summaryrefslogtreecommitdiff
path: root/libjava/classpath
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-09 19:58:05 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-09 19:58:05 +0000
commit65bf3316cf384588453604be6b4f0ed3751a8b0f (patch)
tree996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/classpath
parent8fc56618a84446beccd45b80381cdfe0e94050df (diff)
downloadgcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.tar.gz
Merged gcj-eclipse branch to trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath')
-rw-r--r--libjava/classpath/.cdtproject3
-rw-r--r--libjava/classpath/.classpath14
-rw-r--r--libjava/classpath/.cvsignore18
-rw-r--r--libjava/classpath/.externalToolBuilders/Autogen.launch2
-rw-r--r--libjava/classpath/.externalToolBuilders/ClasspathHeaders.launch2
-rw-r--r--libjava/classpath/.externalToolBuilders/ClasspathJar.launch11
-rw-r--r--libjava/classpath/.externalToolBuilders/CompileNative.launch2
-rw-r--r--libjava/classpath/.externalToolBuilders/Configure.launch13
-rw-r--r--libjava/classpath/.externalToolBuilders/CreateLocaleData.launch12
-rw-r--r--libjava/classpath/.project77
-rw-r--r--libjava/classpath/.settings/org.eclipse.jdt.core.prefs243
-rw-r--r--libjava/classpath/.settings/org.eclipse.jdt.ui.prefs12
-rw-r--r--libjava/classpath/AUTHORS13
-rw-r--r--libjava/classpath/ChangeLog12569
-rw-r--r--libjava/classpath/ChangeLog-20041068
-rw-r--r--libjava/classpath/ChangeLog-20052660
-rw-r--r--libjava/classpath/ChangeLog.gcj200
-rw-r--r--libjava/classpath/ChangeLog.usermap60
-rw-r--r--libjava/classpath/INSTALL15
-rw-r--r--libjava/classpath/LICENSE14
-rw-r--r--libjava/classpath/Makefile.in11
-rw-r--r--libjava/classpath/NEWS55
-rw-r--r--libjava/classpath/aclocal.m42
-rwxr-xr-xlibjava/classpath/compile142
-rwxr-xr-xlibjava/classpath/config.guess664
-rwxr-xr-xlibjava/classpath/config.sub218
-rwxr-xr-xlibjava/classpath/configure2502
-rw-r--r--libjava/classpath/configure.ac154
-rw-r--r--libjava/classpath/doc/.cvsignore13
-rw-r--r--libjava/classpath/doc/Makefile.in11
-rw-r--r--libjava/classpath/doc/api/.cvsignore2
-rw-r--r--libjava/classpath/doc/api/Makefile.am2
-rw-r--r--libjava/classpath/doc/api/Makefile.in41
-rw-r--r--libjava/classpath/doc/vmintegration.texinfo130
-rw-r--r--libjava/classpath/examples/.cvsignore6
-rw-r--r--libjava/classpath/examples/Makefile.am27
-rw-r--r--libjava/classpath/examples/Makefile.in36
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/CORBA/NamingService/Demo.java3
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/awt/aicas.pngbin0 -> 2320 bytes
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/awt/palme.gifbin0 -> 502 bytes
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/icons/back.pngbin0 -> 828 bytes
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/icons/reload.pngbin0 -> 1324 bytes
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/java2d/aicas.pngbin0 -> 2320 bytes
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/java2d/palme.gifbin0 -> 502 bytes
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/BrowserEditorKit.java57
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/ClasspathSwingActivityBoard.launch19
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/Demo.java96
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/HtmlDemo.java392
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/TabbedPaneDemo.java145
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/TreeDemo.java35
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/forms.html98
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/frame1.html41
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/frame2.html42
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/frame3.html42
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/frame4.html41
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/frames.html44
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/tables.html66
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/textstyles.html78
-rw-r--r--libjava/classpath/examples/gnu/classpath/examples/swing/welcome.html63
-rw-r--r--libjava/classpath/external/.cvsignore2
-rw-r--r--libjava/classpath/external/Makefile.am2
-rw-r--r--libjava/classpath/external/Makefile.in13
-rw-r--r--libjava/classpath/external/jsr166/.cvsignore1
-rw-r--r--libjava/classpath/external/jsr166/IMPORTING31
-rw-r--r--libjava/classpath/external/jsr166/Makefile.am74
-rw-r--r--libjava/classpath/external/jsr166/Makefile.in522
-rw-r--r--libjava/classpath/external/jsr166/java/util/AbstractQueue.java166
-rw-r--r--libjava/classpath/external/jsr166/java/util/ArrayDeque.java839
-rw-r--r--libjava/classpath/external/jsr166/java/util/Deque.java547
-rw-r--r--libjava/classpath/external/jsr166/java/util/NavigableMap.java395
-rw-r--r--libjava/classpath/external/jsr166/java/util/NavigableSet.java290
-rw-r--r--libjava/classpath/external/jsr166/java/util/Queue.java189
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/AbstractExecutorService.java270
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ArrayBlockingQueue.java778
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/BlockingDeque.java613
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/BlockingQueue.java344
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/BrokenBarrierException.java38
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/Callable.java36
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/CancellationException.java34
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/CompletionService.java97
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentHashMap.java1277
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentLinkedQueue.java480
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentMap.java134
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentNavigableMap.java148
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentSkipListMap.java3114
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentSkipListSet.java456
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/CopyOnWriteArraySet.java364
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/CountDownLatch.java290
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/CyclicBarrier.java454
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/DelayQueue.java487
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/Delayed.java33
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/Exchanger.java656
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ExecutionException.java65
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/Executor.java112
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ExecutorCompletionService.java174
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ExecutorService.java306
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/Executors.java666
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/Future.java142
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/FutureTask.java325
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/LinkedBlockingDeque.java1021
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/LinkedBlockingQueue.java807
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/PriorityBlockingQueue.java563
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/RejectedExecutionException.java62
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/RejectedExecutionHandler.java33
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/RunnableFuture.java25
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/RunnableScheduledFuture.java29
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ScheduledExecutorService.java159
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ScheduledFuture.java19
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ScheduledThreadPoolExecutor.java626
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/Semaphore.java681
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/SynchronousQueue.java1127
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ThreadFactory.java40
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/ThreadPoolExecutor.java1605
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/TimeUnit.java331
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/TimeoutException.java38
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicBoolean.java133
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicInteger.java234
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerArray.java255
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java316
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLong.java248
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLongArray.java255
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLongFieldUpdater.java406
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicMarkableReference.java161
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReference.java124
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReferenceArray.java163
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java275
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicStampedReference.java165
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/atomic/package.html158
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/locks/AbstractOwnableSynchronizer.java57
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java1934
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/locks/AbstractQueuedSynchronizer.java2159
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/locks/Condition.java435
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/locks/Lock.java327
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/locks/LockSupport.java352
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/locks/ReadWriteLock.java104
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/locks/ReentrantLock.java740
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/locks/ReentrantReadWriteLock.java1346
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/locks/package.html50
-rw-r--r--libjava/classpath/external/jsr166/java/util/concurrent/package.html222
-rw-r--r--libjava/classpath/external/jsr166/readme45
-rw-r--r--libjava/classpath/external/relaxngDatatype/.cvsignore2
-rw-r--r--libjava/classpath/external/relaxngDatatype/Makefile.in11
-rw-r--r--libjava/classpath/external/sax/.cvsignore2
-rw-r--r--libjava/classpath/external/sax/Makefile.in11
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/AttributeList.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/Attributes.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/ContentHandler.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/DTDHandler.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/DocumentHandler.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/EntityResolver.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/ErrorHandler.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/HandlerBase.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/InputSource.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/Locator.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/Parser.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/SAXException.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/SAXNotRecognizedException.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/SAXNotSupportedException.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/SAXParseException.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/XMLFilter.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/XMLReader.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/ext/Attributes2.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/ext/Attributes2Impl.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/ext/DeclHandler.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/ext/DefaultHandler2.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/ext/EntityResolver2.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/ext/LexicalHandler.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/ext/Locator2.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/ext/Locator2Impl.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/ext/package.html2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/helpers/AttributeListImpl.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/helpers/AttributesImpl.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/helpers/DefaultHandler.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/helpers/LocatorImpl.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/helpers/NamespaceSupport.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/helpers/NewInstance.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/helpers/ParserAdapter.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/helpers/ParserFactory.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/helpers/XMLFilterImpl.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderFactory.java2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/helpers/package.html2
-rw-r--r--libjava/classpath/external/sax/org/xml/sax/package.html2
-rw-r--r--libjava/classpath/external/w3c_dom/.cvsignore2
-rw-r--r--libjava/classpath/external/w3c_dom/COPYRIGHT.html106
-rw-r--r--libjava/classpath/external/w3c_dom/Makefile.in11
-rw-r--r--libjava/classpath/gnu/CORBA/CDR/Vio.java5
-rw-r--r--libjava/classpath/gnu/CORBA/CollocatedOrbs.java164
-rw-r--r--libjava/classpath/gnu/CORBA/Connected_objects.java10
-rw-r--r--libjava/classpath/gnu/CORBA/NamingService/Binding_iterator_impl.java6
-rw-r--r--libjava/classpath/gnu/CORBA/NamingService/Ext.java6
-rw-r--r--libjava/classpath/gnu/CORBA/NamingService/NameParser.java3
-rw-r--r--libjava/classpath/gnu/CORBA/NamingService/NameTransformer.java6
-rw-r--r--libjava/classpath/gnu/CORBA/NamingService/NamingServiceTransient.java42
-rw-r--r--libjava/classpath/gnu/CORBA/NamingService/TransientContext.java4
-rw-r--r--libjava/classpath/gnu/CORBA/OrbFunctional.java122
-rw-r--r--libjava/classpath/gnu/CORBA/Poa/LocalRequest.java7
-rw-r--r--libjava/classpath/gnu/CORBA/Poa/ORB_1_4.java2
-rw-r--r--libjava/classpath/gnu/CORBA/Poa/gnuPOA.java4
-rw-r--r--libjava/classpath/gnu/CORBA/Poa/gnuServantObject.java15
-rw-r--r--libjava/classpath/gnu/CORBA/SafeForDirectCalls.java50
-rw-r--r--libjava/classpath/gnu/CORBA/SimpleDelegate.java40
-rw-r--r--libjava/classpath/gnu/classpath/.cvsignore1
-rw-r--r--libjava/classpath/gnu/classpath/ListenerData.java136
-rw-r--r--libjava/classpath/gnu/classpath/SystemProperties.java1
-rw-r--r--libjava/classpath/gnu/classpath/debug/Component.java7
-rw-r--r--libjava/classpath/gnu/classpath/debug/SystemLogger.java41
-rw-r--r--libjava/classpath/gnu/java/awt/ComponentReshapeEvent.java85
-rw-r--r--libjava/classpath/gnu/java/awt/LowPriorityEvent.java48
-rw-r--r--libjava/classpath/gnu/java/awt/color/PyccConverter.java9
-rw-r--r--libjava/classpath/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java12
-rw-r--r--libjava/classpath/gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.java6
-rw-r--r--libjava/classpath/gnu/java/awt/font/autofit/AxisHints.java45
-rw-r--r--libjava/classpath/gnu/java/awt/font/autofit/Constants.java61
-rw-r--r--libjava/classpath/gnu/java/awt/font/autofit/GlyphHints.java75
-rw-r--r--libjava/classpath/gnu/java/awt/font/autofit/Latin.java177
-rw-r--r--libjava/classpath/gnu/java/awt/font/autofit/LatinAxis.java53
-rw-r--r--libjava/classpath/gnu/java/awt/font/autofit/LatinMetrics.java51
-rw-r--r--libjava/classpath/gnu/java/awt/font/autofit/Scaler.java52
-rw-r--r--libjava/classpath/gnu/java/awt/font/autofit/Script.java62
-rw-r--r--libjava/classpath/gnu/java/awt/font/autofit/ScriptMetrics.java49
-rw-r--r--libjava/classpath/gnu/java/awt/font/autofit/Segment.java47
-rw-r--r--libjava/classpath/gnu/java/awt/font/autofit/Width.java46
-rw-r--r--libjava/classpath/gnu/java/awt/font/opentype/CharGlyphMap.java2
-rw-r--r--libjava/classpath/gnu/java/awt/font/opentype/OpenTypeFont.java17
-rw-r--r--libjava/classpath/gnu/java/awt/font/opentype/Scaler.java12
-rw-r--r--libjava/classpath/gnu/java/awt/font/opentype/truetype/GlyphLoader.java5
-rw-r--r--libjava/classpath/gnu/java/awt/font/opentype/truetype/TrueTypeScaler.java6
-rw-r--r--libjava/classpath/gnu/java/awt/font/opentype/truetype/Zone.java2
-rw-r--r--libjava/classpath/gnu/java/awt/java2d/AbstractGraphics2D.java181
-rw-r--r--libjava/classpath/gnu/java/awt/java2d/QuadSegment.java69
-rw-r--r--libjava/classpath/gnu/java/awt/java2d/ShapeCache.java85
-rw-r--r--libjava/classpath/gnu/java/awt/java2d/TexturePaintContext.java8
-rw-r--r--libjava/classpath/gnu/java/awt/peer/ClasspathFontPeer.java14
-rw-r--r--libjava/classpath/gnu/java/awt/peer/GLightweightPeer.java247
-rw-r--r--libjava/classpath/gnu/java/awt/peer/NativeEventLoopRunningEvent.java58
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/AsyncImage.java283
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/BufferedImageGraphics.java405
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java509
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/CairoSurface.java130
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java216
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java283
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java149
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GdkFontMetrics.java143
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java229
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java8
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GtkChoicePeer.java2
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java73
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java22
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GtkImageConsumer.java43
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GtkMainThread.java190
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java112
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GtkVolatileImage.java45
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java78
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/VolatileImageGraphics.java209
-rw-r--r--libjava/classpath/gnu/java/awt/peer/headless/HeadlessGraphicsEnvironment.java118
-rw-r--r--libjava/classpath/gnu/java/awt/peer/headless/HeadlessToolkit.java371
-rw-r--r--libjava/classpath/gnu/java/awt/peer/qt/QtFontPeer.java11
-rw-r--r--libjava/classpath/gnu/java/awt/peer/qt/QtGraphics.java7
-rw-r--r--libjava/classpath/gnu/java/awt/peer/swing/SwingButtonPeer.java22
-rw-r--r--libjava/classpath/gnu/java/awt/peer/swing/SwingComponent.java6
-rw-r--r--libjava/classpath/gnu/java/awt/peer/swing/SwingComponentPeer.java156
-rw-r--r--libjava/classpath/gnu/java/awt/peer/swing/SwingContainerPeer.java209
-rw-r--r--libjava/classpath/gnu/java/awt/peer/swing/SwingFramePeer.java11
-rw-r--r--libjava/classpath/gnu/java/awt/peer/swing/SwingLabelPeer.java48
-rw-r--r--libjava/classpath/gnu/java/awt/peer/swing/SwingListPeer.java352
-rw-r--r--libjava/classpath/gnu/java/awt/peer/swing/SwingMenuBarPeer.java2
-rw-r--r--libjava/classpath/gnu/java/awt/peer/swing/SwingPanelPeer.java4
-rw-r--r--libjava/classpath/gnu/java/awt/peer/swing/SwingTextAreaPeer.java317
-rw-r--r--libjava/classpath/gnu/java/awt/peer/swing/SwingTextFieldPeer.java32
-rw-r--r--libjava/classpath/gnu/java/awt/peer/swing/SwingWindowPeer.java8
-rw-r--r--libjava/classpath/gnu/java/awt/peer/x/XFontPeer.java7
-rw-r--r--libjava/classpath/gnu/java/awt/peer/x/XFontPeer2.java6
-rw-r--r--libjava/classpath/gnu/java/io/ObjectIdentityMap2Int.java292
-rw-r--r--libjava/classpath/gnu/java/io/class-dependencies.conf75
-rw-r--r--libjava/classpath/gnu/java/lang/InstrumentationImpl.java16
-rw-r--r--libjava/classpath/gnu/java/lang/management/BeanImpl.java437
-rw-r--r--libjava/classpath/gnu/java/lang/management/MemoryMXBeanImpl.java45
-rw-r--r--libjava/classpath/gnu/java/lang/management/MemoryPoolMXBeanImpl.java6
-rw-r--r--libjava/classpath/gnu/java/lang/reflect/ClassSignatureParser.java2
-rw-r--r--libjava/classpath/gnu/java/lang/reflect/GenericSignatureParser.java17
-rw-r--r--libjava/classpath/gnu/java/lang/reflect/MethodSignatureParser.java4
-rw-r--r--libjava/classpath/gnu/java/locale/.cvsignore1
-rw-r--r--libjava/classpath/gnu/java/net/DefaultProxySelector.java80
-rw-r--r--libjava/classpath/gnu/java/net/PlainDatagramSocketImpl.java252
-rw-r--r--libjava/classpath/gnu/java/net/PlainSocketImpl.java376
-rw-r--r--libjava/classpath/gnu/java/net/local/LocalSocketImpl.java7
-rw-r--r--libjava/classpath/gnu/java/net/protocol/http/HTTPConnection.java50
-rw-r--r--libjava/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java40
-rw-r--r--libjava/classpath/gnu/java/net/protocol/jar/Handler.java46
-rw-r--r--libjava/classpath/gnu/java/nio/DatagramChannelImpl.java165
-rw-r--r--libjava/classpath/gnu/java/nio/DatagramChannelSelectionKey.java13
-rw-r--r--libjava/classpath/gnu/java/nio/EpollSelectionKeyImpl.java122
-rw-r--r--libjava/classpath/gnu/java/nio/EpollSelectorImpl.java399
-rw-r--r--libjava/classpath/gnu/java/nio/FileChannelImpl.java572
-rw-r--r--libjava/classpath/gnu/java/nio/FileLockImpl.java2
-rw-r--r--libjava/classpath/gnu/java/nio/KqueueSelectionKeyImpl.java189
-rw-r--r--libjava/classpath/gnu/java/nio/KqueueSelectorImpl.java527
-rw-r--r--libjava/classpath/gnu/java/nio/NIOSocket.java29
-rw-r--r--libjava/classpath/gnu/java/nio/NIOSocketImpl.java110
-rw-r--r--libjava/classpath/gnu/java/nio/PipeImpl.java34
-rw-r--r--libjava/classpath/gnu/java/nio/SelectionKeyImpl.java1
-rw-r--r--libjava/classpath/gnu/java/nio/SelectorImpl.java20
-rw-r--r--libjava/classpath/gnu/java/nio/SelectorProviderImpl.java37
-rw-r--r--libjava/classpath/gnu/java/nio/ServerSocketChannelImpl.java39
-rw-r--r--libjava/classpath/gnu/java/nio/ServerSocketChannelSelectionKey.java13
-rw-r--r--libjava/classpath/gnu/java/nio/SocketChannelImpl.java262
-rw-r--r--libjava/classpath/gnu/java/nio/SocketChannelSelectionKey.java13
-rw-r--r--libjava/classpath/gnu/java/nio/SocketChannelSelectionKeyImpl.java11
-rw-r--r--libjava/classpath/gnu/java/nio/VMChannelOwner.java57
-rw-r--r--libjava/classpath/gnu/java/nio/channels/FileChannelImpl.java553
-rw-r--r--libjava/classpath/gnu/java/rmi/server/ActivatableRef.java8
-rw-r--r--libjava/classpath/gnu/java/rmi/server/RMIClassLoaderImpl.java67
-rw-r--r--libjava/classpath/gnu/java/rmi/server/RMIObjectInputStream.java61
-rw-r--r--libjava/classpath/gnu/java/security/.cvsignore1
-rw-r--r--libjava/classpath/gnu/java/security/Engine.java174
-rw-r--r--libjava/classpath/gnu/java/security/Requires.java59
-rw-r--r--libjava/classpath/gnu/java/security/action/GetPropertyAction.java4
-rw-r--r--libjava/classpath/gnu/java/security/action/GetSecurityPropertyAction.java4
-rw-r--r--libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairRawCodec.java4
-rw-r--r--libjava/classpath/gnu/java/security/util/ByteBufferOutputStream.java118
-rw-r--r--libjava/classpath/gnu/java/util/DoubleEnumeration.java12
-rw-r--r--libjava/classpath/gnu/java/util/prefs/GConfBasedPreferences.java27
-rw-r--r--libjava/classpath/gnu/java/util/prefs/gconf/GConfNativePeer.java53
-rw-r--r--libjava/classpath/gnu/java/util/regex/CharIndexed.java17
-rw-r--r--libjava/classpath/gnu/java/util/regex/CharIndexedCharSequence.java13
-rw-r--r--libjava/classpath/gnu/java/util/regex/CharIndexedInputStream.java14
-rw-r--r--libjava/classpath/gnu/java/util/regex/RE.java34
-rw-r--r--libjava/classpath/gnu/java/util/regex/REMatch.java4
-rw-r--r--libjava/classpath/gnu/java/util/regex/RESyntax.java11
-rw-r--r--libjava/classpath/gnu/java/util/regex/REToken.java15
-rw-r--r--libjava/classpath/gnu/java/util/regex/RETokenChar.java12
-rw-r--r--libjava/classpath/gnu/java/util/regex/RETokenEnd.java15
-rw-r--r--libjava/classpath/gnu/java/util/regex/RETokenEndSub.java4
-rw-r--r--libjava/classpath/gnu/java/util/regex/RETokenNamedProperty.java8
-rw-r--r--libjava/classpath/gnu/java/util/regex/RETokenOneOf.java1
-rw-r--r--libjava/classpath/gnu/java/util/regex/RETokenRepeated.java199
-rw-r--r--libjava/classpath/gnu/javax/crypto/RSACipherImpl.java67
-rw-r--r--libjava/classpath/gnu/javax/crypto/jce/cipher/CipherAdapter.java39
-rw-r--r--libjava/classpath/gnu/javax/crypto/key/GnuPBEKey.java95
-rw-r--r--libjava/classpath/gnu/javax/crypto/pad/PKCS7.java4
-rw-r--r--libjava/classpath/gnu/javax/management/Server.java2200
-rw-r--r--libjava/classpath/gnu/javax/naming/giop/ContextContinuation.java956
-rw-r--r--libjava/classpath/gnu/javax/naming/giop/CorbalocParser.java439
-rw-r--r--libjava/classpath/gnu/javax/naming/giop/GiopNamingEnumeration.java187
-rw-r--r--libjava/classpath/gnu/javax/naming/giop/GiopNamingServiceFactory.java177
-rw-r--r--libjava/classpath/gnu/javax/naming/giop/GiopNamingServiceURLContext.java840
-rw-r--r--libjava/classpath/gnu/javax/naming/giop/ListBindingsEnumeration.java116
-rw-r--r--libjava/classpath/gnu/javax/naming/giop/ListEnumeration.java116
-rw-r--r--libjava/classpath/gnu/javax/naming/ictxImpl/trans/GnuName.java467
-rw-r--r--libjava/classpath/gnu/javax/naming/jndi/url/corbaname/corbanameURLContextFactory.java53
-rw-r--r--libjava/classpath/gnu/javax/naming/jndi/url/rmi/ContextContinuation.java597
-rw-r--r--libjava/classpath/gnu/javax/naming/jndi/url/rmi/ListBindingsEnumeration.java97
-rw-r--r--libjava/classpath/gnu/javax/naming/jndi/url/rmi/ListEnumeration.java80
-rw-r--r--libjava/classpath/gnu/javax/naming/jndi/url/rmi/RmiContinuation.java594
-rw-r--r--libjava/classpath/gnu/javax/naming/jndi/url/rmi/RmiNamingEnumeration.java130
-rw-r--r--libjava/classpath/gnu/javax/naming/jndi/url/rmi/rmiURLContext.java637
-rw-r--r--libjava/classpath/gnu/javax/naming/jndi/url/rmi/rmiURLContextFactory.java66
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/AbstractSessionContext.java288
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/PreSharedKeyManager.java54
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/PreSharedKeyManagerParameters.java83
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/PrivateCredentials.java16
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/SSLCipherSuite.java142
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/SSLProtocolVersion.java54
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/SSLRecordHandler.java101
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/Session.java364
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/SessionStoreException.java59
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/AbstractHandshake.java1205
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Alert.java422
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/AlertException.java37
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Builder.java66
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Certificate.java205
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/CertificateBuilder.java94
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/CertificateRequest.java226
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/CertificateRequestBuilder.java113
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/CertificateStatusRequest.java272
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/CertificateStatusType.java13
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/CertificateType.java56
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/CertificateURL.java388
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/CertificateVerify.java54
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/CipherAlgorithm.java47
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/CipherSuite.java1193
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/CipherSuiteList.java283
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ClientCertificateTypeList.java227
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ClientDHE_PSKParameters.java122
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ClientDiffieHellmanPublic.java129
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ClientHandshake.java1150
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ClientHello.java315
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ClientHelloBuilder.java137
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ClientHelloV2.java158
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ClientKeyExchange.java163
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ClientKeyExchangeBuilder.java75
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ClientPSKParameters.java125
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ClientRSA_PSKParameters.java126
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/CompressionMethod.java51
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/CompressionMethodList.java281
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Constructed.java47
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ContentType.java72
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Context.java334
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Debug.java66
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/DelegatedTask.java93
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/DiffieHellman.java6
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/DigestInputStream.java103
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/DigestOutputStream.java107
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/EmptyExchangeKeys.java77
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/EncryptedPreMasterSecret.java151
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Enumerated.java79
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ExchangeKeys.java54
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Extension.java260
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ExtensionList.java290
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Extensions.java159
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Finished.java146
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/GNUSecurityParameters.java490
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Handshake.java472
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/HelloRequest.java70
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/InputSecurityParameters.java336
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/JCESecurityParameters.java307
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/JDBCSessionContext.java356
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Jessie.java35
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/JessieDHPrivateKey.java99
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/JessieDHPublicKey.java99
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/JessieRSAPrivateKey.java98
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/JessieRSAPublicKey.java98
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/KeyExchangeAlgorithm.java57
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/KeyPool.java110
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/MacAlgorithm.java47
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/MaxFragmentLength.java59
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/OutputSecurityParameters.java297
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/OverflowException.java57
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/PreSharedKeyManagerFactoryImpl.java118
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ProtocolVersion.java73
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Random.java112
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Record.java198
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/RecordInput.java232
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/RecordInputStream.java106
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/RecordOutputStream.java189
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/RecordingInputStream.java131
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLContextImpl.java315
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLEngineImpl.java842
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLRSASignature.java235
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLRSASignatureImpl.java233
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocket.java283
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocketFactory.java136
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocketFactoryImpl.java108
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocketImpl.java199
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLSocket.java3515
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketFactory.java133
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.java137
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketImpl.java833
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketInputStream.java181
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketOutputStream.java115
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLv3HMacMD5Impl.java116
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SSLv3HMacSHAImpl.java116
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SecurityParameters.java178
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ServerDHE_PSKParameters.java151
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ServerDHParams.java248
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ServerHandshake.java1377
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ServerHello.java271
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ServerHelloBuilder.java131
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ServerHelloDone.java66
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ServerKeyExchange.java311
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ServerKeyExchangeBuilder.java89
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ServerKeyExchangeParams.java50
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ServerNameList.java311
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ServerPSKParameters.java127
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ServerRSAParams.java163
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/ServerRSA_PSKParameters.java62
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Session.java381
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SessionContext.java250
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SessionImpl.java198
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Signature.java140
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SignatureAlgorithm.java62
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SimpleSessionContext.java146
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/SynchronizedRandom.java104
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/TruncatedHMAC.java76
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/TrustedAuthorities.java298
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/UnresolvedExtensionValue.java83
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/Util.java109
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/X500PrincipalList.java272
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/X509KeyManagerFactory.java95
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/X509TrustManagerFactory.java147
-rw-r--r--libjava/classpath/gnu/javax/net/ssl/provider/XMLSessionContext.java619
-rw-r--r--libjava/classpath/gnu/javax/rmi/CORBA/UtilDelegateImpl.java30
-rw-r--r--libjava/classpath/gnu/javax/security/auth/callback/AbstractCallbackHandler.java97
-rw-r--r--libjava/classpath/gnu/javax/security/auth/callback/CertificateCallback.java64
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/css/BorderStyle.java64
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/css/BorderWidth.java78
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/css/CSSColor.java170
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/css/CSSLexicalException.java60
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/css/CSSParser.java500
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/css/CSSParserCallback.java81
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/css/CSSParserException.java62
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/css/CSSScanner.java718
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/css/FontSize.java273
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/css/FontStyle.java80
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/css/FontWeight.java84
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/css/Length.java283
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/css/Selector.java244
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/parser/GnuParserDelegator.java3
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/parser/HTML_401F.java4
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/parser/HTML_401Swing.java91
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/parser/htmlValidator.java5
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/parser/support/Parser.java70
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/parser/support/low/Constants.java11
-rw-r--r--libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java38
-rw-r--r--libjava/classpath/gnu/test/.cvsignore1
-rw-r--r--libjava/classpath/gnu/xml/dom/DomAttr.java2
-rw-r--r--libjava/classpath/gnu/xml/dom/DomNode.java3
-rw-r--r--libjava/classpath/gnu/xml/dom/ls/SAXEventSink.java8
-rw-r--r--libjava/classpath/gnu/xml/stream/SAXParser.java15
-rw-r--r--libjava/classpath/gnu/xml/stream/XMLStreamWriterImpl.java6
-rw-r--r--libjava/classpath/gnu/xml/transform/SAXTemplatesHandler.java97
-rw-r--r--libjava/classpath/gnu/xml/transform/SAXTransformerHandler.java111
-rw-r--r--libjava/classpath/gnu/xml/transform/StreamSerializer.java3
-rw-r--r--libjava/classpath/gnu/xml/transform/TransformerFactoryImpl.java52
-rw-r--r--libjava/classpath/gnu/xml/transform/XSLURIResolver.java21
-rw-r--r--libjava/classpath/gnu/xml/xpath/Expr.java35
-rw-r--r--libjava/classpath/include/.cvsignore9
-rw-r--r--libjava/classpath/include/GtkDragSourceContextPeer.h2
-rw-r--r--libjava/classpath/include/Makefile.am20
-rw-r--r--libjava/classpath/include/Makefile.in31
-rw-r--r--libjava/classpath/include/config.h.in84
-rw-r--r--libjava/classpath/include/gnu_java_awt_peer_gtk_CairoGraphics2D.h18
-rw-r--r--libjava/classpath/include/gnu_java_awt_peer_gtk_CairoSurface.h2
-rw-r--r--libjava/classpath/include/gnu_java_awt_peer_gtk_GdkFontPeer.h16
-rw-r--r--libjava/classpath/include/gnu_java_awt_peer_gtk_GtkChoicePeer.h6
-rw-r--r--libjava/classpath/include/gnu_java_awt_peer_gtk_GtkFramePeer.h4
-rw-r--r--libjava/classpath/include/gnu_java_awt_peer_gtk_GtkToolkit.h3
-rw-r--r--libjava/classpath/include/gnu_java_net_VMPlainDatagramSocketImpl.h30
-rw-r--r--libjava/classpath/include/gnu_java_net_VMPlainSocketImpl.h34
-rw-r--r--libjava/classpath/include/gnu_java_nio_EpollSelectorImpl.h37
-rw-r--r--libjava/classpath/include/gnu_java_nio_FileChannelImpl.h30
-rw-r--r--libjava/classpath/include/gnu_java_nio_KqueueSelectorImpl.h39
-rw-r--r--libjava/classpath/include/gnu_java_nio_VMChannel.h34
-rw-r--r--libjava/classpath/include/gnu_java_nio_VMPipe.h2
-rw-r--r--libjava/classpath/include/gnu_java_nio_channels_FileChannelImpl.h46
-rw-r--r--libjava/classpath/include/gnu_java_util_prefs_gconf_GConfNativePeer.h6
-rw-r--r--libjava/classpath/include/java_net_VMInetAddress.h1
-rw-r--r--libjava/classpath/include/java_net_VMNetworkInterface.h3
-rw-r--r--libjava/classpath/java/applet/AppletContext.java8
-rw-r--r--libjava/classpath/java/awt/AWTEvent.java5
-rw-r--r--libjava/classpath/java/awt/AWTEventMulticaster.java7
-rw-r--r--libjava/classpath/java/awt/AWTKeyStroke.java18
-rw-r--r--libjava/classpath/java/awt/BasicStroke.java164
-rw-r--r--libjava/classpath/java/awt/Button.java6
-rw-r--r--libjava/classpath/java/awt/CardLayout.java25
-rw-r--r--libjava/classpath/java/awt/CheckboxMenuItem.java4
-rw-r--r--libjava/classpath/java/awt/Choice.java27
-rw-r--r--libjava/classpath/java/awt/Color.java33
-rw-r--r--libjava/classpath/java/awt/Component.java824
-rw-r--r--libjava/classpath/java/awt/Container.java346
-rw-r--r--libjava/classpath/java/awt/Dialog.java21
-rw-r--r--libjava/classpath/java/awt/EventQueue.java394
-rw-r--r--libjava/classpath/java/awt/FileDialog.java28
-rw-r--r--libjava/classpath/java/awt/FlowLayout.java5
-rw-r--r--libjava/classpath/java/awt/Font.java34
-rw-r--r--libjava/classpath/java/awt/Frame.java36
-rw-r--r--libjava/classpath/java/awt/Graphics2D.java6
-rw-r--r--libjava/classpath/java/awt/GridBagLayout.java34
-rw-r--r--libjava/classpath/java/awt/GridLayout.java2
-rw-r--r--libjava/classpath/java/awt/KeyboardFocusManager.java16
-rw-r--r--libjava/classpath/java/awt/LightweightDispatcher.java384
-rw-r--r--libjava/classpath/java/awt/List.java1765
-rw-r--r--libjava/classpath/java/awt/Menu.java641
-rw-r--r--libjava/classpath/java/awt/MenuBar.java2
-rw-r--r--libjava/classpath/java/awt/MenuItem.java6
-rw-r--r--libjava/classpath/java/awt/MenuShortcut.java233
-rw-r--r--libjava/classpath/java/awt/Rectangle.java22
-rw-r--r--libjava/classpath/java/awt/RenderingHints.java13
-rw-r--r--libjava/classpath/java/awt/ScrollPane.java62
-rw-r--r--libjava/classpath/java/awt/ScrollPaneAdjustable.java47
-rw-r--r--libjava/classpath/java/awt/Scrollbar.java72
-rw-r--r--libjava/classpath/java/awt/TextArea.java68
-rw-r--r--libjava/classpath/java/awt/TextComponent.java6
-rw-r--r--libjava/classpath/java/awt/TextField.java14
-rw-r--r--libjava/classpath/java/awt/Toolkit.java39
-rw-r--r--libjava/classpath/java/awt/Window.java216
-rw-r--r--libjava/classpath/java/awt/datatransfer/DataFlavor.java291
-rw-r--r--libjava/classpath/java/awt/datatransfer/FlavorMap.java4
-rw-r--r--libjava/classpath/java/awt/datatransfer/FlavorTable.java4
-rw-r--r--libjava/classpath/java/awt/datatransfer/MimeType.java281
-rw-r--r--libjava/classpath/java/awt/datatransfer/SystemFlavorMap.java12
-rw-r--r--libjava/classpath/java/awt/dnd/DragGestureEvent.java14
-rw-r--r--libjava/classpath/java/awt/dnd/DragGestureRecognizer.java16
-rw-r--r--libjava/classpath/java/awt/dnd/DragSource.java36
-rw-r--r--libjava/classpath/java/awt/dnd/DragSourceContext.java46
-rw-r--r--libjava/classpath/java/awt/dnd/DropTarget.java143
-rw-r--r--libjava/classpath/java/awt/dnd/DropTargetContext.java23
-rw-r--r--libjava/classpath/java/awt/dnd/DropTargetDragEvent.java5
-rw-r--r--libjava/classpath/java/awt/dnd/DropTargetDropEvent.java4
-rw-r--r--libjava/classpath/java/awt/dnd/DropTargetEvent.java4
-rw-r--r--libjava/classpath/java/awt/event/ComponentEvent.java39
-rw-r--r--libjava/classpath/java/awt/font/FontRenderContext.java8
-rw-r--r--libjava/classpath/java/awt/font/TextHitInfo.java5
-rw-r--r--libjava/classpath/java/awt/font/TextLayout.java1015
-rw-r--r--libjava/classpath/java/awt/geom/AffineTransform.java16
-rw-r--r--libjava/classpath/java/awt/geom/Arc2D.java44
-rw-r--r--libjava/classpath/java/awt/geom/GeneralPath.java39
-rw-r--r--libjava/classpath/java/awt/geom/RectangularShape.java5
-rw-r--r--libjava/classpath/java/awt/geom/RoundRectangle2D.java415
-rw-r--r--libjava/classpath/java/awt/im/InputContext.java12
-rw-r--r--libjava/classpath/java/awt/im/InputMethodHighlight.java7
-rw-r--r--libjava/classpath/java/awt/im/spi/InputMethodContext.java3
-rw-r--r--libjava/classpath/java/awt/image/AffineTransformOp.java513
-rw-r--r--libjava/classpath/java/awt/image/BandCombineOp.java128
-rw-r--r--libjava/classpath/java/awt/image/BufferedImage.java361
-rw-r--r--libjava/classpath/java/awt/image/ColorConvertOp.java443
-rw-r--r--libjava/classpath/java/awt/image/ColorModel.java40
-rw-r--r--libjava/classpath/java/awt/image/ComponentColorModel.java31
-rw-r--r--libjava/classpath/java/awt/image/ConvolveOp.java131
-rw-r--r--libjava/classpath/java/awt/image/CropImageFilter.java9
-rw-r--r--libjava/classpath/java/awt/image/DirectColorModel.java16
-rw-r--r--libjava/classpath/java/awt/image/ImageConsumer.java2
-rw-r--r--libjava/classpath/java/awt/image/ImageFilter.java350
-rw-r--r--libjava/classpath/java/awt/image/IndexColorModel.java62
-rw-r--r--libjava/classpath/java/awt/image/LookupOp.java141
-rw-r--r--libjava/classpath/java/awt/image/MemoryImageSource.java76
-rw-r--r--libjava/classpath/java/awt/image/PixelGrabber.java4
-rw-r--r--libjava/classpath/java/awt/image/RGBImageFilter.java416
-rw-r--r--libjava/classpath/java/awt/image/Raster.java7
-rw-r--r--libjava/classpath/java/awt/image/RenderedImage.java2
-rw-r--r--libjava/classpath/java/awt/image/ReplicateScaleFilter.java153
-rw-r--r--libjava/classpath/java/awt/image/RescaleOp.java293
-rw-r--r--libjava/classpath/java/awt/image/SampleModel.java29
-rw-r--r--libjava/classpath/java/awt/image/SinglePixelPackedSampleModel.java121
-rw-r--r--libjava/classpath/java/awt/image/WritableRaster.java24
-rw-r--r--libjava/classpath/java/awt/image/renderable/ParameterBlock.java24
-rw-r--r--libjava/classpath/java/awt/image/renderable/RenderableImage.java2
-rw-r--r--libjava/classpath/java/awt/image/renderable/RenderableImageOp.java2
-rw-r--r--libjava/classpath/java/beans/BeanDescriptor.java12
-rw-r--r--libjava/classpath/java/beans/Beans.java4
-rw-r--r--libjava/classpath/java/beans/DefaultPersistenceDelegate.java4
-rw-r--r--libjava/classpath/java/beans/DesignMode.java84
-rw-r--r--libjava/classpath/java/beans/Encoder.java5
-rw-r--r--libjava/classpath/java/beans/EventHandler.java18
-rw-r--r--libjava/classpath/java/beans/EventSetDescriptor.java20
-rw-r--r--libjava/classpath/java/beans/FeatureDescriptor.java6
-rw-r--r--libjava/classpath/java/beans/IndexedPropertyDescriptor.java8
-rw-r--r--libjava/classpath/java/beans/Introspector.java13
-rw-r--r--libjava/classpath/java/beans/PersistenceDelegate.java4
-rw-r--r--libjava/classpath/java/beans/PropertyDescriptor.java18
-rw-r--r--libjava/classpath/java/beans/PropertyEditorManager.java7
-rw-r--r--libjava/classpath/java/beans/SimpleBeanInfo.java15
-rw-r--r--libjava/classpath/java/beans/Statement.java22
-rw-r--r--libjava/classpath/java/beans/beancontext/BeanContextServicesSupport.java616
-rw-r--r--libjava/classpath/java/beans/beancontext/BeanContextSupport.java408
-rw-r--r--libjava/classpath/java/io/CharArrayWriter.java6
-rw-r--r--libjava/classpath/java/io/DeleteFileHelper.java13
-rw-r--r--libjava/classpath/java/io/File.java107
-rw-r--r--libjava/classpath/java/io/FileDescriptor.java7
-rw-r--r--libjava/classpath/java/io/FileInputStream.java20
-rw-r--r--libjava/classpath/java/io/FileOutputStream.java26
-rw-r--r--libjava/classpath/java/io/InputStreamReader.java62
-rw-r--r--libjava/classpath/java/io/ObjectInputStream.java136
-rw-r--r--libjava/classpath/java/io/ObjectOutputStream.java365
-rw-r--r--libjava/classpath/java/io/ObjectStreamClass.java463
-rw-r--r--libjava/classpath/java/io/ObjectStreamField.java47
-rw-r--r--libjava/classpath/java/io/OutputStreamWriter.java6
-rw-r--r--libjava/classpath/java/io/PipedInputStream.java4
-rw-r--r--libjava/classpath/java/io/PipedReader.java4
-rw-r--r--libjava/classpath/java/io/PrintStream.java56
-rw-r--r--libjava/classpath/java/io/PrintWriter.java52
-rw-r--r--libjava/classpath/java/io/RandomAccessFile.java19
-rw-r--r--libjava/classpath/java/io/Reader.java19
-rw-r--r--libjava/classpath/java/io/SequenceInputStream.java26
-rw-r--r--libjava/classpath/java/io/StringWriter.java21
-rw-r--r--libjava/classpath/java/io/Writer.java23
-rw-r--r--libjava/classpath/java/io/class-dependencies.conf100
-rw-r--r--libjava/classpath/java/lang/Boolean.java16
-rw-r--r--libjava/classpath/java/lang/Byte.java34
-rw-r--r--libjava/classpath/java/lang/Character.java246
-rw-r--r--libjava/classpath/java/lang/Class.java136
-rw-r--r--libjava/classpath/java/lang/ClassLoader.java71
-rw-r--r--libjava/classpath/java/lang/Comparable.java8
-rw-r--r--libjava/classpath/java/lang/Compiler.java2
-rw-r--r--libjava/classpath/java/lang/Deprecated.java56
-rw-r--r--libjava/classpath/java/lang/Double.java27
-rw-r--r--libjava/classpath/java/lang/Enum.java43
-rw-r--r--libjava/classpath/java/lang/EnumConstantNotPresentException.java7
-rw-r--r--libjava/classpath/java/lang/Float.java27
-rw-r--r--libjava/classpath/java/lang/InheritableThreadLocal.java19
-rw-r--r--libjava/classpath/java/lang/Integer.java23
-rw-r--r--libjava/classpath/java/lang/Iterable.java4
-rw-r--r--libjava/classpath/java/lang/Long.java25
-rw-r--r--libjava/classpath/java/lang/Object.java2
-rw-r--r--libjava/classpath/java/lang/Override.java56
-rw-r--r--libjava/classpath/java/lang/Package.java14
-rw-r--r--libjava/classpath/java/lang/ProcessBuilder.java337
-rw-r--r--libjava/classpath/java/lang/SecurityManager.java6
-rw-r--r--libjava/classpath/java/lang/Short.java33
-rw-r--r--libjava/classpath/java/lang/StrictMath.java226
-rw-r--r--libjava/classpath/java/lang/String.java48
-rw-r--r--libjava/classpath/java/lang/StringBuffer.java120
-rw-r--r--libjava/classpath/java/lang/StringBuilder.java3
-rw-r--r--libjava/classpath/java/lang/SuppressWarnings.java69
-rw-r--r--libjava/classpath/java/lang/System.java488
-rw-r--r--libjava/classpath/java/lang/Thread.java93
-rw-r--r--libjava/classpath/java/lang/ThreadLocal.java24
-rw-r--r--libjava/classpath/java/lang/Void.java6
-rw-r--r--libjava/classpath/java/lang/annotation/Annotation.java3
-rw-r--r--libjava/classpath/java/lang/annotation/Documented.java50
-rw-r--r--libjava/classpath/java/lang/annotation/ElementType.java59
-rw-r--r--libjava/classpath/java/lang/annotation/IncompleteAnnotationException.java7
-rw-r--r--libjava/classpath/java/lang/annotation/Inherited.java51
-rw-r--r--libjava/classpath/java/lang/annotation/Retention.java59
-rw-r--r--libjava/classpath/java/lang/annotation/RetentionPolicy.java66
-rw-r--r--libjava/classpath/java/lang/annotation/Target.java52
-rw-r--r--libjava/classpath/java/lang/class-dependencies.conf58
-rw-r--r--libjava/classpath/java/lang/instrument/ClassDefinition.java6
-rw-r--r--libjava/classpath/java/lang/instrument/ClassFileTransformer.java3
-rw-r--r--libjava/classpath/java/lang/management/ManagementFactory.java233
-rw-r--r--libjava/classpath/java/lang/management/MemoryPoolMXBean.java2
-rw-r--r--libjava/classpath/java/lang/management/MemoryType.java51
-rw-r--r--libjava/classpath/java/lang/management/RuntimeMXBean.java4
-rw-r--r--libjava/classpath/java/lang/management/ThreadInfo.java26
-rw-r--r--libjava/classpath/java/lang/ref/PhantomReference.java10
-rw-r--r--libjava/classpath/java/lang/ref/Reference.java23
-rw-r--r--libjava/classpath/java/lang/ref/ReferenceQueue.java65
-rw-r--r--libjava/classpath/java/lang/ref/SoftReference.java12
-rw-r--r--libjava/classpath/java/lang/ref/WeakReference.java10
-rw-r--r--libjava/classpath/java/lang/reflect/AccessibleObject.java6
-rw-r--r--libjava/classpath/java/lang/reflect/AnnotatedElement.java6
-rw-r--r--libjava/classpath/java/lang/reflect/Array.java4
-rw-r--r--libjava/classpath/java/lang/reflect/GenericDeclaration.java3
-rw-r--r--libjava/classpath/java/lang/reflect/Proxy.java10
-rw-r--r--libjava/classpath/java/lang/reflect/TypeVariable.java7
-rw-r--r--libjava/classpath/java/math/BigDecimal.java67
-rw-r--r--libjava/classpath/java/math/BigInteger.java78
-rw-r--r--libjava/classpath/java/math/MathContext.java64
-rw-r--r--libjava/classpath/java/math/RoundingMode.java89
-rw-r--r--libjava/classpath/java/math/class-dependencies.conf58
-rw-r--r--libjava/classpath/java/net/DatagramSocket.java43
-rw-r--r--libjava/classpath/java/net/Inet6Address.java2
-rw-r--r--libjava/classpath/java/net/InetAddress.java8
-rw-r--r--libjava/classpath/java/net/MulticastSocket.java46
-rw-r--r--libjava/classpath/java/net/NetworkInterface.java172
-rw-r--r--libjava/classpath/java/net/Proxy.java137
-rw-r--r--libjava/classpath/java/net/ProxySelector.java117
-rw-r--r--libjava/classpath/java/net/ServerSocket.java109
-rw-r--r--libjava/classpath/java/net/Socket.java118
-rw-r--r--libjava/classpath/java/net/URI.java10
-rw-r--r--libjava/classpath/java/net/URL.java32
-rw-r--r--libjava/classpath/java/net/URLClassLoader.java6
-rw-r--r--libjava/classpath/java/net/URLConnection.java66
-rw-r--r--libjava/classpath/java/net/class-dependencies.conf122
-rw-r--r--libjava/classpath/java/nio/ByteBuffer.java10
-rw-r--r--libjava/classpath/java/nio/CharBuffer.java45
-rw-r--r--libjava/classpath/java/nio/DirectByteBufferImpl.java2
-rw-r--r--libjava/classpath/java/nio/DoubleBuffer.java10
-rw-r--r--libjava/classpath/java/nio/FloatBuffer.java10
-rw-r--r--libjava/classpath/java/nio/IntBuffer.java10
-rw-r--r--libjava/classpath/java/nio/LongBuffer.java10
-rw-r--r--libjava/classpath/java/nio/ShortBuffer.java10
-rw-r--r--libjava/classpath/java/nio/channels/Channel.java5
-rw-r--r--libjava/classpath/java/nio/channels/Selector.java4
-rw-r--r--libjava/classpath/java/nio/channels/spi/AbstractSelectableChannel.java15
-rw-r--r--libjava/classpath/java/nio/channels/spi/AbstractSelector.java8
-rw-r--r--libjava/classpath/java/nio/charset/Charset.java23
-rw-r--r--libjava/classpath/java/nio/charset/spi/CharsetProvider.java4
-rw-r--r--libjava/classpath/java/nio/class-dependencies.conf58
-rw-r--r--libjava/classpath/java/rmi/server/LoaderHandler.java5
-rw-r--r--libjava/classpath/java/rmi/server/RMIClassLoader.java17
-rw-r--r--libjava/classpath/java/rmi/server/RMIClassLoaderSpi.java10
-rw-r--r--libjava/classpath/java/security/AccessControlContext.java22
-rw-r--r--libjava/classpath/java/security/AccessController.java12
-rw-r--r--libjava/classpath/java/security/AlgorithmParameterGenerator.java100
-rw-r--r--libjava/classpath/java/security/AlgorithmParameters.java125
-rw-r--r--libjava/classpath/java/security/AlgorithmParametersSpi.java4
-rw-r--r--libjava/classpath/java/security/IdentityScope.java2
-rw-r--r--libjava/classpath/java/security/KeyFactory.java101
-rw-r--r--libjava/classpath/java/security/KeyFactorySpi.java7
-rw-r--r--libjava/classpath/java/security/KeyPairGenerator.java91
-rw-r--r--libjava/classpath/java/security/KeyStore.java134
-rw-r--r--libjava/classpath/java/security/KeyStoreSpi.java2
-rw-r--r--libjava/classpath/java/security/MessageDigest.java121
-rw-r--r--libjava/classpath/java/security/MessageDigestSpi.java19
-rw-r--r--libjava/classpath/java/security/PermissionCollection.java4
-rw-r--r--libjava/classpath/java/security/Permissions.java2
-rw-r--r--libjava/classpath/java/security/PrivilegedAction.java6
-rw-r--r--libjava/classpath/java/security/PrivilegedExceptionAction.java6
-rw-r--r--libjava/classpath/java/security/SecureClassLoader.java55
-rw-r--r--libjava/classpath/java/security/SecureRandom.java126
-rw-r--r--libjava/classpath/java/security/Security.java12
-rw-r--r--libjava/classpath/java/security/Signature.java122
-rw-r--r--libjava/classpath/java/security/SignatureSpi.java19
-rw-r--r--libjava/classpath/java/security/acl/Acl.java4
-rw-r--r--libjava/classpath/java/security/acl/AclEntry.java6
-rw-r--r--libjava/classpath/java/security/acl/Group.java4
-rw-r--r--libjava/classpath/java/security/cert/CertPath.java4
-rw-r--r--libjava/classpath/java/security/cert/CertPathBuilder.java113
-rw-r--r--libjava/classpath/java/security/cert/CertPathValidator.java103
-rw-r--r--libjava/classpath/java/security/cert/CertStore.java121
-rw-r--r--libjava/classpath/java/security/cert/CertStoreSpi.java6
-rw-r--r--libjava/classpath/java/security/cert/CertificateFactory.java136
-rw-r--r--libjava/classpath/java/security/cert/CertificateFactorySpi.java10
-rw-r--r--libjava/classpath/java/security/cert/CollectionCertStoreParameters.java5
-rw-r--r--libjava/classpath/java/security/cert/PKIXBuilderParameters.java4
-rw-r--r--libjava/classpath/java/security/cert/PKIXCertPathChecker.java5
-rw-r--r--libjava/classpath/java/security/cert/PKIXParameters.java19
-rw-r--r--libjava/classpath/java/security/cert/PolicyNode.java12
-rw-r--r--libjava/classpath/java/security/cert/PolicyQualifierInfo.java5
-rw-r--r--libjava/classpath/java/security/cert/X509CRL.java4
-rw-r--r--libjava/classpath/java/security/cert/X509CRLSelector.java5
-rw-r--r--libjava/classpath/java/security/cert/X509CertSelector.java17
-rw-r--r--libjava/classpath/java/security/cert/X509Certificate.java9
-rw-r--r--libjava/classpath/java/security/cert/X509Extension.java6
-rw-r--r--libjava/classpath/java/sql/Array.java13
-rw-r--r--libjava/classpath/java/sql/CallableStatement.java4
-rw-r--r--libjava/classpath/java/sql/Connection.java4
-rw-r--r--libjava/classpath/java/sql/DriverManager.java2
-rw-r--r--libjava/classpath/java/sql/Ref.java2
-rw-r--r--libjava/classpath/java/sql/ResultSet.java6
-rw-r--r--libjava/classpath/java/sql/Struct.java2
-rw-r--r--libjava/classpath/java/sql/Timestamp.java4
-rw-r--r--libjava/classpath/java/text/AttributedCharacterIterator.java29
-rw-r--r--libjava/classpath/java/text/AttributedString.java81
-rw-r--r--libjava/classpath/java/text/AttributedStringIterator.java27
-rw-r--r--libjava/classpath/java/text/Bidi.java3
-rw-r--r--libjava/classpath/java/text/CollationKey.java17
-rw-r--r--libjava/classpath/java/text/Collator.java2
-rw-r--r--libjava/classpath/java/text/DecimalFormat.java3037
-rw-r--r--libjava/classpath/java/text/DecimalFormatSymbols.java4
-rw-r--r--libjava/classpath/java/text/MessageFormat.java2
-rw-r--r--libjava/classpath/java/text/NumberFormat.java21
-rw-r--r--libjava/classpath/java/text/SimpleDateFormat.java20
-rw-r--r--libjava/classpath/java/util/.cvsignore1
-rw-r--r--libjava/classpath/java/util/AbstractCollection.java48
-rw-r--r--libjava/classpath/java/util/AbstractList.java466
-rw-r--r--libjava/classpath/java/util/AbstractMap.java211
-rw-r--r--libjava/classpath/java/util/AbstractSequentialList.java30
-rw-r--r--libjava/classpath/java/util/AbstractSet.java33
-rw-r--r--libjava/classpath/java/util/ArrayList.java55
-rw-r--r--libjava/classpath/java/util/Arrays.java41
-rw-r--r--libjava/classpath/java/util/BitSet.java11
-rw-r--r--libjava/classpath/java/util/Calendar.java61
-rw-r--r--libjava/classpath/java/util/Collection.java22
-rw-r--r--libjava/classpath/java/util/Collections.java2685
-rw-r--r--libjava/classpath/java/util/Comparator.java6
-rw-r--r--libjava/classpath/java/util/Date.java20
-rw-r--r--libjava/classpath/java/util/Dictionary.java14
-rw-r--r--libjava/classpath/java/util/EnumMap.java394
-rw-r--r--libjava/classpath/java/util/EnumSet.java365
-rw-r--r--libjava/classpath/java/util/Enumeration.java7
-rw-r--r--libjava/classpath/java/util/Formatter.java222
-rw-r--r--libjava/classpath/java/util/GregorianCalendar.java3
-rw-r--r--libjava/classpath/java/util/HashMap.java138
-rw-r--r--libjava/classpath/java/util/HashSet.java22
-rw-r--r--libjava/classpath/java/util/Hashtable.java349
-rw-r--r--libjava/classpath/java/util/IdentityHashMap.java288
-rw-r--r--libjava/classpath/java/util/IllegalFormatConversionException.java6
-rw-r--r--libjava/classpath/java/util/Iterator.java6
-rw-r--r--libjava/classpath/java/util/LinkedHashMap.java26
-rw-r--r--libjava/classpath/java/util/LinkedHashSet.java13
-rw-r--r--libjava/classpath/java/util/LinkedList.java191
-rw-r--r--libjava/classpath/java/util/List.java34
-rw-r--r--libjava/classpath/java/util/ListIterator.java12
-rw-r--r--libjava/classpath/java/util/ListResourceBundle.java8
-rw-r--r--libjava/classpath/java/util/Locale.java24
-rw-r--r--libjava/classpath/java/util/Map.java24
-rw-r--r--libjava/classpath/java/util/PriorityQueue.java335
-rw-r--r--libjava/classpath/java/util/Properties.java5
-rw-r--r--libjava/classpath/java/util/PropertyResourceBundle.java10
-rw-r--r--libjava/classpath/java/util/ResourceBundle.java136
-rw-r--r--libjava/classpath/java/util/Set.java19
-rw-r--r--libjava/classpath/java/util/SortedMap.java16
-rw-r--r--libjava/classpath/java/util/SortedSet.java16
-rw-r--r--libjava/classpath/java/util/Stack.java13
-rw-r--r--libjava/classpath/java/util/StringTokenizer.java2
-rw-r--r--libjava/classpath/java/util/Timer.java86
-rw-r--r--libjava/classpath/java/util/TreeMap.java234
-rw-r--r--libjava/classpath/java/util/TreeSet.java73
-rw-r--r--libjava/classpath/java/util/UUID.java13
-rw-r--r--libjava/classpath/java/util/Vector.java84
-rw-r--r--libjava/classpath/java/util/WeakHashMap.java54
-rw-r--r--libjava/classpath/java/util/class-dependencies.conf78
-rw-r--r--libjava/classpath/java/util/concurrent/CopyOnWriteArrayList.java490
-rw-r--r--libjava/classpath/java/util/jar/Attributes.java14
-rw-r--r--libjava/classpath/java/util/jar/JarEntry.java29
-rw-r--r--libjava/classpath/java/util/jar/JarFile.java212
-rw-r--r--libjava/classpath/java/util/jar/Manifest.java10
-rw-r--r--libjava/classpath/java/util/logging/LogManager.java69
-rw-r--r--libjava/classpath/java/util/logging/LoggingMXBean.java2
-rw-r--r--libjava/classpath/java/util/prefs/Preferences.java4
-rw-r--r--libjava/classpath/java/util/regex/Matcher.java27
-rw-r--r--libjava/classpath/java/util/zip/Deflater.java24
-rw-r--r--libjava/classpath/java/util/zip/DeflaterEngine.java6
-rw-r--r--libjava/classpath/java/util/zip/Inflater.java26
-rw-r--r--libjava/classpath/java/util/zip/ZipFile.java137
-rw-r--r--libjava/classpath/javax/accessibility/AccessibleRelationSet.java3
-rw-r--r--libjava/classpath/javax/accessibility/AccessibleStateSet.java2
-rw-r--r--libjava/classpath/javax/crypto/Cipher.java199
-rw-r--r--libjava/classpath/javax/crypto/CipherOutputStream.java180
-rw-r--r--libjava/classpath/javax/crypto/ExemptionMechanism.java117
-rw-r--r--libjava/classpath/javax/crypto/KeyAgreement.java116
-rw-r--r--libjava/classpath/javax/crypto/KeyGenerator.java114
-rw-r--r--libjava/classpath/javax/crypto/Mac.java131
-rw-r--r--libjava/classpath/javax/crypto/MacSpi.java18
-rw-r--r--libjava/classpath/javax/crypto/SecretKeyFactory.java108
-rw-r--r--libjava/classpath/javax/imageio/IIOImage.java13
-rw-r--r--libjava/classpath/javax/imageio/ImageIO.java128
-rw-r--r--libjava/classpath/javax/imageio/ImageReader.java18
-rw-r--r--libjava/classpath/javax/imageio/ImageWriter.java11
-rw-r--r--libjava/classpath/javax/imageio/metadata/IIOMetadataFormat.java6
-rw-r--r--libjava/classpath/javax/imageio/metadata/IIOMetadataFormatImpl.java33
-rw-r--r--libjava/classpath/javax/imageio/spi/IIORegistry.java3
-rw-r--r--libjava/classpath/javax/imageio/spi/IIOServiceProvider.java4
-rw-r--r--libjava/classpath/javax/imageio/spi/ImageInputStreamSpi.java6
-rw-r--r--libjava/classpath/javax/imageio/spi/ImageOutputStreamSpi.java6
-rw-r--r--libjava/classpath/javax/imageio/spi/RegisterableService.java4
-rw-r--r--libjava/classpath/javax/imageio/spi/ServiceRegistry.java47
-rw-r--r--libjava/classpath/javax/management/BadAttributeValueExpException.java91
-rw-r--r--libjava/classpath/javax/management/BadBinaryOpValueExpException.java102
-rw-r--r--libjava/classpath/javax/management/BadStringOperationException.java92
-rw-r--r--libjava/classpath/javax/management/InstanceAlreadyExistsException.java76
-rw-r--r--libjava/classpath/javax/management/InstanceNotFoundException.java76
-rw-r--r--libjava/classpath/javax/management/InvalidApplicationException.java92
-rw-r--r--libjava/classpath/javax/management/MBeanAttributeInfo.java13
-rw-r--r--libjava/classpath/javax/management/MBeanConstructorInfo.java25
-rw-r--r--libjava/classpath/javax/management/MBeanFeatureInfo.java2
-rw-r--r--libjava/classpath/javax/management/MBeanInfo.java23
-rw-r--r--libjava/classpath/javax/management/MBeanOperationInfo.java29
-rw-r--r--libjava/classpath/javax/management/MBeanPermission.java562
-rw-r--r--libjava/classpath/javax/management/MBeanRegistration.java95
-rw-r--r--libjava/classpath/javax/management/MBeanRegistrationException.java84
-rw-r--r--libjava/classpath/javax/management/MBeanServer.java1199
-rw-r--r--libjava/classpath/javax/management/MBeanServerBuilder.java102
-rw-r--r--libjava/classpath/javax/management/MBeanServerConnection.java768
-rw-r--r--libjava/classpath/javax/management/MBeanServerDelegate.java308
-rw-r--r--libjava/classpath/javax/management/MBeanServerDelegateMBean.java101
-rw-r--r--libjava/classpath/javax/management/MBeanServerFactory.java413
-rw-r--r--libjava/classpath/javax/management/MBeanServerNotification.java103
-rw-r--r--libjava/classpath/javax/management/MBeanServerPermission.java470
-rw-r--r--libjava/classpath/javax/management/MBeanTrustPermission.java105
-rw-r--r--libjava/classpath/javax/management/MalformedObjectNameException.java76
-rw-r--r--libjava/classpath/javax/management/ObjectInstance.java147
-rw-r--r--libjava/classpath/javax/management/ObjectName.java775
-rw-r--r--libjava/classpath/javax/management/QueryExp.java87
-rw-r--r--libjava/classpath/javax/management/RuntimeErrorException.java115
-rw-r--r--libjava/classpath/javax/management/RuntimeMBeanException.java114
-rw-r--r--libjava/classpath/javax/management/ServiceNotFoundException.java75
-rw-r--r--libjava/classpath/javax/management/StandardMBean.java32
-rw-r--r--libjava/classpath/javax/management/ValueExp.java86
-rw-r--r--libjava/classpath/javax/management/loading/ClassLoaderRepository.java139
-rw-r--r--libjava/classpath/javax/management/openmbean/InvalidOpenTypeException.java76
-rw-r--r--libjava/classpath/javax/management/openmbean/KeyAlreadyExistsException.java77
-rw-r--r--libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfo.java120
-rw-r--r--libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java546
-rw-r--r--libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfo.java112
-rw-r--r--libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java174
-rw-r--r--libjava/classpath/javax/management/openmbean/OpenMBeanInfo.java154
-rw-r--r--libjava/classpath/javax/management/openmbean/OpenMBeanInfoSupport.java191
-rw-r--r--libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfo.java154
-rw-r--r--libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfoSupport.java240
-rw-r--r--libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfo.java190
-rw-r--r--libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java511
-rw-r--r--libjava/classpath/javax/management/openmbean/OpenType.java6
-rw-r--r--libjava/classpath/javax/management/openmbean/SimpleType.java2
-rw-r--r--libjava/classpath/javax/management/openmbean/TabularData.java45
-rw-r--r--libjava/classpath/javax/management/openmbean/TabularDataSupport.java652
-rw-r--r--libjava/classpath/javax/naming/CannotProceedException.java6
-rw-r--r--libjava/classpath/javax/naming/CompositeName.java4
-rw-r--r--libjava/classpath/javax/naming/CompoundName.java4
-rw-r--r--libjava/classpath/javax/naming/Context.java10
-rw-r--r--libjava/classpath/javax/naming/InitialContext.java20
-rw-r--r--libjava/classpath/javax/naming/Name.java18
-rw-r--r--libjava/classpath/javax/naming/NamingEnumeration.java4
-rw-r--r--libjava/classpath/javax/naming/Reference.java4
-rw-r--r--libjava/classpath/javax/naming/ReferralException.java2
-rw-r--r--libjava/classpath/javax/naming/directory/Attribute.java2
-rw-r--r--libjava/classpath/javax/naming/directory/Attributes.java4
-rw-r--r--libjava/classpath/javax/naming/directory/BasicAttribute.java4
-rw-r--r--libjava/classpath/javax/naming/directory/BasicAttributes.java4
-rw-r--r--libjava/classpath/javax/naming/directory/DirContext.java36
-rw-r--r--libjava/classpath/javax/naming/directory/InitialDirContext.java37
-rw-r--r--libjava/classpath/javax/naming/ldap/ControlFactory.java2
-rw-r--r--libjava/classpath/javax/naming/ldap/InitialLdapContext.java12
-rw-r--r--libjava/classpath/javax/naming/ldap/LdapReferralException.java5
-rw-r--r--libjava/classpath/javax/naming/spi/DirObjectFactory.java2
-rw-r--r--libjava/classpath/javax/naming/spi/DirStateFactory.java2
-rw-r--r--libjava/classpath/javax/naming/spi/DirectoryManager.java4
-rw-r--r--libjava/classpath/javax/naming/spi/InitialContextFactory.java3
-rw-r--r--libjava/classpath/javax/naming/spi/InitialContextFactoryBuilder.java10
-rw-r--r--libjava/classpath/javax/naming/spi/NamingManager.java87
-rw-r--r--libjava/classpath/javax/naming/spi/ObjectFactory.java5
-rw-r--r--libjava/classpath/javax/naming/spi/ObjectFactoryBuilder.java4
-rw-r--r--libjava/classpath/javax/naming/spi/Resolver.java41
-rw-r--r--libjava/classpath/javax/naming/spi/StateFactory.java2
-rw-r--r--libjava/classpath/javax/net/ssl/CertPathTrustManagerParameters.java71
-rw-r--r--libjava/classpath/javax/net/ssl/HandshakeCompletedEvent.java31
-rw-r--r--libjava/classpath/javax/net/ssl/HttpsURLConnection.java45
-rw-r--r--libjava/classpath/javax/net/ssl/KeyManagerFactory.java106
-rw-r--r--libjava/classpath/javax/net/ssl/KeyStoreBuilderParameters.java48
-rw-r--r--libjava/classpath/javax/net/ssl/SSLContext.java148
-rw-r--r--libjava/classpath/javax/net/ssl/SSLContextSpi.java22
-rw-r--r--libjava/classpath/javax/net/ssl/SSLEngine.java442
-rw-r--r--libjava/classpath/javax/net/ssl/SSLEngineResult.java194
-rw-r--r--libjava/classpath/javax/net/ssl/SSLSession.java67
-rw-r--r--libjava/classpath/javax/net/ssl/SSLSocketFactory.java2
-rw-r--r--libjava/classpath/javax/net/ssl/TrustManagerFactory.java103
-rw-r--r--libjava/classpath/javax/net/ssl/X509ExtendedKeyManager.java96
-rw-r--r--libjava/classpath/javax/print/PrintService.java14
-rw-r--r--libjava/classpath/javax/print/attribute/Attribute.java2
-rw-r--r--libjava/classpath/javax/print/attribute/AttributeSet.java6
-rw-r--r--libjava/classpath/javax/print/attribute/AttributeSetUtilities.java8
-rw-r--r--libjava/classpath/javax/print/attribute/HashAttributeSet.java14
-rw-r--r--libjava/classpath/javax/print/attribute/standard/Chromaticity.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/ColorSupported.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/Compression.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/Copies.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/CopiesSupported.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/DateTimeAtCompleted.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/DateTimeAtCreation.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/DateTimeAtProcessing.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/Destination.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/DocumentName.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/Fidelity.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/Finishings.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobHoldUntil.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobImpressions.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobImpressionsCompleted.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobImpressionsSupported.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobKOctets.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobKOctetsProcessed.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobKOctetsSupported.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobMediaSheets.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobMediaSheetsCompleted.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobMediaSheetsSupported.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobMessageFromOperator.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobName.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobOriginatingUserName.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobPriority.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobPrioritySupported.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobSheets.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobState.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobStateReason.java2
-rw-r--r--libjava/classpath/javax/print/attribute/standard/JobStateReasons.java16
-rw-r--r--libjava/classpath/javax/print/attribute/standard/Media.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/MediaPrintableArea.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/MediaSize.java15
-rw-r--r--libjava/classpath/javax/print/attribute/standard/MultipleDocumentHandling.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/NumberOfDocuments.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/NumberOfInterveningJobs.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/NumberUp.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/NumberUpSupported.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/OrientationRequested.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/OutputDeviceAssigned.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PDLOverrideSupported.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PageRanges.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PagesPerMinute.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PagesPerMinuteColor.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PresentationDirection.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PrintQuality.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PrinterInfo.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PrinterIsAcceptingJobs.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PrinterLocation.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PrinterMakeAndModel.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PrinterMessageFromOperator.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PrinterMoreInfo.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PrinterName.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PrinterResolution.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PrinterState.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PrinterStateReason.java2
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PrinterStateReasons.java16
-rw-r--r--libjava/classpath/javax/print/attribute/standard/PrinterURI.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/QueuedJobCount.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/ReferenceUriSchemesSupported.java2
-rw-r--r--libjava/classpath/javax/print/attribute/standard/RequestingUserName.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/Severity.java2
-rw-r--r--libjava/classpath/javax/print/attribute/standard/SheetCollate.java3
-rw-r--r--libjava/classpath/javax/print/attribute/standard/Sides.java3
-rw-r--r--libjava/classpath/javax/rmi/CORBA/Tie.java6
-rw-r--r--libjava/classpath/javax/security/auth/Subject.java17
-rw-r--r--libjava/classpath/javax/security/auth/login/AppConfigurationEntry.java4
-rw-r--r--libjava/classpath/javax/security/auth/spi/LoginModule.java2
-rw-r--r--libjava/classpath/javax/security/sasl/Sasl.java10
-rw-r--r--libjava/classpath/javax/security/sasl/SaslClientFactory.java6
-rw-r--r--libjava/classpath/javax/security/sasl/SaslServerFactory.java5
-rw-r--r--libjava/classpath/javax/sound/midi/Instrument.java2
-rw-r--r--libjava/classpath/javax/sound/midi/Sequence.java10
-rw-r--r--libjava/classpath/javax/sound/midi/SoundbankResource.java4
-rw-r--r--libjava/classpath/javax/sound/sampled/AudioFileFormat.java4
-rw-r--r--libjava/classpath/javax/sound/sampled/AudioFormat.java4
-rw-r--r--libjava/classpath/javax/sound/sampled/DataLine.java6
-rw-r--r--libjava/classpath/javax/sound/sampled/Line.java4
-rw-r--r--libjava/classpath/javax/sound/sampled/Port.java2
-rw-r--r--libjava/classpath/javax/sql/RowSet.java4
-rw-r--r--libjava/classpath/javax/swing/AbstractButton.java229
-rw-r--r--libjava/classpath/javax/swing/AbstractListModel.java2
-rw-r--r--libjava/classpath/javax/swing/AbstractSpinnerModel.java12
-rw-r--r--libjava/classpath/javax/swing/ButtonGroup.java8
-rw-r--r--libjava/classpath/javax/swing/DefaultBoundedRangeModel.java2
-rw-r--r--libjava/classpath/javax/swing/DefaultButtonModel.java4
-rw-r--r--libjava/classpath/javax/swing/DefaultComboBoxModel.java32
-rw-r--r--libjava/classpath/javax/swing/DefaultListModel.java2
-rw-r--r--libjava/classpath/javax/swing/DefaultListSelectionModel.java2
-rw-r--r--libjava/classpath/javax/swing/DefaultSingleSelectionModel.java2
-rw-r--r--libjava/classpath/javax/swing/JButton.java2
-rw-r--r--libjava/classpath/javax/swing/JComboBox.java2
-rw-r--r--libjava/classpath/javax/swing/JComponent.java803
-rw-r--r--libjava/classpath/javax/swing/JDialog.java55
-rw-r--r--libjava/classpath/javax/swing/JEditorPane.java336
-rw-r--r--libjava/classpath/javax/swing/JFrame.java51
-rw-r--r--libjava/classpath/javax/swing/JLabel.java103
-rw-r--r--libjava/classpath/javax/swing/JLayeredPane.java2
-rw-r--r--libjava/classpath/javax/swing/JList.java235
-rw-r--r--libjava/classpath/javax/swing/JMenu.java263
-rw-r--r--libjava/classpath/javax/swing/JMenuBar.java33
-rw-r--r--libjava/classpath/javax/swing/JMenuItem.java107
-rw-r--r--libjava/classpath/javax/swing/JPopupMenu.java23
-rw-r--r--libjava/classpath/javax/swing/JRootPane.java12
-rw-r--r--libjava/classpath/javax/swing/JScrollBar.java113
-rw-r--r--libjava/classpath/javax/swing/JScrollPane.java8
-rw-r--r--libjava/classpath/javax/swing/JSlider.java71
-rw-r--r--libjava/classpath/javax/swing/JSplitPane.java34
-rw-r--r--libjava/classpath/javax/swing/JTabbedPane.java31
-rw-r--r--libjava/classpath/javax/swing/JTable.java120
-rw-r--r--libjava/classpath/javax/swing/JTextField.java3
-rw-r--r--libjava/classpath/javax/swing/JTextPane.java19
-rw-r--r--libjava/classpath/javax/swing/JToggleButton.java5
-rw-r--r--libjava/classpath/javax/swing/JToolTip.java14
-rw-r--r--libjava/classpath/javax/swing/JTree.java173
-rw-r--r--libjava/classpath/javax/swing/JViewport.java133
-rw-r--r--libjava/classpath/javax/swing/JWindow.java5
-rw-r--r--libjava/classpath/javax/swing/LookAndFeel.java2
-rw-r--r--libjava/classpath/javax/swing/Popup.java2
-rw-r--r--libjava/classpath/javax/swing/RepaintManager.java299
-rw-r--r--libjava/classpath/javax/swing/ScrollPaneLayout.java38
-rw-r--r--libjava/classpath/javax/swing/SizeSequence.java8
-rw-r--r--libjava/classpath/javax/swing/SortingFocusTraversalPolicy.java6
-rw-r--r--libjava/classpath/javax/swing/SpinnerListModel.java6
-rw-r--r--libjava/classpath/javax/swing/SwingUtilities.java274
-rw-r--r--libjava/classpath/javax/swing/Timer.java2
-rw-r--r--libjava/classpath/javax/swing/ToolTipManager.java77
-rw-r--r--libjava/classpath/javax/swing/TransferHandler.java357
-rw-r--r--libjava/classpath/javax/swing/UIDefaults.java8
-rw-r--r--libjava/classpath/javax/swing/UIManager.java251
-rw-r--r--libjava/classpath/javax/swing/border/CompoundBorder.java27
-rw-r--r--libjava/classpath/javax/swing/event/EventListenerList.java60
-rw-r--r--libjava/classpath/javax/swing/filechooser/FileSystemView.java9
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicButtonListener.java136
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicButtonUI.java330
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicDirectoryModel.java6
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java10
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicGraphicsUtils.java55
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicHTML.java26
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java10
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java64
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicLabelUI.java57
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicListUI.java2
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java24
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicMenuItemUI.java144
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicMenuUI.java207
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java160
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java79
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java237
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java566
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneDivider.java412
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java372
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java417
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicTableHeaderUI.java8
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java9
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicTextUI.java538
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java6
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicToolTipUI.java123
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicTreeUI.java529
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/DefaultMetalTheme.java100
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/MetalBorders.java16
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java72
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/MetalCheckBoxIcon.java11
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/MetalIconFactory.java119
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java50
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/MetalMenuBarUI.java9
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/MetalRadioButtonUI.java2
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/MetalScrollBarUI.java15
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/MetalSliderUI.java27
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/MetalSplitPaneDivider.java281
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/MetalTabbedPaneUI.java2
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/MetalToolTipUI.java70
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/MetalTreeUI.java122
-rw-r--r--libjava/classpath/javax/swing/plaf/metal/OceanTheme.java2
-rw-r--r--libjava/classpath/javax/swing/plaf/synth/SynthLookAndFeel.java4
-rw-r--r--libjava/classpath/javax/swing/table/AbstractTableModel.java4
-rw-r--r--libjava/classpath/javax/swing/table/DefaultTableColumnModel.java8
-rw-r--r--libjava/classpath/javax/swing/table/DefaultTableModel.java2
-rw-r--r--libjava/classpath/javax/swing/table/TableColumnModel.java2
-rw-r--r--libjava/classpath/javax/swing/table/TableModel.java2
-rw-r--r--libjava/classpath/javax/swing/text/AbstractDocument.java913
-rw-r--r--libjava/classpath/javax/swing/text/AttributeSet.java2
-rw-r--r--libjava/classpath/javax/swing/text/BoxView.java484
-rw-r--r--libjava/classpath/javax/swing/text/ComponentView.java336
-rw-r--r--libjava/classpath/javax/swing/text/CompositeView.java195
-rw-r--r--libjava/classpath/javax/swing/text/DefaultCaret.java15
-rw-r--r--libjava/classpath/javax/swing/text/DefaultEditorKit.java365
-rw-r--r--libjava/classpath/javax/swing/text/DefaultFormatter.java6
-rw-r--r--libjava/classpath/javax/swing/text/DefaultHighlighter.java389
-rw-r--r--libjava/classpath/javax/swing/text/DefaultStyledDocument.java2036
-rw-r--r--libjava/classpath/javax/swing/text/ElementIterator.java203
-rw-r--r--libjava/classpath/javax/swing/text/FieldView.java4
-rw-r--r--libjava/classpath/javax/swing/text/FlowView.java419
-rw-r--r--libjava/classpath/javax/swing/text/GapContent.java723
-rw-r--r--libjava/classpath/javax/swing/text/GlyphView.java620
-rw-r--r--libjava/classpath/javax/swing/text/InternationalFormatter.java2
-rw-r--r--libjava/classpath/javax/swing/text/JTextComponent.java278
-rw-r--r--libjava/classpath/javax/swing/text/LabelView.java78
-rw-r--r--libjava/classpath/javax/swing/text/MaskFormatter.java377
-rw-r--r--libjava/classpath/javax/swing/text/MutableAttributeSet.java2
-rw-r--r--libjava/classpath/javax/swing/text/ParagraphView.java107
-rw-r--r--libjava/classpath/javax/swing/text/PlainView.java150
-rw-r--r--libjava/classpath/javax/swing/text/Position.java4
-rw-r--r--libjava/classpath/javax/swing/text/SimpleAttributeSet.java18
-rw-r--r--libjava/classpath/javax/swing/text/StringContent.java304
-rw-r--r--libjava/classpath/javax/swing/text/StyleConstants.java11
-rw-r--r--libjava/classpath/javax/swing/text/StyleContext.java600
-rw-r--r--libjava/classpath/javax/swing/text/StyledEditorKit.java46
-rw-r--r--libjava/classpath/javax/swing/text/TextAction.java51
-rw-r--r--libjava/classpath/javax/swing/text/Utilities.java189
-rw-r--r--libjava/classpath/javax/swing/text/View.java104
-rw-r--r--libjava/classpath/javax/swing/text/WrappedPlainView.java199
-rw-r--r--libjava/classpath/javax/swing/text/ZoneView.java442
-rw-r--r--libjava/classpath/javax/swing/text/html/BRView.java5
-rw-r--r--libjava/classpath/javax/swing/text/html/BlockView.java482
-rw-r--r--libjava/classpath/javax/swing/text/html/CSS.java274
-rw-r--r--libjava/classpath/javax/swing/text/html/CSSBorder.java421
-rw-r--r--libjava/classpath/javax/swing/text/html/FormSubmitEvent.java123
-rw-r--r--libjava/classpath/javax/swing/text/html/FormView.java649
-rw-r--r--libjava/classpath/javax/swing/text/html/FrameSetView.java274
-rw-r--r--libjava/classpath/javax/swing/text/html/FrameView.java233
-rw-r--r--libjava/classpath/javax/swing/text/html/HTML.java22
-rw-r--r--libjava/classpath/javax/swing/text/html/HTMLDocument.java931
-rw-r--r--libjava/classpath/javax/swing/text/html/HTMLEditorKit.java578
-rw-r--r--libjava/classpath/javax/swing/text/html/HTMLWriter.java1084
-rw-r--r--libjava/classpath/javax/swing/text/html/ImageView.java403
-rw-r--r--libjava/classpath/javax/swing/text/html/InlineView.java151
-rw-r--r--libjava/classpath/javax/swing/text/html/ListView.java3
-rw-r--r--libjava/classpath/javax/swing/text/html/MultiAttributeSet.java213
-rw-r--r--libjava/classpath/javax/swing/text/html/MultiStyle.java136
-rw-r--r--libjava/classpath/javax/swing/text/html/Option.java12
-rw-r--r--libjava/classpath/javax/swing/text/html/ParagraphView.java131
-rw-r--r--libjava/classpath/javax/swing/text/html/ResetableModel.java50
-rw-r--r--libjava/classpath/javax/swing/text/html/ResetablePlainDocument.java82
-rw-r--r--libjava/classpath/javax/swing/text/html/ResetableToggleButtonModel.java71
-rw-r--r--libjava/classpath/javax/swing/text/html/SelectComboBoxModel.java84
-rw-r--r--libjava/classpath/javax/swing/text/html/SelectListModel.java106
-rw-r--r--libjava/classpath/javax/swing/text/html/StyleSheet.java1124
-rw-r--r--libjava/classpath/javax/swing/text/html/TableView.java942
-rw-r--r--libjava/classpath/javax/swing/text/html/ViewAttributeSet.java163
-rw-r--r--libjava/classpath/javax/swing/text/html/parser/AttributeList.java6
-rw-r--r--libjava/classpath/javax/swing/text/html/parser/ContentModel.java6
-rw-r--r--libjava/classpath/javax/swing/text/html/parser/DTD.java17
-rw-r--r--libjava/classpath/javax/swing/text/html/parser/DocumentParser.java4
-rw-r--r--libjava/classpath/javax/swing/text/html/parser/ParserDelegator.java4
-rw-r--r--libjava/classpath/javax/swing/tree/AbstractLayoutCache.java27
-rw-r--r--libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java12
-rw-r--r--libjava/classpath/javax/swing/tree/DefaultTreeCellEditor.java322
-rw-r--r--libjava/classpath/javax/swing/tree/DefaultTreeCellRenderer.java108
-rw-r--r--libjava/classpath/javax/swing/tree/DefaultTreeModel.java29
-rw-r--r--libjava/classpath/javax/swing/tree/DefaultTreeSelectionModel.java780
-rw-r--r--libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java2
-rw-r--r--libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java190
-rw-r--r--libjava/classpath/javax/swing/undo/CompoundEdit.java16
-rw-r--r--libjava/classpath/javax/swing/undo/StateEdit.java4
-rw-r--r--libjava/classpath/javax/swing/undo/StateEditable.java4
-rw-r--r--libjava/classpath/javax/swing/undo/UndoableEditSupport.java5
-rw-r--r--libjava/classpath/javax/xml/parsers/DocumentBuilderFactory.java2
-rw-r--r--libjava/classpath/javax/xml/validation/SchemaFactory.java101
-rw-r--r--libjava/classpath/jvmti.h1819
-rw-r--r--libjava/classpath/lib/.cvsignore38
-rw-r--r--libjava/classpath/lib/Makefile.am73
-rw-r--r--libjava/classpath/lib/Makefile.gcj2
-rw-r--r--libjava/classpath/lib/Makefile.in75
-rwxr-xr-xlibjava/classpath/lib/gen-classlist.sh.in31
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Asynchron.classbin0 -> 1872 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/BigDecimalHelper.classbin0 -> 3255 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/ByteArrayComparator.classbin0 -> 1158 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/AbstractCdrInput.classbin0 -> 20999 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/AbstractCdrOutput.classbin0 -> 13461 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/AbstractDataInput.classbin0 -> 682 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/AbstractDataOutput.classbin0 -> 562 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/AligningInput.classbin0 -> 1725 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/AligningOutput.classbin0 -> 1631 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/ArrayValueHelper.classbin0 -> 5994 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/BigEndianInputStream.classbin0 -> 424 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/BigEndianOutputStream.classbin0 -> 432 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/BufferedCdrOutput.classbin0 -> 2161 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/BufferredCdrInput.classbin0 -> 1668 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/EncapsulationStream.classbin0 -> 2254 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/HeadlessInput.classbin0 -> 11596 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/IDLTypeHelper.classbin0 -> 3101 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/LittleEndianInputStream.classbin0 -> 4549 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/LittleEndianOutputStream.classbin0 -> 2133 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/UnknownExceptionCtxHandler.classbin0 -> 6277 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/VMVio.classbin0 -> 1408 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/Vio.classbin0 -> 21547 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime$1.classbin0 -> 984 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime$Entry.classbin0 -> 886 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime$Redirection.classbin0 -> 656 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime.classbin0 -> 4831 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CDR/gnuValueStream.classbin0 -> 278 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CdrEncapsCodecImpl.classbin0 -> 5871 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CollocatedOrbs.classbin0 -> 2494 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Connected_objects$cObject.classbin0 -> 809 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Connected_objects.classbin0 -> 3540 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/CorbaList.classbin0 -> 1205 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DefaultSocketFactory.classbin0 -> 924 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DefinitionKindHolder.classbin0 -> 1162 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DuplicateNameHolder.classbin0 -> 1390 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/AbstractAny.classbin0 -> 2680 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/DivideableAny.classbin0 -> 8187 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/NameValuePairHolder.classbin0 -> 1232 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/RecordAny.classbin0 -> 8043 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/UndivideableAny.classbin0 -> 5868 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/ValueChangeListener.classbin0 -> 159 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynAny.classbin0 -> 14085 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynAnyFactory.classbin0 -> 6415 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynArray.classbin0 -> 6545 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynEnum.classbin0 -> 4358 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynFixed.classbin0 -> 4430 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynSequence.classbin0 -> 4531 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynStruct.classbin0 -> 2045 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynUnion.classbin0 -> 7251 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynValue.classbin0 -> 8072 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynValueBox.classbin0 -> 6920 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/DynAnySeqHolder.classbin0 -> 1210 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/EmptyExceptionHolder.classbin0 -> 1812 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/ForwardRequestHelper.classbin0 -> 2869 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/CancelHeader.classbin0 -> 432 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/CharSets_OSF.classbin0 -> 4139 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/CloseMessage.classbin0 -> 1079 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/CodeSetServiceContext.classbin0 -> 3524 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/ContextHandler.classbin0 -> 900 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/ErrorMessage.classbin0 -> 1769 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/MessageHeader.classbin0 -> 6691 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/ReplyHeader.classbin0 -> 1418 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/RequestHeader.classbin0 -> 1442 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/ServiceContext.classbin0 -> 4969 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/v1_0/CancelHeader.classbin0 -> 834 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/v1_0/ReplyHeader.classbin0 -> 2441 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/v1_0/RequestHeader.classbin0 -> 3122 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/v1_2/ReplyHeader.classbin0 -> 1766 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GIOP/v1_2/RequestHeader.classbin0 -> 3618 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/GeneralHolder.classbin0 -> 2394 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/HolderLocator.classbin0 -> 2952 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/IOR$CodeSets_profile$CodeSet_component.classbin0 -> 2363 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/IOR$CodeSets_profile.classbin0 -> 2149 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/IOR$Internet_profile.classbin0 -> 2834 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/IOR.classbin0 -> 8912 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Interceptor/ClientRequestInterceptors.classbin0 -> 2096 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Interceptor/ForwardRequestHolder.classbin0 -> 1327 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Interceptor/IORInterceptors.classbin0 -> 2605 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Interceptor/Registrator.classbin0 -> 9169 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Interceptor/ServerRequestInterceptors.classbin0 -> 2123 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Interceptor/gnuClientRequestInfo.classbin0 -> 5483 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Interceptor/gnuIcCurrent.classbin0 -> 4277 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Interceptor/gnuIorInfo.classbin0 -> 2375 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Interceptor/gnuServerRequestInfo.classbin0 -> 7751 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/IorDelegate.classbin0 -> 7919 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/IorObject.classbin0 -> 1966 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/IorProvider.classbin0 -> 150 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Minor.classbin0 -> 1262 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/NameDynAnyPairHolder.classbin0 -> 1258 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/NameDynAnyPairSeqHolder.classbin0 -> 1274 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/NameValuePairHolder.classbin0 -> 1250 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/NameValuePairSeqHolder.classbin0 -> 1266 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/NamingService/Binding_iterator_impl.classbin0 -> 1808 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/NamingService/Ext.classbin0 -> 3928 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/NamingService/NameComponentComparator.classbin0 -> 1059 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/NamingService/NameParser.classbin0 -> 9739 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/NamingService/NameTransformer.classbin0 -> 4814 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/NamingService/NameValidator.classbin0 -> 1159 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/NamingService/NamingMap.classbin0 -> 2648 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/NamingService/NamingServiceTransient$1.classbin0 -> 701 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/NamingService/NamingServiceTransient.classbin0 -> 2390 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/NamingService/TransientContext.classbin0 -> 6742 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/ObjectCreator.classbin0 -> 10180 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/OctetHolder.classbin0 -> 1334 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/OrbFocused.classbin0 -> 6441 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/OrbFunctional$1.classbin0 -> 635 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/OrbFunctional$2.classbin0 -> 1116 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/OrbFunctional$portServer.classbin0 -> 2171 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/OrbFunctional$sharedPortServer.classbin0 -> 872 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/OrbFunctional.classbin0 -> 24752 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/OrbRestricted.classbin0 -> 10136 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/AOM$Obj.classbin0 -> 1342 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/AOM.classbin0 -> 4383 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/AccessiblePolicy.classbin0 -> 221 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/DynamicImpHandler.classbin0 -> 1204 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/ForwardRequestHolder.classbin0 -> 1273 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/ForwardedServant.classbin0 -> 4682 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/InvalidPolicyHolder.classbin0 -> 1333 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/LocalDelegate.classbin0 -> 8751 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/LocalRequest.classbin0 -> 12849 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/LocalServerRequest.classbin0 -> 3164 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/ORB_1_4.classbin0 -> 7622 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/ServantDelegateImpl.classbin0 -> 4010 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/StandardPolicies.classbin0 -> 3263 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/gnuAdapterActivator.classbin0 -> 1055 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/gnuForwardRequest.classbin0 -> 759 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/gnuIdAssignmentPolicy.classbin0 -> 942 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/gnuIdUniquenessPolicy.classbin0 -> 942 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/gnuImplicitActivationPolicy.classbin0 -> 996 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/gnuLifespanPolicy.classbin0 -> 906 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA$RefTemplate.classbin0 -> 1993 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA.classbin0 -> 25936 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/gnuPOAManager.classbin0 -> 3326 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/gnuPoaCurrent.classbin0 -> 2741 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/gnuRequestProcessingPolicy.classbin0 -> 987 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/gnuServantObject.classbin0 -> 14471 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/gnuServantRetentionPolicy.classbin0 -> 978 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Poa/gnuThreadPolicy.classbin0 -> 888 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/RawReply.classbin0 -> 1131 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/ResponseHandlerImpl.classbin0 -> 2485 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/SafeForDirectCalls.classbin0 -> 127 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/ServiceDetailHolder.classbin0 -> 1154 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/ServiceRequestAdapter.classbin0 -> 3086 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/SetOverrideTypeHolder.classbin0 -> 1170 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/SimpleDelegate.classbin0 -> 4870 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/SocketRepository.classbin0 -> 1958 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/StreamBasedRequest.classbin0 -> 412 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/StreamHolder.classbin0 -> 1456 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/StubLocator.classbin0 -> 1718 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/TypeCodeHelper.classbin0 -> 4997 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/TypeKindNamer.classbin0 -> 4025 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Unexpected.classbin0 -> 1454 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/Version.classbin0 -> 2480 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/WCharHolder.classbin0 -> 1329 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/WStringHolder.classbin0 -> 1407 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/_PolicyImplBase.classbin0 -> 2822 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/gnuAny.classbin0 -> 14005 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/gnuCodecFactory.classbin0 -> 1065 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/gnuContext.classbin0 -> 3523 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/gnuContextList.classbin0 -> 1009 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/gnuEnvironment.classbin0 -> 623 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/gnuExceptionList.classbin0 -> 1046 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/gnuNVList.classbin0 -> 1889 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/gnuNamedValue.classbin0 -> 1043 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/gnuRequest$1.classbin0 -> 567 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/gnuRequest$2.classbin0 -> 623 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/gnuRequest.classbin0 -> 23103 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/gnuValueHolder.classbin0 -> 2003 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/interfaces/SocketFactory.classbin0 -> 407 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/typecodes/AliasTypeCode.classbin0 -> 1443 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/typecodes/ArrayTypeCode.classbin0 -> 3132 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/typecodes/FixedTypeCode.classbin0 -> 1842 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/typecodes/GeneralTypeCode.classbin0 -> 3185 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/typecodes/PrimitiveTypeCode.classbin0 -> 2769 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/typecodes/RecordTypeCode$Field.classbin0 -> 582 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/typecodes/RecordTypeCode.classbin0 -> 3537 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/typecodes/RecursiveTypeCode.classbin0 -> 755 bytes
-rw-r--r--libjava/classpath/lib/gnu/CORBA/typecodes/StringTypeCode.classbin0 -> 682 bytes
-rw-r--r--libjava/classpath/lib/gnu/awt/LightweightRedirector.classbin0 -> 3189 bytes
-rw-r--r--libjava/classpath/lib/gnu/awt/j2d/AbstractGraphicsState.classbin0 -> 1779 bytes
-rw-r--r--libjava/classpath/lib/gnu/awt/j2d/DirectRasterGraphics.classbin0 -> 925 bytes
-rw-r--r--libjava/classpath/lib/gnu/awt/j2d/Graphics2DImpl.classbin0 -> 12314 bytes
-rw-r--r--libjava/classpath/lib/gnu/awt/j2d/IntegerGraphicsState$ScreenCoupledImage.classbin0 -> 314 bytes
-rw-r--r--libjava/classpath/lib/gnu/awt/j2d/IntegerGraphicsState.classbin0 -> 9383 bytes
-rw-r--r--libjava/classpath/lib/gnu/awt/j2d/MappedRaster.classbin0 -> 723 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/Configuration.classbin0 -> 795 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/ListenerData.classbin0 -> 1197 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/NotImplementedException.classbin0 -> 400 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/Pointer.classbin0 -> 274 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/Pointer32.classbin0 -> 344 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/Pointer64.classbin0 -> 344 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/ServiceFactory$ServiceIterator.classbin0 -> 3903 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/ServiceFactory.classbin0 -> 3194 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/ServiceProviderLoadingAction.classbin0 -> 1292 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/SystemProperties.classbin0 -> 2655 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/VMStackWalker.classbin0 -> 653 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/debug/Component.classbin0 -> 2187 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/debug/PreciseFilter.classbin0 -> 1400 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/debug/Simple1LineFormatter.classbin0 -> 3090 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/debug/SystemLogger.classbin0 -> 1949 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/debug/TeeInputStream.classbin0 -> 1164 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/debug/TeeOutputStream.classbin0 -> 1032 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/debug/TeeReader.classbin0 -> 1116 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/debug/TeeWriter.classbin0 -> 990 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/Jdwp$1.classbin0 -> 804 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/Jdwp.classbin0 -> 5748 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$ClassStatus.classbin0 -> 557 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ArrayReference.classbin0 -> 660 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ArrayType.classbin0 -> 583 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ClassLoaderReference.classbin0 -> 619 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ClassObjectReference.classbin0 -> 618 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ClassType.classbin0 -> 683 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$Event.classbin0 -> 568 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$EventRequest.classbin0 -> 657 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$Field.classbin0 -> 535 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$InterfaceType.classbin0 -> 559 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$Method.classbin0 -> 730 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ObjectReference.classbin0 -> 858 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ReferenceType.classbin0 -> 1101 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$StackFrame.classbin0 -> 687 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$StringReference.classbin0 -> 594 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ThreadGroupReference.classbin0 -> 670 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ThreadReference.classbin0 -> 965 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$VirtualMachine.classbin0 -> 1291 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet.classbin0 -> 1924 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$Error.classbin0 -> 2679 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$EventKind.classbin0 -> 1119 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$InvokeOptions.classbin0 -> 522 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$ModKind.classbin0 -> 796 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$StepDepth.classbin0 -> 506 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$StepSize.classbin0 -> 475 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$SuspendPolicy.classbin0 -> 526 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$SuspendStatus.classbin0 -> 468 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$Tag.classbin0 -> 890 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$ThreadStatus.classbin0 -> 584 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$TypeTag.classbin0 -> 508 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$Version.classbin0 -> 475 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants.classbin0 -> 1279 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/VMFrame.classbin0 -> 837 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/VMIdManager$IdFactory.classbin0 -> 3138 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/VMIdManager$ReferenceKey.classbin0 -> 1266 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/VMIdManager.classbin0 -> 3624 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/VMMethod.classbin0 -> 1983 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/VMVirtualMachine.classbin0 -> 2883 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/BreakpointEvent.classbin0 -> 1458 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/ClassPrepareEvent.classbin0 -> 2047 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/ClassUnloadEvent.classbin0 -> 1000 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/Event.classbin0 -> 1598 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/EventManager.classbin0 -> 4198 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/EventRequest.classbin0 -> 4493 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/ExceptionEvent.classbin0 -> 2304 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/MethodEntryEvent.classbin0 -> 1553 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/MethodExitEvent.classbin0 -> 1532 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/SingleStepEvent.classbin0 -> 1549 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/ThreadEndEvent.classbin0 -> 1140 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/ThreadStartEvent.classbin0 -> 1146 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/VmDeathEvent.classbin0 -> 657 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/VmInitEvent.classbin0 -> 1120 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ClassExcludeFilter.classbin0 -> 703 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ClassMatchFilter.classbin0 -> 1588 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ClassOnlyFilter.classbin0 -> 1303 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ConditionalFilter.classbin0 -> 776 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/filters/CountFilter.classbin0 -> 818 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.classbin0 -> 1681 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/filters/FieldOnlyFilter.classbin0 -> 1507 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/filters/IEventFilter.classbin0 -> 194 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/filters/InstanceOnlyFilter.classbin0 -> 1328 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/filters/LocationOnlyFilter.classbin0 -> 889 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/filters/StepFilter.classbin0 -> 1463 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ThreadOnlyFilter.classbin0 -> 1383 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidClassException.classbin0 -> 865 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidClassLoaderException.classbin0 -> 889 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidCountException.classbin0 -> 860 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidEventTypeException.classbin0 -> 881 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidFieldException.classbin0 -> 865 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidLocationException.classbin0 -> 623 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidMethodException.classbin0 -> 869 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidObjectException.classbin0 -> 869 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidStringException.classbin0 -> 1023 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidThreadException.classbin0 -> 869 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidThreadGroupException.classbin0 -> 890 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/JdwpException.classbin0 -> 741 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/JdwpIllegalArgumentException.classbin0 -> 480 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/JdwpInternalErrorException.classbin0 -> 649 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/NativeMethodException.classbin0 -> 868 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/NotImplementedException.classbin0 -> 753 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/exception/VmDeadException.classbin0 -> 416 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/id/ArrayId.classbin0 -> 317 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/id/ArrayReferenceTypeId.classbin0 -> 362 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/id/ClassLoaderId.classbin0 -> 915 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/id/ClassObjectId.classbin0 -> 874 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/id/ClassReferenceTypeId.classbin0 -> 362 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/id/InterfaceReferenceTypeId.classbin0 -> 374 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/id/JdwpId.classbin0 -> 1359 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/id/ObjectId.classbin0 -> 1399 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/id/ReferenceTypeId.classbin0 -> 1033 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/id/StringId.classbin0 -> 879 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/id/ThreadGroupId.classbin0 -> 918 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/id/ThreadId.classbin0 -> 912 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/ArrayReferenceCommandSet.classbin0 -> 4143 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/ArrayTypeCommandSet.classbin0 -> 2446 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.classbin0 -> 2722 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/ClassObjectReferenceCommandSet.classbin0 -> 2157 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/ClassTypeCommandSet.classbin0 -> 5471 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/CommandSet.classbin0 -> 631 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/EventRequestCommandSet.classbin0 -> 5267 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/FieldCommandSet.classbin0 -> 814 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/InterfaceTypeCommandSet.classbin0 -> 846 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/MethodCommandSet.classbin0 -> 3284 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.classbin0 -> 6344 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/PacketProcessor.classbin0 -> 4326 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.classbin0 -> 7908 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/StackFrameCommandSet.classbin0 -> 3406 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/StringReferenceCommandSet.classbin0 -> 1977 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/ThreadGroupReferenceCommandSet.classbin0 -> 3763 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.classbin0 -> 5835 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.classbin0 -> 9303 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/transport/ITransport.classbin0 -> 456 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpCommandPacket.classbin0 -> 1601 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpConnection.classbin0 -> 5043 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpPacket.classbin0 -> 2845 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpReplyPacket.classbin0 -> 1571 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/transport/SocketTransport.classbin0 -> 2603 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/transport/TransportException.classbin0 -> 545 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/transport/TransportFactory$TransportMethod.classbin0 -> 638 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/transport/TransportFactory.classbin0 -> 2138 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/util/JdwpString.classbin0 -> 1340 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/util/LineTable.classbin0 -> 1044 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/util/Location.classbin0 -> 2633 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/util/MethodResult.classbin0 -> 878 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/util/Signature.classbin0 -> 2661 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/util/Value.classbin0 -> 4871 bytes
-rw-r--r--libjava/classpath/lib/gnu/classpath/jdwp/util/VariableTable.classbin0 -> 1255 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/Core.classbin0 -> 429 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/RawData.classbin0 -> 262 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/RawDataManaged.classbin0 -> 283 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/BytesToCharsetAdaptor.classbin0 -> 2167 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/BytesToUnicode.classbin0 -> 3258 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/CharsetToBytesAdaptor.classbin0 -> 3025 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Convert.classbin0 -> 5087 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/IOConverter.classbin0 -> 2119 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Input_8859_1.classbin0 -> 821 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Input_ASCII.classbin0 -> 816 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Input_EUCJIS.classbin0 -> 502 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Input_JavaSrc.classbin0 -> 1157 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Input_SJIS.classbin0 -> 453 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Input_UTF8.classbin0 -> 1130 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Input_UnicodeBig.classbin0 -> 925 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Input_UnicodeLittle.classbin0 -> 942 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Input_iconv.classbin0 -> 719 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Output_8859_1.classbin0 -> 1170 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Output_ASCII.classbin0 -> 1164 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Output_EUCJIS.classbin0 -> 633 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Output_JavaSrc.classbin0 -> 1248 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Output_SJIS.classbin0 -> 605 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Output_UTF8.classbin0 -> 1704 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Output_UnicodeLittleUnmarked.classbin0 -> 830 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Output_iconv.classbin0 -> 723 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/UnicodeToBytes.classbin0 -> 3627 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/io/DefaultMimeTypes.classbin0 -> 5579 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/io/MimeTypes.classbin0 -> 1793 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/io/SimpleSHSStream.classbin0 -> 1323 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/jvmti/Breakpoint.classbin0 -> 626 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/jvmti/BreakpointManager.classbin0 -> 1275 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/jvmti/Location.classbin0 -> 1096 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/BootClassLoader.classbin0 -> 1561 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/ExtensionClassLoader.classbin0 -> 864 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/FinalizerThread.classbin0 -> 525 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/HelperClassLoader$1.classbin0 -> 896 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/HelperClassLoader.classbin0 -> 2189 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/JNIWeakRef.classbin0 -> 363 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/NameFinder$Addr2Line.classbin0 -> 1669 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/NameFinder.classbin0 -> 5440 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$AccessMode.classbin0 -> 991 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$ByteWrapper.classbin0 -> 953 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$HashIterator.classbin0 -> 1509 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$MapEntry.classbin0 -> 877 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap.classbin0 -> 9645 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/SharedLibHelper.classbin0 -> 5568 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/SharedLibLoader.classbin0 -> 2052 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/StringBuffer.classbin0 -> 2514 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/runtime/SystemClassLoader.classbin0 -> 2998 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Fileset.classbin0 -> 1534 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Main.classbin0 -> 10771 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Tokenizer.classbin0 -> 1101 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/util/Debug.classbin0 -> 5432 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/AWTUtilities$VisibleComponentList$VisibleComponentIterator.classbin0 -> 2389 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/AWTUtilities$VisibleComponentList.classbin0 -> 1070 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/AWTUtilities.classbin0 -> 5941 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/BitMaskExtent.classbin0 -> 788 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/BitwiseXORComposite$GeneralContext.classbin0 -> 2206 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/BitwiseXORComposite$IntContext.classbin0 -> 2306 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/BitwiseXORComposite.classbin0 -> 1207 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/Buffers.classbin0 -> 2865 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/ClasspathToolkit.classbin0 -> 2455 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/ComponentDataBlitOp.classbin0 -> 3258 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/ComponentReshapeEvent.classbin0 -> 588 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/EmbeddedWindow.classbin0 -> 2023 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/EventModifier.classbin0 -> 833 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/GradientPaintContext.classbin0 -> 2322 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/LowPriorityEvent.classbin0 -> 126 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/color/CieXyzConverter.classbin0 -> 928 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/color/ClutProfileConverter.classbin0 -> 1763 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/color/ColorLookUpTable.classbin0 -> 6371 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/color/ColorSpaceConverter.classbin0 -> 221 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/color/GrayProfileConverter.classbin0 -> 1883 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/color/GrayScaleConverter.classbin0 -> 1653 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/color/LinearRGBConverter.classbin0 -> 1747 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/color/ProfileHeader.classbin0 -> 5228 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/color/PyccConverter.classbin0 -> 755 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/color/RgbProfileConverter.classbin0 -> 3481 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/color/SrgbConverter.classbin0 -> 1766 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/color/TagEntry.classbin0 -> 1964 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/color/ToneReproductionCurve.classbin0 -> 1850 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/dnd/GtkMouseDragGestureRecognizer.classbin0 -> 3199 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.classbin0 -> 4092 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.classbin0 -> 1604 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/dnd/peer/gtk/GtkDropTargetPeer.classbin0 -> 654 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/FontDelegate.classbin0 -> 792 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/FontFactory.classbin0 -> 581 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/GNUGlyphVector.classbin0 -> 6624 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/autofit/AxisHints.classbin0 -> 362 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/autofit/Constants.classbin0 -> 258 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/autofit/GlyphHints.classbin0 -> 972 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/autofit/Latin.classbin0 -> 4407 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/autofit/LatinAxis.classbin0 -> 450 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/autofit/LatinMetrics.classbin0 -> 417 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/autofit/Scaler.classbin0 -> 426 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/autofit/Script.classbin0 -> 447 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/autofit/ScriptMetrics.classbin0 -> 424 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/autofit/Segment.classbin0 -> 347 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/autofit/Width.classbin0 -> 338 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Dummy.classbin0 -> 595 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Type0.classbin0 -> 5509 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Type12.classbin0 -> 1637 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Type4.classbin0 -> 2808 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap.classbin0 -> 2377 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/GlyphNamer.classbin0 -> 21906 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/MacResourceFork$Resource.classbin0 -> 1571 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/MacResourceFork.classbin0 -> 2474 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/NameDecoder.classbin0 -> 8392 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/OpenTypeFont.classbin0 -> 8291 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/OpenTypeFontFactory.classbin0 -> 1609 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/Scaler.classbin0 -> 656 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/Fixed.classbin0 -> 1969 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLoader.classbin0 -> 7309 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLocator$FourByte.classbin0 -> 1050 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLocator$TwoByte.classbin0 -> 1055 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLocator.classbin0 -> 1073 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphMeasurer.classbin0 -> 2140 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/TrueTypeScaler.classbin0 -> 4706 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/VirtualMachine.classbin0 -> 25434 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/Zone.classbin0 -> 4834 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/ZonePathIterator.classbin0 -> 2814 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/image/ImageDecoder$DataInputStreamWrapper.classbin0 -> 767 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/image/ImageDecoder.classbin0 -> 2977 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/image/XBMDecoder.classbin0 -> 2987 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/java2d/AbstractGraphics2D.classbin0 -> 33135 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/java2d/AlphaCompositeContext.classbin0 -> 3745 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/java2d/CubicSegment.classbin0 -> 3098 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/java2d/ImagePaint$ImagePaintContext.classbin0 -> 2514 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/java2d/ImagePaint.classbin0 -> 1292 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/java2d/LineSegment.classbin0 -> 2054 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/java2d/PolyEdge.classbin0 -> 1559 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/java2d/PolyEdgeComparator.classbin0 -> 752 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/java2d/QuadSegment.classbin0 -> 4635 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/java2d/RasterGraphics.classbin0 -> 940 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/java2d/Segment.classbin0 -> 1826 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/java2d/ShapeCache.classbin0 -> 551 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/java2d/TexturePaintContext.classbin0 -> 3431 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/ClasspathFontPeer.classbin0 -> 8543 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/EmbeddedWindowPeer.classbin0 -> 189 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/GLightweightPeer.classbin0 -> 7416 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/NativeEventLoopRunningEvent.classbin0 -> 608 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/AsyncImage$Loader.classbin0 -> 1343 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/AsyncImage$NullImageSource.classbin0 -> 1614 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/AsyncImage.classbin0 -> 3561 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/BufferedImageGraphics.classbin0 -> 10724 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoGraphics2D.classbin0 -> 36599 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoSurface$CairoDataBuffer.classbin0 -> 1519 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoSurface.classbin0 -> 5276 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoSurfaceGraphics.classbin0 -> 7704 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphics.classbin0 -> 12284 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphicsCopy.classbin0 -> 2743 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/FreetypeGlyphVector.classbin0 -> 8741 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GThreadMutex.classbin0 -> 439 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.classbin0 -> 2869 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer$GdkFontLineMetrics.classbin0 -> 1705 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer$GdkFontMetrics.classbin0 -> 2341 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer.classbin0 -> 9155 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.classbin0 -> 3231 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.classbin0 -> 2766 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufReader.classbin0 -> 5200 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufReaderSpi.classbin0 -> 1825 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufWriter.classbin0 -> 5158 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufWriterSpi.classbin0 -> 1878 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$ImageFormatSpec.classbin0 -> 1003 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.classbin0 -> 7774 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkRobotPeer.classbin0 -> 1566 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice$X11DisplayMode.classbin0 -> 626 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.classbin0 -> 5577 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkButtonPeer.classbin0 -> 1557 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCanvasPeer.classbin0 -> 664 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.classbin0 -> 1170 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCheckboxPeer.classbin0 -> 3001 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkChoicePeer.classbin0 -> 2221 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkClipboard.classbin0 -> 6435 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkClipboardNotifier.classbin0 -> 1567 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkComponentPeer$RepaintTimerTask.classbin0 -> 1498 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkComponentPeer.classbin0 -> 18251 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkContainerPeer.classbin0 -> 2481 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCursor.classbin0 -> 979 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkDialogPeer.classbin0 -> 914 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.classbin0 -> 847 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkFileDialogPeer.classbin0 -> 4290 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkFramePeer.classbin0 -> 4563 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkGenericPeer.classbin0 -> 1974 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkImage.classbin0 -> 7420 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkImageConsumer.classbin0 -> 3184 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkLabelPeer.classbin0 -> 1390 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkListPeer.classbin0 -> 3563 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMainThread.classbin0 -> 2319 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuBarPeer.classbin0 -> 1236 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.classbin0 -> 1145 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuItemPeer.classbin0 -> 1236 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuPeer.classbin0 -> 1927 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMouseInfoPeer.classbin0 -> 1504 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkPanelPeer.classbin0 -> 850 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.classbin0 -> 1015 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkScrollPanePeer.classbin0 -> 1785 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkScrollbarPeer.classbin0 -> 1629 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkSelection.classbin0 -> 7019 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkTextAreaPeer.classbin0 -> 4023 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkTextFieldPeer.classbin0 -> 3662 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkToolkit$LRUCache.classbin0 -> 672 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkToolkit.classbin0 -> 17432 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkVolatileImage.classbin0 -> 4243 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkWindowPeer.classbin0 -> 7753 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/VolatileImageGraphics.classbin0 -> 7987 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/headless/HeadlessGraphicsEnvironment.classbin0 -> 2568 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/headless/HeadlessToolkit.classbin0 -> 7617 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/MainQtThread.classbin0 -> 830 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/NativeWrapper.classbin0 -> 333 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QMatrix.classbin0 -> 823 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QPainterPath.classbin0 -> 1782 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QPen.classbin0 -> 926 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtAudioClip.classbin0 -> 1506 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtButtonPeer.classbin0 -> 1370 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtCanvasPeer.classbin0 -> 846 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtCheckboxPeer.classbin0 -> 2071 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtChoicePeer.classbin0 -> 1760 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtComponentGraphics.classbin0 -> 1920 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtComponentPeer$RepaintTimerTask.classbin0 -> 1132 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtComponentPeer.classbin0 -> 16303 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtContainerPeer.classbin0 -> 1580 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtDialogPeer.classbin0 -> 1208 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtEmbeddedWindowPeer.classbin0 -> 664 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtFileDialogPeer.classbin0 -> 1336 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtFontMetrics.classbin0 -> 2250 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtFontPeer.classbin0 -> 4252 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtFramePeer.classbin0 -> 2945 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtGraphics.classbin0 -> 17525 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtGraphicsEnvironment.classbin0 -> 2031 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtImage.classbin0 -> 10031 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtImageConsumer.classbin0 -> 2774 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtImageDirectGraphics.classbin0 -> 3155 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtImageGraphics.classbin0 -> 2582 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtLabelPeer.classbin0 -> 910 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtListPeer.classbin0 -> 3498 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuBarPeer.classbin0 -> 1748 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuComponentPeer.classbin0 -> 1191 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuItemPeer.classbin0 -> 1993 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuPeer.classbin0 -> 3060 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtPanelPeer.classbin0 -> 605 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtPopupMenuPeer.classbin0 -> 1468 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtRepaintThread$RepaintComponent.classbin0 -> 964 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtRepaintThread.classbin0 -> 1750 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtScreenDevice.classbin0 -> 2089 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtScreenDeviceConfiguration.classbin0 -> 2755 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtScrollPanePeer.classbin0 -> 1410 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtScrollbarPeer.classbin0 -> 1602 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtTextAreaPeer.classbin0 -> 3522 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtTextFieldPeer.classbin0 -> 2954 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtToolkit.classbin0 -> 12257 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtVolatileImage$1.classbin0 -> 716 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtVolatileImage.classbin0 -> 7103 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/qt/QtWindowPeer.classbin0 -> 849 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingButtonPeer$SwingButton.classbin0 -> 2148 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingButtonPeer$SwingButtonListener.classbin0 -> 1280 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingButtonPeer.classbin0 -> 1351 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingCanvasPeer.classbin0 -> 572 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingComponent.classbin0 -> 335 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingComponentPeer.classbin0 -> 12438 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingContainerPeer.classbin0 -> 5446 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingFramePeer.classbin0 -> 2549 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingLabelPeer$SwingLabel.classbin0 -> 1996 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingLabelPeer.classbin0 -> 1575 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingListPeer$SwingList.classbin0 -> 2229 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingListPeer.classbin0 -> 4649 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuBarPeer$SwingMenuBar.classbin0 -> 1590 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuBarPeer.classbin0 -> 3584 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuItemPeer$SwingMenuItemListener.classbin0 -> 1326 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuItemPeer.classbin0 -> 1645 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuPeer$SwingMenu.classbin0 -> 1556 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuPeer.classbin0 -> 2958 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingPanelPeer.classbin0 -> 549 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextAreaPeer$SwingTextArea.classbin0 -> 2265 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextAreaPeer.classbin0 -> 3822 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextFieldPeer$SwingTextField.classbin0 -> 2190 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextFieldPeer.classbin0 -> 3242 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingToolkit.classbin0 -> 2296 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/swing/SwingWindowPeer.classbin0 -> 556 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/print/JavaPrinterGraphics.classbin0 -> 12394 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/print/JavaPrinterJob.classbin0 -> 6418 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/print/PostScriptGraphics2D.classbin0 -> 30082 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/print/SpooledDocument.classbin0 -> 1252 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/BeanInfoEmbryo.classbin0 -> 4796 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/DefaultExceptionListener.classbin0 -> 1092 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/DoubleKey.classbin0 -> 993 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/DummyAppletContext.classbin0 -> 2208 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/DummyAppletStub.classbin0 -> 1275 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/ExplicitBeanInfo.classbin0 -> 2128 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/IntrospectionIncubator.classbin0 -> 8782 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/AbstractContext.classbin0 -> 811 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/AbstractCreatableObjectContext.classbin0 -> 1412 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/AbstractElementHandler.classbin0 -> 4436 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/AbstractObjectContext.classbin0 -> 2066 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/ArrayContext.classbin0 -> 2068 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/ArrayHandler.classbin0 -> 2748 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/AssemblyException.classbin0 -> 393 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/BooleanHandler.classbin0 -> 1035 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/ByteHandler.classbin0 -> 718 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/CharHandler.classbin0 -> 958 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/ClassHandler.classbin0 -> 880 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/ConstructorContext.classbin0 -> 2106 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/Context.classbin0 -> 704 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/DecoderContext.classbin0 -> 1913 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/DoubleHandler.classbin0 -> 728 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/DummyContext.classbin0 -> 1589 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/DummyHandler.classbin0 -> 2314 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/ElementHandler.classbin0 -> 860 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/FloatHandler.classbin0 -> 723 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/GrowableArrayContext.classbin0 -> 2456 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/IndexContext.classbin0 -> 2043 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/IntHandler.classbin0 -> 721 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/JavaHandler.classbin0 -> 1942 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/LongHandler.classbin0 -> 718 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/MethodContext.classbin0 -> 2509 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/MethodFinder.classbin0 -> 3321 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/NullHandler.classbin0 -> 911 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/ObjectContext.classbin0 -> 1498 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/ObjectHandler.classbin0 -> 3188 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ArrayHandlerCreator.classbin0 -> 971 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$BooleanHandlerCreator.classbin0 -> 979 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ByteHandlerCreator.classbin0 -> 967 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$CharHandlerCreator.classbin0 -> 967 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ClassHandlerCreator.classbin0 -> 971 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$Creator.classbin0 -> 348 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$DoubleHandlerCreator.classbin0 -> 975 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$FloatHandlerCreator.classbin0 -> 971 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$IntHandlerCreator.classbin0 -> 963 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$JavaHandlerCreator.classbin0 -> 934 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$LongHandlerCreator.classbin0 -> 967 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$NullHandlerCreator.classbin0 -> 967 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ObjectHandlerCreator.classbin0 -> 975 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ShortHandlerCreator.classbin0 -> 971 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$StringHandlerCreator.classbin0 -> 975 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$VoidHandlerCreator.classbin0 -> 967 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser.classbin0 -> 8449 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/PropertyContext.classbin0 -> 3270 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/ShortHandler.classbin0 -> 723 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/SimpleHandler.classbin0 -> 2072 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/StaticMethodContext.classbin0 -> 2088 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/StringHandler.classbin0 -> 586 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/decoder/VoidHandler.classbin0 -> 2834 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/editors/ColorEditor.classbin0 -> 2251 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/editors/FontEditor.classbin0 -> 1381 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/editors/NativeBooleanEditor.classbin0 -> 1232 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/editors/NativeByteEditor.classbin0 -> 850 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/editors/NativeDoubleEditor.classbin0 -> 860 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/editors/NativeFloatEditor.classbin0 -> 855 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/editors/NativeIntEditor.classbin0 -> 853 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/editors/NativeLongEditor.classbin0 -> 850 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/editors/NativeShortEditor.classbin0 -> 855 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/editors/StringEditor.classbin0 -> 735 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/ArrayPersistenceDelegate.classbin0 -> 3069 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/ClassPersistenceDelegate.classbin0 -> 972 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/CollectionPersistenceDelegate.classbin0 -> 1511 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/Context.classbin0 -> 1179 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/GenericScannerState.classbin0 -> 5047 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/IgnoringScannerState.classbin0 -> 2183 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/MapPersistenceDelegate.classbin0 -> 1681 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/ObjectId.classbin0 -> 2310 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/PrimitivePersistenceDelegate.classbin0 -> 1210 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/ReportingScannerState.classbin0 -> 3297 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/Root$RootElement.classbin0 -> 1105 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/Root.classbin0 -> 2009 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/ScanEngine.classbin0 -> 10282 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/ScannerState.classbin0 -> 4519 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/StAXWriter.classbin0 -> 3532 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/Writer.classbin0 -> 579 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/ArrayInstantiation.classbin0 -> 1307 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/Array_Get.classbin0 -> 803 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/Array_Set.classbin0 -> 803 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/ClassResolution.classbin0 -> 881 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/Element.classbin0 -> 1800 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/List_Get.classbin0 -> 626 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/List_Set.classbin0 -> 626 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/MethodInvocation.classbin0 -> 819 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/NullObject.classbin0 -> 709 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/ObjectInstantiation.classbin0 -> 1224 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/ObjectReference.classbin0 -> 943 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/PrimitiveInstantiation.classbin0 -> 949 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/StaticFieldAccess.classbin0 -> 972 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/StaticMethodInvocation.classbin0 -> 988 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/beans/encoder/elements/StringReference.classbin0 -> 867 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/io/ASN1ParsingException.classbin0 -> 453 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/io/Base64InputStream.classbin0 -> 2758 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/io/ClassLoaderObjectInputStream.classbin0 -> 881 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/io/NullOutputStream.classbin0 -> 710 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/io/ObjectIdentityMap2Int.classbin0 -> 2650 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/io/ObjectIdentityWrapper.classbin0 -> 1122 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/io/PlatformHelper.classbin0 -> 1866 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/ArrayHelper.classbin0 -> 716 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/CharData.classbin0 -> 41184 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/ClassHelper.classbin0 -> 3642 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/InstrumentationImpl.classbin0 -> 3425 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/MainThread.classbin0 -> 3204 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/VMInstrumentationImpl.classbin0 -> 1086 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/BeanImpl.classbin0 -> 15568 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/ClassLoadingMXBeanImpl.classbin0 -> 1114 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/CompilationMXBeanImpl.classbin0 -> 1324 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/GarbageCollectorMXBeanImpl.classbin0 -> 900 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/MemoryMXBeanImpl.classbin0 -> 7173 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/MemoryManagerMXBeanImpl.classbin0 -> 1194 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/MemoryPoolMXBeanImpl.classbin0 -> 4031 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/OperatingSystemMXBeanImpl.classbin0 -> 1085 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/RuntimeMXBeanImpl.classbin0 -> 3865 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/ThreadMXBeanImpl.classbin0 -> 5137 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/VMClassLoadingMXBeanImpl.classbin0 -> 475 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/VMCompilationMXBeanImpl.classbin0 -> 384 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.classbin0 -> 440 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/VMMemoryMXBeanImpl.classbin0 -> 897 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/VMMemoryManagerMXBeanImpl.classbin0 -> 1497 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/VMMemoryPoolMXBeanImpl.classbin0 -> 950 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/VMRuntimeMXBeanImpl.classbin0 -> 1273 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/management/VMThreadMXBeanImpl.classbin0 -> 1742 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/reflect/ClassSignatureParser.classbin0 -> 1982 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/reflect/FieldSignatureParser.classbin0 -> 1717 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/reflect/GenericArrayTypeImpl.classbin0 -> 1366 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/reflect/GenericSignatureParser.classbin0 -> 5172 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/reflect/MethodSignatureParser.classbin0 -> 3626 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/reflect/ParameterizedTypeImpl.classbin0 -> 3079 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/reflect/TypeImpl.classbin0 -> 735 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/reflect/TypeSignature.classbin0 -> 4010 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/reflect/TypeVariableImpl.classbin0 -> 1659 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/reflect/UnresolvedTypeVariable.classbin0 -> 1893 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/lang/reflect/WildcardTypeImpl.classbin0 -> 1856 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/Calendar.classbin0 -> 1343 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/Calendar_de.classbin0 -> 715 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/Calendar_en.classbin0 -> 551 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/Calendar_nl.classbin0 -> 660 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleData.classbin0 -> 6225 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleHelper.classbin0 -> 2636 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation.classbin0 -> 328 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_af_ZA.classbin0 -> 2305 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_AE.classbin0 -> 2443 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_BH.classbin0 -> 2442 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_DZ.classbin0 -> 2442 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_EG.classbin0 -> 2442 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_IN.classbin0 -> 2454 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_IQ.classbin0 -> 2442 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_JO.classbin0 -> 2272 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_KW.classbin0 -> 2442 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_LB.classbin0 -> 2272 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_LY.classbin0 -> 2442 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_MA.classbin0 -> 2442 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_OM.classbin0 -> 2442 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_QA.classbin0 -> 2442 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_SD.classbin0 -> 2442 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_SY.classbin0 -> 2304 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_TN.classbin0 -> 2442 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_YE.classbin0 -> 2442 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_be_BY.classbin0 -> 2512 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_bn_IN.classbin0 -> 2597 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_br_FR.classbin0 -> 2272 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_bs_BA.classbin0 -> 2271 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ca_ES.classbin0 -> 2266 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_cs_CZ.classbin0 -> 2328 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_cy_GB.classbin0 -> 2238 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_da_DK.classbin0 -> 2290 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_de.classbin0 -> 3408 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_AT.classbin0 -> 2272 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_BE.classbin0 -> 2296 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_CH.classbin0 -> 2297 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_DE.classbin0 -> 2296 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_LU.classbin0 -> 2298 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_el_GR.classbin0 -> 2526 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en.classbin0 -> 5113 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_AU.classbin0 -> 2289 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_BW.classbin0 -> 1713 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_CA.classbin0 -> 2313 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_DK.classbin0 -> 2292 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_GB.classbin0 -> 2290 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_HK.classbin0 -> 2312 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_IE.classbin0 -> 2290 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_IN.classbin0 -> 2324 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_NZ.classbin0 -> 2289 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_PH.classbin0 -> 2313 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_SG.classbin0 -> 2309 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_US.classbin0 -> 2315 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_ZA.classbin0 -> 2289 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_ZW.classbin0 -> 1713 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_AR.classbin0 -> 2271 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_BO.classbin0 -> 2272 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_CL.classbin0 -> 2271 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_CO.classbin0 -> 2271 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_CR.classbin0 -> 2271 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_DO.classbin0 -> 2271 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_EC.classbin0 -> 2271 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_ES.classbin0 -> 2269 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_GT.classbin0 -> 2271 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_HN.classbin0 -> 2272 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_MX.classbin0 -> 2271 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_NI.classbin0 -> 2272 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PA.classbin0 -> 2272 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PE.classbin0 -> 2272 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PR.classbin0 -> 2271 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PY.classbin0 -> 2273 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_SV.classbin0 -> 2272 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_US.classbin0 -> 2292 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_UY.classbin0 -> 2272 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_VE.classbin0 -> 2273 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_et_EE.classbin0 -> 2300 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_eu_ES.classbin0 -> 2293 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_fa_IR.classbin0 -> 2430 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_fi_FI.classbin0 -> 2380 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_fo_FO.classbin0 -> 2317 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_BE.classbin0 -> 2267 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_CA.classbin0 -> 2269 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_CH.classbin0 -> 2263 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_FR.classbin0 -> 2261 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_LU.classbin0 -> 2264 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ga_IE.classbin0 -> 2367 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_gd_GB.classbin0 -> 2380 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_gl_ES.classbin0 -> 2265 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_gv_GB.classbin0 -> 2369 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_he_IL.classbin0 -> 2395 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_hi_IN.classbin0 -> 2533 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_hr_HR.classbin0 -> 2295 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_hu_HU.classbin0 -> 2289 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_id_ID.classbin0 -> 2277 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_it_CH.classbin0 -> 2308 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_it_IT.classbin0 -> 2280 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_iw_IL.classbin0 -> 2395 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ja_JP.classbin0 -> 2290 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ka_GE.classbin0 -> 2718 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_kl_GL.classbin0 -> 2346 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ko_KR.classbin0 -> 2371 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_kw_GB.classbin0 -> 2339 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_lt_LT.classbin0 -> 2353 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_lv_LV.classbin0 -> 2342 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_mi_NZ.classbin0 -> 2370 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_mk_MK.classbin0 -> 2468 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_mr_IN.classbin0 -> 2496 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_mt_MT.classbin0 -> 2331 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_nl.classbin0 -> 4111 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_nl_BE.classbin0 -> 2273 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_nl_NL.classbin0 -> 2266 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_nn_NO.classbin0 -> 2281 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_no_NO.classbin0 -> 2287 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_oc_FR.classbin0 -> 2265 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_pl_PL.classbin0 -> 2295 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_pt_BR.classbin0 -> 2279 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_pt_PT.classbin0 -> 2280 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ro_RO.classbin0 -> 2283 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ru_RU.classbin0 -> 2490 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ru_UA.classbin0 -> 2472 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_se_NO.classbin0 -> 2415 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_sk_SK.classbin0 -> 2283 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_sl_SI.classbin0 -> 2267 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_sq_AL.classbin0 -> 2332 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_sr_YU.classbin0 -> 2245 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_sv_FI.classbin0 -> 2293 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_sv_SE.classbin0 -> 2293 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ta_IN.classbin0 -> 2452 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_te_IN.classbin0 -> 2582 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_tg_TJ.classbin0 -> 2490 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_tl_PH.classbin0 -> 2319 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_tr_TR.classbin0 -> 2562 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_uk_UA.classbin0 -> 2501 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_ur_PK.classbin0 -> 2199 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_uz_UZ.classbin0 -> 2292 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_vi_VN.classbin0 -> 2449 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_yi_US.classbin0 -> 2525 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_CN.classbin0 -> 2355 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_HK.classbin0 -> 2369 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_SG.classbin0 -> 2153 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_TW.classbin0 -> 2376 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/math/MPN.classbin0 -> 7842 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/BASE64.classbin0 -> 3190 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/CRLFInputStream.classbin0 -> 1605 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/CRLFOutputStream.classbin0 -> 1880 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/DefaultContentHandlerFactory.classbin0 -> 1353 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/DefaultProxySelector.classbin0 -> 1184 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/EmptyX509TrustManager.classbin0 -> 931 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/GetLocalHostAction.classbin0 -> 564 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/HeaderFieldHelper.classbin0 -> 1930 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/ImageHandler.classbin0 -> 626 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/IndexListParser.classbin0 -> 2568 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/LineInputStream.classbin0 -> 2236 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/PlainDatagramSocketImpl.classbin0 -> 3097 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketInputStream.classbin0 -> 810 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketOutputStream.classbin0 -> 720 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/PlainSocketImpl.classbin0 -> 3295 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/URLParseError.classbin0 -> 349 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/loader/FileResource.classbin0 -> 1259 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/loader/FileURLLoader.classbin0 -> 2171 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/loader/JarURLLoader.classbin0 -> 5457 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/loader/JarURLResource.classbin0 -> 2230 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/loader/RemoteResource.classbin0 -> 1051 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/loader/RemoteURLLoader.classbin0 -> 1900 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/loader/Resource.classbin0 -> 1229 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/loader/URLLoader.classbin0 -> 1716 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/loader/URLStreamHandlerCache.classbin0 -> 1273 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/local/LocalServerSocket.classbin0 -> 3487 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/local/LocalSocket.classbin0 -> 5583 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/local/LocalSocketAddress.classbin0 -> 1183 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/local/LocalSocketImpl$LocalInputStream.classbin0 -> 1624 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/local/LocalSocketImpl$LocalOutputStream.classbin0 -> 1247 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/local/LocalSocketImpl.classbin0 -> 4520 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/core/Connection.classbin0 -> 3158 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/core/CoreInputStream.classbin0 -> 1518 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/core/Handler.classbin0 -> 588 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/file/Connection$StaticData.classbin0 -> 1010 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/file/Connection.classbin0 -> 5576 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/file/Handler.classbin0 -> 1057 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/ActiveModeDTP.classbin0 -> 3794 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/BlockInputStream.classbin0 -> 1694 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/BlockOutputStream.classbin0 -> 1454 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/CompressedInputStream.classbin0 -> 2403 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/CompressedOutputStream.classbin0 -> 2753 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/DTP.classbin0 -> 382 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/DTPInputStream.classbin0 -> 867 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/DTPOutputStream.classbin0 -> 875 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPConnection.classbin0 -> 16843 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPException.classbin0 -> 685 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPResponse.classbin0 -> 885 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPURLConnection$ClosingInputStream.classbin0 -> 969 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPURLConnection$ClosingOutputStream.classbin0 -> 977 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPURLConnection.classbin0 -> 5875 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/Handler.classbin0 -> 673 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/PassiveModeDTP.classbin0 -> 3282 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/StreamInputStream.classbin0 -> 1089 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/ftp/StreamOutputStream.classbin0 -> 1021 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/gcjlib/Connection.classbin0 -> 2252 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/gcjlib/Handler.classbin0 -> 594 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/Authenticator.classbin0 -> 223 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.classbin0 -> 942 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/ChunkedInputStream.classbin0 -> 2748 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/Cookie.classbin0 -> 1894 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/CookieManager.classbin0 -> 294 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/Credentials.classbin0 -> 648 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/HTTPConnection$Pool$Reaper.classbin0 -> 1482 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/HTTPConnection$Pool.classbin0 -> 3489 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/HTTPConnection.classbin0 -> 10087 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/HTTPDateFormat.classbin0 -> 6629 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/HTTPURLConnection$1.classbin0 -> 976 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/HTTPURLConnection.classbin0 -> 12123 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/Handler.classbin0 -> 677 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/Headers$HeaderElement.classbin0 -> 571 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/Headers.classbin0 -> 5178 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/LimitedLengthInputStream.classbin0 -> 2288 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/Request.classbin0 -> 15584 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/RequestBodyWriter.classbin0 -> 221 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/Response.classbin0 -> 2213 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/ResponseHeaderHandler.classbin0 -> 193 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/http/SimpleCookieManager.classbin0 -> 3051 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/https/Handler.classbin0 -> 680 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/jar/Connection$JarFileCache.classbin0 -> 2288 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/jar/Connection.classbin0 -> 3397 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/net/protocol/jar/Handler.classbin0 -> 3822 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/ChannelInputStream.classbin0 -> 1104 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/ChannelOutputStream.classbin0 -> 913 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/ChannelReader.classbin0 -> 2954 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/ChannelWriter.classbin0 -> 2972 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/DatagramChannelImpl.classbin0 -> 5081 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/DatagramChannelSelectionKey.classbin0 -> 810 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/FileLockImpl.classbin0 -> 1125 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/InputStreamChannel.classbin0 -> 1187 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/NIOConstants.classbin0 -> 346 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/NIODatagramSocket.classbin0 -> 837 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/NIOServerSocket.classbin0 -> 1431 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/NIOSocket.classbin0 -> 992 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/OutputStreamChannel.classbin0 -> 1182 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/PipeImpl$SinkChannelImpl.classbin0 -> 1856 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/PipeImpl$SourceChannelImpl.classbin0 -> 1865 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/PipeImpl.classbin0 -> 1072 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/SelectionKeyImpl.classbin0 -> 1511 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/SelectorImpl.classbin0 -> 5965 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/SelectorProviderImpl.classbin0 -> 1290 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/ServerSocketChannelImpl.classbin0 -> 2266 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/ServerSocketChannelSelectionKey.classbin0 -> 826 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/SocketChannelImpl.classbin0 -> 5935 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/SocketChannelSelectionKey.classbin0 -> 1027 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/SocketChannelSelectionKeyImpl.classbin0 -> 843 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/VMChannel.classbin0 -> 2528 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/VMChannelOwner.classbin0 -> 174 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/VMPipe.classbin0 -> 401 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/VMSelector.classbin0 -> 359 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/channels/FileChannelImpl.classbin0 -> 7914 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ByteCharset$Decoder.classbin0 -> 1300 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ByteCharset$Encoder.classbin0 -> 2042 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ByteCharset.classbin0 -> 1313 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp424.classbin0 -> 2396 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp437.classbin0 -> 2429 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp737.classbin0 -> 2429 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp775.classbin0 -> 2429 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp850.classbin0 -> 2429 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp852.classbin0 -> 2429 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp855.classbin0 -> 2450 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp857.classbin0 -> 2452 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp860.classbin0 -> 2450 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp861.classbin0 -> 2450 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp862.classbin0 -> 2450 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp863.classbin0 -> 2450 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp864.classbin0 -> 2738 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp865.classbin0 -> 2450 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp866.classbin0 -> 2450 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp869.classbin0 -> 2446 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Cp874.classbin0 -> 2403 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/EncodingHelper.classbin0 -> 3137 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_1$Decoder.classbin0 -> 1161 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_1$Encoder.classbin0 -> 1632 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_1.classbin0 -> 1311 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_13.classbin0 -> 2683 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_15.classbin0 -> 2869 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_2.classbin0 -> 2817 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_3.classbin0 -> 2815 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_4.classbin0 -> 2817 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_5.classbin0 -> 2808 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_6.classbin0 -> 2857 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_7.classbin0 -> 2871 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_8.classbin0 -> 2827 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_9.classbin0 -> 2841 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/KOI_8.classbin0 -> 2594 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/MS874.classbin0 -> 2403 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/MacCentralEurope.classbin0 -> 2478 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/MacCroatian.classbin0 -> 2462 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/MacCyrillic.classbin0 -> 2458 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/MacDingbat.classbin0 -> 2527 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/MacGreek.classbin0 -> 2446 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/MacIceland.classbin0 -> 2458 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/MacRoman.classbin0 -> 2458 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/MacRomania.classbin0 -> 2458 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/MacSymbol.classbin0 -> 2488 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/MacThai.classbin0 -> 2414 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/MacTurkish.classbin0 -> 2462 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Provider$1.classbin0 -> 581 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Provider.classbin0 -> 5340 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/US_ASCII$Decoder.classbin0 -> 1248 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/US_ASCII$Encoder.classbin0 -> 1622 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/US_ASCII.classbin0 -> 1301 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/UTF_16.classbin0 -> 1283 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/UTF_16BE.classbin0 -> 1438 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/UTF_16Decoder.classbin0 -> 2637 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/UTF_16Encoder.classbin0 -> 2308 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/UTF_16LE.classbin0 -> 1340 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/UTF_8$Decoder.classbin0 -> 3229 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/UTF_8$Encoder.classbin0 -> 2124 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/UTF_8.classbin0 -> 1316 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/UnicodeLittle.classbin0 -> 1218 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Windows1250.classbin0 -> 2657 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Windows1251.classbin0 -> 2603 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Windows1252.classbin0 -> 2585 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Windows1253.classbin0 -> 2587 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Windows1254.classbin0 -> 2597 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Windows1255.classbin0 -> 2581 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Windows1256.classbin0 -> 2599 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Windows1257.classbin0 -> 2592 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/nio/charset/Windows1258.classbin0 -> 2595 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/RMIMarshalledObjectInputStream.classbin0 -> 875 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/RMIMarshalledObjectOutputStream.classbin0 -> 1182 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/activation/ActivationSystemTransient.classbin0 -> 8308 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/activation/BidiTable.classbin0 -> 2027 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/activation/DefaultActivationGroup.classbin0 -> 3584 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/activation/DefaultActivationSystem.classbin0 -> 1936 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl$RefProtector.classbin0 -> 1143 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl.classbin0 -> 1554 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl_Skel.classbin0 -> 3350 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl_Stub.classbin0 -> 4340 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/dgc/LeaseRenewingTask$LeaseTimerTask.classbin0 -> 636 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/dgc/LeaseRenewingTask.classbin0 -> 3205 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl.classbin0 -> 4240 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl_Skel.classbin0 -> 4107 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl_Stub.classbin0 -> 6139 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/ActivatableRef.classbin0 -> 3872 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/ActivatableServerRef.classbin0 -> 4674 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/CombinedClassLoader.classbin0 -> 1957 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/ConnectionRunnerPool$ConnectionRunner.classbin0 -> 1527 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/ConnectionRunnerPool.classbin0 -> 2673 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/ProtocolConstants.classbin0 -> 719 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/RMIClassLoaderImpl$CacheKey.classbin0 -> 1553 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/RMIClassLoaderImpl$MyClassLoader.classbin0 -> 1385 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/RMIClassLoaderImpl.classbin0 -> 5117 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/RMIDefaultSocketFactory.classbin0 -> 814 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/RMIHashes.classbin0 -> 2179 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/RMIIncomingThread.classbin0 -> 898 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/RMIObjectInputStream.classbin0 -> 3019 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/RMIObjectOutputStream.classbin0 -> 2997 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/RMIVoidValue.classbin0 -> 411 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/TripleKey.classbin0 -> 1315 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/UnicastConnection.classbin0 -> 4367 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/UnicastConnectionManager$1.classbin0 -> 1917 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/UnicastConnectionManager.classbin0 -> 7405 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/UnicastRef.classbin0 -> 10033 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteCall$DummyObjectInputStream.classbin0 -> 3682 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteCall$DummyObjectOutputStream.classbin0 -> 3218 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteCall.classbin0 -> 6149 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteStub.classbin0 -> 569 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/UnicastServer.classbin0 -> 6736 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/server/UnicastServerRef.classbin0 -> 9296 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/Configuration.classbin0 -> 174 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/Engine.classbin0 -> 5340 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/OID.classbin0 -> 6174 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/PolicyFile$1.classbin0 -> 2136 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/PolicyFile.classbin0 -> 12883 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/Properties$1.classbin0 -> 753 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/Properties.classbin0 -> 5002 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/Registry.classbin0 -> 7593 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/Requires.classbin0 -> 601 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/action/GetPropertyAction.classbin0 -> 1489 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/action/GetSecurityPropertyAction.classbin0 -> 1525 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/action/SetAccessibleAction.classbin0 -> 914 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/ber/BER.classbin0 -> 419 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/ber/BEREncodingException.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/ber/BERReader.classbin0 -> 1404 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/ber/BERValue.classbin0 -> 1093 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/der/BitString.classbin0 -> 3755 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/der/DER.classbin0 -> 1355 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/der/DEREncodingException.classbin0 -> 473 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/der/DERReader.classbin0 -> 6819 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/der/DERValue.classbin0 -> 3556 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/der/DERWriter.classbin0 -> 6118 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/BaseHash.classbin0 -> 2006 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/HashFactory.classbin0 -> 2386 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/Haval.classbin0 -> 16340 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/IMessageDigest.classbin0 -> 410 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/MD2.classbin0 -> 4558 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/MD4.classbin0 -> 6039 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/MD5.classbin0 -> 7138 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/RipeMD128.classbin0 -> 5286 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/RipeMD160.classbin0 -> 6249 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/Sha160.classbin0 -> 3824 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/Sha256.classbin0 -> 5078 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/Sha384.classbin0 -> 6155 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/Sha512.classbin0 -> 6405 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/Tiger.classbin0 -> 27969 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/hash/Whirlpool.classbin0 -> 10870 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/hash/HavalSpi.classbin0 -> 375 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/hash/MD2Spi.classbin0 -> 367 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/hash/MD4Spi.classbin0 -> 367 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/hash/MD5Spi.classbin0 -> 367 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/hash/MessageDigestAdapter.classbin0 -> 1911 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/hash/RipeMD128Spi.classbin0 -> 391 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/hash/RipeMD160Spi.classbin0 -> 391 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/hash/Sha160Spi.classbin0 -> 380 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/hash/Sha256Spi.classbin0 -> 380 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/hash/Sha384Spi.classbin0 -> 380 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/hash/Sha512Spi.classbin0 -> 380 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/hash/TigerSpi.classbin0 -> 375 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/hash/WhirlpoolSpi.classbin0 -> 391 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/prng/HavalRandomSpi.classbin0 -> 392 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/prng/MD2RandomSpi.classbin0 -> 384 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/prng/MD4RandomSpi.classbin0 -> 384 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/prng/MD5RandomSpi.classbin0 -> 384 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/prng/RipeMD128RandomSpi.classbin0 -> 408 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/prng/RipeMD160RandomSpi.classbin0 -> 408 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/prng/SecureRandomAdapter.classbin0 -> 1358 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/prng/Sha160RandomSpi.classbin0 -> 397 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/prng/Sha256RandomSpi.classbin0 -> 397 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/prng/Sha384RandomSpi.classbin0 -> 397 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/prng/Sha512RandomSpi.classbin0 -> 397 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/prng/TigerRandomSpi.classbin0 -> 392 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/prng/WhirlpoolRandomSpi.classbin0 -> 408 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/DSSKeyFactory.classbin0 -> 5029 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/DSSKeyPairGeneratorSpi.classbin0 -> 3213 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/DSSParameters.classbin0 -> 4369 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/DSSParametersGenerator.classbin0 -> 2984 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/DSSRawSignatureSpi.classbin0 -> 504 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/EncodedKeyFactory.classbin0 -> 9348 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/KeyPairGeneratorAdapter.classbin0 -> 1043 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/MD2withRSA.classbin0 -> 509 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/MD5withRSA.classbin0 -> 509 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/RSAKeyFactory.classbin0 -> 5638 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/RSAKeyPairGeneratorSpi.classbin0 -> 1615 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/RSAPSSRawSignatureSpi.classbin0 -> 520 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/SHA160withDSS.classbin0 -> 490 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/SHA160withRSA.classbin0 -> 522 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/SHA256withRSA.classbin0 -> 522 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/SHA384withRSA.classbin0 -> 522 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/SHA512withRSA.classbin0 -> 522 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/jce/sig/SignatureAdapter.classbin0 -> 4861 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/IKeyPairCodec.classbin0 -> 553 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/IKeyPairGenerator.classbin0 -> 259 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/KeyPairCodecFactory.classbin0 -> 5797 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/KeyPairGeneratorFactory.classbin0 -> 2362 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/dss/DSSKey.classbin0 -> 2829 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairGenerator.classbin0 -> 7539 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.classbin0 -> 5128 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairRawCodec.classbin0 -> 4553 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairX509Codec.classbin0 -> 4955 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/dss/DSSPrivateKey.classbin0 -> 3030 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/dss/DSSPublicKey.classbin0 -> 3030 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/dss/FIPS186.classbin0 -> 3701 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/rsa/GnuRSAKey.classbin0 -> 2347 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/rsa/GnuRSAPrivateKey.classbin0 -> 4618 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/rsa/GnuRSAPublicKey.classbin0 -> 2694 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairGenerator.classbin0 -> 4142 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.classbin0 -> 6261 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairRawCodec.classbin0 -> 4068 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairX509Codec.classbin0 -> 4663 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/pkcs/PKCS7Data.classbin0 -> 668 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/pkcs/PKCS7SignedData.classbin0 -> 8206 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/pkcs/SignerInfo.classbin0 -> 6501 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/prng/BasePRNG.classbin0 -> 2892 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/prng/EntropySource.classbin0 -> 181 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/prng/IRandom.classbin0 -> 561 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/prng/LimitReachedException.classbin0 -> 478 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/prng/MDGenerator.classbin0 -> 2078 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/prng/PRNGFactory.classbin0 -> 1073 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/prng/RandomEvent.classbin0 -> 1015 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/prng/RandomEventListener.classbin0 -> 240 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/provider/CollectionCertStoreImpl.classbin0 -> 2073 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/provider/DefaultPolicy.classbin0 -> 911 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/provider/Gnu$1.classbin0 -> 12433 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/provider/Gnu.classbin0 -> 805 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/provider/PKIXCertPathValidatorImpl.classbin0 -> 14032 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/provider/X509CertificateFactory.classbin0 -> 5056 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/BaseSignature.classbin0 -> 3996 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/ISignature.classbin0 -> 762 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/ISignatureCodec.classbin0 -> 317 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/SignatureCodecFactory.classbin0 -> 3489 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/SignatureFactory.classbin0 -> 1382 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/dss/DSSSignature.classbin0 -> 5250 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/dss/DSSSignatureRawCodec.classbin0 -> 2143 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/dss/DSSSignatureX509Codec.classbin0 -> 2596 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/rsa/EME_PKCS1_V1_5.classbin0 -> 3513 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/rsa/EMSA_PKCS1_V1_5.classbin0 -> 3423 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/rsa/EMSA_PSS.classbin0 -> 3734 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/rsa/RSA.classbin0 -> 4209 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPKCS1V1_5Signature.classbin0 -> 3399 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPKCS1V1_5SignatureRawCodec.classbin0 -> 1762 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPKCS1V1_5SignatureX509Codec.classbin0 -> 924 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPSSSignature.classbin0 -> 4129 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPSSSignatureRawCodec.classbin0 -> 1690 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/sig/rsa/RSASignatureFactory.classbin0 -> 2802 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/util/Base64.classbin0 -> 4996 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/util/ByteArray.classbin0 -> 2137 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/util/ByteBufferOutputStream.classbin0 -> 2085 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/util/DerUtil.classbin0 -> 893 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/util/ExpirableObject$Destroyer.classbin0 -> 841 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/util/ExpirableObject.classbin0 -> 1264 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/util/FormatUtil.classbin0 -> 1246 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/util/IntegerUtil$1.classbin0 -> 689 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/util/IntegerUtil.classbin0 -> 1193 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/util/PRNG.classbin0 -> 1822 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/util/Prime.classbin0 -> 1776 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/util/Sequence.classbin0 -> 1738 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/util/SimpleList.classbin0 -> 2443 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/util/Util.classbin0 -> 7616 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/GnuPKIExtension.classbin0 -> 314 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/PolicyNodeImpl.classbin0 -> 4472 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/Util.classbin0 -> 2815 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/X500DistinguishedName.classbin0 -> 11414 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/X509CRL.classbin0 -> 9760 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/X509CRLEntry.classbin0 -> 5338 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/X509CRLSelectorImpl.classbin0 -> 2421 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/X509CertPath.classbin0 -> 5636 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/X509CertSelectorImpl.classbin0 -> 3382 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/X509Certificate.classbin0 -> 17078 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/AuthorityKeyIdentifier.classbin0 -> 2707 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/BasicConstraints.classbin0 -> 2690 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/CRLNumber.classbin0 -> 1879 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/CertificatePolicies.classbin0 -> 4908 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/ExtendedKeyUsage.classbin0 -> 2069 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/Extension$Value.classbin0 -> 1195 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/Extension.classbin0 -> 4712 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/GeneralNames.classbin0 -> 3599 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/IssuerAlternativeNames.classbin0 -> 1334 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/KeyUsage.classbin0 -> 1954 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/PolicyConstraint.classbin0 -> 2187 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/PolicyMappings.classbin0 -> 2433 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.classbin0 -> 2082 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/ReasonCode.classbin0 -> 1609 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/SubjectAlternativeNames.classbin0 -> 1337 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/security/x509/ext/SubjectKeyIdentifier.classbin0 -> 1612 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/text/AttributedFormatBuffer.classbin0 -> 4054 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/text/BaseBreakIterator.classbin0 -> 1503 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/text/CharacterBreakIterator.classbin0 -> 3120 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/text/FormatBuffer.classbin0 -> 613 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/text/FormatCharacterIterator.classbin0 -> 7158 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/text/LineBreakIterator.classbin0 -> 2355 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/text/SentenceBreakIterator.classbin0 -> 2834 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/text/StringFormatBuffer.classbin0 -> 2306 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/text/WordBreakIterator.classbin0 -> 2956 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/DoubleEnumeration.classbin0 -> 1348 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/EmptyEnumeration.classbin0 -> 795 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$1.classbin0 -> 2951 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$WeakBucket$WeakEntry.classbin0 -> 2038 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$WeakBucket.classbin0 -> 1120 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$WeakEntrySet.classbin0 -> 996 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap.classbin0 -> 5474 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/jar/JarUtils.classbin0 -> 9045 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/prefs/EventDispatcher.classbin0 -> 1264 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/prefs/FileBasedFactory.classbin0 -> 921 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/prefs/FileBasedPreferences$1.classbin0 -> 924 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/prefs/FileBasedPreferences.classbin0 -> 4473 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/prefs/GConfBasedFactory.classbin0 -> 869 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/prefs/GConfBasedPreferences.classbin0 -> 5305 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/prefs/MemoryBasedFactory.classbin0 -> 880 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/prefs/MemoryBasedPreferences.classbin0 -> 2204 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/prefs/NodeReader.classbin0 -> 4168 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/prefs/NodeWriter.classbin0 -> 5937 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/prefs/gconf/GConfNativePeer.classbin0 -> 2599 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/BacktrackStack$Backtrack.classbin0 -> 911 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/BacktrackStack.classbin0 -> 1487 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/CharIndexed.classbin0 -> 549 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/CharIndexedCharArray.classbin0 -> 508 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/CharIndexedCharSequence.classbin0 -> 2168 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/CharIndexedInputStream.classbin0 -> 3586 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/CharIndexedString.classbin0 -> 458 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/CharIndexedStringBuffer.classbin0 -> 488 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RE$CharExpression.classbin0 -> 654 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RE$CharUnit.classbin0 -> 516 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RE$IntPair.classbin0 -> 515 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RE$NamedProperty.classbin0 -> 549 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RE$ParseCharClassResult.classbin0 -> 632 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RE.classbin0 -> 29673 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/REException.classbin0 -> 1846 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/REFilterInputStream.classbin0 -> 2226 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/REMatch.classbin0 -> 4207 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/REMatchEnumeration.classbin0 -> 2007 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RESyntax.classbin0 -> 5039 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/REToken.classbin0 -> 4189 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenAny.classbin0 -> 1863 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenBackRef.classbin0 -> 1555 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenChar.classbin0 -> 2786 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenEnd.classbin0 -> 2560 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenEndOfPreviousMatch.classbin0 -> 1604 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenEndSub.classbin0 -> 1668 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenIndependent.classbin0 -> 1615 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenLookAhead.classbin0 -> 1537 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenLookBehind$RETokenMatchHereOnly.classbin0 -> 1065 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenLookBehind.classbin0 -> 2393 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$1.classbin0 -> 831 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$Handler.classbin0 -> 566 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$POSIXHandler.classbin0 -> 1238 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$UnicodeBlockHandler.classbin0 -> 948 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$UnicodeCategoriesHandler.classbin0 -> 868 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$UnicodeCategoryHandler.classbin0 -> 782 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty.classbin0 -> 6298 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenOneOf.classbin0 -> 6619 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenPOSIX.classbin0 -> 3820 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenRange.classbin0 -> 2109 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$DoablesFinder.classbin0 -> 2400 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$FindMatchControl.classbin0 -> 596 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$FindMatchControlStack.classbin0 -> 1698 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$StackedInfo.classbin0 -> 999 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$TryAnotherResult.classbin0 -> 768 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated.classbin0 -> 9441 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenStart.classbin0 -> 2229 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/RETokenWordBoundary.classbin0 -> 2115 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/util/regex/UncheckedRE.classbin0 -> 1096 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/RSACipherImpl.classbin0 -> 7374 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/assembly/Assembly.classbin0 -> 2993 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/assembly/Cascade.classbin0 -> 5202 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/assembly/CascadeStage.classbin0 -> 2122 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/assembly/CascadeTransformer.classbin0 -> 2530 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/assembly/DeflateTransformer.classbin0 -> 3183 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/assembly/Direction.classbin0 -> 863 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/assembly/LoopbackTransformer.classbin0 -> 1478 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/assembly/ModeStage.classbin0 -> 2475 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/assembly/Operation.classbin0 -> 679 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/assembly/PaddingTransformer.classbin0 -> 2783 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/assembly/Stage.classbin0 -> 2354 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/assembly/Transformer.classbin0 -> 5430 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/assembly/TransformerException.classbin0 -> 1878 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/Anubis.classbin0 -> 8212 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/BaseCipher.classbin0 -> 4395 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/Blowfish$Block.classbin0 -> 672 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/Blowfish$Context.classbin0 -> 1097 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/Blowfish.classbin0 -> 21891 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/Cast5$Cast5Key.classbin0 -> 1106 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/Cast5.classbin0 -> 38541 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/CipherFactory.classbin0 -> 2302 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/DES$Context.classbin0 -> 1058 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/DES.classbin0 -> 13928 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/IBlockCipher.classbin0 -> 829 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/IBlockCipherSpi.classbin0 -> 425 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/Khazad.classbin0 -> 7325 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/NullCipher.classbin0 -> 1919 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/Rijndael.classbin0 -> 11637 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/Serpent$Key.classbin0 -> 5565 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/Serpent.classbin0 -> 28958 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/Square.classbin0 -> 7421 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/TripleDES$Context.classbin0 -> 732 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/TripleDES.classbin0 -> 3879 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/Twofish.classbin0 -> 11522 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/cipher/WeakKeyException.classbin0 -> 479 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/DiffieHellmanImpl.classbin0 -> 3619 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/GnuCrypto$1.classbin0 -> 26862 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/GnuCrypto.classbin0 -> 1116 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/GnuSasl$1.classbin0 -> 2082 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/GnuSasl.classbin0 -> 927 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacHaval.classbin0 -> 469 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacMD2.classbin0 -> 461 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacMD4.classbin0 -> 461 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacMD5.classbin0 -> 461 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacRipeMD128.classbin0 -> 485 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacRipeMD160.classbin0 -> 485 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA1.classbin0 -> 465 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA256.classbin0 -> 473 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA384.classbin0 -> 473 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA512.classbin0 -> 473 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacTiger.classbin0 -> 469 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacWhirlpool.classbin0 -> 485 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory.classbin0 -> 3819 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AES128KeyWrapSpi.classbin0 -> 431 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AES192KeyWrapSpi.classbin0 -> 431 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AES256KeyWrapSpi.classbin0 -> 431 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AESKeyWrapSpi.classbin0 -> 800 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AESSpi.classbin0 -> 1559 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/ARCFourSpi.classbin0 -> 3913 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AnubisSpi.classbin0 -> 375 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/BlowfishSpi.classbin0 -> 383 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/Cast5Spi.classbin0 -> 371 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/CipherAdapter.classbin0 -> 9825 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/DESSpi.classbin0 -> 363 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/KeyWrappingAlgorithmAdapter.classbin0 -> 8363 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/KhazadSpi.classbin0 -> 375 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/NullCipherSpi.classbin0 -> 385 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$AES.classbin0 -> 480 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Anubis.classbin0 -> 489 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Blowfish.classbin0 -> 495 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Cast5.classbin0 -> 486 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$DES.classbin0 -> 480 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Khazad.classbin0 -> 489 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Serpent.classbin0 -> 492 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Square.classbin0 -> 489 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$TripleDES.classbin0 -> 498 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Twofish.classbin0 -> 492 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval.classbin0 -> 1411 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$AES.classbin0 -> 472 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Anubis.classbin0 -> 481 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Blowfish.classbin0 -> 487 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Cast5.classbin0 -> 478 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$DES.classbin0 -> 472 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Khazad.classbin0 -> 481 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Serpent.classbin0 -> 484 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Square.classbin0 -> 481 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$TripleDES.classbin0 -> 490 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Twofish.classbin0 -> 484 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2.classbin0 -> 1383 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$AES.classbin0 -> 472 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Anubis.classbin0 -> 481 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Blowfish.classbin0 -> 487 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Cast5.classbin0 -> 478 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$DES.classbin0 -> 472 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Khazad.classbin0 -> 481 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Serpent.classbin0 -> 484 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Square.classbin0 -> 481 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$TripleDES.classbin0 -> 490 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Twofish.classbin0 -> 484 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4.classbin0 -> 1383 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$AES.classbin0 -> 472 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Anubis.classbin0 -> 481 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Blowfish.classbin0 -> 487 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Cast5.classbin0 -> 478 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$DES.classbin0 -> 472 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Khazad.classbin0 -> 481 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Serpent.classbin0 -> 484 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Square.classbin0 -> 481 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$TripleDES.classbin0 -> 490 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Twofish.classbin0 -> 484 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5.classbin0 -> 1383 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$AES.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Anubis.classbin0 -> 505 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Blowfish.classbin0 -> 511 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Cast5.classbin0 -> 502 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$DES.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Khazad.classbin0 -> 505 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Serpent.classbin0 -> 508 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Square.classbin0 -> 505 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$TripleDES.classbin0 -> 514 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Twofish.classbin0 -> 508 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128.classbin0 -> 1467 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$AES.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Anubis.classbin0 -> 505 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Blowfish.classbin0 -> 511 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Cast5.classbin0 -> 502 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$DES.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Khazad.classbin0 -> 505 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Serpent.classbin0 -> 508 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Square.classbin0 -> 505 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$TripleDES.classbin0 -> 514 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Twofish.classbin0 -> 508 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160.classbin0 -> 1467 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$AES.classbin0 -> 476 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Anubis.classbin0 -> 485 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Blowfish.classbin0 -> 491 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Cast5.classbin0 -> 482 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$DES.classbin0 -> 476 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Khazad.classbin0 -> 485 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Serpent.classbin0 -> 488 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Square.classbin0 -> 485 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$TripleDES.classbin0 -> 494 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Twofish.classbin0 -> 488 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1.classbin0 -> 1397 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$AES.classbin0 -> 484 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Anubis.classbin0 -> 493 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Blowfish.classbin0 -> 499 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Cast5.classbin0 -> 490 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$DES.classbin0 -> 484 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Khazad.classbin0 -> 493 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Serpent.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Square.classbin0 -> 493 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$TripleDES.classbin0 -> 502 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Twofish.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256.classbin0 -> 1426 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$AES.classbin0 -> 484 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Anubis.classbin0 -> 493 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Blowfish.classbin0 -> 499 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Cast5.classbin0 -> 490 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$DES.classbin0 -> 484 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Khazad.classbin0 -> 493 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Serpent.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Square.classbin0 -> 493 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$TripleDES.classbin0 -> 502 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Twofish.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384.classbin0 -> 1426 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$AES.classbin0 -> 484 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Anubis.classbin0 -> 493 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Blowfish.classbin0 -> 499 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Cast5.classbin0 -> 490 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$DES.classbin0 -> 484 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Khazad.classbin0 -> 493 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Serpent.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Square.classbin0 -> 493 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$TripleDES.classbin0 -> 502 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Twofish.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512.classbin0 -> 1426 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$AES.classbin0 -> 480 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Anubis.classbin0 -> 489 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Blowfish.classbin0 -> 495 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Cast5.classbin0 -> 486 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$DES.classbin0 -> 480 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Khazad.classbin0 -> 489 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Serpent.classbin0 -> 492 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Square.classbin0 -> 489 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$TripleDES.classbin0 -> 498 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Twofish.classbin0 -> 492 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger.classbin0 -> 1411 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$AES.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Anubis.classbin0 -> 505 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Blowfish.classbin0 -> 511 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Cast5.classbin0 -> 502 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$DES.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Khazad.classbin0 -> 505 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Serpent.classbin0 -> 508 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Square.classbin0 -> 505 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$TripleDES.classbin0 -> 514 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Twofish.classbin0 -> 508 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool.classbin0 -> 1467 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2.classbin0 -> 4591 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/RijndaelSpi.classbin0 -> 386 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/SerpentSpi.classbin0 -> 379 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/SquareSpi.classbin0 -> 375 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/TripleDESKeyWrapSpi.classbin0 -> 460 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/TripleDESSpi.classbin0 -> 387 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/cipher/TwofishSpi.classbin0 -> 379 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/AnubisKeyGeneratorImpl.classbin0 -> 414 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/AnubisSecretKeyFactoryImpl.classbin0 -> 386 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/BlowfishKeyGeneratorImpl.classbin0 -> 422 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/BlowfishSecretKeyFactoryImpl.classbin0 -> 392 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/Cast5KeyGeneratorImpl.classbin0 -> 410 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/Cast5SecretKeyFactoryImpl.classbin0 -> 383 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/DESKeyGeneratorImpl.classbin0 -> 1080 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/DESSecretKeyFactoryImpl.classbin0 -> 1589 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/DESedeSecretKeyFactoryImpl.classbin0 -> 1599 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/KhazadKeyGeneratorImpl.classbin0 -> 414 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/KhazadSecretKeyFactoryImpl.classbin0 -> 386 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/RijndaelKeyGeneratorImpl.classbin0 -> 422 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/RijndaelSecretKeyFactoryImpl.classbin0 -> 392 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/SecretKeyFactoryImpl.classbin0 -> 1889 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/SecretKeyGeneratorImpl.classbin0 -> 2889 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/SerpentKeyGeneratorImpl.classbin0 -> 418 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/SerpentSecretKeyFactoryImpl.classbin0 -> 389 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/SquareKeyGeneratorImpl.classbin0 -> 414 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/SquareSecretKeyFactoryImpl.classbin0 -> 386 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/TripleDESKeyGeneratorImpl.classbin0 -> 426 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/TwofishKeyGeneratorImpl.classbin0 -> 418 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/key/TwofishSecretKeyFactoryImpl.classbin0 -> 389 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/keyring/GnuKeyring.classbin0 -> 9345 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacHavalSpi.classbin0 -> 376 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacMD2Spi.classbin0 -> 368 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacMD4Spi.classbin0 -> 368 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacMD5Spi.classbin0 -> 368 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacRipeMD128Spi.classbin0 -> 392 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacRipeMD160Spi.classbin0 -> 392 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA160Spi.classbin0 -> 381 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA256Spi.classbin0 -> 381 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA384Spi.classbin0 -> 381 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA512Spi.classbin0 -> 381 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacTigerSpi.classbin0 -> 376 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacWhirlpoolSpi.classbin0 -> 392 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/MacAdapter.classbin0 -> 2656 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacAnubisImpl.classbin0 -> 383 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacBlowfishImpl.classbin0 -> 391 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacCast5Impl.classbin0 -> 379 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacDESImpl.classbin0 -> 371 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Anubis.classbin0 -> 517 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Blowfish.classbin0 -> 525 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Cast5.classbin0 -> 513 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$DES.classbin0 -> 505 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Khazad.classbin0 -> 517 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Rijndael.classbin0 -> 525 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Serpent.classbin0 -> 521 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Square.classbin0 -> 517 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$TripleDES.classbin0 -> 529 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Twofish.classbin0 -> 521 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl.classbin0 -> 1213 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacKhazadImpl.classbin0 -> 383 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacRijndaelImpl.classbin0 -> 391 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacSerpentImpl.classbin0 -> 387 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacSquareImpl.classbin0 -> 383 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacTripleDESImpl.classbin0 -> 395 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacTwofishImpl.classbin0 -> 387 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/TMMH16Spi.classbin0 -> 1659 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/UHash32Spi.classbin0 -> 367 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/mac/UMac32Spi.classbin0 -> 1242 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/params/BlockCipherParameters.classbin0 -> 3568 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/params/DEREncodingException.classbin0 -> 485 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/params/DERReader.classbin0 -> 2085 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/params/DERWriter.classbin0 -> 2257 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/prng/ARCFourRandomSpi.classbin0 -> 1418 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/prng/CSPRNGSpi.classbin0 -> 1499 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/prng/FortunaImpl.classbin0 -> 1354 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/prng/ICMRandomSpi.classbin0 -> 3712 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/prng/UMacRandomSpi.classbin0 -> 3184 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHKeyFactory.classbin0 -> 4888 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHKeyPairGeneratorSpi.classbin0 -> 1650 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHParameters.classbin0 -> 4564 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHParametersGenerator.classbin0 -> 3498 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/spec/BlockCipherParameterSpec.classbin0 -> 1630 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/spec/TMMHParameterSpec.classbin0 -> 1094 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/jce/spec/UMac32ParameterSpec.classbin0 -> 524 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/BaseKeyAgreementParty.classbin0 -> 2887 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/GnuPBEKey.classbin0 -> 1273 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/GnuSecretKey.classbin0 -> 1620 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/IKeyAgreementParty.classbin0 -> 491 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/IncomingMessage.classbin0 -> 5337 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/KeyAgreementException.classbin0 -> 1782 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/KeyAgreementFactory.classbin0 -> 1998 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/OutgoingMessage.classbin0 -> 3590 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/dh/DHKeyPairPKCS8Codec.classbin0 -> 4882 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/dh/DHKeyPairRawCodec.classbin0 -> 4528 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/dh/DHKeyPairX509Codec.classbin0 -> 4928 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/dh/DiffieHellmanKeyAgreement.classbin0 -> 1058 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/dh/DiffieHellmanReceiver.classbin0 -> 2816 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/dh/DiffieHellmanSender.classbin0 -> 2956 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/dh/ElGamalKeyAgreement.classbin0 -> 1075 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/dh/ElGamalReceiver.classbin0 -> 2008 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/dh/ElGamalSender.classbin0 -> 2505 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHKey.classbin0 -> 2703 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHKeyPairGenerator.classbin0 -> 4686 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHPrivateKey.classbin0 -> 2989 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHPublicKey.classbin0 -> 2990 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/dh/RFC2631.classbin0 -> 3411 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6Host.classbin0 -> 4805 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6KeyAgreement.classbin0 -> 2064 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6SaslClient.classbin0 -> 1268 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6SaslServer.classbin0 -> 1205 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6TLSClient.classbin0 -> 4230 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6TLSServer.classbin0 -> 4819 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6User.classbin0 -> 4660 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPAlgorithm.classbin0 -> 4451 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPKey.classbin0 -> 1256 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.classbin0 -> 5486 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPKeyPairRawCodec.classbin0 -> 4346 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPPrivateKey.classbin0 -> 2479 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPPublicKey.classbin0 -> 1972 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/AuthenticatedEntry.classbin0 -> 5067 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/BaseKeyring.classbin0 -> 3549 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/BinaryDataEntry.classbin0 -> 1815 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/CertPathEntry.classbin0 -> 2959 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/CertificateEntry.classbin0 -> 2968 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/CompressedEntry.classbin0 -> 3048 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/EncryptedEntry.classbin0 -> 5894 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/Entry.classbin0 -> 3066 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/EnvelopeEntry.classbin0 -> 7797 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/GnuPrivateKeyring.classbin0 -> 7405 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/GnuPublicKeyring.classbin0 -> 4016 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/IKeyring.classbin0 -> 754 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/IPrivateKeyring.classbin0 -> 790 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/IPublicKeyring.classbin0 -> 390 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/MalformedKeyringException.classbin0 -> 494 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/MaskableEnvelopeEntry.classbin0 -> 2248 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/MeteredInputStream.classbin0 -> 1978 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/PasswordAuthenticatedEntry.classbin0 -> 8106 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/PasswordEncryptedEntry.classbin0 -> 8323 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/PasswordProtectedEntry.classbin0 -> 498 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/PrimitiveEntry.classbin0 -> 2280 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/PrivateKeyEntry.classbin0 -> 4367 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/Properties.classbin0 -> 3479 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/keyring/PublicKeyEntry.classbin0 -> 3747 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/kwa/AESKeyWrap.classbin0 -> 3081 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/kwa/BaseKeyWrappingAlgorithm.classbin0 -> 2353 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/kwa/IKeyWrappingAlgorithm.classbin0 -> 698 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/kwa/KeyUnwrappingException.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/kwa/KeyWrappingAlgorithmFactory.classbin0 -> 1474 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/kwa/TripleDESKeyWrap.classbin0 -> 5388 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mac/BaseMac.classbin0 -> 1694 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mac/HMac.classbin0 -> 4848 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mac/HMacFactory.classbin0 -> 1916 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mac/IMac.classbin0 -> 686 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mac/MacFactory.classbin0 -> 2483 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mac/MacInputStream.classbin0 -> 1464 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mac/MacOutputStream.classbin0 -> 1438 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mac/OMAC.classbin0 -> 5837 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mac/TMMH16.classbin0 -> 4710 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mac/UHash32$L1Hash32.classbin0 -> 3648 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mac/UHash32$L2Hash32.classbin0 -> 3784 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mac/UHash32$L3Hash32.classbin0 -> 1865 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mac/UHash32.classbin0 -> 5515 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mac/UMac32.classbin0 -> 6241 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mode/BaseMode.classbin0 -> 4880 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mode/CBC.classbin0 -> 1912 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mode/CFB.classbin0 -> 2144 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mode/CTR.classbin0 -> 2347 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mode/EAX.classbin0 -> 6178 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mode/ECB.classbin0 -> 1484 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mode/IAuthenticatedMode.classbin0 -> 207 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mode/ICM.classbin0 -> 2874 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mode/IMode.classbin0 -> 517 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mode/ModeFactory.classbin0 -> 2809 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/mode/OFB.classbin0 -> 1618 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/pad/BasePad.classbin0 -> 2343 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/pad/IPad.classbin0 -> 530 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/pad/ISO10126.classbin0 -> 1212 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/pad/PKCS1_V1_5.classbin0 -> 2172 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/pad/PKCS7.classbin0 -> 1381 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/pad/PadFactory.classbin0 -> 1921 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/pad/SSL3.classbin0 -> 1151 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/pad/TBC.classbin0 -> 1423 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/pad/TLS1.classbin0 -> 1199 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/pad/WrongPaddingException.classbin0 -> 333 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/prng/ARCFour.classbin0 -> 1692 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG$1.classbin0 -> 697 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG$Poller.classbin0 -> 3788 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG$Spinner.classbin0 -> 738 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG.classbin0 -> 12837 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/prng/Fortuna$Generator.classbin0 -> 4028 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/prng/Fortuna.classbin0 -> 4083 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/prng/ICMGenerator.classbin0 -> 4444 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/prng/IPBE.classbin0 -> 451 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/prng/PBKDF2.classbin0 -> 3572 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/prng/PRNGFactory.classbin0 -> 2272 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/prng/UMacGenerator.classbin0 -> 2654 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/AuthInfo.classbin0 -> 2428 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/AuthInfoProviderFactory.classbin0 -> 1062 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/ClientFactory.classbin0 -> 4064 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/ClientMechanism.classbin0 -> 5373 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/ConfidentialityException.classbin0 -> 667 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/IAuthInfoProvider.classbin0 -> 502 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/IAuthInfoProviderFactory.classbin0 -> 237 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/IllegalMechanismStateException.classbin0 -> 701 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/InputBuffer.classbin0 -> 3753 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/IntegrityException.classbin0 -> 649 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/NoSuchMechanismException.classbin0 -> 418 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/NoSuchUserException.classbin0 -> 494 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/OutputBuffer.classbin0 -> 2769 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/SaslEncodingException.classbin0 -> 488 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/SaslInputStream.classbin0 -> 4002 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/SaslOutputStream.classbin0 -> 2860 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/SaslUtil.classbin0 -> 954 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/ServerFactory.classbin0 -> 3779 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/ServerMechanism.classbin0 -> 5632 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/UserAlreadyExistsException.classbin0 -> 510 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/anonymous/AnonymousClient.classbin0 -> 1734 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/anonymous/AnonymousServer.classbin0 -> 1399 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/anonymous/AnonymousUtil.classbin0 -> 951 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5AuthInfoProvider.classbin0 -> 3418 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Client.classbin0 -> 3839 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Registry.classbin0 -> 543 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Server.classbin0 -> 3369 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Util.classbin0 -> 2534 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/PasswordFile.classbin0 -> 5083 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PasswordFile.classbin0 -> 5266 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainAuthInfoProvider.classbin0 -> 3441 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainClient.classbin0 -> 3394 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainRegistry.classbin0 -> 526 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainServer.classbin0 -> 3221 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/srp/CALG.classbin0 -> 4124 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/srp/ClientStore.classbin0 -> 2087 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/srp/IALG.classbin0 -> 2245 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/srp/KDF.classbin0 -> 2276 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/srp/PasswordFile.classbin0 -> 11585 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRP.classbin0 -> 4671 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPAuthInfoProvider.classbin0 -> 3562 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPClient.classbin0 -> 18659 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPRegistry.classbin0 -> 3133 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPServer.classbin0 -> 15844 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SecurityContext.classbin0 -> 2168 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/srp/ServerStore.classbin0 -> 2658 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/crypto/sasl/srp/StoreEntry.classbin0 -> 641 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/IIOInputStream.classbin0 -> 1477 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/BMPDecoder.classbin0 -> 3476 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/BMPEncoder.classbin0 -> 1547 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/BMPException.classbin0 -> 379 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/BMPFileHeader.classbin0 -> 2715 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageReader.classbin0 -> 3376 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageReaderSpi.classbin0 -> 3037 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageWriter.classbin0 -> 3379 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageWriterSpi.classbin0 -> 3398 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/BMPInfoHeader.classbin0 -> 5107 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeBF16.classbin0 -> 2661 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeBF32.classbin0 -> 2692 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB1.classbin0 -> 2391 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB24.classbin0 -> 1766 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB4.classbin0 -> 2367 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB8.classbin0 -> 2347 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRLE4.classbin0 -> 3651 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRLE8.classbin0 -> 3241 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB1.classbin0 -> 2105 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB16.classbin0 -> 2126 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB24.classbin0 -> 2144 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB32.classbin0 -> 2162 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB4.classbin0 -> 2105 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB8.classbin0 -> 2105 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRLE4.classbin0 -> 4023 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRLE8.classbin0 -> 3631 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/gif/GIFFile$GIFException.classbin0 -> 464 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/gif/GIFFile.classbin0 -> 8669 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/gif/GIFImageReader.classbin0 -> 5068 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/gif/GIFImageReaderSpi.classbin0 -> 3106 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/jpeg/DCT.classbin0 -> 4527 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/jpeg/HuffmanTable.classbin0 -> 3234 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGComponent.classbin0 -> 5425 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGDecoder.classbin0 -> 9405 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGException.classbin0 -> 384 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGFrame.classbin0 -> 2241 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGImageInputStream.classbin0 -> 1776 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGImageReader.classbin0 -> 2704 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGImageReaderSpi.classbin0 -> 3652 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGMarker.classbin0 -> 1860 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGMarkerFoundException.classbin0 -> 382 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGScan.classbin0 -> 2721 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/jpeg/YCbCr_ColorSpace.classbin0 -> 1269 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/jpeg/ZigZag.classbin0 -> 5447 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGChunk.classbin0 -> 4262 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGData.classbin0 -> 1572 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGDecoder.classbin0 -> 5300 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGEncoder.classbin0 -> 5501 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGException.classbin0 -> 368 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGFile.classbin0 -> 5022 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGFilter.classbin0 -> 3211 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGGamma.classbin0 -> 1461 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGHeader.classbin0 -> 3615 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGICCProfile.classbin0 -> 2711 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGImageReader.classbin0 -> 3530 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGImageReaderSpi.classbin0 -> 2450 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGPalette.classbin0 -> 2641 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGPhys.classbin0 -> 2042 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/imageio/png/PNGTime.classbin0 -> 1650 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/management/Server$ServerInfo.classbin0 -> 898 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/management/Server$ServerInputStream.classbin0 -> 1219 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/management/Server$ServerNotificationListener.classbin0 -> 1282 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/management/Server.classbin0 -> 23261 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/giop/ContextContinuation.classbin0 -> 11356 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/giop/CorbalocParser.classbin0 -> 7202 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingEnumeration.classbin0 -> 2055 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingServiceFactory$1.classbin0 -> 908 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingServiceFactory.classbin0 -> 3622 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingServiceURLContext.classbin0 -> 11362 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/giop/ListBindingsEnumeration.classbin0 -> 1743 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/giop/ListEnumeration.classbin0 -> 1733 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/ictxImpl/trans/GnuName$GnuNameEnum.classbin0 -> 1068 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/ictxImpl/trans/GnuName.classbin0 -> 4953 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/jndi/url/corbaname/corbanameURLContextFactory.classbin0 -> 443 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/ContextContinuation.classbin0 -> 8448 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/ListBindingsEnumeration.classbin0 -> 1061 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/ListEnumeration.classbin0 -> 854 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/RmiContinuation.classbin0 -> 8301 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/RmiNamingEnumeration.classbin0 -> 1159 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/rmiURLContext.classbin0 -> 9374 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/rmiURLContextFactory.classbin0 -> 824 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/AbstractSessionContext.classbin0 -> 3707 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/Base64.classbin0 -> 3230 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/EntropySource.classbin0 -> 176 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/NullManagerParameters.classbin0 -> 370 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/PreSharedKeyManager.classbin0 -> 350 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/PreSharedKeyManagerParameters.classbin0 -> 1549 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/PrivateCredentials.classbin0 -> 9537 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/SRPManagerParameters.classbin0 -> 689 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/SRPTrustManager.classbin0 -> 454 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/SSLCipherSuite.classbin0 -> 3137 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/SSLProtocolVersion.classbin0 -> 1205 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/SSLRecordHandler.classbin0 -> 803 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/Session$ID.classbin0 -> 1871 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/Session.classbin0 -> 5167 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/SessionStoreException.classbin0 -> 685 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/StaticTrustAnchors.classbin0 -> 92341 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$1.classbin0 -> 1157 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$CertVerifier.classbin0 -> 3995 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$DHE_PSKGen.classbin0 -> 2687 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$DHPhase.classbin0 -> 2303 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake.classbin0 -> 19585 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Alert$Description.classbin0 -> 4176 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Alert$Level.classbin0 -> 1724 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Alert.classbin0 -> 3279 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/AlertException.classbin0 -> 1895 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Builder.classbin0 -> 211 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Certificate.classbin0 -> 3965 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateBuilder.classbin0 -> 2243 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateRequest$ClientCertificateType.classbin0 -> 2127 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateRequest.classbin0 -> 2520 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateRequestBuilder.classbin0 -> 2972 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateStatusRequest$ResponderIdIterator.classbin0 -> 1355 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateStatusRequest.classbin0 -> 5846 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateStatusType.classbin0 -> 1177 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateType.classbin0 -> 1610 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL$CertChainType.classbin0 -> 1447 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL$Iterator.classbin0 -> 1434 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL$URLAndOptionalHash.classbin0 -> 4330 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL.classbin0 -> 5717 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateVerify.classbin0 -> 1646 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherAlgorithm.classbin0 -> 1286 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherSuite.classbin0 -> 13470 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherSuiteList$Iterator.classbin0 -> 2597 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherSuiteList.classbin0 -> 4200 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientCertificateTypeList$Iterator.classbin0 -> 2872 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientCertificateTypeList.classbin0 -> 3931 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientDHE_PSKParameters.classbin0 -> 2502 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientDiffieHellmanPublic.classbin0 -> 2671 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$CertLoader.classbin0 -> 2588 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$ClientDHGen.classbin0 -> 3697 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$GenCertVerify.classbin0 -> 2856 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$ParamsVerifier.classbin0 -> 2151 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$RSAGen.classbin0 -> 3440 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$State.classbin0 -> 2213 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake.classbin0 -> 30697 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHello.classbin0 -> 5069 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHelloBuilder.classbin0 -> 3939 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHelloV2.classbin0 -> 3414 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientKeyExchange.classbin0 -> 3437 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientKeyExchangeBuilder.classbin0 -> 1785 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientPSKParameters.classbin0 -> 2480 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientRSA_PSKParameters.classbin0 -> 3336 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CompressionMethod.classbin0 -> 1447 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CompressionMethodList$Iterator.classbin0 -> 2681 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/CompressionMethodList.classbin0 -> 3860 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Constructed.classbin0 -> 213 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ContentType.classbin0 -> 1657 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Debug.classbin0 -> 420 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/DelegatedTask.classbin0 -> 1606 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/DiffieHellman.classbin0 -> 8733 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/EmptyExchangeKeys.classbin0 -> 1069 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/EncryptedPreMasterSecret.classbin0 -> 3204 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ExchangeKeys.classbin0 -> 686 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Extension$Type.classbin0 -> 1970 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Extension$Value.classbin0 -> 487 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Extension.classbin0 -> 5727 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ExtensionList$ExtensionsIterator.classbin0 -> 2697 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ExtensionList.classbin0 -> 5666 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Finished.classbin0 -> 3117 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Handshake$Body.classbin0 -> 340 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Handshake$Type.classbin0 -> 2593 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Handshake.classbin0 -> 5821 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/HelloRequest.classbin0 -> 905 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/InputSecurityParameters.classbin0 -> 6952 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Jessie$1.classbin0 -> 1944 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Jessie.classbin0 -> 943 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/KeyExchangeAlgorithm.classbin0 -> 1570 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/MacAlgorithm.classbin0 -> 1121 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/MacException.classbin0 -> 322 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/MaxFragmentLength.classbin0 -> 1780 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/OutputSecurityParameters.classbin0 -> 6668 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/PreSharedKeyManagerFactoryImpl$Manager.classbin0 -> 1486 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/PreSharedKeyManagerFactoryImpl.classbin0 -> 1630 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ProtocolVersion.classbin0 -> 3435 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Random.classbin0 -> 2988 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Record.classbin0 -> 3611 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SRPTrustManagerFactory$Manager.classbin0 -> 2766 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SRPTrustManagerFactory.classbin0 -> 2583 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLContextImpl.classbin0 -> 5552 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLEngineImpl$Mode.classbin0 -> 1197 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLEngineImpl.classbin0 -> 21687 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLHMac.classbin0 -> 2627 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLRSASignatureImpl.classbin0 -> 5048 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLRandom.classbin0 -> 3093 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLServerSocketFactoryImpl.classbin0 -> 2363 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLServerSocketImpl.classbin0 -> 3468 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.classbin0 -> 3412 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl$1.classbin0 -> 885 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl$SocketInputStream.classbin0 -> 3668 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl$SocketOutputStream.classbin0 -> 3392 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl.classbin0 -> 16460 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLv3HMacMD5Impl.classbin0 -> 2107 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLv3HMacSHAImpl.classbin0 -> 2111 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerDHE_PSKParameters.classbin0 -> 3858 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerDHParams.classbin0 -> 4428 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$CertLoader.classbin0 -> 3121 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$GenDH.classbin0 -> 3828 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$RSAKeyExchange.classbin0 -> 2453 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$RSA_PSKExchange.classbin0 -> 2897 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$State.classbin0 -> 2284 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake.classbin0 -> 34821 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHello.classbin0 -> 4424 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHelloBuilder.classbin0 -> 3225 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHelloDone.classbin0 -> 988 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerKeyExchange.classbin0 -> 4255 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerKeyExchangeBuilder.classbin0 -> 2131 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerKeyExchangeParams.classbin0 -> 274 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList$Iterator.classbin0 -> 1410 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList$NameType.classbin0 -> 1354 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList$ServerName.classbin0 -> 3814 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList.classbin0 -> 4498 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerPSKParameters.classbin0 -> 2864 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerRSAParams.classbin0 -> 2848 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerRSA_PSKParameters.classbin0 -> 844 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SessionImpl$PrivateData.classbin0 -> 545 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SessionImpl.classbin0 -> 4385 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Signature.classbin0 -> 3037 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SignatureAlgorithm.classbin0 -> 1648 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SimpleSessionContext$1.classbin0 -> 1347 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/SimpleSessionContext.classbin0 -> 2957 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/TLSHMac.classbin0 -> 2111 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/TLSRandom.classbin0 -> 4306 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/TruncatedHMAC.classbin0 -> 1125 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities$AuthoritiesIterator.classbin0 -> 1497 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities$IdentifierType.classbin0 -> 1597 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities$TrustedAuthority.classbin0 -> 3221 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities.classbin0 -> 3425 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/UnresolvedExtensionValue.classbin0 -> 1413 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Util$1.classbin0 -> 692 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Util$2.classbin0 -> 725 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Util$WrappedBuffer.classbin0 -> 773 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/Util.classbin0 -> 7423 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/X500PrincipalList$Iterator.classbin0 -> 2566 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/X500PrincipalList.classbin0 -> 4562 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/X509KeyManagerFactory$Manager.classbin0 -> 5311 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/X509KeyManagerFactory.classbin0 -> 5245 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/X509TrustManagerFactory$Manager.classbin0 -> 3262 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/net/ssl/provider/X509TrustManagerFactory.classbin0 -> 4623 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/CupsIppOperation.classbin0 -> 860 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/CupsMediaMapping.classbin0 -> 4194 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/CupsPrintService.classbin0 -> 1287 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/CupsPrintServiceLookup.classbin0 -> 3703 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/CupsServer.classbin0 -> 4232 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrintAttributeException.classbin0 -> 1653 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrintFlavorException.classbin0 -> 1248 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrintUriException.classbin0 -> 1355 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$Color.classbin0 -> 3306 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$JobAttributes.classbin0 -> 5932 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$Quality.classbin0 -> 3566 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$SidesPanel.classbin0 -> 3599 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel.classbin0 -> 2445 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel$CopiesAndSorted.classbin0 -> 4024 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel$PrintRange.classbin0 -> 4723 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel$PrintServices.classbin0 -> 5188 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel.classbin0 -> 2133 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel$Margins.classbin0 -> 3187 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel$MediaTypes.classbin0 -> 3821 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel$Orientation.classbin0 -> 3923 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel.classbin0 -> 2129 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/PrinterDialog.classbin0 -> 7369 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/DocPrintJobImpl.classbin0 -> 10253 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/IppDelimiterTag.classbin0 -> 675 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/IppException.classbin0 -> 733 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/IppMultiDocPrintService.classbin0 -> 945 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/IppPrintService.classbin0 -> 20077 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/IppRequest$RequestWriter.classbin0 -> 9273 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/IppRequest.classbin0 -> 8604 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/IppResponse$ResponseReader.classbin0 -> 13159 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/IppResponse.classbin0 -> 2476 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/IppStatusCode.classbin0 -> 2084 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/IppUtilities.classbin0 -> 15597 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/IppValueTag.classbin0 -> 1278 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/MultiDocPrintJobImpl.classbin0 -> 987 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/CharsetSyntax.classbin0 -> 1048 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/DefaultValueAttribute.classbin0 -> 263 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/DetailedStatusMessage.classbin0 -> 740 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/DocumentAccessError.classbin0 -> 732 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/NaturalLanguageSyntax.classbin0 -> 1072 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/RequestedAttributes.classbin0 -> 1632 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/StatusMessage.classbin0 -> 707 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/UnknownAttribute.classbin0 -> 2180 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/CopiesDefault.classbin0 -> 1151 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/DocumentFormatDefault.classbin0 -> 1042 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/FinishingsDefault.classbin0 -> 3187 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/JobHoldUntilDefault.classbin0 -> 1603 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/JobPriorityDefault.classbin0 -> 1173 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/JobSheetsDefault.classbin0 -> 1338 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/MediaDefault.classbin0 -> 1043 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/MultipleDocumentHandlingDefault.classbin0 -> 2077 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/NumberUpDefault.classbin0 -> 1031 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/OrientationRequestedDefault.classbin0 -> 1998 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/PrintQualityDefault.classbin0 -> 1778 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/PrinterResolutionDefault.classbin0 -> 1207 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/SidesDefault.classbin0 -> 1850 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/AttributesCharset.classbin0 -> 804 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/AttributesNaturalLanguage.classbin0 -> 844 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobDetailedStatusMessages.classbin0 -> 765 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobDocumentAccessErrors.classbin0 -> 757 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobId.classbin0 -> 725 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobMoreInfo.classbin0 -> 638 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobPrinterUri.classbin0 -> 646 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobStateMessage.classbin0 -> 724 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobUri.classbin0 -> 617 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/CharsetConfigured.classbin0 -> 691 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/DocumentFormat.classbin0 -> 1481 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/MultipleOperationTimeOut.classbin0 -> 679 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/NaturalLanguageConfigured.classbin0 -> 732 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterCurrentTime.classbin0 -> 856 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterDriverInstaller.classbin0 -> 690 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterStateMessage.classbin0 -> 760 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterUpTime.classbin0 -> 634 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/CharsetSupported.classbin0 -> 706 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/CompressionSupported.classbin0 -> 2442 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/DocumentFormatSupported.classbin0 -> 783 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/FinishingsSupported.classbin0 -> 3892 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/GeneratedNaturalLanguageSupported.classbin0 -> 784 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/IppVersionsSupported.classbin0 -> 1309 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/JobHoldUntilSupported.classbin0 -> 1363 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.classbin0 -> 2290 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/MediaSupported.classbin0 -> 1762 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/MultipleDocumentHandlingSupported.classbin0 -> 2774 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/MultipleDocumentJobsSupported.classbin0 -> 1375 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/OperationsSupported.classbin0 -> 2682 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/OrientationRequestedSupported.classbin0 -> 2679 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PageRangesSupported.classbin0 -> 1332 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PrintQualitySupported.classbin0 -> 2459 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PrinterResolutionSupported.classbin0 -> 1820 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PrinterUriSupported.classbin0 -> 697 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/SidesSupported.classbin0 -> 1511 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/UriAuthenticationSupported.classbin0 -> 1598 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/UriSecuritySupported.classbin0 -> 1372 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/rmi/CORBA/CorbaInput.classbin0 -> 4281 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/rmi/CORBA/CorbaOutput.classbin0 -> 3416 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/rmi/CORBA/DefaultWriteObjectTester.classbin0 -> 890 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/rmi/CORBA/DelegateFactory.classbin0 -> 1678 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/rmi/CORBA/GetDelegateInstanceException.classbin0 -> 593 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/rmi/CORBA/PortableRemoteObjectDelegateImpl.classbin0 -> 7327 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/rmi/CORBA/RmiUtilities$1.classbin0 -> 863 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/rmi/CORBA/RmiUtilities$2.classbin0 -> 822 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/rmi/CORBA/RmiUtilities.classbin0 -> 18745 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/rmi/CORBA/StubDelegateImpl.classbin0 -> 6511 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/rmi/CORBA/TieTargetRecord.classbin0 -> 890 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/rmi/CORBA/UtilDelegateImpl.classbin0 -> 12840 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.classbin0 -> 3264 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/Password.classbin0 -> 2543 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/AWTCallbackHandler.classbin0 -> 10086 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/AbstractCallbackHandler.classbin0 -> 4916 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/CertificateCallback.classbin0 -> 663 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/ConsoleCallbackHandler.classbin0 -> 6784 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/DefaultCallbackHandler.classbin0 -> 2626 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/GnuCallbacks$1.classbin0 -> 1268 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/GnuCallbacks.classbin0 -> 745 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$1.classbin0 -> 1388 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$2.classbin0 -> 1802 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$3.classbin0 -> 1869 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$4.classbin0 -> 1692 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$5.classbin0 -> 1727 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$6.classbin0 -> 1714 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$7.classbin0 -> 1255 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler.classbin0 -> 12162 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/login/ConfigFileParser.classbin0 -> 5453 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/login/ConfigFileTokenizer.classbin0 -> 3414 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/security/auth/login/GnuConfiguration.classbin0 -> 5617 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaInputPortDevice.classbin0 -> 1398 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaInfo.classbin0 -> 732 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaInputPortInfo.classbin0 -> 919 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaOutputPortInfo.classbin0 -> 923 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaPortInfo.classbin0 -> 753 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaSequencerInfo.classbin0 -> 870 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider.classbin0 -> 2276 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiSequencerDevice.classbin0 -> 5607 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaOutputPortDevice.classbin0 -> 1274 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaPortDevice$AlsaReceiver.classbin0 -> 900 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaPortDevice$AlsaTransmitter.classbin0 -> 1602 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaPortDevice.classbin0 -> 912 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSIMidiDeviceProvider$1.classbin0 -> 748 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSIMidiDeviceProvider$DSSIInfo.classbin0 -> 849 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSIMidiDeviceProvider.classbin0 -> 3095 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSIInstrument.classbin0 -> 978 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSIMidiChannel.classbin0 -> 3148 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSIReceiver.classbin0 -> 1835 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSISoundbank.classbin0 -> 2595 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer.classbin0 -> 6305 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/file/ExtendedMidiFileFormat.classbin0 -> 639 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/file/MidiDataInputStream.classbin0 -> 666 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/file/MidiDataOutputStream.classbin0 -> 930 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/file/MidiFileReader.classbin0 -> 5807 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/midi/file/MidiFileWriter.classbin0 -> 3371 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/sampled/AU/AUReader$AUFormatType.classbin0 -> 507 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/sampled/AU/AUReader$AUHeader.classbin0 -> 2587 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/sampled/AU/AUReader.classbin0 -> 2634 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/sound/sampled/WAV/WAVReader.classbin0 -> 4349 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/plaf/gnu/GNULookAndFeel$CheckBoxIcon.classbin0 -> 1366 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/plaf/gnu/GNULookAndFeel$RadioButtonIcon.classbin0 -> 2334 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/plaf/gnu/GNULookAndFeel.classbin0 -> 3156 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/plaf/metal/CustomizableTheme.classbin0 -> 2107 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/CharacterAttributeTranslator.classbin0 -> 3502 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/CombinedAttributes$CombinedEnumeration.classbin0 -> 1066 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/CombinedAttributes.classbin0 -> 2759 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/ImageViewIconFactory$LoadingImageIcon.classbin0 -> 2165 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/ImageViewIconFactory$NoImageIcon.classbin0 -> 2074 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/ImageViewIconFactory.classbin0 -> 852 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/css/BorderStyle.classbin0 -> 736 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/css/BorderWidth.classbin0 -> 755 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSColor.classbin0 -> 2754 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSLexicalException.classbin0 -> 490 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParser$1.classbin0 -> 1508 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParser.classbin0 -> 5677 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParserCallback.classbin0 -> 310 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParserException.classbin0 -> 406 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSScanner.classbin0 -> 8017 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/css/FontSize.classbin0 -> 3980 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/css/FontStyle.classbin0 -> 653 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/css/FontWeight.classbin0 -> 676 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/css/Length.classbin0 -> 2810 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/css/Selector.classbin0 -> 3283 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/GnuParserDelegator$gnuParser.classbin0 -> 3083 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/GnuParserDelegator.classbin0 -> 1712 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/HTML_401F.classbin0 -> 74378 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/SmallHtmlAttributeSet$1.classbin0 -> 1076 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/SmallHtmlAttributeSet.classbin0 -> 3164 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/gnuDTD.classbin0 -> 6936 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlAttributeSet$1.classbin0 -> 1270 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlAttributeSet.classbin0 -> 2379 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlValidator$hTag.classbin0 -> 1850 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlValidator.classbin0 -> 10443 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/PCDATAonly_model.classbin0 -> 901 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/TableRowContentModel.classbin0 -> 1284 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/list.classbin0 -> 4383 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/noTagModel.classbin0 -> 1153 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/node.classbin0 -> 3855 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/transformer.classbin0 -> 3015 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/Parser$1.classbin0 -> 859 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/Parser$2.classbin0 -> 1742 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/Parser.classbin0 -> 20690 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/gnuStringIntMapper.classbin0 -> 1382 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Buffer.classbin0 -> 3384 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Constants.classbin0 -> 5329 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Location.classbin0 -> 591 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/ParseException.classbin0 -> 489 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Queue.classbin0 -> 1980 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/ReaderTokenizer.classbin0 -> 5335 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Token.classbin0 -> 2832 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/node.classbin0 -> 551 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/pattern.classbin0 -> 1556 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/parameterDefaulter.classbin0 -> 1882 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/textPreProcessor.classbin0 -> 1913 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/swing/tree/GnuPath.classbin0 -> 453 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/aelfred2/JAXPFactory$JaxpParser.classbin0 -> 1835 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/aelfred2/JAXPFactory.classbin0 -> 2898 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/aelfred2/SAXDriver$Adapter.classbin0 -> 2407 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/aelfred2/SAXDriver$Attribute.classbin0 -> 657 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/aelfred2/SAXDriver.classbin0 -> 20456 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$AttributeDecl.classbin0 -> 514 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$ElementDecl.classbin0 -> 500 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$EntityInfo.classbin0 -> 528 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$ExternalIdentifiers.classbin0 -> 704 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$Input.classbin0 -> 703 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/aelfred2/XmlParser.classbin0 -> 52439 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/aelfred2/XmlReader$FatalErrorHandler.classbin0 -> 624 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/aelfred2/XmlReader.classbin0 -> 4752 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/Consumer$Backdoor.classbin0 -> 5882 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/Consumer.classbin0 -> 851 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DTDAttributeTypeInfo.classbin0 -> 1095 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DTDElementTypeInfo.classbin0 -> 1909 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomAttr.classbin0 -> 5205 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomCDATASection.classbin0 -> 849 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomCharacterData$EmptyNodeList.classbin0 -> 621 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomCharacterData.classbin0 -> 4429 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomComment.classbin0 -> 614 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomDOMException.classbin0 -> 2560 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomDoctype.classbin0 -> 6376 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomDocument.classbin0 -> 23664 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomDocumentBuilder.classbin0 -> 4375 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomDocumentBuilderFactory.classbin0 -> 3710 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomDocumentConfiguration.classbin0 -> 4078 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomDocumentFragment.classbin0 -> 575 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomElement.classbin0 -> 8101 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomEntity.classbin0 -> 1220 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomEntityReference.classbin0 -> 1169 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomEvent$DomMutationEvent.classbin0 -> 1909 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomEvent$DomUIEvent.classbin0 -> 1038 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomEvent.classbin0 -> 2406 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomExtern.classbin0 -> 955 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomImpl.classbin0 -> 3939 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomIterator.classbin0 -> 4187 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomNSResolverContext.classbin0 -> 1251 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomNamedNodeMap.classbin0 -> 5204 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomNode$DomEventException.classbin0 -> 459 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomNode$ListenerRecord.classbin0 -> 1009 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomNode$LiveNodeList.classbin0 -> 3023 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomNode$ShadowList.classbin0 -> 1025 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomNode.classbin0 -> 22734 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomNodeIterator.classbin0 -> 4168 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomNotation.classbin0 -> 856 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomNsNode.classbin0 -> 2725 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomProcessingInstruction.classbin0 -> 1255 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomText.classbin0 -> 3741 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomXPathExpression.classbin0 -> 3337 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomXPathNSResolver.classbin0 -> 638 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/DomXPathResult.classbin0 -> 3637 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/ImplementationList.classbin0 -> 765 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/ImplementationSource.classbin0 -> 3312 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/JAXPFactory$JAXPBuilder.classbin0 -> 4140 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/JAXPFactory.classbin0 -> 2738 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLAnchorElement.classbin0 -> 3209 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLAppletElement.classbin0 -> 3172 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLAreaElement.classbin0 -> 2461 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBRElement.classbin0 -> 923 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBaseElement.classbin0 -> 1105 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBaseFontElement.classbin0 -> 1419 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBodyElement.classbin0 -> 1816 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLButtonElement.classbin0 -> 2264 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLCollection.classbin0 -> 4083 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDListElement.classbin0 -> 891 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDirectoryElement.classbin0 -> 907 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDivElement.classbin0 -> 927 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDocument.classbin0 -> 10676 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLElement.classbin0 -> 4725 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLEmbedElement.classbin0 -> 2258 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFieldSetElement.classbin0 -> 820 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFontElement.classbin0 -> 1273 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFormElement.classbin0 -> 2784 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFrameElement.classbin0 -> 2533 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFrameSetElement.classbin0 -> 1115 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHRElement.classbin0 -> 1596 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHeadElement.classbin0 -> 937 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHeadingElement.classbin0 -> 943 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHtmlElement.classbin0 -> 937 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLIFrameElement.classbin0 -> 2730 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLImageElement.classbin0 -> 3147 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLImpl.classbin0 -> 767 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLInputElement.classbin0 -> 4906 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLIsIndexElement.classbin0 -> 1181 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLIElement.classbin0 -> 1224 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLabelElement.classbin0 -> 1380 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLegendElement.classbin0 -> 1372 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLinkElement.classbin0 -> 2470 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLMapElement.classbin0 -> 1389 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLMenuElement.classbin0 -> 887 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLMetaElement.classbin0 -> 1477 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLModElement.classbin0 -> 1118 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLOListElement.classbin0 -> 1554 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLObjectElement.classbin0 -> 5932 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLOptGroupElement.classbin0 -> 1268 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLOptionElement.classbin0 -> 2410 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLParagraphElement.classbin0 -> 951 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLParamElement.classbin0 -> 1468 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLParser.classbin0 -> 4808 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLPreElement.classbin0 -> 869 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLQuoteElement.classbin0 -> 932 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLScriptElement.classbin0 -> 2174 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLSelectElement.classbin0 -> 4686 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLStyleElement.classbin0 -> 1427 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableCaptionElement.classbin0 -> 963 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableCellElement.classbin0 -> 3661 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableColElement.classbin0 -> 1964 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableElement.classbin0 -> 6637 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableRowElement.classbin0 -> 4138 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableSectionElement.classbin0 -> 3194 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTextAreaElement.classbin0 -> 3318 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTitleElement.classbin0 -> 838 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLUListElement.classbin0 -> 1250 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/ls/DomLSException.classbin0 -> 584 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/ls/DomLSInput.classbin0 -> 2644 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/ls/DomLSOutput.classbin0 -> 1412 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/ls/DomLSParser.classbin0 -> 10963 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/ls/DomLSSerializer.classbin0 -> 5775 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/ls/FilteredSAXEventSink.classbin0 -> 5514 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/ls/ReaderInputStream.classbin0 -> 3321 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/ls/SAXEventSink.classbin0 -> 12805 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/dom/ls/WriterOutputStream.classbin0 -> 1291 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeAttr.classbin0 -> 1884 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeCDATASection.classbin0 -> 420 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeCharacterData.classbin0 -> 2367 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeComment.classbin0 -> 409 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDOMException.classbin0 -> 1176 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDOMStringList.classbin0 -> 913 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocument.classbin0 -> 10110 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentBuilder.classbin0 -> 5993 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentBuilderFactory.classbin0 -> 1683 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentFragment.classbin0 -> 436 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentType.classbin0 -> 1475 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeElement.classbin0 -> 3362 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeEntity.classbin0 -> 1358 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeEntityReference.classbin0 -> 432 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNamedNodeMap.classbin0 -> 917 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNode.classbin0 -> 9182 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNodeList.classbin0 -> 488 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNotation.classbin0 -> 1060 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeProcessingInstruction.classbin0 -> 1110 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeText.classbin0 -> 2414 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeTypeInfo.classbin0 -> 562 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathExpression.classbin0 -> 1313 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathNSResolver.classbin0 -> 660 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathNodeList.classbin0 -> 609 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathResult.classbin0 -> 2233 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeLocator.classbin0 -> 1191 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeSAXParser.classbin0 -> 1481 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeSAXParserFactory.classbin0 -> 1596 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeXMLReader.classbin0 -> 16049 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/sax/Namespaces.classbin0 -> 1840 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/sax/StringArrayAttributes.classbin0 -> 2599 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/sax/XMLName.classbin0 -> 1238 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/transform/ErrorListenerErrorHandler.classbin0 -> 1647 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/transform/GnomeTransformer.classbin0 -> 11424 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/transform/GnomeTransformerFactory$AssociatedStylesheetHandler.classbin0 -> 1279 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/transform/GnomeTransformerFactory.classbin0 -> 7295 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/transform/URIResolverEntityResolver.classbin0 -> 1383 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/util/EmptyNodeList.classbin0 -> 521 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/util/NamedInputStream.classbin0 -> 1272 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/util/StandaloneDocumentType.classbin0 -> 5182 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/util/StandaloneLocator.classbin0 -> 993 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/util/XMLJ$XMLJShutdownHook.classbin0 -> 727 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/libxmlj/util/XMLJ.classbin0 -> 4753 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/CallFilter$Requestor.classbin0 -> 3236 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/CallFilter.classbin0 -> 2591 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/DomConsumer$Handler.classbin0 -> 12458 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/DomConsumer.classbin0 -> 4021 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/EventConsumer.classbin0 -> 425 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/EventFilter.classbin0 -> 11052 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/LinkFilter.classbin0 -> 3109 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/NSFilter.classbin0 -> 6282 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/PipelineFactory$Pipeline.classbin0 -> 1433 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/PipelineFactory$Stage.classbin0 -> 5275 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/PipelineFactory.classbin0 -> 3857 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/TeeConsumer.classbin0 -> 7036 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/TextConsumer.classbin0 -> 1613 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$AttributeInfo.classbin0 -> 609 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$ChildrenRecognizer.classbin0 -> 5547 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$ElementInfo.classbin0 -> 1680 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$EmptyRecognizer.classbin0 -> 850 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$MixedRecognizer.classbin0 -> 2369 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$Recognizer.classbin0 -> 1170 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer.classbin0 -> 18791 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/WellFormednessFilter.classbin0 -> 6832 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/XIncludeFilter$Scrubber.classbin0 -> 2383 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/XIncludeFilter.classbin0 -> 10814 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/pipeline/XsltFilter.classbin0 -> 2911 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/AttributeImpl.classbin0 -> 2098 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/BufferedReader.classbin0 -> 2886 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/CRLFReader.classbin0 -> 2032 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/CharactersImpl.classbin0 -> 1830 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/CommentImpl.classbin0 -> 1362 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/DTDImpl.classbin0 -> 1811 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/EndDocumentImpl.classbin0 -> 722 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/EndElementImpl.classbin0 -> 1844 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/EntityDeclarationImpl.classbin0 -> 2367 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/EntityReferenceImpl.classbin0 -> 1586 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/FilteredEventReader.classbin0 -> 1631 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/FilteredStreamReader.classbin0 -> 1128 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/NamespaceImpl.classbin0 -> 1777 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/NotationDeclarationImpl.classbin0 -> 1811 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/ProcessingInstructionImpl.classbin0 -> 1536 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/SAXParser.classbin0 -> 22005 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/SAXParserFactory.classbin0 -> 2605 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/StartDocumentImpl.classbin0 -> 2225 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/StartElementImpl.classbin0 -> 3087 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/UnicodeReader.classbin0 -> 2897 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XIncludeFilter.classbin0 -> 17712 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLEventAllocatorImpl.classbin0 -> 5884 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLEventFactoryImpl.classbin0 -> 7643 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLEventImpl.classbin0 -> 3112 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLEventReaderImpl.classbin0 -> 2614 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLEventWriterImpl.classbin0 -> 4785 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLInputFactoryImpl.classbin0 -> 9613 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLOutputFactoryImpl.classbin0 -> 4038 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLParser$AnyContentModel.classbin0 -> 594 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLParser$Attribute.classbin0 -> 1789 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLParser$AttributeDecl.classbin0 -> 897 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLParser$ContentModel.classbin0 -> 787 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLParser$ContentParticle.classbin0 -> 595 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLParser$Doctype.classbin0 -> 5857 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLParser$ElementContentModel.classbin0 -> 964 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLParser$EmptyContentModel.classbin0 -> 600 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLParser$ExternalIds.classbin0 -> 556 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLParser$Input.classbin0 -> 6256 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLParser$MixedContentModel.classbin0 -> 965 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLParser.classbin0 -> 67379 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/stream/XMLStreamWriterImpl.classbin0 -> 14899 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/AbstractNumberNode.classbin0 -> 6009 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/ApplyImportsNode.classbin0 -> 1500 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/ApplyTemplatesNode.classbin0 -> 5369 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/AttributeNode.classbin0 -> 4870 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/AttributeSet.classbin0 -> 923 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/Bindings.classbin0 -> 5257 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/CallTemplateNode.classbin0 -> 4096 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/ChooseNode.classbin0 -> 1521 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/CommentNode.classbin0 -> 2104 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/CopyNode.classbin0 -> 3782 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/CopyOfNode.classbin0 -> 4070 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/CurrentFunction.classbin0 -> 1641 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/DOMSourceLocator.classbin0 -> 872 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/DocumentFunction.classbin0 -> 5846 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/ElementAvailableFunction.classbin0 -> 4430 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/ElementNode.classbin0 -> 6372 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/ErrorListenerErrorHandler.classbin0 -> 1346 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/ForEachNode.classbin0 -> 3796 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/FormatNumberFunction.classbin0 -> 3272 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/FunctionAvailableFunction.classbin0 -> 4586 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/GenerateIdFunction.classbin0 -> 3112 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/IfNode.classbin0 -> 2314 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/Key.classbin0 -> 901 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/KeyFunction.classbin0 -> 5017 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/LiteralNode.classbin0 -> 4966 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/MessageNode.classbin0 -> 2468 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/NamespaceProxy.classbin0 -> 1109 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/NodeNumberNode.classbin0 -> 4740 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/NumberNode.classbin0 -> 1879 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/OtherwiseNode.classbin0 -> 1331 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/ParameterNode.classbin0 -> 4111 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/ProcessingInstructionNode.classbin0 -> 2568 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/SAXSerializer.classbin0 -> 6506 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/SAXTemplatesHandler.classbin0 -> 1782 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/SAXTransformerHandler.classbin0 -> 2047 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/SortKey.classbin0 -> 3065 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/StreamSerializer.classbin0 -> 17808 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/StrippingInstruction.classbin0 -> 703 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/Stylesheet.classbin0 -> 38666 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/SystemPropertyFunction.classbin0 -> 3011 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/Template.classbin0 -> 5603 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/TemplateNode.classbin0 -> 2764 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/TemplatesImpl.classbin0 -> 1466 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/TextNode.classbin0 -> 2653 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/TransformerFactoryImpl.classbin0 -> 11477 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/TransformerImpl.classbin0 -> 17191 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/TransformerOutputProperties.classbin0 -> 3335 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/URIResolverEntityResolver.classbin0 -> 1294 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/UnparsedEntityUriFunction.classbin0 -> 2875 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/ValueOfNode.classbin0 -> 3965 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/WhenNode.classbin0 -> 2325 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/WithParam.classbin0 -> 2404 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/XSLComparator.classbin0 -> 2203 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/transform/XSLURIResolver.classbin0 -> 6144 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/DoParse$MyErrorHandler.classbin0 -> 1301 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/DoParse.classbin0 -> 5058 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/DomParser.classbin0 -> 11909 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/Resolver.classbin0 -> 3303 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$DomHandler.classbin0 -> 997 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$DomTerminus.classbin0 -> 874 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$ListenerAdapter.classbin0 -> 2042 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$LocatorAdapter.classbin0 -> 940 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$NullHandler.classbin0 -> 3212 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$NullTransformer.classbin0 -> 5136 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory.classbin0 -> 5459 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/XCat$Catalog.classbin0 -> 5817 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/XCat$DoneDelegation.classbin0 -> 372 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/XCat$Loader.classbin0 -> 10205 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/XCat.classbin0 -> 7607 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/XHTMLWriter.classbin0 -> 1019 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/util/XMLWriter.classbin0 -> 26506 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/Annotation.classbin0 -> 508 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/AnySimpleType.classbin0 -> 753 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/AnyType.classbin0 -> 628 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/AnyURIType.classbin0 -> 1703 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/AtomicSimpleType.classbin0 -> 1385 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/Base64BinaryType.classbin0 -> 2173 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/BooleanType.classbin0 -> 2029 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/ByteType.classbin0 -> 2336 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/DateTimeType.classbin0 -> 4310 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/DateType.classbin0 -> 3469 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/DecimalType.classbin0 -> 2033 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/DoubleType.classbin0 -> 2285 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/DurationType$Duration.classbin0 -> 1355 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/DurationType.classbin0 -> 3020 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/EntitiesType.classbin0 -> 2090 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/EntityType.classbin0 -> 1579 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/EnumerationFacet.classbin0 -> 876 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/Facet.classbin0 -> 925 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/FloatType.classbin0 -> 2278 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/FractionDigitsFacet.classbin0 -> 854 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/GDayType$GDay.classbin0 -> 873 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/GDayType.classbin0 -> 2407 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/GMonthDayType$GMonthDay.classbin0 -> 1006 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/GMonthDayType.classbin0 -> 2527 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/GMonthType$GMonth.classbin0 -> 889 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/GMonthType.classbin0 -> 2343 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/GYearMonthType$GYearMonth.classbin0 -> 1014 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/GYearMonthType.classbin0 -> 2559 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/GYearType$GYear.classbin0 -> 881 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/GYearType.classbin0 -> 2299 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/HexBinaryType.classbin0 -> 1627 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/IDRefType.classbin0 -> 1327 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/IDRefsType.classbin0 -> 1330 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/IDType.classbin0 -> 1315 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/IntType.classbin0 -> 2338 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/IntegerType.classbin0 -> 1940 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/LanguageType.classbin0 -> 1692 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/LengthFacet.classbin0 -> 829 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/ListSimpleType.classbin0 -> 1633 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/LongType.classbin0 -> 2358 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/MaxExclusiveFacet.classbin0 -> 1798 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/MaxInclusiveFacet.classbin0 -> 1841 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/MaxLengthFacet.classbin0 -> 838 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/MinExclusiveFacet.classbin0 -> 1797 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/MinInclusiveFacet.classbin0 -> 1840 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/MinLengthFacet.classbin0 -> 838 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/NCNameType.classbin0 -> 2021 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/NMTokenType.classbin0 -> 1867 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/NMTokensType.classbin0 -> 2500 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/NameType.classbin0 -> 1914 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/NegativeIntegerType.classbin0 -> 1988 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/NonNegativeIntegerType.classbin0 -> 2080 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/NonPositiveIntegerType.classbin0 -> 2080 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/NormalizedStringType.classbin0 -> 1577 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/NotationType.classbin0 -> 1538 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/PatternFacet.classbin0 -> 878 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/PositiveIntegerType.classbin0 -> 1975 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/QNameType.classbin0 -> 2399 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/ShortType.classbin0 -> 2332 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/SimpleType.classbin0 -> 5599 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/StringType.classbin0 -> 941 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/TimeType$Time.classbin0 -> 1036 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/TimeType.classbin0 -> 3776 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/TokenType.classbin0 -> 1662 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/TotalDigitsFacet.classbin0 -> 845 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/Type.classbin0 -> 551 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/TypeBuilder.classbin0 -> 7085 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/TypeLibrary.classbin0 -> 7275 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/TypeLibraryFactory.classbin0 -> 753 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/UnionSimpleType.classbin0 -> 1702 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedByteType.classbin0 -> 2212 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedIntType.classbin0 -> 2216 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedLongType.classbin0 -> 2235 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedShortType.classbin0 -> 2226 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/datatype/WhiteSpaceFacet.classbin0 -> 953 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/AnyNameNameClass.classbin0 -> 642 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/AttributePattern.classbin0 -> 463 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/ChoiceNameClass.classbin0 -> 654 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/ChoicePattern.classbin0 -> 413 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/DataPattern.classbin0 -> 605 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/Define.classbin0 -> 397 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/ElementPattern.classbin0 -> 457 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/EmptyPattern.classbin0 -> 439 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/FullSyntaxBuilder.classbin0 -> 32653 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/Grammar.classbin0 -> 805 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/GrammarException.classbin0 -> 394 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/GrammarValidator.classbin0 -> 1483 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/GroupPattern.classbin0 -> 410 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/InterleavePattern.classbin0 -> 425 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/ListPattern.classbin0 -> 387 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/NSNameNameClass.classbin0 -> 748 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/NameClass.classbin0 -> 370 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/NameNameClass.classbin0 -> 652 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/NotAllowedPattern.classbin0 -> 454 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/OneOrMorePattern.classbin0 -> 402 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/Param.classbin0 -> 346 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/Pattern.classbin0 -> 300 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/RELAXNGSchemaFactory.classbin0 -> 4226 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/RefPattern.classbin0 -> 363 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/TextPattern.classbin0 -> 436 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/relaxng/ValuePattern.classbin0 -> 499 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/AnyAttribute.classbin0 -> 642 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/AttributeDeclaration.classbin0 -> 1008 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/AttributeUse.classbin0 -> 672 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/ComplexType.classbin0 -> 937 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/ElementDeclaration.classbin0 -> 1233 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/Particle.classbin0 -> 558 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/ValidationException.classbin0 -> 483 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchema.classbin0 -> 1892 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaAttributeTypeInfo.classbin0 -> 1700 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaBuilder.classbin0 -> 14866 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaElementTypeInfo.classbin0 -> 1657 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaSchemaFactory.classbin0 -> 4437 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaTypeInfo.classbin0 -> 1095 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaTypeInfoProvider.classbin0 -> 1088 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaValidator.classbin0 -> 1500 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaValidatorHandler.classbin0 -> 10302 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/AndExpr.classbin0 -> 1548 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/ArithmeticExpr.classbin0 -> 2522 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/BooleanFunction.classbin0 -> 1655 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/CeilingFunction.classbin0 -> 1681 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/ConcatFunction.classbin0 -> 2181 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/Constant.classbin0 -> 1572 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/ContainsFunction.classbin0 -> 1971 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/CountFunction.classbin0 -> 1592 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/DocumentOrderComparator.classbin0 -> 694 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/EqualityExpr.classbin0 -> 4075 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/Expr$ExprNodeSet.classbin0 -> 939 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/Expr.classbin0 -> 8763 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/FalseFunction.classbin0 -> 955 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/FloorFunction.classbin0 -> 1674 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/Function.classbin0 -> 156 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/FunctionCall.classbin0 -> 3750 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/IdFunction.classbin0 -> 1789 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/LangFunction.classbin0 -> 2382 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/LastFunction.classbin0 -> 933 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/LocalNameFunction.classbin0 -> 1830 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/NameFunction.classbin0 -> 1797 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/NameTest.classbin0 -> 2393 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/NamespaceTest.classbin0 -> 2047 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/NamespaceUriFunction.classbin0 -> 1848 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/NegativeExpr.classbin0 -> 1357 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/NodeTypeTest.classbin0 -> 2035 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/NormalizeSpaceFunction.classbin0 -> 2184 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/NotFunction.classbin0 -> 1639 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/NumberFunction.classbin0 -> 1651 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/OrExpr.classbin0 -> 1544 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/ParenthesizedExpr.classbin0 -> 1627 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/Path.classbin0 -> 356 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/Pattern.classbin0 -> 318 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/PositionFunction.classbin0 -> 949 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/Predicate.classbin0 -> 1545 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/RelationalExpr.classbin0 -> 1897 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/Root.classbin0 -> 1538 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/RoundFunction.classbin0 -> 1759 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/Selector.classbin0 -> 8831 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/StartsWithFunction.classbin0 -> 1982 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/Steps.classbin0 -> 4349 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/StringFunction.classbin0 -> 1678 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/StringLengthFunction.classbin0 -> 1853 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/SubstringAfterFunction.classbin0 -> 2036 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/SubstringBeforeFunction.classbin0 -> 2011 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/SubstringFunction.classbin0 -> 2340 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/SumFunction.classbin0 -> 2040 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/Test.classbin0 -> 422 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/TranslateFunction.classbin0 -> 2543 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/TrueFunction.classbin0 -> 950 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/UnionExpr.classbin0 -> 2105 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/VariableReference.classbin0 -> 2043 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathFactoryImpl.classbin0 -> 1666 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathImpl.classbin0 -> 3800 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyCheckClass.classbin0 -> 7787 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyDefRedClass.classbin0 -> 863 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyDgotoClass.classbin0 -> 669 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyGindexClass.classbin0 -> 589 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyLenClass.classbin0 -> 952 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyLhsClass.classbin0 -> 1018 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyNameClass.classbin0 -> 1520 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyRindexClass.classbin0 -> 774 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathParser$YySindexClass.classbin0 -> 1024 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyTableClass.classbin0 -> 5389 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathParser$yyException.classbin0 -> 453 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathParser$yyInput.classbin0 -> 330 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathParser.classbin0 -> 15434 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathTokenizer$XPathToken.classbin0 -> 796 bytes
-rw-r--r--libjava/classpath/lib/gnu/xml/xpath/XPathTokenizer.classbin0 -> 7206 bytes
-rw-r--r--libjava/classpath/lib/java/applet/Applet$AccessibleApplet.classbin0 -> 1235 bytes
-rw-r--r--libjava/classpath/lib/java/applet/Applet$URLAudioClip.classbin0 -> 1500 bytes
-rw-r--r--libjava/classpath/lib/java/applet/Applet.classbin0 -> 4351 bytes
-rw-r--r--libjava/classpath/lib/java/applet/AppletContext.classbin0 -> 833 bytes
-rw-r--r--libjava/classpath/lib/java/applet/AppletStub.classbin0 -> 359 bytes
-rw-r--r--libjava/classpath/lib/java/applet/AudioClip.classbin0 -> 162 bytes
-rw-r--r--libjava/classpath/lib/java/awt/AWTError.classbin0 -> 394 bytes
-rw-r--r--libjava/classpath/lib/java/awt/AWTEvent.classbin0 -> 3487 bytes
-rw-r--r--libjava/classpath/lib/java/awt/AWTEventMulticaster.classbin0 -> 14395 bytes
-rw-r--r--libjava/classpath/lib/java/awt/AWTException.classbin0 -> 410 bytes
-rw-r--r--libjava/classpath/lib/java/awt/AWTKeyStroke$1.classbin0 -> 1001 bytes
-rw-r--r--libjava/classpath/lib/java/awt/AWTKeyStroke$2.classbin0 -> 1451 bytes
-rw-r--r--libjava/classpath/lib/java/awt/AWTKeyStroke$3.classbin0 -> 1214 bytes
-rw-r--r--libjava/classpath/lib/java/awt/AWTKeyStroke.classbin0 -> 7354 bytes
-rw-r--r--libjava/classpath/lib/java/awt/AWTPermission.classbin0 -> 558 bytes
-rw-r--r--libjava/classpath/lib/java/awt/ActiveEvent.classbin0 -> 137 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Adjustable.classbin0 -> 666 bytes
-rw-r--r--libjava/classpath/lib/java/awt/AlphaComposite$1.classbin0 -> 715 bytes
-rw-r--r--libjava/classpath/lib/java/awt/AlphaComposite.classbin0 -> 3106 bytes
-rw-r--r--libjava/classpath/lib/java/awt/AttributeValue.classbin0 -> 609 bytes
-rw-r--r--libjava/classpath/lib/java/awt/BasicStroke.classbin0 -> 11709 bytes
-rw-r--r--libjava/classpath/lib/java/awt/BorderLayout.classbin0 -> 8006 bytes
-rw-r--r--libjava/classpath/lib/java/awt/BufferCapabilities$FlipContents.classbin0 -> 873 bytes
-rw-r--r--libjava/classpath/lib/java/awt/BufferCapabilities.classbin0 -> 1772 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Button$AccessibleAWTButton.classbin0 -> 2322 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Button.classbin0 -> 4645 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Canvas$AccessibleAWTCanvas.classbin0 -> 783 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Canvas$CanvasBltBufferStrategy.classbin0 -> 947 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Canvas$CanvasFlipBufferStrategy.classbin0 -> 972 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Canvas.classbin0 -> 3756 bytes
-rw-r--r--libjava/classpath/lib/java/awt/CardLayout.classbin0 -> 6645 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Checkbox$AccessibleAWTCheckbox.classbin0 -> 2701 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Checkbox.classbin0 -> 5130 bytes
-rw-r--r--libjava/classpath/lib/java/awt/CheckboxGroup.classbin0 -> 1568 bytes
-rw-r--r--libjava/classpath/lib/java/awt/CheckboxMenuItem$AccessibleAWTCheckboxMenuItem.classbin0 -> 734 bytes
-rw-r--r--libjava/classpath/lib/java/awt/CheckboxMenuItem.classbin0 -> 4664 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Choice$AccessibleAWTChoice.classbin0 -> 1502 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Choice.classbin0 -> 6422 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Color.classbin0 -> 9697 bytes
-rw-r--r--libjava/classpath/lib/java/awt/ColorPaintContext$ColorRaster.classbin0 -> 2055 bytes
-rw-r--r--libjava/classpath/lib/java/awt/ColorPaintContext.classbin0 -> 1437 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Component$AccessibleAWTComponent$AccessibleAWTComponentHandler.classbin0 -> 1391 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Component$AccessibleAWTComponent$AccessibleAWTFocusHandler.classbin0 -> 1188 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Component$AccessibleAWTComponent.classbin0 -> 7344 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Component$BltBufferStrategy.classbin0 -> 3260 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Component$FlipBufferStrategy.classbin0 -> 3406 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Component$HeavyweightInLightweightListener.classbin0 -> 1500 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Component.classbin0 -> 57337 bytes
-rw-r--r--libjava/classpath/lib/java/awt/ComponentOrientation.classbin0 -> 1996 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Composite.classbin0 -> 243 bytes
-rw-r--r--libjava/classpath/lib/java/awt/CompositeContext.classbin0 -> 247 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Container$AccessibleAWTContainer$AccessibleContainerHandler.classbin0 -> 1195 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Container$AccessibleAWTContainer.classbin0 -> 1986 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Container$GfxPaintAllVisitor.classbin0 -> 801 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Container$GfxPaintVisitor.classbin0 -> 789 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Container$GfxPrintAllVisitor.classbin0 -> 801 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Container$GfxPrintVisitor.classbin0 -> 789 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Container$GfxVisitor.classbin0 -> 421 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Container.classbin0 -> 25778 bytes
-rw-r--r--libjava/classpath/lib/java/awt/ContainerOrderFocusTraversalPolicy.classbin0 -> 5181 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Cursor.classbin0 -> 3144 bytes
-rw-r--r--libjava/classpath/lib/java/awt/DefaultFocusTraversalPolicy.classbin0 -> 1060 bytes
-rw-r--r--libjava/classpath/lib/java/awt/DefaultKeyboardFocusManager$EventDelayRequest.classbin0 -> 2221 bytes
-rw-r--r--libjava/classpath/lib/java/awt/DefaultKeyboardFocusManager.classbin0 -> 8339 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Dialog$AccessibleAWTDialog.classbin0 -> 1304 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Dialog.classbin0 -> 5452 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Dimension.classbin0 -> 2137 bytes
-rw-r--r--libjava/classpath/lib/java/awt/DisplayMode.classbin0 -> 1147 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Event.classbin0 -> 4355 bytes
-rw-r--r--libjava/classpath/lib/java/awt/EventDispatchThread.classbin0 -> 1751 bytes
-rw-r--r--libjava/classpath/lib/java/awt/EventQueue$Queue.classbin0 -> 610 bytes
-rw-r--r--libjava/classpath/lib/java/awt/EventQueue.classbin0 -> 7265 bytes
-rw-r--r--libjava/classpath/lib/java/awt/FileDialog.classbin0 -> 3706 bytes
-rw-r--r--libjava/classpath/lib/java/awt/FlowLayout.classbin0 -> 4816 bytes
-rw-r--r--libjava/classpath/lib/java/awt/FocusTraversalPolicy.classbin0 -> 734 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Font.classbin0 -> 14714 bytes
-rw-r--r--libjava/classpath/lib/java/awt/FontFormatException.classbin0 -> 431 bytes
-rw-r--r--libjava/classpath/lib/java/awt/FontMetrics.classbin0 -> 6101 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Frame$AccessibleAWTFrame.classbin0 -> 1302 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Frame.classbin0 -> 7975 bytes
-rw-r--r--libjava/classpath/lib/java/awt/GradientPaint.classbin0 -> 2918 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Graphics.classbin0 -> 5028 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Graphics2D.classbin0 -> 2479 bytes
-rw-r--r--libjava/classpath/lib/java/awt/GraphicsConfigTemplate.classbin0 -> 684 bytes
-rw-r--r--libjava/classpath/lib/java/awt/GraphicsConfiguration.classbin0 -> 1797 bytes
-rw-r--r--libjava/classpath/lib/java/awt/GraphicsDevice.classbin0 -> 2719 bytes
-rw-r--r--libjava/classpath/lib/java/awt/GraphicsEnvironment.classbin0 -> 2586 bytes
-rw-r--r--libjava/classpath/lib/java/awt/GridBagConstraints.classbin0 -> 2167 bytes
-rw-r--r--libjava/classpath/lib/java/awt/GridBagLayout.classbin0 -> 16068 bytes
-rw-r--r--libjava/classpath/lib/java/awt/GridBagLayoutInfo.classbin0 -> 737 bytes
-rw-r--r--libjava/classpath/lib/java/awt/GridLayout.classbin0 -> 5050 bytes
-rw-r--r--libjava/classpath/lib/java/awt/HeadlessException.classbin0 -> 526 bytes
-rw-r--r--libjava/classpath/lib/java/awt/IllegalComponentStateException.classbin0 -> 557 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Image.classbin0 -> 2109 bytes
-rw-r--r--libjava/classpath/lib/java/awt/ImageCapabilities.classbin0 -> 900 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Insets.classbin0 -> 1998 bytes
-rw-r--r--libjava/classpath/lib/java/awt/ItemSelectable.classbin0 -> 261 bytes
-rw-r--r--libjava/classpath/lib/java/awt/JobAttributes$DefaultSelectionType.classbin0 -> 812 bytes
-rw-r--r--libjava/classpath/lib/java/awt/JobAttributes$DestinationType.classbin0 -> 726 bytes
-rw-r--r--libjava/classpath/lib/java/awt/JobAttributes$DialogType.classbin0 -> 768 bytes
-rw-r--r--libjava/classpath/lib/java/awt/JobAttributes$MultipleDocumentHandlingType.classbin0 -> 903 bytes
-rw-r--r--libjava/classpath/lib/java/awt/JobAttributes$SidesType.classbin0 -> 833 bytes
-rw-r--r--libjava/classpath/lib/java/awt/JobAttributes.classbin0 -> 9010 bytes
-rw-r--r--libjava/classpath/lib/java/awt/KeyEventDispatcher.classbin0 -> 184 bytes
-rw-r--r--libjava/classpath/lib/java/awt/KeyEventPostProcessor.classbin0 -> 193 bytes
-rw-r--r--libjava/classpath/lib/java/awt/KeyboardFocusManager.classbin0 -> 14539 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Label$AccessibleAWTLabel.classbin0 -> 900 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Label.classbin0 -> 2964 bytes
-rw-r--r--libjava/classpath/lib/java/awt/LayoutManager.classbin0 -> 402 bytes
-rw-r--r--libjava/classpath/lib/java/awt/LayoutManager2.classbin0 -> 433 bytes
-rw-r--r--libjava/classpath/lib/java/awt/LightweightDispatcher.classbin0 -> 4928 bytes
-rw-r--r--libjava/classpath/lib/java/awt/List$AccessibleAWTList$AccessibleAWTListChild.classbin0 -> 1888 bytes
-rw-r--r--libjava/classpath/lib/java/awt/List$AccessibleAWTList.classbin0 -> 3495 bytes
-rw-r--r--libjava/classpath/lib/java/awt/List.classbin0 -> 11505 bytes
-rw-r--r--libjava/classpath/lib/java/awt/MediaTracker$MediaEntry.classbin0 -> 970 bytes
-rw-r--r--libjava/classpath/lib/java/awt/MediaTracker.classbin0 -> 5777 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Menu$AccessibleAWTMenu.classbin0 -> 760 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Menu.classbin0 -> 5501 bytes
-rw-r--r--libjava/classpath/lib/java/awt/MenuBar$AccessibleAWTMenuBar.classbin0 -> 806 bytes
-rw-r--r--libjava/classpath/lib/java/awt/MenuBar.classbin0 -> 4947 bytes
-rw-r--r--libjava/classpath/lib/java/awt/MenuComponent$AccessibleAWTMenuComponent.classbin0 -> 6273 bytes
-rw-r--r--libjava/classpath/lib/java/awt/MenuComponent.classbin0 -> 4426 bytes
-rw-r--r--libjava/classpath/lib/java/awt/MenuContainer.classbin0 -> 262 bytes
-rw-r--r--libjava/classpath/lib/java/awt/MenuItem$AccessibleAWTMenuItem.classbin0 -> 2507 bytes
-rw-r--r--libjava/classpath/lib/java/awt/MenuItem.classbin0 -> 5918 bytes
-rw-r--r--libjava/classpath/lib/java/awt/MenuShortcut.classbin0 -> 5566 bytes
-rw-r--r--libjava/classpath/lib/java/awt/MouseInfo.classbin0 -> 1744 bytes
-rw-r--r--libjava/classpath/lib/java/awt/PageAttributes$ColorType.classbin0 -> 720 bytes
-rw-r--r--libjava/classpath/lib/java/awt/PageAttributes$MediaType.classbin0 -> 8335 bytes
-rw-r--r--libjava/classpath/lib/java/awt/PageAttributes$OrientationRequestedType.classbin0 -> 777 bytes
-rw-r--r--libjava/classpath/lib/java/awt/PageAttributes$OriginType.classbin0 -> 727 bytes
-rw-r--r--libjava/classpath/lib/java/awt/PageAttributes$PrintQualityType.classbin0 -> 788 bytes
-rw-r--r--libjava/classpath/lib/java/awt/PageAttributes.classbin0 -> 6150 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Paint.classbin0 -> 311 bytes
-rw-r--r--libjava/classpath/lib/java/awt/PaintContext.classbin0 -> 246 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Panel$AccessibleAWTPanel.classbin0 -> 773 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Panel.classbin0 -> 1695 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Point.classbin0 -> 2317 bytes
-rw-r--r--libjava/classpath/lib/java/awt/PointerInfo.classbin0 -> 656 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Polygon$1.classbin0 -> 1484 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Polygon.classbin0 -> 5355 bytes
-rw-r--r--libjava/classpath/lib/java/awt/PopupMenu$AccessibleAWTPopupMenu.classbin0 -> 799 bytes
-rw-r--r--libjava/classpath/lib/java/awt/PopupMenu.classbin0 -> 2008 bytes
-rw-r--r--libjava/classpath/lib/java/awt/PrintGraphics.classbin0 -> 162 bytes
-rw-r--r--libjava/classpath/lib/java/awt/PrintJob.classbin0 -> 533 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Rectangle.classbin0 -> 6927 bytes
-rw-r--r--libjava/classpath/lib/java/awt/RenderingHints$Key.classbin0 -> 818 bytes
-rw-r--r--libjava/classpath/lib/java/awt/RenderingHints$KeyImpl.classbin0 -> 956 bytes
-rw-r--r--libjava/classpath/lib/java/awt/RenderingHints.classbin0 -> 7812 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Robot$1.classbin0 -> 526 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Robot.classbin0 -> 5749 bytes
-rw-r--r--libjava/classpath/lib/java/awt/ScrollPane$AccessibleAWTScrollPane.classbin0 -> 820 bytes
-rw-r--r--libjava/classpath/lib/java/awt/ScrollPane.classbin0 -> 8617 bytes
-rw-r--r--libjava/classpath/lib/java/awt/ScrollPaneAdjustable.classbin0 -> 4436 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Scrollbar$AccessibleAWTScrollBar.classbin0 -> 2221 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Scrollbar.classbin0 -> 7765 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Shape.classbin0 -> 514 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Stroke.classbin0 -> 168 bytes
-rw-r--r--libjava/classpath/lib/java/awt/SystemColor.classbin0 -> 4272 bytes
-rw-r--r--libjava/classpath/lib/java/awt/TextArea$AccessibleAWTTextArea.classbin0 -> 734 bytes
-rw-r--r--libjava/classpath/lib/java/awt/TextArea.classbin0 -> 6781 bytes
-rw-r--r--libjava/classpath/lib/java/awt/TextComponent$AccessibleAWTTextComponent.classbin0 -> 4191 bytes
-rw-r--r--libjava/classpath/lib/java/awt/TextComponent.classbin0 -> 5979 bytes
-rw-r--r--libjava/classpath/lib/java/awt/TextField$AccessibleAWTTextField.classbin0 -> 743 bytes
-rw-r--r--libjava/classpath/lib/java/awt/TextField.classbin0 -> 6258 bytes
-rw-r--r--libjava/classpath/lib/java/awt/TexturePaint.classbin0 -> 1491 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Toolkit$1.classbin0 -> 616 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Toolkit$2.classbin0 -> 3538 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Toolkit.classbin0 -> 14310 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Transparency.classbin0 -> 262 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Window$AccessibleAWTWindow.classbin0 -> 1243 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Window$WindowBltBufferStrategy.classbin0 -> 947 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Window$WindowFlipBufferStrategy.classbin0 -> 972 bytes
-rw-r--r--libjava/classpath/lib/java/awt/Window.classbin0 -> 17825 bytes
-rw-r--r--libjava/classpath/lib/java/awt/color/CMMException.classbin0 -> 429 bytes
-rw-r--r--libjava/classpath/lib/java/awt/color/ColorSpace.classbin0 -> 3046 bytes
-rw-r--r--libjava/classpath/lib/java/awt/color/ICC_ColorSpace.classbin0 -> 3606 bytes
-rw-r--r--libjava/classpath/lib/java/awt/color/ICC_Profile.classbin0 -> 18802 bytes
-rw-r--r--libjava/classpath/lib/java/awt/color/ICC_ProfileGray.classbin0 -> 1361 bytes
-rw-r--r--libjava/classpath/lib/java/awt/color/ICC_ProfileRGB.classbin0 -> 2417 bytes
-rw-r--r--libjava/classpath/lib/java/awt/color/ProfileDataException.classbin0 -> 453 bytes
-rw-r--r--libjava/classpath/lib/java/awt/datatransfer/Clipboard.classbin0 -> 3685 bytes
-rw-r--r--libjava/classpath/lib/java/awt/datatransfer/ClipboardOwner.classbin0 -> 230 bytes
-rw-r--r--libjava/classpath/lib/java/awt/datatransfer/DataFlavor.classbin0 -> 12089 bytes
-rw-r--r--libjava/classpath/lib/java/awt/datatransfer/FlavorEvent.classbin0 -> 423 bytes
-rw-r--r--libjava/classpath/lib/java/awt/datatransfer/FlavorListener.classbin0 -> 228 bytes
-rw-r--r--libjava/classpath/lib/java/awt/datatransfer/FlavorMap.classbin0 -> 507 bytes
-rw-r--r--libjava/classpath/lib/java/awt/datatransfer/FlavorTable.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/java/awt/datatransfer/MimeType.classbin0 -> 4293 bytes
-rw-r--r--libjava/classpath/lib/java/awt/datatransfer/MimeTypeParseException.classbin0 -> 547 bytes
-rw-r--r--libjava/classpath/lib/java/awt/datatransfer/StringSelection.classbin0 -> 1799 bytes
-rw-r--r--libjava/classpath/lib/java/awt/datatransfer/SystemFlavorMap.classbin0 -> 5169 bytes
-rw-r--r--libjava/classpath/lib/java/awt/datatransfer/Transferable.classbin0 -> 459 bytes
-rw-r--r--libjava/classpath/lib/java/awt/datatransfer/UnsupportedFlavorException.classbin0 -> 641 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/Autoscroll.classbin0 -> 209 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DnDConstants.classbin0 -> 529 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DnDEventMulticaster.classbin0 -> 1262 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DragGestureEvent.classbin0 -> 3417 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DragGestureListener.classbin0 -> 232 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DragGestureRecognizer.classbin0 -> 4026 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DragSource.classbin0 -> 7238 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DragSourceAdapter.classbin0 -> 1104 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DragSourceContext.classbin0 -> 5805 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DragSourceDragEvent.classbin0 -> 1593 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DragSourceDropEvent.classbin0 -> 1240 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DragSourceEvent.classbin0 -> 1259 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DragSourceListener.classbin0 -> 385 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DragSourceMotionListener.classbin0 -> 238 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DropTarget$DropTargetAutoScroller.classbin0 -> 2504 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DropTarget.classbin0 -> 6159 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DropTargetAdapter.classbin0 -> 817 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DropTargetContext$TransferableProxy.classbin0 -> 1371 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DropTargetContext.classbin0 -> 3312 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DropTargetDragEvent.classbin0 -> 2244 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DropTargetDropEvent.classbin0 -> 2590 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DropTargetEvent.classbin0 -> 629 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/DropTargetListener.classbin0 -> 378 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/InvalidDnDOperationException.classbin0 -> 553 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/MouseDragGestureRecognizer.classbin0 -> 2199 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/peer/DragSourceContextPeer.classbin0 -> 457 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/peer/DropTargetContextPeer.classbin0 -> 631 bytes
-rw-r--r--libjava/classpath/lib/java/awt/dnd/peer/DropTargetPeer.classbin0 -> 209 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/AWTEventListener.classbin0 -> 210 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/AWTEventListenerProxy.classbin0 -> 859 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/ActionEvent.classbin0 -> 2338 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/ActionListener.classbin0 -> 215 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/AdjustmentEvent.classbin0 -> 2301 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/AdjustmentListener.classbin0 -> 234 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/ComponentAdapter.classbin0 -> 765 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/ComponentEvent.classbin0 -> 1641 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/ComponentListener.classbin0 -> 301 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/ContainerAdapter.classbin0 -> 596 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/ContainerEvent.classbin0 -> 1507 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/ContainerListener.classbin0 -> 250 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/FocusAdapter.classbin0 -> 562 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/FocusEvent.classbin0 -> 1702 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/FocusListener.classbin0 -> 228 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/HierarchyBoundsAdapter.classbin0 -> 618 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/HierarchyBoundsListener.classbin0 -> 260 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/HierarchyEvent.classbin0 -> 2402 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/HierarchyListener.classbin0 -> 225 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/InputEvent.classbin0 -> 2833 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/InputMethodEvent.classbin0 -> 3854 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/InputMethodListener.classbin0 -> 268 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/InvocationEvent.classbin0 -> 2700 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/ItemEvent.classbin0 -> 1688 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/ItemListener.classbin0 -> 210 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/KeyAdapter.classbin0 -> 629 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/KeyEvent.classbin0 -> 15180 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/KeyListener.classbin0 -> 242 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/MouseAdapter.classbin0 -> 812 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/MouseEvent.classbin0 -> 3968 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/MouseListener.classbin0 -> 301 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/MouseMotionAdapter.classbin0 -> 588 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/MouseMotionListener.classbin0 -> 242 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/MouseWheelEvent.classbin0 -> 1770 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/MouseWheelListener.classbin0 -> 227 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/PaintEvent.classbin0 -> 1383 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/TextEvent.classbin0 -> 672 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/TextListener.classbin0 -> 210 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/WindowAdapter.classbin0 -> 1343 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/WindowEvent.classbin0 -> 2974 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/WindowFocusListener.classbin0 -> 253 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/WindowListener.classbin0 -> 367 bytes
-rw-r--r--libjava/classpath/lib/java/awt/event/WindowStateListener.classbin0 -> 228 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/FontRenderContext.classbin0 -> 1637 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/GlyphJustificationInfo.classbin0 -> 1006 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/GlyphMetrics.classbin0 -> 2130 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/GlyphVector.classbin0 -> 3366 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/GraphicAttribute.classbin0 -> 1382 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/ImageGraphicAttribute.classbin0 -> 2224 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/LineBreakMeasurer.classbin0 -> 2685 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/LineMetrics.classbin0 -> 595 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/MultipleMaster.classbin0 -> 357 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/NumericShaper.classbin0 -> 4638 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/OpenType.classbin0 -> 1965 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/ShapeGraphicAttribute.classbin0 -> 2387 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/TextAttribute.classbin0 -> 4769 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/TextHitInfo.classbin0 -> 2065 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/TextLayout$CaretPolicy.classbin0 -> 1005 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/TextLayout$Run.classbin0 -> 946 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/TextLayout.classbin0 -> 23555 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/TextMeasurer.classbin0 -> 2843 bytes
-rw-r--r--libjava/classpath/lib/java/awt/font/TransformAttribute.classbin0 -> 989 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/AffineTransform.classbin0 -> 12490 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Arc2D$ArcIterator.classbin0 -> 3696 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Arc2D$Double.classbin0 -> 2281 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Arc2D$Float.classbin0 -> 2314 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Arc2D.classbin0 -> 8744 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Area$AreaIterator$IteratorSegment.classbin0 -> 630 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Area$AreaIterator.classbin0 -> 2481 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Area$CubicSegment.classbin0 -> 8297 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Area$Intersection.classbin0 -> 672 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Area$LineSegment.classbin0 -> 5193 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Area$QuadSegment.classbin0 -> 6012 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Area$Segment.classbin0 -> 6120 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Area.classbin0 -> 23638 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/CubicCurve2D$1.classbin0 -> 2038 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/CubicCurve2D$Double.classbin0 -> 2454 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/CubicCurve2D$Float.classbin0 -> 2694 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/CubicCurve2D.classbin0 -> 9086 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Dimension2D.classbin0 -> 893 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Ellipse2D$Double.classbin0 -> 1308 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Ellipse2D$Float.classbin0 -> 1459 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Ellipse2D.classbin0 -> 1989 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/FlatteningPathIterator.classbin0 -> 4030 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/GeneralPath$GeneralPathIterator.classbin0 -> 1905 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/GeneralPath.classbin0 -> 10364 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/IllegalPathStateException.classbin0 -> 543 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Line2D$1.classbin0 -> 1797 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Line2D$Double.classbin0 -> 1886 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Line2D$Float.classbin0 -> 2038 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Line2D.classbin0 -> 7219 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/NoninvertibleTransformException.classbin0 -> 471 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/PathIterator.classbin0 -> 497 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Point2D$Double.classbin0 -> 1125 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Point2D$Float.classbin0 -> 1232 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Point2D.classbin0 -> 2115 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/QuadCurve2D$1.classbin0 -> 1927 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/QuadCurve2D$Double.classbin0 -> 2038 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/QuadCurve2D$Float.classbin0 -> 2232 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/QuadCurve2D.classbin0 -> 7376 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Rectangle2D$1.classbin0 -> 1986 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Rectangle2D$Double.classbin0 -> 2839 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Rectangle2D$Float.classbin0 -> 3146 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/Rectangle2D.classbin0 -> 5149 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/RectangularShape.classbin0 -> 3979 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/RoundRectangle2D$1.classbin0 -> 3069 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/RoundRectangle2D$Double.classbin0 -> 1665 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/RoundRectangle2D$Float.classbin0 -> 1862 bytes
-rw-r--r--libjava/classpath/lib/java/awt/geom/RoundRectangle2D.classbin0 -> 2622 bytes
-rw-r--r--libjava/classpath/lib/java/awt/im/InputContext.classbin0 -> 5168 bytes
-rw-r--r--libjava/classpath/lib/java/awt/im/InputMethodHighlight.classbin0 -> 1841 bytes
-rw-r--r--libjava/classpath/lib/java/awt/im/InputMethodRequests.classbin0 -> 623 bytes
-rw-r--r--libjava/classpath/lib/java/awt/im/InputSubset.classbin0 -> 915 bytes
-rw-r--r--libjava/classpath/lib/java/awt/im/spi/InputMethod.classbin0 -> 735 bytes
-rw-r--r--libjava/classpath/lib/java/awt/im/spi/InputMethodContext.classbin0 -> 538 bytes
-rw-r--r--libjava/classpath/lib/java/awt/im/spi/InputMethodDescriptor.classbin0 -> 540 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/AffineTransformOp.classbin0 -> 9727 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/AreaAveragingScaleFilter.classbin0 -> 3621 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/BandCombineOp.classbin0 -> 3170 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/BandedSampleModel.classbin0 -> 10990 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/BufferStrategy.classbin0 -> 482 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/BufferedImage$1.classbin0 -> 2235 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/BufferedImage.classbin0 -> 14436 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/BufferedImageFilter.classbin0 -> 2898 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/BufferedImageOp.classbin0 -> 603 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/ByteLookupTable.classbin0 -> 1414 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/ColorConvertOp.classbin0 -> 7929 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/ColorModel$SRGBColorModel.classbin0 -> 1142 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/ColorModel.classbin0 -> 9110 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/ComponentColorModel.classbin0 -> 7615 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/ComponentSampleModel.classbin0 -> 10746 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/ConvolveOp.classbin0 -> 5812 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/CropImageFilter.classbin0 -> 2690 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/DataBuffer.classbin0 -> 3033 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/DataBufferByte.classbin0 -> 1893 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/DataBufferDouble.classbin0 -> 2771 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/DataBufferFloat.classbin0 -> 2778 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/DataBufferInt.classbin0 -> 1875 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/DataBufferShort.classbin0 -> 1888 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/DataBufferUShort.classbin0 -> 1994 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/DirectColorModel.classbin0 -> 6947 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/FilteredImageSource.classbin0 -> 1902 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/ImageConsumer.classbin0 -> 816 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/ImageFilter.classbin0 -> 3039 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/ImageObserver.classbin0 -> 438 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/ImageProducer.classbin0 -> 328 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/ImagingOpException.classbin0 -> 447 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/IndexColorModel.classbin0 -> 7385 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/Kernel.classbin0 -> 1509 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/LookupOp.classbin0 -> 4856 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/LookupTable.classbin0 -> 688 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/MemoryImageSource.classbin0 -> 6116 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/MultiPixelPackedSampleModel.classbin0 -> 7107 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/PackedColorModel.classbin0 -> 4057 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/PixelGrabber$1.classbin0 -> 826 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/PixelGrabber.classbin0 -> 6014 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/PixelInterleavedSampleModel.classbin0 -> 1024 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/RGBImageFilter.classbin0 -> 3344 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/Raster.classbin0 -> 11880 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/RasterFormatException.classbin0 -> 456 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/RasterOp.classbin0 -> 545 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/RenderedImage.classbin0 -> 981 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/ReplicateScaleFilter.classbin0 -> 3101 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/RescaleOp.classbin0 -> 5920 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/SampleModel.classbin0 -> 9352 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/ShortLookupTable.classbin0 -> 1417 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/SinglePixelPackedSampleModel.classbin0 -> 7808 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/TileObserver.classbin0 -> 188 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/VolatileImage.classbin0 -> 1206 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/WritableRaster.classbin0 -> 7103 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/WritableRenderedImage.classbin0 -> 532 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/renderable/ContextualRenderedImageFactory.classbin0 -> 834 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/renderable/ParameterBlock.classbin0 -> 7441 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/renderable/RenderContext.classbin0 -> 2746 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/renderable/RenderableImage.classbin0 -> 827 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/renderable/RenderableImageOp.classbin0 -> 4519 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/renderable/RenderableImageProducer.classbin0 -> 4012 bytes
-rw-r--r--libjava/classpath/lib/java/awt/image/renderable/RenderedImageFactory.classbin0 -> 266 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/ButtonPeer.classbin0 -> 193 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/CanvasPeer.classbin0 -> 150 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/CheckboxMenuItemPeer.classbin0 -> 195 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/CheckboxPeer.classbin0 -> 280 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/ChoicePeer.classbin0 -> 274 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/ComponentPeer.classbin0 -> 2110 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/ContainerPeer.classbin0 -> 426 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/DialogPeer.classbin0 -> 220 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/FileDialogPeer.classbin0 -> 278 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/FontPeer.classbin0 -> 111 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/FramePeer.classbin0 -> 486 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/LabelPeer.classbin0 -> 220 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/LightweightPeer.classbin0 -> 160 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/ListPeer.classbin0 -> 562 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/MenuBarPeer.classbin0 -> 242 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/MenuComponentPeer.classbin0 -> 192 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/MenuItemPeer.classbin0 -> 270 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/MenuPeer.classbin0 -> 242 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/MouseInfoPeer.classbin0 -> 225 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/PanelPeer.classbin0 -> 148 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/PopupMenuPeer.classbin0 -> 224 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/RobotPeer.classbin0 -> 333 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/ScrollPanePeer.classbin0 -> 356 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/ScrollbarPeer.classbin0 -> 247 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/TextAreaPeer.classbin0 -> 417 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/TextComponentPeer.classbin0 -> 612 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/TextFieldPeer.classbin0 -> 340 bytes
-rw-r--r--libjava/classpath/lib/java/awt/peer/WindowPeer.classbin0 -> 254 bytes
-rw-r--r--libjava/classpath/lib/java/awt/print/Book.classbin0 -> 1689 bytes
-rw-r--r--libjava/classpath/lib/java/awt/print/NoPrinterJob.classbin0 -> 1976 bytes
-rw-r--r--libjava/classpath/lib/java/awt/print/PageFormat.classbin0 -> 2188 bytes
-rw-r--r--libjava/classpath/lib/java/awt/print/Pageable.classbin0 -> 398 bytes
-rw-r--r--libjava/classpath/lib/java/awt/print/Paper.classbin0 -> 1511 bytes
-rw-r--r--libjava/classpath/lib/java/awt/print/Printable.classbin0 -> 334 bytes
-rw-r--r--libjava/classpath/lib/java/awt/print/PrinterAbortException.classbin0 -> 542 bytes
-rw-r--r--libjava/classpath/lib/java/awt/print/PrinterException.classbin0 -> 515 bytes
-rw-r--r--libjava/classpath/lib/java/awt/print/PrinterGraphics.classbin0 -> 182 bytes
-rw-r--r--libjava/classpath/lib/java/awt/print/PrinterIOException.classbin0 -> 873 bytes
-rw-r--r--libjava/classpath/lib/java/awt/print/PrinterJob.classbin0 -> 2499 bytes
-rw-r--r--libjava/classpath/lib/java/beans/AppletInitializer.classbin0 -> 254 bytes
-rw-r--r--libjava/classpath/lib/java/beans/BeanDescriptor.classbin0 -> 1332 bytes
-rw-r--r--libjava/classpath/lib/java/beans/BeanInfo.classbin0 -> 722 bytes
-rw-r--r--libjava/classpath/lib/java/beans/Beans.classbin0 -> 4626 bytes
-rw-r--r--libjava/classpath/lib/java/beans/Customizer.classbin0 -> 272 bytes
-rw-r--r--libjava/classpath/lib/java/beans/DefaultPersistenceDelegate.classbin0 -> 3915 bytes
-rw-r--r--libjava/classpath/lib/java/beans/DesignMode.classbin0 -> 256 bytes
-rw-r--r--libjava/classpath/lib/java/beans/Encoder$1.classbin0 -> 623 bytes
-rw-r--r--libjava/classpath/lib/java/beans/Encoder.classbin0 -> 5974 bytes
-rw-r--r--libjava/classpath/lib/java/beans/EventHandler.classbin0 -> 6940 bytes
-rw-r--r--libjava/classpath/lib/java/beans/EventSetDescriptor.classbin0 -> 10501 bytes
-rw-r--r--libjava/classpath/lib/java/beans/ExceptionListener.classbin0 -> 179 bytes
-rw-r--r--libjava/classpath/lib/java/beans/ExplicitInfo.classbin0 -> 4484 bytes
-rw-r--r--libjava/classpath/lib/java/beans/Expression.classbin0 -> 1633 bytes
-rw-r--r--libjava/classpath/lib/java/beans/FeatureDescriptor.classbin0 -> 2393 bytes
-rw-r--r--libjava/classpath/lib/java/beans/IndexedPropertyChangeEvent.classbin0 -> 811 bytes
-rw-r--r--libjava/classpath/lib/java/beans/IndexedPropertyDescriptor.classbin0 -> 5909 bytes
-rw-r--r--libjava/classpath/lib/java/beans/IntrospectionException.classbin0 -> 440 bytes
-rw-r--r--libjava/classpath/lib/java/beans/Introspector.classbin0 -> 7027 bytes
-rw-r--r--libjava/classpath/lib/java/beans/MethodDescriptor.classbin0 -> 1028 bytes
-rw-r--r--libjava/classpath/lib/java/beans/ParameterDescriptor.classbin0 -> 316 bytes
-rw-r--r--libjava/classpath/lib/java/beans/PersistenceDelegate.classbin0 -> 1665 bytes
-rw-r--r--libjava/classpath/lib/java/beans/PropertyChangeEvent.classbin0 -> 1375 bytes
-rw-r--r--libjava/classpath/lib/java/beans/PropertyChangeListener.classbin0 -> 230 bytes
-rw-r--r--libjava/classpath/lib/java/beans/PropertyChangeListenerProxy.classbin0 -> 1124 bytes
-rw-r--r--libjava/classpath/lib/java/beans/PropertyChangeSupport.classbin0 -> 7022 bytes
-rw-r--r--libjava/classpath/lib/java/beans/PropertyDescriptor.classbin0 -> 7963 bytes
-rw-r--r--libjava/classpath/lib/java/beans/PropertyEditor.classbin0 -> 727 bytes
-rw-r--r--libjava/classpath/lib/java/beans/PropertyEditorManager.classbin0 -> 3761 bytes
-rw-r--r--libjava/classpath/lib/java/beans/PropertyEditorSupport.classbin0 -> 2744 bytes
-rw-r--r--libjava/classpath/lib/java/beans/PropertyVetoException.classbin0 -> 708 bytes
-rw-r--r--libjava/classpath/lib/java/beans/SimpleBeanInfo.classbin0 -> 1664 bytes
-rw-r--r--libjava/classpath/lib/java/beans/Statement.classbin0 -> 6040 bytes
-rw-r--r--libjava/classpath/lib/java/beans/VetoableChangeListener.classbin0 -> 291 bytes
-rw-r--r--libjava/classpath/lib/java/beans/VetoableChangeListenerProxy.classbin0 -> 1185 bytes
-rw-r--r--libjava/classpath/lib/java/beans/VetoableChangeSupport.classbin0 -> 6761 bytes
-rw-r--r--libjava/classpath/lib/java/beans/Visibility.classbin0 -> 207 bytes
-rw-r--r--libjava/classpath/lib/java/beans/XMLDecoder.classbin0 -> 2926 bytes
-rw-r--r--libjava/classpath/lib/java/beans/XMLEncoder.classbin0 -> 3443 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContext.classbin0 -> 983 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextChild.classbin0 -> 598 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextChildComponentProxy.classbin0 -> 212 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextChildSupport.classbin0 -> 4168 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextContainerProxy.classbin0 -> 202 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextEvent.classbin0 -> 1031 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextMembershipEvent.classbin0 -> 1426 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextMembershipListener.classbin0 -> 300 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextProxy.classbin0 -> 212 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextServiceAvailableEvent.classbin0 -> 1228 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextServiceProvider.classbin0 -> 531 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextServiceProviderBeanInfo.classbin0 -> 256 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextServiceRevokedEvent.classbin0 -> 1387 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextServiceRevokedListener.classbin0 -> 287 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextServices.classbin0 -> 1130 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextServicesListener.classbin0 -> 312 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$BCSSChild.classbin0 -> 892 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$BCSSProxyServiceProvider.classbin0 -> 2093 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$BCSSServiceProvider.classbin0 -> 1471 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$Request.classbin0 -> 837 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$ServiceLease.classbin0 -> 996 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$ServiceRequest.classbin0 -> 1145 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport.classbin0 -> 12765 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextSupport$BCSChild.classbin0 -> 1055 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextSupport$BCSIterator.classbin0 -> 829 bytes
-rw-r--r--libjava/classpath/lib/java/beans/beancontext/BeanContextSupport.classbin0 -> 15564 bytes
-rw-r--r--libjava/classpath/lib/java/io/BufferedInputStream.classbin0 -> 2997 bytes
-rw-r--r--libjava/classpath/lib/java/io/BufferedOutputStream.classbin0 -> 1318 bytes
-rw-r--r--libjava/classpath/lib/java/io/BufferedReader.classbin0 -> 5190 bytes
-rw-r--r--libjava/classpath/lib/java/io/BufferedWriter.classbin0 -> 2423 bytes
-rw-r--r--libjava/classpath/lib/java/io/ByteArrayInputStream.classbin0 -> 1661 bytes
-rw-r--r--libjava/classpath/lib/java/io/ByteArrayOutputStream.classbin0 -> 2496 bytes
-rw-r--r--libjava/classpath/lib/java/io/CharArrayReader.classbin0 -> 2503 bytes
-rw-r--r--libjava/classpath/lib/java/io/CharArrayWriter.classbin0 -> 3702 bytes
-rw-r--r--libjava/classpath/lib/java/io/CharConversionException.classbin0 -> 522 bytes
-rw-r--r--libjava/classpath/lib/java/io/Closeable.classbin0 -> 177 bytes
-rw-r--r--libjava/classpath/lib/java/io/DataInput.classbin0 -> 781 bytes
-rw-r--r--libjava/classpath/lib/java/io/DataInputStream.classbin0 -> 5170 bytes
-rw-r--r--libjava/classpath/lib/java/io/DataOutput.classbin0 -> 623 bytes
-rw-r--r--libjava/classpath/lib/java/io/DataOutputStream.classbin0 -> 3626 bytes
-rw-r--r--libjava/classpath/lib/java/io/DeleteFileHelper$1.classbin0 -> 739 bytes
-rw-r--r--libjava/classpath/lib/java/io/DeleteFileHelper.classbin0 -> 1228 bytes
-rw-r--r--libjava/classpath/lib/java/io/EOFException.classbin0 -> 489 bytes
-rw-r--r--libjava/classpath/lib/java/io/Externalizable.classbin0 -> 345 bytes
-rw-r--r--libjava/classpath/lib/java/io/File.classbin0 -> 13330 bytes
-rw-r--r--libjava/classpath/lib/java/io/FileDescriptor.classbin0 -> 1346 bytes
-rw-r--r--libjava/classpath/lib/java/io/FileFilter.classbin0 -> 146 bytes
-rw-r--r--libjava/classpath/lib/java/io/FileInputStream.classbin0 -> 3029 bytes
-rw-r--r--libjava/classpath/lib/java/io/FileNotFoundException.classbin0 -> 516 bytes
-rw-r--r--libjava/classpath/lib/java/io/FileOutputStream.classbin0 -> 2903 bytes
-rw-r--r--libjava/classpath/lib/java/io/FilePermission.classbin0 -> 3406 bytes
-rw-r--r--libjava/classpath/lib/java/io/FileReader.classbin0 -> 774 bytes
-rw-r--r--libjava/classpath/lib/java/io/FileWriter.classbin0 -> 1099 bytes
-rw-r--r--libjava/classpath/lib/java/io/FilenameFilter.classbin0 -> 172 bytes
-rw-r--r--libjava/classpath/lib/java/io/FilterInputStream.classbin0 -> 1405 bytes
-rw-r--r--libjava/classpath/lib/java/io/FilterOutputStream.classbin0 -> 1060 bytes
-rw-r--r--libjava/classpath/lib/java/io/FilterReader.classbin0 -> 1350 bytes
-rw-r--r--libjava/classpath/lib/java/io/FilterWriter.classbin0 -> 1112 bytes
-rw-r--r--libjava/classpath/lib/java/io/Flushable.classbin0 -> 177 bytes
-rw-r--r--libjava/classpath/lib/java/io/IOException.classbin0 -> 486 bytes
-rw-r--r--libjava/classpath/lib/java/io/InputStream.classbin0 -> 1659 bytes
-rw-r--r--libjava/classpath/lib/java/io/InputStreamReader.classbin0 -> 3729 bytes
-rw-r--r--libjava/classpath/lib/java/io/InterruptedIOException.classbin0 -> 680 bytes
-rw-r--r--libjava/classpath/lib/java/io/InvalidClassException.classbin0 -> 1027 bytes
-rw-r--r--libjava/classpath/lib/java/io/InvalidObjectException.classbin0 -> 448 bytes
-rw-r--r--libjava/classpath/lib/java/io/LineNumberInputStream.classbin0 -> 1926 bytes
-rw-r--r--libjava/classpath/lib/java/io/LineNumberReader.classbin0 -> 3594 bytes
-rw-r--r--libjava/classpath/lib/java/io/NotActiveException.classbin0 -> 517 bytes
-rw-r--r--libjava/classpath/lib/java/io/NotSerializableException.classbin0 -> 535 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectInput.classbin0 -> 447 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectInputStream$1.classbin0 -> 1152 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectInputStream$2.classbin0 -> 6148 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectInputStream$GetField.classbin0 -> 1025 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectInputStream$ValidatorAndPriority.classbin0 -> 786 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectInputStream.classbin0 -> 29187 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectInputValidation.classbin0 -> 221 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectOutput.classbin0 -> 378 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectOutputStream$1.classbin0 -> 4699 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectOutputStream$PutField.classbin0 -> 818 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectOutputStream.classbin0 -> 17829 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectStreamClass$1.classbin0 -> 946 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectStreamClass$2.classbin0 -> 834 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectStreamClass$InterfaceComparator.classbin0 -> 862 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectStreamClass$MemberComparator.classbin0 -> 1121 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectStreamClass.classbin0 -> 17794 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectStreamConstants.classbin0 -> 1529 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectStreamException.classbin0 -> 516 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectStreamField$1.classbin0 -> 810 bytes
-rw-r--r--libjava/classpath/lib/java/io/ObjectStreamField.classbin0 -> 6794 bytes
-rw-r--r--libjava/classpath/lib/java/io/OptionalDataException.classbin0 -> 498 bytes
-rw-r--r--libjava/classpath/lib/java/io/OutputStream.classbin0 -> 1018 bytes
-rw-r--r--libjava/classpath/lib/java/io/OutputStreamWriter.classbin0 -> 3952 bytes
-rw-r--r--libjava/classpath/lib/java/io/PipedInputStream.classbin0 -> 2836 bytes
-rw-r--r--libjava/classpath/lib/java/io/PipedOutputStream.classbin0 -> 1518 bytes
-rw-r--r--libjava/classpath/lib/java/io/PipedReader.classbin0 -> 2980 bytes
-rw-r--r--libjava/classpath/lib/java/io/PipedWriter.classbin0 -> 1514 bytes
-rw-r--r--libjava/classpath/lib/java/io/PrintStream.classbin0 -> 7581 bytes
-rw-r--r--libjava/classpath/lib/java/io/PrintWriter.classbin0 -> 7841 bytes
-rw-r--r--libjava/classpath/lib/java/io/PushbackInputStream.classbin0 -> 2552 bytes
-rw-r--r--libjava/classpath/lib/java/io/PushbackReader.classbin0 -> 3232 bytes
-rw-r--r--libjava/classpath/lib/java/io/RandomAccessFile.classbin0 -> 7493 bytes
-rw-r--r--libjava/classpath/lib/java/io/Reader.classbin0 -> 1933 bytes
-rw-r--r--libjava/classpath/lib/java/io/SequenceInputStream.classbin0 -> 1812 bytes
-rw-r--r--libjava/classpath/lib/java/io/Serializable.classbin0 -> 113 bytes
-rw-r--r--libjava/classpath/lib/java/io/SerializablePermission.classbin0 -> 1169 bytes
-rw-r--r--libjava/classpath/lib/java/io/StreamCorruptedException.classbin0 -> 535 bytes
-rw-r--r--libjava/classpath/lib/java/io/StreamTokenizer.classbin0 -> 6870 bytes
-rw-r--r--libjava/classpath/lib/java/io/StringBufferInputStream.classbin0 -> 1413 bytes
-rw-r--r--libjava/classpath/lib/java/io/StringReader.classbin0 -> 2210 bytes
-rw-r--r--libjava/classpath/lib/java/io/StringWriter.classbin0 -> 2955 bytes
-rw-r--r--libjava/classpath/lib/java/io/SyncFailedException.classbin0 -> 429 bytes
-rw-r--r--libjava/classpath/lib/java/io/UTFDataFormatException.classbin0 -> 519 bytes
-rw-r--r--libjava/classpath/lib/java/io/UnsupportedEncodingException.classbin0 -> 537 bytes
-rw-r--r--libjava/classpath/lib/java/io/VMObjectInputStream.classbin0 -> 472 bytes
-rw-r--r--libjava/classpath/lib/java/io/VMObjectStreamClass.classbin0 -> 1042 bytes
-rw-r--r--libjava/classpath/lib/java/io/WriteAbortedException.classbin0 -> 1176 bytes
-rw-r--r--libjava/classpath/lib/java/io/Writer.classbin0 -> 2355 bytes
-rw-r--r--libjava/classpath/lib/java/lang/AbstractMethodError.classbin0 -> 527 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Appendable.classbin0 -> 344 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ArithmeticException.classbin0 -> 515 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ArrayIndexOutOfBoundsException.classbin0 -> 827 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ArrayStoreException.classbin0 -> 515 bytes
-rw-r--r--libjava/classpath/lib/java/lang/AssertionError.classbin0 -> 1646 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Boolean.classbin0 -> 2395 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Byte.classbin0 -> 3077 bytes
-rw-r--r--libjava/classpath/lib/java/lang/CharSequence.classbin0 -> 257 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Character$Subset.classbin0 -> 795 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Character$UnicodeBlock.classbin0 -> 17734 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Character.classbin0 -> 11431 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Class.classbin0 -> 14910 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ClassCastException.classbin0 -> 512 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ClassCircularityError.classbin0 -> 517 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ClassFormatError.classbin0 -> 502 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ClassLoader$AnnotationsKey.classbin0 -> 1160 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ClassLoader.classbin0 -> 11539 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ClassNotFoundException.classbin0 -> 894 bytes
-rw-r--r--libjava/classpath/lib/java/lang/CloneNotSupportedException.classbin0 -> 529 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Cloneable.classbin0 -> 109 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Comparable.classbin0 -> 235 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Compiler.classbin0 -> 993 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Deprecated.classbin0 -> 331 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Double.classbin0 -> 4562 bytes
-rw-r--r--libjava/classpath/lib/java/lang/EcosProcess.classbin0 -> 1047 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Enum.classbin0 -> 2931 bytes
-rw-r--r--libjava/classpath/lib/java/lang/EnumConstantNotPresentException.classbin0 -> 1266 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Error.classbin0 -> 753 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Exception.classbin0 -> 765 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ExceptionInInitializerError.classbin0 -> 963 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Float.classbin0 -> 4642 bytes
-rw-r--r--libjava/classpath/lib/java/lang/IllegalAccessError.classbin0 -> 524 bytes
-rw-r--r--libjava/classpath/lib/java/lang/IllegalAccessException.classbin0 -> 517 bytes
-rw-r--r--libjava/classpath/lib/java/lang/IllegalArgumentException.classbin0 -> 827 bytes
-rw-r--r--libjava/classpath/lib/java/lang/IllegalMonitorStateException.classbin0 -> 542 bytes
-rw-r--r--libjava/classpath/lib/java/lang/IllegalStateException.classbin0 -> 818 bytes
-rw-r--r--libjava/classpath/lib/java/lang/IllegalThreadStateException.classbin0 -> 547 bytes
-rw-r--r--libjava/classpath/lib/java/lang/IncompatibleClassChangeError.classbin0 -> 538 bytes
-rw-r--r--libjava/classpath/lib/java/lang/IndexOutOfBoundsException.classbin0 -> 533 bytes
-rw-r--r--libjava/classpath/lib/java/lang/InheritableThreadLocal.classbin0 -> 1623 bytes
-rw-r--r--libjava/classpath/lib/java/lang/InstantiationError.classbin0 -> 524 bytes
-rw-r--r--libjava/classpath/lib/java/lang/InstantiationException.classbin0 -> 517 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Integer.classbin0 -> 6722 bytes
-rw-r--r--libjava/classpath/lib/java/lang/InternalError.classbin0 -> 500 bytes
-rw-r--r--libjava/classpath/lib/java/lang/InterruptedException.classbin0 -> 511 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Iterable.classbin0 -> 252 bytes
-rw-r--r--libjava/classpath/lib/java/lang/LinkageError.classbin0 -> 483 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Long.classbin0 -> 6360 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Math.classbin0 -> 3628 bytes
-rw-r--r--libjava/classpath/lib/java/lang/NegativeArraySizeException.classbin0 -> 536 bytes
-rw-r--r--libjava/classpath/lib/java/lang/NoClassDefFoundError.classbin0 -> 514 bytes
-rw-r--r--libjava/classpath/lib/java/lang/NoSuchFieldError.classbin0 -> 518 bytes
-rw-r--r--libjava/classpath/lib/java/lang/NoSuchFieldException.classbin0 -> 511 bytes
-rw-r--r--libjava/classpath/lib/java/lang/NoSuchMethodError.classbin0 -> 521 bytes
-rw-r--r--libjava/classpath/lib/java/lang/NoSuchMethodException.classbin0 -> 514 bytes
-rw-r--r--libjava/classpath/lib/java/lang/NullPointerException.classbin0 -> 518 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Number.classbin0 -> 967 bytes
-rw-r--r--libjava/classpath/lib/java/lang/NumberFormatException.classbin0 -> 529 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Object.classbin0 -> 1670 bytes
-rw-r--r--libjava/classpath/lib/java/lang/OutOfMemoryError.classbin0 -> 509 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Override.classbin0 -> 378 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Package.classbin0 -> 5278 bytes
-rw-r--r--libjava/classpath/lib/java/lang/PosixProcess$EOFInputStream.classbin0 -> 567 bytes
-rw-r--r--libjava/classpath/lib/java/lang/PosixProcess$ProcessManager.classbin0 -> 2643 bytes
-rw-r--r--libjava/classpath/lib/java/lang/PosixProcess.classbin0 -> 4143 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Process.classbin0 -> 520 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ProcessBuilder.classbin0 -> 2592 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Readable.classbin0 -> 197 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Runnable.classbin0 -> 127 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Runtime.classbin0 -> 6772 bytes
-rw-r--r--libjava/classpath/lib/java/lang/RuntimeException.classbin0 -> 786 bytes
-rw-r--r--libjava/classpath/lib/java/lang/RuntimePermission.classbin0 -> 582 bytes
-rw-r--r--libjava/classpath/lib/java/lang/SecurityException.classbin0 -> 806 bytes
-rw-r--r--libjava/classpath/lib/java/lang/SecurityManager$1.classbin0 -> 871 bytes
-rw-r--r--libjava/classpath/lib/java/lang/SecurityManager.classbin0 -> 9195 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Short.classbin0 -> 3282 bytes
-rw-r--r--libjava/classpath/lib/java/lang/StackOverflowError.classbin0 -> 515 bytes
-rw-r--r--libjava/classpath/lib/java/lang/StackTraceElement.classbin0 -> 2637 bytes
-rw-r--r--libjava/classpath/lib/java/lang/StrictMath.classbin0 -> 24574 bytes
-rw-r--r--libjava/classpath/lib/java/lang/String$CaseInsensitiveComparator.classbin0 -> 743 bytes
-rw-r--r--libjava/classpath/lib/java/lang/String.classbin0 -> 9041 bytes
-rw-r--r--libjava/classpath/lib/java/lang/StringBuffer.classbin0 -> 10367 bytes
-rw-r--r--libjava/classpath/lib/java/lang/StringBuilder.classbin0 -> 9663 bytes
-rw-r--r--libjava/classpath/lib/java/lang/StringIndexOutOfBoundsException.classbin0 -> 831 bytes
-rw-r--r--libjava/classpath/lib/java/lang/SuppressWarnings.classbin0 -> 509 bytes
-rw-r--r--libjava/classpath/lib/java/lang/System$EnvironmentCollection.classbin0 -> 2428 bytes
-rw-r--r--libjava/classpath/lib/java/lang/System$EnvironmentMap.classbin0 -> 2592 bytes
-rw-r--r--libjava/classpath/lib/java/lang/System$EnvironmentSet.classbin0 -> 1021 bytes
-rw-r--r--libjava/classpath/lib/java/lang/System.classbin0 -> 5896 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Thread$State.classbin0 -> 1242 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Thread$UncaughtExceptionHandler.classbin0 -> 281 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Thread.classbin0 -> 9327 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ThreadDeath.classbin0 -> 345 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ThreadGroup.classbin0 -> 8558 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ThreadLocal.classbin0 -> 1704 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Throwable$StaticData.classbin0 -> 598 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Throwable.classbin0 -> 4594 bytes
-rw-r--r--libjava/classpath/lib/java/lang/TypeNotPresentException.classbin0 -> 828 bytes
-rw-r--r--libjava/classpath/lib/java/lang/UnknownError.classbin0 -> 497 bytes
-rw-r--r--libjava/classpath/lib/java/lang/UnsatisfiedLinkError.classbin0 -> 514 bytes
-rw-r--r--libjava/classpath/lib/java/lang/UnsupportedClassVersionError.classbin0 -> 542 bytes
-rw-r--r--libjava/classpath/lib/java/lang/UnsupportedOperationException.classbin0 -> 842 bytes
-rw-r--r--libjava/classpath/lib/java/lang/VMClassLoader.classbin0 -> 5495 bytes
-rw-r--r--libjava/classpath/lib/java/lang/VMCompiler.classbin0 -> 6666 bytes
-rw-r--r--libjava/classpath/lib/java/lang/VMDouble.classbin0 -> 457 bytes
-rw-r--r--libjava/classpath/lib/java/lang/VMFloat.classbin0 -> 358 bytes
-rw-r--r--libjava/classpath/lib/java/lang/VMThrowable.classbin0 -> 476 bytes
-rw-r--r--libjava/classpath/lib/java/lang/VerifyError.classbin0 -> 487 bytes
-rw-r--r--libjava/classpath/lib/java/lang/VirtualMachineError.classbin0 -> 504 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Void.classbin0 -> 516 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Win32Process.classbin0 -> 1711 bytes
-rw-r--r--libjava/classpath/lib/java/lang/annotation/Annotation.classbin0 -> 355 bytes
-rw-r--r--libjava/classpath/lib/java/lang/annotation/AnnotationFormatError.classbin0 -> 744 bytes
-rw-r--r--libjava/classpath/lib/java/lang/annotation/AnnotationTypeMismatchException.classbin0 -> 821 bytes
-rw-r--r--libjava/classpath/lib/java/lang/annotation/Documented.classbin0 -> 342 bytes
-rw-r--r--libjava/classpath/lib/java/lang/annotation/ElementType.classbin0 -> 1451 bytes
-rw-r--r--libjava/classpath/lib/java/lang/annotation/IncompleteAnnotationException.classbin0 -> 1006 bytes
-rw-r--r--libjava/classpath/lib/java/lang/annotation/Inherited.classbin0 -> 441 bytes
-rw-r--r--libjava/classpath/lib/java/lang/annotation/Retention.classbin0 -> 492 bytes
-rw-r--r--libjava/classpath/lib/java/lang/annotation/RetentionPolicy.classbin0 -> 1186 bytes
-rw-r--r--libjava/classpath/lib/java/lang/annotation/Target.classbin0 -> 483 bytes
-rw-r--r--libjava/classpath/lib/java/lang/instrument/ClassDefinition.classbin0 -> 875 bytes
-rw-r--r--libjava/classpath/lib/java/lang/instrument/ClassFileTransformer.classbin0 -> 460 bytes
-rw-r--r--libjava/classpath/lib/java/lang/instrument/IllegalClassFormatException.classbin0 -> 554 bytes
-rw-r--r--libjava/classpath/lib/java/lang/instrument/Instrumentation.classbin0 -> 690 bytes
-rw-r--r--libjava/classpath/lib/java/lang/instrument/UnmodifiableClassException.classbin0 -> 551 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/ClassLoadingMXBean.classbin0 -> 301 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/CompilationMXBean.classbin0 -> 270 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/GarbageCollectorMXBean.classbin0 -> 257 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/ManagementFactory.classbin0 -> 8693 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/ManagementPermission.classbin0 -> 864 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/MemoryMXBean.classbin0 -> 349 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/MemoryManagerMXBean.classbin0 -> 258 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/MemoryNotificationInfo.classbin0 -> 2259 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/MemoryPoolMXBean.classbin0 -> 835 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/MemoryType.classbin0 -> 1030 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/MemoryUsage.classbin0 -> 3061 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/OperatingSystemMXBean.classbin0 -> 263 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/RuntimeMXBean.classbin0 -> 731 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/ThreadInfo.classbin0 -> 7798 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/ThreadMXBean.classbin0 -> 1008 bytes
-rw-r--r--libjava/classpath/lib/java/lang/management/VMManagementFactory.classbin0 -> 444 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ref/PhantomReference.classbin0 -> 848 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ref/Reference.classbin0 -> 1726 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ref/ReferenceQueue.classbin0 -> 1842 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ref/SoftReference.classbin0 -> 1004 bytes
-rw-r--r--libjava/classpath/lib/java/lang/ref/WeakReference.classbin0 -> 870 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/AccessibleObject.classbin0 -> 2646 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/AnnotatedElement.classbin0 -> 515 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/Array.classbin0 -> 2431 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/Constructor.classbin0 -> 6252 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/Field.classbin0 -> 8309 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/GenericArrayType.classbin0 -> 224 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/GenericDeclaration.classbin0 -> 262 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/GenericSignatureFormatError.classbin0 -> 420 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/InvocationHandler.classbin0 -> 284 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/InvocationTargetException.classbin0 -> 985 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/MalformedParameterizedTypeException.classbin0 -> 444 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/Member.classbin0 -> 341 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/Method.classbin0 -> 6176 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/Modifier.classbin0 -> 3197 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/ParameterizedType.classbin0 -> 299 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/Proxy$ClassFactory.classbin0 -> 11555 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/Proxy$ProxyData.classbin0 -> 4102 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/Proxy$ProxySignature.classbin0 -> 3655 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/Proxy$ProxyType.classbin0 -> 997 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/Proxy.classbin0 -> 4465 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/ReflectPermission.classbin0 -> 599 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/Type.classbin0 -> 107 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/TypeVariable.classbin0 -> 443 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/UndeclaredThrowableException.classbin0 -> 939 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/VMProxy.classbin0 -> 1005 bytes
-rw-r--r--libjava/classpath/lib/java/lang/reflect/WildcardType.classbin0 -> 233 bytes
-rw-r--r--libjava/classpath/lib/java/math/BigDecimal.classbin0 -> 18062 bytes
-rw-r--r--libjava/classpath/lib/java/math/BigInteger.classbin0 -> 30692 bytes
-rw-r--r--libjava/classpath/lib/java/math/MathContext.classbin0 -> 2676 bytes
-rw-r--r--libjava/classpath/lib/java/math/RoundingMode.classbin0 -> 1970 bytes
-rw-r--r--libjava/classpath/lib/java/net/Authenticator.classbin0 -> 2399 bytes
-rw-r--r--libjava/classpath/lib/java/net/BindException.classbin0 -> 499 bytes
-rw-r--r--libjava/classpath/lib/java/net/ConnectException.classbin0 -> 508 bytes
-rw-r--r--libjava/classpath/lib/java/net/ContentHandler.classbin0 -> 811 bytes
-rw-r--r--libjava/classpath/lib/java/net/ContentHandlerFactory.classbin0 -> 211 bytes
-rw-r--r--libjava/classpath/lib/java/net/DatagramPacket.classbin0 -> 3557 bytes
-rw-r--r--libjava/classpath/lib/java/net/DatagramSocket.classbin0 -> 9962 bytes
-rw-r--r--libjava/classpath/lib/java/net/DatagramSocketImpl.classbin0 -> 1571 bytes
-rw-r--r--libjava/classpath/lib/java/net/DatagramSocketImplFactory.classbin0 -> 209 bytes
-rw-r--r--libjava/classpath/lib/java/net/FileNameMap.classbin0 -> 181 bytes
-rw-r--r--libjava/classpath/lib/java/net/HttpURLConnection.classbin0 -> 5717 bytes
-rw-r--r--libjava/classpath/lib/java/net/Inet4Address.classbin0 -> 2735 bytes
-rw-r--r--libjava/classpath/lib/java/net/Inet6Address.classbin0 -> 5032 bytes
-rw-r--r--libjava/classpath/lib/java/net/InetAddress.classbin0 -> 6300 bytes
-rw-r--r--libjava/classpath/lib/java/net/InetSocketAddress.classbin0 -> 2684 bytes
-rw-r--r--libjava/classpath/lib/java/net/JarURLConnection.classbin0 -> 2636 bytes
-rw-r--r--libjava/classpath/lib/java/net/MalformedURLException.classbin0 -> 518 bytes
-rw-r--r--libjava/classpath/lib/java/net/MimeTypeMapper.classbin0 -> 11230 bytes
-rw-r--r--libjava/classpath/lib/java/net/MulticastSocket.classbin0 -> 6058 bytes
-rw-r--r--libjava/classpath/lib/java/net/NetPermission.classbin0 -> 556 bytes
-rw-r--r--libjava/classpath/lib/java/net/NetworkInterface.classbin0 -> 5118 bytes
-rw-r--r--libjava/classpath/lib/java/net/NoRouteToHostException.classbin0 -> 526 bytes
-rw-r--r--libjava/classpath/lib/java/net/PasswordAuthentication.classbin0 -> 641 bytes
-rw-r--r--libjava/classpath/lib/java/net/PortUnreachableException.classbin0 -> 532 bytes
-rw-r--r--libjava/classpath/lib/java/net/ProtocolException.classbin0 -> 506 bytes
-rw-r--r--libjava/classpath/lib/java/net/Proxy$Type.classbin0 -> 1121 bytes
-rw-r--r--libjava/classpath/lib/java/net/Proxy.classbin0 -> 1522 bytes
-rw-r--r--libjava/classpath/lib/java/net/ProxySelector.classbin0 -> 1266 bytes
-rw-r--r--libjava/classpath/lib/java/net/ResolverCache$Entry.classbin0 -> 732 bytes
-rw-r--r--libjava/classpath/lib/java/net/ResolverCache.classbin0 -> 3355 bytes
-rw-r--r--libjava/classpath/lib/java/net/ServerSocket.classbin0 -> 6796 bytes
-rw-r--r--libjava/classpath/lib/java/net/Socket.classbin0 -> 11073 bytes
-rw-r--r--libjava/classpath/lib/java/net/SocketAddress.classbin0 -> 378 bytes
-rw-r--r--libjava/classpath/lib/java/net/SocketException.classbin0 -> 500 bytes
-rw-r--r--libjava/classpath/lib/java/net/SocketImpl.classbin0 -> 2159 bytes
-rw-r--r--libjava/classpath/lib/java/net/SocketImplFactory.classbin0 -> 177 bytes
-rw-r--r--libjava/classpath/lib/java/net/SocketOptions.classbin0 -> 785 bytes
-rw-r--r--libjava/classpath/lib/java/net/SocketPermission.classbin0 -> 6565 bytes
-rw-r--r--libjava/classpath/lib/java/net/SocketTimeoutException.classbin0 -> 532 bytes
-rw-r--r--libjava/classpath/lib/java/net/URI.classbin0 -> 16370 bytes
-rw-r--r--libjava/classpath/lib/java/net/URISyntaxException.classbin0 -> 1462 bytes
-rw-r--r--libjava/classpath/lib/java/net/URL$1.classbin0 -> 629 bytes
-rw-r--r--libjava/classpath/lib/java/net/URL.classbin0 -> 10393 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader$1.classbin0 -> 1022 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader$2.classbin0 -> 908 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader$CoreResource.classbin0 -> 1826 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader$CoreURLLoader.classbin0 -> 1344 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader$FileResource.classbin0 -> 1739 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader$FileURLLoader.classbin0 -> 1278 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader$JarURLLoader.classbin0 -> 3418 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader$JarURLResource.classbin0 -> 2202 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader$RemoteResource.classbin0 -> 1152 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader$RemoteURLLoader.classbin0 -> 1724 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader$Resource.classbin0 -> 1217 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader$SoResource.classbin0 -> 1097 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader$SoURLLoader.classbin0 -> 1625 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader$URLLoader.classbin0 -> 1354 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLClassLoader.classbin0 -> 14234 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLConnection.classbin0 -> 11321 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLDecoder.classbin0 -> 1781 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLEncoder.classbin0 -> 1842 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLStreamHandler.classbin0 -> 6389 bytes
-rw-r--r--libjava/classpath/lib/java/net/URLStreamHandlerFactory.classbin0 -> 219 bytes
-rw-r--r--libjava/classpath/lib/java/net/UnknownHostException.classbin0 -> 515 bytes
-rw-r--r--libjava/classpath/lib/java/net/UnknownServiceException.classbin0 -> 524 bytes
-rw-r--r--libjava/classpath/lib/java/net/VMInetAddress.classbin0 -> 610 bytes
-rw-r--r--libjava/classpath/lib/java/net/VMNetworkInterface.classbin0 -> 397 bytes
-rw-r--r--libjava/classpath/lib/java/net/VMURLConnection.classbin0 -> 944 bytes
-rw-r--r--libjava/classpath/lib/java/nio/Buffer.classbin0 -> 2875 bytes
-rw-r--r--libjava/classpath/lib/java/nio/BufferOverflowException.classbin0 -> 390 bytes
-rw-r--r--libjava/classpath/lib/java/nio/BufferUnderflowException.classbin0 -> 393 bytes
-rw-r--r--libjava/classpath/lib/java/nio/ByteBuffer.classbin0 -> 5629 bytes
-rw-r--r--libjava/classpath/lib/java/nio/ByteBufferHelper.classbin0 -> 6390 bytes
-rw-r--r--libjava/classpath/lib/java/nio/ByteBufferImpl.classbin0 -> 7873 bytes
-rw-r--r--libjava/classpath/lib/java/nio/ByteOrder.classbin0 -> 838 bytes
-rw-r--r--libjava/classpath/lib/java/nio/CharBuffer.classbin0 -> 5915 bytes
-rw-r--r--libjava/classpath/lib/java/nio/CharBufferImpl.classbin0 -> 3360 bytes
-rw-r--r--libjava/classpath/lib/java/nio/CharViewBufferImpl.classbin0 -> 3286 bytes
-rw-r--r--libjava/classpath/lib/java/nio/DirectByteBufferImpl$ReadOnly.classbin0 -> 938 bytes
-rw-r--r--libjava/classpath/lib/java/nio/DirectByteBufferImpl$ReadWrite.classbin0 -> 862 bytes
-rw-r--r--libjava/classpath/lib/java/nio/DirectByteBufferImpl.classbin0 -> 8554 bytes
-rw-r--r--libjava/classpath/lib/java/nio/DoubleBuffer.classbin0 -> 3594 bytes
-rw-r--r--libjava/classpath/lib/java/nio/DoubleBufferImpl.classbin0 -> 2345 bytes
-rw-r--r--libjava/classpath/lib/java/nio/DoubleViewBufferImpl.classbin0 -> 2973 bytes
-rw-r--r--libjava/classpath/lib/java/nio/FloatBuffer.classbin0 -> 3548 bytes
-rw-r--r--libjava/classpath/lib/java/nio/FloatBufferImpl.classbin0 -> 2338 bytes
-rw-r--r--libjava/classpath/lib/java/nio/FloatViewBufferImpl.classbin0 -> 2961 bytes
-rw-r--r--libjava/classpath/lib/java/nio/IntBuffer.classbin0 -> 3421 bytes
-rw-r--r--libjava/classpath/lib/java/nio/IntBufferImpl.classbin0 -> 2314 bytes
-rw-r--r--libjava/classpath/lib/java/nio/IntViewBufferImpl.classbin0 -> 2931 bytes
-rw-r--r--libjava/classpath/lib/java/nio/InvalidMarkException.classbin0 -> 386 bytes
-rw-r--r--libjava/classpath/lib/java/nio/LongBuffer.classbin0 -> 3498 bytes
-rw-r--r--libjava/classpath/lib/java/nio/LongBufferImpl.classbin0 -> 2331 bytes
-rw-r--r--libjava/classpath/lib/java/nio/LongViewBufferImpl.classbin0 -> 2953 bytes
-rw-r--r--libjava/classpath/lib/java/nio/MappedByteBuffer.classbin0 -> 1069 bytes
-rw-r--r--libjava/classpath/lib/java/nio/MappedByteBufferImpl.classbin0 -> 8128 bytes
-rw-r--r--libjava/classpath/lib/java/nio/ReadOnlyBufferException.classbin0 -> 403 bytes
-rw-r--r--libjava/classpath/lib/java/nio/ShortBuffer.classbin0 -> 3485 bytes
-rw-r--r--libjava/classpath/lib/java/nio/ShortBufferImpl.classbin0 -> 2338 bytes
-rw-r--r--libjava/classpath/lib/java/nio/ShortViewBufferImpl.classbin0 -> 2961 bytes
-rw-r--r--libjava/classpath/lib/java/nio/VMDirectByteBuffer.classbin0 -> 600 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/AlreadyConnectedException.classbin0 -> 419 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/AsynchronousCloseException.classbin0 -> 431 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/ByteChannel.classbin0 -> 211 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/CancelledKeyException.classbin0 -> 407 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/Channel.classbin0 -> 231 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/Channels.classbin0 -> 2520 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/ClosedByInterruptException.classbin0 -> 435 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/ClosedChannelException.classbin0 -> 398 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/ClosedSelectorException.classbin0 -> 413 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/ConnectionPendingException.classbin0 -> 422 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/DatagramChannel.classbin0 -> 1817 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/FileChannel$MapMode.classbin0 -> 786 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/FileChannel.classbin0 -> 1821 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/FileLock.classbin0 -> 1781 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/FileLockInterruptionException.classbin0 -> 419 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/GatheringByteChannel.classbin0 -> 324 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/IllegalBlockingModeException.classbin0 -> 428 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/IllegalSelectorException.classbin0 -> 419 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/InterruptibleChannel.classbin0 -> 242 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/NoConnectionPendingException.classbin0 -> 428 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/NonReadableChannelException.classbin0 -> 425 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/NonWritableChannelException.classbin0 -> 425 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/NotYetBoundException.classbin0 -> 404 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/NotYetConnectedException.classbin0 -> 416 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/OverlappingFileLockException.classbin0 -> 428 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/Pipe$SinkChannel.classbin0 -> 676 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/Pipe$SourceChannel.classbin0 -> 683 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/Pipe.classbin0 -> 812 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/ReadableByteChannel.classbin0 -> 260 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/ScatteringByteChannel.classbin0 -> 325 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/SelectableChannel.classbin0 -> 1112 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/SelectionKey.classbin0 -> 1347 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/Selector.classbin0 -> 912 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/ServerSocketChannel.classbin0 -> 931 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/SocketChannel.classbin0 -> 1857 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/UnresolvedAddressException.classbin0 -> 425 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/UnsupportedAddressTypeException.classbin0 -> 440 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/VMChannels.classbin0 -> 1129 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/WritableByteChannel.classbin0 -> 261 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/spi/AbstractInterruptibleChannel.classbin0 -> 980 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/spi/AbstractSelectableChannel.classbin0 -> 3883 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/spi/AbstractSelectionKey.classbin0 -> 747 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/spi/AbstractSelector.classbin0 -> 2139 bytes
-rw-r--r--libjava/classpath/lib/java/nio/channels/spi/SelectorProvider.classbin0 -> 2066 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/CharacterCodingException.classbin0 -> 402 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/Charset.classbin0 -> 7400 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/CharsetDecoder.classbin0 -> 5808 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/CharsetEncoder.classbin0 -> 7022 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/CoderMalfunctionError.classbin0 -> 480 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/CoderResult$1.classbin0 -> 561 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/CoderResult$2.classbin0 -> 561 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/CoderResult$Cache.classbin0 -> 1220 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/CoderResult.classbin0 -> 2826 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/CodingErrorAction.classbin0 -> 745 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/IllegalCharsetNameException.classbin0 -> 623 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/MalformedInputException.classbin0 -> 834 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/UnmappableCharacterException.classbin0 -> 849 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/UnsupportedCharsetException.classbin0 -> 623 bytes
-rw-r--r--libjava/classpath/lib/java/nio/charset/spi/CharsetProvider.classbin0 -> 821 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/AccessException.classbin0 -> 633 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/AlreadyBoundException.classbin0 -> 512 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/ConnectException.classbin0 -> 636 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/ConnectIOException.classbin0 -> 642 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/MarshalException.classbin0 -> 636 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/MarshalledObject.classbin0 -> 1855 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/Naming.classbin0 -> 3141 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/NoSuchObjectException.classbin0 -> 436 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/NotBoundException.classbin0 -> 500 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/RMISecurityException.classbin0 -> 599 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/RMISecurityManager.classbin0 -> 310 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/Remote.classbin0 -> 102 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/RemoteException.classbin0 -> 1334 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/ServerError.classbin0 -> 503 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/ServerException.classbin0 -> 633 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/ServerRuntimeException.classbin0 -> 569 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/StubNotFoundException.classbin0 -> 651 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/UnexpectedException.classbin0 -> 645 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/UnknownHostException.classbin0 -> 648 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/UnmarshalException.classbin0 -> 642 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/Activatable.classbin0 -> 8556 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/ActivateFailedException.classbin0 -> 680 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/ActivationDesc.classbin0 -> 2753 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/ActivationException.classbin0 -> 1291 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/ActivationGroup.classbin0 -> 5542 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/ActivationGroupDesc$CommandEnvironment.classbin0 -> 1613 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/ActivationGroupDesc.classbin0 -> 3895 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/ActivationGroupID.classbin0 -> 1152 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/ActivationGroup_Stub.classbin0 -> 1895 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/ActivationID.classbin0 -> 2732 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/ActivationInstantiator.classbin0 -> 392 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/ActivationMonitor.classbin0 -> 557 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/ActivationSystem.classbin0 -> 1571 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/Activator.classbin0 -> 378 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/UnknownGroupException.classbin0 -> 473 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/activation/UnknownObjectException.classbin0 -> 476 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/dgc/DGC.classbin0 -> 339 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/dgc/Lease.classbin0 -> 1065 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/dgc/VMID.classbin0 -> 1907 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/registry/LocateRegistry.classbin0 -> 2079 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/registry/Registry.classbin0 -> 612 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/registry/RegistryHandler.classbin0 -> 392 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/ExportException.classbin0 -> 647 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/LoaderHandler.classbin0 -> 685 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/LogStream.classbin0 -> 1851 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/ObjID.classbin0 -> 2488 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/Operation.classbin0 -> 595 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/RMIClassLoader.classbin0 -> 3592 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/RMIClassLoaderSpi.classbin0 -> 1029 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/RMIClientSocketFactory.classbin0 -> 253 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/RMIFailureHandler.classbin0 -> 176 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/RMIServerSocketFactory.classbin0 -> 247 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/RMISocketFactory.classbin0 -> 1425 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/RemoteCall.classbin0 -> 611 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/RemoteObject.classbin0 -> 3766 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/RemoteObjectInvocationHandler.classbin0 -> 3872 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/RemoteRef.classbin0 -> 894 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/RemoteServer.classbin0 -> 1358 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/RemoteStub.classbin0 -> 704 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/ServerCloneException.classbin0 -> 1307 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/ServerNotActiveException.classbin0 -> 535 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/ServerRef.classbin0 -> 459 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/Skeleton.classbin0 -> 321 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/SkeletonMismatchException.classbin0 -> 487 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/SkeletonNotFoundException.classbin0 -> 696 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/SocketSecurityException.classbin0 -> 633 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/UID.classbin0 -> 2816 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/UnicastRemoteObject.classbin0 -> 3032 bytes
-rw-r--r--libjava/classpath/lib/java/rmi/server/Unreferenced.classbin0 -> 150 bytes
-rw-r--r--libjava/classpath/lib/java/security/AccessControlContext.classbin0 -> 3506 bytes
-rw-r--r--libjava/classpath/lib/java/security/AccessControlException.classbin0 -> 772 bytes
-rw-r--r--libjava/classpath/lib/java/security/AccessController.classbin0 -> 2821 bytes
-rw-r--r--libjava/classpath/lib/java/security/AlgorithmParameterGenerator.classbin0 -> 4329 bytes
-rw-r--r--libjava/classpath/lib/java/security/AlgorithmParameterGeneratorSpi.classbin0 -> 640 bytes
-rw-r--r--libjava/classpath/lib/java/security/AlgorithmParameters.classbin0 -> 4550 bytes
-rw-r--r--libjava/classpath/lib/java/security/AlgorithmParametersSpi.classbin0 -> 906 bytes
-rw-r--r--libjava/classpath/lib/java/security/AllPermission$AllPermissionCollection.classbin0 -> 1510 bytes
-rw-r--r--libjava/classpath/lib/java/security/AllPermission.classbin0 -> 1336 bytes
-rw-r--r--libjava/classpath/lib/java/security/BasicPermission$BasicPermissionCollection.classbin0 -> 2446 bytes
-rw-r--r--libjava/classpath/lib/java/security/BasicPermission.classbin0 -> 1944 bytes
-rw-r--r--libjava/classpath/lib/java/security/Certificate.classbin0 -> 534 bytes
-rw-r--r--libjava/classpath/lib/java/security/CodeSource.classbin0 -> 5314 bytes
-rw-r--r--libjava/classpath/lib/java/security/DigestException.classbin0 -> 816 bytes
-rw-r--r--libjava/classpath/lib/java/security/DigestInputStream.classbin0 -> 1681 bytes
-rw-r--r--libjava/classpath/lib/java/security/DigestOutputStream.classbin0 -> 1649 bytes
-rw-r--r--libjava/classpath/lib/java/security/DomainCombiner.classbin0 -> 245 bytes
-rw-r--r--libjava/classpath/lib/java/security/DummyKeyPairGenerator.classbin0 -> 1628 bytes
-rw-r--r--libjava/classpath/lib/java/security/DummyMessageDigest.classbin0 -> 1719 bytes
-rw-r--r--libjava/classpath/lib/java/security/DummySignature.classbin0 -> 2336 bytes
-rw-r--r--libjava/classpath/lib/java/security/GeneralSecurityException.classbin0 -> 824 bytes
-rw-r--r--libjava/classpath/lib/java/security/Guard.classbin0 -> 150 bytes
-rw-r--r--libjava/classpath/lib/java/security/GuardedObject.classbin0 -> 1062 bytes
-rw-r--r--libjava/classpath/lib/java/security/Identity.classbin0 -> 4357 bytes
-rw-r--r--libjava/classpath/lib/java/security/IdentityScope.classbin0 -> 2238 bytes
-rw-r--r--libjava/classpath/lib/java/security/IntersectingDomainCombiner.classbin0 -> 1156 bytes
-rw-r--r--libjava/classpath/lib/java/security/InvalidAlgorithmParameterException.classbin0 -> 873 bytes
-rw-r--r--libjava/classpath/lib/java/security/InvalidKeyException.classbin0 -> 816 bytes
-rw-r--r--libjava/classpath/lib/java/security/InvalidParameterException.classbin0 -> 551 bytes
-rw-r--r--libjava/classpath/lib/java/security/Key.classbin0 -> 287 bytes
-rw-r--r--libjava/classpath/lib/java/security/KeyException.classbin0 -> 807 bytes
-rw-r--r--libjava/classpath/lib/java/security/KeyFactory.classbin0 -> 4252 bytes
-rw-r--r--libjava/classpath/lib/java/security/KeyFactorySpi.classbin0 -> 886 bytes
-rw-r--r--libjava/classpath/lib/java/security/KeyManagementException.classbin0 -> 825 bytes
-rw-r--r--libjava/classpath/lib/java/security/KeyPair.classbin0 -> 791 bytes
-rw-r--r--libjava/classpath/lib/java/security/KeyPairGenerator.classbin0 -> 4574 bytes
-rw-r--r--libjava/classpath/lib/java/security/KeyPairGeneratorSpi.classbin0 -> 961 bytes
-rw-r--r--libjava/classpath/lib/java/security/KeyStore.classbin0 -> 6138 bytes
-rw-r--r--libjava/classpath/lib/java/security/KeyStoreException.classbin0 -> 822 bytes
-rw-r--r--libjava/classpath/lib/java/security/KeyStoreSpi.classbin0 -> 1668 bytes
-rw-r--r--libjava/classpath/lib/java/security/MessageDigest.classbin0 -> 5360 bytes
-rw-r--r--libjava/classpath/lib/java/security/MessageDigestSpi.classbin0 -> 1514 bytes
-rw-r--r--libjava/classpath/lib/java/security/NoSuchAlgorithmException.classbin0 -> 843 bytes
-rw-r--r--libjava/classpath/lib/java/security/NoSuchProviderException.classbin0 -> 549 bytes
-rw-r--r--libjava/classpath/lib/java/security/Permission.classbin0 -> 1670 bytes
-rw-r--r--libjava/classpath/lib/java/security/PermissionCollection.classbin0 -> 1550 bytes
-rw-r--r--libjava/classpath/lib/java/security/Permissions$1.classbin0 -> 1225 bytes
-rw-r--r--libjava/classpath/lib/java/security/Permissions$PermissionsHash.classbin0 -> 1401 bytes
-rw-r--r--libjava/classpath/lib/java/security/Permissions.classbin0 -> 1988 bytes
-rw-r--r--libjava/classpath/lib/java/security/Policy.classbin0 -> 3648 bytes
-rw-r--r--libjava/classpath/lib/java/security/Principal.classbin0 -> 239 bytes
-rw-r--r--libjava/classpath/lib/java/security/PrivateKey.classbin0 -> 204 bytes
-rw-r--r--libjava/classpath/lib/java/security/PrivilegedAction.classbin0 -> 243 bytes
-rw-r--r--libjava/classpath/lib/java/security/PrivilegedActionException.classbin0 -> 830 bytes
-rw-r--r--libjava/classpath/lib/java/security/PrivilegedExceptionAction.classbin0 -> 309 bytes
-rw-r--r--libjava/classpath/lib/java/security/ProtectionDomain.classbin0 -> 3502 bytes
-rw-r--r--libjava/classpath/lib/java/security/Provider.classbin0 -> 2473 bytes
-rw-r--r--libjava/classpath/lib/java/security/ProviderException.classbin0 -> 810 bytes
-rw-r--r--libjava/classpath/lib/java/security/PublicKey.classbin0 -> 202 bytes
-rw-r--r--libjava/classpath/lib/java/security/SecureClassLoader.classbin0 -> 2507 bytes
-rw-r--r--libjava/classpath/lib/java/security/SecureRandom.classbin0 -> 7756 bytes
-rw-r--r--libjava/classpath/lib/java/security/SecureRandomSpi.classbin0 -> 489 bytes
-rw-r--r--libjava/classpath/lib/java/security/Security.classbin0 -> 11241 bytes
-rw-r--r--libjava/classpath/lib/java/security/SecurityPermission.classbin0 -> 583 bytes
-rw-r--r--libjava/classpath/lib/java/security/Signature.classbin0 -> 7379 bytes
-rw-r--r--libjava/classpath/lib/java/security/SignatureException.classbin0 -> 825 bytes
-rw-r--r--libjava/classpath/lib/java/security/SignatureSpi.classbin0 -> 2716 bytes
-rw-r--r--libjava/classpath/lib/java/security/SignedObject.classbin0 -> 2675 bytes
-rw-r--r--libjava/classpath/lib/java/security/Signer.classbin0 -> 2154 bytes
-rw-r--r--libjava/classpath/lib/java/security/UnrecoverableKeyException.classbin0 -> 555 bytes
-rw-r--r--libjava/classpath/lib/java/security/UnresolvedPermission.classbin0 -> 2332 bytes
-rw-r--r--libjava/classpath/lib/java/security/UnresolvedPermissionCollection$1.classbin0 -> 1297 bytes
-rw-r--r--libjava/classpath/lib/java/security/UnresolvedPermissionCollection.classbin0 -> 1616 bytes
-rw-r--r--libjava/classpath/lib/java/security/VMAccessControlState.classbin0 -> 816 bytes
-rw-r--r--libjava/classpath/lib/java/security/VMAccessController.classbin0 -> 4797 bytes
-rw-r--r--libjava/classpath/lib/java/security/VMSecureRandom$Spinner.classbin0 -> 808 bytes
-rw-r--r--libjava/classpath/lib/java/security/VMSecureRandom.classbin0 -> 1429 bytes
-rw-r--r--libjava/classpath/lib/java/security/acl/Acl.classbin0 -> 829 bytes
-rw-r--r--libjava/classpath/lib/java/security/acl/AclEntry.classbin0 -> 639 bytes
-rw-r--r--libjava/classpath/lib/java/security/acl/AclNotFoundException.classbin0 -> 392 bytes
-rw-r--r--libjava/classpath/lib/java/security/acl/Group.classbin0 -> 355 bytes
-rw-r--r--libjava/classpath/lib/java/security/acl/LastOwnerException.classbin0 -> 386 bytes
-rw-r--r--libjava/classpath/lib/java/security/acl/NotOwnerException.classbin0 -> 383 bytes
-rw-r--r--libjava/classpath/lib/java/security/acl/Owner.classbin0 -> 373 bytes
-rw-r--r--libjava/classpath/lib/java/security/acl/Permission.classbin0 -> 202 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CRL.classbin0 -> 536 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CRLException.classbin0 -> 817 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CRLSelector.classbin0 -> 234 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertPath$CertPathRep.classbin0 -> 1562 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertPath.classbin0 -> 2633 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertPathBuilder.classbin0 -> 3671 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertPathBuilderException.classbin0 -> 1632 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertPathBuilderResult.classbin0 -> 264 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertPathBuilderSpi.classbin0 -> 557 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertPathParameters.classbin0 -> 202 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertPathValidator$1.classbin0 -> 718 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertPathValidator.classbin0 -> 3933 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertPathValidatorException.classbin0 -> 2433 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertPathValidatorResult.classbin0 -> 212 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertPathValidatorSpi.classbin0 -> 599 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertSelector.classbin0 -> 244 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertStore$1.classbin0 -> 678 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertStore.classbin0 -> 4728 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertStoreException.classbin0 -> 1614 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertStoreParameters.classbin0 -> 204 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertStoreSpi.classbin0 -> 935 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/Certificate$CertificateRep.classbin0 -> 1361 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/Certificate.classbin0 -> 2001 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertificateEncodingException.classbin0 -> 866 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertificateException.classbin0 -> 841 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertificateExpiredException.classbin0 -> 572 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertificateFactory.classbin0 -> 4794 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertificateFactorySpi.classbin0 -> 1972 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertificateNotYetValidException.classbin0 -> 584 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CertificateParsingException.classbin0 -> 863 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/CollectionCertStoreParameters.classbin0 -> 1491 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/LDAPCertStoreParameters.classbin0 -> 1450 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/PKIXBuilderParameters.classbin0 -> 1961 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/PKIXCertPathBuilderResult.classbin0 -> 1549 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/PKIXCertPathChecker.classbin0 -> 1117 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/PKIXCertPathValidatorResult.classbin0 -> 1691 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/PKIXParameters.classbin0 -> 8202 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/PolicyNode.classbin0 -> 601 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/PolicyQualifierInfo.classbin0 -> 2039 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/TrustAnchor.classbin0 -> 2116 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/X509CRL.classbin0 -> 1939 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/X509CRLEntry.classbin0 -> 1053 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/X509CRLSelector.classbin0 -> 6627 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/X509CertSelector.classbin0 -> 13958 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/X509Certificate.classbin0 -> 2025 bytes
-rw-r--r--libjava/classpath/lib/java/security/cert/X509Extension.classbin0 -> 388 bytes
-rw-r--r--libjava/classpath/lib/java/security/interfaces/DSAKey.classbin0 -> 179 bytes
-rw-r--r--libjava/classpath/lib/java/security/interfaces/DSAKeyPairGenerator.classbin0 -> 357 bytes
-rw-r--r--libjava/classpath/lib/java/security/interfaces/DSAParams.classbin0 -> 196 bytes
-rw-r--r--libjava/classpath/lib/java/security/interfaces/DSAPrivateKey.classbin0 -> 309 bytes
-rw-r--r--libjava/classpath/lib/java/security/interfaces/DSAPublicKey.classbin0 -> 306 bytes
-rw-r--r--libjava/classpath/lib/java/security/interfaces/RSAKey.classbin0 -> 166 bytes
-rw-r--r--libjava/classpath/lib/java/security/interfaces/RSAMultiPrimePrivateCrtKey.classbin0 -> 519 bytes
-rw-r--r--libjava/classpath/lib/java/security/interfaces/RSAPrivateCrtKey.classbin0 -> 427 bytes
-rw-r--r--libjava/classpath/lib/java/security/interfaces/RSAPrivateKey.classbin0 -> 323 bytes
-rw-r--r--libjava/classpath/lib/java/security/interfaces/RSAPublicKey.classbin0 -> 319 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/AlgorithmParameterSpec.classbin0 -> 144 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/DSAParameterSpec.classbin0 -> 884 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/DSAPrivateKeySpec.classbin0 -> 971 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/DSAPublicKeySpec.classbin0 -> 968 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/EncodedKeySpec.classbin0 -> 530 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/InvalidKeySpecException.classbin0 -> 850 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/InvalidParameterSpecException.classbin0 -> 577 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/KeySpec.classbin0 -> 114 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/PKCS8EncodedKeySpec.classbin0 -> 569 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/PSSParameterSpec.classbin0 -> 570 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/RSAKeyGenParameterSpec.classbin0 -> 943 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.classbin0 -> 2190 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/RSAOtherPrimeInfo.classbin0 -> 967 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/RSAPrivateCrtKeySpec.classbin0 -> 1458 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/RSAPrivateKeySpec.classbin0 -> 712 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/RSAPublicKeySpec.classbin0 -> 707 bytes
-rw-r--r--libjava/classpath/lib/java/security/spec/X509EncodedKeySpec.classbin0 -> 565 bytes
-rw-r--r--libjava/classpath/lib/java/sql/Array.classbin0 -> 1031 bytes
-rw-r--r--libjava/classpath/lib/java/sql/BatchUpdateException.classbin0 -> 1224 bytes
-rw-r--r--libjava/classpath/lib/java/sql/Blob.classbin0 -> 516 bytes
-rw-r--r--libjava/classpath/lib/java/sql/CallableStatement.classbin0 -> 4652 bytes
-rw-r--r--libjava/classpath/lib/java/sql/Clob.classbin0 -> 704 bytes
-rw-r--r--libjava/classpath/lib/java/sql/Connection.classbin0 -> 2469 bytes
-rw-r--r--libjava/classpath/lib/java/sql/DataTruncation.classbin0 -> 1072 bytes
-rw-r--r--libjava/classpath/lib/java/sql/DatabaseMetaData.classbin0 -> 9882 bytes
-rw-r--r--libjava/classpath/lib/java/sql/Date.classbin0 -> 1914 bytes
-rw-r--r--libjava/classpath/lib/java/sql/Driver.classbin0 -> 490 bytes
-rw-r--r--libjava/classpath/lib/java/sql/DriverManager.classbin0 -> 4441 bytes
-rw-r--r--libjava/classpath/lib/java/sql/DriverPropertyInfo.classbin0 -> 538 bytes
-rw-r--r--libjava/classpath/lib/java/sql/ParameterMetaData.classbin0 -> 824 bytes
-rw-r--r--libjava/classpath/lib/java/sql/PreparedStatement.classbin0 -> 1974 bytes
-rw-r--r--libjava/classpath/lib/java/sql/Ref.classbin0 -> 456 bytes
-rw-r--r--libjava/classpath/lib/java/sql/ResultSet.classbin0 -> 7255 bytes
-rw-r--r--libjava/classpath/lib/java/sql/ResultSetMetaData.classbin0 -> 1067 bytes
-rw-r--r--libjava/classpath/lib/java/sql/SQLData.classbin0 -> 328 bytes
-rw-r--r--libjava/classpath/lib/java/sql/SQLException.classbin0 -> 1367 bytes
-rw-r--r--libjava/classpath/lib/java/sql/SQLInput.classbin0 -> 1192 bytes
-rw-r--r--libjava/classpath/lib/java/sql/SQLOutput.classbin0 -> 1264 bytes
-rw-r--r--libjava/classpath/lib/java/sql/SQLPermission.classbin0 -> 505 bytes
-rw-r--r--libjava/classpath/lib/java/sql/SQLWarning.classbin0 -> 1151 bytes
-rw-r--r--libjava/classpath/lib/java/sql/Savepoint.classbin0 -> 249 bytes
-rw-r--r--libjava/classpath/lib/java/sql/Statement.classbin0 -> 2029 bytes
-rw-r--r--libjava/classpath/lib/java/sql/Struct.classbin0 -> 414 bytes
-rw-r--r--libjava/classpath/lib/java/sql/Time.classbin0 -> 2129 bytes
-rw-r--r--libjava/classpath/lib/java/sql/Timestamp.classbin0 -> 3826 bytes
-rw-r--r--libjava/classpath/lib/java/sql/Types.classbin0 -> 1194 bytes
-rw-r--r--libjava/classpath/lib/java/text/Annotation.classbin0 -> 924 bytes
-rw-r--r--libjava/classpath/lib/java/text/AttributedCharacterIterator$Attribute.classbin0 -> 1922 bytes
-rw-r--r--libjava/classpath/lib/java/text/AttributedCharacterIterator.classbin0 -> 900 bytes
-rw-r--r--libjava/classpath/lib/java/text/AttributedString$AttributeRange.classbin0 -> 689 bytes
-rw-r--r--libjava/classpath/lib/java/text/AttributedString.classbin0 -> 5877 bytes
-rw-r--r--libjava/classpath/lib/java/text/AttributedStringIterator.classbin0 -> 5196 bytes
-rw-r--r--libjava/classpath/lib/java/text/Bidi.classbin0 -> 10729 bytes
-rw-r--r--libjava/classpath/lib/java/text/BreakIterator.classbin0 -> 3564 bytes
-rw-r--r--libjava/classpath/lib/java/text/CharacterIterator.classbin0 -> 488 bytes
-rw-r--r--libjava/classpath/lib/java/text/ChoiceFormat.classbin0 -> 5710 bytes
-rw-r--r--libjava/classpath/lib/java/text/CollationElementIterator.classbin0 -> 5230 bytes
-rw-r--r--libjava/classpath/lib/java/text/CollationKey.classbin0 -> 1695 bytes
-rw-r--r--libjava/classpath/lib/java/text/Collator.classbin0 -> 3454 bytes
-rw-r--r--libjava/classpath/lib/java/text/DateFormat$Field.classbin0 -> 3570 bytes
-rw-r--r--libjava/classpath/lib/java/text/DateFormat.classbin0 -> 8501 bytes
-rw-r--r--libjava/classpath/lib/java/text/DateFormatSymbols.classbin0 -> 5265 bytes
-rw-r--r--libjava/classpath/lib/java/text/DecimalFormat.classbin0 -> 23996 bytes
-rw-r--r--libjava/classpath/lib/java/text/DecimalFormatSymbols.classbin0 -> 6530 bytes
-rw-r--r--libjava/classpath/lib/java/text/FieldPosition.classbin0 -> 2447 bytes
-rw-r--r--libjava/classpath/lib/java/text/Format$Field.classbin0 -> 492 bytes
-rw-r--r--libjava/classpath/lib/java/text/Format.classbin0 -> 2009 bytes
-rw-r--r--libjava/classpath/lib/java/text/MessageFormat$Field.classbin0 -> 1176 bytes
-rw-r--r--libjava/classpath/lib/java/text/MessageFormat$MessageFormatElement.classbin0 -> 2477 bytes
-rw-r--r--libjava/classpath/lib/java/text/MessageFormat.classbin0 -> 11574 bytes
-rw-r--r--libjava/classpath/lib/java/text/NumberFormat$Field.classbin0 -> 2098 bytes
-rw-r--r--libjava/classpath/lib/java/text/NumberFormat.classbin0 -> 8151 bytes
-rw-r--r--libjava/classpath/lib/java/text/ParseException.classbin0 -> 585 bytes
-rw-r--r--libjava/classpath/lib/java/text/ParsePosition.classbin0 -> 1546 bytes
-rw-r--r--libjava/classpath/lib/java/text/RuleBasedCollator$CollationElement.classbin0 -> 925 bytes
-rw-r--r--libjava/classpath/lib/java/text/RuleBasedCollator$CollationSorter.classbin0 -> 778 bytes
-rw-r--r--libjava/classpath/lib/java/text/RuleBasedCollator.classbin0 -> 10427 bytes
-rw-r--r--libjava/classpath/lib/java/text/SimpleDateFormat$CompiledField.classbin0 -> 1491 bytes
-rw-r--r--libjava/classpath/lib/java/text/SimpleDateFormat.classbin0 -> 17953 bytes
-rw-r--r--libjava/classpath/lib/java/text/StringCharacterIterator.classbin0 -> 2733 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractCollection.classbin0 -> 4777 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractList$1.classbin0 -> 2205 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractList$2.classbin0 -> 1499 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractList$3.classbin0 -> 2389 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractList$RandomAccessSubList.classbin0 -> 865 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractList$SubList.classbin0 -> 3945 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractList.classbin0 -> 4911 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractMap$1.classbin0 -> 1129 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractMap$2.classbin0 -> 1269 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractMap$3.classbin0 -> 1154 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractMap$4.classbin0 -> 1271 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractMap$SimpleEntry.classbin0 -> 2423 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractMap$SimpleImmutableEntry.classbin0 -> 1736 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractMap.classbin0 -> 5285 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractQueue.classbin0 -> 1965 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractSequentialList.classbin0 -> 2769 bytes
-rw-r--r--libjava/classpath/lib/java/util/AbstractSet.classbin0 -> 1708 bytes
-rw-r--r--libjava/classpath/lib/java/util/ArrayDeque$DeqIterator.classbin0 -> 1664 bytes
-rw-r--r--libjava/classpath/lib/java/util/ArrayDeque$DescendingIterator.classbin0 -> 1692 bytes
-rw-r--r--libjava/classpath/lib/java/util/ArrayDeque.classbin0 -> 10291 bytes
-rw-r--r--libjava/classpath/lib/java/util/ArrayList.classbin0 -> 7908 bytes
-rw-r--r--libjava/classpath/lib/java/util/Arrays$ArrayList.classbin0 -> 2662 bytes
-rw-r--r--libjava/classpath/lib/java/util/Arrays.classbin0 -> 26603 bytes
-rw-r--r--libjava/classpath/lib/java/util/BitSet.classbin0 -> 6968 bytes
-rw-r--r--libjava/classpath/lib/java/util/Calendar.classbin0 -> 13449 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collection.classbin0 -> 841 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$1$SynchronizedMapEntry.classbin0 -> 2194 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$1.classbin0 -> 1138 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$2.classbin0 -> 1103 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$3.classbin0 -> 1511 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$4.classbin0 -> 1543 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$5.classbin0 -> 1611 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$6.classbin0 -> 1487 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$7.classbin0 -> 1809 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$8.classbin0 -> 889 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$9.classbin0 -> 902 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$CheckedCollection.classbin0 -> 3768 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$CheckedIterator.classbin0 -> 1272 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$CheckedList.classbin0 -> 3851 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$CheckedListIterator.classbin0 -> 2065 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$CheckedMap$CheckedEntrySet.classbin0 -> 1781 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$CheckedMap.classbin0 -> 4991 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$CheckedRandomAccessList.classbin0 -> 963 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$CheckedSet.classbin0 -> 1290 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$CheckedSortedMap.classbin0 -> 2347 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$CheckedSortedSet.classbin0 -> 2153 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$CopiesList.classbin0 -> 2693 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$EmptyList.classbin0 -> 2671 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$EmptyMap.classbin0 -> 2143 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$EmptySet.classbin0 -> 2422 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$ReverseComparator.classbin0 -> 1024 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$SingletonList.classbin0 -> 3063 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$SingletonMap.classbin0 -> 2981 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$SingletonSet.classbin0 -> 2438 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$SynchronizedCollection.classbin0 -> 3969 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$SynchronizedIterator.classbin0 -> 1366 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$SynchronizedList.classbin0 -> 3835 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$SynchronizedListIterator.classbin0 -> 2030 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$SynchronizedMap.classbin0 -> 4720 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$SynchronizedRandomAccessList.classbin0 -> 1461 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$SynchronizedSet.classbin0 -> 1550 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$SynchronizedSortedMap.classbin0 -> 2611 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$SynchronizedSortedSet.classbin0 -> 2577 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$UnmodifiableCollection.classbin0 -> 3096 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$UnmodifiableIterator.classbin0 -> 1182 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$UnmodifiableList.classbin0 -> 3136 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$UnmodifiableListIterator.classbin0 -> 1745 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableMapEntry.classbin0 -> 2188 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet.classbin0 -> 2550 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$UnmodifiableMap.classbin0 -> 3698 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$UnmodifiableRandomAccessList.classbin0 -> 883 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$UnmodifiableSet.classbin0 -> 1193 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$UnmodifiableSortedMap.classbin0 -> 2105 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections$UnmodifiableSortedSet.classbin0 -> 2032 bytes
-rw-r--r--libjava/classpath/lib/java/util/Collections.classbin0 -> 21075 bytes
-rw-r--r--libjava/classpath/lib/java/util/Comparator.classbin0 -> 295 bytes
-rw-r--r--libjava/classpath/lib/java/util/ConcurrentModificationException.classbin0 -> 556 bytes
-rw-r--r--libjava/classpath/lib/java/util/Currency.classbin0 -> 3337 bytes
-rw-r--r--libjava/classpath/lib/java/util/Date.classbin0 -> 10943 bytes
-rw-r--r--libjava/classpath/lib/java/util/Deque.classbin0 -> 1056 bytes
-rw-r--r--libjava/classpath/lib/java/util/Dictionary.classbin0 -> 836 bytes
-rw-r--r--libjava/classpath/lib/java/util/DuplicateFormatFlagsException.classbin0 -> 876 bytes
-rw-r--r--libjava/classpath/lib/java/util/EmptyStackException.classbin0 -> 380 bytes
-rw-r--r--libjava/classpath/lib/java/util/EnumMap$1.classbin0 -> 1315 bytes
-rw-r--r--libjava/classpath/lib/java/util/EnumMap$2.classbin0 -> 1460 bytes
-rw-r--r--libjava/classpath/lib/java/util/EnumMap$3.classbin0 -> 1053 bytes
-rw-r--r--libjava/classpath/lib/java/util/EnumMap$4.classbin0 -> 1233 bytes
-rw-r--r--libjava/classpath/lib/java/util/EnumMap$5.classbin0 -> 1839 bytes
-rw-r--r--libjava/classpath/lib/java/util/EnumMap$6.classbin0 -> 1753 bytes
-rw-r--r--libjava/classpath/lib/java/util/EnumMap$7.classbin0 -> 1307 bytes
-rw-r--r--libjava/classpath/lib/java/util/EnumMap.classbin0 -> 5826 bytes
-rw-r--r--libjava/classpath/lib/java/util/EnumSet$1.classbin0 -> 1389 bytes
-rw-r--r--libjava/classpath/lib/java/util/EnumSet.classbin0 -> 8349 bytes
-rw-r--r--libjava/classpath/lib/java/util/Enumeration.classbin0 -> 269 bytes
-rw-r--r--libjava/classpath/lib/java/util/EventListener.classbin0 -> 117 bytes
-rw-r--r--libjava/classpath/lib/java/util/EventListenerProxy.classbin0 -> 546 bytes
-rw-r--r--libjava/classpath/lib/java/util/EventObject.classbin0 -> 1140 bytes
-rw-r--r--libjava/classpath/lib/java/util/FormatFlagsConversionMismatchException.classbin0 -> 1111 bytes
-rw-r--r--libjava/classpath/lib/java/util/Formattable.classbin0 -> 162 bytes
-rw-r--r--libjava/classpath/lib/java/util/FormattableFlags.classbin0 -> 562 bytes
-rw-r--r--libjava/classpath/lib/java/util/Formatter$BigDecimalLayoutForm.classbin0 -> 1177 bytes
-rw-r--r--libjava/classpath/lib/java/util/Formatter.classbin0 -> 17740 bytes
-rw-r--r--libjava/classpath/lib/java/util/FormatterClosedException.classbin0 -> 400 bytes
-rw-r--r--libjava/classpath/lib/java/util/GregorianCalendar.classbin0 -> 14556 bytes
-rw-r--r--libjava/classpath/lib/java/util/HashMap$1.classbin0 -> 1222 bytes
-rw-r--r--libjava/classpath/lib/java/util/HashMap$2.classbin0 -> 898 bytes
-rw-r--r--libjava/classpath/lib/java/util/HashMap$3.classbin0 -> 1494 bytes
-rw-r--r--libjava/classpath/lib/java/util/HashMap$HashEntry.classbin0 -> 1008 bytes
-rw-r--r--libjava/classpath/lib/java/util/HashMap$HashIterator.classbin0 -> 1854 bytes
-rw-r--r--libjava/classpath/lib/java/util/HashMap.classbin0 -> 8875 bytes
-rw-r--r--libjava/classpath/lib/java/util/HashSet.classbin0 -> 3994 bytes
-rw-r--r--libjava/classpath/lib/java/util/Hashtable$1.classbin0 -> 1217 bytes
-rw-r--r--libjava/classpath/lib/java/util/Hashtable$2.classbin0 -> 926 bytes
-rw-r--r--libjava/classpath/lib/java/util/Hashtable$3.classbin0 -> 1530 bytes
-rw-r--r--libjava/classpath/lib/java/util/Hashtable$EntryEnumerator.classbin0 -> 1475 bytes
-rw-r--r--libjava/classpath/lib/java/util/Hashtable$EntryIterator.classbin0 -> 1861 bytes
-rw-r--r--libjava/classpath/lib/java/util/Hashtable$HashEntry.classbin0 -> 1054 bytes
-rw-r--r--libjava/classpath/lib/java/util/Hashtable$KeyEnumerator.classbin0 -> 1278 bytes
-rw-r--r--libjava/classpath/lib/java/util/Hashtable$KeyIterator.classbin0 -> 1132 bytes
-rw-r--r--libjava/classpath/lib/java/util/Hashtable$ValueEnumerator.classbin0 -> 1286 bytes
-rw-r--r--libjava/classpath/lib/java/util/Hashtable$ValueIterator.classbin0 -> 1140 bytes
-rw-r--r--libjava/classpath/lib/java/util/Hashtable.classbin0 -> 10367 bytes
-rw-r--r--libjava/classpath/lib/java/util/IdentityHashMap$1.classbin0 -> 1915 bytes
-rw-r--r--libjava/classpath/lib/java/util/IdentityHashMap$2.classbin0 -> 1786 bytes
-rw-r--r--libjava/classpath/lib/java/util/IdentityHashMap$3.classbin0 -> 1412 bytes
-rw-r--r--libjava/classpath/lib/java/util/IdentityHashMap$IdentityEntry.classbin0 -> 2554 bytes
-rw-r--r--libjava/classpath/lib/java/util/IdentityHashMap$IdentityIterator.classbin0 -> 1900 bytes
-rw-r--r--libjava/classpath/lib/java/util/IdentityHashMap.classbin0 -> 6772 bytes
-rw-r--r--libjava/classpath/lib/java/util/IllegalFormatCodePointException.classbin0 -> 625 bytes
-rw-r--r--libjava/classpath/lib/java/util/IllegalFormatConversionException.classbin0 -> 1364 bytes
-rw-r--r--libjava/classpath/lib/java/util/IllegalFormatException.classbin0 -> 534 bytes
-rw-r--r--libjava/classpath/lib/java/util/IllegalFormatFlagsException.classbin0 -> 881 bytes
-rw-r--r--libjava/classpath/lib/java/util/IllegalFormatPrecisionException.classbin0 -> 821 bytes
-rw-r--r--libjava/classpath/lib/java/util/IllegalFormatWidthException.classbin0 -> 801 bytes
-rw-r--r--libjava/classpath/lib/java/util/InputMismatchException.classbin0 -> 466 bytes
-rw-r--r--libjava/classpath/lib/java/util/InvalidPropertiesFormatException.classbin0 -> 1142 bytes
-rw-r--r--libjava/classpath/lib/java/util/Iterator.classbin0 -> 271 bytes
-rw-r--r--libjava/classpath/lib/java/util/LinkedHashMap$1.classbin0 -> 1521 bytes
-rw-r--r--libjava/classpath/lib/java/util/LinkedHashMap$LinkedHashEntry.classbin0 -> 1630 bytes
-rw-r--r--libjava/classpath/lib/java/util/LinkedHashMap.classbin0 -> 3388 bytes
-rw-r--r--libjava/classpath/lib/java/util/LinkedHashSet.classbin0 -> 1400 bytes
-rw-r--r--libjava/classpath/lib/java/util/LinkedList$Entry.classbin0 -> 719 bytes
-rw-r--r--libjava/classpath/lib/java/util/LinkedList$LinkedListItr.classbin0 -> 3062 bytes
-rw-r--r--libjava/classpath/lib/java/util/LinkedList.classbin0 -> 9888 bytes
-rw-r--r--libjava/classpath/lib/java/util/List.classbin0 -> 1427 bytes
-rw-r--r--libjava/classpath/lib/java/util/ListIterator.classbin0 -> 506 bytes
-rw-r--r--libjava/classpath/lib/java/util/ListResourceBundle.classbin0 -> 1614 bytes
-rw-r--r--libjava/classpath/lib/java/util/Locale.classbin0 -> 16086 bytes
-rw-r--r--libjava/classpath/lib/java/util/Map$Entry.classbin0 -> 480 bytes
-rw-r--r--libjava/classpath/lib/java/util/Map.classbin0 -> 935 bytes
-rw-r--r--libjava/classpath/lib/java/util/MissingFormatArgumentException.classbin0 -> 917 bytes
-rw-r--r--libjava/classpath/lib/java/util/MissingFormatWidthException.classbin0 -> 890 bytes
-rw-r--r--libjava/classpath/lib/java/util/MissingResourceException.classbin0 -> 770 bytes
-rw-r--r--libjava/classpath/lib/java/util/NavigableMap.classbin0 -> 1538 bytes
-rw-r--r--libjava/classpath/lib/java/util/NavigableSet.classbin0 -> 1179 bytes
-rw-r--r--libjava/classpath/lib/java/util/NoSuchElementException.classbin0 -> 529 bytes
-rw-r--r--libjava/classpath/lib/java/util/Observable.classbin0 -> 2016 bytes
-rw-r--r--libjava/classpath/lib/java/util/Observer.classbin0 -> 170 bytes
-rw-r--r--libjava/classpath/lib/java/util/PriorityQueue$1.classbin0 -> 1094 bytes
-rw-r--r--libjava/classpath/lib/java/util/PriorityQueue.classbin0 -> 5551 bytes
-rw-r--r--libjava/classpath/lib/java/util/Properties.classbin0 -> 12084 bytes
-rw-r--r--libjava/classpath/lib/java/util/PropertyPermission.classbin0 -> 3334 bytes
-rw-r--r--libjava/classpath/lib/java/util/PropertyPermissionCollection.classbin0 -> 2452 bytes
-rw-r--r--libjava/classpath/lib/java/util/PropertyResourceBundle.classbin0 -> 1762 bytes
-rw-r--r--libjava/classpath/lib/java/util/Queue.classbin0 -> 426 bytes
-rw-r--r--libjava/classpath/lib/java/util/Random.classbin0 -> 2327 bytes
-rw-r--r--libjava/classpath/lib/java/util/RandomAccess.classbin0 -> 115 bytes
-rw-r--r--libjava/classpath/lib/java/util/ResourceBundle$1.classbin0 -> 662 bytes
-rw-r--r--libjava/classpath/lib/java/util/ResourceBundle$BundleKey.classbin0 -> 1438 bytes
-rw-r--r--libjava/classpath/lib/java/util/ResourceBundle.classbin0 -> 6232 bytes
-rw-r--r--libjava/classpath/lib/java/util/Set.classbin0 -> 831 bytes
-rw-r--r--libjava/classpath/lib/java/util/SimpleTimeZone.classbin0 -> 10254 bytes
-rw-r--r--libjava/classpath/lib/java/util/SortedMap.classbin0 -> 669 bytes
-rw-r--r--libjava/classpath/lib/java/util/SortedSet.classbin0 -> 634 bytes
-rw-r--r--libjava/classpath/lib/java/util/Stack.classbin0 -> 1548 bytes
-rw-r--r--libjava/classpath/lib/java/util/StringTokenizer.classbin0 -> 2332 bytes
-rw-r--r--libjava/classpath/lib/java/util/TimeZone$1.classbin0 -> 1134 bytes
-rw-r--r--libjava/classpath/lib/java/util/TimeZone.classbin0 -> 27535 bytes
-rw-r--r--libjava/classpath/lib/java/util/Timer$Scheduler.classbin0 -> 1292 bytes
-rw-r--r--libjava/classpath/lib/java/util/Timer$TaskQueue.classbin0 -> 2929 bytes
-rw-r--r--libjava/classpath/lib/java/util/Timer.classbin0 -> 4067 bytes
-rw-r--r--libjava/classpath/lib/java/util/TimerTask.classbin0 -> 681 bytes
-rw-r--r--libjava/classpath/lib/java/util/TooManyListenersException.classbin0 -> 531 bytes
-rw-r--r--libjava/classpath/lib/java/util/TreeMap$1.classbin0 -> 2442 bytes
-rw-r--r--libjava/classpath/lib/java/util/TreeMap$2.classbin0 -> 1770 bytes
-rw-r--r--libjava/classpath/lib/java/util/TreeMap$3.classbin0 -> 1318 bytes
-rw-r--r--libjava/classpath/lib/java/util/TreeMap$4.classbin0 -> 1913 bytes
-rw-r--r--libjava/classpath/lib/java/util/TreeMap$5.classbin0 -> 1456 bytes
-rw-r--r--libjava/classpath/lib/java/util/TreeMap$6.classbin0 -> 938 bytes
-rw-r--r--libjava/classpath/lib/java/util/TreeMap$Node.classbin0 -> 976 bytes
-rw-r--r--libjava/classpath/lib/java/util/TreeMap$SubMap.classbin0 -> 5456 bytes
-rw-r--r--libjava/classpath/lib/java/util/TreeMap$TreeIterator.classbin0 -> 1805 bytes
-rw-r--r--libjava/classpath/lib/java/util/TreeMap.classbin0 -> 13896 bytes
-rw-r--r--libjava/classpath/lib/java/util/TreeSet.classbin0 -> 5980 bytes
-rw-r--r--libjava/classpath/lib/java/util/UUID.classbin0 -> 4915 bytes
-rw-r--r--libjava/classpath/lib/java/util/UnknownFormatConversionException.classbin0 -> 875 bytes
-rw-r--r--libjava/classpath/lib/java/util/UnknownFormatFlagsException.classbin0 -> 872 bytes
-rw-r--r--libjava/classpath/lib/java/util/VMTimeZone.classbin0 -> 4238 bytes
-rw-r--r--libjava/classpath/lib/java/util/Vector$1.classbin0 -> 977 bytes
-rw-r--r--libjava/classpath/lib/java/util/Vector.classbin0 -> 10887 bytes
-rw-r--r--libjava/classpath/lib/java/util/WeakHashMap$1.classbin0 -> 584 bytes
-rw-r--r--libjava/classpath/lib/java/util/WeakHashMap$2.classbin0 -> 2719 bytes
-rw-r--r--libjava/classpath/lib/java/util/WeakHashMap$WeakBucket$WeakEntry.classbin0 -> 2131 bytes
-rw-r--r--libjava/classpath/lib/java/util/WeakHashMap$WeakBucket.classbin0 -> 1472 bytes
-rw-r--r--libjava/classpath/lib/java/util/WeakHashMap$WeakEntrySet.classbin0 -> 880 bytes
-rw-r--r--libjava/classpath/lib/java/util/WeakHashMap.classbin0 -> 6368 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/AbstractExecutorService.classbin0 -> 8804 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ArrayBlockingQueue$Itr.classbin0 -> 2191 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ArrayBlockingQueue.classbin0 -> 9946 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/BlockingDeque.classbin0 -> 1518 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/BlockingQueue.classbin0 -> 982 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/BrokenBarrierException.classbin0 -> 541 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Callable.classbin0 -> 283 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/CancellationException.classbin0 -> 550 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/CompletionService.classbin0 -> 855 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$EntryIterator.classbin0 -> 1504 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$EntrySet.classbin0 -> 1751 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$HashEntry.classbin0 -> 1373 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$HashIterator.classbin0 -> 2413 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$KeyIterator.classbin0 -> 1138 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$KeySet.classbin0 -> 1274 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$Segment.classbin0 -> 6776 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$ValueIterator.classbin0 -> 1146 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$Values.classbin0 -> 1151 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$WriteThroughEntry.classbin0 -> 1272 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap.classbin0 -> 10684 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentLinkedQueue$Itr.classbin0 -> 1874 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentLinkedQueue$Node.classbin0 -> 3245 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentLinkedQueue.classbin0 -> 6269 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentMap.classbin0 -> 534 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentNavigableMap.classbin0 -> 1363 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$ComparableUsingComparator.classbin0 -> 1303 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$EntryIterator.classbin0 -> 1420 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$EntrySet.classbin0 -> 3244 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$HeadIndex.classbin0 -> 1570 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Index.classbin0 -> 3030 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Iter.classbin0 -> 1873 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$KeyIterator.classbin0 -> 1106 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$KeySet.classbin0 -> 6690 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Node.classbin0 -> 4161 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapEntryIterator.classbin0 -> 1564 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapIter.classbin0 -> 2947 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapKeyIterator.classbin0 -> 1250 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapValueIterator.classbin0 -> 1090 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap.classbin0 -> 18179 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$ValueIterator.classbin0 -> 946 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Values.classbin0 -> 2209 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap.classbin0 -> 29603 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListSet.classbin0 -> 9070 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList.classbin0 -> 6845 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/CopyOnWriteArraySet.classbin0 -> 3911 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/CountDownLatch$Sync.classbin0 -> 1003 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/CountDownLatch.classbin0 -> 1704 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/CyclicBarrier$Generation.classbin0 -> 565 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/CyclicBarrier.classbin0 -> 3723 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/DelayQueue$Itr.classbin0 -> 1914 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/DelayQueue.classbin0 -> 8027 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Delayed.classbin0 -> 295 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Exchanger$Node.classbin0 -> 624 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Exchanger$Slot.classbin0 -> 791 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Exchanger.classbin0 -> 5987 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ExecutionException.classbin0 -> 816 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executor.classbin0 -> 162 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ExecutorCompletionService$QueueingFuture.classbin0 -> 1361 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ExecutorCompletionService.classbin0 -> 4452 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ExecutorService.classbin0 -> 1948 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors$1.classbin0 -> 1313 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors$2.classbin0 -> 2030 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors$3.classbin0 -> 1437 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors$4.classbin0 -> 1349 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors$5.classbin0 -> 867 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors$6.classbin0 -> 951 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors$DefaultThreadFactory.classbin0 -> 2039 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors$DelegatedExecutorService.classbin0 -> 3943 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors$DelegatedScheduledExecutorService.classbin0 -> 2190 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors$FinalizableDelegatedExecutorService.classbin0 -> 718 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors$PrivilegedCallable.classbin0 -> 2052 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors$PrivilegedCallableUsingCurrentClassLoader.classbin0 -> 2834 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors$PrivilegedThreadFactory.classbin0 -> 1674 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors$RunnableAdapter.classbin0 -> 1067 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Executors.classbin0 -> 6410 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Future.classbin0 -> 573 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/FutureTask$Sync.classbin0 -> 3705 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/FutureTask.classbin0 -> 3262 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$AbstractItr.classbin0 -> 1533 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$DescendingItr.classbin0 -> 1589 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$Itr.classbin0 -> 1537 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$Node.classbin0 -> 1107 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque.classbin0 -> 15659 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/LinkedBlockingQueue$Itr.classbin0 -> 3118 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/LinkedBlockingQueue$Node.classbin0 -> 792 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/LinkedBlockingQueue.classbin0 -> 11808 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/PriorityBlockingQueue$Itr.classbin0 -> 1869 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/PriorityBlockingQueue.classbin0 -> 8073 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/RejectedExecutionException.classbin0 -> 847 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/RejectedExecutionHandler.classbin0 -> 245 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/RunnableFuture.classbin0 -> 328 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/RunnableScheduledFuture.classbin0 -> 410 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ScheduledExecutorService.classbin0 -> 960 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ScheduledFuture.classbin0 -> 330 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor$1.classbin0 -> 1597 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue.classbin0 -> 5234 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask.classbin0 -> 4323 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor.classbin0 -> 9440 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Semaphore$FairSync.classbin0 -> 962 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Semaphore$NonfairSync.classbin0 -> 657 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Semaphore$Sync.classbin0 -> 1293 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/Semaphore.classbin0 -> 3504 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/SynchronousQueue$EmptyIterator.classbin0 -> 1052 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/SynchronousQueue$FifoWaitQueue.classbin0 -> 600 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/SynchronousQueue$LifoWaitQueue.classbin0 -> 600 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferQueue$QNode.classbin0 -> 2398 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferQueue.classbin0 -> 5213 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferStack$SNode.classbin0 -> 2334 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferStack.classbin0 -> 5011 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/SynchronousQueue$Transferer.classbin0 -> 486 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/SynchronousQueue$WaitQueue.classbin0 -> 449 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/SynchronousQueue.classbin0 -> 6851 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ThreadFactory.classbin0 -> 191 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$AbortPolicy.classbin0 -> 792 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$CallerRunsPolicy.classbin0 -> 832 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$DiscardOldestPolicy.classbin0 -> 1002 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$DiscardPolicy.classbin0 -> 733 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$Worker.classbin0 -> 2276 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor.classbin0 -> 14974 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/TimeUnit$1.classbin0 -> 1382 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/TimeUnit$2.classbin0 -> 1414 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/TimeUnit$3.classbin0 -> 1417 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/TimeUnit$4.classbin0 -> 1440 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/TimeUnit$5.classbin0 -> 1445 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/TimeUnit$6.classbin0 -> 1468 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/TimeUnit$7.classbin0 -> 1482 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/TimeUnit.classbin0 -> 3823 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/TimeoutException.classbin0 -> 523 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicBoolean.classbin0 -> 2174 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicInteger.classbin0 -> 3106 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicIntegerArray.classbin0 -> 3528 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.classbin0 -> 4605 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.classbin0 -> 2744 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicLong.classbin0 -> 3192 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongArray.classbin0 -> 3538 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater.classbin0 -> 4511 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongFieldUpdater$LockedUpdater.classbin0 -> 4539 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongFieldUpdater.classbin0 -> 2909 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicMarkableReference$ReferenceBooleanPair.classbin0 -> 1189 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicMarkableReference.classbin0 -> 3193 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicReference.classbin0 -> 2739 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicReferenceArray.classbin0 -> 3528 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl.classbin0 -> 5338 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.classbin0 -> 1995 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicStampedReference$ReferenceIntegerPair.classbin0 -> 1186 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/atomic/AtomicStampedReference.classbin0 -> 3208 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/AbstractOwnableSynchronizer.classbin0 -> 754 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedLongSynchronizer$ConditionObject.classbin0 -> 6818 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedLongSynchronizer$Node.classbin0 -> 1553 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.classbin0 -> 14442 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.classbin0 -> 6683 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedSynchronizer$Node.classbin0 -> 1529 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedSynchronizer.classbin0 -> 14257 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/Condition.classbin0 -> 422 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/Lock.classbin0 -> 387 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/LockSupport.classbin0 -> 2227 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/ReadWriteLock.classbin0 -> 211 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock$FairSync.classbin0 -> 1304 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock$NonfairSync.classbin0 -> 960 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock$Sync.classbin0 -> 2389 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock.classbin0 -> 4600 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$FairSync.classbin0 -> 837 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync.classbin0 -> 856 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock.classbin0 -> 2473 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$Sync$HoldCounter.classbin0 -> 846 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$Sync$ThreadLocalHoldCounter.classbin0 -> 1021 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$Sync.classbin0 -> 5082 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock.classbin0 -> 2795 bytes
-rw-r--r--libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock.classbin0 -> 5343 bytes
-rw-r--r--libjava/classpath/lib/java/util/jar/Attributes$Name.classbin0 -> 2920 bytes
-rw-r--r--libjava/classpath/lib/java/util/jar/Attributes.classbin0 -> 3812 bytes
-rw-r--r--libjava/classpath/lib/java/util/jar/JarEntry.classbin0 -> 1895 bytes
-rw-r--r--libjava/classpath/lib/java/util/jar/JarException.classbin0 -> 508 bytes
-rw-r--r--libjava/classpath/lib/java/util/jar/JarFile$EntryInputStream.classbin0 -> 5747 bytes
-rw-r--r--libjava/classpath/lib/java/util/jar/JarFile$JarEnumeration.classbin0 -> 2148 bytes
-rw-r--r--libjava/classpath/lib/java/util/jar/JarFile.classbin0 -> 14110 bytes
-rw-r--r--libjava/classpath/lib/java/util/jar/JarInputStream.classbin0 -> 2192 bytes
-rw-r--r--libjava/classpath/lib/java/util/jar/JarOutputStream.classbin0 -> 1201 bytes
-rw-r--r--libjava/classpath/lib/java/util/jar/Manifest.classbin0 -> 2568 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/ConsoleHandler.classbin0 -> 938 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/ErrorManager.classbin0 -> 1654 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/FileHandler$ostr.classbin0 -> 1249 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/FileHandler.classbin0 -> 6238 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/Filter.classbin0 -> 167 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/Formatter.classbin0 -> 1482 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/Handler.classbin0 -> 2968 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/Level.classbin0 -> 3397 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/LogManager$1.classbin0 -> 2265 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/LogManager.classbin0 -> 13097 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/LogRecord.classbin0 -> 4865 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/Logger$1.classbin0 -> 588 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/Logger.classbin0 -> 12065 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/LoggingMXBean.classbin0 -> 395 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/LoggingPermission.classbin0 -> 852 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/MemoryHandler.classbin0 -> 2945 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/SimpleFormatter.classbin0 -> 1997 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/SocketHandler.classbin0 -> 1932 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/StreamHandler.classbin0 -> 5354 bytes
-rw-r--r--libjava/classpath/lib/java/util/logging/XMLFormatter.classbin0 -> 4482 bytes
-rw-r--r--libjava/classpath/lib/java/util/prefs/AbstractPreferences$1.classbin0 -> 1009 bytes
-rw-r--r--libjava/classpath/lib/java/util/prefs/AbstractPreferences$2.classbin0 -> 1104 bytes
-rw-r--r--libjava/classpath/lib/java/util/prefs/AbstractPreferences.classbin0 -> 15751 bytes
-rw-r--r--libjava/classpath/lib/java/util/prefs/BackingStoreException.classbin0 -> 1046 bytes
-rw-r--r--libjava/classpath/lib/java/util/prefs/InvalidPreferencesFormatException.classbin0 -> 1236 bytes
-rw-r--r--libjava/classpath/lib/java/util/prefs/NodeChangeEvent.classbin0 -> 1309 bytes
-rw-r--r--libjava/classpath/lib/java/util/prefs/NodeChangeListener.classbin0 -> 247 bytes
-rw-r--r--libjava/classpath/lib/java/util/prefs/PreferenceChangeEvent.classbin0 -> 1485 bytes
-rw-r--r--libjava/classpath/lib/java/util/prefs/PreferenceChangeListener.classbin0 -> 248 bytes
-rw-r--r--libjava/classpath/lib/java/util/prefs/Preferences$1.classbin0 -> 1282 bytes
-rw-r--r--libjava/classpath/lib/java/util/prefs/Preferences.classbin0 -> 5352 bytes
-rw-r--r--libjava/classpath/lib/java/util/prefs/PreferencesFactory.classbin0 -> 207 bytes
-rw-r--r--libjava/classpath/lib/java/util/regex/MatchResult.classbin0 -> 270 bytes
-rw-r--r--libjava/classpath/lib/java/util/regex/Matcher.classbin0 -> 5016 bytes
-rw-r--r--libjava/classpath/lib/java/util/regex/Pattern.classbin0 -> 4266 bytes
-rw-r--r--libjava/classpath/lib/java/util/regex/PatternSyntaxException.classbin0 -> 1455 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/Adler32.classbin0 -> 1181 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/CRC32.classbin0 -> 1280 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/CheckedInputStream.classbin0 -> 1443 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/CheckedOutputStream.classbin0 -> 1062 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/Checksum.classbin0 -> 200 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/DataFormatException.classbin0 -> 518 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/Deflater.classbin0 -> 2397 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/DeflaterOutputStream.classbin0 -> 2157 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/GZIPInputStream.classbin0 -> 4268 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/GZIPOutputStream.classbin0 -> 1763 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/Inflater.classbin0 -> 1441 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/InflaterInputStream.classbin0 -> 3282 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/ZipConstants.classbin0 -> 1279 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/ZipEntry.classbin0 -> 5378 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/ZipException.classbin0 -> 497 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/ZipFile$1.classbin0 -> 1024 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/ZipFile$PartialInputStream.classbin0 -> 5138 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/ZipFile$ZipEntryEnumeration.classbin0 -> 1173 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/ZipFile.classbin0 -> 7716 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/ZipInputStream.classbin0 -> 6130 bytes
-rw-r--r--libjava/classpath/lib/java/util/zip/ZipOutputStream.classbin0 -> 6670 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/Accessible.classbin0 -> 196 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleAction.classbin0 -> 449 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleAttributeSequence.classbin0 -> 449 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleBundle.classbin0 -> 919 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleComponent.classbin0 -> 1188 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleContext.classbin0 -> 5243 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleEditableText.classbin0 -> 532 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleExtendedComponent.classbin0 -> 361 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleExtendedTable.classbin0 -> 291 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleExtendedText.classbin0 -> 471 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleHyperlink.classbin0 -> 678 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleHypertext.classbin0 -> 305 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleIcon.classbin0 -> 327 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleKeyBinding.classbin0 -> 244 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleRelation.classbin0 -> 2740 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleRelationSet.classbin0 -> 2893 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleResourceBundle.classbin0 -> 481 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleRole.classbin0 -> 4524 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleSelection.classbin0 -> 453 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleState.classbin0 -> 2352 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleStateSet.classbin0 -> 2107 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleStreamable.classbin0 -> 284 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleTable.classbin0 -> 1206 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleTableModelChange.classbin0 -> 379 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleText.classbin0 -> 668 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleTextSequence.classbin0 -> 415 bytes
-rw-r--r--libjava/classpath/lib/javax/accessibility/AccessibleValue.classbin0 -> 322 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/BadPaddingException.classbin0 -> 539 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/Cipher.classbin0 -> 11080 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/CipherInputStream.classbin0 -> 4883 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/CipherOutputStream.classbin0 -> 1742 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/CipherSpi.classbin0 -> 2771 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/EncryptedPrivateKeyInfo.classbin0 -> 4351 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/ExemptionMechanism.classbin0 -> 4810 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/ExemptionMechanismException.classbin0 -> 563 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/ExemptionMechanismSpi.classbin0 -> 855 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/IllegalBlockSizeException.classbin0 -> 557 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/KeyAgreement.classbin0 -> 4848 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/KeyAgreementSpi.classbin0 -> 952 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/KeyGenerator.classbin0 -> 4125 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/KeyGeneratorSpi.classbin0 -> 617 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/Mac.classbin0 -> 5444 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/MacSpi.classbin0 -> 1179 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/NoSuchPaddingException.classbin0 -> 548 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/NullCipher.classbin0 -> 423 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/NullCipherImpl.classbin0 -> 2559 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/SealedObject.classbin0 -> 4493 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/SecretKey.classbin0 -> 201 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/SecretKeyFactory.classbin0 -> 3822 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/SecretKeyFactorySpi.classbin0 -> 713 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/ShortBufferException.classbin0 -> 542 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/interfaces/DHKey.classbin0 -> 175 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/interfaces/DHPrivateKey.classbin0 -> 304 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/interfaces/DHPublicKey.classbin0 -> 301 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/interfaces/PBEKey.classbin0 -> 299 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/spec/DESKeySpec.classbin0 -> 2243 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/spec/DESedeKeySpec.classbin0 -> 1230 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/spec/DHGenParameterSpec.classbin0 -> 642 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/spec/DHParameterSpec.classbin0 -> 947 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/spec/DHPrivateKeySpec.classbin0 -> 798 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/spec/DHPublicKeySpec.classbin0 -> 795 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/spec/IvParameterSpec.classbin0 -> 731 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/spec/PBEKeySpec.classbin0 -> 2279 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/spec/PBEParameterSpec.classbin0 -> 643 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/spec/RC2ParameterSpec.classbin0 -> 1599 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/spec/RC5ParameterSpec.classbin0 -> 1956 bytes
-rw-r--r--libjava/classpath/lib/javax/crypto/spec/SecretKeySpec.classbin0 -> 1600 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/IIOException.classbin0 -> 598 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/IIOImage.classbin0 -> 2986 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/IIOParam.classbin0 -> 4094 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/IIOParamController.classbin0 -> 180 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageIO$1.classbin0 -> 1187 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageIO$ImageReaderIterator.classbin0 -> 1779 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageIO$ImageWriterIterator.classbin0 -> 1779 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageIO$ReaderFormatFilter.classbin0 -> 996 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageIO$ReaderMIMETypeFilter.classbin0 -> 996 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageIO$ReaderObjectFilter.classbin0 -> 843 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageIO$ReaderSuffixFilter.classbin0 -> 994 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageIO$TranscoderFilter.classbin0 -> 1392 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageIO$WriterFormatFilter.classbin0 -> 996 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageIO$WriterMIMETypeFilter.classbin0 -> 996 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageIO$WriterObjectFilter.classbin0 -> 1193 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageIO$WriterSuffixFilter.classbin0 -> 994 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageIO.classbin0 -> 13182 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageReadParam.classbin0 -> 2209 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageReader.classbin0 -> 20387 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageTranscoder.classbin0 -> 438 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageTypeSpecifier.classbin0 -> 6079 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageWriteParam.classbin0 -> 6550 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/ImageWriter.classbin0 -> 13487 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/event/IIOReadProgressListener.classbin0 -> 543 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/event/IIOReadUpdateListener.classbin0 -> 536 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/event/IIOReadWarningListener.classbin0 -> 253 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/event/IIOWriteProgressListener.classbin0 -> 493 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/event/IIOWriteWarningListener.classbin0 -> 256 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOInvalidTreeException.classbin0 -> 953 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadata.classbin0 -> 5437 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataController.classbin0 -> 207 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormat.classbin0 -> 2613 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$1.classbin0 -> 818 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttr.classbin0 -> 1846 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttrBounded.classbin0 -> 1379 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttrEnumerated.classbin0 -> 1283 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttrList.classbin0 -> 1187 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObject.classbin0 -> 1419 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObjectArray.classbin0 -> 1284 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObjectBounded.classbin0 -> 1499 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObjectEnumerated.classbin0 -> 1253 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl.classbin0 -> 16110 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataNode$IIONamedNodeMap.classbin0 -> 2445 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataNode$IIONodeList.classbin0 -> 1154 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/metadata/IIOMetadataNode.classbin0 -> 10716 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/plugins/bmp/BMPImageWriteParam.classbin0 -> 1248 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGHuffmanTable.classbin0 -> 5297 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGImageReadParam.classbin0 -> 1750 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGImageWriteParam.classbin0 -> 3531 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGQTable.classbin0 -> 3025 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/spi/IIORegistry.classbin0 -> 2596 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/spi/IIOServiceProvider.classbin0 -> 1399 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/spi/ImageInputStreamSpi.classbin0 -> 1458 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/spi/ImageOutputStreamSpi.classbin0 -> 1467 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/spi/ImageReaderSpi.classbin0 -> 3023 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/spi/ImageReaderWriterSpi.classbin0 -> 4061 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/spi/ImageTranscoderSpi.classbin0 -> 694 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/spi/ImageWriterSpi.classbin0 -> 3443 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/spi/RegisterableService.classbin0 -> 336 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/spi/ServiceRegistry$1.classbin0 -> 1076 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/spi/ServiceRegistry$2.classbin0 -> 1168 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/spi/ServiceRegistry$Filter.classbin0 -> 256 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/spi/ServiceRegistry.classbin0 -> 8702 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/stream/FileCacheImageInputStream.classbin0 -> 1455 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/stream/FileCacheImageOutputStream.classbin0 -> 1740 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/stream/FileImageInputStream.classbin0 -> 1567 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/stream/FileImageOutputStream.classbin0 -> 1956 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/stream/IIOByteBuffer.classbin0 -> 972 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/stream/ImageInputStream.classbin0 -> 1680 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/stream/ImageInputStreamImpl.classbin0 -> 8798 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/stream/ImageOutputStream.classbin0 -> 1056 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/stream/ImageOutputStreamImpl.classbin0 -> 4842 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/stream/MemoryCacheImageInputStream.classbin0 -> 1907 bytes
-rw-r--r--libjava/classpath/lib/javax/imageio/stream/MemoryCacheImageOutputStream.classbin0 -> 1612 bytes
-rw-r--r--libjava/classpath/lib/javax/management/Attribute.classbin0 -> 1293 bytes
-rw-r--r--libjava/classpath/lib/javax/management/AttributeList.classbin0 -> 1795 bytes
-rw-r--r--libjava/classpath/lib/javax/management/AttributeNotFoundException.classbin0 -> 502 bytes
-rw-r--r--libjava/classpath/lib/javax/management/BadAttributeValueExpException.classbin0 -> 1050 bytes
-rw-r--r--libjava/classpath/lib/javax/management/BadBinaryOpValueExpException.classbin0 -> 1167 bytes
-rw-r--r--libjava/classpath/lib/javax/management/BadStringOperationException.classbin0 -> 960 bytes
-rw-r--r--libjava/classpath/lib/javax/management/DynamicMBean.classbin0 -> 804 bytes
-rw-r--r--libjava/classpath/lib/javax/management/InstanceAlreadyExistsException.classbin0 -> 578 bytes
-rw-r--r--libjava/classpath/lib/javax/management/InstanceNotFoundException.classbin0 -> 563 bytes
-rw-r--r--libjava/classpath/lib/javax/management/IntrospectionException.classbin0 -> 554 bytes
-rw-r--r--libjava/classpath/lib/javax/management/InvalidApplicationException.classbin0 -> 1044 bytes
-rw-r--r--libjava/classpath/lib/javax/management/InvalidAttributeValueException.classbin0 -> 514 bytes
-rw-r--r--libjava/classpath/lib/javax/management/JMException.classbin0 -> 440 bytes
-rw-r--r--libjava/classpath/lib/javax/management/JMRuntimeException.classbin0 -> 468 bytes
-rw-r--r--libjava/classpath/lib/javax/management/ListenerNotFoundException.classbin0 -> 563 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanAttributeInfo.classbin0 -> 3515 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanConstructorInfo.classbin0 -> 2979 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanException.classbin0 -> 896 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanFeatureInfo.classbin0 -> 1654 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanInfo.classbin0 -> 4188 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanNotificationInfo.classbin0 -> 2094 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanOperationInfo.classbin0 -> 4069 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanParameterInfo.classbin0 -> 1809 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanPermission$NameHolder.classbin0 -> 2646 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanPermission.classbin0 -> 4723 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanRegistration.classbin0 -> 408 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanRegistrationException.classbin0 -> 653 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanServer.classbin0 -> 4177 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanServerBuilder.classbin0 -> 996 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanServerConnection.classbin0 -> 3243 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanServerDelegate.classbin0 -> 4939 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanServerDelegateMBean.classbin0 -> 395 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanServerFactory.classbin0 -> 6217 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanServerNotification.classbin0 -> 961 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanServerPermission$MBeanServerPermissionCollection$MBeanServerPermissionEnumeration.classbin0 -> 1404 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanServerPermission$MBeanServerPermissionCollection.classbin0 -> 2905 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanServerPermission.classbin0 -> 3110 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MBeanTrustPermission.classbin0 -> 912 bytes
-rw-r--r--libjava/classpath/lib/javax/management/MalformedObjectNameException.classbin0 -> 572 bytes
-rw-r--r--libjava/classpath/lib/javax/management/NotCompliantMBeanException.classbin0 -> 566 bytes
-rw-r--r--libjava/classpath/lib/javax/management/Notification.classbin0 -> 2790 bytes
-rw-r--r--libjava/classpath/lib/javax/management/NotificationBroadcaster.classbin0 -> 557 bytes
-rw-r--r--libjava/classpath/lib/javax/management/NotificationEmitter.classbin0 -> 392 bytes
-rw-r--r--libjava/classpath/lib/javax/management/NotificationFilter.classbin0 -> 231 bytes
-rw-r--r--libjava/classpath/lib/javax/management/NotificationListener.classbin0 -> 253 bytes
-rw-r--r--libjava/classpath/lib/javax/management/ObjectInstance.classbin0 -> 1460 bytes
-rw-r--r--libjava/classpath/lib/javax/management/ObjectName.classbin0 -> 8761 bytes
-rw-r--r--libjava/classpath/lib/javax/management/OperationsException.classbin0 -> 537 bytes
-rw-r--r--libjava/classpath/lib/javax/management/QueryExp.classbin0 -> 486 bytes
-rw-r--r--libjava/classpath/lib/javax/management/ReflectionException.classbin0 -> 911 bytes
-rw-r--r--libjava/classpath/lib/javax/management/RuntimeErrorException.classbin0 -> 900 bytes
-rw-r--r--libjava/classpath/lib/javax/management/RuntimeMBeanException.classbin0 -> 959 bytes
-rw-r--r--libjava/classpath/lib/javax/management/RuntimeOperationsException.classbin0 -> 974 bytes
-rw-r--r--libjava/classpath/lib/javax/management/ServiceNotFoundException.classbin0 -> 560 bytes
-rw-r--r--libjava/classpath/lib/javax/management/StandardMBean.classbin0 -> 14040 bytes
-rw-r--r--libjava/classpath/lib/javax/management/ValueExp.classbin0 -> 531 bytes
-rw-r--r--libjava/classpath/lib/javax/management/loading/ClassLoaderRepository.classbin0 -> 405 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/ArrayType.classbin0 -> 3898 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/CompositeData.classbin0 -> 545 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/CompositeDataSupport.classbin0 -> 5405 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/CompositeType.classbin0 -> 4543 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/InvalidKeyException.classbin0 -> 563 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/InvalidOpenTypeException.classbin0 -> 578 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/KeyAlreadyExistsException.classbin0 -> 581 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/OpenDataException.classbin0 -> 551 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/OpenMBeanAttributeInfo.classbin0 -> 380 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/OpenMBeanAttributeInfoSupport.classbin0 -> 7086 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/OpenMBeanConstructorInfo.classbin0 -> 373 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/OpenMBeanConstructorInfoSupport.classbin0 -> 2540 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/OpenMBeanInfo.classbin0 -> 568 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/OpenMBeanInfoSupport.classbin0 -> 3351 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/OpenMBeanOperationInfo.classbin0 -> 483 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/OpenMBeanOperationInfoSupport.classbin0 -> 3539 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/OpenMBeanParameterInfo.classbin0 -> 651 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/OpenMBeanParameterInfoSupport.classbin0 -> 6517 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/OpenType.classbin0 -> 2746 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/SimpleType.classbin0 -> 3353 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/TabularData.classbin0 -> 885 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/TabularDataSupport.classbin0 -> 7234 bytes
-rw-r--r--libjava/classpath/lib/javax/management/openmbean/TabularType.classbin0 -> 3680 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/AuthenticationException.classbin0 -> 545 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/AuthenticationNotSupportedException.classbin0 -> 581 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/BinaryRefAddr.classbin0 -> 2131 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/Binding.classbin0 -> 1937 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/CannotProceedException.classbin0 -> 1824 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/CommunicationException.classbin0 -> 534 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/CompositeName.classbin0 -> 6437 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/CompoundName.classbin0 -> 9469 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ConfigurationException.classbin0 -> 534 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/Context.classbin0 -> 3164 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ContextNotEmptyException.classbin0 -> 540 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/InitialContext.classbin0 -> 10044 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/InsufficientResourcesException.classbin0 -> 558 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/InterruptedNamingException.classbin0 -> 546 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/InvalidNameException.classbin0 -> 528 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/LimitExceededException.classbin0 -> 534 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/LinkException.classbin0 -> 2151 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/LinkLoopException.classbin0 -> 517 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/LinkRef.classbin0 -> 1083 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/MalformedLinkException.classbin0 -> 532 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/Name.classbin0 -> 1134 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/NameAlreadyBoundException.classbin0 -> 543 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/NameClassPair.classbin0 -> 1868 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/NameNotFoundException.classbin0 -> 531 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/NameParser.classbin0 -> 229 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/NamingEnumeration.classbin0 -> 425 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/NamingException.classbin0 -> 3473 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/NamingSecurityException.classbin0 -> 537 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/NoInitialContextException.classbin0 -> 543 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/NoPermissionException.classbin0 -> 539 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/NotContextException.classbin0 -> 525 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/OperationNotSupportedException.classbin0 -> 558 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/PartialResultException.classbin0 -> 534 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/RefAddr.classbin0 -> 1468 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/Reference.classbin0 -> 4085 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/Referenceable.classbin0 -> 229 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ReferralException.classbin0 -> 838 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ServiceUnavailableException.classbin0 -> 549 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/SizeLimitExceededException.classbin0 -> 553 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/StringRefAddr.classbin0 -> 610 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/TimeLimitExceededException.classbin0 -> 553 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/Attribute.classbin0 -> 928 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/AttributeInUseException.classbin0 -> 557 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/AttributeModificationException.classbin0 -> 1327 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/Attributes.classbin0 -> 757 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/BasicAttribute$BasicAttributeEnumeration.classbin0 -> 1448 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/BasicAttribute.classbin0 -> 5900 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/BasicAttributes$BasicAttributesEnumeration.classbin0 -> 1671 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/BasicAttributes.classbin0 -> 4910 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/DirContext.classbin0 -> 4072 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/InitialDirContext.classbin0 -> 8037 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/InvalidAttributeIdentifierException.classbin0 -> 593 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/InvalidAttributeValueException.classbin0 -> 578 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/InvalidAttributesException.classbin0 -> 566 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/InvalidSearchControlsException.classbin0 -> 578 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/InvalidSearchFilterException.classbin0 -> 572 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/ModificationItem.classbin0 -> 1285 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/NoSuchAttributeException.classbin0 -> 560 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/SchemaViolationException.classbin0 -> 560 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/SearchControls.classbin0 -> 2181 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/directory/SearchResult.classbin0 -> 2145 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/event/EventContext.classbin0 -> 631 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/event/EventDirContext.classbin0 -> 853 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/event/NamespaceChangeListener.classbin0 -> 295 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/event/NamingEvent.classbin0 -> 2012 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/event/NamingExceptionEvent.classbin0 -> 1239 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/event/NamingListener.classbin0 -> 238 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/event/ObjectChangeListener.classbin0 -> 243 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ldap/Control.classbin0 -> 327 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ldap/ControlFactory.classbin0 -> 2274 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ldap/ExtendedRequest.classbin0 -> 382 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ldap/ExtendedResponse.classbin0 -> 231 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ldap/HasControls.classbin0 -> 233 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ldap/InitialLdapContext.classbin0 -> 2605 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ldap/LdapContext.classbin0 -> 779 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ldap/LdapReferralException.classbin0 -> 920 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ldap/StartTlsRequest.classbin0 -> 1676 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ldap/StartTlsResponse.classbin0 -> 995 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ldap/UnsolicitedNotification.classbin0 -> 329 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ldap/UnsolicitedNotificationEvent.classbin0 -> 1113 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/ldap/UnsolicitedNotificationListener.classbin0 -> 287 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/spi/DirObjectFactory.classbin0 -> 544 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/spi/DirStateFactory$Result.classbin0 -> 822 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/spi/DirStateFactory.classbin0 -> 678 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/spi/DirectoryManager.classbin0 -> 5499 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/spi/InitialContextFactory.classbin0 -> 345 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/spi/InitialContextFactoryBuilder.classbin0 -> 405 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/spi/NamingManager.classbin0 -> 9601 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/spi/ObjectFactory.classbin0 -> 430 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/spi/ObjectFactoryBuilder.classbin0 -> 401 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/spi/ResolveResult.classbin0 -> 1913 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/spi/Resolver.classbin0 -> 582 bytes
-rw-r--r--libjava/classpath/lib/javax/naming/spi/StateFactory.classbin0 -> 434 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ServerSocketFactory.classbin0 -> 1235 bytes
-rw-r--r--libjava/classpath/lib/javax/net/SocketFactory.classbin0 -> 1351 bytes
-rw-r--r--libjava/classpath/lib/javax/net/VanillaServerSocketFactory.classbin0 -> 1067 bytes
-rw-r--r--libjava/classpath/lib/javax/net/VanillaSocketFactory.classbin0 -> 1470 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/CertPathTrustManagerParameters.classbin0 -> 747 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/HandshakeCompletedEvent.classbin0 -> 1889 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/HandshakeCompletedListener.classbin0 -> 252 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/HostnameVerifier.classbin0 -> 194 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/HttpsURLConnection.classbin0 -> 3247 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/KeyManager.classbin0 -> 115 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/KeyManagerFactory$1.classbin0 -> 717 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/KeyManagerFactory.classbin0 -> 4221 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/KeyManagerFactorySpi.classbin0 -> 704 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/KeyStoreBuilderParameters.classbin0 -> 374 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/ManagerFactoryParameters.classbin0 -> 143 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLContext.classbin0 -> 4340 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLContextSpi.classbin0 -> 861 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLEngine.classbin0 -> 2522 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLEngineResult$HandshakeStatus.classbin0 -> 1388 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLEngineResult$Status.classbin0 -> 1265 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLEngineResult.classbin0 -> 2115 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLException.classbin0 -> 855 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLHandshakeException.classbin0 -> 390 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLKeyException.classbin0 -> 372 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLPeerUnverifiedException.classbin0 -> 405 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLPermission.classbin0 -> 579 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLProtocolException.classbin0 -> 387 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLServerSocket.classbin0 -> 1272 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLServerSocketFactory.classbin0 -> 2694 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLSession.classbin0 -> 1067 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLSessionBindingEvent.classbin0 -> 852 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLSessionBindingListener.classbin0 -> 264 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLSessionContext.classbin0 -> 357 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLSocket.classbin0 -> 1795 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/SSLSocketFactory.classbin0 -> 2826 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/TrivialHostnameVerifier.classbin0 -> 568 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/TrustManager.classbin0 -> 119 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/TrustManagerFactory$1.classbin0 -> 727 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/TrustManagerFactory.classbin0 -> 4189 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/TrustManagerFactorySpi.classbin0 -> 619 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/X509ExtendedKeyManager.classbin0 -> 912 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/X509KeyManager.classbin0 -> 665 bytes
-rw-r--r--libjava/classpath/lib/javax/net/ssl/X509TrustManager.classbin0 -> 429 bytes
-rw-r--r--libjava/classpath/lib/javax/print/AttributeException.classbin0 -> 257 bytes
-rw-r--r--libjava/classpath/lib/javax/print/CancelablePrintJob.classbin0 -> 238 bytes
-rw-r--r--libjava/classpath/lib/javax/print/Doc.classbin0 -> 434 bytes
-rw-r--r--libjava/classpath/lib/javax/print/DocFlavor$BYTE_ARRAY.classbin0 -> 2275 bytes
-rw-r--r--libjava/classpath/lib/javax/print/DocFlavor$CHAR_ARRAY.classbin0 -> 758 bytes
-rw-r--r--libjava/classpath/lib/javax/print/DocFlavor$INPUT_STREAM.classbin0 -> 2298 bytes
-rw-r--r--libjava/classpath/lib/javax/print/DocFlavor$READER.classbin0 -> 758 bytes
-rw-r--r--libjava/classpath/lib/javax/print/DocFlavor$SERVICE_FORMATTED.classbin0 -> 910 bytes
-rw-r--r--libjava/classpath/lib/javax/print/DocFlavor$STRING.classbin0 -> 760 bytes
-rw-r--r--libjava/classpath/lib/javax/print/DocFlavor$URL.classbin0 -> 2264 bytes
-rw-r--r--libjava/classpath/lib/javax/print/DocFlavor.classbin0 -> 5538 bytes
-rw-r--r--libjava/classpath/lib/javax/print/DocPrintJob.classbin0 -> 719 bytes
-rw-r--r--libjava/classpath/lib/javax/print/FlavorException.classbin0 -> 184 bytes
-rw-r--r--libjava/classpath/lib/javax/print/MultiDoc.classbin0 -> 248 bytes
-rw-r--r--libjava/classpath/lib/javax/print/MultiDocPrintJob.classbin0 -> 303 bytes
-rw-r--r--libjava/classpath/lib/javax/print/MultiDocPrintService.classbin0 -> 233 bytes
-rw-r--r--libjava/classpath/lib/javax/print/PrintException.classbin0 -> 788 bytes
-rw-r--r--libjava/classpath/lib/javax/print/PrintService.classbin0 -> 1813 bytes
-rw-r--r--libjava/classpath/lib/javax/print/PrintServiceLookup.classbin0 -> 3781 bytes
-rw-r--r--libjava/classpath/lib/javax/print/ServiceUI.classbin0 -> 1871 bytes
-rw-r--r--libjava/classpath/lib/javax/print/ServiceUIFactory.classbin0 -> 814 bytes
-rw-r--r--libjava/classpath/lib/javax/print/SimpleDoc.classbin0 -> 2719 bytes
-rw-r--r--libjava/classpath/lib/javax/print/StreamPrintService.classbin0 -> 779 bytes
-rw-r--r--libjava/classpath/lib/javax/print/StreamPrintServiceFactory.classbin0 -> 1596 bytes
-rw-r--r--libjava/classpath/lib/javax/print/URIException.classbin0 -> 333 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/Attribute.classbin0 -> 312 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/AttributeSet.classbin0 -> 706 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedAttributeSet.classbin0 -> 2396 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedDocAttributeSet.classbin0 -> 776 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedPrintJobAttributeSet.classbin0 -> 806 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedPrintRequestAttributeSet.classbin0 -> 830 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedPrintServiceAttributeSet.classbin0 -> 830 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiableAttributeSet.classbin0 -> 2385 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiableDocAttributeSet.classbin0 -> 776 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiablePrintJobAttributeSet.classbin0 -> 806 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiablePrintRequestAttributeSet.classbin0 -> 830 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiablePrintServiceAttributeSet.classbin0 -> 830 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities.classbin0 -> 4904 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/DateTimeSyntax.classbin0 -> 1129 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/DocAttribute.classbin0 -> 166 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/DocAttributeSet.classbin0 -> 287 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/EnumSyntax.classbin0 -> 1919 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/HashAttributeSet.classbin0 -> 6236 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/HashDocAttributeSet.classbin0 -> 1266 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/HashPrintJobAttributeSet.classbin0 -> 1321 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/HashPrintRequestAttributeSet.classbin0 -> 1365 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/HashPrintServiceAttributeSet.classbin0 -> 1365 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/IntegerSyntax.classbin0 -> 1215 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/PrintJobAttribute.classbin0 -> 176 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/PrintJobAttributeSet.classbin0 -> 297 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/PrintRequestAttribute.classbin0 -> 184 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/PrintRequestAttributeSet.classbin0 -> 305 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/PrintServiceAttribute.classbin0 -> 184 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/PrintServiceAttributeSet.classbin0 -> 305 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/ResolutionSyntax.classbin0 -> 2590 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/SetOfIntegerSyntax$1.classbin0 -> 745 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/SetOfIntegerSyntax.classbin0 -> 5008 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/Size2DSyntax.classbin0 -> 2497 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/SupportedValuesAttribute.classbin0 -> 190 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/TextSyntax.classbin0 -> 1403 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/URISyntax.classbin0 -> 1100 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/UnmodifiableSetException.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/Chromaticity.classbin0 -> 1462 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/ColorSupported.classbin0 -> 1410 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/Compression.classbin0 -> 1505 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/Copies.classbin0 -> 1081 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/CopiesSupported.classbin0 -> 1274 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/DateTimeAtCompleted.classbin0 -> 985 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/DateTimeAtCreation.classbin0 -> 981 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/DateTimeAtProcessing.classbin0 -> 989 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/Destination.classbin0 -> 1001 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/DocumentName.classbin0 -> 1016 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/Fidelity.classbin0 -> 1432 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/Finishings.classbin0 -> 3008 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobHoldUntil.classbin0 -> 1007 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobImpressions.classbin0 -> 1113 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobImpressionsCompleted.classbin0 -> 1099 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobImpressionsSupported.classbin0 -> 1147 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobKOctets.classbin0 -> 1098 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobKOctetsProcessed.classbin0 -> 1084 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobKOctetsSupported.classbin0 -> 1132 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobMediaSheets.classbin0 -> 1114 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobMediaSheetsCompleted.classbin0 -> 1100 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobMediaSheetsSupported.classbin0 -> 1148 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobMessageFromOperator.classbin0 -> 1058 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobName.classbin0 -> 1047 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobOriginatingUserName.classbin0 -> 1059 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobPriority.classbin0 -> 1098 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobPrioritySupported.classbin0 -> 1091 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobSheets.classbin0 -> 1400 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobState.classbin0 -> 1864 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobStateReason.classbin0 -> 4071 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/JobStateReasons.classbin0 -> 2137 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/Media.classbin0 -> 1073 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/MediaName.classbin0 -> 1275 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/MediaPrintableArea.classbin0 -> 3086 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/MediaSize$Engineering.classbin0 -> 1050 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/MediaSize$ISO.classbin0 -> 2547 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/MediaSize$JIS.classbin0 -> 2622 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/MediaSize$NA.classbin0 -> 2218 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/MediaSize$Other.classbin0 -> 1602 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/MediaSize.classbin0 -> 3575 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/MediaSizeName.classbin0 -> 6466 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/MediaTray.classbin0 -> 1465 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/MultipleDocumentHandling.classbin0 -> 1826 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/NumberOfDocuments.classbin0 -> 1075 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/NumberOfInterveningJobs.classbin0 -> 1100 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/NumberUp.classbin0 -> 1001 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/NumberUpSupported.classbin0 -> 1486 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/OrientationRequested.classbin0 -> 1800 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/OutputDeviceAssigned.classbin0 -> 1052 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PDLOverrideSupported.classbin0 -> 1449 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PageRanges.classbin0 -> 1667 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PagesPerMinute.classbin0 -> 1067 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PagesPerMinuteColor.classbin0 -> 1088 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PresentationDirection.classbin0 -> 2046 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PrintQuality.classbin0 -> 1592 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PrinterInfo.classbin0 -> 1020 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PrinterIsAcceptingJobs.classbin0 -> 1484 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PrinterLocation.classbin0 -> 1040 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PrinterMakeAndModel.classbin0 -> 1055 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PrinterMessageFromOperator.classbin0 -> 1078 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PrinterMoreInfo.classbin0 -> 961 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PrinterMoreInfoManufacturer.classbin0 -> 1010 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PrinterName.classbin0 -> 1020 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PrinterResolution.classbin0 -> 1103 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PrinterState.classbin0 -> 1540 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PrinterStateReason.classbin0 -> 4201 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PrinterStateReasons.classbin0 -> 3545 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/PrinterURI.classbin0 -> 940 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/QueuedJobCount.classbin0 -> 1067 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/ReferenceUriSchemesSupported.classbin0 -> 1860 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/RequestingUserName.classbin0 -> 1046 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/Severity.classbin0 -> 1400 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/SheetCollate.classbin0 -> 1481 bytes
-rw-r--r--libjava/classpath/lib/javax/print/attribute/standard/Sides.classbin0 -> 1662 bytes
-rw-r--r--libjava/classpath/lib/javax/print/event/PrintEvent.classbin0 -> 704 bytes
-rw-r--r--libjava/classpath/lib/javax/print/event/PrintJobAdapter.classbin0 -> 973 bytes
-rw-r--r--libjava/classpath/lib/javax/print/event/PrintJobAttributeEvent.classbin0 -> 953 bytes
-rw-r--r--libjava/classpath/lib/javax/print/event/PrintJobAttributeListener.classbin0 -> 223 bytes
-rw-r--r--libjava/classpath/lib/javax/print/event/PrintJobEvent.classbin0 -> 1029 bytes
-rw-r--r--libjava/classpath/lib/javax/print/event/PrintJobListener.classbin0 -> 354 bytes
-rw-r--r--libjava/classpath/lib/javax/print/event/PrintServiceAttributeEvent.classbin0 -> 921 bytes
-rw-r--r--libjava/classpath/lib/javax/print/event/PrintServiceAttributeListener.classbin0 -> 235 bytes
-rw-r--r--libjava/classpath/lib/javax/rmi/CORBA/ClassDesc.classbin0 -> 432 bytes
-rw-r--r--libjava/classpath/lib/javax/rmi/CORBA/PortableRemoteObjectDelegate.classbin0 -> 576 bytes
-rw-r--r--libjava/classpath/lib/javax/rmi/CORBA/Stub.classbin0 -> 2763 bytes
-rw-r--r--libjava/classpath/lib/javax/rmi/CORBA/StubDelegate.classbin0 -> 652 bytes
-rw-r--r--libjava/classpath/lib/javax/rmi/CORBA/Tie.classbin0 -> 437 bytes
-rw-r--r--libjava/classpath/lib/javax/rmi/CORBA/Util.classbin0 -> 3292 bytes
-rw-r--r--libjava/classpath/lib/javax/rmi/CORBA/UtilDelegate.classbin0 -> 1285 bytes
-rw-r--r--libjava/classpath/lib/javax/rmi/CORBA/ValueHandler.classbin0 -> 616 bytes
-rw-r--r--libjava/classpath/lib/javax/rmi/CORBA/ValueHandlerMultiFormat.classbin0 -> 312 bytes
-rw-r--r--libjava/classpath/lib/javax/rmi/PortableRemoteObject.classbin0 -> 1607 bytes
-rw-r--r--libjava/classpath/lib/javax/rmi/ssl/SslRMIClientSocketFactory.classbin0 -> 2635 bytes
-rw-r--r--libjava/classpath/lib/javax/rmi/ssl/SslRMIServerSocketFactory.classbin0 -> 2688 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/AuthPermission.classbin0 -> 530 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/DestroyFailedException.classbin0 -> 479 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/Destroyable.classbin0 -> 246 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/Policy.classbin0 -> 1059 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/PrivateCredentialPermission$CredOwner.classbin0 -> 1186 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/PrivateCredentialPermission.classbin0 -> 3273 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/RefreshFailedException.classbin0 -> 479 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/Refreshable.classbin0 -> 244 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/Subject$SecureSet.classbin0 -> 4086 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/Subject.classbin0 -> 6981 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/SubjectDomainCombiner.classbin0 -> 1805 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/callback/Callback.classbin0 -> 126 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/callback/CallbackHandler.classbin0 -> 316 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/callback/ChoiceCallback.classbin0 -> 2286 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/callback/ConfirmationCallback.classbin0 -> 3748 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/callback/LanguageCallback.classbin0 -> 664 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/callback/NameCallback.classbin0 -> 1477 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/callback/PasswordCallback.classbin0 -> 1467 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/callback/TextInputCallback.classbin0 -> 1502 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/callback/TextOutputCallback.classbin0 -> 1226 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/callback/UnsupportedCallbackException.classbin0 -> 847 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/kerberos/DelegationPermission$1.classbin0 -> 1699 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/kerberos/DelegationPermission.classbin0 -> 1471 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/kerberos/KerberosKey.classbin0 -> 2715 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/kerberos/KerberosPrincipal.classbin0 -> 2656 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/kerberos/KerberosTicket.classbin0 -> 4697 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/kerberos/KeyImpl.classbin0 -> 1062 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/kerberos/ServicePermission$1.classbin0 -> 1681 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/kerberos/ServicePermission.classbin0 -> 2220 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/AccountException.classbin0 -> 558 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/AccountExpiredException.classbin0 -> 581 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/AccountLockedException.classbin0 -> 578 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/AccountNotFoundException.classbin0 -> 584 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/AppConfigurationEntry$LoginModuleControlFlag.classbin0 -> 923 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/AppConfigurationEntry.classbin0 -> 2363 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/Configuration$1.classbin0 -> 747 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/Configuration.classbin0 -> 1789 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/CredentialException.classbin0 -> 567 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/CredentialExpiredException.classbin0 -> 593 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/CredentialNotFoundException.classbin0 -> 596 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/FailedLoginException.classbin0 -> 570 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/LoginContext.classbin0 -> 6202 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/LoginException.classbin0 -> 550 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/login/NullConfiguration.classbin0 -> 629 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/spi/LoginModule.classbin0 -> 603 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/x500/X500Principal.classbin0 -> 11344 bytes
-rw-r--r--libjava/classpath/lib/javax/security/auth/x500/X500PrivateCredential.classbin0 -> 1459 bytes
-rw-r--r--libjava/classpath/lib/javax/security/cert/Certificate.classbin0 -> 1354 bytes
-rw-r--r--libjava/classpath/lib/javax/security/cert/CertificateEncodingException.classbin0 -> 514 bytes
-rw-r--r--libjava/classpath/lib/javax/security/cert/CertificateException.classbin0 -> 469 bytes
-rw-r--r--libjava/classpath/lib/javax/security/cert/CertificateExpiredException.classbin0 -> 511 bytes
-rw-r--r--libjava/classpath/lib/javax/security/cert/CertificateNotYetValidException.classbin0 -> 523 bytes
-rw-r--r--libjava/classpath/lib/javax/security/cert/CertificateParsingException.classbin0 -> 511 bytes
-rw-r--r--libjava/classpath/lib/javax/security/cert/X509CertBridge.classbin0 -> 3538 bytes
-rw-r--r--libjava/classpath/lib/javax/security/cert/X509Certificate.classbin0 -> 1891 bytes
-rw-r--r--libjava/classpath/lib/javax/security/sasl/AuthenticationException.classbin0 -> 666 bytes
-rw-r--r--libjava/classpath/lib/javax/security/sasl/AuthorizeCallback.classbin0 -> 1357 bytes
-rw-r--r--libjava/classpath/lib/javax/security/sasl/RealmCallback.classbin0 -> 555 bytes
-rw-r--r--libjava/classpath/lib/javax/security/sasl/RealmChoiceCallback.classbin0 -> 534 bytes
-rw-r--r--libjava/classpath/lib/javax/security/sasl/Sasl.classbin0 -> 6585 bytes
-rw-r--r--libjava/classpath/lib/javax/security/sasl/SaslClient.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/javax/security/sasl/SaslClientFactory.classbin0 -> 742 bytes
-rw-r--r--libjava/classpath/lib/javax/security/sasl/SaslException.classbin0 -> 1813 bytes
-rw-r--r--libjava/classpath/lib/javax/security/sasl/SaslServer.classbin0 -> 495 bytes
-rw-r--r--libjava/classpath/lib/javax/security/sasl/SaslServerFactory.classbin0 -> 704 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/ControllerEventListener.classbin0 -> 236 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/Instrument.classbin0 -> 959 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/InvalidMidiDataException.classbin0 -> 537 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/MetaEventListener.classbin0 -> 214 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/MetaMessage.classbin0 -> 2002 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/MidiChannel.classbin0 -> 715 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/MidiDevice$Info.classbin0 -> 1283 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/MidiDevice.classbin0 -> 621 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/MidiEvent.classbin0 -> 734 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/MidiFileFormat.classbin0 -> 1095 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/MidiMessage.classbin0 -> 1052 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/MidiSystem.classbin0 -> 8221 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/MidiUnavailableException.classbin0 -> 537 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/Patch.classbin0 -> 550 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/Receiver.classbin0 -> 248 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/Sequence.classbin0 -> 3224 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/Sequencer$SyncMode.classbin0 -> 1124 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/Sequencer.classbin0 -> 1751 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/ShortMessage.classbin0 -> 3400 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/Soundbank.classbin0 -> 430 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/SoundbankResource.classbin0 -> 1130 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/Synthesizer.classbin0 -> 1039 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/SysexMessage.classbin0 -> 1753 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/Track.classbin0 -> 2021 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/Transmitter.classbin0 -> 251 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/VoiceStatus.classbin0 -> 518 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/spi/MidiDeviceProvider.classbin0 -> 927 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/spi/MidiFileReader.classbin0 -> 856 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/spi/MidiFileWriter.classbin0 -> 1011 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/midi/spi/SoundbankReader.classbin0 -> 620 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/AudioFileFormat$Type.classbin0 -> 1402 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/AudioFileFormat.classbin0 -> 2977 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/AudioFormat$Encoding.classbin0 -> 1111 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/AudioFormat.classbin0 -> 3884 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/AudioInputStream$TargetInputStream.classbin0 -> 992 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/AudioInputStream.classbin0 -> 2914 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/AudioPermission.classbin0 -> 597 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/AudioSystem.classbin0 -> 11940 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/BooleanControl$Type.classbin0 -> 659 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/BooleanControl.classbin0 -> 1626 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/Clip.classbin0 -> 615 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/CompoundControl$Type.classbin0 -> 476 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/CompoundControl.classbin0 -> 1195 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/Control$Type.classbin0 -> 783 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/Control.classbin0 -> 705 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/DataLine$Info.classbin0 -> 2896 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/DataLine.classbin0 -> 570 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/EnumControl$Type.classbin0 -> 584 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/EnumControl.classbin0 -> 1633 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/FloatControl$Type.classbin0 -> 1080 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/FloatControl.classbin0 -> 2914 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/Line$Info.classbin0 -> 995 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/Line.classbin0 -> 683 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/LineEvent$Type.classbin0 -> 1067 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/LineEvent.classbin0 -> 1926 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/LineListener.classbin0 -> 210 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/LineUnavailableException.classbin0 -> 545 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/Mixer$Info.classbin0 -> 1545 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/Mixer.classbin0 -> 995 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/Port$Info.classbin0 -> 2235 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/Port.classbin0 -> 214 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/ReverbType.classbin0 -> 2055 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/SourceDataLine.classbin0 -> 376 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/TargetDataLine.classbin0 -> 375 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/UnsupportedAudioFileException.classbin0 -> 560 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/spi/AudioFileReader.classbin0 -> 931 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/spi/AudioFileWriter.classbin0 -> 1500 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/spi/FormatConversionProvider.classbin0 -> 2222 bytes
-rw-r--r--libjava/classpath/lib/javax/sound/sampled/spi/MixerProvider.classbin0 -> 839 bytes
-rw-r--r--libjava/classpath/lib/javax/sql/ConnectionEvent.classbin0 -> 771 bytes
-rw-r--r--libjava/classpath/lib/javax/sql/ConnectionEventListener.classbin0 -> 262 bytes
-rw-r--r--libjava/classpath/lib/javax/sql/ConnectionPoolDataSource.classbin0 -> 543 bytes
-rw-r--r--libjava/classpath/lib/javax/sql/DataSource.classbin0 -> 495 bytes
-rw-r--r--libjava/classpath/lib/javax/sql/PooledConnection.classbin0 -> 373 bytes
-rw-r--r--libjava/classpath/lib/javax/sql/RowSet.classbin0 -> 2753 bytes
-rw-r--r--libjava/classpath/lib/javax/sql/RowSetEvent.classbin0 -> 370 bytes
-rw-r--r--libjava/classpath/lib/javax/sql/RowSetInternal.classbin0 -> 429 bytes
-rw-r--r--libjava/classpath/lib/javax/sql/RowSetListener.classbin0 -> 246 bytes
-rw-r--r--libjava/classpath/lib/javax/sql/RowSetMetaData.classbin0 -> 824 bytes
-rw-r--r--libjava/classpath/lib/javax/sql/RowSetReader.classbin0 -> 216 bytes
-rw-r--r--libjava/classpath/lib/javax/sql/RowSetWriter.classbin0 -> 217 bytes
-rw-r--r--libjava/classpath/lib/javax/sql/XAConnection.classbin0 -> 261 bytes
-rw-r--r--libjava/classpath/lib/javax/sql/XADataSource.classbin0 -> 507 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/AbstractAction.classbin0 -> 3209 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/AbstractButton$1.classbin0 -> 1793 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/AbstractButton$AccessibleAbstractButton.classbin0 -> 8947 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/AbstractButton$ButtonChangeListener.classbin0 -> 954 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/AbstractButton$EventHandler.classbin0 -> 1356 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/AbstractButton.classbin0 -> 20618 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/AbstractCellEditor.classbin0 -> 2259 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/AbstractListModel.classbin0 -> 2498 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/AbstractSpinnerModel.classbin0 -> 1771 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Action.classbin0 -> 861 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ActionMap.classbin0 -> 2209 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/BorderFactory.classbin0 -> 4962 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/BoundedRangeModel.classbin0 -> 514 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Box$AccessibleBox.classbin0 -> 662 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Box$Filler$AccessibleBoxFiller.classbin0 -> 753 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Box$Filler.classbin0 -> 1392 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Box.classbin0 -> 2326 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/BoxLayout.classbin0 -> 5920 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ButtonGroup.classbin0 -> 2388 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ButtonModel.classbin0 -> 857 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/CellEditor.classbin0 -> 423 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/CellRendererPane$AccessibleCellRendererPane.classbin0 -> 878 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/CellRendererPane.classbin0 -> 2772 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ComboBoxEditor.classbin0 -> 380 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ComboBoxModel.classbin0 -> 247 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/CompatibilityFocusTraversalPolicy.classbin0 -> 2190 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ComponentInputMap.classbin0 -> 1635 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DebugGraphics.classbin0 -> 14084 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultBoundedRangeModel.classbin0 -> 5095 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultButtonModel.classbin0 -> 6192 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultCellEditor$EditorDelegate.classbin0 -> 2576 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultCellEditor$JCheckBoxDelegate.classbin0 -> 1387 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultCellEditor$JComboBoxDelegate.classbin0 -> 1514 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultCellEditor$JTextFieldDelegate.classbin0 -> 1367 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultCellEditor.classbin0 -> 3457 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultComboBoxModel.classbin0 -> 2973 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultDesktopManager.classbin0 -> 7571 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultFocusManager.classbin0 -> 1469 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultListCellRenderer$UIResource.classbin0 -> 442 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultListCellRenderer.classbin0 -> 3535 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultListModel.classbin0 -> 4580 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultListSelectionModel.classbin0 -> 8540 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DefaultSingleSelectionModel.classbin0 -> 2350 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/DesktopManager.classbin0 -> 651 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/FocusManager$WrappingFocusManager.classbin0 -> 5486 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/FocusManager.classbin0 -> 1199 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/GrayFilter.classbin0 -> 1375 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Icon.classbin0 -> 221 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ImageIcon$1.classbin0 -> 372 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ImageIcon$AccessibleImageIcon.classbin0 -> 2147 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ImageIcon.classbin0 -> 4406 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/InputMap.classbin0 -> 2530 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/InputVerifier.classbin0 -> 479 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/InternalFrameFocusTraversalPolicy.classbin0 -> 624 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JApplet$AccessibleJApplet.classbin0 -> 509 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JApplet.classbin0 -> 4021 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JButton$AccessibleJButton.classbin0 -> 753 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JButton.classbin0 -> 3347 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JCheckBox$AccessibleJCheckBox.classbin0 -> 770 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JCheckBox.classbin0 -> 2782 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem.classbin0 -> 894 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JCheckBoxMenuItem.classbin0 -> 2645 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JColorChooser$AccessibleJColorChooser.classbin0 -> 865 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JColorChooser$DefaultOKCancelListener.classbin0 -> 769 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JColorChooser$DefaultResetListener.classbin0 -> 876 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JColorChooser.classbin0 -> 8097 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JComboBox$1.classbin0 -> 997 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JComboBox$AccessibleJComboBox.classbin0 -> 3980 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JComboBox$DefaultKeySelectionManager.classbin0 -> 1348 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JComboBox$KeySelectionManager.classbin0 -> 271 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JComboBox.classbin0 -> 15989 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JComponent$1.classbin0 -> 586 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JComponent$AccessibleJComponent$AccessibleContainerHandler.classbin0 -> 1529 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JComponent$AccessibleJComponent$AccessibleFocusHandler.classbin0 -> 1215 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JComponent$AccessibleJComponent.classbin0 -> 4520 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JComponent$ActionListenerProxy.classbin0 -> 1101 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JComponent.classbin0 -> 36725 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JDesktopPane$AccessibleJDesktopPane.classbin0 -> 855 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JDesktopPane.classbin0 -> 4836 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JDialog$AccessibleJDialog.classbin0 -> 506 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JDialog.classbin0 -> 6937 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JEditorPane$1.classbin0 -> 914 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JEditorPane$2.classbin0 -> 971 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JEditorPane$AccessibleJEditorPane.classbin0 -> 999 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JEditorPane$AccessibleJEditorPaneHTML.classbin0 -> 738 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JEditorPane$EditorKitMapping.classbin0 -> 603 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport$HTMLLink.classbin0 -> 3759 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport.classbin0 -> 3232 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JEditorPane$PageLoader.classbin0 -> 2158 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JEditorPane$PageStream.classbin0 -> 1492 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JEditorPane$PlainEditorKit.classbin0 -> 674 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JEditorPane.classbin0 -> 12028 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JFileChooser$1.classbin0 -> 744 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JFileChooser$AccessibleJFileChooser.classbin0 -> 791 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JFileChooser.classbin0 -> 18403 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JFormattedTextField$AbstractFormatter.classbin0 -> 2454 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JFormattedTextField$AbstractFormatterFactory.classbin0 -> 567 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JFormattedTextField.classbin0 -> 5767 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JFrame$AccessibleJFrame.classbin0 -> 494 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JFrame.classbin0 -> 7071 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JInternalFrame$AccessibleJInternalFrame.classbin0 -> 1792 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JInternalFrame$JDesktopIcon$AccessibleJDesktopIcon.classbin0 -> 1831 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JInternalFrame$JDesktopIcon.classbin0 -> 2259 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JInternalFrame.classbin0 -> 17072 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JLabel$AccessibleJLabel.classbin0 -> 5379 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JLabel.classbin0 -> 8529 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JLayeredPane$AccessibleJLayeredPane.classbin0 -> 791 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JLayeredPane.classbin0 -> 8209 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JList$1.classbin0 -> 790 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JList$2.classbin0 -> 846 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JList$3.classbin0 -> 829 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JList$AccessibleJList$AccessibleJListChild.classbin0 -> 6064 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JList$AccessibleJList.classbin0 -> 4910 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JList$ListListener.classbin0 -> 1488 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JList.classbin0 -> 18892 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JMenu$AccessibleJMenu.classbin0 -> 3677 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JMenu$ActionChangedListener.classbin0 -> 1012 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JMenu$MenuChangeListener.classbin0 -> 1143 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JMenu$WinListener.classbin0 -> 811 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JMenu.classbin0 -> 14040 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JMenuBar$AccessibleJMenuBar.classbin0 -> 2223 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JMenuBar.classbin0 -> 7798 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JMenuItem$1.classbin0 -> 997 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JMenuItem$AccessibleJMenuItem.classbin0 -> 2194 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JMenuItem.classbin0 -> 10317 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JOptionPane$1.classbin0 -> 441 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JOptionPane$2.classbin0 -> 447 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JOptionPane$AccessibleJOptionPane.classbin0 -> 845 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JOptionPane$ValuePropertyHandler.classbin0 -> 1144 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JOptionPane.classbin0 -> 17932 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JPanel$AccessibleJPanel.classbin0 -> 730 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JPanel.classbin0 -> 1964 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JPasswordField$AccessibleJPasswordField.classbin0 -> 874 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JPasswordField.classbin0 -> 3032 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JPopupMenu$1.classbin0 -> 592 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JPopupMenu$2.classbin0 -> 639 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JPopupMenu$AccessibleJPopupMenu.classbin0 -> 835 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JPopupMenu$ActionChangeListener.classbin0 -> 833 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JPopupMenu$Separator.classbin0 -> 503 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JPopupMenu.classbin0 -> 12623 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JProgressBar$1.classbin0 -> 780 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JProgressBar$AccessibleJProgressBar.classbin0 -> 2399 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JProgressBar.classbin0 -> 7973 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JRadioButton$AccessibleJRadioButton.classbin0 -> 864 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JRadioButton.classbin0 -> 2256 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JRadioButtonMenuItem$AccessibleJRadioButtonMenuItem.classbin0 -> 924 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JRadioButtonMenuItem.classbin0 -> 2374 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JRootPane$AccessibleJRootPane.classbin0 -> 825 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JRootPane$RootLayout.classbin0 -> 3577 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JRootPane.classbin0 -> 6631 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JScrollBar$AccessibleJScrollBar.classbin0 -> 2501 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JScrollBar$ScrollBarChangeListener.classbin0 -> 1222 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JScrollBar.classbin0 -> 7898 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JScrollPane$AccessibleJScrollPane.classbin0 -> 1495 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JScrollPane$ScrollBar.classbin0 -> 1423 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JScrollPane.classbin0 -> 10207 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSeparator$AccessibleJSeparator.classbin0 -> 834 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSeparator.classbin0 -> 2623 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSlider$1.classbin0 -> 750 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSlider$AccessibleJSlider.classbin0 -> 2348 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSlider$LabelUIResource.classbin0 -> 672 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSlider.classbin0 -> 11001 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSpinner$DateEditor.classbin0 -> 2032 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSpinner$DateEditorFormatter.classbin0 -> 708 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSpinner$DefaultEditor.classbin0 -> 3921 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSpinner$ListEditor.classbin0 -> 693 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSpinner$ModelListener.classbin0 -> 704 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSpinner$NumberEditor.classbin0 -> 2057 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSpinner$NumberEditorFormatter.classbin0 -> 722 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSpinner.classbin0 -> 4828 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSplitPane$AccessibleJSplitPane.classbin0 -> 2425 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JSplitPane.classbin0 -> 9784 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTabbedPane$AccessibleJTabbedPane.classbin0 -> 3122 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTabbedPane$ModelListener.classbin0 -> 810 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTabbedPane$Page.classbin0 -> 5502 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTabbedPane.classbin0 -> 14724 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleJTableCell.classbin0 -> 6478 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleJTableHeaderCell.classbin0 -> 5760 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleJTableModelChange.classbin0 -> 1316 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleTableHeader.classbin0 -> 4585 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTable$AccessibleJTable.classbin0 -> 13524 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTable$BooleanCellRenderer.classbin0 -> 2085 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTable$DateCellRenderer.classbin0 -> 1275 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTable$DoubleCellRenderer.classbin0 -> 1221 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTable$FloatCellRenderer.classbin0 -> 1216 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTable$IconCellRenderer.classbin0 -> 1086 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTable$NumberCellRenderer.classbin0 -> 543 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTable$TableColumnPropertyChangeHandler.classbin0 -> 1405 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTable$TableTextField.classbin0 -> 686 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTable.classbin0 -> 37074 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTextArea$AccessibleJTextArea.classbin0 -> 768 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTextArea.classbin0 -> 7526 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTextField$1.classbin0 -> 791 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTextField$2.classbin0 -> 1275 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTextField$AccessibleJTextField.classbin0 -> 841 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTextField.classbin0 -> 8146 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTextPane.classbin0 -> 6360 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JToggleButton$AccessibleJToggleButton.classbin0 -> 1479 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JToggleButton$ToggleButtonModel.classbin0 -> 1280 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JToggleButton.classbin0 -> 2541 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JToolBar$AccessibleJToolBar.classbin0 -> 955 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JToolBar$DefaultToolBarLayout.classbin0 -> 3238 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JToolBar$Separator.classbin0 -> 1172 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JToolBar.classbin0 -> 6886 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JToolTip$AccessibleJToolTip.classbin0 -> 1019 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JToolTip.classbin0 -> 2448 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTree$AccessibleJTree$AccessibleJTreeNode.classbin0 -> 11937 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTree$AccessibleJTree.classbin0 -> 4836 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTree$DynamicUtilTreeNode.classbin0 -> 2406 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTree$EmptySelectionModel.classbin0 -> 1021 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTree$TreeModelHandler.classbin0 -> 3080 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTree$TreeSelectionRedirector.classbin0 -> 980 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JTree.classbin0 -> 29327 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JViewport$AccessibleJViewport.classbin0 -> 760 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JViewport$ViewListener.classbin0 -> 809 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JViewport.classbin0 -> 12807 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JWindow$AccessibleJWindow.classbin0 -> 506 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/JWindow.classbin0 -> 4615 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/KeyStroke.classbin0 -> 2011 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/KeyboardManager.classbin0 -> 4273 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/LayoutFocusTraversalPolicy$LayoutComparator.classbin0 -> 951 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/LayoutFocusTraversalPolicy.classbin0 -> 602 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ListCellRenderer.classbin0 -> 229 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ListModel.classbin0 -> 287 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ListSelectionModel.classbin0 -> 1007 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/LookAndFeel$1.classbin0 -> 852 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/LookAndFeel.classbin0 -> 5733 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/MenuElement.classbin0 -> 495 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/MenuSelectionManager.classbin0 -> 6636 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/MutableComboBoxModel.classbin0 -> 319 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/OverlayLayout.classbin0 -> 4409 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Popup$JWindowPopup.classbin0 -> 1314 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Popup$LightweightPopup.classbin0 -> 2173 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Popup.classbin0 -> 817 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/PopupFactory.classbin0 -> 1903 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ProgressMonitor$1.classbin0 -> 742 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ProgressMonitor$TimerListener.classbin0 -> 1671 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ProgressMonitor.classbin0 -> 3912 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ProgressMonitorInputStream.classbin0 -> 2495 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Renderer.classbin0 -> 201 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/RepaintManager$RepaintWorker.classbin0 -> 1299 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/RepaintManager$RepaintWorkerEvent.classbin0 -> 751 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/RepaintManager.classbin0 -> 9873 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/RootPaneContainer.classbin0 -> 488 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ScrollPaneConstants.classbin0 -> 1079 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ScrollPaneLayout$UIResource.classbin0 -> 414 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ScrollPaneLayout.classbin0 -> 7677 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Scrollable.classbin0 -> 379 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SingleSelectionModel.classbin0 -> 357 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SizeRequirements.classbin0 -> 5413 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SizeSequence.classbin0 -> 2218 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SortingFocusTraversalPolicy.classbin0 -> 3700 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SpinnerDateModel.classbin0 -> 2933 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SpinnerListModel.classbin0 -> 2285 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SpinnerModel.classbin0 -> 351 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SpinnerNumberModel.classbin0 -> 3988 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Spring$1.classbin0 -> 1114 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Spring$2.classbin0 -> 1218 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Spring$3.classbin0 -> 1218 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Spring$AddSpring.classbin0 -> 1822 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Spring$MaxSpring.classbin0 -> 1860 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Spring$MinusSpring.classbin0 -> 1225 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Spring$SimpleSpring.classbin0 -> 1250 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Spring.classbin0 -> 2675 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SpringLayout$Constraints.classbin0 -> 4240 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SpringLayout$DeferredDimension.classbin0 -> 683 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SpringLayout$DeferredHeight.classbin0 -> 1175 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SpringLayout$DeferredSpring.classbin0 -> 1875 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SpringLayout$DeferredWidth.classbin0 -> 1169 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SpringLayout.classbin0 -> 5789 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SwingConstants.classbin0 -> 694 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SwingUtilities$OwnerFrame.classbin0 -> 659 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/SwingUtilities.classbin0 -> 19713 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Timer$1.classbin0 -> 557 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Timer$Task.classbin0 -> 906 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/Timer.classbin0 -> 4981 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ToolTipManager$insideTimerAction.classbin0 -> 737 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ToolTipManager$outsideTimerAction.classbin0 -> 709 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ToolTipManager$stillInsideTimerAction.classbin0 -> 752 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ToolTipManager.classbin0 -> 7320 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/TransferHandler$PropertyTransferable.classbin0 -> 2735 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/TransferHandler$TransferAction.classbin0 -> 2022 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/TransferHandler.classbin0 -> 6249 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/UIDefaults$1.classbin0 -> 1211 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/UIDefaults$2.classbin0 -> 1308 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/UIDefaults$3.classbin0 -> 1379 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/UIDefaults$4.classbin0 -> 1477 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/UIDefaults$ActiveValue.classbin0 -> 267 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/UIDefaults$LazyInputMap.classbin0 -> 1156 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/UIDefaults$LazyValue.classbin0 -> 263 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/UIDefaults$ProxyLazyValue.classbin0 -> 2228 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/UIDefaults.classbin0 -> 9901 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/UIManager$LookAndFeelInfo.classbin0 -> 1148 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/UIManager$MultiplexUIDefaults$MultiplexEnumeration.classbin0 -> 1221 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/UIManager$MultiplexUIDefaults.classbin0 -> 1632 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/UIManager.classbin0 -> 9920 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/UnsupportedLookAndFeelException.classbin0 -> 403 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/ViewportLayout.classbin0 -> 2485 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/WindowConstants.classbin0 -> 300 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/border/AbstractBorder.classbin0 -> 1795 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/border/BevelBorder.classbin0 -> 4286 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/border/Border.classbin0 -> 282 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/border/CompoundBorder.classbin0 -> 2225 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/border/EmptyBorder.classbin0 -> 1568 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/border/EtchedBorder.classbin0 -> 3182 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/border/LineBorder.classbin0 -> 2689 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/border/MatteBorder.classbin0 -> 3754 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/border/SoftBevelBorder.classbin0 -> 2794 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/border/TitledBorder.classbin0 -> 9912 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/AbstractColorChooserPanel.classbin0 -> 1582 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/ColorChooserComponentFactory.classbin0 -> 1014 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/ColorSelectionModel.classbin0 -> 340 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultColorSelectionModel.classbin0 -> 2281 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$1.classbin0 -> 1434 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$2.classbin0 -> 1077 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$ImageScrollListener.classbin0 -> 1825 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$MainGradientMouseListener.classbin0 -> 2513 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$RadioStateListener.classbin0 -> 1503 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$SliderChangeListener.classbin0 -> 1353 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel.classbin0 -> 9940 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultPreviewPanel$PreviewBorder.classbin0 -> 2020 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultPreviewPanel.classbin0 -> 4044 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultRGBChooserPanel$SliderHandler.classbin0 -> 1333 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultRGBChooserPanel$SpinnerHandler.classbin0 -> 1517 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultRGBChooserPanel.classbin0 -> 5019 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$MainPanelLayout.classbin0 -> 2444 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$MainSwatchPanel.classbin0 -> 7923 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$MouseHandler.classbin0 -> 1620 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$RecentPanelLayout.classbin0 -> 2178 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$RecentSwatchPanel.classbin0 -> 2954 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$SwatchPanel.classbin0 -> 1303 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel.classbin0 -> 3119 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/AncestorEvent.classbin0 -> 1099 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/AncestorListener.classbin0 -> 275 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/CaretEvent.classbin0 -> 400 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/CaretListener.classbin0 -> 214 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/CellEditorListener.classbin0 -> 254 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/ChangeEvent.classbin0 -> 362 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/ChangeListener.classbin0 -> 218 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/DocumentEvent$ElementChange.classbin0 -> 388 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/DocumentEvent$EventType.classbin0 -> 794 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/DocumentEvent.classbin0 -> 554 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/DocumentListener.classbin0 -> 271 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/EventListenerList.classbin0 -> 4510 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/HyperlinkEvent$EventType.classbin0 -> 802 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/HyperlinkEvent.classbin0 -> 1782 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/HyperlinkListener.classbin0 -> 230 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/InternalFrameAdapter.classbin0 -> 1105 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/InternalFrameEvent.classbin0 -> 1343 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/InternalFrameListener.classbin0 -> 443 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/ListDataEvent.classbin0 -> 1587 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/ListDataListener.classbin0 -> 277 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/ListSelectionEvent.classbin0 -> 1514 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/ListSelectionListener.classbin0 -> 239 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/MenuDragMouseEvent.classbin0 -> 1050 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/MenuDragMouseListener.classbin0 -> 340 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/MenuEvent.classbin0 -> 356 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/MenuKeyEvent.classbin0 -> 986 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/MenuKeyListener.classbin0 -> 272 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/MenuListener.classbin0 -> 260 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/MouseInputAdapter.classbin0 -> 1003 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/MouseInputListener.classbin0 -> 213 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/PopupMenuEvent.classbin0 -> 371 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/PopupMenuListener.classbin0 -> 308 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/SwingPropertyChangeSupport.classbin0 -> 482 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/TableColumnModelEvent.classbin0 -> 740 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/TableColumnModelListener.classbin0 -> 437 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/TableModelEvent.classbin0 -> 1718 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/TableModelListener.classbin0 -> 230 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/TreeExpansionEvent.classbin0 -> 620 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/TreeExpansionListener.classbin0 -> 263 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/TreeModelEvent.classbin0 -> 2298 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/TreeModelListener.classbin0 -> 317 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/TreeSelectionEvent.classbin0 -> 2194 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/TreeSelectionListener.classbin0 -> 239 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/TreeWillExpandListener.classbin0 -> 345 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/UndoableEditEvent.classbin0 -> 684 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/event/UndoableEditListener.classbin0 -> 244 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/filechooser/FileFilter.classbin0 -> 392 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/filechooser/FileSystemView.classbin0 -> 4192 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/filechooser/FileView.classbin0 -> 863 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/filechooser/UnixFileSystemView.classbin0 -> 2253 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/ActionMapUIResource.classbin0 -> 360 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/BorderUIResource$BevelBorderUIResource.classbin0 -> 1078 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/BorderUIResource$CompoundBorderUIResource.classbin0 -> 739 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/BorderUIResource$EmptyBorderUIResource.classbin0 -> 811 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/BorderUIResource$EtchedBorderUIResource.classbin0 -> 1024 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/BorderUIResource$LineBorderUIResource.classbin0 -> 776 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/BorderUIResource$MatteBorderUIResource.classbin0 -> 1030 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/BorderUIResource$TitledBorderUIResource.classbin0 -> 1670 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/BorderUIResource.classbin0 -> 2641 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/ButtonUI.classbin0 -> 295 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/ColorChooserUI.classbin0 -> 317 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/ColorUIResource.classbin0 -> 762 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/ComboBoxUI.classbin0 -> 444 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/ComponentInputMapUIResource.classbin0 -> 466 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/ComponentUI.classbin0 -> 2426 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/DesktopIconUI.classbin0 -> 314 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/DesktopPaneUI.classbin0 -> 314 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/DimensionUIResource.classbin0 -> 402 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/FileChooserUI.classbin0 -> 747 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/FontUIResource.classbin0 -> 657 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/IconUIResource.classbin0 -> 1114 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/InputMapUIResource.classbin0 -> 356 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/InsetsUIResource.classbin0 -> 547 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/InternalFrameUI.classbin0 -> 320 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/LabelUI.classbin0 -> 296 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/ListUI.classbin0 -> 497 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/MenuBarUI.classbin0 -> 302 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/MenuItemUI.classbin0 -> 302 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/OptionPaneUI.classbin0 -> 433 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/PanelUI.classbin0 -> 296 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/PopupMenuUI.classbin0 -> 981 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/ProgressBarUI.classbin0 -> 314 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/RootPaneUI.classbin0 -> 305 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/ScrollBarUI.classbin0 -> 308 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/ScrollPaneUI.classbin0 -> 311 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/SeparatorUI.classbin0 -> 308 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/SliderUI.classbin0 -> 299 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/SpinnerUI.classbin0 -> 302 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/SplitPaneUI.classbin0 -> 645 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/TabbedPaneUI.classbin0 -> 501 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/TableHeaderUI.classbin0 -> 314 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/TableUI.classbin0 -> 296 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/TextUI.classbin0 -> 1455 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/ToolBarUI.classbin0 -> 302 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/ToolTipUI.classbin0 -> 302 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/TreeUI.classbin0 -> 949 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/UIResource.classbin0 -> 118 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/ViewportUI.classbin0 -> 305 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicArrowButton.classbin0 -> 4556 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$ButtonBorder.classbin0 -> 2305 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$FieldBorder.classbin0 -> 2104 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$MarginBorder.classbin0 -> 1420 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$MenuBarBorder.classbin0 -> 1861 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$RadioButtonBorder.classbin0 -> 2394 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$RolloverButtonBorder.classbin0 -> 1786 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$SplitPaneBorder.classbin0 -> 2795 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$SplitPaneDividerBorder.classbin0 -> 2559 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$ToggleButtonBorder.classbin0 -> 1704 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders.classbin0 -> 4045 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener$1.classbin0 -> 1175 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener$2.classbin0 -> 1175 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener$ButtonAction.classbin0 -> 1892 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener.classbin0 -> 6685 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonUI.classbin0 -> 11510 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.classbin0 -> 1185 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicCheckBoxUI.classbin0 -> 628 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$1.classbin0 -> 924 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$PreviewListener.classbin0 -> 1413 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$PropertyHandler.classbin0 -> 1657 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$TabPaneListener.classbin0 -> 1275 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI.classbin0 -> 4904 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxEditor$UIResource.classbin0 -> 459 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxEditor.classbin0 -> 1816 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxRenderer$UIResource.classbin0 -> 467 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxRenderer.classbin0 -> 2088 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$ComboBoxLayoutManager.classbin0 -> 2168 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$FocusHandler.classbin0 -> 1191 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$ItemHandler.classbin0 -> 1308 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$KeyHandler.classbin0 -> 1593 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$ListDataHandler.classbin0 -> 3136 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$PropertyChangeHandler.classbin0 -> 2581 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI.classbin0 -> 16273 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$InvocationKeyHandler.classbin0 -> 734 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$InvocationMouseHandler.classbin0 -> 2308 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$InvocationMouseMotionHandler.classbin0 -> 1954 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ItemHandler.classbin0 -> 1152 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListDataHandler.classbin0 -> 940 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListMouseHandler.classbin0 -> 1081 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListMouseMotionHandler.classbin0 -> 1296 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListSelectionHandler.classbin0 -> 799 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$PropertyChangeHandler.classbin0 -> 1878 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup.classbin0 -> 14150 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$1.classbin0 -> 1713 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$2.classbin0 -> 814 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$BoundButton.classbin0 -> 1306 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$DesktopIconBorder.classbin0 -> 2025 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$InternalFrameDefaultMenuIcon.classbin0 -> 1310 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$MouseInputHandler.classbin0 -> 2401 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI.classbin0 -> 4991 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$CloseAction.classbin0 -> 1157 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$MaximizeAction.classbin0 -> 1170 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$MinimizeAction.classbin0 -> 1167 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$NavigateAction.classbin0 -> 1351 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$OpenAction.classbin0 -> 1238 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI.classbin0 -> 3093 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel$1.classbin0 -> 856 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel$DirectoryLoadThread$UpdateSwingRequest.classbin0 -> 2209 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel$DirectoryLoadThread.classbin0 -> 4426 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel.classbin0 -> 5555 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicEditorPaneUI.classbin0 -> 914 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$AcceptAllFileFilter.classbin0 -> 893 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$ApproveSelectionAction.classbin0 -> 2289 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$BasicFileView.classbin0 -> 2695 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$CancelSelectionAction.classbin0 -> 1079 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$ChangeToParentDirectoryAction.classbin0 -> 1031 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$DoubleClickListener.classbin0 -> 2984 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$GoHomeAction.classbin0 -> 1186 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$NewFolderAction.classbin0 -> 1269 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$SelectionListener.classbin0 -> 1680 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$UpdateAction.classbin0 -> 758 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI.classbin0 -> 13666 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicFormattedTextFieldUI.classbin0 -> 669 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicGraphicsUtils.classbin0 -> 8236 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicHTML$HTMLRootView.classbin0 -> 4406 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicHTML.classbin0 -> 2774 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$1.classbin0 -> 1221 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$2.classbin0 -> 1188 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$CheckBoxIcon.classbin0 -> 836 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$CheckBoxMenuItemIcon.classbin0 -> 1278 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$DummyIcon.classbin0 -> 1212 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$RadioButtonIcon.classbin0 -> 845 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory.classbin0 -> 1847 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$CloseAction.classbin0 -> 1046 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$IconifyAction.classbin0 -> 1088 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$MaximizeAction.classbin0 -> 1350 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$MoveAction.classbin0 -> 817 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$PaneButton.classbin0 -> 887 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$PropertyChangeHandler.classbin0 -> 1598 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$RestoreAction.classbin0 -> 1054 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$SizeAction.classbin0 -> 817 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$SystemMenuBar.classbin0 -> 1381 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$TitlePaneLayout.classbin0 -> 2770 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane.classbin0 -> 10171 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$BasicInternalFrameListener.classbin0 -> 1622 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$BorderListener.classbin0 -> 5434 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$ComponentHandler.classbin0 -> 1663 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$GlassPaneDispatcher.classbin0 -> 3894 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$InternalFrameBorder.classbin0 -> 2244 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$InternalFrameLayout.classbin0 -> 3731 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$InternalFramePropertyChangeListener.classbin0 -> 3035 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$ShowSystemMenuAction.classbin0 -> 1138 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI.classbin0 -> 12010 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicLabelUI$1.classbin0 -> 1068 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicLabelUI.classbin0 -> 9298 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ActionListenerProxy.classbin0 -> 1138 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$FocusHandler.classbin0 -> 894 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ListAction.classbin0 -> 4157 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ListDataHandler.classbin0 -> 1130 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ListSelectionHandler.classbin0 -> 1200 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$MouseInputHandler.classbin0 -> 2536 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$PropertyChangeHandler.classbin0 -> 1770 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI.classbin0 -> 15521 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$1.classbin0 -> 920 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$2.classbin0 -> 913 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$3.classbin0 -> 918 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$4.classbin0 -> 921 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$5.classbin0 -> 1557 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$6.classbin0 -> 996 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$7.classbin0 -> 916 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$AudioAction.classbin0 -> 1804 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$PopupHelper.classbin0 -> 2053 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel.classbin0 -> 54628 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$ChangeHandler.classbin0 -> 911 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$ContainerHandler.classbin0 -> 1177 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$FocusAction.classbin0 -> 1327 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$MouseInputHandler.classbin0 -> 1811 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$PropertyChangeHandler.classbin0 -> 1278 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI.classbin0 -> 5909 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$ClickAction.classbin0 -> 896 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$ItemHandler.classbin0 -> 1250 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$MenuDragMouseHandler.classbin0 -> 2003 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$MenuKeyHandler.classbin0 -> 1091 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$MouseInputHandler.classbin0 -> 2324 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$PropertyChangeHandler.classbin0 -> 2614 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI.classbin0 -> 17650 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$ChangeHandler.classbin0 -> 969 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MenuDragMouseHandler.classbin0 -> 2832 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MenuHandler.classbin0 -> 1638 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MenuKeyHandler.classbin0 -> 1125 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MouseInputHandler.classbin0 -> 3272 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$SelectMenuAction.classbin0 -> 1439 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI.classbin0 -> 6078 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$1.classbin0 -> 1325 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$2.classbin0 -> 1389 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$3.classbin0 -> 1406 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$4.classbin0 -> 1282 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$ButtonActionListener.classbin0 -> 2178 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$ButtonAreaLayout.classbin0 -> 3303 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$MessageIcon.classbin0 -> 953 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$OptionPaneCloseAction.classbin0 -> 897 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$PropertyChangeHandler.classbin0 -> 1430 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI.classbin0 -> 14568 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicPanelUI.classbin0 -> 1437 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicPasswordFieldUI.classbin0 -> 900 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.classbin0 -> 1533 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$KeyboardHelper.classbin0 -> 3368 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$NavigateAction.classbin0 -> 6719 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$PopupMenuHandler.classbin0 -> 2391 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$TopWindowListener.classbin0 -> 1481 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI.classbin0 -> 6526 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$AncestorHandler.classbin0 -> 1345 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$Animator.classbin0 -> 960 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$ChangeHandler.classbin0 -> 888 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$ComponentHandler.classbin0 -> 1056 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$PropertyChangeHandler.classbin0 -> 1491 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI.classbin0 -> 13071 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.classbin0 -> 1197 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicRadioButtonUI.classbin0 -> 5547 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicRootPaneUI$DefaultPressAction.classbin0 -> 1211 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicRootPaneUI$DefaultReleaseAction.classbin0 -> 1217 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicRootPaneUI.classbin0 -> 3905 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$1.classbin0 -> 1190 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$2.classbin0 -> 1191 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$3.classbin0 -> 1190 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$4.classbin0 -> 1191 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$5.classbin0 -> 1122 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$6.classbin0 -> 1122 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$ArrowButtonListener.classbin0 -> 1555 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$ModelListener.classbin0 -> 955 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$PropertyChangeHandler.classbin0 -> 2087 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$ScrollListener.classbin0 -> 1651 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$TrackListener.classbin0 -> 3012 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI.classbin0 -> 16908 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$1.classbin0 -> 1344 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$10.classbin0 -> 1345 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$2.classbin0 -> 1359 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$3.classbin0 -> 1341 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$4.classbin0 -> 1343 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$5.classbin0 -> 1342 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$6.classbin0 -> 1344 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$7.classbin0 -> 1359 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$8.classbin0 -> 1342 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$9.classbin0 -> 1341 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$HSBChangeListener.classbin0 -> 1387 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$MouseWheelHandler.classbin0 -> 1690 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$PropertyChangeHandler.classbin0 -> 2042 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$VSBChangeListener.classbin0 -> 1385 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$ViewportChangeHandler.classbin0 -> 843 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$ViewportContainerListener.classbin0 -> 1211 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI.classbin0 -> 10659 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSeparatorUI.classbin0 -> 3047 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$1.classbin0 -> 1165 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$2.classbin0 -> 1165 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$3.classbin0 -> 1166 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$4.classbin0 -> 1166 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$5.classbin0 -> 1142 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$6.classbin0 -> 1142 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ActionScroller.classbin0 -> 827 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ChangeHandler.classbin0 -> 889 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ComponentHandler.classbin0 -> 872 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$FocusHandler.classbin0 -> 920 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$PropertyChangeHandler.classbin0 -> 1862 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ScrollListener.classbin0 -> 1574 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$TrackListener.classbin0 -> 2631 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI.classbin0 -> 25517 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$1.classbin0 -> 1216 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$2.classbin0 -> 1703 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$3.classbin0 -> 784 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$4.classbin0 -> 1711 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$5.classbin0 -> 784 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$DefaultLayoutManager.classbin0 -> 3926 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI.classbin0 -> 4321 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$BasicOneTouchButton.classbin0 -> 2121 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$DividerLayout.classbin0 -> 2579 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$DragController.classbin0 -> 1769 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$MouseHandler.classbin0 -> 1691 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$OneTouchAction.classbin0 -> 2371 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$VerticalDragController.classbin0 -> 1197 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider.classbin0 -> 7162 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$1.classbin0 -> 855 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$2.classbin0 -> 977 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$3.classbin0 -> 985 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$4.classbin0 -> 985 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$5.classbin0 -> 1182 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$6.classbin0 -> 1182 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$7.classbin0 -> 855 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$8.classbin0 -> 855 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$BasicHorizontalLayoutManager.classbin0 -> 6704 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$BasicVerticalLayoutManager.classbin0 -> 701 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$FocusHandler.classbin0 -> 965 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardDownRightHandler.classbin0 -> 787 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardEndHandler.classbin0 -> 769 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardHomeHandler.classbin0 -> 772 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardResizeToggleHandler.classbin0 -> 796 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardUpLeftHandler.classbin0 -> 778 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$PropertyHandler.classbin0 -> 1987 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI.classbin0 -> 14032 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$FocusHandler.classbin0 -> 1350 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$MouseHandler.classbin0 -> 4164 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$NavigateAction.classbin0 -> 1097 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$NavigatePageDownAction.classbin0 -> 1104 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$NavigatePageUpAction.classbin0 -> 1100 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$PropertyChangeHandler.classbin0 -> 2309 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$RequestFocusAction.classbin0 -> 804 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$RequestFocusForVisibleComponentAction.classbin0 -> 1029 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingButton.classbin0 -> 659 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingPanel$ScrollingPanelUI.classbin0 -> 1945 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingPanel.classbin0 -> 1293 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingViewport.classbin0 -> 790 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$TabSelectionHandler.classbin0 -> 1145 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayout.classbin0 -> 10750 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneScrollLayout.classbin0 -> 6417 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI.classbin0 -> 32391 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTableHeaderUI$1.classbin0 -> 1270 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTableHeaderUI$MouseInputHandler.classbin0 -> 5270 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTableHeaderUI.classbin0 -> 6332 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$FocusHandler.classbin0 -> 1654 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$KeyHandler.classbin0 -> 1233 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$MouseInputHandler.classbin0 -> 3833 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$PropertyChangeHandler.classbin0 -> 2003 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$TableAction.classbin0 -> 10390 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI.classbin0 -> 11558 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTextAreaUI.classbin0 -> 1835 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTextFieldUI.classbin0 -> 2284 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTextPaneUI.classbin0 -> 1583 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$BasicCaret.classbin0 -> 462 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$BasicHighlighter.classbin0 -> 486 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$FocusHandler.classbin0 -> 2071 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$Handler.classbin0 -> 2400 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$RootView.classbin0 -> 4656 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI.classbin0 -> 17718 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicToggleButtonUI.classbin0 -> 3114 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarSeparatorUI.classbin0 -> 1337 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$DockingListener.classbin0 -> 2955 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$DragWindow.classbin0 -> 2025 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$FrameListener.classbin0 -> 1391 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$PropertyListener.classbin0 -> 1112 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarAction.classbin0 -> 1577 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarBorder.classbin0 -> 2132 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarContListener.classbin0 -> 2107 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarDialog.classbin0 -> 786 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarFocusListener.classbin0 -> 1147 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI.classbin0 -> 16635 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicToolTipUI$PropertyChangeHandler.classbin0 -> 1514 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicToolTipUI.classbin0 -> 5073 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$1.classbin0 -> 1001 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$CellEditorHandler.classbin0 -> 901 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$ComponentHandler.classbin0 -> 2143 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$FocusHandler.classbin0 -> 1242 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$KeyHandler.classbin0 -> 2114 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$MouseHandler.classbin0 -> 2514 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$MouseInputHandler.classbin0 -> 2338 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$NodeDimensionsHandler.classbin0 -> 2351 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$PropertyChangeHandler.classbin0 -> 2241 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$SelectionModelPropertyChangeHandler.classbin0 -> 966 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeCancelEditingAction.classbin0 -> 987 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeExpansionHandler.classbin0 -> 1477 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeHomeAction.classbin0 -> 2637 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeIncrementAction.classbin0 -> 3035 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeModelHandler.classbin0 -> 1898 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreePageAction.classbin0 -> 3700 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeSelectionHandler.classbin0 -> 1558 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeStartEditingAction.classbin0 -> 1115 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeToggleAction.classbin0 -> 1673 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeTraverseAction.classbin0 -> 2504 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI.classbin0 -> 37315 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/BasicViewportUI.classbin0 -> 1238 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/ComboPopup.classbin0 -> 447 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/DefaultMenuLayout.classbin0 -> 601 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/basic/SharedUIDefaults.classbin0 -> 987 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/DefaultMetalTheme.classbin0 -> 3433 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ButtonBorder.classbin0 -> 3859 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$DesktopIconBorder.classbin0 -> 1464 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$Flush3DBorder.classbin0 -> 1822 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$InternalFrameBorder.classbin0 -> 2289 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$MenuBarBorder.classbin0 -> 1790 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$MenuItemBorder.classbin0 -> 2085 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$OptionDialogBorder.classbin0 -> 2348 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$PaletteBorder.classbin0 -> 1779 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$PopupMenuBorder.classbin0 -> 1821 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder.classbin0 -> 760 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$RolloverMarginBorder.classbin0 -> 1247 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ScrollPaneBorder.classbin0 -> 1716 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$TableHeaderBorder.classbin0 -> 1452 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$TextFieldBorder.classbin0 -> 1378 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder.classbin0 -> 2043 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ToolBarBorder.classbin0 -> 1869 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders.classbin0 -> 3427 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalButtonListener.classbin0 -> 617 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalButtonUI.classbin0 -> 4967 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalCheckBoxIcon.classbin0 -> 2082 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalCheckBoxUI.classbin0 -> 689 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxButton.classbin0 -> 4952 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor$EditorTextField.classbin0 -> 1031 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor$MetalComboBoxEditorBorder.classbin0 -> 1715 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor$UIResource.classbin0 -> 459 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor.classbin0 -> 1094 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxIcon.classbin0 -> 1244 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI$MetalComboBoxLayoutManager.classbin0 -> 1060 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI$MetalComboPopup.classbin0 -> 866 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI$MetalPropertyChangeListener.classbin0 -> 2089 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI.classbin0 -> 5757 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalDesktopIconUI.classbin0 -> 532 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$ButtonLayout.classbin0 -> 2657 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DetailViewActionListener.classbin0 -> 1928 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxAction.classbin0 -> 1224 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxModel.classbin0 -> 2120 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxRenderer.classbin0 -> 1992 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$FileRenderer.classbin0 -> 2259 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$FilterComboBoxModel.classbin0 -> 2310 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$FilterComboBoxRenderer.classbin0 -> 1179 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$IndentIcon.classbin0 -> 1373 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$ListViewActionListener.classbin0 -> 1834 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$MetalFileChooserPropertyChangeListener.classbin0 -> 7109 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$MetalFileChooserSelectionListener.classbin0 -> 1334 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$SingleClickListener$EditingActionListener.classbin0 -> 1068 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$SingleClickListener.classbin0 -> 4212 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$TableClickListener$EditingActionListener.classbin0 -> 1062 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$TableClickListener.classbin0 -> 5158 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$TableFileRenderer.classbin0 -> 2595 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$VerticalMidLayout.classbin0 -> 2163 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI.classbin0 -> 19113 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$1.classbin0 -> 1188 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$2.classbin0 -> 1192 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$3.classbin0 -> 1221 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$CheckBoxMenuItemIcon.classbin0 -> 1689 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserDetailViewIcon.classbin0 -> 1696 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserHomeFolderIcon.classbin0 -> 1818 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserListViewIcon.classbin0 -> 2031 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserNewFolderIcon.classbin0 -> 1729 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserUpFolderIcon.classbin0 -> 1204 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileIcon16.classbin0 -> 1577 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FolderIcon16.classbin0 -> 1654 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$HorizontalSliderThumbIcon.classbin0 -> 2736 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameAltMaximizeIcon.classbin0 -> 2494 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameCloseIcon.classbin0 -> 2551 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameDefaultMenuIcon.classbin0 -> 1605 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameMaximizeIcon.classbin0 -> 2544 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameMinimizeIcon.classbin0 -> 2347 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$PaletteCloseIcon.classbin0 -> 1817 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$RadioButtonIcon.classbin0 -> 3091 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$RadioButtonMenuItemIcon.classbin0 -> 1899 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeComputerIcon.classbin0 -> 1656 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeControlIcon.classbin0 -> 1564 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeFloppyDriveIcon.classbin0 -> 1712 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon.classbin0 -> 637 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeHardDriveIcon.classbin0 -> 2463 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeLeafIcon.classbin0 -> 629 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$VerticalSliderThumbIcon.classbin0 -> 2728 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory.classbin0 -> 6422 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameTitlePane$MetalInternalFrameTitlePanePropertyChangeHandler.classbin0 -> 1838 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameTitlePane$MetalTitlePaneLayout.classbin0 -> 2938 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameTitlePane.classbin0 -> 6716 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameUI$1.classbin0 -> 1205 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameUI.classbin0 -> 2982 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalLabelUI.classbin0 -> 1469 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalLookAndFeel$1.classbin0 -> 916 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalLookAndFeel.classbin0 -> 30873 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalMenuBarUI.classbin0 -> 1225 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.classbin0 -> 600 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalProgressBarUI.classbin0 -> 2578 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalRadioButtonUI.classbin0 -> 2409 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalFrameBorder.classbin0 -> 2445 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalRootLayout.classbin0 -> 4344 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$CloseAction.classbin0 -> 1617 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$IconifyAction.classbin0 -> 1422 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$MaximizeAction.classbin0 -> 1427 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$MetalTitlePaneLayout.classbin0 -> 2810 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$MouseHandler.classbin0 -> 1773 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$PaneButton.classbin0 -> 959 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane.classbin0 -> 8217 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI.classbin0 -> 3207 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollBarUI$MetalScrollBarPropertyChangeHandler.classbin0 -> 1557 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollBarUI.classbin0 -> 7735 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollButton.classbin0 -> 5504 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollPaneUI.classbin0 -> 1734 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalSeparatorUI.classbin0 -> 1827 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalSliderUI$MetalPropertyListener.classbin0 -> 1242 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalSliderUI.classbin0 -> 7057 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalSplitPaneDivider$MetalOneTouchButton.classbin0 -> 2338 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalSplitPaneDivider.classbin0 -> 3190 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalSplitPaneUI.classbin0 -> 1016 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalTabbedPaneUI$TabbedPaneLayout.classbin0 -> 1097 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalTabbedPaneUI.classbin0 -> 12940 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalTextFieldUI.classbin0 -> 706 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalTheme.classbin0 -> 4295 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalToggleButtonUI.classbin0 -> 4445 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI$MetalContainerListener.classbin0 -> 662 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI$MetalDockingListener.classbin0 -> 1188 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI$MetalRolloverListener.classbin0 -> 656 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI.classbin0 -> 3159 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalToolTipUI.classbin0 -> 4741 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalTreeUI$LineStyleListener.classbin0 -> 1207 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalTreeUI.classbin0 -> 4661 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/MetalUtils.classbin0 -> 7703 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/metal/OceanTheme.classbin0 -> 5545 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiButtonUI.classbin0 -> 3741 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiColorChooserUI.classbin0 -> 3765 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiComboBoxUI.classbin0 -> 4539 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiDesktopIconUI.classbin0 -> 3761 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiDesktopPaneUI.classbin0 -> 3761 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiFileChooserUI.classbin0 -> 5542 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiInternalFrameUI.classbin0 -> 3769 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiLabelUI.classbin0 -> 3737 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiListUI.classbin0 -> 4778 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiLookAndFeel.classbin0 -> 4980 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiMenuBarUI.classbin0 -> 3745 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiMenuItemUI.classbin0 -> 3749 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiOptionPaneUI.classbin0 -> 4309 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiPanelUI.classbin0 -> 3737 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiPopupMenuUI.classbin0 -> 3753 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiProgressBarUI.classbin0 -> 3761 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiRootPaneUI.classbin0 -> 3749 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiScrollBarUI.classbin0 -> 3753 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiScrollPaneUI.classbin0 -> 3757 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiSeparatorUI.classbin0 -> 3753 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiSliderUI.classbin0 -> 3741 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiSpinnerUI.classbin0 -> 3745 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiSplitPaneUI.classbin0 -> 5265 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiTabbedPaneUI.classbin0 -> 4734 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiTableHeaderUI.classbin0 -> 3761 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiTableUI.classbin0 -> 3737 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiTextUI.classbin0 -> 7018 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiToolBarUI.classbin0 -> 3745 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiToolTipUI.classbin0 -> 3745 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiTreeUI.classbin0 -> 6600 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/multi/MultiViewportUI.classbin0 -> 3749 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/synth/ColorType.classbin0 -> 1096 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/synth/Region.classbin0 -> 5717 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/synth/SynthConstants.classbin0 -> 374 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/synth/SynthContext.classbin0 -> 1110 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/synth/SynthGraphicsUtils.classbin0 -> 4042 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/synth/SynthLookAndFeel.classbin0 -> 2732 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/synth/SynthPainter.classbin0 -> 16885 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/synth/SynthStyle.classbin0 -> 3043 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/plaf/synth/SynthStyleFactory.classbin0 -> 440 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/table/AbstractTableModel.classbin0 -> 4043 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/table/DefaultTableCellRenderer$UIResource.classbin0 -> 464 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/table/DefaultTableCellRenderer.classbin0 -> 3503 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/table/DefaultTableColumnModel.classbin0 -> 8494 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/table/DefaultTableModel.classbin0 -> 7491 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/table/JTableHeader$AccessibleJTableHeader$AccessibleJTableHeaderEntry.classbin0 -> 9605 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/table/JTableHeader$AccessibleJTableHeader.classbin0 -> 1638 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/table/JTableHeader.classbin0 -> 6581 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/table/TableCellEditor.classbin0 -> 263 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/table/TableCellRenderer.classbin0 -> 240 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/table/TableColumn.classbin0 -> 6349 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/table/TableColumnModel.classbin0 -> 1035 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/table/TableModel.classbin0 -> 551 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AbstractDocument$AbstractElement.classbin0 -> 7275 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AbstractDocument$AttributeContext.classbin0 -> 946 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AbstractDocument$BidiElement.classbin0 -> 1170 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AbstractDocument$BidiRootElement.classbin0 -> 775 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AbstractDocument$BranchElement.classbin0 -> 3805 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AbstractDocument$Bypass.classbin0 -> 1368 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AbstractDocument$Content.classbin0 -> 636 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AbstractDocument$DefaultDocumentEvent.classbin0 -> 2879 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AbstractDocument$ElementEdit.classbin0 -> 1266 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AbstractDocument$LeafElement.classbin0 -> 2890 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AbstractDocument.classbin0 -> 19878 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AbstractWriter.classbin0 -> 6829 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AsyncBoxView$ChildLocator.classbin0 -> 4547 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AsyncBoxView$ChildState.classbin0 -> 3896 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AsyncBoxView$FlushTask.classbin0 -> 1889 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AsyncBoxView.classbin0 -> 10236 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AttributeSet$CharacterAttribute.classbin0 -> 228 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AttributeSet$ColorAttribute.classbin0 -> 220 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AttributeSet$FontAttribute.classbin0 -> 218 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AttributeSet$ParagraphAttribute.classbin0 -> 228 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/AttributeSet.classbin0 -> 1219 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/BadLocationException.classbin0 -> 606 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/BoxView.classbin0 -> 13114 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/Caret.classbin0 -> 674 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/ChangedCharSetException.classbin0 -> 796 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/ComponentView$1.classbin0 -> 1200 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/ComponentView$Interceptor.classbin0 -> 2577 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/ComponentView.classbin0 -> 4965 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/CompositeView.classbin0 -> 8179 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DateFormatter.classbin0 -> 761 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultCaret$BlinkTimerListener.classbin0 -> 1007 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultCaret$Bypass.classbin0 -> 960 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultCaret$DocumentHandler.classbin0 -> 1602 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultCaret$PropertyChangeHandler.classbin0 -> 1916 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultCaret.classbin0 -> 14143 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BackwardAction.classbin0 -> 750 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeepAction.classbin0 -> 716 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeginAction.classbin0 -> 1248 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeginLineAction.classbin0 -> 1442 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeginWordAction.classbin0 -> 1434 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$CopyAction.classbin0 -> 864 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$CutAction.classbin0 -> 859 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction.classbin0 -> 1326 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DeleteNextCharAction.classbin0 -> 1595 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DeletePrevCharAction.classbin0 -> 1575 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DownAction.classbin0 -> 731 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$EndAction.classbin0 -> 1393 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$EndLineAction.classbin0 -> 1432 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$EndWordAction.classbin0 -> 1424 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$ForwardAction.classbin0 -> 745 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$InsertBreakAction.classbin0 -> 896 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$InsertContentAction.classbin0 -> 658 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$InsertTabAction.classbin0 -> 888 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$NextWordAction.classbin0 -> 1429 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$PasteAction.classbin0 -> 871 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$PreviousWordAction.classbin0 -> 1449 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectAllAction.classbin0 -> 1444 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectLineAction.classbin0 -> 1512 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectWordAction.classbin0 -> 1776 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBackwardAction.classbin0 -> 782 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBeginAction.classbin0 -> 1280 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBeginLineAction.classbin0 -> 1418 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBeginWordAction.classbin0 -> 1466 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionDownAction.classbin0 -> 763 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionEndAction.classbin0 -> 1425 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionEndLineAction.classbin0 -> 1408 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionEndWordAction.classbin0 -> 1456 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionForwardAction.classbin0 -> 777 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionNextWordAction.classbin0 -> 1461 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionPreviousWordAction.classbin0 -> 1481 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionUpAction.classbin0 -> 755 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit$UpAction.classbin0 -> 723 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultEditorKit.classbin0 -> 9767 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultFormatter$FormatterDocumentFilter.classbin0 -> 2934 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultFormatter.classbin0 -> 3572 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultFormatterFactory.classbin0 -> 2826 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultHighlighter$DefaultHighlightPainter.classbin0 -> 3060 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultHighlighter$HighlightEntry.classbin0 -> 1259 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultHighlighter$LayerHighlightEntry.classbin0 -> 2281 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultHighlighter.classbin0 -> 6755 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$AttributeUndoableEdit.classbin0 -> 1512 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$ElementBuffer$Edit.classbin0 -> 1219 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$ElementBuffer.classbin0 -> 18010 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$ElementSpec.classbin0 -> 2801 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$SectionElement.classbin0 -> 800 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$StyleChangeListener.classbin0 -> 1181 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultStyledDocument.classbin0 -> 15413 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DefaultTextUI.classbin0 -> 345 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/Document.classbin0 -> 1226 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DocumentFilter$FilterBypass.classbin0 -> 733 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/DocumentFilter.classbin0 -> 1408 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/EditorKit.classbin0 -> 1450 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/Element.classbin0 -> 514 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/ElementIterator$ElementRef.classbin0 -> 667 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/ElementIterator.classbin0 -> 3003 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/EmptyAttributeSet$1.classbin0 -> 891 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/EmptyAttributeSet.classbin0 -> 1728 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/FieldView$1.classbin0 -> 813 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/FieldView.classbin0 -> 6268 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/FlowView$FlowStrategy.classbin0 -> 5963 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/FlowView$LogicalView.classbin0 -> 3269 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/FlowView.classbin0 -> 4208 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/GapContent$GapContentPosition.classbin0 -> 736 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/GapContent$InsertUndo.classbin0 -> 1557 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/GapContent$Mark.classbin0 -> 1400 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/GapContent$UndoPosRef.classbin0 -> 908 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/GapContent$UndoRemove.classbin0 -> 1623 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/GapContent.classbin0 -> 12279 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/GlyphView$DefaultGlyphPainter.classbin0 -> 4860 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/GlyphView$GlyphPainter.classbin0 -> 1753 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/GlyphView$J2DGlyphPainter.classbin0 -> 4332 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/GlyphView.classbin0 -> 12332 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/Highlighter$Highlight.classbin0 -> 334 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/Highlighter$HighlightPainter.classbin0 -> 313 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/Highlighter.classbin0 -> 782 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/IconView.classbin0 -> 2347 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/InternationalFormatter.classbin0 -> 3849 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/JTextComponent$AccessibleJTextComponent.classbin0 -> 10550 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/JTextComponent$DefaultKeymap.classbin0 -> 3384 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/JTextComponent$DefaultTransferHandler.classbin0 -> 3041 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/JTextComponent$KeyBinding.classbin0 -> 595 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/JTextComponent$KeymapActionMap.classbin0 -> 1605 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/JTextComponent$KeymapWrapper.classbin0 -> 1999 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/JTextComponent.classbin0 -> 18400 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/Keymap.classbin0 -> 861 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/LabelView.classbin0 -> 3664 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/LayeredHighlighter$LayerPainter.classbin0 -> 614 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/LayeredHighlighter.classbin0 -> 581 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/LayoutQueue.classbin0 -> 1339 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/MaskFormatter.classbin0 -> 6608 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/MutableAttributeSet.classbin0 -> 492 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/NavigationFilter$FilterBypass.classbin0 -> 544 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/NavigationFilter.classbin0 -> 1419 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/NumberFormatter.classbin0 -> 730 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/ParagraphView$Row.classbin0 -> 2673 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/ParagraphView.classbin0 -> 6072 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/PasswordView.classbin0 -> 4121 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/PlainDocument.classbin0 -> 6235 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/PlainView.classbin0 -> 11774 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/Position$Bias.classbin0 -> 717 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/Position.classbin0 -> 214 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/Segment.classbin0 -> 2533 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/SimpleAttributeSet.classbin0 -> 4801 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StringContent$InsertUndo.classbin0 -> 1566 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StringContent$Mark.classbin0 -> 568 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StringContent$RemoveUndo.classbin0 -> 1673 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StringContent$StickyPosition.classbin0 -> 1163 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StringContent$UndoPosRef.classbin0 -> 815 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StringContent.classbin0 -> 5574 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/Style.classbin0 -> 292 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyleConstants$CharacterConstants.classbin0 -> 1428 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyleConstants$ColorConstants.classbin0 -> 776 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyleConstants$FontConstants.classbin0 -> 858 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyleConstants$ParagraphConstants.classbin0 -> 1091 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyleConstants.classbin0 -> 8963 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyleContext$1.classbin0 -> 995 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyleContext$NamedStyle.classbin0 -> 6753 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyleContext$SimpleFontSpec.classbin0 -> 937 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyleContext$SmallAttributeSet.classbin0 -> 4021 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyleContext.classbin0 -> 11737 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyledDocument.classbin0 -> 841 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyledEditorKit$AlignmentAction.classbin0 -> 1181 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyledEditorKit$BoldAction.classbin0 -> 1692 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyledEditorKit$CaretTracker.classbin0 -> 1774 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyledEditorKit$FontFamilyAction.classbin0 -> 1220 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyledEditorKit$FontSizeAction.classbin0 -> 1180 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyledEditorKit$ForegroundAction.classbin0 -> 1231 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyledEditorKit$ItalicAction.classbin0 -> 1704 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyledEditorKit$StyledTextAction.classbin0 -> 3268 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyledEditorKit$StyledViewFactory.classbin0 -> 1724 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyledEditorKit$UnderlineAction.classbin0 -> 1722 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/StyledEditorKit.classbin0 -> 4297 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/TabExpander.classbin0 -> 150 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/TabSet.classbin0 -> 2402 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/TabStop.classbin0 -> 2174 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/TabableView.classbin0 -> 214 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/TableView$TableCell.classbin0 -> 1132 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/TableView$TableRow.classbin0 -> 2230 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/TableView.classbin0 -> 3781 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/TextAction$HorizontalMovementAction.classbin0 -> 1800 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/TextAction$VerticalMovementAction.classbin0 -> 1953 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/TextAction.classbin0 -> 2692 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/Utilities.classbin0 -> 8224 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/View.classbin0 -> 12065 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/ViewFactory.classbin0 -> 191 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/WrappedPlainView$WrappedLine.classbin0 -> 5765 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/WrappedPlainView$WrappedLineCreator.classbin0 -> 889 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/WrappedPlainView.classbin0 -> 8465 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/ZoneView$Zone.classbin0 -> 912 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/ZoneView.classbin0 -> 5663 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/BRView.classbin0 -> 553 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/BlockView$PositionInfo.classbin0 -> 998 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/BlockView.classbin0 -> 9557 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/CSS$Attribute.classbin0 -> 6219 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/CSS.classbin0 -> 6687 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/CSSBorder.classbin0 -> 7458 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/CSSParser$CSSParserCallback.classbin0 -> 390 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/CSSParser.classbin0 -> 4348 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/FormSubmitEvent$MethodType.classbin0 -> 567 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/FormSubmitEvent.classbin0 -> 1362 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/FormView$1.classbin0 -> 1669 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/FormView$MouseEventListener.classbin0 -> 941 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/FormView$SubmitThread.classbin0 -> 5391 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/FormView.classbin0 -> 10767 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/FrameSetView$FrameSetRow.classbin0 -> 1841 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/FrameSetView.classbin0 -> 3609 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/FrameView.classbin0 -> 4334 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HRuleView$Beginning.classbin0 -> 850 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HRuleView.classbin0 -> 2341 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTML$Attribute.classbin0 -> 6257 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTML$Tag.classbin0 -> 6702 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTML$UnknownTag.classbin0 -> 546 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTML.classbin0 -> 2647 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$1.classbin0 -> 1352 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$BlockElement.classbin0 -> 1326 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$AreaAction.classbin0 -> 1106 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$BaseAction.classbin0 -> 1330 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$BlockAction.classbin0 -> 1103 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$CharacterAction.classbin0 -> 1544 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$ConvertAction.classbin0 -> 2417 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$FormAction.classbin0 -> 5253 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$FormTagAction.classbin0 -> 913 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$HeadAction.classbin0 -> 1714 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$HiddenAction.classbin0 -> 1106 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$IsindexAction.classbin0 -> 1202 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$LinkAction.classbin0 -> 2414 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$MapAction.classbin0 -> 1103 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$MetaAction.classbin0 -> 1106 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$ParagraphAction.classbin0 -> 1086 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$PreAction.classbin0 -> 1471 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$SpecialAction.classbin0 -> 971 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$StyleAction.classbin0 -> 1084 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$TagAction.classbin0 -> 993 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$TitleAction.classbin0 -> 1109 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader.classbin0 -> 15313 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$Iterator.classbin0 -> 612 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$LeafIterator.classbin0 -> 1732 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument$RunElement.classbin0 -> 1364 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLDocument.classbin0 -> 14134 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$HTMLFactory.classbin0 -> 3016 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$HTMLTextAction.classbin0 -> 3248 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$InsertHTMLTextAction.classbin0 -> 5648 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$LinkController.classbin0 -> 5330 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$Parser.classbin0 -> 542 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$ParserCallback.classbin0 -> 1710 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit.classbin0 -> 10214 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLFrameHyperlinkEvent.classbin0 -> 1753 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/HTMLWriter.classbin0 -> 13091 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/ImageView$1.classbin0 -> 842 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/ImageView$Observer.classbin0 -> 1079 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/ImageView.classbin0 -> 8743 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/InlineView.classbin0 -> 4798 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/ListView.classbin0 -> 1920 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/MinimalHTMLWriter.classbin0 -> 9010 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/MultiAttributeSet$MultiNameEnumeration.classbin0 -> 1245 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/MultiAttributeSet.classbin0 -> 2791 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/MultiStyle.classbin0 -> 1900 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/NullView.classbin0 -> 1284 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/ObjectView.classbin0 -> 1388 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/Option.classbin0 -> 1511 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/ParagraphView.classbin0 -> 4882 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/ResetableModel.classbin0 -> 153 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/ResetablePlainDocument.classbin0 -> 1046 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/ResetableToggleButtonModel.classbin0 -> 655 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/SelectComboBoxModel.classbin0 -> 837 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/SelectListModel.classbin0 -> 1125 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/StyleSheet$BoxPainter.classbin0 -> 3498 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/StyleSheet$CSSStyle.classbin0 -> 1625 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/StyleSheet$CSSStyleSheetParserCallback.classbin0 -> 2235 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/StyleSheet$ListPainter.classbin0 -> 2672 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/StyleSheet.classbin0 -> 17082 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/TableView$CellView.classbin0 -> 1794 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/TableView$RowView.classbin0 -> 3261 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/TableView.classbin0 -> 12518 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/ViewAttributeSet.classbin0 -> 2824 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/AttributeList$1.classbin0 -> 944 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/AttributeList.classbin0 -> 2576 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/ContentModel.classbin0 -> 2305 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/DTD.classbin0 -> 9163 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/DTDConstants.classbin0 -> 1133 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/DocumentParser$gnuParser.classbin0 -> 3356 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/DocumentParser.classbin0 -> 2434 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/Element$1.classbin0 -> 653 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/Element.classbin0 -> 2752 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/Entity$1.classbin0 -> 783 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/Entity.classbin0 -> 1637 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/Parser$1.classbin0 -> 2671 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/Parser.classbin0 -> 4563 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/ParserDelegator$gnuParser.classbin0 -> 3250 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/ParserDelegator.classbin0 -> 2400 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/html/parser/TagElement.classbin0 -> 1863 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/rtf/ControlWordToken.classbin0 -> 587 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/rtf/RTFEditorKit.classbin0 -> 1122 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/rtf/RTFParseException.classbin0 -> 473 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/rtf/RTFParser.classbin0 -> 2582 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/rtf/RTFScanner.classbin0 -> 2952 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/rtf/TextToken.classbin0 -> 399 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/text/rtf/Token.classbin0 -> 508 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/AbstractLayoutCache$NodeDimensions.classbin0 -> 534 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/AbstractLayoutCache.classbin0 -> 4406 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode$BreadthFirstEnumeration.classbin0 -> 1311 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode$PostorderEnumeration.classbin0 -> 1720 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode$PreorderEnumeration.classbin0 -> 1623 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode.classbin0 -> 10962 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/DefaultTreeCellEditor$DefaultTextField.classbin0 -> 1547 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/DefaultTreeCellEditor$EditorContainer.classbin0 -> 2279 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/DefaultTreeCellEditor.classbin0 -> 9819 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/DefaultTreeCellRenderer.classbin0 -> 7763 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/DefaultTreeModel.classbin0 -> 8345 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/DefaultTreeSelectionModel$PathPlaceHolder.classbin0 -> 632 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/DefaultTreeSelectionModel.classbin0 -> 14529 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/ExpandVetoException.classbin0 -> 675 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/FixedHeightLayoutCache$NodeRecord.classbin0 -> 2355 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/FixedHeightLayoutCache.classbin0 -> 7085 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/MutableTreeNode.classbin0 -> 392 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/RowMapper.classbin0 -> 177 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/TreeCellEditor.classbin0 -> 259 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/TreeCellRenderer.classbin0 -> 236 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/TreeModel.classbin0 -> 564 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/TreeNode.classbin0 -> 400 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/TreePath.classbin0 -> 3273 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/TreeSelectionModel.classbin0 -> 1436 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/VariableHeightLayoutCache$NodeRecord.classbin0 -> 2254 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/tree/VariableHeightLayoutCache.classbin0 -> 8001 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/undo/AbstractUndoableEdit.classbin0 -> 2624 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/undo/CannotRedoException.classbin0 -> 330 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/undo/CannotUndoException.classbin0 -> 330 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/undo/CompoundEdit.classbin0 -> 3252 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/undo/StateEdit.classbin0 -> 2261 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/undo/StateEditable.classbin0 -> 449 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/undo/UndoManager.classbin0 -> 5167 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/undo/UndoableEdit.classbin0 -> 553 bytes
-rw-r--r--libjava/classpath/lib/javax/swing/undo/UndoableEditSupport.classbin0 -> 3518 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/HeuristicCommitException.classbin0 -> 477 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/HeuristicMixedException.classbin0 -> 474 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/HeuristicRollbackException.classbin0 -> 483 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/InvalidTransactionException.classbin0 -> 491 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/NotSupportedException.classbin0 -> 468 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/RollbackException.classbin0 -> 456 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/Status.classbin0 -> 541 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/Synchronization.classbin0 -> 195 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/SystemException.classbin0 -> 585 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/Transaction.classbin0 -> 771 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/TransactionManager.classbin0 -> 885 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/TransactionRequiredException.classbin0 -> 494 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/TransactionRolledbackException.classbin0 -> 500 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/UserTransaction.classbin0 -> 661 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/xa/XAException.classbin0 -> 1451 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/xa/XAResource.classbin0 -> 1062 bytes
-rw-r--r--libjava/classpath/lib/javax/transaction/xa/Xid.classbin0 -> 292 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/XMLConstants.classbin0 -> 1138 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/datatype/DatatypeConfigurationException.classbin0 -> 788 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/datatype/DatatypeConstants$Field.classbin0 -> 717 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/datatype/DatatypeConstants.classbin0 -> 2609 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/datatype/DatatypeFactory.classbin0 -> 5735 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/datatype/Duration.classbin0 -> 3881 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/datatype/XMLGregorianCalendar.classbin0 -> 3296 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/namespace/NamespaceContext.classbin0 -> 285 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/namespace/QName.classbin0 -> 2665 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/parsers/DocumentBuilder.classbin0 -> 2261 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/parsers/DocumentBuilderFactory.classbin0 -> 5298 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/parsers/FactoryConfigurationError.classbin0 -> 1171 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/parsers/ParserConfigurationException.classbin0 -> 489 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/parsers/SAXParser.classbin0 -> 4329 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/parsers/SAXParserFactory.classbin0 -> 4217 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/EventFilter.classbin0 -> 177 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/FactoryConfigurationError.classbin0 -> 1130 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/Location.classbin0 -> 266 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/StreamFilter.classbin0 -> 179 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/XMLEventFactory.classbin0 -> 5548 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/XMLEventReader.classbin0 -> 555 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/XMLEventWriter.classbin0 -> 769 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/XMLInputFactory.classbin0 -> 5885 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/XMLOutputFactory.classbin0 -> 4233 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/XMLReporter.classbin0 -> 288 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/XMLResolver.classbin0 -> 303 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/XMLStreamConstants.classbin0 -> 688 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/XMLStreamException.classbin0 -> 1355 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/XMLStreamReader.classbin0 -> 1768 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/XMLStreamWriter.classbin0 -> 1556 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/events/Attribute.classbin0 -> 304 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/events/Characters.classbin0 -> 285 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/events/Comment.classbin0 -> 200 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/events/DTD.classbin0 -> 326 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/events/EndDocument.classbin0 -> 167 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/events/EndElement.classbin0 -> 264 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/events/EntityDeclaration.classbin0 -> 340 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/events/EntityReference.classbin0 -> 289 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/events/Namespace.classbin0 -> 278 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/events/NotationDeclaration.classbin0 -> 268 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/events/ProcessingInstruction.classbin0 -> 248 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/events/StartDocument.classbin0 -> 349 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/events/StartElement.classbin0 -> 528 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/events/XMLEvent.classbin0 -> 850 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/util/EventReaderDelegate.classbin0 -> 2151 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/util/ReaderDelegate.classbin0 -> 6601 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/util/XMLEventAllocator.classbin0 -> 459 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/stream/util/XMLEventConsumer.classbin0 -> 253 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/ErrorListener.classbin0 -> 319 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/OutputKeys.classbin0 -> 820 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/Result.classbin0 -> 427 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/Source.classbin0 -> 204 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/SourceLocator.classbin0 -> 250 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/Templates.classbin0 -> 321 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/Transformer.classbin0 -> 1269 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/TransformerConfigurationException.classbin0 -> 1316 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/TransformerException.classbin0 -> 3839 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/TransformerFactory.classbin0 -> 4088 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/TransformerFactoryConfigurationError.classbin0 -> 1174 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/URIResolver.classbin0 -> 279 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/dom/DOMLocator.classbin0 -> 218 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/dom/DOMResult.classbin0 -> 1693 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/dom/DOMSource.classbin0 -> 1180 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/sax/SAXResult.classbin0 -> 1391 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/sax/SAXSource.classbin0 -> 2439 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/sax/SAXTransformerFactory.classbin0 -> 1212 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/sax/TemplatesHandler.classbin0 -> 321 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/sax/TransformerHandler.classbin0 -> 514 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/stream/StreamResult.classbin0 -> 2049 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/transform/stream/StreamSource.classbin0 -> 2517 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/validation/Schema.classbin0 -> 423 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/validation/SchemaFactory.classbin0 -> 5071 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/validation/SchemaFactoryLoader.classbin0 -> 408 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/validation/TypeInfoProvider.classbin0 -> 487 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/validation/Validator.classbin0 -> 1638 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/validation/ValidatorHandler.classbin0 -> 1764 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/xpath/XPath.classbin0 -> 1124 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/xpath/XPathConstants.classbin0 -> 1073 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/xpath/XPathException.classbin0 -> 1079 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/xpath/XPathExpression.classbin0 -> 501 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/xpath/XPathExpressionException.classbin0 -> 616 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/xpath/XPathFactory.classbin0 -> 3748 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/xpath/XPathFactoryConfigurationException.classbin0 -> 646 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/xpath/XPathFunction.classbin0 -> 248 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/xpath/XPathFunctionException.classbin0 -> 620 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/xpath/XPathFunctionResolver.classbin0 -> 229 bytes
-rw-r--r--libjava/classpath/lib/javax/xml/xpath/XPathVariableResolver.classbin0 -> 215 bytes
-rw-r--r--libjava/classpath/lib/jazzlib/index.html47
-rwxr-xr-xlibjava/classpath/lib/jazzlib/makeJazzlibDist.sh121
-rwxr-xr-xlibjava/classpath/lib/mkdep.pl.in336
-rw-r--r--libjava/classpath/lib/org/ietf/jgss/ChannelBinding.classbin0 -> 1653 bytes
-rw-r--r--libjava/classpath/lib/org/ietf/jgss/GSSContext.classbin0 -> 1929 bytes
-rw-r--r--libjava/classpath/lib/org/ietf/jgss/GSSCredential.classbin0 -> 961 bytes
-rw-r--r--libjava/classpath/lib/org/ietf/jgss/GSSException.classbin0 -> 5289 bytes
-rw-r--r--libjava/classpath/lib/org/ietf/jgss/GSSManager.classbin0 -> 2374 bytes
-rw-r--r--libjava/classpath/lib/org/ietf/jgss/GSSName.classbin0 -> 1248 bytes
-rw-r--r--libjava/classpath/lib/org/ietf/jgss/MessageProp.classbin0 -> 1738 bytes
-rw-r--r--libjava/classpath/lib/org/ietf/jgss/Oid.classbin0 -> 4656 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ACTIVITY_COMPLETED.classbin0 -> 975 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ACTIVITY_REQUIRED.classbin0 -> 972 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ARG_IN.classbin0 -> 156 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ARG_INOUT.classbin0 -> 162 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ARG_OUT.classbin0 -> 158 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/Any.classbin0 -> 3486 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/AnyHolder.classbin0 -> 1378 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/AnySeqHelper.classbin0 -> 2256 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/AnySeqHolder.classbin0 -> 1617 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/BAD_CONTEXT.classbin0 -> 954 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/BAD_INV_ORDER.classbin0 -> 960 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/BAD_OPERATION.classbin0 -> 960 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/BAD_PARAM.classbin0 -> 948 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/BAD_POLICY.classbin0 -> 164 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/BAD_POLICY_TYPE.classbin0 -> 174 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/BAD_POLICY_VALUE.classbin0 -> 176 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/BAD_QOS.classbin0 -> 942 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/BAD_TYPECODE.classbin0 -> 957 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/BooleanHolder.classbin0 -> 1356 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/BooleanSeqHelper.classbin0 -> 2082 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/BooleanSeqHolder.classbin0 -> 1506 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/Bounds.classbin0 -> 426 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ByteHolder.classbin0 -> 1339 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/CODESET_INCOMPATIBLE.classbin0 -> 981 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/COMM_FAILURE.classbin0 -> 957 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/CTX_RESTRICT_SCOPE.classbin0 -> 180 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/CharHolder.classbin0 -> 1331 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/CharSeqHelper.classbin0 -> 2058 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/CharSeqHolder.classbin0 -> 1488 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/CompletionStatus.classbin0 -> 1772 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/CompletionStatusHelper.classbin0 -> 2021 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/Context.classbin0 -> 687 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ContextList.classbin0 -> 468 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/Current.classbin0 -> 216 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/CurrentHelper$_CurrentStub.classbin0 -> 736 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/CurrentHelper.classbin0 -> 2402 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/CurrentHolder.classbin0 -> 1185 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/CurrentOperations.classbin0 -> 129 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/CustomMarshal.classbin0 -> 234 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/CustomValue.classbin0 -> 192 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DATA_CONVERSION.classbin0 -> 966 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DataInputStream.classbin0 -> 1641 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DataOutputStream.classbin0 -> 1296 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DefinitionKind.classbin0 -> 3590 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DefinitionKindHelper.classbin0 -> 2646 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DomainManager.classbin0 -> 262 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DomainManagerOperations.classbin0 -> 197 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DoubleHolder.classbin0 -> 1349 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DoubleSeqHelper.classbin0 -> 2074 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DoubleSeqHolder.classbin0 -> 1500 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DynAny.classbin0 -> 2088 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/Invalid.classbin0 -> 589 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/InvalidSeq.classbin0 -> 598 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/InvalidValue.classbin0 -> 604 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/TypeMismatch.classbin0 -> 604 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DynArray.classbin0 -> 303 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DynEnum.classbin0 -> 264 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DynFixed.classbin0 -> 263 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DynSequence.classbin0 -> 347 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DynStruct.classbin0 -> 433 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DynUnion.classbin0 -> 408 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DynValue.classbin0 -> 459 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/DynamicImplementation.classbin0 -> 3441 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/Environment.classbin0 -> 383 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ExceptionList.classbin0 -> 486 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/FREE_MEM.classbin0 -> 945 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/FieldNameHelper.classbin0 -> 1734 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/FixedHolder.classbin0 -> 1175 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/FloatHolder.classbin0 -> 1342 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/FloatSeqHelper.classbin0 -> 2066 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/FloatSeqHolder.classbin0 -> 1494 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/IDLType.classbin0 -> 274 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/IDLTypeHelper.classbin0 -> 2607 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/IDLTypeOperations.classbin0 -> 213 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/IMP_LIMIT.classbin0 -> 948 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/INITIALIZE.classbin0 -> 951 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/INTERNAL.classbin0 -> 945 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/INTF_REPOS.classbin0 -> 951 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/INVALID_ACTIVITY.classbin0 -> 969 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/INVALID_TRANSACTION.classbin0 -> 978 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/INV_FLAG.classbin0 -> 945 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/INV_IDENT.classbin0 -> 948 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/INV_OBJREF.classbin0 -> 951 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/INV_POLICY.classbin0 -> 951 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/IRObject.classbin0 -> 247 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/IRObjectOperations.classbin0 -> 265 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/IdentifierHelper.classbin0 -> 1739 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/IntHolder.classbin0 -> 1328 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/LocalObject.classbin0 -> 4238 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/LongHolder.classbin0 -> 1351 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/LongLongSeqHelper.classbin0 -> 2086 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/LongLongSeqHolder.classbin0 -> 1512 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/LongSeqHelper.classbin0 -> 2058 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/LongSeqHolder.classbin0 -> 1488 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/MARSHAL.classbin0 -> 950 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/NO_IMPLEMENT.classbin0 -> 957 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/NO_MEMORY.classbin0 -> 948 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/NO_PERMISSION.classbin0 -> 960 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/NO_RESOURCES.classbin0 -> 963 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/NO_RESPONSE.classbin0 -> 954 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/NVList.classbin0 -> 595 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/NameValuePair.classbin0 -> 684 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/NameValuePairHelper.classbin0 -> 3134 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/NamedValue.classbin0 -> 383 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/OBJECT_NOT_EXIST.classbin0 -> 969 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/OBJ_ADAPTER.classbin0 -> 954 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/OMGVMCID.classbin0 -> 160 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ORB.classbin0 -> 10975 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ORBPackage/InconsistentTypeCode.classbin0 -> 622 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ORBPackage/InvalidName.classbin0 -> 595 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/Object.classbin0 -> 1024 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ObjectHelper.classbin0 -> 2070 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ObjectHolder.classbin0 -> 1526 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/OctetSeqHelper.classbin0 -> 2066 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/OctetSeqHolder.classbin0 -> 1494 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/PERSIST_STORE.classbin0 -> 960 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/PRIVATE_MEMBER.classbin0 -> 172 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/PUBLIC_MEMBER.classbin0 -> 170 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ParameterMode.classbin0 -> 1385 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ParameterModeHelper.classbin0 -> 2148 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ParameterModeHolder.classbin0 -> 1227 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/Policy.classbin0 -> 241 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/PolicyError.classbin0 -> 753 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/PolicyErrorCodeHelper.classbin0 -> 1800 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/PolicyErrorHelper.classbin0 -> 3053 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/PolicyErrorHolder.classbin0 -> 1217 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/PolicyHelper.classbin0 -> 2615 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/PolicyHolder.classbin0 -> 1177 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/PolicyListHelper.classbin0 -> 2448 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/PolicyListHolder.classbin0 -> 1197 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/PolicyOperations.classbin0 -> 221 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/PolicyTypeHelper.classbin0 -> 1741 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/Principal.classbin0 -> 521 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/PrincipalHolder.classbin0 -> 1455 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/REBIND.classbin0 -> 939 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/RepositoryIdHelper.classbin0 -> 1749 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/Request.classbin0 -> 1159 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ServerRequest.classbin0 -> 1210 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ServiceDetail.classbin0 -> 573 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ServiceDetailHelper.classbin0 -> 3418 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ServiceInformation.classbin0 -> 640 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ServiceInformationHelper.classbin0 -> 3602 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ServiceInformationHolder.classbin0 -> 1267 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/SetOverrideType.classbin0 -> 1318 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/SetOverrideTypeHelper.classbin0 -> 2169 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ShortHolder.classbin0 -> 1342 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ShortSeqHelper.classbin0 -> 2066 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ShortSeqHolder.classbin0 -> 1494 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/StringHolder.classbin0 -> 1409 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/StringSeqHelper.classbin0 -> 2271 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/StringSeqHolder.classbin0 -> 1650 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/StringValueHelper.classbin0 -> 2938 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/StructMember.classbin0 -> 802 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/StructMemberHelper.classbin0 -> 4010 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/SystemException.classbin0 -> 1174 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/TCKind.classbin0 -> 3902 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/TIMEOUT.classbin0 -> 942 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/TRANSACTION_MODE.classbin0 -> 969 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/TRANSACTION_REQUIRED.classbin0 -> 981 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/TRANSACTION_ROLLEDBACK.classbin0 -> 987 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/TRANSACTION_UNAVAILABLE.classbin0 -> 990 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/TRANSIENT.classbin0 -> 948 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/TypeCode.classbin0 -> 1292 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/TypeCodeHolder.classbin0 -> 1376 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/TypeCodePackage/BadKind.classbin0 -> 593 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/TypeCodePackage/Bounds.classbin0 -> 590 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ULongLongSeqHelper.classbin0 -> 2094 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ULongLongSeqHolder.classbin0 -> 1518 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ULongSeqHelper.classbin0 -> 2065 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ULongSeqHolder.classbin0 -> 1494 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/UNKNOWN.classbin0 -> 942 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/UNSUPPORTED_POLICY.classbin0 -> 180 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.classbin0 -> 192 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/UShortSeqHelper.classbin0 -> 2073 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/UShortSeqHolder.classbin0 -> 1500 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/UnionMember.classbin0 -> 896 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/UnionMemberHelper.classbin0 -> 4221 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/UnknownUserException.classbin0 -> 633 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/UnknownUserExceptionHelper.classbin0 -> 3008 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/UnknownUserExceptionHolder.classbin0 -> 1289 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/UserException.classbin0 -> 571 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/VM_ABSTRACT.classbin0 -> 166 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/VM_CUSTOM.classbin0 -> 162 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/VM_NONE.classbin0 -> 158 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/VM_TRUNCATABLE.classbin0 -> 172 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ValueBaseHelper.classbin0 -> 1577 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ValueBaseHolder.classbin0 -> 1184 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ValueMember.classbin0 -> 1095 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/ValueMemberHelper.classbin0 -> 4773 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/VersionSpecHelper.classbin0 -> 1744 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/VisibilityHelper.classbin0 -> 1776 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/WCharSeqHelper.classbin0 -> 2065 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/WCharSeqHolder.classbin0 -> 1494 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/WStringSeqHelper.classbin0 -> 2278 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/WStringSeqHolder.classbin0 -> 1656 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/WStringValueHelper.classbin0 -> 2950 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/WrongTransaction.classbin0 -> 456 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/WrongTransactionHelper.classbin0 -> 2642 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/WrongTransactionHolder.classbin0 -> 1257 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/_IDLTypeStub.classbin0 -> 2887 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/_PolicyStub.classbin0 -> 2534 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/ApplicationException.classbin0 -> 865 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/BoxedValueHelper.classbin0 -> 347 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/CustomValue.classbin0 -> 201 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/Delegate.classbin0 -> 4453 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/IDLEntity.classbin0 -> 150 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/IndirectionException.classbin0 -> 689 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/InputStream.classbin0 -> 1973 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/InvokeHandler.classbin0 -> 342 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/ObjectImpl.classbin0 -> 6331 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/OutputStream.classbin0 -> 2185 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/RemarshalException.classbin0 -> 420 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/ResponseHandler.classbin0 -> 229 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/ServantObject.classbin0 -> 349 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/Streamable.classbin0 -> 287 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/StreamableValue.classbin0 -> 283 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/UnknownException.classbin0 -> 862 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/ValueBase.classbin0 -> 213 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA/portable/ValueFactory.classbin0 -> 216 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA_2_3/ORB.classbin0 -> 1214 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA_2_3/portable/Delegate.classbin0 -> 485 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA_2_3/portable/InputStream.classbin0 -> 2118 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA_2_3/portable/ObjectImpl.classbin0 -> 1190 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CORBA_2_3/portable/OutputStream.classbin0 -> 1870 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/Binding.classbin0 -> 655 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/BindingHelper.classbin0 -> 3450 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/BindingHolder.classbin0 -> 1204 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/BindingIterator.classbin0 -> 419 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/BindingIteratorHelper.classbin0 -> 3291 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/BindingIteratorHolder.classbin0 -> 1271 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/BindingIteratorOperations.classbin0 -> 292 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/BindingIteratorPOA.classbin0 -> 3104 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/BindingListHelper.classbin0 -> 2886 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/BindingListHolder.classbin0 -> 1245 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/BindingType.classbin0 -> 1151 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/BindingTypeHelper.classbin0 -> 2576 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/BindingTypeHolder.classbin0 -> 1239 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/IstringHelper.classbin0 -> 1736 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NameComponent.classbin0 -> 1628 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NameComponentHelper.classbin0 -> 2932 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NameComponentHolder.classbin0 -> 1255 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NameHelper.classbin0 -> 2941 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NameHolder.classbin0 -> 1223 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContext.classbin0 -> 1280 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextExt.classbin0 -> 262 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextExtHelper.classbin0 -> 3314 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextExtHolder.classbin0 -> 1276 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextExtOperations.classbin0 -> 783 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPOA.classbin0 -> 9433 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/AddressHelper.classbin0 -> 1957 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/InvalidAddress.classbin0 -> 635 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHelper.classbin0 -> 2467 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHolder.classbin0 -> 1431 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/StringNameHelper.classbin0 -> 1952 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/URLStringHelper.classbin0 -> 1947 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextHelper.classbin0 -> 3408 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextHolder.classbin0 -> 1255 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextOperations.classbin0 -> 1183 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPOA.classbin0 -> 7525 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/AlreadyBound.classbin0 -> 595 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.classbin0 -> 2720 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHolder.classbin0 -> 1394 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/CannotProceed.classbin0 -> 1056 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/CannotProceedHelper.classbin0 -> 3876 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/CannotProceedHolder.classbin0 -> 1399 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/InvalidName.classbin0 -> 592 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.classbin0 -> 2711 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/InvalidNameHolder.classbin0 -> 1386 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotEmpty.classbin0 -> 583 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.classbin0 -> 2672 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotEmptyHolder.classbin0 -> 1359 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFound.classbin0 -> 1115 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundHelper.classbin0 -> 3905 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundHolder.classbin0 -> 1362 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundReason.classbin0 -> 1350 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.classbin0 -> 2858 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHolder.classbin0 -> 1410 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/_BindingIteratorImplBase.classbin0 -> 3208 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/_BindingIteratorStub.classbin0 -> 3449 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/_NamingContextExtImplBase.classbin0 -> 5393 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/_NamingContextExtStub.classbin0 -> 4329 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/_NamingContextImplBase.classbin0 -> 8183 bytes
-rw-r--r--libjava/classpath/lib/org/omg/CosNaming/_NamingContextStub.classbin0 -> 8173 bytes
-rw-r--r--libjava/classpath/lib/org/omg/Dynamic/Parameter.classbin0 -> 708 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/AnySeqHelper.classbin0 -> 1820 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynAny.classbin0 -> 251 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactory.classbin0 -> 272 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryHelper.classbin0 -> 2755 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryOperations.classbin0 -> 417 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCode.classbin0 -> 649 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.classbin0 -> 2917 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynAnyHelper.classbin0 -> 2467 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynAnyOperations.classbin0 -> 2284 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/InvalidValue.classbin0 -> 611 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.classbin0 -> 2758 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/TypeMismatch.classbin0 -> 611 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.classbin0 -> 2758 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynAnySeqHelper.classbin0 -> 2483 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynArray.classbin0 -> 290 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynArrayHelper.classbin0 -> 2493 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynArrayOperations.classbin0 -> 550 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynEnum.classbin0 -> 287 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynEnumHelper.classbin0 -> 2480 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynEnumOperations.classbin0 -> 415 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynFixed.classbin0 -> 290 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynFixedHelper.classbin0 -> 2493 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynFixedOperations.classbin0 -> 393 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynSequence.classbin0 -> 299 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynSequenceHelper.classbin0 -> 2532 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynSequenceOperations.classbin0 -> 621 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynStruct.classbin0 -> 293 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynStructHelper.classbin0 -> 2506 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynStructOperations.classbin0 -> 728 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynUnion.classbin0 -> 290 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynUnionHelper.classbin0 -> 2493 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynUnionOperations.classbin0 -> 724 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynValue.classbin0 -> 331 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynValueBox.classbin0 -> 340 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynValueBoxOperations.classbin0 -> 631 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynValueCommon.classbin0 -> 383 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynValueCommonOperations.classbin0 -> 266 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynValueHelper.classbin0 -> 2493 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/DynValueOperations.classbin0 -> 797 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/FieldNameHelper.classbin0 -> 1749 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/NameDynAnyPair.classbin0 -> 712 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/NameDynAnyPairHelper.classbin0 -> 3058 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/NameDynAnyPairSeqHelper.classbin0 -> 2595 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/NameValuePair.classbin0 -> 693 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/NameValuePairHelper.classbin0 -> 3228 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/NameValuePairSeqHelper.classbin0 -> 2888 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/_DynAnyFactoryStub.classbin0 -> 1629 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/_DynAnyStub.classbin0 -> 6420 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/_DynArrayStub.classbin0 -> 6920 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/_DynEnumStub.classbin0 -> 6718 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/_DynFixedStub.classbin0 -> 6558 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/_DynSequenceStub.classbin0 -> 7118 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/_DynStructStub.classbin0 -> 7220 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/_DynUnionStub.classbin0 -> 7225 bytes
-rw-r--r--libjava/classpath/lib/org/omg/DynamicAny/_DynValueStub.classbin0 -> 7486 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/CodeSets.classbin0 -> 158 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/Codec.classbin0 -> 206 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/CodecFactory.classbin0 -> 227 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/CodecFactoryHelper.classbin0 -> 2591 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/CodecFactoryOperations.classbin0 -> 282 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/CodecFactoryPackage/UnknownEncoding.classbin0 -> 618 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.classbin0 -> 2785 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/CodecOperations.classbin0 -> 501 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/CodecPackage/FormatMismatch.classbin0 -> 601 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/CodecPackage/FormatMismatchHelper.classbin0 -> 2710 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/CodecPackage/InvalidTypeForEncoding.classbin0 -> 625 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.classbin0 -> 2810 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/CodecPackage/TypeMismatch.classbin0 -> 595 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/CodecPackage/TypeMismatchHelper.classbin0 -> 2686 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/ComponentIdHelper.classbin0 -> 1733 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/ENCODING_CDR_ENCAPS.classbin0 -> 180 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/Encoding.classbin0 -> 687 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/ExceptionDetailMessage.classbin0 -> 186 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/IOR.classbin0 -> 740 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/IORHelper.classbin0 -> 3250 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/IORHolder.classbin0 -> 1139 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/MultipleComponentProfileHelper.classbin0 -> 2658 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/MultipleComponentProfileHolder.classbin0 -> 1275 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/ProfileIdHelper.classbin0 -> 1719 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/RMICustomMaxStreamFormat.classbin0 -> 190 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/ServiceContext.classbin0 -> 644 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/ServiceContextHelper.classbin0 -> 3345 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/ServiceContextHolder.classbin0 -> 1227 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/ServiceContextListHelper.classbin0 -> 2700 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/ServiceContextListHolder.classbin0 -> 1247 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/ServiceIdHelper.classbin0 -> 1719 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TAG_ALTERNATE_IIOP_ADDRESS.classbin0 -> 194 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TAG_CODE_SETS.classbin0 -> 168 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TAG_INTERNET_IOP.classbin0 -> 174 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TAG_JAVA_CODEBASE.classbin0 -> 176 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TAG_MULTIPLE_COMPONENTS.classbin0 -> 188 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TAG_ORB_TYPE.classbin0 -> 166 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TAG_POLICIES.classbin0 -> 166 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.classbin0 -> 206 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TaggedComponent.classbin0 -> 637 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TaggedComponentHelper.classbin0 -> 3538 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TaggedComponentHolder.classbin0 -> 1235 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TaggedProfile.classbin0 -> 627 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TaggedProfileHelper.classbin0 -> 3718 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TaggedProfileHolder.classbin0 -> 1219 bytes
-rw-r--r--libjava/classpath/lib/org/omg/IOP/TransactionService.classbin0 -> 178 bytes
-rw-r--r--libjava/classpath/lib/org/omg/Messaging/SYNC_WITH_TRANSPORT.classbin0 -> 186 bytes
-rw-r--r--libjava/classpath/lib/org/omg/Messaging/SyncScopeHelper.classbin0 -> 1782 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ACTIVE.classbin0 -> 170 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/AdapterManagerIdHelper.classbin0 -> 1808 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/AdapterNameHelper.classbin0 -> 2073 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/AdapterStateHelper.classbin0 -> 1793 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInfo.classbin0 -> 321 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInfoOperations.classbin0 -> 831 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInterceptor.classbin0 -> 342 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.classbin0 -> 497 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/Current.classbin0 -> 245 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/CurrentHelper.classbin0 -> 2240 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/CurrentOperations.classbin0 -> 386 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/DISCARDING.classbin0 -> 178 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ForwardRequest.classbin0 -> 849 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ForwardRequestHelper.classbin0 -> 3204 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/HOLDING.classbin0 -> 172 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/INACTIVE.classbin0 -> 174 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/IORInfo.classbin0 -> 272 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/IORInfoOperations.classbin0 -> 623 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor.classbin0 -> 397 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptorOperations.classbin0 -> 288 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0.classbin0 -> 299 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.classbin0 -> 3462 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0Holder.classbin0 -> 1371 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0Operations.classbin0 -> 442 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/Interceptor.classbin0 -> 256 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/InterceptorOperations.classbin0 -> 213 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/InvalidSlot.classbin0 -> 598 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/InvalidSlotHelper.classbin0 -> 2708 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/LOCATION_FORWARD.classbin0 -> 190 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/NON_EXISTENT.classbin0 -> 182 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ORBIdHelper.classbin0 -> 1753 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfo.classbin0 -> 256 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoOperations.classbin0 -> 1047 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateName.classbin0 -> 821 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHelper.classbin0 -> 3155 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidName.classbin0 -> 636 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.classbin0 -> 2872 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.classbin0 -> 1818 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitializer.classbin0 -> 265 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitializerOperations.classbin0 -> 243 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ObjectIdHelper.classbin0 -> 1757 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceFactory.classbin0 -> 302 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.classbin0 -> 2808 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceFactoryHolder.classbin0 -> 1403 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplate.classbin0 -> 320 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.classbin0 -> 2841 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateHolder.classbin0 -> 1411 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHelper.classbin0 -> 3255 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHolder.classbin0 -> 1427 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/PolicyFactory.classbin0 -> 262 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/PolicyFactoryOperations.classbin0 -> 280 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/RequestInfo.classbin0 -> 256 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/RequestInfoOperations.classbin0 -> 845 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/SUCCESSFUL.classbin0 -> 178 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/SYSTEM_EXCEPTION.classbin0 -> 190 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ServerIdHelper.classbin0 -> 1768 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInfo.classbin0 -> 321 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInfoOperations.classbin0 -> 793 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInterceptor.classbin0 -> 342 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.classbin0 -> 524 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/TRANSPORT_RETRY.classbin0 -> 188 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/USER_EXCEPTION.classbin0 -> 186 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableInterceptor/_IORInterceptor_3_0Stub.classbin0 -> 4213 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/AdapterActivator.classbin0 -> 261 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/AdapterActivatorOperations.classbin0 -> 234 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/Current.classbin0 -> 235 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/CurrentHelper.classbin0 -> 2186 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/CurrentOperations.classbin0 -> 345 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/CurrentPackage/NoContext.classbin0 -> 612 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/CurrentPackage/NoContextHelper.classbin0 -> 2767 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/DynamicImplementation.classbin0 -> 400 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ForwardRequest.classbin0 -> 859 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ForwardRequestHelper.classbin0 -> 2895 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ID_ASSIGNMENT_POLICY_ID.classbin0 -> 199 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ID_UNIQUENESS_POLICY_ID.classbin0 -> 199 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/IMPLICIT_ACTIVATION_POLICY_ID.classbin0 -> 211 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/IdAssignmentPolicy.classbin0 -> 267 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/IdAssignmentPolicyOperations.classbin0 -> 267 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/IdAssignmentPolicyValue.classbin0 -> 1654 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/IdUniquenessPolicy.classbin0 -> 267 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/IdUniquenessPolicyOperations.classbin0 -> 267 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/IdUniquenessPolicyValue.classbin0 -> 1662 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ImplicitActivationPolicy.classbin0 -> 285 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ImplicitActivationPolicyOperations.classbin0 -> 285 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ImplicitActivationPolicyValue.classbin0 -> 1738 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/LIFESPAN_POLICY_ID.classbin0 -> 189 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/LifespanPolicy.classbin0 -> 255 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/LifespanPolicyOperations.classbin0 -> 255 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/LifespanPolicyValue.classbin0 -> 1640 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POA.classbin0 -> 222 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAHelper.classbin0 -> 2396 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAManager.classbin0 -> 243 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAManagerOperations.classbin0 -> 444 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAManagerPackage/AdapterInactive.classbin0 -> 636 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.classbin0 -> 2866 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAManagerPackage/State.classbin0 -> 1802 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAOperations.classbin0 -> 3397 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterAlreadyExists.classbin0 -> 637 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.classbin0 -> 2943 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterNonExistent.classbin0 -> 631 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.classbin0 -> 2915 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/InvalidPolicy.classbin0 -> 1185 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/InvalidPolicyHelper.classbin0 -> 3122 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/NoServant.classbin0 -> 604 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/NoServantHelper.classbin0 -> 2807 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectAlreadyActive.classbin0 -> 634 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.classbin0 -> 2931 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectNotActive.classbin0 -> 622 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.classbin0 -> 2879 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantAlreadyActive.classbin0 -> 637 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.classbin0 -> 2943 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantNotActive.classbin0 -> 625 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.classbin0 -> 2891 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongAdapter.classbin0 -> 613 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongAdapterHelper.classbin0 -> 2843 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongPolicy.classbin0 -> 610 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongPolicyHelper.classbin0 -> 2831 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/REQUEST_PROCESSING_POLICY_ID.classbin0 -> 209 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/RequestProcessingPolicy.classbin0 -> 282 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/RequestProcessingPolicyOperations.classbin0 -> 282 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/RequestProcessingPolicyValue.classbin0 -> 1862 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/SERVANT_RETENTION_POLICY_ID.classbin0 -> 207 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/Servant.classbin0 -> 3457 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantActivator.classbin0 -> 306 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantActivatorHelper.classbin0 -> 2476 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantActivatorOperations.classbin0 -> 456 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantActivatorPOA$delegator.classbin0 -> 1364 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantActivatorPOA.classbin0 -> 1737 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantLocator.classbin0 -> 300 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantLocatorHelper.classbin0 -> 2482 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantLocatorOperations.classbin0 -> 562 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantLocatorPOA$delegator.classbin0 -> 1785 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantLocatorPOA.classbin0 -> 1719 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.classbin0 -> 1045 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantManager.classbin0 -> 255 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantManagerOperations.classbin0 -> 152 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantRetentionPolicy.classbin0 -> 279 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantRetentionPolicyOperations.classbin0 -> 279 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ServantRetentionPolicyValue.classbin0 -> 1674 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/THREAD_POLICY_ID.classbin0 -> 185 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ThreadPolicy.classbin0 -> 249 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ThreadPolicyOperations.classbin0 -> 249 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/ThreadPolicyValue.classbin0 -> 1658 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/_ServantActivatorStub.classbin0 -> 1441 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/_ServantLocatorStub.classbin0 -> 1730 bytes
-rw-r--r--libjava/classpath/lib/org/omg/PortableServer/portable/Delegate.classbin0 -> 600 bytes
-rw-r--r--libjava/classpath/lib/org/omg/SendingContext/RunTime.classbin0 -> 262 bytes
-rw-r--r--libjava/classpath/lib/org/omg/SendingContext/RunTimeOperations.classbin0 -> 138 bytes
-rw-r--r--libjava/classpath/lib/org/omg/stub/java/rmi/_Remote_Stub.classbin0 -> 549 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/Datatype.classbin0 -> 920 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/DatatypeBuilder.classbin0 -> 375 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/DatatypeException.classbin0 -> 740 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/DatatypeLibrary.classbin0 -> 381 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/DatatypeLibraryFactory.classbin0 -> 239 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/DatatypeStreamingValidator.classbin0 -> 306 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/ValidationContext.classbin0 -> 326 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$Loader.classbin0 -> 1749 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$Loader2.classbin0 -> 1756 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$ProviderEnumeration.classbin0 -> 1656 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$Singleton.classbin0 -> 1126 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service.classbin0 -> 4546 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader.classbin0 -> 1250 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.classbin0 -> 1013 bytes
-rw-r--r--libjava/classpath/lib/org/relaxng/datatype/helpers/StreamingValidatorImpl.classbin0 -> 1449 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/Attr.classbin0 -> 432 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/CDATASection.classbin0 -> 141 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/CharacterData.classbin0 -> 558 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/Comment.classbin0 -> 140 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/DOMConfiguration.classbin0 -> 445 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/DOMError.classbin0 -> 470 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/DOMErrorHandler.classbin0 -> 173 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/DOMException.classbin0 -> 1156 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/DOMImplementation.classbin0 -> 561 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/DOMImplementationList.classbin0 -> 213 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/DOMImplementationSource.classbin0 -> 317 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/DOMLocator.classbin0 -> 306 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/DOMStringList.classbin0 -> 227 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/Document.classbin0 -> 2096 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/DocumentFragment.classbin0 -> 149 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/DocumentType.classbin0 -> 330 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/Element.classbin0 -> 1532 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/Entity.classbin0 -> 298 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/EntityReference.classbin0 -> 147 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/NameList.classbin0 -> 309 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/NamedNodeMap.classbin0 -> 566 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/Node.classbin0 -> 2560 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/NodeList.classbin0 -> 174 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/Notation.classbin0 -> 200 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ProcessingInstruction.classbin0 -> 315 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/Text.classbin0 -> 398 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/TypeInfo.classbin0 -> 437 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/UserDataHandler.classbin0 -> 419 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$1.classbin0 -> 1248 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$2.classbin0 -> 842 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$3.classbin0 -> 786 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$4.classbin0 -> 1067 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry.classbin0 -> 5443 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSS2Properties.classbin0 -> 7355 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSSCharsetRule.classbin0 -> 300 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSSFontFaceRule.classbin0 -> 219 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSSImportRule.classbin0 -> 314 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSSMediaRule.classbin0 -> 404 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSSPageRule.classbin0 -> 363 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSSPrimitiveValue.classbin0 -> 1487 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSSRule.classbin0 -> 663 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSSRuleList.classbin0 -> 191 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSSStyleDeclaration.classbin0 -> 700 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSSStyleRule.classbin0 -> 365 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSSStyleSheet.classbin0 -> 411 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSSUnknownRule.classbin0 -> 156 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSSValue.classbin0 -> 457 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/CSSValueList.classbin0 -> 226 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/Counter.classbin0 -> 204 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/DOMImplementationCSS.classbin0 -> 329 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/DocumentCSS.classbin0 -> 272 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/ElementCSSInlineStyle.classbin0 -> 200 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/RGBColor.classbin0 -> 207 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/Rect.classbin0 -> 219 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/css/ViewCSS.classbin0 -> 257 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/events/DocumentEvent.classbin0 -> 250 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/events/Event.classbin0 -> 578 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/events/EventException.classbin0 -> 518 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/events/EventListener.classbin0 -> 180 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/events/EventTarget.classbin0 -> 356 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/events/MouseEvent.classbin0 -> 549 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/events/MutationEvent.classbin0 -> 572 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/events/UIEvent.classbin0 -> 308 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLAnchorElement.classbin0 -> 737 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLAppletElement.classbin0 -> 658 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLAreaElement.classbin0 -> 557 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLBRElement.classbin0 -> 247 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLBaseElement.classbin0 -> 289 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLBaseFontElement.classbin0 -> 344 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLBodyElement.classbin0 -> 451 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLButtonElement.classbin0 -> 527 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLCollection.classbin0 -> 253 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLDListElement.classbin0 -> 223 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLDirectoryElement.classbin0 -> 231 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLDivElement.classbin0 -> 249 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLDocument.classbin0 -> 780 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLElement.classbin0 -> 381 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLFieldSetElement.classbin0 -> 232 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLFontElement.classbin0 -> 323 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLFormElement.classbin0 -> 591 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLFrameElement.classbin0 -> 640 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLFrameSetElement.classbin0 -> 293 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLHRElement.classbin0 -> 376 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLHeadElement.classbin0 -> 255 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLHeadingElement.classbin0 -> 257 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLHtmlElement.classbin0 -> 255 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLIFrameElement.classbin0 -> 701 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLImageElement.classbin0 -> 703 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLInputElement.classbin0 -> 1075 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLIsIndexElement.classbin0 -> 317 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLLIElement.classbin0 -> 296 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLLabelElement.classbin0 -> 361 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLLegendElement.classbin0 -> 359 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLLinkElement.classbin0 -> 574 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLMapElement.classbin0 -> 305 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLMenuElement.classbin0 -> 221 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLMetaElement.classbin0 -> 377 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLModElement.classbin0 -> 291 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLOListElement.classbin0 -> 357 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLObjectElement.classbin0 -> 1035 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLOptGroupElement.classbin0 -> 316 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLOptionElement.classbin0 -> 553 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLOptionsCollection.classbin0 -> 347 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLParagraphElement.classbin0 -> 261 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLParamElement.classbin0 -> 371 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLPreElement.classbin0 -> 215 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLQuoteElement.classbin0 -> 251 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLScriptElement.classbin0 -> 496 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLSelectElement.classbin0 -> 921 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLStyleElement.classbin0 -> 346 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLTableCaptionElement.classbin0 -> 267 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLTableCellElement.classbin0 -> 816 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLTableColElement.classbin0 -> 456 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLTableElement.classbin0 -> 1336 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLTableRowElement.classbin0 -> 675 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLTableSectionElement.classbin0 -> 581 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLTextAreaElement.classbin0 -> 753 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLTitleElement.classbin0 -> 251 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/html2/HTMLUListElement.classbin0 -> 306 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ls/DOMImplementationLS.classbin0 -> 533 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ls/LSException.classbin0 -> 521 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ls/LSInput.classbin0 -> 648 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ls/LSLoadEvent.classbin0 -> 250 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ls/LSOutput.classbin0 -> 451 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ls/LSParser.classbin0 -> 924 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ls/LSParserFilter.classbin0 -> 418 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ls/LSProgressEvent.classbin0 -> 257 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ls/LSResourceResolver.classbin0 -> 277 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ls/LSSerializer.classbin0 -> 688 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ls/LSSerializerFilter.classbin0 -> 202 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ranges/DocumentRange.classbin0 -> 179 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ranges/Range.classbin0 -> 1408 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/ranges/RangeException.classbin0 -> 559 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/stylesheets/DocumentStyle.classbin0 -> 201 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/stylesheets/LinkStyle.classbin0 -> 183 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/stylesheets/MediaList.classbin0 -> 400 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/stylesheets/StyleSheet.classbin0 -> 436 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/stylesheets/StyleSheetList.classbin0 -> 216 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/traversal/DocumentTraversal.classbin0 -> 444 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/traversal/NodeFilter.classbin0 -> 801 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/traversal/NodeIterator.classbin0 -> 427 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/traversal/TreeWalker.classbin0 -> 574 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/views/AbstractView.classbin0 -> 182 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/views/DocumentView.classbin0 -> 185 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/xpath/XPathEvaluator.classbin0 -> 569 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/xpath/XPathException.classbin0 -> 544 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/xpath/XPathExpression.classbin0 -> 301 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/xpath/XPathNSResolver.classbin0 -> 199 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/xpath/XPathNamespace.classbin0 -> 267 bytes
-rw-r--r--libjava/classpath/lib/org/w3c/dom/xpath/XPathResult.classbin0 -> 1060 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/AttributeList.classbin0 -> 300 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/Attributes.classbin0 -> 484 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/ContentHandler.classbin0 -> 799 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/DTDHandler.classbin0 -> 366 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/DocumentHandler.classbin0 -> 617 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/EntityResolver.classbin0 -> 291 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/ErrorHandler.classbin0 -> 282 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/HandlerBase.classbin0 -> 2468 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/InputSource.classbin0 -> 1772 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/Locator.classbin0 -> 230 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/Parser.classbin0 -> 587 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/SAXException.classbin0 -> 1117 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/SAXNotRecognizedException.classbin0 -> 477 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/SAXNotSupportedException.classbin0 -> 474 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/SAXParseException.classbin0 -> 1971 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/XMLFilter.classbin0 -> 237 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/XMLReader.classbin0 -> 1101 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/ext/Attributes2.classbin0 -> 297 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/ext/Attributes2Impl.classbin0 -> 3721 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/ext/DeclHandler.classbin0 -> 504 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/ext/DefaultHandler2.classbin0 -> 2469 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/ext/EntityResolver2.classbin0 -> 473 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/ext/LexicalHandler.classbin0 -> 474 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/ext/Locator2.classbin0 -> 209 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/ext/Locator2Impl.classbin0 -> 1050 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/helpers/AttributeListImpl.classbin0 -> 2485 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/helpers/AttributesImpl.classbin0 -> 5438 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/helpers/DefaultHandler.classbin0 -> 2922 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/helpers/LocatorImpl.classbin0 -> 1480 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/helpers/NamespaceSupport$Context.classbin0 -> 3777 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/helpers/NamespaceSupport.classbin0 -> 3965 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/helpers/NewInstance.classbin0 -> 1771 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/helpers/ParserAdapter$AttributeListAdapter.classbin0 -> 2443 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/helpers/ParserAdapter.classbin0 -> 11822 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/helpers/ParserFactory.classbin0 -> 1233 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/helpers/XMLFilterImpl.classbin0 -> 6984 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/helpers/XMLReaderAdapter$AttributesAdapter.classbin0 -> 1477 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/helpers/XMLReaderAdapter.classbin0 -> 4848 bytes
-rw-r--r--libjava/classpath/lib/org/xml/sax/helpers/XMLReaderFactory.classbin0 -> 3227 bytes
-rw-r--r--libjava/classpath/lib/standard.omit2
-rw-r--r--libjava/classpath/lib/sun/misc/Service.classbin0 -> 715 bytes
-rw-r--r--libjava/classpath/lib/sun/misc/ServiceConfigurationError.classbin0 -> 462 bytes
-rw-r--r--libjava/classpath/lib/sun/misc/Unsafe.classbin0 -> 1550 bytes
-rw-r--r--libjava/classpath/lib/sun/reflect/Reflection.classbin0 -> 477 bytes
-rw-r--r--libjava/classpath/lib/sun/reflect/annotation/AnnotationInvocationHandler.classbin0 -> 7471 bytes
-rw-r--r--libjava/classpath/lib/sun/reflect/annotation/AnnotationParser.classbin0 -> 926 bytes
-rw-r--r--libjava/classpath/lib/sun/reflect/annotation/AnnotationType.classbin0 -> 671 bytes
-rw-r--r--libjava/classpath/lib/sun/reflect/annotation/EnumConstantNotPresentExceptionProxy.classbin0 -> 580 bytes
-rw-r--r--libjava/classpath/lib/sun/reflect/annotation/ExceptionProxy.classbin0 -> 313 bytes
-rw-r--r--libjava/classpath/lib/sun/reflect/misc/ReflectUtil$MustBeNull.classbin0 -> 392 bytes
-rw-r--r--libjava/classpath/lib/sun/reflect/misc/ReflectUtil.classbin0 -> 1606 bytes
-rwxr-xr-xlibjava/classpath/ltconfig2
-rw-r--r--libjava/classpath/ltmain.sh8
-rw-r--r--libjava/classpath/m4/acinclude.m413
-rw-r--r--libjava/classpath/m4/gcc_attribute.m4133
-rw-r--r--libjava/classpath/native/.cvsignore8
-rw-r--r--libjava/classpath/native/Makefile.am4
-rw-r--r--libjava/classpath/native/Makefile.in15
-rw-r--r--libjava/classpath/native/fdlibm/.cvsignore8
-rw-r--r--libjava/classpath/native/fdlibm/Makefile.in11
-rw-r--r--libjava/classpath/native/fdlibm/mprec.h2
-rw-r--r--libjava/classpath/native/jawt/Makefile.am13
-rw-r--r--libjava/classpath/native/jawt/Makefile.in80
-rw-r--r--libjava/classpath/native/jawt/jawt.c2
-rw-r--r--libjava/classpath/native/jni/.cvsignore8
-rw-r--r--libjava/classpath/native/jni/Makefile.am5
-rw-r--r--libjava/classpath/native/jni/Makefile.in16
-rw-r--r--libjava/classpath/native/jni/classpath/.cvsignore8
-rw-r--r--libjava/classpath/native/jni/classpath/Makefile.in11
-rw-r--r--libjava/classpath/native/jni/classpath/classpath_jawt.h1
-rw-r--r--libjava/classpath/native/jni/classpath/jcl.c131
-rw-r--r--libjava/classpath/native/jni/gconf-peer/.cvsignore6
-rw-r--r--libjava/classpath/native/jni/gconf-peer/GConfNativePeer.c117
-rw-r--r--libjava/classpath/native/jni/gconf-peer/Makefile.in11
-rw-r--r--libjava/classpath/native/jni/gtk-peer/GtkDragSourceContextPeer.c132
-rw-r--r--libjava/classpath/native/jni/gtk-peer/Makefile.am12
-rw-r--r--libjava/classpath/native/jni/gtk-peer/Makefile.in80
-rw-r--r--libjava/classpath/native/jni/gtk-peer/cairographics2d.h3
-rw-r--r--libjava/classpath/native/jni/gtk-peer/gdkfont.h5
-rw-r--r--libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c151
-rw-r--r--libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c24
-rw-r--r--libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c92
-rw-r--r--libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c21
-rw-r--r--libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c2
-rw-r--r--libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c18
-rw-r--r--libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c44
-rw-r--r--libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c2
-rw-r--r--libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c49
-rw-r--r--libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c22
-rw-r--r--libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c64
-rw-r--r--libjava/classpath/native/jni/gtk-peer/gtk_jawt.c35
-rw-r--r--libjava/classpath/native/jni/java-io/.cvsignore8
-rw-r--r--libjava/classpath/native/jni/java-io/Makefile.am3
-rw-r--r--libjava/classpath/native/jni/java-io/Makefile.in18
-rw-r--r--libjava/classpath/native/jni/java-io/java_io_VMFile.c213
-rw-r--r--libjava/classpath/native/jni/java-lang/.cvsignore8
-rw-r--r--libjava/classpath/native/jni/java-lang/Makefile.am3
-rw-r--r--libjava/classpath/native/jni/java-lang/Makefile.in17
-rw-r--r--libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c350
-rw-r--r--libjava/classpath/native/jni/java-lang/java_lang_VMProcess.c185
-rw-r--r--libjava/classpath/native/jni/java-net/.cvsignore8
-rw-r--r--libjava/classpath/native/jni/java-net/Makefile.am5
-rw-r--r--libjava/classpath/native/jni/java-net/Makefile.in24
-rw-r--r--libjava/classpath/native/jni/java-net/gnu_java_net_VMPlainDatagramSocketImpl.c399
-rw-r--r--libjava/classpath/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c1003
-rw-r--r--libjava/classpath/native/jni/java-net/gnu_java_net_local_LocalSocketImpl.c2
-rw-r--r--libjava/classpath/native/jni/java-net/java_net_VMInetAddress.c201
-rw-r--r--libjava/classpath/native/jni/java-net/java_net_VMNetworkInterface.c206
-rw-r--r--libjava/classpath/native/jni/java-net/javanet.c551
-rw-r--r--libjava/classpath/native/jni/java-net/javanet.h9
-rw-r--r--libjava/classpath/native/jni/java-net/local.c2
-rw-r--r--libjava/classpath/native/jni/java-nio/.cvsignore8
-rw-r--r--libjava/classpath/native/jni/java-nio/Makefile.am10
-rw-r--r--libjava/classpath/native/jni/java-nio/Makefile.in30
-rw-r--r--libjava/classpath/native/jni/java-nio/gnu_java_nio_EpollSelectorImpl.c414
-rw-r--r--libjava/classpath/native/jni/java-nio/gnu_java_nio_KqueueSelectorImpl.c387
-rw-r--r--libjava/classpath/native/jni/java-nio/gnu_java_nio_VMChannel.c1511
-rw-r--r--libjava/classpath/native/jni/java-nio/gnu_java_nio_VMPipe.c41
-rw-r--r--libjava/classpath/native/jni/java-nio/gnu_java_nio_VMSelector.c12
-rw-r--r--libjava/classpath/native/jni/java-nio/gnu_java_nio_channels_FileChannelImpl.c902
-rw-r--r--libjava/classpath/native/jni/java-nio/java_nio_MappedByteBufferImpl.c5
-rw-r--r--libjava/classpath/native/jni/java-nio/javanio.c122
-rw-r--r--libjava/classpath/native/jni/java-nio/javanio.h332
-rw-r--r--libjava/classpath/native/jni/java-util/.cvsignore8
-rw-r--r--libjava/classpath/native/jni/java-util/Makefile.in11
-rw-r--r--libjava/classpath/native/jni/midi-alsa/.cvsignore9
-rw-r--r--libjava/classpath/native/jni/midi-alsa/Makefile.in11
-rw-r--r--libjava/classpath/native/jni/midi-dssi/.cvsignore9
-rw-r--r--libjava/classpath/native/jni/midi-dssi/Makefile.am5
-rw-r--r--libjava/classpath/native/jni/midi-dssi/Makefile.in16
-rw-r--r--libjava/classpath/native/jni/midi-dssi/dssi_data.h2
-rw-r--r--libjava/classpath/native/jni/native-lib/.cvsignore8
-rw-r--r--libjava/classpath/native/jni/native-lib/Makefile.am12
-rw-r--r--libjava/classpath/native/jni/native-lib/Makefile.in570
-rw-r--r--libjava/classpath/native/jni/native-lib/cpio.c485
-rw-r--r--libjava/classpath/native/jni/native-lib/cpio.h85
-rw-r--r--libjava/classpath/native/jni/native-lib/cpnative.h49
-rw-r--r--libjava/classpath/native/jni/native-lib/cpnet.c768
-rw-r--r--libjava/classpath/native/jni/native-lib/cpnet.h209
-rw-r--r--libjava/classpath/native/jni/native-lib/cpproc.c136
-rw-r--r--libjava/classpath/native/jni/native-lib/cpproc.h52
-rw-r--r--libjava/classpath/native/jni/qt-peer/Makefile.am3
-rw-r--r--libjava/classpath/native/jni/qt-peer/Makefile.in71
-rw-r--r--libjava/classpath/native/jni/xmlj/.cvsignore8
-rw-r--r--libjava/classpath/native/jni/xmlj/Makefile.in11
-rw-r--r--libjava/classpath/native/plugin/Makefile.am2
-rw-r--r--libjava/classpath/native/plugin/Makefile.in13
-rw-r--r--libjava/classpath/native/plugin/gcjwebplugin.cc9
-rw-r--r--libjava/classpath/native/target/Linux/Makefile.am10
-rw-r--r--libjava/classpath/native/target/Linux/Makefile.in454
-rw-r--r--libjava/classpath/native/target/Linux/target_native.h79
-rw-r--r--libjava/classpath/native/target/Linux/target_native_file.h79
-rw-r--r--libjava/classpath/native/target/Linux/target_native_io.h78
-rw-r--r--libjava/classpath/native/target/Linux/target_native_math_float.h80
-rw-r--r--libjava/classpath/native/target/Linux/target_native_math_int.h80
-rw-r--r--libjava/classpath/native/target/Linux/target_native_misc.h79
-rw-r--r--libjava/classpath/native/target/Linux/target_native_network.h79
-rw-r--r--libjava/classpath/native/target/Makefile.am5
-rw-r--r--libjava/classpath/native/target/Makefile.in604
-rw-r--r--libjava/classpath/native/target/generic/Makefile.am10
-rw-r--r--libjava/classpath/native/target/generic/Makefile.in454
-rw-r--r--libjava/classpath/native/target/generic/target_generic.h171
-rw-r--r--libjava/classpath/native/target/generic/target_generic_file.h844
-rw-r--r--libjava/classpath/native/target/generic/target_generic_io.h82
-rw-r--r--libjava/classpath/native/target/generic/target_generic_math_float.h130
-rw-r--r--libjava/classpath/native/target/generic/target_generic_math_int.h260
-rw-r--r--libjava/classpath/native/target/generic/target_generic_misc.h203
-rw-r--r--libjava/classpath/native/target/generic/target_generic_network.h1289
-rw-r--r--libjava/classpath/native/target/readme.txt149
-rw-r--r--libjava/classpath/org/omg/CORBA/AnyHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/AnySeqHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/AnySeqHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/BooleanHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/BooleanSeqHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/BooleanSeqHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/ByteHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/CharHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/CharSeqHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/CharSeqHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/Context.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/CurrentHelper.java5
-rw-r--r--libjava/classpath/org/omg/CORBA/CustomValue.java5
-rw-r--r--libjava/classpath/org/omg/CORBA/DataOutputStream.java28
-rw-r--r--libjava/classpath/org/omg/CORBA/DefinitionKindHelper.java5
-rw-r--r--libjava/classpath/org/omg/CORBA/DomainManagerOperations.java4
-rw-r--r--libjava/classpath/org/omg/CORBA/DoubleHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/DoubleSeqHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/DoubleSeqHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/DynAny.java10
-rw-r--r--libjava/classpath/org/omg/CORBA/DynSequence.java4
-rw-r--r--libjava/classpath/org/omg/CORBA/DynValue.java4
-rw-r--r--libjava/classpath/org/omg/CORBA/DynamicImplementation.java4
-rw-r--r--libjava/classpath/org/omg/CORBA/FieldNameHelper.java8
-rw-r--r--libjava/classpath/org/omg/CORBA/FixedHolder.java7
-rw-r--r--libjava/classpath/org/omg/CORBA/FloatHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/FloatSeqHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/FloatSeqHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/IdentifierHelper.java8
-rw-r--r--libjava/classpath/org/omg/CORBA/IntHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/LocalObject.java12
-rw-r--r--libjava/classpath/org/omg/CORBA/LongHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/LongLongSeqHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/LongLongSeqHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/LongSeqHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/LongSeqHolder.java10
-rw-r--r--libjava/classpath/org/omg/CORBA/ORB.java65
-rw-r--r--libjava/classpath/org/omg/CORBA/ObjectHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/ObjectHolder.java9
-rw-r--r--libjava/classpath/org/omg/CORBA/OctetSeqHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/OctetSeqHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/PolicyErrorCodeHelper.java10
-rw-r--r--libjava/classpath/org/omg/CORBA/PolicyErrorHelper.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/PolicyHelper.java5
-rw-r--r--libjava/classpath/org/omg/CORBA/PolicyListHelper.java14
-rw-r--r--libjava/classpath/org/omg/CORBA/PolicyTypeHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/PrincipalHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/RepositoryIdHelper.java8
-rw-r--r--libjava/classpath/org/omg/CORBA/Request.java8
-rw-r--r--libjava/classpath/org/omg/CORBA/ShortHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/ShortSeqHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/ShortSeqHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/StringSeqHelper.java3
-rwxr-xr-xlibjava/classpath/org/omg/CORBA/StringSeqHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/ULongLongSeqHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/ULongLongSeqHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/ULongSeqHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/ULongSeqHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/UShortSeqHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/UShortSeqHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/ValueBaseHelper.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/ValueBaseHolder.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/VersionSpecHelper.java8
-rw-r--r--libjava/classpath/org/omg/CORBA/WCharSeqHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/WCharSeqHolder.java10
-rw-r--r--libjava/classpath/org/omg/CORBA/WStringSeqHelper.java3
-rwxr-xr-xlibjava/classpath/org/omg/CORBA/WStringSeqHolder.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/WrongTransactionHelper.java3
-rw-r--r--libjava/classpath/org/omg/CORBA/_IDLTypeStub.java2
-rw-r--r--libjava/classpath/org/omg/CORBA/_PolicyStub.java4
-rw-r--r--libjava/classpath/org/omg/CORBA/portable/BoxedValueHelper.java8
-rw-r--r--libjava/classpath/org/omg/CORBA/portable/Delegate.java6
-rw-r--r--libjava/classpath/org/omg/CORBA/portable/ObjectImpl.java31
-rw-r--r--libjava/classpath/org/omg/CORBA/portable/ServantObject.java4
-rw-r--r--libjava/classpath/org/omg/CORBA/portable/StreamableValue.java4
-rw-r--r--libjava/classpath/org/omg/CORBA/portable/ValueFactory.java2
-rw-r--r--libjava/classpath/org/omg/CORBA_2_3/ORB.java11
-rw-r--r--libjava/classpath/org/omg/CORBA_2_3/portable/InputStream.java8
-rw-r--r--libjava/classpath/org/omg/CORBA_2_3/portable/OutputStream.java12
-rw-r--r--libjava/classpath/org/omg/CosNaming/BindingIteratorHelper.java7
-rw-r--r--libjava/classpath/org/omg/CosNaming/BindingType.java8
-rw-r--r--libjava/classpath/org/omg/CosNaming/BindingTypeHelper.java3
-rw-r--r--libjava/classpath/org/omg/CosNaming/IstringHelper.java10
-rw-r--r--libjava/classpath/org/omg/CosNaming/NameComponentHelper.java4
-rw-r--r--libjava/classpath/org/omg/CosNaming/NameHelper.java3
-rw-r--r--libjava/classpath/org/omg/CosNaming/NamingContextExtHelper.java7
-rw-r--r--libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/AddressHelper.java3
-rw-r--r--libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHelper.java3
-rw-r--r--libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHolder.java3
-rw-r--r--libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/StringNameHelper.java4
-rw-r--r--libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/URLStringHelper.java3
-rw-r--r--libjava/classpath/org/omg/CosNaming/NamingContextHelper.java9
-rw-r--r--libjava/classpath/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.java3
-rw-r--r--libjava/classpath/org/omg/CosNaming/NamingContextPackage/InvalidName.java3
-rw-r--r--libjava/classpath/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.java3
-rw-r--r--libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotEmpty.java2
-rw-r--r--libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.java3
-rw-r--r--libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.java3
-rw-r--r--libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHolder.java6
-rw-r--r--libjava/classpath/org/omg/CosNaming/_NamingContextExtImplBase.java4
-rw-r--r--libjava/classpath/org/omg/CosNaming/_NamingContextImplBase.java4
-rw-r--r--libjava/classpath/org/omg/DynamicAny/AnySeqHelper.java3
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynAnyFactoryHelper.java10
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynAnyFactoryOperations.java5
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.java3
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java10
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynAnyOperations.java12
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.java3
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.java3
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java6
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynArrayHelper.java12
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynEnumHelper.java10
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynFixedHelper.java10
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynSequenceHelper.java10
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynStructHelper.java10
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynStructOperations.java6
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynUnionHelper.java10
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynUnionOperations.java2
-rw-r--r--libjava/classpath/org/omg/DynamicAny/DynValueHelper.java10
-rw-r--r--libjava/classpath/org/omg/DynamicAny/FieldNameHelper.java8
-rw-r--r--libjava/classpath/org/omg/DynamicAny/NameDynAnyPairHelper.java4
-rw-r--r--libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java6
-rw-r--r--libjava/classpath/org/omg/IOP/CodecFactoryHelper.java12
-rw-r--r--libjava/classpath/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.java3
-rw-r--r--libjava/classpath/org/omg/IOP/CodecOperations.java10
-rw-r--r--libjava/classpath/org/omg/IOP/CodecPackage/FormatMismatchHelper.java3
-rw-r--r--libjava/classpath/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.java3
-rw-r--r--libjava/classpath/org/omg/IOP/CodecPackage/TypeMismatchHelper.java3
-rw-r--r--libjava/classpath/org/omg/IOP/ComponentIdHelper.java3
-rw-r--r--libjava/classpath/org/omg/IOP/ExceptionDetailMessage.java4
-rw-r--r--libjava/classpath/org/omg/IOP/MultipleComponentProfileHelper.java5
-rw-r--r--libjava/classpath/org/omg/IOP/ProfileIdHelper.java3
-rw-r--r--libjava/classpath/org/omg/IOP/ServiceContextListHelper.java7
-rw-r--r--libjava/classpath/org/omg/IOP/ServiceIdHelper.java3
-rw-r--r--libjava/classpath/org/omg/IOP/TAG_CODE_SETS.java4
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java5
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java4
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java9
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/IORInfo.java4
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.java3
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/ORBIdHelper.java8
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java12
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.java3
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/ORBInitializerOperations.java4
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java3
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.java3
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/RequestInfoOperations.java5
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/ServerIdHelper.java8
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java5
-rw-r--r--libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.java18
-rw-r--r--libjava/classpath/org/omg/PortableServer/AdapterActivatorOperations.java4
-rw-r--r--libjava/classpath/org/omg/PortableServer/CurrentHelper.java4
-rw-r--r--libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContextHelper.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyValue.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyValue.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyValue.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/LifespanPolicyValue.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/POA.java6
-rw-r--r--libjava/classpath/org/omg/PortableServer/POAHelper.java6
-rw-r--r--libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.java1
-rw-r--r--libjava/classpath/org/omg/PortableServer/POAManagerPackage/State.java6
-rw-r--r--libjava/classpath/org/omg/PortableServer/POAOperations.java32
-rw-r--r--libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicy.java6
-rw-r--r--libjava/classpath/org/omg/PortableServer/POAPackage/NoServantHelper.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapterHelper.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicyHelper.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyValue.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/Servant.java9
-rw-r--r--libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java7
-rw-r--r--libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java8
-rw-r--r--libjava/classpath/org/omg/PortableServer/ServantLocatorOperations.java4
-rw-r--r--libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyValue.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java3
-rw-r--r--libjava/classpath/org/omg/PortableServer/_ServantActivatorStub.java14
-rw-r--r--libjava/classpath/org/omg/PortableServer/_ServantLocatorStub.java2
-rw-r--r--libjava/classpath/org/omg/PortableServer/portable/Delegate.java6
-rw-r--r--libjava/classpath/org/omg/stub/java/rmi/_Remote_Stub.java2
-rw-r--r--libjava/classpath/resource/.cvsignore2
-rw-r--r--libjava/classpath/resource/META-INF/services/.cvsignore1
-rw-r--r--libjava/classpath/resource/META-INF/services/java.util.prefs.PreferencesFactory1
-rw-r--r--libjava/classpath/resource/Makefile.am4
-rw-r--r--libjava/classpath/resource/Makefile.in15
-rw-r--r--libjava/classpath/resource/gnu/classpath/tools/appletviewer/MessagesBundle.properties70
-rw-r--r--libjava/classpath/resource/gnu/classpath/tools/appletviewer/MessagesBundle_de.properties75
-rw-r--r--libjava/classpath/resource/gnu/classpath/tools/appletviewer/messages.properties102
-rw-r--r--libjava/classpath/resource/gnu/classpath/tools/common/Messages.properties40
-rw-r--r--libjava/classpath/resource/gnu/classpath/tools/getopt/Messages.properties3
-rw-r--r--libjava/classpath/resource/gnu/classpath/tools/jarsigner/MessageBundle.properties33
-rw-r--r--libjava/classpath/resource/gnu/classpath/tools/keytool/MessageBundle.properties95
-rw-r--r--libjava/classpath/resource/gnu/classpath/tools/orbd/messages.properties46
-rw-r--r--libjava/classpath/resource/gnu/classpath/tools/rmic/messages.properties61
-rw-r--r--libjava/classpath/resource/gnu/classpath/tools/rmid/messages.properties50
-rw-r--r--libjava/classpath/resource/gnu/classpath/tools/rmiregistry/messages.properties48
-rw-r--r--libjava/classpath/resource/gnu/classpath/tools/tnameserv/messages.properties43
-rw-r--r--libjava/classpath/resource/gnu/java/util/regex/MessagesBundle_it.properties2
-rw-r--r--libjava/classpath/scripts/.cvsignore3
-rw-r--r--libjava/classpath/scripts/Makefile.in11
-rw-r--r--libjava/classpath/scripts/build_mathnamespace6
-rwxr-xr-xlibjava/classpath/scripts/check_jni_methods.sh3
-rw-r--r--libjava/classpath/scripts/checkstyle-config.xml132
-rw-r--r--libjava/classpath/scripts/checkstyle-header.regex38
-rw-r--r--libjava/classpath/scripts/checkstyle-suppressions.xml34
-rw-r--r--libjava/classpath/scripts/checkstyle.css42
-rw-r--r--libjava/classpath/scripts/checkstyle2html.xsl102
-rwxr-xr-xlibjava/classpath/scripts/classpath-build68
-rwxr-xr-xlibjava/classpath/scripts/classpath-daily17
-rw-r--r--libjava/classpath/scripts/classpath.spec.in2
-rw-r--r--libjava/classpath/scripts/eclipse-gnu.xml246
-rw-r--r--libjava/classpath/scripts/jalopy-gnu.xml378
-rwxr-xr-xlibjava/classpath/scripts/japi135
-rwxr-xr-xlibjava/classpath/scripts/kissme-mauve346
-rwxr-xr-xlibjava/classpath/scripts/loc44
-rw-r--r--libjava/classpath/scripts/math_symbols69
-rwxr-xr-xlibjava/classpath/scripts/patches.pl164
-rwxr-xr-xlibjava/classpath/scripts/sanitize-jsr1666
-rwxr-xr-xlibjava/classpath/scripts/timezones.pl366
-rw-r--r--libjava/classpath/scripts/tzabbrevs40
-rwxr-xr-xlibjava/classpath/scripts/unicode-blocks.pl364
-rwxr-xr-xlibjava/classpath/scripts/unicode-muncher.pl868
-rw-r--r--libjava/classpath/sun/misc/Service.java66
-rw-r--r--libjava/classpath/sun/misc/ServiceConfigurationError.java64
-rw-r--r--libjava/classpath/sun/reflect/annotation/AnnotationInvocationHandler.java56
-rw-r--r--libjava/classpath/sun/reflect/annotation/AnnotationParser.java57
-rw-r--r--libjava/classpath/sun/reflect/annotation/AnnotationType.java52
-rw-r--r--libjava/classpath/sun/reflect/annotation/EnumConstantNotPresentExceptionProxy.java52
-rw-r--r--libjava/classpath/sun/reflect/annotation/ExceptionProxy.java46
-rw-r--r--libjava/classpath/tools/.cvsignore13
-rwxr-xr-xlibjava/classpath/tools/Makefile.am254
-rw-r--r--libjava/classpath/tools/Makefile.in782
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/AnnotationVisitor.classbin0 -> 481 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/AnnotationWriter.classbin0 -> 5344 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/Attribute.classbin0 -> 2624 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/ByteVector.classbin0 -> 3259 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/ClassAdapter.classbin0 -> 2432 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/ClassReader.classbin0 -> 22135 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/ClassVisitor.classbin0 -> 894 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/ClassWriter.classbin0 -> 14071 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/Edge.classbin0 -> 360 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/FieldVisitor.classbin0 -> 295 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/FieldWriter.classbin0 -> 3658 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/Handler.classbin0 -> 428 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/Item.classbin0 -> 2190 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/Label.classbin0 -> 2561 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/MethodAdapter.classbin0 -> 4363 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/MethodVisitor.classbin0 -> 1464 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/MethodWriter.classbin0 -> 20587 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/Opcodes.classbin0 -> 5782 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/Type.classbin0 -> 7900 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapAttribute.classbin0 -> 6499 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapFrame.classbin0 -> 1113 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapTableAttribute.classbin0 -> 10012 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapType.classbin0 -> 2422 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/commons/AdviceAdapter.classbin0 -> 7757 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/commons/EmptyVisitor.classbin0 -> 5591 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/commons/GeneratorAdapter.classbin0 -> 18390 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/commons/LocalVariablesSorter.classbin0 -> 2561 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/commons/Method.classbin0 -> 3964 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/commons/SerialVersionUIDAdder$Item.classbin0 -> 946 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/commons/SerialVersionUIDAdder.classbin0 -> 5030 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/commons/StaticInitMerger.classbin0 -> 2143 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/commons/TableSwitchGenerator.classbin0 -> 234 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/optimizer/AnnotationConstantsCollector.classbin0 -> 3362 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/optimizer/ClassConstantsCollector.classbin0 -> 4468 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/optimizer/ClassOptimizer.classbin0 -> 4248 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/optimizer/Constant.classbin0 -> 3227 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/optimizer/ConstantPool.classbin0 -> 4508 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/optimizer/FieldConstantsCollector.classbin0 -> 1547 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/optimizer/JarOptimizer.classbin0 -> 2470 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/optimizer/MethodConstantsCollector.classbin0 -> 4239 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/optimizer/MethodOptimizer.classbin0 -> 2621 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/optimizer/NameMapping.classbin0 -> 2533 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/optimizer/Shrinker$ConstantComparator.classbin0 -> 2004 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/optimizer/Shrinker.classbin0 -> 4058 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/signature/SignatureReader.classbin0 -> 2803 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/signature/SignatureVisitor.classbin0 -> 808 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/signature/SignatureWriter.classbin0 -> 2981 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/AbstractInsnNode.classbin0 -> 994 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/AnnotationNode.classbin0 -> 2730 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/ClassNode.classbin0 -> 4574 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/FieldInsnNode.classbin0 -> 996 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/FieldNode.classbin0 -> 1958 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/IincInsnNode.classbin0 -> 749 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/InnerClassNode.classbin0 -> 836 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/InsnNode.classbin0 -> 994 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/IntInsnNode.classbin0 -> 819 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/JumpInsnNode.classbin0 -> 874 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/LabelNode.classbin0 -> 736 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/LdcInsnNode.classbin0 -> 729 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/LineNumberNode.classbin0 -> 709 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/LocalVariableNode.classbin0 -> 1021 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/LookupSwitchInsnNode.classbin0 -> 1655 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/MemberNode.classbin0 -> 1241 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/MethodInsnNode.classbin0 -> 1000 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/MethodNode$1.classbin0 -> 803 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/MethodNode.classbin0 -> 8683 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/MultiANewArrayInsnNode.classbin0 -> 828 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/TableSwitchInsnNode.classbin0 -> 1401 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/TryCatchBlockNode.classbin0 -> 904 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/TypeInsnNode.classbin0 -> 858 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/VarInsnNode.classbin0 -> 815 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Analyzer.classbin0 -> 8867 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/AnalyzerException.classbin0 -> 1243 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/BasicInterpreter.classbin0 -> 5974 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/BasicValue.classbin0 -> 1962 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/BasicVerifier.classbin0 -> 7836 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/DataflowInterpreter.classbin0 -> 4302 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/DataflowValue.classbin0 -> 1356 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Frame.classbin0 -> 10023 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/IntMap.classbin0 -> 1230 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Interpreter.classbin0 -> 1312 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/SimpleVerifier.classbin0 -> 4833 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/SmallSet.classbin0 -> 1641 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Subroutine.classbin0 -> 1836 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Value.classbin0 -> 147 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierAbstractVisitor.classbin0 -> 4875 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierAnnotationVisitor.classbin0 -> 2587 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierClassVisitor.classbin0 -> 9817 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierFieldVisitor.classbin0 -> 437 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierMethodVisitor.classbin0 -> 7739 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/AbstractVisitor.classbin0 -> 3823 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/CheckAnnotationAdapter.classbin0 -> 2766 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/CheckClassAdapter.classbin0 -> 9728 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/CheckFieldAdapter.classbin0 -> 1588 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/CheckMethodAdapter.classbin0 -> 13225 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/TraceAbstractVisitor.classbin0 -> 2593 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/TraceAnnotationVisitor.classbin0 -> 5991 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/TraceClassVisitor.classbin0 -> 9174 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/TraceFieldVisitor.classbin0 -> 1141 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/TraceMethodVisitor.classbin0 -> 10058 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/TraceSignatureVisitor.classbin0 -> 4781 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/ASMStackMapAttribute.classbin0 -> 5535 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/ASMStackMapTableAttribute.classbin0 -> 5483 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/ASMifiable.classbin0 -> 210 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/Traceable.classbin0 -> 189 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationDefaultRule.classbin0 -> 1399 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationParameterRule.classbin0 -> 1849 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationRule.classbin0 -> 1890 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueAnnotationRule.classbin0 -> 1576 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueArrayRule.classbin0 -> 1497 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueEnumRule.classbin0 -> 1358 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueRule.classbin0 -> 1393 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$ClassRule.classbin0 -> 1839 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$ExceptionRule.classbin0 -> 1267 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$ExceptionsRule.classbin0 -> 1802 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$FieldRule.classbin0 -> 1851 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$InnerClassRule.classbin0 -> 1433 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$InterfaceRule.classbin0 -> 1267 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$InterfacesRule.classbin0 -> 1867 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LabelRule.classbin0 -> 1268 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LineNumberRule.classbin0 -> 1457 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LocalVarRule.classbin0 -> 1709 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LookupSwitchLabelRule.classbin0 -> 1460 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LookupSwitchRule.classbin0 -> 2474 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$MaxRule.classbin0 -> 1312 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$MethodRule.classbin0 -> 1704 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$Opcode.classbin0 -> 525 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$OpcodeGroup.classbin0 -> 594 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$OpcodesRule.classbin0 -> 3082 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$OuterClassRule.classbin0 -> 1331 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$Rule.classbin0 -> 4962 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$RuleSet.classbin0 -> 2077 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$SourceRule.classbin0 -> 1254 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$TableSwitchLabelRule.classbin0 -> 1364 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$TableSwitchRule.classbin0 -> 2394 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$TryCatchRule.classbin0 -> 1526 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler.classbin0 -> 16825 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ASMContentHandlerFactory.classbin0 -> 839 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ContentHandlerFactory.classbin0 -> 299 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$EntryElement.classbin0 -> 367 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$InputSlicingHandler.classbin0 -> 2363 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$OutputSlicingHandler.classbin0 -> 3077 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ProtectedInputStream.classbin0 -> 1130 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SAXWriter.classbin0 -> 4521 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SAXWriterFactory.classbin0 -> 815 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SingleDocElement.classbin0 -> 907 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SubdocumentHandlerFactory.classbin0 -> 749 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$TransformerHandlerFactory.classbin0 -> 1724 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ZipEntryElement.classbin0 -> 1140 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor.classbin0 -> 11122 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXAdapter.classbin0 -> 1848 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXAnnotationAdapter.classbin0 -> 4628 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXClassAdapter.classbin0 -> 6837 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXCodeAdapter.classbin0 -> 7552 bytes
-rw-r--r--libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXFieldAdapter.classbin0 -> 1719 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/AppletClassLoader.classbin0 -> 935 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/AppletSecurityManager.classbin0 -> 1193 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/AppletTag.classbin0 -> 8668 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/CommonAppletContext.classbin0 -> 2750 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/CommonAppletStub.classbin0 -> 1891 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/ErrorApplet.classbin0 -> 648 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$1.classbin0 -> 828 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$10.classbin0 -> 801 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$2.classbin0 -> 828 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$3.classbin0 -> 828 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$4.classbin0 -> 973 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$5.classbin0 -> 974 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$6.classbin0 -> 915 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$7.classbin0 -> 1067 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$8.classbin0 -> 831 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$9.classbin0 -> 799 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main.classbin0 -> 8053 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Messages.classbin0 -> 1169 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/PluginAppletContext.classbin0 -> 1320 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/PluginAppletViewer.classbin0 -> 3918 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/PluginAppletWindow.classbin0 -> 8194 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletContext.classbin0 -> 1397 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.classbin0 -> 4309 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletWindow$1.classbin0 -> 1119 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.classbin0 -> 11928 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/TagParser.classbin0 -> 6630 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/common/CallbackUtil.classbin0 -> 2816 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser$1.classbin0 -> 1028 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser.classbin0 -> 1394 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/common/Messages.classbin0 -> 1151 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/common/Persistent$ExitTask.classbin0 -> 532 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/common/Persistent.classbin0 -> 570 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/common/ProviderUtil$1.classbin0 -> 891 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/common/ProviderUtil$2.classbin0 -> 705 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/common/ProviderUtil.classbin0 -> 2879 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/common/SecurityProviderInfo.classbin0 -> 1215 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/getopt/FileArgumentCallback.classbin0 -> 459 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Messages.classbin0 -> 1151 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Option.classbin0 -> 2640 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/getopt/OptionException.classbin0 -> 391 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/getopt/OptionGroup.classbin0 -> 3894 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$1.classbin0 -> 1061 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$2.classbin0 -> 1119 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$3.classbin0 -> 904 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser.classbin0 -> 8099 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Action.classbin0 -> 393 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.classbin0 -> 6303 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Entry.classbin0 -> 634 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Extractor.classbin0 -> 2938 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Indexer.classbin0 -> 4105 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Lister.classbin0 -> 2941 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$1.classbin0 -> 964 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$2.classbin0 -> 903 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$3.classbin0 -> 899 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$4.classbin0 -> 904 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$5.classbin0 -> 1014 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$6.classbin0 -> 966 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$HandleFile.classbin0 -> 1151 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$JarParser.classbin0 -> 1469 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$ModeOption.classbin0 -> 1413 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main.classbin0 -> 4933 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Messages.classbin0 -> 1142 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/Updater.classbin0 -> 2403 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jar/WorkSet.classbin0 -> 1498 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/HashUtils.classbin0 -> 2539 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/JarSigner.classbin0 -> 5541 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/JarVerifier.classbin0 -> 9109 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$1.classbin0 -> 1187 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$10.classbin0 -> 1136 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$11.classbin0 -> 1138 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$12.classbin0 -> 1201 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$2.classbin0 -> 1188 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$3.classbin0 -> 1192 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$4.classbin0 -> 1190 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$5.classbin0 -> 1193 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$6.classbin0 -> 1199 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$7.classbin0 -> 1130 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$8.classbin0 -> 1129 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$9.classbin0 -> 1131 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$ToolParser.classbin0 -> 3938 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$ToolParserCallback.classbin0 -> 1000 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main.classbin0 -> 11988 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Messages.classbin0 -> 2620 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/SFHelper.classbin0 -> 11138 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/ClassWrapper.classbin0 -> 7779 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/CniIncludePrinter.classbin0 -> 1928 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/CniPrintStream.classbin0 -> 5058 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/CniStubPrinter.classbin0 -> 3940 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/FieldHelper.classbin0 -> 2203 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniHelper.classbin0 -> 2997 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniIncludePrinter.classbin0 -> 4343 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniPrintStream.classbin0 -> 3119 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniStubPrinter.classbin0 -> 3407 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/Keywords.classbin0 -> 2625 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$1.classbin0 -> 1002 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$10.classbin0 -> 928 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$2.classbin0 -> 1106 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$3.classbin0 -> 1111 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$4.classbin0 -> 994 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$5.classbin0 -> 1056 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$6.classbin0 -> 926 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$7.classbin0 -> 1004 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$8.classbin0 -> 924 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$9.classbin0 -> 928 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main.classbin0 -> 10324 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/MethodHelper.classbin0 -> 3041 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/PackageWrapper.classbin0 -> 500 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$1.classbin0 -> 939 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$2.classbin0 -> 1104 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$3.classbin0 -> 1103 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$4.classbin0 -> 1108 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$5.classbin0 -> 1107 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup.classbin0 -> 3120 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/Printer.classbin0 -> 2145 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/javah/Text.classbin0 -> 565 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$1.classbin0 -> 1036 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$2.classbin0 -> 1030 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$3.classbin0 -> 1029 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$4.classbin0 -> 1034 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$5.classbin0 -> 1041 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$6.classbin0 -> 972 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd.classbin0 -> 6606 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$1.classbin0 -> 1035 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$10.classbin0 -> 987 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$2.classbin0 -> 1042 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$3.classbin0 -> 1045 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$4.classbin0 -> 1038 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$5.classbin0 -> 1036 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$6.classbin0 -> 1035 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$7.classbin0 -> 1040 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$8.classbin0 -> 1047 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$9.classbin0 -> 978 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd.classbin0 -> 10386 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Command$ShutdownHook.classbin0 -> 780 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Command.classbin0 -> 19742 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$1.classbin0 -> 1029 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$2.classbin0 -> 1030 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$3.classbin0 -> 1029 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$4.classbin0 -> 1034 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$5.classbin0 -> 1041 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$6.classbin0 -> 972 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd.classbin0 -> 5720 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$1.classbin0 -> 1029 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$2.classbin0 -> 1036 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$3.classbin0 -> 1030 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$4.classbin0 -> 1029 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$5.classbin0 -> 1034 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$6.classbin0 -> 1041 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$7.classbin0 -> 968 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$8.classbin0 -> 972 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd.classbin0 -> 6748 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$1.classbin0 -> 1029 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$10.classbin0 -> 1036 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$11.classbin0 -> 1043 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$12.classbin0 -> 974 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$2.classbin0 -> 1036 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$3.classbin0 -> 1034 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$4.classbin0 -> 1036 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$5.classbin0 -> 1029 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$6.classbin0 -> 1032 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$7.classbin0 -> 1035 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$8.classbin0 -> 1030 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$9.classbin0 -> 1029 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd.classbin0 -> 12086 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$1.classbin0 -> 1059 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$2.classbin0 -> 1054 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$3.classbin0 -> 1053 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$4.classbin0 -> 1058 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$5.classbin0 -> 1065 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$6.classbin0 -> 996 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd.classbin0 -> 4563 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$1.classbin0 -> 1029 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$10.classbin0 -> 974 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$2.classbin0 -> 1036 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$3.classbin0 -> 1032 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$4.classbin0 -> 973 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$5.classbin0 -> 977 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$6.classbin0 -> 1030 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$7.classbin0 -> 1029 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$8.classbin0 -> 1034 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$9.classbin0 -> 1041 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd.classbin0 -> 17535 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$1.classbin0 -> 1041 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$2.classbin0 -> 1045 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$3.classbin0 -> 1044 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$4.classbin0 -> 1047 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$5.classbin0 -> 1042 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$6.classbin0 -> 1041 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$7.classbin0 -> 1046 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$8.classbin0 -> 1053 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$9.classbin0 -> 984 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd.classbin0 -> 8733 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$1.classbin0 -> 1047 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$2.classbin0 -> 1050 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$3.classbin0 -> 1053 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$4.classbin0 -> 1048 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$5.classbin0 -> 1047 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$6.classbin0 -> 1052 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$7.classbin0 -> 1059 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$8.classbin0 -> 990 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd.classbin0 -> 8305 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$1.classbin0 -> 1017 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$2.classbin0 -> 1018 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$3.classbin0 -> 1017 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$4.classbin0 -> 1022 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$5.classbin0 -> 1029 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$6.classbin0 -> 960 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$7.classbin0 -> 956 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd.classbin0 -> 8719 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Main$NoParseOption.classbin0 -> 1130 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Main$ShutdownHook.classbin0 -> 756 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Main.classbin0 -> 8761 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Messages.classbin0 -> 2614 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/PrintCertCmd$1.classbin0 -> 1054 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/PrintCertCmd$2.classbin0 -> 990 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/PrintCertCmd.classbin0 -> 3871 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$1.classbin0 -> 1041 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$10.classbin0 -> 986 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$2.classbin0 -> 1048 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$3.classbin0 -> 1041 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$4.classbin0 -> 1044 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$5.classbin0 -> 1047 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$6.classbin0 -> 1042 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$7.classbin0 -> 1041 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$8.classbin0 -> 1046 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$9.classbin0 -> 1053 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd.classbin0 -> 8750 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$1.classbin0 -> 1065 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$2.classbin0 -> 1060 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$3.classbin0 -> 1059 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$4.classbin0 -> 1064 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$5.classbin0 -> 1071 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$6.classbin0 -> 1002 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd.classbin0 -> 7050 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Messages.classbin0 -> 1169 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII$1.classbin0 -> 1264 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII$2.classbin0 -> 1019 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII$HandleFile.classbin0 -> 1088 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII.classbin0 -> 4073 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$1.classbin0 -> 1106 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$2.classbin0 -> 1052 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$3.classbin0 -> 1048 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$4.classbin0 -> 969 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$5.classbin0 -> 721 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main.classbin0 -> 5449 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Messages.classbin0 -> 1145 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentContext.classbin0 -> 3047 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentContextMap.classbin0 -> 1138 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentMap$Entry.classbin0 -> 2453 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentMap.classbin0 -> 5523 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/AbstractMethodGenerator.classbin0 -> 232 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/ClassRmicCompiler$MethodRef.classbin0 -> 2725 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/ClassRmicCompiler.classbin0 -> 30617 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/CompilationError.classbin0 -> 624 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Generator.classbin0 -> 2992 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/GiopIo.classbin0 -> 2777 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/HashFinder.classbin0 -> 1064 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$1.classbin0 -> 969 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$10.classbin0 -> 971 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$11.classbin0 -> 900 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$12.classbin0 -> 971 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$13.classbin0 -> 971 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$14.classbin0 -> 971 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$15.classbin0 -> 1039 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$16.classbin0 -> 972 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$17.classbin0 -> 1039 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$18.classbin0 -> 900 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$2.classbin0 -> 969 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$3.classbin0 -> 969 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$4.classbin0 -> 1048 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$5.classbin0 -> 1048 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$6.classbin0 -> 960 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$7.classbin0 -> 960 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$8.classbin0 -> 969 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$9.classbin0 -> 969 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main.classbin0 -> 6058 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Messages.classbin0 -> 1145 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/MethodGenerator.classbin0 -> 5369 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RMICException.classbin0 -> 555 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RmiMethodGenerator.classbin0 -> 5210 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RmicBackend.classbin0 -> 271 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.classbin0 -> 12424 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceRmicCompiler.classbin0 -> 3890 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Variables.classbin0 -> 3290 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmic/WrapUnWrapper.classbin0 -> 1244 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmid/ActivationSystemImpl.classbin0 -> 5243 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmid/ActivationSystemImpl_Stub.classbin0 -> 8775 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$1.classbin0 -> 1084 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$2.classbin0 -> 969 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$3.classbin0 -> 969 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$4.classbin0 -> 969 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$5.classbin0 -> 1048 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$6.classbin0 -> 983 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main.classbin0 -> 5921 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Messages.classbin0 -> 1145 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmid/PersistentBidiHashTable$AdaptedReader.classbin0 -> 1111 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmid/PersistentBidiHashTable$WriteToDiskTask.classbin0 -> 755 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmid/PersistentBidiHashTable.classbin0 -> 4185 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$1.classbin0 -> 1011 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$2.classbin0 -> 1011 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$3.classbin0 -> 1011 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$4.classbin0 -> 1090 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$5.classbin0 -> 965 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$6.classbin0 -> 883 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main.classbin0 -> 5715 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Messages.classbin0 -> 1166 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/PersistentHashTable$WriteToDiskTask.classbin0 -> 766 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/PersistentHashTable.classbin0 -> 4109 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/RegistryImpl.classbin0 -> 2942 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/RegistryImpl_Skel.classbin0 -> 4191 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/RegistryImpl_Stub.classbin0 -> 3829 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/serialver/Messages.classbin0 -> 1160 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer$1.classbin0 -> 1171 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer$2.classbin0 -> 1197 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer$3.classbin0 -> 950 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer.classbin0 -> 4402 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Main$1.classbin0 -> 1136 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Main$2.classbin0 -> 1082 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Main.classbin0 -> 2391 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Messages.classbin0 -> 1160 bytes
-rw-r--r--libjava/classpath/tools/external/README9
-rw-r--r--libjava/classpath/tools/external/asm/LICENSE.txt28
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/AnnotationVisitor.java88
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/AnnotationWriter.java311
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/Attribute.java254
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/ByteVector.java293
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/ClassAdapter.java121
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/ClassReader.java1606
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/ClassVisitor.java195
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/ClassWriter.java1162
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/Edge.java57
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/FieldVisitor.java63
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/FieldWriter.java276
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/Handler.java70
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/Item.java252
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/Label.java299
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/MethodAdapter.java185
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/MethodVisitor.java334
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/MethodWriter.java2022
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/Opcodes.java295
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/Type.java760
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapAttribute.java378
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapFrame.java82
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapTableAttribute.java927
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapType.java114
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/package.html48
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/commons/AdviceAdapter.java643
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/commons/EmptyVisitor.java211
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/commons/GeneratorAdapter.java1454
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/commons/LocalVariablesSorter.java136
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/commons/Method.java220
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/commons/SerialVersionUIDAdder.java490
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/commons/StaticInitMerger.java99
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/commons/TableSwitchGenerator.java55
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/commons/package.html33
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/AnnotationConstantsCollector.java150
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/ClassConstantsCollector.java212
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/ClassOptimizer.java182
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/Constant.java265
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/ConstantPool.java198
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/FieldConstantsCollector.java76
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/JarOptimizer.java87
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/MethodConstantsCollector.java168
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/MethodOptimizer.java108
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/NameMapping.java101
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/Shrinker.java168
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/shrink.properties225
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/package.html87
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/signature/SignatureReader.java233
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/signature/SignatureVisitor.java185
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/signature/SignatureWriter.java207
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/signature/package.html36
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/AbstractInsnNode.java143
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/AnnotationNode.java187
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/ClassNode.java283
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/FieldInsnNode.java97
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/FieldNode.java123
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/IincInsnNode.java71
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/InnerClassNode.java101
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/InsnNode.java96
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/IntInsnNode.java75
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/JumpInsnNode.java84
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LabelNode.java54
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LdcInsnNode.java68
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LineNumberNode.java73
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LocalVariableNode.java111
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LookupSwitchInsnNode.java103
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MemberNode.java120
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MethodInsnNode.java98
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MethodNode.java439
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MultiANewArrayInsnNode.java71
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/TableSwitchInsnNode.java102
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/TryCatchBlockNode.java93
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/TypeInsnNode.java78
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/VarInsnNode.java81
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Analyzer.java416
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/AnalyzerException.java56
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/BasicInterpreter.java335
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/BasicValue.java105
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/BasicVerifier.java428
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/DataflowInterpreter.java174
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/DataflowValue.java92
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Frame.java670
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/IntMap.java73
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Interpreter.java178
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/SimpleVerifier.java266
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/SmallSet.java126
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Subroutine.java96
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Value.java45
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/package.html36
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/tree/package.html149
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierAbstractVisitor.java226
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierAnnotationVisitor.java127
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierClassVisitor.java607
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierFieldVisitor.java50
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierMethodVisitor.java347
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/AbstractVisitor.java201
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckAnnotationAdapter.java125
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckClassAdapter.java416
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckFieldAdapter.java75
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckMethodAdapter.java942
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceAbstractVisitor.java180
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceAnnotationVisitor.java272
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceClassVisitor.java534
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceFieldVisitor.java78
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceMethodVisitor.java486
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceSignatureVisitor.java300
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/ASMStackMapAttribute.java223
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/ASMStackMapTableAttribute.java214
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/ASMifiable.java53
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/Traceable.java52
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/package.html36
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/util/package.html40
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/xml/ASMContentHandler.java1215
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/xml/Processor.java1048
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXAdapter.java91
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXAnnotationAdapter.java191
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXClassAdapter.java351
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXCodeAdapter.java310
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXFieldAdapter.java77
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/xml/asm-xml.dtd340
-rw-r--r--libjava/classpath/tools/external/asm/org/objectweb/asm/xml/package.html96
-rw-r--r--libjava/classpath/tools/gjavah.in47
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/AbstractMethodGenerator.java53
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/HelpPrinter.java116
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/appletviewer/AppletWarning.java66
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java3
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/appletviewer/ConsoleDialog.java175
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java123
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/appletviewer/Messages.java67
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java4
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java12
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java4
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java3
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java10
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java33
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/appletviewer/TagParser.java56
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/common/ClasspathToolParser.java87
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/common/Messages.java67
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/common/Persistent.java87
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/getopt/ClasspathToolParser.java73
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/getopt/Messages.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/getopt/Option.java68
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/getopt/OptionGroup.java5
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/getopt/Parser.java99
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/getopt/package.html49
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/GRMIC.java189
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/GRMIC.txt33
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/IorParser.java109
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/IorParser.txt10
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/NameService.java75
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/NameServicePersistent.java186
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/NameServicePersistent.txt28
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/NamingService.txt21
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/README19
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/grmic/CompilationError.java52
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/grmic/Generator.java128
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/grmic/GiopIo.java112
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java593
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/grmic/HashFinder.java84
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/grmic/MethodGenerator.java285
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/nameservice/PersistentContext.java152
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/nameservice/PersistentContextMap.java87
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/giop/nameservice/PersistentMap.java454
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java9
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/jar/Main.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/jarsigner/Main.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java346
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/CniIncludePrinter.java80
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/CniPrintStream.java243
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/CniStubPrinter.java129
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/FieldHelper.java99
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/JniHelper.java120
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/JniIncludePrinter.java158
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/JniPrintStream.java115
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/JniStubPrinter.java106
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/Keywords.java85
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/Main.java441
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/MethodHelper.java130
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/PackageWrapper.java54
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/PathOptionGroup.java135
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/Printer.java138
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/javah/Text.java60
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/CACertCmd.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/CertReqCmd.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/Command.java4
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/DeleteCmd.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/ExportCmd.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/GenKeyCmd.java3
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/IdentityDBCmd.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/ImportCmd.java3
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/KeyCloneCmd.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/KeyPasswdCmd.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/ListCmd.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/Main.java10
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/PrintCertCmd.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/SelfCertCmd.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/keytool/StorePasswdCmd.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/orbd/Main.java228
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/orbd/Messages.java67
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentContext.java152
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentContextMap.java87
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentMap.java454
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/Persistent.java87
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/PersistentBidiHashTable.java268
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/PersistentHashTable.java246
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/REGISTRY.java165
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/REGISTRY.txt28
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/RMIC.java186
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/RMIC.txt45
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/RMID.java189
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/RMID.txt30
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/registry/RegistryImpl.java139
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/registry/RegistryImpl_Skel.java278
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/registry/RegistryImpl_Stub.java263
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java287
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/RmicCompiler.java171
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/WrapUnWrapper.java83
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/rmid/ActivationSystemImpl.java244
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmi/rmid/ActivationSystemImpl_Stub.java556
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/AbstractMethodGenerator.java53
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java1824
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/CompilationError.java52
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/Generator.java128
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/GiopIo.java112
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/HashFinder.java84
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/Main.java282
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/Messages.java67
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/MethodGenerator.java285
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/RMICException.java54
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java287
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/RmicBackend.java31
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java694
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/SourceRmicCompiler.java179
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/Variables.java137
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/WrapUnWrapper.java83
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/templates/ImplTie.jav (renamed from libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/ImplTie.jav)0
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub.jav (renamed from libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/Stub.jav)0
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/templates/StubMethod.jav (renamed from libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/StubMethod.jav)0
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/templates/StubMethodVoid.jav (renamed from libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/StubMethodVoid.jav)0
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12.jav (renamed from libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav)0
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12Method.jav (renamed from libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12Method.jav)0
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12MethodVoid.jav (renamed from libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12MethodVoid.jav)0
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Tie.jav (renamed from libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/Tie.jav)0
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/templates/TieMethod.jav (renamed from libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/TieMethod.jav)0
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmic/templates/TieMethodVoid.jav (renamed from libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/TieMethodVoid.jav)0
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmid/ActivationSystemImpl.java243
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmid/ActivationSystemImpl_Stub.java556
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmid/Main.java259
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmid/Messages.java67
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmid/PersistentBidiHashTable.java269
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmiregistry/Main.java232
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmiregistry/Messages.java67
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmiregistry/PersistentHashTable.java262
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmiregistry/RegistryImpl.java138
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmiregistry/RegistryImpl_Skel.java278
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/rmiregistry/RegistryImpl_Stub.java263
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/serialver/SerialVer.java2
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/tnameserv/Main.java117
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/tnameserv/Messages.java67
-rw-r--r--libjava/classpath/tools/gorbd.in47
-rw-r--r--libjava/classpath/tools/grmic.in47
-rw-r--r--libjava/classpath/tools/grmid.in47
-rw-r--r--libjava/classpath/tools/grmiregistry.in47
-rw-r--r--libjava/classpath/tools/gtnameserv.in47
-rw-r--r--libjava/classpath/tools/toolwrapper.c42
-rw-r--r--libjava/classpath/vm/.cvsignore2
-rw-r--r--libjava/classpath/vm/reference/.cvsignore2
-rw-r--r--libjava/classpath/vm/reference/gnu/classpath/VMStackWalker.java19
-rw-r--r--libjava/classpath/vm/reference/gnu/classpath/jdwp/VMVirtualMachine.java4
-rw-r--r--libjava/classpath/vm/reference/gnu/java/lang/management/VMMemoryMXBeanImpl.java4
-rw-r--r--libjava/classpath/vm/reference/gnu/java/net/VMPlainSocketImpl.java602
-rw-r--r--libjava/classpath/vm/reference/gnu/java/nio/VMChannel.java651
-rw-r--r--libjava/classpath/vm/reference/gnu/java/nio/VMPipe.java24
-rw-r--r--libjava/classpath/vm/reference/java/io/VMFile.java105
-rw-r--r--libjava/classpath/vm/reference/java/io/VMObjectInputStream.java39
-rw-r--r--libjava/classpath/vm/reference/java/lang/VMClassLoader.java3
-rw-r--r--libjava/classpath/vm/reference/java/lang/reflect/Constructor.java24
-rw-r--r--libjava/classpath/vm/reference/java/lang/reflect/Field.java7
-rw-r--r--libjava/classpath/vm/reference/java/lang/reflect/Method.java14
-rw-r--r--libjava/classpath/vm/reference/java/net/VMInetAddress.java10
-rw-r--r--libjava/classpath/vm/reference/java/net/VMNetworkInterface.java74
-rw-r--r--libjava/classpath/vm/reference/java/nio/channels/VMChannels.java2
-rw-r--r--libjava/classpath/vm/reference/sun/reflect/misc/ReflectUtil.java23
9597 files changed, 206694 insertions, 54623 deletions
diff --git a/libjava/classpath/.cdtproject b/libjava/classpath/.cdtproject
new file mode 100644
index 00000000000..2ec939f28d9
--- /dev/null
+++ b/libjava/classpath/.cdtproject
@@ -0,0 +1,3 @@
+<?xml version='1.0'?>
+<?eclipse-cdt version="2.0"?>
+<cdtproject/> \ No newline at end of file
diff --git a/libjava/classpath/.classpath b/libjava/classpath/.classpath
new file mode 100644
index 00000000000..ec7cfd1755f
--- /dev/null
+++ b/libjava/classpath/.classpath
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry excluding=".externalToolBuilders/|.settings/|ChangeLog*|Makefile*|autom4te.cache/|compat/|config*|doc/|examples/|external/|external/relaxngDatatype/|include/|install/|lib/|m4/|native/|resource/|scripts/|test/|testsuite/|tools/|vm/reference/|tools/external/asm/|gnu/java/awt/peer/x/" kind="src" path=""/>
+ <classpathentry excluding=".cvsignore|Makefile|Makefile.am|Makefile.in|README.txt" kind="src" path="external/relaxngDatatype"/>
+ <classpathentry kind="src" path="external/jsr166"/>
+ <classpathentry excluding=".cvsignore|Makefile|Makefile.am|Makefile.in|README|gnu/classpath/tools/javah/|external/asm/" kind="src" path="tools"/>
+ <classpathentry excluding=".cvsignore|Makefile|Makefile.am|Makefile.in" kind="src" path="resource"/>
+ <classpathentry excluding=".cvsignore|Makefile.am" kind="src" path="vm/reference"/>
+ <classpathentry excluding=".cvsignore|Makefile|Makefile.am|Makefile.in|README" kind="src" path="external/sax"/>
+ <classpathentry excluding=".cvsignore|Makefile|Makefile.am|Makefile.in|README" kind="src" path="external/w3c_dom"/>
+ <classpathentry excluding=".cvsignore|Makefile|Makefile.am|Makefile.in|Makefile.jawt|Makefile.jawt.in|README" kind="src" path="examples"/>
+ <classpathentry kind="src" path="tools/external/asm"/>
+ <classpathentry kind="output" path="install/share/classpath"/>
+</classpath>
diff --git a/libjava/classpath/.cvsignore b/libjava/classpath/.cvsignore
new file mode 100644
index 00000000000..422f3b45527
--- /dev/null
+++ b/libjava/classpath/.cvsignore
@@ -0,0 +1,18 @@
+aclocal.m4
+compile
+configure
+config.guess
+config.log
+config.cache
+config.status
+config.sub
+config.h.in
+config.h
+libtool
+ltmain.sh
+Makefile
+Makefile.in
+stamp-h
+stamp-h.in
+autom4te*.cache
+install
diff --git a/libjava/classpath/.externalToolBuilders/Autogen.launch b/libjava/classpath/.externalToolBuilders/Autogen.launch
new file mode 100644
index 00000000000..a6051b111c3
--- /dev/null
+++ b/libjava/classpath/.externalToolBuilders/Autogen.launch
@@ -0,0 +1,2 @@
+<?xml version='1.0'?>
+<launchConfiguration type='org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType'><stringAttribute key='org.eclipse.debug.core.ATTR_REFRESH_SCOPE' value='${project}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS' value='full,incremental,auto,'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE' value='${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;workingSet&quot; editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/external/sax/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/external/w3c_dom/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/test/java.net/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/test/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/java-nio/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/midi-dssi/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/vmi/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/test/java.util/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/target/generic/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/lib/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/fdlibm/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/target/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/target/Linux/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/examples/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jawt/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/gtk-peer/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/classpath/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/midi-alsa/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/test/java.lang.reflect/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/test/java.io/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/external/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/xmlj/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/compat/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/qt-peer/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/vm/reference/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/java-util/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/test/gnu.java.lang.reflect/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/configure.ac&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/compat/java.net/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/include/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/java-lang/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/java-io/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/doc/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/gnu/test/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/doc/api/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/testsuite/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/java-net/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/vm/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native/jni/Makefile.am&quot; type=&quot;1&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_LOCATION' value='/bin/sh'/><booleanAttribute key='org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED' value='true'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY' value='${build_project}'/><booleanAttribute key='org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED' value='true'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS' value='./autogen.sh'/><booleanAttribute key='org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND' value='false'/><booleanAttribute key='org.eclipse.debug.core.appendEnvironmentVariables' value='true'/></launchConfiguration> \ No newline at end of file
diff --git a/libjava/classpath/.externalToolBuilders/ClasspathHeaders.launch b/libjava/classpath/.externalToolBuilders/ClasspathHeaders.launch
new file mode 100644
index 00000000000..0c8481719eb
--- /dev/null
+++ b/libjava/classpath/.externalToolBuilders/ClasspathHeaders.launch
@@ -0,0 +1,2 @@
+<?xml version='1.0'?>
+<launchConfiguration type='org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType'><stringAttribute key='org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS' value='full,incremental,auto,'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE' value='${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;workingSet&quot; editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/include/Makefile&quot; type=&quot;1&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_LOCATION' value='${system_path:make}'/><booleanAttribute key='org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED' value='true'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY' value='${build_project}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS' value='-C ${build_project}/include CLASSDIR=install/share/classpath USER_CLASSLIB=../install/share/classpath all install'/><booleanAttribute key='org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND' value='false'/><booleanAttribute key='org.eclipse.debug.core.appendEnvironmentVariables' value='true'/></launchConfiguration> \ No newline at end of file
diff --git a/libjava/classpath/.externalToolBuilders/ClasspathJar.launch b/libjava/classpath/.externalToolBuilders/ClasspathJar.launch
new file mode 100644
index 00000000000..269e62c0e63
--- /dev/null
+++ b/libjava/classpath/.externalToolBuilders/ClasspathJar.launch
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="true"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot; factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; label=&quot;workingSet&quot; name=&quot;workingSet&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/install/share/classpath&quot; type=&quot;2&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-cf glibj.zip META-INF java gnu org javax vm sun"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${build_project:install/share/classpath}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${system_path:jar}"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+</launchConfiguration>
diff --git a/libjava/classpath/.externalToolBuilders/CompileNative.launch b/libjava/classpath/.externalToolBuilders/CompileNative.launch
new file mode 100644
index 00000000000..c6a6b9f06a9
--- /dev/null
+++ b/libjava/classpath/.externalToolBuilders/CompileNative.launch
@@ -0,0 +1,2 @@
+<?xml version='1.0'?>
+<launchConfiguration type='org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType'><stringAttribute key='org.eclipse.debug.core.ATTR_REFRESH_SCOPE' value='${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;working set&quot; editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native&quot; type=&quot;2&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS' value='full,incremental,auto,'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE' value='${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;workingSet&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/native&quot; type=&quot;2&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_LOCATION' value='${system_path:make}'/><booleanAttribute key='org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED' value='true'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY' value='${build_project}'/><stringAttribute key='org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS' value='-C ${build_project}/native all install'/><booleanAttribute key='org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND' value='false'/><booleanAttribute key='org.eclipse.debug.core.appendEnvironmentVariables' value='true'/></launchConfiguration> \ No newline at end of file
diff --git a/libjava/classpath/.externalToolBuilders/Configure.launch b/libjava/classpath/.externalToolBuilders/Configure.launch
new file mode 100644
index 00000000000..d2347ae8428
--- /dev/null
+++ b/libjava/classpath/.externalToolBuilders/Configure.launch
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
+<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot; factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;workingSet&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/Makefile.in&quot; type=&quot;1&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="--prefix=${build_project}/install --enable-regen-headers --with-ecj"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${build_project}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${build_project}/configure"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+</launchConfiguration>
diff --git a/libjava/classpath/.externalToolBuilders/CreateLocaleData.launch b/libjava/classpath/.externalToolBuilders/CreateLocaleData.launch
new file mode 100644
index 00000000000..0610d24a561
--- /dev/null
+++ b/libjava/classpath/.externalToolBuilders/CreateLocaleData.launch
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;workingSet&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/resource/gnu/java/locale&quot; type=&quot;2&quot;/&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/scripts/generate-locale-list.sh&quot; type=&quot;1&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-C ${build_project}/lib ../gnu/java/locale/LocaleData.java"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;launchConfigurationWorkingSet editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot; factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; name=&quot;working set&quot;&gt;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/classpath/gnu/java/locale&quot; type=&quot;2&quot;/&gt;&#10;&lt;/launchConfigurationWorkingSet&gt;}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${build_project}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${system_path:make}"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+</launchConfiguration>
diff --git a/libjava/classpath/.project b/libjava/classpath/.project
new file mode 100644
index 00000000000..ebc689daf2f
--- /dev/null
+++ b/libjava/classpath/.project
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>classpath</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+ <triggers>auto,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>LaunchConfigHandle</key>
+ <value>&lt;project&gt;/.externalToolBuilders/Autogen.launch</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+ <triggers>auto,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>LaunchConfigHandle</key>
+ <value>&lt;project&gt;/.externalToolBuilders/Configure.launch</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>LaunchConfigHandle</key>
+ <value>&lt;project&gt;/.externalToolBuilders/CreateLocaleData.launch</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+ <triggers>auto,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>LaunchConfigHandle</key>
+ <value>&lt;project&gt;/.externalToolBuilders/ClasspathHeaders.launch</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+ <triggers>auto,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>LaunchConfigHandle</key>
+ <value>&lt;project&gt;/.externalToolBuilders/CompileNative.launch</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+ <triggers>auto,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>LaunchConfigHandle</key>
+ <value>&lt;project&gt;/.externalToolBuilders/ClasspathJar.launch</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/libjava/classpath/.settings/org.eclipse.jdt.core.prefs b/libjava/classpath/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..812e62a8400
--- /dev/null
+++ b/libjava/classpath/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,243 @@
+#Tue Feb 07 05:21:36 EST 2006
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line_shifted
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=18
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=18
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=17
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=17
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.brace_position_for_block=next_line_shifted
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=true
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.lineSplit=80
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=18
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=18
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.blank_lines_before_package=2
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=82
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=18
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=18
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=18
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=18
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=insert
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
diff --git a/libjava/classpath/.settings/org.eclipse.jdt.ui.prefs b/libjava/classpath/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..e03780f20c3
--- /dev/null
+++ b/libjava/classpath/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,12 @@
+#Tue Jan 11 17:36:31 MST 2005
+comment_format_source_code=true
+comment_new_line_for_parameter=true
+comment_format_html=true
+comment_line_length=80
+comment_format_header=false
+eclipse.preferences.version=1
+comment_indent_parameter_description=true
+comment_format_comments=true
+comment_separate_root_tags=true
+comment_clear_blank_lines=true
+comment_indent_root_tags=true
diff --git a/libjava/classpath/AUTHORS b/libjava/classpath/AUTHORS
index 5dd3eab469b..4efc086df61 100644
--- a/libjava/classpath/AUTHORS
+++ b/libjava/classpath/AUTHORS
@@ -9,6 +9,7 @@ Anthony Balkissoon (abalkiss@redhat.com)
Stuart Ballard (stuart.a.ballard@gmail.com)
Mark Benvenuto (mcb54@columbia.edu)
Gary Benson (gbenson@redhat.com)
+Tania Bento (tbento@redhat.com)
Geoff Berry (gcb@gnu.org)
James E. Blair (corvus@gnu.org)
Eric Blake (ebb9@email.byu.edu)
@@ -17,16 +18,19 @@ Chris Burdess (dog@gnu.org)
David Daney (ddaney@avtrex.com)
Nic Ferrier (nferrier@tapsellferrier.co.uk)
Paul Fisher (rao@gnu.org)
+Thomas Fitzsimmons (fitzsim@redhat.com)
+Jeroen Frijters (jeroen@frijters.net)
David Gilbert (david.gilbert@object-refinery.com)
Anthony Green (green@redhat.com)
Jochen Hoenicke (Jochen.Hoenicke@Informatik.Uni-Oldenburg.de)
-Kazumitsu Ito (kaz@maczuka.gcd.org)
Andrew John Hughes (gnu_andrew@member.fsf.org)
+Kazumitsu Ito (kaz@maczuka.gcd.org)
Olivier Jolly (olivier.jolly@pcedev.com)
Brian Jones (cbj@gnu.org)
-Roman Kennke (roman@kennke.org)
-Michael Koch (konqueror@gmx.de)
John Keiser (jkeiser@iname.com)
+Roman Kennke (roman@kennke.org)
+Michael Koch (konqueror@gmx.de)
+Francis Kung (fkung@redhat.com)
John Leuner (jewel@debian.org)
Warren Levy (warrenl@cygnus.com)
Sven de Marothy (sven@physto.se)
@@ -37,6 +41,9 @@ Raif S. Naffah (raif@swiftdsl.com.au)
Aaron M. Renn (arenn@urbanophile.com)
Andrew Selkirk (aselkirk@sympatico.ca)
Christian Thalinger (twisti@complang.tuwien.ac.at)
+Andreas Tobler (a.tobler@schweiz.org)
+Mario Torre (neugens@limasoftware.net)
+Dalibor Topic (robilad@kaffe.org)
Tom Tromey (tromey@cygnus.com)
Ronald Veldema (rveldema@cs.vu.nl)
Mark Wielaard (mark@klomp.org)
diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog
index 13eda590a7f..83de49090b6 100644
--- a/libjava/classpath/ChangeLog
+++ b/libjava/classpath/ChangeLog
@@ -1,50 +1,9047 @@
-2006-08-02 Sven de Marothy <sven@physto.se>
+2006-12-14 Andrew Haley <aph@redhat.com>
- * gnu/java/awt/peer/gtk/GtkChoicePeer.java
- (remove): Force event on removing item 0 when it's selected.
- (handleEvent): Always call Choice.selected().
- * java/awt/Choice.java:
- (remove): Simplify and correct.
+ * tools/gnu/classpath/tools/jar/Creator.java: Close the
+ inputStream.
-2006-07-30 Sven de Marothy <sven@physto.se>
+2006-10-12 Andrew Haley <aph@redhat.com>
- * java/awt/Choice.java:
- (accessibleAction): Call select() directly.
- (add, insert, remove): Reimplement.
- (dispatchEventImpl): Always call super.
- (processItemEvent): Does not set the index.
- * include/gnu_java_awt_peer_gtk_GtkChoicePeer.h
- * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
- (append): removed.
- (nativeAdd): Name changed to add.
- (selection_changed_cb): Simplify callback.
- * gnu/java/awt/peer/gtk/GtkChoicePeer.java
- (selected): New field.
- (add): Replaced with native impl.
- (handleEvent): New method.
+ * java/lang/InheritableThreadLocal.java: Rename NULL to sentinel.
+ * java/lang/ThreadLocal.java: Likewise.
+
+2006-09-13 Andrew Haley <aph@redhat.com>
+
+ * external/jsr166/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java:
+ Revert previous gcj-specific disabling of checks.
+ * external/jsr166/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java:
+ Likewise.
+ * classpath/external/jsr166/java/util/concurrent/atomic/AtomicLongFieldUpdater.java:
+ Likewise.
+
+2006-09-13 Andrew Haley <aph@redhat.com>
+
+ * java/util/PriorityQueue.java: Throw IllegalArgumentException for
+ capacity < 1.
+ (Iterator.remove()): Decrement index after removing element.
+
+2006-12-11 Jeroen Frijters <jeroen@frijters.net>
+
+ * javax/net/ssl/SSLSocketFactory.java (getDefault):
+ Chain exception cause.
+
+2006-12-11 Roman Kennke <kennke@aicas.com>
+
+ * .classpath: Include ASM in Eclipse classpath.
+
+2006-12-11 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/java/lang/management/BeanImpl.java:
+ (translate(String)): Trim strings of whitespace.
+ * javax/management/MBeanAttributeInfo.java:
+ (MBeanAttributeInfo(String,String,Method,Method)):
+ Use Class.getName() for normal (non-parameterized) cases.
+ * javax/management/MBeanConstructorInfo.java:
+ (MBeanConstructorInfo(String, Constructor)):
+ Likewise.
+ * javax/management/MBeanOperationInfo.java:
+ (MBeanOperationInfo(String, Method)):
+ Likewise.
+
+2006-12-11 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/Class.java:
+ (getClasses()): Return Class<?>[].
+ (internalGetClasses()): Likewise.
+ (getConstructor(Class<?>...)): Add type parameter
+ to parameters.
+ (getDeclaredConstructor(Class<?>...)): Likewise.
+ (getDeclaredClasses()): Return Class<?>[].
+ (getDeclaredClasses(boolean)): Likewise.
+ (getDeclaredConstructors()): Return Constructor<?>[].
+ (getDeclaredConstructors(boolean)): Likewise.
+ (getDeclaredMethod(String,Class<?>...)): Add type
+ parameter to parameters.
+ (getInterfaces()): Return Class<?>[].
+ (getMethods(String,Class<?>...)): Add type
+ parameter to parameters.
+ * java/text/CollationKey.java:
+ Make non-final.
+ * java/text/DecimalFormatSymbols.java:
+ Likewise.
+
+2006-12-11 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/java/lang/management/BeanImpl.java:
+ (translate(String)): Handle Map and List as
+ Strings of the form "java.util.Map<K,V>" and
+ "java.util.List<E>"
+ * javax/management/MBeanAttributeInfo.java:
+ (MBeanAttributeInfo(String,String,Method,Method)):
+ Use generic parameter and return types.
+ * javax/management/MBeanConstructorInfo.java:
+ (MBeanConstructorInfo(String, Constructor)):
+ Use generic parameter types.
+ * javax/management/MBeanOperationInfo.java:
+ (MBeanOperationInfo(String, Method)):
+ Use generic parameter and return types.
+
+2006-12-10 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/java/lang/management/BeanImpl.java:
+ (translate(String)): Comment out code for using type
+ variables for Map and List.
+ * java/lang/Thread.java:
+ (Thread(ThreadGroup,Runnable,String,long)): Fix
+ incrementation of totalThreadsCreated to be prior to use.
+
+2006-12-10 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/management/MBeanServerFactory.java:
+ (createMBeanServer(String)): Added security check.
+ (findMBeanServer(String)): Likewise.
+ (newMBeanServer(String)): Likewise.
+ (releaseMBeanServer(String)): Likewise.
+ * javax/management/MBeanServerPermission.java:
+ New file.
+
+2006-12-08 David Daney <ddaney@avtrex.com>
+
+ * native/jni/java-nio/gnu_java_nio_VMChannel.c (is_non_blocking_fd):
+ Fix comment.
+
+2006-12-08 David Daney <ddaney@avtrex.com>
+
+ * NEWS: Mention URLConnection.[get|set]ReadTimeout.
+
+2006-12-08 David Daney <ddaney@avtrex.com>
+
+ * gnu/java/net/protocol/http/HTTPConnection.java (imports): Add
+ SocketException.
+ (HTTPConnection): Handle NumberFormatException in properties parsing.
+ (Pool.get): Set timeout on reused sockets.
+ * gnu/java/net/protocol/http/HTTPURLConnection.java (proxyPort):
+ Initialize.
+ (HTTPURLConnection): Cleanup properties handling.
+ (getConnection): Use both connection and read timeouts.
+ (setConnectTimeout): Removed.
+ (setReadTimeout): New method.
+ * java/net/URLConnection.java (timeout): Renamed to...
+ (connectTimeout): ... connectTimeout throughout.
+ (readTimeout): New field.
+ (getReadTimeout): New method.
+ (setReadTimeout): New method.
+
+2006-12-08 Tania Bento <tbento@redhat.com>
+
+ * java/awt/ScrollPane.java
+ (doLayout): Change the location of the scrollpane's child
+ to (0, 0).
+
+2006-12-08 David Daney <ddaney@avtrex.com>
+
+ * native/jni/java-nio/gnu_java_nio_VMChannel.c (is_non_blocking_fd):
+ New method.
+ (Java_gnu_java_nio_VMChannel_read__ILjava_nio_ByteBuffer_2): Throw
+ SocketTimeoutException if a blocking socket timesout.
+ (Java_gnu_java_nio_VMChannel_readScattering): Same.
+ (Java_gnu_java_nio_VMChannel_read__I): Same.
+ (Java_gnu_java_nio_VMChannel_connect): Initialize the fd set.
+ (Java_gnu_java_nio_VMChannel_connect6): Same.
+
+2006-12-08 Mark Wielaard <mark@klomp.org>
+
+ * configure.ac (VERSION): Set to 0.93-generics.
+ * NEWS: Add release date.
+
+2006-12-08 Tania Bento <tbento@redhat.com>
+
+ * java/awt/ScrollPane.java
+ (getScrollPosition): Throw NullPointerException if scrollpane
+ does have a child.
+ (setScrollPosition(int, int)): Throw NullPointerException if
+ scrollpane does have a child. Check that both ints are within
+ the allowed bounds; If they are not, scroll to the closest allowed
+ bound.
+
+2006-12-07 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JEditorPane.java
+ (EditorKitMapping): New inner helper class.
+ (editorKits): New static field for caching editor kit instances.
+ (static_initiazer): Initialize static mappings here.
+ (createEditorKitForContentType): Try to use cached instance.
+ Use correct classloader for loading.
+ (getEditorKitClassNameForContentType): Make use of EditorKitMapping
+ class.
+ (getEditorKitForContentType): Store the fetched editor kit.
+ Fallback to createDefaultEditorKit().
+ (init): Don't clean the static registry here.
+ (registerEditorKitForContentType(String,String,ClassLoader)):
+ Implemented.
+ (registerEditorKitForContentType(String,String)): Delegate to
+ the other version of this method with the thread's context
+ classloader.
+
+2006-12-07 Mark Wielaard <mark@klomp.org>
+
+ * examples/gnu/classpath/examples/swing/HtmlDemo.java
+ (setPage): Don't convert URL to String for setPage().
+
+2006-12-07 Mark Wielaard <mark@klomp.org>
+
+ * tools/Makefile.am (clean-local): Remove iasm and asm.lst.
+
+2006-12-07 Mark Wielaard <mark@klomp.org>
+
+ * tools/Makefile.am: Explicitly define and use bootclasspath as
+ GLIBJ_BOOTCLASSPATH
+
+2006-12-07 Mark Wielaard <mark@klomp.org>
+
+ * javax/swing/JEditorPane.java (createEditorKitForContentType):
+ Always load from system class loader.
+
+2006-12-07 Mark Wielaard <mark@klomp.org>
+
+ * java/net/URL.java (URL(URL,String,URLStreamHandler,boolean)): New
+ private constructor.
+ (URL(URL,String,URLStreamHandler)): Call new constructor.
+ (URL(URL,String)): Likewise.
+ (URL(String)): Likewise.
+
+2006-12-07 Tom Tromey <tromey@redhat.com>
+
+ * NEWS: Mention ASM.
+ * INSTALL: Don't mention --with-asm.
+ * tools/external/README: New file.
+ * tools/toolwrapper.c (main): Don't use ASM_JAR.
+ * tools/gjavah.in: Don't use PATH_TO_ASM.
+ * tools/grmic.in: Likewise.
+ * tools/Makefile.am (GLIBJ_CLASSPATH): Removed PATH_TO_ASM, added
+ 'asm'.
+ (javah, rmic): Removed variables.
+ (bin_PROGRAMS): Updated.
+ (gappletviewer_CFLAGS): Don't define ASM_JAR.
+ (gjarsigner_CFLAGS): Likewise.
+ (gkeytool_CFLAGS): Likewise.
+ (gjar_CFLAGS): Likewise.
+ (gnative2ascii_CFLAGS): Likewise.
+ (gserialver_CFLAGS): Likewise.
+ (grmiregistry_CFLAGS): Likewise.
+ (gtnameserv_CFLAGS): Likewise.
+ (gorbd_CFLAGS): Likewise.
+ (grmid_CFLAGS): Likewise.
+ (gjavah_CFLAGS): Likewise.
+ (grmic_CFLAGS): Likewise.
+ (bin_SCRIPTS): Updated.
+ (TOOLS_JAVA_FILES): Updated.
+ ($(TOOLS_ZIP)): Compile ASM sources. Copy resource files.
+ * configure.ac: Removed --with-asm. Always build gjavah.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * examples/gnu/classpath/examples/swing/BrowserEditorKit.java:
+ New class.
+ * examples/gnu/classpath/examples/swing/HtmlDemo.java
+ (LoadActionListener): Call setPage() helper method.
+ (createContent): Register tweaked editor kit. For FormSubmitEvents
+ call submitForm(), otherwise setPage().
+ (postData): Helper method for posting form data.
+ (setPage): Helper method for navigating to a new URL.
+ (submitForm): Helper method for submitting a form.
+ * examples/gnu/classpath/examples/swing/forms.html:
+ Added text/password fields and select boxes.
+ * examples/gnu/classpath/examples/swing/welcome.html: Fixed typo.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/FormView.java
+ (SubmitThread.postData): Implemented.
+ (SubmitThread.run): Pass data to postData().
+ (actionPerformed): Reset form when reset button is activated.
+ (createComponent): Add support for select lists and comboboxes.
+ Don't set value of text and password fields here, this is done
+ now in HTMLDocument for consistency.
+ (getElementFormData): Add support for fetching form data from
+ select lists and comboboxes as well as textareas.
+ (getSelectData): New helper method. Fetches form data from
+ select boxes.
+ (getTextAreaData): New helper method. Fetches form data from
+ textareas.
+ (resetForm): New helper method. Resets the entire form.
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.FormAction.end): Handle SELECT and OPTION tags.
+ (HTMLReader.FormAction.start): Handle SELECT and OPTION tags.
+ (HTMLReader.FormAction.setModel): Initialize text and password
+ values here. Also, use the resetable special models.
+ Group radio buttons into ButtonGroup for exclusive selection.
+ (HTMLReader.FormTagAction): New class. Handles FORM tags.
+ (HTMLReader.buttonGroups): New field.
+ (HTMLReader.numOptions): New field.
+ (HTMLReader.option): New field.
+ (HTMLReader.selectModel): New field.
+ (HTMLReader.textAreaDocument): Make ResetablePlainDocument.
+ (HTMLReader.handleText): Handle OPTION text.
+ (HTMLReader.initTags): Map FORM tags to FormTagAction.
+ (HTMLReader.textAreaContent): Set initial content.
+ * javax/swing/text/html/Option.java
+ (Option): Make copy of attribute set. Initialize selected state.
+ (getValue): Fetch value from attribute set.
+ * javax/swing/text/html/ResetableModel.java: New interface.
+ * javax/swing/text/html/ResetablePlainDocument.java: New class.
+ Supports resetting the state.
+ * javax/swing/text/html/ResetableToggleButtonModel.java: Likewise.
+ * javax/swing/text/html/SelectComboBoxModel.java: Likewise.
+ * javax/swing/text/html/SelectListModel.java: Likewise.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/DefaultCaret.java
+ (appear): Adjust visibility here.
+ (setDotImpl): Don't adjust visibility here.
+ (moveDotImpl): Don't adjust visibility here.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/awt/peer/gtk/AsyncImage.java
+ (Loader.run): Synchronize on the AsyncImage to avoid threading
+ issues.
+ (addObservers): Check for obs==null outside and synchronize on
+ this inside to avoid locking issues.
+ (checkImage): New helper method.
+ (notifyObservers): Check that the correct lock is held and
+ remove actual locking.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java
+ (checkImage): Added special handling for AsyncImages.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * examples/gnu/classpath/examples/swing/Demo.java
+ (getIcon): Made package private.
+ * examples/gnu/classpath/examples/swing/HtmlDemo.java
+ (hyperlinkUpdate): Convert URL to string.
+
+2006-12-06 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/awt/peer/gtk/AsyncImage.java (addObserver): Never notify
+ null Observer.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * examples/gnu/classpath/examples/icons/back.png,
+ * examples/gnu/classpath/examples/icons/reload.png:
+ New icons for the HTML browser.
+ * examples/gnu/classpath/examples/swing/HtmlDemo.java
+ (history): New field. Manages the browsing history.
+ (HtmlDemo): Initialize history.
+ (createContent): Set location and add history. Add toolbar.
+ (createToolBar): New helper method.
+ (main): Make default size bigger.
+ * examples/gnu/classpath/examples/swing/frame1.html,
+ * examples/gnu/classpath/examples/swing/frame2.html,
+ * examples/gnu/classpath/examples/swing/frame3.html,
+ * examples/gnu/classpath/examples/swing/frame4.html,
+ * examples/gnu/classpath/examples/swing/frames.html,
+ * examples/gnu/classpath/examples/swing/tables.html:
+ New example pages.
+ * examples/gnu/classpath/examples/swing/welcome.html
+ Add a couple of links and new test pages.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JEditorPane.java
+ (getStream): Buffer the stream for efficiency.
+ (setPage): Don't scroll the view at this point.
+ * javax/swing/plaf/basic/BasicTextUI.java
+ (RootView.paint): Call RootView's setSize to get synchronization.
+ (RootView.setSize): Synchronize to prevent race in layout code.
+ * javax/swing/text/AbstractDocument.java
+ (notifyListeners): New field.
+ (fireChangedUpdate): Track notifyListener field.
+ (fireRemoveUpdate): Track notifyListener field.
+ (fireIndertUpdate): Track notifyListener field.
+ (writeLock): Check notifyListener and throw IllegalStateException.
+ * javax/swing/text/View.java
+ (preferenceChanged): Create local var for better thread safety and
+ more efficiency.
+
+2006-12-06 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * java/awt/ScrollPane.java (addNotify): Add a parent panel for any
+ lightweight component, not just for non-Panel components.
+ (addImpl): Do not call doLayout.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+ (setNativeBounds): Ensure widget parent is a GtkFixed before
+ calling gtk_fixed_move.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
+ (setNativeBounds): Likewise.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+ (setNativeBounds): Likewise.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/TableView.java
+ (RowView.layoutMajorAxis): Check column index for invalid value.
+ (updateGrid): Check column index for invalid value.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/BlockView.java
+ (getAlignment): Align blocks horizontally by the superclass.
+ * javax/swing/text/html/HTMLEditorKit.java
+ (HTMLFactory.create): Replace equals comparison by == for efficiency.
+ Add mapping for misplaced tr, td and th tags. Include object mapping.
+ * javax/swing/text/html/TableView.java
+ (RowView.replace): Invalidate grid early.
+ (gridValid): Initialize with false.
+ (create): Only create RowView and CellView for correctly placed
+ tags. Avoid unnecessary casts.
+ (getAlignment): Removed.
+ (replace): Invalidate grid early.
+
+2006-12-06 Francis Kung <fkung@redhat.com>
+
+ * java/awt/geom/RectangularShape.java
+ (getBounds): Remove empty rectangle check.
+
+2006-12-06 Ben Konrath <bkonrath@redhat.com>
-2006-07-06 Paul Eggert <eggert@cs.ucla.edu>
+ Fixes PR 29853.
+ * gnu/xml/dom/DomAttr.java: Don't report mutation if oldValue and
+ newValue are the same.
+ * gnu/xml/dom/DomNode.java: Set parent if null during mutation.
- Port to hosts whose 'sort' and 'tail' implementations
- treat operands with leading '+' as file names, as POSIX
- has required since 2001. However, make sure the code still
- works on pre-POSIX hosts.
- * libjava/classpath/ltmain.sh: Don't assume "sort +2" is
- equivalent to "sort -k 3", since POSIX 1003.1-2001 no longer
- requires this.
- This uses the same fix that is already in
- libjava/libltdl/ltmain.sh.
+2006-12-06 Tania Bento <tbento@redhat.com>
-2006-07-04 Peter O'Gorman <peter@pogma.com>
+ * javax/swing/border/CompoundBorder.java:
+ (isBorderOpaque): If inside border is null, return true if outside
+ border is opaque, false otherwise; if outside border is null, return
+ true if inside border is opaque, false otherwise; if inside or
+ outside border are both not null, then return true only if both the
+ inside and outside border are opaque, false otherwise.
- * ltconfig: chmod 644 before ranlib during install.
+2006-12-06 Tania Bento <tbento@redhat.com>
+
+ * javax/swing/border/CompoundBorder.java:
+ (isBorderOpaque): If inside and outside border both have a null
+ value, return true.
+
+2006-12-06 Chris Burdess <dog@gnu.org>
+
+ Fixes PR 29272.
+ * javax/xml/parsers/DocumentBuilderFactory.java: Fix broken Javadoc.
+ * gnu/xml/stream/SAXParser.java: Fix file descriptor leak.
+
+2006-12-06 Chris Burdess <dog@gnu.org>
+
+ Fixes PR 29264.
+ * gnu/xml/stream/XMLStreamWriterImpl.java: Allow arbitrary text in
+ writeDTD method.
+
+2006-12-06 Chris Burdess <dog@gnu.org>
+
+ Fixes PR 28816.
+ * javax/xml/validation/SchemaFactory.java: Use correct algorithm to
+ discover schema factory implementation class.
+
+2006-12-05 Francis Kung <fkung@redhat.com>
+
+ * java/awt/BasicStroke.java
+ (capEnd): Prevent division by zero.
+ * java/awt/geom/Arc2D.java
+ (ArcIterator.ArcIterator): Do not shift the arc to make the extent positive.
+ (ArcIterator.currentSegment): Handle a negative extent.
+
+2006-12-05 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+ (constructor): Handle translated subimages properly, ie, if the image's
+ 0,0 position is not the data buffer's first element.
+
+2006-12-05 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/awt/peer/gtk/AsyncImage.java
+ (Loader.run): Nullify observers after loading.
+ (observers): Made package private.
+ (addObserver): Check for null observers field. Create local
+ variable for thread safety.
+ (getHeight): Use addObserver() for checking state of field
+ and notifying observer when necessary.
+ (getWidth): Use addObserver() for checking state of field
+ and notifying observer when necessary.
+ (getProperty): Use addObserver() for checking state of field
+ and notifying observer when necessary.
+ (notifyObservers): Check for null observers field. Create local
+ variable for thread safety.
+
+2006-12-05 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/HTMLEditorKit.java
+ (HTMLFactory.create): Removed debug output.
+ * javax/swing/text/html/InlineView.java
+ (getBreakWeight): Likewise.
+ * javax/swing/text/html/StyleSheet.java
+ (addRule): Likewise.
+ (ListPainter.paint): Removed debug output.
+
+2006-12-05 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/BlockView.java
+ (painter): Made package visible.
+ * javax/swing/text/html/StyleSheet.java
+ (translateBorder): New helper method.
+ (translateHTMLToCSS): Add mappings for border attributes.
+ * javax/swing/text/html/TableView.java
+ Made class subclass of BlockView to get CSS goodness.
+ (CellView.rowSpan): New field.
+ (CellView.setPropertiesFromAttributes): Fetch rowspan.
+ (RowView.overlap): New field.
+ (RowView.rowIndex): New field.
+ (RowView.layoutMajorAxis): Skip overlapping cells.
+ (RowView.layoutMinorAxis): Layout cells that span more than 1 row.
+ (numColumns): New field.
+ (tmpRect): New field.
+ (TableView): Initialize tmpRect.
+ (calculateColumnRequirements): Adjusted and fixed for multirows.
+ (getAlignment): Overridden to center tables.
+ (paint): Overridden to fix clipping.
+ (getStyleSheet): Made protected.
+ (layoutMajorAxis): Invalidate rows.
+ (setPropertiesFromAttributes): Made protected and call super.
+ (updateGrid): Update the overlapping information for multirows.
+
+2006-12-05 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/awt/peer/gtk/AsyncImage.java
+ (addObserver): Check for null and ignore null observers.
+ (getWidth): Check for null and ignore null observers.
+ (getHeight): Check for null and ignore null observers.
+ (getProperty): Check for null and ignore null observers.
+
+2006-12-05 Francis Kung <fkung@redhat.com>
+
+ * java/awt/BasicStroke.java
+ (capEnd): Prevent division by zero.
+ * java/awt/geom/Arc2D.java
+ (ArcIterator.ArcIterator): Do not shift the arc to make the extent positive.
+ (ArcIterator.currentSegment): Handle a negative extent.
+
+2006-12-05 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+ (constructor): Handle translated subimages properly, ie, if the image's
+ 0,0 position is not the data buffer's first element.
+
+2006-12-05 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/ImageView.java
+ (imageUpdate): Use spans field to determine if the CSS width/height
+ are set. Call safePreferenceChanged to protect view structure
+ from threading issues.
+ (spans): Made package private.
+ (ImageView): Initialize loadOnDemand with false.
+ (loadImage): Call Toolkit.prepareImage() to make sure we have
+ our Observer registered.
+ (safePreferenceChanged): New helper method. Calls preferenceChanged
+ in a thread safe environment.
+
+2006-12-05 Roman Kennke <kennke@aicas.com>
+
+ * NEWS: Add entry about improved HTML support.
+
+2006-12-05 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/ImageView.java
+ (ImageView): Initialize spans array here.
+ (setPropertiesFromAttributes): Moved init of spans array to
+ constructor.
+
+2006-12-05 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/BlockView.java
+ (painter): Made package visible.
+ * javax/swing/text/html/StyleSheet.java
+ (translateBorder): New helper method.
+ (translateHTMLToCSS): Add mappings for border attributes.
+ * javax/swing/text/html/TableView.java
+ Made class subclass of BlockView to get CSS goodness.
+ (CellView.rowSpan): New field.
+ (CellView.setPropertiesFromAttributes): Fetch rowspan.
+ (RowView.overlap): New field.
+ (RowView.rowIndex): New field.
+ (RowView.layoutMajorAxis): Skip overlapping cells.
+ (RowView.layoutMinorAxis): Layout cells that span more than 1 row.
+ (numColumns): New field.
+ (tmpRect): New field.
+ (TableView): Initialize tmpRect.
+ (calculateColumnRequirements): Adjusted and fixed for multirows.
+ (getAlignment): Overridden to center tables.
+ (paint): Overridden to fix clipping.
+ (getStyleSheet): Made protected.
+ (layoutMajorAxis): Invalidate rows.
+ (setPropertiesFromAttributes): Made protected and call super.
+ (updateGrid): Update the overlapping information for multirows.
+
+2006-12-05 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/HTMLEditorKit.java
+ (HTMLFactory.create): Removed debug output.
+ * javax/swing/text/html/InlineView.java
+ (getBreakWeight): Likewise.
+ * javax/swing/text/html/StyleSheet.java
+ (addRule): Likewise.
+ (ListPainter.paint): Removed debug output.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/BlockView.java
+ (getAlignment): Align blocks horizontally by the superclass.
+ * javax/swing/text/html/HTMLEditorKit.java
+ (HTMLFactory.create): Replace equals comparison by == for efficiency.
+ Add mapping for misplaced tr, td and th tags. Include object mapping.
+ * javax/swing/text/html/TableView.java
+ (RowView.replace): Invalidate grid early.
+ (gridValid): Initialize with false.
+ (create): Only create RowView and CellView for correctly placed
+ tags. Avoid unnecessary casts.
+ (getAlignment): Removed.
+ (replace): Invalidate grid early.
+
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/TableView.java
+ (RowView.layoutMajorAxis): Check column index for invalid value.
+ (updateGrid): Check column index for invalid value.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JEditorPane.java
+ (getStream): Buffer the stream for efficiency.
+ (setPage): Don't scroll the view at this point.
+ * javax/swing/plaf/basic/BasicTextUI.java
+ (RootView.paint): Call RootView's setSize to get synchronization.
+ (RootView.setSize): Synchronize to prevent race in layout code.
+ * javax/swing/text/AbstractDocument.java
+ (notifyListeners): New field.
+ (fireChangedUpdate): Track notifyListener field.
+ (fireRemoveUpdate): Track notifyListener field.
+ (fireIndertUpdate): Track notifyListener field.
+ (writeLock): Check notifyListener and throw IllegalStateException.
+ * javax/swing/text/View.java
+ (preferenceChanged): Create local var for better thread safety and
+ more efficiency.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * examples/gnu/classpath/examples/icons/back.png,
+ * examples/gnu/classpath/examples/icons/reload.png:
+ New icons for the HTML browser.
+ * examples/gnu/classpath/examples/swing/HtmlDemo.java
+ (history): New field. Manages the browsing history.
+ (HtmlDemo): Initialize history.
+ (createContent): Set location and add history. Add toolbar.
+ (createToolBar): New helper method.
+ (main): Make default size bigger.
+ * examples/gnu/classpath/examples/swing/frame1.html,
+ * examples/gnu/classpath/examples/swing/frame2.html,
+ * examples/gnu/classpath/examples/swing/frame3.html,
+ * examples/gnu/classpath/examples/swing/frame4.html,
+ * examples/gnu/classpath/examples/swing/frames.html,
+ * examples/gnu/classpath/examples/swing/tables.html:
+ New example pages.
+ * examples/gnu/classpath/examples/swing/welcome.html
+ Add a couple of links and new test pages.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * examples/gnu/classpath/examples/swing/Demo.java
+ (getIcon): Made package private.
+ * examples/gnu/classpath/examples/swing/HtmlDemo.java
+ (hyperlinkUpdate): Convert URL to string.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/DefaultCaret.java
+ (appear): Adjust visibility here.
+ (setDotImpl): Don't adjust visibility here.
+ (moveDotImpl): Don't adjust visibility here.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/FormView.java
+ (SubmitThread.postData): Implemented.
+ (SubmitThread.run): Pass data to postData().
+ (actionPerformed): Reset form when reset button is activated.
+ (createComponent): Add support for select lists and comboboxes.
+ Don't set value of text and password fields here, this is done
+ now in HTMLDocument for consistency.
+ (getElementFormData): Add support for fetching form data from
+ select lists and comboboxes as well as textareas.
+ (getSelectData): New helper method. Fetches form data from
+ select boxes.
+ (getTextAreaData): New helper method. Fetches form data from
+ textareas.
+ (resetForm): New helper method. Resets the entire form.
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.FormAction.end): Handle SELECT and OPTION tags.
+ (HTMLReader.FormAction.start): Handle SELECT and OPTION tags.
+ (HTMLReader.FormAction.setModel): Initialize text and password
+ values here. Also, use the resetable special models.
+ Group radio buttons into ButtonGroup for exclusive selection.
+ (HTMLReader.FormTagAction): New class. Handles FORM tags.
+ (HTMLReader.buttonGroups): New field.
+ (HTMLReader.numOptions): New field.
+ (HTMLReader.option): New field.
+ (HTMLReader.selectModel): New field.
+ (HTMLReader.textAreaDocument): Make ResetablePlainDocument.
+ (HTMLReader.handleText): Handle OPTION text.
+ (HTMLReader.initTags): Map FORM tags to FormTagAction.
+ (HTMLReader.textAreaContent): Set initial content.
+ * javax/swing/text/html/Option.java
+ (Option): Make copy of attribute set. Initialize selected state.
+ (getValue): Fetch value from attribute set.
+ * javax/swing/text/html/ResetableModel.java: New interface.
+ * javax/swing/text/html/ResetablePlainDocument.java: New class.
+ Supports resetting the state.
+ * javax/swing/text/html/ResetableToggleButtonModel.java: Likewise.
+ * javax/swing/text/html/SelectComboBoxModel.java: Likewise.
+ * javax/swing/text/html/SelectListModel.java: Likewise.
+
+2006-12-06 Roman Kennke <kennke@aicas.com>
+
+ * examples/gnu/classpath/examples/swing/BrowserEditorKit.java:
+ New class.
+ * examples/gnu/classpath/examples/swing/HtmlDemo.java
+ (LoadActionListener): Call setPage() helper method.
+ (createContent): Register tweaked editor kit. For FormSubmitEvents
+ call submitForm(), otherwise setPage().
+ (postData): Helper method for posting form data.
+ (setPage): Helper method for navigating to a new URL.
+ (submitForm): Helper method for submitting a form.
+ * examples/gnu/classpath/examples/swing/forms.html:
+ Added text/password fields and select boxes.
+ * examples/gnu/classpath/examples/swing/welcome.html: Fixed typo.
+
+2006-12-07 Mark Wielaard <mark@klomp.org>
+
+ * java/net/URL.java (URL(URL,String,URLStreamHandler,boolean)): New
+ private constructor.
+ (URL(URL,String,URLStreamHandler)): Call new constructor.
+ (URL(URL,String)): Likewise.
+ (URL(String)): Likewise.
+
+2006-12-07 Mark Wielaard <mark@klomp.org>
+
+ * javax/swing/JEditorPane.java (createEditorKitForContentType):
+ Always load from system class loader.
+
+2006-12-06 Ben Konrath <bkonrath@redhat.com>
+
+ Fixes PR 29853.
+ * gnu/xml/dom/DomAttr.java: Don't report mutation if oldValue and
+ newValue are the same.
+ * gnu/xml/dom/DomNode.java: Set parent if null during mutation.
+
+2006-12-06 Chris Burdess <dog@gnu.org>
+
+ Fixes PR 29272.
+ * javax/xml/parsers/DocumentBuilderFactory.java: Fix broken Javadoc.
+ * gnu/xml/stream/SAXParser.java: Fix file descriptor leak.
+
+2006-12-06 Chris Burdess <dog@gnu.org>
+
+ Fixes PR 29264.
+ * gnu/xml/stream/XMLStreamWriterImpl.java: Allow arbitrary text in
+ writeDTD method.
+
+2006-12-056 Chris Burdess <dog@gnu.org>
+
+ Fixes PR 28816.
+ * javax/xml/validation/SchemaFactory.java: Use correct algorithm to
+ discover schema factory implementation class.
+
+2006-12-05 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/awt/peer/gtk/AsyncImage.java: New class. Supports
+ asynchronous loading of images.
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (drawImage): Fetch real image from possibly AsyncImage.
+ * gnu/java/awt/peer/gtk/ComponentGraphics.java
+ (drawImage): Fetch real image from possibly AsyncImage.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java
+ (createImage(URL)): Create async image.
+ (imageOrError): Made method static for easy access from AsyncImage.
+ (prepareImage): For async images, register the observer to the
+ image.
+
+2006-12-05 Roman Kennke <kennke@aicas.com>
+
+ (paintComponent): Include paint area from event.
+ (updateComponent): Include paint area from event.
+
+2006-12-06 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * java/awt/ScrollPane.java (addNotify): Add a parent panel for any
+ lightweight component, not just for non-Panel components.
+ (addImpl): Do not call doLayout.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+ (setNativeBounds): Ensure widget parent is a GtkFixed before
+ calling gtk_fixed_move.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
+ (setNativeBounds): Likewise.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+ (setNativeBounds): Likewise.
+
+2006-12-04 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * java/awt/Component.java (getFontImpl): Return a default font if
+ topmost parent's font is null.
+
+2006-12-04 Mark Wielaard <mark@klomp.org>
+
+ * javax/swing/text/html/CSS.java (parseMarginShorthand):
+ Remove debug output.
+
+2006-12-04 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/font/TextLayout.java
+ (hitTestChar): Fixed conditions for inclusion of range.
+ Use layout information in the run for more efficiency.
+
+2006-12-04 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/GlyphView.java
+ (J2DGlyphPainter): New inner class.
+ (checkPainter): For Java2D capable environments create
+ a J2DGlyphPainter.
+
+2006-12-04 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
+ (FreeTypeGlyphVector): Don't filter control chars here.
+ (getGlyphs): Filter control chars and replace them by
+ hair space char.
+
+2006-12-04 Roman Kennke <kennke@aicas.com>
+
+ * native/jni/java-nio/gnu_java_nio_VMChannel.c
+ (Java_gnu_java_nio_VMChannel_connect): Retry on EINTR.
+
+2006-12-04 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/java/lang/management/BeanImpl.java:
+ (translate(String)): Don't assume the list uses "E",
+ just use the first and only type variable.
+ * java/lang/management/ManagementFactory.java:
+ (getPlatformMBeanServer()): Register logging bean.
+ * javax/management/openmbean/OpenType.java:
+ (OpenType(String,String,String)): Actually use
+ the string created to handle arrays.
+
+2006-12-04 Mark Wielaard <mark@klomp.org>
+
+ * native/jni/java-nio/gnu_java_nio_VMChannel.c
+ (JCL_thread_interrupted): Use CallStaticBooleanMethod.
+
+2006-12-04 Mark Wielaard <mark@klomp.org>
+
+ * vm/reference/gnu/java/nio/VMChannel.java (isThreadInterrupted):
+ Make static.
+ * native/jni/java-nio/gnu_java_nio_VMChannel.c
+ (JCL_thread_interrupted): Only take JNIEnv.
+ (vm_channel_class): New static variable.
+ (initID): Set vm_channel_class.
+ Wrap all reads() and writes() in do-while blocks that check
+ interrupted status.
+
+2006-12-04 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/javax/management/Server.java:
+ Make map final and initialise it.
+ (unregisterMBean(ObjectName)): Match against
+ delegate's object name and not the instance.
+ * java/lang/management/ManagementFactory.java:
+ Added constant fields.
+ (getPlatformMBeanServer()): Implemented.
+ * javax/management/MBeanServerFactory.java: New file.
+
+2006-12-04 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/BoxView.java
+ (paint): Replaced painting algorithm with more simple and more
+ reliable painting of the box.
+ * javax/swing/text/html/BlockView.java
+ (PositionInfo): New inner class. Stores additional CSS
+ positioning information.
+ (positionInfo): New field.
+ (BlockView): Initialize positionInfo field.
+ (fetchLayoutInfo): New helper method. Fetches additional
+ CSS positioning information.
+ (layoutMajorAxis): Perform additional CSS layout.
+ (layoutMinorAxis): Perform additional CSS layout.
+ (positionView): New helper method.
+ (replace): Overridden to fetch additional layout information.
+ * javax/swing/text/html/CSS.java
+ (Attribute.POSITION): New field.
+ (Attribute.LEFT): New field.
+ (Attribute.RIGHT): New field.
+ (Attribute.TOP): New field.
+ (Attribute.BOTTOM): New field.
+ (getValue): Create Length for left, right, top and bottom
+ attributes.
+
+2006-12-04 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/parser/support/Parser.java
+ (Sgml): Consume any whitespace that immediately follows
+ and sgml insertion.
+ (parseDocument): Consume any initial whitespace.
+
+2006-12-03 Mark Wielaard <mark@klomp.org>
+
+ * gnu/javax/management/Server.java (beans): Initialize.
+ (registerMBean): Don't initialize beans.
+
+2006-12-03 Mark Wielaard <mark@klomp.org>
+
+ * java/util/logging/LogManager.java (getLevelProperty): Check
+ whether value is null before passing to Level.parse().
+
+2006-12-04 Robert Lougher <rob.lougher@gmail.com>
+
+ * java/lang/management/ThreadInfo.java (ThreadInfo): Check
+ whether given a null lock and lockOwner.
+
+2006-12-03 Mark Wielaard <mark@klomp.org>
+
+ * javax/swing/JEditorPane.java (PageLoader.in): Made a PageStream.
+ (PageLoader.page): Made package local.
+ (PageLoader.run): Don't reset loader.
+ (PageLoader.cancel): New method.
+ (loading): Renamed to loader.
+ (getPage): Return loader.page.
+ (setPage): Always set loader. Never reset to null.
+
+2006-12-03 Mark Wielaard <mark@klomp.org>
+
+ * javax/swing/plaf/basic/BasicTreeUI.java (paint): Check whether
+ path[k] is null.
+ (isLastChild): Return false when path is null.
+
+2006-12-03 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java (paintArea): Renamed
+ to currentPaintArea.
+ (paintComponent): Work with local reference to currentPaintArea.
+ (updateComponent): Likewise.
+ (coalescePaintEvent): Set currentPaintArea.
+
+2006-12-02 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/management/MBeanServerBuilder.java: New file.
+
+2006-12-01 Mark Wielaard <mark@klomp.org>
+
+ * java/text/DecimalFormat.java (parse): Always increment parsing
+ index and adjust pos result.
+
+2006-12-01 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/HTML.java
+ (Attribute.DYNAMIC_CLASS): New field.
+ (Attribute.PSEUDO_CLASS): New field.
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.CharacterAction.start): Initialize anchor with link
+ pseudo attribute.
+ (updateSpecialClass): New helper method. Updates the dynamic
+ or pseudo class for anchor tags.
+ * javax/swing/text/html/HTMLEditorKit.java
+ (LinkController.lastAnchorElement): New field. For tracking
+ enter/exit of anchors.
+ (LinkController.activateLink): Set pseudo class to 'visited'.
+ (LinkController.mouseMoved): Added support for tracking
+ the 'hover' dynamic class.
+ * javax/swing/text/html/InlineView.java
+ (changedUpdate): Fetch new properties.
+ * javax/swing/text/html/StyleSheet.java
+ (attributeSetToMap): New helper method.
+ (getRule): Also append dynamic and pseudo class to key.
+ (resolveStyle): Resolve style based generally on all attributes.
+ * javax/swing/text/html/TableView.java
+ (RowView.layoutMajorAxis): Make sure the grid is valid.
+ (updateGrid): Made package private.
+ * gnu/javax/swing/text/html/css/Selector.java
+ (calculateSpecificity): Added support for dynamic and pseudo classes.
+ (matches): Changed to operate on general attributes.
+ Added support for dynamic and pseudo classes.
+
+2006-12-01 Mario Torre <neugens@limasoftware.net>
+
+ * java/text/DecimalFormat.java (formatInternal): move the formatting of
+ fractional portion in a separate method.
+ Also fixes the handling of decimal separator and its associated field.
+ (handleFractionalPart): new method, needed to relax a bit
+ formatInternal.
+
+2006-12-01 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/beans/beancontext/BeanContextServicesSupport.java:
+ (BCSSProxyServiceProvider.getCurrentServiceSelectors(BeanContextServices,
+ Class)): Implemented.
+ (BCSSProxyServiceProvider.getService(BeanContextServices, Object,
+ Class, Object)): Implemented.
+ (BCSSProxyServiceProvider.releaseService(BeanContextServices,
+ Object, Object)): Implemented.
+ (BCSSProxyServiceProvider.serviceRevoked(BeanContextServiceRevokedEvent)):
+ Implemented.
+ (initialiseBeanContextResources()): Implemented.
+ (releaseBeanContextResoures()): Implemented.
+
+2006-12-01 Mark Wielaard <mark@klomp.org>
+
+ * include/gnu_java_awt_peer_gtk_GdkFontPeer.h: Regenerated.
+
+2006-12-01 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/css/BorderStyle.java: New class for
+ handling border styles.
+ * gnu/javax/swing/text/html/css/BorderWidth.java
+ (isValid): New method.
+ * gnu/javax/swing/text/html/css/Length.java
+ (isValid): New method.
+ * javax/swing/text/html/CSS.java
+ (addInternal): Added shorthand parsing for border, padding and
+ margin.
+ (parseBackgroundShorthand): Added API docs.
+ (parsePaddingShorthand): New method. Handles padding shorthand
+ values.
+ (parseMarginShorthand): New method. Handles margin shorthand
+ values.
+ (parseBorderShorthand): New method. Handles border shorthand
+ values.
+ * javax/swing/text/html/StyleSheet.java
+ (translateHTMLToCSS): Set specific padding attributes.
+ (BoxPainter.BoxPainter): Don't handle PADDING and MARGIN here.
+ These shorthands are now handled in CSS.
+ (BoxPainter.paint): Exclude the outer margin.
+
+2006-12-01 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/css/Length.java
+ (emBase): New field.
+ (exBase): New field.
+ (isFontEMRelative): New field.
+ (isFontEXRelative): New field.
+ (Length): Recognize and setup EM and EX relative values.
+ (getValue): Handle EM and EX relative values.
+ (isEMRelative): New method.
+ (isEXRelative): New method.
+ (setEMBase): New method.
+ (setEXBase): New method.
+ (setFontBases): New method.
+ * gnu/javax/swing/text/html/parser/support/Parser.java
+ (_handleEmptyTag): Use new isBlock() helper method.
+ (_handleEndTag_remaining): Use new isBlock() helper method.
+ (_handleStartTag): Consume whitespace after block start tag.
+ (Comment): Consume whitespace after a comment.
+ (isBlock): New helper method.
+ (readAttributes): Consider all characters in unquoted attribute
+ values.
+ * javax/swing/text/html/BlockView.java
+ (layoutMinorAxis): Use cached span value.
+ (paint): Added debug code (commented out).
+ (setPropertiesFromAttributes): Set the EM and EX base on lengths.
+ * javax/swing/text/html/CSSBorder.java
+ (CSSBorder): Take StyleSheet as argument. Call getBorderWidth()
+ with stylesheet.
+ (getBorderWidth): Set the EM and EX base on the length values.
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.ParagraphAction.end): Do not set the inParagraph field.
+ (HTMLReader.ParagraphAction.start): Do not set the inParagraph field.
+ (HTMLReader.inImpliedParagraph): Removed.
+ (HTMLReader.inParagraph): Removed.
+ (HTMLReader.parseStack): New field.
+ (HTMLReader.addContent): Use new paragraph handling.
+ (HTMLReader.addSpecialElement): Use new paragraph handling.
+ (HTMLReader.blockClose): Use new paragraph handling.
+ (HTMLReader.blockOpen): Use new paragraph handling.
+ (HTMLReader.inImpliedParagraph): New helper method.
+ (HTMLReader.inParagraph): New helper method.
+ * javax/swing/text/html/ImageView.java
+ (attributes): New field. Caches view attributes.
+ (spans): New field. Caches CSS spans.
+ (getAttributes): Correctly setup CSS view attributes.
+ (getPreferredSpan): Use caches spans.
+ (getStyleSheet): Use the view's getDocument() method.
+ (setPropertiesFromAttributes): Cache spans and setup EM and EX.
+ (updateSize): Use cached spans.
+ * javax/swing/text/html/ParagraphView.java
+ (setPropertiesFromAttributes): Setup EM and EX.
+ * javax/swing/text/html/StyleSheet.java
+ (BoxPainter.BoxPainter): Setup EM and EX correctly.
+ (getEMBase): New helper method.
+ (getEXBase): New helper method.
+ * javax/swing/text/html/TableView.java
+ (width): New field. Caches the table width.
+ (calculateMinorAxisRequirements): Use caches span.
+ (setPropertiesFromAttributes): Cache span and setup EM/EX.
+ (updateGrid): Correctly setup EM/EX.
+
+2006-11-30 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/FormSubmitEvent.java: New class.
+ * javax/swing/text/html/FormView.java
+ (SubmitThread): New class for submitting data in a separate thread.
+ (actionPerformed): Fetch the actual for data.
+ (addData): New helper method.
+ (getElementFormData): New helper method.
+ (getFormData): New helper method.
+ (getInputFormData): New helper method.
+ (submitData): Implemented.
+ * javax/swing/text/html/FrameView.java
+ (createComponent): Add this as hyperlink listener.
+ Set the target document as frame document.
+ (getTopEditorPane): New helper method.
+ (hyperlinkUpdate): Implementation of the HyperlinkListener interface.
+ (handleHyperlinkEvent): New helper method.
+ (handleFormSubmitEvent): New helper method.
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.BaseAction.start): Track the base target.
+ (HTMLReader.BaseAction.end): Removed.
+ (baseTarget): New field.
+ (frameDocument): New field.
+ (getBaseTarget): New property accessor.
+ (isFrameDocument): New property accessor.
+ (processHTMLFrameHyperlinkEvent): Implemented.
+ (setFrameDocument): New property accessor.
+ (updateFrame): New helper method.
+ (updateFrameSet): New helper method.
+ * javax/swing/text/html/HTMLEditorKit.java
+ (LinkController.createHyperlinkEvent): Handle frame documents.
+ (autoFormSubmission): New field.
+ (HTMLEditorKit): Set autoFormSubmission to true.
+ (isAutoFormSubmission): New property accessor.
+ (setAutoFormSubmission): New property accessor.
+
+2006-11-30 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/ElementIterator.java
+ (ElementRef): New inner class.
+ (currentDepth): Removed.
+ (currentElement): Removed.
+ (previousItem): Removed.
+ (stack): New field. Holds the iteration stack.
+ (state): Removed.
+ (ElementIterator(Document)): Removed init of removed fields.
+ (ElementIterator(Element)): Removed init of removed fields.
+ (current): Changed to stack based algorithm.
+ (deepestLeaf): New helper method.
+ (depth): Changed to stack based algorithm.
+ (first): Changed to stack based algorithm.
+ (next): Changed to stack based algorithm.
+ (previous): Changed to stack based algorithm.
+
+2006-11-30 Francis Kung <fkung@redhat.com>
+
+ * .settings/org.eclipse.jdt.core.prefs: Set compilar compliance to 1.4.
+ * .externalToolBuilders/ClasspathJar.launch: Include sun.* classses.
+
+2006-11-30 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+ (draw): Set transform in buffered composite.
+ (drawComposite): Do not transform bounds; round bounds.
+ (drawGlyphVector): Set transform in buffered composite.
+ (drawRenderedImage): Set transform in buffered composite.
+ (fill): Set transform in buffered composite.
+ (updateBufferedImage): Fix scanline & height calculations.
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (createPath): Simplify width & height calculation.
+ (drawImage): Also transform width & height.
+
+2006-11-30 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/FrameSetView.java: New class. Implements
+ HTML framesets.
+ * javax/swing/text/html/FrameView.java: New class. Implements
+ HTML frames.
+ * javax/swing/text/html/HTMLDocument.java:
+ (HTMLReader.addSpecialElement): Only add one artificial space.
+ * javax/swing/text/html/HTMLEditorKit.java
+ (HTMLFactory.create): Uncomment code for FrameSetView and FrameView.
+ * gnu/javax/swing/text/html/parser/support/Parser.java
+ (_handleEmptyTag): Also consume whitespace after frame tags.
+
+2006-11-30 Gary Benson <gbenson@redhat.com>
+
+ * java/lang/Thread.java: Javadoc fixes.
+
+2006-11-29 Tom Tromey <tromey@redhat.com>
+
+ PR classpath/28203:
+ * java/lang/Class.java (getAnnotations): Rewrote.
+
+2006-11-29 Tania Bento <tbento@redhat.com>
+
+ * tools/gnu/classpath/tools/appletviewer/TagParser.java:
+ (parseParams): Unescape 'val' before putting it into the Map.
+ (unescapeString): New private method.
+
+2006-11-29 Tom Tromey <tromey@redhat.com>
+
+ * tools/gnu/classpath/tools/getopt/package.html: New file.
+
+2006-11-29 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/plaf/metal/MetalIconFactory.java
+ (HorizontalSliderThumbIcon.paintIcon()): Commented out gradient paint,
+ (VerticalSliderThumbIcon.paintIcon()): Likewise.
+
+2006-11-29 Mario Torre <neugens@limasoftware.net>
+
+ * java/text/NumberFormat.java (getCurrencyInstance): Replaced dollar sign
+ with the default international currency sign \u00A4.
+ * java/text/DecimalFormat.java (scanFix): Fix to use the localized symbol
+ table for string formatting.
+ (formatInternal): likewise.
+ (scanNegativePattern): likewise.
+ (applyPattern): likewise.
+ * java/text/DecimalFormatSymbols.java (clone): Revert to old version as
+ Locale is immutable and does not need clone.
+
+2006-11-29 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (drawLine): Remove hard-coded pixel shifting.
+
+2006-11-29 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/Component.java
+ (isShowing): Simplified condition code and avoid unnecessary
+ if-codepaths.
+ (coalesceEvents): Always coalesce paint events and let the peer
+ figure out the expanding of the repaint area.
+ * gnu/java/awt/peer/swing/SwingComponentPeer.java
+ (currentPaintEvents): Removed. Replaced by paintArea.
+ (paintArea): New field. Tracks the dirty area.
+ (SwingComponentPeer): Removed init of currentPaintEvents.
+ (coalescePaintEvent): Simplified to only union the dirty regions.
+ (handleEvent): Paint dirty region that was tracked in paintArea.
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java
+ (paintArea): New field. Tracks the dirty region.
+ (coalescePaintEvent): Implemented to track the dirty region.
+ (paintComponent): Use the dirty region in paintArea. Protect
+ state by putting the paint and dispose code in a try-finally.
+ (updateComponent): Use the dirty region in paintArea. Protect
+ state by putting the paint and dispose code in a try-finally.
+
+2006-11-29 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/font/TextLayout.java
+ (getVisualHighlightShape): Removed debug output.
+
+2006-11-28 Andrew Haley <aph@redhat.com>
+
+ * vm/reference/sun/reflect/misc/ReflectUtil.java
+ (checkPackageAccess): Implement.
+
+2006-11-28 Dalibor Topic <robilad@kaffe.org>
+
+ * native/jni/java-lang/java_lang_VMDouble.c:
+ (parseDoubleFromChars) New function. Factored out from ...
+ (Java_java_lang_VMDouble_parseDouble): Factored out the parsing.
+ (dtoa_toString): New function. Factored out from ...
+ (Java_java_lang_VMDouble_toString) : Factored out the conversion.
+ Changed conversion mode to 2, as modes 0 and 1 don't round
+ as the API spec demands. Invoke conversion function as often
+ as necessary with growing precision until a reversible
+ representation of the double in form of a string is reached.
+
+2006-11-28 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JComponent.java
+ (putClientProperty): Do not fire event when both old and new
+ value are == null.
+
+2006-11-27 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/Enum.java:
+ Make name and ordinal final.
+
+2006-11-27 Casey Marshall <csm@gnu.org>
+
+ * java/util/jar/JarEntry.java (certs): removed.
+ (jarfile): new field.
+ (getCertificates): read the certificates from the containing JarFile.
+ * java/util/jar/JarFile.java (JarEnumeration.nextElement): don't
+ fill in 'certs,' fill in 'jarfile' for the entry.
+ (getEntry): likewise.
+
+2006-11-27 Francis Kung <fkung@redhat.com>
+
+ * java/awt/image/WritableRaster.java
+ (createChild): Implemented.
+
+2006-11-27 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/font/TextLayout.java
+ (TextLayout(TextLayout,int,int)): Also layout the new runs.
+ (getVisualHighlightShape): Implemented.
+ (layoutRuns): Fixed boundary so that the last run is also laid out.
+ (left): New helper method.
+ (right): New helper method.
+
+2006-11-27 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/font/TextLayout.java
+ (getCaretShape(TextHitInfo,Rectangle2D)): Implemented.
+ (getCaretShape(TextHitInfo)): Use natural bounds.
+ (getCaretShapes(int,Rectangle2D,CaretPolicy)): New API method.
+ (getCaretShapes(int,Rectangle2D)): Delegate to new method
+ above with DEFAULT_CARET_POLICY.
+ (getCaretShapes(int)): Use natural bounds.
+
+2006-11-27 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/font/TextLayout.java
+ (Run.font): New field.
+ (Run.location): New field.
+ (Run.Run): Initialize font.
+ (font): Removed field. This is moved into Run as the actual font
+ is something run-specific.
+ (TextLayout(String,Font,FontRenderContext)): Set font on the
+ single runs. Layout the runs here.
+ (TextLayout(TextLayout,int,int)): Copy over the run fonts.
+ (findRunAtIndex): New helper method.
+ (getCaretInfo): Implemented.
+ (layoutRuns): New helper method.
+ (toString): Don't put font in output string.
+
+2006-11-27 Raif S. Naffah <classpath@naffah-raif.name>
+
+ * AUTHORS: Added Jeroen Fritjers.
+
+2006-11-27 neugens <neugens@nirvana.limasoftware.net>
+
+ * java/text/DecimalFormat.java (formatInternal): Add an explicit test
+ for FieldPosition to be null.
+ Check if the factional part is just 0 and can be omitted from the
+ result.
+ (scanNegativePattern): Fixed index out of bound exception when searching
+ for international currency symbol in negative pattern.
+
+2006-11-27 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/beans/beancontext/BeanContextSupport.java:
+ (readObject(ObjectInputStream)): Implemented.
+ (writeObject(ObjectOutputStream)): Likewise.
+ (BCSChild.getTargetChild()): Added.
+ (bcsPreDeserializationHook()): Implemented.
+ (bcsPreSerializationHook()): Likewise.
+ (childDeserializedHook(Object,BCSChild)): Likewise.
+ (isSerializing()): Likewise.
+ (readChildren(ObjectInputStream)): Likewise.
+ (writeChildren(ObjectOutputStream)): Likewise.
+
+2006-11-26 Roger Sayle <roger <at> eyesopen.com>
+ Ian Lance Taylor <ian <at> airs.com>
+ Paolo Bonzini <bonzini <at> gnu.org>
+
+ Fixes bug #25557.
+
+ * lib/gen-classlist.sh.in: Avoid using test's -ef operator for
+ increased portability. Likewise, use -f instead of -e.
+
+2006-11-26 Mark Wielaard <mark@klomp.org>
+
+ * lib/Makefile.am (propertydirs): Removed.
+ (resources): Explicitly create all dirs.
+
+2006-11-26 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/net/PlainSocketImpl.java (accept): Reset timeout on Socket.
+
+2006-11-26 Dalibor Topic <robilad@kaffe.org>
+
+ * native/target/.cvsignore,
+ native/target/generic/.cvsignore,
+ native/target/Linux/.cvsignore:
+ Removed no longer used files.
+
+ * native/target: Removed no longer used directory.
+
+2006-11-26 Dalibor Topic <robilad@kaffe.org>
+
+ Fixes bug #29133.
+
+ * libraries/clib/nio/gnu_java_nio_VMSelector.c
+ (Java_gnu_java_nio_VMSelector_select):
+ Use strerror if strerror_r is not available.
+
+ Reported by: Michael Franz <mvfranz@gmail.com>,
+ Riccardo Mottola <zuse@libero.it>
+
+2006-11-26 Dalibor Topic <robilad@kaffe.org>
+
+ Fixes bug #26756.
+
+ * native/jni/midi-dssi/Makefile.am (AM_CFLAGS): Removed
+ STRICT_WARNING_CFLAGS since it caused the build to fail
+ on GNU/Linux.
+
+2006-11-26 Ian Rogers <ian.rogers@manchester.ac.uk>
+
+ * doc/vmintegration.texinfo: Update VM Threading Model section.
+
+2006-11-26 Tom Tromey <tromey@redhat.com>
+
+ * native/jni/java-net/java_net_VMNetworkInterface.c: Conditionally
+ include ifaddrs.h.
+ (Java_java_net_VMNetworkInterface_getVMInterfaces): Updated
+ conditional.
+ * native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c:
+ Conditionally include ifaddrs.h.
+ (getif_address): Updated conditional.
+ (getif_index): Likewise.
+ * configure.ac: Check for ifaddrs.h.
+
+2006-11-25 Mark Wielaard <mark@klomp.org>
+
+ * java/io/File.java (list): Return empty list for unreadable dirs.
+
+2006-11-25 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java (drawGlyphVector):
+ Synchronize on font peer.
+ (setFont): Likewise.
+ * gnu/java/awt/peer/gtk/GdkFontPeer.java (getFontMetrics): Mark
+ synchronized.
+ (getTextMetrics): Likewise.
+
+2006-11-25 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/GapContent.java
+ (getPositionsInRange): Rewritten to use the more efficient
+ binary search searchFirst() and avoid an NPE that was caused
+ by GC'ed positions.
+
+2006-11-25 Mark Wielaard <mark@klomp.org>
+
+ * javax/swing/text/CompositeView.java (modelToView): Never return
+ null.
+
+2006-11-25 Mark Wielaard <mark@klomp.org>
+
+ * javax/swing/text/html/TableView.java (calculateColumnRequirements):
+ Check whether rowView instanceof RowView.
+ (updateGrid): Likewise.
+
+2006-11-25 Mario Torre <neugens@nirvana.limasoftware.net>
+
+ PR28462
+ * java/text/DecimalFormat.java: Almost new rewrite, and update to 1.5.
+ * java/text/NumberFormat.java (format): all format methods, fixed
+ FieldPosition argument should never be null.
+ (format(Object, StringBuffer, FieldPosition)): fixed signature,
+ method is not final.
+ * java/text/DecimalFormatSymbols.java (clone): fixed to also clone
+ locale.
+ * AUTHORS: added my name to the file.
+
+2006-11-25 Mark Wielaard <mark@klomp.org>
+
+ * javax/swing/text/html/StyleSheet.java (paint): Guard against
+ getChildAllocation() returning null.
+
+2006-11-25 Mark Wielaard <mark@klomp.org>
+
+ * gnu/javax/swing/text/html/css/Selector.java (calculateSpecificity):
+ Use clazzIndex for id substring.
+
+2006-11-25 Mark Wielaard <mark@klomp.org>
+
+ * java/awt/EventQueue.java (pop): Only terminate dispatchThread when
+ it is still running.
+
+2006-11-25 Mark Wielaard <mark@klomp.org>
+
+ Fixes bug #28822
+ * doc/api/Makefile.am (create_html): Guard GJDOC invocation with
+ CREATE_API_DOCS
+
+2006-11-24 Tania Bento <tbento@redhat.com>
+
+ * java/awt/font/TextHitInfo.java
+ (equals(TextHitInfo)): If TextHitInfo parameter is null, return false.
+ (beforeOffset): Decreased first parameter by 1.
+
+2006-11-24 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+ (constructor): Check sample model when setting fastCM flag.
+ (updateBufferedImage): Check scanline and sample model offsets before
+ copying data directly into the image data buffer.
+
+2006-11-24 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/java2d/QuadSegment.java
+ (offsetSubdivided): Handle special straight-line cases.
+
+2006-11-24 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/dnd/DropTarget.java
+ (DropTargetAutoScroller.HYSTERESIS): New constant.
+ (DropTargetAutoScroller.DELAY): New constant.
+ (DropTargetAutoScroller.inner): New field. A cached
+ Rectangle instance.
+ (DropTargetAutoScroller.outer): New field. A cached
+ Rectangle instance.
+ (DropTargetAutoScroller.timer): New field. The actual timer.
+ (DropTargetAutoScroller.DropTargetAutoScroller):
+ Initialize timer.
+ (DropTargetAutoScroller.actionPerformed): Implemented.
+ (DropTargetAutoScroller.stop): Implemented.
+ (DropTargetAutoScroller.updateLocation): Implemented.
+ (clearAutoscroll): Stop the autoscroller before nullifying it.
+ (createDropTargetAutoScroller): Don't set the field here,
+ only return a new instance.
+ (dragEnter): Only do something when active. Initialize
+ auto scrolling.
+ (dragExit): Only do something when active. Stop auto scrolling.
+ (dragOver): Only do something when active. Update auto scrolling.
+ (drop): Only do something when active. Update auto scrolling.
+ (dropActionChanged): Only do something when active. Update
+ auto scrolling.
+ (initializeAutoScrolling): Check if component is an instance
+ of Autoscroll, otherwise do nothing.
+ (setActive): Disable autoscrolling when deactivating.
+ (setComponent): When component is set to null, disable autoscrolling.
+
+2006-11-24 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/beans/beancontext/BeanContextServicesSupport.java
+ (getChildBeanContextServicesListener): Implemented.
+
+2006-11-23 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/awt/peer/headless/HeadlessGraphicsEnvironment.java
+ (createGraphics): Use constructor to create new instance of
+ BufferedImageGraphics.
+ * java/awt/Toolkit.java
+ (getDefaultToolkit): Really try to get a real toolkit. Only
+ use HeadlessToolkit if no other is available.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java
+ (checkHeadless): New helper method. Checks for headless environment
+ and throws HeadlessException if appropriate.
+ (createButton): Check for headless.
+ (createCanvas): Check for headless.
+ (createCheckbox): Check for headless.
+ (createCheckboxMenuItem): Check for headless.
+ (createChoice): Check for headless.
+ (createDialog): Check for headless.
+ (createDragGestureRecognizer): Check for headless.
+ (createDragSourceContextPeer): Check for headless.
+ (createEmbeddedWindow): Check for headless.
+ (createFileDialog): Check for headless.
+ (createFrame): Check for headless.
+ (createCheckbox): Check for headless.
+ (createLabel): Check for headless.
+ (createList): Check for headless.
+ (createMenu): Check for headless.
+ (createMenuBar): Check for headless.
+ (createMenuItem): Check for headless.
+ (createPanel): Check for headless.
+ (createPopupMenu): Check for headless.
+ (createScrollbar): Check for headless.
+ (createScrollPane): Check for headless.
+ (createTextArea): Check for headless.
+ (createTextField): Check for headless.
+ (createWindow): Check for headless.
+
+2006-11-23 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/beans/beancontext/BeanContextSupport.java
+ (deserialize): Implemented,
+ (serialize): Implemented.
+
+2006-11-23 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/awt/peer/headless/HeadlessGraphicsEnvironment.java
+ (createGraphics): Try to use Cairo graphics if available.
+
+2006-11-22 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/beans/beancontext/BeanContextSupport.java
+ (toArray): Added API docs,
+ (toArray(Object[])): Added API docs, removed NotImplementedException.
+
+2006-11-22 Tania Bento <tbento@redhat.com>
+
+ * javax/swing/JRootPane.java
+ (setLayeredPane): Added documentation; throw
+ IllegalComponentStateException if layered pane parameter is null.
+
+2006-11-22 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/beans/beancontext/BeanContextSupport.java
+ (avoidingGui): Removed NotImplementedException.
+
+2006-11-22 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+ (drawGlyphVector): Clip updated area to glyph bounds.
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (createPath): Eliminate distortion when pixel-shifting rectangles; separate
+ x-coordinate and y-coordinate pixel shifting.
+ (shifted): Removed method.
+ (shiftX): New method, recognising scaling transforms.
+ (shiftY): New method, recognising scaling transforms.
+ (walkPath): Separate x-coordinate and y-coordinate pixel shifting.
+
+2006-11-22 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/font/TextLayout.java
+ (hash): New field. Caches the hash code.
+ (hashCode): Implemented.
+
+2006-11-22 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/image/ImageFilter.java
+ Reformat whole class.
+ (getFilterInstance): Don't touch the consumer field. Don't check
+ consumer.
+ (imageComplete): Don't check consumer.
+ (setColorModel): Don't check consumer.
+ (setDimensions): Don't check consumer.
+ (setHints): Don't check consumer.
+ (setPixels): Don't check consumer.
+ (setProperties): Pass the original property too.
+ * java/awt/image/IndexColorModel.java
+ (IndexColorModel(int,int,byte[],byte[],byte[],int)): Set the
+ transparent pixel by calling the new helper method.
+ (IndexColorModel(int,int,byte[],int,boolean,int)): Set the
+ transparent pixel by calling the new helper method.
+ (IndexColorModel(int,int,int[],int,boolean,int,int)): Set the
+ transparent pixel by calling the new helper method.
+ (coerceData): Removed. This is not needed.
+ (getAlpha): Simply return value from color map. The transparent
+ pixel has to be there.
+ (setTransparentPixel): New helper method. Inserts the transparent
+ pixel.
+ * java/awt/image/RGBImageFilter.java
+ Reformat whole class.
+ (convertColorModelToDefault): Removed. No longer needed.
+ (filterIndexColorModel): Don't handle transparent pixels
+ separately.
+ (filterRGBPixels): Set pixels on consumer already.
+ (makeColor): Removed. No longer needed.
+ * java/awt/image/ReplicateScaleFilter.java
+ (replicatePixels): Removed.
+ (setDimension): Correctly compute destination size, avoid double
+ calculations.
+ (setPixels): Avoid double calculations. Fixed some boundary cases.
+ (setupSources): New helper method.
+ * java/awt/image/SampleModel.java
+ (setDataElements): Also handle TYPE_SHORT, TYPE_FLOAT
+ and TYPE_DOUBLE.
+ * java/awt/image/SinglePixelPackedSampleModel.java
+ (setDataElements(int,int,int,int,Object,DataBuffer)): Removed.
+ This is not needed as the superclass already copies line
+ by line.
+ (setDataElements(int,int,Object,DataBuffer)): Simplified code,
+ removed some checks that the RI also doesn't perform. Call
+ DataBuffer.setElem().
+
+2006-11-22 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/text/TextLayout.java
+ (getLogicalRangesForVisualSelection): Implemented.
+
+2006-11-21 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * sun/reflect/annotation/AnnotationParser.java,
+ * sun/reflect/annotation/AnnotationType.java,
+ * sun/reflect/annotation/EnumConstantNotPresentExceptionProxy.java,
+ * sun/reflect/annotation/ExceptionProxy.java:
+ Stubbed.
+ * sun/misc/ServiceConfigurationError.java,
+ * sun/misc/Service.java:
+ Implemented.
+
+2006-11-21 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/text/TextLayout.java
+ (Run.isLeftToRight): New helper method.
+ (logicalToVisual): New field. Maps logical indices to visual
+ indices.
+ (visualToLogical): New field. Maps visual indices to logical
+ indices.
+ (TextLayout): Setup mappings.
+ (setupMappings): New method for setting up the mappings.
+ (getCharacterLevel): Reorganized code.
+ (getNextLeftHit(int)): Implemented.
+ (getNextLeftHit(int,CaretPolicy)): New method.
+ (getNextLeftHit(TextHitInfo)): Implemented.
+ (getNextRightHit(int)): Implemented.
+ (getNextRightHit(int,CaretPolicy)): New method.
+ (getNextRightHit(TextHitInfo)): New method.
+ (getVisualOtherHit): Implemented.
+ (checkHitInfo): New helper methods for checking parameters.
+ (hitToCaret): New helper method. Maps hit infos to caret locations.
+ (caretToHit): New helper method. Maps caret locations to hit infos.
+ (isCharacterLTR): New helper method.
+ (CaretPolicy.getStrongCaret): Implemented.
+
+2006-11-21 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+ (draw): Include stroke width when calculating bounds.
+ (updateBufferedImage): Round bounds more generously, handle negative
+ height/width values, and clip more intelligently.
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (createPath): Add shortcut optimization for lines.
+ (draw): Include stroke width when calculating bounds.
+ (drawLine): Delegate to main draw() method.
+ (drawRect): Likewise.
+ (fillRect): Delegate to main fill() method.
+ (findStrokedBounds): New method.
+ (setCustomPaint): Round bounds more generously.
+ * gnu/java/awt/peer/gtk/ComponentGraphics.java
+ (drawLine): Removed.
+ (drawRect): Removed.
+ (fillRect): Removed.
+
+2006-11-21 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/java2d/TexturePaintContext.java
+ (getRaster): Handle negative coordinate values.
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (setPaint): Moved custom paint processing to a new method.
+ (setPaintPixels): Added x, y parameters.
+ (getRealBounds): Added documentation.
+ (copy): Copy clipping information.
+ (drawLine): Process custom paints.
+ (setCustomPaint): New method.
+ (fill): Process custom paints.
+ (drawGlyphVector): Process custom paints.
+ (drawRect): Process custom paints.
+ (draw): Process custom paints.
+ * gnu/java/awt/peer/gtk/CairoSurface.java
+ (cairoCM_opaque): New constant.
+ * gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+ (argb32): Removed constant.
+ (rgb32): Removed constant.
+ (BufferedImageGraphics(BufferedImage)): Updated constant names.
+ (BufferedImageGraphics(BufferedImageGraphics)): Copy color model flags.
+ (updateBufferedImage): Transform to device-space before updating.
+ * include/gnu_java_awt_peer_gtk_CairoGraphics2D.h
+ (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_setPaintPixels): Added x, y
+ parameters.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
+ (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_setPaintPixels): Set pattern
+ source at designated x, y origin.
+
+2006-11-21 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/text/TextLayout.java
+ (Run): New inner helper class.
+ (length): New field.
+ (naturalBounds): New field.
+ (offset): New field.
+ (runIndices): Removed. This is now encapsulate in a Run object.
+ (runs): Changed to Run[].
+ (string): Changed to char[].
+ (totalAdvance): New field. Caches advance value.
+ (TextLayout(String,Font,FontRenderContext)): Change to store
+ string as char[] and run layout as Run[]. Clean out empty
+ run items.
+ (TextLayout(TextLayout,int,int)): Change to store
+ string as char[] and run layout as Run[].
+ (clone): Call private constructor for maximum efficiency.
+ (determineWhitespace): Adapted to use char[] data.
+ (draw): Adapted to use Run objects.
+ (getAdvance): Cache computed total advance.
+ (getBlackBoxBounds): Adapted to use Run objects.
+ (getCaretInfo): Use natural layout bounds.
+ (getCharacterCount): Return length field.
+ (getLogicalHighlightShape): Adapted to use Run objects.
+ (getNaturalBounds): New helper method. Calculates and returns the
+ natural bounds of this text layout.
+ (getOutline): Adapted to use Run objects.
+ (getStringProperties): Adapted to use char[] data.
+ (getVisibleAdvance): Adapted to use char[] and Run data.
+ (handleJustify): Adapted to use char[] and Run data.
+ (hitTestChar(float,float,Rectangle2D)): Implemented.
+ (hitTestChar(float,float)): Use natural bounds.
+ (setCharIndices): Adapted to use char[] and Run data.
+ (toString): Adapted to use char[] and Run data.
+ * java/text/Bidi.java
+ (requiresBidi): Exclude paragraph separators from bidi-triggers.
+
+2006-11-21 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/awt/peer/gtk/GdkFontMetrics.java:
+ Removed. This is now an inner class in GdkFontPeer.
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (drawString(float,float)): Use text layout cache from
+ GdkFontPeer.
+ (getFontMetrics): Delegate to GdkFontPeer.
+ * gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
+ (getGlyphCodes): Also check array size.
+ (getGlyphPositions): Also check array size.
+ * gnu/java/awt/peer/gtk/GdkFontPeer.java
+ (GdkFontLineMetrics.fm): Removed.
+ (GdkFontLineMetrics.strikeThroughOffset): Removed.
+ (GdkFontLineMetrics.strikeThroughThickness): Removed.
+ (GdkFontLineMetrics.underlineOffset): Removed.
+ (GdkFontLineMetrics.underlineThickness): Removed.
+ (GdkFontLineMetrics.GdkFontLineMetrics): Don't take
+ FontMetrics argument. Don't init removed fields.
+ (GdkFontLineMetrics.getAscent): Return font peer's field.
+ (GdkFontLineMetrics.getDescent): Return font peer's field.
+ (GdkFontLineMetrics.getHeight): Return font peer's field.
+ (GdkFontLineMetrics.getLeading): Return font peer's field.
+ (GdkFontLineMetrics.getNumChars): Reformat.
+ (GdkFontLineMetrics.getStrikeThroughOffset): Return half ascent.
+ (GdkFontLineMetrics.getStrikeThroughThickness): Return 1.
+ (GdkFontLineMetrics.getUnderlineOffset): Return font peer's field.
+ (GdkFontLineMetrics.getUnderlineThickness): Return font peer's field.
+ (GdkFontMetrics): Moved class in here as inner class.
+ Make it use the font peer's fields and for the char(s) width
+ and string width method, use TextLayout to measure the actual widths.
+ (ascent): New field.
+ (bundle): Removed.
+ (DEFAULT_CTX): New constant field.
+ (descent): New field.
+ (FONT_METRICS_ASCENT): New constant.
+ (FONT_METRICS_DESCENT): New constant.
+ (FONT_METRICS_HEIGHT): New constant.
+ (FONT_METRICS_MAX_ADVANCE): New constant.
+ (FONT_METRICS_MAX_ASCENT): New constant.
+ (FONT_METRICS_MAX_DESCENT): New constant.
+ (FONT_METRICS_UNDERLINE_OFFSET): New constant.
+ (FONT_METRICS_UNDERLINE_THICKNESS): New constant.
+ (height): New field.
+ (maxAdvance): New field.
+ (maxAscent): New field.
+ (maxDescent): New field.
+ (metrics): New field. Stores a FontMetrics for this font.
+ (textLayoutCache): New field. Caches TextLayout instances.
+ (underlineOffset): New field.
+ (underlineThickness): New field.
+ (cinit): Don't initialize resource bundle.
+ (GdkFontPeer): Setup the metrics.
+ (getFontMetrics): Return stored metrics if possible.
+ (getLineMetrics): Adapt to new constructor.
+ (initFont): New helper method.
+ (setupMetrics): New helper method.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java
+ (LRUCache): Made class a static class.
+ (getFontMetrics): Delegate to GdkFontPeer.
+ * native/jni/gtk-peer/gdkfont.h
+ Added new constant defines.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
+ (getFontMetrics): Rewritten to fetch the font metrics from
+ FreeType.
+
+2006-11-20 Tania Bento <tbento@redhat.com>
+
+ * javax/swing/ButtonGroup.java:
+ (setSelected): Select the ButtonModel if all conditions
+ are met.
+
+2006-11-20 Tania Bento <tbento@redhat.com>
+
+ * javax/swing/JSlider.java:
+ (updateLabelUIs): Removed casting.
+
+2006-11-20 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/util/regex/RE.java (messages): Don't initialize.
+ (bundle): New static final String field.
+ (getLocalizedMessage): Initialize messages when still null.
+ * gnu/java/util/regex/RESyntax.java (SYNTAX_IS_FINAL): Removed.
+ (set): Use RE.getLocalizedMessage().
+ (clear): Likewise.
+ (setLineSeparator): Likewise.
+
+2006-11-20 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/StyleSheet.java
+ (linked): New field.
+ (styleSheet): Replaced by linked.
+ (addStyleSheet): Use an arraylist for simplicity.
+ (getRule): Removed useless instantiation.
+ (getStyleSheets): Convert array list to array.
+ (removeStyleSheet): Use an arraylist for simplicity.
+ (resolveStyle): Include styles from linked lists.
+
+2006-11-20 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/BoxView.java
+ (BoxView): Initialize with invalid req's.
+ (forwardUpdate): Trigger repaint when children changed the
+ major axis.
+ (getResizeWeight): Return resizable when the pref differs from
+ the min or the pref differs from the max size.
+ (layoutMajorAxis): Actually sum up the preferred sizes.
+ (paint): Made binary search more robust.
+ (replace): Let arrays shrink when needed.
+ (replaceLayoutArray): Let arrays shrink when needed.
+ (setAxis): Trigger preferenceChanged.
+ * javax/swing/text/CompositeView.java
+ (getInsideAllocation): Call insets method to take account
+ of overriding subclasses.
+ * javax/swing/text/DefaultStyledDocument.java
+ (ElementBuffer.finishEdit): Clear the stack and edits buffer.
+ (ElementBuffer.insertUpdate): Only remove the found element, not
+ all.
+ * javax/swing/text/GlyphView.java
+ (insertUpdate): Pass null in preferenceChanged.
+ (removeUpdate): Pass null in preferenceChanged.
+ (changedUpdate): Pass null in preferenceChanged.
+ * javax/swing/text/Utilities.java
+ (drawTabbedText): Avoid single calls to charWidth() and instead
+ call charsWidth() on whole chunks.
+ * javax/swing/text/html/HTMLDocument.java
+ (BlockElement.getName): Fall back to super when necessary.
+ (RunElement.getName): Fall back to super when necessary.
+ (HTMLReader.MAX_THRESHOLD): New constant field.
+ (HTMLReader.GROW_THRESHOLD): New constant field.
+ (HTMLReader.theshold): New field.
+ (HTMLReader.HTMLReader): Fetch threshold from document.
+ (HTMLReader.addContent): Sucessivly grow the threshold.
+ (createLeafElement): Don't create two elemens and don't set
+ attribute.
+ * javax/swing/text/html/TableView.java
+ (RowView.replace): Invalidate grid.
+ (gridValid): Made package private.
+ (layoutMinorAxis): Mark all rows as invalid.
+ (replace): Invalidate grid.
+
+2006-11-20 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/AbstractDocument.java
+ (DefaultDocumentEvent.changes): Changed to be a HashMap.
+ (DefaultDocumentEvent.modified): Made private.
+ (DefaultDocumentEvent.THRESHOLD): New constant field.
+ (DefaultDocumentEvent.DefaultDocumentEvent): Don't initialize
+ changes table.
+ (DefaultDocumentEvent.addEdit): Switch to hashmap only when
+ exceeding threshold.
+ (DefaultDocumentEvent.getChange): Use iterative approach
+ when we have no hashmap yet.
+ (documentCV): Removed.
+ (numWriters): Renamed from numWritersWaiting.
+ (createPosition): Reformat.
+ (getCurrentWriter): Synchronized.
+ (readLock): Implement more straightforward.
+ (readUnlock): Implement more straightforward.
+ (writeLock): Implement more straightforward.
+ (writeUnlock): Implement more straightforward.
+ (remove): Write-lock here.
+ (removeImpl): Don't write-lock here.
+
+2006-11-20 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JEditorPane.java
+ (setPage): Set priority on loading thread.
+
+2006-11-20 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicTextUI.java
+ (RootView.paint): Avoid allocation.
+ (cachedInsets): New field. Caches an Insets instance.
+ (getNextVisualPositionFrom): Read-lock the document to avoid
+ thread nastiness. Push allocation.
+ (getPreferredSize): Push fake allocation when not yet laid out.
+ (getVisibleEditorRect): Use cached insets.
+ (viewToModel): Read-lock the document to avoid
+ thread nastiness. Push allocation.
+
+2006-11-20 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/StyleContext.java
+ (attributeSetPool): Synchronize this map.
+ (addAttribute): Synchronize this method.
+ (addAttributes: Synchronize this method.
+ (readObject): Install synchronized map on target object.
+ (removeAttribute): Synchronize this method.
+ (removeAttributes): Synchronize this method.
+ (removeAttributes): Synchronize this method.
+
+2006-11-20 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/GapContent.java
+ (GapContentPosition.GapContentPosition): Removed constructor.
+ (Mark): Made subclass of WeakReference to refer directly to
+ the associated position.
+ (Mark.refCount): Removed.
+ (Mark.Mark(int,GapContentPosition,ReferenceQueue):
+ New constructor. Used to reference a position and register the
+ reference queue.
+ (Mark.Mark(index)): Call super and don't adjust mark offset.
+ (Mark.compareTo): Removed.
+ (Mark.equals): Removed.
+ (Mark.getOffset): Return at least null. Removed assert.
+ (Mark.getPosition): New helper method.
+ (garbageMarks): New field.
+ (positions): Removed.
+ (searchMark): New field.
+ (GapContent): Removed init of positions map.
+ (addImpl): New helper method.
+ (adjustPositionsInRange): Removed.
+ (compare): New helper method.
+ (createPosition): Rewritten for new datastructures. This now
+ performs a much more efficient binary search for finding
+ a position at the requested offste.
+ (garbageCollect): Rewritten to collect unused marks.
+ (getPositionsInRange): Adjusted for new data structures.
+ (removeImpl): New helper method.
+ (replace): Use new addImpl() and removeImpl() helper method for
+ correctly adjusting the positions and gap.
+ (search): Rewritten. Implements a more suitable binary search.
+ (searchFirst): New helper method.
+ (setPositionsInRange): Removed.
+ (shiftEnd): Update the marks here.
+ (shiftGap): Update the marks here.
+ (shiftGapEndUp): Update the marks here.
+ (shiftGapStartDown): Update the marks here.
+
+2006-11-20 Marco Trudel <mtrudel@gmx.ch>
+
+ * java/util/jar/JarFile.java (digestAlgorithms): New field used to cache
+ digest algorithm implementations.
+ (readSignatures): Parse the manifest once and reuse that data.
+ Add support for line breaks.
+ (verifyHashes): Use the parsed manifest entry.
+ (readManifestEntry): Removed.
+
+2006-11-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/beans/beancontext/BeanContextServicesSupport.java:
+ Added more documentation.
+ (addService(Class,BeanContextServiceProvider,boolean)):
+ Synchronized over global hierarchy lock.
+ (bcsPreDeserializationHook(ObjectInputStream)): Implemented.
+ (bcsPreSerializationHook(ObjectOutputStream)): Implemented.
+ (childJustRemovedHook(Object,BCSChild)): Implemented.
+ (createBCSSServiceProvider(Class,BeanContextServiceProvider)):
+ Implemented.
+ (fireServiceRevoked(BeanContextServiceRevokedEvent)):
+ Added revocation-only listeners.
+ (getBeanContextServicesPeer()): Implemented.
+ (getCurrentServiceClasses(Class)): Synchronized over global
+ hierarchy lock.
+ (getCurrentServiceSelectors(Class)): Synchronized over global
+ hierarchy lock, and fixed FIXME.
+ (getService(BeanContextChild,Object,Class,Object,
+ BeanContextServiceRevokedListener)): Implemented.
+ (hasService(Class)): Synchronized over global hierarchy lock.
+ (releaseService(BeanContextChild,Object,Object)): Implemented.
+ (revokeService(Class,BeanContextServiceProvider,boolean)): Implemented.
+ * java/beans/beancontext/BeanContextSupport.java:
+ (remove(Object, boolean)): Documentation correction.
+
+2006-11-19 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JEditorPane.java
+ (PageStream): New inner class.
+ (PageLoader): New inner class.
+ (loading): New field.
+ (setPage): Implemented asynchronous loading.
+ * javax/swing/text/DefaultStyledDocument.java
+ (ElementBuffer.create): New helper method.
+ (create): Use new ElementBuffer method instead of hack.
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.flushImpl): New helper method.
+ (HTMLReader.addContent): Use flushImpl().
+ (HTMLReader.blockClose): Added null check.
+ (HTMLReader.flush): Use flushImpl().
+ * javax/swing/text/html/HTMLEditorKit.java
+ (createDefaultDocument): Set load priority to 4 and token threshold
+ to 100.
+ * javax/swing/text/html/TableView.java
+ (insertUpdate): Overridden to provide correct view factory.
+ (removeUpdate): Overridden to provide correct view factory.
+ (changedUpdate): Overridden to provide correct view factory.
+
+2006-11-19 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/BoxView.java
+ (clipRect): New field.
+ (tmpRect): New field.
+ (layout): Reorganized code. Now uses layoutAxis() helper method.
+ (layoutAxis): New helper method.
+ (paint): Optimized by using cached Rectangle objects and
+ a binary search for child views inside the clip.
+ * javax/swing/text/CompositeView.java
+ (insideAllocation): Made private and initialized in constructor.
+ (getInsideAllocation): Removed initialization block for
+ insideAllocation field. Avoid unnecessary allocations.
+ * javax/swing/text/GlyphView.java
+ (DefaultGlyphPainter.paint): Only paint the actual glyphs here
+ The remaining stuff (background, underline and striking) is
+ done in the GlpyhView itself. Avoid unnecessary allocations.
+ (cached): A cached Segment instance.
+ (getText): Return cached segment.
+ (paint): Paint underline, strike and background here. Avoid
+ unecessary allocs.
+
+2006-11-19 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/StyleSheet.java
+ (getFontSize): Removed debug output.
+ (ListPainter.tmpRect): New field.
+ (ListPainter.paint): Align bullet vertically centered to
+ the first line of the paragraph.
+
+2006-11-17 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/css/CSSParser.java
+ (parseDeclaration): Trim string before reporting.
+ * gnu/javax/swing/text/html/css/FontSize.java
+ (size): New field.
+ (isRelative): New field.
+ (sizeIndex): New field.
+ (FontSize): Initialize new fields.
+ (getValue): Changed to call getValue(int).
+ (getValue(int)): New method. Implements relative font sizes.
+ (isRelative): New method.
+ (mapAbsolute): Store index.
+ (mapEM): New helper method.
+ (mapLarger): New helper method.
+ (mapPercent): New helper method.
+ (mapRelative): New helper method.
+ (mapSmaller): New helper method.
+ (mapValue): New helper method.
+ * javax/swing/text/html/CSS.java
+ (parseBackgroundShorthand): Create CSSColor directly.
+ * javax/swing/text/html/StyleSheet.java
+ (addRule): Invalidate resolved styles.
+ (getFont): Call new getFontSize() method to resolve relative
+ font sizes.
+ (getFontSize): New helper method. Resolves relative font sizes.
+ (translateHTMLToCSS): Create CSS objects directly.
+
+2006-11-13 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/java/util/regex/RETokenNamedProperty.java:
+ (getHandler(String)): Add support for 'all'.
+
+2006-11-18 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/javax/management/Server.java:
+ Initial implementation of a GNU management server.
+ * javax/management/MBeanPermission.java,
+ * javax/management/MBeanRegistration.java,
+ * javax/management/MBeanTrustPermission.java:
+ Implemented.
+
+2006-11-17 Mark Wielaard <mark@klomp.org>
+
+ * docs/www.gnu.org/newsitems.txt: Add Sun GPL news announcement.
+
+2006-11-17 Gary Benson <gbenson@redhat.com>
+
+ * java/net/DatagramSocket.java (getLocalAddress, connect,
+ receive): Perform security check on address not hostname.
+
+2006-11-16 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/parser/support/Parser.java
+ (_handleText): Fixed condition for consuming whitespace.
+ Removed validator check, this is superfluous now.
+
+2006-11-16 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/css/CSSParser.java
+ (parseRuleset): Support 'combined' selectors.
+ (main): Adapt callback for combined selectors support.
+ * gnu/javax/swing/text/html/css/CSSParserCallback.java
+ (startStatement): Take selector array as argument, to
+ support combined selectors.
+ * javax/swing/text/html/BlockView.java
+ (calculateMinorAxisRequirements): Fetch and apply alignment.
+ * javax/swing/text/html/StyleSheet.java
+ (CSSStyle): Inverted the constants for correct precedence.
+ (CSSStyleSheetParserCallback.styles): New field. Stores the current
+ styles.
+ (CSSStyleSheetParserCallback.style): Removed.
+ (CSSStyleSheetParserCallback.declaration): Update multiple styles.
+ (CSSStyleSheetParserCallback.end): Push multiple styles.
+ (CSSStyleSheetParserCallback.start): Initialize multiple styles.
+
+2006-11-16 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/FlowView.java
+ (LogicalView.getPreferredSpan): Calculate maximum correctly.
+ * javax/swing/text/GlyphView.java
+ (tabExpander): New field.
+ (tabX): New field.
+ (breakView): Set tabX on broken view.
+ (getPartialSpan): Let the painter fetch the span.
+ (getTabbedSpan): Update the tab expander field. Maybe trigger
+ relayout.
+ (getTabExpander): Simply return the stored expander.
+ * javax/swing/text/Utilities.java
+ (getTabbedTextOffset): Made algoritm a little smarter and more
+ efficient.
+ (getTabbedTextWidth): Don't add single char widths, instead add
+ chunks of characters.
+ * javax/swing/text/html/ParagraphView.java
+ (calculateMinorAxisRequirements): Adjust margin only when the
+ CSS span is not fixed.
+
+2006-11-16 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/beans/beancontext/BeanContextSupport.java
+ (getChildBeanContextMembershipListener): Implemented,
+ (getChildPropertyChangeListener): Implemented,
+ (getChildSerializable): Implemented,
+ (getChildVetoableChangeListener): Implemented,
+ (getChildVisibility): Implemented,
+ (setDesignTime): Use same property name as Sun's implementation.
+
+2006-11-16 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/beans/DesignMode.java: Reformatted and removed a FIXME,
+ * java/beans/Statement.java
+ (toString): Updated to match reference implementation.
+
+2006-11-15 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/HTMLEditorKit.java
+ (InsertHTMLTextAction.actionPerformed): Also try inserting
+ the alternate tag. Adjust the selection accordingly.
+ (InsertHTMLTextAction.adjustSelection): New helper method.
+ Adjusts the selection after an insertion.
+ (insertAtBoundary): Delegate to deprecated method.
+ (insertAtBoundry): Implemented missing method.
+ (tryInsert): New helper method.
+ (defaultActions): Implemented to fill the array with
+ a couple of InsertHTMLTextActions.
+
+2006-11-15 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/ImageView.java
+ (Observer): New class. Observes image loading.
+ (haveHeight): New field.
+ (haveWidth): New field.
+ (height): New field.
+ (width): New field.
+ (image): New field.
+ (imageIcon): New field.
+ (loading): New field.
+ (observer): New field.
+ (reloadImage): New field.
+ (reloadProperties): New field.
+ (ImageView): Initialize observer and some flags.
+ (getImage): Update the image state and return the image.
+ (loadImage): New helper method. Actually starts loading.
+ (paint): Rewritten to paint the image directly, not via Icon.
+ (reloadImage): Rewritten. Loads the image and its properties.
+ (renderIcon): Removed. No more necessary.
+ (setPropertiesFromAttributes): Don't nullify image here.
+ Added comment about missing impl.
+ (setSize): Added comment about missing impl.
+ (updateSize): New helper method. Updates the size attributes.
+ (updateState): New helper method. Makes sure the image
+ and its properties are valid.
+
+2006-11-15 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/parser/support/Parser.java
+ (_handleEndTag_remaining): Consume whitespace after a closing
+ block like tag.
+
+2006-11-15 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.ParagraphAction.end): Call super instead of blockClose()
+ directly.
+ (HTMLReader.ParagraphAction.start): Call super instead of blockOpen()
+ directly.
+ (HTMLReader.parseStack): Removed.
+ (HTMLReader.blockClose): Simply call addContent() with ' '
+ instead of doing more complicated stuff. Removed parseStack
+ handling.
+ (HTMLReader.blockOpen): Removed parseStack handling.
+ (getInsertingReader): Removed parseStack init.
+ * gnu/javax/swing/text/html/parser/htmlValidator.java
+ (closeTag): Return true only when the tag actually should be
+ closed.
+ * gnu/javax/swing/text/html/parser/support/Parser.java
+ (_handleEndTag): Only actually close the tag when the validator
+ allows it.
+
+2006-11-15 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/CSS.java
+ (Attribute.BORDER_SPACING): New field for the CSS border-spacing
+ attribute.
+ * javax/swing/text/html/StyleSheet.java
+ (BoxPainter.bottomPadding): New field.
+ (BoxPainter.leftPadding): New field.
+ (BoxPainter.rightPadding): New field.
+ (BoxPainter.topPadding): New field.
+ (BoxPainter.BoxPainter): Fetch the MARGIN and PADDING* attributes
+ too.
+ (BoxPainter.getInset): Recognize and include the padding.
+ (translateHTMLToCSS): Added mapping for CELLPADDING and CELLSPACING.
+ javax/swing/text/html/TableView.java
+ (RowView.calculateMajorAxisRequirements): Adjust req's for
+ cellSpacing.
+ (RowView.layoutMajorAxis): Adjust multi-column span for cellSpacing.
+ (cellSpacing): New field.
+ (columnRequirements): Made package private to avoid accessor method.
+ (calculateMinorAxisRequirements): Include cellSpacing.
+ (calculateMajorAxisRequirements): Overridden to include cellSpacing.
+ (layoutMajorAxis): Likewise.
+ (layoutColumns): Respect cellSpacing.
+ (setParent): Overridden to fetch the CSS attributes when view gets
+ connected.
+ (setPropertiesFromAttributes): New method. Fetches the cell
+ spacing from the CSS attributes.
+
+2006-11-15 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/parser/support/Parser.java
+ (_handleText): Consume whitespace directly before a closing tag.
+ (restOfTag): Consume whitespace directly after opening.
+ * gnu/javax/swing/text/html/parser/support/textPreProcessor.java
+ (preprocess): Don't perform array boundary checking by
+ catch AIOOBE, instead check the boundary in loop condition.
+ * gnu/javax/swing/text/html/parser/support/low/Constants.java
+ (TAG_CLOSE): New constants. Describes the token pattern for
+ a closing tag.
+
+2006-11-14 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/ImageView.java
+ (getPreferredSpan): Use CSS length values.
+ * javax/swing/text/html/TableView.java
+ (CellView.calculateMajorAxisRequirements): Overridden to
+ set the maximum reqs to maximum.
+ (RowView.getMaximumSize): For the X_AXIS, set the maximum
+ span to maximum.
+ (RowView.getMinimumSpan): Overridden. For the X_AXIS, return
+ the total column reqs.
+ (RowView.getPreferredSpan): Overridden. For the X_AXIS, return
+ the total column reqs.
+ * gnu/javax/swing/text/html/css/CSSColor.java
+ (convertValue): Catch NumberFormatExceptions for more robustness.
+ * gnu/javax/swing/text/html/css/FontSize.java
+ (mapPixels): Actually map px values. Catch NFE for more robustness.
+
+2006-11-14 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/awt/font/autofit/AxisHints.java,
+ * gnu/java/awt/font/autofit/Constants.java,
+ * gnu/java/awt/font/autofit/GlyphHints.java,
+ * nu/java/awt/font/autofit/Latin.java,
+ * nu/java/awt/font/autofit/LatinAxis.java,
+ * gnu/java/awt/font/autofit/LatinMetrics.java,
+ * gnu/java/awt/font/autofit/Scaler.java,
+ * gnu/java/awt/font/autofit/Script.java,
+ * gnu/java/awt/font/autofit/ScriptMetrics.java,
+ * gnu/java/awt/font/autofit/Segment.java,
+ * gnu/java/awt/font/autofit/Width.java:
+ New classes. This is some skeleton stuff for the FreeType-alike
+ auto-gridfitter.
+ * gnu/java/awt/font/opentype/CharGlyphMap.java: Made class public.
+ * gnu/java/awt/font/opentype/OpenTypeFont.java
+ (unitsPerEm): Made field public.
+ (getRawGlyphOutline): New method. Fetches the raw outline.
+ * gnu/java/awt/font/opentype/Scaler.java
+ (getRawGlyphOutline): New method. Fetches the raw outline.
+ * gnu/java/awt/font/opentype/truetype/GlyphLoader.java
+ (loadGlyph): New method. This is used to load raw outlines.
+ * gnu/java/awt/font/opentype/truetype/TrueTypeScaler.java
+ (getRawOutline): New method. Fetches the raw outline.
+ * gnu/java/awt/font/opentype/truetype/Zone.java:
+ Made class public.
+
+2006-11-14 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/RepaintManager.java
+ (RepaintManager): Fetch the default state for the double buffering
+ from a system property gnu.swing.doublebuffering.
+
+2006-11-14 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicLabelUI.java
+ (cachedInsets): New field.
+ (getFontMetrics): New helper method. Fetches the font metrics
+ from the component or the toolkit.
+ (getPreferredSize): Use getFontMetrics() helper method for
+ fetching the font metrics.
+ (paint): Use getFontMetrics() helper method for
+ fetching the font metrics. Only paint if icon or text
+ are != null. Use cached insets.
+ (paintDisabledText): Don't store/restore color object. The
+ JComponent painting mechanism takes care of this by calling
+ create().
+ (paintEnabledText): Don't store/restore color object. The
+ JComponent painting mechanism takes care of this by calling
+ create().
+
+2006-11-14 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/awt/peer/GLightweightPeer.java
+ (handleEvent): Try to do something reasonable and trigger painting
+ for the lightweight component.
+ (getFontMetrics): Fetch and return a font metrics object from
+ the Toolkit.
+
+2006-11-13 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/java/util/regex/RETokenNamedProperty.java:
+ (getHandler(String)): Add support for 'all'.
+
+2006-11-13 Andreas Tobler <a.tobler@schweiz.org>
+
+ * AUTHORS: Add myself.
+
+2006-11-13 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * AUTHORS: Add Tania Bento, Thomas Fitzsimmons, Francis Kung and
+ Dalibor Topic. Re-order 'K' section. Remove trailing space from
+ Roman Kennke's entry.
+
+2006-11-13 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/image/IndexColorModel.java
+ (createCompatibleSampleModel): Implemented missing method.
+
+2006-11-11 Andreas Tobler <a.tobler@schweiz.org>
+
+ * gnu/java/awt/peer/gtk/GtkImageConsumer.java (setPixels): Handle data
+ from big endian systems correctly.
+
+2006-11-11 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/css/CSSColor.java
+ (isValidColor): New helper method. Checks strings if they
+ form a valid color value.
+ * gnu/javax/swing/text/html/css/Length.java
+ (Length): Catch number format exceptions.
+ * javax/swing/text/html/CSS.java
+ (addInternal): New method. Checks for shorthand CSS attributes
+ and parses them.
+ (parseBackgroundShorthand): New method. Parses the background
+ shorthand attribute.
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.LinkAction): Made class a subclass of HiddenAction.
+ (HTMLReader.LinkAction.start): Implemented to load the linked
+ stylesheet.
+ (HTMLReader.LinkAction.end): Removed. This is not needed.
+ * javax/swing/text/html/StyleSheet.java
+ (CSSStyleSheetParserCallback.declaration): Push declaration
+ through CSS.addInternal() to parse shorthand attributes.
+ (addCSSAttribute): Push declaration through CSS.addInternal()
+ to parse shorthand attributes.
+ (importStyleSheet): Implemented. This adds a stylesheet from
+ an URL.
+ * javax/swing/text/html/TableView.java
+ (calculateColumnRequirements): Increase column index for
+ non CellView children to avoid endless loop.
+ * javax/swing/text/CompositeView.java
+ (setParent): Comparen with numChildren not with real arraylength.
+
+2006-11-11 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/beans/beancontext/BeanContextSupport.java
+ (getChildBeanContextChild): Implemented.
+
+2006-11-10 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/View.java
+ (updateLayout): Only repaint when needed.
+
+2006-11-10 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/util/Collections.java
+ (sort(List)): Minor API doc addition,
+ (sort(List, Comparator)): Likewise.
+
+2006-11-10 David Fu <fchoong@netbeans.jp>
+
+ * javax/swing/text/html/HTMLWriter.java
+ (traverse): Removed Classpath specific handling of implied
+ tags.
+ (traverseHtmlFragment): Removed Classpath specific handling of
+ implied tags.
+
+2006-11-10 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/ParagraphView.java
+ (Row.getMaximumSize): Removed. This method is not necessary.
+ * javax/swing/text/html/TableView.java
+ (CellView): Moved attribute init to setPropertiesFromAttributes().
+ (setPropertiesFromAttributes): Fetch attributes here.
+ (RowView.RowView): Documented.
+ (RowView.getMaximumSpan): Overridden to restrict the max span
+ in the Y direction.
+ (RowView.layoutMajorAxis): Correctly layout the spans.
+ (columnWidths): New field. Stores the width attributes of
+ the columns.
+ (calculateColumnRequirements): Added support for relative
+ (== percent) width attributes.
+ (calculateMajorAxisRequirements): Removed.
+ (calculateMinorAxisRequirements): Removed unnecessary code.
+ (getMaximumSpan): Overridden to restrict the table's width.
+ (layoutColumns): Documented. Implement more clever table layout,
+ i.e. for relative columns etc.
+ (layoutMinorAxis): Don't mark rows invalid.
+ (updateGrid): Added docs. Initialize column widths.
+
+2006-11-09 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/awt/peer/headless/HeadlessGraphicsEnvironment,
+ * gnu/java/awt/peer/headless/HeadlessToolkit: New classes.
+ Implement basic headless toolkit.
+ * java/awt/Toolkit.java
+ (getDefaultToolkit): Check headless property and create
+ headless toolkit when true.
+
+2006-11-09 Ingo Proetel <proetel@aicas.com>
+2006-11-09 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/awt/peer/swing/SwingButtonPeer.java
+ (SwingButton.button): New field.
+ (SwingButton.SwingButton): Added constructor.
+ (SwingButton.isShowing): Access button field instead of
+ the surrounding class.
+ (SwingButton.getParent): Access button field instead of
+ the surrounding class.
+ (SwingButtonPeer): Call new SwingButton constructor.
+ * gnu/java/awt/peer/swing/SwingComponent.java:
+ Several documentation updates.
+ * gnu/java/awt/peer/swing/SwingComponentPeer.java
+ (currentPaintEvents): New field.
+ (peerFont): New field.
+ (SwingComponentPeer): Initialize currentPaintEvents fields.
+ (coalescePaintEvents): Implemented.
+ (dispose): Unregister peer from heavyweight list of its container.
+ (getGraphics): Fetch graphics from parent component.
+ (handleEvent): Discard paint event if its coalesced.
+ (init): Register component with its container for proper painting.
+ (paint): Call peerPaint().
+ (peerPaint): Added argument that indicates if we should update.
+ Call paint or update on the actual AWT component.
+ (peerPaintComponent): New method. Paints the peer (Swing) component.
+ (setFont): Set peerFont field.
+ * gnu/java/awt/peer/swing/SwingContainerPeer.java
+ (backbuffer): New field.
+ (focusOwner): New field.
+ (heavyweightDescendents): New field.
+ (SwingContainerPeer): Take Container as argument. Don't call init
+ yet.
+ (addHeavyweightDescendent): New method.
+ (getFocusOwner): New helper method.
+ (getInsets): Delegate to insets().
+ (handleKeyEvent): Dispatch event to focus owner.
+ (handleMouseEvent): Dispatch to child component.
+ (isDoubleBuffering): New helper method.
+ (peerPaint): Overridden to implement container painting with
+ double buffering.
+ (peerPaintChildren): New method. Paints the descendents of this
+ container.
+ (removeHeavyweightDescendent): New helper method.
+ * gnu/java/awt/peer/swing/SwingFramePeer.java
+ (peerPaint): Removed.
+ (peerPaintComponent): Overridden to paint the menu bar.
+ * gnu/java/awt/peer/swing/SwingLabelPeer.java
+ (SwingLabel.label): New field.
+ (SwingLabel.SwingLabel): Added constructor with Label argument.
+ (SwingLabel.getGraphics): Implemented to fetch the graphics from
+ the actual AWT component.
+ (SwingLabel.getParent): Implemented to fetch the parent from
+ the AWT component.
+ (SwingLabel.isShowing): Access the label field.
+ (SwingLabelPeer): Set alignment from label.
+ * gnu/java/awt/peer/swing/SwingListPeer.java: New class.
+ * gnu/java/awt/peer/swing/SwingMenuBarPeer.java: Documentation
+ fixlet.
+ * gnu/java/awt/peer/swing/SwingPanelPeer.java:
+ Don't be a lighweight peer.
+ (SwingPanelPeer): Call init.
+ * gnu/java/awt/peer/swing/SwingTextAreaPeer.java: New class.
+ * gnu/java/awt/peer/swing/SwingTextFieldPeer.java
+ (SwingTextField.textField): New field.
+ (SwingTextField.SwingTextField): New constructor.
+ (SwingTextField.isShowing): Access field not enclosing class.
+ (SwingTextField.getGraphics): New method.
+ (SwingTextField.getParent): New method.
+ (SwingTextFieldPeer): Call new constructor.
+ (select): Renamed arguments.
+ * gnu/java/awt/peer/swing/SwingWindowPeer.java
+ (SwingWindowPeer): Call init.
+
+2006-11-09 Tania Bento <tbento@redhat.com>
+
+ * javax/swing/JLabel.java
+ (JLabel(Icon)): Changed documentation; Changed text to null.
+ (JLabel(Icon,int)): Likewise.
+ (JLabel(text)): Changed documenation.
+ (JLabel(text,int)): Likewise.
+ (JLabel(text,Icon,int)): Changed documentation; Throw
+ IllegalArgumentException if int is not one of LEFT, RIGHT,
+ CENTER, LEADING or TRAILING.
+
+2006-11-09 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/beans/beancontext/BeanContextSupport.java
+ (BeanContextSupport): Use correct dtime default,
+ (BeanContextSupport(BeanContext)): Likewise,
+ (BeanContextSupport(BeanContext, Locale)): Likewise, plus renamed
+ locale argument,
+ (BeanContextSupport(BeanContext, Locale, boolean)): Likewise,
+ (BeanContextSupport(BeanContext, Locale, boolean, boolean)): Likewise.
+
+2006-11-09 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/beans/beancontext/BeanContextSupport.java
+ (getBeanContextPeer): Implemented.
+
+2006-11-09 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/BlockView.java
+ (cssHeight): Removed.
+ (cssWidth): Removed.
+ (cssSpans): New field. Replaces the two fields above.
+ (BlockView): Allocate cssSpans array.
+ (layoutMinorAxis): Fetch and use child span, not this view's span.
+ (setCSSSpan): Adjusted to use cssSpans array.
+ (setPropertiesFromAttributes): Adjusted to use cssSpans array.
+
+2006-11-09 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/InlineView.java
+ (nowrap): New field.
+ (getBreakWeight): Add support for nowrap.
+ (setPropertiesFromAttributes): Fetch the nowrap setting.
+
+2006-11-09 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/css/CSSParser.java
+ (parseRuleset): Use new Selector class.
+ (parseValue): Parse multiple anys, not only one.
+ (main): Allow stylesheet be specified on the command line.
+ Use new Selector class.
+ * gnu/javax/swing/text/html/css/CSSParserCallback.java
+ (startStatement): Use Selector class.
+ * gnu/javax/swing/text/html/css/CSSScanner.java
+ (readName): Actually read a character in the loop to avoid
+ endless loop.
+ * gnu/javax/swing/text/html/css/Length.java
+ (getValue): Only multiply when we have a percentage value.
+ * gnu/javax/swing/text/html/css/Selector.java:
+ New class. Provides handling of CSS selectors.
+ * javax/swing/text/html/StyleSheet.java
+ (CSSStyle.PREC_AUTHOR_IMPORTANT): New constant field.
+ (CSSStyle.PREC_AUTHOR_NORMAL): New constant field.
+ (CSSStyle.PREC_NORM): New constant field.
+ (CSSStyle.PREC_UA): New constant field.
+ (CSSStyle.PREC_USER_IMPORTANT): New constant field.
+ (CSSStyle.precedence): New field.
+ (CSSStyle.priority): Removed.
+ (CSSStyle.selector): New field.
+ (CSSStyle.CSSStyle(int,Selector)): Initialize with Selector
+ and precendence.
+ (CSSStyle.compareTo): Adjusted to use the precedence and
+ specificity of the selector.
+ (CSSStyleSheetParserCallback.precedence): New field.
+ (CSSStyleSheetParserCallback.selector): Removed.
+ (CSSStyleSheetParserCallback.style): New field.
+ (CSSStyleSheetParserCallback.CSSStyleSheetParserCallback):
+ Initialize with precedence.
+ (CSSStyleSheetParserCallback.declaration): Don't look up
+ existing rule, simply create new one.
+ (CSSStyleSheetParserCallback.endStatement): Append style
+ to stylesheet.
+ (CSSStyleSheetParserCallback.startStatement): Use new Selector
+ class.
+ (css): Changed to be ArrayList.
+ (addRule): Create parser with author-normal precendence.
+ (getRule): Fixed implementation.
+ (loadRules): Create parser with UA precendence.
+ (resolveStyle): Use Selector class for resolving and matching
+ stylesheet rules.
+ (translateHTMLToCSS): Added mappings for a couple of HTML
+ attributes.
+
+2006-11-09 David Gilbert <david.gilbert@object-refinery.com>
+
+ Fixes bug #29770
+ * java/beans/SimpleBeanInfo.java
+ (loadImage): Check for nulls.
+
+2006-11-09 Robert Schuster <robertschuster@fsfe.org>
+
+ * native/jni/java-nio/gnu_java_nio_VMChannel.c:
+ (getpeername): Added 16 byte offset to memcpy operation.
+
+2006-11-09 Robert Schuster <robertschuster@fsfe.org>
+
+ * native/jni/java-nio/gnu_java_nio_VMChannel.c:
+ (getsockname): Added 16 byte offset to memcpy operation.
+
+2006-11-08 Mark Wielaard <mark@klomp.org>
+
+ Fixes bug #29754
+ * java/io/OutputStreamWriter.java
+ (OutputStreamWriter(OutputStream,Charset)): Set encodingName.
+ (OutputStreamWriter(OutputStream,CharsetEncoder)): Likewise.
+
+2006-11-08 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/HTMLEditorKit.java
+ (getParser): Use plain HTML_401F DTD.
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.print): Removed method and all calls to it.
+ (HTMLReader.printBuffer): Removed method and all calls to it.
+ (HTMLReader.inImpliedParagraph): New field.
+ (HTMLReader.inParagraph): New field.
+ (HTMLReader.addContent): Create implied p-tag if necessary.
+ (HTMLReader.addSpecialElement): Create implied p-tag if necessary.
+ (HTMLReader.blockClose): Close implied p-tag if necessary.
+ (HTMLReader.blockOpen): Close implied p-tag if necessary.
+ * gnu/javax/swing/text/html/parser/HTML_401Swing.java: Removed.
+
+2006-11-08 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/HTMLEditorKit.java
+ (HTMLFactory.create): Removed mapping for TD tag. This
+ is done in TableView.
+ * javax/swing/text/html/TableView.java:
+ Implemented from scratch.
+
+2006-11-07 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/parser/support/Parser.java
+ (_handleText): Check if text content is actually allowed before
+ passing empty text fragments on to the parser callbacks.
+
+2006-11-07 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/net/protocol/jar/Handler.java (parseURL): Flatten jar
+ path.
+ (flat): New method.
+
+2006-11-07 Tania Bento <tbento@redhat.com>
+
+ * java/awt/FlowLayout.java
+ (getSize): If parent does not have a component, then a
+ different formula is used to calcuate the width.
+
+2006-11-07 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/HTMLEditorKit.java
+ (HTMLFactory.create): Include ListView.
+ * javax/swing/text/html/ListView.java
+ (paint): Removed comment.
+ * javax/swing/text/html/StyleSheet.java
+ (CSSStyle.priority): New field.
+ (CSSStyle.CSSStyle(int)): New constructor with priority.
+ (CSSStyle.compareTo): New method. Used for sorting the styles.
+ (CSSStyleSheetParserCallback.declaration): Store the style
+ with the complete selector.
+ (ListPainter.attributes): Renamed as field.
+ (ListPainter.styleSheet): New field.
+ (ListPainter.type): New field.
+ (ListPainter.ListPainter): Pass StyleSheet to constructor.
+ (ListPainter.paint): Provide simplistic implementation.
+ (getListPainter): Pass StyleSheet to constructor.
+ (resolveStyle): Fixed CSS style resolving.
+
+2006-11-07 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/css/BorderWidth.java:
+ New class. Handles CSS border width values.
+ * gnu/javax/swing/text/html/css/Length.java
+ (floatValue): Made protected so that BorderWidth can access it.
+ * javax/swing/text/html/CSS.java
+ (Attribute.BORDER_BOTTOM_COLOR): New static field.
+ (Attribute.BORDER_BOTTOM_STYLE): New static field.
+ (Attribute.BORDER_LEFT_COLOR): New static field.
+ (Attribute.BORDER_LEFT_STYLE): New static field.
+ (Attribute.BORDER_RIGHT_COLOR): New static field.
+ (Attribute.BORDER_RIGHT_STYLE): New static field.
+ (Attribute.BORDER_TOP_COLOR): New static field.
+ (Attribute.BORDER_TOP_STYLE): New static field.
+ (getValue): Added some mappings for the border color and
+ border width values.
+ * javax/swing/text/html/CSSBorder.java: New class. Implements
+ CSS borders.
+ * javax/swing/text/html/StyleSheet.java
+ (BoxPainter.background): New field.
+ (BoxPainter.border): New field.
+ (BoxPainter.bottomInset): Documented.
+ (BoxPainter.leftInset): Documented.
+ (BoxPainter.rightInset): Documented.
+ (BoxPainter.topInset): Documented.
+ (BoxPainter.BoxPainter): Added support for borders and background.
+ (BoxPainter.getInset): Add border insets.
+ (BoxPainter.paint): Implemented. Paints the background and the
+ CSS border.
+ (addRule): Be less picky about parse and IO exceptions.
+ (getBoxPainter): Adjust to new BoxPainter constructor.
+
+2006-11-07 Andreas <a.tobler@schweiz.org>
+
+ * examples/Makefile.am: Add rule to install the *.html files we use
+ in the Swing Demo.
+
+2006-11-06 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/ComponentGraphics.java
+ (fillRect): Handle custom composites.
+ (drawRenderedImage): Handle custom composites.
+ (drawImage): Handle custom composites.
+ (createBuffer): New method.
+ (drawLine): Handle custom composites.
+ (drawComposite): New method.
+ (fill): Handle custom composites.
+ (getNativeCM): New method.
+ (drawGlyphVector): Handle custom composites.
+ (drawRect): Handle custom composites.
+ (draw): Handle custom composites.
+ * gnu/java/awt/peer/gtk/VolatileImageGraphics.java
+ (drawComposite): Unset composite during draw call, to prevent parent
+ from handling composite again.
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (getBufferCM): Added comments.
+ (getNativeCM): Made abstract.
+ (setComposite): Removed comments.
+
+2006-11-06 Roman Kennke <kennke@aicas.com>
+
+ * examples/gnu/classpath/examples/swing/HtmlDemo.java:
+ Fixed initial window size and start document.
+
+2006-11-06 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.addSpecialElement): Removed comment about
+ htmlAttributeSet.
+ (HTMLReader.handleComment): Create SimpleAttributeSet instead
+ of htmlAttributeSet.
+ * javax/swing/text/html/parser/DocumentParser.java
+ (gnuParser.handleStartTag): Use SimpleAttributeSet instead
+ of htmlAttributeSet.
+ * javax/swing/text/html/parser/ParserDelegator.java
+ (gnuParser.handleStartTag): Use SimpleAttributeSet instead
+ of htmlAttributeSet.
+ * gnu/javax/swing/text/html/parser/GnuParserDelegator.java
+ (gnuParser.handleStartTag): Use SimpleAttributeSet instead
+ of htmlAttributeSet.
+ * gnu/javax/swing/text/html/parser/support/Parser.java
+ (getAttributes): Return a SimpleAttributeSet.
+ (restOfTag): Don't set resolving parent here.
+
+2006-11-06 Tania Bento <tbento@redhat.com>
+
+ * java/awt/TextComponent.java
+ (setSelectionStart): Added check.
+
+2006-11-06 Tania Bento <tbento@redhat.com>
+
+ * java/awt/TextField.java
+ (minimumSize(int)): Check if minimum size has been previously
+ set and changed values of Dimension returned if peer == null.
+ (preferredSize(int)): Check if preferred size has been previously
+ set and changed values of Dimension returned if peer == null.
+
+2006-11-06 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JTree.java
+ (TreeModelHandler.treeNodesRemoved): Implemented.
+ (TreeModelHandler.treeStructureChanged): Implemented.
+ (nodeStates): Made package private.
+
+2006-11-06 Francis Kung <fkung@redhat.com>
+
+ PR 29420
+ * javax/swing/JTree.java
+ (clearSelectionPathStates): New private method to clean up nodeStates.
+ (removeSelectionPath): Call clearSelectionPathStates().
+ (removeSelectionPaths): Call clearSelectionPathStates().
+ (removeSelectionRow): Call clearSelectionPathStates().
+ (setSelectionPath): Call clearSelectionPathStates().
+ (setSelectionPaths): Call clearSelectionPathStates().
+ (setSelectionRow): Call clearSelectionPathStates().
+
+2006-11-06 Ito Kazumitsu <kaz@maczuka.gcd.org>
+
+ Fixes bug #29703
+ * java/util/regex/Matcher.java(reset): Reset inputCharIndexed.
+
+2006-11-06 Roman Kennke <kennke@aicas.com>
+
+ * examples/gnu/classpath/examples/swing/HtmlDemo.java:
+ Changed to implement a minimalistic browser.
+ * examples/gnu/classpath/examples/swing/forms.html,
+ * examples/gnu/classpath/examples/swing/textstyles.html,
+ * examples/gnu/classpath/examples/swing/welcome.html:
+ Some example content.
+
+2006-11-06 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/ComponentView.java
+ (setParent): Lock the document and repaint the hosting
+ container.
+ * javax/swing/text/FlowView.java
+ (FlowStrategy.createView): Removed comment.
+ (FlowView): Initialize span with Short.MAX_VALUE.
+ (getFlowStart): Return 0 unconditionally.
+ (layout): Moved code around to make it more readable.
+ (loadChildren): Always set the parent.
+ * javax/swing/text/GlyphView.java
+ (DefaultGlyphPainter.fontMetrics): New field.
+ (DefaultGlyphPainter.getAscent): Use new helper method to
+ synchronize the font metrics.
+ (DefaultGlyphPainter.getBoundedPosition): Use new helper method
+ to synchronize the font metrics.
+ (DefaultGlyphPainter.getDescent): Use new helper method to
+ synchronize the font metrics.
+ (DefaultGlyphPainter.getHeight): Use new helper method to
+ synchronize the font metrics.
+ (DefaultGlyphPainter.getSpan): Use new helper method to
+ synchronize the font metrics.
+ (DefaultGlyphPainter.modelToView): Use new helper method to
+ synchronize the font metrics.
+ (DefaultGlyphPainter.updateFontMetrics): New helper method for
+ font metrics caching.
+ (DefaultGlyphPainter.viewToModel): Use new helper method to
+ synchronize the font metrics. Fixed view to model mapping.
+ * javax/swing/text/View.java
+ (removeAll): Pass null to replace().
+ (setParent): Only reparent children that have this view as parent.
+
+2006-11-05 Mark Wielaard <mark@klomp.org>
+
+ * include/gnu_java_net_VMPlainDatagramSocketImpl.h: Removed.
+ * include/gnu_java_nio_channels_FileChannelImpl.h: Removed.
+ * native/jni/java-net/gnu_java_net_VMPlainDatagramSocketImpl.c:
+ Removed.
+ * native/jni/java-nio/gnu_java_nio_channels_FileChannelImpl.c:
+ Removed.
+ * native/jni/java-nio/Makefile.am (libjavanio_la_SOURCES):
+ Remove gnu_java_nio_channels_FileChannelImpl.c.
+
+2006-11-03 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/BlockView.java
+ (attributes): New field.
+ (cssHeight): New field.
+ (cssWidth): New field.
+ (painter): New field.
+ (calculateMajorAxisRequirements): Overridden to account for
+ CSS settings.
+ (calculateMinorAxisRequirements): Overridden to account for
+ CSS settings.
+ (layoutMinorAxis): Overridden to account for CSS settings.
+ (changedUpdate): Formatting fixlet.
+ (constrainSize): New helper method.
+ (getAlignment): Fix alignment.
+ (getAttributes): Cache attributes for better performance.
+ (getStyleSheet): Fetch stylesheet from document rather than creating
+ a new one.
+ (paint): Remove comment.
+ (setCSSSpan): New helper method.
+ (setPropertiesFromAttributes): Implemented to fetch the
+ recognized properties.
+ * javax/swing/text/html/CSS.java
+ (getValue): Added mapping for width and height attributes.
+ * javax/swing/text/html/InlineView.java
+ (longestWord): New field.
+ (getLongestWord): New helper method.
+ (calculateLongestWord): New helper method.
+ (getMinimumSpan): Overridden to constrain the minimum span by the
+ longest word.
+ * javax/swing/text/html/ParagraphView.java
+ (cssHeight): New field.
+ (cssWidth): New field.
+ (calculateMinorAxisRequirements): Overridden to account for
+ CSS settings.
+ (setCSSSpan): New helper method.
+ (setPropertiesFromAttributes): Fetch CSS width and height. Added
+ null check.
+ * gnu/javax/swing/text/html/css/Length.java
+ (percentage): New field.
+ (Length): Determine percentage values.
+ (getValue(float)): New method for handling percentage values.
+ (isPercentage): New method.
+
+2006-11-03 Tania Bento <tbento@redhat.com>
+
+ * java/awt/TextArea.java
+ (getMinimumSize): Changed documentation.
+ (getPreferredSize): Changed documentation.
+ (getMinimumSize(int,int)): Changed documenation.
+ (getPreferredSize(int,int)): Changed documenation.
+ (minimumSize): Changed documentation.
+ (preferredSize): Changed documenation.
+ (minimumSize(int,int)): Changed documentation. Checked if
+ minimum size had been previously set and changed values of
+ Dimension returned if peer == null.
+ (preferredSize(int, int)): Checked if preferred size had been
+ previously set and changed values of Dimension returned if
+ peer = null.
+
+2006-11-03 Tania Bento <tbento@redhat.com>
+
+ * java/awt/event/ComponentEvent.java
+ (paramString): Changed format of string representation returned.
+
+2006-11-03 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.FormAction.start): Added support for textarea.
+ (HTMLReader.FormAction.end): Added support for textarea.
+ (HTMLReader.HeadAction.end): Call super to actually close the
+ block.
+ (HTMLReader.inTextArea): New field.
+ (HTMLReader.textAreaDocument): New field.
+ (HTMLReader.handleText): Call textAreaContent when inside
+ a textarea tag.
+ (HTMLReader.textAreaContent): Implemented to initialize
+ the text area's model.
+ * javax/swing/text/html/FormView.java
+ (createComponent): Added support for textarea tag.
+
+2006-11-03 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.IsindexAction.start): Implemented.
+
+2006-11-03 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/StyleSheet.java
+ (addRule): Implemented.
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.inStyleTag): New field.
+ (HTMLReader.styles): New field.
+ (HTMLReader.HeadAction.end): Implemented to read all stylesheets,
+ if any.
+ (HTMLReader.StyleAction.start): Set inStyleTag flag.
+ (HTMLReader.StyleAction.end): Set inStyleTag flag.
+ (HTMLReader.handleText): When inside a style tag, add
+ content to the styles array.
+
+2006-11-02 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/FormView.java
+ (maxIsPreferred): New field.
+ (createComponent): Initialize components correctly.
+ (getMaximumSpan): Return the preferred span for components
+ that need this. The maxIsPreferred flag is set accordingly
+ in createComponent.
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.FormAction.start): Implemented to set the
+ correct model as attribute.
+ (HTMLReader.FormAction.setModel): New helper method.
+ (HTMLReader.FormAction.end): Call super to finish the element.
+ Added TODO about things left to do.
+ (HTMLReader.handleComment): Use SimpleAttributeSet rather
+ than htmlAttributeSet.
+ * javax/swing/text/html/HTMLEditorKit.java
+ (HTMLFactory.create): Create BlockView for FORM tags.
+ Create FormView for INPUT, TEXTAREA and SELECT tags.
+
+2006-11-02 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/awt/geom/GeneralPath.java: API doc fixes.
+
+2006-11-02 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/ImageView.java
+ (getImageURL): Fetch attribute from element. Consider the
+ base URL for relative image locations.
+
+2006-11-02 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JEditorPane.java
+ (setContentType): Strip off attributes.
+ * javax/swing/text/html/HTMLEditorKit.java
+ (LinkController.activateLink(int,JEditorPane,int,int): New
+ method. Implements activation of a hyperlink.
+ (LinkController.activateLinke(int,JEditorPane)): Delegate
+ to the other activateLink() method.
+ (LinkController.createHyperlinkEvent): New helper method.
+ (LinkController.mouseClicked): Implemented to activate the link.
+ (LinkController.mouseDragged): Added comment that this
+ method does nothing.
+ (LinkController.mouseMoved): Update cursor for hyperlinks.
+ (mouseHandler): Renamed field to linkController.
+ (HTMLEditorKit): Create a link controller.
+ (clone): Give the clone a new link controller.
+ (deinstall): De-install link controller as mouseMotionListener too.
+ (install): Install link controller as mouseMotionListener too.
+
+2006-11-02 Roman Kennke <kennke@aicas.com>
+
+ PR 29644
+ * javax/swing/text/FlowView.java
+ (FlowStrategy.changedUpdate): Reversed condition. This caused
+ wrong layout and bad performance.
+ (FlowStrategy.insertUpdate): Reversed condition. This caused
+ wrong layout and bad performance.
+ (FlowStrategy.removeUpdate): Reversed condition. This caused
+ wrong layout and bad performance.
+ (LogicalView): Changed to be a subclass of CompositeView.
+ (LogicalView()): Only take one Element argument.
+ (LogicalView.childAllocation): New method for implementing
+ the abstract CompositeView method.
+ (LogicalView.forwardUpdateToView): Overridden for correct
+ reparenting.
+ (getMinimumSpan): Overridden to handle line breaking correctly.
+ (getPreferredSpan): Implemented to handle line breaking correctly.
+ (getViewAtPoint): New method for implementing
+ the abstract CompositeView method.
+ (getViewIndexAtPosition): Overridden to handle leaf elements
+ correctly.
+ (isAfter): New method for implementing
+ the abstract CompositeView method.
+ (isBefore): New method for implementing
+ the abstract CompositeView method.
+ (loadChildren): Overridden to handle leaf elements
+ correctly.
+ (paint): New method for implementing
+ the abstract CompositeView method.
+ (calculateMinorAxisRequirements): Use preferredSpan in calculation.
+ (loadChildren): Initialize flow layout by sending a synthetic
+ insertUpdate() to the layout strategy.
+ * javax/swing/text/GlyphView.java
+ (DefaultGlyphPainter.getBoundedPosition): Fall back to Toolkit's
+ font metrics if component is not available. Add initial offset
+ to result.
+ (breakView): Be more clever when breaking the view.
+ (getBreakLocation): New helper method to determine a good
+ break location.
+ (getBreakWeight): Be more clever when breaking the view.
+ (getTabbedSpan): Make sure we have a painter. Use view's
+ start and end offset rather than the element's.
+ * javax/swing/text/Utilities.java
+ (drawTabbedText): Avoid useless add and sub with the y offset.
+
+2006-11-02 Roman Kennke <kennke@aicas.com>
+
+ PR 29644
+ * gnu/java/awt/peer/ClasspathFontPeer.java
+ (getStringBounds): Removed abstract method. This is replaced
+ in java.awt.Font to use a TextLayout.
+ * gnu/java/awt/peer/gtk/GtkWindowPeer.java
+ (GtkWindowPeer): Set a font on the window object.
+ * gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
+ (FreetypeGlyphVector(Font,String,FontRenderContext,int)):
+ Changed to take char,int,int instead of String. Filter
+ control characters.
+ (FreetypeGlyphVector(Font,String,FontRenderContext)):
+ Create char array out of string.
+ (getLogicalBounds): Don't translate bounds. They already are
+ translated.
+ * gnu/java/awt/peer/gtk/GdkFontMetrics.java
+ (stringWidth): Filter out control characters.
+ * gnu/java/awt/peer/gtk/GdkFontPeer.java
+ (getStringBounds): Removed unneeded method.
+ (layoutGlyphVector): Pass char array directly to FreetypeGlyphVector
+ constructor.
+ * gnu/java/awt/peer/qt/QtFontPeer.java
+ (getStringBounds): Removed unneeded method.
+ * gnu/java/awt/peer/x/XFontPeer.java
+ (getStringBounds): Removed unneeded method.
+ * gnu/java/awt/peer/x/XFontPeer2.java
+ (getStringBounds): Removed unneeded method.
+ * java/awt/Font.java
+ (getStringBounds(char[],int,int,FontRenderContext)):
+ Use TextLayout to determine the bounds.
+ (getStringBounds(CharacterIterator,int,int,FontRenderContext)):
+ Delegate to the char[] version of this method.
+ (getStringBounds(String,FontRenderContext)):
+ Delegate to the char[] version of this method.
+ (getStringBounds(String,int,int,FontRenderContext)):
+ Delegate to the String version of this method.
+
+2006-11-01 Tania Bento <tbento@redhat.com>
+
+ * java/awt/ScrollPaneAdjustable.java
+ (paramString): Changed format of string representation returned.
+ (paramStringHelper): New private method.
+
+2006-11-01 Tania Bento <tbento@redhat.com>
+
+ * java/awt/GridBagLayout.java
+ (toString): Implemented method.
+
+2006-10-30 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * native/plugin/gcjwebplugin.cc (GCJ_New): Move GLib threading
+ initialization to NP_Initialize.
+ (NP_Initialize): Initialize GLib threading.
+
+2006-10-31 Tania Bento <tbento@redhat.com>
+
+ * javax/swing/JTextField.java
+ (fireActionPerformed): When creating the new event, if
+ actionCommand == null, then getText() is used.
+
+2006-10-31 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (fillArc): Corrected arc type to Arc2D.PIE.
+
+2006-10-31 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.PreAction.end): Implemented.
+ (HTMLReader.PreAction.start): Implemented.
+ (HTMLReader.inPreTag): New field.
+ (HTMLReader.handleTag): When inside a pre tag, call preContent().
+ (HTMLReader.preContent): Implemented.
+
+2006-10-31 Tania Bento <tbento@redhat.com>
+
+ * javax/swing/JTextField.java
+ (fireActionPerformed): When creating the new event,
+ actionCommand should be used as the command, not
+ getText().
+
+2006-10-31 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/HTMLEditorKit.java
+ (write): Use HTMLWriter or MinimalHTMLWriter for writing
+ HTML or Styled documents.
+
+2006-10-31 David Fu <fchoong@netbeans.jp>
+
+ * javax/swing/text/html/HTMLWriter.java: New class.
+
+2006-10-30 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/dnd/DragSourceContext.java
+ (dragExit): Use constant fields instead of 0.
+ (updateCurrentCursor): Completed implementation.
+
+2006-10-30 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/dnd/DragGestureRecognizer.java
+ (resetRecognizer): Added API docs. Do not replace the events object
+ but rather clear() it. Removed not implemented tag.
+
+2006-10-30 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/datatransfer/DataFlavor.java
+ (writeExternal): Remove not implemented tag.
+
+2006-10-30 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/datatransfer/DataFlavor.java
+ (javaFileListFlavor): Don't explicitly specify class.
+ (plainTextFlavor): Don't explicitly specify class.
+ (mimeType): Changed to type MimeType. Remove final.
+ (representationClass): Remove final.
+ (DataFlavor): Don't do anything here.
+ (DataFlavor(Class,String,String)): Removed.
+ (DataFlavor(Class,String)): Initialize here.
+ (DataFlavor(String,String,ClassLoader)): Initialize in init().
+ (DataFlavor(String,String)): Initialize in init().
+ (DataFlavor(String)): Initialize in init().
+ (init): New initialization method.
+ (getMimeType): Delegate to MimeType.toString().
+ (getParameter(String,String)): Removed. Is now done in MimeType.
+ (getParameter(String)): Delegate to MimeType.
+ (getPrimaryType): Delegate to MimeType.
+ (getRepresentationClassFromMime): Removed.
+ (getRepresentationClassFromMimeThrows): Removed.
+ (getSubType): Delegate to MimeType.
+ (hashCode): Take MimeType.toString() for the hashCode.
+ (isFlavorRemoveObjectType): Return true only when representation
+ class is remove and serializable and the mime type is remote.
+ (isFlavorSerializedObjectType): Return true only when representation
+ class is serializable and the mime type is serialized.
+ (isMimeTypeEqual): Rewritten to delegate to MimeType.matches().
+ (isMimeTypeSerializedObject): Delegate to isMimeTypeEqual().
+ (readExternal): Implemented stub method.
+ (writeExternal): Implemented stub method.
+ * java/awt/datatransfer/MimeType.java: New helper class.
+
+2006-10-28 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/TransferHandler.java
+ (importData): Implemented stub method. Added API docs.
+
+2006-10-26 Christian Elias Naur <elias@oddlabs.com>
+
+ * native/jni/gtk-peer/gtk_jawt.c (classpath_jawt_get_depth): New
+ function.
+ * native/jni/classpath/classpath_jawt.h: Likewise.
+ * native/jawt/jawt.c (_Jv_GetDrawingSurfaceInfo): Added
+ initializer for surface_info_x11->depth.
+
+2006-10-26 Tania Bento <tbento@redhat.com>
+
+ * java/awt/FileDialog.java:
+ (setFile): Changed if-clause condition.
+
+2006-10-25 Francis Kung <fkung@redhat.com>
+
+ * include/gnu_java_nio_VMChannel.h,
+ * include/java_net_VMNetworkInterface.h,
+ * include/gnu_java_nio_EpollSelectorImpl.h,
+ * include/gnu_java_awt_peer_gtk_CairoGraphics2D.h,
+ * include/gnu_java_nio_FileChannelImpl.h,
+ * include/gnu_java_nio_KqueueSelectorImpl.h,
+ * include/gnu_java_nio_VMPipe.h,
+ * include/gnu_java_net_VMPlainSocketImpl.h: Regenerated.
+
+2006-10-25 Tania Bento <tbento@redhat.com>
+
+ * java/awt/Dialog.java: Created new private variable
+ next_dialog_number.
+ (Dialog(Frame, String, boolean, GraphicsConfiguration)):
+ Set cursor to default cursor.
+ (Dialog(Dialog, STring, boolean, GraphicsConfiguration)):
+ Same.
+ (generateName): New method.
+ (getUniqueLong): New private method.
+ * java/awt/FileDialog.java: Created new private variable
+ next_file_dialog_number.
+ (setFile): If file == "", set it to null.
+ (generateName): New method.
+ (getUniqueLong): New private method.
+
+2006-10-25 Robert Schuster <robertschuster@fsfe.org>
+
+ * java/net/MulticastSocket.java:
+ (setNetworkInterface): Rewritten.
+
+2006-10-25 Robert Schuster <robertschuster@fsfe.org>
+
+ * native/jni/java-net/javanet.h: Added declaration for
+ _javanet_create_inetaddress.
+ * native/jni/java-net/javanet.c:
+ (_javanet_create_inetaddress): Removed static keyword.
+
+2006-10-25 Robert Schuster <robertschuster@fsfe.org>
+
+ * gnu/java/net/PlainDatagramSocketImpl.java:
+ (connect): Use VMChannel instance for connect call.
+ (getTimeToLive): Call VMPlainSocketImpl.getTimeToLive.
+ (setTimeToLive): Call VMPlainSocketImpl.setTimeToLive.
+ (setOption): Handle multicast options.
+ (getOption): Handle multicast options.
+ * gnu/java/net/PlainSocketImpl.java:
+ (getTimeToLive): Call VMPlainSocketImpl.getTimeToLive.
+ (setTimeToLive): Call VMPlainSocketImpl.setTimeToLive.
+ (setOption): Filter unappropriate options.
+ (getOption): Filter unappropriate options.
+ (connect): Use given SocketAddress.
+ (close): Reset address and port.
+ (getInetAddress):
+ * include/Makefile.am: Removed all occurences of
+ gnu_java_net_VMPlainDatagramSocketImpl.h.
+ * include/gnu_java_net_VMPlainDatagramSocketImpl.h: Removed.
+ * native/jni/java-net/Makefile.am: Removed
+ gnu_java_net_VMPlainDatagramSocketImpl.c from sources.
+ * native/jni/java-net/gnu_java_net_VMPlainDatagramSocketImpl.c:
+ Removed.
+ as SocketException, declare to throw SocketException.
+ * native/jni/java-nio/gnu_java_nio_VMChannel.c: Added definitions
+ for SocketException and ConnectException.
+ (Java_gnu_java_nio_VMChannel_connect): Throw SocketException instead
+ of IOException.
+ (Java_gnu_java_nio_VMChannel_connect6): Throw SocketException instead
+ of IOException.
+ (Java_gnu_java_nio_VMChannel_accept): Rewritten.
+ (JCL_thread_interrupted): New function.
+ (initIDs): Added initialisation for isThreadInterrupted method id.
+ * native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c: Added
+ CPNET_IP_TTL to java_sockopt enum.
+ (Java_gnu_java_net_VMPlainSocketImpl_setOption): Handle CPNET_IP_TTL
+ case, handle SO_LINGER case properly.
+ (Java_gnu_java_net_VMPlainSocketImpl_getOption): Handle CPNET_IP_TTL
+ case, handle SO_LINGER case properly.
+ (Java_gnu_java_net_VMPlainSocketImpl_getMulticastInterface): New
+ function.
+ (Java_gnu_java_net_VMPlainSocketImpl_setMulticastInterface): New
+ function.
+ (Java_gnu_java_net_VMPlainSocketImpl_setMulticastInterface6): New
+ function.
+ (Java_gnu_java_net_VMPlainSocketImpl_leave6): Fixed constant to be
+ IPV6_LEAVE_GROUP.
+ * vm/reference/gnu/java/net/VMPlainDatagramSocketImpl.java: Removed.
+ * vm/reference/gnu/java/nio/VMChannel.java:
+ (connect(int, byte[], int, int)): Declare to throw SocketException.
+ (connect6): Declare to throw SocketException.
+ (connect(InetSocketAddress, int)): Catch IOException and rethrow
+ (isThreadInterrupted): New method.
+ * vm/reference/gnu/java/net/VMPlainSocketImpl.java: Added CP_IP_TTL
+ field.
+ (setTimeToLive): New method.
+ (getTimeToLive): New method.
+ (setMulticastInterface(int, InetAddress)): New method.
+ (setMulticastInterface(int, int, Inet4Address): New method.
+ (setMulticastInterface6(int, int, Inet6Address): New method.
+ (setOptions): Handle SO_LINGER case.
+ (getOptions): Add missing SO_REUSEADDR case.
+ * java/net/Socket.java:
+ (Socket(InetAddress, int, InetAddress, int, boolean)): Close socket
+ when exception was thrown out of connect().
+ (setSoLinger): Replaced instantiations with valueOf calls, replaced
+ Boolean.FALSE with Integer.valueOf(-1).
+ * native/jni/native-lib/cpio.h: Added cpio_closeOnExec declaration.
+ * native/jni/native-lib/cpio.c: Added cpio_closeOnExec implementation.
+ * NEWS: Documented VM interface changes.
+
+2006-10-25 Robert Schuster <robertschuster@fsfe.org>
+
+ * java/net/Inet6Address.java:
+ (isMulticastAddress): Fixed check.
+
+2006-10-25 Robert Schuster <robertschuster@fsfe.org>
+
+ Fixes PR29576
+ * java/net/MulticastSocket.java:
+ (getNetworkInterface): Return a special NetworkInterface instance
+ if the socket's multicast interface is set to any.
+
+2006-10-25 Robert Schuster <robertschuster@fsfe.org>
+
+ Fixes PR29576
+ * java/net/NetworkInterface.java:
+ (createAnyInterface): New method.
+ (equals): Added if-statement to handle case where netif.name is null.
+ * vm/reference/java/net/VMNetworkInterface.java:
+ (hashCode): Rewritten.
+ (VMNetworkInterface): New constructor.
+
+2006-10-24 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * tools/Makefile.am: Add ASM_JAR define to each tool's CFLAGS.
+ * tools/toolwrapper.c (main): Set bootclasspath, not classpath.
+ Add ASM_JAR to bootclasspath.
+
+2006-10-24 Tania Bento <tbento@redhat.com>
+
+ * java/awt/Scrollbar.java:
+ (setLineIncrement): Removed unnecessary if-clause and if
+ lineIncrement == 0, then it should be set to 1, not 0.
+ (setPageIncrement): Removed unnecessary if-clause and if
+ pageIncrement == 0, then it should be set to 1, not 0.
+ (setValues): If visibleAmount <= 0, it should be set to 1, not 0.
+ If maximum <= minimum, maximum should be set to mininum + 1. The
+ actual value of maximum is maximum - visibleAmount, so I made
+ this change to the appropriate if-check. Remove the two unneccessary
+ if-clauses.
+
+2006-10-23 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (cairoSetFont): New method.
+ (copy): Set font using setFont method.
+ (setFont): Call cairoSetFont.
+ (setup): Set font using setFont method.
+ * include/gnu_java_awt_peer_gtk_CairoGraphics2D.h: Added method.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
+ (install_font_peer): Removed.
+ (cairoDrawGlyphVector): Removed call to install_font_peer.
+ (cairoSetFont): New method.
+
+2006-10-23 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/NativeEventLoopRunningEvent.java: New file.
+ * gnu/java/awt/peer/gtk/GtkMainThread.java: Post
+ NativeEventLoopRunningEvent after GTK main loop start and stop.
+ * java/awt/EventQueue.java (isShutdown): Check nativeLoopRunning.
+ (getNextEvent): Set dispatchThread to null.
+ (postEventImpl): Set nativeLoopRunning.
+ (pop): Interrupt event dispatch thread.
+ * java/awt/Frame.java (noteFrame): Synchronize on weakFrames.
+
+2006-10-22 Christian Thalinger <twisti@complang.tuwien.ac.at>
+
+ * native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c (config-int.h):
+ Added include.
+ * native/jni/java-nio/gnu_java_nio_VMChannel.c (config-int.h):
+ Likewise.
+
+2006-10-23 Marco Trudel <mtrudel@gmx.ch>
+
+ * gnu/javax/crypto/pad/PKCS7.java (unpad): Removed an unnecessary test.
+ * javax/crypto/CipherOutputStream.java: Re-implemented.
+ * gnu/javax/crypto/jce/cipher/CipherAdapter.java
+ (engineUpdate(byte[], int, int)): Always keep data for unpadding in padded
+ decryption mode and check if it is a complete block.
+ (engineUpdate(byte[], int, int, byte[], int)): Likewise.
+ (engineDoFinal(byte[], int, int)): In padded decryption mode, take
+ partially processed data into account.
+
+2006-10-21 Tom Tromey <tromey@redhat.com>
+
+ PR classpath/29086:
+ * java/util/AbstractCollection.java (toArray): Removed cast.
+
+2006-10-20 Tom Tromey <tromey@redhat.com>
+
+ * tools/gnu/classpath/tools/javah/JniIncludePrinter.java (printClass):
+ Don't use mangled class name for .h file.
+ * tools/gnu/classpath/tools/javah/JniStubPrinter.java (printClass):
+ Don't use mangled class name for .c file.
+ * tools/gnu/classpath/tools/javah/CniPrintStream.java (writeClass):
+ Handle classes from the default package.
+
+2006-10-20 Francis Kung <fkung@redhat.com>
+
+ * include/gnu_java_awt_peer_gtk_CairoGraphics2D.h: Added missing constants.
+
+2006-10-19 Francis Kung <fkung@redhat.com>
+
+ PR 29510
+ * java/awt/image/BufferedImage.java
+ (constructor): Updated some properties of default image types.
+ * gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+ (argb32): Updated field to match default in BufferedImage.
+
+2006-10-18 Roman Kennke <kennke@aicas.com>
+
+ PR 29419
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (copyArea): Changed size comparison to return when size == 0
+ too.
+ * javax/swing/JViewport.java
+ (paintBackingStore): Check width and height of blitted area
+ and only do blit if its > 0.
+ (paintBlit): Check width and height of blitted area
+ and only do blit if its > 0.
+
+2006-10-18 Roman Kennke <kennke@aicas.com>
+
+ PR 27091
+ * gnu/java/awt/peer/gtk/GtkFramePeer.java
+ (maximize): New native method.
+ (unmaximize): New native method.
+ (iconify): New native method.
+ (deiconify): New native method.
+ (getState): Implemented.
+ (setState): Implemented.
+ * gnu/java/awt/peer/gtk/GtkWindowPeer.java
+ (oldState): Rename to windowState and made protected, so that
+ the FramePeer can access it.
+ (postWindowEvent): Handle state change events more gently and
+ correctly.
+ * java/awt/Frame.java
+ (getState): Fetch state from getExtendedState().
+ (setExtendedState): Update the peer. Check if the state change
+ is actually supported.
+ (getExtendedState): Update the state from the peer.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
+ (maximize): New method.
+ (unmaximize): New method.
+ (iconify): New method.
+ (deiconify): New method.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
+ (AWT_FRAME_NORMAL): New macro.
+ (AWT_FRAME_ICONIFIED): New macro.
+ (AWT_FRAME_MAXIMIZED_BOTH): New macro.
+ (window_window_state_cb): Rewritten to handle window state changes
+ more gently (mostly on the java side of the world).
+ * include/gnu_java_awt_peer_gtk_GtkFramePeer.h: Regenerated.
+
+2006-10-18 Tania Bento <tbento@redhat.com>
+
+ * java/awt/CardLayout.java:
+ (maximumLayoutSize): Return a new Dimension with Integer.MAX_VALUE as
+ its height and width if Container passed as argument is null.
+ (gotoComponent): Consider the case where the component is not visible.
+
+2006-10-18 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * resource/gnu/classpath/tools/appletviewer/MessagesBundle.properties:
+ Rename file...
+ * resource/gnu/classpath/tools/appletviewer/messages.properties:
+ New file.
+ * resource/gnu/classpath/tools/appletviewer/MessagesBundle_de.properties:
+ Remove file.
+ * tools/gnu/classpath/tools/appletviewer/AppletWarning.java:
+ Remove file.
+ * tools/gnu/classpath/tools/appletviewer/ConsoleDialog.java:
+ Likewise.
+ * tools/gnu/classpath/tools/appletviewer/Messages.java: New file.
+ * tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java:
+ Retrieve user-visible strings through Messages.getString.
+ * tools/gnu/classpath/tools/appletviewer/Main.java: Likewise.
+ * tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java:
+ Likewise.
+ * tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java:
+ Likewise.
+ * tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java:
+ Likewise.
+ * tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java:
+ Likewise.
+ * tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java:
+ Likewise.
+ * tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java:
+ Likewise.
+
+2006-10-18 Roman Kennke <kennke@aicas.com>
+
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
+ (AWT_WINDOW_OPENED): Remove unnecessary macro.
+ (window_show_cb): Removed unnecessary function.
+ (connect_signals): Don't connect signal for show. *
+ gnu/java/awt/peer/gtk/GtkWindowPeer.java
+ (hasBeenShown): Removed. This is handled in java.awt.Window.
+ (postWindowEvent): Removed handling of WINDOW_OPENED. This is done
+ in java.awt.Window. * java/awt/Window.java
+ (dispose): Post WINDOW_CLOSED here, not WINDOW_OPENED.
+
+2006-10-18 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java
+ (drawRenderedImage): New method.
+ (drawImage): New method.
+ (CairoSurfaceGraphics): Set clip.
+ (createBuffer): New method.
+ (getBufferCM): New method.
+ (drawComposite): New method.
+ (fill): New method.
+ (getNativeCM): New method.
+ (drawGlyphVector): New method.
+ (draw): New method.
+ * gnu/java/awt/peer/gtk/VolatileImageGraphics.java
+ (getNativeCM): Reflect renamed field.
+ * gnu/java/awt/peer/gtk/CairoSurface.java
+ (cairoCM_pre): Renamed from cairoColorModel.
+ (cairoColorModel): Set premultiplication to false.
+
+2006-10-18 Roman Kennke <kennke@aicas.com>
+
+ PR 28769
+ * javax/swing/JScrollPane.java
+ (viewportBorder): Made field private.
+ (wheelScrollingEnabled): Made field private.
+ (JScrollPane): Enabled wheel scrolling by default.
+ * javax/swing/JTree.java
+ (TreeSelectionRedirector.valueChanged): Don't repaint anything
+ here.
+ (getScrollableUnitIncrement): Fixed thinko.
+ * javax/swing/plaf/basic/BasicScrollBarUI.java
+ (static scrollByBlock): New static method to avoid code duplication
+ for the BasicScrollPane wheel scrolling.
+ (static scrollByUnits): New static method to avoid code duplication
+ for the BasicScrollPane wheel scrolling.
+ (scrollByBlock): Delegate to static helper method.
+ (scrollByUnit): Delegate to static helper method.
+ * javax/swing/plaf/basic/BasicScrollPaneUI.java
+ (MouseWheelHandler.mouseWheelMoved): Delegate to BasicScrollBarUI
+ static helper methods to avoid code duplication.
+ (MouseWheelHandler.bounds): Removed.
+ (MouseWheelHandler.getValue): Removed.
+ (MouseWheelHandler.scroll): Removed.
+
+2006-10-18 Roman Kennke <kennke@aicas.com>
+
+ PR 29502
+ * gnu/java/awt/peer/gtk/GtkWindowPeer.java
+ (updateComponent): Don't override this here.
+ * java/awt/Window.java
+ (addWindowListener): Ignore null listener. Set newEventsOnly flag.
+ (addWindowFocusListener): Ignore null listener. Set newEventsOnly
+ flag.
+ (addWindowStateListener): Ignore null listener. Set newEventsOnly
+ flag.
+
+2006-10-18 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JEditorPane.java
+ (getStream): Try to detect and set the content type of the
+ connection stream.
+
+2006-10-18 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/RepaintManager.java
+ (RepaintWorkerEvent): Pass full set of params to super.
+ (RepaintWorker.dispatch): Overridden to allow apps to call this
+ via reflection.
+ (addDirtyRegion): Synchronize a little more to protect the
+ dirtyComponents field and avoid NPEs.
+ (invokeLater): Pass full set of params to RepaintWorkerEvent
+ constructor.
+
+2006-10-18 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JEditorPane.java
+ (page): Removed field. The page is now stored in the correct
+ document property.
+ (getPage): Fetch page URL from document property.
+ (read): Set the document for this JEditorPane. Use a Reader
+ for reading in the document.
+ (setPage): Call getStream() to get the stream from which we read.
+ Fire property change. Store page in document property.
+
+2006-10-18 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/datatransfer/DataFlavor.java
+ (DataFlavor(String)): Removed check for space in mime string.
+
+2006-10-18 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/Container.java
+ (validateTree): Call ContainerPeer.begin|endLayout() rather than
+ begin|endValidate().
+ (validate): Call ContainerPeer.begin|endValidate() here.
+ Added some local vars to avoid NPEs.
+
+2006-10-18 Roman Kennke <kennke@aicas.com>
+
+ * native/target/.cvsignore
+ * native/target/Linux/.cvsignore
+ * native/target/generic/.cvsignore:
+ Added to let CVS ignore the generated Makefile and Makefile.in
+ files.
+
+2006-10-18 Roman Kennke <kennke@aicas.com>
+
+ PR 29448
+ * java/awt/Window.java
+ (eventTypeEnabled): Overridden to handle WindowEvents.
+ (processEvent): Switch between processWindowEvent(),
+ processWindowFocusEvent() and processWindowStateEvent() here,
+ rather than simply calling processWindowEvent().
+ (processWindowEvent): Only dispatch event to listener, do not
+ switch to processWindowFocusEvent() or processWindowStateEvent()
+ here.
+ * javax/swing/JFrame.java
+ (frameInit): Explicitly enable window and key events here.
+ (processWindowEvent): Throw out some unnecessary code.
+ * javax/swing/JWindow.java
+ (windowInit): Explicitly enable key events here.
+ * javax/swing/JDialog.java
+ (close_action): Renamed to closeAction.
+ (dialogInit): Explicitly enable window events here.
+ (getDefaultCloseOperation): Renamed close_action to closeAction.
+ (processWindowEvent): Throw out some unnecessary code.
+ Renamed close_action to closeAction.
+ (setDefaultCloseOperation): Renamed close_action to closeAction.
+
+2006-10-17 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkMainThread.java: Introduce running flag
+ to track native GTK event loop status.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c: Set and
+ clear running flag when native GTK event loop starts and stops.
+
+2006-10-17 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/TransferHandler.java
+ (exportToClipboard): Implemented.
+
+2006-10-17 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/BufferedImageGraphics.java (draw): Extend updated
+ region to account for pixel-shifting.
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java (shiftDrawCalls): Made
+ proctected.
+
+2006-10-17 Francis Kung <fkung@redhat.com>
+
+ PR 29450
+ * gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
+ (getLogicalBounds): Translate individual glyphs before appending bounds.
+ (getOutline): Translate individual glyphs before appending outline.
+
+2006-10-17 Cameron McCormack <cam@mcc.id.au>
+
+ PR 29014
+ * java/awt/font/TextLayout.java
+ (bidi): New field.
+ (constructor): Store bidi in field.
+ (getCharacterLevel): Implemented.
+
+2006-10-17 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/TransferHandler.java
+ (PropertyTransferable): New inner class. Handles transfers
+ from component properties.
+ (createTransferable): Implemented.
+
+2006-10-17 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+ (drawComposite): Ensure composite does not extend beyond buffer
+ bounds.
+ * java/awt/image/Raster.java
+ (createChild): Ensure child does not extend beyond parent's
+ bounds.
+ * java/awt/image/WritableRaster.java
+ (createWritableChild): Ensure child does not extend beyond
+ parent's bounds.
+
+2006-10-17 Jeroen Frijters <jeroen@frijters.net>
+
+ * native/jni/classpath/jcl.c
+ (JNI_OnLoad): Corrected calling convention.
+
+2006-10-16 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/TransferHandler.java
+ (propertyName): New field.
+ (TransferHandler(String)): Store property name in field.
+ (canImport): Implemented stub method.
+ (exportDone): This is a no-op. Removed not-implemented mark.
+ (getPropertyDataFlavor): New helper method.
+ (getPropertyDescriptor): New helper method.
+
+2006-10-16 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/AbstractButton.java
+ (AccessibleJButton.getAfterIndex): Implemented.
+ (AccessibleJButton.getAtIndex): Implemented.
+ (AccessibleJButton.getBeforeIndex): Implemented.
+ (AccessibleJButton.getCharacterAttribute): Completed incomplete
+ method implementation.
+
+2006-10-16 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JLabel.java
+ (AccessibleJLabel.getIndexAtPoint): Implemented.
+ (AccessibleJLabel.getCharacterBounds): Implemented.
+ (AccessibleJLabel.getTextRectangle): New helper method.
+
+2006-10-16 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/filechooser/FileSystemView.java
+ (getFileSystemView): Mark as implemented.
+
+2006-10-14 Roman Kennke <kennke@aicas.com>
+
+ PR 27957
+ * javax/swing/JComponent.java
+ (toolTipText): Removed field.
+ (createToolTip): Don't set tooltip text here. This is done
+ in the ToolTipManager.
+ (setToolTipText): Set tooltip text as client property.
+ (getToolTipText): Get tooltip text from client property.
+ * javax/swing/ToolTipManager.java
+ (currentComponent): Made field non-static and of type JComponent.
+ (currentPoint): Made field non-static.
+ (currentTip): Made field non-static.
+ (popup): Made field non-static.
+ (toolTipText): New field. Stores the current tooltip text.
+ (checkTipUpdate): New helper method. Checks for updates of
+ the tooltip text and triggers the appropriate actions.
+ (getContentPaneDeepestComponent): Removed unneeded casts.
+ (mouseEntered): Removed unneeded cast. Initially fetch tooltip
+ text from component.
+ (mouseMoved): Check for tooltip text updates.
+ (showTip): Set tooltip text from current setting.
+
+2006-10-14 Roman Kennke <kennke@aicas.com>
+
+ PR 27956
+ * javax/swing/JSlider.java
+ (setPaintLabels): Call setLabelTable() instead of setting
+ the field directly. This also updates the label's size.
+
+2006-10-13 Tom Tromey <tromey@redhat.com>
+
+ * tools/gnu/classpath/tools/javah/ClassWrapper.java (toString): New
+ method.
+
+2006-10-13 Tania Bento <tbento@redhat.com>
+
+ * java/awt/ScrollPane.java
+ (setLayout): Should throw AWTError whenever called.
+
+2006-10-13 Roman Kennke <kennke@aicas.com>
+
+ PR 29448
+ * java/awt/Component.java
+ (dispatchEventImpl): Special handle ComponentReshapeEvents to
+ update the AWT's knowledge about a component's size.
+ * gnu/java/awt/ComponentReshapeEvent.java: New class.
+ * gnu/java/awt/peer/gtk/GtkWindowPeer.java
+ (postConfigureEvent): Directly dispatch a ComponentReshapeEvent
+ to update the AWT's knowledge about the component bounds.
+
+2006-10-13 Tania Bento <tbento@redhat.com>
+
+ * java/awt/ScrollPaneAdjustable.java
+ (setMaximum): Should throw AWTError whenever called.
+ (setMinimum): Same.
+ (setVisibleAmount): Same.
+
+2006-10-13 Tania Bento <tbento@redhat.com>
+
+ * java/awt/ScrollPane.java
+ (addImpl): When calling super, index should be value passed,
+ not -1.
+ (getIsValidString): New helper method for paramString().
+ (getScrollbarDisplayString): New helper method for paramString().
+ (paramString): Changed format of outputted string.
+
+2006-10-13 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/tree/DefaultTreeSelectionModel.java
+ (clone): Added cast to TreePath[].
+
+2006-10-13 Roman Kennke <kennke@aicas.com>
+
+ PR 27780
+ * javax/swing/JMenuItem.java
+ (isDragging): New field. Indicates if we are inside a mouse
+ drag.
+ (createMenuDragMouseEvent): Removed unneeded method.
+ (processMenuDragMouseEvent): Track if we are dragging.
+ (processMouseEvent): Simply forward to processMenuDragMouseEvent().
+ * javax/swing/plaf/basic/BasicMenuItemUI.java
+ (MenuDragMouseHandler.menuDragMouseDragged): Fetch
+ MenuSelectionManager from event.
+ (MenuDragMouseHandler.menuDragMouseEntered): Fetch
+ MenuSelectionManager from event.
+ (MenuDragMouseHandler.menuDragMouseExited): Fetch
+ MenuSelectionManager from event.
+ (MenuDragMouseHandler.menuDragMouseReleased): Click on mouse
+ release inside menu item, otherwise clear selection.
+ (MenuInputHandler.mouseReleased): Avoid multiple calls to getX()
+ and getY(). Call doClick() rather than the doClick() of JMenuItem.
+ (doClick): Perform an immediate click.
+
+2006-10-13 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * javax/swing/DefaultComboBoxModel.java (setSelectedItem): Simply
+ return if object is not in the list.
+
+2006-10-12 Andrew Haley <aph@redhat.com>
+
+ * java/lang/InheritableThreadLocal.java: Rename NULL to sentinel.
+ * java/lang/ThreadLocal.java: Likewise.
+
+2006-10-12 Roman Kennke <kennke@aicas.com>
+
+ PR 27956
+ * javax/swing/JSlider.java
+ (LabelUIResource): New inner class. A JLabel as UIResource.
+ (createStandardLabels): Don't set label bounds here.
+ Create LabelUIResource instances.
+ (setInverted): Repaint.
+ (setLabelTable): Update the label UIs. Revalidate and repaint.
+ (setMajorTickSpacing): Update the label table. Repaint if
+ necessary.
+ (setMinorTickSpacing): Repaint if necessary.
+ (setOrientation): Revalidate.
+ (setPaintLabels): Revalidate and repaint.
+ (setPaintTicks): Revalidate and repaint.
+ (setPaintTrack): Repaint.
+ (updateLabelUIs): Set the label sizes here.
+ (updateUI): Also update the label UIs.
+ * javax/swing/plaf/basic/BasicSliderUI.java
+ (ComponentHandler.componentResized): Don't revalidate.
+ (FocusHandler.focusGained): Don't set field.
+ (FocusHandler.focusLost): Don't set field.
+ (PropertyChangeHandler.propertyChange): Calculate geometry
+ and repaint for a couple more properties.
+ (TrackListener.mouseReleased): Repaint.
+ (hasFocus): Removed unneeded field.
+ (calculateContentRect): No need to check for content size < 0.
+ (calculateFocusRect): Use insets from insetCache.
+ (calculateLabelRect): Fixed calculation of label rectangle.
+ It is relative to the tick rectangle, rather than the content
+ rectangle.
+ (calculateTickRect): Small restructuring to avoid unnecessary
+ comparisons.
+ (calculateTrackRect): Fixed calculation of track rectangle.
+ (getMaximumSize): Fixed. Fetch preferred size and set
+ the height of width to Short.MAX_VALUE.
+ (getMinimumHorizontalSize): Fixed to return UIManager value.
+ (getMinimumVerticalSize): Fixed to return UIManager value.
+ (getPreferredHorizontalSize): Fixed to return UIManager value.
+ (getPreferredVerticalSize): Fixed to return UIManager value.
+ (getMinimumSize): Fixed to return the UIManager value plus
+ insets added.
+ (getPreferredSize): Fixed to return the UIManager value plus
+ insets added.
+ (getWidthOfWidestLabel): Restructured for more cleanness and
+ efficiency.
+ (hitClip): New helper method.
+ (paintHorizontalLabel): Replaced by more efficient and clean
+ implementation.
+ (paintVerticalLabel): Replaced by more efficient and clean
+ implementation.
+ (paintLabels): Replaced by more efficient and clean
+ implementation.
+ (paint): Check if rectangles intersect with clip for maximum
+ efficiency.
+ (recalculateIfInsetsChanged): Fixed. This method should
+ recalculate only when the insets changed.
+ (setThumbLocation): Repaint with a reasonable clip.
+ (xPositionForValue): Made more clean and efficient.
+ (yPositionForValue): Made more clean and efficient.
+ * javax/swing/plaf/basic/BasicLookAndFeel.java
+ (initComponenDefaults): Added Slider.horizontalSize,
+ Slider.verticalSize, Slider.minimumHorizontalSize and
+ Slider.minimumVerticalSize properties.
+ * javax/swing/plaf/metal/MetalSliderUI.java
+ (getTickLength): Add 1 for horizontal sliders and 3 for
+ vertical sliders.
+ (paintMajorTickForHorizSlider): Fix colors. Fix line locations.
+ (paintMinorTickForHorizSlider): Fix colors. Fix line locations.
+ (paintMajorTickForVertSlider): Fix colors. Fix line locations.
+ (paintMinorTickForVertSlider): Fix colors. Fix line locations.
+
+2006-10-12 Roman Kennke <kennke@aicas.com>
+
+ PR 28696
+ * javax/swing/text/FlowView.java
+ (FlowStrategy.layout): Preserve logical views from getting lost.
+ (FlowStrategy.layoutRow): Fix line breaking.
+ (FlowStrategy.adjustRow): Fix line breaking.
+ (FlowStrategy.changedUpdate): Mark layout invalid, or repaint.
+ (FlowStrategy.insertUpdate): Mark layout invalid, or repaint.
+ (FlowStrategy.removeUpdate): Mark layout invalid, or repaint.
+ (createView): Don't check index.
+ (contains): New helper method.
+ (reparent): New helper method.
+ (layoutDirty): Removed unneeded field.
+ (FlowView): Removed layoutDirty field init.
+ (changedUpdate): Removed layoutDirty handling.
+ (insertUpdate): Removed layoutDirty handling.
+ (removeUpdate): Removed layoutDirty handling.
+ (layout): Use isLayoutValid() rather than the layoutDirty field.
+ * javax/swing/text/GlyphView.java
+ (startOffset): Removed.
+ (endOffset): Removed.
+ (offset): New field.
+ (length): New field.
+ (GlyphView): Initialize new fields. Removed old fields.
+ (createFragment): Create fragment with new relative offsets.
+ (getEndOffset): Work with new relative offsets.
+ (getStartOffset): Work with new relative offsets.
+ * javax/swing/text/ParagraphView.java
+ (Row.getStartOffset): Overidden to determine the minimum start
+ offset from the children.
+ (Row.getEndOffset): Overidden to determine the maximum end
+ offset from the children.
+ * javax/swing/text/html/BRView.java
+ Make subclass of InlineView.
+ (getBreakWeight): Fall back to super for Y_AXIS.
+
+2006-10-12 Roman Kennke <kennke@aicas.com>
+
+ PR 28733
+ * javax/swing/plaf/basic/BasicTabbedPaneUI.java
+ (TabPaneLayout.normalizeTabRuns): Replaced algorithm with
+ one that avoids faulty state that could cause division by zero
+ error.
+
+2006-10-12 Roman Kennke <kennke@aicas.com>
+
+ PR 28057
+ * javax/swing/plaf/basic/BasicRadioButtonUI.java
+ (paint): Determine correct icon. Added support for HTML label.
+ Added small optimizations.
+ (getPreferredSize): Only consider the buttons iconTextGap, and
+ only when the text is not null.
+ * javax/swing/plaf/basic/BasicLookAndFeel.java
+ (initComponentDefaults): Fetch border for RadioButton from
+ BasicButtons.getRadioButtonBorder().
+ * javax/swing/plaf/metal/MetalRadioButtonUI.java
+ (paintFocus): Paint focus rectangle one pixel smaller.
+
+2006-10-12 Roman Kennke <kennke@aicas.com>
+
+ PR 29418
+ * javax/swing/tree/AbstractLayoutCache.java
+ (getNodeDimensions): Don't throw InternalError, but instead
+ return null.
+ (getRowsForPaths): Check for null here.
+ (isFixedRowHeight): Returns true when rowHeight > 0.
+ (setSelectionModel): Set this as the row mapper for the selection
+ model.
+ * javax/swing/tree/VariableHeightLayoutCache.java
+ (NodeRecord.NodeRecord): Initialize bounds field.
+ (getBounds): Simply return the bounds field.
+ (row2Node): Changed to be an ArrayList.
+ (RECT_CACHE): New field. Caches a Rectangle instance.
+ (countRows): Added y parameter and return value. The method
+ now takes the current y position as parameter, and returns
+ the updated y position.
+ (getBounds): Fixed to return the correct bounds.
+ (getPathForRow): Replaced by fixed implementation.
+ (getPreferredHeight): Replaced by more efficient implementation.
+ This simply fetches the last node record and returns its lower
+ bounds.
+ (getPreferredWidth): Added null check.
+ (getVisibleChildCount): Added null check.
+ (getVisiblePathsFrom): Added null check.
+ (setExpandedState): Also expand the ancestors of the node
+ to be expanded.
+ (setModel): Set dirty flag rather than updating for real.
+ (setNodeDimensions): Overridden to set the dirty flag.
+ (setRowHeight): Overridden to set the dirty flag.
+ (update): Don't special case the root here, this is done now
+ in countRows().
+
+2006-10-12 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JComponent.java
+ (paintImmediately2): Added support for components which need
+ to force themselves as paint root.
+ (isPaintRoot): New method. This should be overridden by components
+ which need to force themselves as paint root.
+ * javax/swing/JViewport.java
+ (isPaintRoot): Overridden to force the viewport as paint root
+ when running in backingstore mode.
+
+2006-10-12 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/tree/DefaultTreeSelectionModel.java
+ (PathPlaceHolder): New inner class. Wraps a path and its status
+ wrt to its newness.
+ (selectedPaths): New field. A supporting datastructure.
+ (tmpPaths): New field. A supporting datastructure.
+ (DefaultTreeSelectionModel): Initialize the list selection model,
+ the leadIndex and the supporting datastructures.
+ (addPropertyChangeListener): Create changeSupport object lazily.
+ (addSelectionPaths): Mostly rewritten to handle the different
+ selection modes correctly.
+ (addSelectionPath): Delegate to addSelectionPaths().
+ (arePathsContiguous): Replaced with more efficient implementation
+ using BitSet
+ (canPathBeAdded): Removed unneeded method.
+ (canPathsBeAdded): Replaced with more efficient implementation.
+ (clearSelection): Create correct event. Clear the fields correctly,
+ including the supporting datastructures.
+ (clone): Also clone the supporting datastructures and nullify
+ changeSupport field.
+ (getMaxSelectionRow): Delegate to list selection model.
+ (getMinSelectionRow): Delegate to list selection model.
+ (getPath): Removed unneeded method.
+ (getPropertyChangeListeners): Handle null changeSupport field
+ correctly.
+ (getRow): Handle null rowMapper field correctly.
+ (getSelectionRows): Handle invisible rows correctly.
+ (insureRowContinuity): Replaced by more efficient and correct
+ implementation.
+ (isRowSelected): Delegate to list selection model.
+ (notifyPathChange): Made more efficient by use of PathPlaceHolder
+ class.
+ (removePropertyChangeListener): Handle null changeSupport field.
+ (removeSelectionPaths): Mostly rewritten to handle the different
+ selection modes correctly.
+ (removeSelectionPath): Delegate to removeSelectionPaths().
+ (resetRowSelection): Handle list selection model.
+ (selectOne): Removed unneeded field.
+ (setRowMapper): Reset the row selection.
+ (setSelectionMode): Check for invalid mode and set to
+ DISCONTINUOUS_TREE_SELECTION in this case. Fire property change.
+ (setSelectionPaths): Mostly rewritten to handle the different
+ selection modes correctly.
+ (setSelectionPath): Delegate to setSelectionPaths().
+ (updateLeadIndex): Made more efficient.
+
+2006-10-11 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+ (buffer, locked): New fields.
+ (constructors): Initialize new variables.
+ (createBuffer): New method.
+ (draw): Implement custom composites.
+ (drawComposite): New method.
+ (drawGlyphVector): Implement custom composites.
+ (drawImage): Implement custom composites.
+ (drawRenderedImage): Implement custom composites.
+ (fill): Implement custom composites.
+ (getBufferCM): New method.
+ (getNativeCM): New method.
+ (updateBufferedImage): Fix premultiplication.
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (copy): Copy composite.
+ (drawImage): Set background properly.
+ (getBufferCM): New method.
+ (setComposite): Reset alpha composite when using custom composite.
+ * gnu/java/awt/peer/gtk/CairoSurface.java
+ (cairoColorModel): New field.
+ (nativeColorModel): Renamed.
+ (constructor): Use renamed createCairoSampleModel method.
+ (createCairoSampleModel): New method.
+ (createNativeSampleModel): Renamed.
+ (getBufferedImage): Use renamed cairoColorModel field.
+ * gnu/java/awt/peer/gtk/GtkVolatileImage.java
+ (gdkColorModel): New field.
+ (createGdkSampleModel): New method.
+ (getPixels): Added comments.
+ (getSnapshot): Use GDK colour and sample models.
+ * gnu/java/awt/peer/gtk/VolatileImageGraphics.java
+ (createBuffer): Use GDK colour and sample models.
+ (getNativeCM): Added comments.
+ * java/awt/image/BufferedImage.java
+ (constructor): Set premultiplied flag properly.
+
+2006-10-11 Edwin Steiner <edwin.steiner@gmx.net>
+
+ * native/jni/java-nio/gnu_java_nio_VMChannel.c
+ (Java_gnu_java_nio_VMChannel_lock): Special case Long.MAX_VALUE.
+
+2006-10-10 Francis Kung <fkung@redhat.com>
+
+ PR 29372
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (createPath): Added isDraw parameter.
+ (draw): Updated createPath call.
+ (fill): Updated createPath call.
+
+2006-10-10 Tom Tromey <tromey@redhat.com>
+
+ PR classpath/29362:
+ * gnu/xml/transform/TransformerImpl.java (transform): Only strip if
+ there is a stylesheet.
+
+2006-10-10 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/Toolkit.java
+ (getDefaultTookit): Make method synchronized to avoid
+ accidentally creating more than one toolkits from different
+ threads.
+
+2006-10-10 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/LightweightDispatcher.java
+ (handleMouseEvent): Redispatch MOUSE_WHEEL events too.
+ (redispatch): Transfer the button to the redispatched event.
+
+2006-10-10 Francis Kung <fkung@redhat.com>
+
+ * java/awt/image/ColorModel.java (coerceData): Implemented.
+
+2006-10-09 Christian Elias Naur <elias@oddlabs.com>
+
+ * vm/reference/java/lang/VMClassLoader.java:
+ (defineClassWithTransformers): Use proper class name format.
+
+2006-10-09 Gary Benson <gbenson@redhat.com>
+
+ * java/net/ServerSocket.java
+ (implAccept): Add security check.
+ (accept): Close socket if security check fails.
+ (setSocketFactory): Add security check and already-set check.
+
+2006-10-09 Roman Kennke <kennke@aicas.com>
+
+ PR 29325
+ * javax/swing/JSplitPane.java
+ (dividerLocation): New field. Stores the divider location.
+ (JSplitPane): Initialize dividerLocation with -1.
+ (addImpl): Removed unneeded local variables.
+ (getDividerLocation): Manage dividerLocation in the JSplitPane
+ class, not in the UI.
+ (setDividerLocation): Manage dividerLocation in the JSplitPane
+ class, not in the UI. Only call the UI method for notification.
+ * javax/swing/plaf/basic/BasicSplitPaneUI.java
+ (BasicHorizontalLayoutManager.layoutContainer): Fetch divider
+ location from the JSplitPane. Honour the minimumSize, but only
+ if the divider location hasn't been set explicitly.
+ (BasicHorizontalLayoutManager.minimumLayoutSize): Removed unneeded
+ statement.
+ (BasicHorizontalLayoutManager.preferredLayoutSize): Removed unneeded
+ statement.
+ (BasicHorizontalLayoutManager.resetToPreferredSizes): Don't touch
+ the divider location.
+ (dividerLocationSet): New field.
+ (dividerLocation): Removed field.
+ (createActionMap): Fetch and set divider location on the JSplitPane.
+ (getDividerLocation): Return the actual real divider location.
+ (getMaximumSize): Removed unneeded cast.
+ (getPreferredSize): Removed unneeded cast.
+ (getMinimumSize): Removed unneeded cast.
+ (installUI): Initialize dividerLocationSet with false.
+ (uninstallUI): Initialize dividerLocationSet with false.
+ (setDividerLocation): Set dividerLocationSet to true.
+
+2006-10-09 Robert Schuster <robertschuster@fsfe.org>
+
+ * native/jni/java-net/gnu_java_net/VMPlainSocketImpl.c:
+ (Java_gnu_java_net_VMPlainSocketImpl_joinGroup): Properly
+ convert jstring into char *.
+ (Java_gnu_java_net_VMPlainSocketImpl_joinGroup6): Dito.
+ (Java_gnu_java_net_VMPlainSocketImpl_leaveGroup): Dito.
+ (Java_gnu_java_net_VMPlainSocketImpl_leaveGroup6): Dito.
+ (getif_address): Added const modifier to second argument.
+ (getif_index): Dito.
+
+2006-10-09 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JTree.java
+ (isSelected): Added API docs.
+
+2006-10-09 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JTree.java
+ (isSelected): Delegate to the selection model directly.
+
+2006-10-09 Robert Schuster <robertschuster@fsfe.org>
+
+ * gnu/java/nio/KqueueSelectorImpl.java: Renamed field
+ sizeof_struct_kevent to _sizeof_struct_kevent.
+
+2006-10-07 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ * tools/gnu/classpath/tools/rmic/RMICException.java:
+ javadoc corrections, reformatted.
+
+2006-10-07 Christian Elias Naur <elias@oddlabs.com>
+
+ * gnu/java/lang/InstrumentationImpl.java:
+ Made constructor package visible.
+
+2006-10-05 Gary Benson <gbenson@redhat.com>
+
+ * java/net/Socket.java
+ (Socket): Perform security check on address not hostname.
+
+2006-10-04 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/tree/VariableHeightLayoutCache.java
+ (getBounds): When rect is null, create a new Rectangle.
+
+2006-10-04 Christian Thalinger <twisti@complang.tuwien.ac.at>
+
+ * native/jni/java-nio/javanio.c (cpnio_read, cpnio_readv)
+ (cpnio_write, cpnio_writev, cpnio_socket, cpnio_connect)
+ (cpnio_accept, cpnio_sendto, cpnio_recvfrom, cpnio_fcntl)
+ (cpnio_select): Use CPNIO_EXPORT.
+ * native/jni/java-nio/javanio.h (CPNIO_EXPORT): Define to static
+ inline instead of extern inline, as newer GCCs changed their
+ behavior.
+
+2006-10-04 Gary Benson <gbenson@redhat.com>
+
+ * java/net/InetAddress.java: Updated javadoc.
+ (<clinit>, getByLiteral): Throw InternalError on failures.
+
+2006-10-03 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (compCtx): New field for composite context.
+ (copy): Copy composite.
+ (dispose): Dispose of composite context.
+ (getNativeCM): New method.
+ (setComposite): Discard old composite context and set up new context.
+ (setRenderingHints): Update composite context.
+ * gnu/java/awt/peer/gtk/CairoSurface.java
+ (nativeColorModel): New field, renamed from nativeModel.
+ (nativeModel): Renamed field to nativeColorModel.
+ (CairoSurface(int, int)): Call new method to create sample model.
+ (createNativeSampleModel): New method.
+ (getBufferedImage): Updated variable name.
+ * gnu/java/awt/peer/gtk/VolatileImageGraphics.java
+ (buffer): New field.
+ (createBuffer): New method.
+ (draw): New method.
+ (drawComposite): New method.
+ (drawGlyphVector): New method.
+ (drawImage(Image, AffineTransform, Color, ImageObserver)): New method.
+ (drawImage(Image, int, int, ImageObserver)): Check composite.
+ (drawImage(Image, int, int, int, int, ImageObserver)): Check composite.
+ (fill): New method.
+ (getNativeCM): New method.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c
+ (Java_gnu_java_awt_peer_gtk_GtkVolatileImage_nativeGetPixels): Use
+ intermediary pixbuf to grab on-screen pixels.
+
+2006-10-03 Tom Tromey <tromey@redhat.com>
+
+ PR classpath/28987:
+ * java/util/IdentityHashMap.java (tombstone): Removed.
+ (emptyslot): Removed.
+ (nullslot): New field.
+ (IdentityHashMap): Don't fill array.
+ (clear): Fill with null.
+ (hash): Now final. Use linear probing.
+ (xform): New method.
+ (unxform): Likewise.
+ (removeAtIndex): Likewise.
+ (clone, containsKey, containsValue, entrySet, get, hashCode,
+ keySet, put, remove, values): Updated.
+ (IdentityIterator, IdentityEntry): Likewise.
+ (writeObject): Likewise.
+
+2006-10-03 Tom Tromey <tromey@redhat.com>
+
+ * java/util/Locale.java (hashcode): Updated javadoc.
+ (hashcodeCache): Removed.
+ (Locale): Updated.
+ (hashCode): Updated.
+ (writeObject): New method.
+ (readObject): Updated.
+
+2006-10-02 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+ (updateBufferedImage): Recognise that raw data is alpha-premultiplied.
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (clearRect): Paint background colour with AlphaComposite.SRC rule.
+ (drawImage(Image, AffineTransform, Color, ImageObserver)): Alpha
+ pre-multiply data before drawing.
+ (fillRect): Draw using regular fill() method.
+ (setComposite): Handle null case with AlphaComposite.SrcOver default.
+ * gnu/java/awt/peer/gtk/CairoSurface.java
+ (nativeModel): Use correct value for alpha premultiplication (true).
+ * java/awt/image/BufferedImage.java
+ (coerceData): Update isPremultiplied field.
+
+2006-10-02 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/classpath/ListenerData.java:
+ New class for holding listener data.
+ * gnu/java/lang/management/MemoryMXBeanImpl.java:
+ ListenerData class moved to its own file.
+ * javax/management/MBeanServerDelegate.java,
+ * javax/management/MBeanServerDelegateMBean.java,
+ * javax/management/MBeanServerNotification.java:
+ Implemented.
+
+2006-10-02 Tania Bento <tbento@redhat.com>
+
+ * java/ast/Rectangle.java:
+ (Rectangle(Rectangle)): Do not throw NPE.
+ (Rectangle(Point, Dimension)): Same.
+ (Rectangle(Point)): Same.
+ (Rectangle(Dimension)): Same.
+
+2006-09-29 Casey Marshall <csm@gnu.org>
+
+ PR 29190
+ * gnu/java/nio/EpollSelectionKeyImpl.java: extend
+ `AbstractSelectionKey.'
+ (cancel, isValid): removed.
+ * gnu/java/nio/EpollSelectorImpl.java (cancelledKeys): removed.
+ (events): new field.
+ (INITIAL_CAPACITY, MAX_DOUBLING_CAPACITY, CAPACITY_INCREMENT): new
+ fields.
+ (<clinit>): initialize those constants.
+ (<init>): don't initialize `cancelledKeys;' initialize `events.'
+ (doSelect): deregister cancelled keys; remove keys attached to
+ closed channels; wrap `epoll_wait' in `begin' and `end' calls; use
+ `events' buffer; reallocate `events' buffer if needed.
+ (register): reallocate `events' buffer if needed.
+ (reallocateBuffer): new method.
+ (cancel): removed.
+
+2006-09-29 Roman Kennke <kennke@aicas.com>
+
+ PR 28929
+ * javax/swing/JViewport.java
+ (cinit): Renamed system property to gnu.swing.scrollmode
+ to avoid bloat. Default to BACKINGSTORE, this is much
+ more reliable.
+ (repaint): Forward repaint() to parent as is specified.
+
+2006-09-29 Tania Bento <tbento@redhat.com>
+
+ * javax/swing/plaf/basic/BasicTableUI.java
+ (getPreferredSize): The number of iterations for the for-loop should be
+ the number of columns in the table's column model, not the number of
+ columns of the table.
+ * javax/swing/JTable.java
+ (JTable(TableModel, TableColumnModel, ListSelectionModel): Removed 4
+ lines that are not needed.
+ (initializeLocalVars): dragEnabled should be set to false, not true.
+ (getCellRenderer): Added a check to prevent an
+ ArrayIndexOutOfBoundsException.
+ (doLayout): The number of iterations for the for-loops should be the
+ number of columns in the table's column model, not the number of columns
+ of the table.
+
+2006-09-29 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/awt/java2d/AbstractGraphics2D.java: Updated
+ API docs.
+ (isOptimized): Initialize with true.
+ (paintRaster): Removed unneeded field.
+ (shapeCache): New static field. Caches certain shapes for reuse.
+ (computeIntersection): Removed unneeded casts.
+ (drawArc): Use shape cache.
+ (drawImage): Removed unneeded statement.
+ (drawLine): Use shape cache. Pass untranslated coordinates
+ to rawDrawLine().
+ (drawOval): Use shape cache.
+ (drawPolygon): Use shape cache.
+ (drawRect): Overridden to provide accelerated rectangle drawing
+ if possible and to use the shape cache.
+ (drawRoundRect): Use shape cache.
+ (fillArc): Use shape cache.
+ (fillOval): Use shape cache.
+ (fillPolygon): Use shape cache.
+ (fillRect): Pass untranslated coordinates to rawFillRect().
+ Use shape cache.
+ (fillRoundRect): Use shape cache.
+ (fillScanlineAA): Removed unneeded statement.
+ (fillScanline): Updated API docs.
+ (fillShapeAntialias): Removed unnecessary cast.
+ (fillShapeImpl): Update API docs. Removed unnecessary cast.
+ (fillShape): Updated API docs.
+ (getShapeCache): New helper method.
+ * gnu/java/awt/java2d/ShapeCache.java: New class. Caches
+ certain shapes for reuse in AbstractGraphics2D.
+
+2006-09-28 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/management/BadBinaryOpValueExpException.java:
+ (getExp()): Implemented.
+ * javax/management/MBeanConnection.java:
+ Renamed to MBeanServerConnection.
+ * javax/management/MBeanServer.java:
+ (setAttribute(Attribute)): Fixed...
+ (setAttribute(ObjectName,Attribute)): to this.
+ * javax/management/MBeanServerConnection.java:
+ Renamed from MBeanConnection.
+ * javax/management/QueryExp.java:
+ Extend Serializable.
+ * javax/management/ValueExp.java:
+ Likewise.
+ * javax/management/loading/ClassLoaderRepository.java:
+ (loadClass(String)): Throw ClassNotFoundException.
+ (loadClassBefore(ClassLoader,String)): Likewise.
+ (loadClassWithout(String, ClassLoader): Fixed...
+ (loadClassWithout(ClassLoader,String)): to this.
+
+2006-09-28 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/tree/DefaultTreeCellRenderer.java
+ (DefaultTreeCellRenderer): Fetch drawsFocusBorderAroundIcon
+ property from UIManager.
+ (paint): Rewritten to use super's implementation and only paint
+ background and focus indicator before.
+ (paintFocus): New helper method.
+ (getXOffset): New helper method.
+
+2006-09-28 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/management/BadBinaryOpValueExpException.java,
+ * javax/management/MBeanConnection.java,
+ * javax/management/MBeanServer.java,
+ * javax/management/ObjectInstance.java:
+ Implemented.
+ * javax/management/ObjectName.java:
+ (setMBeanServer(MBeanServer)): Implemented.
+ * javax/management/QueryExp.java,
+ * javax/management/ValueExp.java,
+ * javax/management/loading/ClassLoaderRepository.java:
+ Implemented.
+
+2006-09-27 Robert Schuster <robertschuster@fsfe.org>
+
+ * gnu/java/nio/VMChannelOwner.java: Removed unneeded imports.
+
+2006-09-27 Robert Schuster <robertschuster@fsfe.org>
+
+ * vm/reference/gnu/java/nio/VMChannel.java: Removed unneeded imports.
+ * vm/reference/gnu/java/nio/VMPipe.java: Removed unneeded imports.
+ * gnu/java/nio/EpollSelectorImpl.java:
+ (doSelect): Use Integer.valueOf() instead of constructor call.
+ (register): Use Integer.valueOf() instead of constructor call.
+
+2006-09-27 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/Container.java
+ (addContainerListener): Activate newEventsOnly for the component.
+ Ignore null listeners.
+
+2006-09-27 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/EventQueue.java
+ (Queue): New inner class. Implements the actual queue.
+ (LOW_PRIORITY): New constant field.
+ (NORM_PRIORITY): New constant field.
+ (queueHead): Removed. Moved into Queue.
+ (queueTail): Removed. Moved into Queue.
+ (queues): New field.
+ (EventQueue): Initialize two internal queues, one for
+ normal events, one for low priority events.
+ (getNextEventImpl): New helper method, fetches the next event.
+ (getNextEvent): Use getNextEventImpl() for fetching the event.
+ (peekEvent): Use getNextEventImpl() for fetching the event.
+ (peekEvent(int)): Search for event in all queues.
+ (postEventImpl(AWTEvent)): Moved actual posting into
+ postEventImpl(AWTEvent,int). Prioritize events here.
+ (postEventImpl(AWTEvent,int)): Take priority parameter and insert
+ event into correct queue. Re-enable event coalescing.
+ * gnu/java/awt/LowPriorityEvent.java: New marker interface.
+ * javax/swing/RepaintManager.java
+ (RepaintWorkerEvent): New internal class. This is a low priority
+ event for the repaint worker.
+ (addDirtyRegion): Use new internal invokeLater() for sending
+ a low priority event.
+ (addInvalidComponent): Use new internal invokeLater() for sending
+ a low priority event.
+ (commitBuffer): Added some null checks.
+ (invokeLater): New helper method. Sends a low priority
+ repaint worker event on the event queue.
+
+2006-09-27 Roman Kennke <kennke@aicas.com>
+
+ PR 29036
+ PR 29161
+ * javax/swing/plaf/basic/BasicButtonUI.java
+ (cachedInsets): New field.
+ (installListeners): Fire synthetic property change to initialize
+ TEXT_LAYOUT_CACHE for the button because the font has been
+ installed before.
+ (uninstallUI): Clear the TEXT_LAYOUT_CACHE for the button.
+ (paint): Use cached insets.
+ (paintText): Let new method forward to old one, not vice versa.
+ * javax/swing/plaf/basic/BasicMenuItemUI.java
+ (defaultAcceleratorLabelGap): Removed unused field.
+ (MenuGap): Removed unused field.
+ (propertyChangeListener): Made private.
+ (getAcceleratorRect): Removed unused method.
+ (getAcceleratorText): Removed unused method.
+ (getPath): Removed unnecessary cast.
+ (installListeners): Fire synthetic property change to initialize
+ TEXT_LAYOUT_CACHE for the button because the font has been
+ installed before.
+ (uninstallUI): Clear the TEXT_LAYOUT_CACHE for the button.
+ (layoutMenuItem): Removed unused statements.
+
+2006-09-27 Roman Kennke <kennke@aicas.com>
+
+ PR 29218
+ * javax/swing/tree/DefaultTreeModel.java
+ (isLeaf): Check if the node allows children when
+ asksAllowsChildren is true, otherwise fall back
+ to return the node's leaf property.
+
+2006-09-27 Mario Torre <neugens@limasoftware.net>
+
+ * scripts/check_jni_methods.sh: removed methods from the
+ ignore list:
+ Java_gnu_java_util_prefs_gconf_GConfNativePeer_finalize_1class
+ Java_gnu_java_util_prefs_gconf_GConfNativePeer_init_1id_1cache
+ Java_gnu_java_util_prefs_gconf_GConfNativePeer_init_1class
+ Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1escape_1key
+ Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1unescape_1key
+ * native/jni/gconf-peer/GConfNativePeer.c: fixed coding style
+ to better follow the GNU style.
+ * include/gnu_java_util_prefs_gconf_GConfNativePeer.h.
+ regenerated header file for GConfNativePeer.
+
+2006-09-27 Robert Schuster <robertschuster@fsfe.org>
+
+ * INSTALL: Added information about grmic being built when ASM
+ is available, added information about gconf dependency, indented
+ Qt4 dependency section.
+ * configure.ac: Added information about grmic being built when ASM
+ is available.
+
+2006-09-27 Ian Rogers <ian.rogers@manchester.ac.uk>
+
+ * native/jni/classpath/jcl.c (JNI_OnLoad): Don't call
+ DeleteGlobalRef on a local ref.
+
+2006-09-24 Mario Torre <neugens@limasoftware.net>
+
+ * scripts/check_jni_methods.sh: added two new methods in the
+ ignore list:
+ Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1escape_1key
+ and
+ Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1unescape_1key
+ * native/jni/gconf-peer/GConfNativePeer.c:
+ (Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1all_1keys):
+ refacored method name, renamed from
+ Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1gconf_1client_1all_1keys.
+ Added code to unescape escaped GConf key names.
+ (Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1all_1nodes):
+ refacored method name, renamed from
+ Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1gconf_1client_1all_1nodes.
+ Added code to unescape escaped GConf key names.
+ (Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1escape_1key):
+ new function.
+ (Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1unescape_1key):
+ new function.
+ * gnu/java/util/prefs/gconf/GConfNativePeer.java: removed
+ version javadoc tag.
+ (escapeString): new method.
+ (unescapeString): likewise.
+ (gconf_escape_key): new native method.
+ (gconf_unescape_key): likewise.
+ (gconf_client_suggest_sync): update native method signature, now
+ explicity throws BackingStoreException.
+ (gconf_client_all_nodes): update native method signature, now
+ explicity throws BackingStoreException. Refactored method name,
+ renamed from gconf_client_gconf_client_all_nodes.
+ (gconf_client_all_keys): update native method signature, now
+ explicity throws BackingStoreException. Refactored method name,
+ renamed from gconf_client_gconf_client_all_keys.
+ (getKeys): refactored to use the new method name
+ gconf_client_all_keys.
+ (getChildrenNodes): refactored to use the new method name
+ gconf_client_all_nodes.
+ * gnu/java/util/prefs/GConfBasedPreferences.java: removed
+ version javadoc tag.
+ (GConfBasedPreferences): Added code to escape node names from
+ invalid characters so that GConf now accept invalid node names.
+ (GConfBasedPreferences): Moved code to register the current
+ node to the list of nodes watched by GConf outside the constructor.
+ (childSpi): Added code to register the current node to the
+ list of nodes watched by GConf.
+ (getGConfKey): Added code to escape key names from
+ invalid characters so that GConf now accept invalid key names.
+
+2006-09-26 Tom Tromey <tromey@redhat.com>
+
+ * tools/gnu/classpath/tools/javah/Printer.java (Printer): Don't
+ call mkdirs in output-directory case.
+ (getPrintStream): Create output directory.
+ * tools/gnu/classpath/tools/javah/Main.java (makeOutputDirectory):
+ Don't call mkdirs.
+
+2006-09-27 Raif S. Naffah <raif@swiftdsl.com.au>
+
+ * tools/gnu/classpath/tools/javah/CniIncludePrinter.java (CniIncludePrinter):
+ Accept three additional arguments.
+ (writePreambleImpl): New method.
+ (getPrintStreamImpl): Likewise.
+ (printClass): Adapted to use new methods in Printer superclass.
+ * tools/gnu/classpath/tools/javah/CniStubPrinter.java: Likewise.
+ * tools/gnu/classpath/tools/javah/JniIncludePrinter.java: Likewise.
+ * tools/gnu/classpath/tools/javah/JniStubPrinter.java: Likewise.
+ * tools/gnu/classpath/tools/javah/Main.java (outFileName): New field.
+ (force): Likewise.
+ (getParser): Add support for -o option.
+ Check that only one of -d or -o is defined.
+ Add support for -jni option.
+ Add support for -force option.
+ (makeOutputFile): New method.
+ (writeHeaders): Removed File argument from signature.
+ (run): Take into account newly added fields.
+ Invoke concrete PrintStream implementations with augmented constructors.
+ * tools/gnu/classpath/tools/javah/Printer.java (outputFileObject): New field.
+ (isDirectory): Likewise.
+ (force): Likewise.
+ (wrotePreamble): Likewise.
+ (Printer): Changed ctor to accept three additional arguments.
+ (printClass): Changed signature to accept one ClassWrapper argument.
+ (writePreambleImpl): New abstract method.
+ (getPrintStreamImpl): Likewise.
+ (getPrintStream): New method.
+ (writePreamble): Likewise.
+
+2006-09-26 Tania Bento <tbento@redhat.com>
+
+ * java/awt/GridLayout.java
+ (toString): There is no common before hgap.
+ * java/awt/Rectangle.java
+ (Rectangle(Rectangle)): Throw NPE if Rectangle is null.
+ (Rectangle(Point, Rectangle)): Throw NPE if either Point or
+ Rectangle is null.
+ (Rectangle(Point)): Throw NPE if Point is null.
+ (Rectangle(Dimension)): Throw NPE if Dimension is null.
+
+2006-09-26 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/plaf/metal/MetalIconFactory.java
+ (FileIcon16.paintIcon): Apply vertical shift by the number of pixels
+ returned by getShift(),
+ (FileIcon16.getShift): Updated API docs,
+ (FolderIcon16.paintIcon): Apply vertical shift by the number of pixels
+ returned by getShift(),
+ (FolderIcon16.getShift): Updated API docs,
+ (TreeFolderIcon.getShift): Likewise,
+ (TreeLeafIcon.getShift): Likewise.
+
+2006-09-26 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/plaf/metal/MetalIconFactory.java
+ (FileIcon16.paintIcon): Fetch colors from look and feel,
+ (FolderIcon16.paintIcon): Likewise.
+
+2006-09-25 Casey Marshall <csm@gnu.org>
+
+ * gnu/java/nio/FileChannelImpl.java (read): revert back to using
+ `readScattering.'
+ (write): revert back to using `writeGathering.'
+ * vm/reference/gnu/java/nio/VMChannel.java (writeGathering): find
+ the first buffer that has data remaining, and start at that one.
+
+2006-09-25 Tom Tromey <tromey@redhat.com>
+
+ * native/jni/gconf-peer/Makefile.am (libgconfpeer_la_LDFLAGS): New
+ variable.
+
+2006-09-25 Tom Tromey <tromey@redhat.com>
+
+ * tools/.cvsignore: Updated.
+
+2006-09-25 Tom Tromey <tromey@redhat.com>
+
+ PR libgcj/29178:
+ * gnu/java/nio/charset/US_ASCII.java (Encoder.canEncode): New method.
+ (Encoder.canEncode): Likewise.
+ (Encoder.encodeLoop): Return unmappable for all non-ASCII characters.
+ * gnu/java/nio/charset/ByteCharset.java (Encoder.canEncode): New
+ method.
+ (Encoder.canEncode): Likewise.
+ * gnu/java/nio/charset/ISO_8859_1.java (Encoder.canEncode): New
+ method.
+ (Encoder.canEncode): Likewise.
+
+2006-09-25 Tom Tromey <tromey@redhat.com>
+
+ * native/fdlibm/mprec.c (mprec_calloc): Renamed.
+ (Balloc): Updated.
+
+2006-09-25 Francis Kung <fkung@redhat.com>
+
+ * java/awt/image/ColorModel.java
+ (coerceData): Made abstract.
+ (coerceDataWorker): New protected method.
+ * java/awt/image/ComponentColorModel.java
+ (coerceData): Return new instance of proper ColorModel.
+ * java/awt/image/DirectColorModel.java
+ (coerceData): Return new instance of proper ColorModel.
+ * java/awt/image/IndexColorModel.java
+ (coerceData): New method.
+
+2006-09-24 Casey Marshall <csm@gnu.org>
+
+ * gnu/java/nio/FileChannelImpl.java
+ (read): call `read' in a loop, don't use `readScattering.'
+ (write): call `write' in a loop, don't use `writeGathering.'
+
+2006-09-24 Mark Wielaard <mark@klomp.org>
+
+ * configure.ac: Move -pedantic from WARNING to STRICT flags.
+
+2006-09-24 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/nio/channels/spi/AbstractSelectableChannel.java
+ (register): Set interestOps and attachment when the key already
+ exists.
+
+2006-09-24 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/net/ServerSocket.java
+ (bind(SocketAddress,int)): Added support for null address.
+ Throw proper exception if already bound.
+ Handle unresolved addresses correctly. Ignore exceptions that
+ happen during close in error path (to prevent losing the original
+ exception.)
+
+2006-09-24 Mark Wielaard <mark@klomp.org>
+
+ Suggested by Aaron M. Ucko <ucko@debian.org>
+ Fixes bug #29203
+ * native/fdlibm/mprec.c (ulp): Define L as int32_t.
+
+2006-09-24 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/nio/channels/spi/AbstractSelectableChannel.java
+ (implCloseChannel): Cancel all keys after closing the channel.
+
+2006-09-22 Casey Marshall <csm@gnu.org>
+
+ * gnu/java/nio/EpollSelectorImpl.java (doSelect): remove keys
+ after we delete them.
+ (selectedKeys): return an empty set if nothing's been selected.
+ * native/jni/java-nio/gnu_java_nio_EpollSelectorImpl.c
+ (Java_gnu_java_nio_EpollSelectorImpl_epoll_1delete): don't
+ throw an exception on EBADF.
+ (Java_gnu_java_nio_EpollSelectorImpl_epoll_1wait): don't
+ throw exception on EINTR, just return 0.
+
+2006-09-22 Casey Marshall <csm@gnu.org>
+
+ * native/jni/java-io/java_io_VMFile.c (Java_java_io_VMFile_list):
+ remove `const' from `filename.'
+ * native/jni/native-lib/cpio.c (cpio_readDir): remove `const' from
+ `filename.'
+ * native/jni/native-lib/cpio.h (cpio_readDir): likewise.
+
+2006-09-22 Casey Marshall <csm@gnu.org>
+
+ * configure.ac (AC_CHECK_FUNCS): check for `readdir_r.'
+ * native/jni/java-io/java_io_VMFile.c (Java_java_io_VMFile_list):
+ allocate `filename,' and handle changes to `cpio_readDir.'
+ * native/jni/native-lib/cpio.c (cpio_readDir): use `readdir_r' if
+ available; copy the filename into the destination buffer; return
+ an error code if readdir returns NULL, but errno is 0.
+ * native/jni/native-lib/cpio.h (cpio_readDir): change second
+ parameter to `const char *.'
+
+2006-09-23 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/management/ObjectName.java:
+ Implemented.
+
+2006-09-22 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * resource/gnu/classpath/tools/orbd: New directory.
+ * resource/gnu/classpath/tools/rmic: Likewise.
+ * resource/gnu/classpath/tools/rmid: Likewise.
+ * resource/gnu/classpath/tools/rmiregistry: Likewise.
+ * resource/gnu/classpath/tools/tnameserv: Likewise.
+ * tools/gnu/classpath/tools/giop: Move contents to...
+ * tools/gnu/classpath/tools/orbd,
+ tools/gnu/classpath/tools/tnameserv: New directories.
+ * tools/gnu/classpath/tools/rmi/rmic: Move contents to...
+ * tools/gnu/classpath/tools/rmic: New directory.
+ * tools/gnu/classpath/tools/rmi/rmid: Move contents to...
+ * tools/gnu/classpath/tools/rmid: New directory.
+ * tools/gnu/classpath/tools/rmi/registry: Move contents to...
+ * tools/gnu/classpath/tools/rmiregistry: New directory.
+ * resource/gnu/classpath/tools/orbd/messages.properties: New file.
+ * resource/gnu/classpath/tools/rmic/messages.properties: Likewise.
+ * resource/gnu/classpath/tools/rmid/messages.properties: Likewise.
+ * resource/gnu/classpath/tools/rmiregistry/messages.properties:
+ Likewise.
+ * resource/gnu/classpath/tools/tnameserv/messages.properties:
+ Likewise.
+ * tools/gnu/classpath/tools/orbd/Main.java,
+ tools/gnu/classpath/tools/orbd/Messages.java,
+ tools/gnu/classpath/tools/orbd/PersistentContext.java,
+ tools/gnu/classpath/tools/orbd/PersistentContextMap.java,
+ tools/gnu/classpath/tools/orbd/PersistentMap.java,
+ tools/gnu/classpath/tools/rmic/AbstractMethodGenerator.java,
+ tools/gnu/classpath/tools/rmic/CompilationError.java,
+ tools/gnu/classpath/tools/rmic/Generator.java,
+ tools/gnu/classpath/tools/rmic/GiopIo.java,
+ tools/gnu/classpath/tools/rmic/HashFinder.java,
+ tools/gnu/classpath/tools/rmic/Main.java,
+ tools/gnu/classpath/tools/rmic/Messages.java,
+ tools/gnu/classpath/tools/rmic/MethodGenerator.java,
+ tools/gnu/classpath/tools/rmic/RMICException.java,
+ tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java,
+ tools/gnu/classpath/tools/rmic/RmicBackend.java,
+ tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java,
+ tools/gnu/classpath/tools/rmic/SourceRmicCompiler.java,
+ tools/gnu/classpath/tools/rmic/Variables.java,
+ tools/gnu/classpath/tools/rmic/WrapUnWrapper.java,
+ tools/gnu/classpath/tools/rmic/templates,
+ tools/gnu/classpath/tools/rmid/ActivationSystemImpl.java,
+ tools/gnu/classpath/tools/rmid/ActivationSystemImpl_Stub.java,
+ tools/gnu/classpath/tools/rmid/Main.java,
+ tools/gnu/classpath/tools/rmid/Messages.java,
+ tools/gnu/classpath/tools/rmid/PersistentBidiHashTable.java,
+ tools/gnu/classpath/tools/rmiregistry/Main.java,
+ tools/gnu/classpath/tools/rmiregistry/Messages.java,
+ tools/gnu/classpath/tools/rmiregistry/PersistentHashTable.java,
+ tools/gnu/classpath/tools/rmiregistry/RegistryImpl.java,
+ tools/gnu/classpath/tools/rmiregistry/RegistryImpl_Skel.java,
+ tools/gnu/classpath/tools/rmiregistry/RegistryImpl_Stub.java,
+ tools/gnu/classpath/tools/tnameserv/Main.java,
+ tools/gnu/classpath/tools/tnameserv/Messages.java: New files.
+ * tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java: Import
+ RMIC.java from cp-tools.
+ * configure.ac (AC_CONFIG_FILES): Add tools/grmiregistry,
+ tools/gtnameserv, tools/gorbd, tools/grmid and tools/grmic.
+ (AC_CONFIG_COMMANDS): Add grmiregistry, gtnameserv, gorbd, grmid
+ and grmic.
+ * examples/Makefile.am (GLIBJ_CLASSPATH): Add tools.zip.
+ * gnu/CORBA/NamingService/NamingServiceTransient.java (main):
+ Rename...
+ (start): New method.
+ * tools/Makefile.am: Add build support for new tool wrappers.
+ * tools/gorbd.in: New file.
+ * tools/grmic.in: Likewise.
+ * tools/grmid.in: Likewise.
+ * tools/grmiregistry.in: Likewise.
+ * tools/gtnameserv.in: Likewise.
+ * tools/gnu/classpath/tools/AbstractMethodGenerator.java: Move to...
+ * tools/gnu/classpath/tools/rmic/AbstractMethodGenerator.java: New
+ file.
+ * tools/gnu/classpath/tools/HelpPrinter.java: Remove file.
+ * tools/gnu/classpath/tools/rmi/Persistent.java: Move to...
+ * tools/gnu/classpath/tools/common/Persistent.java: New file.
+
+2006-09-22 Ito Kazumitsu <kaz@maczuka.gcd.org>
+
+ Fixes bug #29047
+ * gnu/java/util/regex/RETokenRepeated.java
+ (findMatch): Rewriten without using recursive calls,
+ (FindMatchControlStack): New class,
+ (FindMatchControl): New class,
+ (TryAnotherResult): New class,
+ (tryAnother): New method.
+
+2006-09-22 Gary Benson <gbenson@redhat.com>
+
+ * java/net/SocketPermission.java
+ (processHostport): Cope with IPv6 addresses with a
+ one-digit first component.
+
+2006-09-22 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/Component.java
+ (enableEvents): Set newEventsOnly flag.
+ * java/awt/Container.java
+ (dispatchEventImpl): Consume event if lightweight dispatcher
+ dispatched the event. Don't call processEvent() here, this
+ is already done in Component.dispatchEventImpl(). For
+ heavyweights or when the lightweight dispatcher could
+ not dispatch, fall back to calling super.
+ (dispatchNoLightweight): New helper method to avoid
+ recursivly calling the lightweight dispatcher.
+ * java/awt/LightweightDispatcher.java
+ (dragButton): Removed field.
+ (dragTarget): Removed field.
+ (mouseEventTarget): New field.
+ (convertPointToChild): Removed method.
+ (dispatchEvent): Don't depend on component beeing
+ a window.
+ (findTarget): Improved algorithm for finding a target.
+ Before we went down to the deepest component and went
+ up again to find a suitable target. Now we go
+ down only once, without going up.
+ (handleMouseEvent): Broke method down into some smaller
+ helper methods.
+ (isDragging): New helper method.
+ (isMouseListening): New helper method.
+ (redispatch): New helper method.
+ (trackEnterExit): New helper method.
+
+2006-09-22 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/SizeSequence.java
+ (getSize): Return 0 if index is out of bounds.
+
+2006-09-21 Tom Tromey <tromey@redhat.com>
+
+ * tools/gnu/classpath/tools/javah/PathOptionGroup.java
+ (PathOptionGroup): Make -I a joined option.
+ * tools/gnu/classpath/tools/keytool/CACertCmd.java: Updated.
+ * tools/gnu/classpath/tools/keytool/CertReqCmd.java: Updated.
+ * tools/gnu/classpath/tools/keytool/DeleteCmd.java: Updated.
+ * tools/gnu/classpath/tools/keytool/ExportCmd.java: Updated.
+ * tools/gnu/classpath/tools/keytool/GenKeyCmd.java: Updated.
+ * tools/gnu/classpath/tools/keytool/IdentityDBCmd.java: Updated.
+ * tools/gnu/classpath/tools/keytool/ImportCmd.java: Updated.
+ * tools/gnu/classpath/tools/keytool/KeyCloneCmd.java: Updated.
+ * tools/gnu/classpath/tools/keytool/KeyPasswdCmd.java: Updated.
+ * tools/gnu/classpath/tools/keytool/ListCmd.java: Updated.
+ * tools/gnu/classpath/tools/keytool/MainCmd.java: Updated.
+ * tools/gnu/classpath/tools/keytool/PrintCertCmd.java: Updated.
+ * tools/gnu/classpath/tools/keytool/SelfCertCmd.java: Updated.
+ * tools/gnu/classpath/tools/keytool/StorePasswdCmd.java: Updated.
+ * tools/gnu/classpath/tools/appletviewer/Main.java: Updated.
+ * tools/gnu/classpath/tools/jar/Main.java: Updated.
+ * tools/gnu/classpath/tools/jarsigner/Main.java: Updated.
+ * tools/gnu/classpath/tools/javah/Main.java: Updated.
+ * tools/gnu/classpath/tools/native2ascii/Main.java: Updated.
+ * tools/gnu/classpath/tools/serialver/SerialVer.java: Updated.
+ * resource/gnu/classpath/tools/getopt/Messages.properties: Removed
+ unused entries.
+ * resource/gnu/classpath/tools/common/Messages.properties: New file.
+ * tools/gnu/classpath/tools/common/Messages.java: New file.
+ * tools/gnu/classpath/tools/getopt/Messages.java: Now package-private.
+ * tools/gnu/classpath/tools/common/ClasspathToolParser.java: Moved
+ from getopt.
+ (ClasspathToolParser): Add -J option here.
+ (ClasspathToolParser): Call other constructor in this class.
+ * tools/gnu/classpath/tools/getopt/Parser.java (handleLongOption):
+ Handle joined options.
+ (handleShortOptions): Likewise.
+ (handleShortOption): Removed.
+ (finalGroup): New field.
+ (Parser): Initialize new field. Don't add -J option.
+ (addFinal): New method.
+ * tools/gnu/classpath/tools/getopt/OptionGroup.java (printHelp): Use
+ isJoined.
+ * tools/gnu/classpath/tools/getopt/Option.java (isJoined): New method.
+ (Option): Check short option for validity.
+ (Option): New constructors.
+ (joined): New field.
+
+2006-09-21 csm <csm@pollux.local>
+
+ * gnu/java/net/PlainDatagramSocketImpl.java (send): ignore
+ `InterruptedIOException;' try again if it gets thrown.
+ (receive): likewise, but re-throw `SocketTimeoutException.'
+ * gnu/java/nio/EpollSelectorImpl.java (doSelect): just return 0
+ if we have nothing to select.
+
+2006-09-21 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/FreetypeGlyphVector.java:
+ (getLogicalBounds): Respect glyph transformations.
+ (getGlyphOutline): Added null pointer check.
+ (getGlyphTransform): Do not generate identity transform (API permits null).
+ (setGlyphPosition): Do not invalidate transform.
+ (setGlyphTransform): Do not modify glyph position.
+
+2006-09-21 Francis Kung <fkung@redhat.com>
+
+ * java/awt/image/ColorModel.java (coerceData): Set alpha premultiplied flag.
+
+2006-09-21 Francis Kung <fkung@redhat.com>
+
+ * java/awt/image/ColorModel.java (coerceData): Return proper colour model.
+ * java/awt/image/ComponentColorModel.java (coerceData): Likewise.
+ * java/awt/image/DirectColorModel.java (coerceData): Likewise.
+
+2006-09-21 Tania Bento <tbento@redhat.com>
+
+ * javax/swing/JTabbedPane.java:
+ (insertTab): Notify ChangeListeners if the tab inserted is selected.
+ (setModel): A ChangeListener should be created only if there does not
+ currently exist one.
+
+2006-09-21 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
+ (MaximizeAction.actionPerformed): Change icon on maxButton.
+
+2006-09-21 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicScrollPaneUI.java
+ (syncScrollPaneWithViewport): Fixed typo (hsb vs. vsb).
+ Use more efficient getViewPosition() and getViewSize() methods
+ to avoid creating a rectangle.
+ (HSBChangeListener.stateChanged): Update the view position
+ unconditionally. Let the Viewport figure out if something
+ changed.
+ (VSBChangeListener.stateChanged): Update the view position
+ unconditionally. Let the Viewport figure out if something
+ changed.
+ * javax/swing/JViewport.java
+ (ViewListener.componentResized): Fire state change, because
+ the extentSize changes.
+ (extentSize): Removed unneeded field.
+ (viewSize): Removed unneeded field.
+ (getExtentSize): Return the viewport's size here.
+ (getViewRect): Reformatted.
+ (getViewSize): Reordered for only one return statement.
+ (paintImmediately2): Fixed up javadoc.
+ (paint): Removed unneeded statement.
+ (setExtentSize): Set viewport size and check for actual change
+ of value.
+ (setViewPosition): Simplified condition. Set scrollUnderway
+ true and don't set isViewSizeSet. Avoid creating one Point
+ object.
+ (setViewSize): Fixed != comparison with equals(). Set scrollUnderway
+ to false.
+ * javax/swing/JScrollBar.java
+ (ScrollBarListener): New class. Forwards change events from
+ the model as adjustment events.
+ (sbChangeListener): New field.
+ (JScrollBar): Install listener on new model.
+ (fireAdjustmentValueChanged(int,int,int)): Delegate to new helper
+ method.
+ (fireAdjustmentValueChanged(int,int,int,boolean)): New helper
+ method to allow custom isAdjusting value.
+ (setMaximum): Only forward to model.
+ (setMinimum): Only forward to model.
+ (setValue): Only forward to model.
+ (setVisibleAmount): Only forward to model.
+ (setValues): Only forward to model.
+ (setModel): Update the change listener.
+
+2006-09-20 Christian Thalinger <twisti@complang.tuwien.ac.at>
+
+ * java/util/Formatter.java (basicIntegralConversion): Removed
+ check for ZERO && !LEFT_JUSTIFY.
+
+2006-09-20 Roman Kennke <kennke@aicas.com>
+
+ PR 29036
+ * javax/swing/plaf/metal/DefaultMetalTheme.java
+ (PLAIN_CONTROL_TEXT_FONT): New constant field.
+ (BOLD_CONTROL_TEXT_FONT): New constant field.
+ (PLAIN_MENU_TEXT_FONT): New constant field.
+ (BOLD_MENU_TEXT_FONT): New constant field.
+ (controlTextFont): Removed.
+ (menuTextFont): Removed.
+ (CONTROL_TEXT_FONT): New constant field.
+ (MENU_TEXT_FONT): New constant field.
+ (getControlTextFont): Use getFont() helper method for fetching
+ the correct font.
+ (getMenuTextFont): Use getFont() helper method for fetching
+ the correct font.
+ (getFont): New helper method.
+ (isBoldMetal): New helper method.
+
+2006-09-20 Casey Marshall <csm@gnu.org>
+
+ * NEWS: mention epoll selector along with the kqueue one.
+
+2006-09-20 Casey Marshall <csm@gnu.org>
+
+ * native/jni/java-nio/gnu_java_nio_EpollSelectorImpl.c
+ (Java_gnu_java_nio_EpollSelectorImpl_epoll_1delete): ignore ENOENT.
+
+2006-09-20 Francis Kung <fkung@redhat.com>
+
+ PR 29011
+ * gnu/java/awt/peer/gtk/FreetypeGlyphVector.java:
+ (getGlyphTransform): Use translation instead of scale.
+ (performDefaultLayout): Increment position values instead of resetting, and
+ pre-increment instead of post-increment.
+ (setGlyphTransform): Handle null case with identity transform.
+
+2006-09-20 Casey Marshall <csm@gnu.org>
+
+ * configure.ac (AC_CHECK_HEADERS): check for `sys/epoll.h.'
+ (AC_CHECK_FUNCS): check for `epoll_create.'
+ * gnu/java/nio/EpollSelectionKeyImpl.java: new file.
+ * gnu/java/nio/EpollSelectorImpl.java: new file.
+ * gnu/java/nio/SelectorProviderImpl.java (epoll_failed): new class
+ field.
+ (openSelector): return epoll selector if requested and available.
+ * include/Makefile.am (H_FILES): add gnu_java_nio_EpollSelectorImpl.h.
+ (gnu_java_nio_EpollSelectorImpl.h): new target.
+ * include/gnu_java_nio_EpollSelectorImpl.h: new file.
+ * native/jni/java-nio/Makefile.am (libjavanio_la_SOURCES): add
+ gnu_java_nio_EpollSelectorImpl.c.
+ * native/jni/java-nio/gnu_java_nio_EpollSelectorImpl.c: new file.
+
+2006-09-20 Casey Marshall <csm@gnu.org>
+
+ * gnu/java/nio/SocketChannelImpl.java (finishConnect): don't
+ call `isConnected.'
+ (isConnected): return false if `connectionPending' is true.
+
+2006-09-20 Francis Kung <fkung@redhat.com>
+
+ PR 29011
+ * gnu/java/awt/peer/gtk/FreetypeGlyphVector.java:
+ (constructor): Expanded glyphPositions array to accomodate Y-coordinates.
+ (getGlyphOutline): Call getGylphTransform to generate transform.
+ (getGylphPosition): Read position directly out of array.
+ (getGlyphPositions): Read positions directly out of array.
+ (getGlyphTransform): Generate transform based on gylphPositions array.
+ (performDefaultLayout): Populate glyphPositions array instead of transforms.
+ (setGlyphPosition): Set position directly into array.
+ (setGlyphTransform): Update positions array as well.
+
+2006-09-20 David Daney <ddaney@avtrex.com>
+
+ PR classpath/28661
+ * gnu/java/net/protocol/http/HTTPURLConnection.java (connect): Add
+ default content-type for POST method.
+
+2006-09-20 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/plaf/basic/BasicRadioButtonUI.java
+ (BasicRadioButtonUI): Don't fetch icon here,
+ (installDefaults): Initialise icon here,
+ (getDefaultIcon): Just return icon.
+
+2006-09-20 Mark Wielaard <mark@klomp.org>
+
+ * native/jni/java-nio/Makefile.am (libjavanio_la_SOURCES):
+ Add gnu_java_nio_channels_FileChannelImpl.c and javanio.h.
+ (EXTRA_DIST): Include javanio.c.
+
+2006-09-20 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/awt/geom/RoundRectangle2D.java:
+ (getPathIterator): Reimplemented,
+ and updated various API doc comments.
+
+2006-09-20 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/Container.java
+ (addImpl): Set the new component's parent after it has been
+ added to the array. Call addNotify() and invalidate()
+ after the component has been added, so that the peer
+ gets to know about the component structure when it is created.
+ * java/awt/Window.java
+ (dispatchEventImpl): Only revalidate when window is resized,
+ let the other stuff be processed by the superclass.
+ (dispose): Post WINDOW_CLOSED event only when some listener
+ is registered or event is explicitly enabled.
+ (show): Post WINDOW_OPENED event when appropriate.
+
+2006-09-20 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/Component.java
+ (addNotify): Invalidate here. Fetch peer font.
+ (getFont): Delegate to helper method, to protect from
+ overriding client code. Lock the tree while fetching the font.
+ (getFontImpl): New helper method. Moved code from getFont() in
+ here.
+ (removeNotify): Nullify peerFont too.
+ (setFont): Synchronize on tree and component to avoid threading
+ issues. Update the peerFont correctly.
+ (validate): Update the peer font if necessary, before validating.
+ (getGraphics): Revert to recursive graphics fetching.
+ Set component font on the Graphics object.
+ (translateEvent): Removed unnecessary cast.
+ * java/awt/Container.java
+ (invalidateTree): Made final and private. Made implementation
+ slightly more efficient.
+ (setFont): Get old and new font via getFont() to account for
+ the real font, and only invalidate the tree when they are not
+ the same and not equal.
+ (visitChild): Set the font of the child on the component graphics.
+ * java/awt/Frame.java
+ (setMenuBar): Create local reference of peer for thread safety.
+ Only call simple invalidate, not invalidateTree().
+
+2006-09-19 Cameron McCormack <cam@mcc.id.au>
+
+ PR 29012
+ * gnu/java/awt/peer/gtk/BufferedImageGraphics.java:
+ (constructor): Copy image field.
+
+2006-09-19 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/JMenuBar.java
+ (getHelpMenu): Implemented to throw an Error, and added API docs,
+ (getMargin): Added API docs,
+ (setMargin): Likewise.
+
+2006-09-19 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/AbstractButton.java
+ (AbstractButton): Don't call updateUI(),
+ * javax/swing/JButton.java
+ (JButton(String, Icon)): Call setModel() before init(),
+ * javax/swing/JMenuItem.java
+ (JMenuItem()): Delegate to another constructor,
+ (JMenuItem(Icon)): Likewise,
+ (JMenuItem(Action)): Set model,
+ (JMenuItem(String, Icon)): Likewise,
+ * javax/swing/JToggleButton.java
+ (init): Call setModel() before init().
+
+2006-09-19 Mark Wielaard <mark@klomp.org>
+
+ Fixes bug #29137
+ * java/util/logging/LogManager.java (addLogger): Always check for
+ existing children of a new Logger.
+
+2006-09-19 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicScrollPaneUI.java
+ (HSBChangeListener.stateChanged): Moved handling of header to
+ syncScrollPaneWithViewport().
+ (VSBChangeListener.stateChanged): Moved handling of header to
+ syncScrollPaneWithViewport().
+ (ViewportChangedHandler.stateChanged): Removed unused statements.
+ (syncScrollPaneWithViewport): Added null checks. Use setValues
+ rather then the single setter methods to avoid multiple
+ adjustments and side effects. Also snyc the headers here.
+ (updateScrollBarDisplayPolicy): Revalidate and repaint here.
+ (uninstallUI): Removed unnecessary cast and this qualifier as well
+ as the call to super.
+
+2006-09-19 Gary Benson <gbenson@redhat.com>
+
+ * java/net/ResolverCache.java: New class (a DNS cache).
+ * java/net/InetAddress.java
+ (internalGetCanonicalHostName, getAllByName): Use the above.
+
+2006-09-19 Jeroen Frijters <jeroen@frijters.net>
+
+ * gnu/java/nio/SocketChannelImpl.java: Removed unused import.
+ * java/net/ServerSocket.java
+ (port): New field.
+ (bind): Set port field.
+ (close): Set impl to null.
+ (isClosed): Check impl and channel instead of using VMChannel.
+ (toString): Use port field and getLocalPort() method.
+ * java/net/Socket.java
+ (isClosed): Check impl and channel instead of using VMChannel.
+
+2006-09-18 Tom Tromey <tromey@redhat.com>
+
+ * java/util/concurrent/CopyOnWriteArrayList.java
+ (CopyOnWriteArrayList): New constructor.
+
+2006-09-18 Casey Marshall <csm@gnu.org>
+
+ * native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c
+ (Java_gnu_java_net_VMPlainSocketImpl_listen): remove debug printf.
+
+2006-09-18 Tom Tromey <tromey@redhat.com>
+
+ * gnu/javax/net/ssl/provider/SSLSocket.java (isBound, isClosed,
+ isConnected): Removed old comment.
+ (getRemoteSocketAddress): Uncommented.
+ (setOOBInline, getOOBInline, setKeepAlive, getKeepAlive,
+ setTrafficClass, getTrafficClass, setReuseAddress,
+ getReuseAddress, shutdownInput, shutdownOutput, isInputShutdown,
+ isOutputShutdown): Uncommented.
+
+2006-09-18 David Pirkle <dpirkle@symyx.com>
+
+ Fixes PR 28589
+ * gnu/xml/transform/XSLURIResolver.java: Test SAXSource for specific
+ input stream during resolution.
+
+2006-09-18 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/LightweightDispatcher.java
+ (findTarget): Correctly translate child coordinates.
+ Use Component.eventTypeEnabled() for checking if a component
+ has a certain event enabled.
+ (handleMouseEvent): Find the correct mouse event target.
+ Use Component.eventTypeEnabled() for checking if a component
+ has a certain event enabled.
+
+2006-09-18 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/Component.java
+ (show): Test for the peer beeing lightweight directly.
+ (paintAll): Validate before painting. Don't paint when not
+ showing. Call peer.paint() when the component is heavyweight.
+ (repaint): Delegate to the parent when lightweight, rather
+ than skipping to the nearest heavyweight.
+ (createImage): Added null check to prevent NPE.
+ (dispatchEvent): Moved old event dispatching and toolkit
+ event dispatching to dispatchEventImpl.
+ (addComponentListener): Don't enable event. Only add listener
+ when not null. Switch to new event dispatching only.
+ (addFocusListener): Likewise.
+ (addHierarchyListener): Likewise.
+ (addHierarchyBoundsListener): Likewise.
+ (addKeyListener): Likewise.
+ (addMouseListener): Likewise.
+ (addMouseMotionListener): Likewise.
+ (addMouseWheelListener): Likewise.
+ (addInputMethodListener): Likewise.
+ (coalesceEvents): For mouse events coalesce them only when
+ their modifiers are equal. For paint events coalesce the events
+ when one contains the other, without going through complicated
+ heuristics.
+ (dispatchEventImpl): Moved old event dispatching and toolkit
+ event dispatching to dispatchEventImpl.
+ (coalescePaintEvents): Removed.
+ (HeavyweightInLightweightListener.componentHidden):
+ Fixed condition.
+ * java/awt/Container.java
+ (addImpl): Don't enable events on lightweights.
+ (remove): Reordered operations. Don't remove any listeners.
+ Throw ArrayIndexOutOfBoundsException when index >= ncomponents.
+ Only removeNotify() when peer is != null. Only invalidate if
+ not already invalid. Only fire ContainerEvent if there is
+ an interested listener or the event is enabled. Dispatch this
+ event directly without the event queue.
+ (removeAll): Likewise.
+ (paintComponents): Only paint when showing. Also paint heavyweights.
+ Don't paint the container itself.
+ (removeNotify): Create local variables for improved thread safety.
+ (addNotifyContainerChildren): Don't enable events for lightweights.
+
+2006-09-18 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/EventQueue.java
+ (INITIAL_QUEUE_DEPTH): Removed obsolete field.
+ (next_in): Removed obsolete field.
+ (next_out): Removed obsolete field.
+ (queueHead): New field. Markes the head of the queue.
+ (queueTail): New field. Markes the tail of the queue.
+ (queue): Removed obsolete field.
+ (EventQueue): Documented empty block.
+ (getNextEvent): Changed array based implementation to single-linked
+ list based implementation.
+ (invokeAndWait): Use an Object as synchronization object rather
+ than the current thread.
+ (peekEvent(int)): Changed array based implementation to single-linked
+ list based implementation.
+ (peekEvent()): Changed array based implementation to single-linked
+ list based implementation.
+ (pop()): Changed array based implementation to single-linked
+ list based implementation.
+ (postEvent): Foward to postEventImpl.
+ (postEventImpl): Changed array based implementation to single-linked
+ list based implementation.
+ (push): Changed array based implementation to single-linked
+ list based implementation.
+ * java/awt/AWTEvent.java
+ (queueNext): New field. Implements a single-linked list for
+ the EventQueue.
+
+2006-09-17 Mark Wielaard <mark@klomp.org>
+
+ * javax/swing/text/html/HTMLEditorKit (getStyleSheet): Load
+ resource from HTMLEditorKit.class.
+
+2006-09-17 Mark Wielaard <mark@klomp.org>
+
+ * javax/swing/plaf/basic/BasicToolBarUI.java
+ (setBorderToNonRollover): Check whether border is null.
+ (setBorderToRollover): Likewise.
+
+2006-09-17 Mark Wielaard <mark@klomp.org>
+
+ * javax/swing/JTree.java (setLeadSelectionPath): Handle null path.
+
+2006-09-17 Mark Wielaard <mark@klomp.org>
+
+ * native/jni/java-nio/javanio.c (cpnio_fcntl): Last argument is long.
+ * native/jni/java-nio/javanio.h (cpnio_fcntl): Likewise.
+ * native/jni/java-nio/gnu_java_nio_VMChannel.c
+ (Java_gnu_java_nio_VMChannel_lock): Likewise.
+ (Java_gnu_java_nio_VMChannel_unlock): Likewise.
+
+2006-09-17 Casey Marshall <csm@gnu.org>
+
+ * native/jni/classpath/jcl.c (JNI_OnLoad): mark `reserved' as
+ unused.
+
+2006-09-17 Chris Burdess <dog@gnu.org>
+
+ Fixes PR 27610 27687.
+ * gnu/xml/dom/ls/SAXEventSink.java: Permit limited subclassing.
+ * gnu/xml/transform/SAXTemplatesHandler.java,
+ * gnu/xml/transform/SAXTransformerHandler.java: New files.
+ * gnu/xml/transform/TransformerFactoryImpl.java: Implement
+ SAXTransformerFactory.
+
+2006-09-16 Casey Marshall <csm@gnu.org>
+
+ * NEWS: updated.
+ * configure.ac (AC_CHECK_HEADERS): check for `sys/event.h'.
+ (AC_CHECK_FUNCS): add checks for readv, writev, getifaddrs,
+ kqueue, and kevent.
+ (HAVE_INET6): define if IPv6 is supported.
+ * gnu/java/net/PlainDatagramSocketImpl.java (channel): new field.
+ (native_fd): removed.
+ (impl): new field.
+ (<init>): throw IOException; initialize fields.
+ (finalize): removed.
+ (getNativeFD): removed.
+ (bind): use `PlainSocketImpl.bind.'
+ (create): use `PlainSocketImpl.initSocket.'
+ (disconnect): use `PlainSocketImpl.disconnect.'
+ (getLocalPort): new method.
+ (send): use `VMChannel.send.'
+ (receive): use `VMChannel.receive.'
+ (setOption): use `PlainSocketImpl.setOption.'
+ (getOption): use `PlainSocketImpl.getOption.'
+ (close): use `VMChannel.State.close.'
+ (join): use `PlainSocketImpl.join.'
+ (leave): use `PlainSocketImpl.leave.'
+ (joinGroup, leaveGroup): implemented.
+ * gnu/java/net/PlainSocketImpl.java: make non-final.
+ (native_fd): removed.
+ (impl): new field.
+ (channel): new field.
+ (<init>): initialize `impl.'
+ (finalize, getNativeFD): removed.
+ (setOption): use `PlainSocketImpl.setOption.'
+ (getOption): use `PlainSocketImpl.getOption.'
+ (shutdownInput): use `PlainSocketImpl.shutdownInput.'
+ (shutdownOutput): use `PlainSocketImpl.shutdownOutput.'
+ (create): create `channel,' initialize `impl's native state.
+ (connect): use `connect(SocketAddress, int).'
+ (connect): use `SocketChannelImpl.connect;' initialize `address'
+ and `port.'
+ (bind): use `VMPlainSocketImpl.bind.'
+ (listen): use `VMPlainSocketImpl.listen.'
+ (accept): use `SocketChannelImpl.accept.'
+ (available): use `VMChannel.available.'
+ (close): use `PlainSocketImpl.close.'
+ (sendUrgentData): use `PlainSocketImpl.sendUrgentData.'
+ (getVMChannel, getInetAddress, getLocalPort, getLocalAddress,
+ getPort): new methods.
+ (SocketInputStream.read): use `VMChannel.read.'
+ (SocketInputStream.read): use `SocketChannel.read.'
+ (SocketOutputStream.write): use `VMChannel.write.'
+ (SocketOutputStream.write): use `SocketChannel.write.'
+ * gnu/java/nio/DatagramChannelImpl.java: implement VMChannel.
+ (channel): new field.
+ (<init>): initialize `channel.'
+ (implCloseSelectableChannel): use `VMChannel.close.'
+ (implConfigureBlocking): use `VMChannel.setBlocking.'
+ (connect): use `VMChannel.connect.'
+ (disconnect): use `VMChannel.disconnect.'
+ (isConnected): use `VMChannel.getPeerAddress.'
+ (write): use `VMChannel.write.'
+ (write): use `VMChannel.writeGathering.'
+ (read): use `VMChannel.read.'
+ (read): use `VMChannel.readScattering.'
+ (receive): use `VMChannel.receive.'
+ (send): use `VMChannel.send.'
+ (getVMChannel): new method.
+ * gnu/java/nio/DatagramChannelSelectionKey.java (getNativeFD):
+ access native FD through VMChannel.State.
+ * gnu/java/nio/FileChannelImpl.java: moved from
+ gnu/java/nio/channels/FileChannelImpl.java.
+ * gnu/java/nio/FileLockImpl.java: fix imports.
+ * gnu/java/nio/KqueueSelectionKeyImpl.java: new file.
+ * gnu/java/nio/KqueueSelectorImpl.java: new file.
+ * gnu/java/nio/NIOSocket.java (impl): removed.
+ (channel): new field.
+ (<init>): init superclass with a `NIOSocketImpl;' init `channel.'
+ (getPlainSocketImpl, setChannel): removed.
+ (isConnected): new method.
+ * gnu/java/nio/NIOSocketImpl.java: new file.
+ * gnu/java/nio/PipeImpl.java (SourceChannelImpl): implement
+ `VMChannelOwner.'
+ (SourceChannelImpl.native_fd): removed.
+ (SourceChannelImpl.<init>): init with a `VMChannel.'
+ (SourceChannelImpl.getNativeFD): removed.
+ (SourceChannelImpl.getVMChannel): new method.
+ (SourceChannelImpl.implCloseSelectableChannel): implement.
+ (SinkChannelImpl): implement `VMChannelOwner.'
+ (SinkChannelImpl.native_fd): removed.
+ (SinkChannelImpl.<init>): init with a `VMChannel.'
+ (SinkChannelImpl.implCloseSelectableChannel): implement.
+ (SinkChannelImpl.getNativeFD): removed.
+ (SinkChannelImpl.getVMChannel): new method.
+ * gnu/java/nio/SelectionKeyImpl.java (getNativeFD): mark
+ deprecated.
+ * gnu/java/nio/SelectorProviderImpl.java (SELECTOR_IMPL_KQUEUE,
+ SELECTOR_IMPL_EPOLL, SELECTOR_IMPL): new constants.
+ (openSelector): return kqueue selector if available.
+ * gnu/java/nio/ServerSocketChannelImpl.java: implement
+ `VMChannelOwner.'
+ (channel): new field.
+ (<init>): init `channel.'
+ (finalizer): check if the `VMChannel.State' is valid.
+ (implCloseSelectableChannel): use `VMChannel.close.'
+ (implConfigureBlocking): use `VMChannel.setBlocking.'
+ (accept): use `VMChannel.accept.'
+ (getVMChannel): new method.
+ * gnu/java/nio/ServerSocketChannelSelectionKey.java (getNativeFD):
+ access native FD through `VMChannel.State.'
+ * gnu/java/nio/SocketChannelImpl.java: implement `VMChannelOwner.'
+ (impl): removed.
+ (channel, connected, connectAddress): new field.
+ (<init>): new constructors.
+ (getPlainSocketImpl): removed.
+ (implCloseSelectableChannel): use `VMChannel.close.'
+ (implConfigureBlocking): use `VMChannel.setBlocking.'
+ (connect): use `connect(SocketAddress,int).'
+ (connect): use `VMChannel.connect.'
+ (finishConnect): don't use a selector.
+ (isConnected): use `VMChannel.getPeerAddress.'
+ (read): use `VMChannel.read.'
+ (read): use `VMChannel.readScattering.'
+ (write): use `VMChannel.write.'
+ (write): use `VMChannel.writeGathering.'
+ (getVMChannel): new method.
+ * gnu/java/nio/SocketChannelSelectionKey.java (getNativeFD): get
+ native FD from `VMChannel.State.'
+ * gnu/java/nio/SocketChannelSelectionKeyImpl.java (getNativeFD):
+ get native FD from `VMChannel.State.'
+ * gnu/java/nio/VMChannelOwner.java: new file.
+ * gnu/java/nio/channels/FileChannelImpl.java: removed.
+ * include/Makefile.am: generate `gnu_java_nio_FileChannelImpl.h'
+ and `gnu_java_nio_KqueueSelectorImpl.h;' don't generate
+ `gnu_java_nio_channels_FileChannelImpl.h.'
+ * include/gnu_java_net_VMPlainSocketImpl.h: regenerated.
+ * include/gnu_java_nio_FileChannelImpl.h: new file.
+ * include/gnu_java_nio_KqueueSelectorImpl.h: new file.
+ * include/gnu_java_nio_VMChannel.h: regenerated.
+ * include/gnu_java_nio_VMPipe.h: regenerated.
+ * include/java_net_VMNetworkInterface.h: regenerated.
+ * java/io/FileDescriptor.java: fix imports.
+ * java/io/FileInputStream.java (<init>): handle exceptions.
+ (read): wrap the destination arary.
+ * java/io/FileOutputStream.java (<init>): handle exceptions.
+ (write): wrap the source array.
+ * java/io/RandomAccessFile.java (<init>): handle exceptions.
+ * java/net/DatagramSocket.java (<init>): handle exceptions.
+ (receive): handle length/port setting.
+ (connect): bind to any address/port if the argument is null.
+ * java/net/NetworkInterface.java (name, inetAddress): removed.
+ (netif): new field.
+ (<init>): make private.
+ (getName): return `netif.name.'
+ (getInetAddresses): access `netif.addresses.'
+ (getDisplayName): return `netif.name.'
+ (getByName, getByAddress): handle changes to `VMNetworkInterface.'
+ (condense): removed.
+ (getNetworkInterfaces): handle changes to `VMNetworkInterface.'
+ (equals): compare `netif' fields.
+ (hashCode): get hash codes from `netif.'
+ (toString): use a StringBuffer.
+ * java/net/ServerSocket.java (close): don't set `impl' to null.
+ (isClosed): use `VMChannel.State.isClosed.'
+ * java/net/Socket.java (getLocalAddress): don't use `getOption' if
+ the `SocketImpl' is a `PlainSocketImpl.'
+ (close): just close the `impl.'
+ (toString): use `super.toString' in the value we return.
+ (isConnected): just access `impl,' not `getImpl.'
+ (isBound): use `PlainSocketImpl' methods if we can.
+ (isClosed): look at `VMChannel.State.'
+ * native/jni/classpath/jcl.c (JNI_OnLoad): new function.
+ (JCL_NewRawDataObject): don't initialize cached fields here; throw
+ an exception if they were not.
+ (JCL_GetRawData): throw an exception if cached fields weren't
+ created.
+ * native/jni/java-lang/java_lang_VMProcess.c: handle
+ FileChannelImpl move.
+ * native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c
+ (IO_EXCEPTION, SOCKET_EXCEPTION, BIND_EXCEPTION,
+ THROW_NO_NETWORK): new macros.
+ (Java_gnu_java_net_VMPlainSocketImpl_bind): reipmlemented.
+ (Java_gnu_java_net_VMPlainSocketImpl_bind6): new function.
+ (Java_gnu_java_net_VMPlainSocketImpl_listen): reimplemented.
+ (java_sockopt): new enum.
+ (Java_gnu_java_net_VMPlainSocketImpl_setOption): reimplemented.
+ (Java_gnu_java_net_VMPlainSocketImpl_getOption): reimplemented.
+ (Java_gnu_java_net_VMPlainSocketImpl_shutdownInput):
+ reimplemented.
+ (Java_gnu_java_net_VMPlainSocketImpl_shutdownOutput):
+ reimplemented.
+ (Java_gnu_java_net_VMPlainSocketImpl_sendUrgentData): new
+ function.
+ (Java_gnu_java_net_VMPlainSocketImpl_join): new function.
+ (Java_gnu_java_net_VMPlainSocketImpl_join6): new function.
+ (Java_gnu_java_net_VMPlainSocketImpl_read): removed.
+ (Java_gnu_java_net_VMPlainSocketImpl_leave): new function.
+ (Java_gnu_java_net_VMPlainSocketImpl_leave6): new function.
+ (Java_gnu_java_net_VMPlainSocketImpl_joinGroup): new function.
+ (Java_gnu_java_net_VMPlainSocketImpl_write): removed.
+ (Java_gnu_java_net_VMPlainSocketImpl_joinGroup6): new function.
+ (Java_gnu_java_net_VMPlainSocketImpl_leaveGroup): new function.
+ (Java_gnu_java_net_VMPlainSocketImpl_leaveGroup6): new function.
+ (getif_address): new function.
+ (getif_index): new function.
+ * native/jni/java-net/java_net_VMNetworkInterface.c
+ (java_net_VMNetworkInterface_init,
+ java_net_VMNetworkInterface_addAddress): new file-scope globals.
+ (Java_java_net_VMNetworkInterface_initIds): new function.
+ (struct netif_entry): new struct.
+ (free_netif_list): new function.
+ (Java_java_net_VMNetworkInterface_getInterfaces): removed.
+ (Java_java_net_VMNetworkInterface_getVMInterfaces): new function.
+ * native/jni/java-nio/Makefile.am (libjavanio_la_SOURCES): remove
+ gnu_java_nio_channels_FileChannelImpl.c, add
+ gnu_java_nio_KqueueSelectorImpl.c.
+ * native/jni/java-nio/gnu_java_nio_KqueueSelectorImpl.c: new file.
+ * native/jni/java-nio/gnu_java_nio_VMChannel.c
+ (INTERRUPTED_IO_EXCEPTION, SOCKET_TIMEOUT_EXCEPTION, ALIGN_UP,
+ ALIGN_DOWN): new macros.
+ (JCL_init_buffer): get the address through GetDirectBufferAddress
+ if possible.
+ (Java_gnu_java_nio_VMChannel_stdin_1fd,
+ Java_gnu_java_nio_VMChannel_stdout_1fd,
+ Java_gnu_java_nio_VMChannel_stderr_1fd): new functions.
+ (Java_gnu_java_nio_VMChannel_setBlocking): fix setting blocking
+ value.
+ (Java_gnu_java_nio_VMChannel_read): renamed...
+ (Java_gnu_java_nio_VMChannel_read__ILjava_nio_ByteBuffer_2): to
+ this; handle interrupted IO; add HAVE_READ check.
+ (Java_gnu_java_nio_VMChannel_write): renamed...
+ (Java_gnu_java_nio_VMChannel_write__ILjava_nio_ByteBuffer_2): to
+ this; handle zero-length write; add HAVE_WRITE check.
+ (Java_gnu_java_nio_VMChannel_receive): new function.
+ (Java_gnu_java_nio_VMChannel_send): new function.
+ (Java_gnu_java_nio_VMChannel_send6): new function.
+ (Java_gnu_java_nio_VMChannel_read__I): new function.
+ (Java_gnu_java_nio_VMChannel_write__II): new function.
+ (Java_gnu_java_nio_VMChannel_socket): new function.
+ (Java_gnu_java_nio_VMChannel_connect): new function.
+ (Java_gnu_java_nio_VMChannel_connect6): new function.
+ (Java_gnu_java_nio_VMChannel_getsockname): new function.
+ (Java_gnu_java_nio_VMChannel_getpeername): new function.
+ (Java_gnu_java_nio_VMChannel_accept): new function.
+ (Java_gnu_java_nio_VMChannel_disconnect): new function.
+ (Java_gnu_java_nio_VMChannel_close): new function.
+ (Java_gnu_java_nio_VMChannel_available): new function.
+ (FileChannel_mode): new enum.
+ (Java_gnu_java_nio_VMChannel_open): new function.
+ (Java_gnu_java_nio_VMChannel_position): new function.
+ (Java_gnu_java_nio_VMChannel_seek): new function.
+ (Java_gnu_java_nio_VMChannel_truncate): new funciton.
+ (Java_gnu_java_nio_VMChannel_lock): new function.
+ (Java_gnu_java_nio_VMChannel_unlock): new function.
+ (Java_gnu_java_nio_VMChannel_size): new function.
+ (Java_gnu_java_nio_VMChannel_map): new function.
+ (Java_gnu_java_nio_VMChannel_flush): new function.
+ * native/jni/java-nio/gnu_java_nio_VMPipe.c
+ (Java_gnu_java_nio_VMPipe_init): removed.
+ (Java_gnu_java_nio_VMPipe_pipe0): new function.
+ * native/jni/java-nio/javanio.c: new file.
+ * native/jni/java-nio/javanio.h: new file.
+ * native/jni/native-lib/cpnet.c (cpnet_getHostByName): fix for
+ systems without `gethostbyname_r.'
+ * vm/reference/gnu/java/net/VMPlainSocketImpl.java (nfd): new
+ field.
+ (<init>, <init>): new constructors.
+ (setOption, getOption): make instance methods; defer to native
+ implementation.
+ (connect): removed.
+ (bind): make an instance method; defer to native methods.
+ (accept): removed.
+ (available): removed.
+ (listen): make an instance method; defer to native method.
+ (read): removed.
+ (join, leave): new methods.
+ (write): removed.
+ (joinGroup, leaveGroup): new methods.
+ (shutdownInput, shutdownOutput): make instance methods.
+ (sendUrgentData): removed.
+ (State): new class.
+ * vm/reference/gnu/java/nio/VMChannel.java: make final.
+ (fd): removed.
+ (nfd): new field.
+ (<init>): new, public constructors.
+ (getVMChannel): methods removed.
+ (getState, getStdin, getStdout, getStderr, stdin_fd, stdout_fd,
+ stderr_fd): new methods.
+ (setBlocking): make an instance method.
+ (available): new method.
+ (read): get native fd from `nfd.'
+ (read): new single-byte read method.
+ (readScattering): get native fd from `nfd.'
+ (receive): new method.
+ (write, writeGathering): get native fd from `nfd.'
+ (send): new method.
+ (write): new single-byte write method.
+ (initSocket): new method.
+ (connect): new method.
+ (disconnect): new method.
+ (getLocalAddress): new method.
+ (getPeerAddress): new method.
+ (accept): new method.
+ (openFile): new method.
+ (position): new method.
+ (seek): new method.
+ (truncate): new method.
+ (lock): new method.
+ (unlock): new method.
+ (size): new method.
+ (map): new method.
+ (flush): new method.
+ (close): new method.
+ (State): new class.
+ (Kind): new class.
+ * vm/reference/gnu/java/nio/VMPipe.java (init): removed.
+ (pipe, pipe0): new method.
+ * vm/reference/java/net/VMNetworkInterface.java (name, addresses):
+ new fields.
+ (<clinit>): call `initIds.'
+ (initIds): new method.
+ (getInterfaces): removed.
+ (getVMInterfaces): new method.
+ (addAddress): new method.
+ * vm/reference/java/nio/channels/VMChannels.java: fix imports.
+
+2006-09-16 Chris Burdess <dog@gnu.org>
+
+ Fixes PR 28572.
+ * gnu/xml/transform/StreamSerializer.java: Don't escape XML entities
+ when in text output mode.
+
+2006-09-16 Chris Burdess <dog@gnu.org>
+
+ Fixes PR 27293.
+ * gnu/xml/dom/DomNode.java: Increment length of node during insert.
+
+2006-09-14 Michael Koch <konqueror@gmx.de>
+
+ * include/gnu_java_awt_peer_gtk_CairoGraphics2D.h: Recreated.
+
+2006-09-15 Chistian Elias Naur <elias@oddlabs.com>
+
+ * java/io/ObjectStreamClass.java (setClass(Class, ObjectStreamClass)):
+ Added !cl.isArray() to serialVersionUID mismatch check.
+
+2006-09-14 Francis Kung <fkung@redhat.com>
+
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
+ (gnu_java_awt_peer_gtk_CairoGraphics2D_setGradient): Updated constants to
+ be compatibe with Cairo 1.2.x.
+
+2006-09-14 Francis Kung <fkung@redhat.com>
+
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java: Added interpolation constants.
+ (cairoSurfaceSetFilter): Removed method.
+ (drawImage): Pass interpolation type as argument to drawing methods.
+ (drawPixels): Added interpolation parameter.
+ (drawRaster): Pass interpolation type as argument to drawing method.
+ (getInterpolation): New method.
+ (setRenderingHint): Store hints, but do not set interpolation in cairo.
+ (setRenderingHints): Store hints, but do not set interpolation in cairo.
+ * gnu/java/awt/peer/gtk/CairoSurface.java
+ (drawSurface): Added interpolation parameter.
+ (nativeDrawSurface): Added interpolation parameter.
+ * include/gnu_java_awt_peer_gtk_CairoGraphics2D.h
+ (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_drawPixels): Added interpolation
+ parameter.
+ (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSurfaceSetFilter): Removed.
+ * native/jni/gtk-peer/cairographics2d.h
+ (java_awt_rendering_hints_filter): Added bicubic interpolation constant.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
+ (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_drawPixels): Added interpolation
+ parameter.
+ (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSurfaceSetFilter): Removed.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c
+ (Java_gnu_java_awt_peer_gtk_CairoSurface_nativeDrawSurface): Added
+ interpolation parameter.
+
+2006-09-14 Gary Benson <gbenson@redhat.com>
+
+ * java/net/InetAddress.java
+ (internalGetCanonicalHostName): New method.
+ (getCanonicalHostName): Use internalGetCanonicalHostName.
+ (getByLiteral): New method.
+ (getAllByName): Use getByLiteral.
+ * java/net/SocketPermission.java
+ (host): Replaced with...
+ (hostname, address): New fields.
+ (equals, hashcode): Reflect the above.
+ (setHostPort): Parse host into hostname or address.
+ (implies): Rewrite host checks.
+
+2006-09-14 David Gilbert <david.gilbert@object-refinery.com>
+
+ Fixes PR28699
+ * java/awt/Menu.java
+ (insert(MenuItem, int)): Fixed loop range,
+ (insert(String, int)): Updated API docs.
+
+2006-09-14 Christian Thalinger <twisti@complang.tuwien.ac.at>
+
+ Fixes PR22800
+ * native/fdlibm/mprec.h (Storeinc): Define correctly for LE
+ architectures (like Arm).
+ * native/jni/java-lang/java_lang_VMDouble.c (doubleToLongBits):
+ Reverted SWAP_DOUBLE patch.
+ (doubleToRawLongBits): Likewise.
+ (longBitsToDouble): Likewise.
+
+2006-09-14 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/awt/Menu.java: Reformatted source file.
+
+2006-09-14 Jeroen Frijters <jeroen@frijters.net>
+
+ * gnu/java/rmi/server/ActivatableRef.java
+ (readExternal, writeExternal): Partial fix for serialization format.
+
+2006-09-14 Jeroen Frijters <jeroen@frijters.net>
+
+ PR classpath/28984
+ * java/io/InputStreamReader.java
+ (read(char[],int,int)): Fixed bug.
+
+2006-09-13 Francis Kung <fkung@redhat.com>
+
+ * java/awt/image/BandCombineOp.java: Updated documentation.
+ (filter(Raster, WritableRaster)): Use int arrays, and added simple cache.
+
+2006-09-13 Tom Tromey <tromey@redhat.com>
+
+ PR classpath/29034:
+ * java/io/PipedReader.java (read): Return early if len==0.
+ * java/io/PipedInputStream.java (read): Return early if len==0.
+
+2006-09-13 Francis Kung <fkung@redhat.com>
+
+ * java/awt/image/ConvolveOp.java (filter(Raster, WritableRaster)):
+ Removed hard-coded max sample value.
+ * java/awt/image/RescaleOp.java (filter(Raster, WritableRaster)):
+ Fixed finding of max sample value.
+
+2006-09-12 David Gilbert <david.gilbert@object-refinery.com>
+
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (setPaint): Check null argument ('p').
+
+2006-09-12 Francis Kung <fkung@redhat.com>
+
+ PR 27940
+ * gnu/java/awt/java2d/TexturePaintContext.java
+ (constructor): Fixed typo, getMinY instead of getMaxX.
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (setPaint): Implemented support for custom Paint classes.
+ (setPaintPixels): Renamed from setTexturePixels, added repeat parameter.
+ (setTexturePixels): Renamed to setPaintPixels, added repeat parameter.
+ * include/gnu_java_awt_peer_gtk_CairoGraphics2D.h: Renamed setTexturePixels
+ to setPaintPixels, and added repeat parameter.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c:
+ Renamed setTexturePixels to setPaintPixels, and added repeat parameter.
+
+2006-09-12 Gary Benson <gbenson@redhat.com>
+
+ * java/net/NetworkInterface.java (getInetAddresses):
+ Fix port used in security check.
+
+2006-09-12 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/plaf/metal/DefaultMetalTheme.java
+ (CONTROL_TEXT_FONT): Renamed 'controlTextFont',
+ (MENU_TEXT_FONT): Renamed 'menuTextFont',
+ (getControlTextFont): Check 'swing.boldMetal' setting before
+ initialising font,
+ (getMenuTextFont): Likewise.
+
+2006-09-12 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/plaf/metal/OceanTheme.java
+ (addCustomEntriesToTable): Added 'List.focusCellHighlightBorder' entry.
+
+2006-09-12 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/plaf/metal/MetalIconFactory.java
+ (InternalFrameDefaultMenuIcon.paintIcon): Use theme colors.
+
+2006-09-12 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/AbstractSpinnerModel.java: API doc updates.
+
+2006-09-12 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/AbstractButton.java
+ (AbstractButton): Initialise textIconGap field.
+
+2006-09-11 Tom Tromey <tromey@redhat.com>
+
+ * tools/gnu/classpath/tools/javah/FieldHelper.java (print): Print
+ "volatile" when needed.
+
+2006-09-11 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/text/AttributedCharacterIterator.java
+ (LANGUAGE): Initialise with lower case string,
+ (INPUT_METHOD_SEGMENT): Likewise,
+ (READING): Likewise,
+ * java/text/AttributedStringIterator.java
+ (getRunLimit): Check all attributes for changes.
+
+2006-09-11 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/text/AttributedCharacterIterator.java: Added @since tag,
+ renamed some variables (no underscores) and removed some spaces to
+ match the common style,
+ * java/text/AttributedString.java: Likewise,
+ * java/text/AttributedStringIterator.java: Likewise.
+
+2006-09-11 Gary Benson <gbenson@redhat.com>
+
+ * java/net/Inet4Address.java
+ (FAMILY): Renamed back to AF_INET.
+ (<init>, writeReplace): Reflect the above.
+ * java/net/Inet6Address.java
+ (FAMILY): Renamed back to AF_INET6.
+ (<init>): Reflect the above.
+
+2006-09-11 Cameron McCormack <cam-gcc-bugzilla@aka.mcc.id.au>
+
+ Fixes PR29010
+ * java/text/AttributedString.java
+ (AttributedString(AttributedCharacterIterator, int, int,
+ AttributedCharacterIterator.Attribute[])): Fixed check for defined
+ attribute.
+
+2006-09-11 Gary Benson <gbenson@redhat.com>
+
+ * java/net/Inet4Address.java
+ (AF_INET): Renamed to FAMILY.
+ (<init>, writeReplace): Reflect the above.
+ * java/net/Inet6Address.java
+ (AF_INET6): Renamed to FAMILY.
+ (<init>): Reflect the above.
+
+2006-09-10 Ito Kazumitsu <kaz@maczuka.gcd.org>
+
+ Fixes bug #28867
+ Originally in Kaffe: 2004-04-16 Helmer Kraemer <hkraemer@freenet.de>
+ * java/net/ServerSocket.java(implAccept): Deleted socket.implCreated.
+ * java/net/Socket.java: Avoid creating a redundant file descriptor.
+ (implCreated): Deleted, (getImpl): Don't check impleCreated,
+ (bind): Call getImpl().create(true).
+
+2006-09-09 Chris Burdess <dog@gnu.org>
+
+ * gnu/xml/xpath/Expr.java: Ensure that node-set evaluation returns
+ an instance of org.w3c.dom.NodeList.
+
+2006-09-08 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * tools/gnu/classpath/tools/appletviewer/Main.java: Warn about
+ missing security manager when run in standalone mode.
+
+2006-09-08 Francis Kung <fkung@redhat.com>
+
+ * java/awt/image/AffineTransformOp.java: Updated documentation.
+ (createCompatibleDestRaster): Updated formatting.
+ (filter(BufferedImage, BufferedImage)): Updated formatting.
+ (filter(Raster, WritableRaster)): Delegated processing to native peers for
+ if colour model is compatible.
+ (filterBicubic): Get entire pixel at once, and use appropriate array type.
+ (filterBilinear): Get entire pixel at once, and use appropriate array type.
+
+2006-09-08 Gary Benson <gbenson@redhat.com>
+
+ * java/net/InetAddress.java
+ (family): Updated javadoc and made private.
+ (<init>): Add an address family argument.
+ (readObject): Don't overwrite family.
+ * java/net/Inet4Address.java
+ (AF_INET): New constant.
+ (<init>): Use AF_INET as the family.
+ (writeReplace): Likewise.
+ * java/net/Inet6Address.java
+ (AF_INET6): New constant.
+ (<init>): Use AF_INET6 as the family.
+
+2006-09-08 Gary Benson <gbenson@redhat.com>
+
+ * java/net/InetAddress.java
+ (getHostName): Move lookup into getCanonicalHostName.
+ (getCanonicalHostName): Move lookup from getHostName,
+ Perform security check on canonical name (ie after lookup).
+
+2006-09-08 Gary Benson <gbenson@redhat.com>
+
+ * java/net/Inet4Address.java (isMulticastAddress,
+ isLoopbackAddress, isAnyLocalAddress, isLinkLocalAddress,
+ isSiteLocalAddress, isMCGlobal, isMCNodeLocal, isMCLinkLocal,
+ isMCSiteLocal, isMCOrgLocal, getHostAddress): Moved
+ implementations from InetAddress.
+ * java/net/InetAddress.java (isMulticastAddress,
+ isLoopbackAddress, isAnyLocalAddress, isLinkLocalAddress,
+ isSiteLocalAddress, isMCGlobal, isMCNodeLocal, isMCLinkLocal,
+ isMCSiteLocal, isMCOrgLocal, getHostAddress): Replace
+ implementations with UnsupportedOperationExceptions.
+
+2006-09-08 Gary Benson <gbenson@redhat.com>
+
+ * java/net/InetAddress.java
+ (inaddr_any): Removed.
+ (ANY_IF, LOCALHOST): Create using getByAddress.
+ (<init>): Updated javadoc.
+ (getHostName): Cache hostname even if the lookup failed.
+ (getByAddress): Create Inet4Address objects when passed
+ IPv4-mapped IPv6 addresses.
+ (aton): Removed.
+ (getAllByName): Create address objects using getByAddress.
+ Do not perform security checks unless actually required.
+ Do not strip whitespace from the hostname.
+ (getInaddrAny): Removed.
+ (getLocalHost): Return the loopback address if getByName
+ throws a SecurityException.
+ (readResolve): Updated javadoc.
+ * vm/reference/java/net/VMInetAddress.java (aton): Declared.
+ * include/java_net_VMInetAddress.h
+ (Java_java_net_VMInetAddress_aton): Likewise.
+ * native/jni/java-net/java_net_VMInetAddress.c
+ (Java_java_net_VMInetAddress_aton): New method.
+ * native/jni/native-lib/cpnet.h (cpnet_aton): Declared.
+ * native/jni/native-lib/cpnet.c (cpnet_aton): New method.
+ * configure.ac (AC_CHECK_FUNCS): Checks for cpnet_aton.
+ * java/net/Inet4Address.java (writeReplace): Updated javadoc.
+ * NEWS: Added note about updated VM interface.
+
+2006-09-07 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/plaf/basic/BasicInternalFrameUI.java
+ (setNorthPane): Assign component to titlePane.
+
+2006-09-07 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ * gnu/CORBA/NamingService/NameParser.java (corbaloc):
+ Remove unused variable alt_addr.
+ * gnu/CORBA/NamingService/NameTransformer.java (toName):
+ Remove unused variables.
+
+2006-09-07 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/plaf/metal/MetalScrollBarUI.java
+ (installDefaults): Initialise scrollBarWidth from UI defaults here,
+ (createDecreaseButton): Don't fetch scrollBarWidth here,
+ (createIncreaseButton): Likewise.
+
+2006-09-07 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/awt/image/MemoryImageSource.java: Added API docs.
+
+2006-09-06 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/plaf/basic/BasicScrollBarUI.java
+ (installDefaults): Call configureScrollBarColors().
+
+2006-09-06 Francis Kung <fkung@redhat.com>
+
+ * java/awt/image/RescaleOp.java: Updated documentation and formatting.
+ (constructor): Make copy of arrays.
+ (createCompatibleDestImage): Changed treatment of null ColorModel.
+ (filter(BufferedImage, BufferedImage)): Re-implemented.
+ (filter(Raster, WritableRaster, boolean[])): New method.
+ (filter(Raster, WritableRaster)): Re-implemented.
+ (getOffsets): Prevent ArrayIndexOutOfBoundsException.
+ (getPoint2D): Cleaned up formatting.
+ (getScaleFactors): Prevent ArrayIndexOutOfBoundsException.
+
+2006-09-06 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/UIManager.java
+ (getBoolean(Object)): Reimplemented,
+ (getBoolean(Object, Locale)): Likewise,
+ (getBorder(Object)): Likewise,
+ (getBorder(Object, Locale)): Likewise,
+ (getColor(Object)): Likewise,
+ (getColor(Object, Locale)): Likewise,
+ (getDimension(Object)): Likewise,
+ (getDimension(Object, Locale)): Likewise,
+ (getFont(Object)): Likewise,
+ (getFont(Object, Locale)): Likewise,
+ (getIcon(Object)): Likewise,
+ (getIcon(Object, Locale)): Likewise,
+ (getInsets(Object)): Updated API docs,
+ (getInsets(Object, Locale)): Likewise,
+ (getInt(Object)): Reimplemented,
+ (getInt(Object, Locale)): Likewise,
+ (getString(Object)): Likewise,
+ (getString(Object, Locale)): Likewise.
+
+2006-09-06 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/UIManager.java
+ (MultiplexUIDefaults.MultiplexUIDefaults()): Don't allow null fallback,
+ (getDefaults): Initialise MultiplexUIDefaults with empty fallback.
+
+2006-09-06 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/plaf/metal/MetalLookAndFeel.java
+ (initComponentDefaults): Corrected various font defaults.
+
+2006-09-05 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/awt/List.java: Added @since to various methods.
+
+2006-09-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * native/jni/native-lib/cpprocess.c:
+ (forkAndExec(char*,char*,int,int,pid_t,char*)):
+ Add redirection of stdout to stderr.
+ * native/jni/native-lib/cpprocess.h:
+ Added redirect argument.
+ * native/jni/java-lang/java_lang_VMProcess.c
+ (Java_java_lang_VMProcess_nativeSpawn): Readd redirect argument.
+ * vm/reference/java/lang/VMProcess.java: Likewise.
+ * include/java_lang_VMProcess.h: Regenerated.
+
+2006-09-05 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c: Adjust
+ __attribute to __attribute__.
+
+ * native/jni/java-nio/java_nio_MappedByteBufferImpl.c: Remove duplicate
+ header include.
+
+2006-09-05 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/awt/List.java: Source code reformatted.
+
+2006-09-05 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ * gnu/CORBA/CollocatedOrbs.java,
+ gnu/CORBA/SafeForDirectCalls.java: New files.
+ * gnu/CORBA/NamingService/Binding_iterator_impl.java:
+ Implement gnu.CORBA.SafeForDirectCalls.
+ * gnu/CORBA/NamingService/Ext.java: Likewise.
+ * gnu/CORBA/NamingService/TransientContext.java: Likewise.
+ * gnu/CORBA/OrbFunctional.java (createIor):Cache the address
+ of the local host. (ior_to_object): Return the local object
+ where possible. (run): Register/unregister this ORB.
+ * gnu/CORBA/Poa/LocalRequest.java (v_invoke): Call gnuPOA.checkDiscarding.
+ * gnu/CORBA/Poa/gnuPOA.java (checkDiscarding): Made package private.
+ * gnu/CORBA/Poa/gnuServantObject.java (noRetain): New field.
+ (constructors): Initialize noRetain. (_invoke): Drop servant
+ if noRetain is true. (getHandler): Always seach for the new servant
+ if noRetain is true.
+ * gnu/CORBA/SimpleDelegate.java (create_request): Implemented.
+ * NEWS: Added note about the new feature.
+
+2006-09-05 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/awt/Choice.java
+ (addItem): Fixed API doc glitch.
+
+2006-09-05 Francis Kung <fkung@redhat.com>
+
+ * java/awt/image/LookupOp.java: Updated documentation & formatting.
+ (createCompatibleDestImage): Re-implemented.
+ (filter(BufferedImage, BufferedImage)): Added check for src/dest image
+ compatibility, and use ColorConvertOp for color conversion if needed.
+ (filter(Raster, WritableRaster)): Made exceptions more descriptive.
+
+2006-09-05 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ gnu/CORBA/CDR/Vio.java,
+ org/omg/CORBA_2_3/ORB.java,
+ org/omg/CORBA_2_3/portable/InputStream.java,
+ org/omg/CORBA_2_3/portable/OutputStream.java,
+ org/omg/CosNaming/BindingIteratorHelper.java,
+ org/omg/CosNaming/BindingTypeHelper.java,
+ org/omg/CosNaming/NameComponentHelper.java,
+ org/omg/CosNaming/NameHelper.java,
+ org/omg/CosNaming/NamingContextExtHelper.java,
+ org/omg/CosNaming/NamingContextExtPackage/AddressHelper.java,
+ org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHelper.java,
+ org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHolder.java,
+ org/omg/CosNaming/NamingContextExtPackage/StringNameHelper.java,
+ org/omg/CosNaming/NamingContextExtPackage/URLStringHelper.java,
+ org/omg/CosNaming/NamingContextHelper.java,
+ org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.java,
+ org/omg/CosNaming/NamingContextPackage/InvalidName.java,
+ org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.java,
+ org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.java,
+ org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.java,
+ org/omg/CosNaming/NamingContextPackage/NotFoundReasonHolder.java,
+ org/omg/DynamicAny/AnySeqHelper.java,
+ org/omg/DynamicAny/DynAnyFactoryHelper.java,
+ org/omg/DynamicAny/DynAnyFactoryOperations.java,
+ org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.java,
+ org/omg/DynamicAny/DynAnyHelper.java,
+ org/omg/DynamicAny/DynAnyOperations.java,
+ org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.java,
+ org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.java,
+ org/omg/DynamicAny/DynAnySeqHelper.java,
+ org/omg/DynamicAny/DynArrayHelper.java,
+ org/omg/DynamicAny/DynEnumHelper.java,
+ org/omg/DynamicAny/DynFixedHelper.java,
+ org/omg/DynamicAny/DynSequenceHelper.java,
+ org/omg/DynamicAny/DynStructHelper.java,
+ org/omg/DynamicAny/DynStructOperations.java,
+ org/omg/DynamicAny/DynUnionHelper.java,
+ org/omg/DynamicAny/DynValueHelper.java,
+ org/omg/DynamicAny/NameDynAnyPairHelper.java,
+ org/omg/DynamicAny/NameDynAnyPairSeqHelper.java,
+ org/omg/IOP/CodecFactoryHelper.java,
+ org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.java,
+ org/omg/IOP/CodecOperations.java,
+ org/omg/IOP/CodecPackage/FormatMismatchHelper.java,
+ org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.java,
+ org/omg/IOP/CodecPackage/TypeMismatchHelper.java,
+ org/omg/IOP/ComponentIdHelper.java,
+ org/omg/IOP/ExceptionDetailMessage.java,
+ org/omg/IOP/MultipleComponentProfileHelper.java,
+ org/omg/IOP/ProfileIdHelper.java,
+ org/omg/IOP/ServiceContextListHelper.java,
+ org/omg/IOP/ServiceIdHelper.java,
+ org/omg/IOP/TAG_CODE_SETS.java,
+ org/omg/PortableInterceptor/ClientRequestInfoOperations.java,
+ org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java,
+ org/omg/PortableInterceptor/CurrentHelper.java,
+ org/omg/PortableInterceptor/IORInfo.java,
+ org/omg/PortableInterceptor/IORInterceptor_3_0Helper.java,
+ org/omg/PortableInterceptor/ORBIdHelper.java,
+ org/omg/PortableInterceptor/ORBInitInfoOperations.java,
+ org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.java,
+ org/omg/PortableInterceptor/ORBInitializerOperations.java,
+ org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java,
+ org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.java,
+ org/omg/PortableInterceptor/RequestInfoOperations.java,
+ org/omg/PortableInterceptor/ServerIdHelper.java,
+ org/omg/PortableInterceptor/ServerRequestInfoOperations.java,
+ org/omg/PortableInterceptor/ServerRequestInterceptorOperations.java,
+ org/omg/PortableServer/AdapterActivatorOperations.java,
+ org/omg/PortableServer/CurrentHelper.java,
+ org/omg/PortableServer/CurrentPackage/NoContextHelper.java,
+ org/omg/PortableServer/ForwardRequestHelper.java,
+ org/omg/PortableServer/IdAssignmentPolicyValue.java,
+ org/omg/PortableServer/IdUniquenessPolicyValue.java,
+ org/omg/PortableServer/ImplicitActivationPolicyValue.java,
+ org/omg/PortableServer/LifespanPolicyValue.java,
+ org/omg/PortableServer/POA.java,
+ org/omg/PortableServer/POAHelper.java,
+ org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.java,
+ org/omg/PortableServer/POAManagerPackage/State.java,
+ org/omg/PortableServer/POAOperations.java,
+ org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.java,
+ org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.java,
+ org/omg/PortableServer/POAPackage/InvalidPolicy.java,
+ org/omg/PortableServer/POAPackage/NoServantHelper.java,
+ org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.java,
+ org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.java,
+ org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java,
+ org/omg/PortableServer/POAPackage/ServantNotActiveHelper.java,
+ org/omg/PortableServer/POAPackage/WrongAdapterHelper.java,
+ org/omg/PortableServer/POAPackage/WrongPolicyHelper.java,
+ org/omg/PortableServer/RequestProcessingPolicyValue.java,
+ org/omg/PortableServer/ServantActivatorHelper.java,
+ org/omg/PortableServer/ServantLocatorHelper.java,
+ org/omg/PortableServer/ServantLocatorOperations.java,
+ org/omg/PortableServer/ServantRetentionPolicyValue.java,
+ org/omg/PortableServer/ThreadPolicyValue.java,
+ org/omg/PortableServer/_ServantActivatorStub.java,
+ org/omg/PortableServer/_ServantLocatorStub.java,
+ org/omg/PortableServer/portable/Delegate.java: Documentation fixes.
+
+2006-09-05 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ * javax/rmi/CORBA/Tie.java,
+ org/omg/CORBA/AnyHolder.java,
+ org/omg/CORBA/AnySeqHelper.java,
+ org/omg/CORBA/AnySeqHolder.java,
+ org/omg/CORBA/BooleanHolder.java,
+ org/omg/CORBA/BooleanSeqHelper.java,
+ org/omg/CORBA/BooleanSeqHolder.java,
+ org/omg/CORBA/ByteHolder.java,
+ org/omg/CORBA/CharHolder.java,
+ org/omg/CORBA/CharSeqHelper.java,
+ org/omg/CORBA/CharSeqHolder.java,
+ org/omg/CORBA/Context.java,
+ org/omg/CORBA/CurrentHelper.java,
+ org/omg/CORBA/CustomValue.java,
+ org/omg/CORBA/DataOutputStream.java,
+ org/omg/CORBA/DefinitionKindHelper.java,
+ org/omg/CORBA/DomainManagerOperations.java,
+ org/omg/CORBA/DoubleHolder.java,
+ org/omg/CORBA/DoubleSeqHelper.java,
+ org/omg/CORBA/DoubleSeqHolder.java,
+ org/omg/CORBA/DynAny.java,
+ org/omg/CORBA/DynSequence.java,
+ org/omg/CORBA/DynValue.java,
+ org/omg/CORBA/DynamicImplementation.java,
+ org/omg/CORBA/FieldNameHelper.java,
+ org/omg/CORBA/FixedHolder.java,
+ org/omg/CORBA/FloatHolder.java,
+ org/omg/CORBA/FloatSeqHelper.java,
+ org/omg/CORBA/FloatSeqHolder.java,
+ org/omg/CORBA/IdentifierHelper.java,
+ org/omg/CORBA/IntHolder.java,
+ org/omg/CORBA/LocalObject.java,
+ org/omg/CORBA/LongHolder.java,
+ org/omg/CORBA/LongLongSeqHelper.java,
+ org/omg/CORBA/LongLongSeqHolder.java,
+ org/omg/CORBA/LongSeqHelper.java,
+ org/omg/CORBA/LongSeqHolder.java,
+ org/omg/CORBA/ORB.java,
+ org/omg/CORBA/ObjectHelper.java,
+ org/omg/CORBA/ObjectHolder.java,
+ org/omg/CORBA/OctetSeqHelper.java,
+ org/omg/CORBA/OctetSeqHolder.java,
+ org/omg/CORBA/PolicyErrorCodeHelper.java,
+ org/omg/CORBA/PolicyErrorHelper.java,
+ org/omg/CORBA/PolicyHelper.java,
+ org/omg/CORBA/PolicyListHelper.java,
+ org/omg/CORBA/PolicyTypeHelper.java,
+ org/omg/CORBA/PrincipalHolder.java,
+ org/omg/CORBA/RepositoryIdHelper.java,
+ org/omg/CORBA/Request.java,
+ org/omg/CORBA/ShortHolder.java,
+ org/omg/CORBA/ShortSeqHelper.java,
+ org/omg/CORBA/ShortSeqHolder.java,
+ org/omg/CORBA/StringSeqHelper.java,
+ org/omg/CORBA/StringSeqHolder.java,
+ org/omg/CORBA/ULongLongSeqHelper.java,
+ org/omg/CORBA/ULongLongSeqHolder.java,
+ org/omg/CORBA/ULongSeqHelper.java,
+ org/omg/CORBA/ULongSeqHolder.java,
+ org/omg/CORBA/UShortSeqHelper.java,
+ org/omg/CORBA/UShortSeqHolder.java,
+ org/omg/CORBA/ValueBaseHelper.java,
+ org/omg/CORBA/ValueBaseHolder.java,
+ org/omg/CORBA/VersionSpecHelper.java,
+ org/omg/CORBA/WCharSeqHelper.java,
+ org/omg/CORBA/WCharSeqHolder.java,
+ org/omg/CORBA/WStringSeqHelper.java,
+ org/omg/CORBA/WStringSeqHolder.java,
+ org/omg/CORBA/WrongTransactionHelper.java,
+ org/omg/CORBA/_IDLTypeStub.java,
+ org/omg/CORBA/_PolicyStub.java,
+ org/omg/CORBA/portable/BoxedValueHelper.java,
+ org/omg/CORBA/portable/Delegate.java,
+ org/omg/CORBA/portable/ObjectImpl.java,
+ org/omg/CORBA/portable/ServantObject.java,
+ org/omg/CORBA/portable/StreamableValue.java,
+ org/omg/CosNaming/BindingType.java,
+ org/omg/CosNaming/IstringHelper.java,
+ org/omg/DynamicAny/FieldNameHelper.java,
+ org/omg/PortableServer/Servant.java: Documentation fixes.
+
+2006-09-04 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/awt/Rectangle.java
+ (setRect(double, double, double, double)): Modified rounding of input
+ values.
+
+2006-09-03 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ * gnu/javax/swing/text/html/parser/HTML_401F.java (defineElements):
+ Disallow H1 - H6 in the paragraphs.
+ * gnu/javax/swing/text/html/parser/support/textPreProcessor.java
+ (preprocess): Leave at most one leading and/or trailing space.
+ * javax/swing/text/html/HTMLDocument.java (HTMLReader.handleText):
+ Do not add any text after closing the HTML tag.
+
+2006-09-02 Roman Kennke <kennke@aicas.com>
+
+ PR 28928
+ * javax/swing/plaf/basic/BasicTextUI.java
+ (RootView.getPreferredSpan): Default to 10 when there is no
+ real view.
+ (RootView.getMinimumSpan): Forward to view and default to 10
+ when there is no real view.
+ (RootView.getMaximumSpan): Return Integer.MAX_VALUE.
+ (getMaximumSize): Check for overflow.
+ * javax/swing/text/FieldView.java
+ (getResizeWeight): Removed unneeded assignment.
+
+2006-09-01 Francis Kung <fkung@redhat.com>
+ * java/awt/image/ColorConvertOp.java
+ (copyImage): Updated javadoc and comments.
+ (copyRaster): Add javadoc.
+ (createCompatibleColorModel): Add javadocs and comments.
+ (createCompatibleDestImage): Use correct transfer type.
+ (createCompatibleDestRaster): Add new parameter for transfer type.
+ (filter): Use correct transfer type.
+ * java/awt/image/ConvolveOp.java: Updated javadocs.
+ (createCompatibleDestImage): Set new image properties correctly.
+ (filter(BufferedImage, BufferedImage): Correct handling of premultiplication.
+ (filter(WritableRaster, Raster): Clip sample values to [0-255].
+
+2006-09-01 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/table/DefaultTableModel.java:
+ (checkSize): Added null check for dataVector.
+
+2006-09-01 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/plaf/basic/BasicSplitPaneUI.java:
+ (BasicHorizontalLayout.getAlignmentX): Return fixed value.
+ (BasicHorizontalLayout.getAlignmentY): Return fixed value.
+
+2006-09-01 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/plaf/metal/MetalCheckBoxIcon.java:
+ (paintIcon): Removed unused import statements, lowered cast requirement
+ from JCheckBox to AbstractButton.
+
+2006-09-01 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/plaf/basic/BasicLookAndFeel.java:
+ (initComponentDefaults): Added, changed and removed some
+ tabbed pane properties.
+
+2006-09-01 Robert Schuster <robertschuster@fsfe.org>
+
+ * examples/gnu/classpath/examples/swing/TabbedPaneDemo.java:
+ (createContent): Changed menu item name and tab naming.
+
+2006-09-01 Roman Kennke <kennke@aicas.com>
+
+ PR 28922
+ * javax/swing/plaf/basic/BasicHTML.java
+ (HTMLRootView.getAttributes): Overridden to return null.
+ (HTMLRootView.getElement): Overridden to return the view's
+ element.
+
+2006-09-01 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/plaf/basic/BasicTabbedPaneUI.java:
+ (calculateTabAreaHeight): Use getTabRunOverlay method instead
+ of accessing variable directly.
+ (calculateTabAreaWidth): Dito.
+
+2006-08-31 Keith Seitz <keiths@redhat.com>
+
+ * include/jvmti.h: Include jvmti_md.h.
+
+2006-08-31 Keith Seitz <keiths@redhat.com>
+
+ From Martin Platter <motse@complang.tuwien.ac.at>:
+ * Makefile.am (include_HEADERS): Include jvmti.h.
+ * include/jvmti.h (jvmtiEnv) [!__cplusplus]: Add missing '*'.
+ (jvmtiError): Remove superfluous comma after last entry.
+ (jvmtiEvent): It's "BREAKPOINT" not "BERAKPOINT".
+ (_Jv_jvmtiEnv.StopThread): Add missing exception parameter.
+ (_Jv_jvmtiEnv.RawMonitorWait): Add missing millis parameter.
+ (_Jv_jvmtiEnv.GetSourceFileName): source_name_ptr is pointer to
+ character pointer.
+ (_Jv_JVMTIEnv::StopThread): Add missing exception parameter.
+ (_Jv_JVMTIEnv::RawMonitorWait): Add missing millis parameter.
+ (_Jv_JVMTIEnv::GetSourceFileName): source_name_ptr is pointer to
+ character pointer.
+
+2006-08-31 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/BoxView.java
+ (getWidth): Return the width with insets added, not with one
+ added and one removed.
+ (getHeight): Return the height with insets added, not with one
+ added and one removed.
+ * javax/swing/text/GlyphView.java
+ (DefaultGlyphPainter.viewToModel): Need to add the start offset.
+ * javax/swing/text/ParagraphView.java
+ (Row.getAlignment): Adjust alignment with respect to
+ the justification attribute.
+ (Row.getLeftInset): Overridden to adjust for firstLineIndent
+ attribute.
+ * javax/swing/text/html/CSS.java
+ (getValue): Convert length values.
+ * javax/swing/text/html/Paragraph.java
+ (painter): New field.
+ (paint): Implemented to delegate painting to the BoxPainter too.
+ (setPropertiesFromAttributes): Implemented to load attributes
+ from CSS.
+ * javax/swing/text/html/StyleSheet.java
+ (BoxPainter.as): Removed field.
+ (BoxPainter.leftInset): New field.
+ (BoxPainter.bottomInset): New field.
+ (BoxPainter.rightInset): New field.
+ (BoxPainter.topInset): New field.
+ (BoxPainter.BoxPainter): Implemented to load the insets from
+ CSS.
+ (BoxPainter.getInset): Implemented.
+ * gnu/javax/swing/text/html/Length.java: New class.
+ Converts CSS length units to usable values.
+
+2006-08-31 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * configure.ac: Add check for gethostbyname_r.
+ Add check for MSG_NOSIGNAL and SO_NOSIGPIPE.
+ * native/jni/native-lib/cpnet.c (SOCKET_NOSIGNAL): Define
+ SOCKET_NOSIGNAL according to the configure check.
+ (cpnet_send): Use SOCKET_NOSIGNAL.
+ (cpnet_sendTo): Likewise.
+ (cpnet_getHostByName): Use gethostbyname in case gethostbyname_r is not
+ defined.
+ * native/jni/native-lib/cpio.c: Define O_SYNC and O_DSYNC in case they
+ are not available.
+
+ * lib/Makefile.am (cssfiles): Add new rule to install css files.
+
+2006-08-31 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JEditorPane.java
+ (getPreferredSize): Replace preferred size with minimum
+ UI size only if the scrollable does _not_ track the viewport
+ size and only if the viewport's size is smaller than the
+ scrollable's size.
+ (getScrollableTracksViewportWidth): Avoid unnecessary multiple
+ method calls.
+ * javax/swing/plaf/basic/BasicTextUI.java
+ (getPreferredSize): Read-lock the document to avoid
+ concurrency problems.
+ (getMaximumSize): Return maximum size of the view.
+ Read-lock the document to avoid concurrency problems.
+ (getMinimumSize): Return minimum size of the view.
+ Read-lock the document to avoid concurrency problems.
+
+2006-08-31 Gary Benson <gbenson@redhat.com>
+
+ * java/net/SocketPermission.java
+ (maybeBracketIPv6Address): Renamed to processHostport.
+ (processHostport): Also translate "" to "localhost".
+ (setHostPort): Remove special cases for empty hostport and for
+ extra colons in hostport (processHostport handles these now).
+
+2006-08-31 Mark Wielaard <mark@klomp.org>
+
+ * javax/swing/text/ZoneView.java (Zone): Make static class.
+ Constructor takes axis parameter.
+ (createZone): Create Zone with getAxis() as major axis.
+
+2006-08-30 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/ZoneView.java
+ (loadChildren): Implemented.
+ (getViewIndexAtPosition): Implemented.
+ (checkZoneAt): New helper method.
+ (splitZone): New helper method.
+ (getPreferredZoneEnd): New helper method.
+
+2006-08-30 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/ZoneView.java: New class.
+
+2006-08-30 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JMenu.java
+ (getMenu): Removed unneeded cast.
+ (getPopupMenuOrigin): Made positioning algorithm better respect
+ the screen bounds.
+ (setMenuLocation): Also set the location on the popup if it's
+ not null.
+ (setModel): Use menuChangeListener so that we don't override
+ the changeListener field from AbstractButton.
+ (setPopupMenuVisible): Use custom location if set, otherwise
+ fallback to getPopupMenuOrigin().
+
+2006-08-29 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/InternationalFormatter.java
+ (stringToValue): Fixed bounds check.
+ * javax/swing/text/MaskFormatter.java
+ (MaskFormatter): Don't explicitly set allosInvalid property.
+ (convertStringToValue): New helper method.
+ (convertValueToString): New helper method.
+ (convertValue): Removed. Replaced by the 2 convert* methods
+ above.
+ (getPadCharAt): Removed.
+ (isCharValid): Removed.
+ (pad): Removed.
+ (stringToValue): Fixed stringToValue conversion.
+ (stripLiterals): Removed.
+ (valueToString): Fixed valueToString conversion.
+ * javax/swing/text/DefaultFormatter.java
+ (DefaultFormatter): Default to commitsOnValidEdit = false.
+
+2006-08-29 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/TextAction.java
+ (getTextComponent): Check event for null and return null in
+ this case.
+ (augmentList): Augment Actions based on their names.
+ * javax/swing/text/DefaultEditorKit.java
+ (BeginAction.actionPerformed): Check target for null.
+ (BeginLineAction.actionPerformed): Check target for null.
+ (CopyAction.actionPerformed): Check target for null.
+ (CutAction.actionPerformed): Check target for null.
+ (EndAction.actionPerformed): Check target for null.
+ (EndLineAction.actionPerformed): Check target for null.
+ (InsertBreakAction.actionPerformed): Check target for null.
+ (InsertTabAction.actionPerformed): Check target for null.
+ (PasteAction.actionPerformed): Check target for null.
+ (SelectAllAction.actionPerformed): Check target for null.
+ (SelectionBeginAction.actionPerformed): Check target for null.
+ (SelectionBeginLineAction.actionPerformed): Check target for null.
+ (SelectionEndAction.actionPerformed): Check target for null.
+ (SelectionEndLineAction.actionPerformed): Check target for null.
+ (SelectLineAction.actionPerformed): Check target for null.
+ (SelectWordAction.actionPerformed): Check target for null.
+
+2006-08-29 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicTextUI.java
+ (FocusHandler): New class. This is moved from the anonymous
+ inner focus listener class to a static member class, and
+ is now shared between components.
+ (DocumentHandler): This class is combined with the PropertyHandler
+ into the Handler class.
+ (PropertyChangeHandler): This class is combined with the
+ DocumentHandler into the Handler class.
+ (Handler): New class. This combines the Property and Document
+ handler into one class.
+ (RootView.changedUpdate): Only forward if real view != null.
+ (RootView.insertUpdate): Only forward if real view != null.
+ (RootView.removeUpdate): Only forward if real view != null.
+ (documentHandler): Removed field and replaced by handler.
+ (focuslistener): Made field static and renamed to focusListener.
+ (handler): New field.
+ (kit): Lazily initialize field.
+ (rootView): Lazily initialize field.
+ (updateHandler): Removed and replaced by handler.
+ (getEditorKit): Lazily instantiate field.
+ (installDefaults): Don't set margin twice. Install correct
+ property for disabledTextColor. Moved caret and highlighter
+ initialization to installFixedDefaults.
+ (installFixedDefaults): New method. Installs defaults that
+ can't be overridden by subclasses.
+ (installListeners): Only install focus handler when new
+ system property gnu.swing.text.no-xlike-clipboard is not set.
+ Lazily initialize focus handler.
+ (installUI): Lazily initialize rootView. Install handler
+ both for property and document changes.
+ (uninstallDefaults): Uninstall the UI defaults.
+ (uninstallFixedDefaults): New method. Uninstalls the fixed
+ defaults.
+ (installListeners): Only uninstall focus handler when not null.
+ (uninstallUI): Uninstall property and document listener here.
+
+2006-08-29 Gary Benson <gbenson@redhat.com>
+
+ * java/net/SocketPermission.java
+ (maybeBracketIPv6Address): New method.
+ (<init>): Pass the hostport argument through the above.
+
+ * java/net/NetworkInterface.java (getInetAddresses):
+ Don't bracket IPv6 addresses.
+
+2006-08-28 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/BoxView.java
+ (calculateMinorAxisRequirements): Initialize max size
+ with Integer.MAX_VALUE.
+ * javax/swing/text/Utilities.java
+ (getBreakLocation): For simple chars, scan the text directly.
+ * javax/swing/text/WrappedPlainView.java
+ (tabBase): New field.
+ (tabSize): New field.
+ (calculateBreakPosition): Use Utilities. Fixed for correct
+ break calculation.
+ (changedUpdate): Update children directly.
+ (insertUpdate): Update children directly. Notify children.
+ (removeUpdate): Update children directly. Notify children.
+ (updateChildren): New helper method.
+ (nextTabStop): Fixed to return correct results.
+ (paint): Update tabBase.
+ (updateMetrics): Update tab size.
+
+2006-08-28 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/Position.java
+ (Bias.Forward): Initialize with 'Forward' rather then 'forward'.
+ (Bias.Backward): Initialize with 'Backward' rather then 'backward'.
+
+2006-08-28 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/View.java
+ (height): Removed unneeded field.
+ (width): Removed unneeded field.
+ (getBreakWeight): Return GoodBreakWeight when pos is after
+ the view's span.
+ (getToolTipText): Check view index more carefully. Avoid
+ Rectangle creation.
+ (insertUpdate): Only execute method body if view count > 0.
+ When updateChildren returns false, clear the ec variable.
+ (updateChildren): Added null checks.
+ (viewToModel): Initialize bias array correctly.
+ * javax/swing/text/CompositeView.java
+ (children): Made private.
+ (numChildren): New field.
+ (loadChildren): Check factory for null. Don't load children
+ when factory is null.
+ (replace): Removed null check. Nullify removed children. Made
+ growing the array more efficient.
+ (getViewCount): Return numChildren rather then the real array
+ size.
+ * javax/swing/text/BoxView.java
+ (getViewAtPoint): Fixed algorithm for finding the view.
+ (replace): Made array growing more efficient.
+ (replaceLayoutArray): New helper method for growing/patching
+ the layout arrays.
+ (viewToModel): Make sure we have a valid layout.
+
+2006-08-28 Tania Bento <tbento@redhat.com>
+
+ * java/awt/MenuShortcut.java
+ (MenuShortcut (int, boolean)): Set keyName.
+ (toString): Modified string output.
+ (setKeyName): New private method.
+
+2006-08-28 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/GapContent.java
+ (Mark.getOffset): Made assert less strict, include boundary.
+ (search): Made package private to avoid accessor method.
+
+2006-08-28 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/StringContent.java
+ (InsertUndo.positions): New field.
+ (InsertUndo.redo): Update the undo positions.
+ (InsertUndo.undo): Fetch the undo positions.
+ (Mark): New class. Layer of indirection to allow Positions
+ to be GC'ed while we still hold references to the Mark.
+ (RemoveUndo.len): New field.
+ (RemoveUndo.positions): New field.
+ (RemoveUndo.RemoveUndo): Fetch undo positions.
+ (RemoveUndo.redo): Re-fetch positions and string.
+ (RemoveUndo.undo): Update undo positions.
+ (StickyPosition.mark): New field.
+ (StickyPosition.offset): Removed field.
+ (StickyPosition.StickyPosition): Create new Mark. Register
+ Position in queueOfDeath. Update reference count on mark.
+ (StickyPosition.getOffset): Return offset stored in mark.
+ (StickyPosition.setOffset): Removed unneeded method.
+ (UndoPosRef): New class. Handles undo/redo on positions/marks.
+ (EMPTY): New field.
+ (marks): New field. Stores the marks.
+ (positions): Removed field.
+ (queueOfDeath): New field. Used for GCing the positions.
+ (StringContent): Initialize queueOfDeath.
+ (createPosition): Lazily create marks vector.
+ (garbageCollect): New helper method. Collects positions
+ to be GCed and updates their marks.
+ (getChars): Fixed bounds check.
+ (getPositionsInRange): When v == null, create new Vector,
+ otherwise use v. Store UndoPosRefs in vector.
+ (getString): Added comment about bug in RI.
+ (insertString): Use new helper method for replacing the array.
+ Correctly update positions.
+ (length): Removed this qualifier.
+ (remove): Use new helper method for replacing the array.
+ Correctly update positions.
+ (replace): New helper method for growing or patching the array.
+ (updateUndoPositions): Implemented. Updates the positions
+ for undo/redo operations.
+
+2006-08-27 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/StyleContext.java
+ (NamedStyle.attributes): Made field transient.
+ (NamedStyle.changeEvent): Made field transient.
+ (NamedStyle.name): Removed field. The name is stored as
+ attribute.
+ (NamedStyle.NamedStyle(String,Style)): Call setName() for
+ storing the name and check for null name and resolveParent.
+ Don't initialize changeEvent.
+ (NamedStyle.copyAttributes): Return a new NamedStyle,
+ rather than a plain copy of the attributes field.
+ (NamedStyle.fireStateChange): Lazily create changeEvent
+ field.
+ (NamedStyle.getName): Fetch name from attributes.
+ (NamedStyle.setName): Store name from attributes.
+ (NamedStyle.readObject): Implemented for correct
+ deserialization.
+ (NamedStyle.writeObject): Implemented for correct
+ serialization.
+ (NamedStyle.setResolveParent): When new parent is null,
+ remove resolveParent attribute. Use addAttribute() method
+ rather than StyleContext addAttribute().
+ (NamedStyle.toString): Fixed to produce output equal to the
+ RI.
+ (SmallAttributeSet.resolveParent): New field.
+ (SmallAttributeSet.SmallAttributeSet(AttributeSet)): Update
+ the resolveParent field correctly.
+ (SmallAttributeSet.SmallAttributeSet(Object[])): Don't copy
+ array but store it directly. Update
+ the resolveParent field correctly.
+ (SmallAttributeSet.clone): Return this as the object is
+ immutable.
+ (SmallAttributeSet.containsAttributes): Make sure that keys
+ and values are the same.
+ (SmallAttributeSet.containsAttribute): Make sure that keys
+ and values are the same.
+ (SmallAttributeSet.copyAttributes): Return this as the object is
+ immutable.
+ (SmallAttributeSet.equals): Fixed comparison. Two AttributeSet
+ are equal if they have the same number of attributes and
+ one contains the other.
+ (SmallAttributeSet.getAttribute): Improved lookup of
+ resolveParent.
+ (SmallAttributeSet.getResolveParent): Improved lookup of
+ resolveParent.
+ (SmallAttributeSet.isEqual): When comparing object is a
+ SmallAttributeSet, consider them equal only if they are the
+ same object.
+ (SmallAttributeSet.toString): Fixed to produce output equal to the
+ RI.
+ (attributeSetPool): New field.
+ (defaultStyleContext): Initialize lazily.
+ (defaultStyle): Removed field. This is stored in the style context
+ as attribute.
+ (listenerList): Removed field. The NamedStyle stores the
+ listeners.
+ (readAttributeKeys): New static field. Used for looking up
+ the serialization mappings when reading.
+ (search): New field. Used as search key.
+ (staticAttributeKeys): Replaced by read/writeAttributeKeys.
+ (styles): New field. Stores the styles and listeners.
+ (styleTable): Removed field. Replaced by styles field.
+ (writeAttributeKeys): New static field. Used for looking up
+ the serialization mappings when writing.
+ (static_initializer): Register mappings for all keys in
+ StyleConstants.
+ (StyleContext): Initialize styles correctly.
+ (addAttributes): Fixed caching of immutable attributes.
+ (addAttribute): Fixed caching of immutable attributes.
+ (removeAttributes): Fixed caching of immutable attributes.
+ (removeAttribute): Fixed caching of immutable attributes.
+ (addChangeListener): Add listener to styles field.
+ (removeChangeListener): Remove listener from styles field.
+ (getChangeListeners): Fetch listeners from styles field.
+ (addStyle): Add style to styles field.
+ (cleanupPool): New method.
+ (getDefaultStyleContext): Lazily create context.
+ (getEmptySet): Simply return SimpleAttributeSet.EMPTY.
+ (getMutableAttributeSet): New helper method. Used for
+ caching.
+ (getStaticAttribute): Fetch key from readAttributeKeys.
+ (getStyleNames): Return names from styles field.
+ (getStyle): Lookup style in styles field.
+ (removeStyle): Remove style from styles field.
+ (readAttributeSet): Fixed deserialization.
+ (writeAttributeSet): Fixed serialization.
+ (readObject): Fixed deserialization.
+ (writeObject): Fixed serialization.
+ (reclaim): Simply cleanup the pool.
+ (registerStaticAttributeKey): Store mapping in both ways.
+ (searchImmutableSet): New helper method for caching.
+ (toString): Fixed for output like the RI.
+ * javax/swing/text/StyleConstants.java
+ (keys): New field. Stores all known keys.
+ (StyleConstants): Store created key in keys list.
+ * javax/swing/event/EventListenerList.java
+ (readObject): Fixed deserialization.
+ (writeObject): Fixed serialization.
+
+2006-08-25 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/CompositeView.java
+ (insets): Removed. Replaced by single short fields.
+ (top): New field. Replaces insets.
+ (bottom): New field. Replaces insets.
+ (left): New field. Replaces insets.
+ (right): New field. Replaces insets.
+ (CompositeView): Initialize insets fields.
+ (createDefaultLocation): Removed unneeded method.
+ (getBottomInset): Return field directly.
+ (getTopInset): Return field directly.
+ (getLeftInset): Return field directly.
+ (getRightInset): Return field directly.
+ (getInsideAllocation): Adjusted to work on new insets fields.
+ (getViewIndex): Fixed check.
+ (loadChildren): Don't replace the old children.
+ (replace): Make sure that there is an array to operate on.
+ Only set parent to null, when it is this View.
+ (setInsets): Adjusted to work with new insets fields.
+ (setParagraphInsets): Fixed to pull insets directly from
+ StyleConstants.
+
+2006-08-25 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/ComponentView.java
+ (Interceptor): New inner helper class. Used to propagate
+ invalidate requests and cache component layout sizes.
+ (interceptor): New field.
+ (getAlignment): Fetch alignment from interceptor container.
+ (getComponent): Don't create component here. This is done
+ in setParent().
+ (getMaximumSpan): Fetch layout info from interceptor. Check
+ for illegal axis.
+ (getMinimumSpan): Fetch layout info from interceptor. Check
+ for illegal axis.
+ (getPreferredSpan): Fetch layout info from interceptor. Check
+ for illegal axis.
+ (modelToView): Fixed model to view mapping.
+ (viewToModel): Fixed view to model mapping.
+ (paint): Check for null. Set bounds on interceptor rather
+ then component.
+ (setParentImpl): Install interceptor between component
+ and hosting container.
+ (setParent): Call super.setParent() immediately.
+
+2006-08-25 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/LabelView.java
+ (setPropertiesFromAttributes): Only set background when
+ the corresponding attribute is actually defined, otherwise
+ set to null, as the StyleConstants would return black.
+ * javax/swing/text/DefaultStyledDocument.java
+ (ElementBuffer.documentEvent): Removed obsolete field.
+ (ElementBuffer.change): Do prepareEdits() and finishEdits()
+ to correctly update the element structure.
+ (ElementBuffer.insertContentTag): Removed unused statement.
+ (ElementBuffer.recreateAfterFracture): Removed
+ unused obsolete method.
+ (setCharacterAttributes): Removed unused statement.
+
+2006-08-25 Roman Kennke <kennke@aicas.com>
+
+ * examples/gnu/classpath/examples/swing/Demo.java
+ (LaterMain.run): Removed unused local variable.
+ (Demo): Don't put desktop in scrollpane.
+ (addChildren): Removed unused method.
+ (mkButtonBar): Added HTML demo.
+ (mkMenuBar): Added HTML demo.
+ (mkPanel): Removed unused method.
+ (mkScrollPane): Removed unused method.
+ (mkTree): Removed unused method.
+ (valign2str): Removed unused method.
+ * examples/gnu/classpath/examples/swing/HtmlDemo.java:
+ Initialize text field with some HTML that already works.
+ (DEBUG): New field. Set to true for debugging output.
+ (createContent): Dump element tree after parsing.
+
+2006-08-25 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/CSS.java
+ (getValue): Added color value conversion.
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.ConvertAction): New class, converts HTML style tags
+ to CSS attributes.
+ (HTMLReader.initTags): Register ConvertAction for <font> tag.
+ * javax/swing/text/html/InlineView.java
+ (setPropertiesFromAttributes): Implemented to fetch
+ CSS character attributes.
+ * javax/swing/text/html/StyleSheet.java
+ (addCSSAttribute): Convert value.
+ (getBackground): Implemented to fetch CSS background color
+ attribute.
+ (getForeground): Implemented to fetch CSS color
+ attribute.
+ (getFont): Adjust font size for superscript and subscript.
+ (translateHTMLToCSS): Rudimentary implementation that
+ copies the original attributes, so that any CSS attributes in
+ there are preserved.
+ (stringToColor): Use CSSColor for conversion.
+ * gnu/javax/swing/text/html/css/CSSColor.java:
+ New class. Converts CSS color values to RGB color values.
+ * gnu/javax/swing/text/html/CharacterAttributeTranslator.java:
+ Removed. This is more or less replaced by CSSColor and the
+ ConvertAction in HTMLReader.
+
+2006-08-25 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/BoxView.java
+ (childReqs): Removed obsolete field.
+ (baselineLayout): Reimplemented for correct baseline layout.
+ (baselineRequirements): Reimplemented for correct baseline
+ layout.
+ (updateChildRequirements): Removed obsolete method.
+ * javax/swing/text/GlyphView.java
+ (DefaultGlyphPainter.getSpan): Removed unused statement.
+ (DefaultGlyphPainter.paint): Dont paint subscript/superscript
+ specially. The subscript/superscript layout is performed
+ via the alignment, the font is supplied by the StyleContext.
+ (breakView): Removed unused statements.
+ (getAlignment): Adjust alignment according to the
+ superscript/subscript setting.
+ (getFont): Reimplemented to fetch the font from the style
+ context, or from the document if the stylecontext is not
+ available.
+ (getPreferredSpan): Adjust span for superscript. Use switch
+ instead of if-else.
+ * javax/swing/text/LabelView.java
+ (setPropertiesFromAttributes): Fetch background and foreground
+ from document / style context.
+ (isSubscript): Resync properties if needed.
+ * javax/swing/text/ParagraphView.java
+ (Row.calculateMinorAxisRequirements): Overridden to perform
+ a baseline layout.
+ (Row.layoutMinorAxis): Overridden to perform a baseline layout.
+
+2006-08-24 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/Utilities.java
+ (BUF_LENGTH): Removed unused field.
+ (drawTabbedText): Removed unneeded cast.
+ (getBreakLocation): Removed unneeded cast.
+ Fixed offset to account for Segments not starting at 0.
+
+2006-08-24 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicTabbedPaneUI.java
+ (TabbedPaneLayout.normalizeTabRuns): Removed unused statement.
+ (TabbedPaneScrollLayout.layoutContainer): Likewise.
+ (ScrollingPane.updateUI): Likewise.
+ (calculateTabWidth): Rewritten to correctly and efficiently
+ layout the tab width.
+ (layoutLabel): Call SwingUtilities method with the tabPane
+ as argument.
+ (paintContentBorderLeftEdge): Removed unused statement.
+ (paintContentBorderRightEdge): Removed unused statement.
+ (paintContentBorder): Removed unused statement.
+
+2006-08-24 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicTextUI.java
+ (RootView.getAttributes): Overridden to return null,
+ as the RootView has no parent.
+
+2006-08-24 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/html/CSSParser.java: Removed.
+ * javax/swing/text/html/CSS.java
+ (getValue): New helper method. Returns special converter
+ instances for certain kinds of property values.
+ * javax/swing/text/html/HTMLDocument.java
+ (HTMLReader.CharacterAction.start): Don't translate tags
+ here. Instead, store the attributes directly with the tag
+ as key.
+ (content): Removed field. The Content object is handled
+ by AbstractDocument.
+ (styleSheet): Removed field. The styleSheet is the styleContext
+ of this document and handled by the DefaultStyledDocument already.
+ (HTMLDocument(Content,StyleSheet): Simply call super here.
+ The super classes already handle the content and styleContext.
+ (HTMLDocument()): Call this() with a default GapContent and
+ StyleSheet.
+ (getStyleSheet): Return the styleContext here.
+ (insertUpdate): New method. Overridden to add the
+ CONTENT dummy tag to the element's attributes.
+ (setBase): Set the base on the styleContext.
+ * javax/swing/text/html/HTMLEditorKit.java
+ (styleContext): Removed unneeded field.
+ (styleSheet): Made field private.
+ (HTMLEditorKit): Do nothing here. The StyleSheet is
+ created lazily in getStyleSheet(). A styleContext is not
+ needed here.
+ (getStyleSheet): Create StyleSheet correctly.
+ (insertHTML): Removed unneeded cast.
+ * javax/swing/text/html/InlineView.java
+ (attributes): New field.
+ (changedUpdate): Reload attributes. Trigger preferenceChanged.
+ (getAttributes): Implemented to fetch the attributes from
+ the stylesheet.
+ * javax/swing/text/html/MultiAttributeSet.java: New class.
+ Multiplexes between several AttributeSets.
+ * javax/swing/text/html/MultiStyle.java: New class.
+ Multiplexes between several Styles.
+ * javax/swing/text/html/ParagraphView.java
+ (attributes): New field.
+ (getAttributes): Implemented to fetch the attributes from
+ the stylesheet.
+ * javax/swing/text/html/StyleSheet.java
+ (CssParser): Removed inner class.
+ (CSSStyle): New inner class. Represents a style defined
+ by a CSS rule.
+ (CSSStyleSheetParserCallback): New class, for parsing
+ CSS stylesheets.
+ (css): New field. Stores the CSS rules.
+ (resolvedStyles): New field. Stores resolved styles.
+ (StyleSheet): Initialize resolvedStyles map.
+ (addRule): Removed bogus impl.
+ (getFont): Implemented to fetch font, based on CSS rules.
+ (getResolvedStyle): New helper method. Looks up resolved
+ styles, and resolves a style if necessary.
+ (resolveStyle): New pair of helper methods. Resolves
+ CSS style rules.
+ (getRule(String)): Provide rudimentary implementation.
+ (getRule(Tag,Element)): Implemented.
+ (getViewAttributes): Implemented.
+ (loadRules): Implemented.
+ (translateHTMLToCSS): Tagged as not implemented.
+ * javax/swing/text/html/ViewAttributeSet.java: New class.
+
+2006-08-24 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/FlowView.java:
+ (LogicalView.getAttributes): New method. Overrides super
+ impl to return the attributes of the FlowView instance.
+ * javax/swing/text/LabelView.java:
+ (setPropertiesFromAttributes): Fetch attributes from
+ View, rather then from the Element. (In the HTML
+ package the getAttributes() method is overridden to
+ return different attributes). Fetch font from the StyledDocument.
+
+2006-08-24 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/DefaultEditorKit.java:
+ (DefaultKeyTypedAction.actionPerform): Also filter
+ ALT and CTRL modifiers.
+
+2006-08-24 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/css/FontSize.java,
+ * gnu/javax/swing/text/html/css/FontStyle.java,
+ * gnu/javax/swing/text/html/css/FontWeight.java:
+ New classes. Used to convert CSS font attributes to AWT/Swing
+ Font constants.
+
+2006-08-24 Francis Kung <fkung@redhat.com>
+ * gnu/java/awt/color/PyccConverter.java: Throw UnsupportedOperationExceptions.
+ * java/awt/image/ColorConvertOp.java: Updated javadocs.
+ (srccs, dstcs, rasterValid): Variables removed.
+ (ColorConvertOp(RenderingHints)): Initialize spaces to empty array.
+ (copyRaster): Check for null rendering hints
+ (createCompatibleColorModel): New private method.
+ (createCompatibleDestImage): Re-implemented.
+ (createCompatibleDestRaster(Raster, ColorSpace, boolean)): New private method.
+ (createCompatibleDestRaster(Raster)): Re-implemented.
+ (filter(BufferedImage, BufferedImage)): Add checks; fix temp image creation.
+ (filter(Raster, WritableRaster)): Add checks; fix temp raster creation.
+ (getPoint2D): Clean up formatting.
+ * java/awt/image/ComponentColorModel.java
+ (constructor): use findBits method instead of passing null.
+ (findBits): New method.
+
+2006-08-24 Gary Benson <gbenson@redhat.com>
+
+ * java/net/NetworkInterface.java (getInetAddresses): Bracket IPv6
+ addresses.
+
+2006-08-24 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/lang/ref/Reference.java
+ (queue, nextOnQueue): Made volatile.
+ (enqueue): Made thread safe.
+ * java/lang/ref/ReferenceQueue.java
+ (lock): New field.
+ (poll): Removed synchronized.
+ (enqueue): Changed to synchronize on lock object, to update Reference
+ state and return success status.
+ (dequeue, remove): Synchronize on lock object.
+
+2006-08-24 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/security/SecureClassLoader.java
+ (protectionDomainCache): Changed to HashMap.
+ (SecureClassLoader): Removed redundant security check.
+ (defineClass(String,byte[],int,int,CodeSource): Moved
+ protection domain lookup/construction to new method.
+ (defineClass(String,ByteBuffer,CodeSource): New method.
+ (getProtectionDomain): New method.
+
+2006-08-23 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JComponent.java
+ (isRepainting): Made package private.
+ (paintChild): New field.
+ (findOpaqueParent): Removed method. This is now in
+ paintImmediately().
+ (findOverlapFreeParent): Removed method. This is now
+ in paintImmediately2().
+ (findPaintRoot): Removed method. This is now
+ in paintImmediately2().
+ (isCompletelyObscured): Changed to take rectangle as single
+ ints as argument.
+ (isPaintingDoubleBuffered): Removed method. This is now
+ in paintImmediately2().
+ (isPartiallyObscured): New helper method.
+ (onTop): New helper method for optimization.
+ (paintChildren): Paint only to specific child when
+ requested like this from paintImmediately2().
+ (paintDoubleBuffered): Changed to take rectangle as single int
+ arguments.
+ (paintImmediately2): Changed to take rectangle as single int
+ arguments. Optimized determination of paint root.
+ (paintImmediately(Rectangle)): Change to delegate to
+ paintImmediately(int,int,int,int).
+ (paintImmediately(int,int,int,int)): Look for opaque ancestor
+ and start painting there.
+ (paint): Call paintDoubleBuffered() with int arguments. Only
+ paint component, when not completely occupied by opaque child.
+ (processKeyBinding): Removed unnecessary cast.
+ (isOccupiedByChild): New helper method.
+ * javax/swing/RepaintManager.java
+ (repaintUnderway): Removed obsolete field.
+ (commitRequests): Removed obsolete field.
+ (RepaintManager): Removed initialization of obsolete fields.
+ (addDirtyRegion): Removed unused statement.
+ (commitBuffer): Changed to take plain ints as argument.
+ (compileRepaintRoots): Optimized to avoid use of Rectangle.
+ Compute offsets in place, rather than using SwingUtilities.
+ (paintDirtyRegions): Removed unused field.
+ * javax/swing/JMenuItem.java
+ (onTop): Return true when not descendant of JInternalFrame.
+ * javax/swing/JPopupMenu.java
+ (onTop): Return true.
+ * javax/swing/JToolTip.java
+ (onTop): Return true.
+ * javax/swing/JViewport.java
+ (paintImmediately2): Change signature to match the
+ corresponding JComponent method.
+
+2006-08-23 Tania Bento <tbento@redhat.com>
+
+ * java/awt/Color.java
+ (brighter): Modified algorithm to correctly determine the
+ new brighter colour.
+
+2006-08-23 Roman Kennke <kennke@aicas.com>
+
+ * java/awt/Container.java
+ (maxSize): Removed field. This is already declared in Component.
+ (validateTree): Check for ContainerPeer. Don't addNotify here.
+ Only validate Component instances if they are invalid.
+
+2006-08-22 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JComponent.java
+ (preferredSize): Removed field.
+ (maximumSize): Removed field.
+ (minimumSize): Removed field.
+ (getMaximumSize): Adjusted to delegate to Component, rather
+ then managing the size in JComponent.
+ (getMinimumSize): Adjusted to delegate to Component, rather
+ then managing the size in JComponent.
+ (getPreferredSize): Adjusted to delegate to Component, rather
+ then managing the size in JComponent.
+ (isMaximumSizeSet): Removed.
+ (isMinimumSizeSet): Removed.
+ (isPreferredSizeSet): Removed.
+ (setMaximumSize): Removed.
+ (setMinimumSize): Removed
+ (setPreferredSize): Removed.
+
+2006-08-22 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/AbstractButton.java
+ (ButtonChangeListener.stateChanged): Delegate to combined
+ handler.
+ (EventHandler): New inner class. Handles all three types
+ of events on the model.
+ (eventHandler): New field. Stores the combined event
+ handler.
+ (AbstractButton): Moved listener initialization to
+ setModel().
+ (createActionListener): Return combined handler.
+ (createChangeListener): Return combined handler.
+ (createItemListener): Return combined handler.
+ (getEventHandler): New helper method for creating the combined
+ handler.
+ (setModel): Initialize listeners here.
+ * javax/swing/plaf/basic/BasicButtonListener.java
+ (ButtonAction): New class. Implements the keyboard action
+ for buttons.
+ (checkOpacity): Implemented.
+ (createDefaultActionMap): New helper method.
+ (installKeyboardActions): Rewritten to install InputMap
+ and ActionMap according to 'new' keyboard input method.
+ (mouseClicked): Commented as no-op.
+ (mouseDragged): Commented as no-op.
+ (mouseMoved): Commented as no-op.
+ (propertyChange): Check for contentAreaFilled change and
+ update opacity. Pull handling of HTLM in font and text handler.
+ (stateChanged): Repaint button.
+ (uninstallKeyboardActions): Properly uninstall keyboard actions.
+ * javax/swing/plaf/basic/BasicButtonUI.java
+ (listener): Removed.
+ (sharedListener): New static field. Stores the shared listener.
+ (sharedUI): New static field. Stores the shared UI.
+ (createButtonListener): Return shared instance here.
+ (createUI): Return shared instance here.
+ (getButtonListener): New helper method. Looks for the
+ BasicButtonListener installed on a button and returns it.
+ (installDefaults): Correctly install rollover property here.
+ Fetch defaultTextShiftOffset. Initialize opaqueness correctly.
+ (installKeyboardActions): Fetch listener with new helper method.
+ (installListeners): Don't use removed field. Check for null.
+ (installUI): Added comment about order of method invocations.
+ (uninstallDefaults): Don't uninstall non-uninstallable properties.
+ (uninstallKeyboardActions): Fetch listener with new helper method.
+ (uninstallListeners): Fetch listener with new helper method.
+ (paintIcon): Paint icon offset when pressed and armed.
+ * javax/swing/plaf/metal/MetalButtonListener.java: Removed.
+ * javax/swing/plaf/metal/MetalButtonUI.java
+ (sharedUI): New field. Stores the shared UI.
+ (MetalButtonUI): Don't initialize fields here.
+ (createButtonListener): Removed method. Use super impl.
+ (createUI): Return shared instance.
+ (getDisabledTextColor): Update field here.
+ (getFocusColor): Update field here.
+ (getSelectColor): Update field here.
+ (installDefaults): Don't handle rollover property here.
+ (uninstallDefaults): Don't handle rollover property here.
+ (paintButtonPressed): Use accessor method to update the
+ field value.
+
+2006-08-21 Mark Wielaard <mark@klomp.org>
+
+ Merge NATIVE_LAYER branch.
+
+ 2006-08-20 Mark Wielaard <mark@klomp.org>
+
+ * doc/tools.texinfo: Add file from trunk.
+ * native/jni/Makefile.am (DIST_SUBDIRS): Add native-lib.
+ * native/jni/java-io/java_io_VMFile.c: Include lstat and readlink
+ headers.
+ * native/jni/java-lang/java_lang_VMProcess.c
+ (Java_java_lang_VMProcess_nativeSpawn): Remove redirect argument.
+ * native/jni/java-net/java_net_VMInetAddress.c
+ (Java_java_net_VMInetAddress_getHostByName): Remove unused variable.
+ * native/jni/native-lib/Makefile.am: Remove empty and nonexisting
+ files.
+ * native/jni/native-lib/cpio.c (cpio_setFileReadonly): Use correct
+ mask.
+ * native/jni/native-lib/cpnet.c (cpnet_connect): Removed unused
+ theaddr.
+ * native/jni/native-lib/cpnet.h (cpnet_freeAddresses): Moved from
+ cpnet.h.
+ * native/jni/native-lib/cpnet.h (cpnet_freeAddresses): Declare,
+ don't implement.
+ * vm/reference/java/lang/VMProcess.java: Removed unused redirect
+ argument.
+ * include/java_lang_VMProcess.h: Regenerated.
+
+ 2006-07-09 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * native/jni/java-net/gnu_java_net_VMPlainDatagramSocketImpl.c
+ (nativeReceive): Fixed the type of the arrays (use java types).
+ (nativeSendTo): Force throwing an exception if port is 0.
+
+ * native/jni/java-net/javanet.c:
+ (_javanet_accept): Throw SocketTimeoutException if ETIMEDOUT is
+ returned.
+ (_javanet_recvfrom): Likewise.
+ (_javanet_sendto): Throw a NullPointerException if the socket is
+ not connected and no address is given.
+
+ * native/jni/java-net/javanet.h
+ (NULL_EXCEPTION): Defined.
+
+ 2006-06-16 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * native/jni/java-net/java_net_VMInetAddress.c
+ (Java_java_net_VMInetAddress_getHostByName): Fix detection of
+ error.
+
+ * native/jni/java-net/javanet.c
+ (_javanet_accept): Fixed bogus call to TARGET.
+ (_javanet_create_inetaddress): Fixed address generation. Fixed
+ bogus memory free.
+ (_javanet_bind): set "Reuse address" flag.
+
+ * native/jni/native-lib/cpio.c
+ (cpio_getModificationTime): Fixed type.
+ (cpio_removeFile): Use rmdir too.
+
+ * native/jni/native-lib/cpnet.c
+ (cpnet_getHostByName): Fixed error detection.
+
+ * native/jni/native-lib/cpnet.h
+ (cpnet_newIPV4address, cpnet_newIPV6address): Put zero in the
+ memory.
+ (cpnet_IPV4AddressToBytes): Fixed types.
+
+ 2006-06-10 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * native/jni/native-lib/cpio.c
+ (cpio_openDir, cpio_closeDir, cpio_readDir): Implemented.
+
+ * native/jni/native-lib/cpnet.h:
+ (cpnet_bytesToIPV4Address): Fixed type casting to avoid being
+ messed by signs in jbyte.
+
+ * native/jni/native-lib/cpproc.h
+ (CPIO_EXEC_NUM_PIPES): Compilation fix.
+
+ 2006-05-09 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * native/jni/native-lib/cpnet.c
+ (cpnet_getSocketTimeout, cpnet_setSocketTimeout): Reimplemented.
+ (waitForWritable, waitForReadable): New functions.
+ (socketTimeouts): New static global table to hold timeouts for all
+ socket fds.
+ (cpnet_accept,cpnet_bind,cpnet_sendTo,cpnet_recv,cpnet_recvFrom):
+ Added waitForXXXX safeguards to handle socket timeouts.
+
+ * native/jni/java-net/javanet.c
+ (_javanet_accept): Check for the right error value when a timeout
+ occurs.
+
+ 2006-03-25 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * native/jni/java-io/Makefile.am,
+ native/jni/java-lang/Makefile.am,
+ native/jni/java-net/Makefile.am,
+ native/jni/java-nio/Makefile.am: Link to libclasspathnative.la now.
+
+ * native/jni/native-lib/Makefile.am: Added cpproc.c
+
+ * native/jni/native-lib/cpio.c: Implemented missing functions for
+ CPIO.
+
+ * native/jni/native-lib/cpnet.c
+ (cpnet_getHostByName): Fixed address array initialization.
+
+ * native/jni/native-lib/cpproc.c: Implemented.
+
+ 2006-02-19 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * configure.ac: Invoke GCC_ATTRIBUTE_UNUSED.
+
+ * m4/gcc_attribute.m4: New file from ac_archive.
+
+ * native/jni/java-net/javanet.c: Adapted to cpnet API
+ modification.
+
+ * native/jni/native-lib/cpnet.c: Implemented.
+
+ * native/jni/native-lib/cpnet.h
+ (cpnet_openSocketDatagram,
+ cpnet_openSocketStream): These calls need an address family now.
+ (cpnet_IPV4AddressToBytes,
+ cpnet_bytesToIPV4Address): Convert the address to network order.
+
+ 2006-02-19 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * native/jni/java-io/java_io_VMFile.c,
+ native/jni/java-nio/gnu_java_nio_channels_FileChannelImpl.c,
+ native/jni/midi-dssi/dssi_data.h,
+ native/jni/native-lib/cpio.c,
+ native/jni/native-lib/cpmath.h: Removed cpmath
+ dependency. Fixed coding style.
+
+ 2006-02-18 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * native/jni/java-lang/java_lang_VMProcess.c: Removed TARGET
+ dependency. Simplified the JNI code by moving some part into the
+ native layer.
+
+ * native/jni/native-lib/cpproc.h: New interface to handle processes.
+
+ 2006-02-18 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * native/jni/java-net/java_net_VMInetAddress.c: Fixed compilation
+ errors. Removed any remaining TARGET invocations.
+
+ * native/jni/java-net/javanet.c
+ (_javanet_create_inetaddress): Removed spurious arr and
+ octets. Fixed compilation errors.
+
+ * native/jni/native-lib/cpnet.h
+ (cpnet_getHostname, cpnet_getHostByName, cpnet_getHostByAddr,
+ cpnet_setIPV4Any, cpnet_freeAddresses, cpnet_isIPV6Address,
+ cpnet_isIPV4Address): New functions.
+ (cpnet_bytesToIPV4Address): Fixed interface to be consistent with
+ the rest.
+
+ 2006-01-28 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * native/jni/java-io/java_io_VMFile.c,
+ native/jni/java-net/gnu_java_net_VMPlainDatagramSocketImpl.c,
+ native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c,
+ native/jni/java-net/javanet.c,
+ native/jni/java-net/javanet.h: Adapted the VM layer code
+ to the new native layer.
+
+ * native/jni/native-lib/cpnet.h
+ (cpnet_addMembership,
+ cpnet_dropMembership,
+ cpnet_getAvailableBytes): Added the declarations of
+ some new functions.
+ (cpnet_newIPV6Address,
+ cpnet_IPV6AddressToBytes,
+ cpnet_bytesToIPV6Address): Implemented.
+ (cpnet_newIPV4Address): Initialize the sin_family field.
+
+ 2006-01-28 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * native/target: Removed.
+
+ * configure.ac: Removed target from CLASSPATH_INCLUDES and
+ Makefile generation.
+
+ * native/jni/native-lib/Makefile.am,
+ native/jni/native-lib/cpnet.h,
+ native/jni/native-lib/cpnet.c
+ native/jni/native-lib/cpio.h,
+ native/jni/native-lib/cpio.c,
+ native/jni/native-lib/cpmath.h: Imported new native compatibility
+ layer.
+
+2006-08-21 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/css/CSSParser.java:
+ New class.
+ * gnu/javax/swing/text/html/css/CSSParserCallback.java:
+ New interface.
+ * gnu/javax/swing/text/html/css/CSSParserException.java:
+ New exception.
+ * gnu/javax/swing/text/html/css/CSSScanner.java:
+ Adjusted API comments. Made all constants package private.
+ (EOF): New constant field.
+ (parseBuffer): Made package private.
+ (tokenEnd): Made package private.
+ (CSSScanner): Initialize lookahead buffer with -1.
+ (main): Print out to System.out rather then System.err.
+ (nextToken): Push back character after IDENT.
+
+2006-08-21 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/io/File.java (normalizePath): Fixed handling of "//" and "\\".
+
+2006-08-21 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/css/CSSScanner.java
+ (main): Use buffered input stream.
+ (nextToken): Removed 65536 workaround. Use int value directly
+ without cast to char.
+ (readComment): Use int value directly without cast to char.
+ Cast to char only when putting the character into the buffer.
+ (readEscape): Likewise.
+ (readIdent): Likewise.
+ (readName): Likewise.
+ (readNum): Likewise.
+ (readString): Likewise.
+ (readWhitespace): Likewise.
+
+2006-08-21 Ingo Proetel <proetel@aicas.com>
+
+ * java/io/InputStreamReader.java
+ (bytesCache): New field.
+ (cacheLock): New field.
+ (read(byte[],int,int): Avoid allocations of new byte
+ array on every call and reuse cached byte array if possible.
+
+2006-08-21 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/net/local/LocalSocketImpl.java
+ Only load native lib if this is supported by runtime.
+ * native/jni/java-net/local.c
+ Include config.h unconditionally.
+ * native/jni/java-net/gnu_java_net_local_LocalSocketImpl.c
+ Include config.h unconditionally.
+
+2006-08-21 Friedjof Siebert <siebert@aicas.com>
+
+ * java/io/ObjectInputStream.java
+ (objectLookupTable): Changed to be a Vector.
+ (ObjectInputStream): Initialize objectLookupTable as Vector.
+ (assignNewHandle): Store Object using handle index rather than
+ Hashtable, using the new rememberHandle() method.
+ (hierarchy): New method. This replaces inputGetObjectStreamClasses()
+ with a caching in ObjectStreamClass.
+ (inputGetObjectStreamClass): Replaced by hierarchy().
+ (lookupHandle): New method. Looks up an object by it's handle
+ index.
+ (parseContent): Avoid creating of Integer objects. Use
+ hierarchy() method for looking up the class hierarchy.
+ (processResolution): Use rememberHandle() to store
+ handle per index, rather than Hashtabling the object.
+ (readFields):
+ (rememberHandle): New method.
+ * java/io/ObjectOutputStream.java
+ (OIDLookupTable): Use ObjectIdentityMap2Int instead of
+ Hashtable for improved lookup performance.
+ (ObjectOutputStream): Initialize OIDLookupTable as
+ ObjectIdentityMap2Int.
+ (assignNewHandle): Change to use ObjectIdentityMap2Int.
+ (findHandle): Change to use ObjectIdentityMap2Int.
+ (getBooleanField): Removed.
+ (getByteField): Removed.
+ (getCharField): Removed.
+ (getDoubleField): Removed.
+ (getField): Removed.
+ (getFloatField): Removed.
+ (getIntField): Removed.
+ (getLongField): Removed.
+ (getObjectField): Removed.
+ (writeFields(Object,ObjectStreamClass)): Use new helper method.
+ (writeFields(Object,ObjectStreamField)): New helper method.
+ Use switch rather then if-else cascade.
+ (writeObject): Use int handle, rather then Integer.
+ * java/io/ObjectStreamClass.java
+ (hierarchy): New field. Caches the class hierarchy.
+ (methodCache): New field. Caches methods.
+ (readObjectSignature): New field. Stores the read signature.
+ (uidCache): New field. Caches UIDs.
+ (writeObjectSignature): New field. Stores the write signature.
+ (cacheMethods): Cache methods in methodCache.
+ (calculateClassID): Outsourced from getClassUID()
+ for computing the UIDs.
+ (getClassUIDFromField): Outsourced from getClassUID() for
+ fetching the UID from the class field.
+ (getClassUID): Use cached uid if possible. Use new helper
+ methods for fetching the UID from the field or computing
+ from scratch.
+ (getObjectStreamClasses): Removed. Replaced by more
+ efficient hierarchy() method, that also caches the result.
+ (hierarchy): Replaces getObjectStreamClasses() for caching
+ the result.
+ (loadedByBootOrApplicationClassLoader): New helper method.
+ (setClass): Invalidate hierarchy cache.
+ (setSuperclass): Invalidate hierarchy cache.
+ * java/io/ObjectStreamField.java
+ (field): Made field package private for access from other
+ classes.
+ * gnu/java/io/ObjectIdentityWrapper.java: Removed.
+ * gnu/java/io/ObjectIdentityMap2Int.java: Efficient
+ hashtable for mapping objects to ints.
+
+2006-08-21 Roman Kennke <kennke@aicas.com>
+
+ * java/io/File.java
+ (getAbsolutePath): Fetch absolute path from
+ VMFile.getAbsolutePath(). Moved actual impl to there.
+ (isAbsolute): Let VMFile determine the absoluteness.
+ (toURL): Let VMFile convert the filename.
+ * vm/reference/java/io/VMFile.java
+ (getAbsolutePath): New method.
+ (isAbsolute): New method.
+ (toURL): New method.
+
+2006-08-21 Jeroen Frijters <jeroen@frijters.net>
+
+ * NEWS: Added note about updated VM interface.
+
+2006-08-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/management/ManagementFactory.java:
+ Updated documentation.
+
+2006-08-20 Ito Kazumitsu <kaz@maczuka.gcd.org>
+
+ Fixes bug #28412
+ * gnu/java/util/regex/CharIndexed.java(move1, setHitEnd, hitEnd):
+ New methods.
+ * gnu/java/util/regex/CharIndexedCharSequence.java,
+ gnu/java/util/regex/CharIndexedInputStream.java: Implemented the
+ new methods above.
+ * gnu/java/util/regex/RE.java(REG_FIX_STARTING_POSITION): New flag,
+ (match): call the new method setHitEnd of the input,
+ (getMatchImpl): Handle the new flag REG_FIX_STARTING_POSITION,
+ Some optimization commented out, Use CharIndexed#move1 instead of move.
+ * gnu/java/util/regex/REMatch.java: Made some debugging methods public.
+ * gnu/java/util/regex/REToken.java(match): The method body has been
+ moved to an internal private method, (matchFake): New method,
+ (setHitEnd): New method.
+ * gnu/java/util/regex/RETokenChar.java(matchThis): Call setHitEnd
+ if the match is not complete, (matchOneString): Count the number of
+ characters which matched the pattern.
+ * gnu/java/util/regex/RETokenEnd.java(fake): New field,
+ (setFake): New method, (match): Call super.match or super.matchFake.
+ * gnu/java/util/regex/RETokenEndSub.java(setHitEnd): New method.
+ * gnu/java/util/regex/RETokenOneOf.java(match): call the new method
+ setHitEnd of the input,
+ * gnu/java/util/regex/RETokenRepeated.java(match): Likewise.
+ * java/util/regex/Matcher.java(lookingAt, match): Use the new flag
+ RE.REG_FIX_STARTING_POSITION, (hitEnd, toString): New methods.
+
+2006-08-18 Tom Tromey <tromey@redhat.com>
+
+ * gnu/javax/swing/text/html/css/CSSScanner.java (readWhitespace): Push
+ the 'int', not the cast char.
+
+2006-08-18 Roger Sayle <roger@eyesopen.com>
+
+ * scripts/check_jni_methods.sh: Don't use the "set -C" command
+ which isn't available in all shells.
+
+2006-08-18 Roger Sayle <roger@eyesopen.com>
+
+ * lib/Makefile.am (resources): Fix some shell portability issues.
+
+2006-08-18 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * configure.ac (tool-wrappers): Check for ltdl support when tool
+ wrapper binaries are enabled.
+ * tools/Makefile.am (LIBJVM): Remove variable.
+ (AM_CPPFLAGS): Add LIBJVM define.
+ (gappletviewer_LDFLAGS, gjarsigner_LDFLAGS, gkeytool_LDFLAGS,
+ gjar_LDFLAGS, gnative2ascii_LDFLAGS, gserialver_LDFLAGS,
+ gjavah_LDFLAGS): Remove variables.
+ * tools/toolwrapper.c (main): Use dlopen to load libjvm library.
+
+2006-08-18 Tom Tromey <tromey@redhat.com>
+
+ * gnu/java/util/prefs/NodeWriter.java (writeParents): Removed
+ debugging prints.
+ * gnu/java/util/prefs/NodeReader.java (readNodes): Removed debugging
+ print.
+ (readEntries): Likewise.
+
+2006-08-17 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicTabbedPaneUI.java
+ (layoutLabel): Reset the text and icon rectangles.
+
+2006-08-17 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ PR classpath/28537
+ * native/plugin/Makefile.am (libgcjwebplugin_la_CXXFLAGS):
+ Transform gappletviewer name using program_transform_name.
+
+2006-08-17 Jeroen Frijters <jeroen@frijters.net>
+
+ * javax/swing/filechooser/FileSystemView.java
+ (getFileSystemView): Always return UnixFileSystemView, since
+ that's the only one we got. Marked with NotImplementedException.
+ * javax/swing/plaf/basic/BasicFileChooserUI.java
+ (mouseClicked, installUI): Don't parse path by hand.
+
+2006-08-17 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JComponent.java
+ (scrollRectToVisible): Handle intermediate non-JComponents
+ more gracefully.
+
+2006-08-17 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/RepaintManager.java
+ (blitBuffer): Removed. This is now done in commitBuffer().
+ (commitBuffer): Always paint on the root window or applet.
+ No need to look for intermediate heavyweights. Optimized
+ rectangle translation.
+ (commitRemainingBuffers): Removed. Not needed anymore.
+ (getHeavyweightParent): Removed. Not needed anymore.
+ (getOffscreenBuffer): Fetch offscreen image from the
+ actual root component.
+ (paintDirtyRegions): Don't call commitRemainingBuffers().
+
+2006-08-17 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/SwingUtilities.java
+ (clipString): New helper method for trimming strings.
+ (layoutCompoundLabelImpl): Fixed algorithm to conform
+ testsuites. Trim text if it's too long. Avoid creating
+ new Rectangles. Optimized for performance.
+ (layoutCompoundLabel): Use switch rather then if-else-chain.
+ * javax/swing/plaf/basic/BasicButtonUI.java
+ (viewR): New field.
+ (iconR): New field.
+ (textR): New field.
+ (paint): Reset and use cached rectangles. Only call paintIcon()
+ if icon is not null. Don't call paintButtonPressed() when
+ button is selected, only when it is both armed and pressed.
+ * javax/swing/plaf/basic/BasicGraphicsUtils.java
+ (getPreferredButtonSize): Reused cached rectangles rather
+ then creating new ones. Don't create new Rectangle via
+ Rectangle.union().
+ * javax/swing/plaf/basic/BasicLabelUI.java
+ (getPreferredSize): Correctly reset cached rectangles. Especially
+ the view rect must have a big size to give it room for layouting.
+ Short cut layout when text == null.
+ (paint): Correctly reset cached rectangles.
+ * javax/swing/plaf/basic/BasicMenuItemUI.java
+ (resetRectangles): New helper method.
+ (getPreferredMenuItemSize): Correctly reset the cached rectangles.
+ (paintMenuItem): Correctly reset the cached rectangles.
+ * javax/swing/plaf/basic/BasicRadioButtonUI.java
+ (getPreferredSize): Use cached Rectangle objects and initialize
+ them correctly.
+ (paint): Use cached Rectangle objects and initialize
+ them correctly.
+
+2006-08-17 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/util/Calendar.java: API doc additions.
+
+2006-08-17 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/DefaultButtonModel.java:
+ (setRollover): Simplified statement.
+
+2006-08-17 Jeroen Frijters <jeroen@frijters.net>
+
+ * gnu/java/rmi/server/RMIClassLoaderImpl.java
+ (loadClass): Rewritten to use getClassLoader.
+ (loadProxyClass): Implemented.
+ (getClassLoader): Fixed support for null or empty codebase.
+ * gnu/java/rmi/server/RMIObjectInputStream.java
+ (resolveClass): Use user class loader as default class loader.
+ (resolveProxyClass): Delegate to RMIClassLoader.loadProxyClass.
+ * gnu/javax/rmi/CORBA/UtilDelegateImpl.java
+ (loadClass): Simplified and use user class loader instead of
+ context class loader as default.
+ * java/io/ObjectInputStream.java
+ (currentLoader): Use VMStackWalker.firstNonNullClassLoader().
+ * vm/reference/gnu/classpath/VMStackWalker.java
+ (firstNonNullClassLoader): New method.
+ * vm/reference/java/io/VMObjectInputStream.java
+ (loaderAction, currentClassLoader): Removed.
+
+2006-08-17 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/plaf/basic/BasicTabbedPaneUI.java:
+ (getTabBounds(JTabbedPane, int)): Added code to shift rectangle
+ by current scroll offset, added method documention.
+ (getTabBounds(int, Rectangle)): Added method documentation.
+ * javax/swing/plaf/metal/MetalTabbedPaneUI.java:
+ (paintContentBorderLeftEdge): Changed y to 1.
+
+2006-08-17 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/plaf/basic/BasicTabbedPaneUI.java:
+ (MouseHandler.mouseReleased): Implemented.
+ (MouseHandler.mousePressed): Added delegation to tabbed pane.
+ (MouseHandler.mouseEntered): Dito.
+ (MouseHandler.mouseExited): Dito.
+ (MouseHandler.mouseMoved): Dito.
+ (MouseHandler.redispatchEvent): New method.
+ (PropertyChangeHandler.propertyChange): Added extra block level,
+ added code to handle tab placement changes, added comment.
+ (updateViewPosition): Set unneeded coordinate to 0, added comment.
+
+2006-08-16 Roman Kennke <kennke@aicas.com>
+
+ * gnu/javax/swing/text/html/css/CSSScanner.java: New file.
+ * gnu/javax/swing/text/html/css/CSSLexicalException.java:
+ New file.
+
+2006-08-16 Mark Wielaard <mark@klomp.org>
+
+ * java/awt/Component.java (orientation): Renamed to
+ componentOrientation.
+ (setComponentOrientation): Use new field name.
+ (getComponentOrientation): Likewise.
+
+2006-08-16 Roman Kennke <kennke@aicas.com>
+
+ PR 28750
+ * javax/swing/plaf/basic/BasicTreeUI.java
+ (CellEditorHandler.editingCancelled): Call completeEditing
+ directly.
+ (CellEditorHandler.editingStopped): Call completeEditing
+ directly.
+ (NodeDimensionHandler.getNodeDimensions): Rewritten
+ to use the preferred sizes of the renderer and editor.
+ (TreeExpansionHandler.treeCollapsed): Complete editing
+ here.
+ (TreeSelectionHandler.valueChanged): Complete editing
+ here.
+ (cancelEditing): Call completeEditing with false, false and
+ false. Don't call finish (removed method).
+ (completeEditing(boolean,boolean,boolean): Only do something when
+ stopEditingInCompleteEditing is true. Nullify editingComponent
+ and editingPath. Remove editingComponent from tree. Update
+ the layout when necessary and repaint.
+ (completeEditing): Stop editing when necessary.
+ (editorRequestFocus): New helper method. Request focus
+ on the actual editor.
+ (finish) Removed. This is now done in completeEditing().
+ (prepareForUIInstall): Set stopEditingInCompleteEditing to true.
+ (setLargeModel): Complete editing here.
+ (setRootVisible): Complete editing here.
+ (setRowHeight): Complete editing here.
+ (setSelectionModel): Complete editing here.
+ (startEditing): Correctly initialize and start editing.
+ (updateExpandedDescendants): Complete editing here.
+ * javax/swing/tree/DefaultTreeCellEditor.java
+ (DefaultTextField): Fetch size from super and use renderer's height
+ if appropriate.
+ (EditorContainer.EditorContainer): Set layout to null, just
+ to make sure.
+ (EditorContainer.doLayout): Layout so that the editor
+ is offset to the right of the icon.
+ (EditorContainer.getPreferredSize): Implemented to
+ provide a reasonable preferred size.
+ (EditorContainer.paint): Position icon in the middle.
+ Also paint border if appropriate.
+ (EditorContainer.setBounds): Removed.
+ (RealEditorListener): Removed.
+ (DefaultTreeCellEditor): Set correct border.
+ (cancelCellEditing): Message real editor. Call finish().
+ (createCellEditor): Don't add listener.
+ (determineOffset): Correctly determine offset, and update
+ the icon.
+ (finish): New helper method.
+ (getTreeCellEditorComponent): Set correct font. Call
+ prepareForEditing() and determineOffset() to correctly initialize
+ the state.
+ (stopCellEditing): Messsage realEditor to stop editing. Call
+ finish to clean up.
+ (stopEditingTimer): Removed.
+ (valueChanged): Correctly reset lastPath.
+ * javax/swing/tree/DefaultTreeCellRenderer.java
+ (getPreferredSize): Return super plus some extra space for
+ better readability.
+
+2006-08-16 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/metal/MetalTreeUI.java
+ (LineStyleListener): New property listener, that updates
+ the line style setting if the corresponding property
+ changes.
+ (lineStyleListener): New field.
+ (lineStyle): New field.
+ (LINE_STYLE_ANGLED): New constant field.
+ (LINE_STYLE_HORIZONTAL): New constant field.
+ (LINE_STYLE_NONE): New constant field.
+ (LINE_STYLE_VALUE_ANGLED): New constant field.
+ (LINE_STYLE_VALUE_HORIZONTAL): New constant field.
+ (LINE_STYLE_VALUE_NONE): New constant field.
+ (LINE_STYLE_PROPERTY): New constant field.
+ (decodeLineStyle): Implemented.
+ (installUI): Install line style listener. Set initial
+ lineStyle.
+ (uninstallUI): Uninstall line style listener.
+ (paintHorizontalPartOfLeg): Only call super for angled
+ lineStyle.
+ (paintVerticalPartOfLeg): Only call super for angled
+ lineStyle.
+ (paintHorizontalSeparators): Implemented.
+ (paint): If lineStyle==HORIZONTAL, call
+ paintHorizontalSeparators().
+ * examples/gnu/classpath/examples/swing/TreeDemo.java
+ (createContent): Add panel for selecting line styles.
+
+2006-08-16 Robert Schuster <robertschuster@fsfe.org>
+
+ * examples/gnu/classpath/demo/swing/TabbedPaneDemo.java:
+ (createContent): Rewritten.
+ (createPlacementChangingMenuItem): New method.
+ (createLayoutPolicyChangingMenuItem): New method.
+ (createTabbedPane): New method.
+ (createTabContent): New method.
+
+2006-08-16 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/plaf/basic/BasicTabbedPaneUI.java:
+ (MouseHandler.mousePressed): Fixed indentation, intercept clicks on
+ disabled tabs, do proper revalidation in WRAP_TAB_LAYOUT mode.
+
+2006-08-16 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/text/WrappedPlainView.java:
+ (WrappedLine.modelToView): Provide variable pos as argument and not a fixed value.
+ (calculateBreakPosition): Add p0 to return value.
+
+2006-08-15 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicTreeUI.java
+ (MouseHandler.selectedOnPress): New field.
+ (MouseHandler.handleEvent): New helper method for handling
+ selection and start/stop editing for mouse events.
+ (MouseHandler.mouseDragged): Commented as no-op method.
+ (MouseHandler.mouseMoved): Commented as no-op method.
+ (MouseHandler.mousePressed): Use handleEvent() to handle
+ selection and editing handling.
+ (MouseHandler.mouseReleased): Use handleEvent() to handle
+ selection and editing handling.
+ (MouseInputHandler.MouseInputHandler): Register itself
+ as mouse listener on source. Redispatch event to
+ destination.
+ (MouseInputHandler.dispatch): New helper method.
+ (MouseInputHandler.mouseClicked): Dispatch event.
+ (MouseInputHandler.mouseDragged): Dispatch event.
+ (MouseInputHandler.mouseEntered): Stop dispatching
+ if dragging stopped.
+ (MouseInputHandler.mouseExited): Stop dispatching
+ if dragging stopped.
+ (MouseInputHandler.mouseMoved): Stop dispatching.
+ (MouseInputHandler.mousePressed): Marked as no-op.
+ (MouseInputHandler.mouseReleased): Dispatch and stop
+ dispatching afterwards.
+ (MouseInputHandler.removeFromSource): Implemented.
+ (PropertyChangeHandler.propertyChange): Also handle
+ editable property changes by calling setEditable().
+ (SelectionModelPropertyChangeHandler.propertyChange):
+ Reset row selection.
+ (startEditTimer): Removed.
+ (setCellEditor): Call updateEditor().
+ (setEditable): Call updateEditor().
+ (startEditingAtPath): Make path fully visible before starting
+ editing.
+ (startEditing): Maybe cancel previous edit session. Add
+ editing component itself, not its parent container.
+ Register MouseInputHandler for correctly redispatching
+ initial events.
+ (stopEditing): Message cellEditor and only completeEditing()
+ when approved by cell editor.
+ (updateCellEditor): Complete editing before updating
+ the cell editor. Get cell editor from JTree if possible,
+ otherwise create default editor. Update the listeners
+ on the editor.
+ * javax/swing/tree/DefaultTreeCellEditor.java
+ (CLICK_COUNT_TO_START): Removed.
+ (DefaultTreeCellEditor): Install correct border. Let setTree()
+ update the listeners. Don't initialize lastPath and font yet.
+ (actionPerformed): Implemented to start editing.
+ (createTreeCellEditor): Set click count to start to 1, rather than
+ 3.
+ (isCellEditable): Prepare editor here. Determine if we can
+ start immediately, or if we trigger a timer to do so.
+ (prepareForEditing): Don't removeAll() (not necessary),
+ check editingComponent to be non-null.
+ (setTree): Update listeners.
+ (shouldStartEditingTimer): Check for left mouse button.
+ (startEditingTimer): Lazily create timer.
+
+2006-08-15 Lillian Angel <langel@redhat.com>
+
+ * java/awt/dnd/DropTargetDragEvent.java
+ (getTransferable): Implemented.
+
+2006-08-15 Roman Kennke <kennke@aicas.com>
+
+ * java/util/Vector.java
+ (removeAll): Added comment about NPE.
+ (retainAll): Added comment about NPE.
+
+2006-08-15 Roman Kennke <kennke@aicas.com>
+
+ * java/util/zip/ZipFile.java
+ (UTF8DECODER): Removed.
+ (UTF8CHARSET): New constant field. Stores the UTF8 charset.
+ (utf8Decoder): New instance field.
+ (decodeChars): Lazily create UTF8 decoder. Use instance
+ field rather than a static field to avoid corruption.
+
+2006-08-15 Roman Kennke <kennke@aicas.com>
+
+ * java/io/PrintStream.java
+ (line_separator): Provide default for system property.
+ * java/io/FileDescriptor.java
+ (valid): Create local copy of channel field for better
+ threading safetly.
+
+2006-08-15 Ingo Proetel <proetel@aicas.com>
+
+ * java/util/zip/ZipFile.java
+ (PartialInputStream.UTF8DECODER): New constant field, used
+ for decoding UTF8 strings.
+ (readLeShort): Access buffer directly if it has enough bytes
+ available.
+ (readLeInt): Access buffer directly if it has enough bytes
+ available.
+ (decodeChars): New helper method for decoding UTF8 strings.
+ (readString): Avoid NIO charset decoder if possible.
+
+2006-08-15 Roman Kennke <kennke@aicas.com>
+
+ * java/util/Vector.java
+ (removeAll): Don't explicitly null-check here. The RI allows
+ null arguments when Vector is empty. In other cases we
+ implicitly throw an NPE.
+ (retainAll): Don't explicitly null-check here. The RI allows
+ null arguments when Vector is empty. In other cases we
+ implicitly throw an NPE.
+
+2006-08-14 Casey Marshall <csm@gnu.org>
+
+ Merge in ssl-nio-branch work. See `ChangeLog-ssl-nio' for a record
+ of changes made on this branch.
+ Files modified:
+ * gnu/classpath/debug/Component.java
+ * gnu/classpath/debug/SystemLogger.java
+ * gnu/java/security/action/GetPropertyAction.java
+ * gnu/java/security/action/GetSecurityPropertyAction.java
+ * gnu/javax/crypto/RSACipherImpl.java
+ * gnu/javax/net/ssl/PrivateCredentials.java
+ * gnu/javax/net/ssl/provider/Alert.java
+ * gnu/javax/net/ssl/provider/AlertException.java
+ * gnu/javax/net/ssl/provider/Certificate.java
+ * gnu/javax/net/ssl/provider/CertificateRequest.java
+ * gnu/javax/net/ssl/provider/CertificateType.java
+ * gnu/javax/net/ssl/provider/CertificateVerify.java
+ * gnu/javax/net/ssl/provider/CipherSuite.java
+ * gnu/javax/net/ssl/provider/ClientHello.java
+ * gnu/javax/net/ssl/provider/ClientKeyExchange.java
+ * gnu/javax/net/ssl/provider/CompressionMethod.java
+ * gnu/javax/net/ssl/provider/Constructed.java
+ * gnu/javax/net/ssl/provider/ContentType.java
+ * gnu/javax/net/ssl/provider/DiffieHellman.java
+ * gnu/javax/net/ssl/provider/Extension.java
+ * gnu/javax/net/ssl/provider/Finished.java
+ * gnu/javax/net/ssl/provider/Handshake.java
+ * gnu/javax/net/ssl/provider/Jessie.java
+ * gnu/javax/net/ssl/provider/ProtocolVersion.java
+ * gnu/javax/net/ssl/provider/Random.java
+ * gnu/javax/net/ssl/provider/ServerHello.java
+ * gnu/javax/net/ssl/provider/ServerKeyExchange.java
+ * gnu/javax/net/ssl/provider/Signature.java
+ * gnu/javax/net/ssl/provider/Util.java
+ * gnu/javax/net/ssl/provider/X509KeyManagerFactory.java
+ * gnu/javax/net/ssl/provider/X509TrustManagerFactory.java
+ * java/security/MessageDigest.java
+ * java/security/MessageDigestSpi.java
+ * java/security/Signature.java
+ * java/security/SignatureSpi.java
+ * javax/crypto/Mac.java
+ * javax/crypto/MacSpi.java
+ * javax/net/ssl/HandshakeCompletedEvent.java
+ * javax/net/ssl/HttpsURLConnection.java
+ * javax/net/ssl/SSLContext.java
+ * javax/net/ssl/SSLContextSpi.java
+ * javax/net/ssl/SSLSession.java
+ Files added:
+ * gnu/javax/net/ssl/provider/ServerKeyExchangeBuilder.java
+ * gnu/javax/net/ssl/provider/SSLv3HMacSHAImpl.java
+ * gnu/javax/net/ssl/provider/SimpleSessionContext.java
+ * gnu/javax/net/ssl/provider/ServerRSAParams.java
+ * gnu/javax/net/ssl/provider/SSLContextImpl.java
+ * gnu/javax/net/ssl/provider/ServerDHParams.java
+ * gnu/javax/net/ssl/provider/ClientHelloBuilder.java
+ * gnu/javax/net/ssl/provider/ClientDHE_PSKParameters.java
+ * gnu/javax/net/ssl/provider/SignatureAlgorithm.java
+ * gnu/javax/net/ssl/provider/CipherSuiteList.java
+ * gnu/javax/net/ssl/provider/ServerNameList.java
+ * gnu/javax/net/ssl/provider/SSLServerSocketImpl.java
+ * gnu/javax/net/ssl/provider/CompressionMethodList.java
+ * gnu/javax/net/ssl/provider/ServerRSA_PSKParameters.java
+ * gnu/javax/net/ssl/provider/ClientKeyExchangeBuilder.java
+ * gnu/javax/net/ssl/provider/TrustedAuthorities.java
+ * gnu/javax/net/ssl/provider/CertificateStatusRequest.java
+ * gnu/javax/net/ssl/provider/ServerHelloDone.java
+ * gnu/javax/net/ssl/provider/ServerDHE_PSKParameters.java
+ * gnu/javax/net/ssl/provider/SSLSocketImpl.java
+ * gnu/javax/net/ssl/provider/ServerHelloBuilder.java
+ * gnu/javax/net/ssl/provider/Record.java
+ * gnu/javax/net/ssl/provider/SSLRSASignatureImpl.java
+ * gnu/javax/net/ssl/provider/EncryptedPreMasterSecret.java
+ * gnu/javax/net/ssl/provider/PreSharedKeyManagerFactoryImpl.java
+ * gnu/javax/net/ssl/provider/KeyExchangeAlgorithm.java
+ * gnu/javax/net/ssl/provider/SSLServerSocketFactoryImpl.java
+ * gnu/javax/net/ssl/provider/CertificateBuilder.java
+ * gnu/javax/net/ssl/provider/ClientRSA_PSKParameters.java
+ * gnu/javax/net/ssl/provider/CertificateStatusType.java
+ * gnu/javax/net/ssl/provider/ExtensionList.java
+ * gnu/javax/net/ssl/provider/ClientCertificateTypeList.java
+ * gnu/javax/net/ssl/provider/ClientPSKParameters.java
+ * gnu/javax/net/ssl/provider/X500PrincipalList.java
+ * gnu/javax/net/ssl/provider/ServerHandshake.java
+ * gnu/javax/net/ssl/provider/ClientDiffieHellmanPublic.java
+ * gnu/javax/net/ssl/provider/SessionImpl.java
+ * gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.java
+ * gnu/javax/net/ssl/provider/ServerPSKParameters.java
+ * gnu/javax/net/ssl/provider/TruncatedHMAC.java
+ * gnu/javax/net/ssl/provider/MaxFragmentLength.java
+ * gnu/javax/net/ssl/provider/HelloRequest.java
+ * gnu/javax/net/ssl/provider/ServerKeyExchangeParams.java
+ * gnu/javax/net/ssl/provider/UnresolvedExtensionValue.java
+ * gnu/javax/net/ssl/provider/CipherAlgorithm.java
+ * gnu/javax/net/ssl/provider/ClientHandshake.java
+ * gnu/javax/net/ssl/provider/ExchangeKeys.java
+ * gnu/javax/net/ssl/provider/CertificateURL.java
+ * gnu/javax/net/ssl/provider/EmptyExchangeKeys.java
+ * gnu/javax/net/ssl/provider/CertificateRequestBuilder.java
+ * gnu/javax/net/ssl/provider/SSLv3HMacMD5Impl.java
+ * gnu/javax/net/ssl/provider/Builder.java
+ * gnu/javax/net/ssl/provider/Debug.java
+ * gnu/javax/net/ssl/provider/SSLEngineImpl.java
+ * gnu/javax/net/ssl/provider/MacAlgorithm.java
+ * gnu/javax/net/ssl/provider/DelegatedTask.java
+ * gnu/javax/net/ssl/provider/InputSecurityParameters.java
+ * gnu/javax/net/ssl/provider/ClientHelloV2.java
+ * gnu/javax/net/ssl/provider/OutputSecurityParameters.java
+ * gnu/javax/net/ssl/provider/AbstractHandshake.java
+ * javax/net/ssl/SSLEngine.java
+ * javax/net/ssl/CertPathTrustManagerParameters.java
+ * javax/net/ssl/KeyStoreBuilderParameters.java
+ * javax/net/ssl/X509ExtendedKeyManager.java
+ * javax/net/ssl/SSLEngineResult.java
+ * gnu/javax/net/ssl/PreSharedKeyManager.java
+ * gnu/javax/net/ssl/Session.java
+ * gnu/javax/net/ssl/PreSharedKeyManagerParameters.java
+ * gnu/javax/net/ssl/SSLCipherSuite.java
+ * gnu/javax/net/ssl/AbstractSessionContext.java
+ * gnu/javax/net/ssl/SessionStoreException.java
+ * gnu/javax/net/ssl/SSLRecordHandler.java
+ * gnu/javax/net/ssl/SSLProtocolVersion.java
+ * gnu/javax/crypto/key/GnuPBEKey.java
+ * gnu/java/security/util/ByteBufferOutputStream.java
+ * gnu/java/security/Requires.java
+ * gnu/javax/security/auth/callback/CertificateCallback.java
+ Files removed:
+ * gnu/javax/net/ssl/provider/Context.java
+ * gnu/javax/net/ssl/provider/DigestInputStream.java
+ * gnu/javax/net/ssl/provider/DigestOutputStream.java
+ * gnu/javax/net/ssl/provider/Enumerated.java
+ * gnu/javax/net/ssl/provider/Extensions.java
+ * gnu/javax/net/ssl/provider/GNUSecurityParameters.java
+ * gnu/javax/net/ssl/provider/JCESecurityParameters.java
+ * gnu/javax/net/ssl/provider/JDBCSessionContext.java
+ * gnu/javax/net/ssl/provider/JessieDHPrivateKey.java
+ * gnu/javax/net/ssl/provider/JessieDHPublicKey.java
+ * gnu/javax/net/ssl/provider/JessieRSAPrivateKey.java
+ * gnu/javax/net/ssl/provider/JessieRSAPublicKey.java
+ * gnu/javax/net/ssl/provider/KeyPool.java
+ * gnu/javax/net/ssl/provider/OverflowException.java
+ * gnu/javax/net/ssl/provider/RecordInput.java
+ * gnu/javax/net/ssl/provider/RecordInputStream.java
+ * gnu/javax/net/ssl/provider/RecordOutputStream.java
+ * gnu/javax/net/ssl/provider/RecordingInputStream.java
+ * gnu/javax/net/ssl/provider/SSLRSASignature.java
+ * gnu/javax/net/ssl/provider/SSLServerSocket.java
+ * gnu/javax/net/ssl/provider/SSLServerSocketFactory.java
+ * gnu/javax/net/ssl/provider/SSLSocket.java
+ * gnu/javax/net/ssl/provider/SSLSocketFactory.java
+ * gnu/javax/net/ssl/provider/SSLSocketInputStream.java
+ * gnu/javax/net/ssl/provider/SSLSocketOutputStream.java
+ * gnu/javax/net/ssl/provider/SecurityParameters.java
+ * gnu/javax/net/ssl/provider/Session.java
+ * gnu/javax/net/ssl/provider/SessionContext.java
+ * gnu/javax/net/ssl/provider/SynchronizedRandom.java
+ * gnu/javax/net/ssl/provider/XMLSessionContext.java
+
+2006-08-14 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicSplitPaneDivider.java
+ (DividerLayout.layoutContainer): Removed debug output.
+ * javax/swing/plaf/basic/BasicSplitPaneUI.java
+ (BasicHorizontalLayoutManager.axis): New field.
+ (BasicHorizontalLayoutManager.BasicHorizontalLayoutManager(int)):
+ New constructor.
+ (BasicHorizontalLayoutManager.BasicHorizontalLayoutManager()):
+ Call new axis constructor.
+ (BasicHorizontalLayoutManager.getAvailableSize): Refactored to
+ handle direction.
+ (BasicHorizontalLayoutManager.getInitialLocation): Refactored to
+ handle direction.
+ (BasicHorizontalLayoutManager.getPreferredSizeOfComponent):
+ Refactored to handle direction.
+ (BasicHorizontalLayoutManager.getSizeOfComponent): Refactored
+ to handle direction.
+ (BasicHorizontalLayoutManager.minimumLayoutSize): Refactored to
+ handle direction.
+ (BasicHorizontalLayoutManager.preferredLayoutSize): Refactored
+ to handle direction.
+ (BasicHorizontalLayoutManager.minimumSizeOfComponent): Refactored
+ to handle direction.
+ (BasicHorizontalLayoutManager.setComponentToSize): Refactored
+ to handle direction.
+ (BasicHorizontalLayoutManager.updateComponents): Don't reset
+ divider size.
+ (BasicVerticalLayoutManager.BasicVerticalLayoutManager):
+ New explicit constructor. Calls super with vertical axis.
+ (BasicVerticalLayoutManager.getAvailableSize): Functionality moved
+ to BasicHorizontalLayoutManager.
+ (BasicVerticalLayoutManager.getInitialLocation): Functionality
+ moved to BasicHorizontalLayoutManager.
+ (BasicVerticalLayoutManager.getPreferredSizeOfComponent):
+ Functionality moved to BasicHorizontalLayoutManager.
+ (BasicVerticalLayoutManager.getSizeOfComponent): Functionality
+ moved to BasicHorizontalLayoutManager.
+ (BasicVerticalLayoutManager.minimumLayoutSize): Functionality
+ moved to BasicHorizontalLayoutManager.
+ (BasicVerticalLayoutManager.minimumSizeOfComponent):
+ Functionality moved to BasicHorizontalLayoutManager.
+ (BasicVerticalLayoutManager.preferredLayoutSize): Functionality
+ moved to BasicHorizontalLayoutManager.
+ (BasicVerticalLayoutManager.setComponentToSize): Functionality
+ moved to BasicHorizontalLayoutManager.
+ * javax/swing/plaf/metal/MetalSplitPaneDivider.java
+ (BUTTON_SPRITE): Renamed to BUTTON_SPRITE_L.
+ (BUTTON_SPRITE_R): New constant field.
+ (MetalOneTouchButton.paint): Paint R sprite for right buttons,
+ L sprite for left buttons.
+
+2006-08-14 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
+ (query_formats): g_free 'name' after usage.
+ g_strfreev 'ch', the gdk_pixbuf_format_get_extensions instance.
+ g_strfreev 'ch', the gdk_pixbuf_format_get_mime_types instance.
+
+2006-08-14 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ PR classpath/27723
+ * configure.ac (MOZILLA_FOUND): Add pkg-config check for
+ seamonkey-plugin.
+
+2006-08-14 Francis Kung <fkung@redhat.com>
+
+ PR 28694
+ * java/awt/image/ColorModel.java
+ (coerceData): Added check for non-transparent images.
+
+2006-08-14 Francis Kung <fkung@redhat.com>
+
+ * java/awt/image/BandCombineOp.java
+ (BandCombineOp): Perform checks on validity of matrix.
+ (createCompatibleDestRaster): Add checks and choose raster type dynamically.
+ (filter): Updated to work with new matrix storage.
+ (getMatrix): Updated javadoc.
+ (getPoint2D): Formatting change.
+
+2006-08-14 Francis Kung <fkung@redhat.com>
+
+ * java/awt/image/AffineTransformOp.java
+ (AffineTransformOp): Updated javadoc.
+ (createCompatibleDestImage): Match behaviour of reference implementation.
+ (createCompatibleDestRaster): Formatting changes.
+ (filter(BufferedImage, BufferedImage)): Create compatible destination image.
+ (filter(Raster, WritableRaster)): Re-implemented.
+ (filterBicubic): New private method.
+ (filterBilinear): New private method.
+ (filterNearest): New private method.
+ (getBounds2D): No longer fixed around one point for rotations.
+ (getInterpolationType): Add support for bicubic interpolation.
+
+2006-08-14 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/metal/MetalLookAndFeel.java
+ (MetalLookAndFeel): Moved theme initialization to
+ getDefaults().
+ (createDefaultTheme): Forward to getCurrentTheme().
+ (getDefaults): Initialize theme before doing anything else.
+ (getCurrentTheme): Recognize swing.metalTheme property.
+
+2006-08-14 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JTable
+ (getScrollableUnitIncrement): Expose partially exposed
+ row in scrolling direction.
+
+2006-08-14 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ * javax/swing/JTable (getScrollableUnitIncrement):
+ Removing my name as the whole method body have been
+ recently completely replaced.
+
+2006-08-14 Roman Kennke <kennke@aicas.com>
+
+ PR 28028
+ * javax/swing/text/Utilities.java
+ (getTabbedTextOffset): Don't add p0 here.
+
+2006-08-14 Roman Kennke <kennke@aicas.com>
+
+ PR 28719
+ * javax/swing/plaf/basic/BasicScrollPaneUI.java
+ (MouseWheelHandler.mouseWheelMoved): Scroll negative delta
+ when wheel is going up.
+
+2006-08-14 Roman Kennke <kennke@aicas.com>
+
+ PR 28693
+ * javax/swing/plaf/basic/BasicSplitPaneDivider.java
+ (BasicOneTouchButton): New inner class.
+ (DividerLayout.changeButtonOrientation): Removed.
+ (DividerLayout.positionButtons): Moved into layoutContainer.
+ (DividerLayout.layoutContainer): Reworked for correct layout.
+ (OneTouchAction): New inner class.
+ (centerOneTouchButtons): New field.
+ (BasicSplitPaneDivider): Initialize centerOneTouchButton from
+ UIManager.
+ (createLeftOneTouchButton): Reimplemented to return
+ BasicOneTouchButton.
+ (createRightOneTouchButton): Reimplemented to return
+ BasicOneTouchButton.
+ (getPreferredSize): Reimplemented to return fixed preferredSize.
+ (oneTouchExpandableChanged): Add OneTouchAction action to
+ buttons. Don't install mouse listeners.
+ (MouseHandler.mousePressed): Removed handling of one touch buttons.
+ (paint): Don't trigger extra paint for buttons.
+ (propertyChange): Revalidate splitPane when orientation is changed.
+ (setBasicSplitPaneUI): Call oneTouchExpandableChanged only when
+ oneTouchExpandable is true.
+ * javax/swing/plaf/basic/BasicSplitPaneUI.java
+ (installDefaults): Install dividerSize on the divider too.
+ * javax/swing/plaf/metal/MetalSplitPaneDivider.java
+ (MetalDividerLayout): Removed. Functionality is already
+ in BasicSplitPaneDivider.DividerLayout.
+ (MetalOneTouchButton): New inner class.
+ (BUTTON_SPRITE): New constant field.
+ (MetalSplitPaneDivider): Don't change layout.
+ (createLeftOneTouchButton): Overridden to return custom button
+ for Metal.
+ (createRightOneTouchButton): Overridden to return custom button
+ for Metal.
+ (paint): Don't trigger button painting. Call super instead.
+
+2006-08-13 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicTableHeaderUI.java
+ (installKeyboardAction): Unmarked as stub. Added comment
+ explaining that the RI seems to do nothing here.
+ (uninstallKeyboardAction): Unmarked as stub. Added comment
+ explaining that the RI seems to do nothing here.
+
+2006-08-13 Roman Kennke <kennke@aicas.com>
+
+ PR 28135
+ * javax/swing/ScrollPaneLayout.java
+ (layoutContainer): Consider the viewportBorder of the
+ JScrollPane.
+ (minimumLayoutSize): Consider the viewportBorder of the
+ JScrollPane.
+ (preferredLayoutSize): Consider the viewportBorder of the
+ JScrollPane.
+ * javax/swing/plaf/basic/BasicScrollPaneUI.java
+ (installDefaults): Also install viewportBorder if specified.
+ (paint): Paint viewportBorder if present.
+ (uninstallDefaults): Uninstall viewportBorder if appropriate.
+ Don't nullify foreground, background and font. Uninstall
+ border via LookAndFeel helper method to avoid uninstall
+ user set border.
+
+2006-08-13 Roman Kennke <kennke@aicas.com>
+
+ PR 28696
+ * javax/swing/plaf/basic/BasicHTML.java
+ (HTMLRootView.HTMLRootView): Trigger initial layout.
+ (HTMLRootView.setSize): Overridden to forward to real view.
+ * javax/swing/plaf/basic/BasicToolTipUI.java
+ (PropertyChangeHandler): New inner class. Updates the HTML
+ renderer.
+ (propertyChangeHandler): New field.
+ (getMaximumSize): Add HTML width delta.
+ (getMinimumSize): Add HTML width delta.
+ (getPreferredSize): Reimplemented to use HTML view for size
+ calculation if appropriate, otherwise use simple stringWidth()
+ measurement.
+ (installListeners): Install propertyChangeHandler.
+ (uninstallListeners): Uninstall propertyChangeHandler.
+ (installUI): Update HTML renderer.
+ (uninstallUI): Update HTML renderer.
+ (paint): Reimplemented to use HTML view for rendering if
+ appropriate, simple drawString otherwise.
+ * javax/swing/plaf/metal/MetalToolTipUI.java
+ (getPreferredSize): Call super and add accelerator delta.
+ (paint): Simply call super.
+
+2006-08-13 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JMenu.java
+ (changeListener): Renamed to menuChangeListener to avoid
+ shadowing changeListener field from AbstractButton.
+
+2006-08-13 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JTree.java
+ (getScrollableUnitIncrement): Fixed direction.
+ (getScrollableBlockIncrement): Implemented to scroll one
+ page.
+ * javax/swing/tree/VariableHeightLayoutCache.java
+ (distance): Consider y + height already outside the node.
+
+2006-08-13 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JTable.java
+ (getScrollableUnitIncrement): Fixed direction. Make it behave
+ like the RI.
+ (getScrollableBlockIncrement): Fixed direction. Make it behave
+ like the RI.
+
+2006-08-13 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JList.java
+ (getScrollableUnitIncrement): Fixed direction. Implemented
+ horizontal scrolling. Improved usability.
+ (getScrollableBlockIncrement): Fixed direction. Improved usability.
+
+2006-08-13 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicScrollBarUI.java
+ (scrollByUnit): Scroll by -unit when direction is not positive
+ and +unit otherwise.
+ (scrollByBlock): Scroll by -unit when direction is not positive
+ and +unit otherwise.
+
+2006-08-13 Roman Kennke <kennke@aicas.com>
+
+ PR 28028
+ * javax/swing/text/PlainView.java
+ (paint): Limit painted area to the lines inside the clip
+ and allocation.
+
+2006-08-13 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicTextUI.java
+ (uninstallListeners): Unregister document listener.
+
+2006-08-13 Sven de Marothy <sven@physto.se>
+
+ * java/util/Locale.java
+ (hashcodeCache): New field.
+ (hashCode): use the above field instead of the serialized one
+ (writeObject): Removed method.
+ (readObject): Intern strings.
+ (equals): Revert to previous method.
+
+2006-08-13 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JTabbedPane.java
+ (JTabbedPane): Call setModel() here and let this install the
+ change listener correctly.
+ (setModel): Correctly uninstall and reinstall ChangeListener when
+ model changes.
+
+2006-08-13 Raif S. Naffah <raif@swiftdsl.com.au>
+
+ PR Classpath/23952
+ * java/util/ResourceBundle.java (CACHE_SIZE): New constant.
+ (bundleCache): Replaced with an LRU of CACHE_SIZE elements.
+ (lastDefaultLocale): Removed.
+ (emptyLocale): Likewise.
+ (BundleKey.defaultLocale): New field.
+ (BundleKey.BundleKey): Add a Locale (as a 1st positional) argument.
+ (BundleKey.set): Likewise.
+ (BundleKey.equals): Take defaultLocal field into consideration.
+ (getBundle(String, Locale, ClassLoader)): Use updated BundleKey and LRU.
+
+2006-08-13 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JMenu.java
+ (MenuChangeListener): New inner class, helps firing menu events.
+ (changeListener): New field.
+ (add(text)): Create new JMenuItem here and call add(JMenuItem).
+ (add(Action)): Create Action using createActionComponent()
+ and add via add(Component).
+ (setModel): Install and uninstall MenuChangeListener here.
+
+2006-08-13 Raif S. Naffah <raif@swiftdsl.com.au>
+
+ PR Classpath/27372
+ * java/math/BigInteger.java: Updated copyright year.
+ (init): Consume as little bytes as possible.
+ (BigInteger(int, int, Random)): Ensure bitLength bits are used.
+ (valueOf(String, int)): Throw NumberFormatException for malformed strings
+ as per RI's documentation.
+
+2006-08-13 Sven de Marothy <sven@physto.se>
+
+ * java/util/Locale.java
+ (hashcode): Is a serialized field, not transient.
+ (equals): Should NOT compare strings by reference.
+ (readObject/writeObject): Use the default methods and handle the hash
+ seperately.
+
+2006-08-13 Raif S. Naffah <raif@swiftdsl.com.au>
+
+ PR Classpath/28678
+ * gnu/java/security/Engine.java (getInstance(String, String, Provider)):
+ Updated documentation.
+ Formatting.
+ (getInstance(String, String, Provider, Object[])): Likewise.
+ Separate checks for null and empty string arguments.
+ Include as much information as possible in the exception's message.
+ Do not swallow original exception; instead use it as the cause of the
+ resulting exception.
+ * gnu/javax/security/auth/callback/AbstractCallbackHandler.java
+ (getInstance(String)): Updated documentation.
+ Formatting.
+ Store last exception caught when iterating through all providers.
+ If no implementation found, raise last exception if one was caught.
+ (getInstance(String, String)): Updated documentation.
+ Formatting.
+ Check for null or empty provider as per RI-5's documentation.
+ (getInstance(String, Provider)): Updated documentation.
+ Formatting.
+ Use as much information as possible in the exception message.
+ Do not swallow original exception; instead use it as the cause for the
+ ultimate raised exception(s).
+ * java/security/cert/CertificateFactory.java: Likewise.
+ * java/security/cert/CertPathBuilder.java: Likewise.
+ * java/security/cert/CertPathValidator.java: Likewise.
+ * java/security/cert/CertStore.java: Likewise.
+ * java/security/AlgorithmParameterGenerator.java: Likewise.
+ * java/security/AlgorithmParameters.java: Likewise.
+ * java/security/KeyFactory.java: Likewise.
+ * java/security/KeyPairGenerator.java: Likewise.
+ * java/security/KeyStore.java: Likewise.
+ * java/security/MessageDigest.java: Likewise.
+ * java/security/SecureRandom.java: Likewise.
+ * java/security/Signature.java: Likewise.
+ * javax/crypto/Cipher.java: Likewise.
+ * javax/crypto/ExemptionMechanism.java: Likewise.
+ * javax/crypto/KeyAgreement.java: Likewise.
+ * javax/crypto/KeyGenerator.java: Likewise.
+ * javax/crypto/Mac.java: Likewise.
+ * javax/crypto/SecretKeyFactory.java: Likewise.
+ * javax/net/ssl/KeyManagerFactory.java: Likewise.
+ * javax/net/ssl/SSLContext.java: Likewise.
+ * javax/net/ssl/TrustManagerFactory.java: Likewise.
+
+2006-08-13 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/JEditorPane.java
+ (getScrollableTracksViewportHeight): Also check maximum size.
+ * javax/swing/JTextPane.java
+ (insertIcon): Use input attributes for adding the icon
+ attribute.
+ * javax/swing/plaf/basic/BasicTextUI.java
+ (RootView.setSize): Overridden to forward to real view.
+ (getPreferredSize): Trigger setSize() on the view.
+ (viewToModel(JTextComponent,Point)): Pass Position.Bias array
+ to viewToModel() call, rather then null.
+ * javax/swing/text/ParagraphView.java
+ (changedUpdate): Invalide layout. Call super.
+ * javax/swing/text/SimpleAttributeSet.java
+ (clone): Use super's clone method to create clone.
+ * javax/swing/text/StyleConstants.java
+ (setIcon): Also set element name attribute.
+ * javax/swing/text/StyledEditorKit.java
+ (BoldAction.actionPerformed): Actually set the bold attribute,
+ not italic.
+ (setCharacterAttributes): Replaced with more straightforward
+ impl.
+ * javax/swing/text/TextAction.java
+ (getFocusedComponent): Implemented.
+ * javax/swing/text/Utilities.java
+ (getNextVisualPositionFrom): Pass Position.Bias arrays instead
+ of null.
+ * javax/swing/text/View.java
+ (changedUpdate): Nullify element change when updateChildren
+ says so.
+
+2006-08-11 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * vm/reference/gnu/java/lang/management/VMMemoryMXBeanImpl.java:
+ Fix documentation typos.
+
+2006-08-11 David Daney <ddaney@avtrex.com>
+
+ PR classpath/28580
+ * gnu/java/net/protocol/http/Request.java (readResponse): Call
+ createResponseBodyStream in more cases and with new parameter.
+ (createResponseBodyStream): Added new parameter mayHaveBody. Handle
+ HEAD and !mayHaveBody responses specially.
+
+2006-08-11 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/GlyphView.java
+ (DefaultGlyphPainter.modelToView): Fixed model->view mapping.
+ * javax/swing/text/LabelView.java
+ (valid): New flag indicating if the text attributes are valid.
+ (LabelView): Initialize valid field with false.
+ (setPropertiesFromAttributes): Call setter methods instead
+ of setting properties directly. Set valid to true.
+ (changedUpdate): Invalidate attributes. Call super.
+ (getBackground): Sync attributes if necessary.
+ (getForeground): Sync attributes if necessary.
+ (getFont): Sync attributes if necessary.
+ (isUnderline): Sync attributes if necessary.
+ (isSuperscript): Sync attributes if necessary.
+ (isStrikeThrough): Sync attributes if necessary.
+ (getFontMetrics): Sync attributes if necessary. Fetch font metrics
+ from toolkit if Container is not available yet.
+
+2006-08-11 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/PlainView.java
+ (tabBase): New field.
+ (tabSize): New field.
+ (updateMetrics): Update tabSize.
+ (lineToRect): Only allocate when really necessary.
+ (modelToView): Use tabBase for offset calculations.
+ (paint): Only allocate when really necessary. Update tabBase.
+ (nextTabStop): Fixed tab calculation.
+ (viewToModel): Correctly handle multiline text and locations
+ outside the view's bounds. Set bias.
+ (getLineLength): Use tabBase.
+ * javax/swing/text/Utilities.java
+ (drawTabbedText): Don't special case newlines. The views
+ must take care of this.
+
+2006-08-11 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/GapContent.java
+ (UndoPosRef): New inner class. Used for resetting positions
+ after undo/redo operations.
+ (InsertUndo.positions): New field.
+ (InsertUndo.undo): Store positions in removed range.
+ (InsertUndo.redo): Restore positions in re-inserted range.
+ (UndoRemove.positions): New field.
+ (UndoRemove.UndoRemove): Store positions in removed range.
+ (UndoRemove.undo): Restore positions in re-inserted range.
+ (UndoRemove.redo): Store positions in removed range.
+ (insertString): Create InsertUndo instance before actually
+ inserting the string.
+ (remove): Create UndoRemove instance before actually
+ removing.
+ (getPositionsInRange): Don't clear the Vector. Return Vector
+ of UndoPosRefs.
+ (updateUndoPositions): Implemented to reset all UndoPosRefs
+ in the vector.
+
+2006-08-11 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/io/ObjectInputStream.java (readClassDescriptor):
+ Use class's class loader to resolve field types.
+ * java/io/ObjectStreamField.java
+ (ObjectStreamField(String,String,ClassLoader)): Removed.
+ (ObjectStreamField(String,String)): Don't try to resolve typename.
+ (resolveType): New method.
+
+2006-08-10 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/BoxView.java
+ (calculateMajorAxisRequirements): Sum up the preferred and
+ maximum sizes.
+ (isAfter): Also add in the rectangle's with/height.
+ (childAllocation): Don't trigger layout here.
+ (layoutMinorAxis): Removed debug output.
+ (getWidth): Consider the insets.
+ (getHeight): Consider the insets.
+ (setSize): Consider the insets.
+ (updateRequirements): Check axis and throw
+ IllegalArgumentException.
+
+2006-08-10 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/AbstractDocument.java
+ (BidiRootName): New constant field, denotes the element name
+ for bidi root elements.
+ (AsyncLoadPriority): New constant field, denotes the property
+ to store the asynchronousLoadPriority.
+ (I18N): New constant field, denotes the property for
+ I18N support.
+ (bidiRoot): Made field type BidiRootElement.
+ (AbstractDocument): Build initial element structure for
+ bidi.
+ (getAsynchronousLoadPriority): Implemented. Returns the
+ value stored in the document properties.
+ (setAsynchronousLoadPriority): Implemented. Sets the
+ value stored in the document properties.
+ (getEndPosition): Implemented to use a Position from the
+ content.
+ (getStartPosition): Implemented to use a Position from the
+ content.
+ (insertStringImpl): Update the I18N setting if necessary.
+ (insertUpdate): Update the bidi structure if necessary.
+ (postRemoveUpdate): Update the bidi structure if necessary.
+ (putProperty): Update the I18N setting and bidi structure
+ if necessary.
+ (updateBidi): New helper method for updating the bidi
+ structure.
+ (getBidis): New helper method. Fetches the Bidi analysers
+ for the paragraphs of the range to check.
+ (dump): Also dump the bidi structure.
+ (AbstractElement.dump): Indent the '>' correctly.
+ (AbstractElement.children): Check numChildren rather then
+ children.length.
+ (BidiRootElement): New inner class.
+ (BidiElement): New inner class.
+
+2006-08-10 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/GapContent.java
+ (getChars): Optimized to only copy array when really necessary.
+ Respect the partialReturn property.
+
+2006-08-10 Lillian Angel <langel@redhat.com>
+
+ * gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java
+ (getComponentPeer): Added check to prevent NPE.
+
+2006-08-10 Gary Benson <gbenson@redhat.com>
+
+ * java/security/AccessControlContext.java (<init>):
+ Avoid a duplicated AccessController.getContext() call.
+
+2006-08-09 Mark Wielaard <mark@klomp.org>
+
+ * doc/www.gnu.org/newsitems.txt: Add 0.92.
+ * doc/www.gnu.org/downloads/downloads.wml: Likewise.
+ * doc/www.gnu.org/announce/20060809.wml: New file.
2006-08-09 Mark Wielaard <mark@klomp.org>
- * configure.ac (VERSION): Set to 0.92.
+ * configure.ac (VERSION): Set to 0.92-generics.
* NEWS: Add updates for 0.92 release.
-2006-08-08 Roman Kennke <kennke@aicas.com>
+2006-08-09 Tom Tromey <tromey@redhat.com>
+
+ PR classpath/28658:
+ * java/text/SimpleDateFormat.java (parse): Let an unquoted space in
+ the pattern match any number of spaces in the text.
+
+2006-08-09 Sven de Marothy <sven@physto.se>
+
+ * java/awt/image/BufferedImage.java
+ (BufferedImage): Reimplement predefined-type constructor.
+ (observers/tileObservers): Field renamed to tileObservers.
+ (createDefaultIndexedColorModel): New method.
+
+2006-08-09 Tom Tromey <tromey@redhat.com>
+
+ PR classpath/28666:
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.c
+ (Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeGetDisplayModes):
+ Create a 'short' array.
+
+2006-08-09 Tom Tromey <tromey@redhat.com>
+
+ * tools/gnu/classpath/tools/javah/JniHelper.java (getName): Properly
+ handle arrays.
+ * tools/gnu/classpath/tools/javah/JniIncludePrinter.java
+ (writeFields): Print "L" after int constant. Don't mangle the field
+ name. Only print int/long fields.
+
+2006-08-09 Tom Tromey <tromey@redhat.com>
+
+ * tools/gnu/classpath/tools/javah/Main.java (getParser): Name program
+ "javah".
+
+2006-08-09 Sven de Marothy <sven@physto.se>
+
+ * javax/swing/JTree.java
+ (JTree): Default SelectionModel should be DefaultTreeSelectionModel.
+ (setSelectionModel): Null parameter should create an EmptySelectionM.
+
+2006-08-09 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/AbstractDocument.java
+ (insertString): Perform modifications inside a write lock.
+ (insertStringImpl): Don't lock here. This is already done
+ in insertString().
+ (replace): Perform modifications inside a write lock.
+ (AbstractElement.AbstractElement): Call addAttributes() to
+ add the attributes.
+ (AbstractElement.getName): Fetch name from the ElementNameAttibute.
+ (BranchElement.lastIndex): New field. Optimizes getElementIndex().
+ (BranchElement.BranchElement): Set lastIndex to -1.
+ (BranchElement.getElementIndex): Implemented more efficient
+ search.
+
+2006-08-09 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/DefaultStyledDocument.java
+ (Edit): Moved this inner class into ElementBuffer where it
+ is actually needed.
+ (edits): Moved this field into ElementBuffer.
+ (getEditForParagraphAndIndex): Removed obsolete method.
+ (insertUpdate): Added some optimizations and fixes. Split
+ out handling insertion after newlines.
+ (insertAfterNewline): New helper method. Handles insertions
+ after a newline.
+ (ElementBuffer.Edit): New inner class. Moved here from
+ DefaultStyledDocument.
+ (ElementBuffer.createdFracture): New field.
+ (ElementBuffer.documentEvent): Made private.
+ (ElementBuffer.edits): New field. Moved here from
+ DefaultStyledDocument.
+ (ElementBuffer.fracNotCreated): Replaced by createdFracture.
+ (ElementBuffer.fracturedChild): New field.
+ (ElementBuffer.fracturedParent): New field.
+ (ElementBuffer.insertPath): New field.
+ (ElementBuffer.lastFractured): Removed. Replaced by fracturedChild and
+ fracturedParent.
+ (ElementBuffer.offsetLastIndex): New field.
+ (ElementBuffer.offsetLastIndexReplace): New field.
+ (ElementBuffer.recreateLeafs): New field.
+ (ElementBuffer.ElementBuffer): Don't initialize stack here.
+ (ElementBuffer.canJoin): New helper method.
+ (ElementBuffer.changeUpdate): Changed to use elementStack with
+ Edits rather than Elements. Let the split method do the work.
+ (ElementBuffer.cloneAsNecessary): New helper method.
+ (ElementBuffer.createFracture): Changed to fracture the bottommost
+ child in the stack.
+ (ElementBuffer.finishEdit): New helper method. Moved out
+ from insertUpdate to perform the actual changes and update
+ the event.
+ (fracture): New helper method.
+ (insertContentTag): Fixed some bugs and changed to use Edit
+ instances in the stack, rather then Elements.
+ (insertElement): New helper method. Moved out from insertUpdate()
+ to process the ElementSpecs.
+ (insertFirstContentTag): Fixed some problems and changed to use Edit
+ instances in the stack, rather then Elements.
+ (insertFracture): Removed. Basically moved into createFracture()
+ and fracture().
+ (insertParagraph): Removed.
+ (insertUpdate): Split out the ElementSpec processing into
+ insertElement(). Use Edit instances in the stack. Fixed some
+ problems.
+ (insert): Split out the preparation and finishing code into
+ prepareEdit() and finishEdit().
+ (join): New helper method.
+ (pop): New helper method.
+ (prepareEdit): New helper method.
+ (recreateFracturedElement): New helper method.
+ (recreateLeaves): Removed.
+ (recreate): New helper method.
+ (removeElements): New helper method. Split out from removeUpdate().
+ (removeUpdate): Split out the actual removal. Use the
+ Edit stack to perform removal and perform the remove actions
+ and event updates afterwards, just like in insertImpl().
+ (remove): Use prepareEdit() and finishEdit().
+ (split): Replaced with more flexible impl.
+
+2006-08-09 Sven de Marothy <sven@physto.se>
+
+ * gnu/java/awt/peer/gtk/CairoSurface.java
+ Change class to extend WritableRaster and not DataBuffer.
+ (CairoDataBuffer): New inner class.
+ * gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ * gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
+ Accomodate the above change.
+
+2006-08-09 Sven de Marothy <sven@physto.se>
+
+ * gnu/java/awt/peer/gtk/GtkMainThread.java
+ New file.
+ * gnu/java/awt/peer/gtk/GtkChoicePeer.java
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java
+ Replace GtkToolkit.mainThread with GtkMainThread.mainThread.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java
+ Minor style fixes; removed unused fields,
+ set fields to private where possible.
+ (createDialog, createFrame, createWindow, createEmbeddedWindow):
+ Call GtkMainThread.createWindow().
+ * gnu/java/awt/peer/gtk/GtkWindowPeer.java
+ (dispose): New method.
+ * include/gnu_java_awt_peer_gtk_GtkToolkit.h
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
+ (gtkQuit): New native method.
+
+2006-08-08 Lillian Angel <langel@redhat.com>
+
+ * java/awt/Component.java
+ (setDropTarget): Added check.
+
+2006-08-08 Lillian Angel <langel@redhat.com>
+
+ * gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java
+ (GtkDragSourceContextPeer): Added FIXME. Changed call
+ to setTarget.
+ * gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.java
+ (GtkDropTargetContextPeer): Removed target initialization.
+ * java/awt/Component.java
+ (setTarget): Removed commented out code.
+
+2006-08-08 Mark Wielaard <mark@klomp.org>
+
+ * javax/swing/text/DefaultHighlighter.java: Qualify
+ Highlighter.HighlightPainter class name for gcj.
+
+2006-08-05 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicTableUI.java
+ (MouseInputHandler.mousePressed): Request focus on list
+ component.
+
+2006-08-05 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/plaf/basic/BasicListUI.java
+ (MouseInputHandler.mousePressed): Request focus on list
+ component.
+
+2006-08-05 Roman Kennke <kennke@aicas.com>
PR 28650
* javax/swing/plaf/basic/BasicMenuBarUI.java
@@ -208,7 +9205,7 @@
(getMinimumSize): Added specnote about this method never
beeing called in the RI.
-2006-08-06 Sven de Marothy <sven@physto.se>
+2006-08-03 Sven de Marothy <sven@physto.se>
* gnu/java/awt/peer/gtk/ComponentGraphics.java
(grab, nativeGrab): New methods.
@@ -218,7 +9215,7 @@
* gnu/java/awt/peer/gtk/GtkComponentPeer.java
(print): Implement.
* java/awt/Component.java
- (printAll): Should call peer print method.
+ (printAll): Should call peer print method.
2006-08-06 Thomas Minor <1nocentrabidlamb@sexMagnet.com>
@@ -236,10 +9233,10 @@
2006-08-06 Roman Kennke <kennke@aicas.com>
* NEWS: Added note about the X peers.
- * INSTALL: Added install notes about the X peers.
+ * INSTALL: Added install notes about the X peers.
2006-08-06 Raif S. Naffah <raif@swiftdsl.com.au>
- Paul Jenner <psj@harker.dyndns.org>
+ Paul Jenner <psj@harker.dyndns.org>
* README: Update bug, patches and cvs instructions plus new URLs of
various external projects.
@@ -256,13 +9253,347 @@
g_type_init earlier in function to correctly initialize the
type system used by the backend.
-2006-08-05 Robert Schuster <robertschuster@fsfe.org>
+2006-08-05 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/DefaultHighlight.java
+ (DefaultHighlightPainter.paintHighlight): Removed method.
+ (DefaultHighlightPainter.paintLayer): Implemented.
+ (DefaultHighlightPainter.paint): Implemented more efficient
+ painting for multiline-highlights.
+ (HighlightEntry.p0): Changed to be a Position.
+ (HighlightEntry.p1): Changed to be a Position.
+ (HighlightEntry.HighlightEntry): Changed to take Position
+ arfuments.
+ (HighlightEntry.getStartOffset): Changed to return p0.getOffset();
+ (HighlightEntry.getEndOffset): Changed to return p1.getOffset();
+ (LayerHighlightEntry): New inner class. Extends HighlightEntry
+ and tracks the painted rectangle for efficient repainting.
+ (addHighlight): Handle layered highlight.
+ (changeHighlight): Handle layered highlight.
+ (paintLayeredHighlights): Implemented.
+ (paint): Paint only non-layered highlights here.
+ (removeAllHighlights): Trigger correct repaint.
+ (removeHighlight): Handle layered highlight here for
+ more efficient repainting.
+ * javax/swing/text/GlyphView.java
+ (paint): Handle layered highlights.
+ * javax/swing/text/PlainView.java
+ (paint): Handle layered highlights.
+ * javax/swing/text/WrappedPlainView.java
+ (WrappedLine.paint): Handle layered highlights.
+
+2006-08-07 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ PR 26972
+ * NEWS: As suggested by Paul Jennier, added note about the fix of
+ the InitialContext.
+
+2006-08-07 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ * NEWS: Added entry about the context factories for JNDI.
+
+2006-08-07 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ PR 27383
+ * gnu/CORBA/Connected_objects.java (size): New method.
+ * gnu/CORBA/OrbFunctional.java (countConnectedObjects):
+ New method.
+ * javax/naming/spi/NamingManager.java (getURLContext):
+ Also search for the URL context factories in
+ gnu/javax/naming/jndi/url.
+ * gnu/javax/naming/giop/ContextContinuation.java,
+ gnu/javax/naming/giop/CorbalocParser.java,
+ gnu/javax/naming/giop/GiopNamingEnumeration.java,
+ gnu/javax/naming/giop/GiopNamingServiceFactory.java,
+ gnu/javax/naming/giop/GiopNamingServiceURLContext.java,
+ gnu/javax/naming/giop/ListBindingsEnumeration.java,
+ gnu/javax/naming/giop/ListEnumeration.java,
+ gnu/javax/naming/jndi/url/corbaname/corbanameURLContextFactory.java,
+ gnu/javax/naming/jndi/url/rmi/ContextContinuation.java,
+ gnu/javax/naming/jndi/url/rmi/ListBindingsEnumeration.java,
+ gnu/javax/naming/jndi/url/rmi/ListEnumeration.java,
+ gnu/javax/naming/jndi/url/rmi/RmiContinuation.java,
+ gnu/javax/naming/jndi/url/rmi/RmiNamingEnumeration.java,
+ gnu/javax/naming/jndi/url/rmi/rmiURLContext.java,
+ gnu/javax/naming/jndi/url/rmi/rmiURLContextFactory.java: New files.
+
+2006-08-06 Sven de Marothy <sven@physto.se>
+
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+ (drawGlyphVector): Synchronize against font object when drawing.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
+ (nativeDrawGlyphVector): Use pango locking when drawing.
+ (install_font_peer): Use pango locking when creating the cairo face.
+
+2006-08-06 C. Scott Marshall <csm@gnu.org>
+
+ Fixes PR 28608.
+ * java/nio/DirectByteBufferImpl.java (duplicate): only reset if
+ the mark has been set.
+ * native/jni/java-nio/java_nio_VMDirectByteBuffer.c
+ (Java_java_nio_VMDirectByteBuffer_allocate): zero out the
+ allocated data.
+
+2006-08-06 Mark Wielaard <mark@klomp.org>
+
+ PR 28555
+ Suggested by Matthew Burgess <matthew@linuxfromscratch.org>
+ * gnu/xml/transform/ApplyTemplatesNode.java (clone): Check whether
+ withParams is null.
+ * gnu/xml/transform/ForEachNode.java (clone): Check whether
+ sortKeys is null.
+
+2006-08-06 Raif S. Naffah <raif@swiftdsl.com.au>
+ Paul Jenner <psj@harker.dyndns.org>
+
+ * README: Update bug, patches and cvs instructions plus new URLs of
+ various external projects.
+
+2006-08-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/java/lang/management/BeanImpl.java:
+ (cacheMBeanInfo(MBeanInfo)): Override given MBeanInfo
+ with open variant.
+ (getCachedMBeanInfo()): Return open variant.
+ (getMBeanInfo()): Likewise.
+ (getTypeFromClass(Class)): Implemented.
+ (translateSignature(MBeanParameterInfo)): Likewise.
+ (translate(String)): Likewise.
+ * javax/management/StandardMBean.java:
+ (getMBeanInfo()): Return attribute names with capital letters,
+ as in docs for java.lang.management.ManagementFactory, and
+ ensure descriptions are not "".
+ * javax/management/openmbean/OpenMBeanConstructorInfoSupport.java,
+ * javax/management/openmbean/OpenMBeanInfoSupport.java,
+ * javax/management/openmbean/OpenMBeanOperationInfoSupport.java:
+ (toString()): Use Arrays.toString().
+ * javax/management/openmbean/OpenMBeanParameterInfoSupport.java:
+ (OpenMBeanParameterInfoSupport(String, String, OpenType)):
+ Set open type here rather than in other constructors.
+
+2006-08-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/management/MBeanFeatureInfo.java:
+ Make string variable package-private.
+ * javax/management/StandardMBean.java:
+ (getMBeanInterface()): Made final.
+ * javax/management/openmbean/SimpleType.java:
+ Made final.
+
+2006-08-05 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/awt/Component.java (setDropTarget): Commented out GTK specific
+ code.
+
+2006-08-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * examples/gnu/classpath/examples/swing/FillRect.java,
+ * gnu/CORBA/Focused_ORB.java,
+ * gnu/CORBA/interfaces/gnuSocketFactory.java,
+ * gnu/classpath/ByteArray.java,
+ * gnu/classpath/ObjectPool.java,
+ * gnu/java/awt/peer/ClasspathTextLayoutPeer.java,
+ * gnu/java/awt/peer/x/fonts.properties,
+ * gnu/java/security/util/Prime2.java,
+ * gnu/javax/imageio/gif/GIFStream.java,
+ * javax/swing/text/html/HTMLTableView.java,
+ * native/cni/Makefile.am,
+ * org/omg/CORBA/SendingContext/RunTimeOperations.java,
+ * org/omg/CORBA/SendingContext/Runtime.java,
+ * resource/gnu/regexp/MessagesBundle.properties,
+ * resource/gnu/regexp/MessagesBundle_fr.properties,
+ * resource/gnu/regexp/MessagesBundle_it.properties,
+ * tools/appletviewer.in,
+ * tools/jarsigner.in,
+ * tools/keytool.in,
+ * vm/reference/java/lang/management/VMThreadInfo.java:
+ Removed.
+ * examples/gnu/classpath/examples/awt/aicas.png,
+ * examples/gnu/classpath/examples/awt/palme.gif,
+ * examples/gnu/classpath/examples/java2d/aicas.png,
+ * examples/gnu/classpath/examples/java2d/palme.gif,
+ * gnu/java/awt/font/opentype/truetype/doc-files/ZonePathIterator-1.dia,
+ * gnu/java/awt/font/opentype/truetype/doc-files/ZonePathIterator-1.png,
+ * java/awt/doc-files/capjoin.png,
+ * java/awt/geom/doc-files/Area-1.png,
+ * java/awt/geom/doc-files/Ellipse-1.png,
+ * java/awt/geom/doc-files/GeneralPath-1.png:
+ Added.
+
+2006-08-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * configdiag.jnlp:
+ Removed.
+
+2006-08-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/java/lang/management/BeanImpl.java:
+ (getAttribute(String)): Implemented.
+
+2006-08-05 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/text/JTextComponent.java
+ (AccessibleJTextComponent.dot): Renamed field into caretDot.
+ (AccessibleJTextComponent.textComp): Removed field
+ and replace with JTextComponent.this construct.
+ (AccessibleJTextComponent.AccessibleJTextComponent):
+ Fetch caret position.
+ (caretUpdate): Implemented. Fires property change events and
+ updates the caretDot field.
+ (changedUpdate): Implemented. Fires property change events.
+ (insertUpdate): Implemented. Fires property change events.
+ (removeUpdate): Implemented. Fires property change events.
+ (cut): Replaced textComp with JTextComponent.this construct.
+ (paste): Replaced textComp with JTextComponent.this construct.
+ (replaceText): Replaced textComp with JTextComponent.this construct.
+ (selectText): Replaced textComp with JTextComponent.this construct.
+ (getCaretPosition): Replaced textComp with JTextComponent.this
+ construct.
+ (getCharCount): Replaced textComp with JTextComponent.this construct.
+ (getSelectedText): Replaced textComp with JTextComponent.this
+ construct.
+ (getSelectionEnd): Replaced textComp with JTextComponent.this
+ construct.
+ (getSelectionStart): Replaced textComp with JTextComponent.this
+ construct.
+ (getTextRange): Replaced textComp with JTextComponent.this
+ construct.
+ (doAccessibleAction): Implemented.
+ (getAccessibleActionCount): Implemented.
+ (getAccessibleActionDescription): Implemented.
+ (getAccessibleStateSet): Implemented.
+ (getAfterIndex): Implemented.
+ (getBeforeIndex): Implemented.
+ (getAtIndex): Implemented.
+ (getAtIndexImpl): New helper method.
+ (getCharacterAttribute): Implemented.
+ (getCharacterBounds): Implemented.
+ (getIndexAtPoint): Implemented.
+ (insertTextAtIndex): Implemented.
+ (setAttributes): Implemented.
+ (setTextContents): Implemented.
+
+2006-08-05 Raif S. Naffah <raif@swiftdsl.com.au>
+
+ * configure.ac: Better handling of default-preferences-peer option.
+
+2006-08-04 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * java/awt/BasicStroke.java (dashedStroke): Cast coords.clone to
+ double[].
+
+2006-08-04 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/management/openmbean/TabularData.java:
+ Documentation corrections.
+ * javax/management/openmbean/TabularDataSupport.java:
+ New file.
+
+2006-08-04 Francis Kung <fkung@redhat.com>
+
+ * java/awt/BasicStroke.java
+ (dashedStroke): Implemented.
+
+2006-08-04 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/management/BadAttributeValueExpException.java,
+ * javax/management/BadStringOperationException.java,
+ * javax/management/InstanceAlreadyExistsException.java,
+ * javax/management/InstanceNotFoundException.java,
+ * javax/management/InvalidApplicationException.java,
+ * javax/management/MBeanRegistrationException.java,
+ * javax/management/MalformedObjectNameException.java,
+ * javax/management/RuntimeErrorException.java,
+ * javax/management/RuntimeMBeanException.java,
+ * javax/management/ServiceNotFoundException.java:
+ New files.
+
+2006-08-04 Roman Kennke <kennke@aicas.com>
+
+ * javax/swing/SwingUtilities.java
+ (layoutCompoundLabel(JComponent,FontMetrics,String,Icon,int,int,int,
+ int,Rectangle,Rectangle,Rectangle,int)): Delegate to new
+ layoutCompoundLabelImpl().
+ (layoutCompoundLabel(FontMetrics,String,Icon,int,int,int,int,
+ Rectangle,Rectangle,Rectangle,int)): Delegate to new
+ layoutCompoundLabelImpl().
+ (layoutCompoundLabelImpl): New helper method. Moved impl from
+ layoutCompoundLabel() to here and added handling of HTML.
+ * javax/swing/plaf/basic/BasicButtonUI.java
+ (installUI): Update HTML view if appropriate.
+ (uninstallUI): New method. Do the usual uninstallUI things
+ and uninstall HTML view.
+ (getMinimumSize): New method. Adjusts the minimum size
+ by the HTML view minimum size.
+ (getMaximumSize): New method. Adjusts the maximum size
+ by the HTML view maximum size.
+ (getPreferredSize): Pass the button's iconTextGap to the
+ BasicGraphicsUtils method.
+ (paint): Let HTML view paint the text, if present.
+ * javax/swing/plaf/basic/BasicButtonListener.java
+ (propertyChange): Update the HTML view when the button's
+ text is changed.
+
+2006-08-04 Mario Torre <neugens@limasoftware.net>
+
+ Reported by Raif S. Naffah <raif@swiftdsl.com.au>
+ * native/jni/gconf-peer/GConfNativePeer.c (init_gconf_client):
+ g_type_init earlier in function to correctly initialize the
+ type system used by the backend.
+
+2006-08-04 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ PR 26972
+ * javax/naming/Name.java (addAll, getPrefix, getSuffix):
+ Documented.
+ * gnu/javax/naming/ictxImpl/trans/GnuName.java: New file.
+
+2006-08-04 Robert Schuster <robertschuster@fsfe.org>
Reported by Henrik Gulbrandsen <henrik@gulbra.net>
- Fixes PR27864.
- * gnu/xml/dom/DomIterator.java:
- (successor): Added if-statement.
+ Fixes PR27864.
+ * gnu/xml/dom/DomIterator.java:
+ (successor): Added if-statement.
+
+2006-08-04 Mark Wielaard <mark@klomp.org>
+ * scripts/Makefile.am (EXTRA_DIST): Add import-cacerts.sh.
+
+2006-08-04 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/plaf/metal/MetalMenuBarUI.java:
+ (update): Check size and paint smaller gradient.
+ * javax/swing/plaf/metal/MetalBorders.java:
+ (MenuBarBorder): Removed borderColor field.
+ (MenuBarBorder.paintBorder): Added note, fetch color from UIManager or
+ MetalLookAndFeel.
+
+2006-08-03 Roman Kennke <kennke@aicas.com>
+
+ PR 27637
+ * javax/swing/plaf/basic/BasicInternalFrameUI.java
+ (ComponentHandler.componentResized): Reimplemented to handle
+ arbitrary parents.
+ (InternalFramePropertyChangeHandler.propertyChange): (Un)install
+ component listener on changed ancestor.
+ (installListeners): Install componentListener.
+ (uninstallListeners): Uninstall componentListener.
+
+2006-08-03 Carsten Neumann <cn-develop@gmx.net>
+
+ * StrictMath.java (cbrt): Return argument if it is a NaN.
+ (cosh): Likewise.
+ (expm1): Likewise.
+ (sinh): Likewise.
+
+2006-08-03 Carsten Neumann <cn-develop@gmx.net>
+
+ * java/lang/StrictMath.java (tanh): New method.
+
+2006-08-03 Raif S. Naffah <raif@swiftdsl.com.au>
+
+ * scripts/import-cacerts.sh: Batch CA certificates import script.
+
2006-08-03 Roman Kennke <kennke@aicas.com>
PR 27606
@@ -277,7 +9608,63 @@
Handle indentation.
(IndentIcon): New class. Wraps and indents another icon.
-2006-08-03 Roman Kennke <kennke@aicas.com>
+2006-08-02 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/management/MBeanConstructorInfo.java:
+ (MBeanConstructorInfo(String,String,MBeanParameterInfo[]):
+ Copy array rather than directly assigning.
+ * javax/management/MBeanInfo.java:
+ (MBeanInfo(String,String,MBeanAttributeInfo[],
+ MBeanConstructorInfo[], MBeanOperationInfo[],
+ MBeanNotificationInfo[])): Likewise.
+ * javax/management/MBeanOperationInfo.java:
+ (MBeanOperationInfo(String,String,MBeanParameterInfo[],String,int)):
+ Likewise.
+ * javax/management/openmbean/OpenMBeanAttributeInfoSupport.java,
+ * javax/management/openmbean/OpenMBeanConstructorInfoSupport.java:
+ New files.
+ * javax/management/openmbean/OpenMBeanInfo.java:
+ Corrected documentation.
+ * javax/management/openmbean/OpenMBeanInfoSupport.java:
+ New file.
+ * javax/management/openmbean/OpenMBeanOperationInfo.java:
+ Corrected documentation.
+ * javax/management/openmbean/OpenMBeanOperationInfoSupport.java:
+ New file.
+ * javax/management/openmbean/OpenMBeanParameterInfoSupport.java:
+ (MBeanParameterInfo(String,String,OpenType,Object,Object[])):
+ Call other constructor rather than reimplementing.
+
+2006-08-02 Lillian Angel <langel@redhat.com>
+
+ * java/awt/dnd/DragSource.java
+ (isDragImageSupported): Implemented.
+ (getDragThreshold): Changed default value.
+ * java/awt/dnd/DropTarget.java
+ (DropTarget): Default action is changed to ACTION_COPY_OR_MOVE.
+ (DropTarget): Likewise.
+ (DropTarget): If FlavorMap passed in is null, we should use the system default.
+ (addDropTargetListener): Added check to determine if new DropTargetListener
+ is this class. If so, an IllegalArgumentException is thrown. If the
+ new listener is null, nothing happens.
+
+2006-08-02 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * configure.ac (MOZILLA_FOUND): Fall back to
+ mozilla-firefox-plugin.
+
+2006-08-02 Sven de Marothy <sven@physto.se>
+
+ * java/awt/geom/AffineTransform.java
+ (hashCode): Tweak impl.
+ * java/awt/font/FontRenderContext.java
+ (hashCode): Implement.
+
+2006-08-02 Carsten Neumann <cn-develop@gmx.net>
+
+ * java/lang/StrictMath.java (sinh): New method.
+
+2006-08-02 Roman Kennke <kennke@aicas.com>
PR 27605
* javax/swing/JComboBox.java
@@ -303,7 +9690,70 @@
(createPropertyChangeListener): Return null just like the
RI.
-2006-08-03 Roman Kennke <kennke@aicas.com>
+2006-08-02 Sven de Marothy <sven@physto.se>
+
+ * gnu/java/awt/peer/gtk/GtkChoicePeer.java
+ (remove): Force event on removing item 0 when it's selected.
+ (handleEvent): Always call Choice.selected().
+ * java/awt/Choice.java:
+ (remove): Simplify and correct.
+
+2006-08-02 Mark Wielaard <mark@klomp.org>
+
+ PR 28535
+ * configure.ac (gconf-peer): Check for gdk-2.0.
+ * native/jni/gconf-peer/Makefile.am
+ (AM_LDFLAGS): Use GDK_LIBS.
+ (AM_CFLAGS): Use GDK_CFLAGS.
+
+2006-08-02 Thomas Minor <1nocentrabidlamb@sexMagnet.com>
+
+ * java/net/URL.java (getContent(Class[])): Implement.
+
+2006-08-02 Roman Kennke <kennke@aicas.com>
+
+ PR 27624
+ * javax/swing/JMenu.java
+ (JMenu()): Removed setting of delay.
+ (JMenu(String)): Removed setting of delay.
+ (JMenu(Action)): Removed setting of delay.
+ (JMenu(String,boolean)): Removed setting of delay.
+ (setSelectedHelper): Removed unneeded method.
+ (setSelected): Simply set the model state.
+ (setPopupMenuVisible): Recognize the popup location
+ determined by getPopupMenuOrigin().
+ (getPopupMenuOrigin): Recognize the UI properties for
+ X and Y offset.
+ (menuSelectionChanged): Call setSelected() directly.
+ * javax/swing/JPopupMenu.java
+ (menuSelectionChanged): If invoker is a JMenu, then delegate
+ to that to get the position right.
+ * javax/swing/Popup.java
+ (LightweightPopup.show): Insert the popup as first component
+ in the layer, so that it overlaps it's caller.
+ * javax/swing/plaf/basic/BasicMenuItemUI.java
+ (getPath): Don't include the popup.
+ * javax/swing/plaf/basic/BasicMenuUI.java
+ (SelectMenuAction): New class. This invokes the popup when
+ a menu is selected.
+ (installDefaults): Install delay of 200 ms.
+ (setupPostTimer): Implemented.
+ (MouseInputHandler.mouseClicked): Do nothing here.
+ (MouseInputHandler.mouseEntered): Use MenuSelectionManager
+ magic to handle the selection. Open the menu via a timer.
+ (MouseInputHandler.mousePressed): Use MenuSelectionManager
+ magic to handle the selection. Open the menu via a timer.
+ (MenuDragMouseHandler.menuMouseDragged): Probably use
+ timer.
+ (menuDragMouseEntered): Do nothing here.
+
+2006-08-02 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/management/openmbean/InvalidOpenTypeException.java,
+ * javax/management/openmbean/KeyAlreadyExistsException.java:
+ New files.
+
+2006-08-02 Roman Kennke <kennke@aicas.com>
PR 27604
* javax/swing/plaf/basic/BasicChooserUI.java
@@ -321,12 +9771,16 @@
(getSystemDisplayName): Implemented to return the real name
of a file, special handling files like '.' or '..'.
+2006-08-03 Mark Wielaard <mark@klomp.org>
+
+ * examples/gnu/classpath/examples/icons/badge.png: Add file.
+
2006-08-03 Roman Kennke <kennke@aicas.com>
PR 28562
* javax/swing/plaf/basic/BasicOptionPaneUI.java
(PropertyChangeHandler.propertyChange): Cleanly reinstall
- components when visual property chanegs.
+ components when visual property chanegs.
2006-08-03 Roman Kennke <kennke@aicas.com>
@@ -348,72 +9802,102 @@
Set renderer to a default handler when the current renderer
in the JTree is null.
-2006-08-03 Mark Wielaard <mark@klomp.org>
-
- * scripts/Makefile.am (EXTRA_DIST): Add import-cacerts.sh.
-
-2006-08-03 Raif S. Naffah <raif@swiftdsl.com.au>
+2006-08-02 Raif S. Naffah <raif@swiftdsl.com.au>
- * scripts/import-cacerts.sh: Batch CA certificates import script.
+ PR Classpath/23899
+ * java/security/SecureRandom.java (next): Call nextBytes as per specs.
-2006-08-03 Raif S. Naffah <raif@swiftdsl.com.au>
+2006-08-02 Raif S. Naffah <raif@swiftdsl.com.au>
PR Classpath/28556
- * gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java
- (encodePrivateKey): Updated documentation to clarify that RFC-2459
- states that the parameters field of the AlgorithmIdentifier element
- MUST be NULL if present. Amended the code to reflect the specs.
+ * gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java (encodePrivateKey):
+ Updated documentation to clarify that RFC-2459 states that the parameters
+ field of the AlgorithmIdentifier element MUST be NULL if present.
+ Amended the code to reflect the specs.
(decodePrivateKey): Handle case of NULL AlgorithmIdentifier.parameters.
-2006-08-03 Raif S. Naffah <raif@swiftdsl.com.au>
+2006-08-01 Andrew John Hughes <gnu_andrew@member.fsf.org>
- PR Classpath/23899
- * java/security/SecureRandom.java (next): Call nextBytes as per specs.
+ * javax/management/openmbean/OpenMBeanParameterInfoSupport.java:
+ Call parameter 'defaultValue' not 'defValue'.
-2006-08-03 Thomas Fitzsimmons <fitzsim@redhat.com>
+2006-08-01 Andrew John Hughes <gnu_andrew@member.fsf.org>
- * native/jawt/Makefile.am (libjawt_la_LDFLAGS): Add
- -avoid-version.
- * native/jni/gtk-peer/Makefile.am (libgtkpeer_la_LDFLAGS):
- Likewise.
- * native/jni/midi-alsa/Makefile.am (libgjsmalsa_la_LDFLAGS):
- Likewise.
- * native/jni/midi-dssi/Makefile.am (libgjsmdssi_la_LDFLAGS):
- Likewise.
+ * javax/management/openmbean/OpenMBeanParameterInfoSupport.java:
+ New file.
-2006-08-03 Thomas Fitzsimmons <fitzsim@redhat.com>
+2006-08-01 Roman Kennke <kennke@aicas.com>
+
+ PR 28562
+ * javax/swing/plaf/basic/BasicOptionPaneUI.java
+ (PropertyChangeHandler.propertyChange): Cleanly reinstall
+ components when visual property chanegs.
+
+2006-08-01 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/management/openmbean/OpenMBeanAttributeInfo.java:
+ (toString()): Corrected documentation.
+ * javax/management/openmbean/OpenMBeanConstructorInfo.java,
+ * javax/management/openmbean/OpenMBeanInfo.java,
+ * javax/management/openmbean/OpenMBeanOperationInfo.java:
+ New files.
+ * javax/management/openmbean/OpenMBeanParameterInfo.java:
+ (toString()): Corrected documentation.
+
+2006-08-01 Tania Bento <tbento@redhat.com>
- * native/jni/qt-peer/Makefile.am (libqtpeer_la_LDFLAGS): Add
- -avoid-version.
+ * java/awt/Choice.java
+ (remove(int)): Added documentation.
-2006-08-03 Andrew John Hughes <gnu_andrew@member.fsf.org>
+2006-08-01 Tania Bento <tbento@redhat.com>
+
+ * java/awt/Choice.java
+ (remove(int)): An IllegalArgumentException should not be thrown
+ if int is invalid. Update selectedIndex and peer selection.
- * examples/gnu/classpath/examples/management/TestBeans.java:
- New file.
- * javax/management/MBeanAttributeInfo.java:
- (toString()): Implemented.
- * javax/management/MBeanConstructorInfo.java:
- (toString()): Implemented.
- * javax/management/MBeanFeatureInfo.java:
- (toString()): Implemented.
- * javax/management/MBeanInfo.java:
- (toString()): Implemented.
- * javax/management/MBeanNotificationInfo.java:
- (toString()): Implemented.
- * javax/management/MBeanOperationInfo.java:
- (toString()): Implemented.
- * javax/management/MBeanParameterInfo.java:
- (toString()): Implemented.
- * javax/management/StandardMBean.java:
- (getMBeanInfo()): Fix attribute naming.
+2006-08-01 Tania Bento <tbento@redhat.com>
-2006-08-02 Mark Wielaard <mark@klomp.org>
+ * java/awt/CardLayout.java
+ (toString): Changed format of string outputted.
+ (goToComponent): Changed the order of the if-clause.
- PR 28535
- * configure.ac (gconf-peer): Check for gdk-2.0.
- * native/jni/gconf-peer/Makefile.am
- (AM_LDFLAGS): Use GDK_LIBS.
- (AM_CFLAGS): Use GDK_CFLAGS.
+2006-07-31 Tom Tromey <tromey@redhat.com>
+
+ * INSTALL: Updated for ASM.
+
+2006-07-31 Tom Tromey <tromey@redhat.com>
+
+ PR libgcj/23682:
+ * java/nio/channels/SelectionKey.java (attach): Now synchronized.
+ (attachment): Likewise.
+ * java/nio/channels/spi/AbstractSelectionKey.java (cancel): Now
+ synchronized.
+ (isValid): Likewise.
+ * gnu/java/nio/SelectionKeyImpl.java (impl): Now final
+ (ch): Likewise.
+ (interestOps): Synchronize.
+ (readyOps): Likewise.
+ * gnu/java/nio/SelectorImpl.java (register): Synchronize around
+ interestOps call.
+
+2006-07-31 Roman Kennke <kennke@aicas.com>
+
+ * NEWS: Added note about the X peers.
+ * INSTALL: Added install notes about the X peers.
+
+2006-07-31 Carsten Neumann <cn-develop@gmx.net>
+
+ * StrictMath.java (getLowDWord): Return long instead of int.
+ (getHighDWord): Likewise.
+ (buildDouble): Take two long arguments.
+ (cbrt): Adapted to int -> long change.
+ (expm1): Likewise.
+ (cosh): Likewise.
+
+2006-07-31 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * native/jni/qt-peer/Makefile.am (libqtpeer_la_LDFLAGS): Add
+ -avoid-version.
2006-07-31 Raif S. Naffah <raif@swiftdsl.com.au>
@@ -438,6 +9922,11 @@
2006-07-30 Mark Wielaard <mark@klomp.org>
+ * javax/swing/JComponent.java (getListeners): Revert
+ un-genericization.
+
+2006-07-30 Mark Wielaard <mark@klomp.org>
+
* resource/java/security/classpath.security: Add /dev/urandom as
default securerandom.source.
@@ -447,6 +9936,39 @@
6 weeks.
(nonLeniencyCheck): weeks is either 5 or 6.
+2006-07-30 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/management/openmbean/OpenMBeanAttributeInfo.java,
+ * javax/management/openmbean/OpenMBeanParameterInfo.java:
+ New files.
+
+2006-07-30 Matt Wringe <mwringe@redhat.com>
+
+ * gnu/java/security/Engine.java
+ (getInstance): Ignore self referencing aliases.
+
+2006-07-30 Sven de Marothy <sven@physto.se>
+
+ * java/awt/Choice.java:
+ (accessibleAction): Call select() directly.
+ (add, insert, remove): Reimplement.
+ (dispatchEventImpl): Always call super.
+ (processItemEvent): Does not set the index.
+ * include/gnu_java_awt_peer_gtk_GtkChoicePeer.h
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
+ (append): removed.
+ (nativeAdd): Name changed to add.
+ (selection_changed_cb): Simplify callback.
+ * gnu/java/awt/peer/gtk/GtkChoicePeer.java
+ (selected): New field.
+ (add): Replaced with native impl.
+ (handleEvent): New method.
+
+2006-07-30 Sven de Marothy <sven@physto.se>
+
+ * java/awt/Choice.java:
+ Reformat, fix copyright year.
+
2006-07-29 Mark Wielaard <mark@klomp.org>
* javax/swing/JComponent.java (paintingDoubleBuffered): Renamed
@@ -454,6 +9976,27 @@
as a method.
2006-07-29 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * examples/gnu/classpath/examples/management/TestBeans.java:
+ New file.
+ * javax/management/MBeanAttributeInfo.java:
+ (toString()): Implemented.
+ * javax/management/MBeanConstructorInfo.java:
+ (toString()): Implemented.
+ * javax/management/MBeanFeatureInfo.java:
+ (toString()): Implemented.
+ * javax/management/MBeanInfo.java:
+ (toString()): Implemented.
+ * javax/management/MBeanNotificationInfo.java:
+ (toString()): Implemented.
+ * javax/management/MBeanOperationInfo.java:
+ (toString()): Implemented.
+ * javax/management/MBeanParameterInfo.java:
+ (toString()): Implemented.
+ * javax/management/StandardMBean.java:
+ (getMBeanInfo()): Fix attribute naming.
+
+2006-07-29 Andrew John Hughes <gnu_andrew@member.fsf.org>
* gnu/java/lang/management/BeanImpl.java:
Extended javax.management.StandardMBean.
@@ -479,7 +10022,7 @@
(getMemoryManagerMXBeans()): Likewise.
(getGarbageCollectorMXBeans()): Likewise.
* javax/management/MBeanFeatureInfo.java:
- (hashCode()): Fixed to check for null values.
+ hashCode()): Fixed to check for null values.
2006-07-29 Matt Wringe <mwringe@redhat.com>
@@ -492,6 +10035,16 @@
(get): Method removed, no longer needs to overwrite
parent implementation
+2006-07-29 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/awt/peer/gtk/GdkTextLayout.java: Removed.
+ * gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java: Removed.
+ * include/gnu_java_awt_peer_gtk_GdkTextLayout.h: Removed.
+ * include/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.h: Removed.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c: Removed.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c:
+ Removed.
+
2006-07-29 Sven de Marothy <sven@physto.se>
* java/math/BigDecimal.java
@@ -542,6 +10095,51 @@
(joinSegments): Refactored some code into joinOuterSegments.
(solidStroke): Connect segments together properly.
+2006-07-28 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * native/jawt/Makefile.am (libjawt_la_LDFLAGS): Add
+ -avoid-version.
+ * native/jni/gtk-peer/Makefile.am (libgtkpeer_la_LDFLAGS):
+ Likewise.
+ * native/jni/midi-alsa/Makefile.am (libgjsmalsa_la_LDFLAGS):
+ Likewise.
+ * native/jni/midi-dssi/Makefile.am (libgjsmdssi_la_LDFLAGS):
+ Likewise.
+
+2006-07-28 Tom Tromey <tromey@redhat.com>
+
+ * configure.ac: Enable -Werror by default on Linux-with-gcc.
+
+2006-07-28 Lillian Angel <langel@redhat.com>
+
+ * native/jni/gtk-peer/GtkDragSourceContextPeer.c:
+ Removed function declarations.
+ (connect_signals_for_widget): Removed implementation because
+ stub functions have been removed.
+ (drag_begin_cb): Removed function.
+ (drag_motion_cb): Likewise.
+ (drag_data_get_cb): Likewise.
+ (drag_data_delete_cb): Likewise.
+ (drag_drop_cb): Likewise.
+ (drag_end_cb): Likewise.
+ (drag_data_received_cb): Likewise.
+
+2006-07-28 Mark Wielaard <mark@klomp.org>
+
+ * configure.ac: Set version to 0.93-pre.
+
+2006-07-29 Raif S. Naffah <raif@swiftdsl.com.au>
+
+ * tools/Makefile.am: Added source 1.4 compliance option when ECJ is used.
+
+2006-07-29 Raif S. Naffah <raif@swiftdsl.com.au>
+
+ * tools/gnu/classpath/tools/keytool/Command.java: Removed unused import.
+ (getCallbackHandler): Fully qualify linked class in javadoc.
+ * tools/gnu/classpath/tools/keytool/GenKeyCmd.java (cmdOptionsParser): Removed.
+ * tools/gnu/classpath/tools/keytool/ImportCmd.java (imported): Likewise.
+ * tools/gnu/classpath/tools/keytool/Main.java (printHelp): Likewise.
+
2006-07-27 Tom Tromey <tromey@redhat.com>
PR classpath/28486:
@@ -1295,6 +10893,14 @@
(GtkMouseDragGestureRecognizer): fixed potential threading issue:
removed call to registerListeners from the constructor.
+2006-07-23 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/java/lang/management/MemoryPoolMXBeanImpl.java,
+ * java/lang/management/MemoryPoolMXBean.java:
+ (getType()): Changed return type to MemoryType.
+ * java/lang/management/MemoryType.java:
+ New file.
+
2006-07-23 Mark Wielaard <mark@klomp.org>
* configure.ac: Check for moc and moc-qt4.
@@ -1386,6 +10992,13 @@
* gnu/java/awt/peer/gtk/CairoSurface.java (CairoSurface): Rearrange
code for the pixel swap routine to be more efficient.
+2006-07-21 Carsten Neumann <cn-develop@gmx.net>
+
+ * java/util/CopyOnWriteArrayList.java (indexOf(E, int)): New method.
+ (lastIndexOf(E, int)): Likewise.
+ (add(E)): Increase the size of newData array by one.
+ (add(int, E)): Likewise.
+
2006-07-20 Lillian Angel <langel@redhat.com>
* gnu/java/awt/dnd/GtkMouseDragGestureRecognizer.java:
@@ -2610,12 +12223,26 @@
TYPE_BYTE_GRAY and TYPE_USHORT_GRAY, and throw an
IllegalArgumentException for an unrecognised type.
+2006-07-10 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/management/ManagementFactory.java:
+ (getMemoryPoolMXBeans): Genericized fully.
+ (getMemoryManagerMXBeans): Likewise.
+ (getGarbageCollectorMXBeans): Likewise.
+
+2006-07-10 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/management/ManagementFactory.java (getMemoryPoolMXBeans):
+ Genericized.
+ (getMemoryManagerMXBeans): Likewise.
+ (getGarbageCollectorMXBeans): Likewise.
+
2006-07-10 Mario Torre <neugens@limasoftware.net>
- * java/awt/BasicStroke.java: Removed unused import.
- * gnu/java/awt/java2d/CubicSegment.java (clone): Fixed.
- * gnu/java/awt/java2d/LineSegment.java (clone): Fixed.
- * gnu/java/awt/java2d/QuadSegment.java (clone): Fixed.
+ * java/awt/BasicStroke.java: Removed unused import.
+ * gnu/java/awt/java2d/CubicSegment.java (clone): Fixed.
+ * gnu/java/awt/java2d/LineSegment.java (clone): Fixed.
+ * gnu/java/awt/java2d/QuadSegment.java (clone): Fixed.
2006-07-10 Matt Wringe <mwringe@redhat.com>
@@ -2736,6 +12363,10 @@
org/omg/PortableServer/ServantLocatorHelper.java: Remove the
typecode caching and always use OrbRestricted.Singleton.
+2006-07-09 Tom Tromey <tromey@redhat.com>
+
+ * java/util/logging/LoggingMXBean.java (getLoggerNames): Genericized.
+
2006-07-09 Mark Wielaard <mark@klomp.org>
* gnu/java/awt/peer/gtk/ComponentGraphics.java (hasXRenderExtension):
@@ -3067,6 +12698,12 @@
2006-07-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * java/lang/Thread.java:
+ (getAllStackTraces(Map<Thread,StackTraceElement[]>)):
+ Added generic type signature.
+
+2006-07-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
* NEWS: Updated.
* doc/vmintegration.texinfo: Likewise.
* examples/gnu/classpath/examples/management/TestGarbageCollector.java,
@@ -4647,6 +14284,10 @@
(setDisplayedMnemonicIndex): Removed unnecessary validation,
(getDisplayedMnemonicIndex): Updated API docs.
+2006-06-21 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/util/Collections (entrySet): Fixed compile error.
+
2006-06-21 David Gilbert <david.gilbert@object-refinery.com>
* javax/swing/DefaultListSelectionModel.java
@@ -5196,6 +14837,11 @@
* java/text/AttributedString.java
(AttributedString): Fix constructor to stop at end point.
+2006-06-17 Tom Tromey <tromey@redhat.com>
+
+ * lib/gen-classlist.sh.in: Search all top-level directories, not
+ just 'org', in external.
+
2006-06-12 Mario torre <neugens at limasoftware.net>
* gnu/java/util/prefs/GConfBasedPreferences.java: new class.
@@ -5288,11 +14934,6 @@
* tools/.cvsignore: Added new tool names.
-2006-06-16 Tom Tromey <tromey@redhat.com>
-
- * vm/reference/sun/reflect/misc/ReflectUtil.java: Moved...
- * vm/reference/sun/misc/ReflectUtil.java: ...from here.
-
2006-06-16 Keith Seitz <keiths@redhat.com>
* gnu/classpath/jdwp/event/EventManager.java (getDefault): Redo
@@ -5318,10 +14959,14 @@
2006-06-16 Tom Tromey <tromey@redhat.com>
* NEWS: Updated for JSR 166.
- * vm/reference/sun/reflect/Reflection.java (verifyMemberAccess):
- Removed.
- (getCallerClass): Now static.
- * vm/reference/sun/reflect/misc/ReflectUtil.java: New file.
+
+2006-06-16 Tom Tromey <tromey@redhat.com>
+
+ * lib/Makefile.am (compile_classpath): Added jsr166.
+ * configure.ac: Added external/jsr166/Makefile.
+ * external/Makefile.am (SUBDIRS): Added jsr166.
+ * external/jsr166/Makefile.am: New file.
+ * lib/gen-classlist.sh.in: Look in external/jsr166.
2006-06-16 Kyle Galloway <kgallowa@redhat.com>
@@ -5336,7 +14981,22 @@
2006-06-16 Tom Tromey <tromey@redhat.com>
- * external/jsr166: Removed files from cvs trunk.
+ Imported JSR 166 reference implementation:
+ * .classpath: Added external/jsr166.
+ * java/util/concurrent/CopyOnWriteArrayList.java: New file.
+ * java/util/AbstractQueue.java: Removed.
+ * java/util/Queue.java: Removed.
+ * external/jsr166/java/util/concurrent/ScheduledThreadPoolExecutor.java
+ (runPeriodic): Added explicit cast.
+ * external/jsr166/java/util/ArrayDeque.java (clone): Use
+ elements.clone.
+
+2006-06-16 Tom Tromey <tromey@redhat.com>
+
+ * vm/reference/sun/reflect/Reflection.java (verifyMemberAccess):
+ Removed.
+ (getCallerClass): Now static.
+ * vm/reference/sun/reflect/misc/ReflectUtil.java: New file.
2006-06-16 Lillian Angel <langel@redhat.com>
@@ -5424,6 +15084,14 @@
(drawImage): Don't use setClip() but instead clipRect() to
intersect the current clip with a new one.
+2006-06-15 Tom Tromey <tromey@redhat.com>
+
+ * scripts/sanitize-jsr166: New file.
+ * external/jsr166/IMPORTING: New file.
+ * vm/reference/sun/reflect/Reflection.java: New file.
+ * vm/reference/gnu/classpath/Unsafe.java: Moved...
+ * vm/reference/sun/misc/Unsafe.java: ...here.
+
2006-06-15 Thomas Fitzsimmons <fitzsim@redhat.com>
* configure.ac: Rename appletviewer to gappletviewer, jarsigner to
@@ -5555,6 +15223,14 @@
(writeShape): Likewise,
* java/awt/Shape.java: Small updates to API docs.
+2006-06-14 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/naming/InitialContext.java:
+ (list(javax.naming.Name)): Fixed generic type.
+ (list(String)): Likewise.
+ (listBindings(javax.naming.Name)): Likewise.
+ (listBindings(String)): Likewise.
+
2006-06-14 Roman Kennke <kennke@aicas.com>
* javax/swing/plaf/basic/BasicComboBoxUI.java
@@ -6592,10 +16268,6 @@
* java/util/InputMismatchException.java:
Documented.
-
-2005-04-20 Tom Tromey <tromey@redhat.com>
-
- * java/util/InputMismatchException.java: New file.
2006-06-07 Andreas Tobler <a.tobler@schweiz.ch>
@@ -6703,13 +16375,6 @@
(clip(Shape)): Implemented correctly, so that the current shape
gets intersected by the parameter shape.
-2006-06-07 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- * java/math/BigDecimal.java:
- (compareTo(Object)): Make this call the other
- one.
- (compareTo(BigDecimal)): Recreated.
-
2006-06-07 Lillian Angel <langel@redhat.com>
* javax/swing/plaf/basic/BasicTabbedPaneUI.java
@@ -7177,44 +16842,13 @@
* java/util/Formatter.java:
Documented.
-2006-03-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- * java/util/Formatter.java:
- Make the class final.
-
-2005-09-26 Tom Tromey <tromey@redhat.com>
-
- * java/util/Formatter.java (format): Set fmtLocale.
- (applyLocalization): New method.
- (basicIntegralConversion): Likewise.
- (hexOrOctalConversion): Use it.
- (decimalConversion): New method.
- (format): Use decimalConversion, dateTimeConversion.
- (genericFormat): Upper-case earlier. Justify correctly.
- (singleDateTimeConversion): New method.
- (dateTimeConversion): Likewise.
-
-2005-09-25 Tom Tromey <tromey@redhat.com>
+2006-06-04 Tom Tromey <tromey@redhat.com>
- * java/util/Formatter.java (lineSeparator): Use SystemProperties.
-
-2005-09-24 Tom Tromey <tromey@redhat.com>
-
- * java/util/FormattableFlags.java (PLUS, SPACE, ZERO, COMMA,
- PAREN): New constants.
- * java/util/Formattable.java: New file.
- * java/util/Formatter.java: New file.
-
-2005-08-13 Tom Tromey <tromey@redhat.com>
-
- * java/util/FormattableFlags.java: New file.
-
-2006-06-04 Sven de Marothy <sven@physto.se>
-
- * gnu/java/awt/peer/gtk/GtkComponentPeer.java
- (createVolatileImage): Pass peer to VolatileImage constructor.
- * java/awt/Component.java
- (createVolatileImage): Call peer method directly.
+ * javax/naming/Context.java (list): Genericized.
+ (listBindings): Likewise.
+ * javax/naming/Reference.java (addrs): Genericized.
+ * javax/naming/InitialContext.java (myProps): Fixed type.
+ (init): Genericized.
2006-06-04 Andrew John Hughes <gnu_andrew@member.fsf.org>
@@ -7233,59 +16867,19 @@
* java/util/UnknownFormatFlagsException.java:
Documented.
-2005-08-13 Tom Tromey <tromey@redhat.com>
-
- * java/util/UnknownFormatConversionException.java
- (serialVersionUID): New field.
- (s): Renamed from 'conv' for serialization.
- * java/util/MissingFormatWidthException.java (serialVersionUID):
- New field.
- (s): Renamed from 'width' for serialization.
- * java/util/MissingFormatArgumentException.java
- (serialVersionUID): New field.
- (s): Renamed from 'spec' for serialization.
- * java/util/IllegalFormatWidthException.java (serialVersionUID):
- New field.
- (w): Renamed from 'width' for serialization.
- * java/util/IllegalFormatPrecisionException.java
- (serialVersionUID): New field.
- (p): Renamed from 'precision' for serialization.
- * java/util/IllegalFormatFlagsException.java (serialVersionUID):
- New field.
- * java/util/IllegalFormatConversionException.java
- (serialVersionUID): New field.
- (c): Renamed from 'conv' for serialization.
- (arg): Renamed from 'argClass' for serialization.
- * java/util/IllegalFormatCodePointException.java
- (serialVersionUID): New field.
- (c): Renamed from 'codepoint' for serialization.
- * java/util/FormatFlagsConversionMismatchException.java
- (serialVersionUID): New field.
- (f): Renamed from 'flags' for serialization.
- (c): Renamed from 'conversion' for serialization.
- * java/util/DuplicateFormatFlagsException.java (serialVersionUID):
- New field.
- * java/util/IllegalFormatException.java (serialVersionUID): New
- field.
- * java/util/FormatterClosedException.java (serialVersionUID): New
- field.
+2006-06-04 Andrew John Hughes <gnu_andrew@member.fsf.org>
-2005-04-20 Tom Tromey <tromey@redhat.com>
-
- * java/util/DuplicateFormatFlagsException.java: New file.
- * java/util/FormatFlagsConversionMismatchException.java: New file.
- * java/util/FormatterClosedException.java: New file.
- * java/util/IllegalFormatCodePointException.java: New file.
- * java/util/IllegalFormatConversionException.java: New file.
- * java/util/UnknownFormatFlagsException.java: New file.
- * java/util/UnknownFormatConversionException.java: New file.
- * java/util/MissingFormatWidthException.java: New file.
- * java/util/MissingFormatArgumentException.java: New file.
- * java/util/IllegalFormatWidthException.java: New file.
- * java/util/IllegalFormatPrecisionException.java: New file.
- * java/util/IllegalFormatFlagsException.java: New file.
- * java/util/IllegalFormatException.java: New file.
+ * java/lang/System.java:
+ (getenv()): Handle cases where split only
+ returns an array of size 1.
+
+2006-06-04 Sven de Marothy <sven@physto.se>
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java
+ (createVolatileImage): Pass peer to VolatileImage constructor.
+ * java/awt/Component.java
+ (createVolatileImage): Call peer method directly.
+
2006-06-04 Sven de Marothy <sven@physto.se>
* gnu/java/awt/peer/gtk/CairoSurface.java
@@ -7299,130 +16893,6 @@
(getFlippedBuffer): New method
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c
Avoid window casts.
-
-2006-03-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- * java/lang/System.java:
- (nanoTime()): Documented.
-
-2006-03-20 Tom Tromey <tromey@redhat.com>
-
- * java/lang/System.java:
- (nanoTime()): Implemented.
-
-2006-03-01 Anthony Balkissoon <abalkiss@redhat.com>
-
- * java/math/BigDecimal.java:
- (precision): Fixed overflow problem with large numbers.
- (longValueExact): New method.
- (intValueExact): Likewise.
- (byteValueExact): Likewise.
- (shortValueExact): Likewise.
-
-2006-03-01 Anthony Balkissoon <abalkiss@redhat.com>
-
- * java/math/BigDecimal.java:
- (remainder(BigDecimal)): New method.
- (divideAndRemainder(BigDecimal)): Likewise.
- (divideToIntegralValue(BigDecimal)): Likewise.
- (floor): New implementation method.
-
-2006-02-28 Anthony Balkissoon <abalkiss@redhat.com>
-
- * java/math/BigDecimal.java:
- (divide(BigDecimal, int, RoundingMode)): New method.
- (divide(BigDecimal, RoundingMode)): Likewise.
- (divide(BigDecimal, int, int)): Removed incorrect throwing of exception
- when the new scale is < 0.
- (setScale(int, RoundingMode)): New method.
- (ulp): Likewise.
-
-2006-02-27 Anthony Balkissoon <abalkiss@redhat.com>
-
- * java/math/BigDecimal.java: Replaced occurences of BigInteger.valueOf
- with BigInteger.ZERO, BigInteger.ONE, BigInteger.TEN where appropriate.
- (add(BigDecimal, MathContext)): New method.
- (subtract(BigDecimal, MathContext)): Likewise.
- (precision): Fixed to correctly handle BigIntegers with more than 19
- digits.
- (pow(int, MathContext)): New method.
-
-2006-02-27 Anthony Balkissoon <abalkiss@redhat.com>
-
- * java/math/BigDecimal.java: Added @throws clause to constructors.
- (mathContext): Removed this unneeded field.
- (BigDecimal(int, MathContext)): New constructor.
- (BigDecimal(BigInteger, int, MathContext)): Likewise.
- (multiply(BigDecimal, MathContext)): New method.
- (negate(MathContext)): Likewise.
- (plus(MathContext)): Likewise.
- (numDigitsInLong): Fixed to properly handle negatives.
-
-2006-02-24 Anthony Balkissoon <abalkiss@redhat.com>
-
- * java/math/BigDecimal.java:
- (BigDecimal(long, MathContext)): New constructor.
- (BigDecimal(BigInteger, MathContext)): Likewise.
- (BigDecimal(String, MathContext)): Likewise.
- (BigDecimal(double, MathContext)): Likewise.
- (round): Fixed a typo where the precision field was used instead of a
- call to the precision method, and also store the new precision in the
- returned BigDecimal.
- (abs(MathContext)): New method.
-
-2006-02-24 Anthony Balkissoon <abalkiss@redhat.com>
-
- * java/math/BigDecimal.java
- (toBigInteger): Fixed problem where this method couldn't handle
- negative values for scale.
- (toBigIntegerExact): New method.
- (stripTrailingZeros): Likewise.
-
-2006-02-23 Anthony Balkissoon <abalkiss@redhat.com>
-
- * java/math/BigDecimal.java:
- (toString): Fixed a problem where the negative sign was being displayed
- twice in the exponent.
- (toEngineeringString): New method.
- (toPlainString): Likewise.
- (pow): Likewise.
-
-2006-02-23 Anthony Balkissoon <abalkiss@redhat.com>
-
- * java/math/BigDecimal.java:
- (toString): Rewrote this method to behave as specified. Added API
- comments to explain behaviour.
- (scaleByPowerOfTen): New method.
-
-2006-02-22 Anthony Balkissoon <abalkiss@redhat.com>
-
- * java/math/BigDecimal.java:
- (BigDecimal(char[], int, int, MathContext)): New constructor.
- (BigDecimal(char[], MathContext)): Likewise.
- (BigDecimal(char[])): Likewise.
- (BigDecimal(char[], int, int)): Likewise.
- (BigDecimal(String)): Fixed handling of exponent and scale.
-
-2006-02-21 Anthony Balkissoon <abalkiss@redhat.com>
-
- * java/math/BigDecimal.java:
- (mathContext): New field.
- (precision): Likewise.
- (BigDecimal(int)): New constructor.
- (BigDecimal(long)): Likewise.
- (BigDecimal(BigInteger)): Added API docs.
- (BigDecimal(BigInteger, int)): Removed incorrect NumberFormatException
- and added API docs.
- (plus): New method.
- (round): Likewise.
- (precision): Likewise.
- (valueOf): Likewise.
- (numDigitsInLong): New implementation method.
-
-2006-02-21 Anthony Balkissoon <abalkiss@redhat.com>
-
- * java/math/MathContext.java: New class.
-
2006-06-04 Andrew John Hughes <gnu_andrew@member.fsf.org>
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c:
@@ -7495,11 +16965,17 @@
* java/lang/annotation/IncompleteAnnotationException.java:
Documented.
-2004-08-07 Tom Tromey <tromey@redhat.com>
-
- * java/lang/annotation/IncompleteAnnotationException.java: New
- file.
+2006-06-03 Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * java/lang/ProcessBuilder.java:
+ Documented.
+ (environment): Create as a copy.
+ * java/lang/System.java:
+ (EnvironmentMap.EnvironmentMap(Map<String,String>)):
+ New constructor.
+ (EnvironmentMap.put(String,String)): Override superclass
+ method with checks for nulls and non-Strings.
+
2006-06-02 Sven de Marothy <sven@physto.se>
* gnu/java/awt/peer/gtk/CairoGraphics2D.java
@@ -8187,11 +17663,6 @@
* native/jni/gtk-peer/gtkpeer.h
Remove graphics2d structure.
-2006-05-29 Mark Wielaard <mark@klomp.org>
-
- * java/io/ObjectStreamConstants.java: Removed double declaration
- of SC_ENUM.
-
2006-05-29 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* gnu/java/awt/peer/gtk/GdkGraphics2D.java (copying constructor):
@@ -9532,6 +19003,14 @@
2006-05-15 Tom Tromey <tromey@redhat.com>
+ * java/text/MessageFormat.java (format): Now varargs.
+
+2006-05-15 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/Thread.java (State): Fixed typo.
+
+2006-05-15 Tom Tromey <tromey@redhat.com>
+
* java/net/URLClassLoader.java: Moved inner classes to
gnu.java.net.loader.
(factoryCache): Changed type.
@@ -9572,6 +19051,19 @@
Announce inclusion of appletviewer.
* INSTALL: Note gcjwebplugin dependencies.
+2006-05-15 Mark Wielaard <mark@klomp.org>
+
+ * configure.ac (VERSION): Set to 0.91-generics.
+
+2006-05-15 Mark Wielaard <mark@klomp.org>
+
+ * NEWS: Add release date and VMClassLoader.getBootPackages()
+ changes.
+
+2006-05-15 Christian Thalinger <twisti@complang.tuwien.ac.at>
+
+ * README: Added CACAO to list of VMs.
+
2006-05-15 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* javax/swing/RepaintManager.java (paintDirtyRegions):
@@ -9714,11 +19206,6 @@
* java/awt/Graphics2D.java: Added some API doc comments.
-2006-05-15 Mark Wielaard <mark@klomp.org>
-
- * NEWS: Add release date and VMClassLoader.getBootPackages()
- changes.
-
2006-05-15 David Gilbert <david.gilbert@object-refinery.com>
* javax/swing/JTabbedPane.java
@@ -9764,10 +19251,6 @@
(getPageAttributes): New method.
(setPageable,cancel,isCancelled): Implement.
-2006-05-15 Christian Thalinger <twisti@complang.tuwien.ac.at>
-
- * README: Added CACAO to list of VMs.
-
2006-05-14 David Gilbert <david.gilbert@object-refinery.com>
* javax/swing/JCheckBoxMenuItem.java
@@ -9827,12 +19310,46 @@
* native/jni/java-net/javanet.c (_javanet_accept): Don't use C++
comments.
+2006-05-14 Chris Burdess <dog@gnu.org>
+
+ * gnu/xml/dom/DomNode.java: Permit comments and PIs in doctype
+ nodes to be preserved during cloneNode.
+
2006-05-14 Mark Wielaard <mark@klomp.org>
PR 27459
* native/jni/java-net/javanet.c (_javanet_accept): Reset the
inherited timeout on socket.
+2006-05-14 Lillian Angel <langel@redhat.com>
+
+ * java/util/SimpleTimeZone.java: Reverted patch.
+ (SimpleTimeZone): Throw exception if startMonth ==
+ endMonth.
+ (SimpleTimeZone): Likewise.
+ (checkRule): Rewritten to properly check all values (more
+ efficently).
+ This code is now more stable, at least less buggy than before.
+ Fixed API documentation.
+ (setStartRule): Moved checkRule call to end.
+ (setStartRule): Likewise.
+ (setEndRule): Likewise.
+ (setEndRule): Likewise.
+
+2006-05-14 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ * javax/swing/tree/DefaultTreeSelectionModel.java (leadRow):
+ Initialise to -1.
+
+2006-05-14 Robert Schuster <robertschuster@fsfe.org>
+
+ PR classpath/27595
+ * javax/swing/text/AbstractDocument.java:
+ (insertString): Flipped if-expression and its blocks.
+ (remove): Dito.
+ (replace): Flipped if-expression and its blocks, added note, invoke
+ insertString and remove instead of insertStringImpl and removeImpl.
+
2006-05-14 Raif S. Naffah <raif@swiftdsl.com.au>
* tools/gnu/classpath/tools/jarsigner/Main.java (main): Formatting.
@@ -10040,13 +19557,13 @@
Set correct socket parameters SO_SNDTIMEO and SO_RCVTIMEO.
2006-05-12 Sven de Marothy <sven@physto.se>
-
+
* gnu/javax/print/CupsServer.java
(CupsServer): Make the Cups host configurable.
* java/lang/System.java: Document the system property.
2006-05-12 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/border/TitledBorder.java
(paintBorder): Rewritten for simplicity and correctness.
(layoutBorderWithTitle): New helper method.
@@ -10056,9 +19573,9 @@
(getRealJustification): Removed.
(getMeasurements): Removed.
(Measurements): Removed.
-
+
2006-05-12 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/plaf/basic/BasicPanelUI.java
(sharedUI): New field,
(createUI): Return a shared instance rather than a new instance,
@@ -10143,14 +19660,14 @@
* gnu/java/awt/font/GNUGlyphVector.java
(GNUGlyphVector): Don't apply the font renderer context's
transform.
-
+
2006-05-11 Mark Wielaard <mark@klomp.org>
* java/util/logging/Logger.java (global): Initialize inside static
PrivilegedAction.
2006-05-11 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/JFrame.java
(EXIT_ON_CLOSE): Added note to API docs,
(close_action): Renamed closeAction,
@@ -10160,31 +19677,31 @@
(getDefaultCloseOperation): Updated for renamed field, added API docs,
(processWindowEvent): Updated for renamed field,
(setDefaultCloseOperation): Likewise, and updated API docs.
-
+
2006-05-11 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/JFrame.java
(paramString): Reimplemented,
* javax/swing/SwingUtilities.java
(convertWindowConstantToString): New method.
-
+
2006-05-11 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/WindowConstants.java: Updated API docs.
-
+
2006-05-11 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/plaf/basic/BasicToggleButtonUI.java: Updated API docs,
(createUI): Removed 'final' qualifier for parameter,
(paint): Reformatted.
-
+
2006-05-11 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/plaf/basic/BasicCheckBoxUI.java: Added API docs plus,
(createUI): Removed 'final' qualifier on method argument.
-
+
2006-05-11 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/plaf/basic/BasicCheckBoxUI.java
(getDefaultIcon): Removed this redundant method.
@@ -10197,12 +19714,12 @@
* java/awt/Component.java:
(dispatchEventImpl): Added comment.
-
-2006-05-11 Mark Wielaard <mark@klomp.org>
-
+
+ 2006-05-11 Mark Wielaard <mark@klomp.org>
+
* tools/gnu/classpath/tools/appletviewer/Main.java (main): Cast
Option constructor null argument to String.
-
+
2006-05-11 Mark Wielaard <mark@klomp.org>
* java/awt/geom/GeneralPath.java (WIND_EVEN_ODD, WIND_NON_ZERO):
@@ -10224,21 +19741,22 @@
2006-05-10 Roman Kennke <kennke@aicas.com>
- PR 27481
+ PR classpath/27481
* javax/swing/plaf/basic/BasicInternalFrameUI.java
(installDefaults): Set background of content pane to null, if
no custom color has been installed by the application yet.
-2006-05-10 Sven de Marothy <sven@physto.se>
-
- * java/awt/print/PrinterJob.java:
- (lookupPrintServices): Un-comment-out.
-
2006-05-10 Roman Kennke <kennke@aicas.com>
+ PR classpath/27481
* javax/swing/JRootPane.java
(createContentPane): Don't set background to null.
+2006-05-10 Sven de Marothy <sven@physto.se>
+
+ * java/awt/print/PrinterJob.java:
+ (lookupPrintServices): Un-comment-out.
+
2006-05-11 Raif S. Naffah <raif@swiftdsl.com.au>
* tools/gnu/classpath/tools/getopt/OptionGroup.java
@@ -10373,7 +19891,7 @@
2006-05-09 Robert Schuster <robertschuster@fsfe.org>
- Fixed PR24216.
+ PR classpath/24216
* javax/swing/text/AbstractDocument.java:
(insertString): Added more documentation, added argument check.
(remove): Added more documentation.
@@ -11714,6 +21232,14 @@
* javax/swing/tree/DefaultTreeModel.java (reload): Implemented.
(reload(TreeNode)): Implemented.
+2006-04-25 Tom Tromey <tromey@redhat.com>
+
+ * javax/swing/JComboBox.java (AccessibleJComboBox): Now public.
+ * javax/swing/tree/VariableHeightLayoutCache.java
+ (getVisiblePathsFrom): Genericized.
+ * javax/swing/tree/FixedHeightLayoutCache.java (getVisiblePathsFrom):
+ Genericized.
+
2006-04-25 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* javax/swing/plaf/basic/BasicTreeUI.java (MouseHandler.mousePressed):
@@ -11881,40 +21407,16 @@
(updateClip): New method.
(clipShape): New method.
-2006-04-23 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
- * examples/gnu/classpath/examples/swing/TreeDemo.java:
- (createContent): Added check box to swith between single and
- multiple selection.
- * javax/swing/JTree.java (leadSelectionPath): Removed.
- (addSelectionInterval): Explained. (getLeadSelectionPath):
- Request the path from model. (getPathsBetweenRows): Explained.
- (setLeadSelectionPath): Set the path in model.
- * javax/swing/plaf/basic/BasicTreeUI.java
- (TreeIncrementAction.actionPerformed, isMultiSelectionEvent,
- isToggleSelectionEvent, selectPath, selectPathForEvent): Rewritten.
- (MouseHandler.mousePressed): Call selectPathForEvent.
-
-2006-04-23 Roman Kennke <kennke@aicas.com>
-
- * gnu/java/awt/java2d/AbstractGraphics2D.java: New file.
-
2006-04-23 Jeroen Frijters <jeroen@frijters.net>
- * NEWS: Added entry about new Package constructor.
* java/lang/Package.java: Added compatibility constructor to ease
VM interface migration.
2006-04-23 Jeroen Frijters <jeroen@frijters.net>
- * NEWS: Added information about annotation support.
- * java/lang/Class.java: Implement AnnotatedElement.
- (equals): Reformatted to match generics branch.
- (getEnumConstants): Implemented.
- (getAnnotation, getAnnotations, getDeclaredAnnotations,
- isAnnotationPresent): Merged from generics branch.
- * vm/reference/java/lang/VMClass.java (getDeclaredAnnotations):
- New method.
+ * java/lang/Class.java (getEnumConstants): Implemented without
+ delegating to VMClass.
+ * vm/reference/java/lang/VMClass.java (getEnumConstants): Removed.
2006-04-23 Jeroen Frijters <jeroen@frijters.net>
@@ -11922,17 +21424,28 @@
Package constructor.
* java/lang/Package.java (Package): Added ClassLoader argument.
(loader): New field.
- (getAnnotation, getAnnotations, getDeclaredAnnotations,
- isAnnotationPresent): Merged from generics branch.
+ (getDeclaredAnnotations): Implemented without help from VMPackage.
* vm/reference/java/lang/VMClassLoader.java (static): Added argument
to Package constructor.
+ * vm/reference/java/lang/VMPackage.java: Removed.
-2005-12-14 Nicolas Geoffray <nicolas.geoffray@menlina.com>
+2006-04-23 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ * examples/gnu/classpath/examples/swing/TreeDemo.java:
+ (createContent): Added check box to swith between single and
+ multiple selection.
+ * javax/swing/JTree.java (leadSelectionPath): Removed.
+ (addSelectionInterval): Explained. (getLeadSelectionPath):
+ Request the path from model. (getPathsBetweenRows): Explained.
+ (setLeadSelectionPath): Set the path in model.
+ * javax/swing/plaf/basic/BasicTreeUI.java
+ (TreeIncrementAction.actionPerformed, isMultiSelectionEvent,
+ isToggleSelectionEvent, selectPath, selectPathForEvent): Rewritten.
+ (MouseHandler.mousePressed): Call selectPathForEvent.
- * java/lang/ClassLoader
- (defineClass(String,byte[],int,int,ProtectionDomain)):
- Calls VMClassLoader.defineClassWithTransformers instead
- of VMClassLoader.defineClass.
+2006-04-23 Roman Kennke <kennke@aicas.com>
+
+ * gnu/java/awt/java2d/AbstractGraphics2D.java: New file.
2006-04-22 Andrew John Hughes <gnu_andrew@member.fsf.org>
@@ -11940,18 +21453,6 @@
Mention changes to VMProcess and VMSystem.
* doc/vmintegration.texinfo:
Change documentation on VMProcess and VMSystem.
- * java/lang/reflect/Modifier.java:
- (toString(int,StringBuilder)): Merged from generics
- branch.
- * vm/reference/java/lang/reflect/Constructor.java
- (toString()): Use StringBuilder.
- (toGenericString()): Likewise.
- * vm/reference/java/lang/reflect/Field.java:
- (toString()): Use StringBuilder.
- (toGenericString()): Likewise.
- * vm/reference/java/lang/reflect/Method.java
- (toString()): Use StringBuilder.
- (toGenericString()): Likewise.
* include/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.h,
* include/gnu_java_awt_peer_gtk_GdkFontPeer.h,
* include/gnu_java_awt_peer_gtk_GdkGraphics.h,
@@ -12053,40 +21554,6 @@
* include/java_lang_VMSystem.h:
Regenerated with GCJ 4.1.
-2005-12-05 Casey Marshall <csm@gnu.org>
-
- * native/jni/classpath/jcl.h (environ): define, or declare
- 'extern.'
- * native/jni/java-lang/java_lang_VMProcess.c: include <jcl.h>.
- Remove 'extern' define.
- * native/jni/java-lang/java_lang_VMSystem.c
- (Java_java_lang_VMSystem_environ): don't declare 'environ.'
-
-2005-09-25 Jeroen Frijters <jeroen@frijters.net>
-
- * java/lang/System.java,
- vm/reference/java/lang/VMSystem.java: Removed generic type
- from VMSystem.environ() signature.
-
-2005-05-04 Tom Tromey <tromey@redhat.com>
-
- * native/jni/java-lang/java_lang_VMProcess.c
- (Java_java_lang_VMProcess_nativeSpawn): Added 'redirect'
- argument. Use defines instead of contents.
- * vm/reference/java/lang/VMProcess.java (redirect): New field.
- (spawn): Updated.
- (setProcessInfo): Updated.
- (VMProcess): Added 'redirect' argument.
- (nativeSpawn): Likewise.
- (exec): New overload.
-
-2005-01-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- * include/java_lang_VMSystem.h:
- (Java_java_lang_VMSystem_environ): added
- * vm/reference/java/lang/VMSystem.java:
- (environ()): new native method
-
2006-04-22 Casey Marshall <csm@gnu.org>
Fixes PR classpath/27228.
@@ -12156,6 +21623,13 @@
* java/sql/Time.java: Likewise.
* java/sql/Timestamp.java: Likewise.
+2006-04-21 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/lang/reflect/AccessibleObject.java:
+ Implemented AnnotatedElement.
+ (getAnnotation, getAnnotations, getDeclaredAnnotations,
+ isAnnotationPresent): New methods.
+
2006-04-21 Tom Tromey <tromey@redhat.com>
PR classpath/27163:
@@ -12184,13 +21658,6 @@
(SpinnerDateModel(Date, Comparable, Comparable, int)): Fix argument
checking to call compareTo() on start and end.
-2006-04-21 Jeroen Frijters <jeroen@frijters.net>
-
- * java/lang/reflect/AccessibleObject.java:
- Implemented AnnotatedElement.
- (getAnnotation, getAnnotations, getDeclaredAnnotations,
- isAnnotationPresent): New methods.
-
2006-04-21 David Gilbert <david.gilbert@object-refinery.com>
* javax/swing/border/AbstractBorder.java: API doc updates,
@@ -12639,27 +22106,12 @@
(createActionMap): Modified actions to fetch slider/ui from the event
source.
-2006-04-17 David Gilbert <david.gilbert@object-refinery.com>
-
- * javax/swing/JToolBar.java
- (AccessibleJToolBar.AccessibleJToolBar()): Updated API docs,
- (AccessibleJToolBar.getAccessibleStateSet): Implemented,
- (AccessibleJToolBar.getAccessibleRole): Updated API docs,
- (getAccessibleContext): Likewise.
-
2006-04-17 Andrew John Hughes <gnu_andrew@member.fsf.org>
* java/lang/Enum.java: Documented.
2006-04-17 Andrew John Hughes <gnu_andrew@member.fsf.org>
- * NEWS:
- Mention merge of instrumentation classes.
- * doc/vmintegration.texinfo:
- Move instrumentation to correct section.
-
-2006-04-17 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
* gnu/java/lang/InstrumentationImpl.java:
Moved from java.lang.
* java/lang/InstrumentationImpl.java:
@@ -12670,43 +22122,19 @@
Corrected reference to InstrumentationImpl.
* vm/reference/java/lang/VMInstrumentationImpl.java:
Removed.
-
-2005-12-14 Nicolas Geoffray <nicolas.geoffray@menlina.com>
-
- * vm/reference/java/lang/VMClassLoader
- (defineClassWithTransformers): New method.
- (instrumenter): New Field.
-
-2005-12-04 Nicolas Geoffray <nicolas.geoffray@menlina.com>
-
- * vm/reference/java/lang/VMInstrumentationImpl.java
- (redefineClasses): Added an extra parameter of type
- java.lang.instrument.Instrument.
- * java/lang/InstrumentationImpl.java
- (redefineClasses): Added the Instrumentation object
- to the arguments of VMInstrumentationImpl.redefineClasses
- call.
-
-2005-12-03 Nicolas Geoffray <nicolas.geoffray@menlina.com>
- * java/lang/InstrumentationImpl.java:
- New file.
- * vm/reference/java/lang/VMInstrumentationImpl.java:
- New file.
-
-2006-04-17 Jeroen Frijters <jeroen@frijters.net>
-
- * java/util/Collection.java: Implemented java.lang.Iterable.
+2006-04-17 Andrew John Hughes <gnu_andrew@member.fsf.org>
-2006-04-17 Jeroen Frijters <jeroen@frijters.net>
+ * java/lang/annotation/Annotation.java:
+ Documented.
+
+2006-04-17 David Gilbert <david.gilbert@object-refinery.com>
- * java/lang/Boolean.java: Implemented Comparable.
- * java/lang/ClassLoader.java
- (getResources): Not final anymore in 1.5.
- * java/lang/Enum.java, java/lang/Iterable.java:
- Copied from generics branch.
- * java/lang/Thread.java (destroy): Marked deprecated.
- * java/lang/ThreadLocal.java (remove): New method.
+ * javax/swing/JToolBar.java
+ (AccessibleJToolBar.AccessibleJToolBar()): Updated API docs,
+ (AccessibleJToolBar.getAccessibleStateSet): Implemented,
+ (AccessibleJToolBar.getAccessibleRole): Updated API docs,
+ (getAccessibleContext): Likewise.
2006-04-17 Dalibor Topic <robilad@kaffe.org>
@@ -12783,59 +22211,6 @@
(getActionMap): New method,
(createActionMap): New method.
-2006-04-17 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- * java/lang/annotation/Annotation.java:
- Documented.
-
-2005-06-09 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- * java/lang/reflect/AnnotatedElement.java: Documented.
-
-2005-01-07 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- * java/lang/reflect/AnnotatedElement.java:
- Added import of java.lang.annotation.Annotation
-
-2004-08-26 Tom Tromey <tromey@redhat.com>
-
- * java/lang/reflect/AnnotatedElement.java: New file.
-
-2004-08-07 Tom Tromey <tromey@redhat.com>
-
- * java/lang/annotation/Annotation.java: New file.
-
-2005-12-13 Tom Tromey <tromey@redhat.com>
-
- * java/lang/instrument/ClassDefinition.java: Reformatted.
- * java/lang/instrument/UnmodifiableClassException.java: Reformatted.
- * java/lang/instrument/IllegalClassFormatException.java: Reformatted.
-
-2005-12-13 Tom Tromey <tromey@redhat.com>
-
- * java/lang/instrument/ClassDefinition.java (ClassDefinition): Now
- public.
-
-2005-12-05 Tom Tromey <tromey@redhat.com>
-
- * java/lang/instrument/Instrumentation.java (redefineClasses): Javadoc
- fix.
- * java/lang/instrument/ClassFileTransformer.java (transform): Javadoc
- fix.
-
-2005-12-03 Nicolas Geoffray <nicolas.geoffray@menlina.com>
-
- * java/lang/instrument: New directory.
- * java/lang/instrument/ClassDefinition.java:
- New file.
- * java/lang/instrument/ClassFileTransformer.java:
- New file.
- * java/lang/instrument/IllegalClassFormatException.java:
- New file.
- * java/lang/instrument/Instrumentation.java:
- New file.
- * java/lang/instrument/UnmodifiableClassException.java:
- New file.
2006-04-16 Andrew John Hughes <gnu_andrew@member.fsf.org>
@@ -12890,13 +22265,13 @@
(INDETERMINATE): Added field.
(MANAGES_DESCENDANTS): Likewise.
(TRUNCATED): Likewise.
- * vm/reference/java/lang/reflect/Constructor.java:
- Fixed copyright header to match generics branch.
- * vm/reference/java/lang/reflect/Field.java:
- Fixed copyright header to match generics branch.
- (toGenericString()): Ported from generics branch.
- (getGenericType()): Likewise.
- (getSignature()): Likewise.
+
+2006-04-14 Tom Tromey <tromey@redhat.com>
+
+ * javax/swing/tree/DefaultTreeSelectionModel.java (getListeners):
+ Genericized.
+ * javax/swing/tree/AbstractLayoutCache.java (getVisiblePathsFrom):
+ Genericized.
2006-04-14 Robert Schuster <robertschuster@fsfe.org>
@@ -12983,6 +22358,11 @@
(AccessibleJSplitPane.getMinimumAccessibleValue): Implemented,
(AccessibleJSplitPane.getMaximumAccessibleValue): Implemented.
+2006-04-10 Tom Tromey <tromey@redhat.com>
+
+ * javax/imageio/metadata/IIOMetadataFormatImpl.java (addObjectValue):
+ Fixed parameter bounds.
+
2006-04-13 Andrew John Hughes <gnu_andrew@member.fsf.org>
* gnu/javax/crypto/assembly/Assembly.java,
@@ -14152,125 +23532,6 @@
(getInputStream): Override available function for
InflaterInputStream instance.
-2006-04-03 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- * gnu/java/lang/reflect/ClassSignatureParser.java,
- * gnu/java/lang/reflect/FieldSignatureParser.java,
- * gnu/java/lang/reflect/GenericSignatureParser.java,
- * gnu/java/lang/reflect/MethodSignatureParser.java,
- * gnu/java/lang/reflect/TypeImpl.java,
- * java/lang/Class.java,
- * java/lang/reflect/GenericDeclaration.java,
- * java/lang/reflect/MalformedParameterizedTypeException.java,
- * java/lang/reflect/TypeVariable.java,
- * java/util/Arrays.java,
- * vm/reference/java/lang/VMClass.java,
- * vm/reference/java/lang/reflect/Constructor.java,
- * vm/reference/java/lang/reflect/Method.java:
- Incorporate changes from the generics branch.
-
-2005-10-01 Jeroen Frijters <jeroen@frijters.net>
-
- * vm/reference/java/lang/reflect/Constructor.java
- (getSignature): New method.
- (getGenericExceptionTypes): New method.
- (getGenericParameterTypes): New method.
- * vm/reference/java/lang/reflect/Method.java
- (getSignature): New method.
- (getGenericExceptionTypes): New method.
- (getGenericParameterTypes): New method.
- (getGenericReturnType): New method.
-
-2005-09-30 Jeroen Frijters <jeroen@frijters.net>
-
- * gnu/java/lang/reflect/FieldSignatureParser.java: New file.
- * gnu/java/lang/reflect/ClassSignatureParser.java,
- gnu/java/lang/reflect/GenericSignatureParser.java,
- gnu/java/lang/reflect/MethodSignatureParser.java:
- Finished implementation.
-
-2005-09-25 Jeroen Frijters <jeroen@frijters.net>
-
- * gnu/java/lang/reflect/ClassSignatureParser.java,
- gnu/java/lang/reflect/GenericSignatureParser.java,
- gnu/java/lang/reflect/MethodSignatureParser.java: New files.
- * java/lang/Class.java
- (getGenericInterfaces, getGenericSuperclass, getTypeParameters):
- Implemented.
- * vm/reference/java/lang/VMClass.java
- (getSimpleName, getDeclaredAnnotations, getCanonicalName,
- getEnclosingClass, getEnclosingConstructor, getEnclosingMethod,
- isAnonymousClass, isLocalClass, isMemberClass):
- Removed generic types from signatures.
- (getGenericInterfaces, getGenericSuperclass, getTypeParameters):
- Removed.
- (getClassSignature): New method.
- * vm/reference/java/lang/reflect/Constructor.java
- (getTypeParameters): Implemented.
- * vm/reference/java/lang/reflect/Method.java
- (getTypeParameters, getSignature): New methods.
-
-2005-06-09 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- * java/lang/Class.java:
- (asSubclass(Class)): Documented.
- (getCanonicalName()): Implemented.
- (getEnclosingClass()): Implemented.
- (getEnclosingConstructor()): Implemented.
- (getEnclosingMethod()): Implemented.
- (getGenericInterfaces()): Implemented.
- (getGenericSuperclass()): Implemented.
- (getTypeParameters()): Implemented.
- (isAnonymousClass()): Implemented.
- (isLocalClass()): Implemented.
- (isMemberClass()): Implemented.
- * vm/reference/java/lang/VMClass.java:
- (getSuperClass(Class<?>)): Updated return type.
- (getSimpleName(Class<?>)): Use VM methods directly.
- (getCanonicalName(Class<?>)): Implemented.
- (getEnclosingClass(Class<?>)): New native method.
- (getEnclosingConstructor(Class<?>)): New native method.
- (getEnclosingMethod(Class<?>)): New native method.
- (getGenericInterfaces(Class<?>)): New native method.
- (getGenericSuperclass(Class<?>)): New native method.
- (getTypeParameters(Class<T>)): New native method.
- (isAnonymousClass(Class<?>)): New native method.
- (isLocalClass(Class<?>)): New native method.
- (isMemberClass(Class<?>)): New native method.
- * vm/reference/java/lang/reflect/Constructor.java:
- (getTypeParameters()): Changed to native method.
-
-2005-05-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- * java/lang/Class.java:
- (getSimpleName()): Implemented.
- * vm/reference/java/lang/VMClass.java:
- (getSimpleName()): Reference implementation.
-
-2005-04-20 Tom Tromey <tromey@redhat.com>
-
- * java/util/Arrays.java (hashCode): New methods.
- (deepHashCode): New method.
- (deepEquals): Likewise.
- (toString): New methods.
- (deepToString): New method.
-
-2005-04-04 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- * java/lang/Class.java:
- (isEnum()): New method implemented.
- (isSynthetic()): New method implemented.
- (isAnnotation()): New method implemented.
- * vm/reference/java/lang/VMClass.java:
- (isEnum()): New native method.
- (isSynthetic()): New native method.
- (isAnnotation()): New native method.
-
-2005-03-21 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- * java/lang/Class.java:
- Implements java.lang.reflect.Type
-
2006-04-03 Thomas Fitzsimmons <fitzsim@redhat.com>
* javax/imageio/plugins/jpeg/JPEGImageReadParam.java: New file.
@@ -14379,6 +23640,29 @@
(Logger): Set parent to root.
(setParent): Directly check root field.
+2006-04-02 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/util/Collections.java:
+ (binarySearch(List, T)): Fixed signature.
+ (unmodifiableList(List)): Likewise.
+ (UnmodifiableList(List)): Fixed constructor.
+ (UnmodifiableRandomAccessList(List)): Likewise.
+ (unmodifiableMap(Map)): Fixed signature.
+ (UnmodifiableMap(Map)): Fixed constructor.
+ (unmodifiableSortedMap(Map)): Fixed signature.
+ (UnmodifiableSortedMap(Map)): Fixed constructor.
+
+2006-04-02 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/io/ObjectOutputStream.java:
+ (writeObject(Object)): Added enum support.
+ (writeClassDescriptor(ObjectStreamClass)): Likewise.
+ * java/io/ObjectStreamClass.java:
+ (isEnum()): New package-private method.
+ (setFlags(Class)): Added enum support.
+ * java/io/ObjectStreamConstants.java:
+ (SC_ENUM): Added.
+
2006-04-02 Robert Schuster <robertschuster@fsfe.org>
* javax/swing/text/Segment.java:
@@ -14737,6 +24021,14 @@
component after the removal.
(removeAll): Set selection to -1 before removing the tabs.
+2006-03-29 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/io/ObjectInputStream.java:
+ (parseContent(byte)): Added enum support.
+ * java/io/ObjectStreamConstants.java:
+ (TC_ENUM): Added.
+ (TC_MAX): Changed to new maximum, TC_ENUM.
+
2006-03-29 Lillian Angel <langel@redhat.com>
Partial fix for bug #26929
@@ -14951,10 +24243,50 @@
(paintRightTabBorder): Likewise.
(installDefaults): Fetch tabsOpaque property from the UIDefaults.
+2006-03-27 Tom Tromey <tromey@redhat.com>
+
+ PR classpath/25189:
+ * java/lang/Enum.java (valueOf): Ensure that the named field
+ is an enum constant.
+ (compareTo): Check class of enum.
+
+2006-03-27 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/reflect/ParameterizedType.java: Javadoc fix.
+
+2006-03-27 Tom Tromey <tromey@redhat.com>
+
+ * vm/reference/java/lang/reflect/Method.java (METHOD_MODIFIERS):
+ New constant.
+ (getModifiersInternal): Renamed from getModifiers.
+ (getModifiers): New method.
+ (isBridge): Likewise.
+ (isSynthetic): Likewise.
+ (isVarArgs): Likewise.
+ * vm/reference/java/lang/reflect/Field.java (FIELD_MODIFIERS):
+ New constant.
+ (getModifiersInternal): Renamed from getModifiers.
+ (getModifiers): New method.
+ (isSynthetic): Likewise.
+ (isEnumConstant): Likewise.
+ * vm/reference/java/lang/reflect/Constructor.java
+ (getModifiersInternal): Renamed from getModifiers.
+ (getModifiers): New method
+ (CONSTRUCTOR_MODIFIERS): New constant.
+ (isSynthetic): New method.
+ (isVarArgs): Likewise.
+ * java/lang/reflect/Member.java (isSynthetic): New method.
+
+2006-03-28 Tom Tromey <tromey@redhat.com>
+
+ * java/net/Proxy.java (TYPE): Added missing ";".
+
2006-03-27 Andrew John Hughes <gnu_andrew@member.fsf.org>
- * java/rmi/activation/ActivationGroup_Stub.java:
- Made final.
+ * java/math/RoundingMode.java:
+ Fixed serialization UID.
+ * java/net/Proxy.java:
+ (Type): Likewise.
2006-03-27 Andrew John Hughes <gnu_andrew@member.fsf.org>
@@ -14962,7 +24294,19 @@
(append(char)): Documented.
(append(CharSequence)): Likewise.
(append(CharSequence,int,int)): Likewise.
+
+2006-03-27 Jeroen Frijters <jeroen@frijters.net>
+ * vm/reference/java/lang/reflect/Constructor.java
+ (getTypeParameters): Check return value of getSignature for null.
+ * vm/reference/java/lang/reflect/Method.java
+ (getTypeParameters): Check return value of getSignature for null.
+
+2006-03-27 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/rmi/activation/ActivationGroup_Stub.java:
+ Made final.
+
2006-03-27 Tom Tromey <tromey@redhat.com>
* java/io/CharArrayWriter.java (append): New overloads.
@@ -15038,29 +24382,19 @@
NotImplementedException,
(AccessibleJSlider.getAccessibleValue): Updated API docs.
-2006-03-26 Tom Tromey <tromey@redhat.com>
+2006-03-26 Andrew John Hughes <gnu_andrew@member.fsf.org>
- * NEWS: Updated.
- * vm/reference/java/lang/reflect/Method.java (METHOD_MODIFIERS):
- New constant.
- (getModifiersInternal): Renamed from getModifiers.
- (getModifiers): New method.
- (isBridge): Likewise.
- (isSynthetic): Likewise.
- (isVarArgs): Likewise.
- * vm/reference/java/lang/reflect/Field.java (FIELD_MODIFIERS):
- New constant.
- (getModifiersInternal): Renamed from getModifiers.
- (getModifiers): New method.
- (isSynthetic): Likewise.
- (isEnumConstant): Likewise.
- * vm/reference/java/lang/reflect/Constructor.java
- (getModifiersInternal): Renamed from getModifiers.
- (getModifiers): New method
- (CONSTRUCTOR_MODIFIERS): New constant.
- (isSynthetic): New method.
- (isVarArgs): Likewise.
- * java/lang/reflect/Member.java (isSynthetic): New method.
+ * java/lang/ProcessBuilder.java:
+ Made final.
+
+2006-03-26 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/java/net/protocol/http/Headers.java:
+ Match layout of file on HEAD.
+ * gnu/javax/swing/text/html/parser/htmlValidator.java:
+ Likewise.
+ * java/awt/datatransfer/DataFlavor.java
+ Likewise.
2006-03-26 Andrew John Hughes <gnu_andrew@member.fsf.org>
@@ -15999,6 +25333,48 @@
(setComponent): Fire PropertyChangeEvent,
(setTipText): Likewise.
+2006-03-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/util/Formatter.java:
+ Make the class final.
+
+2006-03-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/System.java:
+ (nanoTime()): Documented.
+ * java/lang/Thread.java:
+ (setUncaughtExceptionHandler(UncaughtExceptionHandler):
+ Added docs and security check.
+ (getUncaughtExceptionHandler()): Documented.
+ (setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler):
+ Added docs and security check.
+ (getDefaultUncaughtExceptionHandler()): Documented.
+ (getId()): Documented.
+ (Thread.State): Documented.
+ * vm/reference/gnu/classpath/Unsafe.java:
+ Documented.
+ (getUnsafe()): Updated to handle security.
+
+2006-03-20 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/System.java:
+ (nanoTime()): Implemented.
+ * java/lang/Thread.java:
+ (getId()): Implemented.
+ * java/util/AbstractMap.java:
+ (SimpleImmutableEntry): New 1.6 class.
+ (BasicMapEntry): Modified to be SimpleEntry.
+ * java/util/Collections.java:
+ Modified to use SimpleEntry.
+ * java/util/EnumMap.java: Likewise.
+ * java/util/HashMap.java: Likewise.
+ * java/util/Hashtable.java: Likewise.
+ * java/util/TreeMap.java: Likewise.
+ * vm/reference/gnu/classpath/Unsafe.java:
+ New class to handle low-level facilities for concurrency.
+ * vm/reference/java/lang/VMSystem.java:
+ (nanoTime()): Implemented.
+
2006-03-20 Tom Tromey <tromey@redhat.com>
* java/security/cert/PKIXCertPathChecker.java: Javadoc fix.
@@ -17641,6 +27017,13 @@
* javax/swing/tree/TreeNode.java: Fixed bad API doc tags,
* javax/swing/tree/TreePath.java: Likewise.
+2006-03-13 Tom Tromey <tromey@redhat.com>
+
+ * javax/swing/text/html/StyleSheet.java (removeAttributes):
+ Genericized.
+ * javax/swing/plaf/synth/SynthLookAndFeel.java (load): Genericized.
+ * java/rmi/server/RMIClassLoader.java (loadProxyClass): Genericized.
+
2006-03-13 Keith Seitz <keiths@redhat.com>
* gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java
@@ -18374,6 +27757,12 @@
* .classpath: added exclude pattern on source folders
(Makefiles, README and .cvsignore)
+2006-03-08 Michael Koch <konqueror@gmx.de>
+
+ * java/net/Proxy.java (NO_PROXY): Made final.
+ (equals): Likewise.
+ (hashCode): Likewise.
+
2006-03-08 Keith Seitz <keiths@redhat.com>
* vm/reference/gnu/classpath/jdwp/VMMethod.java: New file.
@@ -18422,21 +27811,17 @@
(InetSocketAddress(String,int)): Use new private constructor.
(createUnresolved): New method.
+2006-03-07 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/DefaultProxySelector.java,
+ java/net/Proxy.java, java/net/ProxySelector.java:
+ New files.
+
2006-03-07 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* java/rmi/server/UID.java (constructor): Assign last and time fields
after pause.
-2006-03-07 Tom Tromey <tromey@redhat.com>
-
- * java/lang/System.java (clearProperty): New method, merged from
- generics branch.
- (getProperty): Removed 'else'.
- (getProperty): Check for empty key.
- (setProperty): Likewise.
- * gnu/classpath/SystemProperties.java (remove): New method, merged
- from generics branch.
-
2006-03-07 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* java/rmi/server/UID.java: New file (replacing).
@@ -18511,57 +27896,62 @@
2006-03-07 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* gnu/java/rmi/server/UnicastRef.java,
- gnu/java/rmi/server/UnicastServer.java: Formatted.
-
+ * gnu/java/rmi/server/UnicastServer.java: Formatted.
+
2006-03-07 Audrius Meskauskas <AudriusA@Bioinformatics.org>
- * gnu/java/rmi/server/CombinedClassLoader.java (findClass,
- findLibrary, findResouce, findResources): check all loaders in
- array.
-
+ * gnu/java/rmi/server/CombinedClassLoader.java
+ (findClass, findLibrary, findResouce, findResources): check
+ all loaders in array.
+
2006-03-07 Audrius Meskauskas <AudriusA@Bioinformatics.org>
- PR 25526
- * gnu/java/rmi/dgc/DGCImpl.java (LeaseRecord, leaseCache): Removed.
- (RefProtector): new inner class. (dirty): Rewritten.
+ PR 25526
+ * gnu/java/rmi/dgc/DGCImpl.java (LeaseRecord, leaseCache): Removed.
+ (RefProtector): new inner class. (dirty): Rewritten.
* gnu/java/rmi/server/UnicastRef.java (dgcId, dgcInterfaceHash,
dgcSequence, DIRTY, this_id): New fields. (equals, hashCode, notifyDGC):
new methods. (readExternal): Create LeaseRenewingTask if non local.
- * gnu/java/rmi/server/UnicastServer.java (objects):
- Use WeakHashMap. (refcache): Use WeakIdentityHashMap.
+ * gnu/java/rmi/server/UnicastServer.java (objects):
+ Use WeakHashMap. (refcache): Use WeakIdentityHashMap.
(getExported): New method.
* gnu/java/rmi/dgc/LeaseRenewingTask.java: New file.
-
+
2006-03-06 Mark Wielaard <mark@klomp.org>
* doc/www.gnu.org/announce/20060306.wml: New file.
* doc/www.gnu.org/newsitems.txt: Add 0.90 release announcement.
* doc/www.gnu.org/downloads/downloads.wml: Add 0.90.
-
-2006-03-06 Mark Wielaard <mark@klomp.org>
-
- * NEWS: Fix typo.
-
+
2006-03-06 David Gilbert <david.gilbert@object-refinery.com>
* javax/swing/plaf/metal/MetalLookAndFeel.java
- (initComponentDefaults): Use Boolean.TRUE for
- 'CheckBoxMenuItem.borderPainted'.
+ (initComponentDefaults): Use Boolean.TRUE for
+ 'CheckBoxMenuItem.borderPainted'.
+
+2006-03-06 Wolfgang Baer <WBaer@gmx.de>
-2006-03-06 Lillian Angel <langel@redhat.com>
+ * gnu/java/net/protocol/http/Headers.java: Added documentation all over.
+ (dateFormat): Made private.
+ (put): Replace only the last occurance and the value.
+ (putAll): Reimplemented with the put method.
- PR classpath/26569
+2006-03-06 Lillian Angel <langel@redhat.com>
+
+ PR classpath/26569
* java/awt/List.java
- (preferredSize): Return the size of the list if the peer is null.
+ (preferredSize): Return the size of the list if the peer is
+ null.
* gnu/java/awt/peer/gtk/GtkListPeer.java
- (preferredSize): Code was returning the minimum size of the list.
- Added adjustment to the width of the list so it is a proper size.
-
+ (preferredSize): Code was returning the minimum size of the
+ list. Added adjustment to the width of the list so it is a
+ proper size.
+
2006-03-06 Wolfgang Baer <WBaer@gmx.de>
* gnu/java/net/protocol/http/HTTPURLConnection.java: Organized imports.
(getRequestProperty): Remove duplicated null check.
- * java/net/URLConnection.java:
+ * java/net/URLConnection.java:
(URLConnection): Javadoc fix.
(addRequestProperty): Likewise.
(getDefaultRequestProperty): Likewise.
@@ -18573,85 +27963,94 @@
(getRequestProperty): Likewise.
(setDefaultRequestProperty): Likewise.
(setRequestProperty): Likewise.
-
+
+2006-03-06 Robert Schuster <robertschuster@fsfe.org>
+
+ * examples/gnu/classpath/examples/swing/TextArea.java: New file.
+ * examples/gnu/classpath/examples/swing/Demo.java:
+ (mkButtonBar): Changed layout manager to GridLayout, added entry for
+ textarea example.
+ (mkMenuBar): Added entry for text area example.
+
2006-03-06 Tom Tromey <tromey@redhat.com>
* javax/swing/plaf/synth/Region.java (FILE_CHOOSER): Renamed.
(FORMATTED_TEXT_FIELD): Likewise.
-
+
2006-03-06 Tom Tromey <tromey@redhat.com>
* javax/swing/plaf/synth/SynthPainter.java: Finished.
-
-2006-03-06 Mark Wielaard <mark@klomp.org>
-
- Fixes bug #26568 reported by Paul Jenner <psj@harker.dyndns.org>
- * native/fdlibm/fdlibm.h (__ieee754_rem_pio2): Return an int32_t.
- (isnan): Define explicitly isnan if it is not a macro.
-
-2006-03-06 Anthony Balkissoon <abalkiss@redhat.com>
-
- * NEWS: Fixed typo.
-
+
2006-03-06 Robert Schuster <robertschuster@fsfe.org>
* examples/gnu/classpath/examples/swing/Demo.java:
(mkMenuBar): Added menu entry that will display the VM's name,
version and distributor.
-
+
2006-03-06 Tom Tromey <tromey@redhat.com>
-
+
* javax/swing/plaf/synth/SynthLookAndFeel.java (getDescription):
Javadoc fix.
(getName): Likewise.
+
+2006-03-06 Raif S. Naffah <raif@swiftdsl.com.au>
-2006-03-06 Mark Wielaard <mark@klomp.org>
-
- * configure.ac (VERSION): Set to 0.91-pre.
- * NEWS: Add updates for 0.90 release.
-
-2006-03-06 Robert Schuster <robertschuster@fsfe.org>
-
- * javax/swing/text/PlainDocument.java: Fix copyright header,
- added author tags.
- (insertUpdate): Do not copy the whole document any more, added some
- more variables to prevent needless method calls.
-
-2006-03-06 Christian Thalinger <twisti@complang.tuwien.ac.at>
-
- * configure.ac: Check for FREETYPE2. This is a reverted patch and
- is required on Darwin.
- * native/jni/gtk-peer/Makefile.am (AM_LDFLAGS): Added FREETYPE2.
- (AM_CFLAGS): Likewise.
-
+ * java/util/jar/Manifest.java: Removed unused imports.
+ (CRLF): New constant.
+ (read): Added method documentation.
+ Use UTF-8 encoding instead of 8859_1.
+ (write): Added method documentation.
+ Use BufferedOutputStream (w/ 4K buffer) instead of PrintWriter.
+ (write_main_section): Replace PrintWriter arg with OutputStream.
+ Replace JarException with IOException.
+ (write_version_info): Likewise.
+ (write_main_attributes): Likewise.
+ (write_attribute_entry): Likewise.
+ (write_individual_sections): Likewise.
+ (write_entry_attributes): Likewise.
+ (write_header): Replace PrintWriter arg with OutputStream.
+ Re-implemented.
+
2006-03-06 David Gilbert <david.gilbert@object-refinery.com>
+
* javax/swing/tree/FixedHeightLayoutCache.java: Reformatted and fixed
- API doc tag warnings,
+ API doc tag warnings,
* javax/swing/tree/VariableHeightLayoutCache.java: Likewise.
2006-03-06 Dalibor Topic <robilad@kaffe.org>
* gnu/java/net/protocol/file/Connection.java (unquote):
- Update position in buffer after decoding a unicode character
- outside of the basic plane.
+ Update position in buffer after decoding a unicode character
+ outside of the basic plane.
+
+2006-03-06 Dalibor Topic <robilad@kaffe.org>
+ * java/net/URI.java
+ (quote): Pass Unicode characters outside the basic plane through.
+
2006-03-06 Robert Schuster <robertschuster@fsfe.org>
-
+
* javax/swing/plaf/basic/BasicTextUI.java:
(damageRange): Rewritten if-expressions to correctly identify the
- break condition.
+ break condition.
-2006-03-06 Robert Schuster <robertschuster@fsfe.org>
+2006-03-06 Mark Wielaard <mark@klomp.org>
- * javax/swing/text/DefaultCaret.java:
- (mouseDragged): Do selection when shift is pressed.
- (mouseClicked): Implemented.
+ * configure.ac: Set version to 0.90-generics.
+ * NEWS: Fix typos.
-2006-03-06 Dalibor Topic <robilad@kaffe.org>
+2006-03-06 Mark Wielaard <mark@klomp.org>
- * libraries/javalib/external/classpath/java/net/URI.java (quote):
- Pass Unicode characters outside the basic plane through.
+ Fixes bug #26568 reported by Paul Jenner <psj@harker.dyndns.org>
+ * native/fdlibm/fdlibm.h (__ieee754_rem_pio2): Return an int32_t.
+ (isnan): Define explicitly isnan if it is not a macro.
+
+2006-03-06 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/text/GapContent.java:
+ (insertString): Throw exception when argument is below
+ zero.
2006-03-06 Robert Schuster <robertschuster@fsfe.org>
@@ -18660,6 +28059,30 @@
code to generate another Element when newly inserted characters
and old ones will be on the same line.
+2006-03-06 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/text/DefaultCaret.java:
+ (mouseDragged): Do selection when shift is pressed.
+ (mouseClicked): Implemented.
+
+2006-03-06 Robert Schuster <robertschuster@fsfe.org>
+
+ * javax/swing/text/PlainDocument.java: Fix copyright header,
+ added author tags.
+ (insertUpdate): Do not copy the whole document any more, added some
+ more variables to prevent needless method calls.
+
+2006-03-06 Christian Thalinger <twisti@complang.tuwien.ac.at>
+
+ * configure.ac: Check for FREETYPE2. This is a reverted patch and
+ is required on Darwin.
+ * native/jni/gtk-peer/Makefile.am (AM_LDFLAGS): Added FREETYPE2.
+ (AM_CFLAGS): Likewise.
+
+2006-03-06 Mark Wielaard <mark@klomp.org>
+
+ * NEWS: Add updates for 0.90 release.
+
2006-03-05 Robert Schuster <robertschuster@fsfe.org>
* javax/swing/text/GapContent.java:
@@ -18668,16 +28091,22 @@
2006-03-05 David Gilbert <david.gilbert@object-refinery.com>
- * javax/swing/plaf/metal/MetalComboBoxButton.java
- (MetalComboBoxButton(JComboBox, Icon, boolean, CellRendererPane,
- JList)): Fixed API doc tag,
- * javax/swing/plaf/metal/MetalInternalFrameTitlePane
- (createLayout): Fixed API doc warning.
+
+ * javax/swing/filechooser/FileFilter.java:
+ (accept): Fixed API doc tag,
+ (getDescription): Likewise,
+ * javax/swing/filechooser/FileView.java:
+ (isTraversable): Fixed API doc tag.
2006-03-05 David Gilbert <david.gilbert@object-refinery.com>
- * javax/swing/DefaultFocusManager.java: Fixed bad API doc tags,
- * javax/swing/FocusManager.java: Likewise.
+ * javax/swing/colorchooser/ColorSelectionModel.java: Reformatted and
+ added API docs all over.
+
+2006-03-05 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/plaf/ComboBoxUI.java: Fixed typo in class description,
+ and corrected a bad API doc tag.
2006-03-05 David Gilbert <david.gilbert@object-refinery.com>
@@ -18693,26 +28122,23 @@
2006-03-05 David Gilbert <david.gilbert@object-refinery.com>
- * javax/swing/plaf/ComboBoxUI.java: Fixed typo in class description,
- and corrected a bad API doc tag.
+ * javax/swing/DefaultFocusManager.java: Fixed bad API doc tags,
+ * javax/swing/FocusManager.java: Likewise.
-2006-03-05 David Gilbert <david.gilbert@object-refinery.com>
-
- * javax/swing/colorchooser/ColorSelectionModel.java: Reformatted and
- added API docs all over.
2006-03-05 David Gilbert <david.gilbert@object-refinery.com>
- * javax/swing/filechooser/FileFilter.java:
- (accept): Fixed API doc tag,
- (getDescription): Likewise,
- * javax/swing/filechooser/FileView.java:
- (isTraversable): Fixed API doc tag.
-
+
+ * javax/swing/plaf/metal/MetalComboBoxButton.java
+ (MetalComboBoxButton(JComboBox, Icon, boolean, CellRendererPane,
+ JList)): Fixed API doc tag,
+ * javax/swing/plaf/metal/MetalInternalFrameTitlePane
+ (createLayout): Fixed API doc warning.
+
2006-03-05 Tom Tromey <tromey@redhat.com>
* vm/reference/java/lang/reflect/Constructor.java (toString): Use
- ClassHelper.getUserName.
+ ClassHelper.getUserName.
* vm/reference/java/lang/reflect/Method.java (toString): Use
ClassHelper.getUserName.
(getUserTypeName): Removed.
@@ -18723,12 +28149,13 @@
2006-03-05 Olivier Jolly <olivier.jolly@pcedev.com>
Fixes PR 22813
- * java/net/URLClassLoader.java (FileURLLoader.getResource):
+ * java/net/URLClassLoader.java (FileURLLoader.getResource):
Allows directories as valid resources.
-2006-03-04 Mark Wielaard <mark@klomp.org>
+2006-03-05 Mark Wielaard <mark@klomp.org>
- * configure.ac (VERSION): Set to 0.90-pre.
+ * configure.ac (VERSION): Set to 0.90-pre-generics.
+ * Merge with CVS trunk from classpath-0_90-branch-point.
2006-03-04 Tom Tromey <tromey@redhat.com>
@@ -19830,8 +29257,69 @@
* java/util/logging/FileHandler.java: Fixed a javadoc reference.
-2006-02-25 Chris Burdess <dog@gnu.org>
+2006-03-03 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/MenuBar.java (shortcuts): Genericized.
+
+2006-03-03 Tom Tromey <tromey@redhat.com>
+
+ * java/beans/EventSetDescriptor.java (EventSetDescriptor):
+ Genericized.
+ (getListenerType): Likewise.
+ * java/beans/Introspector.java (getBeanInfo): Genericized.
+ * java/beans/DefaultPersistenceDelegate.java (initialize):
+ Genericized.
+
+2006-03-01 Anthony Balkissoon <abalkiss@redhat.com>
+
+ * java/math/BigDecimal.java:
+ (precision): Fixed overflow problem with large numbers.
+ (longValueExact): New method.
+ (intValueExact): Likewise.
+ (byteValueExact): Likewise.
+ (shortValueExact): Likewise.
+
+2006-03-01 Anthony Balkissoon <abalkiss@redhat.com>
+ * java/math/BigDecimal.java:
+ (remainder(BigDecimal)): New method.
+ (divideAndRemainder(BigDecimal)): Likewise.
+ (divideToIntegralValue(BigDecimal)): Likewise.
+ (floor): New implementation method.
+
+2006-02-28 Anthony Balkissoon <abalkiss@redhat.com>
+
+ * java/math/BigDecimal.java:
+ (divide(BigDecimal, int, RoundingMode)): New method.
+ (divide(BigDecimal, RoundingMode)): Likewise.
+ (divide(BigDecimal, int, int)): Removed incorrect throwing of exception
+ when the new scale is < 0.
+ (setScale(int, RoundingMode)): New method.
+ (ulp): Likewise.
+
+2006-02-27 Anthony Balkissoon <abalkiss@redhat.com>
+
+ * java/math/BigDecimal.java: Replaced occurences of BigInteger.valueOf
+ with BigInteger.ZERO, BigInteger.ONE, BigInteger.TEN where appropriate.
+ (add(BigDecimal, MathContext)): New method.
+ (subtract(BigDecimal, MathContext)): Likewise.
+ (precision): Fixed to correctly handle BigIntegers with more than 19
+ digits.
+ (pow(int, MathContext)): New method.
+
+2006-02-27 Anthony Balkissoon <abalkiss@redhat.com>
+
+ * java/math/BigDecimal.java: Added @throws clause to constructors.
+ (mathContext): Removed this unneeded field.
+ (BigDecimal(int, MathContext)): New constructor.
+ (BigDecimal(BigInteger, int, MathContext)): Likewise.
+ (multiply(BigDecimal, MathContext)): New method.
+ (negate(MathContext)): Likewise.
+ (plus(MathContext)): Likewise.
+ (numDigitsInLong): Fixed to properly handle negatives.
+
+2006-02-25 Chris Burdess <dog@gnu.org>
+
* gnu/java/net/CRLFInputStream.java,
gnu/java/net/LineInputStream.java: Streams that use mark
capabilities on the underlying stream do not expose mark
@@ -19855,6 +29343,26 @@
manipulating an array of icharacter positions which _match has
already visited.
+2006-02-24 Anthony Balkissoon <abalkiss@redhat.com>
+
+ * java/math/BigDecimal.java:
+ (BigDecimal(long, MathContext)): New constructor.
+ (BigDecimal(BigInteger, MathContext)): Likewise.
+ (BigDecimal(String, MathContext)): Likewise.
+ (BigDecimal(double, MathContext)): Likewise.
+ (round): Fixed a typo where the precision field was used instead of a
+ call to the precision method, and also store the new precision in the
+ returned BigDecimal.
+ (abs(MathContext)): New method.
+
+2006-02-24 Anthony Balkissoon <abalkiss@redhat.com>
+
+ * java/math/BigDecimal.java
+ (toBigInteger): Fixed problem where this method couldn't handle
+ negative values for scale.
+ (toBigIntegerExact): New method.
+ (stripTrailingZeros): Likewise.
+
2006-02-24 David Daney <ddaney@avtrex.com>
PR classpath/26082
@@ -19869,9 +29377,9 @@
(maxConnections) : Removed.
(GetHTTPPropertiesAction.run): Don't initialize maxConnections.
(getConnection): Moved pool management logic to HTTPConnection.Pool.
-
+
2006-02-24 Lillian Angel <langel@redhat.com>
-
+
* java/awt/Container.java:
Added new field. True if Container has been cleared and
heavyweights need to be repainted.
@@ -19879,28 +29387,28 @@
reset backCleared.
(update): Set backCleared to true after the background
of the container has been cleared.
-
+
2006-02-24 Lillian Angel <langel@redhat.com>
-
+
* java/awt/TextField.java
(addNotify): Added call to super.
-
+
2006-02-24 Lillian Angel <langel@redhat.com>
-
- * java/awt/Component.java
+
+ * java/awt/Component.java
(reshape): Reverted last patch. Should have check here.
(addNotify): Added check. If parent is lightweight, then
initialize listener on the parent.
(HeavyweightInLightweightListener): New class.
-
+
2006-02-24 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicComboPopup.java
(show): Register the popup with the autocloser after it has been
opened completely, by putting the registration on the eventqueue.
-
+
2006-02-24 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
+
* gnu/java/security/prng/BasePRNG.java:
(clone()): Added cast of buffer to byte[].
* gnu/javax/crypto/mac/TMMH16.java:
@@ -19909,9 +29417,9 @@
Added missing defines from old fdlibm.h needed by Darwin.
(GET_FLOAT_WORD(i,d)): Re-added.
(SET_FLOAT_WORD(d,i)): Re-added.
-
+
2006-02-24 Roman Kennke <kennke@aicas.com>
-
+
* java/awt/Container.java:
(dispatcher): Removed field.
(dispatchEventImpl): Removed lightweight dispatching.
@@ -19922,21 +29430,21 @@
* java/awt/Toolkit.java
(Toolkit): Install LightweightDispatcher in global listener
array.
-
+
2006-02-24 Chris Burdess <dog@gnu.org>
-
+
Fixes PR 26324
* gnu/java/net/CRLFInputStream.java: Fix incorrect end condition when
off > 0.
-
+
2006-02-24 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
+
* NEWS: Mentions the VMMath runtime changes.
* doc/vmintegration.texinfo: Updated to include
VMMath.
-
+
2006-02-24 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicLookAndFeel.java
(PopupHelper.autoClosePopups): New field.
(PopupHelper.mousePressed): Also autoclose any registered popups.
@@ -19946,15 +29454,15 @@
(registerForAutoClose): New method.
* javax/swing/plaf/basic/BasicComboPopup.java
(show): Register this popup for autoclosing.
-
+
2006-02-24 Raif S. Naffah <raif@swiftdsl.com.au>
-
+
* gnu/javax/crypto/mac/TMMH16.java (clone): New method.
* gnu/java/security/prng/MDGenerator.java (clone): New method.
* gnu/java/security/prng/BasePRNG.java (clone): Clone buffer.
-
+
2006-02-24 Roman Kennke <kennke@aicas.com>
-
+
Reported by Ingo Proetel <proetel@aicas.com>
* java/util/logging/LogManager.java
(addLogger): Search the parent loggers for log level
@@ -19962,14 +29470,30 @@
(readConfiguration): Provide minimal default configuration
if no configuration can be found otherwise.
-2006-02-23 Roman Kennke <kennke@aicas.com>
+2006-02-23 Anthony Balkissoon <abalkiss@redhat.com>
+
+ * java/math/BigDecimal.java:
+ (toString): Fixed a problem where the negative sign was being displayed
+ twice in the exponent.
+ (toEngineeringString): New method.
+ (toPlainString): Likewise.
+ (pow): Likewise.
+2006-02-23 Anthony Balkissoon <abalkiss@redhat.com>
+
+ * java/math/BigDecimal.java:
+ (toString): Rewrote this method to behave as specified. Added API
+ comments to explain behaviour.
+ (scaleByPowerOfTen): New method.
+
+2006-02-23 Roman Kennke <kennke@aicas.com>
+
* javax/swing/JRootPane.java
(isOptimizedDrawingEnabled): Implemented to return true
when the glassPane is not visible.
-
+
2006-02-23 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicLookAndFeel.java
(PopupHelper): New inner class.
(popupHelper): New field.
@@ -20028,9 +29552,9 @@
* java/awt/Graphics.java
(hitClip): Scott's proposed fix. Added check to handle a
null clip.
-
+
2006-02-23 Wolfgang Baer <WBaer@gmx.de>
-
+
* javax/print/attribute/standard/MediaSize.java:
(media): Field renamed to mediaName for serialization.
(MediaSize): Adapted to new fieldname.
@@ -20080,9 +29604,9 @@
(hashCode): Likewise.
(getHeight): Likewise.
(getWidth): Likewise.
-
+
2006-02-23 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
+
* include/java_lang_VMMath.h:
(Java_java_lang_VMMath_cbrt(JNIEnv*,jclass,jdouble)): Added.
(Java_java_lang_VMMath_cosh(JNIEnv*,jclass,jdouble)): Added.
@@ -20203,14 +29727,14 @@
(toString): Reimplemented.
(readObject): New method for serialization.
(writeObject): Likewise.
-
+
2006-02-23 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/RepaintManager.java
(commitBuffer): Clip the repaint area with the current clip.
-
+
2006-02-23 Raif S. Naffah <raif@swiftdsl.com.au>
-
+
* gnu/javax/crypto/key/dh/GnuDHKeyPairGenerator.java
(DEFAULT_PRIME_SIZE): Made public.
(DEFAULT_EXPONENT_SIZE): Likewise.
@@ -20272,6 +29796,15 @@
(engineGeneratePublic): Likewise.
* gnu/javax/crypto/DiffieHellmanImpl: Removed.
+2006-02-22 Anthony Balkissoon <abalkiss@redhat.com>
+
+ * java/math/BigDecimal.java:
+ (BigDecimal(char[], int, int, MathContext)): New constructor.
+ (BigDecimal(char[], MathContext)): Likewise.
+ (BigDecimal(char[])): Likewise.
+ (BigDecimal(char[], int, int)): Likewise.
+ (BigDecimal(String)): Fixed handling of exponent and scale.
+
2006-02-22 Mark Wielaard <mark@klomp.org>
* java/awt/Checkbox.java (setState): Check that state actually changed
@@ -20286,14 +29819,14 @@
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
(postItemEventID): Method now takes boolean.
(item_toggled_cb): Likewise.
-
+
2006-02-22 Robert Schuster <robertschuster@fsfe.org>
-
+
* javax/swing/text/DefaultHighlighter.java:
(changeHighlight): Added code to minimize the damaged area.
-
+
2006-02-22 Robert Schuster <robertschuster@fsfe.org>
-
+
* javax/swing/text/PlainView.java:
(getPreferredSpan): Added missing 'break'.
statement which corrects an unwanted fall through.
@@ -20301,44 +29834,65 @@
removed, call preferenceChanged accordingly.
(viewToModel): Restrict line number to be within 0 and the
number of elements-1.
-
+
2006-02-22 Robert Schuster <robertschuster@fsfe.org>
-
+
* javax/swing/text/Utilities.java:
(getPositionAbove): Prefer first value by changing comparison
from < to <=.
(getPositionBelow): Dito.
-
+
2006-02-22 Robert Schuster <robertschuster@fsfe.org>
-
+
* javax/swing/text/DefaultEditorKit.java: Added checks and fallback
behavior when magic caret position is null.
-
+
2006-02-22 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JTextField.java
(isValidateRoot): New method.
-
+
2006-02-22 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JEditorPane.java
(getPreferredSize): Rewritten to behave like the reference impl.
(getScrollableTracksViewportWidth): Likewise.
(getScrollableTracksViewportHeight): Likewise.
-
+
2006-02-22 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/RepaintManager.java
(addInvalidComponent): Also consider the component itself.
-
+
2006-02-22 Mark Wielaard <mark@klomp.org>
-
+
* javax/swing/text/html/HTMLDocument.java (createDefaultRoot): Fully
qualify AbstractDocument.AttributeContext.
(blockOpen): Likewise.
+
+2006-02-21 Anthony Balkissoon <abalkiss@redhat.com>
-2006-02-21 Mark Wielaard <mark@klomp.org>
+ * java/math/BigDecimal.java:
+ (mathContext): New field.
+ (precision): Likewise.
+ (BigDecimal(int)): New constructor.
+ (BigDecimal(long)): Likewise.
+ (BigDecimal(BigInteger)): Added API docs.
+ (BigDecimal(BigInteger, int)): Removed incorrect NumberFormatException
+ and added API docs.
+ (plus): New method.
+ (round): Likewise.
+ (precision): Likewise.
+ (valueOf): Likewise.
+ (numDigitsInLong): New implementation method.
+
+2006-02-21 Anthony Balkissoon <abalkiss@redhat.com>
+
+ * java/math/MathContext.java: New class.
+ * java/math/RoundingMode: New Enum.
+2006-02-21 Mark Wielaard <mark@klomp.org>
+
* java/awt/Component.java (translateEvent): Translate
AdjustmentEvents to 1.0 Events.
* java/awt/Scrollbar.java (dispatchEventImpl): Set valueIsAdjusting.
@@ -20352,25 +29906,25 @@
(Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_setValues): Renamed to
Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_setBarValue
* include/gnu_java_awt_peer_gtk_GtkScrollbarPeer.h: Regenerated.
-
+
2006-02-21 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/View.java
(setParent): Set child parent to null when disconnecting
the view from the View hierarchy.
-
+
2006-02-21 Wolfgang Baer <WBaer@gmx.de>
-
+
* javax/print/StreamPrintService.java: Added and enhanced documentation.
-
+
2006-02-21 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/WrappedPlainView.java
(calculateBreakPosition): Changed to use the view's allocation instead
of the container's preferredSize.
-
+
2006-02-21 Wolfgang Baer <WBaer@gmx.de>
-
+
* java/awt/CardLayout.java:
(first): Updated api documentation.
(last): Likewise.
@@ -20380,21 +29934,21 @@
IllegalArgumentException if layout of container is not this.
(gotoComponent): Updated api documentation. Throw
IllegalArgumentException if layout of container is not this.
-
+
2006-02-21 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/NavigationFilter.java
(getNextVisualPositionFrom): New method.
-
+
2006-02-21 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicTextUI.java
(RootView.setView): Call setParent() on the view with this as
argument instead of null.
(setView): Don't set root view's parent here.
-
+
2006-02-21 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/AbstractDocument.java
(AbstractElement.getAttribute): Use getResolveParent() to fetch
the resolving parent.
@@ -20466,9 +30020,9 @@
* javax/swing/text/html/InlineView.java
(setPropertiesFromAttributes): Call super.
* javax/swing/text/html/NullView.java: New class.
-
+
2006-02-21 Roman Kennke <kennke@aicas.com>
-
+
PR classpath/26368
* javax/swing/text/GapContent.java
(GapContentPosition): Made class private.
@@ -20486,9 +30040,9 @@
positions.
(dumpPositions): Handle WeakReference positions.
(clearPositionReferences): New method.
-
+
2006-02-21 Robert Schuster <robertschuster@fsfe.org>
-
+
* javax/swing/plaf/basic/BasicTextUI.java:
(paint): Remove unneccessary part of the if-expression.
(damageRange): Added case where the range spans multiple lines.
@@ -20518,71 +30072,71 @@
(ENDSIG): Likewise.
* java/util/zip/ZipOutputStream.java
(writeLeInt(long)): New method.
-
+
2006-02-21 Michael Koch <konqueror@gmx.de>
-
+
* gnu/javax/net/ssl/provider/PRNG.java: Removed.
-
+
2006-02-20 Mark Wielaard <mark@klomp.org>
-
+
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
(begin_drawing_operation): Output stacktrace and return on bad cairo
status.
(end_drawing_operation): Likewise. And reset cairo_t.
-
+
2006-02-20 Robert Schuster <robertschuster@fsfe.org>
-
+
* javax/swing/text/DefaultEditorKit.java: Fixed comparison
in backward selection action.
-
+
2006-02-20 Olivier Jolly <olivier.jolly@pcedev.com>
-
+
* java/lang/reflect/Proxy.java:
(ProxyData.getProxyData): Skipped overriding of core methods.
(ProxyData.isCoreObjectMethod): New method.
-
+
2006-02-20 Mark Wielaard <mark@klomp.org>
-
+
* gnu/java/nio/charset/Provider.java (Provider): Package private.
-
+
2006-02-20 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/html/Option.java: New class.
-
+
2006-02-20 Lillian Angel <langel@redhat.com>
-
+
* java/swt/Window.java
(show): Calling show() on the owned windows caused problems.
Changed back to get the peer and call setVisible.
-
+
2006-02-20 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicTextUI.java
(damageRange): Implemented this method.
-
+
2006-02-20 Robert Schuster <robertschuster@fsfe.org>
-
+
* javax/swing/text/GapContent.java:
(shiftGapEndUp): Corrected new mark value.
* javax/swing/text/AbstractDocument.java:
(remove): Changed order of operations.
-
+
2006-02-20 Robert Schuster <robertschuster@fsfe.org>
-
+
* javax/swing/text/GapContent.java:
(shiftGapEndUp): Reverted.
* javax/swing/text/AbstractDocument.java:
(remove): Reverted.
-
+
2006-02-20 Robert Schuster <robertschuster@fsfe.org>
-
+
* javax/swing/text/GapContent.java:
(shiftGapEndUp): Corrected new mark value.
* javax/swing/text/AbstractDocument.java:
(remove): Changed order of operations.
-
+
2006-02-20 Mark Wielaard <mark@klomp.org>
-
+
* java/awt/Menu.java (add(MenuItem)): Use item.getParent() to get
parent field.
(insert): Likewise.
@@ -20626,9 +30180,9 @@
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
(Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_nativeSetHelpMenu):
Removed.
-
+
2006-02-20 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* gnu/java/rmi/server/RMIObjectInputStream.java (resolveProxyClass):
Expect that proxy interfaces may have different class loaders.
* gnu/java/rmi/server/UnicastServerRef.java: Rewritten.
@@ -20644,16 +30198,16 @@
* gnu/java/awt/peer/gtk/GtkContainerPeer.java (endValidate): Set
Parent and Bounds of our children if either or parent is showing, or
we are a Window and are showing ourselves now.
-
+
2006-02-19 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* gnu/classpath/tools/rmi/rmic/RmicCompiler.java (convertStubName):
New method.
* gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav:
Another stub name fix.
-
+
2006-02-19 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java (compile):
Call convertStubName. (convertStubName): New method.
* gnu/classpath/tools/rmi/RMIC.java (main): Stub name fix.
@@ -20780,9 +30334,9 @@
* java/awt/datatransfer/DataFlavor.java (tryToLoadClass): Rewritten.
(getRepresentationClassFromMime): Add exception cause to
IllegalArgumentException.
-
+
2006-02-17 Lillian Angel <langel@redhat.com>
-
+
* gnu/java/awt/peer/gtk/GtkComponentPeer.java:
Removed unneeded import.
* gnu/java/awt/peer/gtk/GtkFramePeer.java:
@@ -20791,9 +30345,9 @@
Fixed comment, this is not yet handled in the JDK 1.5.
* java/awt/Container.java:
Removed unneeded import.
-
+
2006-02-17 Lillian Angel <langel@redhat.com>
-
+
* gnu/java/awt/peer/gtk/GtkComponentPeer.java
(setBounds): Removed check. Coordinates should always be changed
to incorporate the parent's coordinates.
@@ -20832,17 +30386,17 @@
attribute values. Fixed number of characters read following a
reset when detecting end of character data with characters after a
Unicode surrogate pair.
-
+
2006-02-17 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/html/HTMLEditorKit.java
(HTMLFactory.create): Create InlineView for content tags.
* javax/swing/text/html/HTMLDocument.java
(HTMLReader.flush): Call create() on first flush and insert
on subsequent flushes.
-
+
2006-02-17 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/AbstractDocument.java
(BranchElement.getStartOffset): Implemented workaround for wrong
NPE.
@@ -20857,9 +30411,9 @@
(createDefaultRoot): Use createBranchElement() and createLeafElement
instead of the constructors.
(create): Rewritten.
-
+
2006-02-17 Keith Seitz <keiths@redhat.com>
-
+
* gnu/classpath/jdwp/id/JdwpId.java (size): Remove.
(SIZE): New constant.
* gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java
@@ -20876,9 +30430,9 @@
Use model index for data model and column index for column model.
(getColumnClass): Convert to model index before requesting class
from model.
-
+
2006-02-17 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/html/HTMLDocument.java
(createDefaultRoot): Implemented.
(createLeafElement): Implemented.
@@ -20889,15 +30443,15 @@
(HTMLReader.ParagraphAction.end): Call blockClose at the very least.
(HTMLReader.blockOpen): Add name attribute with the current tag.
(HTMLReader.addContent): Add name attribute with HTML.Tag.CONTENT.
-
+
2006-02-17 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* javax/swing/plaf/basic/BasicTableHeaderUI.java (MouseInputHandler):
Rewritten.
* javax/swing/table/JTableHeader.java: Documenting related methods.
-
+
2006-02-17 Jeroen Frijters <jeroen@frijters.net>
-
+
Fixes PR 25752
* gnu/java/net/protocol/ftp/FTPURLConnection.java
(connect): Changed to use SystemProperties.
@@ -20905,34 +30459,34 @@
url is a directory, if not use retrieve.
(getOutputStream): Don't worry about directories, simply always
try to do a store.
-
+
2006-02-17 Jeroen Frijters <jeroen@frijters.net>
-
+
* gnu/java/net/protocol/ftp/ActiveModeDTP.java
(ActiveModeDTP): Mark accept thread as daemon.
-
+
2006-02-17 Michael Koch <konqueror@gmx.de>
-
+
* tools/.cvsignore: Ignore tools.zip.
-
+
2006-02-16 Keith Seitz <keiths@redhat.com>
-
+
* vm/reference/gnu/classpath/jdwp/VMIdManager.java (newReferenceTypeId):
Set the ID's reference.
(<clinit>): Remove comments for field, method, and frame ID types,
which will not be handled by VMIdManager.
-
+
2006-02-17 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* javax/swing/JTable.java (getCellEditor, getCellRenderer):
Use model index, not the column number.
* javax/swing/plaf/basic/BasicTableHeaderUI.java (MouseInputHandler):
Rewritten. (draggingHeaderRect): New field. (paint): Animate column
movement by painting draggingHeaderRect.
* NEWS: Added entry about JTable columns.
-
+
2006-02-16 Keith Seitz <keiths@redhat.com>
-
+
* gnu/classpath/jdwp/id/JdwpId.java (size): Make static. Return
default size of eight bytes.
* gnu/classpath/jdwp/id/ObjectId.java (size): Remove.
@@ -20943,25 +30497,25 @@
method.
2006-02-16 David Daney <ddaney@avtrex.com>
-
+
PR classpath/26312
* gnu/java/net/protocol/http/ChunkedInputStream.java (read): Mask
return value with 0xff.
-
+
2006-02-16 Keith Seitz <keiths@redhat.com>
-
+
* gnu/classpath/jdwp/event/EventRequest.java (getFilters): New method.
(matches): Use Iterator instead of ListIterator.
-
+
2006-02-16 Keith Seitz <keiths@redhat.com>
-
+
* gnu/classpath/jdwp/Jdwp.java (_doInitialization): Name the packet
processor thread for easier debugging.
(_enforceSuspendPolicy): Suspend the current thread, not the JDWP
main thread.
-
+
2006-02-16 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* javax/swing/JTable.java
(TableColumnPropertyChangeHandler.propertyChange): Return without
action if table header resizing column in not null. (doLayout):
@@ -20969,13 +30523,13 @@
* javax/swing/plaf/basic/BasicTableHeaderUI.java
(MouseInputHandler.mouseExited, MouseInputHandler.mouseReleased):
Rewritten. (MouseInputHandler.endResizing): New method.
-
+
2006-02-16 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/html/InlineView.java: New file.
-
+
2006-02-16 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JTabbedPane.java
(AccessibleJTable.getAccessibleChild): Implemented to return
the Page instance for the specified index.
@@ -20988,19 +30542,19 @@
(Page.getAccessibleChildrenCount): New method.
(Page.getAccessibleChild): New methdod.
(Page.getLocale): New method.
-
+
2006-02-16 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicTabbedPaneUI.java
(TabbedPaneLayout.calculateTabRects): Expand tabRuns array when
tabCount gets greater than tabRuns.length.
(TabbedPaneScrollLayout.calculateTabRects): Expand tabRuns array
when tabCount gets greater than tabRuns.length.
(paintTabArea): Don't set tabCount == runCount.
-
+
2006-02-16 Roman Kennke <kennke@aicas.com>
-
- * javax/swing/plaf/basic/BasicTextUI.java
+
+ * javax/swing/plaf/basic/BasicTextUI.java
(installUI): Moved installation of PropertyChangeListener
to installListeners(). Call modelChanged() after everything is
is installed.
@@ -21016,19 +30570,19 @@
on exit.
javax/swing/plaf/basic/BasicTableHeaderUI.java
(MouseInputHandler.mouseDragged): Do not repaint the header.
-
+
2006-02-16 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JViewport.java
(static_initializer): Set default scrollMode to backingstore.
-
+
2006-02-16 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* javax/swing/JTable.java (moveToCellBeingEdited): Clone the value,
returned by getCellRect. To not translate the component.
-
+
2006-02-16 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JComponent.java
(rectCache): Made field non-static to avoid nasty interferences.
(computeVisibleRect): Avoid creation of new Rectangles and double
@@ -21036,13 +30590,13 @@
of Rectangle2D.intersect().
(repaint): Interect the dirty region with the visible rectangle
of this component to avoid unnecessary painting.
-
+
2006-02-16 Gary Benson <gbenson@redhat.com>
-
+
* java/lang/Thread.java (stop): Add a missing access check.
-
+
2006-02-16 Robert Schuster <robertschuster@fsfe.org>
-
+
* javax/swing/text/JTextComponent.java:
(replaceSelection): Added code to update the magic caret position.
* javax/swing/text/DefaultEditorKit.java: Added code to update
@@ -21136,29 +30690,29 @@
* javax/swing/JTable.java,
javax/swing/plaf/basic/BasicTableHeaderUI.java,
javax/swing/table/DefaultTableModel.java: Documented.
-
+
2006-02-15 Lillian Angel <langel@redhat.com>
-
+
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:
Removed duplicate methods.
-
+
2006-02-15 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* javax/swing/JTable.java (distributeSpillResizing): New method.
(doLayout): Use distributeSpillResizing when resizing.
* javax/swing/plaf/basic/BasicTableHeaderUI.java (MouseInputHandler):
Rewritten. (installListeners): Add mouse motion listener.
(uninstallListeners): Remove mouse motion listener.
-
+
2006-02-15 Lillian Angel <langel@redhat.com>
-
+
* gnu/java/awt/peer/gtk/GtkDialogPeer.java
(setVisible): Removed method.
* gnu/java/awt/peer/gtk/GtkWindowPeer.java
(setLocation): New method.
(setLocationUnlocked): New method.
(show): Changed to use setLocation instead of setBounds.
- * java/awt/Component.java
+ * java/awt/Component.java
(show): Should call peer.show(), not peer.setVisible(), so the
location of the component is correctly set.
(preferredSize): Added curly braces so else statements are
@@ -21173,46 +30727,46 @@
GtkWindowPeer_nativeSetLocation and
Java_gnu_java_awt_peer_gtk_GtkWindowPeer
_nativeSetLocationUnlocked.
-
+
2006-02-15 Mark Wielaard <mark@klomp.org>
-
+
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
(Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create):
Downcast gtk_plug_new result when used.
-
+
2006-02-15 Olivier Jolly <olivier.jolly@pcedev.com>
-
+
* java/io/ObjectOutputStream.java (writeClassDescriptor):
Call assignNewHandle() after writing Proxy class.
-
+
2006-02-15 Olivier jolly <olivier.jolly@pcedev.com>
-
+
Fixes bug #14144
* java/io/ObjectInputStream.java (readClassDescriptor):
Class doesn't have to be abstract for first_nonserial.
-
+
2006-02-15 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JInternalFrame.java
(setClosed): Call dispose to actually make the frame invisible
and unselected.
-
+
2006-02-15 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JInternalFrame.java
(dispose): Call setVisible(false) instead of hide.
(doDefaultCloseOperation): Likewise.
-
+
2006-02-15 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JComponent.java
(paintChildren): Also check for the visibility of a child component
to avoid artifacts.
(repaint): Simply add this component to the RepaintManager rather than
trying to do useless optimization here.
-
+
2006-02-15 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/JSpinner.java
(DefaultEditor.DefaultEditor(JSpinner)): Add self to text field as a
PropertyChangeListener,
@@ -21318,15 +30872,15 @@
* javax/swing/SpinnerNumberModel.java
(getNextValue): Check for null maximum,
(getPreviousValue): Check for null minimum.
-
+
2006-02-15 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicTableUI.java
(paint): Paint vertical and horizontal lines one pixel shifted
left/top.
-
+
2006-02-15 Jeroen Frijters <jeroen@frijters.net>
-
+
* java/util/zip/ZipFile.java
(checkZipFile): Inlined readLeInt and rewritten for robustness.
(readLeShort(DataInput,byte[]), readLeInt(DataInput,byte[],
@@ -21344,9 +30898,9 @@
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(window_get_frame_extents): Return early of the window has no
decorations.
-
+
2006-02-15 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* examples/gnu/classpath/examples/swing/TableDemo.java
(TModel, createContent): Explain which value appears in the header.
* javax/swing/JTable.java (setColumnModel): Only set the
@@ -21388,27 +30942,27 @@
* javax/swing/ToolTipManager.java: Removed unneeded imports.
* javax/swing/Timer.java: Some small reindention.
(task): Made package private to avoid synthetic accessor method.
-
+
2006-02-14 Roman Kennke <kennke@aicas.com>
-
- * javax/swing/SwingUtilities.java
+
+ * javax/swing/SwingUtilities.java
(layoutCompoundLabel): Dont set textIconGap to 0 when there is
no icon.
-
+
2006-02-14 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* examples/gnu/classpath/examples/swing/TableDemo.java:
Making the columns variable width.
* javax/swing/JTable.java (distributeSpill, doLayout):
Call getPreferredSize and not getSize().
-
+
2006-02-14 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/DefaultCellEditor.java
(DefaultCellEditor): API doc fixlet.
-
+
2006-02-14 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JViewport.java
(isPaintRoot): New field.
(repaint): Only call super here. Also added a comment regarding
@@ -21416,27 +30970,27 @@
(paintBlit): Implemented real blitting.
(paintImmediately2): New method. Overrides the same package private
method in JComponent.
-
+
2006-02-14 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicTableUI.java
(paint): Check for boundary cases when determining the painting
area.
-
+
2006-02-14 Mark Wielaard <mark@klomp.org>
-
+
* java/awt/Menu.java (add): Always set parent of item to this. Call
addNotify() on item when we have a MenuPeer already.
(insert): Always adjust parent for item. Call addNotify() on item if
we already have a peer.
(remove(int)): Always clear item parent. Call removeNotify() on item
if we had a peer.
-
+
2006-02-14 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* javax/swing/JTable.java (rowAtPoint): Return -1 if the computed
row == getRowCount().
-
+
2006-02-14 Lillian Angel <langel@redhat.com>
* gnu/java/awt/peer/gtk/GtkDialogPeer.java
@@ -21472,45 +31026,45 @@
tools/gnu/classpath/tools/giop/nameservice/PersistentContextMap.java,
tools/gnu/classpath/tools/giop/nameservice/PersistentMap.java:
New files.
-
+
2006-02-14 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/JComponent.java
(getListeners): Check for PropertyChangeListener.class and delegate to
getPropertyChangeListeners() for that case.
-
+
2006-02-13 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicTableUI.java
(paint): Determine the cells that need painting based on the
current clip. Use getCellRect() for calculating the cell
bounds.
-
+
2006-02-13 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JTable.java
(rectCache): New field.
(getCellRect): Returns cached Rectangle instance.
-
+
2006-02-13 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JLayeredPane.java
(removeAll): New method. Avoid potential memory leak.
(isOptimizedDrawingEnabled): Replaced heuristic with accurate
calculation.
-
+
2006-02-14 Stuart Ballard <stuart.a.ballard@gmail.com>
-
+
* javax/swing/undo/StateEdit.java (RCSID): Match Sun's value.
* javax/swing/undo/StateEditable.java (RCSID): Likewise.
-
+
2006-02-13 Tom Tromey <tromey@redhat.com>
-
+
* vm/reference/java/lang/reflect/Method.java: Javadoc fix.
* vm/reference/java/lang/reflect/Constructor.java: Javadoc fix.
-
+
2006-02-13 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/RepaintManager.java
(offscreenBuffers): New field.
(doubleBuffer): Removed field.
@@ -21528,18 +31082,18 @@
(paintImmediately2): Don't paint on screen here.
(paintDoubleBuffered): Rewritten for real double buffering.
(paintSimple): Draw to screen in this method.
-
+
2006-02-13 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JRootPane.java
(JRootPane): Set opaque property to true.
-
+
2006-02-13 Tom Tromey <tromey@redhat.com>
-
+
* .classpath: Updated for external/relaxngDatatype.
-
+
2006-02-13 Chris Burdess <dog@gnu.org>
-
+
* gnu/xml/stream/UnicodeReader.java,
gnu/xml/validation/datatype/Annotation.java,
gnu/xml/validation/datatype/AnySimpleType.java,
@@ -21636,9 +31190,9 @@
lib/Makefile.am,
lib/gen-classlist.sh.in: Added external RELAX NG pluggable
datatypes library API.
-
+
2006-02-13 Mark Wielaard <mark@klomp.org>
-
+
* gnu/java/awt/peer/gtk/GtkGenericPeer.java (awtWidget): Made field
final.
(gtkWidgetModifyFont(Font)): New protected helper method.
@@ -21669,51 +31223,51 @@
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
(Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkWidgetModifyFont):
Removed.
-
+
2006-02-13 Mark Wielaard <mark@klomp.org>
-
+
* java/lang/Math.java (static): Explicitly call
System.loadLibrary("javalang").
-
+
2006-02-13 Wolfgang Baer <WBaer@gmx.de>
-
+
* javax/print/StreamPrintServiceFactory.java: New file.
-
+
2006-02-13 Tom Tromey <tromey@redhat.com>
-
+
* tools/.cvsignore: Added Makefile.
-
+
2006-02-13 Wolfgang Baer <WBaer@gmx.de>
-
+
* java/awt/print/PrinterGraphics.java: Reformatted.
* java/awt/print/Paper.java: Likewise.
* java/awt/print/PageFormat.java: Likewise.
* java/awt/print/Pageable.java: Likewise.
-
+
2006-02-13 Lillian Angel <langel@redhat.com>
-
+
* java/awt/BorderLayout.java
(layoutContainer): Rewrote part of this function to
properly set the bounds of the components.
(setBounds): Removed method, not needed.
-
+
2006-02-13 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(ElementBuffer.clone): Fixed replace call.
(clone): Removed method.
-
+
2006-02-13 Roman Kennke <kennke@aicas.com>
-
+
* java/rmi/server/UnicastRemoteObject.java: Reformatted.
-
+
2006-02-13 Roman Kennke <kennke@aicas.com>
-
+
* java/rmi/server/UnicastRemoteObject.java
(exportObject(Remote)): Forward method call to export(Remote,int).
-
+
2006-02-13 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
+
* include/Makefile.am:
Swapped Math.h for VMMath.h
* include/java_lang_Math.h:
@@ -21761,14 +31315,14 @@
(rint(double)): New native method.
2006-02-13 Lillian Angel <langel@redhat.com>
-
+
* java/awt/Component.java
(repaint): No need to call isShowing, it is done in the other repaint call.
(repaint): Likewise.
(repaint): Likewise.
-
+
2006-02-13 Lillian Angel <langel@redhat.com>
-
+
* java/awt/Component.java
(repaint): Reverted last change.
(repaint): Likewise.
@@ -21785,21 +31339,21 @@
(repaint): No need to call isShowing, it is done in the other repaint call.
(repaint): Likewise.
(repaint): Likewise.
-
+
2006-02-13 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/AbstractDocument.java
(setParent): Added API docs. Call setParent(null) on children before
disconnecting this view from the View hierarchy.
-
+
2006-02-13 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/AbstractDocument.java
(readUnlock): Don't attempt to unlock when the current threads also
holds a write lock.
-
+
2006-02-13 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/plaf/metal/MetalBorders.java
(ButtonBorder.getBorderInsets(Component)): Return insets directly,
(ButtonBorder.getBorderInsets(Component, Insets)): Don't check for null
@@ -21841,34 +31395,34 @@
stands for only one character.
(match): Added the processing of the Vector addition.
(matchN), (matchP): Do not check next token if addition is used.
-
+
2006-02-12 Olivier Jolly <olivier.jolly@pcedev.com>
-
+
* AUTHORS: add self.
-
+
2006-02-12 Tom Tromey <tromey@redhat.com>
-
+
* gnu/classpath/ServiceProviderLoadingAction.java: Javadoc fix.
* gnu/classpath/ServiceFactory.java (ServiceIterator): Javadoc fix.
(securityContext): Likewise.
(log): Likewise.
-
+
2006-02-12 Dalibor Topic <robilad@kaffe.org>
-
+
Fixes PR 26218.
-
+
* gnu/java/net/protocol/file/Connection.java (unquote):
Convert Unicode characters outside basic plane to UTF-8,
rather than throwing an exception.
-
+
2006-02-12 Tom Tromey <tromey@redhat.com>
-
+
* javax/sound/sampled/LineEvent.java (readObject): New method.
(writeObject): Likewise.
(serialVersionUID): New field.
-
+
2006-02-12 Mark Wielaard <mark@klomp.org>
-
+
* java/beans/PropertyChangeSupport.java (addPropertyChangeListener):
Silently ignores null listener.
(addPropertyChangeListener(String, PropertyChangeListener): Likewise.
@@ -21907,9 +31461,9 @@
* java/io/InputStream.java
(read(byte[],int,int)): Changed argument validation to prevent
integer overflow. Remove redundant check.
-
+
2006-02-12 Jeroen Frijters <jeroen@frijters.net>
-
+
Fixes PR 26220
* java/io/InputStreamReader.java
(InputStreamReader(InputStream)): Use SystemProperties.
@@ -21986,9 +31540,9 @@
tools/gnu/classpath/tools/giop/grmic/templates/TieMethodVoid.jav:
Rewritten.
* tools/gnu/classpath/tools/giop/grmic/HashFinder.java: New file.
-
+
2006-02-11 Raif S. Naffah <raif@swiftdsl.com.au>
-
+
* gnu/java/security/jce/sig/EncodedKeyFactory.java
(engineGeneratePublic): Added support for raw key-specifications.
(engineGeneratePrivate): Likewise.
@@ -22012,19 +31566,19 @@
(encodePublicKey): Likewise.
(encodePrivateKey): Likewise.
(decodePublicKey): Likewise.
-
+
2006-02-10 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/StyleContext.java
(registerStaticAttributeKey): New static method.
-
+
2006-02-10 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(ElementBuffer.clone): New method.
-
+
2006-02-10 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/ParagraphView.java
(findOffsetToCharactersInString): New method.
(getClosestPositionTo): New method.
@@ -22033,16 +31587,16 @@
(adjustRow): New method.
(breakView): New method.
(getBreakWeight): New method.
-
+
2006-02-10 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/GapContent.java
(updateUndoPositions): New method.
* javax/swing/text/StringContent.java
(updateUndoPositions): New method.
-
+
2006-02-10 Raif S. Naffah <raif@swiftdsl.com.au>
-
+
* gnu/java/security/key/rsa/GnuRSAPrivateKey.java (GnuRSAPrivateKey(9)):
Made it public.
* gnu/java/security/jce/sig/RSAKeyFactory.java: New file.
@@ -22051,16 +31605,16 @@
(engineGeneratePrivate): Likewise.
(engineGetKeySpec): Likewise.
(engineTranslateKey): Corrected order of MPIs and use ctors with 5 args.
-
+
2006-02-10 Robert Schuster <robertschuster@fsfe.org>
-
+
* javax/swing/text/Utilities.java:
(getTabbedTextOffset): Fixed usage of variable p0.
(getPositionAbove): Rewritten.
(getPositionBelow): Rewritten.
-
+
2006-02-09 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/BoxView.java
(getAxis): Added @since tag.
(setAxis): Added @since tag.
@@ -22087,28 +31641,28 @@
(modelToView): Don't throw BadLocationException. This should
really only be thrown if the position is outside the document
model, not if it's outside the view's boundary.
-
+
2006-02-09 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* tools/Makefile.am: Handle rmi and giop folders separately.
-
+
2006-02-09 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/SpinnerDateModel.java: Updated API docs all over,
* javax/swing/SpinnerNumberModel.java: Likewise.
-
+
2006-02-09 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/SpinnerDateModel.java: Removed tabs,
* javax/swing/SpinnerNumberModel.java: Likewise.
-
+
2006-02-09 Anthony Balkissoon <abalkiss@redhat.com>
-
+
* doc/unicode/SpecialCasing-4.0.0.txt: New file.
* doc/unicode/UnicodeData-4.0.0.txt: New file.
-
+
2006-02-09 Wolfgang Baer <WBaer@gmx.de>
-
+
Fixes bug #26081
* gnu/java/net/protocol/http/HTTPURLConnection.java:
(isRedirect): Removed, moved to Response.java.
@@ -22117,9 +31671,9 @@
codes 404 and 410 throw a FileNotFoundException.
* gnu/java/net/protocol/http/Response.java (isError): New method.
(isRedirect): New method, moved from HTTPURLConnection.java.
-
+
2006-02-09 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* tools/Makefile.am: Add tools/gnu/classpath/tools/rmi folder.
* tools/gnu/classpath/tools/giop/GRMIC.txt: Explain it called from RMIC.
* tools/gnu/classpath/tools/giop/grmic/Generator.java (getResource):
@@ -22139,23 +31693,23 @@
tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12MethodVoid.jav:
New files.
* NEWS: Corrected entry about the tools.
-
+
2006-02-09 Lillian Angel <langel@redhat.com>
-
+
* gnu/java/awt/peer/gtk/GtkComponentPeer.java
(handleEvent): Added more to check to prevent assertion errors.
* gnu/java/awt/peer/gtk/GtkPanelPeer.java
(handleEvent): Likewise.
* gnu/java/awt/peer/gtk/GtkWindowPeer.java
(handleEvent): Likewise.
-
+
2006-02-09 Mark Wielaard <mark@klomp.org>
-
+
* javax/swing/JTable.java (tableChanged): Interpret null event as
"everything changed".
-
+
2006-02-09 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/DefaultCaret.java
(DocumentHandler.removeUpdate): When update policy is
'on eventqueue', and the update doesn't come from the
@@ -22163,31 +31717,31 @@
valid.
(moveDot): Make sure the new dot location is valid.
(setDot): Set the mark the same as the dot.
-
+
2006-02-09 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/AbstractDocument.java
(remove): Perform all operations within a write lock and in the
correct order.
-
+
2006-02-09 Mark Wielaard <mark@klomp.org>
-
+
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollbarPeer.c
(Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create): Make sure max is
creater than min, adjusting page_size if necessary.
(Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_setValues): Likewise.
-
+
2006-02-09 Lillian Angel <langel@redhat.com>
-
+
* gnu/java/awt/peer/gtk/GtkPanelPeer.java
(handleEvent): Added code to handle PaintEvent.UPDATE.
Sun does not call update(Graphics g) on Panels.
* gnu/java/awt/peer/gtk/GtkWindowPeer.java
(handleEvent): New method. Added code to handle PaintEvent.UPDATE.
Sun does not call update(Graphics g) on Panels.
-
+
2006-02-09 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/BoxView.java
(myAxis): Made field private.
(xLayoutValid): Replaced by layoutValid array.
@@ -22257,14 +31811,14 @@
(replace): Added API docs.
(forwardUpdate): Rewritten to only notify child views that need to
be notified.
-
+
2006-02-09 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicTextUI.java
(RootView.paint): Call setSize() before painting the view.
-
+
2006-02-09 Ito Kazumitsu <kaz@maczuka.gcd.org>
-
+
Fixes bug #26112
* gnu/regexp/RE.java(REG_REPLACE_USE_BACKSLASHESCAPE): New execution
flag which enables backslash escape in a replacement.
@@ -22320,9 +31874,9 @@
(getRequestProperties): Throw IllegalStateException if connected.
(setRequestProperty): Call super method for exception tests.
(addRequestProperty): Likewise.
-
+
2006-02-09 Wolfgang Baer <WBaer@gmx.de>
-
+
* gnu/java/net/protocol/http/Request.java:
(Request): Remove initialization of removed field.
(requestBodyNegotiationThreshold): Removed now unused field.
@@ -22341,18 +31895,18 @@
(setMinimum): Fixed test for updating value,
(setMaximum): Likewise,
(setStepSize): Likewise.
-
+
2006-02-08 Tom Tromey <tromey@redhat.com>
-
+
* tools/.cvsignore: Added Makefile.in.
-
+
2006-02-08 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* java/rmi/server/RemoteRef.java,
java/rmi/server/RemoteStub.java: Commented.
-
+
2006-02-08 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/SpinnerDateModel.java
(SpinnerDateModel(Date, Comparable, Comparable, int)): Added argument
checks,
@@ -22366,25 +31920,25 @@
(select): Fixed up code, added some checks to prevent errors.
(dispatchEventImpl): Removed. This function is not needed. It
causes several assertion errors.
-
+
2006-02-08 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/PlainView.java
(drawLine): Call drawUnselectedText() with end offset - 1 to avoid
drawing unnecessary characters.
-
+
2006-02-08 Lillian Angel <langel@redhat.com>
-
+
* gnu/java/awt/peer/gtk/GtkComponentPeer.java
(handleEvent): Fixed check to determine if height or
width is less than 1.
-
+
2006-02-08 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
*tools/Makefile.am (ALL_TOOLS_FILES): Add $(TOOLS_HELPS).
-
+
2006-02-08 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* examples/gnu/classpath/examples/CORBA/swing/x5/_GameManagerImpl_Tie.java,
examples/gnu/classpath/examples/CORBA/swing/x5/_PlayerImpl_Tie.java:
Documenting the code generator.
@@ -22422,26 +31976,26 @@
tools/gnu/classpath/tools/giop/grmic/templates/Tie.jav,
tools/gnu/classpath/tools/giop/grmic/templates/TieMethod.jav,
tools/gnu/classpath/tools/giop/grmic/templates/TieMethodVoid.jav: New files.
-
+
2006-02-07 David Gilbert <david.gilbert@object-refinery.com>
-
+
* java/awt/BasicStroke.java: Updated API docs all over,
* java/awt/doc-files/capjoin.png: New file.
-
+
2006-02-07 Lillian Angel <langel@redhat.com>
-
+
* gnu/java/awt/peer/gtk/GtkComponentPeer.java
(handleEvent): Added check. Should not paint or update the
component if it's width and height are both 0.
-
+
2006-02-07 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/AbstractDocument.java
(insertString): Enclose locking/unlocking in try-finally block
and also keep locked while notifying the listeners.
-
+
2006-02-07 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/GlyphView.java
(GlyphView): Initialize startOffset and endOffset with -1 (indicating
element boundary).
@@ -22449,15 +32003,15 @@
(getEndOffset): Return element boundary if endOffset < 0.
(createFragment): Set startOffset and endOffset fields of fragment
if one of p0 or p1 is not at the element boundary.
-
+
2006-02-07 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/CellRendererPane.java
(paintComponent): Enclosed painting in try finally to properly
clean up even when throwing an exception.
-
+
2006-02-07 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/UIManager.java
(listeners): Made this an instance of
java.beans.PropertyChangeSupport instead of the obsoleted
@@ -22469,9 +32023,9 @@
of actions "delete-next" and "delete-previous", added new TextAction
implementations for "selection-begin", "selection-begin-line",
"selection-end" and "selection-end-line".
-
+
2006-02-07 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicTextUI.java
(paint): Acquire read lock on the document before calling
paintSafely.
@@ -22479,24 +32033,24 @@
(paintBackground): Implemented to actually paint the background.
(update): Overridden to _not_ paint the background. This is done
in paintBackground in this UI.
-
+
2006-02-07 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/View.java
(forwardUpdate): Don't notify newly added child views as specified.
-
+
2006-02-07 Robert Schuster <robertschuster@fsfe.org>
-
+
* gnu/java/beans/decoder/DefaultExceptionListener.java: Removed.
-
+
2006-02-07 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(ElementBuffer.insert): Only register change when the element
actually changed.
-
+
2006-02-07 Raif S. Naffah <raif@swiftdsl.com.au>
-
+
* gnu/java/security/key/KeyPairCodecFactory.java (getEncodingName): New
method.
(getEncodingShortName): Likewise.
@@ -22535,9 +32089,9 @@
* gnu/java/security/der/DERWriter.java (writeBitString): Use
writeLength() instead of write().
return buf.length + 1 instead of buf.length.
-
+
2006-02-07 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicTextUI.java
(RootView.preferenceChange): Changed view parameter to view so
that it doesn't hide a field of that class.
@@ -22547,21 +32101,21 @@
(updateHandler): Made field private.
(getVisibleEditorRect): Removed unneeded local variable that
shadowed a field with the same name and purpose.
-
+
2006-02-07 Robert Schuster <robertschuster@fsfe.org>
-
+
* javax/swing/text/JTextComponent.java:
(getSelectedText): Calculate offset and use that as
second argument.
-
+
2006-02-07 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JTextPane.java
(setCharacterAttributes): Replace input attributes when
replace==true.
-
+
2006-02-07 Roman Kennke <kennke@aicas.com>
-
+
* java/awt/Component.java
(firePropertyChange(String,byte,byte)): Made method public.
(firePropertyChange(String,char,char)): Made method public.
@@ -22569,28 +32123,28 @@
(firePropertyChange(String,long,long)): Made method public.
(firePropertyChange(String,float,float)): Made method public.
(firePropertyChange(String,double,double)): Made method public.
-
+
2006-02-06 Tom Tromey <tromey@redhat.com>
-
+
* gnu/CORBA/NamingService/NamingServiceTransient.java (main): Use
2006.
* gnu/java/rmi/registry/RegistryImpl.java (version): Use 2006.
-
+
2006-02-06 Anthony Green <green@redhat.com>
-
+
* gnu/xml/aelfred2/XmlParser.java: Add missing break;.
-
+
2006-02-07 Raif S. Naffah <raif@swiftdsl.com.au>
-
+
* .settings/org.eclipse.jdt.core.prefs:
Force a line split on extends and implements.
Force a white-space after unary operators.
Don't force a new-line after @params.
Add new-line at end-of-file.
* scripts/eclipse-gnu.xml: Export version of the above named GNU.
-
+
2006-02-07 Raif S. Naffah <raif@swiftdsl.com.au>
-
+
* gnu/java/security/provider/GnuDSAPublicKey.java (getEncoded): Use
Registry constant.
* gnu/java/security/provider/GnuDSAPrivateKey.java (getEncoded):
@@ -22629,18 +32183,18 @@
(setPropertiesFromAttributes): Use null for background when no
background is set. StyleConstants.getBackground() doesn't work
for this, because it returns Color.BLACK in that case.
-
+
2006-02-06 Roman Kennke <kennke@aicas.com>
-
+
* java/awt/Container.java
(changeSupport): Removed duplicate (from Component) field.
(addPropertyChangeListener): Call super.
-
+
2006-02-06 Ito Kazumitsu <kaz@maczuka.gcd.org>
-
+
* java/util/regex/Matcher.java(matches):
set RE.REG_TRY_ENTIRE_MATCH as an execution flag of getMatch.
-
+
2006-02-06 Ito Kazumitsu <kaz@maczuka.gcd.org>
Fixes bug #25812
@@ -22669,9 +32223,9 @@
* gnu/regexp/RETokenWordBoundary.java: Likewise.
* gnu/regexp/RETokenIndependent.java: New file.
* gnu/regexp/RETokenLookBehind.java: New file.
-
+
2006-02-06 Roman Kennke <kennke@aicas.com>
-
+
* java/awt/Component.java
(firePropertyChange(String,byte,byte)): New method.
(firePropertyChange(String,char,char)): New method.
@@ -22704,9 +32258,9 @@
(firePropertyChange(String,float,float)): Removed.
(firePropertyChange(String,long,long)): Removed.
(firePropertyChange(String,short,short)): Removed.
-
+
2006-02-06 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/event/SwingPropertyChangeSupport.java
(listeners): Removed field.
(propertyListeners): Removed field.
@@ -22718,19 +32272,19 @@
(getPropertyChangeListeners): Removed methods.
(firePropertyChange): Removed methods.
(hasListeners): Removed methods.
-
+
2006-02-06 Jeroen Frijters <jeroen@frijters.net>
-
+
Fixes PR 25313
* java/net/InetAddress.java
(readResolve): Implemented.
-
+
2006-02-06 Jeroen Frijters <jeroen@frijters.net>
-
+
Fixes PR 26121
* java/io/ObjectInputStream.java
(readNextBlock()): Handle TC_RESET.
-
+
2006-02-06 Wolfgang Baer <WBaer@gmx.de>
* javax/print/attribute/standard/Compression.java,
@@ -22762,22 +32316,22 @@
Throw ConnectException instead of IOException if connection failed.
* native/jni/java-net/javanet.h:
Add a define for java.net.ConnectException
-
+
2006-02-05 Mark Wielaard <mark@klomp.org>
-
+
Fixes bug #26101
reported by Egon Willighagen <egon.willighagen@gmail.com>
* javax/swing/DefaultListCellRenderer.java
(getListCellRendererComponent): Turn null value into empty string.
-
+
2006-02-04 Ito Kazumitsu <kaz@maczuka.gcd.org>
-
+
* gnu/regexp/RETokenNamedProperty.java(getHandler): Check for
a Unicode block if the name starts with "In".
(UnicodeBlockHandler): New inner class.
-
+
2006-02-04 Roman Kennke <kennke@aicas.com>
-
+
* java/awt/Container.java
(getComponentZOrder): New method.
(setComponentZOrder): New method.
@@ -22833,12 +32387,12 @@
(USE_DEFAULTS): more documentation to clarify behavior.
(setup): amended to handle new attribute.
* gnu/java/security/util/PRNG.java: New file.
-
+
2006-02-03 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/plaf/basic/BasicColorChooserUI.java:
chooser field should be protected, not package-private.
-
+
2006-02-03 Lillian Angel <langel@redhat.com>
* javax/swing/text/DefaultStyledDocument.java
@@ -22854,20 +32408,20 @@
when fracturing.
(getEditForParagraphAndIndex): No need to check index. We should
use the same edit for each paragraph.
-
+
2006-02-03 Mark Wielaard <mark@klomp.org>
-
+
* javax/swing/event/SwingPropertyChangeSupport.java
(propertyListeners): Change type to HashMap.
(SwingPropertyChangeSupport): Allocate HashMap.
-
+
2006-02-03 Raif S. Naffah <raif@swiftdsl.com.au>
-
+
* java/security/KeyPairGenerator.java (getInstance): Test for
instanceof KeyPairGenerator before KeyPairGeneratorSpi.
-
+
2006-02-02 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/RepaintManager.java
Made fields private.
(RepaintWorker.run): Enclosed work stuff in try finally block in
@@ -22895,15 +32449,15 @@
(paintDirtyRegions): Compute repaint order here, based on size of
damaged regions. Fine tuned synchronization. Avoid use of working
copies of dirtyComponent.
-
+
2006-02-02 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(insertUpdate): JoinNextDirection should push the
'next' paragraph on the stack.
-
+
2006-02-02 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(insertUpdate): Rewrote code for Originate. This prevents
leaves being created multiple times. If it is on the last
@@ -22912,44 +32466,44 @@
(insertContentTag): Rewrote to add new leaf directly if
this is a branch with no children. Otherwise, it
recreates the remainder of the tree as before.
-
+
2006-02-02 Ito Kazumitsu <kaz@maczuka.gcd.org>
-
+
* gnu/regexp/REMatch.java(REMatchList): New inner utility class
for making a list of REMatch instances.
* gnu/regexp/RETokenOneOf.java(match): Rewritten using REMatchList.
* gnu/regexp/RETokenRepeated.java(findDoables): New method.
(match): Rewritten using REMatchList.
(matchRest): Rewritten using REMatchList.
-
+
2006-02-02 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* examples/gnu/classpath/examples/CORBA/swing/x5/PlayingDesk.java
(friendsMove): Call repaint() only after endOfGame is assigned.
-
+
2006-02-02 Mark Wielaard <mark@klomp.org>
-
+
Fixes bug #25769 reported by Artemus Harper <subanark@gmail.com>
* java/util/AbstractCollection.java (toString): Only use Iterator,
check whether collection contains itself.
-
+
2006-02-01 Casey Marshall <csm@gnu.org>
-
+
Partial fix for PR classpath/25143.
* javax/crypto/EncryptedPrivateKeyInfo.java (algName): new field.
(<init>): fill in `algName,' derive `algOid' from `algName.'
(getOid): new method.
(encode): embed NULL value for parameters if `params' is `null.'
-
+
2006-02-01 Casey Marshall <csm@gnu.org>
-
+
Tag check and OTHER_NAME fixes suggested by Rafael Teixeira
<monoman@gmail.com>.
* gnu/java/security/x509/ext/GeneralNames.java (<init>): fix tag
check; fix OTHER_NAME parsing; fix DIRECTORY_NAME parsing.
-
+
2006-02-01 Casey Marshall <csm@gnu.org>
-
+
toString fix suggested by Rafael Teixeira <monoman@gmail.com>.
* gnu/java/security/der/DERValue.java
(getLength, getEncoded, getEncodedLength): throw an exception,
@@ -22962,28 +32516,28 @@
directly.
2006-02-01 Tom Tromey <tromey@redhat.com>
-
+
* java/security/Security.java (loadProviders): Use system class
loader.
-
+
2006-02-01 Mark Wielaard <mark@klomp.org>
-
+
* gnu/regexp/RE.java (getRETokenNamedProperty): Chain exception.
* gnu/regexp/RETokenNamedProperty.java (LETTER, MARK, SEPARATOR,
SYMBOL, NUMBER, PUNCTUATION, OTHER): New final byte[] fields.
(getHandler): Check for grouped properties L, M, Z, S, N, P or C.
(UnicodeCategoriesHandler): New private static class.
-
+
2006-02-01 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java:
Removed unneeded fields.
(insertUpdate): Removed field initialization.
(insertContentTag): Rewrote part of function. Still
not complete.
-
+
2006-02-01 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(insertParagraph): Cleaned up code.
(insertFirstContentTag): Fixed call to recreateLeaves.
@@ -23002,49 +32556,49 @@
scripts/unicode-blocks.pl and doc/unicode/Blocks-4.0.0.txt.
* scripts/unicode-blocks.pl: Copied this over from the generics branch
but replaced some 1.5-only features (such as enum).
-
+
2006-01-31 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/PasswordView.java
(drawSelectedText): Use drawEchoCharacter() method to draw echo
character.
(drawUnselectedText): Use drawEchoCharacter() method to draw echo
character.
-
+
2006-01-31 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JTextField.java
(getPreferredSize): Also include textfield's insets in width
calculation.
-
+
2006-01-31 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicTextUI.java
(getPreferredSize): Include the textcomponent's insets in
preferredSize.
-
+
2006-01-31 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/table/DefaultTableCellRenderer.java
(getTableCellRendererComponent): Moved setting of the value into
setValue(). Removed (bogus) special handling of JTextField values.
(setValue): Made ?: statement more clear by rewriting it
with if .. else.
-
+
2006-01-31 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JLayeredPane.java
(insertIndexForLayer): Fixed algorithm to correctly determine
inser index for positions >= 0.
(addImpl): Fixed API docs for the index parameter.
-
+
2006-01-31 Mark Wielaard <mark@klomp.org>
-
+
* java/net/URI.java (getURIGroup): Check for null to see whether
group actually exists.
-
+
2006-01-31 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(changeUpdate): Fixed calls to split to incorporate
new parameter.
@@ -23053,22 +32607,22 @@
(insertContentTag): Fixed check to use
recreateLeaves. Added a FIXME comment.
(split): Added a new parameter for edits.
-
+
2006-01-31 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicRootPaneUI.java
(installDefaults): Don't install a background color here.
-
+
2006-01-31 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(insert): Removed comment.
(insertUpdate): Added comment.
(recreateLeaves): Removed call to push newBranch onto the
stack. This does not need to be done here.
-
+
2006-01-31 Chris Burdess <dog@gnu.org>
-
+
* gnu/xml/stream/SAXParser.java,
gnu/xml/stream/UnicodeReader.java,
gnu/xml/stream/XIncludeFilter.java,
@@ -23105,15 +32659,15 @@
* javax/swing/plaf/text/Utilites.java
(drawTabbedText): The coordinates denote the baseline of the text
not the upper left corner.
-
+
2006-01-31 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicTextUI.java
(createKeymap): Don't store KeyBindings[] as focusInputMap in
UIManager. Added FIXME regarding the implementation of this method.
-
+
2006-01-30 David Gilbert <david.gilbert@object-refinery.com>
-
+
* examples/gnu/classpath/examples/swing/ButtonDemo.java
(ButtonDemo): Move content initialisation to new method,
(initFrameContent): New method,
@@ -23123,15 +32677,15 @@
* examples/gnu/classpath/examples/swing/ScrollBarDemo.java: Likewise,
* examples/gnu/classpath/examples/swing/SliderDemo.java: Likewise,
* examples/gnu/classpath/examples/swing/TextFieldDemo.java: Likewise.
-
+
2006-01-30 David Gilbert <david.gilbert@object-refinery.com>
-
+
* examples/gnu/classpath/examples/swing/Demo.java
(Demo): Set frame size,
(mkButtonBar): Removed stacked sub-panels.
-
+
2006-01-30 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java:
Added new fields.
(insert): Initialized fields. Removed call to addEdit,
@@ -23149,16 +32703,16 @@
(recreateLeaves): Fixed code and cleaned it up a bit.
(insertFracture): Set fracNotCreated field.
(addEdit): Removed, this method is not needed.
-
+
2006-01-30 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JRootPane.java
(RootLayout.prefSize): Removed caching for preferredSize.
(RootLayout.invalidateLayout): Likewise.
(RootLayout.preferredLayoutSize): Likewise.
-
+
2006-01-30 Roman Kennke <kennke@aicas.com>
-
+
PR classpath/26035
* javax/swing/JFrame.java
(frameInit): Handle the defaultLookAndFeelDecorated flag.
@@ -23185,23 +32739,23 @@
IllegalArgumentException when orientation is illegal.
(JProgressBar(int, int, int)): Likewise and throw exception.
(setOrientation): Likewise.
-
+
2006-01-30 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/ViewportLayout.java
(minimumLayoutSize): Rewritten to unconditionally return (4,4).
-
+
2006-01-30 Mark Wielaard <mark@klomp.org>
-
+
* javax/swing/JProgressBar.java (orientation): Always set by
constructor.
(JProgressBar(int)): Document default on 'illegal' value.
(JProgressBar(int, int, int)): Likewise and set orientation to
HORIZONTAL when 'illegal'.
(setOrientation): Likewise.
-
+
2006-01-30 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicListUI.java
(ListDataHandler.contentsChanged): Update the
updateLayoutStateNeeded flag.
@@ -23213,30 +32767,30 @@
listeners on new list model.
(maybeUpdateLayoutState): Don't consider the validation state
of the list.
-
+
2006-01-30 Mark Wielaard <mark@klomp.org>
-
+
* gnu/xml/transform/ApplyTemplatesNode.java (clone): Check whether
sortKeys is null.
-
+
2006-01-30 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JLayeredPane.java
(insertIndexForLayer): Fixed algorithm to correctly insert
components within different layers and -1 position.
-
+
2006-01-30 Mark Wielaard <mark@klomp.org>
-
+
* doc/api/Makefile.am (create_html): Add -validhtml.
-
+
2006-01-30 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JLayeredPane.java
(insertIndexForLayer): Fixed algorithm to correctly insert
components within same layer and -1 position.
-
+
2006-01-30 Ito Kazumitsu <kaz@maczuka.gcd.org>
-
+
Fixes bug #24876
* gnu/regexp/gnu/regexp/RE.java(REG_TRY_ENTIRE_MATCH):
New execution flag.
@@ -23260,7 +32814,7 @@
* gnu/javax/crypto/mac/HMac.java (clone): Clone ipadHash, opadHash, and
the ipad buffer.
* gnu/javax/crypto/mac/BaseMac.java (clone): Clone underlyingHash.
-
+
2006-01-30 Audrius Meskauskas <AudriusA@Bioinformatics.org>
PR 26027
@@ -23277,19 +32831,19 @@
* java/beans/Encoder.java:
(setExceptionListener): Use shared DefaultExceptionListener
instance.
-
+
2006-01-29 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/ScrollPaneLayout.java
(minimumLayoutSize): Rewritten to match JDKs behaviour.
-
+
2006-01-29 Mark Wielaard <mark@klomp.org>
-
+
* java/net/SocketPermission.java (setActions): Trim and lower case
action.
-
+
2006-01-29 Raif S. Naffah <raif@swiftdsl.com.au>
-
+
* gnu/java/security/util/Prime2.java (passEulerCriterion): Was
incorrectly failing primality test for some known primes. Fixed.
(passFermatLittleTheorem): Removed.
@@ -23297,55 +32851,55 @@
(isProbablePrime): Cache primes that pass the primality tests.
Use BigInteger.isProbablePrime(int) for primality tests.
(debugBI): New static debugging method.
-
+
2006-01-28 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicListUI.java
(updateLayoutState): Removed unneeded special case for VERTICAL.
-
+
2006-01-28 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicListUI.java
(getCellBounds): Determine correct list width when having a
layoutOrientation of VERTICAL.
(maybeUpdateLayoutState): Don't consider the validation state of
the list.
-
+
2006-01-28 Mark Wielaard <mark@klomp.org>
-
+
Reported by Dimitri Fontaine <dimitri@dalibo.com>
* java/awt/print/NoPrinterJob.java: New (fake) class.
* java/awt/print/PrinterJob.java (getPrinterJob): Return NoPrinterJob.
-
+
2006-01-28 Mark Wielaard <mark@klomp.org>
-
+
* gnu/javax/crypto/mac/HMac.java (clone): Cast cloned ipad to byte[].
-
+
2006-01-28 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* gnu/classpath/examples/swing/Demo.java (mkTree): Make a larger tree.
(addChildren): New method.
-
+
2006-01-28 Raif S. Naffah <raif@swiftdsl.com.au>
-
+
* gnu/javax/crypto/jce/mac/MacAdapter.java (MacAdapter(IMac, Map)): New
constructor for cloning purposes.
(clone): New implementation that ensures cloning.
* gnu/javax/crypto/mac/HMac.java (clone): Implement Cloneable.
* gnu/java/security/Registry.java: Changed value of GNU_SECURITY to
"GNU".
-
+
2006-01-27 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* javax/swing/plaf/basic/BasicTreeUI.java (updateCachedPreferredSize):
Call updateCurrentVisiblePath.
-
+
2006-01-27 Roman Kennke <kennke@aicas.com>
-
+
* examples/gnu/classpath/examples/swing/MiniDemo.java: New file.
-
+
2006-01-27 Roman Kennke <kennke@aicas.com>
-
+
* examples/gnu/classpath/examples/swing/ButtonDemo.java
(createContent): Only create new content if we don't have one
already.
@@ -23367,9 +32921,9 @@
* examples/gnu/classpath/examples/swing/TextFieldDemo.java
(createContent): Only create new content if we don't have one
already.
-
+
2006-01-27 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(insertFirstContentTag): Removed check, not needed. This
still needs to be fixed for some cases. Added call to
@@ -23379,19 +32933,19 @@
leaves after the initial insertion. This still needs
more work.
(handleInsertAfterNewline): Removed else, not needed.
-
+
2006-01-27 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JLayeredPane.java
(inserIndexForLayer): Fixed direction of search.
-
+
2006-01-27 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* javax/swing/JTree.java (constructor): Put EXPANDED for the root
node into nodeStates.
-
+
2006-01-27 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JLayeredPane.java
(FRAME_CONTENT_LAYER): Made field final.
(componentToLayer): Made field private.
@@ -23427,9 +32981,9 @@
statement.
* java/lang/String.java:
(String(int[], int, int)): New API constructor.
-
+
2006-01-27 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(insert): Moved this loop to insertUpdate.
(insertUpdate): Likewise. Fixed variable
@@ -23457,21 +33011,21 @@
* vm/reference/java/io/VMObjectInputStream.java (loaderAction.run):
If no user class loaders found on the stack, return the thread
context class loader. (currentClassLoader): Explained.
-
+
2006-01-27 Roman Kennke <kennke@aicas.com>
-
+
* java/awt/Container.java
(swapComponents): Removed unspecified method.
* javax/swing/JLayeredPane.java
(setPosition): Reimplemented correctly.
(swapComponents): New helper method.
-
+
2006-01-27 Mark Wielaard <mark@klomp.org>
-
+
* configure.ac: Set version to 0.21-pre.
-
+
2006-01-27 Roman Kennke <kennke@aicas.com>
-
+
PR classpath/25968
* javax/swing/JComponent.java
(findOverlapFreeParent): Improved the algorithm to make better use
@@ -23482,14 +33036,14 @@
(computeBlit): Fixed check to decide if blitting is possible or not,
so that it doesn't blit if nothing was scrolled (in order to
update the buffer when the view updates itself).
-
+
2006-01-27 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/metal/MetalFileChooserUI.java
(createList): Don't set scrollbar policy.
-
+
2006-01-27 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicPopupMenuUI.java
(PopupMenuHandler.popupMenuWillBecomeInvisible):
Fixed to also handle non-Swing toplevel containers.
@@ -23498,9 +33052,9 @@
* javax/swing/Popup.java
(JWindowPopup.JWindowPopup()): Correctly set parent window on
popup.
-
+
2006-01-27 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicInternalFrameUI.java
(InternalFramePropertyChangeListener): Don't implement
VetoableChangeListener.
@@ -23509,9 +33063,9 @@
(installListeners): Don't install vetoableChangeListener.
* javax/swing/event/DocumentEvent.java
(EventType): Made class final.
-
+
2006-01-27 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/SwingUtilities.java
(calculateInsetArea): Removed unneeded method. The method
calculateInnerArea has the same purpose and is actually specified.
@@ -23519,9 +33073,9 @@
* javax/swing/plaf/basic/BasicMenuItemUI.java
(paintMenuItem): Use SwingUtilities.calculateInnerArea() instead
of SwingUtilities.calculateInsetArea().
-
+
2006-01-27 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/basic/BasicTreeUI.java
(installDefaults): Removed requestFocusInWindow() call.
* javax/swing/JComponent.java
@@ -23530,9 +33084,9 @@
(printChildren): Made method protected.
(printComponent): Made method protected.
(printBorder): Made method protected.
-
+
2006-01-27 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/AbstractButton.java
(ButtonChangeListener.ButtonChangeListener()): Made constructor
package private.
@@ -23572,26 +33126,26 @@
(AccessibleJWindow.AccessibleJWindow): Made constructor protected.
* javax/swing/RepaintManager.java
(RepaintWorker): Made class private.
-
+
2006-01-27 Roman Kennke <kennke@aicas.com>
-
+
* gnu/java/awt/peer/swing/SwingComponentPeer.java
(handleEvent): Removed debug statement.
-
+
2006-01-27 Roman Kennke <kennke@aicas.com>
-
+
* java/awt/Component.java
(coalescePaintEvents): Don't try to optimize coalescing. This hurts
more than it helps.
-
+
2006-01-26 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(createFracture): Commented out a known problem,
added FIXME tag.
-
+
2006-01-26 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(ElementBuffer): Added fields.
(remove): Initialized pos.
@@ -24084,9 +33638,9 @@
* java/lang/Character.java:
(codePointCount(char[], int, int)): New API method.
(codePointCount(CharSequence, int, int)): Likewise.
-
+
2006-01-25 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
PR 25205
* javax/swing/DefaultCellEditor.java (getTreeCellEditorComponent):
Rewritten.
@@ -24121,13 +33675,13 @@
(stopCellEditing): Rewritten.
(stopEditingTimer): New method.
(valueChanged): Do not configure editing component here.
-
+
2006-01-25 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/html/FormView.java: New file.
-
+
2006-01-25 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JSplitPane.java
(addImpl): Call resetToPreferredSizes() when no dividerLocation
has been set in order to set an initial layout.
@@ -24146,17 +33700,17 @@
* javax/swing/plaf/basic/BasicLookAndFeel.java
(initComponentDefaults): Added SplitPaneDivider.draggingColor
default value.
-
+
2006-01-25 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JSplitPane.java
(addImpl): Removed invalidate() and layout() call.
* javax/swing/plaf/basic/BasicSplitPaneUI.java
(PropertyHandler.propertyChange): Remove layoutContainer() and
repaint() call.
-
+
2006-01-25 Roman Kennke <kennke@aicas.com>
-
+
* configure.ac
* native/Makefile.am
* native/jni/classpath/Makefile.am
@@ -24259,9 +33813,9 @@
* native/target/posix/target_posix_network.c
* native/target/posix/target_posix_network.h:
Removed.
-
+
2006-01-24 Wolfgang Baer <WBaer@gmx.de>
-
+
* javax/print/PrintService.java,
* javax/print/DocPrintJob.java,
* javax/print/CancelablePrintJob.java:
@@ -24293,32 +33847,32 @@
* java/beans/DefaultPersistenceDelegate:
(initialize): Added call to superclass' implementation, added
early return.
-
+
2006-01-24 Tom Tromey <tromey@redhat.com>
-
+
* java/util/regex/PatternSyntaxException.java: Added @since.
* java/util/regex/Matcher.java (Matcher): Implements MatchResult.
* java/util/regex/MatchResult.java: New file.
-
+
2006-01-24 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/text/StringContent.java: Added API docs all over, plus
minor reformatting.
-
+
2006-01-24 Gary Benson <gbenson@redhat.com>
-
+
* java/net/SocketPermission.java: Implemented serialization.
-
+
2006-01-24 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/text/StringContent.java
(remove): Modified argument check to prevent removal of last character,
(getChars): Removed null argument check to allow NullPointerException,
added API docs,
(checkLocation): Added API docs and white space.
-
+
2006-01-23 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(insertUpdate): Should only call createFracture with
StartTagType. Added check.
@@ -24354,20 +33908,20 @@
* javax/swing/plaf/synth/package.html:
New files. Added the public API and framework classes for the
Synth look and feel.
-
+
2006-01-23 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/text/Segment.java: API docs all over.
-
+
2006-01-23 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(split): Should not use createLeafElement and createBranchElement here.
We should just instaniate the LeafElements and BranchElements instead
to avoid the case where create*Element is overridden.
-
+
2006-01-23 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(insertFirstContentTag): Moved check outside of if-statement.
This should be checked before creating the new leaf element.
@@ -24377,18 +33931,18 @@
greater than the offset, then we need to create a temp leaf
as a place holder. Otherwise, the leaf elements should be
created normally.
-
+
2006-01-23 Gary Benson <gbenson@redhat.com>
-
+
* java/net/SocketPermission.java: Almost completely rewritten.
-
+
2006-01-23 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(insertFracture): Set temp leaf's attributes to prevent an NPE.
-
+
2006-01-23 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java:
Formatted ElementBuffer and added new fields.
(remove): Added check to determine if length is 0.
@@ -24461,14 +34015,14 @@
an empty string matched. Added special handling of {0}.
* gnu/regexp/RETokenBackRef.java(match): Sets empty flag
when an empty string matched. Fixed the case insensitive matching.
-
+
2006-01-21 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/plaf/metal/MetalSplitPaneDivider.java
(paint): Added painting of border if one is installed.
-
+
2006-01-21 Roman Kennke <kennke@aicas.com>
-
+
PR classpath/25843:
* javax/swing/plaf/basic/BasicBorders.java
(getSplitPaneDividerBorder): Use new border constructor
@@ -24506,52 +34060,52 @@
(getMinimumDividerLocation): Fixed calculation of minimum location.
2006-01-21 Guilhem Lavaux <guilhem@kaffe.org>
-
+
* m4/acinclude.m4
(CLASSPATH_WITH_GLIBJ): Add support for fastjar.
-
+
* lib/Makefile.am: Likewise.
-
+
2006-01-21 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/PopupFactory.java
(getPopup): If there is no Swing root found in any way, use a
heavyweight popup. This is useful for mixed Swing/AWT GUIs, or
for the Swing AWT peers.
-
+
2006-01-20 Tom Tromey <tromey@redhat.com>
-
+
* gnu/java/net/protocol/http/HTTPURLConnection.java (connect):
Read response body for redirect.
-
+
2006-01-20 Chris Burdess <dog@gnu.org>
-
+
* gnu/java/net/protocol/http/HTTPURLConnection.java: Don't follow
redirects on 304.
-
+
2006-01-20 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(pad): Removed, not needed.
(printElements): Likewise.
(printEdit): Likewise.
-
+
2006-01-20 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/text/DefaultFormatter.java
(DefaultFormatter): Don't set a value class.
-
+
2006-01-19 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* javax/swing/DefaultCellEditor.java: Commented.
-
+
2006-01-19 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JOptionPane.java
Added cast to Frame for JDialog constructor.
-
+
2006-01-19 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JWindow.java
(JWindow(Window)): Fixed to accept null owner argument.
(JWindow(Window,GraphicsConfiguration)): Fixed to accept null
@@ -24565,22 +34119,22 @@
is called.
* javax/swing/JFileChooser.java
(createDialog): Added cast to Frame for JDialog constructor.
-
+
2006-01-19 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* javax/swing/JTable.java (rowAtPoint): Rewritten.
-
+
2006-01-19 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JWindow.java: Added API docs to the constructors.
-
+
2006-01-19 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
* javax/swing/JTable.java: Commenting method headers.
(EditorUpdateTimer): Removed.
-
+
2006-01-19 Roman Kennke <kennke@aicas.com>
-
+
* javax/swing/JDialog.java
(JDialog()): Call SwingUtilities.getOwnerFrame() with null.
(JDialog(Frame,String,boolean,GraphicsConfiguration)): Call
@@ -24600,9 +34154,9 @@
* javax/swing/SwingUtilities.java
(getOwnerFrame): Changed to take a owner parameter that is returned
as owner frame when not null.
-
+
2006-01-19 Roman Kennke <kennke@aicas.com>
-
+
* gnu/java/awt/peer/swing/SwingFramePeer.java
(handleMouseEvent): Fixed handling of mouse events.
(handleMouseMotionEvent): Fixed handling of mouse events.
@@ -24693,27 +34247,27 @@
* java/security/SignatureSpi.java: Likewise.
* java/security/SignedObject.java: Likewise.
* java/security/Signer.java: Likewise.
-
+
2006-01-18 Roman Kennke <kennke@aicas.com>
-
+
* configure.ac: Added --enable-posix-layer option to enable
build of the posix target layer.
-
+
2006-01-18 Roman Kennke <kennke@aicas.com>
-
+
* native/jni/java-net/java_net_VMInetAddress.c
(Java_java_net_VMInetAddress_lookupInaddrAny): Use target native macro
for INADDR_ANY.
-
+
2006-01-18 Roman Kennke <kennke@aicas.com>
-
+
* native/jni/java-util/java_util_VMTimeZone.c:
(Java_java_util_VMTimeZone_getSystemTimeZoneId): Rewritten
to use target native layer.
(jint_to_charbuf): Removed unneeded helper function.
-
+
2006-01-18 Roman Kennke <kennke@aicas.com>
-
+
* native/jni/java-nio/gnu_java_nio_VMPipe.c:
Removed unnecessary include.
* native/jni/java-nio/gnu_java_nio_VMSelector.c:
@@ -24781,14 +34335,14 @@
* native/jni/java-net/javanet.h:
Defined SOCKET_TIMEOUT_EXCEPTION, PORT_UNREACHABLE_EXCEPTION and
SOCKOPT_SO_BROADCAST.
-
+
2006-01-17 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(insert): Cleaned up loop. No need to make so many calls
to getAddedElements and getRemovedElements.
(insertFracture): Removed unneeded array.
-
+
2006-01-17 Lillian Angel <langel@redhat.com>
* javax/swing/text/JTextComponent.java
@@ -24806,9 +34360,9 @@
(paste): Implemented.
(replaceText): Implemented.
(selectText): Implemented.
-
+
2006-01-17 Anthony Balkissoon <abalkiss@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java:
(pad): New debugging method.
(printElements): Likewise.
@@ -24856,9 +34410,9 @@
* javax/swing/text/StyleContent.java:
(SmallAttributeSet.toString): Fixed an off-by-one error in the loop
that was causing an ArrayOutOfBoundsException.
-
+
2006-01-17 Roman Kennke <kennke@aicas.com>
-
+
* native/jni/java-nio/gnu_java_nio_channels_FileChannelImpl.c:
(Java_gnu_java_nio_channels_FileChannelImpl_init): Improved
exception messages a little.
@@ -24897,9 +34451,9 @@
to use the corresponding target native macro.
(Java_gnu_java_nio_channels_FileChannelImpl_unlock): Reimplemented
to use the corresponding target native macro.
-
+
2006-01-17 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultTextUI.java:
Added deprecated tag.
* javax/swing/text/JTextComponent.java
@@ -24938,29 +34492,29 @@
(selectText): Likewise.
(setAttributes): Likewise.
(getAccessibleContext): Implemented.
-
+
2006-01-17 Ito Kazumitsu <kaz@maczuka.gcd.org>
-
+
Fixes bug #25817
* gnu/regexp/RETokenRange.java(constructor):
Keep lo and hi as they are.
(match): Changed the case insensitive comparison.
-
+
2006-01-17 Ito Kazumitsu <kaz@maczuka.gcd.org>
-
+
* gnu/regexp/RETokenChar.java(chain):
Do not concatenate tokens whose insens flags are diffent.
-
+
2006-01-17 Roman Kennke <kennke@aicas.com>
-
+
* native/target/generic/target_generic_network.c:
(targetGenericNetwork_receive): Fixed signature to match the
corresponding .h file.
(targetGenericNetwork_receiveWithAddressPort): Fixed signature
to match the corresponding .h file.
-
+
2006-01-17 Roman Kennke <kennke@aicas.com>
-
+
* native/jni/classpath/jcl.c:
(JCL_malloc): Replaced calls to malloc with the corresponding
target layer macro.
@@ -25022,9 +34576,9 @@
(targetGenericNetwork_receive): Fixed signature to use signed chars
for buffer parameter to avoid warning when passing a jbyte to the
function.
-
+
2006-01-17 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/text/StyleConstants.java
(getAlignment): Removed isDefined() check, so that resolving parent is
used for lookup,
@@ -25060,9 +34614,9 @@
* gnu/java/net/protocol/http/Request.java
(createResponseBodyStream): Remove Content-Encoding for
compressed streams.
-
+
2006-01-16 Chris Burdess <dog@gnu.org>
-
+
* gnu/xml/stream/XMLParser.java,
gnu/xml/stream/XMLStreamWriterImpl.java: Thoroughly check
XMLStreamWriter arguments for conformance to the XML specifications.
@@ -25116,25 +34670,25 @@
* native/target/generic/Makefile.am: Include new memory and math
layer.
* native/target/posix/Makefile.am: New file. Includes posix in dist.
-
+
2006-01-16 Ito Kazumitsu <kaz@maczuka.gcd.org>
-
+
Fixes bug #22884
* gnu/regexp/RE.java(initialize): Parse embedded flags.
* gnu/regexp/RESyntax.java(RE_EMBEDDED_FLAGS): New syntax bit.
-
+
2006-01-16 Roman Kennke <kennke@aicas.com>
-
+
* native/target/generic/target_generic_network.c: Fixed typo.
* native/target/generic/target_generic_network.h: Fixed typo.
-
+
2006-01-16 Nicolas Geoffray <nicolas.geoffray@menlina.com>
-
+
* doc/vmintegration.texinfo: Updated subsection of the
java.lang.InstrumentationImpl documentation.
-
+
2006-01-16 Roman Kennke <kennke@aicas.com>
-
+
* native/target/RTEMS/target_native.h,
* native/target/RTEMS/target_native_file.h,
* native/target/RTEMS/target_native_io.h,
@@ -25143,9 +34697,9 @@
* native/target/RTEMS/target_native_misc.h,
* native/target/RTEMS/target_native_network.h:
New files. Implement the target native layer for the RTEMS platform.
-
+
2006-01-16 Roman Kennke <kennke@aicas.com>
-
+
* native/target/SunOS/target_native.h,
* native/target/SunOS/target_native_file.h,
* native/target/SunOS/target_native_io.h,
@@ -25154,9 +34708,9 @@
* native/target/SunOS/target_native_misc.h,
* native/target/SunOS/target_native_network.h:
New files. Implement the target native layer for the SunOS platform.
-
+
2006-01-16 Roman Kennke <kennke@aicas.com>
-
+
* native/target/MinGW/target_native.h,
* native/target/MinGW/target_native_file.h,
* native/target/MinGW/target_native_io.h,
@@ -25166,9 +34720,9 @@
* native/target/MinGW/target_native_network.h:
New files. Implement the target native layer for the MinGW
platform.
-
+
2006-01-16 Audrius Meskauskas <AudriusA@Bioinformatics.org>
-
+
PR 25770
* javax/swing/DefaultCellEditor.java
(delegate): Assign new instance immediately.
@@ -25258,13 +34812,13 @@
* native/jni/java-nio/gnu_java_nio_channels_FileChannelImpl.c:
Likewise.
* native/target/generic/target_generic_file.h: Likewise.
-
+
2006-01-16 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/text/MutableAttributeSet.java: Updated API docs all over.
-
+
2006-01-16 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/text/SimpleAttributeSet.java
(SimpleAttributeSet()): Initialise storage directly,
(SimpleAttributeSet(AttributeSet)): Removed null check and documented
@@ -25272,27 +34826,27 @@
(containsAttribute): If key is found locally, don't check resolving
parent if the value doesn't match,
(getAttribute): Removed redundant instanceof and cast.
-
+
2006-01-16 Gary Benson <gbenson@redhat.com>
-
+
* java/lang/System.java (setSecurityManager): Ensure policy
files are loaded before a security manager is put in place.
-
+
2006-01-16 David Gilbert <david.gilbert@object-refinery.com>
-
+
* javax/swing/text/SimpleAttributeSet.java: Updated API docs all over.
-
+
2006-01-16 Wolfgang Baer <WBaer@gmx.de>
-
+
* javax/print/attribute/standard/MediaSize.java:
(static_initializer): Added comment.
(MediaSize): Added javadoc to mention cache registration.
(MediaSize): Likewise.
(MediaSize): Likewise.
(MediaSize): Likewise.
-
+
2006-01-16 Raif S. Naffah <raif@swiftdsl.com.au>
-
+
PR classpath/25202
* gnu/javax/security/auth/login/ConfigFileTokenizer.java: New class.
* gnu/javax/security/auth/login/ConfigFileParser.java: New class.
@@ -25305,6 +34859,19 @@
(getConfig(): replaced calls to NullConfiguration with
GnuConfiguration.
+2006-01-15 Tom Tromey <tromey@redhat.com>
+
+ * javax/swing/text/html/HTMLDocument.java (parseBuffer): Genericized.
+ * javax/swing/text/StyleContext.java (removeAttributes): Genericized.
+ * java/beans/PersistenceDelegate.java (initialize): Genericized.
+ * java/beans/Encoder.java (getPersistenceDelegate): Genericized.
+ (setPersistenceDelegate): Likewise.
+
+2006-01-15 Wolfgang Baer <WBaer@gmx.de>
+
+ * javax/print/attribute/standard/PrinterStateReasons.java:
+ (printerStateReasonSet): Genericize the return type.
+
2006-01-15 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* javax/swing/table/DefaultTableCellRenderer.java
@@ -25321,19 +34888,19 @@
Fixes bug #25387
* javax/print/Doc.java: Added and enhanced documentation.
* javax/print/SimpleDoc.java: New file.
-
+
2006-01-14 Wolfgang Baer <WBaer@gmx.de>
-
+
* javax/print/attribute/standard/MediaSize.java:
(Other.TABLOID): New MediaSize added in 1.5
-
+
2006-01-14 Chris Burdess <dog@gnu.org>
-
+
* gnu/xml/stream/SAXParser.java: Ensure that parser is reset
correctly when I/O and runtime exceptions occur during parsing.
-
+
2006-01-13 Roman Kennke <kennke@aicas.com>
-
+
* gnu/java/awt/peer/swing/SwingButtonPeer.java,
* gnu/java/awt/peer/swing/SwingCanvasPeer.java,
* gnu/java/awt/peer/swing/SwingComponent.java,
@@ -25350,37 +34917,37 @@
* gnu/java/awt/peer/swing/SwingWindowPeer.java,
* gnu/java/awt/peer/swing/package.html:
New files. Implemented some basic AWT peers based on Swing.
-
+
2006-01-13 Roman Kennke <kennke@aicas.com>
-
+
* java/awt/peer/ComponentPeer.java: Added API docs all over.
-
+
2006-01-13 Roman Kennke <kennke@aicas.com>
-
+
* java/awt/MenuComponent.java: Reformatted to better match our
coding style.
-
+
2006-01-13 Roman Kennke <kennke@aicas.com>
-
+
* java/awt/Frame.java: Reformatted to better match our
coding style.
-
+
2006-01-13 Roman Kennke <kennke@aicas.com>
-
+
* java/awt/MenuBar.java
(accessibleContext): Removed unnecessary field. This is already
defined in MenuComponent.
(setHelpMenu): Renamed the peer variable to myPeer because it was
hiding a field of MenuComponent.
(addNotify): Removed unnecessary cast.
-
+
2006-01-13 Roman Kennke <kennke@aicas.com>
-
+
* java/awt/MenuBar.java: Reformatted to better match our
coding style.
-
+
2006-01-13 Roman Kennke <kennke@aicas.com>
-
+
* java/awt/MenuBar.java
(frame): New field.
(removeNotify): Clear frame field when beeing removed from the
@@ -25394,9 +34961,9 @@
dispatchEventImpl() to here.
(dispatchEventImpl): Moved handling of old style events to
dispatchEvent().
-
+
2006-01-13 Roman Kennke <kennke@aicas.com>
-
+
* java/awt/Component.java
(dispatchEvent): Moved handling of old style events from
dispatchEventImpl() to this method.
@@ -25405,14 +34972,14 @@
dispatchEvent().
2006-01-13 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(createDefaultRoot): Removed FIXME.
(setLogicalStyle): Added fireUndoableEditUpdate call and
removed FIXME.
-
+
2006-01-13 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java
(Edit): New inner class.
(changeUpdate): Changed addEdit call to add a new
@@ -25424,9 +34991,9 @@
(insertContentTag): Likewise.
(insert): Added loop to go through edits Vector and perform
addEdit on each object.
-
+
2006-01-13 Chris Burdess <dog@gnu.org>
-
+
* gnu/xml/transform/AbstractNumberNode.java,
gnu/xml/transform/ApplyImportsNode.java,
gnu/xml/transform/ApplyTemplatesNode.java,
@@ -25464,9 +35031,9 @@
* doc/www.gnu.org/announce/20060113.wml: New file.
* doc/www.gnu.org/newsitems.txt: Add 0.20 release announcement.
* doc/www.gnu.org/downloads/downloads.wml: Add 0.20.
-
+
2006-01-13 Lillian Angel <langel@redhat.com>
-
+
* javax/swing/text/DefaultStyledDocument.java:
Removed unused fields.
(insert): Removed unused fields.
@@ -25476,17 +35043,22 @@
(insertContentTag): Removed call to prepareContentInsertion.
(printElements): Removed, not needed.
(attributeSetsAreSame): Removed, not needed.
+
+2005-01-13 Mark Wielaard <mark@klomp.org>
-2006-01-13 Mark Wielaard <mark@klomp.org>
+ * java/lang/reflect/Modifier.java (toString(int, StringBuffer)):
+ Duplicate of toString(int, StringBuilder).
+
+2005-01-13 Mark Wielaard <mark@klomp.org>
* configure.ac: Set version to 0.20.
* NEWS: Add entries for all the new work done.
-2006-01-13 Mark Wielaard <mark@klomp.org>
+2005-01-13 Mark Wielaard <mark@klomp.org>
* javax/swing/text/DefaultCaret.java: Chain all AssertionErrors.
-2006-01-13 Mark Wielaard <mark@klomp.org>
+2005-01-13 Mark Wielaard <mark@klomp.org>
* java/util/regex/Pattern.java (Pattern): Chain REException.
@@ -25494,19 +35066,19 @@
* gnu/xml/xpath/NameTest.java: Removed debugging output.
-2006-01-13 Jeroen Frijters <jeroen@frijters.net>
+2005-01-13 Jeroen Frijters <jeroen@frijters.net>
* java/security/Security.java
(getProperty): Added hack to skip security check when trusted
code is direct caller.
-2006-01-13 Jeroen Frijters <jeroen@frijters.net>
+2005-01-13 Jeroen Frijters <jeroen@frijters.net>
* java/io/PrintStream.java
(line_separator, PrintStream(OutputStream,boolean)): Use
SystemProperties.
-2006-01-13 Jeroen Frijters <jeroen@frijters.net>
+2005-01-13 Jeroen Frijters <jeroen@frijters.net>
* gnu/java/nio/charset/Provider.java: Added comment about its
special relation with CharsetProvider.
@@ -25518,12 +35090,12 @@
(CharsetProvider): Add special case to skip security check for
built in providers.
-2006-01-13 Mark Wielaard <mark@klomp.org>
+2005-01-13 Mark Wielaard <mark@klomp.org>
* javax/swing/JMenuItem.java (JMenuItem(Action)): Check whether
name, accel, mnemonic and command are defined before setting.
-2006-01-12 Mark Wielaard <mark@klomp.org>
+2005-01-12 Mark Wielaard <mark@klomp.org>
* javax/swing/plaf/metal/MetalFileChooserUI.java
(FileRenderer.getListCellRendererComponent): Set empty name and null
@@ -26610,3 +36182,4 @@
* java/net/InetAddress.java (getAllByName): use LOCALHOST if
localhost is null or is an empty string. Trim hostname before
lookup.
+
diff --git a/libjava/classpath/ChangeLog-2004 b/libjava/classpath/ChangeLog-2004
index 2f2a97129e4..58e8d1e0459 100644
--- a/libjava/classpath/ChangeLog-2004
+++ b/libjava/classpath/ChangeLog-2004
@@ -1598,6 +1598,14 @@
* javax/swing/plaf/basic/BasicComboBoxUI.java:
(paintCurrentValue): renders "" if no item is selected
+2004-12-18 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/String.java (String(StringBuilder)): Rewrote.
+ * java/lang/StringBuilder.java (shared): Removed.
+ (ensureCapacity): Updated.
+ (substrinng): Likewise.
+ (toString): Likewise.
+
2004-12-17 Michael Koch <konqueror@gmx.de>
* gnu/java/locale/LocaleInformation_de.java,
@@ -2608,47 +2616,47 @@
change event.
2004-11-28 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/awt/peer/gtk/GdkGraphics2D.java: Fix typo.
-
+
2004-11-27 Sven de Marothy <sven@physto.se>
-
+
* gnu/java/awt/peer/gtk/GdkGraphics2D.java
- Reformatted.
- (drawRaster): Added FIXME.
- (drawRaster): Changed to work with packed-sample models.
-
+ Reformatted.
+ (drawRaster): Added FIXME.
+ (drawRaster): Changed to work with packed-sample models.
+
2004-11-26 Michael Koch <konqueror@gmx.de>
-
+
* javax/swing/JList.java, javax/swing/JTree.java:
Added much new methods and fixed much methods setting bound properties.
-
+
2004-11-26 Sven de Marothy <sven@physto.se>
-
- * gnu/java/awt/peer/gtk/GdkGraphics2D.java
- (drawRaster): Set alpha component to opaque if image has no alpha
+
+ * gnu/java/awt/peer/gtk/GdkGraphics2D.java
+ (drawRaster): Set alpha component to opaque if image has no alpha
2004-11-26 Jeroen Frijters <jeroen@frijters.net>
-
+
* java/io/File.java
(canWrite): Moved directory write test to VMFile.
* vm/reference/java/io/VMFile.java
(canWriteDirectory): New method.
-
+
2004-11-25 Sven de Marothy <sven@physto.se>
-
+
* java/awt/image/MultiPixelPackedSampleModel.java
(MultiPixelPackedSampleModel): Corrected parameters, order of bit
shifts and masks, stride length off by one.
-
+
2004-11-25 Sven de Marothy <sven@physto.se>
-
+
* java/awt/image/IndexColorModel.java
(IndexColorModel): Add FIXME with respect to alpha handling.
(getAlpha): Default to returning opaque pixels.
-
+
2004-11-25 Mark Wielaard <mark@klomp.org>
-
+
* doc/vmintegration.texinfo: Fix link to Japhar.
* doc/www.gnu.org/stories.wml: Likewise.
* doc/www.gnu.org/announce/19990206.wml: Likewise.
@@ -2668,91 +2676,91 @@
getAccessibleContext): Implement.
(TextComponent): Extends Accessible.
(getIndexAtPoint, getCharacterBounds): New methods.
-
+
2004-11-23 Jerry Quinn <jlquinn@optonline.net>
-
+
* java/awt/Button.java
(AccessibleAWTButton.getAccessibleActionDescription): Explain the
source of 'click'.
-
+
2004-11-23 Jerry Quinn <jlquinn@optonline.net>
-
+
* java/awt/Checkbox.java: Remove stub comments.
-
+
2004-11-23 Jerry Quinn <jlquinn@optonline.net>
-
+
* java/awt/Button.java
(AccessibleAWTButton.getAccessibleActionDescription): Return
'click'.
-
+
2004-11-23 Jerry Quinn <jlquinn@optonline.net>
-
+
* java/awt/Checkbox.java (AccessibleAWTCheckBox): Remove todo
comments.
-
+
2004-11-23 Jerry Quinn <jlquinn@optonline.net>
-
+
* java/awt/Checkbox.java (itemStateChanged): Implement function.
(getAccessibleContext): Add AccessibleAWTCheckBox to item listeners.
2004-11-23 Jerry Quinn <jlquinn@optonline.net>
-
+
* java/awt/TextArea.java (AccessibleAWTTextArea,
getAccessibleContext): Implement.
* java/awt/TextField.java (AccessibleAWTTextField,
getAccessibleContext): Implement.
-
+
2004-11-23 Jerry Quinn <jlquinn@optonline.net>
-
+
* java/awt/Checkbox.java (AccessibleAWTCheckBox): Implement.
(getAccessibleContext): Implement.
2004-11-23 Jerry Quinn <jlquinn@optonline.net>
-
+
* java/awt/MenuItem.java (AccessibleAWTMenuItem): Implement.
-
+
2004-11-23 Jerry Quinn <jlquinn@optonline.net>
-
+
* java/awt/Choice.java (AccessibleAWTChoice): Implement.
-
+
2004-11-23 Jerry Quinn <jlquinn@optonline.net>
-
+
* java/awt/MenuItem.java (AccessibleAWTMenuItem): Implement.
-
+
2004-11-23 Michael Koch <konqueror@gmx.de>
-
+
* javax/swing/DefaultSingleSelectionModel.java,
javax/swing/JPasswordField.java,
javax/swing/tree/AbstractLayoutCache.java:
Reformatted and javadocs cleaned up.
-
+
2004-11-23 Michael Koch <konqueror@gmx.de>
-
+
* java/nio/channels/spi/AbstractSelectableChannel.java
(register): Only reuse valid selection keys.
-
+
2004-11-23 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/nio/NIOServerSocket.java
(getPlainSocketImpl): Removed debug code.
-
+
2004-11-23 Michael Koch <konqueror@gmx.de>
-
+
* java/awt/Component.java:
Fixed argument names to match javadocs.
(setFont): Rewritten set property first and then fire event.
(setLocale): Likewise.
* javax/swing/text/JTextComponent.java
(setEditable): Likewise.
-
+
2004-11-23 Michael Koch <konqueror@gmx.de>
-
+
* java/util/zip/InflaterInputStream.java
(onebytebuffer): Little reformatting to match libgcj's version.
(read): Likewise.
-
+
2004-11-23 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/nio/NIOServerSocket.java
(getPlainSocketImpl): Implemented in java with reflection.
* include/gnu_java_nio_NIOServerSocket.h,
@@ -2761,20 +2769,20 @@
Don't generate include/gnu_java_nio_NIOServerSocket.h.
* native/jni/java-nio/Makefile.am:
Don't build native/jni/java-nio/gnu_java_nio_NIOServerSocket.c.
-
+
2004-11-22 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/nio/SocketChannelImpl.java
(read): Made check for blocking un-ambiguous.
Removed wrong check for data array length.
-
+
2004-11-22 Patrik Reali <reali@acm.org>
-
+
* doc/www.gnu.org/newsitems.txt doc/www.gnu.org/announce/20041115.wml
doc/www.gnu.org/downloads/downloads.wml: classpath 0.12 announcement
-
+
2004-11-21 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/nio/SocketChannelImpl.java
(read): Only return 0 when no bytes for reading available in
non-blocking mode.
@@ -2787,9 +2795,9 @@
(propertyChangeSupportSerializedDataVersion): Made static.
* java/beans/VetoableChangeSupport.java
(propertyChangeSupportSerializedDataVersion): Likewise.
-
+
2004-11-21 Michael Koch <konqueror@gmx.de>
-
+
* java/awt/CardLayout.java:
Made some constants static.
(serialVersionUID): Made private.
@@ -2798,20 +2806,20 @@
(getModifiersEx): Added missing @param tag.
* java/awt/image/RGBImageFilter.java
(filterRGBPixels): Reformatted, removed wrong @param tag.
-
+
2004-11-21 Michael Koch <konqueror@gmx.de>
-
+
* java/net/URLConnection.java
(getContent): Added missing @return tag.
-
+
2004-11-21 Michael Koch <konqueror@gmx.de>
-
+
* javax/swing/text/FieldView.java,
javax/swing/text/JTextComponent.java:
Removed debug code.
-
+
2004-11-21 Jeroen Frijters <jeroen@frijters.net>
-
+
* java/nio/DirectByteBufferImpl.java
(ReadOnly): New inner subclass.
(ReadWrite): New inner subclass.
@@ -2828,17 +2836,17 @@
* java/nio/MappedByteBufferImpl.java
(slice, duplicate): Modified to instantiate appropriate
DirectByteBufferImpl subclass.
-
+
2004-11-21 Michael Koch <konqueror@gmx.de>
-
+
* javax/swing/BorderFactory.java
(BorderFactory): Added private constructor.
* javax/swing/SwingUtilities.java
(SwingUtilities): Likewise.
(computeStringWidth): New method.
-
+
2004-11-21 Michael Koch <konqueror@gmx.de>
-
+
* java/awt/color/ICC_Profile.java
(icSigNamedColorTag): Removed.
* java/awt/datatransfer/DataFlavor.java
@@ -2846,9 +2854,9 @@
* java/awt/image/AffineTransformOp.java:
Reworked javadocs.
(TYPE_BICUBIC): Added @since tag.
-
+
2004-11-21 Michael Koch <konqueror@gmx.de>
-
+
* gnu/classpath/RawData.java: Made abstract.
* gnu/classpath/RawData32.java,
gnu/classpath/RawData64.java: New files.
@@ -2869,14 +2877,14 @@
* native/jni/java-nio/java_nio_VMDirectByteBuffer.c,
* vm/reference/java/nio/VMDirectByteBuffer.java:
New files.
-
+
2004-11-20 Tom Tromey <tromey@redhat.com>
-
+
* java/util/ResourceBundle.java (tryBundle): Use
Class.isAssignableFrom rather than catching ClassCastException.
-
+
2004-11-20 Bryce McKinlay <mckinlay@redhat.com>
-
+
* java/util/ResourceBundle.java (bundleCache): Renamed from
resourceBundleCache. Update comments.
(getObject): Don't catch MissingResourceException.
@@ -2892,9 +2900,9 @@
name using given classloader.
(tryBundle(String, Locale, ClassLoader, boolean): New. Qualify
baseName for given Locale and attempt to load bundle.
-
+
2004-11-18 Jeroen Frijters <jeroen@frijters.net>
-
+
* gnu/java/io/decode/DecoderUTF8.java
(charsInByteArray, convertToChars, read): Added surrogate pair
support.
@@ -2935,96 +2943,96 @@
(OutputStreamWriter): Removed call to Encoder.setBadCharValue().
* java/lang/String.java: Removed try/catch block around
Encoder/Decoder calls that no longer throw CharConversionException.
-
+
2004-11-17 Michael Koch <konqueror@gmx.de>
-
+
* java/awt/print/PrinterJob.java: Reformatted.
-
+
2004-11-17 Jerry Quinn <jlquinn@optonline.net>
-
+
* java/awt/print/PrinterJob.java (lookupPrintServices,
getPrintService, setPrintService): Implement.
(lookupStreamPrintServices): Add commented out implementation.
(printer): New field.
-
+
2004-11-17 Michael Koch <konqueror@gmx.de>
-
+
* java/net/Socket.java (getPort): Return 0 in error case.
-
+
2004-11-17 Michael Koch <konqueror@gmx.de>
-
+
* java/nio/DirectByteBufferImpl.java
(owner): Updated comment.
(allocate): New method.
-
+
2004-11-17 Michael Koch <konqueror@gmx.de>
-
+
* java/net/URL.java (URL): Handle case when argument is null.
-
+
2004-11-17 Michael Koch <konqueror@gmx.de>
-
+
* java/beans/Beans.java,
java/beans/PropertyChangeEvent.java,
java/beans/PropertyEditorSupport.java:
Fixed javadocs.
-
+
2004-11-17 Michael Koch <konqueror@gmx.de>
-
+
* java/util/Timer.java (DEFAULT_SIZE): Made static.
-
+
2004-11-17 Michael Koch <konqueror@gmx.de>
-
+
* java/awt/image/AffineTransformOp.java,
java/awt/image/ColorConvertOp.java,
java/awt/image/LookupOp.java,
java/awt/image/RescaleOp.java:
Added final keywords where they belong.
-
+
2004-11-17 Michael Koch <konqueror@gmx.de>
-
+
* java/awt/CardLayout.java,
java/awt/Component.java,
java/awt/Font.java,
java/awt/image/SinglePixelPackedSampleModel.java:
Fixed javadocs and argument names all over.
-
+
2004-11-17 Michael Koch <konqueror@gmx.de>
-
+
* java/awt/image/DataBufferShort.java: Fixed file header.
* java/awt/image/DataBufferUShort.java: Likewise.
(DataBufferUShort): Throw NullPointerException if dataArray is null.
-
+
2004-11-17 Michael Koch <konqueror@gmx.de>
-
+
* java/net/InetAddress.java (getCanonicalHostName):
Support IPv6 addresses.
-
+
2004-11-17 Sven de Marothy <sven@physto.se>
-
+
* java/awt/geom/Arc2D.java,
(setAngleStart): Corrected (wrong sign on atan2 y parameter)
(setAngles): Likewise
(containsAngle): Return false on zero extent, don't include final angle
(contains): Treat OPEN-type arcs like CHORD ones, not as PIE ones.
-
+
2004-11-16 Sven de Marothy <sven@physto.se>
-
+
* java/awt/geom/AffineTransform.java,
(inverseTransform): Fixed bug and simplified code.
(createTransformedShape): Return null on null parameter.
-
+
2004-11-16 Michael Koch <konqueror@gmx.de>
-
+
* java/util/Collections.java (synchronizedSortedMap):
Removed some cruft in javadoc.
-
+
2004-11-16 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/locale/LocaleInformation_de.java:
Added some new locale informations to the contents object.
-
+
2004-11-16 Michael Koch <konqueror@gmx.de>
-
+
* java/io/BufferedReader.java,
java/io/FileInputStream.java,
java/io/FileOutputStream.java,
@@ -3045,9 +3053,9 @@
java/nio/ByteOrder.java,
java/nio/channels/Channel.java:
Fixed javadocs all over.
-
+
2004-11-16 Michael Koch <konqueror@gmx.de>
-
+
* java/awt/color/ICC_ColorSpace.java,
java/awt/color/ICC_Profile.java,
java/awt/color/ICC_ProfileGray.java,
@@ -3059,22 +3067,22 @@
(EPSILON): Made static.
(RS_EPSILON): Likewise.
(PE_EPSILON): Likewide.
-
+
2004-11-16 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/locale/LocaleInformation_de.java:
Fix compile error.
-
+
2004-11-16 Sven de Marothy <sven@physto.se>
-
+
* javax/swing/SwingUtilities.java:
(computeDifference): Implemented
(computeIntersection): Likewise
(computeUnion): Likewise
(isRectangleContainingRectangle): Likewise
-
+
2004-11-16 Michael Koch <konqueror@gmx.de>
-
+
* java/awt/BasicStroke.java,
java/awt/Button.java,
java/awt/Canvas.java,
@@ -3108,50 +3116,50 @@
java/awt/image/ShortLookupTable.java,
java/awt/print/Book.java:
Fixed javadocs and method argument names all over.
-
+
2004-11-16 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/locale/LocaleInformation_de.java: Reordered entries in
contents array, added support for ap/pm and territorial names.
-
+
2004-11-16 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/locale/LocaleInformation_de.java: Reformatted. Replaced
some definitions with their generated counterparts.
-
+
2004-11-16 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/locale/LocaleInformation_de.java: Removed some comments to
make it easier to merge this with the new generated classes.
-
+
2004-11-16 Michael Koch <konqueror@gmx.de>
-
+
* configure.ac: Added scripts/Makefile to output files.
* Makefile.am (SUBDIRS): Add scripts
* scripts/Makefile.am: New file.
-
+
2004-11-16 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/awt/peer/gtk/GdkFontPeer.java
(buildString): Optimise String building.
-
+
2004-11-15 Michael Koch <konqueror@gmx.de>
-
+
* native/jni/Makefile.am: Add checking of JNI methods.
* scripts/check_jni_methods.sh: New file.
-
+
2004-11-15 Michael Koch <konqueror@gmx.de>
-
+
* acinclude.m4 (CLASSPATH_WITH_GLIBJ): Added support to not build the
class files/glibj.zip. Handle --disable-examples argument.
* Makefile.am: Build examples subdir conditionally.
-
+
2004-11-15 Craig Black <craig.black@aonix.com>
-
+
* gnu/java/beans/BeanInfoEmbryo.java: Use TreeMap for proper sorting.
-
+
2004-11-15 Jeroen Frijters <jeroen@frijters.net>
-
+
* java/lang/StackTraceElement.java: Made final.
* java/nio/channels/Channels.java: Added private constructor.
* java/rmi/Naming.java: Added private constructor.
@@ -3195,42 +3203,42 @@
(SynchronizedPrintRequestAttributeSet): Made private.
(SynchronizedPrintServiceAttributeSet): Made private.
* javax/security/auth/PrivateCredentialPermission.java: Made final.
-
+
2004-11-14 Mark Wielaard <mark@klomp.org>
-
+
* configure.ac: Set version to 0.12+cvs.
-
+
2004-11-14 Mark Wielaard <mark@klomp.org>
-
+
* configure.ac: Set version to 0.12.
* NEWS: Add new items for this release.
-
+
2004-11-14 Mattias Rehnberg <Mattias.Rehnberg@home.se>
-
+
* java/net/Inet6Address.java (getHostAddress): Fix textual
representation of IPv6 address with embedded zeroes
to conform to RFC 2373.
-
+
2004-11-14 Mark Wielaard <mark@klomp.org>
-
+
* configure.ac (--disable-Werror): Make no the default.
-
+
2004-11-14 Mark Wielaard <mark@klomp.org>
-
+
* javax/swing/ToolTipManager.java (mouseMoved): Set currentComponent
when not yet set.
-
+
2004-11-13 Robert Schuster <thebohemian@gmx.net>
-
+
Complete 1.4 support
* java/beans/PropertyDescriptor.java:
(setReadMethod): New method
(setWriteMethod): New method
(equals): Implemented (1.4)
(checkMethods): operates on arguments now (private)
-
+
2004-11-12 Steven Augart <augart@watson.ibm.com>
-
+
* gnu/classpath/Configuration.java.in: Added
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION.
* configure.ac: Added
@@ -3239,29 +3247,29 @@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION.
2004-11-12 Sven de Marothy <sven@physto.se>
-
+
* java/awt/Polygon.java (contains): Reimplemented.
-
+
2004-11-11 Mark Wielaard <mark@klomp.org>
-
+
* gnu/java/awt/peer/gtk/GdkGraphics2D.java: Indentation fixups.
* gnu/java/awt/peer/gtk/GtkToolkit.java: Likewise.
-
+
2004-11-11 Paul Jenner <psj.home@ntlworld.com>
-
+
* java/awt/image/Raster.java
(createPackedRaster): Implemented.
-
+
2004-11-11 Mark Wielaard <mark@klomp.org>
-
+
* javax/swing/plaf/basic/BasicTableHeaderUI.java: Indentation fixups.
* javax/swing/plaf/basic/BasicViewportUI.java: Likewise.
* javax/swing/text/PlainDocument.java: Likewise.
* javax/swing/text/SimpleAttributeSet.java: Likewise.
* javax/swing/text/Utilities.java: Likewise.
-
+
2004-11-11 Graydon Hoare <graydon@redhat.com>
-
+
* javax/swing/plaf/basic/BasicTextUI.java:
Listen to focus events, indicate focus via caret.
* javax/swing/text/GapContent.java (getString): Return substring.
@@ -3271,14 +3279,14 @@
(removeUpdate): Likewise.
* javax/swing/text/Utilities.java (drawTabbedText): Always advance
on tab and newline, even if no painting happens.
-
+
2004-11-11 Thomas Fitzsimmons <fitzsim@redhat.com>
-
+
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c (setFont):
Set pango context's description and language.
-
+
2004-11-11 Mark Wielaard <mark@klomp.org>
-
+
* include/gnu_java_awt_peer_gtk_GdkFontMetrics.h: Regenerated.
* include/gnu_java_awt_peer_gtk_GdkGraphics.h: Likewise.
* include/gnu_java_awt_peer_gtk_GtkClipboard.h: Likewise.
@@ -3288,9 +3296,9 @@
* include/java_lang_Math.h: Likewise.
* include/java_lang_VMProcess.h: Likewise.
* include/java_net_InetAddress.h: Likewise.
-
+
2004-11-11 Graydon Hoare <graydon@redhat.com>
-
+
* gnu/java/awt/peer/gtk/GdkGraphics2D.java
(GdkGraphics2D): Set clip after transform.
(drawImage): Protect against null image.
@@ -3406,14 +3414,14 @@
(capitalize): added documentation
(DoubleKey): [class] added documentation
(isReachable): new method, refactoring of a large expression
-
+
2004-11-08 Jeroen Frijters <jeroen@frijters.net>
-
+
* java/net/URLStreamHandler.java
(parseURL): Fixed file path canonicalisation.
-
+
2004-11-08 Jeroen Frijters <jeroen@frijters.net>
-
+
* java/io/File.java:
(createTempFile): Use VMFile.IS_DOS_8_3 instead of separatorChar
to determine file system naming restrictions.
@@ -3512,9 +3520,9 @@
* gnu/java/security/pkcs/PKCS7SignedData.java,
* gnu/java/security/pkcs/SignerInfo.java:
new files.
-
+
2004-11-07 Casey Marshall <csm@gnu.org>
-
+
* gnu/java/security/provider/Gnu.java
(<init>): add entries in a priviliged action.
Add new algorithms.
@@ -3567,29 +3575,29 @@
* gnu/java/security/x509/ext/SubjectAlternativeNames.java,
* gnu/java/security/x509/ext/SubjectKeyIdentifier.java:
new files.
-
+
2004-11-07 Sven de Marothy <sven@physto.se>
-
+
* java/awt/geom/GeneralPath.java (evaluateCrossings):
Fixed epsilon value, should always be nonzero.
-
+
2004-11-07 Jerry Quinn <jlquinn@optonline.net>
-
+
* java/awt/image/BandedSampleModel.java (scanlineStride): Remove
field hiding ComponentSampleModel.scanlineStride.
-
+
2004-11-06 Thomas Fitzsimmons <fitzsim@redhat.com>
-
+
* java/awt/DefaultKeyboardFocusManager.java (dispatchEvent):
Track Window focus owner on FOCUS_GAINED events.
-
+
2004-11-06 Tom Tromey <tromey@redhat.com>
-
+
* doc/hacking.texinfo (Source Code Style Guide): Fixed
grammatical error.
-
+
2004-11-06 Tom Tromey <tromey@redhat.com>
-
+
* gnu/java/rmi/server/UnicastConnectionManager.java (clients): Now
package-private.
(connections): Likewise.
@@ -3601,16 +3609,16 @@
(ptr): Likewise.
* gnu/java/security/PolicyFile.java (debug): Now package-private.
* gnu/classpath/ServiceFactory.java (log): Now package-private.
-
+
2004-11-06 Tom Tromey <tromey@redhat.com>
-
+
* javax/naming/directory/BasicAttributes.java (attributes): Now
package-private.
* javax/imageio/spi/ServiceRegistry.java (categories): Now
package-private.
-
+
2004-11-06 Tom Tromey <tromey@redhat.com>
-
+
* java/net/URLClassLoader.java (URLClassLoader): Now
package-private.
* java/nio/charset/CoderResult.java (CoderResult): Now
@@ -3620,27 +3628,27 @@
* java/rmi/server/RMIClassLoader.java (MyClassLoader): Now
package-private.
* java/util/TimeZone.java (timezones): Now package-private.
-
+
2004-11-06 Tom Tromey <tromey@redhat.com>
-
+
* java/security/Permissions.java (perms): Now package-private.
* java/security/UnresolvedPermission.java (permissions): Now
package-private.
-
+
2004-11-06 Tom Tromey <tromey@redhat.com>
-
+
* java/io/FilePermission.java: Reindented.
-
+
2004-11-06 Tom Tromey <tromey@redhat.com>
-
+
* java/io/ObjectOutputStream.java (currentObjectStreamClass): Now
package-private.
(setBlockDataMode): Likewise.
* java/io/DeleteFileHelper.java (DeleteFileHelper): Now
package-private.
-
+
2004-11-06 Tom Tromey <tromey@redhat.com>
-
+
* gnu/java/nio/charset/ISO_8859_1.java (Decoder): Now
package-private.
(Encoder): Likewise.
@@ -3649,9 +3657,9 @@
* gnu/java/nio/charset/US_ASCII.java (Decoder): Now
package-private.
(Encoder): Likewise.
-
+
2004-11-06 Robert Schuster <theBohemian@gmx.net>
-
+
Fixes bug #10908
* gnu/java/beans/IntrospectionIncubator.java:
(addMethod): static methods are discarded now, too.
@@ -3678,126 +3686,176 @@
* java/awt/image/BandCombineOp.java,
java/awt/image/LookupOp.java,
java/awt/image/ConvolveOp.java: New classes.
-
+
2004-11-06 Andrew Haley <aph@redhat.com>
-
+
* java/io/ObjectInputStream.java
(readObject): ENDBLOCKDATA is generated if the class has a write
method, not if it has a read method.
-
+
2004-11-06 Mark Wielaard <mark@klomp.org>
-
+
* java/util/Vector.java (readObject): Removed.
-
+
2004-11-06 Tom Tromey <tromey@redhat.com>
-
+
* gnu/java/net/protocol/http/Connection.java (sendRequest): Fix
typo.
-
+
2004-11-06 Michael Koch <konqueror@gmx.de>
-
+
PR libjava/14009
* gnu/java/net/protocol/http/Connection.java
(sendRequest): Handle case when url.getFile() returns an empty string.
-
+
2004-11-06 Patrik Reali <reali@acm.org>
-
+
* doc/www.gnu.org/newsitems.txt: JDK 1.0 compatibility news
+
+2004-11-06 Tom Tromey <tromey@redhat.com>
-2004-11-05 Noa Resare <noa@resare.com>
+ * java/lang/Void.java (TYPE): Added cast to initializer.
+ * java/lang/Short.java (TYPE): Added cast to initializer.
+ * java/lang/Long.java (TYPE): Added cast to initializer.
+ * java/lang/Integer.java (TYPE): Added cast to initializer.
+ * java/lang/Float.java (TYPE): Added cast to initializer.
+ * java/lang/Double.java (TYPE): Added cast to initializer.
+ * java/lang/Character.java (TYPE): Added cast to initializer.
+ * java/lang/Byte.java (TYPE): Added cast to initializer.
+ * java/lang/Boolean.java (TYPE): Added cast to initializer.
+ * java/util/Hashtable.java (elements): Fixed return type.
+2004-11-05 Noa Resare <noa@resare.com>
+
* java/net/Socket.java(getPort): Return 0 instead of -1 on
unconnected sockets.
-
+
2004-11-05 Sven de Marothy <sven@physto.se>
* gnu/java/awt/peer/gtk/GtkComponentPeer.java
(createImage): Created bitmap should be filled with bg color
-
+
2004-11-04 Torsten Rupp <rupp@aicas.com>
-
+
* native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c:
Replaced 'this' arguments by 'obj' to make source compatible with
C++ compilers.
-
+
2004-11-04 Torsten Rupp <rupp@aicas.com>
-
+
* native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c:
Add dummy return values for WITHOUT_NETWORK code path.
(Java_gnu_java_net_PlainDatagramSocketImpl_receive0): Check fid not
NULL for maxlen field id.
-
+
2004-11-04 Torsten Rupp <rupp@aicas.com>
-
+
* native/jni/java-net/gnu_java_net_PlainSocketImpl.c: Added missing
return values for WITHOUT_NETWORK code path.
-
+
2004-11-03 Tom Tromey <tromey@redhat.com>
-
+
* Makefile.am (EXTRA_DIST): Added ChangeLog-2003.
-
+
2004-11-03 Tom Tromey <tromey@redhat.com>
-
+
* include/jni.h (struct JNINativeInterface) <NewObjectArray>: Now
returns jobjectArray.
(_Jv_JNIEnv::NewObjectArray): Likewise.
+
+2004-11-03 Tom Tromey <tromey@redhat.com>
+
+ * java/util/Collection.java (iterator): Fixed return type.
+
+ * java/util/AbstractSet.java (removeAll): Fixed iterator
+ declaration.
+ * java/util/AbstractList.java (RandomAccessSubList): RandomAccess
+ is not generic.
2004-11-02 Mattias Rehnberg <Mattias.Rehnberg@home.se>
* java/io/Vector.java
(readObject, writeObject): New function to match Sun's
serialized output for Vector.
-
- * java/io/ObjectOutputStream.java
+
+ * java/io/ObjectOutputStream.java
(writeObject): Move the assignment of the class handle to after
the assignment of class descriptor handle.
-
+
2004-11-02 Thomas Fitzsimmons <fitzsim@redhat.com>
-
+
* java/awt/Font.java (name): New field.
(size): Likewise.
(style): Likewise.
-
+
2004-11-01 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
+
* java/util/GregorianCalendar.java:
Added/amended documentation.
2004-11-01 Jeroen Frijters <jeroen@frijters.net>
-
+
* java/lang/ClassLoader.java:
(addFileURL): New method.
(getSystemClassLoaderUrls): Fixed to treat lone separators as
current directory.
+
+2004-11-01 Tom Tromey <tromey@redhat.com>
-2004-10-31 Robert Schuster <thebohemian@gmx.net>
+ * java/util/AbstractMap.java: Removed old FIXME comment.
+ * java/lang/Long.java (rotateRight): Fixed return type.
+ * java/lang/Integer.java (reverse): Use correct name for
+ variable.
+ * java/lang/Character.java (valueOf): Use MIN_VALUE, not
+ MIN_CACHE.
+ * java/lang/Byte.java (valueOf): Use MIN_VALUE, not MIN_CACHE.
+
+ * gnu/java/util/DoubleEnumeration.java: Genericized.
+
+ * java/lang/Appendable.java (append): Throws IOException.
+
+ * java/util/Hashtable.java: Genericized.
+
+ * java/util/HashMap.java (putAll): Use correct type for iterator.
+ (putAllInternal): Likewise.
+ * java/lang/Class.java (cast): Call VMClass.cast.
+ * java/util/Collections.java (UnmodifiableMap.remove): Corrected
+ return type.
+ (entrySet): Likewise.
+ (entries): Corrected type.
+
+ * vm/reference/java/lang/reflect/Constructor.java
+ (getTypeParameters): Stubbed.
+
+2004-10-31 Robert Schuster <thebohemian@gmx.net>
+
Fixes documentation and indentation
* java/beans/PropertyEditorSupport.java:
reworked initial API doc
(value): changed name from val
-
+
2004-10-31 Robert Schuster <thebohemian@gmx.net>
-
+
Updates to 1.5
* java/beans/PropertyEditorSupport.java
(PropertyEditorSupport()): Changed modifier to public
(PropertyEditorSupport(Object): Changed modifier to public
(setSource): New method
(getSource): New method
-
+
2004-10-31 Robert Schuster <thebohemian@gmx.net>
-
+
Fixes bug #10799
* java/beans/PropertyEditorSupport.java
(setValue): Fire property change event
-
+
2004-10-31 Noa Resare <noa@resare.com>
-
+
* java/util/Calendar.java (explicitDSTOffset): New instance field.
(set(int,int)): Set and use new field.
(set(int,int,int)): Check new field.
-
+
2004-10-29 Jerry Quinn <jlquinn@optonline.net>
* java/awt/image/ColorConvertOp.java: New class.
@@ -3956,36 +4014,36 @@
2004-10-26 Andreas Tobler <a.tobler@schweiz.ch>
- * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
- (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Use the
- GTK_TEXT_VIEW macro.
-
- * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
- (connect_awt_hook_cb): Mark unused variable unused.
-
- * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Use the
+ GTK_TEXT_VIEW macro.
+
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+ (connect_awt_hook_cb): Mark unused variable unused.
+
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
(selection_get): Do the cast right.
-
- * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
- (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): According to
- the gtk API gtk_combo_box_new_text actually returns a GtkWidget.
- Remove unused var menu.
- (selection_changed): Remove unused value.
-
- * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
- (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_setNativeBounds): Fix pointer
- warning with using an intermediate variable.
-
- * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
- (area_updated): Fix unused var warning for BE archs.
-
- * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
- (Java_gnu_java_awt_peer_gtk_GdkGraphics_connectSignals): Remove unused
- var.
- (realize_cb): Mark unused variable unused.
-
- * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
- (seek_glyphstring_idx): Fix a C90 warning.
+
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): According to
+ the gtk API gtk_combo_box_new_text actually returns a GtkWidget.
+ Remove unused var menu.
+ (selection_changed): Remove unused value.
+
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_setNativeBounds): Fix pointer
+ warning with using an intermediate variable.
+
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
+ (area_updated): Fix unused var warning for BE archs.
+
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
+ (Java_gnu_java_awt_peer_gtk_GdkGraphics_connectSignals): Remove unused
+ var.
+ (realize_cb): Mark unused variable unused.
+
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
+ (seek_glyphstring_idx): Fix a C90 warning.
2004-10-26 Andreas Tobler <a.tobler@schweiz.ch>
@@ -4749,7 +4807,7 @@
2004-10-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
- * java/util/Currency.java:
+ * java/util/Currency.java
Documented variables and methods more fully.
Caches the currency instances, so that a request
for a locale, l, only ever returns the same
@@ -4758,11 +4816,11 @@
2004-10-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
- * java/util/Collections.java:
+ * java/util/Collections.java
Added documentation.
- * java/util/SortedMap.java:
+ * java/util/SortedMap.java
Clarified some method examples.
- * java/util/SortedSet.java:
+ * java/util/SortedSet.java
Clarified some method examples.
2004-10-20 Michael Koch <konqueror@gmx.de>
@@ -5167,6 +5225,13 @@
* autogen.sh: Replaced with a GNOME-like script that aborts when the
versions of autoconf, automake or libtool are not sufficient.
+
+2004-10-14 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/StringBuilder.java (append): Typo fix; indentation
+ fix.
+ * java/beans/BeanDescriptor.java (BeanDescriptor): Typo fix.
+
2004-10-13 Michael Koch <konqueror@gmx.de>
* java/awt/image/ByteLookupTable.java
@@ -5378,10 +5443,10 @@
2004-10-10 Sven de Marothy <sven@physto.se>
- * native/jni/java-lang/java_lang_Double.c
- (parseDouble): Add handling of NaN/Infinity (bug #10491)
- * java/nio/ByteBufferHelper.java
- (putDouble): Use Double.toRawLongBits instead (bug #9106)
+ * native/jni/java-lang/java_lang_Double.c
+ (parseDouble): Add handling of NaN/Infinity (bug #10491)
+ * java/nio/ByteBufferHelper.java
+ (putDouble): Use Double.toRawLongBits instead (bug #9106)
2004-10-10 Andreas Tobler <a.tobler@schweiz.ch>
@@ -5434,6 +5499,107 @@
* javax/swing/JList.java (init): Revert accidental commit.
+2004-10-09 Tom Tromey <tromey@redhat.com>
+
+ * java/beans/EventHandler.java (create): Now generic methods.
+ * java/beans/Beans.java (getInstanceOf): Updated argument type.
+ (isInstanceOf): Likewise.
+ * java/beans/BeanDescriptor.java (beanClass, customizerClass):
+ Updated type.
+ (BeanDescriptor): Updated argument types.
+ (getBeanClass, getCustomizerClass): Updated return types.
+
+ * java/lang/reflect/Proxy.java (getProxyClass): Updated argument
+ and return types.
+ (isProxyClass): Likewise.
+ (newProxyInstance): Likewise.
+
+ * java/applet/AppletContext.java (getApplets): Updated return
+ type.
+ (getStreamKeys): Likewise.
+
+ * java/lang/String.java: Implement Comparable<String>.
+
+ * java/util/Properties.java: Extend Hashtable<Object, Object>.
+ (save): Mark as @Deprecated.
+ * java/lang/System.java (clearProperty): New method.
+ (setProperty): Check for empty key.
+ (getProperty): Likewise.
+
+ * java/lang/SecurityManager.java (currentLoadedClass): Updated
+ return type.
+
+ * java/lang/Float.java: Updated status.
+ * java/lang/Void.java: Updated status.
+ * java/lang/Double.java: Updated status.
+ * java/lang/Long.java: Updated status.
+ * java/lang/Character.java: Updated status.
+ * java/lang/Integer.java: Updated status.
+ * java/lang/Short.java: Updated status.
+ * java/lang/Byte.java: Updated status.
+ * java/lang/Boolean.java: Updated status.
+
+ * java/lang/ClassLoader.java (defineClass): New method.
+ (findClass): Updated return type.
+ (findLoadedClass): Likewise.
+ (findSystemClass): Likewise.
+ (findResources): Likewise.
+ (getSystemResources): Likewise.
+ (loadClass): Likewise.
+ (resolveClass): Updated argument type.
+ (setSigners): Likewise.
+ (loadedClasses, definedPackages): Updated types.
+ (packageAssertionStatus): Likewise.
+ (systemClassAssertionStatus): Likewise.
+ (classAssertionStatus): Likewise.
+ (defineClass): Updated return type.
+ (getResource): Likewise.
+ (clearAssertionStatus): Clear packageAssertionStatus and
+ classAssertionStatus.
+
+ * java/lang/Void.java (TYPE): Changed type.
+ * java/lang/Character.java: Implement Comparable<Character>.
+ (TYPE): Changed type.
+ (SIZE): New field.
+ (MAX_CACHE, charCache): New fields.
+ (valueOf): New method.
+ (reverseBytes): Likewise.
+ * java/lang/Double.java: Implement Comparable<Double>.
+ (TYPE): Changed type.
+ (SIZE): New field.
+ (valueOf): New method.
+ * java/lang/Float.java: Implement Comparable<Float>
+ (TYPE): Changed type.
+ (SIZE): New field.
+ (valueOf): New method.
+ * java/lang/Short.java: Implement Comparable<Short>.
+ (TYPE): Changed type.
+ (MIN_CACHE, MAX_CACHE, shortCache): New fields.
+ (valueOf): New method.
+ (reverseBytes): Likewise.
+ * java/lang/Byte.java: Implement Comparable<Byte>.
+ (TYPE): Changed type.
+ (SIZE): New field.
+ (byteCache): Likewise.
+ (valueOf): New method.
+ * java/lang/Boolean.java (TYPE): Changed type.
+ * java/lang/Long.java (TYPE): Changed type.
+ (SIZE): New field.
+ (valueOf): New method.
+ (bitCount, rotateLeft, rotateRight, highestOneBit,
+ numberOfLeadingZeros, lowestOneBit, numberOfTrailingZeros,
+ signum, reverseBytes, reverse): New methods.
+ Implement Comparable<Long>.
+ * java/lang/Integer.java: Implement Comparable<Integer>.
+ (SIZE): New field.
+ (intCache): Likewise.
+ (MIN_CACHE, MAX_CACHE): Likewise.
+ (valueOf): New method.
+ (bitCount, rotateLeft, rotateRight, highestOneBit,
+ numberOfLeadingZeros, lowestOneBit, numberOfTrailingZeros,
+ signum, reverseBytes, reverse): New methods.
+ (TYPE): Changed type.
+
2004-10-08 Bryce McKinlay <mckinlay@redhat.com>
* java/util/Calendar.java (set): Invalidate DST_OFFSET
@@ -6001,22 +6167,22 @@
java/awt/GridBagConstraints.java,
java/awt/GridBagLayout.java,
java/awt/GridLayout.java,
- java/awt/Image.java,
+ java/awt/Image.java,
java/awt/KeyboardFocusManager.java,
- java/awt/Label.java,
- java/awt/List.java,
+ java/awt/Label.java,
+ java/awt/List.java,
java/awt/MediaTracker.java,
- java/awt/Menu.java,
- java/awt/MenuBar.java,
- java/awt/MenuComponent.java,
- java/awt/Panel.java,
- java/awt/PopupMenu.java,
+ java/awt/Menu.java,
+ java/awt/MenuBar.java,
+ java/awt/MenuComponent.java,
+ java/awt/Panel.java,
+ java/awt/PopupMenu.java,
java/awt/ScrollPane.java,
- java/awt/Scrollbar.java,
- java/awt/SystemColor.java,
- java/awt/TextArea.java,
- java/awt/TextField.java,
- java/awt/Toolkit.java,
+ java/awt/Scrollbar.java,
+ java/awt/SystemColor.java,
+ java/awt/TextArea.java,
+ java/awt/TextField.java,
+ java/awt/Toolkit.java,
java/awt/Window.java,
java/awt/color/ICC_Profile.java,
java/awt/datatransfer/DataFlavor.java,
@@ -6027,7 +6193,7 @@
java/awt/dnd/DropTargetContext.java,
java/awt/dnd/DropTargetDragEvent.java,
java/awt/dnd/peer/DropTargetContextPeer.java,
- java/awt/event/AdjustmentEvent.java,
+ java/awt/event/AdjustmentEvent.java,
java/awt/event/InputEvent.java,
java/awt/event/InvocationEvent.java,
java/awt/event/KeyEvent.java,
@@ -6068,7 +6234,7 @@
efficient.
2004-09-27 Bryce McKinlay <mckinlay@redhat.com>
-
+
* java.util.Calendar.java (cache): New private static field. Cached
mappings of locales->calendar classes.
(ctorArgTypes): New private static field. Singleton argument for
@@ -6119,7 +6285,7 @@
(getLineOfOffset): Likewise.
(getRowHeight): Likewise.
(replaceRange): Likewise.
- (insert): Reformatted.
+ (insert): Reformatted.
2004-09-27 Michael Koch <konqueror@gmx.de>
@@ -6132,6 +6298,10 @@
(getModel): Likewise.
(setModel): Likewise.
+2004-09-27 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/Deprecated.java: Fixed retention.
+
2004-09-26 Michael Koch <konqueror@gmx.de>
* javax/swing/JTextField.java
@@ -6335,6 +6505,23 @@
* javax/swing/UIDefaults.java
(removePropertyChangeListener): Made public.
+2004-09-26 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/Appendable.java
+ Documented this class.
+ (append(CharSequence, int, int)): added.
+
+2004-09-26 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/Comparable.java
+ Updated status to be 1.5.
+ * java/lang/Iterable.java
+ Added missing documentation.
+ * java/lang/Readable.java
+ Added documentation.
+ * java/lang/Thread.java
+ (UncaughtExceptionHandler): documented.
+
2004-09-25 Michael Koch <konqueror@gmx.de>
* javax/swing/JApplet.java:
@@ -6352,7 +6539,7 @@
(setUI): New method.
2004-09-25 Shashank Bapat <shashankbapat@yahoo.com>
- Mark Wielaard <mark@klomp.org>
+ Mark Wielaard <mark@klomp.org>
* gnu/regexp/RE.java (initialize): Add RETokenLookAhead support.
* gnu/regexp/RETokenLookAhead.java: New file.
@@ -6941,6 +7128,12 @@
* configure.ac: Set version to 0.11+cvs.
+2004-09-18 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/annotation/Retention.java: Documented.
+ * java/lang/annotation/RetentionPolicy.java: Documented.
+ * java/lang/StringBuilder.java: Updated documentation.
+
2004-09-17 Tom Tromey <tromey@redhat.com>
* vm/reference/java/lang/VMProcess.java (ProcessThread): Added
@@ -7167,6 +7360,17 @@
(getDefaultTimeZone): Fixed test to distinguish between hours and
minutes in specified timezone.
+2004-09-07 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/SuppressWarnings.java: Document.
+
+ * java/lang/StringBuilder.java: New file.
+ * java/lang/String.java (String(StringBuilder)): New constructor.
+ * java/lang/StringBuffer.java: Added comment.
+
+ * java/lang/Override.java: Documented.
+ * java/lang/Deprecated.java: Documented.
+
2004-09-06 Andrew John Hughes <gnu_andrew@member.fsf.org>
* java/awt/Canvas.java
@@ -7247,7 +7451,7 @@
2004-09-05 Mark Wielaard <mark@klomp.org>
- * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
(setChars): Only call pango_itemize() when vec->glyphitems != NULL.
Only call pango_shape() when gi->glyphs->num_glyphs > 0.
@@ -7567,7 +7771,7 @@
(modelToView): New method.
* javax/swing/text/PlainView.java
(modelToView): Made public.
-
+
2004-09-04 Michael Koch <konqueror@gmx.de>
* javax/swing/text/AbstractDocument.java
@@ -7790,6 +7994,13 @@
* examples/gnu/classpath/examples/swing/Demo.java:
Added demo for JTextField.
+
+2004-09-04 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/SuppressWarnings.java: Added imports.
+ * java/lang/Override.java: Added imports.
+ * java/lang/Deprecated.java: Added imports.
+
2004-09-03 Mark Wielaard <mark@klomp.org>
* Makefile.am (SUBDIRS): Remove external.
@@ -7800,6 +8011,12 @@
* external/*: Removed.
* NEWS: Mention GNU JAXP.
+2004-09-03 Tom Tromey <tromey@redhat.com>
+
+ * java/util/EnumMap.java: New file.
+ * java/util/EnumSet.java: New file.
+ * java/util/BitSet.java (containsAll): New method.
+
2004-08-31 Mark Wielaard <mark@klomp.org>
* NEWS: Add new news.
@@ -7835,6 +8052,7 @@
* vm/reference/java/io/VMFile.java:
Reindented.
+
2004-08-29 Mark Wielaard <mark@klomp.org>
* resource/org/.cvsignore: New file.
@@ -7901,9 +8119,41 @@
2004-08-27 Sven de Marothy <sven@physto.se>
- * java/awt/geom/Area.java
+ * java/awt/geom/Area.java
Implemented.
+2004-08-26 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/reflect/AnnotatedElement.java: New file.
+ * vm/reference/java/lang/reflect/Constructor.java (Constructor):
+ Now generic. Implements GenericDeclaration.
+ (clazz): Now generic.
+ (getDeclaringClass): Likewise.
+ (getExceptionTypes): Likewise.
+ (getParameterTypes): Likewise.
+ (newInstance): Likewise.
+ (constructNative): Likewise.
+ * java/lang/reflect/GenericDeclaration.java: New file.
+ * java/lang/reflect/GenericSignatureFormatError.java: New file.
+ * java/lang/reflect/WildcardType.java: New file.
+ * java/lang/reflect/TypeVariable.java: New file.
+ * java/lang/reflect/ParameterizedType.java: New file.
+ * java/lang/MalformedParameterizedTypeException.java: New file.
+ * java/lang/TypeNotPresentException.java: New file.
+ * java/lang/reflect/GenericArrayType.java: New file.
+ * java/lang/reflect/Type.java: New file.
+
+ * java/io/Writer.java (Writer): Implements Closeable, Flushable,
+ Appendable.
+ (append): New methods.
+ * java/io/OutputStream.java (OutputStream): Implements Closeable,
+ Flushable.
+ * java/io/Reader.java (Reader): Implements Closeable.
+ * java/io/InputStream.java (InputStream): Implements Closeable.
+ * java/nio/channels/Channel.java (Channel): Extends Closeable.
+ * java/io/Flushable.java: New file.
+ * java/io/Closeable.java: New file.
+
2004-08-25 Mark Wielaard <mark@klomp.org>
* java/awt/geom/Arc2D.java (ArcIterator): Make package private.
@@ -7912,7 +8162,7 @@
* java/awt/geom/Arc2D.java
Reformatted.
- setArc(): Correct documentation to say 'upper left corner'.
+ (setArc()): Correct documentation to say 'upper left corner'.
(setArcByTangent,contains,intersects): Implemented.
(containsAngle): Corrected to handle negative extents.
ArcIterator: Set to private.
@@ -7933,7 +8183,7 @@
* java/awt/KeyboardFocusManager.java
Added missing documentation.
-
+
2004-08-22 Patrik Reali <reali@acm.org>
* doc/www.gnu.org/newsitems.txt: news on JSpinner and java crypto
@@ -7963,7 +8213,7 @@
(getContext): set `inGetContext' as early as possible.
Include the call just prior to `doPrivileged' too.
Handle new form of `contexts' stack.
-
+
2004-08-20 Casey Marshall <csm@gnu.org>
* java/security/cert/X509CRLSelector.java: new file.
@@ -7978,16 +8228,16 @@
* javax/swing/JTextArea.java
Implemented insert() method and added additional
documentation.
-
+
2004-08-18 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
+
* javax/swing/SpinnerListModel.java, javax/swing/SpinnerModel.java
Implemented SpinnerListModel. Added documentation to
SpinnerModel.
-
+
2004-08-18 Bryce McKinlay <mckinlay@redhat.com>
-
- PR libgcj/17081
+
+ PR libgcj/17081
* java/net/URI.java (string): New field. Make all other fields
transient.
(readObject): Implemented.
@@ -8013,24 +8263,24 @@
* java/util/AbstractCollection.java, java/util/AbstractList.java,
java/util/AbstractMap.java, java/util/AbstractSequentialList.java,
java/util/ArrayList.java, java/util/Arrays.java,
- java/util/BitSet.java, java/util/Calendar.java,
- java/util/Collection.java, java/util/ListIterator.java,
- java/util/Map.java, java/util/SortedSet.java:
- Added additional exceptions to documentation, along
- with some additions and corrections.
-
+ java/util/BitSet.java, java/util/Calendar.java,
+ java/util/Collection.java, java/util/ListIterator.java,
+ java/util/Map.java, java/util/SortedSet.java:
+ Added additional exceptions to documentation, along
+ with some additions and corrections.
+
2004-08-16 Tom Tromey <tromey@redhat.com>
* .classpath: Updated.
2004-08-16 Tom Tromey <tromey@redhat.com>
- Bug 9596.
+ Bug 9596.
* java/lang/Class.java (getName): Fixed javadoc.
-
+
2004-08-16 Tom Tromey <tromey@redhat.com>
- Bug 9949.
+ Bug 9949.
* java/text/AttributedString.java (AttributedString): Use
ArrayList to build array of attribute ranges. Don't use
`attribs' before it is set.
@@ -8065,6 +8315,12 @@
* java/io/File.java File(String,String): Fixed handling of empty
path.
+2004-08-16 Tom Tromey <tromey@redhat.com>
+
+ * java/util/AbstractQueue.java (addAll): Return a result.
+ (element): Fixed typo.
+ * java/util/PriorityQueue.java: New file.
+
2004-08-15 Casey Marshall <csm@gnu.org>
* java/security/DummyKeyPairGenerator.java (clone): removed
@@ -8079,40 +8335,82 @@
* java/security/SignatureSpi.java (clone): likewise.
* javax/crypto/MacSpi.java (clone): likewise.
+2004-08-15 Matthias Pfisterer <Matthias.Pfisterer@web.de>
+ Tom Tromey <tromey@redhat.com>
+
+ * java/util/HashMap.java (HashMap): Fixed parameterization in
+ `new'.
+ (putAll): Fixed parameterization.
+ (containsValue): Likewise.
+ (clone): Likewise.
+ (getEntry): Likewise.
+ * java/util/Dictionary.java (remove): Fixed parameterization.
+ * java/util/Collections.java (shuffle): Fixed indentation and
+ type of iterator.
+ (copy): Fixed argument types.
+ (SingletonSet.containsAll): Fixed type parameterizations.
+ (SingletonList.containsAll): Likewise.
+ (EmptyMap.get): Likewise.
+ (isSequential): Likewise.
+ (EmptySet): Genericized.
+ (EmptyList): Likewise.
+ (EmptyMap): Likewise.
+ (compare): Likewise.
+ (SynchronizedCollection.containsAll): Fixed type
+ parameterization.
+ (SynchronizedCollection.iterator): Likewise.
+ (SynchronizedList.listIterator): Likewise.
+ (SynchronizedList.subList): Likewise.
+ (SynchronizedMap.keySet): Likewise.
+ (SynchronizedMap.values): Likewise.
+ (synchronizedSortedSet): Likewise.
+ (UnmodifiableCollection.containsAll): Likewise.
+ (UnmodifiableList.listIterator): Likewise.
+ * java/util/Calendar.java: Implement Comparable<Calendar>.
+ (compareTo): New method.
+ * java/util/Arrays.java (sort): Declare type variable.
+ (asList): Corrected argument type.
+ (ArrayList): Genericized.
+ * java/util/ArrayList.java: Genericized.
+ * java/util/AbstractSet.java (removeAll): Fix type errors in
+ iterator declarations.
+ * java/util/AbstractSequentialList.java (addAll): Genericize
+ iterator `i'.
+
2004-08-14 Ka-Hing Cheung <kahing@javabsp.org>
* javax/swing/AbstractSpinnerModel.java,
- javax/swing/JSpinner.java,
+ javax/swing/JSpinner.java,
javax/swing/SpinnerNumberModel.java,
- javax/swing/plaf/basic/BasicSpinnerUI.java:
- New files.
+ javax/swing/plaf/basic/BasicSpinnerUI.java:
+ New files.
* javax/swing/plaf/basic/BasicLookAndFeel.java
- (initClassDefaults): Added defaults for BasicSpinnerUI.
-
+ (initClassDefaults): Added defaults for BasicSpinnerUI.
+
2004-08-14 Mark Wielaard <mark@klomp.org>
-
+
* examples/gnu/classpath/examples/swing/Demo.java (mkSpinner):
- New method.
- (mkButtonBar): Add Spinner.
+ New method.
+ (mkButtonBar): Add Spinner.
2004-08-14 Casey Marshall <csm@gnu.org>
-
+
The Big Crypto Merge of 2004.
-
+
* configure.ac: generate jgss resource Makefiles.
* lib/Makefile.am: updated for jgss resources.
-
+
* lib/gen-classlist.sh.in: updated for classes in org/.
* javax/security/auth/x500/X500Principal.java: replaced with GNU
- Crypto's version.
-
+ Crypto's version.
+
* resource/org/Makefile.am,
* resource/org/ietf/Makefile.am,
* resource/org/ietf/jgss/Makefile.am:
new files.
-
+
Files imported from GNU Crypto.
* javax/crypto/BadPaddingException.java
* javax/crypto/Cipher.java
@@ -8266,7 +8564,7 @@
(toIso88591, toUtf16Be, toUtf8): new methods.
* gnu/java/security/der/DERValue.java: formatting changes only.
* gnu/java/security/der/DER.java: likewise.
-
+
2004-08-14 Mark Wielaard <mark@klomp.org>
* configure.ac: Add --enable-gtk-cairo checking (cairo, pangoft2).
@@ -8297,7 +8595,7 @@
* java/lang/Rectangle.java (intersects): Check r.width and r.height
first.
-
+
2004-08-13 Tom Tromey <tromey@redhat.com>
* java/nio/CharBuffer.java (put): Fix typo.
@@ -8307,13 +8605,9 @@
* java/nio/LongBuffer.java (put): Fix typo.
* java/nio/ShortBuffer.java (put): Fix typo.
-2004-08-09 Florian Weimer <fw@deneb.enyo.de>
-
- * java/nio/ByteBuffer.java (put): Fix typo.
-
2004-08-12 Guilhem Lavaux <guilhem@kaffe.org>
- * java/net/URL.java (URL): Delete whitespaces in the protocol string.
+ * java/net/URL.java (URL): Delete whitespaces in the protocol string.
2004-08-12 Tom Tromey <tromey@redhat.com>
@@ -8324,15 +8618,19 @@
* doc/www.gnu.org/newsitems.txt: added newitem about generics branch
+2004-08-09 Florian Weimer <fw@deneb.enyo.de>
+
+ * java/nio/ByteBuffer.java (put): Fix typo.
+
2004-08-09 Thomas Fitzsimmons <fitzsim@redhat.com>
- PR AWT/16121
+PR AWT/16121
* native/jni/gtk-peer/gthread-jni.c: Include stdio.h. Eliminate
type-punning compiler warnings using unions.
(throw): Replace bzero with memset.
-
+
2004-08-09 Andreas Tobler <a.tobler@schweiz.ch>
- Thomas Fitzsimmons <fitzsim@redhat.com>
+ Thomas Fitzsimmons <fitzsim@redhat.com>
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c: Move
NSA_PB macros to gtkpeer.h. Include gtkpeer.h.
@@ -8414,12 +8712,12 @@
(nativeSetIconImage): Rename to nativeSetIconImageFromDecoder.
(free_pixbuf_data): New helper function.
(nativeSetIconImageFromData): New function.
-
+
2004-08-08 Kim Ho <kho@redhat.com>
* java/awt/Component.java:
(processMouseEvent): Consume event after
- listene rs process it.
+ listeners process it.
(processMouseMotionEvent): ditto.
(processMouseWheelEvent): ditto.
* java/awt/Container.java:
@@ -8442,12 +8740,113 @@
(createRigidArea): Likewise.
(createVerticalBox): Likewise.
+2004-08-08 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/Enum.java: Added package declaration.
+
+ * java/util/Collections.java (reverseOrder): Syntax fix.
+
+ * external/jaxp/source/gnu/xml/aelfred2/XmlParser.java: Don't use
+ `enum' keyword.
+
+ * java/lang/Class.java, java/lang/Enum.java,
+ java/lang/InheritableThreadLocal.java,
+ java/util/AbstractCollection.java, java/util/Arrays.java,
+ java/util/Collections.java, java/util/LinkedList.java,
+ java/util/TreeSet.java, java/util/Vector.java: Fixed minor syntax
+ errors.
+
+2004-08-07 Tom Tromey <tromey@redhat.com>
+
+ * java/util/AbstractQueue.java: New file.
+ * java/util/LinkedList.java (element): New method.
+ (offer): Likewise.
+ (peek): Likewise.
+ (poll): Likewise.
+ (remove): Likewise.
+ (LinkedList): Implement Queue.
+ * java/util/Queue.java: New file.
+
+ * java/lang/Enum.java: New file.
+ * java/lang/Object.java (getClass): Now generic.
+
+ * java/lang/StringBuffer.java (StringBuffer(CharSequence)): New
+ constructor.
+ (append(CharSequence)): New method
+ (append(CharSequence,int,int)): Likewise.
+ (StringBuffer): Implements Appendable.
+
+ * java/lang/ref/WeakReference.java: Now generic.
+ * java/lang/ref/SoftReference.java: Now generic.
+ * java/lang/ref/ReferenceQueue.java: Now generic.
+ * java/lang/ref/Reference.java: Now generic.
+ * java/lang/ref/PhantomReference.java: Now generic.
+
+ * java/lang/annotation/AnnotationFormatError.java: New file.
+ * java/lang/annotation/IncompleteAnnotationException.java: New
+ file.
+ * java/lang/annotation/AnnotationTypeMismatchException.java: New
+ file.
+ * java/lang/annotation/RetentionPolicy.java: New file.
+ * java/lang/annotation/ElementType.java: New file.
+ * java/lang/annotation/Target.java: New file.
+ * java/lang/annotation/Retention.java: New file.
+ * java/lang/annotation/Inherited.java: New file.
+ * java/lang/annotation/Documented.java: New file.
+ * java/lang/annotation/Annotation.java: New file.
+ * java/lang/Override.java: Fixed formatting.
+ * java/lang/Deprecated.java: Now Documented.
+
2004-08-06 Tom Tromey <tromey@redhat.com>
* java/net/DatagramSocket.java: Fixed typo.
* java/awt/image/Kernel.java (clone): Use super.clone().
+2004-08-06 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/Class.java (asSubClass): Cast `this', not argument.
+
+ * vm/reference/java/lang/VMClass.java (cast): Declare.
+ * java/io/SequenceInputStream.java (SequenceInputStream):
+ Constructor now generic.
+ (e): Updated.
+ (getNextStream): Likewise.
+ * java/lang/Thread.java (UncaughtExceptionHandler): New
+ interface.
+ (State): New enum.
+ * java/lang/Readable.java: New file.
+ * java/lang/Appendable.java: New file.
+ * java/lang/Iterable.java: Documented.
+ * java/lang/Class.java (asSubClass): New method.
+ (Class): Now generic.
+ * java/lang/Boolean.java (parseBoolean): New methods.
+ (compareTo): Likewise.
+ (Boolean): Now implements Comparable.
+ * java/lang/ThreadLocal.java: Now generic.
+ * java/lang/InheritableThreadLocal.java: Now generic.
+ * java/lang/Deprecated.java: New file.
+ * java/lang/Override.java: New file.
+ * java/lang/SuppressWarnings.java: New file.
+
+2004-08-05 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/Iterable.java: New file.
+ * java/lang/Comparable.java, java/util/AbstractCollection.java,
+ java/util/AbstractList.java, java/util/AbstractMap.java,
+ java/util/AbstractSequentialList.java, java/util/AbstractSet.java,
+ java/util/Arrays.java, java/util/Collection.java,
+ java/util/Collections.java, java/util/Comparator.java,
+ java/util/Dictionary.java, java/util/Enumeration.java,
+ java/util/HashMap.java, java/util/HashSet.java,
+ java/util/Iterator.java, java/util/LinkedHashSet.java,
+ java/util/LinkedList.java, java/util/List.java,
+ java/util/ListIterator.java, java/util/Map.java,
+ java/util/Set.java, java/util/SortedMap.java,
+ java/util/SortedSet.java, java/util/Stack.java,
+ java/util/TreeSet.java, java/util/Vector.java: Updated to use
+ generics.
+
2004-08-04 Patrik Reali <reali@acm.org>
* doc/www.gnu.org/newsitems.txt: latest AWT+SWING screenshots
@@ -8476,6 +8875,17 @@
float[] coords.
* java/awt/geom/RoundRectangle2D.java: Several bugfixes (Bug #6007).
+2004-08-01 Sven de Marothy <sven@physto.se>
+
+ * java/awt/geom/CubicCurve2.java: Reindent.
+ (contains): Implemented.
+ (intersects): Implemented.
+ * java/awt/geom/QuadCurve2D.java: Likewise.
+ * java/awt/geom/GeneralPath.java: Reindent and document.
+ Fully (re)implemented using separate xpoints and ypoints
+ float[] coords.
+ * java/awt/geom/RoundRectangle2D.java: Several bugfixes (Bug #6007).
+
2004-08-01 Mark Wielaard <mark@klomp.org>
* NEWS: Mention new examples.
diff --git a/libjava/classpath/ChangeLog-2005 b/libjava/classpath/ChangeLog-2005
index 45ad84db66f..ed9dca268d3 100644
--- a/libjava/classpath/ChangeLog-2005
+++ b/libjava/classpath/ChangeLog-2005
@@ -1028,6 +1028,16 @@
handle XML namespace; handle xml:base; normalize CR/LF pairs
created as a result of mixed text and character entity references.
+2005-12-14 Nicolas Geoffray <nicolas.geoffray@menlina.com>
+
+ * java/lang/ClassLoader
+ (defineClass(String,byte[],int,int,ProtectionDomain)):
+ Calls VMClassLoader.defineClassWithTransformers instead
+ of VMClassLoader.defineClass.
+ * vm/reference/java/lang/VMClassLoader
+ (defineClassWithTransformers): New method.
+ (instrumenter): New Field.
+
2005-12-14 Roman Kennke <kennke@aicas.com>
* gnu/java/awt/peer/gtk/GdkGraphics.java
@@ -1111,6 +1121,17 @@
* java/io/File.java (File): Throw IllegalArgumentException if URI is
non-hierarchical.
+2005-12-13 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/instrument/ClassDefinition.java: Reformatted.
+ * java/lang/instrument/UnmodifiableClassException.java: Reformatted.
+ * java/lang/instrument/IllegalClassFormatException.java: Reformatted.
+
+2005-12-13 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/instrument/ClassDefinition.java (ClassDefinition): Now
+ public.
+
2005-12-13 Lillian Angel <langel@redhat.com>
* javax/swing/text/html/HTMLEditorKit.java
@@ -1311,168 +1332,144 @@
* lib/copy-vmresources.sh.in: Added some '.' after find.
-2005-12-09 Lillian Angel <langel@redhat.com>
-
- * javax/swing/text/html/CSS.java:
- Fixed class signature.
- * javax/swing/text/html/HTMLEditorKit.java:
- Fixed class signature.
- (LinkController): New class added with only stubs. Functions
- are not implmented yet.
- (InsertHTMLTextAction): New class. Constructors implemented.
- (insertHTML): Implemented.
- (insertAtBoundary): Added, not yet implemented.
- (insertAtBoundry): Implemented.
- (actionPerformed): Added, not yet implemented.
- (HTMLTextAction): New class.
- (getHTMLDocument): Implemented.
- (getHTMLEditorKit): Implemented.
- (getElementsAt): Implemented.
- (elementCountToTag): Added, not yet implemented.
- (findElementMatchingTag): Likewise.
- (getViewFactory): Implemented.
- (HTMLFactory): Moved to beginning of class, with other inner classes.
- (ParserCallBack): Added constructor, not yet implemented.
- (clone): Added, not yet implemented. Calls super.
- (createInputAttributes): Likewise.
- (install): Likewise.
- (deinstall): Likewise.
- (getActions): Likewise.
- (getInputAttributes): Likewise.
- (getDefaultCursor): Implemented.
- (getLinkCursor): Implemented.
- (SetLinkCursor): Implemented.
- (setDefaultLinkCursor): Implemented.
- (AccessibleContext): Can't implement until AccessibleHTML is
- implemented. Currently, returns null because accessibility is not supported.
-
-2005-12-09 Anthony Balkissoon <abalkiss@redhat.com>
-
- * javax/swing/JEditorPane.java:
- (setText): Allow the EditorKit to read the text into the Document,
- allowing for other than plain text.
-
-2005-12-09 Lillian Angel <langel@redhat.com>
-
- * javax/swing/text/html/HTMLDocument.java
- (getReader): Added function. Not implemented. It was
- added so a certain mauve test committed compiles with
- classpath fine.
-
-2005-12-09 Lillian Angel <langel@redhat.com>
-
- * javax/swing/text/html/HTMLEditorKit.java
- (getViewFactory): Fixed class name of ViewFactory returned.
- (HTMLFactory): Fixed class name to match API.
-
-2005-12-08 Lillian Angel <langel@redhat.com>
+2005-12-09 Tom Tromey <tromey@redhat.com>
- * javax/swing/text/html/HTMLEditorKit.java
- (insertHTML): Added method, not implemented yet.
- (read): Likewise.
- (write): Likewise.
- (getContentType): Implemented.
- (getViewFactory): Implemented.
- (HTMLViewFactory): New package-private inner class, implemented.
-
-2005-12-08 Lillian Angel <langel@redhat.com>
-
- * javax/swing/text/StyledEditorKit.java
- (create): Reverted to use BoxView. I need to write
- a mauve test to be sure about this.
-
-2005-12-08 Lillian Angel <langel@redhat.com>
-
- * javax/swing/text/StyledEditorKit.java
- (create): Changed to use BlockView here instead of BoxView.
-
-2005-12-08 Anthony Balkissoon <abalkiss@redhat.com>
-
- * javax/swing/JEditorPane.java:
- (init): Changed to no-argument instead of taking in an EditorKit and
- passing it to setEditorKit. Callers will have to call setEditorKit
- themselves.
- (JEditorPane()): Changed call to init to have no arguments, call
- setEditorKit after init.
- (JEditorPane(String, String)): Likewise.
- (JEditorPane(URL)): Don't call default constructor, call init and then
- setEditorKit using the appropriate EditorKit for text/html.
-
-2005-12-08 Anthony Balkissoon <abalkiss@redhat.com>
-
- * javax/swing/JEditorPane.java:
- (registerMap): New field.
- (editorMap): New field.
- (JEditorPane()): Call init instead of setEditorKit.
- (JEditorPane(String, String)): Likewise.
- (init): New method.
- (createEditorKitForContentType): Implemented and documented.
- (getEditorKitClassNameForContentType): Likewise.
- (getEditorKitForContentType): Likewise.
- (registerEditorKitForContentType): Likewise.
- (replaceSelection): Call super (this is temporary until the real
- implementation happens. There is already a TODO noting that this needs
- to be implemented.
- (setEditorKitForContentType): Implemented and documented.
-
-2005-12-08 Lillian Angel <langel@redhat.com>
-
- * javax/swing/text/html/BlockView.java:
- New class added.
- (BlockView): Implemented.
- (setParent): Implemented.
- (calculateMajorAxisRequirements): Added, not fully implemented.
- (calculateMinorAxisRequirements): Likewise.
- (layoutMinorAxis): Likewise.
- (paint): Implemented, but some code is commented out since
- StyleSheet is not yet implemented.
- (getAttributes): Likewise.
- (getResizeWeight): Implemented.
- (getAlignment): Implemented.
- (changedUpdate): Implemented.
- (getPreferredSpan): Implemented.
- (getMinimumSpan): Implemented.
- (getMaximumSpan): Implemented.
- (setPropertiesFromAttributes): Added, not implemented yet. Need
- to wait for StyleSheet to be implemented.
-
-2005-12-08 Tom Tromey <tromey@redhat.com>
-
- * javax/security/auth/login/LoginContext.java (LoginContext): New
- constructor.
- * javax/security/auth/login/CredentialNotFoundException.java: New
- file.
- * javax/security/auth/login/CredentialExpiredException.java: Extends
- CredentialException.
- * javax/security/auth/login/CredentialException.java: New file.
- * javax/security/auth/login/AccountNotFoundException.java: New file.
- * javax/security/auth/login/AccountLockedException.java: New file.
- * javax/security/auth/login/AccountExpiredException.java: Extends
- AccountException.
- * javax/security/auth/login/AccountException.java: New file.
-
-2005-12-08 Roman Kennke <kennke@aicas.com>
-
- * javax/swing/JComponent.java
- (JComponent): Don't set a layout here. The default setting should be
- null.
-
-2005-12-07 Tom Tromey <tromey@redhat.com>
-
- * java/lang/Float.java (toHexString): New method.
- * java/lang/Double.java (toHexString): New method.
-
-2005-12-07 Gary Benson <gbenson@redhat.com>
-
- * java/io/RandomAccessFile.java (RandomAccessFile): Don't create
- DataOutputStream for read-only files to avoid unnecessary security
- manager check.
-
-2005-12-07 Ito Kazumitsu <kaz@maczuka.gcd.org>
-
- Fixes bug #25273
- * java/text/DecimalFormat.java(scanFormat): Don't set
- minimumIntegerDigits to 0.
+ * javax/print/attribute/standard/Chromaticity.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/ColorSupported.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/Compression.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/Copies.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/CopiesSupported.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/DateTimeAtCompleted.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/DateTimeAtCreation.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/DateTimeAtProcessing.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/Destination.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/DocumentName.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/Fidelity.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/Finishings.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobHoldUntil.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobImpressions.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobImpressionsCompleted.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobImpressionsSupported.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobKOctets.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobKOctetsProcessed.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobKOctetsSupported.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobMediaSheets.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobMediaSheetsCompleted.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobMediaSheetsSupported.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobMessageFromOperator.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobName.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobOriginatingUserName.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobPriority.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobPrioritySupported.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobSheets.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobState.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobStateReason.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/JobStateReasons.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/Media.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/MediaPrintableArea.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/MediaSize.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/MultipleDocumentHandling.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/NumberOfDocuments.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/NumberOfInterveningJobs.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/NumberUp.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/NumberUpSupported.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/OrientationRequested.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/OutputDeviceAssigned.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PDLOverrideSupported.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PageRanges.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PagesPerMinute.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PagesPerMinuteColor.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PresentationDirection.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PrintQuality.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PrinterInfo.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PrinterIsAcceptingJobs.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PrinterLocation.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PrinterMakeAndModel.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PrinterMessageFromOperator.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PrinterMoreInfo.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PrinterName.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PrinterResolution.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PrinterState.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PrinterStateReason.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PrinterStateReasons.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/PrinterURI.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/QueuedJobCount.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/ReferenceUriSchemesSupported.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/RequestingUserName.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/Severity.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/SheetCollate.java
+ (getCategory): Genericized.
+ * javax/print/attribute/standard/Sides.java
+ (getCategory): Genericized.
+ * javax/print/attribute/HashAttributeSet.java (get): Genericized.
+ (remove): Likewise.
+ * javax/print/attribute/Attribute.java (getCategory): Fixed return
+ type.
2005-12-06 Anthony Balkissoon <abalkiss@redhat.com>
@@ -1538,6 +1535,73 @@
preferred size. Also, I added a comment explaining a possible bug
in this method.
+2005-12-06 Tom Tromey <tromey@redhat.com>
+
+ * javax/security/auth/Subject.java (Subject): Genericized.
+ (getPrincipals): Likewise.
+ (getPrivateCredentials): Likewise.
+ (getPublicCredentials): Likewise.
+ (getPublicCredentials): Likewise.
+
+2005-12-06 Tom Tromey <tromey@redhat.com>
+
+ * javax/imageio/ImageIO.java (ImageReaderIterator): Genericized.
+ Added new constructor.
+ (ImageWriterIterator): Likewise.
+ (getReadersByFilter): Genericized.
+ (getWritersByFilter): Likewise.
+ (getImageReadersBySuffix): Likewise.
+ (getImageWriters): Likewise.
+ (hasNext): Likewise.
+ * javax/print/attribute/AttributeSetUtilities.java
+ (verifyAttributeCategory): Genericized.
+ (verifyAttributeValue): Likewise.
+ (verifyCategoryForValue): Likewise.
+ * javax/print/attribute/AttributeSet.java (containsKey): Genericized.
+ (get): Likewise.
+ (remove): Likewise.
+ * javax/print/attribute/Attribute.java (getCategory): Genericized.
+ * javax/print/attribute/HashAttributeSet.java (HashAttributeSet):
+ Genericized.
+ (containsKey): Likewise.
+ * javax/imageio/spi/ServiceRegistry.java (deregisterAll):
+ Genericized.
+ * javax/imageio/spi/IIOServiceProvider.java (onDeregistration):
+ Genericized.
+ (onRegistration): Likewise.
+ * javax/imageio/metadata/IIOMetadataFormatImpl.java (getObjectClass):
+ Genericized.
+ (getObjectMaxValue): Likewise.
+ (getObjectMinValue): Likewise.
+ * javax/imageio/ImageIO.java (getImageReadersBySuffix): Genericized.
+ (getImageWriters): Likewise.
+
+2005-12-05 Casey Marshall <csm@gnu.org>
+
+ * native/jni/classpath/jcl.h (environ): define, or declare
+ 'extern.'
+ * native/jni/java-lang/java_lang_VMProcess.c: include <jcl.h>.
+ Remove 'extern' define.
+ * native/jni/java-lang/java_lang_VMSystem.c
+ (Java_java_lang_VMSystem_environ): don't declare 'environ.'
+
+2005-12-05 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/instrument/Instrumentation.java (redefineClasses): Javadoc
+ fix.
+ * java/lang/instrument/ClassFileTransformer.java (transform): Javadoc
+ fix.
+
+2005-12-04 Nicolas Geoffray <nicolas.geoffray@menlina.com>
+
+ * vm/reference/java/lang/VMInstrumentationImpl.java
+ (redefineClasses): Added an extra parameter of type
+ java.lang.instrument.Instrument.
+ * java/lang/InstrumentationImpl.java
+ (redefineClasses): Added the Instrumentation object
+ to the arguments of VMInstrumentationImpl.redefineClasses
+ call.
+
2005-12-05 Mark Wielaard <mark@klomp.org>
Fixes bug classpath/25257
@@ -1562,12 +1626,55 @@
(getClipboard): Return null when access denied.
(clipboard): Removed static field.
+2005-12-03 Nicolas Geoffray <nicolas.geoffray@menlina.com>
+
+ * java/lang/instrument: New directory.
+ * java/lang/instrument/ClassDefinition.java:
+ New file.
+ * java/lang/instrument/ClassFileTransformer.java:
+ New file.
+ * java/lang/instrument/IllegalClassFormatException.java:
+ New file.
+ * java/lang/instrument/Instrumentation.java:
+ New file.
+ * java/lang/instrument/UnmodifiableClassException.java:
+ New file.
+ * java/lang/InstrumentationImpl.java:
+ New file.
+ * vm/reference/java/lang/VMInstrumentationImpl.java:
+ New file.
+
2005-12-03 Mark Wielaard <mark@klomp.org>
* configure.ac (AC_CONFIG_FILES): Removed
native/jni/sampled-jack/Makefile.
(AC_ARG_ENABLE [jack]): Removed.
+2005-12-02 Tom Tromey <tromey@redhat.com>
+
+ * javax/sound/sampled/Port.java (Info): Genericized.
+ * javax/sound/sampled/Line.java (Info): Genericized.
+ (getLineClass): Likewise.
+ * javax/sound/sampled/DataLine.java (Info): Genericized.
+ * javax/sound/sampled/AudioFormat.java (AudioFormat): Genericized.
+ (properties): Likewise.
+ * javax/sound/sampled/AudioFileFormat.java (AudioFileFormat):
+ Genericized.
+ (properties): Likewise.
+
+2005-12-02 Tom Tromey <tromey@redhat.com>
+
+ * javax/naming/directory/InitialDirContext.java (search): Genericized.
+ * javax/naming/directory/BasicAttributes.java (getAll): Genericized.
+ (getIDs): Likewise.
+ * javax/naming/directory/BasicAttribute.java (getAll): Fixed return
+ type.
+ * javax/naming/InitialContext.java: Genericized.
+ (list): Likewise.
+ (listBindings): Likewise.
+ * javax/naming/CompoundName.java (getAll): Genericized.
+ * javax/naming/CompositeName.java (getAll): Genericized.
+
2005-12-02 Anthony Balkissoon <abalkiss@redhat.com>
* javax/swing/text/InternationalFormatter.java:
@@ -1608,6 +1715,65 @@
should return a factory, not just a formatter.
(createFormatterFactory): New method adapted from createFormatter.
+2005-12-01 Tom Tromey <tromey@redhat.com>
+
+ * javax/imageio/spi/RegisterableService.java (onRegistration):
+ Genericized.
+ (onDeregistration): Likewise.
+ * javax/imageio/spi/ServiceRegistry.java (ServiceRegistry):
+ Genericized.
+ (deregisterServiceProvider): Likewise.
+ (getCategories): Likewise.
+ (getServiceProviderByClass): Likewise.
+ (getServiceProviders): Likewise.
+ (lookupProviders): Likewise.
+ (registerServiceProvider): Likewise.
+ (registerServiceProviders): Likewise.
+ (setOrdering): Likewise.
+ (unsetOrdering): Likewise.
+ * javax/imageio/spi/ImageOutputStreamSpi.java (outputClass):
+ Genericized.
+ (ImageOutputStreamSpi): Likewise.
+ (getOutputClass): Likewise.
+ * javax/imageio/spi/ImageInputStreamSpi.java (inputClass):
+ Genericized.
+ (ImageInputStreamSpi): Likewise.
+ (getInputClass): Likewise.
+ * javax/imageio/metadata/IIOMetadataFormatImpl.java (addAttribute):
+ Genericized.
+ (addObjectValue): Likewise.
+ * javax/imageio/metadata/IIOMetadataFormat.java (getObjectClass):
+ Genericized.
+ (getObjectMaxValue): Likewise.
+ (getObjectMinValue): Likewise.
+ * javax/imageio/ImageIO.java (getImageReaders): Genericized.
+ (getImageReadersByFormatName): Likewise.
+ (getImageReadersByMIMEType): Likewise.
+ (getImageTranscoders): Likewise.
+ (getImageWritersByFormatName): Likewise.
+ (getImageWritersByMIMEType): Likewise.
+ (getImageWritersBySuffix): Likewise.
+ (getImageReader): Use getOriginatingProvider.
+ (getImageWriter): Likewise.
+ * javax/imageio/ImageWriter.java (progressListeners): Genericized.
+ (warningListeners): Likewise.
+ (warningLocales): Likewise.
+ (prepareInsertEmpty): Likewise.
+ (prepareWriteEmpty): Likewise.
+ * javax/imageio/ImageReader.java (progressListeners): Genericized.
+ (updateListeners): Likewise.
+ (warningListeners): Likewise.
+ (warningLocales): Likewise.
+ (getDestination): Likewise.
+ (getImageMetadata): Likewise.
+ (getImageTypes): Likewise.
+ (getStreamMetadata): Likewise.
+ (readAll): Likewise.
+ * javax/imageio/IIOImage.java (IIOImage): Genericized.
+ (thumbnails): Likewise.
+ (getThumbnails): Likewise.
+ (setThumbnails): Likewise.
+
2005-12-01 Anthony Green <green@redhat.com>
PR bootstrap/25207
@@ -1741,6 +1907,48 @@
(nativeToFlavorMap): removed generalization.
(flavorToNativeMap): likewise.
+2005-11-29 Tom Tromey <tromey@redhat.com>
+
+ * javax/swing/text/StyleContext.java (removeAttributes): Genericized.
+ (getAttributeNames): Likewise.
+ * javax/swing/text/SimpleAttributeSet.java (getAttributeNames):
+ Genericized.
+ (removeAttributes): Likewise.
+ * javax/swing/text/DefaultStyledDocument.java (getStyleNames):
+ Genericized.
+ * javax/swing/text/AbstractDocument.java (getAttributeNames):
+ Genericized.
+ (removeAttributes): Likewise.
+ * javax/swing/table/TableColumnModel.java (getColumns): Genericized.
+ * javax/swing/table/AbstractTableModel.java (getColumnClass):
+ Genericized.
+ * javax/swing/tree/VariableHeightLayoutCache.java
+ (getVisiblePathsFrom): Genericized.
+ * javax/swing/tree/FixedHeightLayoutCache.java (getVisiblePathsFrom):
+ Genericized.
+ * javax/swing/undo/StateEdit.java (postState): Genericized.
+ (preState): Likewise.
+ * javax/security/sasl/SaslServerFactory.java (createSaslServer):
+ Genericized.
+ * javax/security/sasl/SaslClientFactory.java (createSaslClient):
+ Genericized.
+ (getMechanismNames): Likewise.
+ * javax/security/sasl/Sasl.java (createSaslClient): Genericized.
+ (createSaslServer): Likewise.
+ (getSaslClientFactories): Likewise.
+ (getSaslServerFactories): Likewise.
+ * javax/security/auth/spi/LoginModule.java (initialize): Genericized.
+ * javax/security/auth/login/AppConfigurationEntry.java
+ (AppConfigurationEntry): Genericized.
+ (getOptions): Likewise.
+ * javax/sql/RowSet.java (getTypeMap): Genericized.
+ (setTypeMap): Likewise.
+ * java/sql/Array.java (getResultSet): Genericized.
+ * java/security/cert/X509CertSelector.java (getExtendedKeyUsage):
+ Genericized.
+ * java/security/Permissions.java (elements): Genericized.
+ * java/rmi/server/RMIClassLoader.java (loadClass): Genericized.
+
2005-11-29 Lillian Angel <langel@redhat.com>
* javax/swing/plaf/metal/MetalFileChooserUI.java
@@ -1874,6 +2082,91 @@
2005-11-27 Tom Tromey <tromey@redhat.com>
+ * javax/print/attribute/standard/PrinterStateReasons.java:
+ Genericized.
+ * javax/print/attribute/standard/JobStateReasons.java: Genericized.
+ * javax/print/PrintService.java (getAttribute): Genericized.
+ (getDefaultAttributeValue): Likewise.
+ (getSupportedAttributeCategories): Likewise.
+ (getSupportedAttributeValues): Likewise.
+ (isAttributeValueSupported): Likewise.
+
+2005-11-27 Tom Tromey <tromey@redhat.com>
+
+ * javax/naming/spi/StateFactory.java (getStateToBind): Genericized.
+ * javax/naming/spi/Resolver.java (resolveToClass): Genericized.
+ * javax/naming/spi/ObjectFactoryBuilder.java (createObjectFactory):
+ Genericized.
+ * javax/naming/spi/NamingManager.java (getInitialContext):
+ Genericized.
+ (getURLContext): Likewise.
+ (getObjectInstance): Likewise.
+ (getStateToBind): Likewise.
+ * javax/naming/spi/InitialContextFactoryBuilder.java
+ (createInitialContextFactory): Genericized.
+ * javax/naming/spi/InitialContextFactory.java (getInitialContext):
+ Genericized.
+ * javax/naming/spi/DirectoryManager.java (getObjectInstance):
+ Genericized.
+ (getStateToBind): Likewise.
+ * javax/naming/spi/DirStateFactory.java (getStateToBind):
+ Genericized.
+ * javax/naming/spi/ObjectFactory.java (getObjectInstance):
+ Genericized.
+ * javax/naming/spi/DirObjectFactory.java (getObjectInstance):
+ Genericized.
+ * javax/naming/ldap/LdapReferralException.java (getReferralContext):
+ Genericized.
+ * javax/naming/ldap/ControlFactory.java (getControlInstance):
+ Genericized.
+ * javax/naming/ldap/InitialLdapContext.java (InitialLdapContext):
+ Genericized.
+ * javax/naming/directory/DirContext.java (search): Genericized.
+ * javax/naming/directory/Attributes.java (getAll): Genericized.
+ (getIDs): Likewise.
+ * javax/naming/directory/Attribute.java (getAll): Genericized.
+ * javax/naming/directory/BasicAttribute.java (values): Genericized.
+ (getAll): Likewise.
+ * javax/naming/directory/InitialDirContext.java (InitialDirContext):
+ Genericized.
+ * javax/naming/ReferralException.java (getReferralContext):
+ Genericized.
+ * javax/naming/Name.java (getAll): Genericized.
+ * javax/naming/Context.java (getEnvironment): Genericized.
+ (list): Likewise.
+ (listBindings): Likewise.
+ * javax/naming/NamingEnumeration.java: Genericized.
+ (next): Likewise.
+ * javax/naming/Reference.java (addrs): Genericized.
+ (getAll): Likewise.
+ * javax/naming/CannotProceedException.java (environment): Genericized.
+ (getEnvironment): Likewise.
+ (setEnvironment): Likewise.
+ * javax/naming/InitialContext.java (myProps): Genericized.
+ (InitialContext): Likewise.
+ (init): Likewise.
+ * javax/naming/CompoundName.java (CompoundName): Genericized.
+ * javax/naming/CompositeName.java (CompositeName): Genericized.
+
+2005-11-27 Tom Tromey <tromey@redhat.com>
+
+ * java/sql/Struct.java (getAttributes): Genericized.
+ * java/sql/ResultSet.java (getObject): Genericized.
+ * java/sql/Ref.java (getObject): Genericized.
+ * java/sql/DriverManager.java (getDrivers): Genericized.
+ * java/sql/Connection.java (getTypeMap): Genericized.
+ (setTypeMap): Likewise.
+ * java/sql/CallableStatement.java (getObject): Genericized.
+ (getObject): Likewise.
+ * java/sql/Array.java (getBaseTypeName): Fixed javadoc.
+ (getArray): Likewise.
+ (getResultSet): Likewise.
+ (getResultSet): Likewise.
+ (getArray): Genericized.
+ (getResultSet): Likewise.
+
+2005-11-27 Tom Tromey <tromey@redhat.com>
+
* java/beans/PropertyChangeSupport.java (fireIndexedPropertyChange):
New methods.
* java/beans/IndexedPropertyChangeEvent.java: New file.
@@ -1883,6 +2176,181 @@
* java/lang/StackTraceElement.java (StackTraceElement): New
constructor.
+2005-11-25 Tom Tromey <tromey@redhat.com>
+
+ * javax/swing/text/StyleContext.java (getStyleNames): Genericized.
+ * javax/swing/text/MutableAttributeSet.java (removeAttributes):
+ Genericized.
+ * javax/swing/text/DefaultFormatter.java (getValueClass): Genericized.
+ (setValueClass): Likewise.
+ * javax/swing/text/AttributeSet.java (getAttributeNames): Genericized.
+ * javax/swing/text/AbstractDocument.java (getDocumentProperties):
+ Genericized.
+ (setDocumentProperties): Likewise.
+ (removeAttributes): Likewise.
+ * javax/swing/SwingUtilities.java (getAncestorOfClass): Genericized.
+ * javax/swing/LookAndFeel.java (makeIcon): Genericized.
+ * javax/swing/JTable.java (getColumnClass): Genericized.
+ (getDefaultRenderer): Likewise.
+ (setDefaultRenderer): Likewise.
+ (getDefaultEditor): Likewise.
+ (setDefaultEditor): Likewise.
+ * javax/swing/JLayeredPane.java (getComponentToLayer): Genericized.
+ * javax/swing/DefaultListModel.java (elements): Genericized.
+ * javax/swing/ButtonGroup.java (buttons): Genericized.
+ (getElements): Likewise.
+ * javax/swing/SpinnerListModel.java (SpinnerListModel): Genericized.
+ (getList): Likewise.
+ (setList): Likewise.
+ * javax/swing/SortingFocusTraversalPolicy.java
+ (SortingFocusTraversalPolicy): Genericized.
+ (getComparator): Likewise.
+ (setComparator): Likewise.
+ * javax/swing/JTree.java (JTree): Genericized.
+ (getDescendantToggledPaths): Likewise.
+ (getExpandedDescendants): Likewise.
+ (removeDescendantToggledPaths): Likewise.
+ * javax/swing/JList.java (JList): Genericized.
+ Likewise.
+ * javax/swing/JComboBox.java (JComboBox): Genericized.
+ * javax/swing/DefaultComboBoxModel.java (DefaultComboBoxModel):
+ Genericized.
+ * javax/swing/UIDefaults.java: Genericized superclass.
+ (getUIClass): Likewise.
+ * javax/swing/event/EventListenerList.java (getListenerCount):
+ Genericized.
+ * javax/swing/plaf/basic/BasicDirectoryModel.java (getDirectories):
+ Genericized.
+ (getFiles): Likewise.
+ (sort): Likewise.
+ * javax/swing/plaf/basic/BasicTreeUI.java (drawingCache): Genericized.
+ * javax/swing/plaf/basic/BasicFileChooserUI.java (iconCache):
+ Genericized.
+ * javax/swing/table/TableModel.java (getColumnClass): Genericized.
+ * javax/swing/table/DefaultTableColumnModel.java (tableColumns):
+ Genericized.
+ (getColumns): Likewise.
+ (moveColumn): Updated.
+ * javax/swing/text/html/parser/ContentModel.java (getElements):
+ Genericized.
+ * javax/swing/text/html/parser/DTD.java (entityHash): Fixed type.
+ * javax/swing/text/html/parser/AttributeList.java (AttributeList):
+ Genericized.
+ (values): Likewise.
+ (getValues): Likewise.
+ * javax/swing/tree/AbstractLayoutCache.java (getVisiblePathsFrom):
+ Genericized.
+ * javax/swing/tree/DefaultMutableTreeNode.java (EMPTY_ENUMERATION):
+ Genericized.
+ * javax/swing/undo/StateEditable.java (restoreState): Genericized.
+ (storeState): Likewise.
+
+2005-11-25 Tom Tromey <tromey@redhat.com>
+
+ * java/rmi/server/RMIClassLoaderSpi.java (loadClass): Genericized.
+ (loadProxyClass): Likewise.
+ (getClassAnnotation): Likewise.
+ * java/rmi/server/RMIClassLoader.java (loadClass): Genericized.
+ (getClassAnnotation): Likewise.
+ * java/rmi/server/LoaderHandler.java (loadClass): Genericized.
+
+2005-11-25 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/Font.java (Font): Genericized.
+ (deriveFont): Likewise.
+ (getAttributes): Likewise.
+ (getFont): Likewise.
+
+2005-11-25 Tom Tromey <tromey@redhat.com>
+
+ * java/text/NumberFormat.java (format): No longer final.
+ * java/text/AttributedCharacterIterator.java (getAllAttributeKeys):
+ Genericized.
+ (getAttributes): Likewise.
+ (getRunLimit): Likewise.
+ (getRunStart): Likewise.
+ * java/text/AttributedString.java (AttributedString): Genericized.
+ (addAttributes): Likewise.
+ * java/text/Collator.java: Implement Comparator<Object>.
+
+2005-11-25 Tom Tromey <tromey@redhat.com>
+
+ * java/security/cert/X509Extension.java (getCriticalExtensionOIDs):
+ Genericized.
+ (getNonCriticalExtensionOIDs): Likewise.
+ * java/security/cert/X509Certificate.java (getExtendedKeyUsage):
+ Genericized.
+ (getIssuerAlternativeNames): Likewise.
+ (getSubjectAlternativeNames): Likewise.
+ * java/security/cert/X509CertSelector.java (setExtendedKeyUsage):
+ Genericized.
+ (setSubjectAlternativeNames): Likewise.
+ * java/security/cert/X509CRLSelector.java (getIssuerNames):
+ Genericized.
+ (setIssuerNames): Likewise.
+ * java/security/cert/X509CRL.java (getRevokedCertificates):
+ Genericized.
+ * java/security/cert/PolicyNode.java (getChildren): Genericized.
+ (getExpectedPolicies): Likewise.
+ (getPolicyQualifiers): Likewise.
+ * java/security/cert/PKIXCertPathChecker.java (check): Genericized.
+ (getSupportedExtensions): Likewise.
+ * java/security/cert/CertificateFactorySpi.java
+ (engineGenerateCertPath): Genericized.
+ (engineGenerateCertificates): Likewise.
+ (engineGenerateCRLs): Likewise.
+ (engineGetCertPathEncodings): Likewise.
+ * java/security/cert/CertificateFactory.java (generateCertificates):
+ Genericized.
+ (generateCertPath): Likewise.
+ (generateCRLs): Likewise.
+ (getCertPathEncodings): Likewise.
+ * java/security/cert/CertStoreSpi.java (engineGetCertificates):
+ Genericized.
+ (engineGetCRLs): Likewise.
+ * java/security/cert/CertStore.java (getCertificates): Genericized.
+ (getCRLs): Likewise.
+ * java/security/cert/CertPath.java (getCertificates): Genericized.
+ (getEncodings): Likewise.
+ * java/security/cert/PKIXParameters.java (PKIXParameters):
+ Genericized.
+ (getCertStores): Likewise.
+ (getCertPathCheckers): Likewise.
+ (getInitialPolicies): Likewise.
+ (getTrustAnchors): Likewise.
+ (setCertPathCheckers): Likewise.
+ (setCertStores): Likewise.
+ (setInitialPolicies): Likewise.
+ (setTrustAnchors): Likewise.
+ * java/security/cert/PKIXBuilderParameters.java
+ (PKIXBuilderParameters): Genericized.
+ * java/security/cert/CollectionCertStoreParameters.java
+ (CollectionCertStoreParameters): Genericized.
+ (getCollection): Likewise.
+ * java/security/cert/PolicyQualifierInfo.java: No longer final.
+
+2005-11-25 Tom Tromey <tromey@redhat.com>
+
+ * java/security/Security.java (getAlgorithms): Genericized.
+ (getProviders): Likewise.
+ * java/security/SecureClassLoader.java (defineClass): Genericized.
+ (protectionDomainCache): Likewise.
+ * java/security/PermissionCollection.java (elements): Genericized.
+ (toString): Updated.
+ * java/security/KeyStoreSpi.java (engineAliases): Genericized.
+ * java/security/KeyStore.java (aliases): Genericized.
+ * java/security/KeyFactorySpi.java (engineGetKeySpec): Genericized.
+ (engineTranslateKey): Fixed javadoc.
+ * java/security/KeyFactory.java (getKeySpec): Genericized.
+ * java/security/IdentityScope.java (identities): Genericized.
+ * java/security/AlgorithmParametersSpi.java (engineGetParameterSpec):
+ Genericized.
+ * java/security/AlgorithmParameters.java (getParameterSpec):
+ Genericized.
+ * java/security/AccessController.java (doPrivileged): Genericized.
+ * java/security/PrivilegedExceptionAction.java: Genericized.
+ * java/security/PrivilegedAction.java: Genericized.
+
2005-11-25 Guilhem Lavaux <guilhem@kaffe.org>
* native/jni/java-io/javaio.c, native/jni/java-io/javaio.h:
@@ -4851,8 +5319,18 @@
2005-11-02 Andrew John Hughes <gnu_andrew@member.fsf.org>
- * AUTHORS: Added myself.
+ * examples/Makefile.am:
+ Comment out JIKES and GCJ conditionals.
+ * lib/Makefile.am:
+ Comment out JIKES, KJC and GCJ conditionals.
+ * m4/acinclude.m4:
+ Comment out selection of GCJ, Jikes and KJC as compilers for
+ the branch.
+2005-11-02 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * AUTHORS: Added myself.
+
2005-11-02 Mark Wielaard <mark@klomp.org>
* javax/swing/Timer.java (Waker.run): Only break out when !running.
@@ -4870,6 +5348,24 @@
* lib/copy-vmresources.sh.in: Added definition for top_srcdir.
+2005-11-02 Mark Wielaard <mark@klomp.org>
+
+ * configure.ac (AC_INIT): Set version to 0.19-generics.
+ * lib/Makefile.am: Add typeHiding, unchecked, unused and varargsCast
+ to ECJ compile warning rule.
+
+2005-11-02 Tom Tromey <tromey@redhat.com>
+
+ * javax/sound/midi/Instrument.java (Instrument): Genericized argument
+ type.
+ * javax/sound/midi/SoundbankResource.java (SoundbankResource):
+ Genericized argument type.
+ (getDataClass): Genericized return type.
+ * javax/sound/midi/Sequence.java (tracks): Changed type.
+ (init): Updated.
+ (getTracks): Updated.
+ (getTickLength): Updated.
+
2005-11-02 Andreas Tobler <a.tobler@schweiz.ch>
* NEWS: Mention Qt4 configury for OS-X.
@@ -5955,6 +6451,44 @@
2005-10-24 Tom Tromey <tromey@redhat.com>
+ * javax/accessibility/AccessibleStateSet.java (states):
+ Changed type.
+ * javax/accessibility/AccessibleRelationSet.java (relations):
+ Changed type.
+
+2005-10-24 Tom Tromey <tromey@redhat.com>
+
+ * java/security/acl/Group.java (isMember): Javadoc fix.
+ (members): Changed return type.
+ * java/security/acl/AclEntry.java (addPermission): Fixed javadoc.
+ (checkPermission): Likewise.
+ (permissions): Changed return type.
+ * java/security/acl/Acl.java (entries): Changed return type.
+ (getPermissions): Likewise.
+
+2005-10-24 Tom Tromey <tromey@redhat.com>
+
+ * gnu/java/nio/SelectorImpl.java (keys): Changed type.
+ (selected): Likewise.
+ (SelectorImpl): Updated.
+ (keys): Changed return type.
+ (getFDsAsArray): Updated.
+ (select): Likewise.
+ (selectedKeys): Changed return type.
+ (deregisterCancelledKeys): Updated.
+ * java/nio/channels/Selector.java (selectedKeys): Changed return
+ type.
+ (keys): Likewise.
+
+2005-10-24 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/image/ReplicateScaleFilter.java (setProperties): Changed
+ argument type.
+ * java/awt/image/CropImageFilter.java (setProperties): Changed
+ argument type.
+
+2005-10-24 Tom Tromey <tromey@redhat.com>
+
* java/io/ObjectOutputStream.java (useProtocolVersion): Fixed typo
in javadoc.
@@ -7075,6 +7609,82 @@
org/omg/CORBA/ORB.java: Adapted to support the
gnu.CORBA.ListenerPort property.
+2005-10-16 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/awt/image/BufferedImage.java:
+ (getSources()): Genericized.
+ * java/awt/image/ImageFilter.java:
+ (setProperties(Hashtable<?,?>)): Likewise.
+ * java/awt/image/MemoryImageSource.java:
+ (MemoryImageSource(int,int,int[],int,int,Hashtable<?,?>)): Likewise.
+ * java/awt/image/PixelGrabber.java:
+ (setProperties(Hashtable<?,?>)): Likewise.
+ * java/awt/image/renderable/RenderableImageOp.java:
+ (getSources()): Likewise.
+ * java/beans/Beans.java:
+ (getInstanceOf(Object,Class<?>)): Likewise.
+ (isInstanceOf(Object,Class<?>)): Likewise.
+ * java/beans/EventSetDescriptor.java:
+ (EventSetDescriptor(Class<?>,String,Class<?>,String)): Likewise.
+ (EventSetDescriptor(Class<?>,String,Class<?>,String[],String,String)):
+ Likewise.
+ (EventSetDescriptor(Class<?>,Method[],Method,Method)): Likewise.
+ (EventSetDescriptor(String,Class<?>,MethodDescriptor,Method,Method)):
+ Likewise.
+ (getListenerType()): Likewise.
+ * java/beans/FeatureDescriptor.java:
+ (FeatureDescriptor()): Likewise.
+ (attributeNames()): Likewise.
+ * java/beans/IndexedPropertyDescriptor.java:
+ (IndexedPropertyDescriptor(String,Class<?>)): Likewise.
+ (IndexedPropertyDescriptor(String,Class<?>,String,String,String,String)):
+ Likewise.
+ (getIndexedPropertyType()): Likewise.
+ * java/beans/Introspector.java:
+ (getBeanInfo(Class<?>)): Likewise.
+ (flushFromCaches(Class<?>)): Likewise.
+ (getBeanInfo(Class<?>,Class<?>)): Likewise.
+ * java/beans/PropertyDescriptor.java:
+ (PropertyDescriptor(String,Class<?>)): Likewise.
+ (getPropertyType()): Likewise.
+ (getPropertyEditorClass()): Likewise.
+ (setPropertyEditorClass(Class<?>)): Likewise.
+ (checkMethods(Method,Method)): Likewise.
+ * java/beans/PropertyEditorManager.java:
+ (registerEditor(Class<?>,Class<?>)): Likewise.
+ (getEditor(Class<?>)): Likewise.
+ * java/io/ObjectInputStream.java:
+ (resolveClass(ObjectStreamClass)): Likewise.
+ * java/io/ObjectOutputStream.java:
+ (annotateClass(Class<?>)): Likewise.
+ (annotateProxyClass(Class<?>)): Likewise.
+ * java/io/ObjectStreamClass.java:
+ (lookup(Class<?>)): Likewise.
+ (forClass()): Likewise.
+ * java/io/ObjectStreamField.java:
+ (ObjectStreamField(String,Class<?>)): Likewise.
+ (ObjectStreamField(String,Class<?>,boolean)): Likewise.
+ * java/net/NetworkInterface.java:
+ (getInetAddresses()): Likewise.
+ (getNetworkInterfaces()): Likewise.
+ * java/net/URLClassLoader.java:
+ (findClass(String)): Likewise.
+ (findResources(String)): Likewise.
+ * java/net/URLConnection.java:
+ (getHeaderFields()): Likewise.
+ (getRequestProperties()): Likewise.
+ * javax/swing/text/TextAction.java:
+ (augmentList(Action[],Action[])): Likewise.
+ * javax/swing/text/html/HTML.java:
+ (attrMap): Likewise.
+ (tagMap): Likewise.
+ * javax/swing/text/html/parser/DTD.java:
+ (dtdHash): Likewise.
+ (elementHash): Likewise.
+ (entityHash): Likewise.
+ (defineAttributes(String,AttributeList)): Likewise.
+ (newElement(String)): Likewise.
+
2005-10-15 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* org/omg/CORBA/DynamicImplementation.java: Made concrete.
@@ -7436,6 +8046,77 @@
(initComponentDefaults): added default value for
'List.focusCellHighlightBorder'.
+2005-10-12 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/awt/datatransfer/DataFlavor.java:
+ (DataFlavor(Class<?>,String,String): Genericized.
+ * java/awt/dnd/DragGestureEvent.java:
+ (DragGestureEvent(DragGestureRecognizer,int,Point,
+ List<? extends InputEvent>)): Likewise.
+ (iterator()): Likewise.
+ * java/awt/dnd/DragSource.java:
+ (createDragGestureRecognizer(Class<T>,Component,int,
+ DragGestureListener)): Likewise.
+ * java/awt/dnd/DropTargetContext.java:
+ (getCurrentDataFlavorsAsList()): Likewise.
+ * java/awt/dnd/DropTargetDragEvent.java:
+ (getCurrentDataFlavorsAsList()): Likewise.
+ * java/awt/dnd/DropTargetDropEvent.java:
+ (getCurrentDataFlavorsAsList()): Likewise.
+ * java/awt/font/TextLayout.java:
+ (TextLayout(String,Map<? extends
+ AttributedCharacterIterator.Attribute>, FontRenderContext)): Likewise.
+ * java/awt/image/BufferedImage.java:
+ (BufferedImage(ColorModel,WritableRaster,boolean,Hashtable<?,?>)):
+ Likewise.
+ * java/awt/image/ImageConsumer.java:
+ (setProperties(Hashtable<?,?>)): Likewise.
+ * java/awt/image/MemoryImageSource.java:
+ (MemoryImageSource(int,int,ColorModel,byte[],int,int,Hashtable<?,?>)):
+ Likewise.
+ (MemoryImageSource(int,int,ColorModel,int[],int,int,Hashtable<?,?>)):
+ Likewise.
+ * java/awt/image/RenderedImage.java:
+ (getSources()): Likewise.
+ * java/awt/image/renderable/ParameterBlock.java:
+ (sources): Likewise.
+ (parameters): Likewise.
+ (ParameterBlock()): Likewise.
+ (ParameterBlock(Vector<Object>)): Likewise.
+ (ParameterBlock(Vector<Object>,Vector<Object>)): Likewise.
+ (clone()): Added casts to handle new Vector type.
+ (getSources()): Genericized.
+ (setSources(Vector<Object>)): Likewise.
+ (getParameters()): Likewise.
+ (setParameters(Vector<Object>)): Likewise.
+ * java/awt/image/renderable/RenderableImage.java:
+ (getSources()): Likewise.
+ * javax/swing/tree/DefaultMutableTreeNode.java:
+ (children): Likewise.
+ (getSharedAncestor(DefaultMutableTreeNode)): Likewise.
+ (getDepth()): Likewise.
+ (pathFromAncestorEnumeration(TreeNode)): Likewise.
+ (PostOrderEnumeration)): Likewise.
+ * javax/swing/undo/CompoundEdit.java:
+ (edits): Likewise.
+ (CompoundEdit()): Likewise.
+ (undo()): Likewise.
+ (redo()): Likewise.
+ (lastEdit()): Likewise.
+ (die()): Likewise.
+ (isSignificant()): Likewise.
+ * javax/swing/undo/UndoableEditSupport.java:
+ (listeners): Likewise.
+ (getUndoableEditListeners()): Likewise.
+ * lib/Makefile.am:
+ Turn off listing unused imports (at least for now).
+ * org/omg/CosNaming/_NamingContextExtImplBase.java:
+ (_methods): Likewise.
+ * org/omg/CosNaming/_NamingContextImplBase.java:
+ (methods): Likewise.
+ * vm/reference/java/lang/reflect/Method.java:
+ (getTypeParameters()): Corrected return type.
+
2005-10-12 Lillian Angel <langel@redhat.com>
* javax/swing/UIDefaults.java
@@ -8129,6 +8810,27 @@
(createLineBorder(Color)): Forward call to
createLineBorder(Color, int) with thickness of 1.
+2005-10-06 Tom Tromey <tromey@redhat.com>
+
+ * java/util/ListResourceBundle.java (getKeys): Fixed return type.
+ * java/util/ResourceBundle.java (getKeys): Fixed return type.
+ * java/util/AbstractMap.java (entrySet): Fixed return type.
+ (clone): Updated.
+ (equals): Likewise.
+ (iterator): Likewise.
+ * java/util/Collections.java (fill): Fixed argument type.
+ (reverse): Likewise.
+ (unmodifiableCollection): Likewise.
+ (UnmodifiableCollection): Likewise.
+ (UnmodifiableIterator): Likewise.
+ (unmodifiableSet): Likewise.
+ (UnmodifiableSet): Likewise.
+ (unmodifiableList): Likewise.
+ * java/util/TreeSet.java (TreeSet(SortedSet<T>)): Fixed argument
+ type.
+ (headSet): Fixed return type.
+ * java/util/StringTokenizer.java: Implements Enumeration<Object>.
+
2005-10-06 Anthony Green <green@redhat.com>
* native/jni/midi-dssi/gnu_javax_sound_midi_dssi_DSSISynthesizer.c
@@ -8278,6 +8980,93 @@
* configure.ac: Add Qt4 configury bits for OS-X.
+2005-10-05 Tom Tromey <tromey@redhat.com>
+
+ * java/util/jar/Attributes.java: Implements Map<Object,Object>.
+ (map): Changed type.
+ (entrySet): Changed return type.
+ (keySet): Likewise.
+ (putAll): Changed argument type.
+ (values): Changed return type.
+ * java/util/jar/Manifest.java (getEntries): Genericized.
+ (Manifest): Updated.
+ (entries): Changed type.
+ (read_individual_sections): Updated.
+ (read_section_name): Likewise.
+ (write_main_attributes): Likewise.
+ (write_attribute_entry): Likewise.
+ (write_individual_sections): Likewise.
+ (write_entry_attributes): Likewise.
+ * java/util/jar/JarFile.java (entries): Genericized.
+ (JarEnumeration): Implements Enumeration<JarEntry>.
+ (JarEnumeration.nextElement): Changed return type.
+ (JarEnumeration.entries): Changed type.
+
+2005-10-05 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/datatransfer/SystemFlavorMap.java (getNativesForFlavors):
+ Genericized.
+ (getFlavorsForNatives): Likewise.
+ (getFlavorsForNative): Likewise.
+ (getNativesForFlavor): Likewise.
+ * java/awt/datatransfer/DataFlavor.java (DataFlavor): Genericized.
+ (getDefaultRepresentationClass): Likewise.
+ (getRepresentationClass): Likewise.
+ (tryToLoadClass): Likewise.
+ (representationClass): Likewise.
+ * java/awt/datatransfer/FlavorTable.java (getNativesForFlavor):
+ Genericized.
+ (getFlavorsForNative): Likewise.
+ * java/awt/datatransfer/FlavorMap.java (getFlavorsForNatives):
+ Genericized.
+ (getNativesForFlavors): Likewise.
+
+2005-10-05 Tom Tromey <tromey@redhat.com>
+
+ * java/util/zip/ZipFile.java (entries): Fixed return type.
+
+2005-10-05 Tom Tromey <tromey@redhat.com>
+
+ * java/util/prefs/Preferences.java (systemNodeForPackage): Genericized.
+ (userNodeForPackage): Likewise.
+
+2005-10-05 Tom Tromey <tromey@redhat.com>
+
+ * javax/swing/tree/DefaultTreeSelectionModel.java (getListeners):
+ Genericized.
+ * javax/swing/tree/DefaultTreeModel.java (getListeners): Genericized.
+ * javax/swing/Timer.java (getListeners): Genericized.
+ * javax/swing/text/StyleContext.java (getListeners): Genericized.
+ * javax/swing/text/DefaultCaret.java (getListeners): Genericized.
+ * javax/swing/text/AbstractDocument.java (getListeners):
+ Genericized.
+ * javax/swing/table/DefaultTableColumnModel.java (getListeners):
+ Genericized.
+ * javax/swing/table/AbstractTableModel.java (getListeners):
+ Genericized.
+ * javax/swing/JComponent.java (getListeners): Genericized.
+ * javax/swing/DefaultSingleSelectionModel.java (getListeners):
+ Genericized.
+ * javax/swing/DefaultListSelectionModel.java (getListeners):
+ Genericized.
+ * javax/swing/DefaultButtonModel.java (getListeners): Genericized.
+ * javax/swing/DefaultBoundedRangeModel.java (getListeners):
+ Genericized.
+ * javax/swing/AbstractSpinnerModel.java (getListeners): Genericized.
+ * javax/swing/event/EventListenerList.java (add): Genericized.
+ (getListeners): Likewise.
+ (remove): Likewise.
+ * java/awt/dnd/DragSource.java (getListeners): Genericized.
+ * java/awt/TextField.java (getListeners): Genericized.
+ * java/awt/Window.java (getListeners): Genericized.
+ * java/awt/Scrollbar.java (getListeners): Genericized.
+ * java/awt/List.java (getListeners): Genericized.
+ * java/awt/Choice.java (getListeners): Genericized.
+ * java/awt/TextComponent.java (getListeners): Genericized.
+ * java/awt/CheckboxMenuItem.java (getListeners): Genericized.
+ * java/awt/Button.java (getListeners): Genericized.
+ * java/awt/Container.java (getListeners): Genericized.
+
2005-10-05 Lillian Angel <langel@redhat.com>
* javax/swing/plaf/basic/BasicTreeUI.java
@@ -8512,6 +9301,16 @@
(resizeAndRepaint): New method.
(initializeLocalVars): New method.
+2005-10-04 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/Dialog.java (show): Now deprecated.
+ (hide): Likewise.
+
+2005-10-04 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/ref/Reference.java (nextOnQueue): Changed type.
+ * java/lang/ref/ReferenceQueue.java (first): Changed type.
+
2005-10-04 David Gilbert <david.gilbert@object-refinery.com>
* javax/swing/plaf/basic/BasicFileChooserUI.java: Added API docs all
@@ -9045,6 +9844,21 @@
* javax/imageio/ImageWriter.java: Complete and document.
* javax/imageio/package.html: Write.
+2005-10-01 Jeroen Frijters <jeroen@frijters.net>
+
+ * vm/reference/java/lang/reflect/Constructor.java
+ (getSignature): New method.
+ (getGenericExceptionTypes): New method.
+ (getGenericParameterTypes): New method.
+ * vm/reference/java/lang/reflect/Field.java
+ (getGenericType): New method.
+ (getSignature): New method.
+ * vm/reference/java/lang/reflect/Method.java
+ (getSignature): New method.
+ (getGenericExceptionTypes): New method.
+ (getGenericParameterTypes): New method.
+ (getGenericReturnType): New method.
+
2005-10-01 Tom Tromey <tromey@redhat.com>
PR classpath/23890:
@@ -9090,6 +9904,14 @@
Call cairo_pattern_set_extend after gr->pattern has been set and checked
versus NULL.
+2005-09-30 Jeroen Frijters <jeroen@frijters.net>
+
+ * gnu/java/lang/reflect/FieldSignatureParser.java: New file.
+ * gnu/java/lang/reflect/ClassSignatureParser.java,
+ gnu/java/lang/reflect/GenericSignatureParser.java,
+ gnu/java/lang/reflect/MethodSignatureParser.java:
+ Finished implementation.
+
2005-09-30 Roman Kennke <kennke@aicas.com>
* javax/swing/JTextPane.java
@@ -9444,6 +10266,65 @@
* javax/swing/plaf/basic/BasicMenuItemUI.java
(paintMenuItem): adjusted arrow icon position.
+2005-09-28 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/java/awt/peer/qt/QtGraphics.java:
+ (getRenderingHints()): Create a clone as no such
+ constructor exists with generic typing.
+ (setRenderingHints(Map<?,?>)): Added parametric typing
+ and fixed use of RenderingHints constructor.
+ * java/awt/AWTEventMulticaster.java:
+ (getListeners(EventListener,Class<T>)): Added generic
+ typing.
+ * java/awt/Component.java:
+ (getListeners(Class<T>)): Likewise.
+ (getFocusTraversalKeys(int)): Likewise.
+ * java/awt/Font.java:
+ (Font(Map<? extends Attribute,?>)): Likewise.
+ (deriveFont(Map<? extends Attribute,?>)): Likewise.
+ (getAttributes()): Likewise.
+ (getAvailableAttributes()): Simplified naming with static import.
+ (getFont(Map<? extends Attribute,?>)): Added generic typing.
+ * java/awt/Graphics2D.java:
+ (setRenderingHints(Map<?,?>)): Likewise.
+ (addRenderingHints(Map<?,?>)): Likewise.
+ * java/awt/KeyboardFocusManager.java:
+ (setDefaultFocusTraversalKeys(int,Set<? extends KeyStroke>)):
+ Likewise.
+ (getKeyEventDispatchers()): Likewise.
+ (getKeyEventPostProcessors()): Likewise.
+ * java/awt/MenuItem.java:
+ (getListeners(Class<T>)): Likewise.
+ * java/awt/RenderingHints.java:
+ (RenderingHints(Map<Key,?>)): Likewise.
+ (putAll(Map<?,?>)): Likewise.
+ (keySet()): Likewise.
+ (values()): Likewise.
+ (entrySet()): Likewise.
+ * java/awt/Toolkit.java:
+ (desktopProperties): Likewise.
+ (createDragGestureRecognizer(Class<T>,DragSource,Component,int,
+ DragGestureListener)): Likewise.
+ (mapInputMethodHighlight(InputMethodHighlight)): Likewise.
+ * java/lang/Class.java:
+ (getDeclaringClass()): Likewise.
+ * java/lang/Enum.java:
+ (valueOf(Class<S>,String)): Fixed return type.
+ * java/lang/SecurityManager.java:
+ (checkMemberAccess(Class<?>,int)): Likewise.
+ * java/lang/reflect/Array.java:
+ (newInstance(Class<?>,int)): Likewise.
+ (newInstance(Class<?>,int[])): Likewise.
+ * vm/reference/java/lang/reflect/Constructor.java:
+ (getTypeParameters()): Type parameter changed from ? to Constructor.
+ * vm/reference/java/lang/reflect/Field.java:
+ (getDeclaringClass()): Added generic typing.
+ (getType()): Likewise.
+ * vm/reference/java/lang/reflect/Method.java:
+ (getDeclaringClass()): Likewise.
+ (getExceptionTypes()): Likewise.
+ (getParameterTypes()): Likewise.
+
2005-09-28 Anthony Balkissoon <abalkiss@redhat.com>
* javax/swing/text/AbstractDocument.java:
@@ -9689,6 +10570,79 @@
* javax/swing/plaf/metal/MetalBorders.java
(ToolBarBorder): now implements SwingConstants.
+2005-09-27 Tom Tromey <tromey@redhat.com>
+
+ * java/sql/Timestamp.java (compareTo(Date)): Changed argument type
+ from Object.
+ * javax/naming/Name.java (Name): Implements Comparable<Object>.
+ * java/util/Date.java (Date): Implements Comparable<Date>.
+ (compareTo(Object)): Removed.
+ * java/text/CollationKey.java (CollationKey): Implements
+ Comparable<CollationKey>.
+ (compareTo(Object)): Removed.
+ * java/net/URI.java (URI): Implements Comparable<URI>.
+ (compareTo): Updated argument type.
+ * java/math/BigDecimal.java (BigInteger): Implements
+ Comparable<BigDecimal>.
+ (compareTo(Object)): Removed.
+ * java/math/BigInteger.java (BigInteger): Implements
+ Comparable<BigInteger>.
+ (compareTo(Object)): Removed.
+ * java/io/File.java (File): Implements Comparable<File>.
+ (compareTo(Object)): Removed.
+
+2005-09-27 Tom Tromey <tromey@redhat.com>
+
+ * java/nio/charset/spi/CharsetProvider.java (charsets): Changed
+ return type.
+ * java/nio/charset/Charset.java (aliases): Changed return type.
+ (availableCharsets): Likewise.
+ * java/nio/channels/spi/AbstractSelector.java (cancelledKeys):
+ Changed type.
+ (AbstractSelector): Updated.
+ (cancelledKeys): Updated.
+
+2005-09-27 Tom Tromey <tromey@redhat.com>
+
+ * java/util/logging/LogManager.java (loggers): Genericized type.
+ (LogManager): Updated.
+ (addLogger): Likewise.
+ (findAncestor): Likewise.
+ (getLogger): Likewise.
+ (getLoggerNames): Fixed return type.
+ (reset): Updated.
+
+2005-09-27 Tom Tromey <tromey@redhat.com>
+
+ * java/util/zip/ZipFile.java (entries): Updated return type.
+ (ZipEntryEnumeration): Updated 'implements' type.
+ (entries): Updated type.
+ (ZipEntryEnumeration.elements): Likewise.
+ (readEntries): Updated.
+ (getEntries): Likewise.
+ (getEntry): Likewise.
+ (getInputStream): Likewise.
+
+2005-09-27 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/Compiler.java (compileClass): Updated argument type.
+
+2005-09-27 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/im/InputMethodHighlight.java (InputMethodHighlight):
+ Updated argument types.
+ (getStyle): Updated return type.
+ * java/awt/MenuBar.java (shortcuts): Updated return type.
+ * java/awt/Window.java (hide): Now deprecated.
+ (show): Likewise.
+
+2005-09-27 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/String.java (CASE_INSENSITIVE_ORDER): Now a
+ Comparator<String>.
+ (CaseInsensitiveComparator): Updated.
+ (CaseInsensitiveComparator.compare): Changed argument types.
+
2005-09-27 Anthony Green <green@redhat.com>
* javax/sound/midi/MidiSystem.java (getSequence): Add
@@ -9830,6 +10784,18 @@
* javax/sound/midi/MidiFileFormat.java (bytes, microseconds):
Rename to byteLength and microsecondLength respectively.
+2005-09-26 Tom Tromey <tromey@redhat.com>
+
+ * java/util/Formatter.java (format): Set fmtLocale.
+ (applyLocalization): New method.
+ (basicIntegralConversion): Likewise.
+ (hexOrOctalConversion): Use it.
+ (decimalConversion): New method.
+ (format): Use decimalConversion, dateTimeConversion.
+ (genericFormat): Upper-case earlier. Justify correctly.
+ (singleDateTimeConversion): New method.
+ (dateTimeConversion): Likewise.
+
2005-09-26 Lillian Angel <langel@redhat.com>
* javax/swing/ToolTipManager.java
@@ -9956,6 +10922,43 @@
(adjustGreater): New helper function.
(adjustSmaller): New helper function.
+2005-09-25 Jeroen Frijters <jeroen@frijters.net>
+
+ * gnu/java/lang/reflect/ClassSignatureParser.java,
+ gnu/java/lang/reflect/GenericSignatureParser.java,
+ gnu/java/lang/reflect/MethodSignatureParser.java: New files.
+ * java/lang/Class.java
+ (constructor): Changed type to generic type.
+ (cast, getEnumConstants): Added cast.
+ (getGenericInterfaces, getGenericSuperclass, getTypeParameters):
+ Implemented.
+ * vm/reference/java/lang/VMClass.java
+ (getSimpleName, getDeclaredAnnotations, getCanonicalName,
+ getEnclosingClass, getEnclosingConstructor, getEnclosingMethod,
+ isAnonymousClass, isLocalClass, isMemberClass):
+ Removed generic types from signatures.
+ (getGenericInterfaces, getGenericSuperclass, getTypeParameters):
+ Removed.
+ (getClassSignature): New method.
+ * vm/reference/java/lang/reflect/Constructor.java
+ (getTypeParameters): Implemented.
+ * vm/reference/java/lang/reflect/Method.java
+ (getTypeParameters, getSignature): New methods.
+
+2005-09-25 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/lang/System.java,
+ vm/reference/java/lang/VMSystem.java: Removed generic type
+ from VMSystem.environ() signature.
+
+2005-09-25 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/lang/MalformedParameterizedTypeException.java: Removed.
+
+2005-09-25 Tom Tromey <tromey@redhat.com>
+
+ * java/util/Formatter.java (lineSeparator): Use SystemProperties.
+
2005-09-25 Casey Marshall <csm@gnu.org>
Fixes PR classpath/23916. Fix suggested by Santiago Gala
@@ -9997,6 +11000,26 @@
* gnu/java/security/provider/DiffieHellmanKeyPairGeneratorImpl.java:
new files.
+2005-09-24 Tom Tromey <tromey@redhat.com>
+
+ * java/util/FormattableFlags.java (PLUS, SPACE, ZERO, COMMA,
+ PAREN): New constants.
+ * java/util/UnknownFormatConversionException.java
+ (UnknownFormatConversionException): Set exception text.
+ * java/util/IllegalFormatException.java (IllegalFormatException):
+ New constructor.
+ * java/util/FormatFlagsConversionMismatchException.java
+ (FormatFlagsConversionMismatchException): Set exception text.
+ * java/lang/String.java (format): New methods.
+ * java/io/PrintStream.java (printf): New methods.
+ (format): Likewise.
+ * java/io/PrintWriter.java (printf): New methods.
+ (format): Likewise.
+ * java/util/Formattable.java: New file.
+ * java/util/FormatterClosedException.java (serialVersionUID):
+ Fixed.
+ * java/util/Formatter.java: New file.
+
2005-09-24 Roman Kennke <kennke@aicas.com>
* javax/swing/SizeRequirements.java
@@ -10555,11 +11578,57 @@
* javax/swing/filechooser/FileFilter.java: reformatted and added API
docs.
-2004-10-09 Tom Tromey <tromey@redhat.com>
-
- * java/lang/ClassLoader.java
- (defineClass(String,ByteBuffer,ProtectionDomain)): New method.
+2005-09-21 Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * gnu/classpath/ByteArray.java,
+ * gnu/classpath/ObjectPool.java,
+ * gnu/javax/crypto/DiffieHellmanImpl.java,
+ * gnu/javax/crypto/GnuDHPrivateKey.java,
+ * gnu/javax/crypto/RSACipherImpl.java,
+ * java/lang/Deprecated.java,
+ * java/lang/Enum.java,
+ * java/lang/Iterable.java,
+ * java/lang/MalformedParameterizedTypeException.java,
+ * java/lang/Override.java,
+ * java/lang/ProcessBuilder.java,
+ * java/lang/SuppressWarnings.java,
+ * java/lang/annotation/Annotation.java,
+ * java/lang/annotation/Documented.java,
+ * java/lang/annotation/ElementType.java,
+ * java/lang/annotation/IncompleteAnnotationException.java,
+ * java/lang/annotation/Inherited.java,
+ * java/lang/annotation/Retention.java,
+ * java/lang/annotation/RetentionPolicy.java,
+ * java/lang/annotation/Target.java,
+ * java/lang/reflect/AnnotatedElement.java,
+ * java/lang/reflect/GenericDeclaration.java,
+ * java/lang/reflect/MalformedParameterizedTypeException.java,
+ * java/lang/reflect/TypeVariable.java,
+ * java/util/AbstractQueue.java,
+ * java/util/DuplicateFormatFlagsException.java,
+ * java/util/EnumMap.java,
+ * java/util/EnumSet.java,
+ * java/util/FormatFlagsConversionMismatchException.java,
+ * java/util/FormatterClosedException.java,
+ * java/util/IllegalFormatCodePointException.java,
+ * java/util/IllegalFormatConversionException.java,
+ * java/util/IllegalFormatException.java,
+ * java/util/IllegalFormatFlagsException.java,
+ * java/util/IllegalFormatPrecisionException.java,
+ * java/util/IllegalFormatWidthException.java,
+ * java/util/InputMismatchException.java,
+ * java/util/InvalidPropertiesFormatException.java,
+ * java/util/MissingFormatArgumentException.java,
+ * java/util/MissingFormatWidthException.java,
+ * java/util/PriorityQueue.java,
+ * java/util/Queue.java,
+ * java/util/UnknownFormatConversionException.java,
+ * java/util/UnknownFormatFlagsException.java,
+ * org/omg/CORBA/SendingContext/RunTimeOperations.java,
+ * org/omg/CORBA/SendingContext/Runtime.java,
+ * vm/reference/java/lang/VMPackage.java:
+ Fixed address within GPL.
+
2005-09-21 Lillian Angel <langel@redhat.com>
* javax/swing/ToolTipManager.java
@@ -10797,6 +11866,36 @@
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
(isRealized): Leave GDK critical region when exiting early.
+2005-09-19 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/util/Collections.java:
+ Fixes Bug #PR22921.
+ (emptySet()): Implemented.
+ (emptyList()): Implemented.
+ (emptyMap()): Implemented.
+ (rotate(List<?>,int)): Fixed signature.
+ (shuffle(List<?>)): Fixed signature.
+ (shuffle(List<?>,Random)): Fixed signature.
+ (frequency(Collection<?>,Object)): Documented.
+ (addAll(Collection<? super T>, T... a)): Implemented.
+ (disjoint(Collection<?>,Collection<?>)): Implemented.
+ (swap(List<?>,int,int)): Fixed signature.
+ (checkedCollection(Collection<E>,Class<E>)): Implemented.
+ (Collections.CheckedCollection): New inner class.
+ (Collections.CheckedIterator): New inner class.
+ (checkedList(List<E>, Class<E>)): Implemented.
+ (Collections.CheckedList): New inner class.
+ (Collections.CheckedRandomAccessList): New inner class.
+ (Collections.CheckedListIterator): New inner class.
+ (checkedMap(Map<K,V>,Class<K>,Class<V>)): Implemented.
+ (Collections.CheckedMap): New inner class.
+ (checkedSet(Set<E>,Class<E>)): Implemented.
+ (Collections.CheckedSet): New inner class.
+ (checkedSortedMap(SortedMap<K,V>,Class<K>,Class<V>)): Implemented.
+ (Collections.CheckedSortedMap): New inner class.
+ (checkedSortedSet(SortedSet<E>,Class<E>)): Implemented.
+ (Collections.CheckedSortedSet): New inner class.
+
2005-09-19 Tom Tromey <tromey@redhat.com>
* java/awt/PopupMenu.java (AccessibleAWTPopupMenu.serialVersionUID):
@@ -11414,6 +12513,10 @@
(ButtonBorder.paintBorder): draw a different border for a disabled
button.
+2005-09-15 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/EnumConstantNotPresentException.java: New file.
+
2005-09-15 Anthony Green <green@redhat.com>
* java/awt/Color.java (RGBtoHSB): Don't use integer division when
@@ -15789,9 +16892,80 @@
2005-08-14 Sven de Marothy <sven@physto.se>
+ * gnu/java/awt/ClasspathToolkit.java
+ (getScreenSize, getColorModel, getFontMetrics, getImage, createImage,
+ createImageProducer, registerImageIOSpis):
+ Remove redundant (overloaded) methods.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java
+ (registerImageIOSpis): Move registration to static initializer.
+ * javax/imageio/spi/IIORegistry.java:
+ Remove call to Toolkit registration method.
+
+2005-08-13 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java (repaintTimer): Make
+ field final.
+
+2005-08-14 Sven de Marothy <sven@physto.se>
+
* java/awt/Container.java
(addImpl): Call addNotify() only if the container has a peer.
+2005-08-13 Tom Tromey <tromey@redhat.com>
+
+ * java/util/Collections.java (reverseOrder): New method.
+ (frequency): Likewise.
+ (ReverseComparator): No longer final.
+
+2005-08-13 Tom Tromey <tromey@redhat.com>
+
+ * java/util/Timer.java (Timer(String)): New constructor.
+ (Timer(String,boolean)): Likewise.
+ (purge): New method.
+ (TaskQueue.purge): Likewise.
+
+2005-08-13 Tom Tromey <tromey@redhat.com>
+
+ * java/util/FormattableFlags.java: New file.
+
+2005-08-13 Tom Tromey <tromey@redhat.com>
+
+ * java/util/UnknownFormatConversionException.java
+ (serialVersionUID): New field.
+ (s): Renamed from 'conv' for serialization.
+ * java/util/MissingFormatWidthException.java (serialVersionUID):
+ New field.
+ (s): Renamed from 'width' for serialization.
+ * java/util/MissingFormatArgumentException.java
+ (serialVersionUID): New field.
+ (s): Renamed from 'spec' for serialization.
+ * java/util/IllegalFormatWidthException.java (serialVersionUID):
+ New field.
+ (w): Renamed from 'width' for serialization.
+ * java/util/IllegalFormatPrecisionException.java
+ (serialVersionUID): New field.
+ (p): Renamed from 'precision' for serialization.
+ * java/util/IllegalFormatFlagsException.java (serialVersionUID):
+ New field.
+ * java/util/IllegalFormatConversionException.java
+ (serialVersionUID): New field.
+ (c): Renamed from 'conv' for serialization.
+ (arg): Renamed from 'argClass' for serialization.
+ * java/util/IllegalFormatCodePointException.java
+ (serialVersionUID): New field.
+ (c): Renamed from 'codepoint' for serialization.
+ * java/util/FormatFlagsConversionMismatchException.java
+ (serialVersionUID): New field.
+ (f): Renamed from 'flags' for serialization.
+ (c): Renamed from 'conversion' for serialization.
+ * java/util/DuplicateFormatFlagsException.java (serialVersionUID):
+ New field.
+ * java/util/IllegalFormatException.java (serialVersionUID): New
+ field.
+ * java/util/FormatterClosedException.java (serialVersionUID): New
+ field.
+ * java/util/InvalidPropertiesFormatException.java: New file.
+
2005-08-13 Jeroen Frijters <jeroen@frijters.net>
* java/io/ObjectInputStream.java
@@ -16761,6 +17935,11 @@
(installUI): set the items visible. Fixes exceptions that are
thrown because item is not explicitly set visible.
+2005-08-03 Ewout Prangsma <ewout@prangsma.net>
+
+ * java/lang/Enum.java:
+ (valueOf(Class<S>,String)): Implemented.
+
2005-08-03 Roman Kennke <roman@kennke.org>
* javax/swing/plaf/basic/BasicViewportUI.java
@@ -17116,7 +18295,7 @@
* scripts/eclipse-gnu.xml: Drop extends, implements,
throws into new line.
-2005-07-31 Jan Roehrich <jan@roehrich.info>
+2005-07-31 Jan Roehrich <jan@roehrich.info>
* javax.swing.plaf.basic.BasicTreeUI: fixed indentation.
@@ -21087,6 +22266,12 @@
* org/omg/IOP/TransactionService.java,
org/omg/IOP/CodeSets.java: New files.
+2005-06-17 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/lang/ThreadLocal.java,
+ java/util/TreeMap.java: Fixes to make compiling with Eclipse Java
+ Compiler SVN HEAD possible.
+
2005-06-17 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* org/omg/PortableServer/ID_ASSIGNMENT_POLICY_ID.java,
@@ -21414,6 +22599,21 @@
* java/util/regex/Pattern.java (constructor): Switch syntax from PERL5
to JAVA_1_4.
+2005-06-11 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * doc/unicode/Blocks-4.0.0.txt:
+ New block listings for Unicode 4.0.0.
+ * java/lang/Character.java:
+ Added new fields for 1.5, both in Character and UnicodeBlock.
+ (UnicodeBlock.of(int)): Implemented.
+ (UnicodeBlock.forName(String)): Implemented.
+ * java/lang/annotation/ElementType.java:
+ Corrected serial UID.
+ * java/lang/annotation/RetentionPolicy.java:
+ Likewise.
+ * scripts/unicode-blocks.pl
+ Updated to handle Unicode 4.0.0.
+
2005-06-11 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* org/omg/CORBA/ORB.java,
@@ -21488,6 +22688,72 @@
(gdkDrawDrawable): Check if cairo pattern is non-null before
setting its matrix.
+2005-06-09 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/Class.java:
+ (internalGetClasses()): Use collections with type parameters.
+ (internalGetFields()): Likewise.
+ (internalGetMethods()): Likewise.
+ (getSuperclass()): Changed to new return type.
+ (asSubclass(Class<U>)): Documented.
+ (getEnumConstants()): Calls VMClass.
+ (getAnnotation(Class<?>)): Implemented.
+ (getAnnotations()): Implemented.
+ (getCanonicalName()): Implemented.
+ (getDeclaredAnnotations()): Implemented.
+ (getEnclosingClass()): Implemented.
+ (getEnclosingConstructor()): Implemented.
+ (getEnclosingMethod()): Implemented.
+ (getGenericInterfaces()): Implemented.
+ (getGenericSuperclass()): Implemented.
+ (getTypeParameters()): Implemented.
+ (isAnnotationPresent(Class<?>)): Implemented.
+ (isAnonymousClass()): Implemented.
+ (isLocalClass()): Implemented.
+ (isMemberClass()): Implemented.
+ * java/lang/Package.java:
+ (getAnnotation(Class<?>)): Implemented.
+ (getAnnotations()): Implemented.
+ (getDeclaredAnnotations()): Implemented.
+ (isAnnotationPresent(Class<?>)): Implemented.
+ * java/lang/annotation/AnnotationTypeMismatchException.java:
+ Added serial version UID.
+ * java/lang/annotation/ElementType.java: Likewise.
+ * java/lang/annotation/RetentionPolicy.java: Likewise.
+ * java/lang/reflect/AnnotatedElement.java: Documented.
+ * java/lang/reflect/Modifier.java:
+ (toString(int)): Switched to using StringBuilder.
+ (toString(int,StringBuilder)): Likewise.
+ * vm/reference/java/lang/VMClass.java:
+ (getSuperClass(Class<T>)): Updated return type.
+ (getSimpleName(Class<?>)): Use VM methods directly.
+ (getEnumConstants(Class<T>)): Implementation moved from Class.
+ (getDeclaredAnnotations(Class<?>)): New native method.
+ (getCanonicalName(Class<?>)): Implemented.
+ (getEnclosingClass(Class<?>)): New native method.
+ (getEnclosingConstructor(Class<?>)): New native method.
+ (getEnclosingMethod(Class<?>)): New native method.
+ (getGenericInterfaces(Class<?>)): New native method.
+ (getGenericSuperclass(Class<?>)): New native method.
+ (getTypeParameters(Class<T>)): New native method.
+ (isAnonymousClass(Class<?>)): New native method.
+ (isLocalClass(Class<?>)): New native method.
+ (isMemberClass(Class<?>)): New native method.
+ * vm/reference/java/lang/VMPackage.java:
+ New VM class corresponding to java.lang.Package.
+ (getDeclaredAnnotations(Class<?>)): New native method.
+ * vm/reference/java/lang/VMSystem.java:
+ Removed unnecessary imports.
+ * vm/reference/java/lang/reflect/Constructor.java:
+ (toString()): Changed StringBuffer to StringBuilder.
+ (getTypeParameters()): Changed to native method.
+ * vm/reference/java/lang/reflect/Field.java:
+ (toString()): Changed StringBuffer to StringBuilder.
+ * vm/reference/java/lang/reflect/Method.java:
+ (getReturnType()): Updated return type.
+ (toString()): Changed StringBuffer to StringBuilder.
+ (invoke(Object,...)): Updated arguments.
+
2005-06-09 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkPanelPeer.java,
@@ -22201,8 +23467,8 @@
2005-05-29 Audrius Meskauskas <AudriusA@Bioinformatics.org>
- * org/omg/CORBA/Functional_ORB.java (serve, useProperties, init): Implementing
- the property-configurable time-outs.
+ * org/omg/CORBA/Functional_ORB.java (serve, useProperties, init):
+ Implementing the property-configurable time-outs.
2005-05-29 Audrius Meskauskas <AudriusA@Bioinformatics.org>
@@ -24037,11 +25303,38 @@
(getPreferredSpan): Corrected the calculation of the span of
the view.
+2005-05-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/Class.java:
+ (getSimpleName()): Implemented.
+ * vm/reference/java/lang/VMClass.java:
+ (getSimpleName()): Reference implementation.
+
+2005-05-05 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * include/java_lang_VMProcess.h:
+ Regenerated.
+ * native/jni/java-lang/java_lang_VMProcess.c:
+ Added missing #include statement.
+
2005-05-05 Chris Burdess <dog@gnu.org>
* gnu/xml/transform/StreamSerializer.java: Produce compact,
human-readable XML for non-UTF/ASCII encodings using NIO.
+2005-05-04 Tom Tromey <tromey@redhat.com>
+
+ * native/jni/java-lang/java_lang_VMProcess.c
+ (Java_java_lang_VMProcess_nativeSpawn): Added 'redirect'
+ argument. Use defines instead of contents.
+ * vm/reference/java/lang/VMProcess.java (redirect): New field.
+ (spawn): Updated.
+ (setProcessInfo): Updated.
+ (VMProcess): Added 'redirect' argument.
+ (nativeSpawn): Likewise.
+ (exec): New overload.
+ * java/lang/ProcessBuilder.java: New file.
+
2005-05-04 Mark Wielaard <mark@klomp.org>
* java/awt/BufferCapabilities.java (BufferCapabilities): Make
@@ -24277,7 +25570,7 @@
2005-04-28 Robert Schuster <thebohemian@gmx.net>
- * java/beans/Introspector.java: Fixed bug #12624, BeanDescriptors
+ * java/beans/Introspector: Fixed bug #12624, BeanDescriptors
will now be set correctly.
(flushCaches): Now flushes all cached intermediate data.
@@ -24710,6 +26003,118 @@
include/gnu_java_nio_charset_iconv_IconvEncoder.h:
Regenerated with gcjh from gcc 4.0 branch.
+2005-04-20 Tom Tromey <tromey@redhat.com>
+
+ * .classpath: Updated.
+
+2005-04-20 Tom Tromey <tromey@redhat.com>
+
+ * vm/reference/java/lang/VMThread.java (run): Use thread's
+ uncaught handler.
+ * java/lang/Thread.java (defaultHandler): New field.
+ (setDefaultUncaughtExceptionHandler,
+ getDefaultUncaughtExceptionHandler, setUncaughtExceptionHandler,
+ getUncaughtExceptionHandler): New methods.
+ * java/lang/ThreadGroup.java (ThreadGroup): Implements
+ UncaughtExceptionHandler.
+ (uncaughtException): Use getDefaultUncaughtExceptionHandler.
+
+2005-04-20 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/reflect/MalformedParameterizedTypeException.java: New
+ file.
+
+2005-04-20 Tom Tromey <tromey@redhat.com>
+
+ * java/util/PriorityQueue.java (PriorityQueue): Implements
+ Serializable.
+ (serialVersionUID): New field.
+ * java/util/EnumMap.java (serialVersionUID): New field.
+ * java/util/EnumSet.java (serialVersionUID): New field.
+
+2005-04-20 Tom Tromey <tromey@redhat.com>
+
+ * java/util/Arrays.java (hashCode): New methods.
+ (deepHashCode): New method.
+ (deepEquals): Likewise.
+ (toString): New methods.
+ (deepToString): New method.
+
+2005-04-20 Tom Tromey <tromey@redhat.com>
+
+ * java/util/zip/Inflater.java (getTotalIn): Deprecated.
+ (getBytesRead): New method
+ (getTotalOut): Deprecated.
+ (getBytesWritten): New method.
+ (totalIn, totalOut): Now 'long'.
+ * java/util/zip/DeflaterEngine.java (totalIn): Now 'long'.
+ (getTotalIn): Return 'long'.
+ * java/util/zip/Deflater.java (totalOut): Now 'long'.
+ (getTotalOut): Deprecated.
+ (getBytesWritten): New method.
+ (getTotalIn): Deprecated.
+ (getBytesRead): New method.
+
+2005-04-20 Tom Tromey <tromey@redhat.com>
+
+ * java/nio/charset/Charset.java (compareTo): Changed argument
+ type.
+ * java/nio/ShortBuffer.java (compareTo): Changed argument type.
+ * java/nio/LongBuffer.java (compareTo): Changed argument type.
+ * java/nio/IntBuffer.java (compareTo): Changed argument type.
+ * java/nio/FloatBuffer.java (compareTo): Changed argument type.
+ * java/nio/DoubleBuffer.java (compareTo): Changed argument type.
+ * java/nio/ByteBuffer.java (compareTo): Changed argument type.
+ * java/nio/CharBuffer.java (CharBuffer): Implements Readable,
+ Appendable.
+ (append): New methods.
+ (compareTo): Changed argument type.
+ (read): New method.
+
+2005-04-20 Tom Tromey <tromey@redhat.com>
+
+ * java/io/PrintStream.java (append): Don't throw IOException.
+ * java/io/StringWriter.java (append): New overloads.
+ * java/io/PrintWriter.java (append): New overloads.
+ (PrintWriter): New constructors.
+ * java/io/CharArrayWriter.java (append): New overloads.
+ * java/io/RandomAccessFile.java (RandomAccessFile): Implements
+ Closeable.
+ * java/io/Reader.java (Reader): Implements Readable.
+ (read): New method.
+
+2005-04-20 Tom Tromey <tromey@redhat.com>
+
+ * java/math/BigInteger.java (TEN): New constant.
+ * java/math/BigDecimal.java (ZERO, ONE): Now public.
+ (TEN): New constant.
+
+2005-04-20 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/Short.java (reverseBytes): Argument is 'short'.
+
+2005-04-20 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/ThreadLocal.java (remove): New method.
+
+2005-04-20 Tom Tromey <tromey@redhat.com>
+
+ * java/util/DuplicateFormatFlagsException.java: New file.
+ * java/util/FormatFlagsConversionMismatchException.java: New
+ file.
+ * java/util/FormatterClosedException.java: New file.
+ * java/util/IllegalFormatCodePointException.java: New file.
+ * java/util/IllegalFormatConversionException.java: New file.
+ * java/util/UnknownFormatFlagsException.java: New file.
+ * java/util/UnknownFormatConversionException.java: New file.
+ * java/util/MissingFormatWidthException.java: New file.
+ * java/util/MissingFormatArgumentException.java: New file.
+ * java/util/InputMismatchException.java: New file.
+ * java/util/IllegalFormatWidthException.java: New file.
+ * java/util/IllegalFormatPrecisionException.java: New file.
+ * java/util/IllegalFormatFlagsException.java: New file.
+ * java/util/IllegalFormatException.java: New file.
+
2005-04-20 Roman Kennke <roman@kennke.org>
* javax/swing/plaf/basic/BasicLookAndFeel.java
@@ -24829,6 +26234,12 @@
* gnu/java/io/encode/package.html:
Removed
+2005-04-19 Sven de Marothy <sven@physto.se>
+
+ * java/util/Calendar.java:
+ (compareTo(java.util.Calendar)): Handle instability
+ in obtaining the milliseconds value.
+
2005-04-19 Michael Koch <konqueror@gmx.de>
* java/awt/geom/QuadCurve2D.java:
@@ -25041,9 +26452,42 @@
2005-04-17 Roman Kennke <roman@kennke.org>
* javax/swing/text/SimpleAttributeSet.java
+ (addAttribute): Removed null pointer check.
+ * javax/swing/text/StyleContext.java
+ (NamedStyle.setResolveParent): Added null pointer check.
+
+2005-04-17 Roman Kennke <roman@kennke.org>
+
+ * examples/gnu/classpath/exammples/swing/Demo.java:
+ Print a short summary for available values for the property
+ swing.defaultlaf.
+ Set MetalLookAndFeel as default.
+ Pulled out GNULookAndFeel so that it is accessible.
+ * examples/gnu/classpath/exammples/swing/GNULookAndFeel.java:
+ Pulled out this class from Demo.java.
+
+2005-04-17 Roman Kennke <roman@kennke.org>
+
+ * javax/swing/UIManager.java:
+ Make the UIManager respect the swing.defaultlaf system
+ property.
+
+2005-04-17 Roman Kennke <roman@kennke.org>
+
+ * javax/swing/text/SimpleAttributeSet.java
(addAttribute): Check for null and remove key in that case.
This fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21064 .
+2005-04-16 Ewout Prangsma <ewout@prangsma.net>
+
+ * java/util/PriorityQueue.java:
+ (PriorityQueue(Collection<? extends E>)): Added explicit cast
+ for comparators.
+ (PriorityQueue(PriorityQueue<? extends E>)): Likewise.
+ (PriorityQueue(SortedSet<? extends E>)): Likewise.
+ * java/util/TreeSet.java:
+ (TreeSet(SortedSet<? extends T>)): Likewise.
+
2005-04-16 Roman Kennke <roman@kennke.org>
* java/awt/BorderLayout.java
@@ -25674,6 +27118,36 @@
the whole screen. This is not a fully accelerated fullscreen
exclusive mode.
+2005-04-04 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/Class.java:
+ (newInstance): Returns an instance of T instead of Object.
+ (isEnum()): Now calls VMClass for a proper implementation.
+ (isSynthetic()): New method implemented.
+ (isAnnotation()): New method implemented.
+ * vm/reference/java/lang/VMClass.java:
+ (isEnum()): New native method.
+ (isSynthetic()): New native method.
+ (isAnnotation()): New native method.
+ * vm/reference/java/lang/reflect/Constructor.java:
+ (newInstance(Object...)): Changed input parameter to a vararg.
+
+2005-04-03 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/System.java:
+ (getenv()): Use Collections.unmodifiableMap to wrap an
+ EnvironmentMap.
+ (EnvironmentCollection): Reduced to just String check changes.
+ (EnvironmentSet): Likewise.
+ (EnvironmentMap): Likewise.
+ (EnvironmentIterator): Removed.
+
+2005-04-02 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/StringBuilder.java:
+ Change references to System.arraycopy to
+ VMSystem.arraycopy.
+
2005-04-03 Guilhem Lavaux <guilhem@kaffe.org>
Rei Odaira <ray@is.s.u-tokyo.ac.jp>
@@ -25841,7 +27315,7 @@
* gnu/xml/dom/html2/DomHTMLParser.java:
Changed 'enum' references to become 'enumeration'.
-
+
2005-03-22 Archie Cobbs <archie@dellroad.org>
* configure.ac: Generate scripts/classpath.spec.
@@ -25863,7 +27337,19 @@
* doc/www.gnu.org/events/escape_fosdem05.wml: Add link to kaffe
presentation.
-2005-03-17 Archie Cobbs <archie@dellroad.org>
+2005-03-21 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/Class.java:
+ Implements java.lang.reflect.Type
+ * java/lang/ClassLoader.java:
+ (getResources(String)): No longer final.
+ * java/lang/Enum.java:
+ Added serialization UID.
+ * java/lang/Thread.java:
+ (destroy()): Deprecated.
+ (Thread.State): Added serialization UID.
+
+2005-03-19 Archie Cobbs <archie@dellroad.org>
* vm/reference/java/lang/VMClassLoader.java: handle ZIP files
on the boot loader class path in getResources()
@@ -25875,6 +27361,22 @@
org/omg/CORBA/CompletionStatusHelper.java:
New files.
+2005-03-19 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/IllegalArgumentException:
+ (IllegalArgumentException(String, Throwable)):
+ Implemented.
+ (IllegalArgumentException(Throwable)): Likewise.
+ (IllegalStateException(String, Throwable)):
+ Implemented.
+ (IllegalStateException(Throwable)): Likewise.
+ (SecurityException(String, Throwable)):
+ Implemented.
+ (SecurityException(Throwable)): Likewise.
+ (UnsupportedOperationException(String, Throwable)):
+ Implemented.
+ (UnsupportedOperationException(Throwable)): Likewise.
+
2005-03-18 Mark Wielaard <mark@klomp.org>
* doc/www/downloads/downloads.wml: Add 0.14.
@@ -25885,17 +27387,6 @@
* java/util/zip/GZIPInputStream.java:
(GZIPInputStream): Read header in constructor.
-2005-03-18 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- * gnu/javax/swing/text/html/parser/htmlAttributeSet.java:
- (getAttributeNames()): Replaced 'enum' with 'enumeration'.
- * gnu/javax/swing/text/html/parser/htmlValidator.java:
- (validateParameters(TagElement,htmlAttributeSet)):
- Replaced 'enum' with 'enumeration'.
- (validateAttribute(TagElement,htmlAttributeSet,
- Enumeration,Enumeration)):
- Likewise.
-
2005-03-18 Audrius Meskauskas <audriusa@bluewin.ch>
* ChangeLog.usermap: New file (replacing).
@@ -26065,6 +27556,17 @@
* gnu/xml/aelfred2/XmlParser.java: Fixed typo.
+2005-03-13 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/javax/swing/text/html/parser/htmlAttributeSet.java:
+ (getAttributeNames()): Replaced 'enum' with 'enumeration'.
+ * gnu/javax/swing/text/html/parser/htmlValidator.java:
+ (validateParameters(TagElement,htmlAttributeSet)):
+ Replaced 'enum' with 'enumeration'.
+ (validateAttribute(TagElement,htmlAttributeSet,
+ Enumeration,Enumeration)):
+ Likewise.
+
2005-03-12 Audrius Meskauskas <audriusa@bluewin.ch>
* org/omg/CORBA/StringSeqHelper.java,
@@ -26787,14 +28289,14 @@
org/omg/CORBA/CompletionStatus.java:
Documenting that serialVersionUID is from v1.4.
-2005-04-06 Audrius Meskauskas <audriusa@bluewin.ch>
+2005-03-06 Audrius Meskauskas <audriusa@bluewin.ch>
* org/omg/CORBA/Context.java,
org/omg/CORBA/ContextList.java: New files.
-2005-04-06 Audrius Meskauskas <audriusa@bluewin.ch>
+2005-03-06 Audrius Meskauskas <audriusa@bluewin.ch>
* org/omg/CORBA/TCKind.java: Making fields final.
-2005-04-06 Audrius Meskauskas <audriusa@bluewin.ch>
+2005-03-06 Audrius Meskauskas <audriusa@bluewin.ch>
* org/omg/CORBA/Any.java,
org/omg/CORBA/Principal.java,
@@ -27404,16 +28906,6 @@
2005-02-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
- Merge of interfaces and exceptions to HEAD from
- the generics branch.
-
- * java/lang/StringBuilder.java: Serial version updated.
- * java/lang/annotation/AnnotationTypeMismatchException.java: Likewise.
-
- Changes from generics branch:
-
- 2005-02-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
* java/io/Closeable.java: Documented.
* java/io/Flushable.java: Documented.
* java/lang/Appendable.java: Corrected line overrun.
@@ -27426,34 +28918,100 @@
* java/lang/reflect/ParameterizedType.java: Likewise.
* java/lang/reflect/Type.java: Likewise.
* java/lang/reflect/WildcardType.java: Likewise.
-
- 2005-01-07 Andrew John Hughes <gnu_andrew@member.fsf.org>
- * java/lang/annotation/AnnotationTypeMismatchException.java:
- Added import of java.lang.reflect.Method
+2005-02-20 Mark Wielaard <mark@klomp.org>
- 2004-08-26 Tom Tromey <tromey@redhat.com>
+ * java/util/SimpleTimeZone.java (getOffset): Calculate beforeEnd by
+ taking dstSavings into account.
- * java/lang/reflect/GenericSignatureFormatError.java: New file.
- * java/lang/reflect/WildcardType.java: New file.
- * java/lang/reflect/ParameterizedType.java: New file.
- * java/lang/reflect/GenericArrayType.java: New file.
- * java/lang/reflect/Type.java: New file.
- * java/io/Flushable.java: New file.
- * java/io/Closeable.java: New file.
+2005-02-20 Sven de Marothy <sven@physto.se>
- 2004-08-07 Tom Tromey <tromey@redhat.com>
-
- * java/lang/annotation/AnnotationFormatError.java: New file.
- * java/lang/annotation/AnnotationTypeMismatchException.java: New
- file.
+ * java/text/SimpleDateFormat.java,
+ (parse): Set DST_OFFSET to the correct value.
- 2004-08-06 Tom Tromey <tromey@redhat.com>
+2005-02-20 Rutger Ovidius <ovidr@users.sourceforge.net>
- * java/lang/Readable.java: New file.
+ * gnu/java/security/provider/Gnu.java (Gnu): Add SHA-160 alias.
2005-02-20 Mark Wielaard <mark@klomp.org>
+ * java/text/SimpleDateFormat.java
+ (SimpleDateFormat(String, DateFormatSymbols)): Throw
+ NullPointerException when formatData is null.
+
+2005-02-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/locale/LocaleInformation_af.java,
+ gnu/java/locale/LocaleInformation_am.java,
+ gnu/java/locale/LocaleInformation_ca.java,
+ gnu/java/locale/LocaleInformation_cs.java,
+ gnu/java/locale/LocaleInformation_cy.java,
+ gnu/java/locale/LocaleInformation_da.java,
+ gnu/java/locale/LocaleInformation_de.java,
+ gnu/java/locale/LocaleInformation_el.java,
+ gnu/java/locale/LocaleInformation_en.java,
+ gnu/java/locale/LocaleInformation_eo.java,
+ gnu/java/locale/LocaleInformation_es.java,
+ gnu/java/locale/LocaleInformation_et.java,
+ gnu/java/locale/LocaleInformation_eu.java,
+ gnu/java/locale/LocaleInformation_fa.java,
+ gnu/java/locale/LocaleInformation_fi.java,
+ gnu/java/locale/LocaleInformation_fr.java,
+ gnu/java/locale/LocaleInformation_ga.java,
+ gnu/java/locale/LocaleInformation_hr.java,
+ gnu/java/locale/LocaleInformation_hu.java,
+ gnu/java/locale/LocaleInformation_hy.java,
+ gnu/java/locale/LocaleInformation_id.java,
+ gnu/java/locale/LocaleInformation_is.java,
+ gnu/java/locale/LocaleInformation_it.java,
+ gnu/java/locale/LocaleInformation_ja.java,
+ gnu/java/locale/LocaleInformation_ka.java,
+ gnu/java/locale/LocaleInformation_ko.java,
+ gnu/java/locale/LocaleInformation_lo.java,
+ gnu/java/locale/LocaleInformation_lt.java,
+ gnu/java/locale/LocaleInformation_lv.java,
+ gnu/java/locale/LocaleInformation_mk.java,
+ gnu/java/locale/LocaleInformation_mn.java,
+ gnu/java/locale/LocaleInformation_ms.java,
+ gnu/java/locale/LocaleInformation_mt.java,
+ gnu/java/locale/LocaleInformation_nb.java,
+ gnu/java/locale/LocaleInformation_nl.java,
+ gnu/java/locale/LocaleInformation_nn.java,
+ gnu/java/locale/LocaleInformation_pl.java,
+ gnu/java/locale/LocaleInformation_pt.java,
+ gnu/java/locale/LocaleInformation_ro.java,
+ gnu/java/locale/LocaleInformation_ru.java,
+ gnu/java/locale/LocaleInformation_sk.java,
+ gnu/java/locale/LocaleInformation_sl.java,
+ gnu/java/locale/LocaleInformation_sq.java,
+ gnu/java/locale/LocaleInformation_sv.java,
+ gnu/java/locale/LocaleInformation_th.java,
+ gnu/java/locale/LocaleInformation_tr.java,
+ gnu/java/locale/LocaleInformation_vi.java,
+ gnu/java/locale/LocaleInformation_zh.java,
+ gnu/java/locale/LocaleInformation_zh_Hant.java: Updated.
+ * gnu/java/locale/LocaleInformation_az_Cyrl.java: New file.
+
+2005-02-19 Archie Cobbs <archie@dellroad.org>
+
+ * java/lang/Throwable.java: simplify initializing cause in constructor
+
+2005-02-19 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JToggleButton.java: Removed empty line.
+
+2005-02-18 Bryce McKinlay <mckinlay@redhat.com>
+
+ * java/util/LinkedHashMap (addEntry): Call remove() with key argument,
+ not the HashEntry. Reported by Jean-Marie White.
+
+2005-02-18 Mark Wielaard <mark@klomp.org>
+
+ * doc/www.gnu.org/events/escape_fosdem05.wml: New event.
+ * doc/www.gnu.org/newsitems.txt: Add Escape the Java Trap.
+ * doc/www.gnu.org/events/events.wml: Likewise.
+2005-02-20 Mark Wielaard <mark@klomp.org>
+
* java/util/SimpleTimeZone.java (getOffset): Calculate beforeEnd by
taking dstSavings into account.
@@ -28383,11 +29941,12 @@
2005-02-14 Sven de Marothy <sven@physto.se>
- * java/util/Calendar.java
- (clear): Dates should clear to local time.
- * java/util/GregorianCalendar.java
- (computeTime): Fix priority problem with DAY_OF_WEEK,
- Handle non-sunday-startig weeks and minimumDaysInFirstWeek.
+ * java/util/Calendar.java
+ (clear): Dates should clear to local time.
+
+ * java/util/GregorianCalendar.java
+ (computeTime): Fix priority problem with DAY_OF_WEEK,
+ Handle non-sunday-startig weeks and minimumDaysInFirstWeek.
2005-02-13 Mark Wielaard <mark@klomp.org>
@@ -28793,8 +30352,7 @@
2005-02-05 C. Brian Jones <cbj@gnu.org>
- * gnu/java/rmi/registry/: Added back to classpath again, used by core
- library.
+ * gnu/java/rmi/registry/: added back to classpath again, used by core library
* gnu/java/rmi/registry/RegistryImpl.java: ditto
* gnu/java/rmi/registry/RegistryImpl_Skel.java: ditto
* gnu/java/rmi/registry/RegistryImpl_Stub.java: ditto
@@ -28961,6 +30519,27 @@
javax/security/auth/callback/TextOutputCallback.java,
javax/security/auth/callback/UnsupportedCallbackException.java:
Removed CVS version tags.
+
+2005-02-01 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/lang/Appendable.java:
+ Changed formatting to match HEAD.
+ * java/text/MessageFormat.java:
+ Likewise.
+ * javax/swing/AbstractSet.java,
+ javax/swing/DefaultCellRenderer.java:
+ Finally removed.
+
+2005-01-31 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * acinclude.m4:
+ (CLASSPATH_FIND_JAVAC): Add ECJ option.
+ (CLASSPATH_WITH_ECJ): New function.
+ (CLASSPATH_CHECK_ECJ): New function.
+ * examples/Makefile.am:
+ Allow examples to be built with ecj.
+ * lib/Makefile.am:
+ Allow Classpath to be built with ecj.
2005-01-31 Andrew John Hughes <gnu_andrew@member.fsf.org>
@@ -29683,7 +31262,7 @@
(formatWithAttribute(java.util.Date, gnu.java.text.FormatBuffer,
java.text.FieldPosition)): Changed to use CompiledField.
New handler for RFC 822 timezones added.
-
+
2005-01-22 Andrew John Hughes <gnu_andrew@member.fsf.org>
* java/awt/Checkbox.java:
@@ -29764,6 +31343,25 @@
2005-01-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * include/java_lang_VMSystem.h:
+ (Java_java_lang_VMSystem_environ): added
+ * java/lang/System.java:
+ Added cached environmentMap.
+ (getenv()): documented and implemented
+ (EnvironmentCollection): new class for use
+ by getenv()
+ (EnvironmentSet): likewise
+ (EnvironmentIterator): clone of
+ UnmodifiableIterator from java.util
+ * native/jni/java-lang/java_lang_VMSystem.c:
+ (environ(JNIEnv, jclass)): implemented
+ * vm/reference/java/lang/VMSystem.java:
+ (getenv()): removed
+ (environ()): new native method
+ (getenv(String)): made native like HEAD
+
+2005-01-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
* java/util/Currency.java:
Added new countryMap which maps country codes
to international currency codes. The cache
@@ -29855,26 +31453,6 @@
(AccessibleAWTCheckbox.getAccessibleStateSet()): implemented and
documented
(getAccessibleContext()): name of accessible class corrected
-
-2005-01-19 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- Merge of java.lang.Appendable to HEAD from
- the generics branch.
-
- 2004-08-06 Tom Tromey <tromey@redhat.com>
-
- * java/lang/Appendable.java: New file.
-
- 2004-09-26 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
- * java/lang/Appendable.java
- Documented this class.
- (append(CharSequence, int, int)): added.
-
- 2004-10-31 Robert Schuster <thebohemian@gmx.net>
-
- * java/lang/Appendable.java (append):
- Throws IOException.
2005-01-19 Michael Koch <konqueror@gmx.de>
@@ -30009,6 +31587,35 @@
javax/imageio/metadata/IIONamedNodeMap.java,
javax/imageio/metadata/IIONodeList.java:
New files
+
+2005-01-17 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/util/IdentityHashMap.java:
+ added parameteric typing
+ (entries): generically typed
+ (IdentityHashMap(Map<? extends K, ? extends V>)):
+ likewise
+ (entrySet()): likewise
+ (entrySet().iterator()): likewise
+ (get(Object)): likewise
+ (keySet()): likewise
+ (keySet().iterator()): likewise
+ (put(K,V)): likewise
+ (putAll(Map<? extends K, ? extends V>)): likewise
+ (remove(Object)): likewise
+ (values()): likewise
+ (values().iterator()): likewise
+ (IdentityIterator): likewise
+ (IdentityIterator.next()): likewise
+ (IdentityEntry): likewise
+ (IdentityEntry.getKey()): likewise
+ (IdentityEntry.getValue()): likewise
+ (IdentityEntry.putValue(V)): likewise
+ (readObject()): appropriate casting
+
+2005-01-16 Tom Tromey <tromey@redhat.com>
+
+ * .classpath: Updated.
2005-01-17 Andrew John Hughes <gnu_andrew@member.fsf.org>
@@ -30022,65 +31629,119 @@
* java/lang/ClassLoader.java (getExtClassLoaderUrls): Add check for
null returned from getFiles().
-2005-01-15 Andrew John Hughes <gnu_andrew@member.fsf.org>
+2005-01-16 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ Final merge of HEAD patches to generics branch
+ All changes are listed in merged Changelog.
+ In addition,
+ * java/lang/System.java:
+ (getenv()): changed Runtime.securityManager to
+ SecurityManager.current
+ (getenv(String)): likewise
+ (remove(String)): pointed to SystemProperties
+ * gnu/classpath/SystemProperties.java:
+ (remove(String)): implemented and documented
+2005-01-15 Tom Tromey <tromey@redhat.com>
+
+ * javax/imageo/metadata: Merged from trunk.
+
+2005-01-15 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
* java/text/SimpleDateFormat.java:
(getDateFormatSymbols()): return a copy
(setDateFormatSymbols(java.text.DateFormatSymbols)):
throw exception on null input
(clone()): implemented to clone internal fields
-
+
2005-01-15 Mark Wielaard <mark@klomp.org>
-
+
Reported by Martin Platter <motse@complang.tuwien.ac.at>
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
(Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetFile):
Correct method signature of gtkSetFilename.
2005-01-14 Sven de Marothy <sven@physto.se>
-
+
* java/util/GregorianCalendar.java
(GregorianCalendar): Update fields in the constructor
-
+
2005-01-14 Arnaud Vandyck <avdyk@gnu.org>
-
+
* javax/swing/text/StringContent.java: New file.
-
+
2005-01-13 Andrew John Hughes <gnu_andrew@member.fsf.org>
-
+
* java/text/SimpleDateFormat.java:
(parse): extend try{} block so all illegal arguments
are caught and returned as null
-
+
2005-01-13 Sven de Marothy <sven@physto.se>
-
+
* java/text/SimpleDateFormat.java
(parse): comparison should be case-insensitive, ignore null strings.
-
+
2005-01-13 Jeroen Frijters <jeroen@frijters.net>
-
+
* vm/reference/java/nio/channels/VMChannels.java: Class shouldn't
be public.
(newInputStream,newOutputStream): No need to be public.
-
+
2005-01-13 Michael Koch <konqueror@gmx.de>
-
+
* scripts/check_jni_methods.sh: Don't use GNU sed specific features.
+
+2005-01-13 Andrew John Hughes <gnu_andrew@member.fsf.org>
-2005-01-12 Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * java/util/Arrays.java:
+ (sort(T[],int,int,Comparator<? super T>)): Typed
+ Object[] to T[]
+ * java/util/Collections.java;
+ (compare(T,T,<? super T>)): typed generically
+ (binarySearch(List<? extends T>,T,Comparator<? super T>)):
+ re-typed and added casts to List<T>
+ (rotate(List<? super Object>, int)): added (incorrect?)
+ super type to compile
+ (shuffle(List<? super Object>): likewise
+ (shuffle(List<? super Object, Random)): likewise
+ (entrySet()): singleton version changed for accuracy
+ (swap(List<? super Object>,int,int)): added (incorrect?)
+ super type to compile
+ (entrySet()): unmodifiable version removed invalid
+ static typing of K and V
+ * java/util/HashMap.java:
+ (entries): re-typed to Set<Map.Entry<K,V>>
+ (putAll(Map<? extends K, ? extends V>)): cast and foreach
+ statement added
+ (putAllInternal(Map<? extends K, ? extends V>)): likewise
+ * java/util/Hashtable.java:
+ same as for HashMap
+ * java/util/LinkedHashEntry.java:
+ (pred,succ): generically typed
+ (LinkedHashEntry(K,V)): likewise
+ (cleanup()): likewise
+ (get(Object)): likewise
+ (addEntry(K,V,int,boolean)): likewise
+ * java/util/LinkedList.java:
+ changed incorrect cast
+ (LinkedListItr<I>): re-typed to unique I from T
+ * java/util/TreeSet.java:
+ cast set to SortedSet<T> before using
+2005-01-12 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
* java/text/DecimalFormatSymbols.java
(DecimalFormatSymbols(java.util.Locale)): defaults
changed to "?" and "XXX" to match a nuance of Sun's
impl. along with documentation
-
+
2005-01-12 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/security/x509/X509Certificate.java
(parse): Handle val == null case.
-
+
2005-01-12 Michael Koch <konqueror@gmx.de>
-
+
* java/nio/channels/Channels.java
(newInputStream(ReadableByteChannel)):
Call VMChannels.newInputStream(ReadableByteChannel).
@@ -30089,14 +31750,14 @@
(newInputStream(FileChannelImpl)): Removed.
(newOutputStream(FileChannelImpl)): Likewise.
* vm/reference/java/nio/channels/VMChannels.java: Nw file.
- * native/jni/java-nio/Makefile.am:
+ * native/jni/java-nio/Makefile.am:
* native/jni/java-nio/java_nio_channels_Channels.c,
include/java_nio_channels_Channels.h: Removed.
* include/Makefile.am: Don't generate java_nio_channels_Channels.h.
Removed java_nio_channels_Channels.c.
-
+
2005-01-12 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/net/PlainSocketImpl.java
(shutdownInput): Made native. Throws IOException. Added Javadoc.
(shutdownOutput): Likewise.
@@ -30110,48 +31771,93 @@
* native/jni/java-net/javanet.h
(_javanet_shutdownInput): Likewise.
(_javanet_shutdownOutput): Likewise.
-
+
2005-01-12 Michael Koch <konqueror@gmx.de>
-
+
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(Java_gnu_java_awt_peer_gtk_GtkWindowPeer_nativeSetVisible):
Removed setting of gdk_env.
+
+2005-01-12 Andrew John Hughes <gnu_andrew@member.fsf.org>
-2005-01-11 Mark Wielaard <mark@klomp.org>
+ * java/util/Collections.java
+ all occurences of
+ (toArray(E[] a)): fixed parameteric type to be different
+ from collection type
+ (entrySet()): immutable version retyped to return Map.Entry<K,V>
+ * java/util/TreeMap.java
+ Completion of generic typing for all methods and variables
+ (entries, comparator): generically typed
+ (TreeMap(Comparator<? super K>): likewise
+ (TreeMap(Map <? extends K, ? extends V>): likewise
+ (TreeMap(SortedMap<K, ? extends V> sm): likewise
+ (comparator()): likewise
+ (containsKey(Object)): cast to K for getKey()
+ (entrySet()): generically typed
+ (get(Object)): cast to K for getKey()
+ (keySet()): generically typed
+ (put(K,V)): likewise
+ (putAll(Map<? extends K, ? extends V>)): likewise
+ (remove(Object)): removed invalid generic typing
+ (values()): generically typed
+ (deleteFixup(Node<K,V>, Node<K,V>)): likewise
+ (highestLessThan(K)): likewise
+ (insertFixup(Node<K,V>)): likewise
+ (lastNode()): likewise
+ (lowestGreatThan(K, boolean): likewise
+ (predecessor(Node<K,V>)): likewise
+ (putKeysLinear(Iterator<K>, int)): likewise and doc
+ correction
+ (removeNode(Node<K,V>)): generically typed
+ (rotateLeft(Node<K,V>)): likewise
+ (rotateRight(Node<K,V>)): likewise
+ (sucessor(Node<K,V>)): likewise
+ (SubMap): generically typed with SK and SV
+
+2005-01-12 Andrew John Hughes <gnu_andrew@member.fsf.org>
- * acinclude.m4 (CLASSPATH_WITH_GJDOC): Test for gjdoc, not jay.
+ * java/util/EnumMap.java
+ Corrected comment for accuracy.
+ * java/util/EnumSet.java
+ Corrected indenting.
+ * java/util/Hashtable.java
+ Corrected bracketing of author.
+2005-01-11 Mark Wielaard <mark@klomp.org>
+
+ * acinclude.m4 (CLASSPATH_WITH_GJDOC): Test for gjdoc, not jay.
+
2005-01-12 Thomas Fitzsimmons <fitzsim@redhat.com>
-
+
* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c
(mouseWheel): Call XFlush.
(keyPress): Likewise.
(keyRelease): Likewise.
-
+
2005-01-11 Michael Koch <konqueror@gmx.de>
-
+
* javax/swing/UIDefaults.java (UIDefaults):
Fixed typo in javadoc (Thanks to Thomas Zander for reporting)
Fixed HTML entity and removed a redundant comma.
-
+
2005-01-11 Michael Koch <konqueror@gmx.de>
-
+
* configure.ac: Check for gdk-pixbuf-2.0.
-
+
2005-01-11 Graydon Hoare <graydon@redhat.com>
-
+
* gnu/java/awt/ClasspathToolkit.java
(registerImageIOSpis): New method.
* gnu/java/awt/image/ImageDecoder.java
(imageDecoder): New constructor using InputStream
(startProduction): Handle existing InputStream.
- * gnu/java/awt/peer/gtk/GdkGraphics2D.java
+ * gnu/java/awt/peer/gtk/GdkGraphics2D.java
(findSimpleIntegerArray): Make public and static.
(updateBufferedImage): Set each pixel, in a loop.
* gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:
Implement ImageIO SPI classes.
(createBufferedImage): Rewrite in terms of SPI classes.
- * gnu/java/awt/peer/gtk/GtkToolkit.java
+ * gnu/java/awt/peer/gtk/GtkToolkit.java
(registerImageIOSpis): New method.
* java/lang/reflect/natMethod.cc
(_Jv_CallAnyMethodA): Borrow a patch from aph, applied to trunk,
@@ -30213,9 +31919,9 @@
(Currency(java.util.Locale)): throw IllegalArgumentException
for empty country string and NullPointerException for null
locale or country
-
+
2005-01-11 Graydon Hoare <graydon@redhat.com>
-
+
* gnu/java/awt/ClasspathToolkit.java
(nativeQueueEmpty)
(wakeNativeQueue)
@@ -30267,59 +31973,124 @@
* gnu/java/awt/peer/gtk/GtkWindowPeer.java: Likewise.
* gnu/java/awt/peer/gtk/GtkGenericPeer.java: Likewise.
(q): New method.
-
+
2005-01-11 Michael Koch <konqueror@gmx.de>
-
+
* native/jni/gtk-peer/Makefile.am:
Removed gnu_java_awt_peer_gtk_GtkMainThread.c.
* include/Makefile.am:
Don't generate gnu_java_awt_peer_gtk_GtkMainThread.h
* include/gnu_java_awt_peer_gtk_GtkMainThread.h: Removed.
-
+
2005-01-11 Michael Koch <konqueror@gmx.de>
-
+
* javax/swing/text/DefaultEditorKit.java
(deinstall): Removed.
(install): Likewise.
-
+
2005-01-11 Michael Koch <konqueror@gmx.de>
-
+
* javax/swing/UIDefaults.java (put): Handle value of null.
-
+
2005-01-11 Chris Burdess <dog@gnu.org>
-
+
* gnu/java/net/protocol/http/HTTPConnection.java: Use correct form of
Host header when using a non-default port number.
-
+
2005-01-11 Chris Burdess <dog@gnu.org>
-
+
* javax/net/ssl/HttpsURLConnection.java: Do not request SSLv3
provider during class initialization.
-
+
2005-01-11 Michael Koch <konqueror@gmx.de>
-
+
* java/awt/Robot.java,
java/awt/Scrollbar.java,
java/awt/print/PrinterJob.java,
javax/swing/JTable.java,
javax/swing/text/AbstractDocument.java:
Reworked import statements.
-
+
2005-01-11 Michael Koch <konqueror@gmx.de>
-
+
* java/beans/XMLDecoder.java: Reworked imports, fixed class javadoc.
* java/io/File.java,
java/lang/System.java,
java/net/Inet4Address.java,
java/util/Currency.java,
java/util/ResourceBundle.java: Reworked imports.
+
+2005-01-11 Tom Tromey <tromey@redhat.com>
+
+ * java/util/AbstractList.java (set, add): Fixed argument types.
+ * java/util/ArrayList.java: Properly handle generic arrays.
+ * java/util/Arrays.java (sort): Fixed type of temporary 'elem'.
+ * java/util/BitSet.java (containsAll): Use correct variable name.
+ * java/util/Collections.java (copy): Use correct
+ parameterizations.
+ (min): Likewise.
+ (putAll): Likewise.
+ (compare): Fixed argument types.
+ (sort): Properly handle generic arrays.
+ * java/util/EnumSet.java (clone): Ignore
+ CloneNotSupportedException.
+ (addAll, contains, containsAll, remove, removeAll, retainAll,
+ copyOf, complementOf): Don't use generic instanceof.
+ (copyOf): Cast result of 'clone'.
+ * java/util/HashMap.java (HashMap): Properly handle generic
+ arrays.
+ (clone): Likewise.
+ (rehash): Likewise.
+ (readObject): Likewise.
+ (putAll): Don't use generic instanceof.
+ (getEntry): Likewise.
+ (putAllInternal): Use correct parameterizations.
+ (next): Fixed return type.
+ * java/util/Hashtable.java (Hashtable): Properly handle generic
+ arrays.
+ (clone): Likewise.
+ (rehash): Likewise.
+ (readObject): Likewise.
+ (hash): Fixed argument type.
+ (getEntry): Don't use generic instanceof.
+ (next): Cast return values.
+ (nextElement): Fixed return type.
+ * java/util/LinkedList.java (toArray): Added cast.
+ (LinkedListItr): Now generic.
+ * java/util/TreeMap.java (TreeMap): Now generic.
+ (Node): Likewise.
+ (left, right, parent): Updated types.
+ (firstKey, get, headMap, lastKey, remove, subMap, tailMap,
+ firstNode, getNode): Updated types.
+ * java/util/TreeSet.java (TreeSet): Fixed cast.
+ (clone): Likewise.
+ (readObject): Likewise.
+ * java/util/Vector.java (Vector): Properly handle generic arrays.
+ (trimToSize): Likewise.
+ (ensureCapacity): Likewise.
+ (toArray): Likewise.
+ (addAll): Fixed parameterization.
+ * java/util/WeakHashMap.java (WeakBucket): Now generic.
+ (value, next): Updated types.
+ (WeakEntry): Parameterized superinterface.
+ (key, getKey, getValue, setValue): Updated types.
+ (getEntry): Fixed type of local 'key'.
+ (get): Updated.
+ (put): Fixed return type.
+ (remove): Updated.
+
+2005-01-11 Tom Tromey <tromey@redhat.com>
+
+ * .classpath: Updated for Eclipse 3.1.
+ * .settings/org.eclipse.jdt.core.prefs: New file.
+ * .settings/org.eclipse.jdt.ui.prefs: New file.
2005-01-10 Tom Tromey <tromey@redhat.com>
-
+
* java/io/BufferedInputStream.java: Fixed indentation.
-
+
2005-01-10 Michael Koch <konqueror@gmx.de>
-
+
* javax/swing/JEditorPane.java
(read): Implemented.
(write): Likewise.
@@ -30336,19 +32107,127 @@
(setEditorKit): Likewise.
(setEditorKitForContentType): Removed wrong implementation.
(setPage): Implemented.
-
+
2005-01-10 Michael Koch <konqueror@gmx.de>
-
+
* scripts/check_jni_methods.sh: Dont ignore
Java_gnu_java_awt_peer_gtk_GtkFramePeer_nativeSetIconImageFromData.
-
+
2005-01-10 Thomas Fitzsimmons <fitzsim@redhat.com>
-
+
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
(nativeSetIconImageFromData): Re-add native implementation.
-
+
+2005-01-10 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/util/AbstractMap.java:
+ (putAll(Map<? extends K, ? extends V>)): added cast to
+ Map<K,V>
+ * java/util/EnumMap.java:
+ Corrected instanceof tests, generic array creation,
+ use of Enum.getDeclaringClass() and wrong typing
+ of iterator methods
+ (clone()): re-written to use the EnumMap(EnumMap)
+ constructor
+
+2005-01-10 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/awt/AWTKeyStroke.java:
+ Typed static cache and vktable generically
+ (removeEldestEntry(Map.Entry<AWTKeyStroke,AWTKeyStroke>)):
+ typed generically
+ (registerSubclass(Class<?>)): typed generically
+ (readResolve()): removed unnecessary cast
+ (setFocusTraversalKeys(int, Set<? extends AWTKeyStroke>)):
+ typed generically
+ * java/awt/Container.java:
+ (setFocusTraversalKeys(int, Set<? extends AWTKeyStroke>)):
+ typed generically
+ (getFocusTraversalKeys(int)): typed generically
+ * java/awt/GridBagLayout.java:
+ comptable, internalcomptable now generically typed
+ (GridBagLayout()): generic typing
+ (sortBySpan(Component,int,ArrayList<Component>,boolean)):
+ typed generically
+ * java/awt/KeyboardFocusManager.java:
+ (getDefaultFocusTraversalKeys(int)): typed generically
+ * java/awt/dnd/DragGestureRecognizer.java:
+ typed events generically
+ * java/awt/dnd/DropTargetContext.java:
+ removed unnecessary import and added serialization UID
+ * java/awt/im/InputContext.java:
+ typed descriptors and recent generically
+ * java/awt/im/spi/InputMethodContext.java:
+ removed unnecessary import
+ * java/io/DeleteFileHelper.java:
+ filesToDelete typed generically
+ (add(java.io.File)): typed generically
+ (deleteFiles()): iteration changed to foreach
+ * java/io/ObjectInputStream.java:
+ typed objectLookupTable, validators, classLookupTable, oscs
+ generically
+ (resolveProxyClass(String[]): typed generically
+ * java/io/ObjectOutputStream.java:
+ removed unnecessary import
+ typed OIDLookupTable generically
+ * java/io/ObjectStreamClass.java:
+ typed oscs and classLookupTable generically
+ * java/io/ObjectStreamField.java:
+ type typed generically
+ (getType()): typed generically
+ (checkFieldType()): typed generically
+ * java/lang/Byte.java:
+ (compareTo(Object)): removed as unneeded
+ * java/lang/Character.java:
+ (compareTo(Object)): removed as unneeded
+ * java/lang/Class.java:
+ Typing changed from K to T in accordance with docs
+ and semantics (is a type, not a key)
+ (getEnumConstants()): implemented using reflection
+ (isEnum()): implemented using reflection
+ * java/lang/Double.java:
+ (compareTo(Object)): removed as unneeded
+ * java/lang/Float.java:
+ (compareTo(Object)): removed as unneeded
+ * java/lang/InheritableThreadLocal.java:
+ removed invalid static generic typing
+ * java/lang/Integer.java:
+ (compareTo(Object)): removed as unneeded
+ * java/lang/Long.java:
+ (compareTo(Object)): removed as unneeded
+ * java/lang/Short.java:
+ (compareTo(Object)): removed as unneeded
+ * java/util/AbstractQueue.java:
+ Typing changed from T to E in accordance with docs
+ and semantics (is primarily a element)
+ * java/util/Collection.java:
+ (containsAll(Collection<?> c)): typed generically
+ * java/util/EnumMap.java:
+ (EnumMap(Class<K>)): removed invalid array creation
+ * java/util/LinkedHashMap.java:
+ Added generic typing
+ (LinkedHashMap(Map<? extends K, ? extends V>)): added
+ generics
+ (get(Object)): returns V instead of Object
+ (removeEldestEntry(Map.Entry<K,V>)): typed generically
+ * java/util/PriorityQueue.java:
+ removed invalid generic instanceof and generic array
+ creation
+ (iterator().remove()): added reference to outer class
+ * java/util/WeakHashMap.java
+ Added generic typing
+ (WeakHashMap(Map<? extends K, ? extends V>)): added
+ generics
+ (get(Object)): returns V instead of Object
+ (put(K,V)): generically typed
+ (remove(Object)): returns V instead of Object
+ (entrySet()): returns generic set
+ (keySet()): returns generic set
+ (putAll(Map<? extends K, ? extends V>)): generically typed
+ (values()): returns generic collection
+
2005-01-09 Mark Wielaard <mark@klomp.org>
-
+
* java/security/AlgorithmParameterGenerator.java (getInstance):
Mention provider when throwing NoSuchProviderException.
* java/security/AlgorithmParameters.java (getInstance): Likewise.
@@ -30356,9 +32235,9 @@
* java/security/KeyStore.java (getInstance): Likewise.
* java/security/SecureRandom.java (getInstance): Likewise.
* java/security/cert/CertificateFactory.java (getInstance): Likewise.
-
+
2005-01-09 Mark Wielaard <mark@klomp.org>
-
+
* native/jni/java-io/java_io_VMFile.c
(Java_java_io_VMFile_create): Call JCL_free_cstring() when done with
string.
@@ -30369,13 +32248,13 @@
(Java_java_lang_VMSystem_getenv): Likewise.
* native/jni/java-nio/gnu_java_nio_channels_FileChannelImpl.c
(Java_gnu_java_nio_channels_FileChannelImpl_open): Likewise.
-
+
2005-01-09 Mark Wielaard <mark@klomp.org>
-
+
* configure.ac: Update version to 0.13+cvs.
-
+
2005-01-09 Mark Wielaard <mark@klomp.org>
-
+
* acinclude.m4 (CLASSPATH_WITH_GJDOC): Renamed from
CLASSPATH_ENABLE_GJDOC. Can now take argument to use as gjdoc program.
Doesn't depend on xml tools.
@@ -30391,36 +32270,36 @@
(clean): Also remove create_html file.
(create_html): Rewritten.
* doc/api/classpath-copyright.xml: Removed.
-
+
2005-01-09 Patrik Reali <reali@acm.org>
-
+
* doc/www.gnu.org/newsitems.txt doc/www.gnu.org/announce/20050107.wml
doc/www.gnu.org/downloads/downloads.wml: classpath 0.13 release news
-
+
2005-01-08 Ito Kazumitsu <kaz@maczuka.gcd.org>
-
+
* java/nio/charset/Charset.java (providers):
New method to make an array of CharsetProviders defined in
META-INF/services/java.nio.charset.spi.CharsetProvider.
(charsetForName, availableCharsets): Use the
new method providers().
-
+
2005-01-08 Michael Koch <konqueror@gmx.de>
-
+
* java/util/SimpleTimeZone.java (checkRule):
Throw IllegalArgumentException on invalid month values.
-
+
2005-01-08 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/net/protocol/http/HTTPConnection.java
(newRequest): Use "/" as path if no path given in URL.
-
+
2005-01-08 Michael Koch <konqueror@gmx.de>
-
+
* resource/Makefile.am: Install classpath.security file.
-
+
2005-01-08 Michael Koch <konqueror@gmx.de>
-
+
* resource/java/util/iso639_fr.properties,
resource/java/util/iso3166.properties,
resource/java/util/iso3166_de.properties,
@@ -30430,15 +32309,15 @@
resource/java/util/iso639-a2-old.properties,
resource/java/util/iso3166-a3.properties,
resource/java/util/iso639_ga.properties: Removed.
-
+
2005-01-07 Tom Tromey <tromey@redhat.com>
-
+
* java/lang/Package.java (getPackages): Use VMClassLoader when
appropriate.
(getPackage): Likewise.
-
+
2005-01-07 Michael Koch <konqueror@gmx.de>
-
+
* java/nio/Buffer.java (address): New field.
* java/nio/DirectByteBufferImpl.java (address): Removed.
* java/nio/MappedByteBufferImpl.java (address): Likewise..
@@ -30449,9 +32328,9 @@
* java/nio/IntViewBufferImpl.java (IntViewBufferImpl): Likewise.
* java/nio/LongViewBufferImpl.java (LongViewBufferImpl): Likewise.
* java/nio/ShortViewBufferImpl.java (ShortViewBufferImpl): Likewise.
-
+
2005-01-07 Olga Rodimina <rodimina@redhat.com>
-
+
* javax/swing/JTable.java
(columnAtPoint): New Method. Implemented.
(rowAtPoint): Likewise.
@@ -30537,6 +32416,39 @@
* java/util/SimpleTimeZone.java:
(getOffset): offset end date with daylight savings
+2005-01-07 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/io/PrintStream.java:
+ (PrintStream(String, String)): added UnsupportedEncodingException
+ (PrintStream(File, String)): added UnsupportedEncodingException
+ * java/lang/Deprecated.java:
+ Changed import to java.lang.annotation.RetentionPolicy.RUNTIME
+ * java/lang/InheritableThreadLocal.java:
+ Corrected typo `Locals' to `Local'
+ * java/lang/String.java:
+ (compareTo(Object)): removed
+ * java/lang/annotation/AnnotationTypeMismatchException.java:
+ Added import of java.lang.reflect.Method
+ * java/lang/annotation/Documentation.java:
+ Added import of java.lang.annotation.RetentionPolicy.RUNTIME
+ * java/lang/annotation/Inherited.java:
+ Added import of java.lang.annotation.RetentionPolicy.RUNTIME
+ Added import of java.lang.annotation.ElementType.ANNOTATION_TYPE
+ * java/lang/annotation/Retention.java: ditto
+ * java/lang/annotation/Target.java: ditto
+ * java/lang/reflect/AnnotatedElement.java:
+ Added import of java.lang.annotation.Annotation
+ * java/util/AbstractCollection.java:
+ (toArray(T[])): converted returned type to T[] from Object[]
+ * java/util/EnumMap.java:
+ Added import of java.io.Serializable
+ * java/util/EnumSet.java: ditto
+ * java/util/TreeSet.java:
+ (TreeSet(SortedMap<T,String> backingMap)): type of input parameter
+ corrected.
+ * vm/reference/java/lang/VMClass.java:
+ (cast(Object, Class<K>)): typed method parameterically
+
2005-01-06 Tom Tromey <tromey@redhat.com>
* java/lang/ClassLoader.java (findClass): Fixed documentation.
@@ -30546,41 +32458,41 @@
* configure.ac: Update version to 0.13.
* NEWS: Add news about 0.13.
* INSTALL: Mention new dependencies and configure flags.
-
+
2005-01-06 Mark Wielaard <mark@klomp.org>
-
+
* configure.ac: Add explicit X and libXtst tests when gtk+ peers are
enabled.
-
+
2005-01-06 Michael Koch <konqueror@gmx.de>
-
+
* java/util/TimeZone.java
(setID): Throw NullPointerException if needed.
-
+
2005-01-05 Mark Wielaard <mark@klomp.org>
-
+
* lib/gen-classlist.sh.in: Don't split locales in classes.locale1
and classes.locale2.
* lib/Makefile.am (JAVAC): Compile only classes.locale.
(CLEANFILES): Remove classes.locale1 and classes.locale2,
add classes.locale.
-
+
2005-01-05 Tom Tromey <tromey@redhat.com>
-
+
* java/util/zip/ZipEntry.java (setCompressedSize): Allow any
argument.
(compressedSize): Now 'long'. Default to -1.
(getCompressedSize): Rewrote.
-
+
2005-01-05 Ranjit Mathew <rmathew@hotmail.com>
-
+
* java/util/IdentityHashMap.java (put): Replace mistaken use
of "<<" by "*".
-
+
2005-01-05 Michael Koch <konqueror@gmx.de>
-
+
* gnu/java/locale/LocaleInformation_mn_MN.java:
- New file.
+ New file.
* gnu/java/locale/LocaleInformation_aa.java,
gnu/java/locale/LocaleInformation_aa_DJ.java,
gnu/java/locale/LocaleInformation_aa_ER.java,
@@ -30829,9 +32741,9 @@
gnu/java/locale/LocaleInformation_zh_SG_Hans.java,
gnu/java/locale/LocaleInformation_zh_TW_Hant.java:
Regenerated.
-
+
2005-01-04 Tom Tromey <tromey@redhat.com>
-
+
* vm/reference/java/lang/VMProcess.java (VMProcess): Constructor
now package-private.
(processThread, workList, reapedPid, reapedExitValue, state, cmd,
@@ -30842,32 +32754,32 @@
modifiers.
* vm/reference/java/security/VMAccessController.java
(DEFAULT_CONTEXT): Reordered modifiers.
-
+
* gnu/java/nio/SelectorImpl.java: Removed unused import.
* gnu/java/security/der/DERWriter.java: Removed unused import.
* gnu/java/net/protocol/http/Connection.java: Removed unused
import.
* gnu/java/nio/PipeImpl.java (read): Reordered modifiers. Fixed
indentation.
- (write): Likewise.
+ (write): Likewise.
* gnu/java/rmi/server/ConnectionRunnerPool.java
(getConnectionRunner): Reordered modifiers.
* gnu/java/text/FormatCharacterIterator.java (debug): Removed
useless `final'.
(dumpTable): Likewise.
* gnu/java/net/PlainDatagramSocketImpl.java (bind): Reordered
- modifiers.
+ modifiers.
(create, setOption, getOption, close, join, leave): Likewise.
* gnu/java/net/PlainSocketImpl.java (create): Reordered
modifiers.
(bind, listen, accept): Likewise.
-
+
2005-01-04 Tom Tromey <tromey@redhat.com>
-
+
* Makefile.am (EXTRA_DIST): Added ChangeLog-2004.
-
+
2005-01-04 Robert Schuster <thebohemian@gmx.net>
-
+
* gnu/java/beans/DummyAppletStub.java: Add dummy implementation
of AppletStub for java.beans.Beans.instantiate.
* gnu/java/beans/DummyAppletContext.java: Add dummy implementation
@@ -30877,9 +32789,9 @@
(instantiate): Added two more overloaded variants, reworked user
documentation, fixed exception behavior, fixed behavior when
deserializing null.
-
+
2005-01-03 Michael Koch <konqueror@gmx.de>
-
+
* javax/swing/plaf/metal/MetalLookAndFeel.java
(getControlTextFont): New method.
(getMenuTextFont): Likewise.
@@ -30887,22 +32799,22 @@
(getSystemTextFont): Likewise.
(getUserTextFont): Likewise.
(getWindowTitleFont): Likewise.
-
+
2005-01-03 Michael Koch <konqueror@gmx.de>
-
+
* javax/swing/text/AbstractDocument.java
(documentFilter): New field.
(getDocumentFilter): New method.
(setDocumentFilter): Likewise.
- (dump): Likewise.
-
+ (dump): Likewise.
+
2005-01-03 Michael Koch <konqueror@gmx.de>
-
- * javax/swing/JTree.java
+
+ * javax/swing/JTree.java
(DynamicUtilTreeNode.hasChildren): Clarify javadoc.
-
+
2005-01-03 Thomas Fitzsimmons <fitzsim@redhat.com>
-
+
* gnu/java/awt/ClasspathToolkit.java (createRobot): New method.
* gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
(getDefaultScreenDevice): Implement.
@@ -31034,10 +32946,10 @@
* native/jni/xmlj/xmlj_sax.c: Likewise.
* native/jni/xmlj/xmlj_transform.c: Likewise.
* native/jni/xmlj/xmlj_xpath.c: Likewise.
-
+
2005-01-02 Michael Koch <konqueror@gmx.de>
-
- * javax/swing/text/AbstractDocument.java
+
+ * javax/swing/text/AbstractDocument.java
(AbstractElement.getLength): Fixed off-by-one error.
(AbstractElement.children): Made abstract.
(AbstractElement.getAllowsChildren): Likewise.
@@ -31051,19 +32963,29 @@
(LeafElement.toString): Likewise.
* javax/swing/text/GapContent.java
(GapContent): Put default content into buffer.
- * javax/swing/text/PlainDocument.java
+ * javax/swing/text/PlainDocument.java
(reindex): Use empty attribute sets instead of null.
(createDefaultRoot): Reimplemented.
(insertUpdate): Call super method.
(removeUpdate): Likewise.
(getParagraphElement): Implemented.
+
+2005-01-02 Tom Tromey <tromey@redhat.com>
-2005-01-01 Michael Koch <konqueror@gmx.de>
+ * java/io/PrintStream.java: Implement Appendable.
+ (PrintStream(String)): New constructor.
+ (PrintStream(String,String)): Likewise.
+ (PrintStream(File)): New constructor.
+ (PrintStream(File,String)): Likewise.
+ (append): New methods.
+
+ * java/lang/System.java (getenv): Added @since.
+
+ * java/lang/System.java (getenv(String)): Rewrote.
+ (getenv): New method.
+ * vm/reference/java/lang/VMSystem.java (getenv): New methods.
+2005-01-01 Michael Koch <konqueror@gmx.de>
+
* javax/swing/DefaultBoundedRangeModel.java
(fireValueChanged): Fixed off-by-one error.
-
-
-Local Variables:
-coding: iso-latin-1-unix
-End:
diff --git a/libjava/classpath/ChangeLog.gcj b/libjava/classpath/ChangeLog.gcj
index 4eeed878155..c6b5d5432ca 100644
--- a/libjava/classpath/ChangeLog.gcj
+++ b/libjava/classpath/ChangeLog.gcj
@@ -1,182 +1,80 @@
-2006-11-03 Gary Benson <gbenson@redhat.com>
+2006-12-23 Andreas Tobler <a.tobler@schweiz.org>
- * java/net/Inet4Address.java
- (FAMILY): Renamed to AF_INET.
- (<init>, writeReplace): Reflect the above.
- * java/net/Inet6Address.java
- (FAMILY): Renamed to AF_INET6.
- (<init>): Reflect the above.
+ * classpath/tools/Makefile.am: Replace cp -a with a more portable
+ cp -pR.
+ * classpath/tools/Makefile.in: Regenerate.
-2006-10-10 Tom Tromey <tromey@redhat.com>
+2006-12-18 Tom Tromey <tromey@redhat.com>
- PR classpath/29362:
- * gnu/xml/transform/TransformerImpl.java (transform): Only strip if
- there is a stylesheet.
+ * tools/Makefile.in: Rebuilt.
+ * tools/Makefile.am (GLIBJ_CLASSPATH): Look in srcdir.
-2006-10-05 Gary Benson <gbenson@redhat.com>
+2006-12-18 Tom Tromey <tromey@redhat.com>
- * java/net/SocketPermission.java
- (processHostport): Cope with IPv6 addresses with a
- one-digit first component.
+ * tools/Makefile.in: Rebuilt.
+ * tools/Makefile.am ($(TOOLS_ZIP)): Put classes in srcdir.
+ * tools/asm, tools/classes: Check in .class files.
-2006-09-25 Tom Tromey <tromey@redhat.com>
+2006-12-18 Gary Benson <gbenson@redhat.com>
- * native/jni/gconf-peer/Makefile.in: Rebuilt.
- * native/jni/gconf-peer/Makefile.am (libgconfpeer_la_LDFLAGS): New
- variable.
+ * tools/Makefile.am: Fix typo.
+ * tools/Makefile.in: Rebuilt.
-2006-09-25 Tom Tromey <tromey@redhat.com>
+2006-12-15 Andrew Haley <aph@redhat.com>
- PR libgcj/29178:
- * gnu/java/nio/charset/US_ASCII.java (Encoder.canEncode): New method.
- (Encoder.canEncode): Likewise.
- (Encoder.encodeLoop): Return unmappable for all non-ASCII characters.
- * gnu/java/nio/charset/ByteCharset.java (Encoder.canEncode): New
- method.
- (Encoder.canEncode): Likewise.
- * gnu/java/nio/charset/ISO_8859_1.java (Encoder.canEncode): New
- method.
- (Encoder.canEncode): Likewise.
+ * tools/Makefile.am (TOOLS_ZIP): Pass -g -w to javac.
+ Create all-classes.lst that contains all source filenames.
+ Delete asm.lst.
-2006-09-25 Tom Tromey <tromey@redhat.com>
+2006-12-15 Tom Tromey <tromey@redhat.com>
- * native/fdlibm/mprec.c (mprec_calloc): Renamed.
- (Balloc): Updated.
+ * configure, lib/Makefile.in: Rebuilt.
+ * lib/Makefile.am (compile-classes): Use JAVA_MAINTAINER_MODE.
+ * configure.ac: Added --enable-java-maintainer-mode.
-2006-09-25 Mark Wielaard <mark@klomp.org>
+2006-12-12 Tom Tromey <tromey@redhat.com>
- Suggested by Aaron M. Ucko <ucko@debian.org>
- Fixes bug #29203
- * native/fdlibm/mprec.c (ulp): Define L as int32_t.
-
-2006-09-22 David Daney <ddaney@avtrex.com>
-
- PR classpath/28661
- * gnu/java/net/protocol/http/HTTPURLConnection.java (connect): Add
- default content-type for POST method.
-
-2006-09-20 Gary Benson <gbenson@redhat.com>
-
- * java/net/InetAddress.java: Updated to latest.
- * java/net/Inet4Address.java: Likewise.
- * java/net/Inet6Address.java: Likewise.
- * java/net/ResolverCache.java: Likewise.
- * java/net/SocketPermission.java: Likewise.
-
- * java/net/Inet4Address.java
- (AF_INET): Renamed to FAMILY.
- (<init>, writeReplace): Reflect the above.
- * java/net/Inet6Address.java
- (AF_INET6): Renamed to FAMILY.
- (<init>): Reflect the above.
-
-2006-09-18 Tom Tromey <tromey@redhat.com>
-
- * gnu/javax/net/ssl/provider/SSLSocket.java (isBound, isClosed,
- isConnected): Removed old comment.
- (getRemoteSocketAddress): Uncommented.
- (setOOBInline, getOOBInline, setKeepAlive, getKeepAlive,
- setTrafficClass, getTrafficClass, setReuseAddress,
- getReuseAddress, shutdownInput, shutdownOutput, isInputShutdown,
- isOutputShutdown): Uncommented.
-
-2006-09-11 David Daney <ddaney@avtrex.com>
-
- PR classpath/28580
- * gnu/java/net/protocol/http/Request.java (readResponse): Call
- createResponseBodyStream in more cases and with new parameter.
- (createResponseBodyStream): Added new parameter mayHaveBody. Handle
- HEAD and !mayHaveBody responses specially.
-
-2006-09-05 Gary Benson <gbenson@redhat.com>
-
- * java/net/SocketPermission.java
- (maybeBracketIPv6Address): Renamed to processHostport.
- (processHostport): Also translate "" to "localhost".
- (setHostPort): Remove special cases for empty hostport and for
- extra colons in hostport (processHostport handles these now).
-
-2006-08-31 Keith Seitz <keiths@redhat.com>
-
- * include/jvmti.h: Update from Classpath to get latest fixes and
- improvements.
-
-2006-08-29 Gary Benson <gbenson@redhat.com>
-
- * java/net/SocketPermission.java
- (maybeBracketIPv6Address): New method.
- (<init>): Pass the hostport argument through the above.
-
- * java/net/NetworkInterface.java (getInetAddresses):
- Revert the previous change.
-
-2006-08-24 Gary Benson <gbenson@redhat.com>
-
- * java/net/NetworkInterface.java (getInetAddresses): Bracket IPv6
- addresses.
-
-2006-08-18 Roger Sayle <roger@eyesopen.com>
-
- * scripts/check_jni_methods.sh: Don't use the "set -C" command
- which isn't available in all shells.
+ * Makefile.in, tools/Makefile.in: Rebuilt.
+ * Makefile.am (SUBDIRS): Removed gcj-local change.
+ (DIST_SUBDIRS): Likewise.
+ * tools/Makefile.am (JCOMPILER): Use gcj, not gcjx.
+ (GLIBJ_BOOTCLASSPATH): Find core classes in srcdir.
-2006-08-18 Tom Tromey <tromey@redhat.com>
+2006-12-11 Tom Tromey <tromey@redhat.com>
- * gnu/java/util/prefs/NodeWriter.java (writeParents): Removed
- debugging prints.
- * gnu/java/util/prefs/NodeReader.java (readNodes): Removed debugging
- print.
- (readEntries): Likewise.
+ * Merged in Classpath from libgcj-import-20061211.
-2006-08-09 Tom Tromey <tromey@redhat.com>
+2006-10-17 Tom Tromey <tromey@redhat.com>
- PR classpath/28666:
- * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.c
- (Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeGetDisplayModes):
- Create a 'short' array.
+ * sun/reflect/annotation/AnnotationInvocationHandler.java
+ (invoke): Clone array values before return.
+ (create): New method.
+ (arrayClone): Likewise.
-2006-08-07 Tom Tromey <tromey@redhat.com>
+2006-10-12 Tom Tromey <tromey@redhat.com>
- PR libgcj/28609:
- * ltconfig: Copied from gcc.
+ * lib/Makefile.in: Rebuilt.
+ * lib/Makefile.am (JAVAC): Put classes in srcdir.
+ (compile-classes): Conditional on MAINTAINER_MODE.
-2006-07-20 Keith Seitz <keiths@redhat.com>
+2006-07-18 Tom Tromey <tromey@redhat.com>
- * include/jvmti.h: Include copy from upstream before next merge.
+ * lib/Makefile.in: Rebuilt.
+ * lib/Makefile.am (JAVAC): Add -w, -g, and --encoding.
-2006-07-12 Tom Tromey <tromey@redhat.com>
+2006-07-06 Tom Tromey <tromey@redhat.com>
- PR libgcj/27271:
- * java/util/zip/ZipFile.java (getInputStream): Call addDummyByte
- on PartialInputStream.
- (PartialInputStream.dummyByteCount): New field.
- (PartialInputStream.fillBuffer): Handle dummy byte.
- (PartialInputStream.read): Likewise.
- (PartialInputStream.addDummyByte): New method.
+ * lib/Makefile.in: Rebuilt.
+ * lib/Makefile.am (JAVAC): Define when FOUND_GCJ is true.
+ (compile-classes): Remove special case for gcj.
-2006-06-14 Tom Tromey <tromey@redhat.com>
+2006-06-23 Tom Tromey <tromey@redhat.com>
- PR java/28024:
- * aclocal.m4, configure: Rebuilt.
- * m4/acinclude.m4 (REGEN_WITH_JAY): Use backquote, not $(...).
- * configure.ac (QT_INCLUDE_DIR): Use backquote, not $(...).
+ * Imported Classpath generics 0.91, presesrving local changes.
2006-06-09 Tom Tromey <tromey@redhat.com>
- PR classpath/23863:
- * native/fdlibm/dtoa.c (_dtoa): Free contents of _Jv_reent when
- finished.
- * native/fdlibm/mprec.c: New version from newlib. Commented out
- some includes. Added <assert.h>.
- (_reent, _Bigint): New defines.
- (_REENT_CHECK_MP, _REENT_MP_FREELIST, _REENT_MP_P5S): Likewise.
- (__ULong, __Long): New types.
- (_calloc_r): New function.
- (Balloc): Dynamically add new _freelist entries as needed.
- * native/fdlibm/mprec.h (struct _Jv_Bigint): Don't use
- MAX_BIGNUMS to size _x[].
- (struct _Jv_reent): _freelist now a _Jv_Bigint**. Removed
- _allocation_map, num. Added _max_k.
+ * lib/Makefile.gcj (GCJF): Added -g and -ftarget=1.5.
2006-05-30 Thomas Fitzsimmons <fitzsim@redhat.com>
diff --git a/libjava/classpath/ChangeLog.usermap b/libjava/classpath/ChangeLog.usermap
new file mode 100644
index 00000000000..c0d43db6e04
--- /dev/null
+++ b/libjava/classpath/ChangeLog.usermap
@@ -0,0 +1,60 @@
+abies:'Artur Biesiadowski <abies@pg.gda.pl>'
+alexl:'Alex Lancaster <alexl@gnu.org>'
+anwalt:'Andy Walter <anwalt_pop@aicas.com>'
+aph:'Andrew Haley <aph@redhat.com>'
+archie172:'Archie Cobbs <archie@dellroad.org>'
+arenn:'Aaron M. Renn <arenn@urbanophile.com>'
+aselkirk:'Andrew Selkirk <aselkirk@sympatico.ca>'
+audriusa:'Audrius Meskauskas <audriusa@Bioinformatics.org>'
+avdyk:'Arnaud Vandyck <arnaud.vandyck@ulg.ac.be>'
+brawer:'Sascha Brawer <brawer@dandelis.ch>'
+bryce:'Bryce McKinlay <mckinlay@redhat.com>'
+cbj:'Brian Jones <cbj@gnu.org>'
+corvus:'James E. Blair <corvus@gnu.org>'
+craig:'Craig Black <craig.black@aonix.com>'
+daryllee:'Daryl Lee <dlee@altaregos.com>'
+djee:'David Jee <djee@redhat.com>'
+dog:'Chris Burdess <dog@bluezoo.org>'
+egagnon:'Etienne M. Gagnon <etienne.gagnon@uqam.ca>'
+ericb:'Eric Blake <ebb9@byu.net>'
+fitzsim:'Thomas Fitzsimmons <fitzsim@redhat.com>'
+fnasser:'Fernando Nasser <fnasser@redhat.com>'
+gadek:'Grzegorz B. Prokopski <gadek@debian.org>'
+gcb:'Geoff Berry <gcb@gnu.org>'
+glavaux:'Guilhem Lavaux <guilhem@kaffe.org>'
+gnu_andrew:'Andrew John Hughes <gnu_andrew@member.fsf.org>'
+graydon:'graydon hoare <graydon@pobox.com>'
+green:'Anthony Green <green@redhat.com>'
+iproetel:'Ingo Proetel <proetel@aicas.com>'
+jaz:'Jon A. Zeppieri <jon@eease.com>'
+jewel:'John Leuner <jewel@pixie.co.za>'
+jfrijters:'Jeroen Frijters <jeroen@sumatra.nl>'
+jgeorgal:'Giannis Georgalis <jgeorgal@csd.uoc.gr>'
+jochen:'Jochen Hoenicke <jochen@gnu.org>'
+joey:'Joseph C. Lesh <joey@gnu.org>'
+jsturm:'Jeff Sturm <jsturm@one-point.com>'
+julian:'Julian Scheid <scheid@sektor37.de>'
+kho:'Kim Ho <kho@redhat.com>'
+mark:'Mark Wielaard <mark@klomp.org>'
+mcb:'Mark Benvenuto <mcb54@columbia.edu>'
+mkoch:'Michael Koch <konqueror@gmx.de>'
+nferrier:'Nic Ferrier <nferrier@gnu.org>'
+noa:'Noa Resare <noa@resare.com>'
+overholt:'Andrew Overholt <overholt@redhat.com>'
+patrik_reali:'Patrik Reali <patrik@reali.ch>'
+rabbit78:'Roman Kennke <roman@kennke.org>'
+raif:'Raif S. Naffah <raif@swiftdsl.com.au>'
+rao:'Paul Fisher <rao@gnu.org>'
+robilad:'Dalibor Topic <robilad@yahoo.com>'
+rodimina:'Olga Rodimina <rodimina@redhat.com>'
+rschuster:'Robert Schuster <theBohemian@gmx.net>'
+rsdio:'Casey Marshall <csm@gnu.org>'
+rupp:'Torsten Rupp <rupp@aicas.com>'
+rveldema:'Ronald Veldema <rveldema@cs.vu.nl>'
+saugart:'Steven Augart <augart@watson.ibm.com>'
+shalom:'John Keiser <shalom@gnu.org>'
+siebert:'Fridtjof Siebert <siebert@aicas.com>'
+smarothy:'Sven de Marothy <sven@physto.se>'
+stuart:'Stuart Ballard <stuart.ballard@mcmail.com>'
+tromey:'Tom Tromey <tromey@redhat.com>'
+warrenl:'Warren Levy <warrenl@redhat.com>'
diff --git a/libjava/classpath/INSTALL b/libjava/classpath/INSTALL
index dae909effde..27bb7c0d225 100644
--- a/libjava/classpath/INSTALL
+++ b/libjava/classpath/INSTALL
@@ -1,4 +1,4 @@
-Installing GNU Classpath - Last updated: September 7, 2005
+Installing GNU Classpath - Last updated: June 19, 2006
First, this is a development release only! Unless you are interested in
active development and debugging, or just like running random alpha code,
@@ -54,6 +54,11 @@ Suggested Software
For building gcjwebplugin you'll need the Mozilla plugin
support headers and libraries.
+ The GConf-based backend for java.util.prefs needs the following
+ library headers:
+
+ - gconf 2.11.2 (or higher)
+
For building the Qt AWT peer JNI native libraries you have to
specify --enable-qt-peer and need the following library:
@@ -65,10 +70,10 @@ Suggested Software
http://escher.sourceforge.net
Please note that at the moment most operating systems do not
- ship Qt4 by default. We recommend using GNU Classpath' Qt4
- support only for its developers and bug reporters. See
- http://developer.classpath.org/mediation/ClasspathShowcase
- for details on how to get it to work.
+ ship Qt4 by default. We recommend using GNU Classpath' Qt4
+ support only for its developers and bug reporters. See
+ http://developer.classpath.org/mediation/ClasspathShowcase
+ for details on how to get it to work.
For building the xmlj JAXP implementation (disabled by default, use
configure --enable-xmlj) you need the following installed:
diff --git a/libjava/classpath/LICENSE b/libjava/classpath/LICENSE
index ae2588d4476..44620dcef0c 100644
--- a/libjava/classpath/LICENSE
+++ b/libjava/classpath/LICENSE
@@ -299,6 +299,19 @@ terms:
above copyright notice and this permission notice are included in
all copies or substantial portions of the software.
+The files in java/util/concurrent and subdirectories (with the
+exception of CopyOnWriteArrayList.java), along with
+java.util.NavigableMap, java.util.NavigableSet, java.util.Deque and
+java.util.ArrayDeque, are taken from JSR166 concurrency materials
+maintained by Doug Lea and distributed under the following terms:
+
+ Written by Doug Lea with assistance from members of JCP JSR-166
+ Expert Group and released to the public domain, as explained at
+ http://creativecommons.org/licenses/publicdomain
+
+CopyOnWriteArrayList.java has been reimplemented for GNU Classpath,
+and is distributed under the same terms as other GNU Classpath files,
+as specified at the top of this file.
Directory external/relaxngDatatype
RELAX NG Pluggable Datatype Libraries. All files are distributed under
@@ -345,4 +358,3 @@ the following notice:
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-
diff --git a/libjava/classpath/Makefile.in b/libjava/classpath/Makefile.in
index 9ed7b6deca2..649ffa5729a 100644
--- a/libjava/classpath/Makefile.in
+++ b/libjava/classpath/Makefile.in
@@ -48,12 +48,14 @@ subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -186,6 +188,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -307,7 +311,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
# lib first, to compile .class files before native code, last examples
diff --git a/libjava/classpath/NEWS b/libjava/classpath/NEWS
index a787833e587..0ebecf396a0 100644
--- a/libjava/classpath/NEWS
+++ b/libjava/classpath/NEWS
@@ -1,5 +1,59 @@
+New in release 0.94 (UNRELEASED)
+
+* The ASM library is now included. A separate copy is no longer needed.
+
+* The setReadTimeout and getReadTimeout methods have been added to
+ java.net.URLConnection. They are now fully implemented for http URLs.
+
+New in release 0.93 (Dec 8, 2006)
+
+* CORBA objects that exist on the same virtual machine and only are connected
+ to another ORB are now accessed directly and no longer via network. It is
+ the same feature that RMI implementation provides. These faster calls should
+ be completely transparent, as the parameters are cloned, where required.
+ Currently the direct calls are only possible for the non-deprecated objects
+ that are connected to the ORB via POA.
+* The 'javah' tool has been added. It requires the ASM library
+ (see asm.objectweb.org); it can be enabled with the --with-asm
+ option to configure
+* Added the rmi and corbaname URL context factories for JNDI.
+* Fixes in the JNDI InitialContext now allows to plug-in user implementation.
+* Removed currentClassLoader method from
+ vm/reference/java/io/ObjectInputStream.java.
+* Added firstNonNullClassLoader method to
+ vm/reference/gnu/classpath/VMStackWalker.java. VMs are encouraged to
+ provide a more efficient implementation.
+* Added aton method to vm/reference/java/net/VMInetAddress.java.
+* NetworkInterface has been implemented for systems that provide the
+ `getifaddrs' function.
+* java.nio.channels.Selector implementations have been added that use
+ the kqueue notification mechanism on Mac OS X and *BSD, and that use
+ the epoll notification mechanism on Linux 2.6.
+* java.nio has been refactored to support more non-blocking operations
+ natively. Blocking IO classes have been refactored to call
+ non-blocking classes. Non-blocking accepts, connects, and
+ scatter-gather IO should now be better supported.
+* HTML support for Swing has been greatly enhanced.
+
+Runtime interface changes:
+
+* java.net.VMNetworkInterface and java.net.NetworkInterface have been
+ updated to keep native-modified state in the former, and to simplify
+ the native code in our reference implementation.
+* gnu.java.nio.VMChannel has been expanded to better support native
+ non-blocking IO. Most native state data (such as file descriptor
+ integers) has been abstracted away into private state in the runtime
+ interface.
+* gnu.java.nio.VMPipe has been similarly changed.
+* gnu.java.net.VMPlainSocketImpl has been changed to remove some
+ functionality now provided by VMChannel; datagram socket-specific
+ methods have also been moved here, deprecating VMPlainDatagramSocketImpl.
+* gnu.java.net.VMPlainDatagramSocketImpl removed.
+
New in release 0.92 (Aug 9, 2006)
+* GConf is used as a backend for java.util.prefs. GNU Classpath
+ thanks to Mario Torre for this contribution!
* libjawtgnu.so has been renamed libjawt.so for binary compatibility.
libjawt.so should be installed in a VM-specific directory rather
than directly in /usr/lib. Proprietary VMs put their libjawt.so
@@ -29,6 +83,7 @@ New in release 0.92 (Aug 9, 2006)
* jarsigner
A new configure option --enable-tool-wrappers causes wrapper
binaries to be built for VMs that support the JNI Invocation API.
+* We've imported the JSR 166 (concurrency) reference implementation.
* javax.sound.midi providers have been added to read and
write standard MIDI files.
* A javax.sound.sampled .au and .wav file readers have been added.
diff --git a/libjava/classpath/aclocal.m4 b/libjava/classpath/aclocal.m4
index c6085b3d893..70d0475ff96 100644
--- a/libjava/classpath/aclocal.m4
+++ b/libjava/classpath/aclocal.m4
@@ -875,11 +875,13 @@ AC_SUBST([am__untar])
m4_include([../../config/depstand.m4])
m4_include([../../config/lead-dot.m4])
+m4_include([../../config/no-executables.m4])
m4_include([../../libtool.m4])
m4_include([m4/acattribute.m4])
m4_include([m4/accross.m4])
m4_include([m4/acinclude.m4])
m4_include([m4/ax_create_stdint_h.m4])
+m4_include([m4/gcc_attribute.m4])
m4_include([m4/iconv.m4])
m4_include([m4/lib-ld.m4])
m4_include([m4/lib-link.m4])
diff --git a/libjava/classpath/compile b/libjava/classpath/compile
new file mode 100755
index 00000000000..1b1d2321695
--- /dev/null
+++ b/libjava/classpath/compile
@@ -0,0 +1,142 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2005-05-14.22
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as `compile cc -o foo foo.c'.
+ # So we strip `-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no `-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # `.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/libjava/classpath/config.guess b/libjava/classpath/config.guess
index c085f4f51a2..2fc3acce2ea 100755
--- a/libjava/classpath/config.guess
+++ b/libjava/classpath/config.guess
@@ -1,10 +1,9 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-timestamp='2006-05-13'
+timestamp='2003-06-17'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -18,15 +17,13 @@ timestamp='2006-05-13'
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
-
# Originally written by Per Bothner <per@bothner.com>.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
@@ -56,7 +53,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@@ -69,11 +66,11 @@ Try \`$me --help' for more information."
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
+ echo "$timestamp" ; exit 0 ;;
--version | -v )
- echo "$version" ; exit ;;
+ echo "$version" ; exit 0 ;;
--help | --h* | -h )
- echo "$usage"; exit ;;
+ echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
@@ -107,7 +104,7 @@ set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -126,7 +123,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+esac ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
@@ -139,6 +136,13 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+## for Red Hat Linux
+if test -f /etc/redhat-release ; then
+ VENDOR=redhat ;
+else
+ VENDOR= ;
+fi
+
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -199,32 +203,50 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
- exit ;;
+ exit 0 ;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvmeppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mipseb-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
*:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
- macppc:MirBSD:*:*)
- echo powerppc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
+ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
+ if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
+ fi
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
@@ -262,49 +284,42 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
- # A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit 0 ;;
+ Alpha*:OpenVMS:*:*)
+ echo alpha-hp-vms
+ exit 0 ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
- exit ;;
+ exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
- exit ;;
+ exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
- exit ;;
+ exit 0;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
+ exit 0 ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
+ exit 0 ;;
*:OS/390:*:*)
echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
+ exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
+ exit 0;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
- exit ;;
+ exit 0;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
@@ -312,32 +327,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
else
echo pyramid-pyramid-bsd
fi
- exit ;;
+ exit 0 ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
- exit ;;
+ exit 0 ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ exit 0 ;;
+ DRS?6000:UNIX_SV:4.2*:7*)
case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
+ sparc) echo sparc-icl-nx7 && exit 0 ;;
esac ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ exit 0 ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ exit 0 ;;
i86pc:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ exit 0 ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ exit 0 ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
@@ -346,10 +361,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
+ exit 0 ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
@@ -361,10 +376,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
- exit ;;
+ exit 0 ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
@@ -375,40 +390,37 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
- exit ;;
+ exit 0 ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@@ -432,33 +444,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit (-1);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
- { echo "$SYSTEM_NAME"; exit; }
+ $CC_FOR_BUILD -o $dummy $dummy.c \
+ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && exit 0
echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
- exit ;;
+ exit 0 ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
- exit ;;
+ exit 0 ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
- exit ;;
+ exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
- exit ;;
+ exit 0 ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
- exit ;;
+ exit 0 ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
- exit ;;
+ exit 0 ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
- exit ;;
+ exit 0 ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
@@ -474,29 +485,29 @@ EOF
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
- exit ;;
+ exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
- exit ;;
+ exit 0 ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
- exit ;;
+ exit 0 ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
- exit ;;
+ exit 0 ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
- exit ;;
+ exit 0 ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
+ exit 0 ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
- exit ;;
+ exit 0 ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
@@ -504,7 +515,7 @@ EOF
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
+ exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
@@ -519,18 +530,14 @@ EOF
exit(0);
}
EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
- exit ;;
+ exit 0 ;;
*:AIX:*:[45])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
@@ -544,28 +551,28 @@ EOF
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
+ exit 0 ;;
*:AIX:*:*)
echo rs6000-ibm-aix
- exit ;;
+ exit 0 ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
- exit ;;
+ exit 0 ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
+ exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
- exit ;;
+ exit 0 ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
- exit ;;
+ exit 0 ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
- exit ;;
+ exit 0 ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
- exit ;;
+ exit 0 ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
@@ -627,19 +634,9 @@ EOF
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
- eval $set_cc_for_build
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep __LP64__ >/dev/null
+ # avoid double evaluation of $set_cc_for_build
+ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
then
HP_ARCH="hppa2.0w"
else
@@ -647,11 +644,11 @@ EOF
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
+ exit 0 ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
- exit ;;
+ exit 0 ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@@ -679,176 +676,150 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
echo unknown-hitachi-hiuxwe2
- exit ;;
+ exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
- exit ;;
+ exit 0 ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
- exit ;;
+ exit 0 ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
- exit ;;
+ exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
- exit ;;
+ exit 0 ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
- exit ;;
+ exit 0 ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
- exit ;;
+ exit 0 ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
- exit ;;
+ exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit ;;
+ exit 0 ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit ;;
+ exit 0 ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit ;;
+ exit 0 ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit ;;
+ exit 0 ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit ;;
+ exit 0 ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ exit 0 ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
- exit ;;
+ exit 0 ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ exit 0 ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ exit 0 ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ exit 0 ;;
*:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ exit 0 ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
- exit ;;
+ exit 0 ;;
+ *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
+ # Determine whether the default compiler uses glibc.
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #if __GLIBC__ >= 2
+ LIBC=gnu
+ #else
+ LIBC=
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+ exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
+ exit 0 ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
+ exit 0 ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
- x86:Interix*:[345]*)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- EM64T:Interix*:[345]*)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
+ x86:Interix*:[34]*)
+ echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+ exit 0 ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
- exit ;;
+ exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
- exit ;;
+ exit 0 ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
+ exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
- exit ;;
+ exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ exit 0 ;;
*:GNU:*:*)
- # the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit ;;
+ exit 0 ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
- exit ;;
+ exit 0 ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ exit 0 ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
- exit ;;
- crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
- exit ;;
- frv:Linux:*:*)
- echo frv-unknown-linux-gnu
- exit ;;
+ exit 0 ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu
+ exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ exit 0 ;;
mips:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@@ -865,12 +836,8 @@ EOF
#endif
#endif
EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
;;
mips64:Linux:*:*)
eval $set_cc_for_build
@@ -888,22 +855,15 @@ EOF
#endif
#endif
EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
;;
- or32:Linux:*:*)
- echo or32-unknown-linux-gnu
- exit ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit ;;
+ echo powerpc-${VENDOR:-unknown}-linux-gnu
+ exit 0 ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit ;;
+ echo powerpc64-${VENDOR:-unknown}-linux-gnu
+ exit 0 ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
@@ -917,7 +877,7 @@ EOF
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit ;;
+ exit 0 ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -925,28 +885,25 @@ EOF
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
- exit ;;
+ exit 0 ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
- exit ;;
+ exit 0 ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit ;;
+ echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu
+ exit 0 ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ exit 0 ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ exit 0 ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
- exit ;;
+ exit 0 ;;
x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
- exit ;;
+ echo x86_64-${VENDOR:-unknown}-linux-gnu
+ exit 0 ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
@@ -964,15 +921,15 @@ EOF
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit ;;
+ exit 0 ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit ;;
+ exit 0 ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit ;;
+ exit 0 ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
@@ -989,33 +946,23 @@ EOF
LIBC=gnulibc1
# endif
#else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+ #ifdef __INTEL_COMPILER
LIBC=gnu
#else
LIBC=gnuaout
#endif
#endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
- test x"${LIBC}" != x && {
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit
- }
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0
+ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
- exit ;;
+ exit 0 ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
@@ -1023,27 +970,24 @@ EOF
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
+ exit 0 ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
+ exit 0 ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
+ exit 0 ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
+ exit 0 ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
+ exit 0 ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -1051,16 +995,15 @@ EOF
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
- exit ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ exit 0 ;;
+ i*86:*:5:[78]*)
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
+ exit 0 ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -1078,73 +1021,73 @@ EOF
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
- exit ;;
+ exit 0 ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
- exit ;;
+ exit 0 ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
- exit ;;
+ exit 0 ;;
paragon:*:*:*)
echo i860-intel-osf1
- exit ;;
+ exit 0 ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
- exit ;;
+ exit 0 ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
- exit ;;
+ exit 0 ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
- exit ;;
+ exit 0 ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ exit 0 ;;
+ M68*:*:R3V[567]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+ 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && echo i486-ncr-sysv4.3${OS_REL} && exit 0
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
+ && echo i486-ncr-sysv4 && exit 0 ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
- exit ;;
+ exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
- exit ;;
+ exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
- exit ;;
+ exit 0 ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1152,72 +1095,68 @@ EOF
else
echo ns32k-sni-sysv
fi
- exit ;;
+ exit 0 ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
- exit ;;
+ exit 0 ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
- exit ;;
+ exit 0 ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
+ exit 0 ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
- exit ;;
+ exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
- exit ;;
+ exit 0 ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
- exit ;;
+ exit 0 ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
- exit ;;
+ exit 0 ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
- exit ;;
+ exit 0 ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
- exit ;;
+ exit 0 ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
*:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- unknown) UNAME_PROCESSOR=powerpc ;;
+ case `uname -p` in
+ *86) UNAME_PROCESSOR=i686 ;;
+ powerpc) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1225,25 +1164,22 @@ EOF
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
*:QNX:*:4*)
echo i386-pc-qnx
- exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
+ exit 0 ;;
+ NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
- exit ;;
+ exit 0 ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
- exit ;;
+ exit 0 ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
+ exit 0 ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
@@ -1254,47 +1190,28 @@ EOF
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
+ exit 0 ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
- exit ;;
+ exit 0 ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
- exit ;;
+ exit 0 ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
- exit ;;
+ exit 0 ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
- exit ;;
+ exit 0 ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
- exit ;;
+ exit 0 ;;
*:ITS:*:*)
echo pdp10-unknown-its
- exit ;;
+ exit 0 ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
+ exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1326,7 +1243,7 @@ main ()
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
+ printf ("arm-acorn-riscix"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
@@ -1415,12 +1332,11 @@ main ()
}
EOF
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
# Apollos put the system type in the environment.
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
# Convex versions that predate uname can use getsysinfo(1)
@@ -1429,22 +1345,22 @@ then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
- exit ;;
+ exit 0 ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit ;;
+ exit 0 ;;
c34*)
echo c34-convex-bsd
- exit ;;
+ exit 0 ;;
c38*)
echo c38-convex-bsd
- exit ;;
+ exit 0 ;;
c4*)
echo c4-convex-bsd
- exit ;;
+ exit 0 ;;
esac
fi
@@ -1455,9 +1371,7 @@ This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
-and
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+ ftp://ftp.gnu.org/pub/gnu/config/
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
diff --git a/libjava/classpath/config.sub b/libjava/classpath/config.sub
index 4d936e23942..6b2ff9f6a7a 100755
--- a/libjava/classpath/config.sub
+++ b/libjava/classpath/config.sub
@@ -1,10 +1,9 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-timestamp='2006-05-13'
+timestamp='2003-06-18'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -22,15 +21,14 @@ timestamp='2006-05-13'
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
-
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
#
@@ -72,7 +70,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@@ -85,11 +83,11 @@ Try \`$me --help' for more information."
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
+ echo "$timestamp" ; exit 0 ;;
--version | -v )
- echo "$version" ; exit ;;
+ echo "$version" ; exit 0 ;;
--help | --h* | -h )
- echo "$usage"; exit ;;
+ echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
@@ -101,7 +99,7 @@ while test $# -gt 0 ; do
*local*)
# First pass through any local machine types.
echo $1
- exit ;;
+ exit 0;;
* )
break ;;
@@ -120,9 +118,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
+ nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -148,7 +144,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray)
+ -apple | -axis)
os=
basic_machine=$1
;;
@@ -173,10 +169,6 @@ case $os in
-hiux*)
os=-hiuxwe2
;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -193,10 +185,6 @@ case $os in
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -240,17 +228,14 @@ case $basic_machine in
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
- | bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore \
+ | ip2k \
+ | m32r | m68000 | m68k | m88k | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -259,32 +244,28 @@ case $basic_machine in
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
- | mt \
| msp430 \
- | nios | nios2 \
| ns16k | ns32k \
- | or32 \
+ | openrisc | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
- | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | s390 | s390x \
+ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
+ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
+ | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
- | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | x86 | xscale | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
@@ -295,9 +276,6 @@ case $basic_machine in
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
- ms1)
- basic_machine=mt-unknown
- ;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
@@ -318,19 +296,19 @@ case $basic_machine in
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* \
- | bfin-* | bs2000-* \
+ | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | craynv-* | cydra-* \
+ | clipper-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | m32c-* | m32r-* | m32rle-* \
+ | ip2k-* \
+ | m32r-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* \
+ | m88110-* | m88k-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -339,36 +317,31 @@ case $basic_machine in
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
| msp430-* \
- | nios-* | nios2-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
+ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | s390-* | s390x-* \
+ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
- | xstormy16-* | xtensa-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+ | xtensa-* \
| ymp-* \
| z8k-*)
;;
@@ -388,9 +361,6 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
- abacus)
- basic_machine=abacus-unknown
- ;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
@@ -408,9 +378,6 @@ case $basic_machine in
amd64)
basic_machine=x86_64-pc
;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
amdahl)
basic_machine=580-amdahl
os=-sysv
@@ -470,27 +437,12 @@ case $basic_machine in
basic_machine=j90-cray
os=-unicos
;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16c)
- basic_machine=cr16c-unknown
- os=-elf
- ;;
crds | unos)
basic_machine=m68k-crds
;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
da30 | da30-*)
basic_machine=m68k-da30
;;
@@ -513,10 +465,6 @@ case $basic_machine in
basic_machine=m88k-motorola
os=-sysv3
;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
@@ -695,6 +643,10 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
+ mmix*)
+ basic_machine=mmix-knuth
+ os=-mmixware
+ ;;
monitor)
basic_machine=m68k-rom68k
os=-coff
@@ -707,9 +659,6 @@ case $basic_machine in
basic_machine=i386-pc
os=-msdos
;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
mvs)
basic_machine=i370-ibm
os=-mvs
@@ -778,6 +727,10 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
+ nv1)
+ basic_machine=nv1-cray
+ os=-unicosmp
+ ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -785,12 +738,9 @@ case $basic_machine in
basic_machine=hppa1.1-oki
os=-proelf
;;
- openrisc | openrisc-*)
+ or32 | or32-*)
basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
+ os=-coff
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
@@ -817,12 +767,6 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
@@ -879,10 +823,6 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
- rdos)
- basic_machine=i386-pc
- os=-rdos
- ;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
@@ -893,12 +833,6 @@ case $basic_machine in
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
sa29200)
basic_machine=a29k-amd
os=-udi
@@ -1022,10 +956,6 @@ case $basic_machine in
tower | tower-32)
basic_machine=m68k-ncr
;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
udi29k)
basic_machine=a29k-amd
os=-udi
@@ -1069,10 +999,6 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
xps | xps100)
basic_machine=xps100-honeywell
;;
@@ -1103,9 +1029,6 @@ case $basic_machine in
romp)
basic_machine=romp-ibm
;;
- mmix)
- basic_machine=mmix-knuth
- ;;
rs6000)
basic_machine=rs6000-ibm
;;
@@ -1122,10 +1045,13 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
@@ -1198,23 +1124,19 @@ case $os in
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos*)
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1232,15 +1154,12 @@ case $os in
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
@@ -1253,9 +1172,6 @@ case $os in
-opened*)
os=-openedition
;;
- -os400*)
- os=-os400
- ;;
-wince*)
os=-wince
;;
@@ -1277,9 +1193,6 @@ case $os in
-atheos*)
os=-atheos
;;
- -syllable*)
- os=-syllable
- ;;
-386bsd)
os=-bsd
;;
@@ -1302,9 +1215,6 @@ case $os in
-sinix*)
os=-sysv4
;;
- -tpf*)
- os=-tpf
- ;;
-triton*)
os=-sysv3
;;
@@ -1341,9 +1251,6 @@ case $os in
-kaos*)
os=-kaos
;;
- -zvmoe)
- os=-zvmoe
- ;;
-none)
;;
*)
@@ -1366,9 +1273,6 @@ else
# system, and we'll never get to this point.
case $basic_machine in
- spu-*)
- os=-elf
- ;;
*-acorn)
os=-riscix1.2
;;
@@ -1378,8 +1282,8 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
- c4x-* | tic4x-*)
- os=-coff
+ c4x-* | tic4x-*)
+ os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
@@ -1424,15 +1328,9 @@ case $basic_machine in
*-be)
os=-beos
;;
- *-haiku)
- os=-haiku
- ;;
*-ibm)
os=-aix
;;
- *-knuth)
- os=-mmixware
- ;;
*-wec)
os=-proelf
;;
@@ -1565,15 +1463,9 @@ case $basic_machine in
-mvs* | -opened*)
vendor=ibm
;;
- -os400*)
- vendor=ibm
- ;;
-ptx*)
vendor=sequent
;;
- -tpf*)
- vendor=ibm
- ;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
@@ -1598,7 +1490,7 @@ case $basic_machine in
esac
echo $basic_machine$os
-exit
+exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/libjava/classpath/configure b/libjava/classpath/configure
index cbfa0d88f17..7ef4d4d214e 100755
--- a/libjava/classpath/configure
+++ b/libjava/classpath/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for GNU Classpath 0.92.
+# Generated by GNU Autoconf 2.59 for GNU Classpath 0.94-pre.
#
# Report bugs to <classpath@gnu.org>.
#
@@ -269,8 +269,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='GNU Classpath'
PACKAGE_TARNAME='classpath'
-PACKAGE_VERSION='0.92'
-PACKAGE_STRING='GNU Classpath 0.92'
+PACKAGE_VERSION='0.94-pre'
+PACKAGE_STRING='GNU Classpath 0.94-pre'
PACKAGE_BUGREPORT='classpath@gnu.org'
ac_unique_file="java/lang/System.java"
@@ -312,7 +312,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os LIBVERSION CLASSPATH_MODULE CLASSPATH_CONVENIENCE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CREATE_COLLECTIONS_TRUE CREATE_COLLECTIONS_FALSE CREATE_JNI_LIBRARIES_TRUE CREATE_JNI_LIBRARIES_FALSE CREATE_CORE_JNI_LIBRARIES_TRUE CREATE_CORE_JNI_LIBRARIES_FALSE CREATE_GCONF_PEER_LIBRARIES_TRUE CREATE_GCONF_PEER_LIBRARIES_FALSE default_toolkit CREATE_XMLJ_LIBRARY_TRUE CREATE_XMLJ_LIBRARY_FALSE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP CREATE_ALSA_LIBRARIES_TRUE CREATE_ALSA_LIBRARIES_FALSE CREATE_DSSI_LIBRARIES_TRUE CREATE_DSSI_LIBRARIES_FALSE CREATE_GTK_PEER_LIBRARIES_TRUE CREATE_GTK_PEER_LIBRARIES_FALSE CREATE_QT_PEER_LIBRARIES_TRUE CREATE_QT_PEER_LIBRARIES_FALSE CREATE_PLUGIN_TRUE CREATE_PLUGIN_FALSE toolexeclibdir nativeexeclibdir glibjdir VM_BINARY FOUND_CACAO_TRUE FOUND_CACAO_FALSE CREATE_JNI_HEADERS_TRUE CREATE_JNI_HEADERS_FALSE CREATE_WRAPPERS_TRUE CREATE_WRAPPERS_FALSE LN_S CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE RANLIB ac_ct_RANLIB LIBTOOL CXXCPP PERL COLLECTIONS_PREFIX LIBMAGIC LIBICONV LTLIBICONV WARNING_CFLAGS STRICT_WARNING_CFLAGS ERROR_CFLAGS PKG_CONFIG XML_CFLAGS XML_LIBS XSLT_CFLAGS XSLT_LIBS X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS GTK_CFLAGS GTK_LIBS FREETYPE2_CFLAGS FREETYPE2_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS XTEST_LIBS GCONF_CFLAGS GCONF_LIBS GDK_CFLAGS GDK_LIBS QT_CFLAGS QT_LIBS MOC MOZILLA_CFLAGS MOZILLA_LIBS GLIB_CFLAGS GLIB_LIBS PLUGIN_DIR USER_JAVAH USER_SPECIFIED_JAVAH_TRUE USER_SPECIFIED_JAVAH_FALSE CLASSPATH_INCLUDES GCJ JIKES JIKESENCODING JIKESWARNINGS KJC GCJX ECJ FOUND_GCJ_TRUE FOUND_GCJ_FALSE FOUND_JIKES_TRUE FOUND_JIKES_FALSE FOUND_ECJ_TRUE FOUND_ECJ_FALSE FOUND_KJC_TRUE FOUND_KJC_FALSE FOUND_GCJX_TRUE FOUND_GCJX_FALSE USER_CLASSLIB USER_SPECIFIED_CLASSLIB_TRUE USER_SPECIFIED_CLASSLIB_FALSE vm_classes MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBDEBUG INIT_LOAD_LIBRARY JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION REMOVE MKDIR CP DATE FIND ZIP FASTJAR INSTALL_GLIBJ_ZIP_TRUE INSTALL_GLIBJ_ZIP_FALSE INSTALL_CLASS_FILES_TRUE INSTALL_CLASS_FILES_FALSE BUILD_CLASS_FILES_TRUE BUILD_CLASS_FILES_FALSE EXAMPLESDIR GJDOC CREATE_API_DOCS_TRUE CREATE_API_DOCS_FALSE JAY JAY_SKELETON REGEN_PARSERS_TRUE REGEN_PARSERS_FALSE USE_PREBUILT_GLIBJ_ZIP_TRUE USE_PREBUILT_GLIBJ_ZIP_FALSE PATH_TO_GLIBJ_ZIP USE_ESCHER_TRUE USE_ESCHER_FALSE PATH_TO_ESCHER ENABLE_LOCAL_SOCKETS_TRUE ENABLE_LOCAL_SOCKETS_FALSE DEFAULT_PREFS_PEER LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os JAVA_MAINTAINER_MODE_TRUE JAVA_MAINTAINER_MODE_FALSE LIBVERSION CLASSPATH_MODULE CLASSPATH_CONVENIENCE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CREATE_COLLECTIONS_TRUE CREATE_COLLECTIONS_FALSE CREATE_JNI_LIBRARIES_TRUE CREATE_JNI_LIBRARIES_FALSE CREATE_CORE_JNI_LIBRARIES_TRUE CREATE_CORE_JNI_LIBRARIES_FALSE CREATE_GCONF_PEER_LIBRARIES_TRUE CREATE_GCONF_PEER_LIBRARIES_FALSE default_toolkit CREATE_XMLJ_LIBRARY_TRUE CREATE_XMLJ_LIBRARY_FALSE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP CREATE_ALSA_LIBRARIES_TRUE CREATE_ALSA_LIBRARIES_FALSE CREATE_DSSI_LIBRARIES_TRUE CREATE_DSSI_LIBRARIES_FALSE CREATE_GTK_PEER_LIBRARIES_TRUE CREATE_GTK_PEER_LIBRARIES_FALSE CREATE_QT_PEER_LIBRARIES_TRUE CREATE_QT_PEER_LIBRARIES_FALSE CREATE_PLUGIN_TRUE CREATE_PLUGIN_FALSE nativeexeclibdir glibjdir VM_BINARY FOUND_CACAO_TRUE FOUND_CACAO_FALSE CREATE_JNI_HEADERS_TRUE CREATE_JNI_HEADERS_FALSE CREATE_WRAPPERS_TRUE CREATE_WRAPPERS_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP PERL COLLECTIONS_PREFIX LIBMAGIC LIBICONV LTLIBICONV WARNING_CFLAGS STRICT_WARNING_CFLAGS ERROR_CFLAGS PKG_CONFIG XML_CFLAGS XML_LIBS XSLT_CFLAGS XSLT_LIBS X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS GTK_CFLAGS GTK_LIBS FREETYPE2_CFLAGS FREETYPE2_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS XTEST_LIBS GCONF_CFLAGS GCONF_LIBS GDK_CFLAGS GDK_LIBS QT_CFLAGS QT_LIBS MOC MOZILLA_CFLAGS MOZILLA_LIBS GLIB_CFLAGS GLIB_LIBS PLUGIN_DIR USER_JAVAH USER_SPECIFIED_JAVAH_TRUE USER_SPECIFIED_JAVAH_FALSE CLASSPATH_INCLUDES GCJ JIKES JIKESENCODING JIKESWARNINGS KJC GCJX ECJ FOUND_GCJ_TRUE FOUND_GCJ_FALSE FOUND_JIKES_TRUE FOUND_JIKES_FALSE FOUND_ECJ_TRUE FOUND_ECJ_FALSE FOUND_KJC_TRUE FOUND_KJC_FALSE FOUND_GCJX_TRUE FOUND_GCJX_FALSE USER_CLASSLIB USER_SPECIFIED_CLASSLIB_TRUE USER_SPECIFIED_CLASSLIB_FALSE vm_classes MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBDEBUG INIT_LOAD_LIBRARY JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION REMOVE MKDIR CP DATE FIND ZIP FASTJAR INSTALL_GLIBJ_ZIP_TRUE INSTALL_GLIBJ_ZIP_FALSE INSTALL_CLASS_FILES_TRUE INSTALL_CLASS_FILES_FALSE BUILD_CLASS_FILES_TRUE BUILD_CLASS_FILES_FALSE EXAMPLESDIR GJDOC CREATE_API_DOCS_TRUE CREATE_API_DOCS_FALSE JAY JAY_SKELETON REGEN_PARSERS_TRUE REGEN_PARSERS_FALSE USE_PREBUILT_GLIBJ_ZIP_TRUE USE_PREBUILT_GLIBJ_ZIP_FALSE PATH_TO_GLIBJ_ZIP USE_ESCHER_TRUE USE_ESCHER_FALSE PATH_TO_ESCHER ENABLE_LOCAL_SOCKETS_TRUE ENABLE_LOCAL_SOCKETS_FALSE DEFAULT_PREFS_PEER LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -793,7 +793,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures GNU Classpath 0.92 to adapt to many kinds of systems.
+\`configure' configures GNU Classpath 0.94-pre to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -864,19 +864,23 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of GNU Classpath 0.92:";;
+ short | recursive ) echo "Configuration of GNU Classpath 0.94-pre:";;
esac
cat <<\_ACEOF
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-java-maintainer-mode
+ allow rebuilding of .class and .h files
--enable-collections create collections.jar default=no
--enable-jni compile JNI source default=yes
--enable-core-jni compile JNI sources for core default=yes
- --enable-default-preferences-peer
- fully qualified class name of default Preferences
- API Backend
+ --enable-default-preferences-peer[=peer type or class name]
+ specify one of: "gconf" [default] for a GConf based
+ backend, "file" for a file based one, "memory" for a
+ transient one, or a fully qualified class name
+ implementing java.util.prefs.PreferencesFactory
--disable-gconf-peer compile GConf native peers (disabled by
--disable-jni) default=yes
@@ -1062,7 +1066,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-GNU Classpath configure 0.92
+GNU Classpath configure 0.94-pre
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1076,7 +1080,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by GNU Classpath $as_me 0.92, which was
+It was created by GNU Classpath $as_me 0.94-pre, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1522,6 +1526,22 @@ test -n "$target_alias" &&
NONENONEs,x,x, &&
program_prefix=${target_alias}-
+# Check whether --enable-java-maintainer-mode or --disable-java-maintainer-mode was given.
+if test "${enable_java_maintainer_mode+set}" = set; then
+ enableval="$enable_java_maintainer_mode"
+
+fi;
+
+
+if test "$enable_java_maintainer_mode" = yes; then
+ JAVA_MAINTAINER_MODE_TRUE=
+ JAVA_MAINTAINER_MODE_FALSE='#'
+else
+ JAVA_MAINTAINER_MODE_TRUE='#'
+ JAVA_MAINTAINER_MODE_FALSE=
+fi
+
+
if expr ${target_cpu} : '.*86' > /dev/null; then target_cpu=x86; fi
LIBVERSION="0:0:0"
@@ -1824,7 +1844,7 @@ fi
# Define the identity of the package.
PACKAGE='classpath'
- VERSION='0.92'
+ VERSION='0.94-pre'
cat >>confdefs.h <<_ACEOF
@@ -2039,6 +2059,8 @@ echo "${ECHO_T}$am_cv_prog_tar_ustar" >&6
+
+
# Check whether --enable-collections or --disable-collections was given.
if test "${enable_collections+set}" = set; then
enableval="$enable_collections"
@@ -2109,12 +2131,18 @@ fi
# Check whether --enable-default-preferences-peer or --disable-default-preferences-peer was given.
if test "${enable_default_preferences_peer+set}" = set; then
enableval="$enable_default_preferences_peer"
-
+ case "${enableval}" in
+ file) DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory ;;
+ gconf|yes|true) DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory ;;
+ memory) DEFAULT_PREFS_PEER=gnu.java.util.prefs.MemoryBasedFactory ;;
+ no|false) { { echo "$as_me:$LINENO: error: bad value '${enableval}' for --enable-default-preferences-peer" >&5
+echo "$as_me: error: bad value '${enableval}' for --enable-default-preferences-peer" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ *) DEFAULT_PREFS_PEER=${enableval} ;;
+ esac
+else
+ DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
fi;
-DEFAULT_PREFS_PEER=$enable_default_preferences_peer
-if test "$DEFAULT_PREFS_PEER" = ""; then
- DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory
-fi
# Check whether --enable-gconf-peer or --disable-gconf-peer was given.
if test "${enable_gconf_peer+set}" = set; then
@@ -2152,10 +2180,10 @@ if test "${enable_Werror+set}" = set; then
case "${enableval}" in
yes) ENABLE_WERROR=yes ;;
no) ENABLE_WERROR=no ;;
- *) ENABLE_WERROR=no ;;
+ *) ENABLE_WERROR=default ;;
esac
else
- ENABLE_WERROR=no
+ ENABLE_WERROR=default
fi;
# Check whether --enable-default-toolkit or --disable-default-toolkit was given.
@@ -2606,6 +2634,39 @@ main ()
return 0;
}
_ACEOF
+# FIXME: Cleanup?
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ gcc_no_link=no
+else
+ gcc_no_link=yes
+fi
+
+if test x$gcc_no_link = xyes; then
+ # Setting cross_compile will disable run tests; it will
+ # also disable AC_CHECK_FILE but that's generally
+ # correct if we can't link.
+ cross_compiling=yes
+ EXEEXT=
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
@@ -2742,6 +2803,7 @@ echo "${ECHO_T}$ac_cv_exeext" >&6
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
+fi
echo "$as_me:$LINENO: checking for suffix of object files" >&5
echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
if test "${ac_cv_objext+set}" = set; then
@@ -3945,6 +4007,11 @@ if test "${ac_cv_lib_asound_snd_seq_open+set}" = set; then
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lasound $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -4274,15 +4341,6 @@ fi
- multi_os_directory=`$CC -print-multi-os-directory`
- case $multi_os_directory in
- .) toolexeclibdir=${libdir} ;; # Avoid trailing /.
- *) toolexeclibdir=${libdir}/${multi_os_directory} ;;
- esac
-
-
-
-
# Check whether --with-native-libdir or --without-native-libdir was given.
if test "${with_native_libdir+set}" = set; then
withval="$with_native_libdir"
@@ -4291,7 +4349,7 @@ if test "${with_native_libdir+set}" = set; then
else
- nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`
+ nativeexeclibdir='${libdir}/${PACKAGE}'
fi;
@@ -4363,251 +4421,32 @@ fi
if test "${enable_tool_wrappers+set}" = set; then
enableval="$enable_tool_wrappers"
case x"${enableval}" in
- xyes) COMPILE_WRAPPERS=yes ;;
- xno) COMPILE_WRAPPERS=no ;;
- x) COMPILE_WRAPPERS=yes ;;
- *) COMPILE_WRAPPERS=yes ;;
- esac
-else
- COMPILE_WRAPPERS=no
-fi;
-
-
-if test "x${COMPILE_WRAPPERS}" = xyes; then
- CREATE_WRAPPERS_TRUE=
- CREATE_WRAPPERS_FALSE='#'
-else
- CREATE_WRAPPERS_TRUE='#'
- CREATE_WRAPPERS_FALSE=
-fi
-
-
-echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
- echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6
-fi
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- done
- done
- ;;
-esac
-done
-
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL=$ac_install_sh
- fi
-fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
+ xyes)
+ COMPILE_WRAPPERS=yes;
-ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
- echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$CXX" && break
- done
-fi
-if test -z "$CXX"; then
- ac_ct_CXX=$CXX
- for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+for ac_header in ltdl.h
do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CXX"; then
- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CXX="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
- echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
-echo "${ECHO_T}$ac_ct_CXX" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
fi
-
- test -n "$ac_ct_CXX" && break
-done
-test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
-
- CXX=$ac_ct_CXX
-fi
-
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
- "checking for C++ compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
- (eval $ac_compiler --version </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
- (eval $ac_compiler -v </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
- (eval $ac_compiler -V </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
+$ac_includes_default
+#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -4618,7 +4457,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
+ { ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
@@ -4631,310 +4470,305 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_compiler_gnu=yes
+ ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_compiler_gnu=no
+ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
-fi
-echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
-GXX=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-CXXFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
-echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cxx_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
+#include <$ac_header>
_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cxx_g=yes
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_prog_cxx_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_header_preproc=no
fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-g"
- fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## -------------------------------- ##
+## Report this to classpath@gnu.org ##
+## -------------------------------- ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test "$GXX" = yes; then
- CXXFLAGS="-O2"
- else
- CXXFLAGS=
- fi
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
-for ac_declaration in \
- '' \
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'void exit (int);'
-do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
+
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ { { echo "$as_me:$LINENO: error: cannot find ltdl.h" >&5
+echo "$as_me: error: cannot find ltdl.h" >&2;}
+ { (exit 1); exit 1; }; }
+fi
-continue
+done
+
+
+echo "$as_me:$LINENO: checking for lt_dlopen in -lltdl" >&5
+echo $ECHO_N "checking for lt_dlopen in -lltdl... $ECHO_C" >&6
+if test "${ac_cv_lib_ltdl_lt_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lltdl $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- cat >conftest.$ac_ext <<_ACEOF
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_declaration
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char lt_dlopen ();
int
main ()
{
-exit (42);
+lt_dlopen ();
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
+ { ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- break
+ ac_cv_lib_ltdl_lt_dlopen=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_lib_ltdl_lt_dlopen=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ltdl_lt_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_ltdl_lt_dlopen" >&6
+if test $ac_cv_lib_ltdl_lt_dlopen = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBLTDL 1
+_ACEOF
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-depcc="$CXX" am_compiler_list=
+ LIBS="-lltdl $LIBS"
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
-if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
+ { { echo "$as_me:$LINENO: error: cannot find libltdl" >&5
+echo "$as_me: error: cannot find libltdl" >&2;}
+ { (exit 1); exit 1; }; }
+fi
- am_cv_CXX_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+ ;;
+ xno) COMPILE_WRAPPERS=no ;;
+ x) COMPILE_WRAPPERS=yes ;;
+ *) COMPILE_WRAPPERS=yes ;;
+ esac
+else
+ COMPILE_WRAPPERS=no
+fi;
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CXX_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
- cd ..
- rm -rf conftest.dir
+if test "x${COMPILE_WRAPPERS}" = xyes; then
+ CREATE_WRAPPERS_TRUE=
+ CREATE_WRAPPERS_FALSE='#'
else
- am_cv_CXX_dependencies_compiler_type=none
+ CREATE_WRAPPERS_TRUE='#'
+ CREATE_WRAPPERS_FALSE=
fi
+
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
fi
-echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
-if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
- am__fastdepCXX_TRUE=
- am__fastdepCXX_FALSE='#'
-else
- am__fastdepCXX_TRUE='#'
- am__fastdepCXX_FALSE=
fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
# Check whether --enable-static or --disable-static was given.
@@ -5721,7 +5555,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 5724 "configure"' > conftest.$ac_ext
+ echo '#line 5558 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -5839,7 +5673,12 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
- cat >conftest.$ac_ext <<_ACEOF
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -6002,260 +5841,6 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
# clobbered by the next message.
exec 5>>./config.log
-ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
-echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
-if test -z "$CXXCPP"; then
- if test "${ac_cv_prog_CXXCPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_cxx_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether non-existent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_cxx_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CXXCPP=$CXXCPP
-
-fi
- CXXCPP=$ac_cv_prog_CXXCPP
-else
- ac_cv_prog_CXXCPP=$CXXCPP
-fi
-echo "$as_me:$LINENO: result: $CXXCPP" >&5
-echo "${ECHO_T}$CXXCPP" >&6
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_cxx_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether non-existent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_cxx_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
-lt_save_CC="$CC"
-lt_save_CFLAGS="$CFLAGS"
-AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
-MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
-LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
-AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
-objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
-deplibs_check_method="$deplibs_check_method" \
-file_magic_cmd="$file_magic_cmd" \
-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
---build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
-|| { { echo "$as_me:$LINENO: error: libtool tag configuration failed" >&5
-echo "$as_me: error: libtool tag configuration failed" >&2;}
- { (exit 1); exit 1; }; }
-CC="$lt_save_CC"
-CFLAGS="$lt_save_CFLAGS"
-
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-exec 5>>./config.log
-
@@ -7333,6 +6918,736 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CXX" && break
+ done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CXX" && break
+done
+test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
+
+ CXX=$ac_ct_CXX
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cxx_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cxx_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CXX_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CXX_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+ am__fastdepCXX_FALSE='#'
+else
+ am__fastdepCXX_TRUE='#'
+ am__fastdepCXX_FALSE=
+fi
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
+if test -z "$CXXCPP"; then
+ if test "${ac_cv_prog_CXXCPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+ CXXCPP=$ac_cv_prog_CXXCPP
+else
+ ac_cv_prog_CXXCPP=$CXXCPP
+fi
+echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
+lt_save_CC="$CC"
+lt_save_CFLAGS="$CFLAGS"
+AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" \
+file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
+--build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
+|| { { echo "$as_me:$LINENO: error: libtool tag configuration failed" >&5
+echo "$as_me: error: libtool tag configuration failed" >&2;}
+ { (exit 1); exit 1; }; }
+CC="$lt_save_CC"
+CFLAGS="$lt_save_CFLAGS"
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+
+
+
+
+# Handle -Werror default case.
+if test "$ENABLE_WERROR" = default; then
+ case "$host_os" in
+ *linux*)
+ if test "$GCC" = yes; then
+ ENABLE_WERROR=yes
+ fi
+ ;;
+ esac
+fi
if test "x${COMPILE_COLLECTIONS}" = xyes; then
# Extract the first word of "perl", so it can be a program name with args.
@@ -7383,6 +7698,165 @@ fi
fi
if test "x${COMPILE_JNI}" = xyes; then
+
+
+
+ echo "$as_me:$LINENO: checking __attribute__((,,))" >&5
+echo $ECHO_N "checking __attribute__((,,))... $ECHO_C" >&6
+ if test "${cv_c_gcc_attribute_supported+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+extern int testfunction(int x) __attribute__((,,))
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cv_c_gcc_attribute_supported=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cv_c_gcc_attribute_supported=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+ if test "x$cv_c_gcc_attribute_supported" = xyes; then
+ true
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GNUC25_ATTRIB
+_ACEOF
+
+
+ else
+ true
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+ fi
+
+
+
+
+
+
+
+
+
+
+ echo "$as_me:$LINENO: checking __attribute__((unused))" >&5
+echo $ECHO_N "checking __attribute__((unused))... $ECHO_C" >&6
+ if test "${cv_c_gcc_attribute_unused+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+extern int testfunction(int x) __attribute__((unused))
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cv_c_gcc_attribute_unused=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cv_c_gcc_attribute_unused=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+ if test "x$cv_c_gcc_attribute_unused" = xyes; then
+ true
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GNUC25_UNUSED
+_ACEOF
+
+
+ else
+ true
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+ fi
+
+
+
+
+
+
echo "$as_me:$LINENO: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
if test "${ac_cv_header_stdc+set}" = set; then
@@ -7849,6 +8323,9 @@ fi
+
+
+
for ac_header in unistd.h sys/types.h sys/config.h sys/ioctl.h \
asm/ioctls.h \
inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
@@ -7857,7 +8334,9 @@ for ac_header in unistd.h sys/types.h sys/config.h sys/ioctl.h \
crt_externs.h \
fcntl.h \
sys/mman.h \
- magic.h
+ magic.h \
+ sys/event.h sys/epoll.h \
+ ifaddrs.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -8127,17 +8606,30 @@ rm -f conftest*
+
+
+
+
+
+
+
+
+
+
+
for ac_func in ftruncate fsync select \
gethostname socket strerror fork pipe execve open close \
- lseek fstat read write htonl memset htons connect \
+ lseek fstat read readv write writev htonl memset htons connect \
getsockname getpeername bind listen accept \
recvfrom send sendto setsockopt getsockopt time mktime \
- localtime_r \
+ gethostbyname_r localtime_r \
strerror_r \
fcntl \
mmap munmap mincore msync madvise getpagesize sysconf \
lstat readlink \
-
+ inet_aton inet_addr inet_pton \
+ getifaddrs kqueue kevent epoll_create \
+ readdir_r
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -8145,7 +8637,12 @@ echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -8247,6 +8744,11 @@ if test "${ac_cv_lib_magic_magic_open+set}" = set; then
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lmagic $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -8310,6 +8812,61 @@ fi
+ echo "$as_me:$LINENO: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
+echo $ECHO_N "checking whether struct sockaddr_in6 is in netinet/in.h... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <netinet/in.h>
+int
+main ()
+{
+struct sockaddr_in6 addr6;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INET6 1
+_ACEOF
+
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
if test "${ac_cv_header_time+set}" = set; then
@@ -8566,7 +9123,12 @@ echo $ECHO_N "checking for tzname... $ECHO_C" >&6
if test "${ac_cv_var_tzname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -9542,7 +10104,12 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
- cat >conftest.$ac_ext <<_ACEOF
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -9593,7 +10160,12 @@ rm -f conftest.err conftest.$ac_objext \
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
LIBS="$LIBS $LIBICONV"
- cat >conftest.$ac_ext <<_ACEOF
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -9750,10 +10322,10 @@ _ACEOF
if test "x${GCC}" = xyes; then
- WARNING_CFLAGS='-pedantic -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
+ WARNING_CFLAGS='-W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
- STRICT_WARNING_CFLAGS=-Wstrict-prototypes
+ STRICT_WARNING_CFLAGS='-Wstrict-prototypes -pedantic'
ERROR_CFLAGS=
@@ -10112,7 +10684,12 @@ if test "$ac_x_libraries" = no; then
# Don't add to $LIBS permanently.
ac_save_LIBS=$LIBS
LIBS="-lXt $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -10224,7 +10801,12 @@ else
echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
- cat >conftest.$ac_ext <<_ACEOF
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -10276,7 +10858,12 @@ echo "${ECHO_T}no" >&6
X_LIBS="$X_LIBS -R$x_libraries"
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
- cat >conftest.$ac_ext <<_ACEOF
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -10346,7 +10933,12 @@ echo "${ECHO_T}neither works" >&6
# libraries were built with DECnet support. And Karl Berry says
# the Alpha needs dnet_stub (dnet does not exist).
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
- cat >conftest.$ac_ext <<_ACEOF
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -10402,6 +10994,11 @@ if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -10471,6 +11068,11 @@ if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet_stub $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -10551,7 +11153,12 @@ echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
if test "${ac_cv_func_gethostbyname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -10645,6 +11252,11 @@ if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lnsl $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -10714,6 +11326,11 @@ if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lbsd $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -10790,7 +11407,12 @@ echo $ECHO_N "checking for connect... $ECHO_C" >&6
if test "${ac_cv_func_connect+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -10884,6 +11506,11 @@ if test "${ac_cv_lib_socket_connect+set}" = set; then
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -10953,7 +11580,12 @@ echo $ECHO_N "checking for remove... $ECHO_C" >&6
if test "${ac_cv_func_remove+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -11047,6 +11679,11 @@ if test "${ac_cv_lib_posix_remove+set}" = set; then
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lposix $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -11116,7 +11753,12 @@ echo $ECHO_N "checking for shmat... $ECHO_C" >&6
if test "${ac_cv_func_shmat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -11210,6 +11852,11 @@ if test "${ac_cv_lib_ipc_shmat+set}" = set; then
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lipc $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -11290,6 +11937,11 @@ if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -11367,6 +12019,11 @@ if test "${ac_cv_lib_Xtst_XTestQueryExtension+set}" = set; then
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXtst ${X_LIBS} $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -11734,6 +12391,11 @@ if test "${ac_cv_lib_Xrender_XRenderQueryExtension+set}" = set; then
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXrender ${X_LIBS} $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -11809,6 +12471,11 @@ if test "${ac_cv_lib_Xrandr_XRRQueryExtension+set}" = set; then
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXrandr ${X_LIBS} $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -12391,6 +13058,116 @@ echo "$as_me: Set QT_CFLAGS... $QT_CFLAGS" >&6;}
fi
+ echo "$as_me:$LINENO: checking for MSG_NOSIGNAL" >&5
+echo $ECHO_N "checking for MSG_NOSIGNAL... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/socket.h>
+int
+main ()
+{
+ int f = MSG_NOSIGNAL;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MSG_NOSIGNAL 1
+_ACEOF
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: checking for SO_NOSIGPIPE " >&5
+echo $ECHO_N "checking for SO_NOSIGPIPE ... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/socket.h>
+int
+main ()
+{
+ int f = SO_NOSIGPIPE;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SO_NOSIGPIPE 1
+_ACEOF
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
if test "x${COMPILE_PLUGIN}" = xyes; then
@@ -12783,6 +13560,104 @@ echo "${ECHO_T}$MOZILLA_LIBS" >&6
fi
fi
+ if test "x${MOZILLA_FOUND}" = xno; then
+
+ succeeded=no
+
+ if test -z "$PKG_CONFIG"; then
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+ echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ fi
+
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ echo "$as_me:$LINENO: checking for seamonkey-plugin" >&5
+echo $ECHO_N "checking for seamonkey-plugin... $ECHO_C" >&6
+
+ if $PKG_CONFIG --exists "seamonkey-plugin" ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ succeeded=yes
+
+ echo "$as_me:$LINENO: checking MOZILLA_CFLAGS" >&5
+echo $ECHO_N "checking MOZILLA_CFLAGS... $ECHO_C" >&6
+ MOZILLA_CFLAGS=`$PKG_CONFIG --cflags "seamonkey-plugin"`
+ echo "$as_me:$LINENO: result: $MOZILLA_CFLAGS" >&5
+echo "${ECHO_T}$MOZILLA_CFLAGS" >&6
+
+ echo "$as_me:$LINENO: checking MOZILLA_LIBS" >&5
+echo $ECHO_N "checking MOZILLA_LIBS... $ECHO_C" >&6
+ MOZILLA_LIBS=`$PKG_CONFIG --libs "seamonkey-plugin"`
+ echo "$as_me:$LINENO: result: $MOZILLA_LIBS" >&5
+echo "${ECHO_T}$MOZILLA_LIBS" >&6
+ else
+ MOZILLA_CFLAGS=""
+ MOZILLA_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ MOZILLA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "seamonkey-plugin"`
+
+ fi
+
+
+
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
+
+ if test $succeeded = yes; then
+ MOZILLA_FOUND=yes
+ else
+ MOZILLA_FOUND=no
+ fi
+
+ fi
succeeded=no
@@ -13210,7 +14085,7 @@ fi
-CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/target/Linux -I\$(top_srcdir)/native/target/generic"
+CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/jni/native-lib"
if test "x${COMPILE_JNI}" = xyes; then
@@ -18536,15 +19411,15 @@ case "$with_escher" in
use_escher=false
;;
"yes")
- { { echo "$as_me:$LINENO: error: Please suply an absolute path to Escher library" >&5
-echo "$as_me: error: Please suply an absolute path to Escher library" >&2;}
+ { { echo "$as_me:$LINENO: error: Please supply an absolute path to Escher library" >&5
+echo "$as_me: error: Please supply an absolute path to Escher library" >&2;}
{ (exit 1); exit 1; }; }
;;
*)
use_escher=true
PATH_TO_ESCHER=$with_escher
;;
-esac;
+esac
@@ -18725,7 +19600,12 @@ echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -18841,12 +19721,12 @@ fi
- ac_config_files="$ac_config_files Makefile doc/Makefile doc/api/Makefile external/Makefile external/sax/Makefile external/w3c_dom/Makefile external/relaxngDatatype/Makefile gnu/classpath/Configuration.java gnu/java/security/Configuration.java include/Makefile native/Makefile native/fdlibm/Makefile native/jawt/Makefile native/jni/Makefile native/jni/classpath/Makefile native/jni/java-io/Makefile native/jni/java-lang/Makefile native/jni/java-net/Makefile native/jni/java-nio/Makefile native/jni/java-util/Makefile native/jni/gtk-peer/Makefile native/jni/gconf-peer/Makefile native/jni/qt-peer/Makefile native/jni/xmlj/Makefile native/jni/midi-alsa/Makefile native/jni/midi-dssi/Makefile native/plugin/Makefile native/target/Makefile native/target/Linux/Makefile native/target/generic/Makefile resource/Makefile resource/META-INF/services/java.util.prefs.PreferencesFactory scripts/Makefile scripts/classpath.spec lib/Makefile lib/gen-classlist.sh lib/copy-vmresources.sh tools/Makefile examples/Makefile examples/Makefile.jawt examples/Makefile.java2d"
+ ac_config_files="$ac_config_files Makefile doc/Makefile doc/api/Makefile external/Makefile external/sax/Makefile external/w3c_dom/Makefile external/relaxngDatatype/Makefile external/jsr166/Makefile gnu/classpath/Configuration.java gnu/java/security/Configuration.java include/Makefile native/Makefile native/fdlibm/Makefile native/jawt/Makefile native/jni/Makefile native/jni/classpath/Makefile native/jni/java-io/Makefile native/jni/java-lang/Makefile native/jni/java-net/Makefile native/jni/java-nio/Makefile native/jni/java-util/Makefile native/jni/gtk-peer/Makefile native/jni/gconf-peer/Makefile native/jni/qt-peer/Makefile native/jni/xmlj/Makefile native/jni/midi-alsa/Makefile native/jni/midi-dssi/Makefile native/jni/native-lib/Makefile native/plugin/Makefile resource/Makefile resource/META-INF/services/java.util.prefs.PreferencesFactory scripts/Makefile scripts/classpath.spec lib/Makefile lib/gen-classlist.sh lib/copy-vmresources.sh tools/Makefile examples/Makefile examples/Makefile.jawt examples/Makefile.java2d"
if test "x${COMPILE_WRAPPERS}" = xno
then
- ac_config_files="$ac_config_files tools/gappletviewer tools/gjarsigner tools/gkeytool tools/gjar tools/gnative2ascii tools/gserialver"
+ ac_config_files="$ac_config_files tools/gappletviewer tools/gjarsigner tools/gkeytool tools/gjar tools/gnative2ascii tools/gserialver tools/grmiregistry tools/gtnameserv tools/gorbd tools/grmid tools/grmic tools/gjavah"
ac_config_commands="$ac_config_commands gappletviewer"
@@ -18860,18 +19740,17 @@ then
ac_config_commands="$ac_config_commands gserialver"
-fi
+ ac_config_commands="$ac_config_commands grmiregistry"
+ ac_config_commands="$ac_config_commands gtnameserv"
-if test "x${COMPILE_WRAPPERS}" = xno
-then
- ac_config_files="$ac_config_files tools/appletviewer tools/jarsigner tools/keytool"
+ ac_config_commands="$ac_config_commands gorbd"
- ac_config_commands="$ac_config_commands appletviewer"
+ ac_config_commands="$ac_config_commands grmid"
- ac_config_commands="$ac_config_commands jarsigner"
+ ac_config_commands="$ac_config_commands grmic"
- ac_config_commands="$ac_config_commands keytool"
+ ac_config_commands="$ac_config_commands gjavah"
fi
@@ -18970,6 +19849,13 @@ LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
+if test -z "${JAVA_MAINTAINER_MODE_TRUE}" && test -z "${JAVA_MAINTAINER_MODE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"JAVA_MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"JAVA_MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
if test -z "${CREATE_COLLECTIONS_TRUE}" && test -z "${CREATE_COLLECTIONS_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"CREATE_COLLECTIONS\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
@@ -19075,17 +19961,17 @@ echo "$as_me: error: conditional \"CREATE_WRAPPERS\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -19493,7 +20379,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by GNU Classpath $as_me 0.92, which was
+This file was extended by GNU Classpath $as_me 0.94-pre, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -19559,7 +20445,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-GNU Classpath config.status 0.92
+GNU Classpath config.status 0.94-pre
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
@@ -19695,6 +20581,7 @@ do
"external/sax/Makefile" ) CONFIG_FILES="$CONFIG_FILES external/sax/Makefile" ;;
"external/w3c_dom/Makefile" ) CONFIG_FILES="$CONFIG_FILES external/w3c_dom/Makefile" ;;
"external/relaxngDatatype/Makefile" ) CONFIG_FILES="$CONFIG_FILES external/relaxngDatatype/Makefile" ;;
+ "external/jsr166/Makefile" ) CONFIG_FILES="$CONFIG_FILES external/jsr166/Makefile" ;;
"gnu/classpath/Configuration.java" ) CONFIG_FILES="$CONFIG_FILES gnu/classpath/Configuration.java" ;;
"gnu/java/security/Configuration.java" ) CONFIG_FILES="$CONFIG_FILES gnu/java/security/Configuration.java" ;;
"include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
@@ -19714,10 +20601,8 @@ do
"native/jni/xmlj/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/jni/xmlj/Makefile" ;;
"native/jni/midi-alsa/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/jni/midi-alsa/Makefile" ;;
"native/jni/midi-dssi/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/jni/midi-dssi/Makefile" ;;
+ "native/jni/native-lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/jni/native-lib/Makefile" ;;
"native/plugin/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/plugin/Makefile" ;;
- "native/target/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/target/Makefile" ;;
- "native/target/Linux/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/target/Linux/Makefile" ;;
- "native/target/generic/Makefile" ) CONFIG_FILES="$CONFIG_FILES native/target/generic/Makefile" ;;
"resource/Makefile" ) CONFIG_FILES="$CONFIG_FILES resource/Makefile" ;;
"resource/META-INF/services/java.util.prefs.PreferencesFactory" ) CONFIG_FILES="$CONFIG_FILES resource/META-INF/services/java.util.prefs.PreferencesFactory" ;;
"scripts/Makefile" ) CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
@@ -19735,9 +20620,12 @@ do
"tools/gjar" ) CONFIG_FILES="$CONFIG_FILES tools/gjar" ;;
"tools/gnative2ascii" ) CONFIG_FILES="$CONFIG_FILES tools/gnative2ascii" ;;
"tools/gserialver" ) CONFIG_FILES="$CONFIG_FILES tools/gserialver" ;;
- "tools/appletviewer" ) CONFIG_FILES="$CONFIG_FILES tools/appletviewer" ;;
- "tools/jarsigner" ) CONFIG_FILES="$CONFIG_FILES tools/jarsigner" ;;
- "tools/keytool" ) CONFIG_FILES="$CONFIG_FILES tools/keytool" ;;
+ "tools/grmiregistry" ) CONFIG_FILES="$CONFIG_FILES tools/grmiregistry" ;;
+ "tools/gtnameserv" ) CONFIG_FILES="$CONFIG_FILES tools/gtnameserv" ;;
+ "tools/gorbd" ) CONFIG_FILES="$CONFIG_FILES tools/gorbd" ;;
+ "tools/grmid" ) CONFIG_FILES="$CONFIG_FILES tools/grmid" ;;
+ "tools/grmic" ) CONFIG_FILES="$CONFIG_FILES tools/grmic" ;;
+ "tools/gjavah" ) CONFIG_FILES="$CONFIG_FILES tools/gjavah" ;;
"$ac_config_links_1" ) CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_1" ;;
"depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"mkcollections.pl" ) CONFIG_COMMANDS="$CONFIG_COMMANDS mkcollections.pl" ;;
@@ -19748,9 +20636,12 @@ do
"gjar" ) CONFIG_COMMANDS="$CONFIG_COMMANDS gjar" ;;
"gnative2ascii" ) CONFIG_COMMANDS="$CONFIG_COMMANDS gnative2ascii" ;;
"gserialver" ) CONFIG_COMMANDS="$CONFIG_COMMANDS gserialver" ;;
- "appletviewer" ) CONFIG_COMMANDS="$CONFIG_COMMANDS appletviewer" ;;
- "jarsigner" ) CONFIG_COMMANDS="$CONFIG_COMMANDS jarsigner" ;;
- "keytool" ) CONFIG_COMMANDS="$CONFIG_COMMANDS keytool" ;;
+ "grmiregistry" ) CONFIG_COMMANDS="$CONFIG_COMMANDS grmiregistry" ;;
+ "gtnameserv" ) CONFIG_COMMANDS="$CONFIG_COMMANDS gtnameserv" ;;
+ "gorbd" ) CONFIG_COMMANDS="$CONFIG_COMMANDS gorbd" ;;
+ "grmid" ) CONFIG_COMMANDS="$CONFIG_COMMANDS grmid" ;;
+ "grmic" ) CONFIG_COMMANDS="$CONFIG_COMMANDS grmic" ;;
+ "gjavah" ) CONFIG_COMMANDS="$CONFIG_COMMANDS gjavah" ;;
"gen-classlist" ) CONFIG_COMMANDS="$CONFIG_COMMANDS gen-classlist" ;;
"copy-vmresources" ) CONFIG_COMMANDS="$CONFIG_COMMANDS copy-vmresources" ;;
"include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
@@ -19852,6 +20743,8 @@ s,@target@,$target,;t t
s,@target_cpu@,$target_cpu,;t t
s,@target_vendor@,$target_vendor,;t t
s,@target_os@,$target_os,;t t
+s,@JAVA_MAINTAINER_MODE_TRUE@,$JAVA_MAINTAINER_MODE_TRUE,;t t
+s,@JAVA_MAINTAINER_MODE_FALSE@,$JAVA_MAINTAINER_MODE_FALSE,;t t
s,@LIBVERSION@,$LIBVERSION,;t t
s,@CLASSPATH_MODULE@,$CLASSPATH_MODULE,;t t
s,@CLASSPATH_CONVENIENCE@,$CLASSPATH_CONVENIENCE,;t t
@@ -19916,7 +20809,6 @@ s,@CREATE_QT_PEER_LIBRARIES_TRUE@,$CREATE_QT_PEER_LIBRARIES_TRUE,;t t
s,@CREATE_QT_PEER_LIBRARIES_FALSE@,$CREATE_QT_PEER_LIBRARIES_FALSE,;t t
s,@CREATE_PLUGIN_TRUE@,$CREATE_PLUGIN_TRUE,;t t
s,@CREATE_PLUGIN_FALSE@,$CREATE_PLUGIN_FALSE,;t t
-s,@toolexeclibdir@,$toolexeclibdir,;t t
s,@nativeexeclibdir@,$nativeexeclibdir,;t t
s,@glibjdir@,$glibjdir,;t t
s,@VM_BINARY@,$VM_BINARY,;t t
@@ -19927,15 +20819,15 @@ s,@CREATE_JNI_HEADERS_FALSE@,$CREATE_JNI_HEADERS_FALSE,;t t
s,@CREATE_WRAPPERS_TRUE@,$CREATE_WRAPPERS_TRUE,;t t
s,@CREATE_WRAPPERS_FALSE@,$CREATE_WRAPPERS_FALSE,;t t
s,@LN_S@,$LN_S,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@LIBTOOL@,$LIBTOOL,;t t
s,@CXX@,$CXX,;t t
s,@CXXFLAGS@,$CXXFLAGS,;t t
s,@ac_ct_CXX@,$ac_ct_CXX,;t t
s,@CXXDEPMODE@,$CXXDEPMODE,;t t
s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
-s,@RANLIB@,$RANLIB,;t t
-s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s,@LIBTOOL@,$LIBTOOL,;t t
s,@CXXCPP@,$CXXCPP,;t t
s,@PERL@,$PERL,;t t
s,@COLLECTIONS_PREFIX@,$COLLECTIONS_PREFIX,;t t
@@ -21340,9 +22232,12 @@ echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
gjar ) chmod 755 tools/gjar ;;
gnative2ascii ) chmod 755 tools/gnative2ascii ;;
gserialver ) chmod 755 tools/gserialver ;;
- appletviewer ) chmod 755 tools/appletviewer ;;
- jarsigner ) chmod 755 tools/jarsigner ;;
- keytool ) chmod 755 tools/keytool ;;
+ grmiregistry ) chmod 755 tools/grmiregistry ;;
+ gtnameserv ) chmod 755 tools/gtnameserv ;;
+ gorbd ) chmod 755 tools/gorbd ;;
+ grmid ) chmod 755 tools/grmid ;;
+ grmic ) chmod 755 tools/grmic ;;
+ gjavah ) chmod 755 tools/gjavah ;;
gen-classlist ) chmod 755 lib/gen-classlist.sh ;;
copy-vmresources ) chmod 755 lib/copy-vmresources.sh ;;
esac
@@ -21384,4 +22279,3 @@ cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
if test x$use_escher != xtrue; then
echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit
fi
-
diff --git a/libjava/classpath/configure.ac b/libjava/classpath/configure.ac
index 193b1d5f988..83bab19d0a6 100644
--- a/libjava/classpath/configure.ac
+++ b/libjava/classpath/configure.ac
@@ -6,11 +6,18 @@ dnl -----------------------------------------------------------
dnl define([AC_CACHE_LOAD], )dnl
dnl define([AC_CACHE_SAVE], )dnl
-AC_INIT([GNU Classpath],[0.92],[classpath@gnu.org],[classpath])
+AC_INIT([GNU Classpath],[0.94-pre],[classpath@gnu.org],[classpath])
AC_CONFIG_SRCDIR(java/lang/System.java)
AC_CANONICAL_TARGET
+dnl GCJ LOCAL
+AC_ARG_ENABLE(java-maintainer-mode,
+ AS_HELP_STRING([--enable-java-maintainer-mode],
+ [allow rebuilding of .class and .h files]))
+AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
+dnl END GCJ LOCAL
+
dnl -----------------------------------------------------------
dnl Fold all IA-32 CPU architectures into "x86"
dnl -----------------------------------------------------------
@@ -41,6 +48,9 @@ AM_INIT_AUTOMAKE([1.9.0 gnu std-options tar-ustar])
AC_CONFIG_HEADERS([include/config.h])
AC_PREFIX_DEFAULT(/usr/local/classpath)
+dnl GCC LOCAL
+GCC_NO_EXECUTABLES
+
dnl -----------------------------------------------------------
dnl Enable collections.jar (disabled by default)
dnl -----------------------------------------------------------
@@ -85,13 +95,17 @@ AM_CONDITIONAL(CREATE_CORE_JNI_LIBRARIES, test "x${COMPILE_CORE_JNI}" = xyes)
dnl -----------------------------------------------------------
dnl Default Preference Backend
dnl -----------------------------------------------------------
-AC_ARG_ENABLE(default-preferences-peer,
- AS_HELP_STRING([--enable-default-preferences-peer],
- [fully qualified class name of default Preferences API Backend]))
-DEFAULT_PREFS_PEER=$enable_default_preferences_peer
-if test "$DEFAULT_PREFS_PEER" = ""; then
- DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory
-fi
+AC_ARG_ENABLE([default-preferences-peer],
+ [AS_HELP_STRING([--enable-default-preferences-peer@<:@=peer type or class name@:>@],
+ [specify one of: "gconf" [default] for a GConf based backend, "file" for a file based one, "memory" for a transient one, or a fully qualified class name implementing java.util.prefs.PreferencesFactory])],
+ [case "${enableval}" in
+ file) DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory ;;
+ gconf|yes|true) DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory ;;
+ memory) DEFAULT_PREFS_PEER=gnu.java.util.prefs.MemoryBasedFactory ;;
+ no|false) AC_MSG_ERROR(bad value '${enableval}' for --enable-default-preferences-peer) ;;
+ *) DEFAULT_PREFS_PEER=${enableval} ;;
+ esac],
+ [DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory])
dnl AC_SUBST(DEFAULT_PREFS_PEER)
dnl -----------------------------------------------------------
@@ -120,9 +134,9 @@ AC_ARG_ENABLE([Werror],
[case "${enableval}" in
yes) ENABLE_WERROR=yes ;;
no) ENABLE_WERROR=no ;;
- *) ENABLE_WERROR=no ;;
+ *) ENABLE_WERROR=default ;;
esac],
- [ENABLE_WERROR=no])
+ [ENABLE_WERROR=default])
dnl -----------------------------------------------------------
dnl Default AWT toolkit
@@ -222,24 +236,15 @@ AC_ARG_ENABLE([plugin],
AM_CONDITIONAL(CREATE_PLUGIN, test "x${COMPILE_PLUGIN}" = xyes)
dnl -----------------------------------------------------------
-dnl GCJ LOCAL: Calculates and substitutes toolexeclibdir. $libdir is
-dnl defined to the same value for all multilibs. We define toolexeclibdir
-dnl so that we can refer to the multilib installation directories from
-dnl classpath's build files.
-dnl -----------------------------------------------------------
-CLASSPATH_TOOLEXECLIBDIR
-
-dnl -----------------------------------------------------------
dnl Sets the native libraries installation dir
dnl -----------------------------------------------------------
-dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}
AC_ARG_WITH([native-libdir],
[AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
[
nativeexeclibdir=${withval}
],
[
- nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`
+ nativeexeclibdir='${libdir}/${PACKAGE}'
])
AC_SUBST(nativeexeclibdir)
@@ -292,7 +297,11 @@ dnl -----------------------------------------------------------
AC_ARG_ENABLE([tool-wrappers],
[AS_HELP_STRING(--enable-tool-wrappers,create tool wrapper binaries [default=no])],
[case x"${enableval}" in
- xyes) COMPILE_WRAPPERS=yes ;;
+ xyes)
+ COMPILE_WRAPPERS=yes;
+ AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
+ AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
+ ;;
xno) COMPILE_WRAPPERS=no ;;
x) COMPILE_WRAPPERS=yes ;;
*) COMPILE_WRAPPERS=yes ;;
@@ -306,13 +315,25 @@ AC_PROG_INSTALL
dnl -----------------------------------------------------------
dnl Checks for programs.
dnl -----------------------------------------------------------
-AC_PROG_CXX
+
dnl Initialize libtool
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
dnl AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
+AC_PROG_CXX
+
+# Handle -Werror default case.
+if test "$ENABLE_WERROR" = default; then
+ case "$host_os" in
+ *linux*)
+ if test "$GCC" = yes; then
+ ENABLE_WERROR=yes
+ fi
+ ;;
+ esac
+fi
if test "x${COMPILE_COLLECTIONS}" = xyes; then
AC_PATH_PROG(PERL, [perl])
@@ -323,6 +344,8 @@ if test "x${COMPILE_COLLECTIONS}" = xyes; then
fi
if test "x${COMPILE_JNI}" = xyes; then
+ GCC_ATTRIBUTE_UNUSED
+
AC_HEADER_STDC
dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64,
@@ -344,7 +367,9 @@ if test "x${COMPILE_JNI}" = xyes; then
crt_externs.h \
fcntl.h \
sys/mman.h \
- magic.h])
+ magic.h \
+ sys/event.h sys/epoll.h \
+ ifaddrs.h])
AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
@@ -353,20 +378,29 @@ if test "x${COMPILE_JNI}" = xyes; then
AC_CHECK_FUNCS([ftruncate fsync select \
gethostname socket strerror fork pipe execve open close \
- lseek fstat read write htonl memset htons connect \
+ lseek fstat read readv write writev htonl memset htons connect \
getsockname getpeername bind listen accept \
recvfrom send sendto setsockopt getsockopt time mktime \
- localtime_r \
+ gethostbyname_r localtime_r \
strerror_r \
fcntl \
mmap munmap mincore msync madvise getpagesize sysconf \
lstat readlink \
- ])
+ inet_aton inet_addr inet_pton \
+ getifaddrs kqueue kevent epoll_create \
+ readdir_r ])
LIBMAGIC=
AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
AC_SUBST(LIBMAGIC)
+ AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[struct sockaddr_in6 addr6;]])],
+ [AC_DEFINE(HAVE_INET6, 1,
+ [Define if inet6 structures are defined in netinet/in.h.])
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)])
+
AC_HEADER_TIME
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
@@ -401,17 +435,17 @@ if test "x${COMPILE_JNI}" = xyes; then
dnl When using gcc we want warnings, lots of warnings :-)
if test "x${GCC}" = xyes; then
- dnl We want ISO C90 pedantic ansi, but with longlong (jlong) support
+ dnl We want ISO C90 ansi, but with longlong (jlong) support
dnl and modern POSIX and BSD C library functions/prototypes.
dnl Warning flags for (almost) everybody.
dnl Should probably be configurable
- WARNING_CFLAGS='-pedantic -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
+ WARNING_CFLAGS='-W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
AC_SUBST(WARNING_CFLAGS)
dnl Strict warning flags which not every module uses.
dnl Should probably be configurable.
- STRICT_WARNING_CFLAGS=-Wstrict-prototypes
+ STRICT_WARNING_CFLAGS='-Wstrict-prototypes -pedantic'
AC_SUBST(STRICT_WARNING_CFLAGS)
dnl Whether or not to add -Werror, also not used by all modueles.
@@ -538,6 +572,28 @@ if test "x${COMPILE_JNI}" = xyes; then
AC_SUBST(QT_CFLAGS)
AC_SUBST(QT_LIBS)
fi
+ dnl **********************************************************************
+ dnl Check for MSG_NOSIGNAL
+ dnl **********************************************************************
+ AC_MSG_CHECKING(for MSG_NOSIGNAL)
+ AC_TRY_COMPILE([#include <sys/socket.h>],
+ [ int f = MSG_NOSIGNAL; ],
+ [ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,
+ [Define this symbol if you have MSG_NOSIGNAL]) ],
+ [ AC_MSG_RESULT(no)]
+ )
+ dnl **********************************************************************
+ dnl Check for SO_NOSIGPIPE (Darwin equivalent for MSG_NOSIGNAL)
+ dnl **********************************************************************
+ AC_MSG_CHECKING(for SO_NOSIGPIPE )
+ AC_TRY_COMPILE([#include <sys/socket.h>],
+ [ int f = SO_NOSIGPIPE; ],
+ [ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SO_NOSIGPIPE, 1,
+ [Define this symbol if you have SO_NOSIGPIPE]) ],
+ [ AC_MSG_RESULT(no)]
+ )
dnl Check for plugin support headers and libraries.
if test "x${COMPILE_PLUGIN}" = xyes; then
@@ -551,6 +607,9 @@ if test "x${COMPILE_JNI}" = xyes; then
if test "x${MOZILLA_FOUND}" = xno; then
PKG_CHECK_MODULES(MOZILLA, mozilla-firefox-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
fi
+ if test "x${MOZILLA_FOUND}" = xno; then
+ PKG_CHECK_MODULES(MOZILLA, seamonkey-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
+ fi
PKG_CHECK_MODULES(GLIB, glib-2.0)
AC_SUBST(MOZILLA_CFLAGS)
@@ -568,7 +627,7 @@ dnl -----------------------------------------------------------
dnl Add the include files for the native abstraction layer.
dnl Used by AM_CPPFLAGS in the different modules.
dnl -----------------------------------------------------------
-CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/target/Linux -I\$(top_srcdir)/native/target/generic"
+CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/jni/native-lib"
AC_SUBST(CLASSPATH_INCLUDES)
dnl -----------------------------------------------------------
@@ -746,13 +805,13 @@ case "$with_escher" in
use_escher=false
;;
"yes")
- AC_MSG_ERROR([Please suply an absolute path to Escher library])
+ AC_MSG_ERROR([Please supply an absolute path to Escher library])
;;
*)
use_escher=true
PATH_TO_ESCHER=$with_escher
;;
-esac;
+esac
AM_CONDITIONAL(USE_ESCHER, test x$use_escher = xtrue)
AC_SUBST(PATH_TO_ESCHER)
@@ -795,6 +854,7 @@ external/Makefile
external/sax/Makefile
external/w3c_dom/Makefile
external/relaxngDatatype/Makefile
+external/jsr166/Makefile
gnu/classpath/Configuration.java
gnu/java/security/Configuration.java
include/Makefile
@@ -814,10 +874,8 @@ native/jni/qt-peer/Makefile
native/jni/xmlj/Makefile
native/jni/midi-alsa/Makefile
native/jni/midi-dssi/Makefile
+native/jni/native-lib/Makefile
native/plugin/Makefile
-native/target/Makefile
-native/target/Linux/Makefile
-native/target/generic/Makefile
resource/Makefile
resource/META-INF/services/java.util.prefs.PreferencesFactory
scripts/Makefile
@@ -837,24 +895,25 @@ tools/gjarsigner
tools/gkeytool
tools/gjar
tools/gnative2ascii
-tools/gserialver])
+tools/gserialver
+tools/grmiregistry
+tools/gtnameserv
+tools/gorbd
+tools/grmid
+tools/grmic
+tools/gjavah])
AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
AC_CONFIG_COMMANDS([gjar],[chmod 755 tools/gjar])
AC_CONFIG_COMMANDS([gnative2ascii],[chmod 755 tools/gnative2ascii])
AC_CONFIG_COMMANDS([gserialver],[chmod 755 tools/gserialver])
-fi
-
-
-if test "x${COMPILE_WRAPPERS}" = xno
-then
-AC_CONFIG_FILES([tools/appletviewer
-tools/jarsigner
-tools/keytool])
-AC_CONFIG_COMMANDS([appletviewer],[chmod 755 tools/appletviewer])
-AC_CONFIG_COMMANDS([jarsigner],[chmod 755 tools/jarsigner])
-AC_CONFIG_COMMANDS([keytool],[chmod 755 tools/keytool])
+AC_CONFIG_COMMANDS([grmiregistry],[chmod 755 tools/grmiregistry])
+AC_CONFIG_COMMANDS([gtnameserv],[chmod 755 tools/gtnameserv])
+AC_CONFIG_COMMANDS([gorbd],[chmod 755 tools/gorbd])
+AC_CONFIG_COMMANDS([grmid],[chmod 755 tools/grmid])
+AC_CONFIG_COMMANDS([grmic],[chmod 755 tools/grmic])
+AC_CONFIG_COMMANDS([gjavah], [chmod 755 tools/gjavah])
fi
AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
@@ -866,4 +925,3 @@ cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
if test x$use_escher != xtrue; then
echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit
fi
-
diff --git a/libjava/classpath/doc/.cvsignore b/libjava/classpath/doc/.cvsignore
new file mode 100644
index 00000000000..1c4ea81e2c8
--- /dev/null
+++ b/libjava/classpath/doc/.cvsignore
@@ -0,0 +1,13 @@
+Makefile
+Makefile.in
+*.info
+*.aux
+*.cp
+*.dvi
+*.fn
+*.ky
+*.log
+*.pg
+*.toc
+*.tp
+*.vr
diff --git a/libjava/classpath/doc/Makefile.in b/libjava/classpath/doc/Makefile.in
index 20a87292fea..56bd79eaf56 100644
--- a/libjava/classpath/doc/Makefile.in
+++ b/libjava/classpath/doc/Makefile.in
@@ -41,12 +41,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in texinfo.tex
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -166,6 +168,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -287,7 +291,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
SUBDIRS = api
EXTRA_DIST = README.jaxp
diff --git a/libjava/classpath/doc/api/.cvsignore b/libjava/classpath/doc/api/.cvsignore
new file mode 100644
index 00000000000..282522db034
--- /dev/null
+++ b/libjava/classpath/doc/api/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/libjava/classpath/doc/api/Makefile.am b/libjava/classpath/doc/api/Makefile.am
index 96c586e07f3..b63b31f3444 100644
--- a/libjava/classpath/doc/api/Makefile.am
+++ b/libjava/classpath/doc/api/Makefile.am
@@ -36,6 +36,7 @@ clean-local:
create_html:
-$(MKDIR) html > /dev/null 2>&1
+if CREATE_API_DOCS
$(GJDOC) \
-use \
-sourcepath "$(sourcepath)" \
@@ -51,3 +52,4 @@ create_html:
-header $(classpathbox) -footer $(classpathbox) \
-subpackages java:javax:org
touch create_html
+endif
diff --git a/libjava/classpath/doc/api/Makefile.in b/libjava/classpath/doc/api/Makefile.in
index 4ed24cefeb6..231a47a31f9 100644
--- a/libjava/classpath/doc/api/Makefile.in
+++ b/libjava/classpath/doc/api/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -159,6 +161,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -280,7 +284,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
@CREATE_API_DOCS_TRUE@noinst_DATA = html
sourcepath = $(top_builddir):$(top_srcdir):$(top_srcdir)/vm/reference:$(top_srcdir)/external/w3c_dom:$(top_srcdir)/external/sax
@@ -475,21 +478,21 @@ clean-local:
create_html:
-$(MKDIR) html > /dev/null 2>&1
- $(GJDOC) \
- -use \
- -sourcepath "$(sourcepath)" \
- -encoding UTF-8 \
- -breakiterator \
- -licensetext \
- -linksource \
- -splitindex \
- -validhtml \
- -d html \
- -doctitle "GNU Classpath $(VERSION)" \
- -windowtitle "GNU Classpath $(VERSION) Documentation" \
- -header $(classpathbox) -footer $(classpathbox) \
- -subpackages java:javax:org
- touch create_html
+@CREATE_API_DOCS_TRUE@ $(GJDOC) \
+@CREATE_API_DOCS_TRUE@ -use \
+@CREATE_API_DOCS_TRUE@ -sourcepath "$(sourcepath)" \
+@CREATE_API_DOCS_TRUE@ -encoding UTF-8 \
+@CREATE_API_DOCS_TRUE@ -breakiterator \
+@CREATE_API_DOCS_TRUE@ -licensetext \
+@CREATE_API_DOCS_TRUE@ -linksource \
+@CREATE_API_DOCS_TRUE@ -splitindex \
+@CREATE_API_DOCS_TRUE@ -validhtml \
+@CREATE_API_DOCS_TRUE@ -d html \
+@CREATE_API_DOCS_TRUE@ -doctitle "GNU Classpath $(VERSION)" \
+@CREATE_API_DOCS_TRUE@ -windowtitle "GNU Classpath $(VERSION) Documentation" \
+@CREATE_API_DOCS_TRUE@ -header $(classpathbox) -footer $(classpathbox) \
+@CREATE_API_DOCS_TRUE@ -subpackages java:javax:org
+@CREATE_API_DOCS_TRUE@ touch create_html
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/libjava/classpath/doc/vmintegration.texinfo b/libjava/classpath/doc/vmintegration.texinfo
index e7f85d088b5..6d59b5d8fb4 100644
--- a/libjava/classpath/doc/vmintegration.texinfo
+++ b/libjava/classpath/doc/vmintegration.texinfo
@@ -144,7 +144,7 @@ A simple, small bytecode interpreter that works out-of-the-box with
pure GNU Classpath; it is emerging as the preferred platform for
quickly testing a new build of GNU Classpath. Licensed under the GPL.
-@item @uref{http://oss.software.ibm.com/jikesrvm,Jikes RVM}
+@item @uref{http://jikesrvm.sourceforge.net/,Jikes RVM}
A free runtime environment for Java, written in Java. Works
out-of-the-box with pure GNU Classpath. Features an optimizing JIT.
Runs on the x86 and PowerPC architectures, on the AIX, Linux, and Mac
@@ -1859,8 +1859,7 @@ Classpath places a few requirements on the VM that uses it.
Classpath currently uses only JNI 1.1, except for one JNI 1.2 function
in the JNI Invocation API: GetEnv(). And GetEnv() is only used in the
-``portable native sync'' code, so it's only actually used by Jikes RVM
-and Kaffe.
+now deprecated ``portable native sync'' code.
A future direction will probably be to require that all VMs provide
JNI 1.2. If this poses problems, please raise them on the classpath
@@ -1870,42 +1869,95 @@ mailing list.
@comment node-name, next, previous, up
@section VM Threading Model
-Classpath's AWT peers use GTK+. GTK+ uses GLIB. Normally, Classpath
-will initialize GLIB's @dfn{gthreads} to use
-the platform's native threading model@footnote{The native threading
-model is pthreads on Linux and AIX, the two platforms Classpath
-currently runs on.}
-
-If the Java runtime doesn't use the native threading model, then you
-will want Classpath to tell GLIB to use the Java threading primitives
-instead. Otherwise, GLIB would use the native threading model to
-perform operations such as creating thread-local data, and that just
-doesn't work on systems (such as Kaffe in some configurations, and
-such as Jikes RVM) that use @i{m}:@i{n} threading.
-
-Historically, enabling the Java threading primitives had been done at
-build time, by configuring classpath with the
-@option{--portable-native-sync} option. This had bad consequences,
-though -- it meant that the prebuild GNU Classpath package distributed
-with Debian GNU/Linux would not be usable with VMs that could
-otherwise have used it. Instead, we encourage
-the use of the Java system property
-@code{gnu.classpath.awt.gtk.portable.native.sync}. A VM that wants
-GLIB to use the Java threading primitives should modify
-@code{VMRuntime.insertSystemProperties()} to include code like the
-following:
-
-@example
-static void insertSystemProperties(Properties @var{p})
-@end example
-...
-@example
-@var{p}.put("gnu.classpath.awt.gtk.portable.native.sync", "true");
-@end example
-
-So, the configure option
-@option{--portable-native-sync} is deprecated, and should go away in a
-subsequent release of GNU Classpath.
+VM authors can implement a number of different threading models. When
+native code is also threaded there is the potential for one threading
+model to deadlock the other. The
+@uref{http://java.sun.com/docs/books/jni/html/other.html#29406,Java
+Native Interface Programmer's Guide and Specification} suggests
+consulting VM documentation in such situations. Classpath uses
+existing libraries, for example the AWT peers can use the GTK+
+graphics library. As these libraries assume a different threading
+model, there is the potential for the native code to deadlock a VM.
+
+The different threading models available to a VM author are:
+@enumerate
+@item
+@i{Native threads}: Map a Java thread to an underlying operating system
+thread (normally a POSIX compatible pthread). This approach reduces
+the potential for deadlock as there is only one thread scheduling
+mechanism.
+@item
+@i{Green threads 1}: Green threads are threads scheduled by the VM,
+typically by switching swapping registers. In early VMs green threads
+were seen as advantageous as they didn't require the operating system
+to resechedule, save and swap all of a threads registers. The green
+thread 1 model switches thread on an externally created event, such as
+a timer interrupt. An example of a VM using this approach is Kaffe
+configured with its jthreads model.
+@item
+@i{Green threads 2}: The essential difference with this model is to
+not switch threads on an event, but at fixed points in the code being
+executed by the VM. Points chosen could be backward branches (loops)
+or method calls. This approach can be advantageous to nonconservative
+garbage collectors, as non-running threads would be at known points
+and can have fixed register maps. It can also reduce the number of
+registers it is necessary to swap when switching threads.
+@item
+@i{M:N threading}: a flaw to green threading is that it is unable to
+use multiple processors. @i{M}:@i{N} threading fixes this problem by
+running groups of green threads on multiple underlying native
+threads. An example of a VM using this approach is the Jikes RVM,
+which uses @i{M}:@i{N} threading combined with the green thread 2
+model.
+@end enumerate
+
+An example of the problem of mixing threading models is:
+@itemize @bullet
+@item
+A Java thread calls a native method. The native method aquires a lock.
+@item
+The native method calls back into the VM.
+@item
+An event triggers the VM to reschedule the currently running thread.
+@item
+A new VM thread, executing on the same underlying native thread, calls
+a native method.
+@item
+The native method tries to aquire the lock already aquired earlier. As
+the lock is busy the thread waits and allows the operating system to
+reschedule native threads.
+@item
+The operating system reschedules the VM thread again, but the lock is
+still busy and in some threading models will remain busy forever
+(the VM is deadlocked).
+@end itemize
+
+VMs that don't use the underlying operating system thread scheduling
+mechanism need to avoid deadlock. One now deprecated approach was to
+build Classpath and VMs on top of a wrapper thread library (aka
+portable native sync). The wrapper thread library used was GLIB's
+@dfn{gthreads}. This approach has been deprecated because:
+@enumerate
+@item
+The wrapper library is only in use by some native libraries. For
+example, GTK+ uses the gthread library but QT does not.
+@item
+The wrapper library can't be in use prior to the VM starting as the VM
+must replace the wrapper libraries functions with its own. This
+prevents the VM from running as a plugin in an application that
+already uses the wrapper library.
+@end enumerate
+
+An alternative approach is for the VM to detect deadlocked native code
+and swap Java threads off of that native thread. The VM can't,
+however, swap two blocked native threads that are potentially
+deadlocking each other on a lock. The lock will be associated with the
+native thread. To prevent this from happening the VM must hijack
+functions that operate on locks. This is done by redifining the lock
+functions inside the VM and configuring the linker so that it uses the
+VMs symbol in preference to that of the external thread support
+library. The VM's lock function can then reschedule Java threads if it
+must wait for the lock.
@node Boot Library Path Property, , VM Threading Model, Miscellaneous VM Requirements
@comment node-name, next, previous, up
diff --git a/libjava/classpath/examples/.cvsignore b/libjava/classpath/examples/.cvsignore
new file mode 100644
index 00000000000..d79d635e81a
--- /dev/null
+++ b/libjava/classpath/examples/.cvsignore
@@ -0,0 +1,6 @@
+Makefile
+Makefile.in
+examples.zip
+Makefile.jawt
+Makefile.java2d
+
diff --git a/libjava/classpath/examples/Makefile.am b/libjava/classpath/examples/Makefile.am
index 84e3ebe0fc9..6940bdf2599 100644
--- a/libjava/classpath/examples/Makefile.am
+++ b/libjava/classpath/examples/Makefile.am
@@ -1,23 +1,23 @@
## Input file for automake to generate the Makefile.in used by configure
-GLIBJ_CLASSPATH='$(top_builddir)/lib':'$(top_builddir)/lib/glibj.zip'
+GLIBJ_CLASSPATH='$(top_builddir)/lib':'$(top_builddir)/lib/glibj.zip':'$(top_builddir)/tools/tools.zip'
# Setup the compiler to use the GNU Classpath library we just build
-if FOUND_GCJ
-JCOMPILER = $(GCJ) -encoding UTF-8 --bootclasspath $(GLIBJ_CLASSPATH) --classpath . -C
-else
-if FOUND_JIKES
-JCOMPILER = $(JIKES) $(JIKESENCODING) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(GLIBJ_CLASSPATH):.
-else
+#if FOUND_GCJ
+#JCOMPILER = $(GCJ) --bootclasspath '$(top_builddir)/lib' --classpath . -C
+#else
+#if FOUND_JIKES
+#JCOMPILER = $(JIKES) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(top_builddir)/lib:.
+#else
if FOUND_GCJX
JCOMPILER = $(GCJX) -encoding UTF-8 -bootclasspath '' -sourcepath '' -classpath $(GLIBJ_CLASSPATH):.
else
if FOUND_ECJ
-JCOMPILER = $(ECJ) -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath .
+JCOMPILER = $(ECJ) -1.5 -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath .
else
error dunno how to setup the JCOMPILER and compile
endif
-endif
-endif
+#endif
+#endif
endif
# All our example java source files
@@ -36,11 +36,14 @@ BUILT_SOURCES = $(EXAMPLE_ZIP)
# the png icons we use in some of the examples.
EXAMPLE_ICONS = $(srcdir)/gnu/classpath/examples/icons/*.png
+# the html pages we use in the swing demo example.
+EXAMPLE_HTML = $(srcdir)/gnu/classpath/examples/swing/*.html
+
# The example specific README files.
READMES = $(srcdir)/gnu/classpath/examples/CORBA/swing/README.html
# All the files we find "interesting"
-ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_CH_FILES) $(EXAMPLE_ICONS) $(READMES)
+ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_CH_FILES) $(EXAMPLE_ICONS) $(EXAMPLE_HTML) $(READMES)
# Some architecture independent data to be installed.
example_DATA = $(EXAMPLE_ZIP) README
@@ -100,6 +103,8 @@ dist-hook:
$(EXAMPLE_ZIP): $(EXAMPLE_JAVA_FILES)
mkdir -p classes/gnu/classpath/examples/icons
cp $(EXAMPLE_ICONS) classes/gnu/classpath/examples/icons
+ mkdir -p classes/gnu/classpath/examples/swing
+ cp $(EXAMPLE_HTML) classes/gnu/classpath/examples/swing
$(JCOMPILER) -d classes $(EXAMPLE_JAVA_FILES)
(cd classes; \
if test "$(ZIP)" != ""; then $(ZIP) -r ../$(EXAMPLE_ZIP) .; fi; \
diff --git a/libjava/classpath/examples/Makefile.in b/libjava/classpath/examples/Makefile.in
index d40f2018d24..6e929df647e 100644
--- a/libjava/classpath/examples/Makefile.in
+++ b/libjava/classpath/examples/Makefile.in
@@ -43,12 +43,14 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -168,6 +170,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -289,15 +293,20 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
-GLIBJ_CLASSPATH = '$(top_builddir)/lib':'$(top_builddir)/lib/glibj.zip'
-@FOUND_ECJ_TRUE@@FOUND_GCJX_FALSE@@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@JCOMPILER = $(ECJ) -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath .
-@FOUND_GCJX_TRUE@@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@JCOMPILER = $(GCJX) -encoding UTF-8 -bootclasspath '' -sourcepath '' -classpath $(GLIBJ_CLASSPATH):.
-@FOUND_GCJ_FALSE@@FOUND_JIKES_TRUE@JCOMPILER = $(JIKES) $(JIKESENCODING) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(GLIBJ_CLASSPATH):.
+GLIBJ_CLASSPATH = '$(top_builddir)/lib':'$(top_builddir)/lib/glibj.zip':'$(top_builddir)/tools/tools.zip'
+@FOUND_ECJ_TRUE@@FOUND_GCJX_FALSE@JCOMPILER = $(ECJ) -1.5 -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath .
# Setup the compiler to use the GNU Classpath library we just build
-@FOUND_GCJ_TRUE@JCOMPILER = $(GCJ) -encoding UTF-8 --bootclasspath $(GLIBJ_CLASSPATH) --classpath . -C
+#if FOUND_GCJ
+#JCOMPILER = $(GCJ) --bootclasspath '$(top_builddir)/lib' --classpath . -C
+#else
+#if FOUND_JIKES
+#JCOMPILER = $(JIKES) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(top_builddir)/lib:.
+#else
+@FOUND_GCJX_TRUE@JCOMPILER = $(GCJX) -encoding UTF-8 -bootclasspath '' -sourcepath '' -classpath $(GLIBJ_CLASSPATH):.
+#endif
+#endif
# All our example java source files
EXAMPLE_JAVA_FILES = $(srcdir)/gnu/classpath/examples/*/*.java $(srcdir)/gnu/classpath/examples/*/*/*.java $(srcdir)/gnu/classpath/examples/*/*/*/*.java
@@ -315,11 +324,14 @@ BUILT_SOURCES = $(EXAMPLE_ZIP)
# the png icons we use in some of the examples.
EXAMPLE_ICONS = $(srcdir)/gnu/classpath/examples/icons/*.png
+# the html pages we use in the swing demo example.
+EXAMPLE_HTML = $(srcdir)/gnu/classpath/examples/swing/*.html
+
# The example specific README files.
READMES = $(srcdir)/gnu/classpath/examples/CORBA/swing/README.html
# All the files we find "interesting"
-ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_CH_FILES) $(EXAMPLE_ICONS) $(READMES)
+ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_CH_FILES) $(EXAMPLE_ICONS) $(EXAMPLE_HTML) $(READMES)
# Some architecture independent data to be installed.
example_DATA = $(EXAMPLE_ZIP) README
@@ -522,7 +534,7 @@ uninstall-am: uninstall-exampleDATA uninstall-info-am uninstall-local
uninstall uninstall-am uninstall-exampleDATA uninstall-info-am \
uninstall-local
-@FOUND_ECJ_FALSE@@FOUND_GCJX_FALSE@@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@error dunno how to setup the JCOMPILER and compile
+@FOUND_ECJ_FALSE@@FOUND_GCJX_FALSE@error dunno how to setup the JCOMPILER and compile
# Make sure all sources and icons are also installed so users can use them.
# (Be careful to strip off the srcdir part of the path when installing.)
@@ -573,6 +585,8 @@ dist-hook:
$(EXAMPLE_ZIP): $(EXAMPLE_JAVA_FILES)
mkdir -p classes/gnu/classpath/examples/icons
cp $(EXAMPLE_ICONS) classes/gnu/classpath/examples/icons
+ mkdir -p classes/gnu/classpath/examples/swing
+ cp $(EXAMPLE_HTML) classes/gnu/classpath/examples/swing
$(JCOMPILER) -d classes $(EXAMPLE_JAVA_FILES)
(cd classes; \
if test "$(ZIP)" != ""; then $(ZIP) -r ../$(EXAMPLE_ZIP) .; fi; \
diff --git a/libjava/classpath/examples/gnu/classpath/examples/CORBA/NamingService/Demo.java b/libjava/classpath/examples/gnu/classpath/examples/CORBA/NamingService/Demo.java
index fb5ebdbb5dc..38c4ecb987a 100644
--- a/libjava/classpath/examples/gnu/classpath/examples/CORBA/NamingService/Demo.java
+++ b/libjava/classpath/examples/gnu/classpath/examples/CORBA/NamingService/Demo.java
@@ -39,7 +39,6 @@ exception statement from your version. */
package gnu.classpath.examples.CORBA.NamingService;
import gnu.CORBA.IOR;
-import gnu.CORBA.NamingService.NamingServiceTransient;
import org.omg.CORBA.ORB;
import org.omg.CORBA.Object;
@@ -97,7 +96,7 @@ public class Demo
{
public void run()
{
- NamingServiceTransient.main(args);
+ gnu.classpath.tools.tnameserv.Main.main(args);
}
}.start();
diff --git a/libjava/classpath/examples/gnu/classpath/examples/awt/aicas.png b/libjava/classpath/examples/gnu/classpath/examples/awt/aicas.png
new file mode 100644
index 00000000000..dcf39654b9f
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/awt/aicas.png
Binary files differ
diff --git a/libjava/classpath/examples/gnu/classpath/examples/awt/palme.gif b/libjava/classpath/examples/gnu/classpath/examples/awt/palme.gif
new file mode 100644
index 00000000000..69479465594
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/awt/palme.gif
Binary files differ
diff --git a/libjava/classpath/examples/gnu/classpath/examples/icons/back.png b/libjava/classpath/examples/gnu/classpath/examples/icons/back.png
new file mode 100644
index 00000000000..d320f26c65f
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/icons/back.png
Binary files differ
diff --git a/libjava/classpath/examples/gnu/classpath/examples/icons/reload.png b/libjava/classpath/examples/gnu/classpath/examples/icons/reload.png
new file mode 100644
index 00000000000..04c57500211
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/icons/reload.png
Binary files differ
diff --git a/libjava/classpath/examples/gnu/classpath/examples/java2d/aicas.png b/libjava/classpath/examples/gnu/classpath/examples/java2d/aicas.png
new file mode 100644
index 00000000000..dcf39654b9f
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/java2d/aicas.png
Binary files differ
diff --git a/libjava/classpath/examples/gnu/classpath/examples/java2d/palme.gif b/libjava/classpath/examples/gnu/classpath/examples/java2d/palme.gif
new file mode 100644
index 00000000000..69479465594
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/java2d/palme.gif
Binary files differ
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/BrowserEditorKit.java b/libjava/classpath/examples/gnu/classpath/examples/swing/BrowserEditorKit.java
new file mode 100644
index 00000000000..f61275e5766
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/BrowserEditorKit.java
@@ -0,0 +1,57 @@
+/* BrowserEditorKit.java -- A tweaked editor kit for the browser
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.classpath.examples.swing;
+
+import javax.swing.text.html.HTMLEditorKit;
+
+/**
+ * A tweaked editor kit for out browser.
+ */
+public class BrowserEditorKit
+ extends HTMLEditorKit
+{
+ public BrowserEditorKit()
+ {
+ super();
+ // Turn off automatic form submission so that we can receive notification
+ // instead and can update out location field.
+ setAutoFormSubmission(false);
+ }
+}
+
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/ClasspathSwingActivityBoard.launch b/libjava/classpath/examples/gnu/classpath/examples/swing/ClasspathSwingActivityBoard.launch
new file mode 100644
index 00000000000..7d041a0b0e7
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/ClasspathSwingActivityBoard.launch
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.cdt.launch.localCLaunch">
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="org.eclipse.cdt.debug.mi.core.CDebugger"/>
+<stringAttribute key="org.eclipse.cdt.launch.protocol" value="mi"/>
+<booleanAttribute key="org.eclipse.cdt.debug.mi.core.STOP_ON_SOLIB_EVENTS" value="false"/>
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
+<listAttribute key="org.eclipse.cdt.debug.mi.core.SOLIB_PATH"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<booleanAttribute key="org.eclipse.cdt.launch.ENABLE_REGISTER_BOOKKEEPING" value="false"/>
+<booleanAttribute key="org.eclipse.cdt.debug.mi.core.AUTO_SOLIB" value="true"/>
+<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
+<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="jamvm"/>
+<booleanAttribute key="org.eclipse.cdt.launch.ENABLE_VARIABLE_BOOKKEEPING" value="false"/>
+<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="gdb"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="src/jamvm"/>
+<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="-Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel gnu.classpath.examples.swing.Demo"/>
+<stringAttribute key="org.eclipse.cdt.debug.mi.core.GDB_INIT" value=""/>
+</launchConfiguration>
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/Demo.java b/libjava/classpath/examples/gnu/classpath/examples/swing/Demo.java
index 19bc27c1de8..3c7f0b887ef 100644
--- a/libjava/classpath/examples/gnu/classpath/examples/swing/Demo.java
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/Demo.java
@@ -28,7 +28,6 @@ import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
-import javax.swing.tree.*;
import javax.swing.plaf.basic.BasicLookAndFeel;
import javax.swing.plaf.metal.DefaultMetalTheme;
@@ -67,7 +66,7 @@ public class Demo
return getIcon("/gnu/classpath/examples/icons/big-" + s + ".png", s);
}
- private static Icon getIcon(String location, String name)
+ static Icon getIcon(String location, String name)
{
URL url = Demo.class.getResource(location);
if (url == null) System.err.println("WARNING " + location + " not found.");
@@ -161,6 +160,8 @@ public class Demo
NavigationFilterDemo.createDemoFactory())));
examples.add(new JMenuItem(new PopupAction("JNI Overhead",
JNIOverhead.createDemoFactory())));
+ examples.add(new JMenuItem(new PopupAction("HTML Demo",
+ HtmlDemo.createDemoFactory())));
final JMenuItem vmMenu;
@@ -294,21 +295,6 @@ public class Demo
return bar;
}
- private static String valign2str(int a)
- {
- switch (a)
- {
- case SwingConstants.CENTER:
- return "Center";
- case SwingConstants.TOP:
- return "Top";
- case SwingConstants.BOTTOM:
- return "Bottom";
- default:
- return "Unknown";
- }
- }
-
static String halign2str(int a)
{
switch (a)
@@ -354,17 +340,6 @@ public class Demo
return mkButton(null, i, -1, -1, -1, -1);
}
-
- private static JScrollPane mkScrollPane(JComponent inner)
- {
- JScrollPane jsp;
- jsp = new JScrollPane(inner,
- JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
- JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
-
- return jsp;
- }
-
public Demo()
{
frame = new JFrame("Swing Activity Board");
@@ -376,10 +351,7 @@ public class Demo
JPanel main = new JPanel();
main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS));
desktop = createDesktop();
-
- // Put the desktop in a scrollpane. The scrollbars may show then
- // up when the them or LaF is changed.
- main.add(new JScrollPane(desktop));
+ main.add(desktop);
main.add(mkButtonBar());
component.add(main, BorderLayout.CENTER);
frame.pack();
@@ -391,7 +363,7 @@ public class Demo
{
public void run()
{
- Demo demo = new Demo();
+ new Demo();
}
}
@@ -407,16 +379,6 @@ public class Demo
return b;
}
- private static JPanel mkPanel(JComponent[] inners)
- {
- JPanel p = new JPanel();
- for (int i = 0; i < inners.length; ++i)
- {
- p.add(inners[i]);
- }
- return p;
- }
-
static JButton mkDisposerButton(final JFrame c)
{
JButton close = mkBigButton("Close");
@@ -479,52 +441,6 @@ public class Demo
}
}
- /**
- * Create the tree.
- *
- * @return thr scroll pane, containing the tree.
- */
- private static JComponent mkTree()
- {
- DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root node");
-
- addChildren("Node", root, 12);
-
- JTree tree = new JTree(root);
- tree.setLargeModel(true);
- DefaultTreeSelectionModel dtsm = new DefaultTreeSelectionModel();
- dtsm.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION);
- tree.setSelectionModel(dtsm);
-
- // Make it editable.
- tree.setEditable(true);
-
- JComponent t = mkScrollPane(tree);
- t.setPreferredSize(new Dimension(200,200));
- return t;
- }
-
- /**
- * Add the specified number of children to this parent node. For each
- * child, the method is called recursively adding the nChildren-3 number of
- * grandchildren.
- *
- * @param parent the parent node
- * @param nChildren the number of children
- */
- private static void addChildren(String name, DefaultMutableTreeNode parent,
- int nChildren)
- {
- for (int i = 0; i < nChildren; i++)
- {
- String child_name = parent+"."+i;
- DefaultMutableTreeNode child = new DefaultMutableTreeNode
- (child_name);
- parent.add(child);
- addChildren(child_name, child, nChildren-3);
- }
- }
-
private JPanel mkButtonBar()
{
JPanel panel = new JPanel(new GridLayout(3, 1, 5, 5));
@@ -558,6 +474,8 @@ public class Demo
MetalThemeEditor.createDemoFactory())));
panel.add(new JButton(new PopupAction("JNI Overhead",
JNIOverhead.createDemoFactory())));
+ panel.add(new JButton(new PopupAction("HTML",
+ HtmlDemo.createDemoFactory())));
JButton exitDisposer = mkDisposerButton(frame);
panel.add(exitDisposer);
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/HtmlDemo.java b/libjava/classpath/examples/gnu/classpath/examples/swing/HtmlDemo.java
index 223ee07cd4a..1a24ae2760e 100644
--- a/libjava/classpath/examples/gnu/classpath/examples/swing/HtmlDemo.java
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/HtmlDemo.java
@@ -40,20 +40,31 @@ package gnu.classpath.examples.swing;
import java.awt.BorderLayout;
import java.awt.Dimension;
-import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.LinkedList;
+import javax.swing.BoxLayout;
+import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JComponent;
+import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
+import javax.swing.JTextField;
import javax.swing.JTextPane;
+import javax.swing.JToolBar;
import javax.swing.SwingUtilities;
-import javax.swing.text.Element;
-import javax.swing.text.html.HTMLDocument;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import javax.swing.text.html.FormSubmitEvent;
/**
* Parses and displays HTML content.
@@ -62,28 +73,54 @@ import javax.swing.text.html.HTMLDocument;
*/
public class HtmlDemo extends JPanel
{
-
- JTextPane html = new JTextPane();
- JTextArea text = new JTextArea("<html><body>" +
- "123456789HR!<hr>987654321"+
- "123456789BR!<br>987654321"+
- "<p id='insertHere'>Insertion target</p><p>"+
- "<font color=red>ma</font>"+
- "<sup>sup</sup>normal<sub>sub</sub>normal</p><p>Table:"+
- "<table><tr>a<td>b<td>c<tr>x<td>y<td>z</table></body></html>");
-
- JPanel buttons;
+ private class LoadActionListener
+ implements ActionListener
+ {
+
+ public void actionPerformed(ActionEvent event)
+ {
+ String urlStr = url.getText();
+ try
+ {
+ setPage(new URL(url.getText()));
+ }
+ catch (MalformedURLException ex)
+ {
+ // Do something more useful here.
+ ex.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * Setting this to true causes the parsed element structure to be dumped.
+ */
+ private static final boolean DEBUG = true;
+
+ /**
+ * The URL entry field.
+ */
+ JTextField url = new JTextField();
+
+ JTextPane html = new JTextPane();
int n;
+ /**
+ * The browsing history.
+ *
+ * Package private to avoid accessor method.
+ */
+ LinkedList history;
+
public HtmlDemo()
{
super();
- html.setContentType("text/html"); // not now.
+ history = new LinkedList();
createContent();
}
-
+
/**
* Returns a panel with the demo content. The panel uses a BorderLayout(), and
* the BorderLayout.SOUTH area is empty, to allow callers to add controls to
@@ -93,158 +130,128 @@ public class HtmlDemo extends JPanel
private void createContent()
{
setLayout(new BorderLayout());
-
- JPanel center = new JPanel();
- GridLayout layout = new GridLayout();
- layout.setRows(2);
- center.setLayout(layout);
- center.add(new JScrollPane(text));
- center.add(new JScrollPane(html));
-
- buttons = new JPanel();
-
- JButton parse = new JButton("parse");
- parse.addActionListener(new ActionListener()
+
+ JEditorPane.registerEditorKitForContentType("text/html",
+ BrowserEditorKit.class.getName());
+ html.setEditable(false);
+ html.addHyperlinkListener(new HyperlinkListener()
+ {
+
+ public void hyperlinkUpdate(HyperlinkEvent event)
{
- public void actionPerformed(ActionEvent event)
+ if (event instanceof FormSubmitEvent)
{
- String t = text.getText();
- System.out.println("HtmlDemo.java.createContent:Parsing started");
- html.setText(t);
- System.out.println("HtmlDemo.java.createContent:Parsing completed");
+ submitForm((FormSubmitEvent) event);
}
- });
-
- buttons.add(parse);
-
- JButton insertBeforeEnd = new JButton("before end");
- insertBeforeEnd.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent event)
+ else
{
- HTMLDocument doc = (HTMLDocument) html.getDocument();
- Element el = doc.getElement("insertHere");
- System.out.println("Element found:"+el);
- try
- {
- doc.insertBeforeEnd(el,"before end "+(n++));
- }
- catch (Exception e)
+ URL u = event.getURL();
+ if (u != null)
{
- e.printStackTrace();
+ setPage(u);
}
}
- });
-
- JButton insertBeforeStart = new JButton("before start");
- insertBeforeStart.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent event)
- {
- HTMLDocument doc = (HTMLDocument) html.getDocument();
- Element el = doc.getElement("insertHere");
- System.out.println("Element found:"+el);
- try
- {
- doc.insertBeforeStart(el,"before start "+(n++));
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- });
-
- JButton insertAfterEnd = new JButton("after end");
- insertAfterEnd.addActionListener(new ActionListener()
+ }
+
+ });
+
+ JScrollPane scroller = new JScrollPane(html);
+ JPanel urlPanel = new JPanel();
+ urlPanel.setLayout(new BoxLayout(urlPanel, BoxLayout.X_AXIS));
+ url.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
+ LoadActionListener action = new LoadActionListener();
+ url.addActionListener(action);
+ urlPanel.add(url);
+ JButton loadButton = new JButton("go");
+ urlPanel.add(loadButton);
+ loadButton.addActionListener(action);
+
+ // Setup control panel.
+ JToolBar controlPanel = createToolBar();
+ JPanel browserPanel = new JPanel();
+ browserPanel.setLayout(new BorderLayout());
+ browserPanel.add(urlPanel, BorderLayout.NORTH);
+ browserPanel.add(scroller, BorderLayout.CENTER);
+ add(controlPanel, BorderLayout.NORTH);
+ add(browserPanel, BorderLayout.CENTER);
+
+ // Load start page.
+ try
{
- public void actionPerformed(ActionEvent event)
- {
- HTMLDocument doc = (HTMLDocument) html.getDocument();
- Element el = doc.getElement("insertHere");
- System.out.println("Element found:"+el);
- try
- {
- doc.insertAfterEnd(el,"after end "+(n++));
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- });
-
- JButton insertAfterStart = new JButton("after start");
- insertAfterStart.addActionListener(new ActionListener()
+ URL startpage = getClass().getResource("welcome.html");
+ html.setPage(startpage);
+ url.setText(startpage.toString());
+ history.addLast(startpage);
+ }
+ catch (Exception ex)
{
- public void actionPerformed(ActionEvent event)
- {
- HTMLDocument doc = (HTMLDocument) html.getDocument();
- Element el = doc.getElement("insertHere");
- System.out.println("Element found:"+el);
- try
- {
- doc.insertAfterStart(el,"after start "+(n++));
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- });
-
+ System.err.println("couldn't load page: "/* + startpage*/);
+ ex.printStackTrace();
+ }
+ setPreferredSize(new Dimension(800, 600));
+ }
+
- JButton setInner = new JButton("inner");
- setInner.addActionListener(new ActionListener()
+ /**
+ * Creates the toolbar with the control buttons.
+ *
+ * @return the toolbar with the control buttons
+ */
+ JToolBar createToolBar()
+ {
+ JToolBar tb = new JToolBar();
+ Icon backIcon = Demo.getIcon("/gnu/classpath/examples/icons/back.png",
+ "back");
+ JButton back = new JButton(backIcon);
+ back.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent ev)
{
- public void actionPerformed(ActionEvent event)
+ if (history.size() > 1)
{
- HTMLDocument doc = (HTMLDocument) html.getDocument();
- Element el = doc.getElement("insertHere");
- System.out.println("Element found:"+el);
+ URL last = (URL) history.removeLast();
+ last = (URL) history.getLast();
+ url.setText(last.toString());
try
{
- doc.setInnerHTML(el,"inner "+(n++));
+ html.setPage(last);
}
- catch (Exception e)
+ catch (IOException ex)
{
- e.printStackTrace();
+ // Do something more useful.
+ ex.printStackTrace();
}
}
- });
-
- JButton setOuter = new JButton("outer");
- setOuter.addActionListener(new ActionListener()
+ }
+ });
+ tb.add(back);
+ Icon reloadIcon = Demo.getIcon("/gnu/classpath/examples/icons/reload.png",
+ "reload");
+ JButton reload = new JButton(reloadIcon);
+ reload.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent ev)
{
- public void actionPerformed(ActionEvent event)
+ if (history.size() > 0)
{
- HTMLDocument doc = (HTMLDocument) html.getDocument();
- Element el = doc.getElement("insertHere");
- System.out.println("Element found:"+el);
+ URL last = (URL) history.getLast();
+ url.setText(last.toString());
try
{
- doc.setOuterHTML(el,"outer "+(n++));
+ html.setPage(last);
}
- catch (Exception e)
+ catch (IOException ex)
{
- e.printStackTrace();
+ // Do something more useful.
+ ex.printStackTrace();
}
}
- });
-
-
- buttons.add(insertBeforeStart);
- buttons.add(insertAfterStart);
- buttons.add(insertBeforeEnd);
- buttons.add(insertAfterEnd);
-
- buttons.add(setInner);
- buttons.add(setOuter);
-
- add(center, BorderLayout.CENTER);
- add(buttons, BorderLayout.SOUTH);
+ }
+ });
+ tb.add(reload);
+ return tb;
}
-
+
/**
* The executable method to display the editable table.
*
@@ -259,27 +266,102 @@ public class HtmlDemo extends JPanel
public void run()
{
HtmlDemo demo = new HtmlDemo();
-
- JButton exit = new JButton("exit");
- exit.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent event)
- {
- System.exit(0);
- }
- });
-
- demo.buttons.add(exit);
-
JFrame frame = new JFrame();
frame.getContentPane().add(demo);
- frame.setSize(new Dimension(700, 480));
+ frame.setSize(new Dimension(750, 480));
frame.setVisible(true);
}
});
}
/**
+ * Helper method to navigate to a new URL.
+ *
+ * @param u the new URL to navigate to
+ */
+ void setPage(URL u)
+ {
+ try
+ {
+ url.setText(u.toString());
+ html.setPage(u);
+ history.addLast(u);
+ }
+ catch (IOException ex)
+ {
+ // Do something more useful here.
+ ex.printStackTrace();
+ }
+ }
+
+ /**
+ * Submits a form when a FormSubmitEvent is received. The HTML API
+ * provides automatic form submit but when this is enabled we don't
+ * receive any notification and can't update our location field.
+ *
+ * @param ev the form submit event
+ */
+ void submitForm(FormSubmitEvent ev)
+ {
+ URL url = ev.getURL();
+ String data = ev.getData();
+ FormSubmitEvent.MethodType method = ev.getMethod();
+ if (method == FormSubmitEvent.MethodType.POST)
+ {
+ try
+ {
+ URLConnection conn = url.openConnection();
+ postData(conn, data);
+ }
+ catch (IOException ex)
+ {
+ // Deal with this.
+ ex.printStackTrace();
+ }
+ }
+ else
+ {
+ try
+ {
+ url = new URL(url.toString() + "?" + data);
+ }
+ catch (MalformedURLException ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ setPage(url);
+ }
+
+ /**
+ * Posts the form data for forms with HTTP POST method.
+ *
+ * @param conn the connection
+ * @param data the form data
+ */
+ private void postData(URLConnection conn, String data)
+ {
+ conn.setDoOutput(true);
+ PrintWriter out = null;
+ try
+ {
+ out = new PrintWriter(new OutputStreamWriter(conn.getOutputStream()));
+ out.print(data);
+ out.flush();
+ }
+ catch (IOException ex)
+ {
+ // Deal with this!
+ ex.printStackTrace();
+ }
+ finally
+ {
+ if (out != null)
+ out.close();
+ }
+ }
+
+ /**
* Returns a DemoFactory that creates a HtmlDemo.
*
* @return a DemoFactory that creates a HtmlDemo
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/TabbedPaneDemo.java b/libjava/classpath/examples/gnu/classpath/examples/swing/TabbedPaneDemo.java
index 527fe455e4b..bd0e6bf15b6 100644
--- a/libjava/classpath/examples/gnu/classpath/examples/swing/TabbedPaneDemo.java
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/TabbedPaneDemo.java
@@ -39,15 +39,24 @@ exception statement from your version. */
package gnu.classpath.examples.swing;
import java.awt.BorderLayout;
+import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
+import javax.swing.JTextArea;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
@@ -55,6 +64,10 @@ public class TabbedPaneDemo
extends JPanel
implements ActionListener
{
+ static Color[] colors = { Color.BLUE, Color.CYAN, Color.GRAY, Color.GREEN,
+ Color.MAGENTA, Color.ORANGE, Color.PINK,
+ Color.ORANGE, Color.RED, Color.BLUE, Color.YELLOW
+ };
TabbedPaneDemo()
{
super();
@@ -64,25 +77,123 @@ public class TabbedPaneDemo
private void createContent()
{
JPanel p = new JPanel();
- p.setLayout(new GridLayout(2, 2));
- JTabbedPane tabs1 = new JTabbedPane(SwingConstants.TOP);
- tabs1.add("Top Item 1", new JButton("Content: Top Item 1"));
- tabs1.add("Top Item 2", new JButton("Content: Top Item 2"));
- JTabbedPane tabs2 = new JTabbedPane(SwingConstants.LEFT);
- tabs2.add("Left Item 1", new JButton("Content: Left Item 1"));
- tabs2.add("Left Item 2", new JButton("Content: Left Item 2"));
- JTabbedPane tabs3 = new JTabbedPane(SwingConstants.BOTTOM);
- tabs3.add("Bottom Item 1", new JButton("Content: Bottom Item 1"));
- tabs3.add("Bottom Item 2", new JButton("Content: Bottom Item 2"));
- JTabbedPane tabs4 = new JTabbedPane(SwingConstants.RIGHT);
- tabs4.add("Right Item 1", new JButton("Content: Right Item 1"));
- tabs4.add("Right Item 2", new JButton("Content: Right Item 2"));
- p.add(tabs1);
- p.add(tabs2);
- p.add(tabs3);
- p.add(tabs4);
+ p.setLayout(new GridLayout(1, 1));
+
+ int COUNT = 25;
+ JTabbedPane tp = createTabbedPane(SwingConstants.TOP, "tab", COUNT);
+ p.add(tp);
+
+ final JPopupMenu popup = new JPopupMenu();
+
+ JMenu menu = new JMenu("tab placement");
+ menu.add(createPlacementChangingMenuItem("top",
+ SwingConstants.TOP,
+ tp));
+
+ menu.add(createPlacementChangingMenuItem("bottom",
+ SwingConstants.BOTTOM,
+ tp));
+
+ menu.add(createPlacementChangingMenuItem("left",
+ SwingConstants.LEFT,
+ tp));
+
+ menu.add(createPlacementChangingMenuItem("right",
+ SwingConstants.RIGHT,
+ tp));
+ popup.add(menu);
+
+ menu = new JMenu("tab layout");
+ menu.add(createLayoutPolicyChangingMenuItem("wrapping tabs",
+ JTabbedPane.WRAP_TAB_LAYOUT,
+ tp));
+
+ menu.add(createLayoutPolicyChangingMenuItem("scrolling tabs",
+ JTabbedPane.SCROLL_TAB_LAYOUT,
+ tp));
+ popup.add(menu);
+
+ tp.addMouseListener(new MouseAdapter()
+ {
+ public void mousePressed(MouseEvent e) {
+ showPopup(e);
+ }
+
+ public void mouseReleased(MouseEvent e) {
+ showPopup(e);
+ }
+
+ void showPopup(MouseEvent e) {
+ if (e.isPopupTrigger()) {
+ popup.show(e.getComponent(), e.getX(), e.getY());
+ }
+ }
+ });
+
setLayout(new BorderLayout());
add(p, BorderLayout.CENTER);
+
+ }
+
+ private JMenuItem createPlacementChangingMenuItem(String t,
+ final int v,
+ final JTabbedPane dst)
+ {
+ JMenuItem item = new JMenuItem(t);
+
+ item.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent ae)
+ {
+ dst.setTabPlacement(v);
+ }
+ });
+
+ return item;
+ }
+
+ private JMenuItem createLayoutPolicyChangingMenuItem(String t,
+ final int v,
+ final JTabbedPane dst)
+ {
+ JMenuItem item = new JMenuItem(t);
+
+ item.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent ae)
+ {
+ dst.setTabLayoutPolicy(v);
+ }
+ });
+
+ return item;
+ }
+
+ private JTabbedPane createTabbedPane(int direction, String name, int count)
+ {
+ JTabbedPane pane = new JTabbedPane(direction);
+
+ for(int i = 0; i< count; i++)
+ {
+ pane.addTab(name + " " + i, createTabContent(name + " " + i));
+ if (Math.random() >= 0.75)
+ pane.setEnabledAt(i, false);
+ }
+
+ return pane;
+ }
+
+ private JPanel createTabContent(String name)
+ {
+ JTextArea ta;
+ JPanel panel = new JPanel();
+ panel.add(new JLabel(name));
+ panel.add(new JButton(name));
+ panel.add(new JScrollPane(ta = new JTextArea(5, 5)));
+
+ ta.setBackground(colors[(int) (Math.random() * colors.length)]);
+
+ return panel;
}
public void actionPerformed(ActionEvent e)
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/TreeDemo.java b/libjava/classpath/examples/gnu/classpath/examples/swing/TreeDemo.java
index 32f765f73bb..8da37507152 100644
--- a/libjava/classpath/examples/gnu/classpath/examples/swing/TreeDemo.java
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/TreeDemo.java
@@ -39,17 +39,17 @@ exception statement from your version. */
package gnu.classpath.examples.swing;
import java.awt.BorderLayout;
-import java.awt.JobAttributes.DefaultSelectionType;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-import javax.swing.DebugGraphics;
+import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
+import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.SwingUtilities;
@@ -59,7 +59,6 @@ import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.DefaultTreeSelectionModel;
import javax.swing.tree.TreePath;
-import javax.swing.tree.TreeSelectionModel;
public class TreeDemo
extends JPanel
@@ -222,11 +221,39 @@ public class TreeDemo
p2.add(add);
p2.add(cbSingle);
p2.add(cbRoot);
-
+
tree.getSelectionModel().
setSelectionMode(DefaultTreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
+ // Panel for selecting line style.
+ ActionListener l = new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ JRadioButton b = (JRadioButton) e.getSource();
+ tree.putClientProperty("JTree.lineStyle", b.getText());
+ tree.repaint();
+ }
+ };
+ JPanel lineStylePanel = new JPanel();
+ ButtonGroup buttons = new ButtonGroup();
+ lineStylePanel.add(new JLabel("Line style: "));
+ JRadioButton none = new JRadioButton("None");
+ lineStylePanel.add(none);
+ buttons.add(none);
+ none.addActionListener(l);
+ JRadioButton angled = new JRadioButton("Angled");
+ lineStylePanel.add(angled);
+ buttons.add(angled);
+ angled.addActionListener(l);
+ JRadioButton horizontal = new JRadioButton("Horizontal");
+ lineStylePanel.add(horizontal);
+ buttons.add(horizontal);
+ horizontal.addActionListener(l);
+ p2.add(lineStylePanel);
+
add(p2, BorderLayout.NORTH);
+
add(new JScrollPane(tree), BorderLayout.CENTER);
add(choice, BorderLayout.SOUTH);
}
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/forms.html b/libjava/classpath/examples/gnu/classpath/examples/swing/forms.html
new file mode 100644
index 00000000000..010a94c9360
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/forms.html
@@ -0,0 +1,98 @@
+<!-- welcome.html -- Some HTML stuff to show Swing HTML
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+
+ <head>
+ <title>HTML text styles</title>
+ </head>
+ <body>
+ <form>
+ <a href="welcome.html">Back to start page</a>
+ <h1>Some form elements</h1>
+ <h2>Textarea</h2>
+ <textarea cols="30" rows="5">
+ Hello GNU Classpath world. This text should show up in a text area
+ that has a size of 30 columns and 5 rows
+ </textarea>
+
+ <h2>Input fields</h2>
+ <p>
+ <input type="text" value="This is a normal textfield">
+ <input type="password" value="secret password">
+ </p>
+
+ <h2>Buttons</h2>
+ <p>
+ <input type="submit"></input>
+ <input type="reset"></input>
+ <input type="button" value="Some button"></input>
+ </p>
+
+ <h2>Checkboxes and Radiobuttons</h2>
+ <p>
+ <input type="checkbox" name="2">Check this!</input>
+ <input type="checkbox" name="2">Or this</input>
+ </p>
+ <p>
+ <input type="radio" name="1">A radio button</input>
+ <input type="radio" name="1">Another radio</input>
+ </p>
+ <h2>Select lists and combo boxes</h2>
+ <p>
+ <select>
+ <option>Value1</option>
+ <option>Value2</option>
+ <option>Value3</option>
+ <option label="Labeled value 4">Value4</option>
+ <option>Value5</option>
+ <option>Value6</option>
+ </select>
+ </p>
+ <p>
+ <select size="3">
+ <option>Value1</option>
+ <option>Value2</option>
+ <option>Value3</option>
+ <option label="Labeled value 4">Value4</option>
+ <option>Value5</option>
+ <option>Value6</option>
+ </select>
+ </p>
+ </form>
+ </body>
+</html> \ No newline at end of file
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/frame1.html b/libjava/classpath/examples/gnu/classpath/examples/swing/frame1.html
new file mode 100644
index 00000000000..b9150592fa7
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/frame1.html
@@ -0,0 +1,41 @@
+<!-- frame1.html -- Some HTML stuff to show Swing HTML
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. -->
+<html>
+<body>
+<h1>Top Left Frame</h1>
+</body>
+</html>
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/frame2.html b/libjava/classpath/examples/gnu/classpath/examples/swing/frame2.html
new file mode 100644
index 00000000000..9dbf33c5a0b
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/frame2.html
@@ -0,0 +1,42 @@
+<!-- frame2.html -- Some HTML stuff to show Swing HTML
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. -->
+<html>
+<body>
+<h1>Top Right
+ Frame</h1>
+</body>
+</html>
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/frame3.html b/libjava/classpath/examples/gnu/classpath/examples/swing/frame3.html
new file mode 100644
index 00000000000..e677bd6a100
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/frame3.html
@@ -0,0 +1,42 @@
+<!-- frame3.html -- Some HTML stuff to show Swing HTML
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. -->
+<html>
+<body>
+<h1>Bottom Left Frame</h1>
+</body>
+</html>
+
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/frame4.html b/libjava/classpath/examples/gnu/classpath/examples/swing/frame4.html
new file mode 100644
index 00000000000..1da53b1017b
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/frame4.html
@@ -0,0 +1,41 @@
+<!-- frame4.html -- Some HTML stuff to show Swing HTML
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. -->
+<html>
+<body>
+<h1>Bottom Left Frame</h1>
+</body>
+</html>
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/frames.html b/libjava/classpath/examples/gnu/classpath/examples/swing/frames.html
new file mode 100644
index 00000000000..e7e2bf87c95
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/frames.html
@@ -0,0 +1,44 @@
+<!-- frames.html -- Some HTML stuff to show Swing HTML
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. -->
+<html>
+<frameset cols="40%,60%" rows="20%,80%">
+ <frame src="frame1.html">
+ <frame src="frame2.html">
+ <frame src="frame3.html">
+ <frame src="frame4.html">
+</frameset>
+</html> \ No newline at end of file
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/tables.html b/libjava/classpath/examples/gnu/classpath/examples/swing/tables.html
new file mode 100644
index 00000000000..af908e1ab23
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/tables.html
@@ -0,0 +1,66 @@
+<!-- tables.html -- Some HTML stuff to show Swing HTML
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+
+<head>
+ <title>HTML text styles</title>
+ </head>
+ <body>
+<h1>Table examples</h1>
+<h2>Table with grid and mixed rowspan/colspan</h2>
+ <table border="1">
+ <tr>
+ <td width="30%" colspan="2">Spans two columns</td>
+ <td rowspan="3">Spans three rows</td>
+ </tr>
+ <tr>
+ <td rowspan="2">Spans two rows</td>
+ <td>This is the center</td>
+ </tr>
+ <tr>
+ <td>This should be in the middle of row number 3</td>
+ </tr>
+ <tr>
+ <td>A small one cell box</td>
+ <td colspan="2" rowspan="2">Spans two x two cells</td>
+ </tr>
+ <tr>
+ <td>Another small one cell box</td>
+ </tr>
+ </table>
+</body></html>
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/textstyles.html b/libjava/classpath/examples/gnu/classpath/examples/swing/textstyles.html
new file mode 100644
index 00000000000..786e18b77b8
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/textstyles.html
@@ -0,0 +1,78 @@
+<!-- welcome.html -- Some HTML stuff to show Swing HTML
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+
+ <head>
+ <title>HTML text styles</title>
+ </head>
+ <body>
+ <a href="welcome.html">Back to start page</a>
+ <h1>Colors</h1>
+ <p>The following are the 16 named colors in HTML. Of course you can also
+ use all RGB colors by specifying a value in the <code>#RRGGBB</code>
+ notation.</p>
+ <p>
+ <font color="black">Black</font>, <font color="gray">Gray</font>,
+ <font color="maroon">Maroon</font>, <font color="red">Red</font>,
+ <font color="green">Green</font>, <font color="lime">Lime</font>,
+ <font color="olive">Olive</font>, <font color="yellow">Yellow</font>,
+ <font color="navy">Navy</font>, <font color="blue">Blue</font>,
+ <font color="purple">Purple</font>, <font color="fuchsia">Fuchsia</font>,
+ <font color="teal">Teal</font>, <font color="aque">Aqua</font>,
+ <font color="silver">Silver</font>, <font color="white">White</font></p>
+ <h1>Font styles</h1>
+ <p>The following lists the logical and physical font styles that can be set
+ by certain HTML tags</p>
+ <p>
+ <!--<abbr>Abbreviation</abbr>, <acronym>Acronym</acronym>,-->
+ <address>Address</address>, <b>Bold</b>, <big>Big</big>,
+ <cite>Citation</cite>, <code>Code</code>, <del>Deleted</del>,
+ <em>Emphasized<em>, <i>Italic</i>, <ins>Inserted</ins>, <q>Quote</q>,
+ <s>Stroke-Through</s>, <samp>Example</samp>, <small>Small</small>,
+ <strike>Strike</strike>, <strong>Strong</strong>, <sub>Subscript</sub>,
+ <sup>Superscript</sup>, <u>Underlined</u>, <var>Variable</var>
+ </p>
+ <h1>Header Level 1</h1>
+ <h2>Header Level 2</h2>
+ <h3>Header Level 3</h3>
+ <h4>Header Level 4</h4>
+ <h5>Header Level 5</h5>
+ <h6>Header Level 6</h6>
+ <center>Some centered Text</center>
+ </body>
+</html> \ No newline at end of file
diff --git a/libjava/classpath/examples/gnu/classpath/examples/swing/welcome.html b/libjava/classpath/examples/gnu/classpath/examples/swing/welcome.html
new file mode 100644
index 00000000000..8bc987494c1
--- /dev/null
+++ b/libjava/classpath/examples/gnu/classpath/examples/swing/welcome.html
@@ -0,0 +1,63 @@
+<!-- welcome.html -- Some HTML stuff to show Swing HTML
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+ <head>
+ <title>GNU Classpath HTML Browser</title>
+ </head>
+ <body>
+ <img src="../icons/badge.png" width="100" height="100">
+ <h1>Welcome to GNU Classpath</h1>
+ <h2>A couple of websites that you might want to try out</h2>
+ <ul>
+ <li><a href="http://www.gnu.org/software/classpath/">GNU Classpath homepage</a></li>
+ <li><a href="http://planet.classpath.org">Planet Classpath</a></li>
+ <li><a href="http://developer.classpath.org">GNU Classpath developer pages</a></li>
+ <li><a href="http://www.google.com">Google</a></li>
+ </ul>
+
+ <h2>Testpages</h2>
+ <p>These few pages are here to demonstrate and test the HTML rendering
+ capabilities of GNU Classpath's Swing.</p>
+ <ul>
+ <li><a href="textstyles.html">Text styles</li>
+ <li><a href="forms.html">Form elements</li>
+ <li><a href="tables.html">Tables</li>
+ <li><a href="frames.html">Frames</li>
+ </ul>
+ </body>
+</html> \ No newline at end of file
diff --git a/libjava/classpath/external/.cvsignore b/libjava/classpath/external/.cvsignore
new file mode 100644
index 00000000000..282522db034
--- /dev/null
+++ b/libjava/classpath/external/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/libjava/classpath/external/Makefile.am b/libjava/classpath/external/Makefile.am
index 7f62733739e..2eeef805ad3 100644
--- a/libjava/classpath/external/Makefile.am
+++ b/libjava/classpath/external/Makefile.am
@@ -1,5 +1,5 @@
## Input file for automake to generate the Makefile.in used by configure
-SUBDIRS = sax w3c_dom relaxngDatatype
+SUBDIRS = sax w3c_dom relaxngDatatype jsr166
EXTRA_DIST = README
diff --git a/libjava/classpath/external/Makefile.in b/libjava/classpath/external/Makefile.in
index ffc37bb6f1f..4cf0f43bc8f 100644
--- a/libjava/classpath/external/Makefile.in
+++ b/libjava/classpath/external/Makefile.in
@@ -41,12 +41,14 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -166,6 +168,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -287,9 +291,8 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
-SUBDIRS = sax w3c_dom relaxngDatatype
+SUBDIRS = sax w3c_dom relaxngDatatype jsr166
EXTRA_DIST = README
all: all-recursive
diff --git a/libjava/classpath/external/jsr166/.cvsignore b/libjava/classpath/external/jsr166/.cvsignore
new file mode 100644
index 00000000000..70845e08eb0
--- /dev/null
+++ b/libjava/classpath/external/jsr166/.cvsignore
@@ -0,0 +1 @@
+Makefile.in
diff --git a/libjava/classpath/external/jsr166/IMPORTING b/libjava/classpath/external/jsr166/IMPORTING
new file mode 100644
index 00000000000..30bf3f47450
--- /dev/null
+++ b/libjava/classpath/external/jsr166/IMPORTING
@@ -0,0 +1,31 @@
+The code in this directory comes from the JSR 166
+reference implementation. The RI consists of a public
+domain part and a part that is copyright Sun. We remove
+the copyrighted code prior to import so as not to taint
+our source repository.
+
+To do a new import:
+
+* Download the RI from the source repository.
+ http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java
+ I clicked on the "download tarball" link.
+
+* Unpack the tarball in a fresh directory.
+ mkdir tmp; cd tmp; tar zxvvf .../java.tar.gz
+
+* Clean up the results.
+ .../classpath/scripts/sanitize-jsr166
+
+* Import these using 'cvs import' into the appropriate subdirectory.
+ The vendor branch name is 'JSR166'.
+
+* Merge the vendor branch onto the branch you're using (currently
+ the generics branch, but eventually it will be the trunk).
+
+* Build the result.
+
+* When it works, check it in.
+
+In general we try to avoid divergence from upstream as much
+as possible. You may need to write new classes or methods in
+order for the build to succeed.
diff --git a/libjava/classpath/external/jsr166/Makefile.am b/libjava/classpath/external/jsr166/Makefile.am
new file mode 100644
index 00000000000..fa2db2ebfd3
--- /dev/null
+++ b/libjava/classpath/external/jsr166/Makefile.am
@@ -0,0 +1,74 @@
+## Input file for automake to generate the Makefile.in used by configure
+
+EXTRA_DIST = IMPORTING \
+readme \
+java/util/AbstractQueue.java \
+java/util/concurrent/ScheduledThreadPoolExecutor.java \
+java/util/concurrent/ExecutorCompletionService.java \
+java/util/concurrent/LinkedBlockingQueue.java \
+java/util/concurrent/BlockingDeque.java \
+java/util/concurrent/Delayed.java \
+java/util/concurrent/ThreadFactory.java \
+java/util/concurrent/ArrayBlockingQueue.java \
+java/util/concurrent/RunnableFuture.java \
+java/util/concurrent/LinkedBlockingDeque.java \
+java/util/concurrent/CopyOnWriteArraySet.java \
+java/util/concurrent/DelayQueue.java \
+java/util/concurrent/SynchronousQueue.java \
+java/util/concurrent/Executor.java \
+java/util/concurrent/ExecutionException.java \
+java/util/concurrent/Semaphore.java \
+java/util/concurrent/BrokenBarrierException.java \
+java/util/concurrent/CompletionService.java \
+java/util/concurrent/CyclicBarrier.java \
+java/util/concurrent/AbstractExecutorService.java \
+java/util/concurrent/TimeoutException.java \
+java/util/concurrent/ConcurrentMap.java \
+java/util/concurrent/PriorityBlockingQueue.java \
+java/util/concurrent/CancellationException.java \
+java/util/concurrent/ConcurrentSkipListSet.java \
+java/util/concurrent/ConcurrentLinkedQueue.java \
+java/util/concurrent/RejectedExecutionHandler.java \
+java/util/concurrent/TimeUnit.java \
+java/util/concurrent/RejectedExecutionException.java \
+java/util/concurrent/ExecutorService.java \
+java/util/concurrent/ConcurrentHashMap.java \
+java/util/concurrent/ScheduledExecutorService.java \
+java/util/concurrent/ThreadPoolExecutor.java \
+java/util/concurrent/BlockingQueue.java \
+java/util/concurrent/ConcurrentSkipListMap.java \
+java/util/concurrent/ConcurrentNavigableMap.java \
+java/util/concurrent/Future.java \
+java/util/concurrent/FutureTask.java \
+java/util/concurrent/CountDownLatch.java \
+java/util/concurrent/RunnableScheduledFuture.java \
+java/util/concurrent/Callable.java \
+java/util/concurrent/locks/ReentrantLock.java \
+java/util/concurrent/locks/Lock.java \
+java/util/concurrent/locks/Condition.java \
+java/util/concurrent/locks/AbstractQueuedSynchronizer.java \
+java/util/concurrent/locks/AbstractOwnableSynchronizer.java \
+java/util/concurrent/locks/LockSupport.java \
+java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java \
+java/util/concurrent/locks/ReadWriteLock.java \
+java/util/concurrent/locks/ReentrantReadWriteLock.java \
+java/util/concurrent/Executors.java \
+java/util/concurrent/atomic/AtomicLongFieldUpdater.java \
+java/util/concurrent/atomic/AtomicLongArray.java \
+java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java \
+java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java \
+java/util/concurrent/atomic/AtomicBoolean.java \
+java/util/concurrent/atomic/AtomicReferenceArray.java \
+java/util/concurrent/atomic/AtomicStampedReference.java \
+java/util/concurrent/atomic/AtomicIntegerArray.java \
+java/util/concurrent/atomic/AtomicMarkableReference.java \
+java/util/concurrent/atomic/AtomicReference.java \
+java/util/concurrent/atomic/AtomicInteger.java \
+java/util/concurrent/atomic/AtomicLong.java \
+java/util/concurrent/ScheduledFuture.java \
+java/util/concurrent/Exchanger.java \
+java/util/Deque.java \
+java/util/NavigableMap.java \
+java/util/Queue.java \
+java/util/NavigableSet.java \
+java/util/ArrayDeque.java
diff --git a/libjava/classpath/external/jsr166/Makefile.in b/libjava/classpath/external/jsr166/Makefile.in
new file mode 100644
index 00000000000..ccfca8788e5
--- /dev/null
+++ b/libjava/classpath/external/jsr166/Makefile.in
@@ -0,0 +1,522 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = external/jsr166
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
+ $(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
+ $(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
+ $(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
+ $(top_srcdir)/m4/ax_create_stdint_h.m4 \
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
+BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CLASSPATH_CONVENIENCE = @CLASSPATH_CONVENIENCE@
+CLASSPATH_INCLUDES = @CLASSPATH_INCLUDES@
+CLASSPATH_MODULE = @CLASSPATH_MODULE@
+COLLECTIONS_PREFIX = @COLLECTIONS_PREFIX@
+CP = @CP@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CREATE_ALSA_LIBRARIES_FALSE = @CREATE_ALSA_LIBRARIES_FALSE@
+CREATE_ALSA_LIBRARIES_TRUE = @CREATE_ALSA_LIBRARIES_TRUE@
+CREATE_API_DOCS_FALSE = @CREATE_API_DOCS_FALSE@
+CREATE_API_DOCS_TRUE = @CREATE_API_DOCS_TRUE@
+CREATE_COLLECTIONS_FALSE = @CREATE_COLLECTIONS_FALSE@
+CREATE_COLLECTIONS_TRUE = @CREATE_COLLECTIONS_TRUE@
+CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@
+CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@
+CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@
+CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@
+CREATE_GCONF_PEER_LIBRARIES_FALSE = @CREATE_GCONF_PEER_LIBRARIES_FALSE@
+CREATE_GCONF_PEER_LIBRARIES_TRUE = @CREATE_GCONF_PEER_LIBRARIES_TRUE@
+CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@
+CREATE_GTK_PEER_LIBRARIES_TRUE = @CREATE_GTK_PEER_LIBRARIES_TRUE@
+CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
+CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
+CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
+CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
+CREATE_PLUGIN_FALSE = @CREATE_PLUGIN_FALSE@
+CREATE_PLUGIN_TRUE = @CREATE_PLUGIN_TRUE@
+CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
+CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
+CREATE_WRAPPERS_FALSE = @CREATE_WRAPPERS_FALSE@
+CREATE_WRAPPERS_TRUE = @CREATE_WRAPPERS_TRUE@
+CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
+CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+ECJ = @ECJ@
+EGREP = @EGREP@
+ENABLE_LOCAL_SOCKETS_FALSE = @ENABLE_LOCAL_SOCKETS_FALSE@
+ENABLE_LOCAL_SOCKETS_TRUE = @ENABLE_LOCAL_SOCKETS_TRUE@
+ERROR_CFLAGS = @ERROR_CFLAGS@
+EXAMPLESDIR = @EXAMPLESDIR@
+EXEEXT = @EXEEXT@
+FASTJAR = @FASTJAR@
+FIND = @FIND@
+FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
+FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
+FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
+FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
+FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
+FOUND_GCJX_TRUE = @FOUND_GCJX_TRUE@
+FOUND_GCJ_FALSE = @FOUND_GCJ_FALSE@
+FOUND_GCJ_TRUE = @FOUND_GCJ_TRUE@
+FOUND_JIKES_FALSE = @FOUND_JIKES_FALSE@
+FOUND_JIKES_TRUE = @FOUND_JIKES_TRUE@
+FOUND_KJC_FALSE = @FOUND_KJC_FALSE@
+FOUND_KJC_TRUE = @FOUND_KJC_TRUE@
+FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
+FREETYPE2_LIBS = @FREETYPE2_LIBS@
+GCJ = @GCJ@
+GCJX = @GCJX@
+GCONF_CFLAGS = @GCONF_CFLAGS@
+GCONF_LIBS = @GCONF_LIBS@
+GDK_CFLAGS = @GDK_CFLAGS@
+GDK_LIBS = @GDK_LIBS@
+GJDOC = @GJDOC@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
+INSTALL_CLASS_FILES_FALSE = @INSTALL_CLASS_FILES_FALSE@
+INSTALL_CLASS_FILES_TRUE = @INSTALL_CLASS_FILES_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_GLIBJ_ZIP_FALSE = @INSTALL_GLIBJ_ZIP_FALSE@
+INSTALL_GLIBJ_ZIP_TRUE = @INSTALL_GLIBJ_ZIP_TRUE@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
+JAY = @JAY@
+JAY_SKELETON = @JAY_SKELETON@
+JIKES = @JIKES@
+JIKESENCODING = @JIKESENCODING@
+JIKESWARNINGS = @JIKESWARNINGS@
+KJC = @KJC@
+LDFLAGS = @LDFLAGS@
+LIBDEBUG = @LIBDEBUG@
+LIBICONV = @LIBICONV@
+LIBMAGIC = @LIBMAGIC@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBVERSION = @LIBVERSION@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MKDIR = @MKDIR@
+MOC = @MOC@
+MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
+MOZILLA_LIBS = @MOZILLA_LIBS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
+PANGOFT2_LIBS = @PANGOFT2_LIBS@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TO_ESCHER = @PATH_TO_ESCHER@
+PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
+PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
+PLUGIN_DIR = @PLUGIN_DIR@
+QT_CFLAGS = @QT_CFLAGS@
+QT_LIBS = @QT_LIBS@
+RANLIB = @RANLIB@
+REGEN_PARSERS_FALSE = @REGEN_PARSERS_FALSE@
+REGEN_PARSERS_TRUE = @REGEN_PARSERS_TRUE@
+REMOVE = @REMOVE@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRICT_WARNING_CFLAGS = @STRICT_WARNING_CFLAGS@
+STRIP = @STRIP@
+USER_CLASSLIB = @USER_CLASSLIB@
+USER_JAVAH = @USER_JAVAH@
+USER_SPECIFIED_CLASSLIB_FALSE = @USER_SPECIFIED_CLASSLIB_FALSE@
+USER_SPECIFIED_CLASSLIB_TRUE = @USER_SPECIFIED_CLASSLIB_TRUE@
+USER_SPECIFIED_JAVAH_FALSE = @USER_SPECIFIED_JAVAH_FALSE@
+USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
+USE_ESCHER_FALSE = @USE_ESCHER_FALSE@
+USE_ESCHER_TRUE = @USE_ESCHER_TRUE@
+USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
+USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
+VERSION = @VERSION@
+VM_BINARY = @VM_BINARY@
+WARNING_CFLAGS = @WARNING_CFLAGS@
+XML_CFLAGS = @XML_CFLAGS@
+XML_LIBS = @XML_LIBS@
+XSLT_CFLAGS = @XSLT_CFLAGS@
+XSLT_LIBS = @XSLT_LIBS@
+XTEST_LIBS = @XTEST_LIBS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ZIP = @ZIP@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+default_toolkit = @default_toolkit@
+exec_prefix = @exec_prefix@
+glibjdir = @glibjdir@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+nativeexeclibdir = @nativeexeclibdir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+vm_classes = @vm_classes@
+EXTRA_DIST = IMPORTING \
+readme \
+java/util/AbstractQueue.java \
+java/util/concurrent/ScheduledThreadPoolExecutor.java \
+java/util/concurrent/ExecutorCompletionService.java \
+java/util/concurrent/LinkedBlockingQueue.java \
+java/util/concurrent/BlockingDeque.java \
+java/util/concurrent/Delayed.java \
+java/util/concurrent/ThreadFactory.java \
+java/util/concurrent/ArrayBlockingQueue.java \
+java/util/concurrent/RunnableFuture.java \
+java/util/concurrent/LinkedBlockingDeque.java \
+java/util/concurrent/CopyOnWriteArraySet.java \
+java/util/concurrent/DelayQueue.java \
+java/util/concurrent/SynchronousQueue.java \
+java/util/concurrent/Executor.java \
+java/util/concurrent/ExecutionException.java \
+java/util/concurrent/Semaphore.java \
+java/util/concurrent/BrokenBarrierException.java \
+java/util/concurrent/CompletionService.java \
+java/util/concurrent/CyclicBarrier.java \
+java/util/concurrent/AbstractExecutorService.java \
+java/util/concurrent/TimeoutException.java \
+java/util/concurrent/ConcurrentMap.java \
+java/util/concurrent/PriorityBlockingQueue.java \
+java/util/concurrent/CancellationException.java \
+java/util/concurrent/ConcurrentSkipListSet.java \
+java/util/concurrent/ConcurrentLinkedQueue.java \
+java/util/concurrent/RejectedExecutionHandler.java \
+java/util/concurrent/TimeUnit.java \
+java/util/concurrent/RejectedExecutionException.java \
+java/util/concurrent/ExecutorService.java \
+java/util/concurrent/ConcurrentHashMap.java \
+java/util/concurrent/ScheduledExecutorService.java \
+java/util/concurrent/ThreadPoolExecutor.java \
+java/util/concurrent/BlockingQueue.java \
+java/util/concurrent/ConcurrentSkipListMap.java \
+java/util/concurrent/ConcurrentNavigableMap.java \
+java/util/concurrent/Future.java \
+java/util/concurrent/FutureTask.java \
+java/util/concurrent/CountDownLatch.java \
+java/util/concurrent/RunnableScheduledFuture.java \
+java/util/concurrent/Callable.java \
+java/util/concurrent/locks/ReentrantLock.java \
+java/util/concurrent/locks/Lock.java \
+java/util/concurrent/locks/Condition.java \
+java/util/concurrent/locks/AbstractQueuedSynchronizer.java \
+java/util/concurrent/locks/AbstractOwnableSynchronizer.java \
+java/util/concurrent/locks/LockSupport.java \
+java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java \
+java/util/concurrent/locks/ReadWriteLock.java \
+java/util/concurrent/locks/ReentrantReadWriteLock.java \
+java/util/concurrent/Executors.java \
+java/util/concurrent/atomic/AtomicLongFieldUpdater.java \
+java/util/concurrent/atomic/AtomicLongArray.java \
+java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java \
+java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java \
+java/util/concurrent/atomic/AtomicBoolean.java \
+java/util/concurrent/atomic/AtomicReferenceArray.java \
+java/util/concurrent/atomic/AtomicStampedReference.java \
+java/util/concurrent/atomic/AtomicIntegerArray.java \
+java/util/concurrent/atomic/AtomicMarkableReference.java \
+java/util/concurrent/atomic/AtomicReference.java \
+java/util/concurrent/atomic/AtomicInteger.java \
+java/util/concurrent/atomic/AtomicLong.java \
+java/util/concurrent/ScheduledFuture.java \
+java/util/concurrent/Exchanger.java \
+java/util/Deque.java \
+java/util/NavigableMap.java \
+java/util/Queue.java \
+java/util/NavigableSet.java \
+java/util/ArrayDeque.java
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu external/jsr166/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu external/jsr166/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ $(mkdir_p) $(distdir)/java/util $(distdir)/java/util/concurrent $(distdir)/java/util/concurrent/atomic $(distdir)/java/util/concurrent/locks
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libjava/classpath/external/jsr166/java/util/AbstractQueue.java b/libjava/classpath/external/jsr166/java/util/AbstractQueue.java
new file mode 100644
index 00000000000..644df6c491d
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/AbstractQueue.java
@@ -0,0 +1,166 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util;
+
+/**
+ * This class provides skeletal implementations of some {@link Queue}
+ * operations. The implementations in this class are appropriate when
+ * the base implementation does <em>not</em> allow <tt>null</tt>
+ * elements. Methods {@link #add add}, {@link #remove remove}, and
+ * {@link #element element} are based on {@link #offer offer}, {@link
+ * #poll poll}, and {@link #peek peek}, respectively but throw
+ * exceptions instead of indicating failure via <tt>false</tt> or
+ * <tt>null</tt> returns.
+ *
+ * <p> A <tt>Queue</tt> implementation that extends this class must
+ * minimally define a method {@link Queue#offer} which does not permit
+ * insertion of <tt>null</tt> elements, along with methods {@link
+ * Queue#peek}, {@link Queue#poll}, {@link Collection#size}, and a
+ * {@link Collection#iterator} supporting {@link
+ * Iterator#remove}. Typically, additional methods will be overridden
+ * as well. If these requirements cannot be met, consider instead
+ * subclassing {@link AbstractCollection}.
+ *
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <E> the type of elements held in this collection
+ */
+public abstract class AbstractQueue<E>
+ extends AbstractCollection<E>
+ implements Queue<E> {
+
+ /**
+ * Constructor for use by subclasses.
+ */
+ protected AbstractQueue() {
+ }
+
+ /**
+ * Inserts the specified element into this queue if it is possible to do so
+ * immediately without violating capacity restrictions, returning
+ * <tt>true</tt> upon success and throwing an <tt>IllegalStateException</tt>
+ * if no space is currently available.
+ *
+ * <p>This implementation returns <tt>true</tt> if <tt>offer</tt> succeeds,
+ * else throws an <tt>IllegalStateException</tt>.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> (as specified by {@link Collection#add})
+ * @throws IllegalStateException if the element cannot be added at this
+ * time due to capacity restrictions
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this queue
+ * @throws NullPointerException if the specified element is null and
+ * this queue does not permit null elements
+ * @throws IllegalArgumentException if some property of this element
+ * prevents it from being added to this queue
+ */
+ public boolean add(E e) {
+ if (offer(e))
+ return true;
+ else
+ throw new IllegalStateException("Queue full");
+ }
+
+ /**
+ * Retrieves and removes the head of this queue. This method differs
+ * from {@link #poll poll} only in that it throws an exception if this
+ * queue is empty.
+ *
+ * <p>This implementation returns the result of <tt>poll</tt>
+ * unless the queue is empty.
+ *
+ * @return the head of this queue
+ * @throws NoSuchElementException if this queue is empty
+ */
+ public E remove() {
+ E x = poll();
+ if (x != null)
+ return x;
+ else
+ throw new NoSuchElementException();
+ }
+
+ /**
+ * Retrieves, but does not remove, the head of this queue. This method
+ * differs from {@link #peek peek} only in that it throws an exception if
+ * this queue is empty.
+ *
+ * <p>This implementation returns the result of <tt>peek</tt>
+ * unless the queue is empty.
+ *
+ * @return the head of this queue
+ * @throws NoSuchElementException if this queue is empty
+ */
+ public E element() {
+ E x = peek();
+ if (x != null)
+ return x;
+ else
+ throw new NoSuchElementException();
+ }
+
+ /**
+ * Removes all of the elements from this queue.
+ * The queue will be empty after this call returns.
+ *
+ * <p>This implementation repeatedly invokes {@link #poll poll} until it
+ * returns <tt>null</tt>.
+ */
+ public void clear() {
+ while (poll() != null)
+ ;
+ }
+
+ /**
+ * Adds all of the elements in the specified collection to this
+ * queue. Attempts to addAll of a queue to itself result in
+ * <tt>IllegalArgumentException</tt>. Further, the behavior of
+ * this operation is undefined if the specified collection is
+ * modified while the operation is in progress.
+ *
+ * <p>This implementation iterates over the specified collection,
+ * and adds each element returned by the iterator to this
+ * queue, in turn. A runtime exception encountered while
+ * trying to add an element (including, in particular, a
+ * <tt>null</tt> element) may result in only some of the elements
+ * having been successfully added when the associated exception is
+ * thrown.
+ *
+ * @param c collection containing elements to be added to this queue
+ * @return <tt>true</tt> if this queue changed as a result of the call
+ * @throws ClassCastException if the class of an element of the specified
+ * collection prevents it from being added to this queue
+ * @throws NullPointerException if the specified collection contains a
+ * null element and this queue does not permit null elements,
+ * or if the specified collection is null
+ * @throws IllegalArgumentException if some property of an element of the
+ * specified collection prevents it from being added to this
+ * queue, or if the specified collection is this queue
+ * @throws IllegalStateException if not all the elements can be added at
+ * this time due to insertion restrictions
+ * @see #add(Object)
+ */
+ public boolean addAll(Collection<? extends E> c) {
+ if (c == null)
+ throw new NullPointerException();
+ if (c == this)
+ throw new IllegalArgumentException();
+ boolean modified = false;
+ Iterator<? extends E> e = c.iterator();
+ while (e.hasNext()) {
+ if (add(e.next()))
+ modified = true;
+ }
+ return modified;
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/ArrayDeque.java b/libjava/classpath/external/jsr166/java/util/ArrayDeque.java
new file mode 100644
index 00000000000..c0ee16ea7b3
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/ArrayDeque.java
@@ -0,0 +1,839 @@
+/*
+ * Written by Josh Bloch of Google Inc. and released to the public domain,
+ * as explained at http://creativecommons.org/licenses/publicdomain.
+ */
+
+package java.util;
+import java.io.*;
+
+/**
+ * Resizable-array implementation of the {@link Deque} interface. Array
+ * deques have no capacity restrictions; they grow as necessary to support
+ * usage. They are not thread-safe; in the absence of external
+ * synchronization, they do not support concurrent access by multiple threads.
+ * Null elements are prohibited. This class is likely to be faster than
+ * {@link Stack} when used as a stack, and faster than {@link LinkedList}
+ * when used as a queue.
+ *
+ * <p>Most <tt>ArrayDeque</tt> operations run in amortized constant time.
+ * Exceptions include {@link #remove(Object) remove}, {@link
+ * #removeFirstOccurrence removeFirstOccurrence}, {@link #removeLastOccurrence
+ * removeLastOccurrence}, {@link #contains contains}, {@link #iterator
+ * iterator.remove()}, and the bulk operations, all of which run in linear
+ * time.
+ *
+ * <p>The iterators returned by this class's <tt>iterator</tt> method are
+ * <i>fail-fast</i>: If the deque is modified at any time after the iterator
+ * is created, in any way except through the iterator's own <tt>remove</tt>
+ * method, the iterator will generally throw a {@link
+ * ConcurrentModificationException}. Thus, in the face of concurrent
+ * modification, the iterator fails quickly and cleanly, rather than risking
+ * arbitrary, non-deterministic behavior at an undetermined time in the
+ * future.
+ *
+ * <p>Note that the fail-fast behavior of an iterator cannot be guaranteed
+ * as it is, generally speaking, impossible to make any hard guarantees in the
+ * presence of unsynchronized concurrent modification. Fail-fast iterators
+ * throw <tt>ConcurrentModificationException</tt> on a best-effort basis.
+ * Therefore, it would be wrong to write a program that depended on this
+ * exception for its correctness: <i>the fail-fast behavior of iterators
+ * should be used only to detect bugs.</i>
+ *
+ * <p>This class and its iterator implement all of the
+ * <em>optional</em> methods of the {@link Collection} and {@link
+ * Iterator} interfaces.
+ *
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @author Josh Bloch and Doug Lea
+ * @since 1.6
+ * @param <E> the type of elements held in this collection
+ */
+public class ArrayDeque<E> extends AbstractCollection<E>
+ implements Deque<E>, Cloneable, Serializable
+{
+ /**
+ * The array in which the elements of the deque are stored.
+ * The capacity of the deque is the length of this array, which is
+ * always a power of two. The array is never allowed to become
+ * full, except transiently within an addX method where it is
+ * resized (see doubleCapacity) immediately upon becoming full,
+ * thus avoiding head and tail wrapping around to equal each
+ * other. We also guarantee that all array cells not holding
+ * deque elements are always null.
+ */
+ private transient E[] elements;
+
+ /**
+ * The index of the element at the head of the deque (which is the
+ * element that would be removed by remove() or pop()); or an
+ * arbitrary number equal to tail if the deque is empty.
+ */
+ private transient int head;
+
+ /**
+ * The index at which the next element would be added to the tail
+ * of the deque (via addLast(E), add(E), or push(E)).
+ */
+ private transient int tail;
+
+ /**
+ * The minimum capacity that we'll use for a newly created deque.
+ * Must be a power of 2.
+ */
+ private static final int MIN_INITIAL_CAPACITY = 8;
+
+ // ****** Array allocation and resizing utilities ******
+
+ /**
+ * Allocate empty array to hold the given number of elements.
+ *
+ * @param numElements the number of elements to hold
+ */
+ private void allocateElements(int numElements) {
+ int initialCapacity = MIN_INITIAL_CAPACITY;
+ // Find the best power of two to hold elements.
+ // Tests "<=" because arrays aren't kept full.
+ if (numElements >= initialCapacity) {
+ initialCapacity = numElements;
+ initialCapacity |= (initialCapacity >>> 1);
+ initialCapacity |= (initialCapacity >>> 2);
+ initialCapacity |= (initialCapacity >>> 4);
+ initialCapacity |= (initialCapacity >>> 8);
+ initialCapacity |= (initialCapacity >>> 16);
+ initialCapacity++;
+
+ if (initialCapacity < 0) // Too many elements, must back off
+ initialCapacity >>>= 1;// Good luck allocating 2 ^ 30 elements
+ }
+ elements = (E[]) new Object[initialCapacity];
+ }
+
+ /**
+ * Double the capacity of this deque. Call only when full, i.e.,
+ * when head and tail have wrapped around to become equal.
+ */
+ private void doubleCapacity() {
+ assert head == tail;
+ int p = head;
+ int n = elements.length;
+ int r = n - p; // number of elements to the right of p
+ int newCapacity = n << 1;
+ if (newCapacity < 0)
+ throw new IllegalStateException("Sorry, deque too big");
+ Object[] a = new Object[newCapacity];
+ System.arraycopy(elements, p, a, 0, r);
+ System.arraycopy(elements, 0, a, r, p);
+ elements = (E[])a;
+ head = 0;
+ tail = n;
+ }
+
+ /**
+ * Copies the elements from our element array into the specified array,
+ * in order (from first to last element in the deque). It is assumed
+ * that the array is large enough to hold all elements in the deque.
+ *
+ * @return its argument
+ */
+ private <T> T[] copyElements(T[] a) {
+ if (head < tail) {
+ System.arraycopy(elements, head, a, 0, size());
+ } else if (head > tail) {
+ int headPortionLen = elements.length - head;
+ System.arraycopy(elements, head, a, 0, headPortionLen);
+ System.arraycopy(elements, 0, a, headPortionLen, tail);
+ }
+ return a;
+ }
+
+ /**
+ * Constructs an empty array deque with an initial capacity
+ * sufficient to hold 16 elements.
+ */
+ public ArrayDeque() {
+ elements = (E[]) new Object[16];
+ }
+
+ /**
+ * Constructs an empty array deque with an initial capacity
+ * sufficient to hold the specified number of elements.
+ *
+ * @param numElements lower bound on initial capacity of the deque
+ */
+ public ArrayDeque(int numElements) {
+ allocateElements(numElements);
+ }
+
+ /**
+ * Constructs a deque containing the elements of the specified
+ * collection, in the order they are returned by the collection's
+ * iterator. (The first element returned by the collection's
+ * iterator becomes the first element, or <i>front</i> of the
+ * deque.)
+ *
+ * @param c the collection whose elements are to be placed into the deque
+ * @throws NullPointerException if the specified collection is null
+ */
+ public ArrayDeque(Collection<? extends E> c) {
+ allocateElements(c.size());
+ addAll(c);
+ }
+
+ // The main insertion and extraction methods are addFirst,
+ // addLast, pollFirst, pollLast. The other methods are defined in
+ // terms of these.
+
+ /**
+ * Inserts the specified element at the front of this deque.
+ *
+ * @param e the element to add
+ * @throws NullPointerException if the specified element is null
+ */
+ public void addFirst(E e) {
+ if (e == null)
+ throw new NullPointerException();
+ elements[head = (head - 1) & (elements.length - 1)] = e;
+ if (head == tail)
+ doubleCapacity();
+ }
+
+ /**
+ * Inserts the specified element at the end of this deque.
+ *
+ * <p>This method is equivalent to {@link #add}.
+ *
+ * @param e the element to add
+ * @throws NullPointerException if the specified element is null
+ */
+ public void addLast(E e) {
+ if (e == null)
+ throw new NullPointerException();
+ elements[tail] = e;
+ if ( (tail = (tail + 1) & (elements.length - 1)) == head)
+ doubleCapacity();
+ }
+
+ /**
+ * Inserts the specified element at the front of this deque.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> (as specified by {@link Deque#offerFirst})
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean offerFirst(E e) {
+ addFirst(e);
+ return true;
+ }
+
+ /**
+ * Inserts the specified element at the end of this deque.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> (as specified by {@link Deque#offerLast})
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean offerLast(E e) {
+ addLast(e);
+ return true;
+ }
+
+ /**
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public E removeFirst() {
+ E x = pollFirst();
+ if (x == null)
+ throw new NoSuchElementException();
+ return x;
+ }
+
+ /**
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public E removeLast() {
+ E x = pollLast();
+ if (x == null)
+ throw new NoSuchElementException();
+ return x;
+ }
+
+ public E pollFirst() {
+ int h = head;
+ E result = elements[h]; // Element is null if deque empty
+ if (result == null)
+ return null;
+ elements[h] = null; // Must null out slot
+ head = (h + 1) & (elements.length - 1);
+ return result;
+ }
+
+ public E pollLast() {
+ int t = (tail - 1) & (elements.length - 1);
+ E result = elements[t];
+ if (result == null)
+ return null;
+ elements[t] = null;
+ tail = t;
+ return result;
+ }
+
+ /**
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public E getFirst() {
+ E x = elements[head];
+ if (x == null)
+ throw new NoSuchElementException();
+ return x;
+ }
+
+ /**
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public E getLast() {
+ E x = elements[(tail - 1) & (elements.length - 1)];
+ if (x == null)
+ throw new NoSuchElementException();
+ return x;
+ }
+
+ public E peekFirst() {
+ return elements[head]; // elements[head] is null if deque empty
+ }
+
+ public E peekLast() {
+ return elements[(tail - 1) & (elements.length - 1)];
+ }
+
+ /**
+ * Removes the first occurrence of the specified element in this
+ * deque (when traversing the deque from head to tail).
+ * If the deque does not contain the element, it is unchanged.
+ * More formally, removes the first element <tt>e</tt> such that
+ * <tt>o.equals(e)</tt> (if such an element exists).
+ * Returns <tt>true</tt> if this deque contained the specified element
+ * (or equivalently, if this deque changed as a result of the call).
+ *
+ * @param o element to be removed from this deque, if present
+ * @return <tt>true</tt> if the deque contained the specified element
+ */
+ public boolean removeFirstOccurrence(Object o) {
+ if (o == null)
+ return false;
+ int mask = elements.length - 1;
+ int i = head;
+ E x;
+ while ( (x = elements[i]) != null) {
+ if (o.equals(x)) {
+ delete(i);
+ return true;
+ }
+ i = (i + 1) & mask;
+ }
+ return false;
+ }
+
+ /**
+ * Removes the last occurrence of the specified element in this
+ * deque (when traversing the deque from head to tail).
+ * If the deque does not contain the element, it is unchanged.
+ * More formally, removes the last element <tt>e</tt> such that
+ * <tt>o.equals(e)</tt> (if such an element exists).
+ * Returns <tt>true</tt> if this deque contained the specified element
+ * (or equivalently, if this deque changed as a result of the call).
+ *
+ * @param o element to be removed from this deque, if present
+ * @return <tt>true</tt> if the deque contained the specified element
+ */
+ public boolean removeLastOccurrence(Object o) {
+ if (o == null)
+ return false;
+ int mask = elements.length - 1;
+ int i = (tail - 1) & mask;
+ E x;
+ while ( (x = elements[i]) != null) {
+ if (o.equals(x)) {
+ delete(i);
+ return true;
+ }
+ i = (i - 1) & mask;
+ }
+ return false;
+ }
+
+ // *** Queue methods ***
+
+ /**
+ * Inserts the specified element at the end of this deque.
+ *
+ * <p>This method is equivalent to {@link #addLast}.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> (as specified by {@link Collection#add})
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean add(E e) {
+ addLast(e);
+ return true;
+ }
+
+ /**
+ * Inserts the specified element at the end of this deque.
+ *
+ * <p>This method is equivalent to {@link #offerLast}.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> (as specified by {@link Queue#offer})
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean offer(E e) {
+ return offerLast(e);
+ }
+
+ /**
+ * Retrieves and removes the head of the queue represented by this deque.
+ *
+ * This method differs from {@link #poll poll} only in that it throws an
+ * exception if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #removeFirst}.
+ *
+ * @return the head of the queue represented by this deque
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public E remove() {
+ return removeFirst();
+ }
+
+ /**
+ * Retrieves and removes the head of the queue represented by this deque
+ * (in other words, the first element of this deque), or returns
+ * <tt>null</tt> if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #pollFirst}.
+ *
+ * @return the head of the queue represented by this deque, or
+ * <tt>null</tt> if this deque is empty
+ */
+ public E poll() {
+ return pollFirst();
+ }
+
+ /**
+ * Retrieves, but does not remove, the head of the queue represented by
+ * this deque. This method differs from {@link #peek peek} only in
+ * that it throws an exception if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #getFirst}.
+ *
+ * @return the head of the queue represented by this deque
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public E element() {
+ return getFirst();
+ }
+
+ /**
+ * Retrieves, but does not remove, the head of the queue represented by
+ * this deque, or returns <tt>null</tt> if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #peekFirst}.
+ *
+ * @return the head of the queue represented by this deque, or
+ * <tt>null</tt> if this deque is empty
+ */
+ public E peek() {
+ return peekFirst();
+ }
+
+ // *** Stack methods ***
+
+ /**
+ * Pushes an element onto the stack represented by this deque. In other
+ * words, inserts the element at the front of this deque.
+ *
+ * <p>This method is equivalent to {@link #addFirst}.
+ *
+ * @param e the element to push
+ * @throws NullPointerException if the specified element is null
+ */
+ public void push(E e) {
+ addFirst(e);
+ }
+
+ /**
+ * Pops an element from the stack represented by this deque. In other
+ * words, removes and returns the first element of this deque.
+ *
+ * <p>This method is equivalent to {@link #removeFirst()}.
+ *
+ * @return the element at the front of this deque (which is the top
+ * of the stack represented by this deque)
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public E pop() {
+ return removeFirst();
+ }
+
+ private void checkInvariants() {
+ assert elements[tail] == null;
+ assert head == tail ? elements[head] == null :
+ (elements[head] != null &&
+ elements[(tail - 1) & (elements.length - 1)] != null);
+ assert elements[(head - 1) & (elements.length - 1)] == null;
+ }
+
+ /**
+ * Removes the element at the specified position in the elements array,
+ * adjusting head and tail as necessary. This can result in motion of
+ * elements backwards or forwards in the array.
+ *
+ * <p>This method is called delete rather than remove to emphasize
+ * that its semantics differ from those of {@link List#remove(int)}.
+ *
+ * @return true if elements moved backwards
+ */
+ private boolean delete(int i) {
+ checkInvariants();
+ final E[] elements = this.elements;
+ final int mask = elements.length - 1;
+ final int h = head;
+ final int t = tail;
+ final int front = (i - h) & mask;
+ final int back = (t - i) & mask;
+
+ // Invariant: head <= i < tail mod circularity
+ if (front >= ((t - h) & mask))
+ throw new ConcurrentModificationException();
+
+ // Optimize for least element motion
+ if (front < back) {
+ if (h <= i) {
+ System.arraycopy(elements, h, elements, h + 1, front);
+ } else { // Wrap around
+ System.arraycopy(elements, 0, elements, 1, i);
+ elements[0] = elements[mask];
+ System.arraycopy(elements, h, elements, h + 1, mask - h);
+ }
+ elements[h] = null;
+ head = (h + 1) & mask;
+ return false;
+ } else {
+ if (i < t) { // Copy the null tail as well
+ System.arraycopy(elements, i + 1, elements, i, back);
+ tail = t - 1;
+ } else { // Wrap around
+ System.arraycopy(elements, i + 1, elements, i, mask - i);
+ elements[mask] = elements[0];
+ System.arraycopy(elements, 1, elements, 0, t);
+ tail = (t - 1) & mask;
+ }
+ return true;
+ }
+ }
+
+ // *** Collection Methods ***
+
+ /**
+ * Returns the number of elements in this deque.
+ *
+ * @return the number of elements in this deque
+ */
+ public int size() {
+ return (tail - head) & (elements.length - 1);
+ }
+
+ /**
+ * Returns <tt>true</tt> if this deque contains no elements.
+ *
+ * @return <tt>true</tt> if this deque contains no elements
+ */
+ public boolean isEmpty() {
+ return head == tail;
+ }
+
+ /**
+ * Returns an iterator over the elements in this deque. The elements
+ * will be ordered from first (head) to last (tail). This is the same
+ * order that elements would be dequeued (via successive calls to
+ * {@link #remove} or popped (via successive calls to {@link #pop}).
+ *
+ * @return an iterator over the elements in this deque
+ */
+ public Iterator<E> iterator() {
+ return new DeqIterator();
+ }
+
+ public Iterator<E> descendingIterator() {
+ return new DescendingIterator();
+ }
+
+ private class DeqIterator implements Iterator<E> {
+ /**
+ * Index of element to be returned by subsequent call to next.
+ */
+ private int cursor = head;
+
+ /**
+ * Tail recorded at construction (also in remove), to stop
+ * iterator and also to check for comodification.
+ */
+ private int fence = tail;
+
+ /**
+ * Index of element returned by most recent call to next.
+ * Reset to -1 if element is deleted by a call to remove.
+ */
+ private int lastRet = -1;
+
+ public boolean hasNext() {
+ return cursor != fence;
+ }
+
+ public E next() {
+ if (cursor == fence)
+ throw new NoSuchElementException();
+ E result = elements[cursor];
+ // This check doesn't catch all possible comodifications,
+ // but does catch the ones that corrupt traversal
+ if (tail != fence || result == null)
+ throw new ConcurrentModificationException();
+ lastRet = cursor;
+ cursor = (cursor + 1) & (elements.length - 1);
+ return result;
+ }
+
+ public void remove() {
+ if (lastRet < 0)
+ throw new IllegalStateException();
+ if (delete(lastRet)) { // if left-shifted, undo increment in next()
+ cursor = (cursor - 1) & (elements.length - 1);
+ fence = tail;
+ }
+ lastRet = -1;
+ }
+ }
+
+ private class DescendingIterator implements Iterator<E> {
+ /*
+ * This class is nearly a mirror-image of DeqIterator, using
+ * tail instead of head for initial cursor, and head instead of
+ * tail for fence.
+ */
+ private int cursor = tail;
+ private int fence = head;
+ private int lastRet = -1;
+
+ public boolean hasNext() {
+ return cursor != fence;
+ }
+
+ public E next() {
+ if (cursor == fence)
+ throw new NoSuchElementException();
+ cursor = (cursor - 1) & (elements.length - 1);
+ E result = elements[cursor];
+ if (head != fence || result == null)
+ throw new ConcurrentModificationException();
+ lastRet = cursor;
+ return result;
+ }
+
+ public void remove() {
+ if (lastRet < 0)
+ throw new IllegalStateException();
+ if (!delete(lastRet)) {
+ cursor = (cursor + 1) & (elements.length - 1);
+ fence = head;
+ }
+ lastRet = -1;
+ }
+ }
+
+ /**
+ * Returns <tt>true</tt> if this deque contains the specified element.
+ * More formally, returns <tt>true</tt> if and only if this deque contains
+ * at least one element <tt>e</tt> such that <tt>o.equals(e)</tt>.
+ *
+ * @param o object to be checked for containment in this deque
+ * @return <tt>true</tt> if this deque contains the specified element
+ */
+ public boolean contains(Object o) {
+ if (o == null)
+ return false;
+ int mask = elements.length - 1;
+ int i = head;
+ E x;
+ while ( (x = elements[i]) != null) {
+ if (o.equals(x))
+ return true;
+ i = (i + 1) & mask;
+ }
+ return false;
+ }
+
+ /**
+ * Removes a single instance of the specified element from this deque.
+ * If the deque does not contain the element, it is unchanged.
+ * More formally, removes the first element <tt>e</tt> such that
+ * <tt>o.equals(e)</tt> (if such an element exists).
+ * Returns <tt>true</tt> if this deque contained the specified element
+ * (or equivalently, if this deque changed as a result of the call).
+ *
+ * <p>This method is equivalent to {@link #removeFirstOccurrence}.
+ *
+ * @param o element to be removed from this deque, if present
+ * @return <tt>true</tt> if this deque contained the specified element
+ */
+ public boolean remove(Object o) {
+ return removeFirstOccurrence(o);
+ }
+
+ /**
+ * Removes all of the elements from this deque.
+ * The deque will be empty after this call returns.
+ */
+ public void clear() {
+ int h = head;
+ int t = tail;
+ if (h != t) { // clear all cells
+ head = tail = 0;
+ int i = h;
+ int mask = elements.length - 1;
+ do {
+ elements[i] = null;
+ i = (i + 1) & mask;
+ } while (i != t);
+ }
+ }
+
+ /**
+ * Returns an array containing all of the elements in this deque
+ * in proper sequence (from first to last element).
+ *
+ * <p>The returned array will be "safe" in that no references to it are
+ * maintained by this deque. (In other words, this method must allocate
+ * a new array). The caller is thus free to modify the returned array.
+ *
+ * <p>This method acts as bridge between array-based and collection-based
+ * APIs.
+ *
+ * @return an array containing all of the elements in this deque
+ */
+ public Object[] toArray() {
+ return copyElements(new Object[size()]);
+ }
+
+ /**
+ * Returns an array containing all of the elements in this deque in
+ * proper sequence (from first to last element); the runtime type of the
+ * returned array is that of the specified array. If the deque fits in
+ * the specified array, it is returned therein. Otherwise, a new array
+ * is allocated with the runtime type of the specified array and the
+ * size of this deque.
+ *
+ * <p>If this deque fits in the specified array with room to spare
+ * (i.e., the array has more elements than this deque), the element in
+ * the array immediately following the end of the deque is set to
+ * <tt>null</tt>.
+ *
+ * <p>Like the {@link #toArray()} method, this method acts as bridge between
+ * array-based and collection-based APIs. Further, this method allows
+ * precise control over the runtime type of the output array, and may,
+ * under certain circumstances, be used to save allocation costs.
+ *
+ * <p>Suppose <tt>x</tt> is a deque known to contain only strings.
+ * The following code can be used to dump the deque into a newly
+ * allocated array of <tt>String</tt>:
+ *
+ * <pre>
+ * String[] y = x.toArray(new String[0]);</pre>
+ *
+ * Note that <tt>toArray(new Object[0])</tt> is identical in function to
+ * <tt>toArray()</tt>.
+ *
+ * @param a the array into which the elements of the deque are to
+ * be stored, if it is big enough; otherwise, a new array of the
+ * same runtime type is allocated for this purpose
+ * @return an array containing all of the elements in this deque
+ * @throws ArrayStoreException if the runtime type of the specified array
+ * is not a supertype of the runtime type of every element in
+ * this deque
+ * @throws NullPointerException if the specified array is null
+ */
+ public <T> T[] toArray(T[] a) {
+ int size = size();
+ if (a.length < size)
+ a = (T[])java.lang.reflect.Array.newInstance(
+ a.getClass().getComponentType(), size);
+ copyElements(a);
+ if (a.length > size)
+ a[size] = null;
+ return a;
+ }
+
+ // *** Object methods ***
+
+ /**
+ * Returns a copy of this deque.
+ *
+ * @return a copy of this deque
+ */
+ public ArrayDeque<E> clone() {
+ try {
+ ArrayDeque<E> result = (ArrayDeque<E>) super.clone();
+ // Classpath local: we don't have Arrays.copyOf yet.
+ // result.elements = Arrays.copyOf(elements, elements.length);
+ result.elements = (E[]) elements.clone();
+ return result;
+
+ } catch (CloneNotSupportedException e) {
+ throw new AssertionError();
+ }
+ }
+
+ /**
+ * Appease the serialization gods.
+ */
+ private static final long serialVersionUID = 2340985798034038923L;
+
+ /**
+ * Serialize this deque.
+ *
+ * @serialData The current size (<tt>int</tt>) of the deque,
+ * followed by all of its elements (each an object reference) in
+ * first-to-last order.
+ */
+ private void writeObject(ObjectOutputStream s) throws IOException {
+ s.defaultWriteObject();
+
+ // Write out size
+ s.writeInt(size());
+
+ // Write out elements in order.
+ int mask = elements.length - 1;
+ for (int i = head; i != tail; i = (i + 1) & mask)
+ s.writeObject(elements[i]);
+ }
+
+ /**
+ * Deserialize this deque.
+ */
+ private void readObject(ObjectInputStream s)
+ throws IOException, ClassNotFoundException {
+ s.defaultReadObject();
+
+ // Read in size and allocate array
+ int size = s.readInt();
+ allocateElements(size);
+ head = 0;
+ tail = size;
+
+ // Read in all elements in the proper order.
+ for (int i = 0; i < size; i++)
+ elements[i] = (E)s.readObject();
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/Deque.java b/libjava/classpath/external/jsr166/java/util/Deque.java
new file mode 100644
index 00000000000..a769561dc0a
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/Deque.java
@@ -0,0 +1,547 @@
+/*
+ * Written by Doug Lea and Josh Bloch with assistance from members of
+ * JCP JSR-166 Expert Group and released to the public domain, as explained
+ * at http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util;
+
+/**
+ * A linear collection that supports element insertion and removal at
+ * both ends. The name <i>deque</i> is short for "double ended queue"
+ * and is usually pronounced "deck". Most <tt>Deque</tt>
+ * implementations place no fixed limits on the number of elements
+ * they may contain, but this interface supports capacity-restricted
+ * deques as well as those with no fixed size limit.
+ *
+ * <p>This interface defines methods to access the elements at both
+ * ends of the deque. Methods are provided to insert, remove, and
+ * examine the element. Each of these methods exists in two forms:
+ * one throws an exception if the operation fails, the other returns a
+ * special value (either <tt>null</tt> or <tt>false</tt>, depending on
+ * the operation). The latter form of the insert operation is
+ * designed specifically for use with capacity-restricted
+ * <tt>Deque</tt> implementations; in most implementations, insert
+ * operations cannot fail.
+ *
+ * <p>The twelve methods described above are summarized in the
+ * following table:
+ *
+ * <p>
+ * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <tr>
+ * <td></td>
+ * <td ALIGN=CENTER COLSPAN = 2> <b>First Element (Head)</b></td>
+ * <td ALIGN=CENTER COLSPAN = 2> <b>Last Element (Tail)</b></td>
+ * </tr>
+ * <tr>
+ * <td></td>
+ * <td ALIGN=CENTER><em>Throws exception</em></td>
+ * <td ALIGN=CENTER><em>Special value</em></td>
+ * <td ALIGN=CENTER><em>Throws exception</em></td>
+ * <td ALIGN=CENTER><em>Special value</em></td>
+ * </tr>
+ * <tr>
+ * <td><b>Insert</b></td>
+ * <td>{@link #addFirst addFirst(e)}</td>
+ * <td>{@link #offerFirst offerFirst(e)}</td>
+ * <td>{@link #addLast addLast(e)}</td>
+ * <td>{@link #offerLast offerLast(e)}</td>
+ * </tr>
+ * <tr>
+ * <td><b>Remove</b></td>
+ * <td>{@link #removeFirst removeFirst()}</td>
+ * <td>{@link #pollFirst pollFirst()}</td>
+ * <td>{@link #removeLast removeLast()}</td>
+ * <td>{@link #pollLast pollLast()}</td>
+ * </tr>
+ * <tr>
+ * <td><b>Examine</b></td>
+ * <td>{@link #getFirst getFirst()}</td>
+ * <td>{@link #peekFirst peekFirst()}</td>
+ * <td>{@link #getLast getLast()}</td>
+ * <td>{@link #peekLast peekLast()}</td>
+ * </tr>
+ * </table>
+ *
+ * <p>This interface extends the {@link Queue} interface. When a deque is
+ * used as a queue, FIFO (First-In-First-Out) behavior results. Elements are
+ * added at the end of the deque and removed from the beginning. The methods
+ * inherited from the <tt>Queue</tt> interface are precisely equivalent to
+ * <tt>Deque</tt> methods as indicated in the following table:
+ *
+ * <p>
+ * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <tr>
+ * <td ALIGN=CENTER> <b><tt>Queue</tt> Method</b></td>
+ * <td ALIGN=CENTER> <b>Equivalent <tt>Deque</tt> Method</b></td>
+ * </tr>
+ * <tr>
+ * <td>{@link java.util.Queue#add add(e)}</td>
+ * <td>{@link #addLast addLast(e)}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link java.util.Queue#offer offer(e)}</td>
+ * <td>{@link #offerLast offerLast(e)}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link java.util.Queue#remove remove()}</td>
+ * <td>{@link #removeFirst removeFirst()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link java.util.Queue#poll poll()}</td>
+ * <td>{@link #pollFirst pollFirst()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link java.util.Queue#element element()}</td>
+ * <td>{@link #getFirst getFirst()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link java.util.Queue#peek peek()}</td>
+ * <td>{@link #peek peekFirst()}</td>
+ * </tr>
+ * </table>
+ *
+ * <p>Deques can also be used as LIFO (Last-In-First-Out) stacks. This
+ * interface should be used in preference to the legacy {@link Stack} class.
+ * When a deque is used as a stack, elements are pushed and popped from the
+ * beginning of the deque. Stack methods are precisely equivalent to
+ * <tt>Deque</tt> methods as indicated in the table below:
+ *
+ * <p>
+ * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <tr>
+ * <td ALIGN=CENTER> <b>Stack Method</b></td>
+ * <td ALIGN=CENTER> <b>Equivalent <tt>Deque</tt> Method</b></td>
+ * </tr>
+ * <tr>
+ * <td>{@link #push push(e)}</td>
+ * <td>{@link #addFirst addFirst(e)}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link #pop pop()}</td>
+ * <td>{@link #removeFirst removeFirst()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link #peek peek()}</td>
+ * <td>{@link #peekFirst peekFirst()}</td>
+ * </tr>
+ * </table>
+ *
+ * <p>Note that the {@link #peek peek} method works equally well when
+ * a deque is used as a queue or a stack; in either case, elements are
+ * drawn from the beginning of the deque.
+ *
+ * <p>This interface provides two methods to remove interior
+ * elements, {@link #removeFirstOccurrence removeFirstOccurrence} and
+ * {@link #removeLastOccurrence removeLastOccurrence}.
+ *
+ * <p>Unlike the {@link List} interface, this interface does not
+ * provide support for indexed access to elements.
+ *
+ * <p>While <tt>Deque</tt> implementations are not strictly required
+ * to prohibit the insertion of null elements, they are strongly
+ * encouraged to do so. Users of any <tt>Deque</tt> implementations
+ * that do allow null elements are strongly encouraged <i>not</i> to
+ * take advantage of the ability to insert nulls. This is so because
+ * <tt>null</tt> is used as a special return value by various methods
+ * to indicated that the deque is empty.
+ *
+ * <p><tt>Deque</tt> implementations generally do not define
+ * element-based versions of the <tt>equals</tt> and <tt>hashCode</tt>
+ * methods, but instead inherit the identity-based versions from class
+ * <tt>Object</tt>.
+ *
+ * <p>This interface is a member of the <a
+ * href="{@docRoot}/../technotes/guides/collections/index.html"> Java Collections
+ * Framework</a>.
+ *
+ * @author Doug Lea
+ * @author Josh Bloch
+ * @since 1.6
+ * @param <E> the type of elements held in this collection
+ */
+
+public interface Deque<E> extends Queue<E> {
+ /**
+ * Inserts the specified element at the front of this deque if it is
+ * possible to do so immediately without violating capacity restrictions.
+ * When using a capacity-restricted deque, it is generally preferable to
+ * use method {@link #offerFirst}.
+ *
+ * @param e the element to add
+ * @throws IllegalStateException if the element cannot be added at this
+ * time due to capacity restrictions
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ void addFirst(E e);
+
+ /**
+ * Inserts the specified element at the end of this deque if it is
+ * possible to do so immediately without violating capacity restrictions.
+ * When using a capacity-restricted deque, it is generally preferable to
+ * use method {@link #offerLast}.
+ *
+ * <p>This method is equivalent to {@link #add}.
+ *
+ * @param e the element to add
+ * @throws IllegalStateException if the element cannot be added at this
+ * time due to capacity restrictions
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ void addLast(E e);
+
+ /**
+ * Inserts the specified element at the front of this deque unless it would
+ * violate capacity restrictions. When using a capacity-restricted deque,
+ * this method is generally preferable to the {@link #addFirst} method,
+ * which can fail to insert an element only by throwing an exception.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> if the element was added to this deque, else
+ * <tt>false</tt>
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ boolean offerFirst(E e);
+
+ /**
+ * Inserts the specified element at the end of this deque unless it would
+ * violate capacity restrictions. When using a capacity-restricted deque,
+ * this method is generally preferable to the {@link #addLast} method,
+ * which can fail to insert an element only by throwing an exception.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> if the element was added to this deque, else
+ * <tt>false</tt>
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ boolean offerLast(E e);
+
+ /**
+ * Retrieves and removes the first element of this deque. This method
+ * differs from {@link #pollFirst pollFirst} only in that it throws an
+ * exception if this deque is empty.
+ *
+ * @return the head of this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E removeFirst();
+
+ /**
+ * Retrieves and removes the last element of this deque. This method
+ * differs from {@link #pollLast pollLast} only in that it throws an
+ * exception if this deque is empty.
+ *
+ * @return the tail of this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E removeLast();
+
+ /**
+ * Retrieves and removes the first element of this deque,
+ * or returns <tt>null</tt> if this deque is empty.
+ *
+ * @return the head of this deque, or <tt>null</tt> if this deque is empty
+ */
+ E pollFirst();
+
+ /**
+ * Retrieves and removes the last element of this deque,
+ * or returns <tt>null</tt> if this deque is empty.
+ *
+ * @return the tail of this deque, or <tt>null</tt> if this deque is empty
+ */
+ E pollLast();
+
+ /**
+ * Retrieves, but does not remove, the first element of this deque.
+ *
+ * This method differs from {@link #peekFirst peekFirst} only in that it
+ * throws an exception if this deque is empty.
+ *
+ * @return the head of this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E getFirst();
+
+ /**
+ * Retrieves, but does not remove, the last element of this deque.
+ * This method differs from {@link #peekLast peekLast} only in that it
+ * throws an exception if this deque is empty.
+ *
+ * @return the tail of this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E getLast();
+
+ /**
+ * Retrieves, but does not remove, the first element of this deque,
+ * or returns <tt>null</tt> if this deque is empty.
+ *
+ * @return the head of this deque, or <tt>null</tt> if this deque is empty
+ */
+ E peekFirst();
+
+ /**
+ * Retrieves, but does not remove, the last element of this deque,
+ * or returns <tt>null</tt> if this deque is empty.
+ *
+ * @return the tail of this deque, or <tt>null</tt> if this deque is empty
+ */
+ E peekLast();
+
+ /**
+ * Removes the first occurrence of the specified element from this deque.
+ * If the deque does not contain the element, it is unchanged.
+ * More formally, removes the first element <tt>e</tt> such that
+ * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>
+ * (if such an element exists).
+ * Returns <tt>true</tt> if this deque contained the specified element
+ * (or equivalently, if this deque changed as a result of the call).
+ *
+ * @param o element to be removed from this deque, if present
+ * @return <tt>true</tt> if an element was removed as a result of this call
+ * @throws ClassCastException if the class of the specified element
+ * is incompatible with this deque (optional)
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements (optional)
+ */
+ boolean removeFirstOccurrence(Object o);
+
+ /**
+ * Removes the last occurrence of the specified element from this deque.
+ * If the deque does not contain the element, it is unchanged.
+ * More formally, removes the last element <tt>e</tt> such that
+ * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>
+ * (if such an element exists).
+ * Returns <tt>true</tt> if this deque contained the specified element
+ * (or equivalently, if this deque changed as a result of the call).
+ *
+ * @param o element to be removed from this deque, if present
+ * @return <tt>true</tt> if an element was removed as a result of this call
+ * @throws ClassCastException if the class of the specified element
+ * is incompatible with this deque (optional)
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements (optional)
+ */
+ boolean removeLastOccurrence(Object o);
+
+ // *** Queue methods ***
+
+ /**
+ * Inserts the specified element into the queue represented by this deque
+ * (in other words, at the tail of this deque) if it is possible to do so
+ * immediately without violating capacity restrictions, returning
+ * <tt>true</tt> upon success and throwing an
+ * <tt>IllegalStateException</tt> if no space is currently available.
+ * When using a capacity-restricted deque, it is generally preferable to
+ * use {@link #offer(Object) offer}.
+ *
+ * <p>This method is equivalent to {@link #addLast}.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> (as specified by {@link Collection#add})
+ * @throws IllegalStateException if the element cannot be added at this
+ * time due to capacity restrictions
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ boolean add(E e);
+
+ /**
+ * Inserts the specified element into the queue represented by this deque
+ * (in other words, at the tail of this deque) if it is possible to do so
+ * immediately without violating capacity restrictions, returning
+ * <tt>true</tt> upon success and <tt>false</tt> if no space is currently
+ * available. When using a capacity-restricted deque, this method is
+ * generally preferable to the {@link #add} method, which can fail to
+ * insert an element only by throwing an exception.
+ *
+ * <p>This method is equivalent to {@link #offerLast}.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> if the element was added to this deque, else
+ * <tt>false</tt>
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ boolean offer(E e);
+
+ /**
+ * Retrieves and removes the head of the queue represented by this deque
+ * (in other words, the first element of this deque).
+ * This method differs from {@link #poll poll} only in that it throws an
+ * exception if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #removeFirst()}.
+ *
+ * @return the head of the queue represented by this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E remove();
+
+ /**
+ * Retrieves and removes the head of the queue represented by this deque
+ * (in other words, the first element of this deque), or returns
+ * <tt>null</tt> if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #pollFirst()}.
+ *
+ * @return the first element of this deque, or <tt>null</tt> if
+ * this deque is empty
+ */
+ E poll();
+
+ /**
+ * Retrieves, but does not remove, the head of the queue represented by
+ * this deque (in other words, the first element of this deque).
+ * This method differs from {@link #peek peek} only in that it throws an
+ * exception if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #getFirst()}.
+ *
+ * @return the head of the queue represented by this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E element();
+
+ /**
+ * Retrieves, but does not remove, the head of the queue represented by
+ * this deque (in other words, the first element of this deque), or
+ * returns <tt>null</tt> if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #peekFirst()}.
+ *
+ * @return the head of the queue represented by this deque, or
+ * <tt>null</tt> if this deque is empty
+ */
+ E peek();
+
+
+ // *** Stack methods ***
+
+ /**
+ * Pushes an element onto the stack represented by this deque (in other
+ * words, at the head of this deque) if it is possible to do so
+ * immediately without violating capacity restrictions, returning
+ * <tt>true</tt> upon success and throwing an
+ * <tt>IllegalStateException</tt> if no space is currently available.
+ *
+ * <p>This method is equivalent to {@link #addFirst}.
+ *
+ * @param e the element to push
+ * @throws IllegalStateException if the element cannot be added at this
+ * time due to capacity restrictions
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ void push(E e);
+
+ /**
+ * Pops an element from the stack represented by this deque. In other
+ * words, removes and returns the first element of this deque.
+ *
+ * <p>This method is equivalent to {@link #removeFirst()}.
+ *
+ * @return the element at the front of this deque (which is the top
+ * of the stack represented by this deque)
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E pop();
+
+
+ // *** Collection methods ***
+
+ /**
+ * Removes the first occurrence of the specified element from this deque.
+ * If the deque does not contain the element, it is unchanged.
+ * More formally, removes the first element <tt>e</tt> such that
+ * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>
+ * (if such an element exists).
+ * Returns <tt>true</tt> if this deque contained the specified element
+ * (or equivalently, if this deque changed as a result of the call).
+ *
+ * <p>This method is equivalent to {@link #removeFirstOccurrence}.
+ *
+ * @param o element to be removed from this deque, if present
+ * @return <tt>true</tt> if an element was removed as a result of this call
+ * @throws ClassCastException if the class of the specified element
+ * is incompatible with this deque (optional)
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements (optional)
+ */
+ boolean remove(Object o);
+
+ /**
+ * Returns <tt>true</tt> if this deque contains the specified element.
+ * More formally, returns <tt>true</tt> if and only if this deque contains
+ * at least one element <tt>e</tt> such that
+ * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
+ *
+ * @param o element whose presence in this deque is to be tested
+ * @return <tt>true</tt> if this deque contains the specified element
+ * @throws ClassCastException if the type of the specified element
+ * is incompatible with this deque (optional)
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements (optional)
+ */
+ boolean contains(Object o);
+
+ /**
+ * Returns the number of elements in this deque.
+ *
+ * @return the number of elements in this deque
+ */
+ public int size();
+
+ /**
+ * Returns an iterator over the elements in this deque in proper sequence.
+ * The elements will be returned in order from first (head) to last (tail).
+ *
+ * @return an iterator over the elements in this deque in proper sequence
+ */
+ Iterator<E> iterator();
+
+ /**
+ * Returns an iterator over the elements in this deque in reverse
+ * sequential order. The elements will be returned in order from
+ * last (tail) to first (head).
+ *
+ * @return an iterator over the elements in this deque in reverse
+ * sequence
+ */
+ Iterator<E> descendingIterator();
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/NavigableMap.java b/libjava/classpath/external/jsr166/java/util/NavigableMap.java
new file mode 100644
index 00000000000..a55f84bddd8
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/NavigableMap.java
@@ -0,0 +1,395 @@
+/*
+ * Written by Doug Lea and Josh Bloch with assistance from members of JCP
+ * JSR-166 Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util;
+
+/**
+ * A {@link SortedMap} extended with navigation methods returning the
+ * closest matches for given search targets. Methods
+ * {@code lowerEntry}, {@code floorEntry}, {@code ceilingEntry},
+ * and {@code higherEntry} return {@code Map.Entry} objects
+ * associated with keys respectively less than, less than or equal,
+ * greater than or equal, and greater than a given key, returning
+ * {@code null} if there is no such key. Similarly, methods
+ * {@code lowerKey}, {@code floorKey}, {@code ceilingKey}, and
+ * {@code higherKey} return only the associated keys. All of these
+ * methods are designed for locating, not traversing entries.
+ *
+ * <p>A {@code NavigableMap} may be accessed and traversed in either
+ * ascending or descending key order. The {@code descendingMap}
+ * method returns a view of the map with the senses of all relational
+ * and directional methods inverted. The performance of ascending
+ * operations and views is likely to be faster than that of descending
+ * ones. Methods {@code subMap}, {@code headMap},
+ * and {@code tailMap} differ from the like-named {@code
+ * SortedMap} methods in accepting additional arguments describing
+ * whether lower and upper bounds are inclusive versus exclusive.
+ * Submaps of any {@code NavigableMap} must implement the {@code
+ * NavigableMap} interface.
+ *
+ * <p>This interface additionally defines methods {@code firstEntry},
+ * {@code pollFirstEntry}, {@code lastEntry}, and
+ * {@code pollLastEntry} that return and/or remove the least and
+ * greatest mappings, if any exist, else returning {@code null}.
+ *
+ * <p>Implementations of entry-returning methods are expected to
+ * return {@code Map.Entry} pairs representing snapshots of mappings
+ * at the time they were produced, and thus generally do <em>not</em>
+ * support the optional {@code Entry.setValue} method. Note however
+ * that it is possible to change mappings in the associated map using
+ * method {@code put}.
+ *
+ * <p>Methods
+ * {@link #subMap(Object, Object) subMap(K, K)},
+ * {@link #headMap(Object) headMap(K)}, and
+ * {@link #tailMap(Object) tailMap(K)}
+ * are specified to return {@code SortedMap} to allow existing
+ * implementations of {@code SortedMap} to be compatibly retrofitted to
+ * implement {@code NavigableMap}, but extensions and implementations
+ * of this interface are encouraged to override these methods to return
+ * {@code NavigableMap}. Similarly,
+ * {@link #keySet()} can be overriden to return {@code NavigableSet}.
+ *
+ * <p>This interface is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @author Doug Lea
+ * @author Josh Bloch
+ * @param <K> the type of keys maintained by this map
+ * @param <V> the type of mapped values
+ * @since 1.6
+ */
+public interface NavigableMap<K,V> extends SortedMap<K,V> {
+ /**
+ * Returns a key-value mapping associated with the greatest key
+ * strictly less than the given key, or {@code null} if there is
+ * no such key.
+ *
+ * @param key the key
+ * @return an entry with the greatest key less than {@code key},
+ * or {@code null} if there is no such key
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key is null
+ * and this map does not permit null keys
+ */
+ Map.Entry<K,V> lowerEntry(K key);
+
+ /**
+ * Returns the greatest key strictly less than the given key, or
+ * {@code null} if there is no such key.
+ *
+ * @param key the key
+ * @return the greatest key less than {@code key},
+ * or {@code null} if there is no such key
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key is null
+ * and this map does not permit null keys
+ */
+ K lowerKey(K key);
+
+ /**
+ * Returns a key-value mapping associated with the greatest key
+ * less than or equal to the given key, or {@code null} if there
+ * is no such key.
+ *
+ * @param key the key
+ * @return an entry with the greatest key less than or equal to
+ * {@code key}, or {@code null} if there is no such key
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key is null
+ * and this map does not permit null keys
+ */
+ Map.Entry<K,V> floorEntry(K key);
+
+ /**
+ * Returns the greatest key less than or equal to the given key,
+ * or {@code null} if there is no such key.
+ *
+ * @param key the key
+ * @return the greatest key less than or equal to {@code key},
+ * or {@code null} if there is no such key
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key is null
+ * and this map does not permit null keys
+ */
+ K floorKey(K key);
+
+ /**
+ * Returns a key-value mapping associated with the least key
+ * greater than or equal to the given key, or {@code null} if
+ * there is no such key.
+ *
+ * @param key the key
+ * @return an entry with the least key greater than or equal to
+ * {@code key}, or {@code null} if there is no such key
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key is null
+ * and this map does not permit null keys
+ */
+ Map.Entry<K,V> ceilingEntry(K key);
+
+ /**
+ * Returns the least key greater than or equal to the given key,
+ * or {@code null} if there is no such key.
+ *
+ * @param key the key
+ * @return the least key greater than or equal to {@code key},
+ * or {@code null} if there is no such key
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key is null
+ * and this map does not permit null keys
+ */
+ K ceilingKey(K key);
+
+ /**
+ * Returns a key-value mapping associated with the least key
+ * strictly greater than the given key, or {@code null} if there
+ * is no such key.
+ *
+ * @param key the key
+ * @return an entry with the least key greater than {@code key},
+ * or {@code null} if there is no such key
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key is null
+ * and this map does not permit null keys
+ */
+ Map.Entry<K,V> higherEntry(K key);
+
+ /**
+ * Returns the least key strictly greater than the given key, or
+ * {@code null} if there is no such key.
+ *
+ * @param key the key
+ * @return the least key greater than {@code key},
+ * or {@code null} if there is no such key
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key is null
+ * and this map does not permit null keys
+ */
+ K higherKey(K key);
+
+ /**
+ * Returns a key-value mapping associated with the least
+ * key in this map, or {@code null} if the map is empty.
+ *
+ * @return an entry with the least key,
+ * or {@code null} if this map is empty
+ */
+ Map.Entry<K,V> firstEntry();
+
+ /**
+ * Returns a key-value mapping associated with the greatest
+ * key in this map, or {@code null} if the map is empty.
+ *
+ * @return an entry with the greatest key,
+ * or {@code null} if this map is empty
+ */
+ Map.Entry<K,V> lastEntry();
+
+ /**
+ * Removes and returns a key-value mapping associated with
+ * the least key in this map, or {@code null} if the map is empty.
+ *
+ * @return the removed first entry of this map,
+ * or {@code null} if this map is empty
+ */
+ Map.Entry<K,V> pollFirstEntry();
+
+ /**
+ * Removes and returns a key-value mapping associated with
+ * the greatest key in this map, or {@code null} if the map is empty.
+ *
+ * @return the removed last entry of this map,
+ * or {@code null} if this map is empty
+ */
+ Map.Entry<K,V> pollLastEntry();
+
+ /**
+ * Returns a reverse order view of the mappings contained in this map.
+ * The descending map is backed by this map, so changes to the map are
+ * reflected in the descending map, and vice-versa. If either map is
+ * modified while an iteration over a collection view of either map
+ * is in progress (except through the iterator's own {@code remove}
+ * operation), the results of the iteration are undefined.
+ *
+ * <p>The returned map has an ordering equivalent to
+ * <tt>{@link Collections#reverseOrder(Comparator) Collections.reverseOrder}(comparator())</tt>.
+ * The expression {@code m.descendingMap().descendingMap()} returns a
+ * view of {@code m} essentially equivalent to {@code m}.
+ *
+ * @return a reverse order view of this map
+ */
+ NavigableMap<K,V> descendingMap();
+
+ /**
+ * Returns a {@link NavigableSet} view of the keys contained in this map.
+ * The set's iterator returns the keys in ascending order.
+ * The set is backed by the map, so changes to the map are reflected in
+ * the set, and vice-versa. If the map is modified while an iteration
+ * over the set is in progress (except through the iterator's own {@code
+ * remove} operation), the results of the iteration are undefined. The
+ * set supports element removal, which removes the corresponding mapping
+ * from the map, via the {@code Iterator.remove}, {@code Set.remove},
+ * {@code removeAll}, {@code retainAll}, and {@code clear} operations.
+ * It does not support the {@code add} or {@code addAll} operations.
+ *
+ * @return a navigable set view of the keys in this map
+ */
+ NavigableSet<K> navigableKeySet();
+
+ /**
+ * Returns a reverse order {@link NavigableSet} view of the keys contained in this map.
+ * The set's iterator returns the keys in descending order.
+ * The set is backed by the map, so changes to the map are reflected in
+ * the set, and vice-versa. If the map is modified while an iteration
+ * over the set is in progress (except through the iterator's own {@code
+ * remove} operation), the results of the iteration are undefined. The
+ * set supports element removal, which removes the corresponding mapping
+ * from the map, via the {@code Iterator.remove}, {@code Set.remove},
+ * {@code removeAll}, {@code retainAll}, and {@code clear} operations.
+ * It does not support the {@code add} or {@code addAll} operations.
+ *
+ * @return a reverse order navigable set view of the keys in this map
+ */
+ NavigableSet<K> descendingKeySet();
+
+ /**
+ * Returns a view of the portion of this map whose keys range from
+ * {@code fromKey} to {@code toKey}. If {@code fromKey} and
+ * {@code toKey} are equal, the returned map is empty unless
+ * {@code fromExclusive} and {@code toExclusive} are both true. The
+ * returned map is backed by this map, so changes in the returned map are
+ * reflected in this map, and vice-versa. The returned map supports all
+ * optional map operations that this map supports.
+ *
+ * <p>The returned map will throw an {@code IllegalArgumentException}
+ * on an attempt to insert a key outside of its range, or to construct a
+ * submap either of whose endpoints lie outside its range.
+ *
+ * @param fromKey low endpoint of the keys in the returned map
+ * @param fromInclusive {@code true} if the low endpoint
+ * is to be included in the returned view
+ * @param toKey high endpoint of the keys in the returned map
+ * @param toInclusive {@code true} if the high endpoint
+ * is to be included in the returned view
+ * @return a view of the portion of this map whose keys range from
+ * {@code fromKey} to {@code toKey}
+ * @throws ClassCastException if {@code fromKey} and {@code toKey}
+ * cannot be compared to one another using this map's comparator
+ * (or, if the map has no comparator, using natural ordering).
+ * Implementations may, but are not required to, throw this
+ * exception if {@code fromKey} or {@code toKey}
+ * cannot be compared to keys currently in the map.
+ * @throws NullPointerException if {@code fromKey} or {@code toKey}
+ * is null and this map does not permit null keys
+ * @throws IllegalArgumentException if {@code fromKey} is greater than
+ * {@code toKey}; or if this map itself has a restricted
+ * range, and {@code fromKey} or {@code toKey} lies
+ * outside the bounds of the range
+ */
+ NavigableMap<K,V> subMap(K fromKey, boolean fromInclusive,
+ K toKey, boolean toInclusive);
+
+ /**
+ * Returns a view of the portion of this map whose keys are less than (or
+ * equal to, if {@code inclusive} is true) {@code toKey}. The returned
+ * map is backed by this map, so changes in the returned map are reflected
+ * in this map, and vice-versa. The returned map supports all optional
+ * map operations that this map supports.
+ *
+ * <p>The returned map will throw an {@code IllegalArgumentException}
+ * on an attempt to insert a key outside its range.
+ *
+ * @param toKey high endpoint of the keys in the returned map
+ * @param inclusive {@code true} if the high endpoint
+ * is to be included in the returned view
+ * @return a view of the portion of this map whose keys are less than
+ * (or equal to, if {@code inclusive} is true) {@code toKey}
+ * @throws ClassCastException if {@code toKey} is not compatible
+ * with this map's comparator (or, if the map has no comparator,
+ * if {@code toKey} does not implement {@link Comparable}).
+ * Implementations may, but are not required to, throw this
+ * exception if {@code toKey} cannot be compared to keys
+ * currently in the map.
+ * @throws NullPointerException if {@code toKey} is null
+ * and this map does not permit null keys
+ * @throws IllegalArgumentException if this map itself has a
+ * restricted range, and {@code toKey} lies outside the
+ * bounds of the range
+ */
+ NavigableMap<K,V> headMap(K toKey, boolean inclusive);
+
+ /**
+ * Returns a view of the portion of this map whose keys are greater than (or
+ * equal to, if {@code inclusive} is true) {@code fromKey}. The returned
+ * map is backed by this map, so changes in the returned map are reflected
+ * in this map, and vice-versa. The returned map supports all optional
+ * map operations that this map supports.
+ *
+ * <p>The returned map will throw an {@code IllegalArgumentException}
+ * on an attempt to insert a key outside its range.
+ *
+ * @param fromKey low endpoint of the keys in the returned map
+ * @param inclusive {@code true} if the low endpoint
+ * is to be included in the returned view
+ * @return a view of the portion of this map whose keys are greater than
+ * (or equal to, if {@code inclusive} is true) {@code fromKey}
+ * @throws ClassCastException if {@code fromKey} is not compatible
+ * with this map's comparator (or, if the map has no comparator,
+ * if {@code fromKey} does not implement {@link Comparable}).
+ * Implementations may, but are not required to, throw this
+ * exception if {@code fromKey} cannot be compared to keys
+ * currently in the map.
+ * @throws NullPointerException if {@code fromKey} is null
+ * and this map does not permit null keys
+ * @throws IllegalArgumentException if this map itself has a
+ * restricted range, and {@code fromKey} lies outside the
+ * bounds of the range
+ */
+ NavigableMap<K,V> tailMap(K fromKey, boolean inclusive);
+
+ /**
+ * {@inheritDoc}
+ *
+ * <p>Equivalent to {@code subMap(fromKey, true, toKey, false)}.
+ *
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ SortedMap<K,V> subMap(K fromKey, K toKey);
+
+ /**
+ * {@inheritDoc}
+ *
+ * <p>Equivalent to {@code headMap(toKey, false)}.
+ *
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ SortedMap<K,V> headMap(K toKey);
+
+ /**
+ * {@inheritDoc}
+ *
+ * <p>Equivalent to {@code tailMap(fromKey, true)}.
+ *
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ SortedMap<K,V> tailMap(K fromKey);
+}
diff --git a/libjava/classpath/external/jsr166/java/util/NavigableSet.java b/libjava/classpath/external/jsr166/java/util/NavigableSet.java
new file mode 100644
index 00000000000..e14fe347d71
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/NavigableSet.java
@@ -0,0 +1,290 @@
+/*
+ * Written by Doug Lea and Josh Bloch with assistance from members of JCP
+ * JSR-166 Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util;
+
+/**
+ * A {@link SortedSet} extended with navigation methods reporting
+ * closest matches for given search targets. Methods {@code lower},
+ * {@code floor}, {@code ceiling}, and {@code higher} return elements
+ * respectively less than, less than or equal, greater than or equal,
+ * and greater than a given element, returning {@code null} if there
+ * is no such element. A {@code NavigableSet} may be accessed and
+ * traversed in either ascending or descending order. The {@code
+ * descendingSet} method returns a view of the set with the senses of
+ * all relational and directional methods inverted. The performance of
+ * ascending operations and views is likely to be faster than that of
+ * descending ones. This interface additionally defines methods
+ * {@code pollFirst} and {@code pollLast} that return and remove the
+ * lowest and highest element, if one exists, else returning {@code
+ * null}. Methods {@code subSet}, {@code headSet},
+ * and {@code tailSet} differ from the like-named {@code
+ * SortedSet} methods in accepting additional arguments describing
+ * whether lower and upper bounds are inclusive versus exclusive.
+ * Subsets of any {@code NavigableSet} must implement the {@code
+ * NavigableSet} interface.
+ *
+ * <p> The return values of navigation methods may be ambiguous in
+ * implementations that permit {@code null} elements. However, even
+ * in this case the result can be disambiguated by checking
+ * {@code contains(null)}. To avoid such issues, implementations of
+ * this interface are encouraged to <em>not</em> permit insertion of
+ * {@code null} elements. (Note that sorted sets of {@link
+ * Comparable} elements intrinsically do not permit {@code null}.)
+ *
+ * <p>Methods
+ * {@link #subSet(Object, Object) subSet(E, E)},
+ * {@link #headSet(Object) headSet(E)}, and
+ * {@link #tailSet(Object) tailSet(E)}
+ * are specified to return {@code SortedSet} to allow existing
+ * implementations of {@code SortedSet} to be compatibly retrofitted to
+ * implement {@code NavigableSet}, but extensions and implementations
+ * of this interface are encouraged to override these methods to return
+ * {@code NavigableSet}.
+ *
+ * <p>This interface is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @author Doug Lea
+ * @author Josh Bloch
+ * @param <E> the type of elements maintained by this set
+ * @since 1.6
+ */
+public interface NavigableSet<E> extends SortedSet<E> {
+ /**
+ * Returns the greatest element in this set strictly less than the
+ * given element, or {@code null} if there is no such element.
+ *
+ * @param e the value to match
+ * @return the greatest element less than {@code e},
+ * or {@code null} if there is no such element
+ * @throws ClassCastException if the specified element cannot be
+ * compared with the elements currently in the set
+ * @throws NullPointerException if the specified element is null
+ * and this set does not permit null elements
+ */
+ E lower(E e);
+
+ /**
+ * Returns the greatest element in this set less than or equal to
+ * the given element, or {@code null} if there is no such element.
+ *
+ * @param e the value to match
+ * @return the greatest element less than or equal to {@code e},
+ * or {@code null} if there is no such element
+ * @throws ClassCastException if the specified element cannot be
+ * compared with the elements currently in the set
+ * @throws NullPointerException if the specified element is null
+ * and this set does not permit null elements
+ */
+ E floor(E e);
+
+ /**
+ * Returns the least element in this set greater than or equal to
+ * the given element, or {@code null} if there is no such element.
+ *
+ * @param e the value to match
+ * @return the least element greater than or equal to {@code e},
+ * or {@code null} if there is no such element
+ * @throws ClassCastException if the specified element cannot be
+ * compared with the elements currently in the set
+ * @throws NullPointerException if the specified element is null
+ * and this set does not permit null elements
+ */
+ E ceiling(E e);
+
+ /**
+ * Returns the least element in this set strictly greater than the
+ * given element, or {@code null} if there is no such element.
+ *
+ * @param e the value to match
+ * @return the least element greater than {@code e},
+ * or {@code null} if there is no such element
+ * @throws ClassCastException if the specified element cannot be
+ * compared with the elements currently in the set
+ * @throws NullPointerException if the specified element is null
+ * and this set does not permit null elements
+ */
+ E higher(E e);
+
+ /**
+ * Retrieves and removes the first (lowest) element,
+ * or returns {@code null} if this set is empty.
+ *
+ * @return the first element, or {@code null} if this set is empty
+ */
+ E pollFirst();
+
+ /**
+ * Retrieves and removes the last (highest) element,
+ * or returns {@code null} if this set is empty.
+ *
+ * @return the last element, or {@code null} if this set is empty
+ */
+ E pollLast();
+
+ /**
+ * Returns an iterator over the elements in this set, in ascending order.
+ *
+ * @return an iterator over the elements in this set, in ascending order
+ */
+ Iterator<E> iterator();
+
+ /**
+ * Returns a reverse order view of the elements contained in this set.
+ * The descending set is backed by this set, so changes to the set are
+ * reflected in the descending set, and vice-versa. If either set is
+ * modified while an iteration over either set is in progress (except
+ * through the iterator's own {@code remove} operation), the results of
+ * the iteration are undefined.
+ *
+ * <p>The returned set has an ordering equivalent to
+ * <tt>{@link Collections#reverseOrder(Comparator) Collections.reverseOrder}(comparator())</tt>.
+ * The expression {@code s.descendingSet().descendingSet()} returns a
+ * view of {@code s} essentially equivalent to {@code s}.
+ *
+ * @return a reverse order view of this set
+ */
+ NavigableSet<E> descendingSet();
+
+ /**
+ * Returns an iterator over the elements in this set, in descending order.
+ * Equivalent in effect to {@code descendingSet().iterator()}.
+ *
+ * @return an iterator over the elements in this set, in descending order
+ */
+ Iterator<E> descendingIterator();
+
+ /**
+ * Returns a view of the portion of this set whose elements range from
+ * {@code fromElement} to {@code toElement}. If {@code fromElement} and
+ * {@code toElement} are equal, the returned set is empty unless {@code
+ * fromExclusive} and {@code toExclusive} are both true. The returned set
+ * is backed by this set, so changes in the returned set are reflected in
+ * this set, and vice-versa. The returned set supports all optional set
+ * operations that this set supports.
+ *
+ * <p>The returned set will throw an {@code IllegalArgumentException}
+ * on an attempt to insert an element outside its range.
+ *
+ * @param fromElement low endpoint of the returned set
+ * @param fromInclusive {@code true} if the low endpoint
+ * is to be included in the returned view
+ * @param toElement high endpoint of the returned set
+ * @param toInclusive {@code true} if the high endpoint
+ * is to be included in the returned view
+ * @return a view of the portion of this set whose elements range from
+ * {@code fromElement}, inclusive, to {@code toElement}, exclusive
+ * @throws ClassCastException if {@code fromElement} and
+ * {@code toElement} cannot be compared to one another using this
+ * set's comparator (or, if the set has no comparator, using
+ * natural ordering). Implementations may, but are not required
+ * to, throw this exception if {@code fromElement} or
+ * {@code toElement} cannot be compared to elements currently in
+ * the set.
+ * @throws NullPointerException if {@code fromElement} or
+ * {@code toElement} is null and this set does
+ * not permit null elements
+ * @throws IllegalArgumentException if {@code fromElement} is
+ * greater than {@code toElement}; or if this set itself
+ * has a restricted range, and {@code fromElement} or
+ * {@code toElement} lies outside the bounds of the range.
+ */
+ NavigableSet<E> subSet(E fromElement, boolean fromInclusive,
+ E toElement, boolean toInclusive);
+
+ /**
+ * Returns a view of the portion of this set whose elements are less than
+ * (or equal to, if {@code inclusive} is true) {@code toElement}. The
+ * returned set is backed by this set, so changes in the returned set are
+ * reflected in this set, and vice-versa. The returned set supports all
+ * optional set operations that this set supports.
+ *
+ * <p>The returned set will throw an {@code IllegalArgumentException}
+ * on an attempt to insert an element outside its range.
+ *
+ * @param toElement high endpoint of the returned set
+ * @param inclusive {@code true} if the high endpoint
+ * is to be included in the returned view
+ * @return a view of the portion of this set whose elements are less than
+ * (or equal to, if {@code inclusive} is true) {@code toElement}
+ * @throws ClassCastException if {@code toElement} is not compatible
+ * with this set's comparator (or, if the set has no comparator,
+ * if {@code toElement} does not implement {@link Comparable}).
+ * Implementations may, but are not required to, throw this
+ * exception if {@code toElement} cannot be compared to elements
+ * currently in the set.
+ * @throws NullPointerException if {@code toElement} is null and
+ * this set does not permit null elements
+ * @throws IllegalArgumentException if this set itself has a
+ * restricted range, and {@code toElement} lies outside the
+ * bounds of the range
+ */
+ NavigableSet<E> headSet(E toElement, boolean inclusive);
+
+ /**
+ * Returns a view of the portion of this set whose elements are greater
+ * than (or equal to, if {@code inclusive} is true) {@code fromElement}.
+ * The returned set is backed by this set, so changes in the returned set
+ * are reflected in this set, and vice-versa. The returned set supports
+ * all optional set operations that this set supports.
+ *
+ * <p>The returned set will throw an {@code IllegalArgumentException}
+ * on an attempt to insert an element outside its range.
+ *
+ * @param fromElement low endpoint of the returned set
+ * @param inclusive {@code true} if the low endpoint
+ * is to be included in the returned view
+ * @return a view of the portion of this set whose elements are greater
+ * than or equal to {@code fromElement}
+ * @throws ClassCastException if {@code fromElement} is not compatible
+ * with this set's comparator (or, if the set has no comparator,
+ * if {@code fromElement} does not implement {@link Comparable}).
+ * Implementations may, but are not required to, throw this
+ * exception if {@code fromElement} cannot be compared to elements
+ * currently in the set.
+ * @throws NullPointerException if {@code fromElement} is null
+ * and this set does not permit null elements
+ * @throws IllegalArgumentException if this set itself has a
+ * restricted range, and {@code fromElement} lies outside the
+ * bounds of the range
+ */
+ NavigableSet<E> tailSet(E fromElement, boolean inclusive);
+
+ /**
+ * {@inheritDoc}
+ *
+ * <p>Equivalent to {@code subSet(fromElement, true, toElement, false)}.
+ *
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ SortedSet<E> subSet(E fromElement, E toElement);
+
+ /**
+ * {@inheritDoc}
+ *
+ * <p>Equivalent to {@code headSet(toElement, false)}.
+ *
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+na */
+ SortedSet<E> headSet(E toElement);
+
+ /**
+ * {@inheritDoc}
+ *
+ * <p>Equivalent to {@code tailSet(fromElement, true)}.
+ *
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ SortedSet<E> tailSet(E fromElement);
+}
diff --git a/libjava/classpath/external/jsr166/java/util/Queue.java b/libjava/classpath/external/jsr166/java/util/Queue.java
new file mode 100644
index 00000000000..5711545b07b
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/Queue.java
@@ -0,0 +1,189 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util;
+
+/**
+ * A collection designed for holding elements prior to processing.
+ * Besides basic {@link java.util.Collection Collection} operations,
+ * queues provide additional insertion, extraction, and inspection
+ * operations. Each of these methods exists in two forms: one throws
+ * an exception if the operation fails, the other returns a special
+ * value (either <tt>null</tt> or <tt>false</tt>, depending on the
+ * operation). The latter form of the insert operation is designed
+ * specifically for use with capacity-restricted <tt>Queue</tt>
+ * implementations; in most implementations, insert operations cannot
+ * fail.
+ *
+ * <p>
+ * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <tr>
+ * <td></td>
+ * <td ALIGN=CENTER><em>Throws exception</em></td>
+ * <td ALIGN=CENTER><em>Returns special value</em></td>
+ * </tr>
+ * <tr>
+ * <td><b>Insert</b></td>
+ * <td>{@link #add add(e)}</td>
+ * <td>{@link #offer offer(e)}</td>
+ * </tr>
+ * <tr>
+ * <td><b>Remove</b></td>
+ * <td>{@link #remove remove()}</td>
+ * <td>{@link #poll poll()}</td>
+ * </tr>
+ * <tr>
+ * <td><b>Examine</b></td>
+ * <td>{@link #element element()}</td>
+ * <td>{@link #peek peek()}</td>
+ * </tr>
+ * </table>
+ *
+ * <p>Queues typically, but do not necessarily, order elements in a
+ * FIFO (first-in-first-out) manner. Among the exceptions are
+ * priority queues, which order elements according to a supplied
+ * comparator, or the elements' natural ordering, and LIFO queues (or
+ * stacks) which order the elements LIFO (last-in-first-out).
+ * Whatever the ordering used, the <em>head</em> of the queue is that
+ * element which would be removed by a call to {@link #remove() } or
+ * {@link #poll()}. In a FIFO queue, all new elements are inserted at
+ * the <em> tail</em> of the queue. Other kinds of queues may use
+ * different placement rules. Every <tt>Queue</tt> implementation
+ * must specify its ordering properties.
+ *
+ * <p>The {@link #offer offer} method inserts an element if possible,
+ * otherwise returning <tt>false</tt>. This differs from the {@link
+ * java.util.Collection#add Collection.add} method, which can fail to
+ * add an element only by throwing an unchecked exception. The
+ * <tt>offer</tt> method is designed for use when failure is a normal,
+ * rather than exceptional occurrence, for example, in fixed-capacity
+ * (or &quot;bounded&quot;) queues.
+ *
+ * <p>The {@link #remove()} and {@link #poll()} methods remove and
+ * return the head of the queue.
+ * Exactly which element is removed from the queue is a
+ * function of the queue's ordering policy, which differs from
+ * implementation to implementation. The <tt>remove()</tt> and
+ * <tt>poll()</tt> methods differ only in their behavior when the
+ * queue is empty: the <tt>remove()</tt> method throws an exception,
+ * while the <tt>poll()</tt> method returns <tt>null</tt>.
+ *
+ * <p>The {@link #element()} and {@link #peek()} methods return, but do
+ * not remove, the head of the queue.
+ *
+ * <p>The <tt>Queue</tt> interface does not define the <i>blocking queue
+ * methods</i>, which are common in concurrent programming. These methods,
+ * which wait for elements to appear or for space to become available, are
+ * defined in the {@link java.util.concurrent.BlockingQueue} interface, which
+ * extends this interface.
+ *
+ * <p><tt>Queue</tt> implementations generally do not allow insertion
+ * of <tt>null</tt> elements, although some implementations, such as
+ * {@link LinkedList}, do not prohibit insertion of <tt>null</tt>.
+ * Even in the implementations that permit it, <tt>null</tt> should
+ * not be inserted into a <tt>Queue</tt>, as <tt>null</tt> is also
+ * used as a special return value by the <tt>poll</tt> method to
+ * indicate that the queue contains no elements.
+ *
+ * <p><tt>Queue</tt> implementations generally do not define
+ * element-based versions of methods <tt>equals</tt> and
+ * <tt>hashCode</tt> but instead inherit the identity based versions
+ * from class <tt>Object</tt>, because element-based equality is not
+ * always well-defined for queues with the same elements but different
+ * ordering properties.
+ *
+ *
+ * <p>This interface is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @see java.util.Collection
+ * @see LinkedList
+ * @see PriorityQueue
+ * @see java.util.concurrent.LinkedBlockingQueue
+ * @see java.util.concurrent.BlockingQueue
+ * @see java.util.concurrent.ArrayBlockingQueue
+ * @see java.util.concurrent.LinkedBlockingQueue
+ * @see java.util.concurrent.PriorityBlockingQueue
+ * @since 1.5
+ * @author Doug Lea
+ * @param <E> the type of elements held in this collection
+ */
+public interface Queue<E> extends Collection<E> {
+ /**
+ * Inserts the specified element into this queue if it is possible to do so
+ * immediately without violating capacity restrictions, returning
+ * <tt>true</tt> upon success and throwing an <tt>IllegalStateException</tt>
+ * if no space is currently available.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> (as specified by {@link Collection#add})
+ * @throws IllegalStateException if the element cannot be added at this
+ * time due to capacity restrictions
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this queue
+ * @throws NullPointerException if the specified element is null and
+ * this queue does not permit null elements
+ * @throws IllegalArgumentException if some property of this element
+ * prevents it from being added to this queue
+ */
+ boolean add(E e);
+
+ /**
+ * Inserts the specified element into this queue if it is possible to do
+ * so immediately without violating capacity restrictions.
+ * When using a capacity-restricted queue, this method is generally
+ * preferable to {@link #add}, which can fail to insert an element only
+ * by throwing an exception.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> if the element was added to this queue, else
+ * <tt>false</tt>
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this queue
+ * @throws NullPointerException if the specified element is null and
+ * this queue does not permit null elements
+ * @throws IllegalArgumentException if some property of this element
+ * prevents it from being added to this queue
+ */
+ boolean offer(E e);
+
+ /**
+ * Retrieves and removes the head of this queue. This method differs
+ * from {@link #poll poll} only in that it throws an exception if this
+ * queue is empty.
+ *
+ * @return the head of this queue
+ * @throws NoSuchElementException if this queue is empty
+ */
+ E remove();
+
+ /**
+ * Retrieves and removes the head of this queue,
+ * or returns <tt>null</tt> if this queue is empty.
+ *
+ * @return the head of this queue, or <tt>null</tt> if this queue is empty
+ */
+ E poll();
+
+ /**
+ * Retrieves, but does not remove, the head of this queue. This method
+ * differs from {@link #peek peek} only in that it throws an exception
+ * if this queue is empty.
+ *
+ * @return the head of this queue
+ * @throws NoSuchElementException if this queue is empty
+ */
+ E element();
+
+ /**
+ * Retrieves, but does not remove, the head of this queue,
+ * or returns <tt>null</tt> if this queue is empty.
+ *
+ * @return the head of this queue, or <tt>null</tt> if this queue is empty
+ */
+ E peek();
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/AbstractExecutorService.java b/libjava/classpath/external/jsr166/java/util/concurrent/AbstractExecutorService.java
new file mode 100644
index 00000000000..ac15c501083
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/AbstractExecutorService.java
@@ -0,0 +1,270 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.*;
+
+/**
+ * Provides default implementations of {@link ExecutorService}
+ * execution methods. This class implements the <tt>submit</tt>,
+ * <tt>invokeAny</tt> and <tt>invokeAll</tt> methods using a
+ * {@link RunnableFuture} returned by <tt>newTaskFor</tt>, which defaults
+ * to the {@link FutureTask} class provided in this package. For example,
+ * the implementation of <tt>submit(Runnable)</tt> creates an
+ * associated <tt>RunnableFuture</tt> that is executed and
+ * returned. Subclasses may override the <tt>newTaskFor</tt> methods
+ * to return <tt>RunnableFuture</tt> implementations other than
+ * <tt>FutureTask</tt>.
+ *
+ * <p> <b>Extension example</b>. Here is a sketch of a class
+ * that customizes {@link ThreadPoolExecutor} to use
+ * a <tt>CustomTask</tt> class instead of the default <tt>FutureTask</tt>:
+ * <pre>
+ * public class CustomThreadPoolExecutor extends ThreadPoolExecutor {
+ *
+ * static class CustomTask&lt;V&gt; implements RunnableFuture&lt;V&gt; {...}
+ *
+ * protected &lt;V&gt; RunnableFuture&lt;V&gt; newTaskFor(Callable&lt;V&gt; c) {
+ * return new CustomTask&lt;V&gt;(c);
+ * }
+ * protected &lt;V&gt; RunnableFuture&lt;V&gt; newTaskFor(Runnable r, V v) {
+ * return new CustomTask&lt;V&gt;(r, v);
+ * }
+ * // ... add constructors, etc.
+ * }
+ * </pre>
+ * @since 1.5
+ * @author Doug Lea
+ */
+public abstract class AbstractExecutorService implements ExecutorService {
+
+ /**
+ * Returns a <tt>RunnableFuture</tt> for the given runnable and default
+ * value.
+ *
+ * @param runnable the runnable task being wrapped
+ * @param value the default value for the returned future
+ * @return a <tt>RunnableFuture</tt> which when run will run the
+ * underlying runnable and which, as a <tt>Future</tt>, will yield
+ * the given value as its result and provide for cancellation of
+ * the underlying task.
+ * @since 1.6
+ */
+ protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value) {
+ return new FutureTask<T>(runnable, value);
+ }
+
+ /**
+ * Returns a <tt>RunnableFuture</tt> for the given callable task.
+ *
+ * @param callable the callable task being wrapped
+ * @return a <tt>RunnableFuture</tt> which when run will call the
+ * underlying callable and which, as a <tt>Future</tt>, will yield
+ * the callable's result as its result and provide for
+ * cancellation of the underlying task.
+ * @since 1.6
+ */
+ protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) {
+ return new FutureTask<T>(callable);
+ }
+
+ public Future<?> submit(Runnable task) {
+ if (task == null) throw new NullPointerException();
+ RunnableFuture<Object> ftask = newTaskFor(task, null);
+ execute(ftask);
+ return ftask;
+ }
+
+ public <T> Future<T> submit(Runnable task, T result) {
+ if (task == null) throw new NullPointerException();
+ RunnableFuture<T> ftask = newTaskFor(task, result);
+ execute(ftask);
+ return ftask;
+ }
+
+ public <T> Future<T> submit(Callable<T> task) {
+ if (task == null) throw new NullPointerException();
+ RunnableFuture<T> ftask = newTaskFor(task);
+ execute(ftask);
+ return ftask;
+ }
+
+ /**
+ * the main mechanics of invokeAny.
+ */
+ private <T> T doInvokeAny(Collection<? extends Callable<T>> tasks,
+ boolean timed, long nanos)
+ throws InterruptedException, ExecutionException, TimeoutException {
+ if (tasks == null)
+ throw new NullPointerException();
+ int ntasks = tasks.size();
+ if (ntasks == 0)
+ throw new IllegalArgumentException();
+ List<Future<T>> futures= new ArrayList<Future<T>>(ntasks);
+ ExecutorCompletionService<T> ecs =
+ new ExecutorCompletionService<T>(this);
+
+ // For efficiency, especially in executors with limited
+ // parallelism, check to see if previously submitted tasks are
+ // done before submitting more of them. This interleaving
+ // plus the exception mechanics account for messiness of main
+ // loop.
+
+ try {
+ // Record exceptions so that if we fail to obtain any
+ // result, we can throw the last exception we got.
+ ExecutionException ee = null;
+ long lastTime = (timed)? System.nanoTime() : 0;
+ Iterator<? extends Callable<T>> it = tasks.iterator();
+
+ // Start one task for sure; the rest incrementally
+ futures.add(ecs.submit(it.next()));
+ --ntasks;
+ int active = 1;
+
+ for (;;) {
+ Future<T> f = ecs.poll();
+ if (f == null) {
+ if (ntasks > 0) {
+ --ntasks;
+ futures.add(ecs.submit(it.next()));
+ ++active;
+ }
+ else if (active == 0)
+ break;
+ else if (timed) {
+ f = ecs.poll(nanos, TimeUnit.NANOSECONDS);
+ if (f == null)
+ throw new TimeoutException();
+ long now = System.nanoTime();
+ nanos -= now - lastTime;
+ lastTime = now;
+ }
+ else
+ f = ecs.take();
+ }
+ if (f != null) {
+ --active;
+ try {
+ return f.get();
+ } catch (InterruptedException ie) {
+ throw ie;
+ } catch (ExecutionException eex) {
+ ee = eex;
+ } catch (RuntimeException rex) {
+ ee = new ExecutionException(rex);
+ }
+ }
+ }
+
+ if (ee == null)
+ ee = new ExecutionException();
+ throw ee;
+
+ } finally {
+ for (Future<T> f : futures)
+ f.cancel(true);
+ }
+ }
+
+ public <T> T invokeAny(Collection<? extends Callable<T>> tasks)
+ throws InterruptedException, ExecutionException {
+ try {
+ return doInvokeAny(tasks, false, 0);
+ } catch (TimeoutException cannotHappen) {
+ assert false;
+ return null;
+ }
+ }
+
+ public <T> T invokeAny(Collection<? extends Callable<T>> tasks,
+ long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException {
+ return doInvokeAny(tasks, true, unit.toNanos(timeout));
+ }
+
+ public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
+ throws InterruptedException {
+ if (tasks == null)
+ throw new NullPointerException();
+ List<Future<T>> futures = new ArrayList<Future<T>>(tasks.size());
+ boolean done = false;
+ try {
+ for (Callable<T> t : tasks) {
+ RunnableFuture<T> f = newTaskFor(t);
+ futures.add(f);
+ execute(f);
+ }
+ for (Future<T> f : futures) {
+ if (!f.isDone()) {
+ try {
+ f.get();
+ } catch (CancellationException ignore) {
+ } catch (ExecutionException ignore) {
+ }
+ }
+ }
+ done = true;
+ return futures;
+ } finally {
+ if (!done)
+ for (Future<T> f : futures)
+ f.cancel(true);
+ }
+ }
+
+ public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks,
+ long timeout, TimeUnit unit)
+ throws InterruptedException {
+ if (tasks == null || unit == null)
+ throw new NullPointerException();
+ long nanos = unit.toNanos(timeout);
+ List<Future<T>> futures = new ArrayList<Future<T>>(tasks.size());
+ boolean done = false;
+ try {
+ for (Callable<T> t : tasks)
+ futures.add(newTaskFor(t));
+
+ long lastTime = System.nanoTime();
+
+ // Interleave time checks and calls to execute in case
+ // executor doesn't have any/much parallelism.
+ Iterator<Future<T>> it = futures.iterator();
+ while (it.hasNext()) {
+ execute((Runnable)(it.next()));
+ long now = System.nanoTime();
+ nanos -= now - lastTime;
+ lastTime = now;
+ if (nanos <= 0)
+ return futures;
+ }
+
+ for (Future<T> f : futures) {
+ if (!f.isDone()) {
+ if (nanos <= 0)
+ return futures;
+ try {
+ f.get(nanos, TimeUnit.NANOSECONDS);
+ } catch (CancellationException ignore) {
+ } catch (ExecutionException ignore) {
+ } catch (TimeoutException toe) {
+ return futures;
+ }
+ long now = System.nanoTime();
+ nanos -= now - lastTime;
+ lastTime = now;
+ }
+ }
+ done = true;
+ return futures;
+ } finally {
+ if (!done)
+ for (Future<T> f : futures)
+ f.cancel(true);
+ }
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ArrayBlockingQueue.java b/libjava/classpath/external/jsr166/java/util/concurrent/ArrayBlockingQueue.java
new file mode 100644
index 00000000000..bdf34d28a20
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ArrayBlockingQueue.java
@@ -0,0 +1,778 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.concurrent.locks.*;
+import java.util.*;
+
+/**
+ * A bounded {@linkplain BlockingQueue blocking queue} backed by an
+ * array. This queue orders elements FIFO (first-in-first-out). The
+ * <em>head</em> of the queue is that element that has been on the
+ * queue the longest time. The <em>tail</em> of the queue is that
+ * element that has been on the queue the shortest time. New elements
+ * are inserted at the tail of the queue, and the queue retrieval
+ * operations obtain elements at the head of the queue.
+ *
+ * <p>This is a classic &quot;bounded buffer&quot;, in which a
+ * fixed-sized array holds elements inserted by producers and
+ * extracted by consumers. Once created, the capacity cannot be
+ * increased. Attempts to <tt>put</tt> an element into a full queue
+ * will result in the operation blocking; attempts to <tt>take</tt> an
+ * element from an empty queue will similarly block.
+ *
+ * <p> This class supports an optional fairness policy for ordering
+ * waiting producer and consumer threads. By default, this ordering
+ * is not guaranteed. However, a queue constructed with fairness set
+ * to <tt>true</tt> grants threads access in FIFO order. Fairness
+ * generally decreases throughput but reduces variability and avoids
+ * starvation.
+ *
+ * <p>This class and its iterator implement all of the
+ * <em>optional</em> methods of the {@link Collection} and {@link
+ * Iterator} interfaces.
+ *
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <E> the type of elements held in this collection
+ */
+public class ArrayBlockingQueue<E> extends AbstractQueue<E>
+ implements BlockingQueue<E>, java.io.Serializable {
+
+ /**
+ * Serialization ID. This class relies on default serialization
+ * even for the items array, which is default-serialized, even if
+ * it is empty. Otherwise it could not be declared final, which is
+ * necessary here.
+ */
+ private static final long serialVersionUID = -817911632652898426L;
+
+ /** The queued items */
+ private final E[] items;
+ /** items index for next take, poll or remove */
+ private int takeIndex;
+ /** items index for next put, offer, or add. */
+ private int putIndex;
+ /** Number of items in the queue */
+ private int count;
+
+ /*
+ * Concurrency control uses the classic two-condition algorithm
+ * found in any textbook.
+ */
+
+ /** Main lock guarding all access */
+ private final ReentrantLock lock;
+ /** Condition for waiting takes */
+ private final Condition notEmpty;
+ /** Condition for waiting puts */
+ private final Condition notFull;
+
+ // Internal helper methods
+
+ /**
+ * Circularly increment i.
+ */
+ final int inc(int i) {
+ return (++i == items.length)? 0 : i;
+ }
+
+ /**
+ * Inserts element at current put position, advances, and signals.
+ * Call only when holding lock.
+ */
+ private void insert(E x) {
+ items[putIndex] = x;
+ putIndex = inc(putIndex);
+ ++count;
+ notEmpty.signal();
+ }
+
+ /**
+ * Extracts element at current take position, advances, and signals.
+ * Call only when holding lock.
+ */
+ private E extract() {
+ final E[] items = this.items;
+ E x = items[takeIndex];
+ items[takeIndex] = null;
+ takeIndex = inc(takeIndex);
+ --count;
+ notFull.signal();
+ return x;
+ }
+
+ /**
+ * Utility for remove and iterator.remove: Delete item at position i.
+ * Call only when holding lock.
+ */
+ void removeAt(int i) {
+ final E[] items = this.items;
+ // if removing front item, just advance
+ if (i == takeIndex) {
+ items[takeIndex] = null;
+ takeIndex = inc(takeIndex);
+ } else {
+ // slide over all others up through putIndex.
+ for (;;) {
+ int nexti = inc(i);
+ if (nexti != putIndex) {
+ items[i] = items[nexti];
+ i = nexti;
+ } else {
+ items[i] = null;
+ putIndex = i;
+ break;
+ }
+ }
+ }
+ --count;
+ notFull.signal();
+ }
+
+ /**
+ * Creates an <tt>ArrayBlockingQueue</tt> with the given (fixed)
+ * capacity and default access policy.
+ *
+ * @param capacity the capacity of this queue
+ * @throws IllegalArgumentException if <tt>capacity</tt> is less than 1
+ */
+ public ArrayBlockingQueue(int capacity) {
+ this(capacity, false);
+ }
+
+ /**
+ * Creates an <tt>ArrayBlockingQueue</tt> with the given (fixed)
+ * capacity and the specified access policy.
+ *
+ * @param capacity the capacity of this queue
+ * @param fair if <tt>true</tt> then queue accesses for threads blocked
+ * on insertion or removal, are processed in FIFO order;
+ * if <tt>false</tt> the access order is unspecified.
+ * @throws IllegalArgumentException if <tt>capacity</tt> is less than 1
+ */
+ public ArrayBlockingQueue(int capacity, boolean fair) {
+ if (capacity <= 0)
+ throw new IllegalArgumentException();
+ this.items = (E[]) new Object[capacity];
+ lock = new ReentrantLock(fair);
+ notEmpty = lock.newCondition();
+ notFull = lock.newCondition();
+ }
+
+ /**
+ * Creates an <tt>ArrayBlockingQueue</tt> with the given (fixed)
+ * capacity, the specified access policy and initially containing the
+ * elements of the given collection,
+ * added in traversal order of the collection's iterator.
+ *
+ * @param capacity the capacity of this queue
+ * @param fair if <tt>true</tt> then queue accesses for threads blocked
+ * on insertion or removal, are processed in FIFO order;
+ * if <tt>false</tt> the access order is unspecified.
+ * @param c the collection of elements to initially contain
+ * @throws IllegalArgumentException if <tt>capacity</tt> is less than
+ * <tt>c.size()</tt>, or less than 1.
+ * @throws NullPointerException if the specified collection or any
+ * of its elements are null
+ */
+ public ArrayBlockingQueue(int capacity, boolean fair,
+ Collection<? extends E> c) {
+ this(capacity, fair);
+ if (capacity < c.size())
+ throw new IllegalArgumentException();
+
+ for (Iterator<? extends E> it = c.iterator(); it.hasNext();)
+ add(it.next());
+ }
+
+ /**
+ * Inserts the specified element at the tail of this queue if it is
+ * possible to do so immediately without exceeding the queue's capacity,
+ * returning <tt>true</tt> upon success and throwing an
+ * <tt>IllegalStateException</tt> if this queue is full.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> (as specified by {@link Collection#add})
+ * @throws IllegalStateException if this queue is full
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean add(E e) {
+ return super.add(e);
+ }
+
+ /**
+ * Inserts the specified element at the tail of this queue if it is
+ * possible to do so immediately without exceeding the queue's capacity,
+ * returning <tt>true</tt> upon success and <tt>false</tt> if this queue
+ * is full. This method is generally preferable to method {@link #add},
+ * which can fail to insert an element only by throwing an exception.
+ *
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean offer(E e) {
+ if (e == null) throw new NullPointerException();
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ if (count == items.length)
+ return false;
+ else {
+ insert(e);
+ return true;
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Inserts the specified element at the tail of this queue, waiting
+ * for space to become available if the queue is full.
+ *
+ * @throws InterruptedException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public void put(E e) throws InterruptedException {
+ if (e == null) throw new NullPointerException();
+ final E[] items = this.items;
+ final ReentrantLock lock = this.lock;
+ lock.lockInterruptibly();
+ try {
+ try {
+ while (count == items.length)
+ notFull.await();
+ } catch (InterruptedException ie) {
+ notFull.signal(); // propagate to non-interrupted thread
+ throw ie;
+ }
+ insert(e);
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Inserts the specified element at the tail of this queue, waiting
+ * up to the specified wait time for space to become available if
+ * the queue is full.
+ *
+ * @throws InterruptedException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public boolean offer(E e, long timeout, TimeUnit unit)
+ throws InterruptedException {
+
+ if (e == null) throw new NullPointerException();
+ long nanos = unit.toNanos(timeout);
+ final ReentrantLock lock = this.lock;
+ lock.lockInterruptibly();
+ try {
+ for (;;) {
+ if (count != items.length) {
+ insert(e);
+ return true;
+ }
+ if (nanos <= 0)
+ return false;
+ try {
+ nanos = notFull.awaitNanos(nanos);
+ } catch (InterruptedException ie) {
+ notFull.signal(); // propagate to non-interrupted thread
+ throw ie;
+ }
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public E poll() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ if (count == 0)
+ return null;
+ E x = extract();
+ return x;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public E take() throws InterruptedException {
+ final ReentrantLock lock = this.lock;
+ lock.lockInterruptibly();
+ try {
+ try {
+ while (count == 0)
+ notEmpty.await();
+ } catch (InterruptedException ie) {
+ notEmpty.signal(); // propagate to non-interrupted thread
+ throw ie;
+ }
+ E x = extract();
+ return x;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public E poll(long timeout, TimeUnit unit) throws InterruptedException {
+ long nanos = unit.toNanos(timeout);
+ final ReentrantLock lock = this.lock;
+ lock.lockInterruptibly();
+ try {
+ for (;;) {
+ if (count != 0) {
+ E x = extract();
+ return x;
+ }
+ if (nanos <= 0)
+ return null;
+ try {
+ nanos = notEmpty.awaitNanos(nanos);
+ } catch (InterruptedException ie) {
+ notEmpty.signal(); // propagate to non-interrupted thread
+ throw ie;
+ }
+
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public E peek() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return (count == 0) ? null : items[takeIndex];
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ // this doc comment is overridden to remove the reference to collections
+ // greater in size than Integer.MAX_VALUE
+ /**
+ * Returns the number of elements in this queue.
+ *
+ * @return the number of elements in this queue
+ */
+ public int size() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return count;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ // this doc comment is a modified copy of the inherited doc comment,
+ // without the reference to unlimited queues.
+ /**
+ * Returns the number of additional elements that this queue can ideally
+ * (in the absence of memory or resource constraints) accept without
+ * blocking. This is always equal to the initial capacity of this queue
+ * less the current <tt>size</tt> of this queue.
+ *
+ * <p>Note that you <em>cannot</em> always tell if an attempt to insert
+ * an element will succeed by inspecting <tt>remainingCapacity</tt>
+ * because it may be the case that another thread is about to
+ * insert or remove an element.
+ */
+ public int remainingCapacity() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return items.length - count;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Removes a single instance of the specified element from this queue,
+ * if it is present. More formally, removes an element <tt>e</tt> such
+ * that <tt>o.equals(e)</tt>, if this queue contains one or more such
+ * elements.
+ * Returns <tt>true</tt> if this queue contained the specified element
+ * (or equivalently, if this queue changed as a result of the call).
+ *
+ * @param o element to be removed from this queue, if present
+ * @return <tt>true</tt> if this queue changed as a result of the call
+ */
+ public boolean remove(Object o) {
+ if (o == null) return false;
+ final E[] items = this.items;
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ int i = takeIndex;
+ int k = 0;
+ for (;;) {
+ if (k++ >= count)
+ return false;
+ if (o.equals(items[i])) {
+ removeAt(i);
+ return true;
+ }
+ i = inc(i);
+ }
+
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns <tt>true</tt> if this queue contains the specified element.
+ * More formally, returns <tt>true</tt> if and only if this queue contains
+ * at least one element <tt>e</tt> such that <tt>o.equals(e)</tt>.
+ *
+ * @param o object to be checked for containment in this queue
+ * @return <tt>true</tt> if this queue contains the specified element
+ */
+ public boolean contains(Object o) {
+ if (o == null) return false;
+ final E[] items = this.items;
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ int i = takeIndex;
+ int k = 0;
+ while (k++ < count) {
+ if (o.equals(items[i]))
+ return true;
+ i = inc(i);
+ }
+ return false;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns an array containing all of the elements in this queue, in
+ * proper sequence.
+ *
+ * <p>The returned array will be "safe" in that no references to it are
+ * maintained by this queue. (In other words, this method must allocate
+ * a new array). The caller is thus free to modify the returned array.
+ *
+ * <p>This method acts as bridge between array-based and collection-based
+ * APIs.
+ *
+ * @return an array containing all of the elements in this queue
+ */
+ public Object[] toArray() {
+ final E[] items = this.items;
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ Object[] a = new Object[count];
+ int k = 0;
+ int i = takeIndex;
+ while (k < count) {
+ a[k++] = items[i];
+ i = inc(i);
+ }
+ return a;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns an array containing all of the elements in this queue, in
+ * proper sequence; the runtime type of the returned array is that of
+ * the specified array. If the queue fits in the specified array, it
+ * is returned therein. Otherwise, a new array is allocated with the
+ * runtime type of the specified array and the size of this queue.
+ *
+ * <p>If this queue fits in the specified array with room to spare
+ * (i.e., the array has more elements than this queue), the element in
+ * the array immediately following the end of the queue is set to
+ * <tt>null</tt>.
+ *
+ * <p>Like the {@link #toArray()} method, this method acts as bridge between
+ * array-based and collection-based APIs. Further, this method allows
+ * precise control over the runtime type of the output array, and may,
+ * under certain circumstances, be used to save allocation costs.
+ *
+ * <p>Suppose <tt>x</tt> is a queue known to contain only strings.
+ * The following code can be used to dump the queue into a newly
+ * allocated array of <tt>String</tt>:
+ *
+ * <pre>
+ * String[] y = x.toArray(new String[0]);</pre>
+ *
+ * Note that <tt>toArray(new Object[0])</tt> is identical in function to
+ * <tt>toArray()</tt>.
+ *
+ * @param a the array into which the elements of the queue are to
+ * be stored, if it is big enough; otherwise, a new array of the
+ * same runtime type is allocated for this purpose
+ * @return an array containing all of the elements in this queue
+ * @throws ArrayStoreException if the runtime type of the specified array
+ * is not a supertype of the runtime type of every element in
+ * this queue
+ * @throws NullPointerException if the specified array is null
+ */
+ public <T> T[] toArray(T[] a) {
+ final E[] items = this.items;
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ if (a.length < count)
+ a = (T[])java.lang.reflect.Array.newInstance(
+ a.getClass().getComponentType(),
+ count
+ );
+
+ int k = 0;
+ int i = takeIndex;
+ while (k < count) {
+ a[k++] = (T)items[i];
+ i = inc(i);
+ }
+ if (a.length > count)
+ a[count] = null;
+ return a;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public String toString() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return super.toString();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Atomically removes all of the elements from this queue.
+ * The queue will be empty after this call returns.
+ */
+ public void clear() {
+ final E[] items = this.items;
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ int i = takeIndex;
+ int k = count;
+ while (k-- > 0) {
+ items[i] = null;
+ i = inc(i);
+ }
+ count = 0;
+ putIndex = 0;
+ takeIndex = 0;
+ notFull.signalAll();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws UnsupportedOperationException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public int drainTo(Collection<? super E> c) {
+ if (c == null)
+ throw new NullPointerException();
+ if (c == this)
+ throw new IllegalArgumentException();
+ final E[] items = this.items;
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ int i = takeIndex;
+ int n = 0;
+ int max = count;
+ while (n < max) {
+ c.add(items[i]);
+ items[i] = null;
+ i = inc(i);
+ ++n;
+ }
+ if (n > 0) {
+ count = 0;
+ putIndex = 0;
+ takeIndex = 0;
+ notFull.signalAll();
+ }
+ return n;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws UnsupportedOperationException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public int drainTo(Collection<? super E> c, int maxElements) {
+ if (c == null)
+ throw new NullPointerException();
+ if (c == this)
+ throw new IllegalArgumentException();
+ if (maxElements <= 0)
+ return 0;
+ final E[] items = this.items;
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ int i = takeIndex;
+ int n = 0;
+ int sz = count;
+ int max = (maxElements < count)? maxElements : count;
+ while (n < max) {
+ c.add(items[i]);
+ items[i] = null;
+ i = inc(i);
+ ++n;
+ }
+ if (n > 0) {
+ count -= n;
+ takeIndex = i;
+ notFull.signalAll();
+ }
+ return n;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+
+ /**
+ * Returns an iterator over the elements in this queue in proper sequence.
+ * The returned <tt>Iterator</tt> is a "weakly consistent" iterator that
+ * will never throw {@link ConcurrentModificationException},
+ * and guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed to)
+ * reflect any modifications subsequent to construction.
+ *
+ * @return an iterator over the elements in this queue in proper sequence
+ */
+ public Iterator<E> iterator() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return new Itr();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Iterator for ArrayBlockingQueue
+ */
+ private class Itr implements Iterator<E> {
+ /**
+ * Index of element to be returned by next,
+ * or a negative number if no such.
+ */
+ private int nextIndex;
+
+ /**
+ * nextItem holds on to item fields because once we claim
+ * that an element exists in hasNext(), we must return it in
+ * the following next() call even if it was in the process of
+ * being removed when hasNext() was called.
+ */
+ private E nextItem;
+
+ /**
+ * Index of element returned by most recent call to next.
+ * Reset to -1 if this element is deleted by a call to remove.
+ */
+ private int lastRet;
+
+ Itr() {
+ lastRet = -1;
+ if (count == 0)
+ nextIndex = -1;
+ else {
+ nextIndex = takeIndex;
+ nextItem = items[takeIndex];
+ }
+ }
+
+ public boolean hasNext() {
+ /*
+ * No sync. We can return true by mistake here
+ * only if this iterator passed across threads,
+ * which we don't support anyway.
+ */
+ return nextIndex >= 0;
+ }
+
+ /**
+ * Checks whether nextIndex is valid; if so setting nextItem.
+ * Stops iterator when either hits putIndex or sees null item.
+ */
+ private void checkNext() {
+ if (nextIndex == putIndex) {
+ nextIndex = -1;
+ nextItem = null;
+ } else {
+ nextItem = items[nextIndex];
+ if (nextItem == null)
+ nextIndex = -1;
+ }
+ }
+
+ public E next() {
+ final ReentrantLock lock = ArrayBlockingQueue.this.lock;
+ lock.lock();
+ try {
+ if (nextIndex < 0)
+ throw new NoSuchElementException();
+ lastRet = nextIndex;
+ E x = nextItem;
+ nextIndex = inc(nextIndex);
+ checkNext();
+ return x;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public void remove() {
+ final ReentrantLock lock = ArrayBlockingQueue.this.lock;
+ lock.lock();
+ try {
+ int i = lastRet;
+ if (i == -1)
+ throw new IllegalStateException();
+ lastRet = -1;
+
+ int ti = takeIndex;
+ removeAt(i);
+ // back up cursor (reset to front if was first element)
+ nextIndex = (i == ti) ? takeIndex : i;
+ checkNext();
+ } finally {
+ lock.unlock();
+ }
+ }
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/BlockingDeque.java b/libjava/classpath/external/jsr166/java/util/concurrent/BlockingDeque.java
new file mode 100644
index 00000000000..d77a96555ad
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/BlockingDeque.java
@@ -0,0 +1,613 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.*;
+
+/**
+ * A {@link Deque} that additionally supports blocking operations that wait
+ * for the deque to become non-empty when retrieving an element, and wait for
+ * space to become available in the deque when storing an element.
+ *
+ * <p><tt>BlockingDeque</tt> methods come in four forms, with different ways
+ * of handling operations that cannot be satisfied immediately, but may be
+ * satisfied at some point in the future:
+ * one throws an exception, the second returns a special value (either
+ * <tt>null</tt> or <tt>false</tt>, depending on the operation), the third
+ * blocks the current thread indefinitely until the operation can succeed,
+ * and the fourth blocks for only a given maximum time limit before giving
+ * up. These methods are summarized in the following table:
+ *
+ * <p>
+ * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <tr>
+ * <td ALIGN=CENTER COLSPAN = 5> <b>First Element (Head)</b></td>
+ * </tr>
+ * <tr>
+ * <td></td>
+ * <td ALIGN=CENTER><em>Throws exception</em></td>
+ * <td ALIGN=CENTER><em>Special value</em></td>
+ * <td ALIGN=CENTER><em>Blocks</em></td>
+ * <td ALIGN=CENTER><em>Times out</em></td>
+ * </tr>
+ * <tr>
+ * <td><b>Insert</b></td>
+ * <td>{@link #addFirst addFirst(e)}</td>
+ * <td>{@link #offerFirst(Object) offerFirst(e)}</td>
+ * <td>{@link #putFirst putFirst(e)}</td>
+ * <td>{@link #offerFirst(Object, long, TimeUnit) offerFirst(e, time, unit)}</td>
+ * </tr>
+ * <tr>
+ * <td><b>Remove</b></td>
+ * <td>{@link #removeFirst removeFirst()}</td>
+ * <td>{@link #pollFirst pollFirst()}</td>
+ * <td>{@link #takeFirst takeFirst()}</td>
+ * <td>{@link #pollFirst(long, TimeUnit) pollFirst(time, unit)}</td>
+ * </tr>
+ * <tr>
+ * <td><b>Examine</b></td>
+ * <td>{@link #getFirst getFirst()}</td>
+ * <td>{@link #peekFirst peekFirst()}</td>
+ * <td><em>not applicable</em></td>
+ * <td><em>not applicable</em></td>
+ * </tr>
+ * <tr>
+ * <td ALIGN=CENTER COLSPAN = 5> <b>Last Element (Tail)</b></td>
+ * </tr>
+ * <tr>
+ * <td></td>
+ * <td ALIGN=CENTER><em>Throws exception</em></td>
+ * <td ALIGN=CENTER><em>Special value</em></td>
+ * <td ALIGN=CENTER><em>Blocks</em></td>
+ * <td ALIGN=CENTER><em>Times out</em></td>
+ * </tr>
+ * <tr>
+ * <td><b>Insert</b></td>
+ * <td>{@link #addLast addLast(e)}</td>
+ * <td>{@link #offerLast(Object) offerLast(e)}</td>
+ * <td>{@link #putLast putLast(e)}</td>
+ * <td>{@link #offerLast(Object, long, TimeUnit) offerLast(e, time, unit)}</td>
+ * </tr>
+ * <tr>
+ * <td><b>Remove</b></td>
+ * <td>{@link #removeLast() removeLast()}</td>
+ * <td>{@link #pollLast() pollLast()}</td>
+ * <td>{@link #takeLast takeLast()}</td>
+ * <td>{@link #pollLast(long, TimeUnit) pollLast(time, unit)}</td>
+ * </tr>
+ * <tr>
+ * <td><b>Examine</b></td>
+ * <td>{@link #getLast getLast()}</td>
+ * <td>{@link #peekLast peekLast()}</td>
+ * <td><em>not applicable</em></td>
+ * <td><em>not applicable</em></td>
+ * </tr>
+ * </table>
+ *
+ * <p>Like any {@link BlockingQueue}, a <tt>BlockingDeque</tt> is thread safe,
+ * does not permit null elements, and may (or may not) be
+ * capacity-constrained.
+ *
+ * <p>A <tt>BlockingDeque</tt> implementation may be used directly as a FIFO
+ * <tt>BlockingQueue</tt>. The methods inherited from the
+ * <tt>BlockingQueue</tt> interface are precisely equivalent to
+ * <tt>BlockingDeque</tt> methods as indicated in the following table:
+ *
+ * <p>
+ * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <tr>
+ * <td ALIGN=CENTER> <b><tt>BlockingQueue</tt> Method</b></td>
+ * <td ALIGN=CENTER> <b>Equivalent <tt>BlockingDeque</tt> Method</b></td>
+ * </tr>
+ * <tr>
+ * <td ALIGN=CENTER COLSPAN = 2> <b>Insert</b></td>
+ * </tr>
+ * <tr>
+ * <td>{@link #add(Object) add(e)}</td>
+ * <td>{@link #addLast(Object) addLast(e)}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link #offer(Object) offer(e)}</td>
+ * <td>{@link #offerLast(Object) offerLast(e)}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link #put(Object) put(e)}</td>
+ * <td>{@link #putLast(Object) putLast(e)}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link #offer(Object, long, TimeUnit) offer(e, time, unit)}</td>
+ * <td>{@link #offerLast(Object, long, TimeUnit) offerLast(e, time, unit)}</td>
+ * </tr>
+ * <tr>
+ * <td ALIGN=CENTER COLSPAN = 2> <b>Remove</b></td>
+ * </tr>
+ * <tr>
+ * <td>{@link #remove() remove()}</td>
+ * <td>{@link #removeFirst() removeFirst()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link #poll() poll()}</td>
+ * <td>{@link #pollFirst() pollFirst()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link #take() take()}</td>
+ * <td>{@link #takeFirst() takeFirst()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link #poll(long, TimeUnit) poll(time, unit)}</td>
+ * <td>{@link #pollFirst(long, TimeUnit) pollFirst(time, unit)}</td>
+ * </tr>
+ * <tr>
+ * <td ALIGN=CENTER COLSPAN = 2> <b>Examine</b></td>
+ * </tr>
+ * <tr>
+ * <td>{@link #element() element()}</td>
+ * <td>{@link #getFirst() getFirst()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link #peek() peek()}</td>
+ * <td>{@link #peekFirst() peekFirst()}</td>
+ * </tr>
+ * </table>
+ *
+ * <p>Memory consistency effects: As with other concurrent
+ * collections, actions in a thread prior to placing an object into a
+ * {@code BlockingDeque}
+ * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
+ * actions subsequent to the access or removal of that element from
+ * the {@code BlockingDeque} in another thread.
+ *
+ * <p>This interface is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @since 1.6
+ * @author Doug Lea
+ * @param <E> the type of elements held in this collection
+ */
+public interface BlockingDeque<E> extends BlockingQueue<E>, Deque<E> {
+ /*
+ * We have "diamond" multiple interface inheritance here, and that
+ * introduces ambiguities. Methods might end up with different
+ * specs depending on the branch chosen by javadoc. Thus a lot of
+ * methods specs here are copied from superinterfaces.
+ */
+
+ /**
+ * Inserts the specified element at the front of this deque if it is
+ * possible to do so immediately without violating capacity restrictions,
+ * throwing an <tt>IllegalStateException</tt> if no space is currently
+ * available. When using a capacity-restricted deque, it is generally
+ * preferable to use {@link #offerFirst(Object) offerFirst}.
+ *
+ * @param e the element to add
+ * @throws IllegalStateException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ void addFirst(E e);
+
+ /**
+ * Inserts the specified element at the end of this deque if it is
+ * possible to do so immediately without violating capacity restrictions,
+ * throwing an <tt>IllegalStateException</tt> if no space is currently
+ * available. When using a capacity-restricted deque, it is generally
+ * preferable to use {@link #offerLast(Object) offerLast}.
+ *
+ * @param e the element to add
+ * @throws IllegalStateException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ void addLast(E e);
+
+ /**
+ * Inserts the specified element at the front of this deque if it is
+ * possible to do so immediately without violating capacity restrictions,
+ * returning <tt>true</tt> upon success and <tt>false</tt> if no space is
+ * currently available.
+ * When using a capacity-restricted deque, this method is generally
+ * preferable to the {@link #addFirst(Object) addFirst} method, which can
+ * fail to insert an element only by throwing an exception.
+ *
+ * @param e the element to add
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ boolean offerFirst(E e);
+
+ /**
+ * Inserts the specified element at the end of this deque if it is
+ * possible to do so immediately without violating capacity restrictions,
+ * returning <tt>true</tt> upon success and <tt>false</tt> if no space is
+ * currently available.
+ * When using a capacity-restricted deque, this method is generally
+ * preferable to the {@link #addLast(Object) addLast} method, which can
+ * fail to insert an element only by throwing an exception.
+ *
+ * @param e the element to add
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ boolean offerLast(E e);
+
+ /**
+ * Inserts the specified element at the front of this deque,
+ * waiting if necessary for space to become available.
+ *
+ * @param e the element to add
+ * @throws InterruptedException if interrupted while waiting
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ void putFirst(E e) throws InterruptedException;
+
+ /**
+ * Inserts the specified element at the end of this deque,
+ * waiting if necessary for space to become available.
+ *
+ * @param e the element to add
+ * @throws InterruptedException if interrupted while waiting
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ void putLast(E e) throws InterruptedException;
+
+ /**
+ * Inserts the specified element at the front of this deque,
+ * waiting up to the specified wait time if necessary for space to
+ * become available.
+ *
+ * @param e the element to add
+ * @param timeout how long to wait before giving up, in units of
+ * <tt>unit</tt>
+ * @param unit a <tt>TimeUnit</tt> determining how to interpret the
+ * <tt>timeout</tt> parameter
+ * @return <tt>true</tt> if successful, or <tt>false</tt> if
+ * the specified waiting time elapses before space is available
+ * @throws InterruptedException if interrupted while waiting
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ boolean offerFirst(E e, long timeout, TimeUnit unit)
+ throws InterruptedException;
+
+ /**
+ * Inserts the specified element at the end of this deque,
+ * waiting up to the specified wait time if necessary for space to
+ * become available.
+ *
+ * @param e the element to add
+ * @param timeout how long to wait before giving up, in units of
+ * <tt>unit</tt>
+ * @param unit a <tt>TimeUnit</tt> determining how to interpret the
+ * <tt>timeout</tt> parameter
+ * @return <tt>true</tt> if successful, or <tt>false</tt> if
+ * the specified waiting time elapses before space is available
+ * @throws InterruptedException if interrupted while waiting
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ boolean offerLast(E e, long timeout, TimeUnit unit)
+ throws InterruptedException;
+
+ /**
+ * Retrieves and removes the first element of this deque, waiting
+ * if necessary until an element becomes available.
+ *
+ * @return the head of this deque
+ * @throws InterruptedException if interrupted while waiting
+ */
+ E takeFirst() throws InterruptedException;
+
+ /**
+ * Retrieves and removes the last element of this deque, waiting
+ * if necessary until an element becomes available.
+ *
+ * @return the tail of this deque
+ * @throws InterruptedException if interrupted while waiting
+ */
+ E takeLast() throws InterruptedException;
+
+ /**
+ * Retrieves and removes the first element of this deque, waiting
+ * up to the specified wait time if necessary for an element to
+ * become available.
+ *
+ * @param timeout how long to wait before giving up, in units of
+ * <tt>unit</tt>
+ * @param unit a <tt>TimeUnit</tt> determining how to interpret the
+ * <tt>timeout</tt> parameter
+ * @return the head of this deque, or <tt>null</tt> if the specified
+ * waiting time elapses before an element is available
+ * @throws InterruptedException if interrupted while waiting
+ */
+ E pollFirst(long timeout, TimeUnit unit)
+ throws InterruptedException;
+
+ /**
+ * Retrieves and removes the last element of this deque, waiting
+ * up to the specified wait time if necessary for an element to
+ * become available.
+ *
+ * @param timeout how long to wait before giving up, in units of
+ * <tt>unit</tt>
+ * @param unit a <tt>TimeUnit</tt> determining how to interpret the
+ * <tt>timeout</tt> parameter
+ * @return the tail of this deque, or <tt>null</tt> if the specified
+ * waiting time elapses before an element is available
+ * @throws InterruptedException if interrupted while waiting
+ */
+ E pollLast(long timeout, TimeUnit unit)
+ throws InterruptedException;
+
+ /**
+ * Removes the first occurrence of the specified element from this deque.
+ * If the deque does not contain the element, it is unchanged.
+ * More formally, removes the first element <tt>e</tt> such that
+ * <tt>o.equals(e)</tt> (if such an element exists).
+ * Returns <tt>true</tt> if this deque contained the specified element
+ * (or equivalently, if this deque changed as a result of the call).
+ *
+ * @param o element to be removed from this deque, if present
+ * @return <tt>true</tt> if an element was removed as a result of this call
+ * @throws ClassCastException if the class of the specified element
+ * is incompatible with this deque (optional)
+ * @throws NullPointerException if the specified element is null (optional)
+ */
+ boolean removeFirstOccurrence(Object o);
+
+ /**
+ * Removes the last occurrence of the specified element from this deque.
+ * If the deque does not contain the element, it is unchanged.
+ * More formally, removes the last element <tt>e</tt> such that
+ * <tt>o.equals(e)</tt> (if such an element exists).
+ * Returns <tt>true</tt> if this deque contained the specified element
+ * (or equivalently, if this deque changed as a result of the call).
+ *
+ * @param o element to be removed from this deque, if present
+ * @return <tt>true</tt> if an element was removed as a result of this call
+ * @throws ClassCastException if the class of the specified element
+ * is incompatible with this deque (optional)
+ * @throws NullPointerException if the specified element is null (optional)
+ */
+ boolean removeLastOccurrence(Object o);
+
+ // *** BlockingQueue methods ***
+
+ /**
+ * Inserts the specified element into the queue represented by this deque
+ * (in other words, at the tail of this deque) if it is possible to do so
+ * immediately without violating capacity restrictions, returning
+ * <tt>true</tt> upon success and throwing an
+ * <tt>IllegalStateException</tt> if no space is currently available.
+ * When using a capacity-restricted deque, it is generally preferable to
+ * use {@link #offer(Object) offer}.
+ *
+ * <p>This method is equivalent to {@link #addLast(Object) addLast}.
+ *
+ * @param e the element to add
+ * @throws IllegalStateException {@inheritDoc}
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ boolean add(E e);
+
+ /**
+ * Inserts the specified element into the queue represented by this deque
+ * (in other words, at the tail of this deque) if it is possible to do so
+ * immediately without violating capacity restrictions, returning
+ * <tt>true</tt> upon success and <tt>false</tt> if no space is currently
+ * available. When using a capacity-restricted deque, this method is
+ * generally preferable to the {@link #add} method, which can fail to
+ * insert an element only by throwing an exception.
+ *
+ * <p>This method is equivalent to {@link #offerLast(Object) offerLast}.
+ *
+ * @param e the element to add
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ boolean offer(E e);
+
+ /**
+ * Inserts the specified element into the queue represented by this deque
+ * (in other words, at the tail of this deque), waiting if necessary for
+ * space to become available.
+ *
+ * <p>This method is equivalent to {@link #putLast(Object) putLast}.
+ *
+ * @param e the element to add
+ * @throws InterruptedException {@inheritDoc}
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ void put(E e) throws InterruptedException;
+
+ /**
+ * Inserts the specified element into the queue represented by this deque
+ * (in other words, at the tail of this deque), waiting up to the
+ * specified wait time if necessary for space to become available.
+ *
+ * <p>This method is equivalent to
+ * {@link #offerLast(Object,long,TimeUnit) offerLast}.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> if the element was added to this deque, else
+ * <tt>false</tt>
+ * @throws InterruptedException {@inheritDoc}
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ boolean offer(E e, long timeout, TimeUnit unit)
+ throws InterruptedException;
+
+ /**
+ * Retrieves and removes the head of the queue represented by this deque
+ * (in other words, the first element of this deque).
+ * This method differs from {@link #poll poll} only in that it
+ * throws an exception if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #removeFirst() removeFirst}.
+ *
+ * @return the head of the queue represented by this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E remove();
+
+ /**
+ * Retrieves and removes the head of the queue represented by this deque
+ * (in other words, the first element of this deque), or returns
+ * <tt>null</tt> if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #pollFirst()}.
+ *
+ * @return the head of this deque, or <tt>null</tt> if this deque is empty
+ */
+ E poll();
+
+ /**
+ * Retrieves and removes the head of the queue represented by this deque
+ * (in other words, the first element of this deque), waiting if
+ * necessary until an element becomes available.
+ *
+ * <p>This method is equivalent to {@link #takeFirst() takeFirst}.
+ *
+ * @return the head of this deque
+ * @throws InterruptedException if interrupted while waiting
+ */
+ E take() throws InterruptedException;
+
+ /**
+ * Retrieves and removes the head of the queue represented by this deque
+ * (in other words, the first element of this deque), waiting up to the
+ * specified wait time if necessary for an element to become available.
+ *
+ * <p>This method is equivalent to
+ * {@link #pollFirst(long,TimeUnit) pollFirst}.
+ *
+ * @return the head of this deque, or <tt>null</tt> if the
+ * specified waiting time elapses before an element is available
+ * @throws InterruptedException if interrupted while waiting
+ */
+ E poll(long timeout, TimeUnit unit)
+ throws InterruptedException;
+
+ /**
+ * Retrieves, but does not remove, the head of the queue represented by
+ * this deque (in other words, the first element of this deque).
+ * This method differs from {@link #peek peek} only in that it throws an
+ * exception if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #getFirst() getFirst}.
+ *
+ * @return the head of this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E element();
+
+ /**
+ * Retrieves, but does not remove, the head of the queue represented by
+ * this deque (in other words, the first element of this deque), or
+ * returns <tt>null</tt> if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #peekFirst() peekFirst}.
+ *
+ * @return the head of this deque, or <tt>null</tt> if this deque is empty
+ */
+ E peek();
+
+ /**
+ * Removes the first occurrence of the specified element from this deque.
+ * If the deque does not contain the element, it is unchanged.
+ * More formally, removes the first element <tt>e</tt> such that
+ * <tt>o.equals(e)</tt> (if such an element exists).
+ * Returns <tt>true</tt> if this deque contained the specified element
+ * (or equivalently, if this deque changed as a result of the call).
+ *
+ * <p>This method is equivalent to
+ * {@link #removeFirstOccurrence(Object) removeFirstOccurrence}.
+ *
+ * @param o element to be removed from this deque, if present
+ * @return <tt>true</tt> if this deque changed as a result of the call
+ * @throws ClassCastException if the class of the specified element
+ * is incompatible with this deque (optional)
+ * @throws NullPointerException if the specified element is null (optional)
+ */
+ boolean remove(Object o);
+
+ /**
+ * Returns <tt>true</tt> if this deque contains the specified element.
+ * More formally, returns <tt>true</tt> if and only if this deque contains
+ * at least one element <tt>e</tt> such that <tt>o.equals(e)</tt>.
+ *
+ * @param o object to be checked for containment in this deque
+ * @return <tt>true</tt> if this deque contains the specified element
+ * @throws ClassCastException if the class of the specified element
+ * is incompatible with this deque (optional)
+ * @throws NullPointerException if the specified element is null (optional)
+ */
+ public boolean contains(Object o);
+
+ /**
+ * Returns the number of elements in this deque.
+ *
+ * @return the number of elements in this deque
+ */
+ public int size();
+
+ /**
+ * Returns an iterator over the elements in this deque in proper sequence.
+ * The elements will be returned in order from first (head) to last (tail).
+ *
+ * @return an iterator over the elements in this deque in proper sequence
+ */
+ Iterator<E> iterator();
+
+ // *** Stack methods ***
+
+ /**
+ * Pushes an element onto the stack represented by this deque. In other
+ * words, inserts the element at the front of this deque unless it would
+ * violate capacity restrictions.
+ *
+ * <p>This method is equivalent to {@link #addFirst(Object) addFirst}.
+ *
+ * @throws IllegalStateException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ void push(E e);
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/BlockingQueue.java b/libjava/classpath/external/jsr166/java/util/concurrent/BlockingQueue.java
new file mode 100644
index 00000000000..b47cc984273
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/BlockingQueue.java
@@ -0,0 +1,344 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+import java.util.Collection;
+import java.util.Queue;
+
+/**
+ * A {@link java.util.Queue} that additionally supports operations
+ * that wait for the queue to become non-empty when retrieving an
+ * element, and wait for space to become available in the queue when
+ * storing an element.
+ *
+ * <p><tt>BlockingQueue</tt> methods come in four forms, with different ways
+ * of handling operations that cannot be satisfied immediately, but may be
+ * satisfied at some point in the future:
+ * one throws an exception, the second returns a special value (either
+ * <tt>null</tt> or <tt>false</tt>, depending on the operation), the third
+ * blocks the current thread indefinitely until the operation can succeed,
+ * and the fourth blocks for only a given maximum time limit before giving
+ * up. These methods are summarized in the following table:
+ *
+ * <p>
+ * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <tr>
+ * <td></td>
+ * <td ALIGN=CENTER><em>Throws exception</em></td>
+ * <td ALIGN=CENTER><em>Special value</em></td>
+ * <td ALIGN=CENTER><em>Blocks</em></td>
+ * <td ALIGN=CENTER><em>Times out</em></td>
+ * </tr>
+ * <tr>
+ * <td><b>Insert</b></td>
+ * <td>{@link #add add(e)}</td>
+ * <td>{@link #offer offer(e)}</td>
+ * <td>{@link #put put(e)}</td>
+ * <td>{@link #offer(Object, long, TimeUnit) offer(e, time, unit)}</td>
+ * </tr>
+ * <tr>
+ * <td><b>Remove</b></td>
+ * <td>{@link #remove remove()}</td>
+ * <td>{@link #poll poll()}</td>
+ * <td>{@link #take take()}</td>
+ * <td>{@link #poll(long, TimeUnit) poll(time, unit)}</td>
+ * </tr>
+ * <tr>
+ * <td><b>Examine</b></td>
+ * <td>{@link #element element()}</td>
+ * <td>{@link #peek peek()}</td>
+ * <td><em>not applicable</em></td>
+ * <td><em>not applicable</em></td>
+ * </tr>
+ * </table>
+ *
+ * <p>A <tt>BlockingQueue</tt> does not accept <tt>null</tt> elements.
+ * Implementations throw <tt>NullPointerException</tt> on attempts
+ * to <tt>add</tt>, <tt>put</tt> or <tt>offer</tt> a <tt>null</tt>. A
+ * <tt>null</tt> is used as a sentinel value to indicate failure of
+ * <tt>poll</tt> operations.
+ *
+ * <p>A <tt>BlockingQueue</tt> may be capacity bounded. At any given
+ * time it may have a <tt>remainingCapacity</tt> beyond which no
+ * additional elements can be <tt>put</tt> without blocking.
+ * A <tt>BlockingQueue</tt> without any intrinsic capacity constraints always
+ * reports a remaining capacity of <tt>Integer.MAX_VALUE</tt>.
+ *
+ * <p> <tt>BlockingQueue</tt> implementations are designed to be used
+ * primarily for producer-consumer queues, but additionally support
+ * the {@link java.util.Collection} interface. So, for example, it is
+ * possible to remove an arbitrary element from a queue using
+ * <tt>remove(x)</tt>. However, such operations are in general
+ * <em>not</em> performed very efficiently, and are intended for only
+ * occasional use, such as when a queued message is cancelled.
+ *
+ * <p> <tt>BlockingQueue</tt> implementations are thread-safe. All
+ * queuing methods achieve their effects atomically using internal
+ * locks or other forms of concurrency control. However, the
+ * <em>bulk</em> Collection operations <tt>addAll</tt>,
+ * <tt>containsAll</tt>, <tt>retainAll</tt> and <tt>removeAll</tt> are
+ * <em>not</em> necessarily performed atomically unless specified
+ * otherwise in an implementation. So it is possible, for example, for
+ * <tt>addAll(c)</tt> to fail (throwing an exception) after adding
+ * only some of the elements in <tt>c</tt>.
+ *
+ * <p>A <tt>BlockingQueue</tt> does <em>not</em> intrinsically support
+ * any kind of &quot;close&quot; or &quot;shutdown&quot; operation to
+ * indicate that no more items will be added. The needs and usage of
+ * such features tend to be implementation-dependent. For example, a
+ * common tactic is for producers to insert special
+ * <em>end-of-stream</em> or <em>poison</em> objects, that are
+ * interpreted accordingly when taken by consumers.
+ *
+ * <p>
+ * Usage example, based on a typical producer-consumer scenario.
+ * Note that a <tt>BlockingQueue</tt> can safely be used with multiple
+ * producers and multiple consumers.
+ * <pre>
+ * class Producer implements Runnable {
+ * private final BlockingQueue queue;
+ * Producer(BlockingQueue q) { queue = q; }
+ * public void run() {
+ * try {
+ * while (true) { queue.put(produce()); }
+ * } catch (InterruptedException ex) { ... handle ...}
+ * }
+ * Object produce() { ... }
+ * }
+ *
+ * class Consumer implements Runnable {
+ * private final BlockingQueue queue;
+ * Consumer(BlockingQueue q) { queue = q; }
+ * public void run() {
+ * try {
+ * while (true) { consume(queue.take()); }
+ * } catch (InterruptedException ex) { ... handle ...}
+ * }
+ * void consume(Object x) { ... }
+ * }
+ *
+ * class Setup {
+ * void main() {
+ * BlockingQueue q = new SomeQueueImplementation();
+ * Producer p = new Producer(q);
+ * Consumer c1 = new Consumer(q);
+ * Consumer c2 = new Consumer(q);
+ * new Thread(p).start();
+ * new Thread(c1).start();
+ * new Thread(c2).start();
+ * }
+ * }
+ * </pre>
+ *
+ * <p>Memory consistency effects: As with other concurrent
+ * collections, actions in a thread prior to placing an object into a
+ * {@code BlockingQueue}
+ * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
+ * actions subsequent to the access or removal of that element from
+ * the {@code BlockingQueue} in another thread.
+ *
+ * <p>This interface is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <E> the type of elements held in this collection
+ */
+public interface BlockingQueue<E> extends Queue<E> {
+ /**
+ * Inserts the specified element into this queue if it is possible to do
+ * so immediately without violating capacity restrictions, returning
+ * <tt>true</tt> upon success and throwing an
+ * <tt>IllegalStateException</tt> if no space is currently available.
+ * When using a capacity-restricted queue, it is generally preferable to
+ * use {@link #offer(Object) offer}.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> (as specified by {@link Collection#add})
+ * @throws IllegalStateException if the element cannot be added at this
+ * time due to capacity restrictions
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this queue
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this queue
+ */
+ boolean add(E e);
+
+ /**
+ * Inserts the specified element into this queue if it is possible to do
+ * so immediately without violating capacity restrictions, returning
+ * <tt>true</tt> upon success and <tt>false</tt> if no space is currently
+ * available. When using a capacity-restricted queue, this method is
+ * generally preferable to {@link #add}, which can fail to insert an
+ * element only by throwing an exception.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> if the element was added to this queue, else
+ * <tt>false</tt>
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this queue
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this queue
+ */
+ boolean offer(E e);
+
+ /**
+ * Inserts the specified element into this queue, waiting if necessary
+ * for space to become available.
+ *
+ * @param e the element to add
+ * @throws InterruptedException if interrupted while waiting
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this queue
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this queue
+ */
+ void put(E e) throws InterruptedException;
+
+ /**
+ * Inserts the specified element into this queue, waiting up to the
+ * specified wait time if necessary for space to become available.
+ *
+ * @param e the element to add
+ * @param timeout how long to wait before giving up, in units of
+ * <tt>unit</tt>
+ * @param unit a <tt>TimeUnit</tt> determining how to interpret the
+ * <tt>timeout</tt> parameter
+ * @return <tt>true</tt> if successful, or <tt>false</tt> if
+ * the specified waiting time elapses before space is available
+ * @throws InterruptedException if interrupted while waiting
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this queue
+ * @throws NullPointerException if the specified element is null
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this queue
+ */
+ boolean offer(E e, long timeout, TimeUnit unit)
+ throws InterruptedException;
+
+ /**
+ * Retrieves and removes the head of this queue, waiting if necessary
+ * until an element becomes available.
+ *
+ * @return the head of this queue
+ * @throws InterruptedException if interrupted while waiting
+ */
+ E take() throws InterruptedException;
+
+ /**
+ * Retrieves and removes the head of this queue, waiting up to the
+ * specified wait time if necessary for an element to become available.
+ *
+ * @param timeout how long to wait before giving up, in units of
+ * <tt>unit</tt>
+ * @param unit a <tt>TimeUnit</tt> determining how to interpret the
+ * <tt>timeout</tt> parameter
+ * @return the head of this queue, or <tt>null</tt> if the
+ * specified waiting time elapses before an element is available
+ * @throws InterruptedException if interrupted while waiting
+ */
+ E poll(long timeout, TimeUnit unit)
+ throws InterruptedException;
+
+ /**
+ * Returns the number of additional elements that this queue can ideally
+ * (in the absence of memory or resource constraints) accept without
+ * blocking, or <tt>Integer.MAX_VALUE</tt> if there is no intrinsic
+ * limit.
+ *
+ * <p>Note that you <em>cannot</em> always tell if an attempt to insert
+ * an element will succeed by inspecting <tt>remainingCapacity</tt>
+ * because it may be the case that another thread is about to
+ * insert or remove an element.
+ *
+ * @return the remaining capacity
+ */
+ int remainingCapacity();
+
+ /**
+ * Removes a single instance of the specified element from this queue,
+ * if it is present. More formally, removes an element <tt>e</tt> such
+ * that <tt>o.equals(e)</tt>, if this queue contains one or more such
+ * elements.
+ * Returns <tt>true</tt> if this queue contained the specified element
+ * (or equivalently, if this queue changed as a result of the call).
+ *
+ * @param o element to be removed from this queue, if present
+ * @return <tt>true</tt> if this queue changed as a result of the call
+ * @throws ClassCastException if the class of the specified element
+ * is incompatible with this queue (optional)
+ * @throws NullPointerException if the specified element is null (optional)
+ */
+ boolean remove(Object o);
+
+ /**
+ * Returns <tt>true</tt> if this queue contains the specified element.
+ * More formally, returns <tt>true</tt> if and only if this queue contains
+ * at least one element <tt>e</tt> such that <tt>o.equals(e)</tt>.
+ *
+ * @param o object to be checked for containment in this queue
+ * @return <tt>true</tt> if this queue contains the specified element
+ * @throws ClassCastException if the class of the specified element
+ * is incompatible with this queue (optional)
+ * @throws NullPointerException if the specified element is null (optional)
+ */
+ public boolean contains(Object o);
+
+ /**
+ * Removes all available elements from this queue and adds them
+ * to the given collection. This operation may be more
+ * efficient than repeatedly polling this queue. A failure
+ * encountered while attempting to add elements to
+ * collection <tt>c</tt> may result in elements being in neither,
+ * either or both collections when the associated exception is
+ * thrown. Attempts to drain a queue to itself result in
+ * <tt>IllegalArgumentException</tt>. Further, the behavior of
+ * this operation is undefined if the specified collection is
+ * modified while the operation is in progress.
+ *
+ * @param c the collection to transfer elements into
+ * @return the number of elements transferred
+ * @throws UnsupportedOperationException if addition of elements
+ * is not supported by the specified collection
+ * @throws ClassCastException if the class of an element of this queue
+ * prevents it from being added to the specified collection
+ * @throws NullPointerException if the specified collection is null
+ * @throws IllegalArgumentException if the specified collection is this
+ * queue, or some property of an element of this queue prevents
+ * it from being added to the specified collection
+ */
+ int drainTo(Collection<? super E> c);
+
+ /**
+ * Removes at most the given number of available elements from
+ * this queue and adds them to the given collection. A failure
+ * encountered while attempting to add elements to
+ * collection <tt>c</tt> may result in elements being in neither,
+ * either or both collections when the associated exception is
+ * thrown. Attempts to drain a queue to itself result in
+ * <tt>IllegalArgumentException</tt>. Further, the behavior of
+ * this operation is undefined if the specified collection is
+ * modified while the operation is in progress.
+ *
+ * @param c the collection to transfer elements into
+ * @param maxElements the maximum number of elements to transfer
+ * @return the number of elements transferred
+ * @throws UnsupportedOperationException if addition of elements
+ * is not supported by the specified collection
+ * @throws ClassCastException if the class of an element of this queue
+ * prevents it from being added to the specified collection
+ * @throws NullPointerException if the specified collection is null
+ * @throws IllegalArgumentException if the specified collection is this
+ * queue, or some property of an element of this queue prevents
+ * it from being added to the specified collection
+ */
+ int drainTo(Collection<? super E> c, int maxElements);
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/BrokenBarrierException.java b/libjava/classpath/external/jsr166/java/util/concurrent/BrokenBarrierException.java
new file mode 100644
index 00000000000..3f93fbb9dc4
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/BrokenBarrierException.java
@@ -0,0 +1,38 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * Exception thrown when a thread tries to wait upon a barrier that is
+ * in a broken state, or which enters the broken state while the thread
+ * is waiting.
+ *
+ * @see CyclicBarrier
+ *
+ * @since 1.5
+ * @author Doug Lea
+ *
+ */
+public class BrokenBarrierException extends Exception {
+ private static final long serialVersionUID = 7117394618823254244L;
+
+ /**
+ * Constructs a <tt>BrokenBarrierException</tt> with no specified detail
+ * message.
+ */
+ public BrokenBarrierException() {}
+
+ /**
+ * Constructs a <tt>BrokenBarrierException</tt> with the specified
+ * detail message.
+ *
+ * @param message the detail message
+ */
+ public BrokenBarrierException(String message) {
+ super(message);
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/Callable.java b/libjava/classpath/external/jsr166/java/util/concurrent/Callable.java
new file mode 100644
index 00000000000..abc4d04075a
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/Callable.java
@@ -0,0 +1,36 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * A task that returns a result and may throw an exception.
+ * Implementors define a single method with no arguments called
+ * <tt>call</tt>.
+ *
+ * <p>The <tt>Callable</tt> interface is similar to {@link
+ * java.lang.Runnable}, in that both are designed for classes whose
+ * instances are potentially executed by another thread. A
+ * <tt>Runnable</tt>, however, does not return a result and cannot
+ * throw a checked exception.
+ *
+ * <p> The {@link Executors} class contains utility methods to
+ * convert from other common forms to <tt>Callable</tt> classes.
+ *
+ * @see Executor
+ * @since 1.5
+ * @author Doug Lea
+ * @param <V> the result type of method <tt>call</tt>
+ */
+public interface Callable<V> {
+ /**
+ * Computes a result, or throws an exception if unable to do so.
+ *
+ * @return computed result
+ * @throws Exception if unable to compute a result
+ */
+ V call() throws Exception;
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/CancellationException.java b/libjava/classpath/external/jsr166/java/util/concurrent/CancellationException.java
new file mode 100644
index 00000000000..2c29544a0ea
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/CancellationException.java
@@ -0,0 +1,34 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * Exception indicating that the result of a value-producing task,
+ * such as a {@link FutureTask}, cannot be retrieved because the task
+ * was cancelled.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public class CancellationException extends IllegalStateException {
+ private static final long serialVersionUID = -9202173006928992231L;
+
+ /**
+ * Constructs a <tt>CancellationException</tt> with no detail message.
+ */
+ public CancellationException() {}
+
+ /**
+ * Constructs a <tt>CancellationException</tt> with the specified detail
+ * message.
+ *
+ * @param message the detail message
+ */
+ public CancellationException(String message) {
+ super(message);
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/CompletionService.java b/libjava/classpath/external/jsr166/java/util/concurrent/CompletionService.java
new file mode 100644
index 00000000000..df9f719c49d
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/CompletionService.java
@@ -0,0 +1,97 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * A service that decouples the production of new asynchronous tasks
+ * from the consumption of the results of completed tasks. Producers
+ * <tt>submit</tt> tasks for execution. Consumers <tt>take</tt>
+ * completed tasks and process their results in the order they
+ * complete. A <tt>CompletionService</tt> can for example be used to
+ * manage asynchronous IO, in which tasks that perform reads are
+ * submitted in one part of a program or system, and then acted upon
+ * in a different part of the program when the reads complete,
+ * possibly in a different order than they were requested.
+ *
+ * <p>Typically, a <tt>CompletionService</tt> relies on a separate
+ * {@link Executor} to actually execute the tasks, in which case the
+ * <tt>CompletionService</tt> only manages an internal completion
+ * queue. The {@link ExecutorCompletionService} class provides an
+ * implementation of this approach.
+ *
+ * <p>Memory consistency effects: Actions in a thread prior to
+ * submitting a task to a {@code CompletionService}
+ * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
+ * actions taken by that task, which in turn <i>happen-before</i>
+ * actions following a successful return from the corresponding {@code take()}.
+ *
+ */
+public interface CompletionService<V> {
+ /**
+ * Submits a value-returning task for execution and returns a Future
+ * representing the pending results of the task. Upon completion,
+ * this task may be taken or polled.
+ *
+ * @param task the task to submit
+ * @return a Future representing pending completion of the task
+ * @throws RejectedExecutionException if the task cannot be
+ * scheduled for execution
+ * @throws NullPointerException if the task is null
+ */
+ Future<V> submit(Callable<V> task);
+
+ /**
+ * Submits a Runnable task for execution and returns a Future
+ * representing that task. Upon completion, this task may be
+ * taken or polled.
+ *
+ * @param task the task to submit
+ * @param result the result to return upon successful completion
+ * @return a Future representing pending completion of the task,
+ * and whose <tt>get()</tt> method will return the given
+ * result value upon completion
+ * @throws RejectedExecutionException if the task cannot be
+ * scheduled for execution
+ * @throws NullPointerException if the task is null
+ */
+ Future<V> submit(Runnable task, V result);
+
+ /**
+ * Retrieves and removes the Future representing the next
+ * completed task, waiting if none are yet present.
+ *
+ * @return the Future representing the next completed task
+ * @throws InterruptedException if interrupted while waiting
+ */
+ Future<V> take() throws InterruptedException;
+
+
+ /**
+ * Retrieves and removes the Future representing the next
+ * completed task or <tt>null</tt> if none are present.
+ *
+ * @return the Future representing the next completed task, or
+ * <tt>null</tt> if none are present
+ */
+ Future<V> poll();
+
+ /**
+ * Retrieves and removes the Future representing the next
+ * completed task, waiting if necessary up to the specified wait
+ * time if none are yet present.
+ *
+ * @param timeout how long to wait before giving up, in units of
+ * <tt>unit</tt>
+ * @param unit a <tt>TimeUnit</tt> determining how to interpret the
+ * <tt>timeout</tt> parameter
+ * @return the Future representing the next completed task or
+ * <tt>null</tt> if the specified waiting time elapses
+ * before one is present
+ * @throws InterruptedException if interrupted while waiting
+ */
+ Future<V> poll(long timeout, TimeUnit unit) throws InterruptedException;
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentHashMap.java b/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentHashMap.java
new file mode 100644
index 00000000000..7f6d4493c06
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentHashMap.java
@@ -0,0 +1,1277 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.concurrent.locks.*;
+import java.util.*;
+import java.io.Serializable;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+/**
+ * A hash table supporting full concurrency of retrievals and
+ * adjustable expected concurrency for updates. This class obeys the
+ * same functional specification as {@link java.util.Hashtable}, and
+ * includes versions of methods corresponding to each method of
+ * <tt>Hashtable</tt>. However, even though all operations are
+ * thread-safe, retrieval operations do <em>not</em> entail locking,
+ * and there is <em>not</em> any support for locking the entire table
+ * in a way that prevents all access. This class is fully
+ * interoperable with <tt>Hashtable</tt> in programs that rely on its
+ * thread safety but not on its synchronization details.
+ *
+ * <p> Retrieval operations (including <tt>get</tt>) generally do not
+ * block, so may overlap with update operations (including
+ * <tt>put</tt> and <tt>remove</tt>). Retrievals reflect the results
+ * of the most recently <em>completed</em> update operations holding
+ * upon their onset. For aggregate operations such as <tt>putAll</tt>
+ * and <tt>clear</tt>, concurrent retrievals may reflect insertion or
+ * removal of only some entries. Similarly, Iterators and
+ * Enumerations return elements reflecting the state of the hash table
+ * at some point at or since the creation of the iterator/enumeration.
+ * They do <em>not</em> throw {@link ConcurrentModificationException}.
+ * However, iterators are designed to be used by only one thread at a time.
+ *
+ * <p> The allowed concurrency among update operations is guided by
+ * the optional <tt>concurrencyLevel</tt> constructor argument
+ * (default <tt>16</tt>), which is used as a hint for internal sizing. The
+ * table is internally partitioned to try to permit the indicated
+ * number of concurrent updates without contention. Because placement
+ * in hash tables is essentially random, the actual concurrency will
+ * vary. Ideally, you should choose a value to accommodate as many
+ * threads as will ever concurrently modify the table. Using a
+ * significantly higher value than you need can waste space and time,
+ * and a significantly lower value can lead to thread contention. But
+ * overestimates and underestimates within an order of magnitude do
+ * not usually have much noticeable impact. A value of one is
+ * appropriate when it is known that only one thread will modify and
+ * all others will only read. Also, resizing this or any other kind of
+ * hash table is a relatively slow operation, so, when possible, it is
+ * a good idea to provide estimates of expected table sizes in
+ * constructors.
+ *
+ * <p>This class and its views and iterators implement all of the
+ * <em>optional</em> methods of the {@link Map} and {@link Iterator}
+ * interfaces.
+ *
+ * <p> Like {@link Hashtable} but unlike {@link HashMap}, this class
+ * does <em>not</em> allow <tt>null</tt> to be used as a key or value.
+ *
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <K> the type of keys maintained by this map
+ * @param <V> the type of mapped values
+ */
+public class ConcurrentHashMap<K, V> extends AbstractMap<K, V>
+ implements ConcurrentMap<K, V>, Serializable {
+ private static final long serialVersionUID = 7249069246763182397L;
+
+ /*
+ * The basic strategy is to subdivide the table among Segments,
+ * each of which itself is a concurrently readable hash table.
+ */
+
+ /* ---------------- Constants -------------- */
+
+ /**
+ * The default initial capacity for this table,
+ * used when not otherwise specified in a constructor.
+ */
+ static final int DEFAULT_INITIAL_CAPACITY = 16;
+
+ /**
+ * The default load factor for this table, used when not
+ * otherwise specified in a constructor.
+ */
+ static final float DEFAULT_LOAD_FACTOR = 0.75f;
+
+ /**
+ * The default concurrency level for this table, used when not
+ * otherwise specified in a constructor.
+ */
+ static final int DEFAULT_CONCURRENCY_LEVEL = 16;
+
+ /**
+ * The maximum capacity, used if a higher value is implicitly
+ * specified by either of the constructors with arguments. MUST
+ * be a power of two <= 1<<30 to ensure that entries are indexable
+ * using ints.
+ */
+ static final int MAXIMUM_CAPACITY = 1 << 30;
+
+ /**
+ * The maximum number of segments to allow; used to bound
+ * constructor arguments.
+ */
+ static final int MAX_SEGMENTS = 1 << 16; // slightly conservative
+
+ /**
+ * Number of unsynchronized retries in size and containsValue
+ * methods before resorting to locking. This is used to avoid
+ * unbounded retries if tables undergo continuous modification
+ * which would make it impossible to obtain an accurate result.
+ */
+ static final int RETRIES_BEFORE_LOCK = 2;
+
+ /* ---------------- Fields -------------- */
+
+ /**
+ * Mask value for indexing into segments. The upper bits of a
+ * key's hash code are used to choose the segment.
+ */
+ final int segmentMask;
+
+ /**
+ * Shift value for indexing within segments.
+ */
+ final int segmentShift;
+
+ /**
+ * The segments, each of which is a specialized hash table
+ */
+ final Segment<K,V>[] segments;
+
+ transient Set<K> keySet;
+ transient Set<Map.Entry<K,V>> entrySet;
+ transient Collection<V> values;
+
+ /* ---------------- Small Utilities -------------- */
+
+ /**
+ * Applies a supplemental hash function to a given hashCode, which
+ * defends against poor quality hash functions. This is critical
+ * because ConcurrentHashMap uses power-of-two length hash tables,
+ * that otherwise encounter collisions for hashCodes that do not
+ * differ in lower bits.
+ */
+ private static int hash(int h) {
+ // This function ensures that hashCodes that differ only by
+ // constant multiples at each bit position have a bounded
+ // number of collisions (approximately 8 at default load factor).
+ h ^= (h >>> 20) ^ (h >>> 12);
+ return h ^ (h >>> 7) ^ (h >>> 4);
+ }
+
+ /**
+ * Returns the segment that should be used for key with given hash
+ * @param hash the hash code for the key
+ * @return the segment
+ */
+ final Segment<K,V> segmentFor(int hash) {
+ return segments[(hash >>> segmentShift) & segmentMask];
+ }
+
+ /* ---------------- Inner Classes -------------- */
+
+ /**
+ * ConcurrentHashMap list entry. Note that this is never exported
+ * out as a user-visible Map.Entry.
+ *
+ * Because the value field is volatile, not final, it is legal wrt
+ * the Java Memory Model for an unsynchronized reader to see null
+ * instead of initial value when read via a data race. Although a
+ * reordering leading to this is not likely to ever actually
+ * occur, the Segment.readValueUnderLock method is used as a
+ * backup in case a null (pre-initialized) value is ever seen in
+ * an unsynchronized access method.
+ */
+ static final class HashEntry<K,V> {
+ final K key;
+ final int hash;
+ volatile V value;
+ final HashEntry<K,V> next;
+
+ HashEntry(K key, int hash, HashEntry<K,V> next, V value) {
+ this.key = key;
+ this.hash = hash;
+ this.next = next;
+ this.value = value;
+ }
+
+ @SuppressWarnings("unchecked")
+ static final <K,V> HashEntry<K,V>[] newArray(int i) {
+ return new HashEntry[i];
+ }
+ }
+
+ /**
+ * Segments are specialized versions of hash tables. This
+ * subclasses from ReentrantLock opportunistically, just to
+ * simplify some locking and avoid separate construction.
+ */
+ static final class Segment<K,V> extends ReentrantLock implements Serializable {
+ /*
+ * Segments maintain a table of entry lists that are ALWAYS
+ * kept in a consistent state, so can be read without locking.
+ * Next fields of nodes are immutable (final). All list
+ * additions are performed at the front of each bin. This
+ * makes it easy to check changes, and also fast to traverse.
+ * When nodes would otherwise be changed, new nodes are
+ * created to replace them. This works well for hash tables
+ * since the bin lists tend to be short. (The average length
+ * is less than two for the default load factor threshold.)
+ *
+ * Read operations can thus proceed without locking, but rely
+ * on selected uses of volatiles to ensure that completed
+ * write operations performed by other threads are
+ * noticed. For most purposes, the "count" field, tracking the
+ * number of elements, serves as that volatile variable
+ * ensuring visibility. This is convenient because this field
+ * needs to be read in many read operations anyway:
+ *
+ * - All (unsynchronized) read operations must first read the
+ * "count" field, and should not look at table entries if
+ * it is 0.
+ *
+ * - All (synchronized) write operations should write to
+ * the "count" field after structurally changing any bin.
+ * The operations must not take any action that could even
+ * momentarily cause a concurrent read operation to see
+ * inconsistent data. This is made easier by the nature of
+ * the read operations in Map. For example, no operation
+ * can reveal that the table has grown but the threshold
+ * has not yet been updated, so there are no atomicity
+ * requirements for this with respect to reads.
+ *
+ * As a guide, all critical volatile reads and writes to the
+ * count field are marked in code comments.
+ */
+
+ private static final long serialVersionUID = 2249069246763182397L;
+
+ /**
+ * The number of elements in this segment's region.
+ */
+ transient volatile int count;
+
+ /**
+ * Number of updates that alter the size of the table. This is
+ * used during bulk-read methods to make sure they see a
+ * consistent snapshot: If modCounts change during a traversal
+ * of segments computing size or checking containsValue, then
+ * we might have an inconsistent view of state so (usually)
+ * must retry.
+ */
+ transient int modCount;
+
+ /**
+ * The table is rehashed when its size exceeds this threshold.
+ * (The value of this field is always <tt>(int)(capacity *
+ * loadFactor)</tt>.)
+ */
+ transient int threshold;
+
+ /**
+ * The per-segment table.
+ */
+ transient volatile HashEntry<K,V>[] table;
+
+ /**
+ * The load factor for the hash table. Even though this value
+ * is same for all segments, it is replicated to avoid needing
+ * links to outer object.
+ * @serial
+ */
+ final float loadFactor;
+
+ Segment(int initialCapacity, float lf) {
+ loadFactor = lf;
+ setTable(HashEntry.<K,V>newArray(initialCapacity));
+ }
+
+ @SuppressWarnings("unchecked")
+ static final <K,V> Segment<K,V>[] newArray(int i) {
+ return new Segment[i];
+ }
+
+ /**
+ * Sets table to new HashEntry array.
+ * Call only while holding lock or in constructor.
+ */
+ void setTable(HashEntry<K,V>[] newTable) {
+ threshold = (int)(newTable.length * loadFactor);
+ table = newTable;
+ }
+
+ /**
+ * Returns properly casted first entry of bin for given hash.
+ */
+ HashEntry<K,V> getFirst(int hash) {
+ HashEntry<K,V>[] tab = table;
+ return tab[hash & (tab.length - 1)];
+ }
+
+ /**
+ * Reads value field of an entry under lock. Called if value
+ * field ever appears to be null. This is possible only if a
+ * compiler happens to reorder a HashEntry initialization with
+ * its table assignment, which is legal under memory model
+ * but is not known to ever occur.
+ */
+ V readValueUnderLock(HashEntry<K,V> e) {
+ lock();
+ try {
+ return e.value;
+ } finally {
+ unlock();
+ }
+ }
+
+ /* Specialized implementations of map methods */
+
+ V get(Object key, int hash) {
+ if (count != 0) { // read-volatile
+ HashEntry<K,V> e = getFirst(hash);
+ while (e != null) {
+ if (e.hash == hash && key.equals(e.key)) {
+ V v = e.value;
+ if (v != null)
+ return v;
+ return readValueUnderLock(e); // recheck
+ }
+ e = e.next;
+ }
+ }
+ return null;
+ }
+
+ boolean containsKey(Object key, int hash) {
+ if (count != 0) { // read-volatile
+ HashEntry<K,V> e = getFirst(hash);
+ while (e != null) {
+ if (e.hash == hash && key.equals(e.key))
+ return true;
+ e = e.next;
+ }
+ }
+ return false;
+ }
+
+ boolean containsValue(Object value) {
+ if (count != 0) { // read-volatile
+ HashEntry<K,V>[] tab = table;
+ int len = tab.length;
+ for (int i = 0 ; i < len; i++) {
+ for (HashEntry<K,V> e = tab[i]; e != null; e = e.next) {
+ V v = e.value;
+ if (v == null) // recheck
+ v = readValueUnderLock(e);
+ if (value.equals(v))
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ boolean replace(K key, int hash, V oldValue, V newValue) {
+ lock();
+ try {
+ HashEntry<K,V> e = getFirst(hash);
+ while (e != null && (e.hash != hash || !key.equals(e.key)))
+ e = e.next;
+
+ boolean replaced = false;
+ if (e != null && oldValue.equals(e.value)) {
+ replaced = true;
+ e.value = newValue;
+ }
+ return replaced;
+ } finally {
+ unlock();
+ }
+ }
+
+ V replace(K key, int hash, V newValue) {
+ lock();
+ try {
+ HashEntry<K,V> e = getFirst(hash);
+ while (e != null && (e.hash != hash || !key.equals(e.key)))
+ e = e.next;
+
+ V oldValue = null;
+ if (e != null) {
+ oldValue = e.value;
+ e.value = newValue;
+ }
+ return oldValue;
+ } finally {
+ unlock();
+ }
+ }
+
+
+ V put(K key, int hash, V value, boolean onlyIfAbsent) {
+ lock();
+ try {
+ int c = count;
+ if (c++ > threshold) // ensure capacity
+ rehash();
+ HashEntry<K,V>[] tab = table;
+ int index = hash & (tab.length - 1);
+ HashEntry<K,V> first = tab[index];
+ HashEntry<K,V> e = first;
+ while (e != null && (e.hash != hash || !key.equals(e.key)))
+ e = e.next;
+
+ V oldValue;
+ if (e != null) {
+ oldValue = e.value;
+ if (!onlyIfAbsent)
+ e.value = value;
+ }
+ else {
+ oldValue = null;
+ ++modCount;
+ tab[index] = new HashEntry<K,V>(key, hash, first, value);
+ count = c; // write-volatile
+ }
+ return oldValue;
+ } finally {
+ unlock();
+ }
+ }
+
+ void rehash() {
+ HashEntry<K,V>[] oldTable = table;
+ int oldCapacity = oldTable.length;
+ if (oldCapacity >= MAXIMUM_CAPACITY)
+ return;
+
+ /*
+ * Reclassify nodes in each list to new Map. Because we are
+ * using power-of-two expansion, the elements from each bin
+ * must either stay at same index, or move with a power of two
+ * offset. We eliminate unnecessary node creation by catching
+ * cases where old nodes can be reused because their next
+ * fields won't change. Statistically, at the default
+ * threshold, only about one-sixth of them need cloning when
+ * a table doubles. The nodes they replace will be garbage
+ * collectable as soon as they are no longer referenced by any
+ * reader thread that may be in the midst of traversing table
+ * right now.
+ */
+
+ HashEntry<K,V>[] newTable = HashEntry.newArray(oldCapacity<<1);
+ threshold = (int)(newTable.length * loadFactor);
+ int sizeMask = newTable.length - 1;
+ for (int i = 0; i < oldCapacity ; i++) {
+ // We need to guarantee that any existing reads of old Map can
+ // proceed. So we cannot yet null out each bin.
+ HashEntry<K,V> e = oldTable[i];
+
+ if (e != null) {
+ HashEntry<K,V> next = e.next;
+ int idx = e.hash & sizeMask;
+
+ // Single node on list
+ if (next == null)
+ newTable[idx] = e;
+
+ else {
+ // Reuse trailing consecutive sequence at same slot
+ HashEntry<K,V> lastRun = e;
+ int lastIdx = idx;
+ for (HashEntry<K,V> last = next;
+ last != null;
+ last = last.next) {
+ int k = last.hash & sizeMask;
+ if (k != lastIdx) {
+ lastIdx = k;
+ lastRun = last;
+ }
+ }
+ newTable[lastIdx] = lastRun;
+
+ // Clone all remaining nodes
+ for (HashEntry<K,V> p = e; p != lastRun; p = p.next) {
+ int k = p.hash & sizeMask;
+ HashEntry<K,V> n = newTable[k];
+ newTable[k] = new HashEntry<K,V>(p.key, p.hash,
+ n, p.value);
+ }
+ }
+ }
+ }
+ table = newTable;
+ }
+
+ /**
+ * Remove; match on key only if value null, else match both.
+ */
+ V remove(Object key, int hash, Object value) {
+ lock();
+ try {
+ int c = count - 1;
+ HashEntry<K,V>[] tab = table;
+ int index = hash & (tab.length - 1);
+ HashEntry<K,V> first = tab[index];
+ HashEntry<K,V> e = first;
+ while (e != null && (e.hash != hash || !key.equals(e.key)))
+ e = e.next;
+
+ V oldValue = null;
+ if (e != null) {
+ V v = e.value;
+ if (value == null || value.equals(v)) {
+ oldValue = v;
+ // All entries following removed node can stay
+ // in list, but all preceding ones need to be
+ // cloned.
+ ++modCount;
+ HashEntry<K,V> newFirst = e.next;
+ for (HashEntry<K,V> p = first; p != e; p = p.next)
+ newFirst = new HashEntry<K,V>(p.key, p.hash,
+ newFirst, p.value);
+ tab[index] = newFirst;
+ count = c; // write-volatile
+ }
+ }
+ return oldValue;
+ } finally {
+ unlock();
+ }
+ }
+
+ void clear() {
+ if (count != 0) {
+ lock();
+ try {
+ HashEntry<K,V>[] tab = table;
+ for (int i = 0; i < tab.length ; i++)
+ tab[i] = null;
+ ++modCount;
+ count = 0; // write-volatile
+ } finally {
+ unlock();
+ }
+ }
+ }
+ }
+
+
+
+ /* ---------------- Public operations -------------- */
+
+ /**
+ * Creates a new, empty map with the specified initial
+ * capacity, load factor and concurrency level.
+ *
+ * @param initialCapacity the initial capacity. The implementation
+ * performs internal sizing to accommodate this many elements.
+ * @param loadFactor the load factor threshold, used to control resizing.
+ * Resizing may be performed when the average number of elements per
+ * bin exceeds this threshold.
+ * @param concurrencyLevel the estimated number of concurrently
+ * updating threads. The implementation performs internal sizing
+ * to try to accommodate this many threads.
+ * @throws IllegalArgumentException if the initial capacity is
+ * negative or the load factor or concurrencyLevel are
+ * nonpositive.
+ */
+ public ConcurrentHashMap(int initialCapacity,
+ float loadFactor, int concurrencyLevel) {
+ if (!(loadFactor > 0) || initialCapacity < 0 || concurrencyLevel <= 0)
+ throw new IllegalArgumentException();
+
+ if (concurrencyLevel > MAX_SEGMENTS)
+ concurrencyLevel = MAX_SEGMENTS;
+
+ // Find power-of-two sizes best matching arguments
+ int sshift = 0;
+ int ssize = 1;
+ while (ssize < concurrencyLevel) {
+ ++sshift;
+ ssize <<= 1;
+ }
+ segmentShift = 32 - sshift;
+ segmentMask = ssize - 1;
+ this.segments = Segment.newArray(ssize);
+
+ if (initialCapacity > MAXIMUM_CAPACITY)
+ initialCapacity = MAXIMUM_CAPACITY;
+ int c = initialCapacity / ssize;
+ if (c * ssize < initialCapacity)
+ ++c;
+ int cap = 1;
+ while (cap < c)
+ cap <<= 1;
+
+ for (int i = 0; i < this.segments.length; ++i)
+ this.segments[i] = new Segment<K,V>(cap, loadFactor);
+ }
+
+ /**
+ * Creates a new, empty map with the specified initial capacity
+ * and load factor and with the default concurrencyLevel (16).
+ *
+ * @param initialCapacity The implementation performs internal
+ * sizing to accommodate this many elements.
+ * @param loadFactor the load factor threshold, used to control resizing.
+ * Resizing may be performed when the average number of elements per
+ * bin exceeds this threshold.
+ * @throws IllegalArgumentException if the initial capacity of
+ * elements is negative or the load factor is nonpositive
+ *
+ * @since 1.6
+ */
+ public ConcurrentHashMap(int initialCapacity, float loadFactor) {
+ this(initialCapacity, loadFactor, DEFAULT_CONCURRENCY_LEVEL);
+ }
+
+ /**
+ * Creates a new, empty map with the specified initial capacity,
+ * and with default load factor (0.75) and concurrencyLevel (16).
+ *
+ * @param initialCapacity the initial capacity. The implementation
+ * performs internal sizing to accommodate this many elements.
+ * @throws IllegalArgumentException if the initial capacity of
+ * elements is negative.
+ */
+ public ConcurrentHashMap(int initialCapacity) {
+ this(initialCapacity, DEFAULT_LOAD_FACTOR, DEFAULT_CONCURRENCY_LEVEL);
+ }
+
+ /**
+ * Creates a new, empty map with a default initial capacity (16),
+ * load factor (0.75) and concurrencyLevel (16).
+ */
+ public ConcurrentHashMap() {
+ this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_CONCURRENCY_LEVEL);
+ }
+
+ /**
+ * Creates a new map with the same mappings as the given map.
+ * The map is created with a capacity of 1.5 times the number
+ * of mappings in the given map or 16 (whichever is greater),
+ * and a default load factor (0.75) and concurrencyLevel (16).
+ *
+ * @param m the map
+ */
+ public ConcurrentHashMap(Map<? extends K, ? extends V> m) {
+ this(Math.max((int) (m.size() / DEFAULT_LOAD_FACTOR) + 1,
+ DEFAULT_INITIAL_CAPACITY),
+ DEFAULT_LOAD_FACTOR, DEFAULT_CONCURRENCY_LEVEL);
+ putAll(m);
+ }
+
+ /**
+ * Returns <tt>true</tt> if this map contains no key-value mappings.
+ *
+ * @return <tt>true</tt> if this map contains no key-value mappings
+ */
+ public boolean isEmpty() {
+ final Segment<K,V>[] segments = this.segments;
+ /*
+ * We keep track of per-segment modCounts to avoid ABA
+ * problems in which an element in one segment was added and
+ * in another removed during traversal, in which case the
+ * table was never actually empty at any point. Note the
+ * similar use of modCounts in the size() and containsValue()
+ * methods, which are the only other methods also susceptible
+ * to ABA problems.
+ */
+ int[] mc = new int[segments.length];
+ int mcsum = 0;
+ for (int i = 0; i < segments.length; ++i) {
+ if (segments[i].count != 0)
+ return false;
+ else
+ mcsum += mc[i] = segments[i].modCount;
+ }
+ // If mcsum happens to be zero, then we know we got a snapshot
+ // before any modifications at all were made. This is
+ // probably common enough to bother tracking.
+ if (mcsum != 0) {
+ for (int i = 0; i < segments.length; ++i) {
+ if (segments[i].count != 0 ||
+ mc[i] != segments[i].modCount)
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Returns the number of key-value mappings in this map. If the
+ * map contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
+ * <tt>Integer.MAX_VALUE</tt>.
+ *
+ * @return the number of key-value mappings in this map
+ */
+ public int size() {
+ final Segment<K,V>[] segments = this.segments;
+ long sum = 0;
+ long check = 0;
+ int[] mc = new int[segments.length];
+ // Try a few times to get accurate count. On failure due to
+ // continuous async changes in table, resort to locking.
+ for (int k = 0; k < RETRIES_BEFORE_LOCK; ++k) {
+ check = 0;
+ sum = 0;
+ int mcsum = 0;
+ for (int i = 0; i < segments.length; ++i) {
+ sum += segments[i].count;
+ mcsum += mc[i] = segments[i].modCount;
+ }
+ if (mcsum != 0) {
+ for (int i = 0; i < segments.length; ++i) {
+ check += segments[i].count;
+ if (mc[i] != segments[i].modCount) {
+ check = -1; // force retry
+ break;
+ }
+ }
+ }
+ if (check == sum)
+ break;
+ }
+ if (check != sum) { // Resort to locking all segments
+ sum = 0;
+ for (int i = 0; i < segments.length; ++i)
+ segments[i].lock();
+ for (int i = 0; i < segments.length; ++i)
+ sum += segments[i].count;
+ for (int i = 0; i < segments.length; ++i)
+ segments[i].unlock();
+ }
+ if (sum > Integer.MAX_VALUE)
+ return Integer.MAX_VALUE;
+ else
+ return (int)sum;
+ }
+
+ /**
+ * Returns the value to which the specified key is mapped,
+ * or {@code null} if this map contains no mapping for the key.
+ *
+ * <p>More formally, if this map contains a mapping from a key
+ * {@code k} to a value {@code v} such that {@code key.equals(k)},
+ * then this method returns {@code v}; otherwise it returns
+ * {@code null}. (There can be at most one such mapping.)
+ *
+ * @throws NullPointerException if the specified key is null
+ */
+ public V get(Object key) {
+ int hash = hash(key.hashCode());
+ return segmentFor(hash).get(key, hash);
+ }
+
+ /**
+ * Tests if the specified object is a key in this table.
+ *
+ * @param key possible key
+ * @return <tt>true</tt> if and only if the specified object
+ * is a key in this table, as determined by the
+ * <tt>equals</tt> method; <tt>false</tt> otherwise.
+ * @throws NullPointerException if the specified key is null
+ */
+ public boolean containsKey(Object key) {
+ int hash = hash(key.hashCode());
+ return segmentFor(hash).containsKey(key, hash);
+ }
+
+ /**
+ * Returns <tt>true</tt> if this map maps one or more keys to the
+ * specified value. Note: This method requires a full internal
+ * traversal of the hash table, and so is much slower than
+ * method <tt>containsKey</tt>.
+ *
+ * @param value value whose presence in this map is to be tested
+ * @return <tt>true</tt> if this map maps one or more keys to the
+ * specified value
+ * @throws NullPointerException if the specified value is null
+ */
+ public boolean containsValue(Object value) {
+ if (value == null)
+ throw new NullPointerException();
+
+ // See explanation of modCount use above
+
+ final Segment<K,V>[] segments = this.segments;
+ int[] mc = new int[segments.length];
+
+ // Try a few times without locking
+ for (int k = 0; k < RETRIES_BEFORE_LOCK; ++k) {
+ int sum = 0;
+ int mcsum = 0;
+ for (int i = 0; i < segments.length; ++i) {
+ int c = segments[i].count;
+ mcsum += mc[i] = segments[i].modCount;
+ if (segments[i].containsValue(value))
+ return true;
+ }
+ boolean cleanSweep = true;
+ if (mcsum != 0) {
+ for (int i = 0; i < segments.length; ++i) {
+ int c = segments[i].count;
+ if (mc[i] != segments[i].modCount) {
+ cleanSweep = false;
+ break;
+ }
+ }
+ }
+ if (cleanSweep)
+ return false;
+ }
+ // Resort to locking all segments
+ for (int i = 0; i < segments.length; ++i)
+ segments[i].lock();
+ boolean found = false;
+ try {
+ for (int i = 0; i < segments.length; ++i) {
+ if (segments[i].containsValue(value)) {
+ found = true;
+ break;
+ }
+ }
+ } finally {
+ for (int i = 0; i < segments.length; ++i)
+ segments[i].unlock();
+ }
+ return found;
+ }
+
+ /**
+ * Legacy method testing if some key maps into the specified value
+ * in this table. This method is identical in functionality to
+ * {@link #containsValue}, and exists solely to ensure
+ * full compatibility with class {@link java.util.Hashtable},
+ * which supported this method prior to introduction of the
+ * Java Collections framework.
+
+ * @param value a value to search for
+ * @return <tt>true</tt> if and only if some key maps to the
+ * <tt>value</tt> argument in this table as
+ * determined by the <tt>equals</tt> method;
+ * <tt>false</tt> otherwise
+ * @throws NullPointerException if the specified value is null
+ */
+ public boolean contains(Object value) {
+ return containsValue(value);
+ }
+
+ /**
+ * Maps the specified key to the specified value in this table.
+ * Neither the key nor the value can be null.
+ *
+ * <p> The value can be retrieved by calling the <tt>get</tt> method
+ * with a key that is equal to the original key.
+ *
+ * @param key key with which the specified value is to be associated
+ * @param value value to be associated with the specified key
+ * @return the previous value associated with <tt>key</tt>, or
+ * <tt>null</tt> if there was no mapping for <tt>key</tt>
+ * @throws NullPointerException if the specified key or value is null
+ */
+ public V put(K key, V value) {
+ if (value == null)
+ throw new NullPointerException();
+ int hash = hash(key.hashCode());
+ return segmentFor(hash).put(key, hash, value, false);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return the previous value associated with the specified key,
+ * or <tt>null</tt> if there was no mapping for the key
+ * @throws NullPointerException if the specified key or value is null
+ */
+ public V putIfAbsent(K key, V value) {
+ if (value == null)
+ throw new NullPointerException();
+ int hash = hash(key.hashCode());
+ return segmentFor(hash).put(key, hash, value, true);
+ }
+
+ /**
+ * Copies all of the mappings from the specified map to this one.
+ * These mappings replace any mappings that this map had for any of the
+ * keys currently in the specified map.
+ *
+ * @param m mappings to be stored in this map
+ */
+ public void putAll(Map<? extends K, ? extends V> m) {
+ for (Map.Entry<? extends K, ? extends V> e : m.entrySet())
+ put(e.getKey(), e.getValue());
+ }
+
+ /**
+ * Removes the key (and its corresponding value) from this map.
+ * This method does nothing if the key is not in the map.
+ *
+ * @param key the key that needs to be removed
+ * @return the previous value associated with <tt>key</tt>, or
+ * <tt>null</tt> if there was no mapping for <tt>key</tt>
+ * @throws NullPointerException if the specified key is null
+ */
+ public V remove(Object key) {
+ int hash = hash(key.hashCode());
+ return segmentFor(hash).remove(key, hash, null);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @throws NullPointerException if the specified key is null
+ */
+ public boolean remove(Object key, Object value) {
+ int hash = hash(key.hashCode());
+ if (value == null)
+ return false;
+ return segmentFor(hash).remove(key, hash, value) != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @throws NullPointerException if any of the arguments are null
+ */
+ public boolean replace(K key, V oldValue, V newValue) {
+ if (oldValue == null || newValue == null)
+ throw new NullPointerException();
+ int hash = hash(key.hashCode());
+ return segmentFor(hash).replace(key, hash, oldValue, newValue);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return the previous value associated with the specified key,
+ * or <tt>null</tt> if there was no mapping for the key
+ * @throws NullPointerException if the specified key or value is null
+ */
+ public V replace(K key, V value) {
+ if (value == null)
+ throw new NullPointerException();
+ int hash = hash(key.hashCode());
+ return segmentFor(hash).replace(key, hash, value);
+ }
+
+ /**
+ * Removes all of the mappings from this map.
+ */
+ public void clear() {
+ for (int i = 0; i < segments.length; ++i)
+ segments[i].clear();
+ }
+
+ /**
+ * Returns a {@link Set} view of the keys contained in this map.
+ * The set is backed by the map, so changes to the map are
+ * reflected in the set, and vice-versa. The set supports element
+ * removal, which removes the corresponding mapping from this map,
+ * via the <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
+ * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt>
+ * operations. It does not support the <tt>add</tt> or
+ * <tt>addAll</tt> operations.
+ *
+ * <p>The view's <tt>iterator</tt> is a "weakly consistent" iterator
+ * that will never throw {@link ConcurrentModificationException},
+ * and guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed to)
+ * reflect any modifications subsequent to construction.
+ */
+ public Set<K> keySet() {
+ Set<K> ks = keySet;
+ return (ks != null) ? ks : (keySet = new KeySet());
+ }
+
+ /**
+ * Returns a {@link Collection} view of the values contained in this map.
+ * The collection is backed by the map, so changes to the map are
+ * reflected in the collection, and vice-versa. The collection
+ * supports element removal, which removes the corresponding
+ * mapping from this map, via the <tt>Iterator.remove</tt>,
+ * <tt>Collection.remove</tt>, <tt>removeAll</tt>,
+ * <tt>retainAll</tt>, and <tt>clear</tt> operations. It does not
+ * support the <tt>add</tt> or <tt>addAll</tt> operations.
+ *
+ * <p>The view's <tt>iterator</tt> is a "weakly consistent" iterator
+ * that will never throw {@link ConcurrentModificationException},
+ * and guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed to)
+ * reflect any modifications subsequent to construction.
+ */
+ public Collection<V> values() {
+ Collection<V> vs = values;
+ return (vs != null) ? vs : (values = new Values());
+ }
+
+ /**
+ * Returns a {@link Set} view of the mappings contained in this map.
+ * The set is backed by the map, so changes to the map are
+ * reflected in the set, and vice-versa. The set supports element
+ * removal, which removes the corresponding mapping from the map,
+ * via the <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
+ * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt>
+ * operations. It does not support the <tt>add</tt> or
+ * <tt>addAll</tt> operations.
+ *
+ * <p>The view's <tt>iterator</tt> is a "weakly consistent" iterator
+ * that will never throw {@link ConcurrentModificationException},
+ * and guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed to)
+ * reflect any modifications subsequent to construction.
+ */
+ public Set<Map.Entry<K,V>> entrySet() {
+ Set<Map.Entry<K,V>> es = entrySet;
+ return (es != null) ? es : (entrySet = new EntrySet());
+ }
+
+ /**
+ * Returns an enumeration of the keys in this table.
+ *
+ * @return an enumeration of the keys in this table
+ * @see #keySet
+ */
+ public Enumeration<K> keys() {
+ return new KeyIterator();
+ }
+
+ /**
+ * Returns an enumeration of the values in this table.
+ *
+ * @return an enumeration of the values in this table
+ * @see #values
+ */
+ public Enumeration<V> elements() {
+ return new ValueIterator();
+ }
+
+ /* ---------------- Iterator Support -------------- */
+
+ abstract class HashIterator {
+ int nextSegmentIndex;
+ int nextTableIndex;
+ HashEntry<K,V>[] currentTable;
+ HashEntry<K, V> nextEntry;
+ HashEntry<K, V> lastReturned;
+
+ HashIterator() {
+ nextSegmentIndex = segments.length - 1;
+ nextTableIndex = -1;
+ advance();
+ }
+
+ public boolean hasMoreElements() { return hasNext(); }
+
+ final void advance() {
+ if (nextEntry != null && (nextEntry = nextEntry.next) != null)
+ return;
+
+ while (nextTableIndex >= 0) {
+ if ( (nextEntry = currentTable[nextTableIndex--]) != null)
+ return;
+ }
+
+ while (nextSegmentIndex >= 0) {
+ Segment<K,V> seg = segments[nextSegmentIndex--];
+ if (seg.count != 0) {
+ currentTable = seg.table;
+ for (int j = currentTable.length - 1; j >= 0; --j) {
+ if ( (nextEntry = currentTable[j]) != null) {
+ nextTableIndex = j - 1;
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ public boolean hasNext() { return nextEntry != null; }
+
+ HashEntry<K,V> nextEntry() {
+ if (nextEntry == null)
+ throw new NoSuchElementException();
+ lastReturned = nextEntry;
+ advance();
+ return lastReturned;
+ }
+
+ public void remove() {
+ if (lastReturned == null)
+ throw new IllegalStateException();
+ ConcurrentHashMap.this.remove(lastReturned.key);
+ lastReturned = null;
+ }
+ }
+
+ final class KeyIterator
+ extends HashIterator
+ implements Iterator<K>, Enumeration<K>
+ {
+ public K next() { return super.nextEntry().key; }
+ public K nextElement() { return super.nextEntry().key; }
+ }
+
+ final class ValueIterator
+ extends HashIterator
+ implements Iterator<V>, Enumeration<V>
+ {
+ public V next() { return super.nextEntry().value; }
+ public V nextElement() { return super.nextEntry().value; }
+ }
+
+ /**
+ * Custom Entry class used by EntryIterator.next(), that relays
+ * setValue changes to the underlying map.
+ */
+ final class WriteThroughEntry
+ extends AbstractMap.SimpleEntry<K,V>
+ {
+ WriteThroughEntry(K k, V v) {
+ super(k,v);
+ }
+
+ /**
+ * Set our entry's value and write through to the map. The
+ * value to return is somewhat arbitrary here. Since a
+ * WriteThroughEntry does not necessarily track asynchronous
+ * changes, the most recent "previous" value could be
+ * different from what we return (or could even have been
+ * removed in which case the put will re-establish). We do not
+ * and cannot guarantee more.
+ */
+ public V setValue(V value) {
+ if (value == null) throw new NullPointerException();
+ V v = super.setValue(value);
+ ConcurrentHashMap.this.put(getKey(), value);
+ return v;
+ }
+ }
+
+ final class EntryIterator
+ extends HashIterator
+ implements Iterator<Entry<K,V>>
+ {
+ public Map.Entry<K,V> next() {
+ HashEntry<K,V> e = super.nextEntry();
+ return new WriteThroughEntry(e.key, e.value);
+ }
+ }
+
+ final class KeySet extends AbstractSet<K> {
+ public Iterator<K> iterator() {
+ return new KeyIterator();
+ }
+ public int size() {
+ return ConcurrentHashMap.this.size();
+ }
+ public boolean contains(Object o) {
+ return ConcurrentHashMap.this.containsKey(o);
+ }
+ public boolean remove(Object o) {
+ return ConcurrentHashMap.this.remove(o) != null;
+ }
+ public void clear() {
+ ConcurrentHashMap.this.clear();
+ }
+ }
+
+ final class Values extends AbstractCollection<V> {
+ public Iterator<V> iterator() {
+ return new ValueIterator();
+ }
+ public int size() {
+ return ConcurrentHashMap.this.size();
+ }
+ public boolean contains(Object o) {
+ return ConcurrentHashMap.this.containsValue(o);
+ }
+ public void clear() {
+ ConcurrentHashMap.this.clear();
+ }
+ }
+
+ final class EntrySet extends AbstractSet<Map.Entry<K,V>> {
+ public Iterator<Map.Entry<K,V>> iterator() {
+ return new EntryIterator();
+ }
+ public boolean contains(Object o) {
+ if (!(o instanceof Map.Entry))
+ return false;
+ Map.Entry<?,?> e = (Map.Entry<?,?>)o;
+ V v = ConcurrentHashMap.this.get(e.getKey());
+ return v != null && v.equals(e.getValue());
+ }
+ public boolean remove(Object o) {
+ if (!(o instanceof Map.Entry))
+ return false;
+ Map.Entry<?,?> e = (Map.Entry<?,?>)o;
+ return ConcurrentHashMap.this.remove(e.getKey(), e.getValue());
+ }
+ public int size() {
+ return ConcurrentHashMap.this.size();
+ }
+ public void clear() {
+ ConcurrentHashMap.this.clear();
+ }
+ }
+
+ /* ---------------- Serialization Support -------------- */
+
+ /**
+ * Save the state of the <tt>ConcurrentHashMap</tt> instance to a
+ * stream (i.e., serialize it).
+ * @param s the stream
+ * @serialData
+ * the key (Object) and value (Object)
+ * for each key-value mapping, followed by a null pair.
+ * The key-value mappings are emitted in no particular order.
+ */
+ private void writeObject(java.io.ObjectOutputStream s) throws IOException {
+ s.defaultWriteObject();
+
+ for (int k = 0; k < segments.length; ++k) {
+ Segment<K,V> seg = segments[k];
+ seg.lock();
+ try {
+ HashEntry<K,V>[] tab = seg.table;
+ for (int i = 0; i < tab.length; ++i) {
+ for (HashEntry<K,V> e = tab[i]; e != null; e = e.next) {
+ s.writeObject(e.key);
+ s.writeObject(e.value);
+ }
+ }
+ } finally {
+ seg.unlock();
+ }
+ }
+ s.writeObject(null);
+ s.writeObject(null);
+ }
+
+ /**
+ * Reconstitute the <tt>ConcurrentHashMap</tt> instance from a
+ * stream (i.e., deserialize it).
+ * @param s the stream
+ */
+ private void readObject(java.io.ObjectInputStream s)
+ throws IOException, ClassNotFoundException {
+ s.defaultReadObject();
+
+ // Initialize each segment to be minimally sized, and let grow.
+ for (int i = 0; i < segments.length; ++i) {
+ segments[i].setTable(new HashEntry[1]);
+ }
+
+ // Read the keys and values, and put the mappings in the table
+ for (;;) {
+ K key = (K) s.readObject();
+ V value = (V) s.readObject();
+ if (key == null)
+ break;
+ put(key, value);
+ }
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentLinkedQueue.java b/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentLinkedQueue.java
new file mode 100644
index 00000000000..000f4a4c93a
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentLinkedQueue.java
@@ -0,0 +1,480 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.*;
+import java.util.concurrent.atomic.*;
+
+
+/**
+ * An unbounded thread-safe {@linkplain Queue queue} based on linked nodes.
+ * This queue orders elements FIFO (first-in-first-out).
+ * The <em>head</em> of the queue is that element that has been on the
+ * queue the longest time.
+ * The <em>tail</em> of the queue is that element that has been on the
+ * queue the shortest time. New elements
+ * are inserted at the tail of the queue, and the queue retrieval
+ * operations obtain elements at the head of the queue.
+ * A <tt>ConcurrentLinkedQueue</tt> is an appropriate choice when
+ * many threads will share access to a common collection.
+ * This queue does not permit <tt>null</tt> elements.
+ *
+ * <p>This implementation employs an efficient &quot;wait-free&quot;
+ * algorithm based on one described in <a
+ * href="http://www.cs.rochester.edu/u/michael/PODC96.html"> Simple,
+ * Fast, and Practical Non-Blocking and Blocking Concurrent Queue
+ * Algorithms</a> by Maged M. Michael and Michael L. Scott.
+ *
+ * <p>Beware that, unlike in most collections, the <tt>size</tt> method
+ * is <em>NOT</em> a constant-time operation. Because of the
+ * asynchronous nature of these queues, determining the current number
+ * of elements requires a traversal of the elements.
+ *
+ * <p>This class and its iterator implement all of the
+ * <em>optional</em> methods of the {@link Collection} and {@link
+ * Iterator} interfaces.
+ *
+ * <p>Memory consistency effects: As with other concurrent
+ * collections, actions in a thread prior to placing an object into a
+ * {@code ConcurrentLinkedQueue}
+ * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
+ * actions subsequent to the access or removal of that element from
+ * the {@code ConcurrentLinkedQueue} in another thread.
+ *
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <E> the type of elements held in this collection
+ *
+ */
+public class ConcurrentLinkedQueue<E> extends AbstractQueue<E>
+ implements Queue<E>, java.io.Serializable {
+ private static final long serialVersionUID = 196745693267521676L;
+
+ /*
+ * This is a straight adaptation of Michael & Scott algorithm.
+ * For explanation, read the paper. The only (minor) algorithmic
+ * difference is that this version supports lazy deletion of
+ * internal nodes (method remove(Object)) -- remove CAS'es item
+ * fields to null. The normal queue operations unlink but then
+ * pass over nodes with null item fields. Similarly, iteration
+ * methods ignore those with nulls.
+ *
+ * Also note that like most non-blocking algorithms in this
+ * package, this implementation relies on the fact that in garbage
+ * collected systems, there is no possibility of ABA problems due
+ * to recycled nodes, so there is no need to use "counted
+ * pointers" or related techniques seen in versions used in
+ * non-GC'ed settings.
+ */
+
+ private static class Node<E> {
+ private volatile E item;
+ private volatile Node<E> next;
+
+ private static final
+ AtomicReferenceFieldUpdater<Node, Node>
+ nextUpdater =
+ AtomicReferenceFieldUpdater.newUpdater
+ (Node.class, Node.class, "next");
+ private static final
+ AtomicReferenceFieldUpdater<Node, Object>
+ itemUpdater =
+ AtomicReferenceFieldUpdater.newUpdater
+ (Node.class, Object.class, "item");
+
+ Node(E x) { item = x; }
+
+ Node(E x, Node<E> n) { item = x; next = n; }
+
+ E getItem() {
+ return item;
+ }
+
+ boolean casItem(E cmp, E val) {
+ return itemUpdater.compareAndSet(this, cmp, val);
+ }
+
+ void setItem(E val) {
+ itemUpdater.set(this, val);
+ }
+
+ Node<E> getNext() {
+ return next;
+ }
+
+ boolean casNext(Node<E> cmp, Node<E> val) {
+ return nextUpdater.compareAndSet(this, cmp, val);
+ }
+
+ void setNext(Node<E> val) {
+ nextUpdater.set(this, val);
+ }
+
+ }
+
+ private static final
+ AtomicReferenceFieldUpdater<ConcurrentLinkedQueue, Node>
+ tailUpdater =
+ AtomicReferenceFieldUpdater.newUpdater
+ (ConcurrentLinkedQueue.class, Node.class, "tail");
+ private static final
+ AtomicReferenceFieldUpdater<ConcurrentLinkedQueue, Node>
+ headUpdater =
+ AtomicReferenceFieldUpdater.newUpdater
+ (ConcurrentLinkedQueue.class, Node.class, "head");
+
+ private boolean casTail(Node<E> cmp, Node<E> val) {
+ return tailUpdater.compareAndSet(this, cmp, val);
+ }
+
+ private boolean casHead(Node<E> cmp, Node<E> val) {
+ return headUpdater.compareAndSet(this, cmp, val);
+ }
+
+
+ /**
+ * Pointer to header node, initialized to a dummy node. The first
+ * actual node is at head.getNext().
+ */
+ private transient volatile Node<E> head = new Node<E>(null, null);
+
+ /** Pointer to last node on list **/
+ private transient volatile Node<E> tail = head;
+
+
+ /**
+ * Creates a <tt>ConcurrentLinkedQueue</tt> that is initially empty.
+ */
+ public ConcurrentLinkedQueue() {}
+
+ /**
+ * Creates a <tt>ConcurrentLinkedQueue</tt>
+ * initially containing the elements of the given collection,
+ * added in traversal order of the collection's iterator.
+ * @param c the collection of elements to initially contain
+ * @throws NullPointerException if the specified collection or any
+ * of its elements are null
+ */
+ public ConcurrentLinkedQueue(Collection<? extends E> c) {
+ for (Iterator<? extends E> it = c.iterator(); it.hasNext();)
+ add(it.next());
+ }
+
+ // Have to override just to update the javadoc
+
+ /**
+ * Inserts the specified element at the tail of this queue.
+ *
+ * @return <tt>true</tt> (as specified by {@link Collection#add})
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean add(E e) {
+ return offer(e);
+ }
+
+ /**
+ * Inserts the specified element at the tail of this queue.
+ *
+ * @return <tt>true</tt> (as specified by {@link Queue#offer})
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean offer(E e) {
+ if (e == null) throw new NullPointerException();
+ Node<E> n = new Node<E>(e, null);
+ for (;;) {
+ Node<E> t = tail;
+ Node<E> s = t.getNext();
+ if (t == tail) {
+ if (s == null) {
+ if (t.casNext(s, n)) {
+ casTail(t, n);
+ return true;
+ }
+ } else {
+ casTail(t, s);
+ }
+ }
+ }
+ }
+
+ public E poll() {
+ for (;;) {
+ Node<E> h = head;
+ Node<E> t = tail;
+ Node<E> first = h.getNext();
+ if (h == head) {
+ if (h == t) {
+ if (first == null)
+ return null;
+ else
+ casTail(t, first);
+ } else if (casHead(h, first)) {
+ E item = first.getItem();
+ if (item != null) {
+ first.setItem(null);
+ return item;
+ }
+ // else skip over deleted item, continue loop,
+ }
+ }
+ }
+ }
+
+ public E peek() { // same as poll except don't remove item
+ for (;;) {
+ Node<E> h = head;
+ Node<E> t = tail;
+ Node<E> first = h.getNext();
+ if (h == head) {
+ if (h == t) {
+ if (first == null)
+ return null;
+ else
+ casTail(t, first);
+ } else {
+ E item = first.getItem();
+ if (item != null)
+ return item;
+ else // remove deleted node and continue
+ casHead(h, first);
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns the first actual (non-header) node on list. This is yet
+ * another variant of poll/peek; here returning out the first
+ * node, not element (so we cannot collapse with peek() without
+ * introducing race.)
+ */
+ Node<E> first() {
+ for (;;) {
+ Node<E> h = head;
+ Node<E> t = tail;
+ Node<E> first = h.getNext();
+ if (h == head) {
+ if (h == t) {
+ if (first == null)
+ return null;
+ else
+ casTail(t, first);
+ } else {
+ if (first.getItem() != null)
+ return first;
+ else // remove deleted node and continue
+ casHead(h, first);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Returns <tt>true</tt> if this queue contains no elements.
+ *
+ * @return <tt>true</tt> if this queue contains no elements
+ */
+ public boolean isEmpty() {
+ return first() == null;
+ }
+
+ /**
+ * Returns the number of elements in this queue. If this queue
+ * contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
+ * <tt>Integer.MAX_VALUE</tt>.
+ *
+ * <p>Beware that, unlike in most collections, this method is
+ * <em>NOT</em> a constant-time operation. Because of the
+ * asynchronous nature of these queues, determining the current
+ * number of elements requires an O(n) traversal.
+ *
+ * @return the number of elements in this queue
+ */
+ public int size() {
+ int count = 0;
+ for (Node<E> p = first(); p != null; p = p.getNext()) {
+ if (p.getItem() != null) {
+ // Collections.size() spec says to max out
+ if (++count == Integer.MAX_VALUE)
+ break;
+ }
+ }
+ return count;
+ }
+
+ /**
+ * Returns <tt>true</tt> if this queue contains the specified element.
+ * More formally, returns <tt>true</tt> if and only if this queue contains
+ * at least one element <tt>e</tt> such that <tt>o.equals(e)</tt>.
+ *
+ * @param o object to be checked for containment in this queue
+ * @return <tt>true</tt> if this queue contains the specified element
+ */
+ public boolean contains(Object o) {
+ if (o == null) return false;
+ for (Node<E> p = first(); p != null; p = p.getNext()) {
+ E item = p.getItem();
+ if (item != null &&
+ o.equals(item))
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Removes a single instance of the specified element from this queue,
+ * if it is present. More formally, removes an element <tt>e</tt> such
+ * that <tt>o.equals(e)</tt>, if this queue contains one or more such
+ * elements.
+ * Returns <tt>true</tt> if this queue contained the specified element
+ * (or equivalently, if this queue changed as a result of the call).
+ *
+ * @param o element to be removed from this queue, if present
+ * @return <tt>true</tt> if this queue changed as a result of the call
+ */
+ public boolean remove(Object o) {
+ if (o == null) return false;
+ for (Node<E> p = first(); p != null; p = p.getNext()) {
+ E item = p.getItem();
+ if (item != null &&
+ o.equals(item) &&
+ p.casItem(item, null))
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns an iterator over the elements in this queue in proper sequence.
+ * The returned iterator is a "weakly consistent" iterator that
+ * will never throw {@link ConcurrentModificationException},
+ * and guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed to)
+ * reflect any modifications subsequent to construction.
+ *
+ * @return an iterator over the elements in this queue in proper sequence
+ */
+ public Iterator<E> iterator() {
+ return new Itr();
+ }
+
+ private class Itr implements Iterator<E> {
+ /**
+ * Next node to return item for.
+ */
+ private Node<E> nextNode;
+
+ /**
+ * nextItem holds on to item fields because once we claim
+ * that an element exists in hasNext(), we must return it in
+ * the following next() call even if it was in the process of
+ * being removed when hasNext() was called.
+ */
+ private E nextItem;
+
+ /**
+ * Node of the last returned item, to support remove.
+ */
+ private Node<E> lastRet;
+
+ Itr() {
+ advance();
+ }
+
+ /**
+ * Moves to next valid node and returns item to return for
+ * next(), or null if no such.
+ */
+ private E advance() {
+ lastRet = nextNode;
+ E x = nextItem;
+
+ Node<E> p = (nextNode == null)? first() : nextNode.getNext();
+ for (;;) {
+ if (p == null) {
+ nextNode = null;
+ nextItem = null;
+ return x;
+ }
+ E item = p.getItem();
+ if (item != null) {
+ nextNode = p;
+ nextItem = item;
+ return x;
+ } else // skip over nulls
+ p = p.getNext();
+ }
+ }
+
+ public boolean hasNext() {
+ return nextNode != null;
+ }
+
+ public E next() {
+ if (nextNode == null) throw new NoSuchElementException();
+ return advance();
+ }
+
+ public void remove() {
+ Node<E> l = lastRet;
+ if (l == null) throw new IllegalStateException();
+ // rely on a future traversal to relink.
+ l.setItem(null);
+ lastRet = null;
+ }
+ }
+
+ /**
+ * Save the state to a stream (that is, serialize it).
+ *
+ * @serialData All of the elements (each an <tt>E</tt>) in
+ * the proper order, followed by a null
+ * @param s the stream
+ */
+ private void writeObject(java.io.ObjectOutputStream s)
+ throws java.io.IOException {
+
+ // Write out any hidden stuff
+ s.defaultWriteObject();
+
+ // Write out all elements in the proper order.
+ for (Node<E> p = first(); p != null; p = p.getNext()) {
+ Object item = p.getItem();
+ if (item != null)
+ s.writeObject(item);
+ }
+
+ // Use trailing null as sentinel
+ s.writeObject(null);
+ }
+
+ /**
+ * Reconstitute the Queue instance from a stream (that is,
+ * deserialize it).
+ * @param s the stream
+ */
+ private void readObject(java.io.ObjectInputStream s)
+ throws java.io.IOException, ClassNotFoundException {
+ // Read in capacity, and any hidden stuff
+ s.defaultReadObject();
+ head = new Node<E>(null, null);
+ tail = head;
+ // Read in all elements and place in queue
+ for (;;) {
+ E item = (E)s.readObject();
+ if (item == null)
+ break;
+ else
+ offer(item);
+ }
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentMap.java b/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentMap.java
new file mode 100644
index 00000000000..6e5bd073880
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentMap.java
@@ -0,0 +1,134 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.Map;
+
+/**
+ * A {@link java.util.Map} providing additional atomic
+ * <tt>putIfAbsent</tt>, <tt>remove</tt>, and <tt>replace</tt> methods.
+ *
+ * <p>Memory consistency effects: As with other concurrent
+ * collections, actions in a thread prior to placing an object into a
+ * {@code ConcurrentMap} as a key or value
+ * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
+ * actions subsequent to the access or removal of that object from
+ * the {@code ConcurrentMap} in another thread.
+ *
+ * <p>This interface is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <K> the type of keys maintained by this map
+ * @param <V> the type of mapped values
+ */
+public interface ConcurrentMap<K, V> extends Map<K, V> {
+ /**
+ * If the specified key is not already associated
+ * with a value, associate it with the given value.
+ * This is equivalent to
+ * <pre>
+ * if (!map.containsKey(key))
+ * return map.put(key, value);
+ * else
+ * return map.get(key);</pre>
+ * except that the action is performed atomically.
+ *
+ * @param key key with which the specified value is to be associated
+ * @param value value to be associated with the specified key
+ * @return the previous value associated with the specified key, or
+ * <tt>null</tt> if there was no mapping for the key.
+ * (A <tt>null</tt> return can also indicate that the map
+ * previously associated <tt>null</tt> with the key,
+ * if the implementation supports null values.)
+ * @throws UnsupportedOperationException if the <tt>put</tt> operation
+ * is not supported by this map
+ * @throws ClassCastException if the class of the specified key or value
+ * prevents it from being stored in this map
+ * @throws NullPointerException if the specified key or value is null,
+ * and this map does not permit null keys or values
+ * @throws IllegalArgumentException if some property of the specified key
+ * or value prevents it from being stored in this map
+ *
+ */
+ V putIfAbsent(K key, V value);
+
+ /**
+ * Removes the entry for a key only if currently mapped to a given value.
+ * This is equivalent to
+ * <pre>
+ * if (map.containsKey(key) &amp;&amp; map.get(key).equals(value)) {
+ * map.remove(key);
+ * return true;
+ * } else return false;</pre>
+ * except that the action is performed atomically.
+ *
+ * @param key key with which the specified value is associated
+ * @param value value expected to be associated with the specified key
+ * @return <tt>true</tt> if the value was removed
+ * @throws UnsupportedOperationException if the <tt>remove</tt> operation
+ * is not supported by this map
+ * @throws ClassCastException if the key or value is of an inappropriate
+ * type for this map (optional)
+ * @throws NullPointerException if the specified key or value is null,
+ * and this map does not permit null keys or values (optional)
+ */
+ boolean remove(Object key, Object value);
+
+ /**
+ * Replaces the entry for a key only if currently mapped to a given value.
+ * This is equivalent to
+ * <pre>
+ * if (map.containsKey(key) &amp;&amp; map.get(key).equals(oldValue)) {
+ * map.put(key, newValue);
+ * return true;
+ * } else return false;</pre>
+ * except that the action is performed atomically.
+ *
+ * @param key key with which the specified value is associated
+ * @param oldValue value expected to be associated with the specified key
+ * @param newValue value to be associated with the specified key
+ * @return <tt>true</tt> if the value was replaced
+ * @throws UnsupportedOperationException if the <tt>put</tt> operation
+ * is not supported by this map
+ * @throws ClassCastException if the class of a specified key or value
+ * prevents it from being stored in this map
+ * @throws NullPointerException if a specified key or value is null,
+ * and this map does not permit null keys or values
+ * @throws IllegalArgumentException if some property of a specified key
+ * or value prevents it from being stored in this map
+ */
+ boolean replace(K key, V oldValue, V newValue);
+
+ /**
+ * Replaces the entry for a key only if currently mapped to some value.
+ * This is equivalent to
+ * <pre>
+ * if (map.containsKey(key)) {
+ * return map.put(key, value);
+ * } else return null;</pre>
+ * except that the action is performed atomically.
+ *
+ * @param key key with which the specified value is associated
+ * @param value value to be associated with the specified key
+ * @return the previous value associated with the specified key, or
+ * <tt>null</tt> if there was no mapping for the key.
+ * (A <tt>null</tt> return can also indicate that the map
+ * previously associated <tt>null</tt> with the key,
+ * if the implementation supports null values.)
+ * @throws UnsupportedOperationException if the <tt>put</tt> operation
+ * is not supported by this map
+ * @throws ClassCastException if the class of the specified key or value
+ * prevents it from being stored in this map
+ * @throws NullPointerException if the specified key or value is null,
+ * and this map does not permit null keys or values
+ * @throws IllegalArgumentException if some property of the specified key
+ * or value prevents it from being stored in this map
+ */
+ V replace(K key, V value);
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentNavigableMap.java b/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentNavigableMap.java
new file mode 100644
index 00000000000..7d86afb7034
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentNavigableMap.java
@@ -0,0 +1,148 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.*;
+
+/**
+ * A {@link ConcurrentMap} supporting {@link NavigableMap} operations,
+ * and recursively so for its navigable sub-maps.
+ *
+ * <p>This interface is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @author Doug Lea
+ * @param <K> the type of keys maintained by this map
+ * @param <V> the type of mapped values
+ * @since 1.6
+ */
+public interface ConcurrentNavigableMap<K,V>
+ extends ConcurrentMap<K,V>, NavigableMap<K,V>
+{
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ ConcurrentNavigableMap<K,V> subMap(K fromKey, boolean fromInclusive,
+ K toKey, boolean toInclusive);
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ ConcurrentNavigableMap<K,V> headMap(K toKey, boolean inclusive);
+
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ ConcurrentNavigableMap<K,V> tailMap(K fromKey, boolean inclusive);
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ ConcurrentNavigableMap<K,V> subMap(K fromKey, K toKey);
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ ConcurrentNavigableMap<K,V> headMap(K toKey);
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ ConcurrentNavigableMap<K,V> tailMap(K fromKey);
+
+ /**
+ * Returns a reverse order view of the mappings contained in this map.
+ * The descending map is backed by this map, so changes to the map are
+ * reflected in the descending map, and vice-versa.
+ *
+ * <p>The returned map has an ordering equivalent to
+ * <tt>{@link Collections#reverseOrder(Comparator) Collections.reverseOrder}(comparator())</tt>.
+ * The expression {@code m.descendingMap().descendingMap()} returns a
+ * view of {@code m} essentially equivalent to {@code m}.
+ *
+ * @return a reverse order view of this map
+ */
+ ConcurrentNavigableMap<K,V> descendingMap();
+
+ /**
+ * Returns a {@link NavigableSet} view of the keys contained in this map.
+ * The set's iterator returns the keys in ascending order.
+ * The set is backed by the map, so changes to the map are
+ * reflected in the set, and vice-versa. The set supports element
+ * removal, which removes the corresponding mapping from the map,
+ * via the {@code Iterator.remove}, {@code Set.remove},
+ * {@code removeAll}, {@code retainAll}, and {@code clear}
+ * operations. It does not support the {@code add} or {@code addAll}
+ * operations.
+ *
+ * <p>The view's {@code iterator} is a "weakly consistent" iterator
+ * that will never throw {@link ConcurrentModificationException},
+ * and guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed to)
+ * reflect any modifications subsequent to construction.
+ *
+ * @return a navigable set view of the keys in this map
+ */
+ public NavigableSet<K> navigableKeySet();
+
+ /**
+ * Returns a {@link NavigableSet} view of the keys contained in this map.
+ * The set's iterator returns the keys in ascending order.
+ * The set is backed by the map, so changes to the map are
+ * reflected in the set, and vice-versa. The set supports element
+ * removal, which removes the corresponding mapping from the map,
+ * via the {@code Iterator.remove}, {@code Set.remove},
+ * {@code removeAll}, {@code retainAll}, and {@code clear}
+ * operations. It does not support the {@code add} or {@code addAll}
+ * operations.
+ *
+ * <p>The view's {@code iterator} is a "weakly consistent" iterator
+ * that will never throw {@link ConcurrentModificationException},
+ * and guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed to)
+ * reflect any modifications subsequent to construction.
+ *
+ * <p>This method is equivalent to method {@code navigableKeySet}.
+ *
+ * @return a navigable set view of the keys in this map
+ */
+ NavigableSet<K> keySet();
+
+ /**
+ * Returns a reverse order {@link NavigableSet} view of the keys contained in this map.
+ * The set's iterator returns the keys in descending order.
+ * The set is backed by the map, so changes to the map are
+ * reflected in the set, and vice-versa. The set supports element
+ * removal, which removes the corresponding mapping from the map,
+ * via the {@code Iterator.remove}, {@code Set.remove},
+ * {@code removeAll}, {@code retainAll}, and {@code clear}
+ * operations. It does not support the {@code add} or {@code addAll}
+ * operations.
+ *
+ * <p>The view's {@code iterator} is a "weakly consistent" iterator
+ * that will never throw {@link ConcurrentModificationException},
+ * and guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed to)
+ * reflect any modifications subsequent to construction.
+ *
+ * @return a reverse order navigable set view of the keys in this map
+ */
+ public NavigableSet<K> descendingKeySet();
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentSkipListMap.java b/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentSkipListMap.java
new file mode 100644
index 00000000000..52cd17a52d3
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentSkipListMap.java
@@ -0,0 +1,3114 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.*;
+import java.util.concurrent.atomic.*;
+
+/**
+ * A scalable concurrent {@link ConcurrentNavigableMap} implementation.
+ * The map is sorted according to the {@linkplain Comparable natural
+ * ordering} of its keys, or by a {@link Comparator} provided at map
+ * creation time, depending on which constructor is used.
+ *
+ * <p>This class implements a concurrent variant of <a
+ * href="http://www.cs.umd.edu/~pugh/">SkipLists</a> providing
+ * expected average <i>log(n)</i> time cost for the
+ * <tt>containsKey</tt>, <tt>get</tt>, <tt>put</tt> and
+ * <tt>remove</tt> operations and their variants. Insertion, removal,
+ * update, and access operations safely execute concurrently by
+ * multiple threads. Iterators are <i>weakly consistent</i>, returning
+ * elements reflecting the state of the map at some point at or since
+ * the creation of the iterator. They do <em>not</em> throw {@link
+ * ConcurrentModificationException}, and may proceed concurrently with
+ * other operations. Ascending key ordered views and their iterators
+ * are faster than descending ones.
+ *
+ * <p>All <tt>Map.Entry</tt> pairs returned by methods in this class
+ * and its views represent snapshots of mappings at the time they were
+ * produced. They do <em>not</em> support the <tt>Entry.setValue</tt>
+ * method. (Note however that it is possible to change mappings in the
+ * associated map using <tt>put</tt>, <tt>putIfAbsent</tt>, or
+ * <tt>replace</tt>, depending on exactly which effect you need.)
+ *
+ * <p>Beware that, unlike in most collections, the <tt>size</tt>
+ * method is <em>not</em> a constant-time operation. Because of the
+ * asynchronous nature of these maps, determining the current number
+ * of elements requires a traversal of the elements. Additionally,
+ * the bulk operations <tt>putAll</tt>, <tt>equals</tt>, and
+ * <tt>clear</tt> are <em>not</em> guaranteed to be performed
+ * atomically. For example, an iterator operating concurrently with a
+ * <tt>putAll</tt> operation might view only some of the added
+ * elements.
+ *
+ * <p>This class and its views and iterators implement all of the
+ * <em>optional</em> methods of the {@link Map} and {@link Iterator}
+ * interfaces. Like most other concurrent collections, this class does
+ * <em>not</em> permit the use of <tt>null</tt> keys or values because some
+ * null return values cannot be reliably distinguished from the absence of
+ * elements.
+ *
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @author Doug Lea
+ * @param <K> the type of keys maintained by this map
+ * @param <V> the type of mapped values
+ * @since 1.6
+ */
+public class ConcurrentSkipListMap<K,V> extends AbstractMap<K,V>
+ implements ConcurrentNavigableMap<K,V>,
+ Cloneable,
+ java.io.Serializable {
+ /*
+ * This class implements a tree-like two-dimensionally linked skip
+ * list in which the index levels are represented in separate
+ * nodes from the base nodes holding data. There are two reasons
+ * for taking this approach instead of the usual array-based
+ * structure: 1) Array based implementations seem to encounter
+ * more complexity and overhead 2) We can use cheaper algorithms
+ * for the heavily-traversed index lists than can be used for the
+ * base lists. Here's a picture of some of the basics for a
+ * possible list with 2 levels of index:
+ *
+ * Head nodes Index nodes
+ * +-+ right +-+ +-+
+ * |2|---------------->| |--------------------->| |->null
+ * +-+ +-+ +-+
+ * | down | |
+ * v v v
+ * +-+ +-+ +-+ +-+ +-+ +-+
+ * |1|----------->| |->| |------>| |----------->| |------>| |->null
+ * +-+ +-+ +-+ +-+ +-+ +-+
+ * v | | | | |
+ * Nodes next v v v v v
+ * +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+
+ * | |->|A|->|B|->|C|->|D|->|E|->|F|->|G|->|H|->|I|->|J|->|K|->null
+ * +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+
+ *
+ * The base lists use a variant of the HM linked ordered set
+ * algorithm. See Tim Harris, "A pragmatic implementation of
+ * non-blocking linked lists"
+ * http://www.cl.cam.ac.uk/~tlh20/publications.html and Maged
+ * Michael "High Performance Dynamic Lock-Free Hash Tables and
+ * List-Based Sets"
+ * http://www.research.ibm.com/people/m/michael/pubs.htm. The
+ * basic idea in these lists is to mark the "next" pointers of
+ * deleted nodes when deleting to avoid conflicts with concurrent
+ * insertions, and when traversing to keep track of triples
+ * (predecessor, node, successor) in order to detect when and how
+ * to unlink these deleted nodes.
+ *
+ * Rather than using mark-bits to mark list deletions (which can
+ * be slow and space-intensive using AtomicMarkedReference), nodes
+ * use direct CAS'able next pointers. On deletion, instead of
+ * marking a pointer, they splice in another node that can be
+ * thought of as standing for a marked pointer (indicating this by
+ * using otherwise impossible field values). Using plain nodes
+ * acts roughly like "boxed" implementations of marked pointers,
+ * but uses new nodes only when nodes are deleted, not for every
+ * link. This requires less space and supports faster
+ * traversal. Even if marked references were better supported by
+ * JVMs, traversal using this technique might still be faster
+ * because any search need only read ahead one more node than
+ * otherwise required (to check for trailing marker) rather than
+ * unmasking mark bits or whatever on each read.
+ *
+ * This approach maintains the essential property needed in the HM
+ * algorithm of changing the next-pointer of a deleted node so
+ * that any other CAS of it will fail, but implements the idea by
+ * changing the pointer to point to a different node, not by
+ * marking it. While it would be possible to further squeeze
+ * space by defining marker nodes not to have key/value fields, it
+ * isn't worth the extra type-testing overhead. The deletion
+ * markers are rarely encountered during traversal and are
+ * normally quickly garbage collected. (Note that this technique
+ * would not work well in systems without garbage collection.)
+ *
+ * In addition to using deletion markers, the lists also use
+ * nullness of value fields to indicate deletion, in a style
+ * similar to typical lazy-deletion schemes. If a node's value is
+ * null, then it is considered logically deleted and ignored even
+ * though it is still reachable. This maintains proper control of
+ * concurrent replace vs delete operations -- an attempted replace
+ * must fail if a delete beat it by nulling field, and a delete
+ * must return the last non-null value held in the field. (Note:
+ * Null, rather than some special marker, is used for value fields
+ * here because it just so happens to mesh with the Map API
+ * requirement that method get returns null if there is no
+ * mapping, which allows nodes to remain concurrently readable
+ * even when deleted. Using any other marker value here would be
+ * messy at best.)
+ *
+ * Here's the sequence of events for a deletion of node n with
+ * predecessor b and successor f, initially:
+ *
+ * +------+ +------+ +------+
+ * ... | b |------>| n |----->| f | ...
+ * +------+ +------+ +------+
+ *
+ * 1. CAS n's value field from non-null to null.
+ * From this point on, no public operations encountering
+ * the node consider this mapping to exist. However, other
+ * ongoing insertions and deletions might still modify
+ * n's next pointer.
+ *
+ * 2. CAS n's next pointer to point to a new marker node.
+ * From this point on, no other nodes can be appended to n.
+ * which avoids deletion errors in CAS-based linked lists.
+ *
+ * +------+ +------+ +------+ +------+
+ * ... | b |------>| n |----->|marker|------>| f | ...
+ * +------+ +------+ +------+ +------+
+ *
+ * 3. CAS b's next pointer over both n and its marker.
+ * From this point on, no new traversals will encounter n,
+ * and it can eventually be GCed.
+ * +------+ +------+
+ * ... | b |----------------------------------->| f | ...
+ * +------+ +------+
+ *
+ * A failure at step 1 leads to simple retry due to a lost race
+ * with another operation. Steps 2-3 can fail because some other
+ * thread noticed during a traversal a node with null value and
+ * helped out by marking and/or unlinking. This helping-out
+ * ensures that no thread can become stuck waiting for progress of
+ * the deleting thread. The use of marker nodes slightly
+ * complicates helping-out code because traversals must track
+ * consistent reads of up to four nodes (b, n, marker, f), not
+ * just (b, n, f), although the next field of a marker is
+ * immutable, and once a next field is CAS'ed to point to a
+ * marker, it never again changes, so this requires less care.
+ *
+ * Skip lists add indexing to this scheme, so that the base-level
+ * traversals start close to the locations being found, inserted
+ * or deleted -- usually base level traversals only traverse a few
+ * nodes. This doesn't change the basic algorithm except for the
+ * need to make sure base traversals start at predecessors (here,
+ * b) that are not (structurally) deleted, otherwise retrying
+ * after processing the deletion.
+ *
+ * Index levels are maintained as lists with volatile next fields,
+ * using CAS to link and unlink. Races are allowed in index-list
+ * operations that can (rarely) fail to link in a new index node
+ * or delete one. (We can't do this of course for data nodes.)
+ * However, even when this happens, the index lists remain sorted,
+ * so correctly serve as indices. This can impact performance,
+ * but since skip lists are probabilistic anyway, the net result
+ * is that under contention, the effective "p" value may be lower
+ * than its nominal value. And race windows are kept small enough
+ * that in practice these failures are rare, even under a lot of
+ * contention.
+ *
+ * The fact that retries (for both base and index lists) are
+ * relatively cheap due to indexing allows some minor
+ * simplifications of retry logic. Traversal restarts are
+ * performed after most "helping-out" CASes. This isn't always
+ * strictly necessary, but the implicit backoffs tend to help
+ * reduce other downstream failed CAS's enough to outweigh restart
+ * cost. This worsens the worst case, but seems to improve even
+ * highly contended cases.
+ *
+ * Unlike most skip-list implementations, index insertion and
+ * deletion here require a separate traversal pass occuring after
+ * the base-level action, to add or remove index nodes. This adds
+ * to single-threaded overhead, but improves contended
+ * multithreaded performance by narrowing interference windows,
+ * and allows deletion to ensure that all index nodes will be made
+ * unreachable upon return from a public remove operation, thus
+ * avoiding unwanted garbage retention. This is more important
+ * here than in some other data structures because we cannot null
+ * out node fields referencing user keys since they might still be
+ * read by other ongoing traversals.
+ *
+ * Indexing uses skip list parameters that maintain good search
+ * performance while using sparser-than-usual indices: The
+ * hardwired parameters k=1, p=0.5 (see method randomLevel) mean
+ * that about one-quarter of the nodes have indices. Of those that
+ * do, half have one level, a quarter have two, and so on (see
+ * Pugh's Skip List Cookbook, sec 3.4). The expected total space
+ * requirement for a map is slightly less than for the current
+ * implementation of java.util.TreeMap.
+ *
+ * Changing the level of the index (i.e, the height of the
+ * tree-like structure) also uses CAS. The head index has initial
+ * level/height of one. Creation of an index with height greater
+ * than the current level adds a level to the head index by
+ * CAS'ing on a new top-most head. To maintain good performance
+ * after a lot of removals, deletion methods heuristically try to
+ * reduce the height if the topmost levels appear to be empty.
+ * This may encounter races in which it possible (but rare) to
+ * reduce and "lose" a level just as it is about to contain an
+ * index (that will then never be encountered). This does no
+ * structural harm, and in practice appears to be a better option
+ * than allowing unrestrained growth of levels.
+ *
+ * The code for all this is more verbose than you'd like. Most
+ * operations entail locating an element (or position to insert an
+ * element). The code to do this can't be nicely factored out
+ * because subsequent uses require a snapshot of predecessor
+ * and/or successor and/or value fields which can't be returned
+ * all at once, at least not without creating yet another object
+ * to hold them -- creating such little objects is an especially
+ * bad idea for basic internal search operations because it adds
+ * to GC overhead. (This is one of the few times I've wished Java
+ * had macros.) Instead, some traversal code is interleaved within
+ * insertion and removal operations. The control logic to handle
+ * all the retry conditions is sometimes twisty. Most search is
+ * broken into 2 parts. findPredecessor() searches index nodes
+ * only, returning a base-level predecessor of the key. findNode()
+ * finishes out the base-level search. Even with this factoring,
+ * there is a fair amount of near-duplication of code to handle
+ * variants.
+ *
+ * For explanation of algorithms sharing at least a couple of
+ * features with this one, see Mikhail Fomitchev's thesis
+ * (http://www.cs.yorku.ca/~mikhail/), Keir Fraser's thesis
+ * (http://www.cl.cam.ac.uk/users/kaf24/), and Hakan Sundell's
+ * thesis (http://www.cs.chalmers.se/~phs/).
+ *
+ * Given the use of tree-like index nodes, you might wonder why
+ * this doesn't use some kind of search tree instead, which would
+ * support somewhat faster search operations. The reason is that
+ * there are no known efficient lock-free insertion and deletion
+ * algorithms for search trees. The immutability of the "down"
+ * links of index nodes (as opposed to mutable "left" fields in
+ * true trees) makes this tractable using only CAS operations.
+ *
+ * Notation guide for local variables
+ * Node: b, n, f for predecessor, node, successor
+ * Index: q, r, d for index node, right, down.
+ * t for another index node
+ * Head: h
+ * Levels: j
+ * Keys: k, key
+ * Values: v, value
+ * Comparisons: c
+ */
+
+ private static final long serialVersionUID = -8627078645895051609L;
+
+ /**
+ * Generates the initial random seed for the cheaper per-instance
+ * random number generators used in randomLevel.
+ */
+ private static final Random seedGenerator = new Random();
+
+ /**
+ * Special value used to identify base-level header
+ */
+ private static final Object BASE_HEADER = new Object();
+
+ /**
+ * The topmost head index of the skiplist.
+ */
+ private transient volatile HeadIndex<K,V> head;
+
+ /**
+ * The comparator used to maintain order in this map, or null
+ * if using natural ordering.
+ * @serial
+ */
+ private final Comparator<? super K> comparator;
+
+ /**
+ * Seed for simple random number generator. Not volatile since it
+ * doesn't matter too much if different threads don't see updates.
+ */
+ private transient int randomSeed;
+
+ /** Lazily initialized key set */
+ private transient KeySet keySet;
+ /** Lazily initialized entry set */
+ private transient EntrySet entrySet;
+ /** Lazily initialized values collection */
+ private transient Values values;
+ /** Lazily initialized descending key set */
+ private transient ConcurrentNavigableMap<K,V> descendingMap;
+
+ /**
+ * Initializes or resets state. Needed by constructors, clone,
+ * clear, readObject. and ConcurrentSkipListSet.clone.
+ * (Note that comparator must be separately initialized.)
+ */
+ final void initialize() {
+ keySet = null;
+ entrySet = null;
+ values = null;
+ descendingMap = null;
+ randomSeed = seedGenerator.nextInt() | 0x0100; // ensure nonzero
+ head = new HeadIndex<K,V>(new Node<K,V>(null, BASE_HEADER, null),
+ null, null, 1);
+ }
+
+ /** Updater for casHead */
+ private static final
+ AtomicReferenceFieldUpdater<ConcurrentSkipListMap, HeadIndex>
+ headUpdater = AtomicReferenceFieldUpdater.newUpdater
+ (ConcurrentSkipListMap.class, HeadIndex.class, "head");
+
+ /**
+ * compareAndSet head node
+ */
+ private boolean casHead(HeadIndex<K,V> cmp, HeadIndex<K,V> val) {
+ return headUpdater.compareAndSet(this, cmp, val);
+ }
+
+ /* ---------------- Nodes -------------- */
+
+ /**
+ * Nodes hold keys and values, and are singly linked in sorted
+ * order, possibly with some intervening marker nodes. The list is
+ * headed by a dummy node accessible as head.node. The value field
+ * is declared only as Object because it takes special non-V
+ * values for marker and header nodes.
+ */
+ static final class Node<K,V> {
+ final K key;
+ volatile Object value;
+ volatile Node<K,V> next;
+
+ /**
+ * Creates a new regular node.
+ */
+ Node(K key, Object value, Node<K,V> next) {
+ this.key = key;
+ this.value = value;
+ this.next = next;
+ }
+
+ /**
+ * Creates a new marker node. A marker is distinguished by
+ * having its value field point to itself. Marker nodes also
+ * have null keys, a fact that is exploited in a few places,
+ * but this doesn't distinguish markers from the base-level
+ * header node (head.node), which also has a null key.
+ */
+ Node(Node<K,V> next) {
+ this.key = null;
+ this.value = this;
+ this.next = next;
+ }
+
+ /** Updater for casNext */
+ static final AtomicReferenceFieldUpdater<Node, Node>
+ nextUpdater = AtomicReferenceFieldUpdater.newUpdater
+ (Node.class, Node.class, "next");
+
+ /** Updater for casValue */
+ static final AtomicReferenceFieldUpdater<Node, Object>
+ valueUpdater = AtomicReferenceFieldUpdater.newUpdater
+ (Node.class, Object.class, "value");
+
+ /**
+ * compareAndSet value field
+ */
+ boolean casValue(Object cmp, Object val) {
+ return valueUpdater.compareAndSet(this, cmp, val);
+ }
+
+ /**
+ * compareAndSet next field
+ */
+ boolean casNext(Node<K,V> cmp, Node<K,V> val) {
+ return nextUpdater.compareAndSet(this, cmp, val);
+ }
+
+ /**
+ * Returns true if this node is a marker. This method isn't
+ * actually called in any current code checking for markers
+ * because callers will have already read value field and need
+ * to use that read (not another done here) and so directly
+ * test if value points to node.
+ * @param n a possibly null reference to a node
+ * @return true if this node is a marker node
+ */
+ boolean isMarker() {
+ return value == this;
+ }
+
+ /**
+ * Returns true if this node is the header of base-level list.
+ * @return true if this node is header node
+ */
+ boolean isBaseHeader() {
+ return value == BASE_HEADER;
+ }
+
+ /**
+ * Tries to append a deletion marker to this node.
+ * @param f the assumed current successor of this node
+ * @return true if successful
+ */
+ boolean appendMarker(Node<K,V> f) {
+ return casNext(f, new Node<K,V>(f));
+ }
+
+ /**
+ * Helps out a deletion by appending marker or unlinking from
+ * predecessor. This is called during traversals when value
+ * field seen to be null.
+ * @param b predecessor
+ * @param f successor
+ */
+ void helpDelete(Node<K,V> b, Node<K,V> f) {
+ /*
+ * Rechecking links and then doing only one of the
+ * help-out stages per call tends to minimize CAS
+ * interference among helping threads.
+ */
+ if (f == next && this == b.next) {
+ if (f == null || f.value != f) // not already marked
+ appendMarker(f);
+ else
+ b.casNext(this, f.next);
+ }
+ }
+
+ /**
+ * Returns value if this node contains a valid key-value pair,
+ * else null.
+ * @return this node's value if it isn't a marker or header or
+ * is deleted, else null.
+ */
+ V getValidValue() {
+ Object v = value;
+ if (v == this || v == BASE_HEADER)
+ return null;
+ return (V)v;
+ }
+
+ /**
+ * Creates and returns a new SimpleImmutableEntry holding current
+ * mapping if this node holds a valid value, else null.
+ * @return new entry or null
+ */
+ AbstractMap.SimpleImmutableEntry<K,V> createSnapshot() {
+ V v = getValidValue();
+ if (v == null)
+ return null;
+ return new AbstractMap.SimpleImmutableEntry<K,V>(key, v);
+ }
+ }
+
+ /* ---------------- Indexing -------------- */
+
+ /**
+ * Index nodes represent the levels of the skip list. Note that
+ * even though both Nodes and Indexes have forward-pointing
+ * fields, they have different types and are handled in different
+ * ways, that can't nicely be captured by placing field in a
+ * shared abstract class.
+ */
+ static class Index<K,V> {
+ final Node<K,V> node;
+ final Index<K,V> down;
+ volatile Index<K,V> right;
+
+ /**
+ * Creates index node with given values.
+ */
+ Index(Node<K,V> node, Index<K,V> down, Index<K,V> right) {
+ this.node = node;
+ this.down = down;
+ this.right = right;
+ }
+
+ /** Updater for casRight */
+ static final AtomicReferenceFieldUpdater<Index, Index>
+ rightUpdater = AtomicReferenceFieldUpdater.newUpdater
+ (Index.class, Index.class, "right");
+
+ /**
+ * compareAndSet right field
+ */
+ final boolean casRight(Index<K,V> cmp, Index<K,V> val) {
+ return rightUpdater.compareAndSet(this, cmp, val);
+ }
+
+ /**
+ * Returns true if the node this indexes has been deleted.
+ * @return true if indexed node is known to be deleted
+ */
+ final boolean indexesDeletedNode() {
+ return node.value == null;
+ }
+
+ /**
+ * Tries to CAS newSucc as successor. To minimize races with
+ * unlink that may lose this index node, if the node being
+ * indexed is known to be deleted, it doesn't try to link in.
+ * @param succ the expected current successor
+ * @param newSucc the new successor
+ * @return true if successful
+ */
+ final boolean link(Index<K,V> succ, Index<K,V> newSucc) {
+ Node<K,V> n = node;
+ newSucc.right = succ;
+ return n.value != null && casRight(succ, newSucc);
+ }
+
+ /**
+ * Tries to CAS right field to skip over apparent successor
+ * succ. Fails (forcing a retraversal by caller) if this node
+ * is known to be deleted.
+ * @param succ the expected current successor
+ * @return true if successful
+ */
+ final boolean unlink(Index<K,V> succ) {
+ return !indexesDeletedNode() && casRight(succ, succ.right);
+ }
+ }
+
+ /* ---------------- Head nodes -------------- */
+
+ /**
+ * Nodes heading each level keep track of their level.
+ */
+ static final class HeadIndex<K,V> extends Index<K,V> {
+ final int level;
+ HeadIndex(Node<K,V> node, Index<K,V> down, Index<K,V> right, int level) {
+ super(node, down, right);
+ this.level = level;
+ }
+ }
+
+ /* ---------------- Comparison utilities -------------- */
+
+ /**
+ * Represents a key with a comparator as a Comparable.
+ *
+ * Because most sorted collections seem to use natural ordering on
+ * Comparables (Strings, Integers, etc), most internal methods are
+ * geared to use them. This is generally faster than checking
+ * per-comparison whether to use comparator or comparable because
+ * it doesn't require a (Comparable) cast for each comparison.
+ * (Optimizers can only sometimes remove such redundant checks
+ * themselves.) When Comparators are used,
+ * ComparableUsingComparators are created so that they act in the
+ * same way as natural orderings. This penalizes use of
+ * Comparators vs Comparables, which seems like the right
+ * tradeoff.
+ */
+ static final class ComparableUsingComparator<K> implements Comparable<K> {
+ final K actualKey;
+ final Comparator<? super K> cmp;
+ ComparableUsingComparator(K key, Comparator<? super K> cmp) {
+ this.actualKey = key;
+ this.cmp = cmp;
+ }
+ public int compareTo(K k2) {
+ return cmp.compare(actualKey, k2);
+ }
+ }
+
+ /**
+ * If using comparator, return a ComparableUsingComparator, else
+ * cast key as Comparable, which may cause ClassCastException,
+ * which is propagated back to caller.
+ */
+ private Comparable<? super K> comparable(Object key) throws ClassCastException {
+ if (key == null)
+ throw new NullPointerException();
+ if (comparator != null)
+ return new ComparableUsingComparator<K>((K)key, comparator);
+ else
+ return (Comparable<? super K>)key;
+ }
+
+ /**
+ * Compares using comparator or natural ordering. Used when the
+ * ComparableUsingComparator approach doesn't apply.
+ */
+ int compare(K k1, K k2) throws ClassCastException {
+ Comparator<? super K> cmp = comparator;
+ if (cmp != null)
+ return cmp.compare(k1, k2);
+ else
+ return ((Comparable<? super K>)k1).compareTo(k2);
+ }
+
+ /**
+ * Returns true if given key greater than or equal to least and
+ * strictly less than fence, bypassing either test if least or
+ * fence are null. Needed mainly in submap operations.
+ */
+ boolean inHalfOpenRange(K key, K least, K fence) {
+ if (key == null)
+ throw new NullPointerException();
+ return ((least == null || compare(key, least) >= 0) &&
+ (fence == null || compare(key, fence) < 0));
+ }
+
+ /**
+ * Returns true if given key greater than or equal to least and less
+ * or equal to fence. Needed mainly in submap operations.
+ */
+ boolean inOpenRange(K key, K least, K fence) {
+ if (key == null)
+ throw new NullPointerException();
+ return ((least == null || compare(key, least) >= 0) &&
+ (fence == null || compare(key, fence) <= 0));
+ }
+
+ /* ---------------- Traversal -------------- */
+
+ /**
+ * Returns a base-level node with key strictly less than given key,
+ * or the base-level header if there is no such node. Also
+ * unlinks indexes to deleted nodes found along the way. Callers
+ * rely on this side-effect of clearing indices to deleted nodes.
+ * @param key the key
+ * @return a predecessor of key
+ */
+ private Node<K,V> findPredecessor(Comparable<? super K> key) {
+ if (key == null)
+ throw new NullPointerException(); // don't postpone errors
+ for (;;) {
+ Index<K,V> q = head;
+ Index<K,V> r = q.right;
+ for (;;) {
+ if (r != null) {
+ Node<K,V> n = r.node;
+ K k = n.key;
+ if (n.value == null) {
+ if (!q.unlink(r))
+ break; // restart
+ r = q.right; // reread r
+ continue;
+ }
+ if (key.compareTo(k) > 0) {
+ q = r;
+ r = r.right;
+ continue;
+ }
+ }
+ Index<K,V> d = q.down;
+ if (d != null) {
+ q = d;
+ r = d.right;
+ } else
+ return q.node;
+ }
+ }
+ }
+
+ /**
+ * Returns node holding key or null if no such, clearing out any
+ * deleted nodes seen along the way. Repeatedly traverses at
+ * base-level looking for key starting at predecessor returned
+ * from findPredecessor, processing base-level deletions as
+ * encountered. Some callers rely on this side-effect of clearing
+ * deleted nodes.
+ *
+ * Restarts occur, at traversal step centered on node n, if:
+ *
+ * (1) After reading n's next field, n is no longer assumed
+ * predecessor b's current successor, which means that
+ * we don't have a consistent 3-node snapshot and so cannot
+ * unlink any subsequent deleted nodes encountered.
+ *
+ * (2) n's value field is null, indicating n is deleted, in
+ * which case we help out an ongoing structural deletion
+ * before retrying. Even though there are cases where such
+ * unlinking doesn't require restart, they aren't sorted out
+ * here because doing so would not usually outweigh cost of
+ * restarting.
+ *
+ * (3) n is a marker or n's predecessor's value field is null,
+ * indicating (among other possibilities) that
+ * findPredecessor returned a deleted node. We can't unlink
+ * the node because we don't know its predecessor, so rely
+ * on another call to findPredecessor to notice and return
+ * some earlier predecessor, which it will do. This check is
+ * only strictly needed at beginning of loop, (and the
+ * b.value check isn't strictly needed at all) but is done
+ * each iteration to help avoid contention with other
+ * threads by callers that will fail to be able to change
+ * links, and so will retry anyway.
+ *
+ * The traversal loops in doPut, doRemove, and findNear all
+ * include the same three kinds of checks. And specialized
+ * versions appear in findFirst, and findLast and their
+ * variants. They can't easily share code because each uses the
+ * reads of fields held in locals occurring in the orders they
+ * were performed.
+ *
+ * @param key the key
+ * @return node holding key, or null if no such
+ */
+ private Node<K,V> findNode(Comparable<? super K> key) {
+ for (;;) {
+ Node<K,V> b = findPredecessor(key);
+ Node<K,V> n = b.next;
+ for (;;) {
+ if (n == null)
+ return null;
+ Node<K,V> f = n.next;
+ if (n != b.next) // inconsistent read
+ break;
+ Object v = n.value;
+ if (v == null) { // n is deleted
+ n.helpDelete(b, f);
+ break;
+ }
+ if (v == n || b.value == null) // b is deleted
+ break;
+ int c = key.compareTo(n.key);
+ if (c == 0)
+ return n;
+ if (c < 0)
+ return null;
+ b = n;
+ n = f;
+ }
+ }
+ }
+
+ /**
+ * Specialized variant of findNode to perform Map.get. Does a weak
+ * traversal, not bothering to fix any deleted index nodes,
+ * returning early if it happens to see key in index, and passing
+ * over any deleted base nodes, falling back to getUsingFindNode
+ * only if it would otherwise return value from an ongoing
+ * deletion. Also uses "bound" to eliminate need for some
+ * comparisons (see Pugh Cookbook). Also folds uses of null checks
+ * and node-skipping because markers have null keys.
+ * @param okey the key
+ * @return the value, or null if absent
+ */
+ private V doGet(Object okey) {
+ Comparable<? super K> key = comparable(okey);
+ Node<K,V> bound = null;
+ Index<K,V> q = head;
+ Index<K,V> r = q.right;
+ Node<K,V> n;
+ K k;
+ int c;
+ for (;;) {
+ Index<K,V> d;
+ // Traverse rights
+ if (r != null && (n = r.node) != bound && (k = n.key) != null) {
+ if ((c = key.compareTo(k)) > 0) {
+ q = r;
+ r = r.right;
+ continue;
+ } else if (c == 0) {
+ Object v = n.value;
+ return (v != null)? (V)v : getUsingFindNode(key);
+ } else
+ bound = n;
+ }
+
+ // Traverse down
+ if ((d = q.down) != null) {
+ q = d;
+ r = d.right;
+ } else
+ break;
+ }
+
+ // Traverse nexts
+ for (n = q.node.next; n != null; n = n.next) {
+ if ((k = n.key) != null) {
+ if ((c = key.compareTo(k)) == 0) {
+ Object v = n.value;
+ return (v != null)? (V)v : getUsingFindNode(key);
+ } else if (c < 0)
+ break;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Performs map.get via findNode. Used as a backup if doGet
+ * encounters an in-progress deletion.
+ * @param key the key
+ * @return the value, or null if absent
+ */
+ private V getUsingFindNode(Comparable<? super K> key) {
+ /*
+ * Loop needed here and elsewhere in case value field goes
+ * null just as it is about to be returned, in which case we
+ * lost a race with a deletion, so must retry.
+ */
+ for (;;) {
+ Node<K,V> n = findNode(key);
+ if (n == null)
+ return null;
+ Object v = n.value;
+ if (v != null)
+ return (V)v;
+ }
+ }
+
+ /* ---------------- Insertion -------------- */
+
+ /**
+ * Main insertion method. Adds element if not present, or
+ * replaces value if present and onlyIfAbsent is false.
+ * @param kkey the key
+ * @param value the value that must be associated with key
+ * @param onlyIfAbsent if should not insert if already present
+ * @return the old value, or null if newly inserted
+ */
+ private V doPut(K kkey, V value, boolean onlyIfAbsent) {
+ Comparable<? super K> key = comparable(kkey);
+ for (;;) {
+ Node<K,V> b = findPredecessor(key);
+ Node<K,V> n = b.next;
+ for (;;) {
+ if (n != null) {
+ Node<K,V> f = n.next;
+ if (n != b.next) // inconsistent read
+ break;;
+ Object v = n.value;
+ if (v == null) { // n is deleted
+ n.helpDelete(b, f);
+ break;
+ }
+ if (v == n || b.value == null) // b is deleted
+ break;
+ int c = key.compareTo(n.key);
+ if (c > 0) {
+ b = n;
+ n = f;
+ continue;
+ }
+ if (c == 0) {
+ if (onlyIfAbsent || n.casValue(v, value))
+ return (V)v;
+ else
+ break; // restart if lost race to replace value
+ }
+ // else c < 0; fall through
+ }
+
+ Node<K,V> z = new Node<K,V>(kkey, value, n);
+ if (!b.casNext(n, z))
+ break; // restart if lost race to append to b
+ int level = randomLevel();
+ if (level > 0)
+ insertIndex(z, level);
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Returns a random level for inserting a new node.
+ * Hardwired to k=1, p=0.5, max 31 (see above and
+ * Pugh's "Skip List Cookbook", sec 3.4).
+ *
+ * This uses the simplest of the generators described in George
+ * Marsaglia's "Xorshift RNGs" paper. This is not a high-quality
+ * generator but is acceptable here.
+ */
+ private int randomLevel() {
+ int x = randomSeed;
+ x ^= x << 13;
+ x ^= x >>> 17;
+ randomSeed = x ^= x << 5;
+ if ((x & 0x8001) != 0) // test highest and lowest bits
+ return 0;
+ int level = 1;
+ while (((x >>>= 1) & 1) != 0) ++level;
+ return level;
+ }
+
+ /**
+ * Creates and adds index nodes for the given node.
+ * @param z the node
+ * @param level the level of the index
+ */
+ private void insertIndex(Node<K,V> z, int level) {
+ HeadIndex<K,V> h = head;
+ int max = h.level;
+
+ if (level <= max) {
+ Index<K,V> idx = null;
+ for (int i = 1; i <= level; ++i)
+ idx = new Index<K,V>(z, idx, null);
+ addIndex(idx, h, level);
+
+ } else { // Add a new level
+ /*
+ * To reduce interference by other threads checking for
+ * empty levels in tryReduceLevel, new levels are added
+ * with initialized right pointers. Which in turn requires
+ * keeping levels in an array to access them while
+ * creating new head index nodes from the opposite
+ * direction.
+ */
+ level = max + 1;
+ Index<K,V>[] idxs = (Index<K,V>[])new Index[level+1];
+ Index<K,V> idx = null;
+ for (int i = 1; i <= level; ++i)
+ idxs[i] = idx = new Index<K,V>(z, idx, null);
+
+ HeadIndex<K,V> oldh;
+ int k;
+ for (;;) {
+ oldh = head;
+ int oldLevel = oldh.level;
+ if (level <= oldLevel) { // lost race to add level
+ k = level;
+ break;
+ }
+ HeadIndex<K,V> newh = oldh;
+ Node<K,V> oldbase = oldh.node;
+ for (int j = oldLevel+1; j <= level; ++j)
+ newh = new HeadIndex<K,V>(oldbase, newh, idxs[j], j);
+ if (casHead(oldh, newh)) {
+ k = oldLevel;
+ break;
+ }
+ }
+ addIndex(idxs[k], oldh, k);
+ }
+ }
+
+ /**
+ * Adds given index nodes from given level down to 1.
+ * @param idx the topmost index node being inserted
+ * @param h the value of head to use to insert. This must be
+ * snapshotted by callers to provide correct insertion level
+ * @param indexLevel the level of the index
+ */
+ private void addIndex(Index<K,V> idx, HeadIndex<K,V> h, int indexLevel) {
+ // Track next level to insert in case of retries
+ int insertionLevel = indexLevel;
+ Comparable<? super K> key = comparable(idx.node.key);
+ if (key == null) throw new NullPointerException();
+
+ // Similar to findPredecessor, but adding index nodes along
+ // path to key.
+ for (;;) {
+ int j = h.level;
+ Index<K,V> q = h;
+ Index<K,V> r = q.right;
+ Index<K,V> t = idx;
+ for (;;) {
+ if (r != null) {
+ Node<K,V> n = r.node;
+ // compare before deletion check avoids needing recheck
+ int c = key.compareTo(n.key);
+ if (n.value == null) {
+ if (!q.unlink(r))
+ break;
+ r = q.right;
+ continue;
+ }
+ if (c > 0) {
+ q = r;
+ r = r.right;
+ continue;
+ }
+ }
+
+ if (j == insertionLevel) {
+ // Don't insert index if node already deleted
+ if (t.indexesDeletedNode()) {
+ findNode(key); // cleans up
+ return;
+ }
+ if (!q.link(r, t))
+ break; // restart
+ if (--insertionLevel == 0) {
+ // need final deletion check before return
+ if (t.indexesDeletedNode())
+ findNode(key);
+ return;
+ }
+ }
+
+ if (--j >= insertionLevel && j < indexLevel)
+ t = t.down;
+ q = q.down;
+ r = q.right;
+ }
+ }
+ }
+
+ /* ---------------- Deletion -------------- */
+
+ /**
+ * Main deletion method. Locates node, nulls value, appends a
+ * deletion marker, unlinks predecessor, removes associated index
+ * nodes, and possibly reduces head index level.
+ *
+ * Index nodes are cleared out simply by calling findPredecessor.
+ * which unlinks indexes to deleted nodes found along path to key,
+ * which will include the indexes to this node. This is done
+ * unconditionally. We can't check beforehand whether there are
+ * index nodes because it might be the case that some or all
+ * indexes hadn't been inserted yet for this node during initial
+ * search for it, and we'd like to ensure lack of garbage
+ * retention, so must call to be sure.
+ *
+ * @param okey the key
+ * @param value if non-null, the value that must be
+ * associated with key
+ * @return the node, or null if not found
+ */
+ final V doRemove(Object okey, Object value) {
+ Comparable<? super K> key = comparable(okey);
+ for (;;) {
+ Node<K,V> b = findPredecessor(key);
+ Node<K,V> n = b.next;
+ for (;;) {
+ if (n == null)
+ return null;
+ Node<K,V> f = n.next;
+ if (n != b.next) // inconsistent read
+ break;
+ Object v = n.value;
+ if (v == null) { // n is deleted
+ n.helpDelete(b, f);
+ break;
+ }
+ if (v == n || b.value == null) // b is deleted
+ break;
+ int c = key.compareTo(n.key);
+ if (c < 0)
+ return null;
+ if (c > 0) {
+ b = n;
+ n = f;
+ continue;
+ }
+ if (value != null && !value.equals(v))
+ return null;
+ if (!n.casValue(v, null))
+ break;
+ if (!n.appendMarker(f) || !b.casNext(n, f))
+ findNode(key); // Retry via findNode
+ else {
+ findPredecessor(key); // Clean index
+ if (head.right == null)
+ tryReduceLevel();
+ }
+ return (V)v;
+ }
+ }
+ }
+
+ /**
+ * Possibly reduce head level if it has no nodes. This method can
+ * (rarely) make mistakes, in which case levels can disappear even
+ * though they are about to contain index nodes. This impacts
+ * performance, not correctness. To minimize mistakes as well as
+ * to reduce hysteresis, the level is reduced by one only if the
+ * topmost three levels look empty. Also, if the removed level
+ * looks non-empty after CAS, we try to change it back quick
+ * before anyone notices our mistake! (This trick works pretty
+ * well because this method will practically never make mistakes
+ * unless current thread stalls immediately before first CAS, in
+ * which case it is very unlikely to stall again immediately
+ * afterwards, so will recover.)
+ *
+ * We put up with all this rather than just let levels grow
+ * because otherwise, even a small map that has undergone a large
+ * number of insertions and removals will have a lot of levels,
+ * slowing down access more than would an occasional unwanted
+ * reduction.
+ */
+ private void tryReduceLevel() {
+ HeadIndex<K,V> h = head;
+ HeadIndex<K,V> d;
+ HeadIndex<K,V> e;
+ if (h.level > 3 &&
+ (d = (HeadIndex<K,V>)h.down) != null &&
+ (e = (HeadIndex<K,V>)d.down) != null &&
+ e.right == null &&
+ d.right == null &&
+ h.right == null &&
+ casHead(h, d) && // try to set
+ h.right != null) // recheck
+ casHead(d, h); // try to backout
+ }
+
+ /* ---------------- Finding and removing first element -------------- */
+
+ /**
+ * Specialized variant of findNode to get first valid node.
+ * @return first node or null if empty
+ */
+ Node<K,V> findFirst() {
+ for (;;) {
+ Node<K,V> b = head.node;
+ Node<K,V> n = b.next;
+ if (n == null)
+ return null;
+ if (n.value != null)
+ return n;
+ n.helpDelete(b, n.next);
+ }
+ }
+
+ /**
+ * Removes first entry; returns its snapshot.
+ * @return null if empty, else snapshot of first entry
+ */
+ Map.Entry<K,V> doRemoveFirstEntry() {
+ for (;;) {
+ Node<K,V> b = head.node;
+ Node<K,V> n = b.next;
+ if (n == null)
+ return null;
+ Node<K,V> f = n.next;
+ if (n != b.next)
+ continue;
+ Object v = n.value;
+ if (v == null) {
+ n.helpDelete(b, f);
+ continue;
+ }
+ if (!n.casValue(v, null))
+ continue;
+ if (!n.appendMarker(f) || !b.casNext(n, f))
+ findFirst(); // retry
+ clearIndexToFirst();
+ return new AbstractMap.SimpleImmutableEntry<K,V>(n.key, (V)v);
+ }
+ }
+
+ /**
+ * Clears out index nodes associated with deleted first entry.
+ */
+ private void clearIndexToFirst() {
+ for (;;) {
+ Index<K,V> q = head;
+ for (;;) {
+ Index<K,V> r = q.right;
+ if (r != null && r.indexesDeletedNode() && !q.unlink(r))
+ break;
+ if ((q = q.down) == null) {
+ if (head.right == null)
+ tryReduceLevel();
+ return;
+ }
+ }
+ }
+ }
+
+
+ /* ---------------- Finding and removing last element -------------- */
+
+ /**
+ * Specialized version of find to get last valid node.
+ * @return last node or null if empty
+ */
+ Node<K,V> findLast() {
+ /*
+ * findPredecessor can't be used to traverse index level
+ * because this doesn't use comparisons. So traversals of
+ * both levels are folded together.
+ */
+ Index<K,V> q = head;
+ for (;;) {
+ Index<K,V> d, r;
+ if ((r = q.right) != null) {
+ if (r.indexesDeletedNode()) {
+ q.unlink(r);
+ q = head; // restart
+ }
+ else
+ q = r;
+ } else if ((d = q.down) != null) {
+ q = d;
+ } else {
+ Node<K,V> b = q.node;
+ Node<K,V> n = b.next;
+ for (;;) {
+ if (n == null)
+ return (b.isBaseHeader())? null : b;
+ Node<K,V> f = n.next; // inconsistent read
+ if (n != b.next)
+ break;
+ Object v = n.value;
+ if (v == null) { // n is deleted
+ n.helpDelete(b, f);
+ break;
+ }
+ if (v == n || b.value == null) // b is deleted
+ break;
+ b = n;
+ n = f;
+ }
+ q = head; // restart
+ }
+ }
+ }
+
+ /**
+ * Specialized variant of findPredecessor to get predecessor of last
+ * valid node. Needed when removing the last entry. It is possible
+ * that all successors of returned node will have been deleted upon
+ * return, in which case this method can be retried.
+ * @return likely predecessor of last node
+ */
+ private Node<K,V> findPredecessorOfLast() {
+ for (;;) {
+ Index<K,V> q = head;
+ for (;;) {
+ Index<K,V> d, r;
+ if ((r = q.right) != null) {
+ if (r.indexesDeletedNode()) {
+ q.unlink(r);
+ break; // must restart
+ }
+ // proceed as far across as possible without overshooting
+ if (r.node.next != null) {
+ q = r;
+ continue;
+ }
+ }
+ if ((d = q.down) != null)
+ q = d;
+ else
+ return q.node;
+ }
+ }
+ }
+
+ /**
+ * Removes last entry; returns its snapshot.
+ * Specialized variant of doRemove.
+ * @return null if empty, else snapshot of last entry
+ */
+ Map.Entry<K,V> doRemoveLastEntry() {
+ for (;;) {
+ Node<K,V> b = findPredecessorOfLast();
+ Node<K,V> n = b.next;
+ if (n == null) {
+ if (b.isBaseHeader()) // empty
+ return null;
+ else
+ continue; // all b's successors are deleted; retry
+ }
+ for (;;) {
+ Node<K,V> f = n.next;
+ if (n != b.next) // inconsistent read
+ break;
+ Object v = n.value;
+ if (v == null) { // n is deleted
+ n.helpDelete(b, f);
+ break;
+ }
+ if (v == n || b.value == null) // b is deleted
+ break;
+ if (f != null) {
+ b = n;
+ n = f;
+ continue;
+ }
+ if (!n.casValue(v, null))
+ break;
+ K key = n.key;
+ Comparable<? super K> ck = comparable(key);
+ if (!n.appendMarker(f) || !b.casNext(n, f))
+ findNode(ck); // Retry via findNode
+ else {
+ findPredecessor(ck); // Clean index
+ if (head.right == null)
+ tryReduceLevel();
+ }
+ return new AbstractMap.SimpleImmutableEntry<K,V>(key, (V)v);
+ }
+ }
+ }
+
+ /* ---------------- Relational operations -------------- */
+
+ // Control values OR'ed as arguments to findNear
+
+ private static final int EQ = 1;
+ private static final int LT = 2;
+ private static final int GT = 0; // Actually checked as !LT
+
+ /**
+ * Utility for ceiling, floor, lower, higher methods.
+ * @param kkey the key
+ * @param rel the relation -- OR'ed combination of EQ, LT, GT
+ * @return nearest node fitting relation, or null if no such
+ */
+ Node<K,V> findNear(K kkey, int rel) {
+ Comparable<? super K> key = comparable(kkey);
+ for (;;) {
+ Node<K,V> b = findPredecessor(key);
+ Node<K,V> n = b.next;
+ for (;;) {
+ if (n == null)
+ return ((rel & LT) == 0 || b.isBaseHeader())? null : b;
+ Node<K,V> f = n.next;
+ if (n != b.next) // inconsistent read
+ break;
+ Object v = n.value;
+ if (v == null) { // n is deleted
+ n.helpDelete(b, f);
+ break;
+ }
+ if (v == n || b.value == null) // b is deleted
+ break;
+ int c = key.compareTo(n.key);
+ if ((c == 0 && (rel & EQ) != 0) ||
+ (c < 0 && (rel & LT) == 0))
+ return n;
+ if ( c <= 0 && (rel & LT) != 0)
+ return (b.isBaseHeader())? null : b;
+ b = n;
+ n = f;
+ }
+ }
+ }
+
+ /**
+ * Returns SimpleImmutableEntry for results of findNear.
+ * @param key the key
+ * @param rel the relation -- OR'ed combination of EQ, LT, GT
+ * @return Entry fitting relation, or null if no such
+ */
+ AbstractMap.SimpleImmutableEntry<K,V> getNear(K key, int rel) {
+ for (;;) {
+ Node<K,V> n = findNear(key, rel);
+ if (n == null)
+ return null;
+ AbstractMap.SimpleImmutableEntry<K,V> e = n.createSnapshot();
+ if (e != null)
+ return e;
+ }
+ }
+
+
+ /* ---------------- Constructors -------------- */
+
+ /**
+ * Constructs a new, empty map, sorted according to the
+ * {@linkplain Comparable natural ordering} of the keys.
+ */
+ public ConcurrentSkipListMap() {
+ this.comparator = null;
+ initialize();
+ }
+
+ /**
+ * Constructs a new, empty map, sorted according to the specified
+ * comparator.
+ *
+ * @param comparator the comparator that will be used to order this map.
+ * If <tt>null</tt>, the {@linkplain Comparable natural
+ * ordering} of the keys will be used.
+ */
+ public ConcurrentSkipListMap(Comparator<? super K> comparator) {
+ this.comparator = comparator;
+ initialize();
+ }
+
+ /**
+ * Constructs a new map containing the same mappings as the given map,
+ * sorted according to the {@linkplain Comparable natural ordering} of
+ * the keys.
+ *
+ * @param m the map whose mappings are to be placed in this map
+ * @throws ClassCastException if the keys in <tt>m</tt> are not
+ * {@link Comparable}, or are not mutually comparable
+ * @throws NullPointerException if the specified map or any of its keys
+ * or values are null
+ */
+ public ConcurrentSkipListMap(Map<? extends K, ? extends V> m) {
+ this.comparator = null;
+ initialize();
+ putAll(m);
+ }
+
+ /**
+ * Constructs a new map containing the same mappings and using the
+ * same ordering as the specified sorted map.
+ *
+ * @param m the sorted map whose mappings are to be placed in this
+ * map, and whose comparator is to be used to sort this map
+ * @throws NullPointerException if the specified sorted map or any of
+ * its keys or values are null
+ */
+ public ConcurrentSkipListMap(SortedMap<K, ? extends V> m) {
+ this.comparator = m.comparator();
+ initialize();
+ buildFromSorted(m);
+ }
+
+ /**
+ * Returns a shallow copy of this <tt>ConcurrentSkipListMap</tt>
+ * instance. (The keys and values themselves are not cloned.)
+ *
+ * @return a shallow copy of this map
+ */
+ public ConcurrentSkipListMap<K,V> clone() {
+ ConcurrentSkipListMap<K,V> clone = null;
+ try {
+ clone = (ConcurrentSkipListMap<K,V>) super.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new InternalError();
+ }
+
+ clone.initialize();
+ clone.buildFromSorted(this);
+ return clone;
+ }
+
+ /**
+ * Streamlined bulk insertion to initialize from elements of
+ * given sorted map. Call only from constructor or clone
+ * method.
+ */
+ private void buildFromSorted(SortedMap<K, ? extends V> map) {
+ if (map == null)
+ throw new NullPointerException();
+
+ HeadIndex<K,V> h = head;
+ Node<K,V> basepred = h.node;
+
+ // Track the current rightmost node at each level. Uses an
+ // ArrayList to avoid committing to initial or maximum level.
+ ArrayList<Index<K,V>> preds = new ArrayList<Index<K,V>>();
+
+ // initialize
+ for (int i = 0; i <= h.level; ++i)
+ preds.add(null);
+ Index<K,V> q = h;
+ for (int i = h.level; i > 0; --i) {
+ preds.set(i, q);
+ q = q.down;
+ }
+
+ Iterator<? extends Map.Entry<? extends K, ? extends V>> it =
+ map.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry<? extends K, ? extends V> e = it.next();
+ int j = randomLevel();
+ if (j > h.level) j = h.level + 1;
+ K k = e.getKey();
+ V v = e.getValue();
+ if (k == null || v == null)
+ throw new NullPointerException();
+ Node<K,V> z = new Node<K,V>(k, v, null);
+ basepred.next = z;
+ basepred = z;
+ if (j > 0) {
+ Index<K,V> idx = null;
+ for (int i = 1; i <= j; ++i) {
+ idx = new Index<K,V>(z, idx, null);
+ if (i > h.level)
+ h = new HeadIndex<K,V>(h.node, h, idx, i);
+
+ if (i < preds.size()) {
+ preds.get(i).right = idx;
+ preds.set(i, idx);
+ } else
+ preds.add(idx);
+ }
+ }
+ }
+ head = h;
+ }
+
+ /* ---------------- Serialization -------------- */
+
+ /**
+ * Save the state of this map to a stream.
+ *
+ * @serialData The key (Object) and value (Object) for each
+ * key-value mapping represented by the map, followed by
+ * <tt>null</tt>. The key-value mappings are emitted in key-order
+ * (as determined by the Comparator, or by the keys' natural
+ * ordering if no Comparator).
+ */
+ private void writeObject(java.io.ObjectOutputStream s)
+ throws java.io.IOException {
+ // Write out the Comparator and any hidden stuff
+ s.defaultWriteObject();
+
+ // Write out keys and values (alternating)
+ for (Node<K,V> n = findFirst(); n != null; n = n.next) {
+ V v = n.getValidValue();
+ if (v != null) {
+ s.writeObject(n.key);
+ s.writeObject(v);
+ }
+ }
+ s.writeObject(null);
+ }
+
+ /**
+ * Reconstitute the map from a stream.
+ */
+ private void readObject(final java.io.ObjectInputStream s)
+ throws java.io.IOException, ClassNotFoundException {
+ // Read in the Comparator and any hidden stuff
+ s.defaultReadObject();
+ // Reset transients
+ initialize();
+
+ /*
+ * This is nearly identical to buildFromSorted, but is
+ * distinct because readObject calls can't be nicely adapted
+ * as the kind of iterator needed by buildFromSorted. (They
+ * can be, but doing so requires type cheats and/or creation
+ * of adaptor classes.) It is simpler to just adapt the code.
+ */
+
+ HeadIndex<K,V> h = head;
+ Node<K,V> basepred = h.node;
+ ArrayList<Index<K,V>> preds = new ArrayList<Index<K,V>>();
+ for (int i = 0; i <= h.level; ++i)
+ preds.add(null);
+ Index<K,V> q = h;
+ for (int i = h.level; i > 0; --i) {
+ preds.set(i, q);
+ q = q.down;
+ }
+
+ for (;;) {
+ Object k = s.readObject();
+ if (k == null)
+ break;
+ Object v = s.readObject();
+ if (v == null)
+ throw new NullPointerException();
+ K key = (K) k;
+ V val = (V) v;
+ int j = randomLevel();
+ if (j > h.level) j = h.level + 1;
+ Node<K,V> z = new Node<K,V>(key, val, null);
+ basepred.next = z;
+ basepred = z;
+ if (j > 0) {
+ Index<K,V> idx = null;
+ for (int i = 1; i <= j; ++i) {
+ idx = new Index<K,V>(z, idx, null);
+ if (i > h.level)
+ h = new HeadIndex<K,V>(h.node, h, idx, i);
+
+ if (i < preds.size()) {
+ preds.get(i).right = idx;
+ preds.set(i, idx);
+ } else
+ preds.add(idx);
+ }
+ }
+ }
+ head = h;
+ }
+
+ /* ------ Map API methods ------ */
+
+ /**
+ * Returns <tt>true</tt> if this map contains a mapping for the specified
+ * key.
+ *
+ * @param key key whose presence in this map is to be tested
+ * @return <tt>true</tt> if this map contains a mapping for the specified key
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key is null
+ */
+ public boolean containsKey(Object key) {
+ return doGet(key) != null;
+ }
+
+ /**
+ * Returns the value to which the specified key is mapped,
+ * or {@code null} if this map contains no mapping for the key.
+ *
+ * <p>More formally, if this map contains a mapping from a key
+ * {@code k} to a value {@code v} such that {@code key} compares
+ * equal to {@code k} according to the map's ordering, then this
+ * method returns {@code v}; otherwise it returns {@code null}.
+ * (There can be at most one such mapping.)
+ *
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key is null
+ */
+ public V get(Object key) {
+ return doGet(key);
+ }
+
+ /**
+ * Associates the specified value with the specified key in this map.
+ * If the map previously contained a mapping for the key, the old
+ * value is replaced.
+ *
+ * @param key key with which the specified value is to be associated
+ * @param value value to be associated with the specified key
+ * @return the previous value associated with the specified key, or
+ * <tt>null</tt> if there was no mapping for the key
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key or value is null
+ */
+ public V put(K key, V value) {
+ if (value == null)
+ throw new NullPointerException();
+ return doPut(key, value, false);
+ }
+
+ /**
+ * Removes the mapping for the specified key from this map if present.
+ *
+ * @param key key for which mapping should be removed
+ * @return the previous value associated with the specified key, or
+ * <tt>null</tt> if there was no mapping for the key
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key is null
+ */
+ public V remove(Object key) {
+ return doRemove(key, null);
+ }
+
+ /**
+ * Returns <tt>true</tt> if this map maps one or more keys to the
+ * specified value. This operation requires time linear in the
+ * map size.
+ *
+ * @param value value whose presence in this map is to be tested
+ * @return <tt>true</tt> if a mapping to <tt>value</tt> exists;
+ * <tt>false</tt> otherwise
+ * @throws NullPointerException if the specified value is null
+ */
+ public boolean containsValue(Object value) {
+ if (value == null)
+ throw new NullPointerException();
+ for (Node<K,V> n = findFirst(); n != null; n = n.next) {
+ V v = n.getValidValue();
+ if (v != null && value.equals(v))
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns the number of key-value mappings in this map. If this map
+ * contains more than <tt>Integer.MAX_VALUE</tt> elements, it
+ * returns <tt>Integer.MAX_VALUE</tt>.
+ *
+ * <p>Beware that, unlike in most collections, this method is
+ * <em>NOT</em> a constant-time operation. Because of the
+ * asynchronous nature of these maps, determining the current
+ * number of elements requires traversing them all to count them.
+ * Additionally, it is possible for the size to change during
+ * execution of this method, in which case the returned result
+ * will be inaccurate. Thus, this method is typically not very
+ * useful in concurrent applications.
+ *
+ * @return the number of elements in this map
+ */
+ public int size() {
+ long count = 0;
+ for (Node<K,V> n = findFirst(); n != null; n = n.next) {
+ if (n.getValidValue() != null)
+ ++count;
+ }
+ return (count >= Integer.MAX_VALUE)? Integer.MAX_VALUE : (int)count;
+ }
+
+ /**
+ * Returns <tt>true</tt> if this map contains no key-value mappings.
+ * @return <tt>true</tt> if this map contains no key-value mappings
+ */
+ public boolean isEmpty() {
+ return findFirst() == null;
+ }
+
+ /**
+ * Removes all of the mappings from this map.
+ */
+ public void clear() {
+ initialize();
+ }
+
+ /* ---------------- View methods -------------- */
+
+ /*
+ * Note: Lazy initialization works for views because view classes
+ * are stateless/immutable so it doesn't matter wrt correctness if
+ * more than one is created (which will only rarely happen). Even
+ * so, the following idiom conservatively ensures that the method
+ * returns the one it created if it does so, not one created by
+ * another racing thread.
+ */
+
+ /**
+ * Returns a {@link NavigableSet} view of the keys contained in this map.
+ * The set's iterator returns the keys in ascending order.
+ * The set is backed by the map, so changes to the map are
+ * reflected in the set, and vice-versa. The set supports element
+ * removal, which removes the corresponding mapping from the map,
+ * via the {@code Iterator.remove}, {@code Set.remove},
+ * {@code removeAll}, {@code retainAll}, and {@code clear}
+ * operations. It does not support the {@code add} or {@code addAll}
+ * operations.
+ *
+ * <p>The view's {@code iterator} is a "weakly consistent" iterator
+ * that will never throw {@link ConcurrentModificationException},
+ * and guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed to)
+ * reflect any modifications subsequent to construction.
+ *
+ * <p>This method is equivalent to method {@code navigableKeySet}.
+ *
+ * @return a navigable set view of the keys in this map
+ */
+ public NavigableSet<K> keySet() {
+ KeySet ks = keySet;
+ return (ks != null) ? ks : (keySet = new KeySet(this));
+ }
+
+ public NavigableSet<K> navigableKeySet() {
+ KeySet ks = keySet;
+ return (ks != null) ? ks : (keySet = new KeySet(this));
+ }
+
+ /**
+ * Returns a {@link Collection} view of the values contained in this map.
+ * The collection's iterator returns the values in ascending order
+ * of the corresponding keys.
+ * The collection is backed by the map, so changes to the map are
+ * reflected in the collection, and vice-versa. The collection
+ * supports element removal, which removes the corresponding
+ * mapping from the map, via the <tt>Iterator.remove</tt>,
+ * <tt>Collection.remove</tt>, <tt>removeAll</tt>,
+ * <tt>retainAll</tt> and <tt>clear</tt> operations. It does not
+ * support the <tt>add</tt> or <tt>addAll</tt> operations.
+ *
+ * <p>The view's <tt>iterator</tt> is a "weakly consistent" iterator
+ * that will never throw {@link ConcurrentModificationException},
+ * and guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed to)
+ * reflect any modifications subsequent to construction.
+ */
+ public Collection<V> values() {
+ Values vs = values;
+ return (vs != null) ? vs : (values = new Values(this));
+ }
+
+ /**
+ * Returns a {@link Set} view of the mappings contained in this map.
+ * The set's iterator returns the entries in ascending key order.
+ * The set is backed by the map, so changes to the map are
+ * reflected in the set, and vice-versa. The set supports element
+ * removal, which removes the corresponding mapping from the map,
+ * via the <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
+ * <tt>removeAll</tt>, <tt>retainAll</tt> and <tt>clear</tt>
+ * operations. It does not support the <tt>add</tt> or
+ * <tt>addAll</tt> operations.
+ *
+ * <p>The view's <tt>iterator</tt> is a "weakly consistent" iterator
+ * that will never throw {@link ConcurrentModificationException},
+ * and guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed to)
+ * reflect any modifications subsequent to construction.
+ *
+ * <p>The <tt>Map.Entry</tt> elements returned by
+ * <tt>iterator.next()</tt> do <em>not</em> support the
+ * <tt>setValue</tt> operation.
+ *
+ * @return a set view of the mappings contained in this map,
+ * sorted in ascending key order
+ */
+ public Set<Map.Entry<K,V>> entrySet() {
+ EntrySet es = entrySet;
+ return (es != null) ? es : (entrySet = new EntrySet(this));
+ }
+
+ public ConcurrentNavigableMap<K,V> descendingMap() {
+ ConcurrentNavigableMap<K,V> dm = descendingMap;
+ return (dm != null) ? dm : (descendingMap = new SubMap<K,V>
+ (this, null, false, null, false, true));
+ }
+
+ public NavigableSet<K> descendingKeySet() {
+ return descendingMap().navigableKeySet();
+ }
+
+ /* ---------------- AbstractMap Overrides -------------- */
+
+ /**
+ * Compares the specified object with this map for equality.
+ * Returns <tt>true</tt> if the given object is also a map and the
+ * two maps represent the same mappings. More formally, two maps
+ * <tt>m1</tt> and <tt>m2</tt> represent the same mappings if
+ * <tt>m1.entrySet().equals(m2.entrySet())</tt>. This
+ * operation may return misleading results if either map is
+ * concurrently modified during execution of this method.
+ *
+ * @param o object to be compared for equality with this map
+ * @return <tt>true</tt> if the specified object is equal to this map
+ */
+ public boolean equals(Object o) {
+ if (o == this)
+ return true;
+ if (!(o instanceof Map))
+ return false;
+ Map<?,?> m = (Map<?,?>) o;
+ try {
+ for (Map.Entry<K,V> e : this.entrySet())
+ if (! e.getValue().equals(m.get(e.getKey())))
+ return false;
+ for (Map.Entry<?,?> e : m.entrySet()) {
+ Object k = e.getKey();
+ Object v = e.getValue();
+ if (k == null || v == null || !v.equals(get(k)))
+ return false;
+ }
+ return true;
+ } catch (ClassCastException unused) {
+ return false;
+ } catch (NullPointerException unused) {
+ return false;
+ }
+ }
+
+ /* ------ ConcurrentMap API methods ------ */
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return the previous value associated with the specified key,
+ * or <tt>null</tt> if there was no mapping for the key
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key or value is null
+ */
+ public V putIfAbsent(K key, V value) {
+ if (value == null)
+ throw new NullPointerException();
+ return doPut(key, value, true);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key is null
+ */
+ public boolean remove(Object key, Object value) {
+ if (key == null)
+ throw new NullPointerException();
+ if (value == null)
+ return false;
+ return doRemove(key, value) != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if any of the arguments are null
+ */
+ public boolean replace(K key, V oldValue, V newValue) {
+ if (oldValue == null || newValue == null)
+ throw new NullPointerException();
+ Comparable<? super K> k = comparable(key);
+ for (;;) {
+ Node<K,V> n = findNode(k);
+ if (n == null)
+ return false;
+ Object v = n.value;
+ if (v != null) {
+ if (!oldValue.equals(v))
+ return false;
+ if (n.casValue(v, newValue))
+ return true;
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return the previous value associated with the specified key,
+ * or <tt>null</tt> if there was no mapping for the key
+ * @throws ClassCastException if the specified key cannot be compared
+ * with the keys currently in the map
+ * @throws NullPointerException if the specified key or value is null
+ */
+ public V replace(K key, V value) {
+ if (value == null)
+ throw new NullPointerException();
+ Comparable<? super K> k = comparable(key);
+ for (;;) {
+ Node<K,V> n = findNode(k);
+ if (n == null)
+ return null;
+ Object v = n.value;
+ if (v != null && n.casValue(v, value))
+ return (V)v;
+ }
+ }
+
+ /* ------ SortedMap API methods ------ */
+
+ public Comparator<? super K> comparator() {
+ return comparator;
+ }
+
+ /**
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public K firstKey() {
+ Node<K,V> n = findFirst();
+ if (n == null)
+ throw new NoSuchElementException();
+ return n.key;
+ }
+
+ /**
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public K lastKey() {
+ Node<K,V> n = findLast();
+ if (n == null)
+ throw new NoSuchElementException();
+ return n.key;
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if {@code fromKey} or {@code toKey} is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public ConcurrentNavigableMap<K,V> subMap(K fromKey,
+ boolean fromInclusive,
+ K toKey,
+ boolean toInclusive) {
+ if (fromKey == null || toKey == null)
+ throw new NullPointerException();
+ return new SubMap<K,V>
+ (this, fromKey, fromInclusive, toKey, toInclusive, false);
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if {@code toKey} is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public ConcurrentNavigableMap<K,V> headMap(K toKey,
+ boolean inclusive) {
+ if (toKey == null)
+ throw new NullPointerException();
+ return new SubMap<K,V>
+ (this, null, false, toKey, inclusive, false);
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if {@code fromKey} is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public ConcurrentNavigableMap<K,V> tailMap(K fromKey,
+ boolean inclusive) {
+ if (fromKey == null)
+ throw new NullPointerException();
+ return new SubMap<K,V>
+ (this, fromKey, inclusive, null, false, false);
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if {@code fromKey} or {@code toKey} is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public ConcurrentNavigableMap<K,V> subMap(K fromKey, K toKey) {
+ return subMap(fromKey, true, toKey, false);
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if {@code toKey} is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public ConcurrentNavigableMap<K,V> headMap(K toKey) {
+ return headMap(toKey, false);
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if {@code fromKey} is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public ConcurrentNavigableMap<K,V> tailMap(K fromKey) {
+ return tailMap(fromKey, true);
+ }
+
+ /* ---------------- Relational operations -------------- */
+
+ /**
+ * Returns a key-value mapping associated with the greatest key
+ * strictly less than the given key, or <tt>null</tt> if there is
+ * no such key. The returned entry does <em>not</em> support the
+ * <tt>Entry.setValue</tt> method.
+ *
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified key is null
+ */
+ public Map.Entry<K,V> lowerEntry(K key) {
+ return getNear(key, LT);
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified key is null
+ */
+ public K lowerKey(K key) {
+ Node<K,V> n = findNear(key, LT);
+ return (n == null)? null : n.key;
+ }
+
+ /**
+ * Returns a key-value mapping associated with the greatest key
+ * less than or equal to the given key, or <tt>null</tt> if there
+ * is no such key. The returned entry does <em>not</em> support
+ * the <tt>Entry.setValue</tt> method.
+ *
+ * @param key the key
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified key is null
+ */
+ public Map.Entry<K,V> floorEntry(K key) {
+ return getNear(key, LT|EQ);
+ }
+
+ /**
+ * @param key the key
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified key is null
+ */
+ public K floorKey(K key) {
+ Node<K,V> n = findNear(key, LT|EQ);
+ return (n == null)? null : n.key;
+ }
+
+ /**
+ * Returns a key-value mapping associated with the least key
+ * greater than or equal to the given key, or <tt>null</tt> if
+ * there is no such entry. The returned entry does <em>not</em>
+ * support the <tt>Entry.setValue</tt> method.
+ *
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified key is null
+ */
+ public Map.Entry<K,V> ceilingEntry(K key) {
+ return getNear(key, GT|EQ);
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified key is null
+ */
+ public K ceilingKey(K key) {
+ Node<K,V> n = findNear(key, GT|EQ);
+ return (n == null)? null : n.key;
+ }
+
+ /**
+ * Returns a key-value mapping associated with the least key
+ * strictly greater than the given key, or <tt>null</tt> if there
+ * is no such key. The returned entry does <em>not</em> support
+ * the <tt>Entry.setValue</tt> method.
+ *
+ * @param key the key
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified key is null
+ */
+ public Map.Entry<K,V> higherEntry(K key) {
+ return getNear(key, GT);
+ }
+
+ /**
+ * @param key the key
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified key is null
+ */
+ public K higherKey(K key) {
+ Node<K,V> n = findNear(key, GT);
+ return (n == null)? null : n.key;
+ }
+
+ /**
+ * Returns a key-value mapping associated with the least
+ * key in this map, or <tt>null</tt> if the map is empty.
+ * The returned entry does <em>not</em> support
+ * the <tt>Entry.setValue</tt> method.
+ */
+ public Map.Entry<K,V> firstEntry() {
+ for (;;) {
+ Node<K,V> n = findFirst();
+ if (n == null)
+ return null;
+ AbstractMap.SimpleImmutableEntry<K,V> e = n.createSnapshot();
+ if (e != null)
+ return e;
+ }
+ }
+
+ /**
+ * Returns a key-value mapping associated with the greatest
+ * key in this map, or <tt>null</tt> if the map is empty.
+ * The returned entry does <em>not</em> support
+ * the <tt>Entry.setValue</tt> method.
+ */
+ public Map.Entry<K,V> lastEntry() {
+ for (;;) {
+ Node<K,V> n = findLast();
+ if (n == null)
+ return null;
+ AbstractMap.SimpleImmutableEntry<K,V> e = n.createSnapshot();
+ if (e != null)
+ return e;
+ }
+ }
+
+ /**
+ * Removes and returns a key-value mapping associated with
+ * the least key in this map, or <tt>null</tt> if the map is empty.
+ * The returned entry does <em>not</em> support
+ * the <tt>Entry.setValue</tt> method.
+ */
+ public Map.Entry<K,V> pollFirstEntry() {
+ return doRemoveFirstEntry();
+ }
+
+ /**
+ * Removes and returns a key-value mapping associated with
+ * the greatest key in this map, or <tt>null</tt> if the map is empty.
+ * The returned entry does <em>not</em> support
+ * the <tt>Entry.setValue</tt> method.
+ */
+ public Map.Entry<K,V> pollLastEntry() {
+ return doRemoveLastEntry();
+ }
+
+
+ /* ---------------- Iterators -------------- */
+
+ /**
+ * Base of iterator classes:
+ */
+ abstract class Iter<T> implements Iterator<T> {
+ /** the last node returned by next() */
+ Node<K,V> lastReturned;
+ /** the next node to return from next(); */
+ Node<K,V> next;
+ /** Cache of next value field to maintain weak consistency */
+ V nextValue;
+
+ /** Initializes ascending iterator for entire range. */
+ Iter() {
+ for (;;) {
+ next = findFirst();
+ if (next == null)
+ break;
+ Object x = next.value;
+ if (x != null && x != next) {
+ nextValue = (V) x;
+ break;
+ }
+ }
+ }
+
+ public final boolean hasNext() {
+ return next != null;
+ }
+
+ /** Advances next to higher entry. */
+ final void advance() {
+ if ((lastReturned = next) == null)
+ throw new NoSuchElementException();
+ for (;;) {
+ next = next.next;
+ if (next == null)
+ break;
+ Object x = next.value;
+ if (x != null && x != next) {
+ nextValue = (V) x;
+ break;
+ }
+ }
+ }
+
+ public void remove() {
+ Node<K,V> l = lastReturned;
+ if (l == null)
+ throw new IllegalStateException();
+ // It would not be worth all of the overhead to directly
+ // unlink from here. Using remove is fast enough.
+ ConcurrentSkipListMap.this.remove(l.key);
+ lastReturned = null;
+ }
+
+ }
+
+ final class ValueIterator extends Iter<V> {
+ public V next() {
+ V v = nextValue;
+ advance();
+ return v;
+ }
+ }
+
+ final class KeyIterator extends Iter<K> {
+ public K next() {
+ Node<K,V> n = next;
+ advance();
+ return n.key;
+ }
+ }
+
+ final class EntryIterator extends Iter<Map.Entry<K,V>> {
+ public Map.Entry<K,V> next() {
+ Node<K,V> n = next;
+ V v = nextValue;
+ advance();
+ return new AbstractMap.SimpleImmutableEntry<K,V>(n.key, v);
+ }
+ }
+
+ // Factory methods for iterators needed by ConcurrentSkipListSet etc
+
+ Iterator<K> keyIterator() {
+ return new KeyIterator();
+ }
+
+ Iterator<V> valueIterator() {
+ return new ValueIterator();
+ }
+
+ Iterator<Map.Entry<K,V>> entryIterator() {
+ return new EntryIterator();
+ }
+
+ /* ---------------- View Classes -------------- */
+
+ /*
+ * View classes are static, delegating to a ConcurrentNavigableMap
+ * to allow use by SubMaps, which outweighs the ugliness of
+ * needing type-tests for Iterator methods.
+ */
+
+ static final <E> List<E> toList(Collection<E> c) {
+ // Using size() here would be a pessimization.
+ List<E> list = new ArrayList<E>();
+ for (E e : c)
+ list.add(e);
+ return list;
+ }
+
+ static final class KeySet<E> extends AbstractSet<E> implements NavigableSet<E> {
+ private final ConcurrentNavigableMap<E,Object> m;
+ KeySet(ConcurrentNavigableMap<E,Object> map) { m = map; }
+ public int size() { return m.size(); }
+ public boolean isEmpty() { return m.isEmpty(); }
+ public boolean contains(Object o) { return m.containsKey(o); }
+ public boolean remove(Object o) { return m.remove(o) != null; }
+ public void clear() { m.clear(); }
+ public E lower(E e) { return m.lowerKey(e); }
+ public E floor(E e) { return m.floorKey(e); }
+ public E ceiling(E e) { return m.ceilingKey(e); }
+ public E higher(E e) { return m.higherKey(e); }
+ public Comparator<? super E> comparator() { return m.comparator(); }
+ public E first() { return m.firstKey(); }
+ public E last() { return m.lastKey(); }
+ public E pollFirst() {
+ Map.Entry<E,Object> e = m.pollFirstEntry();
+ return e == null? null : e.getKey();
+ }
+ public E pollLast() {
+ Map.Entry<E,Object> e = m.pollLastEntry();
+ return e == null? null : e.getKey();
+ }
+ public Iterator<E> iterator() {
+ if (m instanceof ConcurrentSkipListMap)
+ return ((ConcurrentSkipListMap<E,Object>)m).keyIterator();
+ else
+ return ((ConcurrentSkipListMap.SubMap<E,Object>)m).keyIterator();
+ }
+ public boolean equals(Object o) {
+ if (o == this)
+ return true;
+ if (!(o instanceof Set))
+ return false;
+ Collection<?> c = (Collection<?>) o;
+ try {
+ return containsAll(c) && c.containsAll(this);
+ } catch (ClassCastException unused) {
+ return false;
+ } catch (NullPointerException unused) {
+ return false;
+ }
+ }
+ public Object[] toArray() { return toList(this).toArray(); }
+ public <T> T[] toArray(T[] a) { return toList(this).toArray(a); }
+ public Iterator<E> descendingIterator() {
+ return descendingSet().iterator();
+ }
+ public NavigableSet<E> subSet(E fromElement,
+ boolean fromInclusive,
+ E toElement,
+ boolean toInclusive) {
+ return new ConcurrentSkipListSet<E>
+ (m.subMap(fromElement, fromInclusive,
+ toElement, toInclusive));
+ }
+ public NavigableSet<E> headSet(E toElement, boolean inclusive) {
+ return new ConcurrentSkipListSet<E>(m.headMap(toElement, inclusive));
+ }
+ public NavigableSet<E> tailSet(E fromElement, boolean inclusive) {
+ return new ConcurrentSkipListSet<E>(m.tailMap(fromElement, inclusive));
+ }
+ public NavigableSet<E> subSet(E fromElement, E toElement) {
+ return subSet(fromElement, true, toElement, false);
+ }
+ public NavigableSet<E> headSet(E toElement) {
+ return headSet(toElement, false);
+ }
+ public NavigableSet<E> tailSet(E fromElement) {
+ return tailSet(fromElement, true);
+ }
+ public NavigableSet<E> descendingSet() {
+ return new ConcurrentSkipListSet(m.descendingMap());
+ }
+ }
+
+ static final class Values<E> extends AbstractCollection<E> {
+ private final ConcurrentNavigableMap<Object, E> m;
+ Values(ConcurrentNavigableMap<Object, E> map) {
+ m = map;
+ }
+ public Iterator<E> iterator() {
+ if (m instanceof ConcurrentSkipListMap)
+ return ((ConcurrentSkipListMap<Object,E>)m).valueIterator();
+ else
+ return ((SubMap<Object,E>)m).valueIterator();
+ }
+ public boolean isEmpty() {
+ return m.isEmpty();
+ }
+ public int size() {
+ return m.size();
+ }
+ public boolean contains(Object o) {
+ return m.containsValue(o);
+ }
+ public void clear() {
+ m.clear();
+ }
+ public Object[] toArray() { return toList(this).toArray(); }
+ public <T> T[] toArray(T[] a) { return toList(this).toArray(a); }
+ }
+
+ static final class EntrySet<K1,V1> extends AbstractSet<Map.Entry<K1,V1>> {
+ private final ConcurrentNavigableMap<K1, V1> m;
+ EntrySet(ConcurrentNavigableMap<K1, V1> map) {
+ m = map;
+ }
+
+ public Iterator<Map.Entry<K1,V1>> iterator() {
+ if (m instanceof ConcurrentSkipListMap)
+ return ((ConcurrentSkipListMap<K1,V1>)m).entryIterator();
+ else
+ return ((SubMap<K1,V1>)m).entryIterator();
+ }
+
+ public boolean contains(Object o) {
+ if (!(o instanceof Map.Entry))
+ return false;
+ Map.Entry<K1,V1> e = (Map.Entry<K1,V1>)o;
+ V1 v = m.get(e.getKey());
+ return v != null && v.equals(e.getValue());
+ }
+ public boolean remove(Object o) {
+ if (!(o instanceof Map.Entry))
+ return false;
+ Map.Entry<K1,V1> e = (Map.Entry<K1,V1>)o;
+ return m.remove(e.getKey(),
+ e.getValue());
+ }
+ public boolean isEmpty() {
+ return m.isEmpty();
+ }
+ public int size() {
+ return m.size();
+ }
+ public void clear() {
+ m.clear();
+ }
+ public boolean equals(Object o) {
+ if (o == this)
+ return true;
+ if (!(o instanceof Set))
+ return false;
+ Collection<?> c = (Collection<?>) o;
+ try {
+ return containsAll(c) && c.containsAll(this);
+ } catch (ClassCastException unused) {
+ return false;
+ } catch (NullPointerException unused) {
+ return false;
+ }
+ }
+ public Object[] toArray() { return toList(this).toArray(); }
+ public <T> T[] toArray(T[] a) { return toList(this).toArray(a); }
+ }
+
+ /**
+ * Submaps returned by {@link ConcurrentSkipListMap} submap operations
+ * represent a subrange of mappings of their underlying
+ * maps. Instances of this class support all methods of their
+ * underlying maps, differing in that mappings outside their range are
+ * ignored, and attempts to add mappings outside their ranges result
+ * in {@link IllegalArgumentException}. Instances of this class are
+ * constructed only using the <tt>subMap</tt>, <tt>headMap</tt>, and
+ * <tt>tailMap</tt> methods of their underlying maps.
+ *
+ * @serial include
+ */
+ static final class SubMap<K,V> extends AbstractMap<K,V>
+ implements ConcurrentNavigableMap<K,V>, Cloneable,
+ java.io.Serializable {
+ private static final long serialVersionUID = -7647078645895051609L;
+
+ /** Underlying map */
+ private final ConcurrentSkipListMap<K,V> m;
+ /** lower bound key, or null if from start */
+ private final K lo;
+ /** upper bound key, or null if to end */
+ private final K hi;
+ /** inclusion flag for lo */
+ private final boolean loInclusive;
+ /** inclusion flag for hi */
+ private final boolean hiInclusive;
+ /** direction */
+ private final boolean isDescending;
+
+ // Lazily initialized view holders
+ private transient KeySet<K> keySetView;
+ private transient Set<Map.Entry<K,V>> entrySetView;
+ private transient Collection<V> valuesView;
+
+ /**
+ * Creates a new submap, initializing all fields
+ */
+ SubMap(ConcurrentSkipListMap<K,V> map,
+ K fromKey, boolean fromInclusive,
+ K toKey, boolean toInclusive,
+ boolean isDescending) {
+ if (fromKey != null && toKey != null &&
+ map.compare(fromKey, toKey) > 0)
+ throw new IllegalArgumentException("inconsistent range");
+ this.m = map;
+ this.lo = fromKey;
+ this.hi = toKey;
+ this.loInclusive = fromInclusive;
+ this.hiInclusive = toInclusive;
+ this.isDescending = isDescending;
+ }
+
+ /* ---------------- Utilities -------------- */
+
+ private boolean tooLow(K key) {
+ if (lo != null) {
+ int c = m.compare(key, lo);
+ if (c < 0 || (c == 0 && !loInclusive))
+ return true;
+ }
+ return false;
+ }
+
+ private boolean tooHigh(K key) {
+ if (hi != null) {
+ int c = m.compare(key, hi);
+ if (c > 0 || (c == 0 && !hiInclusive))
+ return true;
+ }
+ return false;
+ }
+
+ private boolean inBounds(K key) {
+ return !tooLow(key) && !tooHigh(key);
+ }
+
+ private void checkKeyBounds(K key) throws IllegalArgumentException {
+ if (key == null)
+ throw new NullPointerException();
+ if (!inBounds(key))
+ throw new IllegalArgumentException("key out of range");
+ }
+
+ /**
+ * Returns true if node key is less than upper bound of range
+ */
+ private boolean isBeforeEnd(ConcurrentSkipListMap.Node<K,V> n) {
+ if (n == null)
+ return false;
+ if (hi == null)
+ return true;
+ K k = n.key;
+ if (k == null) // pass by markers and headers
+ return true;
+ int c = m.compare(k, hi);
+ if (c > 0 || (c == 0 && !hiInclusive))
+ return false;
+ return true;
+ }
+
+ /**
+ * Returns lowest node. This node might not be in range, so
+ * most usages need to check bounds
+ */
+ private ConcurrentSkipListMap.Node<K,V> loNode() {
+ if (lo == null)
+ return m.findFirst();
+ else if (loInclusive)
+ return m.findNear(lo, m.GT|m.EQ);
+ else
+ return m.findNear(lo, m.GT);
+ }
+
+ /**
+ * Returns highest node. This node might not be in range, so
+ * most usages need to check bounds
+ */
+ private ConcurrentSkipListMap.Node<K,V> hiNode() {
+ if (hi == null)
+ return m.findLast();
+ else if (hiInclusive)
+ return m.findNear(hi, m.LT|m.EQ);
+ else
+ return m.findNear(hi, m.LT);
+ }
+
+ /**
+ * Returns lowest absolute key (ignoring directonality)
+ */
+ private K lowestKey() {
+ ConcurrentSkipListMap.Node<K,V> n = loNode();
+ if (isBeforeEnd(n))
+ return n.key;
+ else
+ throw new NoSuchElementException();
+ }
+
+ /**
+ * Returns highest absolute key (ignoring directonality)
+ */
+ private K highestKey() {
+ ConcurrentSkipListMap.Node<K,V> n = hiNode();
+ if (n != null) {
+ K last = n.key;
+ if (inBounds(last))
+ return last;
+ }
+ throw new NoSuchElementException();
+ }
+
+ private Map.Entry<K,V> lowestEntry() {
+ for (;;) {
+ ConcurrentSkipListMap.Node<K,V> n = loNode();
+ if (!isBeforeEnd(n))
+ return null;
+ Map.Entry<K,V> e = n.createSnapshot();
+ if (e != null)
+ return e;
+ }
+ }
+
+ private Map.Entry<K,V> highestEntry() {
+ for (;;) {
+ ConcurrentSkipListMap.Node<K,V> n = hiNode();
+ if (n == null || !inBounds(n.key))
+ return null;
+ Map.Entry<K,V> e = n.createSnapshot();
+ if (e != null)
+ return e;
+ }
+ }
+
+ private Map.Entry<K,V> removeLowest() {
+ for (;;) {
+ Node<K,V> n = loNode();
+ if (n == null)
+ return null;
+ K k = n.key;
+ if (!inBounds(k))
+ return null;
+ V v = m.doRemove(k, null);
+ if (v != null)
+ return new AbstractMap.SimpleImmutableEntry<K,V>(k, v);
+ }
+ }
+
+ private Map.Entry<K,V> removeHighest() {
+ for (;;) {
+ Node<K,V> n = hiNode();
+ if (n == null)
+ return null;
+ K k = n.key;
+ if (!inBounds(k))
+ return null;
+ V v = m.doRemove(k, null);
+ if (v != null)
+ return new AbstractMap.SimpleImmutableEntry<K,V>(k, v);
+ }
+ }
+
+ /**
+ * Submap version of ConcurrentSkipListMap.getNearEntry
+ */
+ private Map.Entry<K,V> getNearEntry(K key, int rel) {
+ if (isDescending) { // adjust relation for direction
+ if ((rel & m.LT) == 0)
+ rel |= m.LT;
+ else
+ rel &= ~m.LT;
+ }
+ if (tooLow(key))
+ return ((rel & m.LT) != 0)? null : lowestEntry();
+ if (tooHigh(key))
+ return ((rel & m.LT) != 0)? highestEntry() : null;
+ for (;;) {
+ Node<K,V> n = m.findNear(key, rel);
+ if (n == null || !inBounds(n.key))
+ return null;
+ K k = n.key;
+ V v = n.getValidValue();
+ if (v != null)
+ return new AbstractMap.SimpleImmutableEntry<K,V>(k, v);
+ }
+ }
+
+ // Almost the same as getNearEntry, except for keys
+ private K getNearKey(K key, int rel) {
+ if (isDescending) { // adjust relation for direction
+ if ((rel & m.LT) == 0)
+ rel |= m.LT;
+ else
+ rel &= ~m.LT;
+ }
+ if (tooLow(key)) {
+ if ((rel & m.LT) == 0) {
+ ConcurrentSkipListMap.Node<K,V> n = loNode();
+ if (isBeforeEnd(n))
+ return n.key;
+ }
+ return null;
+ }
+ if (tooHigh(key)) {
+ if ((rel & m.LT) != 0) {
+ ConcurrentSkipListMap.Node<K,V> n = hiNode();
+ if (n != null) {
+ K last = n.key;
+ if (inBounds(last))
+ return last;
+ }
+ }
+ return null;
+ }
+ for (;;) {
+ Node<K,V> n = m.findNear(key, rel);
+ if (n == null || !inBounds(n.key))
+ return null;
+ K k = n.key;
+ V v = n.getValidValue();
+ if (v != null)
+ return k;
+ }
+ }
+
+ /* ---------------- Map API methods -------------- */
+
+ public boolean containsKey(Object key) {
+ if (key == null) throw new NullPointerException();
+ K k = (K)key;
+ return inBounds(k) && m.containsKey(k);
+ }
+
+ public V get(Object key) {
+ if (key == null) throw new NullPointerException();
+ K k = (K)key;
+ return ((!inBounds(k)) ? null : m.get(k));
+ }
+
+ public V put(K key, V value) {
+ checkKeyBounds(key);
+ return m.put(key, value);
+ }
+
+ public V remove(Object key) {
+ K k = (K)key;
+ return (!inBounds(k))? null : m.remove(k);
+ }
+
+ public int size() {
+ long count = 0;
+ for (ConcurrentSkipListMap.Node<K,V> n = loNode();
+ isBeforeEnd(n);
+ n = n.next) {
+ if (n.getValidValue() != null)
+ ++count;
+ }
+ return count >= Integer.MAX_VALUE? Integer.MAX_VALUE : (int)count;
+ }
+
+ public boolean isEmpty() {
+ return !isBeforeEnd(loNode());
+ }
+
+ public boolean containsValue(Object value) {
+ if (value == null)
+ throw new NullPointerException();
+ for (ConcurrentSkipListMap.Node<K,V> n = loNode();
+ isBeforeEnd(n);
+ n = n.next) {
+ V v = n.getValidValue();
+ if (v != null && value.equals(v))
+ return true;
+ }
+ return false;
+ }
+
+ public void clear() {
+ for (ConcurrentSkipListMap.Node<K,V> n = loNode();
+ isBeforeEnd(n);
+ n = n.next) {
+ if (n.getValidValue() != null)
+ m.remove(n.key);
+ }
+ }
+
+ /* ---------------- ConcurrentMap API methods -------------- */
+
+ public V putIfAbsent(K key, V value) {
+ checkKeyBounds(key);
+ return m.putIfAbsent(key, value);
+ }
+
+ public boolean remove(Object key, Object value) {
+ K k = (K)key;
+ return inBounds(k) && m.remove(k, value);
+ }
+
+ public boolean replace(K key, V oldValue, V newValue) {
+ checkKeyBounds(key);
+ return m.replace(key, oldValue, newValue);
+ }
+
+ public V replace(K key, V value) {
+ checkKeyBounds(key);
+ return m.replace(key, value);
+ }
+
+ /* ---------------- SortedMap API methods -------------- */
+
+ public Comparator<? super K> comparator() {
+ Comparator<? super K> cmp = m.comparator();
+ if (isDescending)
+ return Collections.reverseOrder(cmp);
+ else
+ return cmp;
+ }
+
+ /**
+ * Utility to create submaps, where given bounds override
+ * unbounded(null) ones and/or are checked against bounded ones.
+ */
+ private SubMap<K,V> newSubMap(K fromKey,
+ boolean fromInclusive,
+ K toKey,
+ boolean toInclusive) {
+ if (isDescending) { // flip senses
+ K tk = fromKey;
+ fromKey = toKey;
+ toKey = tk;
+ boolean ti = fromInclusive;
+ fromInclusive = toInclusive;
+ toInclusive = ti;
+ }
+ if (lo != null) {
+ if (fromKey == null) {
+ fromKey = lo;
+ fromInclusive = loInclusive;
+ }
+ else {
+ int c = m.compare(fromKey, lo);
+ if (c < 0 || (c == 0 && !loInclusive && fromInclusive))
+ throw new IllegalArgumentException("key out of range");
+ }
+ }
+ if (hi != null) {
+ if (toKey == null) {
+ toKey = hi;
+ toInclusive = hiInclusive;
+ }
+ else {
+ int c = m.compare(toKey, hi);
+ if (c > 0 || (c == 0 && !hiInclusive && toInclusive))
+ throw new IllegalArgumentException("key out of range");
+ }
+ }
+ return new SubMap<K,V>(m, fromKey, fromInclusive,
+ toKey, toInclusive, isDescending);
+ }
+
+ public SubMap<K,V> subMap(K fromKey,
+ boolean fromInclusive,
+ K toKey,
+ boolean toInclusive) {
+ if (fromKey == null || toKey == null)
+ throw new NullPointerException();
+ return newSubMap(fromKey, fromInclusive, toKey, toInclusive);
+ }
+
+ public SubMap<K,V> headMap(K toKey,
+ boolean inclusive) {
+ if (toKey == null)
+ throw new NullPointerException();
+ return newSubMap(null, false, toKey, inclusive);
+ }
+
+ public SubMap<K,V> tailMap(K fromKey,
+ boolean inclusive) {
+ if (fromKey == null)
+ throw new NullPointerException();
+ return newSubMap(fromKey, inclusive, null, false);
+ }
+
+ public SubMap<K,V> subMap(K fromKey, K toKey) {
+ return subMap(fromKey, true, toKey, false);
+ }
+
+ public SubMap<K,V> headMap(K toKey) {
+ return headMap(toKey, false);
+ }
+
+ public SubMap<K,V> tailMap(K fromKey) {
+ return tailMap(fromKey, true);
+ }
+
+ public SubMap<K,V> descendingMap() {
+ return new SubMap<K,V>(m, lo, loInclusive,
+ hi, hiInclusive, !isDescending);
+ }
+
+ /* ---------------- Relational methods -------------- */
+
+ public Map.Entry<K,V> ceilingEntry(K key) {
+ return getNearEntry(key, (m.GT|m.EQ));
+ }
+
+ public K ceilingKey(K key) {
+ return getNearKey(key, (m.GT|m.EQ));
+ }
+
+ public Map.Entry<K,V> lowerEntry(K key) {
+ return getNearEntry(key, (m.LT));
+ }
+
+ public K lowerKey(K key) {
+ return getNearKey(key, (m.LT));
+ }
+
+ public Map.Entry<K,V> floorEntry(K key) {
+ return getNearEntry(key, (m.LT|m.EQ));
+ }
+
+ public K floorKey(K key) {
+ return getNearKey(key, (m.LT|m.EQ));
+ }
+
+ public Map.Entry<K,V> higherEntry(K key) {
+ return getNearEntry(key, (m.GT));
+ }
+
+ public K higherKey(K key) {
+ return getNearKey(key, (m.GT));
+ }
+
+ public K firstKey() {
+ return isDescending? highestKey() : lowestKey();
+ }
+
+ public K lastKey() {
+ return isDescending? lowestKey() : highestKey();
+ }
+
+ public Map.Entry<K,V> firstEntry() {
+ return isDescending? highestEntry() : lowestEntry();
+ }
+
+ public Map.Entry<K,V> lastEntry() {
+ return isDescending? lowestEntry() : highestEntry();
+ }
+
+ public Map.Entry<K,V> pollFirstEntry() {
+ return isDescending? removeHighest() : removeLowest();
+ }
+
+ public Map.Entry<K,V> pollLastEntry() {
+ return isDescending? removeLowest() : removeHighest();
+ }
+
+ /* ---------------- Submap Views -------------- */
+
+ public NavigableSet<K> keySet() {
+ KeySet<K> ks = keySetView;
+ return (ks != null) ? ks : (keySetView = new KeySet(this));
+ }
+
+ public NavigableSet<K> navigableKeySet() {
+ KeySet<K> ks = keySetView;
+ return (ks != null) ? ks : (keySetView = new KeySet(this));
+ }
+
+ public Collection<V> values() {
+ Collection<V> vs = valuesView;
+ return (vs != null) ? vs : (valuesView = new Values(this));
+ }
+
+ public Set<Map.Entry<K,V>> entrySet() {
+ Set<Map.Entry<K,V>> es = entrySetView;
+ return (es != null) ? es : (entrySetView = new EntrySet(this));
+ }
+
+ public NavigableSet<K> descendingKeySet() {
+ return descendingMap().navigableKeySet();
+ }
+
+ Iterator<K> keyIterator() {
+ return new SubMapKeyIterator();
+ }
+
+ Iterator<V> valueIterator() {
+ return new SubMapValueIterator();
+ }
+
+ Iterator<Map.Entry<K,V>> entryIterator() {
+ return new SubMapEntryIterator();
+ }
+
+ /**
+ * Variant of main Iter class to traverse through submaps.
+ */
+ abstract class SubMapIter<T> implements Iterator<T> {
+ /** the last node returned by next() */
+ Node<K,V> lastReturned;
+ /** the next node to return from next(); */
+ Node<K,V> next;
+ /** Cache of next value field to maintain weak consistency */
+ V nextValue;
+
+ SubMapIter() {
+ for (;;) {
+ next = isDescending ? hiNode() : loNode();
+ if (next == null)
+ break;
+ Object x = next.value;
+ if (x != null && x != next) {
+ if (! inBounds(next.key))
+ next = null;
+ else
+ nextValue = (V) x;
+ break;
+ }
+ }
+ }
+
+ public final boolean hasNext() {
+ return next != null;
+ }
+
+ final void advance() {
+ if ((lastReturned = next) == null)
+ throw new NoSuchElementException();
+ if (isDescending)
+ descend();
+ else
+ ascend();
+ }
+
+ private void ascend() {
+ for (;;) {
+ next = next.next;
+ if (next == null)
+ break;
+ Object x = next.value;
+ if (x != null && x != next) {
+ if (tooHigh(next.key))
+ next = null;
+ else
+ nextValue = (V) x;
+ break;
+ }
+ }
+ }
+
+ private void descend() {
+ for (;;) {
+ next = m.findNear(lastReturned.key, LT);
+ if (next == null)
+ break;
+ Object x = next.value;
+ if (x != null && x != next) {
+ if (tooLow(next.key))
+ next = null;
+ else
+ nextValue = (V) x;
+ break;
+ }
+ }
+ }
+
+ public void remove() {
+ Node<K,V> l = lastReturned;
+ if (l == null)
+ throw new IllegalStateException();
+ m.remove(l.key);
+ lastReturned = null;
+ }
+
+ }
+
+ final class SubMapValueIterator extends SubMapIter<V> {
+ public V next() {
+ V v = nextValue;
+ advance();
+ return v;
+ }
+ }
+
+ final class SubMapKeyIterator extends SubMapIter<K> {
+ public K next() {
+ Node<K,V> n = next;
+ advance();
+ return n.key;
+ }
+ }
+
+ final class SubMapEntryIterator extends SubMapIter<Map.Entry<K,V>> {
+ public Map.Entry<K,V> next() {
+ Node<K,V> n = next;
+ V v = nextValue;
+ advance();
+ return new AbstractMap.SimpleImmutableEntry<K,V>(n.key, v);
+ }
+ }
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentSkipListSet.java b/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentSkipListSet.java
new file mode 100644
index 00000000000..7da50d593ae
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ConcurrentSkipListSet.java
@@ -0,0 +1,456 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.*;
+import sun.misc.Unsafe;
+
+/**
+ * A scalable concurrent {@link NavigableSet} implementation based on
+ * a {@link ConcurrentSkipListMap}. The elements of the set are kept
+ * sorted according to their {@linkplain Comparable natural ordering},
+ * or by a {@link Comparator} provided at set creation time, depending
+ * on which constructor is used.
+ *
+ * <p>This implementation provides expected average <i>log(n)</i> time
+ * cost for the <tt>contains</tt>, <tt>add</tt>, and <tt>remove</tt>
+ * operations and their variants. Insertion, removal, and access
+ * operations safely execute concurrently by multiple threads.
+ * Iterators are <i>weakly consistent</i>, returning elements
+ * reflecting the state of the set at some point at or since the
+ * creation of the iterator. They do <em>not</em> throw {@link
+ * ConcurrentModificationException}, and may proceed concurrently with
+ * other operations. Ascending ordered views and their iterators are
+ * faster than descending ones.
+ *
+ * <p>Beware that, unlike in most collections, the <tt>size</tt>
+ * method is <em>not</em> a constant-time operation. Because of the
+ * asynchronous nature of these sets, determining the current number
+ * of elements requires a traversal of the elements. Additionally, the
+ * bulk operations <tt>addAll</tt>, <tt>removeAll</tt>,
+ * <tt>retainAll</tt>, and <tt>containsAll</tt> are <em>not</em>
+ * guaranteed to be performed atomically. For example, an iterator
+ * operating concurrently with an <tt>addAll</tt> operation might view
+ * only some of the added elements.
+ *
+ * <p>This class and its iterators implement all of the
+ * <em>optional</em> methods of the {@link Set} and {@link Iterator}
+ * interfaces. Like most other concurrent collection implementations,
+ * this class does not permit the use of <tt>null</tt> elements,
+ * because <tt>null</tt> arguments and return values cannot be reliably
+ * distinguished from the absence of elements.
+ *
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @author Doug Lea
+ * @param <E> the type of elements maintained by this set
+ * @since 1.6
+ */
+public class ConcurrentSkipListSet<E>
+ extends AbstractSet<E>
+ implements NavigableSet<E>, Cloneable, java.io.Serializable {
+
+ private static final long serialVersionUID = -2479143111061671589L;
+
+ /**
+ * The underlying map. Uses Boolean.TRUE as value for each
+ * element. This field is declared final for the sake of thread
+ * safety, which entails some ugliness in clone()
+ */
+ private final ConcurrentNavigableMap<E,Object> m;
+
+ /**
+ * Constructs a new, empty set that orders its elements according to
+ * their {@linkplain Comparable natural ordering}.
+ */
+ public ConcurrentSkipListSet() {
+ m = new ConcurrentSkipListMap<E,Object>();
+ }
+
+ /**
+ * Constructs a new, empty set that orders its elements according to
+ * the specified comparator.
+ *
+ * @param comparator the comparator that will be used to order this set.
+ * If <tt>null</tt>, the {@linkplain Comparable natural
+ * ordering} of the elements will be used.
+ */
+ public ConcurrentSkipListSet(Comparator<? super E> comparator) {
+ m = new ConcurrentSkipListMap<E,Object>(comparator);
+ }
+
+ /**
+ * Constructs a new set containing the elements in the specified
+ * collection, that orders its elements according to their
+ * {@linkplain Comparable natural ordering}.
+ *
+ * @param c The elements that will comprise the new set
+ * @throws ClassCastException if the elements in <tt>c</tt> are
+ * not {@link Comparable}, or are not mutually comparable
+ * @throws NullPointerException if the specified collection or any
+ * of its elements are null
+ */
+ public ConcurrentSkipListSet(Collection<? extends E> c) {
+ m = new ConcurrentSkipListMap<E,Object>();
+ addAll(c);
+ }
+
+ /**
+ * Constructs a new set containing the same elements and using the
+ * same ordering as the specified sorted set.
+ *
+ * @param s sorted set whose elements will comprise the new set
+ * @throws NullPointerException if the specified sorted set or any
+ * of its elements are null
+ */
+ public ConcurrentSkipListSet(SortedSet<E> s) {
+ m = new ConcurrentSkipListMap<E,Object>(s.comparator());
+ addAll(s);
+ }
+
+ /**
+ * For use by submaps
+ */
+ ConcurrentSkipListSet(ConcurrentNavigableMap<E,Object> m) {
+ this.m = m;
+ }
+
+ /**
+ * Returns a shallow copy of this <tt>ConcurrentSkipListSet</tt>
+ * instance. (The elements themselves are not cloned.)
+ *
+ * @return a shallow copy of this set
+ */
+ public ConcurrentSkipListSet<E> clone() {
+ ConcurrentSkipListSet<E> clone = null;
+ try {
+ clone = (ConcurrentSkipListSet<E>) super.clone();
+ clone.setMap(new ConcurrentSkipListMap(m));
+ } catch (CloneNotSupportedException e) {
+ throw new InternalError();
+ }
+
+ return clone;
+ }
+
+ /* ---------------- Set operations -------------- */
+
+ /**
+ * Returns the number of elements in this set. If this set
+ * contains more than <tt>Integer.MAX_VALUE</tt> elements, it
+ * returns <tt>Integer.MAX_VALUE</tt>.
+ *
+ * <p>Beware that, unlike in most collections, this method is
+ * <em>NOT</em> a constant-time operation. Because of the
+ * asynchronous nature of these sets, determining the current
+ * number of elements requires traversing them all to count them.
+ * Additionally, it is possible for the size to change during
+ * execution of this method, in which case the returned result
+ * will be inaccurate. Thus, this method is typically not very
+ * useful in concurrent applications.
+ *
+ * @return the number of elements in this set
+ */
+ public int size() {
+ return m.size();
+ }
+
+ /**
+ * Returns <tt>true</tt> if this set contains no elements.
+ * @return <tt>true</tt> if this set contains no elements
+ */
+ public boolean isEmpty() {
+ return m.isEmpty();
+ }
+
+ /**
+ * Returns <tt>true</tt> if this set contains the specified element.
+ * More formally, returns <tt>true</tt> if and only if this set
+ * contains an element <tt>e</tt> such that <tt>o.equals(e)</tt>.
+ *
+ * @param o object to be checked for containment in this set
+ * @return <tt>true</tt> if this set contains the specified element
+ * @throws ClassCastException if the specified element cannot be
+ * compared with the elements currently in this set
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean contains(Object o) {
+ return m.containsKey(o);
+ }
+
+ /**
+ * Adds the specified element to this set if it is not already present.
+ * More formally, adds the specified element <tt>e</tt> to this set if
+ * the set contains no element <tt>e2</tt> such that <tt>e.equals(e2)</tt>.
+ * If this set already contains the element, the call leaves the set
+ * unchanged and returns <tt>false</tt>.
+ *
+ * @param e element to be added to this set
+ * @return <tt>true</tt> if this set did not already contain the
+ * specified element
+ * @throws ClassCastException if <tt>e</tt> cannot be compared
+ * with the elements currently in this set
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean add(E e) {
+ return m.putIfAbsent(e, Boolean.TRUE) == null;
+ }
+
+ /**
+ * Removes the specified element from this set if it is present.
+ * More formally, removes an element <tt>e</tt> such that
+ * <tt>o.equals(e)</tt>, if this set contains such an element.
+ * Returns <tt>true</tt> if this set contained the element (or
+ * equivalently, if this set changed as a result of the call).
+ * (This set will not contain the element once the call returns.)
+ *
+ * @param o object to be removed from this set, if present
+ * @return <tt>true</tt> if this set contained the specified element
+ * @throws ClassCastException if <tt>o</tt> cannot be compared
+ * with the elements currently in this set
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean remove(Object o) {
+ return m.remove(o, Boolean.TRUE);
+ }
+
+ /**
+ * Removes all of the elements from this set.
+ */
+ public void clear() {
+ m.clear();
+ }
+
+ /**
+ * Returns an iterator over the elements in this set in ascending order.
+ *
+ * @return an iterator over the elements in this set in ascending order
+ */
+ public Iterator<E> iterator() {
+ return m.navigableKeySet().iterator();
+ }
+
+ /**
+ * Returns an iterator over the elements in this set in descending order.
+ *
+ * @return an iterator over the elements in this set in descending order
+ */
+ public Iterator<E> descendingIterator() {
+ return m.descendingKeySet().iterator();
+ }
+
+
+ /* ---------------- AbstractSet Overrides -------------- */
+
+ /**
+ * Compares the specified object with this set for equality. Returns
+ * <tt>true</tt> if the specified object is also a set, the two sets
+ * have the same size, and every member of the specified set is
+ * contained in this set (or equivalently, every member of this set is
+ * contained in the specified set). This definition ensures that the
+ * equals method works properly across different implementations of the
+ * set interface.
+ *
+ * @param o the object to be compared for equality with this set
+ * @return <tt>true</tt> if the specified object is equal to this set
+ */
+ public boolean equals(Object o) {
+ // Override AbstractSet version to avoid calling size()
+ if (o == this)
+ return true;
+ if (!(o instanceof Set))
+ return false;
+ Collection<?> c = (Collection<?>) o;
+ try {
+ return containsAll(c) && c.containsAll(this);
+ } catch (ClassCastException unused) {
+ return false;
+ } catch (NullPointerException unused) {
+ return false;
+ }
+ }
+
+ /**
+ * Removes from this set all of its elements that are contained in
+ * the specified collection. If the specified collection is also
+ * a set, this operation effectively modifies this set so that its
+ * value is the <i>asymmetric set difference</i> of the two sets.
+ *
+ * @param c collection containing elements to be removed from this set
+ * @return <tt>true</tt> if this set changed as a result of the call
+ * @throws ClassCastException if the types of one or more elements in this
+ * set are incompatible with the specified collection
+ * @throws NullPointerException if the specified collection or any
+ * of its elements are null
+ */
+ public boolean removeAll(Collection<?> c) {
+ // Override AbstractSet version to avoid unnecessary call to size()
+ boolean modified = false;
+ for (Iterator<?> i = c.iterator(); i.hasNext(); )
+ if (remove(i.next()))
+ modified = true;
+ return modified;
+ }
+
+ /* ---------------- Relational operations -------------- */
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified element is null
+ */
+ public E lower(E e) {
+ return m.lowerKey(e);
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified element is null
+ */
+ public E floor(E e) {
+ return m.floorKey(e);
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified element is null
+ */
+ public E ceiling(E e) {
+ return m.ceilingKey(e);
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if the specified element is null
+ */
+ public E higher(E e) {
+ return m.higherKey(e);
+ }
+
+ public E pollFirst() {
+ Map.Entry<E,Object> e = m.pollFirstEntry();
+ return e == null? null : e.getKey();
+ }
+
+ public E pollLast() {
+ Map.Entry<E,Object> e = m.pollLastEntry();
+ return e == null? null : e.getKey();
+ }
+
+
+ /* ---------------- SortedSet operations -------------- */
+
+
+ public Comparator<? super E> comparator() {
+ return m.comparator();
+ }
+
+ /**
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public E first() {
+ return m.firstKey();
+ }
+
+ /**
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public E last() {
+ return m.lastKey();
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if {@code fromElement} or
+ * {@code toElement} is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public NavigableSet<E> subSet(E fromElement,
+ boolean fromInclusive,
+ E toElement,
+ boolean toInclusive) {
+ return new ConcurrentSkipListSet<E>
+ (m.subMap(fromElement, fromInclusive,
+ toElement, toInclusive));
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if {@code toElement} is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public NavigableSet<E> headSet(E toElement, boolean inclusive) {
+ return new ConcurrentSkipListSet<E>(m.headMap(toElement, inclusive));
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if {@code fromElement} is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public NavigableSet<E> tailSet(E fromElement, boolean inclusive) {
+ return new ConcurrentSkipListSet<E>(m.tailMap(fromElement, inclusive));
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if {@code fromElement} or
+ * {@code toElement} is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public NavigableSet<E> subSet(E fromElement, E toElement) {
+ return subSet(fromElement, true, toElement, false);
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if {@code toElement} is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public NavigableSet<E> headSet(E toElement) {
+ return headSet(toElement, false);
+ }
+
+ /**
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException if {@code fromElement} is null
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public NavigableSet<E> tailSet(E fromElement) {
+ return tailSet(fromElement, true);
+ }
+
+ /**
+ * Returns a reverse order view of the elements contained in this set.
+ * The descending set is backed by this set, so changes to the set are
+ * reflected in the descending set, and vice-versa.
+ *
+ * <p>The returned set has an ordering equivalent to
+ * <tt>{@link Collections#reverseOrder(Comparator) Collections.reverseOrder}(comparator())</tt>.
+ * The expression {@code s.descendingSet().descendingSet()} returns a
+ * view of {@code s} essentially equivalent to {@code s}.
+ *
+ * @return a reverse order view of this set
+ */
+ public NavigableSet<E> descendingSet() {
+ return new ConcurrentSkipListSet(m.descendingMap());
+ }
+
+ // Support for resetting map in clone
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private static final long mapOffset;
+ static {
+ try {
+ mapOffset = unsafe.objectFieldOffset
+ (ConcurrentSkipListSet.class.getDeclaredField("m"));
+ } catch (Exception ex) { throw new Error(ex); }
+ }
+ private void setMap(ConcurrentNavigableMap<E,Object> map) {
+ unsafe.putObjectVolatile(this, mapOffset, map);
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/CopyOnWriteArraySet.java b/libjava/classpath/external/jsr166/java/util/concurrent/CopyOnWriteArraySet.java
new file mode 100644
index 00000000000..39c0e5868de
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/CopyOnWriteArraySet.java
@@ -0,0 +1,364 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain. Use, modify, and
+ * redistribute this code in any way without acknowledgement.
+ */
+
+package java.util.concurrent;
+import java.util.*;
+
+/**
+ * A {@link java.util.Set} that uses an internal {@link CopyOnWriteArrayList}
+ * for all of its operations. Thus, it shares the same basic properties:
+ * <ul>
+ * <li>It is best suited for applications in which set sizes generally
+ * stay small, read-only operations
+ * vastly outnumber mutative operations, and you need
+ * to prevent interference among threads during traversal.
+ * <li>It is thread-safe.
+ * <li>Mutative operations (<tt>add</tt>, <tt>set</tt>, <tt>remove</tt>, etc.)
+ * are expensive since they usually entail copying the entire underlying
+ * array.
+ * <li>Iterators do not support the mutative <tt>remove</tt> operation.
+ * <li>Traversal via iterators is fast and cannot encounter
+ * interference from other threads. Iterators rely on
+ * unchanging snapshots of the array at the time the iterators were
+ * constructed.
+ * </ul>
+ *
+ * <p> <b>Sample Usage.</b> The following code sketch uses a
+ * copy-on-write set to maintain a set of Handler objects that
+ * perform some action upon state updates.
+ *
+ * <pre>
+ * class Handler { void handle(); ... }
+ *
+ * class X {
+ * private final CopyOnWriteArraySet&lt;Handler&gt; handlers
+ * = new CopyOnWriteArraySet&lt;Handler&gt;();
+ * public void addHandler(Handler h) { handlers.add(h); }
+ *
+ * private long internalState;
+ * private synchronized void changeState() { internalState = ...; }
+ *
+ * public void update() {
+ * changeState();
+ * for (Handler handler : handlers)
+ * handler.handle();
+ * }
+ * }
+ * </pre>
+ *
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @see CopyOnWriteArrayList
+ * @since 1.5
+ * @author Doug Lea
+ * @param <E> the type of elements held in this collection
+ */
+public class CopyOnWriteArraySet<E> extends AbstractSet<E>
+ implements java.io.Serializable {
+ private static final long serialVersionUID = 5457747651344034263L;
+
+ private final CopyOnWriteArrayList<E> al;
+
+ /**
+ * Creates an empty set.
+ */
+ public CopyOnWriteArraySet() {
+ al = new CopyOnWriteArrayList<E>();
+ }
+
+ /**
+ * Creates a set containing all of the elements of the specified
+ * collection.
+ *
+ * @param c the collection of elements to initially contain
+ * @throws NullPointerException if the specified collection is null
+ */
+ public CopyOnWriteArraySet(Collection<? extends E> c) {
+ al = new CopyOnWriteArrayList<E>();
+ al.addAllAbsent(c);
+ }
+
+ /**
+ * Returns the number of elements in this set.
+ *
+ * @return the number of elements in this set
+ */
+ public int size() {
+ return al.size();
+ }
+
+ /**
+ * Returns <tt>true</tt> if this set contains no elements.
+ *
+ * @return <tt>true</tt> if this set contains no elements
+ */
+ public boolean isEmpty() {
+ return al.isEmpty();
+ }
+
+ /**
+ * Returns <tt>true</tt> if this set contains the specified element.
+ * More formally, returns <tt>true</tt> if and only if this set
+ * contains an element <tt>e</tt> such that
+ * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
+ *
+ * @param o element whose presence in this set is to be tested
+ * @return <tt>true</tt> if this set contains the specified element
+ */
+ public boolean contains(Object o) {
+ return al.contains(o);
+ }
+
+ /**
+ * Returns an array containing all of the elements in this set.
+ * If this set makes any guarantees as to what order its elements
+ * are returned by its iterator, this method must return the
+ * elements in the same order.
+ *
+ * <p>The returned array will be "safe" in that no references to it
+ * are maintained by this set. (In other words, this method must
+ * allocate a new array even if this set is backed by an array).
+ * The caller is thus free to modify the returned array.
+ *
+ * <p>This method acts as bridge between array-based and collection-based
+ * APIs.
+ *
+ * @return an array containing all the elements in this set
+ */
+ public Object[] toArray() {
+ return al.toArray();
+ }
+
+ /**
+ * Returns an array containing all of the elements in this set; the
+ * runtime type of the returned array is that of the specified array.
+ * If the set fits in the specified array, it is returned therein.
+ * Otherwise, a new array is allocated with the runtime type of the
+ * specified array and the size of this set.
+ *
+ * <p>If this set fits in the specified array with room to spare
+ * (i.e., the array has more elements than this set), the element in
+ * the array immediately following the end of the set is set to
+ * <tt>null</tt>. (This is useful in determining the length of this
+ * set <i>only</i> if the caller knows that this set does not contain
+ * any null elements.)
+ *
+ * <p>If this set makes any guarantees as to what order its elements
+ * are returned by its iterator, this method must return the elements
+ * in the same order.
+ *
+ * <p>Like the {@link #toArray()} method, this method acts as bridge between
+ * array-based and collection-based APIs. Further, this method allows
+ * precise control over the runtime type of the output array, and may,
+ * under certain circumstances, be used to save allocation costs.
+ *
+ * <p>Suppose <tt>x</tt> is a set known to contain only strings.
+ * The following code can be used to dump the set into a newly allocated
+ * array of <tt>String</tt>:
+ *
+ * <pre>
+ * String[] y = x.toArray(new String[0]);</pre>
+ *
+ * Note that <tt>toArray(new Object[0])</tt> is identical in function to
+ * <tt>toArray()</tt>.
+ *
+ * @param a the array into which the elements of this set are to be
+ * stored, if it is big enough; otherwise, a new array of the same
+ * runtime type is allocated for this purpose.
+ * @return an array containing all the elements in this set
+ * @throws ArrayStoreException if the runtime type of the specified array
+ * is not a supertype of the runtime type of every element in this
+ * set
+ * @throws NullPointerException if the specified array is null
+ */
+ public <T> T[] toArray(T[] a) {
+ return al.toArray(a);
+ }
+
+ /**
+ * Removes all of the elements from this set.
+ * The set will be empty after this call returns.
+ */
+ public void clear() {
+ al.clear();
+ }
+
+ /**
+ * Removes the specified element from this set if it is present.
+ * More formally, removes an element <tt>e</tt> such that
+ * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>,
+ * if this set contains such an element. Returns <tt>true</tt> if
+ * this set contained the element (or equivalently, if this set
+ * changed as a result of the call). (This set will not contain the
+ * element once the call returns.)
+ *
+ * @param o object to be removed from this set, if present
+ * @return <tt>true</tt> if this set contained the specified element
+ */
+ public boolean remove(Object o) {
+ return al.remove(o);
+ }
+
+ /**
+ * Adds the specified element to this set if it is not already present.
+ * More formally, adds the specified element <tt>e</tt> to this set if
+ * the set contains no element <tt>e2</tt> such that
+ * <tt>(e==null&nbsp;?&nbsp;e2==null&nbsp;:&nbsp;e.equals(e2))</tt>.
+ * If this set already contains the element, the call leaves the set
+ * unchanged and returns <tt>false</tt>.
+ *
+ * @param e element to be added to this set
+ * @return <tt>true</tt> if this set did not already contain the specified
+ * element
+ */
+ public boolean add(E e) {
+ return al.addIfAbsent(e);
+ }
+
+ /**
+ * Returns <tt>true</tt> if this set contains all of the elements of the
+ * specified collection. If the specified collection is also a set, this
+ * method returns <tt>true</tt> if it is a <i>subset</i> of this set.
+ *
+ * @param c collection to be checked for containment in this set
+ * @return <tt>true</tt> if this set contains all of the elements of the
+ * specified collection
+ * @throws NullPointerException if the specified collection is null
+ * @see #contains(Object)
+ */
+ public boolean containsAll(Collection<?> c) {
+ return al.containsAll(c);
+ }
+
+ /**
+ * Adds all of the elements in the specified collection to this set if
+ * they're not already present. If the specified collection is also a
+ * set, the <tt>addAll</tt> operation effectively modifies this set so
+ * that its value is the <i>union</i> of the two sets. The behavior of
+ * this operation is undefined if the specified collection is modified
+ * while the operation is in progress.
+ *
+ * @param c collection containing elements to be added to this set
+ * @return <tt>true</tt> if this set changed as a result of the call
+ * @throws NullPointerException if the specified collection is null
+ * @see #add(Object)
+ */
+ public boolean addAll(Collection<? extends E> c) {
+ return al.addAllAbsent(c) > 0;
+ }
+
+ /**
+ * Removes from this set all of its elements that are contained in the
+ * specified collection. If the specified collection is also a set,
+ * this operation effectively modifies this set so that its value is the
+ * <i>asymmetric set difference</i> of the two sets.
+ *
+ * @param c collection containing elements to be removed from this set
+ * @return <tt>true</tt> if this set changed as a result of the call
+ * @throws ClassCastException if the class of an element of this set
+ * is incompatible with the specified collection (optional)
+ * @throws NullPointerException if this set contains a null element and the
+ * specified collection does not permit null elements (optional),
+ * or if the specified collection is null
+ * @see #remove(Object)
+ */
+ public boolean removeAll(Collection<?> c) {
+ return al.removeAll(c);
+ }
+
+ /**
+ * Retains only the elements in this set that are contained in the
+ * specified collection. In other words, removes from this set all of
+ * its elements that are not contained in the specified collection. If
+ * the specified collection is also a set, this operation effectively
+ * modifies this set so that its value is the <i>intersection</i> of the
+ * two sets.
+ *
+ * @param c collection containing elements to be retained in this set
+ * @return <tt>true</tt> if this set changed as a result of the call
+ * @throws ClassCastException if the class of an element of this set
+ * is incompatible with the specified collection (optional)
+ * @throws NullPointerException if this set contains a null element and the
+ * specified collection does not permit null elements (optional),
+ * or if the specified collection is null
+ * @see #remove(Object)
+ */
+ public boolean retainAll(Collection<?> c) {
+ return al.retainAll(c);
+ }
+
+ /**
+ * Returns an iterator over the elements contained in this set
+ * in the order in which these elements were added.
+ *
+ * <p>The returned iterator provides a snapshot of the state of the set
+ * when the iterator was constructed. No synchronization is needed while
+ * traversing the iterator. The iterator does <em>NOT</em> support the
+ * <tt>remove</tt> method.
+ *
+ * @return an iterator over the elements in this set
+ */
+ public Iterator<E> iterator() {
+ return al.iterator();
+ }
+
+ /**
+ * Compares the specified object with this set for equality.
+ * Returns {@code true} if the specified object is the same object
+ * as this object, or if it is also a {@link Set} and the elements
+ * returned by an {@linkplain List#iterator() iterator} over the
+ * specified set are the same as the elements returned by an
+ * iterator over this set. More formally, the two iterators are
+ * considered to return the same elements if they return the same
+ * number of elements and for every element {@code e1} returned by
+ * the iterator over the specified set, there is an element
+ * {@code e2} returned by the iterator over this set such that
+ * {@code (e1==null ? e2==null : e1.equals(e2))}.
+ *
+ * @param o object to be compared for equality with this set
+ * @return {@code true} if the specified object is equal to this set
+ */
+ public boolean equals(Object o) {
+ if (o == this)
+ return true;
+ if (!(o instanceof Set))
+ return false;
+ Set<?> set = (Set<?>)(o);
+ Iterator<?> it = set.iterator();
+
+ // Uses O(n^2) algorithm that is only appropriate
+ // for small sets, which CopyOnWriteArraySets should be.
+
+ // Use a single snapshot of underlying array
+ Object[] elements = al.getArray();
+ int len = elements.length;
+ // Mark matched elements to avoid re-checking
+ boolean[] matched = new boolean[len];
+ int k = 0;
+ outer: while (it.hasNext()) {
+ if (++k > len)
+ return false;
+ Object x = it.next();
+ for (int i = 0; i < len; ++i) {
+ if (!matched[i] && eq(x, elements[i])) {
+ matched[i] = true;
+ continue outer;
+ }
+ }
+ return false;
+ }
+ return k == len;
+ }
+
+ /**
+ * Test for equality, coping with nulls.
+ */
+ private static boolean eq(Object o1, Object o2) {
+ return (o1 == null ? o2 == null : o1.equals(o2));
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/CountDownLatch.java b/libjava/classpath/external/jsr166/java/util/concurrent/CountDownLatch.java
new file mode 100644
index 00000000000..016c1a7a55c
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/CountDownLatch.java
@@ -0,0 +1,290 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.concurrent.locks.*;
+import java.util.concurrent.atomic.*;
+
+/**
+ * A synchronization aid that allows one or more threads to wait until
+ * a set of operations being performed in other threads completes.
+ *
+ * <p>A {@code CountDownLatch} is initialized with a given <em>count</em>.
+ * The {@link #await await} methods block until the current count reaches
+ * zero due to invocations of the {@link #countDown} method, after which
+ * all waiting threads are released and any subsequent invocations of
+ * {@link #await await} return immediately. This is a one-shot phenomenon
+ * -- the count cannot be reset. If you need a version that resets the
+ * count, consider using a {@link CyclicBarrier}.
+ *
+ * <p>A {@code CountDownLatch} is a versatile synchronization tool
+ * and can be used for a number of purposes. A
+ * {@code CountDownLatch} initialized with a count of one serves as a
+ * simple on/off latch, or gate: all threads invoking {@link #await await}
+ * wait at the gate until it is opened by a thread invoking {@link
+ * #countDown}. A {@code CountDownLatch} initialized to <em>N</em>
+ * can be used to make one thread wait until <em>N</em> threads have
+ * completed some action, or some action has been completed N times.
+ *
+ * <p>A useful property of a {@code CountDownLatch} is that it
+ * doesn't require that threads calling {@code countDown} wait for
+ * the count to reach zero before proceeding, it simply prevents any
+ * thread from proceeding past an {@link #await await} until all
+ * threads could pass.
+ *
+ * <p><b>Sample usage:</b> Here is a pair of classes in which a group
+ * of worker threads use two countdown latches:
+ * <ul>
+ * <li>The first is a start signal that prevents any worker from proceeding
+ * until the driver is ready for them to proceed;
+ * <li>The second is a completion signal that allows the driver to wait
+ * until all workers have completed.
+ * </ul>
+ *
+ * <pre>
+ * class Driver { // ...
+ * void main() throws InterruptedException {
+ * CountDownLatch startSignal = new CountDownLatch(1);
+ * CountDownLatch doneSignal = new CountDownLatch(N);
+ *
+ * for (int i = 0; i < N; ++i) // create and start threads
+ * new Thread(new Worker(startSignal, doneSignal)).start();
+ *
+ * doSomethingElse(); // don't let run yet
+ * startSignal.countDown(); // let all threads proceed
+ * doSomethingElse();
+ * doneSignal.await(); // wait for all to finish
+ * }
+ * }
+ *
+ * class Worker implements Runnable {
+ * private final CountDownLatch startSignal;
+ * private final CountDownLatch doneSignal;
+ * Worker(CountDownLatch startSignal, CountDownLatch doneSignal) {
+ * this.startSignal = startSignal;
+ * this.doneSignal = doneSignal;
+ * }
+ * public void run() {
+ * try {
+ * startSignal.await();
+ * doWork();
+ * doneSignal.countDown();
+ * } catch (InterruptedException ex) {} // return;
+ * }
+ *
+ * void doWork() { ... }
+ * }
+ *
+ * </pre>
+ *
+ * <p>Another typical usage would be to divide a problem into N parts,
+ * describe each part with a Runnable that executes that portion and
+ * counts down on the latch, and queue all the Runnables to an
+ * Executor. When all sub-parts are complete, the coordinating thread
+ * will be able to pass through await. (When threads must repeatedly
+ * count down in this way, instead use a {@link CyclicBarrier}.)
+ *
+ * <pre>
+ * class Driver2 { // ...
+ * void main() throws InterruptedException {
+ * CountDownLatch doneSignal = new CountDownLatch(N);
+ * Executor e = ...
+ *
+ * for (int i = 0; i < N; ++i) // create and start threads
+ * e.execute(new WorkerRunnable(doneSignal, i));
+ *
+ * doneSignal.await(); // wait for all to finish
+ * }
+ * }
+ *
+ * class WorkerRunnable implements Runnable {
+ * private final CountDownLatch doneSignal;
+ * private final int i;
+ * WorkerRunnable(CountDownLatch doneSignal, int i) {
+ * this.doneSignal = doneSignal;
+ * this.i = i;
+ * }
+ * public void run() {
+ * try {
+ * doWork(i);
+ * doneSignal.countDown();
+ * } catch (InterruptedException ex) {} // return;
+ * }
+ *
+ * void doWork() { ... }
+ * }
+ *
+ * </pre>
+ *
+ * <p>Memory consistency effects: Actions in a thread prior to calling
+ * {@code countDown()}
+ * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
+ * actions following a successful return from a corresponding
+ * {@code await()} in another thread.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public class CountDownLatch {
+ /**
+ * Synchronization control For CountDownLatch.
+ * Uses AQS state to represent count.
+ */
+ private static final class Sync extends AbstractQueuedSynchronizer {
+ private static final long serialVersionUID = 4982264981922014374L;
+
+ Sync(int count) {
+ setState(count);
+ }
+
+ int getCount() {
+ return getState();
+ }
+
+ public int tryAcquireShared(int acquires) {
+ return getState() == 0? 1 : -1;
+ }
+
+ public boolean tryReleaseShared(int releases) {
+ // Decrement count; signal when transition to zero
+ for (;;) {
+ int c = getState();
+ if (c == 0)
+ return false;
+ int nextc = c-1;
+ if (compareAndSetState(c, nextc))
+ return nextc == 0;
+ }
+ }
+ }
+
+ private final Sync sync;
+
+ /**
+ * Constructs a {@code CountDownLatch} initialized with the given count.
+ *
+ * @param count the number of times {@link #countDown} must be invoked
+ * before threads can pass through {@link #await}
+ * @throws IllegalArgumentException if {@code count} is negative
+ */
+ public CountDownLatch(int count) {
+ if (count < 0) throw new IllegalArgumentException("count < 0");
+ this.sync = new Sync(count);
+ }
+
+ /**
+ * Causes the current thread to wait until the latch has counted down to
+ * zero, unless the thread is {@linkplain Thread#interrupt interrupted}.
+ *
+ * <p>If the current count is zero then this method returns immediately.
+ *
+ * <p>If the current count is greater than zero then the current
+ * thread becomes disabled for thread scheduling purposes and lies
+ * dormant until one of two things happen:
+ * <ul>
+ * <li>The count reaches zero due to invocations of the
+ * {@link #countDown} method; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread.
+ * </ul>
+ *
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while waiting,
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared.
+ *
+ * @throws InterruptedException if the current thread is interrupted
+ * while waiting
+ */
+ public void await() throws InterruptedException {
+ sync.acquireSharedInterruptibly(1);
+ }
+
+ /**
+ * Causes the current thread to wait until the latch has counted down to
+ * zero, unless the thread is {@linkplain Thread#interrupt interrupted},
+ * or the specified waiting time elapses.
+ *
+ * <p>If the current count is zero then this method returns immediately
+ * with the value {@code true}.
+ *
+ * <p>If the current count is greater than zero then the current
+ * thread becomes disabled for thread scheduling purposes and lies
+ * dormant until one of three things happen:
+ * <ul>
+ * <li>The count reaches zero due to invocations of the
+ * {@link #countDown} method; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread; or
+ * <li>The specified waiting time elapses.
+ * </ul>
+ *
+ * <p>If the count reaches zero then the method returns with the
+ * value {@code true}.
+ *
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while waiting,
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared.
+ *
+ * <p>If the specified waiting time elapses then the value {@code false}
+ * is returned. If the time is less than or equal to zero, the method
+ * will not wait at all.
+ *
+ * @param timeout the maximum time to wait
+ * @param unit the time unit of the {@code timeout} argument
+ * @return {@code true} if the count reached zero and {@code false}
+ * if the waiting time elapsed before the count reached zero
+ * @throws InterruptedException if the current thread is interrupted
+ * while waiting
+ */
+ public boolean await(long timeout, TimeUnit unit)
+ throws InterruptedException {
+ return sync.tryAcquireSharedNanos(1, unit.toNanos(timeout));
+ }
+
+ /**
+ * Decrements the count of the latch, releasing all waiting threads if
+ * the count reaches zero.
+ *
+ * <p>If the current count is greater than zero then it is decremented.
+ * If the new count is zero then all waiting threads are re-enabled for
+ * thread scheduling purposes.
+ *
+ * <p>If the current count equals zero then nothing happens.
+ */
+ public void countDown() {
+ sync.releaseShared(1);
+ }
+
+ /**
+ * Returns the current count.
+ *
+ * <p>This method is typically used for debugging and testing purposes.
+ *
+ * @return the current count
+ */
+ public long getCount() {
+ return sync.getCount();
+ }
+
+ /**
+ * Returns a string identifying this latch, as well as its state.
+ * The state, in brackets, includes the String {@code "Count ="}
+ * followed by the current count.
+ *
+ * @return a string identifying this latch, as well as its state
+ */
+ public String toString() {
+ return super.toString() + "[Count = " + sync.getCount() + "]";
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/CyclicBarrier.java b/libjava/classpath/external/jsr166/java/util/concurrent/CyclicBarrier.java
new file mode 100644
index 00000000000..e72577537d4
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/CyclicBarrier.java
@@ -0,0 +1,454 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.concurrent.locks.*;
+
+/**
+ * A synchronization aid that allows a set of threads to all wait for
+ * each other to reach a common barrier point. CyclicBarriers are
+ * useful in programs involving a fixed sized party of threads that
+ * must occasionally wait for each other. The barrier is called
+ * <em>cyclic</em> because it can be re-used after the waiting threads
+ * are released.
+ *
+ * <p>A <tt>CyclicBarrier</tt> supports an optional {@link Runnable} command
+ * that is run once per barrier point, after the last thread in the party
+ * arrives, but before any threads are released.
+ * This <em>barrier action</em> is useful
+ * for updating shared-state before any of the parties continue.
+ *
+ * <p><b>Sample usage:</b> Here is an example of
+ * using a barrier in a parallel decomposition design:
+ * <pre>
+ * class Solver {
+ * final int N;
+ * final float[][] data;
+ * final CyclicBarrier barrier;
+ *
+ * class Worker implements Runnable {
+ * int myRow;
+ * Worker(int row) { myRow = row; }
+ * public void run() {
+ * while (!done()) {
+ * processRow(myRow);
+ *
+ * try {
+ * barrier.await();
+ * } catch (InterruptedException ex) {
+ * return;
+ * } catch (BrokenBarrierException ex) {
+ * return;
+ * }
+ * }
+ * }
+ * }
+ *
+ * public Solver(float[][] matrix) {
+ * data = matrix;
+ * N = matrix.length;
+ * barrier = new CyclicBarrier(N,
+ * new Runnable() {
+ * public void run() {
+ * mergeRows(...);
+ * }
+ * });
+ * for (int i = 0; i < N; ++i)
+ * new Thread(new Worker(i)).start();
+ *
+ * waitUntilDone();
+ * }
+ * }
+ * </pre>
+ * Here, each worker thread processes a row of the matrix then waits at the
+ * barrier until all rows have been processed. When all rows are processed
+ * the supplied {@link Runnable} barrier action is executed and merges the
+ * rows. If the merger
+ * determines that a solution has been found then <tt>done()</tt> will return
+ * <tt>true</tt> and each worker will terminate.
+ *
+ * <p>If the barrier action does not rely on the parties being suspended when
+ * it is executed, then any of the threads in the party could execute that
+ * action when it is released. To facilitate this, each invocation of
+ * {@link #await} returns the arrival index of that thread at the barrier.
+ * You can then choose which thread should execute the barrier action, for
+ * example:
+ * <pre> if (barrier.await() == 0) {
+ * // log the completion of this iteration
+ * }</pre>
+ *
+ * <p>The <tt>CyclicBarrier</tt> uses an all-or-none breakage model
+ * for failed synchronization attempts: If a thread leaves a barrier
+ * point prematurely because of interruption, failure, or timeout, all
+ * other threads waiting at that barrier point will also leave
+ * abnormally via {@link BrokenBarrierException} (or
+ * {@link InterruptedException} if they too were interrupted at about
+ * the same time).
+ *
+ * <p>Memory consistency effects: Actions in a thread prior to calling
+ * {@code await()}
+ * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
+ * actions that are part of the barrier action, which in turn
+ * <i>happen-before</i> actions following a successful return from the
+ * corresponding {@code await()} in other threads.
+ *
+ * @since 1.5
+ * @see CountDownLatch
+ *
+ * @author Doug Lea
+ */
+public class CyclicBarrier {
+ /**
+ * Each use of the barrier is represented as a generation instance.
+ * The generation changes whenever the barrier is tripped, or
+ * is reset. There can be many generations associated with threads
+ * using the barrier - due to the non-deterministic way the lock
+ * may be allocated to waiting threads - but only one of these
+ * can be active at a time (the one to which <tt>count</tt> applies)
+ * and all the rest are either broken or tripped.
+ * There need not be an active generation if there has been a break
+ * but no subsequent reset.
+ */
+ private static class Generation {
+ boolean broken = false;
+ }
+
+ /** The lock for guarding barrier entry */
+ private final ReentrantLock lock = new ReentrantLock();
+ /** Condition to wait on until tripped */
+ private final Condition trip = lock.newCondition();
+ /** The number of parties */
+ private final int parties;
+ /* The command to run when tripped */
+ private final Runnable barrierCommand;
+ /** The current generation */
+ private Generation generation = new Generation();
+
+ /**
+ * Number of parties still waiting. Counts down from parties to 0
+ * on each generation. It is reset to parties on each new
+ * generation or when broken.
+ */
+ private int count;
+
+ /**
+ * Updates state on barrier trip and wakes up everyone.
+ * Called only while holding lock.
+ */
+ private void nextGeneration() {
+ // signal completion of last generation
+ trip.signalAll();
+ // set up next generation
+ count = parties;
+ generation = new Generation();
+ }
+
+ /**
+ * Sets current barrier generation as broken and wakes up everyone.
+ * Called only while holding lock.
+ */
+ private void breakBarrier() {
+ generation.broken = true;
+ count = parties;
+ trip.signalAll();
+ }
+
+ /**
+ * Main barrier code, covering the various policies.
+ */
+ private int dowait(boolean timed, long nanos)
+ throws InterruptedException, BrokenBarrierException,
+ TimeoutException {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ final Generation g = generation;
+
+ if (g.broken)
+ throw new BrokenBarrierException();
+
+ if (Thread.interrupted()) {
+ breakBarrier();
+ throw new InterruptedException();
+ }
+
+ int index = --count;
+ if (index == 0) { // tripped
+ boolean ranAction = false;
+ try {
+ final Runnable command = barrierCommand;
+ if (command != null)
+ command.run();
+ ranAction = true;
+ nextGeneration();
+ return 0;
+ } finally {
+ if (!ranAction)
+ breakBarrier();
+ }
+ }
+
+ // loop until tripped, broken, interrupted, or timed out
+ for (;;) {
+ try {
+ if (!timed)
+ trip.await();
+ else if (nanos > 0L)
+ nanos = trip.awaitNanos(nanos);
+ } catch (InterruptedException ie) {
+ if (g == generation && ! g.broken) {
+ breakBarrier();
+ throw ie;
+ } else {
+ // We're about to finish waiting even if we had not
+ // been interrupted, so this interrupt is deemed to
+ // "belong" to subsequent execution.
+ Thread.currentThread().interrupt();
+ }
+ }
+
+ if (g.broken)
+ throw new BrokenBarrierException();
+
+ if (g != generation)
+ return index;
+
+ if (timed && nanos <= 0L) {
+ breakBarrier();
+ throw new TimeoutException();
+ }
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Creates a new <tt>CyclicBarrier</tt> that will trip when the
+ * given number of parties (threads) are waiting upon it, and which
+ * will execute the given barrier action when the barrier is tripped,
+ * performed by the last thread entering the barrier.
+ *
+ * @param parties the number of threads that must invoke {@link #await}
+ * before the barrier is tripped
+ * @param barrierAction the command to execute when the barrier is
+ * tripped, or {@code null} if there is no action
+ * @throws IllegalArgumentException if {@code parties} is less than 1
+ */
+ public CyclicBarrier(int parties, Runnable barrierAction) {
+ if (parties <= 0) throw new IllegalArgumentException();
+ this.parties = parties;
+ this.count = parties;
+ this.barrierCommand = barrierAction;
+ }
+
+ /**
+ * Creates a new <tt>CyclicBarrier</tt> that will trip when the
+ * given number of parties (threads) are waiting upon it, and
+ * does not perform a predefined action when the barrier is tripped.
+ *
+ * @param parties the number of threads that must invoke {@link #await}
+ * before the barrier is tripped
+ * @throws IllegalArgumentException if {@code parties} is less than 1
+ */
+ public CyclicBarrier(int parties) {
+ this(parties, null);
+ }
+
+ /**
+ * Returns the number of parties required to trip this barrier.
+ *
+ * @return the number of parties required to trip this barrier
+ */
+ public int getParties() {
+ return parties;
+ }
+
+ /**
+ * Waits until all {@linkplain #getParties parties} have invoked
+ * <tt>await</tt> on this barrier.
+ *
+ * <p>If the current thread is not the last to arrive then it is
+ * disabled for thread scheduling purposes and lies dormant until
+ * one of the following things happens:
+ * <ul>
+ * <li>The last thread arrives; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * one of the other waiting threads; or
+ * <li>Some other thread times out while waiting for barrier; or
+ * <li>Some other thread invokes {@link #reset} on this barrier.
+ * </ul>
+ *
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while waiting
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared.
+ *
+ * <p>If the barrier is {@link #reset} while any thread is waiting,
+ * or if the barrier {@linkplain #isBroken is broken} when
+ * <tt>await</tt> is invoked, or while any thread is waiting, then
+ * {@link BrokenBarrierException} is thrown.
+ *
+ * <p>If any thread is {@linkplain Thread#interrupt interrupted} while waiting,
+ * then all other waiting threads will throw
+ * {@link BrokenBarrierException} and the barrier is placed in the broken
+ * state.
+ *
+ * <p>If the current thread is the last thread to arrive, and a
+ * non-null barrier action was supplied in the constructor, then the
+ * current thread runs the action before allowing the other threads to
+ * continue.
+ * If an exception occurs during the barrier action then that exception
+ * will be propagated in the current thread and the barrier is placed in
+ * the broken state.
+ *
+ * @return the arrival index of the current thread, where index
+ * <tt>{@link #getParties()} - 1</tt> indicates the first
+ * to arrive and zero indicates the last to arrive
+ * @throws InterruptedException if the current thread was interrupted
+ * while waiting
+ * @throws BrokenBarrierException if <em>another</em> thread was
+ * interrupted or timed out while the current thread was
+ * waiting, or the barrier was reset, or the barrier was
+ * broken when {@code await} was called, or the barrier
+ * action (if present) failed due an exception.
+ */
+ public int await() throws InterruptedException, BrokenBarrierException {
+ try {
+ return dowait(false, 0L);
+ } catch (TimeoutException toe) {
+ throw new Error(toe); // cannot happen;
+ }
+ }
+
+ /**
+ * Waits until all {@linkplain #getParties parties} have invoked
+ * <tt>await</tt> on this barrier, or the specified waiting time elapses.
+ *
+ * <p>If the current thread is not the last to arrive then it is
+ * disabled for thread scheduling purposes and lies dormant until
+ * one of the following things happens:
+ * <ul>
+ * <li>The last thread arrives; or
+ * <li>The specified timeout elapses; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * one of the other waiting threads; or
+ * <li>Some other thread times out while waiting for barrier; or
+ * <li>Some other thread invokes {@link #reset} on this barrier.
+ * </ul>
+ *
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while waiting
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared.
+ *
+ * <p>If the specified waiting time elapses then {@link TimeoutException}
+ * is thrown. If the time is less than or equal to zero, the
+ * method will not wait at all.
+ *
+ * <p>If the barrier is {@link #reset} while any thread is waiting,
+ * or if the barrier {@linkplain #isBroken is broken} when
+ * <tt>await</tt> is invoked, or while any thread is waiting, then
+ * {@link BrokenBarrierException} is thrown.
+ *
+ * <p>If any thread is {@linkplain Thread#interrupt interrupted} while
+ * waiting, then all other waiting threads will throw {@link
+ * BrokenBarrierException} and the barrier is placed in the broken
+ * state.
+ *
+ * <p>If the current thread is the last thread to arrive, and a
+ * non-null barrier action was supplied in the constructor, then the
+ * current thread runs the action before allowing the other threads to
+ * continue.
+ * If an exception occurs during the barrier action then that exception
+ * will be propagated in the current thread and the barrier is placed in
+ * the broken state.
+ *
+ * @param timeout the time to wait for the barrier
+ * @param unit the time unit of the timeout parameter
+ * @return the arrival index of the current thread, where index
+ * <tt>{@link #getParties()} - 1</tt> indicates the first
+ * to arrive and zero indicates the last to arrive
+ * @throws InterruptedException if the current thread was interrupted
+ * while waiting
+ * @throws TimeoutException if the specified timeout elapses
+ * @throws BrokenBarrierException if <em>another</em> thread was
+ * interrupted or timed out while the current thread was
+ * waiting, or the barrier was reset, or the barrier was broken
+ * when {@code await} was called, or the barrier action (if
+ * present) failed due an exception
+ */
+ public int await(long timeout, TimeUnit unit)
+ throws InterruptedException,
+ BrokenBarrierException,
+ TimeoutException {
+ return dowait(true, unit.toNanos(timeout));
+ }
+
+ /**
+ * Queries if this barrier is in a broken state.
+ *
+ * @return {@code true} if one or more parties broke out of this
+ * barrier due to interruption or timeout since
+ * construction or the last reset, or a barrier action
+ * failed due to an exception; {@code false} otherwise.
+ */
+ public boolean isBroken() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return generation.broken;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Resets the barrier to its initial state. If any parties are
+ * currently waiting at the barrier, they will return with a
+ * {@link BrokenBarrierException}. Note that resets <em>after</em>
+ * a breakage has occurred for other reasons can be complicated to
+ * carry out; threads need to re-synchronize in some other way,
+ * and choose one to perform the reset. It may be preferable to
+ * instead create a new barrier for subsequent use.
+ */
+ public void reset() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ breakBarrier(); // break the current generation
+ nextGeneration(); // start a new generation
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns the number of parties currently waiting at the barrier.
+ * This method is primarily useful for debugging and assertions.
+ *
+ * @return the number of parties currently blocked in {@link #await}
+ */
+ public int getNumberWaiting() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return parties - count;
+ } finally {
+ lock.unlock();
+ }
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/DelayQueue.java b/libjava/classpath/external/jsr166/java/util/concurrent/DelayQueue.java
new file mode 100644
index 00000000000..8b839878c3a
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/DelayQueue.java
@@ -0,0 +1,487 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+
+package java.util.concurrent;
+import java.util.concurrent.locks.*;
+import java.util.*;
+
+/**
+ * An unbounded {@linkplain BlockingQueue blocking queue} of
+ * <tt>Delayed</tt> elements, in which an element can only be taken
+ * when its delay has expired. The <em>head</em> of the queue is that
+ * <tt>Delayed</tt> element whose delay expired furthest in the
+ * past. If no delay has expired there is no head and <tt>poll</tt>
+ * will return <tt>null</tt>. Expiration occurs when an element's
+ * <tt>getDelay(TimeUnit.NANOSECONDS)</tt> method returns a value less
+ * than or equal to zero. Even though unexpired elements cannot be
+ * removed using <tt>take</tt> or <tt>poll</tt>, they are otherwise
+ * treated as normal elements. For example, the <tt>size</tt> method
+ * returns the count of both expired and unexpired elements.
+ * This queue does not permit null elements.
+ *
+ * <p>This class and its iterator implement all of the
+ * <em>optional</em> methods of the {@link Collection} and {@link
+ * Iterator} interfaces.
+ *
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <E> the type of elements held in this collection
+ */
+
+public class DelayQueue<E extends Delayed> extends AbstractQueue<E>
+ implements BlockingQueue<E> {
+
+ private transient final ReentrantLock lock = new ReentrantLock();
+ private transient final Condition available = lock.newCondition();
+ private final PriorityQueue<E> q = new PriorityQueue<E>();
+
+ /**
+ * Creates a new <tt>DelayQueue</tt> that is initially empty.
+ */
+ public DelayQueue() {}
+
+ /**
+ * Creates a <tt>DelayQueue</tt> initially containing the elements of the
+ * given collection of {@link Delayed} instances.
+ *
+ * @param c the collection of elements to initially contain
+ * @throws NullPointerException if the specified collection or any
+ * of its elements are null
+ */
+ public DelayQueue(Collection<? extends E> c) {
+ this.addAll(c);
+ }
+
+ /**
+ * Inserts the specified element into this delay queue.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> (as specified by {@link Collection#add})
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean add(E e) {
+ return offer(e);
+ }
+
+ /**
+ * Inserts the specified element into this delay queue.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt>
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean offer(E e) {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ E first = q.peek();
+ q.offer(e);
+ if (first == null || e.compareTo(first) < 0)
+ available.signalAll();
+ return true;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Inserts the specified element into this delay queue. As the queue is
+ * unbounded this method will never block.
+ *
+ * @param e the element to add
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public void put(E e) {
+ offer(e);
+ }
+
+ /**
+ * Inserts the specified element into this delay queue. As the queue is
+ * unbounded this method will never block.
+ *
+ * @param e the element to add
+ * @param timeout This parameter is ignored as the method never blocks
+ * @param unit This parameter is ignored as the method never blocks
+ * @return <tt>true</tt>
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public boolean offer(E e, long timeout, TimeUnit unit) {
+ return offer(e);
+ }
+
+ /**
+ * Retrieves and removes the head of this queue, or returns <tt>null</tt>
+ * if this queue has no elements with an expired delay.
+ *
+ * @return the head of this queue, or <tt>null</tt> if this
+ * queue has no elements with an expired delay
+ */
+ public E poll() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ E first = q.peek();
+ if (first == null || first.getDelay(TimeUnit.NANOSECONDS) > 0)
+ return null;
+ else {
+ E x = q.poll();
+ assert x != null;
+ if (q.size() != 0)
+ available.signalAll();
+ return x;
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Retrieves and removes the head of this queue, waiting if necessary
+ * until an element with an expired delay is available on this queue.
+ *
+ * @return the head of this queue
+ * @throws InterruptedException {@inheritDoc}
+ */
+ public E take() throws InterruptedException {
+ final ReentrantLock lock = this.lock;
+ lock.lockInterruptibly();
+ try {
+ for (;;) {
+ E first = q.peek();
+ if (first == null) {
+ available.await();
+ } else {
+ long delay = first.getDelay(TimeUnit.NANOSECONDS);
+ if (delay > 0) {
+ long tl = available.awaitNanos(delay);
+ } else {
+ E x = q.poll();
+ assert x != null;
+ if (q.size() != 0)
+ available.signalAll(); // wake up other takers
+ return x;
+
+ }
+ }
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Retrieves and removes the head of this queue, waiting if necessary
+ * until an element with an expired delay is available on this queue,
+ * or the specified wait time expires.
+ *
+ * @return the head of this queue, or <tt>null</tt> if the
+ * specified waiting time elapses before an element with
+ * an expired delay becomes available
+ * @throws InterruptedException {@inheritDoc}
+ */
+ public E poll(long timeout, TimeUnit unit) throws InterruptedException {
+ long nanos = unit.toNanos(timeout);
+ final ReentrantLock lock = this.lock;
+ lock.lockInterruptibly();
+ try {
+ for (;;) {
+ E first = q.peek();
+ if (first == null) {
+ if (nanos <= 0)
+ return null;
+ else
+ nanos = available.awaitNanos(nanos);
+ } else {
+ long delay = first.getDelay(TimeUnit.NANOSECONDS);
+ if (delay > 0) {
+ if (nanos <= 0)
+ return null;
+ if (delay > nanos)
+ delay = nanos;
+ long timeLeft = available.awaitNanos(delay);
+ nanos -= delay - timeLeft;
+ } else {
+ E x = q.poll();
+ assert x != null;
+ if (q.size() != 0)
+ available.signalAll();
+ return x;
+ }
+ }
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Retrieves, but does not remove, the head of this queue, or
+ * returns <tt>null</tt> if this queue is empty. Unlike
+ * <tt>poll</tt>, if no expired elements are available in the queue,
+ * this method returns the element that will expire next,
+ * if one exists.
+ *
+ * @return the head of this queue, or <tt>null</tt> if this
+ * queue is empty.
+ */
+ public E peek() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return q.peek();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public int size() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return q.size();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws UnsupportedOperationException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public int drainTo(Collection<? super E> c) {
+ if (c == null)
+ throw new NullPointerException();
+ if (c == this)
+ throw new IllegalArgumentException();
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ int n = 0;
+ for (;;) {
+ E first = q.peek();
+ if (first == null || first.getDelay(TimeUnit.NANOSECONDS) > 0)
+ break;
+ c.add(q.poll());
+ ++n;
+ }
+ if (n > 0)
+ available.signalAll();
+ return n;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws UnsupportedOperationException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public int drainTo(Collection<? super E> c, int maxElements) {
+ if (c == null)
+ throw new NullPointerException();
+ if (c == this)
+ throw new IllegalArgumentException();
+ if (maxElements <= 0)
+ return 0;
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ int n = 0;
+ while (n < maxElements) {
+ E first = q.peek();
+ if (first == null || first.getDelay(TimeUnit.NANOSECONDS) > 0)
+ break;
+ c.add(q.poll());
+ ++n;
+ }
+ if (n > 0)
+ available.signalAll();
+ return n;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Atomically removes all of the elements from this delay queue.
+ * The queue will be empty after this call returns.
+ * Elements with an unexpired delay are not waited for; they are
+ * simply discarded from the queue.
+ */
+ public void clear() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ q.clear();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Always returns <tt>Integer.MAX_VALUE</tt> because
+ * a <tt>DelayQueue</tt> is not capacity constrained.
+ *
+ * @return <tt>Integer.MAX_VALUE</tt>
+ */
+ public int remainingCapacity() {
+ return Integer.MAX_VALUE;
+ }
+
+ /**
+ * Returns an array containing all of the elements in this queue.
+ * The returned array elements are in no particular order.
+ *
+ * <p>The returned array will be "safe" in that no references to it are
+ * maintained by this queue. (In other words, this method must allocate
+ * a new array). The caller is thus free to modify the returned array.
+ *
+ * <p>This method acts as bridge between array-based and collection-based
+ * APIs.
+ *
+ * @return an array containing all of the elements in this queue
+ */
+ public Object[] toArray() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return q.toArray();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns an array containing all of the elements in this queue; the
+ * runtime type of the returned array is that of the specified array.
+ * The returned array elements are in no particular order.
+ * If the queue fits in the specified array, it is returned therein.
+ * Otherwise, a new array is allocated with the runtime type of the
+ * specified array and the size of this queue.
+ *
+ * <p>If this queue fits in the specified array with room to spare
+ * (i.e., the array has more elements than this queue), the element in
+ * the array immediately following the end of the queue is set to
+ * <tt>null</tt>.
+ *
+ * <p>Like the {@link #toArray()} method, this method acts as bridge between
+ * array-based and collection-based APIs. Further, this method allows
+ * precise control over the runtime type of the output array, and may,
+ * under certain circumstances, be used to save allocation costs.
+ *
+ * <p>The following code can be used to dump a delay queue into a newly
+ * allocated array of <tt>Delayed</tt>:
+ *
+ * <pre>
+ * Delayed[] a = q.toArray(new Delayed[0]);</pre>
+ *
+ * Note that <tt>toArray(new Object[0])</tt> is identical in function to
+ * <tt>toArray()</tt>.
+ *
+ * @param a the array into which the elements of the queue are to
+ * be stored, if it is big enough; otherwise, a new array of the
+ * same runtime type is allocated for this purpose
+ * @return an array containing all of the elements in this queue
+ * @throws ArrayStoreException if the runtime type of the specified array
+ * is not a supertype of the runtime type of every element in
+ * this queue
+ * @throws NullPointerException if the specified array is null
+ */
+ public <T> T[] toArray(T[] a) {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return q.toArray(a);
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Removes a single instance of the specified element from this
+ * queue, if it is present, whether or not it has expired.
+ */
+ public boolean remove(Object o) {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return q.remove(o);
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns an iterator over all the elements (both expired and
+ * unexpired) in this queue. The iterator does not return the
+ * elements in any particular order. The returned
+ * <tt>Iterator</tt> is a "weakly consistent" iterator that will
+ * never throw {@link ConcurrentModificationException}, and
+ * guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed
+ * to) reflect any modifications subsequent to construction.
+ *
+ * @return an iterator over the elements in this queue
+ */
+ public Iterator<E> iterator() {
+ return new Itr(toArray());
+ }
+
+ /**
+ * Snapshot iterator that works off copy of underlying q array.
+ */
+ private class Itr implements Iterator<E> {
+ final Object[] array; // Array of all elements
+ int cursor; // index of next element to return;
+ int lastRet; // index of last element, or -1 if no such
+
+ Itr(Object[] array) {
+ lastRet = -1;
+ this.array = array;
+ }
+
+ public boolean hasNext() {
+ return cursor < array.length;
+ }
+
+ public E next() {
+ if (cursor >= array.length)
+ throw new NoSuchElementException();
+ lastRet = cursor;
+ return (E)array[cursor++];
+ }
+
+ public void remove() {
+ if (lastRet < 0)
+ throw new IllegalStateException();
+ Object x = array[lastRet];
+ lastRet = -1;
+ // Traverse underlying queue to find == element,
+ // not just a .equals element.
+ lock.lock();
+ try {
+ for (Iterator it = q.iterator(); it.hasNext(); ) {
+ if (it.next() == x) {
+ it.remove();
+ return;
+ }
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/Delayed.java b/libjava/classpath/external/jsr166/java/util/concurrent/Delayed.java
new file mode 100644
index 00000000000..b1ff4eee555
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/Delayed.java
@@ -0,0 +1,33 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+import java.util.*;
+
+/**
+ * A mix-in style interface for marking objects that should be
+ * acted upon after a given delay.
+ *
+ * <p>An implementation of this interface must define a
+ * <tt>compareTo</tt> method that provides an ordering consistent with
+ * its <tt>getDelay</tt> method.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public interface Delayed extends Comparable<Delayed> {
+
+ /**
+ * Returns the remaining delay associated with this object, in the
+ * given time unit.
+ *
+ * @param unit the time unit
+ * @return the remaining delay; zero or negative values indicate
+ * that the delay has already elapsed
+ */
+ long getDelay(TimeUnit unit);
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/Exchanger.java b/libjava/classpath/external/jsr166/java/util/concurrent/Exchanger.java
new file mode 100644
index 00000000000..fb917f4321e
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/Exchanger.java
@@ -0,0 +1,656 @@
+/*
+ * Written by Doug Lea, Bill Scherer, and Michael Scott with
+ * assistance from members of JCP JSR-166 Expert Group and released to
+ * the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.concurrent.atomic.*;
+import java.util.concurrent.locks.LockSupport;
+
+/**
+ * A synchronization point at which threads can pair and swap elements
+ * within pairs. Each thread presents some object on entry to the
+ * {@link #exchange exchange} method, matches with a partner thread,
+ * and receives its partner's object on return. An Exchanger may be
+ * viewed as a bidirectional form of a {@link SynchronousQueue}.
+ * Exchangers may be useful in applications such as genetic algorithms
+ * and pipeline designs.
+ *
+ * <p><b>Sample Usage:</b>
+ * Here are the highlights of a class that uses an {@code Exchanger}
+ * to swap buffers between threads so that the thread filling the
+ * buffer gets a freshly emptied one when it needs it, handing off the
+ * filled one to the thread emptying the buffer.
+ * <pre>{@code
+ * class FillAndEmpty {
+ * Exchanger<DataBuffer> exchanger = new Exchanger<DataBuffer>();
+ * DataBuffer initialEmptyBuffer = ... a made-up type
+ * DataBuffer initialFullBuffer = ...
+ *
+ * class FillingLoop implements Runnable {
+ * public void run() {
+ * DataBuffer currentBuffer = initialEmptyBuffer;
+ * try {
+ * while (currentBuffer != null) {
+ * addToBuffer(currentBuffer);
+ * if (currentBuffer.isFull())
+ * currentBuffer = exchanger.exchange(currentBuffer);
+ * }
+ * } catch (InterruptedException ex) { ... handle ... }
+ * }
+ * }
+ *
+ * class EmptyingLoop implements Runnable {
+ * public void run() {
+ * DataBuffer currentBuffer = initialFullBuffer;
+ * try {
+ * while (currentBuffer != null) {
+ * takeFromBuffer(currentBuffer);
+ * if (currentBuffer.isEmpty())
+ * currentBuffer = exchanger.exchange(currentBuffer);
+ * }
+ * } catch (InterruptedException ex) { ... handle ...}
+ * }
+ * }
+ *
+ * void start() {
+ * new Thread(new FillingLoop()).start();
+ * new Thread(new EmptyingLoop()).start();
+ * }
+ * }
+ * }</pre>
+ *
+ * <p>Memory consistency effects: For each pair of threads that
+ * successfully exchange objects via an {@code Exchanger}, actions
+ * prior to the {@code exchange()} in each thread
+ * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
+ * those subsequent to a return from the corresponding {@code exchange()}
+ * in the other thread.
+ *
+ * @since 1.5
+ * @author Doug Lea and Bill Scherer and Michael Scott
+ * @param <V> The type of objects that may be exchanged
+ */
+public class Exchanger<V> {
+ /*
+ * Algorithm Description:
+ *
+ * The basic idea is to maintain a "slot", which is a reference to
+ * a Node containing both an Item to offer and a "hole" waiting to
+ * get filled in. If an incoming "occupying" thread sees that the
+ * slot is null, it CAS'es (compareAndSets) a Node there and waits
+ * for another to invoke exchange. That second "fulfilling" thread
+ * sees that the slot is non-null, and so CASes it back to null,
+ * also exchanging items by CASing the hole, plus waking up the
+ * occupying thread if it is blocked. In each case CAS'es may
+ * fail because a slot at first appears non-null but is null upon
+ * CAS, or vice-versa. So threads may need to retry these
+ * actions.
+ *
+ * This simple approach works great when there are only a few
+ * threads using an Exchanger, but performance rapidly
+ * deteriorates due to CAS contention on the single slot when
+ * there are lots of threads using an exchanger. So instead we use
+ * an "arena"; basically a kind of hash table with a dynamically
+ * varying number of slots, any one of which can be used by
+ * threads performing an exchange. Incoming threads pick slots
+ * based on a hash of their Thread ids. If an incoming thread
+ * fails to CAS in its chosen slot, it picks an alternative slot
+ * instead. And similarly from there. If a thread successfully
+ * CASes into a slot but no other thread arrives, it tries
+ * another, heading toward the zero slot, which always exists even
+ * if the table shrinks. The particular mechanics controlling this
+ * are as follows:
+ *
+ * Waiting: Slot zero is special in that it is the only slot that
+ * exists when there is no contention. A thread occupying slot
+ * zero will block if no thread fulfills it after a short spin.
+ * In other cases, occupying threads eventually give up and try
+ * another slot. Waiting threads spin for a while (a period that
+ * should be a little less than a typical context-switch time)
+ * before either blocking (if slot zero) or giving up (if other
+ * slots) and restarting. There is no reason for threads to block
+ * unless there are unlikely to be any other threads present.
+ * Occupants are mainly avoiding memory contention so sit there
+ * quietly polling for a shorter period than it would take to
+ * block and then unblock them. Non-slot-zero waits that elapse
+ * because of lack of other threads waste around one extra
+ * context-switch time per try, which is still on average much
+ * faster than alternative approaches.
+ *
+ * Sizing: Usually, using only a few slots suffices to reduce
+ * contention. Especially with small numbers of threads, using
+ * too many slots can lead to just as poor performance as using
+ * too few of them, and there's not much room for error. The
+ * variable "max" maintains the number of slots actually in
+ * use. It is increased when a thread sees too many CAS
+ * failures. (This is analogous to resizing a regular hash table
+ * based on a target load factor, except here, growth steps are
+ * just one-by-one rather than proportional.) Growth requires
+ * contention failures in each of three tried slots. Requiring
+ * multiple failures for expansion copes with the fact that some
+ * failed CASes are not due to contention but instead to simple
+ * races between two threads or thread pre-emptions occurring
+ * between reading and CASing. Also, very transient peak
+ * contention can be much higher than the average sustainable
+ * levels. The max limit is decreased on average 50% of the times
+ * that a non-slot-zero wait elapses without being fulfilled.
+ * Threads experiencing elapsed waits move closer to zero, so
+ * eventually find existing (or future) threads even if the table
+ * has been shrunk due to inactivity. The chosen mechanics and
+ * thresholds for growing and shrinking are intrinsically
+ * entangled with indexing and hashing inside the exchange code,
+ * and can't be nicely abstracted out.
+ *
+ * Hashing: Each thread picks its initial slot to use in accord
+ * with a simple hashcode. The sequence is the same on each
+ * encounter by any given thread, but effectively random across
+ * threads. Using arenas encounters the classic cost vs quality
+ * tradeoffs of all hash tables. Here, we use a one-step FNV-1a
+ * hash code based on the current thread's Thread.getId(), along
+ * with a cheap approximation to a mod operation to select an
+ * index. The downside of optimizing index selection in this way
+ * is that the code is hardwired to use a maximum table size of
+ * 32. But this value more than suffices for known platforms and
+ * applications.
+ *
+ * Probing: On sensed contention of a selected slot, we probe
+ * sequentially through the table, analogously to linear probing
+ * after collision in a hash table. (We move circularly, in
+ * reverse order, to mesh best with table growth and shrinkage
+ * rules.) Except that to minimize the effects of false-alarms
+ * and cache thrashing, we try the first selected slot twice
+ * before moving.
+ *
+ * Padding: Even with contention management, slots are heavily
+ * contended, so use cache-padding to avoid poor memory
+ * performance. Because of this, slots are lazily constructed
+ * only when used, to avoid wasting this space unnecessarily.
+ * While isolation of locations is not much of an issue at first
+ * in an application, as time goes on and garbage-collectors
+ * perform compaction, slots are very likely to be moved adjacent
+ * to each other, which can cause much thrashing of cache lines on
+ * MPs unless padding is employed.
+ *
+ * This is an improvement of the algorithm described in the paper
+ * "A Scalable Elimination-based Exchange Channel" by William
+ * Scherer, Doug Lea, and Michael Scott in Proceedings of SCOOL05
+ * workshop. Available at: http://hdl.handle.net/1802/2104
+ */
+
+ /** The number of CPUs, for sizing and spin control */
+ private static final int NCPU = Runtime.getRuntime().availableProcessors();
+
+ /**
+ * The capacity of the arena. Set to a value that provides more
+ * than enough space to handle contention. On small machines
+ * most slots won't be used, but it is still not wasted because
+ * the extra space provides some machine-level address padding
+ * to minimize interference with heavily CAS'ed Slot locations.
+ * And on very large machines, performance eventually becomes
+ * bounded by memory bandwidth, not numbers of threads/CPUs.
+ * This constant cannot be changed without also modifying
+ * indexing and hashing algorithms.
+ */
+ private static final int CAPACITY = 32;
+
+ /**
+ * The value of "max" that will hold all threads without
+ * contention. When this value is less than CAPACITY, some
+ * otherwise wasted expansion can be avoided.
+ */
+ private static final int FULL =
+ Math.max(0, Math.min(CAPACITY, NCPU / 2) - 1);
+
+ /**
+ * The number of times to spin (doing nothing except polling a
+ * memory location) before blocking or giving up while waiting to
+ * be fulfilled. Should be zero on uniprocessors. On
+ * multiprocessors, this value should be large enough so that two
+ * threads exchanging items as fast as possible block only when
+ * one of them is stalled (due to GC or preemption), but not much
+ * longer, to avoid wasting CPU resources. Seen differently, this
+ * value is a little over half the number of cycles of an average
+ * context switch time on most systems. The value here is
+ * approximately the average of those across a range of tested
+ * systems.
+ */
+ private static final int SPINS = (NCPU == 1) ? 0 : 2000;
+
+ /**
+ * The number of times to spin before blocking in timed waits.
+ * Timed waits spin more slowly because checking the time takes
+ * time. The best value relies mainly on the relative rate of
+ * System.nanoTime vs memory accesses. The value is empirically
+ * derived to work well across a variety of systems.
+ */
+ private static final int TIMED_SPINS = SPINS / 20;
+
+ /**
+ * Sentinel item representing cancellation of a wait due to
+ * interruption, timeout, or elapsed spin-waits. This value is
+ * placed in holes on cancellation, and used as a return value
+ * from waiting methods to indicate failure to set or get hole.
+ */
+ private static final Object CANCEL = new Object();
+
+ /**
+ * Value representing null arguments/returns from public
+ * methods. This disambiguates from internal requirement that
+ * holes start out as null to mean they are not yet set.
+ */
+ private static final Object NULL_ITEM = new Object();
+
+ /**
+ * Nodes hold partially exchanged data. This class
+ * opportunistically subclasses AtomicReference to represent the
+ * hole. So get() returns hole, and compareAndSet CAS'es value
+ * into hole. This class cannot be parameterized as "V" because
+ * of the use of non-V CANCEL sentinels.
+ */
+ private static final class Node extends AtomicReference<Object> {
+ /** The element offered by the Thread creating this node. */
+ public final Object item;
+
+ /** The Thread waiting to be signalled; null until waiting. */
+ public volatile Thread waiter;
+
+ /**
+ * Creates node with given item and empty hole.
+ * @param item the item
+ */
+ public Node(Object item) {
+ this.item = item;
+ }
+ }
+
+ /**
+ * A Slot is an AtomicReference with heuristic padding to lessen
+ * cache effects of this heavily CAS'ed location. While the
+ * padding adds noticeable space, all slots are created only on
+ * demand, and there will be more than one of them only when it
+ * would improve throughput more than enough to outweigh using
+ * extra space.
+ */
+ private static final class Slot extends AtomicReference<Object> {
+ // Improve likelihood of isolation on <= 64 byte cache lines
+ long q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, qa, qb, qc, qd, qe;
+ }
+
+ /**
+ * Slot array. Elements are lazily initialized when needed.
+ * Declared volatile to enable double-checked lazy construction.
+ */
+ private volatile Slot[] arena = new Slot[CAPACITY];
+
+ /**
+ * The maximum slot index being used. The value sometimes
+ * increases when a thread experiences too many CAS contentions,
+ * and sometimes decreases when a spin-wait elapses. Changes
+ * are performed only via compareAndSet, to avoid stale values
+ * when a thread happens to stall right before setting.
+ */
+ private final AtomicInteger max = new AtomicInteger();
+
+ /**
+ * Main exchange function, handling the different policy variants.
+ * Uses Object, not "V" as argument and return value to simplify
+ * handling of sentinel values. Callers from public methods decode
+ * and cast accordingly.
+ *
+ * @param item the (non-null) item to exchange
+ * @param timed true if the wait is timed
+ * @param nanos if timed, the maximum wait time
+ * @return the other thread's item, or CANCEL if interrupted or timed out
+ */
+ private Object doExchange(Object item, boolean timed, long nanos) {
+ Node me = new Node(item); // Create in case occupying
+ int index = hashIndex(); // Index of current slot
+ int fails = 0; // Number of CAS failures
+
+ for (;;) {
+ Object y; // Contents of current slot
+ Slot slot = arena[index];
+ if (slot == null) // Lazily initialize slots
+ createSlot(index); // Continue loop to reread
+ else if ((y = slot.get()) != null && // Try to fulfill
+ slot.compareAndSet(y, null)) {
+ Node you = (Node)y; // Transfer item
+ if (you.compareAndSet(null, item)) {
+ LockSupport.unpark(you.waiter);
+ return you.item;
+ } // Else cancelled; continue
+ }
+ else if (y == null && // Try to occupy
+ slot.compareAndSet(null, me)) {
+ if (index == 0) // Blocking wait for slot 0
+ return timed? awaitNanos(me, slot, nanos): await(me, slot);
+ Object v = spinWait(me, slot); // Spin wait for non-0
+ if (v != CANCEL)
+ return v;
+ me = new Node(item); // Throw away cancelled node
+ int m = max.get();
+ if (m > (index >>>= 1)) // Decrease index
+ max.compareAndSet(m, m - 1); // Maybe shrink table
+ }
+ else if (++fails > 1) { // Allow 2 fails on 1st slot
+ int m = max.get();
+ if (fails > 3 && m < FULL && max.compareAndSet(m, m + 1))
+ index = m + 1; // Grow on 3rd failed slot
+ else if (--index < 0)
+ index = m; // Circularly traverse
+ }
+ }
+ }
+
+ /**
+ * Returns a hash index for the current thread. Uses a one-step
+ * FNV-1a hash code (http://www.isthe.com/chongo/tech/comp/fnv/)
+ * based on the current thread's Thread.getId(). These hash codes
+ * have more uniform distribution properties with respect to small
+ * moduli (here 1-31) than do other simple hashing functions.
+ *
+ * <p>To return an index between 0 and max, we use a cheap
+ * approximation to a mod operation, that also corrects for bias
+ * due to non-power-of-2 remaindering (see {@link
+ * java.util.Random#nextInt}). Bits of the hashcode are masked
+ * with "nbits", the ceiling power of two of table size (looked up
+ * in a table packed into three ints). If too large, this is
+ * retried after rotating the hash by nbits bits, while forcing new
+ * top bit to 0, which guarantees eventual termination (although
+ * with a non-random-bias). This requires an average of less than
+ * 2 tries for all table sizes, and has a maximum 2% difference
+ * from perfectly uniform slot probabilities when applied to all
+ * possible hash codes for sizes less than 32.
+ *
+ * @return a per-thread-random index, 0 <= index < max
+ */
+ private final int hashIndex() {
+ long id = Thread.currentThread().getId();
+ int hash = (((int)(id ^ (id >>> 32))) ^ 0x811c9dc5) * 0x01000193;
+
+ int m = max.get();
+ int nbits = (((0xfffffc00 >> m) & 4) | // Compute ceil(log2(m+1))
+ ((0x000001f8 >>> m) & 2) | // The constants hold
+ ((0xffff00f2 >>> m) & 1)); // a lookup table
+ int index;
+ while ((index = hash & ((1 << nbits) - 1)) > m) // May retry on
+ hash = (hash >>> nbits) | (hash << (33 - nbits)); // non-power-2 m
+ return index;
+ }
+
+ /**
+ * Creates a new slot at given index. Called only when the slot
+ * appears to be null. Relies on double-check using builtin
+ * locks, since they rarely contend. This in turn relies on the
+ * arena array being declared volatile.
+ *
+ * @param index the index to add slot at
+ */
+ private void createSlot(int index) {
+ // Create slot outside of lock to narrow sync region
+ Slot newSlot = new Slot();
+ Slot[] a = arena;
+ synchronized (a) {
+ if (a[index] == null)
+ a[index] = newSlot;
+ }
+ }
+
+ /**
+ * Tries to cancel a wait for the given node waiting in the given
+ * slot, if so, helping clear the node from its slot to avoid
+ * garbage retention.
+ *
+ * @param node the waiting node
+ * @param the slot it is waiting in
+ * @return true if successfully cancelled
+ */
+ private static boolean tryCancel(Node node, Slot slot) {
+ if (!node.compareAndSet(null, CANCEL))
+ return false;
+ if (slot.get() == node) // pre-check to minimize contention
+ slot.compareAndSet(node, null);
+ return true;
+ }
+
+ // Three forms of waiting. Each just different enough not to merge
+ // code with others.
+
+ /**
+ * Spin-waits for hole for a non-0 slot. Fails if spin elapses
+ * before hole filled. Does not check interrupt, relying on check
+ * in public exchange method to abort if interrupted on entry.
+ *
+ * @param node the waiting node
+ * @return on success, the hole; on failure, CANCEL
+ */
+ private static Object spinWait(Node node, Slot slot) {
+ int spins = SPINS;
+ for (;;) {
+ Object v = node.get();
+ if (v != null)
+ return v;
+ else if (spins > 0)
+ --spins;
+ else
+ tryCancel(node, slot);
+ }
+ }
+
+ /**
+ * Waits for (by spinning and/or blocking) and gets the hole
+ * filled in by another thread. Fails if interrupted before
+ * hole filled.
+ *
+ * When a node/thread is about to block, it sets its waiter field
+ * and then rechecks state at least one more time before actually
+ * parking, thus covering race vs fulfiller noticing that waiter
+ * is non-null so should be woken.
+ *
+ * Thread interruption status is checked only surrounding calls to
+ * park. The caller is assumed to have checked interrupt status
+ * on entry.
+ *
+ * @param node the waiting node
+ * @return on success, the hole; on failure, CANCEL
+ */
+ private static Object await(Node node, Slot slot) {
+ Thread w = Thread.currentThread();
+ int spins = SPINS;
+ for (;;) {
+ Object v = node.get();
+ if (v != null)
+ return v;
+ else if (spins > 0) // Spin-wait phase
+ --spins;
+ else if (node.waiter == null) // Set up to block next
+ node.waiter = w;
+ else if (w.isInterrupted()) // Abort on interrupt
+ tryCancel(node, slot);
+ else // Block
+ LockSupport.park(node);
+ }
+ }
+
+ /**
+ * Waits for (at index 0) and gets the hole filled in by another
+ * thread. Fails if timed out or interrupted before hole filled.
+ * Same basic logic as untimed version, but a bit messier.
+ *
+ * @param node the waiting node
+ * @param nanos the wait time
+ * @return on success, the hole; on failure, CANCEL
+ */
+ private Object awaitNanos(Node node, Slot slot, long nanos) {
+ int spins = TIMED_SPINS;
+ long lastTime = 0;
+ Thread w = null;
+ for (;;) {
+ Object v = node.get();
+ if (v != null)
+ return v;
+ long now = System.nanoTime();
+ if (w == null)
+ w = Thread.currentThread();
+ else
+ nanos -= now - lastTime;
+ lastTime = now;
+ if (nanos > 0) {
+ if (spins > 0)
+ --spins;
+ else if (node.waiter == null)
+ node.waiter = w;
+ else if (w.isInterrupted())
+ tryCancel(node, slot);
+ else
+ LockSupport.parkNanos(node, nanos);
+ }
+ else if (tryCancel(node, slot) && !w.isInterrupted())
+ return scanOnTimeout(node);
+ }
+ }
+
+ /**
+ * Sweeps through arena checking for any waiting threads. Called
+ * only upon return from timeout while waiting in slot 0. When a
+ * thread gives up on a timed wait, it is possible that a
+ * previously-entered thread is still waiting in some other
+ * slot. So we scan to check for any. This is almost always
+ * overkill, but decreases the likelihood of timeouts when there
+ * are other threads present to far less than that in lock-based
+ * exchangers in which earlier-arriving threads may still be
+ * waiting on entry locks.
+ *
+ * @param node the waiting node
+ * @return another thread's item, or CANCEL
+ */
+ private Object scanOnTimeout(Node node) {
+ Object y;
+ for (int j = arena.length - 1; j >= 0; --j) {
+ Slot slot = arena[j];
+ if (slot != null) {
+ while ((y = slot.get()) != null) {
+ if (slot.compareAndSet(y, null)) {
+ Node you = (Node)y;
+ if (you.compareAndSet(null, node.item)) {
+ LockSupport.unpark(you.waiter);
+ return you.item;
+ }
+ }
+ }
+ }
+ }
+ return CANCEL;
+ }
+
+ /**
+ * Creates a new Exchanger.
+ */
+ public Exchanger() {
+ }
+
+ /**
+ * Waits for another thread to arrive at this exchange point (unless
+ * the current thread is {@linkplain Thread#interrupt interrupted}),
+ * and then transfers the given object to it, receiving its object
+ * in return.
+ *
+ * <p>If another thread is already waiting at the exchange point then
+ * it is resumed for thread scheduling purposes and receives the object
+ * passed in by the current thread. The current thread returns immediately,
+ * receiving the object passed to the exchange by that other thread.
+ *
+ * <p>If no other thread is already waiting at the exchange then the
+ * current thread is disabled for thread scheduling purposes and lies
+ * dormant until one of two things happens:
+ * <ul>
+ * <li>Some other thread enters the exchange; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts} the current
+ * thread.
+ * </ul>
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while waiting
+ * for the exchange,
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared.
+ *
+ * @param x the object to exchange
+ * @return the object provided by the other thread
+ * @throws InterruptedException if the current thread was
+ * interrupted while waiting
+ */
+ public V exchange(V x) throws InterruptedException {
+ if (!Thread.interrupted()) {
+ Object v = doExchange(x == null? NULL_ITEM : x, false, 0);
+ if (v == NULL_ITEM)
+ return null;
+ if (v != CANCEL)
+ return (V)v;
+ Thread.interrupted(); // Clear interrupt status on IE throw
+ }
+ throw new InterruptedException();
+ }
+
+ /**
+ * Waits for another thread to arrive at this exchange point (unless
+ * the current thread is {@linkplain Thread#interrupt interrupted} or
+ * the specified waiting time elapses), and then transfers the given
+ * object to it, receiving its object in return.
+ *
+ * <p>If another thread is already waiting at the exchange point then
+ * it is resumed for thread scheduling purposes and receives the object
+ * passed in by the current thread. The current thread returns immediately,
+ * receiving the object passed to the exchange by that other thread.
+ *
+ * <p>If no other thread is already waiting at the exchange then the
+ * current thread is disabled for thread scheduling purposes and lies
+ * dormant until one of three things happens:
+ * <ul>
+ * <li>Some other thread enters the exchange; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread; or
+ * <li>The specified waiting time elapses.
+ * </ul>
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while waiting
+ * for the exchange,
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared.
+ *
+ * <p>If the specified waiting time elapses then {@link
+ * TimeoutException} is thrown. If the time is less than or equal
+ * to zero, the method will not wait at all.
+ *
+ * @param x the object to exchange
+ * @param timeout the maximum time to wait
+ * @param unit the time unit of the <tt>timeout</tt> argument
+ * @return the object provided by the other thread
+ * @throws InterruptedException if the current thread was
+ * interrupted while waiting
+ * @throws TimeoutException if the specified waiting time elapses
+ * before another thread enters the exchange
+ */
+ public V exchange(V x, long timeout, TimeUnit unit)
+ throws InterruptedException, TimeoutException {
+ if (!Thread.interrupted()) {
+ Object v = doExchange(x == null? NULL_ITEM : x,
+ true, unit.toNanos(timeout));
+ if (v == NULL_ITEM)
+ return null;
+ if (v != CANCEL)
+ return (V)v;
+ if (!Thread.interrupted())
+ throw new TimeoutException();
+ }
+ throw new InterruptedException();
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ExecutionException.java b/libjava/classpath/external/jsr166/java/util/concurrent/ExecutionException.java
new file mode 100644
index 00000000000..bc561e58ebb
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ExecutionException.java
@@ -0,0 +1,65 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * Exception thrown when attempting to retrieve the result of a task
+ * that aborted by throwing an exception. This exception can be
+ * inspected using the {@link #getCause()} method.
+ *
+ * @see Future
+ * @since 1.5
+ * @author Doug Lea
+ */
+public class ExecutionException extends Exception {
+ private static final long serialVersionUID = 7830266012832686185L;
+
+ /**
+ * Constructs an <tt>ExecutionException</tt> with no detail message.
+ * The cause is not initialized, and may subsequently be
+ * initialized by a call to {@link #initCause(Throwable) initCause}.
+ */
+ protected ExecutionException() { }
+
+ /**
+ * Constructs an <tt>ExecutionException</tt> with the specified detail
+ * message. The cause is not initialized, and may subsequently be
+ * initialized by a call to {@link #initCause(Throwable) initCause}.
+ *
+ * @param message the detail message
+ */
+ protected ExecutionException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs an <tt>ExecutionException</tt> with the specified detail
+ * message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method)
+ */
+ public ExecutionException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs an <tt>ExecutionException</tt> with the specified cause.
+ * The detail message is set to:
+ * <pre>
+ * (cause == null ? null : cause.toString())</pre>
+ * (which typically contains the class and detail message of
+ * <tt>cause</tt>).
+ *
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method)
+ */
+ public ExecutionException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/Executor.java b/libjava/classpath/external/jsr166/java/util/concurrent/Executor.java
new file mode 100644
index 00000000000..a61e9215291
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/Executor.java
@@ -0,0 +1,112 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * An object that executes submitted {@link Runnable} tasks. This
+ * interface provides a way of decoupling task submission from the
+ * mechanics of how each task will be run, including details of thread
+ * use, scheduling, etc. An <tt>Executor</tt> is normally used
+ * instead of explicitly creating threads. For example, rather than
+ * invoking <tt>new Thread(new(RunnableTask())).start()</tt> for each
+ * of a set of tasks, you might use:
+ *
+ * <pre>
+ * Executor executor = <em>anExecutor</em>;
+ * executor.execute(new RunnableTask1());
+ * executor.execute(new RunnableTask2());
+ * ...
+ * </pre>
+ *
+ * However, the <tt>Executor</tt> interface does not strictly
+ * require that execution be asynchronous. In the simplest case, an
+ * executor can run the submitted task immediately in the caller's
+ * thread:
+ *
+ * <pre>
+ * class DirectExecutor implements Executor {
+ * public void execute(Runnable r) {
+ * r.run();
+ * }
+ * }</pre>
+ *
+ * More typically, tasks are executed in some thread other
+ * than the caller's thread. The executor below spawns a new thread
+ * for each task.
+ *
+ * <pre>
+ * class ThreadPerTaskExecutor implements Executor {
+ * public void execute(Runnable r) {
+ * new Thread(r).start();
+ * }
+ * }</pre>
+ *
+ * Many <tt>Executor</tt> implementations impose some sort of
+ * limitation on how and when tasks are scheduled. The executor below
+ * serializes the submission of tasks to a second executor,
+ * illustrating a composite executor.
+ *
+ * <pre>
+ * class SerialExecutor implements Executor {
+ * final Queue&lt;Runnable&gt; tasks = new ArrayDeque&lt;Runnable&gt;();
+ * final Executor executor;
+ * Runnable active;
+ *
+ * SerialExecutor(Executor executor) {
+ * this.executor = executor;
+ * }
+ *
+ * public synchronized void execute(final Runnable r) {
+ * tasks.offer(new Runnable() {
+ * public void run() {
+ * try {
+ * r.run();
+ * } finally {
+ * scheduleNext();
+ * }
+ * }
+ * });
+ * if (active == null) {
+ * scheduleNext();
+ * }
+ * }
+ *
+ * protected synchronized void scheduleNext() {
+ * if ((active = tasks.poll()) != null) {
+ * executor.execute(active);
+ * }
+ * }
+ * }</pre>
+ *
+ * The <tt>Executor</tt> implementations provided in this package
+ * implement {@link ExecutorService}, which is a more extensive
+ * interface. The {@link ThreadPoolExecutor} class provides an
+ * extensible thread pool implementation. The {@link Executors} class
+ * provides convenient factory methods for these Executors.
+ *
+ * <p>Memory consistency effects: Actions in a thread prior to
+ * submitting a {@code Runnable} object to an {@code Executor}
+ * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
+ * its execution begins, perhaps in another thread.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public interface Executor {
+
+ /**
+ * Executes the given command at some time in the future. The command
+ * may execute in a new thread, in a pooled thread, or in the calling
+ * thread, at the discretion of the <tt>Executor</tt> implementation.
+ *
+ * @param command the runnable task
+ * @throws RejectedExecutionException if this task cannot be
+ * accepted for execution.
+ * @throws NullPointerException if command is null
+ */
+ void execute(Runnable command);
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ExecutorCompletionService.java b/libjava/classpath/external/jsr166/java/util/concurrent/ExecutorCompletionService.java
new file mode 100644
index 00000000000..9b7a0e027a0
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ExecutorCompletionService.java
@@ -0,0 +1,174 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * A {@link CompletionService} that uses a supplied {@link Executor}
+ * to execute tasks. This class arranges that submitted tasks are,
+ * upon completion, placed on a queue accessible using <tt>take</tt>.
+ * The class is lightweight enough to be suitable for transient use
+ * when processing groups of tasks.
+ *
+ * <p>
+ *
+ * <b>Usage Examples.</b>
+ *
+ * Suppose you have a set of solvers for a certain problem, each
+ * returning a value of some type <tt>Result</tt>, and would like to
+ * run them concurrently, processing the results of each of them that
+ * return a non-null value, in some method <tt>use(Result r)</tt>. You
+ * could write this as:
+ *
+ * <pre>
+ * void solve(Executor e,
+ * Collection&lt;Callable&lt;Result&gt;&gt; solvers)
+ * throws InterruptedException, ExecutionException {
+ * CompletionService&lt;Result&gt; ecs
+ * = new ExecutorCompletionService&lt;Result&gt;(e);
+ * for (Callable&lt;Result&gt; s : solvers)
+ * ecs.submit(s);
+ * int n = solvers.size();
+ * for (int i = 0; i &lt; n; ++i) {
+ * Result r = ecs.take().get();
+ * if (r != null)
+ * use(r);
+ * }
+ * }
+ * </pre>
+ *
+ * Suppose instead that you would like to use the first non-null result
+ * of the set of tasks, ignoring any that encounter exceptions,
+ * and cancelling all other tasks when the first one is ready:
+ *
+ * <pre>
+ * void solve(Executor e,
+ * Collection&lt;Callable&lt;Result&gt;&gt; solvers)
+ * throws InterruptedException {
+ * CompletionService&lt;Result&gt; ecs
+ * = new ExecutorCompletionService&lt;Result&gt;(e);
+ * int n = solvers.size();
+ * List&lt;Future&lt;Result&gt;&gt; futures
+ * = new ArrayList&lt;Future&lt;Result&gt;&gt;(n);
+ * Result result = null;
+ * try {
+ * for (Callable&lt;Result&gt; s : solvers)
+ * futures.add(ecs.submit(s));
+ * for (int i = 0; i &lt; n; ++i) {
+ * try {
+ * Result r = ecs.take().get();
+ * if (r != null) {
+ * result = r;
+ * break;
+ * }
+ * } catch (ExecutionException ignore) {}
+ * }
+ * }
+ * finally {
+ * for (Future&lt;Result&gt; f : futures)
+ * f.cancel(true);
+ * }
+ *
+ * if (result != null)
+ * use(result);
+ * }
+ * </pre>
+ */
+public class ExecutorCompletionService<V> implements CompletionService<V> {
+ private final Executor executor;
+ private final AbstractExecutorService aes;
+ private final BlockingQueue<Future<V>> completionQueue;
+
+ /**
+ * FutureTask extension to enqueue upon completion
+ */
+ private class QueueingFuture extends FutureTask<Void> {
+ QueueingFuture(RunnableFuture<V> task) {
+ super(task, null);
+ this.task = task;
+ }
+ protected void done() { completionQueue.add(task); }
+ private final Future<V> task;
+ }
+
+ private RunnableFuture<V> newTaskFor(Callable<V> task) {
+ if (aes == null)
+ return new FutureTask<V>(task);
+ else
+ return aes.newTaskFor(task);
+ }
+
+ private RunnableFuture<V> newTaskFor(Runnable task, V result) {
+ if (aes == null)
+ return new FutureTask<V>(task, result);
+ else
+ return aes.newTaskFor(task, result);
+ }
+
+ /**
+ * Creates an ExecutorCompletionService using the supplied
+ * executor for base task execution and a
+ * {@link LinkedBlockingQueue} as a completion queue.
+ *
+ * @param executor the executor to use
+ * @throws NullPointerException if executor is <tt>null</tt>
+ */
+ public ExecutorCompletionService(Executor executor) {
+ if (executor == null)
+ throw new NullPointerException();
+ this.executor = executor;
+ this.aes = (executor instanceof AbstractExecutorService) ?
+ (AbstractExecutorService) executor : null;
+ this.completionQueue = new LinkedBlockingQueue<Future<V>>();
+ }
+
+ /**
+ * Creates an ExecutorCompletionService using the supplied
+ * executor for base task execution and the supplied queue as its
+ * completion queue.
+ *
+ * @param executor the executor to use
+ * @param completionQueue the queue to use as the completion queue
+ * normally one dedicated for use by this service
+ * @throws NullPointerException if executor or completionQueue are <tt>null</tt>
+ */
+ public ExecutorCompletionService(Executor executor,
+ BlockingQueue<Future<V>> completionQueue) {
+ if (executor == null || completionQueue == null)
+ throw new NullPointerException();
+ this.executor = executor;
+ this.aes = (executor instanceof AbstractExecutorService) ?
+ (AbstractExecutorService) executor : null;
+ this.completionQueue = completionQueue;
+ }
+
+ public Future<V> submit(Callable<V> task) {
+ if (task == null) throw new NullPointerException();
+ RunnableFuture<V> f = newTaskFor(task);
+ executor.execute(new QueueingFuture(f));
+ return f;
+ }
+
+ public Future<V> submit(Runnable task, V result) {
+ if (task == null) throw new NullPointerException();
+ RunnableFuture<V> f = newTaskFor(task, result);
+ executor.execute(new QueueingFuture(f));
+ return f;
+ }
+
+ public Future<V> take() throws InterruptedException {
+ return completionQueue.take();
+ }
+
+ public Future<V> poll() {
+ return completionQueue.poll();
+ }
+
+ public Future<V> poll(long timeout, TimeUnit unit) throws InterruptedException {
+ return completionQueue.poll(timeout, unit);
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ExecutorService.java b/libjava/classpath/external/jsr166/java/util/concurrent/ExecutorService.java
new file mode 100644
index 00000000000..77731926562
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ExecutorService.java
@@ -0,0 +1,306 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.List;
+import java.util.Collection;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedExceptionAction;
+
+/**
+ * An {@link Executor} that provides methods to manage termination and
+ * methods that can produce a {@link Future} for tracking progress of
+ * one or more asynchronous tasks.
+ *
+ * <p>
+ * An <tt>ExecutorService</tt> can be shut down, which will cause it
+ * to stop accepting new tasks. After being shut down, the executor
+ * will eventually terminate, at which point no tasks are actively
+ * executing, no tasks are awaiting execution, and no new tasks can be
+ * submitted. An unused <tt>ExecutorService</tt> should be shut down
+ * to allow reclamation of its resources.
+ *
+ * <p> Method <tt>submit</tt> extends base method {@link
+ * Executor#execute} by creating and returning a {@link Future} that
+ * can be used to cancel execution and/or wait for completion.
+ * Methods <tt>invokeAny</tt> and <tt>invokeAll</tt> perform the most
+ * commonly useful forms of bulk execution, executing a collection of
+ * tasks and then waiting for at least one, or all, to
+ * complete. (Class {@link ExecutorCompletionService} can be used to
+ * write customized variants of these methods.)
+ *
+ * <p>The {@link Executors} class provides factory methods for the
+ * executor services provided in this package.
+ *
+ * <h3>Usage Example</h3>
+ *
+ * Here is a sketch of a network service in which threads in a thread
+ * pool service incoming requests. It uses the preconfigured {@link
+ * Executors#newFixedThreadPool} factory method:
+ *
+ * <pre>
+ * class NetworkService {
+ * private final ServerSocket serverSocket;
+ * private final ExecutorService pool;
+ *
+ * public NetworkService(int port, int poolSize)
+ * throws IOException {
+ * serverSocket = new ServerSocket(port);
+ * pool = Executors.newFixedThreadPool(poolSize);
+ * }
+ *
+ * public void serve() {
+ * try {
+ * for (;;) {
+ * pool.execute(new Handler(serverSocket.accept()));
+ * }
+ * } catch (IOException ex) {
+ * pool.shutdown();
+ * }
+ * }
+ * }
+ *
+ * class Handler implements Runnable {
+ * private final Socket socket;
+ * Handler(Socket socket) { this.socket = socket; }
+ * public void run() {
+ * // read and service request
+ * }
+ * }
+ * </pre>
+ *
+ * <p>Memory consistency effects: Actions in a thread prior to the
+ * submission of a {@code Runnable} or {@code Callable} task to an
+ * {@code ExecutorService}
+ * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
+ * any actions taken by that task, which in turn <i>happen-before</i> the
+ * result is retrieved via {@code Future.get()}.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public interface ExecutorService extends Executor {
+
+ /**
+ * Initiates an orderly shutdown in which previously submitted
+ * tasks are executed, but no new tasks will be accepted.
+ * Invocation has no additional effect if already shut down.
+ *
+ * @throws SecurityException if a security manager exists and
+ * shutting down this ExecutorService may manipulate
+ * threads that the caller is not permitted to modify
+ * because it does not hold {@link
+ * java.lang.RuntimePermission}<tt>("modifyThread")</tt>,
+ * or the security manager's <tt>checkAccess</tt> method
+ * denies access.
+ */
+ void shutdown();
+
+ /**
+ * Attempts to stop all actively executing tasks, halts the
+ * processing of waiting tasks, and returns a list of the tasks that were
+ * awaiting execution.
+ *
+ * <p>There are no guarantees beyond best-effort attempts to stop
+ * processing actively executing tasks. For example, typical
+ * implementations will cancel via {@link Thread#interrupt}, so any
+ * task that fails to respond to interrupts may never terminate.
+ *
+ * @return list of tasks that never commenced execution
+ * @throws SecurityException if a security manager exists and
+ * shutting down this ExecutorService may manipulate
+ * threads that the caller is not permitted to modify
+ * because it does not hold {@link
+ * java.lang.RuntimePermission}<tt>("modifyThread")</tt>,
+ * or the security manager's <tt>checkAccess</tt> method
+ * denies access.
+ */
+ List<Runnable> shutdownNow();
+
+ /**
+ * Returns <tt>true</tt> if this executor has been shut down.
+ *
+ * @return <tt>true</tt> if this executor has been shut down
+ */
+ boolean isShutdown();
+
+ /**
+ * Returns <tt>true</tt> if all tasks have completed following shut down.
+ * Note that <tt>isTerminated</tt> is never <tt>true</tt> unless
+ * either <tt>shutdown</tt> or <tt>shutdownNow</tt> was called first.
+ *
+ * @return <tt>true</tt> if all tasks have completed following shut down
+ */
+ boolean isTerminated();
+
+ /**
+ * Blocks until all tasks have completed execution after a shutdown
+ * request, or the timeout occurs, or the current thread is
+ * interrupted, whichever happens first.
+ *
+ * @param timeout the maximum time to wait
+ * @param unit the time unit of the timeout argument
+ * @return <tt>true</tt> if this executor terminated and
+ * <tt>false</tt> if the timeout elapsed before termination
+ * @throws InterruptedException if interrupted while waiting
+ */
+ boolean awaitTermination(long timeout, TimeUnit unit)
+ throws InterruptedException;
+
+
+ /**
+ * Submits a value-returning task for execution and returns a
+ * Future representing the pending results of the task. The
+ * Future's <tt>get</tt> method will return the task's result upon
+ * successful completion.
+ *
+ * <p>
+ * If you would like to immediately block waiting
+ * for a task, you can use constructions of the form
+ * <tt>result = exec.submit(aCallable).get();</tt>
+ *
+ * <p> Note: The {@link Executors} class includes a set of methods
+ * that can convert some other common closure-like objects,
+ * for example, {@link java.security.PrivilegedAction} to
+ * {@link Callable} form so they can be submitted.
+ *
+ * @param task the task to submit
+ * @return a Future representing pending completion of the task
+ * @throws RejectedExecutionException if the task cannot be
+ * scheduled for execution
+ * @throws NullPointerException if the task is null
+ */
+ <T> Future<T> submit(Callable<T> task);
+
+ /**
+ * Submits a Runnable task for execution and returns a Future
+ * representing that task. The Future's <tt>get</tt> method will
+ * return the given result upon successful completion.
+ *
+ * @param task the task to submit
+ * @param result the result to return
+ * @return a Future representing pending completion of the task
+ * @throws RejectedExecutionException if the task cannot be
+ * scheduled for execution
+ * @throws NullPointerException if the task is null
+ */
+ <T> Future<T> submit(Runnable task, T result);
+
+ /**
+ * Submits a Runnable task for execution and returns a Future
+ * representing that task. The Future's <tt>get</tt> method will
+ * return <tt>null</tt> upon <em>successful</em> completion.
+ *
+ * @param task the task to submit
+ * @return a Future representing pending completion of the task
+ * @throws RejectedExecutionException if the task cannot be
+ * scheduled for execution
+ * @throws NullPointerException if the task is null
+ */
+ Future<?> submit(Runnable task);
+
+ /**
+ * Executes the given tasks, returning a list of Futures holding
+ * their status and results when all complete.
+ * {@link Future#isDone} is <tt>true</tt> for each
+ * element of the returned list.
+ * Note that a <em>completed</em> task could have
+ * terminated either normally or by throwing an exception.
+ * The results of this method are undefined if the given
+ * collection is modified while this operation is in progress.
+ *
+ * @param tasks the collection of tasks
+ * @return A list of Futures representing the tasks, in the same
+ * sequential order as produced by the iterator for the
+ * given task list, each of which has completed.
+ * @throws InterruptedException if interrupted while waiting, in
+ * which case unfinished tasks are cancelled.
+ * @throws NullPointerException if tasks or any of its elements are <tt>null</tt>
+ * @throws RejectedExecutionException if any task cannot be
+ * scheduled for execution
+ */
+
+ <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
+ throws InterruptedException;
+
+ /**
+ * Executes the given tasks, returning a list of Futures holding
+ * their status and results
+ * when all complete or the timeout expires, whichever happens first.
+ * {@link Future#isDone} is <tt>true</tt> for each
+ * element of the returned list.
+ * Upon return, tasks that have not completed are cancelled.
+ * Note that a <em>completed</em> task could have
+ * terminated either normally or by throwing an exception.
+ * The results of this method are undefined if the given
+ * collection is modified while this operation is in progress.
+ *
+ * @param tasks the collection of tasks
+ * @param timeout the maximum time to wait
+ * @param unit the time unit of the timeout argument
+ * @return a list of Futures representing the tasks, in the same
+ * sequential order as produced by the iterator for the
+ * given task list. If the operation did not time out,
+ * each task will have completed. If it did time out, some
+ * of these tasks will not have completed.
+ * @throws InterruptedException if interrupted while waiting, in
+ * which case unfinished tasks are cancelled
+ * @throws NullPointerException if tasks, any of its elements, or
+ * unit are <tt>null</tt>
+ * @throws RejectedExecutionException if any task cannot be scheduled
+ * for execution
+ */
+ <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks,
+ long timeout, TimeUnit unit)
+ throws InterruptedException;
+
+ /**
+ * Executes the given tasks, returning the result
+ * of one that has completed successfully (i.e., without throwing
+ * an exception), if any do. Upon normal or exceptional return,
+ * tasks that have not completed are cancelled.
+ * The results of this method are undefined if the given
+ * collection is modified while this operation is in progress.
+ *
+ * @param tasks the collection of tasks
+ * @return the result returned by one of the tasks
+ * @throws InterruptedException if interrupted while waiting
+ * @throws NullPointerException if tasks or any of its elements
+ * are <tt>null</tt>
+ * @throws IllegalArgumentException if tasks is empty
+ * @throws ExecutionException if no task successfully completes
+ * @throws RejectedExecutionException if tasks cannot be scheduled
+ * for execution
+ */
+ <T> T invokeAny(Collection<? extends Callable<T>> tasks)
+ throws InterruptedException, ExecutionException;
+
+ /**
+ * Executes the given tasks, returning the result
+ * of one that has completed successfully (i.e., without throwing
+ * an exception), if any do before the given timeout elapses.
+ * Upon normal or exceptional return, tasks that have not
+ * completed are cancelled.
+ * The results of this method are undefined if the given
+ * collection is modified while this operation is in progress.
+ *
+ * @param tasks the collection of tasks
+ * @param timeout the maximum time to wait
+ * @param unit the time unit of the timeout argument
+ * @return the result returned by one of the tasks.
+ * @throws InterruptedException if interrupted while waiting
+ * @throws NullPointerException if tasks, any of its elements, or
+ * unit are <tt>null</tt>
+ * @throws TimeoutException if the given timeout elapses before
+ * any task successfully completes
+ * @throws ExecutionException if no task successfully completes
+ * @throws RejectedExecutionException if tasks cannot be scheduled
+ * for execution
+ */
+ <T> T invokeAny(Collection<? extends Callable<T>> tasks,
+ long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException;
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/Executors.java b/libjava/classpath/external/jsr166/java/util/concurrent/Executors.java
new file mode 100644
index 00000000000..f44e66160f7
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/Executors.java
@@ -0,0 +1,666 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedExceptionAction;
+import java.security.AccessControlException;
+
+/**
+ * Factory and utility methods for {@link Executor}, {@link
+ * ExecutorService}, {@link ScheduledExecutorService}, {@link
+ * ThreadFactory}, and {@link Callable} classes defined in this
+ * package. This class supports the following kinds of methods:
+ *
+ * <ul>
+ * <li> Methods that create and return an {@link ExecutorService}
+ * set up with commonly useful configuration settings.
+ * <li> Methods that create and return a {@link ScheduledExecutorService}
+ * set up with commonly useful configuration settings.
+ * <li> Methods that create and return a "wrapped" ExecutorService, that
+ * disables reconfiguration by making implementation-specific methods
+ * inaccessible.
+ * <li> Methods that create and return a {@link ThreadFactory}
+ * that sets newly created threads to a known state.
+ * <li> Methods that create and return a {@link Callable}
+ * out of other closure-like forms, so they can be used
+ * in execution methods requiring <tt>Callable</tt>.
+ * </ul>
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public class Executors {
+
+ /**
+ * Creates a thread pool that reuses a fixed number of threads
+ * operating off a shared unbounded queue. At any point, at most
+ * <tt>nThreads</tt> threads will be active processing tasks.
+ * If additional tasks are submitted when all threads are active,
+ * they will wait in the queue until a thread is available.
+ * If any thread terminates due to a failure during execution
+ * prior to shutdown, a new one will take its place if needed to
+ * execute subsequent tasks. The threads in the pool will exist
+ * until it is explicitly {@link ExecutorService#shutdown shutdown}.
+ *
+ * @param nThreads the number of threads in the pool
+ * @return the newly created thread pool
+ * @throws IllegalArgumentException if <tt>nThreads &lt;= 0</tt>
+ */
+ public static ExecutorService newFixedThreadPool(int nThreads) {
+ return new ThreadPoolExecutor(nThreads, nThreads,
+ 0L, TimeUnit.MILLISECONDS,
+ new LinkedBlockingQueue<Runnable>());
+ }
+
+ /**
+ * Creates a thread pool that reuses a fixed number of threads
+ * operating off a shared unbounded queue, using the provided
+ * ThreadFactory to create new threads when needed. At any point,
+ * at most <tt>nThreads</tt> threads will be active processing
+ * tasks. If additional tasks are submitted when all threads are
+ * active, they will wait in the queue until a thread is
+ * available. If any thread terminates due to a failure during
+ * execution prior to shutdown, a new one will take its place if
+ * needed to execute subsequent tasks. The threads in the pool will
+ * exist until it is explicitly {@link ExecutorService#shutdown
+ * shutdown}.
+ *
+ * @param nThreads the number of threads in the pool
+ * @param threadFactory the factory to use when creating new threads
+ * @return the newly created thread pool
+ * @throws NullPointerException if threadFactory is null
+ * @throws IllegalArgumentException if <tt>nThreads &lt;= 0</tt>
+ */
+ public static ExecutorService newFixedThreadPool(int nThreads, ThreadFactory threadFactory) {
+ return new ThreadPoolExecutor(nThreads, nThreads,
+ 0L, TimeUnit.MILLISECONDS,
+ new LinkedBlockingQueue<Runnable>(),
+ threadFactory);
+ }
+
+ /**
+ * Creates an Executor that uses a single worker thread operating
+ * off an unbounded queue. (Note however that if this single
+ * thread terminates due to a failure during execution prior to
+ * shutdown, a new one will take its place if needed to execute
+ * subsequent tasks.) Tasks are guaranteed to execute
+ * sequentially, and no more than one task will be active at any
+ * given time. Unlike the otherwise equivalent
+ * <tt>newFixedThreadPool(1)</tt> the returned executor is
+ * guaranteed not to be reconfigurable to use additional threads.
+ *
+ * @return the newly created single-threaded Executor
+ */
+ public static ExecutorService newSingleThreadExecutor() {
+ return new FinalizableDelegatedExecutorService
+ (new ThreadPoolExecutor(1, 1,
+ 0L, TimeUnit.MILLISECONDS,
+ new LinkedBlockingQueue<Runnable>()));
+ }
+
+ /**
+ * Creates an Executor that uses a single worker thread operating
+ * off an unbounded queue, and uses the provided ThreadFactory to
+ * create a new thread when needed. Unlike the otherwise
+ * equivalent <tt>newFixedThreadPool(1, threadFactory)</tt> the
+ * returned executor is guaranteed not to be reconfigurable to use
+ * additional threads.
+ *
+ * @param threadFactory the factory to use when creating new
+ * threads
+ *
+ * @return the newly created single-threaded Executor
+ * @throws NullPointerException if threadFactory is null
+ */
+ public static ExecutorService newSingleThreadExecutor(ThreadFactory threadFactory) {
+ return new FinalizableDelegatedExecutorService
+ (new ThreadPoolExecutor(1, 1,
+ 0L, TimeUnit.MILLISECONDS,
+ new LinkedBlockingQueue<Runnable>(),
+ threadFactory));
+ }
+
+ /**
+ * Creates a thread pool that creates new threads as needed, but
+ * will reuse previously constructed threads when they are
+ * available. These pools will typically improve the performance
+ * of programs that execute many short-lived asynchronous tasks.
+ * Calls to <tt>execute</tt> will reuse previously constructed
+ * threads if available. If no existing thread is available, a new
+ * thread will be created and added to the pool. Threads that have
+ * not been used for sixty seconds are terminated and removed from
+ * the cache. Thus, a pool that remains idle for long enough will
+ * not consume any resources. Note that pools with similar
+ * properties but different details (for example, timeout parameters)
+ * may be created using {@link ThreadPoolExecutor} constructors.
+ *
+ * @return the newly created thread pool
+ */
+ public static ExecutorService newCachedThreadPool() {
+ return new ThreadPoolExecutor(0, Integer.MAX_VALUE,
+ 60L, TimeUnit.SECONDS,
+ new SynchronousQueue<Runnable>());
+ }
+
+ /**
+ * Creates a thread pool that creates new threads as needed, but
+ * will reuse previously constructed threads when they are
+ * available, and uses the provided
+ * ThreadFactory to create new threads when needed.
+ * @param threadFactory the factory to use when creating new threads
+ * @return the newly created thread pool
+ * @throws NullPointerException if threadFactory is null
+ */
+ public static ExecutorService newCachedThreadPool(ThreadFactory threadFactory) {
+ return new ThreadPoolExecutor(0, Integer.MAX_VALUE,
+ 60L, TimeUnit.SECONDS,
+ new SynchronousQueue<Runnable>(),
+ threadFactory);
+ }
+
+ /**
+ * Creates a single-threaded executor that can schedule commands
+ * to run after a given delay, or to execute periodically.
+ * (Note however that if this single
+ * thread terminates due to a failure during execution prior to
+ * shutdown, a new one will take its place if needed to execute
+ * subsequent tasks.) Tasks are guaranteed to execute
+ * sequentially, and no more than one task will be active at any
+ * given time. Unlike the otherwise equivalent
+ * <tt>newScheduledThreadPool(1)</tt> the returned executor is
+ * guaranteed not to be reconfigurable to use additional threads.
+ * @return the newly created scheduled executor
+ */
+ public static ScheduledExecutorService newSingleThreadScheduledExecutor() {
+ return new DelegatedScheduledExecutorService
+ (new ScheduledThreadPoolExecutor(1));
+ }
+
+ /**
+ * Creates a single-threaded executor that can schedule commands
+ * to run after a given delay, or to execute periodically. (Note
+ * however that if this single thread terminates due to a failure
+ * during execution prior to shutdown, a new one will take its
+ * place if needed to execute subsequent tasks.) Tasks are
+ * guaranteed to execute sequentially, and no more than one task
+ * will be active at any given time. Unlike the otherwise
+ * equivalent <tt>newScheduledThreadPool(1, threadFactory)</tt>
+ * the returned executor is guaranteed not to be reconfigurable to
+ * use additional threads.
+ * @param threadFactory the factory to use when creating new
+ * threads
+ * @return a newly created scheduled executor
+ * @throws NullPointerException if threadFactory is null
+ */
+ public static ScheduledExecutorService newSingleThreadScheduledExecutor(ThreadFactory threadFactory) {
+ return new DelegatedScheduledExecutorService
+ (new ScheduledThreadPoolExecutor(1, threadFactory));
+ }
+
+ /**
+ * Creates a thread pool that can schedule commands to run after a
+ * given delay, or to execute periodically.
+ * @param corePoolSize the number of threads to keep in the pool,
+ * even if they are idle.
+ * @return a newly created scheduled thread pool
+ * @throws IllegalArgumentException if <tt>corePoolSize &lt; 0</tt>
+ */
+ public static ScheduledExecutorService newScheduledThreadPool(int corePoolSize) {
+ return new ScheduledThreadPoolExecutor(corePoolSize);
+ }
+
+ /**
+ * Creates a thread pool that can schedule commands to run after a
+ * given delay, or to execute periodically.
+ * @param corePoolSize the number of threads to keep in the pool,
+ * even if they are idle.
+ * @param threadFactory the factory to use when the executor
+ * creates a new thread.
+ * @return a newly created scheduled thread pool
+ * @throws IllegalArgumentException if <tt>corePoolSize &lt; 0</tt>
+ * @throws NullPointerException if threadFactory is null
+ */
+ public static ScheduledExecutorService newScheduledThreadPool(
+ int corePoolSize, ThreadFactory threadFactory) {
+ return new ScheduledThreadPoolExecutor(corePoolSize, threadFactory);
+ }
+
+
+ /**
+ * Returns an object that delegates all defined {@link
+ * ExecutorService} methods to the given executor, but not any
+ * other methods that might otherwise be accessible using
+ * casts. This provides a way to safely "freeze" configuration and
+ * disallow tuning of a given concrete implementation.
+ * @param executor the underlying implementation
+ * @return an <tt>ExecutorService</tt> instance
+ * @throws NullPointerException if executor null
+ */
+ public static ExecutorService unconfigurableExecutorService(ExecutorService executor) {
+ if (executor == null)
+ throw new NullPointerException();
+ return new DelegatedExecutorService(executor);
+ }
+
+ /**
+ * Returns an object that delegates all defined {@link
+ * ScheduledExecutorService} methods to the given executor, but
+ * not any other methods that might otherwise be accessible using
+ * casts. This provides a way to safely "freeze" configuration and
+ * disallow tuning of a given concrete implementation.
+ * @param executor the underlying implementation
+ * @return a <tt>ScheduledExecutorService</tt> instance
+ * @throws NullPointerException if executor null
+ */
+ public static ScheduledExecutorService unconfigurableScheduledExecutorService(ScheduledExecutorService executor) {
+ if (executor == null)
+ throw new NullPointerException();
+ return new DelegatedScheduledExecutorService(executor);
+ }
+
+ /**
+ * Returns a default thread factory used to create new threads.
+ * This factory creates all new threads used by an Executor in the
+ * same {@link ThreadGroup}. If there is a {@link
+ * java.lang.SecurityManager}, it uses the group of {@link
+ * System#getSecurityManager}, else the group of the thread
+ * invoking this <tt>defaultThreadFactory</tt> method. Each new
+ * thread is created as a non-daemon thread with priority set to
+ * the smaller of <tt>Thread.NORM_PRIORITY</tt> and the maximum
+ * priority permitted in the thread group. New threads have names
+ * accessible via {@link Thread#getName} of
+ * <em>pool-N-thread-M</em>, where <em>N</em> is the sequence
+ * number of this factory, and <em>M</em> is the sequence number
+ * of the thread created by this factory.
+ * @return a thread factory
+ */
+ public static ThreadFactory defaultThreadFactory() {
+ return new DefaultThreadFactory();
+ }
+
+ /**
+ * Returns a thread factory used to create new threads that
+ * have the same permissions as the current thread.
+ * This factory creates threads with the same settings as {@link
+ * Executors#defaultThreadFactory}, additionally setting the
+ * AccessControlContext and contextClassLoader of new threads to
+ * be the same as the thread invoking this
+ * <tt>privilegedThreadFactory</tt> method. A new
+ * <tt>privilegedThreadFactory</tt> can be created within an
+ * {@link AccessController#doPrivileged} action setting the
+ * current thread's access control context to create threads with
+ * the selected permission settings holding within that action.
+ *
+ * <p> Note that while tasks running within such threads will have
+ * the same access control and class loader settings as the
+ * current thread, they need not have the same {@link
+ * java.lang.ThreadLocal} or {@link
+ * java.lang.InheritableThreadLocal} values. If necessary,
+ * particular values of thread locals can be set or reset before
+ * any task runs in {@link ThreadPoolExecutor} subclasses using
+ * {@link ThreadPoolExecutor#beforeExecute}. Also, if it is
+ * necessary to initialize worker threads to have the same
+ * InheritableThreadLocal settings as some other designated
+ * thread, you can create a custom ThreadFactory in which that
+ * thread waits for and services requests to create others that
+ * will inherit its values.
+ *
+ * @return a thread factory
+ * @throws AccessControlException if the current access control
+ * context does not have permission to both get and set context
+ * class loader.
+ */
+ public static ThreadFactory privilegedThreadFactory() {
+ return new PrivilegedThreadFactory();
+ }
+
+ /**
+ * Returns a {@link Callable} object that, when
+ * called, runs the given task and returns the given result. This
+ * can be useful when applying methods requiring a
+ * <tt>Callable</tt> to an otherwise resultless action.
+ * @param task the task to run
+ * @param result the result to return
+ * @return a callable object
+ * @throws NullPointerException if task null
+ */
+ public static <T> Callable<T> callable(Runnable task, T result) {
+ if (task == null)
+ throw new NullPointerException();
+ return new RunnableAdapter<T>(task, result);
+ }
+
+ /**
+ * Returns a {@link Callable} object that, when
+ * called, runs the given task and returns <tt>null</tt>.
+ * @param task the task to run
+ * @return a callable object
+ * @throws NullPointerException if task null
+ */
+ public static Callable<Object> callable(Runnable task) {
+ if (task == null)
+ throw new NullPointerException();
+ return new RunnableAdapter<Object>(task, null);
+ }
+
+ /**
+ * Returns a {@link Callable} object that, when
+ * called, runs the given privileged action and returns its result.
+ * @param action the privileged action to run
+ * @return a callable object
+ * @throws NullPointerException if action null
+ */
+ public static Callable<Object> callable(final PrivilegedAction<?> action) {
+ if (action == null)
+ throw new NullPointerException();
+ return new Callable<Object>() {
+ public Object call() { return action.run(); }};
+ }
+
+ /**
+ * Returns a {@link Callable} object that, when
+ * called, runs the given privileged exception action and returns
+ * its result.
+ * @param action the privileged exception action to run
+ * @return a callable object
+ * @throws NullPointerException if action null
+ */
+ public static Callable<Object> callable(final PrivilegedExceptionAction<?> action) {
+ if (action == null)
+ throw new NullPointerException();
+ return new Callable<Object>() {
+ public Object call() throws Exception { return action.run(); }};
+ }
+
+ /**
+ * Returns a {@link Callable} object that will, when
+ * called, execute the given <tt>callable</tt> under the current
+ * access control context. This method should normally be
+ * invoked within an {@link AccessController#doPrivileged} action
+ * to create callables that will, if possible, execute under the
+ * selected permission settings holding within that action; or if
+ * not possible, throw an associated {@link
+ * AccessControlException}.
+ * @param callable the underlying task
+ * @return a callable object
+ * @throws NullPointerException if callable null
+ *
+ */
+ public static <T> Callable<T> privilegedCallable(Callable<T> callable) {
+ if (callable == null)
+ throw new NullPointerException();
+ return new PrivilegedCallable<T>(callable);
+ }
+
+ /**
+ * Returns a {@link Callable} object that will, when
+ * called, execute the given <tt>callable</tt> under the current
+ * access control context, with the current context class loader
+ * as the context class loader. This method should normally be
+ * invoked within an {@link AccessController#doPrivileged} action
+ * to create callables that will, if possible, execute under the
+ * selected permission settings holding within that action; or if
+ * not possible, throw an associated {@link
+ * AccessControlException}.
+ * @param callable the underlying task
+ *
+ * @return a callable object
+ * @throws NullPointerException if callable null
+ * @throws AccessControlException if the current access control
+ * context does not have permission to both set and get context
+ * class loader.
+ */
+ public static <T> Callable<T> privilegedCallableUsingCurrentClassLoader(Callable<T> callable) {
+ if (callable == null)
+ throw new NullPointerException();
+ return new PrivilegedCallableUsingCurrentClassLoader<T>(callable);
+ }
+
+ // Non-public classes supporting the public methods
+
+ /**
+ * A callable that runs given task and returns given result
+ */
+ static final class RunnableAdapter<T> implements Callable<T> {
+ final Runnable task;
+ final T result;
+ RunnableAdapter(Runnable task, T result) {
+ this.task = task;
+ this.result = result;
+ }
+ public T call() {
+ task.run();
+ return result;
+ }
+ }
+
+ /**
+ * A callable that runs under established access control settings
+ */
+ static final class PrivilegedCallable<T> implements Callable<T> {
+ private final AccessControlContext acc;
+ private final Callable<T> task;
+ private T result;
+ private Exception exception;
+ PrivilegedCallable(Callable<T> task) {
+ this.task = task;
+ this.acc = AccessController.getContext();
+ }
+
+ public T call() throws Exception {
+ AccessController.doPrivileged(new PrivilegedAction<T>() {
+ public T run() {
+ try {
+ result = task.call();
+ } catch (Exception ex) {
+ exception = ex;
+ }
+ return null;
+ }
+ }, acc);
+ if (exception != null)
+ throw exception;
+ else
+ return result;
+ }
+ }
+
+ /**
+ * A callable that runs under established access control settings and
+ * current ClassLoader
+ */
+ static final class PrivilegedCallableUsingCurrentClassLoader<T> implements Callable<T> {
+ private final ClassLoader ccl;
+ private final AccessControlContext acc;
+ private final Callable<T> task;
+ private T result;
+ private Exception exception;
+ PrivilegedCallableUsingCurrentClassLoader(Callable<T> task) {
+ this.task = task;
+ this.ccl = Thread.currentThread().getContextClassLoader();
+ this.acc = AccessController.getContext();
+ acc.checkPermission(new RuntimePermission("getContextClassLoader"));
+ acc.checkPermission(new RuntimePermission("setContextClassLoader"));
+ }
+
+ public T call() throws Exception {
+ AccessController.doPrivileged(new PrivilegedAction<T>() {
+ public T run() {
+ ClassLoader savedcl = null;
+ Thread t = Thread.currentThread();
+ try {
+ ClassLoader cl = t.getContextClassLoader();
+ if (ccl != cl) {
+ t.setContextClassLoader(ccl);
+ savedcl = cl;
+ }
+ result = task.call();
+ } catch (Exception ex) {
+ exception = ex;
+ } finally {
+ if (savedcl != null)
+ t.setContextClassLoader(savedcl);
+ }
+ return null;
+ }
+ }, acc);
+ if (exception != null)
+ throw exception;
+ else
+ return result;
+ }
+ }
+
+ /**
+ * The default thread factory
+ */
+ static class DefaultThreadFactory implements ThreadFactory {
+ static final AtomicInteger poolNumber = new AtomicInteger(1);
+ final ThreadGroup group;
+ final AtomicInteger threadNumber = new AtomicInteger(1);
+ final String namePrefix;
+
+ DefaultThreadFactory() {
+ SecurityManager s = System.getSecurityManager();
+ group = (s != null)? s.getThreadGroup() :
+ Thread.currentThread().getThreadGroup();
+ namePrefix = "pool-" +
+ poolNumber.getAndIncrement() +
+ "-thread-";
+ }
+
+ public Thread newThread(Runnable r) {
+ Thread t = new Thread(group, r,
+ namePrefix + threadNumber.getAndIncrement(),
+ 0);
+ if (t.isDaemon())
+ t.setDaemon(false);
+ if (t.getPriority() != Thread.NORM_PRIORITY)
+ t.setPriority(Thread.NORM_PRIORITY);
+ return t;
+ }
+ }
+
+ /**
+ * Thread factory capturing access control and class loader
+ */
+ static class PrivilegedThreadFactory extends DefaultThreadFactory {
+ private final ClassLoader ccl;
+ private final AccessControlContext acc;
+
+ PrivilegedThreadFactory() {
+ super();
+ this.ccl = Thread.currentThread().getContextClassLoader();
+ this.acc = AccessController.getContext();
+ acc.checkPermission(new RuntimePermission("setContextClassLoader"));
+ }
+
+ public Thread newThread(final Runnable r) {
+ return super.newThread(new Runnable() {
+ public void run() {
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ public Object run() {
+ Thread.currentThread().setContextClassLoader(ccl);
+ r.run();
+ return null;
+ }
+ }, acc);
+ }
+ });
+ }
+
+ }
+
+ /**
+ * A wrapper class that exposes only the ExecutorService methods
+ * of an ExecutorService implementation.
+ */
+ static class DelegatedExecutorService extends AbstractExecutorService {
+ private final ExecutorService e;
+ DelegatedExecutorService(ExecutorService executor) { e = executor; }
+ public void execute(Runnable command) { e.execute(command); }
+ public void shutdown() { e.shutdown(); }
+ public List<Runnable> shutdownNow() { return e.shutdownNow(); }
+ public boolean isShutdown() { return e.isShutdown(); }
+ public boolean isTerminated() { return e.isTerminated(); }
+ public boolean awaitTermination(long timeout, TimeUnit unit)
+ throws InterruptedException {
+ return e.awaitTermination(timeout, unit);
+ }
+ public Future<?> submit(Runnable task) {
+ return e.submit(task);
+ }
+ public <T> Future<T> submit(Callable<T> task) {
+ return e.submit(task);
+ }
+ public <T> Future<T> submit(Runnable task, T result) {
+ return e.submit(task, result);
+ }
+ public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
+ throws InterruptedException {
+ return e.invokeAll(tasks);
+ }
+ public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks,
+ long timeout, TimeUnit unit)
+ throws InterruptedException {
+ return e.invokeAll(tasks, timeout, unit);
+ }
+ public <T> T invokeAny(Collection<? extends Callable<T>> tasks)
+ throws InterruptedException, ExecutionException {
+ return e.invokeAny(tasks);
+ }
+ public <T> T invokeAny(Collection<? extends Callable<T>> tasks,
+ long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException {
+ return e.invokeAny(tasks, timeout, unit);
+ }
+ }
+
+ static class FinalizableDelegatedExecutorService
+ extends DelegatedExecutorService {
+ FinalizableDelegatedExecutorService(ExecutorService executor) {
+ super(executor);
+ }
+ protected void finalize() {
+ super.shutdown();
+ }
+ }
+
+ /**
+ * A wrapper class that exposes only the ScheduledExecutorService
+ * methods of a ScheduledExecutorService implementation.
+ */
+ static class DelegatedScheduledExecutorService
+ extends DelegatedExecutorService
+ implements ScheduledExecutorService {
+ private final ScheduledExecutorService e;
+ DelegatedScheduledExecutorService(ScheduledExecutorService executor) {
+ super(executor);
+ e = executor;
+ }
+ public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) {
+ return e.schedule(command, delay, unit);
+ }
+ public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) {
+ return e.schedule(callable, delay, unit);
+ }
+ public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) {
+ return e.scheduleAtFixedRate(command, initialDelay, period, unit);
+ }
+ public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) {
+ return e.scheduleWithFixedDelay(command, initialDelay, delay, unit);
+ }
+ }
+
+
+ /** Cannot instantiate. */
+ private Executors() {}
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/Future.java b/libjava/classpath/external/jsr166/java/util/concurrent/Future.java
new file mode 100644
index 00000000000..0459ee453f0
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/Future.java
@@ -0,0 +1,142 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * A <tt>Future</tt> represents the result of an asynchronous
+ * computation. Methods are provided to check if the computation is
+ * complete, to wait for its completion, and to retrieve the result of
+ * the computation. The result can only be retrieved using method
+ * <tt>get</tt> when the computation has completed, blocking if
+ * necessary until it is ready. Cancellation is performed by the
+ * <tt>cancel</tt> method. Additional methods are provided to
+ * determine if the task completed normally or was cancelled. Once a
+ * computation has completed, the computation cannot be cancelled.
+ * If you would like to use a <tt>Future</tt> for the sake
+ * of cancellability but not provide a usable result, you can
+ * declare types of the form <tt>Future&lt;?&gt;</tt> and
+ * return <tt>null</tt> as a result of the underlying task.
+ *
+ * <p>
+ * <b>Sample Usage</b> (Note that the following classes are all
+ * made-up.) <p>
+ * <pre>
+ * interface ArchiveSearcher { String search(String target); }
+ * class App {
+ * ExecutorService executor = ...
+ * ArchiveSearcher searcher = ...
+ * void showSearch(final String target)
+ * throws InterruptedException {
+ * Future&lt;String&gt; future
+ * = executor.submit(new Callable&lt;String&gt;() {
+ * public String call() {
+ * return searcher.search(target);
+ * }});
+ * displayOtherThings(); // do other things while searching
+ * try {
+ * displayText(future.get()); // use future
+ * } catch (ExecutionException ex) { cleanup(); return; }
+ * }
+ * }
+ * </pre>
+ *
+ * The {@link FutureTask} class is an implementation of <tt>Future</tt> that
+ * implements <tt>Runnable</tt>, and so may be executed by an <tt>Executor</tt>.
+ * For example, the above construction with <tt>submit</tt> could be replaced by:
+ * <pre>
+ * FutureTask&lt;String&gt; future =
+ * new FutureTask&lt;String&gt;(new Callable&lt;String&gt;() {
+ * public String call() {
+ * return searcher.search(target);
+ * }});
+ * executor.execute(future);
+ * </pre>
+ *
+ * <p>Memory consistency effects: Actions taken by the asynchronous computation
+ * <a href="package-summary.html#MemoryVisibility"> <i>happen-before</i></a>
+ * actions following the corresponding {@code Future.get()} in another thread.
+ *
+ * @see FutureTask
+ * @see Executor
+ * @since 1.5
+ * @author Doug Lea
+ * @param <V> The result type returned by this Future's <tt>get</tt> method
+ */
+public interface Future<V> {
+
+ /**
+ * Attempts to cancel execution of this task. This attempt will
+ * fail if the task has already completed, has already been cancelled,
+ * or could not be cancelled for some other reason. If successful,
+ * and this task has not started when <tt>cancel</tt> is called,
+ * this task should never run. If the task has already started,
+ * then the <tt>mayInterruptIfRunning</tt> parameter determines
+ * whether the thread executing this task should be interrupted in
+ * an attempt to stop the task.
+ *
+ * <p>After this method returns, subsequent calls to {@link #isDone} will
+ * always return <tt>true</tt>. Subsequent calls to {@link #isCancelled}
+ * will always return <tt>true</tt> if this method returned <tt>true</tt>.
+ *
+ * @param mayInterruptIfRunning <tt>true</tt> if the thread executing this
+ * task should be interrupted; otherwise, in-progress tasks are allowed
+ * to complete
+ * @return <tt>false</tt> if the task could not be cancelled,
+ * typically because it has already completed normally;
+ * <tt>true</tt> otherwise
+ */
+ boolean cancel(boolean mayInterruptIfRunning);
+
+ /**
+ * Returns <tt>true</tt> if this task was cancelled before it completed
+ * normally.
+ *
+ * @return <tt>true</tt> if this task was cancelled before it completed
+ */
+ boolean isCancelled();
+
+ /**
+ * Returns <tt>true</tt> if this task completed.
+ *
+ * Completion may be due to normal termination, an exception, or
+ * cancellation -- in all of these cases, this method will return
+ * <tt>true</tt>.
+ *
+ * @return <tt>true</tt> if this task completed
+ */
+ boolean isDone();
+
+ /**
+ * Waits if necessary for the computation to complete, and then
+ * retrieves its result.
+ *
+ * @return the computed result
+ * @throws CancellationException if the computation was cancelled
+ * @throws ExecutionException if the computation threw an
+ * exception
+ * @throws InterruptedException if the current thread was interrupted
+ * while waiting
+ */
+ V get() throws InterruptedException, ExecutionException;
+
+ /**
+ * Waits if necessary for at most the given time for the computation
+ * to complete, and then retrieves its result, if available.
+ *
+ * @param timeout the maximum time to wait
+ * @param unit the time unit of the timeout argument
+ * @return the computed result
+ * @throws CancellationException if the computation was cancelled
+ * @throws ExecutionException if the computation threw an
+ * exception
+ * @throws InterruptedException if the current thread was interrupted
+ * while waiting
+ * @throws TimeoutException if the wait timed out
+ */
+ V get(long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException;
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/FutureTask.java b/libjava/classpath/external/jsr166/java/util/concurrent/FutureTask.java
new file mode 100644
index 00000000000..bbe49d7aed0
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/FutureTask.java
@@ -0,0 +1,325 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.concurrent.locks.*;
+
+/**
+ * A cancellable asynchronous computation. This class provides a base
+ * implementation of {@link Future}, with methods to start and cancel
+ * a computation, query to see if the computation is complete, and
+ * retrieve the result of the computation. The result can only be
+ * retrieved when the computation has completed; the <tt>get</tt>
+ * method will block if the computation has not yet completed. Once
+ * the computation has completed, the computation cannot be restarted
+ * or cancelled.
+ *
+ * <p>A <tt>FutureTask</tt> can be used to wrap a {@link Callable} or
+ * {@link java.lang.Runnable} object. Because <tt>FutureTask</tt>
+ * implements <tt>Runnable</tt>, a <tt>FutureTask</tt> can be
+ * submitted to an {@link Executor} for execution.
+ *
+ * <p>In addition to serving as a standalone class, this class provides
+ * <tt>protected</tt> functionality that may be useful when creating
+ * customized task classes.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <V> The result type returned by this FutureTask's <tt>get</tt> method
+ */
+public class FutureTask<V> implements RunnableFuture<V> {
+ /** Synchronization control for FutureTask */
+ private final Sync sync;
+
+ /**
+ * Creates a <tt>FutureTask</tt> that will upon running, execute the
+ * given <tt>Callable</tt>.
+ *
+ * @param callable the callable task
+ * @throws NullPointerException if callable is null
+ */
+ public FutureTask(Callable<V> callable) {
+ if (callable == null)
+ throw new NullPointerException();
+ sync = new Sync(callable);
+ }
+
+ /**
+ * Creates a <tt>FutureTask</tt> that will upon running, execute the
+ * given <tt>Runnable</tt>, and arrange that <tt>get</tt> will return the
+ * given result on successful completion.
+ *
+ * @param runnable the runnable task
+ * @param result the result to return on successful completion. If
+ * you don't need a particular result, consider using
+ * constructions of the form:
+ * <tt>Future&lt;?&gt; f = new FutureTask&lt;Object&gt;(runnable, null)</tt>
+ * @throws NullPointerException if runnable is null
+ */
+ public FutureTask(Runnable runnable, V result) {
+ sync = new Sync(Executors.callable(runnable, result));
+ }
+
+ public boolean isCancelled() {
+ return sync.innerIsCancelled();
+ }
+
+ public boolean isDone() {
+ return sync.innerIsDone();
+ }
+
+ public boolean cancel(boolean mayInterruptIfRunning) {
+ return sync.innerCancel(mayInterruptIfRunning);
+ }
+
+ /**
+ * @throws CancellationException {@inheritDoc}
+ */
+ public V get() throws InterruptedException, ExecutionException {
+ return sync.innerGet();
+ }
+
+ /**
+ * @throws CancellationException {@inheritDoc}
+ */
+ public V get(long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException {
+ return sync.innerGet(unit.toNanos(timeout));
+ }
+
+ /**
+ * Protected method invoked when this task transitions to state
+ * <tt>isDone</tt> (whether normally or via cancellation). The
+ * default implementation does nothing. Subclasses may override
+ * this method to invoke completion callbacks or perform
+ * bookkeeping. Note that you can query status inside the
+ * implementation of this method to determine whether this task
+ * has been cancelled.
+ */
+ protected void done() { }
+
+ /**
+ * Sets the result of this Future to the given value unless
+ * this future has already been set or has been cancelled.
+ * This method is invoked internally by the <tt>run</tt> method
+ * upon successful completion of the computation.
+ * @param v the value
+ */
+ protected void set(V v) {
+ sync.innerSet(v);
+ }
+
+ /**
+ * Causes this future to report an <tt>ExecutionException</tt>
+ * with the given throwable as its cause, unless this Future has
+ * already been set or has been cancelled.
+ * This method is invoked internally by the <tt>run</tt> method
+ * upon failure of the computation.
+ * @param t the cause of failure
+ */
+ protected void setException(Throwable t) {
+ sync.innerSetException(t);
+ }
+
+ // The following (duplicated) doc comment can be removed once
+ //
+ // 6270645: Javadoc comments should be inherited from most derived
+ // superinterface or superclass
+ // is fixed.
+ /**
+ * Sets this Future to the result of its computation
+ * unless it has been cancelled.
+ */
+ public void run() {
+ sync.innerRun();
+ }
+
+ /**
+ * Executes the computation without setting its result, and then
+ * resets this Future to initial state, failing to do so if the
+ * computation encounters an exception or is cancelled. This is
+ * designed for use with tasks that intrinsically execute more
+ * than once.
+ * @return true if successfully run and reset
+ */
+ protected boolean runAndReset() {
+ return sync.innerRunAndReset();
+ }
+
+ /**
+ * Synchronization control for FutureTask. Note that this must be
+ * a non-static inner class in order to invoke the protected
+ * <tt>done</tt> method. For clarity, all inner class support
+ * methods are same as outer, prefixed with "inner".
+ *
+ * Uses AQS sync state to represent run status
+ */
+ private final class Sync extends AbstractQueuedSynchronizer {
+ private static final long serialVersionUID = -7828117401763700385L;
+
+ /** State value representing that task is running */
+ private static final int RUNNING = 1;
+ /** State value representing that task ran */
+ private static final int RAN = 2;
+ /** State value representing that task was cancelled */
+ private static final int CANCELLED = 4;
+
+ /** The underlying callable */
+ private final Callable<V> callable;
+ /** The result to return from get() */
+ private V result;
+ /** The exception to throw from get() */
+ private Throwable exception;
+
+ /**
+ * The thread running task. When nulled after set/cancel, this
+ * indicates that the results are accessible. Must be
+ * volatile, to ensure visibility upon completion.
+ */
+ private volatile Thread runner;
+
+ Sync(Callable<V> callable) {
+ this.callable = callable;
+ }
+
+ private boolean ranOrCancelled(int state) {
+ return (state & (RAN | CANCELLED)) != 0;
+ }
+
+ /**
+ * Implements AQS base acquire to succeed if ran or cancelled
+ */
+ protected int tryAcquireShared(int ignore) {
+ return innerIsDone()? 1 : -1;
+ }
+
+ /**
+ * Implements AQS base release to always signal after setting
+ * final done status by nulling runner thread.
+ */
+ protected boolean tryReleaseShared(int ignore) {
+ runner = null;
+ return true;
+ }
+
+ boolean innerIsCancelled() {
+ return getState() == CANCELLED;
+ }
+
+ boolean innerIsDone() {
+ return ranOrCancelled(getState()) && runner == null;
+ }
+
+ V innerGet() throws InterruptedException, ExecutionException {
+ acquireSharedInterruptibly(0);
+ if (getState() == CANCELLED)
+ throw new CancellationException();
+ if (exception != null)
+ throw new ExecutionException(exception);
+ return result;
+ }
+
+ V innerGet(long nanosTimeout) throws InterruptedException, ExecutionException, TimeoutException {
+ if (!tryAcquireSharedNanos(0, nanosTimeout))
+ throw new TimeoutException();
+ if (getState() == CANCELLED)
+ throw new CancellationException();
+ if (exception != null)
+ throw new ExecutionException(exception);
+ return result;
+ }
+
+ void innerSet(V v) {
+ for (;;) {
+ int s = getState();
+ if (s == RAN)
+ return;
+ if (s == CANCELLED) {
+ // aggressively release to set runner to null,
+ // in case we are racing with a cancel request
+ // that will try to interrupt runner
+ releaseShared(0);
+ return;
+ }
+ if (compareAndSetState(s, RAN)) {
+ result = v;
+ releaseShared(0);
+ done();
+ return;
+ }
+ }
+ }
+
+ void innerSetException(Throwable t) {
+ for (;;) {
+ int s = getState();
+ if (s == RAN)
+ return;
+ if (s == CANCELLED) {
+ // aggressively release to set runner to null,
+ // in case we are racing with a cancel request
+ // that will try to interrupt runner
+ releaseShared(0);
+ return;
+ }
+ if (compareAndSetState(s, RAN)) {
+ exception = t;
+ result = null;
+ releaseShared(0);
+ done();
+ return;
+ }
+ }
+ }
+
+ boolean innerCancel(boolean mayInterruptIfRunning) {
+ for (;;) {
+ int s = getState();
+ if (ranOrCancelled(s))
+ return false;
+ if (compareAndSetState(s, CANCELLED))
+ break;
+ }
+ if (mayInterruptIfRunning) {
+ Thread r = runner;
+ if (r != null)
+ r.interrupt();
+ }
+ releaseShared(0);
+ done();
+ return true;
+ }
+
+ void innerRun() {
+ if (!compareAndSetState(0, RUNNING))
+ return;
+ try {
+ runner = Thread.currentThread();
+ if (getState() == RUNNING) // recheck after setting thread
+ innerSet(callable.call());
+ else
+ releaseShared(0); // cancel
+ } catch (Throwable ex) {
+ innerSetException(ex);
+ }
+ }
+
+ boolean innerRunAndReset() {
+ if (!compareAndSetState(0, RUNNING))
+ return false;
+ try {
+ runner = Thread.currentThread();
+ if (getState() == RUNNING)
+ callable.call(); // don't set result
+ runner = null;
+ return compareAndSetState(RUNNING, 0);
+ } catch (Throwable ex) {
+ innerSetException(ex);
+ return false;
+ }
+ }
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/LinkedBlockingDeque.java b/libjava/classpath/external/jsr166/java/util/concurrent/LinkedBlockingDeque.java
new file mode 100644
index 00000000000..91acccfbe8c
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/LinkedBlockingDeque.java
@@ -0,0 +1,1021 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.*;
+import java.util.concurrent.locks.*;
+
+/**
+ * An optionally-bounded {@linkplain BlockingDeque blocking deque} based on
+ * linked nodes.
+ *
+ * <p> The optional capacity bound constructor argument serves as a
+ * way to prevent excessive expansion. The capacity, if unspecified,
+ * is equal to {@link Integer#MAX_VALUE}. Linked nodes are
+ * dynamically created upon each insertion unless this would bring the
+ * deque above capacity.
+ *
+ * <p>Most operations run in constant time (ignoring time spent
+ * blocking). Exceptions include {@link #remove(Object) remove},
+ * {@link #removeFirstOccurrence removeFirstOccurrence}, {@link
+ * #removeLastOccurrence removeLastOccurrence}, {@link #contains
+ * contains}, {@link #iterator iterator.remove()}, and the bulk
+ * operations, all of which run in linear time.
+ *
+ * <p>This class and its iterator implement all of the
+ * <em>optional</em> methods of the {@link Collection} and {@link
+ * Iterator} interfaces.
+ *
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @since 1.6
+ * @author Doug Lea
+ * @param <E> the type of elements held in this collection
+ */
+public class LinkedBlockingDeque<E>
+ extends AbstractQueue<E>
+ implements BlockingDeque<E>, java.io.Serializable {
+
+ /*
+ * Implemented as a simple doubly-linked list protected by a
+ * single lock and using conditions to manage blocking.
+ */
+
+ /*
+ * We have "diamond" multiple interface/abstract class inheritance
+ * here, and that introduces ambiguities. Often we want the
+ * BlockingDeque javadoc combined with the AbstractQueue
+ * implementation, so a lot of method specs are duplicated here.
+ */
+
+ private static final long serialVersionUID = -387911632671998426L;
+
+ /** Doubly-linked list node class */
+ static final class Node<E> {
+ E item;
+ Node<E> prev;
+ Node<E> next;
+ Node(E x, Node<E> p, Node<E> n) {
+ item = x;
+ prev = p;
+ next = n;
+ }
+ }
+
+ /** Pointer to first node */
+ private transient Node<E> first;
+ /** Pointer to last node */
+ private transient Node<E> last;
+ /** Number of items in the deque */
+ private transient int count;
+ /** Maximum number of items in the deque */
+ private final int capacity;
+ /** Main lock guarding all access */
+ private final ReentrantLock lock = new ReentrantLock();
+ /** Condition for waiting takes */
+ private final Condition notEmpty = lock.newCondition();
+ /** Condition for waiting puts */
+ private final Condition notFull = lock.newCondition();
+
+ /**
+ * Creates a <tt>LinkedBlockingDeque</tt> with a capacity of
+ * {@link Integer#MAX_VALUE}.
+ */
+ public LinkedBlockingDeque() {
+ this(Integer.MAX_VALUE);
+ }
+
+ /**
+ * Creates a <tt>LinkedBlockingDeque</tt> with the given (fixed) capacity.
+ *
+ * @param capacity the capacity of this deque
+ * @throws IllegalArgumentException if <tt>capacity</tt> is less than 1
+ */
+ public LinkedBlockingDeque(int capacity) {
+ if (capacity <= 0) throw new IllegalArgumentException();
+ this.capacity = capacity;
+ }
+
+ /**
+ * Creates a <tt>LinkedBlockingDeque</tt> with a capacity of
+ * {@link Integer#MAX_VALUE}, initially containing the elements of
+ * the given collection, added in traversal order of the
+ * collection's iterator.
+ *
+ * @param c the collection of elements to initially contain
+ * @throws NullPointerException if the specified collection or any
+ * of its elements are null
+ */
+ public LinkedBlockingDeque(Collection<? extends E> c) {
+ this(Integer.MAX_VALUE);
+ for (E e : c)
+ add(e);
+ }
+
+
+ // Basic linking and unlinking operations, called only while holding lock
+
+ /**
+ * Links e as first element, or returns false if full.
+ */
+ private boolean linkFirst(E e) {
+ if (count >= capacity)
+ return false;
+ ++count;
+ Node<E> f = first;
+ Node<E> x = new Node<E>(e, null, f);
+ first = x;
+ if (last == null)
+ last = x;
+ else
+ f.prev = x;
+ notEmpty.signal();
+ return true;
+ }
+
+ /**
+ * Links e as last element, or returns false if full.
+ */
+ private boolean linkLast(E e) {
+ if (count >= capacity)
+ return false;
+ ++count;
+ Node<E> l = last;
+ Node<E> x = new Node<E>(e, l, null);
+ last = x;
+ if (first == null)
+ first = x;
+ else
+ l.next = x;
+ notEmpty.signal();
+ return true;
+ }
+
+ /**
+ * Removes and returns first element, or null if empty.
+ */
+ private E unlinkFirst() {
+ Node<E> f = first;
+ if (f == null)
+ return null;
+ Node<E> n = f.next;
+ first = n;
+ if (n == null)
+ last = null;
+ else
+ n.prev = null;
+ --count;
+ notFull.signal();
+ return f.item;
+ }
+
+ /**
+ * Removes and returns last element, or null if empty.
+ */
+ private E unlinkLast() {
+ Node<E> l = last;
+ if (l == null)
+ return null;
+ Node<E> p = l.prev;
+ last = p;
+ if (p == null)
+ first = null;
+ else
+ p.next = null;
+ --count;
+ notFull.signal();
+ return l.item;
+ }
+
+ /**
+ * Unlink e
+ */
+ private void unlink(Node<E> x) {
+ Node<E> p = x.prev;
+ Node<E> n = x.next;
+ if (p == null) {
+ if (n == null)
+ first = last = null;
+ else {
+ n.prev = null;
+ first = n;
+ }
+ } else if (n == null) {
+ p.next = null;
+ last = p;
+ } else {
+ p.next = n;
+ n.prev = p;
+ }
+ --count;
+ notFull.signalAll();
+ }
+
+ // BlockingDeque methods
+
+ /**
+ * @throws IllegalStateException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public void addFirst(E e) {
+ if (!offerFirst(e))
+ throw new IllegalStateException("Deque full");
+ }
+
+ /**
+ * @throws IllegalStateException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public void addLast(E e) {
+ if (!offerLast(e))
+ throw new IllegalStateException("Deque full");
+ }
+
+ /**
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public boolean offerFirst(E e) {
+ if (e == null) throw new NullPointerException();
+ lock.lock();
+ try {
+ return linkFirst(e);
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public boolean offerLast(E e) {
+ if (e == null) throw new NullPointerException();
+ lock.lock();
+ try {
+ return linkLast(e);
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws NullPointerException {@inheritDoc}
+ * @throws InterruptedException {@inheritDoc}
+ */
+ public void putFirst(E e) throws InterruptedException {
+ if (e == null) throw new NullPointerException();
+ lock.lock();
+ try {
+ while (!linkFirst(e))
+ notFull.await();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws NullPointerException {@inheritDoc}
+ * @throws InterruptedException {@inheritDoc}
+ */
+ public void putLast(E e) throws InterruptedException {
+ if (e == null) throw new NullPointerException();
+ lock.lock();
+ try {
+ while (!linkLast(e))
+ notFull.await();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws NullPointerException {@inheritDoc}
+ * @throws InterruptedException {@inheritDoc}
+ */
+ public boolean offerFirst(E e, long timeout, TimeUnit unit)
+ throws InterruptedException {
+ if (e == null) throw new NullPointerException();
+ long nanos = unit.toNanos(timeout);
+ lock.lockInterruptibly();
+ try {
+ for (;;) {
+ if (linkFirst(e))
+ return true;
+ if (nanos <= 0)
+ return false;
+ nanos = notFull.awaitNanos(nanos);
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws NullPointerException {@inheritDoc}
+ * @throws InterruptedException {@inheritDoc}
+ */
+ public boolean offerLast(E e, long timeout, TimeUnit unit)
+ throws InterruptedException {
+ if (e == null) throw new NullPointerException();
+ long nanos = unit.toNanos(timeout);
+ lock.lockInterruptibly();
+ try {
+ for (;;) {
+ if (linkLast(e))
+ return true;
+ if (nanos <= 0)
+ return false;
+ nanos = notFull.awaitNanos(nanos);
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public E removeFirst() {
+ E x = pollFirst();
+ if (x == null) throw new NoSuchElementException();
+ return x;
+ }
+
+ /**
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public E removeLast() {
+ E x = pollLast();
+ if (x == null) throw new NoSuchElementException();
+ return x;
+ }
+
+ public E pollFirst() {
+ lock.lock();
+ try {
+ return unlinkFirst();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public E pollLast() {
+ lock.lock();
+ try {
+ return unlinkLast();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public E takeFirst() throws InterruptedException {
+ lock.lock();
+ try {
+ E x;
+ while ( (x = unlinkFirst()) == null)
+ notEmpty.await();
+ return x;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public E takeLast() throws InterruptedException {
+ lock.lock();
+ try {
+ E x;
+ while ( (x = unlinkLast()) == null)
+ notEmpty.await();
+ return x;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public E pollFirst(long timeout, TimeUnit unit)
+ throws InterruptedException {
+ long nanos = unit.toNanos(timeout);
+ lock.lockInterruptibly();
+ try {
+ for (;;) {
+ E x = unlinkFirst();
+ if (x != null)
+ return x;
+ if (nanos <= 0)
+ return null;
+ nanos = notEmpty.awaitNanos(nanos);
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public E pollLast(long timeout, TimeUnit unit)
+ throws InterruptedException {
+ long nanos = unit.toNanos(timeout);
+ lock.lockInterruptibly();
+ try {
+ for (;;) {
+ E x = unlinkLast();
+ if (x != null)
+ return x;
+ if (nanos <= 0)
+ return null;
+ nanos = notEmpty.awaitNanos(nanos);
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public E getFirst() {
+ E x = peekFirst();
+ if (x == null) throw new NoSuchElementException();
+ return x;
+ }
+
+ /**
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public E getLast() {
+ E x = peekLast();
+ if (x == null) throw new NoSuchElementException();
+ return x;
+ }
+
+ public E peekFirst() {
+ lock.lock();
+ try {
+ return (first == null) ? null : first.item;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public E peekLast() {
+ lock.lock();
+ try {
+ return (last == null) ? null : last.item;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public boolean removeFirstOccurrence(Object o) {
+ if (o == null) return false;
+ lock.lock();
+ try {
+ for (Node<E> p = first; p != null; p = p.next) {
+ if (o.equals(p.item)) {
+ unlink(p);
+ return true;
+ }
+ }
+ return false;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public boolean removeLastOccurrence(Object o) {
+ if (o == null) return false;
+ lock.lock();
+ try {
+ for (Node<E> p = last; p != null; p = p.prev) {
+ if (o.equals(p.item)) {
+ unlink(p);
+ return true;
+ }
+ }
+ return false;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ // BlockingQueue methods
+
+ /**
+ * Inserts the specified element at the end of this deque unless it would
+ * violate capacity restrictions. When using a capacity-restricted deque,
+ * it is generally preferable to use method {@link #offer(Object) offer}.
+ *
+ * <p>This method is equivalent to {@link #addLast}.
+ *
+ * @throws IllegalStateException if the element cannot be added at this
+ * time due to capacity restrictions
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean add(E e) {
+ addLast(e);
+ return true;
+ }
+
+ /**
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean offer(E e) {
+ return offerLast(e);
+ }
+
+ /**
+ * @throws NullPointerException {@inheritDoc}
+ * @throws InterruptedException {@inheritDoc}
+ */
+ public void put(E e) throws InterruptedException {
+ putLast(e);
+ }
+
+ /**
+ * @throws NullPointerException {@inheritDoc}
+ * @throws InterruptedException {@inheritDoc}
+ */
+ public boolean offer(E e, long timeout, TimeUnit unit)
+ throws InterruptedException {
+ return offerLast(e, timeout, unit);
+ }
+
+ /**
+ * Retrieves and removes the head of the queue represented by this deque.
+ * This method differs from {@link #poll poll} only in that it throws an
+ * exception if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #removeFirst() removeFirst}.
+ *
+ * @return the head of the queue represented by this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ public E remove() {
+ return removeFirst();
+ }
+
+ public E poll() {
+ return pollFirst();
+ }
+
+ public E take() throws InterruptedException {
+ return takeFirst();
+ }
+
+ public E poll(long timeout, TimeUnit unit) throws InterruptedException {
+ return pollFirst(timeout, unit);
+ }
+
+ /**
+ * Retrieves, but does not remove, the head of the queue represented by
+ * this deque. This method differs from {@link #peek peek} only in that
+ * it throws an exception if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #getFirst() getFirst}.
+ *
+ * @return the head of the queue represented by this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ public E element() {
+ return getFirst();
+ }
+
+ public E peek() {
+ return peekFirst();
+ }
+
+ /**
+ * Returns the number of additional elements that this deque can ideally
+ * (in the absence of memory or resource constraints) accept without
+ * blocking. This is always equal to the initial capacity of this deque
+ * less the current <tt>size</tt> of this deque.
+ *
+ * <p>Note that you <em>cannot</em> always tell if an attempt to insert
+ * an element will succeed by inspecting <tt>remainingCapacity</tt>
+ * because it may be the case that another thread is about to
+ * insert or remove an element.
+ */
+ public int remainingCapacity() {
+ lock.lock();
+ try {
+ return capacity - count;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws UnsupportedOperationException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public int drainTo(Collection<? super E> c) {
+ if (c == null)
+ throw new NullPointerException();
+ if (c == this)
+ throw new IllegalArgumentException();
+ lock.lock();
+ try {
+ for (Node<E> p = first; p != null; p = p.next)
+ c.add(p.item);
+ int n = count;
+ count = 0;
+ first = last = null;
+ notFull.signalAll();
+ return n;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws UnsupportedOperationException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public int drainTo(Collection<? super E> c, int maxElements) {
+ if (c == null)
+ throw new NullPointerException();
+ if (c == this)
+ throw new IllegalArgumentException();
+ lock.lock();
+ try {
+ int n = 0;
+ while (n < maxElements && first != null) {
+ c.add(first.item);
+ first.prev = null;
+ first = first.next;
+ --count;
+ ++n;
+ }
+ if (first == null)
+ last = null;
+ notFull.signalAll();
+ return n;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ // Stack methods
+
+ /**
+ * @throws IllegalStateException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public void push(E e) {
+ addFirst(e);
+ }
+
+ /**
+ * @throws NoSuchElementException {@inheritDoc}
+ */
+ public E pop() {
+ return removeFirst();
+ }
+
+ // Collection methods
+
+ /**
+ * Removes the first occurrence of the specified element from this deque.
+ * If the deque does not contain the element, it is unchanged.
+ * More formally, removes the first element <tt>e</tt> such that
+ * <tt>o.equals(e)</tt> (if such an element exists).
+ * Returns <tt>true</tt> if this deque contained the specified element
+ * (or equivalently, if this deque changed as a result of the call).
+ *
+ * <p>This method is equivalent to
+ * {@link #removeFirstOccurrence(Object) removeFirstOccurrence}.
+ *
+ * @param o element to be removed from this deque, if present
+ * @return <tt>true</tt> if this deque changed as a result of the call
+ */
+ public boolean remove(Object o) {
+ return removeFirstOccurrence(o);
+ }
+
+ /**
+ * Returns the number of elements in this deque.
+ *
+ * @return the number of elements in this deque
+ */
+ public int size() {
+ lock.lock();
+ try {
+ return count;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns <tt>true</tt> if this deque contains the specified element.
+ * More formally, returns <tt>true</tt> if and only if this deque contains
+ * at least one element <tt>e</tt> such that <tt>o.equals(e)</tt>.
+ *
+ * @param o object to be checked for containment in this deque
+ * @return <tt>true</tt> if this deque contains the specified element
+ */
+ public boolean contains(Object o) {
+ if (o == null) return false;
+ lock.lock();
+ try {
+ for (Node<E> p = first; p != null; p = p.next)
+ if (o.equals(p.item))
+ return true;
+ return false;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Variant of removeFirstOccurrence needed by iterator.remove.
+ * Searches for the node, not its contents.
+ */
+ boolean removeNode(Node<E> e) {
+ lock.lock();
+ try {
+ for (Node<E> p = first; p != null; p = p.next) {
+ if (p == e) {
+ unlink(p);
+ return true;
+ }
+ }
+ return false;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns an array containing all of the elements in this deque, in
+ * proper sequence (from first to last element).
+ *
+ * <p>The returned array will be "safe" in that no references to it are
+ * maintained by this deque. (In other words, this method must allocate
+ * a new array). The caller is thus free to modify the returned array.
+ *
+ * <p>This method acts as bridge between array-based and collection-based
+ * APIs.
+ *
+ * @return an array containing all of the elements in this deque
+ */
+ public Object[] toArray() {
+ lock.lock();
+ try {
+ Object[] a = new Object[count];
+ int k = 0;
+ for (Node<E> p = first; p != null; p = p.next)
+ a[k++] = p.item;
+ return a;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns an array containing all of the elements in this deque, in
+ * proper sequence; the runtime type of the returned array is that of
+ * the specified array. If the deque fits in the specified array, it
+ * is returned therein. Otherwise, a new array is allocated with the
+ * runtime type of the specified array and the size of this deque.
+ *
+ * <p>If this deque fits in the specified array with room to spare
+ * (i.e., the array has more elements than this deque), the element in
+ * the array immediately following the end of the deque is set to
+ * <tt>null</tt>.
+ *
+ * <p>Like the {@link #toArray()} method, this method acts as bridge between
+ * array-based and collection-based APIs. Further, this method allows
+ * precise control over the runtime type of the output array, and may,
+ * under certain circumstances, be used to save allocation costs.
+ *
+ * <p>Suppose <tt>x</tt> is a deque known to contain only strings.
+ * The following code can be used to dump the deque into a newly
+ * allocated array of <tt>String</tt>:
+ *
+ * <pre>
+ * String[] y = x.toArray(new String[0]);</pre>
+ *
+ * Note that <tt>toArray(new Object[0])</tt> is identical in function to
+ * <tt>toArray()</tt>.
+ *
+ * @param a the array into which the elements of the deque are to
+ * be stored, if it is big enough; otherwise, a new array of the
+ * same runtime type is allocated for this purpose
+ * @return an array containing all of the elements in this deque
+ * @throws ArrayStoreException if the runtime type of the specified array
+ * is not a supertype of the runtime type of every element in
+ * this deque
+ * @throws NullPointerException if the specified array is null
+ */
+ public <T> T[] toArray(T[] a) {
+ lock.lock();
+ try {
+ if (a.length < count)
+ a = (T[])java.lang.reflect.Array.newInstance(
+ a.getClass().getComponentType(),
+ count
+ );
+
+ int k = 0;
+ for (Node<E> p = first; p != null; p = p.next)
+ a[k++] = (T)p.item;
+ if (a.length > k)
+ a[k] = null;
+ return a;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public String toString() {
+ lock.lock();
+ try {
+ return super.toString();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Atomically removes all of the elements from this deque.
+ * The deque will be empty after this call returns.
+ */
+ public void clear() {
+ lock.lock();
+ try {
+ first = last = null;
+ count = 0;
+ notFull.signalAll();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns an iterator over the elements in this deque in proper sequence.
+ * The elements will be returned in order from first (head) to last (tail).
+ * The returned <tt>Iterator</tt> is a "weakly consistent" iterator that
+ * will never throw {@link ConcurrentModificationException},
+ * and guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed to)
+ * reflect any modifications subsequent to construction.
+ *
+ * @return an iterator over the elements in this deque in proper sequence
+ */
+ public Iterator<E> iterator() {
+ return new Itr();
+ }
+
+ /**
+ * Returns an iterator over the elements in this deque in reverse
+ * sequential order. The elements will be returned in order from
+ * last (tail) to first (head).
+ * The returned <tt>Iterator</tt> is a "weakly consistent" iterator that
+ * will never throw {@link ConcurrentModificationException},
+ * and guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed to)
+ * reflect any modifications subsequent to construction.
+ */
+ public Iterator<E> descendingIterator() {
+ return new DescendingItr();
+ }
+
+ /**
+ * Base class for Iterators for LinkedBlockingDeque
+ */
+ private abstract class AbstractItr implements Iterator<E> {
+ /**
+ * The next node to return in next
+ */
+ Node<E> next;
+
+ /**
+ * nextItem holds on to item fields because once we claim that
+ * an element exists in hasNext(), we must return item read
+ * under lock (in advance()) even if it was in the process of
+ * being removed when hasNext() was called.
+ */
+ E nextItem;
+
+ /**
+ * Node returned by most recent call to next. Needed by remove.
+ * Reset to null if this element is deleted by a call to remove.
+ */
+ private Node<E> lastRet;
+
+ AbstractItr() {
+ advance(); // set to initial position
+ }
+
+ /**
+ * Advances next, or if not yet initialized, sets to first node.
+ * Implemented to move forward vs backward in the two subclasses.
+ */
+ abstract void advance();
+
+ public boolean hasNext() {
+ return next != null;
+ }
+
+ public E next() {
+ if (next == null)
+ throw new NoSuchElementException();
+ lastRet = next;
+ E x = nextItem;
+ advance();
+ return x;
+ }
+
+ public void remove() {
+ Node<E> n = lastRet;
+ if (n == null)
+ throw new IllegalStateException();
+ lastRet = null;
+ // Note: removeNode rescans looking for this node to make
+ // sure it was not already removed. Otherwise, trying to
+ // re-remove could corrupt list.
+ removeNode(n);
+ }
+ }
+
+ /** Forward iterator */
+ private class Itr extends AbstractItr {
+ void advance() {
+ final ReentrantLock lock = LinkedBlockingDeque.this.lock;
+ lock.lock();
+ try {
+ next = (next == null)? first : next.next;
+ nextItem = (next == null)? null : next.item;
+ } finally {
+ lock.unlock();
+ }
+ }
+ }
+
+ /**
+ * Descending iterator for LinkedBlockingDeque
+ */
+ private class DescendingItr extends AbstractItr {
+ void advance() {
+ final ReentrantLock lock = LinkedBlockingDeque.this.lock;
+ lock.lock();
+ try {
+ next = (next == null)? last : next.prev;
+ nextItem = (next == null)? null : next.item;
+ } finally {
+ lock.unlock();
+ }
+ }
+ }
+
+ /**
+ * Save the state of this deque to a stream (that is, serialize it).
+ *
+ * @serialData The capacity (int), followed by elements (each an
+ * <tt>Object</tt>) in the proper order, followed by a null
+ * @param s the stream
+ */
+ private void writeObject(java.io.ObjectOutputStream s)
+ throws java.io.IOException {
+ lock.lock();
+ try {
+ // Write out capacity and any hidden stuff
+ s.defaultWriteObject();
+ // Write out all elements in the proper order.
+ for (Node<E> p = first; p != null; p = p.next)
+ s.writeObject(p.item);
+ // Use trailing null as sentinel
+ s.writeObject(null);
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Reconstitute this deque from a stream (that is,
+ * deserialize it).
+ * @param s the stream
+ */
+ private void readObject(java.io.ObjectInputStream s)
+ throws java.io.IOException, ClassNotFoundException {
+ s.defaultReadObject();
+ count = 0;
+ first = null;
+ last = null;
+ // Read in all elements and place in queue
+ for (;;) {
+ E item = (E)s.readObject();
+ if (item == null)
+ break;
+ add(item);
+ }
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/LinkedBlockingQueue.java b/libjava/classpath/external/jsr166/java/util/concurrent/LinkedBlockingQueue.java
new file mode 100644
index 00000000000..3dedee56da0
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/LinkedBlockingQueue.java
@@ -0,0 +1,807 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.concurrent.atomic.*;
+import java.util.concurrent.locks.*;
+import java.util.*;
+
+/**
+ * An optionally-bounded {@linkplain BlockingQueue blocking queue} based on
+ * linked nodes.
+ * This queue orders elements FIFO (first-in-first-out).
+ * The <em>head</em> of the queue is that element that has been on the
+ * queue the longest time.
+ * The <em>tail</em> of the queue is that element that has been on the
+ * queue the shortest time. New elements
+ * are inserted at the tail of the queue, and the queue retrieval
+ * operations obtain elements at the head of the queue.
+ * Linked queues typically have higher throughput than array-based queues but
+ * less predictable performance in most concurrent applications.
+ *
+ * <p> The optional capacity bound constructor argument serves as a
+ * way to prevent excessive queue expansion. The capacity, if unspecified,
+ * is equal to {@link Integer#MAX_VALUE}. Linked nodes are
+ * dynamically created upon each insertion unless this would bring the
+ * queue above capacity.
+ *
+ * <p>This class and its iterator implement all of the
+ * <em>optional</em> methods of the {@link Collection} and {@link
+ * Iterator} interfaces.
+ *
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <E> the type of elements held in this collection
+ *
+ */
+public class LinkedBlockingQueue<E> extends AbstractQueue<E>
+ implements BlockingQueue<E>, java.io.Serializable {
+ private static final long serialVersionUID = -6903933977591709194L;
+
+ /*
+ * A variant of the "two lock queue" algorithm. The putLock gates
+ * entry to put (and offer), and has an associated condition for
+ * waiting puts. Similarly for the takeLock. The "count" field
+ * that they both rely on is maintained as an atomic to avoid
+ * needing to get both locks in most cases. Also, to minimize need
+ * for puts to get takeLock and vice-versa, cascading notifies are
+ * used. When a put notices that it has enabled at least one take,
+ * it signals taker. That taker in turn signals others if more
+ * items have been entered since the signal. And symmetrically for
+ * takes signalling puts. Operations such as remove(Object) and
+ * iterators acquire both locks.
+ */
+
+ /**
+ * Linked list node class
+ */
+ static class Node<E> {
+ /** The item, volatile to ensure barrier separating write and read */
+ volatile E item;
+ Node<E> next;
+ Node(E x) { item = x; }
+ }
+
+ /** The capacity bound, or Integer.MAX_VALUE if none */
+ private final int capacity;
+
+ /** Current number of elements */
+ private final AtomicInteger count = new AtomicInteger(0);
+
+ /** Head of linked list */
+ private transient Node<E> head;
+
+ /** Tail of linked list */
+ private transient Node<E> last;
+
+ /** Lock held by take, poll, etc */
+ private final ReentrantLock takeLock = new ReentrantLock();
+
+ /** Wait queue for waiting takes */
+ private final Condition notEmpty = takeLock.newCondition();
+
+ /** Lock held by put, offer, etc */
+ private final ReentrantLock putLock = new ReentrantLock();
+
+ /** Wait queue for waiting puts */
+ private final Condition notFull = putLock.newCondition();
+
+ /**
+ * Signals a waiting take. Called only from put/offer (which do not
+ * otherwise ordinarily lock takeLock.)
+ */
+ private void signalNotEmpty() {
+ final ReentrantLock takeLock = this.takeLock;
+ takeLock.lock();
+ try {
+ notEmpty.signal();
+ } finally {
+ takeLock.unlock();
+ }
+ }
+
+ /**
+ * Signals a waiting put. Called only from take/poll.
+ */
+ private void signalNotFull() {
+ final ReentrantLock putLock = this.putLock;
+ putLock.lock();
+ try {
+ notFull.signal();
+ } finally {
+ putLock.unlock();
+ }
+ }
+
+ /**
+ * Creates a node and links it at end of queue.
+ * @param x the item
+ */
+ private void insert(E x) {
+ last = last.next = new Node<E>(x);
+ }
+
+ /**
+ * Removes a node from head of queue,
+ * @return the node
+ */
+ private E extract() {
+ Node<E> first = head.next;
+ head = first;
+ E x = first.item;
+ first.item = null;
+ return x;
+ }
+
+ /**
+ * Lock to prevent both puts and takes.
+ */
+ private void fullyLock() {
+ putLock.lock();
+ takeLock.lock();
+ }
+
+ /**
+ * Unlock to allow both puts and takes.
+ */
+ private void fullyUnlock() {
+ takeLock.unlock();
+ putLock.unlock();
+ }
+
+
+ /**
+ * Creates a <tt>LinkedBlockingQueue</tt> with a capacity of
+ * {@link Integer#MAX_VALUE}.
+ */
+ public LinkedBlockingQueue() {
+ this(Integer.MAX_VALUE);
+ }
+
+ /**
+ * Creates a <tt>LinkedBlockingQueue</tt> with the given (fixed) capacity.
+ *
+ * @param capacity the capacity of this queue
+ * @throws IllegalArgumentException if <tt>capacity</tt> is not greater
+ * than zero
+ */
+ public LinkedBlockingQueue(int capacity) {
+ if (capacity <= 0) throw new IllegalArgumentException();
+ this.capacity = capacity;
+ last = head = new Node<E>(null);
+ }
+
+ /**
+ * Creates a <tt>LinkedBlockingQueue</tt> with a capacity of
+ * {@link Integer#MAX_VALUE}, initially containing the elements of the
+ * given collection,
+ * added in traversal order of the collection's iterator.
+ *
+ * @param c the collection of elements to initially contain
+ * @throws NullPointerException if the specified collection or any
+ * of its elements are null
+ */
+ public LinkedBlockingQueue(Collection<? extends E> c) {
+ this(Integer.MAX_VALUE);
+ for (E e : c)
+ add(e);
+ }
+
+
+ // this doc comment is overridden to remove the reference to collections
+ // greater in size than Integer.MAX_VALUE
+ /**
+ * Returns the number of elements in this queue.
+ *
+ * @return the number of elements in this queue
+ */
+ public int size() {
+ return count.get();
+ }
+
+ // this doc comment is a modified copy of the inherited doc comment,
+ // without the reference to unlimited queues.
+ /**
+ * Returns the number of additional elements that this queue can ideally
+ * (in the absence of memory or resource constraints) accept without
+ * blocking. This is always equal to the initial capacity of this queue
+ * less the current <tt>size</tt> of this queue.
+ *
+ * <p>Note that you <em>cannot</em> always tell if an attempt to insert
+ * an element will succeed by inspecting <tt>remainingCapacity</tt>
+ * because it may be the case that another thread is about to
+ * insert or remove an element.
+ */
+ public int remainingCapacity() {
+ return capacity - count.get();
+ }
+
+ /**
+ * Inserts the specified element at the tail of this queue, waiting if
+ * necessary for space to become available.
+ *
+ * @throws InterruptedException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public void put(E e) throws InterruptedException {
+ if (e == null) throw new NullPointerException();
+ // Note: convention in all put/take/etc is to preset
+ // local var holding count negative to indicate failure unless set.
+ int c = -1;
+ final ReentrantLock putLock = this.putLock;
+ final AtomicInteger count = this.count;
+ putLock.lockInterruptibly();
+ try {
+ /*
+ * Note that count is used in wait guard even though it is
+ * not protected by lock. This works because count can
+ * only decrease at this point (all other puts are shut
+ * out by lock), and we (or some other waiting put) are
+ * signalled if it ever changes from
+ * capacity. Similarly for all other uses of count in
+ * other wait guards.
+ */
+ try {
+ while (count.get() == capacity)
+ notFull.await();
+ } catch (InterruptedException ie) {
+ notFull.signal(); // propagate to a non-interrupted thread
+ throw ie;
+ }
+ insert(e);
+ c = count.getAndIncrement();
+ if (c + 1 < capacity)
+ notFull.signal();
+ } finally {
+ putLock.unlock();
+ }
+ if (c == 0)
+ signalNotEmpty();
+ }
+
+ /**
+ * Inserts the specified element at the tail of this queue, waiting if
+ * necessary up to the specified wait time for space to become available.
+ *
+ * @return <tt>true</tt> if successful, or <tt>false</tt> if
+ * the specified waiting time elapses before space is available.
+ * @throws InterruptedException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public boolean offer(E e, long timeout, TimeUnit unit)
+ throws InterruptedException {
+
+ if (e == null) throw new NullPointerException();
+ long nanos = unit.toNanos(timeout);
+ int c = -1;
+ final ReentrantLock putLock = this.putLock;
+ final AtomicInteger count = this.count;
+ putLock.lockInterruptibly();
+ try {
+ for (;;) {
+ if (count.get() < capacity) {
+ insert(e);
+ c = count.getAndIncrement();
+ if (c + 1 < capacity)
+ notFull.signal();
+ break;
+ }
+ if (nanos <= 0)
+ return false;
+ try {
+ nanos = notFull.awaitNanos(nanos);
+ } catch (InterruptedException ie) {
+ notFull.signal(); // propagate to a non-interrupted thread
+ throw ie;
+ }
+ }
+ } finally {
+ putLock.unlock();
+ }
+ if (c == 0)
+ signalNotEmpty();
+ return true;
+ }
+
+ /**
+ * Inserts the specified element at the tail of this queue if it is
+ * possible to do so immediately without exceeding the queue's capacity,
+ * returning <tt>true</tt> upon success and <tt>false</tt> if this queue
+ * is full.
+ * When using a capacity-restricted queue, this method is generally
+ * preferable to method {@link BlockingQueue#add add}, which can fail to
+ * insert an element only by throwing an exception.
+ *
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean offer(E e) {
+ if (e == null) throw new NullPointerException();
+ final AtomicInteger count = this.count;
+ if (count.get() == capacity)
+ return false;
+ int c = -1;
+ final ReentrantLock putLock = this.putLock;
+ putLock.lock();
+ try {
+ if (count.get() < capacity) {
+ insert(e);
+ c = count.getAndIncrement();
+ if (c + 1 < capacity)
+ notFull.signal();
+ }
+ } finally {
+ putLock.unlock();
+ }
+ if (c == 0)
+ signalNotEmpty();
+ return c >= 0;
+ }
+
+
+ public E take() throws InterruptedException {
+ E x;
+ int c = -1;
+ final AtomicInteger count = this.count;
+ final ReentrantLock takeLock = this.takeLock;
+ takeLock.lockInterruptibly();
+ try {
+ try {
+ while (count.get() == 0)
+ notEmpty.await();
+ } catch (InterruptedException ie) {
+ notEmpty.signal(); // propagate to a non-interrupted thread
+ throw ie;
+ }
+
+ x = extract();
+ c = count.getAndDecrement();
+ if (c > 1)
+ notEmpty.signal();
+ } finally {
+ takeLock.unlock();
+ }
+ if (c == capacity)
+ signalNotFull();
+ return x;
+ }
+
+ public E poll(long timeout, TimeUnit unit) throws InterruptedException {
+ E x = null;
+ int c = -1;
+ long nanos = unit.toNanos(timeout);
+ final AtomicInteger count = this.count;
+ final ReentrantLock takeLock = this.takeLock;
+ takeLock.lockInterruptibly();
+ try {
+ for (;;) {
+ if (count.get() > 0) {
+ x = extract();
+ c = count.getAndDecrement();
+ if (c > 1)
+ notEmpty.signal();
+ break;
+ }
+ if (nanos <= 0)
+ return null;
+ try {
+ nanos = notEmpty.awaitNanos(nanos);
+ } catch (InterruptedException ie) {
+ notEmpty.signal(); // propagate to a non-interrupted thread
+ throw ie;
+ }
+ }
+ } finally {
+ takeLock.unlock();
+ }
+ if (c == capacity)
+ signalNotFull();
+ return x;
+ }
+
+ public E poll() {
+ final AtomicInteger count = this.count;
+ if (count.get() == 0)
+ return null;
+ E x = null;
+ int c = -1;
+ final ReentrantLock takeLock = this.takeLock;
+ takeLock.lock();
+ try {
+ if (count.get() > 0) {
+ x = extract();
+ c = count.getAndDecrement();
+ if (c > 1)
+ notEmpty.signal();
+ }
+ } finally {
+ takeLock.unlock();
+ }
+ if (c == capacity)
+ signalNotFull();
+ return x;
+ }
+
+
+ public E peek() {
+ if (count.get() == 0)
+ return null;
+ final ReentrantLock takeLock = this.takeLock;
+ takeLock.lock();
+ try {
+ Node<E> first = head.next;
+ if (first == null)
+ return null;
+ else
+ return first.item;
+ } finally {
+ takeLock.unlock();
+ }
+ }
+
+ /**
+ * Removes a single instance of the specified element from this queue,
+ * if it is present. More formally, removes an element <tt>e</tt> such
+ * that <tt>o.equals(e)</tt>, if this queue contains one or more such
+ * elements.
+ * Returns <tt>true</tt> if this queue contained the specified element
+ * (or equivalently, if this queue changed as a result of the call).
+ *
+ * @param o element to be removed from this queue, if present
+ * @return <tt>true</tt> if this queue changed as a result of the call
+ */
+ public boolean remove(Object o) {
+ if (o == null) return false;
+ boolean removed = false;
+ fullyLock();
+ try {
+ Node<E> trail = head;
+ Node<E> p = head.next;
+ while (p != null) {
+ if (o.equals(p.item)) {
+ removed = true;
+ break;
+ }
+ trail = p;
+ p = p.next;
+ }
+ if (removed) {
+ p.item = null;
+ trail.next = p.next;
+ if (last == p)
+ last = trail;
+ if (count.getAndDecrement() == capacity)
+ notFull.signalAll();
+ }
+ } finally {
+ fullyUnlock();
+ }
+ return removed;
+ }
+
+ /**
+ * Returns an array containing all of the elements in this queue, in
+ * proper sequence.
+ *
+ * <p>The returned array will be "safe" in that no references to it are
+ * maintained by this queue. (In other words, this method must allocate
+ * a new array). The caller is thus free to modify the returned array.
+ *
+ * <p>This method acts as bridge between array-based and collection-based
+ * APIs.
+ *
+ * @return an array containing all of the elements in this queue
+ */
+ public Object[] toArray() {
+ fullyLock();
+ try {
+ int size = count.get();
+ Object[] a = new Object[size];
+ int k = 0;
+ for (Node<E> p = head.next; p != null; p = p.next)
+ a[k++] = p.item;
+ return a;
+ } finally {
+ fullyUnlock();
+ }
+ }
+
+ /**
+ * Returns an array containing all of the elements in this queue, in
+ * proper sequence; the runtime type of the returned array is that of
+ * the specified array. If the queue fits in the specified array, it
+ * is returned therein. Otherwise, a new array is allocated with the
+ * runtime type of the specified array and the size of this queue.
+ *
+ * <p>If this queue fits in the specified array with room to spare
+ * (i.e., the array has more elements than this queue), the element in
+ * the array immediately following the end of the queue is set to
+ * <tt>null</tt>.
+ *
+ * <p>Like the {@link #toArray()} method, this method acts as bridge between
+ * array-based and collection-based APIs. Further, this method allows
+ * precise control over the runtime type of the output array, and may,
+ * under certain circumstances, be used to save allocation costs.
+ *
+ * <p>Suppose <tt>x</tt> is a queue known to contain only strings.
+ * The following code can be used to dump the queue into a newly
+ * allocated array of <tt>String</tt>:
+ *
+ * <pre>
+ * String[] y = x.toArray(new String[0]);</pre>
+ *
+ * Note that <tt>toArray(new Object[0])</tt> is identical in function to
+ * <tt>toArray()</tt>.
+ *
+ * @param a the array into which the elements of the queue are to
+ * be stored, if it is big enough; otherwise, a new array of the
+ * same runtime type is allocated for this purpose
+ * @return an array containing all of the elements in this queue
+ * @throws ArrayStoreException if the runtime type of the specified array
+ * is not a supertype of the runtime type of every element in
+ * this queue
+ * @throws NullPointerException if the specified array is null
+ */
+ public <T> T[] toArray(T[] a) {
+ fullyLock();
+ try {
+ int size = count.get();
+ if (a.length < size)
+ a = (T[])java.lang.reflect.Array.newInstance
+ (a.getClass().getComponentType(), size);
+
+ int k = 0;
+ for (Node p = head.next; p != null; p = p.next)
+ a[k++] = (T)p.item;
+ if (a.length > k)
+ a[k] = null;
+ return a;
+ } finally {
+ fullyUnlock();
+ }
+ }
+
+ public String toString() {
+ fullyLock();
+ try {
+ return super.toString();
+ } finally {
+ fullyUnlock();
+ }
+ }
+
+ /**
+ * Atomically removes all of the elements from this queue.
+ * The queue will be empty after this call returns.
+ */
+ public void clear() {
+ fullyLock();
+ try {
+ head.next = null;
+ assert head.item == null;
+ last = head;
+ if (count.getAndSet(0) == capacity)
+ notFull.signalAll();
+ } finally {
+ fullyUnlock();
+ }
+ }
+
+ /**
+ * @throws UnsupportedOperationException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public int drainTo(Collection<? super E> c) {
+ if (c == null)
+ throw new NullPointerException();
+ if (c == this)
+ throw new IllegalArgumentException();
+ Node<E> first;
+ fullyLock();
+ try {
+ first = head.next;
+ head.next = null;
+ assert head.item == null;
+ last = head;
+ if (count.getAndSet(0) == capacity)
+ notFull.signalAll();
+ } finally {
+ fullyUnlock();
+ }
+ // Transfer the elements outside of locks
+ int n = 0;
+ for (Node<E> p = first; p != null; p = p.next) {
+ c.add(p.item);
+ p.item = null;
+ ++n;
+ }
+ return n;
+ }
+
+ /**
+ * @throws UnsupportedOperationException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public int drainTo(Collection<? super E> c, int maxElements) {
+ if (c == null)
+ throw new NullPointerException();
+ if (c == this)
+ throw new IllegalArgumentException();
+ fullyLock();
+ try {
+ int n = 0;
+ Node<E> p = head.next;
+ while (p != null && n < maxElements) {
+ c.add(p.item);
+ p.item = null;
+ p = p.next;
+ ++n;
+ }
+ if (n != 0) {
+ head.next = p;
+ assert head.item == null;
+ if (p == null)
+ last = head;
+ if (count.getAndAdd(-n) == capacity)
+ notFull.signalAll();
+ }
+ return n;
+ } finally {
+ fullyUnlock();
+ }
+ }
+
+ /**
+ * Returns an iterator over the elements in this queue in proper sequence.
+ * The returned <tt>Iterator</tt> is a "weakly consistent" iterator that
+ * will never throw {@link ConcurrentModificationException},
+ * and guarantees to traverse elements as they existed upon
+ * construction of the iterator, and may (but is not guaranteed to)
+ * reflect any modifications subsequent to construction.
+ *
+ * @return an iterator over the elements in this queue in proper sequence
+ */
+ public Iterator<E> iterator() {
+ return new Itr();
+ }
+
+ private class Itr implements Iterator<E> {
+ /*
+ * Basic weak-consistent iterator. At all times hold the next
+ * item to hand out so that if hasNext() reports true, we will
+ * still have it to return even if lost race with a take etc.
+ */
+ private Node<E> current;
+ private Node<E> lastRet;
+ private E currentElement;
+
+ Itr() {
+ final ReentrantLock putLock = LinkedBlockingQueue.this.putLock;
+ final ReentrantLock takeLock = LinkedBlockingQueue.this.takeLock;
+ putLock.lock();
+ takeLock.lock();
+ try {
+ current = head.next;
+ if (current != null)
+ currentElement = current.item;
+ } finally {
+ takeLock.unlock();
+ putLock.unlock();
+ }
+ }
+
+ public boolean hasNext() {
+ return current != null;
+ }
+
+ public E next() {
+ final ReentrantLock putLock = LinkedBlockingQueue.this.putLock;
+ final ReentrantLock takeLock = LinkedBlockingQueue.this.takeLock;
+ putLock.lock();
+ takeLock.lock();
+ try {
+ if (current == null)
+ throw new NoSuchElementException();
+ E x = currentElement;
+ lastRet = current;
+ current = current.next;
+ if (current != null)
+ currentElement = current.item;
+ return x;
+ } finally {
+ takeLock.unlock();
+ putLock.unlock();
+ }
+ }
+
+ public void remove() {
+ if (lastRet == null)
+ throw new IllegalStateException();
+ final ReentrantLock putLock = LinkedBlockingQueue.this.putLock;
+ final ReentrantLock takeLock = LinkedBlockingQueue.this.takeLock;
+ putLock.lock();
+ takeLock.lock();
+ try {
+ Node<E> node = lastRet;
+ lastRet = null;
+ Node<E> trail = head;
+ Node<E> p = head.next;
+ while (p != null && p != node) {
+ trail = p;
+ p = p.next;
+ }
+ if (p == node) {
+ p.item = null;
+ trail.next = p.next;
+ if (last == p)
+ last = trail;
+ int c = count.getAndDecrement();
+ if (c == capacity)
+ notFull.signalAll();
+ }
+ } finally {
+ takeLock.unlock();
+ putLock.unlock();
+ }
+ }
+ }
+
+ /**
+ * Save the state to a stream (that is, serialize it).
+ *
+ * @serialData The capacity is emitted (int), followed by all of
+ * its elements (each an <tt>Object</tt>) in the proper order,
+ * followed by a null
+ * @param s the stream
+ */
+ private void writeObject(java.io.ObjectOutputStream s)
+ throws java.io.IOException {
+
+ fullyLock();
+ try {
+ // Write out any hidden stuff, plus capacity
+ s.defaultWriteObject();
+
+ // Write out all elements in the proper order.
+ for (Node<E> p = head.next; p != null; p = p.next)
+ s.writeObject(p.item);
+
+ // Use trailing null as sentinel
+ s.writeObject(null);
+ } finally {
+ fullyUnlock();
+ }
+ }
+
+ /**
+ * Reconstitute this queue instance from a stream (that is,
+ * deserialize it).
+ * @param s the stream
+ */
+ private void readObject(java.io.ObjectInputStream s)
+ throws java.io.IOException, ClassNotFoundException {
+ // Read in capacity, and any hidden stuff
+ s.defaultReadObject();
+
+ count.set(0);
+ last = head = new Node<E>(null);
+
+ // Read in all elements and place in queue
+ for (;;) {
+ E item = (E)s.readObject();
+ if (item == null)
+ break;
+ add(item);
+ }
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/PriorityBlockingQueue.java b/libjava/classpath/external/jsr166/java/util/concurrent/PriorityBlockingQueue.java
new file mode 100644
index 00000000000..91ae61b631f
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/PriorityBlockingQueue.java
@@ -0,0 +1,563 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+import java.util.concurrent.locks.*;
+import java.util.*;
+
+/**
+ * An unbounded {@linkplain BlockingQueue blocking queue} that uses
+ * the same ordering rules as class {@link PriorityQueue} and supplies
+ * blocking retrieval operations. While this queue is logically
+ * unbounded, attempted additions may fail due to resource exhaustion
+ * (causing <tt>OutOfMemoryError</tt>). This class does not permit
+ * <tt>null</tt> elements. A priority queue relying on {@linkplain
+ * Comparable natural ordering} also does not permit insertion of
+ * non-comparable objects (doing so results in
+ * <tt>ClassCastException</tt>).
+ *
+ * <p>This class and its iterator implement all of the
+ * <em>optional</em> methods of the {@link Collection} and {@link
+ * Iterator} interfaces. The Iterator provided in method {@link
+ * #iterator()} is <em>not</em> guaranteed to traverse the elements of
+ * the PriorityBlockingQueue in any particular order. If you need
+ * ordered traversal, consider using
+ * <tt>Arrays.sort(pq.toArray())</tt>. Also, method <tt>drainTo</tt>
+ * can be used to <em>remove</em> some or all elements in priority
+ * order and place them in another collection.
+ *
+ * <p>Operations on this class make no guarantees about the ordering
+ * of elements with equal priority. If you need to enforce an
+ * ordering, you can define custom classes or comparators that use a
+ * secondary key to break ties in primary priority values. For
+ * example, here is a class that applies first-in-first-out
+ * tie-breaking to comparable elements. To use it, you would insert a
+ * <tt>new FIFOEntry(anEntry)</tt> instead of a plain entry object.
+ *
+ * <pre>
+ * class FIFOEntry&lt;E extends Comparable&lt;? super E&gt;&gt;
+ * implements Comparable&lt;FIFOEntry&lt;E&gt;&gt; {
+ * final static AtomicLong seq = new AtomicLong();
+ * final long seqNum;
+ * final E entry;
+ * public FIFOEntry(E entry) {
+ * seqNum = seq.getAndIncrement();
+ * this.entry = entry;
+ * }
+ * public E getEntry() { return entry; }
+ * public int compareTo(FIFOEntry&lt;E&gt; other) {
+ * int res = entry.compareTo(other.entry);
+ * if (res == 0 &amp;&amp; other.entry != this.entry)
+ * res = (seqNum &lt; other.seqNum ? -1 : 1);
+ * return res;
+ * }
+ * }</pre>
+ *
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <E> the type of elements held in this collection
+ */
+public class PriorityBlockingQueue<E> extends AbstractQueue<E>
+ implements BlockingQueue<E>, java.io.Serializable {
+ private static final long serialVersionUID = 5595510919245408276L;
+
+ private final PriorityQueue<E> q;
+ private final ReentrantLock lock = new ReentrantLock(true);
+ private final Condition notEmpty = lock.newCondition();
+
+ /**
+ * Creates a <tt>PriorityBlockingQueue</tt> with the default
+ * initial capacity (11) that orders its elements according to
+ * their {@linkplain Comparable natural ordering}.
+ */
+ public PriorityBlockingQueue() {
+ q = new PriorityQueue<E>();
+ }
+
+ /**
+ * Creates a <tt>PriorityBlockingQueue</tt> with the specified
+ * initial capacity that orders its elements according to their
+ * {@linkplain Comparable natural ordering}.
+ *
+ * @param initialCapacity the initial capacity for this priority queue
+ * @throws IllegalArgumentException if <tt>initialCapacity</tt> is less
+ * than 1
+ */
+ public PriorityBlockingQueue(int initialCapacity) {
+ q = new PriorityQueue<E>(initialCapacity, null);
+ }
+
+ /**
+ * Creates a <tt>PriorityBlockingQueue</tt> with the specified initial
+ * capacity that orders its elements according to the specified
+ * comparator.
+ *
+ * @param initialCapacity the initial capacity for this priority queue
+ * @param comparator the comparator that will be used to order this
+ * priority queue. If {@code null}, the {@linkplain Comparable
+ * natural ordering} of the elements will be used.
+ * @throws IllegalArgumentException if <tt>initialCapacity</tt> is less
+ * than 1
+ */
+ public PriorityBlockingQueue(int initialCapacity,
+ Comparator<? super E> comparator) {
+ q = new PriorityQueue<E>(initialCapacity, comparator);
+ }
+
+ /**
+ * Creates a <tt>PriorityBlockingQueue</tt> containing the elements
+ * in the specified collection. If the specified collection is a
+ * {@link SortedSet} or a {@link PriorityQueue}, this
+ * priority queue will be ordered according to the same ordering.
+ * Otherwise, this priority queue will be ordered according to the
+ * {@linkplain Comparable natural ordering} of its elements.
+ *
+ * @param c the collection whose elements are to be placed
+ * into this priority queue
+ * @throws ClassCastException if elements of the specified collection
+ * cannot be compared to one another according to the priority
+ * queue's ordering
+ * @throws NullPointerException if the specified collection or any
+ * of its elements are null
+ */
+ public PriorityBlockingQueue(Collection<? extends E> c) {
+ q = new PriorityQueue<E>(c);
+ }
+
+ /**
+ * Inserts the specified element into this priority queue.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> (as specified by {@link Collection#add})
+ * @throws ClassCastException if the specified element cannot be compared
+ * with elements currently in the priority queue according to the
+ * priority queue's ordering
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean add(E e) {
+ return offer(e);
+ }
+
+ /**
+ * Inserts the specified element into this priority queue.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> (as specified by {@link Queue#offer})
+ * @throws ClassCastException if the specified element cannot be compared
+ * with elements currently in the priority queue according to the
+ * priority queue's ordering
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean offer(E e) {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ boolean ok = q.offer(e);
+ assert ok;
+ notEmpty.signal();
+ return true;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Inserts the specified element into this priority queue. As the queue is
+ * unbounded this method will never block.
+ *
+ * @param e the element to add
+ * @throws ClassCastException if the specified element cannot be compared
+ * with elements currently in the priority queue according to the
+ * priority queue's ordering
+ * @throws NullPointerException if the specified element is null
+ */
+ public void put(E e) {
+ offer(e); // never need to block
+ }
+
+ /**
+ * Inserts the specified element into this priority queue. As the queue is
+ * unbounded this method will never block.
+ *
+ * @param e the element to add
+ * @param timeout This parameter is ignored as the method never blocks
+ * @param unit This parameter is ignored as the method never blocks
+ * @return <tt>true</tt>
+ * @throws ClassCastException if the specified element cannot be compared
+ * with elements currently in the priority queue according to the
+ * priority queue's ordering
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean offer(E e, long timeout, TimeUnit unit) {
+ return offer(e); // never need to block
+ }
+
+ public E poll() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return q.poll();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public E take() throws InterruptedException {
+ final ReentrantLock lock = this.lock;
+ lock.lockInterruptibly();
+ try {
+ try {
+ while (q.size() == 0)
+ notEmpty.await();
+ } catch (InterruptedException ie) {
+ notEmpty.signal(); // propagate to non-interrupted thread
+ throw ie;
+ }
+ E x = q.poll();
+ assert x != null;
+ return x;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public E poll(long timeout, TimeUnit unit) throws InterruptedException {
+ long nanos = unit.toNanos(timeout);
+ final ReentrantLock lock = this.lock;
+ lock.lockInterruptibly();
+ try {
+ for (;;) {
+ E x = q.poll();
+ if (x != null)
+ return x;
+ if (nanos <= 0)
+ return null;
+ try {
+ nanos = notEmpty.awaitNanos(nanos);
+ } catch (InterruptedException ie) {
+ notEmpty.signal(); // propagate to non-interrupted thread
+ throw ie;
+ }
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public E peek() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return q.peek();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns the comparator used to order the elements in this queue,
+ * or <tt>null</tt> if this queue uses the {@linkplain Comparable
+ * natural ordering} of its elements.
+ *
+ * @return the comparator used to order the elements in this queue,
+ * or <tt>null</tt> if this queue uses the natural
+ * ordering of its elements
+ */
+ public Comparator<? super E> comparator() {
+ return q.comparator();
+ }
+
+ public int size() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return q.size();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Always returns <tt>Integer.MAX_VALUE</tt> because
+ * a <tt>PriorityBlockingQueue</tt> is not capacity constrained.
+ * @return <tt>Integer.MAX_VALUE</tt>
+ */
+ public int remainingCapacity() {
+ return Integer.MAX_VALUE;
+ }
+
+ /**
+ * Removes a single instance of the specified element from this queue,
+ * if it is present. More formally, removes an element {@code e} such
+ * that {@code o.equals(e)}, if this queue contains one or more such
+ * elements. Returns {@code true} if and only if this queue contained
+ * the specified element (or equivalently, if this queue changed as a
+ * result of the call).
+ *
+ * @param o element to be removed from this queue, if present
+ * @return <tt>true</tt> if this queue changed as a result of the call
+ */
+ public boolean remove(Object o) {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return q.remove(o);
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns {@code true} if this queue contains the specified element.
+ * More formally, returns {@code true} if and only if this queue contains
+ * at least one element {@code e} such that {@code o.equals(e)}.
+ *
+ * @param o object to be checked for containment in this queue
+ * @return <tt>true</tt> if this queue contains the specified element
+ */
+ public boolean contains(Object o) {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return q.contains(o);
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns an array containing all of the elements in this queue.
+ * The returned array elements are in no particular order.
+ *
+ * <p>The returned array will be "safe" in that no references to it are
+ * maintained by this queue. (In other words, this method must allocate
+ * a new array). The caller is thus free to modify the returned array.
+ *
+ * <p>This method acts as bridge between array-based and collection-based
+ * APIs.
+ *
+ * @return an array containing all of the elements in this queue
+ */
+ public Object[] toArray() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return q.toArray();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+
+ public String toString() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return q.toString();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws UnsupportedOperationException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public int drainTo(Collection<? super E> c) {
+ if (c == null)
+ throw new NullPointerException();
+ if (c == this)
+ throw new IllegalArgumentException();
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ int n = 0;
+ E e;
+ while ( (e = q.poll()) != null) {
+ c.add(e);
+ ++n;
+ }
+ return n;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * @throws UnsupportedOperationException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public int drainTo(Collection<? super E> c, int maxElements) {
+ if (c == null)
+ throw new NullPointerException();
+ if (c == this)
+ throw new IllegalArgumentException();
+ if (maxElements <= 0)
+ return 0;
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ int n = 0;
+ E e;
+ while (n < maxElements && (e = q.poll()) != null) {
+ c.add(e);
+ ++n;
+ }
+ return n;
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Atomically removes all of the elements from this queue.
+ * The queue will be empty after this call returns.
+ */
+ public void clear() {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ q.clear();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns an array containing all of the elements in this queue; the
+ * runtime type of the returned array is that of the specified array.
+ * The returned array elements are in no particular order.
+ * If the queue fits in the specified array, it is returned therein.
+ * Otherwise, a new array is allocated with the runtime type of the
+ * specified array and the size of this queue.
+ *
+ * <p>If this queue fits in the specified array with room to spare
+ * (i.e., the array has more elements than this queue), the element in
+ * the array immediately following the end of the queue is set to
+ * <tt>null</tt>.
+ *
+ * <p>Like the {@link #toArray()} method, this method acts as bridge between
+ * array-based and collection-based APIs. Further, this method allows
+ * precise control over the runtime type of the output array, and may,
+ * under certain circumstances, be used to save allocation costs.
+ *
+ * <p>Suppose <tt>x</tt> is a queue known to contain only strings.
+ * The following code can be used to dump the queue into a newly
+ * allocated array of <tt>String</tt>:
+ *
+ * <pre>
+ * String[] y = x.toArray(new String[0]);</pre>
+ *
+ * Note that <tt>toArray(new Object[0])</tt> is identical in function to
+ * <tt>toArray()</tt>.
+ *
+ * @param a the array into which the elements of the queue are to
+ * be stored, if it is big enough; otherwise, a new array of the
+ * same runtime type is allocated for this purpose
+ * @return an array containing all of the elements in this queue
+ * @throws ArrayStoreException if the runtime type of the specified array
+ * is not a supertype of the runtime type of every element in
+ * this queue
+ * @throws NullPointerException if the specified array is null
+ */
+ public <T> T[] toArray(T[] a) {
+ final ReentrantLock lock = this.lock;
+ lock.lock();
+ try {
+ return q.toArray(a);
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Returns an iterator over the elements in this queue. The
+ * iterator does not return the elements in any particular order.
+ * The returned <tt>Iterator</tt> is a "weakly consistent"
+ * iterator that will never throw {@link
+ * ConcurrentModificationException}, and guarantees to traverse
+ * elements as they existed upon construction of the iterator, and
+ * may (but is not guaranteed to) reflect any modifications
+ * subsequent to construction.
+ *
+ * @return an iterator over the elements in this queue
+ */
+ public Iterator<E> iterator() {
+ return new Itr(toArray());
+ }
+
+ /**
+ * Snapshot iterator that works off copy of underlying q array.
+ */
+ private class Itr implements Iterator<E> {
+ final Object[] array; // Array of all elements
+ int cursor; // index of next element to return;
+ int lastRet; // index of last element, or -1 if no such
+
+ Itr(Object[] array) {
+ lastRet = -1;
+ this.array = array;
+ }
+
+ public boolean hasNext() {
+ return cursor < array.length;
+ }
+
+ public E next() {
+ if (cursor >= array.length)
+ throw new NoSuchElementException();
+ lastRet = cursor;
+ return (E)array[cursor++];
+ }
+
+ public void remove() {
+ if (lastRet < 0)
+ throw new IllegalStateException();
+ Object x = array[lastRet];
+ lastRet = -1;
+ // Traverse underlying queue to find == element,
+ // not just a .equals element.
+ lock.lock();
+ try {
+ for (Iterator it = q.iterator(); it.hasNext(); ) {
+ if (it.next() == x) {
+ it.remove();
+ return;
+ }
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+ }
+
+ /**
+ * Saves the state to a stream (that is, serializes it). This
+ * merely wraps default serialization within lock. The
+ * serialization strategy for items is left to underlying
+ * Queue. Note that locking is not needed on deserialization, so
+ * readObject is not defined, just relying on default.
+ */
+ private void writeObject(java.io.ObjectOutputStream s)
+ throws java.io.IOException {
+ lock.lock();
+ try {
+ s.defaultWriteObject();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/RejectedExecutionException.java b/libjava/classpath/external/jsr166/java/util/concurrent/RejectedExecutionException.java
new file mode 100644
index 00000000000..30b043d6627
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/RejectedExecutionException.java
@@ -0,0 +1,62 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * Exception thrown by an {@link Executor} when a task cannot be
+ * accepted for execution.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public class RejectedExecutionException extends RuntimeException {
+ private static final long serialVersionUID = -375805702767069545L;
+
+ /**
+ * Constructs a <tt>RejectedExecutionException</tt> with no detail message.
+ * The cause is not initialized, and may subsequently be
+ * initialized by a call to {@link #initCause(Throwable) initCause}.
+ */
+ public RejectedExecutionException() { }
+
+ /**
+ * Constructs a <tt>RejectedExecutionException</tt> with the
+ * specified detail message. The cause is not initialized, and may
+ * subsequently be initialized by a call to {@link
+ * #initCause(Throwable) initCause}.
+ *
+ * @param message the detail message
+ */
+ public RejectedExecutionException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a <tt>RejectedExecutionException</tt> with the
+ * specified detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method)
+ */
+ public RejectedExecutionException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a <tt>RejectedExecutionException</tt> with the
+ * specified cause. The detail message is set to: <pre> (cause ==
+ * null ? null : cause.toString())</pre> (which typically contains
+ * the class and detail message of <tt>cause</tt>).
+ *
+ * @param cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method)
+ */
+ public RejectedExecutionException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/RejectedExecutionHandler.java b/libjava/classpath/external/jsr166/java/util/concurrent/RejectedExecutionHandler.java
new file mode 100644
index 00000000000..4b4bbeab1bb
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/RejectedExecutionHandler.java
@@ -0,0 +1,33 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * A handler for tasks that cannot be executed by a {@link
+ * ThreadPoolExecutor}.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public interface RejectedExecutionHandler {
+
+ /**
+ * Method that may be invoked by a {@link ThreadPoolExecutor} when
+ * <tt>execute</tt> cannot accept a task. This may occur when no
+ * more threads or queue slots are available because their bounds
+ * would be exceeded, or upon shutdown of the Executor.
+ *
+ * In the absence other alternatives, the method may throw an
+ * unchecked {@link RejectedExecutionException}, which will be
+ * propagated to the caller of <tt>execute</tt>.
+ *
+ * @param r the runnable task requested to be executed
+ * @param executor the executor attempting to execute this task
+ * @throws RejectedExecutionException if there is no remedy
+ */
+ void rejectedExecution(Runnable r, ThreadPoolExecutor executor);
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/RunnableFuture.java b/libjava/classpath/external/jsr166/java/util/concurrent/RunnableFuture.java
new file mode 100644
index 00000000000..d74211d130b
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/RunnableFuture.java
@@ -0,0 +1,25 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * A {@link Future} that is {@link Runnable}. Successful execution of
+ * the <tt>run</tt> method causes completion of the <tt>Future</tt>
+ * and allows access to its results.
+ * @see FutureTask
+ * @see Executor
+ * @since 1.6
+ * @author Doug Lea
+ * @param <V> The result type returned by this Future's <tt>get</tt> method
+ */
+public interface RunnableFuture<V> extends Runnable, Future<V> {
+ /**
+ * Sets this Future to the result of its computation
+ * unless it has been cancelled.
+ */
+ void run();
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/RunnableScheduledFuture.java b/libjava/classpath/external/jsr166/java/util/concurrent/RunnableScheduledFuture.java
new file mode 100644
index 00000000000..0e8cc328c1e
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/RunnableScheduledFuture.java
@@ -0,0 +1,29 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * A {@link ScheduledFuture} that is {@link Runnable}. Successful
+ * execution of the <tt>run</tt> method causes completion of the
+ * <tt>Future</tt> and allows access to its results.
+ * @see FutureTask
+ * @see Executor
+ * @since 1.6
+ * @author Doug Lea
+ * @param <V> The result type returned by this Future's <tt>get</tt> method
+ */
+public interface RunnableScheduledFuture<V> extends RunnableFuture<V>, ScheduledFuture<V> {
+
+ /**
+ * Returns true if this is a periodic task. A periodic task may
+ * re-run according to some schedule. A non-periodic task can be
+ * run only once.
+ *
+ * @return true if this task is periodic
+ */
+ boolean isPeriodic();
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ScheduledExecutorService.java b/libjava/classpath/external/jsr166/java/util/concurrent/ScheduledExecutorService.java
new file mode 100644
index 00000000000..976537ef5d6
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ScheduledExecutorService.java
@@ -0,0 +1,159 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.concurrent.atomic.*;
+import java.util.*;
+
+/**
+ * An {@link ExecutorService} that can schedule commands to run after a given
+ * delay, or to execute periodically.
+ *
+ * <p> The <tt>schedule</tt> methods create tasks with various delays
+ * and return a task object that can be used to cancel or check
+ * execution. The <tt>scheduleAtFixedRate</tt> and
+ * <tt>scheduleWithFixedDelay</tt> methods create and execute tasks
+ * that run periodically until cancelled.
+ *
+ * <p> Commands submitted using the {@link Executor#execute} and
+ * {@link ExecutorService} <tt>submit</tt> methods are scheduled with
+ * a requested delay of zero. Zero and negative delays (but not
+ * periods) are also allowed in <tt>schedule</tt> methods, and are
+ * treated as requests for immediate execution.
+ *
+ * <p>All <tt>schedule</tt> methods accept <em>relative</em> delays and
+ * periods as arguments, not absolute times or dates. It is a simple
+ * matter to transform an absolute time represented as a {@link
+ * java.util.Date} to the required form. For example, to schedule at
+ * a certain future <tt>date</tt>, you can use: <tt>schedule(task,
+ * date.getTime() - System.currentTimeMillis(),
+ * TimeUnit.MILLISECONDS)</tt>. Beware however that expiration of a
+ * relative delay need not coincide with the current <tt>Date</tt> at
+ * which the task is enabled due to network time synchronization
+ * protocols, clock drift, or other factors.
+ *
+ * The {@link Executors} class provides convenient factory methods for
+ * the ScheduledExecutorService implementations provided in this package.
+ *
+ * <h3>Usage Example</h3>
+ *
+ * Here is a class with a method that sets up a ScheduledExecutorService
+ * to beep every ten seconds for an hour:
+ *
+ * <pre>
+ * import static java.util.concurrent.TimeUnit.*;
+ * class BeeperControl {
+ * private final ScheduledExecutorService scheduler =
+ * Executors.newScheduledThreadPool(1);
+ *
+ * public void beepForAnHour() {
+ * final Runnable beeper = new Runnable() {
+ * public void run() { System.out.println("beep"); }
+ * };
+ * final ScheduledFuture&lt;?&gt; beeperHandle =
+ * scheduler.scheduleAtFixedRate(beeper, 10, 10, SECONDS);
+ * scheduler.schedule(new Runnable() {
+ * public void run() { beeperHandle.cancel(true); }
+ * }, 60 * 60, SECONDS);
+ * }
+ * }
+ * </pre>
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public interface ScheduledExecutorService extends ExecutorService {
+
+ /**
+ * Creates and executes a one-shot action that becomes enabled
+ * after the given delay.
+ *
+ * @param command the task to execute
+ * @param delay the time from now to delay execution
+ * @param unit the time unit of the delay parameter
+ * @return a ScheduledFuture representing pending completion of
+ * the task and whose <tt>get()</tt> method will return
+ * <tt>null</tt> upon completion
+ * @throws RejectedExecutionException if the task cannot be
+ * scheduled for execution
+ * @throws NullPointerException if command is null
+ */
+ public ScheduledFuture<?> schedule(Runnable command,
+ long delay, TimeUnit unit);
+
+ /**
+ * Creates and executes a ScheduledFuture that becomes enabled after the
+ * given delay.
+ *
+ * @param callable the function to execute
+ * @param delay the time from now to delay execution
+ * @param unit the time unit of the delay parameter
+ * @return a ScheduledFuture that can be used to extract result or cancel
+ * @throws RejectedExecutionException if the task cannot be
+ * scheduled for execution
+ * @throws NullPointerException if callable is null
+ */
+ public <V> ScheduledFuture<V> schedule(Callable<V> callable,
+ long delay, TimeUnit unit);
+
+ /**
+ * Creates and executes a periodic action that becomes enabled first
+ * after the given initial delay, and subsequently with the given
+ * period; that is executions will commence after
+ * <tt>initialDelay</tt> then <tt>initialDelay+period</tt>, then
+ * <tt>initialDelay + 2 * period</tt>, and so on.
+ * If any execution of the task
+ * encounters an exception, subsequent executions are suppressed.
+ * Otherwise, the task will only terminate via cancellation or
+ * termination of the executor. If any execution of this task
+ * takes longer than its period, then subsequent executions
+ * may start late, but will not concurrently execute.
+ *
+ * @param command the task to execute
+ * @param initialDelay the time to delay first execution
+ * @param period the period between successive executions
+ * @param unit the time unit of the initialDelay and period parameters
+ * @return a ScheduledFuture representing pending completion of
+ * the task, and whose <tt>get()</tt> method will throw an
+ * exception upon cancellation
+ * @throws RejectedExecutionException if the task cannot be
+ * scheduled for execution
+ * @throws NullPointerException if command is null
+ * @throws IllegalArgumentException if period less than or equal to zero
+ */
+ public ScheduledFuture<?> scheduleAtFixedRate(Runnable command,
+ long initialDelay,
+ long period,
+ TimeUnit unit);
+
+ /**
+ * Creates and executes a periodic action that becomes enabled first
+ * after the given initial delay, and subsequently with the
+ * given delay between the termination of one execution and the
+ * commencement of the next. If any execution of the task
+ * encounters an exception, subsequent executions are suppressed.
+ * Otherwise, the task will only terminate via cancellation or
+ * termination of the executor.
+ *
+ * @param command the task to execute
+ * @param initialDelay the time to delay first execution
+ * @param delay the delay between the termination of one
+ * execution and the commencement of the next
+ * @param unit the time unit of the initialDelay and delay parameters
+ * @return a ScheduledFuture representing pending completion of
+ * the task, and whose <tt>get()</tt> method will throw an
+ * exception upon cancellation
+ * @throws RejectedExecutionException if the task cannot be
+ * scheduled for execution
+ * @throws NullPointerException if command is null
+ * @throws IllegalArgumentException if delay less than or equal to zero
+ */
+ public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
+ long initialDelay,
+ long delay,
+ TimeUnit unit);
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ScheduledFuture.java b/libjava/classpath/external/jsr166/java/util/concurrent/ScheduledFuture.java
new file mode 100644
index 00000000000..239d681f6d9
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ScheduledFuture.java
@@ -0,0 +1,19 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * A delayed result-bearing action that can be cancelled.
+ * Usually a scheduled future is the result of scheduling
+ * a task with a {@link ScheduledExecutorService}.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <V> The result type returned by this Future
+ */
+public interface ScheduledFuture<V> extends Delayed, Future<V> {
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ScheduledThreadPoolExecutor.java b/libjava/classpath/external/jsr166/java/util/concurrent/ScheduledThreadPoolExecutor.java
new file mode 100644
index 00000000000..d4da334c6e0
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ScheduledThreadPoolExecutor.java
@@ -0,0 +1,626 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.concurrent.atomic.*;
+import java.util.*;
+
+/**
+ * A {@link ThreadPoolExecutor} that can additionally schedule
+ * commands to run after a given delay, or to execute
+ * periodically. This class is preferable to {@link java.util.Timer}
+ * when multiple worker threads are needed, or when the additional
+ * flexibility or capabilities of {@link ThreadPoolExecutor} (which
+ * this class extends) are required.
+ *
+ * <p> Delayed tasks execute no sooner than they are enabled, but
+ * without any real-time guarantees about when, after they are
+ * enabled, they will commence. Tasks scheduled for exactly the same
+ * execution time are enabled in first-in-first-out (FIFO) order of
+ * submission.
+ *
+ * <p>While this class inherits from {@link ThreadPoolExecutor}, a few
+ * of the inherited tuning methods are not useful for it. In
+ * particular, because it acts as a fixed-sized pool using
+ * <tt>corePoolSize</tt> threads and an unbounded queue, adjustments
+ * to <tt>maximumPoolSize</tt> have no useful effect.
+ *
+ * <p><b>Extension notes:</b> This class overrides {@link
+ * AbstractExecutorService} <tt>submit</tt> methods to generate
+ * internal objects to control per-task delays and scheduling. To
+ * preserve functionality, any further overrides of these methods in
+ * subclasses must invoke superclass versions, which effectively
+ * disables additional task customization. However, this class
+ * provides alternative protected extension method
+ * <tt>decorateTask</tt> (one version each for <tt>Runnable</tt> and
+ * <tt>Callable</tt>) that can be used to customize the concrete task
+ * types used to execute commands entered via <tt>execute</tt>,
+ * <tt>submit</tt>, <tt>schedule</tt>, <tt>scheduleAtFixedRate</tt>,
+ * and <tt>scheduleWithFixedDelay</tt>. By default, a
+ * <tt>ScheduledThreadPoolExecutor</tt> uses a task type extending
+ * {@link FutureTask}. However, this may be modified or replaced using
+ * subclasses of the form:
+ *
+ * <pre>
+ * public class CustomScheduledExecutor extends ScheduledThreadPoolExecutor {
+ *
+ * static class CustomTask&lt;V&gt; implements RunnableScheduledFuture&lt;V&gt; { ... }
+ *
+ * protected &lt;V&gt; RunnableScheduledFuture&lt;V&gt; decorateTask(
+ * Runnable r, RunnableScheduledFuture&lt;V&gt; task) {
+ * return new CustomTask&lt;V&gt;(r, task);
+ * }
+ *
+ * protected &lt;V&gt; RunnableScheduledFuture&lt;V&gt; decorateTask(
+ * Callable&lt;V&gt; c, RunnableScheduledFuture&lt;V&gt; task) {
+ * return new CustomTask&lt;V&gt;(c, task);
+ * }
+ * // ... add constructors, etc.
+ * }
+ * </pre>
+ * @since 1.5
+ * @author Doug Lea
+ */
+public class ScheduledThreadPoolExecutor
+ extends ThreadPoolExecutor
+ implements ScheduledExecutorService {
+
+ /**
+ * False if should cancel/suppress periodic tasks on shutdown.
+ */
+ private volatile boolean continueExistingPeriodicTasksAfterShutdown;
+
+ /**
+ * False if should cancel non-periodic tasks on shutdown.
+ */
+ private volatile boolean executeExistingDelayedTasksAfterShutdown = true;
+
+ /**
+ * Sequence number to break scheduling ties, and in turn to
+ * guarantee FIFO order among tied entries.
+ */
+ private static final AtomicLong sequencer = new AtomicLong(0);
+
+ /** Base of nanosecond timings, to avoid wrapping */
+ private static final long NANO_ORIGIN = System.nanoTime();
+
+ /**
+ * Returns nanosecond time offset by origin
+ */
+ final long now() {
+ return System.nanoTime() - NANO_ORIGIN;
+ }
+
+ private class ScheduledFutureTask<V>
+ extends FutureTask<V> implements RunnableScheduledFuture<V> {
+
+ /** Sequence number to break ties FIFO */
+ private final long sequenceNumber;
+ /** The time the task is enabled to execute in nanoTime units */
+ private long time;
+ /**
+ * Period in nanoseconds for repeating tasks. A positive
+ * value indicates fixed-rate execution. A negative value
+ * indicates fixed-delay execution. A value of 0 indicates a
+ * non-repeating task.
+ */
+ private final long period;
+
+ /**
+ * Creates a one-shot action with given nanoTime-based trigger time.
+ */
+ ScheduledFutureTask(Runnable r, V result, long ns) {
+ super(r, result);
+ this.time = ns;
+ this.period = 0;
+ this.sequenceNumber = sequencer.getAndIncrement();
+ }
+
+ /**
+ * Creates a periodic action with given nano time and period.
+ */
+ ScheduledFutureTask(Runnable r, V result, long ns, long period) {
+ super(r, result);
+ this.time = ns;
+ this.period = period;
+ this.sequenceNumber = sequencer.getAndIncrement();
+ }
+
+ /**
+ * Creates a one-shot action with given nanoTime-based trigger.
+ */
+ ScheduledFutureTask(Callable<V> callable, long ns) {
+ super(callable);
+ this.time = ns;
+ this.period = 0;
+ this.sequenceNumber = sequencer.getAndIncrement();
+ }
+
+ public long getDelay(TimeUnit unit) {
+ long d = unit.convert(time - now(), TimeUnit.NANOSECONDS);
+ return d;
+ }
+
+ public int compareTo(Delayed other) {
+ if (other == this) // compare zero ONLY if same object
+ return 0;
+ if (other instanceof ScheduledFutureTask) {
+ ScheduledFutureTask<?> x = (ScheduledFutureTask<?>)other;
+ long diff = time - x.time;
+ if (diff < 0)
+ return -1;
+ else if (diff > 0)
+ return 1;
+ else if (sequenceNumber < x.sequenceNumber)
+ return -1;
+ else
+ return 1;
+ }
+ long d = (getDelay(TimeUnit.NANOSECONDS) -
+ other.getDelay(TimeUnit.NANOSECONDS));
+ return (d == 0)? 0 : ((d < 0)? -1 : 1);
+ }
+
+ /**
+ * Returns true if this is a periodic (not a one-shot) action.
+ *
+ * @return true if periodic
+ */
+ public boolean isPeriodic() {
+ return period != 0;
+ }
+
+ /**
+ * Runs a periodic task.
+ */
+ private void runPeriodic() {
+ boolean ok = ScheduledFutureTask.super.runAndReset();
+ boolean down = isShutdown();
+ // Reschedule if not cancelled and not shutdown or policy allows
+ if (ok && (!down ||
+ (getContinueExistingPeriodicTasksAfterShutdownPolicy() &&
+ !isTerminating()))) {
+ long p = period;
+ if (p > 0)
+ time += p;
+ else
+ time = now() - p;
+ // Classpath local: ecj from eclipse 3.1 does not
+ // compile this.
+ // ScheduledThreadPoolExecutor.super.getQueue().add(this);
+ ScheduledThreadPoolExecutor.super.getQueue().add((Runnable) this);
+ }
+ // This might have been the final executed delayed
+ // task. Wake up threads to check.
+ else if (down)
+ interruptIdleWorkers();
+ }
+
+ /**
+ * Overrides FutureTask version so as to reset/requeue if periodic.
+ */
+ public void run() {
+ if (isPeriodic())
+ runPeriodic();
+ else
+ ScheduledFutureTask.super.run();
+ }
+ }
+
+ /**
+ * Specialized variant of ThreadPoolExecutor.execute for delayed tasks.
+ */
+ private void delayedExecute(Runnable command) {
+ if (isShutdown()) {
+ reject(command);
+ return;
+ }
+ // Prestart a thread if necessary. We cannot prestart it
+ // running the task because the task (probably) shouldn't be
+ // run yet, so thread will just idle until delay elapses.
+ if (getPoolSize() < getCorePoolSize())
+ prestartCoreThread();
+
+ super.getQueue().add(command);
+ }
+
+ /**
+ * Cancels and clears the queue of all tasks that should not be run
+ * due to shutdown policy.
+ */
+ private void cancelUnwantedTasks() {
+ boolean keepDelayed = getExecuteExistingDelayedTasksAfterShutdownPolicy();
+ boolean keepPeriodic = getContinueExistingPeriodicTasksAfterShutdownPolicy();
+ if (!keepDelayed && !keepPeriodic)
+ super.getQueue().clear();
+ else if (keepDelayed || keepPeriodic) {
+ Object[] entries = super.getQueue().toArray();
+ for (int i = 0; i < entries.length; ++i) {
+ Object e = entries[i];
+ if (e instanceof RunnableScheduledFuture) {
+ RunnableScheduledFuture<?> t = (RunnableScheduledFuture<?>)e;
+ if (t.isPeriodic()? !keepPeriodic : !keepDelayed)
+ t.cancel(false);
+ }
+ }
+ entries = null;
+ purge();
+ }
+ }
+
+ public boolean remove(Runnable task) {
+ if (!(task instanceof RunnableScheduledFuture))
+ return false;
+ return getQueue().remove(task);
+ }
+
+ /**
+ * Modifies or replaces the task used to execute a runnable.
+ * This method can be used to override the concrete
+ * class used for managing internal tasks.
+ * The default implementation simply returns the given task.
+ *
+ * @param runnable the submitted Runnable
+ * @param task the task created to execute the runnable
+ * @return a task that can execute the runnable
+ * @since 1.6
+ */
+ protected <V> RunnableScheduledFuture<V> decorateTask(
+ Runnable runnable, RunnableScheduledFuture<V> task) {
+ return task;
+ }
+
+ /**
+ * Modifies or replaces the task used to execute a callable.
+ * This method can be used to override the concrete
+ * class used for managing internal tasks.
+ * The default implementation simply returns the given task.
+ *
+ * @param callable the submitted Callable
+ * @param task the task created to execute the callable
+ * @return a task that can execute the callable
+ * @since 1.6
+ */
+ protected <V> RunnableScheduledFuture<V> decorateTask(
+ Callable<V> callable, RunnableScheduledFuture<V> task) {
+ return task;
+ }
+
+ /**
+ * Creates a new ScheduledThreadPoolExecutor with the given core
+ * pool size.
+ *
+ * @param corePoolSize the number of threads to keep in the pool,
+ * even if they are idle
+ * @throws IllegalArgumentException if <tt>corePoolSize &lt; 0</tt>
+ */
+ public ScheduledThreadPoolExecutor(int corePoolSize) {
+ super(corePoolSize, Integer.MAX_VALUE, 0, TimeUnit.NANOSECONDS,
+ new DelayedWorkQueue());
+ }
+
+ /**
+ * Creates a new ScheduledThreadPoolExecutor with the given
+ * initial parameters.
+ *
+ * @param corePoolSize the number of threads to keep in the pool,
+ * even if they are idle
+ * @param threadFactory the factory to use when the executor
+ * creates a new thread
+ * @throws IllegalArgumentException if <tt>corePoolSize &lt; 0</tt>
+ * @throws NullPointerException if threadFactory is null
+ */
+ public ScheduledThreadPoolExecutor(int corePoolSize,
+ ThreadFactory threadFactory) {
+ super(corePoolSize, Integer.MAX_VALUE, 0, TimeUnit.NANOSECONDS,
+ new DelayedWorkQueue(), threadFactory);
+ }
+
+ /**
+ * Creates a new ScheduledThreadPoolExecutor with the given
+ * initial parameters.
+ *
+ * @param corePoolSize the number of threads to keep in the pool,
+ * even if they are idle
+ * @param handler the handler to use when execution is blocked
+ * because the thread bounds and queue capacities are reached
+ * @throws IllegalArgumentException if <tt>corePoolSize &lt; 0</tt>
+ * @throws NullPointerException if handler is null
+ */
+ public ScheduledThreadPoolExecutor(int corePoolSize,
+ RejectedExecutionHandler handler) {
+ super(corePoolSize, Integer.MAX_VALUE, 0, TimeUnit.NANOSECONDS,
+ new DelayedWorkQueue(), handler);
+ }
+
+ /**
+ * Creates a new ScheduledThreadPoolExecutor with the given
+ * initial parameters.
+ *
+ * @param corePoolSize the number of threads to keep in the pool,
+ * even if they are idle
+ * @param threadFactory the factory to use when the executor
+ * creates a new thread
+ * @param handler the handler to use when execution is blocked
+ * because the thread bounds and queue capacities are reached.
+ * @throws IllegalArgumentException if <tt>corePoolSize &lt; 0</tt>
+ * @throws NullPointerException if threadFactory or handler is null
+ */
+ public ScheduledThreadPoolExecutor(int corePoolSize,
+ ThreadFactory threadFactory,
+ RejectedExecutionHandler handler) {
+ super(corePoolSize, Integer.MAX_VALUE, 0, TimeUnit.NANOSECONDS,
+ new DelayedWorkQueue(), threadFactory, handler);
+ }
+
+ public ScheduledFuture<?> schedule(Runnable command,
+ long delay,
+ TimeUnit unit) {
+ if (command == null || unit == null)
+ throw new NullPointerException();
+ long triggerTime = now() + unit.toNanos(delay);
+ RunnableScheduledFuture<?> t = decorateTask(command,
+ new ScheduledFutureTask<Boolean>(command, null, triggerTime));
+ delayedExecute(t);
+ return t;
+ }
+
+ public <V> ScheduledFuture<V> schedule(Callable<V> callable,
+ long delay,
+ TimeUnit unit) {
+ if (callable == null || unit == null)
+ throw new NullPointerException();
+ if (delay < 0) delay = 0;
+ long triggerTime = now() + unit.toNanos(delay);
+ RunnableScheduledFuture<V> t = decorateTask(callable,
+ new ScheduledFutureTask<V>(callable, triggerTime));
+ delayedExecute(t);
+ return t;
+ }
+
+ public ScheduledFuture<?> scheduleAtFixedRate(Runnable command,
+ long initialDelay,
+ long period,
+ TimeUnit unit) {
+ if (command == null || unit == null)
+ throw new NullPointerException();
+ if (period <= 0)
+ throw new IllegalArgumentException();
+ if (initialDelay < 0) initialDelay = 0;
+ long triggerTime = now() + unit.toNanos(initialDelay);
+ RunnableScheduledFuture<?> t = decorateTask(command,
+ new ScheduledFutureTask<Object>(command,
+ null,
+ triggerTime,
+ unit.toNanos(period)));
+ delayedExecute(t);
+ return t;
+ }
+
+ public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
+ long initialDelay,
+ long delay,
+ TimeUnit unit) {
+ if (command == null || unit == null)
+ throw new NullPointerException();
+ if (delay <= 0)
+ throw new IllegalArgumentException();
+ if (initialDelay < 0) initialDelay = 0;
+ long triggerTime = now() + unit.toNanos(initialDelay);
+ RunnableScheduledFuture<?> t = decorateTask(command,
+ new ScheduledFutureTask<Boolean>(command,
+ null,
+ triggerTime,
+ unit.toNanos(-delay)));
+ delayedExecute(t);
+ return t;
+ }
+
+
+ /**
+ * Executes command with zero required delay. This has effect
+ * equivalent to <tt>schedule(command, 0, anyUnit)</tt>. Note
+ * that inspections of the queue and of the list returned by
+ * <tt>shutdownNow</tt> will access the zero-delayed
+ * {@link ScheduledFuture}, not the <tt>command</tt> itself.
+ *
+ * @param command the task to execute
+ * @throws RejectedExecutionException at discretion of
+ * <tt>RejectedExecutionHandler</tt>, if task cannot be accepted
+ * for execution because the executor has been shut down.
+ * @throws NullPointerException if command is null
+ */
+ public void execute(Runnable command) {
+ if (command == null)
+ throw new NullPointerException();
+ schedule(command, 0, TimeUnit.NANOSECONDS);
+ }
+
+ // Override AbstractExecutorService methods
+
+ public Future<?> submit(Runnable task) {
+ return schedule(task, 0, TimeUnit.NANOSECONDS);
+ }
+
+ public <T> Future<T> submit(Runnable task, T result) {
+ return schedule(Executors.callable(task, result),
+ 0, TimeUnit.NANOSECONDS);
+ }
+
+ public <T> Future<T> submit(Callable<T> task) {
+ return schedule(task, 0, TimeUnit.NANOSECONDS);
+ }
+
+ /**
+ * Sets the policy on whether to continue executing existing periodic
+ * tasks even when this executor has been <tt>shutdown</tt>. In
+ * this case, these tasks will only terminate upon
+ * <tt>shutdownNow</tt>, or after setting the policy to
+ * <tt>false</tt> when already shutdown. This value is by default
+ * false.
+ *
+ * @param value if true, continue after shutdown, else don't.
+ * @see #getContinueExistingPeriodicTasksAfterShutdownPolicy
+ */
+ public void setContinueExistingPeriodicTasksAfterShutdownPolicy(boolean value) {
+ continueExistingPeriodicTasksAfterShutdown = value;
+ if (!value && isShutdown())
+ cancelUnwantedTasks();
+ }
+
+ /**
+ * Gets the policy on whether to continue executing existing
+ * periodic tasks even when this executor has been
+ * <tt>shutdown</tt>. In this case, these tasks will only
+ * terminate upon <tt>shutdownNow</tt> or after setting the policy
+ * to <tt>false</tt> when already shutdown. This value is by
+ * default false.
+ *
+ * @return true if will continue after shutdown
+ * @see #setContinueExistingPeriodicTasksAfterShutdownPolicy
+ */
+ public boolean getContinueExistingPeriodicTasksAfterShutdownPolicy() {
+ return continueExistingPeriodicTasksAfterShutdown;
+ }
+
+ /**
+ * Sets the policy on whether to execute existing delayed
+ * tasks even when this executor has been <tt>shutdown</tt>. In
+ * this case, these tasks will only terminate upon
+ * <tt>shutdownNow</tt>, or after setting the policy to
+ * <tt>false</tt> when already shutdown. This value is by default
+ * true.
+ *
+ * @param value if true, execute after shutdown, else don't.
+ * @see #getExecuteExistingDelayedTasksAfterShutdownPolicy
+ */
+ public void setExecuteExistingDelayedTasksAfterShutdownPolicy(boolean value) {
+ executeExistingDelayedTasksAfterShutdown = value;
+ if (!value && isShutdown())
+ cancelUnwantedTasks();
+ }
+
+ /**
+ * Gets the policy on whether to execute existing delayed
+ * tasks even when this executor has been <tt>shutdown</tt>. In
+ * this case, these tasks will only terminate upon
+ * <tt>shutdownNow</tt>, or after setting the policy to
+ * <tt>false</tt> when already shutdown. This value is by default
+ * true.
+ *
+ * @return true if will execute after shutdown
+ * @see #setExecuteExistingDelayedTasksAfterShutdownPolicy
+ */
+ public boolean getExecuteExistingDelayedTasksAfterShutdownPolicy() {
+ return executeExistingDelayedTasksAfterShutdown;
+ }
+
+
+ /**
+ * Initiates an orderly shutdown in which previously submitted
+ * tasks are executed, but no new tasks will be accepted. If the
+ * <tt>ExecuteExistingDelayedTasksAfterShutdownPolicy</tt> has
+ * been set <tt>false</tt>, existing delayed tasks whose delays
+ * have not yet elapsed are cancelled. And unless the
+ * <tt>ContinueExistingPeriodicTasksAfterShutdownPolicy</tt> has
+ * been set <tt>true</tt>, future executions of existing periodic
+ * tasks will be cancelled.
+ */
+ public void shutdown() {
+ cancelUnwantedTasks();
+ super.shutdown();
+ }
+
+ /**
+ * Attempts to stop all actively executing tasks, halts the
+ * processing of waiting tasks, and returns a list of the tasks
+ * that were awaiting execution.
+ *
+ * <p>There are no guarantees beyond best-effort attempts to stop
+ * processing actively executing tasks. This implementation
+ * cancels tasks via {@link Thread#interrupt}, so any task that
+ * fails to respond to interrupts may never terminate.
+ *
+ * @return list of tasks that never commenced execution. Each
+ * element of this list is a {@link ScheduledFuture},
+ * including those tasks submitted using <tt>execute</tt>, which
+ * are for scheduling purposes used as the basis of a zero-delay
+ * <tt>ScheduledFuture</tt>.
+ * @throws SecurityException {@inheritDoc}
+ */
+ public List<Runnable> shutdownNow() {
+ return super.shutdownNow();
+ }
+
+ /**
+ * Returns the task queue used by this executor. Each element of
+ * this queue is a {@link ScheduledFuture}, including those
+ * tasks submitted using <tt>execute</tt> which are for scheduling
+ * purposes used as the basis of a zero-delay
+ * <tt>ScheduledFuture</tt>. Iteration over this queue is
+ * <em>not</em> guaranteed to traverse tasks in the order in
+ * which they will execute.
+ *
+ * @return the task queue
+ */
+ public BlockingQueue<Runnable> getQueue() {
+ return super.getQueue();
+ }
+
+ /**
+ * An annoying wrapper class to convince javac to use a
+ * DelayQueue<RunnableScheduledFuture> as a BlockingQueue<Runnable>
+ */
+ private static class DelayedWorkQueue
+ extends AbstractCollection<Runnable>
+ implements BlockingQueue<Runnable> {
+
+ private final DelayQueue<RunnableScheduledFuture> dq = new DelayQueue<RunnableScheduledFuture>();
+ public Runnable poll() { return dq.poll(); }
+ public Runnable peek() { return dq.peek(); }
+ public Runnable take() throws InterruptedException { return dq.take(); }
+ public Runnable poll(long timeout, TimeUnit unit) throws InterruptedException {
+ return dq.poll(timeout, unit);
+ }
+
+ public boolean add(Runnable x) {
+ return dq.add((RunnableScheduledFuture)x);
+ }
+ public boolean offer(Runnable x) {
+ return dq.offer((RunnableScheduledFuture)x);
+ }
+ public void put(Runnable x) {
+ dq.put((RunnableScheduledFuture)x);
+ }
+ public boolean offer(Runnable x, long timeout, TimeUnit unit) {
+ return dq.offer((RunnableScheduledFuture)x, timeout, unit);
+ }
+
+ public Runnable remove() { return dq.remove(); }
+ public Runnable element() { return dq.element(); }
+ public void clear() { dq.clear(); }
+ public int drainTo(Collection<? super Runnable> c) { return dq.drainTo(c); }
+ public int drainTo(Collection<? super Runnable> c, int maxElements) {
+ return dq.drainTo(c, maxElements);
+ }
+
+ public int remainingCapacity() { return dq.remainingCapacity(); }
+ public boolean remove(Object x) { return dq.remove(x); }
+ public boolean contains(Object x) { return dq.contains(x); }
+ public int size() { return dq.size(); }
+ public boolean isEmpty() { return dq.isEmpty(); }
+ public Object[] toArray() { return dq.toArray(); }
+ public <T> T[] toArray(T[] array) { return dq.toArray(array); }
+ public Iterator<Runnable> iterator() {
+ return new Iterator<Runnable>() {
+ private Iterator<RunnableScheduledFuture> it = dq.iterator();
+ public boolean hasNext() { return it.hasNext(); }
+ public Runnable next() { return it.next(); }
+ public void remove() { it.remove(); }
+ };
+ }
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/Semaphore.java b/libjava/classpath/external/jsr166/java/util/concurrent/Semaphore.java
new file mode 100644
index 00000000000..94e9746ae85
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/Semaphore.java
@@ -0,0 +1,681 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.*;
+import java.util.concurrent.locks.*;
+import java.util.concurrent.atomic.*;
+
+/**
+ * A counting semaphore. Conceptually, a semaphore maintains a set of
+ * permits. Each {@link #acquire} blocks if necessary until a permit is
+ * available, and then takes it. Each {@link #release} adds a permit,
+ * potentially releasing a blocking acquirer.
+ * However, no actual permit objects are used; the {@code Semaphore} just
+ * keeps a count of the number available and acts accordingly.
+ *
+ * <p>Semaphores are often used to restrict the number of threads than can
+ * access some (physical or logical) resource. For example, here is
+ * a class that uses a semaphore to control access to a pool of items:
+ * <pre>
+ * class Pool {
+ * private static final int MAX_AVAILABLE = 100;
+ * private final Semaphore available = new Semaphore(MAX_AVAILABLE, true);
+ *
+ * public Object getItem() throws InterruptedException {
+ * available.acquire();
+ * return getNextAvailableItem();
+ * }
+ *
+ * public void putItem(Object x) {
+ * if (markAsUnused(x))
+ * available.release();
+ * }
+ *
+ * // Not a particularly efficient data structure; just for demo
+ *
+ * protected Object[] items = ... whatever kinds of items being managed
+ * protected boolean[] used = new boolean[MAX_AVAILABLE];
+ *
+ * protected synchronized Object getNextAvailableItem() {
+ * for (int i = 0; i < MAX_AVAILABLE; ++i) {
+ * if (!used[i]) {
+ * used[i] = true;
+ * return items[i];
+ * }
+ * }
+ * return null; // not reached
+ * }
+ *
+ * protected synchronized boolean markAsUnused(Object item) {
+ * for (int i = 0; i < MAX_AVAILABLE; ++i) {
+ * if (item == items[i]) {
+ * if (used[i]) {
+ * used[i] = false;
+ * return true;
+ * } else
+ * return false;
+ * }
+ * }
+ * return false;
+ * }
+ *
+ * }
+ * </pre>
+ *
+ * <p>Before obtaining an item each thread must acquire a permit from
+ * the semaphore, guaranteeing that an item is available for use. When
+ * the thread has finished with the item it is returned back to the
+ * pool and a permit is returned to the semaphore, allowing another
+ * thread to acquire that item. Note that no synchronization lock is
+ * held when {@link #acquire} is called as that would prevent an item
+ * from being returned to the pool. The semaphore encapsulates the
+ * synchronization needed to restrict access to the pool, separately
+ * from any synchronization needed to maintain the consistency of the
+ * pool itself.
+ *
+ * <p>A semaphore initialized to one, and which is used such that it
+ * only has at most one permit available, can serve as a mutual
+ * exclusion lock. This is more commonly known as a <em>binary
+ * semaphore</em>, because it only has two states: one permit
+ * available, or zero permits available. When used in this way, the
+ * binary semaphore has the property (unlike many {@link Lock}
+ * implementations), that the &quot;lock&quot; can be released by a
+ * thread other than the owner (as semaphores have no notion of
+ * ownership). This can be useful in some specialized contexts, such
+ * as deadlock recovery.
+ *
+ * <p> The constructor for this class optionally accepts a
+ * <em>fairness</em> parameter. When set false, this class makes no
+ * guarantees about the order in which threads acquire permits. In
+ * particular, <em>barging</em> is permitted, that is, a thread
+ * invoking {@link #acquire} can be allocated a permit ahead of a
+ * thread that has been waiting - logically the new thread places itself at
+ * the head of the queue of waiting threads. When fairness is set true, the
+ * semaphore guarantees that threads invoking any of the {@link
+ * #acquire() acquire} methods are selected to obtain permits in the order in
+ * which their invocation of those methods was processed
+ * (first-in-first-out; FIFO). Note that FIFO ordering necessarily
+ * applies to specific internal points of execution within these
+ * methods. So, it is possible for one thread to invoke
+ * {@code acquire} before another, but reach the ordering point after
+ * the other, and similarly upon return from the method.
+ * Also note that the untimed {@link #tryAcquire() tryAcquire} methods do not
+ * honor the fairness setting, but will take any permits that are
+ * available.
+ *
+ * <p>Generally, semaphores used to control resource access should be
+ * initialized as fair, to ensure that no thread is starved out from
+ * accessing a resource. When using semaphores for other kinds of
+ * synchronization control, the throughput advantages of non-fair
+ * ordering often outweigh fairness considerations.
+ *
+ * <p>This class also provides convenience methods to {@link
+ * #acquire(int) acquire} and {@link #release(int) release} multiple
+ * permits at a time. Beware of the increased risk of indefinite
+ * postponement when these methods are used without fairness set true.
+ *
+ * <p>Memory consistency effects: Actions in a thread prior to calling
+ * a "release" method such as {@code release()}
+ * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
+ * actions following a successful "acquire" method such as {@code acquire()}
+ * in another thread.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ *
+ */
+
+public class Semaphore implements java.io.Serializable {
+ private static final long serialVersionUID = -3222578661600680210L;
+ /** All mechanics via AbstractQueuedSynchronizer subclass */
+ private final Sync sync;
+
+ /**
+ * Synchronization implementation for semaphore. Uses AQS state
+ * to represent permits. Subclassed into fair and nonfair
+ * versions.
+ */
+ abstract static class Sync extends AbstractQueuedSynchronizer {
+ private static final long serialVersionUID = 1192457210091910933L;
+
+ Sync(int permits) {
+ setState(permits);
+ }
+
+ final int getPermits() {
+ return getState();
+ }
+
+ final int nonfairTryAcquireShared(int acquires) {
+ for (;;) {
+ int available = getState();
+ int remaining = available - acquires;
+ if (remaining < 0 ||
+ compareAndSetState(available, remaining))
+ return remaining;
+ }
+ }
+
+ protected final boolean tryReleaseShared(int releases) {
+ for (;;) {
+ int p = getState();
+ if (compareAndSetState(p, p + releases))
+ return true;
+ }
+ }
+
+ final void reducePermits(int reductions) {
+ for (;;) {
+ int current = getState();
+ int next = current - reductions;
+ if (compareAndSetState(current, next))
+ return;
+ }
+ }
+
+ final int drainPermits() {
+ for (;;) {
+ int current = getState();
+ if (current == 0 || compareAndSetState(current, 0))
+ return current;
+ }
+ }
+ }
+
+ /**
+ * NonFair version
+ */
+ final static class NonfairSync extends Sync {
+ private static final long serialVersionUID = -2694183684443567898L;
+
+ NonfairSync(int permits) {
+ super(permits);
+ }
+
+ protected int tryAcquireShared(int acquires) {
+ return nonfairTryAcquireShared(acquires);
+ }
+ }
+
+ /**
+ * Fair version
+ */
+ final static class FairSync extends Sync {
+ private static final long serialVersionUID = 2014338818796000944L;
+
+ FairSync(int permits) {
+ super(permits);
+ }
+
+ protected int tryAcquireShared(int acquires) {
+ Thread current = Thread.currentThread();
+ for (;;) {
+ Thread first = getFirstQueuedThread();
+ if (first != null && first != current)
+ return -1;
+ int available = getState();
+ int remaining = available - acquires;
+ if (remaining < 0 ||
+ compareAndSetState(available, remaining))
+ return remaining;
+ }
+ }
+ }
+
+ /**
+ * Creates a {@code Semaphore} with the given number of
+ * permits and nonfair fairness setting.
+ *
+ * @param permits the initial number of permits available.
+ * This value may be negative, in which case releases
+ * must occur before any acquires will be granted.
+ */
+ public Semaphore(int permits) {
+ sync = new NonfairSync(permits);
+ }
+
+ /**
+ * Creates a {@code Semaphore} with the given number of
+ * permits and the given fairness setting.
+ *
+ * @param permits the initial number of permits available.
+ * This value may be negative, in which case releases
+ * must occur before any acquires will be granted.
+ * @param fair {@code true} if this semaphore will guarantee
+ * first-in first-out granting of permits under contention,
+ * else {@code false}
+ */
+ public Semaphore(int permits, boolean fair) {
+ sync = (fair)? new FairSync(permits) : new NonfairSync(permits);
+ }
+
+ /**
+ * Acquires a permit from this semaphore, blocking until one is
+ * available, or the thread is {@linkplain Thread#interrupt interrupted}.
+ *
+ * <p>Acquires a permit, if one is available and returns immediately,
+ * reducing the number of available permits by one.
+ *
+ * <p>If no permit is available then the current thread becomes
+ * disabled for thread scheduling purposes and lies dormant until
+ * one of two things happens:
+ * <ul>
+ * <li>Some other thread invokes the {@link #release} method for this
+ * semaphore and the current thread is next to be assigned a permit; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread.
+ * </ul>
+ *
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while waiting
+ * for a permit,
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared.
+ *
+ * @throws InterruptedException if the current thread is interrupted
+ */
+ public void acquire() throws InterruptedException {
+ sync.acquireSharedInterruptibly(1);
+ }
+
+ /**
+ * Acquires a permit from this semaphore, blocking until one is
+ * available.
+ *
+ * <p>Acquires a permit, if one is available and returns immediately,
+ * reducing the number of available permits by one.
+ *
+ * <p>If no permit is available then the current thread becomes
+ * disabled for thread scheduling purposes and lies dormant until
+ * some other thread invokes the {@link #release} method for this
+ * semaphore and the current thread is next to be assigned a permit.
+ *
+ * <p>If the current thread is {@linkplain Thread#interrupt interrupted}
+ * while waiting for a permit then it will continue to wait, but the
+ * time at which the thread is assigned a permit may change compared to
+ * the time it would have received the permit had no interruption
+ * occurred. When the thread does return from this method its interrupt
+ * status will be set.
+ */
+ public void acquireUninterruptibly() {
+ sync.acquireShared(1);
+ }
+
+ /**
+ * Acquires a permit from this semaphore, only if one is available at the
+ * time of invocation.
+ *
+ * <p>Acquires a permit, if one is available and returns immediately,
+ * with the value {@code true},
+ * reducing the number of available permits by one.
+ *
+ * <p>If no permit is available then this method will return
+ * immediately with the value {@code false}.
+ *
+ * <p>Even when this semaphore has been set to use a
+ * fair ordering policy, a call to {@code tryAcquire()} <em>will</em>
+ * immediately acquire a permit if one is available, whether or not
+ * other threads are currently waiting.
+ * This &quot;barging&quot; behavior can be useful in certain
+ * circumstances, even though it breaks fairness. If you want to honor
+ * the fairness setting, then use
+ * {@link #tryAcquire(long, TimeUnit) tryAcquire(0, TimeUnit.SECONDS) }
+ * which is almost equivalent (it also detects interruption).
+ *
+ * @return {@code true} if a permit was acquired and {@code false}
+ * otherwise
+ */
+ public boolean tryAcquire() {
+ return sync.nonfairTryAcquireShared(1) >= 0;
+ }
+
+ /**
+ * Acquires a permit from this semaphore, if one becomes available
+ * within the given waiting time and the current thread has not
+ * been {@linkplain Thread#interrupt interrupted}.
+ *
+ * <p>Acquires a permit, if one is available and returns immediately,
+ * with the value {@code true},
+ * reducing the number of available permits by one.
+ *
+ * <p>If no permit is available then the current thread becomes
+ * disabled for thread scheduling purposes and lies dormant until
+ * one of three things happens:
+ * <ul>
+ * <li>Some other thread invokes the {@link #release} method for this
+ * semaphore and the current thread is next to be assigned a permit; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread; or
+ * <li>The specified waiting time elapses.
+ * </ul>
+ *
+ * <p>If a permit is acquired then the value {@code true} is returned.
+ *
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while waiting
+ * to acquire a permit,
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared.
+ *
+ * <p>If the specified waiting time elapses then the value {@code false}
+ * is returned. If the time is less than or equal to zero, the method
+ * will not wait at all.
+ *
+ * @param timeout the maximum time to wait for a permit
+ * @param unit the time unit of the {@code timeout} argument
+ * @return {@code true} if a permit was acquired and {@code false}
+ * if the waiting time elapsed before a permit was acquired
+ * @throws InterruptedException if the current thread is interrupted
+ */
+ public boolean tryAcquire(long timeout, TimeUnit unit)
+ throws InterruptedException {
+ return sync.tryAcquireSharedNanos(1, unit.toNanos(timeout));
+ }
+
+ /**
+ * Releases a permit, returning it to the semaphore.
+ *
+ * <p>Releases a permit, increasing the number of available permits by
+ * one. If any threads are trying to acquire a permit, then one is
+ * selected and given the permit that was just released. That thread
+ * is (re)enabled for thread scheduling purposes.
+ *
+ * <p>There is no requirement that a thread that releases a permit must
+ * have acquired that permit by calling {@link #acquire}.
+ * Correct usage of a semaphore is established by programming convention
+ * in the application.
+ */
+ public void release() {
+ sync.releaseShared(1);
+ }
+
+ /**
+ * Acquires the given number of permits from this semaphore,
+ * blocking until all are available,
+ * or the thread is {@linkplain Thread#interrupt interrupted}.
+ *
+ * <p>Acquires the given number of permits, if they are available,
+ * and returns immediately, reducing the number of available permits
+ * by the given amount.
+ *
+ * <p>If insufficient permits are available then the current thread becomes
+ * disabled for thread scheduling purposes and lies dormant until
+ * one of two things happens:
+ * <ul>
+ * <li>Some other thread invokes one of the {@link #release() release}
+ * methods for this semaphore, the current thread is next to be assigned
+ * permits and the number of available permits satisfies this request; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread.
+ * </ul>
+ *
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while waiting
+ * for a permit,
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared.
+ * Any permits that were to be assigned to this thread are instead
+ * assigned to other threads trying to acquire permits, as if
+ * permits had been made available by a call to {@link #release()}.
+ *
+ * @param permits the number of permits to acquire
+ * @throws InterruptedException if the current thread is interrupted
+ * @throws IllegalArgumentException if {@code permits} is negative
+ */
+ public void acquire(int permits) throws InterruptedException {
+ if (permits < 0) throw new IllegalArgumentException();
+ sync.acquireSharedInterruptibly(permits);
+ }
+
+ /**
+ * Acquires the given number of permits from this semaphore,
+ * blocking until all are available.
+ *
+ * <p>Acquires the given number of permits, if they are available,
+ * and returns immediately, reducing the number of available permits
+ * by the given amount.
+ *
+ * <p>If insufficient permits are available then the current thread becomes
+ * disabled for thread scheduling purposes and lies dormant until
+ * some other thread invokes one of the {@link #release() release}
+ * methods for this semaphore, the current thread is next to be assigned
+ * permits and the number of available permits satisfies this request.
+ *
+ * <p>If the current thread is {@linkplain Thread#interrupt interrupted}
+ * while waiting for permits then it will continue to wait and its
+ * position in the queue is not affected. When the thread does return
+ * from this method its interrupt status will be set.
+ *
+ * @param permits the number of permits to acquire
+ * @throws IllegalArgumentException if {@code permits} is negative
+ *
+ */
+ public void acquireUninterruptibly(int permits) {
+ if (permits < 0) throw new IllegalArgumentException();
+ sync.acquireShared(permits);
+ }
+
+ /**
+ * Acquires the given number of permits from this semaphore, only
+ * if all are available at the time of invocation.
+ *
+ * <p>Acquires the given number of permits, if they are available, and
+ * returns immediately, with the value {@code true},
+ * reducing the number of available permits by the given amount.
+ *
+ * <p>If insufficient permits are available then this method will return
+ * immediately with the value {@code false} and the number of available
+ * permits is unchanged.
+ *
+ * <p>Even when this semaphore has been set to use a fair ordering
+ * policy, a call to {@code tryAcquire} <em>will</em>
+ * immediately acquire a permit if one is available, whether or
+ * not other threads are currently waiting. This
+ * &quot;barging&quot; behavior can be useful in certain
+ * circumstances, even though it breaks fairness. If you want to
+ * honor the fairness setting, then use {@link #tryAcquire(int,
+ * long, TimeUnit) tryAcquire(permits, 0, TimeUnit.SECONDS) }
+ * which is almost equivalent (it also detects interruption).
+ *
+ * @param permits the number of permits to acquire
+ * @return {@code true} if the permits were acquired and
+ * {@code false} otherwise
+ * @throws IllegalArgumentException if {@code permits} is negative
+ */
+ public boolean tryAcquire(int permits) {
+ if (permits < 0) throw new IllegalArgumentException();
+ return sync.nonfairTryAcquireShared(permits) >= 0;
+ }
+
+ /**
+ * Acquires the given number of permits from this semaphore, if all
+ * become available within the given waiting time and the current
+ * thread has not been {@linkplain Thread#interrupt interrupted}.
+ *
+ * <p>Acquires the given number of permits, if they are available and
+ * returns immediately, with the value {@code true},
+ * reducing the number of available permits by the given amount.
+ *
+ * <p>If insufficient permits are available then
+ * the current thread becomes disabled for thread scheduling
+ * purposes and lies dormant until one of three things happens:
+ * <ul>
+ * <li>Some other thread invokes one of the {@link #release() release}
+ * methods for this semaphore, the current thread is next to be assigned
+ * permits and the number of available permits satisfies this request; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread; or
+ * <li>The specified waiting time elapses.
+ * </ul>
+ *
+ * <p>If the permits are acquired then the value {@code true} is returned.
+ *
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while waiting
+ * to acquire the permits,
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared.
+ * Any permits that were to be assigned to this thread, are instead
+ * assigned to other threads trying to acquire permits, as if
+ * the permits had been made available by a call to {@link #release()}.
+ *
+ * <p>If the specified waiting time elapses then the value {@code false}
+ * is returned. If the time is less than or equal to zero, the method
+ * will not wait at all. Any permits that were to be assigned to this
+ * thread, are instead assigned to other threads trying to acquire
+ * permits, as if the permits had been made available by a call to
+ * {@link #release()}.
+ *
+ * @param permits the number of permits to acquire
+ * @param timeout the maximum time to wait for the permits
+ * @param unit the time unit of the {@code timeout} argument
+ * @return {@code true} if all permits were acquired and {@code false}
+ * if the waiting time elapsed before all permits were acquired
+ * @throws InterruptedException if the current thread is interrupted
+ * @throws IllegalArgumentException if {@code permits} is negative
+ */
+ public boolean tryAcquire(int permits, long timeout, TimeUnit unit)
+ throws InterruptedException {
+ if (permits < 0) throw new IllegalArgumentException();
+ return sync.tryAcquireSharedNanos(permits, unit.toNanos(timeout));
+ }
+
+ /**
+ * Releases the given number of permits, returning them to the semaphore.
+ *
+ * <p>Releases the given number of permits, increasing the number of
+ * available permits by that amount.
+ * If any threads are trying to acquire permits, then one
+ * is selected and given the permits that were just released.
+ * If the number of available permits satisfies that thread's request
+ * then that thread is (re)enabled for thread scheduling purposes;
+ * otherwise the thread will wait until sufficient permits are available.
+ * If there are still permits available
+ * after this thread's request has been satisfied, then those permits
+ * are assigned in turn to other threads trying to acquire permits.
+ *
+ * <p>There is no requirement that a thread that releases a permit must
+ * have acquired that permit by calling {@link Semaphore#acquire acquire}.
+ * Correct usage of a semaphore is established by programming convention
+ * in the application.
+ *
+ * @param permits the number of permits to release
+ * @throws IllegalArgumentException if {@code permits} is negative
+ */
+ public void release(int permits) {
+ if (permits < 0) throw new IllegalArgumentException();
+ sync.releaseShared(permits);
+ }
+
+ /**
+ * Returns the current number of permits available in this semaphore.
+ *
+ * <p>This method is typically used for debugging and testing purposes.
+ *
+ * @return the number of permits available in this semaphore
+ */
+ public int availablePermits() {
+ return sync.getPermits();
+ }
+
+ /**
+ * Acquires and returns all permits that are immediately available.
+ *
+ * @return the number of permits acquired
+ */
+ public int drainPermits() {
+ return sync.drainPermits();
+ }
+
+ /**
+ * Shrinks the number of available permits by the indicated
+ * reduction. This method can be useful in subclasses that use
+ * semaphores to track resources that become unavailable. This
+ * method differs from {@code acquire} in that it does not block
+ * waiting for permits to become available.
+ *
+ * @param reduction the number of permits to remove
+ * @throws IllegalArgumentException if {@code reduction} is negative
+ */
+ protected void reducePermits(int reduction) {
+ if (reduction < 0) throw new IllegalArgumentException();
+ sync.reducePermits(reduction);
+ }
+
+ /**
+ * Returns {@code true} if this semaphore has fairness set true.
+ *
+ * @return {@code true} if this semaphore has fairness set true
+ */
+ public boolean isFair() {
+ return sync instanceof FairSync;
+ }
+
+ /**
+ * Queries whether any threads are waiting to acquire. Note that
+ * because cancellations may occur at any time, a {@code true}
+ * return does not guarantee that any other thread will ever
+ * acquire. This method is designed primarily for use in
+ * monitoring of the system state.
+ *
+ * @return {@code true} if there may be other threads waiting to
+ * acquire the lock
+ */
+ public final boolean hasQueuedThreads() {
+ return sync.hasQueuedThreads();
+ }
+
+ /**
+ * Returns an estimate of the number of threads waiting to acquire.
+ * The value is only an estimate because the number of threads may
+ * change dynamically while this method traverses internal data
+ * structures. This method is designed for use in monitoring of the
+ * system state, not for synchronization control.
+ *
+ * @return the estimated number of threads waiting for this lock
+ */
+ public final int getQueueLength() {
+ return sync.getQueueLength();
+ }
+
+ /**
+ * Returns a collection containing threads that may be waiting to acquire.
+ * Because the actual set of threads may change dynamically while
+ * constructing this result, the returned collection is only a best-effort
+ * estimate. The elements of the returned collection are in no particular
+ * order. This method is designed to facilitate construction of
+ * subclasses that provide more extensive monitoring facilities.
+ *
+ * @return the collection of threads
+ */
+ protected Collection<Thread> getQueuedThreads() {
+ return sync.getQueuedThreads();
+ }
+
+ /**
+ * Returns a string identifying this semaphore, as well as its state.
+ * The state, in brackets, includes the String {@code "Permits ="}
+ * followed by the number of permits.
+ *
+ * @return a string identifying this semaphore, as well as its state
+ */
+ public String toString() {
+ return super.toString() + "[Permits = " + sync.getPermits() + "]";
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/SynchronousQueue.java b/libjava/classpath/external/jsr166/java/util/concurrent/SynchronousQueue.java
new file mode 100644
index 00000000000..e47e0401cfe
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/SynchronousQueue.java
@@ -0,0 +1,1127 @@
+/*
+ * Written by Doug Lea, Bill Scherer, and Michael Scott with
+ * assistance from members of JCP JSR-166 Expert Group and released to
+ * the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.concurrent.locks.*;
+import java.util.concurrent.atomic.*;
+import java.util.*;
+
+/**
+ * A {@linkplain BlockingQueue blocking queue} in which each insert
+ * operation must wait for a corresponding remove operation by another
+ * thread, and vice versa. A synchronous queue does not have any
+ * internal capacity, not even a capacity of one. You cannot
+ * <tt>peek</tt> at a synchronous queue because an element is only
+ * present when you try to remove it; you cannot insert an element
+ * (using any method) unless another thread is trying to remove it;
+ * you cannot iterate as there is nothing to iterate. The
+ * <em>head</em> of the queue is the element that the first queued
+ * inserting thread is trying to add to the queue; if there is no such
+ * queued thread then no element is available for removal and
+ * <tt>poll()</tt> will return <tt>null</tt>. For purposes of other
+ * <tt>Collection</tt> methods (for example <tt>contains</tt>), a
+ * <tt>SynchronousQueue</tt> acts as an empty collection. This queue
+ * does not permit <tt>null</tt> elements.
+ *
+ * <p>Synchronous queues are similar to rendezvous channels used in
+ * CSP and Ada. They are well suited for handoff designs, in which an
+ * object running in one thread must sync up with an object running
+ * in another thread in order to hand it some information, event, or
+ * task.
+ *
+ * <p> This class supports an optional fairness policy for ordering
+ * waiting producer and consumer threads. By default, this ordering
+ * is not guaranteed. However, a queue constructed with fairness set
+ * to <tt>true</tt> grants threads access in FIFO order.
+ *
+ * <p>This class and its iterator implement all of the
+ * <em>optional</em> methods of the {@link Collection} and {@link
+ * Iterator} interfaces.
+ *
+ * <p>This class is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @since 1.5
+ * @author Doug Lea and Bill Scherer and Michael Scott
+ * @param <E> the type of elements held in this collection
+ */
+public class SynchronousQueue<E> extends AbstractQueue<E>
+ implements BlockingQueue<E>, java.io.Serializable {
+ private static final long serialVersionUID = -3223113410248163686L;
+
+ /*
+ * This class implements extensions of the dual stack and dual
+ * queue algorithms described in "Nonblocking Concurrent Objects
+ * with Condition Synchronization", by W. N. Scherer III and
+ * M. L. Scott. 18th Annual Conf. on Distributed Computing,
+ * Oct. 2004 (see also
+ * http://www.cs.rochester.edu/u/scott/synchronization/pseudocode/duals.html).
+ * The (Lifo) stack is used for non-fair mode, and the (Fifo)
+ * queue for fair mode. The performance of the two is generally
+ * similar. Fifo usually supports higher throughput under
+ * contention but Lifo maintains higher thread locality in common
+ * applications.
+ *
+ * A dual queue (and similarly stack) is one that at any given
+ * time either holds "data" -- items provided by put operations,
+ * or "requests" -- slots representing take operations, or is
+ * empty. A call to "fulfill" (i.e., a call requesting an item
+ * from a queue holding data or vice versa) dequeues a
+ * complementary node. The most interesting feature of these
+ * queues is that any operation can figure out which mode the
+ * queue is in, and act accordingly without needing locks.
+ *
+ * Both the queue and stack extend abstract class Transferer
+ * defining the single method transfer that does a put or a
+ * take. These are unified into a single method because in dual
+ * data structures, the put and take operations are symmetrical,
+ * so nearly all code can be combined. The resulting transfer
+ * methods are on the long side, but are easier to follow than
+ * they would be if broken up into nearly-duplicated parts.
+ *
+ * The queue and stack data structures share many conceptual
+ * similarities but very few concrete details. For simplicity,
+ * they are kept distinct so that they can later evolve
+ * separately.
+ *
+ * The algorithms here differ from the versions in the above paper
+ * in extending them for use in synchronous queues, as well as
+ * dealing with cancellation. The main differences include:
+ *
+ * 1. The original algorithms used bit-marked pointers, but
+ * the ones here use mode bits in nodes, leading to a number
+ * of further adaptations.
+ * 2. SynchronousQueues must block threads waiting to become
+ * fulfilled.
+ * 3. Support for cancellation via timeout and interrupts,
+ * including cleaning out cancelled nodes/threads
+ * from lists to avoid garbage retention and memory depletion.
+ *
+ * Blocking is mainly accomplished using LockSupport park/unpark,
+ * except that nodes that appear to be the next ones to become
+ * fulfilled first spin a bit (on multiprocessors only). On very
+ * busy synchronous queues, spinning can dramatically improve
+ * throughput. And on less busy ones, the amount of spinning is
+ * small enough not to be noticeable.
+ *
+ * Cleaning is done in different ways in queues vs stacks. For
+ * queues, we can almost always remove a node immediately in O(1)
+ * time (modulo retries for consistency checks) when it is
+ * cancelled. But if it may be pinned as the current tail, it must
+ * wait until some subsequent cancellation. For stacks, we need a
+ * potentially O(n) traversal to be sure that we can remove the
+ * node, but this can run concurrently with other threads
+ * accessing the stack.
+ *
+ * While garbage collection takes care of most node reclamation
+ * issues that otherwise complicate nonblocking algorithms, care
+ * is taken to "forget" references to data, other nodes, and
+ * threads that might be held on to long-term by blocked
+ * threads. In cases where setting to null would otherwise
+ * conflict with main algorithms, this is done by changing a
+ * node's link to now point to the node itself. This doesn't arise
+ * much for Stack nodes (because blocked threads do not hang on to
+ * old head pointers), but references in Queue nodes must be
+ * aggressively forgotten to avoid reachability of everything any
+ * node has ever referred to since arrival.
+ */
+
+ /**
+ * Shared internal API for dual stacks and queues.
+ */
+ static abstract class Transferer {
+ /**
+ * Performs a put or take.
+ *
+ * @param e if non-null, the item to be handed to a consumer;
+ * if null, requests that transfer return an item
+ * offered by producer.
+ * @param timed if this operation should timeout
+ * @param nanos the timeout, in nanoseconds
+ * @return if non-null, the item provided or received; if null,
+ * the operation failed due to timeout or interrupt --
+ * the caller can distinguish which of these occurred
+ * by checking Thread.interrupted.
+ */
+ abstract Object transfer(Object e, boolean timed, long nanos);
+ }
+
+ /** The number of CPUs, for spin control */
+ static final int NCPUS = Runtime.getRuntime().availableProcessors();
+
+ /**
+ * The number of times to spin before blocking in timed waits.
+ * The value is empirically derived -- it works well across a
+ * variety of processors and OSes. Empirically, the best value
+ * seems not to vary with number of CPUs (beyond 2) so is just
+ * a constant.
+ */
+ static final int maxTimedSpins = (NCPUS < 2)? 0 : 32;
+
+ /**
+ * The number of times to spin before blocking in untimed waits.
+ * This is greater than timed value because untimed waits spin
+ * faster since they don't need to check times on each spin.
+ */
+ static final int maxUntimedSpins = maxTimedSpins * 16;
+
+ /**
+ * The number of nanoseconds for which it is faster to spin
+ * rather than to use timed park. A rough estimate suffices.
+ */
+ static final long spinForTimeoutThreshold = 1000L;
+
+ /** Dual stack */
+ static final class TransferStack extends Transferer {
+ /*
+ * This extends Scherer-Scott dual stack algorithm, differing,
+ * among other ways, by using "covering" nodes rather than
+ * bit-marked pointers: Fulfilling operations push on marker
+ * nodes (with FULFILLING bit set in mode) to reserve a spot
+ * to match a waiting node.
+ */
+
+ /* Modes for SNodes, ORed together in node fields */
+ /** Node represents an unfulfilled consumer */
+ static final int REQUEST = 0;
+ /** Node represents an unfulfilled producer */
+ static final int DATA = 1;
+ /** Node is fulfilling another unfulfilled DATA or REQUEST */
+ static final int FULFILLING = 2;
+
+ /** Return true if m has fulfilling bit set */
+ static boolean isFulfilling(int m) { return (m & FULFILLING) != 0; }
+
+ /** Node class for TransferStacks. */
+ static final class SNode {
+ volatile SNode next; // next node in stack
+ volatile SNode match; // the node matched to this
+ volatile Thread waiter; // to control park/unpark
+ Object item; // data; or null for REQUESTs
+ int mode;
+ // Note: item and mode fields don't need to be volatile
+ // since they are always written before, and read after,
+ // other volatile/atomic operations.
+
+ SNode(Object item) {
+ this.item = item;
+ }
+
+ static final AtomicReferenceFieldUpdater<SNode, SNode>
+ nextUpdater = AtomicReferenceFieldUpdater.newUpdater
+ (SNode.class, SNode.class, "next");
+
+ boolean casNext(SNode cmp, SNode val) {
+ return (cmp == next &&
+ nextUpdater.compareAndSet(this, cmp, val));
+ }
+
+ static final AtomicReferenceFieldUpdater<SNode, SNode>
+ matchUpdater = AtomicReferenceFieldUpdater.newUpdater
+ (SNode.class, SNode.class, "match");
+
+ /**
+ * Tries to match node s to this node, if so, waking up thread.
+ * Fulfillers call tryMatch to identify their waiters.
+ * Waiters block until they have been matched.
+ *
+ * @param s the node to match
+ * @return true if successfully matched to s
+ */
+ boolean tryMatch(SNode s) {
+ if (match == null &&
+ matchUpdater.compareAndSet(this, null, s)) {
+ Thread w = waiter;
+ if (w != null) { // waiters need at most one unpark
+ waiter = null;
+ LockSupport.unpark(w);
+ }
+ return true;
+ }
+ return match == s;
+ }
+
+ /**
+ * Tries to cancel a wait by matching node to itself.
+ */
+ void tryCancel() {
+ matchUpdater.compareAndSet(this, null, this);
+ }
+
+ boolean isCancelled() {
+ return match == this;
+ }
+ }
+
+ /** The head (top) of the stack */
+ volatile SNode head;
+
+ static final AtomicReferenceFieldUpdater<TransferStack, SNode>
+ headUpdater = AtomicReferenceFieldUpdater.newUpdater
+ (TransferStack.class, SNode.class, "head");
+
+ boolean casHead(SNode h, SNode nh) {
+ return h == head && headUpdater.compareAndSet(this, h, nh);
+ }
+
+ /**
+ * Creates or resets fields of a node. Called only from transfer
+ * where the node to push on stack is lazily created and
+ * reused when possible to help reduce intervals between reads
+ * and CASes of head and to avoid surges of garbage when CASes
+ * to push nodes fail due to contention.
+ */
+ static SNode snode(SNode s, Object e, SNode next, int mode) {
+ if (s == null) s = new SNode(e);
+ s.mode = mode;
+ s.next = next;
+ return s;
+ }
+
+ /**
+ * Puts or takes an item.
+ */
+ Object transfer(Object e, boolean timed, long nanos) {
+ /*
+ * Basic algorithm is to loop trying one of three actions:
+ *
+ * 1. If apparently empty or already containing nodes of same
+ * mode, try to push node on stack and wait for a match,
+ * returning it, or null if cancelled.
+ *
+ * 2. If apparently containing node of complementary mode,
+ * try to push a fulfilling node on to stack, match
+ * with corresponding waiting node, pop both from
+ * stack, and return matched item. The matching or
+ * unlinking might not actually be necessary because of
+ * other threads performing action 3:
+ *
+ * 3. If top of stack already holds another fulfilling node,
+ * help it out by doing its match and/or pop
+ * operations, and then continue. The code for helping
+ * is essentially the same as for fulfilling, except
+ * that it doesn't return the item.
+ */
+
+ SNode s = null; // constructed/reused as needed
+ int mode = (e == null)? REQUEST : DATA;
+
+ for (;;) {
+ SNode h = head;
+ if (h == null || h.mode == mode) { // empty or same-mode
+ if (timed && nanos <= 0) { // can't wait
+ if (h != null && h.isCancelled())
+ casHead(h, h.next); // pop cancelled node
+ else
+ return null;
+ } else if (casHead(h, s = snode(s, e, h, mode))) {
+ SNode m = awaitFulfill(s, timed, nanos);
+ if (m == s) { // wait was cancelled
+ clean(s);
+ return null;
+ }
+ if ((h = head) != null && h.next == s)
+ casHead(h, s.next); // help s's fulfiller
+ return mode == REQUEST? m.item : s.item;
+ }
+ } else if (!isFulfilling(h.mode)) { // try to fulfill
+ if (h.isCancelled()) // already cancelled
+ casHead(h, h.next); // pop and retry
+ else if (casHead(h, s=snode(s, e, h, FULFILLING|mode))) {
+ for (;;) { // loop until matched or waiters disappear
+ SNode m = s.next; // m is s's match
+ if (m == null) { // all waiters are gone
+ casHead(s, null); // pop fulfill node
+ s = null; // use new node next time
+ break; // restart main loop
+ }
+ SNode mn = m.next;
+ if (m.tryMatch(s)) {
+ casHead(s, mn); // pop both s and m
+ return (mode == REQUEST)? m.item : s.item;
+ } else // lost match
+ s.casNext(m, mn); // help unlink
+ }
+ }
+ } else { // help a fulfiller
+ SNode m = h.next; // m is h's match
+ if (m == null) // waiter is gone
+ casHead(h, null); // pop fulfilling node
+ else {
+ SNode mn = m.next;
+ if (m.tryMatch(h)) // help match
+ casHead(h, mn); // pop both h and m
+ else // lost match
+ h.casNext(m, mn); // help unlink
+ }
+ }
+ }
+ }
+
+ /**
+ * Spins/blocks until node s is matched by a fulfill operation.
+ *
+ * @param s the waiting node
+ * @param timed true if timed wait
+ * @param nanos timeout value
+ * @return matched node, or s if cancelled
+ */
+ SNode awaitFulfill(SNode s, boolean timed, long nanos) {
+ /*
+ * When a node/thread is about to block, it sets its waiter
+ * field and then rechecks state at least one more time
+ * before actually parking, thus covering race vs
+ * fulfiller noticing that waiter is non-null so should be
+ * woken.
+ *
+ * When invoked by nodes that appear at the point of call
+ * to be at the head of the stack, calls to park are
+ * preceded by spins to avoid blocking when producers and
+ * consumers are arriving very close in time. This can
+ * happen enough to bother only on multiprocessors.
+ *
+ * The order of checks for returning out of main loop
+ * reflects fact that interrupts have precedence over
+ * normal returns, which have precedence over
+ * timeouts. (So, on timeout, one last check for match is
+ * done before giving up.) Except that calls from untimed
+ * SynchronousQueue.{poll/offer} don't check interrupts
+ * and don't wait at all, so are trapped in transfer
+ * method rather than calling awaitFulfill.
+ */
+ long lastTime = (timed)? System.nanoTime() : 0;
+ Thread w = Thread.currentThread();
+ SNode h = head;
+ int spins = (shouldSpin(s)?
+ (timed? maxTimedSpins : maxUntimedSpins) : 0);
+ for (;;) {
+ if (w.isInterrupted())
+ s.tryCancel();
+ SNode m = s.match;
+ if (m != null)
+ return m;
+ if (timed) {
+ long now = System.nanoTime();
+ nanos -= now - lastTime;
+ lastTime = now;
+ if (nanos <= 0) {
+ s.tryCancel();
+ continue;
+ }
+ }
+ if (spins > 0)
+ spins = shouldSpin(s)? (spins-1) : 0;
+ else if (s.waiter == null)
+ s.waiter = w; // establish waiter so can park next iter
+ else if (!timed)
+ LockSupport.park(this);
+ else if (nanos > spinForTimeoutThreshold)
+ LockSupport.parkNanos(this, nanos);
+ }
+ }
+
+ /**
+ * Returns true if node s is at head or there is an active
+ * fulfiller.
+ */
+ boolean shouldSpin(SNode s) {
+ SNode h = head;
+ return (h == s || h == null || isFulfilling(h.mode));
+ }
+
+ /**
+ * Unlinks s from the stack.
+ */
+ void clean(SNode s) {
+ s.item = null; // forget item
+ s.waiter = null; // forget thread
+
+ /*
+ * At worst we may need to traverse entire stack to unlink
+ * s. If there are multiple concurrent calls to clean, we
+ * might not see s if another thread has already removed
+ * it. But we can stop when we see any node known to
+ * follow s. We use s.next unless it too is cancelled, in
+ * which case we try the node one past. We don't check any
+ * further because we don't want to doubly traverse just to
+ * find sentinel.
+ */
+
+ SNode past = s.next;
+ if (past != null && past.isCancelled())
+ past = past.next;
+
+ // Absorb cancelled nodes at head
+ SNode p;
+ while ((p = head) != null && p != past && p.isCancelled())
+ casHead(p, p.next);
+
+ // Unsplice embedded nodes
+ while (p != null && p != past) {
+ SNode n = p.next;
+ if (n != null && n.isCancelled())
+ p.casNext(n, n.next);
+ else
+ p = n;
+ }
+ }
+ }
+
+ /** Dual Queue */
+ static final class TransferQueue extends Transferer {
+ /*
+ * This extends Scherer-Scott dual queue algorithm, differing,
+ * among other ways, by using modes within nodes rather than
+ * marked pointers. The algorithm is a little simpler than
+ * that for stacks because fulfillers do not need explicit
+ * nodes, and matching is done by CAS'ing QNode.item field
+ * from non-null to null (for put) or vice versa (for take).
+ */
+
+ /** Node class for TransferQueue. */
+ static final class QNode {
+ volatile QNode next; // next node in queue
+ volatile Object item; // CAS'ed to or from null
+ volatile Thread waiter; // to control park/unpark
+ final boolean isData;
+
+ QNode(Object item, boolean isData) {
+ this.item = item;
+ this.isData = isData;
+ }
+
+ static final AtomicReferenceFieldUpdater<QNode, QNode>
+ nextUpdater = AtomicReferenceFieldUpdater.newUpdater
+ (QNode.class, QNode.class, "next");
+
+ boolean casNext(QNode cmp, QNode val) {
+ return (next == cmp &&
+ nextUpdater.compareAndSet(this, cmp, val));
+ }
+
+ static final AtomicReferenceFieldUpdater<QNode, Object>
+ itemUpdater = AtomicReferenceFieldUpdater.newUpdater
+ (QNode.class, Object.class, "item");
+
+ boolean casItem(Object cmp, Object val) {
+ return (item == cmp &&
+ itemUpdater.compareAndSet(this, cmp, val));
+ }
+
+ /**
+ * Tries to cancel by CAS'ing ref to this as item.
+ */
+ void tryCancel(Object cmp) {
+ itemUpdater.compareAndSet(this, cmp, this);
+ }
+
+ boolean isCancelled() {
+ return item == this;
+ }
+
+ /**
+ * Returns true if this node is known to be off the queue
+ * because its next pointer has been forgotten due to
+ * an advanceHead operation.
+ */
+ boolean isOffList() {
+ return next == this;
+ }
+ }
+
+ /** Head of queue */
+ transient volatile QNode head;
+ /** Tail of queue */
+ transient volatile QNode tail;
+ /**
+ * Reference to a cancelled node that might not yet have been
+ * unlinked from queue because it was the last inserted node
+ * when it cancelled.
+ */
+ transient volatile QNode cleanMe;
+
+ TransferQueue() {
+ QNode h = new QNode(null, false); // initialize to dummy node.
+ head = h;
+ tail = h;
+ }
+
+ static final AtomicReferenceFieldUpdater<TransferQueue, QNode>
+ headUpdater = AtomicReferenceFieldUpdater.newUpdater
+ (TransferQueue.class, QNode.class, "head");
+
+ /**
+ * Tries to cas nh as new head; if successful, unlink
+ * old head's next node to avoid garbage retention.
+ */
+ void advanceHead(QNode h, QNode nh) {
+ if (h == head && headUpdater.compareAndSet(this, h, nh))
+ h.next = h; // forget old next
+ }
+
+ static final AtomicReferenceFieldUpdater<TransferQueue, QNode>
+ tailUpdater = AtomicReferenceFieldUpdater.newUpdater
+ (TransferQueue.class, QNode.class, "tail");
+
+ /**
+ * Tries to cas nt as new tail.
+ */
+ void advanceTail(QNode t, QNode nt) {
+ if (tail == t)
+ tailUpdater.compareAndSet(this, t, nt);
+ }
+
+ static final AtomicReferenceFieldUpdater<TransferQueue, QNode>
+ cleanMeUpdater = AtomicReferenceFieldUpdater.newUpdater
+ (TransferQueue.class, QNode.class, "cleanMe");
+
+ /**
+ * Tries to CAS cleanMe slot.
+ */
+ boolean casCleanMe(QNode cmp, QNode val) {
+ return (cleanMe == cmp &&
+ cleanMeUpdater.compareAndSet(this, cmp, val));
+ }
+
+ /**
+ * Puts or takes an item.
+ */
+ Object transfer(Object e, boolean timed, long nanos) {
+ /* Basic algorithm is to loop trying to take either of
+ * two actions:
+ *
+ * 1. If queue apparently empty or holding same-mode nodes,
+ * try to add node to queue of waiters, wait to be
+ * fulfilled (or cancelled) and return matching item.
+ *
+ * 2. If queue apparently contains waiting items, and this
+ * call is of complementary mode, try to fulfill by CAS'ing
+ * item field of waiting node and dequeuing it, and then
+ * returning matching item.
+ *
+ * In each case, along the way, check for and try to help
+ * advance head and tail on behalf of other stalled/slow
+ * threads.
+ *
+ * The loop starts off with a null check guarding against
+ * seeing uninitialized head or tail values. This never
+ * happens in current SynchronousQueue, but could if
+ * callers held non-volatile/final ref to the
+ * transferer. The check is here anyway because it places
+ * null checks at top of loop, which is usually faster
+ * than having them implicitly interspersed.
+ */
+
+ QNode s = null; // constructed/reused as needed
+ boolean isData = (e != null);
+
+ for (;;) {
+ QNode t = tail;
+ QNode h = head;
+ if (t == null || h == null) // saw uninitialized value
+ continue; // spin
+
+ if (h == t || t.isData == isData) { // empty or same-mode
+ QNode tn = t.next;
+ if (t != tail) // inconsistent read
+ continue;
+ if (tn != null) { // lagging tail
+ advanceTail(t, tn);
+ continue;
+ }
+ if (timed && nanos <= 0) // can't wait
+ return null;
+ if (s == null)
+ s = new QNode(e, isData);
+ if (!t.casNext(null, s)) // failed to link in
+ continue;
+
+ advanceTail(t, s); // swing tail and wait
+ Object x = awaitFulfill(s, e, timed, nanos);
+ if (x == s) { // wait was cancelled
+ clean(t, s);
+ return null;
+ }
+
+ if (!s.isOffList()) { // not already unlinked
+ advanceHead(t, s); // unlink if head
+ if (x != null) // and forget fields
+ s.item = s;
+ s.waiter = null;
+ }
+ return (x != null)? x : e;
+
+ } else { // complementary-mode
+ QNode m = h.next; // node to fulfill
+ if (t != tail || m == null || h != head)
+ continue; // inconsistent read
+
+ Object x = m.item;
+ if (isData == (x != null) || // m already fulfilled
+ x == m || // m cancelled
+ !m.casItem(x, e)) { // lost CAS
+ advanceHead(h, m); // dequeue and retry
+ continue;
+ }
+
+ advanceHead(h, m); // successfully fulfilled
+ LockSupport.unpark(m.waiter);
+ return (x != null)? x : e;
+ }
+ }
+ }
+
+ /**
+ * Spins/blocks until node s is fulfilled.
+ *
+ * @param s the waiting node
+ * @param e the comparison value for checking match
+ * @param timed true if timed wait
+ * @param nanos timeout value
+ * @return matched item, or s if cancelled
+ */
+ Object awaitFulfill(QNode s, Object e, boolean timed, long nanos) {
+ /* Same idea as TransferStack.awaitFulfill */
+ long lastTime = (timed)? System.nanoTime() : 0;
+ Thread w = Thread.currentThread();
+ int spins = ((head.next == s) ?
+ (timed? maxTimedSpins : maxUntimedSpins) : 0);
+ for (;;) {
+ if (w.isInterrupted())
+ s.tryCancel(e);
+ Object x = s.item;
+ if (x != e)
+ return x;
+ if (timed) {
+ long now = System.nanoTime();
+ nanos -= now - lastTime;
+ lastTime = now;
+ if (nanos <= 0) {
+ s.tryCancel(e);
+ continue;
+ }
+ }
+ if (spins > 0)
+ --spins;
+ else if (s.waiter == null)
+ s.waiter = w;
+ else if (!timed)
+ LockSupport.park(this);
+ else if (nanos > spinForTimeoutThreshold)
+ LockSupport.parkNanos(this, nanos);
+ }
+ }
+
+ /**
+ * Gets rid of cancelled node s with original predecessor pred.
+ */
+ void clean(QNode pred, QNode s) {
+ s.waiter = null; // forget thread
+ /*
+ * At any given time, exactly one node on list cannot be
+ * deleted -- the last inserted node. To accommodate this,
+ * if we cannot delete s, we save its predecessor as
+ * "cleanMe", deleting the previously saved version
+ * first. At least one of node s or the node previously
+ * saved can always be deleted, so this always terminates.
+ */
+ while (pred.next == s) { // Return early if already unlinked
+ QNode h = head;
+ QNode hn = h.next; // Absorb cancelled first node as head
+ if (hn != null && hn.isCancelled()) {
+ advanceHead(h, hn);
+ continue;
+ }
+ QNode t = tail; // Ensure consistent read for tail
+ if (t == h)
+ return;
+ QNode tn = t.next;
+ if (t != tail)
+ continue;
+ if (tn != null) {
+ advanceTail(t, tn);
+ continue;
+ }
+ if (s != t) { // If not tail, try to unsplice
+ QNode sn = s.next;
+ if (sn == s || pred.casNext(s, sn))
+ return;
+ }
+ QNode dp = cleanMe;
+ if (dp != null) { // Try unlinking previous cancelled node
+ QNode d = dp.next;
+ QNode dn;
+ if (d == null || // d is gone or
+ d == dp || // d is off list or
+ !d.isCancelled() || // d not cancelled or
+ (d != t && // d not tail and
+ (dn = d.next) != null && // has successor
+ dn != d && // that is on list
+ dp.casNext(d, dn))) // d unspliced
+ casCleanMe(dp, null);
+ if (dp == pred)
+ return; // s is already saved node
+ } else if (casCleanMe(null, pred))
+ return; // Postpone cleaning s
+ }
+ }
+ }
+
+ /**
+ * The transferer. Set only in constructor, but cannot be declared
+ * as final without further complicating serialization. Since
+ * this is accessed only at most once per public method, there
+ * isn't a noticeable performance penalty for using volatile
+ * instead of final here.
+ */
+ private transient volatile Transferer transferer;
+
+ /**
+ * Creates a <tt>SynchronousQueue</tt> with nonfair access policy.
+ */
+ public SynchronousQueue() {
+ this(false);
+ }
+
+ /**
+ * Creates a <tt>SynchronousQueue</tt> with the specified fairness policy.
+ *
+ * @param fair if true, waiting threads contend in FIFO order for
+ * access; otherwise the order is unspecified.
+ */
+ public SynchronousQueue(boolean fair) {
+ transferer = (fair)? new TransferQueue() : new TransferStack();
+ }
+
+ /**
+ * Adds the specified element to this queue, waiting if necessary for
+ * another thread to receive it.
+ *
+ * @throws InterruptedException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public void put(E o) throws InterruptedException {
+ if (o == null) throw new NullPointerException();
+ if (transferer.transfer(o, false, 0) == null) {
+ Thread.interrupted();
+ throw new InterruptedException();
+ }
+ }
+
+ /**
+ * Inserts the specified element into this queue, waiting if necessary
+ * up to the specified wait time for another thread to receive it.
+ *
+ * @return <tt>true</tt> if successful, or <tt>false</tt> if the
+ * specified waiting time elapses before a consumer appears.
+ * @throws InterruptedException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public boolean offer(E o, long timeout, TimeUnit unit)
+ throws InterruptedException {
+ if (o == null) throw new NullPointerException();
+ if (transferer.transfer(o, true, unit.toNanos(timeout)) != null)
+ return true;
+ if (!Thread.interrupted())
+ return false;
+ throw new InterruptedException();
+ }
+
+ /**
+ * Inserts the specified element into this queue, if another thread is
+ * waiting to receive it.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> if the element was added to this queue, else
+ * <tt>false</tt>
+ * @throws NullPointerException if the specified element is null
+ */
+ public boolean offer(E e) {
+ if (e == null) throw new NullPointerException();
+ return transferer.transfer(e, true, 0) != null;
+ }
+
+ /**
+ * Retrieves and removes the head of this queue, waiting if necessary
+ * for another thread to insert it.
+ *
+ * @return the head of this queue
+ * @throws InterruptedException {@inheritDoc}
+ */
+ public E take() throws InterruptedException {
+ Object e = transferer.transfer(null, false, 0);
+ if (e != null)
+ return (E)e;
+ Thread.interrupted();
+ throw new InterruptedException();
+ }
+
+ /**
+ * Retrieves and removes the head of this queue, waiting
+ * if necessary up to the specified wait time, for another thread
+ * to insert it.
+ *
+ * @return the head of this queue, or <tt>null</tt> if the
+ * specified waiting time elapses before an element is present.
+ * @throws InterruptedException {@inheritDoc}
+ */
+ public E poll(long timeout, TimeUnit unit) throws InterruptedException {
+ Object e = transferer.transfer(null, true, unit.toNanos(timeout));
+ if (e != null || !Thread.interrupted())
+ return (E)e;
+ throw new InterruptedException();
+ }
+
+ /**
+ * Retrieves and removes the head of this queue, if another thread
+ * is currently making an element available.
+ *
+ * @return the head of this queue, or <tt>null</tt> if no
+ * element is available.
+ */
+ public E poll() {
+ return (E)transferer.transfer(null, true, 0);
+ }
+
+ /**
+ * Always returns <tt>true</tt>.
+ * A <tt>SynchronousQueue</tt> has no internal capacity.
+ *
+ * @return <tt>true</tt>
+ */
+ public boolean isEmpty() {
+ return true;
+ }
+
+ /**
+ * Always returns zero.
+ * A <tt>SynchronousQueue</tt> has no internal capacity.
+ *
+ * @return zero.
+ */
+ public int size() {
+ return 0;
+ }
+
+ /**
+ * Always returns zero.
+ * A <tt>SynchronousQueue</tt> has no internal capacity.
+ *
+ * @return zero.
+ */
+ public int remainingCapacity() {
+ return 0;
+ }
+
+ /**
+ * Does nothing.
+ * A <tt>SynchronousQueue</tt> has no internal capacity.
+ */
+ public void clear() {
+ }
+
+ /**
+ * Always returns <tt>false</tt>.
+ * A <tt>SynchronousQueue</tt> has no internal capacity.
+ *
+ * @param o the element
+ * @return <tt>false</tt>
+ */
+ public boolean contains(Object o) {
+ return false;
+ }
+
+ /**
+ * Always returns <tt>false</tt>.
+ * A <tt>SynchronousQueue</tt> has no internal capacity.
+ *
+ * @param o the element to remove
+ * @return <tt>false</tt>
+ */
+ public boolean remove(Object o) {
+ return false;
+ }
+
+ /**
+ * Returns <tt>false</tt> unless the given collection is empty.
+ * A <tt>SynchronousQueue</tt> has no internal capacity.
+ *
+ * @param c the collection
+ * @return <tt>false</tt> unless given collection is empty
+ */
+ public boolean containsAll(Collection<?> c) {
+ return c.isEmpty();
+ }
+
+ /**
+ * Always returns <tt>false</tt>.
+ * A <tt>SynchronousQueue</tt> has no internal capacity.
+ *
+ * @param c the collection
+ * @return <tt>false</tt>
+ */
+ public boolean removeAll(Collection<?> c) {
+ return false;
+ }
+
+ /**
+ * Always returns <tt>false</tt>.
+ * A <tt>SynchronousQueue</tt> has no internal capacity.
+ *
+ * @param c the collection
+ * @return <tt>false</tt>
+ */
+ public boolean retainAll(Collection<?> c) {
+ return false;
+ }
+
+ /**
+ * Always returns <tt>null</tt>.
+ * A <tt>SynchronousQueue</tt> does not return elements
+ * unless actively waited on.
+ *
+ * @return <tt>null</tt>
+ */
+ public E peek() {
+ return null;
+ }
+
+ static class EmptyIterator<E> implements Iterator<E> {
+ public boolean hasNext() {
+ return false;
+ }
+ public E next() {
+ throw new NoSuchElementException();
+ }
+ public void remove() {
+ throw new IllegalStateException();
+ }
+ }
+
+ /**
+ * Returns an empty iterator in which <tt>hasNext</tt> always returns
+ * <tt>false</tt>.
+ *
+ * @return an empty iterator
+ */
+ public Iterator<E> iterator() {
+ return new EmptyIterator<E>();
+ }
+
+ /**
+ * Returns a zero-length array.
+ * @return a zero-length array
+ */
+ public Object[] toArray() {
+ return new Object[0];
+ }
+
+ /**
+ * Sets the zeroeth element of the specified array to <tt>null</tt>
+ * (if the array has non-zero length) and returns it.
+ *
+ * @param a the array
+ * @return the specified array
+ * @throws NullPointerException if the specified array is null
+ */
+ public <T> T[] toArray(T[] a) {
+ if (a.length > 0)
+ a[0] = null;
+ return a;
+ }
+
+ /**
+ * @throws UnsupportedOperationException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public int drainTo(Collection<? super E> c) {
+ if (c == null)
+ throw new NullPointerException();
+ if (c == this)
+ throw new IllegalArgumentException();
+ int n = 0;
+ E e;
+ while ( (e = poll()) != null) {
+ c.add(e);
+ ++n;
+ }
+ return n;
+ }
+
+ /**
+ * @throws UnsupportedOperationException {@inheritDoc}
+ * @throws ClassCastException {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @throws IllegalArgumentException {@inheritDoc}
+ */
+ public int drainTo(Collection<? super E> c, int maxElements) {
+ if (c == null)
+ throw new NullPointerException();
+ if (c == this)
+ throw new IllegalArgumentException();
+ int n = 0;
+ E e;
+ while (n < maxElements && (e = poll()) != null) {
+ c.add(e);
+ ++n;
+ }
+ return n;
+ }
+
+ /*
+ * To cope with serialization strategy in the 1.5 version of
+ * SynchronousQueue, we declare some unused classes and fields
+ * that exist solely to enable serializability across versions.
+ * These fields are never used, so are initialized only if this
+ * object is ever serialized or deserialized.
+ */
+
+ static class WaitQueue implements java.io.Serializable { }
+ static class LifoWaitQueue extends WaitQueue {
+ private static final long serialVersionUID = -3633113410248163686L;
+ }
+ static class FifoWaitQueue extends WaitQueue {
+ private static final long serialVersionUID = -3623113410248163686L;
+ }
+ private ReentrantLock qlock;
+ private WaitQueue waitingProducers;
+ private WaitQueue waitingConsumers;
+
+ /**
+ * Save the state to a stream (that is, serialize it).
+ *
+ * @param s the stream
+ */
+ private void writeObject(java.io.ObjectOutputStream s)
+ throws java.io.IOException {
+ boolean fair = transferer instanceof TransferQueue;
+ if (fair) {
+ qlock = new ReentrantLock(true);
+ waitingProducers = new FifoWaitQueue();
+ waitingConsumers = new FifoWaitQueue();
+ }
+ else {
+ qlock = new ReentrantLock();
+ waitingProducers = new LifoWaitQueue();
+ waitingConsumers = new LifoWaitQueue();
+ }
+ s.defaultWriteObject();
+ }
+
+ private void readObject(final java.io.ObjectInputStream s)
+ throws java.io.IOException, ClassNotFoundException {
+ s.defaultReadObject();
+ if (waitingProducers instanceof FifoWaitQueue)
+ transferer = new TransferQueue();
+ else
+ transferer = new TransferStack();
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ThreadFactory.java b/libjava/classpath/external/jsr166/java/util/concurrent/ThreadFactory.java
new file mode 100644
index 00000000000..eca8dceb0e9
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ThreadFactory.java
@@ -0,0 +1,40 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * An object that creates new threads on demand. Using thread factories
+ * removes hardwiring of calls to {@link Thread#Thread(Runnable) new Thread},
+ * enabling applications to use special thread subclasses, priorities, etc.
+ *
+ * <p>
+ * The simplest implementation of this interface is just:
+ * <pre>
+ * class SimpleThreadFactory implements ThreadFactory {
+ * public Thread newThread(Runnable r) {
+ * return new Thread(r);
+ * }
+ * }
+ * </pre>
+ *
+ * The {@link Executors#defaultThreadFactory} method provides a more
+ * useful simple implementation, that sets the created thread context
+ * to known values before returning it.
+ * @since 1.5
+ * @author Doug Lea
+ */
+public interface ThreadFactory {
+
+ /**
+ * Constructs a new <tt>Thread</tt>. Implementations may also initialize
+ * priority, name, daemon status, <tt>ThreadGroup</tt>, etc.
+ *
+ * @param r a runnable to be executed by new thread instance
+ * @return constructed thread
+ */
+ Thread newThread(Runnable r);
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/ThreadPoolExecutor.java b/libjava/classpath/external/jsr166/java/util/concurrent/ThreadPoolExecutor.java
new file mode 100644
index 00000000000..ea89a2c082f
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/ThreadPoolExecutor.java
@@ -0,0 +1,1605 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+import java.util.concurrent.locks.*;
+import java.util.*;
+
+/**
+ * An {@link ExecutorService} that executes each submitted task using
+ * one of possibly several pooled threads, normally configured
+ * using {@link Executors} factory methods.
+ *
+ * <p>Thread pools address two different problems: they usually
+ * provide improved performance when executing large numbers of
+ * asynchronous tasks, due to reduced per-task invocation overhead,
+ * and they provide a means of bounding and managing the resources,
+ * including threads, consumed when executing a collection of tasks.
+ * Each <tt>ThreadPoolExecutor</tt> also maintains some basic
+ * statistics, such as the number of completed tasks.
+ *
+ * <p>To be useful across a wide range of contexts, this class
+ * provides many adjustable parameters and extensibility
+ * hooks. However, programmers are urged to use the more convenient
+ * {@link Executors} factory methods {@link
+ * Executors#newCachedThreadPool} (unbounded thread pool, with
+ * automatic thread reclamation), {@link Executors#newFixedThreadPool}
+ * (fixed size thread pool) and {@link
+ * Executors#newSingleThreadExecutor} (single background thread), that
+ * preconfigure settings for the most common usage
+ * scenarios. Otherwise, use the following guide when manually
+ * configuring and tuning this class:
+ *
+ * <dl>
+ *
+ * <dt>Core and maximum pool sizes</dt>
+ *
+ * <dd>A <tt>ThreadPoolExecutor</tt> will automatically adjust the
+ * pool size
+ * (see {@link ThreadPoolExecutor#getPoolSize})
+ * according to the bounds set by corePoolSize
+ * (see {@link ThreadPoolExecutor#getCorePoolSize})
+ * and
+ * maximumPoolSize
+ * (see {@link ThreadPoolExecutor#getMaximumPoolSize}).
+ * When a new task is submitted in method {@link
+ * ThreadPoolExecutor#execute}, and fewer than corePoolSize threads
+ * are running, a new thread is created to handle the request, even if
+ * other worker threads are idle. If there are more than
+ * corePoolSize but less than maximumPoolSize threads running, a new
+ * thread will be created only if the queue is full. By setting
+ * corePoolSize and maximumPoolSize the same, you create a fixed-size
+ * thread pool. By setting maximumPoolSize to an essentially unbounded
+ * value such as <tt>Integer.MAX_VALUE</tt>, you allow the pool to
+ * accommodate an arbitrary number of concurrent tasks. Most typically,
+ * core and maximum pool sizes are set only upon construction, but they
+ * may also be changed dynamically using {@link
+ * ThreadPoolExecutor#setCorePoolSize} and {@link
+ * ThreadPoolExecutor#setMaximumPoolSize}. <dd>
+ *
+ * <dt> On-demand construction
+ *
+ * <dd> By default, even core threads are initially created and
+ * started only when new tasks arrive, but this can be overridden
+ * dynamically using method {@link
+ * ThreadPoolExecutor#prestartCoreThread} or
+ * {@link ThreadPoolExecutor#prestartAllCoreThreads}.
+ * You probably want to prestart threads if you construct the
+ * pool with a non-empty queue. </dd>
+ *
+ * <dt>Creating new threads</dt>
+ *
+ * <dd>New threads are created using a {@link
+ * java.util.concurrent.ThreadFactory}. If not otherwise specified, a
+ * {@link Executors#defaultThreadFactory} is used, that creates threads to all
+ * be in the same {@link ThreadGroup} and with the same
+ * <tt>NORM_PRIORITY</tt> priority and non-daemon status. By supplying
+ * a different ThreadFactory, you can alter the thread's name, thread
+ * group, priority, daemon status, etc. If a <tt>ThreadFactory</tt> fails to create
+ * a thread when asked by returning null from <tt>newThread</tt>,
+ * the executor will continue, but might
+ * not be able to execute any tasks. </dd>
+ *
+ * <dt>Keep-alive times</dt>
+ *
+ * <dd>If the pool currently has more than corePoolSize threads,
+ * excess threads will be terminated if they have been idle for more
+ * than the keepAliveTime (see {@link
+ * ThreadPoolExecutor#getKeepAliveTime}). This provides a means of
+ * reducing resource consumption when the pool is not being actively
+ * used. If the pool becomes more active later, new threads will be
+ * constructed. This parameter can also be changed dynamically using
+ * method {@link ThreadPoolExecutor#setKeepAliveTime}. Using a value
+ * of <tt>Long.MAX_VALUE</tt> {@link TimeUnit#NANOSECONDS} effectively
+ * disables idle threads from ever terminating prior to shut down. By
+ * default, the keep-alive policy applies only when there are more
+ * than corePoolSizeThreads. But method {@link
+ * ThreadPoolExecutor#allowCoreThreadTimeOut} can be used to apply
+ * this time-out policy to core threads as well, so long as
+ * the keepAliveTime value is non-zero. </dd>
+ *
+ * <dt>Queuing</dt>
+ *
+ * <dd>Any {@link BlockingQueue} may be used to transfer and hold
+ * submitted tasks. The use of this queue interacts with pool sizing:
+ *
+ * <ul>
+ *
+ * <li> If fewer than corePoolSize threads are running, the Executor
+ * always prefers adding a new thread
+ * rather than queuing.</li>
+ *
+ * <li> If corePoolSize or more threads are running, the Executor
+ * always prefers queuing a request rather than adding a new
+ * thread.</li>
+ *
+ * <li> If a request cannot be queued, a new thread is created unless
+ * this would exceed maximumPoolSize, in which case, the task will be
+ * rejected.</li>
+ *
+ * </ul>
+ *
+ * There are three general strategies for queuing:
+ * <ol>
+ *
+ * <li> <em> Direct handoffs.</em> A good default choice for a work
+ * queue is a {@link SynchronousQueue} that hands off tasks to threads
+ * without otherwise holding them. Here, an attempt to queue a task
+ * will fail if no threads are immediately available to run it, so a
+ * new thread will be constructed. This policy avoids lockups when
+ * handling sets of requests that might have internal dependencies.
+ * Direct handoffs generally require unbounded maximumPoolSizes to
+ * avoid rejection of new submitted tasks. This in turn admits the
+ * possibility of unbounded thread growth when commands continue to
+ * arrive on average faster than they can be processed. </li>
+ *
+ * <li><em> Unbounded queues.</em> Using an unbounded queue (for
+ * example a {@link LinkedBlockingQueue} without a predefined
+ * capacity) will cause new tasks to wait in the queue when all
+ * corePoolSize threads are busy. Thus, no more than corePoolSize
+ * threads will ever be created. (And the value of the maximumPoolSize
+ * therefore doesn't have any effect.) This may be appropriate when
+ * each task is completely independent of others, so tasks cannot
+ * affect each others execution; for example, in a web page server.
+ * While this style of queuing can be useful in smoothing out
+ * transient bursts of requests, it admits the possibility of
+ * unbounded work queue growth when commands continue to arrive on
+ * average faster than they can be processed. </li>
+ *
+ * <li><em>Bounded queues.</em> A bounded queue (for example, an
+ * {@link ArrayBlockingQueue}) helps prevent resource exhaustion when
+ * used with finite maximumPoolSizes, but can be more difficult to
+ * tune and control. Queue sizes and maximum pool sizes may be traded
+ * off for each other: Using large queues and small pools minimizes
+ * CPU usage, OS resources, and context-switching overhead, but can
+ * lead to artificially low throughput. If tasks frequently block (for
+ * example if they are I/O bound), a system may be able to schedule
+ * time for more threads than you otherwise allow. Use of small queues
+ * generally requires larger pool sizes, which keeps CPUs busier but
+ * may encounter unacceptable scheduling overhead, which also
+ * decreases throughput. </li>
+ *
+ * </ol>
+ *
+ * </dd>
+ *
+ * <dt>Rejected tasks</dt>
+ *
+ * <dd> New tasks submitted in method {@link
+ * ThreadPoolExecutor#execute} will be <em>rejected</em> when the
+ * Executor has been shut down, and also when the Executor uses finite
+ * bounds for both maximum threads and work queue capacity, and is
+ * saturated. In either case, the <tt>execute</tt> method invokes the
+ * {@link RejectedExecutionHandler#rejectedExecution} method of its
+ * {@link RejectedExecutionHandler}. Four predefined handler policies
+ * are provided:
+ *
+ * <ol>
+ *
+ * <li> In the
+ * default {@link ThreadPoolExecutor.AbortPolicy}, the handler throws a
+ * runtime {@link RejectedExecutionException} upon rejection. </li>
+ *
+ * <li> In {@link
+ * ThreadPoolExecutor.CallerRunsPolicy}, the thread that invokes
+ * <tt>execute</tt> itself runs the task. This provides a simple
+ * feedback control mechanism that will slow down the rate that new
+ * tasks are submitted. </li>
+ *
+ * <li> In {@link ThreadPoolExecutor.DiscardPolicy},
+ * a task that cannot be executed is simply dropped. </li>
+ *
+ * <li>In {@link
+ * ThreadPoolExecutor.DiscardOldestPolicy}, if the executor is not
+ * shut down, the task at the head of the work queue is dropped, and
+ * then execution is retried (which can fail again, causing this to be
+ * repeated.) </li>
+ *
+ * </ol>
+ *
+ * It is possible to define and use other kinds of {@link
+ * RejectedExecutionHandler} classes. Doing so requires some care
+ * especially when policies are designed to work only under particular
+ * capacity or queuing policies. </dd>
+ *
+ * <dt>Hook methods</dt>
+ *
+ * <dd>This class provides <tt>protected</tt> overridable {@link
+ * ThreadPoolExecutor#beforeExecute} and {@link
+ * ThreadPoolExecutor#afterExecute} methods that are called before and
+ * after execution of each task. These can be used to manipulate the
+ * execution environment; for example, reinitializing ThreadLocals,
+ * gathering statistics, or adding log entries. Additionally, method
+ * {@link ThreadPoolExecutor#terminated} can be overridden to perform
+ * any special processing that needs to be done once the Executor has
+ * fully terminated.
+ *
+ * <p>If hook or callback methods throw
+ * exceptions, internal worker threads may in turn fail and
+ * abruptly terminate.</dd>
+ *
+ * <dt>Queue maintenance</dt>
+ *
+ * <dd> Method {@link ThreadPoolExecutor#getQueue} allows access to
+ * the work queue for purposes of monitoring and debugging. Use of
+ * this method for any other purpose is strongly discouraged. Two
+ * supplied methods, {@link ThreadPoolExecutor#remove} and {@link
+ * ThreadPoolExecutor#purge} are available to assist in storage
+ * reclamation when large numbers of queued tasks become
+ * cancelled.</dd>
+ *
+ * <dt>Finalization</dt>
+ *
+ * <dd> A pool that is no longer referenced in a program <em>AND</em>
+ * has no remaining threads will be <tt>shutdown</tt>
+ * automatically. If you would like to ensure that unreferenced pools
+ * are reclaimed even if users forget to call {@link
+ * ThreadPoolExecutor#shutdown}, then you must arrange that unused
+ * threads eventually die, by setting appropriate keep-alive times,
+ * using a lower bound of zero core threads and/or setting {@link
+ * ThreadPoolExecutor#allowCoreThreadTimeOut}. </dd> </dl>
+ *
+ * <p> <b>Extension example</b>. Most extensions of this class
+ * override one or more of the protected hook methods. For example,
+ * here is a subclass that adds a simple pause/resume feature:
+ *
+ * <pre>
+ * class PausableThreadPoolExecutor extends ThreadPoolExecutor {
+ * private boolean isPaused;
+ * private ReentrantLock pauseLock = new ReentrantLock();
+ * private Condition unpaused = pauseLock.newCondition();
+ *
+ * public PausableThreadPoolExecutor(...) { super(...); }
+ *
+ * protected void beforeExecute(Thread t, Runnable r) {
+ * super.beforeExecute(t, r);
+ * pauseLock.lock();
+ * try {
+ * while (isPaused) unpaused.await();
+ * } catch (InterruptedException ie) {
+ * t.interrupt();
+ * } finally {
+ * pauseLock.unlock();
+ * }
+ * }
+ *
+ * public void pause() {
+ * pauseLock.lock();
+ * try {
+ * isPaused = true;
+ * } finally {
+ * pauseLock.unlock();
+ * }
+ * }
+ *
+ * public void resume() {
+ * pauseLock.lock();
+ * try {
+ * isPaused = false;
+ * unpaused.signalAll();
+ * } finally {
+ * pauseLock.unlock();
+ * }
+ * }
+ * }
+ * </pre>
+ * @since 1.5
+ * @author Doug Lea
+ */
+public class ThreadPoolExecutor extends AbstractExecutorService {
+ /**
+ * Only used to force toArray() to produce a Runnable[].
+ */
+ private static final Runnable[] EMPTY_RUNNABLE_ARRAY = new Runnable[0];
+
+ /**
+ * Permission for checking shutdown
+ */
+ private static final RuntimePermission shutdownPerm =
+ new RuntimePermission("modifyThread");
+
+ /**
+ * Queue used for holding tasks and handing off to worker threads.
+ */
+ private final BlockingQueue<Runnable> workQueue;
+
+ /**
+ * Lock held on updates to poolSize, corePoolSize, maximumPoolSize, and
+ * workers set.
+ */
+ private final ReentrantLock mainLock = new ReentrantLock();
+
+ /**
+ * Wait condition to support awaitTermination
+ */
+ private final Condition termination = mainLock.newCondition();
+
+ /**
+ * Set containing all worker threads in pool.
+ */
+ private final HashSet<Worker> workers = new HashSet<Worker>();
+
+ /**
+ * Timeout in nanoseconds for idle threads waiting for work.
+ * Threads use this timeout only when there are more than
+ * corePoolSize present. Otherwise they wait forever for new work.
+ */
+ private volatile long keepAliveTime;
+
+ /**
+ * If false (default) core threads stay alive even when idle.
+ * If true, core threads use keepAliveTime to time out waiting for work.
+ */
+ private volatile boolean allowCoreThreadTimeOut;
+
+ /**
+ * Core pool size, updated only while holding mainLock,
+ * but volatile to allow concurrent readability even
+ * during updates.
+ */
+ private volatile int corePoolSize;
+
+ /**
+ * Maximum pool size, updated only while holding mainLock
+ * but volatile to allow concurrent readability even
+ * during updates.
+ */
+ private volatile int maximumPoolSize;
+
+ /**
+ * Current pool size, updated only while holding mainLock
+ * but volatile to allow concurrent readability even
+ * during updates.
+ */
+ private volatile int poolSize;
+
+ /**
+ * Lifecycle state
+ */
+ volatile int runState;
+
+ // Special values for runState
+ /** Normal, not-shutdown mode */
+ static final int RUNNING = 0;
+ /** Controlled shutdown mode */
+ static final int SHUTDOWN = 1;
+ /** Immediate shutdown mode */
+ static final int STOP = 2;
+ /** Final state */
+ static final int TERMINATED = 3;
+
+ /**
+ * Handler called when saturated or shutdown in execute.
+ */
+ private volatile RejectedExecutionHandler handler;
+
+ /**
+ * Factory for new threads.
+ */
+ private volatile ThreadFactory threadFactory;
+
+ /**
+ * Tracks largest attained pool size.
+ */
+ private int largestPoolSize;
+
+ /**
+ * Counter for completed tasks. Updated only on termination of
+ * worker threads.
+ */
+ private long completedTaskCount;
+
+ /**
+ * The default rejected execution handler
+ */
+ private static final RejectedExecutionHandler defaultHandler =
+ new AbortPolicy();
+
+ /**
+ * Invokes the rejected execution handler for the given command.
+ */
+ void reject(Runnable command) {
+ handler.rejectedExecution(command, this);
+ }
+
+ /**
+ * Creates and returns a new thread running firstTask as its first
+ * task. Call only while holding mainLock.
+ * @param firstTask the task the new thread should run first (or
+ * null if none)
+ * @return the new thread, or null if threadFactory fails to create thread
+ */
+ private Thread addThread(Runnable firstTask) {
+ if (runState == TERMINATED) // Don't create thread if terminated
+ return null;
+ Worker w = new Worker(firstTask);
+ Thread t = threadFactory.newThread(w);
+ if (t != null) {
+ w.thread = t;
+ workers.add(w);
+ int nt = ++poolSize;
+ if (nt > largestPoolSize)
+ largestPoolSize = nt;
+ }
+ return t;
+ }
+
+ /**
+ * Creates and starts a new thread running firstTask as its first
+ * task, only if fewer than corePoolSize threads are running.
+ * @param firstTask the task the new thread should run first (or
+ * null if none)
+ * @return true if successful.
+ */
+ private boolean addIfUnderCorePoolSize(Runnable firstTask) {
+ Thread t = null;
+ final ReentrantLock mainLock = this.mainLock;
+ mainLock.lock();
+ try {
+ if (poolSize < corePoolSize)
+ t = addThread(firstTask);
+ } finally {
+ mainLock.unlock();
+ }
+ if (t == null)
+ return false;
+ t.start();
+ return true;
+ }
+
+ /**
+ * Creates and starts a new thread only if fewer than maximumPoolSize
+ * threads are running. The new thread runs as its first task the
+ * next task in queue, or if there is none, the given task.
+ * @param firstTask the task the new thread should run first (or
+ * null if none)
+ * @return 0 if a new thread cannot be created, a positive number
+ * if firstTask will be run in a new thread, or a negative number
+ * if a new thread was created but is running some other task, in
+ * which case the caller must try some other way to run firstTask
+ * (perhaps by calling this method again).
+ */
+ private int addIfUnderMaximumPoolSize(Runnable firstTask) {
+ Thread t = null;
+ int status = 0;
+ final ReentrantLock mainLock = this.mainLock;
+ mainLock.lock();
+ try {
+ if (poolSize < maximumPoolSize) {
+ Runnable next = workQueue.poll();
+ if (next == null) {
+ next = firstTask;
+ status = 1;
+ } else
+ status = -1;
+ t = addThread(next);
+ }
+ } finally {
+ mainLock.unlock();
+ }
+ if (t == null)
+ return 0;
+ t.start();
+ return status;
+ }
+
+
+ /**
+ * Gets the next task for a worker thread to run.
+ * @return the task
+ */
+ Runnable getTask() {
+ for (;;) {
+ try {
+ switch (runState) {
+ case RUNNING: {
+ // untimed wait if core and not allowing core timeout
+ if (poolSize <= corePoolSize && !allowCoreThreadTimeOut)
+ return workQueue.take();
+
+ long timeout = keepAliveTime;
+ if (timeout <= 0) // die immediately for 0 timeout
+ return null;
+ Runnable r = workQueue.poll(timeout, TimeUnit.NANOSECONDS);
+ if (r != null)
+ return r;
+ if (poolSize > corePoolSize || allowCoreThreadTimeOut)
+ return null; // timed out
+ // Else, after timeout, the pool shrank. Retry
+ break;
+ }
+
+ case SHUTDOWN: {
+ // Help drain queue
+ Runnable r = workQueue.poll();
+ if (r != null)
+ return r;
+
+ // Check if can terminate
+ if (workQueue.isEmpty()) {
+ interruptIdleWorkers();
+ return null;
+ }
+
+ // Else there could still be delayed tasks in queue.
+ return workQueue.take();
+ }
+
+ case STOP:
+ return null;
+ default:
+ assert false;
+ }
+ } catch (InterruptedException ie) {
+ // On interruption, re-check runstate
+ }
+ }
+ }
+
+ /**
+ * Wakes up all threads that might be waiting for tasks.
+ */
+ void interruptIdleWorkers() {
+ final ReentrantLock mainLock = this.mainLock;
+ mainLock.lock();
+ try {
+ for (Worker w : workers)
+ w.interruptIfIdle();
+ } finally {
+ mainLock.unlock();
+ }
+ }
+
+ /**
+ * Performs bookkeeping for a terminated worker thread.
+ * @param w the worker
+ */
+ void workerDone(Worker w) {
+ final ReentrantLock mainLock = this.mainLock;
+ mainLock.lock();
+ try {
+ completedTaskCount += w.completedTasks;
+ workers.remove(w);
+ if (--poolSize > 0)
+ return;
+
+ // Else, this is the last thread. Deal with potential shutdown.
+
+ int state = runState;
+ assert state != TERMINATED;
+
+ if (state != STOP) {
+ // If there are queued tasks but no threads, create
+ // replacement thread. We must create it initially
+ // idle to avoid orphaned tasks in case addThread
+ // fails. This also handles case of delayed tasks
+ // that will sometime later become runnable.
+ if (!workQueue.isEmpty()) {
+ Thread t = addThread(null);
+ if (t != null)
+ t.start();
+ return;
+ }
+
+ // Otherwise, we can exit without replacement
+ if (state == RUNNING)
+ return;
+ }
+
+ // Either state is STOP, or state is SHUTDOWN and there is
+ // no work to do. So we can terminate.
+ termination.signalAll();
+ runState = TERMINATED;
+ // fall through to call terminate() outside of lock.
+ } finally {
+ mainLock.unlock();
+ }
+
+ assert runState == TERMINATED;
+ terminated();
+ }
+
+ /**
+ * Worker threads
+ */
+ private class Worker implements Runnable {
+
+ /**
+ * The runLock is acquired and released surrounding each task
+ * execution. It mainly protects against interrupts that are
+ * intended to cancel the worker thread from instead
+ * interrupting the task being run.
+ */
+ private final ReentrantLock runLock = new ReentrantLock();
+
+ /**
+ * Initial task to run before entering run loop
+ */
+ private Runnable firstTask;
+
+ /**
+ * Per thread completed task counter; accumulated
+ * into completedTaskCount upon termination.
+ */
+ volatile long completedTasks;
+
+ /**
+ * Thread this worker is running in. Acts as a final field,
+ * but cannot be set until thread is created.
+ */
+ Thread thread;
+
+ Worker(Runnable firstTask) {
+ this.firstTask = firstTask;
+ }
+
+ boolean isActive() {
+ return runLock.isLocked();
+ }
+
+ /**
+ * Interrupts thread if not running a task.
+ */
+ void interruptIfIdle() {
+ final ReentrantLock runLock = this.runLock;
+ if (runLock.tryLock()) {
+ try {
+ thread.interrupt();
+ } finally {
+ runLock.unlock();
+ }
+ }
+ }
+
+ /**
+ * Interrupts thread even if running a task.
+ */
+ void interruptNow() {
+ thread.interrupt();
+ }
+
+ /**
+ * Runs a single task between before/after methods.
+ */
+ private void runTask(Runnable task) {
+ final ReentrantLock runLock = this.runLock;
+ runLock.lock();
+ try {
+ // If not shutting down then clear an outstanding interrupt.
+ if (runState != STOP &&
+ Thread.interrupted() &&
+ runState == STOP) // Re-interrupt if stopped after clearing
+ thread.interrupt();
+ boolean ran = false;
+ beforeExecute(thread, task);
+ try {
+ task.run();
+ ran = true;
+ afterExecute(task, null);
+ ++completedTasks;
+ } catch (RuntimeException ex) {
+ if (!ran)
+ afterExecute(task, ex);
+ // Else the exception occurred within
+ // afterExecute itself in which case we don't
+ // want to call it again.
+ throw ex;
+ }
+ } finally {
+ runLock.unlock();
+ }
+ }
+
+ /**
+ * Main run loop
+ */
+ public void run() {
+ try {
+ Runnable task = firstTask;
+ firstTask = null;
+ while (task != null || (task = getTask()) != null) {
+ runTask(task);
+ task = null; // unnecessary but can help GC
+ }
+ } finally {
+ workerDone(this);
+ }
+ }
+ }
+
+ // Public methods
+
+ /**
+ * Creates a new <tt>ThreadPoolExecutor</tt> with the given initial
+ * parameters and default thread factory and rejected execution handler.
+ * It may be more convenient to use one of the {@link Executors} factory
+ * methods instead of this general purpose constructor.
+ *
+ * @param corePoolSize the number of threads to keep in the
+ * pool, even if they are idle.
+ * @param maximumPoolSize the maximum number of threads to allow in the
+ * pool.
+ * @param keepAliveTime when the number of threads is greater than
+ * the core, this is the maximum time that excess idle threads
+ * will wait for new tasks before terminating.
+ * @param unit the time unit for the keepAliveTime
+ * argument.
+ * @param workQueue the queue to use for holding tasks before they
+ * are executed. This queue will hold only the <tt>Runnable</tt>
+ * tasks submitted by the <tt>execute</tt> method.
+ * @throws IllegalArgumentException if corePoolSize, or
+ * keepAliveTime less than zero, or if maximumPoolSize less than or
+ * equal to zero, or if corePoolSize greater than maximumPoolSize.
+ * @throws NullPointerException if <tt>workQueue</tt> is null
+ */
+ public ThreadPoolExecutor(int corePoolSize,
+ int maximumPoolSize,
+ long keepAliveTime,
+ TimeUnit unit,
+ BlockingQueue<Runnable> workQueue) {
+ this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue,
+ Executors.defaultThreadFactory(), defaultHandler);
+ }
+
+ /**
+ * Creates a new <tt>ThreadPoolExecutor</tt> with the given initial
+ * parameters and default rejected execution handler.
+ *
+ * @param corePoolSize the number of threads to keep in the
+ * pool, even if they are idle.
+ * @param maximumPoolSize the maximum number of threads to allow in the
+ * pool.
+ * @param keepAliveTime when the number of threads is greater than
+ * the core, this is the maximum time that excess idle threads
+ * will wait for new tasks before terminating.
+ * @param unit the time unit for the keepAliveTime
+ * argument.
+ * @param workQueue the queue to use for holding tasks before they
+ * are executed. This queue will hold only the <tt>Runnable</tt>
+ * tasks submitted by the <tt>execute</tt> method.
+ * @param threadFactory the factory to use when the executor
+ * creates a new thread.
+ * @throws IllegalArgumentException if corePoolSize, or
+ * keepAliveTime less than zero, or if maximumPoolSize less than or
+ * equal to zero, or if corePoolSize greater than maximumPoolSize.
+ * @throws NullPointerException if <tt>workQueue</tt>
+ * or <tt>threadFactory</tt> are null.
+ */
+ public ThreadPoolExecutor(int corePoolSize,
+ int maximumPoolSize,
+ long keepAliveTime,
+ TimeUnit unit,
+ BlockingQueue<Runnable> workQueue,
+ ThreadFactory threadFactory) {
+ this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue,
+ threadFactory, defaultHandler);
+ }
+
+ /**
+ * Creates a new <tt>ThreadPoolExecutor</tt> with the given initial
+ * parameters and default thread factory.
+ *
+ * @param corePoolSize the number of threads to keep in the
+ * pool, even if they are idle.
+ * @param maximumPoolSize the maximum number of threads to allow in the
+ * pool.
+ * @param keepAliveTime when the number of threads is greater than
+ * the core, this is the maximum time that excess idle threads
+ * will wait for new tasks before terminating.
+ * @param unit the time unit for the keepAliveTime
+ * argument.
+ * @param workQueue the queue to use for holding tasks before they
+ * are executed. This queue will hold only the <tt>Runnable</tt>
+ * tasks submitted by the <tt>execute</tt> method.
+ * @param handler the handler to use when execution is blocked
+ * because the thread bounds and queue capacities are reached.
+ * @throws IllegalArgumentException if corePoolSize, or
+ * keepAliveTime less than zero, or if maximumPoolSize less than or
+ * equal to zero, or if corePoolSize greater than maximumPoolSize.
+ * @throws NullPointerException if <tt>workQueue</tt>
+ * or <tt>handler</tt> are null.
+ */
+ public ThreadPoolExecutor(int corePoolSize,
+ int maximumPoolSize,
+ long keepAliveTime,
+ TimeUnit unit,
+ BlockingQueue<Runnable> workQueue,
+ RejectedExecutionHandler handler) {
+ this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue,
+ Executors.defaultThreadFactory(), handler);
+ }
+
+ /**
+ * Creates a new <tt>ThreadPoolExecutor</tt> with the given initial
+ * parameters.
+ *
+ * @param corePoolSize the number of threads to keep in the
+ * pool, even if they are idle.
+ * @param maximumPoolSize the maximum number of threads to allow in the
+ * pool.
+ * @param keepAliveTime when the number of threads is greater than
+ * the core, this is the maximum time that excess idle threads
+ * will wait for new tasks before terminating.
+ * @param unit the time unit for the keepAliveTime
+ * argument.
+ * @param workQueue the queue to use for holding tasks before they
+ * are executed. This queue will hold only the <tt>Runnable</tt>
+ * tasks submitted by the <tt>execute</tt> method.
+ * @param threadFactory the factory to use when the executor
+ * creates a new thread.
+ * @param handler the handler to use when execution is blocked
+ * because the thread bounds and queue capacities are reached.
+ * @throws IllegalArgumentException if corePoolSize, or
+ * keepAliveTime less than zero, or if maximumPoolSize less than or
+ * equal to zero, or if corePoolSize greater than maximumPoolSize.
+ * @throws NullPointerException if <tt>workQueue</tt>
+ * or <tt>threadFactory</tt> or <tt>handler</tt> are null.
+ */
+ public ThreadPoolExecutor(int corePoolSize,
+ int maximumPoolSize,
+ long keepAliveTime,
+ TimeUnit unit,
+ BlockingQueue<Runnable> workQueue,
+ ThreadFactory threadFactory,
+ RejectedExecutionHandler handler) {
+ if (corePoolSize < 0 ||
+ maximumPoolSize <= 0 ||
+ maximumPoolSize < corePoolSize ||
+ keepAliveTime < 0)
+ throw new IllegalArgumentException();
+ if (workQueue == null || threadFactory == null || handler == null)
+ throw new NullPointerException();
+ this.corePoolSize = corePoolSize;
+ this.maximumPoolSize = maximumPoolSize;
+ this.workQueue = workQueue;
+ this.keepAliveTime = unit.toNanos(keepAliveTime);
+ this.threadFactory = threadFactory;
+ this.handler = handler;
+ }
+
+
+ /**
+ * Executes the given task sometime in the future. The task
+ * may execute in a new thread or in an existing pooled thread.
+ *
+ * If the task cannot be submitted for execution, either because this
+ * executor has been shutdown or because its capacity has been reached,
+ * the task is handled by the current <tt>RejectedExecutionHandler</tt>.
+ *
+ * @param command the task to execute
+ * @throws RejectedExecutionException at discretion of
+ * <tt>RejectedExecutionHandler</tt>, if task cannot be accepted
+ * for execution
+ * @throws NullPointerException if command is null
+ */
+ public void execute(Runnable command) {
+ if (command == null)
+ throw new NullPointerException();
+ for (;;) {
+ if (runState != RUNNING) {
+ reject(command);
+ return;
+ }
+ if (poolSize < corePoolSize && addIfUnderCorePoolSize(command))
+ return;
+ if (workQueue.offer(command))
+ return;
+ int status = addIfUnderMaximumPoolSize(command);
+ if (status > 0) // created new thread
+ return;
+ if (status == 0) { // failed to create thread
+ reject(command);
+ return;
+ }
+ // Retry if created a new thread but it is busy with another task
+ }
+ }
+
+ /**
+ * Initiates an orderly shutdown in which previously submitted
+ * tasks are executed, but no new tasks will be
+ * accepted. Invocation has no additional effect if already shut
+ * down.
+ * @throws SecurityException if a security manager exists and
+ * shutting down this ExecutorService may manipulate threads that
+ * the caller is not permitted to modify because it does not hold
+ * {@link java.lang.RuntimePermission}<tt>("modifyThread")</tt>,
+ * or the security manager's <tt>checkAccess</tt> method denies access.
+ */
+ public void shutdown() {
+ // Fail if caller doesn't have modifyThread permission.
+ SecurityManager security = System.getSecurityManager();
+ if (security != null)
+ security.checkPermission(shutdownPerm);
+
+ boolean fullyTerminated = false;
+ final ReentrantLock mainLock = this.mainLock;
+ mainLock.lock();
+ try {
+ if (workers.size() > 0) {
+ // Check if caller can modify worker threads. This
+ // might not be true even if passed above check, if
+ // the SecurityManager treats some threads specially.
+ if (security != null) {
+ for (Worker w: workers)
+ security.checkAccess(w.thread);
+ }
+
+ int state = runState;
+ if (state == RUNNING) // don't override shutdownNow
+ runState = SHUTDOWN;
+
+ try {
+ for (Worker w: workers)
+ w.interruptIfIdle();
+ } catch (SecurityException se) {
+ // If SecurityManager allows above checks, but
+ // then unexpectedly throws exception when
+ // interrupting threads (which it ought not do),
+ // back out as cleanly as we can. Some threads may
+ // have been killed but we remain in non-shutdown
+ // state.
+ runState = state;
+ throw se;
+ }
+ }
+ else { // If no workers, trigger full termination now
+ fullyTerminated = true;
+ runState = TERMINATED;
+ termination.signalAll();
+ }
+ } finally {
+ mainLock.unlock();
+ }
+ if (fullyTerminated)
+ terminated();
+ }
+
+
+ /**
+ * Attempts to stop all actively executing tasks, halts the
+ * processing of waiting tasks, and returns a list of the tasks
+ * that were awaiting execution.
+ *
+ * <p>There are no guarantees beyond best-effort attempts to stop
+ * processing actively executing tasks. This implementation
+ * cancels tasks via {@link Thread#interrupt}, so any task that
+ * fails to respond to interrupts may never terminate.
+ *
+ * @return list of tasks that never commenced execution
+ * @throws SecurityException if a security manager exists and
+ * shutting down this ExecutorService may manipulate threads that
+ * the caller is not permitted to modify because it does not hold
+ * {@link java.lang.RuntimePermission}<tt>("modifyThread")</tt>,
+ * or the security manager's <tt>checkAccess</tt> method denies access.
+ */
+ public List<Runnable> shutdownNow() {
+ // Almost the same code as shutdown()
+ SecurityManager security = System.getSecurityManager();
+ if (security != null)
+ security.checkPermission(shutdownPerm);
+
+ boolean fullyTerminated = false;
+ final ReentrantLock mainLock = this.mainLock;
+ mainLock.lock();
+ try {
+ if (workers.size() > 0) {
+ if (security != null) {
+ for (Worker w: workers)
+ security.checkAccess(w.thread);
+ }
+
+ int state = runState;
+ if (state != TERMINATED)
+ runState = STOP;
+ try {
+ for (Worker w : workers)
+ w.interruptNow();
+ } catch (SecurityException se) {
+ runState = state; // back out;
+ throw se;
+ }
+ }
+ else { // If no workers, trigger full termination now
+ fullyTerminated = true;
+ runState = TERMINATED;
+ termination.signalAll();
+ }
+ } finally {
+ mainLock.unlock();
+ }
+ if (fullyTerminated)
+ terminated();
+ return Arrays.asList(workQueue.toArray(EMPTY_RUNNABLE_ARRAY));
+ }
+
+ public boolean isShutdown() {
+ return runState != RUNNING;
+ }
+
+ /**
+ * Returns true if this executor is in the process of terminating
+ * after <tt>shutdown</tt> or <tt>shutdownNow</tt> but has not
+ * completely terminated. This method may be useful for
+ * debugging. A return of <tt>true</tt> reported a sufficient
+ * period after shutdown may indicate that submitted tasks have
+ * ignored or suppressed interruption, causing this executor not
+ * to properly terminate.
+ * @return true if terminating but not yet terminated.
+ */
+ public boolean isTerminating() {
+ return runState == STOP;
+ }
+
+ public boolean isTerminated() {
+ return runState == TERMINATED;
+ }
+
+ public boolean awaitTermination(long timeout, TimeUnit unit)
+ throws InterruptedException {
+ long nanos = unit.toNanos(timeout);
+ final ReentrantLock mainLock = this.mainLock;
+ mainLock.lock();
+ try {
+ for (;;) {
+ if (runState == TERMINATED)
+ return true;
+ if (nanos <= 0)
+ return false;
+ nanos = termination.awaitNanos(nanos);
+ }
+ } finally {
+ mainLock.unlock();
+ }
+ }
+
+ /**
+ * Invokes <tt>shutdown</tt> when this executor is no longer
+ * referenced.
+ */
+ protected void finalize() {
+ shutdown();
+ }
+
+ /**
+ * Sets the thread factory used to create new threads.
+ *
+ * @param threadFactory the new thread factory
+ * @throws NullPointerException if threadFactory is null
+ * @see #getThreadFactory
+ */
+ public void setThreadFactory(ThreadFactory threadFactory) {
+ if (threadFactory == null)
+ throw new NullPointerException();
+ this.threadFactory = threadFactory;
+ }
+
+ /**
+ * Returns the thread factory used to create new threads.
+ *
+ * @return the current thread factory
+ * @see #setThreadFactory
+ */
+ public ThreadFactory getThreadFactory() {
+ return threadFactory;
+ }
+
+ /**
+ * Sets a new handler for unexecutable tasks.
+ *
+ * @param handler the new handler
+ * @throws NullPointerException if handler is null
+ * @see #getRejectedExecutionHandler
+ */
+ public void setRejectedExecutionHandler(RejectedExecutionHandler handler) {
+ if (handler == null)
+ throw new NullPointerException();
+ this.handler = handler;
+ }
+
+ /**
+ * Returns the current handler for unexecutable tasks.
+ *
+ * @return the current handler
+ * @see #setRejectedExecutionHandler
+ */
+ public RejectedExecutionHandler getRejectedExecutionHandler() {
+ return handler;
+ }
+
+ /**
+ * Returns the task queue used by this executor. Access to the
+ * task queue is intended primarily for debugging and monitoring.
+ * This queue may be in active use. Retrieving the task queue
+ * does not prevent queued tasks from executing.
+ *
+ * @return the task queue
+ */
+ public BlockingQueue<Runnable> getQueue() {
+ return workQueue;
+ }
+
+ /**
+ * Removes this task from the executor's internal queue if it is
+ * present, thus causing it not to be run if it has not already
+ * started.
+ *
+ * <p> This method may be useful as one part of a cancellation
+ * scheme. It may fail to remove tasks that have been converted
+ * into other forms before being placed on the internal queue. For
+ * example, a task entered using <tt>submit</tt> might be
+ * converted into a form that maintains <tt>Future</tt> status.
+ * However, in such cases, method {@link ThreadPoolExecutor#purge}
+ * may be used to remove those Futures that have been cancelled.
+ *
+ * @param task the task to remove
+ * @return true if the task was removed
+ */
+ public boolean remove(Runnable task) {
+ return getQueue().remove(task);
+ }
+
+
+ /**
+ * Tries to remove from the work queue all {@link Future}
+ * tasks that have been cancelled. This method can be useful as a
+ * storage reclamation operation, that has no other impact on
+ * functionality. Cancelled tasks are never executed, but may
+ * accumulate in work queues until worker threads can actively
+ * remove them. Invoking this method instead tries to remove them now.
+ * However, this method may fail to remove tasks in
+ * the presence of interference by other threads.
+ */
+ public void purge() {
+ // Fail if we encounter interference during traversal
+ try {
+ Iterator<Runnable> it = getQueue().iterator();
+ while (it.hasNext()) {
+ Runnable r = it.next();
+ if (r instanceof Future<?>) {
+ Future<?> c = (Future<?>)r;
+ if (c.isCancelled())
+ it.remove();
+ }
+ }
+ }
+ catch (ConcurrentModificationException ex) {
+ return;
+ }
+ }
+
+ /**
+ * Sets the core number of threads. This overrides any value set
+ * in the constructor. If the new value is smaller than the
+ * current value, excess existing threads will be terminated when
+ * they next become idle. If larger, new threads will, if needed,
+ * be started to execute any queued tasks.
+ *
+ * @param corePoolSize the new core size
+ * @throws IllegalArgumentException if <tt>corePoolSize</tt>
+ * less than zero
+ * @see #getCorePoolSize
+ */
+ public void setCorePoolSize(int corePoolSize) {
+ if (corePoolSize < 0)
+ throw new IllegalArgumentException();
+ final ReentrantLock mainLock = this.mainLock;
+ mainLock.lock();
+ try {
+ int extra = this.corePoolSize - corePoolSize;
+ this.corePoolSize = corePoolSize;
+ if (extra < 0) {
+ int n = workQueue.size();
+ // We have to create initially-idle threads here
+ // because we otherwise have no recourse about
+ // what to do with a dequeued task if addThread fails.
+ while (extra++ < 0 && n-- > 0 && poolSize < corePoolSize ) {
+ Thread t = addThread(null);
+ if (t != null)
+ t.start();
+ else
+ break;
+ }
+ }
+ else if (extra > 0 && poolSize > corePoolSize) {
+ Iterator<Worker> it = workers.iterator();
+ while (it.hasNext() &&
+ extra-- > 0 &&
+ poolSize > corePoolSize &&
+ workQueue.remainingCapacity() == 0)
+ it.next().interruptIfIdle();
+ }
+ } finally {
+ mainLock.unlock();
+ }
+ }
+
+ /**
+ * Returns the core number of threads.
+ *
+ * @return the core number of threads
+ * @see #setCorePoolSize
+ */
+ public int getCorePoolSize() {
+ return corePoolSize;
+ }
+
+ /**
+ * Starts a core thread, causing it to idly wait for work. This
+ * overrides the default policy of starting core threads only when
+ * new tasks are executed. This method will return <tt>false</tt>
+ * if all core threads have already been started.
+ * @return true if a thread was started
+ */
+ public boolean prestartCoreThread() {
+ return addIfUnderCorePoolSize(null);
+ }
+
+ /**
+ * Starts all core threads, causing them to idly wait for work. This
+ * overrides the default policy of starting core threads only when
+ * new tasks are executed.
+ * @return the number of threads started.
+ */
+ public int prestartAllCoreThreads() {
+ int n = 0;
+ while (addIfUnderCorePoolSize(null))
+ ++n;
+ return n;
+ }
+
+ /**
+ * Returns true if this pool allows core threads to time out and
+ * terminate if no tasks arrive within the keepAlive time, being
+ * replaced if needed when new tasks arrive. When true, the same
+ * keep-alive policy applying to non-core threads applies also to
+ * core threads. When false (the default), core threads are never
+ * terminated due to lack of incoming tasks.
+ * @return <tt>true</tt> if core threads are allowed to time out,
+ * else <tt>false</tt>
+ *
+ * @since 1.6
+ */
+ public boolean allowsCoreThreadTimeOut() {
+ return allowCoreThreadTimeOut;
+ }
+
+ /**
+ * Sets the policy governing whether core threads may time out and
+ * terminate if no tasks arrive within the keep-alive time, being
+ * replaced if needed when new tasks arrive. When false, core
+ * threads are never terminated due to lack of incoming
+ * tasks. When true, the same keep-alive policy applying to
+ * non-core threads applies also to core threads. To avoid
+ * continual thread replacement, the keep-alive time must be
+ * greater than zero when setting <tt>true</tt>. This method
+ * should in general be called before the pool is actively used.
+ * @param value <tt>true</tt> if should time out, else <tt>false</tt>
+ * @throws IllegalArgumentException if value is <tt>true</tt>
+ * and the current keep-alive time is not greater than zero.
+ *
+ * @since 1.6
+ */
+ public void allowCoreThreadTimeOut(boolean value) {
+ if (value && keepAliveTime <= 0)
+ throw new IllegalArgumentException("Core threads must have nonzero keep alive times");
+
+ allowCoreThreadTimeOut = value;
+ }
+
+ /**
+ * Sets the maximum allowed number of threads. This overrides any
+ * value set in the constructor. If the new value is smaller than
+ * the current value, excess existing threads will be
+ * terminated when they next become idle.
+ *
+ * @param maximumPoolSize the new maximum
+ * @throws IllegalArgumentException if the new maximum is
+ * less than or equal to zero, or
+ * less than the {@linkplain #getCorePoolSize core pool size}
+ * @see #getMaximumPoolSize
+ */
+ public void setMaximumPoolSize(int maximumPoolSize) {
+ if (maximumPoolSize <= 0 || maximumPoolSize < corePoolSize)
+ throw new IllegalArgumentException();
+ final ReentrantLock mainLock = this.mainLock;
+ mainLock.lock();
+ try {
+ int extra = this.maximumPoolSize - maximumPoolSize;
+ this.maximumPoolSize = maximumPoolSize;
+ if (extra > 0 && poolSize > maximumPoolSize) {
+ Iterator<Worker> it = workers.iterator();
+ while (it.hasNext() &&
+ extra > 0 &&
+ poolSize > maximumPoolSize) {
+ it.next().interruptIfIdle();
+ --extra;
+ }
+ }
+ } finally {
+ mainLock.unlock();
+ }
+ }
+
+ /**
+ * Returns the maximum allowed number of threads.
+ *
+ * @return the maximum allowed number of threads
+ * @see #setMaximumPoolSize
+ */
+ public int getMaximumPoolSize() {
+ return maximumPoolSize;
+ }
+
+ /**
+ * Sets the time limit for which threads may remain idle before
+ * being terminated. If there are more than the core number of
+ * threads currently in the pool, after waiting this amount of
+ * time without processing a task, excess threads will be
+ * terminated. This overrides any value set in the constructor.
+ * @param time the time to wait. A time value of zero will cause
+ * excess threads to terminate immediately after executing tasks.
+ * @param unit the time unit of the time argument
+ * @throws IllegalArgumentException if time less than zero or
+ * if time is zero and allowsCoreThreadTimeOut
+ * @see #getKeepAliveTime
+ */
+ public void setKeepAliveTime(long time, TimeUnit unit) {
+ if (time < 0)
+ throw new IllegalArgumentException();
+ if (time == 0 && allowsCoreThreadTimeOut())
+ throw new IllegalArgumentException("Core threads must have nonzero keep alive times");
+ this.keepAliveTime = unit.toNanos(time);
+ }
+
+ /**
+ * Returns the thread keep-alive time, which is the amount of time
+ * which threads in excess of the core pool size may remain
+ * idle before being terminated.
+ *
+ * @param unit the desired time unit of the result
+ * @return the time limit
+ * @see #setKeepAliveTime
+ */
+ public long getKeepAliveTime(TimeUnit unit) {
+ return unit.convert(keepAliveTime, TimeUnit.NANOSECONDS);
+ }
+
+ /* Statistics */
+
+ /**
+ * Returns the current number of threads in the pool.
+ *
+ * @return the number of threads
+ */
+ public int getPoolSize() {
+ return poolSize;
+ }
+
+ /**
+ * Returns the approximate number of threads that are actively
+ * executing tasks.
+ *
+ * @return the number of threads
+ */
+ public int getActiveCount() {
+ final ReentrantLock mainLock = this.mainLock;
+ mainLock.lock();
+ try {
+ int n = 0;
+ for (Worker w : workers) {
+ if (w.isActive())
+ ++n;
+ }
+ return n;
+ } finally {
+ mainLock.unlock();
+ }
+ }
+
+ /**
+ * Returns the largest number of threads that have ever
+ * simultaneously been in the pool.
+ *
+ * @return the number of threads
+ */
+ public int getLargestPoolSize() {
+ final ReentrantLock mainLock = this.mainLock;
+ mainLock.lock();
+ try {
+ return largestPoolSize;
+ } finally {
+ mainLock.unlock();
+ }
+ }
+
+ /**
+ * Returns the approximate total number of tasks that have been
+ * scheduled for execution. Because the states of tasks and
+ * threads may change dynamically during computation, the returned
+ * value is only an approximation, but one that does not ever
+ * decrease across successive calls.
+ *
+ * @return the number of tasks
+ */
+ public long getTaskCount() {
+ final ReentrantLock mainLock = this.mainLock;
+ mainLock.lock();
+ try {
+ long n = completedTaskCount;
+ for (Worker w : workers) {
+ n += w.completedTasks;
+ if (w.isActive())
+ ++n;
+ }
+ return n + workQueue.size();
+ } finally {
+ mainLock.unlock();
+ }
+ }
+
+ /**
+ * Returns the approximate total number of tasks that have
+ * completed execution. Because the states of tasks and threads
+ * may change dynamically during computation, the returned value
+ * is only an approximation, but one that does not ever decrease
+ * across successive calls.
+ *
+ * @return the number of tasks
+ */
+ public long getCompletedTaskCount() {
+ final ReentrantLock mainLock = this.mainLock;
+ mainLock.lock();
+ try {
+ long n = completedTaskCount;
+ for (Worker w : workers)
+ n += w.completedTasks;
+ return n;
+ } finally {
+ mainLock.unlock();
+ }
+ }
+
+ /**
+ * Method invoked prior to executing the given Runnable in the
+ * given thread. This method is invoked by thread <tt>t</tt> that
+ * will execute task <tt>r</tt>, and may be used to re-initialize
+ * ThreadLocals, or to perform logging.
+ *
+ * <p>This implementation does nothing, but may be customized in
+ * subclasses. Note: To properly nest multiple overridings, subclasses
+ * should generally invoke <tt>super.beforeExecute</tt> at the end of
+ * this method.
+ *
+ * @param t the thread that will run task r.
+ * @param r the task that will be executed.
+ */
+ protected void beforeExecute(Thread t, Runnable r) { }
+
+ /**
+ * Method invoked upon completion of execution of the given Runnable.
+ * This method is invoked by the thread that executed the task. If
+ * non-null, the Throwable is the uncaught <tt>RuntimeException</tt>
+ * or <tt>Error</tt> that caused execution to terminate abruptly.
+ *
+ * <p><b>Note:</b> When actions are enclosed in tasks (such as
+ * {@link FutureTask}) either explicitly or via methods such as
+ * <tt>submit</tt>, these task objects catch and maintain
+ * computational exceptions, and so they do not cause abrupt
+ * termination, and the internal exceptions are <em>not</em>
+ * passed to this method.
+ *
+ * <p>This implementation does nothing, but may be customized in
+ * subclasses. Note: To properly nest multiple overridings, subclasses
+ * should generally invoke <tt>super.afterExecute</tt> at the
+ * beginning of this method.
+ *
+ * @param r the runnable that has completed.
+ * @param t the exception that caused termination, or null if
+ * execution completed normally.
+ */
+ protected void afterExecute(Runnable r, Throwable t) { }
+
+ /**
+ * Method invoked when the Executor has terminated. Default
+ * implementation does nothing. Note: To properly nest multiple
+ * overridings, subclasses should generally invoke
+ * <tt>super.terminated</tt> within this method.
+ */
+ protected void terminated() { }
+
+ /**
+ * A handler for rejected tasks that runs the rejected task
+ * directly in the calling thread of the <tt>execute</tt> method,
+ * unless the executor has been shut down, in which case the task
+ * is discarded.
+ */
+ public static class CallerRunsPolicy implements RejectedExecutionHandler {
+ /**
+ * Creates a <tt>CallerRunsPolicy</tt>.
+ */
+ public CallerRunsPolicy() { }
+
+ /**
+ * Executes task r in the caller's thread, unless the executor
+ * has been shut down, in which case the task is discarded.
+ * @param r the runnable task requested to be executed
+ * @param e the executor attempting to execute this task
+ */
+ public void rejectedExecution(Runnable r, ThreadPoolExecutor e) {
+ if (!e.isShutdown()) {
+ r.run();
+ }
+ }
+ }
+
+ /**
+ * A handler for rejected tasks that throws a
+ * <tt>RejectedExecutionException</tt>.
+ */
+ public static class AbortPolicy implements RejectedExecutionHandler {
+ /**
+ * Creates an <tt>AbortPolicy</tt>.
+ */
+ public AbortPolicy() { }
+
+ /**
+ * Always throws RejectedExecutionException.
+ * @param r the runnable task requested to be executed
+ * @param e the executor attempting to execute this task
+ * @throws RejectedExecutionException always.
+ */
+ public void rejectedExecution(Runnable r, ThreadPoolExecutor e) {
+ throw new RejectedExecutionException();
+ }
+ }
+
+ /**
+ * A handler for rejected tasks that silently discards the
+ * rejected task.
+ */
+ public static class DiscardPolicy implements RejectedExecutionHandler {
+ /**
+ * Creates a <tt>DiscardPolicy</tt>.
+ */
+ public DiscardPolicy() { }
+
+ /**
+ * Does nothing, which has the effect of discarding task r.
+ * @param r the runnable task requested to be executed
+ * @param e the executor attempting to execute this task
+ */
+ public void rejectedExecution(Runnable r, ThreadPoolExecutor e) {
+ }
+ }
+
+ /**
+ * A handler for rejected tasks that discards the oldest unhandled
+ * request and then retries <tt>execute</tt>, unless the executor
+ * is shut down, in which case the task is discarded.
+ */
+ public static class DiscardOldestPolicy implements RejectedExecutionHandler {
+ /**
+ * Creates a <tt>DiscardOldestPolicy</tt> for the given executor.
+ */
+ public DiscardOldestPolicy() { }
+
+ /**
+ * Obtains and ignores the next task that the executor
+ * would otherwise execute, if one is immediately available,
+ * and then retries execution of task r, unless the executor
+ * is shut down, in which case task r is instead discarded.
+ * @param r the runnable task requested to be executed
+ * @param e the executor attempting to execute this task
+ */
+ public void rejectedExecution(Runnable r, ThreadPoolExecutor e) {
+ if (!e.isShutdown()) {
+ e.getQueue().poll();
+ e.execute(r);
+ }
+ }
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/TimeUnit.java b/libjava/classpath/external/jsr166/java/util/concurrent/TimeUnit.java
new file mode 100644
index 00000000000..2cd3d06aba1
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/TimeUnit.java
@@ -0,0 +1,331 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * A <tt>TimeUnit</tt> represents time durations at a given unit of
+ * granularity and provides utility methods to convert across units,
+ * and to perform timing and delay operations in these units. A
+ * <tt>TimeUnit</tt> does not maintain time information, but only
+ * helps organize and use time representations that may be maintained
+ * separately across various contexts. A nanosecond is defined as one
+ * thousandth of a microsecond, a microsecond as one thousandth of a
+ * millisecond, a millisecond as one thousandth of a second, a minute
+ * as sixty seconds, an hour as sixty minutes, and a day as twenty four
+ * hours.
+ *
+ * <p>A <tt>TimeUnit</tt> is mainly used to inform time-based methods
+ * how a given timing parameter should be interpreted. For example,
+ * the following code will timeout in 50 milliseconds if the {@link
+ * java.util.concurrent.locks.Lock lock} is not available:
+ *
+ * <pre> Lock lock = ...;
+ * if ( lock.tryLock(50L, TimeUnit.MILLISECONDS) ) ...
+ * </pre>
+ * while this code will timeout in 50 seconds:
+ * <pre>
+ * Lock lock = ...;
+ * if ( lock.tryLock(50L, TimeUnit.SECONDS) ) ...
+ * </pre>
+ *
+ * Note however, that there is no guarantee that a particular timeout
+ * implementation will be able to notice the passage of time at the
+ * same granularity as the given <tt>TimeUnit</tt>.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public enum TimeUnit {
+ NANOSECONDS {
+ public long toNanos(long d) { return d; }
+ public long toMicros(long d) { return d/(C1/C0); }
+ public long toMillis(long d) { return d/(C2/C0); }
+ public long toSeconds(long d) { return d/(C3/C0); }
+ public long toMinutes(long d) { return d/(C4/C0); }
+ public long toHours(long d) { return d/(C5/C0); }
+ public long toDays(long d) { return d/(C6/C0); }
+ public long convert(long d, TimeUnit u) { return u.toNanos(d); }
+ int excessNanos(long d, long m) { return (int)(d - (m*C2)); }
+ },
+ MICROSECONDS {
+ public long toNanos(long d) { return x(d, C1/C0, MAX/(C1/C0)); }
+ public long toMicros(long d) { return d; }
+ public long toMillis(long d) { return d/(C2/C1); }
+ public long toSeconds(long d) { return d/(C3/C1); }
+ public long toMinutes(long d) { return d/(C4/C1); }
+ public long toHours(long d) { return d/(C5/C1); }
+ public long toDays(long d) { return d/(C6/C1); }
+ public long convert(long d, TimeUnit u) { return u.toMicros(d); }
+ int excessNanos(long d, long m) { return (int)((d*C1) - (m*C2)); }
+ },
+ MILLISECONDS {
+ public long toNanos(long d) { return x(d, C2/C0, MAX/(C2/C0)); }
+ public long toMicros(long d) { return x(d, C2/C1, MAX/(C2/C1)); }
+ public long toMillis(long d) { return d; }
+ public long toSeconds(long d) { return d/(C3/C2); }
+ public long toMinutes(long d) { return d/(C4/C2); }
+ public long toHours(long d) { return d/(C5/C2); }
+ public long toDays(long d) { return d/(C6/C2); }
+ public long convert(long d, TimeUnit u) { return u.toMillis(d); }
+ int excessNanos(long d, long m) { return 0; }
+ },
+ SECONDS {
+ public long toNanos(long d) { return x(d, C3/C0, MAX/(C3/C0)); }
+ public long toMicros(long d) { return x(d, C3/C1, MAX/(C3/C1)); }
+ public long toMillis(long d) { return x(d, C3/C2, MAX/(C3/C2)); }
+ public long toSeconds(long d) { return d; }
+ public long toMinutes(long d) { return d/(C4/C3); }
+ public long toHours(long d) { return d/(C5/C3); }
+ public long toDays(long d) { return d/(C6/C3); }
+ public long convert(long d, TimeUnit u) { return u.toSeconds(d); }
+ int excessNanos(long d, long m) { return 0; }
+ },
+ MINUTES {
+ public long toNanos(long d) { return x(d, C4/C0, MAX/(C4/C0)); }
+ public long toMicros(long d) { return x(d, C4/C1, MAX/(C4/C1)); }
+ public long toMillis(long d) { return x(d, C4/C2, MAX/(C4/C2)); }
+ public long toSeconds(long d) { return x(d, C4/C3, MAX/(C4/C3)); }
+ public long toMinutes(long d) { return d; }
+ public long toHours(long d) { return d/(C5/C4); }
+ public long toDays(long d) { return d/(C6/C4); }
+ public long convert(long d, TimeUnit u) { return u.toMinutes(d); }
+ int excessNanos(long d, long m) { return 0; }
+ },
+ HOURS {
+ public long toNanos(long d) { return x(d, C5/C0, MAX/(C5/C0)); }
+ public long toMicros(long d) { return x(d, C5/C1, MAX/(C5/C1)); }
+ public long toMillis(long d) { return x(d, C5/C2, MAX/(C5/C2)); }
+ public long toSeconds(long d) { return x(d, C5/C3, MAX/(C5/C3)); }
+ public long toMinutes(long d) { return x(d, C5/C4, MAX/(C5/C4)); }
+ public long toHours(long d) { return d; }
+ public long toDays(long d) { return d/(C6/C5); }
+ public long convert(long d, TimeUnit u) { return u.toHours(d); }
+ int excessNanos(long d, long m) { return 0; }
+ },
+ DAYS {
+ public long toNanos(long d) { return x(d, C6/C0, MAX/(C6/C0)); }
+ public long toMicros(long d) { return x(d, C6/C1, MAX/(C6/C1)); }
+ public long toMillis(long d) { return x(d, C6/C2, MAX/(C6/C2)); }
+ public long toSeconds(long d) { return x(d, C6/C3, MAX/(C6/C3)); }
+ public long toMinutes(long d) { return x(d, C6/C4, MAX/(C6/C4)); }
+ public long toHours(long d) { return x(d, C6/C5, MAX/(C6/C5)); }
+ public long toDays(long d) { return d; }
+ public long convert(long d, TimeUnit u) { return u.toDays(d); }
+ int excessNanos(long d, long m) { return 0; }
+ };
+
+ // Handy constants for conversion methods
+ static final long C0 = 1L;
+ static final long C1 = C0 * 1000L;
+ static final long C2 = C1 * 1000L;
+ static final long C3 = C2 * 1000L;
+ static final long C4 = C3 * 60L;
+ static final long C5 = C4 * 60L;
+ static final long C6 = C5 * 24L;
+
+ static final long MAX = Long.MAX_VALUE;
+
+ /**
+ * Scale d by m, checking for overflow.
+ * This has a short name to make above code more readable.
+ */
+ static long x(long d, long m, long over) {
+ if (d > over) return Long.MAX_VALUE;
+ if (d < -over) return Long.MIN_VALUE;
+ return d * m;
+ }
+
+ // To maintain full signature compatibility with 1.5, and to improve the
+ // clarity of the generated javadoc (see 6287639: Abstract methods in
+ // enum classes should not be listed as abstract), method convert
+ // etc. are not declared abstract but otherwise act as abstract methods.
+
+ /**
+ * Convert the given time duration in the given unit to this
+ * unit. Conversions from finer to coarser granularities
+ * truncate, so lose precision. For example converting
+ * <tt>999</tt> milliseconds to seconds results in
+ * <tt>0</tt>. Conversions from coarser to finer granularities
+ * with arguments that would numerically overflow saturate to
+ * <tt>Long.MIN_VALUE</tt> if negative or <tt>Long.MAX_VALUE</tt>
+ * if positive.
+ *
+ * <p>For example, to convert 10 minutes to milliseconds, use:
+ * <tt>TimeUnit.MILLISECONDS.convert(10L, TimeUnit.MINUTES)</tt>
+ *
+ * @param sourceDuration the time duration in the given <tt>sourceUnit</tt>
+ * @param sourceUnit the unit of the <tt>sourceDuration</tt> argument
+ * @return the converted duration in this unit,
+ * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
+ * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
+ */
+ public long convert(long sourceDuration, TimeUnit sourceUnit) {
+ throw new AbstractMethodError();
+ }
+
+ /**
+ * Equivalent to <tt>NANOSECONDS.convert(duration, this)</tt>.
+ * @param duration the duration
+ * @return the converted duration,
+ * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
+ * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
+ * @see #convert
+ */
+ public long toNanos(long duration) {
+ throw new AbstractMethodError();
+ }
+
+ /**
+ * Equivalent to <tt>MICROSECONDS.convert(duration, this)</tt>.
+ * @param duration the duration
+ * @return the converted duration,
+ * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
+ * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
+ * @see #convert
+ */
+ public long toMicros(long duration) {
+ throw new AbstractMethodError();
+ }
+
+ /**
+ * Equivalent to <tt>MILLISECONDS.convert(duration, this)</tt>.
+ * @param duration the duration
+ * @return the converted duration,
+ * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
+ * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
+ * @see #convert
+ */
+ public long toMillis(long duration) {
+ throw new AbstractMethodError();
+ }
+
+ /**
+ * Equivalent to <tt>SECONDS.convert(duration, this)</tt>.
+ * @param duration the duration
+ * @return the converted duration,
+ * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
+ * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
+ * @see #convert
+ */
+ public long toSeconds(long duration) {
+ throw new AbstractMethodError();
+ }
+
+ /**
+ * Equivalent to <tt>MINUTES.convert(duration, this)</tt>.
+ * @param duration the duration
+ * @return the converted duration,
+ * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
+ * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
+ * @see #convert
+ * @since 1.6
+ */
+ public long toMinutes(long duration) {
+ throw new AbstractMethodError();
+ }
+
+ /**
+ * Equivalent to <tt>HOURS.convert(duration, this)</tt>.
+ * @param duration the duration
+ * @return the converted duration,
+ * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
+ * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
+ * @see #convert
+ * @since 1.6
+ */
+ public long toHours(long duration) {
+ throw new AbstractMethodError();
+ }
+
+ /**
+ * Equivalent to <tt>DAYS.convert(duration, this)</tt>.
+ * @param duration the duration
+ * @return the converted duration
+ * @see #convert
+ * @since 1.6
+ */
+ public long toDays(long duration) {
+ throw new AbstractMethodError();
+ }
+
+ /**
+ * Utility to compute the excess-nanosecond argument to wait,
+ * sleep, join.
+ * @param d the duration
+ * @param m the number of milliseconds
+ * @return the number of nanoseconds
+ */
+ abstract int excessNanos(long d, long m);
+
+ /**
+ * Performs a timed <tt>Object.wait</tt> using this time unit.
+ * This is a convenience method that converts timeout arguments
+ * into the form required by the <tt>Object.wait</tt> method.
+ *
+ * <p>For example, you could implement a blocking <tt>poll</tt>
+ * method (see {@link BlockingQueue#poll BlockingQueue.poll})
+ * using:
+ *
+ * <pre> public synchronized Object poll(long timeout, TimeUnit unit) throws InterruptedException {
+ * while (empty) {
+ * unit.timedWait(this, timeout);
+ * ...
+ * }
+ * }</pre>
+ *
+ * @param obj the object to wait on
+ * @param timeout the maximum time to wait. If less than
+ * or equal to zero, do not wait at all.
+ * @throws InterruptedException if interrupted while waiting.
+ * @see Object#wait(long, int)
+ */
+ public void timedWait(Object obj, long timeout)
+ throws InterruptedException {
+ if (timeout > 0) {
+ long ms = toMillis(timeout);
+ int ns = excessNanos(timeout, ms);
+ obj.wait(ms, ns);
+ }
+ }
+
+ /**
+ * Performs a timed <tt>Thread.join</tt> using this time unit.
+ * This is a convenience method that converts time arguments into the
+ * form required by the <tt>Thread.join</tt> method.
+ * @param thread the thread to wait for
+ * @param timeout the maximum time to wait. If less than
+ * or equal to zero, do not wait at all.
+ * @throws InterruptedException if interrupted while waiting.
+ * @see Thread#join(long, int)
+ */
+ public void timedJoin(Thread thread, long timeout)
+ throws InterruptedException {
+ if (timeout > 0) {
+ long ms = toMillis(timeout);
+ int ns = excessNanos(timeout, ms);
+ thread.join(ms, ns);
+ }
+ }
+
+ /**
+ * Performs a <tt>Thread.sleep</tt> using this unit.
+ * This is a convenience method that converts time arguments into the
+ * form required by the <tt>Thread.sleep</tt> method.
+ * @param timeout the minimum time to sleep. If less than
+ * or equal to zero, do not sleep at all.
+ * @throws InterruptedException if interrupted while sleeping.
+ * @see Thread#sleep
+ */
+ public void sleep(long timeout) throws InterruptedException {
+ if (timeout > 0) {
+ long ms = toMillis(timeout);
+ int ns = excessNanos(timeout, ms);
+ Thread.sleep(ms, ns);
+ }
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/TimeoutException.java b/libjava/classpath/external/jsr166/java/util/concurrent/TimeoutException.java
new file mode 100644
index 00000000000..8b84f28e55d
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/TimeoutException.java
@@ -0,0 +1,38 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent;
+
+/**
+ * Exception thrown when a blocking operation times out. Blocking
+ * operations for which a timeout is specified need a means to
+ * indicate that the timeout has occurred. For many such operations it
+ * is possible to return a value that indicates timeout; when that is
+ * not possible or desirable then <tt>TimeoutException</tt> should be
+ * declared and thrown.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public class TimeoutException extends Exception {
+ private static final long serialVersionUID = 1900926677490660714L;
+
+ /**
+ * Constructs a <tt>TimeoutException</tt> with no specified detail
+ * message.
+ */
+ public TimeoutException() {}
+
+ /**
+ * Constructs a <tt>TimeoutException</tt> with the specified detail
+ * message.
+ *
+ * @param message the detail message
+ */
+ public TimeoutException(String message) {
+ super(message);
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicBoolean.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicBoolean.java
new file mode 100644
index 00000000000..bd823bd2c23
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicBoolean.java
@@ -0,0 +1,133 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.atomic;
+import sun.misc.Unsafe;
+
+/**
+ * A <tt>boolean</tt> value that may be updated atomically. See the
+ * {@link java.util.concurrent.atomic} package specification for
+ * description of the properties of atomic variables. An
+ * <tt>AtomicBoolean</tt> is used in applications such as atomically
+ * updated flags, and cannot be used as a replacement for a
+ * {@link java.lang.Boolean}.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public class AtomicBoolean implements java.io.Serializable {
+ private static final long serialVersionUID = 4654671469794556979L;
+ // setup to use Unsafe.compareAndSwapInt for updates
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private static final long valueOffset;
+
+ static {
+ try {
+ valueOffset = unsafe.objectFieldOffset
+ (AtomicBoolean.class.getDeclaredField("value"));
+ } catch (Exception ex) { throw new Error(ex); }
+ }
+
+ private volatile int value;
+
+ /**
+ * Creates a new <tt>AtomicBoolean</tt> with the given initial value.
+ *
+ * @param initialValue the initial value
+ */
+ public AtomicBoolean(boolean initialValue) {
+ value = initialValue ? 1 : 0;
+ }
+
+ /**
+ * Creates a new <tt>AtomicBoolean</tt> with initial value <tt>false</tt>.
+ */
+ public AtomicBoolean() {
+ }
+
+ /**
+ * Returns the current value.
+ *
+ * @return the current value
+ */
+ public final boolean get() {
+ return value != 0;
+ }
+
+ /**
+ * Atomically sets the value to the given updated value
+ * if the current value <tt>==</tt> the expected value.
+ *
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful. False return indicates that
+ * the actual value was not equal to the expected value.
+ */
+ public final boolean compareAndSet(boolean expect, boolean update) {
+ int e = expect ? 1 : 0;
+ int u = update ? 1 : 0;
+ return unsafe.compareAndSwapInt(this, valueOffset, e, u);
+ }
+
+ /**
+ * Atomically sets the value to the given updated value
+ * if the current value <tt>==</tt> the expected value.
+ * May fail spuriously and does not provide ordering guarantees,
+ * so is only rarely an appropriate alternative to <tt>compareAndSet</tt>.
+ *
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful.
+ */
+ public boolean weakCompareAndSet(boolean expect, boolean update) {
+ int e = expect ? 1 : 0;
+ int u = update ? 1 : 0;
+ return unsafe.compareAndSwapInt(this, valueOffset, e, u);
+ }
+
+ /**
+ * Unconditionally sets to the given value.
+ *
+ * @param newValue the new value
+ */
+ public final void set(boolean newValue) {
+ value = newValue ? 1 : 0;
+ }
+
+ /**
+ * Eventually sets to the given value.
+ *
+ * @param newValue the new value
+ * @since 1.6
+ */
+ public final void lazySet(boolean newValue) {
+ int v = newValue ? 1 : 0;
+ unsafe.putOrderedInt(this, valueOffset, v);
+ }
+
+ /**
+ * Atomically sets to the given value and returns the previous value.
+ *
+ * @param newValue the new value
+ * @return the previous value
+ */
+ public final boolean getAndSet(boolean newValue) {
+ for (;;) {
+ boolean current = get();
+ if (compareAndSet(current, newValue))
+ return current;
+ }
+ }
+
+ /**
+ * Returns the String representation of the current value.
+ * @return the String representation of the current value.
+ */
+ public String toString() {
+ return Boolean.toString(get());
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicInteger.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicInteger.java
new file mode 100644
index 00000000000..dc4d470c32a
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicInteger.java
@@ -0,0 +1,234 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.atomic;
+import sun.misc.Unsafe;
+
+/**
+ * An <tt>int</tt> value that may be updated atomically. See the
+ * {@link java.util.concurrent.atomic} package specification for
+ * description of the properties of atomic variables. An
+ * <tt>AtomicInteger</tt> is used in applications such as atomically
+ * incremented counters, and cannot be used as a replacement for an
+ * {@link java.lang.Integer}. However, this class does extend
+ * <tt>Number</tt> to allow uniform access by tools and utilities that
+ * deal with numerically-based classes.
+ *
+ * @since 1.5
+ * @author Doug Lea
+*/
+public class AtomicInteger extends Number implements java.io.Serializable {
+ private static final long serialVersionUID = 6214790243416807050L;
+
+ // setup to use Unsafe.compareAndSwapInt for updates
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private static final long valueOffset;
+
+ static {
+ try {
+ valueOffset = unsafe.objectFieldOffset
+ (AtomicInteger.class.getDeclaredField("value"));
+ } catch (Exception ex) { throw new Error(ex); }
+ }
+
+ private volatile int value;
+
+ /**
+ * Creates a new AtomicInteger with the given initial value.
+ *
+ * @param initialValue the initial value
+ */
+ public AtomicInteger(int initialValue) {
+ value = initialValue;
+ }
+
+ /**
+ * Creates a new AtomicInteger with initial value <tt>0</tt>.
+ */
+ public AtomicInteger() {
+ }
+
+ /**
+ * Gets the current value.
+ *
+ * @return the current value
+ */
+ public final int get() {
+ return value;
+ }
+
+ /**
+ * Sets to the given value.
+ *
+ * @param newValue the new value
+ */
+ public final void set(int newValue) {
+ value = newValue;
+ }
+
+ /**
+ * Eventually sets to the given value.
+ *
+ * @param newValue the new value
+ * @since 1.6
+ */
+ public final void lazySet(int newValue) {
+ unsafe.putOrderedInt(this, valueOffset, newValue);
+ }
+
+ /**
+ * Atomically sets to the given value and returns the old value.
+ *
+ * @param newValue the new value
+ * @return the previous value
+ */
+ public final int getAndSet(int newValue) {
+ for (;;) {
+ int current = get();
+ if (compareAndSet(current, newValue))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically sets the value to the given updated value
+ * if the current value <tt>==</tt> the expected value.
+ *
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful. False return indicates that
+ * the actual value was not equal to the expected value.
+ */
+ public final boolean compareAndSet(int expect, int update) {
+ return unsafe.compareAndSwapInt(this, valueOffset, expect, update);
+ }
+
+ /**
+ * Atomically sets the value to the given updated value
+ * if the current value <tt>==</tt> the expected value.
+ * May fail spuriously and does not provide ordering guarantees,
+ * so is only rarely an appropriate alternative to <tt>compareAndSet</tt>.
+ *
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful.
+ */
+ public final boolean weakCompareAndSet(int expect, int update) {
+ return unsafe.compareAndSwapInt(this, valueOffset, expect, update);
+ }
+
+ /**
+ * Atomically increments by one the current value.
+ *
+ * @return the previous value
+ */
+ public final int getAndIncrement() {
+ for (;;) {
+ int current = get();
+ int next = current + 1;
+ if (compareAndSet(current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically decrements by one the current value.
+ *
+ * @return the previous value
+ */
+ public final int getAndDecrement() {
+ for (;;) {
+ int current = get();
+ int next = current - 1;
+ if (compareAndSet(current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically adds the given value to the current value.
+ *
+ * @param delta the value to add
+ * @return the previous value
+ */
+ public final int getAndAdd(int delta) {
+ for (;;) {
+ int current = get();
+ int next = current + delta;
+ if (compareAndSet(current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically increments by one the current value.
+ *
+ * @return the updated value
+ */
+ public final int incrementAndGet() {
+ for (;;) {
+ int current = get();
+ int next = current + 1;
+ if (compareAndSet(current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Atomically decrements by one the current value.
+ *
+ * @return the updated value
+ */
+ public final int decrementAndGet() {
+ for (;;) {
+ int current = get();
+ int next = current - 1;
+ if (compareAndSet(current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Atomically adds the given value to the current value.
+ *
+ * @param delta the value to add
+ * @return the updated value
+ */
+ public final int addAndGet(int delta) {
+ for (;;) {
+ int current = get();
+ int next = current + delta;
+ if (compareAndSet(current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Returns the String representation of the current value.
+ * @return the String representation of the current value.
+ */
+ public String toString() {
+ return Integer.toString(get());
+ }
+
+
+ public int intValue() {
+ return get();
+ }
+
+ public long longValue() {
+ return (long)get();
+ }
+
+ public float floatValue() {
+ return (float)get();
+ }
+
+ public double doubleValue() {
+ return (double)get();
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerArray.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerArray.java
new file mode 100644
index 00000000000..2ad754fda2b
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerArray.java
@@ -0,0 +1,255 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.atomic;
+import sun.misc.Unsafe;
+import java.util.*;
+
+/**
+ * An <tt>int</tt> array in which elements may be updated atomically.
+ * See the {@link java.util.concurrent.atomic} package
+ * specification for description of the properties of atomic
+ * variables.
+ * @since 1.5
+ * @author Doug Lea
+ */
+public class AtomicIntegerArray implements java.io.Serializable {
+ private static final long serialVersionUID = 2862133569453604235L;
+
+ // setup to use Unsafe.compareAndSwapInt for updates
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private static final int base = unsafe.arrayBaseOffset(int[].class);
+ private static final int scale = unsafe.arrayIndexScale(int[].class);
+ private final int[] array;
+
+ private long rawIndex(int i) {
+ if (i < 0 || i >= array.length)
+ throw new IndexOutOfBoundsException("index " + i);
+ return base + i * scale;
+ }
+
+ /**
+ * Creates a new AtomicIntegerArray of given length.
+ *
+ * @param length the length of the array
+ */
+ public AtomicIntegerArray(int length) {
+ array = new int[length];
+ // must perform at least one volatile write to conform to JMM
+ if (length > 0)
+ unsafe.putIntVolatile(array, rawIndex(0), 0);
+ }
+
+ /**
+ * Creates a new AtomicIntegerArray with the same length as, and
+ * all elements copied from, the given array.
+ *
+ * @param array the array to copy elements from
+ * @throws NullPointerException if array is null
+ */
+ public AtomicIntegerArray(int[] array) {
+ if (array == null)
+ throw new NullPointerException();
+ int length = array.length;
+ this.array = new int[length];
+ if (length > 0) {
+ int last = length-1;
+ for (int i = 0; i < last; ++i)
+ this.array[i] = array[i];
+ // Do the last write as volatile
+ unsafe.putIntVolatile(this.array, rawIndex(last), array[last]);
+ }
+ }
+
+ /**
+ * Returns the length of the array.
+ *
+ * @return the length of the array
+ */
+ public final int length() {
+ return array.length;
+ }
+
+ /**
+ * Gets the current value at position <tt>i</tt>.
+ *
+ * @param i the index
+ * @return the current value
+ */
+ public final int get(int i) {
+ return unsafe.getIntVolatile(array, rawIndex(i));
+ }
+
+ /**
+ * Sets the element at position <tt>i</tt> to the given value.
+ *
+ * @param i the index
+ * @param newValue the new value
+ */
+ public final void set(int i, int newValue) {
+ unsafe.putIntVolatile(array, rawIndex(i), newValue);
+ }
+
+ /**
+ * Eventually sets the element at position <tt>i</tt> to the given value.
+ *
+ * @param i the index
+ * @param newValue the new value
+ * @since 1.6
+ */
+ public final void lazySet(int i, int newValue) {
+ unsafe.putOrderedInt(array, rawIndex(i), newValue);
+ }
+
+ /**
+ * Atomically sets the element at position <tt>i</tt> to the given
+ * value and returns the old value.
+ *
+ * @param i the index
+ * @param newValue the new value
+ * @return the previous value
+ */
+ public final int getAndSet(int i, int newValue) {
+ while (true) {
+ int current = get(i);
+ if (compareAndSet(i, current, newValue))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically sets the element at position <tt>i</tt> to the given
+ * updated value if the current value <tt>==</tt> the expected value.
+ *
+ * @param i the index
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful. False return indicates that
+ * the actual value was not equal to the expected value.
+ */
+ public final boolean compareAndSet(int i, int expect, int update) {
+ return unsafe.compareAndSwapInt(array, rawIndex(i),
+ expect, update);
+ }
+
+ /**
+ * Atomically sets the element at position <tt>i</tt> to the given
+ * updated value if the current value <tt>==</tt> the expected value.
+ * May fail spuriously and does not provide ordering guarantees,
+ * so is only rarely an appropriate alternative to <tt>compareAndSet</tt>.
+ *
+ * @param i the index
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful.
+ */
+ public final boolean weakCompareAndSet(int i, int expect, int update) {
+ return compareAndSet(i, expect, update);
+ }
+
+ /**
+ * Atomically increments by one the element at index <tt>i</tt>.
+ *
+ * @param i the index
+ * @return the previous value
+ */
+ public final int getAndIncrement(int i) {
+ while (true) {
+ int current = get(i);
+ int next = current + 1;
+ if (compareAndSet(i, current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically decrements by one the element at index <tt>i</tt>.
+ *
+ * @param i the index
+ * @return the previous value
+ */
+ public final int getAndDecrement(int i) {
+ while (true) {
+ int current = get(i);
+ int next = current - 1;
+ if (compareAndSet(i, current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically adds the given value to the element at index <tt>i</tt>.
+ *
+ * @param i the index
+ * @param delta the value to add
+ * @return the previous value
+ */
+ public final int getAndAdd(int i, int delta) {
+ while (true) {
+ int current = get(i);
+ int next = current + delta;
+ if (compareAndSet(i, current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically increments by one the element at index <tt>i</tt>.
+ *
+ * @param i the index
+ * @return the updated value
+ */
+ public final int incrementAndGet(int i) {
+ while (true) {
+ int current = get(i);
+ int next = current + 1;
+ if (compareAndSet(i, current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Atomically decrements by one the element at index <tt>i</tt>.
+ *
+ * @param i the index
+ * @return the updated value
+ */
+ public final int decrementAndGet(int i) {
+ while (true) {
+ int current = get(i);
+ int next = current - 1;
+ if (compareAndSet(i, current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Atomically adds the given value to the element at index <tt>i</tt>.
+ *
+ * @param i the index
+ * @param delta the value to add
+ * @return the updated value
+ */
+ public final int addAndGet(int i, int delta) {
+ while (true) {
+ int current = get(i);
+ int next = current + delta;
+ if (compareAndSet(i, current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Returns the String representation of the current values of array.
+ * @return the String representation of the current values of array.
+ */
+ public String toString() {
+ if (array.length > 0) // force volatile read
+ get(0);
+ return Arrays.toString(array);
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
new file mode 100644
index 00000000000..102c2a7c9bd
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
@@ -0,0 +1,316 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.atomic;
+import sun.misc.Unsafe;
+import java.lang.reflect.*;
+
+/**
+ * A reflection-based utility that enables atomic updates to
+ * designated <tt>volatile int</tt> fields of designated classes.
+ * This class is designed for use in atomic data structures in which
+ * several fields of the same node are independently subject to atomic
+ * updates.
+ *
+ * <p>Note that the guarantees of the {@code compareAndSet}
+ * method in this class are weaker than in other atomic classes.
+ * Because this class cannot ensure that all uses of the field
+ * are appropriate for purposes of atomic access, it can
+ * guarantee atomicity only with respect to other invocations of
+ * {@code compareAndSet} and {@code set} on the same updater.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <T> The type of the object holding the updatable field
+ */
+public abstract class AtomicIntegerFieldUpdater<T> {
+ /**
+ * Creates and returns an updater for objects with the given field.
+ * The Class argument is needed to check that reflective types and
+ * generic types match.
+ *
+ * @param tclass the class of the objects holding the field
+ * @param fieldName the name of the field to be updated
+ * @return the updater
+ * @throws IllegalArgumentException if the field is not a
+ * volatile integer type
+ * @throws RuntimeException with a nested reflection-based
+ * exception if the class does not hold field or is the wrong type
+ */
+ public static <U> AtomicIntegerFieldUpdater<U> newUpdater(Class<U> tclass, String fieldName) {
+ return new AtomicIntegerFieldUpdaterImpl<U>(tclass, fieldName);
+ }
+
+ /**
+ * Protected do-nothing constructor for use by subclasses.
+ */
+ protected AtomicIntegerFieldUpdater() {
+ }
+
+ /**
+ * Atomically sets the field of the given object managed by this updater
+ * to the given updated value if the current value <tt>==</tt> the
+ * expected value. This method is guaranteed to be atomic with respect to
+ * other calls to <tt>compareAndSet</tt> and <tt>set</tt>, but not
+ * necessarily with respect to other changes in the field.
+ *
+ * @param obj An object whose field to conditionally set
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful
+ * @throws ClassCastException if <tt>obj</tt> is not an instance
+ * of the class possessing the field established in the constructor
+ */
+ public abstract boolean compareAndSet(T obj, int expect, int update);
+
+ /**
+ * Atomically sets the field of the given object managed by this updater
+ * to the given updated value if the current value <tt>==</tt> the
+ * expected value. This method is guaranteed to be atomic with respect to
+ * other calls to <tt>compareAndSet</tt> and <tt>set</tt>, but not
+ * necessarily with respect to other changes in the field.
+ * May fail spuriously and does not provide ordering guarantees,
+ * so is only rarely an appropriate alternative to <tt>compareAndSet</tt>.
+ *
+ * @param obj An object whose field to conditionally set
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful
+ * @throws ClassCastException if <tt>obj</tt> is not an instance
+ * of the class possessing the field established in the constructor
+ */
+ public abstract boolean weakCompareAndSet(T obj, int expect, int update);
+
+ /**
+ * Sets the field of the given object managed by this updater to the
+ * given updated value. This operation is guaranteed to act as a volatile
+ * store with respect to subsequent invocations of
+ * <tt>compareAndSet</tt>.
+ *
+ * @param obj An object whose field to set
+ * @param newValue the new value
+ */
+ public abstract void set(T obj, int newValue);
+
+ /**
+ * Eventually sets the field of the given object managed by this
+ * updater to the given updated value.
+ *
+ * @param obj An object whose field to set
+ * @param newValue the new value
+ * @since 1.6
+ */
+ public abstract void lazySet(T obj, int newValue);
+
+
+ /**
+ * Gets the current value held in the field of the given object managed
+ * by this updater.
+ *
+ * @param obj An object whose field to get
+ * @return the current value
+ */
+ public abstract int get(T obj);
+
+ /**
+ * Atomically sets the field of the given object managed by this updater
+ * to the given value and returns the old value.
+ *
+ * @param obj An object whose field to get and set
+ * @param newValue the new value
+ * @return the previous value
+ */
+ public int getAndSet(T obj, int newValue) {
+ for (;;) {
+ int current = get(obj);
+ if (compareAndSet(obj, current, newValue))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically increments by one the current value of the field of the
+ * given object managed by this updater.
+ *
+ * @param obj An object whose field to get and set
+ * @return the previous value
+ */
+ public int getAndIncrement(T obj) {
+ for (;;) {
+ int current = get(obj);
+ int next = current + 1;
+ if (compareAndSet(obj, current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically decrements by one the current value of the field of the
+ * given object managed by this updater.
+ *
+ * @param obj An object whose field to get and set
+ * @return the previous value
+ */
+ public int getAndDecrement(T obj) {
+ for (;;) {
+ int current = get(obj);
+ int next = current - 1;
+ if (compareAndSet(obj, current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically adds the given value to the current value of the field of
+ * the given object managed by this updater.
+ *
+ * @param obj An object whose field to get and set
+ * @param delta the value to add
+ * @return the previous value
+ */
+ public int getAndAdd(T obj, int delta) {
+ for (;;) {
+ int current = get(obj);
+ int next = current + delta;
+ if (compareAndSet(obj, current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically increments by one the current value of the field of the
+ * given object managed by this updater.
+ *
+ * @param obj An object whose field to get and set
+ * @return the updated value
+ */
+ public int incrementAndGet(T obj) {
+ for (;;) {
+ int current = get(obj);
+ int next = current + 1;
+ if (compareAndSet(obj, current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Atomically decrements by one the current value of the field of the
+ * given object managed by this updater.
+ *
+ * @param obj An object whose field to get and set
+ * @return the updated value
+ */
+ public int decrementAndGet(T obj) {
+ for (;;) {
+ int current = get(obj);
+ int next = current - 1;
+ if (compareAndSet(obj, current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Atomically adds the given value to the current value of the field of
+ * the given object managed by this updater.
+ *
+ * @param obj An object whose field to get and set
+ * @param delta the value to add
+ * @return the updated value
+ */
+ public int addAndGet(T obj, int delta) {
+ for (;;) {
+ int current = get(obj);
+ int next = current + delta;
+ if (compareAndSet(obj, current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Standard hotspot implementation using intrinsics
+ */
+ private static class AtomicIntegerFieldUpdaterImpl<T> extends AtomicIntegerFieldUpdater<T> {
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private final long offset;
+ private final Class<T> tclass;
+ private final Class cclass;
+
+ AtomicIntegerFieldUpdaterImpl(Class<T> tclass, String fieldName) {
+ Field field = null;
+ Class caller = null;
+ int modifiers = 0;
+ try {
+ field = tclass.getDeclaredField(fieldName);
+ caller = sun.reflect.Reflection.getCallerClass(3);
+ modifiers = field.getModifiers();
+ sun.reflect.misc.ReflectUtil.ensureMemberAccess(
+ caller, tclass, null, modifiers);
+ sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+ } catch(Exception ex) {
+ throw new RuntimeException(ex);
+ }
+
+ Class fieldt = field.getType();
+ if (fieldt != int.class)
+ throw new IllegalArgumentException("Must be integer type");
+
+ if (!Modifier.isVolatile(modifiers))
+ throw new IllegalArgumentException("Must be volatile type");
+
+ this.cclass = (Modifier.isProtected(modifiers) &&
+ caller != tclass) ? caller : null;
+ this.tclass = tclass;
+ offset = unsafe.objectFieldOffset(field);
+ }
+
+ private void fullCheck(T obj) {
+ if (!tclass.isInstance(obj))
+ throw new ClassCastException();
+ if (cclass != null)
+ ensureProtectedAccess(obj);
+ }
+
+ public boolean compareAndSet(T obj, int expect, int update) {
+ if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
+ return unsafe.compareAndSwapInt(obj, offset, expect, update);
+ }
+
+ public boolean weakCompareAndSet(T obj, int expect, int update) {
+ if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
+ return unsafe.compareAndSwapInt(obj, offset, expect, update);
+ }
+
+ public void set(T obj, int newValue) {
+ if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
+ unsafe.putIntVolatile(obj, offset, newValue);
+ }
+
+ public void lazySet(T obj, int newValue) {
+ if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
+ unsafe.putOrderedInt(obj, offset, newValue);
+ }
+
+ public final int get(T obj) {
+ if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
+ return unsafe.getIntVolatile(obj, offset);
+ }
+
+ private void ensureProtectedAccess(T obj) {
+ if (cclass.isInstance(obj)) {
+ return;
+ }
+ throw new RuntimeException(
+ new IllegalAccessException("Class " +
+ cclass.getName() +
+ " can not access a protected member of class " +
+ tclass.getName() +
+ " using an instance of " +
+ obj.getClass().getName()
+ )
+ );
+ }
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLong.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLong.java
new file mode 100644
index 00000000000..136dc60fb7d
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLong.java
@@ -0,0 +1,248 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.atomic;
+import sun.misc.Unsafe;
+
+/**
+ * A <tt>long</tt> value that may be updated atomically. See the
+ * {@link java.util.concurrent.atomic} package specification for
+ * description of the properties of atomic variables. An
+ * <tt>AtomicLong</tt> is used in applications such as atomically
+ * incremented sequence numbers, and cannot be used as a replacement
+ * for a {@link java.lang.Long}. However, this class does extend
+ * <tt>Number</tt> to allow uniform access by tools and utilities that
+ * deal with numerically-based classes.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public class AtomicLong extends Number implements java.io.Serializable {
+ private static final long serialVersionUID = 1927816293512124184L;
+
+ // setup to use Unsafe.compareAndSwapLong for updates
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private static final long valueOffset;
+
+ /**
+ * Records whether the underlying JVM supports lockless
+ * CompareAndSet for longs. While the unsafe.CompareAndSetLong
+ * method works in either case, some constructions should be
+ * handled at Java level to avoid locking user-visible locks.
+ */
+ static final boolean VM_SUPPORTS_LONG_CAS = VMSupportsCS8();
+
+ /**
+ * Returns whether underlying JVM supports lockless CompareAndSet
+ * for longs. Called only once and cached in VM_SUPPORTS_LONG_CAS.
+ */
+ private static native boolean VMSupportsCS8();
+
+ static {
+ try {
+ valueOffset = unsafe.objectFieldOffset
+ (AtomicLong.class.getDeclaredField("value"));
+ } catch (Exception ex) { throw new Error(ex); }
+ }
+
+ private volatile long value;
+
+ /**
+ * Creates a new AtomicLong with the given initial value.
+ *
+ * @param initialValue the initial value
+ */
+ public AtomicLong(long initialValue) {
+ value = initialValue;
+ }
+
+ /**
+ * Creates a new AtomicLong with initial value <tt>0</tt>.
+ */
+ public AtomicLong() {
+ }
+
+ /**
+ * Gets the current value.
+ *
+ * @return the current value
+ */
+ public final long get() {
+ return value;
+ }
+
+ /**
+ * Sets to the given value.
+ *
+ * @param newValue the new value
+ */
+ public final void set(long newValue) {
+ value = newValue;
+ }
+
+ /**
+ * Eventually sets to the given value.
+ *
+ * @param newValue the new value
+ * @since 1.6
+ */
+ public final void lazySet(long newValue) {
+ unsafe.putOrderedLong(this, valueOffset, newValue);
+ }
+
+ /**
+ * Atomically sets to the given value and returns the old value.
+ *
+ * @param newValue the new value
+ * @return the previous value
+ */
+ public final long getAndSet(long newValue) {
+ while (true) {
+ long current = get();
+ if (compareAndSet(current, newValue))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically sets the value to the given updated value
+ * if the current value <tt>==</tt> the expected value.
+ *
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful. False return indicates that
+ * the actual value was not equal to the expected value.
+ */
+ public final boolean compareAndSet(long expect, long update) {
+ return unsafe.compareAndSwapLong(this, valueOffset, expect, update);
+ }
+
+ /**
+ * Atomically sets the value to the given updated value
+ * if the current value <tt>==</tt> the expected value.
+ * May fail spuriously and does not provide ordering guarantees,
+ * so is only rarely an appropriate alternative to <tt>compareAndSet</tt>.
+ *
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful.
+ */
+ public final boolean weakCompareAndSet(long expect, long update) {
+ return unsafe.compareAndSwapLong(this, valueOffset, expect, update);
+ }
+
+ /**
+ * Atomically increments by one the current value.
+ *
+ * @return the previous value
+ */
+ public final long getAndIncrement() {
+ while (true) {
+ long current = get();
+ long next = current + 1;
+ if (compareAndSet(current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically decrements by one the current value.
+ *
+ * @return the previous value
+ */
+ public final long getAndDecrement() {
+ while (true) {
+ long current = get();
+ long next = current - 1;
+ if (compareAndSet(current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically adds the given value to the current value.
+ *
+ * @param delta the value to add
+ * @return the previous value
+ */
+ public final long getAndAdd(long delta) {
+ while (true) {
+ long current = get();
+ long next = current + delta;
+ if (compareAndSet(current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically increments by one the current value.
+ *
+ * @return the updated value
+ */
+ public final long incrementAndGet() {
+ for (;;) {
+ long current = get();
+ long next = current + 1;
+ if (compareAndSet(current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Atomically decrements by one the current value.
+ *
+ * @return the updated value
+ */
+ public final long decrementAndGet() {
+ for (;;) {
+ long current = get();
+ long next = current - 1;
+ if (compareAndSet(current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Atomically adds the given value to the current value.
+ *
+ * @param delta the value to add
+ * @return the updated value
+ */
+ public final long addAndGet(long delta) {
+ for (;;) {
+ long current = get();
+ long next = current + delta;
+ if (compareAndSet(current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Returns the String representation of the current value.
+ * @return the String representation of the current value.
+ */
+ public String toString() {
+ return Long.toString(get());
+ }
+
+
+ public int intValue() {
+ return (int)get();
+ }
+
+ public long longValue() {
+ return (long)get();
+ }
+
+ public float floatValue() {
+ return (float)get();
+ }
+
+ public double doubleValue() {
+ return (double)get();
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLongArray.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLongArray.java
new file mode 100644
index 00000000000..c582cba547a
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLongArray.java
@@ -0,0 +1,255 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.atomic;
+import sun.misc.Unsafe;
+import java.util.*;
+
+/**
+ * A <tt>long</tt> array in which elements may be updated atomically.
+ * See the {@link java.util.concurrent.atomic} package specification
+ * for description of the properties of atomic variables.
+ * @since 1.5
+ * @author Doug Lea
+ */
+public class AtomicLongArray implements java.io.Serializable {
+ private static final long serialVersionUID = -2308431214976778248L;
+
+ // setup to use Unsafe.compareAndSwapInt for updates
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private static final int base = unsafe.arrayBaseOffset(long[].class);
+ private static final int scale = unsafe.arrayIndexScale(long[].class);
+ private final long[] array;
+
+ private long rawIndex(int i) {
+ if (i < 0 || i >= array.length)
+ throw new IndexOutOfBoundsException("index " + i);
+ return base + i * scale;
+ }
+
+ /**
+ * Creates a new AtomicLongArray of given length.
+ *
+ * @param length the length of the array
+ */
+ public AtomicLongArray(int length) {
+ array = new long[length];
+ // must perform at least one volatile write to conform to JMM
+ if (length > 0)
+ unsafe.putLongVolatile(array, rawIndex(0), 0);
+ }
+
+ /**
+ * Creates a new AtomicLongArray with the same length as, and
+ * all elements copied from, the given array.
+ *
+ * @param array the array to copy elements from
+ * @throws NullPointerException if array is null
+ */
+ public AtomicLongArray(long[] array) {
+ if (array == null)
+ throw new NullPointerException();
+ int length = array.length;
+ this.array = new long[length];
+ if (length > 0) {
+ int last = length-1;
+ for (int i = 0; i < last; ++i)
+ this.array[i] = array[i];
+ // Do the last write as volatile
+ unsafe.putLongVolatile(this.array, rawIndex(last), array[last]);
+ }
+ }
+
+ /**
+ * Returns the length of the array.
+ *
+ * @return the length of the array
+ */
+ public final int length() {
+ return array.length;
+ }
+
+ /**
+ * Gets the current value at position <tt>i</tt>.
+ *
+ * @param i the index
+ * @return the current value
+ */
+ public final long get(int i) {
+ return unsafe.getLongVolatile(array, rawIndex(i));
+ }
+
+ /**
+ * Sets the element at position <tt>i</tt> to the given value.
+ *
+ * @param i the index
+ * @param newValue the new value
+ */
+ public final void set(int i, long newValue) {
+ unsafe.putLongVolatile(array, rawIndex(i), newValue);
+ }
+
+ /**
+ * Eventually sets the element at position <tt>i</tt> to the given value.
+ *
+ * @param i the index
+ * @param newValue the new value
+ * @since 1.6
+ */
+ public final void lazySet(int i, long newValue) {
+ unsafe.putOrderedLong(array, rawIndex(i), newValue);
+ }
+
+
+ /**
+ * Atomically sets the element at position <tt>i</tt> to the given value
+ * and returns the old value.
+ *
+ * @param i the index
+ * @param newValue the new value
+ * @return the previous value
+ */
+ public final long getAndSet(int i, long newValue) {
+ while (true) {
+ long current = get(i);
+ if (compareAndSet(i, current, newValue))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically sets the value to the given updated value
+ * if the current value <tt>==</tt> the expected value.
+ *
+ * @param i the index
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful. False return indicates that
+ * the actual value was not equal to the expected value.
+ */
+ public final boolean compareAndSet(int i, long expect, long update) {
+ return unsafe.compareAndSwapLong(array, rawIndex(i),
+ expect, update);
+ }
+
+ /**
+ * Atomically sets the value to the given updated value
+ * if the current value <tt>==</tt> the expected value.
+ * May fail spuriously and does not provide ordering guarantees,
+ * so is only rarely an appropriate alternative to <tt>compareAndSet</tt>.
+ *
+ * @param i the index
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful.
+ */
+ public final boolean weakCompareAndSet(int i, long expect, long update) {
+ return compareAndSet(i, expect, update);
+ }
+
+ /**
+ * Atomically increments by one the element at index <tt>i</tt>.
+ *
+ * @param i the index
+ * @return the previous value
+ */
+ public final long getAndIncrement(int i) {
+ while (true) {
+ long current = get(i);
+ long next = current + 1;
+ if (compareAndSet(i, current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically decrements by one the element at index <tt>i</tt>.
+ *
+ * @param i the index
+ * @return the previous value
+ */
+ public final long getAndDecrement(int i) {
+ while (true) {
+ long current = get(i);
+ long next = current - 1;
+ if (compareAndSet(i, current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically adds the given value to the element at index <tt>i</tt>.
+ *
+ * @param i the index
+ * @param delta the value to add
+ * @return the previous value
+ */
+ public final long getAndAdd(int i, long delta) {
+ while (true) {
+ long current = get(i);
+ long next = current + delta;
+ if (compareAndSet(i, current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically increments by one the element at index <tt>i</tt>.
+ *
+ * @param i the index
+ * @return the updated value
+ */
+ public final long incrementAndGet(int i) {
+ while (true) {
+ long current = get(i);
+ long next = current + 1;
+ if (compareAndSet(i, current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Atomically decrements by one the element at index <tt>i</tt>.
+ *
+ * @param i the index
+ * @return the updated value
+ */
+ public final long decrementAndGet(int i) {
+ while (true) {
+ long current = get(i);
+ long next = current - 1;
+ if (compareAndSet(i, current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Atomically adds the given value to the element at index <tt>i</tt>.
+ *
+ * @param i the index
+ * @param delta the value to add
+ * @return the updated value
+ */
+ public long addAndGet(int i, long delta) {
+ while (true) {
+ long current = get(i);
+ long next = current + delta;
+ if (compareAndSet(i, current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Returns the String representation of the current values of array.
+ * @return the String representation of the current values of array.
+ */
+ public String toString() {
+ if (array.length > 0) // force volatile read
+ get(0);
+ return Arrays.toString(array);
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLongFieldUpdater.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
new file mode 100644
index 00000000000..dafd089236e
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
@@ -0,0 +1,406 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.atomic;
+import sun.misc.Unsafe;
+import java.lang.reflect.*;
+
+/**
+ * A reflection-based utility that enables atomic updates to
+ * designated <tt>volatile long</tt> fields of designated classes.
+ * This class is designed for use in atomic data structures in which
+ * several fields of the same node are independently subject to atomic
+ * updates.
+ *
+ * <p>Note that the guarantees of the {@code compareAndSet}
+ * method in this class are weaker than in other atomic classes.
+ * Because this class cannot ensure that all uses of the field
+ * are appropriate for purposes of atomic access, it can
+ * guarantee atomicity only with respect to other invocations of
+ * {@code compareAndSet} and {@code set} on the same updater.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <T> The type of the object holding the updatable field
+ */
+public abstract class AtomicLongFieldUpdater<T> {
+ /**
+ * Creates and returns an updater for objects with the given field.
+ * The Class argument is needed to check that reflective types and
+ * generic types match.
+ *
+ * @param tclass the class of the objects holding the field
+ * @param fieldName the name of the field to be updated.
+ * @return the updater
+ * @throws IllegalArgumentException if the field is not a
+ * volatile long type.
+ * @throws RuntimeException with a nested reflection-based
+ * exception if the class does not hold field or is the wrong type.
+ */
+ public static <U> AtomicLongFieldUpdater<U> newUpdater(Class<U> tclass, String fieldName) {
+ if (AtomicLong.VM_SUPPORTS_LONG_CAS)
+ return new CASUpdater<U>(tclass, fieldName);
+ else
+ return new LockedUpdater<U>(tclass, fieldName);
+ }
+
+ /**
+ * Protected do-nothing constructor for use by subclasses.
+ */
+ protected AtomicLongFieldUpdater() {
+ }
+
+ /**
+ * Atomically sets the field of the given object managed by this updater
+ * to the given updated value if the current value <tt>==</tt> the
+ * expected value. This method is guaranteed to be atomic with respect to
+ * other calls to <tt>compareAndSet</tt> and <tt>set</tt>, but not
+ * necessarily with respect to other changes in the field.
+ *
+ * @param obj An object whose field to conditionally set
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful.
+ * @throws ClassCastException if <tt>obj</tt> is not an instance
+ * of the class possessing the field established in the constructor.
+ */
+ public abstract boolean compareAndSet(T obj, long expect, long update);
+
+ /**
+ * Atomically sets the field of the given object managed by this updater
+ * to the given updated value if the current value <tt>==</tt> the
+ * expected value. This method is guaranteed to be atomic with respect to
+ * other calls to <tt>compareAndSet</tt> and <tt>set</tt>, but not
+ * necessarily with respect to other changes in the field.
+ * May fail spuriously and does not provide ordering guarantees,
+ * so is only rarely an appropriate alternative to <tt>compareAndSet</tt>.
+ *
+ * @param obj An object whose field to conditionally set
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful.
+ * @throws ClassCastException if <tt>obj</tt> is not an instance
+ * of the class possessing the field established in the constructor.
+ */
+ public abstract boolean weakCompareAndSet(T obj, long expect, long update);
+
+ /**
+ * Sets the field of the given object managed by this updater to the
+ * given updated value. This operation is guaranteed to act as a volatile
+ * store with respect to subsequent invocations of
+ * <tt>compareAndSet</tt>.
+ *
+ * @param obj An object whose field to set
+ * @param newValue the new value
+ */
+ public abstract void set(T obj, long newValue);
+
+ /**
+ * Eventually sets the field of the given object managed by this
+ * updater to the given updated value.
+ *
+ * @param obj An object whose field to set
+ * @param newValue the new value
+ * @since 1.6
+ */
+ public abstract void lazySet(T obj, long newValue);
+
+ /**
+ * Gets the current value held in the field of the given object managed
+ * by this updater.
+ *
+ * @param obj An object whose field to get
+ * @return the current value
+ */
+ public abstract long get(T obj);
+
+ /**
+ * Atomically sets the field of the given object managed by this updater
+ * to the given value and returns the old value.
+ *
+ * @param obj An object whose field to get and set
+ * @param newValue the new value
+ * @return the previous value
+ */
+ public long getAndSet(T obj, long newValue) {
+ for (;;) {
+ long current = get(obj);
+ if (compareAndSet(obj, current, newValue))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically increments by one the current value of the field of the
+ * given object managed by this updater.
+ *
+ * @param obj An object whose field to get and set
+ * @return the previous value
+ */
+ public long getAndIncrement(T obj) {
+ for (;;) {
+ long current = get(obj);
+ long next = current + 1;
+ if (compareAndSet(obj, current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically decrements by one the current value of the field of the
+ * given object managed by this updater.
+ *
+ * @param obj An object whose field to get and set
+ * @return the previous value
+ */
+ public long getAndDecrement(T obj) {
+ for (;;) {
+ long current = get(obj);
+ long next = current - 1;
+ if (compareAndSet(obj, current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically adds the given value to the current value of the field of
+ * the given object managed by this updater.
+ *
+ * @param obj An object whose field to get and set
+ * @param delta the value to add
+ * @return the previous value
+ */
+ public long getAndAdd(T obj, long delta) {
+ for (;;) {
+ long current = get(obj);
+ long next = current + delta;
+ if (compareAndSet(obj, current, next))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically increments by one the current value of the field of the
+ * given object managed by this updater.
+ *
+ * @param obj An object whose field to get and set
+ * @return the updated value
+ */
+ public long incrementAndGet(T obj) {
+ for (;;) {
+ long current = get(obj);
+ long next = current + 1;
+ if (compareAndSet(obj, current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Atomically decrements by one the current value of the field of the
+ * given object managed by this updater.
+ *
+ * @param obj An object whose field to get and set
+ * @return the updated value
+ */
+ public long decrementAndGet(T obj) {
+ for (;;) {
+ long current = get(obj);
+ long next = current - 1;
+ if (compareAndSet(obj, current, next))
+ return next;
+ }
+ }
+
+ /**
+ * Atomically adds the given value to the current value of the field of
+ * the given object managed by this updater.
+ *
+ * @param obj An object whose field to get and set
+ * @param delta the value to add
+ * @return the updated value
+ */
+ public long addAndGet(T obj, long delta) {
+ for (;;) {
+ long current = get(obj);
+ long next = current + delta;
+ if (compareAndSet(obj, current, next))
+ return next;
+ }
+ }
+
+ private static class CASUpdater<T> extends AtomicLongFieldUpdater<T> {
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private final long offset;
+ private final Class<T> tclass;
+ private final Class cclass;
+
+ CASUpdater(Class<T> tclass, String fieldName) {
+ Field field = null;
+ Class caller = null;
+ int modifiers = 0;
+ try {
+ field = tclass.getDeclaredField(fieldName);
+ caller = sun.reflect.Reflection.getCallerClass(3);
+ modifiers = field.getModifiers();
+ sun.reflect.misc.ReflectUtil.ensureMemberAccess(
+ caller, tclass, null, modifiers);
+ sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+ } catch(Exception ex) {
+ throw new RuntimeException(ex);
+ }
+
+ Class fieldt = field.getType();
+ if (fieldt != long.class)
+ throw new IllegalArgumentException("Must be long type");
+
+ if (!Modifier.isVolatile(modifiers))
+ throw new IllegalArgumentException("Must be volatile type");
+
+ this.cclass = (Modifier.isProtected(modifiers) &&
+ caller != tclass) ? caller : null;
+ this.tclass = tclass;
+ offset = unsafe.objectFieldOffset(field);
+ }
+
+ private void fullCheck(T obj) {
+ if (!tclass.isInstance(obj))
+ throw new ClassCastException();
+ if (cclass != null)
+ ensureProtectedAccess(obj);
+ }
+
+ public boolean compareAndSet(T obj, long expect, long update) {
+ if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
+ return unsafe.compareAndSwapLong(obj, offset, expect, update);
+ }
+
+ public boolean weakCompareAndSet(T obj, long expect, long update) {
+ if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
+ return unsafe.compareAndSwapLong(obj, offset, expect, update);
+ }
+
+ public void set(T obj, long newValue) {
+ if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
+ unsafe.putLongVolatile(obj, offset, newValue);
+ }
+
+ public void lazySet(T obj, long newValue) {
+ if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
+ unsafe.putOrderedLong(obj, offset, newValue);
+ }
+
+ public long get(T obj) {
+ if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
+ return unsafe.getLongVolatile(obj, offset);
+ }
+
+ private void ensureProtectedAccess(T obj) {
+ if (cclass.isInstance(obj)) {
+ return;
+ }
+ throw new RuntimeException (
+ new IllegalAccessException("Class " +
+ cclass.getName() +
+ " can not access a protected member of class " +
+ tclass.getName() +
+ " using an instance of " +
+ obj.getClass().getName()
+ )
+ );
+ }
+ }
+
+
+ private static class LockedUpdater<T> extends AtomicLongFieldUpdater<T> {
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private final long offset;
+ private final Class<T> tclass;
+ private final Class cclass;
+
+ LockedUpdater(Class<T> tclass, String fieldName) {
+ Field field = null;
+ Class caller = null;
+ int modifiers = 0;
+ try {
+ field = tclass.getDeclaredField(fieldName);
+ caller = sun.reflect.Reflection.getCallerClass(3);
+ modifiers = field.getModifiers();
+ sun.reflect.misc.ReflectUtil.ensureMemberAccess(
+ caller, tclass, null, modifiers);
+ sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+ } catch(Exception ex) {
+ throw new RuntimeException(ex);
+ }
+
+ Class fieldt = field.getType();
+ if (fieldt != long.class)
+ throw new IllegalArgumentException("Must be long type");
+
+ if (!Modifier.isVolatile(modifiers))
+ throw new IllegalArgumentException("Must be volatile type");
+
+ this.cclass = (Modifier.isProtected(modifiers) &&
+ caller != tclass) ? caller : null;
+ this.tclass = tclass;
+ offset = unsafe.objectFieldOffset(field);
+ }
+
+ private void fullCheck(T obj) {
+ if (!tclass.isInstance(obj))
+ throw new ClassCastException();
+ if (cclass != null)
+ ensureProtectedAccess(obj);
+ }
+
+ public boolean compareAndSet(T obj, long expect, long update) {
+ if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
+ synchronized(this) {
+ long v = unsafe.getLong(obj, offset);
+ if (v != expect)
+ return false;
+ unsafe.putLong(obj, offset, update);
+ return true;
+ }
+ }
+
+ public boolean weakCompareAndSet(T obj, long expect, long update) {
+ return compareAndSet(obj, expect, update);
+ }
+
+ public void set(T obj, long newValue) {
+ if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
+ synchronized(this) {
+ unsafe.putLong(obj, offset, newValue);
+ }
+ }
+
+ public void lazySet(T obj, long newValue) {
+ set(obj, newValue);
+ }
+
+ public long get(T obj) {
+ if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
+ synchronized(this) {
+ return unsafe.getLong(obj, offset);
+ }
+ }
+
+ private void ensureProtectedAccess(T obj) {
+ if (cclass.isInstance(obj)) {
+ return;
+ }
+ throw new RuntimeException (
+ new IllegalAccessException("Class " +
+ cclass.getName() +
+ " can not access a protected member of class " +
+ tclass.getName() +
+ " using an instance of " +
+ obj.getClass().getName()
+ )
+ );
+ }
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicMarkableReference.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicMarkableReference.java
new file mode 100644
index 00000000000..85335b737e5
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicMarkableReference.java
@@ -0,0 +1,161 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.atomic;
+
+/**
+ * An <tt>AtomicMarkableReference</tt> maintains an object reference
+ * along with a mark bit, that can be updated atomically.
+ * <p>
+ * <p> Implementation note. This implementation maintains markable
+ * references by creating internal objects representing "boxed"
+ * [reference, boolean] pairs.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <V> The type of object referred to by this reference
+ */
+public class AtomicMarkableReference<V> {
+
+ private static class ReferenceBooleanPair<T> {
+ private final T reference;
+ private final boolean bit;
+ ReferenceBooleanPair(T r, boolean i) {
+ reference = r; bit = i;
+ }
+ }
+
+ private final AtomicReference<ReferenceBooleanPair<V>> atomicRef;
+
+ /**
+ * Creates a new <tt>AtomicMarkableReference</tt> with the given
+ * initial values.
+ *
+ * @param initialRef the initial reference
+ * @param initialMark the initial mark
+ */
+ public AtomicMarkableReference(V initialRef, boolean initialMark) {
+ atomicRef = new AtomicReference<ReferenceBooleanPair<V>> (new ReferenceBooleanPair<V>(initialRef, initialMark));
+ }
+
+ /**
+ * Returns the current value of the reference.
+ *
+ * @return the current value of the reference
+ */
+ public V getReference() {
+ return atomicRef.get().reference;
+ }
+
+ /**
+ * Returns the current value of the mark.
+ *
+ * @return the current value of the mark
+ */
+ public boolean isMarked() {
+ return atomicRef.get().bit;
+ }
+
+ /**
+ * Returns the current values of both the reference and the mark.
+ * Typical usage is <tt>boolean[1] holder; ref = v.get(holder); </tt>.
+ *
+ * @param markHolder an array of size of at least one. On return,
+ * <tt>markholder[0]</tt> will hold the value of the mark.
+ * @return the current value of the reference
+ */
+ public V get(boolean[] markHolder) {
+ ReferenceBooleanPair<V> p = atomicRef.get();
+ markHolder[0] = p.bit;
+ return p.reference;
+ }
+
+ /**
+ * Atomically sets the value of both the reference and mark
+ * to the given update values if the
+ * current reference is <tt>==</tt> to the expected reference
+ * and the current mark is equal to the expected mark.
+ * May fail spuriously and does not provide ordering guarantees,
+ * so is only rarely an appropriate alternative to <tt>compareAndSet</tt>.
+ *
+ * @param expectedReference the expected value of the reference
+ * @param newReference the new value for the reference
+ * @param expectedMark the expected value of the mark
+ * @param newMark the new value for the mark
+ * @return true if successful
+ */
+ public boolean weakCompareAndSet(V expectedReference,
+ V newReference,
+ boolean expectedMark,
+ boolean newMark) {
+ ReferenceBooleanPair<V> current = atomicRef.get();
+ return expectedReference == current.reference &&
+ expectedMark == current.bit &&
+ ((newReference == current.reference && newMark == current.bit) ||
+ atomicRef.weakCompareAndSet(current,
+ new ReferenceBooleanPair<V>(newReference,
+ newMark)));
+ }
+
+ /**
+ * Atomically sets the value of both the reference and mark
+ * to the given update values if the
+ * current reference is <tt>==</tt> to the expected reference
+ * and the current mark is equal to the expected mark.
+ *
+ * @param expectedReference the expected value of the reference
+ * @param newReference the new value for the reference
+ * @param expectedMark the expected value of the mark
+ * @param newMark the new value for the mark
+ * @return true if successful
+ */
+ public boolean compareAndSet(V expectedReference,
+ V newReference,
+ boolean expectedMark,
+ boolean newMark) {
+ ReferenceBooleanPair<V> current = atomicRef.get();
+ return expectedReference == current.reference &&
+ expectedMark == current.bit &&
+ ((newReference == current.reference && newMark == current.bit) ||
+ atomicRef.compareAndSet(current,
+ new ReferenceBooleanPair<V>(newReference,
+ newMark)));
+ }
+
+ /**
+ * Unconditionally sets the value of both the reference and mark.
+ *
+ * @param newReference the new value for the reference
+ * @param newMark the new value for the mark
+ */
+ public void set(V newReference, boolean newMark) {
+ ReferenceBooleanPair<V> current = atomicRef.get();
+ if (newReference != current.reference || newMark != current.bit)
+ atomicRef.set(new ReferenceBooleanPair<V>(newReference, newMark));
+ }
+
+ /**
+ * Atomically sets the value of the mark to the given update value
+ * if the current reference is <tt>==</tt> to the expected
+ * reference. Any given invocation of this operation may fail
+ * (return <tt>false</tt>) spuriously, but repeated invocation
+ * when the current value holds the expected value and no other
+ * thread is also attempting to set the value will eventually
+ * succeed.
+ *
+ * @param expectedReference the expected value of the reference
+ * @param newMark the new value for the mark
+ * @return true if successful
+ */
+ public boolean attemptMark(V expectedReference, boolean newMark) {
+ ReferenceBooleanPair<V> current = atomicRef.get();
+ return expectedReference == current.reference &&
+ (newMark == current.bit ||
+ atomicRef.compareAndSet
+ (current, new ReferenceBooleanPair<V>(expectedReference,
+ newMark)));
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReference.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReference.java
new file mode 100644
index 00000000000..e7c989c2b7e
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReference.java
@@ -0,0 +1,124 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.atomic;
+import sun.misc.Unsafe;
+
+/**
+ * An object reference that may be updated atomically. See the {@link
+ * java.util.concurrent.atomic} package specification for description
+ * of the properties of atomic variables.
+ * @since 1.5
+ * @author Doug Lea
+ * @param <V> The type of object referred to by this reference
+ */
+public class AtomicReference<V> implements java.io.Serializable {
+ private static final long serialVersionUID = -1848883965231344442L;
+
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private static final long valueOffset;
+
+ static {
+ try {
+ valueOffset = unsafe.objectFieldOffset
+ (AtomicReference.class.getDeclaredField("value"));
+ } catch (Exception ex) { throw new Error(ex); }
+ }
+
+ private volatile V value;
+
+ /**
+ * Creates a new AtomicReference with the given initial value.
+ *
+ * @param initialValue the initial value
+ */
+ public AtomicReference(V initialValue) {
+ value = initialValue;
+ }
+
+ /**
+ * Creates a new AtomicReference with null initial value.
+ */
+ public AtomicReference() {
+ }
+
+ /**
+ * Gets the current value.
+ *
+ * @return the current value
+ */
+ public final V get() {
+ return value;
+ }
+
+ /**
+ * Sets to the given value.
+ *
+ * @param newValue the new value
+ */
+ public final void set(V newValue) {
+ value = newValue;
+ }
+
+ /**
+ * Eventually sets to the given value.
+ *
+ * @param newValue the new value
+ * @since 1.6
+ */
+ public final void lazySet(V newValue) {
+ unsafe.putOrderedObject(this, valueOffset, newValue);
+ }
+
+ /**
+ * Atomically sets the value to the given updated value
+ * if the current value <tt>==</tt> the expected value.
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful. False return indicates that
+ * the actual value was not equal to the expected value.
+ */
+ public final boolean compareAndSet(V expect, V update) {
+ return unsafe.compareAndSwapObject(this, valueOffset, expect, update);
+ }
+
+ /**
+ * Atomically sets the value to the given updated value
+ * if the current value <tt>==</tt> the expected value.
+ * May fail spuriously and does not provide ordering guarantees,
+ * so is only rarely an appropriate alternative to <tt>compareAndSet</tt>.
+ *
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful.
+ */
+ public final boolean weakCompareAndSet(V expect, V update) {
+ return unsafe.compareAndSwapObject(this, valueOffset, expect, update);
+ }
+
+ /**
+ * Atomically sets to the given value and returns the old value.
+ *
+ * @param newValue the new value
+ * @return the previous value
+ */
+ public final V getAndSet(V newValue) {
+ while (true) {
+ V x = get();
+ if (compareAndSet(x, newValue))
+ return x;
+ }
+ }
+
+ /**
+ * Returns the String representation of the current value.
+ * @return the String representation of the current value.
+ */
+ public String toString() {
+ return String.valueOf(get());
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReferenceArray.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReferenceArray.java
new file mode 100644
index 00000000000..91b601ed96e
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReferenceArray.java
@@ -0,0 +1,163 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.atomic;
+import sun.misc.Unsafe;
+import java.util.*;
+
+/**
+ * An array of object references in which elements may be updated
+ * atomically. See the {@link java.util.concurrent.atomic} package
+ * specification for description of the properties of atomic
+ * variables.
+ * @since 1.5
+ * @author Doug Lea
+ * @param <E> The base class of elements held in this array
+ */
+public class AtomicReferenceArray<E> implements java.io.Serializable {
+ private static final long serialVersionUID = -6209656149925076980L;
+
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private static final int base = unsafe.arrayBaseOffset(Object[].class);
+ private static final int scale = unsafe.arrayIndexScale(Object[].class);
+ private final Object[] array;
+
+ private long rawIndex(int i) {
+ if (i < 0 || i >= array.length)
+ throw new IndexOutOfBoundsException("index " + i);
+ return base + i * scale;
+ }
+
+ /**
+ * Creates a new AtomicReferenceArray of given length.
+ * @param length the length of the array
+ */
+ public AtomicReferenceArray(int length) {
+ array = new Object[length];
+ // must perform at least one volatile write to conform to JMM
+ if (length > 0)
+ unsafe.putObjectVolatile(array, rawIndex(0), null);
+ }
+
+ /**
+ * Creates a new AtomicReferenceArray with the same length as, and
+ * all elements copied from, the given array.
+ *
+ * @param array the array to copy elements from
+ * @throws NullPointerException if array is null
+ */
+ public AtomicReferenceArray(E[] array) {
+ if (array == null)
+ throw new NullPointerException();
+ int length = array.length;
+ this.array = new Object[length];
+ if (length > 0) {
+ int last = length-1;
+ for (int i = 0; i < last; ++i)
+ this.array[i] = array[i];
+ // Do the last write as volatile
+ E e = array[last];
+ unsafe.putObjectVolatile(this.array, rawIndex(last), e);
+ }
+ }
+
+ /**
+ * Returns the length of the array.
+ *
+ * @return the length of the array
+ */
+ public final int length() {
+ return array.length;
+ }
+
+ /**
+ * Gets the current value at position <tt>i</tt>.
+ *
+ * @param i the index
+ * @return the current value
+ */
+ public final E get(int i) {
+ return (E) unsafe.getObjectVolatile(array, rawIndex(i));
+ }
+
+ /**
+ * Sets the element at position <tt>i</tt> to the given value.
+ *
+ * @param i the index
+ * @param newValue the new value
+ */
+ public final void set(int i, E newValue) {
+ unsafe.putObjectVolatile(array, rawIndex(i), newValue);
+ }
+
+ /**
+ * Eventually sets the element at position <tt>i</tt> to the given value.
+ *
+ * @param i the index
+ * @param newValue the new value
+ * @since 1.6
+ */
+ public final void lazySet(int i, E newValue) {
+ unsafe.putOrderedObject(array, rawIndex(i), newValue);
+ }
+
+
+ /**
+ * Atomically sets the element at position <tt>i</tt> to the given
+ * value and returns the old value.
+ *
+ * @param i the index
+ * @param newValue the new value
+ * @return the previous value
+ */
+ public final E getAndSet(int i, E newValue) {
+ while (true) {
+ E current = get(i);
+ if (compareAndSet(i, current, newValue))
+ return current;
+ }
+ }
+
+ /**
+ * Atomically sets the element at position <tt>i</tt> to the given
+ * updated value if the current value <tt>==</tt> the expected value.
+ * @param i the index
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful. False return indicates that
+ * the actual value was not equal to the expected value.
+ */
+ public final boolean compareAndSet(int i, E expect, E update) {
+ return unsafe.compareAndSwapObject(array, rawIndex(i),
+ expect, update);
+ }
+
+ /**
+ * Atomically sets the element at position <tt>i</tt> to the given
+ * updated value if the current value <tt>==</tt> the expected value.
+ * May fail spuriously and does not provide ordering guarantees,
+ * so is only rarely an appropriate alternative to <tt>compareAndSet</tt>.
+ *
+ * @param i the index
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful.
+ */
+ public final boolean weakCompareAndSet(int i, E expect, E update) {
+ return compareAndSet(i, expect, update);
+ }
+
+ /**
+ * Returns the String representation of the current values of array.
+ * @return the String representation of the current values of array.
+ */
+ public String toString() {
+ if (array.length > 0) // force volatile read
+ get(0);
+ return Arrays.toString(array);
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
new file mode 100644
index 00000000000..5c18eca33cf
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
@@ -0,0 +1,275 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.atomic;
+import sun.misc.Unsafe;
+import java.lang.reflect.*;
+
+/**
+ * A reflection-based utility that enables atomic updates to
+ * designated <tt>volatile</tt> reference fields of designated
+ * classes. This class is designed for use in atomic data structures
+ * in which several reference fields of the same node are
+ * independently subject to atomic updates. For example, a tree node
+ * might be declared as
+ *
+ * <pre>
+ * class Node {
+ * private volatile Node left, right;
+ *
+ * private static final AtomicReferenceFieldUpdater&lt;Node, Node&gt; leftUpdater =
+ * AtomicReferenceFieldUpdater.newUpdater(Node.class, Node.class, "left");
+ * private static AtomicReferenceFieldUpdater&lt;Node, Node&gt; rightUpdater =
+ * AtomicReferenceFieldUpdater.newUpdater(Node.class, Node.class, "right");
+ *
+ * Node getLeft() { return left; }
+ * boolean compareAndSetLeft(Node expect, Node update) {
+ * return leftUpdater.compareAndSet(this, expect, update);
+ * }
+ * // ... and so on
+ * }
+ * </pre>
+ *
+ * <p>Note that the guarantees of the {@code compareAndSet}
+ * method in this class are weaker than in other atomic classes.
+ * Because this class cannot ensure that all uses of the field
+ * are appropriate for purposes of atomic access, it can
+ * guarantee atomicity only with respect to other invocations of
+ * {@code compareAndSet} and {@code set} on the same updater.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <T> The type of the object holding the updatable field
+ * @param <V> The type of the field
+ */
+public abstract class AtomicReferenceFieldUpdater<T, V> {
+
+ /**
+ * Creates and returns an updater for objects with the given field.
+ * The Class arguments are needed to check that reflective types and
+ * generic types match.
+ *
+ * @param tclass the class of the objects holding the field.
+ * @param vclass the class of the field
+ * @param fieldName the name of the field to be updated.
+ * @return the updater
+ * @throws IllegalArgumentException if the field is not a volatile reference type.
+ * @throws RuntimeException with a nested reflection-based
+ * exception if the class does not hold field or is the wrong type.
+ */
+ public static <U, W> AtomicReferenceFieldUpdater<U,W> newUpdater(Class<U> tclass, Class<W> vclass, String fieldName) {
+ return new AtomicReferenceFieldUpdaterImpl<U,W>(tclass,
+ vclass,
+ fieldName);
+ }
+
+ /**
+ * Protected do-nothing constructor for use by subclasses.
+ */
+ protected AtomicReferenceFieldUpdater() {
+ }
+
+ /**
+ * Atomically sets the field of the given object managed by this updater
+ * to the given updated value if the current value <tt>==</tt> the
+ * expected value. This method is guaranteed to be atomic with respect to
+ * other calls to <tt>compareAndSet</tt> and <tt>set</tt>, but not
+ * necessarily with respect to other changes in the field.
+ *
+ * @param obj An object whose field to conditionally set
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful.
+ */
+ public abstract boolean compareAndSet(T obj, V expect, V update);
+
+ /**
+ * Atomically sets the field of the given object managed by this updater
+ * to the given updated value if the current value <tt>==</tt> the
+ * expected value. This method is guaranteed to be atomic with respect to
+ * other calls to <tt>compareAndSet</tt> and <tt>set</tt>, but not
+ * necessarily with respect to other changes in the field.
+ * May fail spuriously and does not provide ordering guarantees,
+ * so is only rarely an appropriate alternative to <tt>compareAndSet</tt>.
+ *
+ * @param obj An object whose field to conditionally set
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful.
+ */
+ public abstract boolean weakCompareAndSet(T obj, V expect, V update);
+
+ /**
+ * Sets the field of the given object managed by this updater to the
+ * given updated value. This operation is guaranteed to act as a volatile
+ * store with respect to subsequent invocations of
+ * <tt>compareAndSet</tt>.
+ *
+ * @param obj An object whose field to set
+ * @param newValue the new value
+ */
+ public abstract void set(T obj, V newValue);
+
+ /**
+ * Eventually sets the field of the given object managed by this
+ * updater to the given updated value.
+ *
+ * @param obj An object whose field to set
+ * @param newValue the new value
+ * @since 1.6
+ */
+ public abstract void lazySet(T obj, V newValue);
+
+ /**
+ * Gets the current value held in the field of the given object managed
+ * by this updater.
+ *
+ * @param obj An object whose field to get
+ * @return the current value
+ */
+ public abstract V get(T obj);
+
+ /**
+ * Atomically sets the field of the given object managed by this updater
+ * to the given value and returns the old value.
+ *
+ * @param obj An object whose field to get and set
+ * @param newValue the new value
+ * @return the previous value
+ */
+ public V getAndSet(T obj, V newValue) {
+ for (;;) {
+ V current = get(obj);
+ if (compareAndSet(obj, current, newValue))
+ return current;
+ }
+ }
+
+ private static final class AtomicReferenceFieldUpdaterImpl<T,V>
+ extends AtomicReferenceFieldUpdater<T,V> {
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private final long offset;
+ private final Class<T> tclass;
+ private final Class<V> vclass;
+ private final Class cclass;
+
+ /*
+ * Internal type checks within all update methods contain
+ * internal inlined optimizations checking for the common
+ * cases where the class is final (in which case a simple
+ * getClass comparison suffices) or is of type Object (in
+ * which case no check is needed because all objects are
+ * instances of Object). The Object case is handled simply by
+ * setting vclass to null in constructor. The targetCheck and
+ * updateCheck methods are invoked when these faster
+ * screenings fail.
+ */
+
+ AtomicReferenceFieldUpdaterImpl(Class<T> tclass,
+ Class<V> vclass,
+ String fieldName) {
+ Field field = null;
+ Class fieldClass = null;
+ Class caller = null;
+ int modifiers = 0;
+ try {
+ field = tclass.getDeclaredField(fieldName);
+ caller = sun.reflect.Reflection.getCallerClass(3);
+ modifiers = field.getModifiers();
+ sun.reflect.misc.ReflectUtil.ensureMemberAccess(
+ caller, tclass, null, modifiers);
+ sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass);
+ fieldClass = field.getType();
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+
+ if (vclass != fieldClass)
+ throw new ClassCastException();
+
+ if (!Modifier.isVolatile(modifiers))
+ throw new IllegalArgumentException("Must be volatile type");
+
+ this.cclass = (Modifier.isProtected(modifiers) &&
+ caller != tclass) ? caller : null;
+ this.tclass = tclass;
+ if (vclass == Object.class)
+ this.vclass = null;
+ else
+ this.vclass = vclass;
+ offset = unsafe.objectFieldOffset(field);
+ }
+
+ void targetCheck(T obj) {
+ if (!tclass.isInstance(obj))
+ throw new ClassCastException();
+ if (cclass != null)
+ ensureProtectedAccess(obj);
+ }
+
+ void updateCheck(T obj, V update) {
+ if (!tclass.isInstance(obj) ||
+ (update != null && vclass != null && !vclass.isInstance(update)))
+ throw new ClassCastException();
+ if (cclass != null)
+ ensureProtectedAccess(obj);
+ }
+
+ public boolean compareAndSet(T obj, V expect, V update) {
+ if (obj == null || obj.getClass() != tclass || cclass != null ||
+ (update != null && vclass != null &&
+ vclass != update.getClass()))
+ updateCheck(obj, update);
+ return unsafe.compareAndSwapObject(obj, offset, expect, update);
+ }
+
+ public boolean weakCompareAndSet(T obj, V expect, V update) {
+ // same implementation as strong form for now
+ if (obj == null || obj.getClass() != tclass || cclass != null ||
+ (update != null && vclass != null &&
+ vclass != update.getClass()))
+ updateCheck(obj, update);
+ return unsafe.compareAndSwapObject(obj, offset, expect, update);
+ }
+
+ public void set(T obj, V newValue) {
+ if (obj == null || obj.getClass() != tclass || cclass != null ||
+ (newValue != null && vclass != null &&
+ vclass != newValue.getClass()))
+ updateCheck(obj, newValue);
+ unsafe.putObjectVolatile(obj, offset, newValue);
+ }
+
+ public void lazySet(T obj, V newValue) {
+ if (obj == null || obj.getClass() != tclass || cclass != null ||
+ (newValue != null && vclass != null &&
+ vclass != newValue.getClass()))
+ updateCheck(obj, newValue);
+ unsafe.putOrderedObject(obj, offset, newValue);
+ }
+
+ public V get(T obj) {
+ if (obj == null || obj.getClass() != tclass || cclass != null)
+ targetCheck(obj);
+ return (V)unsafe.getObjectVolatile(obj, offset);
+ }
+
+ private void ensureProtectedAccess(T obj) {
+ if (cclass.isInstance(obj)) {
+ return;
+ }
+ throw new RuntimeException (
+ new IllegalAccessException("Class " +
+ cclass.getName() +
+ " can not access a protected member of class " +
+ tclass.getName() +
+ " using an instance of " +
+ obj.getClass().getName()
+ )
+ );
+ }
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicStampedReference.java b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicStampedReference.java
new file mode 100644
index 00000000000..558808216ab
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/AtomicStampedReference.java
@@ -0,0 +1,165 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.atomic;
+
+/**
+ * An <tt>AtomicStampedReference</tt> maintains an object reference
+ * along with an integer "stamp", that can be updated atomically.
+ *
+ * <p> Implementation note. This implementation maintains stamped
+ * references by creating internal objects representing "boxed"
+ * [reference, integer] pairs.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ * @param <V> The type of object referred to by this reference
+ */
+public class AtomicStampedReference<V> {
+
+ private static class ReferenceIntegerPair<T> {
+ private final T reference;
+ private final int integer;
+ ReferenceIntegerPair(T r, int i) {
+ reference = r; integer = i;
+ }
+ }
+
+ private final AtomicReference<ReferenceIntegerPair<V>> atomicRef;
+
+ /**
+ * Creates a new <tt>AtomicStampedReference</tt> with the given
+ * initial values.
+ *
+ * @param initialRef the initial reference
+ * @param initialStamp the initial stamp
+ */
+ public AtomicStampedReference(V initialRef, int initialStamp) {
+ atomicRef = new AtomicReference<ReferenceIntegerPair<V>>
+ (new ReferenceIntegerPair<V>(initialRef, initialStamp));
+ }
+
+ /**
+ * Returns the current value of the reference.
+ *
+ * @return the current value of the reference
+ */
+ public V getReference() {
+ return atomicRef.get().reference;
+ }
+
+ /**
+ * Returns the current value of the stamp.
+ *
+ * @return the current value of the stamp
+ */
+ public int getStamp() {
+ return atomicRef.get().integer;
+ }
+
+ /**
+ * Returns the current values of both the reference and the stamp.
+ * Typical usage is <tt>int[1] holder; ref = v.get(holder); </tt>.
+ *
+ * @param stampHolder an array of size of at least one. On return,
+ * <tt>stampholder[0]</tt> will hold the value of the stamp.
+ * @return the current value of the reference
+ */
+ public V get(int[] stampHolder) {
+ ReferenceIntegerPair<V> p = atomicRef.get();
+ stampHolder[0] = p.integer;
+ return p.reference;
+ }
+
+ /**
+ * Atomically sets the value of both the reference and stamp
+ * to the given update values if the
+ * current reference is <tt>==</tt> to the expected reference
+ * and the current stamp is equal to the expected stamp.
+ * May fail spuriously and does not provide ordering guarantees,
+ * so is only rarely an appropriate alternative to <tt>compareAndSet</tt>.
+ *
+ * @param expectedReference the expected value of the reference
+ * @param newReference the new value for the reference
+ * @param expectedStamp the expected value of the stamp
+ * @param newStamp the new value for the stamp
+ * @return true if successful
+ */
+ public boolean weakCompareAndSet(V expectedReference,
+ V newReference,
+ int expectedStamp,
+ int newStamp) {
+ ReferenceIntegerPair<V> current = atomicRef.get();
+ return expectedReference == current.reference &&
+ expectedStamp == current.integer &&
+ ((newReference == current.reference &&
+ newStamp == current.integer) ||
+ atomicRef.weakCompareAndSet(current,
+ new ReferenceIntegerPair<V>(newReference,
+ newStamp)));
+ }
+
+ /**
+ * Atomically sets the value of both the reference and stamp
+ * to the given update values if the
+ * current reference is <tt>==</tt> to the expected reference
+ * and the current stamp is equal to the expected stamp.
+ *
+ * @param expectedReference the expected value of the reference
+ * @param newReference the new value for the reference
+ * @param expectedStamp the expected value of the stamp
+ * @param newStamp the new value for the stamp
+ * @return true if successful
+ */
+ public boolean compareAndSet(V expectedReference,
+ V newReference,
+ int expectedStamp,
+ int newStamp) {
+ ReferenceIntegerPair<V> current = atomicRef.get();
+ return expectedReference == current.reference &&
+ expectedStamp == current.integer &&
+ ((newReference == current.reference &&
+ newStamp == current.integer) ||
+ atomicRef.compareAndSet(current,
+ new ReferenceIntegerPair<V>(newReference,
+ newStamp)));
+ }
+
+
+ /**
+ * Unconditionally sets the value of both the reference and stamp.
+ *
+ * @param newReference the new value for the reference
+ * @param newStamp the new value for the stamp
+ */
+ public void set(V newReference, int newStamp) {
+ ReferenceIntegerPair<V> current = atomicRef.get();
+ if (newReference != current.reference || newStamp != current.integer)
+ atomicRef.set(new ReferenceIntegerPair<V>(newReference, newStamp));
+ }
+
+ /**
+ * Atomically sets the value of the stamp to the given update value
+ * if the current reference is <tt>==</tt> to the expected
+ * reference. Any given invocation of this operation may fail
+ * (return <tt>false</tt>) spuriously, but repeated invocation
+ * when the current value holds the expected value and no other
+ * thread is also attempting to set the value will eventually
+ * succeed.
+ *
+ * @param expectedReference the expected value of the reference
+ * @param newStamp the new value for the stamp
+ * @return true if successful
+ */
+ public boolean attemptStamp(V expectedReference, int newStamp) {
+ ReferenceIntegerPair<V> current = atomicRef.get();
+ return expectedReference == current.reference &&
+ (newStamp == current.integer ||
+ atomicRef.compareAndSet(current,
+ new ReferenceIntegerPair<V>(expectedReference,
+ newStamp)));
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/atomic/package.html b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/package.html
new file mode 100644
index 00000000000..6bc191ddf01
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/atomic/package.html
@@ -0,0 +1,158 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html> <head>
+<title>Atomics</title>
+</head>
+
+<body>
+
+A small toolkit of classes that support lock-free thread-safe
+programming on single variables. In essence, the classes in this
+package extend the notion of <tt>volatile</tt> values, fields, and
+array elements to those that also provide an atomic conditional update
+operation of the form:
+
+<pre>
+ boolean compareAndSet(expectedValue, updateValue);
+</pre>
+
+<p> This method (which varies in argument types across different
+classes) atomically sets a variable to the <tt>updateValue</tt> if it
+currently holds the <tt>expectedValue</tt>, reporting <tt>true</tt> on
+success. The classes in this package also contain methods to get and
+unconditionally set values, as well as a weaker conditional atomic
+update operation <tt>weakCompareAndSet</tt> desribed below.
+
+<p> The specifications of these methods enable implementations to
+employ efficient machine-level atomic instructions that are available
+on contemporary processors. However on some platforms, support may
+entail some form of internal locking. Thus the methods are not
+strictly guaranteed to be non-blocking --
+a thread may block transiently before performing the operation.
+
+<p> Instances of classes {@link
+java.util.concurrent.atomic.AtomicBoolean}, {@link
+java.util.concurrent.atomic.AtomicInteger}, {@link
+java.util.concurrent.atomic.AtomicLong}, and {@link
+java.util.concurrent.atomic.AtomicReference} each provide access and
+updates to a single variable of the corresponding type. Each class
+also provides appropriate utility methods for that type. For example,
+classes <tt>AtomicLong</tt> and <tt>AtomicInteger</tt> provide atomic
+increment methods. One application is to generate sequence numbers,
+as in:
+
+<pre>
+class Sequencer {
+ private AtomicLong sequenceNumber = new AtomicLong(0);
+ public long next() { return sequenceNumber.getAndIncrement(); }
+}
+</pre>
+
+<p>The memory effects for accesses and updates of atomics generally
+follow the rules for volatiles, as stated in <a
+href="http://java.sun.com/docs/books/jls/"> The Java Language
+Specification, Third Edition (17.4 Memory Model)</a>:
+
+<ul>
+
+ <li> <tt>get</tt> has the memory effects of reading a
+<tt>volatile</tt> variable.
+
+ <li> <tt>set</tt> has the memory effects of writing (assigning) a
+<tt>volatile</tt> variable.
+
+ <li> <tt>lazySet</tt> has the memory effects of writing (assigning)
+ a <tt>volatile</tt> variable except that it permits reorderings with
+ subsequent (but not previous) memory actions that do not themselves
+ impose reordering constraints with ordinary non-<tt>volatile</tt>
+ writes. Among other usage contexts, <tt>lazySet</tt> may apply when
+ nulling out, for the sake of garbage collection, a reference that is
+ never accessed again.
+
+ <li><tt>weakCompareAndSet</tt> atomically reads and conditionally
+ writes a variable but does <em>not</em>
+ create any happens-before orderings, so provides no guarantees
+ with respect to previous or subsequent reads and writes of any
+ variables other than the target of the <tt>weakCompareAndSet</tt>.
+
+ <li> <tt>compareAndSet</tt>
+ and all other read-and-update operations such as <tt>getAndIncrement</tt>
+ have the memory effects of both reading and
+ writing <tt>volatile</tt> variables.
+</ul>
+
+<p>In addition to classes representing single values, this package
+contains <em>Updater</em> classes that can be used to obtain
+<tt>compareAndSet</tt> operations on any selected <tt>volatile</tt>
+field of any selected class. {@link
+java.util.concurrent.atomic.AtomicReferenceFieldUpdater}, {@link
+java.util.concurrent.atomic.AtomicIntegerFieldUpdater}, and {@link
+java.util.concurrent.atomic.AtomicLongFieldUpdater} are
+reflection-based utilities that provide access to the associated field
+types. These are mainly of use in atomic data structures in which
+several <tt>volatile</tt> fields of the same node (for example, the
+links of a tree node) are independently subject to atomic
+updates. These classes enable greater flexibility in how and when to
+use atomic updates, at the expense of more awkward reflection-based
+setup, less convenient usage, and weaker guarantees.
+
+<p>The {@link java.util.concurrent.atomic.AtomicIntegerArray}, {@link
+java.util.concurrent.atomic.AtomicLongArray}, and {@link
+java.util.concurrent.atomic.AtomicReferenceArray} classes further
+extend atomic operation support to arrays of these types. These
+classes are also notable in providing <tt>volatile</tt> access
+semantics for their array elements, which is not supported for
+ordinary arrays.
+
+<p>The atomic classes also support method <tt>weakCompareAndSet</tt>,
+which has limited applicability. On some platforms, the weak version
+may be more efficient than <tt>compareAndSet</tt> in the normal case,
+but differs in that any given invocation of <tt>weakCompareAndSet</tt>
+method may return <tt>false</tt> spuriously (that is, for no apparent
+reason). A <tt>false</tt> return means only that the operation may be
+retried if desired, relying on the guarantee that repeated invocation
+when the variable holds <tt>expectedValue</tt> and no other thread is
+also attempting to set the variable will eventually succeed. (Such
+spurious failures may for example be due to memory contention effects
+that are unrelated to whether the expected and current values are
+equal.) Additionally <tt>weakCompareAndSet</tt> does not provide
+ordering guarantees that are usually needed for synchronization
+control. However, the method may be useful for updating counters and
+statistics when such updates are unrelated to the other happens-before
+orderings of a program. When a thread sees an update to an atomic
+variable caused by a <tt>weakCompareAndSet</tt>, it does not
+necessarily see updates to any <em>other</em> variables that occurred
+before the <tt>weakCompareAndSet</tt>. This may be acceptable when
+for example updating performance statistics, but rarely otherwise.
+
+<p> The {@link java.util.concurrent.atomic.AtomicMarkableReference}
+class associates a single boolean with a reference. For example, this
+bit might be used inside a data structure to mean that the object
+being referenced has logically been deleted. The {@link
+java.util.concurrent.atomic.AtomicStampedReference} class associates
+an integer value with a reference. This may be used for example, to
+represent version numbers corresponding to series of updates.
+
+<p> Atomic classes are designed primarily as building blocks for
+implementing non-blocking data structures and related infrastructure
+classes. The <tt>compareAndSet</tt> method is not a general
+replacement for locking. It applies only when critical updates for an
+object are confined to a <em>single</em> variable.
+
+<p> Atomic classes are not general purpose replacements for
+<tt>java.lang.Integer</tt> and related classes. They do <em>not</em>
+define methods such as <tt>hashCode</tt> and
+<tt>compareTo</tt>. (Because atomic variables are expected to be
+mutated, they are poor choices for hash table keys.) Additionally,
+classes are provided only for those types that are commonly useful in
+intended applications. For example, there is no atomic class for
+representing <tt>byte</tt>. In those infrequent cases where you would
+like to do so, you can use an <tt>AtomicInteger</tt> to hold
+<tt>byte</tt> values, and cast appropriately. You can also hold floats
+using <tt>Float.floatToIntBits</tt> and <tt>Float.intBitstoFloat</tt>
+conversions, and doubles using <tt>Double.doubleToLongBits</tt> and
+<tt>Double.longBitsToDouble</tt> conversions.
+
+
+@since 1.5
+
+</body> </html>
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/locks/AbstractOwnableSynchronizer.java b/libjava/classpath/external/jsr166/java/util/concurrent/locks/AbstractOwnableSynchronizer.java
new file mode 100644
index 00000000000..f3780e5a692
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/locks/AbstractOwnableSynchronizer.java
@@ -0,0 +1,57 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.locks;
+
+/**
+ * A synchronizer that may be exclusively owned by a thread. This
+ * class provides a basis for creating locks and related synchronizers
+ * that may entail a notion of ownership. The
+ * <tt>AbstractOwnableSynchronizer</tt> class itself does not manage or
+ * use this information. However, subclasses and tools may use
+ * appropriately maintained values to help control and monitor access
+ * and provide diagnostics.
+ *
+ * @since 1.6
+ * @author Doug Lea
+ */
+public abstract class AbstractOwnableSynchronizer
+ implements java.io.Serializable {
+
+ /** Use serial ID even though all fields transient. */
+ private static final long serialVersionUID = 3737899427754241961L;
+
+ /**
+ * Empty constructor for use by subclasses.
+ */
+ protected AbstractOwnableSynchronizer() { }
+
+ /**
+ * The current owner of exclusive mode synchronization.
+ */
+ private transient Thread exclusiveOwnerThread;
+
+ /**
+ * Sets the thread that currently owns exclusive access. A
+ * <tt>null</tt> argument indicates that no thread owns access.
+ * This method does not otherwise impose any synchronization or
+ * <tt>volatile</tt> field accesses.
+ */
+ protected final void setExclusiveOwnerThread(Thread t) {
+ exclusiveOwnerThread = t;
+ }
+
+ /**
+ * Returns the thread last set by
+ * <tt>setExclusiveOwnerThread</tt>, or <tt>null</tt> if never
+ * set. This method does not otherwise impose any synchronization
+ * or <tt>volatile</tt> field accesses.
+ * @return the owner thread
+ */
+ protected final Thread getExclusiveOwnerThread() {
+ return exclusiveOwnerThread;
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java b/libjava/classpath/external/jsr166/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java
new file mode 100644
index 00000000000..88a4354bc71
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java
@@ -0,0 +1,1934 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.locks;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+import sun.misc.Unsafe;
+
+/**
+ * A version of {@link AbstractQueuedSynchronizer} in
+ * which synchronization state is maintained as a <tt>long</tt>.
+ * This class has exactly the same structure, properties, and methods
+ * as <tt>AbstractQueuedSynchronizer</tt> with the exception
+ * that all state-related parameters and results are defined
+ * as <tt>long</tt> rather than <tt>int</tt>. This class
+ * may be useful when creating synchronizers such as
+ * multilevel locks and barriers that require
+ * 64 bits of state.
+ *
+ * <p>See {@link AbstractQueuedSynchronizer} for usage
+ * notes and examples.
+ *
+ * @since 1.6
+ * @author Doug Lea
+ */
+public abstract class AbstractQueuedLongSynchronizer
+ extends AbstractOwnableSynchronizer
+ implements java.io.Serializable {
+
+ private static final long serialVersionUID = 7373984972572414692L;
+
+ /*
+ To keep sources in sync, the remainder of this source file is
+ exactly cloned from AbstractQueuedSynchronizer, replacing class
+ name and changing ints related with sync state to longs. Please
+ keep it that way.
+ */
+
+ /**
+ * Creates a new <tt>AbstractQueuedLongSynchronizer</tt> instance
+ * with initial synchronization state of zero.
+ */
+ protected AbstractQueuedLongSynchronizer() { }
+
+ /**
+ * Wait queue node class.
+ *
+ * <p>The wait queue is a variant of a "CLH" (Craig, Landin, and
+ * Hagersten) lock queue. CLH locks are normally used for
+ * spinlocks. We instead use them for blocking synchronizers, but
+ * use the same basic tactic of holding some of the control
+ * information about a thread in the predecessor of its node. A
+ * "status" field in each node keeps track of whether a thread
+ * should block. A node is signalled when its predecessor
+ * releases. Each node of the queue otherwise serves as a
+ * specific-notification-style monitor holding a single waiting
+ * thread. The status field does NOT control whether threads are
+ * granted locks etc though. A thread may try to acquire if it is
+ * first in the queue. But being first does not guarantee success;
+ * it only gives the right to contend. So the currently released
+ * contender thread may need to rewait.
+ *
+ * <p>To enqueue into a CLH lock, you atomically splice it in as new
+ * tail. To dequeue, you just set the head field.
+ * <pre>
+ * +------+ prev +-----+ +-----+
+ * head | | <---- | | <---- | | tail
+ * +------+ +-----+ +-----+
+ * </pre>
+ *
+ * <p>Insertion into a CLH queue requires only a single atomic
+ * operation on "tail", so there is a simple atomic point of
+ * demarcation from unqueued to queued. Similarly, dequeing
+ * involves only updating the "head". However, it takes a bit
+ * more work for nodes to determine who their successors are,
+ * in part to deal with possible cancellation due to timeouts
+ * and interrupts.
+ *
+ * <p>The "prev" links (not used in original CLH locks), are mainly
+ * needed to handle cancellation. If a node is cancelled, its
+ * successor is (normally) relinked to a non-cancelled
+ * predecessor. For explanation of similar mechanics in the case
+ * of spin locks, see the papers by Scott and Scherer at
+ * http://www.cs.rochester.edu/u/scott/synchronization/
+ *
+ * <p>We also use "next" links to implement blocking mechanics.
+ * The thread id for each node is kept in its own node, so a
+ * predecessor signals the next node to wake up by traversing
+ * next link to determine which thread it is. Determination of
+ * successor must avoid races with newly queued nodes to set
+ * the "next" fields of their predecessors. This is solved
+ * when necessary by checking backwards from the atomically
+ * updated "tail" when a node's successor appears to be null.
+ * (Or, said differently, the next-links are an optimization
+ * so that we don't usually need a backward scan.)
+ *
+ * <p>Cancellation introduces some conservatism to the basic
+ * algorithms. Since we must poll for cancellation of other
+ * nodes, we can miss noticing whether a cancelled node is
+ * ahead or behind us. This is dealt with by always unparking
+ * successors upon cancellation, allowing them to stabilize on
+ * a new predecessor.
+ *
+ * <p>CLH queues need a dummy header node to get started. But
+ * we don't create them on construction, because it would be wasted
+ * effort if there is never contention. Instead, the node
+ * is constructed and head and tail pointers are set upon first
+ * contention.
+ *
+ * <p>Threads waiting on Conditions use the same nodes, but
+ * use an additional link. Conditions only need to link nodes
+ * in simple (non-concurrent) linked queues because they are
+ * only accessed when exclusively held. Upon await, a node is
+ * inserted into a condition queue. Upon signal, the node is
+ * transferred to the main queue. A special value of status
+ * field is used to mark which queue a node is on.
+ *
+ * <p>Thanks go to Dave Dice, Mark Moir, Victor Luchangco, Bill
+ * Scherer and Michael Scott, along with members of JSR-166
+ * expert group, for helpful ideas, discussions, and critiques
+ * on the design of this class.
+ */
+ static final class Node {
+ /** waitStatus value to indicate thread has cancelled */
+ static final int CANCELLED = 1;
+ /** waitStatus value to indicate successor's thread needs unparking */
+ static final int SIGNAL = -1;
+ /** waitStatus value to indicate thread is waiting on condition */
+ static final int CONDITION = -2;
+ /** Marker to indicate a node is waiting in shared mode */
+ static final Node SHARED = new Node();
+ /** Marker to indicate a node is waiting in exclusive mode */
+ static final Node EXCLUSIVE = null;
+
+ /**
+ * Status field, taking on only the values:
+ * SIGNAL: The successor of this node is (or will soon be)
+ * blocked (via park), so the current node must
+ * unpark its successor when it releases or
+ * cancels. To avoid races, acquire methods must
+ * first indicate they need a signal,
+ * then retry the atomic acquire, and then,
+ * on failure, block.
+ * CANCELLED: This node is cancelled due to timeout or interrupt.
+ * Nodes never leave this state. In particular,
+ * a thread with cancelled node never again blocks.
+ * CONDITION: This node is currently on a condition queue.
+ * It will not be used as a sync queue node until
+ * transferred. (Use of this value here
+ * has nothing to do with the other uses
+ * of the field, but simplifies mechanics.)
+ * 0: None of the above
+ *
+ * The values are arranged numerically to simplify use.
+ * Non-negative values mean that a node doesn't need to
+ * signal. So, most code doesn't need to check for particular
+ * values, just for sign.
+ *
+ * The field is initialized to 0 for normal sync nodes, and
+ * CONDITION for condition nodes. It is modified only using
+ * CAS.
+ */
+ volatile int waitStatus;
+
+ /**
+ * Link to predecessor node that current node/thread relies on
+ * for checking waitStatus. Assigned during enqueing, and nulled
+ * out (for sake of GC) only upon dequeuing. Also, upon
+ * cancellation of a predecessor, we short-circuit while
+ * finding a non-cancelled one, which will always exist
+ * because the head node is never cancelled: A node becomes
+ * head only as a result of successful acquire. A
+ * cancelled thread never succeeds in acquiring, and a thread only
+ * cancels itself, not any other node.
+ */
+ volatile Node prev;
+
+ /**
+ * Link to the successor node that the current node/thread
+ * unparks upon release. Assigned once during enqueuing, and
+ * nulled out (for sake of GC) when no longer needed. Upon
+ * cancellation, we cannot adjust this field, but can notice
+ * status and bypass the node if cancelled. The enq operation
+ * does not assign next field of a predecessor until after
+ * attachment, so seeing a null next field does not
+ * necessarily mean that node is at end of queue. However, if
+ * a next field appears to be null, we can scan prev's from
+ * the tail to double-check.
+ */
+ volatile Node next;
+
+ /**
+ * The thread that enqueued this node. Initialized on
+ * construction and nulled out after use.
+ */
+ volatile Thread thread;
+
+ /**
+ * Link to next node waiting on condition, or the special
+ * value SHARED. Because condition queues are accessed only
+ * when holding in exclusive mode, we just need a simple
+ * linked queue to hold nodes while they are waiting on
+ * conditions. They are then transferred to the queue to
+ * re-acquire. And because conditions can only be exclusive,
+ * we save a field by using special value to indicate shared
+ * mode.
+ */
+ Node nextWaiter;
+
+ /**
+ * Returns true if node is waiting in shared mode
+ */
+ final boolean isShared() {
+ return nextWaiter == SHARED;
+ }
+
+ /**
+ * Returns previous node, or throws NullPointerException if
+ * null. Use when predecessor cannot be null.
+ * @return the predecessor of this node
+ */
+ final Node predecessor() throws NullPointerException {
+ Node p = prev;
+ if (p == null)
+ throw new NullPointerException();
+ else
+ return p;
+ }
+
+ Node() { // Used to establish initial head or SHARED marker
+ }
+
+ Node(Thread thread, Node mode) { // Used by addWaiter
+ this.nextWaiter = mode;
+ this.thread = thread;
+ }
+
+ Node(Thread thread, int waitStatus) { // Used by Condition
+ this.waitStatus = waitStatus;
+ this.thread = thread;
+ }
+ }
+
+ /**
+ * Head of the wait queue, lazily initialized. Except for
+ * initialization, it is modified only via method setHead. Note:
+ * If head exists, its waitStatus is guaranteed not to be
+ * CANCELLED.
+ */
+ private transient volatile Node head;
+
+ /**
+ * Tail of the wait queue, lazily initialized. Modified only via
+ * method enq to add new wait node.
+ */
+ private transient volatile Node tail;
+
+ /**
+ * The synchronization state.
+ */
+ private volatile long state;
+
+ /**
+ * Returns the current value of synchronization state.
+ * This operation has memory semantics of a <tt>volatile</tt> read.
+ * @return current state value
+ */
+ protected final long getState() {
+ return state;
+ }
+
+ /**
+ * Sets the value of synchronization state.
+ * This operation has memory semantics of a <tt>volatile</tt> write.
+ * @param newState the new state value
+ */
+ protected final void setState(long newState) {
+ state = newState;
+ }
+
+ /**
+ * Atomically sets synchronization state to the given updated
+ * value if the current state value equals the expected value.
+ * This operation has memory semantics of a <tt>volatile</tt> read
+ * and write.
+ *
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful. False return indicates that the actual
+ * value was not equal to the expected value.
+ */
+ protected final boolean compareAndSetState(long expect, long update) {
+ // See below for intrinsics setup to support this
+ return unsafe.compareAndSwapLong(this, stateOffset, expect, update);
+ }
+
+ // Queuing utilities
+
+ /**
+ * The number of nanoseconds for which it is faster to spin
+ * rather than to use timed park. A rough estimate suffices
+ * to improve responsiveness with very short timeouts.
+ */
+ static final long spinForTimeoutThreshold = 1000L;
+
+ /**
+ * Inserts node into queue, initializing if necessary. See picture above.
+ * @param node the node to insert
+ * @return node's predecessor
+ */
+ private Node enq(final Node node) {
+ for (;;) {
+ Node t = tail;
+ if (t == null) { // Must initialize
+ Node h = new Node(); // Dummy header
+ h.next = node;
+ node.prev = h;
+ if (compareAndSetHead(h)) {
+ tail = node;
+ return h;
+ }
+ }
+ else {
+ node.prev = t;
+ if (compareAndSetTail(t, node)) {
+ t.next = node;
+ return t;
+ }
+ }
+ }
+ }
+
+ /**
+ * Creates and enqueues node for given thread and mode.
+ *
+ * @param current the thread
+ * @param mode Node.EXCLUSIVE for exclusive, Node.SHARED for shared
+ * @return the new node
+ */
+ private Node addWaiter(Node mode) {
+ Node node = new Node(Thread.currentThread(), mode);
+ // Try the fast path of enq; backup to full enq on failure
+ Node pred = tail;
+ if (pred != null) {
+ node.prev = pred;
+ if (compareAndSetTail(pred, node)) {
+ pred.next = node;
+ return node;
+ }
+ }
+ enq(node);
+ return node;
+ }
+
+ /**
+ * Sets head of queue to be node, thus dequeuing. Called only by
+ * acquire methods. Also nulls out unused fields for sake of GC
+ * and to suppress unnecessary signals and traversals.
+ *
+ * @param node the node
+ */
+ private void setHead(Node node) {
+ head = node;
+ node.thread = null;
+ node.prev = null;
+ }
+
+ /**
+ * Wakes up node's successor, if one exists.
+ *
+ * @param node the node
+ */
+ private void unparkSuccessor(Node node) {
+ /*
+ * Try to clear status in anticipation of signalling. It is
+ * OK if this fails or if status is changed by waiting thread.
+ */
+ compareAndSetWaitStatus(node, Node.SIGNAL, 0);
+
+ /*
+ * Thread to unpark is held in successor, which is normally
+ * just the next node. But if cancelled or apparently null,
+ * traverse backwards from tail to find the actual
+ * non-cancelled successor.
+ */
+ Node s = node.next;
+ if (s == null || s.waitStatus > 0) {
+ s = null;
+ for (Node t = tail; t != null && t != node; t = t.prev)
+ if (t.waitStatus <= 0)
+ s = t;
+ }
+ if (s != null)
+ LockSupport.unpark(s.thread);
+ }
+
+ /**
+ * Sets head of queue, and checks if successor may be waiting
+ * in shared mode, if so propagating if propagate > 0.
+ *
+ * @param pred the node holding waitStatus for node
+ * @param node the node
+ * @param propagate the return value from a tryAcquireShared
+ */
+ private void setHeadAndPropagate(Node node, long propagate) {
+ setHead(node);
+ if (propagate > 0 && node.waitStatus != 0) {
+ /*
+ * Don't bother fully figuring out successor. If it
+ * looks null, call unparkSuccessor anyway to be safe.
+ */
+ Node s = node.next;
+ if (s == null || s.isShared())
+ unparkSuccessor(node);
+ }
+ }
+
+ // Utilities for various versions of acquire
+
+ /**
+ * Cancels an ongoing attempt to acquire.
+ *
+ * @param node the node
+ */
+ private void cancelAcquire(Node node) {
+ if (node != null) { // Ignore if node doesn't exist
+ node.thread = null;
+ // Can use unconditional write instead of CAS here
+ node.waitStatus = Node.CANCELLED;
+ unparkSuccessor(node);
+ }
+ }
+
+ /**
+ * Checks and updates status for a node that failed to acquire.
+ * Returns true if thread should block. This is the main signal
+ * control in all acquire loops. Requires that pred == node.prev
+ *
+ * @param pred node's predecessor holding status
+ * @param node the node
+ * @return {@code true} if thread should block
+ */
+ private static boolean shouldParkAfterFailedAcquire(Node pred, Node node) {
+ int s = pred.waitStatus;
+ if (s < 0)
+ /*
+ * This node has already set status asking a release
+ * to signal it, so it can safely park
+ */
+ return true;
+ if (s > 0)
+ /*
+ * Predecessor was cancelled. Move up to its predecessor
+ * and indicate retry.
+ */
+ node.prev = pred.prev;
+ else
+ /*
+ * Indicate that we need a signal, but don't park yet. Caller
+ * will need to retry to make sure it cannot acquire before
+ * parking.
+ */
+ compareAndSetWaitStatus(pred, 0, Node.SIGNAL);
+ return false;
+ }
+
+ /**
+ * Convenience method to interrupt current thread.
+ */
+ private static void selfInterrupt() {
+ Thread.currentThread().interrupt();
+ }
+
+ /**
+ * Convenience method to park and then check if interrupted
+ *
+ * @return {@code true} if interrupted
+ */
+ private final boolean parkAndCheckInterrupt() {
+ LockSupport.park(this);
+ return Thread.interrupted();
+ }
+
+ /*
+ * Various flavors of acquire, varying in exclusive/shared and
+ * control modes. Each is mostly the same, but annoyingly
+ * different. Only a little bit of factoring is possible due to
+ * interactions of exception mechanics (including ensuring that we
+ * cancel if tryAcquire throws exception) and other control, at
+ * least not without hurting performance too much.
+ */
+
+ /**
+ * Acquires in exclusive uninterruptible mode for thread already in
+ * queue. Used by condition wait methods as well as acquire.
+ *
+ * @param node the node
+ * @param arg the acquire argument
+ * @return {@code true} if interrupted while waiting
+ */
+ final boolean acquireQueued(final Node node, long arg) {
+ try {
+ boolean interrupted = false;
+ for (;;) {
+ final Node p = node.predecessor();
+ if (p == head && tryAcquire(arg)) {
+ setHead(node);
+ p.next = null; // help GC
+ return interrupted;
+ }
+ if (shouldParkAfterFailedAcquire(p, node) &&
+ parkAndCheckInterrupt())
+ interrupted = true;
+ }
+ } catch (RuntimeException ex) {
+ cancelAcquire(node);
+ throw ex;
+ }
+ }
+
+ /**
+ * Acquires in exclusive interruptible mode.
+ * @param arg the acquire argument
+ */
+ private void doAcquireInterruptibly(long arg)
+ throws InterruptedException {
+ final Node node = addWaiter(Node.EXCLUSIVE);
+ try {
+ for (;;) {
+ final Node p = node.predecessor();
+ if (p == head && tryAcquire(arg)) {
+ setHead(node);
+ p.next = null; // help GC
+ return;
+ }
+ if (shouldParkAfterFailedAcquire(p, node) &&
+ parkAndCheckInterrupt())
+ break;
+ }
+ } catch (RuntimeException ex) {
+ cancelAcquire(node);
+ throw ex;
+ }
+ // Arrive here only if interrupted
+ cancelAcquire(node);
+ throw new InterruptedException();
+ }
+
+ /**
+ * Acquires in exclusive timed mode.
+ *
+ * @param arg the acquire argument
+ * @param nanosTimeout max wait time
+ * @return {@code true} if acquired
+ */
+ private boolean doAcquireNanos(long arg, long nanosTimeout)
+ throws InterruptedException {
+ long lastTime = System.nanoTime();
+ final Node node = addWaiter(Node.EXCLUSIVE);
+ try {
+ for (;;) {
+ final Node p = node.predecessor();
+ if (p == head && tryAcquire(arg)) {
+ setHead(node);
+ p.next = null; // help GC
+ return true;
+ }
+ if (nanosTimeout <= 0) {
+ cancelAcquire(node);
+ return false;
+ }
+ if (nanosTimeout > spinForTimeoutThreshold &&
+ shouldParkAfterFailedAcquire(p, node))
+ LockSupport.parkNanos(this, nanosTimeout);
+ long now = System.nanoTime();
+ nanosTimeout -= now - lastTime;
+ lastTime = now;
+ if (Thread.interrupted())
+ break;
+ }
+ } catch (RuntimeException ex) {
+ cancelAcquire(node);
+ throw ex;
+ }
+ // Arrive here only if interrupted
+ cancelAcquire(node);
+ throw new InterruptedException();
+ }
+
+ /**
+ * Acquires in shared uninterruptible mode.
+ * @param arg the acquire argument
+ */
+ private void doAcquireShared(long arg) {
+ final Node node = addWaiter(Node.SHARED);
+ try {
+ boolean interrupted = false;
+ for (;;) {
+ final Node p = node.predecessor();
+ if (p == head) {
+ long r = tryAcquireShared(arg);
+ if (r >= 0) {
+ setHeadAndPropagate(node, r);
+ p.next = null; // help GC
+ if (interrupted)
+ selfInterrupt();
+ return;
+ }
+ }
+ if (shouldParkAfterFailedAcquire(p, node) &&
+ parkAndCheckInterrupt())
+ interrupted = true;
+ }
+ } catch (RuntimeException ex) {
+ cancelAcquire(node);
+ throw ex;
+ }
+ }
+
+ /**
+ * Acquires in shared interruptible mode.
+ * @param arg the acquire argument
+ */
+ private void doAcquireSharedInterruptibly(long arg)
+ throws InterruptedException {
+ final Node node = addWaiter(Node.SHARED);
+ try {
+ for (;;) {
+ final Node p = node.predecessor();
+ if (p == head) {
+ long r = tryAcquireShared(arg);
+ if (r >= 0) {
+ setHeadAndPropagate(node, r);
+ p.next = null; // help GC
+ return;
+ }
+ }
+ if (shouldParkAfterFailedAcquire(p, node) &&
+ parkAndCheckInterrupt())
+ break;
+ }
+ } catch (RuntimeException ex) {
+ cancelAcquire(node);
+ throw ex;
+ }
+ // Arrive here only if interrupted
+ cancelAcquire(node);
+ throw new InterruptedException();
+ }
+
+ /**
+ * Acquires in shared timed mode.
+ *
+ * @param arg the acquire argument
+ * @param nanosTimeout max wait time
+ * @return {@code true} if acquired
+ */
+ private boolean doAcquireSharedNanos(long arg, long nanosTimeout)
+ throws InterruptedException {
+
+ long lastTime = System.nanoTime();
+ final Node node = addWaiter(Node.SHARED);
+ try {
+ for (;;) {
+ final Node p = node.predecessor();
+ if (p == head) {
+ long r = tryAcquireShared(arg);
+ if (r >= 0) {
+ setHeadAndPropagate(node, r);
+ p.next = null; // help GC
+ return true;
+ }
+ }
+ if (nanosTimeout <= 0) {
+ cancelAcquire(node);
+ return false;
+ }
+ if (nanosTimeout > spinForTimeoutThreshold &&
+ shouldParkAfterFailedAcquire(p, node))
+ LockSupport.parkNanos(this, nanosTimeout);
+ long now = System.nanoTime();
+ nanosTimeout -= now - lastTime;
+ lastTime = now;
+ if (Thread.interrupted())
+ break;
+ }
+ } catch (RuntimeException ex) {
+ cancelAcquire(node);
+ throw ex;
+ }
+ // Arrive here only if interrupted
+ cancelAcquire(node);
+ throw new InterruptedException();
+ }
+
+ // Main exported methods
+
+ /**
+ * Attempts to acquire in exclusive mode. This method should query
+ * if the state of the object permits it to be acquired in the
+ * exclusive mode, and if so to acquire it.
+ *
+ * <p>This method is always invoked by the thread performing
+ * acquire. If this method reports failure, the acquire method
+ * may queue the thread, if it is not already queued, until it is
+ * signalled by a release from some other thread. This can be used
+ * to implement method {@link Lock#tryLock()}.
+ *
+ * <p>The default
+ * implementation throws {@link UnsupportedOperationException}.
+ *
+ * @param arg the acquire argument. This value is always the one
+ * passed to an acquire method, or is the value saved on entry
+ * to a condition wait. The value is otherwise uninterpreted
+ * and can represent anything you like.
+ * @return {@code true} if successful. Upon success, this object has
+ * been acquired.
+ * @throws IllegalMonitorStateException if acquiring would place this
+ * synchronizer in an illegal state. This exception must be
+ * thrown in a consistent fashion for synchronization to work
+ * correctly.
+ * @throws UnsupportedOperationException if exclusive mode is not supported
+ */
+ protected boolean tryAcquire(long arg) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Attempts to set the state to reflect a release in exclusive
+ * mode.
+ *
+ * <p>This method is always invoked by the thread performing release.
+ *
+ * <p>The default implementation throws
+ * {@link UnsupportedOperationException}.
+ *
+ * @param arg the release argument. This value is always the one
+ * passed to a release method, or the current state value upon
+ * entry to a condition wait. The value is otherwise
+ * uninterpreted and can represent anything you like.
+ * @return {@code true} if this object is now in a fully released
+ * state, so that any waiting threads may attempt to acquire;
+ * and {@code false} otherwise.
+ * @throws IllegalMonitorStateException if releasing would place this
+ * synchronizer in an illegal state. This exception must be
+ * thrown in a consistent fashion for synchronization to work
+ * correctly.
+ * @throws UnsupportedOperationException if exclusive mode is not supported
+ */
+ protected boolean tryRelease(long arg) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Attempts to acquire in shared mode. This method should query if
+ * the state of the object permits it to be acquired in the shared
+ * mode, and if so to acquire it.
+ *
+ * <p>This method is always invoked by the thread performing
+ * acquire. If this method reports failure, the acquire method
+ * may queue the thread, if it is not already queued, until it is
+ * signalled by a release from some other thread.
+ *
+ * <p>The default implementation throws {@link
+ * UnsupportedOperationException}.
+ *
+ * @param arg the acquire argument. This value is always the one
+ * passed to an acquire method, or is the value saved on entry
+ * to a condition wait. The value is otherwise uninterpreted
+ * and can represent anything you like.
+ * @return a negative value on failure; zero if acquisition in shared
+ * mode succeeded but no subsequent shared-mode acquire can
+ * succeed; and a positive value if acquisition in shared
+ * mode succeeded and subsequent shared-mode acquires might
+ * also succeed, in which case a subsequent waiting thread
+ * must check availability. (Support for three different
+ * return values enables this method to be used in contexts
+ * where acquires only sometimes act exclusively.) Upon
+ * success, this object has been acquired.
+ * @throws IllegalMonitorStateException if acquiring would place this
+ * synchronizer in an illegal state. This exception must be
+ * thrown in a consistent fashion for synchronization to work
+ * correctly.
+ * @throws UnsupportedOperationException if shared mode is not supported
+ */
+ protected long tryAcquireShared(long arg) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Attempts to set the state to reflect a release in shared mode.
+ *
+ * <p>This method is always invoked by the thread performing release.
+ *
+ * <p>The default implementation throws
+ * {@link UnsupportedOperationException}.
+ *
+ * @param arg the release argument. This value is always the one
+ * passed to a release method, or the current state value upon
+ * entry to a condition wait. The value is otherwise
+ * uninterpreted and can represent anything you like.
+ * @return {@code true} if this release of shared mode may permit a
+ * waiting acquire (shared or exclusive) to succeed; and
+ * {@code false} otherwise
+ * @throws IllegalMonitorStateException if releasing would place this
+ * synchronizer in an illegal state. This exception must be
+ * thrown in a consistent fashion for synchronization to work
+ * correctly.
+ * @throws UnsupportedOperationException if shared mode is not supported
+ */
+ protected boolean tryReleaseShared(long arg) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Returns {@code true} if synchronization is held exclusively with
+ * respect to the current (calling) thread. This method is invoked
+ * upon each call to a non-waiting {@link ConditionObject} method.
+ * (Waiting methods instead invoke {@link #release}.)
+ *
+ * <p>The default implementation throws {@link
+ * UnsupportedOperationException}. This method is invoked
+ * internally only within {@link ConditionObject} methods, so need
+ * not be defined if conditions are not used.
+ *
+ * @return {@code true} if synchronization is held exclusively;
+ * {@code false} otherwise
+ * @throws UnsupportedOperationException if conditions are not supported
+ */
+ protected boolean isHeldExclusively() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Acquires in exclusive mode, ignoring interrupts. Implemented
+ * by invoking at least once {@link #tryAcquire},
+ * returning on success. Otherwise the thread is queued, possibly
+ * repeatedly blocking and unblocking, invoking {@link
+ * #tryAcquire} until success. This method can be used
+ * to implement method {@link Lock#lock}.
+ *
+ * @param arg the acquire argument. This value is conveyed to
+ * {@link #tryAcquire} but is otherwise uninterpreted and
+ * can represent anything you like.
+ */
+ public final void acquire(long arg) {
+ if (!tryAcquire(arg) &&
+ acquireQueued(addWaiter(Node.EXCLUSIVE), arg))
+ selfInterrupt();
+ }
+
+ /**
+ * Acquires in exclusive mode, aborting if interrupted.
+ * Implemented by first checking interrupt status, then invoking
+ * at least once {@link #tryAcquire}, returning on
+ * success. Otherwise the thread is queued, possibly repeatedly
+ * blocking and unblocking, invoking {@link #tryAcquire}
+ * until success or the thread is interrupted. This method can be
+ * used to implement method {@link Lock#lockInterruptibly}.
+ *
+ * @param arg the acquire argument. This value is conveyed to
+ * {@link #tryAcquire} but is otherwise uninterpreted and
+ * can represent anything you like.
+ * @throws InterruptedException if the current thread is interrupted
+ */
+ public final void acquireInterruptibly(long arg) throws InterruptedException {
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ if (!tryAcquire(arg))
+ doAcquireInterruptibly(arg);
+ }
+
+ /**
+ * Attempts to acquire in exclusive mode, aborting if interrupted,
+ * and failing if the given timeout elapses. Implemented by first
+ * checking interrupt status, then invoking at least once {@link
+ * #tryAcquire}, returning on success. Otherwise, the thread is
+ * queued, possibly repeatedly blocking and unblocking, invoking
+ * {@link #tryAcquire} until success or the thread is interrupted
+ * or the timeout elapses. This method can be used to implement
+ * method {@link Lock#tryLock(long, TimeUnit)}.
+ *
+ * @param arg the acquire argument. This value is conveyed to
+ * {@link #tryAcquire} but is otherwise uninterpreted and
+ * can represent anything you like.
+ * @param nanosTimeout the maximum number of nanoseconds to wait
+ * @return {@code true} if acquired; {@code false} if timed out
+ * @throws InterruptedException if the current thread is interrupted
+ */
+ public final boolean tryAcquireNanos(long arg, long nanosTimeout) throws InterruptedException {
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ return tryAcquire(arg) ||
+ doAcquireNanos(arg, nanosTimeout);
+ }
+
+ /**
+ * Releases in exclusive mode. Implemented by unblocking one or
+ * more threads if {@link #tryRelease} returns true.
+ * This method can be used to implement method {@link Lock#unlock}.
+ *
+ * @param arg the release argument. This value is conveyed to
+ * {@link #tryRelease} but is otherwise uninterpreted and
+ * can represent anything you like.
+ * @return the value returned from {@link #tryRelease}
+ */
+ public final boolean release(long arg) {
+ if (tryRelease(arg)) {
+ Node h = head;
+ if (h != null && h.waitStatus != 0)
+ unparkSuccessor(h);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Acquires in shared mode, ignoring interrupts. Implemented by
+ * first invoking at least once {@link #tryAcquireShared},
+ * returning on success. Otherwise the thread is queued, possibly
+ * repeatedly blocking and unblocking, invoking {@link
+ * #tryAcquireShared} until success.
+ *
+ * @param arg the acquire argument. This value is conveyed to
+ * {@link #tryAcquireShared} but is otherwise uninterpreted
+ * and can represent anything you like.
+ */
+ public final void acquireShared(long arg) {
+ if (tryAcquireShared(arg) < 0)
+ doAcquireShared(arg);
+ }
+
+ /**
+ * Acquires in shared mode, aborting if interrupted. Implemented
+ * by first checking interrupt status, then invoking at least once
+ * {@link #tryAcquireShared}, returning on success. Otherwise the
+ * thread is queued, possibly repeatedly blocking and unblocking,
+ * invoking {@link #tryAcquireShared} until success or the thread
+ * is interrupted.
+ * @param arg the acquire argument.
+ * This value is conveyed to {@link #tryAcquireShared} but is
+ * otherwise uninterpreted and can represent anything
+ * you like.
+ * @throws InterruptedException if the current thread is interrupted
+ */
+ public final void acquireSharedInterruptibly(long arg) throws InterruptedException {
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ if (tryAcquireShared(arg) < 0)
+ doAcquireSharedInterruptibly(arg);
+ }
+
+ /**
+ * Attempts to acquire in shared mode, aborting if interrupted, and
+ * failing if the given timeout elapses. Implemented by first
+ * checking interrupt status, then invoking at least once {@link
+ * #tryAcquireShared}, returning on success. Otherwise, the
+ * thread is queued, possibly repeatedly blocking and unblocking,
+ * invoking {@link #tryAcquireShared} until success or the thread
+ * is interrupted or the timeout elapses.
+ *
+ * @param arg the acquire argument. This value is conveyed to
+ * {@link #tryAcquireShared} but is otherwise uninterpreted
+ * and can represent anything you like.
+ * @param nanosTimeout the maximum number of nanoseconds to wait
+ * @return {@code true} if acquired; {@code false} if timed out
+ * @throws InterruptedException if the current thread is interrupted
+ */
+ public final boolean tryAcquireSharedNanos(long arg, long nanosTimeout) throws InterruptedException {
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ return tryAcquireShared(arg) >= 0 ||
+ doAcquireSharedNanos(arg, nanosTimeout);
+ }
+
+ /**
+ * Releases in shared mode. Implemented by unblocking one or more
+ * threads if {@link #tryReleaseShared} returns true.
+ *
+ * @param arg the release argument. This value is conveyed to
+ * {@link #tryReleaseShared} but is otherwise uninterpreted
+ * and can represent anything you like.
+ * @return the value returned from {@link #tryReleaseShared}
+ */
+ public final boolean releaseShared(long arg) {
+ if (tryReleaseShared(arg)) {
+ Node h = head;
+ if (h != null && h.waitStatus != 0)
+ unparkSuccessor(h);
+ return true;
+ }
+ return false;
+ }
+
+ // Queue inspection methods
+
+ /**
+ * Queries whether any threads are waiting to acquire. Note that
+ * because cancellations due to interrupts and timeouts may occur
+ * at any time, a {@code true} return does not guarantee that any
+ * other thread will ever acquire.
+ *
+ * <p>In this implementation, this operation returns in
+ * constant time.
+ *
+ * @return {@code true} if there may be other threads waiting to acquire
+ */
+ public final boolean hasQueuedThreads() {
+ return head != tail;
+ }
+
+ /**
+ * Queries whether any threads have ever contended to acquire this
+ * synchronizer; that is if an acquire method has ever blocked.
+ *
+ * <p>In this implementation, this operation returns in
+ * constant time.
+ *
+ * @return {@code true} if there has ever been contention
+ */
+ public final boolean hasContended() {
+ return head != null;
+ }
+
+ /**
+ * Returns the first (longest-waiting) thread in the queue, or
+ * {@code null} if no threads are currently queued.
+ *
+ * <p>In this implementation, this operation normally returns in
+ * constant time, but may iterate upon contention if other threads are
+ * concurrently modifying the queue.
+ *
+ * @return the first (longest-waiting) thread in the queue, or
+ * {@code null} if no threads are currently queued
+ */
+ public final Thread getFirstQueuedThread() {
+ // handle only fast path, else relay
+ return (head == tail)? null : fullGetFirstQueuedThread();
+ }
+
+ /**
+ * Version of getFirstQueuedThread called when fastpath fails
+ */
+ private Thread fullGetFirstQueuedThread() {
+ /*
+ * The first node is normally h.next. Try to get its
+ * thread field, ensuring consistent reads: If thread
+ * field is nulled out or s.prev is no longer head, then
+ * some other thread(s) concurrently performed setHead in
+ * between some of our reads. We try this twice before
+ * resorting to traversal.
+ */
+ Node h, s;
+ Thread st;
+ if (((h = head) != null && (s = h.next) != null &&
+ s.prev == head && (st = s.thread) != null) ||
+ ((h = head) != null && (s = h.next) != null &&
+ s.prev == head && (st = s.thread) != null))
+ return st;
+
+ /*
+ * Head's next field might not have been set yet, or may have
+ * been unset after setHead. So we must check to see if tail
+ * is actually first node. If not, we continue on, safely
+ * traversing from tail back to head to find first,
+ * guaranteeing termination.
+ */
+
+ Node t = tail;
+ Thread firstThread = null;
+ while (t != null && t != head) {
+ Thread tt = t.thread;
+ if (tt != null)
+ firstThread = tt;
+ t = t.prev;
+ }
+ return firstThread;
+ }
+
+ /**
+ * Returns true if the given thread is currently queued.
+ *
+ * <p>This implementation traverses the queue to determine
+ * presence of the given thread.
+ *
+ * @param thread the thread
+ * @return {@code true} if the given thread is on the queue
+ * @throws NullPointerException if the thread is null
+ */
+ public final boolean isQueued(Thread thread) {
+ if (thread == null)
+ throw new NullPointerException();
+ for (Node p = tail; p != null; p = p.prev)
+ if (p.thread == thread)
+ return true;
+ return false;
+ }
+
+ /**
+ * Return {@code true} if the apparent first queued thread, if one
+ * exists, is not waiting in exclusive mode. Used only as a heuristic
+ * in ReentrantReadWriteLock.
+ */
+ final boolean apparentlyFirstQueuedIsExclusive() {
+ Node h, s;
+ return ((h = head) != null && (s = h.next) != null &&
+ s.nextWaiter != Node.SHARED);
+ }
+
+ /**
+ * Return {@code true} if the queue is empty or if the given thread
+ * is at the head of the queue. This is reliable only if
+ * <tt>current</tt> is actually Thread.currentThread() of caller.
+ */
+ final boolean isFirst(Thread current) {
+ Node h, s;
+ return ((h = head) == null ||
+ ((s = h.next) != null && s.thread == current) ||
+ fullIsFirst(current));
+ }
+
+ final boolean fullIsFirst(Thread current) {
+ // same idea as fullGetFirstQueuedThread
+ Node h, s;
+ Thread firstThread = null;
+ if (((h = head) != null && (s = h.next) != null &&
+ s.prev == head && (firstThread = s.thread) != null))
+ return firstThread == current;
+ Node t = tail;
+ while (t != null && t != head) {
+ Thread tt = t.thread;
+ if (tt != null)
+ firstThread = tt;
+ t = t.prev;
+ }
+ return firstThread == current || firstThread == null;
+ }
+
+
+ // Instrumentation and monitoring methods
+
+ /**
+ * Returns an estimate of the number of threads waiting to
+ * acquire. The value is only an estimate because the number of
+ * threads may change dynamically while this method traverses
+ * internal data structures. This method is designed for use in
+ * monitoring system state, not for synchronization
+ * control.
+ *
+ * @return the estimated number of threads waiting to acquire
+ */
+ public final int getQueueLength() {
+ int n = 0;
+ for (Node p = tail; p != null; p = p.prev) {
+ if (p.thread != null)
+ ++n;
+ }
+ return n;
+ }
+
+ /**
+ * Returns a collection containing threads that may be waiting to
+ * acquire. Because the actual set of threads may change
+ * dynamically while constructing this result, the returned
+ * collection is only a best-effort estimate. The elements of the
+ * returned collection are in no particular order. This method is
+ * designed to facilitate construction of subclasses that provide
+ * more extensive monitoring facilities.
+ *
+ * @return the collection of threads
+ */
+ public final Collection<Thread> getQueuedThreads() {
+ ArrayList<Thread> list = new ArrayList<Thread>();
+ for (Node p = tail; p != null; p = p.prev) {
+ Thread t = p.thread;
+ if (t != null)
+ list.add(t);
+ }
+ return list;
+ }
+
+ /**
+ * Returns a collection containing threads that may be waiting to
+ * acquire in exclusive mode. This has the same properties
+ * as {@link #getQueuedThreads} except that it only returns
+ * those threads waiting due to an exclusive acquire.
+ *
+ * @return the collection of threads
+ */
+ public final Collection<Thread> getExclusiveQueuedThreads() {
+ ArrayList<Thread> list = new ArrayList<Thread>();
+ for (Node p = tail; p != null; p = p.prev) {
+ if (!p.isShared()) {
+ Thread t = p.thread;
+ if (t != null)
+ list.add(t);
+ }
+ }
+ return list;
+ }
+
+ /**
+ * Returns a collection containing threads that may be waiting to
+ * acquire in shared mode. This has the same properties
+ * as {@link #getQueuedThreads} except that it only returns
+ * those threads waiting due to a shared acquire.
+ *
+ * @return the collection of threads
+ */
+ public final Collection<Thread> getSharedQueuedThreads() {
+ ArrayList<Thread> list = new ArrayList<Thread>();
+ for (Node p = tail; p != null; p = p.prev) {
+ if (p.isShared()) {
+ Thread t = p.thread;
+ if (t != null)
+ list.add(t);
+ }
+ }
+ return list;
+ }
+
+ /**
+ * Returns a string identifying this synchronizer, as well as its state.
+ * The state, in brackets, includes the String {@code "State ="}
+ * followed by the current value of {@link #getState}, and either
+ * {@code "nonempty"} or {@code "empty"} depending on whether the
+ * queue is empty.
+ *
+ * @return a string identifying this synchronizer, as well as its state
+ */
+ public String toString() {
+ long s = getState();
+ String q = hasQueuedThreads()? "non" : "";
+ return super.toString() +
+ "[State = " + s + ", " + q + "empty queue]";
+ }
+
+
+ // Internal support methods for Conditions
+
+ /**
+ * Returns true if a node, always one that was initially placed on
+ * a condition queue, is now waiting to reacquire on sync queue.
+ * @param node the node
+ * @return true if is reacquiring
+ */
+ final boolean isOnSyncQueue(Node node) {
+ if (node.waitStatus == Node.CONDITION || node.prev == null)
+ return false;
+ if (node.next != null) // If has successor, it must be on queue
+ return true;
+ /*
+ * node.prev can be non-null, but not yet on queue because
+ * the CAS to place it on queue can fail. So we have to
+ * traverse from tail to make sure it actually made it. It
+ * will always be near the tail in calls to this method, and
+ * unless the CAS failed (which is unlikely), it will be
+ * there, so we hardly ever traverse much.
+ */
+ return findNodeFromTail(node);
+ }
+
+ /**
+ * Returns true if node is on sync queue by searching backwards from tail.
+ * Called only when needed by isOnSyncQueue.
+ * @return true if present
+ */
+ private boolean findNodeFromTail(Node node) {
+ Node t = tail;
+ for (;;) {
+ if (t == node)
+ return true;
+ if (t == null)
+ return false;
+ t = t.prev;
+ }
+ }
+
+ /**
+ * Transfers a node from a condition queue onto sync queue.
+ * Returns true if successful.
+ * @param node the node
+ * @return true if successfully transferred (else the node was
+ * cancelled before signal).
+ */
+ final boolean transferForSignal(Node node) {
+ /*
+ * If cannot change waitStatus, the node has been cancelled.
+ */
+ if (!compareAndSetWaitStatus(node, Node.CONDITION, 0))
+ return false;
+
+ /*
+ * Splice onto queue and try to set waitStatus of predecessor to
+ * indicate that thread is (probably) waiting. If cancelled or
+ * attempt to set waitStatus fails, wake up to resync (in which
+ * case the waitStatus can be transiently and harmlessly wrong).
+ */
+ Node p = enq(node);
+ int c = p.waitStatus;
+ if (c > 0 || !compareAndSetWaitStatus(p, c, Node.SIGNAL))
+ LockSupport.unpark(node.thread);
+ return true;
+ }
+
+ /**
+ * Transfers node, if necessary, to sync queue after a cancelled
+ * wait. Returns true if thread was cancelled before being
+ * signalled.
+ * @param current the waiting thread
+ * @param node its node
+ * @return true if cancelled before the node was signalled.
+ */
+ final boolean transferAfterCancelledWait(Node node) {
+ if (compareAndSetWaitStatus(node, Node.CONDITION, 0)) {
+ enq(node);
+ return true;
+ }
+ /*
+ * If we lost out to a signal(), then we can't proceed
+ * until it finishes its enq(). Cancelling during an
+ * incomplete transfer is both rare and transient, so just
+ * spin.
+ */
+ while (!isOnSyncQueue(node))
+ Thread.yield();
+ return false;
+ }
+
+ /**
+ * Invokes release with current state value; returns saved state.
+ * Cancels node and throws exception on failure.
+ * @param node the condition node for this wait
+ * @return previous sync state
+ */
+ final long fullyRelease(Node node) {
+ try {
+ long savedState = getState();
+ if (release(savedState))
+ return savedState;
+ } catch (RuntimeException ex) {
+ node.waitStatus = Node.CANCELLED;
+ throw ex;
+ }
+ // reach here if release fails
+ node.waitStatus = Node.CANCELLED;
+ throw new IllegalMonitorStateException();
+ }
+
+ // Instrumentation methods for conditions
+
+ /**
+ * Queries whether the given ConditionObject
+ * uses this synchronizer as its lock.
+ *
+ * @param condition the condition
+ * @return <tt>true</tt> if owned
+ * @throws NullPointerException if the condition is null
+ */
+ public final boolean owns(ConditionObject condition) {
+ if (condition == null)
+ throw new NullPointerException();
+ return condition.isOwnedBy(this);
+ }
+
+ /**
+ * Queries whether any threads are waiting on the given condition
+ * associated with this synchronizer. Note that because timeouts
+ * and interrupts may occur at any time, a <tt>true</tt> return
+ * does not guarantee that a future <tt>signal</tt> will awaken
+ * any threads. This method is designed primarily for use in
+ * monitoring of the system state.
+ *
+ * @param condition the condition
+ * @return <tt>true</tt> if there are any waiting threads
+ * @throws IllegalMonitorStateException if exclusive synchronization
+ * is not held
+ * @throws IllegalArgumentException if the given condition is
+ * not associated with this synchronizer
+ * @throws NullPointerException if the condition is null
+ */
+ public final boolean hasWaiters(ConditionObject condition) {
+ if (!owns(condition))
+ throw new IllegalArgumentException("Not owner");
+ return condition.hasWaiters();
+ }
+
+ /**
+ * Returns an estimate of the number of threads waiting on the
+ * given condition associated with this synchronizer. Note that
+ * because timeouts and interrupts may occur at any time, the
+ * estimate serves only as an upper bound on the actual number of
+ * waiters. This method is designed for use in monitoring of the
+ * system state, not for synchronization control.
+ *
+ * @param condition the condition
+ * @return the estimated number of waiting threads
+ * @throws IllegalMonitorStateException if exclusive synchronization
+ * is not held
+ * @throws IllegalArgumentException if the given condition is
+ * not associated with this synchronizer
+ * @throws NullPointerException if the condition is null
+ */
+ public final int getWaitQueueLength(ConditionObject condition) {
+ if (!owns(condition))
+ throw new IllegalArgumentException("Not owner");
+ return condition.getWaitQueueLength();
+ }
+
+ /**
+ * Returns a collection containing those threads that may be
+ * waiting on the given condition associated with this
+ * synchronizer. Because the actual set of threads may change
+ * dynamically while constructing this result, the returned
+ * collection is only a best-effort estimate. The elements of the
+ * returned collection are in no particular order.
+ *
+ * @param condition the condition
+ * @return the collection of threads
+ * @throws IllegalMonitorStateException if exclusive synchronization
+ * is not held
+ * @throws IllegalArgumentException if the given condition is
+ * not associated with this synchronizer
+ * @throws NullPointerException if the condition is null
+ */
+ public final Collection<Thread> getWaitingThreads(ConditionObject condition) {
+ if (!owns(condition))
+ throw new IllegalArgumentException("Not owner");
+ return condition.getWaitingThreads();
+ }
+
+ /**
+ * Condition implementation for a {@link
+ * AbstractQueuedLongSynchronizer} serving as the basis of a {@link
+ * Lock} implementation.
+ *
+ * <p>Method documentation for this class describes mechanics,
+ * not behavioral specifications from the point of view of Lock
+ * and Condition users. Exported versions of this class will in
+ * general need to be accompanied by documentation describing
+ * condition semantics that rely on those of the associated
+ * <tt>AbstractQueuedLongSynchronizer</tt>.
+ *
+ * <p>This class is Serializable, but all fields are transient,
+ * so deserialized conditions have no waiters.
+ *
+ * @since 1.6
+ */
+ public class ConditionObject implements Condition, java.io.Serializable {
+ private static final long serialVersionUID = 1173984872572414699L;
+ /** First node of condition queue. */
+ private transient Node firstWaiter;
+ /** Last node of condition queue. */
+ private transient Node lastWaiter;
+
+ /**
+ * Creates a new <tt>ConditionObject</tt> instance.
+ */
+ public ConditionObject() { }
+
+ // Internal methods
+
+ /**
+ * Adds a new waiter to wait queue.
+ * @return its new wait node
+ */
+ private Node addConditionWaiter() {
+ Node node = new Node(Thread.currentThread(), Node.CONDITION);
+ Node t = lastWaiter;
+ if (t == null)
+ firstWaiter = node;
+ else
+ t.nextWaiter = node;
+ lastWaiter = node;
+ return node;
+ }
+
+ /**
+ * Removes and transfers nodes until hit non-cancelled one or
+ * null. Split out from signal in part to encourage compilers
+ * to inline the case of no waiters.
+ * @param first (non-null) the first node on condition queue
+ */
+ private void doSignal(Node first) {
+ do {
+ if ( (firstWaiter = first.nextWaiter) == null)
+ lastWaiter = null;
+ first.nextWaiter = null;
+ } while (!transferForSignal(first) &&
+ (first = firstWaiter) != null);
+ }
+
+ /**
+ * Removes and transfers all nodes.
+ * @param first (non-null) the first node on condition queue
+ */
+ private void doSignalAll(Node first) {
+ lastWaiter = firstWaiter = null;
+ do {
+ Node next = first.nextWaiter;
+ first.nextWaiter = null;
+ transferForSignal(first);
+ first = next;
+ } while (first != null);
+ }
+
+ /**
+ * Returns true if given node is on this condition queue.
+ * Call only when holding lock.
+ */
+ private boolean isOnConditionQueue(Node node) {
+ return node.next != null || node == lastWaiter;
+ }
+
+ /**
+ * Unlinks a cancelled waiter node from condition queue. This
+ * is called when cancellation occurred during condition wait,
+ * not lock wait, and is called only after lock has been
+ * re-acquired by a cancelled waiter and the node is not known
+ * to already have been dequeued. It is needed to avoid
+ * garbage retention in the absence of signals. So even though
+ * it may require a full traversal, it comes into play only
+ * when timeouts or cancellations occur in the absence of
+ * signals.
+ */
+ private void unlinkCancelledWaiter(Node node) {
+ Node t = firstWaiter;
+ Node trail = null;
+ while (t != null) {
+ if (t == node) {
+ Node next = t.nextWaiter;
+ if (trail == null)
+ firstWaiter = next;
+ else
+ trail.nextWaiter = next;
+ if (lastWaiter == node)
+ lastWaiter = trail;
+ break;
+ }
+ trail = t;
+ t = t.nextWaiter;
+ }
+ }
+
+ // public methods
+
+ /**
+ * Moves the longest-waiting thread, if one exists, from the
+ * wait queue for this condition to the wait queue for the
+ * owning lock.
+ *
+ * @throws IllegalMonitorStateException if {@link #isHeldExclusively}
+ * returns {@code false}
+ */
+ public final void signal() {
+ if (!isHeldExclusively())
+ throw new IllegalMonitorStateException();
+ Node first = firstWaiter;
+ if (first != null)
+ doSignal(first);
+ }
+
+ /**
+ * Moves all threads from the wait queue for this condition to
+ * the wait queue for the owning lock.
+ *
+ * @throws IllegalMonitorStateException if {@link #isHeldExclusively}
+ * returns {@code false}
+ */
+ public final void signalAll() {
+ if (!isHeldExclusively())
+ throw new IllegalMonitorStateException();
+ Node first = firstWaiter;
+ if (first != null)
+ doSignalAll(first);
+ }
+
+ /**
+ * Implements uninterruptible condition wait.
+ * <ol>
+ * <li> Save lock state returned by {@link #getState}
+ * <li> Invoke {@link #release} with
+ * saved state as argument, throwing
+ * IllegalMonitorStateException if it fails.
+ * <li> Block until signalled
+ * <li> Reacquire by invoking specialized version of
+ * {@link #acquire} with saved state as argument.
+ * </ol>
+ */
+ public final void awaitUninterruptibly() {
+ Node node = addConditionWaiter();
+ long savedState = fullyRelease(node);
+ boolean interrupted = false;
+ while (!isOnSyncQueue(node)) {
+ LockSupport.park(this);
+ if (Thread.interrupted())
+ interrupted = true;
+ }
+ if (acquireQueued(node, savedState) || interrupted)
+ selfInterrupt();
+ }
+
+ /*
+ * For interruptible waits, we need to track whether to throw
+ * InterruptedException, if interrupted while blocked on
+ * condition, versus reinterrupt current thread, if
+ * interrupted while blocked waiting to re-acquire.
+ */
+
+ /** Mode meaning to reinterrupt on exit from wait */
+ private static final int REINTERRUPT = 1;
+ /** Mode meaning to throw InterruptedException on exit from wait */
+ private static final int THROW_IE = -1;
+
+ /**
+ * Checks for interrupt, returning THROW_IE if interrupted
+ * before signalled, REINTERRUPT if after signalled, or
+ * 0 if not interrupted.
+ */
+ private int checkInterruptWhileWaiting(Node node) {
+ return (Thread.interrupted()) ?
+ ((transferAfterCancelledWait(node))? THROW_IE : REINTERRUPT) :
+ 0;
+ }
+
+ /**
+ * Throws InterruptedException, reinterrupts current thread, or
+ * does nothing, depending on mode.
+ */
+ private void reportInterruptAfterWait(int interruptMode)
+ throws InterruptedException {
+ if (interruptMode == THROW_IE)
+ throw new InterruptedException();
+ else if (interruptMode == REINTERRUPT)
+ selfInterrupt();
+ }
+
+ /**
+ * Implements interruptible condition wait.
+ * <ol>
+ * <li> If current thread is interrupted, throw InterruptedException
+ * <li> Save lock state returned by {@link #getState}
+ * <li> Invoke {@link #release} with
+ * saved state as argument, throwing
+ * IllegalMonitorStateException if it fails.
+ * <li> Block until signalled or interrupted
+ * <li> Reacquire by invoking specialized version of
+ * {@link #acquire} with saved state as argument.
+ * <li> If interrupted while blocked in step 4, throw exception
+ * </ol>
+ */
+ public final void await() throws InterruptedException {
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ Node node = addConditionWaiter();
+ long savedState = fullyRelease(node);
+ int interruptMode = 0;
+ while (!isOnSyncQueue(node)) {
+ LockSupport.park(this);
+ if ((interruptMode = checkInterruptWhileWaiting(node)) != 0)
+ break;
+ }
+ if (acquireQueued(node, savedState) && interruptMode != THROW_IE)
+ interruptMode = REINTERRUPT;
+ if (isOnConditionQueue(node))
+ unlinkCancelledWaiter(node);
+ if (interruptMode != 0)
+ reportInterruptAfterWait(interruptMode);
+ }
+
+ /**
+ * Implements timed condition wait.
+ * <ol>
+ * <li> If current thread is interrupted, throw InterruptedException
+ * <li> Save lock state returned by {@link #getState}
+ * <li> Invoke {@link #release} with
+ * saved state as argument, throwing
+ * IllegalMonitorStateException if it fails.
+ * <li> Block until signalled, interrupted, or timed out
+ * <li> Reacquire by invoking specialized version of
+ * {@link #acquire} with saved state as argument.
+ * <li> If interrupted while blocked in step 4, throw InterruptedException
+ * </ol>
+ */
+ public final long awaitNanos(long nanosTimeout) throws InterruptedException {
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ Node node = addConditionWaiter();
+ long savedState = fullyRelease(node);
+ long lastTime = System.nanoTime();
+ int interruptMode = 0;
+ while (!isOnSyncQueue(node)) {
+ if (nanosTimeout <= 0L) {
+ transferAfterCancelledWait(node);
+ break;
+ }
+ LockSupport.parkNanos(this, nanosTimeout);
+ if ((interruptMode = checkInterruptWhileWaiting(node)) != 0)
+ break;
+
+ long now = System.nanoTime();
+ nanosTimeout -= now - lastTime;
+ lastTime = now;
+ }
+ if (acquireQueued(node, savedState) && interruptMode != THROW_IE)
+ interruptMode = REINTERRUPT;
+ if (isOnConditionQueue(node))
+ unlinkCancelledWaiter(node);
+ if (interruptMode != 0)
+ reportInterruptAfterWait(interruptMode);
+ return nanosTimeout - (System.nanoTime() - lastTime);
+ }
+
+ /**
+ * Implements absolute timed condition wait.
+ * <ol>
+ * <li> If current thread is interrupted, throw InterruptedException
+ * <li> Save lock state returned by {@link #getState}
+ * <li> Invoke {@link #release} with
+ * saved state as argument, throwing
+ * IllegalMonitorStateException if it fails.
+ * <li> Block until signalled, interrupted, or timed out
+ * <li> Reacquire by invoking specialized version of
+ * {@link #acquire} with saved state as argument.
+ * <li> If interrupted while blocked in step 4, throw InterruptedException
+ * <li> If timed out while blocked in step 4, return false, else true
+ * </ol>
+ */
+ public final boolean awaitUntil(Date deadline) throws InterruptedException {
+ if (deadline == null)
+ throw new NullPointerException();
+ long abstime = deadline.getTime();
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ Node node = addConditionWaiter();
+ long savedState = fullyRelease(node);
+ boolean timedout = false;
+ int interruptMode = 0;
+ while (!isOnSyncQueue(node)) {
+ if (System.currentTimeMillis() > abstime) {
+ timedout = transferAfterCancelledWait(node);
+ break;
+ }
+ LockSupport.parkUntil(this, abstime);
+ if ((interruptMode = checkInterruptWhileWaiting(node)) != 0)
+ break;
+ }
+ if (acquireQueued(node, savedState) && interruptMode != THROW_IE)
+ interruptMode = REINTERRUPT;
+ if (isOnConditionQueue(node))
+ unlinkCancelledWaiter(node);
+ if (interruptMode != 0)
+ reportInterruptAfterWait(interruptMode);
+ return !timedout;
+ }
+
+ /**
+ * Implements timed condition wait.
+ * <ol>
+ * <li> If current thread is interrupted, throw InterruptedException
+ * <li> Save lock state returned by {@link #getState}
+ * <li> Invoke {@link #release} with
+ * saved state as argument, throwing
+ * IllegalMonitorStateException if it fails.
+ * <li> Block until signalled, interrupted, or timed out
+ * <li> Reacquire by invoking specialized version of
+ * {@link #acquire} with saved state as argument.
+ * <li> If interrupted while blocked in step 4, throw InterruptedException
+ * <li> If timed out while blocked in step 4, return false, else true
+ * </ol>
+ */
+ public final boolean await(long time, TimeUnit unit) throws InterruptedException {
+ if (unit == null)
+ throw new NullPointerException();
+ long nanosTimeout = unit.toNanos(time);
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ Node node = addConditionWaiter();
+ long savedState = fullyRelease(node);
+ long lastTime = System.nanoTime();
+ boolean timedout = false;
+ int interruptMode = 0;
+ while (!isOnSyncQueue(node)) {
+ if (nanosTimeout <= 0L) {
+ timedout = transferAfterCancelledWait(node);
+ break;
+ }
+ LockSupport.parkNanos(this, nanosTimeout);
+ if ((interruptMode = checkInterruptWhileWaiting(node)) != 0)
+ break;
+ long now = System.nanoTime();
+ nanosTimeout -= now - lastTime;
+ lastTime = now;
+ }
+ if (acquireQueued(node, savedState) && interruptMode != THROW_IE)
+ interruptMode = REINTERRUPT;
+ if (isOnConditionQueue(node))
+ unlinkCancelledWaiter(node);
+ if (interruptMode != 0)
+ reportInterruptAfterWait(interruptMode);
+ return !timedout;
+ }
+
+ // support for instrumentation
+
+ /**
+ * Returns true if this condition was created by the given
+ * synchronization object.
+ *
+ * @return {@code true} if owned
+ */
+ final boolean isOwnedBy(AbstractQueuedLongSynchronizer sync) {
+ return sync == AbstractQueuedLongSynchronizer.this;
+ }
+
+ /**
+ * Queries whether any threads are waiting on this condition.
+ * Implements {@link AbstractQueuedLongSynchronizer#hasWaiters}.
+ *
+ * @return {@code true} if there are any waiting threads
+ * @throws IllegalMonitorStateException if {@link #isHeldExclusively}
+ * returns {@code false}
+ */
+ protected final boolean hasWaiters() {
+ if (!isHeldExclusively())
+ throw new IllegalMonitorStateException();
+ for (Node w = firstWaiter; w != null; w = w.nextWaiter) {
+ if (w.waitStatus == Node.CONDITION)
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns an estimate of the number of threads waiting on
+ * this condition.
+ * Implements {@link AbstractQueuedLongSynchronizer#getWaitQueueLength}.
+ *
+ * @return the estimated number of waiting threads
+ * @throws IllegalMonitorStateException if {@link #isHeldExclusively}
+ * returns {@code false}
+ */
+ protected final int getWaitQueueLength() {
+ if (!isHeldExclusively())
+ throw new IllegalMonitorStateException();
+ int n = 0;
+ for (Node w = firstWaiter; w != null; w = w.nextWaiter) {
+ if (w.waitStatus == Node.CONDITION)
+ ++n;
+ }
+ return n;
+ }
+
+ /**
+ * Returns a collection containing those threads that may be
+ * waiting on this Condition.
+ * Implements {@link AbstractQueuedLongSynchronizer#getWaitingThreads}.
+ *
+ * @return the collection of threads
+ * @throws IllegalMonitorStateException if {@link #isHeldExclusively}
+ * returns {@code false}
+ */
+ protected final Collection<Thread> getWaitingThreads() {
+ if (!isHeldExclusively())
+ throw new IllegalMonitorStateException();
+ ArrayList<Thread> list = new ArrayList<Thread>();
+ for (Node w = firstWaiter; w != null; w = w.nextWaiter) {
+ if (w.waitStatus == Node.CONDITION) {
+ Thread t = w.thread;
+ if (t != null)
+ list.add(t);
+ }
+ }
+ return list;
+ }
+ }
+
+ /**
+ * Setup to support compareAndSet. We need to natively implement
+ * this here: For the sake of permitting future enhancements, we
+ * cannot explicitly subclass AtomicLong, which would be
+ * efficient and useful otherwise. So, as the lesser of evils, we
+ * natively implement using hotspot intrinsics API. And while we
+ * are at it, we do the same for other CASable fields (which could
+ * otherwise be done with atomic field updaters).
+ */
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private static final long stateOffset;
+ private static final long headOffset;
+ private static final long tailOffset;
+ private static final long waitStatusOffset;
+
+ static {
+ try {
+ stateOffset = unsafe.objectFieldOffset
+ (AbstractQueuedLongSynchronizer.class.getDeclaredField("state"));
+ headOffset = unsafe.objectFieldOffset
+ (AbstractQueuedLongSynchronizer.class.getDeclaredField("head"));
+ tailOffset = unsafe.objectFieldOffset
+ (AbstractQueuedLongSynchronizer.class.getDeclaredField("tail"));
+ waitStatusOffset = unsafe.objectFieldOffset
+ (Node.class.getDeclaredField("waitStatus"));
+
+ } catch (Exception ex) { throw new Error(ex); }
+ }
+
+ /**
+ * CAS head field. Used only by enq
+ */
+ private final boolean compareAndSetHead(Node update) {
+ return unsafe.compareAndSwapObject(this, headOffset, null, update);
+ }
+
+ /**
+ * CAS tail field. Used only by enq
+ */
+ private final boolean compareAndSetTail(Node expect, Node update) {
+ return unsafe.compareAndSwapObject(this, tailOffset, expect, update);
+ }
+
+ /**
+ * CAS waitStatus field of a node.
+ */
+ private final static boolean compareAndSetWaitStatus(Node node,
+ int expect,
+ int update) {
+ return unsafe.compareAndSwapInt(node, waitStatusOffset,
+ expect, update);
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/locks/AbstractQueuedSynchronizer.java b/libjava/classpath/external/jsr166/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
new file mode 100644
index 00000000000..a3abb2cf553
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
@@ -0,0 +1,2159 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.locks;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+import sun.misc.Unsafe;
+
+/**
+ * Provides a framework for implementing blocking locks and related
+ * synchronizers (semaphores, events, etc) that rely on
+ * first-in-first-out (FIFO) wait queues. This class is designed to
+ * be a useful basis for most kinds of synchronizers that rely on a
+ * single atomic <tt>int</tt> value to represent state. Subclasses
+ * must define the protected methods that change this state, and which
+ * define what that state means in terms of this object being acquired
+ * or released. Given these, the other methods in this class carry
+ * out all queuing and blocking mechanics. Subclasses can maintain
+ * other state fields, but only the atomically updated <tt>int</tt>
+ * value manipulated using methods {@link #getState}, {@link
+ * #setState} and {@link #compareAndSetState} is tracked with respect
+ * to synchronization.
+ *
+ * <p>Subclasses should be defined as non-public internal helper
+ * classes that are used to implement the synchronization properties
+ * of their enclosing class. Class
+ * <tt>AbstractQueuedSynchronizer</tt> does not implement any
+ * synchronization interface. Instead it defines methods such as
+ * {@link #acquireInterruptibly} that can be invoked as
+ * appropriate by concrete locks and related synchronizers to
+ * implement their public methods.
+ *
+ * <p>This class supports either or both a default <em>exclusive</em>
+ * mode and a <em>shared</em> mode. When acquired in exclusive mode,
+ * attempted acquires by other threads cannot succeed. Shared mode
+ * acquires by multiple threads may (but need not) succeed. This class
+ * does not &quot;understand&quot; these differences except in the
+ * mechanical sense that when a shared mode acquire succeeds, the next
+ * waiting thread (if one exists) must also determine whether it can
+ * acquire as well. Threads waiting in the different modes share the
+ * same FIFO queue. Usually, implementation subclasses support only
+ * one of these modes, but both can come into play for example in a
+ * {@link ReadWriteLock}. Subclasses that support only exclusive or
+ * only shared modes need not define the methods supporting the unused mode.
+ *
+ * <p>This class defines a nested {@link ConditionObject} class that
+ * can be used as a {@link Condition} implementation by subclasses
+ * supporting exclusive mode for which method {@link
+ * #isHeldExclusively} reports whether synchronization is exclusively
+ * held with respect to the current thread, method {@link #release}
+ * invoked with the current {@link #getState} value fully releases
+ * this object, and {@link #acquire}, given this saved state value,
+ * eventually restores this object to its previous acquired state. No
+ * <tt>AbstractQueuedSynchronizer</tt> method otherwise creates such a
+ * condition, so if this constraint cannot be met, do not use it. The
+ * behavior of {@link ConditionObject} depends of course on the
+ * semantics of its synchronizer implementation.
+ *
+ * <p>This class provides inspection, instrumentation, and monitoring
+ * methods for the internal queue, as well as similar methods for
+ * condition objects. These can be exported as desired into classes
+ * using an <tt>AbstractQueuedSynchronizer</tt> for their
+ * synchronization mechanics.
+ *
+ * <p>Serialization of this class stores only the underlying atomic
+ * integer maintaining state, so deserialized objects have empty
+ * thread queues. Typical subclasses requiring serializability will
+ * define a <tt>readObject</tt> method that restores this to a known
+ * initial state upon deserialization.
+ *
+ * <h3>Usage</h3>
+ *
+ * <p>To use this class as the basis of a synchronizer, redefine the
+ * following methods, as applicable, by inspecting and/or modifying
+ * the synchronization state using {@link #getState}, {@link
+ * #setState} and/or {@link #compareAndSetState}:
+ *
+ * <ul>
+ * <li> {@link #tryAcquire}
+ * <li> {@link #tryRelease}
+ * <li> {@link #tryAcquireShared}
+ * <li> {@link #tryReleaseShared}
+ * <li> {@link #isHeldExclusively}
+ *</ul>
+ *
+ * Each of these methods by default throws {@link
+ * UnsupportedOperationException}. Implementations of these methods
+ * must be internally thread-safe, and should in general be short and
+ * not block. Defining these methods is the <em>only</em> supported
+ * means of using this class. All other methods are declared
+ * <tt>final</tt> because they cannot be independently varied.
+ *
+ * <p>You may also find the inherited methods from {@link
+ * AbstractOwnableSynchronizer} useful to keep track of the thread
+ * owning an exclusive synchronizer. You are encouraged to use them
+ * -- this enables monitoring and diagnostic tools to assist users in
+ * determining which threads hold locks.
+ *
+ * <p>Even though this class is based on an internal FIFO queue, it
+ * does not automatically enforce FIFO acquisition policies. The core
+ * of exclusive synchronization takes the form:
+ *
+ * <pre>
+ * Acquire:
+ * while (!tryAcquire(arg)) {
+ * <em>enqueue thread if it is not already queued</em>;
+ * <em>possibly block current thread</em>;
+ * }
+ *
+ * Release:
+ * if (tryRelease(arg))
+ * <em>unblock the first queued thread</em>;
+ * </pre>
+ *
+ * (Shared mode is similar but may involve cascading signals.)
+ *
+ * <p>Because checks in acquire are invoked before enqueuing, a newly
+ * acquiring thread may <em>barge</em> ahead of others that are
+ * blocked and queued. However, you can, if desired, define
+ * <tt>tryAcquire</tt> and/or <tt>tryAcquireShared</tt> to disable
+ * barging by internally invoking one or more of the inspection
+ * methods. In particular, a strict FIFO lock can define
+ * <tt>tryAcquire</tt> to immediately return <tt>false</tt> if {@link
+ * #getFirstQueuedThread} does not return the current thread. A
+ * normally preferable non-strict fair version can immediately return
+ * <tt>false</tt> only if {@link #hasQueuedThreads} returns
+ * <tt>true</tt> and <tt>getFirstQueuedThread</tt> is not the current
+ * thread; or equivalently, that <tt>getFirstQueuedThread</tt> is both
+ * non-null and not the current thread. Further variations are
+ * possible.
+ *
+ * <p>Throughput and scalability are generally highest for the
+ * default barging (also known as <em>greedy</em>,
+ * <em>renouncement</em>, and <em>convoy-avoidance</em>) strategy.
+ * While this is not guaranteed to be fair or starvation-free, earlier
+ * queued threads are allowed to recontend before later queued
+ * threads, and each recontention has an unbiased chance to succeed
+ * against incoming threads. Also, while acquires do not
+ * &quot;spin&quot; in the usual sense, they may perform multiple
+ * invocations of <tt>tryAcquire</tt> interspersed with other
+ * computations before blocking. This gives most of the benefits of
+ * spins when exclusive synchronization is only briefly held, without
+ * most of the liabilities when it isn't. If so desired, you can
+ * augment this by preceding calls to acquire methods with
+ * "fast-path" checks, possibly prechecking {@link #hasContended}
+ * and/or {@link #hasQueuedThreads} to only do so if the synchronizer
+ * is likely not to be contended.
+ *
+ * <p>This class provides an efficient and scalable basis for
+ * synchronization in part by specializing its range of use to
+ * synchronizers that can rely on <tt>int</tt> state, acquire, and
+ * release parameters, and an internal FIFO wait queue. When this does
+ * not suffice, you can build synchronizers from a lower level using
+ * {@link java.util.concurrent.atomic atomic} classes, your own custom
+ * {@link java.util.Queue} classes, and {@link LockSupport} blocking
+ * support.
+ *
+ * <h3>Usage Examples</h3>
+ *
+ * <p>Here is a non-reentrant mutual exclusion lock class that uses
+ * the value zero to represent the unlocked state, and one to
+ * represent the locked state. While a non-reentrant lock
+ * does not strictly require recording of the current owner
+ * thread, this class does so anyway to make usage easier to monitor.
+ * It also supports conditions and exposes
+ * one of the instrumentation methods:
+ *
+ * <pre>
+ * class Mutex implements Lock, java.io.Serializable {
+ *
+ * // Our internal helper class
+ * private static class Sync extends AbstractQueuedSynchronizer {
+ * // Report whether in locked state
+ * protected boolean isHeldExclusively() {
+ * return getState() == 1;
+ * }
+ *
+ * // Acquire the lock if state is zero
+ * public boolean tryAcquire(int acquires) {
+ * assert acquires == 1; // Otherwise unused
+ * if (compareAndSetState(0, 1)) {
+ * setExclusiveOwnerThread(Thread.currentThread());
+ * return true;
+ * }
+ * return false;
+ * }
+ *
+ * // Release the lock by setting state to zero
+ * protected boolean tryRelease(int releases) {
+ * assert releases == 1; // Otherwise unused
+ * if (getState() == 0) throw new IllegalMonitorStateException();
+ * setExclusiveOwnerThread(null);
+ * setState(0);
+ * return true;
+ * }
+ *
+ * // Provide a Condition
+ * Condition newCondition() { return new ConditionObject(); }
+ *
+ * // Deserialize properly
+ * private void readObject(ObjectInputStream s)
+ * throws IOException, ClassNotFoundException {
+ * s.defaultReadObject();
+ * setState(0); // reset to unlocked state
+ * }
+ * }
+ *
+ * // The sync object does all the hard work. We just forward to it.
+ * private final Sync sync = new Sync();
+ *
+ * public void lock() { sync.acquire(1); }
+ * public boolean tryLock() { return sync.tryAcquire(1); }
+ * public void unlock() { sync.release(1); }
+ * public Condition newCondition() { return sync.newCondition(); }
+ * public boolean isLocked() { return sync.isHeldExclusively(); }
+ * public boolean hasQueuedThreads() { return sync.hasQueuedThreads(); }
+ * public void lockInterruptibly() throws InterruptedException {
+ * sync.acquireInterruptibly(1);
+ * }
+ * public boolean tryLock(long timeout, TimeUnit unit)
+ * throws InterruptedException {
+ * return sync.tryAcquireNanos(1, unit.toNanos(timeout));
+ * }
+ * }
+ * </pre>
+ *
+ * <p>Here is a latch class that is like a {@link CountDownLatch}
+ * except that it only requires a single <tt>signal</tt> to
+ * fire. Because a latch is non-exclusive, it uses the <tt>shared</tt>
+ * acquire and release methods.
+ *
+ * <pre>
+ * class BooleanLatch {
+ *
+ * private static class Sync extends AbstractQueuedSynchronizer {
+ * boolean isSignalled() { return getState() != 0; }
+ *
+ * protected int tryAcquireShared(int ignore) {
+ * return isSignalled()? 1 : -1;
+ * }
+ *
+ * protected boolean tryReleaseShared(int ignore) {
+ * setState(1);
+ * return true;
+ * }
+ * }
+ *
+ * private final Sync sync = new Sync();
+ * public boolean isSignalled() { return sync.isSignalled(); }
+ * public void signal() { sync.releaseShared(1); }
+ * public void await() throws InterruptedException {
+ * sync.acquireSharedInterruptibly(1);
+ * }
+ * }
+ * </pre>
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public abstract class AbstractQueuedSynchronizer
+ extends AbstractOwnableSynchronizer
+ implements java.io.Serializable {
+
+ private static final long serialVersionUID = 7373984972572414691L;
+
+ /**
+ * Creates a new <tt>AbstractQueuedSynchronizer</tt> instance
+ * with initial synchronization state of zero.
+ */
+ protected AbstractQueuedSynchronizer() { }
+
+ /**
+ * Wait queue node class.
+ *
+ * <p>The wait queue is a variant of a "CLH" (Craig, Landin, and
+ * Hagersten) lock queue. CLH locks are normally used for
+ * spinlocks. We instead use them for blocking synchronizers, but
+ * use the same basic tactic of holding some of the control
+ * information about a thread in the predecessor of its node. A
+ * "status" field in each node keeps track of whether a thread
+ * should block. A node is signalled when its predecessor
+ * releases. Each node of the queue otherwise serves as a
+ * specific-notification-style monitor holding a single waiting
+ * thread. The status field does NOT control whether threads are
+ * granted locks etc though. A thread may try to acquire if it is
+ * first in the queue. But being first does not guarantee success;
+ * it only gives the right to contend. So the currently released
+ * contender thread may need to rewait.
+ *
+ * <p>To enqueue into a CLH lock, you atomically splice it in as new
+ * tail. To dequeue, you just set the head field.
+ * <pre>
+ * +------+ prev +-----+ +-----+
+ * head | | <---- | | <---- | | tail
+ * +------+ +-----+ +-----+
+ * </pre>
+ *
+ * <p>Insertion into a CLH queue requires only a single atomic
+ * operation on "tail", so there is a simple atomic point of
+ * demarcation from unqueued to queued. Similarly, dequeing
+ * involves only updating the "head". However, it takes a bit
+ * more work for nodes to determine who their successors are,
+ * in part to deal with possible cancellation due to timeouts
+ * and interrupts.
+ *
+ * <p>The "prev" links (not used in original CLH locks), are mainly
+ * needed to handle cancellation. If a node is cancelled, its
+ * successor is (normally) relinked to a non-cancelled
+ * predecessor. For explanation of similar mechanics in the case
+ * of spin locks, see the papers by Scott and Scherer at
+ * http://www.cs.rochester.edu/u/scott/synchronization/
+ *
+ * <p>We also use "next" links to implement blocking mechanics.
+ * The thread id for each node is kept in its own node, so a
+ * predecessor signals the next node to wake up by traversing
+ * next link to determine which thread it is. Determination of
+ * successor must avoid races with newly queued nodes to set
+ * the "next" fields of their predecessors. This is solved
+ * when necessary by checking backwards from the atomically
+ * updated "tail" when a node's successor appears to be null.
+ * (Or, said differently, the next-links are an optimization
+ * so that we don't usually need a backward scan.)
+ *
+ * <p>Cancellation introduces some conservatism to the basic
+ * algorithms. Since we must poll for cancellation of other
+ * nodes, we can miss noticing whether a cancelled node is
+ * ahead or behind us. This is dealt with by always unparking
+ * successors upon cancellation, allowing them to stabilize on
+ * a new predecessor.
+ *
+ * <p>CLH queues need a dummy header node to get started. But
+ * we don't create them on construction, because it would be wasted
+ * effort if there is never contention. Instead, the node
+ * is constructed and head and tail pointers are set upon first
+ * contention.
+ *
+ * <p>Threads waiting on Conditions use the same nodes, but
+ * use an additional link. Conditions only need to link nodes
+ * in simple (non-concurrent) linked queues because they are
+ * only accessed when exclusively held. Upon await, a node is
+ * inserted into a condition queue. Upon signal, the node is
+ * transferred to the main queue. A special value of status
+ * field is used to mark which queue a node is on.
+ *
+ * <p>Thanks go to Dave Dice, Mark Moir, Victor Luchangco, Bill
+ * Scherer and Michael Scott, along with members of JSR-166
+ * expert group, for helpful ideas, discussions, and critiques
+ * on the design of this class.
+ */
+ static final class Node {
+ /** waitStatus value to indicate thread has cancelled */
+ static final int CANCELLED = 1;
+ /** waitStatus value to indicate successor's thread needs unparking */
+ static final int SIGNAL = -1;
+ /** waitStatus value to indicate thread is waiting on condition */
+ static final int CONDITION = -2;
+ /** Marker to indicate a node is waiting in shared mode */
+ static final Node SHARED = new Node();
+ /** Marker to indicate a node is waiting in exclusive mode */
+ static final Node EXCLUSIVE = null;
+
+ /**
+ * Status field, taking on only the values:
+ * SIGNAL: The successor of this node is (or will soon be)
+ * blocked (via park), so the current node must
+ * unpark its successor when it releases or
+ * cancels. To avoid races, acquire methods must
+ * first indicate they need a signal,
+ * then retry the atomic acquire, and then,
+ * on failure, block.
+ * CANCELLED: This node is cancelled due to timeout or interrupt.
+ * Nodes never leave this state. In particular,
+ * a thread with cancelled node never again blocks.
+ * CONDITION: This node is currently on a condition queue.
+ * It will not be used as a sync queue node until
+ * transferred. (Use of this value here
+ * has nothing to do with the other uses
+ * of the field, but simplifies mechanics.)
+ * 0: None of the above
+ *
+ * The values are arranged numerically to simplify use.
+ * Non-negative values mean that a node doesn't need to
+ * signal. So, most code doesn't need to check for particular
+ * values, just for sign.
+ *
+ * The field is initialized to 0 for normal sync nodes, and
+ * CONDITION for condition nodes. It is modified only using
+ * CAS.
+ */
+ volatile int waitStatus;
+
+ /**
+ * Link to predecessor node that current node/thread relies on
+ * for checking waitStatus. Assigned during enqueing, and nulled
+ * out (for sake of GC) only upon dequeuing. Also, upon
+ * cancellation of a predecessor, we short-circuit while
+ * finding a non-cancelled one, which will always exist
+ * because the head node is never cancelled: A node becomes
+ * head only as a result of successful acquire. A
+ * cancelled thread never succeeds in acquiring, and a thread only
+ * cancels itself, not any other node.
+ */
+ volatile Node prev;
+
+ /**
+ * Link to the successor node that the current node/thread
+ * unparks upon release. Assigned once during enqueuing, and
+ * nulled out (for sake of GC) when no longer needed. Upon
+ * cancellation, we cannot adjust this field, but can notice
+ * status and bypass the node if cancelled. The enq operation
+ * does not assign next field of a predecessor until after
+ * attachment, so seeing a null next field does not
+ * necessarily mean that node is at end of queue. However, if
+ * a next field appears to be null, we can scan prev's from
+ * the tail to double-check.
+ */
+ volatile Node next;
+
+ /**
+ * The thread that enqueued this node. Initialized on
+ * construction and nulled out after use.
+ */
+ volatile Thread thread;
+
+ /**
+ * Link to next node waiting on condition, or the special
+ * value SHARED. Because condition queues are accessed only
+ * when holding in exclusive mode, we just need a simple
+ * linked queue to hold nodes while they are waiting on
+ * conditions. They are then transferred to the queue to
+ * re-acquire. And because conditions can only be exclusive,
+ * we save a field by using special value to indicate shared
+ * mode.
+ */
+ Node nextWaiter;
+
+ /**
+ * Returns true if node is waiting in shared mode
+ */
+ final boolean isShared() {
+ return nextWaiter == SHARED;
+ }
+
+ /**
+ * Returns previous node, or throws NullPointerException if
+ * null. Use when predecessor cannot be null.
+ * @return the predecessor of this node
+ */
+ final Node predecessor() throws NullPointerException {
+ Node p = prev;
+ if (p == null)
+ throw new NullPointerException();
+ else
+ return p;
+ }
+
+ Node() { // Used to establish initial head or SHARED marker
+ }
+
+ Node(Thread thread, Node mode) { // Used by addWaiter
+ this.nextWaiter = mode;
+ this.thread = thread;
+ }
+
+ Node(Thread thread, int waitStatus) { // Used by Condition
+ this.waitStatus = waitStatus;
+ this.thread = thread;
+ }
+ }
+
+ /**
+ * Head of the wait queue, lazily initialized. Except for
+ * initialization, it is modified only via method setHead. Note:
+ * If head exists, its waitStatus is guaranteed not to be
+ * CANCELLED.
+ */
+ private transient volatile Node head;
+
+ /**
+ * Tail of the wait queue, lazily initialized. Modified only via
+ * method enq to add new wait node.
+ */
+ private transient volatile Node tail;
+
+ /**
+ * The synchronization state.
+ */
+ private volatile int state;
+
+ /**
+ * Returns the current value of synchronization state.
+ * This operation has memory semantics of a <tt>volatile</tt> read.
+ * @return current state value
+ */
+ protected final int getState() {
+ return state;
+ }
+
+ /**
+ * Sets the value of synchronization state.
+ * This operation has memory semantics of a <tt>volatile</tt> write.
+ * @param newState the new state value
+ */
+ protected final void setState(int newState) {
+ state = newState;
+ }
+
+ /**
+ * Atomically sets synchronization state to the given updated
+ * value if the current state value equals the expected value.
+ * This operation has memory semantics of a <tt>volatile</tt> read
+ * and write.
+ *
+ * @param expect the expected value
+ * @param update the new value
+ * @return true if successful. False return indicates that the actual
+ * value was not equal to the expected value.
+ */
+ protected final boolean compareAndSetState(int expect, int update) {
+ // See below for intrinsics setup to support this
+ return unsafe.compareAndSwapInt(this, stateOffset, expect, update);
+ }
+
+ // Queuing utilities
+
+ /**
+ * The number of nanoseconds for which it is faster to spin
+ * rather than to use timed park. A rough estimate suffices
+ * to improve responsiveness with very short timeouts.
+ */
+ static final long spinForTimeoutThreshold = 1000L;
+
+ /**
+ * Inserts node into queue, initializing if necessary. See picture above.
+ * @param node the node to insert
+ * @return node's predecessor
+ */
+ private Node enq(final Node node) {
+ for (;;) {
+ Node t = tail;
+ if (t == null) { // Must initialize
+ Node h = new Node(); // Dummy header
+ h.next = node;
+ node.prev = h;
+ if (compareAndSetHead(h)) {
+ tail = node;
+ return h;
+ }
+ }
+ else {
+ node.prev = t;
+ if (compareAndSetTail(t, node)) {
+ t.next = node;
+ return t;
+ }
+ }
+ }
+ }
+
+ /**
+ * Creates and enqueues node for given thread and mode.
+ *
+ * @param current the thread
+ * @param mode Node.EXCLUSIVE for exclusive, Node.SHARED for shared
+ * @return the new node
+ */
+ private Node addWaiter(Node mode) {
+ Node node = new Node(Thread.currentThread(), mode);
+ // Try the fast path of enq; backup to full enq on failure
+ Node pred = tail;
+ if (pred != null) {
+ node.prev = pred;
+ if (compareAndSetTail(pred, node)) {
+ pred.next = node;
+ return node;
+ }
+ }
+ enq(node);
+ return node;
+ }
+
+ /**
+ * Sets head of queue to be node, thus dequeuing. Called only by
+ * acquire methods. Also nulls out unused fields for sake of GC
+ * and to suppress unnecessary signals and traversals.
+ *
+ * @param node the node
+ */
+ private void setHead(Node node) {
+ head = node;
+ node.thread = null;
+ node.prev = null;
+ }
+
+ /**
+ * Wakes up node's successor, if one exists.
+ *
+ * @param node the node
+ */
+ private void unparkSuccessor(Node node) {
+ /*
+ * Try to clear status in anticipation of signalling. It is
+ * OK if this fails or if status is changed by waiting thread.
+ */
+ compareAndSetWaitStatus(node, Node.SIGNAL, 0);
+
+ /*
+ * Thread to unpark is held in successor, which is normally
+ * just the next node. But if cancelled or apparently null,
+ * traverse backwards from tail to find the actual
+ * non-cancelled successor.
+ */
+ Node s = node.next;
+ if (s == null || s.waitStatus > 0) {
+ s = null;
+ for (Node t = tail; t != null && t != node; t = t.prev)
+ if (t.waitStatus <= 0)
+ s = t;
+ }
+ if (s != null)
+ LockSupport.unpark(s.thread);
+ }
+
+ /**
+ * Sets head of queue, and checks if successor may be waiting
+ * in shared mode, if so propagating if propagate > 0.
+ *
+ * @param pred the node holding waitStatus for node
+ * @param node the node
+ * @param propagate the return value from a tryAcquireShared
+ */
+ private void setHeadAndPropagate(Node node, int propagate) {
+ setHead(node);
+ if (propagate > 0 && node.waitStatus != 0) {
+ /*
+ * Don't bother fully figuring out successor. If it
+ * looks null, call unparkSuccessor anyway to be safe.
+ */
+ Node s = node.next;
+ if (s == null || s.isShared())
+ unparkSuccessor(node);
+ }
+ }
+
+ // Utilities for various versions of acquire
+
+ /**
+ * Cancels an ongoing attempt to acquire.
+ *
+ * @param node the node
+ */
+ private void cancelAcquire(Node node) {
+ if (node != null) { // Ignore if node doesn't exist
+ node.thread = null;
+ // Can use unconditional write instead of CAS here
+ node.waitStatus = Node.CANCELLED;
+ unparkSuccessor(node);
+ }
+ }
+
+ /**
+ * Checks and updates status for a node that failed to acquire.
+ * Returns true if thread should block. This is the main signal
+ * control in all acquire loops. Requires that pred == node.prev
+ *
+ * @param pred node's predecessor holding status
+ * @param node the node
+ * @return {@code true} if thread should block
+ */
+ private static boolean shouldParkAfterFailedAcquire(Node pred, Node node) {
+ int s = pred.waitStatus;
+ if (s < 0)
+ /*
+ * This node has already set status asking a release
+ * to signal it, so it can safely park
+ */
+ return true;
+ if (s > 0)
+ /*
+ * Predecessor was cancelled. Move up to its predecessor
+ * and indicate retry.
+ */
+ node.prev = pred.prev;
+ else
+ /*
+ * Indicate that we need a signal, but don't park yet. Caller
+ * will need to retry to make sure it cannot acquire before
+ * parking.
+ */
+ compareAndSetWaitStatus(pred, 0, Node.SIGNAL);
+ return false;
+ }
+
+ /**
+ * Convenience method to interrupt current thread.
+ */
+ private static void selfInterrupt() {
+ Thread.currentThread().interrupt();
+ }
+
+ /**
+ * Convenience method to park and then check if interrupted
+ *
+ * @return {@code true} if interrupted
+ */
+ private final boolean parkAndCheckInterrupt() {
+ LockSupport.park(this);
+ return Thread.interrupted();
+ }
+
+ /*
+ * Various flavors of acquire, varying in exclusive/shared and
+ * control modes. Each is mostly the same, but annoyingly
+ * different. Only a little bit of factoring is possible due to
+ * interactions of exception mechanics (including ensuring that we
+ * cancel if tryAcquire throws exception) and other control, at
+ * least not without hurting performance too much.
+ */
+
+ /**
+ * Acquires in exclusive uninterruptible mode for thread already in
+ * queue. Used by condition wait methods as well as acquire.
+ *
+ * @param node the node
+ * @param arg the acquire argument
+ * @return {@code true} if interrupted while waiting
+ */
+ final boolean acquireQueued(final Node node, int arg) {
+ try {
+ boolean interrupted = false;
+ for (;;) {
+ final Node p = node.predecessor();
+ if (p == head && tryAcquire(arg)) {
+ setHead(node);
+ p.next = null; // help GC
+ return interrupted;
+ }
+ if (shouldParkAfterFailedAcquire(p, node) &&
+ parkAndCheckInterrupt())
+ interrupted = true;
+ }
+ } catch (RuntimeException ex) {
+ cancelAcquire(node);
+ throw ex;
+ }
+ }
+
+ /**
+ * Acquires in exclusive interruptible mode.
+ * @param arg the acquire argument
+ */
+ private void doAcquireInterruptibly(int arg)
+ throws InterruptedException {
+ final Node node = addWaiter(Node.EXCLUSIVE);
+ try {
+ for (;;) {
+ final Node p = node.predecessor();
+ if (p == head && tryAcquire(arg)) {
+ setHead(node);
+ p.next = null; // help GC
+ return;
+ }
+ if (shouldParkAfterFailedAcquire(p, node) &&
+ parkAndCheckInterrupt())
+ break;
+ }
+ } catch (RuntimeException ex) {
+ cancelAcquire(node);
+ throw ex;
+ }
+ // Arrive here only if interrupted
+ cancelAcquire(node);
+ throw new InterruptedException();
+ }
+
+ /**
+ * Acquires in exclusive timed mode.
+ *
+ * @param arg the acquire argument
+ * @param nanosTimeout max wait time
+ * @return {@code true} if acquired
+ */
+ private boolean doAcquireNanos(int arg, long nanosTimeout)
+ throws InterruptedException {
+ long lastTime = System.nanoTime();
+ final Node node = addWaiter(Node.EXCLUSIVE);
+ try {
+ for (;;) {
+ final Node p = node.predecessor();
+ if (p == head && tryAcquire(arg)) {
+ setHead(node);
+ p.next = null; // help GC
+ return true;
+ }
+ if (nanosTimeout <= 0) {
+ cancelAcquire(node);
+ return false;
+ }
+ if (nanosTimeout > spinForTimeoutThreshold &&
+ shouldParkAfterFailedAcquire(p, node))
+ LockSupport.parkNanos(this, nanosTimeout);
+ long now = System.nanoTime();
+ nanosTimeout -= now - lastTime;
+ lastTime = now;
+ if (Thread.interrupted())
+ break;
+ }
+ } catch (RuntimeException ex) {
+ cancelAcquire(node);
+ throw ex;
+ }
+ // Arrive here only if interrupted
+ cancelAcquire(node);
+ throw new InterruptedException();
+ }
+
+ /**
+ * Acquires in shared uninterruptible mode.
+ * @param arg the acquire argument
+ */
+ private void doAcquireShared(int arg) {
+ final Node node = addWaiter(Node.SHARED);
+ try {
+ boolean interrupted = false;
+ for (;;) {
+ final Node p = node.predecessor();
+ if (p == head) {
+ int r = tryAcquireShared(arg);
+ if (r >= 0) {
+ setHeadAndPropagate(node, r);
+ p.next = null; // help GC
+ if (interrupted)
+ selfInterrupt();
+ return;
+ }
+ }
+ if (shouldParkAfterFailedAcquire(p, node) &&
+ parkAndCheckInterrupt())
+ interrupted = true;
+ }
+ } catch (RuntimeException ex) {
+ cancelAcquire(node);
+ throw ex;
+ }
+ }
+
+ /**
+ * Acquires in shared interruptible mode.
+ * @param arg the acquire argument
+ */
+ private void doAcquireSharedInterruptibly(int arg)
+ throws InterruptedException {
+ final Node node = addWaiter(Node.SHARED);
+ try {
+ for (;;) {
+ final Node p = node.predecessor();
+ if (p == head) {
+ int r = tryAcquireShared(arg);
+ if (r >= 0) {
+ setHeadAndPropagate(node, r);
+ p.next = null; // help GC
+ return;
+ }
+ }
+ if (shouldParkAfterFailedAcquire(p, node) &&
+ parkAndCheckInterrupt())
+ break;
+ }
+ } catch (RuntimeException ex) {
+ cancelAcquire(node);
+ throw ex;
+ }
+ // Arrive here only if interrupted
+ cancelAcquire(node);
+ throw new InterruptedException();
+ }
+
+ /**
+ * Acquires in shared timed mode.
+ *
+ * @param arg the acquire argument
+ * @param nanosTimeout max wait time
+ * @return {@code true} if acquired
+ */
+ private boolean doAcquireSharedNanos(int arg, long nanosTimeout)
+ throws InterruptedException {
+
+ long lastTime = System.nanoTime();
+ final Node node = addWaiter(Node.SHARED);
+ try {
+ for (;;) {
+ final Node p = node.predecessor();
+ if (p == head) {
+ int r = tryAcquireShared(arg);
+ if (r >= 0) {
+ setHeadAndPropagate(node, r);
+ p.next = null; // help GC
+ return true;
+ }
+ }
+ if (nanosTimeout <= 0) {
+ cancelAcquire(node);
+ return false;
+ }
+ if (nanosTimeout > spinForTimeoutThreshold &&
+ shouldParkAfterFailedAcquire(p, node))
+ LockSupport.parkNanos(this, nanosTimeout);
+ long now = System.nanoTime();
+ nanosTimeout -= now - lastTime;
+ lastTime = now;
+ if (Thread.interrupted())
+ break;
+ }
+ } catch (RuntimeException ex) {
+ cancelAcquire(node);
+ throw ex;
+ }
+ // Arrive here only if interrupted
+ cancelAcquire(node);
+ throw new InterruptedException();
+ }
+
+ // Main exported methods
+
+ /**
+ * Attempts to acquire in exclusive mode. This method should query
+ * if the state of the object permits it to be acquired in the
+ * exclusive mode, and if so to acquire it.
+ *
+ * <p>This method is always invoked by the thread performing
+ * acquire. If this method reports failure, the acquire method
+ * may queue the thread, if it is not already queued, until it is
+ * signalled by a release from some other thread. This can be used
+ * to implement method {@link Lock#tryLock()}.
+ *
+ * <p>The default
+ * implementation throws {@link UnsupportedOperationException}.
+ *
+ * @param arg the acquire argument. This value is always the one
+ * passed to an acquire method, or is the value saved on entry
+ * to a condition wait. The value is otherwise uninterpreted
+ * and can represent anything you like.
+ * @return {@code true} if successful. Upon success, this object has
+ * been acquired.
+ * @throws IllegalMonitorStateException if acquiring would place this
+ * synchronizer in an illegal state. This exception must be
+ * thrown in a consistent fashion for synchronization to work
+ * correctly.
+ * @throws UnsupportedOperationException if exclusive mode is not supported
+ */
+ protected boolean tryAcquire(int arg) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Attempts to set the state to reflect a release in exclusive
+ * mode.
+ *
+ * <p>This method is always invoked by the thread performing release.
+ *
+ * <p>The default implementation throws
+ * {@link UnsupportedOperationException}.
+ *
+ * @param arg the release argument. This value is always the one
+ * passed to a release method, or the current state value upon
+ * entry to a condition wait. The value is otherwise
+ * uninterpreted and can represent anything you like.
+ * @return {@code true} if this object is now in a fully released
+ * state, so that any waiting threads may attempt to acquire;
+ * and {@code false} otherwise.
+ * @throws IllegalMonitorStateException if releasing would place this
+ * synchronizer in an illegal state. This exception must be
+ * thrown in a consistent fashion for synchronization to work
+ * correctly.
+ * @throws UnsupportedOperationException if exclusive mode is not supported
+ */
+ protected boolean tryRelease(int arg) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Attempts to acquire in shared mode. This method should query if
+ * the state of the object permits it to be acquired in the shared
+ * mode, and if so to acquire it.
+ *
+ * <p>This method is always invoked by the thread performing
+ * acquire. If this method reports failure, the acquire method
+ * may queue the thread, if it is not already queued, until it is
+ * signalled by a release from some other thread.
+ *
+ * <p>The default implementation throws {@link
+ * UnsupportedOperationException}.
+ *
+ * @param arg the acquire argument. This value is always the one
+ * passed to an acquire method, or is the value saved on entry
+ * to a condition wait. The value is otherwise uninterpreted
+ * and can represent anything you like.
+ * @return a negative value on failure; zero if acquisition in shared
+ * mode succeeded but no subsequent shared-mode acquire can
+ * succeed; and a positive value if acquisition in shared
+ * mode succeeded and subsequent shared-mode acquires might
+ * also succeed, in which case a subsequent waiting thread
+ * must check availability. (Support for three different
+ * return values enables this method to be used in contexts
+ * where acquires only sometimes act exclusively.) Upon
+ * success, this object has been acquired.
+ * @throws IllegalMonitorStateException if acquiring would place this
+ * synchronizer in an illegal state. This exception must be
+ * thrown in a consistent fashion for synchronization to work
+ * correctly.
+ * @throws UnsupportedOperationException if shared mode is not supported
+ */
+ protected int tryAcquireShared(int arg) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Attempts to set the state to reflect a release in shared mode.
+ *
+ * <p>This method is always invoked by the thread performing release.
+ *
+ * <p>The default implementation throws
+ * {@link UnsupportedOperationException}.
+ *
+ * @param arg the release argument. This value is always the one
+ * passed to a release method, or the current state value upon
+ * entry to a condition wait. The value is otherwise
+ * uninterpreted and can represent anything you like.
+ * @return {@code true} if this release of shared mode may permit a
+ * waiting acquire (shared or exclusive) to succeed; and
+ * {@code false} otherwise
+ * @throws IllegalMonitorStateException if releasing would place this
+ * synchronizer in an illegal state. This exception must be
+ * thrown in a consistent fashion for synchronization to work
+ * correctly.
+ * @throws UnsupportedOperationException if shared mode is not supported
+ */
+ protected boolean tryReleaseShared(int arg) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Returns {@code true} if synchronization is held exclusively with
+ * respect to the current (calling) thread. This method is invoked
+ * upon each call to a non-waiting {@link ConditionObject} method.
+ * (Waiting methods instead invoke {@link #release}.)
+ *
+ * <p>The default implementation throws {@link
+ * UnsupportedOperationException}. This method is invoked
+ * internally only within {@link ConditionObject} methods, so need
+ * not be defined if conditions are not used.
+ *
+ * @return {@code true} if synchronization is held exclusively;
+ * {@code false} otherwise
+ * @throws UnsupportedOperationException if conditions are not supported
+ */
+ protected boolean isHeldExclusively() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Acquires in exclusive mode, ignoring interrupts. Implemented
+ * by invoking at least once {@link #tryAcquire},
+ * returning on success. Otherwise the thread is queued, possibly
+ * repeatedly blocking and unblocking, invoking {@link
+ * #tryAcquire} until success. This method can be used
+ * to implement method {@link Lock#lock}.
+ *
+ * @param arg the acquire argument. This value is conveyed to
+ * {@link #tryAcquire} but is otherwise uninterpreted and
+ * can represent anything you like.
+ */
+ public final void acquire(int arg) {
+ if (!tryAcquire(arg) &&
+ acquireQueued(addWaiter(Node.EXCLUSIVE), arg))
+ selfInterrupt();
+ }
+
+ /**
+ * Acquires in exclusive mode, aborting if interrupted.
+ * Implemented by first checking interrupt status, then invoking
+ * at least once {@link #tryAcquire}, returning on
+ * success. Otherwise the thread is queued, possibly repeatedly
+ * blocking and unblocking, invoking {@link #tryAcquire}
+ * until success or the thread is interrupted. This method can be
+ * used to implement method {@link Lock#lockInterruptibly}.
+ *
+ * @param arg the acquire argument. This value is conveyed to
+ * {@link #tryAcquire} but is otherwise uninterpreted and
+ * can represent anything you like.
+ * @throws InterruptedException if the current thread is interrupted
+ */
+ public final void acquireInterruptibly(int arg) throws InterruptedException {
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ if (!tryAcquire(arg))
+ doAcquireInterruptibly(arg);
+ }
+
+ /**
+ * Attempts to acquire in exclusive mode, aborting if interrupted,
+ * and failing if the given timeout elapses. Implemented by first
+ * checking interrupt status, then invoking at least once {@link
+ * #tryAcquire}, returning on success. Otherwise, the thread is
+ * queued, possibly repeatedly blocking and unblocking, invoking
+ * {@link #tryAcquire} until success or the thread is interrupted
+ * or the timeout elapses. This method can be used to implement
+ * method {@link Lock#tryLock(long, TimeUnit)}.
+ *
+ * @param arg the acquire argument. This value is conveyed to
+ * {@link #tryAcquire} but is otherwise uninterpreted and
+ * can represent anything you like.
+ * @param nanosTimeout the maximum number of nanoseconds to wait
+ * @return {@code true} if acquired; {@code false} if timed out
+ * @throws InterruptedException if the current thread is interrupted
+ */
+ public final boolean tryAcquireNanos(int arg, long nanosTimeout) throws InterruptedException {
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ return tryAcquire(arg) ||
+ doAcquireNanos(arg, nanosTimeout);
+ }
+
+ /**
+ * Releases in exclusive mode. Implemented by unblocking one or
+ * more threads if {@link #tryRelease} returns true.
+ * This method can be used to implement method {@link Lock#unlock}.
+ *
+ * @param arg the release argument. This value is conveyed to
+ * {@link #tryRelease} but is otherwise uninterpreted and
+ * can represent anything you like.
+ * @return the value returned from {@link #tryRelease}
+ */
+ public final boolean release(int arg) {
+ if (tryRelease(arg)) {
+ Node h = head;
+ if (h != null && h.waitStatus != 0)
+ unparkSuccessor(h);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Acquires in shared mode, ignoring interrupts. Implemented by
+ * first invoking at least once {@link #tryAcquireShared},
+ * returning on success. Otherwise the thread is queued, possibly
+ * repeatedly blocking and unblocking, invoking {@link
+ * #tryAcquireShared} until success.
+ *
+ * @param arg the acquire argument. This value is conveyed to
+ * {@link #tryAcquireShared} but is otherwise uninterpreted
+ * and can represent anything you like.
+ */
+ public final void acquireShared(int arg) {
+ if (tryAcquireShared(arg) < 0)
+ doAcquireShared(arg);
+ }
+
+ /**
+ * Acquires in shared mode, aborting if interrupted. Implemented
+ * by first checking interrupt status, then invoking at least once
+ * {@link #tryAcquireShared}, returning on success. Otherwise the
+ * thread is queued, possibly repeatedly blocking and unblocking,
+ * invoking {@link #tryAcquireShared} until success or the thread
+ * is interrupted.
+ * @param arg the acquire argument.
+ * This value is conveyed to {@link #tryAcquireShared} but is
+ * otherwise uninterpreted and can represent anything
+ * you like.
+ * @throws InterruptedException if the current thread is interrupted
+ */
+ public final void acquireSharedInterruptibly(int arg) throws InterruptedException {
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ if (tryAcquireShared(arg) < 0)
+ doAcquireSharedInterruptibly(arg);
+ }
+
+ /**
+ * Attempts to acquire in shared mode, aborting if interrupted, and
+ * failing if the given timeout elapses. Implemented by first
+ * checking interrupt status, then invoking at least once {@link
+ * #tryAcquireShared}, returning on success. Otherwise, the
+ * thread is queued, possibly repeatedly blocking and unblocking,
+ * invoking {@link #tryAcquireShared} until success or the thread
+ * is interrupted or the timeout elapses.
+ *
+ * @param arg the acquire argument. This value is conveyed to
+ * {@link #tryAcquireShared} but is otherwise uninterpreted
+ * and can represent anything you like.
+ * @param nanosTimeout the maximum number of nanoseconds to wait
+ * @return {@code true} if acquired; {@code false} if timed out
+ * @throws InterruptedException if the current thread is interrupted
+ */
+ public final boolean tryAcquireSharedNanos(int arg, long nanosTimeout) throws InterruptedException {
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ return tryAcquireShared(arg) >= 0 ||
+ doAcquireSharedNanos(arg, nanosTimeout);
+ }
+
+ /**
+ * Releases in shared mode. Implemented by unblocking one or more
+ * threads if {@link #tryReleaseShared} returns true.
+ *
+ * @param arg the release argument. This value is conveyed to
+ * {@link #tryReleaseShared} but is otherwise uninterpreted
+ * and can represent anything you like.
+ * @return the value returned from {@link #tryReleaseShared}
+ */
+ public final boolean releaseShared(int arg) {
+ if (tryReleaseShared(arg)) {
+ Node h = head;
+ if (h != null && h.waitStatus != 0)
+ unparkSuccessor(h);
+ return true;
+ }
+ return false;
+ }
+
+ // Queue inspection methods
+
+ /**
+ * Queries whether any threads are waiting to acquire. Note that
+ * because cancellations due to interrupts and timeouts may occur
+ * at any time, a {@code true} return does not guarantee that any
+ * other thread will ever acquire.
+ *
+ * <p>In this implementation, this operation returns in
+ * constant time.
+ *
+ * @return {@code true} if there may be other threads waiting to acquire
+ */
+ public final boolean hasQueuedThreads() {
+ return head != tail;
+ }
+
+ /**
+ * Queries whether any threads have ever contended to acquire this
+ * synchronizer; that is if an acquire method has ever blocked.
+ *
+ * <p>In this implementation, this operation returns in
+ * constant time.
+ *
+ * @return {@code true} if there has ever been contention
+ */
+ public final boolean hasContended() {
+ return head != null;
+ }
+
+ /**
+ * Returns the first (longest-waiting) thread in the queue, or
+ * {@code null} if no threads are currently queued.
+ *
+ * <p>In this implementation, this operation normally returns in
+ * constant time, but may iterate upon contention if other threads are
+ * concurrently modifying the queue.
+ *
+ * @return the first (longest-waiting) thread in the queue, or
+ * {@code null} if no threads are currently queued
+ */
+ public final Thread getFirstQueuedThread() {
+ // handle only fast path, else relay
+ return (head == tail)? null : fullGetFirstQueuedThread();
+ }
+
+ /**
+ * Version of getFirstQueuedThread called when fastpath fails
+ */
+ private Thread fullGetFirstQueuedThread() {
+ /*
+ * The first node is normally h.next. Try to get its
+ * thread field, ensuring consistent reads: If thread
+ * field is nulled out or s.prev is no longer head, then
+ * some other thread(s) concurrently performed setHead in
+ * between some of our reads. We try this twice before
+ * resorting to traversal.
+ */
+ Node h, s;
+ Thread st;
+ if (((h = head) != null && (s = h.next) != null &&
+ s.prev == head && (st = s.thread) != null) ||
+ ((h = head) != null && (s = h.next) != null &&
+ s.prev == head && (st = s.thread) != null))
+ return st;
+
+ /*
+ * Head's next field might not have been set yet, or may have
+ * been unset after setHead. So we must check to see if tail
+ * is actually first node. If not, we continue on, safely
+ * traversing from tail back to head to find first,
+ * guaranteeing termination.
+ */
+
+ Node t = tail;
+ Thread firstThread = null;
+ while (t != null && t != head) {
+ Thread tt = t.thread;
+ if (tt != null)
+ firstThread = tt;
+ t = t.prev;
+ }
+ return firstThread;
+ }
+
+ /**
+ * Returns true if the given thread is currently queued.
+ *
+ * <p>This implementation traverses the queue to determine
+ * presence of the given thread.
+ *
+ * @param thread the thread
+ * @return {@code true} if the given thread is on the queue
+ * @throws NullPointerException if the thread is null
+ */
+ public final boolean isQueued(Thread thread) {
+ if (thread == null)
+ throw new NullPointerException();
+ for (Node p = tail; p != null; p = p.prev)
+ if (p.thread == thread)
+ return true;
+ return false;
+ }
+
+ /**
+ * Return {@code true} if the apparent first queued thread, if one
+ * exists, is not waiting in exclusive mode. Used only as a heuristic
+ * in ReentrantReadWriteLock.
+ */
+ final boolean apparentlyFirstQueuedIsExclusive() {
+ Node h, s;
+ return ((h = head) != null && (s = h.next) != null &&
+ s.nextWaiter != Node.SHARED);
+ }
+
+ /**
+ * Return {@code true} if the queue is empty or if the given thread
+ * is at the head of the queue. This is reliable only if
+ * <tt>current</tt> is actually Thread.currentThread() of caller.
+ */
+ final boolean isFirst(Thread current) {
+ Node h, s;
+ return ((h = head) == null ||
+ ((s = h.next) != null && s.thread == current) ||
+ fullIsFirst(current));
+ }
+
+ final boolean fullIsFirst(Thread current) {
+ // same idea as fullGetFirstQueuedThread
+ Node h, s;
+ Thread firstThread = null;
+ if (((h = head) != null && (s = h.next) != null &&
+ s.prev == head && (firstThread = s.thread) != null))
+ return firstThread == current;
+ Node t = tail;
+ while (t != null && t != head) {
+ Thread tt = t.thread;
+ if (tt != null)
+ firstThread = tt;
+ t = t.prev;
+ }
+ return firstThread == current || firstThread == null;
+ }
+
+
+ // Instrumentation and monitoring methods
+
+ /**
+ * Returns an estimate of the number of threads waiting to
+ * acquire. The value is only an estimate because the number of
+ * threads may change dynamically while this method traverses
+ * internal data structures. This method is designed for use in
+ * monitoring system state, not for synchronization
+ * control.
+ *
+ * @return the estimated number of threads waiting to acquire
+ */
+ public final int getQueueLength() {
+ int n = 0;
+ for (Node p = tail; p != null; p = p.prev) {
+ if (p.thread != null)
+ ++n;
+ }
+ return n;
+ }
+
+ /**
+ * Returns a collection containing threads that may be waiting to
+ * acquire. Because the actual set of threads may change
+ * dynamically while constructing this result, the returned
+ * collection is only a best-effort estimate. The elements of the
+ * returned collection are in no particular order. This method is
+ * designed to facilitate construction of subclasses that provide
+ * more extensive monitoring facilities.
+ *
+ * @return the collection of threads
+ */
+ public final Collection<Thread> getQueuedThreads() {
+ ArrayList<Thread> list = new ArrayList<Thread>();
+ for (Node p = tail; p != null; p = p.prev) {
+ Thread t = p.thread;
+ if (t != null)
+ list.add(t);
+ }
+ return list;
+ }
+
+ /**
+ * Returns a collection containing threads that may be waiting to
+ * acquire in exclusive mode. This has the same properties
+ * as {@link #getQueuedThreads} except that it only returns
+ * those threads waiting due to an exclusive acquire.
+ *
+ * @return the collection of threads
+ */
+ public final Collection<Thread> getExclusiveQueuedThreads() {
+ ArrayList<Thread> list = new ArrayList<Thread>();
+ for (Node p = tail; p != null; p = p.prev) {
+ if (!p.isShared()) {
+ Thread t = p.thread;
+ if (t != null)
+ list.add(t);
+ }
+ }
+ return list;
+ }
+
+ /**
+ * Returns a collection containing threads that may be waiting to
+ * acquire in shared mode. This has the same properties
+ * as {@link #getQueuedThreads} except that it only returns
+ * those threads waiting due to a shared acquire.
+ *
+ * @return the collection of threads
+ */
+ public final Collection<Thread> getSharedQueuedThreads() {
+ ArrayList<Thread> list = new ArrayList<Thread>();
+ for (Node p = tail; p != null; p = p.prev) {
+ if (p.isShared()) {
+ Thread t = p.thread;
+ if (t != null)
+ list.add(t);
+ }
+ }
+ return list;
+ }
+
+ /**
+ * Returns a string identifying this synchronizer, as well as its state.
+ * The state, in brackets, includes the String {@code "State ="}
+ * followed by the current value of {@link #getState}, and either
+ * {@code "nonempty"} or {@code "empty"} depending on whether the
+ * queue is empty.
+ *
+ * @return a string identifying this synchronizer, as well as its state
+ */
+ public String toString() {
+ int s = getState();
+ String q = hasQueuedThreads()? "non" : "";
+ return super.toString() +
+ "[State = " + s + ", " + q + "empty queue]";
+ }
+
+
+ // Internal support methods for Conditions
+
+ /**
+ * Returns true if a node, always one that was initially placed on
+ * a condition queue, is now waiting to reacquire on sync queue.
+ * @param node the node
+ * @return true if is reacquiring
+ */
+ final boolean isOnSyncQueue(Node node) {
+ if (node.waitStatus == Node.CONDITION || node.prev == null)
+ return false;
+ if (node.next != null) // If has successor, it must be on queue
+ return true;
+ /*
+ * node.prev can be non-null, but not yet on queue because
+ * the CAS to place it on queue can fail. So we have to
+ * traverse from tail to make sure it actually made it. It
+ * will always be near the tail in calls to this method, and
+ * unless the CAS failed (which is unlikely), it will be
+ * there, so we hardly ever traverse much.
+ */
+ return findNodeFromTail(node);
+ }
+
+ /**
+ * Returns true if node is on sync queue by searching backwards from tail.
+ * Called only when needed by isOnSyncQueue.
+ * @return true if present
+ */
+ private boolean findNodeFromTail(Node node) {
+ Node t = tail;
+ for (;;) {
+ if (t == node)
+ return true;
+ if (t == null)
+ return false;
+ t = t.prev;
+ }
+ }
+
+ /**
+ * Transfers a node from a condition queue onto sync queue.
+ * Returns true if successful.
+ * @param node the node
+ * @return true if successfully transferred (else the node was
+ * cancelled before signal).
+ */
+ final boolean transferForSignal(Node node) {
+ /*
+ * If cannot change waitStatus, the node has been cancelled.
+ */
+ if (!compareAndSetWaitStatus(node, Node.CONDITION, 0))
+ return false;
+
+ /*
+ * Splice onto queue and try to set waitStatus of predecessor to
+ * indicate that thread is (probably) waiting. If cancelled or
+ * attempt to set waitStatus fails, wake up to resync (in which
+ * case the waitStatus can be transiently and harmlessly wrong).
+ */
+ Node p = enq(node);
+ int c = p.waitStatus;
+ if (c > 0 || !compareAndSetWaitStatus(p, c, Node.SIGNAL))
+ LockSupport.unpark(node.thread);
+ return true;
+ }
+
+ /**
+ * Transfers node, if necessary, to sync queue after a cancelled
+ * wait. Returns true if thread was cancelled before being
+ * signalled.
+ * @param current the waiting thread
+ * @param node its node
+ * @return true if cancelled before the node was signalled.
+ */
+ final boolean transferAfterCancelledWait(Node node) {
+ if (compareAndSetWaitStatus(node, Node.CONDITION, 0)) {
+ enq(node);
+ return true;
+ }
+ /*
+ * If we lost out to a signal(), then we can't proceed
+ * until it finishes its enq(). Cancelling during an
+ * incomplete transfer is both rare and transient, so just
+ * spin.
+ */
+ while (!isOnSyncQueue(node))
+ Thread.yield();
+ return false;
+ }
+
+ /**
+ * Invokes release with current state value; returns saved state.
+ * Cancels node and throws exception on failure.
+ * @param node the condition node for this wait
+ * @return previous sync state
+ */
+ final int fullyRelease(Node node) {
+ try {
+ int savedState = getState();
+ if (release(savedState))
+ return savedState;
+ } catch (RuntimeException ex) {
+ node.waitStatus = Node.CANCELLED;
+ throw ex;
+ }
+ // reach here if release fails
+ node.waitStatus = Node.CANCELLED;
+ throw new IllegalMonitorStateException();
+ }
+
+ // Instrumentation methods for conditions
+
+ /**
+ * Queries whether the given ConditionObject
+ * uses this synchronizer as its lock.
+ *
+ * @param condition the condition
+ * @return <tt>true</tt> if owned
+ * @throws NullPointerException if the condition is null
+ */
+ public final boolean owns(ConditionObject condition) {
+ if (condition == null)
+ throw new NullPointerException();
+ return condition.isOwnedBy(this);
+ }
+
+ /**
+ * Queries whether any threads are waiting on the given condition
+ * associated with this synchronizer. Note that because timeouts
+ * and interrupts may occur at any time, a <tt>true</tt> return
+ * does not guarantee that a future <tt>signal</tt> will awaken
+ * any threads. This method is designed primarily for use in
+ * monitoring of the system state.
+ *
+ * @param condition the condition
+ * @return <tt>true</tt> if there are any waiting threads
+ * @throws IllegalMonitorStateException if exclusive synchronization
+ * is not held
+ * @throws IllegalArgumentException if the given condition is
+ * not associated with this synchronizer
+ * @throws NullPointerException if the condition is null
+ */
+ public final boolean hasWaiters(ConditionObject condition) {
+ if (!owns(condition))
+ throw new IllegalArgumentException("Not owner");
+ return condition.hasWaiters();
+ }
+
+ /**
+ * Returns an estimate of the number of threads waiting on the
+ * given condition associated with this synchronizer. Note that
+ * because timeouts and interrupts may occur at any time, the
+ * estimate serves only as an upper bound on the actual number of
+ * waiters. This method is designed for use in monitoring of the
+ * system state, not for synchronization control.
+ *
+ * @param condition the condition
+ * @return the estimated number of waiting threads
+ * @throws IllegalMonitorStateException if exclusive synchronization
+ * is not held
+ * @throws IllegalArgumentException if the given condition is
+ * not associated with this synchronizer
+ * @throws NullPointerException if the condition is null
+ */
+ public final int getWaitQueueLength(ConditionObject condition) {
+ if (!owns(condition))
+ throw new IllegalArgumentException("Not owner");
+ return condition.getWaitQueueLength();
+ }
+
+ /**
+ * Returns a collection containing those threads that may be
+ * waiting on the given condition associated with this
+ * synchronizer. Because the actual set of threads may change
+ * dynamically while constructing this result, the returned
+ * collection is only a best-effort estimate. The elements of the
+ * returned collection are in no particular order.
+ *
+ * @param condition the condition
+ * @return the collection of threads
+ * @throws IllegalMonitorStateException if exclusive synchronization
+ * is not held
+ * @throws IllegalArgumentException if the given condition is
+ * not associated with this synchronizer
+ * @throws NullPointerException if the condition is null
+ */
+ public final Collection<Thread> getWaitingThreads(ConditionObject condition) {
+ if (!owns(condition))
+ throw new IllegalArgumentException("Not owner");
+ return condition.getWaitingThreads();
+ }
+
+ /**
+ * Condition implementation for a {@link
+ * AbstractQueuedSynchronizer} serving as the basis of a {@link
+ * Lock} implementation.
+ *
+ * <p>Method documentation for this class describes mechanics,
+ * not behavioral specifications from the point of view of Lock
+ * and Condition users. Exported versions of this class will in
+ * general need to be accompanied by documentation describing
+ * condition semantics that rely on those of the associated
+ * <tt>AbstractQueuedSynchronizer</tt>.
+ *
+ * <p>This class is Serializable, but all fields are transient,
+ * so deserialized conditions have no waiters.
+ */
+ public class ConditionObject implements Condition, java.io.Serializable {
+ private static final long serialVersionUID = 1173984872572414699L;
+ /** First node of condition queue. */
+ private transient Node firstWaiter;
+ /** Last node of condition queue. */
+ private transient Node lastWaiter;
+
+ /**
+ * Creates a new <tt>ConditionObject</tt> instance.
+ */
+ public ConditionObject() { }
+
+ // Internal methods
+
+ /**
+ * Adds a new waiter to wait queue.
+ * @return its new wait node
+ */
+ private Node addConditionWaiter() {
+ Node node = new Node(Thread.currentThread(), Node.CONDITION);
+ Node t = lastWaiter;
+ if (t == null)
+ firstWaiter = node;
+ else
+ t.nextWaiter = node;
+ lastWaiter = node;
+ return node;
+ }
+
+ /**
+ * Removes and transfers nodes until hit non-cancelled one or
+ * null. Split out from signal in part to encourage compilers
+ * to inline the case of no waiters.
+ * @param first (non-null) the first node on condition queue
+ */
+ private void doSignal(Node first) {
+ do {
+ if ( (firstWaiter = first.nextWaiter) == null)
+ lastWaiter = null;
+ first.nextWaiter = null;
+ } while (!transferForSignal(first) &&
+ (first = firstWaiter) != null);
+ }
+
+ /**
+ * Removes and transfers all nodes.
+ * @param first (non-null) the first node on condition queue
+ */
+ private void doSignalAll(Node first) {
+ lastWaiter = firstWaiter = null;
+ do {
+ Node next = first.nextWaiter;
+ first.nextWaiter = null;
+ transferForSignal(first);
+ first = next;
+ } while (first != null);
+ }
+
+ /**
+ * Returns true if given node is on this condition queue.
+ * Call only when holding lock.
+ */
+ private boolean isOnConditionQueue(Node node) {
+ return node.next != null || node == lastWaiter;
+ }
+
+ /**
+ * Unlinks a cancelled waiter node from condition queue. This
+ * is called when cancellation occurred during condition wait,
+ * not lock wait, and is called only after lock has been
+ * re-acquired by a cancelled waiter and the node is not known
+ * to already have been dequeued. It is needed to avoid
+ * garbage retention in the absence of signals. So even though
+ * it may require a full traversal, it comes into play only
+ * when timeouts or cancellations occur in the absence of
+ * signals.
+ */
+ private void unlinkCancelledWaiter(Node node) {
+ Node t = firstWaiter;
+ Node trail = null;
+ while (t != null) {
+ if (t == node) {
+ Node next = t.nextWaiter;
+ if (trail == null)
+ firstWaiter = next;
+ else
+ trail.nextWaiter = next;
+ if (lastWaiter == node)
+ lastWaiter = trail;
+ break;
+ }
+ trail = t;
+ t = t.nextWaiter;
+ }
+ }
+
+ // public methods
+
+ /**
+ * Moves the longest-waiting thread, if one exists, from the
+ * wait queue for this condition to the wait queue for the
+ * owning lock.
+ *
+ * @throws IllegalMonitorStateException if {@link #isHeldExclusively}
+ * returns {@code false}
+ */
+ public final void signal() {
+ if (!isHeldExclusively())
+ throw new IllegalMonitorStateException();
+ Node first = firstWaiter;
+ if (first != null)
+ doSignal(first);
+ }
+
+ /**
+ * Moves all threads from the wait queue for this condition to
+ * the wait queue for the owning lock.
+ *
+ * @throws IllegalMonitorStateException if {@link #isHeldExclusively}
+ * returns {@code false}
+ */
+ public final void signalAll() {
+ if (!isHeldExclusively())
+ throw new IllegalMonitorStateException();
+ Node first = firstWaiter;
+ if (first != null)
+ doSignalAll(first);
+ }
+
+ /**
+ * Implements uninterruptible condition wait.
+ * <ol>
+ * <li> Save lock state returned by {@link #getState}
+ * <li> Invoke {@link #release} with
+ * saved state as argument, throwing
+ * IllegalMonitorStateException if it fails.
+ * <li> Block until signalled
+ * <li> Reacquire by invoking specialized version of
+ * {@link #acquire} with saved state as argument.
+ * </ol>
+ */
+ public final void awaitUninterruptibly() {
+ Node node = addConditionWaiter();
+ int savedState = fullyRelease(node);
+ boolean interrupted = false;
+ while (!isOnSyncQueue(node)) {
+ LockSupport.park(this);
+ if (Thread.interrupted())
+ interrupted = true;
+ }
+ if (acquireQueued(node, savedState) || interrupted)
+ selfInterrupt();
+ }
+
+ /*
+ * For interruptible waits, we need to track whether to throw
+ * InterruptedException, if interrupted while blocked on
+ * condition, versus reinterrupt current thread, if
+ * interrupted while blocked waiting to re-acquire.
+ */
+
+ /** Mode meaning to reinterrupt on exit from wait */
+ private static final int REINTERRUPT = 1;
+ /** Mode meaning to throw InterruptedException on exit from wait */
+ private static final int THROW_IE = -1;
+
+ /**
+ * Checks for interrupt, returning THROW_IE if interrupted
+ * before signalled, REINTERRUPT if after signalled, or
+ * 0 if not interrupted.
+ */
+ private int checkInterruptWhileWaiting(Node node) {
+ return (Thread.interrupted()) ?
+ ((transferAfterCancelledWait(node))? THROW_IE : REINTERRUPT) :
+ 0;
+ }
+
+ /**
+ * Throws InterruptedException, reinterrupts current thread, or
+ * does nothing, depending on mode.
+ */
+ private void reportInterruptAfterWait(int interruptMode)
+ throws InterruptedException {
+ if (interruptMode == THROW_IE)
+ throw new InterruptedException();
+ else if (interruptMode == REINTERRUPT)
+ selfInterrupt();
+ }
+
+ /**
+ * Implements interruptible condition wait.
+ * <ol>
+ * <li> If current thread is interrupted, throw InterruptedException
+ * <li> Save lock state returned by {@link #getState}
+ * <li> Invoke {@link #release} with
+ * saved state as argument, throwing
+ * IllegalMonitorStateException if it fails.
+ * <li> Block until signalled or interrupted
+ * <li> Reacquire by invoking specialized version of
+ * {@link #acquire} with saved state as argument.
+ * <li> If interrupted while blocked in step 4, throw exception
+ * </ol>
+ */
+ public final void await() throws InterruptedException {
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ Node node = addConditionWaiter();
+ int savedState = fullyRelease(node);
+ int interruptMode = 0;
+ while (!isOnSyncQueue(node)) {
+ LockSupport.park(this);
+ if ((interruptMode = checkInterruptWhileWaiting(node)) != 0)
+ break;
+ }
+ if (acquireQueued(node, savedState) && interruptMode != THROW_IE)
+ interruptMode = REINTERRUPT;
+ if (isOnConditionQueue(node))
+ unlinkCancelledWaiter(node);
+ if (interruptMode != 0)
+ reportInterruptAfterWait(interruptMode);
+ }
+
+ /**
+ * Implements timed condition wait.
+ * <ol>
+ * <li> If current thread is interrupted, throw InterruptedException
+ * <li> Save lock state returned by {@link #getState}
+ * <li> Invoke {@link #release} with
+ * saved state as argument, throwing
+ * IllegalMonitorStateException if it fails.
+ * <li> Block until signalled, interrupted, or timed out
+ * <li> Reacquire by invoking specialized version of
+ * {@link #acquire} with saved state as argument.
+ * <li> If interrupted while blocked in step 4, throw InterruptedException
+ * </ol>
+ */
+ public final long awaitNanos(long nanosTimeout) throws InterruptedException {
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ Node node = addConditionWaiter();
+ int savedState = fullyRelease(node);
+ long lastTime = System.nanoTime();
+ int interruptMode = 0;
+ while (!isOnSyncQueue(node)) {
+ if (nanosTimeout <= 0L) {
+ transferAfterCancelledWait(node);
+ break;
+ }
+ LockSupport.parkNanos(this, nanosTimeout);
+ if ((interruptMode = checkInterruptWhileWaiting(node)) != 0)
+ break;
+
+ long now = System.nanoTime();
+ nanosTimeout -= now - lastTime;
+ lastTime = now;
+ }
+ if (acquireQueued(node, savedState) && interruptMode != THROW_IE)
+ interruptMode = REINTERRUPT;
+ if (isOnConditionQueue(node))
+ unlinkCancelledWaiter(node);
+ if (interruptMode != 0)
+ reportInterruptAfterWait(interruptMode);
+ return nanosTimeout - (System.nanoTime() - lastTime);
+ }
+
+ /**
+ * Implements absolute timed condition wait.
+ * <ol>
+ * <li> If current thread is interrupted, throw InterruptedException
+ * <li> Save lock state returned by {@link #getState}
+ * <li> Invoke {@link #release} with
+ * saved state as argument, throwing
+ * IllegalMonitorStateException if it fails.
+ * <li> Block until signalled, interrupted, or timed out
+ * <li> Reacquire by invoking specialized version of
+ * {@link #acquire} with saved state as argument.
+ * <li> If interrupted while blocked in step 4, throw InterruptedException
+ * <li> If timed out while blocked in step 4, return false, else true
+ * </ol>
+ */
+ public final boolean awaitUntil(Date deadline) throws InterruptedException {
+ if (deadline == null)
+ throw new NullPointerException();
+ long abstime = deadline.getTime();
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ Node node = addConditionWaiter();
+ int savedState = fullyRelease(node);
+ boolean timedout = false;
+ int interruptMode = 0;
+ while (!isOnSyncQueue(node)) {
+ if (System.currentTimeMillis() > abstime) {
+ timedout = transferAfterCancelledWait(node);
+ break;
+ }
+ LockSupport.parkUntil(this, abstime);
+ if ((interruptMode = checkInterruptWhileWaiting(node)) != 0)
+ break;
+ }
+ if (acquireQueued(node, savedState) && interruptMode != THROW_IE)
+ interruptMode = REINTERRUPT;
+ if (isOnConditionQueue(node))
+ unlinkCancelledWaiter(node);
+ if (interruptMode != 0)
+ reportInterruptAfterWait(interruptMode);
+ return !timedout;
+ }
+
+ /**
+ * Implements timed condition wait.
+ * <ol>
+ * <li> If current thread is interrupted, throw InterruptedException
+ * <li> Save lock state returned by {@link #getState}
+ * <li> Invoke {@link #release} with
+ * saved state as argument, throwing
+ * IllegalMonitorStateException if it fails.
+ * <li> Block until signalled, interrupted, or timed out
+ * <li> Reacquire by invoking specialized version of
+ * {@link #acquire} with saved state as argument.
+ * <li> If interrupted while blocked in step 4, throw InterruptedException
+ * <li> If timed out while blocked in step 4, return false, else true
+ * </ol>
+ */
+ public final boolean await(long time, TimeUnit unit) throws InterruptedException {
+ if (unit == null)
+ throw new NullPointerException();
+ long nanosTimeout = unit.toNanos(time);
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ Node node = addConditionWaiter();
+ int savedState = fullyRelease(node);
+ long lastTime = System.nanoTime();
+ boolean timedout = false;
+ int interruptMode = 0;
+ while (!isOnSyncQueue(node)) {
+ if (nanosTimeout <= 0L) {
+ timedout = transferAfterCancelledWait(node);
+ break;
+ }
+ LockSupport.parkNanos(this, nanosTimeout);
+ if ((interruptMode = checkInterruptWhileWaiting(node)) != 0)
+ break;
+ long now = System.nanoTime();
+ nanosTimeout -= now - lastTime;
+ lastTime = now;
+ }
+ if (acquireQueued(node, savedState) && interruptMode != THROW_IE)
+ interruptMode = REINTERRUPT;
+ if (isOnConditionQueue(node))
+ unlinkCancelledWaiter(node);
+ if (interruptMode != 0)
+ reportInterruptAfterWait(interruptMode);
+ return !timedout;
+ }
+
+ // support for instrumentation
+
+ /**
+ * Returns true if this condition was created by the given
+ * synchronization object.
+ *
+ * @return {@code true} if owned
+ */
+ final boolean isOwnedBy(AbstractQueuedSynchronizer sync) {
+ return sync == AbstractQueuedSynchronizer.this;
+ }
+
+ /**
+ * Queries whether any threads are waiting on this condition.
+ * Implements {@link AbstractQueuedSynchronizer#hasWaiters}.
+ *
+ * @return {@code true} if there are any waiting threads
+ * @throws IllegalMonitorStateException if {@link #isHeldExclusively}
+ * returns {@code false}
+ */
+ protected final boolean hasWaiters() {
+ if (!isHeldExclusively())
+ throw new IllegalMonitorStateException();
+ for (Node w = firstWaiter; w != null; w = w.nextWaiter) {
+ if (w.waitStatus == Node.CONDITION)
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns an estimate of the number of threads waiting on
+ * this condition.
+ * Implements {@link AbstractQueuedSynchronizer#getWaitQueueLength}.
+ *
+ * @return the estimated number of waiting threads
+ * @throws IllegalMonitorStateException if {@link #isHeldExclusively}
+ * returns {@code false}
+ */
+ protected final int getWaitQueueLength() {
+ if (!isHeldExclusively())
+ throw new IllegalMonitorStateException();
+ int n = 0;
+ for (Node w = firstWaiter; w != null; w = w.nextWaiter) {
+ if (w.waitStatus == Node.CONDITION)
+ ++n;
+ }
+ return n;
+ }
+
+ /**
+ * Returns a collection containing those threads that may be
+ * waiting on this Condition.
+ * Implements {@link AbstractQueuedSynchronizer#getWaitingThreads}.
+ *
+ * @return the collection of threads
+ * @throws IllegalMonitorStateException if {@link #isHeldExclusively}
+ * returns {@code false}
+ */
+ protected final Collection<Thread> getWaitingThreads() {
+ if (!isHeldExclusively())
+ throw new IllegalMonitorStateException();
+ ArrayList<Thread> list = new ArrayList<Thread>();
+ for (Node w = firstWaiter; w != null; w = w.nextWaiter) {
+ if (w.waitStatus == Node.CONDITION) {
+ Thread t = w.thread;
+ if (t != null)
+ list.add(t);
+ }
+ }
+ return list;
+ }
+ }
+
+ /**
+ * Setup to support compareAndSet. We need to natively implement
+ * this here: For the sake of permitting future enhancements, we
+ * cannot explicitly subclass AtomicInteger, which would be
+ * efficient and useful otherwise. So, as the lesser of evils, we
+ * natively implement using hotspot intrinsics API. And while we
+ * are at it, we do the same for other CASable fields (which could
+ * otherwise be done with atomic field updaters).
+ */
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private static final long stateOffset;
+ private static final long headOffset;
+ private static final long tailOffset;
+ private static final long waitStatusOffset;
+
+ static {
+ try {
+ stateOffset = unsafe.objectFieldOffset
+ (AbstractQueuedSynchronizer.class.getDeclaredField("state"));
+ headOffset = unsafe.objectFieldOffset
+ (AbstractQueuedSynchronizer.class.getDeclaredField("head"));
+ tailOffset = unsafe.objectFieldOffset
+ (AbstractQueuedSynchronizer.class.getDeclaredField("tail"));
+ waitStatusOffset = unsafe.objectFieldOffset
+ (Node.class.getDeclaredField("waitStatus"));
+
+ } catch (Exception ex) { throw new Error(ex); }
+ }
+
+ /**
+ * CAS head field. Used only by enq
+ */
+ private final boolean compareAndSetHead(Node update) {
+ return unsafe.compareAndSwapObject(this, headOffset, null, update);
+ }
+
+ /**
+ * CAS tail field. Used only by enq
+ */
+ private final boolean compareAndSetTail(Node expect, Node update) {
+ return unsafe.compareAndSwapObject(this, tailOffset, expect, update);
+ }
+
+ /**
+ * CAS waitStatus field of a node.
+ */
+ private final static boolean compareAndSetWaitStatus(Node node,
+ int expect,
+ int update) {
+ return unsafe.compareAndSwapInt(node, waitStatusOffset,
+ expect, update);
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/locks/Condition.java b/libjava/classpath/external/jsr166/java/util/concurrent/locks/Condition.java
new file mode 100644
index 00000000000..5d24128e172
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/locks/Condition.java
@@ -0,0 +1,435 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.locks;
+import java.util.concurrent.*;
+import java.util.Date;
+
+/**
+ * {@code Condition} factors out the {@code Object} monitor
+ * methods ({@link Object#wait() wait}, {@link Object#notify notify}
+ * and {@link Object#notifyAll notifyAll}) into distinct objects to
+ * give the effect of having multiple wait-sets per object, by
+ * combining them with the use of arbitrary {@link Lock} implementations.
+ * Where a {@code Lock} replaces the use of {@code synchronized} methods
+ * and statements, a {@code Condition} replaces the use of the Object
+ * monitor methods.
+ *
+ * <p>Conditions (also known as <em>condition queues</em> or
+ * <em>condition variables</em>) provide a means for one thread to
+ * suspend execution (to &quot;wait&quot;) until notified by another
+ * thread that some state condition may now be true. Because access
+ * to this shared state information occurs in different threads, it
+ * must be protected, so a lock of some form is associated with the
+ * condition. The key property that waiting for a condition provides
+ * is that it <em>atomically</em> releases the associated lock and
+ * suspends the current thread, just like {@code Object.wait}.
+ *
+ * <p>A {@code Condition} instance is intrinsically bound to a lock.
+ * To obtain a {@code Condition} instance for a particular {@link Lock}
+ * instance use its {@link Lock#newCondition newCondition()} method.
+ *
+ * <p>As an example, suppose we have a bounded buffer which supports
+ * {@code put} and {@code take} methods. If a
+ * {@code take} is attempted on an empty buffer, then the thread will block
+ * until an item becomes available; if a {@code put} is attempted on a
+ * full buffer, then the thread will block until a space becomes available.
+ * We would like to keep waiting {@code put} threads and {@code take}
+ * threads in separate wait-sets so that we can use the optimization of
+ * only notifying a single thread at a time when items or spaces become
+ * available in the buffer. This can be achieved using two
+ * {@link Condition} instances.
+ * <pre>
+ * class BoundedBuffer {
+ * <b>final Lock lock = new ReentrantLock();</b>
+ * final Condition notFull = <b>lock.newCondition(); </b>
+ * final Condition notEmpty = <b>lock.newCondition(); </b>
+ *
+ * final Object[] items = new Object[100];
+ * int putptr, takeptr, count;
+ *
+ * public void put(Object x) throws InterruptedException {
+ * <b>lock.lock();
+ * try {</b>
+ * while (count == items.length)
+ * <b>notFull.await();</b>
+ * items[putptr] = x;
+ * if (++putptr == items.length) putptr = 0;
+ * ++count;
+ * <b>notEmpty.signal();</b>
+ * <b>} finally {
+ * lock.unlock();
+ * }</b>
+ * }
+ *
+ * public Object take() throws InterruptedException {
+ * <b>lock.lock();
+ * try {</b>
+ * while (count == 0)
+ * <b>notEmpty.await();</b>
+ * Object x = items[takeptr];
+ * if (++takeptr == items.length) takeptr = 0;
+ * --count;
+ * <b>notFull.signal();</b>
+ * return x;
+ * <b>} finally {
+ * lock.unlock();
+ * }</b>
+ * }
+ * }
+ * </pre>
+ *
+ * (The {@link java.util.concurrent.ArrayBlockingQueue} class provides
+ * this functionality, so there is no reason to implement this
+ * sample usage class.)
+ *
+ * <p>A {@code Condition} implementation can provide behavior and semantics
+ * that is
+ * different from that of the {@code Object} monitor methods, such as
+ * guaranteed ordering for notifications, or not requiring a lock to be held
+ * when performing notifications.
+ * If an implementation provides such specialized semantics then the
+ * implementation must document those semantics.
+ *
+ * <p>Note that {@code Condition} instances are just normal objects and can
+ * themselves be used as the target in a {@code synchronized} statement,
+ * and can have their own monitor {@link Object#wait wait} and
+ * {@link Object#notify notification} methods invoked.
+ * Acquiring the monitor lock of a {@code Condition} instance, or using its
+ * monitor methods, has no specified relationship with acquiring the
+ * {@link Lock} associated with that {@code Condition} or the use of its
+ * {@linkplain #await waiting} and {@linkplain #signal signalling} methods.
+ * It is recommended that to avoid confusion you never use {@code Condition}
+ * instances in this way, except perhaps within their own implementation.
+ *
+ * <p>Except where noted, passing a {@code null} value for any parameter
+ * will result in a {@link NullPointerException} being thrown.
+ *
+ * <h3>Implementation Considerations</h3>
+ *
+ * <p>When waiting upon a {@code Condition}, a &quot;<em>spurious
+ * wakeup</em>&quot; is permitted to occur, in
+ * general, as a concession to the underlying platform semantics.
+ * This has little practical impact on most application programs as a
+ * {@code Condition} should always be waited upon in a loop, testing
+ * the state predicate that is being waited for. An implementation is
+ * free to remove the possibility of spurious wakeups but it is
+ * recommended that applications programmers always assume that they can
+ * occur and so always wait in a loop.
+ *
+ * <p>The three forms of condition waiting
+ * (interruptible, non-interruptible, and timed) may differ in their ease of
+ * implementation on some platforms and in their performance characteristics.
+ * In particular, it may be difficult to provide these features and maintain
+ * specific semantics such as ordering guarantees.
+ * Further, the ability to interrupt the actual suspension of the thread may
+ * not always be feasible to implement on all platforms.
+ *
+ * <p>Consequently, an implementation is not required to define exactly the
+ * same guarantees or semantics for all three forms of waiting, nor is it
+ * required to support interruption of the actual suspension of the thread.
+ *
+ * <p>An implementation is required to
+ * clearly document the semantics and guarantees provided by each of the
+ * waiting methods, and when an implementation does support interruption of
+ * thread suspension then it must obey the interruption semantics as defined
+ * in this interface.
+ *
+ * <p>As interruption generally implies cancellation, and checks for
+ * interruption are often infrequent, an implementation can favor responding
+ * to an interrupt over normal method return. This is true even if it can be
+ * shown that the interrupt occurred after another action may have unblocked
+ * the thread. An implementation should document this behavior.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public interface Condition {
+
+ /**
+ * Causes the current thread to wait until it is signalled or
+ * {@linkplain Thread#interrupt interrupted}.
+ *
+ * <p>The lock associated with this {@code Condition} is atomically
+ * released and the current thread becomes disabled for thread scheduling
+ * purposes and lies dormant until <em>one</em> of four things happens:
+ * <ul>
+ * <li>Some other thread invokes the {@link #signal} method for this
+ * {@code Condition} and the current thread happens to be chosen as the
+ * thread to be awakened; or
+ * <li>Some other thread invokes the {@link #signalAll} method for this
+ * {@code Condition}; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts} the
+ * current thread, and interruption of thread suspension is supported; or
+ * <li>A &quot;<em>spurious wakeup</em>&quot; occurs.
+ * </ul>
+ *
+ * <p>In all cases, before this method can return the current thread must
+ * re-acquire the lock associated with this condition. When the
+ * thread returns it is <em>guaranteed</em> to hold this lock.
+ *
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while waiting
+ * and interruption of thread suspension is supported,
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared. It is not specified, in the first
+ * case, whether or not the test for interruption occurs before the lock
+ * is released.
+ *
+ * <p><b>Implementation Considerations</b>
+ *
+ * <p>The current thread is assumed to hold the lock associated with this
+ * {@code Condition} when this method is called.
+ * It is up to the implementation to determine if this is
+ * the case and if not, how to respond. Typically, an exception will be
+ * thrown (such as {@link IllegalMonitorStateException}) and the
+ * implementation must document that fact.
+ *
+ * <p>An implementation can favor responding to an interrupt over normal
+ * method return in response to a signal. In that case the implementation
+ * must ensure that the signal is redirected to another waiting thread, if
+ * there is one.
+ *
+ * @throws InterruptedException if the current thread is interrupted
+ * (and interruption of thread suspension is supported)
+ */
+ void await() throws InterruptedException;
+
+ /**
+ * Causes the current thread to wait until it is signalled.
+ *
+ * <p>The lock associated with this condition is atomically
+ * released and the current thread becomes disabled for thread scheduling
+ * purposes and lies dormant until <em>one</em> of three things happens:
+ * <ul>
+ * <li>Some other thread invokes the {@link #signal} method for this
+ * {@code Condition} and the current thread happens to be chosen as the
+ * thread to be awakened; or
+ * <li>Some other thread invokes the {@link #signalAll} method for this
+ * {@code Condition}; or
+ * <li>A &quot;<em>spurious wakeup</em>&quot; occurs.
+ * </ul>
+ *
+ * <p>In all cases, before this method can return the current thread must
+ * re-acquire the lock associated with this condition. When the
+ * thread returns it is <em>guaranteed</em> to hold this lock.
+ *
+ * <p>If the current thread's interrupted status is set when it enters
+ * this method, or it is {@linkplain Thread#interrupt interrupted}
+ * while waiting, it will continue to wait until signalled. When it finally
+ * returns from this method its interrupted status will still
+ * be set.
+ *
+ * <p><b>Implementation Considerations</b>
+ *
+ * <p>The current thread is assumed to hold the lock associated with this
+ * {@code Condition} when this method is called.
+ * It is up to the implementation to determine if this is
+ * the case and if not, how to respond. Typically, an exception will be
+ * thrown (such as {@link IllegalMonitorStateException}) and the
+ * implementation must document that fact.
+ */
+ void awaitUninterruptibly();
+
+ /**
+ * Causes the current thread to wait until it is signalled or interrupted,
+ * or the specified waiting time elapses.
+ *
+ * <p>The lock associated with this condition is atomically
+ * released and the current thread becomes disabled for thread scheduling
+ * purposes and lies dormant until <em>one</em> of five things happens:
+ * <ul>
+ * <li>Some other thread invokes the {@link #signal} method for this
+ * {@code Condition} and the current thread happens to be chosen as the
+ * thread to be awakened; or
+ * <li>Some other thread invokes the {@link #signalAll} method for this
+ * {@code Condition}; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts} the
+ * current thread, and interruption of thread suspension is supported; or
+ * <li>The specified waiting time elapses; or
+ * <li>A &quot;<em>spurious wakeup</em>&quot; occurs.
+ * </ul>
+ *
+ * <p>In all cases, before this method can return the current thread must
+ * re-acquire the lock associated with this condition. When the
+ * thread returns it is <em>guaranteed</em> to hold this lock.
+ *
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while waiting
+ * and interruption of thread suspension is supported,
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared. It is not specified, in the first
+ * case, whether or not the test for interruption occurs before the lock
+ * is released.
+ *
+ * <p>The method returns an estimate of the number of nanoseconds
+ * remaining to wait given the supplied {@code nanosTimeout}
+ * value upon return, or a value less than or equal to zero if it
+ * timed out. This value can be used to determine whether and how
+ * long to re-wait in cases where the wait returns but an awaited
+ * condition still does not hold. Typical uses of this method take
+ * the following form:
+ *
+ * <pre>
+ * synchronized boolean aMethod(long timeout, TimeUnit unit) {
+ * long nanosTimeout = unit.toNanos(timeout);
+ * while (!conditionBeingWaitedFor) {
+ * if (nanosTimeout &gt; 0)
+ * nanosTimeout = theCondition.awaitNanos(nanosTimeout);
+ * else
+ * return false;
+ * }
+ * // ...
+ * }
+ * </pre>
+ *
+ * <p> Design note: This method requires a nanosecond argument so
+ * as to avoid truncation errors in reporting remaining times.
+ * Such precision loss would make it difficult for programmers to
+ * ensure that total waiting times are not systematically shorter
+ * than specified when re-waits occur.
+ *
+ * <p><b>Implementation Considerations</b>
+ *
+ * <p>The current thread is assumed to hold the lock associated with this
+ * {@code Condition} when this method is called.
+ * It is up to the implementation to determine if this is
+ * the case and if not, how to respond. Typically, an exception will be
+ * thrown (such as {@link IllegalMonitorStateException}) and the
+ * implementation must document that fact.
+ *
+ * <p>An implementation can favor responding to an interrupt over normal
+ * method return in response to a signal, or over indicating the elapse
+ * of the specified waiting time. In either case the implementation
+ * must ensure that the signal is redirected to another waiting thread, if
+ * there is one.
+ *
+ * @param nanosTimeout the maximum time to wait, in nanoseconds
+ * @return an estimate of the {@code nanosTimeout} value minus
+ * the time spent waiting upon return from this method.
+ * A positive value may be used as the argument to a
+ * subsequent call to this method to finish waiting out
+ * the desired time. A value less than or equal to zero
+ * indicates that no time remains.
+ * @throws InterruptedException if the current thread is interrupted
+ * (and interruption of thread suspension is supported)
+ */
+ long awaitNanos(long nanosTimeout) throws InterruptedException;
+
+ /**
+ * Causes the current thread to wait until it is signalled or interrupted,
+ * or the specified waiting time elapses. This method is behaviorally
+ * equivalent to:<br>
+ * <pre>
+ * awaitNanos(unit.toNanos(time)) &gt; 0
+ * </pre>
+ * @param time the maximum time to wait
+ * @param unit the time unit of the {@code time} argument
+ * @return {@code false} if the waiting time detectably elapsed
+ * before return from the method, else {@code true}
+ * @throws InterruptedException if the current thread is interrupted
+ * (and interruption of thread suspension is supported)
+ */
+ boolean await(long time, TimeUnit unit) throws InterruptedException;
+
+ /**
+ * Causes the current thread to wait until it is signalled or interrupted,
+ * or the specified deadline elapses.
+ *
+ * <p>The lock associated with this condition is atomically
+ * released and the current thread becomes disabled for thread scheduling
+ * purposes and lies dormant until <em>one</em> of five things happens:
+ * <ul>
+ * <li>Some other thread invokes the {@link #signal} method for this
+ * {@code Condition} and the current thread happens to be chosen as the
+ * thread to be awakened; or
+ * <li>Some other thread invokes the {@link #signalAll} method for this
+ * {@code Condition}; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts} the
+ * current thread, and interruption of thread suspension is supported; or
+ * <li>The specified deadline elapses; or
+ * <li>A &quot;<em>spurious wakeup</em>&quot; occurs.
+ * </ul>
+ *
+ * <p>In all cases, before this method can return the current thread must
+ * re-acquire the lock associated with this condition. When the
+ * thread returns it is <em>guaranteed</em> to hold this lock.
+ *
+ *
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while waiting
+ * and interruption of thread suspension is supported,
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared. It is not specified, in the first
+ * case, whether or not the test for interruption occurs before the lock
+ * is released.
+ *
+ *
+ * <p>The return value indicates whether the deadline has elapsed,
+ * which can be used as follows:
+ * <pre>
+ * synchronized boolean aMethod(Date deadline) {
+ * boolean stillWaiting = true;
+ * while (!conditionBeingWaitedFor) {
+ * if (stillWaiting)
+ * stillWaiting = theCondition.awaitUntil(deadline);
+ * else
+ * return false;
+ * }
+ * // ...
+ * }
+ * </pre>
+ *
+ * <p><b>Implementation Considerations</b>
+ *
+ * <p>The current thread is assumed to hold the lock associated with this
+ * {@code Condition} when this method is called.
+ * It is up to the implementation to determine if this is
+ * the case and if not, how to respond. Typically, an exception will be
+ * thrown (such as {@link IllegalMonitorStateException}) and the
+ * implementation must document that fact.
+ *
+ * <p>An implementation can favor responding to an interrupt over normal
+ * method return in response to a signal, or over indicating the passing
+ * of the specified deadline. In either case the implementation
+ * must ensure that the signal is redirected to another waiting thread, if
+ * there is one.
+ *
+ * @param deadline the absolute time to wait until
+ * @return {@code false} if the deadline has elapsed upon return, else
+ * {@code true}
+ * @throws InterruptedException if the current thread is interrupted
+ * (and interruption of thread suspension is supported)
+ */
+ boolean awaitUntil(Date deadline) throws InterruptedException;
+
+ /**
+ * Wakes up one waiting thread.
+ *
+ * <p>If any threads are waiting on this condition then one
+ * is selected for waking up. That thread must then re-acquire the
+ * lock before returning from {@code await}.
+ */
+ void signal();
+
+ /**
+ * Wakes up all waiting threads.
+ *
+ * <p>If any threads are waiting on this condition then they are
+ * all woken up. Each thread must re-acquire the lock before it can
+ * return from {@code await}.
+ */
+ void signalAll();
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/locks/Lock.java b/libjava/classpath/external/jsr166/java/util/concurrent/locks/Lock.java
new file mode 100644
index 00000000000..4b9abd66543
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/locks/Lock.java
@@ -0,0 +1,327 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.locks;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * {@code Lock} implementations provide more extensive locking
+ * operations than can be obtained using {@code synchronized} methods
+ * and statements. They allow more flexible structuring, may have
+ * quite different properties, and may support multiple associated
+ * {@link Condition} objects.
+ *
+ * <p>A lock is a tool for controlling access to a shared resource by
+ * multiple threads. Commonly, a lock provides exclusive access to a
+ * shared resource: only one thread at a time can acquire the lock and
+ * all access to the shared resource requires that the lock be
+ * acquired first. However, some locks may allow concurrent access to
+ * a shared resource, such as the read lock of a {@link ReadWriteLock}.
+ *
+ * <p>The use of {@code synchronized} methods or statements provides
+ * access to the implicit monitor lock associated with every object, but
+ * forces all lock acquisition and release to occur in a block-structured way:
+ * when multiple locks are acquired they must be released in the opposite
+ * order, and all locks must be released in the same lexical scope in which
+ * they were acquired.
+ *
+ * <p>While the scoping mechanism for {@code synchronized} methods
+ * and statements makes it much easier to program with monitor locks,
+ * and helps avoid many common programming errors involving locks,
+ * there are occasions where you need to work with locks in a more
+ * flexible way. For example, some algorithms for traversing
+ * concurrently accessed data structures require the use of
+ * &quot;hand-over-hand&quot; or &quot;chain locking&quot;: you
+ * acquire the lock of node A, then node B, then release A and acquire
+ * C, then release B and acquire D and so on. Implementations of the
+ * {@code Lock} interface enable the use of such techniques by
+ * allowing a lock to be acquired and released in different scopes,
+ * and allowing multiple locks to be acquired and released in any
+ * order.
+ *
+ * <p>With this increased flexibility comes additional
+ * responsibility. The absence of block-structured locking removes the
+ * automatic release of locks that occurs with {@code synchronized}
+ * methods and statements. In most cases, the following idiom
+ * should be used:
+ *
+ * <pre><tt> Lock l = ...;
+ * l.lock();
+ * try {
+ * // access the resource protected by this lock
+ * } finally {
+ * l.unlock();
+ * }
+ * </tt></pre>
+ *
+ * When locking and unlocking occur in different scopes, care must be
+ * taken to ensure that all code that is executed while the lock is
+ * held is protected by try-finally or try-catch to ensure that the
+ * lock is released when necessary.
+ *
+ * <p>{@code Lock} implementations provide additional functionality
+ * over the use of {@code synchronized} methods and statements by
+ * providing a non-blocking attempt to acquire a lock ({@link
+ * #tryLock()}), an attempt to acquire the lock that can be
+ * interrupted ({@link #lockInterruptibly}, and an attempt to acquire
+ * the lock that can timeout ({@link #tryLock(long, TimeUnit)}).
+ *
+ * <p>A {@code Lock} class can also provide behavior and semantics
+ * that is quite different from that of the implicit monitor lock,
+ * such as guaranteed ordering, non-reentrant usage, or deadlock
+ * detection. If an implementation provides such specialized semantics
+ * then the implementation must document those semantics.
+ *
+ * <p>Note that {@code Lock} instances are just normal objects and can
+ * themselves be used as the target in a {@code synchronized} statement.
+ * Acquiring the
+ * monitor lock of a {@code Lock} instance has no specified relationship
+ * with invoking any of the {@link #lock} methods of that instance.
+ * It is recommended that to avoid confusion you never use {@code Lock}
+ * instances in this way, except within their own implementation.
+ *
+ * <p>Except where noted, passing a {@code null} value for any
+ * parameter will result in a {@link NullPointerException} being
+ * thrown.
+ *
+ * <h3>Memory Synchronization</h3>
+ *
+ * <p>All {@code Lock} implementations <em>must</em> enforce the same
+ * memory synchronization semantics as provided by the built-in monitor
+ * lock, as described in <a href="http://java.sun.com/docs/books/jls/">
+ * The Java Language Specification, Third Edition (17.4 Memory Model)</a>:
+ * <ul>
+ * <li>A successful {@code lock} operation has the same memory
+ * synchronization effects as a successful <em>Lock</em> action.
+ * <li>A successful {@code unlock} operation has the same
+ * memory synchronization effects as a successful <em>Unlock</em> action.
+ * </ul>
+ *
+ * Unsuccessful locking and unlocking operations, and reentrant
+ * locking/unlocking operations, do not require any memory
+ * synchronization effects.
+ *
+ * <h3>Implementation Considerations</h3>
+ *
+ * <p> The three forms of lock acquisition (interruptible,
+ * non-interruptible, and timed) may differ in their performance
+ * characteristics, ordering guarantees, or other implementation
+ * qualities. Further, the ability to interrupt the <em>ongoing</em>
+ * acquisition of a lock may not be available in a given {@code Lock}
+ * class. Consequently, an implementation is not required to define
+ * exactly the same guarantees or semantics for all three forms of
+ * lock acquisition, nor is it required to support interruption of an
+ * ongoing lock acquisition. An implementation is required to clearly
+ * document the semantics and guarantees provided by each of the
+ * locking methods. It must also obey the interruption semantics as
+ * defined in this interface, to the extent that interruption of lock
+ * acquisition is supported: which is either totally, or only on
+ * method entry.
+ *
+ * <p>As interruption generally implies cancellation, and checks for
+ * interruption are often infrequent, an implementation can favor responding
+ * to an interrupt over normal method return. This is true even if it can be
+ * shown that the interrupt occurred after another action may have unblocked
+ * the thread. An implementation should document this behavior.
+ *
+ * @see ReentrantLock
+ * @see Condition
+ * @see ReadWriteLock
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public interface Lock {
+
+ /**
+ * Acquires the lock.
+ *
+ * <p>If the lock is not available then the current thread becomes
+ * disabled for thread scheduling purposes and lies dormant until the
+ * lock has been acquired.
+ *
+ * <p><b>Implementation Considerations</b>
+ *
+ * <p>A {@code Lock} implementation may be able to detect erroneous use
+ * of the lock, such as an invocation that would cause deadlock, and
+ * may throw an (unchecked) exception in such circumstances. The
+ * circumstances and the exception type must be documented by that
+ * {@code Lock} implementation.
+ */
+ void lock();
+
+ /**
+ * Acquires the lock unless the current thread is
+ * {@linkplain Thread#interrupt interrupted}.
+ *
+ * <p>Acquires the lock if it is available and returns immediately.
+ *
+ * <p>If the lock is not available then the current thread becomes
+ * disabled for thread scheduling purposes and lies dormant until
+ * one of two things happens:
+ *
+ * <ul>
+ * <li>The lock is acquired by the current thread; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts} the
+ * current thread, and interruption of lock acquisition is supported.
+ * </ul>
+ *
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while acquiring the
+ * lock, and interruption of lock acquisition is supported,
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared.
+ *
+ * <p><b>Implementation Considerations</b>
+ *
+ * <p>The ability to interrupt a lock acquisition in some
+ * implementations may not be possible, and if possible may be an
+ * expensive operation. The programmer should be aware that this
+ * may be the case. An implementation should document when this is
+ * the case.
+ *
+ * <p>An implementation can favor responding to an interrupt over
+ * normal method return.
+ *
+ * <p>A {@code Lock} implementation may be able to detect
+ * erroneous use of the lock, such as an invocation that would
+ * cause deadlock, and may throw an (unchecked) exception in such
+ * circumstances. The circumstances and the exception type must
+ * be documented by that {@code Lock} implementation.
+ *
+ * @throws InterruptedException if the current thread is
+ * interrupted while acquiring the lock (and interruption
+ * of lock acquisition is supported).
+ */
+ void lockInterruptibly() throws InterruptedException;
+
+ /**
+ * Acquires the lock only if it is free at the time of invocation.
+ *
+ * <p>Acquires the lock if it is available and returns immediately
+ * with the value {@code true}.
+ * If the lock is not available then this method will return
+ * immediately with the value {@code false}.
+ *
+ * <p>A typical usage idiom for this method would be:
+ * <pre>
+ * Lock lock = ...;
+ * if (lock.tryLock()) {
+ * try {
+ * // manipulate protected state
+ * } finally {
+ * lock.unlock();
+ * }
+ * } else {
+ * // perform alternative actions
+ * }
+ * </pre>
+ * This usage ensures that the lock is unlocked if it was acquired, and
+ * doesn't try to unlock if the lock was not acquired.
+ *
+ * @return {@code true} if the lock was acquired and
+ * {@code false} otherwise
+ */
+ boolean tryLock();
+
+ /**
+ * Acquires the lock if it is free within the given waiting time and the
+ * current thread has not been {@linkplain Thread#interrupt interrupted}.
+ *
+ * <p>If the lock is available this method returns immediately
+ * with the value {@code true}.
+ * If the lock is not available then
+ * the current thread becomes disabled for thread scheduling
+ * purposes and lies dormant until one of three things happens:
+ * <ul>
+ * <li>The lock is acquired by the current thread; or
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts} the
+ * current thread, and interruption of lock acquisition is supported; or
+ * <li>The specified waiting time elapses
+ * </ul>
+ *
+ * <p>If the lock is acquired then the value {@code true} is returned.
+ *
+ * <p>If the current thread:
+ * <ul>
+ * <li>has its interrupted status set on entry to this method; or
+ * <li>is {@linkplain Thread#interrupt interrupted} while acquiring
+ * the lock, and interruption of lock acquisition is supported,
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared.
+ *
+ * <p>If the specified waiting time elapses then the value {@code false}
+ * is returned.
+ * If the time is
+ * less than or equal to zero, the method will not wait at all.
+ *
+ * <p><b>Implementation Considerations</b>
+ *
+ * <p>The ability to interrupt a lock acquisition in some implementations
+ * may not be possible, and if possible may
+ * be an expensive operation.
+ * The programmer should be aware that this may be the case. An
+ * implementation should document when this is the case.
+ *
+ * <p>An implementation can favor responding to an interrupt over normal
+ * method return, or reporting a timeout.
+ *
+ * <p>A {@code Lock} implementation may be able to detect
+ * erroneous use of the lock, such as an invocation that would cause
+ * deadlock, and may throw an (unchecked) exception in such circumstances.
+ * The circumstances and the exception type must be documented by that
+ * {@code Lock} implementation.
+ *
+ * @param time the maximum time to wait for the lock
+ * @param unit the time unit of the {@code time} argument
+ * @return {@code true} if the lock was acquired and {@code false}
+ * if the waiting time elapsed before the lock was acquired
+ *
+ * @throws InterruptedException if the current thread is interrupted
+ * while acquiring the lock (and interruption of lock
+ * acquisition is supported)
+ */
+ boolean tryLock(long time, TimeUnit unit) throws InterruptedException;
+
+ /**
+ * Releases the lock.
+ *
+ * <p><b>Implementation Considerations</b>
+ *
+ * <p>A {@code Lock} implementation will usually impose
+ * restrictions on which thread can release a lock (typically only the
+ * holder of the lock can release it) and may throw
+ * an (unchecked) exception if the restriction is violated.
+ * Any restrictions and the exception
+ * type must be documented by that {@code Lock} implementation.
+ */
+ void unlock();
+
+ /**
+ * Returns a new {@link Condition} instance that is bound to this
+ * {@code Lock} instance.
+ *
+ * <p>Before waiting on the condition the lock must be held by the
+ * current thread.
+ * A call to {@link Condition#await()} will atomically release the lock
+ * before waiting and re-acquire the lock before the wait returns.
+ *
+ * <p><b>Implementation Considerations</b>
+ *
+ * <p>The exact operation of the {@link Condition} instance depends on
+ * the {@code Lock} implementation and must be documented by that
+ * implementation.
+ *
+ * @return A new {@link Condition} instance for this {@code Lock} instance
+ * @throws UnsupportedOperationException if this {@code Lock}
+ * implementation does not support conditions
+ */
+ Condition newCondition();
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/locks/LockSupport.java b/libjava/classpath/external/jsr166/java/util/concurrent/locks/LockSupport.java
new file mode 100644
index 00000000000..28728ae2bba
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/locks/LockSupport.java
@@ -0,0 +1,352 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.locks;
+import java.util.concurrent.*;
+import sun.misc.Unsafe;
+
+
+/**
+ * Basic thread blocking primitives for creating locks and other
+ * synchronization classes.
+ *
+ * <p>This class associates, with each thread that uses it, a permit
+ * (in the sense of the {@link java.util.concurrent.Semaphore
+ * Semaphore} class). A call to {@code park} will return immediately
+ * if the permit is available, consuming it in the process; otherwise
+ * it <em>may</em> block. A call to {@code unpark} makes the permit
+ * available, if it was not already available. (Unlike with Semaphores
+ * though, permits do not accumulate. There is at most one.)
+ *
+ * <p>Methods {@code park} and {@code unpark} provide efficient
+ * means of blocking and unblocking threads that do not encounter the
+ * problems that cause the deprecated methods {@code Thread.suspend}
+ * and {@code Thread.resume} to be unusable for such purposes: Races
+ * between one thread invoking {@code park} and another thread trying
+ * to {@code unpark} it will preserve liveness, due to the
+ * permit. Additionally, {@code park} will return if the caller's
+ * thread was interrupted, and timeout versions are supported. The
+ * {@code park} method may also return at any other time, for "no
+ * reason", so in general must be invoked within a loop that rechecks
+ * conditions upon return. In this sense {@code park} serves as an
+ * optimization of a "busy wait" that does not waste as much time
+ * spinning, but must be paired with an {@code unpark} to be
+ * effective.
+ *
+ * <p>The three forms of {@code park} each also support a
+ * {@code blocker} object parameter. This object is recorded while
+ * the thread is blocked to permit monitoring and diagnostic tools to
+ * identify the reasons that threads are blocked. (Such tools may
+ * access blockers using method {@link #getBlocker}.) The use of these
+ * forms rather than the original forms without this parameter is
+ * strongly encouraged. The normal argument to supply as a
+ * {@code blocker} within a lock implementation is {@code this}.
+ *
+ * <p>These methods are designed to be used as tools for creating
+ * higher-level synchronization utilities, and are not in themselves
+ * useful for most concurrency control applications. The {@code park}
+ * method is designed for use only in constructions of the form:
+ * <pre>while (!canProceed()) { ... LockSupport.park(this); }</pre>
+ * where neither {@code canProceed} nor any other actions prior to the
+ * call to {@code park} entail locking or blocking. Because only one
+ * permit is associated with each thread, any intermediary uses of
+ * {@code park} could interfere with its intended effects.
+ *
+ * <p><b>Sample Usage.</b> Here is a sketch of a first-in-first-out
+ * non-reentrant lock class:
+ * <pre>{@code
+ * class FIFOMutex {
+ * private final AtomicBoolean locked = new AtomicBoolean(false);
+ * private final Queue<Thread> waiters
+ * = new ConcurrentLinkedQueue<Thread>();
+ *
+ * public void lock() {
+ * boolean wasInterrupted = false;
+ * Thread current = Thread.currentThread();
+ * waiters.add(current);
+ *
+ * // Block while not first in queue or cannot acquire lock
+ * while (waiters.peek() != current ||
+ * !locked.compareAndSet(false, true)) {
+ * LockSupport.park(this);
+ * if (Thread.interrupted()) // ignore interrupts while waiting
+ * wasInterrupted = true;
+ * }
+ *
+ * waiters.remove();
+ * if (wasInterrupted) // reassert interrupt status on exit
+ * current.interrupt();
+ * }
+ *
+ * public void unlock() {
+ * locked.set(false);
+ * LockSupport.unpark(waiters.peek());
+ * }
+ * }}</pre>
+ */
+
+public class LockSupport {
+ private LockSupport() {} // Cannot be instantiated.
+
+ // Hotspot implementation via intrinsics API
+ private static final Unsafe unsafe = Unsafe.getUnsafe();
+ private static final long parkBlockerOffset;
+
+ static {
+ try {
+ parkBlockerOffset = unsafe.objectFieldOffset
+ (java.lang.Thread.class.getDeclaredField("parkBlocker"));
+ } catch (Exception ex) { throw new Error(ex); }
+ }
+
+ private static void setBlocker(Thread t, Object arg) {
+ // Even though volatile, hotspot doesn't need a write barrier here.
+ unsafe.putObject(t, parkBlockerOffset, arg);
+ }
+
+ /**
+ * Makes available the permit for the given thread, if it
+ * was not already available. If the thread was blocked on
+ * {@code park} then it will unblock. Otherwise, its next call
+ * to {@code park} is guaranteed not to block. This operation
+ * is not guaranteed to have any effect at all if the given
+ * thread has not been started.
+ *
+ * @param thread the thread to unpark, or {@code null}, in which case
+ * this operation has no effect
+ */
+ public static void unpark(Thread thread) {
+ if (thread != null)
+ unsafe.unpark(thread);
+ }
+
+ /**
+ * Disables the current thread for thread scheduling purposes unless the
+ * permit is available.
+ *
+ * <p>If the permit is available then it is consumed and the call returns
+ * immediately; otherwise
+ * the current thread becomes disabled for thread scheduling
+ * purposes and lies dormant until one of three things happens:
+ *
+ * <ul>
+ * <li>Some other thread invokes {@link #unpark unpark} with the
+ * current thread as the target; or
+ *
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread; or
+ *
+ * <li>The call spuriously (that is, for no reason) returns.
+ * </ul>
+ *
+ * <p>This method does <em>not</em> report which of these caused the
+ * method to return. Callers should re-check the conditions which caused
+ * the thread to park in the first place. Callers may also determine,
+ * for example, the interrupt status of the thread upon return.
+ *
+ * @param blocker the synchronization object responsible for this
+ * thread parking
+ * @since 1.6
+ */
+ public static void park(Object blocker) {
+ Thread t = Thread.currentThread();
+ setBlocker(t, blocker);
+ unsafe.park(false, 0L);
+ setBlocker(t, null);
+ }
+
+ /**
+ * Disables the current thread for thread scheduling purposes, for up to
+ * the specified waiting time, unless the permit is available.
+ *
+ * <p>If the permit is available then it is consumed and the call
+ * returns immediately; otherwise the current thread becomes disabled
+ * for thread scheduling purposes and lies dormant until one of four
+ * things happens:
+ *
+ * <ul>
+ * <li>Some other thread invokes {@link #unpark unpark} with the
+ * current thread as the target; or
+ *
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts} the current
+ * thread; or
+ *
+ * <li>The specified waiting time elapses; or
+ *
+ * <li>The call spuriously (that is, for no reason) returns.
+ * </ul>
+ *
+ * <p>This method does <em>not</em> report which of these caused the
+ * method to return. Callers should re-check the conditions which caused
+ * the thread to park in the first place. Callers may also determine,
+ * for example, the interrupt status of the thread, or the elapsed time
+ * upon return.
+ *
+ * @param blocker the synchronization object responsible for this
+ * thread parking
+ * @param nanos the maximum number of nanoseconds to wait
+ * @since 1.6
+ */
+ public static void parkNanos(Object blocker, long nanos) {
+ if (nanos > 0) {
+ Thread t = Thread.currentThread();
+ setBlocker(t, blocker);
+ unsafe.park(false, nanos);
+ setBlocker(t, null);
+ }
+ }
+
+ /**
+ * Disables the current thread for thread scheduling purposes, until
+ * the specified deadline, unless the permit is available.
+ *
+ * <p>If the permit is available then it is consumed and the call
+ * returns immediately; otherwise the current thread becomes disabled
+ * for thread scheduling purposes and lies dormant until one of four
+ * things happens:
+ *
+ * <ul>
+ * <li>Some other thread invokes {@link #unpark unpark} with the
+ * current thread as the target; or
+ *
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts} the
+ * current thread; or
+ *
+ * <li>The specified deadline passes; or
+ *
+ * <li>The call spuriously (that is, for no reason) returns.
+ * </ul>
+ *
+ * <p>This method does <em>not</em> report which of these caused the
+ * method to return. Callers should re-check the conditions which caused
+ * the thread to park in the first place. Callers may also determine,
+ * for example, the interrupt status of the thread, or the current time
+ * upon return.
+ *
+ * @param blocker the synchronization object responsible for this
+ * thread parking
+ * @param deadline the absolute time, in milliseconds from the Epoch,
+ * to wait until
+ * @since 1.6
+ */
+ public static void parkUntil(Object blocker, long deadline) {
+ Thread t = Thread.currentThread();
+ setBlocker(t, blocker);
+ unsafe.park(true, deadline);
+ setBlocker(t, null);
+ }
+
+ /**
+ * Returns the blocker object supplied to the most recent
+ * invocation of a park method that has not yet unblocked, or null
+ * if not blocked. The value returned is just a momentary
+ * snapshot -- the thread may have since unblocked or blocked on a
+ * different blocker object.
+ *
+ * @return the blocker
+ * @since 1.6
+ */
+ public static Object getBlocker(Thread t) {
+ return unsafe.getObjectVolatile(t, parkBlockerOffset);
+ }
+
+ /**
+ * Disables the current thread for thread scheduling purposes unless the
+ * permit is available.
+ *
+ * <p>If the permit is available then it is consumed and the call
+ * returns immediately; otherwise the current thread becomes disabled
+ * for thread scheduling purposes and lies dormant until one of three
+ * things happens:
+ *
+ * <ul>
+ *
+ * <li>Some other thread invokes {@link #unpark unpark} with the
+ * current thread as the target; or
+ *
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread; or
+ *
+ * <li>The call spuriously (that is, for no reason) returns.
+ * </ul>
+ *
+ * <p>This method does <em>not</em> report which of these caused the
+ * method to return. Callers should re-check the conditions which caused
+ * the thread to park in the first place. Callers may also determine,
+ * for example, the interrupt status of the thread upon return.
+ */
+ public static void park() {
+ unsafe.park(false, 0L);
+ }
+
+ /**
+ * Disables the current thread for thread scheduling purposes, for up to
+ * the specified waiting time, unless the permit is available.
+ *
+ * <p>If the permit is available then it is consumed and the call
+ * returns immediately; otherwise the current thread becomes disabled
+ * for thread scheduling purposes and lies dormant until one of four
+ * things happens:
+ *
+ * <ul>
+ * <li>Some other thread invokes {@link #unpark unpark} with the
+ * current thread as the target; or
+ *
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread; or
+ *
+ * <li>The specified waiting time elapses; or
+ *
+ * <li>The call spuriously (that is, for no reason) returns.
+ * </ul>
+ *
+ * <p>This method does <em>not</em> report which of these caused the
+ * method to return. Callers should re-check the conditions which caused
+ * the thread to park in the first place. Callers may also determine,
+ * for example, the interrupt status of the thread, or the elapsed time
+ * upon return.
+ *
+ * @param nanos the maximum number of nanoseconds to wait
+ */
+ public static void parkNanos(long nanos) {
+ if (nanos > 0)
+ unsafe.park(false, nanos);
+ }
+
+ /**
+ * Disables the current thread for thread scheduling purposes, until
+ * the specified deadline, unless the permit is available.
+ *
+ * <p>If the permit is available then it is consumed and the call
+ * returns immediately; otherwise the current thread becomes disabled
+ * for thread scheduling purposes and lies dormant until one of four
+ * things happens:
+ *
+ * <ul>
+ * <li>Some other thread invokes {@link #unpark unpark} with the
+ * current thread as the target; or
+ *
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread; or
+ *
+ * <li>The specified deadline passes; or
+ *
+ * <li>The call spuriously (that is, for no reason) returns.
+ * </ul>
+ *
+ * <p>This method does <em>not</em> report which of these caused the
+ * method to return. Callers should re-check the conditions which caused
+ * the thread to park in the first place. Callers may also determine,
+ * for example, the interrupt status of the thread, or the current time
+ * upon return.
+ *
+ * @param deadline the absolute time, in milliseconds from the Epoch,
+ * to wait until
+ */
+ public static void parkUntil(long deadline) {
+ unsafe.park(true, deadline);
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/locks/ReadWriteLock.java b/libjava/classpath/external/jsr166/java/util/concurrent/locks/ReadWriteLock.java
new file mode 100644
index 00000000000..484f68d1502
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/locks/ReadWriteLock.java
@@ -0,0 +1,104 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.locks;
+
+/**
+ * A <tt>ReadWriteLock</tt> maintains a pair of associated {@link
+ * Lock locks}, one for read-only operations and one for writing.
+ * The {@link #readLock read lock} may be held simultaneously by
+ * multiple reader threads, so long as there are no writers. The
+ * {@link #writeLock write lock} is exclusive.
+ *
+ * <p>All <tt>ReadWriteLock</tt> implementations must guarantee that
+ * the memory synchronization effects of <tt>writeLock</tt> operations
+ * (as specified in the {@link Lock} interface) also hold with respect
+ * to the associated <tt>readLock</tt>. That is, a thread successfully
+ * acquiring the read lock will see all updates made upon previous
+ * release of the write lock.
+ *
+ * <p>A read-write lock allows for a greater level of concurrency in
+ * accessing shared data than that permitted by a mutual exclusion lock.
+ * It exploits the fact that while only a single thread at a time (a
+ * <em>writer</em> thread) can modify the shared data, in many cases any
+ * number of threads can concurrently read the data (hence <em>reader</em>
+ * threads).
+ * In theory, the increase in concurrency permitted by the use of a read-write
+ * lock will lead to performance improvements over the use of a mutual
+ * exclusion lock. In practice this increase in concurrency will only be fully
+ * realized on a multi-processor, and then only if the access patterns for
+ * the shared data are suitable.
+ *
+ * <p>Whether or not a read-write lock will improve performance over the use
+ * of a mutual exclusion lock depends on the frequency that the data is
+ * read compared to being modified, the duration of the read and write
+ * operations, and the contention for the data - that is, the number of
+ * threads that will try to read or write the data at the same time.
+ * For example, a collection that is initially populated with data and
+ * thereafter infrequently modified, while being frequently searched
+ * (such as a directory of some kind) is an ideal candidate for the use of
+ * a read-write lock. However, if updates become frequent then the data
+ * spends most of its time being exclusively locked and there is little, if any
+ * increase in concurrency. Further, if the read operations are too short
+ * the overhead of the read-write lock implementation (which is inherently
+ * more complex than a mutual exclusion lock) can dominate the execution
+ * cost, particularly as many read-write lock implementations still serialize
+ * all threads through a small section of code. Ultimately, only profiling
+ * and measurement will establish whether the use of a read-write lock is
+ * suitable for your application.
+ *
+ *
+ * <p>Although the basic operation of a read-write lock is straight-forward,
+ * there are many policy decisions that an implementation must make, which
+ * may affect the effectiveness of the read-write lock in a given application.
+ * Examples of these policies include:
+ * <ul>
+ * <li>Determining whether to grant the read lock or the write lock, when
+ * both readers and writers are waiting, at the time that a writer releases
+ * the write lock. Writer preference is common, as writes are expected to be
+ * short and infrequent. Reader preference is less common as it can lead to
+ * lengthy delays for a write if the readers are frequent and long-lived as
+ * expected. Fair, or &quot;in-order&quot; implementations are also possible.
+ *
+ * <li>Determining whether readers that request the read lock while a
+ * reader is active and a writer is waiting, are granted the read lock.
+ * Preference to the reader can delay the writer indefinitely, while
+ * preference to the writer can reduce the potential for concurrency.
+ *
+ * <li>Determining whether the locks are reentrant: can a thread with the
+ * write lock reacquire it? Can it acquire a read lock while holding the
+ * write lock? Is the read lock itself reentrant?
+ *
+ * <li>Can the write lock be downgraded to a read lock without allowing
+ * an intervening writer? Can a read lock be upgraded to a write lock,
+ * in preference to other waiting readers or writers?
+ *
+ * </ul>
+ * You should consider all of these things when evaluating the suitability
+ * of a given implementation for your application.
+ *
+ * @see ReentrantReadWriteLock
+ * @see Lock
+ * @see ReentrantLock
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public interface ReadWriteLock {
+ /**
+ * Returns the lock used for reading.
+ *
+ * @return the lock used for reading.
+ */
+ Lock readLock();
+
+ /**
+ * Returns the lock used for writing.
+ *
+ * @return the lock used for writing.
+ */
+ Lock writeLock();
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/locks/ReentrantLock.java b/libjava/classpath/external/jsr166/java/util/concurrent/locks/ReentrantLock.java
new file mode 100644
index 00000000000..4a2fc175c17
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/locks/ReentrantLock.java
@@ -0,0 +1,740 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.locks;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+/**
+ * A reentrant mutual exclusion {@link Lock} with the same basic
+ * behavior and semantics as the implicit monitor lock accessed using
+ * {@code synchronized} methods and statements, but with extended
+ * capabilities.
+ *
+ * <p>A {@code ReentrantLock} is <em>owned</em> by the thread last
+ * successfully locking, but not yet unlocking it. A thread invoking
+ * {@code lock} will return, successfully acquiring the lock, when
+ * the lock is not owned by another thread. The method will return
+ * immediately if the current thread already owns the lock. This can
+ * be checked using methods {@link #isHeldByCurrentThread}, and {@link
+ * #getHoldCount}.
+ *
+ * <p>The constructor for this class accepts an optional
+ * <em>fairness</em> parameter. When set {@code true}, under
+ * contention, locks favor granting access to the longest-waiting
+ * thread. Otherwise this lock does not guarantee any particular
+ * access order. Programs using fair locks accessed by many threads
+ * may display lower overall throughput (i.e., are slower; often much
+ * slower) than those using the default setting, but have smaller
+ * variances in times to obtain locks and guarantee lack of
+ * starvation. Note however, that fairness of locks does not guarantee
+ * fairness of thread scheduling. Thus, one of many threads using a
+ * fair lock may obtain it multiple times in succession while other
+ * active threads are not progressing and not currently holding the
+ * lock.
+ * Also note that the untimed {@link #tryLock() tryLock} method does not
+ * honor the fairness setting. It will succeed if the lock
+ * is available even if other threads are waiting.
+ *
+ * <p>It is recommended practice to <em>always</em> immediately
+ * follow a call to {@code lock} with a {@code try} block, most
+ * typically in a before/after construction such as:
+ *
+ * <pre>
+ * class X {
+ * private final ReentrantLock lock = new ReentrantLock();
+ * // ...
+ *
+ * public void m() {
+ * lock.lock(); // block until condition holds
+ * try {
+ * // ... method body
+ * } finally {
+ * lock.unlock()
+ * }
+ * }
+ * }
+ * </pre>
+ *
+ * <p>In addition to implementing the {@link Lock} interface, this
+ * class defines methods {@code isLocked} and
+ * {@code getLockQueueLength}, as well as some associated
+ * {@code protected} access methods that may be useful for
+ * instrumentation and monitoring.
+ *
+ * <p>Serialization of this class behaves in the same way as built-in
+ * locks: a deserialized lock is in the unlocked state, regardless of
+ * its state when serialized.
+ *
+ * <p>This lock supports a maximum of 2147483647 recursive locks by
+ * the same thread. Attempts to exceed this limit result in
+ * {@link Error} throws from locking methods.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ */
+public class ReentrantLock implements Lock, java.io.Serializable {
+ private static final long serialVersionUID = 7373984872572414699L;
+ /** Synchronizer providing all implementation mechanics */
+ private final Sync sync;
+
+ /**
+ * Base of synchronization control for this lock. Subclassed
+ * into fair and nonfair versions below. Uses AQS state to
+ * represent the number of holds on the lock.
+ */
+ static abstract class Sync extends AbstractQueuedSynchronizer {
+ private static final long serialVersionUID = -5179523762034025860L;
+
+ /**
+ * Performs {@link Lock#lock}. The main reason for subclassing
+ * is to allow fast path for nonfair version.
+ */
+ abstract void lock();
+
+ /**
+ * Performs non-fair tryLock. tryAcquire is
+ * implemented in subclasses, but both need nonfair
+ * try for trylock method.
+ */
+ final boolean nonfairTryAcquire(int acquires) {
+ final Thread current = Thread.currentThread();
+ int c = getState();
+ if (c == 0) {
+ if (compareAndSetState(0, acquires)) {
+ setExclusiveOwnerThread(current);
+ return true;
+ }
+ }
+ else if (current == getExclusiveOwnerThread()) {
+ int nextc = c + acquires;
+ if (nextc < 0) // overflow
+ throw new Error("Maximum lock count exceeded");
+ setState(nextc);
+ return true;
+ }
+ return false;
+ }
+
+ protected final boolean tryRelease(int releases) {
+ int c = getState() - releases;
+ if (Thread.currentThread() != getExclusiveOwnerThread())
+ throw new IllegalMonitorStateException();
+ boolean free = false;
+ if (c == 0) {
+ free = true;
+ setExclusiveOwnerThread(null);
+ }
+ setState(c);
+ return free;
+ }
+
+ protected final boolean isHeldExclusively() {
+ // While we must in general read state before owner,
+ // we don't need to do so to check if current thread is owner
+ return getExclusiveOwnerThread() == Thread.currentThread();
+ }
+
+ final ConditionObject newCondition() {
+ return new ConditionObject();
+ }
+
+ // Methods relayed from outer class
+
+ final Thread getOwner() {
+ return getState() == 0 ? null : getExclusiveOwnerThread();
+ }
+
+ final int getHoldCount() {
+ return isHeldExclusively() ? getState() : 0;
+ }
+
+ final boolean isLocked() {
+ return getState() != 0;
+ }
+
+ /**
+ * Reconstitutes this lock instance from a stream.
+ * @param s the stream
+ */
+ private void readObject(java.io.ObjectInputStream s)
+ throws java.io.IOException, ClassNotFoundException {
+ s.defaultReadObject();
+ setState(0); // reset to unlocked state
+ }
+ }
+
+ /**
+ * Sync object for non-fair locks
+ */
+ final static class NonfairSync extends Sync {
+ private static final long serialVersionUID = 7316153563782823691L;
+
+ /**
+ * Performs lock. Try immediate barge, backing up to normal
+ * acquire on failure.
+ */
+ final void lock() {
+ if (compareAndSetState(0, 1))
+ setExclusiveOwnerThread(Thread.currentThread());
+ else
+ acquire(1);
+ }
+
+ protected final boolean tryAcquire(int acquires) {
+ return nonfairTryAcquire(acquires);
+ }
+ }
+
+ /**
+ * Sync object for fair locks
+ */
+ final static class FairSync extends Sync {
+ private static final long serialVersionUID = -3000897897090466540L;
+
+ final void lock() {
+ acquire(1);
+ }
+
+ /**
+ * Fair version of tryAcquire. Don't grant access unless
+ * recursive call or no waiters or is first.
+ */
+ protected final boolean tryAcquire(int acquires) {
+ final Thread current = Thread.currentThread();
+ int c = getState();
+ if (c == 0) {
+ if (isFirst(current) &&
+ compareAndSetState(0, acquires)) {
+ setExclusiveOwnerThread(current);
+ return true;
+ }
+ }
+ else if (current == getExclusiveOwnerThread()) {
+ int nextc = c + acquires;
+ if (nextc < 0)
+ throw new Error("Maximum lock count exceeded");
+ setState(nextc);
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /**
+ * Creates an instance of {@code ReentrantLock}.
+ * This is equivalent to using {@code ReentrantLock(false)}.
+ */
+ public ReentrantLock() {
+ sync = new NonfairSync();
+ }
+
+ /**
+ * Creates an instance of {@code ReentrantLock} with the
+ * given fairness policy.
+ *
+ * @param fair {@code true} if this lock should use a fair ordering policy
+ */
+ public ReentrantLock(boolean fair) {
+ sync = (fair)? new FairSync() : new NonfairSync();
+ }
+
+ /**
+ * Acquires the lock.
+ *
+ * <p>Acquires the lock if it is not held by another thread and returns
+ * immediately, setting the lock hold count to one.
+ *
+ * <p>If the current thread already holds the lock then the hold
+ * count is incremented by one and the method returns immediately.
+ *
+ * <p>If the lock is held by another thread then the
+ * current thread becomes disabled for thread scheduling
+ * purposes and lies dormant until the lock has been acquired,
+ * at which time the lock hold count is set to one.
+ */
+ public void lock() {
+ sync.lock();
+ }
+
+ /**
+ * Acquires the lock unless the current thread is
+ * {@linkplain Thread#interrupt interrupted}.
+ *
+ * <p>Acquires the lock if it is not held by another thread and returns
+ * immediately, setting the lock hold count to one.
+ *
+ * <p>If the current thread already holds this lock then the hold count
+ * is incremented by one and the method returns immediately.
+ *
+ * <p>If the lock is held by another thread then the
+ * current thread becomes disabled for thread scheduling
+ * purposes and lies dormant until one of two things happens:
+ *
+ * <ul>
+ *
+ * <li>The lock is acquired by the current thread; or
+ *
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts} the
+ * current thread.
+ *
+ * </ul>
+ *
+ * <p>If the lock is acquired by the current thread then the lock hold
+ * count is set to one.
+ *
+ * <p>If the current thread:
+ *
+ * <ul>
+ *
+ * <li>has its interrupted status set on entry to this method; or
+ *
+ * <li>is {@linkplain Thread#interrupt interrupted} while acquiring
+ * the lock,
+ *
+ * </ul>
+ *
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared.
+ *
+ * <p>In this implementation, as this method is an explicit
+ * interruption point, preference is given to responding to the
+ * interrupt over normal or reentrant acquisition of the lock.
+ *
+ * @throws InterruptedException if the current thread is interrupted
+ */
+ public void lockInterruptibly() throws InterruptedException {
+ sync.acquireInterruptibly(1);
+ }
+
+ /**
+ * Acquires the lock only if it is not held by another thread at the time
+ * of invocation.
+ *
+ * <p>Acquires the lock if it is not held by another thread and
+ * returns immediately with the value {@code true}, setting the
+ * lock hold count to one. Even when this lock has been set to use a
+ * fair ordering policy, a call to {@code tryLock()} <em>will</em>
+ * immediately acquire the lock if it is available, whether or not
+ * other threads are currently waiting for the lock.
+ * This &quot;barging&quot; behavior can be useful in certain
+ * circumstances, even though it breaks fairness. If you want to honor
+ * the fairness setting for this lock, then use
+ * {@link #tryLock(long, TimeUnit) tryLock(0, TimeUnit.SECONDS) }
+ * which is almost equivalent (it also detects interruption).
+ *
+ * <p> If the current thread already holds this lock then the hold
+ * count is incremented by one and the method returns {@code true}.
+ *
+ * <p>If the lock is held by another thread then this method will return
+ * immediately with the value {@code false}.
+ *
+ * @return {@code true} if the lock was free and was acquired by the
+ * current thread, or the lock was already held by the current
+ * thread; and {@code false} otherwise
+ */
+ public boolean tryLock() {
+ return sync.nonfairTryAcquire(1);
+ }
+
+ /**
+ * Acquires the lock if it is not held by another thread within the given
+ * waiting time and the current thread has not been
+ * {@linkplain Thread#interrupt interrupted}.
+ *
+ * <p>Acquires the lock if it is not held by another thread and returns
+ * immediately with the value {@code true}, setting the lock hold count
+ * to one. If this lock has been set to use a fair ordering policy then
+ * an available lock <em>will not</em> be acquired if any other threads
+ * are waiting for the lock. This is in contrast to the {@link #tryLock()}
+ * method. If you want a timed {@code tryLock} that does permit barging on
+ * a fair lock then combine the timed and un-timed forms together:
+ *
+ * <pre>if (lock.tryLock() || lock.tryLock(timeout, unit) ) { ... }
+ * </pre>
+ *
+ * <p>If the current thread
+ * already holds this lock then the hold count is incremented by one and
+ * the method returns {@code true}.
+ *
+ * <p>If the lock is held by another thread then the
+ * current thread becomes disabled for thread scheduling
+ * purposes and lies dormant until one of three things happens:
+ *
+ * <ul>
+ *
+ * <li>The lock is acquired by the current thread; or
+ *
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread; or
+ *
+ * <li>The specified waiting time elapses
+ *
+ * </ul>
+ *
+ * <p>If the lock is acquired then the value {@code true} is returned and
+ * the lock hold count is set to one.
+ *
+ * <p>If the current thread:
+ *
+ * <ul>
+ *
+ * <li>has its interrupted status set on entry to this method; or
+ *
+ * <li>is {@linkplain Thread#interrupt interrupted} while
+ * acquiring the lock,
+ *
+ * </ul>
+ * then {@link InterruptedException} is thrown and the current thread's
+ * interrupted status is cleared.
+ *
+ * <p>If the specified waiting time elapses then the value {@code false}
+ * is returned. If the time is less than or equal to zero, the method
+ * will not wait at all.
+ *
+ * <p>In this implementation, as this method is an explicit
+ * interruption point, preference is given to responding to the
+ * interrupt over normal or reentrant acquisition of the lock, and
+ * over reporting the elapse of the waiting time.
+ *
+ * @param timeout the time to wait for the lock
+ * @param unit the time unit of the timeout argument
+ * @return {@code true} if the lock was free and was acquired by the
+ * current thread, or the lock was already held by the current
+ * thread; and {@code false} if the waiting time elapsed before
+ * the lock could be acquired
+ * @throws InterruptedException if the current thread is interrupted
+ * @throws NullPointerException if the time unit is null
+ *
+ */
+ public boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException {
+ return sync.tryAcquireNanos(1, unit.toNanos(timeout));
+ }
+
+ /**
+ * Attempts to release this lock.
+ *
+ * <p>If the current thread is the holder of this lock then the hold
+ * count is decremented. If the hold count is now zero then the lock
+ * is released. If the current thread is not the holder of this
+ * lock then {@link IllegalMonitorStateException} is thrown.
+ *
+ * @throws IllegalMonitorStateException if the current thread does not
+ * hold this lock
+ */
+ public void unlock() {
+ sync.release(1);
+ }
+
+ /**
+ * Returns a {@link Condition} instance for use with this
+ * {@link Lock} instance.
+ *
+ * <p>The returned {@link Condition} instance supports the same
+ * usages as do the {@link Object} monitor methods ({@link
+ * Object#wait() wait}, {@link Object#notify notify}, and {@link
+ * Object#notifyAll notifyAll}) when used with the built-in
+ * monitor lock.
+ *
+ * <ul>
+ *
+ * <li>If this lock is not held when any of the {@link Condition}
+ * {@linkplain Condition#await() waiting} or {@linkplain
+ * Condition#signal signalling} methods are called, then an {@link
+ * IllegalMonitorStateException} is thrown.
+ *
+ * <li>When the condition {@linkplain Condition#await() waiting}
+ * methods are called the lock is released and, before they
+ * return, the lock is reacquired and the lock hold count restored
+ * to what it was when the method was called.
+ *
+ * <li>If a thread is {@linkplain Thread#interrupt interrupted}
+ * while waiting then the wait will terminate, an {@link
+ * InterruptedException} will be thrown, and the thread's
+ * interrupted status will be cleared.
+ *
+ * <li> Waiting threads are signalled in FIFO order.
+ *
+ * <li>The ordering of lock reacquisition for threads returning
+ * from waiting methods is the same as for threads initially
+ * acquiring the lock, which is in the default case not specified,
+ * but for <em>fair</em> locks favors those threads that have been
+ * waiting the longest.
+ *
+ * </ul>
+ *
+ * @return the Condition object
+ */
+ public Condition newCondition() {
+ return sync.newCondition();
+ }
+
+ /**
+ * Queries the number of holds on this lock by the current thread.
+ *
+ * <p>A thread has a hold on a lock for each lock action that is not
+ * matched by an unlock action.
+ *
+ * <p>The hold count information is typically only used for testing and
+ * debugging purposes. For example, if a certain section of code should
+ * not be entered with the lock already held then we can assert that
+ * fact:
+ *
+ * <pre>
+ * class X {
+ * ReentrantLock lock = new ReentrantLock();
+ * // ...
+ * public void m() {
+ * assert lock.getHoldCount() == 0;
+ * lock.lock();
+ * try {
+ * // ... method body
+ * } finally {
+ * lock.unlock();
+ * }
+ * }
+ * }
+ * </pre>
+ *
+ * @return the number of holds on this lock by the current thread,
+ * or zero if this lock is not held by the current thread
+ */
+ public int getHoldCount() {
+ return sync.getHoldCount();
+ }
+
+ /**
+ * Queries if this lock is held by the current thread.
+ *
+ * <p>Analogous to the {@link Thread#holdsLock} method for built-in
+ * monitor locks, this method is typically used for debugging and
+ * testing. For example, a method that should only be called while
+ * a lock is held can assert that this is the case:
+ *
+ * <pre>
+ * class X {
+ * ReentrantLock lock = new ReentrantLock();
+ * // ...
+ *
+ * public void m() {
+ * assert lock.isHeldByCurrentThread();
+ * // ... method body
+ * }
+ * }
+ * </pre>
+ *
+ * <p>It can also be used to ensure that a reentrant lock is used
+ * in a non-reentrant manner, for example:
+ *
+ * <pre>
+ * class X {
+ * ReentrantLock lock = new ReentrantLock();
+ * // ...
+ *
+ * public void m() {
+ * assert !lock.isHeldByCurrentThread();
+ * lock.lock();
+ * try {
+ * // ... method body
+ * } finally {
+ * lock.unlock();
+ * }
+ * }
+ * }
+ * </pre>
+ *
+ * @return {@code true} if current thread holds this lock and
+ * {@code false} otherwise
+ */
+ public boolean isHeldByCurrentThread() {
+ return sync.isHeldExclusively();
+ }
+
+ /**
+ * Queries if this lock is held by any thread. This method is
+ * designed for use in monitoring of the system state,
+ * not for synchronization control.
+ *
+ * @return {@code true} if any thread holds this lock and
+ * {@code false} otherwise
+ */
+ public boolean isLocked() {
+ return sync.isLocked();
+ }
+
+ /**
+ * Returns {@code true} if this lock has fairness set true.
+ *
+ * @return {@code true} if this lock has fairness set true
+ */
+ public final boolean isFair() {
+ return sync instanceof FairSync;
+ }
+
+ /**
+ * Returns the thread that currently owns this lock, or
+ * {@code null} if not owned. When this method is called by a
+ * thread that is not the owner, the return value reflects a
+ * best-effort approximation of current lock status. For example,
+ * the owner may be momentarily {@code null} even if there are
+ * threads trying to acquire the lock but have not yet done so.
+ * This method is designed to facilitate construction of
+ * subclasses that provide more extensive lock monitoring
+ * facilities.
+ *
+ * @return the owner, or {@code null} if not owned
+ */
+ protected Thread getOwner() {
+ return sync.getOwner();
+ }
+
+ /**
+ * Queries whether any threads are waiting to acquire this lock. Note that
+ * because cancellations may occur at any time, a {@code true}
+ * return does not guarantee that any other thread will ever
+ * acquire this lock. This method is designed primarily for use in
+ * monitoring of the system state.
+ *
+ * @return {@code true} if there may be other threads waiting to
+ * acquire the lock
+ */
+ public final boolean hasQueuedThreads() {
+ return sync.hasQueuedThreads();
+ }
+
+
+ /**
+ * Queries whether the given thread is waiting to acquire this
+ * lock. Note that because cancellations may occur at any time, a
+ * {@code true} return does not guarantee that this thread
+ * will ever acquire this lock. This method is designed primarily for use
+ * in monitoring of the system state.
+ *
+ * @param thread the thread
+ * @return {@code true} if the given thread is queued waiting for this lock
+ * @throws NullPointerException if the thread is null
+ */
+ public final boolean hasQueuedThread(Thread thread) {
+ return sync.isQueued(thread);
+ }
+
+
+ /**
+ * Returns an estimate of the number of threads waiting to
+ * acquire this lock. The value is only an estimate because the number of
+ * threads may change dynamically while this method traverses
+ * internal data structures. This method is designed for use in
+ * monitoring of the system state, not for synchronization
+ * control.
+ *
+ * @return the estimated number of threads waiting for this lock
+ */
+ public final int getQueueLength() {
+ return sync.getQueueLength();
+ }
+
+ /**
+ * Returns a collection containing threads that may be waiting to
+ * acquire this lock. Because the actual set of threads may change
+ * dynamically while constructing this result, the returned
+ * collection is only a best-effort estimate. The elements of the
+ * returned collection are in no particular order. This method is
+ * designed to facilitate construction of subclasses that provide
+ * more extensive monitoring facilities.
+ *
+ * @return the collection of threads
+ */
+ protected Collection<Thread> getQueuedThreads() {
+ return sync.getQueuedThreads();
+ }
+
+ /**
+ * Queries whether any threads are waiting on the given condition
+ * associated with this lock. Note that because timeouts and
+ * interrupts may occur at any time, a {@code true} return does
+ * not guarantee that a future {@code signal} will awaken any
+ * threads. This method is designed primarily for use in
+ * monitoring of the system state.
+ *
+ * @param condition the condition
+ * @return {@code true} if there are any waiting threads
+ * @throws IllegalMonitorStateException if this lock is not held
+ * @throws IllegalArgumentException if the given condition is
+ * not associated with this lock
+ * @throws NullPointerException if the condition is null
+ */
+ public boolean hasWaiters(Condition condition) {
+ if (condition == null)
+ throw new NullPointerException();
+ if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject))
+ throw new IllegalArgumentException("not owner");
+ return sync.hasWaiters((AbstractQueuedSynchronizer.ConditionObject)condition);
+ }
+
+ /**
+ * Returns an estimate of the number of threads waiting on the
+ * given condition associated with this lock. Note that because
+ * timeouts and interrupts may occur at any time, the estimate
+ * serves only as an upper bound on the actual number of waiters.
+ * This method is designed for use in monitoring of the system
+ * state, not for synchronization control.
+ *
+ * @param condition the condition
+ * @return the estimated number of waiting threads
+ * @throws IllegalMonitorStateException if this lock is not held
+ * @throws IllegalArgumentException if the given condition is
+ * not associated with this lock
+ * @throws NullPointerException if the condition is null
+ */
+ public int getWaitQueueLength(Condition condition) {
+ if (condition == null)
+ throw new NullPointerException();
+ if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject))
+ throw new IllegalArgumentException("not owner");
+ return sync.getWaitQueueLength((AbstractQueuedSynchronizer.ConditionObject)condition);
+ }
+
+ /**
+ * Returns a collection containing those threads that may be
+ * waiting on the given condition associated with this lock.
+ * Because the actual set of threads may change dynamically while
+ * constructing this result, the returned collection is only a
+ * best-effort estimate. The elements of the returned collection
+ * are in no particular order. This method is designed to
+ * facilitate construction of subclasses that provide more
+ * extensive condition monitoring facilities.
+ *
+ * @param condition the condition
+ * @return the collection of threads
+ * @throws IllegalMonitorStateException if this lock is not held
+ * @throws IllegalArgumentException if the given condition is
+ * not associated with this lock
+ * @throws NullPointerException if the condition is null
+ */
+ protected Collection<Thread> getWaitingThreads(Condition condition) {
+ if (condition == null)
+ throw new NullPointerException();
+ if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject))
+ throw new IllegalArgumentException("not owner");
+ return sync.getWaitingThreads((AbstractQueuedSynchronizer.ConditionObject)condition);
+ }
+
+ /**
+ * Returns a string identifying this lock, as well as its lock state.
+ * The state, in brackets, includes either the String {@code "Unlocked"}
+ * or the String {@code "Locked by"} followed by the
+ * {@linkplain Thread#getName name} of the owning thread.
+ *
+ * @return a string identifying this lock, as well as its lock state
+ */
+ public String toString() {
+ Thread o = sync.getOwner();
+ return super.toString() + ((o == null) ?
+ "[Unlocked]" :
+ "[Locked by thread " + o.getName() + "]");
+ }
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/locks/ReentrantReadWriteLock.java b/libjava/classpath/external/jsr166/java/util/concurrent/locks/ReentrantReadWriteLock.java
new file mode 100644
index 00000000000..df18a7c0884
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/locks/ReentrantReadWriteLock.java
@@ -0,0 +1,1346 @@
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util.concurrent.locks;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+import java.util.*;
+
+/**
+ * An implementation of {@link ReadWriteLock} supporting similar
+ * semantics to {@link ReentrantLock}.
+ * <p>This class has the following properties:
+ *
+ * <ul>
+ * <li><b>Acquisition order</b>
+ *
+ * <p> This class does not impose a reader or writer preference
+ * ordering for lock access. However, it does support an optional
+ * <em>fairness</em> policy.
+ *
+ * <dl>
+ * <dt><b><i>Non-fair mode (default)</i></b>
+ * <dd>When constructed as non-fair (the default), the order of entry
+ * to the read and write lock is unspecified, subject to reentrancy
+ * constraints. A nonfair lock that is continously contended may
+ * indefinitely postpone one or more reader or writer threads, but
+ * will normally have higher throughput than a fair lock.
+ * <p>
+ *
+ * <dt><b><i>Fair mode</i></b>
+ * <dd> When constructed as fair, threads contend for entry using an
+ * approximately arrival-order policy. When the currently held lock
+ * is released either the longest-waiting single writer thread will
+ * be assigned the write lock, or if there is a group of reader threads
+ * waiting longer than all waiting writer threads, that group will be
+ * assigned the read lock.
+ *
+ * <p>A thread that tries to acquire a fair read lock (non-reentrantly)
+ * will block if either the write lock is held, or there is a waiting
+ * writer thread. The thread will not acquire the read lock until
+ * after the oldest currently waiting writer thread has acquired and
+ * released the write lock. Of course, if a waiting writer abandons
+ * its wait, leaving one or more reader threads as the longest waiters
+ * in the queue with the write lock free, then those readers will be
+ * assigned the read lock.
+ *
+ * <p>A thread that tries to acquire a fair write lock (non-reentrantly)
+ * will block unless both the read lock and write lock are free (which
+ * implies there are no waiting threads). (Note that the non-blocking
+ * {@link ReadLock#tryLock()} and {@link WriteLock#tryLock()} methods
+ * do not honor this fair setting and will acquire the lock if it is
+ * possible, regardless of waiting threads.)
+ * <p>
+ * </dl>
+ *
+ * <li><b>Reentrancy</b>
+ *
+ * <p>This lock allows both readers and writers to reacquire read or
+ * write locks in the style of a {@link ReentrantLock}. Non-reentrant
+ * readers are not allowed until all write locks held by the writing
+ * thread have been released.
+ *
+ * <p>Additionally, a writer can acquire the read lock, but not
+ * vice-versa. Among other applications, reentrancy can be useful
+ * when write locks are held during calls or callbacks to methods that
+ * perform reads under read locks. If a reader tries to acquire the
+ * write lock it will never succeed.
+ *
+ * <li><b>Lock downgrading</b>
+ * <p>Reentrancy also allows downgrading from the write lock to a read lock,
+ * by acquiring the write lock, then the read lock and then releasing the
+ * write lock. However, upgrading from a read lock to the write lock is
+ * <b>not</b> possible.
+ *
+ * <li><b>Interruption of lock acquisition</b>
+ * <p>The read lock and write lock both support interruption during lock
+ * acquisition.
+ *
+ * <li><b>{@link Condition} support</b>
+ * <p>The write lock provides a {@link Condition} implementation that
+ * behaves in the same way, with respect to the write lock, as the
+ * {@link Condition} implementation provided by
+ * {@link ReentrantLock#newCondition} does for {@link ReentrantLock}.
+ * This {@link Condition} can, of course, only be used with the write lock.
+ *
+ * <p>The read lock does not support a {@link Condition} and
+ * {@code readLock().newCondition()} throws
+ * {@code UnsupportedOperationException}.
+ *
+ * <li><b>Instrumentation</b>
+ * <p>This class supports methods to determine whether locks
+ * are held or contended. These methods are designed for monitoring
+ * system state, not for synchronization control.
+ * </ul>
+ *
+ * <p>Serialization of this class behaves in the same way as built-in
+ * locks: a deserialized lock is in the unlocked state, regardless of
+ * its state when serialized.
+ *
+ * <p><b>Sample usages</b>. Here is a code sketch showing how to exploit
+ * reentrancy to perform lock downgrading after updating a cache (exception
+ * handling is elided for simplicity):
+ * <pre>
+ * class CachedData {
+ * Object data;
+ * volatile boolean cacheValid;
+ * ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
+ *
+ * void processCachedData() {
+ * rwl.readLock().lock();
+ * if (!cacheValid) {
+ * // Must release read lock before acquiring write lock
+ * rwl.readLock().unlock();
+ * rwl.writeLock().lock();
+ * // Recheck state because another thread might have acquired
+ * // write lock and changed state before we did.
+ * if (!cacheValid) {
+ * data = ...
+ * cacheValid = true;
+ * }
+ * // Downgrade by acquiring read lock before releasing write lock
+ * rwl.readLock().lock();
+ * rwl.writeLock().unlock(); // Unlock write, still hold read
+ * }
+ *
+ * use(data);
+ * rwl.readLock().unlock();
+ * }
+ * }
+ * </pre>
+ *
+ * ReentrantReadWriteLocks can be used to improve concurrency in some
+ * uses of some kinds of Collections. This is typically worthwhile
+ * only when the collections are expected to be large, accessed by
+ * more reader threads than writer threads, and entail operations with
+ * overhead that outweighs synchronization overhead. For example, here
+ * is a class using a TreeMap that is expected to be large and
+ * concurrently accessed.
+ *
+ * <pre>{@code
+ * class RWDictionary {
+ * private final Map<String, Data> m = new TreeMap<String, Data>();
+ * private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
+ * private final Lock r = rwl.readLock();
+ * private final Lock w = rwl.writeLock();
+ *
+ * public Data get(String key) {
+ * r.lock();
+ * try { return m.get(key); }
+ * finally { r.unlock(); }
+ * }
+ * public String[] allKeys() {
+ * r.lock();
+ * try { return m.keySet().toArray(); }
+ * finally { r.unlock(); }
+ * }
+ * public Data put(String key, Data value) {
+ * w.lock();
+ * try { return m.put(key, value); }
+ * finally { w.unlock(); }
+ * }
+ * public void clear() {
+ * w.lock();
+ * try { m.clear(); }
+ * finally { w.unlock(); }
+ * }
+ * }}</pre>
+ *
+ * <h3>Implementation Notes</h3>
+ *
+ * <p>This lock supports a maximum of 65535 recursive write locks
+ * and 65535 read locks. Attempts to exceed these limits result in
+ * {@link Error} throws from locking methods.
+ *
+ * @since 1.5
+ * @author Doug Lea
+ *
+ */
+public class ReentrantReadWriteLock implements ReadWriteLock, java.io.Serializable {
+ private static final long serialVersionUID = -6992448646407690164L;
+ /** Inner class providing readlock */
+ private final ReentrantReadWriteLock.ReadLock readerLock;
+ /** Inner class providing writelock */
+ private final ReentrantReadWriteLock.WriteLock writerLock;
+ /** Performs all synchronization mechanics */
+ private final Sync sync;
+
+ /**
+ * Creates a new {@code ReentrantReadWriteLock} with
+ * default (nonfair) ordering properties.
+ */
+ public ReentrantReadWriteLock() {
+ this(false);
+ }
+
+ /**
+ * Creates a new {@code ReentrantReadWriteLock} with
+ * the given fairness policy.
+ *
+ * @param fair {@code true} if this lock should use a fair ordering policy
+ */
+ public ReentrantReadWriteLock(boolean fair) {
+ sync = (fair)? new FairSync() : new NonfairSync();
+ readerLock = new ReadLock(this);
+ writerLock = new WriteLock(this);
+ }
+
+ public ReentrantReadWriteLock.WriteLock writeLock() { return writerLock; }
+ public ReentrantReadWriteLock.ReadLock readLock() { return readerLock; }
+
+ /**
+ * Synchronization implementation for ReentrantReadWriteLock.
+ * Subclassed into fair and nonfair versions.
+ */
+ static abstract class Sync extends AbstractQueuedSynchronizer {
+ private static final long serialVersionUID = 6317671515068378041L;
+
+ /*
+ * Read vs write count extraction constants and functions.
+ * Lock state is logically divided into two shorts: The lower
+ * one representing the exclusive (writer) lock hold count,
+ * and the upper the shared (reader) hold count.
+ */
+
+ static final int SHARED_SHIFT = 16;
+ static final int SHARED_UNIT = (1 << SHARED_SHIFT);
+ static final int MAX_COUNT = (1 << SHARED_SHIFT) - 1;
+ static final int EXCLUSIVE_MASK = (1 << SHARED_SHIFT) - 1;
+
+ /** Returns the number of shared holds represented in count */
+ static int sharedCount(int c) { return c >>> SHARED_SHIFT; }
+ /** Returns the number of exclusive holds represented in count */
+ static int exclusiveCount(int c) { return c & EXCLUSIVE_MASK; }
+
+ /**
+ * A counter for per-thread read hold counts.
+ * Maintained as a ThreadLocal; cached in cachedHoldCounter
+ */
+ static final class HoldCounter {
+ int count;
+ // Use id, not reference, to avoid garbage retention
+ final long tid = Thread.currentThread().getId();
+ /** Decrement if positive; return previous value */
+ int tryDecrement() {
+ int c = count;
+ if (c > 0)
+ count = c - 1;
+ return c;
+ }
+ }
+
+ /**
+ * ThreadLocal subclass. Easiest to explicitly define for sake
+ * of deserialization mechanics.
+ */
+ static final class ThreadLocalHoldCounter
+ extends ThreadLocal<HoldCounter> {
+ public HoldCounter initialValue() {
+ return new HoldCounter();
+ }
+ }
+
+ /**
+ * The number of read locks held by current thread.
+ * Initialized only in constructor and readObject.
+ */
+ transient ThreadLocalHoldCounter readHolds;
+
+ /**
+ * The hold count of the last thread to successfully acquire
+ * readLock. This saves ThreadLocal lookup in the common case
+ * where the next thread to release is the last one to
+ * acquire. This is non-volatile since it is just used
+ * as a heuristic, and would be great for threads to cache.
+ */
+ transient HoldCounter cachedHoldCounter;
+
+ Sync() {
+ readHolds = new ThreadLocalHoldCounter();
+ setState(getState()); // ensures visibility of readHolds
+ }
+
+ /*
+ * Acquires and releases use the same code for fair and
+ * nonfair locks, but differ in whether/how they allow barging
+ * when queues are non-empty.
+ */
+
+ /**
+ * Return true if a reader thread that is otherwise
+ * eligible for lock should block because of policy
+ * for overtaking other waiting threads.
+ */
+ abstract boolean readerShouldBlock(Thread current);
+
+ /**
+ * Return true if a writer thread that is otherwise
+ * eligible for lock should block because of policy
+ * for overtaking other waiting threads.
+ */
+ abstract boolean writerShouldBlock(Thread current);
+
+ /*
+ * Note that tryRelease and tryAcquire can be called by
+ * Conditions. So it is possible that their arguments contain
+ * both read and write holds that are all released during a
+ * condition wait and re-established in tryAcquire.
+ */
+
+ protected final boolean tryRelease(int releases) {
+ int nextc = getState() - releases;
+ if (Thread.currentThread() != getExclusiveOwnerThread())
+ throw new IllegalMonitorStateException();
+ if (exclusiveCount(nextc) == 0) {
+ setExclusiveOwnerThread(null);
+ setState(nextc);
+ return true;
+ } else {
+ setState(nextc);
+ return false;
+ }
+ }
+
+ protected final boolean tryAcquire(int acquires) {
+ /*
+ * Walkthrough:
+ * 1. if read count nonzero or write count nonzero
+ * and owner is a different thread, fail.
+ * 2. If count would saturate, fail. (This can only
+ * happen if count is already nonzero.)
+ * 3. Otherwise, this thread is eligible for lock if
+ * it is either a reentrant acquire or
+ * queue policy allows it. If so, update state
+ * and set owner.
+ */
+ Thread current = Thread.currentThread();
+ int c = getState();
+ int w = exclusiveCount(c);
+ if (c != 0) {
+ // (Note: if c != 0 and w == 0 then shared count != 0)
+ if (w == 0 || current != getExclusiveOwnerThread())
+ return false;
+ if (w + exclusiveCount(acquires) > MAX_COUNT)
+ throw new Error("Maximum lock count exceeded");
+ }
+ if ((w == 0 && writerShouldBlock(current)) ||
+ !compareAndSetState(c, c + acquires))
+ return false;
+ setExclusiveOwnerThread(current);
+ return true;
+ }
+
+ protected final boolean tryReleaseShared(int unused) {
+ HoldCounter rh = cachedHoldCounter;
+ Thread current = Thread.currentThread();
+ if (rh == null || rh.tid != current.getId())
+ rh = readHolds.get();
+ if (rh.tryDecrement() <= 0)
+ throw new IllegalMonitorStateException();
+ for (;;) {
+ int c = getState();
+ int nextc = c - SHARED_UNIT;
+ if (compareAndSetState(c, nextc))
+ return nextc == 0;
+ }
+ }
+
+ protected final int tryAcquireShared(int unused) {
+ /*
+ * Walkthrough:
+ * 1. If write lock held by another thread, fail
+ * 2. If count saturated, throw error
+ * 3. Otherwise, this thread is eligible for
+ * lock wrt state, so ask if it should block
+ * because of queue policy. If not, try
+ * to grant by CASing state and updating count.
+ * Note that step does not check for reentrant
+ * acquires, which is postponed to full version
+ * to avoid having to check hold count in
+ * the more typical non-reentrant case.
+ * 4. If step 3 fails either because thread
+ * apparently not eligible or CAS fails,
+ * chain to version with full retry loop.
+ */
+ Thread current = Thread.currentThread();
+ int c = getState();
+ if (exclusiveCount(c) != 0 &&
+ getExclusiveOwnerThread() != current)
+ return -1;
+ if (sharedCount(c) == MAX_COUNT)
+ throw new Error("Maximum lock count exceeded");
+ if (!readerShouldBlock(current) &&
+ compareAndSetState(c, c + SHARED_UNIT)) {
+ HoldCounter rh = cachedHoldCounter;
+ if (rh == null || rh.tid != current.getId())
+ cachedHoldCounter = rh = readHolds.get();
+ rh.count++;
+ return 1;
+ }
+ return fullTryAcquireShared(current);
+ }
+
+ /**
+ * Full version of acquire for reads, that handles CAS misses
+ * and reentrant reads not dealt with in tryAcquireShared.
+ */
+ final int fullTryAcquireShared(Thread current) {
+ /*
+ * This code is in part redundant with that in
+ * tryAcquireShared but is simpler overall by not
+ * complicating tryAcquireShared with interactions between
+ * retries and lazily reading hold counts.
+ */
+ HoldCounter rh = cachedHoldCounter;
+ if (rh == null || rh.tid != current.getId())
+ rh = readHolds.get();
+ for (;;) {
+ int c = getState();
+ int w = exclusiveCount(c);
+ if ((w != 0 && getExclusiveOwnerThread() != current) ||
+ ((rh.count | w) == 0 && readerShouldBlock(current)))
+ return -1;
+ if (sharedCount(c) == MAX_COUNT)
+ throw new Error("Maximum lock count exceeded");
+ if (compareAndSetState(c, c + SHARED_UNIT)) {
+ cachedHoldCounter = rh; // cache for release
+ rh.count++;
+ return 1;
+ }
+ }
+ }
+
+ /**
+ * Performs tryLock for write, enabling barging in both modes.
+ * This is identical in effect to tryAcquire except for lack
+ * of calls to writerShouldBlock
+ */
+ final boolean tryWriteLock() {
+ Thread current = Thread.currentThread();
+ int c = getState();
+ if (c != 0) {
+ int w = exclusiveCount(c);
+ if (w == 0 ||current != getExclusiveOwnerThread())
+ return false;
+ if (w == MAX_COUNT)
+ throw new Error("Maximum lock count exceeded");
+ }
+ if (!compareAndSetState(c, c + 1))
+ return false;
+ setExclusiveOwnerThread(current);
+ return true;
+ }
+
+ /**
+ * Performs tryLock for read, enabling barging in both modes.
+ * This is identical in effect to tryAcquireShared except for
+ * lack of calls to readerShouldBlock
+ */
+ final boolean tryReadLock() {
+ Thread current = Thread.currentThread();
+ for (;;) {
+ int c = getState();
+ if (exclusiveCount(c) != 0 &&
+ getExclusiveOwnerThread() != current)
+ return false;
+ if (sharedCount(c) == MAX_COUNT)
+ throw new Error("Maximum lock count exceeded");
+ if (compareAndSetState(c, c + SHARED_UNIT)) {
+ HoldCounter rh = cachedHoldCounter;
+ if (rh == null || rh.tid != current.getId())
+ cachedHoldCounter = rh = readHolds.get();
+ rh.count++;
+ return true;
+ }
+ }
+ }
+
+ protected final boolean isHeldExclusively() {
+ // While we must in general read state before owner,
+ // we don't need to do so to check if current thread is owner
+ return getExclusiveOwnerThread() == Thread.currentThread();
+ }
+
+ // Methods relayed to outer class
+
+ final ConditionObject newCondition() {
+ return new ConditionObject();
+ }
+
+ final Thread getOwner() {
+ // Must read state before owner to ensure memory consistency
+ return ((exclusiveCount(getState()) == 0)?
+ null :
+ getExclusiveOwnerThread());
+ }
+
+ final int getReadLockCount() {
+ return sharedCount(getState());
+ }
+
+ final boolean isWriteLocked() {
+ return exclusiveCount(getState()) != 0;
+ }
+
+ final int getWriteHoldCount() {
+ return isHeldExclusively() ? exclusiveCount(getState()) : 0;
+ }
+
+ final int getReadHoldCount() {
+ return getReadLockCount() == 0? 0 : readHolds.get().count;
+ }
+
+ /**
+ * Reconstitute this lock instance from a stream
+ * @param s the stream
+ */
+ private void readObject(java.io.ObjectInputStream s)
+ throws java.io.IOException, ClassNotFoundException {
+ s.defaultReadObject();
+ readHolds = new ThreadLocalHoldCounter();
+ setState(0); // reset to unlocked state
+ }
+
+ final int getCount() { return getState(); }
+ }
+
+ /**
+ * Nonfair version of Sync
+ */
+ final static class NonfairSync extends Sync {
+ private static final long serialVersionUID = -8159625535654395037L;
+ final boolean writerShouldBlock(Thread current) {
+ return false; // writers can always barge
+ }
+ final boolean readerShouldBlock(Thread current) {
+ /* As a heuristic to avoid indefinite writer starvation,
+ * block if the thread that momentarily appears to be head
+ * of queue, if one exists, is a waiting writer. This is
+ * only a probablistic effect since a new reader will not
+ * block if there is a waiting writer behind other enabled
+ * readers that have not yet drained from the queue.
+ */
+ return apparentlyFirstQueuedIsExclusive();
+ }
+ }
+
+ /**
+ * Fair version of Sync
+ */
+ final static class FairSync extends Sync {
+ private static final long serialVersionUID = -2274990926593161451L;
+ final boolean writerShouldBlock(Thread current) {
+ // only proceed if queue is empty or current thread at head
+ return !isFirst(current);
+ }
+ final boolean readerShouldBlock(Thread current) {
+ // only proceed if queue is empty or current thread at head
+ return !isFirst(current);
+ }
+ }
+
+ /**
+ * The lock returned by method {@link ReentrantReadWriteLock#readLock}.
+ */
+ public static class ReadLock implements Lock, java.io.Serializable {
+ private static final long serialVersionUID = -5992448646407690164L;
+ private final Sync sync;
+
+ /**
+ * Constructor for use by subclasses
+ *
+ * @param lock the outer lock object
+ * @throws NullPointerException if the lock is null
+ */
+ protected ReadLock(ReentrantReadWriteLock lock) {
+ sync = lock.sync;
+ }
+
+ /**
+ * Acquires the read lock.
+ *
+ * <p>Acquires the read lock if the write lock is not held by
+ * another thread and returns immediately.
+ *
+ * <p>If the write lock is held by another thread then
+ * the current thread becomes disabled for thread scheduling
+ * purposes and lies dormant until the read lock has been acquired.
+ */
+ public void lock() {
+ sync.acquireShared(1);
+ }
+
+ /**
+ * Acquires the read lock unless the current thread is
+ * {@linkplain Thread#interrupt interrupted}.
+ *
+ * <p>Acquires the read lock if the write lock is not held
+ * by another thread and returns immediately.
+ *
+ * <p>If the write lock is held by another thread then the
+ * current thread becomes disabled for thread scheduling
+ * purposes and lies dormant until one of two things happens:
+ *
+ * <ul>
+ *
+ * <li>The read lock is acquired by the current thread; or
+ *
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread.
+ *
+ * </ul>
+ *
+ * <p>If the current thread:
+ *
+ * <ul>
+ *
+ * <li>has its interrupted status set on entry to this method; or
+ *
+ * <li>is {@linkplain Thread#interrupt interrupted} while
+ * acquiring the read lock,
+ *
+ * </ul>
+ *
+ * then {@link InterruptedException} is thrown and the current
+ * thread's interrupted status is cleared.
+ *
+ * <p>In this implementation, as this method is an explicit
+ * interruption point, preference is given to responding to
+ * the interrupt over normal or reentrant acquisition of the
+ * lock.
+ *
+ * @throws InterruptedException if the current thread is interrupted
+ */
+ public void lockInterruptibly() throws InterruptedException {
+ sync.acquireSharedInterruptibly(1);
+ }
+
+ /**
+ * Acquires the read lock only if the write lock is not held by
+ * another thread at the time of invocation.
+ *
+ * <p>Acquires the read lock if the write lock is not held by
+ * another thread and returns immediately with the value
+ * {@code true}. Even when this lock has been set to use a
+ * fair ordering policy, a call to {@code tryLock()}
+ * <em>will</em> immediately acquire the read lock if it is
+ * available, whether or not other threads are currently
+ * waiting for the read lock. This &quot;barging&quot; behavior
+ * can be useful in certain circumstances, even though it
+ * breaks fairness. If you want to honor the fairness setting
+ * for this lock, then use {@link #tryLock(long, TimeUnit)
+ * tryLock(0, TimeUnit.SECONDS) } which is almost equivalent
+ * (it also detects interruption).
+ *
+ * <p>If the write lock is held by another thread then
+ * this method will return immediately with the value
+ * {@code false}.
+ *
+ * @return {@code true} if the read lock was acquired
+ */
+ public boolean tryLock() {
+ return sync.tryReadLock();
+ }
+
+ /**
+ * Acquires the read lock if the write lock is not held by
+ * another thread within the given waiting time and the
+ * current thread has not been {@linkplain Thread#interrupt
+ * interrupted}.
+ *
+ * <p>Acquires the read lock if the write lock is not held by
+ * another thread and returns immediately with the value
+ * {@code true}. If this lock has been set to use a fair
+ * ordering policy then an available lock <em>will not</em> be
+ * acquired if any other threads are waiting for the
+ * lock. This is in contrast to the {@link #tryLock()}
+ * method. If you want a timed {@code tryLock} that does
+ * permit barging on a fair lock then combine the timed and
+ * un-timed forms together:
+ *
+ * <pre>if (lock.tryLock() || lock.tryLock(timeout, unit) ) { ... }
+ * </pre>
+ *
+ * <p>If the write lock is held by another thread then the
+ * current thread becomes disabled for thread scheduling
+ * purposes and lies dormant until one of three things happens:
+ *
+ * <ul>
+ *
+ * <li>The read lock is acquired by the current thread; or
+ *
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread; or
+ *
+ * <li>The specified waiting time elapses.
+ *
+ * </ul>
+ *
+ * <p>If the read lock is acquired then the value {@code true} is
+ * returned.
+ *
+ * <p>If the current thread:
+ *
+ * <ul>
+ *
+ * <li>has its interrupted status set on entry to this method; or
+ *
+ * <li>is {@linkplain Thread#interrupt interrupted} while
+ * acquiring the read lock,
+ *
+ * </ul> then {@link InterruptedException} is thrown and the
+ * current thread's interrupted status is cleared.
+ *
+ * <p>If the specified waiting time elapses then the value
+ * {@code false} is returned. If the time is less than or
+ * equal to zero, the method will not wait at all.
+ *
+ * <p>In this implementation, as this method is an explicit
+ * interruption point, preference is given to responding to
+ * the interrupt over normal or reentrant acquisition of the
+ * lock, and over reporting the elapse of the waiting time.
+ *
+ * @param timeout the time to wait for the read lock
+ * @param unit the time unit of the timeout argument
+ * @return {@code true} if the read lock was acquired
+ * @throws InterruptedException if the current thread is interrupted
+ * @throws NullPointerException if the time unit is null
+ *
+ */
+ public boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException {
+ return sync.tryAcquireSharedNanos(1, unit.toNanos(timeout));
+ }
+
+ /**
+ * Attempts to release this lock.
+ *
+ * <p> If the number of readers is now zero then the lock
+ * is made available for write lock attempts.
+ */
+ public void unlock() {
+ sync.releaseShared(1);
+ }
+
+ /**
+ * Throws {@code UnsupportedOperationException} because
+ * {@code ReadLocks} do not support conditions.
+ *
+ * @throws UnsupportedOperationException always
+ */
+ public Condition newCondition() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Returns a string identifying this lock, as well as its lock state.
+ * The state, in brackets, includes the String {@code "Read locks ="}
+ * followed by the number of held read locks.
+ *
+ * @return a string identifying this lock, as well as its lock state
+ */
+ public String toString() {
+ int r = sync.getReadLockCount();
+ return super.toString() +
+ "[Read locks = " + r + "]";
+ }
+ }
+
+ /**
+ * The lock returned by method {@link ReentrantReadWriteLock#writeLock}.
+ */
+ public static class WriteLock implements Lock, java.io.Serializable {
+ private static final long serialVersionUID = -4992448646407690164L;
+ private final Sync sync;
+
+ /**
+ * Constructor for use by subclasses
+ *
+ * @param lock the outer lock object
+ * @throws NullPointerException if the lock is null
+ */
+ protected WriteLock(ReentrantReadWriteLock lock) {
+ sync = lock.sync;
+ }
+
+ /**
+ * Acquires the write lock.
+ *
+ * <p>Acquires the write lock if neither the read nor write lock
+ * are held by another thread
+ * and returns immediately, setting the write lock hold count to
+ * one.
+ *
+ * <p>If the current thread already holds the write lock then the
+ * hold count is incremented by one and the method returns
+ * immediately.
+ *
+ * <p>If the lock is held by another thread then the current
+ * thread becomes disabled for thread scheduling purposes and
+ * lies dormant until the write lock has been acquired, at which
+ * time the write lock hold count is set to one.
+ */
+ public void lock() {
+ sync.acquire(1);
+ }
+
+ /**
+ * Acquires the write lock unless the current thread is
+ * {@linkplain Thread#interrupt interrupted}.
+ *
+ * <p>Acquires the write lock if neither the read nor write lock
+ * are held by another thread
+ * and returns immediately, setting the write lock hold count to
+ * one.
+ *
+ * <p>If the current thread already holds this lock then the
+ * hold count is incremented by one and the method returns
+ * immediately.
+ *
+ * <p>If the lock is held by another thread then the current
+ * thread becomes disabled for thread scheduling purposes and
+ * lies dormant until one of two things happens:
+ *
+ * <ul>
+ *
+ * <li>The write lock is acquired by the current thread; or
+ *
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread.
+ *
+ * </ul>
+ *
+ * <p>If the write lock is acquired by the current thread then the
+ * lock hold count is set to one.
+ *
+ * <p>If the current thread:
+ *
+ * <ul>
+ *
+ * <li>has its interrupted status set on entry to this method;
+ * or
+ *
+ * <li>is {@linkplain Thread#interrupt interrupted} while
+ * acquiring the write lock,
+ *
+ * </ul>
+ *
+ * then {@link InterruptedException} is thrown and the current
+ * thread's interrupted status is cleared.
+ *
+ * <p>In this implementation, as this method is an explicit
+ * interruption point, preference is given to responding to
+ * the interrupt over normal or reentrant acquisition of the
+ * lock.
+ *
+ * @throws InterruptedException if the current thread is interrupted
+ */
+ public void lockInterruptibly() throws InterruptedException {
+ sync.acquireInterruptibly(1);
+ }
+
+ /**
+ * Acquires the write lock only if it is not held by another thread
+ * at the time of invocation.
+ *
+ * <p>Acquires the write lock if neither the read nor write lock
+ * are held by another thread
+ * and returns immediately with the value {@code true},
+ * setting the write lock hold count to one. Even when this lock has
+ * been set to use a fair ordering policy, a call to
+ * {@code tryLock()} <em>will</em> immediately acquire the
+ * lock if it is available, whether or not other threads are
+ * currently waiting for the write lock. This &quot;barging&quot;
+ * behavior can be useful in certain circumstances, even
+ * though it breaks fairness. If you want to honor the
+ * fairness setting for this lock, then use {@link
+ * #tryLock(long, TimeUnit) tryLock(0, TimeUnit.SECONDS) }
+ * which is almost equivalent (it also detects interruption).
+ *
+ * <p> If the current thread already holds this lock then the
+ * hold count is incremented by one and the method returns
+ * {@code true}.
+ *
+ * <p>If the lock is held by another thread then this method
+ * will return immediately with the value {@code false}.
+ *
+ * @return {@code true} if the lock was free and was acquired
+ * by the current thread, or the write lock was already held
+ * by the current thread; and {@code false} otherwise.
+ */
+ public boolean tryLock( ) {
+ return sync.tryWriteLock();
+ }
+
+ /**
+ * Acquires the write lock if it is not held by another thread
+ * within the given waiting time and the current thread has
+ * not been {@linkplain Thread#interrupt interrupted}.
+ *
+ * <p>Acquires the write lock if neither the read nor write lock
+ * are held by another thread
+ * and returns immediately with the value {@code true},
+ * setting the write lock hold count to one. If this lock has been
+ * set to use a fair ordering policy then an available lock
+ * <em>will not</em> be acquired if any other threads are
+ * waiting for the write lock. This is in contrast to the {@link
+ * #tryLock()} method. If you want a timed {@code tryLock}
+ * that does permit barging on a fair lock then combine the
+ * timed and un-timed forms together:
+ *
+ * <pre>if (lock.tryLock() || lock.tryLock(timeout, unit) ) { ... }
+ * </pre>
+ *
+ * <p>If the current thread already holds this lock then the
+ * hold count is incremented by one and the method returns
+ * {@code true}.
+ *
+ * <p>If the lock is held by another thread then the current
+ * thread becomes disabled for thread scheduling purposes and
+ * lies dormant until one of three things happens:
+ *
+ * <ul>
+ *
+ * <li>The write lock is acquired by the current thread; or
+ *
+ * <li>Some other thread {@linkplain Thread#interrupt interrupts}
+ * the current thread; or
+ *
+ * <li>The specified waiting time elapses
+ *
+ * </ul>
+ *
+ * <p>If the write lock is acquired then the value {@code true} is
+ * returned and the write lock hold count is set to one.
+ *
+ * <p>If the current thread:
+ *
+ * <ul>
+ *
+ * <li>has its interrupted status set on entry to this method;
+ * or
+ *
+ * <li>is {@linkplain Thread#interrupt interrupted} while
+ * acquiring the write lock,
+ *
+ * </ul>
+ *
+ * then {@link InterruptedException} is thrown and the current
+ * thread's interrupted status is cleared.
+ *
+ * <p>If the specified waiting time elapses then the value
+ * {@code false} is returned. If the time is less than or
+ * equal to zero, the method will not wait at all.
+ *
+ * <p>In this implementation, as this method is an explicit
+ * interruption point, preference is given to responding to
+ * the interrupt over normal or reentrant acquisition of the
+ * lock, and over reporting the elapse of the waiting time.
+ *
+ * @param timeout the time to wait for the write lock
+ * @param unit the time unit of the timeout argument
+ *
+ * @return {@code true} if the lock was free and was acquired
+ * by the current thread, or the write lock was already held by the
+ * current thread; and {@code false} if the waiting time
+ * elapsed before the lock could be acquired.
+ *
+ * @throws InterruptedException if the current thread is interrupted
+ * @throws NullPointerException if the time unit is null
+ *
+ */
+ public boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException {
+ return sync.tryAcquireNanos(1, unit.toNanos(timeout));
+ }
+
+ /**
+ * Attempts to release this lock.
+ *
+ * <p>If the current thread is the holder of this lock then
+ * the hold count is decremented. If the hold count is now
+ * zero then the lock is released. If the current thread is
+ * not the holder of this lock then {@link
+ * IllegalMonitorStateException} is thrown.
+ *
+ * @throws IllegalMonitorStateException if the current thread does not
+ * hold this lock.
+ */
+ public void unlock() {
+ sync.release(1);
+ }
+
+ /**
+ * Returns a {@link Condition} instance for use with this
+ * {@link Lock} instance.
+ * <p>The returned {@link Condition} instance supports the same
+ * usages as do the {@link Object} monitor methods ({@link
+ * Object#wait() wait}, {@link Object#notify notify}, and {@link
+ * Object#notifyAll notifyAll}) when used with the built-in
+ * monitor lock.
+ *
+ * <ul>
+ *
+ * <li>If this write lock is not held when any {@link
+ * Condition} method is called then an {@link
+ * IllegalMonitorStateException} is thrown. (Read locks are
+ * held independently of write locks, so are not checked or
+ * affected. However it is essentially always an error to
+ * invoke a condition waiting method when the current thread
+ * has also acquired read locks, since other threads that
+ * could unblock it will not be able to acquire the write
+ * lock.)
+ *
+ * <li>When the condition {@linkplain Condition#await() waiting}
+ * methods are called the write lock is released and, before
+ * they return, the write lock is reacquired and the lock hold
+ * count restored to what it was when the method was called.
+ *
+ * <li>If a thread is {@linkplain Thread#interrupt interrupted} while
+ * waiting then the wait will terminate, an {@link
+ * InterruptedException} will be thrown, and the thread's
+ * interrupted status will be cleared.
+ *
+ * <li> Waiting threads are signalled in FIFO order.
+ *
+ * <li>The ordering of lock reacquisition for threads returning
+ * from waiting methods is the same as for threads initially
+ * acquiring the lock, which is in the default case not specified,
+ * but for <em>fair</em> locks favors those threads that have been
+ * waiting the longest.
+ *
+ * </ul>
+ *
+ * @return the Condition object
+ */
+ public Condition newCondition() {
+ return sync.newCondition();
+ }
+
+ /**
+ * Returns a string identifying this lock, as well as its lock
+ * state. The state, in brackets includes either the String
+ * {@code "Unlocked"} or the String {@code "Locked by"}
+ * followed by the {@linkplain Thread#getName name} of the owning thread.
+ *
+ * @return a string identifying this lock, as well as its lock state
+ */
+ public String toString() {
+ Thread o = sync.getOwner();
+ return super.toString() + ((o == null) ?
+ "[Unlocked]" :
+ "[Locked by thread " + o.getName() + "]");
+ }
+
+ /**
+ * Queries if this write lock is held by the current thread.
+ * Identical in effect to {@link
+ * ReentrantReadWriteLock#isWriteLockedByCurrentThread}.
+ *
+ * @return {@code true} if the current thread holds this lock and
+ * {@code false} otherwise
+ * @since 1.6
+ */
+ public boolean isHeldByCurrentThread() {
+ return sync.isHeldExclusively();
+ }
+
+ /**
+ * Queries the number of holds on this write lock by the current
+ * thread. A thread has a hold on a lock for each lock action
+ * that is not matched by an unlock action. Identical in effect
+ * to {@link ReentrantReadWriteLock#getWriteHoldCount}.
+ *
+ * @return the number of holds on this lock by the current thread,
+ * or zero if this lock is not held by the current thread
+ * @since 1.6
+ */
+ public int getHoldCount() {
+ return sync.getWriteHoldCount();
+ }
+ }
+
+ // Instrumentation and status
+
+ /**
+ * Returns {@code true} if this lock has fairness set true.
+ *
+ * @return {@code true} if this lock has fairness set true
+ */
+ public final boolean isFair() {
+ return sync instanceof FairSync;
+ }
+
+ /**
+ * Returns the thread that currently owns the write lock, or
+ * {@code null} if not owned. When this method is called by a
+ * thread that is not the owner, the return value reflects a
+ * best-effort approximation of current lock status. For example,
+ * the owner may be momentarily {@code null} even if there are
+ * threads trying to acquire the lock but have not yet done so.
+ * This method is designed to facilitate construction of
+ * subclasses that provide more extensive lock monitoring
+ * facilities.
+ *
+ * @return the owner, or {@code null} if not owned
+ */
+ protected Thread getOwner() {
+ return sync.getOwner();
+ }
+
+ /**
+ * Queries the number of read locks held for this lock. This
+ * method is designed for use in monitoring system state, not for
+ * synchronization control.
+ * @return the number of read locks held.
+ */
+ public int getReadLockCount() {
+ return sync.getReadLockCount();
+ }
+
+ /**
+ * Queries if the write lock is held by any thread. This method is
+ * designed for use in monitoring system state, not for
+ * synchronization control.
+ *
+ * @return {@code true} if any thread holds the write lock and
+ * {@code false} otherwise
+ */
+ public boolean isWriteLocked() {
+ return sync.isWriteLocked();
+ }
+
+ /**
+ * Queries if the write lock is held by the current thread.
+ *
+ * @return {@code true} if the current thread holds the write lock and
+ * {@code false} otherwise
+ */
+ public boolean isWriteLockedByCurrentThread() {
+ return sync.isHeldExclusively();
+ }
+
+ /**
+ * Queries the number of reentrant write holds on this lock by the
+ * current thread. A writer thread has a hold on a lock for
+ * each lock action that is not matched by an unlock action.
+ *
+ * @return the number of holds on the write lock by the current thread,
+ * or zero if the write lock is not held by the current thread
+ */
+ public int getWriteHoldCount() {
+ return sync.getWriteHoldCount();
+ }
+
+ /**
+ * Queries the number of reentrant read holds on this lock by the
+ * current thread. A reader thread has a hold on a lock for
+ * each lock action that is not matched by an unlock action.
+ *
+ * @return the number of holds on the read lock by the current thread,
+ * or zero if the read lock is not held by the current thread
+ * @since 1.6
+ */
+ public int getReadHoldCount() {
+ return sync.getReadHoldCount();
+ }
+
+ /**
+ * Returns a collection containing threads that may be waiting to
+ * acquire the write lock. Because the actual set of threads may
+ * change dynamically while constructing this result, the returned
+ * collection is only a best-effort estimate. The elements of the
+ * returned collection are in no particular order. This method is
+ * designed to facilitate construction of subclasses that provide
+ * more extensive lock monitoring facilities.
+ *
+ * @return the collection of threads
+ */
+ protected Collection<Thread> getQueuedWriterThreads() {
+ return sync.getExclusiveQueuedThreads();
+ }
+
+ /**
+ * Returns a collection containing threads that may be waiting to
+ * acquire the read lock. Because the actual set of threads may
+ * change dynamically while constructing this result, the returned
+ * collection is only a best-effort estimate. The elements of the
+ * returned collection are in no particular order. This method is
+ * designed to facilitate construction of subclasses that provide
+ * more extensive lock monitoring facilities.
+ *
+ * @return the collection of threads
+ */
+ protected Collection<Thread> getQueuedReaderThreads() {
+ return sync.getSharedQueuedThreads();
+ }
+
+ /**
+ * Queries whether any threads are waiting to acquire the read or
+ * write lock. Note that because cancellations may occur at any
+ * time, a {@code true} return does not guarantee that any other
+ * thread will ever acquire a lock. This method is designed
+ * primarily for use in monitoring of the system state.
+ *
+ * @return {@code true} if there may be other threads waiting to
+ * acquire the lock
+ */
+ public final boolean hasQueuedThreads() {
+ return sync.hasQueuedThreads();
+ }
+
+ /**
+ * Queries whether the given thread is waiting to acquire either
+ * the read or write lock. Note that because cancellations may
+ * occur at any time, a {@code true} return does not guarantee
+ * that this thread will ever acquire a lock. This method is
+ * designed primarily for use in monitoring of the system state.
+ *
+ * @param thread the thread
+ * @return {@code true} if the given thread is queued waiting for this lock
+ * @throws NullPointerException if the thread is null
+ */
+ public final boolean hasQueuedThread(Thread thread) {
+ return sync.isQueued(thread);
+ }
+
+ /**
+ * Returns an estimate of the number of threads waiting to acquire
+ * either the read or write lock. The value is only an estimate
+ * because the number of threads may change dynamically while this
+ * method traverses internal data structures. This method is
+ * designed for use in monitoring of the system state, not for
+ * synchronization control.
+ *
+ * @return the estimated number of threads waiting for this lock
+ */
+ public final int getQueueLength() {
+ return sync.getQueueLength();
+ }
+
+ /**
+ * Returns a collection containing threads that may be waiting to
+ * acquire either the read or write lock. Because the actual set
+ * of threads may change dynamically while constructing this
+ * result, the returned collection is only a best-effort estimate.
+ * The elements of the returned collection are in no particular
+ * order. This method is designed to facilitate construction of
+ * subclasses that provide more extensive monitoring facilities.
+ *
+ * @return the collection of threads
+ */
+ protected Collection<Thread> getQueuedThreads() {
+ return sync.getQueuedThreads();
+ }
+
+ /**
+ * Queries whether any threads are waiting on the given condition
+ * associated with the write lock. Note that because timeouts and
+ * interrupts may occur at any time, a {@code true} return does
+ * not guarantee that a future {@code signal} will awaken any
+ * threads. This method is designed primarily for use in
+ * monitoring of the system state.
+ *
+ * @param condition the condition
+ * @return {@code true} if there are any waiting threads
+ * @throws IllegalMonitorStateException if this lock is not held
+ * @throws IllegalArgumentException if the given condition is
+ * not associated with this lock
+ * @throws NullPointerException if the condition is null
+ */
+ public boolean hasWaiters(Condition condition) {
+ if (condition == null)
+ throw new NullPointerException();
+ if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject))
+ throw new IllegalArgumentException("not owner");
+ return sync.hasWaiters((AbstractQueuedSynchronizer.ConditionObject)condition);
+ }
+
+ /**
+ * Returns an estimate of the number of threads waiting on the
+ * given condition associated with the write lock. Note that because
+ * timeouts and interrupts may occur at any time, the estimate
+ * serves only as an upper bound on the actual number of waiters.
+ * This method is designed for use in monitoring of the system
+ * state, not for synchronization control.
+ *
+ * @param condition the condition
+ * @return the estimated number of waiting threads
+ * @throws IllegalMonitorStateException if this lock is not held
+ * @throws IllegalArgumentException if the given condition is
+ * not associated with this lock
+ * @throws NullPointerException if the condition is null
+ */
+ public int getWaitQueueLength(Condition condition) {
+ if (condition == null)
+ throw new NullPointerException();
+ if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject))
+ throw new IllegalArgumentException("not owner");
+ return sync.getWaitQueueLength((AbstractQueuedSynchronizer.ConditionObject)condition);
+ }
+
+ /**
+ * Returns a collection containing those threads that may be
+ * waiting on the given condition associated with the write lock.
+ * Because the actual set of threads may change dynamically while
+ * constructing this result, the returned collection is only a
+ * best-effort estimate. The elements of the returned collection
+ * are in no particular order. This method is designed to
+ * facilitate construction of subclasses that provide more
+ * extensive condition monitoring facilities.
+ *
+ * @param condition the condition
+ * @return the collection of threads
+ * @throws IllegalMonitorStateException if this lock is not held
+ * @throws IllegalArgumentException if the given condition is
+ * not associated with this lock
+ * @throws NullPointerException if the condition is null
+ */
+ protected Collection<Thread> getWaitingThreads(Condition condition) {
+ if (condition == null)
+ throw new NullPointerException();
+ if (!(condition instanceof AbstractQueuedSynchronizer.ConditionObject))
+ throw new IllegalArgumentException("not owner");
+ return sync.getWaitingThreads((AbstractQueuedSynchronizer.ConditionObject)condition);
+ }
+
+ /**
+ * Returns a string identifying this lock, as well as its lock state.
+ * The state, in brackets, includes the String {@code "Write locks ="}
+ * followed by the number of reentrantly held write locks, and the
+ * String {@code "Read locks ="} followed by the number of held
+ * read locks.
+ *
+ * @return a string identifying this lock, as well as its lock state
+ */
+ public String toString() {
+ int c = sync.getCount();
+ int w = Sync.exclusiveCount(c);
+ int r = Sync.sharedCount(c);
+
+ return super.toString() +
+ "[Write locks = " + w + ", Read locks = " + r + "]";
+ }
+
+}
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/locks/package.html b/libjava/classpath/external/jsr166/java/util/concurrent/locks/package.html
new file mode 100644
index 00000000000..4b945258b8d
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/locks/package.html
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html> <head>
+<title>Locks</title>
+</head>
+
+<body>
+
+Interfaces and classes providing a framework for locking and waiting
+for conditions that is distinct from built-in synchronization and
+monitors. The framework permits much greater flexibility in the use of
+locks and conditions, at the expense of more awkward syntax.
+
+<p> The {@link java.util.concurrent.locks.Lock} interface supports
+locking disciplines that differ in semantics (reentrant, fair, etc),
+and that can be used in non-block-structured contexts including
+hand-over-hand and lock reordering algorithms. The main implementation
+is {@link java.util.concurrent.locks.ReentrantLock}.
+
+<p> The {@link java.util.concurrent.locks.ReadWriteLock} interface
+similarly defines locks that may be shared among readers but are
+exclusive to writers. Only a single implementation, {@link
+java.util.concurrent.locks.ReentrantReadWriteLock}, is provided, since
+it covers most standard usage contexts. But programmers may create
+their own implementations to cover nonstandard requirements.
+
+<p> The {@link java.util.concurrent.locks.Condition} interface
+describes condition variables that may be associated with Locks.
+These are similar in usage to the implicit monitors accessed using
+<tt>Object.wait</tt>, but offer extended capabilities. In particular,
+multiple <tt>Condition</tt> objects may be associated with a single
+<tt>Lock</tt>. To avoid compatibility issues, the names of
+<tt>Condition</tt> methods are different than the corresponding
+<tt>Object</tt> versions.
+
+<p> The {@link java.util.concurrent.locks.AbstractQueuedSynchronizer}
+class serves as a useful superclass for defining locks and other
+synchronizers that rely on queuing blocked threads. The {@link
+java.util.concurrent.locks.AbstractQueuedLongSynchronizer} class
+provides the same functionality but extends support to 64 bits of
+synchronization state. Both extend class {@link
+java.util.concurrent.locks.AbstractOwnableSynchronizer}, a simple
+class that helps record the thread currently holding exclusive
+synchronization. The {@link java.util.concurrent.locks.LockSupport}
+class provides lower-level blocking and unblocking support that is
+useful for those developers implementing their own customized lock
+classes.
+
+@since 1.5
+
+</body> </html>
diff --git a/libjava/classpath/external/jsr166/java/util/concurrent/package.html b/libjava/classpath/external/jsr166/java/util/concurrent/package.html
new file mode 100644
index 00000000000..20227e1fece
--- /dev/null
+++ b/libjava/classpath/external/jsr166/java/util/concurrent/package.html
@@ -0,0 +1,222 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html> <head>
+<title>Concurrency Utilities</title>
+</head>
+
+<body>
+
+<p> Utility classes commonly useful in concurrent programming. This
+package includes a few small standardized extensible frameworks, as
+well as some classes that provide useful functionality and are
+otherwise tedious or difficult to implement. Here are brief
+descriptions of the main components. See also the <tt>locks</tt> and
+<tt>atomic</tt> packages.
+
+<h2>Executors</h2>
+
+<b>Interfaces.</b> {@link java.util.concurrent.Executor} is a simple
+standardized interface for defining custom thread-like subsystems,
+including thread pools, asynchronous IO, and lightweight task
+frameworks. Depending on which concrete Executor class is being used,
+tasks may execute in a newly created thread, an existing
+task-execution thread, or the thread calling <tt>execute()</tt>, and
+may execute sequentially or concurrently. {@link
+java.util.concurrent.ExecutorService} provides a more complete
+asynchronous task execution framework. An ExecutorService manages
+queuing and scheduling of tasks, and allows controlled shutdown. The
+{@link java.util.concurrent.ScheduledExecutorService} subinterface
+and associated interfaces add support for delayed and periodic task execution.
+ExecutorServices provide methods arranging asynchronous execution of
+any function expressed as {@link java.util.concurrent.Callable}, the
+result-bearing analog of {@link java.lang.Runnable}. A {@link
+java.util.concurrent.Future} returns the results of a function, allows
+determination of whether execution has completed, and provides a means to
+cancel execution. A {@link java.util.concurrent.RunnableFuture} is
+a Future that possesses a <tt>run</tt> method that upon execution,
+sets its results.
+
+<p>
+
+<b>Implementations.</b> Classes {@link
+java.util.concurrent.ThreadPoolExecutor} and {@link
+java.util.concurrent.ScheduledThreadPoolExecutor} provide tunable,
+flexible thread pools. The {@link java.util.concurrent.Executors}
+class provides factory methods for the most common kinds and
+configurations of Executors, as well as a few utility methods for
+using them. Other utilities based on Executors include the concrete
+class {@link java.util.concurrent.FutureTask} providing a common
+extensible implementation of Futures, and {@link
+java.util.concurrent.ExecutorCompletionService}, that assists in
+coordinating the processing of groups of asynchronous tasks.
+
+<h2>Queues</h2>
+
+The java.util.concurrent {@link
+java.util.concurrent.ConcurrentLinkedQueue} class supplies an
+efficient scalable thread-safe non-blocking FIFO queue. Five
+implementations in java.util.concurrent support the extended {@link
+java.util.concurrent.BlockingQueue} interface, that defines blocking
+versions of put and take: {@link
+java.util.concurrent.LinkedBlockingQueue}, {@link
+java.util.concurrent.ArrayBlockingQueue}, {@link
+java.util.concurrent.SynchronousQueue}, {@link
+java.util.concurrent.PriorityBlockingQueue}, and {@link
+java.util.concurrent.DelayQueue}. The different classes cover the most
+common usage contexts for producer-consumer, messaging, parallel
+tasking, and related concurrent designs. The {@link
+java.util.concurrent.BlockingDeque} interface extends
+<tt>BlockingQueue</tt> to support both FIFO and LIFO (stack-based)
+operations. Class {@link java.util.concurrent.LinkedBlockingDeque}
+provides an implementation.
+
+
+<h2>Timing</h2>
+
+The {@link java.util.concurrent.TimeUnit} class provides multiple
+granularities (including nanoseconds) for specifying and controlling
+time-out based operations. Most classes in the package contain
+operations based on time-outs in addition to indefinite waits. In all
+cases that time-outs are used, the time-out specifies the minimum time
+that the method should wait before indicating that it
+timed-out. Implementations make a &quot;best effort&quot; to detect
+time-outs as soon as possible after they occur. However, an indefinite
+amount of time may elapse between a time-out being detected and a
+thread actually executing again after that time-out. All methods
+that accept timeout parameters treat values less than or equal to
+zero to mean not to wait at all. To wait "forever", you can use
+a value of <tt>Long.MAX_VALUE</tt>.
+
+<h2>Synchronizers</h2>
+
+Four classes aid common special-purpose synchronization idioms.
+{@link java.util.concurrent.Semaphore} is a classic concurrency tool.
+{@link java.util.concurrent.CountDownLatch} is a very simple yet very
+common utility for blocking until a given number of signals, events,
+or conditions hold. A {@link java.util.concurrent.CyclicBarrier} is a
+resettable multiway synchronization point useful in some styles of
+parallel programming. An {@link java.util.concurrent.Exchanger} allows
+two threads to exchange objects at a rendezvous point, and is useful
+in several pipeline designs.
+
+<h2>Concurrent Collections</h2>
+
+Besides Queues, this package supplies Collection implementations
+designed for use in multithreaded contexts:
+{@link java.util.concurrent.ConcurrentHashMap},
+{@link java.util.concurrent.ConcurrentSkipListMap},
+{@link java.util.concurrent.ConcurrentSkipListSet},
+{@link java.util.concurrent.CopyOnWriteArrayList}, and
+{@link java.util.concurrent.CopyOnWriteArraySet}.
+When many threads are expected to access a given collection,
+a <tt>ConcurrentHashMap</tt> is normally preferable to
+a synchronized <tt>HashMap</tt>, and a
+<tt>ConcurrentSkipListMap</tt> is normally preferable
+to a synchronized <tt>TreeMap</tt>. A
+<tt>CopyOnWriteArrayList</tt> is preferable to
+a synchronized <tt>ArrayList</tt> when the expected number of reads
+and traversals greatly outnumber the number of updates to a list.
+
+<p>The "Concurrent" prefix used with some classes in this package is a
+shorthand indicating several differences from similar "synchronized"
+classes. For example <tt>java.util.Hashtable</tt> and
+<tt>Collections.synchronizedMap(new HashMap())</tt> are
+synchronized. But {@link java.util.concurrent.ConcurrentHashMap} is
+"concurrent". A concurrent collection is thread-safe, but not
+governed by a single exclusion lock. In the particular case of
+ConcurrentHashMap, it safely permits any number of concurrent reads as
+well as a tunable number of concurrent writes. "Synchronized" classes
+can be useful when you need to prevent all access to a collection via
+a single lock, at the expense of poorer scalability. In other cases in
+which multiple threads are expected to access a common collection,
+"concurrent" versions are normally preferable. And unsynchronized
+collections are preferable when either collections are unshared, or
+are accessible only when holding other locks.
+
+<p> Most concurrent Collection implementations (including most Queues)
+also differ from the usual java.util conventions in that their Iterators
+provide <em>weakly consistent</em> rather than fast-fail traversal. A
+weakly consistent iterator is thread-safe, but does not necessarily
+freeze the collection while iterating, so it may (or may not) reflect
+any updates since the iterator was created.
+
+<a name="MemoryVisibility">
+<h2> Memory Consistency Properties </h2>
+
+<a href="http://java.sun.com/docs/books/jls/third_edition/html/memory.html">
+Chapter 17 of the Java Language Specification</a> defines the
+<i>happens-before</i> relation on memory operations such as reads and
+writes of shared variables. The results of a write by one thread are
+guaranteed to be visible to a read by another thread only if the write
+operation <i>happens-before</i> the read operation. The
+{@code synchronized} and {@code volatile} constructs, as well as the
+{@code Thread.start()} and {@code Thread.join()} methods, can form
+<i>happens-before</i> relationships. In particular:
+
+<ul>
+ <li>Each action in a thread <i>happens-before</i> every action in that
+ thread that comes later in the program's order.
+
+ <li>An unlock ({@code synchronized} block or method exit) of a
+ monitor <i>happens-before</i> every subsequent lock ({@code synchronized}
+ block or method entry) of that same monitor. And because
+ the <i>happens-before</i> relation is transitive, all actions
+ of a thread prior to unlocking <i>happen-before</i> all actions
+ subsequent to any thread locking that monitor.
+
+ <li>A write to a {@code volatile} field <i>happens-before</i> every
+ subsequent read of that same field. Writes and reads of
+ {@code volatile} fields have similar memory consistency effects
+ as entering and exiting monitors, but do <em>not</em> entail
+ mutual exclusion locking.
+
+ <li>A call to {@code start} on a thread <i>happens-before</i> any action in the
+ started thread.
+
+ <li>All actions in a thread <i>happen-before</i> any other thread
+ successfully returns from a {@code join} on that thread.
+
+</ul>
+
+
+The methods of all classes in {@code java.util.concurrent} and its
+subpackages extend these guarantees to higher-level
+synchronization. In particular:
+
+<ul>
+
+ <li>Actions in a thread prior to placing an object into any concurrent
+ collection <i>happen-before</i> actions subsequent to the access or
+ removal of that element from the collection in another thread.
+
+ <li>Actions in a thread prior to the submission of a {@code Runnable}
+ to an {@code Executor} <i>happen-before</i> its execution begins.
+ Similarly for {@code Callables} submitted to an {@code ExecutorService}.
+
+ <li>Actions taken by the asynchronous computation represented by a
+ {@code Future} <i>happen-before</i> actions subsequent to the
+ retrieval of the result via {@code Future.get()} in another thread.
+
+ <li>Actions prior to "releasing" synchronizer methods such as
+ {@code Lock.unlock}, {@code Semaphore.release}, and
+ {@code CountDownLatch.countDown} <i>happen-before</i> actions
+ subsequent to a successful "acquiring" method such as
+ {@code Lock.lock}, {@code Semaphore.acquire},
+ {@code Condition.await}, and {@code CountDownLatch.await} on the
+ same synchronizer object in another thread.
+
+ <li>For each pair of threads that successfully exchange objects via
+ an {@code Exchanger}, actions prior to the {@code exchange()}
+ in each thread <i>happen-before</i> those subsequent to the
+ corresponding {@code exchange()} in another thread.
+
+ <li>Actions prior to calling {@code CyclicBarrier.await}
+ <i>happen-before</i> actions performed by the barrier action, and
+ actions performed by the barrier action <i>happen-before</i> actions
+ subsequent to a successful return from the corresponding {@code await}
+ in other threads.
+
+</ul>
+
+@since 1.5
+
+</body> </html>
diff --git a/libjava/classpath/external/jsr166/readme b/libjava/classpath/external/jsr166/readme
new file mode 100644
index 00000000000..eef3c916996
--- /dev/null
+++ b/libjava/classpath/external/jsr166/readme
@@ -0,0 +1,45 @@
+The software comprising JSR166 was written by Doug Lea with assistance
+from members of JCP JSR-166 Expert roup and released to the public
+domain, as explained at:
+http://creativecommons.org/licenses/publicdomain, excepting portions
+of the class java.util.concurrent.CopyOnWriteArrayList, which were
+adapted from class java.util.ArrayList, written by Sun Microsystems,
+Inc, which are used with kind permission, and subject to the
+following:
+
+Copyright 2002-2004 Sun Microsystems, Inc. All rights reserved. Use is
+subject to the following license terms.
+
+ "Sun hereby grants you a non-exclusive, worldwide, non-transferrable
+ license to use and distribute the Java Software technologies as part
+ of a larger work in source and binary forms, with or without
+ modification, provided that the following conditions are met:
+
+ -Neither the name of or trademarks of Sun may be used to endorse or
+ promote products derived from the Java Software technology without
+ specific prior written permission.
+
+ -Redistributions of source or binary code must be accompanied by the
+ following notice and disclaimers:
+
+ Portions copyright Sun Microsystems, Inc. Used with kind permission.
+
+ This software is provided AS IS, without a warranty of any kind. ALL
+ EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
+ WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PUPOSE OR
+ NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ MICROSYSTEMS, INC. AND ITS LICENSORS SHALL NOT BE LIABLE
+ FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
+ USING, MODIFYING OR DISTRIBUTING THE SOFTWARE OR ITS
+ DERIVATIVES. IN NO EVENT WILL SUN MICROSYSTEMS, INC. OR
+ ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR
+ DATA, OR FOR DIRECT, INDIRECT,CONSQUENTIAL, INCIDENTAL
+ OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF
+ THE THEORY OR LIABILITY, ARISING OUT OF THE USE OF OR
+ INABILITY TO USE SOFTWARE, EVEN IF SUN MICROSYSTEMS, INC.
+ HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+ You acknowledge that Software is not designed, licensed or intended for
+ use in the design, construction, operation or maintenance of any nuclear
+ facility."
diff --git a/libjava/classpath/external/relaxngDatatype/.cvsignore b/libjava/classpath/external/relaxngDatatype/.cvsignore
new file mode 100644
index 00000000000..282522db034
--- /dev/null
+++ b/libjava/classpath/external/relaxngDatatype/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/libjava/classpath/external/relaxngDatatype/Makefile.in b/libjava/classpath/external/relaxngDatatype/Makefile.in
index a70d0b24dff..0d40cf484b3 100644
--- a/libjava/classpath/external/relaxngDatatype/Makefile.in
+++ b/libjava/classpath/external/relaxngDatatype/Makefile.in
@@ -41,12 +41,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -157,6 +159,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -278,7 +282,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
EXTRA_DIST = README.txt \
copying.txt \
diff --git a/libjava/classpath/external/sax/.cvsignore b/libjava/classpath/external/sax/.cvsignore
new file mode 100644
index 00000000000..282522db034
--- /dev/null
+++ b/libjava/classpath/external/sax/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/libjava/classpath/external/sax/Makefile.in b/libjava/classpath/external/sax/Makefile.in
index 47f284c1c0a..0f0077129b1 100644
--- a/libjava/classpath/external/sax/Makefile.in
+++ b/libjava/classpath/external/sax/Makefile.in
@@ -41,12 +41,14 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -157,6 +159,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -278,7 +282,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
EXTRA_DIST = README \
org/xml/sax/ext/Attributes2.java \
diff --git a/libjava/classpath/external/sax/org/xml/sax/AttributeList.java b/libjava/classpath/external/sax/org/xml/sax/AttributeList.java
index 74b74b275e9..7d8e9beec37 100644
--- a/libjava/classpath/external/sax/org/xml/sax/AttributeList.java
+++ b/libjava/classpath/external/sax/org/xml/sax/AttributeList.java
@@ -1,7 +1,7 @@
// SAX Attribute List Interface.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: AttributeList.java,v 1.10 2004/12/11 15:41:09 dog Exp $
+// $Id: AttributeList.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/Attributes.java b/libjava/classpath/external/sax/org/xml/sax/Attributes.java
index 6d3708eef01..51735908936 100644
--- a/libjava/classpath/external/sax/org/xml/sax/Attributes.java
+++ b/libjava/classpath/external/sax/org/xml/sax/Attributes.java
@@ -2,7 +2,7 @@
// http://www.saxproject.org
// Written by David Megginson
// NO WARRANTY! This class is in the public domain.
-// $Id: Attributes.java,v 1.10 2004/12/11 15:41:09 dog Exp $
+// $Id: Attributes.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/ContentHandler.java b/libjava/classpath/external/sax/org/xml/sax/ContentHandler.java
index 21f84ff7ace..c0df614108d 100644
--- a/libjava/classpath/external/sax/org/xml/sax/ContentHandler.java
+++ b/libjava/classpath/external/sax/org/xml/sax/ContentHandler.java
@@ -2,7 +2,7 @@
// http://www.saxproject.org
// Written by David Megginson
// NO WARRANTY! This class is in the public domain.
-// $Id: ContentHandler.java,v 1.10 2004/12/11 15:41:09 dog Exp $
+// $Id: ContentHandler.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/DTDHandler.java b/libjava/classpath/external/sax/org/xml/sax/DTDHandler.java
index ef08d450b7e..f894298cded 100644
--- a/libjava/classpath/external/sax/org/xml/sax/DTDHandler.java
+++ b/libjava/classpath/external/sax/org/xml/sax/DTDHandler.java
@@ -1,7 +1,7 @@
// SAX DTD handler.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: DTDHandler.java,v 1.10 2004/12/11 15:41:09 dog Exp $
+// $Id: DTDHandler.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/DocumentHandler.java b/libjava/classpath/external/sax/org/xml/sax/DocumentHandler.java
index 8b0a07f57ce..08429b6bcf4 100644
--- a/libjava/classpath/external/sax/org/xml/sax/DocumentHandler.java
+++ b/libjava/classpath/external/sax/org/xml/sax/DocumentHandler.java
@@ -1,7 +1,7 @@
// SAX document handler.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: DocumentHandler.java,v 1.10 2004/12/11 15:41:09 dog Exp $
+// $Id: DocumentHandler.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/EntityResolver.java b/libjava/classpath/external/sax/org/xml/sax/EntityResolver.java
index a5c6aa82c3c..e240ba14b48 100644
--- a/libjava/classpath/external/sax/org/xml/sax/EntityResolver.java
+++ b/libjava/classpath/external/sax/org/xml/sax/EntityResolver.java
@@ -1,7 +1,7 @@
// SAX entity resolver.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: EntityResolver.java,v 1.10 2004/12/11 15:41:09 dog Exp $
+// $Id: EntityResolver.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/ErrorHandler.java b/libjava/classpath/external/sax/org/xml/sax/ErrorHandler.java
index 940a824cced..5ebe3926321 100644
--- a/libjava/classpath/external/sax/org/xml/sax/ErrorHandler.java
+++ b/libjava/classpath/external/sax/org/xml/sax/ErrorHandler.java
@@ -1,7 +1,7 @@
// SAX error handler.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: ErrorHandler.java,v 1.10 2004/12/11 15:41:09 dog Exp $
+// $Id: ErrorHandler.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/HandlerBase.java b/libjava/classpath/external/sax/org/xml/sax/HandlerBase.java
index 8988a73023a..7d6ce73616a 100644
--- a/libjava/classpath/external/sax/org/xml/sax/HandlerBase.java
+++ b/libjava/classpath/external/sax/org/xml/sax/HandlerBase.java
@@ -1,7 +1,7 @@
// SAX default handler base class.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: HandlerBase.java,v 1.10 2004/12/11 15:41:10 dog Exp $
+// $Id: HandlerBase.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/InputSource.java b/libjava/classpath/external/sax/org/xml/sax/InputSource.java
index 15b0ff00eda..3737b63712d 100644
--- a/libjava/classpath/external/sax/org/xml/sax/InputSource.java
+++ b/libjava/classpath/external/sax/org/xml/sax/InputSource.java
@@ -1,7 +1,7 @@
// SAX input source.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: InputSource.java,v 1.12 2004/12/11 15:41:10 dog Exp $
+// $Id: InputSource.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/Locator.java b/libjava/classpath/external/sax/org/xml/sax/Locator.java
index 73ad7dac739..63947df7ac7 100644
--- a/libjava/classpath/external/sax/org/xml/sax/Locator.java
+++ b/libjava/classpath/external/sax/org/xml/sax/Locator.java
@@ -1,7 +1,7 @@
// SAX locator interface for document events.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: Locator.java,v 1.10 2004/12/11 15:41:10 dog Exp $
+// $Id: Locator.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/Parser.java b/libjava/classpath/external/sax/org/xml/sax/Parser.java
index 73e4584539f..5866eb09ce1 100644
--- a/libjava/classpath/external/sax/org/xml/sax/Parser.java
+++ b/libjava/classpath/external/sax/org/xml/sax/Parser.java
@@ -1,7 +1,7 @@
// SAX parser interface.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: Parser.java,v 1.10 2004/12/11 15:41:10 dog Exp $
+// $Id: Parser.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/SAXException.java b/libjava/classpath/external/sax/org/xml/sax/SAXException.java
index c6f1c58ffed..b3c23e9aedb 100644
--- a/libjava/classpath/external/sax/org/xml/sax/SAXException.java
+++ b/libjava/classpath/external/sax/org/xml/sax/SAXException.java
@@ -1,7 +1,7 @@
// SAX exception class.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: SAXException.java,v 1.10 2004/12/11 15:41:10 dog Exp $
+// $Id: SAXException.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/SAXNotRecognizedException.java b/libjava/classpath/external/sax/org/xml/sax/SAXNotRecognizedException.java
index e8802ce82cc..dc411b105ce 100644
--- a/libjava/classpath/external/sax/org/xml/sax/SAXNotRecognizedException.java
+++ b/libjava/classpath/external/sax/org/xml/sax/SAXNotRecognizedException.java
@@ -2,7 +2,7 @@
// http://www.saxproject.org
// Written by David Megginson
// NO WARRANTY! This class is in the Public Domain.
-// $Id: SAXNotRecognizedException.java,v 1.11 2004/12/11 15:41:10 dog Exp $
+// $Id: SAXNotRecognizedException.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/SAXNotSupportedException.java b/libjava/classpath/external/sax/org/xml/sax/SAXNotSupportedException.java
index 56a7b44951c..232ce8026de 100644
--- a/libjava/classpath/external/sax/org/xml/sax/SAXNotSupportedException.java
+++ b/libjava/classpath/external/sax/org/xml/sax/SAXNotSupportedException.java
@@ -2,7 +2,7 @@
// http://www.saxproject.org
// Written by David Megginson
// NO WARRANTY! This class is in the Public Domain.
-// $Id: SAXNotSupportedException.java,v 1.11 2004/12/11 15:41:10 dog Exp $
+// $Id: SAXNotSupportedException.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/SAXParseException.java b/libjava/classpath/external/sax/org/xml/sax/SAXParseException.java
index ace289112e0..c49ff095be3 100644
--- a/libjava/classpath/external/sax/org/xml/sax/SAXParseException.java
+++ b/libjava/classpath/external/sax/org/xml/sax/SAXParseException.java
@@ -1,7 +1,7 @@
// SAX exception class.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: SAXParseException.java,v 1.10 2004/12/11 15:41:10 dog Exp $
+// $Id: SAXParseException.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/XMLFilter.java b/libjava/classpath/external/sax/org/xml/sax/XMLFilter.java
index 98aaba10808..363328e2d55 100644
--- a/libjava/classpath/external/sax/org/xml/sax/XMLFilter.java
+++ b/libjava/classpath/external/sax/org/xml/sax/XMLFilter.java
@@ -2,7 +2,7 @@
// http://www.saxproject.org
// Written by David Megginson
// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLFilter.java,v 1.10 2004/12/11 15:41:10 dog Exp $
+// $Id: XMLFilter.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/XMLReader.java b/libjava/classpath/external/sax/org/xml/sax/XMLReader.java
index 3888353e5d4..92d0a94e3d1 100644
--- a/libjava/classpath/external/sax/org/xml/sax/XMLReader.java
+++ b/libjava/classpath/external/sax/org/xml/sax/XMLReader.java
@@ -2,7 +2,7 @@
// http://www.saxproject.org
// Written by David Megginson
// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLReader.java,v 1.11 2004/12/11 15:41:10 dog Exp $
+// $Id: XMLReader.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax;
diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2.java b/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2.java
index 56d7cdbfefe..5c839bd1acf 100644
--- a/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2.java
+++ b/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2.java
@@ -1,7 +1,7 @@
// Attributes2.java - extended Attributes
// http://www.saxproject.org
// Public Domain: no warranty.
-// $Id: Attributes2.java,v 1.8 2004/12/11 15:41:10 dog Exp $
+// $Id: Attributes2.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.ext;
diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2Impl.java b/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2Impl.java
index ebc9c07d9ae..485a5d6ac44 100644
--- a/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2Impl.java
+++ b/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2Impl.java
@@ -1,7 +1,7 @@
// Attributes2Impl.java - extended AttributesImpl
// http://www.saxproject.org
// Public Domain: no warranty.
-// $Id: Attributes2Impl.java,v 1.8 2004/12/11 15:41:10 dog Exp $
+// $Id: Attributes2Impl.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.ext;
diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/DeclHandler.java b/libjava/classpath/external/sax/org/xml/sax/ext/DeclHandler.java
index 2e8486bc8a6..1bb4dea4a41 100644
--- a/libjava/classpath/external/sax/org/xml/sax/ext/DeclHandler.java
+++ b/libjava/classpath/external/sax/org/xml/sax/ext/DeclHandler.java
@@ -1,7 +1,7 @@
// DeclHandler.java - Optional handler for DTD declaration events.
// http://www.saxproject.org
// Public Domain: no warranty.
-// $Id: DeclHandler.java,v 1.10 2004/12/11 15:41:10 dog Exp $
+// $Id: DeclHandler.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.ext;
diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/DefaultHandler2.java b/libjava/classpath/external/sax/org/xml/sax/ext/DefaultHandler2.java
index affe7c01b5f..2b792e9df24 100644
--- a/libjava/classpath/external/sax/org/xml/sax/ext/DefaultHandler2.java
+++ b/libjava/classpath/external/sax/org/xml/sax/ext/DefaultHandler2.java
@@ -1,7 +1,7 @@
// DefaultHandler2.java - extended DefaultHandler
// http://www.saxproject.org
// Public Domain: no warranty.
-// $Id: DefaultHandler2.java,v 1.8 2004/12/11 15:41:10 dog Exp $
+// $Id: DefaultHandler2.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.ext;
diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/EntityResolver2.java b/libjava/classpath/external/sax/org/xml/sax/ext/EntityResolver2.java
index 57b0d83e852..1936f7e0421 100644
--- a/libjava/classpath/external/sax/org/xml/sax/ext/EntityResolver2.java
+++ b/libjava/classpath/external/sax/org/xml/sax/ext/EntityResolver2.java
@@ -1,7 +1,7 @@
// EntityResolver2.java - Extended SAX entity resolver.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: EntityResolver2.java,v 1.1 2004/12/23 22:38:42 mark Exp $
+// $Id: EntityResolver2.java,v 1.2 2006/12/10 20:25:41 gnu_andrew Exp $
package org.xml.sax.ext;
diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/LexicalHandler.java b/libjava/classpath/external/sax/org/xml/sax/ext/LexicalHandler.java
index db020d24c78..076bdf857c2 100644
--- a/libjava/classpath/external/sax/org/xml/sax/ext/LexicalHandler.java
+++ b/libjava/classpath/external/sax/org/xml/sax/ext/LexicalHandler.java
@@ -1,7 +1,7 @@
// LexicalHandler.java - optional handler for lexical parse events.
// http://www.saxproject.org
// Public Domain: no warranty.
-// $Id: LexicalHandler.java,v 1.10 2004/12/11 15:41:10 dog Exp $
+// $Id: LexicalHandler.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.ext;
diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/Locator2.java b/libjava/classpath/external/sax/org/xml/sax/ext/Locator2.java
index 2fd9fc25afa..5fe3ba7706a 100644
--- a/libjava/classpath/external/sax/org/xml/sax/ext/Locator2.java
+++ b/libjava/classpath/external/sax/org/xml/sax/ext/Locator2.java
@@ -1,7 +1,7 @@
// Locator2.java - extended Locator
// http://www.saxproject.org
// Public Domain: no warranty.
-// $Id: Locator2.java,v 1.8 2004/12/11 15:41:10 dog Exp $
+// $Id: Locator2.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.ext;
diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/Locator2Impl.java b/libjava/classpath/external/sax/org/xml/sax/ext/Locator2Impl.java
index 52f6331b5ab..f0b35459dba 100644
--- a/libjava/classpath/external/sax/org/xml/sax/ext/Locator2Impl.java
+++ b/libjava/classpath/external/sax/org/xml/sax/ext/Locator2Impl.java
@@ -1,7 +1,7 @@
// Locator2Impl.java - extended LocatorImpl
// http://www.saxproject.org
// Public Domain: no warranty.
-// $Id: Locator2Impl.java,v 1.1 2004/12/23 22:38:42 mark Exp $
+// $Id: Locator2Impl.java,v 1.2 2006/12/10 20:25:41 gnu_andrew Exp $
package org.xml.sax.ext;
diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/package.html b/libjava/classpath/external/sax/org/xml/sax/ext/package.html
index 12866eb38b7..0b744800108 100644
--- a/libjava/classpath/external/sax/org/xml/sax/ext/package.html
+++ b/libjava/classpath/external/sax/org/xml/sax/ext/package.html
@@ -1,5 +1,5 @@
<HTML><HEAD>
-<!-- $Id: package.html,v 1.11 2004/12/11 15:41:10 dog Exp $ -->
+<!-- $Id: package.html,v 1.1 2004/12/23 22:38:42 mark Exp $ -->
</HEAD><BODY>
<p>
diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/AttributeListImpl.java b/libjava/classpath/external/sax/org/xml/sax/helpers/AttributeListImpl.java
index d691fcc7d00..ca859fb1450 100644
--- a/libjava/classpath/external/sax/org/xml/sax/helpers/AttributeListImpl.java
+++ b/libjava/classpath/external/sax/org/xml/sax/helpers/AttributeListImpl.java
@@ -1,7 +1,7 @@
// SAX default implementation for AttributeList.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: AttributeListImpl.java,v 1.11 2004/12/11 15:41:10 dog Exp $
+// $Id: AttributeListImpl.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.helpers;
diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/AttributesImpl.java b/libjava/classpath/external/sax/org/xml/sax/helpers/AttributesImpl.java
index 02139d9fa7a..8753968ba0a 100644
--- a/libjava/classpath/external/sax/org/xml/sax/helpers/AttributesImpl.java
+++ b/libjava/classpath/external/sax/org/xml/sax/helpers/AttributesImpl.java
@@ -2,7 +2,7 @@
// http://www.saxproject.org
// Written by David Megginson
// NO WARRANTY! This class is in the public domain.
-// $Id: AttributesImpl.java,v 1.11 2004/12/11 15:41:10 dog Exp $
+// $Id: AttributesImpl.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.helpers;
diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/DefaultHandler.java b/libjava/classpath/external/sax/org/xml/sax/helpers/DefaultHandler.java
index 9fc9895bdb0..e01c3be403d 100644
--- a/libjava/classpath/external/sax/org/xml/sax/helpers/DefaultHandler.java
+++ b/libjava/classpath/external/sax/org/xml/sax/helpers/DefaultHandler.java
@@ -2,7 +2,7 @@
// http://www.saxproject.org
// Written by David Megginson
// NO WARRANTY! This class is in the public domain.
-// $Id: DefaultHandler.java,v 1.11 2004/12/11 15:41:10 dog Exp $
+// $Id: DefaultHandler.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.helpers;
diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/LocatorImpl.java b/libjava/classpath/external/sax/org/xml/sax/helpers/LocatorImpl.java
index a37467b5a23..6fa4857277c 100644
--- a/libjava/classpath/external/sax/org/xml/sax/helpers/LocatorImpl.java
+++ b/libjava/classpath/external/sax/org/xml/sax/helpers/LocatorImpl.java
@@ -1,7 +1,7 @@
// SAX default implementation for Locator.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: LocatorImpl.java,v 1.11 2004/12/11 15:41:10 dog Exp $
+// $Id: LocatorImpl.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.helpers;
diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/NamespaceSupport.java b/libjava/classpath/external/sax/org/xml/sax/helpers/NamespaceSupport.java
index b4edc707f2b..01e11faf83e 100644
--- a/libjava/classpath/external/sax/org/xml/sax/helpers/NamespaceSupport.java
+++ b/libjava/classpath/external/sax/org/xml/sax/helpers/NamespaceSupport.java
@@ -2,7 +2,7 @@
// http://www.saxproject.org
// Written by David Megginson
// This class is in the Public Domain. NO WARRANTY!
-// $Id: NamespaceSupport.java,v 1.14 2004/12/11 15:41:10 dog Exp $
+// $Id: NamespaceSupport.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.helpers;
diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/NewInstance.java b/libjava/classpath/external/sax/org/xml/sax/helpers/NewInstance.java
index 10ef1276fdf..70c043eb42f 100644
--- a/libjava/classpath/external/sax/org/xml/sax/helpers/NewInstance.java
+++ b/libjava/classpath/external/sax/org/xml/sax/helpers/NewInstance.java
@@ -3,7 +3,7 @@
// Written by Edwin Goei, edwingo@apache.org
// and by David Brownell, dbrownell@users.sourceforge.net
// NO WARRANTY! This class is in the Public Domain.
-// $Id: NewInstance.java,v 1.9 2004/12/11 15:41:10 dog Exp $
+// $Id: NewInstance.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.helpers;
diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/ParserAdapter.java b/libjava/classpath/external/sax/org/xml/sax/helpers/ParserAdapter.java
index 84e18f06782..748ad1c8499 100644
--- a/libjava/classpath/external/sax/org/xml/sax/helpers/ParserAdapter.java
+++ b/libjava/classpath/external/sax/org/xml/sax/helpers/ParserAdapter.java
@@ -2,7 +2,7 @@
// http://www.saxproject.org
// Written by David Megginson
// NO WARRANTY! This class is in the public domain.
-// $Id: ParserAdapter.java,v 1.12 2004/12/11 15:41:10 dog Exp $
+// $Id: ParserAdapter.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.helpers;
diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/ParserFactory.java b/libjava/classpath/external/sax/org/xml/sax/helpers/ParserFactory.java
index d70b853c9ea..23139981088 100644
--- a/libjava/classpath/external/sax/org/xml/sax/helpers/ParserFactory.java
+++ b/libjava/classpath/external/sax/org/xml/sax/helpers/ParserFactory.java
@@ -1,7 +1,7 @@
// SAX parser factory.
// http://www.saxproject.org
// No warranty; no copyright -- use this as you will.
-// $Id: ParserFactory.java,v 1.11 2004/12/11 15:41:10 dog Exp $
+// $Id: ParserFactory.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.helpers;
diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/XMLFilterImpl.java b/libjava/classpath/external/sax/org/xml/sax/helpers/XMLFilterImpl.java
index bdde150bb48..64ff0a4cf88 100644
--- a/libjava/classpath/external/sax/org/xml/sax/helpers/XMLFilterImpl.java
+++ b/libjava/classpath/external/sax/org/xml/sax/helpers/XMLFilterImpl.java
@@ -2,7 +2,7 @@
// http://www.saxproject.org
// Written by David Megginson
// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLFilterImpl.java,v 1.12 2004/12/11 15:41:10 dog Exp $
+// $Id: XMLFilterImpl.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.helpers;
diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java b/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java
index 566e69b8d7b..d2214747d74 100644
--- a/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java
+++ b/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java
@@ -2,7 +2,7 @@
// http://www.saxproject.org
// Written by David Megginson
// NO WARRANTY! This class is in the public domain.
-// $Id: XMLReaderAdapter.java,v 1.1 2004/12/23 22:38:42 mark Exp $
+// $Id: XMLReaderAdapter.java,v 1.2 2006/12/10 20:25:41 gnu_andrew Exp $
package org.xml.sax.helpers;
diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderFactory.java b/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderFactory.java
index f2f51b52b3d..0516ff24e71 100644
--- a/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderFactory.java
+++ b/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderFactory.java
@@ -3,7 +3,7 @@
// Written by David Megginson
// and by David Brownell
// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLReaderFactory.java,v 1.14 2004/12/11 15:41:10 dog Exp $
+// $Id: XMLReaderFactory.java,v 1.1 2004/12/23 22:38:42 mark Exp $
package org.xml.sax.helpers;
import java.io.BufferedReader;
diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/package.html b/libjava/classpath/external/sax/org/xml/sax/helpers/package.html
index f3c7c9629cb..06d4a30a63c 100644
--- a/libjava/classpath/external/sax/org/xml/sax/helpers/package.html
+++ b/libjava/classpath/external/sax/org/xml/sax/helpers/package.html
@@ -1,5 +1,5 @@
<HTML><HEAD>
-<!-- $Id: package.html,v 1.12 2004/12/11 15:41:10 dog Exp $ -->
+<!-- $Id: package.html,v 1.1 2004/12/23 22:38:42 mark Exp $ -->
</HEAD><BODY>
<p>This package contains "helper" classes, including
diff --git a/libjava/classpath/external/sax/org/xml/sax/package.html b/libjava/classpath/external/sax/org/xml/sax/package.html
index 4596a71f0ff..b71f67fdda7 100644
--- a/libjava/classpath/external/sax/org/xml/sax/package.html
+++ b/libjava/classpath/external/sax/org/xml/sax/package.html
@@ -1,5 +1,5 @@
<html><head>
-<!-- $Id: package.html,v 1.14 2004/12/11 15:41:10 dog Exp $ -->
+<!-- $Id: package.html,v 1.1 2004/12/23 22:38:42 mark Exp $ -->
</head><body>
<p> This package provides the core SAX APIs.
diff --git a/libjava/classpath/external/w3c_dom/.cvsignore b/libjava/classpath/external/w3c_dom/.cvsignore
new file mode 100644
index 00000000000..282522db034
--- /dev/null
+++ b/libjava/classpath/external/w3c_dom/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/libjava/classpath/external/w3c_dom/COPYRIGHT.html b/libjava/classpath/external/w3c_dom/COPYRIGHT.html
new file mode 100644
index 00000000000..c7e0e497a5f
--- /dev/null
+++ b/libjava/classpath/external/w3c_dom/COPYRIGHT.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
+ <title>W3C IPR SOFTWARE NOTICE</title>
+<style type="text/css">
+<!--
+html, body { background: #fff; color: #000; } /* body for Windows IE3 */
+-->
+</style>
+ </head>
+ <body>
+ <h1>
+ W3C IPR SOFTWARE NOTICE
+ </h1>
+ <h3>
+ Copyright &copy; 2002 <a href="http://www.w3.org/">World Wide Web
+ Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
+ Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
+ National de Recherche en Informatique et en Automatique</a>, <a
+ href="http://www.keio.ac.jp/">Keio University</a>). All Rights
+ Reserved.
+ </h3>
+ <p>
+ The DOM bindings are published under the W3C Software Copyright Notice
+ and License. The software license requires "Notice of any changes or
+ modifications to the W3C files, including the date changes were made."
+ Consequently, modified versions of the DOM bindings must document that
+ they do not conform to the W3C standard; in the case of the IDL
+ definitions, the pragma prefix can no longer be 'w3c.org'; in the case of
+ the Java language binding, the package names can no longer be in the
+ 'org.w3c' package.
+ </p>
+ <p>
+ <b>Note:</b> The original version of the W3C Software Copyright Notice
+ and License could be found at <a
+ href='http://www.w3.org/Consortium/Legal/copyright-software-19980720'>http://www.w3.org/Consortium/Legal/copyright-software-19980720</a>
+ </p>
+ <h3>
+ Copyright &copy; 1994-2002 <a href="http://www.w3.org/">World Wide Web
+ Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
+ Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
+ National de Recherche en Informatique et en Automatique</a>, <a
+ href="http://www.keio.ac.jp/">Keio University</a>). All Rights
+ Reserved. http://www.w3.org/Consortium/Legal/
+ </h3>
+ <p>
+ This W3C work (including software, documents, or other related items) is
+ being provided by the copyright holders under the following license. By
+ obtaining, using and/or copying this work, you (the licensee) agree that
+ you have read, understood, and will comply with the following terms and
+ conditions:
+ </p>
+ <p>
+ Permission to use, copy, and modify this software and its documentation,
+ with or without modification,&nbsp; for any purpose and without fee or
+ royalty is hereby granted, provided that you include the following on ALL
+ copies of the software and documentation or portions thereof, including
+ modifications, that you make:
+ </p>
+ <ol>
+ <li>
+ The full text of this NOTICE in a location viewable to users of the
+ redistributed or derivative work.
+ </li>
+ <li>
+ Any pre-existing intellectual property disclaimers, notices, or terms
+ and conditions. If none exist, a short notice of the following form
+ (hypertext is preferred, text is permitted) should be used within the
+ body of any redistributed or derivative code: "Copyright &copy;
+ [$date-of-software] <a href="http://www.w3.org/">World Wide Web
+ Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
+ Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
+ National de Recherche en Informatique et en Automatique</a>, <a
+ href="http://www.keio.ac.jp/">Keio University</a>). All Rights
+ Reserved. http://www.w3.org/Consortium/Legal/"
+ </li>
+ <li>
+ Notice of any changes or modifications to the W3C files, including the
+ date changes were made. (We recommend you provide URIs to the location
+ from which the code is derived.)
+ </li>
+ </ol>
+ <p>
+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
+ HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
+ INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR
+ DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
+ TRADEMARKS OR OTHER RIGHTS.
+ </p>
+ <p>
+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
+ CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
+ DOCUMENTATION.
+ </p>
+ <p>
+ The name and trademarks of copyright holders may NOT be used in
+ advertising or publicity pertaining to the software without specific,
+ written prior permission. Title to copyright in this software and any
+ associated documentation will at all times remain with copyright
+ holders.
+ </p>
+ </body>
+</html>
diff --git a/libjava/classpath/external/w3c_dom/Makefile.in b/libjava/classpath/external/w3c_dom/Makefile.in
index 104bcc31a1f..6bf5ded7628 100644
--- a/libjava/classpath/external/w3c_dom/Makefile.in
+++ b/libjava/classpath/external/w3c_dom/Makefile.in
@@ -41,12 +41,14 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -157,6 +159,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -278,7 +282,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
EXTRA_DIST = README \
org/w3c/dom/Attr.java \
diff --git a/libjava/classpath/gnu/CORBA/CDR/Vio.java b/libjava/classpath/gnu/CORBA/CDR/Vio.java
index fd878cb3555..28f1c5672f6 100644
--- a/libjava/classpath/gnu/CORBA/CDR/Vio.java
+++ b/libjava/classpath/gnu/CORBA/CDR/Vio.java
@@ -155,7 +155,6 @@ public abstract class Vio
* read(InputStream, Class) or read(InputStream, Serializable).
*
* @param input a stream to read from.
- * @param repository_id a repository id of the object being read, may be null.
*
* @return the loaded value.
*
@@ -173,7 +172,7 @@ public abstract class Vio
* is known. Hence it may be faster to use the alternative methods,
* read(InputStream, Class) or read(InputStream, Serializable).
*
- * @param an_input a stream to read from.
+ * @param input a stream to read from.
* @param repository_id a repository id of the object being read, may be null.
*
* @return the loaded value.
@@ -904,7 +903,7 @@ public abstract class Vio
*
* @param output an output stream to write into.
* @param value a value to write.
- * @param id a value repository id (can be either single string or string
+ * @param ids a value repository id (can be either single string or string
* array).
* @param helper a helper, writing object - specifical part. Can be null if
* the value should be written using other methods.
diff --git a/libjava/classpath/gnu/CORBA/CollocatedOrbs.java b/libjava/classpath/gnu/CORBA/CollocatedOrbs.java
new file mode 100644
index 00000000000..fc1e513efec
--- /dev/null
+++ b/libjava/classpath/gnu/CORBA/CollocatedOrbs.java
@@ -0,0 +1,164 @@
+/* CollocatedOrbs.java -- Handles collocations
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.CORBA;
+
+import gnu.CORBA.Poa.gnuServantObject;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+
+import org.omg.CORBA.LocalObject;
+import org.omg.CORBA.portable.Delegate;
+import org.omg.CORBA.portable.ObjectImpl;
+
+/**
+ * This class provides support for the direct method invocations without
+ * involving the network in the case when both ORBs run on the same java
+ * virtual machine. Special attention is only needed when call is made
+ * between two independent ORBs, instantiated via ORB.init. The call to the
+ * object, obtained via IOR reference from the ORB where it was locally
+ * connected is always local anyway.
+ *
+ * For security reasons it may be sensible to keep this class and all support
+ * package private.
+ *
+ * @author Audrius Meskauskas
+ */
+class CollocatedOrbs
+{
+ /**
+ * This field is used in automated Classpath specific testing to disable
+ * the direct calls.
+ */
+ static boolean DIRECT_CALLS_ALLOWED = true;
+
+ /**
+ * Containts the references of the all running GNU Classpath ORBs in the
+ * local virtual machine. GNU Classpath ORBs register themselves here when
+ * created and unregister when either ORB.destroy is called or in the
+ * finalizer.
+ */
+ private static ArrayList orbs = new ArrayList();
+
+ /**
+ * The address of the local host.
+ */
+ static String localHost;
+
+ static
+ {
+ try
+ {
+ localHost = InetAddress.getLocalHost().getHostAddress();
+ }
+ catch (UnknownHostException ex)
+ {
+ throw new InternalError("Local host is not accessible:" + ex);
+ }
+ }
+
+ /**
+ * Register the new ORB
+ *
+ * @param orb the orb to register
+ */
+ static void registerOrb(OrbFunctional orb)
+ {
+ if (DIRECT_CALLS_ALLOWED)
+ synchronized (orbs)
+ {
+ assert ! orbs.contains(orb);
+ orbs.add(orb);
+ }
+ }
+
+ /**
+ * Unregister the ORB. The ORB will no longer be reacheable locally but may
+ * be reacheable via network as if it would be remote.
+ *
+ * @param orb the orb to unregister
+ */
+ static void unregisterOrb(OrbFunctional orb)
+ {
+ if (DIRECT_CALLS_ALLOWED)
+ synchronized (orbs)
+ {
+ assert orbs.contains(orb);
+ orbs.remove(orb);
+ }
+ }
+
+ /**
+ * Search the possibly local object. If the IOR is not local or none of the
+ * found ORBs of this virtual machine knows about it, null is returned.
+ *
+ * @param ior the IOR to search
+ * @return the found local CORBA object or null in not found.
+ */
+ static org.omg.CORBA.Object searchLocalObject(IOR ior)
+ {
+ if (! DIRECT_CALLS_ALLOWED && ! ior.Internet.host.equals(localHost))
+ return null;
+
+ synchronized (orbs)
+ {
+ OrbFunctional orb;
+ org.omg.CORBA.Object object;
+ for (int i = 0; i < orbs.size(); i++)
+ {
+ orb = (OrbFunctional) orbs.get(i);
+ object = orb.find_connected_object(ior.key, ior.Internet.port);
+ if (object != null)
+ {
+ if (object instanceof SafeForDirectCalls)
+ {
+ return object;
+ }
+ else if (object instanceof gnuServantObject)
+ {
+ return object;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/libjava/classpath/gnu/CORBA/Connected_objects.java b/libjava/classpath/gnu/CORBA/Connected_objects.java
index ce5761007c0..53ef2dd17d9 100644
--- a/libjava/classpath/gnu/CORBA/Connected_objects.java
+++ b/libjava/classpath/gnu/CORBA/Connected_objects.java
@@ -242,4 +242,14 @@ public class Connected_objects
free_object_number++;
return instance_number;
}
+
+ /**
+ * Get the number of the connected objects.
+ *
+ * @return the size of the internal map.
+ */
+ public int size()
+ {
+ return objects.size();
+ }
} \ No newline at end of file
diff --git a/libjava/classpath/gnu/CORBA/NamingService/Binding_iterator_impl.java b/libjava/classpath/gnu/CORBA/NamingService/Binding_iterator_impl.java
index 79d787083ca..108ca270d21 100644
--- a/libjava/classpath/gnu/CORBA/NamingService/Binding_iterator_impl.java
+++ b/libjava/classpath/gnu/CORBA/NamingService/Binding_iterator_impl.java
@@ -1,5 +1,5 @@
/* Binding_iterator.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.CORBA.NamingService;
+import gnu.CORBA.SafeForDirectCalls;
+
import org.omg.CosNaming.Binding;
import org.omg.CosNaming.BindingHolder;
import org.omg.CosNaming.BindingListHolder;
@@ -51,7 +53,7 @@ import org.omg.CosNaming._BindingIteratorImplBase;
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
*/
public class Binding_iterator_impl
- extends _BindingIteratorImplBase
+ extends _BindingIteratorImplBase implements SafeForDirectCalls
{
/**
* The value, returned by the {@link #next_one} when there
diff --git a/libjava/classpath/gnu/CORBA/NamingService/Ext.java b/libjava/classpath/gnu/CORBA/NamingService/Ext.java
index ee27e68cd79..d339cb194e6 100644
--- a/libjava/classpath/gnu/CORBA/NamingService/Ext.java
+++ b/libjava/classpath/gnu/CORBA/NamingService/Ext.java
@@ -1,5 +1,5 @@
/* TransientContextExt.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.CORBA.NamingService;
+import gnu.CORBA.SafeForDirectCalls;
+
import org.omg.CORBA.NO_IMPLEMENT;
import org.omg.CORBA.Object;
import org.omg.CORBA.portable.Delegate;
@@ -61,7 +63,7 @@ import org.omg.CosNaming._NamingContextExtImplBase;
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
*/
public class Ext
- extends _NamingContextExtImplBase
+ extends _NamingContextExtImplBase implements SafeForDirectCalls
{
/**
* The older version of the naming context, where all relevant calls
diff --git a/libjava/classpath/gnu/CORBA/NamingService/NameParser.java b/libjava/classpath/gnu/CORBA/NamingService/NameParser.java
index c750b2eb4c0..aa922b96a54 100644
--- a/libjava/classpath/gnu/CORBA/NamingService/NameParser.java
+++ b/libjava/classpath/gnu/CORBA/NamingService/NameParser.java
@@ -193,9 +193,6 @@ public class NameParser
boolean corbaname;
- // The alternative addresses, if given.
- ArrayList alt_addr = new ArrayList();
-
// The version numbers with default values.
int major = 1;
int minor = 0;
diff --git a/libjava/classpath/gnu/CORBA/NamingService/NameTransformer.java b/libjava/classpath/gnu/CORBA/NamingService/NameTransformer.java
index 0e0782a5756..d717b9d4011 100644
--- a/libjava/classpath/gnu/CORBA/NamingService/NameTransformer.java
+++ b/libjava/classpath/gnu/CORBA/NamingService/NameTransformer.java
@@ -1,5 +1,5 @@
/* NameTransformer.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -75,10 +75,6 @@ public class NameTransformer
ArrayList components = new ArrayList();
StringTokenizer st = new StringTokenizer(a_name, "./\\", true);
- String id;
- String kind;
- String next;
-
// Create the buffer array, reserving the last element for null.
String[] n = new String[ st.countTokens() + 1 ];
diff --git a/libjava/classpath/gnu/CORBA/NamingService/NamingServiceTransient.java b/libjava/classpath/gnu/CORBA/NamingService/NamingServiceTransient.java
index 3669879f22a..a8cd0b313b3 100644
--- a/libjava/classpath/gnu/CORBA/NamingService/NamingServiceTransient.java
+++ b/libjava/classpath/gnu/CORBA/NamingService/NamingServiceTransient.java
@@ -85,35 +85,26 @@ public class NamingServiceTransient
}
/**
- * Start the naming service on the current host at the given port. The
- * parameter -org.omg.CORBA.ORBInitialPort NNN or -ORBInitialPort NNN, if
- * present, specifies the port, on that the service must be started. If this
- * key is not specified, the service starts at the port 900.
+ * Start the naming service on the current host at the given port.
*
- * The parameter -ior FILE_NAME, if present, forces to store the ior string of
- * this naming service to the specified file.
- *
- * @param args the parameter string.
+ * @param portArgument the port on which the service will be
+ * started, or -1 to use the default port, 900
+ * @param fileArgument if non-null, store the IOR string of this
+ * naming service in a file by this name
*/
- public static void main(String[] args)
+ public static void start(int portArgument, String fileArgument)
{
int port = PORT;
- String iorf = null;
+
+ if (portArgument > -1)
+ port = portArgument;
+
+ String iorf = fileArgument;
try
{
// Create and initialize the ORB
final OrbFunctional orb = new OrbFunctional();
- if (args.length > 1)
- for (int i = 0; i < args.length - 1; i++)
- {
- if (args[i].endsWith("ORBInitialPort"))
- port = Integer.parseInt(args[i + 1]);
-
- if (args[i].equals("-ior"))
- iorf = args[i + 1];
- }
-
OrbFunctional.setPort(port);
// Create the servant and register it with the ORB
@@ -133,15 +124,6 @@ public class NamingServiceTransient
p.close();
}
- System.out.println("GNU Classpath transient naming service "
- + "started at " + iorr.Internet.host + ":" + iorr.Internet.port
- + " key 'NameService'.\n\n"
- + "Copyright (C) 2006 Free Software Foundation\n"
- + "This tool comes with ABSOLUTELY NO WARRANTY. "
- + "This is free software, and you are\nwelcome to "
- + "redistribute it under conditions, defined in "
- + "GNU Classpath license.\n\n" + ior);
-
new Thread()
{
public void run()
@@ -154,7 +136,7 @@ public class NamingServiceTransient
catch (Exception e)
{
System.err.println("ERROR: " + e);
- e.printStackTrace(System.out);
+ e.printStackTrace(System.err);
}
// Restore the default value for allocating ports for the subsequent
diff --git a/libjava/classpath/gnu/CORBA/NamingService/TransientContext.java b/libjava/classpath/gnu/CORBA/NamingService/TransientContext.java
index c2d8275e001..cec87931e28 100644
--- a/libjava/classpath/gnu/CORBA/NamingService/TransientContext.java
+++ b/libjava/classpath/gnu/CORBA/NamingService/TransientContext.java
@@ -54,6 +54,8 @@ import org.omg.CosNaming.NamingContextPackage.NotFound;
import org.omg.CosNaming.NamingContextPackage.NotFoundReason;
import org.omg.CosNaming._NamingContextImplBase;
+import gnu.CORBA.SafeForDirectCalls;
+
import java.util.Iterator;
import java.util.Map;
@@ -69,7 +71,7 @@ import java.util.Map;
*/
public class TransientContext
extends _NamingContextImplBase
- implements NamingContext, NamingContextOperations
+ implements NamingContext, NamingContextOperations, SafeForDirectCalls
{
/**
* Use serial version UID for interoperability.
diff --git a/libjava/classpath/gnu/CORBA/OrbFunctional.java b/libjava/classpath/gnu/CORBA/OrbFunctional.java
index 7b9c34ada12..bfb5e3d86c1 100644
--- a/libjava/classpath/gnu/CORBA/OrbFunctional.java
+++ b/libjava/classpath/gnu/CORBA/OrbFunctional.java
@@ -938,48 +938,55 @@ public class OrbFunctional extends OrbRestricted
/**
* Start the ORBs main working cycle (receive invocation - invoke on the local
- * object - send response - wait for another invocation).
- *
- * The method only returns after calling {@link #shutdown(boolean)}.
+ * object - send response - wait for another invocation). The method only
+ * returns after calling {@link #shutdown(boolean)}.
*/
public void run()
{
- running = true;
-
- // Instantiate the port server for each socket.
- Iterator iter = connected_objects.entrySet().iterator();
- Map.Entry m;
- Connected_objects.cObject obj;
-
- while (iter.hasNext())
+ CollocatedOrbs.registerOrb(this);
+ try
{
- m = (Map.Entry) iter.next();
- obj = (Connected_objects.cObject) m.getValue();
+ running = true;
- portServer subserver;
+ // Instantiate the port server for each socket.
+ Iterator iter = connected_objects.entrySet().iterator();
+ Map.Entry m;
+ Connected_objects.cObject obj;
- if (obj.identity == null)
- {
- subserver = new portServer(obj.port);
- portServers.add(subserver);
- }
- else
- subserver = (portServer) identities.get(obj.identity);
-
- if (!subserver.isAlive())
+ while (iter.hasNext())
{
- // Reuse the current thread for the last portServer.
- if (!iter.hasNext())
+ m = (Map.Entry) iter.next();
+ obj = (Connected_objects.cObject) m.getValue();
+
+ portServer subserver;
+
+ if (obj.identity == null)
{
- // Discard the iterator, eliminating lock checks.
- iter = null;
- subserver.run();
- return;
+ subserver = new portServer(obj.port);
+ portServers.add(subserver);
}
else
- subserver.start();
+ subserver = (portServer) identities.get(obj.identity);
+
+ if (! subserver.isAlive())
+ {
+ // Reuse the current thread for the last portServer.
+ if (! iter.hasNext())
+ {
+ // Discard the iterator, eliminating lock checks.
+ iter = null;
+ subserver.run();
+ return;
+ }
+ else
+ subserver.start();
+ }
}
}
+ finally
+ {
+ CollocatedOrbs.unregisterOrb(this);
+ }
}
/**
@@ -1051,22 +1058,26 @@ public class OrbFunctional extends OrbRestricted
org.omg.CORBA.Object object = find_local_object(ior);
if (object == null)
{
- ObjectImpl impl = StubLocator.search(this, ior);
- try
- {
- if (impl._get_delegate() == null)
- impl._set_delegate(new IorDelegate(this, ior));
- }
- catch (BAD_OPERATION ex)
+ // Check maybe the local object on another ORB, but same VM.
+ object = CollocatedOrbs.searchLocalObject(ior);
+ if (object == null)
{
- // Some colaborants may throw this exception
- // in response to the attempt to get the unset delegate.
- impl._set_delegate(new IorDelegate(this, ior));
- }
+ // Surely remote object.
+ ObjectImpl impl = StubLocator.search(this, ior);
+ try
+ {
+ if (impl._get_delegate() == null)
+ impl._set_delegate(new IorDelegate(this, ior));
+ }
+ catch (BAD_OPERATION ex)
+ {
+ // Some colaborants may throw this exception
+ // in response to the attempt to get the unset delegate.
+ impl._set_delegate(new IorDelegate(this, ior));
+ }
- object = impl;
- // TODO remove commented out code below.
- // connected_objects.add(ior.key, impl, ior.Internet.port, null);
+ object = impl;
+ }
}
return object;
}
@@ -1239,15 +1250,10 @@ public class OrbFunctional extends OrbRestricted
}
if (ior.Id == null)
ior.Id = ref.object.getClass().getName();
- try
- {
- ior.Internet.host = InetAddress.getLocalHost().getHostAddress();
- ior.Internet.port = ref.port;
- }
- catch (UnknownHostException ex)
- {
- throw new BAD_OPERATION("Cannot resolve the local host address");
- }
+
+ ior.Internet.host = CollocatedOrbs.localHost;
+ ior.Internet.port = ref.port;
+
return ior;
}
@@ -1775,4 +1781,14 @@ public class OrbFunctional extends OrbRestricted
running = false;
super.finalize();
}
+
+ /**
+ * Get the number of objects that are connected to this ORB.
+ *
+ * @return the number of objects, connected to this ORB.
+ */
+ public int countConnectedObjects()
+ {
+ return connected_objects.size();
+ }
} \ No newline at end of file
diff --git a/libjava/classpath/gnu/CORBA/Poa/LocalRequest.java b/libjava/classpath/gnu/CORBA/Poa/LocalRequest.java
index a2c0bb106c3..4a9ef8d9044 100644
--- a/libjava/classpath/gnu/CORBA/Poa/LocalRequest.java
+++ b/libjava/classpath/gnu/CORBA/Poa/LocalRequest.java
@@ -193,11 +193,14 @@ public class LocalRequest extends gnuRequest implements ResponseHandler,
/**
* Make an invocation and return a stream from where the results can be read.
*
- * @param the invoke handler (can be null, then it is obtained self
+ * @param handler the invoke handler (can be null, then it is obtained self
* dependently).
*/
public org.omg.CORBA.portable.InputStream v_invoke(InvokeHandler handler)
{
+ // Check maybe POA is in the discarding mode (will throw TRANSIENT if it is).
+ poa.checkDiscarding();
+
// Local request must be intercepted both by server and request
// interceptors.
boolean s_intercept = false;
@@ -246,7 +249,7 @@ public class LocalRequest extends gnuRequest implements ResponseHandler,
s_interceptor.receive_request_service_contexts(s_info);
}
-
+
if (handler == null)
{
handler = object.getHandler(operation(), cookie, false);
diff --git a/libjava/classpath/gnu/CORBA/Poa/ORB_1_4.java b/libjava/classpath/gnu/CORBA/Poa/ORB_1_4.java
index bb00aab70eb..4fc51ff154b 100644
--- a/libjava/classpath/gnu/CORBA/Poa/ORB_1_4.java
+++ b/libjava/classpath/gnu/CORBA/Poa/ORB_1_4.java
@@ -290,4 +290,4 @@ public class ORB_1_4
}
}
-} \ No newline at end of file
+}
diff --git a/libjava/classpath/gnu/CORBA/Poa/gnuPOA.java b/libjava/classpath/gnu/CORBA/Poa/gnuPOA.java
index 460a0a6029a..8ceec23d781 100644
--- a/libjava/classpath/gnu/CORBA/Poa/gnuPOA.java
+++ b/libjava/classpath/gnu/CORBA/Poa/gnuPOA.java
@@ -1582,7 +1582,7 @@ public class gnuPOA
*
* @throws TRANSIENT if the POA is in discarding mode.
*/
- private void checkDiscarding()
+ void checkDiscarding()
throws TRANSIENT
{
if (m_manager.get_state() == State.DISCARDING)
@@ -1813,4 +1813,4 @@ public class gnuPOA
{
return ref_template_ids;
}
-} \ No newline at end of file
+}
diff --git a/libjava/classpath/gnu/CORBA/Poa/gnuServantObject.java b/libjava/classpath/gnu/CORBA/Poa/gnuServantObject.java
index 020897a45b4..77b0ff46792 100644
--- a/libjava/classpath/gnu/CORBA/Poa/gnuServantObject.java
+++ b/libjava/classpath/gnu/CORBA/Poa/gnuServantObject.java
@@ -129,6 +129,12 @@ public class gnuServantObject extends ObjectImpl
* ids are requested from the servant.
*/
public final String[] repository_ids;
+
+ /**
+ * True indicates that the NO_RETAIN policy applies for the servant.
+ * The servant must be discarded after the each call.
+ */
+ boolean noRetain;
/**
* Create an object with no connected servant. The servant must be set later.
@@ -147,6 +153,8 @@ public class gnuServantObject extends ObjectImpl
manager = a_poa.the_POAManager();
poa = a_poa;
orb = an_orb;
+
+ noRetain = poa.applies(ServantRetentionPolicyValue.NON_RETAIN);
}
/**
@@ -182,6 +190,8 @@ public class gnuServantObject extends ObjectImpl
}
repository_ids = null;
orb = an_orb;
+
+ noRetain = poa != null && poa.applies(ServantRetentionPolicyValue.NON_RETAIN);
}
/**
@@ -222,7 +232,7 @@ public class gnuServantObject extends ObjectImpl
boolean forwarding_allowed
) throws gnuForwardRequest
{
- if (servant != null)
+ if (servant != null && !noRetain)
{
return servantToHandler(servant);
}
@@ -641,13 +651,14 @@ public class gnuServantObject extends ObjectImpl
poa.servant_locator.postinvoke(Id, poa, method,
cookie.value, servant
);
- servant = null;
}
}
}
finally
{
orb.currents.remove(Thread.currentThread());
+ if (noRetain)
+ servant = null;
}
}
catch (ForwardRequest fex)
diff --git a/libjava/classpath/gnu/CORBA/SafeForDirectCalls.java b/libjava/classpath/gnu/CORBA/SafeForDirectCalls.java
new file mode 100644
index 00000000000..f3efb6677f0
--- /dev/null
+++ b/libjava/classpath/gnu/CORBA/SafeForDirectCalls.java
@@ -0,0 +1,50 @@
+/* SafeForDirectCalls.java -- FIXME: briefly describe file purpose
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.CORBA;
+
+/**
+ * This interface marks that the object does not modify the passed read only
+ * parameters and hence, if it is local, it is safe to call the methods
+ * directly, without cloning such parameters. Otherwise such parameters should
+ * be cloned.
+ */
+public interface SafeForDirectCalls
+{
+
+}
diff --git a/libjava/classpath/gnu/CORBA/SimpleDelegate.java b/libjava/classpath/gnu/CORBA/SimpleDelegate.java
index c6e20e17374..cb0a7d6034d 100644
--- a/libjava/classpath/gnu/CORBA/SimpleDelegate.java
+++ b/libjava/classpath/gnu/CORBA/SimpleDelegate.java
@@ -98,22 +98,31 @@ public class SimpleDelegate
}
/**
- * Not implemented.
- *
- * @throws NO_IMPLEMENT, always.
+ * Create the request for the local call
*/
public Request create_request(org.omg.CORBA.Object target, Context context,
String operation, NVList parameters,
NamedValue returns
)
{
- throw new NO_IMPLEMENT();
+ if (orb instanceof OrbFunctional)
+ {
+ ((OrbFunctional) orb).ensureRunning();
+ }
+ gnuRequest g = new gnuRequest();
+ g.setORB(orb);
+ g.setOperation(operation);
+ g.setIor(ior);
+ g.m_target = target;
+ g.ctx(context);
+ g.set_args(parameters);
+ if (returns != null)
+ g.set_result(returns);
+ return g;
}
/**
- * Not implemented.
- *
- * @throws NO_IMPLEMENT, always.
+ * Create the request for the local call.
*/
public Request create_request(org.omg.CORBA.Object target, Context context,
String operation, NVList parameters,
@@ -121,7 +130,22 @@ public class SimpleDelegate
ContextList ctx_list
)
{
- throw new NO_IMPLEMENT();
+ if (orb instanceof OrbFunctional)
+ {
+ ((OrbFunctional) orb).ensureRunning();
+ }
+ gnuRequest g = new gnuRequest();
+ g.setORB(orb);
+ g.setOperation(operation);
+ g.setIor(ior);
+ g.m_target = target;
+ g.ctx(context);
+ g.set_args(parameters);
+ g.set_exceptions(exceptions);
+ g.set_context_list(ctx_list);
+ if (returns != null)
+ g.set_result(returns);
+ return g;
}
/**
diff --git a/libjava/classpath/gnu/classpath/.cvsignore b/libjava/classpath/gnu/classpath/.cvsignore
new file mode 100644
index 00000000000..11f6639ebbd
--- /dev/null
+++ b/libjava/classpath/gnu/classpath/.cvsignore
@@ -0,0 +1 @@
+Configuration.java
diff --git a/libjava/classpath/gnu/classpath/ListenerData.java b/libjava/classpath/gnu/classpath/ListenerData.java
new file mode 100644
index 00000000000..284fa02f192
--- /dev/null
+++ b/libjava/classpath/gnu/classpath/ListenerData.java
@@ -0,0 +1,136 @@
+/* ListenerData.java - Class to contain data about management bean listeners
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath;
+
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+
+/**
+ * Container for data on management listeners. Wraps
+ * a {@link javax.management.NotificationListener},
+ * {@link javax.management.NotificationFilter} and
+ * passback object in one class.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class ListenerData
+{
+ /**
+ * The listener itself.
+ */
+ private NotificationListener listener;
+
+ /**
+ * A filter to apply to incoming events.
+ */
+ private NotificationFilter filter;
+
+ /**
+ * An object to pass back to the listener on an
+ * event occurring.
+ */
+ private Object passback;
+
+ /**
+ * Constructs a new {@link ListenerData} with the specified
+ * listener, filter and passback object.
+ *
+ * @param listener the listener itself.
+ * @param filter the filter for incoming events.
+ * @param passback the object to passback on an incoming event.
+ */
+ public ListenerData(NotificationListener listener,
+ NotificationFilter filter, Object passback)
+ {
+ this.listener = listener;
+ this.filter = filter;
+ this.passback = passback;
+ }
+
+ /**
+ * Returns the listener.
+ *
+ * @return the listener.
+ */
+ public NotificationListener getListener()
+ {
+ return listener;
+ }
+
+ /**
+ * Returns the filter.
+ *
+ * @return the filter.
+ */
+ public NotificationFilter getFilter()
+ {
+ return filter;
+ }
+
+ /**
+ * Returns the passback object.
+ *
+ * @return the passback object.
+ */
+ public Object getPassback()
+ {
+ return passback;
+ }
+
+ /**
+ * Returns true if the supplied object is an instance of
+ * {@link ListenerData} and has the same listener, filter
+ * and passback object.
+ *
+ * @param obj the object to check.
+ * @return true if <code>obj</code> is equal to this.
+ */
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof ListenerData)
+ {
+ ListenerData data = (ListenerData) obj;
+ return (data.getListener() == listener &&
+ data.getFilter() == filter &&
+ data.getPassback() == passback);
+ }
+ return false;
+ }
+
+}
diff --git a/libjava/classpath/gnu/classpath/SystemProperties.java b/libjava/classpath/gnu/classpath/SystemProperties.java
index 991279eabb6..d091f1ed0c0 100644
--- a/libjava/classpath/gnu/classpath/SystemProperties.java
+++ b/libjava/classpath/gnu/classpath/SystemProperties.java
@@ -169,4 +169,5 @@ public class SystemProperties
{
return (String) properties.remove(name);
}
+
}
diff --git a/libjava/classpath/gnu/classpath/debug/Component.java b/libjava/classpath/gnu/classpath/debug/Component.java
index 0cc38d7096a..dce257502a7 100644
--- a/libjava/classpath/gnu/classpath/debug/Component.java
+++ b/libjava/classpath/gnu/classpath/debug/Component.java
@@ -97,8 +97,13 @@ public final class Component extends Level
* Trace details about the SSL key exchange.
*/
public static final Component SSL_KEY_EXCHANGE = new Component ("SSL KEY EXCHANGE", 2);
+
+ /**
+ * Trace running of delegated tasks.
+ */
+ public static final Component SSL_DELEGATED_TASK = new Component ("SSL DELEGATED TASK", 3);
- /* Indices 3 and 4 reserved for future use by SSL components. */
+ /* Index 4 reserved for future use by SSL components. */
/**
* Trace the operation of cryptographic primitives.
diff --git a/libjava/classpath/gnu/classpath/debug/SystemLogger.java b/libjava/classpath/gnu/classpath/debug/SystemLogger.java
index 502b488702b..8919e80c785 100644
--- a/libjava/classpath/gnu/classpath/debug/SystemLogger.java
+++ b/libjava/classpath/gnu/classpath/debug/SystemLogger.java
@@ -42,11 +42,12 @@ import gnu.java.security.action.GetPropertyAction;
import java.security.AccessController;
import java.util.StringTokenizer;
+import java.util.logging.Level;
import java.util.logging.Logger;
-public final class SystemLogger
+public final class SystemLogger extends Logger
{
- public static final Logger SYSTEM = Logger.getLogger ("gnu.classpath");
+ public static final SystemLogger SYSTEM = new SystemLogger();
static
{
@@ -62,12 +63,40 @@ public final class SystemLogger
Component c = Component.forName (tok.nextToken ());
if (c != null)
PreciseFilter.GLOBAL.enable (c);
- SYSTEM.log (java.util.logging.Level.INFO, "enabled: {0}", c);
+ SYSTEM.log (Level.INFO, "enabled: {0}", c);
}
}
+ }
- java.util.logging.Handler[] h = SYSTEM.getHandlers ();
- for (int i = 0; i < h.length; i++)
- System.out.println (h[i]);
+ /**
+ * Fetch the system logger instance. The logger returned is meant for debug
+ * and diagnostic logging for Classpath internals.
+ *
+ * @return The system logger.
+ */
+ public static SystemLogger getSystemLogger()
+ {
+ // XXX Check some permission here?
+ return SYSTEM;
+ }
+
+ /**
+ * Keep only one instance of the system logger.
+ */
+ private SystemLogger()
+ {
+ super("gnu.classpath", null);
+ }
+
+ /**
+ * Variable-arguments log method.
+ *
+ * @param level The level to log to.
+ * @param format The format string.
+ * @param args The arguments.
+ */
+ public void logv(Level level, String format, Object... args)
+ {
+ log(level, format, args);
}
}
diff --git a/libjava/classpath/gnu/java/awt/ComponentReshapeEvent.java b/libjava/classpath/gnu/java/awt/ComponentReshapeEvent.java
new file mode 100644
index 00000000000..8f15c851933
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/ComponentReshapeEvent.java
@@ -0,0 +1,85 @@
+/* WindowResizeEvent.java -- Used to synchronize the AWT and peer sizes
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt;
+
+import java.awt.AWTEvent;
+import java.awt.Component;
+
+/**
+ * This is used to update the AWT's knowledge about a Window's size when
+ * the user changes the window bounds.
+ *
+ * This event is _not_ posted to the eventqueue, but rather dispatched directly
+ * via Window.dispatchEvent(). It is the cleanest way we could find to update
+ * the AWT's knowledge of the window size. Small testprograms showed the
+ * following:
+ * - Component.reshape() and its derivatives are _not_ called. This makes sense
+ * as it could end up in loops,because this calls back into the peers.
+ * - Intercepting event dispatching for any events in
+ * EventQueue.dispatchEvent() showed that the size is still updated. So it
+ * is not done via an event dispatched over the eventqueue.
+ *
+ * Possible other candidates for implementation would have been:
+ * - Call a (private) callback method in Window/Component from the native
+ * side.
+ * - Call a (private) callback method in Window/Component via reflection.
+ *
+ * Both is uglier than sending this event directly. Note however that this
+ * is impossible to test, as Component.dispatchEvent() is final and can't be
+ * intercepted from outside code. But this impossibility to test the issue from
+ * outside code also means that this shouldn't raise any compatibility issues.
+ */
+public class ComponentReshapeEvent
+ extends AWTEvent
+{
+
+ public int x;
+ public int y;
+ public int width;
+ public int height;
+
+ public ComponentReshapeEvent(Component c, int x, int y, int width, int height)
+ {
+ super(c, 1999);
+ this.x = x;
+ this.y = y;
+ this.width = width;
+ this.height = height;
+ }
+}
diff --git a/libjava/classpath/gnu/java/awt/LowPriorityEvent.java b/libjava/classpath/gnu/java/awt/LowPriorityEvent.java
new file mode 100644
index 00000000000..c1558f6ff58
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/LowPriorityEvent.java
@@ -0,0 +1,48 @@
+/* LowPriorityEvent.java -- Marks events with low priority
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt;
+
+/**
+ * A marker interface that marks events with low priority. LowPriority events
+ * are dispatched _after_ other (normal priority) events by the EventQueue.
+ */
+public interface LowPriorityEvent
+{
+ // Empty marker interface.
+}
diff --git a/libjava/classpath/gnu/java/awt/color/PyccConverter.java b/libjava/classpath/gnu/java/awt/color/PyccConverter.java
index cd50d8776cd..77ea28a3e92 100644
--- a/libjava/classpath/gnu/java/awt/color/PyccConverter.java
+++ b/libjava/classpath/gnu/java/awt/color/PyccConverter.java
@@ -37,7 +37,6 @@ exception statement from your version. */
package gnu.java.awt.color;
-
/**
* PyccConverter - conversion routines for the PhotoYCC colorspace
*
@@ -52,21 +51,21 @@ public class PyccConverter implements ColorSpaceConverter
{
public float[] toRGB(float[] in)
{
- return null;
+ throw new UnsupportedOperationException();
}
public float[] fromRGB(float[] in)
{
- return null;
+ throw new UnsupportedOperationException();
}
public float[] toCIEXYZ(float[] in)
{
- return null;
+ throw new UnsupportedOperationException();
}
public float[] fromCIEXYZ(float[] in)
{
- return null;
+ throw new UnsupportedOperationException();
}
}
diff --git a/libjava/classpath/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java b/libjava/classpath/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java
index 4f922982273..b68fa105803 100644
--- a/libjava/classpath/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java
+++ b/libjava/classpath/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java
@@ -61,11 +61,13 @@ public class GtkDragSourceContextPeer
private ComponentPeer peer;
private Cursor cursor;
private DragSourceContext context;
+ public static Component target;
native void nativeStartDrag(Image i, int x, int y, int action, String target);
native void connectSignals(ComponentPeer comp);
native void create(ComponentPeer comp);
native void nativeSetCursor(int cursor);
+ native void setTarget(GtkDropTargetContextPeer target);
public GtkDragSourceContextPeer(DragGestureEvent e)
{
@@ -76,10 +78,18 @@ public class GtkDragSourceContextPeer
create(peer);
connectSignals(peer);
cursor = comp.getCursor();
+
+ // FIXME: Where do we set the target?
+
+ if ((target != null))
+ setTarget(new GtkDropTargetContextPeer(target));
}
ComponentPeer getComponentPeer(Component c)
{
+ if (c == null)
+ return null;
+
Component curr = c;
while (curr.getPeer() instanceof LightweightPeer)
curr = curr.getParent();
@@ -93,7 +103,7 @@ public class GtkDragSourceContextPeer
throws InvalidDnDOperationException
{
this.context = context;
-
+
if (p == null)
p = new Point();
diff --git a/libjava/classpath/gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.java b/libjava/classpath/gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.java
index 50cd95d41ad..f24b3f39bcb 100644
--- a/libjava/classpath/gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.java
+++ b/libjava/classpath/gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.java
@@ -50,10 +50,10 @@ public class GtkDropTargetContextPeer
extends GtkGenericPeer
implements DropTargetContextPeer
{
-
- public GtkDropTargetContextPeer()
+
+ public GtkDropTargetContextPeer(Object obj)
{
- super(null);
+ super(obj);
}
public void setTargetActions(int actions)
diff --git a/libjava/classpath/gnu/java/awt/font/autofit/AxisHints.java b/libjava/classpath/gnu/java/awt/font/autofit/AxisHints.java
new file mode 100644
index 00000000000..b2c9912342b
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/font/autofit/AxisHints.java
@@ -0,0 +1,45 @@
+/* AxisHints.java -- FIXME: briefly describe file purpose
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.font.autofit;
+
+class AxisHints
+{
+
+ Segment[] segments;
+}
diff --git a/libjava/classpath/gnu/java/awt/font/autofit/Constants.java b/libjava/classpath/gnu/java/awt/font/autofit/Constants.java
new file mode 100644
index 00000000000..cb3992825ab
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/font/autofit/Constants.java
@@ -0,0 +1,61 @@
+/* Constants.java -- Some constants used in the autofitter
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.font.autofit;
+
+/**
+ * Some constants used in the autofitter.
+ */
+interface Constants
+{
+
+ /**
+ * The horizontal dimension.
+ */
+ static final int DIMENSION_HORZ = 0;
+
+ /**
+ * The vertical dimension.
+ */
+ static final int DIMENSION_VERT = 1;
+
+ /**
+ * The number of dimensions.
+ */
+ static final int DIMENSION_MAX = 2;
+}
diff --git a/libjava/classpath/gnu/java/awt/font/autofit/GlyphHints.java b/libjava/classpath/gnu/java/awt/font/autofit/GlyphHints.java
new file mode 100644
index 00000000000..ad73a04a69b
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/font/autofit/GlyphHints.java
@@ -0,0 +1,75 @@
+/* GlyphHints.java -- Data and methods for actual hinting
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.font.autofit;
+
+import gnu.java.awt.font.opentype.truetype.Zone;
+
+/**
+ * The data and methods used for the actual hinting process.
+ */
+class GlyphHints
+{
+
+ int xScale;
+ int xDelta;
+ int yScale;
+ int yDelta;
+
+ AxisHints[] axis;
+
+ void rescale(ScriptMetrics metrics)
+ {
+ // TODO: Implement.
+ }
+
+ void reload(Zone outline)
+ {
+ // TODO: Implement.
+ }
+
+ void computeSegments(int dim)
+ {
+ // TODO: Implement.
+ }
+
+ void linkSegments(int dim)
+ {
+ // TODO: Implement.
+ }
+}
diff --git a/libjava/classpath/gnu/java/awt/font/autofit/Latin.java b/libjava/classpath/gnu/java/awt/font/autofit/Latin.java
new file mode 100644
index 00000000000..0352b41a45a
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/font/autofit/Latin.java
@@ -0,0 +1,177 @@
+/* Latin.java -- Latin specific glyph handling
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.font.autofit;
+
+import java.awt.geom.AffineTransform;
+
+import gnu.java.awt.font.opentype.OpenTypeFont;
+import gnu.java.awt.font.opentype.truetype.Zone;
+
+/**
+ * Implements Latin specific glyph handling.
+ */
+class Latin
+ implements Script, Constants
+{
+
+ private static final int MAX_WIDTHS = 16;
+
+ public void applyHints(GlyphHints hints, ScriptMetrics metrics)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void doneMetrics(ScriptMetrics metrics)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * Initializes the <code>hints</code> object.
+ *
+ * @param hints the hints to initialize
+ * @param metrics the metrics to use
+ */
+ public void initHints(GlyphHints hints, ScriptMetrics metrics)
+ {
+ hints.rescale(metrics);
+ LatinMetrics lm = (LatinMetrics) metrics;
+ hints.xScale = lm.axis[DIMENSION_HORZ].scale;
+ hints.xDelta = lm.axis[DIMENSION_HORZ].delta;
+ hints.yScale = lm.axis[DIMENSION_VERT].scale;
+ hints.yDelta = lm.axis[DIMENSION_VERT].delta;
+ // TODO: Set the scaler and other flags.
+ }
+
+ /**
+ * Initializes the script metrics.
+ *
+ * @param metrics the script metrics to initialize
+ * @param face the font
+ */
+ public void initMetrics(ScriptMetrics metrics, OpenTypeFont face)
+ {
+ assert metrics instanceof LatinMetrics;
+ LatinMetrics lm = (LatinMetrics) metrics;
+ lm.unitsPerEm = face.unitsPerEm;
+
+ // TODO: Check for latin charmap.
+
+ initWidths(lm, face, 'o');
+ initBlues(lm, face);
+ }
+
+ public void scaleMetrics(ScriptMetrics metrics)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * Determines the standard stem widths.
+ *
+ * @param metrics the metrics to use
+ * @param face the font face
+ * @param ch the character that is used for getting the widths
+ */
+ private void initWidths(LatinMetrics metrics, OpenTypeFont face, char ch)
+ {
+ GlyphHints hints = new GlyphHints();
+ metrics.axis[DIMENSION_HORZ].widthCount = 0;
+ metrics.axis[DIMENSION_VERT].widthCount = 0;
+ int glyphIndex = face.getGlyph(ch);
+ // TODO: Avoid that AffineTransform constructor and change
+ // getRawGlyphOutline() to accept null or remove that parameter altogether.
+ // Consider this when the thing is done and we know what we need that for.
+ Zone outline = face.getRawGlyphOutline(glyphIndex, new AffineTransform());
+ LatinMetrics dummy = new LatinMetrics();
+ Scaler scaler = dummy.scaler;
+ dummy.unitsPerEm = metrics.unitsPerEm;
+ scaler.xScale = scaler.yScale = 10000;
+ scaler.xDelta = scaler.yDelta = 0;
+ scaler.face = face;
+ hints.rescale(dummy);
+ hints.reload(outline);
+ for (int dim = 0; dim < DIMENSION_MAX; dim++)
+ {
+ LatinAxis axis = metrics.axis[dim];
+ AxisHints axHints = hints.axis[dim];
+ int numWidths = 0;
+ hints.computeSegments(dim);
+ hints.linkSegments(dim);
+ Segment[] segs = axHints.segments;
+ for (int i = 0; i < segs.length; i++)
+ {
+ Segment seg = segs[i];
+ Segment link = seg.link;
+ if (link != null && link.link == seg && link.index > i)
+ {
+ int dist = Math.abs(seg.pos - link.pos);
+ if (numWidths < MAX_WIDTHS)
+ axis.widths[numWidths++].org = dist;
+ }
+ }
+ }
+ for (int dim = 0; dim < DIMENSION_MAX; dim++)
+ {
+ LatinAxis axis = metrics.axis[dim];
+ int stdw = axis.widthCount > 0 ? axis.widths[0].org
+ : constant(metrics, 50);
+ axis.edgeDistanceTreshold= stdw / 5;
+ }
+ }
+
+ /**
+ * Initializes the blue zones of the font.
+ *
+ * @param metrics the metrics to use
+ * @param face the font face to analyze
+ */
+ private void initBlues(LatinMetrics metrics, OpenTypeFont face)
+ {
+ // TODO: Implement.
+ }
+
+ private int constant(LatinMetrics metrics, int c)
+ {
+ return c * (metrics.unitsPerEm / 2048);
+ }
+}
diff --git a/libjava/classpath/gnu/java/awt/font/autofit/LatinAxis.java b/libjava/classpath/gnu/java/awt/font/autofit/LatinAxis.java
new file mode 100644
index 00000000000..8ca1e6d9ed2
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/font/autofit/LatinAxis.java
@@ -0,0 +1,53 @@
+/* LatinAxis.java -- Axis specific data
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.font.autofit;
+
+/**
+ * Some axis specific data.
+ */
+class LatinAxis
+{
+
+ int scale;
+ int delta;
+
+ int widthCount;
+ Width[] widths;
+ float edgeDistanceTreshold;
+}
diff --git a/libjava/classpath/gnu/java/awt/font/autofit/LatinMetrics.java b/libjava/classpath/gnu/java/awt/font/autofit/LatinMetrics.java
new file mode 100644
index 00000000000..cd955348b37
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/font/autofit/LatinMetrics.java
@@ -0,0 +1,51 @@
+/* LatinMetrics.java -- Latin specific metrics data
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.font.autofit;
+
+/**
+ * Latin specific metrics data.
+ */
+class LatinMetrics
+ extends ScriptMetrics
+{
+
+ LatinAxis[] axis;
+
+ int unitsPerEm;
+}
diff --git a/libjava/classpath/gnu/java/awt/font/autofit/Scaler.java b/libjava/classpath/gnu/java/awt/font/autofit/Scaler.java
new file mode 100644
index 00000000000..10518512578
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/font/autofit/Scaler.java
@@ -0,0 +1,52 @@
+/* Scaler.java -- FIXME: briefly describe file purpose
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.font.autofit;
+
+import gnu.java.awt.font.opentype.OpenTypeFont;
+
+class Scaler
+{
+
+ int xScale;
+ int xDelta;
+ int yScale;
+ int yDelta;
+ OpenTypeFont face;
+
+}
diff --git a/libjava/classpath/gnu/java/awt/font/autofit/Script.java b/libjava/classpath/gnu/java/awt/font/autofit/Script.java
new file mode 100644
index 00000000000..3b353010f2d
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/font/autofit/Script.java
@@ -0,0 +1,62 @@
+/* Script.java -- Defines script specific interface to the autofitter
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.font.autofit;
+
+import gnu.java.awt.font.opentype.OpenTypeFont;
+
+/**
+ * Defines script specific methods for the auto fitter.
+ */
+interface Script
+{
+
+ /**
+ * Initializes the metrics.
+ */
+ void initMetrics(ScriptMetrics metrics, OpenTypeFont face);
+
+ void scaleMetrics(ScriptMetrics metrics/* , scaler, map this */);
+
+ void doneMetrics(ScriptMetrics metrics);
+
+ void initHints(GlyphHints hints, ScriptMetrics metrics);
+
+ void applyHints(GlyphHints hints, /* some outline object, */
+ ScriptMetrics metrics);
+}
diff --git a/libjava/classpath/gnu/java/awt/font/autofit/ScriptMetrics.java b/libjava/classpath/gnu/java/awt/font/autofit/ScriptMetrics.java
new file mode 100644
index 00000000000..77c815ae59d
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/font/autofit/ScriptMetrics.java
@@ -0,0 +1,49 @@
+/* ScriptMetrics.java -- Script specific metrics data
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.font.autofit;
+
+/**
+ * Script specific metrics data.
+ */
+class ScriptMetrics
+{
+
+ Script script;
+ Scaler scaler;
+}
diff --git a/libjava/classpath/gnu/java/awt/font/autofit/Segment.java b/libjava/classpath/gnu/java/awt/font/autofit/Segment.java
new file mode 100644
index 00000000000..32032a48fcc
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/font/autofit/Segment.java
@@ -0,0 +1,47 @@
+/* Segment.java -- FIXME: briefly describe file purpose
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.font.autofit;
+
+class Segment
+{
+
+ Segment link;
+ int index;
+ int pos;
+}
diff --git a/libjava/classpath/gnu/java/awt/font/autofit/Width.java b/libjava/classpath/gnu/java/awt/font/autofit/Width.java
new file mode 100644
index 00000000000..d4d540069ee
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/font/autofit/Width.java
@@ -0,0 +1,46 @@
+/* Width.java -- FIXME: briefly describe file purpose
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.font.autofit;
+
+public class Width
+{
+ int org;
+ int cur;
+ int fit;
+}
diff --git a/libjava/classpath/gnu/java/awt/font/opentype/CharGlyphMap.java b/libjava/classpath/gnu/java/awt/font/opentype/CharGlyphMap.java
index 6ada3b147c6..184075094b6 100644
--- a/libjava/classpath/gnu/java/awt/font/opentype/CharGlyphMap.java
+++ b/libjava/classpath/gnu/java/awt/font/opentype/CharGlyphMap.java
@@ -61,7 +61,7 @@ import java.nio.IntBuffer;
*
* @author Sascha Brawer (brawer@dandelis.ch)
*/
-abstract class CharGlyphMap
+public abstract class CharGlyphMap
{
private static final int PLATFORM_UNICODE = 0;
private static final int PLATFORM_MACINTOSH = 1;
diff --git a/libjava/classpath/gnu/java/awt/font/opentype/OpenTypeFont.java b/libjava/classpath/gnu/java/awt/font/opentype/OpenTypeFont.java
index 9ee28d76bb4..efc30811f7b 100644
--- a/libjava/classpath/gnu/java/awt/font/opentype/OpenTypeFont.java
+++ b/libjava/classpath/gnu/java/awt/font/opentype/OpenTypeFont.java
@@ -52,6 +52,7 @@ import java.util.Locale;
import gnu.java.awt.font.FontDelegate;
import gnu.java.awt.font.GNUGlyphVector;
import gnu.java.awt.font.opentype.truetype.TrueTypeScaler;
+import gnu.java.awt.font.opentype.truetype.Zone;
/**
@@ -117,7 +118,7 @@ public final class OpenTypeFont
* OpenType fonts with PostScript outlines, other values are
* acceptable (such as 1000).
*/
- private int unitsPerEm;
+ public int unitsPerEm;
/**
@@ -697,6 +698,20 @@ public final class OpenTypeFont
antialias, fractionalMetrics);
}
+ /**
+ * Fetches the raw glyph outline for the specified glyph index. This is used
+ * for the autofitter only ATM and is otherwise not usable for outside code.
+ *
+ * @param glyph the glyph index to fetch
+ * @param transform the transform to apply
+ *
+ * @return the raw outline of that glyph
+ */
+ public synchronized Zone getRawGlyphOutline(int glyph,
+ AffineTransform transform)
+ {
+ return scaler.getRawOutline(glyph, transform);
+ }
/**
* Returns a name for the specified glyph. This is useful for
diff --git a/libjava/classpath/gnu/java/awt/font/opentype/Scaler.java b/libjava/classpath/gnu/java/awt/font/opentype/Scaler.java
index 499c3ea526c..83a31c576c7 100644
--- a/libjava/classpath/gnu/java/awt/font/opentype/Scaler.java
+++ b/libjava/classpath/gnu/java/awt/font/opentype/Scaler.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package gnu.java.awt.font.opentype;
+import gnu.java.awt.font.opentype.truetype.Zone;
+
import java.awt.geom.AffineTransform;
import java.awt.geom.GeneralPath;
import java.awt.geom.Point2D;
@@ -189,4 +191,14 @@ public abstract class Scaler
boolean antialiased,
boolean fractionalMetrics,
boolean horizontal);
+
+ /**
+ * Returns the raw outline data. This is used for the autofitter atm.
+ *
+ * @param glyph the glyph index
+ * @param transform the transform to apply
+ *
+ * @return the raw glyph outline
+ */
+ public abstract Zone getRawOutline(int glyph, AffineTransform transform);
}
diff --git a/libjava/classpath/gnu/java/awt/font/opentype/truetype/GlyphLoader.java b/libjava/classpath/gnu/java/awt/font/opentype/truetype/GlyphLoader.java
index b12d7782b23..3733afe92d8 100644
--- a/libjava/classpath/gnu/java/awt/font/opentype/truetype/GlyphLoader.java
+++ b/libjava/classpath/gnu/java/awt/font/opentype/truetype/GlyphLoader.java
@@ -119,6 +119,11 @@ final class GlyphLoader
0, 0);
}
+ public void loadGlyph(int glyphIndex, AffineTransform transform,
+ Zone glyphZone)
+ {
+ loadGlyph(glyphIndex, unitsPerEm, transform, false, glyphZone);
+ }
private void loadSubGlyph(int glyphIndex,
double pointSize,
diff --git a/libjava/classpath/gnu/java/awt/font/opentype/truetype/TrueTypeScaler.java b/libjava/classpath/gnu/java/awt/font/opentype/truetype/TrueTypeScaler.java
index e4d7309cb55..8dfdeff0790 100644
--- a/libjava/classpath/gnu/java/awt/font/opentype/truetype/TrueTypeScaler.java
+++ b/libjava/classpath/gnu/java/awt/font/opentype/truetype/TrueTypeScaler.java
@@ -198,6 +198,12 @@ public final class TrueTypeScaler
return glyphZone.getPath();
}
+ public Zone getRawOutline(int glyphIndex, AffineTransform transform)
+ {
+ Zone zone = new Zone(glyphZone.getCapacity());
+ glyphLoader.loadGlyph(glyphIndex, transform, zone);
+ return zone;
+ }
/**
* Determines the advance width and height for a glyph.
diff --git a/libjava/classpath/gnu/java/awt/font/opentype/truetype/Zone.java b/libjava/classpath/gnu/java/awt/font/opentype/truetype/Zone.java
index c0a3947f684..ff5bb631619 100644
--- a/libjava/classpath/gnu/java/awt/font/opentype/truetype/Zone.java
+++ b/libjava/classpath/gnu/java/awt/font/opentype/truetype/Zone.java
@@ -45,7 +45,7 @@ import java.awt.geom.PathIterator;
/**
* A collection of points with some additional information.
*/
-final class Zone
+public final class Zone
{
private final int[] pos;
private final int[] origPos;
diff --git a/libjava/classpath/gnu/java/awt/java2d/AbstractGraphics2D.java b/libjava/classpath/gnu/java/awt/java2d/AbstractGraphics2D.java
index 9d017240d60..da21253980f 100644
--- a/libjava/classpath/gnu/java/awt/java2d/AbstractGraphics2D.java
+++ b/libjava/classpath/gnu/java/awt/java2d/AbstractGraphics2D.java
@@ -100,6 +100,20 @@ import java.util.Map;
* {@link #updateRaster(Raster, int, int, int, int)} method, which always gets
* called after a chunk of data got painted into the raster.
* </p>
+ * <p>Alternativly the backend can provide a method for filling Shapes by
+ * overriding the protected method fillShape(). This can be accomplished
+ * by a polygon filling function of the backend. Keep in mind though that
+ * Shapes can be quite complex (i.e. non-convex and containing holes, etc)
+ * which is not supported by all polygon fillers. Also it must be noted
+ * that fillShape() is expected to handle painting and compositing as well as
+ * clipping and transformation. If your backend can't support this natively,
+ * then you can fallback to the implementation in this class. You'll need
+ * to provide a writable Raster then, see above.</p>
+ * <p>Another alternative is to implement fillScanline() which only requires
+ * the backend to be able to draw horizontal lines in device space,
+ * which is usually very cheap.
+ * The implementation should still handle painting and compositing,
+ * but no more clipping and transformation is required by the backend.</p>
* <p>The backend is free to provide implementations for the various raw*
* methods for optimized AWT 1.1 style painting of some primitives. This should
* accelerate painting of Swing greatly. When doing so, the backend must also
@@ -126,6 +140,9 @@ import java.util.Map;
* in plain Java because they involve lots of shuffling around with large
* arrays. In fact, you really would want to let the graphics card to the
* work, they are made for this.</li>
+ * <li>Provide an accelerated implementation for fillShape(). For instance,
+ * OpenGL can fill shapes very efficiently. There are some considerations
+ * to be made though, see above for details.</li>
* </ol>
* </p>
*
@@ -144,6 +161,12 @@ public abstract class AbstractGraphics2D
private static final int AA_SAMPLING = 8;
/**
+ * Caches certain shapes to avoid massive creation of such Shapes in
+ * the various draw* and fill* methods.
+ */
+ private static final ThreadLocal shapeCache = new ThreadLocal();
+
+ /**
* The transformation for this Graphics2D instance
*/
protected AffineTransform transform;
@@ -184,11 +207,6 @@ public abstract class AbstractGraphics2D
private RenderingHints renderingHints;
/**
- * The paint raster.
- */
- private Raster paintRaster;
-
- /**
* The raster of the destination surface. This is where the painting is
* performed.
*/
@@ -219,7 +237,7 @@ public abstract class AbstractGraphics2D
* AbstractGraphics2D object and will be the most commonly used setting
* in Swing rendering and should therefore be optimized as much as possible.
*/
- private boolean isOptimized;
+ private boolean isOptimized = true;
/**
* Creates a new AbstractGraphics2D instance.
@@ -270,7 +288,6 @@ public abstract class AbstractGraphics2D
public boolean drawImage(Image image, AffineTransform xform,
ImageObserver obs)
{
- boolean ret = false;
Rectangle areaOfInterest = new Rectangle(0, 0, image.getWidth(obs),
image.getHeight(obs));
return drawImageImpl(image, xform, obs, areaOfInterest);
@@ -982,7 +999,8 @@ public abstract class AbstractGraphics2D
else
copy.clip = new GeneralPath(clip);
- copy.renderingHints = new RenderingHints(renderingHints);
+ copy.renderingHints = new RenderingHints(null);
+ copy.renderingHints.putAll(renderingHints);
copy.transform = new AffineTransform(transform);
// The remaining state is inmmutable and doesn't need to be copied.
return copy;
@@ -1143,14 +1161,31 @@ public abstract class AbstractGraphics2D
{
if (isOptimized)
{
- int tx = (int) transform.getTranslateX();
- int ty = (int) transform.getTranslateY();
- rawDrawLine(x1 + tx, y1 + ty, x2 + tx, y2 + ty);
+ rawDrawLine(x1, y1, x2, y2);
}
else
{
- Line2D line = new Line2D.Double(x1, y1, x2, y2);
- draw(line);
+ ShapeCache sc = getShapeCache();
+ if (sc.line == null)
+ sc.line = new Line2D.Float();
+ sc.line.setLine(x1, y1, x2, y2);
+ draw(sc.line);
+ }
+ }
+
+ public void drawRect(int x, int y, int w, int h)
+ {
+ if (isOptimized)
+ {
+ rawDrawRect(x, y, w, h);
+ }
+ else
+ {
+ ShapeCache sc = getShapeCache();
+ if (sc.rect == null)
+ sc.rect = new Rectangle();
+ sc.rect.setBounds(x, y, w, h);
+ draw(sc.rect);
}
}
@@ -1166,13 +1201,15 @@ public abstract class AbstractGraphics2D
{
if (isOptimized)
{
- int tx = (int) transform.getTranslateX();
- int ty = (int) transform.getTranslateY();
- rawFillRect(x + tx, y + ty, width, height);
+ rawFillRect(x, y, width, height);
}
else
{
- fill(new Rectangle(x, y, width, height));
+ ShapeCache sc = getShapeCache();
+ if (sc.rect == null)
+ sc.rect = new Rectangle();
+ sc.rect.setBounds(x, y, width, height);
+ fill(sc.rect);
}
}
@@ -1213,8 +1250,11 @@ public abstract class AbstractGraphics2D
public void drawRoundRect(int x, int y, int width, int height, int arcWidth,
int arcHeight)
{
- draw(new RoundRectangle2D.Double(x, y, width, height, arcWidth,
- arcHeight));
+ ShapeCache sc = getShapeCache();
+ if (sc.roundRect == null)
+ sc.roundRect = new RoundRectangle2D.Float();
+ sc.roundRect.setRoundRect(x, y, width, height, arcWidth, arcHeight);
+ draw(sc.roundRect);
}
/**
@@ -1230,8 +1270,11 @@ public abstract class AbstractGraphics2D
public void fillRoundRect(int x, int y, int width, int height, int arcWidth,
int arcHeight)
{
- fill(new RoundRectangle2D.Double(x, y, width, height, arcWidth,
- arcHeight));
+ ShapeCache sc = getShapeCache();
+ if (sc.roundRect == null)
+ sc.roundRect = new RoundRectangle2D.Float();
+ sc.roundRect.setRoundRect(x, y, width, height, arcWidth, arcHeight);
+ fill(sc.roundRect);
}
/**
@@ -1244,7 +1287,11 @@ public abstract class AbstractGraphics2D
*/
public void drawOval(int x, int y, int width, int height)
{
- draw(new Ellipse2D.Double(x, y, width, height));
+ ShapeCache sc = getShapeCache();
+ if (sc.ellipse == null)
+ sc.ellipse = new Ellipse2D.Float();
+ sc.ellipse.setFrame(x, y, width, height);
+ draw(sc.ellipse);
}
/**
@@ -1257,7 +1304,11 @@ public abstract class AbstractGraphics2D
*/
public void fillOval(int x, int y, int width, int height)
{
- fill(new Ellipse2D.Double(x, y, width, height));
+ ShapeCache sc = getShapeCache();
+ if (sc.ellipse == null)
+ sc.ellipse = new Ellipse2D.Float();
+ sc.ellipse.setFrame(x, y, width, height);
+ fill(sc.ellipse);
}
/**
@@ -1266,8 +1317,11 @@ public abstract class AbstractGraphics2D
public void drawArc(int x, int y, int width, int height, int arcStart,
int arcAngle)
{
- draw(new Arc2D.Double(x, y, width, height, arcStart, arcAngle,
- Arc2D.OPEN));
+ ShapeCache sc = getShapeCache();
+ if (sc.arc == null)
+ sc.arc = new Arc2D.Float();
+ sc.arc.setArc(x, y, width, height, arcStart, arcAngle, Arc2D.OPEN);
+ draw(sc.arc);
}
/**
@@ -1276,8 +1330,11 @@ public abstract class AbstractGraphics2D
public void fillArc(int x, int y, int width, int height, int arcStart,
int arcAngle)
{
- fill(new Arc2D.Double(x, y, width, height, arcStart, arcAngle,
- Arc2D.OPEN));
+ ShapeCache sc = getShapeCache();
+ if (sc.arc == null)
+ sc.arc = new Arc2D.Float();
+ sc.arc.setArc(x, y, width, height, arcStart, arcAngle, Arc2D.PIE);
+ draw(sc.arc);
}
public void drawPolyline(int[] xPoints, int[] yPoints, int npoints)
@@ -1291,7 +1348,13 @@ public abstract class AbstractGraphics2D
*/
public void drawPolygon(int[] xPoints, int[] yPoints, int npoints)
{
- draw(new Polygon(xPoints, yPoints, npoints));
+ ShapeCache sc = getShapeCache();
+ if (sc.polygon == null)
+ sc.polygon = new Polygon();
+ sc.polygon.xpoints = xPoints;
+ sc.polygon.ypoints = yPoints;
+ sc.polygon.npoints = npoints;
+ draw(sc.polygon);
}
/**
@@ -1299,7 +1362,13 @@ public abstract class AbstractGraphics2D
*/
public void fillPolygon(int[] xPoints, int[] yPoints, int npoints)
{
- fill(new Polygon(xPoints, yPoints, npoints));
+ ShapeCache sc = getShapeCache();
+ if (sc.polygon == null)
+ sc.polygon = new Polygon();
+ sc.polygon.xpoints = xPoints;
+ sc.polygon.ypoints = yPoints;
+ sc.polygon.npoints = npoints;
+ fill(sc.polygon);
}
/**
@@ -1460,8 +1529,12 @@ public abstract class AbstractGraphics2D
}
/**
- * Fills the specified shape. The shape has already been clipped against the
- * current clip.
+ * Fills the specified shape. Override this if your backend can efficiently
+ * fill shapes. This is possible on many systems via a polygon fill
+ * method or something similar. But keep in mind that Shapes can be quite
+ * complex (non-convex, with holes etc), which is not necessarily supported
+ * by all polygon fillers. Also note that you must perform clipping
+ * before filling the shape.
*
* @param s the shape to fill
* @param isFont <code>true</code> if the shape is a font outline
@@ -1533,6 +1606,11 @@ public abstract class AbstractGraphics2D
draw(new Line2D.Float(x0, y0, x1, y1));
}
+ protected void rawDrawRect(int x, int y, int w, int h)
+ {
+ draw(new Rectangle(x, y, w, h));
+ }
+
/**
* Draws a string in optimization mode. The implementation should respect the
* clip and translation. It can assume that the clip is a rectangle and that
@@ -1627,11 +1705,7 @@ public abstract class AbstractGraphics2D
}
/**
- * Fills the specified polygon. This should be overridden by backends
- * that support accelerated (native) polygon filling, which is the
- * case for most toolkit window and offscreen image implementations.
- *
- * The polygon is already clipped when this method is called.
+ * Fills the specified polygon without anti-aliasing.
*/
private void fillShapeImpl(ArrayList segs, Rectangle2D deviceBounds2D,
Rectangle2D userBounds,
@@ -1662,7 +1736,7 @@ public abstract class AbstractGraphics2D
for (Iterator i = segs.iterator(); i.hasNext();)
{
PolyEdge edge = (PolyEdge) i.next();
- int yindex = (int) ((int) Math.ceil(edge.y0) - (int) Math.ceil(icMinY));
+ int yindex = (int) Math.ceil(edge.y0) - (int) Math.ceil(icMinY);
if (edgeTable[yindex] == null) // Create bucket when needed.
edgeTable[yindex] = new ArrayList();
edgeTable[yindex].add(edge); // Add edge to the bucket of its line.
@@ -1766,7 +1840,8 @@ public abstract class AbstractGraphics2D
}
/**
- * Paints a scanline between x0 and x1.
+ * Paints a scanline between x0 and x1. Override this when your backend
+ * can efficiently draw/fill horizontal lines.
*
* @param x0 the left offset
* @param x1 the right offset
@@ -1972,8 +2047,7 @@ public abstract class AbstractGraphics2D
// Render full scanline.
//System.err.println("scanline: " + y);
if (! emptyScanline)
- fillScanlineAA(alpha, leftX, (int) y, rightX - leftX, pCtx,
- (int) minX);
+ fillScanlineAA(alpha, leftX, y, rightX - leftX, pCtx, (int) minX);
}
pCtx.dispose();
@@ -1986,7 +2060,7 @@ public abstract class AbstractGraphics2D
*
* @param alpha the alpha values in the scanline
* @param x0 the beginning of the scanline
- * @param y the y coordinate of the line
+ * @param yy the y coordinate of the line
*/
private void fillScanlineAA(int[] alpha, int x0, int yy, int numPixels,
PaintContext pCtx, int offs)
@@ -1997,7 +2071,6 @@ public abstract class AbstractGraphics2D
Raster paintRaster = pCtx.getRaster(x0, yy, numPixels, 1);
//System.err.println("paintColorModel: " + pCtx.getColorModel());
WritableRaster aaRaster = paintRaster.createCompatibleWritableRaster();
- int numBands = paintRaster.getNumBands();
ColorModel cm = pCtx.getColorModel();
double lastAlpha = 0.;
int lastAlphaInt = 0;
@@ -2156,10 +2229,10 @@ public abstract class AbstractGraphics2D
private static Rectangle computeIntersection(int x, int y, int w, int h,
Rectangle rect)
{
- int x2 = (int) rect.x;
- int y2 = (int) rect.y;
- int w2 = (int) rect.width;
- int h2 = (int) rect.height;
+ int x2 = rect.x;
+ int y2 = rect.y;
+ int w2 = rect.width;
+ int h2 = rect.height;
int dx = (x > x2) ? x : x2;
int dy = (y > y2) ? y : y2;
@@ -2266,4 +2339,20 @@ public abstract class AbstractGraphics2D
deviceBounds.setRect(minX, minY, maxX - minX, maxY - minY);
return segs;
}
+
+ /**
+ * Returns the ShapeCache for the calling thread.
+ *
+ * @return the ShapeCache for the calling thread
+ */
+ private ShapeCache getShapeCache()
+ {
+ ShapeCache sc = (ShapeCache) shapeCache.get();
+ if (sc == null)
+ {
+ sc = new ShapeCache();
+ shapeCache.set(sc);
+ }
+ return sc;
+ }
}
diff --git a/libjava/classpath/gnu/java/awt/java2d/QuadSegment.java b/libjava/classpath/gnu/java/awt/java2d/QuadSegment.java
index 5e15fe881d8..97a5372f6bd 100644
--- a/libjava/classpath/gnu/java/awt/java2d/QuadSegment.java
+++ b/libjava/classpath/gnu/java/awt/java2d/QuadSegment.java
@@ -145,7 +145,52 @@ public class QuadSegment extends Segment
Point2D cp;
QuadSegment s;
- if( plus )
+ if(!plus)
+ {
+ n1[0] = -n1[0];
+ n1[1] = -n1[1];
+ n2[0] = -n2[0];
+ n2[1] = -n2[1];
+ }
+
+ // Handle special cases where the control point is equal to an end point
+ // or end points are equal (ie, straight lines)
+ if (curve.getP1().equals(curve.getCtrlPt()))
+ {
+ cp = curve.getCtrlPt();
+ cp.setLocation(cp.getX() + n2[0], cp.getY() + n2[1]);
+ n1[0] = n2[0];
+ n1[1] = n2[1];
+ }
+ else if (curve.getP2().equals(curve.getCtrlPt()))
+ {
+ cp = curve.getCtrlPt();
+ cp.setLocation(cp.getX() + n1[0], cp.getY() + n1[1]);
+ n2[0] = n1[0];
+ n2[1] = n1[1];
+ }
+ else if (curve.getP1().equals(curve.getP2()))
+ {
+ cp = curve.getCtrlPt();
+
+ double deltaX = curve.getX1() - curve.getCtrlX();
+ double deltaY = curve.getY1() - curve.getCtrlY();
+ double length = Math.sqrt((deltaX * deltaX) + (deltaY * deltaY));
+ double ratio = radius / length;
+ deltaX *= ratio;
+ deltaY *= ratio;
+
+ if (plus)
+ cp.setLocation(cp.getX() + deltaX, cp.getY() + deltaY);
+ else
+ cp.setLocation(cp.getX() - deltaX, cp.getY() - deltaY);
+ }
+ else if (n1[0] == n2[0] && n1[1] == n2[1])
+ {
+ cp = curve.getCtrlPt();
+ cp.setLocation(cp.getX() + n1[0], cp.getY() + n1[1]);
+ }
+ else
{
cp = lineIntersection(curve.getX1() + n1[0],
curve.getY1() + n1[1],
@@ -155,25 +200,11 @@ public class QuadSegment extends Segment
curve.getCtrlY() + n2[1],
curve.getX2() + n2[0],
curve.getY2() + n2[1], true);
- s = new QuadSegment(curve.getX1() + n1[0], curve.getY1() + n1[1],
- cp.getX(), cp.getY(),
- curve.getX2() + n2[0], curve.getY2() + n2[1]);
- }
- else
- {
- cp = lineIntersection(curve.getX1() - n1[0],
- curve.getY1() - n1[1],
- curve.getCtrlX() - n1[0],
- curve.getCtrlY() - n1[1],
- curve.getCtrlX() - n2[0],
- curve.getCtrlY() - n2[1],
- curve.getX2() - n2[0],
- curve.getY2() - n2[1], true);
-
- s = new QuadSegment(curve.getX1() - n1[0], curve.getY1() - n1[1],
- cp.getX(), cp.getY(),
- curve.getX2() - n2[0], curve.getY2() - n2[1]);
}
+
+ s = new QuadSegment(curve.getX1() + n1[0], curve.getY1() + n1[1],
+ cp.getX(), cp.getY(),
+ curve.getX2() + n2[0], curve.getY2() + n2[1]);
return s;
}
diff --git a/libjava/classpath/gnu/java/awt/java2d/ShapeCache.java b/libjava/classpath/gnu/java/awt/java2d/ShapeCache.java
new file mode 100644
index 00000000000..034b53cadd3
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/java2d/ShapeCache.java
@@ -0,0 +1,85 @@
+/* ShapeCache.java -- Caches certain Shapes for reuse in AbstractGraphics2D
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.java2d;
+
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.geom.Arc2D;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.Line2D;
+import java.awt.geom.RoundRectangle2D;
+
+/**
+ * Caches certain Shape objects for reuse in AbstractGraphics2D. This avoids
+ * massive creation of such objects.
+ */
+public class ShapeCache
+{
+
+ /**
+ * A cached Line2D.
+ */
+ public Line2D line;
+
+ /**
+ * A cached Rectangle.
+ */
+ public Rectangle rect;
+
+ /**
+ * A cached RoundRectangle2D.
+ */
+ public RoundRectangle2D roundRect;
+
+ /**
+ * A cached Ellipse2D.
+ */
+ public Ellipse2D ellipse;
+
+ /**
+ * A cached Arc2D.
+ */
+ public Arc2D arc;
+
+ /**
+ * A cached Polygon.
+ */
+ public Polygon polygon;
+
+}
diff --git a/libjava/classpath/gnu/java/awt/java2d/TexturePaintContext.java b/libjava/classpath/gnu/java/awt/java2d/TexturePaintContext.java
index 1a782ce07e3..db0a2e65804 100644
--- a/libjava/classpath/gnu/java/awt/java2d/TexturePaintContext.java
+++ b/libjava/classpath/gnu/java/awt/java2d/TexturePaintContext.java
@@ -104,7 +104,7 @@ public class TexturePaintContext
double scaleY = anchor.getHeight() / image.getHeight();
transform = (AffineTransform) xform.clone();
transform.scale(scaleX, scaleY);
- transform.translate(-anchor.getMinX(), -anchor.getMaxX());
+ transform.translate(-anchor.getMinX(), -anchor.getMinY());
transform = transform.createInverse();
}
catch (NoninvertibleTransformException ex)
@@ -177,6 +177,12 @@ public class TexturePaintContext
// The modulo operation gives us the replication effect.
dx = ((dx - minX) % width) + minX;
dy = ((dy - minY) % height) + minY;
+
+ // Handle possible negative values (replicating above the top-left)
+ if (dx < 0)
+ dx += width;
+ if (dy < 0)
+ dy += height;
// Copy the pixel.
pixel = source.getDataElements(dx, dy, pixel);
diff --git a/libjava/classpath/gnu/java/awt/peer/ClasspathFontPeer.java b/libjava/classpath/gnu/java/awt/peer/ClasspathFontPeer.java
index dad7bb0b08f..2176f34a5f1 100644
--- a/libjava/classpath/gnu/java/awt/peer/ClasspathFontPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/ClasspathFontPeer.java
@@ -832,18 +832,4 @@ public abstract class ClasspathFontPeer
public abstract Rectangle2D getMaxCharBounds (Font font,
FontRenderContext rc);
- /**
- * Implementation of {@link Font#getStringBounds(CharacterIterator, int,
- * int, FontRenderContext)}
- *
- * @param font the font this peer is being called from. This may be
- * useful if you are sharing peers between Font objects. Otherwise it may
- * be ignored.
- */
-
- public abstract Rectangle2D getStringBounds (Font font,
- CharacterIterator ci,
- int begin, int limit,
- FontRenderContext frc);
-
}
diff --git a/libjava/classpath/gnu/java/awt/peer/GLightweightPeer.java b/libjava/classpath/gnu/java/awt/peer/GLightweightPeer.java
index 88733b92f8c..f9a7bac8ee6 100644
--- a/libjava/classpath/gnu/java/awt/peer/GLightweightPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/GLightweightPeer.java
@@ -54,25 +54,14 @@ import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
import java.awt.event.PaintEvent;
import java.awt.image.ColorModel;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
import java.awt.image.VolatileImage;
-import java.awt.peer.ComponentPeer;
import java.awt.peer.ContainerPeer;
import java.awt.peer.LightweightPeer;
-/*
- * Another possible implementation strategy for lightweight peers is
- * to make GLightweightPeer a placeholder class that implements
- * LightweightPeer. Then the Component and Container classes could
- * identify a peer as lightweight and handle it specially. The
- * current approach is probably more clear but less efficient.
- */
-
/**
* A stub class that implements the ComponentPeer and ContainerPeer
* interfaces using callbacks into the Component and Container
@@ -85,47 +74,48 @@ import java.awt.peer.LightweightPeer;
public class GLightweightPeer
implements LightweightPeer, ContainerPeer
{
- private Component comp;
-
- private Insets containerInsets;
-
- public GLightweightPeer(Component comp)
+ public GLightweightPeer()
{
- this.comp = comp;
+ // Nothing to do here.
}
// -------- java.awt.peer.ContainerPeer implementation:
public Insets insets()
{
- return getInsets ();
+ // Nothing to do here for lightweights.
+ return null;
}
public Insets getInsets()
{
- if (containerInsets == null)
- containerInsets = new Insets (0,0,0,0);
- return containerInsets;
+ // Nothing to do here for lightweights.
+ return null;
}
public void beginValidate()
{
+ // Nothing to do here for lightweights.
}
public void endValidate()
{
+ // Nothing to do here for lightweights.
}
public void beginLayout()
{
+ // Nothing to do here for lightweights.
}
public void endLayout()
{
+ // Nothing to do here for lightweights.
}
public boolean isPaintPending()
{
+ // Nothing to do here for lightweights.
return false;
}
@@ -133,122 +123,188 @@ public class GLightweightPeer
public int checkImage(Image img, int width, int height, ImageObserver o)
{
- return comp.getToolkit().checkImage(img, width, height, o);
+ // Nothing to do here for lightweights.
+ return -1;
}
public Image createImage(ImageProducer prod)
{
- return comp.getToolkit().createImage(prod);
+ // Nothing to do here for lightweights.
+ return null;
}
/* This method is not called. */
public Image createImage(int width, int height)
{
+ // Nothing to do here for lightweights.
return null;
}
- public void disable() {}
+ public void disable()
+ {
+ // Nothing to do here for lightweights.
+ }
- public void dispose() {}
+ public void dispose()
+ {
+ // Nothing to do here for lightweights.
+ }
- public void enable() {}
+ public void enable()
+ {
+ // Nothing to do here for lightweights.
+ }
public GraphicsConfiguration getGraphicsConfiguration()
{
+ // Nothing to do here for lightweights.
return null;
}
public FontMetrics getFontMetrics(Font f)
{
- return comp.getToolkit().getFontMetrics(f);
+ // We shouldn't end up here, but if we do we can still try do something
+ // reasonable.
+ Toolkit tk = Toolkit.getDefaultToolkit();
+ return tk.getFontMetrics(f);
}
/* Returning null here tells the Component object that called us to
* use its parent's Graphics. */
public Graphics getGraphics()
{
+ // Nothing to do here for lightweights.
return null;
}
public Point getLocationOnScreen()
{
- Point parentLocation = comp.getParent().getLocationOnScreen();
- return new Point (parentLocation.x + comp.getX(),
- parentLocation.y + comp.getY());
+ // Nothing to do here for lightweights.
+ return null;
}
public Dimension getMinimumSize()
{
- return new Dimension(comp.getWidth(), comp.getHeight());
+ return minimumSize();
}
- /* A lightweight component's preferred size is equivalent to its
- * Component width and height values. */
public Dimension getPreferredSize()
{
- return new Dimension(comp.getWidth(), comp.getHeight());
+ return preferredSize();
}
/* Returning null here tells the Component object that called us to
* use its parent's Toolkit. */
public Toolkit getToolkit()
{
+ // Nothing to do here for lightweights.
return null;
}
- public void handleEvent(AWTEvent e) {}
+ public void handleEvent(AWTEvent e)
+ {
+ // This can only happen when an application posts a PaintEvent for
+ // a lightweight component directly. We still support painting for
+ // this case.
+ if (e instanceof PaintEvent)
+ {
+ PaintEvent pe = (PaintEvent) e;
+ Component target = (Component) e.getSource();
+ if (target != null && target.isShowing())
+ {
+ Graphics g = target.getGraphics();
+ if (g != null)
+ {
+ try
+ {
+ Rectangle clip = pe.getUpdateRect();
+ g.setClip(clip);
+ target.paint(g);
+ }
+ finally
+ {
+ g.dispose();
+ }
+ }
+ }
+ }
+ }
- public void hide() {}
+ public void hide()
+ {
+ // Nothing to do here for lightweights.
+ }
public boolean isFocusable()
{
+ // Nothing to do here for lightweights.
return false;
}
public boolean isFocusTraversable()
{
+ // Nothing to do here for lightweights.
return false;
}
public Dimension minimumSize()
{
- return getMinimumSize();
+ return new Dimension(0, 0);
}
public Dimension preferredSize()
{
- return getPreferredSize();
+ return new Dimension(0, 0);
}
- public void paint(Graphics graphics) {}
+ public void paint(Graphics graphics)
+ {
+ // Nothing to do here for lightweights.
+ }
public boolean prepareImage(Image img, int width, int height,
ImageObserver o)
{
- return comp.getToolkit().prepareImage(img, width, height, o);
+ // Nothing to do here for lightweights.
+ return false;
}
- public void print(Graphics graphics) {}
+ public void print(Graphics graphics)
+ {
+ // Nothing to do here for lightweights.
+ }
public void repaint(long tm, int x, int y, int width, int height)
{
- Component p = comp.getParent();
- if (p != null)
- p.repaint(tm, x + comp.getX(), y + comp.getY(), width, height);
+ // Nothing to do here for lightweights.
}
- public void requestFocus() {}
+ public void requestFocus()
+ {
+ // Nothing to do here for lightweights.
+ }
- public boolean requestFocus(Component source, boolean bool1, boolean bool2, long x)
+ public boolean requestFocus(Component source, boolean bool1, boolean bool2,
+ long x)
{
+ // Nothing to do here for lightweights.
return false;
}
- public void reshape(int x, int y, int width, int height) {}
+ public void reshape(int x, int y, int width, int height)
+ {
+ // Nothing to do here for lightweights.
+ }
- public void setBackground(Color color) {}
+ public void setBackground(Color color)
+ {
+ // Nothing to do here for lightweights.
+ }
- public void setBounds(int x, int y, int width, int height) {}
+ public void setBounds(int x, int y, int width, int height)
+ {
+ // Nothing to do here for lightweights.
+ }
/**
* Sets the cursor on the heavy-weight parent peer.
@@ -256,110 +312,141 @@ public class GLightweightPeer
*/
public void setCursor(Cursor cursor)
{
- Component p = comp.getParent();
- while (p != null && p.isLightweight())
- p = p.getParent();
-
- if (p != null)
- {
- // Don't actually change the cursor of the component
- // otherwise other childs inherit this cursor.
- ComponentPeer peer = p.getPeer();
- if (peer != null)
- peer.setCursor(cursor);
- }
+ // Nothing to do here for lightweights.
}
- public void setEnabled(boolean enabled) {}
+ public void setEnabled(boolean enabled)
+ {
+ // Nothing to do here for lightweights.
+ }
- public void setEventMask(long eventMask) {}
+ public void setEventMask(long eventMask)
+ {
+ // Nothing to do here for lightweights.
+ }
- public void setFont(Font font) {}
+ public void setFont(Font font)
+ {
+ // Nothing to do here for lightweights.
+ }
- public void setForeground(Color color) {}
+ public void setForeground(Color color)
+ {
+ // Nothing to do here for lightweights.
+ }
- public void setVisible(boolean visible) {}
+ public void setVisible(boolean visible)
+ {
+ // Nothing to do here for lightweights.
+ }
- public void show() {}
+ public void show()
+ {
+ // Nothing to do here for lightweights.
+ }
- public ColorModel getColorModel ()
+ public ColorModel getColorModel()
{
- return comp.getColorModel ();
+ // Nothing to do here for lightweights.
+ return null;
}
public boolean isObscured()
{
+ // Nothing to do here for lightweights.
return false;
}
public boolean canDetermineObscurity()
{
+ // Nothing to do here for lightweights.
return false;
}
- public void coalescePaintEvent(PaintEvent e) { }
+ public void coalescePaintEvent(PaintEvent e)
+ {
+ // Nothing to do here for lightweights.
+ }
- public void updateCursorImmediately() { }
+ public void updateCursorImmediately()
+ {
+ // Nothing to do here for lightweights.
+ }
public VolatileImage createVolatileImage(int width, int height)
{
+ // Nothing to do here for lightweights.
return null;
}
public boolean handlesWheelScrolling()
{
+ // Nothing to do here for lightweights.
return false;
}
public void createBuffers(int x, BufferCapabilities capabilities)
- throws AWTException { }
+ throws AWTException
+ {
+ // Nothing to do here for lightweights.
+ }
public Image getBackBuffer()
{
+ // Nothing to do here for lightweights.
return null;
}
- public void flip(BufferCapabilities.FlipContents contents) { }
+ public void flip(BufferCapabilities.FlipContents contents)
+ {
+ // Nothing to do here for lightweights.
+ }
- public void destroyBuffers() { }
+ public void destroyBuffers()
+ {
+ // Nothing to do here for lightweights.
+ }
public boolean isRestackSupported()
{
+ // Nothing to do here for lightweights.
return false;
}
public void cancelPendingPaint(int x, int y, int width, int height)
{
-
+ // Nothing to do here for lightweights.
}
public void restack()
{
-
+ // Nothing to do here for lightweights.
}
public Rectangle getBounds()
{
+ // Nothing to do here for lightweights.
return null;
}
public void reparent(ContainerPeer parent)
{
-
+ // Nothing to do here for lightweights.
}
public void setBounds(int x, int y, int z, int width, int height)
{
-
+ // Nothing to do here for lightweights.
}
public boolean isReparentSupported()
{
- return false;
+ // Nothing to do here for lightweights.
+ return true;
}
public void layout()
{
-
+ // Nothing to do here for lightweights.
}
}
diff --git a/libjava/classpath/gnu/java/awt/peer/NativeEventLoopRunningEvent.java b/libjava/classpath/gnu/java/awt/peer/NativeEventLoopRunningEvent.java
new file mode 100644
index 00000000000..962ecd9904e
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/peer/NativeEventLoopRunningEvent.java
@@ -0,0 +1,58 @@
+/* NativeEventLoopRunningEvent.java -- communicates to EventQueue the
+ state of the native event loop
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.java.awt.peer;
+
+import java.awt.AWTEvent;
+
+public class NativeEventLoopRunningEvent
+ extends AWTEvent
+{
+ private boolean running;
+
+ public NativeEventLoopRunningEvent(Object source)
+ {
+ super(source, 2999);
+ running = ((Boolean) source).booleanValue();
+ }
+
+ public boolean isRunning()
+ {
+ return running;
+ }
+}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/AsyncImage.java b/libjava/classpath/gnu/java/awt/peer/gtk/AsyncImage.java
new file mode 100644
index 00000000000..5238bfe7410
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/AsyncImage.java
@@ -0,0 +1,283 @@
+/* AsyncImage.java -- Loads images asynchronously
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.peer.gtk;
+
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.image.ImageConsumer;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+
+/**
+ * Supports asynchronous loading of images.
+ */
+public class AsyncImage
+ extends Image
+{
+
+ /**
+ * Returned as source as long as the image is not complete.
+ */
+ private class NullImageSource
+ implements ImageProducer
+ {
+ private ArrayList consumers;
+
+ NullImageSource()
+ {
+ consumers = new ArrayList();
+ }
+
+ public void addConsumer(ImageConsumer ic)
+ {
+ consumers.add(ic);
+ }
+
+ public boolean isConsumer(ImageConsumer ic)
+ {
+ return consumers.contains(ic);
+ }
+
+ public void removeConsumer(ImageConsumer ic)
+ {
+ consumers.remove(ic);
+ }
+
+ public void requestTopDownLeftRightResend(ImageConsumer ic)
+ {
+ startProduction(ic);
+ }
+
+ public void startProduction(ImageConsumer ic)
+ {
+ consumers.add(ic);
+ for (int i = consumers.size() - 1; i >= 0; i--)
+ {
+ ImageConsumer c = (ImageConsumer) consumers.get(i);
+ c.setDimensions(1, 1);
+ ic.imageComplete(ImageConsumer.SINGLEFRAMEDONE);
+ }
+ }
+
+ }
+
+ /**
+ * Loads the image asynchronously.
+ */
+ private class Loader
+ implements Runnable
+ {
+ private URL url;
+ Loader(URL u)
+ {
+ url = u;
+ }
+
+ public void run()
+ {
+ Image image;
+ try
+ {
+ GtkImage gtkImage = new GtkImage(url);
+ image = CairoSurface.getBufferedImage(gtkImage);
+ }
+ catch (IllegalArgumentException iae)
+ {
+ image = null;
+ }
+ realImage = GtkToolkit.imageOrError(image);
+ synchronized (AsyncImage.this)
+ {
+ notifyObservers(ImageObserver.ALLBITS | ImageObserver.HEIGHT
+ | ImageObserver.WIDTH | ImageObserver.PROPERTIES);
+ observers = null; // Not needed anymore.
+ }
+ }
+ }
+
+ /**
+ * The real image. This is null as long as the image is not complete.
+ */
+ Image realImage;
+
+ /**
+ * The image observers.
+ *
+ * This is package private to avoid accessor methods.
+ */
+ HashSet observers;
+
+ /**
+ * Creates a new AsyncImage that loads from the specified URL.
+ */
+ AsyncImage(URL url)
+ {
+ observers = new HashSet();
+ Loader l = new Loader(url);
+ Thread t = new Thread(l);
+ t.start();
+ }
+
+ public void flush()
+ {
+ // Nothing to do here.
+ }
+
+ public Graphics getGraphics()
+ {
+ Image r = realImage;
+ Graphics g = null;
+ if (r != null)
+ g = r.getGraphics(); // Should we return some dummy graphics instead?
+ return g;
+ }
+
+ public int getHeight(ImageObserver observer)
+ {
+ addObserver(observer);
+ int height = 0;
+ Image r = realImage;
+ if (r != null)
+ height = r.getHeight(observer);
+ return height;
+ }
+
+ public Object getProperty(String name, ImageObserver observer)
+ {
+ addObserver(observer);
+ Image r = realImage;
+ Object prop = null;
+ if (r != null)
+ prop = r.getProperty(name, observer);
+ return prop;
+ }
+
+ public ImageProducer getSource()
+ {
+ Image r = realImage;
+ ImageProducer source;
+ if (r == null)
+ source = new NullImageSource();
+ else
+ source = r.getSource();
+ return source;
+ }
+
+ public int getWidth(ImageObserver observer)
+ {
+ addObserver(observer);
+ int width = 0;
+ Image r = realImage;
+ if (r != null)
+ width = r.getWidth(observer);
+ return width;
+ }
+
+ void addObserver(ImageObserver obs)
+ {
+ if (obs != null)
+ {
+ synchronized (this)
+ {
+ // This field gets null when image loading is complete and we don't
+ // need to store any more observers.
+ HashSet observs = observers;
+ if (observs != null)
+ {
+ observs.add(obs);
+ }
+ else
+ {
+ // When the image is complete, notify the observer. Dunno if
+ // that's really needed, but to be sure.
+ obs.imageUpdate(this, ImageObserver.WIDTH
+ | ImageObserver.HEIGHT
+ |ImageObserver.ALLBITS
+ | ImageObserver.PROPERTIES, 0, 0,
+ realImage.getWidth(null),
+ realImage.getHeight(null));
+ }
+ }
+ }
+ }
+
+ static Image realImage(Image img, ImageObserver obs)
+ {
+ if (img instanceof AsyncImage)
+ {
+ ((AsyncImage) img).addObserver(obs);
+ Image r = ((AsyncImage) img).realImage;
+ if (r != null)
+ img = r;
+ }
+ return img;
+ }
+
+ void notifyObservers(int status)
+ {
+ assert Thread.holdsLock(this);
+ // This field gets null when image loading is complete.
+ HashSet observs = observers;
+ if (observs != null)
+ {
+ Image r = realImage;
+ Iterator i = observs.iterator();
+ while (i.hasNext())
+ {
+ ImageObserver obs = (ImageObserver) i.next();
+ obs.imageUpdate(this, status, 0, 0, r.getWidth(null),
+ r.getHeight(null));
+ }
+ }
+ }
+
+ int checkImage(ImageObserver obs)
+ {
+ addObserver(obs);
+ int flags = 0;
+ if (realImage != null)
+ flags = ImageObserver.ALLBITS | ImageObserver.WIDTH
+ | ImageObserver.HEIGHT | ImageObserver.PROPERTIES;
+ return flags;
+ }
+}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/BufferedImageGraphics.java b/libjava/classpath/gnu/java/awt/peer/gtk/BufferedImageGraphics.java
index 6a74eabc5d6..c792645d3e8 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/BufferedImageGraphics.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/BufferedImageGraphics.java
@@ -38,22 +38,27 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
+import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics;
+import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.Shape;
+import java.awt.Toolkit;
import java.awt.font.GlyphVector;
import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
-import java.awt.image.DataBuffer;
-import java.awt.image.DataBufferInt;
import java.awt.image.ColorModel;
-import java.awt.image.DirectColorModel;
-import java.awt.image.RenderedImage;
+import java.awt.image.DataBufferInt;
import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
+import java.awt.image.Raster;
+import java.awt.image.RenderedImage;
+import java.awt.image.SinglePixelPackedSampleModel;
import java.util.WeakHashMap;
/**
@@ -67,7 +72,13 @@ public class BufferedImageGraphics extends CairoGraphics2D
/**
* the buffered Image.
*/
- private BufferedImage image;
+ private BufferedImage image, buffer;
+
+ /**
+ * Allows us to lock the image from updates (if we want to perform a few
+ * intermediary operations on the cairo surface, then update it all at once)
+ */
+ private boolean locked;
/**
* Image size.
@@ -89,12 +100,6 @@ public class BufferedImageGraphics extends CairoGraphics2D
*/
private long cairo_t;
- /**
- * Colormodels we recognize for fast copying.
- */
- static ColorModel rgb32 = new DirectColorModel(32, 0xFF0000, 0xFF00, 0xFF);
- static ColorModel argb32 = new DirectColorModel(32, 0xFF0000, 0xFF00, 0xFF,
- 0xFF000000);
private boolean hasFastCM;
private boolean hasAlpha;
@@ -104,15 +109,19 @@ public class BufferedImageGraphics extends CairoGraphics2D
this.image = bi;
imageWidth = bi.getWidth();
imageHeight = bi.getHeight();
- if(bi.getColorModel().equals(rgb32))
+ locked = false;
+
+ if (!(image.getSampleModel() instanceof SinglePixelPackedSampleModel))
+ hasFastCM = false;
+ else if(bi.getColorModel().equals(CairoSurface.cairoCM_opaque))
{
hasFastCM = true;
hasAlpha = false;
}
- else if(bi.getColorModel().equals(argb32))
+ else if(bi.getColorModel().equals(CairoSurface.cairoColorModel))
{
hasFastCM = true;
- hasAlpha = false;
+ hasAlpha = true;
}
else
hasFastCM = false;
@@ -128,27 +137,45 @@ public class BufferedImageGraphics extends CairoGraphics2D
cairo_t = surface.newCairoContext();
- DataBuffer db = bi.getRaster().getDataBuffer();
+ // Get pixels out of buffered image and set in cairo surface
+ Raster raster = bi.getRaster();
int[] pixels;
- // get pixels
- if(db instanceof CairoSurface)
- pixels = ((CairoSurface)db).getPixels(imageWidth * imageHeight);
+ if (hasFastCM)
+ {
+ SinglePixelPackedSampleModel sm = (SinglePixelPackedSampleModel)image.getSampleModel();
+ int minX = image.getRaster().getSampleModelTranslateX();
+ int minY = image.getRaster().getSampleModelTranslateY();
+
+ // Pull pixels directly out of data buffer
+ if(raster instanceof CairoSurface)
+ pixels = ((CairoSurface)raster).getPixels(raster.getWidth() * raster.getHeight());
+ else
+ pixels = ((DataBufferInt)raster.getDataBuffer()).getData();
+
+ // Discard pixels that fall outside of the image's bounds
+ // (ie, this image is actually a subimage of a different image)
+ if (!(sm.getScanlineStride() == imageWidth && minX == 0 && minY == 0))
+ {
+ int[] pixels2 = new int[imageWidth * imageHeight];
+ int scanline = sm.getScanlineStride();
+
+ for (int i = 0; i < imageHeight; i++)
+ System.arraycopy(pixels, (i - minY) * scanline - minX, pixels2, i * imageWidth, imageWidth);
+
+ pixels = pixels2;
+ }
+
+ // Fill the alpha channel as opaque if image does not have alpha
+ if( !hasAlpha )
+ for(int i = 0; i < pixels.length; i++)
+ pixels[i] &= 0xFFFFFFFF;
+ }
else
{
- if( hasFastCM )
- {
- pixels = ((DataBufferInt)db).getData();
- if( !hasAlpha )
- for(int i = 0; i < pixels.length; i++)
- pixels[i] &= 0xFFFFFFFF;
- }
- else
- {
- pixels = CairoGraphics2D.findSimpleIntegerArray
- (image.getColorModel(),image.getData());
- }
+ pixels = CairoGraphics2D.findSimpleIntegerArray(image.getColorModel(),image.getData());
}
+
surface.setPixels( pixels );
setup( cairo_t );
@@ -157,12 +184,17 @@ public class BufferedImageGraphics extends CairoGraphics2D
BufferedImageGraphics(BufferedImageGraphics copyFrom)
{
+ image = copyFrom.image;
surface = copyFrom.surface;
cairo_t = surface.newCairoContext();
imageWidth = copyFrom.imageWidth;
imageHeight = copyFrom.imageHeight;
+ locked = false;
+
+ hasFastCM = copyFrom.hasFastCM;
+ hasAlpha = copyFrom.hasAlpha;
+
copy( copyFrom, cairo_t );
- setClip(0, 0, surface.width, surface.height);
}
/**
@@ -170,25 +202,82 @@ public class BufferedImageGraphics extends CairoGraphics2D
*/
private void updateBufferedImage(int x, int y, int width, int height)
{
+ if (locked)
+ return;
+
+ double[] points = new double[]{x, y, width+x, height+y};
+ transform.transform(points, 0, points, 0, 2);
+ x = (int)points[0];
+ y = (int)points[1];
+ width = (int)Math.ceil(points[2] - points[0]);
+ height = (int)Math.ceil(points[3] - points[1]);
+
int[] pixels = surface.getPixels(imageWidth * imageHeight);
if( x > imageWidth || y > imageHeight )
return;
+
+ // Deal with negative width/height.
+ if (height < 0)
+ {
+ y += height;
+ height = -height;
+ }
+ if (width < 0)
+ {
+ x += width;
+ width = -width;
+ }
+
// Clip edges.
- if( x < 0 ){ width = width + x; x = 0; }
- if( y < 0 ){ height = height + y; y = 0; }
+ if( x < 0 )
+ x = 0;
+ if( y < 0 )
+ y = 0;
+
if( x + width > imageWidth )
width = imageWidth - x;
if( y + height > imageHeight )
height = imageHeight - y;
-
- if( !hasFastCM )
- image.setRGB(x, y, width, height, pixels,
- x + y * imageWidth, imageWidth);
+
+ if(!hasFastCM)
+ {
+ image.setRGB(x, y, width, height, pixels,
+ x + y * imageWidth, imageWidth);
+ // The setRGB method assumes (or should assume) that pixels are NOT
+ // alpha-premultiplied, but Cairo stores data with premultiplication
+ // (thus the pixels returned in getPixels are premultiplied).
+ // This is ignored for consistency, however, since in
+ // CairoGrahpics2D.drawImage we also use non-premultiplied data
+
+ }
else
- System.arraycopy(pixels, y * imageWidth,
- ((DataBufferInt)image.getRaster().getDataBuffer()).
- getData(), y * imageWidth, height * imageWidth);
+ {
+ int[] db = ((DataBufferInt)image.getRaster().getDataBuffer()).
+ getData();
+
+ // This should not fail, as we check the image sample model when we
+ // set the hasFastCM flag
+ SinglePixelPackedSampleModel sm = (SinglePixelPackedSampleModel)image.getSampleModel() ;
+
+ int minX = image.getRaster().getSampleModelTranslateX();
+ int minY = image.getRaster().getSampleModelTranslateY();
+
+ if (sm.getScanlineStride() == imageWidth && minX == 0)
+ {
+ System.arraycopy(pixels, y * imageWidth,
+ db, (y - minY) * imageWidth,
+ height * imageWidth);
+ }
+ else
+ {
+ int scanline = sm.getScanlineStride();
+ for (int i = y; i < (height + y); i++)
+ System.arraycopy(pixels, i * imageWidth + x, db,
+ (i - minY) * scanline + x - minX, width);
+
+ }
+ }
}
/**
@@ -221,36 +310,246 @@ public class BufferedImageGraphics extends CairoGraphics2D
*/
public void draw(Shape s)
{
- super.draw(s);
- Rectangle r = s.getBounds();
- updateBufferedImage(r.x, r.y, r.width, r.height);
+ // Find total bounds of shape
+ Rectangle r = findStrokedBounds(s);
+ if (shiftDrawCalls)
+ {
+ r.width++;
+ r.height++;
+ }
+
+ // Do the drawing
+ if (comp == null || comp instanceof AlphaComposite)
+ {
+ super.draw(s);
+ updateBufferedImage(r.x, r.y, r.width, r.height);
+ }
+ else
+ {
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setStroke(this.getStroke());
+ g2d.setColor(this.getColor());
+ g2d.setTransform(transform);
+ g2d.draw(s);
+
+ drawComposite(r.getBounds2D(), null);
+ }
}
public void fill(Shape s)
{
- super.fill(s);
- Rectangle r = s.getBounds();
- updateBufferedImage(r.x, r.y, r.width, r.height);
+ if (comp == null || comp instanceof AlphaComposite)
+ {
+ super.fill(s);
+ Rectangle r = s.getBounds();
+ updateBufferedImage(r.x, r.y, r.width, r.height);
+ }
+ else
+ {
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setPaint(this.getPaint());
+ g2d.setColor(this.getColor());
+ g2d.setTransform(transform);
+ g2d.fill(s);
+
+ drawComposite(s.getBounds2D(), null);
+ }
}
public void drawRenderedImage(RenderedImage image, AffineTransform xform)
{
- super.drawRenderedImage(image, xform);
- updateBufferedImage(0, 0, imageWidth, imageHeight);
+ if (comp == null || comp instanceof AlphaComposite)
+ {
+ super.drawRenderedImage(image, xform);
+ updateBufferedImage(0, 0, imageWidth, imageHeight);
+ }
+ else
+ {
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setRenderingHints(this.getRenderingHints());
+ g2d.setTransform(transform);
+ g2d.drawRenderedImage(image, xform);
+
+ drawComposite(buffer.getRaster().getBounds(), null);
+ }
+
}
protected boolean drawImage(Image img, AffineTransform xform,
Color bgcolor, ImageObserver obs)
{
- boolean rv = super.drawImage(img, xform, bgcolor, obs);
- updateBufferedImage(0, 0, imageWidth, imageHeight);
- return rv;
+ if (comp == null || comp instanceof AlphaComposite)
+ {
+ boolean rv = super.drawImage(img, xform, bgcolor, obs);
+ updateBufferedImage(0, 0, imageWidth, imageHeight);
+ return rv;
+ }
+ else
+ {
+ // Get buffered image of source
+ if( !(img instanceof BufferedImage) )
+ {
+ ImageProducer source = img.getSource();
+ if (source == null)
+ return false;
+ img = Toolkit.getDefaultToolkit().createImage(source);
+ }
+ BufferedImage bImg = (BufferedImage) img;
+
+ // Find translated bounds
+ Point2D origin = new Point2D.Double(bImg.getMinX(), bImg.getMinY());
+ Point2D pt = new Point2D.Double(bImg.getWidth() + bImg.getMinX(),
+ bImg.getHeight() + bImg.getMinY());
+ if (xform != null)
+ {
+ origin = xform.transform(origin, origin);
+ pt = xform.transform(pt, pt);
+ }
+
+ // Create buffer and draw image
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setRenderingHints(this.getRenderingHints());
+ g2d.drawImage(img, xform, obs);
+
+ // Perform compositing
+ return drawComposite(new Rectangle2D.Double(origin.getX(),
+ origin.getY(),
+ pt.getX(), pt.getY()),
+ obs);
+ }
}
public void drawGlyphVector(GlyphVector gv, float x, float y)
{
- super.drawGlyphVector(gv, x, y);
- updateBufferedImage(0, 0, imageWidth, imageHeight);
+ // Find absolute bounds, in user-space, of this glyph vector
+ Rectangle2D bounds = gv.getLogicalBounds();
+ bounds = new Rectangle2D.Double(x + bounds.getX(), y + bounds.getY(),
+ bounds.getWidth(), bounds.getHeight());
+
+ // Perform draw operation
+ if (comp == null || comp instanceof AlphaComposite)
+ {
+ super.drawGlyphVector(gv, x, y);
+ updateBufferedImage((int)bounds.getX(), (int)bounds.getY(),
+ (int)bounds.getWidth(), (int)bounds.getHeight());
+ }
+ else
+ {
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setPaint(this.getPaint());
+ g2d.setStroke(this.getStroke());
+ g2d.setTransform(transform);
+ g2d.drawGlyphVector(gv, x, y);
+
+ drawComposite(bounds, null);
+ }
+ }
+
+ /**
+ * Perform composite drawing from the buffer onto the main image.
+ *
+ * The image to be composited should already be drawn into the buffer, in the
+ * proper place, after all necessary transforms have been applied.
+ *
+ * @param bounds The bounds to draw, in user-space.
+ * @param observer The image observer, if any (may be null).
+ * @return True on success, false on failure.
+ */
+ private boolean drawComposite(Rectangle2D bounds, ImageObserver observer)
+ {
+ // Find bounds in device space
+ double[] points = new double[] {bounds.getX(), bounds.getY(),
+ bounds.getMaxX(), bounds.getMaxY()};
+ transform.transform(points, 0, points, 0, 2);
+ bounds = new Rectangle2D.Double(points[0], points[1],
+ (points[2] - points[0]),
+ (points[3] - points[1]));
+
+ // Clip bounds by the stored clip, and by the internal buffer
+ Rectangle2D devClip = this.getClipInDevSpace();
+ Rectangle2D.intersect(bounds, devClip, bounds);
+ devClip = new Rectangle(buffer.getMinX(), buffer.getMinY(),
+ buffer.getWidth(), buffer.getHeight());
+ Rectangle2D.intersect(bounds, devClip, bounds);
+
+ // Round bounds as needed, but be conservative in our rounding
+ // (otherwise it may leave unpainted stripes)
+ double x = bounds.getX();
+ double y = bounds.getY();
+ double w = bounds.getWidth();
+ double h = bounds.getHeight();
+ if (Math.floor(x) != x)
+ w--;
+ if (Math.floor(y) != y)
+ h--;
+ bounds.setRect(Math.ceil(x), Math.ceil(y), Math.floor(w), Math.floor(h));
+
+ // Find subimage of internal buffer for updating
+ BufferedImage buffer2 = buffer;
+ if (!bounds.equals(buffer2.getRaster().getBounds()))
+ buffer2 = buffer2.getSubimage((int)bounds.getX(), (int)bounds.getY(),
+ (int)bounds.getWidth(),
+ (int)bounds.getHeight());
+
+ // Find subimage of main image for updating
+ BufferedImage current = image;
+ current = current.getSubimage((int)bounds.getX(), (int)bounds.getY(),
+ (int)bounds.getWidth(),
+ (int)bounds.getHeight());
+
+ // Perform actual composite operation
+ compCtx.compose(buffer2.getRaster(), current.getRaster(),
+ current.getRaster());
+
+ // Prevent the clearRect in CairoGraphics2D.drawImage from clearing
+ // our composited image
+ locked = true;
+
+ // This MUST call directly into the "action" method in CairoGraphics2D,
+ // not one of the wrappers, to ensure that the composite isn't processed
+ // more than once!
+ boolean rv = super.drawImage(current,
+ AffineTransform.getTranslateInstance(bounds.getX(),
+ bounds.getY()),
+ new Color(0,0,0,0), null);
+ locked = false;
+ return rv;
+ }
+
+ private void createBuffer()
+ {
+ if (buffer == null)
+ {
+ buffer = new BufferedImage(image.getWidth(), image.getHeight(),
+ BufferedImage.TYPE_INT_ARGB);
+ }
+ else
+ {
+ Graphics2D g2d = ((Graphics2D)buffer.getGraphics());
+
+ g2d.setBackground(new Color(0,0,0,0));
+ g2d.clearRect(0, 0, buffer.getWidth(), buffer.getHeight());
+ }
+ }
+
+ protected ColorModel getNativeCM()
+ {
+ return image.getColorModel();
+ }
+
+ protected ColorModel getBufferCM()
+ {
+ return ColorModel.getRGBdefault();
}
}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java b/libjava/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java
index b665f562e25..348801800d2 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java
@@ -45,6 +45,7 @@ import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Composite;
+import java.awt.CompositeContext;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.GradientPaint;
@@ -53,6 +54,8 @@ import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.Image;
import java.awt.Paint;
+import java.awt.PaintContext;
+import java.awt.Point;
import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.RenderingHints;
@@ -68,6 +71,7 @@ import java.awt.geom.Arc2D;
import java.awt.geom.Area;
import java.awt.geom.Ellipse2D;
import java.awt.geom.GeneralPath;
+import java.awt.geom.Line2D;
import java.awt.geom.NoninvertibleTransformException;
import java.awt.geom.PathIterator;
import java.awt.geom.Point2D;
@@ -131,6 +135,7 @@ public abstract class CairoGraphics2D extends Graphics2D
* The current paint
*/
Paint paint;
+ boolean customPaint;
/**
* The current stroke
@@ -161,6 +166,7 @@ public abstract class CairoGraphics2D extends Graphics2D
* The current compositing context, if any.
*/
Composite comp;
+ CompositeContext compCtx;
/**
* Rendering hint map.
@@ -172,7 +178,7 @@ public abstract class CairoGraphics2D extends Graphics2D
* coords be shifted to land on 0.5-pixel boundaries, in order to land on
* "middle of pixel" coordinates and light up complete pixels.
*/
- private boolean shiftDrawCalls = false;
+ protected boolean shiftDrawCalls = false;
/**
* Keep track if the first clip to be set, which is restored on setClip(null);
@@ -190,6 +196,18 @@ public abstract class CairoGraphics2D extends Graphics2D
0xFF000000);
/**
+ * Native constants for interpolation methods.
+ * Note, this corresponds to an enum in native/jni/gtk-peer/cairographics2d.h
+ */
+ public static final int INTERPOLATION_NEAREST = 0,
+ INTERPOLATION_BILINEAR = 1,
+ INTERPOLATION_BICUBIC = 5,
+ ALPHA_INTERPOLATION_SPEED = 2,
+ ALPHA_INTERPOLATION_QUALITY = 3,
+ ALPHA_INTERPOLATION_DEFAULT = 4;
+ // TODO: Does ALPHA_INTERPOLATION really correspond to CAIRO_FILTER_FAST/BEST/GOOD?
+
+ /**
* Constructor does nothing.
*/
public CairoGraphics2D()
@@ -204,7 +222,7 @@ public abstract class CairoGraphics2D extends Graphics2D
{
nativePointer = init(cairo_t_pointer);
setRenderingHints(new RenderingHints(getDefaultHints()));
- font = new Font("SansSerif", Font.PLAIN, 12);
+ setFont(new Font("SansSerif", Font.PLAIN, 12));
setColor(Color.black);
setBackground(Color.white);
setPaint(Color.black);
@@ -239,6 +257,8 @@ public abstract class CairoGraphics2D extends Graphics2D
bg = new Color(g.bg.getRGB());
}
+ firstClip = g.firstClip;
+ originalClip = g.originalClip;
clip = g.getClip();
if (g.transform == null)
@@ -246,14 +266,14 @@ public abstract class CairoGraphics2D extends Graphics2D
else
transform = new AffineTransform(g.transform);
- font = g.font;
-
+ setFont(g.font);
setColor(foreground);
setBackground(bg);
setPaint(paint);
setStroke(stroke);
setTransformImpl(transform);
setClip(clip);
+ setComposite(comp);
}
/**
@@ -274,6 +294,8 @@ public abstract class CairoGraphics2D extends Graphics2D
{
disposeNative(nativePointer);
nativePointer = 0;
+ if (compCtx != null)
+ compCtx.dispose();
}
/**
@@ -293,6 +315,11 @@ public abstract class CairoGraphics2D extends Graphics2D
int width, int height, int dx, int dy);
+ /**
+ * Find the bounds of this graphics context, in device space.
+ *
+ * @return the bounds in device-space
+ */
protected abstract Rectangle2D getRealBounds();
////// Native Methods ////////////////////////////////////////////////////
@@ -309,15 +336,17 @@ public abstract class CairoGraphics2D extends Graphics2D
* @param i2u - affine transform array
*/
private native void drawPixels(long pointer, int[] pixels, int w, int h,
- int stride, double[] i2u, double alpha);
+ int stride, double[] i2u, double alpha,
+ int interpolation);
private native void setGradient(long pointer, double x1, double y1,
double x2, double y2,
int r1, int g1, int b1, int a1, int r2,
int g2, int b2, int a2, boolean cyclic);
- private native void setTexturePixels(long pointer, int[] pixels, int w,
- int h, int stride);
+ private native void setPaintPixels(long pointer, int[] pixels, int w,
+ int h, int stride, boolean repeat,
+ int x, int y);
/**
* Set the current transform matrix
@@ -365,6 +394,10 @@ public abstract class CairoGraphics2D extends Graphics2D
float x, float y, int n,
int[] codes, float[] positions);
+ /**
+ * Set the font in cairo.
+ */
+ private native void cairoSetFont(long pointer, GdkFontPeer font);
private native void cairoRelCurveTo(long pointer, double dx1, double dy1,
double dx2, double dy2, double dx3,
@@ -441,11 +474,6 @@ public abstract class CairoGraphics2D extends Graphics2D
private native void cairoResetClip(long pointer);
/**
- * Set interpolation types
- */
- private native void cairoSurfaceSetFilter(long pointer, int filter);
-
- /**
* Draws a line from (x1,y1) to (x2,y2).
*
* @param pointer the native pointer
@@ -666,13 +694,14 @@ public abstract class CairoGraphics2D extends Graphics2D
public void setPaint(Paint p)
{
- if (paint == null)
+ if (p == null)
return;
paint = p;
if (paint instanceof Color)
{
setColor((Color) paint);
+ customPaint = false;
}
else if (paint instanceof TexturePaint)
{
@@ -690,7 +719,8 @@ public abstract class CairoGraphics2D extends Graphics2D
AffineTransformOp op = new AffineTransformOp(at, getRenderingHints());
BufferedImage texture = op.filter(img, null);
int[] pixels = texture.getRGB(0, 0, width, height, null, 0, width);
- setTexturePixels(nativePointer, pixels, width, height, width);
+ setPaintPixels(nativePointer, pixels, width, height, width, true, 0, 0);
+ customPaint = false;
}
else if (paint instanceof GradientPaint)
{
@@ -703,9 +733,108 @@ public abstract class CairoGraphics2D extends Graphics2D
c1.getRed(), c1.getGreen(), c1.getBlue(), c1.getAlpha(),
c2.getRed(), c2.getGreen(), c2.getBlue(), c2.getAlpha(),
gp.isCyclic());
+ customPaint = false;
}
else
- throw new java.lang.UnsupportedOperationException();
+ {
+ customPaint = true;
+ }
+ }
+
+ /**
+ * Sets a custom paint
+ *
+ * @param bounds the bounding box, in user space
+ */
+ protected void setCustomPaint(Rectangle bounds)
+ {
+ if (paint instanceof Color || paint instanceof TexturePaint
+ || paint instanceof GradientPaint)
+ return;
+
+ int userX = bounds.x;
+ int userY = bounds.y;
+ int userWidth = bounds.width;
+ int userHeight = bounds.height;
+
+ // Find bounds in device space
+ Point2D origin = transform.transform(new Point2D.Double(userX, userY),
+ null);
+ Point2D extreme = transform.transform(new Point2D.Double(userWidth + userX,
+ userHeight + userY),
+ null);
+ int deviceX = (int)origin.getX();
+ int deviceY = (int)origin.getY();
+ int deviceWidth = (int)Math.ceil(extreme.getX() - origin.getX());
+ int deviceHeight = (int)Math.ceil(extreme.getY() - origin.getY());
+
+ // Get raster of the paint background
+ PaintContext pc = paint.createContext(CairoSurface.cairoColorModel,
+ new Rectangle(deviceX, deviceY,
+ deviceWidth,
+ deviceHeight),
+ bounds,
+ transform, hints);
+
+ Raster raster = pc.getRaster(deviceX, deviceY, deviceWidth,
+ deviceHeight);
+
+ // Clear the transform matrix in Cairo, since the raster returned by the
+ // PaintContext is already in device-space
+ AffineTransform oldTx = new AffineTransform(transform);
+ setTransformImpl(new AffineTransform());
+
+ // Set pixels in cairo, aligning the top-left of the background image
+ // to the top-left corner in device space
+ if (pc.getColorModel().equals(CairoSurface.cairoColorModel)
+ && raster.getSampleModel().getTransferType() == DataBuffer.TYPE_INT)
+ {
+ // Use a fast copy if the paint context can uses a Cairo-compatible
+ // color model
+ setPaintPixels(nativePointer,
+ (int[])raster.getDataElements(0, 0, deviceWidth,
+ deviceHeight, null),
+ deviceWidth, deviceHeight, deviceWidth, false,
+ deviceX, deviceY);
+ }
+
+ else if (pc.getColorModel().equals(CairoSurface.cairoCM_opaque)
+ && raster.getSampleModel().getTransferType() == DataBuffer.TYPE_INT)
+ {
+ // We can also optimize if the context uses a similar color model
+ // but without an alpha channel; we just add the alpha
+ int[] pixels = (int[])raster.getDataElements(0, 0, deviceWidth,
+ deviceHeight, null);
+
+ for (int i = 0; i < pixels.length; i++)
+ pixels[i] = 0xff000000 | (pixels[i] & 0x00ffffff);
+
+ setPaintPixels(nativePointer, pixels, deviceWidth, deviceHeight,
+ deviceWidth, false, deviceX, deviceY);
+ }
+
+ else
+ {
+ // Fall back on wrapping the raster in a BufferedImage, and
+ // use BufferedImage.getRGB() to do color-model conversion
+ WritableRaster wr = Raster.createWritableRaster(raster.getSampleModel(),
+ new Point(raster.getMinX(),
+ raster.getMinY()));
+ wr.setRect(raster);
+
+ BufferedImage img2 = new BufferedImage(pc.getColorModel(), wr,
+ pc.getColorModel().isAlphaPremultiplied(),
+ null);
+
+ setPaintPixels(nativePointer,
+ img2.getRGB(0, 0, deviceWidth, deviceHeight, null, 0,
+ deviceWidth),
+ deviceWidth, deviceHeight, deviceWidth, false,
+ deviceX, deviceY);
+ }
+
+ // Restore transform
+ setTransformImpl(oldTx);
}
public Stroke getStroke()
@@ -736,6 +865,33 @@ public abstract class CairoGraphics2D extends Graphics2D
}
}
+ /**
+ * Utility method to find the bounds of a shape, including the stroke width.
+ *
+ * @param s the shape
+ * @return the bounds of the shape, including stroke width
+ */
+ protected Rectangle findStrokedBounds(Shape s)
+ {
+ Rectangle r = s.getBounds();
+
+ if (stroke instanceof BasicStroke)
+ {
+ int strokeWidth = (int)Math.ceil(((BasicStroke)stroke).getLineWidth());
+ r.x -= strokeWidth / 2;
+ r.y -= strokeWidth / 2;
+ r.height += strokeWidth;
+ r.width += strokeWidth;
+ }
+ else
+ {
+ Shape s2 = stroke.createStrokedShape(s);
+ r = s2.getBounds();
+ }
+
+ return r;
+ }
+
public void setPaintMode()
{
setComposite(AlphaComposite.SrcOver);
@@ -896,25 +1052,56 @@ public abstract class CairoGraphics2D extends Graphics2D
*/
public void setComposite(Composite comp)
{
+ if (this.comp == comp)
+ return;
+
this.comp = comp;
+ if (compCtx != null)
+ compCtx.dispose();
+ compCtx = null;
if (comp instanceof AlphaComposite)
{
AlphaComposite a = (AlphaComposite) comp;
- cairoSetOperator(nativePointer, a.getRule());
+ cairoSetOperator(nativePointer, a.getRule());
}
+
else
{
- // FIXME: this check is only required "if this Graphics2D
- // context is drawing to a Component on the display screen".
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission(new AWTPermission("readDisplayPixels"));
-
- // FIXME: implement general Composite support
- throw new java.lang.UnsupportedOperationException();
+ cairoSetOperator(nativePointer, AlphaComposite.SRC_OVER);
+
+ if (comp != null)
+ {
+ // FIXME: this check is only required "if this Graphics2D
+ // context is drawing to a Component on the display screen".
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ sm.checkPermission(new AWTPermission("readDisplayPixels"));
+
+ compCtx = comp.createContext(getBufferCM(), getNativeCM(), hints);
+ }
}
}
+
+ /**
+ * Returns the Colour Model describing the native, raw image data for this
+ * specific peer.
+ *
+ * @return ColorModel the ColorModel of native data in this peer
+ */
+ protected abstract ColorModel getNativeCM();
+
+ /**
+ * Returns the Color Model describing the buffer that this peer uses
+ * for custom composites.
+ *
+ * @return ColorModel the ColorModel of the composite buffer in this peer.
+ */
+ protected ColorModel getBufferCM()
+ {
+ // This may be overridden by some subclasses
+ return getNativeCM();
+ }
///////////////////////// DRAWING PRIMITIVES ///////////////////////////////////
@@ -929,21 +1116,30 @@ public abstract class CairoGraphics2D extends Graphics2D
return;
}
- createPath(s);
+ if (customPaint)
+ {
+ Rectangle r = findStrokedBounds(s);
+ setCustomPaint(r);
+ }
+
+ createPath(s, true);
cairoStroke(nativePointer);
}
public void fill(Shape s)
{
- createPath(s);
+ createPath(s, false);
+ if (customPaint)
+ setCustomPaint(s.getBounds());
+
double alpha = 1.0;
if (comp instanceof AlphaComposite)
alpha = ((AlphaComposite) comp).getAlpha();
cairoFill(nativePointer, alpha);
}
- private void createPath(Shape s)
+ private void createPath(Shape s, boolean isDraw)
{
cairoNewPath(nativePointer);
@@ -951,9 +1147,25 @@ public abstract class CairoGraphics2D extends Graphics2D
if (s instanceof Rectangle2D)
{
Rectangle2D r = (Rectangle2D) s;
- cairoRectangle(nativePointer, shifted(r.getX(), shiftDrawCalls),
- shifted(r.getY(), shiftDrawCalls), r.getWidth(),
- r.getHeight());
+
+ // Pixels need to be shifted in draw operations to ensure that they
+ // light up entire pixels, but we also need to make sure the rectangle
+ // does not get distorted by this shifting operation
+ double x = shiftX(r.getX(),shiftDrawCalls && isDraw);
+ double y = shiftY(r.getY(), shiftDrawCalls && isDraw);
+ double w = Math.round(r.getWidth());
+ double h = Math.round(r.getHeight());
+ cairoRectangle(nativePointer, x, y, w, h);
+ }
+
+ // Lines are easy too
+ else if (s instanceof Line2D)
+ {
+ Line2D l = (Line2D) s;
+ cairoMoveTo(nativePointer, shiftX(l.getX1(), shiftDrawCalls && isDraw),
+ shiftY(l.getY1(), shiftDrawCalls && isDraw));
+ cairoLineTo(nativePointer, shiftX(l.getX2(), shiftDrawCalls && isDraw),
+ shiftY(l.getY2(), shiftDrawCalls && isDraw));
}
// We can optimize ellipses too; however we don't bother optimizing arcs:
@@ -982,9 +1194,9 @@ public abstract class CairoGraphics2D extends Graphics2D
}
cairoArc(nativePointer,
- shifted(e.getCenterX() / xscale, shiftDrawCalls),
- shifted(e.getCenterY() / yscale, shiftDrawCalls), radius, 0,
- Math.PI * 2);
+ shiftX(e.getCenterX() / xscale, shiftDrawCalls && isDraw),
+ shiftY(e.getCenterY() / yscale, shiftDrawCalls && isDraw),
+ radius, 0, Math.PI * 2);
if (xscale != 1 || yscale != 1)
cairoRestore(nativePointer);
@@ -993,7 +1205,7 @@ public abstract class CairoGraphics2D extends Graphics2D
// All other shapes are broken down and drawn in steps using the
// PathIterator
else
- walkPath(s.getPathIterator(null), shiftDrawCalls);
+ walkPath(s.getPathIterator(null), shiftDrawCalls && isDraw);
}
/**
@@ -1006,8 +1218,14 @@ public abstract class CairoGraphics2D extends Graphics2D
{
if (bg != null)
cairoSetRGBAColor(nativePointer, bg.getRed() / 255.0,
- bg.getGreen() / 255.0, bg.getBlue() / 255.0, 1.0);
+ bg.getGreen() / 255.0, bg.getBlue() / 255.0,
+ bg.getAlpha() / 255.0);
+
+ Composite oldcomp = comp;
+ setComposite(AlphaComposite.Src);
fillRect(x, y, width, height);
+
+ setComposite(oldcomp);
updateColor();
}
@@ -1033,15 +1251,14 @@ public abstract class CairoGraphics2D extends Graphics2D
// to draw a single pixel. This is emulated by drawing
// a one pixel sized rectangle.
if (x1 == x2 && y1 == y2)
- cairoFillRect(nativePointer, x1, y1, 1, 1);
+ fill(new Rectangle(x1, y1, 1, 1));
else
- cairoDrawLine(nativePointer, x1 + 0.5, y1 + 0.5, x2 + 0.5, y2 + 0.5);
+ draw(new Line2D.Double(x1, y1, x2, y2));
}
public void drawRect(int x, int y, int width, int height)
{
- cairoDrawRect(nativePointer, shifted(x, shiftDrawCalls),
- shifted(y, shiftDrawCalls), width, height);
+ draw(new Rectangle(x, y, width, height));
}
public void fillArc(int x, int y, int width, int height, int startAngle,
@@ -1049,12 +1266,12 @@ public abstract class CairoGraphics2D extends Graphics2D
{
fill(new Arc2D.Double((double) x, (double) y, (double) width,
(double) height, (double) startAngle,
- (double) arcAngle, Arc2D.OPEN));
+ (double) arcAngle, Arc2D.PIE));
}
public void fillRect(int x, int y, int width, int height)
{
- cairoFillRect(nativePointer, x, y, width, height);
+ fill (new Rectangle(x, y, width, height));
}
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
@@ -1117,7 +1334,7 @@ public abstract class CairoGraphics2D extends Graphics2D
Rectangle2D r = getRealBounds();
- if( width < 0 || height < 0 )
+ if( width <= 0 || height <= 0 )
return;
// Return if outside the surface
if( x + dx > r.getWidth() || y + dy > r.getHeight() )
@@ -1150,32 +1367,10 @@ public abstract class CairoGraphics2D extends Graphics2D
///////////////////////// RENDERING HINTS ///////////////////////////////////
- /**
- * FIXME- support better
- */
public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
{
hints.put(hintKey, hintValue);
- if (hintKey.equals(RenderingHints.KEY_INTERPOLATION)
- || hintKey.equals(RenderingHints.KEY_ALPHA_INTERPOLATION))
- {
- if (hintValue.equals(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR))
- cairoSurfaceSetFilter(nativePointer, 0);
-
- else if (hintValue.equals(RenderingHints.VALUE_INTERPOLATION_BILINEAR))
- cairoSurfaceSetFilter(nativePointer, 1);
-
- else if (hintValue.equals(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED))
- cairoSurfaceSetFilter(nativePointer, 2);
-
- else if (hintValue.equals(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY))
- cairoSurfaceSetFilter(nativePointer, 3);
-
- else if (hintValue.equals(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT))
- cairoSurfaceSetFilter(nativePointer, 4);
- }
-
shiftDrawCalls = hints.containsValue(RenderingHints.VALUE_STROKE_NORMALIZE)
|| hints.containsValue(RenderingHints.VALUE_STROKE_DEFAULT);
}
@@ -1189,30 +1384,15 @@ public abstract class CairoGraphics2D extends Graphics2D
{
this.hints = new RenderingHints(getDefaultHints());
this.hints.add(new RenderingHints(hints));
-
- if (hints.containsKey(RenderingHints.KEY_INTERPOLATION))
- {
- if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR))
- cairoSurfaceSetFilter(nativePointer, 0);
-
- else if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR))
- cairoSurfaceSetFilter(nativePointer, 1);
- }
-
- if (hints.containsKey(RenderingHints.KEY_ALPHA_INTERPOLATION))
- {
- if (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED))
- cairoSurfaceSetFilter(nativePointer, 2);
-
- else if (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY))
- cairoSurfaceSetFilter(nativePointer, 3);
-
- else if (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT))
- cairoSurfaceSetFilter(nativePointer, 4);
- }
-
+
shiftDrawCalls = hints.containsValue(RenderingHints.VALUE_STROKE_NORMALIZE)
|| hints.containsValue(RenderingHints.VALUE_STROKE_DEFAULT);
+
+ if (compCtx != null)
+ {
+ compCtx.dispose();
+ compCtx = comp.createContext(getNativeCM(), getNativeCM(), this.hints);
+ }
}
public void addRenderingHints(Map hints)
@@ -1224,6 +1404,30 @@ public abstract class CairoGraphics2D extends Graphics2D
{
return hints;
}
+
+ private int getInterpolation()
+ {
+ if (this.hints.containsValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR))
+ return INTERPOLATION_NEAREST;
+
+ else if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR))
+ return INTERPOLATION_BILINEAR;
+
+ else if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BICUBIC))
+ return INTERPOLATION_BICUBIC;
+
+ else if (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED))
+ return ALPHA_INTERPOLATION_SPEED;
+
+ else if (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY))
+ return ALPHA_INTERPOLATION_QUALITY;
+
+ else if (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT))
+ return ALPHA_INTERPOLATION_DEFAULT;
+
+ // Do bilinear interpolation as default
+ return INTERPOLATION_BILINEAR;
+ }
///////////////////////// IMAGE. METHODS ///////////////////////////////////
@@ -1259,7 +1463,7 @@ public abstract class CairoGraphics2D extends Graphics2D
// Note - this can get us in trouble when the gdk lock is re-acquired.
// for example by VolatileImage. See ComponentGraphics for how we work
// around this.
-
+ img = AsyncImage.realImage(img, obs);
if( !(img instanceof BufferedImage) )
{
ImageProducer source = img.getSource();
@@ -1269,18 +1473,18 @@ public abstract class CairoGraphics2D extends Graphics2D
}
BufferedImage b = (BufferedImage) img;
- DataBuffer db;
+ Raster raster;
double[] i2u = new double[6];
int width = b.getWidth();
int height = b.getHeight();
-
+
// If this BufferedImage has a BufferedImageGraphics object,
// use the cached CairoSurface that BIG is drawing onto
if( BufferedImageGraphics.bufferedImages.get( b ) != null )
- db = (DataBuffer)BufferedImageGraphics.bufferedImages.get( b );
+ raster = (Raster)BufferedImageGraphics.bufferedImages.get( b );
else
- db = b.getRaster().getDataBuffer();
+ raster = b.getRaster();
invertedXform.getMatrix(i2u);
@@ -1288,29 +1492,37 @@ public abstract class CairoGraphics2D extends Graphics2D
if (comp instanceof AlphaComposite)
alpha = ((AlphaComposite) comp).getAlpha();
- if(db instanceof CairoSurface)
+ if(raster instanceof CairoSurface)
{
- ((CairoSurface)db).drawSurface(nativePointer, i2u, alpha);
+ ((CairoSurface)raster).drawSurface(nativePointer, i2u, alpha,
+ getInterpolation());
updateColor();
return true;
}
if( bgcolor != null )
{
- // Fill a rectangle with the background color
- // to composite the image onto.
- Paint oldPaint = paint;
- AffineTransform oldTransform = transform;
- setPaint( bgcolor );
- setTransform( invertedXform );
- fillRect(0, 0, width, height);
- setTransform( oldTransform );
- setPaint( oldPaint );
+ Color oldColor = bg;
+ setBackground(bgcolor);
+
+ double[] origin = new double[] {0,0};
+ double[] dimensions = new double[] {width, height};
+ xform.transform(origin, 0, origin, 0, 1);
+ xform.deltaTransform(dimensions, 0, dimensions, 0, 1);
+ clearRect((int)origin[0], (int)origin[1],
+ (int)dimensions[0], (int)dimensions[1]);
+
+ setBackground(oldColor);
}
int[] pixels = b.getRGB(0, 0, width, height, null, 0, width);
+
+ // FIXME: The above method returns data in the standard ARGB colorspace,
+ // meaning data should NOT be alpha pre-multiplied; however Cairo expects
+ // data to be premultiplied.
- drawPixels(nativePointer, pixels, width, height, width, i2u, alpha);
+ drawPixels(nativePointer, pixels, width, height, width, i2u, alpha,
+ getInterpolation());
// Cairo seems to lose the current color which must be restored.
updateColor();
@@ -1428,8 +1640,14 @@ public abstract class CairoGraphics2D extends Graphics2D
{
if (str == null || str.length() == 0)
return;
- (new TextLayout( str, getFont(), getFontRenderContext() )).
- draw(this, x, y);
+ GdkFontPeer fontPeer = (GdkFontPeer) font.getPeer();
+ TextLayout tl = (TextLayout) fontPeer.textLayoutCache.get(str);
+ if (tl == null)
+ {
+ tl = new TextLayout( str, getFont(), getFontRenderContext() );
+ fontPeer.textLayoutCache.put(str, tl);
+ }
+ tl.draw(this, x, y);
}
public void drawString(String str, int x, int y)
@@ -1449,6 +1667,9 @@ public abstract class CairoGraphics2D extends Graphics2D
if( gv.getNumGlyphs() <= 0 )
return;
+ if (customPaint)
+ setCustomPaint(gv.getOutline().getBounds());
+
if (comp instanceof AlphaComposite)
alpha = ((AlphaComposite) comp).getAlpha();
if (gv instanceof FreetypeGlyphVector && alpha == 1.0)
@@ -1458,9 +1679,10 @@ public abstract class CairoGraphics2D extends Graphics2D
float[] positions = gv.getGlyphPositions (0, n, null);
setFont (gv.getFont ());
- synchronized( this.font )
+ GdkFontPeer fontPeer = (GdkFontPeer) font.getPeer();
+ synchronized (fontPeer)
{
- cairoDrawGlyphVector(nativePointer, (GdkFontPeer)getFont().getPeer(),
+ cairoDrawGlyphVector(nativePointer, fontPeer,
x, y, n, codes, positions);
}
}
@@ -1498,9 +1720,7 @@ public abstract class CairoGraphics2D extends Graphics2D
public FontMetrics getFontMetrics(Font f)
{
- // the reason we go via the toolkit here is to try to get
- // a cached object. the toolkit keeps such a cache.
- return Toolkit.getDefaultToolkit().getFontMetrics(f);
+ return ((GdkFontPeer) f.getPeer()).getFontMetrics(f);
}
public void setFont(Font f)
@@ -1516,6 +1736,12 @@ public abstract class CairoGraphics2D extends Graphics2D
font =
((ClasspathToolkit)(Toolkit.getDefaultToolkit()))
.getFont(f.getName(), f.getAttributes());
+
+ GdkFontPeer fontpeer = (GdkFontPeer) getFont().getPeer();
+ synchronized (fontpeer)
+ {
+ cairoSetFont(nativePointer, fontpeer);
+ }
}
public Font getFont()
@@ -1626,7 +1852,7 @@ public abstract class CairoGraphics2D extends Graphics2D
if (comp instanceof AlphaComposite)
alpha = ((AlphaComposite) comp).getAlpha();
drawPixels(nativePointer, pixels, r.getWidth(), r.getHeight(),
- r.getWidth(), i2u, alpha);
+ r.getWidth(), i2u, alpha, getInterpolation());
// Cairo seems to lose the current color which must be restored.
updateColor();
@@ -1635,12 +1861,33 @@ public abstract class CairoGraphics2D extends Graphics2D
}
/**
- * Shifts coordinates by 0.5.
+ * Shifts an x-coordinate by 0.5 in device space.
+ */
+ private double shiftX(double coord, boolean doShift)
+ {
+ if (doShift)
+ {
+ double shift = 0.5;
+ if (!transform.isIdentity())
+ shift /= transform.getScaleX();
+ return Math.round(coord) + shift;
+ }
+ else
+ return coord;
+ }
+
+ /**
+ * Shifts a y-coordinate by 0.5 in device space.
*/
- private double shifted(double coord, boolean doShift)
+ private double shiftY(double coord, boolean doShift)
{
if (doShift)
- return Math.floor(coord) + 0.5;
+ {
+ double shift = 0.5;
+ if (!transform.isIdentity())
+ shift /= transform.getScaleY();
+ return Math.round(coord) + shift;
+ }
else
return coord;
}
@@ -1661,35 +1908,35 @@ public abstract class CairoGraphics2D extends Graphics2D
switch (seg)
{
case PathIterator.SEG_MOVETO:
- x = shifted(coords[0], doShift);
- y = shifted(coords[1], doShift);
+ x = shiftX(coords[0], doShift);
+ y = shiftY(coords[1], doShift);
cairoMoveTo(nativePointer, x, y);
break;
case PathIterator.SEG_LINETO:
- x = shifted(coords[0], doShift);
- y = shifted(coords[1], doShift);
+ x = shiftX(coords[0], doShift);
+ y = shiftY(coords[1], doShift);
cairoLineTo(nativePointer, x, y);
break;
case PathIterator.SEG_QUADTO:
// splitting a quadratic bezier into a cubic:
// see: http://pfaedit.sourceforge.net/bezier.html
- double x1 = x + (2.0 / 3.0) * (shifted(coords[0], doShift) - x);
- double y1 = y + (2.0 / 3.0) * (shifted(coords[1], doShift) - y);
+ double x1 = x + (2.0 / 3.0) * (shiftX(coords[0], doShift) - x);
+ double y1 = y + (2.0 / 3.0) * (shiftY(coords[1], doShift) - y);
- double x2 = x1 + (1.0 / 3.0) * (shifted(coords[2], doShift) - x);
- double y2 = y1 + (1.0 / 3.0) * (shifted(coords[3], doShift) - y);
+ double x2 = x1 + (1.0 / 3.0) * (shiftX(coords[2], doShift) - x);
+ double y2 = y1 + (1.0 / 3.0) * (shiftY(coords[3], doShift) - y);
- x = shifted(coords[2], doShift);
- y = shifted(coords[3], doShift);
+ x = shiftX(coords[2], doShift);
+ y = shiftY(coords[3], doShift);
cairoCurveTo(nativePointer, x1, y1, x2, y2, x, y);
break;
case PathIterator.SEG_CUBICTO:
- x = shifted(coords[4], doShift);
- y = shifted(coords[5], doShift);
- cairoCurveTo(nativePointer, shifted(coords[0], doShift),
- shifted(coords[1], doShift),
- shifted(coords[2], doShift),
- shifted(coords[3], doShift), x, y);
+ x = shiftX(coords[4], doShift);
+ y = shiftY(coords[5], doShift);
+ cairoCurveTo(nativePointer, shiftX(coords[0], doShift),
+ shiftY(coords[1], doShift),
+ shiftX(coords[2], doShift),
+ shiftY(coords[3], doShift), x, y);
break;
case PathIterator.SEG_CLOSE:
cairoClosePath(nativePointer);
@@ -1807,4 +2054,4 @@ public abstract class CairoGraphics2D extends Graphics2D
return rect;
}
-}
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/CairoSurface.java b/libjava/classpath/gnu/java/awt/peer/gtk/CairoSurface.java
index 78bc1e02db0..5b63e62e7ed 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/CairoSurface.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/CairoSurface.java
@@ -38,14 +38,18 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.Point;
+import gnu.java.awt.Buffers;
+
import java.awt.Graphics2D;
-import java.awt.image.DataBuffer;
-import java.awt.image.Raster;
-import java.awt.image.WritableRaster;
+import java.awt.Point;
+import java.awt.color.ColorSpace;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
+import java.awt.image.DataBuffer;
import java.awt.image.DirectColorModel;
+import java.awt.image.SampleModel;
+import java.awt.image.SinglePixelPackedSampleModel;
+import java.awt.image.WritableRaster;
import java.nio.ByteOrder;
import java.util.Hashtable;
@@ -54,7 +58,7 @@ import java.util.Hashtable;
*
* @author Sven de Marothy
*/
-public class CairoSurface extends DataBuffer
+public class CairoSurface extends WritableRaster
{
int width = -1, height = -1;
@@ -68,13 +72,27 @@ public class CairoSurface extends DataBuffer
*/
long bufferPointer;
-
- static ColorModel nativeModel = new DirectColorModel(32,
- 0x00FF0000,
- 0x0000FF00,
- 0x000000FF,
- 0xFF000000);
-
+ // FIXME: use only the cairoCM_pre colormodel
+ // since that's what Cairo really uses (is there a way to do this cheaply?
+ // we use a non-multiplied model most of the time to avoid costly coercion
+ // operations...)
+ static ColorModel cairoColorModel = new DirectColorModel(32, 0x00FF0000,
+ 0x0000FF00,
+ 0x000000FF,
+ 0xFF000000);
+
+ static ColorModel cairoCM_pre = new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+ 32, 0x00FF0000,
+ 0x0000FF00,
+ 0x000000FF,
+ 0xFF000000,
+ true,
+ Buffers.smallestAppropriateTransferType(32));
+
+ // This CM corresponds to the CAIRO_FORMAT_RGB24 type in Cairo
+ static ColorModel cairoCM_opaque = new DirectColorModel(24, 0x00FF0000,
+ 0x0000FF00,
+ 0x000000FF);
/**
* Allocates and clears the buffer and creates the cairo surface.
* @param width, height - the image size
@@ -102,11 +120,13 @@ public class CairoSurface extends DataBuffer
* with an affine transform given by i2u.
*/
public native void nativeDrawSurface(long surfacePointer, long contextPointer,
- double[] i2u, double alpha);
+ double[] i2u, double alpha,
+ int interpolation);
- public void drawSurface(long contextPointer, double[] i2u, double alpha)
+ public void drawSurface(long contextPointer, double[] i2u, double alpha,
+ int interpolation)
{
- nativeDrawSurface(surfacePointer, contextPointer, i2u, alpha);
+ nativeDrawSurface(surfacePointer, contextPointer, i2u, alpha, interpolation);
}
/**
@@ -138,18 +158,20 @@ public class CairoSurface extends DataBuffer
*/
public CairoSurface(int width, int height)
{
- super(DataBuffer.TYPE_INT, width * height);
+ super(createCairoSampleModel(width, height),
+ null, new Point(0, 0));
if(width <= 0 || height <= 0)
throw new IllegalArgumentException("Image must be at least 1x1 pixels.");
-
+
this.width = width;
this.height = height;
-
create(width, height, width);
if(surfacePointer == 0 || bufferPointer == 0)
throw new Error("Could not allocate bitmap.");
+
+ dataBuffer = new CairoDataBuffer();
}
/**
@@ -158,18 +180,7 @@ public class CairoSurface extends DataBuffer
*/
CairoSurface(GtkImage image)
{
- super(DataBuffer.TYPE_INT, image.width * image.height);
-
- if(image.width <= 0 || image.height <= 0)
- throw new IllegalArgumentException("Image must be at least 1x1 pixels.");
-
- width = image.width;
- height = image.height;
-
- create(width, height, width);
-
- if(surfacePointer == 0 || bufferPointer == 0)
- throw new Error("Could not allocate bitmap.");
+ this(image.width, image.height);
// Copy the pixel data from the GtkImage.
int[] data = image.getPixels();
@@ -260,32 +271,37 @@ public class CairoSurface extends DataBuffer
*/
public static BufferedImage getBufferedImage(CairoSurface surface)
{
- WritableRaster raster = Raster.createPackedRaster
- (surface, surface.width, surface.height, surface.width,
- new int[]{ 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 },
- new Point(0,0));
-
- return new BufferedImage(nativeModel, raster, true, new Hashtable());
+ return new BufferedImage(cairoColorModel, surface,
+ cairoColorModel.isAlphaPremultiplied(),
+ new Hashtable());
}
- /**
- * DataBank.getElem implementation
- */
- public int getElem(int bank, int i)
+ private class CairoDataBuffer extends DataBuffer
{
- if(bank != 0 || i < 0 || i >= width*height)
- throw new IndexOutOfBoundsException(i+" size: "+width*height);
- return nativeGetElem(bufferPointer, i);
- }
+ public CairoDataBuffer()
+ {
+ super(DataBuffer.TYPE_INT, width * height);
+ }
+
+ /**
+ * DataBuffer.getElem implementation
+ */
+ public int getElem(int bank, int i)
+ {
+ if(bank != 0 || i < 0 || i >= width * height)
+ throw new IndexOutOfBoundsException(i+" size: "+width * height);
+ return nativeGetElem(bufferPointer, i);
+ }
- /**
- * DataBank.setElem implementation
- */
- public void setElem(int bank, int i, int val)
- {
- if(bank != 0 || i < 0 || i >= width*height)
- throw new IndexOutOfBoundsException(i+" size: "+width*height);
- nativeSetElem(bufferPointer, i, val);
+ /**
+ * DataBuffer.setElem implementation
+ */
+ public void setElem(int bank, int i, int val)
+ {
+ if(bank != 0 || i < 0 || i >= width*height)
+ throw new IndexOutOfBoundsException(i+" size: "+width * height);
+ nativeSetElem(bufferPointer, i, val);
+ }
}
/**
@@ -319,4 +335,14 @@ public class CairoSurface extends DataBuffer
{
copyAreaNative2(bufferPointer, x, y, width, height, dx, dy, stride);
}
+
+ /**
+ * Creates a SampleModel that matches Cairo's native format
+ */
+ protected static SampleModel createCairoSampleModel(int w, int h)
+ {
+ return new SinglePixelPackedSampleModel(DataBuffer.TYPE_INT, w, h,
+ new int[]{0x00FF0000, 0x0000FF00,
+ 0x000000FF, 0xFF000000});
+ }
}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java b/libjava/classpath/gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java
index 7bd136c3845..36743b9c2da 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java
@@ -38,10 +38,26 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
+import java.awt.AlphaComposite;
+import java.awt.Color;
import java.awt.Graphics;
-import java.awt.GraphicsEnvironment;
+import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.Toolkit;
+import java.awt.font.GlyphVector;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
+import java.awt.image.RenderedImage;
+import java.util.Hashtable;
/**
* Implementation of Graphics2D on a Cairo surface.
@@ -49,6 +65,7 @@ import java.awt.geom.Rectangle2D;
public class CairoSurfaceGraphics extends CairoGraphics2D
{
protected CairoSurface surface;
+ private BufferedImage buffer;
private long cairo_t;
/**
@@ -59,6 +76,7 @@ public class CairoSurfaceGraphics extends CairoGraphics2D
this.surface = surface;
cairo_t = surface.newCairoContext();
setup( cairo_t );
+ setClip(0, 0, surface.width, surface.height);
}
/**
@@ -91,4 +109,200 @@ public class CairoSurfaceGraphics extends CairoGraphics2D
{
surface.copyAreaNative(x, y, width, height, dx, dy, surface.width);
}
+
+ /**
+ * Overloaded methods that do actual drawing need to account for custom
+ * composites
+ */
+ public void draw(Shape s)
+ {
+ if (comp == null || comp instanceof AlphaComposite)
+ super.draw(s);
+
+ else
+ {
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setStroke(this.getStroke());
+ g2d.setColor(this.getColor());
+ g2d.draw(s);
+
+ drawComposite(s.getBounds2D(), null);
+ }
+ }
+
+ public void fill(Shape s)
+ {
+ if (comp == null || comp instanceof AlphaComposite)
+ super.fill(s);
+
+ else
+ {
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setPaint(this.getPaint());
+ g2d.setColor(this.getColor());
+ g2d.fill(s);
+
+ drawComposite(s.getBounds2D(), null);
+ }
+ }
+
+ public void drawRenderedImage(RenderedImage image, AffineTransform xform)
+ {
+ if (comp == null || comp instanceof AlphaComposite)
+ super.drawRenderedImage(image, xform);
+
+ else
+ {
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setRenderingHints(this.getRenderingHints());
+ g2d.drawRenderedImage(image, xform);
+
+ drawComposite(buffer.getRaster().getBounds(), null);
+ }
+
+ }
+
+ protected boolean drawImage(Image img, AffineTransform xform,
+ Color bgcolor, ImageObserver obs)
+ {
+ if (comp == null || comp instanceof AlphaComposite)
+ return super.drawImage(img, xform, bgcolor, obs);
+
+ else
+ {
+ // Get buffered image of source
+ if( !(img instanceof BufferedImage) )
+ {
+ ImageProducer source = img.getSource();
+ if (source == null)
+ return false;
+ img = Toolkit.getDefaultToolkit().createImage(source);
+ }
+ BufferedImage bImg = (BufferedImage) img;
+
+ // Find translated bounds
+ Point2D origin = new Point2D.Double(bImg.getMinX(), bImg.getMinY());
+ Point2D pt = new Point2D.Double(bImg.getWidth() + bImg.getMinX(),
+ bImg.getHeight() + bImg.getMinY());
+ if (xform != null)
+ {
+ origin = xform.transform(origin, origin);
+ pt = xform.transform(pt, pt);
+ }
+
+ // Create buffer and draw image
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setRenderingHints(this.getRenderingHints());
+ g2d.drawImage(img, xform, obs);
+
+ // Perform compositing
+ return drawComposite(new Rectangle2D.Double(origin.getX(),
+ origin.getY(),
+ pt.getX(), pt.getY()),
+ obs);
+ }
+ }
+
+ public void drawGlyphVector(GlyphVector gv, float x, float y)
+ {
+ if (comp == null || comp instanceof AlphaComposite)
+ super.drawGlyphVector(gv, x, y);
+
+ else
+ {
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setPaint(this.getPaint());
+ g2d.setStroke(this.getStroke());
+ g2d.drawGlyphVector(gv, x, y);
+
+ Rectangle2D bounds = gv.getLogicalBounds();
+ bounds = new Rectangle2D.Double(x + bounds.getX(), y + bounds.getY(),
+ bounds.getWidth(), bounds.getHeight());
+ drawComposite(bounds, null);
+ }
+ }
+
+ private boolean drawComposite(Rectangle2D bounds, ImageObserver observer)
+ {
+ // Clip source to visible areas that need updating
+ Rectangle2D clip = this.getClipBounds();
+ Rectangle2D.intersect(bounds, clip, bounds);
+ clip = new Rectangle(buffer.getMinX(), buffer.getMinY(),
+ buffer.getWidth(), buffer.getHeight());
+ Rectangle2D.intersect(bounds, clip, bounds);
+
+ BufferedImage buffer2 = buffer;
+ if (!bounds.equals(buffer2.getRaster().getBounds()))
+ buffer2 = buffer2.getSubimage((int)bounds.getX(), (int)bounds.getY(),
+ (int)bounds.getWidth(),
+ (int)bounds.getHeight());
+
+ // Get destination clip to bounds
+ double[] points = new double[] {bounds.getX(), bounds.getY(),
+ bounds.getMaxX(), bounds.getMaxY()};
+ transform.transform(points, 0, points, 0, 2);
+
+ Rectangle2D deviceBounds = new Rectangle2D.Double(points[0], points[1],
+ points[2] - points[0],
+ points[3] - points[1]);
+
+ Rectangle2D.intersect(deviceBounds, this.getClipInDevSpace(), deviceBounds);
+
+ BufferedImage current = CairoSurface.getBufferedImage(surface);
+ current = current.getSubimage((int)deviceBounds.getX(),
+ (int)deviceBounds.getY(),
+ (int)deviceBounds.getWidth(),
+ (int)deviceBounds.getHeight());
+
+ // Perform actual composite operation
+ compCtx.compose(buffer2.getRaster(), current.getRaster(),
+ buffer2.getRaster());
+
+ // This MUST call directly into the "action" method in CairoGraphics2D,
+ // not one of the wrappers, to ensure that the composite isn't processed
+ // more than once!
+ boolean rv = super.drawImage(buffer2,
+ AffineTransform.getTranslateInstance(bounds.getX(),
+ bounds.getY()),
+ new Color(0,0,0,0), null);
+ return rv;
+ }
+
+ private void createBuffer()
+ {
+ if (buffer == null)
+ {
+ buffer = new BufferedImage(getBufferCM(),
+ surface.createCompatibleWritableRaster(),
+ getBufferCM().isAlphaPremultiplied(),
+ new Hashtable());
+ }
+ else
+ {
+ Graphics2D g2d = ((Graphics2D)buffer.getGraphics());
+
+ g2d.setBackground(new Color(0,0,0,0));
+ g2d.clearRect(0, 0, buffer.getWidth(), buffer.getHeight());
+ }
+ }
+
+ protected ColorModel getNativeCM()
+ {
+ return CairoSurface.cairoCM_pre;
+ }
+
+ protected ColorModel getBufferCM()
+ {
+ return CairoSurface.cairoColorModel;
+ }
}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java b/libjava/classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java
index ffa78e9c904..763ad7dfddd 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java
@@ -38,22 +38,31 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
+import gnu.classpath.Pointer;
+
+import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.Image;
+import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.Toolkit;
import java.awt.font.GlyphVector;
import java.awt.geom.AffineTransform;
+import java.awt.geom.Line2D;
+import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
+import java.awt.image.Raster;
import java.awt.image.RenderedImage;
-import gnu.classpath.Pointer;
+import java.awt.image.WritableRaster;
+import java.util.Hashtable;
/**
* ComponentGraphics - context for drawing directly to a component,
@@ -67,36 +76,11 @@ public class ComponentGraphics extends CairoGraphics2D
private GtkComponentPeer component;
protected long cairo_t;
+ private BufferedImage buffer, componentBuffer;
private static ThreadLocal hasLock = new ThreadLocal();
private static Integer ONE = Integer.valueOf(1);
- private void lock()
- {
- Integer i = (Integer) hasLock.get();
- if (i == null)
- {
- start_gdk_drawing();
- hasLock.set(ONE);
- }
- else
- hasLock.set(Integer.valueOf(i.intValue() + 1));
- }
-
- private void unlock()
- {
- Integer i = (Integer) hasLock.get();
- if (i == null)
- throw new IllegalStateException();
- if (i == ONE)
- {
- hasLock.set(null);
- end_gdk_drawing();
- }
- else
- hasLock.set(Integer.valueOf(i.intValue() - 1));
- }
-
ComponentGraphics()
{
}
@@ -128,6 +112,32 @@ public class ComponentGraphics extends CairoGraphics2D
*/
private native long initState(GtkComponentPeer component);
+ private void lock()
+ {
+ Integer i = (Integer) hasLock.get();
+ if (i == null)
+ {
+ start_gdk_drawing();
+ hasLock.set(ONE);
+ }
+ else
+ hasLock.set(Integer.valueOf(i.intValue() + 1));
+ }
+
+ private void unlock()
+ {
+ Integer i = (Integer) hasLock.get();
+ if (i == null)
+ throw new IllegalStateException();
+ if (i == ONE)
+ {
+ hasLock.set(null);
+ end_gdk_drawing();
+ }
+ else
+ hasLock.set(Integer.valueOf(i.intValue() - 1));
+ }
+
/**
* Destroys the component surface and calls dispose on the cairo
* graphics2d to destroy any super class resources.
@@ -227,7 +237,20 @@ public class ComponentGraphics extends CairoGraphics2D
lock();
try
{
- super.draw(s);
+ if (comp == null || comp instanceof AlphaComposite)
+ super.draw(s);
+
+ else
+ {
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setStroke(this.getStroke());
+ g2d.setColor(this.getColor());
+ g2d.draw(s);
+
+ drawComposite(s.getBounds2D(), null);
+ }
}
finally
{
@@ -240,7 +263,20 @@ public class ComponentGraphics extends CairoGraphics2D
lock();
try
{
- super.fill(s);
+ if (comp == null || comp instanceof AlphaComposite)
+ super.fill(s);
+
+ else
+ {
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setPaint(this.getPaint());
+ g2d.setColor(this.getColor());
+ g2d.fill(s);
+
+ drawComposite(s.getBounds2D(), null);
+ }
}
finally
{
@@ -253,7 +289,19 @@ public class ComponentGraphics extends CairoGraphics2D
lock();
try
{
- super.drawRenderedImage(image, xform);
+ if (comp == null || comp instanceof AlphaComposite)
+ super.drawRenderedImage(image, xform);
+
+ else
+ {
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setRenderingHints(this.getRenderingHints());
+ g2d.drawRenderedImage(image, xform);
+
+ drawComposite(buffer.getRaster().getBounds(), null);
+ }
}
finally
{
@@ -268,7 +316,44 @@ public class ComponentGraphics extends CairoGraphics2D
lock();
try
{
- rv = super.drawImage(img, xform, bgcolor, obs);
+ if (comp == null || comp instanceof AlphaComposite)
+ rv = super.drawImage(img, xform, bgcolor, obs);
+
+ else
+ {
+ // Get buffered image of source
+ if( !(img instanceof BufferedImage) )
+ {
+ ImageProducer source = img.getSource();
+ if (source == null)
+ return false;
+ img = Toolkit.getDefaultToolkit().createImage(source);
+ }
+ BufferedImage bImg = (BufferedImage) img;
+
+ // Find translated bounds
+ Point2D origin = new Point2D.Double(bImg.getMinX(), bImg.getMinY());
+ Point2D pt = new Point2D.Double(bImg.getWidth() + bImg.getMinX(),
+ bImg.getHeight() + bImg.getMinY());
+ if (xform != null)
+ {
+ origin = xform.transform(origin, origin);
+ pt = xform.transform(pt, pt);
+ }
+
+ // Create buffer and draw image
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setRenderingHints(this.getRenderingHints());
+ g2d.drawImage(img, xform, obs);
+
+ // Perform compositing
+ rv = drawComposite(new Rectangle2D.Double(origin.getX(),
+ origin.getY(),
+ pt.getX(), pt.getY()),
+ obs);
+ }
}
finally
{
@@ -282,7 +367,23 @@ public class ComponentGraphics extends CairoGraphics2D
lock();
try
{
- super.drawGlyphVector(gv, x, y);
+ if (comp == null || comp instanceof AlphaComposite)
+ super.drawGlyphVector(gv, x, y);
+
+ else
+ {
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setPaint(this.getPaint());
+ g2d.setStroke(this.getStroke());
+ g2d.drawGlyphVector(gv, x, y);
+
+ Rectangle2D bounds = gv.getLogicalBounds();
+ bounds = new Rectangle2D.Double(x + bounds.getX(), y + bounds.getY(),
+ bounds.getWidth(), bounds.getHeight());
+ drawComposite(bounds, null);
+ }
}
finally
{
@@ -367,6 +468,7 @@ public class ComponentGraphics extends CairoGraphics2D
}
BufferedImage bimg;
+ img = AsyncImage.realImage(img, observer);
if (img instanceof BufferedImage)
bimg = (BufferedImage) img;
else
@@ -379,57 +481,112 @@ public class ComponentGraphics extends CairoGraphics2D
return super.drawImage(bimg, x, y, width, height, observer);
}
- public void drawLine(int x1, int y1, int x2, int y2)
+ public void setClip(Shape s)
{
lock();
try
{
- super.drawLine(x1, y1, x2, y2);
+ super.setClip(s);
}
finally
{
- unlock();
+ unlock();
}
}
- public void drawRect(int x, int y, int width, int height)
+
+ private boolean drawComposite(Rectangle2D bounds, ImageObserver observer)
{
+ // Clip source to visible areas that need updating
+ Rectangle2D clip = this.getClipBounds();
+ Rectangle2D.intersect(bounds, clip, bounds);
+ clip = new Rectangle(buffer.getMinX(), buffer.getMinY(),
+ buffer.getWidth(), buffer.getHeight());
+ Rectangle2D.intersect(bounds, clip, bounds);
+
+ BufferedImage buffer2 = buffer;
+ if (!bounds.equals(buffer2.getRaster().getBounds()))
+ buffer2 = buffer2.getSubimage((int)bounds.getX(), (int)bounds.getY(),
+ (int)bounds.getWidth(),
+ (int)bounds.getHeight());
+
+ // Get destination clip to bounds
+ double[] points = new double[] {bounds.getX(), bounds.getY(),
+ bounds.getMaxX(), bounds.getMaxY()};
+ transform.transform(points, 0, points, 0, 2);
+
+ Rectangle2D deviceBounds = new Rectangle2D.Double(points[0], points[1],
+ points[2] - points[0],
+ points[3] - points[1]);
+
+ Rectangle2D.intersect(deviceBounds, this.getClipInDevSpace(), deviceBounds);
+
+ // Get current image on the component
+ unlock();
+ GtkImage img = grab(component);
+ Graphics gr = componentBuffer.createGraphics();
+ gr.drawImage(img, 0, 0, null);
+ gr.dispose();
lock();
- try
- {
- super.drawRect(x, y, width, height);
- }
- finally
- {
- unlock();
- }
+
+ BufferedImage cBuffer = componentBuffer;
+ if (!deviceBounds.equals(cBuffer.getRaster().getBounds()))
+ cBuffer = cBuffer.getSubimage((int)deviceBounds.getX(),
+ (int)deviceBounds.getY(),
+ (int)deviceBounds.getWidth(),
+ (int)deviceBounds.getHeight());
+
+ // Perform actual composite operation
+ compCtx.compose(buffer2.getRaster(), cBuffer.getRaster(),
+ cBuffer.getRaster());
+
+ // This MUST call directly into the "action" method in CairoGraphics2D,
+ // not one of the wrappers, to ensure that the composite isn't processed
+ // more than once!
+ boolean rv = super.drawImage(cBuffer,
+ AffineTransform.getTranslateInstance(bounds.getX(),
+ bounds.getY()),
+ null, null);
+ return rv;
}
-
- public void fillRect(int x, int y, int width, int height)
+
+ private void createBuffer()
{
- lock();
- try
- {
- super.fillRect(x, y, width, height);
- }
- finally
+ if (buffer == null)
{
- unlock();
+ WritableRaster rst;
+ rst = Raster.createWritableRaster(GtkVolatileImage.createGdkSampleModel(component.awtComponent.getWidth(),
+ component.awtComponent.getHeight()),
+ new Point(0,0));
+
+ buffer = new BufferedImage(GtkVolatileImage.gdkColorModel, rst,
+ GtkVolatileImage.gdkColorModel.isAlphaPremultiplied(),
+ new Hashtable());
}
- }
-
- public void setClip(Shape s)
- {
- lock();
- try
+ else
{
- super.setClip(s);
+ Graphics2D g2d = ((Graphics2D)buffer.getGraphics());
+
+ g2d.setBackground(new Color(0,0,0,0));
+ g2d.clearRect(0, 0, buffer.getWidth(), buffer.getHeight());
}
- finally
+
+ if (componentBuffer == null)
{
- unlock();
+ WritableRaster rst;
+ rst = Raster.createWritableRaster(GtkVolatileImage.createGdkSampleModel(component.awtComponent.getWidth(),
+ component.awtComponent.getHeight()),
+ new Point(0,0));
+
+ componentBuffer = new BufferedImage(GtkVolatileImage.gdkColorModel, rst,
+ GtkVolatileImage.gdkColorModel.isAlphaPremultiplied(),
+ new Hashtable());
}
}
-
+
+ protected ColorModel getNativeCM()
+ {
+ return GtkVolatileImage.gdkColorModel;
+ }
}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java b/libjava/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
index 2c9d917934f..131a964488f 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
@@ -39,14 +39,15 @@ package gnu.java.awt.peer.gtk;
import java.awt.Font;
import java.awt.Shape;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Point2D;
-import java.awt.geom.Rectangle2D;
-import java.awt.geom.GeneralPath;
+import java.awt.font.FontRenderContext;
import java.awt.font.GlyphJustificationInfo;
import java.awt.font.GlyphMetrics;
import java.awt.font.GlyphVector;
-import java.awt.font.FontRenderContext;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.util.Arrays;
public class FreetypeGlyphVector extends GlyphVector
{
@@ -91,16 +92,17 @@ public class FreetypeGlyphVector extends GlyphVector
*/
public FreetypeGlyphVector(Font f, String s, FontRenderContext frc)
{
- this(f, s, frc, Font.LAYOUT_LEFT_TO_RIGHT);
+ this(f, s.toCharArray(), 0, s.length(), frc, Font.LAYOUT_LEFT_TO_RIGHT);
}
/**
* Create a glyphvector from a given (Freetype) font and a String.
*/
- public FreetypeGlyphVector(Font f, String s, FontRenderContext frc,
- int flags)
+ public FreetypeGlyphVector(Font f, char[] chars, int start, int len,
+ FontRenderContext frc, int flags)
{
- this.s = s;
+ this.s = new String(chars, start, len);
+
this.font = f;
this.frc = frc;
if( !(font.getPeer() instanceof GdkFontPeer ) )
@@ -155,14 +157,15 @@ public class FreetypeGlyphVector extends GlyphVector
}
glyphCodes = new int[ nGlyphs ];
- glyphPositions = new float[ nGlyphs ];
+ glyphPositions = new float[(nGlyphs + 1) * 2];
glyphTransforms = new AffineTransform[ nGlyphs ];
for(int i = 0; i < nGlyphs; i++ )
{
- glyphTransforms[ i ] = new AffineTransform( gv.glyphTransforms[ i ] );
- glyphCodes[i] = gv.glyphCodes[ i ];
- glyphPositions[i] = gv.glyphPositions[ i ];
+ glyphTransforms[ i ] = new AffineTransform( gv.glyphTransforms[ i ] );
+ glyphCodes[i] = gv.glyphCodes[ i ];
}
+ System.arraycopy(gv.glyphPositions, 0, glyphPositions, 0,
+ glyphPositions.length);
}
/**
@@ -178,10 +181,17 @@ public class FreetypeGlyphVector extends GlyphVector
for(int i = 0; i < nGlyphs; i++)
{
codePoints[i] = s.codePointAt( stringIndex );
- // UTF32 surrogate handling
+ // UTF32 surrogate handling
if( codePoints[i] != (int)s.charAt( stringIndex ) )
stringIndex ++;
stringIndex ++;
+
+ if (Character.isISOControl(codePoints[i]))
+ {
+ // Replace with 'hair space'. Should better be 'zero-width space'
+ // but that doesn't seem to be supported by default font.
+ codePoints[i] = 8202;
+ }
}
glyphCodes = getGlyphs( codePoints );
@@ -242,22 +252,31 @@ public class FreetypeGlyphVector extends GlyphVector
public void performDefaultLayout()
{
logicalBounds = null; // invalidate caches.
- glyphPositions = null;
-
- glyphTransforms = new AffineTransform[ nGlyphs ];
- double x = 0;
+ glyphTransforms = new AffineTransform[nGlyphs];
+ Arrays.fill(glyphTransforms, null);
+ glyphPositions = new float[(nGlyphs + 1) * 2];
+ GlyphMetrics gm = null;
+ float x = 0;
+ float y = 0;
for(int i = 0; i < nGlyphs; i++)
{
- GlyphMetrics gm = getGlyphMetrics( i );
- glyphTransforms[ i ] = AffineTransform.getTranslateInstance(x, 0);
- x += gm.getAdvanceX();
- if( i > 0 )
- {
- Point2D p = getKerning( glyphCodes[ i - 1 ], glyphCodes[ i ] );
- x += p.getX();
- }
+ gm = getGlyphMetrics( i );
+ glyphPositions[i*2] = x;
+ glyphPositions[i*2 + 1] = y;
+
+ x += gm.getAdvanceX();
+ y += gm.getAdvanceY();
+
+ if (i != nGlyphs-1)
+ {
+ Point2D p = getKerning(glyphCodes[i], glyphCodes[i + 1]);
+ x += p.getX();
+ y += p.getY();
+ }
}
+ glyphPositions[nGlyphs * 2] = x;
+ glyphPositions[nGlyphs * 2 + 1] = y;
}
/**
@@ -276,7 +295,7 @@ public class FreetypeGlyphVector extends GlyphVector
{
int[] rval;
- if( codeReturn == null )
+ if( codeReturn == null || codeReturn.length < numEntries)
rval = new int[ numEntries ];
else
rval = codeReturn;
@@ -286,9 +305,6 @@ public class FreetypeGlyphVector extends GlyphVector
return rval;
}
- /**
- * FIXME: Implement me.
- */
public Shape getGlyphLogicalBounds(int glyphIndex)
{
GlyphMetrics gm = getGlyphMetrics( glyphIndex );
@@ -296,10 +312,17 @@ public class FreetypeGlyphVector extends GlyphVector
return null;
Rectangle2D r = gm.getBounds2D();
Point2D p = getGlyphPosition( glyphIndex );
- return new Rectangle2D.Double( p.getX() + r.getX() - gm.getLSB(),
- p.getY() + r.getY(),
- gm.getAdvanceX(),
- r.getHeight() );
+
+ double[] bounds = new double[] {p.getX() + r.getX() - gm.getLSB(),
+ p.getY() + r.getY(),
+ p.getX() + r.getX() - gm.getLSB() + gm.getAdvanceX(),
+ p.getY() + r.getY() + r.getHeight()};
+
+ if (glyphTransforms[glyphIndex] != null)
+ glyphTransforms[glyphIndex].transform(bounds, 0, bounds, 0, 4);
+
+ return new Rectangle2D.Double(bounds[0], bounds[1], bounds[2] - bounds[0],
+ bounds[3] - bounds[1]);
}
/*
@@ -352,7 +375,9 @@ public class FreetypeGlyphVector extends GlyphVector
public Shape getGlyphOutline(int glyphIndex)
{
GeneralPath gp = getGlyphOutlineNative( glyphCodes[ glyphIndex ] );
- gp.transform( glyphTransforms[ glyphIndex ] );
+ if (glyphTransforms[glyphIndex] != null)
+ gp.transform( glyphTransforms[glyphIndex]);
+
return gp;
}
@@ -361,8 +386,8 @@ public class FreetypeGlyphVector extends GlyphVector
*/
public Point2D getGlyphPosition(int glyphIndex)
{
- return glyphTransforms[ glyphIndex ].transform( new Point2D.Double(0, 0),
- null );
+ return new Point2D.Float(glyphPositions[glyphIndex*2],
+ glyphPositions[glyphIndex*2 + 1]);
}
/**
@@ -371,25 +396,12 @@ public class FreetypeGlyphVector extends GlyphVector
public float[] getGlyphPositions(int beginGlyphIndex, int numEntries,
float[] positionReturn)
{
- if( glyphPositions != null )
- return glyphPositions;
-
- float[] rval;
-
- if( positionReturn == null )
- rval = new float[2 * numEntries];
- else
- rval = positionReturn;
-
- for( int i = beginGlyphIndex; i < numEntries; i++ )
- {
- Point2D p = getGlyphPosition( i );
- rval[i * 2] = (float)p.getX();
- rval[i * 2 + 1] = (float)p.getY();
- }
-
- glyphPositions = rval;
- return rval;
+ if (positionReturn == null || positionReturn.length < (numEntries * 2))
+ positionReturn = new float[numEntries*2];
+
+ System.arraycopy(glyphPositions, beginGlyphIndex*2, positionReturn, 0,
+ numEntries*2);
+ return positionReturn;
}
/**
@@ -397,7 +409,7 @@ public class FreetypeGlyphVector extends GlyphVector
*/
public AffineTransform getGlyphTransform(int glyphIndex)
{
- return new AffineTransform( glyphTransforms[ glyphIndex ] );
+ return glyphTransforms[glyphIndex];
}
/**
@@ -420,10 +432,12 @@ public class FreetypeGlyphVector extends GlyphVector
return logicalBounds;
Rectangle2D rect = (Rectangle2D)getGlyphLogicalBounds( 0 );
+ AffineTransform tx = new AffineTransform();
for( int i = 1; i < nGlyphs; i++ )
{
- Rectangle2D r2 = (Rectangle2D)getGlyphLogicalBounds( i );
- rect = rect.createUnion( r2 );
+ Rectangle2D r2 = (Rectangle2D)getGlyphLogicalBounds( i );
+
+ rect = rect.createUnion( r2 );
}
logicalBounds = rect;
@@ -444,8 +458,14 @@ public class FreetypeGlyphVector extends GlyphVector
public Shape getOutline()
{
GeneralPath path = new GeneralPath();
+ AffineTransform tx = new AffineTransform();
for( int i = 0; i < getNumGlyphs(); i++ )
- path.append( getGlyphOutline( i ), false );
+ {
+ Shape outline = getGlyphOutline(i);
+ tx.setToTranslation(glyphPositions[i*2], glyphPositions[i*2 +1]);
+ outline = tx.createTransformedShape(outline);
+ path.append(outline, false);
+ }
return path;
}
@@ -485,11 +505,9 @@ public class FreetypeGlyphVector extends GlyphVector
*/
public void setGlyphPosition(int glyphIndex, Point2D newPos)
{
- // FIXME: Scaling, etc.?
- glyphTransforms[ glyphIndex ].setToTranslation( newPos.getX(),
- newPos.getY() );
+ glyphPositions[glyphIndex*2] = (float)(newPos.getX());
+ glyphPositions[glyphIndex*2 + 1] = (float)(newPos.getY());
logicalBounds = null;
- glyphPositions = null;
}
/**
@@ -497,8 +515,7 @@ public class FreetypeGlyphVector extends GlyphVector
*/
public void setGlyphTransform(int glyphIndex, AffineTransform newTX)
{
- glyphTransforms[ glyphIndex ].setTransform( newTX );
logicalBounds = null;
- glyphPositions = null;
+ glyphTransforms[glyphIndex] = newTX;
}
}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontMetrics.java b/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontMetrics.java
deleted file mode 100644
index b2ffed10ea6..00000000000
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontMetrics.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/* GdkFontMetrics.java
- Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.java.awt.peer.gtk;
-
-import gnu.java.awt.ClasspathToolkit;
-
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Toolkit;
-
-public class GdkFontMetrics extends FontMetrics
-{
-
- private int[] font_metrics;
- GdkFontPeer peer;
-
- static final int FONT_METRICS_ASCENT = 0;
- static final int FONT_METRICS_MAX_ASCENT = 1;
- static final int FONT_METRICS_DESCENT = 2;
- static final int FONT_METRICS_MAX_DESCENT = 3;
- static final int FONT_METRICS_MAX_ADVANCE = 4;
-
- static final int TEXT_METRICS_X_BEARING = 0;
- static final int TEXT_METRICS_Y_BEARING = 1;
- static final int TEXT_METRICS_WIDTH = 2;
- static final int TEXT_METRICS_HEIGHT = 3;
- static final int TEXT_METRICS_X_ADVANCE = 4;
- static final int TEXT_METRICS_Y_ADVANCE = 5;
-
- /**
- * Makes sure to return a Font based on the given Font that has as
- * peer a GdkFontPeer. Used in the initializer.
- */
- private static Font initFont(Font font)
- {
- if (font == null)
- return new Font("Dialog", Font.PLAIN, 12);
- else if (font.getPeer() instanceof GdkFontPeer)
- return font;
- else
- {
- ClasspathToolkit toolkit;
- toolkit = (ClasspathToolkit) Toolkit.getDefaultToolkit();
- return toolkit.getFont(font.getName(), font.getAttributes());
- }
- }
-
- public GdkFontMetrics (Font font)
- {
- super(initFont(font));
- peer = (GdkFontPeer) this.font.getPeer();
-
- font_metrics = new int[5];
- double [] hires = new double[5];
- peer.getFontMetrics (hires);
- for (int i = 0; i < 5; ++i)
- font_metrics[i] = (int) hires[i];
- }
-
- public int stringWidth (String str)
- {
- double [] hires = new double[6];
- peer.getTextMetrics(str, hires);
- return (int) hires [TEXT_METRICS_WIDTH];
- }
-
- public int charWidth (char ch)
- {
- return stringWidth (new String (new char[] { ch }));
- }
-
- public int charsWidth (char data[], int off, int len)
- {
- return stringWidth (new String (data, off, len));
- }
-
- public int getLeading ()
- {
- // Sun always returns 0.
- return 0;
- }
-
- public int getAscent ()
- {
- return font_metrics[FONT_METRICS_ASCENT];
- }
-
- public int getMaxAscent ()
- {
- return font_metrics[FONT_METRICS_MAX_ASCENT];
- }
-
- public int getDescent ()
- {
- return font_metrics[FONT_METRICS_DESCENT];
- }
-
- public int getMaxDescent ()
- {
- return font_metrics[FONT_METRICS_MAX_DESCENT];
- }
-
- public int getMaxAdvance ()
- {
- return font_metrics[FONT_METRICS_MAX_ADVANCE];
- }
-}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java b/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java
index 11635c3544e..5f5126ac590 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
+import gnu.java.awt.ClasspathToolkit;
import gnu.java.awt.peer.ClasspathFontPeer;
import gnu.java.awt.font.opentype.NameDecoder;
@@ -48,39 +49,125 @@ import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;
import java.awt.font.GlyphMetrics;
import java.awt.font.LineMetrics;
+import java.awt.font.TextLayout;
import java.awt.geom.Rectangle2D;
import java.text.CharacterIterator;
import java.util.Locale;
import java.util.Map;
-import java.util.ResourceBundle;
import java.nio.ByteBuffer;
import java.util.HashMap;
public class GdkFontPeer extends ClasspathFontPeer
{
+ static final FontRenderContext DEFAULT_CTX =
+ new FontRenderContext(null, false, false);
+
+ /**
+ * Caches TextLayout instances for use in charsWidth() and drawString().
+ * The size of the cache has been chosen so that relativly large GUIs with
+ * text documents are still efficient.
+ */
+ HashMap textLayoutCache = new GtkToolkit.LRUCache(500);
+
+ private class GdkFontMetrics extends FontMetrics
+ {
+
+ public GdkFontMetrics (Font font)
+ {
+ super(initFont(font));
+ }
+
+ public int stringWidth (String str)
+ {
+ TextLayout tl = (TextLayout) textLayoutCache.get(str);
+ if (tl == null)
+ {
+ tl = new TextLayout(str, font, DEFAULT_CTX);
+ textLayoutCache.put(str, tl);
+ }
+ return (int) tl.getAdvance();
+ }
+
+ public int charWidth (char ch)
+ {
+ return stringWidth (new String (new char[] { ch }));
+ }
+
+ public int charsWidth (char data[], int off, int len)
+ {
+ return stringWidth (new String (data, off, len));
+ }
+
+ public int getHeight()
+ {
+ return (int) height;
+ }
+
+ public int getLeading ()
+ {
+ return (int) (height - (ascent + descent));
+ }
+
+ public int getAscent ()
+ {
+ return (int) ascent;
+ }
+
+ public int getMaxAscent ()
+ {
+ return (int) ascent;
+ }
+
+ public int getDescent ()
+ {
+ return (int) descent;
+ }
+
+ public int getMaxDescent ()
+ {
+ return (int) maxDescent;
+ }
+
+ public int getMaxAdvance ()
+ {
+ return (int) maxAdvance;
+ }
+ }
+
static native void initStaticState();
private final int native_state = GtkGenericPeer.getUniqueInteger ();
- private static ResourceBundle bundle;
/**
* Cache GlyphMetrics objects.
*/
private HashMap metricsCache;
-
+
+ private static final int FONT_METRICS_ASCENT = 0;
+ private static final int FONT_METRICS_MAX_ASCENT = 1;
+ private static final int FONT_METRICS_DESCENT = 2;
+ private static final int FONT_METRICS_MAX_DESCENT = 3;
+ private static final int FONT_METRICS_MAX_ADVANCE = 4;
+ private static final int FONT_METRICS_HEIGHT = 5;
+ private static final int FONT_METRICS_UNDERLINE_OFFSET = 6;
+ private static final int FONT_METRICS_UNDERLINE_THICKNESS = 7;
+
+ float ascent;
+ float descent;
+ float maxAscent;
+ float maxDescent;
+ float maxAdvance;
+ float height;
+ float underlineOffset;
+ float underlineThickness;
+
+ GdkFontMetrics metrics;
+
static
{
System.loadLibrary("gtkpeer");
initStaticState ();
- try
- {
- bundle = ResourceBundle.getBundle ("gnu.java.awt.peer.gtk.font");
- }
- catch (Throwable ignored)
- {
- bundle = null;
- }
}
private ByteBuffer nameTable = null;
@@ -89,8 +176,8 @@ public class GdkFontPeer extends ClasspathFontPeer
private native void dispose ();
private native void setFont (String family, int style, int size);
- native void getFontMetrics(double [] metrics);
- native void getTextMetrics(String str, double [] metrics);
+ native synchronized void getFontMetrics(double [] metrics);
+ native synchronized void getTextMetrics(String str, double [] metrics);
native void releasePeerGraphicsResource();
@@ -149,6 +236,7 @@ public class GdkFontPeer extends ClasspathFontPeer
initState ();
setFont (this.familyName, this.style, (int)this.size);
metricsCache = new HashMap();
+ setupMetrics();
}
public GdkFontPeer (String name, Map attributes)
@@ -157,6 +245,40 @@ public class GdkFontPeer extends ClasspathFontPeer
initState ();
setFont (this.familyName, this.style, (int)this.size);
metricsCache = new HashMap();
+ setupMetrics();
+ }
+
+
+ /**
+ * Makes sure to return a Font based on the given Font that has as
+ * peer a GdkFontPeer. Used in the initializer.
+ */
+ static Font initFont(Font font)
+ {
+ if (font == null)
+ return new Font("Dialog", Font.PLAIN, 12);
+ else if (font.getPeer() instanceof GdkFontPeer)
+ return font;
+ else
+ {
+ ClasspathToolkit toolkit;
+ toolkit = (ClasspathToolkit) Toolkit.getDefaultToolkit();
+ return toolkit.getFont(font.getName(), font.getAttributes());
+ }
+ }
+
+ private void setupMetrics()
+ {
+ double [] hires = new double[8];
+ getFontMetrics(hires);
+ ascent = (float) hires[FONT_METRICS_ASCENT];
+ maxAscent = (float) hires[FONT_METRICS_MAX_ASCENT];
+ descent = (float) hires[FONT_METRICS_DESCENT];
+ maxDescent = (float) hires[FONT_METRICS_MAX_DESCENT];
+ maxAdvance = (float) hires[FONT_METRICS_MAX_ADVANCE];
+ height = (float) hires[FONT_METRICS_HEIGHT];
+ underlineOffset = (float) hires[FONT_METRICS_UNDERLINE_OFFSET];
+ underlineThickness = (float) hires[FONT_METRICS_UNDERLINE_THICKNESS];
}
/**
@@ -261,26 +383,17 @@ public class GdkFontPeer extends ClasspathFontPeer
return Font.ROMAN_BASELINE;
}
- private static class GdkFontLineMetrics extends LineMetrics
+ private class GdkFontLineMetrics extends LineMetrics
{
- private FontMetrics fm;
- private int nchars;
- private float strikethroughOffset, strikethroughThickness,
- underlineOffset, underlineThickness;
-
- public GdkFontLineMetrics (GdkFontPeer fp, FontMetrics m, int n)
+ private int nchars;
+ public GdkFontLineMetrics (GdkFontPeer fp, int n)
{
- fm = m;
nchars = n;
- strikethroughOffset = 0f;
- underlineOffset = 0f;
- strikethroughThickness = ((float)fp.getSize(null)) / 12f;
- underlineThickness = strikethroughThickness;
}
public float getAscent()
{
- return (float) fm.getAscent ();
+ return ascent;
}
public int getBaselineIndex()
@@ -296,27 +409,52 @@ public class GdkFontPeer extends ClasspathFontPeer
public float getDescent()
{
- return (float) fm.getDescent ();
+ return descent;
}
public float getHeight()
{
- return (float) fm.getHeight ();
+ return height;
}
- public float getLeading() { return 0.f; }
- public int getNumChars() { return nchars; }
- public float getStrikethroughOffset() { return 0.f; }
- public float getStrikethroughThickness() { return 0.f; }
- public float getUnderlineOffset() { return 0.f; }
- public float getUnderlineThickness() { return 0.f; }
+ public float getLeading()
+ {
+ return height - (ascent + descent);
+ }
+
+ public int getNumChars()
+ {
+ return nchars;
+ }
+
+ public float getStrikethroughOffset()
+ {
+ // FreeType doesn't seem to provide a value here.
+ return ascent / 2;
+ }
+
+ public float getStrikethroughThickness()
+ {
+ // FreeType doesn't seem to provide a value here.
+ return 1.f;
+ }
+
+ public float getUnderlineOffset()
+ {
+ return underlineOffset;
+ }
+
+ public float getUnderlineThickness()
+ {
+ return underlineThickness;
+ }
}
public LineMetrics getLineMetrics (Font font, CharacterIterator ci,
int begin, int limit, FontRenderContext rc)
{
- return new GdkFontLineMetrics (this, getFontMetrics (font), limit - begin);
+ return new GdkFontLineMetrics (this, limit - begin);
}
public Rectangle2D getMaxCharBounds (Font font, FontRenderContext rc)
@@ -345,15 +483,6 @@ public class GdkFontPeer extends ClasspathFontPeer
return buf.getShort(4);
}
- public Rectangle2D getStringBounds (Font font, CharacterIterator ci,
- int begin, int limit, FontRenderContext frc)
- {
- GlyphVector gv = new FreetypeGlyphVector( font,
- buildString(ci, begin, limit),
- frc);
- return gv.getVisualBounds();
- }
-
public boolean hasUniformLineMetrics (Font font)
{
return true;
@@ -363,22 +492,21 @@ public class GdkFontPeer extends ClasspathFontPeer
char[] chars, int start, int limit,
int flags)
{
- return new FreetypeGlyphVector( font, new String( chars, start,
- limit - start),
+ return new FreetypeGlyphVector( font, chars, start, limit - start,
frc, flags);
}
public LineMetrics getLineMetrics (Font font, String str,
FontRenderContext frc)
{
- return new GdkFontLineMetrics (this, getFontMetrics (font), str.length ());
+ return new GdkFontLineMetrics (this, str.length ());
}
public FontMetrics getFontMetrics (Font font)
{
- // Get the font metrics through GtkToolkit to take advantage of
- // the metrics cache.
- return Toolkit.getDefaultToolkit().getFontMetrics (font);
+ if (metrics == null)
+ metrics = new GdkFontMetrics(font);
+ return metrics;
}
/**
@@ -397,4 +525,5 @@ public class GdkFontPeer extends ClasspathFontPeer
{
metricsCache.put( new Integer( glyphCode ), metrics );
}
+
}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java b/libjava/classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
index e095c7dad4b..db725b697df 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
@@ -44,7 +44,7 @@ import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.HeadlessException;
import java.awt.image.BufferedImage;
-import java.awt.image.DataBuffer;
+import java.awt.image.Raster;
import java.util.Locale;
public class GdkGraphicsEnvironment extends GraphicsEnvironment
@@ -103,9 +103,9 @@ public class GdkGraphicsEnvironment extends GraphicsEnvironment
public Graphics2D createGraphics (BufferedImage image)
{
- DataBuffer db = image.getRaster().getDataBuffer();
- if(db instanceof CairoSurface)
- return ((CairoSurface)db).getGraphics();
+ Raster raster = image.getRaster();
+ if(raster instanceof CairoSurface)
+ return ((CairoSurface)raster).getGraphics();
return new BufferedImageGraphics( image );
}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GtkChoicePeer.java b/libjava/classpath/gnu/java/awt/peer/gtk/GtkChoicePeer.java
index f00461f3fc8..d866cefd33c 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GtkChoicePeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GtkChoicePeer.java
@@ -84,7 +84,7 @@ public class GtkChoicePeer extends GtkComponentPeer
public void select (int position)
{
- if (Thread.currentThread() == GtkToolkit.mainThread)
+ if (Thread.currentThread() == GtkMainThread.mainThread)
selectNativeUnlocked (position);
else
selectNative (position);
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java b/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java
index c11c45e2070..b1ef09d6e1b 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java
@@ -90,6 +90,11 @@ public class GtkComponentPeer extends GtkGenericPeer
Insets insets;
+ /**
+ * The current repaint area. Use should be guarded by synchronizing on this.
+ */
+ private Rectangle currentPaintArea;
+
/* this isEnabled differs from Component.isEnabled, in that it
knows if a parent is disabled. In that case Component.isEnabled
may return true, but our isEnabled will always return false */
@@ -308,13 +313,30 @@ public class GtkComponentPeer extends GtkGenericPeer
// seems expensive. However, the graphics state does not carry
// over between calls to paint, and resetting the graphics object
// may even be more costly than simply creating a new one.
- Graphics g = getGraphics();
- g.setClip(event.getUpdateRect());
-
- awtComponent.paint(g);
+ // Make sure that the paintArea includes the area from the event
+ // in the case when an application sends PaintEvents directly.
+ coalescePaintEvent(event);
+ Rectangle paintArea;
+ synchronized (this)
+ {
+ paintArea = currentPaintArea;
+ currentPaintArea = null;
+ }
- g.dispose();
+ if (paintArea != null)
+ {
+ Graphics g = getGraphics();
+ try
+ {
+ g.setClip(paintArea);
+ awtComponent.paint(g);
+ }
+ finally
+ {
+ g.dispose();
+ }
+ }
}
// This method and its overrides are the only methods in the peers
@@ -327,13 +349,29 @@ public class GtkComponentPeer extends GtkGenericPeer
|| (awtComponent.getWidth() < 1 || awtComponent.getHeight() < 1))
return;
- Graphics g = getGraphics();
-
- g.setClip(event.getUpdateRect());
-
- awtComponent.update(g);
+ // Make sure that the paintArea includes the area from the event
+ // in the case when an application sends PaintEvents directly.
+ coalescePaintEvent(event);
+ Rectangle paintArea;
+ synchronized (this)
+ {
+ paintArea = currentPaintArea;
+ currentPaintArea = null;
+ }
- g.dispose();
+ if (paintArea != null)
+ {
+ Graphics g = getGraphics();
+ try
+ {
+ g.setClip(paintArea);
+ awtComponent.update(g);
+ }
+ finally
+ {
+ g.dispose();
+ }
+ }
}
public boolean isFocusTraversable ()
@@ -514,7 +552,7 @@ public class GtkComponentPeer extends GtkGenericPeer
y = 0;
}
- if (Thread.currentThread() == GtkToolkit.mainThread)
+ if (Thread.currentThread() == GtkMainThread.mainThread)
gtkWidgetSetCursorUnlocked(cursor.getType(), image, x, y);
else
gtkWidgetSetCursor(cursor.getType(), image, x, y);
@@ -562,7 +600,7 @@ public class GtkComponentPeer extends GtkGenericPeer
b = (bounds.width > 0) && (bounds.height > 0);
}
- if (Thread.currentThread() == GtkToolkit.mainThread)
+ if (Thread.currentThread() == GtkMainThread.mainThread)
setVisibleNativeUnlocked (b);
else
setVisibleNative (b);
@@ -754,7 +792,14 @@ public class GtkComponentPeer extends GtkGenericPeer
public void coalescePaintEvent (PaintEvent e)
{
-
+ synchronized (this)
+ {
+ Rectangle newRect = e.getUpdateRect();
+ if (currentPaintArea == null)
+ currentPaintArea = newRect;
+ else
+ Rectangle.union(currentPaintArea, newRect, currentPaintArea);
+ }
}
public void updateCursorImmediately ()
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java b/libjava/classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java
index bb6f8b3bb3b..d113e92f5b4 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java
@@ -57,6 +57,11 @@ public class GtkFramePeer extends GtkWindowPeer
native void removeMenuBarPeer ();
native void gtkFixedSetVisible (boolean visible);
+ private native void maximize();
+ private native void unmaximize();
+ private native void iconify();
+ private native void deiconify();
+
int getMenuBarHeight ()
{
return menuBar == null ? 0 : getMenuBarHeight (menuBar);
@@ -199,12 +204,25 @@ public class GtkFramePeer extends GtkWindowPeer
public int getState ()
{
- return 0;
+ return windowState;
}
public void setState (int state)
{
-
+ switch (state)
+ {
+ case Frame.NORMAL:
+ if ((windowState & Frame.ICONIFIED) != 0)
+ deiconify();
+ if ((windowState & Frame.MAXIMIZED_BOTH) != 0)
+ unmaximize();
+ break;
+ case Frame.ICONIFIED:
+ iconify();
+ break;
+ case Frame.MAXIMIZED_BOTH:
+ maximize();
+ }
}
public void setMaximizedBounds (Rectangle r)
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GtkImageConsumer.java b/libjava/classpath/gnu/java/awt/peer/gtk/GtkImageConsumer.java
index f1a74b8cc99..53e97bb1a8a 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GtkImageConsumer.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GtkImageConsumer.java
@@ -42,6 +42,7 @@ import java.awt.image.ColorModel;
import java.awt.image.ImageConsumer;
import java.awt.image.ImageProducer;
import java.awt.image.MemoryImageSource;
+import java.nio.ByteOrder;
import java.util.Hashtable;
/**
@@ -103,7 +104,7 @@ public class GtkImageConsumer implements ImageConsumer
scansize);
}
- public synchronized void setPixels (int x, int y, int width, int height,
+ public synchronized void setPixels (int x, int y, int width, int height,
ColorModel cm, int[] pixels,
int offset, int scansize)
{
@@ -117,18 +118,34 @@ public class GtkImageConsumer implements ImageConsumer
width);
else
{
- for (int i = 0; i < height; i++)
- for (int j = 0; j < width; j++)
- {
- // get in AARRGGBB and convert to AABBGGRR
- int pix = cm.getRGB(pixels[offset + (i * scansize) + x + j]);
- byte b = (byte)(pix & 0xFF);
- byte r = (byte)(((pix & 0x00FF0000) >> 16) & 0xFF);
- pix &= 0xFF00FF00;
- pix |= ((b & 0xFF) << 16);
- pix |= (r & 0xFF);
- pixelCache[(y + i) * this.width + x + j] = pix;
- }
+ if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN)
+ {
+ for (int i = 0; i < height; i++)
+ for (int j = 0; j < width; j++)
+ {
+ // get in RRGGBBAA and convert to AARRGGBB
+ int pix = cm.getRGB(pixels[offset + (i * scansize) + x + j]);
+ int a = ((pix & 0xFF000000) >> 24) & 0xFF;
+ int rgb = (pix & 0x00FFFFFF) << 8;
+ pix = rgb | a;
+ pixelCache[(y + i) * this.width + x + j] = pix;
+ }
+ }
+ else
+ {
+ for (int i = 0; i < height; i++)
+ for (int j = 0; j < width; j++)
+ {
+ // get in AARRGGBB and convert to AABBGGRR
+ int pix = cm.getRGB(pixels[offset + (i * scansize) + x + j]);
+ byte b = (byte)(pix & 0xFF);
+ byte r = (byte)(((pix & 0x00FF0000) >> 16) & 0xFF);
+ pix &= 0xFF00FF00;
+ pix |= ((b & 0xFF) << 16);
+ pix |= (r & 0xFF);
+ pixelCache[(y + i) * this.width + x + j] = pix;
+ }
+ }
}
}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GtkMainThread.java b/libjava/classpath/gnu/java/awt/peer/gtk/GtkMainThread.java
new file mode 100644
index 00000000000..a4e280fe45f
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GtkMainThread.java
@@ -0,0 +1,190 @@
+/* GtkMainThread.java -- Wrapper for the GTK main thread, and some utilities.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.peer.gtk;
+
+import gnu.java.awt.peer.NativeEventLoopRunningEvent;
+
+import java.awt.AWTEvent;
+
+/**
+ * The Java thread representing the native GTK main loop, that is,
+ * GtkMainThread.mainThread, terminates when GtkToolkit.gtkMain()
+ * returns. That happens in response to the last window peer being
+ * disposed (see GtkWindowPeer.dispose).
+ *
+ * When GtkMainThread.destroyWindow is called for the last window, it
+ * in turn calls GtkMainThread.endMainThread, which calls gtk_quit.
+ * gtk_quit signals gtk_main to return, which causes GtkMainThread.run
+ * to return.
+ *
+ * There should only be one native GTK main loop running at any given
+ * time. In order to safely start and stop the GTK main loop, we use
+ * a running flag and corresponding runningLock. startMainThread will
+ * not return until the native GTK main loop has started, as confirmed
+ * by the native set_running_flag callback setting the running flag to
+ * true. Without this protection, gtk_quit could be called before the
+ * main loop has actually started, which causes GTK assertion
+ * failures. Likewise endMainThread will not return until the native
+ * GTK main loop has ended.
+ *
+ * post_running_flag_callback is called during gtk_main initialization
+ * and no window can be created before startMainThread returns. This
+ * ensures that calling post_running_flag_callback is the first action
+ * taken by the native GTK main loop.
+ *
+ * GtkMainThread.mainThread is started when the window count goes from
+ * zero to one.
+ *
+ * GtkMainThread keeps the AWT event queue informed of its status by
+ * posting NativeEventLoopRunningEvents. The AWT event queue uses
+ * this status to determine whether or not the AWT exit conditions
+ * have been met (see EventQueue.isShutdown).
+ */
+public class GtkMainThread extends Thread
+{
+ /** Count of the number of open windows */
+ private static int numberOfWindows = 0;
+
+ /** Lock for the above */
+ private static Object nWindowsLock = new Object();
+
+ /** Indicates whether or not the GTK main loop is running. */
+ private static boolean running = false;
+
+ /** Lock for the above. */
+ private static Object runningLock = new Object();
+
+ /** The main thread instance (singleton) */
+ public static GtkMainThread mainThread;
+
+ /** Constructs a main thread */
+ private GtkMainThread()
+ {
+ super("GTK main thread");
+ }
+
+ public void run ()
+ {
+ GtkToolkit.gtkMain ();
+ }
+
+ private static void setRunning(boolean running)
+ {
+ synchronized (runningLock)
+ {
+ GtkMainThread.running = running;
+ runningLock.notifyAll();
+ }
+ }
+
+ private static void startMainThread()
+ {
+ synchronized (runningLock)
+ {
+ if (!running)
+ {
+ mainThread = new GtkMainThread();
+ mainThread.start();
+
+ while (!running)
+ {
+ try
+ {
+ runningLock.wait();
+ }
+ catch (InterruptedException e)
+ {
+ System.err.println ("GtkMainThread.startMainThread:"
+ + " interrupted while waiting "
+ + " for GTK main loop to start");
+ }
+ }
+ GtkGenericPeer.q()
+ .postEvent(new NativeEventLoopRunningEvent(new Boolean(true)));
+ }
+ }
+ }
+
+ private static void endMainThread()
+ {
+ synchronized (runningLock)
+ {
+ if (running)
+ {
+ GtkToolkit.gtkQuit();
+
+ while (running)
+ {
+ try
+ {
+ runningLock.wait();
+ }
+ catch (InterruptedException e)
+ {
+ System.err.println ("GtkMainThread.endMainThread:"
+ + " interrupted while waiting "
+ + " for GTK main loop to stop");
+ }
+ }
+ GtkGenericPeer.q()
+ .postEvent(new NativeEventLoopRunningEvent(new Boolean(false)));
+ }
+ }
+ }
+
+ public static void createWindow()
+ {
+ synchronized (nWindowsLock)
+ {
+ if (numberOfWindows == 0)
+ startMainThread();
+ numberOfWindows++;
+ }
+ }
+
+ public static void destroyWindow()
+ {
+ synchronized (nWindowsLock)
+ {
+ numberOfWindows--;
+ if (numberOfWindows == 0)
+ endMainThread();
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java b/libjava/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java
index 6aa87fc2ecf..f746a47479f 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java
@@ -62,6 +62,7 @@ import java.awt.FontMetrics;
import java.awt.Frame;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
import java.awt.Image;
import java.awt.Label;
import java.awt.List;
@@ -83,6 +84,7 @@ import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.DragGestureListener;
import java.awt.dnd.DragGestureRecognizer;
import java.awt.dnd.DragSource;
+import java.awt.dnd.InvalidDnDOperationException;
import java.awt.dnd.peer.DragSourceContextPeer;
import java.awt.im.InputMethodHighlight;
import java.awt.image.ColorModel;
@@ -115,7 +117,6 @@ import java.awt.peer.WindowPeer;
import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
-import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;
@@ -131,37 +132,30 @@ import javax.imageio.spi.IIORegistry;
public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
{
- Hashtable containers = new Hashtable();
- static EventQueue q;
- static Thread mainThread;
+ private static EventQueue q;
static native void gtkInit(int portableNativeSync);
+ static native void gtkMain();
+
+ static native void gtkQuit();
+
static
{
System.loadLibrary("gtkpeer");
-
+
int portableNativeSync;
String portNatSyncProp =
System.getProperty("gnu.classpath.awt.gtk.portable.native.sync");
-
+
if (portNatSyncProp == null)
portableNativeSync = -1; // unset
else if (Boolean.valueOf(portNatSyncProp).booleanValue())
portableNativeSync = 1; // true
else
portableNativeSync = 0; // false
-
+
gtkInit(portableNativeSync);
-
- mainThread = new Thread ("GTK main thread")
- {
- public void run ()
- {
- gtkMain ();
- }
- };
- mainThread.start ();
}
public GtkToolkit ()
@@ -169,6 +163,7 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
}
public native void beep();
+
private native void getScreenSizeDimensions(int[] xy);
public int checkImage (Image image, int width, int height,
@@ -181,6 +176,9 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
if (image instanceof GtkImage)
return ((GtkImage) image).checkImage (observer);
+ if (image instanceof AsyncImage)
+ return ((AsyncImage) image).checkImage(observer);
+
if (observer != null)
observer.imageUpdate (image, status,
-1, -1,
@@ -194,7 +192,7 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
* Helper to return either a Image -- the argument -- or a
* GtkImage with the errorLoading flag set if the argument is null.
*/
- private Image imageOrError(Image b)
+ static Image imageOrError(Image b)
{
if (b == null)
return GtkImage.getErrorImage();
@@ -221,16 +219,7 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
public Image createImage (URL url)
{
- Image image;
- try
- {
- image = CairoSurface.getBufferedImage( new GtkImage( url ) );
- }
- catch (IllegalArgumentException iae)
- {
- image = null;
- }
- return imageOrError(image);
+ return new AsyncImage(url);
}
public Image createImage (ImageProducer producer)
@@ -301,7 +290,7 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
"SansSerif" });
}
- private class LRUCache extends LinkedHashMap
+ static class LRUCache extends LinkedHashMap
{
int max_entries;
public LRUCache(int max)
@@ -316,23 +305,11 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
}
private LRUCache fontCache = new LRUCache(50);
- private LRUCache metricsCache = new LRUCache(50);
private LRUCache imageCache = new LRUCache(50);
public FontMetrics getFontMetrics (Font font)
{
- synchronized (metricsCache)
- {
- if (metricsCache.containsKey(font))
- return (FontMetrics) metricsCache.get(font);
- }
-
- FontMetrics m = new GdkFontMetrics (font);
- synchronized (metricsCache)
- {
- metricsCache.put(font, m);
- }
- return m;
+ return ((GdkFontPeer) font.getPeer()).getFontMetrics(font);
}
public Image getImage (String filename)
@@ -408,6 +385,13 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
return ((((GtkImage)image).checkImage (observer) &
ImageObserver.ALLBITS) != 0);
+ if (image instanceof AsyncImage)
+ {
+ AsyncImage aImg = (AsyncImage) image;
+ aImg.addObserver(observer);
+ return aImg.realImage != null;
+ }
+
/* Assume anything else is too */
return true;
}
@@ -437,106 +421,131 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
protected ButtonPeer createButton (Button b)
{
+ checkHeadless();
return new GtkButtonPeer (b);
}
protected CanvasPeer createCanvas (Canvas c)
{
+ checkHeadless();
return new GtkCanvasPeer (c);
}
protected CheckboxPeer createCheckbox (Checkbox cb)
{
+ checkHeadless();
return new GtkCheckboxPeer (cb);
}
protected CheckboxMenuItemPeer createCheckboxMenuItem (CheckboxMenuItem cmi)
{
+ checkHeadless();
return new GtkCheckboxMenuItemPeer (cmi);
}
protected ChoicePeer createChoice (Choice c)
{
+ checkHeadless();
return new GtkChoicePeer (c);
}
protected DialogPeer createDialog (Dialog d)
{
+ checkHeadless();
+ GtkMainThread.createWindow();
return new GtkDialogPeer (d);
}
protected FileDialogPeer createFileDialog (FileDialog fd)
{
+ checkHeadless();
return new GtkFileDialogPeer (fd);
}
protected FramePeer createFrame (Frame f)
{
+ checkHeadless();
+ GtkMainThread.createWindow();
return new GtkFramePeer (f);
}
protected LabelPeer createLabel (Label label)
{
+ checkHeadless();
return new GtkLabelPeer (label);
}
protected ListPeer createList (List list)
{
+ checkHeadless();
return new GtkListPeer (list);
}
protected MenuPeer createMenu (Menu m)
{
+ checkHeadless();
return new GtkMenuPeer (m);
}
protected MenuBarPeer createMenuBar (MenuBar mb)
{
+ checkHeadless();
return new GtkMenuBarPeer (mb);
}
protected MenuItemPeer createMenuItem (MenuItem mi)
{
+ checkHeadless();
return new GtkMenuItemPeer (mi);
}
protected PanelPeer createPanel (Panel p)
{
+ checkHeadless();
return new GtkPanelPeer (p);
}
protected PopupMenuPeer createPopupMenu (PopupMenu target)
{
+ checkHeadless();
return new GtkPopupMenuPeer (target);
}
protected ScrollPanePeer createScrollPane (ScrollPane sp)
{
+ checkHeadless();
return new GtkScrollPanePeer (sp);
}
protected ScrollbarPeer createScrollbar (Scrollbar sb)
{
+ checkHeadless();
return new GtkScrollbarPeer (sb);
}
protected TextAreaPeer createTextArea (TextArea ta)
{
+ checkHeadless();
return new GtkTextAreaPeer (ta);
}
protected TextFieldPeer createTextField (TextField tf)
{
+ checkHeadless();
return new GtkTextFieldPeer (tf);
}
protected WindowPeer createWindow (Window w)
{
+ checkHeadless();
+ GtkMainThread.createWindow();
return new GtkWindowPeer (w);
}
public EmbeddedWindowPeer createEmbeddedWindow (EmbeddedWindow w)
{
+ checkHeadless();
+ GtkMainThread.createWindow();
return new GtkEmbeddedWindowPeer (w);
}
@@ -605,6 +614,8 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent e)
{
+ if (GraphicsEnvironment.isHeadless())
+ throw new InvalidDnDOperationException();
return new GtkDragSourceContextPeer(e);
}
@@ -614,7 +625,8 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
int actions,
DragGestureListener l)
{
- if (recognizer.getName().equals("java.awt.dnd.MouseDragGestureRecognizer"))
+ if (recognizer.getName().equals("java.awt.dnd.MouseDragGestureRecognizer")
+ && ! GraphicsEnvironment.isHeadless())
{
GtkMouseDragGestureRecognizer gestureRecognizer
= new GtkMouseDragGestureRecognizer(ds, comp, actions, l);
@@ -661,13 +673,25 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
GdkPixbufDecoder.registerSpis(reg);
}
- public static native void gtkMain();
-
protected MouseInfoPeer getMouseInfoPeer()
{
return new GtkMouseInfoPeer();
}
+ public boolean isFrameStateSupported(int state)
+ {
+ // GTK supports ICONFIED, NORMAL and MAXIMIZE_BOTH, but
+ // not (yet?) MAXIMIZE_VERT and MAXIMIZE_HORIZ.
+ return state == Frame.NORMAL || state == Frame.ICONIFIED
+ || state == Frame.MAXIMIZED_BOTH;
+ }
+
+ private void checkHeadless()
+ {
+ if (GraphicsEnvironment.isHeadless())
+ throw new HeadlessException();
+ }
+
public native int getMouseNumberOfButtons();
} // class GtkToolkit
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GtkVolatileImage.java b/libjava/classpath/gnu/java/awt/peer/gtk/GtkVolatileImage.java
index 44e7b027b0b..8660ced8ec1 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GtkVolatileImage.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GtkVolatileImage.java
@@ -37,13 +37,21 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.ImageCapabilities;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
+import java.awt.ImageCapabilities;
+import java.awt.Point;
import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.DataBuffer;
+import java.awt.image.DirectColorModel;
import java.awt.image.ImageObserver;
+import java.awt.image.Raster;
+import java.awt.image.SampleModel;
+import java.awt.image.SinglePixelPackedSampleModel;
import java.awt.image.VolatileImage;
+import java.awt.image.WritableRaster;
public class GtkVolatileImage extends VolatileImage
{
@@ -52,6 +60,12 @@ public class GtkVolatileImage extends VolatileImage
final GtkComponentPeer component;
+ static ColorModel gdkColorModel = new DirectColorModel(32,
+ 0x000000FF,
+ 0x0000FF00,
+ 0x00FF0000,
+ 0xFF000000);
+
/**
* Don't touch, accessed from native code.
*/
@@ -62,6 +76,17 @@ public class GtkVolatileImage extends VolatileImage
native void destroy(long pointer);
native int[] nativeGetPixels(long pointer);
+
+ /**
+ * Gets the pixels in the current image from GDK.
+ *
+ * Note that pixels are in 32-bit RGBA, non-premultiplied, which is different
+ * from Cairo's premultiplied ARGB, which is different from Java's standard
+ * non-premultiplied ARGB. Caution is advised when using this method, to
+ * ensure that the data format remains consistent with what you expect.
+ *
+ * @return the current pixels, as reported by GDK.
+ */
public int[] getPixels()
{
return nativeGetPixels(nativePointer);
@@ -113,9 +138,11 @@ public class GtkVolatileImage extends VolatileImage
public BufferedImage getSnapshot()
{
- CairoSurface cs = new CairoSurface( width, height );
- cs.setPixels( getPixels() );
- return CairoSurface.getBufferedImage( cs );
+ WritableRaster raster = Raster.createWritableRaster(createGdkSampleModel(width, height),
+ new Point(0, 0));
+ raster.setDataElements(0, 0, getPixels());
+ return new BufferedImage(gdkColorModel, raster,
+ gdkColorModel.isAlphaPremultiplied(), null);
}
public Graphics getGraphics()
@@ -167,4 +194,14 @@ public class GtkVolatileImage extends VolatileImage
{
return null;
}
+
+ /**
+ * Creates a SampleModel that matches GDK's native format
+ */
+ protected static SampleModel createGdkSampleModel(int w, int h)
+ {
+ return new SinglePixelPackedSampleModel(DataBuffer.TYPE_INT, w, h,
+ new int[]{0x000000FF, 0x0000FF00,
+ 0x00FF0000, 0xFF000000});
+ }
}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java b/libjava/classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java
index 866d9c8816a..8d49719b1d3 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java
@@ -38,7 +38,10 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
+import gnu.java.awt.ComponentReshapeEvent;
+
import java.awt.Component;
+import java.awt.Font;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.KeyboardFocusManager;
@@ -62,8 +65,7 @@ public class GtkWindowPeer extends GtkContainerPeer
protected static final int GDK_WINDOW_TYPE_HINT_DOCK = 6;
protected static final int GDK_WINDOW_TYPE_HINT_DESKTOP = 7;
- private boolean hasBeenShown = false;
- private int oldState = Frame.NORMAL;
+ protected int windowState = Frame.NORMAL;
// Cached awt window component location, width and height.
private int x, y, width, height;
@@ -75,6 +77,12 @@ public class GtkWindowPeer extends GtkContainerPeer
native boolean gtkWindowHasFocus();
native void realize ();
+ public void dispose()
+ {
+ super.dispose();
+ GtkMainThread.destroyWindow();
+ }
+
/** Returns the cached width of the AWT window component. */
int getX ()
{
@@ -144,6 +152,8 @@ public class GtkWindowPeer extends GtkContainerPeer
public GtkWindowPeer (Window window)
{
super (window);
+ // Set reasonable font for the window.
+ window.setFont(new Font("Dialog", Font.PLAIN, 12));
}
public native void toBack();
@@ -218,9 +228,31 @@ public class GtkWindowPeer extends GtkContainerPeer
// only called from GTK thread
protected void postConfigureEvent (int x, int y, int width, int height)
{
+ int frame_x = x - insets.left;
+ int frame_y = y - insets.top;
int frame_width = width + insets.left + insets.right;
int frame_height = height + insets.top + insets.bottom;
+ // Update the component's knowledge about the size.
+ // Important: Please look at the big comment in ComponentReshapeEvent
+ // to learn why we did it this way. If you change this code, make
+ // sure that the peer->AWT bounds update still works.
+ // (for instance: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29448 )
+
+ // We do this befor we post the ComponentEvent, because (in Window)
+ // we invalidate() / revalidate() when a ComponentEvent is seen,
+ // and the AWT must already know about the new size then.
+ if (frame_x != this.x || frame_y != this.y || frame_width != this.width
+ || frame_height != this.height)
+ {
+ ComponentReshapeEvent ev = new ComponentReshapeEvent(awtComponent,
+ frame_x,
+ frame_y,
+ frame_width,
+ frame_height);
+ awtComponent.dispatchEvent(ev);
+ }
+
if (frame_width != getWidth()
|| frame_height != getHeight())
{
@@ -230,9 +262,6 @@ public class GtkWindowPeer extends GtkContainerPeer
ComponentEvent.COMPONENT_RESIZED));
}
- int frame_x = x - insets.left;
- int frame_y = y - insets.top;
-
if (frame_x != getX()
|| frame_y != getY())
{
@@ -241,6 +270,7 @@ public class GtkWindowPeer extends GtkContainerPeer
q().postEvent(new ComponentEvent(awtComponent,
ComponentEvent.COMPONENT_MOVED));
}
+
}
public void show ()
@@ -255,23 +285,26 @@ public class GtkWindowPeer extends GtkContainerPeer
void postWindowEvent (int id, Window opposite, int newState)
{
- if (id == WindowEvent.WINDOW_OPENED)
+ if (id == WindowEvent.WINDOW_STATE_CHANGED)
{
- // Post a WINDOW_OPENED event the first time this window is shown.
- if (!hasBeenShown)
+ if (windowState != newState)
{
+ // Post old styleWindowEvent with WINDOW_ICONIFIED or
+ // WINDOW_DEICONIFIED if appropriate.
+ if ((windowState & Frame.ICONIFIED) != 0
+ && (newState & Frame.ICONIFIED) == 0)
+ q().postEvent(new WindowEvent((Window) awtComponent,
+ WindowEvent.WINDOW_DEICONIFIED,
+ opposite, 0, 0));
+ else if ((windowState & Frame.ICONIFIED) == 0
+ && (newState & Frame.ICONIFIED) != 0)
+ q().postEvent(new WindowEvent((Window) awtComponent,
+ WindowEvent.WINDOW_ICONIFIED,
+ opposite, 0, 0));
+ // Post new-style WindowStateEvent.
q().postEvent (new WindowEvent ((Window) awtComponent, id,
- opposite));
- hasBeenShown = true;
- }
- }
- else if (id == WindowEvent.WINDOW_STATE_CHANGED)
- {
- if (oldState != newState)
- {
- q().postEvent (new WindowEvent ((Window) awtComponent, id, opposite,
- oldState, newState));
- oldState = newState;
+ opposite, windowState, newState));
+ windowState = newState;
}
}
else
@@ -350,13 +383,6 @@ public class GtkWindowPeer extends GtkContainerPeer
return g;
}
- protected void updateComponent (PaintEvent event)
- {
- // Do not clear anything before painting. Sun never calls
- // Window.update, only Window.paint.
- paintComponent(event);
- }
-
protected void postMouseEvent(int id, long when, int mods, int x, int y,
int clickCount, boolean popupTrigger)
{
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/VolatileImageGraphics.java b/libjava/classpath/gnu/java/awt/peer/gtk/VolatileImageGraphics.java
index 58496559320..62dbb45d81a 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/VolatileImageGraphics.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/VolatileImageGraphics.java
@@ -38,15 +38,32 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Composite;
import java.awt.Graphics;
+import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.Image;
+import java.awt.Point;
+import java.awt.Shape;
+import java.awt.Toolkit;
+import java.awt.font.GlyphVector;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
+import java.awt.image.Raster;
+import java.awt.image.WritableRaster;
+import java.util.Hashtable;
public class VolatileImageGraphics extends ComponentGraphics
{
private GtkVolatileImage owner;
+ private BufferedImage buffer;
public VolatileImageGraphics(GtkVolatileImage img)
{
@@ -77,10 +94,118 @@ public class VolatileImageGraphics extends ComponentGraphics
return new VolatileImageGraphics( this );
}
+ public void draw(Shape s)
+ {
+ if (comp == null || comp instanceof AlphaComposite)
+ super.draw(s);
+
+ // Custom composite
+ else
+ {
+ // Draw operation to temporary buffer
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setColor(this.getColor());
+ g2d.setStroke(this.getStroke());
+ g2d.draw(s);
+
+ drawComposite(s.getBounds2D(), null);
+ }
+ }
+
+ public void fill(Shape s)
+ {
+ if (comp == null || comp instanceof AlphaComposite)
+ super.fill(s);
+
+ // Custom composite
+ else
+ {
+ // Draw operation to temporary buffer
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setPaint(this.getPaint());
+ g2d.setColor(this.getColor());
+ g2d.fill(s);
+
+ drawComposite(s.getBounds2D(), null);
+ }
+ }
+
+ public void drawGlyphVector(GlyphVector gv, float x, float y)
+ {
+ if (comp == null || comp instanceof AlphaComposite)
+ super.drawGlyphVector(gv, x, y);
+
+ // Custom composite
+ else
+ {
+ // Draw operation to temporary buffer
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+
+ g2d.setPaint(this.getPaint());
+ g2d.setColor(this.getColor());
+ g2d.drawGlyphVector(gv, x, y);
+
+ Rectangle2D bounds = gv.getLogicalBounds();
+ bounds = new Rectangle2D.Double(x + bounds.getX(), y + bounds.getY(),
+ bounds.getWidth(), bounds.getHeight());
+ drawComposite(bounds, null);
+ }
+ }
+
+ protected boolean drawImage(Image img, AffineTransform xform,
+ Color bgcolor, ImageObserver obs)
+ {
+ if (comp == null || comp instanceof AlphaComposite)
+ return super.drawImage(img, xform, bgcolor, obs);
+
+ // Custom composite
+ else
+ {
+ // Get buffered image of source
+ if( !(img instanceof BufferedImage) )
+ {
+ ImageProducer source = img.getSource();
+ if (source == null)
+ return false;
+ img = Toolkit.getDefaultToolkit().createImage(source);
+ }
+ BufferedImage bImg = (BufferedImage) img;
+
+ // Find dimensions of translation
+ Point2D origin = new Point2D.Double(bImg.getMinX(), bImg.getMinY());
+ Point2D pt = new Point2D.Double(bImg.getWidth(), bImg.getHeight());
+ if (xform != null)
+ {
+ origin = xform.transform(origin, origin);
+ pt = xform.transform(pt, pt);
+ }
+
+ // Create buffer and draw image
+ createBuffer();
+
+ Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+ g2d.setRenderingHints(this.getRenderingHints());
+ g2d.drawImage(img, xform, obs);
+ // Perform compositing from buffer to screen
+ return drawComposite(new Rectangle2D.Double((int)origin.getX(),
+ (int)origin.getY(),
+ (int)pt.getX(),
+ (int)pt.getY()),
+ obs);
+ }
+ }
+
public boolean drawImage(Image img, int x, int y, ImageObserver observer)
{
- if( img instanceof GtkVolatileImage )
+ if (img instanceof GtkVolatileImage
+ && (comp == null || comp instanceof AlphaComposite))
{
owner.drawVolatile( ((GtkVolatileImage)img).nativePointer,
x, y,
@@ -94,7 +219,8 @@ public class VolatileImageGraphics extends ComponentGraphics
public boolean drawImage(Image img, int x, int y, int width, int height,
ImageObserver observer)
{
- if( img instanceof GtkVolatileImage )
+ if ((img instanceof GtkVolatileImage)
+ && (comp == null || comp instanceof AlphaComposite))
{
owner.drawVolatile( ((GtkVolatileImage)img).nativePointer,
x, y, width, height );
@@ -107,5 +233,84 @@ public class VolatileImageGraphics extends ComponentGraphics
{
return new Rectangle2D.Double(0, 0, owner.width, owner.height);
}
+
+ private boolean drawComposite(Rectangle2D bounds, ImageObserver observer)
+ {
+ // Clip source to visible areas that need updating
+ Rectangle2D clip = this.getClipBounds();
+ Rectangle2D.intersect(bounds, clip, bounds);
+
+ BufferedImage buffer2 = buffer;
+ if (!bounds.equals(buffer2.getRaster().getBounds()))
+ buffer2 = buffer2.getSubimage((int)bounds.getX(), (int)bounds.getY(),
+ (int)bounds.getWidth(),
+ (int)bounds.getHeight());
+
+ // Get current on-screen pixels (destination) and clip to bounds
+ BufferedImage current = owner.getSnapshot();
+
+ double[] points = new double[] {bounds.getX(), bounds.getY(),
+ bounds.getMaxX(), bounds.getMaxY()};
+ transform.transform(points, 0, points, 0, 2);
+
+ Rectangle2D deviceBounds = new Rectangle2D.Double(points[0], points[1],
+ points[2] - points[0],
+ points[3] - points[1]);
+ Rectangle2D.intersect(deviceBounds, this.getClipInDevSpace(), deviceBounds);
+
+ current = current.getSubimage((int)deviceBounds.getX(),
+ (int)deviceBounds.getY(),
+ (int)deviceBounds.getWidth(),
+ (int)deviceBounds.getHeight());
+
+ // Perform actual composite operation
+ compCtx.compose(buffer2.getRaster(), current.getRaster(),
+ buffer2.getRaster());
+
+ // This MUST call directly into the "action" method in CairoGraphics2D,
+ // not one of the wrappers, to ensure that the composite isn't processed
+ // more than once!
+ Composite oldComp = comp; // so that ComponentGraphics doesn't
+ comp = null; // process the composite again
+ boolean rv = super.drawImage(buffer2,
+ AffineTransform.getTranslateInstance(bounds.getX(),
+ bounds.getY()),
+ null, null);
+ comp = oldComp;
+
+ return rv;
+ }
+
+ private void createBuffer()
+ {
+ if (buffer == null)
+ {
+ WritableRaster rst;
+ rst = Raster.createWritableRaster(GtkVolatileImage.createGdkSampleModel(owner.width,
+ owner.height),
+ new Point(0,0));
+
+ buffer = new BufferedImage(GtkVolatileImage.gdkColorModel, rst,
+ GtkVolatileImage.gdkColorModel.isAlphaPremultiplied(),
+ new Hashtable());
+ }
+ else
+ {
+ Graphics2D g2d = ((Graphics2D)buffer.getGraphics());
+
+ g2d.setBackground(new Color(0,0,0,0));
+ g2d.clearRect(0, 0, buffer.getWidth(), buffer.getHeight());
+ }
+ }
+
+ protected ColorModel getNativeCM()
+ {
+ // We should really return GtkVolatileImage.gdkColorModel ,
+ // but CairoGraphics2D doesn't handle alpha premultiplication properly (see
+ // the fixme in drawImage) so we use the naive Cairo model instead to trick
+ // the compositing context.
+ // Because getNativeCM() == getBufferCM() for this peer, it doesn't break.
+ return CairoSurface.cairoCM_pre;
+ }
}
diff --git a/libjava/classpath/gnu/java/awt/peer/headless/HeadlessGraphicsEnvironment.java b/libjava/classpath/gnu/java/awt/peer/headless/HeadlessGraphicsEnvironment.java
new file mode 100644
index 00000000000..b3eeb1baa84
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/peer/headless/HeadlessGraphicsEnvironment.java
@@ -0,0 +1,118 @@
+/* HeadlessGraphicsEnvironment.java -- A graphics environment for headless mode
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.peer.headless;
+
+import gnu.java.awt.java2d.RasterGraphics;
+
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
+import java.awt.image.BufferedImage;
+import java.awt.image.Raster;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.util.Locale;
+
+public class HeadlessGraphicsEnvironment
+ extends GraphicsEnvironment
+{
+
+ public Graphics2D createGraphics(BufferedImage image)
+ {
+ Graphics2D g2d;
+ try
+ {
+ // Try to get a CairoGraphics (accellerated) when available. Do this
+ // via reflection to avoid having a hard compile time dependency.
+ Class cairoSurfaceCl =
+ Class.forName("gnu.java.awt.peer.gtk.CairoSurface");
+ Raster raster = image.getRaster();
+ if (cairoSurfaceCl.isInstance(raster))
+ {
+ Method getGraphicsM = cairoSurfaceCl.getMethod("getGraphics",
+ new Class[0]);
+ g2d = (Graphics2D) getGraphicsM.invoke(raster, new Object[0]);
+ }
+ else
+ {
+ Class bigCl =
+ Class.forName("gnu.java.awt.peer.gtk.BufferedImageGraphics");
+ Constructor bigC =
+ bigCl.getConstructor(new Class[]{BufferedImage.class });
+ g2d = (Graphics2D) bigC.newInstance(new Object[]{ image});
+ }
+ }
+ catch (Exception ex)
+ {
+ g2d = new RasterGraphics(image.getRaster(), image.getColorModel());
+ }
+ return g2d;
+ }
+
+ public Font[] getAllFonts()
+ {
+ // FIXME: Implement.
+ return null;
+ }
+
+ public String[] getAvailableFontFamilyNames()
+ {
+ // FIXME: Implement.
+ return null;
+ }
+
+ public String[] getAvailableFontFamilyNames(Locale l)
+ {
+ // FIXME: Implement.
+ return null;
+ }
+
+ public GraphicsDevice getDefaultScreenDevice()
+ {
+ throw new HeadlessException();
+ }
+
+ public GraphicsDevice[] getScreenDevices()
+ {
+ throw new HeadlessException();
+ }
+
+}
diff --git a/libjava/classpath/gnu/java/awt/peer/headless/HeadlessToolkit.java b/libjava/classpath/gnu/java/awt/peer/headless/HeadlessToolkit.java
new file mode 100644
index 00000000000..96798c9e9d8
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/peer/headless/HeadlessToolkit.java
@@ -0,0 +1,371 @@
+/* HeadlessToolkit.java -- A toolkit for headless mode
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.peer.headless;
+
+import gnu.java.awt.ClasspathToolkit;
+import gnu.java.awt.EmbeddedWindow;
+import gnu.java.awt.peer.ClasspathFontPeer;
+import gnu.java.awt.peer.EmbeddedWindowPeer;
+
+import java.awt.AWTException;
+import java.awt.Button;
+import java.awt.Canvas;
+import java.awt.Checkbox;
+import java.awt.CheckboxMenuItem;
+import java.awt.Choice;
+import java.awt.Dialog;
+import java.awt.Dimension;
+import java.awt.EventQueue;
+import java.awt.FileDialog;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Frame;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
+import java.awt.Image;
+import java.awt.Label;
+import java.awt.List;
+import java.awt.Menu;
+import java.awt.MenuBar;
+import java.awt.MenuItem;
+import java.awt.Panel;
+import java.awt.PopupMenu;
+import java.awt.PrintJob;
+import java.awt.ScrollPane;
+import java.awt.Scrollbar;
+import java.awt.TextArea;
+import java.awt.TextField;
+import java.awt.Window;
+import java.awt.datatransfer.Clipboard;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.peer.DragSourceContextPeer;
+import java.awt.im.InputMethodHighlight;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
+import java.awt.peer.ButtonPeer;
+import java.awt.peer.CanvasPeer;
+import java.awt.peer.CheckboxMenuItemPeer;
+import java.awt.peer.CheckboxPeer;
+import java.awt.peer.ChoicePeer;
+import java.awt.peer.DialogPeer;
+import java.awt.peer.FileDialogPeer;
+import java.awt.peer.FontPeer;
+import java.awt.peer.FramePeer;
+import java.awt.peer.LabelPeer;
+import java.awt.peer.ListPeer;
+import java.awt.peer.MenuBarPeer;
+import java.awt.peer.MenuItemPeer;
+import java.awt.peer.MenuPeer;
+import java.awt.peer.PanelPeer;
+import java.awt.peer.PopupMenuPeer;
+import java.awt.peer.RobotPeer;
+import java.awt.peer.ScrollPanePeer;
+import java.awt.peer.ScrollbarPeer;
+import java.awt.peer.TextAreaPeer;
+import java.awt.peer.TextFieldPeer;
+import java.awt.peer.WindowPeer;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Map;
+import java.util.Properties;
+
+public class HeadlessToolkit
+ extends ClasspathToolkit
+{
+
+ /**
+ * The graphics environment for headless graphics.
+ */
+ private HeadlessGraphicsEnvironment graphicsEnv;
+
+ public void beep()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public int checkImage(Image image, int width, int height,
+ ImageObserver observer)
+ {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ protected ButtonPeer createButton(Button target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected CanvasPeer createCanvas(Canvas target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected CheckboxPeer createCheckbox(Checkbox target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected ChoicePeer createChoice(Choice target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected DialogPeer createDialog(Dialog target)
+ {
+ throw new HeadlessException();
+ }
+
+ public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent e)
+ {
+ throw new HeadlessException();
+ }
+
+ protected FileDialogPeer createFileDialog(FileDialog target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected FramePeer createFrame(Frame target)
+ {
+ throw new HeadlessException();
+ }
+
+ public Image createImage(String filename)
+ {
+ // FIXME: Implement.
+ return null;
+ }
+
+ public Image createImage(URL url)
+ {
+ // FIXME: Implement.
+ return null;
+ }
+
+ public Image createImage(ImageProducer producer)
+ {
+ // FIXME: Implement.
+ return null;
+ }
+
+ public Image createImage(byte[] data, int offset, int len)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ protected LabelPeer createLabel(Label target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected ListPeer createList(List target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected MenuPeer createMenu(Menu target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected MenuBarPeer createMenuBar(MenuBar target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected MenuItemPeer createMenuItem(MenuItem target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected PanelPeer createPanel(Panel target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected PopupMenuPeer createPopupMenu(PopupMenu target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected ScrollPanePeer createScrollPane(ScrollPane target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected ScrollbarPeer createScrollbar(Scrollbar target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected TextAreaPeer createTextArea(TextArea target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected TextFieldPeer createTextField(TextField target)
+ {
+ throw new HeadlessException();
+ }
+
+ protected WindowPeer createWindow(Window target)
+ {
+ throw new HeadlessException();
+ }
+
+ public ColorModel getColorModel()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String[] getFontList()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public FontMetrics getFontMetrics(Font name)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ protected FontPeer getFontPeer(String name, int style)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Image getImage(String name)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Image getImage(URL url)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public PrintJob getPrintJob(Frame frame, String title, Properties props)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public int getScreenResolution()
+ {
+ throw new HeadlessException();
+ }
+
+ public Dimension getScreenSize()
+ {
+ throw new HeadlessException();
+ }
+
+ public Clipboard getSystemClipboard()
+ {
+ throw new HeadlessException();
+ }
+
+ protected EventQueue getSystemEventQueueImpl()
+ {
+ throw new HeadlessException();
+ }
+
+ public Map mapInputMethodHighlight(InputMethodHighlight highlight)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean prepareImage(Image image, int width, int height,
+ ImageObserver observer)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void sync()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public EmbeddedWindowPeer createEmbeddedWindow(EmbeddedWindow w)
+ {
+ throw new HeadlessException();
+ }
+
+ public Font createFont(int format, InputStream stream)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public RobotPeer createRobot(GraphicsDevice screen) throws AWTException
+ {
+ throw new HeadlessException();
+ }
+
+ public ClasspathFontPeer getClasspathFontPeer(String name, Map attrs)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public GraphicsEnvironment getLocalGraphicsEnvironment()
+ {
+ if (graphicsEnv == null)
+ graphicsEnv = new HeadlessGraphicsEnvironment();
+ return graphicsEnv;
+ }
+
+}
diff --git a/libjava/classpath/gnu/java/awt/peer/qt/QtFontPeer.java b/libjava/classpath/gnu/java/awt/peer/qt/QtFontPeer.java
index d847a805396..6ffe3f69176 100644
--- a/libjava/classpath/gnu/java/awt/peer/qt/QtFontPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/qt/QtFontPeer.java
@@ -194,15 +194,4 @@ public class QtFontPeer extends ClasspathFontPeer
throw new UnsupportedOperationException();
}
- public Rectangle2D getStringBounds (Font font,
- CharacterIterator ci,
- int begin, int limit,
- FontRenderContext frc)
- {
- int index = begin;
- String s = "" + ci.setIndex( index );
- while( index++ <= limit )
- s = s + ci.next();
- return metrics.getStringBounds(s);
- }
}
diff --git a/libjava/classpath/gnu/java/awt/peer/qt/QtGraphics.java b/libjava/classpath/gnu/java/awt/peer/qt/QtGraphics.java
index 842cbbbf8ba..5694e8d2076 100644
--- a/libjava/classpath/gnu/java/awt/peer/qt/QtGraphics.java
+++ b/libjava/classpath/gnu/java/awt/peer/qt/QtGraphics.java
@@ -669,12 +669,13 @@ public abstract class QtGraphics extends Graphics2D
public RenderingHints getRenderingHints()
{
- return new RenderingHints( renderingHints );
+ return (RenderingHints) renderingHints.clone();
}
- public void setRenderingHints(Map hints)
+ public void setRenderingHints(Map<?,?> hints)
{
- renderingHints = new RenderingHints( hints );
+ renderingHints = new RenderingHints( null );
+ renderingHints.putAll(hints);
updateRenderingHints();
}
diff --git a/libjava/classpath/gnu/java/awt/peer/swing/SwingButtonPeer.java b/libjava/classpath/gnu/java/awt/peer/swing/SwingButtonPeer.java
index 2357fcbfb0d..531d6f2db3b 100644
--- a/libjava/classpath/gnu/java/awt/peer/swing/SwingButtonPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/swing/SwingButtonPeer.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package gnu.java.awt.peer.swing;
import java.awt.Button;
+import java.awt.Container;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
@@ -69,6 +70,13 @@ public class SwingButtonPeer
extends JButton
implements SwingComponent
{
+ Button button;
+
+ SwingButton(Button button)
+ {
+ this.button = button;
+ }
+
/**
* Overridden so that this method returns the correct value even without a
* peer.
@@ -90,8 +98,8 @@ public class SwingButtonPeer
public boolean isShowing()
{
boolean retVal = false;
- if (SwingButtonPeer.this.awtComponent != null)
- retVal = SwingButtonPeer.this.awtComponent.isShowing();
+ if (button != null)
+ retVal = button.isShowing();
return retVal;
}
@@ -168,6 +176,14 @@ public class SwingButtonPeer
ev.setSource(this);
processKeyEvent(ev);
}
+
+ public Container getParent()
+ {
+ Container par = null;
+ if (button != null)
+ par = button.getParent();
+ return par;
+ }
}
/**
@@ -205,7 +221,7 @@ public class SwingButtonPeer
*/
public SwingButtonPeer(Button theButton)
{
- SwingButton button = new SwingButton();
+ SwingButton button = new SwingButton(theButton);
button.setText(theButton.getLabel());
button.addActionListener(new SwingButtonListener());
init(theButton, button);
diff --git a/libjava/classpath/gnu/java/awt/peer/swing/SwingComponent.java b/libjava/classpath/gnu/java/awt/peer/swing/SwingComponent.java
index a51b758adf0..04ca7294f78 100644
--- a/libjava/classpath/gnu/java/awt/peer/swing/SwingComponent.java
+++ b/libjava/classpath/gnu/java/awt/peer/swing/SwingComponent.java
@@ -62,7 +62,7 @@ public interface SwingComponent
/**
* Handles a mouse event. This is usually forwarded to
- * {@link java.awt.Component#processMouseMotionEvent(MouseEvent)} of the swing
+ * {@link Component#processMouseMotionEvent(MouseEvent)} of the swing
* component.
*
* @param ev the mouse event
@@ -71,7 +71,7 @@ public interface SwingComponent
/**
* Handles a mouse motion event. This is usually forwarded to
- * {@link java.awt.Component#processMouseEvent(MouseEvent)} of the swing
+ * {@link Component#processMouseEvent(MouseEvent)} of the swing
* component.
*
* @param ev the mouse motion event
@@ -80,7 +80,7 @@ public interface SwingComponent
/**
* Handles a key event. This is usually forwarded to
- * {@link java.awt.Component#processKeyEvent(KeyEvent)} of the swing
+ * {@link Component#processKeyEvent(KeyEvent)} of the swing
* component.
*
* @param ev the key event
diff --git a/libjava/classpath/gnu/java/awt/peer/swing/SwingComponentPeer.java b/libjava/classpath/gnu/java/awt/peer/swing/SwingComponentPeer.java
index 96ccc00b8f0..bfa14dddee3 100644
--- a/libjava/classpath/gnu/java/awt/peer/swing/SwingComponentPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/swing/SwingComponentPeer.java
@@ -42,6 +42,7 @@ import java.awt.AWTException;
import java.awt.BufferCapabilities;
import java.awt.Color;
import java.awt.Component;
+import java.awt.Container;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Font;
@@ -62,6 +63,10 @@ import java.awt.image.ImageProducer;
import java.awt.image.VolatileImage;
import java.awt.peer.ComponentPeer;
import java.awt.peer.ContainerPeer;
+import java.awt.peer.LightweightPeer;
+
+import javax.swing.JComponent;
+import javax.swing.RepaintManager;
/**
* The base class for Swing based component peers. This provides the basic
@@ -97,9 +102,18 @@ public class SwingComponentPeer
protected SwingComponent swingComponent;
/**
+ * The font that is set for this peer.
+ */
+ protected Font peerFont;
+
+ /**
+ * The current repaint area.
+ */
+ protected Rectangle paintArea;
+
+ /**
* Creates a SwingComponentPeer instance. Subclasses are expected to call
- * this constructor and thereafter call
- * {@link #init(Component,SwingComponent)}
+ * this constructor and thereafter call {@link #init(Component, JComponent)}
* in order to setup the AWT and Swing components properly.
*/
protected SwingComponentPeer()
@@ -118,6 +132,38 @@ public class SwingComponentPeer
{
awtComponent = awtComp;
swingComponent = swingComp;
+ if (swingComponent != null)
+ {
+ JComponent c = swingComponent.getJComponent();
+ if (c != null)
+ {
+ c.addNotify();
+ RepaintManager.currentManager(c).setDoubleBufferingEnabled(false);
+ System.setProperty("gnu.awt.swing.doublebuffering", "true");
+ }
+ }
+
+ // Register this heavyweight component with the nearest heavyweight
+ // container, so we get peerPaint() triggered by that container.
+ if (! (this instanceof LightweightPeer))
+ {
+ Component comp = awtComponent;
+ Container parent = comp.getParent();
+ while (parent != null &&
+ ! (parent.getPeer() instanceof SwingContainerPeer))
+ {
+ comp = parent;
+ parent = comp.getParent();
+ }
+
+ // At this point we have the ancestor with a SwingContainerPeer
+ // (or null peer).
+ if (parent != null && parent.getPeer() instanceof SwingContainerPeer)
+ {
+ SwingContainerPeer p = (SwingContainerPeer) parent.getPeer();
+ p.addHeavyweightDescendent(awtComponent);
+ }
+ }
}
/**
@@ -185,6 +231,28 @@ public class SwingComponentPeer
*/
public void dispose()
{
+ // Unregister this heavyweight component from the nearest heavyweight
+ // container.
+ if (! (this instanceof LightweightPeer))
+ {
+ Component comp = awtComponent;
+ Container parent = comp.getParent();
+ while (parent != null &&
+ ! (parent.getPeer() instanceof SwingContainerPeer))
+ {
+ comp = parent;
+ parent = comp.getParent();
+ }
+
+ // At this point we have the ancestor with a SwingContainerPeer
+ // (or null peer).
+ if (parent != null && parent.getPeer() instanceof SwingContainerPeer)
+ {
+ SwingContainerPeer p = (SwingContainerPeer) parent.getPeer();
+ p.removeHeavyweightDescendent(awtComponent);
+ }
+ }
+
awtComponent = null;
swingComponent = null;
}
@@ -244,8 +312,7 @@ public class SwingComponentPeer
public Graphics getGraphics()
{
Component parent = awtComponent.getParent();
- ComponentPeer parentPeer = parent.getPeer();
- Graphics g = parentPeer.getGraphics();
+ Graphics g = parent.getGraphics();
g.translate(awtComponent.getX(), awtComponent.getY());
g.setClip(0, 0, awtComponent.getWidth(), awtComponent.getHeight());
return g;
@@ -331,23 +398,28 @@ public class SwingComponentPeer
{
case PaintEvent.UPDATE:
case PaintEvent.PAINT:
- // This only will work when the component is showing.
- if (awtComponent.isShowing())
+ // Need to synchronize to avoid threading problems on the
+ // paint event list.
+ // We must synchronize on the tree lock first to avoid deadlock,
+ // because Container.paint() will grab it anyway.
+ synchronized (this)
{
- Graphics g = getGraphics();
- Rectangle clip = ((PaintEvent)e).getUpdateRect();
- g.clipRect(clip.x, clip.y, clip.width, clip.height);
- //if (this instanceof LightweightPeer)
- // {
- if (e.getID() == PaintEvent.UPDATE)
- awtComponent.update(g);
- else
- awtComponent.paint(g);
- // }
- // We paint the 'heavyweights' at last, so that they appear on top of
- // everything else.
- peerPaint(g);
- g.dispose();
+ assert paintArea != null;
+ if (awtComponent.isShowing())
+ {
+ Graphics g = awtComponent.getGraphics();
+ try
+ {
+ Rectangle clip = paintArea;
+ g.clipRect(clip.x, clip.y, clip.width, clip.height);
+ peerPaint(g, e.getID() == PaintEvent.UPDATE);
+ }
+ finally
+ {
+ g.dispose();
+ paintArea = null;
+ }
+ }
}
break;
case MouseEvent.MOUSE_PRESSED:
@@ -451,9 +523,15 @@ public class SwingComponentPeer
return retVal;
}
+ /**
+ * Paints the component. This is triggered by
+ * {@link Component#paintAll(Graphics)}.
+ *
+ * @param graphics the graphics to paint with
+ */
public void paint(Graphics graphics)
{
- // FIXME: I don't know what this method is supposed to do.
+ peerPaint(graphics, false);
}
/**
@@ -634,6 +712,7 @@ public class SwingComponentPeer
*/
public void setFont(Font font)
{
+ peerFont = font;
if (swingComponent != null)
swingComponent.getJComponent().setFont(font);
}
@@ -741,7 +820,14 @@ public class SwingComponentPeer
*/
public void coalescePaintEvent(PaintEvent e)
{
- // Nothing to do here yet.
+ synchronized (this)
+ {
+ Rectangle newRect = e.getUpdateRect();
+ if (paintArea == null)
+ paintArea = newRect;
+ else
+ Rectangle.union(paintArea, newRect, paintArea);
+ }
}
/**
@@ -947,9 +1033,33 @@ public class SwingComponentPeer
* paint() on the Swing component.
*
* @param g the graphics context to use for painting
+ * @param update wether we need to call update or paint on the AWT component
+ */
+ protected void peerPaint(Graphics g, boolean update)
+ {
+ peerPaintComponent(g);
+
+ Graphics userGraphics = g.create();
+ try{
+ if (update)
+ awtComponent.update(userGraphics);
+ else
+ awtComponent.paint(userGraphics);
+ } finally {
+ userGraphics.dispose();
+ }
+
+ }
+
+ /**
+ * Paints the actual 'heavyweight' swing component, if there is one
+ * associated to this peer.
+ *
+ * @param g the graphics to paint the component with
*/
- protected void peerPaint(Graphics g)
+ protected void peerPaintComponent(Graphics g)
{
+ // Paint the actual Swing component if this peer has one.
if (swingComponent != null)
swingComponent.getJComponent().paint(g);
}
diff --git a/libjava/classpath/gnu/java/awt/peer/swing/SwingContainerPeer.java b/libjava/classpath/gnu/java/awt/peer/swing/SwingContainerPeer.java
index f433e1b5c2d..c78b644a765 100644
--- a/libjava/classpath/gnu/java/awt/peer/swing/SwingContainerPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/swing/SwingContainerPeer.java
@@ -37,14 +37,20 @@ exception statement from your version. */
package gnu.java.awt.peer.swing;
+import gnu.classpath.SystemProperties;
+
import java.awt.Component;
import java.awt.Container;
import java.awt.Graphics;
+import java.awt.Image;
import java.awt.Insets;
-import java.awt.Shape;
+import java.awt.Rectangle;
+import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.peer.ComponentPeer;
import java.awt.peer.ContainerPeer;
+import java.util.Iterator;
+import java.util.LinkedList;
/**
* A peer for Container to be used with the Swing based AWT peers.
@@ -57,13 +63,53 @@ public class SwingContainerPeer
{
/**
+ * Stores all heavyweight descendents of the container. This is used
+ * in {@link #peerPaintChildren(Graphics)}.
+ */
+ private LinkedList heavyweightDescendents;
+
+ /**
+ * The backbuffer used for painting UPDATE events.
+ */
+ private Image backbuffer;
+
+ /**
* Creates a new SwingContainerPeer.
*
* @param awtCont
*/
- public SwingContainerPeer(Component awtCont)
+ public SwingContainerPeer(Container awtCont)
+ {
+ heavyweightDescendents = new LinkedList();
+ }
+
+ /**
+ * Registers a heavyweight descendent. This is then painted by
+ * {@link #peerPaintChildren(Graphics)}.
+ *
+ * @param comp the descendent to register
+ *
+ * @see #peerPaintChildren(Graphics)
+ * @see #removeHeavyweightDescendent(Component)
+ */
+ synchronized void addHeavyweightDescendent(Component comp)
+ {
+ heavyweightDescendents.add(comp);
+ focusOwner = null;
+ }
+
+ /**
+ * Unregisters a heavyweight descendent.
+ *
+ * @param comp the descendent to unregister
+ *
+ * @see #peerPaintChildren(Graphics)
+ * @see #addHeavyweightDescendent(Component)
+ */
+ synchronized void removeHeavyweightDescendent(Component comp)
{
- init(awtCont, null);
+ heavyweightDescendents.remove(comp);
+ focusOwner = null;
}
/**
@@ -92,12 +138,7 @@ public class SwingContainerPeer
*/
public Insets getInsets()
{
- Insets retVal;
- if (swingComponent != null)
- retVal = swingComponent.getJComponent().getInsets();
- else
- retVal = new Insets(0, 0, 0, 0);
- return retVal;
+ return insets();
}
/**
@@ -171,38 +212,83 @@ public class SwingContainerPeer
}
/**
- * Triggers painting of a component. This calls peerPaint on all the child
- * components of this container.
- *
- * @param g the graphics context to paint to
+ * Performs the super behaviour (call peerPaintComponent() and
+ * awtComponent.paint()), and forwards the paint request to the heavyweight
+ * descendents of the container.
*/
- protected void peerPaint(Graphics g)
+ protected void peerPaint(Graphics g, boolean update)
{
- Container c = (Container) awtComponent;
- Component[] children = c.getComponents();
- for (int i = children.length - 1; i >= 0; --i)
+ if (isDoubleBuffering())
{
- Component child = children[i];
- ComponentPeer peer = child.getPeer();
- boolean translated = false;
- boolean clipped = false;
- Shape oldClip = g.getClip();
+ int width = awtComponent.getWidth();
+ int height = awtComponent.getHeight();
+ if (backbuffer == null
+ || backbuffer.getWidth(awtComponent) < width
+ || backbuffer.getHeight(awtComponent) < height)
+ backbuffer = awtComponent.createImage(width, height);
+ Graphics g2 = backbuffer.getGraphics();
+ Rectangle clip = g.getClipRect();
try
- {
- g.translate(child.getX(), child.getY());
- translated = true;
- g.setClip(0, 0, child.getWidth(), child.getHeight());
- clipped = true;
- if (peer instanceof SwingComponentPeer)
- ((SwingComponentPeer) peer).peerPaint(g);
- }
+ {
+ g2.setClip(clip);
+ super.peerPaint(g2, update);
+ peerPaintChildren(g2);
+ }
finally
- {
- if (translated)
- g.translate(- child.getX(), - child.getY());
- if (clipped)
- g.setClip(oldClip);
- }
+ {
+ g2.dispose();
+ }
+ g.drawImage(backbuffer, 0, 0, awtComponent);
+ }
+ else
+ {
+ super.peerPaint(g, update);
+ peerPaintChildren(g);
+ }
+ }
+
+ /**
+ * Determines if we should do double buffering or not.
+ *
+ * @return if we should do double buffering or not
+ */
+ private boolean isDoubleBuffering()
+ {
+ Object prop =
+ SystemProperties.getProperty("gnu.awt.swing.doublebuffering", "false");
+ return prop.equals("true");
+ }
+
+ /**
+ * Paints any heavyweight child components.
+ *
+ * @param g the graphics to use for painting
+ */
+ protected synchronized void peerPaintChildren(Graphics g)
+ {
+ // TODO: Is this the right painting order?
+ for (Iterator i = heavyweightDescendents.iterator(); i.hasNext();)
+ {
+ Component child = (Component) i.next();
+ ComponentPeer peer = child.getPeer();
+
+ if (peer instanceof SwingComponentPeer && child.isVisible())
+ {
+ // TODO: The translation here doesn't work for deeper
+ // nested children. Fix this!
+ Graphics g2 = g.create(child.getX(), child.getY(),
+ child.getWidth(), child.getHeight());
+ try
+ {
+ // update() is only called for the topmost component if
+ // necessary, all other components only get paint() called.
+ ((SwingComponentPeer) peer).peerPaint(g2, false);
+ }
+ finally
+ {
+ g2.dispose();
+ }
+ }
}
}
@@ -214,17 +300,13 @@ public class SwingContainerPeer
protected void handleMouseEvent(MouseEvent ev)
{
Component comp = awtComponent.getComponentAt(ev.getPoint());
- if(comp == null)
- comp = awtComponent;
- if (comp != null)
+ if(comp == null) comp = awtComponent;
+ ComponentPeer peer = comp.getPeer();
+ if (awtComponent != comp && !comp.isLightweight() && peer instanceof SwingComponentPeer)
{
- ComponentPeer peer = comp.getPeer();
- if (awtComponent != comp && !comp.isLightweight() && peer instanceof SwingComponentPeer)
- {
- ev.translatePoint(comp.getX(), comp.getY());
- ev.setSource(comp);
- ((SwingComponentPeer) peer).handleMouseEvent(ev);
- }
+ ev.translatePoint(comp.getX(), comp.getY());
+ ev.setSource(comp);
+ ((SwingComponentPeer) peer).handleMouseEvent(ev);
}
}
@@ -246,4 +328,39 @@ public class SwingContainerPeer
}
}
}
+
+ /**
+ * Handles key events on the component. This is usually forwarded to the
+ * SwingComponent's processKeyEvent() method.
+ *
+ * @param e the key event
+ */
+ protected void handleKeyEvent(KeyEvent e)
+ {
+ Component owner = getFocusOwner();
+ if(owner != null)
+ owner.dispatchEvent(e);
+ else
+ super.handleKeyEvent(e);
+ }
+
+ private Component focusOwner = null;
+
+ private Component getFocusOwner()
+ {
+ if(focusOwner == null)
+ {
+ for(Iterator iter=heavyweightDescendents.iterator(); iter.hasNext();)
+ {
+ Component child = (Component) iter.next();
+ if(child.isFocusable())
+ {
+ focusOwner = child;
+ break;
+ }
+ }
+ }
+ return focusOwner;
+ }
+
}
diff --git a/libjava/classpath/gnu/java/awt/peer/swing/SwingFramePeer.java b/libjava/classpath/gnu/java/awt/peer/swing/SwingFramePeer.java
index 0d5a02d78f6..56c7417cdcf 100644
--- a/libjava/classpath/gnu/java/awt/peer/swing/SwingFramePeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/swing/SwingFramePeer.java
@@ -43,6 +43,7 @@ import java.awt.Insets;
import java.awt.MenuBar;
import java.awt.Point;
import java.awt.event.MouseEvent;
+import java.awt.peer.ComponentPeer;
import java.awt.peer.FramePeer;
/**
@@ -53,9 +54,9 @@ import java.awt.peer.FramePeer;
* As a minimum, a subclass must implement all the remaining abstract methods
* as well as the following methods:
* <ul>
- * <li>{@link java.awt.peer.ComponentPeer#getLocationOnScreen()}</li>
- * <li>{@link java.awt.peer.ComponentPeer#getGraphics()}</li>
- * <li>{@link java.awt.peer.ComponentPeer#createImage(int, int)}</li>
+ * <li>{@link ComponentPeer#getLocationOnScreen()}</li>
+ * <li>{@link ComponentPeer#getGraphics()}</li>
+ * <li>{@link ComponentPeer#createImage(int, int)}</li>
* </ul>
*
* @author Roman Kennke (kennke@aicas.com)
@@ -97,9 +98,9 @@ public abstract class SwingFramePeer
*
* @param g the graphics context to use for painting
*/
- protected void peerPaint(Graphics g)
+ protected void peerPaintComponent(Graphics g)
{
- super.peerPaint(g);
+ super.peerPaintComponent(g);
if (menuBar != null)
menuBar.peerPaint(g);
}
diff --git a/libjava/classpath/gnu/java/awt/peer/swing/SwingLabelPeer.java b/libjava/classpath/gnu/java/awt/peer/swing/SwingLabelPeer.java
index dd86fff2d10..349c5a0abe2 100644
--- a/libjava/classpath/gnu/java/awt/peer/swing/SwingLabelPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/swing/SwingLabelPeer.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package gnu.java.awt.peer.swing;
+import java.awt.Container;
+import java.awt.Graphics;
import java.awt.Image;
import java.awt.Label;
import java.awt.Point;
@@ -67,7 +69,14 @@ public class SwingLabelPeer
extends JLabel
implements SwingComponent
{
-
+ Label label;
+
+
+ SwingLabel(Label label)
+ {
+ this.label = label;
+ }
+
/**
* Returns this label.
*
@@ -131,8 +140,8 @@ public class SwingLabelPeer
public boolean isShowing()
{
boolean retVal = false;
- if (SwingLabelPeer.this.awtComponent != null)
- retVal = SwingLabelPeer.this.awtComponent.isShowing();
+ if (label != null)
+ retVal = label.isShowing();
return retVal;
}
@@ -149,7 +158,19 @@ public class SwingLabelPeer
{
return SwingLabelPeer.this.createImage(w, h);
}
-
+
+ public Graphics getGraphics()
+ {
+ return SwingLabelPeer.this.getGraphics();
+ }
+
+ public Container getParent()
+ {
+ Container par = null;
+ if (label != null)
+ par = label.getParent();
+ return par;
+ }
}
/**
@@ -160,11 +181,11 @@ public class SwingLabelPeer
public SwingLabelPeer(Label label)
{
super();
- SwingLabel swingLabel = new SwingLabel();
+ SwingLabel swingLabel = new SwingLabel(label);
swingLabel.setText(label.getText());
- swingLabel.setHorizontalAlignment(label.getAlignment());
swingLabel.setOpaque(true);
init(label, swingLabel);
+ setAlignment(label.getAlignment());
}
/**
@@ -190,7 +211,20 @@ public class SwingLabelPeer
*/
public void setAlignment(int alignment)
{
- ((JLabel) swingComponent.getJComponent()).setHorizontalAlignment(alignment);
+ JLabel swingLabel = (JLabel) swingComponent.getJComponent();
+ switch (alignment)
+ {
+ case Label.RIGHT:
+ swingLabel.setHorizontalAlignment(JLabel.RIGHT);
+ break;
+ case Label.CENTER:
+ swingLabel.setHorizontalAlignment(JLabel.CENTER);
+ break;
+ case Label.LEFT:
+ default:
+ swingLabel.setHorizontalAlignment(JLabel.LEFT);
+ break;
+ }
}
}
diff --git a/libjava/classpath/gnu/java/awt/peer/swing/SwingListPeer.java b/libjava/classpath/gnu/java/awt/peer/swing/SwingListPeer.java
new file mode 100644
index 00000000000..aca2070486d
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/peer/swing/SwingListPeer.java
@@ -0,0 +1,352 @@
+/* SwingListPeer.java -- A Swing based peer for AWT lists
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.java.awt.peer.swing;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.List;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.awt.peer.ListPeer;
+
+import javax.swing.DefaultListModel;
+import javax.swing.JComponent;
+import javax.swing.JList;
+import javax.swing.JScrollPane;
+import javax.swing.ListSelectionModel;
+
+public class SwingListPeer
+ extends SwingComponentPeer
+ implements ListPeer
+{
+
+ /**
+ * A spezialized Swing scroller used to hold the list.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+ private class SwingList
+ extends JScrollPane
+ implements SwingComponent
+ {
+
+ SwingList(Component comp)
+ {
+ super(comp, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
+ JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
+ }
+
+ /**
+ * Returns this label.
+ *
+ * @return <code>this</code>
+ */
+ public JComponent getJComponent()
+ {
+ return this;
+ }
+
+ /**
+ * Handles mouse events by forwarding it to
+ * <code>processMouseEvent()</code>.
+ *
+ * @param ev the mouse event
+ */
+ public void handleMouseEvent(MouseEvent ev)
+ {
+ ev.setSource(this);
+ dispatchEvent(ev);
+ }
+
+ /**
+ * Force lightweight mouse dispatching.
+ */
+ public boolean isLightweight()
+ {
+ return false;
+ }
+
+ /**
+ * Handles mouse motion events by forwarding it to
+ * <code>processMouseMotionEvent()</code>.
+ *
+ * @param ev the mouse motion event
+ */
+ public void handleMouseMotionEvent(MouseEvent ev)
+ {
+ processMouseMotionEvent(ev);
+ }
+
+ /**
+ * Handles key events by forwarding it to <code>processKeyEvent()</code>.
+ *
+ * @param ev the mouse event
+ */
+ public void handleKeyEvent(KeyEvent ev)
+ {
+ processKeyEvent(ev);
+ }
+
+ /**
+ * Overridden so that this method returns the correct value even without a
+ * peer.
+ *
+ * @return the screen location of the button
+ */
+ public Point getLocationOnScreen()
+ {
+ return SwingListPeer.this.getLocationOnScreen();
+ }
+
+ /**
+ * Overridden so that the isShowing method returns the correct value for the
+ * swing button, even if it has no peer on its own.
+ *
+ * @return <code>true</code> if the button is currently showing,
+ * <code>false</code> otherwise
+ */
+ public boolean isShowing()
+ {
+ boolean retVal = false;
+ if (SwingListPeer.this.awtComponent != null)
+ retVal = SwingListPeer.this.awtComponent.isShowing();
+ return retVal;
+ }
+
+ /**
+ * Overridden, so that the Swing button can create an Image without its
+ * own peer.
+ *
+ * @param w the width of the image
+ * @param h the height of the image
+ *
+ * @return an image
+ */
+ public Image createImage(int w, int h)
+ {
+ return SwingListPeer.this.createImage(w, h);
+ }
+
+ public Graphics getGraphics()
+ {
+ return SwingListPeer.this.getGraphics();
+ }
+
+ public Container getParent()
+ {
+ Container par = null;
+ if (SwingListPeer.this.awtComponent != null)
+ par = SwingListPeer.this.awtComponent.getParent();
+ return par;
+ }
+ }
+
+ /**
+ * The actual Swing JList.
+ */
+ private JList jList;
+
+ private DefaultListModel listModel;
+
+ public SwingListPeer(List list)
+ {
+ super();
+ listModel = new DefaultListModel();
+ jList = new JList(listModel);
+ SwingList swingList = new SwingList(jList);
+ init(list, swingList);
+
+ // Pull over the items from the list.
+ String[] items = list.getItems();
+ for (int i = 0 ; i < items.length; i++)
+ addItem(items[i], i);
+ }
+
+ public void add(String item, int index)
+ {
+ if (listModel != null)
+ listModel.add(index, item);
+ }
+
+ public void addItem(String item, int index)
+ {
+ if (listModel != null)
+ listModel.add(index, item);
+ }
+
+ public void clear()
+ {
+ if (listModel != null)
+ listModel.clear();
+ }
+
+ public void delItems(int startIndex, int endIndex)
+ {
+ if (listModel != null)
+ listModel.removeRange(startIndex, endIndex);
+ }
+
+ public void deselect(int index)
+ {
+ if (jList != null)
+ {
+ jList.getSelectionModel().removeSelectionInterval(index, index);
+ }
+ }
+
+ public Dimension getMinimumSize(int s)
+ {
+ Dimension d = null;
+ if (jList != null)
+ {
+ d = jList.getComponent(s).getMinimumSize();
+ }
+ return d;
+ }
+
+ public Dimension getPreferredSize(int s)
+ {
+ Dimension d = null;
+ if (jList != null)
+ {
+ d = jList.getComponent(s).getPreferredSize();
+ }
+ return d;
+ }
+
+ public int[] getSelectedIndexes()
+ {
+ int[] sel = null;
+ if (jList != null)
+ {
+ sel = jList.getSelectedIndices();
+ }
+ return sel;
+ }
+
+ public void makeVisible(int index)
+ {
+ if (jList != null)
+ {
+ Component comp = jList.getComponent(index);
+ jList.scrollRectToVisible(comp.getBounds());
+ }
+ }
+
+ public Dimension minimumSize(int s)
+ {
+ Dimension d = null;
+ if (jList != null)
+ {
+ d = jList.getComponent(s).getMinimumSize();
+ }
+ return d;
+ }
+
+ public Dimension preferredSize(int s)
+ {
+ Dimension d = null;
+ if (jList != null)
+ {
+ d = jList.getComponent(s).getPreferredSize();
+ }
+ return d;
+ }
+
+ public void removeAll()
+ {
+ if (jList != null)
+ {
+ jList.removeAll();
+ }
+ }
+
+ public void select(int index)
+ {
+ if (jList != null)
+ {
+ jList.setSelectedIndex(index);
+ }
+ }
+
+ public void setMultipleMode(boolean multi)
+ {
+ if (jList != null)
+ {
+ jList.setSelectionMode(multi
+ ? ListSelectionModel.MULTIPLE_INTERVAL_SELECTION
+ : ListSelectionModel.SINGLE_SELECTION);
+ }
+ }
+
+ public void setMultipleSelections(boolean multi)
+ {
+ if (jList != null)
+ {
+ jList.setSelectionMode(multi
+ ? ListSelectionModel.MULTIPLE_INTERVAL_SELECTION
+ : ListSelectionModel.SINGLE_SELECTION);
+ }
+ }
+
+ public void reshape(int x, int y, int width, int height)
+ {
+ if (swingComponent != null)
+ {
+ swingComponent.getJComponent().setBounds(x, y, width, height);
+ swingComponent.getJComponent().validate();
+ }
+ }
+
+ protected void peerPaint(Graphics g, boolean update)
+ {
+ super.peerPaint(g, update);
+ jList.doLayout();
+ jList.list();
+
+ Rectangle r = getBounds();
+ g.setColor(Color.RED);
+ g.drawRect(r.x, r.y, r.width, r.height);
+ }
+}
diff --git a/libjava/classpath/gnu/java/awt/peer/swing/SwingMenuBarPeer.java b/libjava/classpath/gnu/java/awt/peer/swing/SwingMenuBarPeer.java
index 0033efb025f..bd9dcd77aaa 100644
--- a/libjava/classpath/gnu/java/awt/peer/swing/SwingMenuBarPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/swing/SwingMenuBarPeer.java
@@ -174,7 +174,7 @@ public class SwingMenuBarPeer
/**
* Adds a help menu to the menu bar.
*
- * @param menu the menu to add
+ * @param m the menu to add
*/
public void addHelpMenu(Menu menu)
{
diff --git a/libjava/classpath/gnu/java/awt/peer/swing/SwingPanelPeer.java b/libjava/classpath/gnu/java/awt/peer/swing/SwingPanelPeer.java
index 0a0f20fe826..3cea62ac4d1 100644
--- a/libjava/classpath/gnu/java/awt/peer/swing/SwingPanelPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/swing/SwingPanelPeer.java
@@ -39,7 +39,6 @@ exception statement from your version. */
package gnu.java.awt.peer.swing;
import java.awt.Panel;
-import java.awt.peer.LightweightPeer;
import java.awt.peer.PanelPeer;
/**
@@ -51,7 +50,7 @@ import java.awt.peer.PanelPeer;
// necessary, but might be good for more consistend Look.
public class SwingPanelPeer
extends SwingContainerPeer
- implements PanelPeer, LightweightPeer
+ implements PanelPeer
{
/**
@@ -63,5 +62,6 @@ public class SwingPanelPeer
public SwingPanelPeer(Panel panel)
{
super(panel);
+ init(panel, null);
}
}
diff --git a/libjava/classpath/gnu/java/awt/peer/swing/SwingTextAreaPeer.java b/libjava/classpath/gnu/java/awt/peer/swing/SwingTextAreaPeer.java
new file mode 100644
index 00000000000..04ac011419f
--- /dev/null
+++ b/libjava/classpath/gnu/java/awt/peer/swing/SwingTextAreaPeer.java
@@ -0,0 +1,317 @@
+/* SwingTextAreaPeer.java -- A Swing based peer for AWT textareas
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.java.awt.peer.swing;
+
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.TextArea;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.awt.im.InputMethodRequests;
+import java.awt.peer.TextAreaPeer;
+
+import javax.swing.JComponent;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.text.BadLocationException;
+
+public class SwingTextAreaPeer
+ extends SwingComponentPeer
+ implements TextAreaPeer
+{
+
+ /**
+ * A spezialized Swing scroller used to hold the textarea.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+ private class SwingTextArea
+ extends JScrollPane
+ implements SwingComponent
+ {
+
+ SwingTextArea(Component comp)
+ {
+ super(comp, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
+ JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
+ }
+
+ /**
+ * Returns this label.
+ *
+ * @return <code>this</code>
+ */
+ public JComponent getJComponent()
+ {
+ return this;
+ }
+
+ /**
+ * Handles mouse events by forwarding it to
+ * <code>processMouseEvent()</code>.
+ *
+ * @param ev the mouse event
+ */
+ public void handleMouseEvent(MouseEvent ev)
+ {
+ ev.setSource(this);
+ dispatchEvent(ev);
+ }
+
+ /**
+ * Force lightweight mouse dispatching.
+ */
+ public boolean isLightweight()
+ {
+ return false;
+ }
+
+ /**
+ * Handles mouse motion events by forwarding it to
+ * <code>processMouseMotionEvent()</code>.
+ *
+ * @param ev the mouse motion event
+ */
+ public void handleMouseMotionEvent(MouseEvent ev)
+ {
+ processMouseMotionEvent(ev);
+ }
+
+ /**
+ * Handles key events by forwarding it to <code>processKeyEvent()</code>.
+ *
+ * @param ev the mouse event
+ */
+ public void handleKeyEvent(KeyEvent ev)
+ {
+ processKeyEvent(ev);
+ }
+
+ /**
+ * Overridden so that this method returns the correct value even without a
+ * peer.
+ *
+ * @return the screen location of the button
+ */
+ public Point getLocationOnScreen()
+ {
+ return SwingTextAreaPeer.this.getLocationOnScreen();
+ }
+
+ /**
+ * Overridden so that the isShowing method returns the correct value for the
+ * swing button, even if it has no peer on its own.
+ *
+ * @return <code>true</code> if the button is currently showing,
+ * <code>false</code> otherwise
+ */
+ public boolean isShowing()
+ {
+ boolean retVal = false;
+ if (SwingTextAreaPeer.this.awtComponent != null)
+ retVal = SwingTextAreaPeer.this.awtComponent.isShowing();
+ return retVal;
+ }
+
+ /**
+ * Overridden, so that the Swing button can create an Image without its
+ * own peer.
+ *
+ * @param w the width of the image
+ * @param h the height of the image
+ *
+ * @return an image
+ */
+ public Image createImage(int w, int h)
+ {
+ return SwingTextAreaPeer.this.createImage(w, h);
+ }
+
+ public Graphics getGraphics()
+ {
+ return SwingTextAreaPeer.this.getGraphics();
+ }
+
+ public Container getParent()
+ {
+ Container par = null;
+ if (SwingTextAreaPeer.this.awtComponent != null)
+ par = SwingTextAreaPeer.this.awtComponent.getParent();
+ return par;
+ }
+ }
+
+ /**
+ * The actual JTextArea.
+ */
+ private JTextArea jTextArea;
+
+ public SwingTextAreaPeer(TextArea textArea)
+ {
+ super();
+ System.err.println("new SwingTextAreaPeer");
+ jTextArea = new JTextArea();
+ SwingTextArea swingArea = new SwingTextArea(jTextArea);
+ init(textArea, swingArea);
+
+ // Pull over the text from the text area.
+ setText(textArea.getText());
+ }
+
+ public Dimension getMinimumSize(int rows, int cols)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Dimension getPreferredSize(int rows, int cols)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void insert(String text, int pos)
+ {
+ jTextArea.insert(text, pos);
+ }
+
+ public void insertText(String text, int pos)
+ {
+ jTextArea.insert(text, pos);
+ }
+
+ public Dimension minimumSize(int rows, int cols)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Dimension preferredSize(int rows, int cols)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void replaceRange(String text, int start, int end)
+ {
+ jTextArea.replaceRange(text, start, end);
+ }
+
+ public void replaceText(String text, int start, int end)
+ {
+ jTextArea.replaceRange(text, start, end);
+ }
+
+ public long filterEvents(long filter)
+ {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public int getCaretPosition()
+ {
+ return jTextArea.getCaretPosition();
+ }
+
+ public Rectangle getCharacterBounds(int pos)
+ {
+ Rectangle r;
+ try
+ {
+ return jTextArea.modelToView(pos);
+ }
+ catch (BadLocationException ex)
+ {
+ r = null;
+ }
+ return r;
+ }
+
+ public int getIndexAtPoint(int x, int y)
+ {
+ return jTextArea.viewToModel(new Point(x, y));
+ }
+
+ public InputMethodRequests getInputMethodRequests()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public int getSelectionEnd()
+ {
+ return jTextArea.getSelectionEnd();
+ }
+
+ public int getSelectionStart()
+ {
+ return jTextArea.getSelectionStart();
+ }
+
+ public String getText()
+ {
+ return jTextArea.getText();
+ }
+
+ public void select(int start, int end)
+ {
+ jTextArea.select(start, end);
+ }
+
+ public void setCaretPosition(int pos)
+ {
+ jTextArea.setCaretPosition(pos);
+ }
+
+ public void setEditable(boolean editable)
+ {
+ jTextArea.setEditable(editable);
+ }
+
+ public void setText(String text)
+ {
+ System.err.println("setText: " + text);
+ jTextArea.setText(text);
+ }
+
+}
diff --git a/libjava/classpath/gnu/java/awt/peer/swing/SwingTextFieldPeer.java b/libjava/classpath/gnu/java/awt/peer/swing/SwingTextFieldPeer.java
index 0c3b4e72603..d7d574a0bb9 100644
--- a/libjava/classpath/gnu/java/awt/peer/swing/SwingTextFieldPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/swing/SwingTextFieldPeer.java
@@ -36,7 +36,10 @@ obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.awt.peer.swing;
+import java.awt.Component;
+import java.awt.Container;
import java.awt.Dimension;
+import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
@@ -69,6 +72,13 @@ public class SwingTextFieldPeer
implements SwingComponent
{
+ TextField textField;
+
+ SwingTextField(TextField textField)
+ {
+ this.textField = textField;
+ }
+
/**
* Overridden to provide normal behaviour even without a real peer
* attached.
@@ -90,8 +100,8 @@ public class SwingTextFieldPeer
public boolean isShowing()
{
boolean retVal = false;
- if (SwingTextFieldPeer.this.awtComponent != null)
- retVal = SwingTextFieldPeer.this.awtComponent.isShowing();
+ if (textField != null)
+ retVal = textField.isShowing();
return retVal;
}
@@ -151,7 +161,19 @@ public class SwingTextFieldPeer
ev.setSource(this);
processKeyEvent(ev);
}
-
+
+ public Container getParent()
+ {
+ Container par = null;
+ if (textField != null)
+ par = textField.getParent();
+ return par;
+ }
+
+ public Graphics getGraphics()
+ {
+ return SwingTextFieldPeer.this.getGraphics();
+ }
}
/**
@@ -162,7 +184,7 @@ public class SwingTextFieldPeer
*/
public SwingTextFieldPeer(TextField textField)
{
- SwingTextField swingTextField = new SwingTextField();
+ SwingTextField swingTextField = new SwingTextField(textField);
swingTextField.setText(textField.getText());
init(textField, swingTextField);
}
@@ -283,7 +305,7 @@ public class SwingTextFieldPeer
* @param startPos the start index of the selection
* @param endPos the start index of the selection
*/
- public void select(int startPos, int endPos)
+ public void select(int start_pos, int endPos)
{
// TODO: Must be implemented.
}
diff --git a/libjava/classpath/gnu/java/awt/peer/swing/SwingWindowPeer.java b/libjava/classpath/gnu/java/awt/peer/swing/SwingWindowPeer.java
index 43a509b957d..531552d902c 100644
--- a/libjava/classpath/gnu/java/awt/peer/swing/SwingWindowPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/swing/SwingWindowPeer.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package gnu.java.awt.peer.swing;
import java.awt.Window;
+import java.awt.peer.ComponentPeer;
import java.awt.peer.WindowPeer;
/**
@@ -48,9 +49,9 @@ import java.awt.peer.WindowPeer;
* As a minimum, a subclass must implement all the remaining abstract methods
* as well as the following methods:
* <ul>
- * <li>{@link java.awt.peer.ComponentPeer#getLocationOnScreen()}</li>
- * <li>{@link java.awt.peer.ComponentPeer#getGraphics()}</li>
- * <li>{@link java.awt.peer.ComponentPeer#createImage(int, int)}</li>
+ * <li>{@link ComponentPeer#getLocationOnScreen()}</li>
+ * <li>{@link ComponentPeer#getGraphics()}</li>
+ * <li>{@link ComponentPeer#createImage(int, int)}</li>
* </ul>
*
* @author Roman Kennke (kennke@aicas.com)
@@ -68,5 +69,6 @@ public abstract class SwingWindowPeer
public SwingWindowPeer(Window window)
{
super(window);
+ init(window, null);
}
}
diff --git a/libjava/classpath/gnu/java/awt/peer/x/XFontPeer.java b/libjava/classpath/gnu/java/awt/peer/x/XFontPeer.java
index fd293d8dd43..8183fed0cd2 100644
--- a/libjava/classpath/gnu/java/awt/peer/x/XFontPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/x/XFontPeer.java
@@ -608,13 +608,6 @@ public class XFontPeer
throw new UnsupportedOperationException("Not yet implemented.");
}
- public Rectangle2D getStringBounds(Font font, CharacterIterator ci,
- int begin, int limit, FontRenderContext frc)
- {
- // TODO: Implement this.
- throw new UnsupportedOperationException("Not yet implemented.");
- }
-
/**
* Encodes a font name + style + size specification into a X logical font
* description (XLFD) as described here:
diff --git a/libjava/classpath/gnu/java/awt/peer/x/XFontPeer2.java b/libjava/classpath/gnu/java/awt/peer/x/XFontPeer2.java
index 25371de1a41..ef9507f3050 100644
--- a/libjava/classpath/gnu/java/awt/peer/x/XFontPeer2.java
+++ b/libjava/classpath/gnu/java/awt/peer/x/XFontPeer2.java
@@ -326,10 +326,4 @@ public class XFontPeer2
throw new UnsupportedOperationException("Not yet implemented");
}
- public Rectangle2D getStringBounds(Font font, CharacterIterator ci, int begin, int limit, FontRenderContext frc)
- {
- // FIXME: Implement this.
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
}
diff --git a/libjava/classpath/gnu/java/io/ObjectIdentityMap2Int.java b/libjava/classpath/gnu/java/io/ObjectIdentityMap2Int.java
new file mode 100644
index 00000000000..08f089d7921
--- /dev/null
+++ b/libjava/classpath/gnu/java/io/ObjectIdentityMap2Int.java
@@ -0,0 +1,292 @@
+/* ObjectIdentityMapToInt.java -- Helper class for faster serialization
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.io;
+
+/**
+ * This class provides a map from Object to non-negative int values.
+ * Objects are considered equal only if their references are equal.
+ *
+ * This can be used to equip objects with an integer id. This class
+ * is implemented to use as little memory as possible, particularly
+ * not to create hashtable buckets and Integer instances for each
+ * mapping.
+ *
+ * @author Fridtjof Siebert (siebert@aicas.com)
+ */
+public class ObjectIdentityMap2Int
+{
+
+
+ /**
+ * Prime numbers used as size of array. We need the size to be a
+ * prime number since the delta used for conflict resulution must
+ * not have any common divisors with the length.
+ */
+ private static final int[] PRIMES = {
+ 0x1f,
+ 0x3d,
+ 0x7f,
+ 0xfb,
+ 0x1fd,
+ 0x3fd,
+ 0x7f7,
+ 0xffd,
+ 0x1fff,
+ 0x3ffd,
+ 0x7fed,
+ 0xfff1,
+ 0x1ffff,
+ 0x3fffb,
+ 0x7ffff,
+ 0xffffd,
+ 0x1ffff7,
+ 0x3ffffd,
+ 0x7ffff1,
+ 0xfffffd,
+ 0x1ffffd9,
+ 0x3fffffb,
+ 0x7ffffd9,
+ 0xfffffc7,
+ 0x1ffffffd,
+ 0x3fffffdd,
+ 0x7fffffff};
+
+
+ /**
+ * Object to be used instead of "null"
+ */
+ private static final Object NIL = new Object();
+
+
+ /**
+ * The objects in this map:
+ *
+ * invariant
+ * objectTable.size == PRIMES[cap]
+ */
+ private Object[] objectTable;
+
+
+ /**
+ * The corresponding integer ids.
+ *
+ * invariant
+ * intTable.size == PRIMES[cap]
+ */
+ private int[] intTable;
+
+
+ /**
+ * The number of entries in this map.
+ *
+ * invariant
+ * size < limit
+ */
+ private int size = 0;
+
+
+ /**
+ * The index in primes of the size of the tables.
+ */
+ private int cap = 0;
+
+
+ /**
+ * The limit for size at which the table size is increased.
+ *
+ * invariant
+ * limit = PRIMES[cap] / 4 * 3;
+ */
+ private int limit = 0;
+
+
+ /**
+ * Constructs an empty <code>ObjectIdentityMap2Int</code>.
+ */
+ public ObjectIdentityMap2Int()
+ {
+ alloc(0);
+ }
+
+
+ /**
+ * Helper function to alloc the object and int array for the given
+ * capacity. Set limit, reset size to 0.
+ *
+ * No elements will be stored in the newly allocated arrays.
+ *
+ * @param c the capacity: this is an index in PRIMES, PRIMES[c]
+ * gives the size of the arrays.
+ *
+ * @throws InternalError if c >= PRIMES.length (in this case, a
+ * normal Hashtable would throw an OutOfMemoryError or a
+ * NegativeArraySizeException since the array size exceeds the range
+ * of positive integers).
+ */
+ private void alloc(int c)
+ {
+ if (c >= PRIMES.length)
+ throw new InternalError("Hash table size overflow");
+
+ cap = c;
+ int len = PRIMES[c];
+ objectTable = new Object[len];
+ intTable = new int[len];
+ limit = len / 4 * 3;
+
+ size = 0;
+ }
+
+
+ /**
+ * Add a mapping to this Map.
+ *
+ * ensures
+ * (get(o) == i);
+ *
+ * @param o object reference or null that is to be mapped.
+ *
+ * @param i the integer id to be associated with o
+ *
+ * @throws IllegalArgumentException if i<0
+ *
+ * @throws InternalError if hash tables has grown to more then
+ * 0x7fffffff entries (ie., size >= 0x7fffffff*3/4).
+ */
+ public void put(Object o, int i)
+ {
+ if (i < 0)
+ throw new IllegalArgumentException("int argument must be postive: "+i);
+
+ o = (o == null) ? NIL : o;
+ int s = slot(o);
+ Object[] ot = objectTable;
+ intTable[s] = i;
+ if (objectTable[s] == null)
+ {
+ objectTable[s] = o;
+ size++;
+ if (size >= limit)
+ {
+ rehash();
+ }
+ }
+ }
+
+
+ /**
+ * Helper function to find the index of a free or existing slot for
+ * object o
+ *
+ * ensure
+ * ((objectTable[result] != null) IMPLIES (objectTable[result] == o));
+ *
+ * @param o an object, must not be null.
+ *
+ * @return an index of o
+ */
+ private int slot(Object o)
+ {
+ Object[] ot = objectTable;
+ int hc = System.identityHashCode(o);
+ int len = ot.length;
+ int result = hc % len;
+ result = result < 0 ? -result : result;
+ int delta = 16 - (hc & 15);
+ Object existing = ot[result];
+ while ((existing != null) && (existing != o))
+ {
+ result += delta;
+ if (result >= len)
+ result -= len;
+ existing = ot[result];
+ }
+ return result;
+ }
+
+
+ /**
+ * Helper function for put() to increaes the capacity of this table
+ * to the next size (approx. double the size). Keep the mapping and
+ * the size unchanged.
+ *
+ * ensure
+ * (cap == \old cap+1);
+ */
+ private void rehash()
+ {
+ Object[] ot = objectTable;
+ int [] it = intTable;
+ alloc(cap + 1);
+
+ for (int i = 0; i < ot.length; i++)
+ put(ot[i], it[i]);
+ }
+
+
+ /**
+ * Obtain an element from this map
+ *
+ * @param o an object or null
+ *
+ * @return the corresponding integer id for o or -1 if o has not
+ * been put into this map.
+ */
+ public int get(Object o)
+ {
+ o = (o == null) ? NIL : o;
+ int s = slot(o);
+ return objectTable[s] == null ? -1 : intTable[s];
+ }
+
+ /**
+ * Clear this map
+ *
+ * ensures
+ * ((size == 0) && \forall Object o: get(o) == -1)
+ */
+ public void clear()
+ {
+ Object[] ot = objectTable;
+ size = 0;
+ for (int i = 0; i < ot.length; i++)
+ ot[i] = null;
+ }
+
+}
diff --git a/libjava/classpath/gnu/java/io/class-dependencies.conf b/libjava/classpath/gnu/java/io/class-dependencies.conf
new file mode 100644
index 00000000000..2500f6b14b5
--- /dev/null
+++ b/libjava/classpath/gnu/java/io/class-dependencies.conf
@@ -0,0 +1,75 @@
+# This property file contains dependencies of classes, methods, and
+# field on other methods or classes.
+#
+# Syntax:
+#
+# <used>: <needed 1> [... <needed N>]
+#
+# means that when <used> is included, <needed 1> (... <needed N>) must
+# be included as well.
+#
+# <needed X> and <used> are of the form
+#
+# <class.methodOrField(signature)>
+#
+# or just
+#
+# <class>
+#
+# Within dependencies, variables can be used. A variable is defined as
+# follows:
+#
+# {variable}: value1 value2 ... value<n>
+#
+# variables can be used on the right side of dependencies as follows:
+#
+# <used>: com.bla.blu.{variable}.Class.m()V
+#
+# The use of the variable will expand to <n> dependencies of the form
+#
+# <used>: com.bla.blu.value1.Class.m()V
+# <used>: com.bla.blu.value2.Class.m()V
+# ...
+# <used>: com.bla.blu.value<n>.Class.m()V
+#
+# Variables can be redefined when building a system to select the
+# required support for features like encodings, protocols, etc.
+#
+# Hints:
+#
+# - For methods and fields, the signature is mandatory. For
+# specification, please see the Java Virtual Machine Specification by
+# SUN. Unlike in the spec, field signatures (types) are in brackets.
+#
+# - Package names must be separated by '/' (and not '.'). E.g.,
+# java/lang/Class (this is necessary, because the '.' is used to
+# separate method or field names from classes)
+#
+# - In case <needed> refers to a class, only the class itself will be
+# included in the resulting binary, NOT necessarily all its methods
+# and fields. If you want to refer to all methods and fields, you can
+# write class.* as an abbreviation.
+#
+# - Abbreviations for packages are also possible: my/package/* means all
+# methods and fields of all classes in my/package.
+#
+# - A line with a trailing '\' continues in the next line.
+
+
+# All encodings supported are loaded via gnu/java/io/EncodingManager.findEncoderConstructor
+# or gnu/java/io/EncodingManager.findDecoderConstructor from class
+# gnu/java/io/decode/Decoder<encoding>.
+#
+# This introduces a dependency for all encodings. To allow an easy selection
+# and addition of encodings, the library variable {encodings} can be set to
+# the set of supported encodings.
+#
+{encodings}: 8859_1 8859_2 8859_3 8859_4 8859_5 UTF8
+
+gnu/java/io/EncodingManager.findEncoderConstructor(Ljava/lang/String;Z)Ljava/lang/reflect/Constructor;: \
+ gnu/java/io/decode/Decoder{encodings}.*
+
+gnu/java/io/EncodingManager.findDecoderConstructor(Ljava/lang/String;Z)Ljava/lang/reflect/Constructor;: \
+ gnu/java/io/encode/Encoder{encodings}.* \
+
+# end of file
diff --git a/libjava/classpath/gnu/java/lang/InstrumentationImpl.java b/libjava/classpath/gnu/java/lang/InstrumentationImpl.java
index 7bfed458245..2425b35c8a9 100644
--- a/libjava/classpath/gnu/java/lang/InstrumentationImpl.java
+++ b/libjava/classpath/gnu/java/lang/InstrumentationImpl.java
@@ -1,6 +1,6 @@
/* InstrumentationImpl.java -- GNU implementation of
java.lang.instrument.Instrumentation
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -63,11 +63,11 @@ public final class InstrumentationImpl implements Instrumentation
{
/* List of transformers */
- /* FIXME[GENERICS]: Should be ClassFileTransformer list */
- private ArrayList transformers = new ArrayList();
+ private ArrayList<ClassFileTransformer> transformers =
+ new ArrayList<ClassFileTransformer>();
- private InstrumentationImpl()
+ InstrumentationImpl()
{
}
@@ -210,9 +210,8 @@ public final class InstrumentationImpl implements Instrumentation
*
* @return the new class file
*/
- /* FIXME[GENERICS]: Should be Class<?> */
public byte[] callTransformers(ClassLoader loader, String className,
- Class classBeingRedefined, ProtectionDomain protectionDomain,
+ Class<?> classBeingRedefined, ProtectionDomain protectionDomain,
byte[] classfileBuffer)
{
byte[] newBuffer = null;
@@ -220,11 +219,10 @@ public final class InstrumentationImpl implements Instrumentation
ClassFileTransformer current;
synchronized (transformers)
{
- Iterator i = transformers.iterator();
+ Iterator<ClassFileTransformer> i = transformers.iterator();
while (i.hasNext())
{
- /* FIXME[GENERICS]: Remove cast */
- current = (ClassFileTransformer) i.next();
+ current = i.next();
try
{
newBuffer = current.transform(loader, className,
diff --git a/libjava/classpath/gnu/java/lang/management/BeanImpl.java b/libjava/classpath/gnu/java/lang/management/BeanImpl.java
index 24572a25d5d..e5b47181273 100644
--- a/libjava/classpath/gnu/java/lang/management/BeanImpl.java
+++ b/libjava/classpath/gnu/java/lang/management/BeanImpl.java
@@ -39,9 +39,50 @@ package gnu.java.lang.management;
import java.lang.management.ManagementPermission;
+import java.lang.reflect.Array;
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.TypeVariable;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.AttributeNotFoundException;
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanConstructorInfo;
+import javax.management.MBeanException;
+import javax.management.MBeanInfo;
+import javax.management.MBeanOperationInfo;
+import javax.management.MBeanParameterInfo;
+import javax.management.MBeanInfo;
import javax.management.NotCompliantMBeanException;
+import javax.management.ReflectionException;
import javax.management.StandardMBean;
+import javax.management.openmbean.ArrayType;
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeDataSupport;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.OpenMBeanAttributeInfo;
+import javax.management.openmbean.OpenMBeanAttributeInfoSupport;
+import javax.management.openmbean.OpenMBeanConstructorInfo;
+import javax.management.openmbean.OpenMBeanConstructorInfoSupport;
+import javax.management.openmbean.OpenMBeanInfo;
+import javax.management.openmbean.OpenMBeanInfoSupport;
+import javax.management.openmbean.OpenMBeanOperationInfo;
+import javax.management.openmbean.OpenMBeanOperationInfoSupport;
+import javax.management.openmbean.OpenMBeanParameterInfo;
+import javax.management.openmbean.OpenMBeanParameterInfoSupport;
+import javax.management.openmbean.OpenType;
+import javax.management.openmbean.SimpleType;
+import javax.management.openmbean.TabularData;
+import javax.management.openmbean.TabularDataSupport;
+import javax.management.openmbean.TabularType;
+
/**
* A common superclass for bean implementations.
*
@@ -51,7 +92,12 @@ import javax.management.StandardMBean;
public class BeanImpl
extends StandardMBean
{
-
+
+ /**
+ * Cached open bean information.
+ */
+ private OpenMBeanInfo openInfo;
+
/**
* Constructs a new <code>BeanImpl</code>.
*
@@ -67,6 +113,71 @@ public class BeanImpl
super(iface);
}
+ protected void cacheMBeanInfo(MBeanInfo info)
+ {
+ if (info == null)
+ return;
+ try
+ {
+ MBeanAttributeInfo[] oldA = info.getAttributes();
+ OpenMBeanAttributeInfo[] attribs =
+ new OpenMBeanAttributeInfoSupport[oldA.length];
+ for (int a = 0; a < oldA.length; ++a)
+ {
+ OpenMBeanParameterInfo param = translate(oldA[a].getType());
+ if (param.getMinValue() == null)
+ {
+ Object[] lv;
+ if (param.getLegalValues() == null)
+ lv = null;
+ else
+ lv = param.getLegalValues().toArray();
+ attribs[a] = new OpenMBeanAttributeInfoSupport(oldA[a].getName(),
+ oldA[a].getDescription(),
+ param.getOpenType(),
+ oldA[a].isReadable(),
+ oldA[a].isWritable(),
+ oldA[a].isIs(),
+ param.getDefaultValue(),
+ lv);
+ }
+ else
+ attribs[a] = new OpenMBeanAttributeInfoSupport(oldA[a].getName(),
+ oldA[a].getDescription(),
+ param.getOpenType(),
+ oldA[a].isReadable(),
+ oldA[a].isWritable(),
+ oldA[a].isIs(),
+ param.getDefaultValue(),
+ param.getMinValue(),
+ param.getMaxValue());
+ }
+ MBeanConstructorInfo[] oldC = info.getConstructors();
+ OpenMBeanConstructorInfo[] cons = new OpenMBeanConstructorInfoSupport[oldC.length];
+ for (int a = 0; a < oldC.length; ++a)
+ cons[a] =
+ new OpenMBeanConstructorInfoSupport(oldC[a].getName(),
+ oldC[a].getDescription(),
+ translateSignature(oldC[a].getSignature()));
+ MBeanOperationInfo[] oldO = info.getOperations();
+ OpenMBeanOperationInfo[] ops = new OpenMBeanOperationInfoSupport[oldO.length];
+ for (int a = 0; a < oldO.length; ++a)
+ ops[a] =
+ new OpenMBeanOperationInfoSupport(oldO[a].getName(),
+ oldO[a].getDescription(),
+ translateSignature(oldO[a].getSignature()),
+ translate(oldO[a].getReturnType()).getOpenType(),
+ oldO[a].getImpact());
+ openInfo = new OpenMBeanInfoSupport(info.getClassName(), info.getDescription(),
+ attribs, cons, ops, info.getNotifications());
+ }
+ catch (OpenDataException e)
+ {
+ throw (InternalError) (new InternalError("A problem occurred creating the open type " +
+ "descriptors.").initCause(e));
+ }
+ }
+
protected void checkMonitorPermissions()
{
SecurityManager sm = System.getSecurityManager();
@@ -81,4 +192,328 @@ public class BeanImpl
sm.checkPermission(new ManagementPermission("control"));
}
+ public Object getAttribute(String attribute)
+ throws AttributeNotFoundException, MBeanException,
+ ReflectionException
+ {
+ Object value = super.getAttribute(attribute);
+ if (value instanceof Enum)
+ return ((Enum) value).name();
+ Class vClass = value.getClass();
+ if (vClass.isArray())
+ return value;
+ String cName = vClass.getName();
+ String[] allowedTypes = OpenType.ALLOWED_CLASSNAMES;
+ for (int a = 0; a < allowedTypes.length; ++a)
+ if (cName.equals(allowedTypes[a]))
+ return value;
+ if (value instanceof List)
+ {
+ List l = (List) value;
+ Class e = null;
+ TypeVariable[] vars = vClass.getTypeParameters();
+ for (int a = 0; a < vars.length; ++a)
+ if (vars[a].getName().equals("E"))
+ e = (Class) vars[a].getGenericDeclaration();
+ if (e == null)
+ e = Object.class;
+ Object[] array = (Object[]) Array.newInstance(e, l.size());
+ return l.toArray(array);
+ }
+ OpenMBeanInfo info = (OpenMBeanInfo) getMBeanInfo();
+ OpenMBeanAttributeInfo[] attribs =
+ (OpenMBeanAttributeInfo[]) info.getAttributes();
+ OpenType type = null;
+ for (int a = 0; a < attribs.length; ++a)
+ if (attribs[a].getName().equals("attribute"))
+ type = attribs[a].getOpenType();
+ if (value instanceof Map)
+ {
+ TabularType ttype = (TabularType) type;
+ TabularData data = new TabularDataSupport(ttype);
+ Iterator it = ((Map) value).entrySet().iterator();
+ while (it.hasNext())
+ {
+ Map.Entry entry = (Map.Entry) it.next();
+ try
+ {
+ data.put(new CompositeDataSupport(ttype.getRowType(),
+ new String[] {
+ "key",
+ "value"
+ },
+ new Object[] {
+ entry.getKey(),
+ entry.getValue()
+ }));
+ }
+ catch (OpenDataException e)
+ {
+ throw (InternalError) (new InternalError("A problem occurred " +
+ "converting the map " +
+ "to a composite data " +
+ "structure.").initCause(e));
+ }
+ }
+ return data;
+ }
+ CompositeType cType = (CompositeType) type;
+ Set names = cType.keySet();
+ Iterator it = names.iterator();
+ List values = new ArrayList(names.size());
+ while (it.hasNext())
+ {
+ String field = (String) it.next();
+ Method getter = null;
+ try
+ {
+ getter = vClass.getMethod("get" + field, null);
+ }
+ catch (NoSuchMethodException e)
+ {
+ /* Ignored; the type tells us it's there. */
+ }
+ try
+ {
+ values.add(getter.invoke(value, null));
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new ReflectionException(e, "Failed to retrieve " + field);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new ReflectionException(e, "Failed to retrieve " + field);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new MBeanException((Exception) e.getCause(),
+ "The getter of " + field +
+ " threw an exception");
+ }
+ }
+ try
+ {
+ return new CompositeDataSupport(cType,
+ (String[])
+ names.toArray(new String[names.size()]),
+ values.toArray());
+ }
+ catch (OpenDataException e)
+ {
+ throw (InternalError) (new InternalError("A problem occurred " +
+ "converting the value " +
+ "to a composite data " +
+ "structure.").initCause(e));
+ }
+ }
+
+ protected MBeanInfo getCachedMBeanInfo()
+ {
+ return (MBeanInfo) openInfo;
+ }
+
+ public MBeanInfo getMBeanInfo()
+ {
+ super.getMBeanInfo();
+ return getCachedMBeanInfo();
+ }
+
+ private OpenType getTypeFromClass(Class c)
+ throws OpenDataException
+ {
+ return translate(c.getName()).getOpenType();
+ }
+
+ private OpenMBeanParameterInfo[] translateSignature(MBeanParameterInfo[] oldS)
+ throws OpenDataException
+ {
+ OpenMBeanParameterInfo[] sig = new OpenMBeanParameterInfoSupport[oldS.length];
+ for (int a = 0; a < oldS.length; ++a)
+ {
+ OpenMBeanParameterInfo param = translate(oldS[a].getType());
+ if (param.getMinValue() == null)
+ {
+ Object[] lv;
+ if (param.getLegalValues() == null)
+ lv = null;
+ else
+ lv = param.getLegalValues().toArray();
+ sig[a] = new OpenMBeanParameterInfoSupport(oldS[a].getName(),
+ oldS[a].getDescription(),
+ param.getOpenType(),
+ param.getDefaultValue(),
+ lv);
+ }
+ else
+ sig[a] = new OpenMBeanParameterInfoSupport(oldS[a].getName(),
+ oldS[a].getDescription(),
+ param.getOpenType(),
+ param.getDefaultValue(),
+ param.getMinValue(),
+ param.getMaxValue());
+ }
+ return sig;
+ }
+
+ private OpenMBeanParameterInfo translate(String type)
+ throws OpenDataException
+ {
+ if (type.equals("boolean") || type.equals(Boolean.class.getName()))
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ SimpleType.BOOLEAN,
+ null,
+ new Object[] {
+ Boolean.TRUE,
+ Boolean.FALSE
+ });
+ if (type.equals("byte") || type.equals(Byte.class.getName()))
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ SimpleType.BYTE,
+ null,
+ Byte.valueOf(Byte.MIN_VALUE),
+ Byte.valueOf(Byte.MAX_VALUE));
+ if (type.equals("char") || type.equals(Character.class.getName()))
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ SimpleType.CHARACTER,
+ null,
+ Character.valueOf(Character.MIN_VALUE),
+ Character.valueOf(Character.MAX_VALUE));
+ if (type.equals("double") || type.equals(Double.class.getName()))
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ SimpleType.DOUBLE,
+ null,
+ Double.valueOf(Double.MIN_VALUE),
+ Double.valueOf(Double.MAX_VALUE));
+ if (type.equals("float") || type.equals(Float.class.getName()))
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ SimpleType.FLOAT,
+ null,
+ Float.valueOf(Float.MIN_VALUE),
+ Float.valueOf(Float.MAX_VALUE));
+ if (type.equals("int") || type.equals(Integer.class.getName()))
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ SimpleType.INTEGER,
+ null,
+ Integer.valueOf(Integer.MIN_VALUE),
+ Integer.valueOf(Integer.MAX_VALUE));
+ if (type.equals("long") || type.equals(Long.class.getName()))
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ SimpleType.LONG,
+ null,
+ Long.valueOf(Long.MIN_VALUE),
+ Long.valueOf(Long.MAX_VALUE));
+ if (type.equals("short") || type.equals(Short.class.getName()))
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ SimpleType.SHORT,
+ null,
+ Short.valueOf(Short.MIN_VALUE),
+ Short.valueOf(Short.MAX_VALUE));
+ if (type.equals(String.class.getName()))
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ SimpleType.STRING);
+ if (type.equals("void"))
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ SimpleType.VOID);
+ if (type.startsWith("java.util.Map"))
+ {
+ int lparam = type.indexOf("<");
+ int comma = type.indexOf(",", lparam);
+ int rparam = type.indexOf(">", comma);
+ String key = type.substring(lparam + 1, comma).trim();
+ OpenType k = translate(key).getOpenType();
+ OpenType v = translate(type.substring(comma + 1, rparam).trim()).getOpenType();
+ CompositeType ctype = new CompositeType(Map.class.getName(), Map.class.getName(),
+ new String[] { "key", "value" },
+ new String[] { "Map key", "Map value"},
+ new OpenType[] { k, v});
+ TabularType ttype = new TabularType(key, key, ctype,
+ new String[] { "key" });
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ ttype);
+ }
+ if (type.startsWith("java.util.List"))
+ {
+ int lparam = type.indexOf("<");
+ int rparam = type.indexOf(">");
+ OpenType e = translate(type.substring(lparam + 1, rparam).trim()).getOpenType();
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ new ArrayType(1, e)
+ );
+ }
+ Class c;
+ try
+ {
+ c = Class.forName(type);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw (InternalError)
+ (new InternalError("The class for a type used in a management bean " +
+ "could not be loaded.").initCause(e));
+ }
+ if (c.isEnum())
+ {
+ Object[] values = c.getEnumConstants();
+ String[] names = new String[values.length];
+ for (int a = 0; a < values.length; ++a)
+ names[a] = values[a].toString();
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ SimpleType.STRING,
+ null,
+ (Object[]) names);
+ }
+ try
+ {
+ c.getMethod("from", new Class[] { CompositeData.class });
+ Method[] methods = c.getMethods();
+ List names = new ArrayList();
+ List types = new ArrayList();
+ for (int a = 0; a < methods.length; ++a)
+ {
+ String name = methods[a].getName();
+ if (name.startsWith("get"))
+ {
+ names.add(name.substring(3));
+ types.add(getTypeFromClass(methods[a].getReturnType()));
+ }
+ }
+ String[] fields = (String[]) names.toArray();
+ CompositeType ctype = new CompositeType(c.getName(), c.getName(),
+ fields, fields,
+ (OpenType[]) types.toArray());
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ ctype);
+ }
+ catch (NoSuchMethodException e)
+ {
+ /* Ignored; we expect this if this isn't a from(CompositeData) class */
+ }
+ if (c.isArray())
+ {
+ int depth;
+ for (depth = 0; c.getName().charAt(depth) == '['; ++depth);
+ OpenType ot = getTypeFromClass(c.getComponentType());
+ return new OpenMBeanParameterInfoSupport("TransParam",
+ "Translated parameter",
+ new ArrayType(depth, ot)
+ );
+ }
+ throw new InternalError("The type used does not have an open type translation.");
+ }
+
}
diff --git a/libjava/classpath/gnu/java/lang/management/MemoryMXBeanImpl.java b/libjava/classpath/gnu/java/lang/management/MemoryMXBeanImpl.java
index 064e19a1970..8cb10420213 100644
--- a/libjava/classpath/gnu/java/lang/management/MemoryMXBeanImpl.java
+++ b/libjava/classpath/gnu/java/lang/management/MemoryMXBeanImpl.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package gnu.java.lang.management;
+import gnu.classpath.ListenerData;
+
import java.lang.management.MemoryMXBean;
import java.lang.management.MemoryNotificationInfo;
import java.lang.management.MemoryUsage;
@@ -168,49 +170,6 @@ public final class MemoryMXBeanImpl
VMMemoryMXBeanImpl.setVerbose(verbose);
}
- private class ListenerData
- {
- private NotificationListener listener;
- private NotificationFilter filter;
- private Object passback;
-
- public ListenerData(NotificationListener listener,
- NotificationFilter filter, Object passback)
- {
- this.listener = listener;
- this.filter = filter;
- this.passback = passback;
- }
-
- public NotificationListener getListener()
- {
- return listener;
- }
-
- public NotificationFilter getFilter()
- {
- return filter;
- }
-
- public Object getPassback()
- {
- return passback;
- }
-
- public boolean equals(Object obj)
- {
- if (obj instanceof ListenerData)
- {
- ListenerData data = (ListenerData) obj;
- return (data.getListener() == listener &&
- data.getFilter() == filter &&
- data.getPassback() == passback);
- }
- return false;
- }
-
- }
-
public void addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object passback)
diff --git a/libjava/classpath/gnu/java/lang/management/MemoryPoolMXBeanImpl.java b/libjava/classpath/gnu/java/lang/management/MemoryPoolMXBeanImpl.java
index ed4dccd769e..e314ca1648a 100644
--- a/libjava/classpath/gnu/java/lang/management/MemoryPoolMXBeanImpl.java
+++ b/libjava/classpath/gnu/java/lang/management/MemoryPoolMXBeanImpl.java
@@ -40,6 +40,7 @@ package gnu.java.lang.management;
import gnu.classpath.SystemProperties;
import java.lang.management.MemoryPoolMXBean;
+import java.lang.management.MemoryType;
import java.lang.management.MemoryUsage;
import javax.management.NotCompliantMBeanException;
@@ -133,9 +134,10 @@ public final class MemoryPoolMXBeanImpl
return null;
}
- public String getType()
+ public MemoryType getType()
{
- return VMMemoryPoolMXBeanImpl.getType(name);
+ return
+ MemoryType.valueOf(VMMemoryPoolMXBeanImpl.getType(name));
}
public MemoryUsage getUsage()
diff --git a/libjava/classpath/gnu/java/lang/reflect/ClassSignatureParser.java b/libjava/classpath/gnu/java/lang/reflect/ClassSignatureParser.java
index 0c9b962921e..31f28385f44 100644
--- a/libjava/classpath/gnu/java/lang/reflect/ClassSignatureParser.java
+++ b/libjava/classpath/gnu/java/lang/reflect/ClassSignatureParser.java
@@ -61,7 +61,7 @@ public class ClassSignatureParser extends GenericSignatureParser
}
// SuperclassSignature
superclassType = readClassTypeSignature();
- ArrayList interfaces = new ArrayList();
+ ArrayList<Type> interfaces = new ArrayList<Type>();
while (peekChar() == 'L')
{
// SuperinterfaceSignature
diff --git a/libjava/classpath/gnu/java/lang/reflect/GenericSignatureParser.java b/libjava/classpath/gnu/java/lang/reflect/GenericSignatureParser.java
index 399f1bdc46f..06bc9e4ab06 100644
--- a/libjava/classpath/gnu/java/lang/reflect/GenericSignatureParser.java
+++ b/libjava/classpath/gnu/java/lang/reflect/GenericSignatureParser.java
@@ -60,7 +60,6 @@ final class TypeVariableImpl extends TypeImpl implements TypeVariable
return this;
}
- /* FIXME[GENERICS]: Remove cast */
public Type[] getBounds()
{
resolve(bounds);
@@ -141,10 +140,9 @@ final class ParameterizedTypeImpl extends TypeImpl implements ParameterizedType
return this;
}
- /* FIXME[GENERICS]: Remove cast */
public Type[] getActualTypeArguments()
{
- return (Type[]) typeArgs.clone();
+ return (Type[]) typeArgs.clone();
}
public Type getRawType()
@@ -276,12 +274,11 @@ final class UnresolvedTypeVariable extends TypeImpl implements Type
GenericDeclaration d = decl;
while (d != null)
{
- TypeVariable[] vars = d.getTypeParameters();
- for (int a = 0; a < vars.length ; ++a)
+ for (TypeVariable t : d.getTypeParameters())
{
- if (vars[a].getName().equals(name))
+ if (t.getName().equals(name))
{
- return vars[a];
+ return t;
}
}
d = getParent(d);
@@ -414,7 +411,7 @@ class GenericSignatureParser
TypeVariable[] readFormalTypeParameters()
{
consume('<');
- ArrayList params = new ArrayList();
+ ArrayList<TypeVariable> params = new ArrayList<TypeVariable>();
do
{
// TODO should we handle name clashes?
@@ -430,7 +427,7 @@ class GenericSignatureParser
{
String identifier = readIdentifier();
consume(':');
- ArrayList bounds = new ArrayList();
+ ArrayList<Type> bounds = new ArrayList<Type>();
if (peekChar() != ':')
{
bounds.add(readFieldTypeSignature());
@@ -501,7 +498,7 @@ class GenericSignatureParser
private Type[] readTypeArguments()
{
consume('<');
- ArrayList list = new ArrayList();
+ ArrayList<Type> list = new ArrayList<Type>();
do
{
list.add(readTypeArgument());
diff --git a/libjava/classpath/gnu/java/lang/reflect/MethodSignatureParser.java b/libjava/classpath/gnu/java/lang/reflect/MethodSignatureParser.java
index 16b1af99b73..50f98e29965 100644
--- a/libjava/classpath/gnu/java/lang/reflect/MethodSignatureParser.java
+++ b/libjava/classpath/gnu/java/lang/reflect/MethodSignatureParser.java
@@ -72,7 +72,7 @@ public class MethodSignatureParser extends GenericSignatureParser
typeParameters = new TypeVariable[0];
}
consume('(');
- ArrayList args = new ArrayList();
+ ArrayList<Type> args = new ArrayList<Type>();
while (peekChar() != ')')
{
args.add(readTypeSignature());
@@ -81,7 +81,7 @@ public class MethodSignatureParser extends GenericSignatureParser
args.toArray(argTypes);
consume(')');
retType = readTypeSignature();
- ArrayList throwsSigs = new ArrayList();
+ ArrayList<Type> throwsSigs = new ArrayList<Type>();
while (peekChar() == '^')
{
consume('^');
diff --git a/libjava/classpath/gnu/java/locale/.cvsignore b/libjava/classpath/gnu/java/locale/.cvsignore
new file mode 100644
index 00000000000..d41ae8d8147
--- /dev/null
+++ b/libjava/classpath/gnu/java/locale/.cvsignore
@@ -0,0 +1 @@
+LocaleData.java
diff --git a/libjava/classpath/gnu/java/net/DefaultProxySelector.java b/libjava/classpath/gnu/java/net/DefaultProxySelector.java
new file mode 100644
index 00000000000..31f861e8710
--- /dev/null
+++ b/libjava/classpath/gnu/java/net/DefaultProxySelector.java
@@ -0,0 +1,80 @@
+/* DefaultProxySelector.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.net;
+
+import java.io.IOException;
+import java.net.Proxy;
+import java.net.ProxySelector;
+import java.net.SocketAddress;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+public final class DefaultProxySelector
+ extends ProxySelector
+{
+ private static final List<Proxy> proxies = new ArrayList<Proxy>();
+
+ static
+ {
+ // The default proxy selector supports only direct connections.
+ proxies.add(Proxy.NO_PROXY);
+ }
+
+ public DefaultProxySelector()
+ {
+ // Do nothing by default.
+ }
+
+ public void connectFailed(URI uri, SocketAddress sa, IOException ioe)
+ {
+ if (uri == null || sa == null || ioe == null)
+ throw new IllegalArgumentException();
+
+ // Do nothing by default.
+ }
+
+ public List<Proxy> select(URI uri)
+ {
+ if (uri == null)
+ throw new IllegalArgumentException();
+
+ return proxies;
+ }
+}
diff --git a/libjava/classpath/gnu/java/net/PlainDatagramSocketImpl.java b/libjava/classpath/gnu/java/net/PlainDatagramSocketImpl.java
index 0fcd780dfb9..a84525e18b8 100644
--- a/libjava/classpath/gnu/java/net/PlainDatagramSocketImpl.java
+++ b/libjava/classpath/gnu/java/net/PlainDatagramSocketImpl.java
@@ -1,5 +1,5 @@
/* PlainDatagramSocketImpl.java -- Default DatagramSocket implementation
- Copyright (C) 1998, 1999, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,13 +38,19 @@ exception statement from your version. */
package gnu.java.net;
+import gnu.java.nio.VMChannel;
+
import java.io.IOException;
+import java.io.InterruptedIOException;
import java.net.DatagramPacket;
import java.net.DatagramSocketImpl;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.net.NetworkInterface;
import java.net.SocketAddress;
import java.net.SocketException;
+import java.net.SocketTimeoutException;
+import java.nio.ByteBuffer;
/**
* Written using on-line Java Platform 1.2 API Specification, as well
@@ -62,11 +68,12 @@ import java.net.SocketException;
*/
public final class PlainDatagramSocketImpl extends DatagramSocketImpl
{
-
+ private final VMChannel channel;
+
/**
- * This is the actual underlying file descriptor
+ * The platform-specific socket implementation.
*/
- int native_fd = -1;
+ private final VMPlainSocketImpl impl;
/**
* Lock object to serialize threads wanting to receive
@@ -81,25 +88,26 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
/**
* Default do nothing constructor
*/
- public PlainDatagramSocketImpl()
+ public PlainDatagramSocketImpl() throws IOException
{
- // Nothing to do here.
+ channel = new VMChannel();
+ impl = new VMPlainSocketImpl(channel);
}
- protected void finalize() throws Throwable
+ /*protected void finalize() throws Throwable
{
synchronized (this)
{
- if (native_fd != -1)
+ if (channel.getState().isValid())
close();
}
super.finalize();
- }
+ }*/
- public int getNativeFD()
+ /*public int getNativeFD()
{
return native_fd;
- }
+ }*/
/**
* Binds this socket to a particular port and interface
@@ -109,20 +117,46 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*
* @exception SocketException If an error occurs
*/
- protected synchronized void bind(int port, InetAddress addr)
+ protected synchronized void bind(int port, InetAddress addr)
throws SocketException
- {
- VMPlainDatagramSocketImpl.bind(this, port, addr);
- }
+ {
+ try
+ {
+ impl.bind(new InetSocketAddress(addr, port));
+ }
+ catch (SocketException se)
+ {
+ throw se;
+ }
+ catch (IOException ioe)
+ {
+ SocketException se = new SocketException();
+ se.initCause(ioe);
+ throw se;
+ }
+ }
/**
* Creates a new datagram socket
*
* @exception SocketException If an error occurs
*/
- protected synchronized void create() throws SocketException
+ protected synchronized void create() throws SocketException
{
- VMPlainDatagramSocketImpl.create(this);
+ try
+ {
+ channel.initSocket(false);
+ }
+ catch (SocketException se)
+ {
+ throw se;
+ }
+ catch (IOException ioe)
+ {
+ SocketException se = new SocketException();
+ se.initCause(ioe);
+ throw se;
+ }
}
/**
@@ -135,7 +169,7 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*/
protected void connect(InetAddress addr, int port) throws SocketException
{
- VMPlainDatagramSocketImpl.connect(this, addr, port);
+ channel.connect(new InetSocketAddress(addr, port), 0);
}
/**
@@ -147,8 +181,14 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
{
synchronized (this)
{
- if (native_fd != -1)
- close();
+ try
+ {
+ if (channel.getState().isValid())
+ channel.disconnect();
+ }
+ catch (IOException ioe)
+ {
+ }
}
}
@@ -161,7 +201,7 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*/
protected synchronized void setTimeToLive(int ttl) throws IOException
{
- setOption(VMPlainDatagramSocketImpl.IP_TTL, new Integer(ttl));
+ impl.setTimeToLive(ttl);
}
/**
@@ -173,15 +213,27 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*/
protected synchronized int getTimeToLive() throws IOException
{
- Object obj = getOption(VMPlainDatagramSocketImpl.IP_TTL);
+ return impl.getTimeToLive();
+ }
- if (! (obj instanceof Integer))
- throw new IOException("Internal Error");
+ protected int getLocalPort()
+ {
+ if (channel == null)
+ return -1;
- return ((Integer) obj).intValue();
+ try
+ {
+ InetSocketAddress local = channel.getLocalAddress();
+ if (local == null)
+ return -1;
+ return local.getPort();
+ }
+ catch (IOException ioe)
+ {
+ return -1;
+ }
}
-
/**
* Sends a packet of data to a remote host
*
@@ -191,13 +243,30 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*/
protected void send(DatagramPacket packet) throws IOException
{
- if (native_fd != -1)
+ synchronized (SEND_LOCK)
{
- synchronized(SEND_LOCK)
+ ByteBuffer buf = ByteBuffer.wrap(packet.getData(),
+ packet.getOffset(),
+ packet.getLength());
+ InetAddress remote = packet.getAddress();
+ int port = packet.getPort();
+ if (remote == null)
+ throw new NullPointerException();
+ if (port <= 0)
+ throw new SocketException("invalid port " + port);
+ while (true)
{
- VMPlainDatagramSocketImpl.send(this, packet);
+ try
+ {
+ channel.send(buf, new InetSocketAddress(remote, port));
+ break;
+ }
+ catch (InterruptedIOException ioe)
+ {
+ // Ignore; interrupted system call.
+ }
}
- }
+ }
}
/**
@@ -210,48 +279,123 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
protected void receive(DatagramPacket packet)
throws IOException
{
- synchronized(RECEIVE_LOCK)
- {
- VMPlainDatagramSocketImpl.receive(this, packet);
- }
+ synchronized(RECEIVE_LOCK)
+ {
+ ByteBuffer buf = ByteBuffer.wrap(packet.getData(),
+ packet.getOffset(),
+ packet.getLength());
+ SocketAddress addr = null;
+ while (true)
+ {
+ try
+ {
+ addr = channel.receive(buf);
+ break;
+ }
+ catch (SocketTimeoutException ste)
+ {
+ throw ste;
+ }
+ catch (InterruptedIOException iioe)
+ {
+ // Ignore. Loop.
+ }
+ }
+ if (addr != null)
+ packet.setSocketAddress(addr);
+ packet.setLength(buf.position() - packet.getOffset());
+ }
}
/**
* Sets the value of an option on the socket
*
- * @param option_id The identifier of the option to set
- * @param val The value of the option to set
+ * @param optionId The identifier of the option to set
+ * @param value The value of the option to set
*
* @exception SocketException If an error occurs
*/
- public synchronized void setOption(int option_id, Object val)
+ public synchronized void setOption(int optionId, Object value)
throws SocketException
- {
- VMPlainDatagramSocketImpl.setOption(this, option_id, val);
- }
+ {
+ switch (optionId)
+ {
+ case IP_MULTICAST_IF:
+ case IP_MULTICAST_IF2:
+ impl.setMulticastInterface(optionId, (InetAddress) value);
+ break;
+
+ case IP_MULTICAST_LOOP:
+ case SO_BROADCAST:
+ case SO_KEEPALIVE:
+ case SO_OOBINLINE:
+ case TCP_NODELAY:
+ case IP_TOS:
+ case SO_LINGER:
+ case SO_RCVBUF:
+ case SO_SNDBUF:
+ case SO_TIMEOUT:
+ case SO_REUSEADDR:
+ impl.setOption(optionId, value);
+ return;
+
+ default:
+ throw new SocketException("cannot set option " + optionId);
+ }
+ }
/**
* Retrieves the value of an option on the socket
*
- * @param option_id The identifier of the option to retrieve
+ * @param optionId The identifier of the option to retrieve
*
* @return The value of the option
*
* @exception SocketException If an error occurs
*/
- public synchronized Object getOption(int option_id)
+ public synchronized Object getOption(int optionId)
throws SocketException
- {
- return VMPlainDatagramSocketImpl.getOption(this, option_id);
- }
+ {
+ if (optionId == SO_BINDADDR)
+ {
+ try
+ {
+ InetSocketAddress local = channel.getLocalAddress();
+ if (local == null)
+ return null;
+ return local.getAddress();
+ }
+ catch (SocketException se)
+ {
+ throw se;
+ }
+ catch (IOException ioe)
+ {
+ SocketException se = new SocketException();
+ se.initCause(ioe);
+ throw se;
+ }
+ }
+ if (optionId == IP_MULTICAST_IF || optionId == IP_MULTICAST_IF2)
+ return impl.getMulticastInterface(optionId);
+
+ return impl.getOption(optionId);
+ }
/**
* Closes the socket
*/
protected synchronized void close()
{
- VMPlainDatagramSocketImpl.close(this);
+ try
+ {
+ if (channel.getState().isValid())
+ channel.close();
+ }
+ catch (IOException ioe)
+ {
+ }
}
/**
@@ -291,7 +435,7 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*/
protected synchronized void join(InetAddress addr) throws IOException
{
- VMPlainDatagramSocketImpl.join(this,addr);
+ impl.join(addr);
}
/**
@@ -303,7 +447,7 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*/
protected synchronized void leave(InetAddress addr) throws IOException
{
- VMPlainDatagramSocketImpl.leave(this, addr);
+ impl.leave(addr);
}
/**
@@ -323,12 +467,20 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
public void joinGroup(SocketAddress address, NetworkInterface netIf)
throws IOException
{
- VMPlainDatagramSocketImpl.joinGroup(this, address, netIf);
+ if (address == null)
+ throw new NullPointerException();
+ if (!(address instanceof InetSocketAddress))
+ throw new SocketException("unknown address type");
+ impl.joinGroup((InetSocketAddress) address, netIf);
}
public void leaveGroup(SocketAddress address, NetworkInterface netIf)
throws IOException
{
- VMPlainDatagramSocketImpl.leaveGroup(this, address, netIf);
+ if (address == null)
+ throw new NullPointerException();
+ if (!(address instanceof InetSocketAddress))
+ throw new SocketException("unknown address type");
+ impl.leaveGroup((InetSocketAddress) address, netIf);
}
}
diff --git a/libjava/classpath/gnu/java/net/PlainSocketImpl.java b/libjava/classpath/gnu/java/net/PlainSocketImpl.java
index 47d05aa410d..5bda0a5e9bf 100644
--- a/libjava/classpath/gnu/java/net/PlainSocketImpl.java
+++ b/libjava/classpath/gnu/java/net/PlainSocketImpl.java
@@ -39,13 +39,20 @@ exception statement from your version. */
package gnu.java.net;
+import gnu.java.nio.SocketChannelImpl;
+import gnu.java.nio.VMChannel;
+
import java.io.InputStream;
import java.io.IOException;
+import java.io.InterruptedIOException;
import java.io.OutputStream;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.SocketException;
import java.net.SocketImpl;
+import java.net.SocketTimeoutException;
+import java.nio.ByteBuffer;
/**
* Written using on-line Java Platform 1.2 API Specification, as well
@@ -63,17 +70,13 @@ import java.net.SocketImpl;
* @author Nic Ferrier (nferrier@tapsellferrier.co.uk)
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public final class PlainSocketImpl extends SocketImpl
+public class PlainSocketImpl extends SocketImpl
{
/**
- * The OS file handle representing the socket.
- * This is used for reads and writes to/from the socket and
- * to close it.
- *
- * When the socket is closed this is reset to -1.
+ * The underlying plain socket VM implementation.
*/
- int native_fd = -1;
+ protected VMPlainSocketImpl impl;
/**
* A cached copy of the in stream for reading from the socket.
@@ -90,7 +93,13 @@ public final class PlainSocketImpl extends SocketImpl
* is being invoked on this socket.
*/
private boolean inChannelOperation;
-
+
+ /**
+ * The socket channel we use for IO operation. Package-private for
+ * use by inner classes.
+ */
+ SocketChannelImpl channel;
+
/**
* Indicates whether we should ignore whether any associated
* channel is set to non-blocking mode. Certain operations
@@ -117,29 +126,7 @@ public final class PlainSocketImpl extends SocketImpl
*/
public PlainSocketImpl()
{
- // Nothing to do here.
- }
-
- protected void finalize() throws Throwable
- {
- synchronized (this)
- {
- if (native_fd != -1)
- try
- {
- close();
- }
- catch (IOException ex)
- {
- // Nothing we can do about it.
- }
- }
- super.finalize();
- }
-
- public int getNativeFD()
- {
- return native_fd;
+ this.impl = new VMPlainSocketImpl();
}
/**
@@ -155,7 +142,24 @@ public final class PlainSocketImpl extends SocketImpl
*/
public void setOption(int optionId, Object value) throws SocketException
{
- VMPlainSocketImpl.setOption(this, optionId, value);
+ switch (optionId)
+ {
+ case SO_LINGER:
+ case IP_MULTICAST_LOOP:
+ case SO_BROADCAST:
+ case SO_KEEPALIVE:
+ case SO_OOBINLINE:
+ case TCP_NODELAY:
+ case IP_TOS:
+ case SO_RCVBUF:
+ case SO_SNDBUF:
+ case SO_TIMEOUT:
+ case SO_REUSEADDR:
+ impl.setOption(optionId, value);
+ return;
+ default:
+ throw new SocketException("Unrecognized TCP option: " + optionId);
+ }
}
/**
@@ -171,17 +175,49 @@ public final class PlainSocketImpl extends SocketImpl
*/
public Object getOption(int optionId) throws SocketException
{
- return VMPlainSocketImpl.getOption(this, optionId);
+ if (optionId == SO_BINDADDR)
+ {
+ try
+ {
+ return channel.getVMChannel().getLocalAddress().getAddress();
+ }
+ catch (IOException ioe)
+ {
+ SocketException se = new SocketException();
+ se.initCause(ioe);
+ throw se;
+ }
+ }
+
+ // This filters options which are invalid for TCP.
+ switch (optionId)
+ {
+ case SO_LINGER:
+ case IP_MULTICAST_LOOP:
+ case SO_BROADCAST:
+ case SO_KEEPALIVE:
+ case SO_OOBINLINE:
+ case TCP_NODELAY:
+ case IP_TOS:
+ case SO_RCVBUF:
+ case SO_SNDBUF:
+ case SO_TIMEOUT:
+ case SO_REUSEADDR:
+ return impl.getOption(optionId);
+ default:
+ throw new SocketException("Unrecognized TCP option: " + optionId);
+ }
+
}
public void shutdownInput() throws IOException
{
- VMPlainSocketImpl.shutdownInput(this);
+ impl.shutdownInput();
}
public void shutdownOutput() throws IOException
{
- VMPlainSocketImpl.shutdownOutput(this);
+ impl.shutdownOutput();
}
/**
@@ -195,7 +231,11 @@ public final class PlainSocketImpl extends SocketImpl
*/
protected synchronized void create(boolean stream) throws IOException
{
- VMPlainSocketImpl.create(this);
+ channel = new SocketChannelImpl(false);
+ VMChannel vmchannel = channel.getVMChannel();
+ vmchannel.initSocket(stream);
+ channel.configureBlocking(true);
+ impl.getState().setChannelFD(vmchannel.getState());
}
/**
@@ -222,7 +262,7 @@ public final class PlainSocketImpl extends SocketImpl
*/
protected void connect(InetAddress addr, int port) throws IOException
{
- VMPlainSocketImpl.connect(this, addr, port);
+ connect(new InetSocketAddress(addr, port), 0);
}
/**
@@ -236,7 +276,17 @@ public final class PlainSocketImpl extends SocketImpl
protected synchronized void connect(SocketAddress address, int timeout)
throws IOException
{
- VMPlainSocketImpl.connect(this, address, timeout);
+ if (channel == null)
+ create(true);
+ boolean connected = channel.connect(address, timeout);
+ if (!connected)
+ throw new SocketTimeoutException("connect timed out");
+
+ // Using the given SocketAddress is important to preserve
+ // hostnames given by the caller.
+ InetSocketAddress addr = (InetSocketAddress) address;
+ this.address = addr.getAddress();
+ this.port = addr.getPort();
}
/**
@@ -251,7 +301,10 @@ public final class PlainSocketImpl extends SocketImpl
protected synchronized void bind(InetAddress addr, int port)
throws IOException
{
- VMPlainSocketImpl.bind(this, addr, port);
+ if (channel == null)
+ create(true);
+ impl.bind(new InetSocketAddress(addr, port));
+ localport = channel.getVMChannel().getLocalAddress().getPort();
}
/**
@@ -267,7 +320,7 @@ public final class PlainSocketImpl extends SocketImpl
protected synchronized void listen(int queuelen)
throws IOException
{
- VMPlainSocketImpl.listen(this, queuelen);
+ impl.listen(queuelen);
}
/**
@@ -279,7 +332,19 @@ public final class PlainSocketImpl extends SocketImpl
protected synchronized void accept(SocketImpl impl)
throws IOException
{
- VMPlainSocketImpl.accept(this, impl);
+ if (channel == null)
+ create(true);
+ if (!(impl instanceof PlainSocketImpl))
+ throw new IOException("incompatible SocketImpl: "
+ + impl.getClass().getName());
+ PlainSocketImpl that = (PlainSocketImpl) impl;
+ VMChannel c = channel.getVMChannel().accept();
+ that.impl.getState().setChannelFD(c.getState());
+ that.channel = new SocketChannelImpl(c);
+ that.setOption(SO_REUSEADDR, Boolean.TRUE);
+ // Reset the inherited timeout.
+ that.setOption(SO_TIMEOUT, Integer.valueOf(0));
+
}
/**
@@ -292,7 +357,9 @@ public final class PlainSocketImpl extends SocketImpl
*/
protected int available() throws IOException
{
- return VMPlainSocketImpl.available(this);
+ if (channel == null)
+ throw new SocketException("not connected");
+ return channel.getVMChannel().available();
}
/**
@@ -308,65 +375,16 @@ public final class PlainSocketImpl extends SocketImpl
*/
protected void close() throws IOException
{
- VMPlainSocketImpl.close(this);
- }
-
- public void sendUrgentData(int data)
- {
- VMPlainSocketImpl.sendUrgendData(this, data);
- }
-
- /**
- * Internal method used by SocketInputStream for reading data from
- * the connection. Reads up to len bytes of data into the buffer
- * buf starting at offset bytes into the buffer.
- *
- * @return the actual number of bytes read or -1 if end of stream.
- *
- * @throws IOException if an error occurs
- */
- protected int read(byte[] buf, int offset, int len)
- throws IOException
- {
- return VMPlainSocketImpl.read(this, buf, offset, len);
- }
-
- /**
- * Internal method used by SocketInputStream for reading data from
- * the connection. Reads and returns one byte of data.
- *
- * @return the read byte
- *
- * @throws IOException if an error occurs
- */
- protected int read()
- throws IOException
- {
- return VMPlainSocketImpl.read(this);
- }
-
- /**
- * Internal method used by SocketOuputStream for writing data to
- * the connection. Writes up to len bytes of data from the buffer
- * buf starting at offset bytes into the buffer.
- *
- * @throws IOException If an error occurs
- */
- protected void write(byte[] buf, int offset, int len)
- throws IOException
- {
- VMPlainSocketImpl.write(this, buf, offset, len);
+ if (impl.getState().isValid())
+ impl.close();
+
+ address = null;
+ port = -1;
}
- /**
- * Internal method used by SocketOuputStream for writing data to
- * the connection. Writes up one byte to the socket.
- *
- * @throws IOException If an error occurs
- */
- protected void write(int data) throws IOException
+ public void sendUrgentData(int data) throws IOException
{
- VMPlainSocketImpl.write(this, data);
+ impl.sendUrgentData(data);
}
/**
@@ -400,6 +418,95 @@ public final class PlainSocketImpl extends SocketImpl
return out;
}
+
+ public VMChannel getVMChannel()
+ {
+ if (channel == null)
+ return null;
+ return channel.getVMChannel();
+ }
+
+ /* (non-Javadoc)
+ * @see java.net.SocketImpl#getInetAddress()
+ */
+ protected InetAddress getInetAddress()
+ {
+ if (channel == null)
+ return null;
+
+ try
+ {
+ InetSocketAddress remote = channel.getVMChannel().getPeerAddress();
+ if (remote == null)
+ return null;
+ // To mimic behavior of the RI the InetAddress instance which was
+ // used to establish the connection is returned instead of one that
+ // was created by the native layer (this preserves exact hostnames).
+ if (address != null)
+ return address;
+
+ return remote.getAddress();
+ }
+ catch (IOException ioe)
+ {
+ return null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see java.net.SocketImpl#getLocalPort()
+ */
+ protected int getLocalPort()
+ {
+ if (channel == null)
+ return -1;
+ try
+ {
+ InetSocketAddress local = channel.getVMChannel().getLocalAddress();
+ if (local == null)
+ return -1;
+ return local.getPort();
+ }
+ catch (IOException ioe)
+ {
+ return -1;
+ }
+ }
+
+ public InetSocketAddress getLocalAddress()
+ {
+ if (channel == null)
+ return null;
+ try
+ {
+ return channel.getVMChannel().getLocalAddress();
+ }
+ catch (IOException ioe)
+ {
+ return null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see java.net.SocketImpl#getPort()
+ */
+ protected int getPort()
+ {
+ if (channel == null)
+ return -1;
+
+ try
+ {
+ InetSocketAddress remote = channel.getVMChannel().getPeerAddress();
+ if (remote == null)
+ return -1;
+ return remote.getPort();
+ }
+ catch (IOException ioe)
+ {
+ return -1;
+ }
+ }
/**
* This class contains an implementation of <code>InputStream</code> for
@@ -437,7 +544,23 @@ public final class PlainSocketImpl extends SocketImpl
*/
public int read() throws IOException
{
- return PlainSocketImpl.this.read();
+ if (channel == null)
+ throw new SocketException("not connected");
+ while (true)
+ {
+ try
+ {
+ return channel.getVMChannel().read();
+ }
+ catch (SocketTimeoutException ste)
+ {
+ throw ste;
+ }
+ catch (InterruptedIOException iioe)
+ {
+ // Ignore; NIO may throw this; net io shouldn't
+ }
+ }
}
/**
@@ -454,12 +577,24 @@ public final class PlainSocketImpl extends SocketImpl
*/
public int read (byte[] buf, int offset, int len) throws IOException
{
- int bytes_read = PlainSocketImpl.this.read (buf, offset, len);
-
- if (bytes_read == 0)
- return -1;
-
- return bytes_read;
+ if (channel == null)
+ throw new SocketException("not connected");
+ ByteBuffer b = ByteBuffer.wrap(buf, offset, len);
+ while (true)
+ {
+ try
+ {
+ return channel.read(b);
+ }
+ catch (SocketTimeoutException ste)
+ {
+ throw ste;
+ }
+ catch (InterruptedIOException iioe)
+ {
+ // Ignored; NIO may throw this; net IO not.
+ }
+ }
}
}
@@ -495,7 +630,20 @@ public final class PlainSocketImpl extends SocketImpl
*/
public void write(int b) throws IOException
{
- PlainSocketImpl.this.write(b);
+ if (channel == null)
+ throw new SocketException("not connected");
+ while (true)
+ {
+ try
+ {
+ channel.getVMChannel().write(b);
+ return;
+ }
+ catch (InterruptedIOException iioe)
+ {
+ // Ignored.
+ }
+ }
}
/**
@@ -510,7 +658,21 @@ public final class PlainSocketImpl extends SocketImpl
*/
public void write (byte[] buf, int offset, int len) throws IOException
{
- PlainSocketImpl.this.write (buf, offset, len);
+ if (channel == null)
+ throw new SocketException("not connected");
+ ByteBuffer b = ByteBuffer.wrap(buf, offset, len);
+ while (b.hasRemaining())
+ {
+ try
+ {
+ if (channel.write(b) == -1)
+ throw new IOException("channel has been closed");
+ }
+ catch (InterruptedIOException iioe)
+ {
+ // Ignored.
+ }
+ }
}
}
}
diff --git a/libjava/classpath/gnu/java/net/local/LocalSocketImpl.java b/libjava/classpath/gnu/java/net/local/LocalSocketImpl.java
index f43305a8027..f49b79947b7 100644
--- a/libjava/classpath/gnu/java/net/local/LocalSocketImpl.java
+++ b/libjava/classpath/gnu/java/net/local/LocalSocketImpl.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.java.net.local;
+import gnu.classpath.Configuration;
+
import java.io.FileDescriptor;
import java.io.InputStream;
import java.io.IOException;
@@ -66,7 +68,10 @@ final class LocalSocketImpl extends SocketImpl
{
try
{
- System.loadLibrary ("javanet");
+ if (Configuration.INIT_LOAD_LIBRARY)
+ {
+ System.loadLibrary ("javanet");
+ }
}
catch (Exception x)
{
diff --git a/libjava/classpath/gnu/java/net/protocol/http/HTTPConnection.java b/libjava/classpath/gnu/java/net/protocol/http/HTTPConnection.java
index f5e831c6a01..3956d2aba3a 100644
--- a/libjava/classpath/gnu/java/net/protocol/http/HTTPConnection.java
+++ b/libjava/classpath/gnu/java/net/protocol/http/HTTPConnection.java
@@ -48,6 +48,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
+import java.net.SocketException;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -227,10 +228,16 @@ public class HTTPConnection
* @param secure whether to use a secure connection
* @param connectionTimeout the connection timeout
* @param timeout the socket read timeout
+ *
+ * @throws IllegalArgumentException if either connectionTimeout or
+ * timeout less than zero.
*/
public HTTPConnection(String hostname, int port, boolean secure,
int connectionTimeout, int timeout)
{
+ if (connectionTimeout < 0 || timeout < 0)
+ throw new IllegalArgumentException();
+
this.hostname = hostname;
this.port = port;
this.secure = secure;
@@ -471,14 +478,32 @@ public class HTTPConnection
{
String ttl =
SystemProperties.getProperty("classpath.net.http.keepAliveTTL");
- connectionTTL = (ttl != null && ttl.length() > 0) ?
- 1000 * Math.max(1, Integer.parseInt(ttl)) : 10000;
+ connectionTTL = 10000;
+ if (ttl != null && ttl.length() > 0)
+ try
+ {
+ int v = 1000 * Integer.parseInt(ttl);
+ if (v >= 0)
+ connectionTTL = v;
+ }
+ catch (NumberFormatException _)
+ {
+ // Ignore.
+ }
String mc = SystemProperties.getProperty("http.maxConnections");
- maxConnections = (mc != null && mc.length() > 0) ?
- Math.max(Integer.parseInt(mc), 1) : 5;
- if (maxConnections < 1)
- maxConnections = 1;
+ maxConnections = 5;
+ if (mc != null && mc.length() > 0)
+ try
+ {
+ int v = Integer.parseInt(mc);
+ if (v > 0)
+ maxConnections = v;
+ }
+ catch (NumberFormatException _)
+ {
+ // Ignore.
+ }
HTTPConnection c = null;
@@ -490,12 +515,23 @@ public class HTTPConnection
{
c = cc;
it.remove();
+ // Update the timeout.
+ if (c.socket != null)
+ try
+ {
+ c.socket.setSoTimeout(timeout);
+ }
+ catch (SocketException _)
+ {
+ // Ignore.
+ }
break;
}
}
if (c == null)
{
- c = new HTTPConnection(host, port, secure, connectionTimeout, timeout);
+ c = new HTTPConnection(host, port, secure,
+ connectionTimeout, timeout);
c.setPool(this);
}
return c;
diff --git a/libjava/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java b/libjava/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java
index cc68a3bac30..6c926b72fb4 100644
--- a/libjava/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java
+++ b/libjava/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java
@@ -75,7 +75,7 @@ public class HTTPURLConnection
// These are package private for use in anonymous inner classes.
String proxyHostname;
- int proxyPort;
+ int proxyPort = -1;
String agent;
boolean keepAlive;
@@ -99,18 +99,21 @@ public class HTTPURLConnection
{
super(url);
requestHeaders = new Headers();
- proxyHostname = SystemProperties.getProperty("http.proxyHost");
- if (proxyHostname != null && proxyHostname.length() > 0)
+ String proxy = SystemProperties.getProperty("http.proxyHost");
+ if (proxy != null && proxy.length() > 0)
{
String port = SystemProperties.getProperty("http.proxyPort");
if (port != null && port.length() > 0)
{
- proxyPort = Integer.parseInt(port);
- }
- else
- {
- proxyHostname = null;
- proxyPort = -1;
+ try
+ {
+ proxyPort = Integer.parseInt(port);
+ proxyHostname = proxy;
+ }
+ catch (NumberFormatException _)
+ {
+ // Ignore.
+ }
}
}
agent = SystemProperties.getProperty("http.agent");
@@ -354,11 +357,14 @@ public class HTTPURLConnection
HTTPConnection connection;
if (keepAlive)
{
- connection = HTTPConnection.Pool.instance.get(host, port, secure, getConnectTimeout(), 0);
+ connection = HTTPConnection.Pool.instance.get(host, port, secure,
+ getConnectTimeout(),
+ getReadTimeout());
}
else
{
- connection = new HTTPConnection(host, port, secure, 0, getConnectTimeout());
+ connection = new HTTPConnection(host, port, secure,
+ getConnectTimeout(), getReadTimeout());
}
return connection;
}
@@ -662,23 +668,23 @@ public class HTTPURLConnection
}
/**
- * Set the connection timeout speed, in milliseconds, or zero if the timeout
+ * Set the read timeout, in milliseconds, or zero if the timeout
* is to be considered infinite.
*
* Overloaded.
*
*/
- public void setConnectTimeout(int timeout)
+ public void setReadTimeout(int timeout)
throws IllegalArgumentException
{
- super.setConnectTimeout( timeout );
- if( connection == null )
+ super.setReadTimeout(timeout);
+ if (connection == null)
return;
try
{
- connection.getSocket().setSoTimeout( timeout );
+ connection.getSocket().setSoTimeout(timeout);
}
- catch(IOException se)
+ catch (IOException se)
{
// Ignore socket exceptions.
}
diff --git a/libjava/classpath/gnu/java/net/protocol/jar/Handler.java b/libjava/classpath/gnu/java/net/protocol/jar/Handler.java
index 316d8cb02be..7c09766a557 100644
--- a/libjava/classpath/gnu/java/net/protocol/jar/Handler.java
+++ b/libjava/classpath/gnu/java/net/protocol/jar/Handler.java
@@ -1,5 +1,5 @@
/* gnu.java.net.protocol.jar.Handler - jar protocol handler for java.net
- Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,6 +45,9 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.StringTokenizer;
/**
* @author Kresten Krab Thorup (krab@gnu.org)
@@ -114,7 +117,7 @@ public class Handler extends URLStreamHandler
file = file.substring(0, idx + 1) + url_string;
}
- setURL (url, "jar", url.getHost(), url.getPort(), file, null);
+ setURL (url, "jar", url.getHost(), url.getPort(), flat(file), null);
return;
}
@@ -149,6 +152,45 @@ public class Handler extends URLStreamHandler
}
/**
+ * Makes the given jar url string 'flat' by removing any . and .. from
+ * jar file path because ZipFile entries can only handle flat paths.
+ * Inside jar files '/' is always the path separator.
+ */
+ private static String flat(String url_string)
+ {
+ int jar_stop = url_string.indexOf("!/");
+ String jar_path = url_string.substring(jar_stop + 1, url_string.length());
+
+ if (jar_path.indexOf("/.") < 0)
+ return url_string;
+
+ ArrayList tokens = new ArrayList();
+ StringTokenizer st = new StringTokenizer(jar_path, "/");
+ while (st.hasMoreTokens())
+ {
+ String token = st.nextToken();
+ if (token.equals("."))
+ continue;
+ else if (token.equals(".."))
+ {
+ if (! tokens.isEmpty())
+ tokens.remove(tokens.size() - 1);
+ }
+ else
+ tokens.add(token);
+ }
+
+ StringBuffer path = new StringBuffer(url_string.length());
+ path.append(url_string.substring(0, jar_stop + 1));
+
+ Iterator it = tokens.iterator();
+ while (it.hasNext())
+ path.append('/').append(it.next());
+
+ return path.toString();
+ }
+
+ /**
* This method converts a Jar URL object into a String.
*
* @param url The URL object to convert
diff --git a/libjava/classpath/gnu/java/nio/DatagramChannelImpl.java b/libjava/classpath/gnu/java/nio/DatagramChannelImpl.java
index 4687bf3f59e..268ee0a8aa7 100644
--- a/libjava/classpath/gnu/java/nio/DatagramChannelImpl.java
+++ b/libjava/classpath/gnu/java/nio/DatagramChannelImpl.java
@@ -55,8 +55,10 @@ import java.nio.channels.spi.SelectorProvider;
* @author Michael Koch
*/
public final class DatagramChannelImpl extends DatagramChannel
+ implements VMChannelOwner
{
private NIODatagramSocket socket;
+ private VMChannel channel;
/**
* Indicates whether this channel initiated whatever operation
@@ -64,6 +66,16 @@ public final class DatagramChannelImpl extends DatagramChannel
*/
private boolean inChannelOperation;
+ protected DatagramChannelImpl (SelectorProvider provider)
+ throws IOException
+ {
+ super (provider);
+ socket = new NIODatagramSocket (new PlainDatagramSocketImpl(), this);
+ channel = new VMChannel();
+ channel.initSocket(false);
+ configureBlocking(true);
+ }
+
/**
* Indicates whether our datagram socket should ignore whether
* we are set to non-blocking mode. Certain operations on our
@@ -85,14 +97,6 @@ public final class DatagramChannelImpl extends DatagramChannel
inChannelOperation = b;
}
- protected DatagramChannelImpl (SelectorProvider provider)
- throws IOException
- {
- super (provider);
- socket = new NIODatagramSocket (new PlainDatagramSocketImpl(), this);
- configureBlocking(true);
- }
-
public DatagramSocket socket ()
{
return socket;
@@ -101,13 +105,13 @@ public final class DatagramChannelImpl extends DatagramChannel
protected void implCloseSelectableChannel ()
throws IOException
{
- socket.close ();
+ channel.close();
}
protected void implConfigureBlocking (boolean blocking)
throws IOException
{
- socket.setSoTimeout (blocking ? 0 : NIOConstants.DEFAULT_TIMEOUT);
+ channel.setBlocking(blocking);
}
public DatagramChannel connect (SocketAddress remote)
@@ -116,20 +120,34 @@ public final class DatagramChannelImpl extends DatagramChannel
if (!isOpen())
throw new ClosedChannelException();
- socket.connect (remote);
+ try
+ {
+ channel.connect((InetSocketAddress) remote, 0);
+ }
+ catch (ClassCastException cce)
+ {
+ throw new IOException("unsupported socked address type");
+ }
return this;
}
public DatagramChannel disconnect ()
throws IOException
{
- socket.disconnect ();
+ channel.disconnect();
return this;
}
- public boolean isConnected ()
+ public boolean isConnected()
{
- return socket.isConnected ();
+ try
+ {
+ return channel.getPeerAddress() != null;
+ }
+ catch (IOException ioe)
+ {
+ return false;
+ }
}
public int write (ByteBuffer src)
@@ -138,7 +156,7 @@ public final class DatagramChannelImpl extends DatagramChannel
if (!isConnected ())
throw new NotYetConnectedException ();
- return send (src, socket.getRemoteSocketAddress());
+ return channel.write(src);
}
public long write (ByteBuffer[] srcs, int offset, int length)
@@ -152,13 +170,11 @@ public final class DatagramChannelImpl extends DatagramChannel
|| (length < 0)
|| (length > (srcs.length - offset)))
throw new IndexOutOfBoundsException();
-
- long result = 0;
-
- for (int index = offset; index < offset + length; index++)
- result += write (srcs [index]);
- return result;
+ /* We are connected, meaning we will write these bytes to
+ * the host we connected to, so we don't need to explicitly
+ * give the host. */
+ return channel.writeGathering(srcs, offset, length);
}
public int read (ByteBuffer dst)
@@ -167,9 +183,7 @@ public final class DatagramChannelImpl extends DatagramChannel
if (!isConnected ())
throw new NotYetConnectedException ();
- int remaining = dst.remaining();
- receive (dst);
- return remaining - dst.remaining();
+ return channel.read(dst);
}
public long read (ByteBuffer[] dsts, int offset, int length)
@@ -184,12 +198,8 @@ public final class DatagramChannelImpl extends DatagramChannel
|| (length > (dsts.length - offset)))
throw new IndexOutOfBoundsException();
- long result = 0;
-
- for (int index = offset; index < offset + length; index++)
- result += read (dsts [index]);
-
- return result;
+ /* Likewise, see the comment int write above. */
+ return channel.readScattering(dsts, offset, length);
}
public SocketAddress receive (ByteBuffer dst)
@@ -200,49 +210,12 @@ public final class DatagramChannelImpl extends DatagramChannel
try
{
- DatagramPacket packet;
- int len = dst.remaining();
-
- if (dst.hasArray())
- {
- packet = new DatagramPacket (dst.array(),
- dst.arrayOffset() + dst.position(),
- len);
- }
- else
- {
- packet = new DatagramPacket (new byte [len], len);
- }
-
- boolean completed = false;
-
- try
- {
- begin();
- setInChannelOperation(true);
- socket.receive (packet);
- completed = true;
- }
- finally
- {
- end (completed);
- setInChannelOperation(false);
- }
-
- if (!dst.hasArray())
- {
- dst.put (packet.getData(), packet.getOffset(), packet.getLength());
- }
- else
- {
- dst.position (dst.position() + packet.getLength());
- }
-
- return packet.getSocketAddress();
+ begin();
+ return channel.receive(dst);
}
- catch (SocketTimeoutException e)
+ finally
{
- return null;
+ end(true);
}
}
@@ -252,46 +225,18 @@ public final class DatagramChannelImpl extends DatagramChannel
if (!isOpen())
throw new ClosedChannelException();
- if (target instanceof InetSocketAddress
- && ((InetSocketAddress) target).isUnresolved())
- throw new IOException("Target address not resolved");
-
- byte[] buffer;
- int offset = 0;
- int len = src.remaining();
+ if (!(target instanceof InetSocketAddress))
+ throw new IOException("can only send to inet socket addresses");
- if (src.hasArray())
- {
- buffer = src.array();
- offset = src.arrayOffset() + src.position();
- }
- else
- {
- buffer = new byte [len];
- src.get (buffer);
- }
-
- DatagramPacket packet = new DatagramPacket (buffer, offset, len, target);
-
- boolean completed = false;
- try
- {
- begin();
- setInChannelOperation(true);
- socket.send(packet);
- completed = true;
- }
- finally
- {
- end (completed);
- setInChannelOperation(false);
- }
-
- if (src.hasArray())
- {
- src.position (src.position() + len);
- }
+ InetSocketAddress dst = (InetSocketAddress) target;
+ if (dst.isUnresolved())
+ throw new IOException("Target address not resolved");
- return len;
+ return channel.send(src, dst);
+ }
+
+ public VMChannel getVMChannel()
+ {
+ return channel;
}
}
diff --git a/libjava/classpath/gnu/java/nio/DatagramChannelSelectionKey.java b/libjava/classpath/gnu/java/nio/DatagramChannelSelectionKey.java
index 698e07e348f..f192e5002d4 100644
--- a/libjava/classpath/gnu/java/nio/DatagramChannelSelectionKey.java
+++ b/libjava/classpath/gnu/java/nio/DatagramChannelSelectionKey.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package gnu.java.nio;
+import java.io.IOException;
import java.nio.channels.spi.AbstractSelectableChannel;
/**
@@ -52,10 +53,16 @@ public final class DatagramChannelSelectionKey
super (channel, selector);
}
+ // FIXME don't use file descriptor integers
public int getNativeFD()
{
- NIODatagramSocket socket =
- (NIODatagramSocket) ((DatagramChannelImpl) ch).socket();
- return socket.getPlainDatagramSocketImpl().getNativeFD();
+ try
+ {
+ return ((DatagramChannelImpl) ch).getVMChannel().getState().getNativeFD();
+ }
+ catch (IOException ioe)
+ {
+ throw new IllegalStateException(ioe);
+ }
}
}
diff --git a/libjava/classpath/gnu/java/nio/EpollSelectionKeyImpl.java b/libjava/classpath/gnu/java/nio/EpollSelectionKeyImpl.java
new file mode 100644
index 00000000000..11113f3975c
--- /dev/null
+++ b/libjava/classpath/gnu/java/nio/EpollSelectionKeyImpl.java
@@ -0,0 +1,122 @@
+/* EpollSelectionKeyImpl.java -- selection key for the epoll selector.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.nio;
+
+import java.io.IOException;
+import java.nio.channels.CancelledKeyException;
+import java.nio.channels.SelectableChannel;
+import java.nio.channels.SelectionKey;
+import java.nio.channels.Selector;
+import java.nio.channels.spi.AbstractSelectionKey;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class EpollSelectionKeyImpl extends AbstractSelectionKey
+{
+ final int fd;
+ private final EpollSelectorImpl selector;
+ private final SelectableChannel channel;
+ int interestOps;
+ int selectedOps;
+ int key;
+ boolean valid;
+ boolean cancelled;
+
+ EpollSelectionKeyImpl(EpollSelectorImpl selector,
+ SelectableChannel channel, int fd)
+ {
+ this.selector = selector;
+ this.channel = channel;
+ this.fd = fd;
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.SelectionKey#channel()
+ */
+ public SelectableChannel channel()
+ {
+ return channel;
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.SelectionKey#interestOps()
+ */
+ public int interestOps()
+ {
+ return interestOps;
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.SelectionKey#interestOps(int)
+ */
+ public SelectionKey interestOps(int ops)
+ {
+ if (cancelled)
+ throw new CancelledKeyException();
+ if ((ops & ~(channel.validOps())) != 0)
+ throw new IllegalArgumentException("unsupported channel ops");
+ try
+ {
+ selector.epoll_modify(this, ops);
+ interestOps = ops;
+ }
+ catch (IOException ioe)
+ {
+ throw new IllegalArgumentException(ioe);
+ }
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.SelectionKey#readyOps()
+ */
+ public int readyOps()
+ {
+ return selectedOps;
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.SelectionKey#selector()
+ */
+ public Selector selector()
+ {
+ return selector;
+ }
+}
diff --git a/libjava/classpath/gnu/java/nio/EpollSelectorImpl.java b/libjava/classpath/gnu/java/nio/EpollSelectorImpl.java
new file mode 100644
index 00000000000..2b3c9bbb1b6
--- /dev/null
+++ b/libjava/classpath/gnu/java/nio/EpollSelectorImpl.java
@@ -0,0 +1,399 @@
+/* EpollSelectorImpl.java -- selector implementation using epoll
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.nio;
+
+import gnu.classpath.Configuration;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.SelectableChannel;
+import java.nio.channels.SelectionKey;
+import java.nio.channels.Selector;
+import java.nio.channels.spi.AbstractSelectableChannel;
+import java.nio.channels.spi.AbstractSelector;
+import java.nio.channels.spi.SelectorProvider;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * An implementation of {@link Selector} that uses the epoll event
+ * notification mechanism on GNU/Linux.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class EpollSelectorImpl extends AbstractSelector
+{
+ // XXX is this reasonable? Does it matter?
+ private static final int DEFAULT_EPOLL_SIZE = 128;
+ private static final int sizeof_struct_epoll_event;
+
+ private static final int OP_ACCEPT = SelectionKey.OP_ACCEPT;
+ private static final int OP_CONNECT = SelectionKey.OP_CONNECT;
+ private static final int OP_READ = SelectionKey.OP_READ;
+ private static final int OP_WRITE = SelectionKey.OP_WRITE;
+
+ /** our epoll file descriptor. */
+ private int epoll_fd;
+
+ private final HashMap keys;
+ private Set selectedKeys;
+ private Thread waitingThread;
+ private ByteBuffer events;
+
+ private static final int INITIAL_CAPACITY;
+ private static final int MAX_DOUBLING_CAPACITY;
+ private static final int CAPACITY_INCREMENT;
+
+ static
+ {
+ if (Configuration.INIT_LOAD_LIBRARY)
+ System.loadLibrary("javanio");
+
+ if (epoll_supported())
+ sizeof_struct_epoll_event = sizeof_struct();
+ else
+ sizeof_struct_epoll_event = -1;
+
+ INITIAL_CAPACITY = 64 * sizeof_struct_epoll_event;
+ MAX_DOUBLING_CAPACITY = 1024 * sizeof_struct_epoll_event;
+ CAPACITY_INCREMENT = 128 * sizeof_struct_epoll_event;
+ }
+
+ public EpollSelectorImpl(SelectorProvider provider)
+ throws IOException
+ {
+ super(provider);
+ epoll_fd = epoll_create(DEFAULT_EPOLL_SIZE);
+ keys = new HashMap();
+ selectedKeys = null;
+ events = ByteBuffer.allocateDirect(INITIAL_CAPACITY);
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.Selector#keys()
+ */
+ public Set keys()
+ {
+ return new HashSet(keys.values());
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.Selector#select()
+ */
+ public int select() throws IOException
+ {
+ return doSelect(-1);
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.Selector#select(long)
+ */
+ public int select(long timeout) throws IOException
+ {
+ if (timeout > Integer.MAX_VALUE)
+ throw new IllegalArgumentException("timeout is too large");
+ if (timeout < 0)
+ throw new IllegalArgumentException("invalid timeout");
+ return doSelect((int) timeout);
+ }
+
+ private int doSelect(int timeout) throws IOException
+ {
+ synchronized (keys)
+ {
+ Set cancelledKeys = cancelledKeys();
+ synchronized (cancelledKeys)
+ {
+ for (Iterator it = cancelledKeys.iterator(); it.hasNext(); )
+ {
+ EpollSelectionKeyImpl key = (EpollSelectionKeyImpl) it.next();
+ epoll_delete(epoll_fd, key.fd);
+ key.valid = false;
+ keys.remove(Integer.valueOf(key.fd));
+ it.remove();
+ deregister(key);
+ }
+
+ // Clear out closed channels. The fds are removed from the epoll
+ // fd when closed, so there is no need to remove them manually.
+ for (Iterator it = keys.values().iterator(); it.hasNext(); )
+ {
+ EpollSelectionKeyImpl key = (EpollSelectionKeyImpl) it.next();
+ SelectableChannel ch = key.channel();
+ if (ch instanceof VMChannelOwner)
+ {
+ if (!((VMChannelOwner) ch).getVMChannel().getState().isValid())
+ it.remove();
+ }
+ }
+
+ // Don't bother if we have nothing to select.
+ if (keys.isEmpty())
+ return 0;
+
+ int ret;
+ try
+ {
+ begin();
+ waitingThread = Thread.currentThread();
+ ret = epoll_wait(epoll_fd, events, keys.size(), timeout);
+ }
+ finally
+ {
+ Thread.interrupted();
+ waitingThread = null;
+ end();
+ }
+
+ HashSet s = new HashSet(ret);
+ for (int i = 0; i < ret; i++)
+ {
+ events.position(i * sizeof_struct_epoll_event);
+ ByteBuffer b = events.slice();
+ int fd = selected_fd(b);
+ EpollSelectionKeyImpl key
+ = (EpollSelectionKeyImpl) keys.get(Integer.valueOf(fd));
+ if (key == null)
+ throw new IOException("fd was selected, but no key found");
+ key.selectedOps = selected_ops(b) & key.interestOps;
+ s.add(key);
+ }
+
+ reallocateBuffer();
+
+ selectedKeys = s;
+ return ret;
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.Selector#selectedKeys()
+ */
+ public Set selectedKeys()
+ {
+ if (selectedKeys == null)
+ return Collections.EMPTY_SET;
+ return selectedKeys;
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.Selector#selectNow()
+ */
+ public int selectNow() throws IOException
+ {
+ return doSelect(0);
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.Selector#wakeup()
+ */
+ public Selector wakeup()
+ {
+ try
+ {
+ waitingThread.interrupt();
+ }
+ catch (NullPointerException npe)
+ {
+ // Ignored, thrown if we are not in a blocking op.
+ }
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.spi.AbstractSelector#implCloseSelector()
+ */
+ protected void implCloseSelector() throws IOException
+ {
+ VMChannel.close(epoll_fd);
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.spi.AbstractSelector#register(java.nio.channels.spi.AbstractSelectableChannel, int, java.lang.Object)
+ */
+ protected SelectionKey register(AbstractSelectableChannel ch, int ops, Object att)
+ {
+ if (!(ch instanceof VMChannelOwner))
+ throw new IllegalArgumentException("unsupported channel type");
+
+ VMChannel channel = ((VMChannelOwner) ch).getVMChannel();
+ try
+ {
+ int native_fd = channel.getState().getNativeFD();
+ synchronized (keys)
+ {
+ if (keys.containsKey(Integer.valueOf(native_fd)))
+ throw new IllegalArgumentException("channel already registered");
+ EpollSelectionKeyImpl result =
+ new EpollSelectionKeyImpl(this, ch, native_fd);
+ if ((ops & ~(ch.validOps())) != 0)
+ throw new IllegalArgumentException("invalid ops for channel");
+ result.interestOps = ops;
+ result.selectedOps = 0;
+ result.valid = true;
+ result.attach(att);
+ result.key = System.identityHashCode(result);
+ epoll_add(epoll_fd, result.fd, ops);
+ keys.put(Integer.valueOf(native_fd), result);
+ reallocateBuffer();
+ return result;
+ }
+ }
+ catch (IOException ioe)
+ {
+ throw new IllegalArgumentException(ioe);
+ }
+ }
+
+ private void reallocateBuffer()
+ {
+ // Ensure we have enough space for all potential events that may be
+ // returned.
+ if (events.capacity() < keys.size() * sizeof_struct_epoll_event)
+ {
+ int cap = events.capacity();
+ if (cap < MAX_DOUBLING_CAPACITY)
+ cap <<= 1;
+ else
+ cap += CAPACITY_INCREMENT;
+ events = ByteBuffer.allocateDirect(cap);
+ }
+ // Ensure that the events buffer is not too large, given the number of
+ // events registered.
+ else if (events.capacity() > keys.size() * sizeof_struct_epoll_event * 2 + 1
+ && events.capacity() > INITIAL_CAPACITY)
+ {
+ int cap = events.capacity() >>> 1;
+ events = ByteBuffer.allocateDirect(cap);
+ }
+ }
+
+ void epoll_modify(EpollSelectionKeyImpl key, int ops) throws IOException
+ {
+ epoll_modify(epoll_fd, key.fd, ops);
+ }
+
+ /**
+ * Tell if epoll is supported by this system, and support was compiled in.
+ *
+ * @return True if this system supports event notification with epoll.
+ */
+ public static native boolean epoll_supported();
+
+
+ /**
+ * Returns the size of `struct epoll_event'.
+ *
+ * @return The size of `struct epoll_event'.
+ */
+ private static native int sizeof_struct();
+
+
+ /**
+ * Open a new epoll file descriptor.
+ *
+ * @param size The size hint for the new epoll descriptor.
+ * @return The new file descriptor integer.
+ * @throws IOException If allocating a new epoll descriptor fails.
+ */
+ private static native int epoll_create(int size) throws IOException;
+
+ /**
+ * Add a file descriptor to this selector.
+ *
+ * @param efd The epoll file descriptor.
+ * @param fd The file descriptor to add (or modify).
+ * @param ops The interest opts.
+ */
+ private static native void epoll_add(int efd, int fd, int ops)
+ throws IOException;
+
+ /**
+ * Modify the interest ops of the key selecting for the given FD.
+ *
+ * @param efd The epoll file descriptor.
+ * @param fd The file descriptor to modify.
+ * @param ops The ops.
+ * @throws IOException
+ */
+ private static native void epoll_modify(int efd, int fd, int ops)
+ throws IOException;
+
+ /**
+ * Remove a file descriptor from this selector.
+ *
+ * @param efd The epoll file descriptor.
+ * @param fd The file descriptor.
+ * @throws IOException
+ */
+ private static native void epoll_delete(int efd, int fd) throws IOException;
+
+ /**
+ * Select events.
+ *
+ * @param efd The epoll file descriptor.
+ * @param state The buffer to hold selected events.
+ * @param n The number of events that may be put in `state'.
+ * @param timeout The timeout.
+ * @return The number of events selected.
+ * @throws IOException
+ */
+ private static native int epoll_wait(int efd, ByteBuffer state, int n, int timeout)
+ throws IOException;
+
+ /**
+ * Fetch the fd value from a selected struct epoll_event.
+ *
+ * @param struct The direct buffer holding the struct.
+ * @return The fd value.
+ */
+ private static native int selected_fd(ByteBuffer struct);
+
+ /**
+ * Fetch the enabled operations from a selected struct epoll_event.
+ *
+ * @param struct The direct buffer holding the struct.
+ * @return The selected operations.
+ */
+ private static native int selected_ops(ByteBuffer struct);
+}
diff --git a/libjava/classpath/gnu/java/nio/FileChannelImpl.java b/libjava/classpath/gnu/java/nio/FileChannelImpl.java
new file mode 100644
index 00000000000..41912405078
--- /dev/null
+++ b/libjava/classpath/gnu/java/nio/FileChannelImpl.java
@@ -0,0 +1,572 @@
+/* FileChannelImpl.java --
+ Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.nio;
+
+import gnu.classpath.Configuration;
+import gnu.java.nio.FileLockImpl;
+import gnu.java.nio.VMChannel;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.ClosedChannelException;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileLock;
+import java.nio.channels.NonReadableChannelException;
+import java.nio.channels.NonWritableChannelException;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.channels.WritableByteChannel;
+
+/**
+ * This file is not user visible !
+ * But alas, Java does not have a concept of friendly packages
+ * so this class is public.
+ * Instances of this class are created by invoking getChannel
+ * Upon a Input/Output/RandomAccessFile object.
+ */
+public final class FileChannelImpl extends FileChannel
+{
+ // These are mode values for open().
+ public static final int READ = 1;
+ public static final int WRITE = 2;
+ public static final int APPEND = 4;
+
+ // EXCL is used only when making a temp file.
+ public static final int EXCL = 8;
+ public static final int SYNC = 16;
+ public static final int DSYNC = 32;
+
+ public static final FileChannelImpl in;
+ public static final FileChannelImpl out;
+ public static final FileChannelImpl err;
+
+ //private static native void init();
+
+ static
+ {
+ if (Configuration.INIT_LOAD_LIBRARY)
+ {
+ System.loadLibrary("javanio");
+ }
+
+ //init();
+
+ FileChannelImpl ch = null;
+ try
+ {
+ ch = new FileChannelImpl(VMChannel.getStdin(), READ);
+ }
+ catch (IOException ioe)
+ {
+ throw new Error(ioe);
+ }
+ in = ch;
+
+ ch = null;
+ try
+ {
+ ch = new FileChannelImpl(VMChannel.getStdout(), WRITE);
+ }
+ catch (IOException ioe)
+ {
+ throw new Error(ioe);
+ }
+ out = ch;
+
+ ch = null;
+ try
+ {
+ ch = new FileChannelImpl(VMChannel.getStderr(), WRITE);
+ }
+ catch (IOException ioe)
+ {
+ throw new Error(ioe);
+ }
+ err = ch;
+ }
+
+ /**
+ * This is the actual native file descriptor value
+ */
+ private VMChannel ch;
+
+ private int mode;
+
+ final String description;
+
+ /* Open a file. MODE is a combination of the above mode flags. */
+ /* This is a static factory method, so that VM implementors can decide
+ * substitute subclasses of FileChannelImpl. */
+ public static FileChannelImpl create(File file, int mode)
+ throws IOException
+ {
+ return new FileChannelImpl(file, mode);
+ }
+
+ private FileChannelImpl(File file, int mode)
+ throws IOException
+ {
+ String path = file.getPath();
+ description = path;
+ this.mode = mode;
+ this.ch = new VMChannel();
+ ch.openFile(path, mode);
+
+ // First open the file and then check if it is a a directory
+ // to avoid race condition.
+ if (file.isDirectory())
+ {
+ try
+ {
+ close();
+ }
+ catch (IOException e)
+ {
+ /* ignore it */
+ }
+
+ throw new FileNotFoundException(description + " is a directory");
+ }
+ }
+
+ /**
+ * Constructor for default channels in, out and err.
+ *
+ * Used by init() (native code).
+ *
+ * @param fd the file descriptor (0, 1, 2 for stdin, stdout, stderr).
+ *
+ * @param mode READ or WRITE
+ */
+ FileChannelImpl (VMChannel ch, int mode)
+ {
+ this.mode = mode;
+ this.description = "descriptor(" + ch.getState() + ")";
+ this.ch = ch;
+ }
+
+ public int available() throws IOException
+ {
+ return ch.available();
+ }
+
+ private long implPosition() throws IOException
+ {
+ return ch.position();
+ }
+
+ private void seek(long newPosition) throws IOException
+ {
+ ch.seek(newPosition);
+ }
+
+ private void implTruncate(long size) throws IOException
+ {
+ ch.truncate(size);
+ }
+
+ public void unlock(long pos, long len) throws IOException
+ {
+ ch.unlock(pos, len);
+ }
+
+ public long size () throws IOException
+ {
+ return ch.size();
+ }
+
+ protected void implCloseChannel() throws IOException
+ {
+ ch.close();
+ }
+
+ /**
+ * Makes sure the Channel is properly closed.
+ */
+ protected void finalize() throws IOException
+ {
+ if (ch.getState().isValid())
+ close();
+ }
+
+ public int read (ByteBuffer dst) throws IOException
+ {
+ return ch.read(dst);
+ }
+
+ public int read (ByteBuffer dst, long position)
+ throws IOException
+ {
+ if (position < 0)
+ throw new IllegalArgumentException ("position: " + position);
+ long oldPosition = implPosition ();
+ position (position);
+ int result = read(dst);
+ position (oldPosition);
+
+ return result;
+ }
+
+ public int read() throws IOException
+ {
+ return ch.read();
+ }
+
+ public long read (ByteBuffer[] dsts, int offset, int length)
+ throws IOException
+ {
+ return ch.readScattering(dsts, offset, length);
+ }
+
+ public int write (ByteBuffer src) throws IOException
+ {
+ return ch.write(src);
+ }
+
+ public int write (ByteBuffer src, long position)
+ throws IOException
+ {
+ if (position < 0)
+ throw new IllegalArgumentException ("position: " + position);
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ if ((mode & WRITE) == 0)
+ throw new NonWritableChannelException ();
+
+ int result;
+ long oldPosition;
+
+ oldPosition = implPosition ();
+ seek (position);
+ result = write(src);
+ seek (oldPosition);
+
+ return result;
+ }
+
+ public void write (int b) throws IOException
+ {
+ ch.write(b);
+ }
+
+ public long write(ByteBuffer[] srcs, int offset, int length)
+ throws IOException
+ {
+ return ch.writeGathering(srcs, offset, length);
+ }
+
+ public MappedByteBuffer map (FileChannel.MapMode mode,
+ long position, long size)
+ throws IOException
+ {
+ char nmode = 0;
+ if (mode == MapMode.READ_ONLY)
+ {
+ nmode = 'r';
+ if ((this.mode & READ) == 0)
+ throw new NonReadableChannelException();
+ }
+ else if (mode == MapMode.READ_WRITE || mode == MapMode.PRIVATE)
+ {
+ nmode = mode == MapMode.READ_WRITE ? '+' : 'c';
+ if ((this.mode & WRITE) != WRITE)
+ throw new NonWritableChannelException();
+ if ((this.mode & READ) != READ)
+ throw new NonReadableChannelException();
+ }
+ else
+ throw new IllegalArgumentException ("mode: " + mode);
+
+ if (position < 0 || size < 0 || size > Integer.MAX_VALUE)
+ throw new IllegalArgumentException ("position: " + position
+ + ", size: " + size);
+ return ch.map(nmode, position, (int) size);
+ }
+
+ /**
+ * msync with the disk
+ */
+ public void force (boolean metaData) throws IOException
+ {
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ ch.flush(metaData);
+ }
+
+ // like transferTo, but with a count of less than 2Gbytes
+ private int smallTransferTo (long position, int count,
+ WritableByteChannel target)
+ throws IOException
+ {
+ ByteBuffer buffer;
+ try
+ {
+ // Try to use a mapped buffer if we can. If this fails for
+ // any reason we'll fall back to using a ByteBuffer.
+ buffer = map (MapMode.READ_ONLY, position, count);
+ }
+ catch (IOException e)
+ {
+ buffer = ByteBuffer.allocate (count);
+ read (buffer, position);
+ buffer.flip();
+ }
+
+ return target.write (buffer);
+ }
+
+ public long transferTo (long position, long count,
+ WritableByteChannel target)
+ throws IOException
+ {
+ if (position < 0
+ || count < 0)
+ throw new IllegalArgumentException ("position: " + position
+ + ", count: " + count);
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ if ((mode & READ) == 0)
+ throw new NonReadableChannelException ();
+
+ final int pageSize = 65536;
+ long total = 0;
+
+ while (count > 0)
+ {
+ int transferred
+ = smallTransferTo (position, (int)Math.min (count, pageSize),
+ target);
+ if (transferred < 0)
+ break;
+ total += transferred;
+ position += transferred;
+ count -= transferred;
+ }
+
+ return total;
+ }
+
+ // like transferFrom, but with a count of less than 2Gbytes
+ private int smallTransferFrom (ReadableByteChannel src, long position,
+ int count)
+ throws IOException
+ {
+ ByteBuffer buffer = null;
+
+ if (src instanceof FileChannel)
+ {
+ try
+ {
+ // Try to use a mapped buffer if we can. If this fails
+ // for any reason we'll fall back to using a ByteBuffer.
+ buffer = ((FileChannel)src).map (MapMode.READ_ONLY, position,
+ count);
+ }
+ catch (IOException e)
+ {
+ }
+ }
+
+ if (buffer == null)
+ {
+ buffer = ByteBuffer.allocate ((int) count);
+ src.read (buffer);
+ buffer.flip();
+ }
+
+ return write (buffer, position);
+ }
+
+ public long transferFrom (ReadableByteChannel src, long position,
+ long count)
+ throws IOException
+ {
+ if (position < 0
+ || count < 0)
+ throw new IllegalArgumentException ("position: " + position
+ + ", count: " + count);
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ if ((mode & WRITE) == 0)
+ throw new NonWritableChannelException ();
+
+ final int pageSize = 65536;
+ long total = 0;
+
+ while (count > 0)
+ {
+ int transferred = smallTransferFrom (src, position,
+ (int)Math.min (count, pageSize));
+ if (transferred < 0)
+ break;
+ total += transferred;
+ position += transferred;
+ count -= transferred;
+ }
+
+ return total;
+ }
+
+ // Shared sanity checks between lock and tryLock methods.
+ private void lockCheck(long position, long size, boolean shared)
+ throws IOException
+ {
+ if (position < 0
+ || size < 0)
+ throw new IllegalArgumentException ("position: " + position
+ + ", size: " + size);
+
+ if (!isOpen ())
+ throw new ClosedChannelException();
+
+ if (shared && ((mode & READ) == 0))
+ throw new NonReadableChannelException();
+
+ if (!shared && ((mode & WRITE) == 0))
+ throw new NonWritableChannelException();
+ }
+
+ public FileLock tryLock (long position, long size, boolean shared)
+ throws IOException
+ {
+ lockCheck(position, size, shared);
+
+ boolean completed = false;
+ try
+ {
+ begin();
+ boolean lockable = ch.lock(position, size, shared, false);
+ completed = true;
+ return (lockable
+ ? new FileLockImpl(this, position, size, shared)
+ : null);
+ }
+ finally
+ {
+ end(completed);
+ }
+ }
+
+ public FileLock lock (long position, long size, boolean shared)
+ throws IOException
+ {
+ lockCheck(position, size, shared);
+
+ boolean completed = false;
+ try
+ {
+ boolean lockable = ch.lock(position, size, shared, true);
+ completed = true;
+ return (lockable
+ ? new FileLockImpl(this, position, size, shared)
+ : null);
+ }
+ finally
+ {
+ end(completed);
+ }
+ }
+
+ public long position ()
+ throws IOException
+ {
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ return implPosition ();
+ }
+
+ public FileChannel position (long newPosition)
+ throws IOException
+ {
+ if (newPosition < 0)
+ throw new IllegalArgumentException ("newPosition: " + newPosition);
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ // FIXME note semantics if seeking beyond eof.
+ // We should seek lazily - only on a write.
+ seek (newPosition);
+ return this;
+ }
+
+ public FileChannel truncate (long size)
+ throws IOException
+ {
+ if (size < 0)
+ throw new IllegalArgumentException ("size: " + size);
+
+ if (!isOpen ())
+ throw new ClosedChannelException ();
+
+ if ((mode & WRITE) == 0)
+ throw new NonWritableChannelException ();
+
+ if (size < size ())
+ implTruncate (size);
+
+ return this;
+ }
+
+ public String toString()
+ {
+ return (super.toString()
+ + "[ fd: " + ch.getState()
+ + "; mode: " + Integer.toOctalString(mode)
+ + "; " + description + " ]");
+ }
+
+ /**
+ * @return The native file descriptor.
+ * /
+ public int getNativeFD()
+ {
+ return fd;
+ }*/
+}
diff --git a/libjava/classpath/gnu/java/nio/FileLockImpl.java b/libjava/classpath/gnu/java/nio/FileLockImpl.java
index 673ca2522df..768906ce973 100644
--- a/libjava/classpath/gnu/java/nio/FileLockImpl.java
+++ b/libjava/classpath/gnu/java/nio/FileLockImpl.java
@@ -38,8 +38,6 @@ exception statement from your version. */
package gnu.java.nio;
-import gnu.java.nio.channels.FileChannelImpl;
-
import java.io.IOException;
import java.nio.channels.FileLock;
diff --git a/libjava/classpath/gnu/java/nio/KqueueSelectionKeyImpl.java b/libjava/classpath/gnu/java/nio/KqueueSelectionKeyImpl.java
new file mode 100644
index 00000000000..2f93c50cc19
--- /dev/null
+++ b/libjava/classpath/gnu/java/nio/KqueueSelectionKeyImpl.java
@@ -0,0 +1,189 @@
+/* KqueueSelectionKeyImpl.java -- selection key for kqueue/kevent.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.nio;
+
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.SelectableChannel;
+import java.nio.channels.SelectionKey;
+import java.nio.channels.Selector;
+import java.nio.channels.spi.AbstractSelectionKey;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class KqueueSelectionKeyImpl extends AbstractSelectionKey
+{
+ int interestOps;
+ int readyOps;
+ int activeOps = 0;
+ int key;
+ int fd;
+
+ /** The selector we were created for. */
+ private final KqueueSelectorImpl selector;
+
+ /** The channel we are attached to. */
+ private final SelectableChannel channel;
+
+ private final VMChannelOwner natChannel;
+
+ public KqueueSelectionKeyImpl(KqueueSelectorImpl selector,
+ SelectableChannel channel)
+ {
+ this.selector = selector;
+ this.channel = channel;
+ natChannel = (VMChannelOwner) channel;
+ interestOps = 0;
+ readyOps = 0;
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.SelectionKey#channel()
+ */
+ //@Override
+ public SelectableChannel channel()
+ {
+ return channel;
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.SelectionKey#interestOps()
+ */
+ //@Override
+ public int interestOps()
+ {
+ return interestOps;
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.SelectionKey#interestOps(int)
+ */
+ //@Override
+ public SelectionKey interestOps(int ops)
+ {
+ if (!isValid())
+ throw new IllegalStateException("key is invalid");
+ if ((ops & ~channel.validOps()) != 0)
+ throw new IllegalArgumentException("channel does not support all operations");
+
+ selector.setInterestOps(this, ops);
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.SelectionKey#readyOps()
+ */
+ //@Override
+ public int readyOps()
+ {
+ return readyOps;
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.SelectionKey#selector()
+ */
+ //@Override
+ public Selector selector()
+ {
+ return selector;
+ }
+
+ public String toString()
+ {
+ if (!isValid())
+ return super.toString() + " [ fd: " + fd + " <<invalid>> ]";
+ return super.toString() + " [ fd: " + fd + " interest ops: {"
+ + ((interestOps & OP_ACCEPT) != 0 ? " OP_ACCEPT" : "")
+ + ((interestOps & OP_CONNECT) != 0 ? " OP_CONNECT" : "")
+ + ((interestOps & OP_READ) != 0 ? " OP_READ" : "")
+ + ((interestOps & OP_WRITE) != 0 ? " OP_WRITE" : "")
+ + " }; ready ops: {"
+ + ((readyOps & OP_ACCEPT) != 0 ? " OP_ACCEPT" : "")
+ + ((readyOps & OP_CONNECT) != 0 ? " OP_CONNECT" : "")
+ + ((readyOps & OP_READ) != 0 ? " OP_READ" : "")
+ + ((readyOps & OP_WRITE) != 0 ? " OP_WRITE" : "")
+ + " } ]";
+ }
+
+ public int hashCode()
+ {
+ return fd;
+ }
+
+ public boolean equals(Object o)
+ {
+ if (!(o instanceof KqueueSelectionKeyImpl))
+ return false;
+ KqueueSelectionKeyImpl that = (KqueueSelectionKeyImpl) o;
+ return that.fd == this.fd && that.channel.equals(this.channel);
+ }
+
+
+ boolean isReadActive()
+ {
+ return (activeOps & (OP_READ | OP_ACCEPT)) != 0;
+ }
+
+ boolean isReadInterested()
+ {
+ return (interestOps & (OP_READ | OP_ACCEPT)) != 0;
+ }
+
+ boolean isWriteActive()
+ {
+ return (activeOps & (OP_WRITE | OP_CONNECT)) != 0;
+ }
+
+ boolean isWriteInterested()
+ {
+ return (interestOps & (OP_WRITE | OP_CONNECT)) != 0;
+ }
+
+ boolean needCommitRead()
+ {
+ return isReadActive() == (!isReadInterested());
+ }
+
+ boolean needCommitWrite()
+ {
+ return isWriteActive() == (!isWriteInterested());
+ }
+}
diff --git a/libjava/classpath/gnu/java/nio/KqueueSelectorImpl.java b/libjava/classpath/gnu/java/nio/KqueueSelectorImpl.java
new file mode 100644
index 00000000000..34ca1dc596d
--- /dev/null
+++ b/libjava/classpath/gnu/java/nio/KqueueSelectorImpl.java
@@ -0,0 +1,527 @@
+/* KqueueSelectorImpl.java -- Selector for systems with kqueue event notification.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.nio;
+
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.channels.ClosedSelectorException;
+import java.nio.channels.SelectableChannel;
+import java.nio.channels.SelectionKey;
+import java.nio.channels.Selector;
+import java.nio.channels.spi.AbstractSelectableChannel;
+import java.nio.channels.spi.AbstractSelector;
+import java.nio.channels.spi.SelectorProvider;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * A {@link Selector} implementation that uses the <code>kqueue</code>
+ * event notification facility.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class KqueueSelectorImpl extends AbstractSelector
+{
+ // Prepended underscore to field name to make it distinct
+ // from the method with the similar name.
+ private static final int _sizeof_struct_kevent;
+
+ private static final int MAX_DOUBLING_CAPACITY = 16384;
+ private static final int CAP_INCREMENT = 1024;
+ private static final int INITIAL_CAPACITY;
+
+ static
+ {
+ try
+ {
+ System.loadLibrary("javanio");
+ }
+ catch (Exception x)
+ {
+ x.printStackTrace();
+ }
+
+ if (kqueue_supported ())
+ _sizeof_struct_kevent = sizeof_struct_kevent();
+ else
+ _sizeof_struct_kevent = -1;
+ INITIAL_CAPACITY = 16 * _sizeof_struct_kevent;
+ }
+
+ /**
+ * Tell if kqueue-based selectors are supported on this system.
+ *
+ * @return True if this system has kqueue support, and support for it was
+ * compiled in to Classpath.
+ */
+ public static native boolean kqueue_supported();
+
+ /* Our native file descriptor. */
+ private int kq;
+
+ private HashMap/*<Integer,KqueueSelectionKeyImpl>*/ keys;
+ private HashSet/*<KqueueSelectionKeyImpl>*/ selected;
+ private Thread blockedThread;
+ private ByteBuffer events;
+
+ private static final int OP_ACCEPT = SelectionKey.OP_ACCEPT;
+ private static final int OP_CONNECT = SelectionKey.OP_CONNECT;
+ private static final int OP_READ = SelectionKey.OP_READ;
+ private static final int OP_WRITE = SelectionKey.OP_WRITE;
+
+ public KqueueSelectorImpl(SelectorProvider provider) throws IOException
+ {
+ super(provider);
+ kq = implOpen();
+ keys = new HashMap/*<KqueueSelectionKeyImpl>*/();
+ events = ByteBuffer.allocateDirect(INITIAL_CAPACITY);
+ }
+
+ protected void implCloseSelector() throws IOException
+ {
+ implClose(kq);
+ kq = -1;
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.Selector#keys()
+ */
+ public Set keys()
+ {
+ if (!isOpen())
+ throw new ClosedSelectorException();
+
+ return new HashSet(keys.values());
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.Selector#select()
+ */
+ public int select() throws IOException
+ {
+ return doSelect(-1);
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.Selector#select(long)
+ */
+ public int select(long timeout) throws IOException
+ {
+ if (timeout == 0)
+ timeout = -1;
+ return doSelect(timeout);
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.Selector#selectedKeys()
+ */
+ public Set selectedKeys()
+ {
+ if (!isOpen())
+ throw new ClosedSelectorException();
+
+ return selected;
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.Selector#selectNow()
+ */
+ public int selectNow() throws IOException
+ {
+ return doSelect(0);
+ }
+
+ /* (non-Javadoc)
+ * @see java.nio.channels.Selector#wakeup()
+ */
+ public Selector wakeup()
+ {
+ if (blockedThread != null)
+ blockedThread.interrupt();
+ return this;
+ }
+
+ public String toString()
+ {
+ return super.toString() + " [ fd: " + kq + " ]";
+ }
+
+ public boolean equals(Object o)
+ {
+ if (!(o instanceof KqueueSelectorImpl))
+ return false;
+
+ return ((KqueueSelectorImpl) o).kq == kq;
+ }
+
+ int doSelect(long timeout) throws IOException
+ {
+ Set cancelled = cancelledKeys();
+ synchronized (cancelled)
+ {
+ synchronized (keys)
+ {
+ for (Iterator it = cancelled.iterator(); it.hasNext(); )
+ {
+ KqueueSelectionKeyImpl key = (KqueueSelectionKeyImpl) it.next();
+ key.interestOps = 0;
+ }
+
+ int events_size = (2 * _sizeof_struct_kevent) * keys.size();
+ int num_events = 0;
+
+ for (Iterator it = keys.entrySet().iterator(); it.hasNext(); )
+ {
+ Map.Entry e = (Map.Entry) it.next();
+ KqueueSelectionKeyImpl key = (KqueueSelectionKeyImpl) e.getValue();
+
+ SelectableChannel ch = key.channel();
+ if (ch instanceof VMChannelOwner)
+ {
+ if (!((VMChannelOwner) ch).getVMChannel().getState().isValid())
+ {
+ // closed channel; removed from kqueue automatically.
+ it.remove();
+ continue;
+ }
+ }
+
+ // If this key is registering a read filter, add it to the buffer.
+ if (key.needCommitRead())
+ {
+ kevent_set(events, num_events, key.fd,
+ key.interestOps & (OP_READ | OP_ACCEPT),
+ key.activeOps & (OP_READ | OP_ACCEPT), key.key);
+ num_events++;
+ }
+
+ // If this key is registering a write filter, add it to the buffer.
+ if (key.needCommitWrite())
+ {
+ kevent_set(events, num_events, key.fd,
+ key.interestOps & (OP_WRITE | OP_CONNECT),
+ key.activeOps & (OP_WRITE | OP_CONNECT), key.key);
+ num_events++;
+ }
+ }
+ events.rewind().limit(events.capacity());
+
+ //System.out.println("dump of keys to select:");
+ //dump_selection_keys(events.duplicate());
+
+ int n = 0;
+ try
+ {
+ //System.out.println("[" + kq + "] kevent enter selecting from " + keys.size());
+ begin();
+ blockedThread = Thread.currentThread();
+ if (blockedThread.isInterrupted())
+ timeout = 0;
+ n = kevent(kq, events, num_events,
+ events.capacity() / _sizeof_struct_kevent, timeout);
+ }
+ finally
+ {
+ end();
+ blockedThread = null;
+ Thread.interrupted();
+ //System.out.println("[" + kq + "kevent exit selected " + n);
+ }
+
+ //System.out.println("dump of keys selected:");
+ //dump_selection_keys((ByteBuffer) events.duplicate().limit(n * _sizeof_struct_kevent));
+
+ // Commit the operations we've just added in the call to kevent.
+ for (Iterator it = keys.values().iterator(); it.hasNext(); )
+ {
+ KqueueSelectionKeyImpl key = (KqueueSelectionKeyImpl) it.next();
+ key.activeOps = key.interestOps;
+ }
+
+ selected = new HashSet/*<KqueueSelectionKeyImpl>*/(n);
+ int x = 0;
+ for (int i = 0; i < n; i++)
+ {
+ events.position(x).limit(x + _sizeof_struct_kevent);
+ x += _sizeof_struct_kevent;
+ int y = fetch_key(events.slice());
+ KqueueSelectionKeyImpl key =
+ (KqueueSelectionKeyImpl) keys.get(new Integer(y));
+
+ if (key == null)
+ {
+ System.out.println("WARNING! no key found for selected key " + y);
+ continue;
+ }
+ // Keys that have been cancelled may be returned here; don't
+ // add them to the selected set.
+ if (!key.isValid())
+ continue;
+ key.readyOps = ready_ops(events.slice(), key.interestOps);
+ selected.add(key);
+ }
+
+ // Finally, remove the cancelled keys.
+ for (Iterator it = cancelled.iterator(); it.hasNext(); )
+ {
+ KqueueSelectionKeyImpl key = (KqueueSelectionKeyImpl) it.next();
+ keys.remove(new Integer(key.key));
+ deregister(key);
+ it.remove();
+ }
+
+ reallocateBuffer();
+
+ return selected.size();
+ }
+ }
+ }
+
+ protected SelectionKey register(AbstractSelectableChannel channel,
+ int interestOps,
+ Object attachment)
+ {
+ int native_fd = -1;
+ try
+ {
+ if (channel instanceof VMChannelOwner)
+ native_fd = ((VMChannelOwner) channel).getVMChannel()
+ .getState().getNativeFD();
+ else
+ throw new IllegalArgumentException("cannot handle channel type " +
+ channel.getClass().getName());
+ }
+ catch (IOException ioe)
+ {
+ throw new IllegalArgumentException("channel is closed or invalid");
+ }
+
+ KqueueSelectionKeyImpl result = new KqueueSelectionKeyImpl(this, channel);
+ result.interestOps = interestOps;
+ result.attach(attachment);
+ result.fd = native_fd;
+ result.key = System.identityHashCode(result);
+ synchronized (keys)
+ {
+ while (keys.containsKey(new Integer(result.key)))
+ result.key++;
+ keys.put(new Integer(result.key), result);
+ reallocateBuffer();
+ }
+ return result;
+ }
+
+ void setInterestOps(KqueueSelectionKeyImpl key, int ops)
+ {
+ synchronized (keys)
+ {
+ key.interestOps = ops;
+ }
+ }
+
+ /**
+ * Reallocate the events buffer. This is the destination buffer for
+ * events returned by kevent. This method will:
+ *
+ * * Grow the buffer if there is insufficent space for all registered
+ * events.
+ * * Shrink the buffer if it is more than twice the size needed.
+ *
+ */
+ private void reallocateBuffer()
+ {
+ synchronized (keys)
+ {
+ if (events.capacity() < (2 * _sizeof_struct_kevent) * keys.size())
+ {
+ int cap = events.capacity();
+ if (cap >= MAX_DOUBLING_CAPACITY)
+ cap += CAP_INCREMENT;
+ else
+ cap = cap << 1;
+
+ events = ByteBuffer.allocateDirect(cap);
+ }
+ else if (events.capacity() > 4 * (_sizeof_struct_kevent) * keys.size() + 1
+ && events.capacity() > INITIAL_CAPACITY)
+ {
+ int cap = events.capacity();
+ cap = cap >>> 1;
+ events = ByteBuffer.allocateDirect(cap);
+ }
+ }
+ }
+
+ //synchronized void updateOps(KqueueSelectionKeyImpl key, int interestOps)
+ //{
+ // updateOps(key, interestOps, 0, false);
+ //}
+
+ /*void updateOps(KqueueSelectionKeyImpl key, int interestOps,
+ int activeOps, int fd)
+ {
+ //System.out.println(">> updating kqueue selection key:");
+ //dump_selection_keys(key.nstate.duplicate());
+ //System.out.println("<<");
+ synchronized (keys)
+ {
+ kevent_set(key.nstate, fd, interestOps, activeOps, key.key);
+ }
+ //System.out.println(">> updated kqueue selection key:");
+ //dump_selection_keys(key.nstate.duplicate());
+ //System.out.println("<<");
+ }*/
+
+ private void dump_selection_keys(ByteBuffer keys)
+ {
+ // WARNING! This method is not guaranteed to be portable! This works
+ // on darwin/x86, but the sizeof and offsetof these fields may be
+ // different on other platforms!
+ int i = 0;
+ keys.order(ByteOrder.nativeOrder());
+ while (keys.hasRemaining())
+ {
+ System.out.println("struct kevent { ident: "
+ + Integer.toString(keys.getInt())
+ + " filter: "
+ + Integer.toHexString(keys.getShort() & 0xFFFF)
+ + " flags: "
+ + Integer.toHexString(keys.getShort() & 0xFFFF)
+ + " fflags: "
+ + Integer.toHexString(keys.getInt())
+ + " data: "
+ + Integer.toHexString(keys.getInt())
+ + " udata: "
+ + Integer.toHexString(keys.getInt())
+ + " }");
+ }
+ }
+
+ /**
+ * Return the size of a <code>struct kevent</code> on this system.
+ *
+ * @return The size of <code>struct kevent</code>.
+ */
+ private static native int sizeof_struct_kevent();
+
+ /**
+ * Opens a kqueue descriptor.
+ *
+ * @return The new kqueue descriptor.
+ * @throws IOException If opening fails.
+ */
+ private static native int implOpen() throws IOException;
+
+ /**
+ * Closes the kqueue file descriptor.
+ *
+ * @param kq The kqueue file descriptor.
+ * @throws IOException
+ */
+ private static native void implClose(int kq) throws IOException;
+
+ /**
+ * Initialize the specified native state for the given interest ops.
+ *
+ * @param nstate The native state structures; in this buffer should be
+ * the <code>struct kevent</code>s created for a key.
+ * @param fd The file descriptor. If 0, the native FD is unmodified.
+ * @param interestOps The operations to enable.
+ * @param key A unique key that will reference the associated key later.
+ * @param delete Set to true if this event should be deleted from the
+ * kqueue (if false, this event is added/updated).
+ */
+ private static native void kevent_set(ByteBuffer nstate, int i, int fd,
+ int interestOps, int activeOps, int key);
+
+ /**
+ * Poll for events. The source events are stored in <code>events</code>,
+ * which is also where polled events will be placed.
+ *
+ * @param events The events to poll. This buffer is also the destination
+ * for events read from the queue.
+ * @param nevents The number of events to poll (that is, the number of
+ * events in the <code>events</code> buffer).
+ * @param nout The maximum number of events that may be returned.
+ * @param timeout The timeout. A timeout of -1 returns immediately; a timeout
+ * of 0 waits indefinitely.
+ * @return The number of events read.
+ */
+ private static native int kevent(int kq, ByteBuffer events, int nevents,
+ int nout, long timeout);
+
+ /**
+ * Fetch a polled key from a native state buffer. For each kevent key we
+ * create, we put the native state info (one or more <code>struct
+ * kevent</code>s) in that key's {@link KqueueSelectionKeyImpl#nstate}
+ * buffer, and place the pointer of the key in the <code>udata</code> field
+ * of that structure. This method fetches that pointer from the given
+ * buffer (assumed to be a <code>struct kqueue</code>) and returns it.
+ *
+ * @param nstate The buffer containing the <code>struct kqueue</code> to read.
+ * @return The key object.
+ */
+ private static native int fetch_key(ByteBuffer nstate);
+
+ /**
+ * Fetch the ready ops of the associated native state. That is, this
+ * inspects the first argument as a <code>struct kevent</code>, looking
+ * at its operation (the input is assumed to have been returned via a
+ * previous call to <code>kevent</code>), and translating that to the
+ * appropriate Java bit set, based on the second argument.
+ *
+ * @param nstate The native state.
+ * @param interestOps The enabled operations for the key.
+ * @return The bit set representing the ready operations.
+ */
+ private static native int ready_ops(ByteBuffer nstate, int interestOps);
+
+ /**
+ * Check if kevent returned EV_EOF for a selection key.
+ *
+ * @param nstate The native state.
+ * @return True if the kevent call returned EOF.
+ */
+ private static native boolean check_eof(ByteBuffer nstate);
+}
diff --git a/libjava/classpath/gnu/java/nio/NIOSocket.java b/libjava/classpath/gnu/java/nio/NIOSocket.java
index 4d812bf44ba..060a3a89c1c 100644
--- a/libjava/classpath/gnu/java/nio/NIOSocket.java
+++ b/libjava/classpath/gnu/java/nio/NIOSocket.java
@@ -48,30 +48,33 @@ import java.nio.channels.SocketChannel;
*/
public final class NIOSocket extends Socket
{
- private PlainSocketImpl impl;
private SocketChannelImpl channel;
- protected NIOSocket (PlainSocketImpl impl, SocketChannelImpl channel)
+ protected NIOSocket (SocketChannelImpl channel)
throws IOException
{
- super (impl);
- this.impl = impl;
+ super (new NIOSocketImpl(channel));
this.channel = channel;
}
- public final PlainSocketImpl getPlainSocketImpl()
- {
- return impl;
- }
+ //public final PlainSocketImpl getPlainSocketImpl()
+ //{
+ // return impl;
+ //}
- final void setChannel (SocketChannelImpl channel)
- {
- this.impl = channel.getPlainSocketImpl();
- this.channel = channel;
- }
+ //final void setChannel (SocketChannelImpl channel)
+ //{
+ // this.impl = channel.getPlainSocketImpl();
+ // this.channel = channel;
+ //}
public final SocketChannel getChannel()
{
return channel;
}
+
+ public boolean isConnected()
+ {
+ return channel.isConnected();
+ }
}
diff --git a/libjava/classpath/gnu/java/nio/NIOSocketImpl.java b/libjava/classpath/gnu/java/nio/NIOSocketImpl.java
new file mode 100644
index 00000000000..4b26561a212
--- /dev/null
+++ b/libjava/classpath/gnu/java/nio/NIOSocketImpl.java
@@ -0,0 +1,110 @@
+/* NIOSocketImpl.java -- subclass of PlainSocketImpl for NIO.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.nio;
+
+import gnu.java.net.PlainSocketImpl;
+
+import java.io.IOException;
+import java.net.InetAddress;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class NIOSocketImpl extends PlainSocketImpl
+{
+
+ private final SocketChannelImpl channel;
+
+ NIOSocketImpl(SocketChannelImpl channel) throws IOException
+ {
+ this.channel = channel;
+ impl.getState().setChannelFD(channel.getVMChannel().getState());
+ }
+
+ /* (non-Javadoc)
+ * @see java.net.SocketImpl#getInetAddress()
+ */
+ //@Override
+ protected InetAddress getInetAddress()
+ {
+ try
+ {
+ return channel.getVMChannel().getPeerAddress().getAddress();
+ }
+ catch (IOException ioe)
+ {
+ return null;
+ }
+ catch (NullPointerException npe)
+ {
+ // Socket is not connected yet.
+ return null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see java.net.SocketImpl#getPort()
+ */
+ //@Override
+ protected int getPort()
+ {
+ try
+ {
+ return channel.getVMChannel().getPeerAddress().getPort();
+ }
+ catch (IOException ioe)
+ {
+ return -1;
+ }
+ catch (NullPointerException npe)
+ {
+ // Socket is not connected yet.
+ return -1;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.java.net.PlainSocketImpl#create(boolean)
+ */
+ //@Override
+ protected synchronized void create(boolean stream)
+ {
+ // Ignored; the socket has already been created.
+ }
+}
diff --git a/libjava/classpath/gnu/java/nio/PipeImpl.java b/libjava/classpath/gnu/java/nio/PipeImpl.java
index cccaa39885f..8a95b9622ae 100644
--- a/libjava/classpath/gnu/java/nio/PipeImpl.java
+++ b/libjava/classpath/gnu/java/nio/PipeImpl.java
@@ -46,22 +46,21 @@ import java.nio.channels.spi.SelectorProvider;
class PipeImpl extends Pipe
{
public static final class SourceChannelImpl extends Pipe.SourceChannel
+ implements VMChannelOwner
{
- private int native_fd;
private VMChannel vmch;
public SourceChannelImpl (SelectorProvider selectorProvider,
- int native_fd)
+ VMChannel channel)
{
super (selectorProvider);
- this.native_fd = native_fd;
- vmch = VMChannel.getVMChannel(this);
+ vmch = channel;
}
protected final void implCloseSelectableChannel()
throws IOException
{
- throw new Error ("Not implemented");
+ vmch.close();
}
protected void implConfigureBlocking (boolean blocking)
@@ -94,30 +93,29 @@ class PipeImpl extends Pipe
return vmch.readScattering(srcs, offset, len);
}
-
- public final int getNativeFD()
+
+ public VMChannel getVMChannel()
{
- return native_fd;
+ return vmch;
}
}
public static final class SinkChannelImpl extends Pipe.SinkChannel
+ implements VMChannelOwner
{
- private int native_fd;
private VMChannel vmch;
public SinkChannelImpl (SelectorProvider selectorProvider,
- int native_fd)
+ VMChannel channel)
{
super (selectorProvider);
- this.native_fd = native_fd;
- vmch = VMChannel.getVMChannel(this);
+ vmch = channel;
}
protected final void implCloseSelectableChannel()
throws IOException
{
- throw new Error ("Not implemented");
+ vmch.close();
}
protected final void implConfigureBlocking (boolean blocking)
@@ -149,10 +147,10 @@ class PipeImpl extends Pipe
return vmch.writeGathering(srcs, offset, len);
}
-
- public final int getNativeFD()
+
+ public VMChannel getVMChannel()
{
- return native_fd;
+ return vmch;
}
}
@@ -163,7 +161,9 @@ class PipeImpl extends Pipe
throws IOException
{
super();
- VMPipe.init (this, provider);
+ VMChannel[] pipe = VMPipe.pipe();
+ sink = new SinkChannelImpl(provider, pipe[0]);
+ source = new SourceChannelImpl(provider, pipe[1]);
}
public Pipe.SinkChannel sink()
diff --git a/libjava/classpath/gnu/java/nio/SelectionKeyImpl.java b/libjava/classpath/gnu/java/nio/SelectionKeyImpl.java
index 8745377c58f..c927f319644 100644
--- a/libjava/classpath/gnu/java/nio/SelectionKeyImpl.java
+++ b/libjava/classpath/gnu/java/nio/SelectionKeyImpl.java
@@ -106,5 +106,6 @@ public abstract class SelectionKeyImpl extends AbstractSelectionKey
return impl;
}
+ /* @deprecated */
public abstract int getNativeFD();
}
diff --git a/libjava/classpath/gnu/java/nio/SelectorImpl.java b/libjava/classpath/gnu/java/nio/SelectorImpl.java
index d0ec4871367..c08478c9968 100644
--- a/libjava/classpath/gnu/java/nio/SelectorImpl.java
+++ b/libjava/classpath/gnu/java/nio/SelectorImpl.java
@@ -54,8 +54,8 @@ import java.util.Set;
public class SelectorImpl extends AbstractSelector
{
- private Set keys;
- private Set selected;
+ private Set<SelectionKey> keys;
+ private Set<SelectionKey> selected;
/**
* A dummy object whose monitor regulates access to both our
@@ -83,8 +83,8 @@ public class SelectorImpl extends AbstractSelector
{
super (provider);
- keys = new HashSet ();
- selected = new HashSet ();
+ keys = new HashSet<SelectionKey> ();
+ selected = new HashSet<SelectionKey> ();
}
protected void finalize() throws Throwable
@@ -110,7 +110,7 @@ public class SelectorImpl extends AbstractSelector
}
}
- public final Set keys()
+ public final Set<SelectionKey> keys()
{
if (!isOpen())
throw new ClosedSelectorException();
@@ -136,7 +136,7 @@ public class SelectorImpl extends AbstractSelector
{
int[] result;
int counter = 0;
- Iterator it = keys.iterator ();
+ Iterator<SelectionKey> it = keys.iterator ();
// Count the number of file descriptors needed
while (it.hasNext ())
@@ -253,7 +253,7 @@ public class SelectorImpl extends AbstractSelector
selectThread = null;
}
- Iterator it = keys.iterator ();
+ Iterator<SelectionKey> it = keys.iterator ();
while (it.hasNext ())
{
@@ -317,7 +317,7 @@ public class SelectorImpl extends AbstractSelector
}
}
- public final Set selectedKeys()
+ public final Set<SelectionKey> selectedKeys()
{
if (!isOpen())
throw new ClosedSelectorException();
@@ -350,10 +350,10 @@ public class SelectorImpl extends AbstractSelector
private final void deregisterCancelledKeys()
{
- Set ckeys = cancelledKeys ();
+ Set<SelectionKey> ckeys = cancelledKeys ();
synchronized (ckeys)
{
- Iterator it = ckeys.iterator();
+ Iterator<SelectionKey> it = ckeys.iterator();
while (it.hasNext ())
{
diff --git a/libjava/classpath/gnu/java/nio/SelectorProviderImpl.java b/libjava/classpath/gnu/java/nio/SelectorProviderImpl.java
index 47521107e90..56167b69ea8 100644
--- a/libjava/classpath/gnu/java/nio/SelectorProviderImpl.java
+++ b/libjava/classpath/gnu/java/nio/SelectorProviderImpl.java
@@ -37,6 +37,9 @@ exception statement from your version. */
package gnu.java.nio;
+
+import gnu.classpath.SystemProperties;
+
import java.io.IOException;
import java.nio.channels.DatagramChannel;
import java.nio.channels.Pipe;
@@ -47,6 +50,11 @@ import java.nio.channels.spi.SelectorProvider;
public class SelectorProviderImpl extends SelectorProvider
{
+ private static final String SELECTOR_IMPL_KQUEUE = "kqueue";
+ private static final String SELECTOR_IMPL_EPOLL = "epoll";
+ private static final String SELECTOR_IMPL = "gnu.java.nio.selectorImpl";
+ private static boolean epoll_failed = false;
+
public SelectorProviderImpl ()
{
}
@@ -66,6 +74,35 @@ public class SelectorProviderImpl extends SelectorProvider
public AbstractSelector openSelector ()
throws IOException
{
+ String selectorImpl = "default";
+ if (KqueueSelectorImpl.kqueue_supported())
+ selectorImpl = SELECTOR_IMPL_KQUEUE;
+ if (EpollSelectorImpl.epoll_supported() && !epoll_failed)
+ selectorImpl = SELECTOR_IMPL_EPOLL;
+ selectorImpl = SystemProperties.getProperty(SELECTOR_IMPL, selectorImpl);
+
+ if (selectorImpl.equals(SELECTOR_IMPL_KQUEUE))
+ return new KqueueSelectorImpl(this);
+
+ if (selectorImpl.equals(SELECTOR_IMPL_EPOLL))
+ {
+ // We jump through these hoops because even though epoll may look
+ // like it's available (sys/epoll.h exists, and you can link against
+ // all the epoll functions) it may not be available in the kernel
+ // (especially 2.4 kernels), meaning you will get ENOSYS at run time.
+ //
+ // Madness!
+ try
+ {
+ return new EpollSelectorImpl(this);
+ }
+ catch (InternalError e)
+ {
+ // epoll_create throws this on ENOSYS.
+ epoll_failed = true;
+ }
+ }
+
return new SelectorImpl (this);
}
diff --git a/libjava/classpath/gnu/java/nio/ServerSocketChannelImpl.java b/libjava/classpath/gnu/java/nio/ServerSocketChannelImpl.java
index c538ea802e1..1e8e0901d7c 100644
--- a/libjava/classpath/gnu/java/nio/ServerSocketChannelImpl.java
+++ b/libjava/classpath/gnu/java/nio/ServerSocketChannelImpl.java
@@ -48,7 +48,9 @@ import java.nio.channels.SocketChannel;
import java.nio.channels.spi.SelectorProvider;
public final class ServerSocketChannelImpl extends ServerSocketChannel
+ implements VMChannelOwner
{
+ private VMChannel channel;
private NIOServerSocket serverSocket;
private boolean connected;
@@ -56,13 +58,15 @@ public final class ServerSocketChannelImpl extends ServerSocketChannel
throws IOException
{
super (provider);
- serverSocket = new NIOServerSocket (this);
+ serverSocket = new NIOServerSocket(this);
+ channel = serverSocket.getPlainSocketImpl().getVMChannel();
configureBlocking(true);
}
+ // XXX do we need this?
public void finalizer()
{
- if (connected)
+ if (channel.getState().isValid())
{
try
{
@@ -77,12 +81,12 @@ public final class ServerSocketChannelImpl extends ServerSocketChannel
protected void implCloseSelectableChannel () throws IOException
{
connected = false;
- serverSocket.close();
+ channel.close();
}
protected void implConfigureBlocking (boolean blocking) throws IOException
{
- serverSocket.setSoTimeout (blocking ? 0 : NIOConstants.DEFAULT_TIMEOUT);
+ channel.setBlocking(blocking);
}
public SocketChannel accept () throws IOException
@@ -98,27 +102,28 @@ public final class ServerSocketChannelImpl extends ServerSocketChannel
try
{
begin();
- serverSocket.getPlainSocketImpl().setInChannelOperation(true);
- // indicate that a channel is initiating the accept operation
- // so that the socket ignores the fact that we might be in
- // non-blocking mode.
- NIOSocket socket = (NIOSocket) serverSocket.accept();
- completed = true;
- return socket.getChannel();
- }
- catch (SocketTimeoutException e)
- {
- return null;
+ VMChannel client = channel.accept();
+ if (client == null)
+ return null;
+ else
+ {
+ completed = true;
+ return new SocketChannelImpl(provider(), client, false);
+ }
}
finally
{
- serverSocket.getPlainSocketImpl().setInChannelOperation(false);
end (completed);
}
}
- public ServerSocket socket ()
+ public ServerSocket socket()
{
return serverSocket;
}
+
+ public VMChannel getVMChannel()
+ {
+ return channel;
+ }
}
diff --git a/libjava/classpath/gnu/java/nio/ServerSocketChannelSelectionKey.java b/libjava/classpath/gnu/java/nio/ServerSocketChannelSelectionKey.java
index d00c2b7482a..5b510cb6f4d 100644
--- a/libjava/classpath/gnu/java/nio/ServerSocketChannelSelectionKey.java
+++ b/libjava/classpath/gnu/java/nio/ServerSocketChannelSelectionKey.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package gnu.java.nio;
+import java.io.IOException;
import java.nio.channels.spi.AbstractSelectableChannel;
public final class ServerSocketChannelSelectionKey
@@ -49,10 +50,16 @@ public final class ServerSocketChannelSelectionKey
super (channel, selector);
}
+ // FIXME don't use file descriptor integers
public int getNativeFD()
{
- NIOServerSocket socket =
- (NIOServerSocket) ((ServerSocketChannelImpl) ch).socket();
- return socket.getPlainSocketImpl().getNativeFD();
+ try
+ {
+ return ((ServerSocketChannelImpl) ch).getVMChannel().getState().getNativeFD();
+ }
+ catch (IOException ioe)
+ {
+ throw new IllegalStateException(ioe);
+ }
}
}
diff --git a/libjava/classpath/gnu/java/nio/SocketChannelImpl.java b/libjava/classpath/gnu/java/nio/SocketChannelImpl.java
index 680eba2f92b..1c563ac097c 100644
--- a/libjava/classpath/gnu/java/nio/SocketChannelImpl.java
+++ b/libjava/classpath/gnu/java/nio/SocketChannelImpl.java
@@ -39,15 +39,20 @@ exception statement from your version. */
package gnu.java.nio;
import gnu.java.net.PlainSocketImpl;
+import gnu.java.net.VMPlainSocketImpl;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketAddress;
+import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.nio.ByteBuffer;
+import java.nio.ReadOnlyBufferException;
import java.nio.channels.AlreadyConnectedException;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.ConnectionPendingException;
@@ -61,28 +66,57 @@ import java.nio.channels.UnsupportedAddressTypeException;
import java.nio.channels.spi.SelectorProvider;
public final class SocketChannelImpl extends SocketChannel
+ implements VMChannelOwner
{
- private PlainSocketImpl impl;
+ private VMChannel channel;
+ //private PlainSocketImpl impl;
private NIOSocket socket;
private boolean connectionPending;
+ private boolean connected;
+ private InetSocketAddress connectAddress;
+
+ public SocketChannelImpl(boolean create) throws IOException
+ {
+ // XXX consider adding security check; this is used by
+ // PlainSocketImpl.
+ this(new SelectorProviderImpl(), create);
+ }
+
+ public SocketChannelImpl(VMChannel channel) throws IOException
+ {
+ this(new SelectorProviderImpl(), channel, false);
+ }
+
+ SocketChannelImpl(SelectorProvider provider) throws IOException
+ {
+ this(provider, true);
+ }
- SocketChannelImpl (SelectorProvider provider)
+ SocketChannelImpl(SelectorProvider provider, boolean create)
+ throws IOException
+ {
+ this(provider, new VMChannel(), create);
+ }
+
+ SocketChannelImpl(SelectorProvider provider, VMChannel channel, boolean create)
throws IOException
{
super (provider);
- impl = new PlainSocketImpl();
- socket = new NIOSocket (impl, this);
+ this.channel = channel;
+ if (create)
+ channel.initSocket(true);
+ socket = new NIOSocket(this);
configureBlocking(true);
}
- SocketChannelImpl (SelectorProvider provider,
+ /*SocketChannelImpl (SelectorProvider provider,
NIOSocket socket)
throws IOException
{
super (provider);
this.impl = socket.getPlainSocketImpl();
this.socket = socket;
- }
+ }*/
public void finalizer()
{
@@ -98,23 +132,28 @@ public final class SocketChannelImpl extends SocketChannel
}
}
- PlainSocketImpl getPlainSocketImpl()
- {
- return impl;
- }
+ //PlainSocketImpl getPlainSocketImpl()
+ //{
+ // return null; // XXX
+ //}
- protected void implCloseSelectableChannel () throws IOException
+ protected void implCloseSelectableChannel() throws IOException
{
- socket.close();
+ channel.close();
}
protected void implConfigureBlocking (boolean blocking) throws IOException
{
- socket.setSoTimeout (blocking ? 0 : NIOConstants.DEFAULT_TIMEOUT);
+ channel.setBlocking(blocking);
}
public boolean connect (SocketAddress remote) throws IOException
{
+ return connect(remote, 0);
+ }
+
+ public boolean connect (SocketAddress remote, int timeout) throws IOException
+ {
if (!isOpen())
throw new ClosedChannelException();
@@ -126,79 +165,52 @@ public final class SocketChannelImpl extends SocketChannel
if (!(remote instanceof InetSocketAddress))
throw new UnsupportedAddressTypeException();
+
+ connectAddress = (InetSocketAddress) remote;
- if (((InetSocketAddress) remote).isUnresolved())
+ if (connectAddress.isUnresolved())
throw new UnresolvedAddressException();
- try
- {
- socket.getPlainSocketImpl().setInChannelOperation(true);
- // indicate that a channel is initiating the accept operation
- // so that the socket ignores the fact that we might be in
- // non-blocking mode.
-
- if (isBlocking())
- {
- // Do blocking connect.
- socket.connect (remote);
- return true;
- }
-
- // Do non-blocking connect.
- try
- {
- socket.connect (remote, NIOConstants.DEFAULT_TIMEOUT);
- return true;
- }
- catch (SocketTimeoutException e)
- {
- connectionPending = true;
- return false;
- }
- }
- finally
- {
- socket.getPlainSocketImpl().setInChannelOperation(false);
- }
+ connected = channel.connect(connectAddress, timeout);
+ connectionPending = !connected;
+ return connected;
}
-
- public boolean finishConnect ()
+
+ public boolean finishConnect()
throws IOException
{
if (!isOpen())
throw new ClosedChannelException();
-
- if (!isConnected() && !connectionPending)
- throw new NoConnectionPendingException();
-
- if (isConnected())
- return true;
- // FIXME: Handle blocking/non-blocking mode.
-
- Selector selector = provider().openSelector();
- register(selector, SelectionKey.OP_CONNECT);
-
- if (isBlocking())
+ InetSocketAddress remote = channel.getPeerAddress();
+ if (remote != null)
{
- selector.select(); // blocking until channel is connected.
connectionPending = false;
return true;
}
-
- int ready = selector.selectNow(); // non-blocking
- if (ready == 1)
- {
- connectionPending = false;
- return true;
- }
-
+
+ if (!connectionPending)
+ throw new NoConnectionPendingException();
+
return false;
}
- public boolean isConnected ()
+ public boolean isConnected()
{
- return socket.isConnected();
+ // Wait until finishConnect is called before transitioning to
+ // connected.
+ if (connectionPending)
+ return false;
+ try
+ {
+ InetSocketAddress remote = channel.getPeerAddress();
+ return remote != null;
+ }
+ catch (IOException ioe)
+ {
+ ioe.printStackTrace(System.out);
+ return false;
+ }
}
public boolean isConnectionPending ()
@@ -216,52 +228,7 @@ public final class SocketChannelImpl extends SocketChannel
if (!isConnected())
throw new NotYetConnectedException();
- byte[] data;
- int offset = 0;
- InputStream input = socket.getInputStream();
- int available = input.available();
- int len = dst.remaining();
-
- if ((! isBlocking()) && available == 0)
- return 0;
-
- if (dst.hasArray())
- {
- offset = dst.arrayOffset() + dst.position();
- data = dst.array();
- }
- else
- {
- data = new byte [len];
- }
-
- int readBytes = 0;
- boolean completed = false;
-
- try
- {
- begin();
- socket.getPlainSocketImpl().setInChannelOperation(true);
- readBytes = input.read (data, offset, len);
- completed = true;
- }
- finally
- {
- end (completed);
- socket.getPlainSocketImpl().setInChannelOperation(false);
- }
-
- if (readBytes > 0)
- if (dst.hasArray())
- {
- dst.position (dst.position() + readBytes);
- }
- else
- {
- dst.put (data, offset, readBytes);
- }
-
- return readBytes;
+ return channel.read(dst);
}
public long read (ByteBuffer[] dsts, int offset, int length)
@@ -275,61 +242,19 @@ public final class SocketChannelImpl extends SocketChannel
|| (length < 0)
|| (length > (dsts.length - offset)))
throw new IndexOutOfBoundsException();
-
- long readBytes = 0;
-
- for (int index = offset; index < length; index++)
- readBytes += read (dsts [index]);
-
- return readBytes;
+
+ return channel.readScattering(dsts, offset, length);
}
- public int write (ByteBuffer src)
- throws IOException
+ public int write(ByteBuffer src) throws IOException
{
if (!isConnected())
throw new NotYetConnectedException();
-
- byte[] data;
- int offset = 0;
- int len = src.remaining();
-
- if (!src.hasArray())
- {
- data = new byte [len];
- src.get (data, 0, len);
- }
- else
- {
- offset = src.arrayOffset() + src.position();
- data = src.array();
- }
- OutputStream output = socket.getOutputStream();
- boolean completed = false;
-
- try
- {
- begin();
- socket.getPlainSocketImpl().setInChannelOperation(true);
- output.write (data, offset, len);
- completed = true;
- }
- finally
- {
- end (completed);
- socket.getPlainSocketImpl().setInChannelOperation(false);
- }
-
- if (src.hasArray())
- {
- src.position (src.position() + len);
- }
-
- return len;
+ return channel.write(src);
}
- public long write (ByteBuffer[] srcs, int offset, int length)
+ public long write(ByteBuffer[] srcs, int offset, int length)
throws IOException
{
if (!isConnected())
@@ -340,12 +265,13 @@ public final class SocketChannelImpl extends SocketChannel
|| (length < 0)
|| (length > (srcs.length - offset)))
throw new IndexOutOfBoundsException();
-
- long writtenBytes = 0;
-
- for (int index = offset; index < length; index++)
- writtenBytes += write (srcs [index]);
- return writtenBytes;
+ return channel.writeGathering(srcs, offset, length);
+ }
+
+ public VMChannel getVMChannel()
+ {
+ // XXX security check?
+ return channel;
}
}
diff --git a/libjava/classpath/gnu/java/nio/SocketChannelSelectionKey.java b/libjava/classpath/gnu/java/nio/SocketChannelSelectionKey.java
index 75b4dfd87e5..9ceebdec90f 100644
--- a/libjava/classpath/gnu/java/nio/SocketChannelSelectionKey.java
+++ b/libjava/classpath/gnu/java/nio/SocketChannelSelectionKey.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package gnu.java.nio;
+import java.io.IOException;
import java.nio.channels.spi.AbstractSelectableChannel;
public final class SocketChannelSelectionKey
@@ -49,10 +50,16 @@ public final class SocketChannelSelectionKey
super (channel, selector);
}
+ // FIXME don't use file descriptor integers
public int getNativeFD()
{
- NIOSocket socket =
- (NIOSocket) ((SocketChannelImpl) ch).socket();
- return socket.getPlainSocketImpl().getNativeFD();
+ try
+ {
+ return ((SocketChannelImpl) ch).getVMChannel().getState().getNativeFD();
+ }
+ catch (IOException ioe)
+ {
+ throw new IllegalStateException(ioe);
+ }
}
}
diff --git a/libjava/classpath/gnu/java/nio/SocketChannelSelectionKeyImpl.java b/libjava/classpath/gnu/java/nio/SocketChannelSelectionKeyImpl.java
index 30fb2dfba44..31a96ed7d88 100644
--- a/libjava/classpath/gnu/java/nio/SocketChannelSelectionKeyImpl.java
+++ b/libjava/classpath/gnu/java/nio/SocketChannelSelectionKeyImpl.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.java.nio;
+import java.io.IOException;
+
/**
* @author Michael Barker <mike@middlesoft.co.uk>
@@ -63,7 +65,14 @@ public class SocketChannelSelectionKeyImpl extends SelectionKeyImpl
*/
public int getNativeFD()
{
- return ch.getPlainSocketImpl().getNativeFD();
+ try
+ {
+ return ch.getVMChannel().getState().getNativeFD();
+ }
+ catch (IOException ioe)
+ {
+ return 0; // FIXME
+ }
}
}
diff --git a/libjava/classpath/gnu/java/nio/VMChannelOwner.java b/libjava/classpath/gnu/java/nio/VMChannelOwner.java
new file mode 100644
index 00000000000..363dea2b214
--- /dev/null
+++ b/libjava/classpath/gnu/java/nio/VMChannelOwner.java
@@ -0,0 +1,57 @@
+/* NativeFD.java -- interface for Channels that have an underlying file descriptor.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.nio;
+
+/**
+ * This interface is meant to be implemented by any {@link Channel}
+ * implementation we support that uses a platform-specific {@link VMChannel}
+ * at their core. This is primarily used by {@link Selector} implementations,
+ * for easier access to the native state.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+interface VMChannelOwner
+{
+ /**
+ * Return the underlying platform-specific Channel instance.
+ *
+ * @return The platform channel object.
+ */
+ VMChannel getVMChannel();
+}
diff --git a/libjava/classpath/gnu/java/nio/channels/FileChannelImpl.java b/libjava/classpath/gnu/java/nio/channels/FileChannelImpl.java
deleted file mode 100644
index ed439e141ef..00000000000
--- a/libjava/classpath/gnu/java/nio/channels/FileChannelImpl.java
+++ /dev/null
@@ -1,553 +0,0 @@
-/* FileChannelImpl.java --
- Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.java.nio.channels;
-
-import gnu.classpath.Configuration;
-import gnu.java.nio.FileLockImpl;
-import gnu.java.nio.VMChannel;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.MappedByteBuffer;
-import java.nio.channels.ClosedChannelException;
-import java.nio.channels.FileChannel;
-import java.nio.channels.FileLock;
-import java.nio.channels.NonReadableChannelException;
-import java.nio.channels.NonWritableChannelException;
-import java.nio.channels.ReadableByteChannel;
-import java.nio.channels.WritableByteChannel;
-
-/**
- * This file is not user visible !
- * But alas, Java does not have a concept of friendly packages
- * so this class is public.
- * Instances of this class are created by invoking getChannel
- * Upon a Input/Output/RandomAccessFile object.
- */
-public final class FileChannelImpl extends FileChannel
-{
- // These are mode values for open().
- public static final int READ = 1;
- public static final int WRITE = 2;
- public static final int APPEND = 4;
-
- // EXCL is used only when making a temp file.
- public static final int EXCL = 8;
- public static final int SYNC = 16;
- public static final int DSYNC = 32;
-
- public static FileChannelImpl in;
- public static FileChannelImpl out;
- public static FileChannelImpl err;
-
- private static native void init();
-
- static
- {
- if (Configuration.INIT_LOAD_LIBRARY)
- {
- System.loadLibrary("javanio");
- }
-
- init();
-
- in = new FileChannelImpl(0, READ);
- out = new FileChannelImpl(1, WRITE);
- err = new FileChannelImpl(2, WRITE);
- }
-
- /**
- * This is the actual native file descriptor value
- */
- // System's notion of file descriptor. It might seem redundant to
- // initialize this given that it is reassigned in the constructors.
- // However, this is necessary because if open() throws an exception
- // we want to make sure this has the value -1. This is the most
- // efficient way to accomplish that.
- private int fd = -1;
- private VMChannel ch;
-
- private int mode;
-
- final String description;
-
- /* Open a file. MODE is a combination of the above mode flags. */
- /* This is a static factory method, so that VM implementors can decide
- * substitute subclasses of FileChannelImpl. */
- public static FileChannelImpl create(File file, int mode)
- throws FileNotFoundException
- {
- return new FileChannelImpl(file, mode);
- }
-
- private FileChannelImpl(File file, int mode)
- throws FileNotFoundException
- {
- String path = file.getPath();
- description = path;
- fd = open (path, mode);
- this.mode = mode;
- this.ch = VMChannel.getVMChannel(this);
-
- // First open the file and then check if it is a a directory
- // to avoid race condition.
- if (file.isDirectory())
- {
- try
- {
- close();
- }
- catch (IOException e)
- {
- /* ignore it */
- }
-
- throw new FileNotFoundException(description + " is a directory");
- }
- }
-
- /**
- * Constructor for default channels in, out and err.
- *
- * Used by init() (native code).
- *
- * @param fd the file descriptor (0, 1, 2 for stdin, stdout, stderr).
- *
- * @param mode READ or WRITE
- */
- FileChannelImpl (int fd, int mode)
- {
- this.fd = fd;
- this.mode = mode;
- this.description = "descriptor(" + fd + ")";
- this.ch = VMChannel.getVMChannel(this);
- }
-
- private native int open (String path, int mode) throws FileNotFoundException;
-
- public native int available () throws IOException;
- private native long implPosition () throws IOException;
- private native void seek (long newPosition) throws IOException;
- private native void implTruncate (long size) throws IOException;
-
- public native void unlock (long pos, long len) throws IOException;
-
- public native long size () throws IOException;
-
- protected native void implCloseChannel() throws IOException;
-
- /**
- * Makes sure the Channel is properly closed.
- */
- protected void finalize() throws IOException
- {
- if (fd != -1)
- close();
- }
-
- public int read (ByteBuffer dst) throws IOException
- {
- /*
- int result;
- byte[] buffer = new byte [dst.remaining ()];
-
- result = read (buffer, 0, buffer.length);
-
- if (result > 0)
- dst.put (buffer, 0, result);
-
- return result;
- */
- return ch.read(dst);
- }
-
- public int read (ByteBuffer dst, long position)
- throws IOException
- {
- if (position < 0)
- throw new IllegalArgumentException ("position: " + position);
- long oldPosition = implPosition ();
- position (position);
- int result = read(dst);
- position (oldPosition);
-
- return result;
- }
-
- public native int read ()
- throws IOException;
-
- public native int read (byte[] buffer, int offset, int length)
- throws IOException;
-
- public long read (ByteBuffer[] dsts, int offset, int length)
- throws IOException
- {
- return ch.readScattering(dsts, offset, length);
- }
-
- public int write (ByteBuffer src) throws IOException
- {
- return ch.write(src);
- }
-
- public int write (ByteBuffer src, long position)
- throws IOException
- {
- if (position < 0)
- throw new IllegalArgumentException ("position: " + position);
-
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- if ((mode & WRITE) == 0)
- throw new NonWritableChannelException ();
-
- int result;
- long oldPosition;
-
- oldPosition = implPosition ();
- seek (position);
- result = write(src);
- seek (oldPosition);
-
- return result;
- }
-
- public native void write (byte[] buffer, int offset, int length)
- throws IOException;
-
- public native void write (int b) throws IOException;
-
- public long write(ByteBuffer[] srcs, int offset, int length)
- throws IOException
- {
- return ch.writeGathering(srcs, offset, length);
- }
-
- public native MappedByteBuffer mapImpl (char mode, long position, int size)
- throws IOException;
-
- public MappedByteBuffer map (FileChannel.MapMode mode,
- long position, long size)
- throws IOException
- {
- char nmode = 0;
- if (mode == MapMode.READ_ONLY)
- {
- nmode = 'r';
- if ((this.mode & READ) == 0)
- throw new NonReadableChannelException();
- }
- else if (mode == MapMode.READ_WRITE || mode == MapMode.PRIVATE)
- {
- nmode = mode == MapMode.READ_WRITE ? '+' : 'c';
- if ((this.mode & WRITE) != WRITE)
- throw new NonWritableChannelException();
- if ((this.mode & READ) != READ)
- throw new NonReadableChannelException();
- }
- else
- throw new IllegalArgumentException ("mode: " + mode);
-
- if (position < 0 || size < 0 || size > Integer.MAX_VALUE)
- throw new IllegalArgumentException ("position: " + position
- + ", size: " + size);
- return mapImpl(nmode, position, (int) size);
- }
-
- /**
- * msync with the disk
- */
- public void force (boolean metaData) throws IOException
- {
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- force ();
- }
-
- private native void force ();
-
- // like transferTo, but with a count of less than 2Gbytes
- private int smallTransferTo (long position, int count,
- WritableByteChannel target)
- throws IOException
- {
- ByteBuffer buffer;
- try
- {
- // Try to use a mapped buffer if we can. If this fails for
- // any reason we'll fall back to using a ByteBuffer.
- buffer = map (MapMode.READ_ONLY, position, count);
- }
- catch (IOException e)
- {
- buffer = ByteBuffer.allocate (count);
- read (buffer, position);
- buffer.flip();
- }
-
- return target.write (buffer);
- }
-
- public long transferTo (long position, long count,
- WritableByteChannel target)
- throws IOException
- {
- if (position < 0
- || count < 0)
- throw new IllegalArgumentException ("position: " + position
- + ", count: " + count);
-
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- if ((mode & READ) == 0)
- throw new NonReadableChannelException ();
-
- final int pageSize = 65536;
- long total = 0;
-
- while (count > 0)
- {
- int transferred
- = smallTransferTo (position, (int)Math.min (count, pageSize),
- target);
- if (transferred < 0)
- break;
- total += transferred;
- position += transferred;
- count -= transferred;
- }
-
- return total;
- }
-
- // like transferFrom, but with a count of less than 2Gbytes
- private int smallTransferFrom (ReadableByteChannel src, long position,
- int count)
- throws IOException
- {
- ByteBuffer buffer = null;
-
- if (src instanceof FileChannel)
- {
- try
- {
- // Try to use a mapped buffer if we can. If this fails
- // for any reason we'll fall back to using a ByteBuffer.
- buffer = ((FileChannel)src).map (MapMode.READ_ONLY, position,
- count);
- }
- catch (IOException e)
- {
- }
- }
-
- if (buffer == null)
- {
- buffer = ByteBuffer.allocate ((int) count);
- src.read (buffer);
- buffer.flip();
- }
-
- return write (buffer, position);
- }
-
- public long transferFrom (ReadableByteChannel src, long position,
- long count)
- throws IOException
- {
- if (position < 0
- || count < 0)
- throw new IllegalArgumentException ("position: " + position
- + ", count: " + count);
-
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- if ((mode & WRITE) == 0)
- throw new NonWritableChannelException ();
-
- final int pageSize = 65536;
- long total = 0;
-
- while (count > 0)
- {
- int transferred = smallTransferFrom (src, position,
- (int)Math.min (count, pageSize));
- if (transferred < 0)
- break;
- total += transferred;
- position += transferred;
- count -= transferred;
- }
-
- return total;
- }
-
- // Shared sanity checks between lock and tryLock methods.
- private void lockCheck(long position, long size, boolean shared)
- throws IOException
- {
- if (position < 0
- || size < 0)
- throw new IllegalArgumentException ("position: " + position
- + ", size: " + size);
-
- if (!isOpen ())
- throw new ClosedChannelException();
-
- if (shared && ((mode & READ) == 0))
- throw new NonReadableChannelException();
-
- if (!shared && ((mode & WRITE) == 0))
- throw new NonWritableChannelException();
- }
-
- public FileLock tryLock (long position, long size, boolean shared)
- throws IOException
- {
- lockCheck(position, size, shared);
-
- boolean completed = false;
- try
- {
- begin();
- boolean lockable = lock(position, size, shared, false);
- completed = true;
- return (lockable
- ? new FileLockImpl(this, position, size, shared)
- : null);
- }
- finally
- {
- end(completed);
- }
- }
-
- /** Try to acquire a lock at the given position and size.
- * On success return true.
- * If wait as specified, block until we can get it.
- * Otherwise return false.
- */
- private native boolean lock(long position, long size,
- boolean shared, boolean wait) throws IOException;
-
- public FileLock lock (long position, long size, boolean shared)
- throws IOException
- {
- lockCheck(position, size, shared);
-
- boolean completed = false;
- try
- {
- boolean lockable = lock(position, size, shared, true);
- completed = true;
- return (lockable
- ? new FileLockImpl(this, position, size, shared)
- : null);
- }
- finally
- {
- end(completed);
- }
- }
-
- public long position ()
- throws IOException
- {
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- return implPosition ();
- }
-
- public FileChannel position (long newPosition)
- throws IOException
- {
- if (newPosition < 0)
- throw new IllegalArgumentException ("newPosition: " + newPosition);
-
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- // FIXME note semantics if seeking beyond eof.
- // We should seek lazily - only on a write.
- seek (newPosition);
- return this;
- }
-
- public FileChannel truncate (long size)
- throws IOException
- {
- if (size < 0)
- throw new IllegalArgumentException ("size: " + size);
-
- if (!isOpen ())
- throw new ClosedChannelException ();
-
- if ((mode & WRITE) == 0)
- throw new NonWritableChannelException ();
-
- if (size < size ())
- implTruncate (size);
-
- return this;
- }
-
- public String toString()
- {
- return (this.getClass()
- + "[fd=" + fd
- + ",mode=" + mode + ","
- + description + "]");
- }
-
- /**
- * @return The native file descriptor.
- */
- public int getNativeFD()
- {
- return fd;
- }
-}
diff --git a/libjava/classpath/gnu/java/rmi/server/ActivatableRef.java b/libjava/classpath/gnu/java/rmi/server/ActivatableRef.java
index d191c0c1717..e7580bcd79d 100644
--- a/libjava/classpath/gnu/java/rmi/server/ActivatableRef.java
+++ b/libjava/classpath/gnu/java/rmi/server/ActivatableRef.java
@@ -112,8 +112,10 @@ public class ActivatableRef extends UnicastRef
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException
{
- super.readExternal(in);
actId = (ActivationID) in.readObject();
+ String type = in.readUTF();
+ // XXX handle type.equals("") (null reference)
+ super.readExternal(in);
}
/**
@@ -121,8 +123,10 @@ public class ActivatableRef extends UnicastRef
*/
public void writeExternal(ObjectOutput out) throws IOException
{
- super.writeExternal(out);
out.writeObject(actId);
+ // XXX write a "" if the "nested" reference is a null reference
+ out.writeUTF("UnicastRef2");
+ super.writeExternal(out);
}
/**
diff --git a/libjava/classpath/gnu/java/rmi/server/RMIClassLoaderImpl.java b/libjava/classpath/gnu/java/rmi/server/RMIClassLoaderImpl.java
index 2e1e7805531..82f0ff69e4e 100644
--- a/libjava/classpath/gnu/java/rmi/server/RMIClassLoaderImpl.java
+++ b/libjava/classpath/gnu/java/rmi/server/RMIClassLoaderImpl.java
@@ -1,5 +1,5 @@
/* RMIClassLoaderImpl.java -- FIXME: briefly describe file purpose
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,7 @@ exception statement from your version. */
package gnu.java.rmi.server;
+import java.lang.reflect.Proxy;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
@@ -186,6 +187,7 @@ public class RMIClassLoaderImpl extends RMIClassLoaderSpi
{
defaultClassLoader = new MyClassLoader (new URL[] { defaultCodebase }, null,
defaultAnnotation);
+ // XXX using getContextClassLoader here *cannot* be right
cacheLoaders.put (new CacheKey (defaultAnnotation,
Thread.currentThread().getContextClassLoader()),
defaultClassLoader);
@@ -216,47 +218,53 @@ public class RMIClassLoaderImpl extends RMIClassLoaderSpi
ClassLoader defaultLoader)
throws MalformedURLException, ClassNotFoundException
{
- ClassLoader loader;
- if (defaultLoader == null)
- loader = Thread.currentThread().getContextClassLoader();
- else
- loader = defaultLoader;
-
- //try context class loader first
try
{
- return Class.forName(name, false, loader);
+ if (defaultLoader != null)
+ return Class.forName(name, false, defaultLoader);
}
catch (ClassNotFoundException e)
{
- // class not found in the local classpath
+ }
+
+ return Class.forName(name, false, getClassLoader(codeBase));
+ }
+
+ public Class loadProxyClass(String codeBase, String[] interfaces,
+ ClassLoader defaultLoader)
+ throws MalformedURLException, ClassNotFoundException
+ {
+ Class clss[] = new Class[interfaces.length];
+
+ for (int i = 0; i < interfaces.length; i++)
+ {
+ clss[i] = loadClass(codeBase, interfaces[i], defaultLoader);
}
- if (codeBase.length() == 0) //==""
+ // Chain all class loaders (they may differ).
+ ArrayList loaders = new ArrayList(clss.length);
+ ClassLoader loader = null;
+ for (int i = 0; i < clss.length; i++)
{
- loader = defaultClassLoader;
+ loader = clss[i].getClassLoader();
+ if (! loaders.contains(loader))
+ {
+ loaders.add(0, loader);
+ }
}
- else
+ if (loaders.size() > 1)
{
- loader = getClassLoader(codeBase);
+ loader = new CombinedClassLoader(loaders);
}
- if (loader == null)
+ try
{
- //do not throw NullPointerException
- throw new ClassNotFoundException ("Could not find class (" + name +
- ") at codebase (" + codeBase + ")");
+ return Proxy.getProxyClass(loader, clss);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new ClassNotFoundException(null, e);
}
-
- return Class.forName(name, false, loader);
- }
-
- public Class loadProxyClass(String codeBase, String[] interfaces,
- ClassLoader defaultLoader)
- throws MalformedURLException, ClassNotFoundException
- {
- // FIXME: Implement this.
- return null;
}
/**
@@ -272,6 +280,9 @@ public class RMIClassLoaderImpl extends RMIClassLoaderSpi
public ClassLoader getClassLoader(String codebase)
throws MalformedURLException
{
+ if (codebase == null || codebase.length() == 0)
+ return Thread.currentThread().getContextClassLoader();
+
ClassLoader loader;
CacheKey loaderKey = new CacheKey
(codebase, Thread.currentThread().getContextClassLoader());
diff --git a/libjava/classpath/gnu/java/rmi/server/RMIObjectInputStream.java b/libjava/classpath/gnu/java/rmi/server/RMIObjectInputStream.java
index e76535447be..75f4f120236 100644
--- a/libjava/classpath/gnu/java/rmi/server/RMIObjectInputStream.java
+++ b/libjava/classpath/gnu/java/rmi/server/RMIObjectInputStream.java
@@ -1,5 +1,5 @@
/* RMIObjectInputStream.java --
- Copyright (c) 1996, 1997, 1998, 1999, 2002, 2004
+ Copyright (c) 1996, 1997, 1998, 1999, 2002, 2004, 2006
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,11 +39,11 @@ exception statement from your version. */
package gnu.java.rmi.server;
+import gnu.classpath.VMStackWalker;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectStreamClass;
-import java.lang.reflect.Proxy;
import java.net.MalformedURLException;
import java.rmi.server.RMIClassLoader;
import java.util.ArrayList;
@@ -57,16 +57,14 @@ public RMIObjectInputStream(InputStream strm) throws IOException {
}
protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
- String annotation = (String)getAnnotation();
-
try {
- if(annotation == null)
- return (RMIClassLoader.loadClass(desc.getName()));
- else
- return (RMIClassLoader.loadClass(annotation, desc.getName()));
+ return RMIClassLoader.loadClass(
+ (String)getAnnotation(),
+ desc.getName(),
+ VMStackWalker.firstNonNullClassLoader());
}
- catch (MalformedURLException _) {
- throw new ClassNotFoundException(desc.getName());
+ catch (MalformedURLException x) {
+ throw new ClassNotFoundException(desc.getName(), x);
}
}
@@ -81,45 +79,16 @@ protected Object getAnnotation()
protected Class resolveProxyClass(String intfs[]) throws IOException,
ClassNotFoundException
{
- String annotation = (String) getAnnotation();
-
- Class clss[] = new Class[intfs.length];
-
- for (int i = 0; i < intfs.length; i++)
- {
- if (annotation == null)
- clss[i] = RMIClassLoader.loadClass(intfs[i]);
- else
- clss[i] = RMIClassLoader.loadClass(annotation, intfs[i]);
- }
-
- ClassLoader loader;
-
- if (clss.length > 0)
- {
- // Chain all class loaders (they may differ).
- ArrayList loaders = new ArrayList(intfs.length);
- ClassLoader cx;
- for (int i = 0; i < clss.length; i++)
- {
- cx = clss[i].getClassLoader();
- if (!loaders.contains(cx))
- {
- loaders.add(0, cx);
- }
- }
- loader = new CombinedClassLoader(loaders);
- }
- else
- loader = ClassLoader.getSystemClassLoader();
-
- try
+ try
{
- return Proxy.getProxyClass(loader, clss);
+ return RMIClassLoader.loadProxyClass(
+ (String)getAnnotation(),
+ intfs,
+ VMStackWalker.firstNonNullClassLoader());
}
- catch (IllegalArgumentException e)
+ catch (MalformedURLException x)
{
- throw new ClassNotFoundException(null, e);
+ throw new ClassNotFoundException(null, x);
}
}
diff --git a/libjava/classpath/gnu/java/security/.cvsignore b/libjava/classpath/gnu/java/security/.cvsignore
new file mode 100644
index 00000000000..11f6639ebbd
--- /dev/null
+++ b/libjava/classpath/gnu/java/security/.cvsignore
@@ -0,0 +1 @@
+Configuration.java
diff --git a/libjava/classpath/gnu/java/security/Engine.java b/libjava/classpath/gnu/java/security/Engine.java
index c6271e3f219..44318af8ec7 100644
--- a/libjava/classpath/gnu/java/security/Engine.java
+++ b/libjava/classpath/gnu/java/security/Engine.java
@@ -79,158 +79,170 @@ public final class Engine
/** This class cannot be instantiated. */
private Engine() { }
- // Class method.
- // ------------------------------------------------------------------------
-
/**
- * Get the implementation for <i>algorithm</i> for service
- * <i>service</i> from <i>provider</i>. The service is e.g.
- * "Signature", and the algorithm "DSA".
- *
- * @param service The service name.
+ * Return the implementation for <i>algorithm</i> for service <i>service</i>
+ * from <i>provider</i>. The service is e.g. "Signature", and the algorithm
+ * "DSA".
+ *
+ * @param service The service name.
* @param algorithm The name of the algorithm to get.
- * @param provider The provider to get the implementation from.
- * @return The engine class for the specified algorithm; the object
- * returned is typically a subclass of the SPI class for that
- * service, but callers should check that this is so.
- * @throws NoSuchAlgorithmException If the implementation cannot be
- * found or cannot be instantiated.
- * @throws InvocationTargetException If the SPI class's constructor
- * throws an exception.
- * @throws IllegalArgumentException If any of the three arguments are null.
+ * @param provider The provider to get the implementation from.
+ * @return The engine class for the specified algorithm; the object returned
+ * is typically a subclass of the SPI class for that service, but
+ * callers should check that this is so.
+ * @throws NoSuchAlgorithmException If the implementation cannot be found or
+ * cannot be instantiated.
+ * @throws InvocationTargetException If the SPI class's constructor throws an
+ * exception.
+ * @throws IllegalArgumentException If any of the three arguments is null.
*/
public static Object getInstance(String service, String algorithm,
Provider provider)
- throws InvocationTargetException, NoSuchAlgorithmException
+ throws InvocationTargetException, NoSuchAlgorithmException
{
return getInstance(service, algorithm, provider, NO_ARGS);
}
/**
- * Get the implementation for <i>algorithm</i> for service
- * <i>service</i> from <i>provider</i>, passing <i>initArgs</i> to the
- * SPI class's constructor (which cannot be null; pass a zero-length
- * array if the SPI takes no arguments). The service is e.g.
- * "Signature", and the algorithm "DSA".
- *
- * @param service The service name.
+ * Return the implementation for <i>algorithm</i> for service <i>service</i>
+ * from <i>provider</i>, passing <i>initArgs</i> to the SPI class's
+ * constructor (which cannot be null; pass a zero-length array if the SPI
+ * takes no arguments). The service is e.g. "Signature", and the algorithm
+ * "DSA".
+ *
+ * @param service The service name.
* @param algorithm The name of the algorithm to get.
- * @param provider The provider to get the implementation from.
- * @param initArgs The arguments to pass to the SPI class's
- * constructor (cannot be null).
- * @return The engine class for the specified algorithm; the object
- * returned is typically a subclass of the SPI class for that
- * service, but callers should check that this is so.
- * @throws NoSuchAlgorithmException If the implementation cannot be
- * found or cannot be instantiated.
- * @throws InvocationTargetException If the SPI class's constructor
- * throws an exception.
- * @throws IllegalArgumentException If any of the four arguments are null.
+ * @param provider The provider to get the implementation from.
+ * @param initArgs The arguments to pass to the SPI class's constructor
+ * (cannot be null).
+ * @return The engine class for the specified algorithm; the object returned
+ * is typically a subclass of the SPI class for that service, but
+ * callers should check that this is so.
+ * @throws NoSuchAlgorithmException If the implementation cannot be found or
+ * cannot be instantiated.
+ * @throws InvocationTargetException If the SPI class's constructor throws an
+ * exception.
+ * @throws IllegalArgumentException If any of the four arguments is
+ * <code>null</code> or if either <code>service</code>, or
+ * <code>algorithm</code> is an empty string.
*/
public static Object getInstance(String service, String algorithm,
Provider provider, Object[] initArgs)
- throws InvocationTargetException, NoSuchAlgorithmException
+ throws InvocationTargetException, NoSuchAlgorithmException
{
- if (service != null)
- service = service.trim();
+ if (service == null)
+ throw new IllegalArgumentException("service MUST NOT be null");
+ service = service.trim();
+ if (service.length() == 0)
+ throw new IllegalArgumentException("service MUST NOT be empty");
+ if (algorithm == null)
+ throw new IllegalArgumentException("algorithm MUST NOT be null");
+ algorithm = algorithm.trim();
+ if (algorithm.length() == 0)
+ throw new IllegalArgumentException("algorithm MUST NOT be empty");
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
+ if (initArgs == null)
+ throw new IllegalArgumentException("Constructor's parameters MUST NOT be null");
- if (algorithm != null)
- algorithm = algorithm.trim();
-
- if (service == null || service.length() == 0
- || algorithm == null || algorithm.length() == 0
- || provider == null || initArgs == null)
- throw new IllegalArgumentException();
-
-
Enumeration enumer = provider.propertyNames();
String key;
String alias;
int count = 0;
boolean algorithmFound = false;
-
+ StringBuilder sb = new StringBuilder();
while (enumer.hasMoreElements())
{
key = (String) enumer.nextElement();
-
if (key.equalsIgnoreCase(service + "." + algorithm))
{
// remove the service portion from the key
algorithm = key.substring(service.length() + 1);
-
algorithmFound = true;
break;
-
}
else if (key.equalsIgnoreCase(ALG_ALIAS + service + "." + algorithm))
{
-
alias = (String) provider.getProperty(key);
-
if (! algorithm.equalsIgnoreCase(alias)) // does not refer to itself
{
algorithm = alias;
if (count++ > MAX_ALIASES)
- throw new NoSuchAlgorithmException("too many aliases");
-
+ {
+ sb.append("Algorithm [").append(algorithm)
+ .append("] of type [").append(service)
+ .append("] from provider [").append(provider)
+ .append("] has too many aliases");
+ throw new NoSuchAlgorithmException(sb.toString());
+ }
// need to reset enumeration to now look for the alias
enumer = provider.propertyNames();
}
}
}
-
+
if (! algorithmFound)
{
- throw new NoSuchAlgorithmException(algorithm);
+ sb.append("Algorithm [").append(algorithm).append("] of type [")
+ .append(service).append("] from provider [")
+ .append(provider).append("] is not found");
+ throw new NoSuchAlgorithmException(sb.toString());
}
-
-
- // Find and instantiate the implementation.
+
+ // Find and instantiate the implementation
Class clazz = null;
ClassLoader loader = provider.getClass().getClassLoader();
Constructor constructor = null;
- String error = algorithm;
-
+ String className = provider.getProperty(service + "." + algorithm);
+ sb.append("Class [").append(className).append("] for algorithm [")
+ .append(algorithm).append("] of type [").append(service)
+ .append("] from provider [").append(provider).append("] ");
+ Throwable cause = null;
try
{
if (loader != null)
- clazz = loader.loadClass(provider.getProperty(service+"."+algorithm));
+ clazz = loader.loadClass(className);
else
- clazz = Class.forName(provider.getProperty(service+"."+algorithm));
+ clazz = Class.forName(className);
constructor = getCompatibleConstructor(clazz, initArgs);
return constructor.newInstance(initArgs);
}
- catch (ClassNotFoundException cnfe)
+ catch (ClassNotFoundException x)
{
- error = "class not found: " + algorithm;
+ sb.append("cannot not be found");
+ cause = x;
}
- catch (IllegalAccessException iae)
+ catch (IllegalAccessException x)
{
- error = "illegal access: " + iae.getMessage();
+ sb.append("cannot be accessed");
+ cause = x;
}
- catch (InstantiationException ie)
+ catch (InstantiationException x)
{
- error = "instantiation exception: " + ie.getMessage();
+ sb.append("cannot be instantiated");
+ cause = x;
}
- catch (ExceptionInInitializerError eiie)
+ catch (ExceptionInInitializerError x)
{
- error = "exception in initializer: " + eiie.getMessage();
+ sb.append("cannot be initialized");
+ cause = x;
}
- catch (SecurityException se)
+ catch (SecurityException x)
{
- error = "security exception: " + se.getMessage();
+ sb.append("caused a security violation");
+ cause = x;
}
- catch (NoSuchMethodException nsme)
+ catch (NoSuchMethodException x)
{
- error = "no appropriate constructor found";
+ sb.append("does not have/expose an appropriate constructor");
+ cause = x;
}
- throw new NoSuchAlgorithmException(error);
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
- // Own methods.
- // ------------------------------------------------------------------------
-
/**
* Find a constructor in the given class that can take the specified
* argument list, allowing any of which to be null.
diff --git a/libjava/classpath/gnu/java/security/Requires.java b/libjava/classpath/gnu/java/security/Requires.java
new file mode 100644
index 00000000000..c820336c01e
--- /dev/null
+++ b/libjava/classpath/gnu/java/security/Requires.java
@@ -0,0 +1,59 @@
+/* Requires.java -- mark methods as requiring permission.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.security;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.CLASS;
+import java.security.Permission;
+
+/**
+ *
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+@Documented @Retention(CLASS) @Target(METHOD)
+public @interface Requires
+{
+ Class<? extends Permission> permissionClass();
+ String target();
+ String action();
+}
diff --git a/libjava/classpath/gnu/java/security/action/GetPropertyAction.java b/libjava/classpath/gnu/java/security/action/GetPropertyAction.java
index 2886deb3474..0c8141a4d9b 100644
--- a/libjava/classpath/gnu/java/security/action/GetPropertyAction.java
+++ b/libjava/classpath/gnu/java/security/action/GetPropertyAction.java
@@ -49,7 +49,7 @@ import java.security.PrivilegedAction;
* String port = AccessController.doPrivileged(action);
* </code>
*/
-public class GetPropertyAction implements PrivilegedAction
+public class GetPropertyAction implements PrivilegedAction<String>
{
String name;
String value = null;
@@ -68,7 +68,7 @@ public class GetPropertyAction implements PrivilegedAction
setParameters(propName, defaultValue);
}
- public Object run()
+ public String run()
{
return System.getProperty(name, value);
}
diff --git a/libjava/classpath/gnu/java/security/action/GetSecurityPropertyAction.java b/libjava/classpath/gnu/java/security/action/GetSecurityPropertyAction.java
index 97fa15d03e5..ac928ca336f 100644
--- a/libjava/classpath/gnu/java/security/action/GetSecurityPropertyAction.java
+++ b/libjava/classpath/gnu/java/security/action/GetSecurityPropertyAction.java
@@ -50,7 +50,7 @@ import java.security.Security;
* String passwd = AccessController.doPrivileged(action);
* </code>
*/
-public class GetSecurityPropertyAction implements PrivilegedAction
+public class GetSecurityPropertyAction implements PrivilegedAction<String>
{
private String name;
private String value;
@@ -83,7 +83,7 @@ public class GetSecurityPropertyAction implements PrivilegedAction
return this;
}
- public Object run()
+ public String run()
{
String val = Security.getProperty(name);
if (val == null)
diff --git a/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairRawCodec.java b/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairRawCodec.java
index c2650e6a49c..95220236617 100644
--- a/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairRawCodec.java
+++ b/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairRawCodec.java
@@ -81,11 +81,11 @@ public class RSAKeyPairRawCodec
* the <code>toByteArray()</code> method on the RSA parameter <code>e</code>.
* </li>
* </ol>
- *
+ *
* @param key the key to encode.
* @return the <i>Raw</i> format encoding of the designated key.
* @exception IllegalArgumentException if the designated key is not an RSA
- * one.
+ * one.
*/
public byte[] encodePublicKey(PublicKey key)
{
diff --git a/libjava/classpath/gnu/java/security/util/ByteBufferOutputStream.java b/libjava/classpath/gnu/java/security/util/ByteBufferOutputStream.java
new file mode 100644
index 00000000000..be4d0a98d67
--- /dev/null
+++ b/libjava/classpath/gnu/java/security/util/ByteBufferOutputStream.java
@@ -0,0 +1,118 @@
+/* ByteBufferOutputStream.java -- output stream with a growable underlying
+ byte buffer.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.security.util;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import java.nio.ByteBuffer;
+
+/**
+ * An output stream that writes bytes to a ByteBuffer, which will be resized
+ * if more space is needed.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class ByteBufferOutputStream extends OutputStream
+{
+ private ByteBuffer buffer;
+
+ public ByteBufferOutputStream()
+ {
+ this(256);
+ }
+
+ public ByteBufferOutputStream(int initialCapacity)
+ {
+ buffer = ByteBuffer.allocate(initialCapacity);
+ }
+
+ /* (non-Javadoc)
+ * @see java.io.OutputStream#write(int)
+ */
+ public @Override synchronized void write(int b) throws IOException
+ {
+ if (!buffer.hasRemaining())
+ growBuffer();
+ buffer.put((byte) b);
+ }
+
+ public @Override synchronized void write(byte[] b, int offset, int length)
+ {
+ if (buffer.remaining() < length)
+ growBuffer();
+ buffer.put(b, offset, length);
+ }
+
+ public @Override void write(byte[] b)
+ {
+ write(b, 0, b.length);
+ }
+
+ /**
+ * Get the current state of the buffer. The returned buffer will have
+ * its position set to zero, its capacity set to the current limit,
+ * and its limit set to its capacity.
+ *
+ * @return The buffer.
+ */
+ public ByteBuffer buffer()
+ {
+ return ((ByteBuffer) buffer.duplicate().flip()).slice();
+ }
+
+ public String toString()
+ {
+ return super.toString() + " [ buffer: " + buffer + " ]";
+ }
+
+ private void growBuffer()
+ {
+ int newCapacity = buffer.capacity();
+ if (newCapacity < 16384) // If the buffer isn't huge yet, double its size
+ newCapacity = newCapacity << 1;
+ else // Otherwize, increment by a bit.
+ newCapacity += 4096;
+ ByteBuffer newBuffer = ByteBuffer.allocate(newCapacity);
+ buffer.flip();
+ newBuffer.put(buffer);
+ buffer = newBuffer;
+ }
+}
diff --git a/libjava/classpath/gnu/java/util/DoubleEnumeration.java b/libjava/classpath/gnu/java/util/DoubleEnumeration.java
index 1fc37f8e0f8..94efb923d2a 100644
--- a/libjava/classpath/gnu/java/util/DoubleEnumeration.java
+++ b/libjava/classpath/gnu/java/util/DoubleEnumeration.java
@@ -1,5 +1,5 @@
/* gnu.java.util.DoubleEnumeration
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -63,7 +63,7 @@ import java.util.NoSuchElementException;
* @author Jochen Hoenicke
* @author Mark Wielaard (mark@klomp.org)
*/
-public class DoubleEnumeration implements Enumeration
+public class DoubleEnumeration<T> implements Enumeration<T>
{
/**
* This is true as long as one of the enumerations has more
@@ -82,17 +82,17 @@ public class DoubleEnumeration implements Enumeration
/**
* The first enumeration.
*/
- private Enumeration e1;
+ private Enumeration<T> e1;
/**
* The second enumeration.
*/
- private Enumeration e2;
+ private Enumeration<T> e2;
/**
* Creates a new Enumeration combining the given two enumerations.
* The enumerations mustn't be accessed by other classes.
*/
- public DoubleEnumeration(Enumeration e1, Enumeration e2)
+ public DoubleEnumeration(Enumeration<T> e1, Enumeration<T> e2)
{
this.e1 = e1;
this.e2 = e2;
@@ -126,7 +126,7 @@ public class DoubleEnumeration implements Enumeration
* element of the second enumeration. If both enumeration don't have
* any elements it throws a <code>NoSuchElementException</code>.
*/
- public Object nextElement()
+ public T nextElement()
{
if (!hasMoreElements())
throw new NoSuchElementException();
diff --git a/libjava/classpath/gnu/java/util/prefs/GConfBasedPreferences.java b/libjava/classpath/gnu/java/util/prefs/GConfBasedPreferences.java
index 5702751cf5c..a7e2322b524 100644
--- a/libjava/classpath/gnu/java/util/prefs/GConfBasedPreferences.java
+++ b/libjava/classpath/gnu/java/util/prefs/GConfBasedPreferences.java
@@ -72,7 +72,6 @@ import java.util.prefs.BackingStoreException;
* <br />
*
* @author Mario Torre <neugens@limasoftware.net>
- * @version 1.0.1
*/
public class GConfBasedPreferences
extends AbstractPreferences
@@ -136,12 +135,20 @@ public class GConfBasedPreferences
absolutePath = absolutePath.substring(0, absolutePath.length() - 1);
}
+ // strip invalid characters
+ // please, note that all names are unescaped into the native peer
+ int index = absolutePath.lastIndexOf('/');
+ if (index > -1)
+ {
+ absolutePath = absolutePath.substring(0, index + 1);
+ absolutePath = absolutePath + GConfNativePeer.escapeString(name);
+ }
+
this.node = this.getRealRoot(isUser) + absolutePath;
boolean nodeExist = backend.nodeExist(this.node);
this.newNode = !nodeExist;
- backend.startWatchingNode(this.node);
}
/**
@@ -156,7 +163,15 @@ public class GConfBasedPreferences
// we don't check anything here, if the node is a new node this will be
// detected in the constructor, so we simply return a new reference to
// the requested node.
- return new GConfBasedPreferences(this, name, this.isUser);
+
+ GConfBasedPreferences preferenceNode
+ = new GConfBasedPreferences(this, name, this.isUser);
+
+ // register the node for to GConf so that it can listen
+ // events outside the scope of the application
+ backend.startWatchingNode(this.node);
+
+ return preferenceNode;
}
/**
@@ -365,6 +380,10 @@ public class GConfBasedPreferences
{
String nodeName = "";
+ // strip key
+ // please, note that all names are unescaped into the native peer
+ key = GConfNativePeer.escapeString(key);
+
if (this.node.endsWith("/"))
{
nodeName = this.node + key;
@@ -373,7 +392,7 @@ public class GConfBasedPreferences
{
nodeName = this.node + "/" + key;
}
-
+
return nodeName;
}
diff --git a/libjava/classpath/gnu/java/util/prefs/gconf/GConfNativePeer.java b/libjava/classpath/gnu/java/util/prefs/gconf/GConfNativePeer.java
index f1cb6278767..6049863e916 100644
--- a/libjava/classpath/gnu/java/util/prefs/gconf/GConfNativePeer.java
+++ b/libjava/classpath/gnu/java/util/prefs/gconf/GConfNativePeer.java
@@ -45,7 +45,6 @@ import java.util.prefs.BackingStoreException;
* Native peer for GConf based preference backend.
*
* @author Mario Torre <neugens@limasoftware.net>
- * @version 1.0.1
*/
public final class GConfNativePeer
{
@@ -150,7 +149,7 @@ public final class GConfNativePeer
*/
public List getKeys(String node) throws BackingStoreException
{
- return gconf_client_gconf_client_all_keys(node);
+ return gconf_client_all_keys(node);
}
/**
@@ -162,10 +161,26 @@ public final class GConfNativePeer
*/
public List getChildrenNodes(String node) throws BackingStoreException
{
- return gconf_client_gconf_client_all_nodes(node);
+ return gconf_client_all_nodes(node);
}
/**
+ * Escape the given string so the it is a valid GConf name.
+ */
+ public static String escapeString(String plain)
+ {
+ return gconf_escape_key(plain);
+ }
+
+ /**
+ * Unescape a string escaped with {@link #escapeString}.
+ */
+ public static String unescapeString(String escaped)
+ {
+ return gconf_unescape_key(escaped);
+ }
+
+ /**
* Suggest to the backend GConf daemon to synch with the database.
*/
public void suggestSync() throws BackingStoreException
@@ -270,8 +285,9 @@ public final class GConfNativePeer
* Suggest to the GConf native peer a sync with the database.
*
*/
- native static final protected void gconf_client_suggest_sync();
-
+ native static final protected void gconf_client_suggest_sync()
+ throws BackingStoreException;
+
/**
* Returns a list of all nodes under the given node.
*
@@ -279,8 +295,9 @@ public final class GConfNativePeer
* @return A list of nodes under the given source node.
*/
native
- static final protected List gconf_client_gconf_client_all_nodes(String node);
-
+ static final protected List gconf_client_all_nodes(String node)
+ throws BackingStoreException;
+
/**
* Returns a list of all keys stored in the given node.
*
@@ -288,8 +305,28 @@ public final class GConfNativePeer
* @return A list of all keys stored in the given node.
*/
native
- static final protected List gconf_client_gconf_client_all_keys(String node);
+ static final protected List gconf_client_all_keys(String node)
+ throws BackingStoreException;
+ /**
+ * Escape the input String so that it's a valid element for GConf.
+ *
+ * @param plain the String to escape.
+ * @return An escaped String for use with GConf.
+ */
+ native
+ static final protected String gconf_escape_key(String plain);
+
+ /**
+ * Converts a string escaped with gconf_escape_key back into its
+ * original form.
+ *
+ * @param escaped key as returned by gconf_escape_key
+ * @return An unescaped key.
+ */
+ native
+ static final protected String gconf_unescape_key(String escaped);
+
static
{
System.loadLibrary("gconfpeer");
diff --git a/libjava/classpath/gnu/java/util/regex/CharIndexed.java b/libjava/classpath/gnu/java/util/regex/CharIndexed.java
index 6cd857e3bc0..27e07b2f8ff 100644
--- a/libjava/classpath/gnu/java/util/regex/CharIndexed.java
+++ b/libjava/classpath/gnu/java/util/regex/CharIndexed.java
@@ -77,6 +77,13 @@ public interface CharIndexed {
boolean move(int index);
/**
+ * Shifts the input buffer by a given number of positions. Returns
+ * true if the new cursor position is valid or cursor position is at
+ * the end of input.
+ */
+ boolean move1(int index); // I cannot think of a better name for this.
+
+ /**
* Returns true if the most recent move() operation placed the cursor
* position at a valid position in the input.
*/
@@ -105,6 +112,16 @@ public interface CharIndexed {
REMatch getLastMatch();
/**
+ * Sets the information used for hitEnd().
+ */
+ void setHitEnd(REMatch match);
+
+ /**
+ * Returns whether the matcher has hit the end of input.
+ */
+ boolean hitEnd();
+
+ /**
* Returns the anchor.
*/
int getAnchor();
diff --git a/libjava/classpath/gnu/java/util/regex/CharIndexedCharSequence.java b/libjava/classpath/gnu/java/util/regex/CharIndexedCharSequence.java
index 2eb753b0f5c..8a0578eb80f 100644
--- a/libjava/classpath/gnu/java/util/regex/CharIndexedCharSequence.java
+++ b/libjava/classpath/gnu/java/util/regex/CharIndexedCharSequence.java
@@ -62,6 +62,10 @@ class CharIndexedCharSequence implements CharIndexed, Serializable {
return ((anchor += index) < len);
}
+ public boolean move1(int index) {
+ return ((anchor += index) <= len);
+ }
+
public CharIndexed lookBehind(int index, int length) {
if (length > (anchor + index)) length = anchor + index;
return new CharIndexedCharSequence(s, anchor + index - length);
@@ -77,6 +81,15 @@ class CharIndexedCharSequence implements CharIndexed, Serializable {
lastMatch.anchor = anchor;
}
public REMatch getLastMatch() { return lastMatch; }
+
+ private int rightmostTriedPosition = 0;
+ public void setHitEnd(REMatch match) {
+ int pos = anchor + match.index;
+ if (pos > rightmostTriedPosition) rightmostTriedPosition = pos;
+ }
+ public boolean hitEnd() { return rightmostTriedPosition >= len; }
+
public int getAnchor() { return anchor; }
public void setAnchor(int anchor) { this.anchor = anchor; }
+
}
diff --git a/libjava/classpath/gnu/java/util/regex/CharIndexedInputStream.java b/libjava/classpath/gnu/java/util/regex/CharIndexedInputStream.java
index 77cd1abd5cc..844fada51fc 100644
--- a/libjava/classpath/gnu/java/util/regex/CharIndexedInputStream.java
+++ b/libjava/classpath/gnu/java/util/regex/CharIndexedInputStream.java
@@ -166,6 +166,16 @@ class CharIndexedInputStream implements CharIndexed {
"difficult to support getLastMatch for an input stream");
}
+ public void setHitEnd(REMatch match) {
+ throw new UnsupportedOperationException(
+ "difficult to support setHitEnd for an input stream");
+ }
+
+ public boolean hitEnd() {
+ throw new UnsupportedOperationException(
+ "difficult to support hitEnd for an input stream");
+ }
+
public int getAnchor() {
throw new UnsupportedOperationException(
"difficult to support getAnchor for an input stream");
@@ -176,6 +186,10 @@ class CharIndexedInputStream implements CharIndexed {
"difficult to support setAnchor for an input stream");
}
+ public boolean move1(int index) {
+ throw new UnsupportedOperationException(
+ "difficult to support move1 for an input stream");
+ }
}
diff --git a/libjava/classpath/gnu/java/util/regex/RE.java b/libjava/classpath/gnu/java/util/regex/RE.java
index 1aab3b781a2..09ff74b908f 100644
--- a/libjava/classpath/gnu/java/util/regex/RE.java
+++ b/libjava/classpath/gnu/java/util/regex/RE.java
@@ -130,7 +130,11 @@ public class RE extends REToken {
private static final String VERSION = "1.1.5-dev";
// The localized strings are kept in a separate file
- private static ResourceBundle messages = PropertyResourceBundle.getBundle("gnu/java/util/regex/MessagesBundle", Locale.getDefault());
+ // Used by getLocalizedMessage().
+ private static ResourceBundle messages;
+
+ // Name of the bundle that contains the localized messages.
+ private static final String bundle = "gnu/java/util/regex/MessagesBundle";
// These are, respectively, the first and last tokens in our linked list
// If there is only one token, firstToken == lastToken
@@ -252,6 +256,13 @@ public class RE extends REToken {
*/
public static final int REG_ICASE_USASCII = 0x0800;
+ /**
+ * Execution flag.
+ * Do not move the position at which the search begins. If not set,
+ * the starting position will be moved until a match is found.
+ */
+ public static final int REG_FIX_STARTING_POSITION = 0x1000;
+
/** Returns a string representing the version of the gnu.regexp package. */
public static final String version() {
return VERSION;
@@ -259,6 +270,8 @@ public class RE extends REToken {
// Retrieves a message from the ResourceBundle
static final String getLocalizedMessage(String key) {
+ if (messages == null)
+ messages = PropertyResourceBundle.getBundle(bundle, Locale.getDefault());
return messages.getString(key);
}
@@ -1643,6 +1656,7 @@ public class RE extends REToken {
/* Implements abstract method REToken.match() */
boolean match(CharIndexed input, REMatch mymatch) {
+ input.setHitEnd(mymatch);
if (firstToken == null) {
return next(input, mymatch);
}
@@ -1720,15 +1734,23 @@ public class RE extends REToken {
REMatch getMatchImpl(CharIndexed input, int anchor, int eflags, StringBuffer buffer) {
boolean tryEntireMatch = ((eflags & REG_TRY_ENTIRE_MATCH) != 0);
+ boolean doMove = ((eflags & REG_FIX_STARTING_POSITION) == 0);
RE re = (tryEntireMatch ? (RE) this.clone() : this);
if (tryEntireMatch) {
- re.chain(new RETokenEnd(0, null));
+ RETokenEnd reEnd = new RETokenEnd(0, null);
+ reEnd.setFake(true);
+ re.chain(reEnd);
}
// Create a new REMatch to hold results
REMatch mymatch = new REMatch(numSubs, anchor, eflags);
do {
+ /* The following potimization is commented out because
+ the matching should be tried even if the length of
+ input is obviously too short in order that
+ java.util.regex.Matcher#hitEnd() may work correctly.
// Optimization: check if anchor + minimumLength > length
if (minimumLength == 0 || input.charAt(minimumLength-1) != CharIndexed.OUT_OF_BOUNDS) {
+ */
if (re.match(input, mymatch)) {
REMatch best = mymatch;
// We assume that the match that coms first is the best.
@@ -1749,13 +1771,17 @@ public class RE extends REToken {
input.setLastMatch(best);
return best;
}
- }
+ /* End of the optimization commented out
+ }
+ */
mymatch.clear(++anchor);
// Append character to buffer if needed
if (buffer != null && input.charAt(0) != CharIndexed.OUT_OF_BOUNDS) {
buffer.append(input.charAt(0));
}
- } while (input.move(1));
+ // java.util.regex.Matcher#hitEnd() requires that the search should
+ // be tried at the end of input, so we use move1(1) instead of move(1)
+ } while (doMove && input.move1(1));
// Special handling at end of input for e.g. "$"
if (minimumLength == 0) {
diff --git a/libjava/classpath/gnu/java/util/regex/REMatch.java b/libjava/classpath/gnu/java/util/regex/REMatch.java
index 3ff5ad794b8..d8994829323 100644
--- a/libjava/classpath/gnu/java/util/regex/REMatch.java
+++ b/libjava/classpath/gnu/java/util/regex/REMatch.java
@@ -307,12 +307,12 @@ public final class REMatch implements Serializable, Cloneable {
}
/* The following are used for debugging purpose
- static String d(REMatch m) {
+ public static String d(REMatch m) {
if (m == null) return "null";
else return "[" + m.index + "]";
}
- String substringUptoIndex(CharIndexed input) {
+ public String substringUptoIndex(CharIndexed input) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < index; i++) {
sb.append(input.charAt(i));
diff --git a/libjava/classpath/gnu/java/util/regex/RESyntax.java b/libjava/classpath/gnu/java/util/regex/RESyntax.java
index b66b32f5878..db11e2db450 100644
--- a/libjava/classpath/gnu/java/util/regex/RESyntax.java
+++ b/libjava/classpath/gnu/java/util/regex/RESyntax.java
@@ -54,8 +54,6 @@ import java.util.BitSet;
public final class RESyntax implements Serializable {
static final String DEFAULT_LINE_SEPARATOR = System.getProperty("line.separator");
- private static final String SYNTAX_IS_FINAL = RE.getLocalizedMessage("syntax.final");
-
private BitSet bits;
// true for the constant defined syntaxes
@@ -513,7 +511,8 @@ public final class RESyntax implements Serializable {
* @return a reference to this object for easy chaining.
*/
public RESyntax set(int index) {
- if (isFinal) throw new IllegalAccessError(SYNTAX_IS_FINAL);
+ if (isFinal)
+ throw new IllegalAccessError(RE.getLocalizedMessage("syntax.final"));
bits.set(index);
return this;
}
@@ -525,7 +524,8 @@ public final class RESyntax implements Serializable {
* @return a reference to this object for easy chaining.
*/
public RESyntax clear(int index) {
- if (isFinal) throw new IllegalAccessError(SYNTAX_IS_FINAL);
+ if (isFinal)
+ throw new IllegalAccessError(RE.getLocalizedMessage("syntax.final"));
bits.clear(index);
return this;
}
@@ -548,7 +548,8 @@ public final class RESyntax implements Serializable {
* @return this object for convenient chaining
*/
public RESyntax setLineSeparator(String aSeparator) {
- if (isFinal) throw new IllegalAccessError(SYNTAX_IS_FINAL);
+ if (isFinal)
+ throw new IllegalAccessError(RE.getLocalizedMessage("syntax.final"));
lineSeparator = aSeparator;
return this;
}
diff --git a/libjava/classpath/gnu/java/util/regex/REToken.java b/libjava/classpath/gnu/java/util/regex/REToken.java
index 155c01878e8..9affd4ee3c9 100644
--- a/libjava/classpath/gnu/java/util/regex/REToken.java
+++ b/libjava/classpath/gnu/java/util/regex/REToken.java
@@ -72,6 +72,16 @@ abstract class REToken implements Serializable, Cloneable {
/** Returns true if the match succeeded, false if it failed. */
boolean match(CharIndexed input, REMatch mymatch) {
+ return match(input, mymatch, false);
+ }
+ boolean matchFake(CharIndexed input, REMatch mymatch) {
+ return match(input, mymatch, true);
+ }
+
+ private boolean match(CharIndexed input, REMatch mymatch, boolean fake) {
+ if (!fake) {
+ setHitEnd(input, mymatch);
+ }
REMatch m = matchThis(input, mymatch);
if (m == null) return false;
if (next(input, m)) {
@@ -81,6 +91,11 @@ abstract class REToken implements Serializable, Cloneable {
return false;
}
+ /** Sets whether the matching occurs at the end of input */
+ void setHitEnd(CharIndexed input, REMatch mymatch) {
+ input.setHitEnd(mymatch);
+ }
+
/** Returns true if the match succeeded, false if it failed.
* The matching is done against this REToken only. Chained
* tokens are not checked.
diff --git a/libjava/classpath/gnu/java/util/regex/RETokenChar.java b/libjava/classpath/gnu/java/util/regex/RETokenChar.java
index 92d3efcf85b..b70e6b1d843 100644
--- a/libjava/classpath/gnu/java/util/regex/RETokenChar.java
+++ b/libjava/classpath/gnu/java/util/regex/RETokenChar.java
@@ -58,15 +58,20 @@ final class RETokenChar extends REToken {
}
REMatch matchThis(CharIndexed input, REMatch mymatch) {
- int z = ch.length;
if (matchOneString(input, mymatch.index)) {
- mymatch.index += z;
+ mymatch.index += matchedLength;
return mymatch;
}
+ // java.util.regex.Matcher#hitEnd() requires that the length of
+ // partial match be counted.
+ mymatch.index += matchedLength;
+ input.setHitEnd(mymatch);
return null;
}
- boolean matchOneString(CharIndexed input, int index) {
+ private int matchedLength;
+ private boolean matchOneString(CharIndexed input, int index) {
+ matchedLength = 0;
int z = ch.length;
char c;
for (int i=0; i<z; i++) {
@@ -74,6 +79,7 @@ final class RETokenChar extends REToken {
if (! charEquals(c, ch[i])) {
return false;
}
+ ++matchedLength;
}
return true;
}
diff --git a/libjava/classpath/gnu/java/util/regex/RETokenEnd.java b/libjava/classpath/gnu/java/util/regex/RETokenEnd.java
index 00efdb6a712..294e32085b5 100644
--- a/libjava/classpath/gnu/java/util/regex/RETokenEnd.java
+++ b/libjava/classpath/gnu/java/util/regex/RETokenEnd.java
@@ -45,6 +45,12 @@ final class RETokenEnd extends REToken {
private String newline;
private boolean check_java_line_terminators;
+ /**
+ * Indicates whether this token is a real one generated at compile time,
+ * or a fake one temporarily added by RE#getMatchImpl.
+ */
+ private boolean fake = false;
+
RETokenEnd(int subIndex,String newline) {
super(subIndex);
this.newline = newline;
@@ -57,10 +63,19 @@ final class RETokenEnd extends REToken {
this.check_java_line_terminators = b;
}
+ void setFake(boolean fake) {
+ this.fake = fake;
+ }
+
int getMaximumLength() {
return 0;
}
+ boolean match(CharIndexed input, REMatch mymatch) {
+ if (!fake) return super.match(input, mymatch);
+ return super.matchFake(input, mymatch);
+ }
+
REMatch matchThis(CharIndexed input, REMatch mymatch) {
char ch = input.charAt(mymatch.index);
if (ch == CharIndexed.OUT_OF_BOUNDS)
diff --git a/libjava/classpath/gnu/java/util/regex/RETokenEndSub.java b/libjava/classpath/gnu/java/util/regex/RETokenEndSub.java
index 57a146d03b9..b3a28a3e82e 100644
--- a/libjava/classpath/gnu/java/util/regex/RETokenEndSub.java
+++ b/libjava/classpath/gnu/java/util/regex/RETokenEndSub.java
@@ -58,6 +58,10 @@ final class RETokenEndSub extends REToken {
return super.findMatch(input, mymatch);
}
+ void setHitEnd(CharIndexed input, REMatch mymatch) {
+ // Do nothing
+ }
+
void dump(StringBuffer os) {
// handled by RE
// But add something for debugging.
diff --git a/libjava/classpath/gnu/java/util/regex/RETokenNamedProperty.java b/libjava/classpath/gnu/java/util/regex/RETokenNamedProperty.java
index a286c5be8c6..aec27583a58 100644
--- a/libjava/classpath/gnu/java/util/regex/RETokenNamedProperty.java
+++ b/libjava/classpath/gnu/java/util/regex/RETokenNamedProperty.java
@@ -260,6 +260,14 @@ final class RETokenNamedProperty extends REToken {
return new UnicodeCategoryHandler(Character.UNASSIGNED);
if (name.equals("Lu"))
return new UnicodeCategoryHandler(Character.UPPERCASE_LETTER);
+ if (name.equals("all"))
+ return new Handler()
+ {
+ public boolean includes(char c)
+ {
+ return true;
+ }
+ };
throw new REException("unsupported name " + name, REException.REG_ESCAPE, 0);
}
diff --git a/libjava/classpath/gnu/java/util/regex/RETokenOneOf.java b/libjava/classpath/gnu/java/util/regex/RETokenOneOf.java
index bccc783118a..239c2201ca7 100644
--- a/libjava/classpath/gnu/java/util/regex/RETokenOneOf.java
+++ b/libjava/classpath/gnu/java/util/regex/RETokenOneOf.java
@@ -120,6 +120,7 @@ final class RETokenOneOf extends REToken {
}
boolean match(CharIndexed input, REMatch mymatch) {
+ setHitEnd(input, mymatch);
if (matchesOneChar) return matchOneChar(input, mymatch);
else return matchOneRE(input, mymatch);
}
diff --git a/libjava/classpath/gnu/java/util/regex/RETokenRepeated.java b/libjava/classpath/gnu/java/util/regex/RETokenRepeated.java
index 531c4a31124..7f5e5626f1e 100644
--- a/libjava/classpath/gnu/java/util/regex/RETokenRepeated.java
+++ b/libjava/classpath/gnu/java/util/regex/RETokenRepeated.java
@@ -38,8 +38,7 @@ exception statement from your version. */
package gnu.java.util.regex;
-// import java.util.Vector;
-// import java.util.Stack;
+import java.util.ArrayList;
final class RETokenRepeated extends REToken {
private REToken token;
@@ -168,19 +167,63 @@ final class RETokenRepeated extends REToken {
}
}
+ private static class FindMatchControlStack extends ArrayList {
+ private void push(FindMatchControl control) {
+ add(control);
+ }
+ private FindMatchControl pop() {
+ return (FindMatchControl)remove(size()-1);
+ }
+ private boolean empty() {
+ return isEmpty();
+ }
+ }
+
+ private static class FindMatchControl {
+ DoablesFinder finder;
+ FindMatchControl(DoablesFinder finder) {
+ this.finder = finder;
+ }
+ }
+
private REMatch findMatch(BacktrackStack stack) {
- // Avoid using recursive calls.
+ return findMatch(stack, new FindMatchControlStack());
+ }
+
+ private REMatch findMatch(BacktrackStack stack,
+ FindMatchControlStack controlStack) {
+ REMatch result = null;
+ StackedInfo si = null;
+ CharIndexed input = null;
+ int numRepeats = 0;
+ REMatch mymatch = null;
+ int[] visited = null;
+ DoablesFinder finder = null;
+
+ // Avoid using recursive calls because a match can be very long.
+
+ // This is the first entry point of this method.
+ // If you want to call this method recursively and you need the
+ // result returned, save necessary information in a FindMatchControl
+ // object and push it to controlStack, then continue from this point.
+ // You can check the result after exiting MAIN_LOOP.
+ MAIN_LOOP0:
+ while (true) {
+
+ // This is the second entry point of this method.
+ // If you want to call this method recursively but you do not need the
+ // result returned, just continue from this point.
MAIN_LOOP:
while (true) {
- if (stack.empty()) return null;
- StackedInfo si = (StackedInfo)(stack.peek());
- CharIndexed input = si.input;
- int numRepeats = si.numRepeats;
- REMatch mymatch = si.match;
- int[] visited = si.visited;
- DoablesFinder finder = si.finder;
-
+ if (stack.empty()) break MAIN_LOOP;
+ si = (StackedInfo)(stack.peek());
+ input = si.input;
+ numRepeats = si.numRepeats;
+ mymatch = si.match;
+ visited = si.visited;
+ finder = si.finder;
+
if (mymatch.backtrackStack == null)
mymatch.backtrackStack = new BacktrackStack();
@@ -192,12 +235,13 @@ final class RETokenRepeated extends REToken {
m1.backtrackStack.push(new BacktrackStack.Backtrack(
this, input, mymatch, stack));
}
- return m1;
+ result = m1;
+ break MAIN_LOOP;
}
if (stingy) {
continue MAIN_LOOP;
}
- return null;
+ break MAIN_LOOP;
}
if (finder == null) {
@@ -238,7 +282,8 @@ final class RETokenRepeated extends REToken {
m1.backtrackStack.push(new BacktrackStack.Backtrack(
this, input, mymatch, stack));
}
- return m1;
+ result = m1;
+ break MAIN_LOOP;
}
else {
continue MAIN_LOOP;
@@ -247,8 +292,82 @@ final class RETokenRepeated extends REToken {
visited = addVisited(mymatch.index, visited);
+ TryAnotherResult taresult = tryAnother(stack, input, mymatch, numRepeats, finder, visited);
+ visited = taresult.visited;
+ switch (taresult.status) {
+ case TryAnotherResult.TRY_FURTHER:
+ controlStack.push(new FindMatchControl(
+ finder));
+ continue MAIN_LOOP0;
+ case TryAnotherResult.RESULT_FOUND:
+ result = taresult.result;
+ break MAIN_LOOP;
+ }
+
+ if (!stack.empty()) {
+ stack.pop();
+ }
+ if (possessive) {
+ stack.clear();
+ }
+ REMatch m1 = matchRest(input, mymatch);
+ if (m1 != null) {
+ if (! stack.empty()) {
+ m1.backtrackStack.push(new BacktrackStack.Backtrack(
+ this, input, mymatch, stack));
+ }
+ result = m1;
+ break MAIN_LOOP;
+ }
+
+ } // MAIN_LOOP
+
+ if (controlStack.empty()) return result;
+ FindMatchControl control = controlStack.pop();
+ if (possessive) {
+ return result;
+ }
+ if (result != null) {
+ result.backtrackStack.push(new BacktrackStack.Backtrack(
+ this, input, mymatch, stack));
+ return result;
+ }
+
+ finder = control.finder;
+
+ TryAnotherResult taresult = tryAnother(stack, input, mymatch, numRepeats, finder, visited);
+ visited = taresult.visited;
+ switch (taresult.status) {
+ case TryAnotherResult.TRY_FURTHER:
+ controlStack.push(new FindMatchControl(
+ finder));
+ continue MAIN_LOOP0;
+ case TryAnotherResult.RESULT_FOUND:
+ return taresult.result;
+ }
+ continue MAIN_LOOP0;
+
+ } // MAIN_LOOP0
+ }
+
+ private static class TryAnotherResult {
+ REMatch result;
+ int status;
+ static final int RESULT_FOUND = 1;
+ static final int TRY_FURTHER = 2;
+ static final int NOTHING_FOUND = 3;
+ int[] visited;
+ }
+
+ private TryAnotherResult tryAnother(BacktrackStack stack,
+ CharIndexed input, REMatch mymatch, int numRepeats,
+ DoablesFinder finder, int[] visited) {
+
+ TryAnotherResult taresult = new TryAnotherResult();
+ taresult.visited = visited;
+
DO_THIS:
- do {
+ {
boolean emptyMatchFound = false;
@@ -263,61 +382,45 @@ final class RETokenRepeated extends REToken {
if (!emptyMatchFound) {
int n = doable.index;
- if (! visitedContains(n, visited)) {
- visited = addVisited(n, visited);
- }
- else {
+ if (visitedContains(n, visited)) {
continue DO_ONE_DOABLE;
}
+ visited = addVisited(n, visited);
stack.push(new StackedInfo(
- input, numRepeats + 1, doable, visited, null));
- REMatch m1 = findMatch(stack);
- if (possessive) {
- return m1;
- }
- if (m1 != null) {
- m1.backtrackStack.push(new BacktrackStack.Backtrack(
- this, input, mymatch, stack));
- return m1;
- }
+ input, numRepeats + 1, doable, visited, null));
+ taresult.visited = visited;
+ taresult.status = TryAnotherResult.TRY_FURTHER;
+ return taresult;
}
else {
REMatch m1 = matchRest(input, doable);
if (possessive) {
- return m1;
+ taresult.result = m1;
+ taresult.status = TryAnotherResult.RESULT_FOUND;
+ return taresult;
}
if (m1 != null) {
if (! stack.empty()) {
m1.backtrackStack.push(new BacktrackStack.Backtrack(
this, input, mymatch, stack));
- }
- return m1;
+ }
+ taresult.result = m1;
+ taresult.status = TryAnotherResult.RESULT_FOUND;
+ return taresult;
}
}
} // DO_ONE_DOABLE
- } while (false); // DO_THIS only once;
+ } // DO_THIS
- if (!stack.empty()) {
- stack.pop();
- }
- if (possessive) {
- stack.clear();
- }
- REMatch m1 = matchRest(input, mymatch);
- if (m1 != null) {
- if (! stack.empty()) {
- m1.backtrackStack.push(new BacktrackStack.Backtrack(
- this, input, mymatch, stack));
- }
- return m1;
- }
+ taresult.status = TryAnotherResult.NOTHING_FOUND;
+ return taresult;
- } // MAIN_LOOP
}
boolean match(CharIndexed input, REMatch mymatch) {
+ setHitEnd(input, mymatch);
REMatch m1 = findMatch(input, mymatch);
if (m1 != null) {
mymatch.assignFrom(m1);
diff --git a/libjava/classpath/gnu/javax/crypto/RSACipherImpl.java b/libjava/classpath/gnu/javax/crypto/RSACipherImpl.java
index 60504ecce85..a4adff00779 100644
--- a/libjava/classpath/gnu/javax/crypto/RSACipherImpl.java
+++ b/libjava/classpath/gnu/javax/crypto/RSACipherImpl.java
@@ -40,6 +40,7 @@ package gnu.javax.crypto;
import gnu.classpath.debug.Component;
import gnu.classpath.debug.SystemLogger;
+import gnu.java.security.sig.rsa.EME_PKCS1_V1_5;
import gnu.java.security.util.ByteArray;
import java.math.BigInteger;
@@ -53,7 +54,6 @@ import java.security.interfaces.RSAPrivateCrtKey;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.AlgorithmParameterSpec;
-import java.util.logging.Logger;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
@@ -65,7 +65,8 @@ import javax.crypto.ShortBufferException;
public class RSACipherImpl
extends CipherSpi
{
- private static final Logger logger = SystemLogger.SYSTEM;
+ private static final SystemLogger logger = SystemLogger.SYSTEM;
+
private static final byte[] EMPTY = new byte[0];
private int opmode = -1;
private RSAPrivateKey decipherKey = null;
@@ -199,22 +200,12 @@ public class RSACipherImpl
engineUpdate(in, offset, length);
if (opmode == Cipher.DECRYPT_MODE)
{
- if (pos < dataBuffer.length)
- throw new IllegalBlockSizeException("expecting exactly "
- + dataBuffer.length + " bytes");
- BigInteger enc = new BigInteger(1, dataBuffer);
- byte[] dec = rsaDecrypt(enc);
- logger.log(Component.CRYPTO, "RSA: decryption produced\n{0}",
- new ByteArray(dec));
- if (dec[0] != 0x02)
- throw new BadPaddingException("expected padding type 2");
- int i;
- for (i = 1; i < dec.length && dec[i] != 0x00; i++)
- ; // keep incrementing i
- int len = dec.length - i - 1; // skip the 0x00 byte
- byte[] result = new byte[len];
- System.arraycopy(dec, i + 1, result, 0, len);
- pos = 0;
+ BigInteger enc = new BigInteger (1, dataBuffer);
+ byte[] dec = rsaDecrypt (enc);
+ logger.log (Component.CRYPTO, "RSA: decryption produced\n{0}",
+ new ByteArray (dec));
+ EME_PKCS1_V1_5 pkcs = EME_PKCS1_V1_5.getInstance(decipherKey);
+ byte[] result = pkcs.decode(dec);
return result;
}
else
@@ -222,24 +213,18 @@ public class RSACipherImpl
offset = dataBuffer.length - pos;
if (offset < 3)
throw new IllegalBlockSizeException("input is too large to encrypt");
- byte[] dec = new byte[dataBuffer.length];
- dec[0] = 0x02;
+ EME_PKCS1_V1_5 pkcs = EME_PKCS1_V1_5.getInstance(encipherKey);
if (random == null)
random = new SecureRandom();
- byte[] pad = new byte[offset - 2];
- random.nextBytes(pad);
- for (int i = 0; i < pad.length; i++)
- if (pad[i] == 0)
- pad[i] = 1;
- System.arraycopy(pad, 0, dec, 1, pad.length);
- dec[dec.length - pos] = 0x00;
- System.arraycopy(dataBuffer, 0, dec, offset, pos);
- logger.log(Component.CRYPTO, "RSA: produced padded plaintext\n{0}",
- new ByteArray(dec));
- BigInteger x = new BigInteger(1, dec);
- BigInteger y = x.modPow(encipherKey.getPublicExponent(),
- encipherKey.getModulus());
- byte[] enc = y.toByteArray();
+ byte[] em = new byte[pos];
+ System.arraycopy(dataBuffer, 0, em, 0, pos);
+ byte[] dec = pkcs.encode(em, random);
+ logger.log (Component.CRYPTO, "RSA: produced padded plaintext\n{0}",
+ new ByteArray (dec));
+ BigInteger x = new BigInteger (1, dec);
+ BigInteger y = x.modPow (encipherKey.getPublicExponent (),
+ encipherKey.getModulus ());
+ byte[] enc = y.toByteArray ();
if (enc[0] == 0x00)
{
byte[] tmp = new byte[enc.length - 1];
@@ -298,7 +283,17 @@ public class RSACipherImpl
}
BigInteger dec = enc.modPow(decipherKey.getPrivateExponent(), n);
if (pubExp != null)
- dec = dec.multiply(r.modInverse(n)).mod(n);
- return dec.toByteArray();
+ {
+ dec = dec.multiply (r.modInverse (n)).mod (n);
+ }
+
+ byte[] decb = dec.toByteArray();
+ if (decb[0] != 0x00)
+ {
+ byte[] b = new byte[decb.length + 1];
+ System.arraycopy(decb, 0, b, 1, decb.length);
+ decb = b;
+ }
+ return decb;
}
}
diff --git a/libjava/classpath/gnu/javax/crypto/jce/cipher/CipherAdapter.java b/libjava/classpath/gnu/javax/crypto/jce/cipher/CipherAdapter.java
index b7cd755f5b4..0863b1f1c88 100644
--- a/libjava/classpath/gnu/javax/crypto/jce/cipher/CipherAdapter.java
+++ b/libjava/classpath/gnu/javax/crypto/jce/cipher/CipherAdapter.java
@@ -373,14 +373,24 @@ class CipherAdapter
engineInit(opmode, key, spec, random);
}
- protected byte[] engineUpdate(byte[] input, int off, int len)
+ protected byte[] engineUpdate(byte[] input, int inOff, int inLen)
{
+ if (inLen == 0) // nothing to process
+ return new byte[0];
final int blockSize = mode.currentBlockSize();
- final int count = (partLen + len) / blockSize;
- final byte[] out = new byte[count * blockSize];
+ int blockCount = (partLen + inLen) / blockSize;
+
+ // always keep data for unpadding in padded decryption mode;
+ // might even be a complete block
+ if (pad != null
+ && ((Integer) attributes.get(IMode.STATE)).intValue() == IMode.DECRYPTION
+ && (partLen + inLen) % blockSize == 0)
+ blockCount--;
+
+ final byte[] out = new byte[blockCount * blockSize];
try
{
- engineUpdate(input, off, len, out, 0);
+ engineUpdate(input, inOff, inLen, out, 0);
}
catch (ShortBufferException x) // should not happen
{
@@ -395,7 +405,15 @@ class CipherAdapter
if (inLen == 0) // nothing to process
return 0;
final int blockSize = mode.currentBlockSize();
- final int blockCount = (partLen + inLen) / blockSize;
+ int blockCount = (partLen + inLen) / blockSize;
+
+ // always keep data for unpadding in padded decryption mode;
+ // might even be a complete block
+ if (pad != null
+ && ((Integer) attributes.get(IMode.STATE)).intValue() == IMode.DECRYPTION
+ && (partLen + inLen) % blockSize == 0)
+ blockCount--;
+
final int result = blockCount * blockSize;
if (result > out.length - outOff)
throw new ShortBufferException();
@@ -447,16 +465,21 @@ class CipherAdapter
break;
case IMode.DECRYPTION:
int padLen;
+ byte[] buf3 = new byte[buf.length + partLen];
try
{
- padLen = pad.unpad(buf, 0, buf.length);
+ if (partLen != mode.currentBlockSize())
+ throw new WrongPaddingException();
+ System.arraycopy(buf, 0, buf3, 0, buf.length);
+ mode.update(partBlock, 0, buf3, buf.length);
+ padLen = pad.unpad(buf3, 0, buf3.length);
}
catch (WrongPaddingException wpe)
{
throw new BadPaddingException(wpe.getMessage());
}
- result = new byte[buf.length - padLen];
- System.arraycopy(buf, 0, result, 0, result.length);
+ result = new byte[buf3.length - padLen];
+ System.arraycopy(buf3, 0, result, 0, result.length);
break;
default:
throw new IllegalStateException();
diff --git a/libjava/classpath/gnu/javax/crypto/key/GnuPBEKey.java b/libjava/classpath/gnu/javax/crypto/key/GnuPBEKey.java
new file mode 100644
index 00000000000..6f4bcb1b37e
--- /dev/null
+++ b/libjava/classpath/gnu/javax/crypto/key/GnuPBEKey.java
@@ -0,0 +1,95 @@
+/* GnuPBEKey.java -- A password-based encryption key.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.crypto.key;
+
+import javax.crypto.interfaces.PBEKey;
+import javax.crypto.spec.PBEKeySpec;
+
+/**
+ * An implementation of a password-based encryption key.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class GnuPBEKey
+ implements PBEKey
+{
+ private final PBEKeySpec spec;
+
+ public GnuPBEKey (final PBEKeySpec spec)
+ {
+ if (spec == null)
+ throw new NullPointerException ();
+ this.spec = spec;
+ }
+
+ public GnuPBEKey (char[] password, byte[] salt, int iterationCount)
+ {
+ this (new PBEKeySpec (password, salt, iterationCount));
+ }
+
+ public int getIterationCount ()
+ {
+ return spec.getIterationCount ();
+ }
+
+ public char[] getPassword ()
+ {
+ return spec.getPassword ();
+ }
+
+ public byte[] getSalt ()
+ {
+ return spec.getSalt ();
+ }
+
+ public String getAlgorithm ()
+ {
+ return "PBE";
+ }
+
+ public String getFormat ()
+ {
+ return "NONE"; // FIXME?
+ }
+
+ public byte[] getEncoded ()
+ {
+ return null; // FIXME?
+ }
+}
diff --git a/libjava/classpath/gnu/javax/crypto/pad/PKCS7.java b/libjava/classpath/gnu/javax/crypto/pad/PKCS7.java
index bef1784eeb3..8fce5b8b0c6 100644
--- a/libjava/classpath/gnu/javax/crypto/pad/PKCS7.java
+++ b/libjava/classpath/gnu/javax/crypto/pad/PKCS7.java
@@ -100,8 +100,8 @@ public final class PKCS7
throws WrongPaddingException
{
int limit = offset + length;
- int result = in[limit - 1] & 0xFF;
- for (int i = 0; i < result; i++)
+ int result = in[--limit] & 0xFF;
+ for (int i = 0; i < result - 1; i++)
if (result != (in[--limit] & 0xFF))
throw new WrongPaddingException();
if (Configuration.DEBUG)
diff --git a/libjava/classpath/gnu/javax/management/Server.java b/libjava/classpath/gnu/javax/management/Server.java
new file mode 100644
index 00000000000..5501b4af7c0
--- /dev/null
+++ b/libjava/classpath/gnu/javax/management/Server.java
@@ -0,0 +1,2200 @@
+/* Server.java -- A GNU Classpath management server.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.management;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectStreamClass;
+import java.io.StreamCorruptedException;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.Attribute;
+import javax.management.AttributeList;
+import javax.management.AttributeNotFoundException;
+import javax.management.BadAttributeValueExpException;
+import javax.management.BadBinaryOpValueExpException;
+import javax.management.BadStringOperationException;
+import javax.management.DynamicMBean;
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.IntrospectionException;
+import javax.management.InvalidApplicationException;
+import javax.management.InvalidAttributeValueException;
+import javax.management.ListenerNotFoundException;
+import javax.management.MalformedObjectNameException;
+import javax.management.MBeanException;
+import javax.management.MBeanInfo;
+import javax.management.MBeanPermission;
+import javax.management.MBeanRegistration;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerDelegate;
+import javax.management.MBeanTrustPermission;
+import javax.management.NotCompliantMBeanException;
+import javax.management.Notification;
+import javax.management.NotificationBroadcaster;
+import javax.management.NotificationEmitter;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.management.ObjectInstance;
+import javax.management.ObjectName;
+import javax.management.OperationsException;
+import javax.management.QueryExp;
+import javax.management.ReflectionException;
+import javax.management.RuntimeOperationsException;
+import javax.management.StandardMBean;
+
+import javax.management.loading.ClassLoaderRepository;
+
+/**
+ * This class provides an {@link javax.management.MBeanServer}
+ * implementation for GNU Classpath.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class Server
+ implements MBeanServer
+{
+
+ /**
+ * The name of the delegate bean.
+ */
+ private static final ObjectName DELEGATE_NAME;
+
+ /**
+ * The registered beans, represented as a map of
+ * {@link javax.management.ObjectName}s to
+ * {@link java.lang.Object}s.
+ */
+ private final Map beans = new HashMap();
+
+ /**
+ * The default domain.
+ */
+ private String defaultDomain;
+
+ /**
+ * The outer server.
+ */
+ private MBeanServer outer;
+
+ /**
+ * The class loader repository.
+ */
+ private ClassLoaderRepository repository;
+
+ /**
+ * The map of listener delegates to the true
+ * listener.
+ */
+ private Map listeners;
+
+ /**
+ * Initialise the delegate name.
+ */
+ static
+ {
+ try
+ {
+ DELEGATE_NAME =
+ new ObjectName("JMImplementation:type=MBeanServerDelegate");
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw (Error)
+ (new InternalError("Failed to construct " +
+ "the delegate's object name.").initCause(e));
+ }
+ }
+
+ /**
+ * Constructs a new management server using the specified
+ * default domain, delegate bean and outer server.
+ *
+ * @param domain the default domain to use for beans constructed
+ * with no specified domain.
+ * @param outer an {@link javax.management.MBeanServer} to pass
+ * to beans implementing the {@link MBeanRegistration}
+ * interface, or <code>null</code> if <code>this</code>
+ * should be passed.
+ * @param delegate the delegate bean for this server.
+ */
+ public Server(String defaultDomain, MBeanServer outer,
+ MBeanServerDelegate delegate)
+ {
+ this.defaultDomain = defaultDomain;
+ this.outer = outer;
+ try
+ {
+ registerMBean(delegate, DELEGATE_NAME);
+ }
+ catch (InstanceAlreadyExistsException e)
+ {
+ throw (Error)
+ (new InternalError("The delegate bean is " +
+ "already registered.").initCause(e));
+ }
+ catch (MBeanRegistrationException e)
+ {
+ throw (Error)
+ (new InternalError("The delegate bean's preRegister " +
+ "methods threw an exception.").initCause(e));
+ }
+ catch (NotCompliantMBeanException e)
+ {
+ throw (Error)
+ (new InternalError("The delegate bean is " +
+ "not compliant.").initCause(e));
+ }
+ }
+
+ /**
+ * Checks for the necessary security privileges to perform an
+ * operation.
+ *
+ * @param name the name of the bean being accessed.
+ * @param member the name of the operation or attribute being
+ * accessed, or <code>null</code> if one is not
+ * involved.
+ * @param action the action being performed.
+ * @throws SecurityException if the action is denied.
+ */
+ private void checkSecurity(ObjectName name, String member,
+ String action)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ try
+ {
+ MBeanInfo info = null;
+ if (name != null)
+ {
+ Object bean = getBean(name);
+ Method method = bean.getClass().getMethod("getMBeanInfo", null);
+ info = (MBeanInfo) method.invoke(bean, null);
+ }
+ sm.checkPermission(new MBeanPermission((info == null) ?
+ null : info.getClassName(),
+ member, name, action));
+ }
+ catch (InstanceNotFoundException e)
+ {
+ throw (Error)
+ (new InternalError("Failed to get bean.").initCause(e));
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw (Error)
+ (new InternalError("Failed to get bean info.").initCause(e));
+ }
+ catch (IllegalAccessException e)
+ {
+ throw (Error)
+ (new InternalError("Failed to get bean info.").initCause(e));
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw (Error)
+ (new InternalError("Failed to get bean info.").initCause(e));
+ }
+ catch (InvocationTargetException e)
+ {
+ throw (Error)
+ (new InternalError("Failed to get bean info.").initCause(e));
+ }
+ }
+
+ /**
+ * Retrieves the specified bean.
+ *
+ * @param name the name of the bean.
+ * @return the bean.
+ * @throws InstanceNotFoundException if the name of the management bean
+ * could not be resolved.
+ */
+ private Object getBean(ObjectName name)
+ throws InstanceNotFoundException
+ {
+ ServerInfo bean = (ServerInfo) beans.get(name);
+ if (bean == null)
+ throw new InstanceNotFoundException("The bean, " + name +
+ ", was not found.");
+ return bean.getObject();
+ }
+
+ /**
+ * Registers the supplied listener with the specified management
+ * bean. Notifications emitted by the management bean are forwarded
+ * to the listener via the server, which will convert an MBean
+ * references in the source to a portable {@link ObjectName}
+ * instance. The notification is otherwise unchanged.
+ *
+ * @param name the name of the management bean with which the listener
+ * should be registered.
+ * @param listener the listener which will handle notifications from
+ * the bean.
+ * @param filter the filter to apply to incoming notifications, or
+ * <code>null</code> if no filtering should be applied.
+ * @param passback an object to be passed to the listener when a
+ * notification is emitted.
+ * @throws InstanceNotFoundException if the name of the management bean
+ * could not be resolved.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "addNotificationListener")</code>}.
+ * @see #removeNotificationListener(ObjectName, NotificationListener)
+ * @see #removeNotificationListener(ObjectName, NotificationListener,
+ * NotificationFilter, Object)
+ * @see NotificationBroadcaster#addNotificationListener(NotificationListener,
+ * NotificationFilter,
+ * Object)
+ */
+ public void addNotificationListener(ObjectName name, NotificationListener listener,
+ NotificationFilter filter, Object passback)
+ throws InstanceNotFoundException
+ {
+ Object bean = getBean(name);
+ checkSecurity(name, null, "addNotificationListener");
+ if (bean instanceof NotificationBroadcaster)
+ {
+ NotificationBroadcaster bbean = (NotificationBroadcaster) bean;
+ if (listeners == null)
+ listeners = new HashMap();
+ NotificationListener indirection = new ServerNotificationListener(bean, name,
+ listener);
+ bbean.addNotificationListener(indirection, filter, passback);
+ listeners.put(listener, indirection);
+ }
+ }
+
+ /**
+ * <p>
+ * Registers the supplied listener with the specified management
+ * bean. Notifications emitted by the management bean are forwarded
+ * to the listener via the server, which will convert any MBean
+ * references in the source to portable {@link ObjectName}
+ * instances. The notification is otherwise unchanged.
+ * </p>
+ * <p>
+ * The listener that receives notifications will be the one that is
+ * registered with the given name at the time this method is called.
+ * Even if it later unregisters and ceases to use that name, it will
+ * still receive notifications.
+ * </p>
+ *
+ * @param name the name of the management bean with which the listener
+ * should be registered.
+ * @param listener the name of the listener which will handle
+ * notifications from the bean.
+ * @param filter the filter to apply to incoming notifications, or
+ * <code>null</code> if no filtering should be applied.
+ * @param passback an object to be passed to the listener when a
+ * notification is emitted.
+ * @throws InstanceNotFoundException if the name of the management bean
+ * could not be resolved.
+ * @throws RuntimeOperationsException if the bean associated with the given
+ * object name is not a
+ * {@link NotificationListener}. This
+ * exception wraps an
+ * {@link IllegalArgumentException}.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "addNotificationListener")</code>}.
+ * @see #removeNotificationListener(ObjectName, NotificationListener)
+ * @see #removeNotificationListener(ObjectName, NotificationListener,
+ * NotificationFilter, Object)
+ * @see NotificationBroadcaster#addNotificationListener(NotificationListener,
+ * NotificationFilter,
+ * Object)
+ */
+ public void addNotificationListener(ObjectName name, ObjectName listener,
+ NotificationFilter filter, Object passback)
+ throws InstanceNotFoundException
+ {
+ Object lbean = getBean(listener);
+ if (!(lbean instanceof NotificationListener))
+ {
+ RuntimeException e =
+ new IllegalArgumentException("The supplied listener name does not " +
+ "correspond to a notification listener.");
+ throw new RuntimeOperationsException(e);
+ }
+ addNotificationListener(name, ((NotificationListener) lbean), filter, passback);
+ }
+
+ /**
+ * <p>
+ * Instantiates a new instance of the specified management bean
+ * using the default constructor and registers it with the server
+ * under the supplied name. The class is loaded using the
+ * {@link javax.management.loading.ClassLoaderRepository default
+ * loader repository} of the server.
+ * </p>
+ * <p>
+ * If the name supplied is <code>null</code>, then the bean is
+ * expected to implement the {@link MBeanRegistration} interface.
+ * The {@link MBeanRegistration#preRegister preRegister} method
+ * of this interface will be used to obtain the name in this case.
+ * </p>
+ * <p>
+ * This method is equivalent to calling {@link
+ * #createMBean(String, ObjectName, Object[], String[])
+ * <code>createMBean(className, name, (Object[]) null,
+ * (String[]) null)</code>} with <code>null</code> parameters
+ * and signature.
+ * </p>
+ *
+ * @param className the class of the management bean, of which
+ * an instance should be created.
+ * @param name the name to register the new bean with.
+ * @return an {@link ObjectInstance} containing the {@link ObjectName}
+ * and Java class name of the created instance.
+ * @throws ReflectionException if an exception occurs in creating
+ * an instance of the bean.
+ * @throws InstanceAlreadyExistsException if a matching instance
+ * already exists.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preRegister
+ * method.
+ * @throws MBeanException if the bean's constructor throws an exception.
+ * @throws NotCompliantMBeanException if the created bean is not
+ * compliant with the JMX specification.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> class name or object
+ * name or if the object name is a pattern.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply the
+ * use of the <code>instantiate</code>
+ * and <code>registerMBean</code> methods.
+ * @see #createMBean(String, ObjectName, Object[], String[])
+ */
+ public ObjectInstance createMBean(String className, ObjectName name)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException,
+ NotCompliantMBeanException
+ {
+ return createMBean(className, name, (Object[]) null, (String[]) null);
+ }
+
+ /**
+ * <p>
+ * Instantiates a new instance of the specified management bean
+ * using the given constructor and registers it with the server
+ * under the supplied name. The class is loaded using the
+ * {@link javax.management.loading.ClassLoaderRepository default
+ * loader repository} of the server.
+ * </p>
+ * <p>
+ * If the name supplied is <code>null</code>, then the bean is
+ * expected to implement the {@link MBeanRegistration} interface.
+ * The {@link MBeanRegistration#preRegister preRegister} method
+ * of this interface will be used to obtain the name in this case.
+ * </p>
+ *
+ * @param className the class of the management bean, of which
+ * an instance should be created.
+ * @param name the name to register the new bean with.
+ * @param params the parameters for the bean's constructor.
+ * @param sig the signature of the constructor to use.
+ * @return an {@link ObjectInstance} containing the {@link ObjectName}
+ * and Java class name of the created instance.
+ * @throws ReflectionException if an exception occurs in creating
+ * an instance of the bean.
+ * @throws InstanceAlreadyExistsException if a matching instance
+ * already exists.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preRegister
+ * method.
+ * @throws MBeanException if the bean's constructor throws an exception.
+ * @throws NotCompliantMBeanException if the created bean is not
+ * compliant with the JMX specification.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> class name or object
+ * name or if the object name is a pattern.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply the
+ * use of the <code>instantiate</code>
+ * and <code>registerMBean</code> methods.
+ */
+ public ObjectInstance createMBean(String className, ObjectName name,
+ Object[] params, String[] sig)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException,
+ NotCompliantMBeanException
+ {
+ return registerMBean(instantiate(className, params, sig), name);
+ }
+
+ /**
+ * <p>
+ * Instantiates a new instance of the specified management bean
+ * using the default constructor and registers it with the server
+ * under the supplied name. The class is loaded using the
+ * given class loader. If this argument is <code>null</code>,
+ * then the same class loader as was used to load the server
+ * is used.
+ * </p>
+ * <p>
+ * If the name supplied is <code>null</code>, then the bean is
+ * expected to implement the {@link MBeanRegistration} interface.
+ * The {@link MBeanRegistration#preRegister preRegister} method
+ * of this interface will be used to obtain the name in this case.
+ * </p>
+ * <p>
+ * This method is equivalent to calling {@link
+ * #createMBean(String, ObjectName, ObjectName, Object[], String)
+ * <code>createMBean(className, name, loaderName, (Object[]) null,
+ * (String) null)</code>} with <code>null</code> parameters
+ * and signature.
+ * </p>
+ *
+ * @param className the class of the management bean, of which
+ * an instance should be created.
+ * @param name the name to register the new bean with.
+ * @param loaderName the name of the class loader.
+ * @return an {@link ObjectInstance} containing the {@link ObjectName}
+ * and Java class name of the created instance.
+ * @throws ReflectionException if an exception occurs in creating
+ * an instance of the bean.
+ * @throws InstanceAlreadyExistsException if a matching instance
+ * already exists.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preRegister
+ * method.
+ * @throws MBeanException if the bean's constructor throws an exception.
+ * @throws NotCompliantMBeanException if the created bean is not
+ * compliant with the JMX specification.
+ * @throws InstanceNotFoundException if the specified class loader is not
+ * registered with the server.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> class name or object
+ * name or if the object name is a pattern.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply the
+ * use of the <code>instantiate</code>
+ * and <code>registerMBean</code> methods.
+ * @see #createMBean(String, ObjectName, ObjectName, Object[], String[])
+ */
+ public ObjectInstance createMBean(String className, ObjectName name,
+ ObjectName loaderName)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException,
+ NotCompliantMBeanException, InstanceNotFoundException
+ {
+ return createMBean(className, name, loaderName, (Object[]) null,
+ (String[]) null);
+ }
+
+ /**
+ * <p>
+ * Instantiates a new instance of the specified management bean
+ * using the given constructor and registers it with the server
+ * under the supplied name. The class is loaded using the
+ * given class loader. If this argument is <code>null</code>,
+ * then the same class loader as was used to load the server
+ * is used.
+ * </p>
+ * <p>
+ * If the name supplied is <code>null</code>, then the bean is
+ * expected to implement the {@link MBeanRegistration} interface.
+ * The {@link MBeanRegistration#preRegister preRegister} method
+ * of this interface will be used to obtain the name in this case.
+ * </p>
+ *
+ * @param className the class of the management bean, of which
+ * an instance should be created.
+ * @param name the name to register the new bean with.
+ * @param loaderName the name of the class loader.
+ * @param params the parameters for the bean's constructor.
+ * @param sig the signature of the constructor to use.
+ * @return an {@link ObjectInstance} containing the {@link ObjectName}
+ * and Java class name of the created instance.
+ * @throws ReflectionException if an exception occurs in creating
+ * an instance of the bean.
+ * @throws InstanceAlreadyExistsException if a matching instance
+ * already exists.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preRegister
+ * method.
+ * @throws MBeanException if the bean's constructor throws an exception.
+ * @throws NotCompliantMBeanException if the created bean is not
+ * compliant with the JMX specification.
+ * @throws InstanceNotFoundException if the specified class loader is not
+ * registered with the server.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> class name or object
+ * name or if the object name is a pattern.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply the
+ * use of the <code>instantiate</code>
+ * and <code>registerMBean</code> methods.
+ */
+ public ObjectInstance createMBean(String className, ObjectName name,
+ ObjectName loaderName, Object[] params,
+ String[] sig)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException,
+ NotCompliantMBeanException, InstanceNotFoundException
+ {
+ return registerMBean(instantiate(className, loaderName, params, sig),
+ name);
+ }
+
+ /**
+ * Deserializes a byte array using the class loader of the specified
+ * management bean as its context.
+ *
+ * @param name the name of the bean whose class loader should be used.
+ * @param data the byte array to be deserialized.
+ * @return the deserialized object stream.
+ * @deprecated {@link #getClassLoaderFor(ObjectName)} should be used
+ * to obtain the class loader of the bean, which can then
+ * be used to perform deserialization in the user's code.
+ * @throws InstanceNotFoundException if the specified bean is not
+ * registered with the server.
+ * @throws OperationsException if any I/O error is thrown by the
+ * deserialization process.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "getClassLoaderFor")</code>
+ */
+ public ObjectInputStream deserialize(ObjectName name, byte[] data)
+ throws InstanceNotFoundException, OperationsException
+ {
+ try
+ {
+ return new ServerInputStream(new ByteArrayInputStream(data),
+ getClassLoaderFor(name));
+ }
+ catch (IOException e)
+ {
+ throw new OperationsException("An I/O error occurred: " + e);
+ }
+ }
+
+ /**
+ * Deserializes a byte array using the same class loader for its context
+ * as was used to load the given class. This class loader is obtained by
+ * loading the specified class using the {@link
+ * javax.management.loading.ClassLoaderRepository Class Loader Repository}
+ * and then using the class loader of the resulting {@link Class} instance.
+ *
+ * @param name the name of the class which should be loaded to obtain the
+ * class loader.
+ * @param data the byte array to be deserialized.
+ * @return the deserialized object stream.
+ * @deprecated {@link #getClassLoaderRepository} should be used
+ * to obtain the class loading repository, which can then
+ * be used to obtain the {@link Class} instance and deserialize
+ * the array using its class loader.
+ * @throws OperationsException if any I/O error is thrown by the
+ * deserialization process.
+ * @throws ReflectionException if an error occurs in obtaining the
+ * {@link Class} instance.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(null, null, null,
+ * "getClassLoaderRepository")</code>
+ */
+ public ObjectInputStream deserialize(String name, byte[] data)
+ throws OperationsException, ReflectionException
+ {
+ try
+ {
+ Class c = getClassLoaderRepository().loadClass(name);
+ return new ServerInputStream(new ByteArrayInputStream(data),
+ c.getClassLoader());
+ }
+ catch (IOException e)
+ {
+ throw new OperationsException("An I/O error occurred: " + e);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new ReflectionException(e, "The class could not be found.");
+ }
+ }
+
+ /**
+ * Deserializes a byte array using the same class loader for its context
+ * as was used to load the given class. The name of the class loader to
+ * be used is supplied, and may be <code>null</code> if the server's
+ * class loader should be used instead.
+ *
+ * @param name the name of the class which should be loaded to obtain the
+ * class loader.
+ * @param loader the name of the class loader to use, or <code>null</code>
+ * if the class loader of the server should be used.
+ * @param data the byte array to be deserialized.
+ * @return the deserialized object stream.
+ * @deprecated {@link #getClassLoader(ObjectName} can be used to obtain
+ * the named class loader and deserialize the array.
+ * @throws InstanceNotFoundException if the specified class loader is not
+ * registered with the server.
+ * @throws OperationsException if any I/O error is thrown by the
+ * deserialization process.
+ * @throws ReflectionException if an error occurs in obtaining the
+ * {@link Class} instance.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, loader,
+ * "getClassLoader")</code>
+ */
+ public ObjectInputStream deserialize(String name, ObjectName loader, byte[] data)
+ throws InstanceNotFoundException, ReflectionException,
+ OperationsException
+ {
+ try
+ {
+ Class c = getClassLoader(loader).loadClass(name);
+ return new ServerInputStream(new ByteArrayInputStream(data),
+ c.getClassLoader());
+ }
+ catch (IOException e)
+ {
+ throw new OperationsException("An I/O error occurred: " + e);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new ReflectionException(e, "The class could not be found.");
+ }
+ }
+
+ /**
+ * Returns the value of the supplied attribute from the specified
+ * management bean.
+ *
+ * @param bean the bean to retrieve the value from.
+ * @param name the name of the attribute to retrieve.
+ * @return the value of the attribute.
+ * @throws AttributeNotFoundException if the attribute could not be
+ * accessed from the bean.
+ * @throws MBeanException if the management bean's accessor throws
+ * an exception.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ReflectionException if an exception was thrown in trying
+ * to invoke the bean's accessor.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean or attribute
+ * name.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, name, bean,
+ * "getAttribute")</code>}.
+ * @see DynamicMBean#getAttribute(String)
+ */
+ public Object getAttribute(ObjectName bean, String name)
+ throws MBeanException, AttributeNotFoundException,
+ InstanceNotFoundException, ReflectionException
+ {
+ if (bean == null || name == null)
+ {
+ RuntimeException e =
+ new IllegalArgumentException("One of the supplied arguments was null.");
+ throw new RuntimeOperationsException(e);
+ }
+ Object abean = getBean(bean);
+ checkSecurity(bean, name, "getAttribute");
+ if (abean instanceof DynamicMBean)
+ return ((DynamicMBean) abean).getAttribute(name);
+ else
+ try
+ {
+ return new StandardMBean(abean, null).getAttribute(name);
+ }
+ catch (NotCompliantMBeanException e)
+ {
+ throw (Error)
+ (new InternalError("Failed to create dynamic bean.").initCause(e));
+ }
+ }
+
+
+ /**
+ * Returns the values of the named attributes from the specified
+ * management bean.
+ *
+ * @param bean the bean to retrieve the value from.
+ * @param names the names of the attributes to retrieve.
+ * @return the values of the attributes.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ReflectionException if an exception was thrown in trying
+ * to invoke the bean's accessor.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean or attribute
+ * name.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, bean,
+ * "getAttribute")</code>}. Additionally,
+ * for an attribute name, <code>n</code>, the
+ * caller's permission must imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, n, bean,
+ * "getAttribute")</code>} or that attribute will
+ * not be included.
+ *
+ * @see DynamicMBean#getAttributes(String[])
+ */
+ public AttributeList getAttributes(ObjectName bean, String[] names)
+ throws InstanceNotFoundException, ReflectionException
+ {
+ if (bean == null || names == null)
+ {
+ RuntimeException e =
+ new IllegalArgumentException("One of the supplied arguments was null.");
+ throw new RuntimeOperationsException(e);
+ }
+ Object abean = getBean(bean);
+ checkSecurity(bean, null, "getAttribute");
+ AttributeList list = new AttributeList(names.length);
+ for (int a = 0; a < names.length; ++a)
+ {
+ if (names[a] == null)
+ {
+ RuntimeException e =
+ new IllegalArgumentException("Argument " + a + " was null.");
+ throw new RuntimeOperationsException(e);
+ }
+ checkSecurity(bean, names[a], "getAttribute");
+ try
+ {
+ Object value;
+ if (abean instanceof DynamicMBean)
+ value = ((DynamicMBean) abean).getAttribute(names[a]);
+ else
+ try
+ {
+ value = new StandardMBean(abean, null).getAttribute(names[a]);
+ }
+ catch (NotCompliantMBeanException e)
+ {
+ throw (Error)
+ (new InternalError("Failed to create dynamic bean.").initCause(e));
+ }
+ list.add(new Attribute(names[a], value));
+ }
+ catch (AttributeNotFoundException e)
+ {
+ /* Ignored */
+ }
+ catch (MBeanException e)
+ {
+ /* Ignored */
+ }
+ }
+ return list;
+ }
+
+
+ /**
+ * Returns the specified class loader. If the specified value is
+ * <code>null</code>, then the class loader of the server will be
+ * returned. If <code>l</code> is the requested class loader,
+ * and <code>r</code> is the actual class loader returned, then
+ * either <code>l</code> and <code>r</code> will be identical,
+ * or they will at least return the same class from
+ * {@link ClassLoader#loadClass(String)} for any given string.
+ * They may not be identical due to one or the other
+ * being wrapped in another class loader (e.g. for security).
+ *
+ * @param name the name of the class loader to return.
+ * @return the class loader.
+ * @throws InstanceNotFoundException if the class loader can not
+ * be found.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "getClassLoader")</code>
+ */
+ public ClassLoader getClassLoader(ObjectName name)
+ throws InstanceNotFoundException
+ {
+ if (name == null)
+ {
+ checkSecurity(null, null, "getClassLoader");
+ return getClass().getClassLoader();
+ }
+ Object bean = getBean(name);
+ checkSecurity(name, null, "getClassLoader");
+ return (ClassLoader) bean;
+ }
+
+ /**
+ * Returns the class loader of the specified management bean. If
+ * <code>l</code> is the requested class loader, and <code>r</code>
+ * is the actual class loader returned, then either <code>l</code>
+ * and <code>r</code> will be identical, or they will at least
+ * return the same class from {@link ClassLoader#loadClass(String)}
+ * for any given string. They may not be identical due to one or
+ * the other being wrapped in another class loader (e.g. for
+ * security).
+ *
+ * @param name the name of the bean whose class loader should be
+ * returned.
+ * @return the class loader.
+ * @throws InstanceNotFoundException if the bean is not registered
+ * with the server.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "getClassLoaderFor")</code>
+ */
+ public ClassLoader getClassLoaderFor(ObjectName name)
+ throws InstanceNotFoundException
+ {
+ Object bean = getBean(name);
+ checkSecurity(name, null, "getClassLoaderFor");
+ return bean.getClass().getClassLoader();
+ }
+
+ /**
+ * Returns the class loader repository used by this server.
+ *
+ * @return the class loader repository.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(null, null, null,
+ * "getClassLoaderRepository")</code>
+ */
+ public ClassLoaderRepository getClassLoaderRepository()
+ {
+ return repository;
+ }
+
+ /**
+ * Returns the default domain this server applies to beans that have
+ * no specified domain.
+ *
+ * @return the default domain.
+ */
+ public String getDefaultDomain()
+ {
+ return defaultDomain;
+ }
+
+
+ /**
+ * Returns an array containing all the domains used by beans registered
+ * with this server. The ordering of the array is undefined.
+ *
+ * @return the list of domains.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(null, null, name,
+ * "getDomains")</code>}. Additionally,
+ * for an domain, <code>d</code>, the
+ * caller's permission must imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(null, null,
+ * new ObjectName("d:x=x"), "getDomains")</code>}
+ * or that domain will not be included. Note
+ * that "x=x" is an arbitrary key-value pair
+ * provided to satisfy the constructor.
+ * @see ObjectName#getDomain()
+ */
+ public String[] getDomains()
+ {
+ checkSecurity(null, null, "getDomains");
+ Set domains = new HashSet();
+ Iterator iterator = beans.keySet().iterator();
+ while (iterator.hasNext())
+ {
+ String d = ((ObjectName) iterator.next()).getDomain();
+ try
+ {
+ checkSecurity(new ObjectName(d + ":x=x"), null, "getDomains");
+ domains.add(d);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ /* Ignored */
+ }
+ }
+ return (String[]) domains.toArray(new String[domains.size()]);
+ }
+
+ /**
+ * Returns the number of management beans registered with this server.
+ * This may be less than the real number if the caller's access is
+ * restricted.
+ *
+ * @return the number of registered beans.
+ */
+ public Integer getMBeanCount()
+ {
+ return Integer.valueOf(beans.size());
+ }
+
+ /**
+ * Returns information on the given management bean.
+ *
+ * @param name the name of the management bean.
+ * @return an instance of {@link MBeanInfo} for the bean.
+ * @throws IntrospectionException if an exception occurs in examining
+ * the bean.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ReflectionException if an exception occurs when trying
+ * to invoke {@link DynamicMBean#getMBeanInfo()}
+ * on the bean.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "getMBeanInfo")</code>}.
+ * @see DynamicMBean#getMBeanInfo()
+ */
+ public MBeanInfo getMBeanInfo(ObjectName name)
+ throws InstanceNotFoundException, IntrospectionException,
+ ReflectionException
+ {
+ Object bean = getBean(name);
+ checkSecurity(name, null, "getMBeanInfo");
+ try
+ {
+ Method method = bean.getClass().getMethod("getMBeanInfo", null);
+ return (MBeanInfo) method.invoke(bean, null);
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw new IntrospectionException("The getMBeanInfo method " +
+ "could not be found.");
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new ReflectionException(e, "Failed to call getMBeanInfo");
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new ReflectionException(e, "Failed to call getMBeanInfo");
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new ReflectionException(e, "The method threw an exception");
+ }
+ }
+
+ /**
+ * Returns the {@link ObjectInstance} created for the specified
+ * management bean on registration.
+ *
+ * @param name the name of the bean.
+ * @return the corresponding {@link ObjectInstance} instance.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "getObjectInstance")</code>
+ * @see #createMBean(String, ObjectName)
+ */
+ public ObjectInstance getObjectInstance(ObjectName name)
+ throws InstanceNotFoundException
+ {
+ ServerInfo bean = (ServerInfo) beans.get(name);
+ if (bean == null)
+ throw new InstanceNotFoundException("The bean, " + name +
+ ", was not found.");
+ return bean.getInstance();
+ }
+
+ /**
+ * <p>
+ * Creates an instance of the specified class using the list of
+ * class loaders from the {@link
+ * javax.management.loading.ClassLoaderRepository Class Loader
+ * Repository}. The class should have a public constructor
+ * with no arguments. A reference to the new instance is returned,
+ * but the instance is not yet registered with the server.
+ * </p>
+ * <p>
+ * This method is equivalent to calling {@link
+ * #instantiate(String, Object[], String[])
+ * <code>instantiate(name, (Object[]) null, (String[]) null)</code>}
+ * with <code>null</code> parameters and signature.
+ * </p>
+ *
+ * @param name the name of the class of bean to be instantiated.
+ * @return an instance of the given class.
+ * @throws ReflectionException if an exception is thrown during
+ * loading the class or calling the
+ * constructor.
+ * @throws MBeanException if the constructor throws an exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> name.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, null,
+ * "instantiate")</code>}.
+ * @see #instantiate(String, Object[], String[])
+ */
+ public Object instantiate(String name)
+ throws ReflectionException, MBeanException
+ {
+ return instantiate(name, (Object[]) null, (String[]) null);
+ }
+
+ /**
+ * Creates an instance of the specified class using the list of
+ * class loaders from the {@link
+ * javax.management.loading.ClassLoaderRepository Class Loader
+ * Repository}. The class should have a public constructor
+ * matching the supplied signature. A reference to the new
+ * instance is returned, but the instance is not yet
+ * registered with the server.
+ *
+ * @param name the name of the class of bean to be instantiated.
+ * @param params the parameters for the constructor.
+ * @param sig the signature of the constructor.
+ * @return an instance of the given class.
+ * @throws ReflectionException if an exception is thrown during
+ * loading the class or calling the
+ * constructor.
+ * @throws MBeanException if the constructor throws an exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> name.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, null,
+ * "instantiate")</code>}.
+ */
+ public Object instantiate(String name, Object[] params, String[] sig)
+ throws ReflectionException, MBeanException
+ {
+ checkSecurity(null, null, "instantiate");
+ if (name == null)
+ {
+ RuntimeException e =
+ new IllegalArgumentException("The name was null.");
+ throw new RuntimeOperationsException(e);
+ }
+ Class[] sigTypes = new Class[sig.length];
+ for (int a = 0; a < sigTypes.length; ++a)
+ {
+ try
+ {
+ sigTypes[a] = repository.loadClass(sig[a]);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new ReflectionException(e, "The class, " + sigTypes[a] +
+ ", in the method signature " +
+ "could not be loaded.");
+ }
+ }
+ try
+ {
+ Constructor cons =
+ repository.loadClass(name).getConstructor(sigTypes);
+ return cons.newInstance(params);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new ReflectionException(e, "The class, " + name +
+ ", of the constructor " +
+ "could not be loaded.");
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw new ReflectionException(e, "The method, " + name +
+ ", could not be found.");
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new ReflectionException(e, "Failed to instantiate the object");
+ }
+ catch (InstantiationException e)
+ {
+ throw new ReflectionException(e, "Failed to instantiate the object");
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new MBeanException((Exception) e.getCause(), "The constructor "
+ + name + " threw an exception");
+ }
+ }
+
+ /**
+ * <p>
+ * Creates an instance of the specified class using the supplied
+ * class loader. If the class loader given is <code>null</code>,
+ * then the class loader of the server will be used. The class
+ * should have a public constructor with no arguments. A reference
+ * to the new instance is returned, but the instance is not yet
+ * registered with the server.
+ * </p>
+ * <p>
+ * This method is equivalent to calling {@link
+ * #instantiate(String, ObjectName, Object[], String[])
+ * <code>instantiate(name, loaderName, (Object[]) null,
+ * (String[]) null)</code>} with <code>null</code> parameters
+ * and signature.
+ * </p>
+ *
+ * @param name the name of the class of bean to be instantiated.
+ * @param loaderName the name of the class loader to use.
+ * @return an instance of the given class.
+ * @throws InstanceNotFoundException if the class loader is not
+ * registered with the server.
+ * @throws ReflectionException if an exception is thrown during
+ * loading the class or calling the
+ * constructor.
+ * @throws MBeanException if the constructor throws an exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> name.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, null,
+ * "instantiate")</code>}.
+ * @see #instantiate(String, Object[], String[])
+ */
+ public Object instantiate(String name, ObjectName loaderName)
+ throws InstanceNotFoundException, ReflectionException,
+ MBeanException
+ {
+ return instantiate(name, loaderName);
+ }
+
+ /**
+ * Creates an instance of the specified class using the supplied
+ * class loader. If the class loader given is <code>null</code>,
+ * then the class loader of the server will be used. The class
+ * should have a public constructor matching the supplied
+ * signature. A reference to the new instance is returned,
+ * but the instance is not yet registered with the server.
+ *
+ * @param name the name of the class of bean to be instantiated.
+ * @param loaderName the name of the class loader to use.
+ * @param params the parameters for the constructor.
+ * @param sig the signature of the constructor.
+ * @return an instance of the given class.
+ * @throws InstanceNotFoundException if the class loader is not
+ * registered with the server.
+ * @throws ReflectionException if an exception is thrown during
+ * loading the class or calling the
+ * constructor.
+ * @throws MBeanException if the constructor throws an exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> name.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, null,
+ * "instantiate")</code>}.
+ */
+ public Object instantiate(String name, ObjectName loaderName,
+ Object[] params, String[] sig)
+ throws InstanceNotFoundException, ReflectionException,
+ MBeanException
+ {
+ checkSecurity(null, null, "instantiate");
+ if (name == null)
+ {
+ RuntimeException e =
+ new IllegalArgumentException("The name was null.");
+ throw new RuntimeOperationsException(e);
+ }
+ ClassLoader loader = getClassLoader(loaderName);
+ Class[] sigTypes = new Class[sig.length];
+ for (int a = 0; a < sig.length; ++a)
+ {
+ try
+ {
+ sigTypes[a] = Class.forName(sig[a], true, loader);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new ReflectionException(e, "The class, " + sig[a] +
+ ", in the method signature " +
+ "could not be loaded.");
+ }
+ }
+ try
+ {
+ Constructor cons =
+ Class.forName(name, true, loader).getConstructor(sigTypes);
+ return cons.newInstance(params);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new ReflectionException(e, "The class, " + name +
+ ", of the constructor " +
+ "could not be loaded.");
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw new ReflectionException(e, "The method, " + name +
+ ", could not be found.");
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new ReflectionException(e, "Failed to instantiate the object");
+ }
+ catch (InstantiationException e)
+ {
+ throw new ReflectionException(e, "Failed to instantiate the object");
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new MBeanException((Exception) e.getCause(), "The constructor "
+ + name + " threw an exception");
+ }
+ }
+
+ /**
+ * Invokes the supplied operation on the specified management
+ * bean. The class objects specified in the signature are loaded
+ * using the same class loader as was used for the management bean.
+ *
+ * @param bean the management bean whose operation should be invoked.
+ * @param name the name of the operation to invoke.
+ * @param params the parameters of the operation.
+ * @param sig the signature of the operation.
+ * @return the return value of the method.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws MBeanException if the method invoked throws an exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> name.
+ * @throws ReflectionException if an exception is thrown in invoking the
+ * method.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, name, bean,
+ * "invoke")</code>}.
+ * @see DynamicMBean#invoke(String, Object[], String[])
+ */
+ public Object invoke(ObjectName bean, String name, Object[] params, String[] sig)
+ throws InstanceNotFoundException, MBeanException,
+ ReflectionException
+ {
+ if (bean == null)
+ {
+ RuntimeException e =
+ new IllegalArgumentException("The bean was null.");
+ throw new RuntimeOperationsException(e);
+ }
+ Object abean = getBean(bean);
+ checkSecurity(bean, name, "invoke");
+ if (abean instanceof DynamicMBean)
+ return ((DynamicMBean) abean).invoke(name, params, sig);
+ else
+ try
+ {
+ return new StandardMBean(abean, null).invoke(name, params, sig);
+ }
+ catch (NotCompliantMBeanException e)
+ {
+ throw (Error)
+ (new InternalError("Failed to create dynamic bean.").initCause(e));
+ }
+ }
+
+ /**
+ * <p>
+ * Returns true if the specified management bean is an instance
+ * of the supplied class.
+ * </p>
+ * <p>
+ * A bean, B, is an instance of a class, C, if either of the following
+ * conditions holds:
+ * </p>
+ * <ul>
+ * <li>The class name in B's {@link MBeanInfo} is equal to the supplied
+ * name.</li>
+ * <li>Both the class of B and C were loaded by the same class loader,
+ * and B is assignable to C.</li>
+ * </ul>
+ *
+ * @param name the name of the management bean.
+ * @param className the name of the class to test if <code>name</code> is
+ * an instance of.
+ * @return true if either B is directly an instance of the named class,
+ * or B is assignable to the class, given that both it and B's
+ * current class were loaded using the same class loader.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "isInstanceOf")</code>
+ */
+ public boolean isInstanceOf(ObjectName name, String className)
+ throws InstanceNotFoundException
+ {
+ Object bean = getBean(name);
+ checkSecurity(name, null, "isInstanceOf");
+ MBeanInfo info;
+ if (bean instanceof DynamicMBean)
+ info = ((DynamicMBean) bean).getMBeanInfo();
+ else
+ try
+ {
+ info = new StandardMBean(bean, null).getMBeanInfo();
+ }
+ catch (NotCompliantMBeanException e)
+ {
+ throw (Error)
+ (new InternalError("Failed to create dynamic bean.").initCause(e));
+ }
+ if (info.getClassName().equals(className))
+ return true;
+ Class bclass = bean.getClass();
+ try
+ {
+ Class oclass = Class.forName(className);
+ return (bclass.getClassLoader().equals(oclass.getClassLoader()) &&
+ oclass.isAssignableFrom(bclass));
+ }
+ catch (ClassNotFoundException e)
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Returns true if the specified management bean is registered with
+ * the server.
+ *
+ * @param name the name of the management bean.
+ * @return true if the bean is registered.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean name.
+ */
+ public boolean isRegistered(ObjectName name)
+ {
+ if (name == null)
+ {
+ RuntimeException e =
+ new IllegalArgumentException("The name was null.");
+ throw new RuntimeOperationsException(e);
+ }
+ return beans.containsKey(name);
+ }
+
+ /**
+ * <p>
+ * Returns a set of {@link ObjectInstance}s matching the specified
+ * criteria. The full set of beans registered with the server
+ * are passed through two filters:
+ * </p>
+ * <ol>
+ * <li>Pattern matching is performed using the supplied
+ * {@link ObjectName}.</li>
+ * <li>The supplied query expression is applied.</li>
+ * </ol>
+ * <p>
+ * If both the object name and the query expression are <code>null</code>,
+ * or the object name has no domain and no key properties,
+ * no filtering will be performed and all beans are returned.
+ * </p>
+ *
+ * @param name an {@link ObjectName} to use as a filter.
+ * @param query a query expression to apply to each of the beans that match
+ * the given object name.
+ * @return a set of {@link ObjectInstance}s matching the filtered beans.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(null, null, name,
+ * "queryMBeans")</code>}. Additionally,
+ * for an bean, <code>b</code>, the
+ * caller's permission must imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, b, name,
+ * "queryMBeans")</code>} or that bean will
+ * not be included. Such an exception may also
+ * arise from the execution of the query, in which
+ * case that particular bean will again be excluded.
+ */
+ public Set queryMBeans(ObjectName name, QueryExp query)
+ {
+ checkSecurity(name, null, "queryMBeans");
+ Set results = new HashSet();
+ Iterator iterator = beans.entrySet().iterator();
+ while (iterator.hasNext())
+ {
+ Map.Entry entry = (Map.Entry) iterator.next();
+ ObjectName nextName = (ObjectName) entry.getKey();
+ checkSecurity(name, nextName.toString(), "queryMBeans");
+ try
+ {
+ if ((name == null || name.apply(nextName)) &&
+ (query == null || query.apply(nextName)))
+ results.add(((ServerInfo) entry.getValue()).getInstance());
+ }
+ catch (BadStringOperationException e)
+ {
+ /* Ignored -- assume false result */
+ }
+ catch (BadBinaryOpValueExpException e)
+ {
+ /* Ignored -- assume false result */
+ }
+ catch (BadAttributeValueExpException e)
+ {
+ /* Ignored -- assume false result */
+ }
+ catch (InvalidApplicationException e)
+ {
+ /* Ignored -- assume false result */
+ }
+ }
+ return results;
+ }
+
+ /**
+ * <p>
+ * Returns a set of {@link ObjectName}s matching the specified
+ * criteria. The full set of beans registered with the server
+ * are passed through two filters:
+ * </p>
+ * <ol>
+ * <li>Pattern matching is performed using the supplied
+ * {@link ObjectName}.</li>
+ * <li>The supplied query expression is applied.</li>
+ * </ol>
+ * <p>
+ * If both the object name and the query expression are <code>null</code>,
+ * or the object name has no domain and no key properties,
+ * no filtering will be performed and all beans are returned.
+ * </p>
+ *
+ * @param name an {@link ObjectName} to use as a filter.
+ * @param query a query expression to apply to each of the beans that match
+ * the given object name.
+ * @return a set of {@link ObjectName}s matching the filtered beans.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(null, null, name,
+ * "queryNames")</code>}. Additionally,
+ * for an name, <code>n</code>, the
+ * caller's permission must imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, n, name,
+ * "queryNames")</code>} or that name will
+ * not be included. Such an exception may also
+ * arise from the execution of the query, in which
+ * case that particular bean will again be excluded.
+ * Note that these permissions are implied if the
+ * <code>queryMBeans</code> permissions are available.
+ */
+ public Set queryNames(ObjectName name, QueryExp query)
+ {
+ checkSecurity(name, null, "queryNames");
+ Set results = new HashSet();
+ Iterator iterator = beans.entrySet().iterator();
+ while (iterator.hasNext())
+ {
+ Map.Entry entry = (Map.Entry) iterator.next();
+ ObjectName nextName = (ObjectName) entry.getKey();
+ checkSecurity(name, nextName.toString(), "queryNames");
+ try
+ {
+ if ((name == null || name.apply(nextName)) &&
+ (query == null || query.apply(nextName)))
+ results.add(nextName);
+ }
+ catch (BadStringOperationException e)
+ {
+ /* Ignored -- assume false result */
+ }
+ catch (BadBinaryOpValueExpException e)
+ {
+ /* Ignored -- assume false result */
+ }
+ catch (BadAttributeValueExpException e)
+ {
+ /* Ignored -- assume false result */
+ }
+ catch (InvalidApplicationException e)
+ {
+ /* Ignored -- assume false result */
+ }
+ }
+ return results;
+ }
+
+ /**
+ * Registers the supplied instance with the server, using the specified
+ * {@link ObjectName}. If the name given is <code>null</code>, then
+ * the bean supplied is expected to implement the {@link MBeanRegistration}
+ * interface and provide the name via the
+ * {@link MBeanRegistration#preRegister preRegister} method
+ * of this interface.
+ *
+ * @param obj the object to register with the server.
+ * @param name the name under which to register the object,
+ * or <code>null</code> if the {@link MBeanRegistration}
+ * interface should be used.
+ * @return an {@link ObjectInstance} containing the supplied
+ * {@link ObjectName} along with the name of the bean's class.
+ * @throws InstanceAlreadyExistsException if a matching instance
+ * already exists.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preRegister
+ * method.
+ * @throws NotCompliantMBeanException if the created bean is not
+ * compliant with the JMX specification.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> object.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "registerMBean")</code>}. <code>className</code>
+ * here corresponds to the result of
+ * {@link MBeanInfo#getClassName()} for objects of
+ * this class. If this check succeeds, a check
+ * is also made on its
+ * {@link java.security.ProtectionDomain} to ensure
+ * it implies {@link MBeanTrustPermission(String)
+ * <code>MBeanTrustPermission("register")</code>}.
+ * The use of the {@link MBeanRegistration} interface
+ * results in another {@link MBeanPermission} check
+ * being made on the returned {@link ObjectName}.
+ */
+ public ObjectInstance registerMBean(Object obj, ObjectName name)
+ throws InstanceAlreadyExistsException, MBeanRegistrationException,
+ NotCompliantMBeanException
+ {
+ SecurityManager sm = System.getSecurityManager();
+ Class cl = obj.getClass();
+ String className = cl.getName();
+ if (sm != null)
+ {
+ sm.checkPermission(new MBeanPermission(className, null, name,
+ "registerMBean"));
+ if (!(cl.getProtectionDomain().implies(new MBeanTrustPermission("register"))))
+ throw new SecurityException("The protection domain of the object's class" +
+ "does not imply the trust permission," +
+ "register");
+ }
+ if (obj == null)
+ {
+ RuntimeException e =
+ new IllegalArgumentException("The object was null.");
+ throw new RuntimeOperationsException(e);
+ }
+ MBeanRegistration register = null;
+ if (obj instanceof MBeanRegistration)
+ register = (MBeanRegistration) obj;
+ if (name == null)
+ {
+ if (register == null)
+ {
+ RuntimeException e =
+ new IllegalArgumentException("The name was null and " +
+ "the bean does not implement " +
+ "MBeanRegistration.");
+ throw new RuntimeOperationsException(e);
+ }
+ try
+ {
+ name = register.preRegister(this, null);
+ if (sm != null)
+ sm.checkPermission(new MBeanPermission(className, null, name,
+ "registerMBean"));
+ }
+ catch (SecurityException e)
+ {
+ register.postRegister(Boolean.FALSE);
+ throw e;
+ }
+ catch (Exception e)
+ {
+ register.postRegister(Boolean.FALSE);
+ throw new MBeanRegistrationException(e, "Pre-registration failed.");
+ }
+ }
+ if (beans.containsKey(name))
+ {
+ if (register != null)
+ register.postRegister(Boolean.FALSE);
+ throw new InstanceAlreadyExistsException(name + "is already registered.");
+ }
+ ObjectInstance obji = new ObjectInstance(name, className);
+ beans.put(name, new ServerInfo(obji, obj));
+ if (register != null)
+ register.postRegister(Boolean.TRUE);
+ return obji;
+ }
+
+ /**
+ * Removes the specified listener from the list of recipients
+ * of notifications from the supplied bean. This includes all
+ * combinations of filters and passback objects registered for
+ * this listener. For more specific removal of listeners, see
+ * {@link #removeNotificationListener(ObjectName,
+ * NotificationListener,NotificationFilter,Object)}
+ *
+ * @param name the name of the management bean from which the
+ * listener should be removed.
+ * @param listener the listener to remove.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ListenerNotFoundException if the specified listener
+ * is not registered with the bean.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "removeNotificationListener")</code>}.
+ * @see #addNotificationListener(NotificationListener, NotificationFilter,
+ * java.lang.Object)
+ * @see NotificationBroadcaster#removeNotificationListener(NotificationListener)
+ */
+ public void removeNotificationListener(ObjectName name,
+ NotificationListener listener)
+ throws InstanceNotFoundException, ListenerNotFoundException
+ {
+ Object bean = getBean(name);
+ checkSecurity(name, null, "removeNotificationListener");
+ if (bean instanceof NotificationBroadcaster)
+ {
+ NotificationBroadcaster bbean = (NotificationBroadcaster) bean;
+ NotificationListener indirection = (NotificationListener)
+ listeners.get(listener);
+ if (indirection == null)
+ bbean.removeNotificationListener(listener);
+ else
+ {
+ bbean.removeNotificationListener(indirection);
+ listeners.remove(listener);
+ }
+ }
+ }
+
+ /**
+ * Removes the specified listener from the list of recipients
+ * of notifications from the supplied bean. Only the first instance with
+ * the supplied filter and passback object is removed.
+ * <code>null</code> is used as a valid value for these parameters,
+ * rather than as a way to remove all registration instances for
+ * the specified listener; for this behaviour instead, see
+ * {@link #removeNotificationListener(ObjectName, NotificationListener)}.
+ *
+ * @param name the name of the management bean from which the
+ * listener should be removed.
+ * @param listener the listener to remove.
+ * @param filter the filter of the listener to remove.
+ * @param passback the passback object of the listener to remove.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ListenerNotFoundException if the specified listener
+ * is not registered with the bean.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "removeNotificationListener")</code>}.
+ * @see #addNotificationListener(ObjectName, NotificationListener,
+ * NotificationFilter, Object)
+ * @see NotificationEmitter#removeNotificationListener(NotificationListener,
+ * NotificationFilter,
+ * Object)
+ */
+ public void removeNotificationListener(ObjectName name,
+ NotificationListener listener,
+ NotificationFilter filter,
+ Object passback)
+ throws InstanceNotFoundException, ListenerNotFoundException
+ {
+ Object bean = getBean(name);
+ checkSecurity(name, null, "removeNotificationListener");
+ if (bean instanceof NotificationEmitter)
+ {
+ NotificationEmitter bbean = (NotificationEmitter) bean;
+ NotificationListener indirection = (NotificationListener)
+ listeners.get(listener);
+ if (indirection == null)
+ bbean.removeNotificationListener(listener, filter, passback);
+ else
+ {
+ bbean.removeNotificationListener(indirection, filter, passback);
+ listeners.remove(listener);
+ }
+ }
+ }
+
+ /**
+ * Removes the specified listener from the list of recipients
+ * of notifications from the supplied bean. This includes all
+ * combinations of filters and passback objects registered for
+ * this listener. For more specific removal of listeners, see
+ * {@link #removeNotificationListener(ObjectName,
+ * ObjectName,NotificationFilter,Object)}
+ *
+ * @param name the name of the management bean from which the
+ * listener should be removed.
+ * @param listener the name of the listener to remove.
+ * @throws InstanceNotFoundException if a name doesn't match a registered
+ * bean.
+ * @throws ListenerNotFoundException if the specified listener
+ * is not registered with the bean.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "removeNotificationListener")</code>}.
+ * @see #addNotificationListener(NotificationListener, NotificationFilter,
+ * java.lang.Object)
+ * @see NotificationBroadcaster#removeNotificationListener(NotificationListener)
+ */
+ public void removeNotificationListener(ObjectName name, ObjectName listener)
+ throws InstanceNotFoundException, ListenerNotFoundException
+ {
+ Object lbean = getBean(listener);
+ if (!(lbean instanceof NotificationListener))
+ {
+ RuntimeException e =
+ new IllegalArgumentException("The supplied listener name does not " +
+ "correspond to a notification listener.");
+ throw new RuntimeOperationsException(e);
+ }
+ removeNotificationListener(name, ((NotificationListener) lbean));
+ }
+
+ /**
+ * Removes the specified listener from the list of recipients
+ * of notifications from the supplied bean. Only the first instance with
+ * the supplied filter and passback object is removed.
+ * <code>null</code> is used as a valid value for these parameters,
+ * rather than as a way to remove all registration instances for
+ * the specified listener; for this behaviour instead, see
+ * {@link #removeNotificationListener(ObjectName, ObjectName)}.
+ *
+ * @param name the name of the management bean from which the
+ * listener should be removed.
+ * @param listener the name of the listener to remove.
+ * @param filter the filter of the listener to remove.
+ * @param passback the passback object of the listener to remove.
+ * @throws InstanceNotFoundException if a name doesn't match a registered
+ * bean.
+ * @throws ListenerNotFoundException if the specified listener
+ * is not registered with the bean.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "removeNotificationListener")</code>}.
+ * @see #addNotificationListener(ObjectName, NotificationListener,
+ * NotificationFilter, Object)
+ * @see NotificationEmitter#removeNotificationListener(NotificationListener,
+ * NotificationFilter,
+ * Object)
+ */
+ public void removeNotificationListener(ObjectName name,
+ ObjectName listener,
+ NotificationFilter filter,
+ Object passback)
+ throws InstanceNotFoundException, ListenerNotFoundException
+ {
+ Object lbean = getBean(listener);
+ if (!(lbean instanceof NotificationListener))
+ {
+ RuntimeException e =
+ new IllegalArgumentException("The supplied listener name does not " +
+ "correspond to a notification listener.");
+ throw new RuntimeOperationsException(e);
+ }
+ removeNotificationListener(name, ((NotificationListener) lbean), filter,
+ passback);
+ }
+
+ /**
+ * Sets the value of the specified attribute of the supplied
+ * management bean.
+ *
+ * @param name the name of the management bean.
+ * @param attribute the attribute to set.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws AttributeNotFoundException if the attribute does not
+ * correspond to an attribute
+ * of the bean.
+ * @throws InvalidAttributeValueException if the value is invalid
+ * for this particular
+ * attribute of the bean.
+ * @throws MBeanException if setting the attribute causes
+ * the bean to throw an exception (which
+ * becomes the cause of this exception).
+ * @throws ReflectionException if an exception occurred in trying
+ * to use the reflection interface
+ * to lookup the attribute. The
+ * thrown exception is the cause of
+ * this exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean or attribute
+ * name.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, name, bean,
+ * "setAttribute")</code>}.
+ * @see #getAttribute(ObjectName, String)
+ * @see DynamicMBean#setAttribute(Attribute)
+ */
+ public void setAttribute(ObjectName name, Attribute attribute)
+ throws InstanceNotFoundException, AttributeNotFoundException,
+ InvalidAttributeValueException, MBeanException,
+ ReflectionException
+ {
+ if (attribute == null || name == null)
+ {
+ RuntimeException e =
+ new IllegalArgumentException("One of the supplied arguments was null.");
+ throw new RuntimeOperationsException(e);
+ }
+ Object bean = getBean(name);
+ checkSecurity(name, attribute.getName(), "setAttribute");
+ if (bean instanceof DynamicMBean)
+ ((DynamicMBean) bean).setAttribute(attribute);
+ else
+ try
+ {
+ new StandardMBean(bean, null).setAttribute(attribute);
+ }
+ catch (NotCompliantMBeanException e)
+ {
+ throw (Error)
+ (new InternalError("Failed to create dynamic bean.").initCause(e));
+ }
+ }
+
+ /**
+ * Sets the value of each of the specified attributes
+ * of the supplied management bean to that specified by
+ * the {@link Attribute} object. The returned list contains
+ * the attributes that were set and their new values.
+ *
+ * @param name the name of the management bean.
+ * @param attributes the attributes to set.
+ * @return a list of the changed attributes.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ReflectionException if an exception occurred in trying
+ * to use the reflection interface
+ * to lookup the attribute. The
+ * thrown exception is the cause of
+ * this exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean or attribute
+ * list.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, bean,
+ * "setAttribute")</code>}. Additionally,
+ * for an attribute name, <code>n</code>, the
+ * caller's permission must imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, n, bean,
+ * "setAttribute")</code>} or that attribute will
+ * not be included.
+ * @see #getAttributes(ObjectName, String[])
+ * @see DynamicMBean#setAttributes(AttributeList)
+ */
+ public AttributeList setAttributes(ObjectName name, AttributeList attributes)
+ throws InstanceNotFoundException, ReflectionException
+ {
+ if (name == null || attributes == null)
+ {
+ RuntimeException e =
+ new IllegalArgumentException("One of the supplied arguments was null.");
+ throw new RuntimeOperationsException(e);
+ }
+ Object abean = getBean(name);
+ checkSecurity(name, null, "setAttribute");
+ AttributeList list = new AttributeList(attributes.size());
+ Iterator it = attributes.iterator();
+ while (it.hasNext())
+ {
+ try
+ {
+ Attribute attrib = (Attribute) it.next();
+ if (attrib == null)
+ {
+ RuntimeException e =
+ new IllegalArgumentException("An attribute was null.");
+ throw new RuntimeOperationsException(e);
+ }
+ checkSecurity(name, attrib.getName(), "setAttribute");
+ if (abean instanceof DynamicMBean)
+ ((DynamicMBean) abean).setAttribute(attrib);
+ else
+ try
+ {
+ new StandardMBean(abean, null).setAttribute(attrib);
+ }
+ catch (NotCompliantMBeanException e)
+ {
+ throw (Error)
+ (new InternalError("Failed to create dynamic bean.").initCause(e));
+ }
+ list.add(attrib);
+ }
+ catch (AttributeNotFoundException e)
+ {
+ /* Ignored */
+ }
+ catch (InvalidAttributeValueException e)
+ {
+ /* Ignored */
+ }
+ catch (MBeanException e)
+ {
+ /* Ignored */
+ }
+ }
+ return list;
+ }
+
+ /**
+ * Unregisters the specified management bean. Following this operation,
+ * the bean instance is no longer accessible from the server via this
+ * name. Prior to unregistering the bean, the
+ * {@link MBeanRegistration#preDeregister()} method will be called if
+ * the bean implements the {@link MBeanRegistration} interface.
+ *
+ * @param name the name of the management bean.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preDeregister
+ * method.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean name or a
+ * request being made to unregister the
+ * {@link MBeanServerDelegate} bean.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "unregisterMBean")</code>}.
+ */
+ public void unregisterMBean(ObjectName name)
+ throws InstanceNotFoundException, MBeanRegistrationException
+ {
+ if (name == null)
+ {
+ RuntimeException e =
+ new IllegalArgumentException("The name was null.");
+ throw new RuntimeOperationsException(e);
+ }
+ if (name.equals(DELEGATE_NAME))
+ {
+ RuntimeException e =
+ new IllegalArgumentException("The delegate can not be unregistered.");
+ throw new RuntimeOperationsException(e);
+ }
+ Object bean = getBean(name);
+ checkSecurity(name, null, "unregisterMBean");
+ MBeanRegistration register = null;
+ if (bean instanceof MBeanRegistration)
+ {
+ register = (MBeanRegistration) bean;
+ try
+ {
+ register.preDeregister();
+ }
+ catch (Exception e)
+ {
+ throw new MBeanRegistrationException(e, "Pre-deregistration failed.");
+ }
+ }
+ beans.remove(name);
+ if (register != null)
+ register.postDeregister();
+ }
+
+ /**
+ * Input stream which deserializes using the given classloader.
+ */
+ private class ServerInputStream
+ extends ObjectInputStream
+ {
+
+ private ClassLoader cl;
+
+ public ServerInputStream(InputStream is, ClassLoader cl)
+ throws IOException, StreamCorruptedException
+ {
+ super(is);
+ this.cl = cl;
+ }
+
+ protected Class resolveClass(ObjectStreamClass osc)
+ throws ClassNotFoundException, IOException
+ {
+ try
+ {
+ return Class.forName(osc.getName(), true, cl);
+ }
+ catch (ClassNotFoundException e)
+ {
+ return super.resolveClass(osc);
+ }
+ }
+
+ }
+
+ /**
+ * Holder for information on registered beans.
+ */
+ private class ServerInfo
+ {
+ private ObjectInstance instance;
+
+ private Object object;
+
+ public ServerInfo(ObjectInstance instance, Object object)
+ {
+ this.instance = instance;
+ this.object = object;
+ }
+
+ public Object getObject()
+ {
+ return object;
+ }
+
+ public ObjectInstance getInstance()
+ {
+ return instance;
+ }
+ }
+
+ /**
+ * Notification listener which removes direct references
+ * to beans.
+ */
+ private class ServerNotificationListener
+ implements NotificationListener
+ {
+
+ /**
+ * The bean from which notifications are emitted.
+ */
+ Object bean;
+
+ /**
+ * The {@link ObjectName} of the emitting bean.
+ */
+ ObjectName name;
+
+ /**
+ * The real {@link NotificationListener}.
+ */
+ NotificationListener listener;
+
+ /**
+ * Constructs a new {@link ServerNotificationListener} replacing
+ * occurrences of <code>bean</code> with its name.
+ *
+ * @param bean the bean emitting notifications.
+ * @param name the object name of the emitting bean.
+ * @param listener the listener events eventually reach.
+ */
+ public ServerNotificationListener(Object bean, ObjectName name,
+ NotificationListener listener)
+ {
+ this.bean = bean;
+ this.name = name;
+ this.listener = listener;
+ }
+
+ /**
+ * Replace a direct reference to <code>bean</code> with its
+ * object reference, if necessary, before calling the listener.
+ *
+ * @param notif the notification being emitted.
+ * @param handback an object that will be returned to the notification
+ * listener when an event occurs.
+ */
+ public void handleNotification(Notification notif, Object handback)
+ {
+ if (notif.getSource() == bean)
+ notif.setSource(name);
+ listener.handleNotification(notif, handback);
+ }
+
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/naming/giop/ContextContinuation.java b/libjava/classpath/gnu/javax/naming/giop/ContextContinuation.java
new file mode 100644
index 00000000000..7d7a785fd2f
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/giop/ContextContinuation.java
@@ -0,0 +1,956 @@
+/* ContextContinuation.java -- handles corbaname: urls
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.naming.giop;
+
+import gnu.CORBA.NamingService.Ext;
+import gnu.CORBA.NamingService.NameTransformer;
+
+import java.util.Hashtable;
+
+import javax.naming.Binding;
+import javax.naming.Context;
+import javax.naming.ContextNotEmptyException;
+import javax.naming.InvalidNameException;
+import javax.naming.Name;
+import javax.naming.NameAlreadyBoundException;
+import javax.naming.NameClassPair;
+import javax.naming.NameNotFoundException;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.OperationNotSupportedException;
+import javax.naming.directory.InvalidAttributesException;
+
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.portable.Delegate;
+import org.omg.CORBA.portable.ObjectImpl;
+import org.omg.CosNaming.BindingIteratorHolder;
+import org.omg.CosNaming.BindingListHolder;
+import org.omg.CosNaming.NameComponent;
+import org.omg.CosNaming.NamingContext;
+import org.omg.CosNaming.NamingContextExt;
+import org.omg.CosNaming.NamingContextExtHelper;
+import org.omg.CosNaming.NamingContextHelper;
+import org.omg.CosNaming._NamingContextExtStub;
+import org.omg.CosNaming._NamingContextStub;
+import org.omg.CosNaming.NamingContextPackage.AlreadyBound;
+import org.omg.CosNaming.NamingContextPackage.CannotProceed;
+import org.omg.CosNaming.NamingContextPackage.InvalidName;
+import org.omg.CosNaming.NamingContextPackage.NotFound;
+
+/**
+ * The context to represent the corba naming service. Being the naming service,
+ * the returned context supports creating the subcontexts, forwarding this task
+ * to the existing naming service. When listing bindings, it uses the
+ * {@link Context#BATCHSIZE} property to determine, how many bindings should
+ * be returned at once (the process is transparend)
+ *
+ * @author Audrius Meskauskas (audriusa@Bioinformatics.org)
+ */
+public class ContextContinuation implements Context
+{
+ /**
+ * This number of bindings will be requested from the naming server at once,
+ * while the subsequent bindings will be requested via binding iterator one by
+ * one. Use {@link Context#BATCHSIZE} to override the value of this constant.
+ */
+ public int DEFAULT_BATCH_SIZE = 20;
+
+ /**
+ * The actual CORBA naming service.
+ */
+ NamingContextExt service;
+
+ /**
+ * The object request broker, used to access the naming service. This field
+ * is only initialised when the context is constructed from the URL.
+ */
+ ORB orb;
+
+ /**
+ * The properties.
+ */
+ Hashtable properties;
+
+ /**
+ * The parent factory.
+ */
+ GiopNamingServiceFactory factory;
+
+ /**
+ * The name transformer to obtain the name from its string representation. The
+ * to_name method of the naming service is avoided as it may be remote and
+ * hence expensive. The conversion rules are standard and cannot be service
+ * specific.
+ */
+ static NameTransformer transformer = new NameTransformer();
+
+ /**
+ * The batch size for list operations - how many to return at once.
+ */
+ public final int howMany;
+
+ /**
+ * Creates a new naming context that uses naming service, represented by the
+ * given CORBA object.
+ *
+ * @param namingService
+ * the naming service object. It must be possible to narrow it into
+ * the NamingContextExt.
+ * @param props
+ * the environment table.
+ * @param orb
+ * the associated ORB. This reference is used during cleanup.
+ * @param the
+ * parent factory. This reference is used during cleanup.
+ */
+ public ContextContinuation(org.omg.CORBA.Object nsObject,
+ Hashtable props, ORB anOrb,
+ GiopNamingServiceFactory aFactory)
+ {
+ factory = aFactory;
+ orb = anOrb;
+
+ Delegate delegate = ((ObjectImpl) nsObject)._get_delegate();
+
+ // If the IOR provides the IDL ID, we can check if our name
+ // service is old NamingContext or new NamingContextExt.
+ // Not all forms of the URL always provide the IDL id.
+ if (!nsObject._is_a(NamingContextExtHelper.id())
+ && nsObject._is_a(NamingContextHelper.id()))
+ {
+ // We are surely working with the old version.
+ _NamingContextStub stub = new _NamingContextStub();
+ stub._set_delegate(delegate);
+ // The Ext object will add the necessary extensions.
+ service = new Ext(stub);
+ }
+ else
+ {
+ // We expecte the service to be the NamingContextExt (this is true
+ // for both Sun's and our implementations). There is no easy way
+ // to check the version.
+ _NamingContextExtStub stub = new _NamingContextExtStub();
+ stub._set_delegate(delegate);
+ service = stub;
+ }
+ properties = props;
+ howMany = getBatchSize();
+ }
+
+ /**
+ * Give the specified name for the specified object. The passed name must not
+ * be already bound to some other object. The components of the name are
+ * mapped into the components of the CORBA name.
+ *
+ * @param name
+ * the name that will be given to the object (in the scope of this
+ * context).
+ * @param obj
+ * the object being named.
+ * @throws NameAlreadyBoundException
+ * if this name is already used to name some object.
+ * @throws InvalidAttributesException
+ * if the object does not supply all required attributes.
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void bind(Name name, Object obj) throws NamingException
+ {
+ try
+ {
+ org.omg.CORBA.Object object = (org.omg.CORBA.Object) obj;
+ service.bind(toGiop(name), object);
+ }
+ catch (ClassCastException e)
+ {
+ throw new NamingException(org.omg.CORBA.Object.class + " required ");
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException();
+ }
+ catch (AlreadyBound e)
+ {
+ throw new NameAlreadyBoundException();
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * Give the specified name for the specified object. The passed name must not
+ * be already bound to some other object.
+ *
+ * @param name
+ * the name that will be given to the object (in the scope of this
+ * context).
+ * @param obj
+ * the object being named.
+ * @throws NameAlreadyBoundException
+ * if this name is already used to name some object.
+ * @throws InvalidAttributesException
+ * if the object does not supply all required attributes.
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void bind(String name, Object obj) throws NamingException
+ {
+ try
+ {
+ org.omg.CORBA.Object object = (org.omg.CORBA.Object) obj;
+ service.bind(transformer.toName(name), object);
+ }
+ catch (ClassCastException e)
+ {
+ throw new NamingException(org.omg.CORBA.Object.class + " required ");
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException();
+ }
+ catch (AlreadyBound e)
+ {
+ throw new NameAlreadyBoundException();
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * Releases all resources, associated with this context. The close() method
+ * can be called several times, but after it has been once invoked, it is not
+ * allowed to call any other method of this context. This method destroys
+ * the ORB, if we have one.
+ *
+ * @throws NamingException
+ */
+ public void close() throws NamingException
+ {
+ if (orb != null && factory !=null)
+ {
+ factory.checkIfReferenced(orb);
+ }
+ }
+
+ /**
+ * Not supported.
+ */
+ public Name composeName(Name name, Name prefix) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Not supported
+ */
+ public String composeName(String name1, String name2) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Creates the new naming subcontext and binds it to the current (this)
+ * context. The returned object will wrap around the newly created CORBA
+ * subcontext
+ *
+ * @param name
+ * the name of the new context being created
+ * @return the newly created context, bound to the instance of the context on
+ * that the method has been called
+ * @throws NameAlreadyBoundException
+ * if this name is already bound
+ * @throws InvalidAttributesException
+ * if the creation of the new context requires the missing mandatory
+ * attributes
+ * @throws NamingException
+ */
+ public Context createSubcontext(Name subContext) throws NamingException
+ {
+ try
+ {
+ org.omg.CORBA.Object subcontext = service.bind_new_context(
+ toGiop(subContext));
+ Hashtable clonedProps = new Hashtable();
+ clonedProps.putAll(properties);
+
+ // Nulls are passed both for orb and factory, as the child contexts
+ // need not to do any cleanup.
+ return new ContextContinuation(subcontext, clonedProps, null, null);
+ }
+ catch (AlreadyBound e)
+ {
+ throw new NameAlreadyBoundException();
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException();
+ }
+ catch (Exception ex)
+ {
+ throw new NamingException(ex.toString());
+ }
+ }
+
+ /**
+ * Creates the new naming subcontext and binds it to the current (this)
+ * context. The returned object will wrap around the newly created CORBA
+ * subcontext
+ *
+ * @param name
+ * the name of the new context being created
+ * @return the newly created context, bound to the instance of the context on
+ * that the method has been called
+ * @throws NameAlreadyBoundException
+ * if this name is already bound
+ * @throws InvalidAttributesException
+ * if the creation of the new context requires the missing mandatory
+ * attributes
+ * @throws NamingException
+ */
+ public Context createSubcontext(String subContext) throws NamingException
+ {
+ try
+ {
+ org.omg.CORBA.Object subcontext =
+ service.bind_new_context(transformer.toName(subContext));
+ Hashtable clonedProps = new Hashtable();
+ clonedProps.putAll(properties);
+
+ // Nulls are passed both for orb and factory, as the child contexts
+ // need not to do any cleanup.
+ return new ContextContinuation(subcontext, clonedProps, null,
+ null);
+ }
+ catch (AlreadyBound e)
+ {
+ throw new NameAlreadyBoundException(subContext);
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException(subContext);
+ }
+ catch (Exception ex)
+ {
+ throw new NamingException(ex.toString());
+ }
+ }
+
+ /**
+ * Removes the naming subcontext from this naming context. Returns without
+ * action if such subcontext does not exist. The context being destroyed must
+ * be empty.
+ *
+ * @param name
+ * the name of the subcontext beig removed.
+ * @throws ContextNotEmptyException
+ * if the named context is not empty.
+ * @throws NamingException
+ */
+ public void destroySubcontext(Name subContext) throws NamingException
+ {
+ unbind(subContext);
+ }
+
+ /**
+ * Removes the naming subcontext from this naming context. Returns without
+ * action if such subcontext does not exist. The context being destroyed must
+ * be empty.
+ *
+ * @param name
+ * the name of the subcontext beig removed.
+ * @throws ContextNotEmptyException
+ * if the named context is not empty.
+ * @throws NamingException
+ */
+ public void destroySubcontext(String subContext) throws NamingException
+ {
+ unbind(subContext);
+ }
+
+ /**
+ * Returs the full name of this naming context. The returned string is not a
+ * JNDI composite name and should not be passed directly to the methods of the
+ * naming context. This implementation returns the IOR.
+ *
+ * @return the full name of this naming context, in its own namespace.
+ * @throws OperationNotSupportedException
+ * if the naming system, represented by this context, does not
+ * support the notation of the full name.
+ * @throws NamingException
+ */
+ public String getNameInNamespace() throws NamingException
+ {
+ if (orb != null)
+ return orb.object_to_string(service);
+ else
+ {
+ try
+ {
+ ObjectImpl impl = (ObjectImpl) service;
+ return impl._orb().object_to_string(impl);
+ }
+ catch (ClassCastException e)
+ {
+ throw new UnsupportedOperationException();
+ }
+ }
+ }
+
+ /**
+ * Not supported.
+ */
+ public NameParser getNameParser(Name name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not supported.
+ */
+ public NameParser getNameParser(String name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Creates and returns the enumeration over the name bindings that are present
+ * the given subcontext. The enumeration elements have the type of
+ * {@link NameClassPair}, providing also information about the class of the
+ * bound object. The behaviour in the case if the bindings are added or
+ * removed later is not defined. The contents of the subcontexts are not
+ * included.
+ *
+ * @param name
+ * the name of the subcontext
+ * @return the enumeration over the names, known for the given subcontext.
+ * @throws NamingException
+ */
+ public NamingEnumeration list(Name name) throws NamingException
+ {
+ BindingIteratorHolder bi = new BindingIteratorHolder();
+ BindingListHolder bl = new BindingListHolder();
+
+ NamingContext subcontext;
+
+ if (name.size() == 0)
+ subcontext = service;
+ else
+ {
+ try
+ {
+ subcontext = (NamingContextHelper.narrow(service.resolve(toGiop(name))));
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+
+ }
+
+ subcontext.list(howMany, bl, bi);
+
+ return new ListEnumeration(bl, bi, howMany);
+ }
+
+ /**
+ * Creates and returns the enumeration over the name bindings that are present
+ * the given subcontext. The enumeration elements have the type of
+ * {@link NameClassPair}, providing also information about the class of the
+ * bound object. The behaviour in the case if the bindings are added or
+ * removed later is not defined. The contents of the subcontexts are not
+ * included.
+ *
+ * @param name
+ * the name of the subcontext
+ * @return the enumeration over the names, known for the given subcontext.
+ * @throws NamingException
+ */
+ public NamingEnumeration list(String name) throws NamingException
+ {
+ BindingIteratorHolder bi = new BindingIteratorHolder();
+ BindingListHolder bl = new BindingListHolder();
+
+ NamingContext subcontext;
+
+ if (name.length() == 0)
+ subcontext = service;
+ else
+ {
+ try
+ {
+ subcontext = (NamingContextHelper.narrow(service.resolve_str(name)));
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+
+ }
+
+ subcontext.list(howMany, bl, bi);
+
+ return new ListEnumeration(bl, bi, howMany);
+ }
+
+ /**
+ * Creates and returns the enumeration over the name - object bindings that
+ * are present the given subcontext. The enumeration elements have the type of
+ * {@link Binding}, providing also information about the class of the bound
+ * object. The behaviour in the case if the bindings are added or removed
+ * later is not defined. The contents of the subcontexts are not included.
+ *
+ * @param name
+ * the name of the subcontext
+ * @return the enumeration over the names, known for the given subcontext.
+ * @throws NamingException
+ */
+ public NamingEnumeration listBindings(Name name) throws NamingException
+ {
+ BindingIteratorHolder bi = new BindingIteratorHolder();
+ BindingListHolder bl = new BindingListHolder();
+
+ NamingContext subcontext;
+
+ if (name.size() == 0)
+ subcontext = service;
+ else
+ {
+ try
+ {
+ subcontext = (NamingContextHelper.narrow(service.resolve(toGiop(name))));
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ subcontext.list(howMany, bl, bi);
+
+ return new ListBindingsEnumeration(bl, bi, howMany, subcontext);
+ }
+
+ /**
+ * Creates and returns the enumeration over the name - object bindings that
+ * are present the given subcontext. The enumeration elements have the type of
+ * {@link Binding}, providing also information about the class of the bound
+ * object. The behaviour in the case if the bindings are added or removed
+ * later is not defined. The contents of the subcontexts are not included.
+ *
+ * @param name
+ * the name of the subcontext
+ * @return the enumeration over the names, known for the given subcontext.
+ * @throws NamingException
+ */
+ public NamingEnumeration listBindings(String name) throws NamingException
+ {
+ BindingIteratorHolder bi = new BindingIteratorHolder();
+ BindingListHolder bl = new BindingListHolder();
+
+ NamingContext subcontext;
+
+ if (name.length() == 0)
+ subcontext = service;
+ else
+ {
+ try
+ {
+ subcontext = (NamingContextHelper.narrow(service.resolve_str(name)));
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+
+ }
+
+ subcontext.list(howMany, bl, bi);
+
+ return new ListBindingsEnumeration(bl, bi, howMany, subcontext);
+ }
+
+ /**
+ * Gets the previously named object by name. If the passed name is empty, the
+ * method should return a cloned instance of this naming context.
+ *
+ * @param name
+ * the name of the object being searched in this context
+ * @return the named object
+ * @throws NameNotFountException
+ * if the name is not found
+ */
+ public Object lookup(Name name) throws NamingException
+ {
+ try
+ {
+ return service.resolve(toGiop(name));
+ }
+ catch (NotFound e)
+ {
+ throw new NameNotFoundException();
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException();
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * Gets the previously named object by name. If the passed name is empty, the
+ * method should return a cloned instance of this naming context.
+ *
+ * @param name
+ * the name of the object being searched in this context
+ * @return the named object
+ * @throws NamingException
+ * if the naming fails.
+ */
+ public Object lookup(String name) throws NamingException
+ {
+ try
+ {
+ return service.resolve_str(name);
+ }
+ catch (NotFound e)
+ {
+ throw new NameNotFoundException();
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException();
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * Not supported.
+ */
+ public Object lookupLink(Name name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Not supported.
+ */
+ public Object lookupLink(String name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Give the specified name for the specified object. Unlike bind, this method
+ * silently replaces the existing binding for this name, if one exists.
+ *
+ * @param name
+ * the name that will be given to the object (in the scope of this
+ * context).
+ * @param obj
+ * the object being named.
+ * @throws InvalidAttributesException
+ * if the object does not supply all required attributes.
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void rebind(Name name, Object obj) throws NamingException
+ {
+ try
+ {
+ org.omg.CORBA.Object object = (org.omg.CORBA.Object) obj;
+ service.rebind(toGiop(name), object);
+ }
+ catch (ClassCastException e)
+ {
+ throw new NamingException(org.omg.CORBA.Object.class + " required ");
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException();
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * Give the specified name for the specified object. Unlike bind, this method
+ * silently replaces the existing binding for this name, if one exists.
+ *
+ * @param name
+ * the name that will be given to the object (in the scope of this
+ * context).
+ * @param obj
+ * the object being named.
+ * @throws InvalidAttributesException
+ * if the object does not supply all required attributes.
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void rebind(String name, Object obj) throws NamingException
+ {
+ try
+ {
+ org.omg.CORBA.Object object = (org.omg.CORBA.Object) obj;
+ service.rebind(transformer.toName(name), object);
+ }
+ catch (ClassCastException e)
+ {
+ throw new NamingException(org.omg.CORBA.Object.class + " required ");
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException();
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * Renames the existing binding, removing the existing and giving the new name
+ * for the same object.
+ *
+ * @param oldName
+ * the existing name of the known object
+ * @param newName
+ * the new name of the same object
+ * @throws NameNotFoundException
+ * if the oldName is unknown for this context
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void rename(Name oldName, Name newName) throws NamingException
+ {
+ Object object = lookup(oldName);
+ unbind(oldName);
+ bind(newName, object);
+ }
+
+ /**
+ * Renames the existing binding, removing the existing and giving the new name
+ * for the same object.
+ *
+ * @param oldName
+ * the existing name of the known object
+ * @param newName
+ * the new name of the same object
+ * @throws NameNotFoundException
+ * if the oldName is unknown for this context
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void rename(String oldName, String newName) throws NamingException
+ {
+ Object object = lookup(oldName);
+ unbind(oldName);
+ bind(newName, object);
+ }
+
+ /**
+ * Removes the name - object mapping from the current context. This method
+ * returns without action if the name is not bound to an object in the
+ * terminal context, but throws {@link NameNotFoundException} if one of the
+ * intermadiate contexts does not exist.
+ *
+ * @param name
+ * the name to be removed
+ * @throws NameNotFoundException
+ * if one of the intermediate naming contexts does not exist. Will
+ * not be thrown if just the terminal binding is missing.
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void unbind(Name name) throws NamingException
+ {
+ try
+ {
+ service.unbind(toGiop(name));
+ }
+ catch (NotFound e)
+ {
+ throw new NameNotFoundException();
+ }
+ catch (CannotProceed e)
+ {
+ throw new ContextNotEmptyException();
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException();
+ }
+ }
+
+ /**
+ * Removes the name - object mapping from the current context. This method
+ * returns without action if the name is not bound to an object in the
+ * terminal context, but throws {@link NameNotFoundException} if one of the
+ * intermadiate contexts does not exist.
+ *
+ * @param name
+ * the name to be removed
+ * @throws NameNotFoundException
+ * if one of the intermediate naming contexts does not exist. Will
+ * not be thrown if just the terminal binding is missing.
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void unbind(String name) throws NamingException
+ {
+ try
+ {
+ service.unbind(transformer.toName(name));
+ }
+ catch (NotFound e)
+ {
+ throw new NameNotFoundException(name);
+ }
+ catch (CannotProceed e)
+ {
+ throw new ContextNotEmptyException(name);
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException(name);
+ }
+ }
+
+ /**
+ * Add new environment property to the environment of this context. Both name
+ * and value of the new property must not be null. If the property is already
+ * defined, is current value is replaced by the propVal.
+ *
+ * @param propName
+ * the name of the new property
+ * @param propVal
+ * the value of the new property
+ * @return the previous value of this property or null if the property has not
+ * been previously defined
+ * @throws NamingException
+ */
+ public Object addToEnvironment(String key, Object value)
+ throws NamingException
+ {
+ if (key == null || value == null)
+ throw new NullPointerException();
+ return properties.put(key, value);
+ }
+
+ /**
+ * Returns the environment, associated with this naming context. The returned
+ * table should never be modified by the caller. Use {@link #addToEnvironment}
+ * and {@link #removeFromEnvironment} to modify the environement, if needed.
+ *
+ * @return the table, representing the environment of this context
+ * @throws NamingException
+ */
+ public Hashtable getEnvironment() throws NamingException
+ {
+ return properties;
+ }
+
+ /**
+ * Removes the property with the given name from the environment. Returns
+ * without action if this property is not defined.
+ *
+ * @param propName
+ * the name of the property being removed.
+ * @return the value of the property that has been removed or null if the
+ * property was not defined.
+ * @throws NamingException
+ */
+ public Object removeFromEnvironment(String propName) throws NamingException
+ {
+ return properties.remove(propName);
+ }
+
+ /**
+ * Convert the {@link Name} into array of the name components, required to the
+ * CORBA naming service. First the string representation is obtained, then
+ * it is converted using parsing rules of the CORBA name.
+ *
+ * @param name
+ * then name to convert
+ * @return the converted array of components.
+ */
+ public NameComponent[] toGiop(Name name) throws InvalidName
+ {
+ return transformer.toName(name.toString());
+ }
+
+ /**
+ * Get the batch size from the environment properties. The batch size is used
+ * for listing operations.
+ *
+ * @return the batch size, or some default value if not specified.
+ */
+ public int getBatchSize()
+ {
+ int batchSize = DEFAULT_BATCH_SIZE;
+ Object bs = properties.get(Context.BATCHSIZE);
+ if (bs != null)
+ {
+ try
+ {
+ int b = Integer.parseInt(bs.toString());
+ if (b >= 0)
+ batchSize = b;
+ }
+ catch (NumberFormatException e)
+ {
+ // OK, use default value.
+ }
+ }
+ return batchSize;
+ }
+
+
+}
diff --git a/libjava/classpath/gnu/javax/naming/giop/CorbalocParser.java b/libjava/classpath/gnu/javax/naming/giop/CorbalocParser.java
new file mode 100644
index 00000000000..397b1c7d9e4
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/giop/CorbalocParser.java
@@ -0,0 +1,439 @@
+/* CorbalocParser.java -- handles corbaname: urls
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.naming.giop;
+
+import gnu.CORBA.IOR;
+import gnu.CORBA.Minor;
+import gnu.CORBA.Unexpected;
+import gnu.CORBA.Version;
+import gnu.CORBA.NamingService.NameTransformer;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.util.StringTokenizer;
+
+import javax.naming.InvalidNameException;
+
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.DATA_CONVERSION;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Object;
+import org.omg.CORBA.ORBPackage.InvalidName;
+
+/**
+ * Parses the alternative IOR representations into our IOR structure.
+ *
+ * TODO This parser currently supports only one address per target string. A
+ * string with the multiple addresses will be accepted, but only the last
+ * address will be taken into consideration. The fault tolerance is not yet
+ * implemented.
+ *
+ * The key string is filtered using {@link java.net.URLDecoder} that replaces
+ * the agreed escape sequences by the corresponding non alphanumeric characters.
+ *
+ * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
+ */
+public class CorbalocParser
+ extends NameTransformer
+{
+ /**
+ * The corbaloc prefix.
+ */
+ public static final String pxCORBALOC = "corbaloc";
+
+ /**
+ * The corbaname prefix.
+ */
+ public static final String pxCORBANAME = "corbaname";
+
+ /**
+ * The IOR prefix.
+ */
+ public static final String pxIOR = "ior";
+
+ /**
+ * The file:// prefix.
+ */
+ public static final String pxFILE = "file://";
+
+ /**
+ * The ftp:// prefix.
+ */
+ public static final String pxFTP = "ftp://";
+
+ /**
+ * The http:// prefix.
+ */
+ public static final String pxHTTP = "http://";
+
+ /**
+ * Marks iiop protocol.
+ */
+ public static final String IIOP = "iiop";
+
+ /**
+ * Marks rir protocol.
+ */
+ public static final String RIR = "rir";
+
+ /**
+ * The default port value, as specified in OMG documentation.
+ */
+ public static final int DEFAULT_PORT = 2809;
+
+ /**
+ * The default name.
+ */
+ public static final String DEFAULT_NAME = "NameService";
+
+ /**
+ * The string to name converter, initialized on demand.
+ */
+ static NameTransformer converter;
+
+ /**
+ * The current position.
+ */
+ int p;
+
+ /**
+ * The address being parsed, splitted into tokens.
+ */
+ String[] t;
+
+ /**
+ * Parse CORBALOC.
+ *
+ * The expected format is: <br>
+ * 1. corbaloc:[iiop][version.subversion@]:host[:port]/key <br>
+ * 2. corbaloc:rir:[/key] <br>
+ * 3. corbaname:[iiop][version.subversion@]:host[:port]/key <br>
+ * 4. corbaname:rir:[/key] <br>
+ * 5. file://[file name]<br>
+ * 6. http://[url]<br>
+ * 7. ftp://[url]<br>
+ *
+ * Protocol defaults to IOP, the object key defaults to the NameService.
+ *
+ * @param corbaloc the string to parse.
+ * @param orb the ORB, needed to create IORs and resolve rir references.
+ *
+ * @return the arrey of strings, first member being the IOR of the
+ * naming service, second member the name in the naming service.
+ */
+ public synchronized String[] corbaloc(String corbaloc,
+ ORB orb)
+ throws InvalidNameException
+ {
+ return corbaloc(corbaloc, orb, 0);
+ }
+
+ /**
+ * Parse controlling against the infinite recursion loop.
+ */
+ private String[] corbaloc(String corbaloc,
+ ORB orb, int recursion) throws InvalidNameException
+ {
+ // The used CORBA specification does not state how many times we should to
+ //redirect, but the infinite loop may be used to knock out the system.
+ // by malicious attempt.
+ if (recursion > 10)
+ throw new DATA_CONVERSION("More than 10 redirections");
+
+ if (corbaloc.startsWith(pxFILE))
+ return corbaloc(readFile(corbaloc.substring(pxFILE.length())), orb, recursion+1);
+ else if (corbaloc.startsWith(pxHTTP))
+ return corbaloc(readUrl(corbaloc), orb, recursion+1);
+ else if (corbaloc.startsWith(pxFTP))
+ return corbaloc(readUrl(corbaloc), orb, recursion+1);
+
+ // The version numbers with default values.
+ int major = 1;
+ int minor = 0;
+
+ // The host address.
+ String host;
+
+ // The port.
+ int port = DEFAULT_PORT;
+
+ // The object key as string.
+ String key;
+
+ StringTokenizer st = new StringTokenizer(corbaloc, ":@/.,#", true);
+
+ t = new String[st.countTokens()];
+
+ for (int i = 0; i < t.length; i++)
+ {
+ t[i] = st.nextToken();
+ }
+
+ p = 0;
+
+ if (!t[p].startsWith(pxCORBANAME))
+ throw new InvalidNameException(corbaloc+" must start with "+pxCORBANAME);
+
+ p++;
+
+ if (!t[p++].equals(":"))
+ throw new BAD_PARAM("Syntax (':' expected after name prefix)");
+
+ // Check for rir:
+ if (t[p].equals(RIR))
+ {
+ p++;
+ if (!t[p++].equals(":"))
+ throw new BAD_PARAM("':' expected after 'rir'");
+
+ key = readKey("/");
+
+ Object object;
+ try
+ {
+ object = orb.resolve_initial_references(key);
+ return resolve(orb.object_to_string(object));
+ }
+ catch (InvalidName e)
+ {
+ throw new BAD_PARAM("Unknown initial reference '" + key + "'");
+ }
+ }
+ else
+ // Check for iiop.
+ if (t[p].equals(IIOP) || t[p].equals(":"))
+ {
+ IOR ior = new IOR();
+
+ Addresses: do
+ { // Read addresses.
+ if (t[p].equals(":"))
+ {
+ p++;
+ }
+ else
+ {
+ p++;
+ if (!t[p++].equals(":"))
+ throw new BAD_PARAM("':' expected after 'iiop'");
+ // Check if version is present.
+ if (t[p + 1].equals("."))
+ if (t[p + 3].equals("@"))
+ {
+ // Version info present.
+ try
+ {
+ major = Integer.parseInt(t[p++]);
+ }
+ catch (NumberFormatException e)
+ {
+ throw new BAD_PARAM("Major version number '"
+ + t[p - 1] + "'");
+ }
+ p++; // '.' at this point.
+ try
+ {
+ minor = Integer.parseInt(t[p++]);
+ }
+ catch (NumberFormatException e)
+ {
+ throw new BAD_PARAM("Major version number '"
+ + t[p - 1] + "'");
+ }
+ p++; // '@' at this point.
+ }
+ }
+
+ ior.Internet.version = new Version(major, minor);
+
+ // Then host data goes till '/' or ':'.
+ StringBuffer bhost = new StringBuffer(corbaloc.length());
+ while (!t[p].equals(":") && !t[p].equals("/") && !t[p].equals(","))
+ bhost.append(t[p++]);
+
+ host = bhost.toString();
+
+ ior.Internet.host = host;
+
+ if (t[p].equals(":"))
+ {
+ // Port specified.
+ p++;
+ try
+ {
+ port = Integer.parseInt(t[p++]);
+ }
+ catch (NumberFormatException e)
+ {
+ throw new BAD_PARAM("Invalid port '" + t[p - 1] + "'");
+ }
+ }
+
+ ior.Internet.port = port;
+
+ // Id is not listed.
+ ior.Id = "";
+
+ if (t[p].equals(","))
+ p++;
+ else
+ break Addresses;
+ }
+ while (true);
+
+ key = readKey("/");
+ ior.key = key.getBytes();
+
+ return resolve(ior.toStringifiedReference());
+ }
+
+ else
+ throw new InvalidNameException("Unsupported protocol '" + t[p] +
+ "' (iiop expected)");
+ }
+
+ /**
+ * Read IOR from the file in the local file system.
+ */
+ String readFile(String file)
+ {
+ File f = new File(file);
+ if (!f.exists())
+ {
+ DATA_CONVERSION err = new DATA_CONVERSION(f.getAbsolutePath()
+ + " does not exist.");
+ err.minor = Minor.Missing_IOR;
+ }
+ try
+ {
+ char[] c = new char[(int) f.length()];
+ FileReader fr = new FileReader(f);
+ fr.read(c);
+ fr.close();
+ return new String(c).trim();
+ }
+ catch (IOException ex)
+ {
+ DATA_CONVERSION d = new DATA_CONVERSION();
+ d.initCause(ex);
+ d.minor = Minor.Missing_IOR;
+ throw (d);
+ }
+ }
+
+ /**
+ * Read IOR from the remote URL.
+ */
+ String readUrl(String url)
+ {
+ URL u;
+ try
+ {
+ u = new URL(url);
+ }
+ catch (MalformedURLException mex)
+ {
+ throw new BAD_PARAM("Malformed URL: '" + url + "'");
+ }
+
+ try
+ {
+ InputStreamReader r = new InputStreamReader(u.openStream());
+
+ StringBuffer b = new StringBuffer();
+ int c;
+
+ while ((c = r.read()) > 0)
+ b.append((char) c);
+
+ return b.toString().trim();
+ }
+ catch (Exception exc)
+ {
+ DATA_CONVERSION d = new DATA_CONVERSION("Reading " + url + " failed.");
+ d.minor = Minor.Missing_IOR;
+ throw d;
+ }
+ }
+
+ private String[] resolve(String nsIor)
+ {
+ String [] n = new String[2];
+ n[0] = nsIor;
+ n[1] = readKey("#");
+ return n;
+ }
+
+ private String readKey(String delimiter)
+ throws BAD_PARAM
+ {
+ if (p < t.length)
+ if (!t[p].equals(delimiter))
+ {
+ if (t[p].equals("#"))
+ return DEFAULT_NAME;
+ else
+ throw new BAD_PARAM("'" + delimiter + "String' expected '" + t[p]
+ + "' found");
+ }
+
+ StringBuffer bKey = new StringBuffer();
+ p++;
+
+ while (p < t.length && !t[p].equals("#"))
+ bKey.append(t[p++]);
+
+ if (bKey.length() == 0)
+ return DEFAULT_NAME;
+
+ try
+ {
+ return URLDecoder.decode(bKey.toString(), "UTF-8");
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ throw new Unexpected("URLDecoder does not support UTF-8", e);
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/javax/naming/giop/GiopNamingEnumeration.java b/libjava/classpath/gnu/javax/naming/giop/GiopNamingEnumeration.java
new file mode 100644
index 00000000000..9b93f8bb6a8
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/giop/GiopNamingEnumeration.java
@@ -0,0 +1,187 @@
+/* GiopNamingEnumeration.java -- handles corbaname: urls
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.naming.giop;
+
+import java.util.NoSuchElementException;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+import org.omg.CosNaming.Binding;
+import org.omg.CosNaming.BindingIterator;
+import org.omg.CosNaming.BindingIteratorHolder;
+import org.omg.CosNaming.BindingListHolder;
+
+/**
+ * Iterates over name class pairs, obtaining values first from the binding list
+ * and then from the binding iterator.
+ *
+ * @author Audrius Meskauskas
+ */
+public abstract class GiopNamingEnumeration implements NamingEnumeration
+{
+ /**
+ * The array of bindings, returned at once.
+ */
+ Binding[] list;
+
+ /**
+ * The binding iterator to obtain the subsequent bindings. May be null,
+ * if all values are stored in the <code>list</code>.
+ */
+ BindingIterator iterator;
+
+ /**
+ * The batch size.
+ */
+ int batch;
+
+ /**
+ * The position of the element in the binding list, that must be returned
+ * during the subsequent call of the next(). If this field is grater or equal
+ * to the lenght of the list, the subsequent values must be requested from the
+ * iterator.
+ */
+ int p;
+
+ GiopNamingEnumeration(BindingListHolder bh, BindingIteratorHolder bih, int batchSize)
+ {
+ list = bh.value;
+ iterator = bih.value;
+ batch = batchSize;
+ }
+
+ /**
+ * Convert from the CORBA binding into that this enumeration should return.
+ *
+ * @param binding
+ * the binding to convert
+ * @return the value, that must be returned by the {@link #next()}.
+ */
+ public abstract Object convert(Binding binding);
+
+ public void close() throws NamingException
+ {
+ if (iterator != null)
+ {
+ iterator.destroy();
+ iterator = null;
+ }
+ }
+
+ /**
+ * Checks if there are more elements to return.
+ *
+ * @throws NamingException
+ * never
+ */
+ public boolean hasMore() throws NamingException
+ {
+ return hasMoreElements();
+ }
+
+ /**
+ * Returns the next element.
+ *
+ * @throws NamingException
+ * never
+ */
+ public Object next() throws NamingException
+ {
+ return nextElement();
+ }
+
+ /**
+ * Checks if there are more elements to return.
+ */
+ public boolean hasMoreElements()
+ {
+ if (p < 0)
+ return false;
+ else if (p < list.length)
+ return true;
+ else
+ return getMore();
+ }
+
+ /**
+ * Returns the next element.
+ */
+ public Object nextElement()
+ {
+ if (p < 0)
+ throw new NoSuchElementException();
+ else if (p < list.length)
+ return convert(list[p++]);
+ else if (getMore())
+ // getMore updates p
+ return convert(list[p++]);
+ else
+ throw new NoSuchElementException();
+ }
+
+ /**
+ * Tries to obtain more elements, return true on success. Updates the fields
+ * accordingly.
+ */
+ boolean getMore()
+ {
+ if (iterator != null)
+ {
+ BindingListHolder holder = new BindingListHolder();
+ boolean rt = iterator.next_n(batch, holder);
+ if (rt)
+ {
+ // The new pack of the bindings arrived.
+ p = 0;
+ list = holder.value;
+ return true;
+ }
+ else
+ {
+ iterator.destroy();
+ iterator = null;
+ p = -1;
+ return false;
+ }
+ }
+ else
+ return false;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/naming/giop/GiopNamingServiceFactory.java b/libjava/classpath/gnu/javax/naming/giop/GiopNamingServiceFactory.java
new file mode 100644
index 00000000000..84aa3241365
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/giop/GiopNamingServiceFactory.java
@@ -0,0 +1,177 @@
+/* GiopNamingServiceFactory.java -- handles corbaname: urls
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.naming.giop;
+
+import gnu.CORBA.OrbFunctional;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.TreeMap;
+
+import javax.naming.Context;
+import javax.naming.Name;
+
+import org.omg.CORBA.ORB;
+
+/**
+ * The context factory to represent the corbaname: style urls. Such URL states
+ * that the CORBA naming service exists on the given host. This service can
+ * return the required object, finding it by the given name. The names are
+ * parsed using the specification of the corbaname urls. Being the naming
+ * service, the returned context supports creating the subcontexts, forwarding
+ * this task to the existing naming service.
+ *
+ * @author Audrius Meskauskas (audriusa@Bioinformatics.org)
+ */
+public class GiopNamingServiceFactory
+{
+ /**
+ * The default naming service provider. It is assumed, that the naming service
+ * is running on the port 900 of the local host, using the GIOP version 1.2
+ */
+ public static final String DEFAULT_PROVIDER =
+ "corbaloc:iiop:1.2@127.0.0.1:900/NameService";
+
+ /**
+ * The table of all instantiated ORB's that are found by they ORB
+ * properties signatures. If all ORB related properties are the same,
+ * the ORB's are shared.
+ */
+ public static Hashtable orbs = new Hashtable();
+
+
+ /**
+ * Create a new instance of the corbaname URL context.
+ */
+ public Object getObjectInstance(Object refObj, Name name, Context nameCtx,
+ Hashtable environment)
+ {
+ String provider = (String) environment.get(Context.PROVIDER_URL);
+ if (provider == null)
+ provider = DEFAULT_PROVIDER;
+
+ String orbSignature = getOrbSignature(environment);
+
+ ORB orb;
+ synchronized (orbs)
+ {
+ orb = (ORB) orbs.get(orbSignature);
+ if (orb == null)
+ {
+ Properties props = new Properties();
+ props.putAll(environment);
+ orb = ORB.init(new String[0], props);
+ orbs.put(orbSignature, orb);
+ final ORB runIt = orb;
+ new Thread()
+ {
+ public void run()
+ {
+ runIt.run();
+ }
+ }.start();
+ }
+ }
+
+ return new GiopNamingServiceURLContext(environment, this, orb);
+ }
+
+ /**
+ * Check if this ORB is still in use (maybe it is time to shutdown it). This
+ * method only works when the Classpath CORBA implementation is used
+ * (otherwise it return without action). The method is called from the close()
+ * method of the created context.
+ *
+ * @param orb
+ * the ORB that maybe is no longer referenced.
+ */
+ public void checkIfReferenced(ORB orb)
+ {
+ synchronized (orbs)
+ {
+ // We can only do this with the Classpath implementation.
+ if (orb instanceof OrbFunctional)
+ {
+ OrbFunctional cOrb = (OrbFunctional) orb;
+ // If there are no connected objects, we can destroy the orb.
+ if (cOrb.countConnectedObjects() == 0)
+ {
+ cOrb.shutdown(false);
+ cOrb.destroy();
+
+ Enumeration keys = orbs.keys();
+ Object key;
+ Remove: while (keys.hasMoreElements())
+ {
+ key = keys.nextElement();
+ if (orbs.get(key) == orb)
+ {
+ orbs.remove(key);
+ break Remove;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Get all properties.
+ */
+ public String getOrbSignature(Map props)
+ {
+ TreeMap map = new TreeMap();
+ map.putAll(props);
+ StringBuffer b = new StringBuffer(50*props.size());
+
+ Iterator iter = map.entrySet().iterator();
+ Map.Entry m;
+ while (iter.hasNext())
+ {
+ m = (Map.Entry) iter.next();
+ b.append(m.getKey());
+ b.append('=');
+ b.append(m.getValue());
+ }
+ return b.toString();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/naming/giop/GiopNamingServiceURLContext.java b/libjava/classpath/gnu/javax/naming/giop/GiopNamingServiceURLContext.java
new file mode 100644
index 00000000000..50446ac7edd
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/giop/GiopNamingServiceURLContext.java
@@ -0,0 +1,840 @@
+/* GiopNamingServiceURLContext.java -- handles corbaname: urls
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.naming.giop;
+
+import gnu.CORBA.NamingService.Ext;
+import gnu.CORBA.NamingService.NameTransformer;
+
+import java.util.Hashtable;
+
+import javax.naming.Binding;
+import javax.naming.Context;
+import javax.naming.ContextNotEmptyException;
+import javax.naming.InvalidNameException;
+import javax.naming.Name;
+import javax.naming.NameAlreadyBoundException;
+import javax.naming.NameClassPair;
+import javax.naming.NameNotFoundException;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.OperationNotSupportedException;
+import javax.naming.directory.InvalidAttributesException;
+
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.portable.Delegate;
+import org.omg.CORBA.portable.ObjectImpl;
+import org.omg.CosNaming.BindingIteratorHolder;
+import org.omg.CosNaming.BindingListHolder;
+import org.omg.CosNaming.NameComponent;
+import org.omg.CosNaming.NamingContext;
+import org.omg.CosNaming.NamingContextExt;
+import org.omg.CosNaming.NamingContextExtHelper;
+import org.omg.CosNaming.NamingContextHelper;
+import org.omg.CosNaming._NamingContextExtStub;
+import org.omg.CosNaming._NamingContextStub;
+import org.omg.CosNaming.NamingContextPackage.AlreadyBound;
+import org.omg.CosNaming.NamingContextPackage.CannotProceed;
+import org.omg.CosNaming.NamingContextPackage.InvalidName;
+import org.omg.CosNaming.NamingContextPackage.NotFound;
+
+/**
+ * The context to represent the corba naming service. Being the naming service,
+ * the returned context supports creating the subcontexts, forwarding this task
+ * to the existing naming service. When listing bindings, it uses the
+ * {@link Context#BATCHSIZE} property to determine, how many bindings should
+ * be returned at once (the process is transparend)
+ *
+ * @author Audrius Meskauskas (audriusa@Bioinformatics.org)
+ */
+public class GiopNamingServiceURLContext extends CorbalocParser implements
+ Context
+{
+ /**
+ * This number of bindings will be requested from the naming server at once,
+ * while the subsequent bindings will be requested via binding iterator one by
+ * one. Use {@link Context#BATCHSIZE} to override the value of this constant.
+ */
+ public int DEFAULT_BATCH_SIZE = 20;
+
+ /**
+ * The object request broker, used to access the naming service. This field
+ * is only initialised when the context is constructed from the URL.
+ */
+ ORB orb;
+
+ /**
+ * The properties.
+ */
+ Hashtable properties;
+
+ /**
+ * The parent factory.
+ */
+ GiopNamingServiceFactory factory;
+
+ /**
+ * The name transformer to obtain the name from its string representation. The
+ * to_name method of the naming service is avoided as it may be remote and
+ * hence expensive. The conversion rules are standard and cannot be service
+ * specific.
+ */
+ static NameTransformer transformer = new NameTransformer();
+
+ /**
+ * The batch size for list operations - how many to return at once.
+ */
+ public final int howMany;
+
+ /**
+ * Creates a new naming context that uses naming service, represented by the
+ * given CORBA object.
+ *
+ * @param props
+ * the environment table.
+ * @param aFactory
+ * parent factory. This reference is used during cleanup.
+ * @param anOrb
+ * the associated ORB. This reference is used during cleanup.
+ */
+ public GiopNamingServiceURLContext(Hashtable props,
+ GiopNamingServiceFactory aFactory,
+ ORB anOrb)
+ {
+ factory = aFactory;
+ orb = anOrb;
+
+ properties = props;
+ howMany = getBatchSize();
+ }
+
+ public NamingContextExt getService(String address)
+ {
+ org.omg.CORBA.Object nsObject = orb.string_to_object(address);
+ Delegate delegate = ((ObjectImpl) nsObject)._get_delegate();
+
+ // If the IOR provides the IDL ID, we can check if our name
+ // service is old NamingContext or new NamingContextExt.
+ // Not all forms of the URL always provide the IDL id.
+ if (!nsObject._is_a(NamingContextExtHelper.id())
+ && nsObject._is_a(NamingContextHelper.id()))
+ {
+ // We are surely working with the old version.
+ _NamingContextStub stub = new _NamingContextStub();
+ stub._set_delegate(delegate);
+ // The Ext object will add the necessary extensions.
+ return new Ext(stub);
+ }
+ else
+ {
+ // We expecte the service to be the NamingContextExt (this is true
+ // for both Sun's and our implementations). There is no easy way
+ // to check the version.
+ _NamingContextExtStub stub = new _NamingContextExtStub();
+ stub._set_delegate(delegate);
+ return stub;
+ }
+ }
+
+ /**
+ * Split the corbaname name into the address of the naming service (first
+ * part) and the name of the object in the naming service (second part)
+ */
+ public String[] split(String corbaloc) throws InvalidNameException
+ {
+ if (corbaloc.endsWith("#"))
+ corbaloc = corbaloc.substring(0, corbaloc.length() - 1);
+
+ // No name part - parse as corbaname.
+ if (corbaloc.indexOf('#') < 0)
+ {
+ if (!corbaloc.regionMatches(true, 0, pxCORBANAME, 0,
+ pxCORBANAME.length()))
+ throw new InvalidNameException(corbaloc + " must start with "
+ + pxCORBANAME);
+ corbaloc = pxCORBALOC + corbaloc.substring(pxCORBANAME.length());
+ return new String[] { corbaloc, "" };
+ }
+
+ return corbaloc(corbaloc, orb);
+ }
+
+ /**
+ * Give the specified name for the specified object. The passed name must not
+ * be already bound to some other object. The components of the name are
+ * mapped into the components of the CORBA name.
+ *
+ * @param name
+ * the name that will be given to the object (in the scope of this
+ * context).
+ * @param obj
+ * the object being named.
+ * @throws NameAlreadyBoundException
+ * if this name is already used to name some object.
+ * @throws InvalidAttributesException
+ * if the object does not supply all required attributes.
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void bind(Name name, Object obj) throws NamingException
+ {
+ bind(name.toString(), obj);
+ }
+
+ /**
+ * Give the specified name for the specified object. The passed name must not
+ * be already bound to some other object.
+ *
+ * @param name
+ * the name that will be given to the object (in the scope of this
+ * context).
+ * @param obj
+ * the object being named.
+ * @throws NameAlreadyBoundException
+ * if this name is already used to name some object.
+ * @throws InvalidAttributesException
+ * if the object does not supply all required attributes.
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void bind(String name, Object obj) throws NamingException
+ {
+ try
+ {
+ String[] n = split(name);
+ org.omg.CORBA.Object object = (org.omg.CORBA.Object) obj;
+ getService(n[0]).bind(transformer.toName(n[1]), object);
+ }
+ catch (ClassCastException e)
+ {
+ throw new NamingException(org.omg.CORBA.Object.class + " required ");
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException();
+ }
+ catch (AlreadyBound e)
+ {
+ throw new NameAlreadyBoundException();
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * Releases all resources, associated with this context. The close() method
+ * can be called several times, but after it has been once invoked, it is not
+ * allowed to call any other method of this context. This method destroys
+ * the ORB, if we have one.
+ *
+ * @throws NamingException
+ */
+ public void close() throws NamingException
+ {
+ if (orb != null && factory != null)
+ {
+ factory.checkIfReferenced(orb);
+ }
+ }
+
+ /**
+ * Not supported.
+ */
+ public Name composeName(Name name, Name prefix) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Not supported
+ */
+ public String composeName(String name1, String name2) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Creates the new naming subcontext and binds it to the current (this)
+ * context. The returned object will wrap around the newly created CORBA
+ * subcontext
+ *
+ * @param subContext
+ * the name of the new context being created
+ * @return the newly created context, bound to the instance of the context on
+ * that the method has been called
+ * @throws NameAlreadyBoundException
+ * if this name is already bound
+ * @throws InvalidAttributesException
+ * if the creation of the new context requires the missing mandatory
+ * attributes
+ * @throws NamingException
+ */
+ public Context createSubcontext(Name subContext) throws NamingException
+ {
+ return createSubcontext(subContext.toString());
+ }
+
+ /**
+ * Creates the new naming subcontext and binds it to the current (this)
+ * context. The returned object will wrap around the newly created CORBA
+ * subcontext
+ *
+ * @param subContext
+ * the name of the new context being created
+ * @return the newly created context, bound to the instance of the context on
+ * that the method has been called
+ * @throws NameAlreadyBoundException
+ * if this name is already bound
+ * @throws InvalidAttributesException
+ * if the creation of the new context requires the missing mandatory
+ * attributes
+ * @throws NamingException
+ */
+ public Context createSubcontext(String subContext) throws NamingException
+ {
+ try
+ {
+ String[] n = split(subContext);
+ org.omg.CORBA.Object subcontext = getService(n[0]).bind_new_context(
+ transformer.toName(n[1]));
+ Hashtable clonedProps = new Hashtable();
+ clonedProps.putAll(properties);
+
+ // Nulls are passed both for orb and factory, as the child contexts
+ // need not to do any cleanup.
+ return new ContextContinuation(subcontext, clonedProps, null, null);
+ }
+ catch (AlreadyBound e)
+ {
+ throw new NameAlreadyBoundException(subContext);
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException(subContext);
+ }
+ catch (Exception ex)
+ {
+ throw new NamingException(ex.toString());
+ }
+ }
+
+ /**
+ * Removes the naming subcontext from this naming context. Returns without
+ * action if such subcontext does not exist. The context being destroyed must
+ * be empty.
+ *
+ * @param subContext
+ * the name of the subcontext beig removed.
+ * @throws ContextNotEmptyException
+ * if the named context is not empty.
+ * @throws NamingException
+ */
+ public void destroySubcontext(Name subContext) throws NamingException
+ {
+ unbind(subContext);
+ }
+
+ /**
+ * Removes the naming subcontext from this naming context. Returns without
+ * action if such subcontext does not exist. The context being destroyed must
+ * be empty.
+ *
+ * @param subContext
+ * the name of the subcontext beig removed.
+ * @throws ContextNotEmptyException
+ * if the named context is not empty.
+ * @throws NamingException
+ */
+ public void destroySubcontext(String subContext) throws NamingException
+ {
+ unbind(subContext);
+ }
+
+ /**
+ * Returs the empty string.
+ */
+ public String getNameInNamespace() throws NamingException
+ {
+ return "";
+ }
+
+ /**
+ * Not supported.
+ */
+ public NameParser getNameParser(Name name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Not supported.
+ */
+ public NameParser getNameParser(String name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Creates and returns the enumeration over the name bindings that are present
+ * the given subcontext. The enumeration elements have the type of
+ * {@link NameClassPair}, providing also information about the class of the
+ * bound object. The behaviour in the case if the bindings are added or
+ * removed later is not defined. The contents of the subcontexts are not
+ * included.
+ *
+ * @param name
+ * the name of the subcontext
+ * @return the enumeration over the names, known for the given subcontext.
+ * @throws NamingException
+ */
+ public NamingEnumeration list(Name name) throws NamingException
+ {
+ return list(name.toString());
+ }
+
+ /**
+ * Creates and returns the enumeration over the name bindings that are present
+ * the given subcontext. The enumeration elements have the type of
+ * {@link NameClassPair}, providing also information about the class of the
+ * bound object. The behaviour in the case if the bindings are added or
+ * removed later is not defined. The contents of the subcontexts are not
+ * included.
+ *
+ * @param name
+ * the name of the subcontext
+ * @return the enumeration over the names, known for the given subcontext.
+ * @throws NamingException
+ */
+ public NamingEnumeration list(String name) throws NamingException
+ {
+ BindingIteratorHolder bi = new BindingIteratorHolder();
+ BindingListHolder bl = new BindingListHolder();
+
+ NamingContext subcontext;
+
+ String [] n = split(name);
+ NamingContextExt service = getService(n[0]);
+
+ if (n[1].length() == 0)
+ subcontext = service;
+ else
+ {
+ try
+ {
+ subcontext = (NamingContextHelper.narrow(service.resolve_str(n[1])));
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+
+ }
+
+ subcontext.list(howMany, bl, bi);
+
+ return new ListEnumeration(bl, bi, howMany);
+ }
+
+ /**
+ * Creates and returns the enumeration over the name - object bindings that
+ * are present the given subcontext. The enumeration elements have the type of
+ * {@link Binding}, providing also information about the class of the bound
+ * object. The behaviour in the case if the bindings are added or removed
+ * later is not defined. The contents of the subcontexts are not included.
+ *
+ * @param name
+ * the name of the subcontext
+ * @return the enumeration over the names, known for the given subcontext.
+ * @throws NamingException
+ */
+ public NamingEnumeration listBindings(Name name) throws NamingException
+ {
+ return listBindings(name.toString());
+ }
+
+ /**
+ * Creates and returns the enumeration over the name - object bindings that
+ * are present the given subcontext. The enumeration elements have the type of
+ * {@link Binding}, providing also information about the class of the bound
+ * object. The behaviour in the case if the bindings are added or removed
+ * later is not defined. The contents of the subcontexts are not included.
+ *
+ * @param name
+ * the name of the subcontext
+ * @return the enumeration over the names, known for the given subcontext.
+ * @throws NamingException
+ */
+ public NamingEnumeration listBindings(String name) throws NamingException
+ {
+ BindingIteratorHolder bi = new BindingIteratorHolder();
+ BindingListHolder bl = new BindingListHolder();
+
+ NamingContext subcontext;
+
+ String [] n = split(name);
+ NamingContextExt service = getService(n[0]);
+
+ if (n[1].length() == 0)
+ subcontext = service;
+ else
+ {
+ try
+ {
+ subcontext = (NamingContextHelper.narrow(service.resolve_str(n[1])));
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+
+ }
+
+ subcontext.list(howMany, bl, bi);
+
+ return new ListBindingsEnumeration(bl, bi, howMany, subcontext);
+ }
+
+ /**
+ * Gets the previously named object by name. If the passed name is empty, the
+ * method should return a cloned instance of this naming context.
+ *
+ * @param name
+ * the name of the object being searched in this context
+ * @return the named object
+ * @throws NameNotFoundException
+ * if the name is not found
+ */
+ public Object lookup(Name name) throws NamingException
+ {
+ return lookup(name.toString());
+ }
+
+ /**
+ * Gets the previously named object by name. If the passed name is empty, the
+ * method should return a cloned instance of this naming context.
+ *
+ * @param name
+ * the name of the object being searched in this context
+ * @return the named object
+ * @throws NamingException
+ * if the naming fails.
+ */
+ public Object lookup(String name) throws NamingException
+ {
+ try
+ {
+ String [] n = split(name);
+ NamingContextExt service = getService(n[0]);
+ return service.resolve_str(n[1]);
+ }
+ catch (NotFound e)
+ {
+ throw new NameNotFoundException();
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException();
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * Not supported.
+ */
+ public Object lookupLink(Name name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Not supported.
+ */
+ public Object lookupLink(String name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Give the specified name for the specified object. Unlike bind, this method
+ * silently replaces the existing binding for this name, if one exists.
+ *
+ * @param name
+ * the name that will be given to the object (in the scope of this
+ * context).
+ * @param obj
+ * the object being named.
+ * @throws InvalidAttributesException
+ * if the object does not supply all required attributes.
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void rebind(Name name, Object obj) throws NamingException
+ {
+ rebind(name.toString(), obj);
+ }
+
+ /**
+ * Give the specified name for the specified object. Unlike bind, this method
+ * silently replaces the existing binding for this name, if one exists.
+ *
+ * @param name
+ * the name that will be given to the object (in the scope of this
+ * context).
+ * @param obj
+ * the object being named.
+ * @throws InvalidAttributesException
+ * if the object does not supply all required attributes.
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void rebind(String name, Object obj) throws NamingException
+ {
+ try
+ {
+ String[] n = split(name);
+ NamingContextExt service = getService(n[0]);
+
+ org.omg.CORBA.Object object = (org.omg.CORBA.Object) obj;
+ service.rebind(transformer.toName(n[1]), object);
+ }
+ catch (ClassCastException e)
+ {
+ throw new NamingException(org.omg.CORBA.Object.class + " required ");
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException();
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * Renames the existing binding, removing the existing and giving the new name
+ * for the same object.
+ *
+ * @param oldName
+ * the existing name of the known object
+ * @param newName
+ * the new name of the same object
+ * @throws NameNotFoundException
+ * if the oldName is unknown for this context
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void rename(Name oldName, Name newName) throws NamingException
+ {
+ Object object = lookup(oldName);
+ unbind(oldName);
+ bind(newName, object);
+ }
+
+ /**
+ * Renames the existing binding, removing the existing and giving the new name
+ * for the same object.
+ *
+ * @param oldName
+ * the existing name of the known object
+ * @param newName
+ * the new name of the same object
+ * @throws NameNotFoundException
+ * if the oldName is unknown for this context
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void rename(String oldName, String newName) throws NamingException
+ {
+ Object object = lookup(oldName);
+ unbind(oldName);
+ bind(newName, object);
+ }
+
+ /**
+ * Removes the name - object mapping from the current context. This method
+ * returns without action if the name is not bound to an object in the
+ * terminal context, but throws {@link NameNotFoundException} if one of the
+ * intermadiate contexts does not exist.
+ *
+ * @param name
+ * the name to be removed
+ * @throws NameNotFoundException
+ * if one of the intermediate naming contexts does not exist. Will
+ * not be thrown if just the terminal binding is missing.
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void unbind(Name name) throws NamingException
+ {
+ unbind(name.toString());
+ }
+
+ /**
+ * Removes the name - object mapping from the current context. This method
+ * returns without action if the name is not bound to an object in the
+ * terminal context, but throws {@link NameNotFoundException} if one of the
+ * intermadiate contexts does not exist.
+ *
+ * @param name
+ * the name to be removed
+ * @throws NameNotFoundException
+ * if one of the intermediate naming contexts does not exist. Will
+ * not be thrown if just the terminal binding is missing.
+ * @throws NamingException
+ * if the naming operation has failed due other reasons.
+ */
+ public void unbind(String name) throws NamingException
+ {
+ try
+ {
+ String[] n = split(name);
+ NamingContextExt service = getService(n[0]);
+
+ service.unbind(transformer.toName(n[1]));
+ }
+ catch (NotFound e)
+ {
+ throw new NameNotFoundException(name);
+ }
+ catch (CannotProceed e)
+ {
+ throw new ContextNotEmptyException(name);
+ }
+ catch (InvalidName e)
+ {
+ throw new InvalidNameException(name);
+ }
+ }
+
+ /**
+ * Add new environment property to the environment of this context. Both name
+ * and value of the new property must not be null. If the property is already
+ * defined, is current value is replaced by the propVal.
+ *
+ * @param key
+ * the name of the new property
+ * @param value
+ * the value of the new property
+ * @return the previous value of this property or null if the property has not
+ * been previously defined
+ * @throws NamingException
+ */
+ public Object addToEnvironment(String key, Object value)
+ throws NamingException
+ {
+ if (key == null || value == null)
+ throw new NullPointerException();
+ return properties.put(key, value);
+ }
+
+ /**
+ * Returns the environment, associated with this naming context. The returned
+ * table should never be modified by the caller. Use {@link #addToEnvironment}
+ * and {@link #removeFromEnvironment} to modify the environement, if needed.
+ *
+ * @return the table, representing the environment of this context
+ * @throws NamingException
+ */
+ public Hashtable getEnvironment() throws NamingException
+ {
+ return properties;
+ }
+
+ /**
+ * Removes the property with the given name from the environment. Returns
+ * without action if this property is not defined.
+ *
+ * @param propName
+ * the name of the property being removed.
+ * @return the value of the property that has been removed or null if the
+ * property was not defined.
+ * @throws NamingException
+ */
+ public Object removeFromEnvironment(String propName) throws NamingException
+ {
+ return properties.remove(propName);
+ }
+
+ /**
+ * Convert the {@link Name} into array of the name components, required to the
+ * CORBA naming service. First the string representation is obtained, then
+ * it is converted using parsing rules of the CORBA name.
+ *
+ * @param name
+ * then name to convert
+ * @return the converted array of components.
+ */
+ public NameComponent[] toGiop(Name name) throws InvalidName
+ {
+ return transformer.toName(name.toString());
+ }
+
+ /**
+ * Get the batch size from the environment properties. The batch size is used
+ * for listing operations.
+ *
+ * @return the batch size, or some default value if not specified.
+ */
+ public int getBatchSize()
+ {
+ int batchSize = DEFAULT_BATCH_SIZE;
+ Object bs = properties.get(Context.BATCHSIZE);
+ if (bs != null)
+ {
+ try
+ {
+ int b = Integer.parseInt(bs.toString());
+ if (b >= 0)
+ batchSize = b;
+ }
+ catch (NumberFormatException e)
+ {
+ // OK, use default value.
+ }
+ }
+ return batchSize;
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/naming/giop/ListBindingsEnumeration.java b/libjava/classpath/gnu/javax/naming/giop/ListBindingsEnumeration.java
new file mode 100644
index 00000000000..00f4a0779c7
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/giop/ListBindingsEnumeration.java
@@ -0,0 +1,116 @@
+/* ListBindingsEnumeration.java -- handles corbaname: urls
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.naming.giop;
+
+import javax.naming.NamingEnumeration;
+
+import org.omg.CosNaming.Binding;
+import org.omg.CosNaming.BindingIteratorHolder;
+import org.omg.CosNaming.BindingListHolder;
+import org.omg.CosNaming.NamingContext;
+
+/**
+ * Iterates over bindings, obtaining values first from the binding list and then
+ * from the binding iterator.
+ *
+ * @author Audrius Meskauskas
+ */
+public class ListBindingsEnumeration extends GiopNamingEnumeration implements
+ NamingEnumeration
+{
+ /**
+ * The naming service, to resolve the objects.
+ */
+ NamingContext service;
+
+ /**
+ * Create the new enumeration
+ *
+ * @param bh
+ * holder, containing the first portion of the bindings
+ * @param bih
+ * the iterator, containing the remaining bindings
+ * @param batchSize
+ * the number of bindings the the iterator will be requested to
+ * return as a single pack
+ * @param aService
+ * the naming service, used to obtain the objects, bound to the
+ * names.
+ */
+ public ListBindingsEnumeration(BindingListHolder bh,
+ BindingIteratorHolder bih, int batchSize,
+ NamingContext aService)
+ {
+ super(bh, bih, batchSize);
+ service = aService;
+ }
+
+ /**
+ * Convert from the CORBA binding into the javax.naming binding. As the CORBA
+ * naming service binding does not contain the object itself, this method
+ * makes the additional calls to the naming service.
+ *
+ * @param binding
+ * the binding to convert
+ * @return the value, that must be returned by the {@link #next()}.
+ */
+ public Object convert(Binding binding)
+ {
+ StringBuffer name = new StringBuffer();
+
+ for (int i = 0; i < binding.binding_name.length; i++)
+ {
+ name.append(binding.binding_name[i]);
+ if (i < binding.binding_name.length - 1)
+ name.append('/');
+ }
+
+ try
+ {
+ Object object = service.resolve(binding.binding_name);
+ return new javax.naming.Binding(name.toString(), object);
+ }
+ catch (Exception e)
+ {
+ // Probably was removed by the concurent thread.
+ return null;
+ }
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/naming/giop/ListEnumeration.java b/libjava/classpath/gnu/javax/naming/giop/ListEnumeration.java
new file mode 100644
index 00000000000..2e64e67d393
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/giop/ListEnumeration.java
@@ -0,0 +1,116 @@
+/* ListEnumeration.java -- handles corbaname: urls
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.naming.giop;
+
+import javax.naming.NameClassPair;
+import javax.naming.NamingEnumeration;
+
+import org.omg.CosNaming.Binding;
+import org.omg.CosNaming.BindingIteratorHolder;
+import org.omg.CosNaming.BindingListHolder;
+import org.omg.CosNaming.BindingType;
+import org.omg.CosNaming.NamingContext;
+
+/**
+ * Iterates over name class pairs, obtaining values first from the binding list
+ * and then from the binding iterator.
+ *
+ * @author Audrius Meskauskas
+ */
+public class ListEnumeration extends GiopNamingEnumeration implements
+ NamingEnumeration
+{
+ /**
+ * Create the new enumeration
+ *
+ * @param bh
+ * holder, containing the first portion of the bindings
+ * @param bih
+ * the iterator, containing the remaining bindings
+ * @param batchSize
+ * the number of bindings the the iterator will be requested to
+ * return as a single pack
+ */
+ public ListEnumeration(BindingListHolder bh,
+ BindingIteratorHolder bih, int batchSize)
+ {
+ super(bh, bih, batchSize);
+ }
+
+ /**
+ * Convert from the CORBA binding into the {@link NameClassPair} that this
+ * enumeration should return. This method converts into NameClassPair,
+ * connecting the name components with slashes and setting the class name
+ * to either NamingContext or GIOP Object.
+ *
+ * @param binding
+ * the binding to convert
+ * @return the value, that must be returned by the {@link #next()}.
+ */
+ public Object convert(Binding binding)
+ {
+ StringBuffer name = new StringBuffer();
+
+ for (int i = 0; i < binding.binding_name.length; i++)
+ {
+ name.append(binding.binding_name[i]);
+ if (i < binding.binding_name.length - 1)
+ name.append('/');
+ }
+
+ String className;
+
+ switch (binding.binding_type.value())
+ {
+ case BindingType._ncontext:
+ className = NamingContext.class.getName();
+ break;
+ case BindingType._nobject:
+ className = org.omg.CORBA.Object.class.getName();
+ break;
+ default:
+ className = Object.class.getName();
+ break;
+ }
+
+ NameClassPair pair = new NameClassPair(name.toString(), className);
+ return pair;
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/naming/ictxImpl/trans/GnuName.java b/libjava/classpath/gnu/javax/naming/ictxImpl/trans/GnuName.java
new file mode 100644
index 00000000000..b20bfa4ea8b
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/ictxImpl/trans/GnuName.java
@@ -0,0 +1,467 @@
+/* GnuName.java -- implementation of the javax.naming.Name
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.naming.ictxImpl.trans;
+
+import java.util.Enumeration;
+import java.util.NoSuchElementException;
+
+import javax.naming.InvalidNameException;
+import javax.naming.Name;
+
+/**
+ * The implementation of the {@link Name}.
+ *
+ * @author Audrius Meskauskas
+ */
+public class GnuName
+ implements Name
+{
+ /**
+ * The enumeration to traverse over name components.
+ */
+ class GnuNameEnum
+ implements Enumeration
+ {
+ /**
+ * Get the new enumeration that enumerates from the given position forward
+ *
+ * @param position the position of the first name component to enumerate (0
+ * means first element)
+ */
+ GnuNameEnum(int position)
+ {
+ nxt = from + position;
+ }
+
+ /**
+ * The position of the next enumeration component to be returned or -1 if
+ * the end has been reached.
+ */
+ int nxt;
+
+ /**
+ * Check if there are more elements in this enumeration.
+ */
+ public boolean hasMoreElements()
+ {
+ return nxt >= 0;
+ }
+
+ /**
+ * Return the next element or throw a NoSuchElementException if there is no
+ * any.
+ */
+ public Object nextElement()
+ {
+ if (nxt < 0)
+ throw new NoSuchElementException();
+ Object r = content[nxt++];
+
+ if (nxt - from == length)
+ nxt = - 1;
+
+ return r;
+ }
+ }
+
+ private static final long serialVersionUID = - 3617482732056931635L;
+
+ /**
+ * The hashcode
+ */
+ int hash;
+
+ /**
+ * The content buffer of the name. This buffer may be shared, so the array
+ * member content should never be modified.
+ */
+ String[] content;
+
+ /**
+ * The place, inclusive, where the name content starts in the content buffer.
+ */
+ int from;
+
+ /**
+ * The length of the name.
+ */
+ int length;
+
+ /**
+ * Creates the unitialised name.
+ */
+ protected GnuName()
+ {
+
+ }
+
+ /**
+ * Creates the name, containing from the given chain of the atomic components.
+ *
+ * @param name the array, containing the name components.
+ */
+ public GnuName(String[] name)
+ {
+ this(name, 0, name.length);
+ }
+
+ /**
+ * Creates the name that uses the given portion of the array for its
+ * components.
+ */
+ public GnuName(String[] buffer, int useFrom, int useLength)
+ {
+ content = buffer;
+ from = useFrom;
+ length = useLength;
+ }
+
+ /**
+ * Inserts the given <code>String</code> component to this <code>Name</code>
+ * at the given index. The method modifies the current <code>Name</code> and
+ * then returns it.
+ *
+ * @exception ArrayIndexOutOfBoundsException if the given index is smaller
+ * then zero or greater then or equal to <code>size()</code>.
+ * @exception InvalidNameException if the given <code>String</code> is not a
+ * valid component for this <code>Name</code>.
+ */
+ public Name add(int posn, String comp) throws InvalidNameException
+ {
+ String[] nc = new String[content.length + 1];
+ System.arraycopy(content, from, nc, 0, posn);
+ nc[posn] = comp;
+ System.arraycopy(content, from + posn, nc, posn + 1, length - posn);
+
+ content = nc;
+ from = 0;
+ length = content.length;
+ hash = 0;
+ return this;
+ }
+
+ /**
+ * Adds the given <code>String</code> component to the end of this
+ * <code>Name</code>. The method modifies the current <code>Name</code>
+ * and then returns it.
+ *
+ * @exception InvalidNameException if the given <code>String</code> is not a
+ * valid component for this <code>Name</code>.
+ */
+ public Name add(String comp) throws InvalidNameException
+ {
+ String[] nc = new String[content.length + 1];
+ System.arraycopy(content, from, nc, 0, length);
+ nc[nc.length - 1] = comp;
+
+ content = nc;
+ from = 0;
+ length = content.length;
+ hash = 0;
+ return this;
+ }
+
+ /**
+ * Inserts all the components of the given <code>Name</code> to this
+ * <code>Name</code> at the given index. Components after this index (if
+ * any) are shifted up. The method modifies the current <code>Name</code>
+ * and then returns it.
+ *
+ * @exception ArrayIndexOutOfBoundsException if the given index is smaller
+ * then zero or greater then or equal to <code>size()</code>.
+ * @exception InvalidNameException if any of the given components is not a
+ * valid component for this <code>Name</code>.
+ */
+ public Name addAll(int posn, Name n) throws InvalidNameException
+ {
+ String[] nc = new String[length + n.size()];
+ System.arraycopy(content, from, nc, 0, posn);
+
+ int i = posn;
+ for (int p = 0; p < n.size(); i++, p++)
+ nc[i] = n.get(p);
+
+ System.arraycopy(content, from + posn, nc, i, length - posn);
+
+ length = length + n.size();
+ hash = 0;
+ content = nc;
+ return this;
+ }
+
+ /**
+ * Adds all the components of the given <code>Name</code> to the end of this
+ * <code>Name</code>. The method modifies the current <code>Name</code>
+ * and then returns it.
+ *
+ * @exception InvalidNameException if any of the given components is not a
+ * valid component for this <code>Name</code>.
+ */
+ public Name addAll(Name suffix) throws InvalidNameException
+ {
+ String[] nc = new String[length + suffix.size()];
+ System.arraycopy(content, from, nc, 0, length);
+
+ for (int i = length, p = 0; i < nc.length; i++, p++)
+ nc[i] = suffix.get(p);
+
+ length = length + suffix.size();
+ hash = 0;
+ content = nc;
+ return this;
+ }
+
+ /**
+ * Compares the given object to this <code>Name</code>. Returns a negative
+ * value if the given <code>Object</code> is smaller then this
+ * <code>Name</code>, a positive value if the <code>Object</code> is
+ * bigger, and zero if the are equal. If the <code>Object</code> is not of a
+ * class that can be compared to the class of this <code>Name</code> then a
+ * <code>ClassCastException</code> is thrown. Note that it is not guaranteed
+ * that <code>Name</code>s implemented in different classes can be
+ * compared. The definition of smaller, bigger and equal is up to the actual
+ * implementing class.
+ */
+ public int compareTo(Object obj)
+ {
+ Name n = (Name) obj;
+
+ int l = Math.min(length, n.size());
+ int c;
+
+ for (int i = 0; i < l; i++)
+ {
+ c = content[from + i].compareTo(n.get(i));
+ if (c != 0)
+ return c;
+ }
+ return length - n.size();
+ }
+
+ /**
+ * Returns <code>true</code> if this <code>Name</code> ends with the
+ * components of the given <code>Name</code>, <code>false</code>
+ * otherwise.
+ */
+ public boolean endsWith(Name n)
+ {
+ if (n.size() > length)
+ return false;
+
+ int ofs = length - n.size() + from;
+
+ for (int i = 0; i < n.size(); i++, ofs++)
+ if (! content[ofs].equals(n.get(i)))
+ return false;
+
+ return true;
+ }
+
+ /**
+ * Gets the component at the given index.
+ *
+ * @exception ArrayIndexOutOfBoundsException if the given index is smaller
+ * then zero or greater then or equal to <code>size()</code>.
+ */
+ public String get(int posn)
+ {
+ return content[from + posn];
+ }
+
+ /**
+ * Returns a non-null (but possibly empty) <code>Enumeration</code> of the
+ * components of the <code>Name</code> as <code>String</code>s.
+ */
+ public Enumeration getAll()
+ {
+ return new GnuNameEnum(0);
+ }
+
+ /**
+ * Returns the components till the given index as a <code>Name</code>. The
+ * returned <code>Name</code> can be modified without changing the original.
+ *
+ * @param posn the ending position, exclusive
+ * @exception ArrayIndexOutOfBoundsException if the given index is smaller
+ * then zero or greater then or equal to <code>size()</code>.
+ */
+ public Name getPrefix(int posn)
+ {
+ return new GnuName(content, from, posn);
+ }
+
+ /**
+ * Returns the components from the given index till the end as a
+ * <code>Name</code>. The returned <code>Name</code> can be modified
+ * without changing the original.
+ *
+ * @param posn the starting position, inclusive. If it is equal to the size of
+ * the name, the empty name is returned.
+ * @exception ArrayIndexOutOfBoundsException if the given index is smaller
+ * then zero or greater then or equal to <code>size()</code>.
+ */
+ public Name getSuffix(int posn)
+ {
+ return new GnuName(content, from + posn, length - posn);
+ }
+
+ /**
+ * Returns <code>true</code> if the number of components of this
+ * <code>Name</code> is zero, <code>false</code> otherwise.
+ */
+ public boolean isEmpty()
+ {
+ return length == 0;
+ }
+
+ /**
+ * Removes the component at the given index from this <code>Name</code>.
+ * The method modifies the current <code>Name</code> and then returns it.
+ *
+ * @exception InvalidNameException if the name size reduces below zero.
+ */
+ public Object remove(int posn) throws InvalidNameException
+ {
+ if (length == 0)
+ throw new InvalidNameException("negative size");
+ else
+ {
+ length--;
+ if (posn == 0)
+ from++;
+ else if (posn < length)
+ {
+ String[] nc = new String[length];
+ System.arraycopy(content, from, nc, 0, posn);
+ System.arraycopy(content, from + posn + 1, nc, posn, length - posn);
+ content = nc;
+ from = 0;
+ }
+ }
+ hash = 0;
+ return this;
+ }
+
+ /**
+ * Returns the number of components of this <code>Name</code>. The returned
+ * number can be zero.
+ */
+ public int size()
+ {
+ return length;
+ }
+
+ /**
+ * Returns <code>true</code> if this <code>Name</code> starts with the
+ * components of the given <code>Name</code>, <code>false</code>
+ * otherwise.
+ */
+ public boolean startsWith(Name n)
+ {
+ if (n.size() > length)
+ return false;
+
+ for (int i = 0; i < n.size(); i++)
+ if (! content[from + i].equals(n.get(i)))
+ return false;
+
+ return true;
+ }
+
+ /**
+ * Returns a clone of this <code>Name</code>. It will be a deep copy of all
+ * the components of the <code>Name</code> so that changes to components of
+ * the components does not change the component in this <code>Name</code>.
+ */
+ public Object clone()
+ {
+ return new GnuName(content, from, length);
+ }
+
+ /**
+ * The name is equal to other name if they contents are equal.
+ */
+ public boolean equals(Object arg0)
+ {
+ if (this == arg0)
+ return true;
+ else if (arg0 instanceof Name)
+ {
+ Name n = (Name) arg0;
+ if (length != n.size())
+ return false;
+
+ for (int i = 0; i < length; i++)
+ if (! content[from + i].equals(n.get(i)))
+ return false;
+ return true;
+ }
+ else
+ return false;
+ }
+
+ /**
+ * Overridden to make consistent with equals.
+ */
+ public int hashCode()
+ {
+ if (hash == 0 && length > 0)
+ {
+ int s = 0;
+ for (int i = from; i < from + length; i++)
+ s ^= content[i].hashCode();
+ hash = s;
+ }
+ return hash;
+ }
+
+ /**
+ * Get the string representation, separating the name components by slashes
+ */
+ public String toString()
+ {
+ StringBuffer b = new StringBuffer();
+ for (int i = 0; i < length; i++)
+ {
+ b.append(get(i));
+ if (i < length - 1)
+ b.append('/');
+ }
+ return b.toString();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/naming/jndi/url/corbaname/corbanameURLContextFactory.java b/libjava/classpath/gnu/javax/naming/jndi/url/corbaname/corbanameURLContextFactory.java
new file mode 100644
index 00000000000..7fe2e5c8cad
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/jndi/url/corbaname/corbanameURLContextFactory.java
@@ -0,0 +1,53 @@
+/* corbanameURLContextFactory.java -- handles corbaname: urls
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.naming.jndi.url.corbaname;
+
+import gnu.javax.naming.giop.GiopNamingServiceFactory;
+
+import javax.naming.spi.ObjectFactory;
+
+/**
+ * The GIOP URL context factory.
+ *
+ * @author Audrius Meskauskas (audriusa@Bioinformatics.org)
+ */
+public class corbanameURLContextFactory extends GiopNamingServiceFactory
+ implements ObjectFactory
+{
+ // Nothing to override here.
+}
diff --git a/libjava/classpath/gnu/javax/naming/jndi/url/rmi/ContextContinuation.java b/libjava/classpath/gnu/javax/naming/jndi/url/rmi/ContextContinuation.java
new file mode 100644
index 00000000000..de79b93c3dc
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/jndi/url/rmi/ContextContinuation.java
@@ -0,0 +1,597 @@
+/* ContextContinuation.java -- RMI naming context
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.naming.jndi.url.rmi;
+
+import java.rmi.AccessException;
+import java.rmi.AlreadyBoundException;
+import java.rmi.NotBoundException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.naming.CommunicationException;
+import javax.naming.Context;
+import javax.naming.InvalidNameException;
+import javax.naming.Name;
+import javax.naming.NameAlreadyBoundException;
+import javax.naming.NameNotFoundException;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.OperationNotSupportedException;
+
+/**
+ * The implementation of the RMI URL context. This context connects
+ *
+ * @author Audrius Meskauskas
+ */
+public class ContextContinuation implements Context
+{
+ /**
+ * The default registry location.
+ */
+ public static final String DEFAULT_REGISTRY_LOCATION = "rmi://localhost:1099";
+
+ /**
+ * The local or remote RMI registry, performing the actual work for this
+ * context.
+ */
+ Registry registry;
+
+ /**
+ * The properties.
+ */
+ Properties properties;
+
+ /**
+ * The flag, indicating, that the lookup methods were called before.
+ * If the lookup methods were called before, the existing ORB cannot be
+ * destroyed, as references to the existing objects will become
+ * unfunctional.
+ */
+ boolean lookupCalled;
+
+ /**
+ * Add new environment property to the environment of this context. Both name
+ * and value of the new property must not be null. If the property is already
+ * defined, is current value is replaced by the propVal. This method replaces
+ * the registry. The new registry will be lazily instantiated on the first
+ * call.
+ *
+ * @param propName
+ * the name of the new property
+ * @param propVal
+ * the value of the new property
+ * @return the previous value of this property or null if the property has not
+ * been previously defined
+ */
+ public Object addToEnvironment(String key, Object value)
+ {
+ removeRegistry();
+ if (key == null || value == null)
+ throw new NullPointerException();
+ return properties.put(key, value);
+ }
+
+ /**
+ * Returns the environment, associated with this naming context. The returned
+ * table should never be modified by the caller (the registry would not be updated
+ * in such case). Use {@link #addToEnvironment} and
+ * {@link #removeFromEnvironment} to modify the environement, if needed.
+ *
+ * @return the table, representing the environment of this context
+ * @throws NamingException
+ */
+ public Hashtable getEnvironment() throws NamingException
+ {
+ return properties;
+ }
+
+ /**
+ * Removes the property with the given name from the environment. Returns
+ * without action if this property is not defined. Replaces the ORB,
+ * constructing the new ORB with the changes set of properties (you can
+ * replace the CORBA implementation provider, for instance). The new ORB will
+ * be lazily instantiated on the first call.
+ *
+ * @param propName
+ * the name of the property being removed.
+ * @return the value of the property that has been removed or null if the
+ * property was not defined.
+ * @throws NamingException
+ */
+ public Object removeFromEnvironment(String propName) throws NamingException
+ {
+ removeRegistry();
+ return properties.remove(propName);
+ }
+
+ /**
+ * Remove the current registry reference.
+ */
+ public void removeRegistry()
+ {
+ registry = null;
+ }
+
+ /**
+ * Get the cached or new registry reference.
+ *
+ * @return the registry reference, either cached or new.
+ */
+ public Registry getRegistry() throws NamingException
+ {
+ if (registry == null)
+ {
+ String address = properties.getProperty(Context.PROVIDER_URL,
+ DEFAULT_REGISTRY_LOCATION);
+
+ // The format like rmi://localhost:1099 is expected. Parse.
+ if (!address.startsWith("rmi://"))
+ throw new InvalidNameException(address);
+
+ String a = address.substring("rmi://".length());
+
+ // The colon, if present, indicates the start of the port number.
+ int colon = a.lastIndexOf(':');
+ int port;
+
+ try
+ {
+ if (colon >=0)
+ {
+ port = Integer.parseInt(a.substring(colon+1));
+ a = a.substring(0, colon);
+ }
+ else
+ port = Registry.REGISTRY_PORT;
+ }
+ catch (NumberFormatException e1)
+ {
+ throw new InvalidNameException(address);
+ }
+
+ try
+ {
+ registry = LocateRegistry.getRegistry(a, port);
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ }
+ return registry;
+ }
+
+ /**
+ * Create the rmi url context that works, talking with the given RMI registry.
+ *
+ * @param props
+ * the properties for this context
+ * @param initialRegistry
+ * the initial value of the registry
+ */
+ public ContextContinuation(Map props, Registry initialRegistry)
+ {
+ properties = new Properties();
+ if (props != null)
+ properties.putAll(props);
+ registry = initialRegistry;
+ }
+
+ /**
+ * Bind the given name into this context. The .toString() is called to
+ * convert into the string representation, required by RMI registry.
+ *
+ * @throws NamingException if the object is not an instance of Remote
+ */
+ public void bind(Name name, Object obj) throws NamingException
+ {
+ bind(name.toString(), obj);
+ }
+
+ /**
+ * Bind the given name into this context.
+ */
+ public void bind(String name, Object obj) throws NamingException
+ {
+ try
+ {
+ getRegistry().bind(name, (Remote) obj);
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException("access:"+e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (AlreadyBoundException e)
+ {
+ throw new NameAlreadyBoundException(name);
+ }
+ catch (ClassCastException c)
+ {
+ throw new NamingException("Only Remote can be bound:"
+ + obj.getClass().getName());
+ }
+ }
+
+ /**
+ * Not supported.
+ */
+ public Name composeName(Name name, Name prefix) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Not supported.
+ */
+ public String composeName(String name, String prefix) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Subcontexts are not supporte by RMI registry. The only supported case is an
+ * empty name (returns the cloned instance of self).
+ */
+ public Context createSubcontext(Name name) throws NamingException
+ {
+ if (name.size() == 0)
+ return new rmiURLContext(properties);
+ else
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Subcontexts are not supporte by RMI registry. The only supported case is an
+ * empty name (returns the cloned instance of self).
+ */
+ public Context createSubcontext(String name) throws NamingException
+ {
+ if (name.length() == 0)
+ return new rmiURLContext(properties);
+ else
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Subcontexts are not supporte by RMI registry.
+ */
+ public void destroySubcontext(Name name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Subcontexts are not supporte by RMI registry.
+ */
+ public void destroySubcontext(String name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Returns the naming service URL, same that was passed vie
+ * {@link Context#PROVIDER_URL}.
+ */
+ public String getNameInNamespace() throws NamingException
+ {
+ return properties.getProperty(Context.PROVIDER_URL,
+ DEFAULT_REGISTRY_LOCATION);
+ }
+
+ /**
+ * Not supported, this context never parses any names.
+ */
+ public NameParser getNameParser(Name name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Not supported, this context never parses any names.
+ */
+ public NameParser getNameParser(String name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * List existing bindings of this context (the parameter must be empty name,
+ * indicating the root context). The class name of the returned name class
+ * pairs is "Remote", as this "quick preview" method should probably not call
+ * the naming service again. Use listBindings if more details are required.
+ */
+ public NamingEnumeration list(Name name) throws NamingException
+ {
+ if (name.size() > 0)
+ throw new OperationNotSupportedException("Only empty name is accepted");
+ return list("");
+ }
+
+ /**
+ * List existing bindings of this context (the parameter must be empty string,
+ * indicating the root context). The class name of the returned name class
+ * pairs is "Remote", as this "quick preview" method should probably not call
+ * the naming service again. Use listBindings if more details are required.
+ */
+ public NamingEnumeration list(String name) throws NamingException
+ {
+ if (name.length() > 0)
+ throw new OperationNotSupportedException("Only empty name is accepted");
+
+ try
+ {
+ return new ListEnumeration(getRegistry().list());
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * List existing bindings of this context (the parameter must be empty name,
+ * indicating the root context).
+ */
+ public NamingEnumeration listBindings(Name name) throws NamingException
+ {
+ if (name.size() > 0)
+ throw new OperationNotSupportedException("Only empty name is accepted");
+ return listBindings("");
+ }
+
+ /**
+ * List existing bindings of this context (the parameter must be empty name,
+ * indicating the root context).
+ */
+ public NamingEnumeration listBindings(String name) throws NamingException
+ {
+ if (name.length() > 0)
+ throw new OperationNotSupportedException("Only empty name is accepted");
+
+ try
+ {
+ Registry r = getRegistry();
+ return new ListBindingsEnumeration(r.list(), r);
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * Not supported.
+ */
+ public Object lookupLink(Name name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Not supported.
+ */
+ public Object lookupLink(String name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Rebinds this object.
+ *
+ * @param name
+ * the object name (.toString()) is used to convert into string
+ * representation.
+ * @param the
+ * object (must be an instance of Remote).
+ */
+ public void rebind(Name name, Object obj) throws NamingException
+ {
+ rebind(name.toString(), obj);
+ }
+
+ /**
+ * Rebinds this object.
+ *
+ * @param name
+ * the object name.
+ * @param the
+ * object (must be an instance of Remote).
+ */
+ public void rebind(String name, Object obj) throws NamingException
+ {
+ try
+ {
+ getRegistry().rebind(name, (Remote) obj);
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException("access:"+e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (ClassCastException c)
+ {
+ throw new NamingException("Only Remote can be bound:"
+ + obj.getClass().getName());
+ }
+ }
+
+ /**
+ * Renames the object. If the new name is already bound in the given context,
+ * the {@link AlreadyBoundException} is thrown and the oldName binding is
+ * preserved.
+ */
+ public void rename(Name oldName, Name newName) throws NamingException
+ {
+ rename(oldName.toString(), newName.toString());
+ }
+
+ /**
+ * Renames the object. If the new name is already bound in the given context,
+ * the {@link AlreadyBoundException} is thrown and the oldName binding is
+ * preserved.
+ */
+ public synchronized void rename(String oldName, String newName)
+ throws NamingException
+ {
+ try
+ {
+ Registry r = getRegistry();
+ Remote object = r.lookup(oldName);
+ r.unbind(oldName);
+ try
+ {
+ r.bind(newName, object);
+ }
+ catch (AlreadyBoundException e)
+ {
+ // Bind it back.
+ try
+ {
+ r.bind(oldName, object);
+ }
+ catch (AlreadyBoundException e1)
+ {
+ // We have just removed this name.
+ throw new InternalError();
+ }
+ throw new NameAlreadyBoundException(newName);
+ }
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException(e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (NotBoundException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ }
+
+ /**
+ * Unbind the object.
+ */
+ public void unbind(Name name) throws NamingException
+ {
+ unbind(name.toString());
+ }
+
+ /**
+ * Unbind the object.
+ */
+ public void unbind(String name) throws NamingException
+ {
+ try
+ {
+ getRegistry().unbind(name);
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException(e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (NotBoundException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ }
+
+ /**
+ * Release the associated resources.
+ */
+ public void close() throws NamingException
+ {
+ removeRegistry();
+ }
+
+ /**
+ * Resolve the object by name.
+ *
+ * @param name
+ * the object name, .toString() is used to get the string
+ * representation.
+ */
+ public Object lookup(Name name) throws NamingException
+ {
+ return lookup(name.toString());
+ }
+
+ /**
+ * Resolve the object by name
+ *
+ * @param name the object name.
+ */
+ public Object lookup(String name) throws NamingException
+ {
+ try
+ {
+ return getRegistry().lookup(name);
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException(e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (NotBoundException e)
+ {
+ throw new NameNotFoundException(name);
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/javax/naming/jndi/url/rmi/ListBindingsEnumeration.java b/libjava/classpath/gnu/javax/naming/jndi/url/rmi/ListBindingsEnumeration.java
new file mode 100644
index 00000000000..757e8bf59c1
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/jndi/url/rmi/ListBindingsEnumeration.java
@@ -0,0 +1,97 @@
+/* ListBindingsEnumeration.java -- handles rmi: urls
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.naming.jndi.url.rmi;
+
+import java.rmi.registry.Registry;
+
+import javax.naming.NamingEnumeration;
+
+/**
+ * Iterates over bindings, obtaining values first from the binding list and then
+ * from the binding iterator.
+ *
+ * @author Audrius Meskauskas
+ */
+public class ListBindingsEnumeration extends RmiNamingEnumeration implements
+ NamingEnumeration
+{
+ /**
+ * The naming service, to resolve the objects.
+ */
+ Registry service;
+
+ /**
+ * Create the new enumeration
+ *
+ * @param bindings
+ * the list of the bound names
+ * @param aService
+ * the RMI naming service, used to get the bound values.
+ */
+ public ListBindingsEnumeration(String [] bindings,
+ Registry aService)
+ {
+ super(bindings);
+ service = aService;
+ }
+
+ /**
+ * Convert from the CORBA binding into the javax.naming binding. As the CORBA
+ * naming service binding does not contain the object itself, this method
+ * makes the additional calls to the naming service.
+ *
+ * @param binding
+ * the binding to convert
+ * @return the value, that must be returned by the {@link #next()}.
+ */
+ public Object convert(String binding)
+ {
+ try
+ {
+ Object object = service.lookup(binding);
+ return new javax.naming.Binding(binding, object);
+ }
+ catch (Exception e)
+ {
+ // Probably was removed by the concurent thread.
+ return null;
+ }
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/naming/jndi/url/rmi/ListEnumeration.java b/libjava/classpath/gnu/javax/naming/jndi/url/rmi/ListEnumeration.java
new file mode 100644
index 00000000000..b4142c5e37d
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/jndi/url/rmi/ListEnumeration.java
@@ -0,0 +1,80 @@
+/* ListEnumeration.java -- handles rmi: urls
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.naming.jndi.url.rmi;
+
+import java.rmi.Remote;
+
+import javax.naming.NameClassPair;
+import javax.naming.NamingEnumeration;
+
+/**
+ * Iterates over name class pairs, obtaining values first from the binding list
+ * and then from the binding iterator.
+ *
+ * @author Audrius Meskauskas
+ */
+public class ListEnumeration extends RmiNamingEnumeration implements
+ NamingEnumeration
+{
+ /**
+ * Create the new enumeration
+ *
+ * @param bindings
+ * the array of the binding names, returned by the RMI registry.
+ */
+ public ListEnumeration(String [] bindings)
+ {
+ super(bindings);
+ }
+
+ /**
+ * Convert from the binding name into the {@link NameClassPair} that this
+ * enumeration should return.
+ *
+ * @param binding
+ * the binding to convert
+ * @return the value, that must be returned by the {@link #next()}.
+ */
+ public Object convert(String binding)
+ {
+ NameClassPair pair = new NameClassPair(binding, Remote.class.getName());
+ return pair;
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/naming/jndi/url/rmi/RmiContinuation.java b/libjava/classpath/gnu/javax/naming/jndi/url/rmi/RmiContinuation.java
new file mode 100644
index 00000000000..29eb61b4be5
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/jndi/url/rmi/RmiContinuation.java
@@ -0,0 +1,594 @@
+/* RmiContinuation.java -- RMI naming context
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.naming.jndi.url.rmi;
+
+import java.rmi.AccessException;
+import java.rmi.AlreadyBoundException;
+import java.rmi.NotBoundException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.naming.CommunicationException;
+import javax.naming.Context;
+import javax.naming.InvalidNameException;
+import javax.naming.Name;
+import javax.naming.NameAlreadyBoundException;
+import javax.naming.NameNotFoundException;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.OperationNotSupportedException;
+
+/**
+ * The implementation of the RMI URL context. This context connects
+ *
+ * @author Audrius Meskauskas
+ */
+public class RmiContinuation implements Context
+{
+ /**
+ * The default registry location.
+ */
+ public static final String DEFAULT_REGISTRY_LOCATION = "rmi://localhost:1099";
+
+ /**
+ * The local or remote RMI registry, performing the actual work for this
+ * context.
+ */
+ Registry registry;
+
+ /**
+ * The properties.
+ */
+ Properties properties;
+
+ /**
+ * The flag, indicating, that the lookup methods were called before.
+ * If the lookup methods were called before, the existing ORB cannot be
+ * destroyed, as references to the existing objects will become
+ * unfunctional.
+ */
+ boolean lookupCalled;
+
+ /**
+ * Add new environment property to the environment of this context. Both name
+ * and value of the new property must not be null. If the property is already
+ * defined, is current value is replaced by the propVal. This method replaces
+ * the registry. The new registry will be lazily instantiated on the first
+ * call.
+ *
+ * @param key
+ * the name of the new property
+ * @param value
+ * the value of the new property
+ * @return the previous value of this property or null if the property has not
+ * been previously defined
+ */
+ public Object addToEnvironment(String key, Object value)
+ {
+ removeRegistry();
+ if (key == null || value == null)
+ throw new NullPointerException();
+ return properties.put(key, value);
+ }
+
+ /**
+ * Returns the environment, associated with this naming context. The returned
+ * table should never be modified by the caller (the registry would not be updated
+ * in such case). Use {@link #addToEnvironment} and
+ * {@link #removeFromEnvironment} to modify the environement, if needed.
+ *
+ * @return the table, representing the environment of this context
+ * @throws NamingException
+ */
+ public Hashtable getEnvironment() throws NamingException
+ {
+ return properties;
+ }
+
+ /**
+ * Removes the property with the given name from the environment. Returns
+ * without action if this property is not defined. Replaces the ORB,
+ * constructing the new ORB with the changes set of properties (you can
+ * replace the CORBA implementation provider, for instance). The new ORB will
+ * be lazily instantiated on the first call.
+ *
+ * @param propName
+ * the name of the property being removed.
+ * @return the value of the property that has been removed or null if the
+ * property was not defined.
+ * @throws NamingException
+ */
+ public Object removeFromEnvironment(String propName) throws NamingException
+ {
+ removeRegistry();
+ return properties.remove(propName);
+ }
+
+ /**
+ * Remove the current registry reference.
+ */
+ public void removeRegistry()
+ {
+ registry = null;
+ }
+
+ /**
+ * Get the cached or new registry reference.
+ *
+ * @return the registry reference, either cached or new.
+ */
+ public Registry getRegistry() throws NamingException
+ {
+ if (registry == null)
+ {
+ String address = properties.getProperty(Context.PROVIDER_URL,
+ DEFAULT_REGISTRY_LOCATION);
+
+ // The format like rmi://localhost:1099 is expected. Parse.
+ if (!address.startsWith("rmi://"))
+ throw new InvalidNameException(address);
+
+ String a = address.substring("rmi://".length());
+
+ // The colon, if present, indicates the start of the port number.
+ int colon = a.lastIndexOf(':');
+ int port;
+
+ try
+ {
+ if (colon >=0)
+ {
+ port = Integer.parseInt(a.substring(colon+1));
+ a = a.substring(0, colon);
+ }
+ else
+ port = Registry.REGISTRY_PORT;
+ }
+ catch (NumberFormatException e1)
+ {
+ throw new InvalidNameException(address);
+ }
+
+ try
+ {
+ registry = LocateRegistry.getRegistry(a, port);
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ }
+ return registry;
+ }
+
+ /**
+ * Create the rmi url context that works, talking with the given RMI registry.
+ *
+ * @param props
+ * the properties for this context
+ */
+ public RmiContinuation(Map props)
+ {
+ properties = new Properties();
+ if (props != null)
+ properties.putAll(props);
+ }
+
+ /**
+ * Bind the given name into this context. The .toString() is called to
+ * convert into the string representation, required by RMI registry.
+ *
+ * @throws NamingException if the object is not an instance of Remote
+ */
+ public void bind(Name name, Object obj) throws NamingException
+ {
+ bind(name.toString(), obj);
+ }
+
+ /**
+ * Bind the given name into this context.
+ */
+ public void bind(String name, Object obj) throws NamingException
+ {
+ try
+ {
+ getRegistry().bind(name, (Remote) obj);
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException("access:"+e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (AlreadyBoundException e)
+ {
+ throw new NameAlreadyBoundException(name);
+ }
+ catch (ClassCastException c)
+ {
+ throw new NamingException("Only Remote can be bound:"
+ + obj.getClass().getName());
+ }
+ }
+
+ /**
+ * Not supported.
+ */
+ public Name composeName(Name name, Name prefix) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Not supported.
+ */
+ public String composeName(String name, String prefix) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Subcontexts are not supporte by RMI registry. The only supported case is an
+ * empty name (returns the cloned instance of self).
+ */
+ public Context createSubcontext(Name name) throws NamingException
+ {
+ if (name.size() == 0)
+ return new RmiContinuation(properties);
+ else
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Subcontexts are not supporte by RMI registry. The only supported case is an
+ * empty name (returns the cloned instance of self).
+ */
+ public Context createSubcontext(String name) throws NamingException
+ {
+ if (name.length() == 0)
+ return new RmiContinuation(properties);
+ else
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Subcontexts are not supporte by RMI registry.
+ */
+ public void destroySubcontext(Name name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Subcontexts are not supporte by RMI registry.
+ */
+ public void destroySubcontext(String name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Returns the naming service URL, same that was passed vie
+ * {@link Context#PROVIDER_URL}.
+ */
+ public String getNameInNamespace() throws NamingException
+ {
+ return properties.getProperty(Context.PROVIDER_URL,
+ DEFAULT_REGISTRY_LOCATION);
+ }
+
+ /**
+ * Not supported, this context never parses any names.
+ */
+ public NameParser getNameParser(Name name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Not supported, this context never parses any names.
+ */
+ public NameParser getNameParser(String name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * List existing bindings of this context (the parameter must be empty name,
+ * indicating the root context). The class name of the returned name class
+ * pairs is "Remote", as this "quick preview" method should probably not call
+ * the naming service again. Use listBindings if more details are required.
+ */
+ public NamingEnumeration list(Name name) throws NamingException
+ {
+ if (name.size() > 0)
+ throw new OperationNotSupportedException("Only empty name is accepted");
+ return list("");
+ }
+
+ /**
+ * List existing bindings of this context (the parameter must be empty string,
+ * indicating the root context). The class name of the returned name class
+ * pairs is "Remote", as this "quick preview" method should probably not call
+ * the naming service again. Use listBindings if more details are required.
+ */
+ public NamingEnumeration list(String name) throws NamingException
+ {
+ if (name.length() > 0)
+ throw new OperationNotSupportedException("Only empty name is accepted");
+
+ try
+ {
+ return new ListEnumeration(getRegistry().list());
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * List existing bindings of this context (the parameter must be empty name,
+ * indicating the root context).
+ */
+ public NamingEnumeration listBindings(Name name) throws NamingException
+ {
+ if (name.size() > 0)
+ throw new OperationNotSupportedException("Only empty name is accepted");
+ return listBindings("");
+ }
+
+ /**
+ * List existing bindings of this context (the parameter must be empty name,
+ * indicating the root context).
+ */
+ public NamingEnumeration listBindings(String name) throws NamingException
+ {
+ if (name.length() > 0)
+ throw new OperationNotSupportedException("Only empty name is accepted");
+
+ try
+ {
+ Registry r = getRegistry();
+ return new ListBindingsEnumeration(r.list(), r);
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * Not supported.
+ */
+ public Object lookupLink(Name name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Not supported.
+ */
+ public Object lookupLink(String name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Rebinds this object.
+ *
+ * @param name
+ * the object name (.toString()) is used to convert into string
+ * representation.
+ * @param obj
+ * object (must be an instance of Remote).
+ */
+ public void rebind(Name name, Object obj) throws NamingException
+ {
+ rebind(name.toString(), obj);
+ }
+
+ /**
+ * Rebinds this object.
+ *
+ * @param name
+ * the object name.
+ * @param obj
+ * object (must be an instance of Remote).
+ */
+ public void rebind(String name, Object obj) throws NamingException
+ {
+ try
+ {
+ getRegistry().rebind(name, (Remote) obj);
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException("access:"+e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (ClassCastException c)
+ {
+ throw new NamingException("Only Remote can be bound:"
+ + obj.getClass().getName());
+ }
+ }
+
+ /**
+ * Renames the object. If the new name is already bound in the given context,
+ * the {@link AlreadyBoundException} is thrown and the oldName binding is
+ * preserved.
+ */
+ public void rename(Name oldName, Name newName) throws NamingException
+ {
+ rename(oldName.toString(), newName.toString());
+ }
+
+ /**
+ * Renames the object. If the new name is already bound in the given context,
+ * the {@link AlreadyBoundException} is thrown and the oldName binding is
+ * preserved.
+ */
+ public synchronized void rename(String oldName, String newName)
+ throws NamingException
+ {
+ try
+ {
+ Registry r = getRegistry();
+ Remote object = r.lookup(oldName);
+ r.unbind(oldName);
+ try
+ {
+ r.bind(newName, object);
+ }
+ catch (AlreadyBoundException e)
+ {
+ // Bind it back.
+ try
+ {
+ r.bind(oldName, object);
+ }
+ catch (AlreadyBoundException e1)
+ {
+ // We have just removed this name.
+ throw new InternalError();
+ }
+ throw new NameAlreadyBoundException(newName);
+ }
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException(e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (NotBoundException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ }
+
+ /**
+ * Unbind the object.
+ */
+ public void unbind(Name name) throws NamingException
+ {
+ unbind(name.toString());
+ }
+
+ /**
+ * Unbind the object.
+ */
+ public void unbind(String name) throws NamingException
+ {
+ try
+ {
+ getRegistry().unbind(name);
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException(e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (NotBoundException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ }
+
+ /**
+ * Release the associated resources.
+ */
+ public void close() throws NamingException
+ {
+ removeRegistry();
+ }
+
+ /**
+ * Resolve the object by name.
+ *
+ * @param name
+ * the object name, .toString() is used to get the string
+ * representation.
+ */
+ public Object lookup(Name name) throws NamingException
+ {
+ return lookup(name.toString());
+ }
+
+ /**
+ * Resolve the object by name
+ *
+ * @param name the object name.
+ */
+ public Object lookup(String name) throws NamingException
+ {
+ try
+ {
+ return getRegistry().lookup(name);
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException(e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (NotBoundException e)
+ {
+ throw new NameNotFoundException(name);
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/javax/naming/jndi/url/rmi/RmiNamingEnumeration.java b/libjava/classpath/gnu/javax/naming/jndi/url/rmi/RmiNamingEnumeration.java
new file mode 100644
index 00000000000..6d88cccefe3
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/jndi/url/rmi/RmiNamingEnumeration.java
@@ -0,0 +1,130 @@
+/* RmiNamingEnumeration.java -- handles rmi: urls
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.naming.jndi.url.rmi;
+
+import java.util.NoSuchElementException;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+/**
+ * Iterates over name class pairs, obtaining values first from the binding list
+ * and then from the binding iterator.
+ *
+ * @author Audrius Meskauskas
+ */
+public abstract class RmiNamingEnumeration implements NamingEnumeration
+{
+ /**
+ * The array of bindings, returned at once.
+ */
+ String[] list;
+
+ /**
+ * The position of the element in the binding list, that must be returned
+ * during the subsequent call of the next(). If this field is grater or equal
+ * to the lenght of the list, the subsequent values must be requested from the
+ * iterator.
+ */
+ int p;
+
+ RmiNamingEnumeration(String[] bindingList)
+ {
+ list = bindingList;
+ }
+
+ /**
+ * Convert from the CORBA binding into that this enumeration should return.
+ *
+ * @param binding
+ * the binding to convert
+ * @return the value, that must be returned by the {@link #next()}.
+ */
+ public abstract Object convert(String binding);
+
+ /**
+ * Checks if there are more elements to return.
+ *
+ * @throws NamingException
+ * never
+ */
+ public boolean hasMore() throws NamingException
+ {
+ return hasMoreElements();
+ }
+
+ /**
+ * Returns the next element.
+ *
+ * @throws NamingException
+ * never
+ */
+ public Object next() throws NamingException
+ {
+ return nextElement();
+ }
+
+ /**
+ * Checks if there are more elements to return.
+ */
+ public boolean hasMoreElements()
+ {
+ return p < list.length;
+ }
+
+ /**
+ * Returns the next element.
+ */
+ public Object nextElement()
+ {
+ if (p < list.length)
+ return convert(list[p++]);
+ else
+ throw new NoSuchElementException();
+ }
+
+ /**
+ * Nothing to do in this method.
+ */
+ public void close()
+ {
+ // Nothing to do here.
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/naming/jndi/url/rmi/rmiURLContext.java b/libjava/classpath/gnu/javax/naming/jndi/url/rmi/rmiURLContext.java
new file mode 100644
index 00000000000..a17ce026b16
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/jndi/url/rmi/rmiURLContext.java
@@ -0,0 +1,637 @@
+/* rmiURLContext.java -- RMI naming context
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.naming.jndi.url.rmi;
+
+import java.rmi.AccessException;
+import java.rmi.AlreadyBoundException;
+import java.rmi.NotBoundException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Properties;
+import java.util.WeakHashMap;
+
+import javax.naming.CommunicationException;
+import javax.naming.Context;
+import javax.naming.InvalidNameException;
+import javax.naming.Name;
+import javax.naming.NameAlreadyBoundException;
+import javax.naming.NameNotFoundException;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.OperationNotSupportedException;
+
+/**
+ * The implementation of the RMI URL context. This context connects
+ *
+ * @author Audrius Meskauskas
+ */
+public class rmiURLContext implements Context
+{
+ /**
+ * The default registry location.
+ */
+ public static final String DEFAULT_REGISTRY_LOCATION = "rmi://localhost:1099";
+
+ /**
+ * The registry cache, maps the registry URL's to they instances. The
+ * obtained registries are reused, as newly obtaining them may cause the
+ * resource leak.
+ */
+ static WeakHashMap registryCache = new WeakHashMap();
+
+ /**
+ * The properties.
+ */
+ Properties properties;
+
+ /**
+ * The flag, indicating, that the lookup methods were called before.
+ * If the lookup methods were called before, the existing ORB cannot be
+ * destroyed, as references to the existing objects will become
+ * unfunctional.
+ */
+ boolean lookupCalled;
+
+ /**
+ * Add new environment property to the environment of this context. Both name
+ * and value of the new property must not be null. If the property is already
+ * defined, is current value is replaced by the propVal. This method replaces
+ * the registry. The new registry will be lazily instantiated on the first
+ * call.
+ *
+ * @param key
+ * the name of the new property
+ * @param value
+ * the value of the new property
+ * @return the previous value of this property or null if the property has not
+ * been previously defined
+ */
+ public Object addToEnvironment(String key, Object value)
+ {
+ if (key == null || value == null)
+ throw new NullPointerException();
+ return properties.put(key, value);
+ }
+
+ /**
+ * Returns the environment, associated with this naming context. The returned
+ * table should never be modified by the caller (the registry would not be updated
+ * in such case). Use {@link #addToEnvironment} and
+ * {@link #removeFromEnvironment} to modify the environement, if needed.
+ *
+ * @return the table, representing the environment of this context
+ * @throws NamingException
+ */
+ public Hashtable getEnvironment() throws NamingException
+ {
+ return properties;
+ }
+
+ /**
+ * Removes the property with the given name from the environment. Returns
+ * without action if this property is not defined. Replaces the ORB,
+ * constructing the new ORB with the changes set of properties (you can
+ * replace the CORBA implementation provider, for instance). The new ORB will
+ * be lazily instantiated on the first call.
+ *
+ * @param propName
+ * the name of the property being removed.
+ * @return the value of the property that has been removed or null if the
+ * property was not defined.
+ * @throws NamingException
+ */
+ public Object removeFromEnvironment(String propName) throws NamingException
+ {
+ return properties.remove(propName);
+ }
+
+ /**
+ * Get the cached or new registry reference.
+ *
+ * @return the registry reference, either cached or new.
+ */
+ public Registry getRegistry(String netAddress) throws NamingException
+ {
+ Registry registry;
+
+ synchronized (registryCache)
+ {
+ registry = (Registry) registryCache.get(netAddress);
+ }
+
+ if (registry == null)
+ {
+ // The colon, if present, indicates the start of the port number.
+ int colon = netAddress.lastIndexOf(':');
+ int port;
+
+ try
+ {
+ if (colon >= 0)
+ {
+ port = Integer.parseInt(netAddress.substring(colon + 1));
+ netAddress = netAddress.substring(0, colon);
+ }
+ else
+ port = Registry.REGISTRY_PORT;
+ }
+ catch (NumberFormatException e1)
+ {
+ throw new InvalidNameException(netAddress);
+ }
+
+ try
+ {
+ registry = LocateRegistry.getRegistry(netAddress, port);
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+
+ synchronized (registryCache)
+ {
+ registryCache.put(netAddress, registry);
+ }
+ }
+ return registry;
+ }
+
+ /**
+ * Create the rmi url context that works, talking with the given RMI registry.
+ *
+ * @param props
+ * the properties for this context
+ */
+ public rmiURLContext(Map props)
+ {
+ properties = new Properties();
+ if (props != null)
+ properties.putAll(props);
+ }
+
+ /**
+ * Bind the given name into this context. The .toString() is called to
+ * convert into the string representation, required by RMI registry.
+ *
+ * @throws NamingException if the object is not an instance of Remote
+ */
+ public void bind(Name name, Object obj) throws NamingException
+ {
+ bind(name.toString(), obj);
+ }
+
+ /**
+ * Bind the given name into this context.
+ */
+ public void bind(String name, Object obj) throws NamingException
+ {
+ try
+ {
+ String [] n = split(name);
+ getRegistry(n[0]).bind(n[1], (Remote) obj);
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException("access:"+e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (AlreadyBoundException e)
+ {
+ throw new NameAlreadyBoundException(name);
+ }
+ catch (ClassCastException c)
+ {
+ throw new NamingException("Only Remote can be bound:"
+ + obj.getClass().getName());
+ }
+ }
+
+ /**
+ * Not supported.
+ */
+ public Name composeName(Name name, Name prefix) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Not supported.
+ */
+ public String composeName(String name, String prefix) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Subcontexts are not supporte by RMI registry. The only supported case is an
+ * empty name (returns the cloned instance of self).
+ */
+ public Context createSubcontext(Name name) throws NamingException
+ {
+ if (name.size() == 0)
+ return new rmiURLContext(properties);
+ else
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Subcontexts are not supporte by RMI registry. The only supported case is an
+ * empty name (returns the cloned instance of self).
+ */
+ public Context createSubcontext(String name) throws NamingException
+ {
+ if (name.length() == 0)
+ return new rmiURLContext(properties);
+ else
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Subcontexts are not supporte by RMI registry.
+ */
+ public void destroySubcontext(Name name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Subcontexts are not supporte by RMI registry.
+ */
+ public void destroySubcontext(String name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Returns the naming service URL, same that was passed vie
+ * {@link Context#PROVIDER_URL}.
+ */
+ public String getNameInNamespace() throws NamingException
+ {
+ return properties.getProperty(Context.PROVIDER_URL,
+ DEFAULT_REGISTRY_LOCATION);
+ }
+
+ /**
+ * Not supported, this context never parses any names.
+ */
+ public NameParser getNameParser(Name name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * Not supported, this context never parses any names.
+ */
+ public NameParser getNameParser(String name) throws NamingException
+ {
+ throw new OperationNotSupportedException();
+ }
+
+ /**
+ * List existing bindings of this context (the parameter must be empty name,
+ * indicating the root context). The class name of the returned name class
+ * pairs is "Remote", as this "quick preview" method should probably not call
+ * the naming service again. Use listBindings if more details are required.
+ */
+ public NamingEnumeration list(Name name) throws NamingException
+ {
+ return list(name);
+ }
+
+ /**
+ * List existing bindings of thie given registry.The class name of the
+ * returned name class pairs is "Remote", as this "quick preview" method
+ * should probably not call the naming service again. Use listBindings if more
+ * details are required.
+ */
+ public NamingEnumeration list(String name) throws NamingException
+ {
+ try
+ {
+ String [] n = split(name);
+ if (n[1].length() > 0)
+ throw new InvalidNameException(name+", the name part must be empty");
+ return new ListEnumeration(getRegistry(n[0]).list());
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * List existing bindings of this context (the parameter must be empty name,
+ * indicating the root context).
+ */
+ public NamingEnumeration listBindings(Name name) throws NamingException
+ {
+ return listBindings(name.toString());
+ }
+
+ /**
+ * List existing bindings of this context.
+ */
+ public NamingEnumeration listBindings(String name) throws NamingException
+ {
+ try
+ {
+ String [] n = split(name);
+ if (n[1].length() > 0)
+ throw new InvalidNameException(name+", the name part must be empty");
+
+ Registry r = getRegistry(n[0]);
+ return new ListBindingsEnumeration(r.list(), r);
+ }
+ catch (Exception e)
+ {
+ throw new NamingException(e.toString());
+ }
+ }
+
+ /**
+ * Returns the naming service context under the given address, wrapped as
+ * Context.
+ */
+ public Object lookupLink(Name name) throws NamingException
+ {
+ return lookupLink(name.toString());
+ }
+
+ /**
+ * Returns the naming service context under the given address,
+ * wrapped as Context.
+ */
+ public Object lookupLink(String name) throws NamingException
+ {
+ return new ContextContinuation(properties, getRegistry(name));
+ }
+
+ /**
+ * Rebinds this object.
+ *
+ * @param name
+ * the object name (.toString()) is used to convert into string
+ * representation.
+ * @param obj
+ * object (must be an instance of Remote).
+ */
+ public void rebind(Name name, Object obj) throws NamingException
+ {
+ rebind(name.toString(), obj);
+ }
+
+ /**
+ * Rebinds this object.
+ *
+ * @param name
+ * the object name.
+ * @param obj
+ * object (must be an instance of Remote).
+ */
+ public void rebind(String name, Object obj) throws NamingException
+ {
+ try
+ {
+ String [] n = split(name);
+ getRegistry(n[0]).rebind(n[1], (Remote) obj);
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException("access:"+e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (ClassCastException c)
+ {
+ throw new NamingException("Only Remote can be bound:"
+ + obj.getClass().getName());
+ }
+ }
+
+ /**
+ * Renames the object. If the new name is already bound in the given context,
+ * the {@link AlreadyBoundException} is thrown and the oldName binding is
+ * preserved.
+ */
+ public void rename(Name oldName, Name newName) throws NamingException
+ {
+ rename(oldName.toString(), newName.toString());
+ }
+
+ /**
+ * Renames the object. If the new name is already bound in the given context,
+ * the {@link AlreadyBoundException} is thrown and the oldName binding is
+ * preserved.
+ */
+ public synchronized void rename(String oldName, String newName)
+ throws NamingException
+ {
+ try
+ {
+ String [] n = split(oldName);
+ Registry r = getRegistry(n[0]);
+ Remote object = r.lookup(n[1]);
+ r.unbind(oldName);
+ try
+ {
+ String [] n2 = split(newName);
+ Registry r2 = getRegistry(n2[0]);
+ r2.bind(n2[1], object);
+ }
+ catch (AlreadyBoundException e)
+ {
+ // Bind it back.
+ try
+ {
+ r.bind(oldName, object);
+ }
+ catch (AlreadyBoundException e1)
+ {
+ // We have just removed this name.
+ throw new InternalError();
+ }
+ throw new NameAlreadyBoundException(newName);
+ }
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException(e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (NotBoundException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ }
+
+ /**
+ * Unbind the object.
+ */
+ public void unbind(Name name) throws NamingException
+ {
+ unbind(name.toString());
+ }
+
+ /**
+ * Unbind the object.
+ */
+ public void unbind(String name) throws NamingException
+ {
+ try
+ {
+ String [] n = split(name);
+ getRegistry(n[0]).unbind(n[1]);
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException(e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (NotBoundException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ }
+
+ /**
+ * Release the associated resources.
+ */
+ public void close() throws NamingException
+ {
+ }
+
+ /**
+ * Resolve the object by name.
+ *
+ * @param name
+ * the object name, .toString() is used to get the string
+ * representation.
+ */
+ public Object lookup(Name name) throws NamingException
+ {
+ return lookup(name.toString());
+ }
+
+ /**
+ * Resolve the object by name
+ *
+ * @param name the object name.
+ */
+ public Object lookup(String name) throws NamingException
+ {
+ try
+ {
+ String [] n = split(name);
+ return getRegistry(n[0]).lookup(n[1]);
+ }
+ catch (AccessException e)
+ {
+ throw new NamingException(e.toString());
+ }
+ catch (RemoteException e)
+ {
+ throw new CommunicationException(e.toString());
+ }
+ catch (NotBoundException e)
+ {
+ throw new NameNotFoundException(name);
+ }
+ }
+
+ /**
+ * Split the given rmi address into the network address and naming service
+ * name.
+ *
+ * @param address
+ * the address to split
+ * @return the two member array, lower being the network address of the naming
+ * service and upper being the naming service name
+ * @throws NamingException
+ * if the name is invalid
+ */
+ public String[] split(String address) throws NamingException
+ {
+ // The format like rmi://localhost:1099/name is expected. Parse.
+ if (!address.startsWith("rmi://"))
+ throw new InvalidNameException(
+ address
+ + " should be like 'rmi://localhost:1099/name'");
+
+ String a = address.substring("rmi://".length());
+
+ // The suffix starts after the first slash from the rmi://
+ int sfx = a.indexOf('/');
+
+ // Handle the possible escape
+ while (sfx > 0 && a.charAt(sfx - 1) == '\\')
+ sfx = a.indexOf('/', sfx + 1);
+
+ String net;
+ String name;
+ if (sfx >= 0)
+ {
+ net = a.substring(0, sfx);
+ name = a.substring(sfx + 1);
+ }
+ else
+ {
+ net = a;
+ name = "";
+ }
+
+ return new String[] { net, name };
+ }
+}
diff --git a/libjava/classpath/gnu/javax/naming/jndi/url/rmi/rmiURLContextFactory.java b/libjava/classpath/gnu/javax/naming/jndi/url/rmi/rmiURLContextFactory.java
new file mode 100644
index 00000000000..59384532736
--- /dev/null
+++ b/libjava/classpath/gnu/javax/naming/jndi/url/rmi/rmiURLContextFactory.java
@@ -0,0 +1,66 @@
+/* rmiURLContextFactory.java -- handles RMI naming context
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.naming.jndi.url.rmi;
+
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.spi.ObjectFactory;
+
+/**
+ * Find the RMI URL context. This factory checks the Context.PROVIDER_URL
+ * property for the address of the RMI naming service and creates the
+ * context that operates talking with this naming service. If such property
+ * is missing, "rmi://localhost:1099" is assumed.
+ *
+ * @author Audrius Meskauskas (audriusa@Bioinformatics.org)
+ */
+public class rmiURLContextFactory implements ObjectFactory
+{
+
+ /**
+ * Create a new instance of the context.
+ */
+ public Object getObjectInstance(Object refObj, Name name, Context nameCtx,
+ Hashtable environment)
+ {
+ return new rmiURLContext(environment);
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/AbstractSessionContext.java b/libjava/classpath/gnu/javax/net/ssl/AbstractSessionContext.java
new file mode 100644
index 00000000000..bdd7f274e06
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/AbstractSessionContext.java
@@ -0,0 +1,288 @@
+/* AbstractSessionContext -- stores SSL sessions, possibly persistently.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl;
+
+import gnu.java.security.Requires;
+
+import gnu.javax.net.ssl.provider.SimpleSessionContext;
+
+import java.util.Enumeration;
+
+import javax.net.ssl.SSLException;
+import javax.net.ssl.SSLPermission;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.SSLSessionContext;
+
+/**
+ * A skeletal implementation of {@link SSLSessionContext}. This class may
+ * be subclassed to add extended functionality to session contexts, such
+ * as by storing sessions in files on disk, or by sharing contexts
+ * across different JVM instances.
+ *
+ * <p>In order to securely store sessions, along with private key data,
+ * the abstract methods {@lnk {@link #load(char[])} and {@link #store(char[])}
+ * come into play. When storing sessions, a session context implementation
+ * must pass this password to the {@link Session#prepare(char[])} method,
+ * before either writing the {@link java.io.Serializable} session to the
+ * underlying store, or getting the opaque {@link Session#privateData()}
+ * class from the session, and storing that.
+ *
+ * <p>As a simple example, that writes sessions to some object output
+ * stream:
+ *
+ * <pre>
+ char[] password = ...;
+ ObjectOutputStream out = ...;
+ ...
+ for (Session s : this)
+ {
+ s.prepare(password);
+ out.writeObject(s);
+ }</pre>
+ *
+ * <p>The reverse must be done when deserializing sessions, by using the
+ * {@link Session#repair(char[])} method, possibly by first calling
+ * {@link Session#setPrivateData(java.io.Serializable)} with the read,
+ * opaque private data type. Thus an example of reading may be:
+ *
+ * <pre>
+ char[] password = ...;
+ ObjectInputStream in = ...;
+ ...
+ while (hasMoreSessions(in))
+ {
+ Session s = (Session) in.readObject();
+ s.repair(password);
+ addToThisStore(s);
+ }</pre>
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public abstract class AbstractSessionContext implements SSLSessionContext
+{
+ protected long timeout;
+ private static Class<? extends AbstractSessionContext>
+ implClass = SimpleSessionContext.class;
+
+ /**
+ * Create a new instance of a session context, according to the configured
+ * implementation class.
+ *
+ * @return The new session context.
+ * @throws SSLException If an error occurs in creating the instance.
+ */
+ public static AbstractSessionContext newInstance () throws SSLException
+ {
+ try
+ {
+ return implClass.newInstance();
+ }
+ catch (IllegalAccessException iae)
+ {
+ throw new SSLException(iae);
+ }
+ catch (InstantiationException ie)
+ {
+ throw new SSLException(ie);
+ }
+ }
+
+ /**
+ * Reconfigure this instance to use a different session context
+ * implementation.
+ *
+ * <p><strong>Note:</strong> this method requires that the caller have
+ * {@link SSLPermission} with target
+ * <code>gnu.javax.net.ssl.AbstractSessionContext</code> and action
+ * <code>setImplClass</code>.
+ *
+ * @param clazz The new implementation class.
+ * @throws SecurityException If the caller does not have permission to
+ * change the session context.
+ */
+ @Requires(permissionClass = SSLPermission.class,
+ target = "gnu.javax.net.ssl.AbstractSessionContext",
+ action = "setImplClass")
+ public static synchronized void setImplClass
+ (Class<? extends AbstractSessionContext> clazz)
+ throws SecurityException
+ {
+ SecurityManager sm = System.getSecurityManager ();
+ if (sm != null)
+ sm.checkPermission(new SSLPermission("gnu.javax.net.ssl.AbstractSessionContext",
+ "setImplClass"));
+ implClass = clazz;
+ }
+
+ /**
+ * @param timeout The initial session timeout.
+ */
+ protected AbstractSessionContext (final int timeout)
+ {
+ setSessionTimeout(timeout);
+ }
+
+ /**
+ * Fetch a saved session by its ID. This method will (possibly)
+ * deserialize and return the SSL session with that ID, or null if
+ * the requested session does not exist, or has expired.
+ *
+ * <p>Subclasses implementing this class <strong>must not</strong>
+ * perform any blocking operations in this method. If any blocking
+ * behavior is required, it must be done in the {@link load(char[])}
+ * method.
+ *
+ * @param sessionId The ID of the session to get.
+ * @return The found session, or null if no such session was found,
+ * or if that session has expired.
+ */
+ public final SSLSession getSession (byte[] sessionId)
+ {
+ Session s = implGet (sessionId);
+ if (s != null
+ && System.currentTimeMillis () - s.getLastAccessedTime () > timeout)
+ {
+ remove (sessionId);
+ return null;
+ }
+ return s;
+ }
+
+ public final SSLSession getSession(String host, int port)
+ {
+ for (Enumeration e = getIds(); e.hasMoreElements(); )
+ {
+ byte[] id = (byte[]) e.nextElement();
+ SSLSession s = getSession(id);
+ if (s == null) // session expired.
+ continue;
+ String host2 = s.getPeerHost();
+ if (host == null)
+ {
+ if (host2 != null)
+ continue;
+ }
+ else if (!host.equals(host2))
+ continue;
+ int port2 = s.getPeerPort();
+ if (port != port2)
+ continue;
+
+ // Else, a match.
+ return s;
+ }
+
+ return null;
+ }
+
+ /**
+ * To be implemented by subclasses. Subclasses do not need to check
+ * timeouts in this method.
+ *
+ * @param sessionId The session ID.
+ * @return The session, or <code>null</code> if the requested session
+ * was not found.
+ */
+ protected abstract Session implGet (byte[] sessionId);
+
+ public int getSessionTimeout()
+ {
+ return (int) (timeout / 1000);
+ }
+
+ /**
+ * Load this session store from the underlying media, if supported
+ * by the implementation.
+ *
+ * @param password The password that protects the sensitive data in
+ * this store.
+ * @throws SessionStoreException If reading this store fails, such
+ * as when an I/O exception occurs, or if the password is incorrect.
+ */
+ public abstract void load (char[] password) throws SessionStoreException;
+
+ /**
+ * Add a new session to the store. The underlying implementation
+ * will add the session to its store, possibly overwriting any
+ * existing session with the same ID.
+ *
+ * <p>Subclasses implementing this class <strong>must not</strong>
+ * perform any blocking operations in this method. If any blocking
+ * behavior is required, it must be done in the {@link
+ * #store(char[])} method.
+ *
+ * @param session The session to add.
+ * @throws NullPointerException If the argument is null.
+ */
+ public abstract void put (Session session);
+
+ /**
+ * Remove a session from this store.
+ *
+ * <p>Subclasses implementing this class <strong>must not</strong>
+ * perform any blocking operations in this method. If any blocking
+ * behavior is required, it must be done in the {@link
+ * #store(char[])} method.
+ *
+ * @param sessionId The ID of the session to remove.
+ */
+ public abstract void remove (byte[] sessionId);
+
+ /**
+ *
+ */
+ public final void setSessionTimeout(int seconds)
+ {
+ if (timeout < 0)
+ throw new IllegalArgumentException("timeout may not be negative");
+ this.timeout = (long) seconds * 1000;
+ }
+
+ /**
+ * Commit this session store to the underlying media. For session
+ * store implementations that support saving sessions across
+ * invocations of the JVM, this method will save any sessions that
+ * have not expired to some persistent media, so they may be loaded
+ * and used again later.
+ *
+ * @param password The password that will protect the sensitive data
+ * in this store.
+ */
+ public abstract void store (char[] password) throws SessionStoreException;
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/PreSharedKeyManager.java b/libjava/classpath/gnu/javax/net/ssl/PreSharedKeyManager.java
new file mode 100644
index 00000000000..ba6500a27d4
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/PreSharedKeyManager.java
@@ -0,0 +1,54 @@
+/* PreSharedKeyManager.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl;
+
+import java.security.KeyManagementException;
+
+import javax.crypto.SecretKey;
+import javax.net.ssl.KeyManager;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public interface PreSharedKeyManager extends KeyManager
+{
+ SecretKey getKey(String name) throws KeyManagementException;
+
+ String chooseIdentityHint();
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/PreSharedKeyManagerParameters.java b/libjava/classpath/gnu/javax/net/ssl/PreSharedKeyManagerParameters.java
new file mode 100644
index 00000000000..1b1d492b1ae
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/PreSharedKeyManagerParameters.java
@@ -0,0 +1,83 @@
+/* PreSharedKeyManagerParameters.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+
+import javax.crypto.SecretKey;
+import javax.net.ssl.ManagerFactoryParameters;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class PreSharedKeyManagerParameters
+ implements ManagerFactoryParameters
+{
+ private final LinkedHashMap<String, SecretKey> keys;
+
+ public PreSharedKeyManagerParameters()
+ {
+ keys = new LinkedHashMap<String, SecretKey>();
+ }
+
+ public SecretKey getKey(String name)
+ {
+ name.getClass();
+ return keys.get(name);
+ }
+
+ public void putKey(String name, SecretKey key)
+ {
+ name.getClass();
+ key.getClass();
+ keys.put(name, key);
+ }
+
+ public boolean removeKey(String name)
+ {
+ name.getClass();
+ return keys.remove(name) != null;
+ }
+
+ public Iterator<String> identities()
+ {
+ return keys.keySet().iterator();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/PrivateCredentials.java b/libjava/classpath/gnu/javax/net/ssl/PrivateCredentials.java
index f602f98ae22..442629309e7 100644
--- a/libjava/classpath/gnu/javax/net/ssl/PrivateCredentials.java
+++ b/libjava/classpath/gnu/javax/net/ssl/PrivateCredentials.java
@@ -51,6 +51,7 @@ import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.Security;
+import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
@@ -95,16 +96,16 @@ public class PrivateCredentials implements ManagerFactoryParameters
public static final String BEGIN_RSA = "-----BEGIN RSA PRIVATE KEY";
public static final String END_RSA = "-----END RSA PRIVATE KEY";
- private List privateKeys;
- private List certChains;
+ private List<PrivateKey> privateKeys;
+ private List<X509Certificate[]> certChains;
// Constructor.
// -------------------------------------------------------------------------
public PrivateCredentials()
{
- privateKeys = new LinkedList();
- certChains = new LinkedList();
+ privateKeys = new LinkedList<PrivateKey>();
+ certChains = new LinkedList<X509Certificate[]>();
}
// Instance methods.
@@ -115,7 +116,7 @@ public class PrivateCredentials implements ManagerFactoryParameters
IOException, NoSuchAlgorithmException, WrongPaddingException
{
CertificateFactory cf = CertificateFactory.getInstance("X.509");
- Collection certs = cf.generateCertificates(certChain);
+ Collection<? extends Certificate> certs = cf.generateCertificates(certChain);
X509Certificate[] chain = (X509Certificate[]) certs.toArray(new X509Certificate[0]);
String alg = null;
@@ -199,11 +200,12 @@ public class PrivateCredentials implements ManagerFactoryParameters
(BigInteger) der.read().getValue(), // d mod (q-1)
(BigInteger) der.read().getValue()); // coefficient
}
+
privateKeys.add(kf.generatePrivate(spec));
certChains.add(chain);
}
- public List getPrivateKeys()
+ public List<PrivateKey> getPrivateKeys()
{
if (isDestroyed())
{
@@ -212,7 +214,7 @@ public class PrivateCredentials implements ManagerFactoryParameters
return privateKeys;
}
- public List getCertChains()
+ public List<X509Certificate[]> getCertChains()
{
return certChains;
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/SSLCipherSuite.java b/libjava/classpath/gnu/javax/net/ssl/SSLCipherSuite.java
new file mode 100644
index 00000000000..a3ab8771389
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/SSLCipherSuite.java
@@ -0,0 +1,142 @@
+/* SSLCipherSuite.java -- an SSL cipher suite.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl;
+
+import gnu.java.security.Engine;
+
+import java.lang.reflect.InvocationTargetException;
+import java.nio.ByteBuffer;
+import java.security.NoSuchAlgorithmException;
+import java.security.Provider;
+import java.security.Security;
+
+/**
+ * An SSL cipher suite.
+ */
+public abstract class SSLCipherSuite
+{
+ private static final String SERVICE = "SSLCipherSuite";
+ private final String algorithm;
+ private final byte[] id;
+ private final SSLProtocolVersion version;
+ private Provider provider;
+
+ protected SSLCipherSuite (final String algorithm, final byte[] id,
+ final SSLProtocolVersion version)
+ {
+ this.algorithm = algorithm;
+ if (id.length != 2)
+ throw new IllegalArgumentException ("cipher suite ID must be two bytes");
+ this.id = (byte[]) id.clone ();
+ this.version = version;
+ }
+
+ public static final SSLCipherSuite getInstance (SSLProtocolVersion version, byte[] id)
+ throws NoSuchAlgorithmException
+ {
+ return getInstance (version + "-" + ((id[0] & 0xFF) + "/" + (id[1] & 0xFF)));
+ }
+
+ public static final SSLCipherSuite getInstance (SSLProtocolVersion version,
+ byte[] id, Provider provider)
+ throws NoSuchAlgorithmException
+ {
+ return getInstance (version + "-" + (id[0] & 0xFF) + "/" + (id[1] & 0xFF), provider);
+ }
+
+ public static final SSLCipherSuite getInstance (String name)
+ throws NoSuchAlgorithmException
+ {
+ Provider[] providers = Security.getProviders ();
+ for (int i = 0; i < providers.length; i++)
+ {
+ try
+ {
+ return getInstance (name, providers[i]);
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ // Ignore.
+ }
+ }
+
+ throw new NoSuchAlgorithmException (SERVICE + ": " + name);
+ }
+
+ public static final SSLCipherSuite getInstance (String name, Provider provider)
+ throws NoSuchAlgorithmException
+ {
+ SSLCipherSuite suite = null;
+ try
+ {
+ suite = (SSLCipherSuite) Engine.getInstance (SERVICE, name, provider);
+ suite.provider = provider;
+ }
+ catch (InvocationTargetException ite)
+ {
+ // XXX
+ NoSuchAlgorithmException nsae = new NoSuchAlgorithmException (name);
+ nsae.initCause (ite);
+ throw nsae;
+ }
+ return suite;
+ }
+
+ public final String getAlgorithm ()
+ {
+ return algorithm;
+ }
+
+ public final byte[] getId ()
+ {
+ return (byte[]) id.clone ();
+ }
+
+ public final Provider getProvider ()
+ {
+ return provider;
+ }
+
+ public final SSLProtocolVersion getProtocolVersion ()
+ {
+ return version;
+ }
+
+ public abstract void encipher (ByteBuffer in, ByteBuffer out);
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/SSLProtocolVersion.java b/libjava/classpath/gnu/javax/net/ssl/SSLProtocolVersion.java
new file mode 100644
index 00000000000..3998f936abe
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/SSLProtocolVersion.java
@@ -0,0 +1,54 @@
+/* SSLProtocolVersion.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl;
+
+public enum SSLProtocolVersion
+{
+ SSLv3 (3, 0),
+ TLSv1 (3, 1);
+
+ public final int major;
+ public final int minor;
+
+ private SSLProtocolVersion (int major, int minor)
+ {
+ this.major = major;
+ this.minor = minor;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/SSLRecordHandler.java b/libjava/classpath/gnu/javax/net/ssl/SSLRecordHandler.java
new file mode 100644
index 00000000000..3147415fe36
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/SSLRecordHandler.java
@@ -0,0 +1,101 @@
+/* SSLRecordHandler.java -- a class that handles SSL record layer messages.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl;
+
+import java.nio.ByteBuffer;
+import javax.net.ssl.SSLEngineResult;
+import javax.net.ssl.SSLException;
+
+public abstract class SSLRecordHandler
+{
+ private final byte contentType;
+
+ /**
+ * Create a new record handler for the given content type.
+ */
+ protected SSLRecordHandler (final byte contentType)
+ {
+ this.contentType = contentType;
+ }
+
+ /**
+ * Handle an SSL record layer message, encapsulated in the supplied
+ * input buffer, and writing any output bytes to the output
+ * buffer. The input buffer is always only limited to the bytes that
+ * encapsulate the <em>fragment</em> of the record layer message
+ * &mdash; that is, the content-type, version, and length fields are
+ * not present in the input buffer, and the limit of the input
+ * buffer is always only as large as the fragment. If the message
+ * being read is not contained entirely within the given buffer,
+ * then the implementation should cache the bytes read as input, and
+ * wait until subsequent calls finish the object being read.
+ *
+ * <p>Technically, we expect only APPLICATION messages to ever
+ * produce output, but do suppose that extensions to the SSL
+ * protocol could allow other channels that produce output.
+ *
+ * @param input The input buffer.
+ * @param output The output buffer.
+ */
+ public abstract void handle (final ByteBuffer input,
+ final ByteBuffer output)
+ throws SSLException;
+
+ /**
+ * Returns the record layer content type that this handler is for.
+ *
+ * @return The content type value.
+ */
+ public final byte contentType ()
+ {
+ return contentType;
+ }
+
+ public boolean equals (final Object o)
+ {
+ if (!(o instanceof SSLRecordHandler))
+ return false;
+ return ((SSLRecordHandler) o).contentType == contentType;
+ }
+
+ public int hashCode ()
+ {
+ return contentType & 0xFF;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/Session.java b/libjava/classpath/gnu/javax/net/ssl/Session.java
new file mode 100644
index 00000000000..e2b21aa1e81
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/Session.java
@@ -0,0 +1,364 @@
+/* SessionImpl.java -- concrete definition of SSLSession.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl;
+
+import java.io.Serializable;
+
+import java.security.Principal;
+import java.security.SecureRandom;
+import java.security.cert.Certificate;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Set;
+
+import javax.crypto.SealedObject;
+import javax.net.ssl.SSLException;
+import javax.net.ssl.SSLPeerUnverifiedException;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.SSLSessionBindingEvent;
+import javax.net.ssl.SSLSessionBindingListener;
+import javax.net.ssl.SSLSessionContext;
+import javax.security.cert.X509Certificate;
+
+/**
+ * A concrete implementation of the {@link SSLSession} interface. This
+ * class is provided to allow pluggable {@link AbstractSessionContext}
+ * implementations.
+ */
+public abstract class Session implements SSLSession, Serializable
+{
+ protected final long creationTime;
+ protected long lastAccessedTime;
+ protected int applicationBufferSize;
+
+ protected ID sessionId;
+ protected Certificate[] localCerts;
+ protected Certificate[] peerCerts;
+ protected X509Certificate[] peerCertChain;
+ protected String peerHost;
+ protected int peerPort;
+ protected boolean peerVerified;
+ protected HashMap<String,Object> values;
+ protected boolean valid;
+ protected boolean truncatedMac = false;
+ transient protected SecureRandom random;
+ transient protected SSLSessionContext context;
+
+ protected Session()
+ {
+ creationTime = System.currentTimeMillis();
+ values = new HashMap<String, Object>();
+ applicationBufferSize = (1 << 14);
+ }
+
+ public void access()
+ {
+ lastAccessedTime = System.currentTimeMillis ();
+ }
+
+ public int getApplicationBufferSize()
+ {
+ return applicationBufferSize;
+ }
+
+ public String getCipherSuite()
+ {
+ return null;
+ }
+
+ public long getCreationTime()
+ {
+ return creationTime;
+ }
+
+ public byte[] getId()
+ {
+ return sessionId.id();
+ }
+
+ public ID id()
+ {
+ return sessionId;
+ }
+
+ public long getLastAccessedTime()
+ {
+ return lastAccessedTime;
+ }
+
+ public Certificate[] getLocalCertificates()
+ {
+ if (localCerts == null)
+ return null;
+ return (Certificate[]) localCerts.clone();
+ }
+
+ public Principal getLocalPrincipal()
+ {
+ if (localCerts != null)
+ {
+ if (localCerts[0] instanceof java.security.cert.X509Certificate)
+ return ((java.security.cert.X509Certificate) localCerts[0]).getSubjectDN();
+ }
+ return null;
+ }
+
+ public int getPacketBufferSize()
+ {
+ return applicationBufferSize + 2048;
+ }
+
+ public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException
+ {
+ if (!peerVerified)
+ throw new SSLPeerUnverifiedException("peer not verified");
+ if (peerCerts == null)
+ return null;
+ return (Certificate[]) peerCerts.clone();
+ }
+
+ public X509Certificate[] getPeerCertificateChain()
+ throws SSLPeerUnverifiedException
+ {
+ if (!peerVerified)
+ throw new SSLPeerUnverifiedException("peer not verified");
+ if (peerCertChain == null)
+ return null;
+ return (X509Certificate[]) peerCertChain.clone();
+ }
+
+ public String getPeerHost()
+ {
+ return peerHost;
+ }
+
+ public int getPeerPort()
+ {
+ return peerPort;
+ }
+
+ public Principal getPeerPrincipal() throws SSLPeerUnverifiedException
+ {
+ if (!peerVerified)
+ throw new SSLPeerUnverifiedException("peer not verified");
+ if (peerCertChain == null)
+ return null;
+ return peerCertChain[0].getSubjectDN();
+ }
+
+ public SSLSessionContext getSessionContext()
+ {
+ return context;
+ }
+
+ public String[] getValueNames()
+ {
+ Set<String> keys = this.values.keySet();
+ return keys.toArray(new String[keys.size()]);
+ }
+
+ public Object getValue(String name)
+ {
+ return values.get(name);
+ }
+
+ public void invalidate()
+ {
+ valid = false;
+ }
+
+ public boolean isValid()
+ {
+ return valid;
+ }
+
+ public void putValue(String name, Object value)
+ {
+ values.put(name, value);
+ try
+ {
+ if (value instanceof SSLSessionBindingListener)
+ ((SSLSessionBindingListener) value).valueBound
+ (new SSLSessionBindingEvent(this, name));
+ }
+ catch (Exception x)
+ {
+ }
+ }
+
+ public void removeValue(String name)
+ {
+ Object value = values.remove(name);
+ try
+ {
+ if (value instanceof SSLSessionBindingListener)
+ ((SSLSessionBindingListener) value).valueUnbound
+ (new SSLSessionBindingEvent(this, name));
+ }
+ catch (Exception x)
+ {
+ }
+ }
+
+ public final boolean isTruncatedMac()
+ {
+ return truncatedMac;
+ }
+
+ /**
+ * Prepare this session for serialization. Private data will be encrypted
+ * with the given password, and this object will then be ready to be
+ * serialized.
+ *
+ * @param password The password to protect this session with.
+ * @throws SSLException If encrypting this session's private data fails.
+ */
+ public abstract void prepare (char[] password) throws SSLException;
+
+ /**
+ * Repair this session's private data after deserialization. This method
+ * will decrypt this session's private data, and prepare the session for
+ * use in new SSL connections.
+ *
+ * @param password The password to decrypt the private data with.
+ * @throws SSLException
+ */
+ public abstract void repair(char[] password) throws SSLException;
+
+ /**
+ * Get the private data of this session. This method may only be called
+ * after first calling {@link #prepare(char[])}.
+ *
+ * @return The sealed private data.
+ * @throws SSLException If the private data have not been sealed.
+ */
+ public abstract SealedObject privateData() throws SSLException;
+
+ /**
+ * Set the private data of this session.
+ * @param data
+ * @throws SSLException
+ */
+ public abstract void setPrivateData(SealedObject data) throws SSLException;
+
+ // Inner classes.
+ // -------------------------------------------------------------------------
+
+ /**
+ * An SSL or TLS session ID.
+ */
+ public static final class ID implements Comparable, Serializable
+ {
+
+ // Fields.
+ // -----------------------------------------------------------------------
+
+ static final long serialVersionUID = 7887036954666565936L;
+ /** The ID itself. */
+ private final byte[] id;
+
+ // Constructor.
+ // -----------------------------------------------------------------------
+
+ /**
+ * Creates a new ID.
+ *
+ * @param id The ID. The array is cloned.
+ */
+ public ID (final byte[] id)
+ {
+ if (id.length > 32)
+ throw new IllegalArgumentException ("session ID's are limited to 32 bytes");
+ this.id = (byte[]) id.clone();
+ }
+
+ // Instance methods.
+ // -----------------------------------------------------------------------
+
+ public byte[] id()
+ {
+ return (byte[]) id.clone();
+ }
+
+ public boolean equals(Object other)
+ {
+ if (!(other instanceof ID))
+ return false;
+ return Arrays.equals(id, ((ID) other).id);
+ }
+
+ public int hashCode()
+ {
+ int code = 0;
+ for (int i = 0; i < id.length; i++)
+ code |= (id[i] & 0xFF) << ((i & 3) << 3);
+ return code;
+ }
+
+ public int compareTo(Object other)
+ {
+ byte[] id2 = ((ID) other).id;
+ if (id.length != id2.length)
+ return (id.length < id2.length) ? -1 : 1;
+ for (int i = 0; i < id.length; i++)
+ {
+ if ((id[i] & 0xFF) < (id2[i] & 0xFF))
+ return -1;
+ if ((id[i] & 0xFF) > (id2[i] & 0xFF))
+ return 1;
+ }
+ return 0;
+ }
+
+ public String toString()
+ {
+ StringBuffer str = new StringBuffer (3 * id.length + 1);
+ for (int i = 0; i < id.length; i++)
+ {
+ int x = id[i] & 0xFF;
+ str.append (Character.forDigit ((x >>> 4) & 0xF, 16));
+ str.append (Character.forDigit (x & 0xF, 16));
+ if (i != id.length - 1)
+ str.append (':');
+ }
+ return str.toString ();
+ }
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/SessionStoreException.java b/libjava/classpath/gnu/javax/net/ssl/SessionStoreException.java
new file mode 100644
index 00000000000..5dcf3d02887
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/SessionStoreException.java
@@ -0,0 +1,59 @@
+/* SessionStoreException.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl;
+
+import javax.net.ssl.SSLException;
+
+public class SessionStoreException extends SSLException
+{
+ public SessionStoreException (final String message)
+ {
+ super (message);
+ }
+
+ public SessionStoreException (final String message, final Throwable cause)
+ {
+ super (message, cause);
+ }
+
+ public SessionStoreException (final Throwable cause)
+ {
+ super (cause);
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/AbstractHandshake.java b/libjava/classpath/gnu/javax/net/ssl/provider/AbstractHandshake.java
new file mode 100644
index 00000000000..d80a5bb789b
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/AbstractHandshake.java
@@ -0,0 +1,1205 @@
+/* AbstractHandshake.java -- abstract handshake handler.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.classpath.debug.Component;
+import gnu.classpath.debug.SystemLogger;
+import gnu.java.security.action.GetSecurityPropertyAction;
+import gnu.java.security.prng.IRandom;
+import gnu.java.security.prng.LimitReachedException;
+import gnu.java.security.util.ByteArray;
+import gnu.javax.security.auth.callback.CertificateCallback;
+import gnu.javax.security.auth.callback.DefaultCallbackHandler;
+
+import java.nio.ByteBuffer;
+import java.security.AccessController;
+import java.security.DigestException;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.InvalidKeyException;
+import java.security.KeyManagementException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivilegedExceptionAction;
+import java.security.SecureRandom;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.zip.Deflater;
+import java.util.zip.Inflater;
+
+import javax.crypto.Cipher;
+import javax.crypto.KeyAgreement;
+import javax.crypto.Mac;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.SecretKey;
+import javax.crypto.interfaces.DHPrivateKey;
+import javax.crypto.interfaces.DHPublicKey;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import javax.net.ssl.SSLEngineResult;
+import javax.net.ssl.SSLException;
+import javax.net.ssl.X509TrustManager;
+import javax.net.ssl.SSLEngineResult.HandshakeStatus;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.ConfirmationCallback;
+
+/**
+ * The base interface for handshake implementations. Concrete
+ * subclasses of this class (one for the server, one for the client)
+ * handle the HANDSHAKE content-type in communications.
+ */
+public abstract class AbstractHandshake
+{
+ protected static final SystemLogger logger = SystemLogger.SYSTEM;
+
+ /**
+ * "server finished" -- TLS 1.0 and later
+ */
+ protected static final byte[] SERVER_FINISHED
+ = new byte[] {
+ 115, 101, 114, 118, 101, 114, 32, 102, 105, 110, 105, 115,
+ 104, 101, 100
+ };
+
+ /**
+ * "client finished" -- TLS 1.0 and later
+ */
+ protected static final byte[] CLIENT_FINISHED
+ = new byte[] {
+ 99, 108, 105, 101, 110, 116, 32, 102, 105, 110, 105, 115,
+ 104, 101, 100
+ };
+
+ /**
+ * "key expansion" -- TLS 1.0 and later
+ */
+ private static final byte[] KEY_EXPANSION =
+ new byte[] { 107, 101, 121, 32, 101, 120, 112,
+ 97, 110, 115, 105, 111, 110 };
+
+ /**
+ * "master secret" -- TLS 1.0 and later
+ */
+ private static final byte[] MASTER_SECRET
+ = new byte[] {
+ 109, 97, 115, 116, 101, 114, 32, 115, 101, 99, 114, 101, 116
+ };
+
+ /**
+ * "client write key" -- TLS 1.0 exportable whitener.
+ */
+ private static final byte[] CLIENT_WRITE_KEY
+ = new byte[] {
+ 99, 108, 105, 101, 110, 116, 32, 119, 114, 105, 116, 101, 32, 107,
+ 101, 121
+ };
+
+ /**
+ * "server write key" -- TLS 1.0 exportable whitener.
+ */
+ private static final byte[] SERVER_WRITE_KEY
+ = new byte[] {
+ 115, 101, 114, 118, 101, 114, 32, 119, 114, 105, 116, 101, 32, 107,
+ 101, 121
+ };
+
+ private static final byte[] IV_BLOCK
+ = new byte[] {
+ 73, 86, 32, 98, 108, 111, 99, 107
+ };
+
+ /**
+ * SSL 3.0; the string "CLNT"
+ */
+ private static final byte[] SENDER_CLIENT
+ = new byte[] { 0x43, 0x4C, 0x4E, 0x54 };
+
+ /**
+ * SSL 3.0; the string "SRVR"
+ */
+ private static final byte[] SENDER_SERVER
+ = new byte[] { 0x53, 0x52, 0x56, 0x52 };
+
+ /**
+ * SSL 3.0; the value 0x36 40 (for SHA-1 hashes) or 48 (for MD5 hashes)
+ * times.
+ */
+ protected static final byte[] PAD1 = new byte[48];
+
+ /**
+ * SSL 3.0; the value 0x5c 40 (for SHA-1 hashes) or 48 (for MD5 hashes)
+ * times.
+ */
+ protected static final byte[] PAD2 = new byte[48];
+
+ static
+ {
+ Arrays.fill(PAD1, SSLHMac.PAD1);
+ Arrays.fill(PAD2, SSLHMac.PAD2);
+ }
+
+ /**
+ * The currently-read handshake messages. There may be zero, or
+ * multiple, handshake messages in this buffer.
+ */
+ protected ByteBuffer handshakeBuffer;
+
+ /**
+ * The offset into `handshakeBuffer' where the first unread
+ * handshake message resides.
+ */
+ protected int handshakeOffset;
+
+ protected MessageDigest sha;
+ protected MessageDigest md5;
+
+ protected final SSLEngineImpl engine;
+ protected KeyAgreement keyAgreement;
+ protected byte[] preMasterSecret;
+ protected InputSecurityParameters inParams;
+ protected OutputSecurityParameters outParams;
+ protected LinkedList<DelegatedTask> tasks;
+ protected Random serverRandom;
+ protected Random clientRandom;
+ protected CompressionMethod compression;
+
+ protected AbstractHandshake(SSLEngineImpl engine)
+ throws NoSuchAlgorithmException
+ {
+ this.engine = engine;
+ sha = MessageDigest.getInstance("SHA-1");
+ md5 = MessageDigest.getInstance("MD5");
+ tasks = new LinkedList<DelegatedTask>();
+ }
+
+ /**
+ * Handles the next input message in the handshake. This is called
+ * in response to a call to {@link javax.net.ssl.SSLEngine#unwrap}
+ * for a message with content-type HANDSHAKE.
+ *
+ * @param record The input record. The callee should not assume that
+ * the record's buffer is writable, and should not try to use it for
+ * output or temporary storage.
+ * @return An {@link SSLEngineResult} describing the result.
+ */
+ public final HandshakeStatus handleInput (ByteBuffer fragment)
+ throws SSLException
+ {
+ if (!tasks.isEmpty())
+ return HandshakeStatus.NEED_TASK;
+
+ HandshakeStatus status = status();
+ if (status != HandshakeStatus.NEED_UNWRAP)
+ return status;
+
+ // Try to read another...
+ if (!pollHandshake(fragment))
+ return HandshakeStatus.NEED_UNWRAP;
+
+ while (hasMessage() && status != HandshakeStatus.NEED_WRAP)
+ {
+ int pos = handshakeOffset;
+ status = implHandleInput();
+ int len = handshakeOffset - pos;
+ if (len == 0)
+ {
+ // Don't bother; the impl is just telling us to go around
+ // again.
+ continue;
+ }
+ if (doHash())
+ {
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "hashing output\n{0}",
+ Util.hexDump((ByteBuffer) handshakeBuffer
+ .duplicate().position(pos)
+ .limit(pos+len), " >> "));
+ sha.update((ByteBuffer) handshakeBuffer.duplicate()
+ .position(pos).limit(pos+len));
+ md5.update((ByteBuffer) handshakeBuffer.duplicate()
+ .position(pos).limit(pos+len));
+ }
+ }
+ return status;
+ }
+
+ /**
+ * Called to process more handshake data. This method will be called
+ * repeatedly while there is remaining handshake data, and while the
+ * status is
+ * @return
+ * @throws SSLException
+ */
+ protected abstract HandshakeStatus implHandleInput()
+ throws SSLException;
+
+ /**
+ * Produce more handshake output. This is called in response to a
+ * call to {@link javax.net.ssl.SSLEngine#wrap}, when the handshake
+ * is still in progress.
+ *
+ * @param record The output record; the callee should put its output
+ * handshake message (or a part of it) in the argument's
+ * <code>fragment</code>, and should set the record length
+ * appropriately.
+ * @return An {@link SSLEngineResult} describing the result.
+ */
+ public final HandshakeStatus handleOutput (ByteBuffer fragment)
+ throws SSLException
+ {
+ if (!tasks.isEmpty())
+ return HandshakeStatus.NEED_TASK;
+
+ int orig = fragment.position();
+ SSLEngineResult.HandshakeStatus status = implHandleOutput(fragment);
+ if (doHash())
+ {
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "hashing output:\n{0}",
+ Util.hexDump((ByteBuffer) fragment.duplicate().flip().position(orig), " >> "));
+ sha.update((ByteBuffer) fragment.duplicate().flip().position(orig));
+ md5.update((ByteBuffer) fragment.duplicate().flip().position(orig));
+ }
+ return status;
+ }
+
+ /**
+ * Called to implement the underlying output handling. The callee should
+ * attempt to fill the given buffer as much as it can; this can include
+ * multiple, and even partial, handshake messages.
+ *
+ * @param fragment The buffer the callee should write handshake messages to.
+ * @return The new status of the handshake.
+ * @throws SSLException If an error occurs processing the output message.
+ */
+ protected abstract SSLEngineResult.HandshakeStatus implHandleOutput (ByteBuffer fragment)
+ throws SSLException;
+
+ /**
+ * Return a new instance of input security parameters, initialized with
+ * the session key. It is, of course, only valid to invoke this method
+ * once the handshake is complete, and the session keys established.
+ *
+ * <p>In the presence of a well-behaving peer, this should be called once
+ * the <code>ChangeCipherSpec</code> message is recieved.
+ *
+ * @return The input parameters for the newly established session.
+ * @throws SSLException If the handshake is not complete.
+ */
+ final InputSecurityParameters getInputParams() throws SSLException
+ {
+ checkKeyExchange();
+ return inParams;
+ }
+
+ /**
+ * Return a new instance of output security parameters, initialized with
+ * the session key. This should be called after the
+ * <code>ChangeCipherSpec</code> message is sent to the peer.
+ *
+ * @return The output parameters for the newly established session.
+ * @throws SSLException If the handshake is not complete.
+ */
+ final OutputSecurityParameters getOutputParams() throws SSLException
+ {
+ checkKeyExchange();
+ return outParams;
+ }
+
+ /**
+ * Fetch a delegated task waiting to run, if any.
+ *
+ * @return The task.
+ */
+ final Runnable getTask()
+ {
+ if (tasks.isEmpty())
+ return null;
+ return tasks.removeFirst();
+ }
+
+ /**
+ * Used by the skeletal code to query the current status of the handshake.
+ * This <em>should</em> be the same value as returned by the previous call
+ * to {@link #implHandleOutput(ByteBuffer)} or {@link
+ * #implHandleInput(ByteBuffer)}.
+ *
+ * @return The current handshake status.
+ */
+ abstract HandshakeStatus status();
+
+ /**
+ * Check if the key exchange completed successfully, throwing an exception
+ * if not.
+ *
+ * <p>Note that we assume that the caller of our SSLEngine is correct, and
+ * that they did run the delegated tasks that encapsulate the key exchange.
+ * What we are primarily checking, therefore, is that no error occurred in the
+ * key exchange operation itself.
+ *
+ * @throws SSLException If the key exchange did not complete successfully.
+ */
+ abstract void checkKeyExchange() throws SSLException;
+
+ /**
+ * Handle an SSLv2 client hello. This is only used by SSL servers.
+ *
+ * @param hello The hello message.
+ */
+ abstract void handleV2Hello(ByteBuffer hello) throws SSLException;
+
+ /**
+ * Attempt to read the next handshake message from the given
+ * record. If only a partial handshake message is available, then
+ * this method saves the incoming bytes and returns false. If a
+ * complete handshake is read, or if there was one buffered in the
+ * handshake buffer, this method returns true, and `handshakeBuffer'
+ * can be used to read the handshake.
+ *
+ * @param record The input record.
+ * @return True if a complete handshake is present in the buffer;
+ * false if only a partial one.
+ */
+ protected boolean pollHandshake (final ByteBuffer fragment)
+ {
+ // Allocate space for the new fragment.
+ if (handshakeBuffer == null
+ || handshakeBuffer.remaining() < fragment.remaining())
+ {
+ // We need space for anything still unread in the handshake
+ // buffer...
+ int len = ((handshakeBuffer == null) ? 0
+ : handshakeBuffer.position() - handshakeOffset);
+
+ // Plus room for the incoming record.
+ len += fragment.remaining();
+ reallocateBuffer(len);
+ }
+
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "inserting {0} into {1}",
+ fragment, handshakeBuffer);
+
+ // Put the fragment into the buffer.
+ handshakeBuffer.put(fragment);
+
+ return hasMessage();
+ }
+
+ protected boolean doHash()
+ {
+ return true;
+ }
+
+ /**
+ * Tell if the handshake buffer currently has a full handshake
+ * message.
+ */
+ protected boolean hasMessage()
+ {
+ if (handshakeBuffer == null)
+ return false;
+ ByteBuffer tmp = handshakeBuffer.duplicate();
+ tmp.flip();
+ tmp.position(handshakeOffset);
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "current buffer: {0}; test buffer {1}",
+ handshakeBuffer, tmp);
+ if (tmp.remaining() < 4)
+ return false;
+ Handshake handshake = new Handshake(tmp.slice());
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "handshake len:{0} remaining:{1}",
+ handshake.length(), tmp.remaining());
+ return (handshake.length() <= tmp.remaining() - 4);
+ }
+
+ /**
+ * Reallocate the handshake buffer so it can hold `totalLen'
+ * bytes. The smallest buffer allocated is 1024 bytes, and the size
+ * doubles from there until the buffer is sufficiently large.
+ */
+ private void reallocateBuffer (final int totalLen)
+ {
+ int len = handshakeBuffer == null ? -1
+ : handshakeBuffer.capacity() - (handshakeBuffer.limit() - handshakeOffset);
+ if (len >= totalLen)
+ {
+ // Big enough; no need to reallocate; but maybe shift the contents
+ // down.
+ if (handshakeOffset > 0)
+ {
+ handshakeBuffer.flip().position(handshakeOffset);
+ handshakeBuffer.compact();
+ handshakeOffset = 0;
+ }
+ return;
+ }
+
+ // Start at 1K (probably the system's page size). Double the size
+ // from there.
+ len = 1024;
+ while (len < totalLen)
+ len = len << 1;
+ ByteBuffer newBuf = ByteBuffer.allocate (len);
+
+ // Copy the unread bytes from the old buffer.
+ if (handshakeBuffer != null)
+ {
+ handshakeBuffer.flip ();
+ handshakeBuffer.position(handshakeOffset);
+ newBuf.put(handshakeBuffer);
+ }
+ handshakeBuffer = newBuf;
+
+ // We just put only unread handshake messages in the new buffer;
+ // the offset of the next one is now zero.
+ handshakeOffset = 0;
+ }
+
+ /**
+ * Generate a certificate verify message for SSLv3. In SSLv3, a different
+ * algorithm was used to generate this value was subtly different than
+ * that used in TLSv1.0 and later. In TLSv1.0 and later, this value is
+ * just the digest over the handshake messages.
+ *
+ * <p>SSLv3 uses the algorithm:
+ *
+ * <pre>
+CertificateVerify.signature.md5_hash
+ MD5(master_secret + pad_2 +
+ MD5(handshake_messages + master_secret + pad_1));
+Certificate.signature.sha_hash
+ SHA(master_secret + pad_2 +
+ SHA(handshake_messages + master_secret + pad_1));</pre>
+ *
+ * @param md5 The running MD5 hash of the handshake.
+ * @param sha The running SHA-1 hash of the handshake.
+ * @param session The current session being negotiated.
+ * @return The computed to-be-signed value.
+ */
+ protected byte[] genV3CertificateVerify(MessageDigest md5,
+ MessageDigest sha,
+ SessionImpl session)
+ {
+ byte[] md5value = null;
+ if (session.suite.signatureAlgorithm() == SignatureAlgorithm.RSA)
+ {
+ md5.update(session.privateData.masterSecret);
+ md5.update(PAD1, 0, 48);
+ byte[] tmp = md5.digest();
+ md5.reset();
+ md5.update(session.privateData.masterSecret);
+ md5.update(PAD2, 0, 48);
+ md5.update(tmp);
+ md5value = md5.digest();
+ }
+
+ sha.update(session.privateData.masterSecret);
+ sha.update(PAD1, 0, 40);
+ byte[] tmp = sha.digest();
+ sha.reset();
+ sha.update(session.privateData.masterSecret);
+ sha.update(PAD2, 0, 40);
+ sha.update(tmp);
+ byte[] shavalue = sha.digest();
+
+ if (md5value != null)
+ return Util.concat(md5value, shavalue);
+
+ return shavalue;
+ }
+
+ /**
+ * Generate the session keys from the computed master secret.
+ *
+ * @param clientRandom The client's nonce.
+ * @param serverRandom The server's nonce.
+ * @param session The session being established.
+ * @return The derived keys.
+ */
+ protected byte[][] generateKeys(Random clientRandom, Random serverRandom,
+ SessionImpl session)
+ {
+ int maclen = 20; // SHA-1.
+ if (session.suite.macAlgorithm() == MacAlgorithm.MD5)
+ maclen = 16;
+ int ivlen = 0;
+ if (session.suite.cipherAlgorithm() == CipherAlgorithm.DES
+ || session.suite.cipherAlgorithm() == CipherAlgorithm.DESede)
+ ivlen = 8;
+ if (session.suite.cipherAlgorithm() == CipherAlgorithm.AES)
+ ivlen = 16;
+ int keylen = session.suite.keyLength();
+
+ byte[][] keys = new byte[6][];
+ keys[0] = new byte[maclen]; // client_write_MAC_secret
+ keys[1] = new byte[maclen]; // server_write_MAC_secret
+ keys[2] = new byte[keylen]; // client_write_key
+ keys[3] = new byte[keylen]; // server_write_key
+ keys[4] = new byte[ivlen]; // client_write_iv
+ keys[5] = new byte[ivlen]; // server_write_iv
+
+ IRandom prf = null;
+ if (session.version == ProtocolVersion.SSL_3)
+ {
+ byte[] seed = new byte[clientRandom.length()
+ + serverRandom.length()];
+ serverRandom.buffer().get(seed, 0, serverRandom.length());
+ clientRandom.buffer().get(seed, serverRandom.length(),
+ clientRandom.length());
+ prf = new SSLRandom();
+ HashMap<String,byte[]> attr = new HashMap<String,byte[]>(2);
+ attr.put(SSLRandom.SECRET, session.privateData.masterSecret);
+ attr.put(SSLRandom.SEED, seed);
+ prf.init(attr);
+ }
+ else
+ {
+ byte[] seed = new byte[KEY_EXPANSION.length
+ + clientRandom.length()
+ + serverRandom.length()];
+ System.arraycopy(KEY_EXPANSION, 0, seed, 0, KEY_EXPANSION.length);
+ serverRandom.buffer().get(seed, KEY_EXPANSION.length,
+ serverRandom.length());
+ clientRandom.buffer().get(seed, (KEY_EXPANSION.length
+ + serverRandom.length()),
+ clientRandom.length());
+
+ prf = new TLSRandom();
+ HashMap<String,byte[]> attr = new HashMap<String,byte[]>(2);
+ attr.put(TLSRandom.SECRET, session.privateData.masterSecret);
+ attr.put(TLSRandom.SEED, seed);
+ prf.init(attr);
+ }
+
+ try
+ {
+ prf.nextBytes(keys[0], 0, keys[0].length);
+ prf.nextBytes(keys[1], 0, keys[1].length);
+ prf.nextBytes(keys[2], 0, keys[2].length);
+ prf.nextBytes(keys[3], 0, keys[3].length);
+
+ if (session.suite.isExportable())
+ {
+ if (session.version == ProtocolVersion.SSL_3)
+ {
+ MessageDigest md5 = MessageDigest.getInstance("MD5");
+ md5.update(clientRandom.buffer());
+ md5.update(serverRandom.buffer());
+ byte[] d = md5.digest();
+ System.arraycopy(d, 0, keys[4], 0, keys[4].length);
+
+ md5.reset();
+ md5.update(serverRandom.buffer());
+ md5.update(clientRandom.buffer());
+ d = md5.digest();
+ System.arraycopy(d, 0, keys[5], 0, keys[5].length);
+
+ md5.reset();
+ md5.update(keys[2]);
+ md5.update(clientRandom.buffer());
+ md5.update(serverRandom.buffer());
+ keys[2] = Util.trim(md5.digest(), 8);
+
+ md5.reset();
+ md5.update(keys[3]);
+ md5.update(serverRandom.buffer());
+ md5.update(clientRandom.buffer());
+ keys[3] = Util.trim(md5.digest(), 8);
+ }
+ else
+ {
+ TLSRandom prf2 = new TLSRandom();
+ HashMap<String,byte[]> attr = new HashMap<String,byte[]>(2);
+ attr.put(TLSRandom.SECRET, keys[2]);
+ byte[] seed = new byte[CLIENT_WRITE_KEY.length +
+ clientRandom.length() +
+ serverRandom.length()];
+ System.arraycopy(CLIENT_WRITE_KEY, 0, seed, 0,
+ CLIENT_WRITE_KEY.length);
+ clientRandom.buffer().get(seed, CLIENT_WRITE_KEY.length,
+ clientRandom.length());
+ serverRandom.buffer().get(seed, CLIENT_WRITE_KEY.length
+ + clientRandom.length(),
+ serverRandom.length());
+ attr.put(TLSRandom.SEED, seed);
+ prf2.init(attr);
+ keys[2] = new byte[8];
+ prf2.nextBytes(keys[2], 0, keys[2].length);
+
+ attr.put(TLSRandom.SECRET, keys[3]);
+ seed = new byte[SERVER_WRITE_KEY.length +
+ serverRandom.length() +
+ clientRandom.length()];
+ System.arraycopy(SERVER_WRITE_KEY, 0, seed, 0,
+ SERVER_WRITE_KEY.length);
+ serverRandom.buffer().get(seed, SERVER_WRITE_KEY.length,
+ serverRandom.length());
+ clientRandom.buffer().get(seed, SERVER_WRITE_KEY.length
+ + serverRandom.length(),
+ + clientRandom.length());
+ attr.put(TLSRandom.SEED, seed);
+ prf2.init(attr);
+ keys[3] = new byte[8];
+ prf2.nextBytes(keys[3], 0, keys[3].length);
+
+ attr.put(TLSRandom.SECRET, new byte[0]);
+ seed = new byte[IV_BLOCK.length +
+ clientRandom.length() +
+ serverRandom.length()];
+ System.arraycopy(IV_BLOCK, 0, seed, 0, IV_BLOCK.length);
+ clientRandom.buffer().get(seed, IV_BLOCK.length,
+ clientRandom.length());
+ serverRandom.buffer().get(seed, IV_BLOCK.length
+ + clientRandom.length(),
+ serverRandom.length());
+ attr.put(TLSRandom.SEED, seed);
+ prf2.init(attr);
+ prf2.nextBytes(keys[4], 0, keys[4].length);
+ prf2.nextBytes(keys[5], 0, keys[5].length);
+ }
+ }
+ else
+ {
+ prf.nextBytes(keys[4], 0, keys[4].length);
+ prf.nextBytes(keys[5], 0, keys[5].length);
+ }
+ }
+ catch (LimitReachedException lre)
+ {
+ // Won't happen with our implementation.
+ throw new Error(lre);
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ throw new Error(nsae);
+ }
+
+ if (Debug.DEBUG_KEY_EXCHANGE)
+ logger.logv(Component.SSL_KEY_EXCHANGE,
+ "keys generated;\n [0]: {0}\n [1]: {1}\n [2]: {2}\n" +
+ " [3]: {3}\n [4]: {4}\n [5]: {5}",
+ Util.toHexString(keys[0], ':'),
+ Util.toHexString(keys[1], ':'),
+ Util.toHexString(keys[2], ':'),
+ Util.toHexString(keys[3], ':'),
+ Util.toHexString(keys[4], ':'),
+ Util.toHexString(keys[5], ':'));
+ return keys;
+ }
+
+ /**
+ * Generate a "finished" message. The hashes passed in are modified
+ * by this function, so they should be clone copies of the digest if
+ * the hash function needs to be used more.
+ *
+ * @param md5 The MD5 computation.
+ * @param sha The SHA-1 computation.
+ * @param isClient Whether or not the client-side finished message is
+ * being computed.
+ * @param session The current session.
+ * @return A byte buffer containing the computed finished message.
+ */
+ protected ByteBuffer generateFinished(MessageDigest md5,
+ MessageDigest sha,
+ boolean isClient,
+ SessionImpl session)
+ {
+ ByteBuffer finishedBuffer = null;
+ if (session.version.compareTo(ProtocolVersion.TLS_1) >= 0)
+ {
+ finishedBuffer = ByteBuffer.allocate(12);
+ TLSRandom prf = new TLSRandom();
+ byte[] md5val = md5.digest();
+ byte[] shaval = sha.digest();
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "finished md5:{0} sha:{1}",
+ Util.toHexString(md5val, ':'),
+ Util.toHexString(shaval, ':'));
+ byte[] seed = new byte[CLIENT_FINISHED.length
+ + md5val.length
+ + shaval.length];
+ if (isClient)
+ System.arraycopy(CLIENT_FINISHED, 0, seed, 0, CLIENT_FINISHED.length);
+ else
+ System.arraycopy(SERVER_FINISHED, 0, seed, 0, SERVER_FINISHED.length);
+ System.arraycopy(md5val, 0,
+ seed, CLIENT_FINISHED.length,
+ md5val.length);
+ System.arraycopy(shaval, 0,
+ seed, CLIENT_FINISHED.length + md5val.length,
+ shaval.length);
+ HashMap<String, Object> params = new HashMap<String, Object>(2);
+ params.put(TLSRandom.SECRET, session.privateData.masterSecret);
+ params.put(TLSRandom.SEED, seed);
+ prf.init(params);
+ byte[] buf = new byte[12];
+ prf.nextBytes(buf, 0, buf.length);
+ finishedBuffer.put(buf).position(0);
+ }
+ else
+ {
+ // The SSLv3 algorithm is:
+ //
+ // enum { client(0x434C4E54), server(0x53525652) } Sender;
+ //
+ // struct {
+ // opaque md5_hash[16];
+ // opaque sha_hash[20];
+ // } Finished;
+ //
+ // md5_hash MD5(master_secret + pad2 +
+ // MD5(handshake_messages + Sender +
+ // master_secret + pad1));
+ // sha_hash SHA(master_secret + pad2 +
+ // SHA(handshake_messages + Sender +
+ // master_secret + pad1));
+ //
+
+ finishedBuffer = ByteBuffer.allocate(36);
+
+ md5.update(isClient ? SENDER_CLIENT : SENDER_SERVER);
+ md5.update(session.privateData.masterSecret);
+ md5.update(PAD1);
+
+ byte[] tmp = md5.digest();
+ md5.reset();
+ md5.update(session.privateData.masterSecret);
+ md5.update(PAD2);
+ md5.update(tmp);
+ finishedBuffer.put(md5.digest());
+
+ sha.update(isClient ? SENDER_CLIENT : SENDER_SERVER);
+ sha.update(session.privateData.masterSecret);
+ sha.update(PAD1, 0, 40);
+
+ tmp = sha.digest();
+ sha.reset();
+ sha.update(session.privateData.masterSecret);
+ sha.update(PAD2, 0, 40);
+ sha.update(tmp);
+ finishedBuffer.put(sha.digest()).position(0);
+ }
+ return finishedBuffer;
+ }
+
+ protected void initDiffieHellman(DHPrivateKey dhKey, SecureRandom random)
+ throws SSLException
+ {
+ try
+ {
+ keyAgreement = KeyAgreement.getInstance("DH");
+ keyAgreement.init(dhKey, random);
+ }
+ catch (InvalidKeyException ike)
+ {
+ throw new SSLException(ike);
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ throw new SSLException(nsae);
+ }
+ }
+
+ protected void generateMasterSecret(Random clientRandom,
+ Random serverRandom,
+ SessionImpl session)
+ throws SSLException
+ {
+ assert(clientRandom != null);
+ assert(serverRandom != null);
+ assert(session != null);
+
+ if (Debug.DEBUG_KEY_EXCHANGE)
+ logger.logv(Component.SSL_KEY_EXCHANGE, "preMasterSecret:\n{0}",
+ new ByteArray(preMasterSecret));
+
+ if (session.version == ProtocolVersion.SSL_3)
+ {
+ try
+ {
+ MessageDigest _md5 = MessageDigest.getInstance("MD5");
+ MessageDigest _sha = MessageDigest.getInstance("SHA");
+ session.privateData.masterSecret = new byte[48];
+
+ _sha.update((byte) 'A');
+ _sha.update(preMasterSecret);
+ _sha.update(clientRandom.buffer());
+ _sha.update(serverRandom.buffer());
+ _md5.update(preMasterSecret);
+ _md5.update(_sha.digest());
+ _md5.digest(session.privateData.masterSecret, 0, 16);
+
+ _sha.update((byte) 'B');
+ _sha.update((byte) 'B');
+ _sha.update(preMasterSecret);
+ _sha.update(clientRandom.buffer());
+ _sha.update(serverRandom.buffer());
+ _md5.update(preMasterSecret);
+ _md5.update(_sha.digest());
+ _md5.digest(session.privateData.masterSecret, 16, 16);
+
+ _sha.update((byte) 'C');
+ _sha.update((byte) 'C');
+ _sha.update((byte) 'C');
+ _sha.update(preMasterSecret);
+ _sha.update(clientRandom.buffer());
+ _sha.update(serverRandom.buffer());
+ _md5.update(preMasterSecret);
+ _md5.update(_sha.digest());
+ _md5.digest(session.privateData.masterSecret, 32, 16);
+ }
+ catch (DigestException de)
+ {
+ throw new SSLException(de);
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ throw new SSLException(nsae);
+ }
+ }
+ else // TLSv1.0 and later
+ {
+ byte[] seed = new byte[clientRandom.length()
+ + serverRandom.length()
+ + MASTER_SECRET.length];
+ System.arraycopy(MASTER_SECRET, 0, seed, 0, MASTER_SECRET.length);
+ clientRandom.buffer().get(seed, MASTER_SECRET.length,
+ clientRandom.length());
+ serverRandom.buffer().get(seed,
+ MASTER_SECRET.length + clientRandom.length(),
+ serverRandom.length());
+ TLSRandom prf = new TLSRandom();
+ HashMap<String,byte[]> attr = new HashMap<String,byte[]>(2);
+ attr.put(TLSRandom.SECRET, preMasterSecret);
+ attr.put(TLSRandom.SEED, seed);
+ prf.init(attr);
+
+ session.privateData.masterSecret = new byte[48];
+ prf.nextBytes(session.privateData.masterSecret, 0, 48);
+ }
+
+ if (Debug.DEBUG_KEY_EXCHANGE)
+ logger.log(Component.SSL_KEY_EXCHANGE, "master_secret: {0}",
+ new ByteArray(session.privateData.masterSecret));
+
+ // Wipe out the preMasterSecret.
+ for (int i = 0; i < preMasterSecret.length; i++)
+ preMasterSecret[i] = 0;
+ }
+
+ protected void setupSecurityParameters(byte[][] keys, boolean isClient,
+ SSLEngineImpl engine,
+ CompressionMethod compression)
+ throws SSLException
+ {
+ assert(keys.length == 6);
+ assert(engine != null);
+ assert(compression != null);
+
+ try
+ {
+ CipherSuite s = engine.session().suite;
+ Cipher inCipher = s.cipher();
+ Mac inMac = s.mac(engine.session().version);
+ Inflater inflater = (compression == CompressionMethod.ZLIB
+ ? new Inflater() : null);
+ inCipher.init(Cipher.DECRYPT_MODE,
+ new SecretKeySpec(keys[isClient ? 3 : 2],
+ s.cipherAlgorithm().toString()),
+ new IvParameterSpec(keys[isClient ? 5 : 4]));
+ inMac.init(new SecretKeySpec(keys[isClient ? 1 : 0],
+ inMac.getAlgorithm()));
+ inParams = new InputSecurityParameters(inCipher, inMac,
+ inflater,
+ engine.session(), s);
+
+ Cipher outCipher = s.cipher();
+ Mac outMac = s.mac(engine.session().version);
+ Deflater deflater = (compression == CompressionMethod.ZLIB
+ ? new Deflater() : null);
+ outCipher.init(Cipher.ENCRYPT_MODE,
+ new SecretKeySpec(keys[isClient ? 2 : 3],
+ s.cipherAlgorithm().toString()),
+ new IvParameterSpec(keys[isClient ? 4 : 5]));
+ outMac.init(new SecretKeySpec(keys[isClient ? 0 : 1],
+ outMac.getAlgorithm()));
+ outParams = new OutputSecurityParameters(outCipher, outMac,
+ deflater,
+ engine.session(), s);
+ }
+ catch (InvalidAlgorithmParameterException iape)
+ {
+ throw new SSLException(iape);
+ }
+ catch (InvalidKeyException ike)
+ {
+ throw new SSLException(ike);
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ throw new SSLException(nsae);
+ }
+ catch (NoSuchPaddingException nspe)
+ {
+ throw new SSLException(nspe);
+ }
+ }
+
+ protected void generatePSKSecret(String identity, byte[] otherkey,
+ boolean isClient)
+ throws SSLException
+ {
+ SecretKey key = null;
+ try
+ {
+ key = engine.contextImpl.pskManager.getKey(identity);
+ }
+ catch (KeyManagementException kme)
+ {
+ }
+ if (key != null)
+ {
+ byte[] keyb = key.getEncoded();
+ if (otherkey == null)
+ {
+ otherkey = new byte[keyb.length];
+ }
+ preMasterSecret = new byte[otherkey.length + keyb.length + 4];
+ preMasterSecret[0] = (byte) (otherkey.length >>> 8);
+ preMasterSecret[1] = (byte) otherkey.length;
+ System.arraycopy(otherkey, 0, preMasterSecret, 2, otherkey.length);
+ preMasterSecret[otherkey.length + 2]
+ = (byte) (keyb.length >>> 8);
+ preMasterSecret[otherkey.length + 3]
+ = (byte) keyb.length;
+ System.arraycopy(keyb, 0, preMasterSecret,
+ otherkey.length + 4, keyb.length);
+ }
+ else
+ {
+ // Generate a random, fake secret.
+ preMasterSecret = new byte[8];
+ preMasterSecret[1] = 2;
+ preMasterSecret[5] = 2;
+ preMasterSecret[6] = (byte) engine.session().random().nextInt();
+ preMasterSecret[7] = (byte) engine.session().random().nextInt();
+ }
+
+ if (Debug.DEBUG_KEY_EXCHANGE)
+ logger.logv(Component.SSL_KEY_EXCHANGE, "PSK identity {0} key {1}",
+ identity, key);
+
+ generateMasterSecret(clientRandom, serverRandom,
+ engine.session());
+ byte[][] keys = generateKeys(clientRandom, serverRandom,
+ engine.session());
+ setupSecurityParameters(keys, isClient, engine, compression);
+ }
+
+ protected class DHPhase extends DelegatedTask
+ {
+ private final DHPublicKey key;
+ private final boolean full;
+
+ protected DHPhase(DHPublicKey key)
+ {
+ this(key, true);
+ }
+
+ protected DHPhase(DHPublicKey key, boolean full)
+ {
+ this.key = key;
+ this.full = full;
+ }
+
+ protected void implRun() throws InvalidKeyException, SSLException
+ {
+ keyAgreement.doPhase(key, true);
+ preMasterSecret = keyAgreement.generateSecret();
+ if (full)
+ {
+ generateMasterSecret(clientRandom, serverRandom, engine.session());
+ byte[][] keys = generateKeys(clientRandom, serverRandom, engine.session());
+ setupSecurityParameters(keys, engine.getUseClientMode(), engine, compression);
+ }
+ }
+ }
+
+ protected class CertVerifier extends DelegatedTask
+ {
+ private final boolean clientSide;
+ private final X509Certificate[] chain;
+ private boolean verified;
+
+ protected CertVerifier(boolean clientSide, X509Certificate[] chain)
+ {
+ this.clientSide = clientSide;
+ this.chain = chain;
+ }
+
+ boolean verified()
+ {
+ return verified;
+ }
+
+ protected void implRun()
+ {
+ X509TrustManager tm = engine.contextImpl.trustManager;
+ if (clientSide)
+ {
+ try
+ {
+ tm.checkServerTrusted(chain, null);
+ verified = true;
+ }
+ catch (CertificateException ce)
+ {
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_DELEGATED_TASK, "cert verify", ce);
+ // For client connections, ask the user if the certificate is OK.
+ CallbackHandler verify = new DefaultCallbackHandler();
+ GetSecurityPropertyAction gspa
+ = new GetSecurityPropertyAction("jessie.certificate.handler");
+ String clazz = AccessController.doPrivileged(gspa);
+ try
+ {
+ ClassLoader cl =
+ AccessController.doPrivileged(new PrivilegedExceptionAction<ClassLoader>()
+ {
+ public ClassLoader run() throws Exception
+ {
+ return ClassLoader.getSystemClassLoader();
+ }
+ });
+ verify = (CallbackHandler) cl.loadClass(clazz).newInstance();
+ }
+ catch (Exception x)
+ {
+ // Ignore.
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_DELEGATED_TASK,
+ "callback handler loading", x);
+ }
+ // XXX Internationalize
+ CertificateCallback confirm =
+ new CertificateCallback(chain[0],
+ "The server's certificate could not be verified. There is no proof " +
+ "that this server is who it claims to be, or that their certificate " +
+ "is valid. Do you wish to continue connecting? ");
+
+ try
+ {
+ verify.handle(new Callback[] { confirm });
+ verified = confirm.getSelectedIndex() == ConfirmationCallback.YES;
+ }
+ catch (Exception x)
+ {
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_DELEGATED_TASK,
+ "callback handler exception", x);
+ verified = false;
+ }
+ }
+ }
+ else
+ {
+ try
+ {
+ tm.checkClientTrusted(chain, null);
+ }
+ catch (CertificateException ce)
+ {
+ verified = false;
+ }
+ }
+
+ if (verified)
+ engine.session().setPeerVerified(true);
+ }
+ }
+
+ protected class DHE_PSKGen extends DelegatedTask
+ {
+ private final DHPublicKey dhKey;
+ private final SecretKey psKey;
+ private final boolean isClient;
+
+ protected DHE_PSKGen(DHPublicKey dhKey, SecretKey psKey, boolean isClient)
+ {
+ this.dhKey = dhKey;
+ this.psKey = psKey;
+ this.isClient = isClient;
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.DelegatedTask#implRun()
+ */
+ @Override protected void implRun() throws Throwable
+ {
+ keyAgreement.doPhase(dhKey, true);
+ byte[] dhSecret = keyAgreement.generateSecret();
+ byte[] psSecret = null;
+ if (psKey != null)
+ psSecret = psKey.getEncoded();
+ else
+ {
+ psSecret = new byte[8];
+ engine.session().random().nextBytes(psSecret);
+ }
+
+ preMasterSecret = new byte[dhSecret.length + psSecret.length + 4];
+ preMasterSecret[0] = (byte) (dhSecret.length >>> 8);
+ preMasterSecret[1] = (byte) dhSecret.length;
+ System.arraycopy(dhSecret, 0, preMasterSecret, 2, dhSecret.length);
+ preMasterSecret[dhSecret.length + 2] = (byte) (psSecret.length >>> 8);
+ preMasterSecret[dhSecret.length + 3] = (byte) psSecret.length;
+ System.arraycopy(psSecret, 0, preMasterSecret, dhSecret.length + 4,
+ psSecret.length);
+
+ generateMasterSecret(clientRandom, serverRandom, engine.session());
+ byte[][] keys = generateKeys(clientRandom, serverRandom, engine.session());
+ setupSecurityParameters(keys, isClient, engine, compression);
+ }
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Alert.java b/libjava/classpath/gnu/javax/net/ssl/provider/Alert.java
index c31e1bef5ca..12c86b0a402 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/Alert.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/Alert.java
@@ -38,10 +38,10 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
-import java.io.EOFException;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import java.nio.ByteBuffer;
/**
* An alert message in the SSL protocol. Alerts are sent both as warnings
@@ -52,211 +52,112 @@ import java.io.OutputStream;
*
* <pre>
* struct {
- * AlertLevel level;
+ * AlertLevel level;
* AlertDescription description;
* }
* </pre>
*/
-final class Alert implements Constructed
+public final class Alert implements Constructed
{
// Fields.
// -------------------------------------------------------------------------
- /** The alert level enumerated. */
- private final Level level;
-
- /** The alert description enumerated. */
- private final Description description;
+ /** The underlying byte buffer. */
+ private final ByteBuffer buffer;
// Constructor.
// -------------------------------------------------------------------------
- Alert(Level level, Description description)
+ public Alert (final ByteBuffer buffer)
+ {
+ this.buffer = buffer;
+ }
+
+ public Alert (final Level level, final Description description)
{
- this.level = level;
- this.description = description;
+ level.getClass ();
+ description.getClass ();
+ ByteBuffer b = ByteBuffer.allocate (2);
+ b.put (0, (byte) level.getValue ());
+ b.put (1, (byte) description.getValue ());
+ this.buffer = b.asReadOnlyBuffer ();
}
- // Class method.
+ // Instance methods.
// -------------------------------------------------------------------------
- static Alert read(InputStream in) throws IOException
+ public int length ()
{
- Level level = Level.read(in);
- Description desc = Description.read(in);
- return new Alert(level, desc);
+ return 2;
}
- static Alert forName(String name)
+ byte[] getEncoded()
{
- if (name == null)
- {
- return new Alert(Level.FATAL, Description.INTERNAL_ERROR);
- }
- Description desc = Description.INTERNAL_ERROR;
- if (name.equals("close_notify"))
- {
- desc = Description.CLOSE_NOTIFY;
- }
- else if (name.equals("unexpected_message"))
- {
- desc = Description.UNEXPECTED_MESSAGE;
- }
- else if (name.equals("bad_record_mac"))
- {
- desc = Description.BAD_RECORD_MAC;
- }
- else if (name.equals("DECRYPTION_FAILED"))
- {
- desc = Description.DECRYPTION_FAILED;
- }
- else if (name.equals("record_overflow"))
- {
- desc = Description.RECORD_OVERFLOW;
- }
- else if (name.equals("decompression_failure"))
- {
- desc = Description.DECOMPRESSION_FAILURE;
- }
- else if (name.equals("handshake_failure"))
- {
- desc = Description.HANDSHAKE_FAILURE;
- }
- else if (name.equals("no_certificate"))
- {
- desc = Description.NO_CERTIFICATE;
- }
- else if (name.equals("bad_certificate"))
- {
- desc = Description.BAD_CERTIFICATE;
- }
- else if (name.equals("unsupported_certificate"))
- {
- desc = Description.UNSUPPORTED_CERTIFICATE;
- }
- else if (name.equals("certificate_revoked"))
- {
- desc = Description.CERTIFICATE_REVOKED;
- }
- else if (name.equals("certificate_expired"))
- {
- desc = Description.CERTIFICATE_EXPIRED;
- }
- else if (name.equals("certificate_unknown"))
- {
- desc = Description.CERTIFICATE_UNKNOWN;
- }
- else if (name.equals("illegal_parameter"))
- {
- desc = Description.ILLEGAL_PARAMETER;
- }
- else if (name.equals("unknown_ca"))
- {
- desc = Description.UNKNOWN_CA;
- }
- else if (name.equals("access_denied"))
- {
- desc = Description.ACCESS_DENIED;
- }
- else if (name.equals("decode_error"))
- {
- desc = Description.DECODE_ERROR;
- }
- else if (name.equals("decrypt_error"))
- {
- desc = Description.DECRYPT_ERROR;
- }
- else if (name.equals("export_restriction"))
- {
- desc = Description.EXPORT_RESTRICTION;
- }
- else if (name.equals("protocol_version"))
- {
- desc = Description.PROTOCOL_VERSION;
- }
- else if (name.equals("insufficient_security"))
- {
- desc = Description.INSUFFICIENT_SECURITY;
- }
- else if (name.equals("internal_error"))
- {
- desc = Description.INTERNAL_ERROR;
- }
- else if (name.equals("user_canceled"))
- {
- desc = Description.USER_CANCELED;
- }
- else if (name.equals("no_renegotiation"))
- {
- desc = Description.NO_RENEGOTIATION;
- }
- else if (name.equals("unsupported_extension"))
- {
- desc = Description.UNSUPPORTED_EXTENSION;
- }
- else if (name.equals("certificate_unobtainable"))
- {
- desc = Description.CERTIFICATE_UNOBTAINABLE;
- }
- else if (name.equals("unrecognized_name"))
- {
- desc = Description.UNRECOGNIZED_NAME;
- }
- else if (name.equals("bad_certificate_status_response"))
- {
- desc = Description.BAD_CERTIFICATE_STATUS_RESPONSE;
- }
- else if (name.equals("bad_certificate_hash_value"))
- {
- desc = Description.BAD_CERTIFICATE_HASH_VALUE;
- }
- else if (name.equals("unknown_srp_username"))
- {
- desc = Description.UNKNOWN_SRP_USERNAME;
- }
- else if (name.equals("missing_srp_username"))
- {
- desc = Description.MISSING_SRP_USERNAME;
- }
- return new Alert(Level.FATAL, desc);
+ byte[] buf = new byte[2];
+ buffer.position (0);
+ buffer.get (buf);
+ return buf;
}
- // Instance methods.
- // -------------------------------------------------------------------------
+ public Level level()
+ {
+ return Level.forInteger (buffer.get (0) & 0xFF);
+ }
- public void write(OutputStream out) throws IOException
+ public Description description()
{
- out.write((byte) level.getValue());
- out.write((byte) description.getValue());
+ return Description.forInteger (buffer.get (1) & 0xFF);
}
- byte[] getEncoded()
+ public void setLevel (final Level level)
+ {
+ buffer.put (0, (byte) level.getValue ());
+ }
+
+ public void setDescription (final Description description)
{
- return new byte[] { (byte) level.getValue(),
- (byte) description.getValue() };
+ buffer.put (1, (byte) description.getValue ());
}
- Level getLevel()
+ public boolean equals (Object o)
{
- return level;
+ if (!(o instanceof Alert))
+ return false;
+ Alert that = (Alert) o;
+ return that.buffer.position (0).equals (buffer.position (0));
}
- Description getDescription()
+ public int hashCode ()
{
- return description;
+ return buffer.getShort (0) & 0xFFFF;
}
public String toString()
{
- String nl = System.getProperty("line.separator");
- return "struct {" + nl +
- " level = " + level + ";" + nl +
- " description = " + description + ";" + nl +
- "} Alert;" + nl;
+ return toString (null);
+ }
+
+ public String toString (final String prefix)
+ {
+ StringWriter str = new StringWriter ();
+ PrintWriter out = new PrintWriter (str);
+ if (prefix != null) out.print (prefix);
+ out.println ("struct {");
+ if (prefix != null) out.print (prefix);
+ out.print (" level: ");
+ out.print (level ());
+ out.println (";");
+ if (prefix != null) out.print (prefix);
+ out.print (" description: ");
+ out.print (description ());
+ out.println (";");
+ if (prefix != null) out.print (prefix);
+ out.print ("} Alert;");
+ return str.toString ();
}
- // Inner classes.
+ // Enumerations.
// -------------------------------------------------------------------------
/**
@@ -266,129 +167,88 @@ final class Alert implements Constructed
* enum { warning(1), fatal(2), (255) } AlertLevel;
* </pre>
*/
- static final class Level implements Enumerated
+ public static enum Level
{
- // Constants and fields.
- // -----------------------------------------------------------------------
-
- static final Level WARNING = new Level(1), FATAL = new Level(2);
-
+ WARNING (1), FATAL (2);
+
private final int value;
- // Constructor.
- // -----------------------------------------------------------------------
-
private Level(int value)
{
this.value = value;
}
- // Class method.
- // -----------------------------------------------------------------------
-
- static Level read(InputStream in) throws IOException
+ public static Level forInteger (final int value)
{
- int i = in.read();
- if (i == -1)
- {
- throw new EOFException("unexpected end of stream");
- }
- switch (i & 0xFF)
+ switch (value & 0xFF)
{
case 1: return WARNING;
case 2: return FATAL;
- default: return new Level(i);
+ default: throw new IllegalArgumentException ("invalid alert level: " + value);
}
}
- // Instance methods.
- // -----------------------------------------------------------------------
-
- public byte[] getEncoded()
- {
- return new byte[] { (byte) value };
- }
-
public int getValue()
{
return value;
}
-
- public String toString()
- {
- switch (value)
- {
- case 1: return "warning";
- case 2: return "fatal";
- default: return "unknown(" + value + ")";
- }
- }
}
/**
* The description enumeration.
*/
- static final class Description implements Enumerated
+ public static enum Description
{
-
- // Constants and fields.
- // -----------------------------------------------------------------------
-
- static final Description
- CLOSE_NOTIFY = new Description( 0),
- UNEXPECTED_MESSAGE = new Description( 10),
- BAD_RECORD_MAC = new Description( 20),
- DECRYPTION_FAILED = new Description( 21),
- RECORD_OVERFLOW = new Description( 22),
- DECOMPRESSION_FAILURE = new Description( 30),
- HANDSHAKE_FAILURE = new Description( 40),
- NO_CERTIFICATE = new Description( 41),
- BAD_CERTIFICATE = new Description( 42),
- UNSUPPORTED_CERTIFICATE = new Description( 43),
- CERTIFICATE_REVOKED = new Description( 44),
- CERTIFICATE_EXPIRED = new Description( 45),
- CERTIFICATE_UNKNOWN = new Description( 46),
- ILLEGAL_PARAMETER = new Description( 47),
- UNKNOWN_CA = new Description( 48),
- ACCESS_DENIED = new Description( 49),
- DECODE_ERROR = new Description( 50),
- DECRYPT_ERROR = new Description( 51),
- EXPORT_RESTRICTION = new Description( 60),
- PROTOCOL_VERSION = new Description( 70),
- INSUFFICIENT_SECURITY = new Description( 71),
- INTERNAL_ERROR = new Description( 80),
- USER_CANCELED = new Description( 90),
- NO_RENEGOTIATION = new Description(100),
- UNSUPPORTED_EXTENSION = new Description(110),
- CERTIFICATE_UNOBTAINABLE = new Description(111),
- UNRECOGNIZED_NAME = new Description(112),
- BAD_CERTIFICATE_STATUS_RESPONSE = new Description(113),
- BAD_CERTIFICATE_HASH_VALUE = new Description(114),
- UNKNOWN_SRP_USERNAME = new Description(120),
- MISSING_SRP_USERNAME = new Description(121);
-
+ CLOSE_NOTIFY ( 0),
+ UNEXPECTED_MESSAGE ( 10),
+ BAD_RECORD_MAC ( 20),
+ DECRYPTION_FAILED ( 21),
+ RECORD_OVERFLOW ( 22),
+ DECOMPRESSION_FAILURE ( 30),
+ HANDSHAKE_FAILURE ( 40),
+ NO_CERTIFICATE ( 41),
+ BAD_CERTIFICATE ( 42),
+ UNSUPPORTED_CERTIFICATE ( 43),
+ CERTIFICATE_REVOKED ( 44),
+ CERTIFICATE_EXPIRED ( 45),
+ CERTIFICATE_UNKNOWN ( 46),
+ ILLEGAL_PARAMETER ( 47),
+ UNKNOWN_CA ( 48),
+ ACCESS_DENIED ( 49),
+ DECODE_ERROR ( 50),
+ DECRYPT_ERROR ( 51),
+ EXPORT_RESTRICTION ( 60),
+ PROTOCOL_VERSION ( 70),
+ INSUFFICIENT_SECURITY ( 71),
+ INTERNAL_ERROR ( 80),
+ USER_CANCELED ( 90),
+ NO_RENEGOTIATION (100),
+ UNSUPPORTED_EXTENSION (110),
+ CERTIFICATE_UNOBTAINABLE (111),
+ UNRECOGNIZED_NAME (112),
+ BAD_CERTIFICATE_STATUS_RESPONSE (113),
+ BAD_CERTIFICATE_HASH_VALUE (114),
+ UNKNOWN_SRP_USERNAME (120),
+ MISSING_SRP_USERNAME (121);
+
private final int value;
- // Constructor.
- // -----------------------------------------------------------------------
-
private Description(int value)
{
this.value = value;
}
- // Class method.
- // -----------------------------------------------------------------------
-
- static Description read(InputStream in) throws IOException
+ /**
+ * Return an alert description object based on the specified integer
+ * value.
+ *
+ * @param value The raw description value.
+ * @return The appropriate description object.
+ */
+ public static Description forInteger (final int value)
{
- int i = in.read();
- if (i == -1)
- {
- throw new EOFException("unexpected end of input stream");
- }
- switch (i)
+ switch (value & 0xFF)
{
case 0: return CLOSE_NOTIFY;
case 10: return UNEXPECTED_MESSAGE;
@@ -416,59 +276,13 @@ final class Alert implements Constructed
case 100: return NO_RENEGOTIATION;
case 120: return UNKNOWN_SRP_USERNAME;
case 121: return MISSING_SRP_USERNAME;
- default: return new Description(i);
+ default: throw new IllegalArgumentException("unknown alert description: " + value);
}
}
- // Instance methods.
- // -----------------------------------------------------------------------
-
- public byte[] getEncoded()
- {
- return new byte[] { (byte) value };
- }
-
public int getValue()
{
return value;
}
-
- public String toString()
- {
- switch (value)
- {
- case 0: return "close_notify";
- case 10: return "unexpected_message";
- case 20: return "bad_record_mac";
- case 21: return "decryption_failed";
- case 22: return "record_overflow";
- case 30: return "decompression_failure";
- case 40: return "handshake_failure";
- case 42: return "bad_certificate";
- case 43: return "unsupported_certificate";
- case 44: return "certificate_revoked";
- case 45: return "certificate_expired";
- case 46: return "certificate_unknown";
- case 47: return "illegal_parameter";
- case 48: return "unknown_ca";
- case 49: return "access_denied";
- case 50: return "decode_error";
- case 51: return "decrypt_error";
- case 60: return "export_restriction";
- case 70: return "protocol_version";
- case 71: return "insufficient_security";
- case 80: return "internal_error";
- case 90: return "user_canceled";
- case 100: return "no_renegotiation";
- case 110: return "unsupported_extension";
- case 111: return "certificate_unobtainable";
- case 112: return "unrecognized_name";
- case 113: return "bad_certificate_status_response";
- case 114: return "bad_certificate_hash_value";
- case 120: return "unknown_srp_username";
- case 121: return "missing_srp_username";
- default: return "unknown(" + value + ")";
- }
- }
}
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/AlertException.java b/libjava/classpath/gnu/javax/net/ssl/provider/AlertException.java
index 666efe5ac0d..291de2700c9 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/AlertException.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/AlertException.java
@@ -40,7 +40,10 @@ package gnu.javax.net.ssl.provider;
import javax.net.ssl.SSLException;
-class AlertException extends SSLException
+/**
+ * An exception generated by an SSL alert.
+ */
+public class AlertException extends SSLException
{
// Fields.
@@ -52,25 +55,47 @@ class AlertException extends SSLException
// Constructor.
// -------------------------------------------------------------------------
- AlertException(Alert alert, boolean isLocal)
+ public AlertException(Alert alert, boolean isLocal)
{
- super(alert.getDescription().toString());
+ super(alert.description().toString());
this.alert = alert;
this.isLocal = isLocal;
}
+ public AlertException(Alert alert)
+ {
+ this(alert, true);
+ }
+
+ public AlertException(Alert alert, boolean isLocal, Throwable cause)
+ {
+ super(alert.description().toString(), cause);
+ this.alert = alert;
+ this.isLocal = isLocal;
+ }
+
+ public AlertException(Alert alert, Throwable cause)
+ {
+ this(alert, true, cause);
+ }
+
// Instance methods.
// -------------------------------------------------------------------------
public String getMessage()
{
- return alert.getDescription() + ": " +
+ return alert.description() + ": " +
(isLocal ? "locally generated; " : "remotely generated; ") +
- alert.getLevel();
+ alert.level();
}
- public Alert getAlert ()
+ public Alert alert ()
{
return alert;
}
+
+ public boolean isLocal()
+ {
+ return isLocal;
+ }
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Builder.java b/libjava/classpath/gnu/javax/net/ssl/provider/Builder.java
new file mode 100644
index 00000000000..baaba8aecf6
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/Builder.java
@@ -0,0 +1,66 @@
+/* Builder.java -- builder interface for protocol objects.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.nio.ByteBuffer;
+
+/**
+ * The base interface for classes that build SSL protocol objects. The
+ * general contract for Builder implementations is that they maintain a
+ * buffer that grows to fit the object being built; the allocated size of
+ * this buffer may be larger than the built object needs, but the general
+ * effort will be not to allocate too large a buffer.
+ *
+ * <p>Once the object is built, through various <em>setters</em> for
+ * the object's attributes, the final buffer may be retrieved with the
+ * {@link #buffer()} method.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public interface Builder extends Constructed
+{
+ /**
+ * Returns the final buffer, possibly containing the built object. The
+ * returned buffer will be "trimmed" to size: its position will be zero,
+ * and its limit and capacity set to the length of the built object.
+ *
+ * @return The underlying buffer.
+ */
+ ByteBuffer buffer();
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Certificate.java b/libjava/classpath/gnu/javax/net/ssl/provider/Certificate.java
index b1d6b2a0143..8ff91e5579e 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/Certificate.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/Certificate.java
@@ -1,4 +1,4 @@
-/* Certificate.java -- SSL Certificate message.
+/* Certificate.java -- SSL certificate message.
Copyright (C) 2006 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -38,157 +38,140 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
-import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.EOFException;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
import java.io.PrintWriter;
-import java.io.StringReader;
import java.io.StringWriter;
-import java.security.cert.CertificateEncodingException;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
+import java.util.Iterator;
import java.util.LinkedList;
-
-import javax.net.ssl.SSLProtocolException;
-
-final class Certificate implements Handshake.Body
+import java.util.List;
+
+/**
+ * The certificate object. This is used by both the client and the server
+ * to send their certificates (if any) to one another.
+ *
+ * <pre>opaque ASN.1Cert&lt;1..2^24-1&gt;;
+
+struct {
+ ASN.1Cert certificate_list&lt;0..2^24-1&gt;;
+} Certificate;</pre>
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class Certificate implements Handshake.Body
{
// Fields.
// -------------------------------------------------------------------------
- private final X509Certificate[] certs;
+ protected ByteBuffer buffer;
+ protected final CertificateType type;
// Constructors.
// -------------------------------------------------------------------------
- Certificate(X509Certificate[] certs)
+ public Certificate (final ByteBuffer buffer, final CertificateType type)
{
- if (certs == null)
- {
- throw new NullPointerException();
- }
- this.certs = certs;
+ buffer.getClass ();
+ type.getClass ();
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ this.type = type;
}
- // Class methods.
+ // Instance methods.
// -------------------------------------------------------------------------
- static Certificate read(InputStream in, CertificateType type)
- throws IOException
+ public int length ()
{
- if (type == CertificateType.X509)
- {
- int len = (in.read() & 0xFF) << 16 | (in.read() & 0xFF) << 8
- | (in.read() & 0xFF);
- byte[] buf = new byte[len];
- int count = 0;
- while (count < len)
- {
- int l = in.read(buf, count, len - count);
- if (l == -1)
- {
- throw new EOFException("unexpected end of stream");
- }
- count += l;
- }
- try
- {
- LinkedList certs = new LinkedList();
- CertificateFactory fact = CertificateFactory.getInstance("X.509");
- ByteArrayInputStream bin = new ByteArrayInputStream(buf);
- count = 0;
- while (count < len)
- {
- int len2 = (bin.read() & 0xFF) << 16 | (bin.read() & 0xFF) << 8
- | (bin.read() & 0xFF);
- certs.add(fact.generateCertificate(bin));
- count += len2 + 3;
- }
- return new Certificate((X509Certificate[])
- certs.toArray(new X509Certificate[certs.size()]));
- }
- catch (CertificateException ce)
- {
- SSLProtocolException sslpe = new SSLProtocolException(ce.getMessage());
- sslpe.initCause (ce);
- throw sslpe;
- }
- }
- else if (type == CertificateType.OPEN_PGP)
- {
- throw new UnsupportedOperationException("not yet implemented");
- }
- else
- throw new Error("unsupported certificate type "+type);
+ return (((buffer.get (0) & 0xFF) << 24)
+ | buffer.getShort (1)) + 3;
}
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public void write(OutputStream out) throws IOException
+ public List<java.security.cert.Certificate> certificates ()
+ throws CertificateException, NoSuchAlgorithmException
{
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- try
- {
- for (int i = 0; i < certs.length; i++)
- {
- byte[] enc = certs[i].getEncoded();
- bout.write((enc.length >>> 16) & 0xFF);
- bout.write((enc.length >>> 8) & 0xFF);
- bout.write( enc.length & 0xFF);
- bout.write(enc);
- }
- }
- catch (CertificateEncodingException cee)
- {
- throw new Error("cannot encode certificates");
- }
- catch (IOException ignored)
+ LinkedList<java.security.cert.Certificate> list
+ = new LinkedList<java.security.cert.Certificate>();
+ CertificateFactory factory = CertificateFactory.getInstance(type.toString());
+ int length = (((buffer.get(0) & 0xFF) << 16)
+ | (buffer.getShort(1) & 0xFFFF));
+ ByteBuffer b = (ByteBuffer) buffer.duplicate().position(3);
+ for (int i = 3; i < length; )
{
+ int length2 = (((b.get () & 0xFF) << 16)
+ | (b.getShort () & 0xFFFF));
+ byte[] buf = new byte[length2];
+ b.position(i+3);
+ b.get (buf);
+ list.add(factory.generateCertificate (new ByteArrayInputStream (buf)));
+ i += length2 + 3;
+ b.position(i);
}
- out.write(bout.size() >>> 16 & 0xFF);
- out.write(bout.size() >>> 8 & 0xFF);
- out.write(bout.size() & 0xFF);
- bout.writeTo(out);
+ return list;
}
- X509Certificate[] getCertificates()
+ public String toString ()
{
- return certs;
+ return toString (null);
}
- public String toString()
+ public String toString (final String prefix)
{
StringWriter str = new StringWriter();
PrintWriter out = new PrintWriter(str);
- out.println("struct {");
- out.println(" certificateList =");
- for (int i = 0; i < certs.length; i++)
+ if (prefix != null)
+ out.print (prefix);
+ out.println ("struct {");
+ try
{
- BufferedReader r =
- new BufferedReader(new StringReader(certs[i].toString()));
- String s;
- try
- {
- while ((s = r.readLine()) != null)
- {
- out.print(" ");
- out.println(s);
- }
- }
- catch (IOException ignored)
+ List certs = certificates ();
+ if (prefix != null)
+ out.print (prefix);
+ out.print (" certificateList: [");
+ out.print (certs.size ());
+ out.println ("] {");
+ for (Iterator it = certs.iterator (); it.hasNext (); )
{
+ java.security.cert.Certificate cert =
+ (java.security.cert.Certificate) it.next ();
+ if (prefix != null)
+ out.print (prefix);
+ out.print (" ");
+ if (cert instanceof X509Certificate)
+ out.print (((X509Certificate) cert).getSubjectDN ());
+ else
+ out.print (cert);
+ out.println (";");
}
+ if (prefix != null)
+ out.print (prefix);
+ out.println (" };");
+ }
+ catch (CertificateException ce)
+ {
+ if (prefix != null)
+ out.print (prefix);
+ out.print (" ");
+ out.print (ce);
+ out.println (";");
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ if (prefix != null)
+ out.print (prefix);
+ out.print (" ");
+ out.print (nsae);
+ out.println (";");
}
- out.println("} Certificate;");
+ out.print ("} Certificate;");
return str.toString();
}
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/CertificateBuilder.java b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateBuilder.java
new file mode 100644
index 00000000000..b60ad556ac9
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateBuilder.java
@@ -0,0 +1,94 @@
+/* CertificateBuilder.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.List;
+import java.security.cert.CertificateException;
+
+/**
+ * Builder for {@link Certificate} objects.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class CertificateBuilder extends Certificate implements Builder
+{
+ public CertificateBuilder(final CertificateType certType)
+ {
+ super(ByteBuffer.allocate(1024), certType);
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Builder#buffer()
+ */
+ public ByteBuffer buffer()
+ {
+ return ((ByteBuffer) buffer.duplicate().position(0).limit(length())).slice();
+ }
+
+ public void setCertificates (final List<? extends java.security.cert.Certificate> certificates)
+ throws CertificateException
+ {
+ ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
+ for (java.security.cert.Certificate cert : certificates)
+ {
+ byte[] encoded = cert.getEncoded();
+ out.write((encoded.length >>> 16) & 0xFF);
+ out.write((encoded.length >>> 8) & 0xFF);
+ out.write( encoded.length & 0xFF);
+ try
+ {
+ out.write(encoded);
+ }
+ catch (IOException shouldNotHappen)
+ {
+ // ignore; this is a ByteArrayOutputStream.
+ }
+ }
+ byte[] certs = out.toByteArray();
+ // There is only one field in Certificate; so it is easy to reallocate.
+ if (buffer.capacity() < certs.length + 3)
+ buffer = ByteBuffer.allocate(certs.length + 3);
+ buffer.put(0, (byte) (certs.length >>> 16));
+ buffer.putShort(1, (short) certs.length);
+ ((ByteBuffer) buffer.duplicate().position(3)).put(certs);
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/CertificateRequest.java b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateRequest.java
index 0f788039b0b..b7a22b20400 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/CertificateRequest.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateRequest.java
@@ -38,201 +38,96 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.EOFException;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
-import java.util.LinkedList;
-import java.security.Principal;
-
-final class CertificateRequest implements Handshake.Body
+/**
+ * A request by the server for a client certificate.
+ *
+ * <pre>
+struct
+{
+ ClientCertificateType certificate_types&lt;1..2^8-1&gt;;
+ DistinguishedName certificate_authorities&lt;3..2^16-1&gt;;
+} CertificateRequest;
+</pre>
+ */
+public class CertificateRequest implements Handshake.Body
{
// Fields.
// -------------------------------------------------------------------------
- private final ClientType[] types;
- private final Principal[] authorities;
-
+ protected ByteBuffer buffer;
+
// Constructor.
// -------------------------------------------------------------------------
- CertificateRequest(ClientType[] types, Principal[] authorities)
- {
- if (types == null)
- {
- throw new NullPointerException();
- }
- this.types = types;
- if (authorities == null)
- {
- throw new NullPointerException();
- }
- this.authorities = authorities;
- }
-
- // Class methods.
- // -------------------------------------------------------------------------
-
- static CertificateRequest read(InputStream in) throws IOException
+ public CertificateRequest(final ByteBuffer buffer)
{
- DataInputStream din = new DataInputStream(in);
- ClientType[] types = new ClientType[din.readUnsignedByte()];
- for (int i = 0; i < types.length; i++)
- {
- types[i] = ClientType.read(din);
- }
-
- LinkedList authorities = new LinkedList();
- byte[] buf = new byte[din.readUnsignedShort()];
- din.readFully(buf);
- ByteArrayInputStream bin = new ByteArrayInputStream(buf);
- try
- {
- String x500name = Util.getSecurityProperty("jessie.x500.class");
- if (x500name == null)
- {
- x500name = "org.metastatic.jessie.pki.X500Name";
- }
- Class x500class = null;
- ClassLoader cl = ClassLoader.getSystemClassLoader();
- if (cl != null)
- {
- x500class = cl.loadClass(x500name);
- }
- else
- {
- x500class = Class.forName(x500name);
- }
- Constructor c = x500class.getConstructor(new Class[] { new byte[0].getClass() });
- while (bin.available() > 0)
- {
- buf = new byte[(bin.read() & 0xFF) << 8 | (bin.read() & 0xFF)];
- bin.read(buf);
- authorities.add(c.newInstance(new Object[] { buf }));
- }
- }
- catch (IOException ioe)
- {
- throw ioe;
- }
- catch (Exception ex)
- {
- throw new Error(ex.toString());
- }
- return new CertificateRequest(types,
- (Principal[]) authorities.toArray(new Principal[authorities.size()]));
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
}
// Instance methods.
// -------------------------------------------------------------------------
- public void write(OutputStream out) throws IOException
+ public int length ()
{
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- out.write(types.length);
- for (int i = 0; i < types.length; i++)
- {
- out.write(types[i].getValue());
- }
-
- try
- {
- Class x500class = authorities[0].getClass();
- Method m = x500class.getMethod("getEncoded", null);
- for (int i = 0; i < authorities.length; i++)
- {
- byte[] buf = (byte[]) m.invoke(authorities[i], null);
- bout.write(buf.length >>> 8 & 0xFF);
- bout.write(buf.length & 0xFF);
- bout.write(buf, 0, buf.length);
- }
- }
- catch (Exception ex)
- {
- throw new Error(ex.toString());
- }
- out.write(bout.size() >>> 8 & 0xFF);
- out.write(bout.size() & 0xFF);
- bout.writeTo(out);
+ int o1 = (buffer.get (0) & 0xFF) + 1;
+ return o1 + (buffer.getShort (o1) & 0xFFFF) + 2;
}
- ClientType[] getTypes()
+ public ClientCertificateTypeList types ()
{
- return types;
+ return new ClientCertificateTypeList(buffer.duplicate());
}
- String[] getTypeStrings()
+ public X500PrincipalList authorities ()
{
- try
- {
- return (String[]) Util.transform(types, String.class, "toString", null);
- }
- catch (Exception x)
- {
- return null;
- }
+ int offset = (buffer.get (0) & 0xFF) + 1;
+ return new X500PrincipalList (((ByteBuffer) buffer.position(offset)).slice());
}
- Principal[] getAuthorities()
+ public String toString()
{
- return authorities;
+ return toString (null);
}
- public String toString()
+ public String toString (final String prefix)
{
StringWriter str = new StringWriter();
PrintWriter out = new PrintWriter(str);
+ String subprefix = " ";
+ if (prefix != null) subprefix = prefix + " ";
+ if (prefix != null) out.print (prefix);
out.println("struct {");
- out.print(" types = ");
- for (int i = 0; i < types.length; i++)
- {
- out.print(types[i]);
- if (i != types.length - 1)
- out.print(", ");
- }
- out.println(";");
+ if (prefix != null) out.print (prefix);
+ out.println (" types =");
+ out.println (types ().toString (subprefix));
+ if (prefix != null) out.print (prefix);
out.println(" authorities =");
- for (int i = 0; i < authorities.length; i++)
- {
- out.print(" ");
- out.print(authorities[i].getName());
- if (i != types.length - 1)
- out.println(",");
- }
- out.println(";");
- out.println("} CertificateRequest;");
+ out.println (authorities ().toString (subprefix));
+ if (prefix != null) out.print (prefix);
+ out.print ("} CertificateRequest;");
return str.toString();
}
- // Inner class.
- // -------------------------------------------------------------------------
-
- static final class ClientType implements Enumerated
+ public static enum ClientCertificateType
{
-
- // Constants and fields.
- // -----------------------------------------------------------------------
-
- static final ClientType
- RSA_SIGN = new ClientType(1), DSS_SIGN = new ClientType(2),
- RSA_FIXED_DH = new ClientType(3), DSS_FIXED_DH = new ClientType(4);
+ RSA_SIGN (1),
+ DSS_SIGN (2),
+ RSA_FIXED_DH (3),
+ DSS_FIXED_DH (4);
private final int value;
// Constructor.
// -----------------------------------------------------------------------
- private ClientType(int value)
+ private ClientCertificateType (final int value)
{
this.value = value;
}
@@ -240,46 +135,21 @@ final class CertificateRequest implements Handshake.Body
// Class method.
// -----------------------------------------------------------------------
- static ClientType read(InputStream in) throws IOException
+ static ClientCertificateType forValue (final int value)
{
- int i = in.read();
- if (i == -1)
- {
- throw new EOFException("unexpected end of input stream");
- }
- switch (i & 0xFF)
+ switch (value)
{
case 1: return RSA_SIGN;
case 2: return DSS_SIGN;
case 3: return RSA_FIXED_DH;
case 4: return DSS_FIXED_DH;
- default: return new ClientType(i);
+ default: throw new IllegalArgumentException("unknown client certificate type: " + value);
}
}
- // Instance methods.
- // -----------------------------------------------------------------------
-
- public byte[] getEncoded()
- {
- return new byte[] { (byte) value };
- }
-
public int getValue()
{
return value;
}
-
- public String toString()
- {
- switch (value)
- {
- case 1: return "rsa_sign";
- case 2: return "dss_sign";
- case 3: return "rsa_fixed_dh";
- case 4: return "dss_fixed_dh";
- default: return "unknown(" + value + ")";
- }
- }
}
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/CertificateRequestBuilder.java b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateRequestBuilder.java
new file mode 100644
index 00000000000..9beab473ca6
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateRequestBuilder.java
@@ -0,0 +1,113 @@
+/* CertificateRequestBuilder.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import static gnu.javax.net.ssl.provider.CertificateRequest.ClientCertificateType;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.List;
+
+import javax.security.auth.x500.X500Principal;
+
+/**
+ * Builder for {@link CertificateRequest} objects.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class CertificateRequestBuilder extends CertificateRequest
+ implements Builder
+{
+ public CertificateRequestBuilder()
+ {
+ super(ByteBuffer.allocate(1024));
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Builder#buffer()
+ */
+ public ByteBuffer buffer()
+ {
+ return ((ByteBuffer) buffer.duplicate().limit(length())).slice();
+ }
+
+ public void setTypes(List<ClientCertificateType> types)
+ {
+ ensureCapacity(types.size() + 3);
+ buffer.put(0, (byte) types.size());
+ ByteBuffer b = (ByteBuffer) buffer.duplicate().position(1);
+ for (ClientCertificateType type : types)
+ b.put((byte) type.getValue());
+ }
+
+ public void setAuthorities(List<X500Principal> authorities)
+ {
+ ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
+ for (X500Principal auth : authorities)
+ {
+ byte[] encoded = auth.getEncoded();
+ out.write((encoded.length >>> 8) & 0xFF);
+ out.write( encoded.length & 0xFF);
+ try
+ {
+ out.write(encoded);
+ }
+ catch (IOException ignored)
+ {
+ // Ignored; we use a ByteArrayOutputStream.
+ }
+ }
+ byte[] auths = out.toByteArray();
+ int typesLen = 1 + (buffer.get(0) & 0xFF);
+ int len = typesLen + auths.length + 2;
+ ensureCapacity(len);
+ buffer.putShort(typesLen, (short) auths.length);
+ ((ByteBuffer) buffer.duplicate().position(typesLen + 2)).put(auths);
+ }
+
+ public void ensureCapacity(final int capacity)
+ {
+ if (buffer.capacity() >= capacity)
+ return;
+ ByteBuffer newBuffer = ByteBuffer.allocate(capacity);
+ newBuffer.duplicate().put(buffer);
+ buffer = newBuffer;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/CertificateStatusRequest.java b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateStatusRequest.java
new file mode 100644
index 00000000000..059c6ec47ba
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateStatusRequest.java
@@ -0,0 +1,272 @@
+/* CertificateStatusRequest.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.javax.net.ssl.provider.Extension.Value;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.ByteBuffer;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+/**
+ * <pre>
+struct {
+ CertificateStatusType status_type;
+ select (status_type) {
+ case ocsp: OCSPStatusRequest;
+ } request;
+} CertificateStatusRequest;
+
+enum { ocsp(1), (255) } CertificateStatusType;
+
+struct {
+ ResponderID responder_id_list&lt;0..2^16-1&gt;;
+ Extensions request_extensions;
+} OCSPStatusRequest;
+
+opaque ResponderID&lt;1..2^16-1&gt;;
+opaque Extensions&lt;0..2^16-1&gt;;</pre>
+ *
+ * @author csm
+ */
+public class CertificateStatusRequest extends Value implements Iterable<byte[]>
+{
+ private ByteBuffer buffer;
+
+ public CertificateStatusRequest(final ByteBuffer buffer)
+ {
+ this.buffer = buffer;
+ }
+
+ public CertificateStatusRequest(CertificateStatusType type,
+ List<byte[]> responderIdList,
+ byte[] requestExtensions)
+ {
+ if (type != CertificateStatusType.OCSP)
+ throw new IllegalArgumentException();
+ int length = 3;
+ int idsLength = 0;
+ for (byte[] responderId : responderIdList)
+ {
+ length += 2 + responderId.length;
+ idsLength += 2 + responderId.length;
+ }
+ length += 2 + requestExtensions.length;
+ buffer = ByteBuffer.allocate(length);
+ buffer.put((byte) 1);
+ buffer.putShort((short) idsLength);
+ for (byte[] responderId : responderIdList)
+ buffer.putShort((short) responderId.length).put(responderId);
+ buffer.putShort((short) requestExtensions.length);
+ buffer.put(requestExtensions);
+ buffer.rewind();
+ }
+
+ public int length()
+ {
+ int l = 3 + (buffer.getShort(1) & 0xFFFF);
+ return l + (buffer.getShort(l) & 0xFFFF) + 2;
+ }
+
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().limit(length());
+ }
+
+ public CertificateStatusType statusType()
+ {
+ int x = buffer.get(0) & 0xFF;
+ if (x == 1)
+ return CertificateStatusType.OCSP;
+ throw new IllegalArgumentException ("invalid type: " + x);
+ }
+
+ public int size()
+ {
+ int len = buffer.getShort(1) & 0xFFFF;
+ int n = 0;
+ for (int i = 3; i < len; )
+ {
+ int l = buffer.getShort(i);
+ i += l + 2;
+ n++;
+ }
+ return n;
+ }
+
+ public byte[] responderId(int index)
+ {
+ int len = buffer.getShort(1) & 0xFFFF;
+ int n = 0;
+ int i = 3;
+ while (i < len && n <= index)
+ {
+ int l = buffer.getShort(i) & 0xFFFF;
+ if (n == index)
+ {
+ byte[] b = new byte[l];
+ ((ByteBuffer) buffer.duplicate().position(i+2)).get(b);
+ return b;
+ }
+ i += l + 2;
+ n++;
+ }
+ throw new IndexOutOfBoundsException();
+ }
+
+ public byte[] requestExtensions()
+ {
+ int l = 2 + (buffer.getShort(0) & 0xFFFF);
+ int ll = buffer.getShort(l) & 0xFFFF;
+ byte[] b = new byte[ll];
+ ((ByteBuffer) buffer.duplicate().position(ll+2)).get(b);
+ return b;
+ }
+
+ public void setStatusType(CertificateStatusType type)
+ {
+ buffer.put(0, (byte) type.value);
+ }
+
+ public void setRequestIdListLength(int newLength)
+ {
+ if (newLength < 0 || newLength > 0xFFFF)
+ throw new IllegalArgumentException("length out of range");
+ buffer.putShort(1, (short) newLength);
+ }
+
+ public void putRequestId(int index, byte[] id)
+ {
+ if (id.length > 0xFFFF)
+ throw new IllegalArgumentException("request ID too large");
+ int len = buffer.getShort(1) & 0xFFFF;
+ int n = 0;
+ int i = 3;
+ while (i < len && n < index)
+ {
+ int l = buffer.getShort(i) & 0xFFFF;
+ i += l + 2;
+ n++;
+ }
+ if (n < index)
+ throw new IndexOutOfBoundsException();
+ buffer.putShort(i, (short) id.length);
+ ((ByteBuffer) buffer.duplicate().position(i)).put(id);
+ }
+
+ public void setRequestExtensions(int index, byte[] ext)
+ {
+ if (ext.length > 0xFFFF)
+ throw new IllegalArgumentException("exceptions too large");
+ int off = 3 + (buffer.getShort(1) & 0xFFFF);
+ buffer.putShort(off, (short) ext.length);
+ ((ByteBuffer) buffer.duplicate().position(off+2)).put(ext);
+ }
+
+ public Iterator<byte[]> iterator()
+ {
+ return new ResponderIdIterator();
+ }
+
+ public String toString()
+ {
+ return toString(null);
+ }
+
+ public String toString(String prefix)
+ {
+ StringWriter str = new StringWriter();
+ PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print(prefix);
+ out.println("struct {");
+ if (prefix != null) out.print(prefix);
+ out.print(" status_type = ");
+ out.print(statusType());
+ out.println(";");
+ String subprefix = " ";
+ if (prefix != null) subprefix = prefix + subprefix;
+ if (prefix != null) out.print(prefix);
+ out.println(" responder_id_list = {");
+ for (byte[] b : this)
+ out.print(Util.hexDump(b, subprefix));
+ if (prefix != null) out.print(prefix);
+ out.println(" };");
+ if (prefix != null) out.print(prefix);
+ out.println(" request_extensions =");
+ out.print(Util.hexDump(requestExtensions(), subprefix));
+ if (prefix != null) out.print(prefix);
+ out.print("} CertificateStatus;");
+ return str.toString();
+ }
+
+ public class ResponderIdIterator implements Iterator<byte[]>
+ {
+ private int index;
+
+ public ResponderIdIterator()
+ {
+ index = 0;
+ }
+
+ public byte[] next() throws NoSuchElementException
+ {
+ try
+ {
+ return responderId(index++);
+ }
+ catch (IndexOutOfBoundsException ioobe)
+ {
+ throw new NoSuchElementException();
+ }
+ }
+
+ public boolean hasNext()
+ {
+ return index < size();
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/CertificateStatusType.java b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateStatusType.java
new file mode 100644
index 00000000000..7cddf168f94
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateStatusType.java
@@ -0,0 +1,13 @@
+package gnu.javax.net.ssl.provider;
+
+public enum CertificateStatusType
+{
+ OCSP (1);
+
+ public final int value;
+
+ private CertificateStatusType (final int value)
+ {
+ this.value = value;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/CertificateType.java b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateType.java
index c5705939f74..ecba21b6342 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/CertificateType.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateType.java
@@ -38,67 +38,25 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
-import java.io.EOFException;
-import java.io.InputStream;
-import java.io.IOException;
-
-final class CertificateType implements Enumerated
+public enum CertificateType
{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- static final CertificateType X509 = new CertificateType(0);
- static final CertificateType OPEN_PGP = new CertificateType(1);
+ X509 (0),
+ OPEN_PGP (1);
private final int value;
- // Constructor.
- // -------------------------------------------------------------------------
-
private CertificateType(int value)
{
this.value = value;
}
- // Class method.
- // -------------------------------------------------------------------------
-
- static CertificateType read(InputStream in) throws IOException
- {
- int value = in.read();
- if (value == -1)
- {
- throw new EOFException("unexpected end of input stream");
- }
- switch (value & 0xFF)
- {
- case 0: return X509;
- case 1: return OPEN_PGP;
- default: return new CertificateType(value);
- }
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public byte[] getEncoded()
- {
- return new byte[] { (byte) value };
- }
-
- public int getValue()
- {
- return value;
- }
-
- public String toString()
+ public static CertificateType forValue (final int value)
{
switch (value)
{
- case 0: return "X.509";
- case 1: return "OpenPGP";
- default: return "unknown(" + value + ")";
+ case 0: return X509;
+ case 1: return OPEN_PGP;
+ default: throw new IllegalArgumentException ("unknown certificate type: " + value);
}
}
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/CertificateURL.java b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateURL.java
new file mode 100644
index 00000000000..0bc1c428b48
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateURL.java
@@ -0,0 +1,388 @@
+/* CertificateURL.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.javax.net.ssl.provider.Extension.Value;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetEncoder;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+/**
+ * The CertificateURL extension value.
+ *
+ * <pre>
+enum {
+ individual_certs(0), pkipath(1), (255)
+} CertChainType;
+
+enum {
+ false(0), true(1)
+} Boolean;
+
+struct {
+ CertChainType type;
+ URLAndOptionalHash url_and_hash_list&lt;1..2^16-1&gt;;
+} CertificateURL;
+
+struct {
+ opaque url&lt;1..2^16-1&gt;;
+ Boolean hash_present;
+ select (hash_present) {
+ case false: struct {};
+ case true: SHA1Hash;
+ } hash;
+} URLAndOptionalHash;
+
+opaque SHA1Hash[20];</pre>
+ *
+ * @author csm
+ *
+ */
+public class CertificateURL extends Value implements Iterable<CertificateURL.URLAndOptionalHash>
+{
+ private ByteBuffer buffer;
+
+ public CertificateURL(final ByteBuffer buffer)
+ {
+ this.buffer = buffer;
+ }
+
+ public CertificateURL(CertChainType type, List<URLAndOptionalHash> urls)
+ {
+ int length = 3;
+ for (URLAndOptionalHash url : urls)
+ length += url.length();
+ buffer = ByteBuffer.allocate(length);
+ buffer.put((byte) type.getValue());
+ buffer.putShort((short) (length - 1));
+ for (URLAndOptionalHash url : urls)
+ buffer.put(url.buffer());
+ buffer.rewind();
+ }
+
+ public int length()
+ {
+ return 3 + (buffer.getShort(1) & 0xFFFF);
+ }
+
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().limit(length());
+ }
+
+ public CertChainType type()
+ {
+ switch (buffer.get(0))
+ {
+ case 0: return CertChainType.INDIVIDUAL_CERTS;
+ case 1: return CertChainType.PKIPATH;
+ }
+ throw new IllegalArgumentException("unknown certificate URL type");
+ }
+
+ public int size()
+ {
+ int len = buffer.getShort(1) & 0xFFFF;
+ int n = 0;
+ for (int i = 3; i < len; )
+ {
+ URLAndOptionalHash u
+ = new URLAndOptionalHash((ByteBuffer) buffer.duplicate().position(i));
+ int l = u.length();
+ i += l;
+ n++;
+ }
+ return n;
+ }
+
+ public URLAndOptionalHash get(int index)
+ {
+ int len = buffer.getShort(1) & 0xFFFF;
+ int n = 0;
+ int l = 0;
+ int i;
+ for (i = 3; i < len && n < index; )
+ {
+ URLAndOptionalHash u
+ = new URLAndOptionalHash((ByteBuffer) buffer.duplicate().position(i));
+ l = u.length();
+ i += l;
+ n++;
+ }
+ if (n < index)
+ throw new IndexOutOfBoundsException();
+ return new URLAndOptionalHash(((ByteBuffer) buffer.duplicate().position(i).limit(i+l)).slice());
+ }
+
+ public void set(int index, URLAndOptionalHash url)
+ {
+ int len = buffer.getShort(1) & 0xFFFF;
+ int n = 0;
+ int i;
+ for (i = 3; i < len && n < index-1; )
+ {
+ URLAndOptionalHash u
+ = new URLAndOptionalHash((ByteBuffer) buffer.duplicate().position(i));
+ int l = u.length();
+ i += l;
+ n++;
+ }
+ if (n < index - 1)
+ throw new IndexOutOfBoundsException();
+ int l = url.urlLength();
+ buffer.putShort(i, (short) l);
+ ((ByteBuffer) buffer.duplicate().position(i+2)).put(url.urlBuffer());
+ buffer.put(i+l+2, (byte) (url.hashPresent() ? 1 : 0));
+ if (url.hashPresent())
+ ((ByteBuffer) buffer.duplicate().position(i+l+3)).put (url.sha1Hash());
+ }
+
+ public void setLength(final int length)
+ {
+ if (length < 0 || length > 65535)
+ throw new IllegalArgumentException("length must be between 0 and 65535");
+ buffer.putShort(1, (short) length);
+ }
+
+ public String toString()
+ {
+ return toString(null);
+ }
+
+ public String toString(String prefix)
+ {
+ StringWriter str = new StringWriter();
+ PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print(prefix);
+ out.println ("struct {");
+ if (prefix != null) out.print(prefix);
+ out.print(" type = ");
+ out.print(type());
+ out.println(";");
+ if (prefix != null) out.print(prefix);
+ out.println(" url_and_hash_list = {");
+ String subprefix = " ";
+ if (prefix != null) subprefix = prefix + subprefix;
+ for (URLAndOptionalHash url : this)
+ {
+ out.println(url.toString(subprefix));
+ }
+ if (prefix != null) out.print(prefix);
+ out.println(" };");
+ if (prefix != null) out.print(prefix);
+ out.print("} CertificateURL;");
+ return str.toString();
+ }
+
+ public java.util.Iterator<URLAndOptionalHash> iterator()
+ {
+ return new Iterator();
+ }
+
+ public class Iterator implements java.util.Iterator<URLAndOptionalHash>
+ {
+ private int index;
+
+ public Iterator()
+ {
+ index = 0;
+ }
+
+ public URLAndOptionalHash next() throws NoSuchElementException
+ {
+ try
+ {
+ return get(index++);
+ }
+ catch (IndexOutOfBoundsException ioobe)
+ {
+ throw new NoSuchElementException();
+ }
+ }
+
+ public boolean hasNext()
+ {
+ return index < size();
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ public static enum CertChainType
+ {
+ INDIVIDUAL_CERTS (0), PKIPATH (1);
+
+ private final int value;
+
+ private CertChainType (final int value)
+ {
+ this.value = value;
+ }
+
+ public int getValue()
+ {
+ return value;
+ }
+ }
+
+ public static class URLAndOptionalHash implements Builder, Constructed
+ {
+ private ByteBuffer buffer;
+
+ public URLAndOptionalHash (final ByteBuffer buffer)
+ {
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ }
+
+ public URLAndOptionalHash(String url)
+ {
+ this(url, null);
+ }
+
+ public URLAndOptionalHash(String url, byte[] hash)
+ {
+ if (hash != null && hash.length < 20)
+ throw new IllegalArgumentException();
+ int length = 3 + url.length();
+ if (hash != null)
+ length += 20;
+ buffer = ByteBuffer.allocate(length);
+ buffer.putShort((short) url.length());
+ Charset cs = Charset.forName("US-ASCII");
+ CharsetEncoder ascii = cs.newEncoder();
+ ascii.encode(CharBuffer.wrap(url), buffer, true);
+ buffer.put((byte) (hash != null ? 1 : 0));
+ if (hash != null)
+ buffer.put(hash, 0, 20);
+ buffer.rewind();
+ }
+
+ public int length()
+ {
+ return ((buffer.getShort(0) & 0xFFFF)
+ + (hashPresent() ? 23 : 3));
+ }
+
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().limit(length());
+ }
+
+ public String url()
+ {
+ Charset cs = Charset.forName("ASCII");
+ return cs.decode(urlBuffer()).toString();
+ }
+
+ public int urlLength()
+ {
+ return buffer.getShort(0) & 0xFFFF;
+ }
+
+ public ByteBuffer urlBuffer()
+ {
+ int len = urlLength();
+ return ((ByteBuffer) buffer.duplicate().position(2).limit(2+len)).slice();
+ }
+
+ public boolean hashPresent()
+ {
+ int i = (buffer.getShort(0) & 0xFFFF) + 2;
+ byte b = buffer.get(i);
+ if (b == 0)
+ return false;
+ if (b == 1)
+ return true;
+ throw new IllegalArgumentException("expecting 0 or 1: " + (b & 0xFF));
+ }
+
+ public byte[] sha1Hash()
+ {
+ int i = (buffer.getShort(0) & 0xFFFF) + 2;
+ byte b = buffer.get(i);
+ if (b == 0)
+ return null;
+ byte[] buf = new byte[20];
+ ((ByteBuffer) buffer.duplicate().position(i+1)).get(buf);
+ return buf;
+ }
+
+ public String toString()
+ {
+ return toString(null);
+ }
+
+ public String toString(final String prefix)
+ {
+ StringWriter str = new StringWriter();
+ PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print(prefix);
+ out.println("struct {");
+ if (prefix != null) out.print(prefix);
+ out.print(" url = ");
+ out.print(url());
+ out.println(";");
+ boolean has_hash = hashPresent();
+ if (prefix != null) out.print(prefix);
+ out.print(" hash_present = ");
+ out.print(has_hash);
+ out.println(";");
+ if (has_hash)
+ {
+ if (prefix != null) out.print(prefix);
+ out.print(" sha1Hash = ");
+ out.print(Util.toHexString(sha1Hash(), ':'));
+ out.println(";");
+ }
+ if (prefix != null) out.print(prefix);
+ out.print("} URLAndOptionalHash;");
+ return str.toString();
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/CertificateVerify.java b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateVerify.java
index e0bf130f189..b63f5e4ef0c 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/CertificateVerify.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/CertificateVerify.java
@@ -38,34 +38,24 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
import java.io.PrintWriter;
-import java.io.StringReader;
import java.io.StringWriter;
-import java.security.PublicKey;
+import java.nio.ByteBuffer;
-final class CertificateVerify extends Signature implements Handshake.Body
+public class CertificateVerify extends Signature implements Handshake.Body
{
// Contstructor.
// -------------------------------------------------------------------------
- CertificateVerify(Object sigValue, String sigAlg)
+ public CertificateVerify(final ByteBuffer buffer, final SignatureAlgorithm sigAlg)
{
- super(sigValue, sigAlg);
+ super(buffer, sigAlg);
}
-
- // Class method.
- // --------------------------------------------------------------------------
-
- static Signature read(InputStream in, CipherSuite suite, PublicKey key)
- throws IOException
+
+ public CertificateVerify(final byte[] sigVal, final SignatureAlgorithm sigAlg)
{
- Signature sig = Signature.read(in, suite, key);
- return new CertificateVerify(sig.getSigValue(), sig.getSigAlg());
+ super(sigVal, sigAlg);
}
// Instance method.
@@ -73,23 +63,21 @@ final class CertificateVerify extends Signature implements Handshake.Body
public String toString()
{
- StringWriter str = new StringWriter();
- PrintWriter out = new PrintWriter(str);
+ return toString (null);
+ }
+
+ public String toString (final String prefix)
+ {
+ StringWriter str = new StringWriter ();
+ PrintWriter out = new PrintWriter (str);
+ if (prefix != null) out.print (prefix);
out.println("struct {");
- BufferedReader r = new BufferedReader(new StringReader(super.toString()));
- String s;
- try
- {
- while ((s = r.readLine()) != null)
- {
- out.print(" ");
- out.println(s);
- }
- }
- catch (IOException ignored)
- {
- }
- out.println("} CertificateVerify;");
+ String subprefix = " ";
+ if (prefix != null)
+ subprefix = prefix + subprefix;
+ out.println (super.toString (subprefix));
+ if (prefix != null) out.print (prefix);
+ out.print ("} CertificateVerify;");
return str.toString();
}
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/CipherAlgorithm.java b/libjava/classpath/gnu/javax/net/ssl/provider/CipherAlgorithm.java
new file mode 100644
index 00000000000..98e05af310d
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/CipherAlgorithm.java
@@ -0,0 +1,47 @@
+/* CipherAlgorithm.java -- Cipher algorithm enumeration.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+/**
+ * The set of cipher algorithms we support.
+ */
+public enum CipherAlgorithm
+{
+ NULL, RC4, DES, DESede, CAST5, AES
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/CipherSuite.java b/libjava/classpath/gnu/javax/net/ssl/provider/CipherSuite.java
index de916817b92..af3041e9403 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/CipherSuite.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/CipherSuite.java
@@ -38,407 +38,521 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
-import java.io.DataInputStream;
-import java.io.InputStream;
+import gnu.java.security.action.GetSecurityPropertyAction;
+
import java.io.IOException;
import java.io.OutputStream;
-import java.lang.reflect.Field;
+import java.nio.ByteBuffer;
+import java.security.AccessController;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
-import java.security.Provider;
-import java.security.Security;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import java.util.Set;
import javax.crypto.Cipher;
import javax.crypto.Mac;
import javax.crypto.NoSuchPaddingException;
+import javax.crypto.NullCipher;
-import gnu.javax.crypto.cipher.CipherFactory;
-import gnu.javax.crypto.cipher.IBlockCipher;
-import gnu.javax.crypto.mac.IMac;
-import gnu.javax.crypto.mac.MacFactory;
-import gnu.javax.crypto.mode.IMode;
-import gnu.javax.crypto.mode.ModeFactory;
-
-final class CipherSuite implements Constructed
+public final class CipherSuite implements Constructed
{
// Constants and fields.
// -------------------------------------------------------------------------
- private static final List tlsSuiteNames = new LinkedList();
- private static final HashMap namesToSuites = new HashMap();
-
- // SSL CipherSuites.
- static final CipherSuite SSL_NULL_WITH_NULL_NULL =
- new CipherSuite("null", "null", "null", "null", 0, 0x00, 0x00,
- "SSL_NULL_WITH_NULL_NULL", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_RSA_WITH_NULL_MD5 =
- new CipherSuite("null", "RSA", "RSA", "SSLMAC-MD5", 0, 0x00, 0x01,
- "SSL_RSA_WITH_NULL_MD5", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_RSA_WITH_NULL_SHA =
- new CipherSuite("null", "RSA", "RSA", "SSLMAC-SHA", 0, 0x00, 0x02,
- "SSL_RSA_WITH_NULL_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_RSA_EXPORT_WITH_RC4_40_MD5 =
- new CipherSuite("RC4", "RSA", "RSA", "SSLMAC-MD5", 5, 0x00, 0x03,
- "SSL_RSA_EXPORT_WITH_RC4_40_MD5", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_RSA_WITH_RC4_128_MD5 =
- new CipherSuite("RC4", "RSA", "RSA", "SSLMAC-MD5", 16, 0x00, 0x04,
- "SSL_RSA_WITH_RC4_128_MD5", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_RSA_WITH_RC4_128_SHA =
- new CipherSuite("RC4", "RSA", "RSA", "SSLMAC-SHA", 16, 0x00, 0x05,
- "SSL_RSA_WITH_RC4_128_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_RSA_EXPORT_WITH_DES40_CBC_SHA =
- new CipherSuite("DES", "RSA", "RSA", "SSLMAC-SHA", 5, 0x00, 0x08,
- "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_RSA_WITH_DES_CBC_SHA =
- new CipherSuite("DES", "RSA", "RSA", "SSLMAC-SHA", 8, 0x00, 0x09,
- "SSL_RSA_WITH_DES_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_RSA_WITH_3DES_EDE_CBC_SHA =
- new CipherSuite("TripleDES", "RSA", "RSA", "SSLMAC-SHA", 24, 0x00, 0x0A,
- "SSL_RSA_WITH_3DES_EDE_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA =
- new CipherSuite("DES", "DH", "DSS", "SSLMAC-SHA", 5, 0x00, 0x0B,
- "SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DH_DSS_WITH_DES_CBC_SHA =
- new CipherSuite("DES", "DH", "DSS", "SSLMAC-SHA", 8, 0x00, 0x0C,
- "SSL_DH_DSS_WITH_DES_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA =
- new CipherSuite("TripleDES", "DH", "DSS", "SSLMAC-SHA", 24, 0x00, 0x0D,
- "SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA =
- new CipherSuite("DES", "DH", "RSA", "SSLMAC-SHA", 5, 0x00, 0x0E,
- "SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DH_RSA_WITH_DES_CBC_SHA =
- new CipherSuite("DES", "DH", "RSA", "SSLMAC-SHA", 8, 0x00, 0x0F,
- "SSL_DH_RSA_WITH_DES_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA =
- new CipherSuite("TripleDES", "DH", "RSA", "SSLMAC-SHA", 24, 0x00, 0x10,
- "SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA =
- new CipherSuite("DES", "DHE", "DSS", "SSLMAC-SHA", 5, 0x00, 0x11,
- "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_DSS_WITH_DES_CBC_SHA =
- new CipherSuite("DES", "DHE", "DSS", "SSLMAC-SHA", 8, 0x00, 0x12,
- "SSL_DHE_DSS_WITH_DES_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA =
- new CipherSuite("TripleDES", "DHE", "DSS", "SSLMAC-SHA", 24, 0x00, 0x13,
- "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA =
- new CipherSuite("DES", "DHE", "RSA", "SSLMAC-SHA", 5, 0x00, 0x14,
- "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_RSA_WITH_DES_CBC_SHA =
- new CipherSuite("DES", "DHE", "RSA", "SSLMAC-SHA", 8, 0x00, 0x15,
- "SSL_DHE_RSA_WITH_DES_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA =
- new CipherSuite("TripleDES", "DHE", "RSA", "SSLMAC-SHA", 24, 0x00, 0x16,
- "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", ProtocolVersion.SSL_3);
+ private static final List<String> tlsSuiteNames = new LinkedList<String>();
+ private static final HashMap<String, CipherSuite> namesToSuites = new HashMap<String, CipherSuite>();
+
+ // Core TLS cipher suites.
+ public static final CipherSuite TLS_NULL_WITH_NULL_NULL =
+ new CipherSuite (CipherAlgorithm.NULL,
+ KeyExchangeAlgorithm.NONE,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.NULL, 0, 0x00, 0x00,
+ "TLS_NULL_WITH_NULL_NULL");
+ public static final CipherSuite TLS_RSA_WITH_NULL_MD5 =
+ new CipherSuite (CipherAlgorithm.NULL,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.MD5, 0, 0x00, 0x01,
+ "TLS_RSA_WITH_NULL_MD5");
+ public static final CipherSuite TLS_RSA_WITH_NULL_SHA =
+ new CipherSuite (CipherAlgorithm.NULL,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 0, 0x00, 0x02,
+ "TLS_RSA_WITH_NULL_SHA");
+ public static final CipherSuite TLS_RSA_EXPORT_WITH_RC4_40_MD5 =
+ new CipherSuite (CipherAlgorithm.RC4,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.MD5, 5, 0x00, 0x03,
+ "TLS_RSA_EXPORT_WITH_RC4_40_MD5");
+ public static final CipherSuite TLS_RSA_WITH_RC4_128_MD5 =
+ new CipherSuite (CipherAlgorithm.RC4,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.MD5, 16, 0x00, 0x04,
+ "TLS_RSA_WITH_RC4_128_MD5");
+ public static final CipherSuite TLS_RSA_WITH_RC4_128_SHA =
+ new CipherSuite (CipherAlgorithm.RC4,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 16, 0x00, 0x05,
+ "TLS_RSA_WITH_RC4_128_SHA");
+ public static final CipherSuite TLS_RSA_EXPORT_WITH_DES40_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DES,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 5, 0x00, 0x08,
+ "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA");
+ public static final CipherSuite TLS_RSA_WITH_DES_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DES,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 8, 0x00, 0x09,
+ "TLS_RSA_WITH_DES_CBC_SHA");
+ public static final CipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DESede,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 24, 0x00, 0x0A,
+ "TLS_RSA_WITH_3DES_EDE_CBC_SHA");
+ public static final CipherSuite TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DES,
+ KeyExchangeAlgorithm.DH_DSS,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 5, 0x00, 0x0B,
+ "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA");
+ public static final CipherSuite TLS_DH_DSS_WITH_DES_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DES,
+ KeyExchangeAlgorithm.DH_DSS,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 8, 0x00, 0x0C,
+ "TLS_DH_DSS_WITH_DES_CBC_SHA");
+ public static final CipherSuite TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DESede,
+ KeyExchangeAlgorithm.DH_DSS,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 24, 0x00, 0x0D,
+ "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA");
+ public static final CipherSuite TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DES,
+ KeyExchangeAlgorithm.DH_RSA,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 5, 0x00, 0x0E,
+ "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA");
+ public static final CipherSuite TLS_DH_RSA_WITH_DES_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DES,
+ KeyExchangeAlgorithm.DH_RSA,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 8, 0x00, 0x0F,
+ "TLS_DH_RSA_WITH_DES_CBC_SHA");
+ public static final CipherSuite TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DESede,
+ KeyExchangeAlgorithm.DH_RSA,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 24, 0x00, 0x10,
+ "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA");
+ public static final CipherSuite TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DES,
+ KeyExchangeAlgorithm.DHE_DSS, true,
+ SignatureAlgorithm.DSA,
+ MacAlgorithm.SHA, 5, 0x00, 0x11,
+ "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA");
+ public static final CipherSuite TLS_DHE_DSS_WITH_DES_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DES,
+ KeyExchangeAlgorithm.DHE_DSS, true,
+ SignatureAlgorithm.DSA,
+ MacAlgorithm.SHA, 8, 0x00, 0x12,
+ "TLS_DHE_DSS_WITH_DES_CBC_SHA");
+ public static final CipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DESede,
+ KeyExchangeAlgorithm.DHE_DSS, true,
+ SignatureAlgorithm.DSA,
+ MacAlgorithm.SHA, 24, 0x00, 0x13,
+ "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA");
+ public static final CipherSuite TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DES,
+ KeyExchangeAlgorithm.DHE_RSA, true,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 5, 0x00, 0x14,
+ "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA");
+ public static final CipherSuite TLS_DHE_RSA_WITH_DES_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DES,
+ KeyExchangeAlgorithm.DHE_RSA, true,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 8, 0x00, 0x15,
+ "TLS_DHE_RSA_WITH_DES_CBC_SHA");
+ public static final CipherSuite TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DESede,
+ KeyExchangeAlgorithm.DHE_RSA, true,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 24, 0x00, 0x16,
+ "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA");
// AES CipherSuites.
- static final CipherSuite SSL_RSA_WITH_AES_128_CBC_SHA =
- new CipherSuite("AES", "RSA", "RSA", "SSLMAC-SHA", 16, 0x00, 0x2F,
- "SSL_RSA_WITH_AES_128_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DH_DSS_WITH_AES_128_CBC_SHA =
- new CipherSuite("AES", "DH", "DSS", "SSLMAC-SHA", 16, 0x00, 0x30,
- "SSL_DH_DSS_WITH_AES_128_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DH_RSA_WITH_AES_128_CBC_SHA =
- new CipherSuite("AES", "DH", "RSA", "SSLMAC-SHA", 16, 0x00, 0x31,
- "SSL_DH_RSA_WITH_AES_128_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_DSS_WITH_AES_128_CBC_SHA =
- new CipherSuite("AES", "DHE", "DSS", "SSLMAC-SHA", 16, 0x00, 0x32,
- "SSL_DHE_DSS_WITH_AES_128_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_RSA_WITH_AES_128_CBC_SHA =
- new CipherSuite("AES", "DHE", "RSA", "SSLMAC-SHA", 16, 0x00, 0x33,
- "SSL_DHE_RSA_WITH_AES_128_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_RSA_WITH_AES_256_CBC_SHA =
- new CipherSuite("AES", "RSA", "RSA", "SSLMAC-SHA", 32, 0x00, 0x35,
- "SSL_RSA_WITH_AES_256_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DH_DSS_WITH_AES_256_CBC_SHA =
- new CipherSuite("AES", "DH", "DSS", "SSLMAC-SHA", 32, 0x00, 0x36,
- "SSL_DH_DSS_WITH_AES_256_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DH_RSA_WITH_AES_256_CBC_SHA =
- new CipherSuite("AES", "DH", "RSA", "SSLMAC-SHA", 32, 0x00, 0x37,
- "SSL_DH_RSA_WITH_AES_256_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_DSS_WITH_AES_256_CBC_SHA =
- new CipherSuite("AES", "DHE", "DSS", "SSLMAC-SHA", 32, 0x00, 0x38,
- "SSL_DHE_DSS_WITH_AES_256_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_RSA_WITH_AES_256_CBC_SHA =
- new CipherSuite("AES", "DHE", "RSA", "SSLMAC-SHA", 32, 0x00, 0x39,
- "SSL_DHE_RSA_WITH_AES_256_CBC_SHA", ProtocolVersion.SSL_3);
-
- // Ciphersuites from the OpenPGP extension draft.
- static final CipherSuite SSL_DHE_DSS_WITH_CAST_128_CBC_SHA =
- new CipherSuite("CAST5", "DHE", "DSS", "HMAC-SHA", 16, 0x00, 0x70,
- "SSL_DHE_DSS_WITH_CAST_128_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_DSS_WITH_CAST_128_CBC_RMD =
- new CipherSuite("CAST5", "DHE", "DSS", "HMAC-RIPEMD-160", 16, 0x00, 0x71,
- "SSL_DHE_DSS_WITH_CAST_128_CBC_RMD", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_DSS_WITH_3DES_EDE_CBC_RMD =
- new CipherSuite("TripleDES", "DHE", "DSS", "HMAC-RIPEMD-160", 24, 0x00, 0x72,
- "SSL_DHE_DSS_WITH_3DES_EDE_CBC_RMD", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_DSS_WITH_AES_128_CBC_RMD =
- new CipherSuite("AES", "DHE", "DSS", "HMAC-RIPEMD-160", 16, 0x00, 0x73,
- "SSL_DHE_DSS_WITH_AES_128_CBC_RMD", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_DSS_WITH_AES_256_CBC_RMD =
- new CipherSuite("AES", "DHE", "DSS", "HMAC-RIPEMD-160", 32, 0x00, 0x74,
- "SSL_DHE_DSS_WITH_AES_256_CBC_RMD", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_RSA_WITH_CAST_128_CBC_SHA =
- new CipherSuite("CAST5", "DHE", "RSA", "HMAC-SHA", 16, 0x00, 0x75,
- "SSL_DHE_RSA_WITH_CAST_128_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_RSA_WITH_CAST_128_CBC_RMD =
- new CipherSuite("CAST5", "DHE", "RSA", "HMAC-RIPEMD-160", 16, 0x00, 0x76,
- "SSL_DHE_RSA_WITH_CAST_128_CBC_RMD", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_RSA_WITH_3DES_EDE_CBC_RMD =
- new CipherSuite("TripleDES", "DHE", "RSA", "HMAC-RIPEMD-160", 24, 0x00, 0x77,
- "SSL_DHE_RSA_WITH_3DES_EDE_CBC_RMD", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_RSA_WITH_AES_128_CBC_RMD =
- new CipherSuite("AES", "DHE", "RSA", "HMAC-RIPEMD-160", 16, 0x00, 0x78,
- "SSL_DHE_RSA_WITH_AES_128_CBC_RMD", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_DHE_RSA_WITH_AES_256_CBC_RMD =
- new CipherSuite("AES", "DHE", "RSA", "HMAC-RIPEMD-160", 32, 0x00, 0x79,
- "SSL_DHE_RSA_WITH_AES_256_CBC_RMD", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_RSA_WITH_CAST_128_CBC_SHA =
- new CipherSuite("CAST5", "RSA", "RSA", "HMAC-SHA", 16, 0x00, 0x7A,
- "SSL_RSA_WITH_CAST_128_CBC_SHA", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_RSA_WITH_CAST_128_CBC_RMD =
- new CipherSuite("CAST5", "RSA", "RSA", "HMAC-RIPEMD-160", 16, 0x00, 0x7B,
- "SSL_RSA_WITH_CAST_128_CBC_RMD", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_RSA_WITH_3DES_EDE_CBC_RMD =
- new CipherSuite("TripleDES", "RSA", "RSA", "HMAC-RIPEMD-160", 24, 0x00, 0x7C,
- "SSL_RSA_WITH_3DES_EDE_CBC_RMD", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_RSA_WITH_AES_128_CBC_RMD =
- new CipherSuite("AES", "RSA", "RSA", "HMAC-RIPEMD-160", 16, 0x00, 0x7D,
- "SSL_RSA_WITH_AES_128_CBC_RMD", ProtocolVersion.SSL_3);
- static final CipherSuite SSL_RSA_WITH_AES_256_CBC_RMD =
- new CipherSuite("AES", "RSA", "RSA", "HMAC-RIPEMD-160", 32, 0x00, 0x7E,
- "SSL_RSA_WITH_AES_256_CBC_RMD", ProtocolVersion.SSL_3);
-
- static final CipherSuite TLS_NULL_WITH_NULL_NULL =
- new CipherSuite("null", "null", "null", "null", 0, 0x00, 0x00,
- "TLS_NULL_WITH_NULL_NULL", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_RSA_WITH_NULL_MD5 =
- new CipherSuite("null", "RSA", "RSA", "HMAC-MD5", 0, 0x00, 0x01,
- "TLS_RSA_WITH_NULL_MD5", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_RSA_WITH_NULL_SHA =
- new CipherSuite("null", "RSA", "RSA", "HMAC-SHA", 0, 0x00, 0x02,
- "TLS_RSA_WITH_NULL_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_RSA_EXPORT_WITH_RC4_40_MD5 =
- new CipherSuite("RC4", "RSA", "RSA", "HMAC-MD5", 5, 0x00, 0x03,
- "TLS_RSA_EXPORT_WITH_RC4_40_MD5", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_RSA_WITH_RC4_128_MD5 =
- new CipherSuite("RC4", "RSA", "RSA", "HMAC-MD5", 16, 0x00, 0x04,
- "TLS_RSA_WITH_RC4_128_MD5", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_RSA_WITH_RC4_128_SHA =
- new CipherSuite("RC4", "RSA", "RSA", "HMAC-SHA", 16, 0x00, 0x05,
- "TLS_RSA_WITH_RC4_128_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_RSA_EXPORT_WITH_DES40_CBC_SHA =
- new CipherSuite("DES", "RSA", "RSA", "HMAC-SHA", 5, 0x00, 0x08,
- "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_RSA_WITH_DES_CBC_SHA =
- new CipherSuite("DES", "RSA", "RSA", "HMAC-SHA", 8, 0x00, 0x09,
- "TLS_RSA_WITH_DES_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA =
- new CipherSuite("TripleDES", "RSA", "RSA", "HMAC-SHA", 24, 0x00, 0x0A,
- "TLS_RSA_WITH_3DES_EDE_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA =
- new CipherSuite("DES", "DH", "DSS", "HMAC-SHA", 5, 0x00, 0x0B,
- "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DH_DSS_WITH_DES_CBC_SHA =
- new CipherSuite("DES", "DH", "DSS", "HMAC-SHA", 8, 0x00, 0x0C,
- "TLS_DH_DSS_WITH_DES_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA =
- new CipherSuite("TripleDES", "DH", "DSS", "HMAC-SHA", 24, 0x00, 0x0D,
- "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA =
- new CipherSuite("DES", "DH", "RSA", "HMAC-SHA", 5, 0x00, 0x0E,
- "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DH_RSA_WITH_DES_CBC_SHA =
- new CipherSuite("DES", "DH", "RSA", "HMAC-SHA", 8, 0x00, 0x0F,
- "TLS_DH_RSA_WITH_DES_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA =
- new CipherSuite("TripleDES", "DH", "RSA", "HMAC-SHA", 24, 0x00, 0x10,
- "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA =
- new CipherSuite("DES", "DHE", "DSS", "HMAC-SHA", 5, 0x00, 0x11,
- "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_DSS_WITH_DES_CBC_SHA =
- new CipherSuite("DES", "DHE", "DSS", "HMAC-SHA", 8, 0x00, 0x12,
- "TLS_DHE_DSS_WITH_DES_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA =
- new CipherSuite("TripleDES", "DHE", "DSS", "HMAC-SHA", 24, 0x00, 0x13,
- "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA =
- new CipherSuite("DES", "DHE", "RSA", "HMAC-SHA", 5, 0x00, 0x14,
- "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_RSA_WITH_DES_CBC_SHA =
- new CipherSuite("DES", "DHE", "RSA", "HMAC-SHA", 8, 0x00, 0x15,
- "TLS_DHE_RSA_WITH_DES_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA =
- new CipherSuite("TripleDES", "DHE", "RSA", "HMAC-SHA", 24, 0x00, 0x16,
- "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA", ProtocolVersion.TLS_1);
-
- // AES CipherSuites.
- static final CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA =
- new CipherSuite("AES", "RSA", "RSA", "HMAC-SHA", 16, 0x00, 0x2F,
- "TLS_RSA_WITH_AES_128_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DH_DSS_WITH_AES_128_CBC_SHA =
- new CipherSuite("AES", "DH", "DSS", "HMAC-SHA", 16, 0x00, 0x30,
- "TLS_DH_DSS_WITH_AES_128_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DH_RSA_WITH_AES_128_CBC_SHA =
- new CipherSuite("AES", "DH", "RSA", "HMAC-SHA", 16, 0x00, 0x31,
- "TLS_DH_RSA_WITH_AES_128_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA =
- new CipherSuite("AES", "DHE", "DSS", "HMAC-SHA", 16, 0x00, 0x32,
- "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_SHA =
- new CipherSuite("AES", "DHE", "RSA", "HMAC-SHA", 16, 0x00, 0x33,
- "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_RSA_WITH_AES_256_CBC_SHA =
- new CipherSuite("AES", "RSA", "RSA", "HMAC-SHA", 32, 0x00, 0x35,
- "TLS_RSA_WITH_AES_256_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DH_DSS_WITH_AES_256_CBC_SHA =
- new CipherSuite("AES", "DH", "DSS", "HMAC-SHA", 32, 0x00, 0x36,
- "TLS_DH_DSS_WITH_AES_256_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DH_RSA_WITH_AES_256_CBC_SHA =
- new CipherSuite("AES", "DH", "RSA", "HMAC-SHA", 32, 0x00, 0x37,
- "TLS_DH_RSA_WITH_AES_256_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA =
- new CipherSuite("AES", "DHE", "DSS", "HMAC-SHA", 32, 0x00, 0x38,
- "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_SHA =
- new CipherSuite("AES", "DHE", "RSA", "HMAC-SHA", 32, 0x00, 0x39,
- "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", ProtocolVersion.TLS_1);
+ public static final CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 16, 0x00, 0x2F,
+ "TLS_RSA_WITH_AES_128_CBC_SHA");
+ public static final CipherSuite TLS_DH_DSS_WITH_AES_128_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.DH_DSS,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 16, 0x00, 0x30,
+ "TLS_DH_DSS_WITH_AES_128_CBC_SHA");
+ public static final CipherSuite TLS_DH_RSA_WITH_AES_128_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.DH_RSA,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 16, 0x00, 0x31,
+ "TLS_DH_RSA_WITH_AES_128_CBC_SHA");
+ public static final CipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.DHE_DSS, true,
+ SignatureAlgorithm.DSA,
+ MacAlgorithm.SHA, 16, 0x00, 0x32,
+ "TLS_DHE_DSS_WITH_AES_128_CBC_SHA");
+ public static final CipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.DHE_RSA, true,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 16, 0x00, 0x33,
+ "TLS_DHE_RSA_WITH_AES_128_CBC_SHA");
+ public static final CipherSuite TLS_RSA_WITH_AES_256_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 32, 0x00, 0x35,
+ "TLS_RSA_WITH_AES_256_CBC_SHA");
+ public static final CipherSuite TLS_DH_DSS_WITH_AES_256_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.DH_DSS,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 32, 0x00, 0x36,
+ "TLS_DH_DSS_WITH_AES_256_CBC_SHA");
+ public static final CipherSuite TLS_DH_RSA_WITH_AES_256_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.DH_RSA,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 32, 0x00, 0x37,
+ "TLS_DH_RSA_WITH_AES_256_CBC_SHA");
+ public static final CipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.DHE_DSS, true,
+ SignatureAlgorithm.DSA,
+ MacAlgorithm.SHA, 32, 0x00, 0x38,
+ "TLS_DHE_DSS_WITH_AES_256_CBC_SHA");
+ public static final CipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.DHE_RSA, true,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 32, 0x00, 0x39,
+ "TLS_DHE_RSA_WITH_AES_256_CBC_SHA");
// Secure remote password (SRP) ciphersuites
- static final CipherSuite TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA =
- new CipherSuite("TripleDES", "SRP", "anon", "HMAC-SHA", 24, 0x00, 0x50,
- "TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA =
- new CipherSuite("TripleDES", "SRP", "RSA", "HMAC-SHA", 24, 0x00, 0x51,
- "TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA =
- new CipherSuite("TripleDES", "SRP", "DSS", "HMAC-SHA", 24, 0x00, 0x52,
- "TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_SRP_SHA_WITH_AES_128_CBC_SHA =
- new CipherSuite("AES", "SRP", "anon", "HMAC-SHA", 16, 0x00, 0x53,
- "TLS_SRP_SHA_WITH_AES_128_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA =
- new CipherSuite("AES", "SRP", "RSA", "HMAC-SHA", 16, 0x00, 0x54,
- "TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA =
- new CipherSuite("AES", "SRP", "DSS", "HMAC-SHA", 16, 0x00, 0x55,
- "TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_SRP_SHA_WITH_AES_256_CBC_SHA =
- new CipherSuite("AES", "SRP", "anon", "HMAC-SHA", 32, 0x00, 0x56,
- "TLS_SRP_SHA_WITH_AES_256_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA =
- new CipherSuite("AES", "SRP", "RSA", "HMAC-SHA", 32, 0x00, 0x57,
- "TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA =
- new CipherSuite("AES", "SRP", "DSS", "HMAC-SHA", 32, 0x00, 0x58,
- "TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA", ProtocolVersion.TLS_1);
+ // Actual ID values are TBD, so these are omitted until they are specified.
+ /*public static final CipherSuite TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DESede,
+ KeyExchangeAlgorithm.SRP,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 24, 0x00, 0x50,
+ "TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA");
+ public static final CipherSuite TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DESede,
+ KeyExchangeAlgorithm.SRP,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 24, 0x00, 0x51,
+ "TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA");
+ public static final CipherSuite TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.DESede,
+ KeyExchangeAlgorithm.SRP,
+ SignatureAlgorithm.DSA,
+ MacAlgorithm.SHA, 24, 0x00, 0x52,
+ "TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA");
+ public static final CipherSuite TLS_SRP_SHA_WITH_AES_128_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.SRP,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 16, 0x00, 0x53,
+ "TLS_SRP_SHA_WITH_AES_128_CBC_SHA");
+ public static final CipherSuite TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.SRP,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 16, 0x00, 0x54,
+ "TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA");
+ public static final CipherSuite TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.SRP,
+ SignatureAlgorithm.DSA,
+ MacAlgorithm.SHA, 16, 0x00, 0x55,
+ "TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA");
+ public static final CipherSuite TLS_SRP_SHA_WITH_AES_256_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.SRP,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 32, 0x00, 0x56,
+ "TLS_SRP_SHA_WITH_AES_256_CBC_SHA");
+ public static final CipherSuite TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.SRP,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 32, 0x00, 0x57,
+ "TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA");
+ public static final CipherSuite TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.SRP,
+ SignatureAlgorithm.DSA,
+ MacAlgorithm.SHA, 32, 0x00, 0x58,
+ "TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA");*/
+
+ // Pre-shared key suites.
+ public static final CipherSuite TLS_PSK_WITH_RC4_128_SHA =
+ new CipherSuite(CipherAlgorithm.RC4,
+ KeyExchangeAlgorithm.PSK,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 16, 0x00, 0x8A,
+ "TLS_PSK_WITH_RC4_128_SHA");
+ public static final CipherSuite TLS_PSK_WITH_3DES_EDE_CBC_SHA =
+ new CipherSuite(CipherAlgorithm.DESede,
+ KeyExchangeAlgorithm.PSK,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 24, 0x00, 0x8B,
+ "TLS_PSK_WITH_3DES_EDE_CBC_SHA");
+ public static final CipherSuite TLS_PSK_WITH_AES_128_CBC_SHA =
+ new CipherSuite(CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.PSK,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 16, 0x00, 0x8C,
+ "TLS_PSK_WITH_AES_128_CBC_SHA");
+ public static final CipherSuite TLS_PSK_WITH_AES_256_CBC_SHA =
+ new CipherSuite(CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.PSK,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 32, 0x00, 0x8D,
+ "TLS_PSK_WITH_AES_256_CBC_SHA");
+
+ public static final CipherSuite TLS_DHE_PSK_WITH_RC4_128_SHA =
+ new CipherSuite(CipherAlgorithm.RC4,
+ KeyExchangeAlgorithm.DHE_PSK, true,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 16, 0x00, 0x8E,
+ "TLS_DHE_PSK_WITH_RC4_128_SHA");
+ public static final CipherSuite TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA =
+ new CipherSuite(CipherAlgorithm.DESede,
+ KeyExchangeAlgorithm.DHE_PSK, true,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 24, 0x00, 0x8F,
+ "TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA");
+ public static final CipherSuite TLS_DHE_PSK_WITH_AES_128_CBC_SHA =
+ new CipherSuite(CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.DHE_PSK, true,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 16, 0x00, 0x90,
+ "TLS_DHE_PSK_WITH_AES_128_CBC_SHA");
+ public static final CipherSuite TLS_DHE_PSK_WITH_AES_256_CBC_SHA =
+ new CipherSuite(CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.DHE_PSK, true,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 32, 0x00, 0x91,
+ "TLS_DHE_PSK_WITH_AES_256_CBC_SHA");
+
+ public static final CipherSuite TLS_RSA_PSK_WITH_RC4_128_SHA =
+ new CipherSuite(CipherAlgorithm.RC4,
+ KeyExchangeAlgorithm.RSA_PSK,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 16, 0x00, 0x92,
+ "TLS_RSA_PSK_WITH_RC4_128_SHA");
+ public static final CipherSuite TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA =
+ new CipherSuite(CipherAlgorithm.DESede,
+ KeyExchangeAlgorithm.RSA_PSK,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 24, 0x00, 0x93,
+ "TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA");
+ public static final CipherSuite TLS_RSA_PSK_WITH_AES_128_CBC_SHA =
+ new CipherSuite(CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.RSA_PSK,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 16, 0x00, 0x94,
+ "TLS_RSA_PSK_WITH_AES_128_CBC_SHA");
+ public static final CipherSuite TLS_RSA_PSK_WITH_AES_256_CBC_SHA =
+ new CipherSuite(CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.RSA_PSK,
+ SignatureAlgorithm.ANONYMOUS,
+ MacAlgorithm.SHA, 32, 0x00, 0x95,
+ "TLS_RSA_PSK_WITH_AES_256_CBC_SHA");
// Ciphersuites from the OpenPGP extension draft.
- static final CipherSuite TLS_DHE_DSS_WITH_CAST_128_CBC_SHA =
- new CipherSuite("CAST5", "DHE", "DSS", "HMAC-SHA", 16, 0x00, 0x70,
- "TLS_DHE_DSS_WITH_CAST_128_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_DSS_WITH_CAST_128_CBC_RMD =
- new CipherSuite("CAST5", "DHE", "DSS", "HMAC-RIPEMD-160", 16, 0x00, 0x71,
- "TLS_DHE_DSS_WITH_CAST_128_CBC_RMD", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_RMD =
- new CipherSuite("TripleDES", "DHE", "DSS", "HMAC-RIPEMD-160", 24, 0x00, 0x72,
- "TLS_DHE_DSS_WITH_3DES_EDE_CBC_RMD", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_RMD =
- new CipherSuite("AES", "DHE", "DSS", "HMAC-RIPEMD-160", 16, 0x00, 0x73,
- "TLS_DHE_DSS_WITH_AES_128_CBC_RMD", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_RMD =
- new CipherSuite("AES", "DHE", "DSS", "HMAC-RIPEMD-160", 32, 0x00, 0x74,
- "TLS_DHE_DSS_WITH_AES_256_CBC_RMD", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_RSA_WITH_CAST_128_CBC_SHA =
- new CipherSuite("CAST5", "DHE", "RSA", "HMAC-SHA", 16, 0x00, 0x75,
- "TLS_DHE_RSA_WITH_CAST_128_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_RSA_WITH_CAST_128_CBC_RMD =
- new CipherSuite("CAST5", "DHE", "RSA", "HMAC-RIPEMD-160", 16, 0x00, 0x76,
- "TLS_DHE_RSA_WITH_CAST_128_CBC_RMD", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_RSA_WITH_3DES_EDE_CBC_RMD =
- new CipherSuite("TripleDES", "DHE", "RSA", "HMAC-RIPEMD-160", 24, 0x00, 0x77,
- "TLS_DHE_RSA_WITH_3DES_EDE_CBC_RMD", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_RMD =
- new CipherSuite("AES", "DHE", "RSA", "HMAC-RIPEMD-160", 16, 0x00, 0x78,
- "TLS_DHE_RSA_WITH_AES_128_CBC_RMD", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_RMD =
- new CipherSuite("AES", "DHE", "RSA", "HMAC-RIPEMD-160", 32, 0x00, 0x79,
- "TLS_DHE_RSA_WITH_AES_256_CBC_RMD", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_RSA_WITH_CAST_128_CBC_SHA =
- new CipherSuite("CAST5", "RSA", "RSA", "HMAC-SHA", 16, 0x00, 0x7A,
- "TLS_RSA_WITH_CAST_128_CBC_SHA", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_RSA_WITH_CAST_128_CBC_RMD =
- new CipherSuite("CAST5", "RSA", "RSA", "HMAC-RIPEMD-160", 16, 0x00, 0x7B,
- "TLS_RSA_WITH_CAST_128_CBC_RMD", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_RSA_WITH_3DES_EDE_CBC_RMD =
- new CipherSuite("TripleDES", "RSA", "RSA", "HMAC-RIPEMD-160", 24, 0x00, 0x7C,
- "TLS_RSA_WITH_3DES_EDE_CBC_RMD", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_RSA_WITH_AES_128_CBC_RMD =
- new CipherSuite("AES", "RSA", "RSA", "HMAC-RIPEMD-160", 16, 0x00, 0x7D,
- "TLS_RSA_WITH_AES_128_CBC_RMD", ProtocolVersion.TLS_1);
- static final CipherSuite TLS_RSA_WITH_AES_256_CBC_RMD =
- new CipherSuite("AES", "RSA", "RSA", "HMAC-RIPEMD-160", 32, 0x00, 0x7E,
- "TLS_RSA_WITH_AES_256_CBC_RMD", ProtocolVersion.TLS_1);
-
- private final String cipherName;
- private final String kexName;
- private final String sigName;
- private final String macName;
+ // These disappeared from a more recent draft.
+/* public static final CipherSuite TLS_DHE_DSS_WITH_CAST_128_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.CAST5,
+ KeyExchangeAlgorithm.DIFFIE_HELLMAN, true,
+ SignatureAlgorithm.DSA,
+ MacAlgorithm.SHA, 16, 0x00, 0x70,
+ "TLS_DHE_DSS_WITH_CAST_128_CBC_SHA");
+ public static final CipherSuite TLS_DHE_DSS_WITH_CAST_128_CBC_RMD =
+ new CipherSuite (CipherAlgorithm.CAST5,
+ KeyExchangeAlgorithm.DIFFIE_HELLMAN, true,
+ SignatureAlgorithm.DSA,
+ MacAlgorithm.HMAC_RMD, 16, 0x00, 0x71,
+ "TLS_DHE_DSS_WITH_CAST_128_CBC_RMD");
+ public static final CipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_RMD =
+ new CipherSuite (CipherAlgorithm.DESede,
+ KeyExchangeAlgorithm.DIFFIE_HELLMAN, true,
+ SignatureAlgorithm.DSA,
+ MacAlgorithm.HMAC_RMD, 24, 0x00, 0x72,
+ "TLS_DHE_DSS_WITH_3DES_EDE_CBC_RMD");
+ public static final CipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_RMD =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.DIFFIE_HELLMAN, true,
+ SignatureAlgorithm.DSA,
+ MacAlgorithm.HMAC_RMD, 16, 0x00, 0x73,
+ "TLS_DHE_DSS_WITH_AES_128_CBC_RMD");
+ public static final CipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_RMD =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.DIFFIE_HELLMAN, true,
+ SignatureAlgorithm.DSA,
+ MacAlgorithm.HMAC_RMD, 32, 0x00, 0x74,
+ "TLS_DHE_DSS_WITH_AES_256_CBC_RMD");
+ public static final CipherSuite TLS_DHE_RSA_WITH_CAST_128_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.CAST5,
+ KeyExchangeAlgorithm.DIFFIE_HELLMAN, true,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 16, 0x00, 0x75,
+ "TLS_DHE_RSA_WITH_CAST_128_CBC_SHA");
+ public static final CipherSuite TLS_DHE_RSA_WITH_CAST_128_CBC_RMD =
+ new CipherSuite (CipherAlgorithm.CAST5,
+ KeyExchangeAlgorithm.DIFFIE_HELLMAN, true,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.HMAC_RMD, 16, 0x00, 0x76,
+ "TLS_DHE_RSA_WITH_CAST_128_CBC_RMD");
+ public static final CipherSuite TLS_DHE_RSA_WITH_3DES_EDE_CBC_RMD =
+ new CipherSuite (CipherAlgorithm.DESede,
+ KeyExchangeAlgorithm.DIFFIE_HELLMAN, true,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.HMAC_RMD, 24, 0x00, 0x77,
+ "TLS_DHE_RSA_WITH_3DES_EDE_CBC_RMD");
+ public static final CipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_RMD =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.DIFFIE_HELLMAN, true,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.HMAC_RMD, 16, 0x00, 0x78,
+ "TLS_DHE_RSA_WITH_AES_128_CBC_RMD");
+ public static final CipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_RMD =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.DIFFIE_HELLMAN, true,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.HMAC_RMD, 32, 0x00, 0x79,
+ "TLS_DHE_RSA_WITH_AES_256_CBC_RMD");
+ public static final CipherSuite TLS_RSA_WITH_CAST_128_CBC_SHA =
+ new CipherSuite (CipherAlgorithm.CAST5,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.SHA, 16, 0x00, 0x7A,
+ "TLS_RSA_WITH_CAST_128_CBC_SHA");
+ public static final CipherSuite TLS_RSA_WITH_CAST_128_CBC_RMD =
+ new CipherSuite (CipherAlgorithm.CAST5,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.HMAC_RMD, 16, 0x00, 0x7B,
+ "TLS_RSA_WITH_CAST_128_CBC_RMD");
+ public static final CipherSuite TLS_RSA_WITH_3DES_EDE_CBC_RMD =
+ new CipherSuite (CipherAlgorithm.DESede,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.HMAC_RMD, 24, 0x00, 0x7C,
+ "TLS_RSA_WITH_3DES_EDE_CBC_RMD");
+ public static final CipherSuite TLS_RSA_WITH_AES_128_CBC_RMD =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.HMAC_RMD, 16, 0x00, 0x7D,
+ "TLS_RSA_WITH_AES_128_CBC_RMD");
+ public static final CipherSuite TLS_RSA_WITH_AES_256_CBC_RMD =
+ new CipherSuite (CipherAlgorithm.AES,
+ KeyExchangeAlgorithm.RSA,
+ SignatureAlgorithm.RSA,
+ MacAlgorithm.HMAC_RMD, 32, 0x00, 0x7E,
+ "TLS_RSA_WITH_AES_256_CBC_RMD"); */
+
+ private final CipherAlgorithm cipherAlgorithm;
+ private final KeyExchangeAlgorithm keyExchangeAlgorithm;
+ private final SignatureAlgorithm signatureAlgorithm;
+ private final MacAlgorithm macAlgorithm;
+ private final boolean ephemeralDH;
private final boolean exportable;
private final boolean isStream;
private final int keyLength;
private final byte[] id;
private final String name;
- private final ProtocolVersion version;
+ private final boolean isResolved;
// Constructors.
// -------------------------------------------------------------------------
- private CipherSuite(String cipherName, String kexName, String sigName,
- String macName, int keyLength, int id1, int id2,
- String name, ProtocolVersion version)
+ private CipherSuite (final CipherAlgorithm cipherAlgorithm,
+ final KeyExchangeAlgorithm keyExchangeAlgorithm,
+ final SignatureAlgorithm signatureAlgorithm,
+ final MacAlgorithm macAlgorithm,
+ final int keyLength,
+ final int id1,
+ final int id2,
+ final String name)
+ {
+ this (cipherAlgorithm, keyExchangeAlgorithm, false, signatureAlgorithm,
+ macAlgorithm, keyLength, id1, id2, name);
+ }
+
+ private CipherSuite (final CipherAlgorithm cipherAlgorithm,
+ final KeyExchangeAlgorithm keyExchangeAlgorithm,
+ final boolean ephemeralDH,
+ final SignatureAlgorithm signatureAlgorithm,
+ final MacAlgorithm macAlgorithm,
+ final int keyLength,
+ final int id1,
+ final int id2,
+ final String name)
{
- this.cipherName = cipherName.intern();
- this.kexName = kexName.intern();
- this.sigName = sigName.intern();
- this.macName = macName.intern();
+ this.cipherAlgorithm = cipherAlgorithm;
+ this.keyExchangeAlgorithm = keyExchangeAlgorithm;
+ this.ephemeralDH = ephemeralDH;
+ this.signatureAlgorithm = signatureAlgorithm;
+ this.macAlgorithm = macAlgorithm;
this.exportable = keyLength <= 5;
- this.isStream = cipherName.equals("null") || cipherName.equals("RC4");
+ this.isStream = (cipherAlgorithm == CipherAlgorithm.NULL
+ || cipherAlgorithm == CipherAlgorithm.RC4);
this.keyLength = keyLength;
this.id = new byte[] { (byte) id1, (byte) id2 };
this.name = name.intern();
- this.version = version;
namesToSuites.put(name, this);
if (name.startsWith("TLS"))
{
tlsSuiteNames.add(name);
}
+ isResolved = true;
}
private CipherSuite(byte[] id)
{
- cipherName = null;
- kexName = null;
- sigName = null;
- macName = null;
+ cipherAlgorithm = null;
+ keyExchangeAlgorithm = null;
+ signatureAlgorithm = null;
+ macAlgorithm = null;
+ ephemeralDH = false;
exportable = false;
isStream = false;
keyLength = 0;
this.id = id;
name = null;
- version = null;
+ isResolved = false;
}
// Class methods.
@@ -450,274 +564,243 @@ final class CipherSuite implements Constructed
*
* @return The named cipher suite.
*/
- static CipherSuite forName(String name)
+ public static CipherSuite forName(String name)
{
- return (CipherSuite) namesToSuites.get(name);
+ if (name.startsWith("SSL_"))
+ name = "TLS_" + name.substring(4);
+ return namesToSuites.get(name);
}
- static List availableSuiteNames()
+ public static CipherSuite forValue(final short raw_value)
{
- return tlsSuiteNames;
+ byte[] b = new byte[] { (byte) (raw_value >>> 8), (byte) raw_value };
+ return new CipherSuite(b).resolve();
}
- static CipherSuite read(InputStream in) throws IOException
+ public static List<String> availableSuiteNames()
{
- DataInputStream din = new DataInputStream(in);
- byte[] id = new byte[2];
- din.readFully(id);
- return new CipherSuite(id);
+ return tlsSuiteNames;
}
- static IMode getCipher(String cbcCipherName)
+ // Intance methods.
+ // -------------------------------------------------------------------------
+
+ public CipherAlgorithm cipherAlgorithm ()
{
- IBlockCipher cipher = CipherFactory.getInstance(cbcCipherName);
- if (cipher == null)
- {
- return null;
- }
- return ModeFactory.getInstance("CBC", cipher, cipher.defaultBlockSize());
+ return cipherAlgorithm;
}
- static Cipher getJCECipher (final String name)
- throws NoSuchAlgorithmException, NoSuchPaddingException
+ public Cipher cipher () throws NoSuchAlgorithmException, NoSuchPaddingException
{
- final String provider = Util.getSecurityProperty ("jessie.with.jce.provider");
- if (name.equals ("RC4"))
+ if (cipherAlgorithm == null)
+ throw new NoSuchAlgorithmException (toString () + ": unresolved cipher suite");
+ if (cipherAlgorithm == CipherAlgorithm.NULL)
+ return new NullCipher ();
+
+ String alg = null;
+ if (cipherAlgorithm == CipherAlgorithm.RC4)
+ alg = "RC4";
+ else
+ alg = cipherAlgorithm + "/CBC/NoPadding";
+ GetSecurityPropertyAction gspa =
+ new GetSecurityPropertyAction ("jessie.jce.provider");
+ final String provider = (String) AccessController.doPrivileged (gspa);
+ if (provider != null)
{
- if (provider != null)
+ try
{
- try
- {
- return Cipher.getInstance (name, provider);
- }
- catch (NoSuchProviderException nsae)
- {
- // Fall through. Try any available provider.
- }
+ return Cipher.getInstance (alg, provider);
}
-
- return Cipher.getInstance (name);
- }
- else
- {
- // Oh, hey! Look! Something else Sun doesn't understand: SSLv3 padding
- // is different than TLSv1 in subtle, but important, ways. But they
- // sorta look the same, so why not make them equivalent?
- //
- // There should be a seperate padding "TLS1Padding".
- if (provider != null)
+ catch (NoSuchProviderException nspe)
{
- try
- {
- return Cipher.getInstance (name + "/CBC/SSL3Padding", provider);
- }
- catch (NoSuchProviderException nspe)
- {
- // Fall through. Try any available provider.
- }
}
- return Cipher.getInstance (name + "/CBC/SSL3Padding");
}
+ return Cipher.getInstance (alg);
+ }
+
+ public MacAlgorithm macAlgorithm ()
+ {
+ return macAlgorithm;
}
- static IMac getMac(String macName)
+ public Mac mac(ProtocolVersion version) throws NoSuchAlgorithmException
{
- if (macName.startsWith("SSLMAC-"))
+ if (macAlgorithm == null)
+ throw new NoSuchAlgorithmException(toString() + ": unresolved cipher suite");
+ if (macAlgorithm == MacAlgorithm.NULL)
+ return null;
+
+ String macAlg = null;
+ if (version == ProtocolVersion.SSL_3)
{
- return new SSLHMac(macName.substring(7));
+ macAlg = "SSLv3HMac-" + macAlgorithm;
}
else
{
- return MacFactory.getInstance(macName);
+ if (macAlgorithm == MacAlgorithm.MD5)
+ macAlg = "HMac-MD5";
+ if (macAlgorithm == MacAlgorithm.SHA)
+ macAlg = "HMac-SHA1";
}
- }
-
- static Mac getJCEMac (final String name)
- throws NoSuchAlgorithmException
- {
- final String provider = Util.getSecurityProperty ("jessie.with.jce.provider");
+
+ GetSecurityPropertyAction gspa =
+ new GetSecurityPropertyAction ("jessie.jce.provider");
+ final String provider = AccessController.doPrivileged (gspa);
if (provider != null)
{
try
{
- return Mac.getInstance (name, provider);
+ return Mac.getInstance(macAlg, provider);
}
catch (NoSuchProviderException nspe)
{
- // Fall through. Try any available provider.
+ // Ignore; try any installed provider.
}
}
- return Mac.getInstance (name);
+ return Mac.getInstance(macAlg);
}
- // Intance methods.
- // -------------------------------------------------------------------------
-
- public void write(OutputStream out) throws IOException
+ public SignatureAlgorithm signatureAlgorithm ()
{
- out.write(id);
+ return signatureAlgorithm;
}
- CipherSuite resolve(ProtocolVersion version)
+ public KeyExchangeAlgorithm keyExchangeAlgorithm ()
{
- if (version == ProtocolVersion.SSL_3)
- {
- if (id[0] == 0x00) switch (id[1])
- {
- case 0x00: return SSL_NULL_WITH_NULL_NULL;
- case 0x01: return SSL_RSA_WITH_NULL_MD5;
- case 0x02: return SSL_RSA_WITH_NULL_SHA;
- case 0x03: return SSL_RSA_EXPORT_WITH_RC4_40_MD5;
- case 0x04: return SSL_RSA_WITH_RC4_128_MD5;
- case 0x05: return SSL_RSA_WITH_RC4_128_SHA;
- case 0x08: return SSL_RSA_EXPORT_WITH_DES40_CBC_SHA;
- case 0x09: return SSL_RSA_WITH_DES_CBC_SHA;
- case 0x0A: return SSL_RSA_WITH_3DES_EDE_CBC_SHA;
- case 0x0B: return SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA;
- case 0x0C: return SSL_DH_DSS_WITH_DES_CBC_SHA;
- case 0x0D: return SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA;
- case 0x0E: return SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA;
- case 0x0F: return SSL_DH_RSA_WITH_DES_CBC_SHA;
- case 0x10: return SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA;
- case 0x11: return SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA;
- case 0x12: return SSL_DHE_DSS_WITH_DES_CBC_SHA;
- case 0x13: return SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA;
- case 0x14: return SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA;
- case 0x15: return SSL_DHE_RSA_WITH_DES_CBC_SHA;
- case 0x16: return SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA;
- case 0x2F: return SSL_RSA_WITH_AES_128_CBC_SHA;
- case 0x30: return SSL_DH_DSS_WITH_AES_128_CBC_SHA;
- case 0x31: return SSL_DH_RSA_WITH_AES_128_CBC_SHA;
- case 0x32: return SSL_DHE_DSS_WITH_AES_128_CBC_SHA;
- case 0x33: return SSL_DHE_RSA_WITH_AES_128_CBC_SHA;
- case 0x35: return SSL_RSA_WITH_AES_256_CBC_SHA;
- case 0x36: return SSL_DH_DSS_WITH_AES_256_CBC_SHA;
- case 0x37: return SSL_DH_RSA_WITH_AES_256_CBC_SHA;
- case 0x38: return SSL_DHE_DSS_WITH_AES_256_CBC_SHA;
- case 0x39: return SSL_DHE_RSA_WITH_AES_256_CBC_SHA;
- }
- }
- else if (version == ProtocolVersion.TLS_1 ||
- version == ProtocolVersion.TLS_1_1)
- {
- if (id[0] == 0x00) switch (id[1])
- {
- case 0x00: return TLS_NULL_WITH_NULL_NULL;
- case 0x01: return TLS_RSA_WITH_NULL_MD5;
- case 0x02: return TLS_RSA_WITH_NULL_SHA;
- case 0x03: return TLS_RSA_EXPORT_WITH_RC4_40_MD5;
- case 0x04: return TLS_RSA_WITH_RC4_128_MD5;
- case 0x05: return TLS_RSA_WITH_RC4_128_SHA;
- case 0x08: return TLS_RSA_EXPORT_WITH_DES40_CBC_SHA;
- case 0x09: return TLS_RSA_WITH_DES_CBC_SHA;
- case 0x0A: return TLS_RSA_WITH_3DES_EDE_CBC_SHA;
- case 0x0B: return TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA;
- case 0x0C: return TLS_DH_DSS_WITH_DES_CBC_SHA;
- case 0x0D: return TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA;
- case 0x0E: return TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA;
- case 0x0F: return TLS_DH_RSA_WITH_DES_CBC_SHA;
- case 0x10: return TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA;
- case 0x11: return TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA;
- case 0x12: return TLS_DHE_DSS_WITH_DES_CBC_SHA;
- case 0x13: return TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA;
- case 0x14: return TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA;
- case 0x15: return TLS_DHE_RSA_WITH_DES_CBC_SHA;
- case 0x16: return TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA;
- case 0x2F: return TLS_RSA_WITH_AES_128_CBC_SHA;
- case 0x30: return TLS_DH_DSS_WITH_AES_128_CBC_SHA;
- case 0x31: return TLS_DH_RSA_WITH_AES_128_CBC_SHA;
- case 0x32: return TLS_DHE_DSS_WITH_AES_128_CBC_SHA;
- case 0x33: return TLS_DHE_RSA_WITH_AES_128_CBC_SHA;
- case 0x35: return TLS_RSA_WITH_AES_256_CBC_SHA;
- case 0x36: return TLS_DH_DSS_WITH_AES_256_CBC_SHA;
- case 0x37: return TLS_DH_RSA_WITH_AES_256_CBC_SHA;
- case 0x38: return TLS_DHE_DSS_WITH_AES_256_CBC_SHA;
- case 0x39: return TLS_DHE_RSA_WITH_AES_256_CBC_SHA;
- case 0x50: return TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA;
- case 0x51: return TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA;
- case 0x52: return TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA;
- case 0x53: return TLS_SRP_SHA_WITH_AES_128_CBC_SHA;
- case 0x54: return TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA;
- case 0x55: return TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA;
- case 0x56: return TLS_SRP_SHA_WITH_AES_256_CBC_SHA;
- case 0x57: return TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA;
- case 0x58: return TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA;
- case 0x70: return TLS_DHE_DSS_WITH_CAST_128_CBC_SHA;
- case 0x71: return TLS_DHE_DSS_WITH_CAST_128_CBC_RMD;
- case 0x72: return TLS_DHE_DSS_WITH_3DES_EDE_CBC_RMD;
- case 0x73: return TLS_DHE_DSS_WITH_AES_128_CBC_RMD;
- case 0x74: return TLS_DHE_DSS_WITH_AES_256_CBC_RMD;
- case 0x75: return TLS_DHE_RSA_WITH_CAST_128_CBC_SHA;
- case 0x76: return TLS_DHE_RSA_WITH_CAST_128_CBC_RMD;
- case 0x77: return TLS_DHE_RSA_WITH_3DES_EDE_CBC_RMD;
- case 0x78: return TLS_DHE_RSA_WITH_AES_128_CBC_RMD;
- case 0x79: return TLS_DHE_RSA_WITH_AES_256_CBC_RMD;
- case 0x7A: return TLS_RSA_WITH_CAST_128_CBC_SHA;
- case 0x7B: return TLS_RSA_WITH_CAST_128_CBC_RMD;
- case 0x7C: return TLS_RSA_WITH_3DES_EDE_CBC_RMD;
- case 0x7D: return TLS_RSA_WITH_AES_128_CBC_RMD;
- case 0x7E: return TLS_RSA_WITH_AES_256_CBC_RMD;
- }
- }
- return this;
+ return keyExchangeAlgorithm;
}
- String getCipher()
+ public boolean isEphemeralDH ()
{
- return cipherName;
+ return ephemeralDH;
}
- int getKeyLength()
+ public int length ()
{
- return keyLength;
+ return 2;
}
- String getKeyExchange()
+ public void write(OutputStream out) throws IOException
{
- return kexName;
+ out.write(id);
}
- String getSignature()
+ public void put (final ByteBuffer buf)
{
- return sigName;
+ buf.put (id);
}
-
- String getMac()
+
+ public CipherSuite resolve()
{
- return macName;
+ if (id[0] == 0x00) switch (id[1] & 0xFF)
+ {
+ case 0x00: return TLS_NULL_WITH_NULL_NULL;
+ case 0x01: return TLS_RSA_WITH_NULL_MD5;
+ case 0x02: return TLS_RSA_WITH_NULL_SHA;
+ case 0x03: return TLS_RSA_EXPORT_WITH_RC4_40_MD5;
+ case 0x04: return TLS_RSA_WITH_RC4_128_MD5;
+ case 0x05: return TLS_RSA_WITH_RC4_128_SHA;
+ case 0x08: return TLS_RSA_EXPORT_WITH_DES40_CBC_SHA;
+ case 0x09: return TLS_RSA_WITH_DES_CBC_SHA;
+ case 0x0A: return TLS_RSA_WITH_3DES_EDE_CBC_SHA;
+ case 0x0B: return TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA;
+ case 0x0C: return TLS_DH_DSS_WITH_DES_CBC_SHA;
+ case 0x0D: return TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA;
+ case 0x0E: return TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA;
+ case 0x0F: return TLS_DH_RSA_WITH_DES_CBC_SHA;
+ case 0x10: return TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA;
+ case 0x11: return TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA;
+ case 0x12: return TLS_DHE_DSS_WITH_DES_CBC_SHA;
+ case 0x13: return TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA;
+ case 0x14: return TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA;
+ case 0x15: return TLS_DHE_RSA_WITH_DES_CBC_SHA;
+ case 0x16: return TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA;
+ case 0x2F: return TLS_RSA_WITH_AES_128_CBC_SHA;
+ case 0x30: return TLS_DH_DSS_WITH_AES_128_CBC_SHA;
+ case 0x31: return TLS_DH_RSA_WITH_AES_128_CBC_SHA;
+ case 0x32: return TLS_DHE_DSS_WITH_AES_128_CBC_SHA;
+ case 0x33: return TLS_DHE_RSA_WITH_AES_128_CBC_SHA;
+ case 0x35: return TLS_RSA_WITH_AES_256_CBC_SHA;
+ case 0x36: return TLS_DH_DSS_WITH_AES_256_CBC_SHA;
+ case 0x37: return TLS_DH_RSA_WITH_AES_256_CBC_SHA;
+ case 0x38: return TLS_DHE_DSS_WITH_AES_256_CBC_SHA;
+ case 0x39: return TLS_DHE_RSA_WITH_AES_256_CBC_SHA;
+ /*case 0x50: return TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA;
+ case 0x51: return TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA;
+ case 0x52: return TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA;
+ case 0x53: return TLS_SRP_SHA_WITH_AES_128_CBC_SHA;
+ case 0x54: return TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA;
+ case 0x55: return TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA;
+ case 0x56: return TLS_SRP_SHA_WITH_AES_256_CBC_SHA;
+ case 0x57: return TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA;
+ case 0x58: return TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA;
+ case 0x70: return TLS_DHE_DSS_WITH_CAST_128_CBC_SHA;
+ case 0x71: return TLS_DHE_DSS_WITH_CAST_128_CBC_RMD;
+ case 0x72: return TLS_DHE_DSS_WITH_3DES_EDE_CBC_RMD;
+ case 0x73: return TLS_DHE_DSS_WITH_AES_128_CBC_RMD;
+ case 0x74: return TLS_DHE_DSS_WITH_AES_256_CBC_RMD;
+ case 0x75: return TLS_DHE_RSA_WITH_CAST_128_CBC_SHA;
+ case 0x76: return TLS_DHE_RSA_WITH_CAST_128_CBC_RMD;
+ case 0x77: return TLS_DHE_RSA_WITH_3DES_EDE_CBC_RMD;
+ case 0x78: return TLS_DHE_RSA_WITH_AES_128_CBC_RMD;
+ case 0x79: return TLS_DHE_RSA_WITH_AES_256_CBC_RMD;
+ case 0x7A: return TLS_RSA_WITH_CAST_128_CBC_SHA;
+ case 0x7B: return TLS_RSA_WITH_CAST_128_CBC_RMD;
+ case 0x7C: return TLS_RSA_WITH_3DES_EDE_CBC_RMD;
+ case 0x7D: return TLS_RSA_WITH_AES_128_CBC_RMD;
+ case 0x7E: return TLS_RSA_WITH_AES_256_CBC_RMD;*/
+ case 0x8A: return TLS_PSK_WITH_RC4_128_SHA;
+ case 0x8B: return TLS_PSK_WITH_3DES_EDE_CBC_SHA;
+ case 0x8C: return TLS_PSK_WITH_AES_128_CBC_SHA;
+ case 0x8D: return TLS_PSK_WITH_AES_256_CBC_SHA;
+ case 0x8E: return TLS_DHE_PSK_WITH_RC4_128_SHA;
+ case 0x8F: return TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA;
+ case 0x90: return TLS_DHE_PSK_WITH_AES_128_CBC_SHA;
+ case 0x91: return TLS_DHE_PSK_WITH_AES_256_CBC_SHA;
+ case 0x92: return TLS_RSA_PSK_WITH_RC4_128_SHA;
+ case 0x93: return TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA;
+ case 0x94: return TLS_RSA_PSK_WITH_AES_128_CBC_SHA;
+ case 0x95: return TLS_RSA_PSK_WITH_AES_256_CBC_SHA;
+ }
+ return this;
}
-
- boolean isExportable()
+
+ public boolean isResolved()
{
- return exportable;
+ return isResolved;
}
- boolean isStreamCipher()
+ public int keyLength()
{
- return isStream;
+ return keyLength;
}
- String getAuthType()
+ public boolean isExportable()
{
- if (kexName.equals("RSA"))
- {
- if (isExportable())
- {
- return "RSA_EXPORT";
- }
- return "RSA";
- }
- return kexName + "_" + sigName;
+ return exportable;
}
- byte[] getId()
+ public boolean isStreamCipher()
{
- return id;
+ return isStream;
}
- ProtocolVersion getVersion()
+// String getAuthType()
+// {
+// if (keyExchangeAlgorithm == KeyExchangeAlgorithm.RSA)
+// {
+// if (isExportable())
+// {
+// return "RSA_EXPORT";
+// }
+// return "RSA";
+// }
+// return kexName + "_" + sigName;
+// }
+
+ public byte[] id()
{
- return version;
+ return id;
}
public boolean equals(Object o)
@@ -728,26 +811,26 @@ final class CipherSuite implements Constructed
}
if (o == this)
return true;
- byte[] id = ((CipherSuite) o).getId();
- return id[0] == this.id[0] &&
- id[1] == this.id[1];
+ byte[] id = ((CipherSuite) o).id();
+ return (id[0] == this.id[0] &&
+ id[1] == this.id[1]);
}
public int hashCode()
{
- if (version == null)
- {
- return 0xFFFF0000 | (id[0] & 0xFF) << 8 | (id[1] & 0xFF);
- }
- return version.getMajor() << 24 | version.getMinor() << 16
- | (id[0] & 0xFF) << 8 | (id[1] & 0xFF);
+ return 0xFFFF0000 | (id[0] & 0xFF) << 8 | (id[1] & 0xFF);
+ }
+
+ public String toString (String prefix)
+ {
+ return toString ();
}
public String toString()
{
if (name == null)
{
- return "UNKNOWN { " + (id[0] & 0xFF) + ", " + (id[1] & 0xFF) + " }";
+ return "{ " + (id[0] & 0xFF) + ", " + (id[1] & 0xFF) + " }";
}
return name;
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/CipherSuiteList.java b/libjava/classpath/gnu/javax/net/ssl/provider/CipherSuiteList.java
new file mode 100644
index 00000000000..0e96b31443a
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/CipherSuiteList.java
@@ -0,0 +1,283 @@
+/* CipherSuiteList.java -- A list of cipher suites.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import java.nio.ByteBuffer;
+import java.util.ConcurrentModificationException;
+import java.util.ListIterator;
+import java.util.NoSuchElementException;
+
+public final class CipherSuiteList implements Iterable<CipherSuite>
+{
+ private final ByteBuffer buffer;
+ private final ProtocolVersion version;
+ private int modCount;
+
+ public CipherSuiteList (final ByteBuffer buffer)
+ {
+ this (buffer, ProtocolVersion.SSL_3);
+ }
+
+ public CipherSuiteList (final ByteBuffer buffer, final ProtocolVersion version)
+ {
+ this.version = version;
+ this.buffer = buffer;
+ modCount = 0;
+ }
+
+ /**
+ * Return the number of elements in this list.
+ *
+ * @return The size of this list.
+ */
+ public int size ()
+ {
+ return (buffer.getShort (0) & 0xFFFF) >>> 1;
+ }
+
+ /**
+ * Get the cipher suite at the specified index.
+ *
+ * @param index The index of the suite to get.
+ * @return The cipher suite at that index.
+ * @throws IndexOutOfBoundsException If the index is negative or is
+ * not less than {@link size()}.
+ */
+ public CipherSuite get (final int index)
+ {
+ int size = size ();
+ if (index < 0 || index >= size)
+ throw new IndexOutOfBoundsException ("limit: " + size
+ + "; requested: " + index);
+ return CipherSuite.forValue(buffer.getShort(2 + (index << 1))).resolve();
+ }
+
+ /**
+ * Set the CipherSuite at the specified index. The list must have
+ * sufficient size to hold the element (that is, <code>index &lt;=
+ * size ()</code>).
+ *
+ * @param index The index to put the suite.
+ * @param suite The CipherSuite object.
+ * @throws IndexOutOfBoundsException If <code>index</code> is not
+ * less than @{link #size()}, or if it is negative.
+ * @throws NullPointerException If <code>suite</code> is
+ * <code>null</code>.
+ * @throws java.nio.ReadOnlyBufferException If the underlying buffer
+ * is not writable.
+ */
+ public void put (final int index, final CipherSuite suite)
+ {
+ int size = size ();
+ if (index < 0 || index >= size)
+ throw new IndexOutOfBoundsException ("limit: " + size
+ + "; requested: " + index);
+ buffer.position (2 + (index << 1));
+ buffer.put (suite.id ());
+ modCount++;
+ }
+
+ /**
+ * Sets the size of this list. You must call this if you are adding
+ * elements to the list; calling {@link
+ * #put(int,gnu.jessie.provider.CipherSuite)} does not expand the
+ * list size (the same goes for removing elements, as there is no
+ * <code>remove</code> method).
+ *
+ * @param newSize The new size of this list.
+ * @throws IllegalArgumentException If the new size is negative or
+ * greater than 32767, or if there is insufficient space for that
+ * many elements in the underlying buffer.
+ * @throws java.nio.ReadOnlyBufferException If the underlying buffer
+ * is not writable.
+ */
+ public void setSize (final int newSize)
+ {
+ if (newSize < 0 || newSize > 32767)
+ throw new IllegalArgumentException ("size must be between 0 and 32767");
+ if ((newSize << 1) + 2 > buffer.capacity ())
+ throw new IllegalArgumentException ("limit: " + buffer.capacity ()
+ + "; requested: " + newSize);
+ buffer.putShort (0, (short) (newSize << 1));
+ modCount++;
+ }
+
+ public String toString ()
+ {
+ return toString (null);
+ }
+
+ public String toString (final String prefix)
+ {
+ StringWriter str = new StringWriter ();
+ PrintWriter out = new PrintWriter (str);
+ if (prefix != null)
+ out.print (prefix);
+ out.print ("[");
+ out.print (size ());
+ out.println ("] {");
+ for (Iterator it = new Iterator (); it.hasNext (); )
+ {
+ CipherSuite suite = (CipherSuite) it.next ();
+ if (prefix != null)
+ out.print (prefix);
+ out.print (" ");
+ out.print (suite);
+ if (it.hasNext ())
+ out.print (",");
+ out.println ();
+ }
+ if (prefix != null)
+ out.print (prefix);
+ out.print ("};");
+ return str.toString ();
+ }
+
+ public boolean equals (Object o)
+ {
+ if (!(o instanceof CipherSuiteList))
+ return false;
+ CipherSuiteList that = (CipherSuiteList) o;
+
+ if (size () != that.size ())
+ return false;
+
+ for (Iterator it1 = new Iterator (), it2 = that.new Iterator ();
+ it1.hasNext () && it2.hasNext (); )
+ {
+ if (!it1.next ().equals (it2.next ()))
+ return false;
+ }
+ return true;
+ }
+
+ public java.util.Iterator<CipherSuite> iterator ()
+ {
+ return new Iterator ();
+ }
+
+ /**
+ * An iterator for the elements in this list. The iterator supports
+ * only the <code>set</code> method out of the optional methods,
+ * because elements in a CipherSuiteList may not be removed or
+ * added; only the size of the list can be changed, and elements at
+ * a specific index changed.
+ */
+ public class Iterator implements ListIterator<CipherSuite>
+ {
+ private final int modCount;
+ private int index;
+
+ Iterator ()
+ {
+ this.modCount = CipherSuiteList.this.modCount;
+ index = 0;
+ }
+
+ public void add (CipherSuite cs)
+ {
+ throw new UnsupportedOperationException ();
+ }
+
+ public boolean hasNext ()
+ {
+ return (index < size ());
+ }
+
+ public boolean hasPrevious ()
+ {
+ return (index > 0);
+ }
+
+ public CipherSuite next () throws NoSuchElementException
+ {
+ if (modCount != CipherSuiteList.this.modCount)
+ throw new ConcurrentModificationException ();
+ try
+ {
+ return get (index++);
+ }
+ catch (IndexOutOfBoundsException ioobe)
+ {
+ throw new NoSuchElementException ();
+ }
+ }
+
+ public int nextIndex ()
+ {
+ if (hasNext ())
+ return (index + 1);
+ return -1;
+ }
+
+ public CipherSuite previous () throws NoSuchElementException
+ {
+ if (index == 0)
+ throw new NoSuchElementException ();
+ if (modCount != CipherSuiteList.this.modCount)
+ throw new ConcurrentModificationException ();
+ try
+ {
+ return get (--index);
+ }
+ catch (IndexOutOfBoundsException ioobe) // on empty list
+ {
+ throw new NoSuchElementException ();
+ }
+ }
+
+ public int previousIndex ()
+ {
+ return (index - 1);
+ }
+
+ public void remove ()
+ {
+ throw new UnsupportedOperationException ();
+ }
+
+ public void set (final CipherSuite cs)
+ {
+ put (index, cs);
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ClientCertificateTypeList.java b/libjava/classpath/gnu/javax/net/ssl/provider/ClientCertificateTypeList.java
new file mode 100644
index 00000000000..1a1886b888c
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ClientCertificateTypeList.java
@@ -0,0 +1,227 @@
+/* ClientCertificateTypeList.java -- A list of certificate types.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.javax.net.ssl.provider.CertificateRequest.ClientCertificateType;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import java.nio.ByteBuffer;
+
+import java.util.ConcurrentModificationException;
+import java.util.ListIterator;
+import java.util.NoSuchElementException;
+
+public class ClientCertificateTypeList implements Iterable<ClientCertificateType>
+{
+ private final ByteBuffer buffer;
+ private int modCount;
+
+ public ClientCertificateTypeList (final ByteBuffer buffer)
+ {
+ this.buffer = buffer;
+ modCount = 0;
+ }
+
+ public int size ()
+ {
+ return (buffer.get (0) & 0xFF);
+ }
+
+ public CertificateRequest.ClientCertificateType get (final int index)
+ {
+ int size = size ();
+ if (index < 0 || index >= size)
+ throw new IndexOutOfBoundsException ("limit: " + size
+ + "; requested: " + index);
+ return CertificateRequest.ClientCertificateType.forValue
+ (buffer.get (index + 1) & 0xFF);
+ }
+
+ public java.util.Iterator<ClientCertificateType> iterator()
+ {
+ return new Iterator();
+ }
+
+ public void put (final int index, final CertificateRequest.ClientCertificateType type)
+ {
+ int size = size ();
+ if (index < 0 || index >= size)
+ throw new IndexOutOfBoundsException ("limit: " + size
+ + "; requested: " + index);
+ buffer.put (index + 1, (byte) type.getValue ());
+ modCount++;
+ }
+
+ public void setSize (final int newSize)
+ {
+ if (newSize < 0 || newSize > 255)
+ throw new IllegalArgumentException ("size must be between 0 and 255");
+ if (newSize + 1 > buffer.capacity ())
+ throw new IllegalArgumentException ("limit: " + (buffer.capacity () - 1)
+ + "; requested: " + newSize);
+ buffer.put (0, (byte) newSize);
+ modCount++;
+ }
+
+ public String toString ()
+ {
+ return toString (null);
+ }
+
+ public String toString (final String prefix)
+ {
+ StringWriter str = new StringWriter ();
+ PrintWriter out = new PrintWriter (str);
+ if (prefix != null) out.print (prefix);
+ out.print ("[");
+ out.print (size ());
+ out.println ("] {");
+ for (Iterator it = new Iterator (); it.hasNext (); )
+ {
+ if (prefix != null) out.print (prefix);
+ out.print (" ");
+ out.print (it.next ());
+ if (it.hasNext ())
+ out.print (",");
+ out.println ();
+ }
+ if (prefix != null) out.print (prefix);
+ out.println ("};");
+ return str.toString ();
+ }
+
+ public boolean equals (Object o)
+ {
+ if (!(o instanceof ClientCertificateTypeList))
+ return false;
+ ClientCertificateTypeList that = (ClientCertificateTypeList) o;
+
+ if (size () != that.size ())
+ return false;
+
+ for (Iterator it1 = new Iterator (), it2 = that.new Iterator ();
+ it1.hasNext () && it2.hasNext (); )
+ {
+ if (!it1.next ().equals (it2.next ()))
+ return false;
+ }
+ return true;
+ }
+
+ public class Iterator implements ListIterator<CertificateRequest.ClientCertificateType>
+ {
+ private int index;
+ private final int modCount;
+
+ Iterator ()
+ {
+ index = 0;
+ modCount = ClientCertificateTypeList.this.modCount;
+ }
+
+ public void add (CertificateRequest.ClientCertificateType type)
+ {
+ throw new UnsupportedOperationException ();
+ }
+
+ public boolean hasNext ()
+ {
+ return (index < size ());
+ }
+
+ public boolean hasPrevious ()
+ {
+ return (index > 0);
+ }
+
+ public CertificateRequest.ClientCertificateType next () throws NoSuchElementException
+ {
+ if (modCount != ClientCertificateTypeList.this.modCount)
+ throw new ConcurrentModificationException ();
+ try
+ {
+ return get (index++);
+ }
+ catch (IndexOutOfBoundsException ioobe)
+ {
+ throw new NoSuchElementException ();
+ }
+ }
+
+ public int nextIndex ()
+ {
+ if (hasNext ())
+ return (index + 1);
+ return -1;
+ }
+
+ public CertificateRequest.ClientCertificateType previous () throws NoSuchElementException
+ {
+ if (index == 0)
+ throw new NoSuchElementException ();
+ if (modCount != ClientCertificateTypeList.this.modCount)
+ throw new ConcurrentModificationException ();
+ try
+ {
+ return get (--index);
+ }
+ catch (IndexOutOfBoundsException ioobe)
+ {
+ throw new NoSuchElementException ();
+ }
+ }
+
+ public int previousIndex ()
+ {
+ return (index - 1);
+ }
+
+ public void remove ()
+ {
+ throw new UnsupportedOperationException ();
+ }
+
+ public void set (final CertificateRequest.ClientCertificateType type)
+ {
+ put (index, type);
+ }
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ClientDHE_PSKParameters.java b/libjava/classpath/gnu/javax/net/ssl/provider/ClientDHE_PSKParameters.java
new file mode 100644
index 00000000000..e63e03c0aa7
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ClientDHE_PSKParameters.java
@@ -0,0 +1,122 @@
+/* ClientDHE_PSKParameters.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+
+/**
+ * <pre>
+ struct {
+ select (KeyExchangeAlgorithm) {
+ /* other cases for rsa, diffie_hellman, etc. &#42;/
+ case diffie_hellman_psk: /* NEW &#42;/
+ opaque psk_identity<0..2^16-1>;
+ ClientDiffieHellmanPublic public;
+ } exchange_keys;
+ } ClientKeyExchange;</pre>
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class ClientDHE_PSKParameters extends ExchangeKeys implements Builder, Constructed
+{
+ public ClientDHE_PSKParameters(ByteBuffer buffer)
+ {
+ super(buffer);
+ }
+
+ public ClientDHE_PSKParameters(String identity, ClientDiffieHellmanPublic dh)
+ {
+ super(null);
+ Charset utf8 = Charset.forName("UTF-8");
+ ByteBuffer idBuf = utf8.encode(identity);
+ buffer = ByteBuffer.allocate(2 + idBuf.remaining() + dh.length());
+ buffer.putShort((short) idBuf.remaining());
+ buffer.put(idBuf);
+ buffer.put(dh.buffer());
+ buffer.rewind();
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Builder#buffer()
+ */
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().rewind().limit(length());
+ }
+
+ private int identityLength()
+ {
+ return (buffer.getShort(0) & 0xFFFF) + 2;
+ }
+
+ public String identity()
+ {
+ Charset utf8 = Charset.forName("UTF-8");
+ return utf8.decode((ByteBuffer) buffer.duplicate().position(2).limit
+ (identityLength())).toString();
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Constructed#length()
+ */
+ public int length()
+ {
+ int length = (buffer.getShort(0) & 0xFFFF) + 2;
+ // XXX always explicit?
+ length += (buffer.getShort(length) & 0xFFFF) + 2;
+ return length;
+ }
+
+ public ClientDiffieHellmanPublic params()
+ {
+ return new ClientDiffieHellmanPublic(((ByteBuffer) buffer.duplicate()
+ .position(identityLength()).limit(length())).slice());
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Constructed#toString(java.lang.String)
+ */
+ public String toString(String prefix)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ClientDiffieHellmanPublic.java b/libjava/classpath/gnu/javax/net/ssl/provider/ClientDiffieHellmanPublic.java
new file mode 100644
index 00000000000..8af8b850ba2
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ClientDiffieHellmanPublic.java
@@ -0,0 +1,129 @@
+/* ClientDiffieHellmanPublic.java -- Client Diffie-Hellman value.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import java.math.BigInteger;
+
+import java.nio.ByteBuffer;
+
+/**
+ * The client's explicit Diffie Hellman value.
+ *
+ * <pre>
+struct {
+ select (PublicValueEncoding) {
+ case implicit: struct { };
+ case explicit: opaque dh_Yc&lt;1..2^16-1&gt;;
+ } dh_public;
+} ClientDiffieHellmanPublic;</pre>
+ */
+public class ClientDiffieHellmanPublic extends ExchangeKeys implements Builder
+{
+ public ClientDiffieHellmanPublic(final ByteBuffer buffer)
+ {
+ super(buffer);
+ }
+
+ public ClientDiffieHellmanPublic(final BigInteger Yc)
+ {
+ super(wrap(Yc));
+ }
+
+ private static ByteBuffer wrap(BigInteger Yc)
+ {
+ byte[] b = Util.trim(Yc);
+ ByteBuffer ret = ByteBuffer.allocate(b.length + 2);
+ ret.putShort((short) b.length);
+ ret.put(b);
+ return (ByteBuffer) ret.rewind();
+ }
+
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().rewind().limit(length());
+ }
+
+ public BigInteger publicValue()
+ {
+ int len = length() - 2;
+ byte[] b = new byte[len];
+ buffer.position(2);
+ buffer.get(b);
+ buffer.rewind();
+ return new BigInteger(1, b);
+ }
+
+ public void setPublicValue(final BigInteger Yc)
+ {
+ byte[] buf = Util.trim(Yc);
+ if (buffer.capacity() < buf.length + 2)
+ buffer = ByteBuffer.allocate(buf.length + 2);
+ buffer.putShort((short) buf.length);
+ buffer.put(buf);
+ buffer.rewind();
+ }
+
+ public int length ()
+ {
+ return (buffer.getShort(0) & 0xFFFF) + 2;
+ }
+
+ public String toString ()
+ {
+ return toString (null);
+ }
+
+ public String toString (final String prefix)
+ {
+ StringWriter str = new StringWriter ();
+ PrintWriter out = new PrintWriter (str);
+ if (prefix != null) out.print (prefix);
+ out.println ("struct {");
+ if (prefix != null) out.print (prefix);
+ out.print (" dh_Yc = ");
+ out.print (publicValue ().toString (16));
+ out.println (';');
+ if (prefix != null) out.print (prefix);
+ out.print ("} ClientDiffieHellmanPublic;");
+ return str.toString ();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ClientHandshake.java b/libjava/classpath/gnu/javax/net/ssl/provider/ClientHandshake.java
new file mode 100644
index 00000000000..059b165a67d
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ClientHandshake.java
@@ -0,0 +1,1150 @@
+/* ClientHandshake.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import static gnu.javax.net.ssl.provider.ClientHandshake.State.*;
+import static gnu.javax.net.ssl.provider.KeyExchangeAlgorithm.*;
+
+import gnu.classpath.debug.Component;
+import gnu.java.security.action.GetSecurityPropertyAction;
+import gnu.javax.crypto.key.dh.GnuDHPublicKey;
+import gnu.javax.net.ssl.AbstractSessionContext;
+import gnu.javax.net.ssl.Session;
+import gnu.javax.net.ssl.provider.Alert.Description;
+import gnu.javax.net.ssl.provider.Alert.Level;
+import gnu.javax.net.ssl.provider.CertificateRequest.ClientCertificateType;
+import gnu.javax.net.ssl.provider.ServerNameList.NameType;
+import gnu.javax.net.ssl.provider.ServerNameList.ServerName;
+
+import java.nio.ByteBuffer;
+import java.security.AccessController;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.InvalidKeyException;
+import java.security.KeyManagementException;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.SignatureException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.security.interfaces.RSAPublicKey;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.zip.Deflater;
+import java.util.zip.Inflater;
+
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.SecretKey;
+import javax.crypto.interfaces.DHPrivateKey;
+import javax.crypto.interfaces.DHPublicKey;
+import javax.crypto.spec.DHParameterSpec;
+import javax.net.ssl.SSLException;
+import javax.net.ssl.SSLPeerUnverifiedException;
+import javax.net.ssl.X509ExtendedKeyManager;
+import javax.net.ssl.SSLEngineResult.HandshakeStatus;
+import javax.security.auth.x500.X500Principal;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class ClientHandshake extends AbstractHandshake
+{
+ static enum State
+ {
+ WRITE_CLIENT_HELLO (false, true),
+ READ_SERVER_HELLO (true, false),
+ READ_CERTIFICATE (true, false),
+ READ_SERVER_KEY_EXCHANGE (true, false),
+ READ_CERTIFICATE_REQUEST (true, false),
+ READ_SERVER_HELLO_DONE (true, false),
+ WRITE_CERTIFICATE (false, true),
+ WRITE_CLIENT_KEY_EXCHANGE (false, true),
+ WRITE_CERTIFICATE_VERIFY (false, true),
+ WRITE_FINISHED (false, true),
+ READ_FINISHED (true, false),
+ DONE (false, false);
+
+ private final boolean isWriteState;
+ private final boolean isReadState;
+
+ private State(boolean isReadState, boolean isWriteState)
+ {
+ this.isReadState = isReadState;
+ this.isWriteState = isWriteState;
+ }
+
+ boolean isReadState()
+ {
+ return isReadState;
+ }
+
+ boolean isWriteState()
+ {
+ return isWriteState;
+ }
+ }
+
+ private State state;
+ private ByteBuffer outBuffer;
+ private boolean continuedSession;
+ private SessionImpl continued;
+ private KeyPair dhPair;
+ private String keyAlias;
+ private PrivateKey privateKey;
+ private MaxFragmentLength maxFragmentLengthSent;
+ private boolean truncatedHMacSent;
+ private ProtocolVersion sentVersion;
+
+ // Delegated tasks.
+ private CertVerifier certVerifier;
+ private ParamsVerifier paramsVerifier;
+ private DelegatedTask keyExchange;
+ private CertLoader certLoader;
+ private GenCertVerify genCertVerify;
+
+ public ClientHandshake(SSLEngineImpl engine) throws NoSuchAlgorithmException
+ {
+ super(engine);
+ state = WRITE_CLIENT_HELLO;
+ continuedSession = false;
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.AbstractHandshake#implHandleInput()
+ */
+ @Override protected HandshakeStatus implHandleInput() throws SSLException
+ {
+ if (state == DONE)
+ return HandshakeStatus.FINISHED;
+
+ if (state.isWriteState()
+ || (outBuffer != null && outBuffer.hasRemaining()))
+ return HandshakeStatus.NEED_WRAP;
+
+ // Copy the current buffer, and prepare it for reading.
+ ByteBuffer buffer = handshakeBuffer.duplicate ();
+ buffer.flip();
+ buffer.position(handshakeOffset);
+
+ Handshake handshake = new Handshake(buffer.slice(),
+ engine.session().suite,
+ engine.session().version);
+
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "processing in state {0}:\n{1}",
+ state, handshake);
+
+ switch (state)
+ {
+ // Server Hello.
+ case READ_SERVER_HELLO:
+ {
+ if (handshake.type() != Handshake.Type.SERVER_HELLO)
+ throw new AlertException(new Alert(Alert.Level.FATAL,
+ Alert.Description.UNEXPECTED_MESSAGE));
+ ServerHello hello = (ServerHello) handshake.body();
+ serverRandom = hello.random().copy();
+ engine.session().suite = hello.cipherSuite();
+ engine.session().version = hello.version();
+ compression = hello.compressionMethod();
+ Session.ID serverId = new Session.ID(hello.sessionId());
+ if (continued != null
+ && continued.id().equals(serverId))
+ {
+ continuedSession = true;
+ engine.setSession(continued);
+ }
+ else if (engine.getEnableSessionCreation())
+ {
+ ((AbstractSessionContext) engine.contextImpl
+ .engineGetClientSessionContext()).put(engine.session());
+ }
+ ExtensionList extensions = hello.extensions();
+ if (extensions != null)
+ {
+ for (Extension extension : extensions)
+ {
+ Extension.Type type = extension.type();
+ if (type == null)
+ continue;
+ switch (type)
+ {
+ case MAX_FRAGMENT_LENGTH:
+ MaxFragmentLength mfl
+ = (MaxFragmentLength) extension.value();
+ if (maxFragmentLengthSent == mfl)
+ engine.session().setApplicationBufferSize(mfl.maxLength());
+ break;
+
+ case TRUNCATED_HMAC:
+ if (truncatedHMacSent)
+ engine.session().setTruncatedMac(true);
+ break;
+ }
+ }
+ }
+
+ KeyExchangeAlgorithm kex = engine.session().suite.keyExchangeAlgorithm();
+ if (continuedSession)
+ {
+ byte[][] keys = generateKeys(clientRandom, serverRandom,
+ engine.session());
+ setupSecurityParameters(keys, true, engine, compression);
+ state = READ_FINISHED;
+ }
+ else if (kex == RSA || kex == DH_DSS || kex == DH_RSA
+ || kex == DHE_DSS || kex == DHE_RSA || kex == RSA_PSK)
+ state = READ_CERTIFICATE;
+ else if (kex == DH_anon || kex == PSK || kex == DHE_PSK)
+ state = READ_SERVER_KEY_EXCHANGE;
+ else
+ state = READ_CERTIFICATE_REQUEST;
+ }
+ break;
+
+ // Server Certificate.
+ case READ_CERTIFICATE:
+ {
+ if (handshake.type() != Handshake.Type.CERTIFICATE)
+ {
+ // We need a certificate for non-anonymous suites.
+ if (engine.session().suite.signatureAlgorithm() != SignatureAlgorithm.ANONYMOUS)
+ throw new AlertException(new Alert(Level.FATAL,
+ Description.UNEXPECTED_MESSAGE));
+ state = READ_SERVER_KEY_EXCHANGE;
+ }
+ Certificate cert = (Certificate) handshake.body();
+ X509Certificate[] chain = null;
+ try
+ {
+ chain = cert.certificates().toArray(new X509Certificate[0]);
+ }
+ catch (CertificateException ce)
+ {
+ throw new AlertException(new Alert(Level.FATAL,
+ Description.BAD_CERTIFICATE),
+ ce);
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ throw new AlertException(new Alert(Level.FATAL,
+ Description.UNSUPPORTED_CERTIFICATE),
+ nsae);
+ }
+ engine.session().setPeerCertificates(chain);
+ certVerifier = new CertVerifier(true, chain);
+ tasks.add(certVerifier);
+
+ // If we are doing an RSA key exchange, generate our parameters.
+ KeyExchangeAlgorithm kea = engine.session().suite.keyExchangeAlgorithm();
+ if (kea == RSA || kea == RSA_PSK)
+ {
+ keyExchange = new RSAGen(kea == RSA);
+ tasks.add(keyExchange);
+ if (kea == RSA)
+ state = READ_CERTIFICATE_REQUEST;
+ else
+ state = READ_SERVER_KEY_EXCHANGE;
+ }
+ else
+ state = READ_SERVER_KEY_EXCHANGE;
+ }
+ break;
+
+ // Server Key Exchange.
+ case READ_SERVER_KEY_EXCHANGE:
+ {
+ CipherSuite s = engine.session().suite;
+ KeyExchangeAlgorithm kexalg = s.keyExchangeAlgorithm();
+ // XXX also SRP.
+ if (kexalg != DHE_DSS && kexalg != DHE_RSA && kexalg != DH_anon
+ && kexalg != DHE_PSK && kexalg != PSK && kexalg != RSA_PSK)
+ throw new AlertException(new Alert(Level.FATAL,
+ Description.UNEXPECTED_MESSAGE));
+
+ if (handshake.type() != Handshake.Type.SERVER_KEY_EXCHANGE)
+ {
+ if (kexalg != RSA_PSK && kexalg != PSK)
+ throw new AlertException(new Alert(Level.FATAL,
+ Description.UNEXPECTED_MESSAGE));
+ state = READ_CERTIFICATE_REQUEST;
+ return HandshakeStatus.NEED_UNWRAP;
+ }
+
+ ServerKeyExchange skex = (ServerKeyExchange) handshake.body();
+ ByteBuffer paramsBuffer = null;
+ if (kexalg == DHE_DSS || kexalg == DHE_RSA || kexalg == DH_anon)
+ {
+ ServerDHParams dhParams = (ServerDHParams) skex.params();
+ ByteBuffer b = dhParams.buffer();
+ paramsBuffer = ByteBuffer.allocate(b.remaining());
+ paramsBuffer.put(b);
+ }
+
+ if (s.signatureAlgorithm() != SignatureAlgorithm.ANONYMOUS)
+ {
+ byte[] signature = skex.signature().signature();
+ paramsVerifier = new ParamsVerifier(paramsBuffer, signature);
+ tasks.add(paramsVerifier);
+ }
+
+ if (kexalg == DHE_DSS || kexalg == DHE_RSA || kexalg == DH_anon)
+ {
+ ServerDHParams dhParams = (ServerDHParams) skex.params();
+ DHPublicKey serverKey = new GnuDHPublicKey(null,
+ dhParams.p(),
+ dhParams.g(),
+ dhParams.y());
+ DHParameterSpec params = new DHParameterSpec(dhParams.p(),
+ dhParams.g());
+ keyExchange = new ClientDHGen(serverKey, params, true);
+ tasks.add(keyExchange);
+ }
+ if (kexalg == DHE_PSK)
+ {
+ ServerDHE_PSKParameters pskParams = (ServerDHE_PSKParameters)
+ skex.params();
+ ServerDHParams dhParams = pskParams.params();
+ DHPublicKey serverKey = new GnuDHPublicKey(null,
+ dhParams.p(),
+ dhParams.g(),
+ dhParams.y());
+ DHParameterSpec params = new DHParameterSpec(dhParams.p(),
+ dhParams.g());
+ keyExchange = new ClientDHGen(serverKey, params, false);
+ tasks.add(keyExchange);
+ }
+ state = READ_CERTIFICATE_REQUEST;
+ }
+ break;
+
+ // Certificate Request.
+ case READ_CERTIFICATE_REQUEST:
+ {
+ if (handshake.type() != Handshake.Type.CERTIFICATE_REQUEST)
+ {
+ state = READ_SERVER_HELLO_DONE;
+ return HandshakeStatus.NEED_UNWRAP;
+ }
+
+ CertificateRequest req = (CertificateRequest) handshake.body();
+ ClientCertificateTypeList types = req.types();
+ LinkedList<String> typeList = new LinkedList<String>();
+ for (ClientCertificateType t : types)
+ typeList.add(t.name());
+
+ X500PrincipalList issuers = req.authorities();
+ LinkedList<X500Principal> issuerList = new LinkedList<X500Principal>();
+ for (X500Principal p : issuers)
+ issuerList.add(p);
+
+ certLoader = new CertLoader(typeList, issuerList);
+ tasks.add(certLoader);
+ }
+ break;
+
+ // Server Hello Done.
+ case READ_SERVER_HELLO_DONE:
+ {
+ if (handshake.type() != Handshake.Type.SERVER_HELLO_DONE)
+ throw new AlertException(new Alert(Level.FATAL,
+ Description.UNEXPECTED_MESSAGE));
+ state = WRITE_CERTIFICATE;
+ }
+ break;
+
+ // Finished.
+ case READ_FINISHED:
+ {
+ if (handshake.type() != Handshake.Type.FINISHED)
+ throw new AlertException(new Alert(Level.FATAL,
+ Description.UNEXPECTED_MESSAGE));
+
+ Finished serverFinished = (Finished) handshake.body();
+ MessageDigest md5copy = null;
+ MessageDigest shacopy = null;
+ try
+ {
+ md5copy = (MessageDigest) md5.clone();
+ shacopy = (MessageDigest) sha.clone();
+ }
+ catch (CloneNotSupportedException cnse)
+ {
+ // We're improperly configured to use a non-cloneable
+ // md5/sha-1, OR there's a runtime bug.
+ throw new SSLException(cnse);
+ }
+ Finished clientFinished =
+ new Finished(generateFinished(md5copy, shacopy,
+ false, engine.session()),
+ engine.session().version);
+
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "clientFinished: {0}",
+ clientFinished);
+
+ if (engine.session().version == ProtocolVersion.SSL_3)
+ {
+ if (!Arrays.equals(clientFinished.md5Hash(),
+ serverFinished.md5Hash())
+ || !Arrays.equals(clientFinished.shaHash(),
+ serverFinished.shaHash()))
+ {
+ engine.session().invalidate();
+ throw new SSLException("session verify failed");
+ }
+ }
+ else
+ {
+ if (!Arrays.equals(clientFinished.verifyData(),
+ serverFinished.verifyData()))
+ {
+ engine.session().invalidate();
+ throw new SSLException("session verify failed");
+ }
+ }
+
+ if (continuedSession)
+ {
+ engine.changeCipherSpec();
+ state = WRITE_FINISHED;
+ }
+ else
+ state = DONE;
+ }
+ break;
+
+ default:
+ throw new IllegalStateException("invalid state: " + state);
+ }
+
+ handshakeOffset += handshake.length() + 4;
+
+ if (!tasks.isEmpty())
+ return HandshakeStatus.NEED_TASK;
+ if (state.isWriteState()
+ || (outBuffer != null && outBuffer.hasRemaining()))
+ return HandshakeStatus.NEED_WRAP;
+ if (state.isReadState())
+ return HandshakeStatus.NEED_UNWRAP;
+
+ return HandshakeStatus.FINISHED;
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.AbstractHandshake#implHandleOutput(java.nio.ByteBuffer)
+ */
+ @Override protected HandshakeStatus implHandleOutput(ByteBuffer fragment)
+ throws SSLException
+ {
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "output to {0}; state:{1}; outBuffer:{2}",
+ fragment, state, outBuffer);
+
+ // Drain the output buffer, if it needs it.
+ if (outBuffer != null && outBuffer.hasRemaining())
+ {
+ int l = Math.min(fragment.remaining(), outBuffer.remaining());
+ fragment.put((ByteBuffer) outBuffer.duplicate().limit(outBuffer.position() + l));
+ outBuffer.position(outBuffer.position() + l);
+ }
+
+ if (!fragment.hasRemaining())
+ {
+ if (state.isWriteState() || outBuffer.hasRemaining())
+ return HandshakeStatus.NEED_WRAP;
+ else
+ return HandshakeStatus.NEED_UNWRAP;
+ }
+
+outer_loop:
+ while (fragment.remaining() >= 4 && state.isWriteState())
+ {
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "loop state={0}", state);
+
+ switch (state)
+ {
+ case WRITE_CLIENT_HELLO:
+ {
+ ClientHelloBuilder hello = new ClientHelloBuilder();
+ AbstractSessionContext ctx = (AbstractSessionContext)
+ engine.contextImpl.engineGetClientSessionContext();
+ continued = (SessionImpl) ctx.getSession(engine.getPeerHost(),
+ engine.getPeerPort());
+ engine.session().setId(new Session.ID(new byte[0]));
+ Session.ID sid = engine.session().id();
+ // If we have a session that we may want to continue, send
+ // that ID.
+ if (continued != null)
+ sid = continued.id();
+
+ hello.setSessionId(sid.id());
+ sentVersion = chooseVersion();
+ hello.setVersion(sentVersion);
+ hello.setCipherSuites(getSuites());
+ hello.setCompressionMethods(getCompressionMethods());
+ Random r = hello.random();
+ r.setGmtUnixTime(Util.unixTime());
+ byte[] nonce = new byte[28];
+ engine.session().random().nextBytes(nonce);
+ r.setRandomBytes(nonce);
+ clientRandom = r.copy();
+ if (enableExtensions())
+ {
+ List<Extension> extensions = new LinkedList<Extension>();
+ MaxFragmentLength fraglen = maxFragmentLength();
+ if (fraglen != null)
+ {
+ extensions.add(new Extension(Extension.Type.MAX_FRAGMENT_LENGTH,
+ fraglen));
+ maxFragmentLengthSent = fraglen;
+ }
+
+ String host = engine.getPeerHost();
+ if (host != null)
+ {
+ ServerName name
+ = new ServerName(NameType.HOST_NAME, host);
+ ServerNameList names
+ = new ServerNameList(Collections.singletonList(name));
+ extensions.add(new Extension(Extension.Type.SERVER_NAME,
+ names));
+ }
+
+ if (truncatedHMac())
+ {
+ extensions.add(new Extension(Extension.Type.TRUNCATED_HMAC,
+ new TruncatedHMAC()));
+ truncatedHMacSent = true;
+ }
+
+ ExtensionList elist = new ExtensionList(extensions);
+ hello.setExtensions(elist.buffer());
+ }
+ else
+ hello.setDisableExtensions(true);
+
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "{0}", hello);
+
+ fragment.putInt((Handshake.Type.CLIENT_HELLO.getValue() << 24)
+ | (hello.length() & 0xFFFFFF));
+ outBuffer = hello.buffer();
+ int l = Math.min(fragment.remaining(), outBuffer.remaining());
+ fragment.put((ByteBuffer) outBuffer.duplicate()
+ .limit(outBuffer.position() + l));
+ outBuffer.position(outBuffer.position() + l);
+
+ state = READ_SERVER_HELLO;
+ }
+ break;
+
+ case WRITE_CERTIFICATE:
+ {
+ java.security.cert.Certificate[] chain
+ = engine.session().getLocalCertificates();
+ if (chain != null)
+ {
+ CertificateBuilder cert
+ = new CertificateBuilder(CertificateType.X509);
+ try
+ {
+ cert.setCertificates(Arrays.asList(chain));
+ }
+ catch (CertificateException ce)
+ {
+ throw new AlertException(new Alert(Level.FATAL,
+ Description.INTERNAL_ERROR),
+ ce);
+ }
+
+ outBuffer = cert.buffer();
+
+ fragment.putInt((Handshake.Type.CERTIFICATE.getValue() << 24)
+ | (cert.length() & 0xFFFFFF));
+
+ int l = Math.min(fragment.remaining(), outBuffer.remaining());
+ fragment.put((ByteBuffer) outBuffer.duplicate()
+ .limit(outBuffer.position() + l));
+ outBuffer.position(outBuffer.position() + l);
+ }
+ state = WRITE_CLIENT_KEY_EXCHANGE;
+ }
+ break;
+
+ case WRITE_CLIENT_KEY_EXCHANGE:
+ {
+ KeyExchangeAlgorithm kea = engine.session().suite.keyExchangeAlgorithm();
+ ClientKeyExchangeBuilder ckex
+ = new ClientKeyExchangeBuilder(engine.session().suite,
+ engine.session().version);
+ if (kea == DHE_DSS || kea == DHE_RSA || kea == DH_anon
+ || kea == DH_DSS || kea == DH_RSA)
+ {
+ assert(dhPair != null);
+ DHPublicKey pubkey = (DHPublicKey) dhPair.getPublic();
+ ClientDiffieHellmanPublic pub
+ = new ClientDiffieHellmanPublic(pubkey.getY());
+ ckex.setExchangeKeys(pub.buffer());
+ }
+ if (kea == RSA || kea == RSA_PSK)
+ {
+ assert(keyExchange instanceof RSAGen);
+ assert(keyExchange.hasRun());
+ if (keyExchange.thrown() != null)
+ throw new AlertException(new Alert(Level.FATAL,
+ Description.HANDSHAKE_FAILURE),
+ keyExchange.thrown());
+ EncryptedPreMasterSecret epms
+ = new EncryptedPreMasterSecret(((RSAGen) keyExchange).encryptedSecret(),
+ engine.session().version);
+ if (kea == RSA)
+ ckex.setExchangeKeys(epms.buffer());
+ else
+ {
+ String identity = getPSKIdentity();
+ if (identity == null)
+ throw new SSLException("no pre-shared-key identity;"
+ + " set the security property"
+ + " \"jessie.client.psk.identity\"");
+ ClientRSA_PSKParameters params =
+ new ClientRSA_PSKParameters(identity, epms.buffer());
+ ckex.setExchangeKeys(params.buffer());
+ generatePSKSecret(identity, preMasterSecret, true);
+ }
+ }
+ if (kea == DHE_PSK)
+ {
+ assert(keyExchange instanceof ClientDHGen);
+ assert(dhPair != null);
+ String identity = getPSKIdentity();
+ if (identity == null)
+ throw new SSLException("no pre-shared key identity; set"
+ + " the security property"
+ + " \"jessie.client.psk.identity\"");
+ DHPublicKey pubkey = (DHPublicKey) dhPair.getPublic();
+ ClientDHE_PSKParameters params =
+ new ClientDHE_PSKParameters(identity,
+ new ClientDiffieHellmanPublic(pubkey.getY()));
+ ckex.setExchangeKeys(params.buffer());
+ generatePSKSecret(identity, preMasterSecret, true);
+ }
+ if (kea == PSK)
+ {
+ String identity = getPSKIdentity();
+ if (identity == null)
+ throw new SSLException("no pre-shared key identity; set"
+ + " the security property"
+ + " \"jessie.client.psk.identity\"");
+ generatePSKSecret(identity, null, true);
+ ClientPSKParameters params = new ClientPSKParameters(identity);
+ ckex.setExchangeKeys(params.buffer());
+ }
+ if (kea == NONE)
+ {
+ Inflater inflater = null;
+ Deflater deflater = null;
+ if (compression == CompressionMethod.ZLIB)
+ {
+ inflater = new Inflater();
+ deflater = new Deflater();
+ }
+ inParams = new InputSecurityParameters(null, null, inflater,
+ engine.session(),
+ engine.session().suite);
+ outParams = new OutputSecurityParameters(null, null, deflater,
+ engine.session(),
+ engine.session().suite);
+ engine.session().privateData.masterSecret = new byte[0];
+ }
+
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "{0}", ckex);
+
+ outBuffer = ckex.buffer();
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "client kex buffer {0}", outBuffer);
+ fragment.putInt((Handshake.Type.CLIENT_KEY_EXCHANGE.getValue() << 24)
+ | (ckex.length() & 0xFFFFFF));
+ int l = Math.min(fragment.remaining(), outBuffer.remaining());
+ fragment.put((ByteBuffer) outBuffer.duplicate().limit(outBuffer.position() + l));
+ outBuffer.position(outBuffer.position() + l);
+
+ if (privateKey != null)
+ {
+ genCertVerify = new GenCertVerify(md5, sha);
+ tasks.add(genCertVerify);
+ state = WRITE_CERTIFICATE_VERIFY;
+ }
+ else
+ {
+ engine.changeCipherSpec();
+ state = WRITE_FINISHED;
+ }
+ }
+ // Both states terminate in a NEED_TASK, or a need to change cipher
+ // specs; so we can't write any more messages here.
+ break outer_loop;
+
+ case WRITE_CERTIFICATE_VERIFY:
+ {
+ assert(genCertVerify != null);
+ assert(genCertVerify.hasRun());
+ CertificateVerify verify = new CertificateVerify(genCertVerify.signed(),
+ engine.session().suite.signatureAlgorithm());
+
+ outBuffer = verify.buffer();
+ fragment.putInt((Handshake.Type.CERTIFICATE_VERIFY.getValue() << 24)
+ | (verify.length() & 0xFFFFFF));
+ int l = Math.min(fragment.remaining(), outBuffer.remaining());
+ fragment.put((ByteBuffer) outBuffer.duplicate().limit(outBuffer.position() + l));
+ outBuffer.position(outBuffer.position() + l);
+
+ // XXX This is a potential problem: we may not have drained
+ // outBuffer, but set the changeCipherSpec toggle.
+ engine.changeCipherSpec();
+ state = WRITE_FINISHED;
+ }
+ break outer_loop;
+
+ case WRITE_FINISHED:
+ {
+ MessageDigest md5copy = null;
+ MessageDigest shacopy = null;
+ try
+ {
+ md5copy = (MessageDigest) md5.clone();
+ shacopy = (MessageDigest) sha.clone();
+ }
+ catch (CloneNotSupportedException cnse)
+ {
+ // We're improperly configured to use a non-cloneable
+ // md5/sha-1, OR there's a runtime bug.
+ throw new SSLException(cnse);
+ }
+ outBuffer
+ = generateFinished(md5copy, shacopy, true,
+ engine.session());
+
+ fragment.putInt((Handshake.Type.FINISHED.getValue() << 24)
+ | outBuffer.remaining() & 0xFFFFFF);
+
+ int l = Math.min(outBuffer.remaining(), fragment.remaining());
+ fragment.put((ByteBuffer) outBuffer.duplicate().limit(outBuffer.position() + l));
+ outBuffer.position(outBuffer.position() + l);
+
+ if (continuedSession)
+ state = DONE;
+ else
+ state = READ_FINISHED;
+ }
+ break;
+
+ default:
+ throw new IllegalStateException("invalid state: " + state);
+ }
+ }
+
+ if (!tasks.isEmpty())
+ return HandshakeStatus.NEED_TASK;
+ if (state.isWriteState() ||
+ (outBuffer != null && outBuffer.hasRemaining()))
+ return HandshakeStatus.NEED_WRAP;
+ if (state.isReadState())
+ return HandshakeStatus.NEED_UNWRAP;
+
+ return HandshakeStatus.FINISHED;
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.AbstractHandshake#status()
+ */
+ @Override HandshakeStatus status()
+ {
+ if (state.isReadState())
+ return HandshakeStatus.NEED_UNWRAP;
+ if (state.isWriteState())
+ return HandshakeStatus.NEED_WRAP;
+ return HandshakeStatus.FINISHED;
+ }
+
+ @Override void checkKeyExchange() throws SSLException
+ {
+ // XXX implement.
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.AbstractHandshake#handleV2Hello(java.nio.ByteBuffer)
+ */
+ @Override void handleV2Hello(ByteBuffer hello) throws SSLException
+ {
+ throw new SSLException("this should be impossible");
+ }
+
+ private ProtocolVersion chooseVersion() throws SSLException
+ {
+ // Select the highest enabled version, for our initial key exchange.
+ ProtocolVersion version = null;
+ for (String ver : engine.getEnabledProtocols())
+ {
+ try
+ {
+ ProtocolVersion v = ProtocolVersion.forName(ver);
+ if (version == null || version.compareTo(v) < 0)
+ version = v;
+ }
+ catch (Exception x)
+ {
+ continue;
+ }
+ }
+
+ if (version == null)
+ throw new SSLException("no suitable enabled versions");
+
+ return version;
+ }
+
+ private List<CipherSuite> getSuites() throws SSLException
+ {
+ List<CipherSuite> suites = new LinkedList<CipherSuite>();
+ for (String s : engine.getEnabledCipherSuites())
+ {
+ CipherSuite suite = CipherSuite.forName(s);
+ if (suite != null)
+ suites.add(suite);
+ }
+ if (suites.isEmpty())
+ throw new SSLException("no cipher suites enabled");
+ return suites;
+ }
+
+ private List<CompressionMethod> getCompressionMethods()
+ {
+ List<CompressionMethod> methods = new LinkedList<CompressionMethod>();
+ GetSecurityPropertyAction gspa = new GetSecurityPropertyAction("jessie.enable.compression");
+ if (Boolean.valueOf(AccessController.doPrivileged(gspa)))
+ methods.add(CompressionMethod.ZLIB);
+ methods.add(CompressionMethod.NULL);
+ return methods;
+ }
+
+ private boolean enableExtensions()
+ {
+ GetSecurityPropertyAction action
+ = new GetSecurityPropertyAction("jessie.client.enable.extensions");
+ return Boolean.valueOf(AccessController.doPrivileged(action));
+ }
+
+ private MaxFragmentLength maxFragmentLength()
+ {
+ GetSecurityPropertyAction action
+ = new GetSecurityPropertyAction("jessie.client.maxFragmentLength");
+ String s = AccessController.doPrivileged(action);
+ if (s != null)
+ {
+ try
+ {
+ int len = Integer.parseInt(s);
+ switch (len)
+ {
+ case 9:
+ case (1 << 9): return MaxFragmentLength.LEN_2_9;
+ case 10:
+ case (1 << 10): return MaxFragmentLength.LEN_2_10;
+ case 11:
+ case (1 << 11): return MaxFragmentLength.LEN_2_11;
+ case 12:
+ case (1 << 12): return MaxFragmentLength.LEN_2_12;
+ }
+ }
+ catch (NumberFormatException nfe)
+ {
+ }
+ }
+ return null;
+ }
+
+ private boolean truncatedHMac()
+ {
+ GetSecurityPropertyAction action
+ = new GetSecurityPropertyAction("jessie.client.truncatedHMac");
+ return Boolean.valueOf(AccessController.doPrivileged(action));
+ }
+
+ private String getPSKIdentity()
+ {
+ GetSecurityPropertyAction action
+ = new GetSecurityPropertyAction("jessie.client.psk.identity");
+ return AccessController.doPrivileged(action);
+ }
+
+ // Delegated tasks.
+
+ class ParamsVerifier extends DelegatedTask
+ {
+ private final ByteBuffer paramsBuffer;
+ private final byte[] signature;
+ private boolean verified;
+
+ ParamsVerifier(ByteBuffer paramsBuffer, byte[] signature)
+ {
+ this.paramsBuffer = paramsBuffer;
+ this.signature = signature;
+ }
+
+ public void implRun()
+ throws InvalidKeyException, NoSuchAlgorithmException,
+ SSLPeerUnverifiedException, SignatureException
+ {
+ java.security.Signature s
+ = java.security.Signature.getInstance(engine.session().suite
+ .signatureAlgorithm().algorithm());
+ s.initVerify(engine.session().getPeerCertificates()[0]);
+ s.update(paramsBuffer);
+ verified = s.verify(signature);
+ synchronized (this)
+ {
+ notifyAll();
+ }
+ }
+
+ boolean verified()
+ {
+ return verified;
+ }
+ }
+
+ class ClientDHGen extends DelegatedTask
+ {
+ private final DHPublicKey serverKey;
+ private final DHParameterSpec params;
+ private final boolean full;
+
+ ClientDHGen(DHPublicKey serverKey, DHParameterSpec params, boolean full)
+ {
+ this.serverKey = serverKey;
+ this.params = params;
+ this.full = full;
+ }
+
+ public void implRun()
+ throws InvalidAlgorithmParameterException, NoSuchAlgorithmException,
+ SSLException
+ {
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_DELEGATED_TASK, "running client DH phase");
+ if (paramsVerifier != null)
+ {
+ synchronized (paramsVerifier)
+ {
+ try
+ {
+ while (!paramsVerifier.hasRun())
+ paramsVerifier.wait(500);
+ }
+ catch (InterruptedException ie)
+ {
+ // Ignore.
+ }
+ }
+ }
+ KeyPairGenerator gen = KeyPairGenerator.getInstance("DH");
+ gen.initialize(params, engine.session().random());
+ dhPair = gen.generateKeyPair();
+ if (Debug.DEBUG_KEY_EXCHANGE)
+ logger.logv(Component.SSL_KEY_EXCHANGE,
+ "client keys public:{0} private:{1}", dhPair.getPublic(),
+ dhPair.getPrivate());
+
+ initDiffieHellman((DHPrivateKey) dhPair.getPrivate(), engine.session().random());
+
+ // We have enough info to do the full key exchange; so let's do it.
+ DHPhase phase = new DHPhase(serverKey, full);
+ phase.run();
+ if (phase.thrown() != null)
+ throw new SSLException(phase.thrown());
+ }
+
+ DHPublicKey serverKey()
+ {
+ return serverKey;
+ }
+ }
+
+ class CertLoader extends DelegatedTask
+ {
+ private final List<String> keyTypes;
+ private final List<X500Principal> issuers;
+
+ CertLoader(List<String> keyTypes, List<X500Principal> issuers)
+ {
+ this.keyTypes = keyTypes;
+ this.issuers = issuers;
+ }
+
+ public void implRun()
+ {
+ X509ExtendedKeyManager km = engine.contextImpl.keyManager;
+ if (km == null)
+ return;
+ keyAlias = km.chooseEngineClientAlias(keyTypes.toArray(new String[keyTypes.size()]),
+ issuers.toArray(new X500Principal[issuers.size()]),
+ engine);
+ engine.session().setLocalCertificates(km.getCertificateChain(keyAlias));
+ privateKey = km.getPrivateKey(keyAlias);
+ }
+ }
+
+ class RSAGen extends DelegatedTask
+ {
+ private byte[] encryptedPreMasterSecret;
+ private final boolean full;
+
+ RSAGen()
+ {
+ this(true);
+ }
+
+ RSAGen(boolean full)
+ {
+ this.full = full;
+ }
+
+ public void implRun()
+ throws BadPaddingException, IllegalBlockSizeException, InvalidKeyException,
+ NoSuchAlgorithmException, NoSuchPaddingException,
+ SSLException
+ {
+ if (certVerifier != null)
+ {
+ synchronized (certVerifier)
+ {
+ try
+ {
+ while (!certVerifier.hasRun())
+ certVerifier.wait(500);
+ }
+ catch (InterruptedException ie)
+ {
+ // Ignore.
+ }
+ }
+ }
+ preMasterSecret = new byte[48];
+ engine.session().random().nextBytes(preMasterSecret);
+ preMasterSecret[0] = (byte) sentVersion.major();
+ preMasterSecret[1] = (byte) sentVersion.minor();
+ Cipher rsa = Cipher.getInstance("RSA");
+ java.security.cert.Certificate cert
+ = engine.session().getPeerCertificates()[0];
+ rsa.init(Cipher.ENCRYPT_MODE, cert);
+ encryptedPreMasterSecret = rsa.doFinal(preMasterSecret);
+
+ // Generate our session keys, because we can.
+ if (full)
+ {
+ generateMasterSecret(clientRandom, serverRandom, engine.session());
+ byte[][] keys = generateKeys(clientRandom, serverRandom, engine.session());
+ setupSecurityParameters(keys, true, engine, compression);
+ }
+ }
+
+ byte[] encryptedSecret()
+ {
+ return encryptedPreMasterSecret;
+ }
+ }
+
+ class GenCertVerify extends DelegatedTask
+ {
+ private final MessageDigest md5, sha;
+ private byte[] signed;
+
+ GenCertVerify(MessageDigest md5, MessageDigest sha)
+ {
+ try
+ {
+ this.md5 = (MessageDigest) md5.clone();
+ this.sha = (MessageDigest) sha.clone();
+ }
+ catch (CloneNotSupportedException cnse)
+ {
+ // Our message digests *should* be cloneable.
+ throw new Error(cnse);
+ }
+ }
+
+ public void implRun()
+ throws InvalidKeyException, NoSuchAlgorithmException, SignatureException
+ {
+ byte[] toSign;
+ if (engine.session().version == ProtocolVersion.SSL_3)
+ {
+ toSign = genV3CertificateVerify(md5, sha, engine.session());
+ }
+ else
+ {
+ if (engine.session().suite.signatureAlgorithm() == SignatureAlgorithm.RSA)
+ toSign = Util.concat(md5.digest(), sha.digest());
+ else
+ toSign = sha.digest();
+ }
+
+ java.security.Signature sig =
+ java.security.Signature.getInstance(engine.session().suite.signatureAlgorithm().name());
+ sig.initSign(privateKey);
+ sig.update(toSign);
+ signed = sig.sign();
+ }
+
+ byte[] signed()
+ {
+ return signed;
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ClientHello.java b/libjava/classpath/gnu/javax/net/ssl/provider/ClientHello.java
index 259051df129..54d7f8b4d74 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/ClientHello.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ClientHello.java
@@ -38,216 +38,203 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
import java.io.PrintWriter;
-import java.io.StringReader;
import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
-import javax.net.ssl.SSLProtocolException;
-
-final class ClientHello implements Handshake.Body
+/**
+ * A ClientHello handshake message.
+ *
+ * <pre>
+struct
+{
+ ProtocolVersion client_version; // 2
+ Random random; // 32
+ SessionID session_id; // 1 + 0..32
+ CipherSuite cipher_suites&lt;2..2^16-1&gt;
+ CompressionMethod compression_methods&lt;1..2^8-1&gt;
+ Extension client_hello_extension_list&lt;0..2^16-1&gt;
+} ClientHello;
+</pre>
+ */
+public class ClientHello implements Handshake.Body
{
// Fields.
// -------------------------------------------------------------------------
- private ProtocolVersion version;
- private Random random;
- private byte[] sessionId;
- private List suites;
- private List comp;
- private List extensions;
+ // To help track offsets into the message:
+ // The location of the 'random' field.
+ protected static final int RANDOM_OFFSET = 2;
+ // The location of the sesion_id length.
+ protected static final int SESSID_OFFSET = 32 + RANDOM_OFFSET;
+ // The location of the session_id bytes (if any).
+ protected static final int SESSID_OFFSET2 = SESSID_OFFSET + 1;
+
+ protected ByteBuffer buffer;
+ protected boolean disableExtensions;
// Constructor.
// -------------------------------------------------------------------------
- ClientHello(ProtocolVersion version, Random random,
- byte[] sessionId, List suites, List comp)
+ public ClientHello (final ByteBuffer buffer)
{
- this(version, random, sessionId, suites, comp, null);
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ disableExtensions = false;
}
- ClientHello(ProtocolVersion version, Random random,
- byte[] sessionId, List suites, List comp, List extensions)
+ // Instance methods.
+ // -------------------------------------------------------------------------
+
+ public int length()
{
- this.version = version;
- this.random = random;
- this.sessionId = sessionId;
- this.suites = suites;
- this.comp = comp;
- this.extensions = extensions;
+ int len = SESSID_OFFSET2 + buffer.get(SESSID_OFFSET);
+ len += (buffer.getShort(len) & 0xFFFF) + 2;
+ len += (buffer.get(len) & 0xFF) + 1;
+ if (!disableExtensions && len + 1 < buffer.capacity())
+ len += (buffer.getShort(len) & 0xFFFF) + 2;
+ return len;
}
- // Class methods.
- // -------------------------------------------------------------------------
+ /**
+ * Gets the protocol version field.
+ *
+ * @return The protocol version field.
+ */
+ public ProtocolVersion version()
+ {
+ return ProtocolVersion.getInstance (buffer.getShort (0));
+ }
- static ClientHello read(InputStream in) throws IOException
+ /**
+ * Gets the SSL nonce.
+ *
+ * @return The nonce.
+ */
+ public Random random()
{
- ProtocolVersion vers = ProtocolVersion.read(in);
- Random rand = Random.read(in);
- byte[] id = new byte[in.read() & 0xFF];
- in.read(id);
- int len = (in.read() & 0xFF) << 8 | (in.read() & 0xFF);
- ArrayList suites = new ArrayList(len / 2);
- for (int i = 0; i < len; i += 2)
- {
- suites.add(CipherSuite.read(in).resolve(vers));
- }
- len = in.read() & 0xFF;
- ArrayList comp = new ArrayList(len);
- for (int i = 0; i < len; i++)
- {
- comp.add(CompressionMethod.read(in));
- }
-
- List ext = null;
- // Since parsing MAY need to continue into the extensions fields, or it
- // may end here, the specified input stream MUST be a ByteArrayInputStream
- // over all the data this hello contains. Otherwise this will mess up
- // the data stream.
- if (in.available() > 0) // then we have extensions.
- {
- ext = new LinkedList();
- len = (in.read() & 0xFF) << 8 | (in.read() & 0xFF);
- int count = 0;
- while (count < len)
- {
- Extension e = Extension.read(in);
- ext.add(e);
- count += e.getValue().length + 4;
- }
- }
- return new ClientHello(vers, rand, id, suites, comp, ext);
+ ByteBuffer randomBuf =
+ ((ByteBuffer) buffer.duplicate ().position (RANDOM_OFFSET)
+ .limit (SESSID_OFFSET)).slice ();
+ return new Random (randomBuf);
}
- // Instance methods.
- // -------------------------------------------------------------------------
+ public byte[] sessionId()
+ {
+ int idlen = buffer.get (SESSID_OFFSET) & 0xFF;
+ byte[] sessionId = new byte[idlen];
+ buffer.position (SESSID_OFFSET2);
+ buffer.get (sessionId);
+ return sessionId;
+ }
- public void write(OutputStream out) throws IOException
+ public CipherSuiteList cipherSuites()
{
- version.write(out);
- random.write(out);
- out.write(sessionId.length);
- out.write(sessionId);
- out.write((suites.size() << 1) >>> 8 & 0xFF);
- out.write((suites.size() << 1) & 0xFF);
- for (Iterator i = suites.iterator(); i.hasNext(); )
- {
- ((CipherSuite) i.next()).write(out);
- }
- out.write(comp.size());
- for (Iterator i = comp.iterator(); i.hasNext(); )
- {
- out.write(((CompressionMethod) i.next()).getValue());
- }
- if (extensions != null)
- {
- ByteArrayOutputStream out2 = new ByteArrayOutputStream();
- for (Iterator i = extensions.iterator(); i.hasNext(); )
- {
- ((Extension) i.next()).write(out2);
- }
- out.write(out2.size() >>> 8 & 0xFF);
- out.write(out2.size() & 0xFF);
- out2.writeTo(out);
- }
+ int offset = getCipherSuitesOffset ();
+
+ // We give the CipherSuiteList all the remaining bytes to play with,
+ // since this might be an in-construction packet that will fill in
+ // the length field itself.
+ ByteBuffer listBuf = ((ByteBuffer) buffer.duplicate ().position (offset)
+ .limit (buffer.capacity ())).slice ();
+ return new CipherSuiteList (listBuf, version ());
}
- ProtocolVersion getVersion()
+ public CompressionMethodList compressionMethods()
{
- return version;
+ int offset = getCompressionMethodsOffset ();
+ ByteBuffer listBuf = ((ByteBuffer) buffer.duplicate ().position (offset)
+ .limit (buffer.capacity ())).slice ();
+ return new CompressionMethodList (listBuf);
+ }
+
+ public boolean hasExtensions()
+ {
+ int offset = getExtensionsOffset();
+ return (offset + 1 < buffer.limit());
}
- Random getRandom()
+ public ExtensionList extensions()
+ {
+ int offset = getExtensionsOffset ();
+ if (offset + 1 >= buffer.limit())
+ return null;
+ int len = buffer.getShort(offset) & 0xFFFF;
+ if (len == 0)
+ len = buffer.limit() - offset - 2;
+ ByteBuffer ebuf = ((ByteBuffer) buffer.duplicate().position(offset)
+ .limit(offset + len + 2)).slice ();
+ return new ExtensionList(ebuf);
+ }
+
+ public int extensionsLength()
{
- return random;
+ if (hasExtensions())
+ return 0;
+ return buffer.getShort(getExtensionsOffset()) & 0xFFFF;
}
- byte[] getSessionId()
+ protected int getCipherSuitesOffset ()
{
- return sessionId;
+ return (SESSID_OFFSET2 + (buffer.get (SESSID_OFFSET) & 0xFF));
}
- List getCipherSuites()
+ protected int getCompressionMethodsOffset ()
{
- return suites;
+ int csOffset = getCipherSuitesOffset ();
+ int csLen = buffer.getShort (csOffset) & 0xFFFF;
+ return csOffset + csLen + 2;
}
- List getCompressionMethods()
+ protected int getExtensionsOffset ()
{
- return comp;
+ int cmOffset = getCompressionMethodsOffset ();
+ return (buffer.get (cmOffset) & 0xFF) + cmOffset + 1;
}
- List getExtensions()
+ public String toString ()
{
- return extensions;
+ return toString (null);
}
- public String toString()
+ public String toString (final String prefix)
{
- StringWriter str = new StringWriter();
- PrintWriter out = new PrintWriter(str);
- out.println("struct {");
- out.println(" version = " + version + ";");
- BufferedReader r = new BufferedReader(new StringReader(random.toString()));
- String s;
- try
- {
- while ((s = r.readLine()) != null)
- {
- out.print(" ");
- out.println(s);
- }
- }
- catch (IOException ignored)
- {
- }
- out.println(" sessionId = " + Util.toHexString(sessionId, ':') + ";");
- out.println(" cipherSuites = {");
- for (Iterator i = suites.iterator(); i.hasNext(); )
- {
- out.print(" ");
- out.println(i.next());
- }
- out.println(" };");
- out.print(" compressionMethods = { ");
- for (Iterator i = comp.iterator(); i.hasNext(); )
- {
- out.print(i.next());
- if (i.hasNext())
- out.print(", ");
- }
- out.println(" };");
- if (extensions != null)
- {
- out.println(" extensions = {");
- for (Iterator i = extensions.iterator(); i.hasNext(); )
- {
- r = new BufferedReader(new StringReader(i.next().toString()));
- try
- {
- while ((s = r.readLine()) != null)
- {
- out.print(" ");
- out.println(s);
- }
- }
- catch (IOException ignored)
- {
- }
- }
- out.println(" };");
- }
- out.println("} ClientHello;");
+ StringWriter str = new StringWriter ();
+ PrintWriter out = new PrintWriter (str);
+ String subprefix = " ";
+ if (prefix != null)
+ subprefix += prefix;
+ if (prefix != null)
+ out.print (prefix);
+ out.println ("struct {");
+ if (prefix != null)
+ out.print (prefix);
+ out.print (" version: ");
+ out.print (version ());
+ out.println (";");
+ out.print (subprefix);
+ out.println ("random:");
+ out.print (random ().toString (subprefix));
+ if (prefix != null)
+ out.print (prefix);
+ out.print (" sessionId: ");
+ out.print (Util.toHexString (sessionId (), ':'));
+ out.println (";");
+ out.print (subprefix);
+ out.println ("cipher_suites:");
+ out.println (cipherSuites ().toString (subprefix));
+ out.print (subprefix);
+ out.println ("compression_methods:");
+ out.println (compressionMethods ().toString (subprefix));
+ out.print (subprefix);
+ out.print ("extensions: ");
+ ExtensionList el = extensions();
+ out.println (el != null ? el.toString(subprefix+" ") : "(nil)");
+ if (prefix != null)
+ out.print (prefix);
+ out.print ("} ClientHello;");
return str.toString();
}
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ClientHelloBuilder.java b/libjava/classpath/gnu/javax/net/ssl/provider/ClientHelloBuilder.java
new file mode 100644
index 00000000000..81e3dd72f71
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ClientHelloBuilder.java
@@ -0,0 +1,137 @@
+/* ClientHelloBuilder.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.nio.ByteBuffer;
+import java.util.List;
+
+/**
+ * Builder for {@link ClientHello} objects.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class ClientHelloBuilder extends ClientHello implements Builder
+{
+ public ClientHelloBuilder()
+ {
+ super(ByteBuffer.allocate(256));
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Builder#buffer()
+ */
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().position(0).limit(length());
+ }
+
+ public void setVersion(final ProtocolVersion version)
+ {
+ ensureCapacity(2);
+ buffer.putShort(0, (short) version.rawValue ());
+ }
+
+ public void setSessionId (final byte[] buffer)
+ {
+ setSessionId(buffer, 0, buffer.length);
+ }
+
+ public void setSessionId (final byte[] buffer, final int offset, final int length)
+ {
+ ensureCapacity(SESSID_OFFSET2 + length);
+ int len = Math.min (32, length);
+ this.buffer.put (SESSID_OFFSET, (byte) len);
+ this.buffer.position (SESSID_OFFSET2);
+ this.buffer.put (buffer, offset, len);
+ }
+
+ public void setCipherSuites(List<CipherSuite> suites)
+ {
+ int off = getCipherSuitesOffset();
+ ensureCapacity(off + (2 * suites.size()) + 2);
+ buffer.putShort(off, (short) (suites.size() * 2));
+ int i = 2;
+ for (CipherSuite suite : suites)
+ {
+ ((ByteBuffer) buffer.duplicate().position(off+i)).put(suite.id());
+ i += 2;
+ }
+ }
+
+ public void setCompressionMethods(List<CompressionMethod> methods)
+ {
+ int off = getCompressionMethodsOffset();
+ ensureCapacity(off + methods.size() + 1);
+ buffer.put(off, (byte) methods.size());
+ for (CompressionMethod method : methods)
+ buffer.put(++off, (byte) method.getValue());
+ }
+
+ public void setExtensionsLength (final int length)
+ {
+ if (length < 0 || length > 16384)
+ throw new IllegalArgumentException("length must be nonnegative and not exceed 16384");
+ int needed = getExtensionsOffset() + 2 + length;
+ if (buffer.capacity() < needed)
+ ensureCapacity(needed);
+ buffer.putShort(getExtensionsOffset(), (short) length);
+ }
+
+ public void setExtensions(ByteBuffer extensions)
+ {
+ int elen = extensions.getShort(0) & 0xFFFF;
+ setExtensionsLength(elen);
+ ((ByteBuffer) buffer.duplicate().position(getExtensionsOffset())).put(extensions);
+ }
+
+ public void setDisableExtensions(boolean disableExtensions)
+ {
+ this.disableExtensions = disableExtensions;
+ }
+
+ public void ensureCapacity(final int length)
+ {
+ if (buffer.capacity() >= length)
+ return;
+ ByteBuffer newBuf = ByteBuffer.allocate(length);
+ newBuf.put((ByteBuffer) buffer.position(0));
+ newBuf.position(0);
+ this.buffer = newBuf;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ClientHelloV2.java b/libjava/classpath/gnu/javax/net/ssl/provider/ClientHelloV2.java
new file mode 100644
index 00000000000..a514d9ad37c
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ClientHelloV2.java
@@ -0,0 +1,158 @@
+/* ClientHelloV2.java -- a hello message from SSLv2.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A client hello message from SSLv2. In SSLv3 and later, clients can
+ * send an SSLv2 client hello message, but set the protocol version
+ * for a later version.
+ *
+ * <p>The format of a version 2 client hello is:
+ *
+ * <pre>
+ char MSG-CLIENT-HELLO // equals 1
+ char CLIENT-VERSION-MSB
+ char CLIENT-VERSION-LSB
+ char CIPHER-SPECS-LENGTH-MSB
+ char CIPHER-SPECS-LENGTH-LSB
+ char SESSION-ID-LENGTH-MSB
+ char SESSION-ID-LENGTH-LSB
+ char CHALLENGE-LENGTH-MSB
+ char CHALLENGE-LENGTH-LSB
+ char CIPHER-SPECS-DATA[(MSB&lt;&lt;8)|LSB]
+ char SESSION-ID-DATA[(MSB&lt;&lt;8)|LSB]
+ char CHALLENGE-DATA[(MSB&lt;&lt;8)|LSB]</pre>
+ */
+class ClientHelloV2 implements Constructed
+{
+ private final ByteBuffer buffer;
+
+ ClientHelloV2 (final ByteBuffer buffer)
+ {
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ }
+
+ public int length ()
+ {
+ return 9 + cipherSpecsLength () + sessionIdLength () + challengeLength ();
+ }
+
+ ProtocolVersion version ()
+ {
+ return ProtocolVersion.getInstance (buffer.getShort (1));
+ }
+
+ int cipherSpecsLength ()
+ {
+ return buffer.getShort (3) & 0xFFFF;
+ }
+
+ int sessionIdLength ()
+ {
+ return buffer.getShort (5) & 0xFFFF;
+ }
+
+ int challengeLength ()
+ {
+ return buffer.getShort (7) & 0xFFFF;
+ }
+
+ public List<CipherSuite> cipherSpecs ()
+ {
+ int n = cipherSpecsLength ();
+ List<CipherSuite> l = new ArrayList<CipherSuite>(n / 3);
+ ByteBuffer b = (ByteBuffer) buffer.duplicate ().position (9);
+ for (int i = 0; i < n; i += 3)
+ {
+ if (b.get () == 0)
+ l.add (CipherSuite.forValue(b.getShort()).resolve());
+ else
+ b.getShort ();
+ }
+ return l;
+ }
+
+ byte[] sessionId ()
+ {
+ byte[] id = new byte[sessionIdLength ()];
+ ((ByteBuffer) buffer.duplicate ().position (9 + cipherSpecsLength ())).get (id);
+ return id;
+ }
+
+ byte[] challenge ()
+ {
+ byte[] challenge = new byte[challengeLength ()];
+ ((ByteBuffer) buffer.duplicate ().position (9 + cipherSpecsLength () + sessionIdLength ())).get (challenge);
+ return challenge;
+ }
+
+ public String toString ()
+ {
+ return toString (null);
+ }
+
+ public String toString (String prefix)
+ {
+ StringWriter str = new StringWriter ();
+ PrintWriter out = new PrintWriter (str);
+
+ if (prefix != null) out.print (prefix);
+ out.println ("CLIENT-HELLO-MSG");
+ if (prefix != null) out.print (prefix);
+ out.print (" version: ");
+ out.println (version ());
+ if (prefix != null) out.print (prefix);
+ out.println (" suites: ");
+ out.println (cipherSpecs ());
+ if (prefix != null) out.print (prefix);
+ out.print (" sessionId: ");
+ out.println (Util.toHexString (sessionId (), ':'));
+ if (prefix != null) out.print (prefix);
+ out.print (" challenge: ");
+ out.println (Util.toHexString (challenge (), ':'));
+ return str.toString ();
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ClientKeyExchange.java b/libjava/classpath/gnu/javax/net/ssl/provider/ClientKeyExchange.java
index 828aa8d5e93..2006e73850b 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/ClientKeyExchange.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ClientKeyExchange.java
@@ -38,143 +38,94 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
-import java.io.BufferedReader;
-import java.io.DataInputStream;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
import java.io.PrintWriter;
-import java.io.StringReader;
import java.io.StringWriter;
-import java.math.BigInteger;
-
-import java.security.PublicKey;
-import java.security.interfaces.RSAKey;
-import javax.crypto.interfaces.DHPublicKey;
-
-final class ClientKeyExchange implements Handshake.Body
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+/**
+ * The client key exchange message.
+ *
+ * <pre>
+struct {
+ select (KeyExchangeAlgorithm) {
+ case rsa: EncryptedPreMasterSecret;
+ case diffie_hellman: ClientDiffieHellmanPublic;
+ } exchange_keys;
+} ClientKeyExchange;</pre>
+ */
+public class ClientKeyExchange implements Handshake.Body
{
// Fields.
// -------------------------------------------------------------------------
- private final Object exObject;
+ protected ByteBuffer buffer;
+ protected final CipherSuite suite;
+ protected final ProtocolVersion version;
// Constructors.
// -------------------------------------------------------------------------
- ClientKeyExchange(byte[] encryptedSecret)
- {
- exObject = encryptedSecret;
- }
-
- ClientKeyExchange(BigInteger bigint)
- {
- exObject = bigint;
- }
-
- // Class method.
- // -------------------------------------------------------------------------
-
- static ClientKeyExchange read(InputStream in, CipherSuite suite,
- PublicKey key)
- throws IOException
+ public ClientKeyExchange (final ByteBuffer buffer, final CipherSuite suite,
+ final ProtocolVersion version)
{
- DataInputStream din = new DataInputStream(in);
- if (suite.getKeyExchange().equals("RSA"))
- {
- int len = 0;
- if (suite.getVersion() == ProtocolVersion.SSL_3)
- {
- len = (((RSAKey) key).getModulus().bitLength()+7) / 8;
- }
- else
- {
- len = din.readUnsignedShort();
- }
- byte[] buf = new byte[len];
- din.readFully(buf);
- return new ClientKeyExchange(buf);
- }
- else if (suite.getKeyExchange().equals("SRP"))
- {
- byte[] buf = new byte[din.readUnsignedShort()];
- din.readFully(buf);
- return new ClientKeyExchange(new BigInteger(1, buf));
- }
- else if (key == null || !(key instanceof DHPublicKey)) // explicit.
- {
- byte[] buf = new byte[din.readUnsignedShort()];
- din.readFully(buf);
- return new ClientKeyExchange(new BigInteger(1, buf));
- }
- else
- {
- return new ClientKeyExchange(new byte[0]);
- }
+ suite.getClass();
+ version.getClass ();
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ this.suite = suite;
+ this.version = version;
}
// Instance methods.
// -------------------------------------------------------------------------
- public void write(OutputStream out) throws IOException
+ public ExchangeKeys exchangeKeys ()
{
- throw new UnsupportedOperationException("use write(java.io.OutputStream,ProtocolVersion) instead");
+ KeyExchangeAlgorithm alg = suite.keyExchangeAlgorithm();
+ if (alg == KeyExchangeAlgorithm.RSA)
+ return new EncryptedPreMasterSecret(buffer, version);
+ else if (alg == KeyExchangeAlgorithm.DH_anon
+ || alg == KeyExchangeAlgorithm.DHE_DSS
+ || alg == KeyExchangeAlgorithm.DHE_RSA)
+ return new ClientDiffieHellmanPublic(buffer.duplicate());
+ else if (alg == KeyExchangeAlgorithm.DHE_PSK)
+ return new ClientDHE_PSKParameters(buffer.duplicate());
+ else if (alg == KeyExchangeAlgorithm.PSK)
+ return new ClientPSKParameters(buffer.duplicate());
+ else if (alg == KeyExchangeAlgorithm.RSA_PSK)
+ return new ClientRSA_PSKParameters(buffer.duplicate());
+ else if (alg == KeyExchangeAlgorithm.NONE)
+ return new EmptyExchangeKeys();
+ throw new IllegalArgumentException("unsupported key exchange: " + alg);
}
- public void write(OutputStream out, ProtocolVersion version) throws IOException
+ public int length()
{
- if (exObject instanceof byte[])
- {
- byte[] b = (byte[]) exObject;
- if (b.length > 0)
- {
- if (version != ProtocolVersion.SSL_3)
- {
- out.write(b.length >>> 8 & 0xFF);
- out.write(b.length & 0xFF);
- }
- out.write(b);
- }
- }
- else
- {
- byte[] bigint = ((BigInteger) exObject).toByteArray();
- if (bigint[0] == 0x00)
- {
- out.write(bigint.length - 1 >>> 8 & 0xFF);
- out.write(bigint.length - 1 & 0xFF);
- out.write(bigint, 1, bigint.length - 1);
- }
- else
- {
- out.write(bigint.length >>> 8 & 0xFF);
- out.write(bigint.length & 0xFF);
- out.write(bigint);
- }
- }
+ if (suite.keyExchangeAlgorithm() == KeyExchangeAlgorithm.NONE)
+ return 0;
+ return exchangeKeys().length();
}
- Object getExchangeObject()
+ public String toString ()
{
- return exObject;
+ return toString (null);
}
- public String toString()
+ public String toString (final String prefix)
{
StringWriter str = new StringWriter();
PrintWriter out = new PrintWriter(str);
+ if (prefix != null)
+ out.print (prefix);
out.println("struct {");
- if (exObject instanceof byte[] && ((byte[]) exObject).length > 0)
- {
- out.println(" encryptedPreMasterSecret =");
- out.print(Util.hexDump((byte[]) exObject, " "));
- }
- else if (exObject instanceof BigInteger)
- {
- out.println(" clientPublic = " + ((BigInteger) exObject).toString(16) + ";");
- }
+ String subprefix = " ";
+ if (prefix != null)
+ subprefix = prefix + subprefix;
+ out.println (exchangeKeys ().toString (subprefix));
+ if (prefix != null)
+ out.print (prefix);
out.println("} ClientKeyExchange;");
return str.toString();
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ClientKeyExchangeBuilder.java b/libjava/classpath/gnu/javax/net/ssl/provider/ClientKeyExchangeBuilder.java
new file mode 100644
index 00000000000..ebebdcc0e03
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ClientKeyExchangeBuilder.java
@@ -0,0 +1,75 @@
+/* ClientKeyExchangeBuilder.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.nio.ByteBuffer;
+
+/**
+ * Builder for {@link ClientKeyExchange} objects.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class ClientKeyExchangeBuilder extends ClientKeyExchange
+ implements Builder
+{
+ public ClientKeyExchangeBuilder(CipherSuite suite, ProtocolVersion version)
+ {
+ super(ByteBuffer.allocate(512), suite, version);
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Builder#buffer()
+ */
+ public ByteBuffer buffer()
+ {
+ return ((ByteBuffer) buffer.duplicate().position(0).limit(length())).slice();
+ }
+
+ public void setExchangeKeys(ByteBuffer exchangeKeys)
+ {
+ // For SSLv3 and RSA key exchange, the message is sent without length.
+ // So we use the precise capacity of the buffer to signal the size of
+ // the message.
+ if (buffer.capacity() < exchangeKeys.remaining()
+ || (suite.keyExchangeAlgorithm() == KeyExchangeAlgorithm.RSA
+ && version == ProtocolVersion.SSL_3))
+ buffer = ByteBuffer.allocate(exchangeKeys.remaining());
+ ((ByteBuffer) buffer.duplicate().position(0)).put(exchangeKeys);
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ClientPSKParameters.java b/libjava/classpath/gnu/javax/net/ssl/provider/ClientPSKParameters.java
new file mode 100644
index 00000000000..676a872f925
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ClientPSKParameters.java
@@ -0,0 +1,125 @@
+/* ClientPSKParameters.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.classpath.debug.Component;
+import gnu.classpath.debug.SystemLogger;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+
+/**
+ * <pre>
+ struct {
+ select (KeyExchangeAlgorithm) {
+ /* other cases for rsa, diffie_hellman, etc. &#42;/
+ case psk: /* NEW &#42;/
+ opaque psk_identity&lt;0..2^16-1&gt;;
+ } exchange_keys;
+ } ClientKeyExchange;</pre>
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class ClientPSKParameters extends ExchangeKeys implements Builder, Constructed
+{
+ public ClientPSKParameters(ByteBuffer buffer)
+ {
+ super(buffer);
+ }
+
+ public ClientPSKParameters(String identity)
+ {
+ super(null);
+ Charset utf8 = Charset.forName("UTF-8");
+ ByteBuffer idBuf = utf8.encode(CharBuffer.wrap(identity));
+ buffer = ByteBuffer.allocate(idBuf.remaining() + 2);
+ buffer.putShort((short) idBuf.remaining());
+ buffer.put(idBuf);
+ buffer.rewind();
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Builder#buffer()
+ */
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().rewind().limit(length());
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Constructed#length()
+ */
+ public int length()
+ {
+ return (buffer.getShort(0) & 0xFFFF) + 2;
+ }
+
+ public String identity()
+ {
+ Charset utf8 = Charset.forName("UTF-8");
+ return utf8.decode((ByteBuffer) buffer.duplicate().position(2).limit(length())).toString();
+ }
+
+ public @Override String toString()
+ {
+ return toString(null);
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Constructed#toString(java.lang.String)
+ */
+ public String toString(String prefix)
+ {
+ StringWriter str = new StringWriter();
+ PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print(prefix);
+ out.println("struct {");
+ if (prefix != null) out.print(prefix);
+ out.print(" identity = ");
+ out.print(identity());
+ out.println(";");
+ if (prefix != null) out.print(prefix);
+ out.print("} ClientPSKParameters;");
+ return str.toString();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ClientRSA_PSKParameters.java b/libjava/classpath/gnu/javax/net/ssl/provider/ClientRSA_PSKParameters.java
new file mode 100644
index 00000000000..f7483a94c30
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ClientRSA_PSKParameters.java
@@ -0,0 +1,126 @@
+/* ClientRSA_PSKParameters.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.classpath.debug.Component;
+import gnu.classpath.debug.SystemLogger;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.charset.Charset;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class ClientRSA_PSKParameters extends ExchangeKeys implements Builder, Constructed
+{
+ public ClientRSA_PSKParameters(ByteBuffer buffer)
+ {
+ super(buffer);
+ }
+
+ public ClientRSA_PSKParameters(String identity, ByteBuffer epms)
+ {
+ super(null);
+ Charset utf8 = Charset.forName("UTF-8");
+ ByteBuffer idBuf = utf8.encode(identity);
+ buffer = ByteBuffer.allocate(2 + idBuf.remaining() + epms.remaining());
+ buffer.putShort((short) idBuf.remaining());
+ buffer.put(idBuf);
+ buffer.put(epms);
+ buffer.rewind();
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Builder#buffer()
+ */
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().rewind().limit(length());
+ }
+
+ public String identity()
+ {
+ Charset utf8 = Charset.forName("UTF-8");
+ return utf8.decode((ByteBuffer) buffer.duplicate().position(2).limit
+ (identityLength())).toString();
+ }
+
+ private int identityLength()
+ {
+ return (buffer.getShort(0) & 0xFFFF) + 2;
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Constructed#length()
+ */
+ public int length()
+ {
+ return identityLength() + secret().length();
+ }
+
+ public EncryptedPreMasterSecret secret()
+ {
+ return new EncryptedPreMasterSecret
+ (((ByteBuffer) buffer.duplicate().position(identityLength())
+ .limit(buffer.capacity())).slice(), ProtocolVersion.TLS_1);
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Constructed#toString(java.lang.String)
+ */
+ public String toString(String prefix)
+ {
+ StringWriter str = new StringWriter();
+ PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print(prefix);
+ out.println("struct {");
+ if (prefix != null) out.print(prefix);
+ out.print(" identity = ");
+ out.print(identity());
+ if (prefix != null) out.print(prefix);
+ out.println(" encrypted_pre_master_secret =");
+ out.println(secret().toString(prefix != null ? prefix + " " : " "));
+ if (prefix != null) out.print(prefix);
+ out.print("} ClientRSA_PSKParameters;");
+ return str.toString();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/CompressionMethod.java b/libjava/classpath/gnu/javax/net/ssl/provider/CompressionMethod.java
index c2fdf05f9a3..6c57e840c65 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/CompressionMethod.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/CompressionMethod.java
@@ -1,4 +1,4 @@
-/* CompressionMethod.java -- the compression method enum.
+/* CompressionMethod.java -- The CompressionMethod enum.
Copyright (C) 2006 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -38,67 +38,32 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
-import java.io.EOFException;
-import java.io.InputStream;
-import java.io.IOException;
-
-final class CompressionMethod implements Enumerated
+public enum CompressionMethod
{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- static final CompressionMethod NULL = new CompressionMethod(0),
- ZLIB = new CompressionMethod(1);
+ NULL (0), ZLIB(1);
private final int value;
- // Constructor.
- // -------------------------------------------------------------------------
-
private CompressionMethod(int value)
{
this.value = value;
}
- // Class method.
- // -------------------------------------------------------------------------
-
- static CompressionMethod read(InputStream in) throws IOException
+ public static CompressionMethod getInstance (final int value)
{
- int value = in.read();
- if (value == -1)
- {
- throw new EOFException("unexpected end of input stream");
- }
switch (value & 0xFF)
{
case 0: return NULL;
case 1: return ZLIB;
- default: return new CompressionMethod(value);
+
+ // Note: we can't throw an exception here, because we get these values
+ // over the wire, and need to just ignore ones we don't recognize.
+ default: return null;
}
}
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public byte[] getEncoded()
- {
- return new byte[] { (byte) value };
- }
-
public int getValue()
{
return value;
}
-
- public String toString()
- {
- switch (value)
- {
- case 0: return "null";
- case 1: return "zlib";
- default: return "unknown(" + value + ")";
- }
- }
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/CompressionMethodList.java b/libjava/classpath/gnu/javax/net/ssl/provider/CompressionMethodList.java
new file mode 100644
index 00000000000..47ba5484c3f
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/CompressionMethodList.java
@@ -0,0 +1,281 @@
+/* CompressionMethodList.java -- A list of compression methods.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import java.nio.ByteBuffer;
+
+import java.util.ConcurrentModificationException;
+import java.util.ListIterator;
+import java.util.NoSuchElementException;
+
+/**
+ * A basic list interface to a list of compression methods in an SSL
+ * packet.
+ */
+public final class CompressionMethodList implements Iterable<CompressionMethod>
+{
+ private final ByteBuffer buffer;
+ private int modCount;
+
+ public CompressionMethodList (final ByteBuffer buffer)
+ {
+ this.buffer = buffer;
+ modCount = 0;
+ }
+
+ /**
+ * Return the number of elements in this list.
+ *
+ * @return The size of this list.
+ */
+ public int size ()
+ {
+ return (buffer.get (0) & 0xFF);
+ }
+
+ /**
+ * Get the cipher suite at the specified index.
+ *
+ * @param index The index of the suite to get.
+ * @return The cipher suite at that index.
+ * @throws IndexOutOfBoundsException If the index is negative or is
+ * not less than {@link #size()}.
+ */
+ public CompressionMethod get (final int index)
+ {
+ int size = size ();
+ if (index < 0 || index >= size)
+ throw new IndexOutOfBoundsException ("limit: " + size
+ + "; requested: " + index);
+ return CompressionMethod.getInstance (buffer.get (1 + index));
+ }
+
+ /**
+ * Set the CompressionMethod at the specified index. The list must
+ * have sufficient size to hold the element (that is, <code>index
+ * &lt;= size ()</code>).
+ *
+ * @param index The index to put the suite.
+ * @param method The CompressionMethod object.
+ * @throws IndexOutOfBoundsException If <code>index</code> is not
+ * less than @{link #size()}, or if it is negative.
+ * @throws NullPointerException If <code>suite</code> is
+ * <code>null</code>.
+ * @throws java.nio.ReadOnlyBufferException If the underlying buffer
+ * is not writable.
+ */
+ public void put (final int index, final CompressionMethod method)
+ {
+ int size = size ();
+ if (index < 0 || index >= size)
+ throw new IndexOutOfBoundsException ("limit: " + size
+ + "; requested: " + index);
+ buffer.position (1 + index);
+ buffer.put ((byte) method.getValue ());
+ modCount++;
+ }
+
+ /**
+ * Sets the size of this list. You must call this if you are adding
+ * elements to the list; calling {@link
+ * #put(int,gnu.jessie.provider.CipherSuite)} does not expand the
+ * list size (the same goes for removing elements, as there is no
+ * <code>remove</code> method).
+ *
+ * @param newSize The new size of this list.
+ * @throws IllegalArgumentException If the new size is negative or
+ * greater than 32767, or if there is insufficient space for that
+ * many elements in the underlying buffer.
+ * @throws java.nio.ReadOnlyBufferException If the underlying buffer
+ * is not writable.
+ */
+ public void setSize (final int newSize)
+ {
+ if (newSize < 0 || newSize > 255)
+ throw new IllegalArgumentException ("size must be between 0 and 255");
+ if (newSize + 1 > buffer.capacity ())
+ throw new IllegalArgumentException ("limit: " + buffer.capacity ()
+ + "; requested: " + newSize);
+ buffer.put (0, (byte) newSize);
+ modCount++;
+ }
+
+ public String toString ()
+ {
+ return toString (null);
+ }
+
+ public String toString (final String prefix)
+ {
+ StringWriter str = new StringWriter ();
+ PrintWriter out = new PrintWriter (str);
+ if (prefix != null)
+ out.print (prefix);
+ out.print ("[");
+ out.print (size ());
+ out.println ("] {");
+ for (Iterator it = new Iterator (); it.hasNext (); )
+ {
+ CompressionMethod method = (CompressionMethod) it.next ();
+ if (prefix != null)
+ out.print (prefix);
+ out.print (" ");
+ out.print (method);
+ if (it.hasNext ())
+ out.print (",");
+ out.println ();
+ }
+ if (prefix != null)
+ out.print (prefix);
+ out.print ("};");
+ return str.toString ();
+ }
+
+ public boolean equals (Object o)
+ {
+ if (!(o instanceof CompressionMethodList))
+ return false;
+ CompressionMethodList that = (CompressionMethodList) o;
+
+ if (size () != that.size ())
+ return false;
+
+ for (Iterator it1 = new Iterator (), it2 = that.new Iterator ();
+ it1.hasNext () && it2.hasNext (); )
+ {
+ if (!it1.next ().equals (it2.next ()))
+ return false;
+ }
+ return true;
+ }
+
+ public java.util.Iterator<CompressionMethod> iterator ()
+ {
+ return new Iterator ();
+ }
+
+ /**
+ * An iterator for the elements in this list. The iterator supports
+ * only the <code>set</code> method out of the optional methods,
+ * because elements in a CipherSuiteList may not be removed or
+ * added; only the size of the list can be changed, and elements at
+ * a specific index changed.
+ */
+ public class Iterator implements ListIterator<CompressionMethod>
+ {
+ private int index;
+ private final int modCount;
+
+ Iterator ()
+ {
+ index = 0;
+ modCount = CompressionMethodList.this.modCount;
+ }
+
+ public void add (CompressionMethod cm)
+ {
+ throw new UnsupportedOperationException ();
+ }
+
+ public boolean hasNext ()
+ {
+ return (index < size ());
+ }
+
+ public boolean hasPrevious ()
+ {
+ return (index > 0);
+ }
+
+ public CompressionMethod next () throws NoSuchElementException
+ {
+ if (modCount != CompressionMethodList.this.modCount)
+ throw new ConcurrentModificationException ();
+ try
+ {
+ return get (index++);
+ }
+ catch (IndexOutOfBoundsException ioobe)
+ {
+ throw new NoSuchElementException ();
+ }
+ }
+
+ public int nextIndex ()
+ {
+ if (hasNext ())
+ return (index + 1);
+ return -1;
+ }
+
+ public CompressionMethod previous () throws NoSuchElementException
+ {
+ if (index == 0)
+ throw new NoSuchElementException ();
+ if (modCount != CompressionMethodList.this.modCount)
+ throw new ConcurrentModificationException ();
+ try
+ {
+ return get (--index);
+ }
+ catch (IndexOutOfBoundsException ioobe) // on empty list
+ {
+ throw new NoSuchElementException ();
+ }
+ }
+
+ public int previousIndex ()
+ {
+ return (index - 1);
+ }
+
+ public void remove ()
+ {
+ throw new UnsupportedOperationException ();
+ }
+
+ public void set (final CompressionMethod cm)
+ {
+ put (index, cm);
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Constructed.java b/libjava/classpath/gnu/javax/net/ssl/provider/Constructed.java
index ee3f56a7f47..3a3545b226e 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/Constructed.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/Constructed.java
@@ -1,4 +1,4 @@
-/* Constructed.java -- constructed type.
+/* Constructed.java -- Constructed type.
Copyright (C) 2006 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -38,20 +38,49 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
-import java.io.IOException;
-import java.io.OutputStream;
-
/**
* The base interface to SSL constructed types.
+ *
+ * <p><b>Contract for ByteBuffer-based constructed types:</b>
+ *
+ * <p>Most implementations of this interface supported by this library
+ * take a "view" of an underlying ByteBuffer. The general contract of
+ * such classes is that they <em>will not</em> modify the position or
+ * limit of the buffer when doing read operations. That is, the position
+ * of the underlying buffer <em>should</em> remain at 0 throughout the
+ * lifetime of the object, and the limit should be either set to the
+ * capacity of the buffer, or to the size of the object (in most cases,
+ * the length of the protocol object is determined by the contents of
+ * the object, so the limit isn't useful in such cases. Of course, if the
+ * limit is set to something other than the object's length, it must be
+ * larger than the object length).
+ *
+ * <p>Setter methods (usually in a class that implements the {@link Builder}
+ * interface) may modify the limit, but the general contract remains that
+ * the position remain at zero, and that the limit be at least as large as
+ * the object length.
+ *
+ * <p>Thus, very often the code will use <em>absolute</em> getters and setters
+ * for primitive types, or it will use the {@link java.nio.ByteBuffer#duplicate()}
+ * method, and sometimes the {@link java.nio.ByteBuffer#slice()} method, and
+ * will change the position or limit of the duplicate buffer.
*/
-interface Constructed
+public interface Constructed
{
+ /**
+ * Returns the total length, in bytes, of this structure.
+ *
+ * @return The length of this structure.
+ */
+ int length();
/**
- * Writes this structure's encoded form to the given output stream.
+ * Returns a printable representation of this structure, with the
+ * given prefix prepended to each line.
*
- * @param out The output stream.
- * @throws IOException If an I/O error occurs.
+ * @param prefix The prefix to prepend to each line of the
+ * output. This value may be <code>null</code>.
+ * @return A printable representation of this structure.
*/
- void write(OutputStream out) throws IOException;
+ String toString(String prefix);
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ContentType.java b/libjava/classpath/gnu/javax/net/ssl/provider/ContentType.java
index 336809467e4..f7165a2d769 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/ContentType.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ContentType.java
@@ -1,4 +1,4 @@
-/* ContentType.java -- record layer content type.
+/* ContentType.java -- SSL record layer content type.
Copyright (C) 2006 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -45,22 +45,23 @@ import java.io.IOException;
/**
* The content type enumeration, which marks packets in the record layer.
*
- * <pre>enum { change_cipher_spec(20), alert(21), handshake(22),
- * application_data(23), (255) } ContentType;</pre>
+ * <pre>
+enum { change_cipher_spec(20), alert(21), handshake(22),
+ application_data(23), (255) } ContentType;</pre>
+ *
+ * <p>There is also a "pseudo" content type, <code>client_hello_v2
+ * (1)</code>, which is used for backwards compatibility with SSLv2.
*
* @author Casey Marshall (rsdio@metastatic.org)
*/
-final class ContentType implements Enumerated
+public enum ContentType
{
- // Constants and fields.
- // ------------------------------------------------------------------------
-
- static final ContentType CLIENT_HELLO_V2 = new ContentType( 1);
- static final ContentType CHANGE_CIPHER_SPEC = new ContentType(20);
- static final ContentType ALERT = new ContentType(21);
- static final ContentType HANDSHAKE = new ContentType(22);
- static final ContentType APPLICATION_DATA = new ContentType(23);
+ CLIENT_HELLO_V2 ( 1),
+ CHANGE_CIPHER_SPEC (20),
+ ALERT (21),
+ HANDSHAKE (22),
+ APPLICATION_DATA (23);
private int value;
@@ -72,16 +73,8 @@ final class ContentType implements Enumerated
this.value = value;
}
- // Class methods.
- // ------------------------------------------------------------------------
-
- static final ContentType read(InputStream in) throws IOException
+ static final ContentType forInteger (final int value)
{
- int value = in.read();
- if (value == -1)
- {
- throw new EOFException("unexpected end of input stream");
- }
switch (value & 0xFF)
{
case 1: return CLIENT_HELLO_V2;
@@ -89,47 +82,12 @@ final class ContentType implements Enumerated
case 21: return ALERT;
case 22: return HANDSHAKE;
case 23: return APPLICATION_DATA;
- default: return new ContentType(value);
+ default: return null;
}
}
- // Instance methods.
- // ------------------------------------------------------------------------
-
- public byte[] getEncoded()
- {
- return new byte[] { (byte) value };
- }
-
public int getValue()
{
return value;
}
-
- public boolean equals(Object o)
- {
- if (o == null || !(o instanceof ContentType))
- {
- return false;
- }
- return ((ContentType) o).value == value;
- }
-
- public int hashCode()
- {
- return getValue();
- }
-
- public String toString()
- {
- switch (value)
- {
- case 1: return "v2_client_hello";
- case 20: return "change_cipher_spec";
- case 21: return "alert";
- case 22: return "handshake";
- case 23: return "application_data";
- default: return "unknown(" + value + ")";
- }
- }
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Context.java b/libjava/classpath/gnu/javax/net/ssl/provider/Context.java
deleted file mode 100644
index 2bd7193f265..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/Context.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/* Context.java -- SSLContext implementation.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.File;
-import java.io.InputStream;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.KeyStoreException;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.SecureRandom;
-import java.security.Security;
-import java.security.UnrecoverableKeyException;
-import java.sql.SQLException;
-
-import javax.net.ssl.KeyManager;
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLContextSpi;
-import javax.net.ssl.SSLSessionContext;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.TrustManagerFactory;
-import javax.net.ssl.X509KeyManager;
-import javax.net.ssl.X509TrustManager;
-
-import gnu.javax.net.ssl.NullManagerParameters;
-import gnu.javax.net.ssl.SRPTrustManager;
-import gnu.javax.net.ssl.StaticTrustAnchors;
-
-/**
- * This is Jessie's implementation of a {@link javax.net.ssl.SSLContext}
- * engine, and is available under the algorithm names ``SSLv3'', ``SSL'',
- * ``TLSv1'', and ``TLS''.
- */
-public final class Context extends SSLContextSpi
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private SessionContext clientSessions;
- private SessionContext serverSessions;
- private X509KeyManager keyManager;
- private X509TrustManager trustManager;
- private SRPTrustManager srpTrustManager;
- private SecureRandom random;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- public Context()
- {
- String codec = Util.getSecurityProperty("jessie.clientSessionContext.codec");
- String codecClass = null;
- if (codec == null)
- {
- codec = "null";
- }
- if (codec.equalsIgnoreCase("xml"))
- {
- codecClass = "gnu.javax.net.ssl.provider.XMLSessionContext";
- }
- else if (codec.equalsIgnoreCase("jdbc"))
- {
- codecClass = "gnu.javax.net.ssl.provider.JDBCSessionContext";
- }
- else if (codec.equalsIgnoreCase("null"))
- {
- codecClass = "gnu.javax.net.ssl.provider.SessionContext";
- }
- else
- {
- throw new IllegalArgumentException("no such codec: " + codec);
- }
- try
- {
- ClassLoader cl = Context.class.getClassLoader();
- if (cl == null)
- {
- cl = ClassLoader.getSystemClassLoader();
- }
- clientSessions = (SessionContext) cl.loadClass(codecClass).newInstance();
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- throw new IllegalArgumentException(ex.toString());
- }
-
- codec = Util.getSecurityProperty("jessie.serverSessionContext.codec");
- if (codec == null)
- {
- codec = "null";
- }
- if (codec.equalsIgnoreCase("xml"))
- {
- codecClass = "gnu.javax.net.ssl.provider.XMLSessionContext";
- }
- else if (codec.equalsIgnoreCase("jdbc"))
- {
- codecClass = "gnu.javax.net.ssl.provider.JDBCSessionContext";
- }
- else if (codec.equalsIgnoreCase("null"))
- {
- codecClass = "gnu.javax.net.ssl.provider.SessionContext";
- }
- else
- {
- throw new IllegalArgumentException("no such codec: " + codec);
- }
- try
- {
- ClassLoader cl = Context.class.getClassLoader();
- if (cl == null)
- {
- cl = ClassLoader.getSystemClassLoader();
- }
- serverSessions = (SessionContext) cl.loadClass(codecClass).newInstance();
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- throw new IllegalArgumentException(ex.toString());
- }
- }
-
- // Engine methods.
- // -------------------------------------------------------------------------
-
- protected SSLSessionContext engineGetClientSessionContext()
- {
- return clientSessions;
- }
-
- protected SSLSessionContext engineGetServerSessionContext()
- {
- return serverSessions;
- }
-
- protected javax.net.ssl.SSLServerSocketFactory engineGetServerSocketFactory()
- {
- if (keyManager == null || (trustManager == null && srpTrustManager == null)
- || random == null)
- {
- throw new IllegalStateException();
- }
- return new SSLServerSocketFactory(trustManager, srpTrustManager, keyManager,
- random, serverSessions);
- }
-
- protected javax.net.ssl.SSLSocketFactory engineGetSocketFactory()
- {
- if (keyManager == null || trustManager == null || random == null)
- {
- throw new IllegalStateException();
- }
- return new SSLSocketFactory(trustManager, keyManager, random, clientSessions);
- }
-
- protected void engineInit(KeyManager[] keyManagers,
- TrustManager[] trustManagers, SecureRandom random)
- throws KeyManagementException
- {
- keyManager = null;
- trustManager = null;
- srpTrustManager = null;
- if (keyManagers != null)
- {
- for (int i = 0; i < keyManagers.length; i++)
- {
- if (keyManagers[i] instanceof X509KeyManager)
- {
- keyManager = (X509KeyManager) keyManagers[i];
- break;
- }
- }
- }
- if (keyManager == null)
- {
- keyManager = defaultKeyManager();
- }
- if (trustManagers != null)
- {
- for (int i = 0; i < trustManagers.length; i++)
- {
- if (trustManagers[i] instanceof X509TrustManager)
- {
- if (trustManager == null)
- {
- trustManager = (X509TrustManager) trustManagers[i];
- }
- }
- else if (trustManagers[i] instanceof SRPTrustManager)
- {
- if (srpTrustManager == null)
- {
- srpTrustManager = (SRPTrustManager) trustManagers[i];
- }
- }
- }
- }
- if (trustManager == null && srpTrustManager == null)
- {
- trustManager = defaultTrustManager();
- }
- if (random != null)
- {
- this.random = random;
- }
- else
- {
- this.random = defaultRandom();
- }
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private X509KeyManager defaultKeyManager() throws KeyManagementException
- {
- KeyManagerFactory fact = null;
- try
- {
- fact = KeyManagerFactory.getInstance("JessieX509", "Jessie");
- }
- catch (NoSuchAlgorithmException nsae)
- {
- throw new KeyManagementException();
- }
- catch (NoSuchProviderException nspe)
- {
- throw new KeyManagementException();
- }
- try
- {
- fact.init(null, null);
- return (X509KeyManager) fact.getKeyManagers()[0];
- }
- catch (NoSuchAlgorithmException nsae) { }
- catch (KeyStoreException kse) { }
- catch (UnrecoverableKeyException uke) { }
- catch (IllegalStateException ise) { }
-
- try
- {
- fact.init(new NullManagerParameters());
- return (X509KeyManager) fact.getKeyManagers()[0];
- }
- catch (Exception shouldNotHappen)
- {
- throw new Error(shouldNotHappen.toString());
- }
- }
-
- private X509TrustManager defaultTrustManager() throws KeyManagementException
- {
- try
- {
- TrustManagerFactory fact =
- TrustManagerFactory.getInstance("JessieX509", "Jessie");
- fact.init(StaticTrustAnchors.CA_CERTS);
- return (X509TrustManager) fact.getTrustManagers()[0];
- }
- catch (NoSuchAlgorithmException nsae)
- {
- throw new KeyManagementException(nsae.toString());
- }
- catch (NoSuchProviderException nspe)
- {
- throw new KeyManagementException(nspe.toString());
- }
- catch (InvalidAlgorithmParameterException kse)
- {
- throw new KeyManagementException(kse.toString());
- }
- }
-
- private SecureRandom defaultRandom() throws KeyManagementException
- {
- String alg = Util.getSecurityProperty("jessie.secure.random");
- if (alg == null)
- {
- alg = "Fortuna";
- }
- SecureRandom rand = null;
- try
- {
- rand = SecureRandom.getInstance(alg);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- throw new KeyManagementException(nsae.toString());
- }
-
- return rand;
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Debug.java b/libjava/classpath/gnu/javax/net/ssl/provider/Debug.java
new file mode 100644
index 00000000000..6d0f7c3a519
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/Debug.java
@@ -0,0 +1,66 @@
+/* Debug.java -- Jessie debug constants.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+/**
+ * Debug constants for Jessie.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public final class Debug
+{
+ /**
+ * Set to true to dump out traces of SSL connections to the system
+ * logger.
+ */
+ public static final boolean DEBUG = true;
+
+ /**
+ * Set to true to dump out info about the SSL key exchange. Since this
+ * MAY contain sensitive data, it is a separate value.
+ */
+ public static final boolean DEBUG_KEY_EXCHANGE = true;
+
+ /**
+ * Set to true to turn on dumping of decrypted packets. Since this will
+ * log potentially-sensitive information (i.e., decrypted messages), only
+ * enable this in debug scenarios.
+ */
+ public static final boolean DEBUG_DECRYPTION = false;
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/DelegatedTask.java b/libjava/classpath/gnu/javax/net/ssl/provider/DelegatedTask.java
new file mode 100644
index 00000000000..200d4d457cf
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/DelegatedTask.java
@@ -0,0 +1,93 @@
+/* DelegatedTask.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.classpath.debug.Component;
+import gnu.classpath.debug.SystemLogger;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public abstract class DelegatedTask implements Runnable
+{
+ private static final SystemLogger logger = SystemLogger.SYSTEM;
+ private boolean hasRun;
+ protected Throwable thrown;
+
+ protected DelegatedTask()
+ {
+ hasRun = false;
+ }
+
+ public final void run()
+ {
+ if (hasRun)
+ throw new IllegalStateException("task already ran");
+ try
+ {
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_DELEGATED_TASK,
+ "running delegated task {0} in {1}", this,
+ Thread.currentThread());
+ implRun();
+ }
+ catch (Throwable t)
+ {
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_DELEGATED_TASK, "task threw exception", t);
+ thrown = t;
+ }
+ finally
+ {
+ hasRun = true;
+ }
+ }
+
+ public final boolean hasRun()
+ {
+ return hasRun;
+ }
+
+ public final Throwable thrown()
+ {
+ return thrown;
+ }
+
+ protected abstract void implRun() throws Throwable;
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/DiffieHellman.java b/libjava/classpath/gnu/javax/net/ssl/provider/DiffieHellman.java
index ad48c795906..5a5275712a0 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/DiffieHellman.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/DiffieHellman.java
@@ -39,6 +39,9 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
import java.math.BigInteger;
+import java.security.AccessController;
+
+import gnu.java.security.action.GetSecurityPropertyAction;
import gnu.javax.crypto.key.dh.GnuDHPrivateKey;
/**
@@ -72,7 +75,8 @@ final class DiffieHellman
static GnuDHPrivateKey getParams()
{
BigInteger p = DiffieHellman.GROUP_5;
- String group = Util.getSecurityProperty("jessie.key.dh.group");
+ String group = AccessController.doPrivileged
+ (new GetSecurityPropertyAction("jessie.key.dh.group"));
if (group != null)
{
group = group.trim();
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/DigestInputStream.java b/libjava/classpath/gnu/javax/net/ssl/provider/DigestInputStream.java
deleted file mode 100644
index dd138b436a1..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/DigestInputStream.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* DigestInputStream.java -- digesting input stream.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.FilterInputStream;
-import java.io.InputStream;
-import java.io.IOException;
-
-import gnu.java.security.hash.IMessageDigest;
-
-final class DigestInputStream extends FilterInputStream
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private IMessageDigest md5, sha;
- private boolean digesting;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- DigestInputStream(InputStream in, IMessageDigest md5, IMessageDigest sha)
- {
- super(in);
- if (md5 == null || sha == null)
- throw new NullPointerException();
- this.md5 = md5;
- this.sha = sha;
- digesting = true;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- void setDigesting(boolean digesting)
- {
- this.digesting = digesting;
- }
-
- public int read() throws IOException
- {
- int i = in.read();
- if (digesting && i != -1)
- {
- md5.update((byte) i);
- sha.update((byte) i);
- }
- return i;
- }
-
- public int read(byte[] buf) throws IOException
- {
- return read(buf, 0, buf.length);
- }
-
- public int read(byte[] buf, int off, int len) throws IOException
- {
- int ret = in.read(buf, off, len);
- if (digesting && ret != -1)
- {
- md5.update(buf, off, ret);
- sha.update(buf, off, ret);
- }
- return ret;
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/DigestOutputStream.java b/libjava/classpath/gnu/javax/net/ssl/provider/DigestOutputStream.java
deleted file mode 100644
index f1548459e8c..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/DigestOutputStream.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* DigestOutputStream.java -- digesting output stream.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import gnu.java.security.hash.IMessageDigest;
-
-final class DigestOutputStream extends FilterOutputStream
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private IMessageDigest md5, sha;
- private boolean digesting;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- DigestOutputStream(OutputStream out, IMessageDigest md5, IMessageDigest sha)
- {
- super(out);
- this.md5 = md5;
- this.sha = sha;
- digesting = true;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- void setDigesting(boolean digesting)
- {
- this.digesting = digesting;
- }
-
- public void write(int b) throws IOException
- {
- if (digesting)
- {
- md5.update((byte) b);
- sha.update((byte) b);
- }
- out.write(b);
- }
-
- public void write(byte[] buf) throws IOException
- {
- write(buf, 0, buf.length);
- }
-
- public void write(byte[] buf, int off, int len) throws IOException
- {
- if (buf == null)
- {
- throw new NullPointerException();
- }
- if (off < 0 || len < 0 || off+len > buf.length)
- {
- throw new ArrayIndexOutOfBoundsException();
- }
- if (digesting)
- {
- md5.update(buf, off, len);
- sha.update(buf, off, len);
- }
- out.write(buf, off, len);
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/EmptyExchangeKeys.java b/libjava/classpath/gnu/javax/net/ssl/provider/EmptyExchangeKeys.java
new file mode 100644
index 00000000000..acf4cfa03a9
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/EmptyExchangeKeys.java
@@ -0,0 +1,77 @@
+/* EmptyExchangeKeys.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.nio.ByteBuffer;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class EmptyExchangeKeys
+ extends ExchangeKeys
+{
+
+ public EmptyExchangeKeys()
+ {
+ super(ByteBuffer.allocate(0));
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Constructed#length()
+ */
+ public int length()
+ {
+ return 0;
+ }
+
+ public String toString()
+ {
+ return toString(null);
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Constructed#toString(java.lang.String)
+ */
+ public String toString(String prefix)
+ {
+ String ret = "struct { };";
+ if (prefix != null) ret = prefix + ret;
+ return ret;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/EncryptedPreMasterSecret.java b/libjava/classpath/gnu/javax/net/ssl/provider/EncryptedPreMasterSecret.java
new file mode 100644
index 00000000000..ea7439bd2c6
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/EncryptedPreMasterSecret.java
@@ -0,0 +1,151 @@
+/* EncryptedPreMasterSecret.java -- RSA encrypted secret.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.classpath.debug.Component;
+import gnu.classpath.debug.SystemLogger;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import java.nio.ByteBuffer;
+
+/**
+ * The client's RSA-encrypted pre-master secret.
+ *
+ * <pre>
+struct {
+ public-key-encrypted PreMasterSecret pre_master_secret;
+} EncryptedPreMasterSecret;</pre>
+ */
+public final class EncryptedPreMasterSecret extends ExchangeKeys implements Builder
+{
+ private final ProtocolVersion version;
+
+ public EncryptedPreMasterSecret(ByteBuffer buffer, ProtocolVersion version)
+ {
+ super(buffer);
+ version.getClass();
+ this.version = version;
+ }
+
+ public EncryptedPreMasterSecret(byte[] encryptedSecret, ProtocolVersion version)
+ {
+ this(ByteBuffer.allocate(version == ProtocolVersion.SSL_3
+ ? encryptedSecret.length
+ : encryptedSecret.length + 2), version);
+ ByteBuffer b = buffer.duplicate();
+ if (version != ProtocolVersion.SSL_3)
+ b.putShort((short) encryptedSecret.length);
+ b.put(encryptedSecret);
+ }
+
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().rewind();
+ }
+
+ public byte[] encryptedSecret()
+ {
+ byte[] secret;
+ if (version == ProtocolVersion.SSL_3)
+ {
+ buffer.position (0);
+ secret = new byte[buffer.limit ()];
+ buffer.get(secret);
+ }
+ else
+ {
+ int len = buffer.getShort(0) & 0xFFFF;
+ secret = new byte[len];
+ buffer.position(2);
+ buffer.get(secret);
+ }
+ return secret;
+ }
+
+ public void setEncryptedSecret(final byte[] secret, final int offset, final int length)
+ {
+ if (version == ProtocolVersion.SSL_3)
+ {
+ buffer.position(0);
+ buffer.put(secret, offset, length);
+ buffer.rewind();
+ }
+ else
+ {
+ buffer.putShort(0, (short) length);
+ buffer.position(2);
+ buffer.put(secret, offset, length);
+ buffer.rewind();
+ }
+ }
+
+ public int length ()
+ {
+ if (version == ProtocolVersion.SSL_3)
+ {
+ return buffer.capacity();
+ }
+ else
+ {
+ return (buffer.getShort(0) & 0xFFFF) + 2;
+ }
+ }
+
+ public String toString ()
+ {
+ return toString (null);
+ }
+
+ public String toString (final String prefix)
+ {
+ StringWriter str = new StringWriter();
+ PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print(prefix);
+ out.println("struct {");
+ if (prefix != null) out.print(prefix);
+ out.println(" pre_master_secret = ");
+ out.print(Util.hexDump(encryptedSecret(), prefix != null ? prefix + " "
+ : " "));
+ if (prefix != null) out.print(prefix);
+ out.print("} EncryptedPreMasterSecret;");
+ return str.toString();
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Enumerated.java b/libjava/classpath/gnu/javax/net/ssl/provider/Enumerated.java
deleted file mode 100644
index 8875addab3f..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/Enumerated.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Enumerated.java -- Interface to enumerated types.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-/**
- * An enumerated type in the SSL protocols. Enumerated values take on
- * one of a set of possible numeric values, which are not specifically
- * ordered, and may be extensible to a maximum value.
- *
- * <pre>enum { e1(v1), e2(v2), ... [[, (n) ]] }</pre>
- *
- * <p>Enumerated types are encoded as big-endian multibyte integers,
- * which take up the least possible number of bytes. Thus, an
- * enumeration with up to 255 values will be encoded in a single byte,
- * and so on.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-interface Enumerated
-{
-
- /**
- * Returns the encoded value of this enumerated value, which is
- * appropriate to send over-the-wire.
- *
- * @return The encoded value.
- */
- byte[] getEncoded();
-
- /**
- * Returns the numeric value of this enumerated value.
- *
- * @return The numeric value.
- */
- int getValue();
-
- /**
- * Returns a string representation of this enumerated value.
- *
- * @return The string.
- */
- String toString();
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ExchangeKeys.java b/libjava/classpath/gnu/javax/net/ssl/provider/ExchangeKeys.java
new file mode 100644
index 00000000000..f161f484a57
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ExchangeKeys.java
@@ -0,0 +1,54 @@
+/* ExchangeKeys.java -- key exchange values.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+public abstract class ExchangeKeys implements Constructed
+{
+
+ protected ByteBuffer buffer;
+
+ public ExchangeKeys (final ByteBuffer buffer)
+ {
+ if (buffer != null)
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Extension.java b/libjava/classpath/gnu/javax/net/ssl/provider/Extension.java
index 1c79dd5cb26..c79e58832b8 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/Extension.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/Extension.java
@@ -38,177 +38,209 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
-import java.io.EOFException;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
-final class Extension implements Constructed
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+/**
+ * An SSL hello extension.
+ *
+ * <pre>
+ * struct {
+ * ExtensionType extension_type;
+ * opaque extension_data<0..2^16-1>;
+ * } Extension;</pre>
+ *
+ * @author csm@gnu.org
+ */
+public final class Extension implements Builder, Constructed
{
// Fields.
// -------------------------------------------------------------------------
- private final Type type;
- private final byte[] value;
+ private ByteBuffer buffer;
// Constructor.
// -------------------------------------------------------------------------
- Extension(Type type, byte[] value)
+ public Extension(final ByteBuffer buffer)
{
- if (type == null || value == null)
- {
- throw new NullPointerException();
- }
- this.type = type;
- this.value = value;
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
}
-
- // Class method.
- // -------------------------------------------------------------------------
-
- static Extension read(InputStream in) throws IOException
+
+ public Extension(final Type type, final Value value)
{
- Type t = Type.read(in);
- int len = (in.read() & 0xFF) << 8 | (in.read() & 0xFF);
- byte[] v = new byte[len];
- int count = 0;
- while (count < len)
- {
- int l = in.read(v, count, len - count);
- if (l == -1)
- {
- throw new EOFException("unexpected end of extension");
- }
- count += l;
- }
- return new Extension(t, v);
+ ByteBuffer valueBuffer = value.buffer();
+ int length = 2 + 2 + valueBuffer.remaining();
+ buffer = ByteBuffer.allocate(length);
+ buffer.putShort((short) type.getValue());
+ buffer.putShort((short) valueBuffer.remaining());
+ buffer.put(valueBuffer);
+ buffer.rewind();
}
// Instance methods.
// -------------------------------------------------------------------------
- public void write(OutputStream out) throws IOException
+ public int length ()
+ {
+ return (buffer.getShort (2) & 0xFFFF) + 4;
+ }
+
+ public ByteBuffer buffer()
{
- out.write(type.getEncoded());
- out.write(value.length >>> 8 & 0xFF);
- out.write(value.length & 0xFF);
- out.write(value);
+ return (ByteBuffer) buffer.duplicate().limit(length());
}
- Type getType()
+ public Type type()
{
- return type;
+ return Type.forValue (buffer.getShort (0) & 0xFFFF);
}
- byte[] getValue()
+ public byte[] valueBytes()
{
+ int len = buffer.getShort (2) & 0xFFFF;
+ byte[] value = new byte[len];
+ ((ByteBuffer) buffer.duplicate ().position (4)).get (value);
return value;
}
+
+ public ByteBuffer valueBuffer()
+ {
+ int len = buffer.getShort(2) & 0xFFFF;
+ return ((ByteBuffer) buffer.duplicate().position(4).limit(len+4)).slice();
+ }
+
+ public Value value()
+ {
+ switch (type ())
+ {
+ case SERVER_NAME:
+ return new ServerNameList(valueBuffer());
+
+ case MAX_FRAGMENT_LENGTH:
+ switch (valueBuffer().get() & 0xFF)
+ {
+ case 1: return MaxFragmentLength.LEN_2_9;
+ case 2: return MaxFragmentLength.LEN_2_10;
+ case 3: return MaxFragmentLength.LEN_2_11;
+ case 4: return MaxFragmentLength.LEN_2_12;
+ default:
+ throw new IllegalArgumentException("invalid max_fragment_len");
+ }
+
+ case TRUNCATED_HMAC:
+ return new TruncatedHMAC();
+
+ case CLIENT_CERTIFICATE_URL:
+ return new CertificateURL(valueBuffer());
+
+ case TRUSTED_CA_KEYS:
+ return new TrustedAuthorities(valueBuffer());
+
+ case STATUS_REQUEST:
+ return new CertificateStatusRequest(valueBuffer());
+
+ case SRP:
+ case CERT_TYPE:
+ }
+ return new UnresolvedExtensionValue(valueBuffer());
+ }
+
+ public void setLength (final int newLength)
+ {
+ if (newLength < 0 || newLength > 65535)
+ throw new IllegalArgumentException ("length is out of bounds");
+ buffer.putShort (2, (short) newLength);
+ }
+
+ public void setType (final Type type)
+ {
+ buffer.putShort(0, (short) type.getValue());
+ }
+ public void setValue (byte[] value)
+ {
+ setValue (value, 0, value.length);
+ }
+
+ public void setValue (final byte[] value, final int offset, final int length)
+ {
+ if (length != length ())
+ throw new IllegalArgumentException ("length is different than claimed length");
+ ((ByteBuffer) buffer.duplicate().position(4)).put(value, offset, length);
+ }
+
public String toString()
{
+ return toString(null);
+ }
+
+ public String toString(String prefix)
+ {
StringWriter str = new StringWriter();
PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print (prefix);
out.println("struct {");
- out.println(" type = " + type + ";");
+ if (prefix != null) out.print (prefix);
+ out.println(" type = " + type () + ";");
+ if (prefix != null) out.print (prefix);
+ String subprefix = " ";
+ if (prefix != null) subprefix = prefix + subprefix;
out.println(" value =");
- out.println(Util.hexDump(value, " "));
- out.println("} Extension;");
+ out.println(value().toString(subprefix));
+ if (prefix != null) out.print (prefix);
+ out.print("} Extension;");
return str.toString();
}
- // Inner class.
+ // Inner classes.
// -------------------------------------------------------------------------
- static final class Type implements Enumerated
+ public static enum Type
{
-
- // Constants and fields.
- // -----------------------------------------------------------------------
-
- static final Type SERVER_NAME = new Type(0);
- static final Type MAX_FRAGMENT_LENGTH = new Type(1);
- static final Type CLIENT_CERTIFICATE_URL = new Type(2);
- static final Type TRUSTED_CA_KEYS = new Type(3);
- static final Type TRUNCATED_HMAC = new Type(4);
- static final Type STATUS_REQUEST = new Type(5);
- static final Type SRP = new Type(6);
- static final Type CERT_TYPE = new Type(7);
+ SERVER_NAME (0),
+ MAX_FRAGMENT_LENGTH (1),
+ CLIENT_CERTIFICATE_URL (2),
+ TRUSTED_CA_KEYS (3),
+ TRUNCATED_HMAC (4),
+ STATUS_REQUEST (5),
+ SRP (6),
+ CERT_TYPE (7);
private final int value;
- // Constructor.
- // -----------------------------------------------------------------------
-
private Type(int value)
{
this.value = value;
}
- // Class methods.
- // -----------------------------------------------------------------------
-
- static Type read(InputStream in) throws IOException
+ public static Type forValue (final int value)
{
- int i = in.read();
- if (i == -1)
- {
- throw new EOFException("unexpected end of input stream");
- }
- int value = (i & 0xFF) << 8;
- i = in.read();
- if (i == -1)
+ switch (value & 0xFFFF)
{
- throw new EOFException("unexpected end of input stream");
- }
- value |= i & 0xFF;
- switch (value)
- {
- case 0: return SERVER_NAME;
- case 1: return MAX_FRAGMENT_LENGTH;
- case 2: return CLIENT_CERTIFICATE_URL;
- case 3: return TRUSTED_CA_KEYS;
- case 4: return TRUNCATED_HMAC;
- case 5: return STATUS_REQUEST;
- case 6: return SRP;
- case 7: return CERT_TYPE;
- default: return new Type(value);
+ case 0: return SERVER_NAME;
+ case 1: return MAX_FRAGMENT_LENGTH;
+ case 2: return CLIENT_CERTIFICATE_URL;
+ case 3: return TRUSTED_CA_KEYS;
+ case 4: return TRUNCATED_HMAC;
+ case 5: return STATUS_REQUEST;
+ case 6: return SRP;
+ case 7: return CERT_TYPE;
+ default: return null;
}
}
-
- // Instance methods.
- // -----------------------------------------------------------------------
-
- public byte[] getEncoded()
- {
- return new byte[] {
- (byte) (value >>> 8 & 0xFF), (byte) (value & 0xFF)
- };
- }
-
+
public int getValue()
{
return value;
}
-
- public String toString()
- {
- switch (value)
- {
- case 0: return "server_name";
- case 1: return "max_fragment_length";
- case 2: return "client_certificate_url";
- case 3: return "trusted_ca_keys";
- case 4: return "truncated_hmac";
- case 5: return "status_request";
- case 6: return "srp";
- case 7: return "cert_type";
- default: return "unknown(" + value + ")";
- }
- }
+ }
+
+ public static abstract class Value implements Builder, Constructed
+ {
}
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ExtensionList.java b/libjava/classpath/gnu/javax/net/ssl/provider/ExtensionList.java
new file mode 100644
index 00000000000..d5aaad62155
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ExtensionList.java
@@ -0,0 +1,290 @@
+package gnu.javax.net.ssl.provider;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.util.ConcurrentModificationException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.NoSuchElementException;
+
+/**
+ * A list of extensions, that may appear in either the {@link ClientHello} or
+ * {@link ServerHello}. The form of the extensions list is:
+ *
+ * <tt> Extension extensions_list&lt;1..2^16-1&gt;</tt>
+ *
+ * @author csm
+ */
+public class ExtensionList implements Builder, Iterable<Extension>
+{
+ private final ByteBuffer buffer;
+ private int modCount;
+
+ public ExtensionList (ByteBuffer buffer)
+ {
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ modCount = 0;
+ }
+
+ public ExtensionList(List<Extension> extensions)
+ {
+ int length = 2;
+ for (Extension extension : extensions)
+ length += extension.length();
+ buffer = ByteBuffer.allocate(length);
+ buffer.putShort((short) (length - 2));
+ for (Extension extension : extensions)
+ buffer.put(extension.buffer());
+ buffer.rewind();
+ }
+
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().limit(length());
+ }
+
+ public Extension get (final int index)
+ {
+ int length = length ();
+ int i;
+ int n = 0;
+ for (i = 2; i < length && n < index; )
+ {
+ int l = buffer.getShort (i+2) & 0xFFFF;
+ i += l + 4;
+ n++;
+ }
+ if (n < index)
+ throw new IndexOutOfBoundsException ("no elemenet at " + index);
+ int el = buffer.getShort (i+2) & 0xFFFF;
+ ByteBuffer b = (ByteBuffer) buffer.duplicate().position(i).limit(i+el+4);
+ return new Extension(b.slice());
+ }
+
+ /**
+ * Returns the number of extensions this list contains.
+ *
+ * @return The number of extensions.
+ */
+ public int size ()
+ {
+ int length = length ();
+ if (length == 0)
+ return 0;
+ int n = 0;
+ for (int i = 2; i < length; )
+ {
+ int len = buffer.getShort (i+2) & 0xFFFF;
+ i += len + 4;
+ n++;
+ }
+ return n;
+ }
+
+ /**
+ * Returns the length of this extension list, in bytes.
+ *
+ * @return The length of this extension list, in bytes.
+ */
+ public int length ()
+ {
+ return (buffer.getShort (0) & 0xFFFF) + 2;
+ }
+
+ /**
+ * Sets the extension at index <i>i</i> to <i>e</i>. Note that setting an
+ * element at an index <b>may</b> invalidate any other elements that come
+ * after element at index <i>i</i>. In other words, no attempt is made to
+ * move existing elements in this list, and since extensions are variable
+ * length, you can <em>not</em> guarantee that extensions later in the list
+ * will still be valid.
+ *
+ * <p>Thus, elements of this list <b>must</b> be set in order of increasing
+ * index.
+ *
+ * @param index The index to set the extension at.
+ * @param e The extension.
+ * @throws java.nio.BufferOverflowException If setting the extension overflows
+ * the buffer.
+ * @throws IllegalArgumentException If it isn't possible to find the given index
+ * in the current list (say, if no element index - 1 is set), or if setting
+ * the extension will overflow the current list length (given by {@link
+ * #length()}).
+ */
+ public void set (final int index, Extension e)
+ {
+ int length = length();
+ int n = 0;
+ int i;
+ for (i = 2; i < length && n < index; )
+ {
+ int len = buffer.getShort(i+2) & 0xFFFF;
+ i += len + 4;
+ n++;
+ }
+ if (n < index)
+ throw new IllegalArgumentException("nothing set at index " + (index-1)
+ + " or insufficient space");
+ if (i + e.length() + 2 > length)
+ throw new IllegalArgumentException("adding this element will exceed the "
+ + "list length");
+ buffer.putShort(i, (short) e.type().getValue());
+ buffer.putShort(i+2, (short) e.length());
+ ((ByteBuffer) buffer.duplicate().position(i+4)).put (e.valueBuffer());
+ modCount++;
+ }
+
+ /**
+ * Reserve space for an extension at index <i>i</i> in the list. In other
+ * words, this does the job of {@link #set(int, Extension)}, but does not
+ * copy the extension value to the underlying buffer.
+ *
+ * @param index The index of the extension to reserve space for.
+ * @param t The type of the extension.
+ * @param eLength The number of bytes to reserve for this extension. The total
+ * number of bytes used by this method is this length, plus four.
+ */
+ public void set (final int index, Extension.Type t, final int eLength)
+ {
+ int length = length ();
+ int n = 0;
+ int i;
+ for (i = 2; i < length && n < index; )
+ {
+ int len = buffer.getShort (i+2) & 0xFFFF;
+ i += len + 4;
+ n++;
+ }
+ if (n < index)
+ throw new IllegalArgumentException ("nothing set at index " + (index-1)
+ + " or insufficient space");
+ if (i + eLength + 2 > length)
+ throw new IllegalArgumentException ("adding this element will exceed the "
+ + "list length");
+ buffer.putShort(i, (short) t.getValue());
+ buffer.putShort(i+2, (short) eLength);
+ modCount++;
+ }
+
+ /**
+ * Set the total length of this list, in bytes.
+ *
+ * @param newLength The new list length.
+ */
+ public void setLength (final int newLength)
+ {
+ if (newLength < 0 || newLength > 65535)
+ throw new IllegalArgumentException ("invalid length");
+ buffer.putShort (0, (short) newLength);
+ modCount++;
+ }
+
+ public Iterator<Extension> iterator()
+ {
+ return new ExtensionsIterator();
+ }
+
+ public String toString()
+ {
+ return toString (null);
+ }
+
+ public String toString(final String prefix)
+ {
+ StringWriter str = new StringWriter();
+ PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print(prefix);
+ out.println("ExtensionList {");
+ if (prefix != null) out.print(prefix);
+ out.print(" length = ");
+ out.print(length());
+ out.println(";");
+ String subprefix = " ";
+ if (prefix != null)
+ subprefix = prefix + subprefix;
+ for (Extension e : this)
+ out.println(e.toString(subprefix));
+ if (prefix != null) out.print(prefix);
+ out.print("};");
+ return str.toString();
+ }
+
+ /**
+ * List iterator interface to an extensions list.
+ *
+ * @author csm@gnu.org
+ */
+ public final class ExtensionsIterator implements ListIterator<Extension>
+ {
+ private final int modCount;
+ private int index;
+ private final int size;
+
+ public ExtensionsIterator ()
+ {
+ this.modCount = ExtensionList.this.modCount;
+ index = 0;
+ size = size ();
+ }
+
+ public boolean hasNext()
+ {
+ return index < size;
+ }
+
+ public boolean hasPrevious()
+ {
+ return index > 0;
+ }
+
+ public Extension next() throws NoSuchElementException
+ {
+ if (modCount != ExtensionList.this.modCount)
+ throw new ConcurrentModificationException ();
+ if (!hasNext ())
+ throw new NoSuchElementException ();
+ return get (index++);
+ }
+
+ public Extension previous() throws NoSuchElementException
+ {
+ if (modCount != ExtensionList.this.modCount)
+ throw new ConcurrentModificationException ();
+ if (!hasPrevious ())
+ throw new NoSuchElementException ();
+ return get (--index);
+ }
+
+ public int nextIndex()
+ {
+ if (hasNext ())
+ return index + 1;
+ return index;
+ }
+
+ public int previousIndex()
+ {
+ if (hasPrevious ())
+ return index - 1;
+ return -1;
+ }
+
+ public void add(Extension e)
+ {
+ throw new UnsupportedOperationException ("cannot add items to this iterator");
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException ("cannot remove items from this iterator");
+ }
+
+ public void set(Extension e)
+ {
+ ExtensionList.this.set (index, e);
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Extensions.java b/libjava/classpath/gnu/javax/net/ssl/provider/Extensions.java
deleted file mode 100644
index 9ed9619f06f..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/Extensions.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/* Extensions.java -- various static extension utilities.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.security.auth.x500.X500Principal;
-
-import gnu.java.security.x509.X500DistinguishedName;
-
-final class Extensions
-{
-
- // Constants.
- // -------------------------------------------------------------------------
-
- private static final Integer _512 = new Integer(512),
- _1024 = new Integer(1024), _2048 = new Integer(2048),
- _4096 = new Integer(4096);
-
- // Class methods only.
- private Extensions() { }
-
- // Class methods.
- // -------------------------------------------------------------------------
-
- static List getServerName(Extension ex)
- {
- LinkedList l = new LinkedList();
- byte[] buf = ex.getValue();
- int pos = 0;
- try
- {
- while (pos < buf.length)
- {
- if (buf[pos++] != 0)
- break;
- int len = (buf[pos++] & 0xFF) << 8;
- len |= buf[pos++] & 0xFF;
- l.add(new String(buf, pos, len, "UTF-8"));
- pos += len;
- }
- }
- catch (Exception x)
- {
- }
- return Collections.unmodifiableList(l);
- }
-
- static List getClientCertTypes(Extension ex) throws IOException
- {
- List l = new LinkedList();
- ByteArrayInputStream in = new ByteArrayInputStream(ex.getValue());
- final int len = in.read() & 0xFF;
- for (int i = 0; i < len; i++)
- {
- l.add(CertificateType.read(in));
- }
- return Collections.unmodifiableList(l);
- }
-
- static CertificateType getServerCertType(Extension ex) throws IOException
- {
- return CertificateType.read(new ByteArrayInputStream(ex.getValue()));
- }
-
- static Integer getMaxFragmentLength(Extension ex)
- {
- switch (ex.getValue()[0] & 0xFF)
- {
- case 1: return _512;
- case 2: return _1024;
- case 3: return _2048;
- case 4: return _4096;
- }
- throw new IllegalArgumentException();
- }
-
- static Object[] getTrustedCA(Extension ex)
- {
- byte[] buf = ex.getValue();
- int type = buf[0] & 0xFF;
- try
- {
- switch (type)
- {
- case 0:
- return new Object[] { new Integer(type), null };
- case 1:
- case 3:
- return new Object[] { new Integer(type),
- Util.trim(buf, 1, 20) };
- case 2:
- return new Object[] { new Integer(type),
- new X500Principal(Util.trim(buf, 1, 20)) };
- }
- }
- catch (Exception x)
- {
- }
- throw new IllegalArgumentException();
- }
-
- static String getSRPUsername(Extension ex)
- {
- int len = ex.getValue()[0] & 0xFF;
- if (len > ex.getValue().length - 1)
- throw new IllegalArgumentException();
- try
- {
- return new String(ex.getValue(), 1, len, "UTF-8");
- }
- catch (UnsupportedEncodingException uee)
- {
- throw new Error(uee.toString());
- }
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Finished.java b/libjava/classpath/gnu/javax/net/ssl/provider/Finished.java
index 8b9c220a527..9a2a4707aa0 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/Finished.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/Finished.java
@@ -38,10 +38,10 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
-import java.io.DataInputStream;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import java.nio.ByteBuffer;
final class Finished implements Handshake.Body
{
@@ -49,95 +49,125 @@ final class Finished implements Handshake.Body
// Fields.
// -------------------------------------------------------------------------
- /** TLSv1.x verify data. */
- private final byte[] verifyData;
-
- /** SSLv3 message digest pair. */
- private final byte[] md5, sha;
+ private final ByteBuffer buffer;
+ private final ProtocolVersion version;
// Constructor.
// -------------------------------------------------------------------------
- Finished(byte[] verifyData)
+ Finished (final ByteBuffer buffer, final ProtocolVersion version)
{
- this.verifyData = verifyData;
- md5 = sha = null;
+ buffer.getClass ();
+ version.getClass ();
+ this.buffer = buffer;
+ this.version = version;
}
- Finished(byte[] md5, byte[] sha)
+ // Instance methods.
+ // -------------------------------------------------------------------------
+
+ public int length ()
{
- this.md5 = md5;
- this.sha = sha;
- verifyData = null;
+ if (version.compareTo(ProtocolVersion.TLS_1) >= 0)
+ return 12;
+ if (version == ProtocolVersion.SSL_3)
+ return 36;
+ throw new IllegalArgumentException ("length for this version unknown");
}
- // Class methods.
- // -------------------------------------------------------------------------
-
- static Finished read(InputStream in, CipherSuite suite)
- throws IOException
+ byte[] verifyData()
{
- DataInputStream din = new DataInputStream(in);
- if (suite.getVersion().equals(ProtocolVersion.SSL_3))
+ if (version.compareTo(ProtocolVersion.TLS_1) >= 0)
{
- byte[] md5 = new byte[16];
- byte[] sha = new byte[20];
- din.readFully(md5);
- din.readFully(sha);
- return new Finished(md5, sha);
+ byte[] verify = new byte[12];
+ buffer.position (0);
+ buffer.get (verify);
+ return verify;
}
- else
+ throw new IllegalArgumentException ("not TLSv1.0 or later");
+ }
+
+ byte[] md5Hash()
+ {
+ if (version == ProtocolVersion.SSL_3)
{
- byte[] buf = new byte[12];
- din.readFully(buf);
- return new Finished(buf);
+ byte[] md5 = new byte[16];
+ buffer.position (0);
+ buffer.get (md5);
+ return md5;
}
+ throw new IllegalArgumentException ("not SSLv3");
}
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public void write(OutputStream out) throws IOException
+ byte[] shaHash()
{
- if (verifyData != null)
- out.write(verifyData);
- else
+ if (version == ProtocolVersion.SSL_3)
{
- out.write(md5);
- out.write(sha);
+ byte[] sha = new byte[20];
+ buffer.position (16);
+ buffer.get (sha);
+ return sha;
}
+ throw new IllegalArgumentException ("not SSLv3");
+ }
+
+ void setVerifyData (final byte[] verifyData, final int offset)
+ {
+ if (version == ProtocolVersion.SSL_3)
+ throw new IllegalArgumentException ("not TLSv1");
+ buffer.position (0);
+ buffer.put (verifyData, offset, 12);
}
- byte[] getVerifyData()
+ void setMD5Hash (final byte[] md5, final int offset)
{
- return verifyData;
+ if (version != ProtocolVersion.SSL_3)
+ throw new IllegalArgumentException ("not SSLv3");
+ buffer.position (0);
+ buffer.put (md5, offset, 16);
}
- byte[] getMD5Hash()
+ void setShaHash (final byte[] sha, final int offset)
{
- return md5;
+ if (version != ProtocolVersion.SSL_3)
+ throw new IllegalArgumentException ("not SSLv3");
+ buffer.position (16);
+ buffer.put (sha, offset, 20);
}
- byte[] getSHAHash()
+ public String toString ()
{
- return sha;
+ return toString (null);
}
- public String toString()
+ public String toString (final String prefix)
{
- String nl = System.getProperty("line.separator");
- if (verifyData != null)
+ StringWriter str = new StringWriter ();
+ PrintWriter out = new PrintWriter (str);
+ if (prefix != null)
+ out.print (prefix);
+ out.println ("struct {");
+ if (prefix != null)
+ out.print (prefix);
+ if (version.compareTo(ProtocolVersion.TLS_1) >= 0)
{
- return "struct {" + nl +
- " verifyData = " + Util.toHexString(verifyData, ':') + ";" + nl +
- "} Finished;" + nl;
+ out.print (" verifyData = ");
+ out.print (Util.toHexString (verifyData (), ':'));
}
- else
+ else if (version == ProtocolVersion.SSL_3)
{
- return "struct {" + nl +
- " md5Hash = " + Util.toHexString(md5, ':') + ";" + nl +
- " shaHash = " + Util.toHexString(sha, ':') + ";" + nl +
- "} Finished;" + nl;
+ out.print (" md5 = ");
+ out.print (Util.toHexString (md5Hash (), ':'));
+ out.println (';');
+ if (prefix != null)
+ out.print (prefix);
+ out.print (" sha = ");
+ out.print (Util.toHexString (shaHash (), ':'));
}
+ out.println (';');
+ if (prefix != null)
+ out.print (prefix);
+ out.print ("} Finished;");
+ return str.toString ();
}
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/GNUSecurityParameters.java b/libjava/classpath/gnu/javax/net/ssl/provider/GNUSecurityParameters.java
deleted file mode 100644
index a04c3fd5c15..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/GNUSecurityParameters.java
+++ /dev/null
@@ -1,490 +0,0 @@
-/* GNUSecurityParameters.java -- SSL security parameters.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-
-import java.security.SecureRandom;
-import java.security.Security;
-import java.util.Arrays;
-import java.util.zip.DataFormatException;
-import java.util.zip.Deflater;
-import java.util.zip.Inflater;
-
-import javax.net.ssl.SSLException;
-
-import gnu.javax.crypto.mac.IMac;
-import gnu.javax.crypto.mode.IMode;
-import gnu.java.security.prng.IRandom;
-import gnu.java.security.prng.LimitReachedException;
-
-/**
- * This class implements the {@link SecurityParameters} interface, using the
- * GNU Crypto interface for ciphers and macs, and the JZlib package for
- * record compression.
- */
-class GNUSecurityParameters implements SecurityParameters
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private static final boolean DEBUG_RECORD_LAYER = false;
- private static final PrintWriter debug = new PrintWriter (System.err, true);
-
- /**
- * The CBC block cipher, if any.
- */
- IMode inCipher, outCipher;
-
- /**
- * The RC4 PRNG, if any.
- */
- IRandom inRandom, outRandom;
-
- /**
- * The MAC algorithm.
- */
- IMac inMac, outMac;
-
- long inSequence, outSequence;
- Session session;
- ProtocolVersion version;
- int fragmentLength;
- private Inflater inflater;
- private Deflater deflater;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- GNUSecurityParameters (Session session)
- {
- inSequence = 0;
- outSequence = 0;
- this.session = session;
- fragmentLength = 16384;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public void reset()
- {
- inSequence = 0L;
- outSequence = 0L;
- inCipher = null;
- outCipher = null;
- inMac = null;
- outMac = null;
- inRandom = null;
- outRandom = null;
- deflater = null;
- inflater = null;
- }
-
- public ProtocolVersion getVersion()
- {
- return version;
- }
-
- public void setVersion(ProtocolVersion version)
- {
- this.version = version;
- }
-
- public void setInCipher(Object inCipher)
- {
- if (inCipher instanceof IMode)
- {
- this.inCipher = (IMode) inCipher;
- inRandom = null;
- }
- else
- {
- inRandom = (IRandom) inCipher;
- this.inCipher = null;
- }
- }
-
- public void setOutCipher(Object outCipher)
- {
- if (outCipher instanceof IMode)
- {
- this.outCipher = (IMode) outCipher;
- outRandom = null;
- }
- else
- {
- outRandom = (IRandom) outCipher;
- this.outCipher = null;
- }
- }
-
- public void setInMac(Object inMac)
- {
- this.inMac = (IMac) inMac;
- inSequence = 0L;
- }
-
- public void setOutMac(Object outMac)
- {
- this.outMac = (IMac) outMac;
- outSequence = 0L;
- }
-
- public void setDeflating (boolean deflate)
- {
- if (deflate)
- {
- if (deflater == null)
- deflater = new Deflater();
- }
- else
- deflater = null;
- }
-
- public void setInflating (boolean inflate)
- {
- if (inflate)
- {
- if (inflater == null)
- inflater = new Inflater();
- }
- else
- inflater = null;
- }
-
- public int getFragmentLength()
- {
- return fragmentLength;
- }
-
- public void setFragmentLength (int fragmentLength)
- {
- this.fragmentLength = fragmentLength;
- }
-
- /**
- * Decrypt, verify, and decompress a fragment, returning the transformed
- * fragment.
- *
- * @param fragment The fragment to decrypt.
- * @param version The protocol version of the fragment's record.
- * @param type The content type of the record.
- * @return The decrypted fragment.
- * @throws MacException If the MAC could not be verified.
- * @throws OverflowException If the inflated data is too large.
- * @throws SSLException If decompressing fails.
- */
- public synchronized byte[] decrypt (byte[] fragment, ProtocolVersion version,
- ContentType type)
- throws MacException, OverflowException, SSLException
- {
- boolean badPadding = false;
-
- // Decrypt the ciphertext, if it is encrypted.
- if (inCipher != null)
- {
- int bs = inCipher.currentBlockSize ();
- for (int i = 0; i < fragment.length; i += bs)
- {
- inCipher.update (fragment, i, fragment, i);
- }
- int padLen = fragment[fragment.length-1] & 0xFF;
- int len = fragment.length - padLen - 1;
- if (version == ProtocolVersion.SSL_3)
- {
- // SSLv3 requires that the padding length not exceed the
- // cipher's block size.
- if (padLen >= bs)
- {
- badPadding = true;
- }
- }
- else
- {
- for (int i = len; i < fragment.length; i++)
- {
- // If the TLS padding is wrong, throw a MAC exception below.
- if ((fragment[i] & 0xFF) != padLen)
- {
- badPadding = true;
- }
- }
- }
- fragment = Util.trim (fragment, len);
- }
- else if (inRandom != null)
- {
- transformRC4 (fragment, 0, fragment.length, fragment, 0, inRandom);
- }
-
- // Check the MAC.
- if (inMac != null)
- {
- inMac.update ((byte) (inSequence >>> 56));
- inMac.update ((byte) (inSequence >>> 48));
- inMac.update ((byte) (inSequence >>> 40));
- inMac.update ((byte) (inSequence >>> 32));
- inMac.update ((byte) (inSequence >>> 24));
- inMac.update ((byte) (inSequence >>> 16));
- inMac.update ((byte) (inSequence >>> 8));
- inMac.update ((byte) inSequence);
- inMac.update ((byte) type.getValue());
- if (version != ProtocolVersion.SSL_3)
- {
- inMac.update ((byte) version.getMajor());
- inMac.update ((byte) version.getMinor());
- }
- int macLen = inMac.macSize ();
- int fragLen = fragment.length - macLen;
- inMac.update ((byte) (fragLen >>> 8));
- inMac.update ((byte) fragLen);
- inMac.update (fragment, 0, fragLen);
- byte[] mac = inMac.digest ();
- inMac.reset ();
- for (int i = 0; i < macLen; i++)
- {
- if (fragment[i + fragLen] != mac[i])
- {
- throw new MacException();
- }
- }
- if (badPadding)
- {
- throw new MacException();
- }
- fragment = Util.trim (fragment, fragLen);
- }
-
- if (inflater != null)
- {
- byte[] buf = new byte[1024];
- ByteArrayOutputStream bout = new ByteArrayOutputStream (fragment.length << 1);
- inflater.setInput (fragment);
- int len;
- try
- {
- while ((len = inflater.inflate (buf)) > 0)
- {
- bout.write (buf, 0, len);
- if (bout.size() > fragmentLength + 1024)
- throw new OverflowException ("inflated data too large");
- }
- }
- catch (DataFormatException dfe)
- {
- throw new SSLException (String.valueOf (dfe));
- }
- fragment = bout.toByteArray();
- inflater.reset();
- }
-
- inSequence++;
- return fragment;
- }
-
- /**
- * Compress, MAC, encrypt, and write a record. The fragment of the
- * record is taken from <i>buf</i> as <i>len</i> bytes starting at
- * <i>offset</i>. <i>len</i> <b>must</b> be smaller than or equal to
- * the configured fragment length.
- *
- * @param buf The fragment bytes.
- * @param off The offset from whence to read.
- * @param len The size of the fragment.
- * @param type The content-type for this record.
- * @param out The output stream to write the record to.
- * @throws IOException If an I/O error occurs.
- * @throws SSLException If compression fails.
- * @throws OverflowException If compression inflates the data beyond
- * the fragment length plus 1024 bytes.
- */
- public synchronized byte[] encrypt (byte[] buf, int off, int len,
- ContentType type)
- throws SSLException, OverflowException
- {
- // If we are compressing, do it.
- if (deflater != null)
- {
- byte[] buf2 = new byte[1024];
- ByteArrayOutputStream bout = new ByteArrayOutputStream (len >>> 1);
- deflater.setInput (buf, off, len);
- deflater.finish();
- len = 0;
- while ((len = deflater.deflate (buf2)) > 0)
- bout.write (buf2, 0, len);
- // This should technically never happen for zlib.
- if (bout.size() > fragmentLength + 1024)
- throw new OverflowException ("deflated data too large");
- buf = bout.toByteArray();
- off = 0;
- len = buf.length;
- deflater.reset();
- }
-
- // If there is a MAC, compute it.
- byte[] mac = new byte[0];
- if (outMac != null)
- {
- outMac.update((byte) (outSequence >>> 56));
- outMac.update((byte) (outSequence >>> 48));
- outMac.update((byte) (outSequence >>> 40));
- outMac.update((byte) (outSequence >>> 32));
- outMac.update((byte) (outSequence >>> 24));
- outMac.update((byte) (outSequence >>> 16));
- outMac.update((byte) (outSequence >>> 8));
- outMac.update((byte) outSequence);
- outMac.update((byte) type.getValue());
- if (version != ProtocolVersion.SSL_3)
- {
- outMac.update((byte) version.getMajor());
- outMac.update((byte) version.getMinor());
- }
- outMac.update((byte) (len >>> 8));
- outMac.update((byte) len);
- outMac.update(buf, off, len);
- mac = outMac.digest();
- outMac.reset();
- }
- outSequence++;
-
- // Compute padding if needed.
- byte[] pad = new byte[0];
- if (outCipher != null)
- {
- int padLen = outCipher.currentBlockSize() -
- ((len + mac.length + 1) % outCipher.currentBlockSize());
- // Use a random amount of padding if the protocol is TLS.
- if (version != ProtocolVersion.SSL_3 && session.random != null)
- {
- padLen += (Math.abs(session.random.nextInt ()) & 7) *
- outCipher.currentBlockSize();
- while (padLen > 255)
- {
- padLen -= outCipher.currentBlockSize();
- }
- }
- pad = new byte[padLen+1];
- Arrays.fill (pad, (byte) padLen);
- }
-
- // Write the record header.
- final int fraglen = len + mac.length + pad.length;
-
- // Encrypt and write the fragment.
- if (outCipher != null)
- {
- byte[] buf2 = new byte[fraglen];
- System.arraycopy (buf, off, buf2, 0, len);
- System.arraycopy (mac, 0, buf2, len, mac.length);
- System.arraycopy (pad, 0, buf2, len + mac.length, pad.length);
- int bs = outCipher.currentBlockSize ();
- for (int i = 0; i < fraglen; i += bs)
- {
- outCipher.update (buf2, i, buf2, i);
- }
- return buf2;
- }
- else if (outRandom != null)
- {
- byte[] buf2 = new byte[fraglen];
- transformRC4 (buf, off, len, buf2, 0, outRandom);
- transformRC4 (mac, 0, mac.length, buf2, len, outRandom);
- return buf2;
- }
- else
- {
- if (mac.length == 0)
- {
- return Util.trim (buf, off, len);
- }
- else
- {
- return Util.concat (Util.trim (buf, off, len), mac);
- }
- }
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- /**
- * Encrypt/decrypt a byte array with the RC4 stream cipher.
- *
- * @param in The input data.
- * @param off The input offset.
- * @param len The number of bytes to transform.
- * @param out The output buffer.
- * @param outOffset The offest into the output buffer.
- * @param random The ARCFOUR PRNG.
- */
- private static void transformRC4(byte[] in, int off, int len,
- byte[] out, int outOffset, IRandom random)
- {
- if (random == null)
- {
- throw new IllegalStateException();
- }
- if (in == null || out == null)
- {
- throw new NullPointerException();
- }
- if (off < 0 || off + len > in.length ||
- outOffset < 0 || outOffset + len > out.length)
- {
- throw new ArrayIndexOutOfBoundsException();
- }
-
- try
- {
- for (int i = 0; i < len; i++)
- {
- out[outOffset+i] = (byte) (in[off+i] ^ random.nextByte());
- }
- }
- catch (LimitReachedException cannotHappen)
- {
- throw new Error(cannotHappen.toString());
- }
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Handshake.java b/libjava/classpath/gnu/javax/net/ssl/provider/Handshake.java
index ef9e72381c1..52f61424e4c 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/Handshake.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/Handshake.java
@@ -1,4 +1,4 @@
-/* Handshake.java -- SSL handshake message.
+/* Handshake.java -- SSL Handshake message.
Copyright (C) 2006 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -49,6 +49,8 @@ import java.io.PrintWriter;
import java.io.StringReader;
import java.io.StringWriter;
+import java.nio.ByteBuffer;
+
import java.security.PublicKey;
import java.util.ArrayList;
@@ -56,306 +58,219 @@ import java.util.Collections;
import javax.net.ssl.SSLProtocolException;
-final class Handshake implements Constructed
+/**
+ * An SSL handshake message. SSL handshake messages have the following
+ * form:
+ *
+ * <pre>
+struct
+{
+ HandshakeType msg_type;
+ uint24 length;
+ select (msg_type)
+ {
+ case hello_request: HelloRequest;
+ case client_hello: ClientHello;
+ case server_hello: ServerHello;
+ case certificate: Certificate;
+ case server_key_exchange: ServerKeyExchange;
+ case certificate_request: CertificateRequest;
+ case server_hello_done: ServerHelloDone;
+ case certificate_verify: CertificateVerify;
+ case client_key_exchange: ClientKeyExchange;
+ case finished: Finished;
+ } body;
+};</pre>
+ */
+public final class Handshake implements Constructed
{
// Fields.
// -------------------------------------------------------------------------
- private static final buffer BUF = new buffer();
-
- private final Type type;
- private final Body body;
+ private final ByteBuffer buffer;
+ private final CipherSuite suite;
+ private final ProtocolVersion version;
// Constructors.
// -------------------------------------------------------------------------
- Handshake(Type type, Body body)
+ public Handshake (final ByteBuffer buffer)
{
- this.type = type;
- this.body = body;
+ this (buffer, null, ProtocolVersion.TLS_1_1);
}
- // Class methods.
- // -------------------------------------------------------------------------
-
- static Handshake read(byte[] buffer) throws IOException
+ public Handshake (final ByteBuffer buffer, final CipherSuite suite,
+ final ProtocolVersion version)
{
- return read(new ByteArrayInputStream(buffer));
+ this.buffer = buffer;
+ this.suite = suite;
+ this.version = version;
}
- static Handshake read(byte[] buffer, CipherSuite suite, PublicKey key)
- throws IOException
- {
- return read(new ByteArrayInputStream(buffer), suite, key);
- }
-
- static Handshake read(InputStream in) throws IOException
- {
- return read(in, null, null);
- }
+ // Instance methods.
+ // -------------------------------------------------------------------------
- static Handshake read(InputStream in, CipherSuite suite, PublicKey key)
- throws IOException
+ /**
+ * Returns the handshake type.
+ *
+ * @return The handshake type.
+ */
+ public Type type()
{
- return read(in, suite, key, null);
+ return Type.forInteger (buffer.get (0) & 0xFF);
}
- static Handshake read(InputStream in, CertificateType certType)
- throws IOException
+ /**
+ * Returns the message length.
+ *
+ * @return The message length.
+ */
+ public int length ()
{
- return read(in, null, null, certType);
+ // Length is a uint24.
+ return buffer.getInt (0) & 0xFFFFFF;
}
- static Handshake read(InputStream in, CipherSuite suite, PublicKey key,
- CertificateType certType)
- throws IOException
+ /**
+ * Returns the handshake message body. Depending on the handshake
+ * type, some implementation of the Body interface is returned.
+ *
+ * @return The handshake body.
+ */
+ public Body body()
{
- Type type = Type.read(in);
- byte[] lenbuf = new byte[3];
- in.read(lenbuf);
- int len = (lenbuf[0] & 0xFF) << 16 | (lenbuf[1] & 0xFF) << 8
- | (lenbuf[2] & 0xFF);
- Body body = null;
- if (type == Type.HELLO_REQUEST)
- {
- body = null;
- }
- else if (type == Type.CLIENT_HELLO)
- {
- // Most likely a V2 hello. If the first byte is 0x30, and if this
- // is not a V2 client hello, then it is a V3 client hello with
- // at least 1.5 million cipher specs, which is unlikely.
- if (lenbuf[0] == 3 && (lenbuf[1] >= 0 && lenbuf[1] <= 2))
- {
- ProtocolVersion vers = null;
- switch (lenbuf[1])
- {
- case 0:
- vers = ProtocolVersion.SSL_3;
- break;
- case 1:
- vers = ProtocolVersion.TLS_1;
- break;
- case 2:
- vers = ProtocolVersion.TLS_1_1;
- break;
- }
- int specLen = (lenbuf[2] & 0xFF) << 8 | (in.read() & 0xFF);
- int idLen = (in.read() & 0xFF) << 8 | (in.read() & 0xFF);
- int chalLen = (in.read() & 0xFF) << 8 | (in.read() & 0xFF);
-
- ArrayList suites = new ArrayList(specLen / 3);
- for (int i = 0; i < specLen; i += 3)
- {
- if (in.read() == 0)
- {
- suites.add(CipherSuite.read(in).resolve(vers));
- }
- else
- {
- in.read();
- in.read();
- }
- }
- byte[] id = new byte[idLen];
- in.read(id);
- byte[] challenge = new byte[chalLen];
- in.read(challenge);
- if (challenge.length > 32)
- challenge = Util.trim(challenge, 32);
- else if (challenge.length < 32)
- {
- byte[] b = new byte[32];
- System.arraycopy(challenge, 0, b, b.length - challenge.length,
- challenge.length);
- challenge = b;
- }
- int time = (challenge[0] & 0xFF) << 24 | (challenge[1] & 0xFF) << 16
- | (challenge[2] & 0xFF) << 8 | (challenge[3] & 0xFF);
- Random rand = new Random(time, Util.trim(challenge, 4, 28));
- return new Handshake(Handshake.Type.CLIENT_HELLO,
- new ClientHello(vers, rand, id, suites,
- Collections.singletonList(CompressionMethod.NULL)));
- }
- // Since hello messages may contain extensions, we read the whole
- // thing here.
- byte[] buf = new byte[len];
- int count = 0;
- while (count < len)
- {
- int l = in.read(buf, count, len - count);
- if (l == -1)
- {
- throw new EOFException("unexpected end of input stream");
- }
- count += l;
- }
- body = ClientHello.read(new ByteArrayInputStream(buf));
- }
- else if (type == Type.SERVER_HELLO)
- {
- byte[] buf = new byte[len];
- int count = 0;
- while (count < len)
- {
- int l = in.read(buf, count, len - count);
- if (l == -1)
- {
- throw new EOFException("unexpected end of input stream");
- }
- count += l;
- }
- body = ServerHello.read(new ByteArrayInputStream(buf));
- }
- else if (type == Type.CERTIFICATE)
- {
- body = Certificate.read(in, certType);
- }
- else if (type == Type.SERVER_KEY_EXCHANGE)
+ Type type = type ();
+ ByteBuffer bodyBuffer = bodyBuffer ();
+ switch (type)
{
- body = ServerKeyExchange.read(in, suite, key);
- }
- else if (type == Type.CERTIFICATE_REQUEST)
- {
- body = CertificateRequest.read(in);
- }
- else if (type == Type.CERTIFICATE_VERIFY)
- {
- body = (CertificateVerify) CertificateVerify.read(in, suite, key);
- }
- else if (type == Type.CLIENT_KEY_EXCHANGE)
- {
- body = ClientKeyExchange.read(in, suite, key);
- }
- else if (type == Type.SERVER_HELLO_DONE)
- {
- body = null;
- }
- else if (type == Type.FINISHED)
- {
- body = Finished.read(in, suite);
- }
- else
- {
- throw new SSLProtocolException("unknown HandshakeType: " +
- type.getValue());
- }
+ case HELLO_REQUEST:
+ return new HelloRequest ();
- return new Handshake(type, body);
- }
+ case CLIENT_HELLO:
+ return new ClientHello (bodyBuffer);
- // Instance methods.
- // -------------------------------------------------------------------------
+ case SERVER_HELLO:
+ return new ServerHello (bodyBuffer);
- public void write(OutputStream out)
- {
- throw new UnsupportedOperationException();
+ case CERTIFICATE:
+ return new Certificate (bodyBuffer, CertificateType.X509);
+
+ case SERVER_KEY_EXCHANGE:
+ return new ServerKeyExchange (bodyBuffer, suite);
+
+ case CERTIFICATE_REQUEST:
+ return new CertificateRequest (bodyBuffer);
+
+ case SERVER_HELLO_DONE:
+ return new ServerHelloDone ();
+
+ case CERTIFICATE_VERIFY:
+ return new CertificateVerify (bodyBuffer, suite.signatureAlgorithm ());
+
+ case CLIENT_KEY_EXCHANGE:
+ return new ClientKeyExchange (bodyBuffer, suite, version);
+
+ case FINISHED:
+ return new Finished (bodyBuffer, version);
+
+ case CERTIFICATE_URL:
+ case CERTIFICATE_STATUS:
+ throw new UnsupportedOperationException ("FIXME");
+ }
+ throw new IllegalArgumentException ("unknown handshake type " + type);
}
- public int write(OutputStream out, ProtocolVersion version)
- throws IOException
+ /**
+ * Returns a subsequence of the underlying buffer, containing only
+ * the bytes that compose the handshake body.
+ *
+ * @return The body's byte buffer.
+ */
+ public ByteBuffer bodyBuffer ()
{
- out.write(type.getValue());
- if (body == null)
- {
- out.write(0);
- out.write(0);
- out.write(0);
- return 4;
- }
- else
- {
- ByteArrayOutputStream bout = BUF.getBuffer();
- bout.reset();
- if (body instanceof ServerKeyExchange)
- {
- ((ServerKeyExchange) body).write(bout, version);
- }
- else if (body instanceof ClientKeyExchange)
- {
- ((ClientKeyExchange) body).write(bout, version);
- }
- else if (body instanceof CertificateVerify)
- {
- ((CertificateVerify) body).write(bout, version);
- }
- else
- {
- body.write(bout);
- }
- out.write(bout.size() >>> 16 & 0xFF);
- out.write(bout.size() >>> 8 & 0xFF);
- out.write(bout.size() & 0xFF);
- bout.writeTo(out);
- return 4 + bout.size();
- }
+ int length = length ();
+ return ((ByteBuffer) buffer.position (4).limit (4 + length)).slice ();
}
- Type getType()
+ /**
+ * Sets the handshake body type.
+ *
+ * @param type The handshake type.
+ */
+ public void setType (final Type type)
{
- return type;
+ buffer.put (0, (byte) type.getValue ());
}
- Body getBody()
+ /**
+ * Sets the length of the handshake body.
+ *
+ * @param length The handshake body length.
+ * @throws java.nio.ReadOnlyBufferException If the underlying buffer
+ * is not writable.
+ * @throws IllegalArgumentException of <code>length</code> is not
+ * between 0 and 16777215, inclusive.
+ */
+ public void setLength (final int length)
{
- return body;
+ if (length < 0 || length > 0xFFFFFF)
+ throw new IllegalArgumentException ("length " + length + " out of range;"
+ + " must be between 0 and 16777215");
+ buffer.put (1, (byte) (length >>> 16));
+ buffer.put (2, (byte) (length >>> 8));
+ buffer.put (3, (byte) length);
}
public String toString()
{
+ return toString (null);
+ }
+
+ public String toString (final String prefix)
+ {
StringWriter str = new StringWriter();
PrintWriter out = new PrintWriter(str);
- String nl = System.getProperty("line.separator");
- StringBuffer buf = new StringBuffer();
+ if (prefix != null) out.print (prefix);
out.println("struct {");
- out.println(" type = " + type + ";");
- if (body != null)
- {
- BufferedReader r = new BufferedReader(new StringReader(body.toString()));
- String s;
- try
- {
- while ((s = r.readLine()) != null)
- {
- out.print(" ");
- out.println(s);
- }
- }
- catch (IOException ignored)
- {
- }
- }
- out.println("} Handshake;");
+ if (prefix != null) out.print (prefix);
+ out.print (" type: ");
+ out.print (type ());
+ out.println (";");
+ Body body = body ();
+ out.println (body.toString (prefix != null ? (prefix + " ") : " "));
+ if (prefix != null) out.print (prefix);
+ out.print ("} Handshake;");
return str.toString();
}
// Inner class.
// -------------------------------------------------------------------------
- static interface Body extends Constructed
+ public static interface Body extends Constructed
{
+ int length ();
+
+ String toString (String prefix);
}
- static class Type implements Enumerated
+ public static enum Type
{
-
- // Constants and fields.
- // -----------------------------------------------------------------------
-
- public static final Type
- HELLO_REQUEST = new Type( 0), CLIENT_HELLO = new Type( 1),
- SERVER_HELLO = new Type( 2), CERTIFICATE = new Type(11),
- SERVER_KEY_EXCHANGE = new Type(12), CERTIFICATE_REQUEST = new Type(13),
- SERVER_HELLO_DONE = new Type(14), CERTIFICATE_VERIFY = new Type(15),
- CLIENT_KEY_EXCHANGE = new Type(16), FINISHED = new Type(20),
- CERTIFICATE_URL = new Type(21), CERTIFICATE_STATUS = new Type(22);
+ HELLO_REQUEST ( 0),
+ CLIENT_HELLO ( 1),
+ SERVER_HELLO ( 2),
+ CERTIFICATE (11),
+ SERVER_KEY_EXCHANGE (12),
+ CERTIFICATE_REQUEST (13),
+ SERVER_HELLO_DONE (14),
+ CERTIFICATE_VERIFY (15),
+ CLIENT_KEY_EXCHANGE (16),
+ FINISHED (20),
+ CERTIFICATE_URL (21),
+ CERTIFICATE_STATUS (22);
private final int value;
- // Constructor.
- // -----------------------------------------------------------------------
-
private Type(int value)
{
this.value = value;
@@ -364,18 +279,20 @@ final class Handshake implements Constructed
// Class methods.
// -----------------------------------------------------------------------
- public static Type read(InputStream in) throws IOException
+ /**
+ * Convert a raw handshake type value to a type enum value.
+ *
+ * @return The corresponding enum value for the raw integer value.
+ * @throws IllegalArgumentException If the value is not a known handshake
+ * type.
+ */
+ public static Type forInteger (final int value)
{
- int i = in.read();
- if (i == -1)
+ switch (value & 0xFF)
{
- throw new EOFException("unexpected end of input stream");
- }
- switch (i & 0xFF)
- {
- case 0: return HELLO_REQUEST;
- case 1: return CLIENT_HELLO;
- case 2: return SERVER_HELLO;
+ case 0: return HELLO_REQUEST;
+ case 1: return CLIENT_HELLO;
+ case 2: return SERVER_HELLO;
case 11: return CERTIFICATE;
case 12: return SERVER_KEY_EXCHANGE;
case 13: return CERTIFICATE_REQUEST;
@@ -385,56 +302,13 @@ final class Handshake implements Constructed
case 20: return FINISHED;
case 21: return CERTIFICATE_URL;
case 22: return CERTIFICATE_STATUS;
- default: return new Type(i);
+ default: throw new IllegalArgumentException ("unsupported value type " + value);
}
}
- // Instance methods.
- // -----------------------------------------------------------------------
-
- public byte[] getEncoded()
- {
- return new byte[] { (byte) value };
- }
-
public int getValue()
{
return value;
}
-
- public String toString()
- {
- switch (value)
- {
- case 0: return "hello_request";
- case 1: return "client_hello";
- case 2: return "server_hello";
- case 11: return "certificate";
- case 12: return "server_key_exchange";
- case 13: return "certificate_request";
- case 14: return "server_hello_done";
- case 15: return "certificate_verify";
- case 16: return "client_key_exchange";
- case 20: return "finished";
- case 21: return "certificate_url";
- case 22: return "certificate_status";
- default: return "unknown(" + value + ")";
- }
- }
- }
-
- private static class buffer extends ThreadLocal
- {
- static final int SIZE = 2048;
-
- protected Object initialValue()
- {
- return new ByteArrayOutputStream(SIZE);
- }
-
- ByteArrayOutputStream getBuffer()
- {
- return (ByteArrayOutputStream) get();
- }
}
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/HelloRequest.java b/libjava/classpath/gnu/javax/net/ssl/provider/HelloRequest.java
new file mode 100644
index 00000000000..0ffc26c2b5d
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/HelloRequest.java
@@ -0,0 +1,70 @@
+/* HelloRequest.java -- SSL HelloRequest handshake message.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+/**
+ * The handshake body for a HelloRequest handshake message.
+ *
+ * <pre>struct { } HelloRequest;</pre>
+ */
+public final class HelloRequest implements Handshake.Body
+{
+ public HelloRequest ()
+ {
+ }
+
+ public String toString (final String prefix)
+ {
+ StringBuffer str = new StringBuffer ();
+ if (prefix != null)
+ str.append (prefix);
+ str.append ("HelloRequest { };");
+ return str.toString ();
+ }
+
+ public int length ()
+ {
+ return 0;
+ }
+
+ public String toString ()
+ {
+ return toString (null);
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/InputSecurityParameters.java b/libjava/classpath/gnu/javax/net/ssl/provider/InputSecurityParameters.java
new file mode 100644
index 00000000000..13a3ef814de
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/InputSecurityParameters.java
@@ -0,0 +1,336 @@
+/* SecurityParameters.java -- SSL security parameters.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.classpath.debug.Component;
+import gnu.classpath.debug.SystemLogger;
+import gnu.java.security.util.ByteArray;
+import gnu.java.security.util.ByteBufferOutputStream;
+
+import java.nio.BufferOverflowException;
+import java.nio.ByteBuffer;
+
+import java.util.Arrays;
+import java.util.logging.Level;
+import java.util.zip.DataFormatException;
+import java.util.zip.Inflater;
+
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.Mac;
+import javax.crypto.ShortBufferException;
+
+import javax.net.ssl.SSLException;
+
+public class InputSecurityParameters
+{
+ private static final SystemLogger logger = SystemLogger.SYSTEM;
+ private final Cipher cipher;
+ private final Mac mac;
+ private final Inflater inflater;
+ private SessionImpl session;
+ private final CipherSuite suite;
+ private long sequence;
+
+ public InputSecurityParameters (final Cipher cipher, final Mac mac,
+ final Inflater inflater,
+ final SessionImpl session,
+ final CipherSuite suite)
+ {
+ this.cipher = cipher;
+ this.mac = mac;
+ this.inflater = inflater;
+ this.session = session;
+ this.suite = suite;
+ sequence = 0;
+ }
+
+ /**
+ * Decrypt a record, storing the decrypted fragment into the given array
+ * of byte buffers.
+ *
+ * @param record The input record.
+ * @param output The output buffers.
+ * @param offset The offset of the first buffer to use.
+ * @param length The number of buffers to use.
+ * @return The number of bytes put in the output buffers.
+ * @throws DataFormatException If decompression fails.
+ * @throws IllegalBlockSizeException If the current cipher is a block cipher,
+ * and the input fragment is not a multiple of the block size.
+ * @throws MacException If verifying the MAC fails.
+ * @throws SSLException ???
+ * @throws ShortBufferException
+ */
+ public int decrypt(Record record, ByteBuffer[] output, int offset, int length)
+ throws DataFormatException, IllegalBlockSizeException,
+ MacException, SSLException, ShortBufferException
+ {
+ return decrypt(record, output, offset, length, null);
+ }
+
+ /**
+ * Decrypt a record, storing the decrypted fragment into the given growable
+ * buffer.
+ *
+ * @param record The input record.
+ * @param outputStream The output buffer.
+ * @return The number of bytes put into the output buffer.
+ * @throws DataFormatException
+ * @throws IllegalBlockSizeException
+ * @throws MacException
+ * @throws SSLException
+ * @throws ShortBufferException
+ */
+ public int decrypt(Record record, ByteBufferOutputStream outputStream)
+ throws DataFormatException, IllegalBlockSizeException,
+ MacException, SSLException, ShortBufferException
+ {
+ return decrypt(record, null, 0, 0, outputStream);
+ }
+
+ private int decrypt(Record record, ByteBuffer[] output, int offset, int length,
+ ByteBufferOutputStream outputStream)
+ throws DataFormatException, IllegalBlockSizeException,
+ MacException, SSLException, ShortBufferException
+ {
+ boolean badPadding = false;
+ ByteBuffer fragment;
+ if (cipher != null)
+ {
+ ByteBuffer input = record.fragment();
+ fragment = ByteBuffer.allocate(input.remaining());
+ cipher.update(input, fragment);
+ }
+ else
+ fragment = record.fragment();
+
+ if (Debug.DEBUG_DECRYPTION)
+ logger.logv(Component.SSL_RECORD_LAYER, "decrypted fragment:\n{0}",
+ Util.hexDump((ByteBuffer) fragment.duplicate().position(0), " >> "));
+
+ int fragmentLength = record.length();
+ int maclen = 0;
+ if (mac != null)
+ maclen = mac.getMacLength();
+ fragmentLength -= maclen;
+
+ int padlen = 0;
+ int padRemoveLen = 0;
+ if (!suite.isStreamCipher ())
+ {
+ padlen = fragment.get(record.length() - 1) & 0xFF;
+ padRemoveLen = padlen + 1;
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_RECORD_LAYER, "padlen:{0}", padlen);
+
+ if (record.version() == ProtocolVersion.SSL_3)
+ {
+ // In SSLv3, the padding length must not be larger than
+ // the cipher's block size.
+ if (padlen > cipher.getBlockSize ())
+ badPadding = true;
+ }
+ else if (record.version().compareTo(ProtocolVersion.TLS_1) >= 0)
+ {
+ // In TLSv1 and later, the padding must be `padlen' copies of the
+ // value `padlen'.
+ byte[] pad = new byte[padlen];
+ ((ByteBuffer) fragment.duplicate().position(record.length() - padlen - 1)).get(pad);
+ for (int i = 0; i < pad.length; i++)
+ if ((pad[i] & 0xFF) != padlen)
+ badPadding = true;
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_RECORD_LAYER, "TLSv1.x padding\n{0}",
+ new ByteArray(pad));
+ }
+
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_RECORD_LAYER, "padding bad? {0}",
+ badPadding);
+ if (!badPadding)
+ fragmentLength = fragmentLength - padRemoveLen;
+ }
+
+ int ivlen = 0;
+ if (session.version.compareTo(ProtocolVersion.TLS_1_1) >= 0
+ && !suite.isStreamCipher())
+ ivlen = cipher.getBlockSize();
+
+ // Compute and check the MAC.
+ if (mac != null)
+ {
+ mac.update((byte) (sequence >>> 56));
+ mac.update((byte) (sequence >>> 48));
+ mac.update((byte) (sequence >>> 40));
+ mac.update((byte) (sequence >>> 32));
+ mac.update((byte) (sequence >>> 24));
+ mac.update((byte) (sequence >>> 16));
+ mac.update((byte) (sequence >>> 8));
+ mac.update((byte) sequence);
+ mac.update((byte) record.getContentType().getValue());
+ ProtocolVersion version = record.version();
+ if (version != ProtocolVersion.SSL_3)
+ {
+ mac.update((byte) version.major());
+ mac.update((byte) version.minor());
+ }
+ mac.update((byte) ((fragmentLength - ivlen) >>> 8));
+ mac.update((byte) (fragmentLength - ivlen));
+ ByteBuffer content =
+ (ByteBuffer) fragment.duplicate().position(ivlen).limit(fragmentLength);
+ mac.update(content);
+ byte[] mac1 = mac.doFinal ();
+ byte[] mac2 = new byte[maclen];
+ mac.reset();
+ ((ByteBuffer) fragment.duplicate().position(fragmentLength)).get(mac2);
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_RECORD_LAYER, "mac1:{0} mac2:{1}",
+ Util.toHexString(mac1, ':'), Util.toHexString(mac2, ':'));
+ if (!Arrays.equals (mac1, mac2))
+ badPadding = true;
+ }
+
+ // We always say "bad MAC" and not "bad padding," because saying
+ // the latter will leak information to an attacker.
+ if (badPadding)
+ throw new MacException ();
+
+ // Inflate the compressed bytes.
+ int produced = 0;
+ if (inflater != null)
+ {
+ ByteBufferOutputStream out = new ByteBufferOutputStream(fragmentLength);
+ byte[] inbuffer = new byte[1024];
+ byte[] outbuffer = new byte[1024];
+ boolean done = false;
+ if (record.version().compareTo(ProtocolVersion.TLS_1_1) >= 0
+ && !suite.isStreamCipher())
+ fragment.position (cipher.getBlockSize());
+ else
+ fragment.position(0);
+ fragment.limit(fragmentLength);
+
+ while (!done)
+ {
+ int l;
+ if (inflater.needsInput())
+ {
+ l = Math.min(inbuffer.length, fragment.remaining());
+ fragment.get(inbuffer, 0, l);
+ inflater.setInput(inbuffer);
+ }
+
+ l = inflater.inflate(outbuffer);
+ out.write(outbuffer, 0, l);
+ done = !fragment.hasRemaining() && inflater.finished();
+ }
+
+ ByteBuffer outbuf = out.buffer();
+ if (outputStream != null)
+ {
+ byte[] buf = new byte[1024];
+ while (outbuf.hasRemaining())
+ {
+ int l = Math.min(outbuf.remaining(), buf.length);
+ outbuf.get(buf, 0, l);
+ outputStream.write(buf, 0, l);
+ produced += l;
+ }
+ }
+ else
+ {
+ int i = offset;
+ while (outbuf.hasRemaining() && i < offset + length)
+ {
+ int l = Math.min(output[i].remaining(), outbuf.remaining());
+ ByteBuffer b = (ByteBuffer)
+ outbuf.duplicate().limit(outbuf.position() + l);
+ output[i++].put(b);
+ outbuf.position(outbuf.position() + l);
+ produced += l;
+ }
+ if (outbuf.hasRemaining())
+ throw new BufferOverflowException();
+ }
+ }
+ else
+ {
+ ByteBuffer outbuf = (ByteBuffer)
+ fragment.duplicate().position(0).limit(record.length() - maclen - padRemoveLen);
+ if (record.version().compareTo(ProtocolVersion.TLS_1_1) >= 0
+ && !suite.isStreamCipher())
+ outbuf.position(cipher.getBlockSize());
+ if (outputStream != null)
+ {
+ byte[] buf = new byte[1024];
+ while (outbuf.hasRemaining())
+ {
+ int l = Math.min(outbuf.remaining(), buf.length);
+ outbuf.get(buf, 0, l);
+ outputStream.write(buf, 0, l);
+ produced += l;
+ }
+ }
+ else
+ {
+ int i = offset;
+ while (outbuf.hasRemaining() && i < offset + length)
+ {
+ int l = Math.min(output[i].remaining(), outbuf.remaining());
+ ByteBuffer b = (ByteBuffer) outbuf.duplicate().limit(outbuf.position() + l);
+ output[i++].put(b);
+ outbuf.position(outbuf.position() + l);
+ produced += l;
+ }
+ if (outbuf.hasRemaining())
+ throw new BufferOverflowException();
+ }
+ }
+
+ sequence++;
+
+ return produced;
+ }
+
+ CipherSuite cipherSuite ()
+ {
+ return suite;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/JCESecurityParameters.java b/libjava/classpath/gnu/javax/net/ssl/provider/JCESecurityParameters.java
deleted file mode 100644
index 6663c97b59d..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/JCESecurityParameters.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/* JCESecurityParameters.java -- JCE-based security parameters.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.ByteArrayOutputStream;
-
-import java.util.Arrays;
-import java.util.zip.DataFormatException;
-import java.util.zip.Deflater;
-import java.util.zip.Inflater;
-
-import javax.crypto.BadPaddingException;
-import javax.crypto.Cipher;
-import javax.crypto.IllegalBlockSizeException;
-import javax.crypto.Mac;
-
-import javax.net.ssl.SSLException;
-
-class JCESecurityParameters implements SecurityParameters
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private Cipher inCipher, outCipher;
- private Mac inMac, outMac;
- private Inflater inflater;
- private Deflater deflater;
- private int fragmentLength;
- private long inSequence, outSequence;
- private ProtocolVersion version;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- JCESecurityParameters ()
- {
- fragmentLength = 16384;
- inSequence = 0L;
- outSequence = 0L;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public void reset()
- {
- inCipher = null;
- outCipher = null;
- inMac = null;
- outMac = null;
- deflater = null;
- inflater = null;
- }
-
- public void setInCipher (Object inCipher)
- {
- this.inCipher = (Cipher) inCipher;
- }
-
- public void setOutCipher (Object outCipher)
- {
- this.outCipher = (Cipher) outCipher;
- }
-
- public void setInMac (Object inMac)
- {
- this.inMac = (Mac) inMac;
- inSequence = 0L;
- }
-
- public void setOutMac (Object outMac)
- {
- this.outMac = (Mac) outMac;
- outSequence = 0L;
- }
-
- public void setDeflating (boolean deflate)
- {
- if (deflate)
- {
- if (deflater == null)
- deflater = new Deflater();
- }
- else
- deflater = null;
- }
-
- public void setInflating (boolean inflate)
- {
- if (inflate)
- {
- if (inflater == null)
- inflater = new Inflater();
- }
- else
- inflater = null;
- }
-
- public int getFragmentLength()
- {
- return fragmentLength;
- }
-
- public void setFragmentLength (int fragmentLength)
- {
- this.fragmentLength = fragmentLength;
- }
-
- public ProtocolVersion getVersion()
- {
- return version;
- }
-
- public void setVersion (ProtocolVersion version)
- {
- this.version = version;
- }
-
- public synchronized byte[] decrypt (byte[] fragment, ProtocolVersion version,
- ContentType type)
- throws MacException, OverflowException, SSLException
- {
- boolean badpad = false;
- if (inCipher != null)
- {
- // We imagine that the JCE would be used in cases where hardware
- // acceleration is available, since it isn't really that useful for
- // pure Java crypto. We decrypt (and encrypt, below) in one go
- // to minimize (potential) calls to native methods.
- try
- {
- fragment = inCipher.doFinal (fragment);
- }
- catch (BadPaddingException bpe)
- {
- badpad = true;
- }
- catch (IllegalBlockSizeException ibse)
- {
- badpad = true;
- }
- }
-
- if (inMac != null)
- {
- int macLen = inMac.getMacLength();
- int fragLen = fragment.length - macLen;
- byte[] mac = Util.trim (fragment, fragLen, macLen);
- fragment = Util.trim (fragment, fragLen);
- inMac.update ((byte) (inSequence >>> 56));
- inMac.update ((byte) (inSequence >>> 48));
- inMac.update ((byte) (inSequence >>> 40));
- inMac.update ((byte) (inSequence >>> 32));
- inMac.update ((byte) (inSequence >>> 24));
- inMac.update ((byte) (inSequence >>> 16));
- inMac.update ((byte) (inSequence >>> 8));
- inMac.update ((byte) inSequence);
- inMac.update ((byte) type.getValue());
- if (version != ProtocolVersion.SSL_3)
- {
- inMac.update ((byte) version.getMajor());
- inMac.update ((byte) version.getMinor());
- }
- inMac.update ((byte) (fragLen >>> 8));
- inMac.update ((byte) fragLen);
- inMac.update (fragment);
- if (!Arrays.equals (mac, inMac.doFinal()) || badpad)
- throw new MacException();
- }
-
- if (inflater != null)
- {
- byte[] buf = new byte[1024];
- ByteArrayOutputStream bout = new ByteArrayOutputStream (fragment.length << 1);
- inflater.setInput (fragment);
- int len;
- try
- {
- while ((len = inflater.inflate (buf)) > 0)
- {
- bout.write (buf, 0, len);
- if (bout.size() > fragmentLength + 1024)
- throw new OverflowException ("inflated data too large");
- }
- }
- catch (DataFormatException dfe)
- {
- throw new SSLException (String.valueOf (dfe));
- }
- fragment = bout.toByteArray();
- inflater.reset();
- }
-
- inSequence++;
- return fragment;
- }
-
- public synchronized byte[] encrypt (byte[] fragment, int off, int len,
- ContentType type)
- throws OverflowException, SSLException
- {
- if (deflater != null)
- {
- byte[] buf = new byte[1024];
- ByteArrayOutputStream bout = new ByteArrayOutputStream (len >>> 1);
- deflater.setInput (fragment, off, len);
- deflater.finish();
- len = 0;
- while ((len = deflater.deflate (buf)) > 0)
- bout.write (buf, 0, len);
- // This should technically never happen for zlib.
- if (bout.size() > fragmentLength + 1024)
- throw new OverflowException ("deflated data too large");
- fragment = bout.toByteArray();
- off = 0;
- len = fragment.length;
- deflater.reset();
- }
-
- if (outMac != null)
- {
- outMac.update ((byte) (inSequence >>> 56));
- outMac.update ((byte) (inSequence >>> 48));
- outMac.update ((byte) (inSequence >>> 40));
- outMac.update ((byte) (inSequence >>> 32));
- outMac.update ((byte) (inSequence >>> 24));
- outMac.update ((byte) (inSequence >>> 16));
- outMac.update ((byte) (inSequence >>> 8));
- outMac.update ((byte) inSequence);
- outMac.update ((byte) type.getValue());
- if (version != ProtocolVersion.SSL_3)
- {
- outMac.update ((byte) version.getMajor());
- outMac.update ((byte) version.getMinor());
- }
- outMac.update ((byte) (len >>> 8));
- outMac.update ((byte) len);
- outMac.update (fragment, off, len);
- fragment = Util.concat (fragment, outMac.doFinal());
- off = 0;
- len = fragment.length;
- }
-
- if (outCipher != null)
- {
- try
- {
- fragment = outCipher.doFinal (fragment, off, len);
- }
- catch (BadPaddingException shouldNeverHappen)
- {
- // This is nonsensical. Don't even pretend that we can handle this.
- throw new RuntimeException ("bad padding thrown while encrypting");
- }
- catch (IllegalBlockSizeException ibse)
- {
- // Ditto.
- throw new RuntimeException ("illegal block size thrown while encrypting");
- }
- off = 0;
- len = fragment.length;
- }
-
- outSequence++;
- if (off == 0 && len == fragment.length)
- return fragment;
- else
- return Util.trim (fragment, off, len);
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/JDBCSessionContext.java b/libjava/classpath/gnu/javax/net/ssl/provider/JDBCSessionContext.java
deleted file mode 100644
index 2b9b1403425..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/JDBCSessionContext.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/* JDBCSessionContext.java -- database persistent sessions.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import java.security.SecureRandom;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateFactory;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.Timestamp;
-import java.sql.Types;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Enumeration;
-import java.util.TreeSet;
-import java.util.Vector;
-
-import javax.net.ssl.SSLSession;
-
-/**
- * The SQL table this class stores sessions in, called <tt>SESSIONS</tt>,
- * looks like this:
- *
- * <blockquote><pre>
- * TABLE SESSIONS (
- * ID VARBINARY(32) PRIMARY KEY UNIQUE NOT NULL,
- * CREATED TIMESTAMP NOT NULL,
- * LAST_ACCESSED TIMESTAMP NOT NULL,
- * PROTOCOL VARCHAR(7) NOT NULL,
- * SUITE VARCHAR(255) NOT NULL,
- * PEER_HOST TEXT NOT NULL,
- * PEER_CERT_TYPE VARCHAR(32),
- * PEER_CERTS BLOB,
- * CERT_TYPE VARCHAR(32),
- * CERTS BLOB,
- * SECRET VARBINARY(48) NOT NULL
- * )
- * </pre></blockquote>
- *
- * <p>Note that the master secret for sessions is not protected before
- * being inserted into the database; it is up to the system to protect
- * the stored data from unauthorized access.
- */
-class JDBCSessionContext extends SessionContext
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- protected Connection connection;
- protected PreparedStatement selectById;
- protected PreparedStatement insert;
- protected PreparedStatement selectTimestamp;
- protected PreparedStatement updateTimestamp;
- protected PreparedStatement deleteSession;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- JDBCSessionContext() throws SQLException
- {
- String url = Util.getSecurityProperty("jessie.SessionContext.jdbc.url");
- String user = Util.getSecurityProperty("jessie.SessionContext.jdbc.user");
- String passwd = Util.getSecurityProperty("jessie.SessionContext.jdbc.password");
- if (url == null)
- {
- throw new IllegalArgumentException("no JDBC URL");
- }
- if (user == null || passwd == null)
- {
- connection = DriverManager.getConnection(url);
- }
- else
- {
- connection = DriverManager.getConnection(url, user, passwd);
- }
- selectById =
- connection.prepareStatement("SELECT * FROM SESSIONS WHERE ID = ?");
- insert = connection.prepareStatement("INSERT INTO SESSIONS VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
- selectTimestamp =
- connection.prepareStatement("SELECT CREATED FROM SESSIONS WHERE ID = ?");
- updateTimestamp =
- connection.prepareStatement("UPDATE SESSIONS SET LAST_ACCESSED = ? WHERE ID = ?");
- deleteSession =
- connection.prepareStatement("DELETE FROM SESSIONS WHERE ID = ?");
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public synchronized Enumeration getIds()
- {
- Vector ids = new Vector();
- try
- {
- Statement stmt = connection.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT ID FROM SESSIONS");
- while (rs.next())
- {
- byte[] id = rs.getBytes("ID");
- ids.add(id);
- }
- }
- catch (SQLException sqle)
- {
- }
- return ids.elements();
- }
-
- public synchronized SSLSession getSession(byte[] sessionId)
- {
- Session session = (Session) super.getSession(sessionId);
- if (session == null)
- {
- try
- {
- selectById.setBytes(1, sessionId);
- ResultSet rs = selectById.executeQuery();
- if (rs.next())
- {
- session = new Session(rs.getTimestamp("CREATED").getTime());
- session.enabledSuites = new ArrayList(SSLSocket.supportedSuites);
- session.enabledProtocols = new TreeSet(SSLSocket.supportedProtocols);
- session.random = new SecureRandom();
- session.context = this;
- session.sessionId = new Session.ID(rs.getBytes("ID"));
- session.setLastAccessedTime(rs.getTimestamp("LAST_ACCESSED").getTime());
- long elapsed = System.currentTimeMillis() - session.getLastAccessedTime();
- if ((int) (elapsed / 1000L) > timeout)
- {
- removeSession(session.sessionId);
- return null;
- }
- session.peerHost = rs.getString("PEER_HOST");
- String protocol = rs.getString("PROTOCOL");
- if (protocol.equals("SSLv3"))
- {
- session.protocol = ProtocolVersion.SSL_3;
- }
- else if (protocol.equals("TLSv1"))
- {
- session.protocol = ProtocolVersion.TLS_1;
- }
- else if (protocol.equals("TLSv1.1"))
- {
- session.protocol = ProtocolVersion.TLS_1_1;
- }
- else
- {
- return null;
- }
- session.cipherSuite = CipherSuite.forName(rs.getString("SUITE"));
- String type = rs.getString("PEER_CERT_TYPE");
- boolean wasNull = rs.wasNull();
- InputStream certs = null;
- if (!wasNull)
- {
- certs = rs.getBinaryStream("PEER_CERTS");
- wasNull = rs.wasNull();
- }
- if (!wasNull)
- {
- CertificateFactory cf = CertificateFactory.getInstance(type);
- session.peerCerts = (Certificate[])
- cf.generateCertificates(certs).toArray(new Certificate[0]);
- session.peerVerified = true;
- }
- type = rs.getString("CERT_TYPE");
- wasNull = rs.wasNull();
- if (!wasNull)
- {
- certs = rs.getBinaryStream("CERTS");
- wasNull = rs.wasNull();
- }
- if (!wasNull)
- {
- CertificateFactory cf = CertificateFactory.getInstance(type);
- session.localCerts = (Certificate[])
- cf.generateCertificates(certs).toArray(new Certificate[0]);
- }
- session.masterSecret = rs.getBytes("SECRET");
- if (cacheSize == 0 || sessions.size() < cacheSize)
- {
- sessions.put(session.sessionId, session);
- }
- }
- }
- catch (Exception ex)
- {
- }
- }
- return session;
- }
-
- synchronized boolean addSession(Session.ID id, Session s)
- {
- if (containsSessionID(id))
- {
- return false;
- }
- try
- {
- insert.setBytes(1, id.getId());
- insert.setTimestamp(2, new Timestamp(s.getCreationTime()));
- insert.setTimestamp(3, new Timestamp(s.getLastAccessedTime()));
- insert.setString(4, s.getProtocol());
- insert.setString(5, s.getCipherSuite());
- insert.setString(6, s.peerHost);
- if (s.peerCerts != null && s.peerCerts.length > 0)
- {
- insert.setString(7, s.peerCerts[0].getType());
- insert.setBytes(8, certs(s.peerCerts));
- }
- else
- {
- insert.setNull(7, Types.VARCHAR);
- insert.setNull(8, Types.LONGVARBINARY);
- }
- if (s.localCerts != null && s.localCerts.length > 0)
- {
- insert.setString(9, s.localCerts[0].getType());
- insert.setBytes(10, certs(s.localCerts));
- }
- else
- {
- insert.setNull(9, Types.VARCHAR);
- insert.setNull(10, Types.LONGVARBINARY);
- }
- insert.setBytes(11, s.masterSecret);
- insert.executeUpdate();
- super.addSession(id, s);
- }
- catch (SQLException sqle)
- {
- return false;
- }
- return true;
- }
-
- synchronized boolean containsSessionID(Session.ID sessionId)
- {
- try
- {
- selectTimestamp.setBytes(1, sessionId.getId());
- ResultSet rs = selectTimestamp.executeQuery();
- if (!rs.next())
- {
- return false;
- }
- Timestamp ts = rs.getTimestamp("CREATED");
- if (rs.wasNull())
- {
- return false;
- }
- long elapsed = System.currentTimeMillis() - ts.getTime();
- if ((int) (elapsed / 1000) > timeout)
- {
- removeSession(sessionId);
- return false;
- }
- return true;
- }
- catch (SQLException sqle)
- {
- return false;
- }
- }
-
- protected boolean removeSession(Session.ID sessionId)
- {
- super.removeSession(sessionId);
- try
- {
- deleteSession.setBytes(1, sessionId.getId());
- return deleteSession.executeUpdate() > 0;
- }
- catch (SQLException sqle)
- {
- }
- return false;
- }
-
- synchronized void notifyAccess(Session session)
- {
- try
- {
- updateTimestamp.setTimestamp(1, new Timestamp(session.getLastAccessedTime()));
- updateTimestamp.setBytes(2, session.getId());
- updateTimestamp.executeUpdate();
- }
- catch (SQLException sqle)
- {
- }
- }
-
- private byte[] certs(Certificate[] certs)
- {
- ByteArrayOutputStream out = new ByteArrayOutputStream(2048);
- for (int i = 0; i < certs.length; i++)
- {
- try
- {
- out.write(certs[i].getEncoded());
- }
- catch (Exception x)
- {
- }
- }
- return out.toByteArray();
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Jessie.java b/libjava/classpath/gnu/javax/net/ssl/provider/Jessie.java
index 14b671d0230..6bd68b3850f 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/Jessie.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/Jessie.java
@@ -59,31 +59,42 @@ import java.security.Provider;
*/
public class Jessie extends Provider
{
+ private static final long serialVersionUID = -1;
- public static final String VERSION = "1.0.0";
- public static final double VERSION_DOUBLE = 1.0;
+ public static final String VERSION = "2.0.0";
+ public static final double VERSION_DOUBLE = 2.0;
public Jessie()
{
super("Jessie", VERSION_DOUBLE,
- "Implementing SSLv3, TLSv1 SSL Contexts; X.509 Key Manager Factories;" +
- System.getProperty("line.separator") +
- "X.509 and SRP Trust Manager Factories, continuously-seeded secure random." );
+ "Implementing TLSv1.1, with SSLv3, TLSv1.0 compatibility modes; "
+ + "X.509 Key Manager Factory; "
+ + "X.509 Trust Manager Factory; "
+ + "SSLv3 MD5 and SHA Mac.");
- AccessController.doPrivileged(new PrivilegedAction()
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
{
public Object run()
{
- put("SSLContext.SSLv3", Context.class.getName());
- put("Alg.Alias.SSLContext.SSL", "SSLv3");
- put("Alg.Alias.SSLContext.TLSv1", "SSLv3");
- put("Alg.Alias.SSLContext.TLS", "SSLv3");
- //put("Alg.Alias.SSLContext.TLSv1.1", "SSLv3");
+ put("SSLContext.TLSv1.1", SSLContextImpl.class.getName());
+ put("Alg.Alias.SSLContext.SSLv3", "TLSv1.1");
+ put("Alg.Alias.SSLContext.TLSv1", "TLSv1.1");
+ put("Alg.Alias.SSLContext.TLSv1.0", "TLSv1.1");
+ put("Alg.Alias.SSLContext.TLS", "TLSv1.1");
+ put("Alg.Alias.SSLContext.SSL", "TLSv1.1");
put("KeyManagerFactory.JessieX509", X509KeyManagerFactory.class.getName());
put("TrustManagerFactory.JessieX509", X509TrustManagerFactory.class.getName());
- put("TrustManagerFactory.SRP", SRPTrustManagerFactory.class.getName());
+ put("KeyManagerFactory.JessiePSK", PreSharedKeyManagerFactoryImpl.class.getName());
+ //put("TrustManagerFactory.SRP", SRPTrustManagerFactory.class.getName());
+ put("Mac.SSLv3HMac-MD5", SSLv3HMacMD5Impl.class.getName());
+ put("Mac.SSLv3HMac-SHA", SSLv3HMacSHAImpl.class.getName());
+
+ put("Signature.TLSv1.1-RSA", SSLRSASignatureImpl.class.getName());
+ put("Alg.Alias.Signature.TLSv1-RSA", "TLSv1.1-RSA");
+ put("Alg.Alias.Signature.SSLv3-RSA", "TLSv1.1-RSA");
+
return null;
}
});
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/JessieDHPrivateKey.java b/libjava/classpath/gnu/javax/net/ssl/provider/JessieDHPrivateKey.java
deleted file mode 100644
index 1997458dd24..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/JessieDHPrivateKey.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/* JessieDHPrivateKey.java -- simple DH private key.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.math.BigInteger;
-
-import javax.crypto.interfaces.DHPrivateKey;
-import javax.crypto.spec.DHParameterSpec;
-
-class JessieDHPrivateKey implements DHPrivateKey
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private final DHParameterSpec params;
- private final BigInteger x;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- JessieDHPrivateKey(DHParameterSpec params, BigInteger x)
- {
- this.params = params;
- this.x = x;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public String getAlgorithm()
- {
- return "Diffie-Hellman";
- }
-
- public String getFormat()
- {
- return "NONE";
- }
-
- public byte[] getEncoded()
- {
- return null;
- }
-
- public DHParameterSpec getParams()
- {
- return params;
- }
-
- public BigInteger getX()
- {
- return x;
- }
-
- public String toString()
- {
- String nl = System.getProperty("line.separator");
- return "P: " + params.getP() + nl +
- "G: " + params.getG() + nl +
- "X: " + x;
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/JessieDHPublicKey.java b/libjava/classpath/gnu/javax/net/ssl/provider/JessieDHPublicKey.java
deleted file mode 100644
index dc6587288e6..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/JessieDHPublicKey.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/* JessieDHPublicKey.java -- simple DH public key.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.math.BigInteger;
-
-import javax.crypto.interfaces.DHPublicKey;
-import javax.crypto.spec.DHParameterSpec;
-
-class JessieDHPublicKey implements DHPublicKey
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private final DHParameterSpec params;
- private final BigInteger y;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- JessieDHPublicKey(DHParameterSpec params, BigInteger y)
- {
- this.params = params;
- this.y = y;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public String getAlgorithm()
- {
- return "Diffie-Hellman";
- }
-
- public String getFormat()
- {
- return "NONE";
- }
-
- public byte[] getEncoded()
- {
- return null;
- }
-
- public DHParameterSpec getParams()
- {
- return params;
- }
-
- public BigInteger getY()
- {
- return y;
- }
-
- public String toString()
- {
- String nl = System.getProperty("line.separator");
- return "P: " + params.getP() + nl +
- "G: " + params.getG() + nl +
- "Y: " + y;
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/JessieRSAPrivateKey.java b/libjava/classpath/gnu/javax/net/ssl/provider/JessieRSAPrivateKey.java
deleted file mode 100644
index 4ec71a7aad3..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/JessieRSAPrivateKey.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* JessieRSAPrivateKey.java -- simple RSA private key.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.math.BigInteger;
-import java.security.interfaces.RSAPrivateKey;
-
-class JessieRSAPrivateKey implements RSAPrivateKey
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private final BigInteger modulus;
- private final BigInteger exponent;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- JessieRSAPrivateKey(BigInteger modulus, BigInteger exponent)
- {
- this.modulus = modulus;
- this.exponent = exponent;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public String getAlgorithm()
- {
- return "RSA";
- }
-
- public String getFormat()
- {
- return "NONE";
- }
-
- public byte[] getEncoded()
- {
- return null;
- }
-
- public BigInteger getModulus()
- {
- return modulus;
- }
-
- public BigInteger getPrivateExponent()
- {
- return exponent;
- }
-
- public String toString()
- {
- String nl = System.getProperty("line.separator");
- return "RSAPrivateKey {" + nl +
- " modulus = " + modulus.toString(16) + ";" + nl +
- " exponent = " + exponent.toString(16) + ";" + nl +
- "};";
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/JessieRSAPublicKey.java b/libjava/classpath/gnu/javax/net/ssl/provider/JessieRSAPublicKey.java
deleted file mode 100644
index 19921d98c67..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/JessieRSAPublicKey.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* JessieRSAPublicKey.java -- simple RSA public key.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.math.BigInteger;
-import java.security.interfaces.RSAPublicKey;
-
-class JessieRSAPublicKey implements RSAPublicKey
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private final BigInteger modulus;
- private final BigInteger exponent;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- JessieRSAPublicKey(BigInteger modulus, BigInteger exponent)
- {
- this.modulus = modulus;
- this.exponent = exponent;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public String getAlgorithm()
- {
- return "RSA";
- }
-
- public String getFormat()
- {
- return "NONE";
- }
-
- public byte[] getEncoded()
- {
- return null;
- }
-
- public BigInteger getModulus()
- {
- return modulus;
- }
-
- public BigInteger getPublicExponent()
- {
- return exponent;
- }
-
- public String toString()
- {
- String nl = System.getProperty("line.separator");
- return "RSAPublicKey {" + nl +
- " modulus = " + modulus.toString(16) + ";" + nl +
- " exponent = " + exponent.toString(16) + ";" + nl +
- "};";
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/KeyExchangeAlgorithm.java b/libjava/classpath/gnu/javax/net/ssl/provider/KeyExchangeAlgorithm.java
new file mode 100644
index 00000000000..04416c5a5cc
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/KeyExchangeAlgorithm.java
@@ -0,0 +1,57 @@
+/* KeyExchangeAlgorithm.java -- Key exchange algorithm enumeration.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+/**
+ * The enumeration of supported key exchange algorithms.
+ */
+public enum KeyExchangeAlgorithm
+{
+ NONE,
+ RSA,
+ DH_DSS,
+ DH_RSA,
+ DH_anon,
+ DHE_DSS,
+ DHE_RSA,
+// SRP,
+ PSK,
+ DHE_PSK,
+ RSA_PSK;
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/KeyPool.java b/libjava/classpath/gnu/javax/net/ssl/provider/KeyPool.java
deleted file mode 100644
index 18d9dc281ab..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/KeyPool.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/* KeyPool.java -- A set of ephemeral key pairs.
- Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.math.BigInteger;
-import java.security.KeyPair;
-import java.security.SecureRandom;
-
-final class KeyPool
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private static final BigInteger ONE = BigInteger.ONE;
- private static final BigInteger TWO = BigInteger.valueOf(2L);
- private static final BigInteger E = BigInteger.valueOf(65537L);
- private static final SecureRandom RANDOM = new SecureRandom ();
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- private KeyPool()
- {
- }
-
- // Class methods.
- // -------------------------------------------------------------------------
-
- /**
- * Generate an export-class (512 bit) RSA key pair.
- *
- * @return The new key pair.
- */
- static KeyPair generateRSAKeyPair()
- {
- BigInteger p, q, n, d;
-
- // Simplified version of GNU Crypto's RSAKeyPairGenerator.
-
- int M = 256;
- BigInteger lower = TWO.pow(255);
- BigInteger upper = TWO.pow(256).subtract(ONE);
- byte[] kb = new byte[32];
- while (true)
- {
- nextBytes(kb);
- p = new BigInteger(1, kb).setBit(0);
- if (p.compareTo(lower) >= 0 && p.compareTo(upper) <= 0 &&
- p.isProbablePrime(80) && p.gcd(E).equals(ONE))
- break;
- }
-
- while (true)
- {
- nextBytes(kb);
- q = new BigInteger(1, kb).setBit(0);
- n = q.multiply(p);
- if (n.bitLength() == 512 && q.isProbablePrime(80) &&
- q.gcd(E).equals(ONE))
- break;
- }
-
- d = E.modInverse(p.subtract(ONE).multiply(q.subtract(ONE)));
-
- return new KeyPair(new JessieRSAPublicKey(n, E),
- new JessieRSAPrivateKey(n, d));
- }
-
- private static void nextBytes(byte[] buf)
- {
- RANDOM.nextBytes (buf);
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/MacAlgorithm.java b/libjava/classpath/gnu/javax/net/ssl/provider/MacAlgorithm.java
new file mode 100644
index 00000000000..cae0efbfa80
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/MacAlgorithm.java
@@ -0,0 +1,47 @@
+/* MacAlgorithm.java -- MAC algorithm enumeration.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+/**
+ * An enumeration of MAC algorithms we support.
+ */
+public enum MacAlgorithm
+{
+ NULL, MD5, SHA;
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/MaxFragmentLength.java b/libjava/classpath/gnu/javax/net/ssl/provider/MaxFragmentLength.java
new file mode 100644
index 00000000000..eb63958b839
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/MaxFragmentLength.java
@@ -0,0 +1,59 @@
+package gnu.javax.net.ssl.provider;
+
+import gnu.javax.net.ssl.provider.Extension.Value;
+
+import java.nio.ByteBuffer;
+
+/**
+ * Extension value
+ * @author csm
+ */
+public class MaxFragmentLength extends Value
+{
+ public static final MaxFragmentLength LEN_2_9 = new MaxFragmentLength(1, 1 << 9);
+ public static final MaxFragmentLength LEN_2_10 = new MaxFragmentLength(2, 1 << 10);
+ public static final MaxFragmentLength LEN_2_11 = new MaxFragmentLength(3, 1 << 11);
+ public static final MaxFragmentLength LEN_2_12 = new MaxFragmentLength(4, 1 << 12);
+
+ private final int value;
+ private final int length;
+
+ private MaxFragmentLength(int value, int length)
+ {
+ this.value = value;
+ this.length = length;
+ }
+
+ public ByteBuffer buffer()
+ {
+ return ByteBuffer.allocate(1).put(0, (byte) value);
+ }
+
+ public int length()
+ {
+ return 1;
+ }
+
+ public int getValue()
+ {
+ return value;
+ }
+
+ public int maxLength()
+ {
+ return length;
+ }
+
+ public String toString()
+ {
+ return toString(null);
+ }
+
+ public String toString(String prefix)
+ {
+ String s = "max_fragment_length = ";
+ if (prefix != null)
+ s = prefix + s;
+ return s + maxLength() + ";";
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/OutputSecurityParameters.java b/libjava/classpath/gnu/javax/net/ssl/provider/OutputSecurityParameters.java
new file mode 100644
index 00000000000..6da0d066741
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/OutputSecurityParameters.java
@@ -0,0 +1,297 @@
+/* OutputSecurityParameters.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.classpath.debug.Component;
+import gnu.classpath.debug.SystemLogger;
+import gnu.java.security.util.ByteArray;
+import gnu.java.security.util.ByteBufferOutputStream;
+
+import java.nio.ByteBuffer;
+
+import java.util.logging.Level;
+import java.util.zip.DataFormatException;
+import java.util.zip.Deflater;
+
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.Mac;
+import javax.crypto.ShortBufferException;
+
+public class OutputSecurityParameters
+{
+ private static final SystemLogger logger = SystemLogger.SYSTEM;
+ private final Cipher cipher;
+ private final Mac mac;
+ private final Deflater deflater;
+ private final SessionImpl session;
+ private final CipherSuite suite;
+ private long sequence;
+
+ public OutputSecurityParameters (final Cipher cipher, final Mac mac,
+ final Deflater deflater, SessionImpl session,
+ CipherSuite suite)
+ {
+ this.cipher = cipher;
+ this.mac = mac;
+ this.deflater = deflater;
+ this.session = session;
+ this.suite = suite;
+ sequence = 0;
+ }
+
+ /**
+ * Encrypt a record, storing the result in the given output buffer.
+ *
+ * @return The number of bytes taken from the input, and the number stored
+ * into `output;' that is, the size of the encrypted fragment, plus the
+ * encoding for the record.
+ */
+ public int[] encrypt (final ByteBuffer[] input, int offset, int length,
+ final ContentType contentType, final ByteBuffer output)
+ throws DataFormatException, IllegalBlockSizeException, ShortBufferException
+ {
+ if (offset < 0 || offset >= input.length
+ || length <= 0 || offset + length > input.length)
+ throw new IndexOutOfBoundsException();
+
+ if (Debug.DEBUG)
+ for (int i = offset; i < offset+length; i++)
+ logger.logv(Component.SSL_RECORD_LAYER, "encrypting record [{0}]: {1}",
+ i-offset, input[i]);
+
+ int maclen = 0;
+ if (mac != null)
+ maclen = session.isTruncatedMac() ? 10 : mac.getMacLength ();
+
+ int ivlen = 0;
+ byte[] iv = null;
+ if (session.version.compareTo(ProtocolVersion.TLS_1_1) >= 0
+ && !suite.isStreamCipher())
+ {
+ ivlen = cipher.getBlockSize();
+ iv = new byte[ivlen];
+ session.random().nextBytes(iv);
+ }
+
+ int padaddlen = 0;
+ if (!suite.isStreamCipher()
+ && session.version.compareTo(ProtocolVersion.TLS_1) >= 0)
+ {
+ padaddlen = (session.random().nextInt(255 / cipher.getBlockSize())
+ * cipher.getBlockSize());
+ }
+
+ int fragmentLength = 0;
+ ByteBuffer[] fragments = null;
+ // Compress the content, if needed.
+ if (deflater != null)
+ {
+ ByteBufferOutputStream deflated = new ByteBufferOutputStream();
+
+ byte[] inbuf = new byte[1024];
+ byte[] outbuf = new byte[1024];
+ int written = 0;
+
+ // Here we use the guarantee that the deflater won't increase the
+ // output size by more than 1K -- we resign ourselves to only deflate
+ // as much data as we have space for *uncompressed*,
+ int limit = output.remaining() - (maclen + ivlen + padaddlen) - 1024;
+
+ for (int i = offset; i < length && written < limit; i++)
+ {
+ ByteBuffer in = input[i];
+ while (in.hasRemaining() && written < limit)
+ {
+ int l = Math.min(in.remaining(), inbuf.length);
+ l = Math.min(limit - written, l);
+ in.get(inbuf, 0, l);
+ deflater.setInput(inbuf, 0, l);
+ l = deflater.deflate(outbuf);
+ deflated.write(outbuf, 0, l);
+ written += l;
+ }
+ }
+ deflater.finish();
+ while (!deflater.finished())
+ {
+ int l = deflater.deflate(outbuf);
+ deflated.write(outbuf, 0, l);
+ written += l;
+ }
+ fragments = new ByteBuffer[] { deflated.buffer() };
+ fragmentLength = ((int) deflater.getBytesWritten()) + maclen + ivlen;
+ deflater.reset();
+ offset = 0;
+ length = 1;
+ }
+ else
+ {
+ int limit = output.remaining() - (maclen + ivlen + padaddlen);
+ fragments = input;
+ for (int i = offset; i < length && fragmentLength < limit; i++)
+ {
+ int l = Math.min(limit - fragmentLength, fragments[i].remaining());
+ fragmentLength += l;
+ }
+ fragmentLength += maclen + ivlen;
+ }
+
+ // Compute padding...
+ int padlen = 0;
+ byte[] pad = null;
+ if (!suite.isStreamCipher())
+ {
+ int bs = cipher.getBlockSize();
+ padlen = bs - (fragmentLength % bs);
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_RECORD_LAYER,
+ "framentLen:{0} padlen:{1} blocksize:{2}",
+ fragmentLength, padlen, bs);
+ if (session.version.compareTo(ProtocolVersion.TLS_1) >= 0)
+ {
+ // TLS 1.0 and later uses a random amount of padding, up to
+ // 255 bytes. Each byte of the pad is equal to the padding
+ // length, minus one.
+ padlen += padaddlen;
+ while (padlen > 255)
+ padlen -= bs;
+ pad = new byte[padlen];
+ for (int i = 0; i < padlen; i++)
+ pad[i] = (byte) (padlen - 1);
+ }
+ else
+ {
+ // SSL 3 uses a pad only as large as the block size, but the
+ // pad may contain any values.
+ pad = new byte[padlen];
+ session.random().nextBytes(pad);
+ pad[padlen - 1] = (byte) (padlen - 1);
+ }
+ fragmentLength += pad.length;
+ }
+
+ // If there is a MAC, compute it.
+ byte[] macValue = null;
+ if (mac != null)
+ {
+ mac.update((byte) (sequence >>> 56));
+ mac.update((byte) (sequence >>> 48));
+ mac.update((byte) (sequence >>> 40));
+ mac.update((byte) (sequence >>> 32));
+ mac.update((byte) (sequence >>> 24));
+ mac.update((byte) (sequence >>> 16));
+ mac.update((byte) (sequence >>> 8));
+ mac.update((byte) sequence);
+ mac.update((byte) contentType.getValue());
+ if (session.version != ProtocolVersion.SSL_3)
+ {
+ mac.update((byte) session.version.major ());
+ mac.update((byte) session.version.minor ());
+ }
+ int toWrite = fragmentLength - maclen - ivlen - padlen;
+ mac.update((byte) (toWrite >>> 8));
+ mac.update((byte) toWrite);
+ int written = 0;
+ for (int i = offset; i < length && written < toWrite; i++)
+ {
+ ByteBuffer fragment = fragments[i].duplicate();
+ int l = Math.min(fragment.remaining(), toWrite - written);
+ fragment.limit(fragment.position() + l);
+ mac.update(fragment);
+ }
+ macValue = mac.doFinal();
+ }
+
+ Record outrecord = new Record(output);
+ outrecord.setContentType(contentType);
+ outrecord.setVersion(session.version);
+ outrecord.setLength(fragmentLength);
+
+ int consumed = 0;
+ ByteBuffer outfragment = outrecord.fragment();
+
+ if (cipher != null)
+ {
+ if (iv != null)
+ cipher.update(ByteBuffer.wrap(iv), outfragment);
+ int toWrite = fragmentLength - maclen - ivlen - padlen;
+ for (int i = offset; i < offset + length && consumed < toWrite; i++)
+ {
+ ByteBuffer fragment = fragments[i].slice();
+ int l = Math.min(fragment.remaining(), toWrite - consumed);
+ fragment.limit(fragment.position() + l);
+ cipher.update(fragment, outfragment);
+ fragments[i].position(fragments[i].position() + l);
+ consumed += l;
+ }
+ if (macValue != null)
+ cipher.update(ByteBuffer.wrap(macValue), outfragment);
+ if (pad != null)
+ cipher.update(ByteBuffer.wrap(pad), outfragment);
+ }
+ else
+ {
+ // iv and pad are only used if we have a block cipher.
+ int toWrite = fragmentLength - maclen;
+ for (int i = offset; i < offset + length && consumed < toWrite; i++)
+ {
+ ByteBuffer fragment = fragments[i];
+ int l = Math.min(fragment.remaining(), toWrite - consumed);
+ fragment.limit(fragment.position() + l);
+ outfragment.put(fragment);
+ consumed += l;
+ }
+ if (macValue != null)
+ outfragment.put(macValue);
+ }
+
+ // Advance the output buffer's position.
+ output.position(output.position() + outrecord.length() + 5);
+ sequence++;
+
+ return new int[] { consumed, fragmentLength + 5 };
+ }
+
+ CipherSuite suite()
+ {
+ return suite;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/OverflowException.java b/libjava/classpath/gnu/javax/net/ssl/provider/OverflowException.java
deleted file mode 100644
index 93bdcaec5ed..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/OverflowException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/* OverflowException.java -- signals an input overflow.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.IOException;
-
-class OverflowException extends IOException
-{
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- OverflowException()
- {
- }
-
- OverflowException(String msg)
- {
- super(msg);
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/PreSharedKeyManagerFactoryImpl.java b/libjava/classpath/gnu/javax/net/ssl/provider/PreSharedKeyManagerFactoryImpl.java
new file mode 100644
index 00000000000..aa1f97853cf
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/PreSharedKeyManagerFactoryImpl.java
@@ -0,0 +1,118 @@
+/* PreSharedKeyManagerFactory.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.javax.net.ssl.PreSharedKeyManager;
+import gnu.javax.net.ssl.PreSharedKeyManagerParameters;
+
+import java.security.InvalidAlgorithmParameterException;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.UnrecoverableKeyException;
+import java.util.Iterator;
+
+import javax.crypto.SecretKey;
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactorySpi;
+import javax.net.ssl.ManagerFactoryParameters;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class PreSharedKeyManagerFactoryImpl
+ extends KeyManagerFactorySpi
+{
+ PreSharedKeyManagerParameters params;
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.KeyManagerFactorySpi#engineGetKeyManagers()
+ */
+ @Override protected KeyManager[] engineGetKeyManagers()
+ {
+ if (params == null)
+ throw new IllegalStateException("not initialized");
+ return new KeyManager[] { new Manager() };
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.KeyManagerFactorySpi#engineInit(javax.net.ssl.ManagerFactoryParameters)
+ */
+ @Override protected void engineInit(ManagerFactoryParameters params)
+ throws InvalidAlgorithmParameterException
+ {
+ if (!(params instanceof PreSharedKeyManagerParameters))
+ throw new InvalidAlgorithmParameterException("only supports gnu.javax.net.ssl.PreSharedKeyManagerParameters");
+ params = (PreSharedKeyManagerParameters) params;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.KeyManagerFactorySpi#engineInit(java.security.KeyStore, char[])
+ */
+ @Override protected void engineInit(KeyStore store, char[] passwd)
+ throws KeyStoreException, NoSuchAlgorithmException,
+ UnrecoverableKeyException
+ {
+ // XXX Could implement this.
+ }
+
+ class Manager implements PreSharedKeyManager
+ {
+ Manager()
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.PreSharedKeyManager#getKey(java.lang.String)
+ */
+ public SecretKey getKey(String name) throws KeyManagementException
+ {
+ return params.getKey(name);
+ }
+
+ public String chooseIdentityHint()
+ {
+ Iterator<String> it = params.identities();
+ if (it.hasNext())
+ return it.next();
+ return null;
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ProtocolVersion.java b/libjava/classpath/gnu/javax/net/ssl/provider/ProtocolVersion.java
index 5f5d1d979aa..ca62054a89c 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/ProtocolVersion.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ProtocolVersion.java
@@ -42,15 +42,16 @@ import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
-final class ProtocolVersion implements Comparable, Constructed
+public final class ProtocolVersion
+ implements Comparable<ProtocolVersion>, Constructed
{
// Constants and fields.
// -------------------------------------------------------------------------
- static final ProtocolVersion SSL_3 = new ProtocolVersion(3, 0);
- static final ProtocolVersion TLS_1 = new ProtocolVersion(3, 1);
- static final ProtocolVersion TLS_1_1 = new ProtocolVersion(3, 2);
+ public static final ProtocolVersion SSL_3 = new ProtocolVersion(3, 0);
+ public static final ProtocolVersion TLS_1 = new ProtocolVersion(3, 1);
+ public static final ProtocolVersion TLS_1_1 = new ProtocolVersion(3, 2);
private final int major;
private final int minor;
@@ -67,14 +68,25 @@ final class ProtocolVersion implements Comparable, Constructed
// Class methods.
// -------------------------------------------------------------------------
- static ProtocolVersion read(InputStream in) throws IOException
+ public static ProtocolVersion read(InputStream in) throws IOException
{
int major = in.read() & 0xFF;
int minor = in.read() & 0xFF;
return getInstance(major, minor);
}
- static ProtocolVersion getInstance(int major, int minor)
+ public static ProtocolVersion forName (final String name)
+ {
+ if (name.equalsIgnoreCase ("SSLv3"))
+ return SSL_3;
+ if (name.equalsIgnoreCase ("TLSv1"))
+ return TLS_1;
+ if (name.equalsIgnoreCase("TLSv1.1"))
+ return TLS_1_1;
+ throw new IllegalArgumentException ("unknown protocol name: " + name);
+ }
+
+ public static ProtocolVersion getInstance(final int major, final int minor)
{
if (major == 3)
{
@@ -88,35 +100,46 @@ final class ProtocolVersion implements Comparable, Constructed
return new ProtocolVersion(major, minor);
}
+ public static ProtocolVersion getInstance (final short raw_value)
+ {
+ int major = raw_value >>> 8 & 0xFF;
+ int minor = raw_value & 0xFF;
+ return getInstance (major, minor);
+ }
+
// Instance methods.
// -------------------------------------------------------------------------
- public void write(OutputStream out) throws IOException
+ public int length ()
{
- out.write(major);
- out.write(minor);
+ return 2;
}
- byte[] getEncoded()
+ public byte[] getEncoded()
{
return new byte[] {
(byte) major, (byte) minor
};
}
- int getMajor()
+ public int major()
{
return major;
}
- int getMinor()
+ public int minor()
{
return minor;
}
+ public int rawValue ()
+ {
+ return (major << 8) | minor;
+ }
+
public boolean equals(Object o)
{
- if (o == null || !(o instanceof ProtocolVersion))
+ if (!(o instanceof ProtocolVersion))
{
return false;
}
@@ -129,35 +152,33 @@ final class ProtocolVersion implements Comparable, Constructed
return major << 8 | minor;
}
- public int compareTo(Object o)
+ public int compareTo(ProtocolVersion that)
{
- if (o == null || !(o instanceof ProtocolVersion))
+ if (major > that.major)
{
return 1;
}
- if (this.equals(o))
- {
- return 0;
- }
- if (major > ((ProtocolVersion) o).major)
- {
- return 1;
- }
- else if (major < ((ProtocolVersion) o).major)
+ else if (major < that.major)
{
return -1;
}
- if (minor > ((ProtocolVersion) o).minor)
+
+ if (minor > that.minor)
{
return 1;
}
- else if (minor < ((ProtocolVersion) o).minor)
+ else if (minor < that.minor)
{
return -1;
}
return 0;
}
+ public String toString (String prefix)
+ {
+ return toString ();
+ }
+
public String toString()
{
if (this == SSL_3)
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Random.java b/libjava/classpath/gnu/javax/net/ssl/provider/Random.java
index c42592b147b..e6815930934 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/Random.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/Random.java
@@ -45,80 +45,110 @@ import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
-class Random implements Constructed
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+/**
+ * An SSL nonce.
+ *
+ * <pre>
+struct
+{
+ uint32 gmt_unix_time;
+ opaque random_bytes[28];
+} Random;
+ */
+public class Random implements Builder, Constructed
{
// Fields.
// -------------------------------------------------------------------------
- private final int gmtUnixTime;
- private final byte[] randomBytes;
+ static final int RANDOM_LENGTH = 28;
+
+ private final ByteBuffer buffer;
// Constructors.
// -------------------------------------------------------------------------
- Random(int gmtUnixTime, byte[] randomBytes)
+ public Random (final ByteBuffer buffer)
{
- this.gmtUnixTime = gmtUnixTime;
- this.randomBytes = (byte[]) randomBytes.clone();
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
}
- // Class methods.
- // -------------------------------------------------------------------------
+ public Random copy()
+ {
+ ByteBuffer buffer = ByteBuffer.allocate(32);
+ buffer.put((ByteBuffer) this.buffer.duplicate().position(0));
+ return new Random(buffer);
+ }
- static Random read(InputStream in) throws IOException
+ public int length()
{
- int time = (in.read() & 0xFF) << 24 | (in.read() & 0xFF) << 16
- | (in.read() & 0xFF) << 8 | (in.read() & 0xFF);
- byte[] buf = new byte[28];
- in.read(buf);
- return new Random(time, buf);
+ return RANDOM_LENGTH + 4;
+ }
+
+ public ByteBuffer buffer()
+ {
+ return ((ByteBuffer) buffer.duplicate().position(0).limit(length())).slice();
}
- // Instance methods.
- // -------------------------------------------------------------------------
+ public int gmtUnixTime ()
+ {
+ return buffer.getInt(0);
+ }
- public void write(OutputStream out) throws IOException
+ public byte[] randomBytes()
{
- out.write((gmtUnixTime >>> 24) & 0xFF);
- out.write((gmtUnixTime >>> 16) & 0xFF);
- out.write((gmtUnixTime >>> 8) & 0xFF);
- out.write(gmtUnixTime & 0xFF);
- out.write(randomBytes);
+ byte[] buf = new byte[28];
+ buffer.position (4);
+ buffer.get (buf);
+ return buf;
}
- byte[] getEncoded()
+ public void setGmtUnixTime (final int gmtUnixTime)
{
- ByteArrayOutputStream bout = new ByteArrayOutputStream(32);
- try
- {
- write(bout);
- }
- catch (IOException cantHappen)
- {
- throw new Error(cantHappen.toString());
- }
- return bout.toByteArray();
+ buffer.putInt (0, gmtUnixTime);
}
- int getTime()
+ public void setRandomBytes (final byte[] randomBytes)
{
- return gmtUnixTime;
+ setRandomBytes (randomBytes, 0);
}
- byte[] getRandomBytes()
+ public void setRandomBytes (final byte[] randomBytes, final int offset)
{
- return randomBytes;
+ if (randomBytes.length - offset < RANDOM_LENGTH)
+ throw new IllegalArgumentException ("random value too short");
+ buffer.position (4);
+ buffer.put (randomBytes, offset, RANDOM_LENGTH);
}
- public String toString()
+ public String toString (final String prefix)
{
StringWriter str = new StringWriter();
PrintWriter out = new PrintWriter(str);
+ if (prefix != null)
+ out.print (prefix);
out.println("struct {");
- out.println(" gmt_unix_time = " + gmtUnixTime + ";");
- out.println(" random_bytes = " + Util.toHexString(randomBytes, ':') + ";");
- out.println("} Random;");
+ if (prefix != null)
+ out.print (prefix);
+ out.print (" gmt_unix_time: ");
+ out.print (gmtUnixTime ());
+ out.println (";");
+ if (prefix != null)
+ out.print (prefix);
+ out.print (" random_bytes: ");
+ out.print (Util.toHexString (randomBytes (), ':'));
+ out.println (";");
+ if (prefix != null)
+ out.print (prefix);
+ out.print ("} Random;");
return str.toString();
}
+
+ public String toString ()
+ {
+ return toString (null);
+ }
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Record.java b/libjava/classpath/gnu/javax/net/ssl/provider/Record.java
new file mode 100644
index 00000000000..6f5a23ef4dc
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/Record.java
@@ -0,0 +1,198 @@
+/* Record.java -- A single SSL Record.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+/**
+ * A SSL/TLS record structure. An SSL record is defined to be:
+ *
+ * <pre>
+struct
+{
+ {@link ContentType} type;
+ {@link ProtocolVersion} version;
+ uint16 length;
+ opaque fragment[TLSPlaintext.length];
+} TLSPlaintext;
+</pre>
+ */
+public class Record
+{
+ private final ByteBuffer buffer;
+
+ public Record (final ByteBuffer buffer)
+ {
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ }
+
+ // XXX remove
+ public ContentType getContentType ()
+ {
+ return contentType ();
+ }
+
+ /**
+ * Gets the content type field.
+ *
+ * @return The content type field.
+ */
+ public ContentType contentType ()
+ {
+ return ContentType.forInteger (buffer.get (0) & 0xFF);
+ }
+
+ /**
+ * Get the fragment content, storing it into <code>sink</code>.
+ *
+ * @param sink The sink for the fragment bytes.
+ * @return The number of bytes put into <code>sink</code>
+ */
+ public int fragment (final ByteBuffer sink)
+ {
+ int length = length ();
+ sink.put (((ByteBuffer) buffer.limit (5 + length).position (5)).slice ());
+ return length;
+ }
+
+ /**
+ * Returns the fragment field as a ByteBuffer. The returned buffer
+ * is shared with this object's underlying buffer, so it will share
+ * its attributes. For example, if the underlying buffer is
+ * read-only, the returned buffer will be read-only.
+ *
+ * @return The fragment buffer.
+ */
+ public ByteBuffer fragment ()
+ {
+ int length = length ();
+ return ((ByteBuffer) buffer.limit (5 + length).position (5)).slice ();
+ }
+
+ /**
+ * Gets the fragment length.
+ *
+ * @return The fragment length.
+ */
+ public int length ()
+ {
+ // XXX this is different behavior than we usually want: we return the
+ // length field, not the total length. We should consider changing this.
+ return buffer.getShort (3) & 0xFFFF;
+ }
+
+ /**
+ * Gets the protocol version field.
+ *
+ * @return The protocol version field.
+ */
+ public ProtocolVersion version ()
+ {
+ int major = buffer.get (1) & 0xFF;
+ int minor = buffer.get (2) & 0xFF;
+ return ProtocolVersion.getInstance (major, minor);
+ }
+
+ /**
+ * Sets the content type field.
+ *
+ * @param type The content type.
+ * @throws java.nio.ReadOnlyBufferException If the underlying buffer
+ * is not writeable.
+ * @throws NullPointerException If <i>type</i> is <code>null</code>.
+ */
+ public void setContentType (final ContentType type)
+ {
+ buffer.put (0, (byte) type.getValue ());
+ }
+
+ /**
+ * Sets the fragment length.
+ *
+ * @param length The fragment length.
+ * @throws java.nio.ReadOnlyBufferException If the underlying buffer
+ * is not writeable.
+ * @throws IllegalArgumentException If the length is not between 0
+ * and 16384, inclusive.
+ */
+ public void setLength (final int length)
+ {
+ if (length < 0 || length > 16384)
+ throw new IllegalArgumentException ("length " + length + " out of range; "
+ + "must be between 0 and 16384");
+ buffer.putShort (3, (short) length);
+ }
+
+ /**
+ * Sets the protocol version field.
+ *
+ * @param version The protocol version.
+ * @throws java.nio.ReadOnlyBufferException If the underlying buffer
+ * is not writeable.
+ * @throws NullPointerException If <i>version</i> is <code>null</code>.
+ */
+ public void setVersion (final ProtocolVersion version)
+ {
+ buffer.put (1, (byte) version.major ()).put (2, (byte) version.minor ());
+ }
+
+ public String toString ()
+ {
+ StringWriter str = new StringWriter ();
+ PrintWriter out = new PrintWriter (str);
+ out.println ("struct {");
+ out.print (" type: ");
+ out.print (contentType ());
+ out.println (";");
+ out.print (" version: ");
+ out.print (version ());
+ out.println (";");
+ out.print(" length: ");
+ out.print(length());
+ out.println(";");
+ out.println (" fragment {");
+ out.print (Util.hexDump (fragment (), " "));
+ out.println (" };");
+ out.print ("} Record;");
+ return str.toString ();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/RecordInput.java b/libjava/classpath/gnu/javax/net/ssl/provider/RecordInput.java
deleted file mode 100644
index d4ba5b596d6..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/RecordInput.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/* RecordInput.java -- record layer input.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import gnu.classpath.SystemProperties;
-import gnu.classpath.debug.Component;
-import gnu.classpath.debug.SystemLogger;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-import java.util.logging.Logger;
-
-import javax.net.ssl.SSLProtocolException;
-
-class RecordInput
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private static final boolean DEBUG_RECORD_LAYER = true;
- private static final Logger logger = SystemLogger.SYSTEM;
-
- private byte[] fragment;
- private int index;
- private ContentType type;
-
- private final DataInputStream in;
- private Session session;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- RecordInput (final InputStream in, final Session session)
- {
- this.in = new DataInputStream (in);
- this.session = session;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- synchronized int available (ContentType type) throws IOException
- {
- if (fragment == null)
- {
- readRecord ();
- }
- if (type != this.type)
- {
- return 0;
- }
- return fragment.length - index;
- }
-
- void setSession (Session session)
- {
- this.session = session;
- }
-
- synchronized int read (byte[] buf, int off, int len, ContentType type)
- throws IOException
- {
- if (off < 0 || len < 0 || off + len > buf.length)
- {
- throw new ArrayIndexOutOfBoundsException ("size=" + buf.length +
- " off=" + off + " len=" + len);
- }
- if (fragment == null || index >= fragment.length)
- {
- readRecord ();
- }
- if (type != this.type)
- {
- return 0;
- }
- len = Math.min (len, fragment.length - index);
- System.arraycopy (fragment, index, buf, off, len);
- index += len;
- return len;
- }
-
- boolean pollClose () throws IOException
- {
- if (fragment == null || index >= fragment.length)
- {
- try
- {
- readRecord();
- }
- catch (AlertException ae)
- {
- Alert alert = ae.getAlert();
- if (alert.getDescription() == Alert.Description.CLOSE_NOTIFY)
- {
- return true;
- }
- throw ae;
- }
- }
- return false;
- }
-
- private void readRecord() throws IOException
- {
- type = ContentType.read (in);
- if ((type.getValue() & 0x80) != 0 || (type.getValue() & 0x40) != 0)
- {
- in.read();
- if ((type.getValue() & 0x40) != 0)
- {
- in.read();
- }
- type = ContentType.read(in);
- if (type != ContentType.CLIENT_HELLO_V2)
- {
- throw new SSLProtocolException("unsupported V2 message");
- }
- type = ContentType.HANDSHAKE;
- // Record this message, and re-present it as a normal handshake
- // layer message. ClientHello will handle the real parsing.
- ByteArrayOutputStream buffer = new ByteArrayOutputStream (256);
- buffer.write(1); // The type we just read.
- RecordingInputStream in2 = new RecordingInputStream (in, buffer);
- ProtocolVersion version = ProtocolVersion.read (in2);
- if (version.compareTo (ProtocolVersion.SSL_3) < 0)
- {
- throw new SSLProtocolException("unsupported client version");
- }
- int len = (in2.read() & 0xFF) << 8 | (in2.read() & 0xFF);
- len += (in2.read() & 0xFF) << 8 | (in2.read() & 0xFF);
- len += (in2.read() & 0xFF) << 8 | (in2.read() & 0xFF);
- int count = 0;
- while (count < len)
- {
- int l = (int) in2.skip(len - count);
- if (l > 0)
- {
- count += l;
- }
- }
- fragment = buffer.toByteArray ();
- index = 0;
-
- // We can't be encrypted/MACed/compressed here, since a V2 message
- // will only be sent as the first message, and only by the client.
- return;
- }
- ProtocolVersion v = ProtocolVersion.read (in);
- int len = in.readUnsignedShort ();
- if (len > session.params.getFragmentLength() + 2048)
- {
- throw new OverflowException();
- }
- fragment = new byte [len];
- in.readFully (fragment);
-
- if (DEBUG_RECORD_LAYER)
- {
- logger.log (Component.SSL_RECORD_LAYER,
- ">> READ RECORD <<{4}" +
- "struct {{4}" +
- " type = {0};{4}" +
- " version = {1};{4}" +
- " length = {2};{4}" +
- "{3}{4}" +
- "} TLSCiphertext;", new Object[]
- {
- type, v, new Integer (len),
- Util.hexDump (fragment, " "),
- SystemProperties.getProperty ("line.separator")
- });
- }
-
- fragment = session.params.decrypt (fragment, v, type);
- index = 0;
-
- if (session.random != null)
- session.random.setSeed (fragment);
-
- if (type == ContentType.ALERT)
- {
- Alert alert = Alert.read (new ByteArrayInputStream (fragment));
- session.currentAlert = alert;
- }
- if (session.currentAlert != null)
- {
- throw new AlertException (session.currentAlert, false);
- }
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/RecordInputStream.java b/libjava/classpath/gnu/javax/net/ssl/provider/RecordInputStream.java
deleted file mode 100644
index 14cf829ac67..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/RecordInputStream.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/* RecordInputStream.java -- record layer input stream interface.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-class RecordInputStream extends InputStream
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- /**
- * The record input instance.
- */
- private final RecordInput in;
-
- /**
- * The content type this stream is reading.
- */
- private final ContentType type;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- RecordInputStream (RecordInput in, ContentType type)
- {
- this.in = in;
- this.type = type;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public int available () throws IOException
- {
- return in.available (type);
- }
-
- public int read () throws IOException
- {
- byte[] b = new byte[1];
- int ret;
- while ((ret = read (b)) != 1)
- {
- if (ret == -1)
- {
- return -1;
- }
- Thread.yield ();
- }
- return b[0] & 0xFF;
- }
-
- public int read (byte[] buf) throws IOException
- {
- return read (buf, 0, buf.length);
- }
-
- public int read (byte[] buf, int off, int len) throws IOException
- {
- return in.read (buf, off, len, type);
- }
-
- public String toString ()
- {
- return RecordInputStream.class.getName () + " [ type=" + type + " ]";
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/RecordOutputStream.java b/libjava/classpath/gnu/javax/net/ssl/provider/RecordOutputStream.java
deleted file mode 100644
index 3bf228f2d69..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/RecordOutputStream.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/* RecordOutputStream.java -- record layer output.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import gnu.classpath.SystemProperties;
-import gnu.classpath.debug.Component;
-import gnu.classpath.debug.SystemLogger;
-
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-
-import java.util.logging.Logger;
-
-/**
- * An output stream for writing data to the record layer. All data written
- * to this stream (through any of the write methods) is immediately sent
- * as a full record, so it is advisable to write large arrays to the stream
- * instead of one byte at a time (alternatively, a {@link
- * java.io.BufferedOutputStream} can be used).
- */
-class RecordOutputStream extends FilterOutputStream
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private static final boolean DEBUG_RECORD_LAYER = true;
- private static final Logger logger = SystemLogger.SYSTEM;
-
- /**
- * The content type of this output stream.
- */
- private final ContentType type;
-
- /**
- * The security parameters.
- */
- private final SecurityParameters params;
-
- private final boolean emitEmpty;
-
- private static final byte[] ZERO = new byte[0];
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- RecordOutputStream (final OutputStream out, final ContentType type,
- final SecurityParameters params)
- {
- super (out);
- this.type = type;
- this.params = params;
- String empty = Util.getSecurityProperty ("jessie.emit.empty.records");
- if (empty == null)
- {
- // IE panics if it gets an empty record; so, leave this false
- // for the default.
- empty = "false";
- }
- emitEmpty = Boolean.valueOf (empty).booleanValue () &&
- type == ContentType.APPLICATION_DATA;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public void write (int b) throws IOException
- {
- write (new byte[] { (byte) b });
- }
-
- public void write (byte[] buf) throws IOException
- {
- write (buf, 0, buf.length);
- }
-
- public void write (byte[] buf, int off, int len) throws IOException
- {
- if (off < 0 || len < 0 || off + len > buf.length)
- {
- throw new ArrayIndexOutOfBoundsException ("size=" + buf.length +
- " off=" + off + " len=" + len);
- }
-
- int count = 0;
- int len2 = 0;
- do
- {
- if (emitEmpty)
- {
- byte[] fragment = params.encrypt (ZERO, 0, 0, type);
- if (DEBUG_RECORD_LAYER)
- {
- logger.log (Component.SSL_RECORD_LAYER,
- ">> WRITING RECORD <<{4}" +
- "struct {{4}" +
- " type = {0};{4}" +
- " version = {1};{4}" +
- " length = {2};{4}" +
- "{3}{4}" +
- "} TLSCiphertext;", new Object[]
- {
- type, params.getVersion (), new Integer (fragment.length),
- Util.hexDump (fragment, " "),
- SystemProperties.getProperty ("line.separator")
- });
- }
- out.write (type.getValue());
- params.getVersion().write (out);
- out.write ((fragment.length >>> 8) & 0xFF);
- out.write ( fragment.length & 0xFF);
- out.write (fragment);
- out.flush ();
- }
- len2 = Math.min (len - count, params.getFragmentLength());
- if (DEBUG_RECORD_LAYER)
- {
- logger.log (Component.SSL_RECORD_LAYER,
- "writing chunk size={0}", new Integer (len2));
- }
- synchronized (out)
- {
- byte[] fragment = params.encrypt (buf, off + count, len2, type);
- if (DEBUG_RECORD_LAYER)
- {
- logger.log (Component.SSL_RECORD_LAYER,
- ">> WRITING RECORD <<{4}" +
- "struct {{4}" +
- " type = {0};{4}" +
- " version = {1};{4}" +
- " length = {2};{4}" +
- "{3}{4}" +
- "} TLSCiphertext;", new Object[]
- {
- type, params.getVersion (), new Integer (fragment.length),
- Util.hexDump (fragment, " "),
- SystemProperties.getProperty ("line.separator")
- });
- }
- out.write (type.getValue());
- params.getVersion().write (out);
- out.write ((fragment.length >>> 8) & 0xFF);
- out.write ( fragment.length & 0xFF);
- out.write (fragment);
- out.flush ();
- }
- count += len2;
- }
- while (count < len);
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/RecordingInputStream.java b/libjava/classpath/gnu/javax/net/ssl/provider/RecordingInputStream.java
deleted file mode 100644
index d81b652d516..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/RecordingInputStream.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/* RecordingInputStream.java -- Input stream that records data.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.ByteArrayOutputStream;
-import java.io.FilterInputStream;
-import java.io.InputStream;
-import java.io.IOException;
-
-/**
- * A filter input stream that records every byte read from the underlying
- * input stream. This class is useful for protocols that require portions
- * of the communication to be saved, such as the handshake and key
- * derivation in SSL.
- *
- * @author Casey Marshall (rsdio@metastatic.org)
- */
-class RecordingInputStream extends FilterInputStream
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- protected ByteArrayOutputStream sink;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- RecordingInputStream(InputStream in)
- {
- this(in, new ByteArrayOutputStream());
- }
-
- RecordingInputStream(InputStream in, ByteArrayOutputStream sink)
- {
- super(in);
- this.sink = sink;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public synchronized int read() throws IOException
- {
- int i = in.read();
- sink.write(i);
- return i;
- }
-
- public synchronized int read(byte[] buf, int off, int len) throws IOException
- {
- int l = in.read(buf, off, len);
- sink.write(buf, off, l);
- return l;
- }
-
- public synchronized int read(byte[] buf) throws IOException
- {
- return read(buf, 0, buf.length);
- }
-
- public synchronized long skip(long len) throws IOException
- {
- long l = 0;
- int i = 0;
- byte[] buf = new byte[1024];
- while (l < len)
- {
- i = read(buf, 0, (int) Math.min((long) buf.length, len - l));
- if (i == -1)
- break;
- l += i;
- }
- return l;
- }
-
- /**
- * Returns all bytes recorded after this instance was created, or the last
- * call to {@link resetSink()}.
- *
- * @return The recorded bytes.
- */
- byte[] getBytes()
- {
- return sink.toByteArray();
- }
-
- /**
- * Clears the recording buffer off all previously-recorded bytes.
- */
- void resetSink()
- {
- sink.reset();
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLContextImpl.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLContextImpl.java
new file mode 100644
index 00000000000..cf7c8e4e3d6
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/SSLContextImpl.java
@@ -0,0 +1,315 @@
+/* SSLContextImpl.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.java.security.action.GetSecurityPropertyAction;
+import gnu.javax.net.ssl.AbstractSessionContext;
+import gnu.javax.net.ssl.NullManagerParameters;
+import gnu.javax.net.ssl.PreSharedKeyManager;
+import gnu.javax.net.ssl.SRPTrustManager;
+
+import java.security.AccessController;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.SecureRandom;
+import java.security.UnrecoverableKeyException;
+
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContextSpi;
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLException;
+import javax.net.ssl.SSLServerSocketFactory;
+import javax.net.ssl.SSLSessionContext;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.X509ExtendedKeyManager;
+import javax.net.ssl.X509TrustManager;
+
+/**
+ * Our implementation of {@link SSLContextSpi}.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public final class SSLContextImpl extends SSLContextSpi
+{
+ AbstractSessionContext serverContext;
+ AbstractSessionContext clientContext;
+
+ PreSharedKeyManager pskManager;
+ X509ExtendedKeyManager keyManager;
+ X509TrustManager trustManager;
+ SRPTrustManager srpTrustManager;
+ SecureRandom random;
+
+ public SSLContextImpl()
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLContextSpi#engineCreateSSLEngine()
+ */
+ protected @Override SSLEngine engineCreateSSLEngine()
+ {
+ return engineCreateSSLEngine(null, -1);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLContextSpi#engineCreateSSLEngine(java.lang.String, int)
+ */
+ protected @Override SSLEngine engineCreateSSLEngine(String host, int port)
+ {
+ return new SSLEngineImpl(this, host, port);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLContextSpi#engineGetClientSessionContext()
+ */
+ protected @Override synchronized SSLSessionContext engineGetClientSessionContext()
+ {
+ if (clientContext == null)
+ {
+ try
+ {
+ clientContext = AbstractSessionContext.newInstance();
+ }
+ catch (SSLException ssle)
+ {
+ // XXX Ignore?
+ }
+ }
+ return clientContext;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLContextSpi#engineGetServerSessionContext()
+ */
+ protected @Override synchronized SSLSessionContext engineGetServerSessionContext()
+ {
+ if (serverContext == null)
+ {
+ try
+ {
+ serverContext = AbstractSessionContext.newInstance();
+ }
+ catch (SSLException ssle)
+ {
+ // XXX Ignore?
+ }
+ }
+ return serverContext;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLContextSpi#engineGetServerSocketFactory()
+ */
+ protected @Override SSLServerSocketFactory engineGetServerSocketFactory()
+ {
+ return new SSLServerSocketFactoryImpl(this);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLContextSpi#engineGetSocketFactory()
+ */
+ protected @Override SSLSocketFactory engineGetSocketFactory()
+ {
+ return new SSLSocketFactoryImpl(this);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLContextSpi#engineInit(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], java.security.SecureRandom)
+ */
+ protected @Override void engineInit(KeyManager[] keyManagers,
+ TrustManager[] trustManagers,
+ SecureRandom random)
+ throws KeyManagementException
+ {
+ keyManager = null;
+ trustManager = null;
+ srpTrustManager = null;
+ if (keyManagers != null)
+ {
+ for (int i = 0; i < keyManagers.length; i++)
+ {
+ if ((keyManagers[i] instanceof X509ExtendedKeyManager)
+ && keyManager == null)
+ keyManager = (X509ExtendedKeyManager) keyManagers[i];
+ if (keyManagers[i] instanceof PreSharedKeyManager
+ && pskManager == null)
+ pskManager = (PreSharedKeyManager) keyManagers[i];
+ }
+ }
+ if (keyManager == null)
+ keyManager = defaultKeyManager();
+ if (trustManagers != null)
+ {
+ for (int i = 0; i < trustManagers.length; i++)
+ {
+ if (trustManagers[i] instanceof X509TrustManager)
+ {
+ if (trustManager == null)
+ trustManager = (X509TrustManager) trustManagers[i];
+ }
+ else if (trustManagers[i] instanceof SRPTrustManager)
+ {
+ if (srpTrustManager == null)
+ srpTrustManager = (SRPTrustManager) trustManagers[i];
+ }
+ }
+ }
+ if (trustManager == null && srpTrustManager == null)
+ {
+ trustManager = defaultTrustManager();
+ }
+ if (random != null)
+ {
+ this.random = random;
+ }
+ else
+ {
+ this.random = defaultRandom();
+ }
+ }
+
+ /**
+ * Create and return a default key manager. The default is the JessieX509
+ * algorithm, loaded from either the jssecerts file, or the cacerts file.
+ *
+ * @return The default key manager instance.
+ * @throws KeyManagementException If the instance cannot be created.
+ */
+ private X509ExtendedKeyManager defaultKeyManager() throws KeyManagementException
+ {
+ KeyManagerFactory fact = null;
+ try
+ {
+ fact = KeyManagerFactory.getInstance("JessieX509", "Jessie");
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ throw new KeyManagementException(nsae);
+ }
+ catch (NoSuchProviderException nspe)
+ {
+ throw new KeyManagementException(nspe);
+ }
+ try
+ {
+ fact.init(null, null);
+ return (X509ExtendedKeyManager) fact.getKeyManagers()[0];
+ }
+ catch (NoSuchAlgorithmException nsae) { }
+ catch (KeyStoreException kse) { }
+ catch (UnrecoverableKeyException uke) { }
+ catch (IllegalStateException ise) { }
+
+ try
+ {
+ fact.init(new NullManagerParameters());
+ return (X509ExtendedKeyManager) fact.getKeyManagers()[0];
+ }
+ catch (Exception shouldNotHappen)
+ {
+ throw new Error(shouldNotHappen.toString());
+ }
+ }
+
+ /**
+ * Create and return a default trust manager. The default is the JessieX509
+ * algorithm, loaded from either the jssecerts file, or the cacerts file.
+ *
+ * @return The default trust manager instance.
+ * @throws KeyManagementException If the instance cannot be created.
+ */
+ private X509TrustManager defaultTrustManager() throws KeyManagementException
+ {
+ try
+ {
+ TrustManagerFactory fact =
+ TrustManagerFactory.getInstance("JessieX509", "Jessie");
+ fact.init((KeyStore) null);
+ return (X509TrustManager) fact.getTrustManagers()[0];
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ throw new KeyManagementException(nsae);
+ }
+ catch (NoSuchProviderException nspe)
+ {
+ throw new KeyManagementException(nspe);
+ }
+ catch (KeyStoreException kse)
+ {
+ throw new KeyManagementException(kse);
+ }
+ }
+
+ /**
+ * Create a default secure PRNG. This is defined as either the algorithm
+ * given in the <code>gnu.javax.net.ssl.secureRandom</code> security
+ * property, or Fortuna if that property is not set. If none of these
+ * algorithms can be found, and instance created with the SecureRandom
+ * constructor is returned.
+ *
+ * @return The default secure PRNG instance.
+ */
+ private SecureRandom defaultRandom()
+ {
+ GetSecurityPropertyAction gspa
+ = new GetSecurityPropertyAction("gnu.javax.net.ssl.secureRandom");
+ String alg = AccessController.doPrivileged(gspa);
+ if (alg == null)
+ alg = "Fortuna";
+ SecureRandom rand = null;
+ try
+ {
+ rand = SecureRandom.getInstance(alg);
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ rand = new SecureRandom();
+ }
+
+ return rand;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLEngineImpl.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLEngineImpl.java
new file mode 100644
index 00000000000..22c488d68c0
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/SSLEngineImpl.java
@@ -0,0 +1,842 @@
+/* SSLEngineImpl.java -- implementation of SSLEngine.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.classpath.debug.Component;
+import gnu.classpath.debug.SystemLogger;
+
+import gnu.java.security.util.ByteBufferOutputStream;
+import gnu.javax.net.ssl.Session;
+import gnu.javax.net.ssl.SSLRecordHandler;
+
+import java.nio.BufferOverflowException;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.zip.DataFormatException;
+
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.ShortBufferException;
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLEngineResult;
+import javax.net.ssl.SSLException;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.SSLEngineResult.HandshakeStatus;
+import javax.net.ssl.SSLEngineResult.Status;
+
+public final class SSLEngineImpl extends SSLEngine
+{
+ final SSLContextImpl contextImpl;
+ private SSLRecordHandler[] handlers;
+ private static final SystemLogger logger = SystemLogger.SYSTEM;
+ private SessionImpl session;
+ private InputSecurityParameters insec;
+ private OutputSecurityParameters outsec;
+ private boolean inClosed;
+ private boolean outClosed;
+ private boolean createSessions;
+ private boolean needClientAuth;
+ private boolean wantClientAuth;
+ private boolean initialHandshakeDone;
+ private AbstractHandshake handshake;
+ private Alert lastAlert;
+ private SSLEngineResult.HandshakeStatus handshakeStatus;
+ private boolean changeCipherSpec;
+
+ private String[] enabledSuites;
+ private String[] enabledProtocols;
+
+ /**
+ * We can receive any message chunked across multiple records,
+ * including alerts, even though all alert messages are only two
+ * bytes long. Handshake messages are de-chunked in the handshake
+ * handler, change-cipher-spec messages are always empty, and we
+ * don't care about chunking of application messages.
+ *
+ * This buffer will hold the incomplete alert that we receive, if
+ * any.
+ */
+ private final ByteBuffer alertBuffer;
+
+ private Mode mode;
+
+ private enum Mode { SERVER, CLIENT };
+
+ SSLEngineImpl (SSLContextImpl contextImpl, String host, int port)
+ {
+ super(host, port);
+ this.contextImpl = contextImpl;
+ handlers = new SSLRecordHandler[256];
+ session = new SessionImpl();
+ session.suite = CipherSuite.TLS_NULL_WITH_NULL_NULL;
+ session.version = ProtocolVersion.TLS_1_1;
+ byte[] sid = new byte[32];
+ contextImpl.random.nextBytes(sid);
+ session.setId(new Session.ID(sid));
+ session.setRandom(contextImpl.random);
+
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_RECORD_LAYER, "generated session ID {0} with random {1}",
+ session.id(), contextImpl.random);
+
+ // Begin with no encryption.
+ insec = new InputSecurityParameters (null, null, null, session,
+ CipherSuite.TLS_NULL_WITH_NULL_NULL);
+ outsec = new OutputSecurityParameters (null, null, null, session,
+ CipherSuite.TLS_NULL_WITH_NULL_NULL);
+ inClosed = false;
+ outClosed = false;
+ needClientAuth = false;
+ wantClientAuth = false;
+ createSessions = true;
+ initialHandshakeDone = false;
+ alertBuffer = ByteBuffer.wrap (new byte[2]);
+ mode = null;
+ lastAlert = null;
+ handshakeStatus = SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING;
+ changeCipherSpec = false;
+
+ // Set up default protocols and suites.
+ enabledProtocols = new String[] {
+ ProtocolVersion.TLS_1_1.toString(),
+ ProtocolVersion.TLS_1.toString(),
+ ProtocolVersion.SSL_3.toString()
+ };
+ enabledSuites = defaultSuites();
+ }
+
+ static String[] defaultSuites()
+ {
+ return new String[] {
+ CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA.toString(),
+ CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA.toString(),
+ CipherSuite.TLS_DH_DSS_WITH_AES_256_CBC_SHA.toString(),
+ CipherSuite.TLS_DH_RSA_WITH_AES_256_CBC_SHA.toString(),
+ CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA.toString(),
+ CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA.toString(),
+ CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA.toString(),
+ CipherSuite.TLS_DH_DSS_WITH_AES_128_CBC_SHA.toString(),
+ CipherSuite.TLS_DH_RSA_WITH_AES_128_CBC_SHA.toString(),
+ CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA.toString(),
+ CipherSuite.TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA.toString(),
+ CipherSuite.TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA.toString(),
+ CipherSuite.TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA.toString(),
+ CipherSuite.TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA.toString(),
+ CipherSuite.TLS_RSA_WITH_3DES_EDE_CBC_SHA.toString(),
+ CipherSuite.TLS_RSA_WITH_RC4_128_MD5.toString(),
+ CipherSuite.TLS_RSA_WITH_RC4_128_SHA.toString(),
+ CipherSuite.TLS_DHE_DSS_WITH_DES_CBC_SHA.toString(),
+ CipherSuite.TLS_DHE_RSA_WITH_DES_CBC_SHA.toString(),
+ CipherSuite.TLS_DH_DSS_WITH_DES_CBC_SHA.toString(),
+ CipherSuite.TLS_DH_RSA_WITH_DES_CBC_SHA.toString(),
+ CipherSuite.TLS_RSA_WITH_DES_CBC_SHA.toString(),
+ CipherSuite.TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA.toString(),
+ CipherSuite.TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA.toString(),
+ CipherSuite.TLS_RSA_EXPORT_WITH_DES40_CBC_SHA.toString(),
+ CipherSuite.TLS_RSA_EXPORT_WITH_RC4_40_MD5.toString(),
+ CipherSuite.TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA.toString(),
+ CipherSuite.TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA.toString(),
+ CipherSuite.TLS_RSA_WITH_NULL_MD5.toString(),
+ CipherSuite.TLS_RSA_WITH_NULL_SHA.toString()
+ };
+ }
+
+ // XXX implement?
+ /*public void registerHandler (final int contentType,
+ SSLRecordHandler handler)
+ throws SSLException
+ {
+ if (type.equals (ContentType.CHANGE_CIPHER_SPEC)
+ || type.equals (ContentType.ALERT)
+ || type.equals (ContentType.HANDSHAKE)
+ || type.equals (ContentType.APPLICATION_DATA))
+ throw new SSLException ("can't override handler for content type " + type);
+ int i = type.getValue ();
+ if (i < 0 || i > 255)
+ throw new SSLException ("illegal content type: " + type);
+ handlers[i] = handler;
+ }*/
+
+ @Override
+ public void beginHandshake () throws SSLException
+ {
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_HANDSHAKE, "{0} handshake begins", mode);
+
+ if (mode == null)
+ throw new IllegalStateException("setUseClientMode was never used");
+
+ switch (mode)
+ {
+ case SERVER:
+ if (getHandshakeStatus() != SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING)
+ throw new SSLException("handshake already in progress");
+ try
+ {
+ handshake = new ServerHandshake(initialHandshakeDone, this);
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ throw new SSLException(nsae);
+ }
+ break;
+
+ case CLIENT:
+ try
+ {
+ handshake = new ClientHandshake(this);
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ throw new SSLException(nsae);
+ }
+ break;
+ }
+ }
+
+ @Override
+ public void closeInbound()
+ {
+ inClosed = true;
+ }
+
+ @Override
+ public void closeOutbound()
+ {
+ lastAlert = new Alert(Alert.Level.WARNING, Alert.Description.CLOSE_NOTIFY);
+ }
+
+ @Override
+ public Runnable getDelegatedTask()
+ {
+ if (handshake == null)
+ return null;
+ return handshake.getTask();
+ }
+
+ @Override
+ public String[] getEnabledCipherSuites()
+ {
+ return (String[]) enabledSuites.clone();
+ }
+
+ @Override
+ public String[] getEnabledProtocols()
+ {
+ return (String[]) enabledProtocols.clone();
+ }
+
+ @Override
+ public boolean getEnableSessionCreation()
+ {
+ return createSessions;
+ }
+
+ @Override
+ public HandshakeStatus getHandshakeStatus()
+ {
+ if (handshake == null)
+ return HandshakeStatus.NOT_HANDSHAKING;
+ return handshake.status();
+ }
+
+ @Override
+ public boolean getNeedClientAuth()
+ {
+ return needClientAuth;
+ }
+
+ @Override
+ public SSLSession getSession()
+ {
+ return session;
+ }
+
+ @Override
+ public boolean getUseClientMode ()
+ {
+ return (mode == Mode.CLIENT);
+ }
+
+ @Override
+ public boolean getWantClientAuth()
+ {
+ return wantClientAuth;
+ }
+
+ @Override
+ public boolean isInboundDone()
+ {
+ return inClosed;
+ }
+
+ @Override
+ public boolean isOutboundDone()
+ {
+ return outClosed;
+ }
+
+ @Override
+ public void setEnableSessionCreation(final boolean createSessions)
+ {
+ this.createSessions = createSessions;
+ }
+
+ @Override
+ public void setEnabledCipherSuites(final String[] suites)
+ {
+ if (suites.length == 0)
+ throw new IllegalArgumentException("need at least one suite");
+ enabledSuites = (String[]) suites.clone();
+ }
+
+ @Override
+ public void setEnabledProtocols(final String[] protocols)
+ {
+ if (protocols.length == 0)
+ throw new IllegalArgumentException("need at least one protocol");
+ enabledProtocols = (String[]) protocols.clone();
+ }
+
+ @Override
+ public String[] getSupportedCipherSuites()
+ {
+ // XXX if we ever want to support "pluggable" cipher suites, we'll need
+ // to figure this out.
+
+ return CipherSuite.availableSuiteNames().toArray(new String[0]);
+ }
+
+ @Override
+ public String[] getSupportedProtocols()
+ {
+ return new String[] { ProtocolVersion.SSL_3.toString(),
+ ProtocolVersion.TLS_1.toString(),
+ ProtocolVersion.TLS_1_1.toString() };
+ }
+
+ @Override
+ public void setNeedClientAuth(final boolean needClientAuth)
+ {
+ this.needClientAuth = needClientAuth;
+ }
+
+ @Override
+ public void setUseClientMode (final boolean clientMode)
+ {
+ if (clientMode)
+ mode = Mode.CLIENT;
+ else
+ mode = Mode.SERVER;
+ }
+
+ public @Override void setWantClientAuth(final boolean wantClientAuth)
+ {
+ this.wantClientAuth = wantClientAuth;
+ }
+
+ public @Override SSLEngineResult unwrap (final ByteBuffer source,
+ final ByteBuffer[] sinks,
+ final int offset, final int length)
+ throws SSLException
+ {
+ if (mode == null)
+ throw new IllegalStateException ("setUseClientMode was never called");
+
+ if (inClosed)
+ return new SSLEngineResult(SSLEngineResult.Status.CLOSED,
+ handshakeStatus, 0, 0);
+
+ if (source.remaining() < 5)
+ {
+ return new SSLEngineResult(SSLEngineResult.Status.BUFFER_UNDERFLOW,
+ handshakeStatus, 0, 0);
+ }
+
+ Record record = null;
+ boolean helloV2 = false;
+
+ // XXX: messages may be chunked across multiple records; does this
+ // include the SSLv2 message? I don't think it does, but we should
+ // make sure.
+ if (!getUseClientMode() && (source.get(source.position()) & 0x80) == 0x80)
+ {
+ if (handshake == null)
+ beginHandshake();
+ int hellolen = source.getShort(source.position()) & 0x7FFF;
+ this.handshake.handleV2Hello(source.slice());
+ if (!insec.cipherSuite().equals (CipherSuite.TLS_NULL_WITH_NULL_NULL))
+ throw new SSLException ("received SSLv2 client hello in encrypted "
+ + "session; this is invalid.");
+ if (Debug.DEBUG)
+ logger.log (Component.SSL_RECORD_LAYER,
+ "converting SSLv2 client hello to version 3 hello");
+
+ source.getShort(); // skip length
+ ClientHelloV2 v2 = new ClientHelloV2(source.slice());
+
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_RECORD_LAYER, "v2 hello: {0}", v2);
+
+ List<CipherSuite> suites = v2.cipherSpecs();
+
+ ClientHelloBuilder hello = new ClientHelloBuilder();
+ hello.setVersion(v2.version ());
+
+ Random random = hello.random();
+ byte[] challenge = v2.challenge();
+ if (challenge.length < 32)
+ {
+ byte[] b = new byte[32];
+ System.arraycopy(challenge, 0, b, b.length - challenge.length,
+ challenge.length);
+ challenge = b;
+ }
+ random.setGmtUnixTime((challenge[0] & 0xFF) << 24
+ | (challenge[1] & 0xFF) << 16
+ | (challenge[2] & 0xFF) << 8
+ | (challenge[3] & 0xFF));
+ random.setRandomBytes(challenge, 4);
+
+ byte[] sessionId = v2.sessionId();
+ hello.setSessionId(sessionId, 0, sessionId.length);
+ hello.setCipherSuites(suites);
+ ArrayList<CompressionMethod> comps = new ArrayList<CompressionMethod>(1);
+ comps.add(CompressionMethod.NULL);
+ hello.setCompressionMethods(comps);
+
+ record = new Record(ByteBuffer.allocate(hello.length() + 9));
+ record.setContentType(ContentType.HANDSHAKE);
+ record.setVersion(v2.version());
+ record.setLength(hello.length() + 4);
+
+ Handshake handshake = new Handshake(record.fragment());
+ handshake.setLength(hello.length());
+ handshake.setType(Handshake.Type.CLIENT_HELLO);
+
+ handshake.bodyBuffer().put(hello.buffer());
+ source.position(source.position() + hellolen);
+ helloV2 = true;
+ }
+ else
+ record = new Record(source);
+
+ ContentType type = record.contentType ();
+
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_RECORD_LAYER, "input record:\n{0}", record);
+
+ if (record.length() > session.getPacketBufferSize() - 5)
+ {
+ lastAlert = new Alert(Alert.Level.FATAL,
+ Alert.Description.RECORD_OVERFLOW);
+ throw new AlertException(lastAlert);
+ }
+
+ ByteBufferOutputStream sysMsg = null;
+ ByteBuffer msg = null;
+
+ int produced = 0;
+ try
+ {
+ // Application data will get decrypted directly into the user's
+ // output buffers.
+ if (record.contentType() == ContentType.APPLICATION_DATA)
+ produced = insec.decrypt(record, sinks, offset, length);
+ else
+ {
+ if (insec.cipherSuite() == CipherSuite.TLS_NULL_WITH_NULL_NULL)
+ msg = record.fragment();
+ else
+ {
+ sysMsg = new ByteBufferOutputStream();
+ insec.decrypt(record, sysMsg);
+ }
+ }
+
+ // Advance the input buffer past the record we just read.
+ if (!helloV2)
+ source.position(source.position() + record.length() + 5);
+ }
+ catch (BufferOverflowException boe)
+ {
+ // We throw this if the output buffers are not large enough; signal
+ // the caller about this.
+ logger.log(Component.SSL_RECORD_LAYER, "buffer overflow when decrypting", boe);
+ return new SSLEngineResult(SSLEngineResult.Status.BUFFER_OVERFLOW,
+ handshakeStatus, 0, 0);
+ }
+ catch (IllegalBlockSizeException ibse)
+ {
+ lastAlert = new Alert(Alert.Level.FATAL,
+ Alert.Description.BAD_RECORD_MAC);
+ throw new AlertException(lastAlert, ibse);
+ }
+ catch (DataFormatException dfe)
+ {
+ lastAlert = new Alert(Alert.Level.FATAL,
+ Alert.Description.DECOMPRESSION_FAILURE);
+ throw new AlertException(lastAlert, dfe);
+ }
+ catch (MacException me)
+ {
+ lastAlert = new Alert(Alert.Level.FATAL,
+ Alert.Description.BAD_RECORD_MAC);
+ throw new AlertException(lastAlert, me);
+ }
+ catch (ShortBufferException sbe)
+ {
+ // We've messed up if this happens.
+ lastAlert = new Alert(Alert.Level.FATAL,
+ Alert.Description.INTERNAL_ERROR);
+ throw new AlertException(lastAlert, sbe);
+ }
+
+ SSLEngineResult result = null;
+
+ // If we need to handle the output here, do it. Otherwise, the output
+ // has been stored in the supplied output buffers.
+ if (sysMsg != null)
+ {
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_RECORD_LAYER, "sysmessage {0}", sysMsg);
+ msg = sysMsg.buffer();
+ }
+
+ if (type == ContentType.CHANGE_CIPHER_SPEC)
+ {
+ // We *may* get a partial message, even though the message is only
+ // one byte long.
+ if (msg.remaining() == 0)
+ {
+ result = new SSLEngineResult (SSLEngineResult.Status.OK,
+ handshakeStatus,
+ record.length() + 5, 0);
+ }
+ else
+ {
+ byte b = msg.get();
+ if (b != 1)
+ throw new SSLException ("unknown ChangeCipherSpec value: " + (b & 0xFF));
+ InputSecurityParameters params = handshake.getInputParams();
+ logger.log (Component.SSL_RECORD_LAYER,
+ "switching to input security parameters {0}",
+ params.cipherSuite());
+ insec = params;
+ result = new SSLEngineResult (SSLEngineResult.Status.OK,
+ handshakeStatus,
+ record.length() + 5, 0);
+ }
+ }
+ else if (type == ContentType.ALERT)
+ {
+ int len = 0;
+ if (alertBuffer.position() > 0)
+ {
+ alertBuffer.put(msg.get());
+ len = 1;
+ }
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_RECORD_LAYER, "processing alerts {0}",
+ Util.wrapBuffer(msg));
+ len += msg.remaining() / 2;
+ Alert[] alerts = new Alert[len];
+ int i = 0;
+ if (alertBuffer.position() > 0)
+ {
+ alertBuffer.flip();
+ alerts[0] = new Alert(alertBuffer);
+ i++;
+ }
+ while (i < alerts.length)
+ {
+ alerts[i++] = new Alert(msg.duplicate());
+ msg.position(msg.position() + 2);
+ }
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_RECORD_LAYER, "alerts: {0}", alerts.length);
+
+ for (i = 0; i < alerts.length; i++)
+ {
+ if (alerts[i].level() == Alert.Level.FATAL)
+ throw new AlertException(alerts[i], false);
+ if (alerts[i].description() != Alert.Description.CLOSE_NOTIFY)
+ logger.log(java.util.logging.Level.WARNING,
+ "received alert: {0}", alerts[i]);
+ if (alerts[i].description() == Alert.Description.CLOSE_NOTIFY)
+ inClosed = true;
+ }
+
+ if (msg.hasRemaining())
+ alertBuffer.position(0).limit(2);
+
+ result = new SSLEngineResult (SSLEngineResult.Status.OK,
+ handshakeStatus,
+ record.length() + 5, 0);
+ }
+ else if (type == ContentType.HANDSHAKE)
+ {
+ if (handshake == null)
+ beginHandshake();
+ try
+ {
+ handshakeStatus = handshake.handleInput(msg);
+ }
+ catch (AlertException ae)
+ {
+ lastAlert = ae.alert();
+ return new SSLEngineResult(SSLEngineResult.Status.OK,
+ SSLEngineResult.HandshakeStatus.NEED_WRAP,
+ 0, 0);
+ }
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "handshake status {0}", handshakeStatus);
+ result = new SSLEngineResult(SSLEngineResult.Status.OK,
+ handshakeStatus,
+ record.length() + 5,
+ 0);
+ if (handshakeStatus == HandshakeStatus.FINISHED)
+ {
+ handshake = null;
+ handshakeStatus = HandshakeStatus.NOT_HANDSHAKING;
+ }
+ }
+ else if (type == ContentType.APPLICATION_DATA)
+ {
+ // Do nothing more; the application data has been put into
+ // the output buffers.
+ result = new SSLEngineResult(SSLEngineResult.Status.OK,
+ handshakeStatus,
+ record.length() + 5,
+ produced);
+ }
+ else
+ {
+ SSLRecordHandler handler = handlers[type.getValue()];
+ if (handler != null)
+ {
+ result = new SSLEngineResult(SSLEngineResult.Status.OK,
+ handshakeStatus,
+ record.length() + 5,
+ 0);
+ }
+ else
+ throw new SSLException ("unknown content type: " + type);
+ }
+
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_RECORD_LAYER, "return result: {0}", result);
+
+ return result;
+ }
+
+ public @Override SSLEngineResult wrap (ByteBuffer[] sources, int offset, int length,
+ ByteBuffer sink)
+ throws SSLException
+ {
+ if (mode == null)
+ throw new IllegalStateException ("setUseClientMode was never called");
+
+ if (outClosed)
+ return new SSLEngineResult(SSLEngineResult.Status.CLOSED,
+ handshakeStatus, 0, 0);
+
+ ContentType type = null;
+ ByteBuffer sysMessage = null;
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_RECORD_LAYER, "wrap {0} {1} {2} {3} / {4}",
+ sources, offset, length, sink, getHandshakeStatus());
+ if (lastAlert != null)
+ {
+ type = ContentType.ALERT;
+ sysMessage = ByteBuffer.allocate(2);
+ Alert alert = new Alert(sysMessage);
+ alert.setDescription(lastAlert.description());
+ alert.setLevel(lastAlert.level());
+ if (lastAlert.description() == Alert.Description.CLOSE_NOTIFY)
+ outClosed = true;
+ }
+ else if (changeCipherSpec)
+ {
+ type = ContentType.CHANGE_CIPHER_SPEC;
+ sysMessage = ByteBuffer.allocate(1);
+ sysMessage.put(0, (byte) 1);
+ }
+ else if (getHandshakeStatus() == SSLEngineResult.HandshakeStatus.NEED_WRAP)
+ {
+ // If we are not encrypting, optimize the handshake to fill
+ // the buffer directly.
+ if (outsec.suite() == CipherSuite.TLS_NULL_WITH_NULL_NULL)
+ {
+ int orig = sink.position();
+ sink.order(ByteOrder.BIG_ENDIAN);
+ sink.put((byte) ContentType.HANDSHAKE.getValue());
+ sink.putShort((short) session.version.rawValue());
+ sink.putShort((short) 0);
+ handshakeStatus = handshake.handleOutput(sink);
+ int produced = sink.position() - orig;
+ sink.putShort(orig + 3, (short) (produced - 5));
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_RECORD_LAYER, "emitting record:\n{0}",
+ new Record((ByteBuffer) sink.duplicate().position(orig)));
+ SSLEngineResult result = new SSLEngineResult(SSLEngineResult.Status.OK,
+ handshakeStatus, 0, produced);
+
+ // Note, this will only happen if we transition from
+ // TLS_NULL_WITH_NULL_NULL *to* TLS_NULL_WITH_NULL_NULL, which
+ // doesn't make a lot of sense, but we support it anyway.
+ if (handshakeStatus == HandshakeStatus.FINISHED)
+ {
+ handshake = null; // finished with it.
+ handshakeStatus = HandshakeStatus.NOT_HANDSHAKING;
+ }
+ return result;
+ }
+
+ // Rough guideline; XXX.
+ sysMessage = ByteBuffer.allocate(sink.remaining() - 2048);
+ type = ContentType.HANDSHAKE;
+ try
+ {
+ handshakeStatus = handshake.handleOutput(sysMessage);
+ }
+ catch (AlertException ae)
+ {
+ lastAlert = ae.alert();
+ return new SSLEngineResult(Status.OK,
+ HandshakeStatus.NEED_WRAP, 0, 0);
+ }
+ sysMessage.flip();
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "handshake status {0}",
+ handshakeStatus);
+ }
+
+ int produced = 0;
+ int consumed = 0;
+
+ try
+ {
+ int orig = sink.position();
+ int[] inout = null;
+ if (sysMessage != null)
+ {
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_RECORD_LAYER, "encrypt system message {0} to {1}", sysMessage, sink);
+ inout = outsec.encrypt(new ByteBuffer[] { sysMessage }, 0, 1,
+ type, sink);
+ produced = inout[1];
+ }
+ else
+ {
+ inout = outsec.encrypt(sources, offset, length,
+ ContentType.APPLICATION_DATA, sink);
+ consumed = inout[0];
+ produced = inout[1];
+ }
+
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_RECORD_LAYER, "emitting record:\n{0}",
+ new Record((ByteBuffer) sink.duplicate().position(orig).limit(produced)));
+ }
+ catch (ShortBufferException sbe)
+ {
+ // We don't expect this to happen, except for bugs; signal an
+ // internal error.
+ lastAlert = new Alert(Alert.Level.FATAL, Alert.Description.INTERNAL_ERROR);
+ return new SSLEngineResult(SSLEngineResult.Status.OK, handshakeStatus, 0, 0);
+ }
+ catch (IllegalBlockSizeException ibse)
+ {
+ // We don't expect this to happen, except for bugs; signal an
+ // internal error.
+ lastAlert = new Alert(Alert.Level.FATAL, Alert.Description.INTERNAL_ERROR);
+ return new SSLEngineResult(SSLEngineResult.Status.OK, handshakeStatus, 0, 0);
+ }
+ catch (DataFormatException dfe)
+ {
+ // We don't expect this to happen; signal an internal error.
+ lastAlert = new Alert(Alert.Level.FATAL, Alert.Description.INTERNAL_ERROR);
+ return new SSLEngineResult(SSLEngineResult.Status.OK, handshakeStatus, 0, 0);
+ }
+
+ if (lastAlert != null && lastAlert.level() == Alert.Level.FATAL)
+ {
+ AlertException ae = new AlertException(lastAlert);
+ lastAlert = null;
+ throw ae;
+ }
+
+ if (changeCipherSpec)
+ {
+ outsec = handshake.getOutputParams();
+ changeCipherSpec = false;
+ }
+ SSLEngineResult result
+ = new SSLEngineResult(outClosed ? SSLEngineResult.Status.CLOSED
+ : SSLEngineResult.Status.OK,
+ handshakeStatus, consumed, produced);
+ if (handshakeStatus == HandshakeStatus.FINISHED)
+ {
+ handshake = null; // done with it.
+ handshakeStatus = HandshakeStatus.NOT_HANDSHAKING;
+ }
+ return result;
+ }
+
+ // Package-private methods.
+
+ SessionImpl session ()
+ {
+ return session;
+ }
+
+ void setSession(SessionImpl session)
+ {
+ this.session = session;
+ }
+
+ void changeCipherSpec()
+ {
+ changeCipherSpec = true;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLRSASignature.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLRSASignature.java
deleted file mode 100644
index 2f8c6cfe665..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/SSLRSASignature.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/* SSLRSASignature.java -- SSL's RSA signature algorithm.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.math.BigInteger;
-
-import java.security.InvalidKeyException;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.interfaces.RSAPrivateKey;
-import java.security.interfaces.RSAPublicKey;
-
-import java.util.Arrays;
-import java.util.Map;
-
-import gnu.java.security.hash.HashFactory;
-import gnu.java.security.hash.IMessageDigest;
-import gnu.java.security.sig.ISignature;
-import gnu.java.security.sig.rsa.RSA;
-
-/**
- * The RSA signature algorithm as used in the SSL protocol. Note that this
- * is different from the RSA signature used to verify certificates.
- *
- * <p>This signature scheme works as follows:</p>
- *
- * <blockquote><p><pre>digitally-signed struct {
- * opaque md5_hash[16];
- * opaque sha_hash[20];
- * }</pre></p></blockquote>
- *
- * <p>Where a <code>digitally-signed struct</code> is RSA-encrypted with
- * block type 0 or 1 according to PKCS #1, version 1.5.</p>
- */
-final class SSLRSASignature implements ISignature
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private RSAPublicKey pubkey;
- private RSAPrivateKey privkey;
- private final IMessageDigest md5, sha;
- private boolean initVerify = false, initSign = false;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- SSLRSASignature()
- {
- this(HashFactory.getInstance("MD5"), HashFactory.getInstance("SHA-1"));
- }
-
- SSLRSASignature(IMessageDigest md5, IMessageDigest sha)
- {
- this.md5 = md5;
- this.sha = sha;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public String name()
- {
- return "RSA/SSL";
- }
-
- public void setupVerify(Map attrib)
- {
- PublicKey key = (PublicKey) attrib.get(VERIFIER_KEY);
- if (key == null)
- {
- if (initSign)
- {
- return; // re-use.
- }
- throw new IllegalArgumentException("no key supplied");
- }
- if (!(key instanceof RSAPublicKey))
- {
- throw new IllegalArgumentException("not an RSA key");
- }
- pubkey = (RSAPublicKey) key;
- privkey = null;
- initSign = false;
- initVerify = true;
- }
-
- public void setupSign(Map attrib)
- {
- PrivateKey key = (PrivateKey) attrib.get(SIGNER_KEY);
- if (key == null)
- {
- if (initVerify)
- {
- return; // re-use.
- }
- throw new IllegalArgumentException("no key supplied");
- }
- if (!(key instanceof RSAPrivateKey))
- {
- throw new IllegalArgumentException("not an RSA key");
- }
- privkey = (RSAPrivateKey) key;
- pubkey = null;
- initVerify = false;
- initSign = true;
- }
-
- public void update(byte b)
- {
- if (!initVerify && !initSign)
- {
- throw new IllegalStateException();
- }
- md5.update(b);
- sha.update(b);
- }
-
- public void update(byte[] buf, int off, int len)
- {
- if (!initVerify && !initSign)
- {
- throw new IllegalStateException();
- }
- md5.update(buf, off, len);
- sha.update(buf, off, len);
- }
-
- public Object sign()
- {
- if (!initSign)
- {
- throw new IllegalStateException();
- }
- // Pad the hash results with RSA block type 1.
- final int k = (privkey.getModulus().bitLength() + 7) >>> 3;
- final byte[] d = Util.concat(md5.digest(), sha.digest());
- if (k - 11 < d.length)
- {
- throw new IllegalArgumentException("message too long");
- }
- final byte[] eb = new byte[k];
- eb[0] = 0x00;
- eb[1] = 0x01;
- for (int i = 2; i < k - d.length - 1; i++)
- {
- eb[i] = (byte) 0xFF;
- }
- System.arraycopy(d, 0, eb, k - d.length, d.length);
- BigInteger EB = new BigInteger(eb);
-
- // Private-key encrypt the padded hashes.
- BigInteger EM = RSA.sign(privkey, EB);
- return Util.trim(EM);
- }
-
- public boolean verify(Object signature)
- {
- if (!initVerify)
- {
- throw new IllegalStateException();
- }
- // Public-key decrypt the signature representative.
- BigInteger EM = new BigInteger(1, (byte[]) signature);
- BigInteger EB = RSA.verify(pubkey, EM);
-
- // Unpad the decrypted message.
- int i = 0;
- final byte[] eb = EB.toByteArray();
- if (eb[0] == 0x00)
- {
- for (i = 0; i < eb.length && eb[i] == 0x00; i++);
- }
- else if (eb[0] == 0x01)
- {
- for (i = 1; i < eb.length && eb[i] != 0x00; i++)
- {
- if (eb[i] != (byte) 0xFF)
- {
- throw new IllegalArgumentException("bad padding");
- }
- }
- i++;
- }
- else
- {
- throw new IllegalArgumentException("decryption failed");
- }
- byte[] d1 = Util.trim(eb, i, eb.length - i);
- byte[] d2 = Util.concat(md5.digest(), sha.digest());
- return Arrays.equals(d1, d2);
- }
-
- public Object clone()
- {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLRSASignatureImpl.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLRSASignatureImpl.java
new file mode 100644
index 00000000000..415efc6f58d
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/SSLRSASignatureImpl.java
@@ -0,0 +1,233 @@
+/* SSLRSASignatureImpl.java -- SSL/TLS RSA implementation.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.classpath.debug.Component;
+import gnu.classpath.debug.SystemLogger;
+import gnu.java.security.sig.rsa.RSA;
+
+import java.math.BigInteger;
+import java.security.InvalidKeyException;
+import java.security.InvalidParameterException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.PublicKey;
+import java.security.SignatureException;
+import java.security.SignatureSpi;
+import java.security.interfaces.RSAPrivateKey;
+import java.security.interfaces.RSAPublicKey;
+import java.util.Arrays;
+
+/**
+ * An implementation of of the RSA signature algorithm; this is an RSA
+ * encrypted MD5 hash followed by a SHA-1 hash.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class SSLRSASignatureImpl extends SignatureSpi
+{
+ private static final SystemLogger logger = SystemLogger.SYSTEM;
+ private RSAPublicKey pubkey;
+ private RSAPrivateKey privkey;
+ private final MessageDigest md5, sha;
+ private boolean initSign = false;
+ private boolean initVerify = false;
+
+ public SSLRSASignatureImpl() throws NoSuchAlgorithmException
+ {
+ md5 = MessageDigest.getInstance("MD5");
+ sha = MessageDigest.getInstance("SHA-1");
+ }
+
+ /* (non-Javadoc)
+ * @see java.security.SignatureSpi#engineInitVerify(java.security.PublicKey)
+ */
+ @Override protected void engineInitVerify(PublicKey publicKey)
+ throws InvalidKeyException
+ {
+ try
+ {
+ pubkey = (RSAPublicKey) publicKey;
+ initVerify = true;
+ initSign = false;
+ privkey = null;
+ }
+ catch (ClassCastException cce)
+ {
+ throw new InvalidKeyException(cce);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see java.security.SignatureSpi#engineInitSign(java.security.PrivateKey)
+ */
+ @Override protected void engineInitSign(PrivateKey privateKey)
+ throws InvalidKeyException
+ {
+ try
+ {
+ privkey = (RSAPrivateKey) privateKey;
+ initSign = true;
+ initVerify = false;
+ pubkey = null;
+ }
+ catch (ClassCastException cce)
+ {
+ throw new InvalidKeyException(cce);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see java.security.SignatureSpi#engineUpdate(byte)
+ */
+ @Override protected void engineUpdate(byte b) throws SignatureException
+ {
+ if (!initSign && !initVerify)
+ throw new IllegalStateException("not initialized");
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_HANDSHAKE, "SSL/RSA update 0x{0}",
+ Util.formatInt(b & 0xFF, 16, 2));
+ md5.update(b);
+ sha.update(b);
+ }
+
+ /* (non-Javadoc)
+ * @see java.security.SignatureSpi#engineUpdate(byte[], int, int)
+ */
+ @Override protected void engineUpdate(byte[] b, int off, int len)
+ throws SignatureException
+ {
+ if (!initSign && !initVerify)
+ throw new IllegalStateException("not initialized");
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_HANDSHAKE, "SSL/RSA update\n{0}",
+ Util.hexDump(b, off, len, ">> "));
+ md5.update(b, off, len);
+ sha.update(b, off, len);
+ }
+
+ /* (non-Javadoc)
+ * @see java.security.SignatureSpi#engineSign()
+ */
+ @Override protected byte[] engineSign() throws SignatureException
+ {
+ // FIXME we need to add RSA blinding to this, somehow.
+
+ if (!initSign)
+ throw new SignatureException("not initialized for signing");
+ // Pad the hash results with RSA block type 1.
+ final int k = (privkey.getModulus().bitLength() + 7) >>> 3;
+ final byte[] d = Util.concat(md5.digest(), sha.digest());
+ if (k - 11 < d.length)
+ throw new SignatureException("message too long");
+ final byte[] eb = new byte[k];
+ eb[0] = 0x00;
+ eb[1] = 0x01;
+ for (int i = 2; i < k - d.length - 1; i++)
+ eb[i] = (byte) 0xFF;
+ System.arraycopy(d, 0, eb, k - d.length, d.length);
+ BigInteger EB = new BigInteger(eb);
+
+ // Private-key encrypt the padded hashes.
+ BigInteger EM = RSA.sign(privkey, EB);
+ return Util.trim(EM);
+ }
+
+ /* (non-Javadoc)
+ * @see java.security.SignatureSpi#engineVerify(byte[])
+ */
+ @Override protected boolean engineVerify(byte[] sigBytes)
+ throws SignatureException
+ {
+ if (!initVerify)
+ throw new SignatureException("not initialized for verifying");
+
+ // Public-key decrypt the signature representative.
+ BigInteger EM = new BigInteger(1, (byte[]) sigBytes);
+ BigInteger EB = RSA.verify(pubkey, EM);
+
+ // Unpad the decrypted message.
+ int i = 0;
+ final byte[] eb = EB.toByteArray();
+ if (eb[0] == 0x00)
+ {
+ for (i = 0; i < eb.length && eb[i] == 0x00; i++);
+ }
+ else if (eb[0] == 0x01)
+ {
+ for (i = 1; i < eb.length && eb[i] != 0x00; i++)
+ {
+ if (eb[i] != (byte) 0xFF)
+ {
+ throw new SignatureException("bad padding");
+ }
+ }
+ i++;
+ }
+ else
+ {
+ throw new SignatureException("decryption failed");
+ }
+ byte[] d1 = Util.trim(eb, i, eb.length - i);
+ byte[] d2 = Util.concat(md5.digest(), sha.digest());
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "SSL/RSA d1:{0} d2:{1}",
+ Util.toHexString(d1, ':'), Util.toHexString(d2, ':'));
+ return Arrays.equals(d1, d2);
+ }
+
+ /* (non-Javadoc)
+ * @see java.security.SignatureSpi#engineSetParameter(java.lang.String, java.lang.Object)
+ */
+ @Override protected void engineSetParameter(String param, Object value)
+ throws InvalidParameterException
+ {
+ throw new InvalidParameterException("parameters not supported");
+ }
+
+ /* (non-Javadoc)
+ * @see java.security.SignatureSpi#engineGetParameter(java.lang.String)
+ */
+ @Override protected Object engineGetParameter(String param)
+ throws InvalidParameterException
+ {
+ throw new InvalidParameterException("parameters not supported");
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocket.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocket.java
deleted file mode 100644
index ee96b8d1bdf..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocket.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/* SSLServerSocket.java -- SSL server socket.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.IOException;
-
-import java.net.InetAddress;
-import java.net.Socket;
-
-import java.security.SecureRandom;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import javax.net.ssl.X509KeyManager;
-import javax.net.ssl.X509TrustManager;
-
-import gnu.javax.net.ssl.SRPTrustManager;
-
-class SSLServerSocket extends javax.net.ssl.SSLServerSocket
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private SessionContext sessions;
- private SortedSet enabledProtocols = new TreeSet(SSLSocket.supportedProtocols);
- private List enabledSuites = new ArrayList(SSLSocket.supportedSuites);
- private boolean clientMode = false;
- private boolean needClientAuth = false;
- private boolean wantClientAuth = false;
- private boolean createSessions = true;
- private SRPTrustManager srpTrustManager;
- private X509TrustManager trustManager;
- private X509KeyManager keyManager;
- private SecureRandom random;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- SSLServerSocket() throws IOException
- {
- super();
- }
-
- SSLServerSocket(int port) throws IOException
- {
- super(port);
- }
-
- SSLServerSocket(int port, int backlog) throws IOException
- {
- super(port, backlog);
- }
-
- SSLServerSocket(int port, int backlog, InetAddress address)
- throws IOException
- {
- super(port, backlog, address);
- }
-
- // SSL methods.
- // -------------------------------------------------------------------------
-
- public String[] getSupportedCipherSuites()
- {
- return (String[]) CipherSuite.availableSuiteNames().toArray(new String[0]);
- }
-
- public String[] getEnabledCipherSuites()
- {
- synchronized (enabledSuites)
- {
- String[] s = new String[enabledSuites.size()];
- int i = 0;
- for (Iterator it = enabledSuites.iterator(); it.hasNext(); )
- s[i++] = it.next().toString();
- return s;
- }
- }
-
- public void setEnabledCipherSuites(String[] suites)
- {
- if (suites == null || suites.length == 0)
- throw new IllegalArgumentException();
- for (int i = 0; i < suites.length; i++)
- if (CipherSuite.forName(suites[i]) == null)
- throw new IllegalArgumentException("unsupported suite: " +
- suites[i]);
- synchronized (enabledSuites)
- {
- enabledSuites.clear();
- for (int i = 0; i < suites.length; i++)
- {
- CipherSuite suite = CipherSuite.forName(suites[i]);
- if (!enabledSuites.contains(suite))
- enabledSuites.add(suite);
- }
- }
- }
-
- public String[] getSupportedProtocols()
- {
- return new String[] { "SSLv3", "TLSv1", "TLSv1.1" };
- }
-
- public String[] getEnabledProtocols()
- {
- synchronized (enabledProtocols)
- {
- String[] s = new String[enabledProtocols.size()];
- int i = 0;
- for (Iterator it = enabledProtocols.iterator(); it.hasNext(); )
- s[i++] = it.next().toString();
- return s;
- }
- }
-
- public void setEnabledProtocols(String[] protocols)
- {
- if (protocols == null || protocols.length == 0)
- throw new IllegalArgumentException();
- for (int i = 0; i < protocols.length; i++)
- {
- if (!(protocols[i].equalsIgnoreCase("SSLv3") ||
- protocols[i].equalsIgnoreCase("TLSv1") ||
- protocols[i].equalsIgnoreCase("TLSv1.1")))
- {
- throw new
- IllegalArgumentException("unsupported protocol: " +
- protocols[i]);
- }
- }
- synchronized (enabledProtocols)
- {
- enabledProtocols.clear();
- for (int i = 0; i < protocols.length; i++)
- {
- if (protocols[i].equalsIgnoreCase("SSLv3"))
- enabledProtocols.add(ProtocolVersion.SSL_3);
- else if (protocols[i].equalsIgnoreCase("TLSv1"))
- enabledProtocols.add(ProtocolVersion.TLS_1);
- else
- enabledProtocols.add(ProtocolVersion.TLS_1_1);
- }
- }
- }
-
- public void setUseClientMode(boolean clientMode)
- {
- this.clientMode = clientMode;
- }
-
- public boolean getUseClientMode()
- {
- return clientMode;
- }
-
- public void setNeedClientAuth(boolean needClientAuth)
- {
- this.needClientAuth = needClientAuth;
- }
-
- public boolean getNeedClientAuth()
- {
- return needClientAuth;
- }
-
- public void setWantClientAuth(boolean wantClientAuth)
- {
- this.wantClientAuth = wantClientAuth;
- }
-
- public boolean getWantClientAuth()
- {
- return wantClientAuth;
- }
-
- // I misspelled this method in javax.net.SSLServerSocket, and that version
- // made it into kaffe 1.1.4.
- public void setEnabledSessionCreation(boolean createSessions)
- {
- setEnableSessionCreation(createSessions);
- }
-
- public void setEnableSessionCreation(boolean createSessions)
- {
- this.createSessions = createSessions;
- }
-
- public boolean getEnableSessionCreation()
- {
- return createSessions;
- }
-
- // Socket methods.
- // -------------------------------------------------------------------------
-
- public Socket accept() throws IOException
- {
- SSLSocket socket = new SSLSocket();
- implAccept(socket);
- socket.setUseClientMode(clientMode);
- socket.setNeedClientAuth(needClientAuth);
- socket.setWantClientAuth(wantClientAuth);
- socket.setEnableSessionCreation(createSessions);
- socket.setSessionContext(sessions);
- socket.setEnabledCipherSuites(new ArrayList(enabledSuites));
- socket.setEnabledProtocols(new TreeSet(enabledProtocols));
- socket.setSRPTrustManager(srpTrustManager);
- socket.setTrustManager(trustManager);
- socket.setKeyManager(keyManager);
- socket.setRandom(random);
- return socket;
- }
-
- // Package methods.
- // -------------------------------------------------------------------------
-
- void setSessionContext(SessionContext sessions)
- {
- this.sessions = sessions;
- }
-
- void setKeyManager(X509KeyManager keyManager)
- {
- this.keyManager = keyManager;
- }
-
- void setTrustManager(X509TrustManager trustManager)
- {
- this.trustManager = trustManager;
- }
-
- void setSRPTrustManager(SRPTrustManager srpTrustManager)
- {
- this.srpTrustManager = srpTrustManager;
- }
-
- void setRandom(SecureRandom random)
- {
- this.random = random;
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocketFactory.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocketFactory.java
deleted file mode 100644
index 72fb512c582..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocketFactory.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/* SSLServerSocketFactory.java -- factory for SSL server sockets.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.IOException;
-
-import java.net.InetAddress;
-import java.net.ServerSocket;
-
-import java.security.SecureRandom;
-
-import javax.net.ssl.X509KeyManager;
-import javax.net.ssl.X509TrustManager;
-
-import gnu.javax.net.ssl.SRPTrustManager;
-
-class SSLServerSocketFactory extends javax.net.ssl.SSLServerSocketFactory
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private final SessionContext sessions;
- private final X509KeyManager keyManager;
- private final X509TrustManager trustManager;
- private final SRPTrustManager srpTrustManager;
- private final SecureRandom random;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- SSLServerSocketFactory(X509TrustManager trustManager,
- SRPTrustManager srpTrustManager,
- X509KeyManager keyManager,
- SecureRandom random,
- SessionContext sessions)
- {
- super();
- this.trustManager = trustManager;
- this.srpTrustManager = srpTrustManager;
- this.keyManager = keyManager;
- this.random = random;
- this.sessions = sessions;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public String[] getDefaultCipherSuites()
- {
- return getSupportedCipherSuites();
- }
-
- public String[] getSupportedCipherSuites()
- {
- return (String[]) CipherSuite.availableSuiteNames().toArray(new String[0]);
- }
-
- public ServerSocket createServerSocket() throws IOException
- {
- SSLServerSocket socket = new SSLServerSocket();
- setup(socket);
- return socket;
- }
-
- public ServerSocket createServerSocket(int port) throws IOException
- {
- SSLServerSocket socket = new SSLServerSocket(port);
- setup(socket);
- return socket;
- }
-
- public ServerSocket createServerSocket(int port, int backlog)
- throws IOException
- {
- SSLServerSocket socket = new SSLServerSocket(port, backlog);
- setup(socket);
- return socket;
- }
-
- public ServerSocket createServerSocket(int port, int backlog, InetAddress addr)
- throws IOException
- {
- SSLServerSocket socket = new SSLServerSocket(port, backlog, addr);
- setup(socket);
- return socket;
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private void setup(SSLServerSocket socket)
- {
- socket.setSessionContext(sessions);
- socket.setKeyManager(keyManager);
- socket.setTrustManager(trustManager);
- socket.setSRPTrustManager(srpTrustManager);
- socket.setRandom(random);
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocketFactoryImpl.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocketFactoryImpl.java
new file mode 100644
index 00000000000..dc80dc78248
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocketFactoryImpl.java
@@ -0,0 +1,108 @@
+/* SSLServerSocketFactoryImpl.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+
+import javax.net.ssl.SSLServerSocketFactory;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class SSLServerSocketFactoryImpl extends SSLServerSocketFactory
+{
+ private final SSLContextImpl contextImpl;
+
+ public SSLServerSocketFactoryImpl(SSLContextImpl contextImpl)
+ {
+ this.contextImpl = contextImpl;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocketFactory#getDefaultCipherSuites()
+ */
+ @Override public String[] getDefaultCipherSuites()
+ {
+ return SSLEngineImpl.defaultSuites();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocketFactory#getSupportedCipherSuites()
+ */
+ @Override public String[] getSupportedCipherSuites()
+ {
+ return CipherSuite.availableSuiteNames().toArray(new String[0]);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ServerSocketFactory#createServerSocket(int)
+ */
+ @Override public SSLServerSocketImpl createServerSocket(int port)
+ throws IOException
+ {
+ SSLServerSocketImpl socket = new SSLServerSocketImpl(contextImpl);
+ socket.bind(new InetSocketAddress(port));
+ return socket;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ServerSocketFactory#createServerSocket(int, int)
+ */
+ @Override public SSLServerSocketImpl createServerSocket(int port, int backlog)
+ throws IOException
+ {
+ SSLServerSocketImpl socket = new SSLServerSocketImpl(contextImpl);
+ socket.bind(new InetSocketAddress(port), backlog);
+ return socket;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ServerSocketFactory#createServerSocket(int, int, java.net.InetAddress)
+ */
+ @Override public SSLServerSocketImpl createServerSocket(int port, int backlog,
+ InetAddress bindAddress)
+ throws IOException
+ {
+ SSLServerSocketImpl socket = new SSLServerSocketImpl(contextImpl);
+ socket.bind(new InetSocketAddress(bindAddress, port), backlog);
+ return socket;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocketImpl.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocketImpl.java
new file mode 100644
index 00000000000..41ef5f1cf46
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/SSLServerSocketImpl.java
@@ -0,0 +1,199 @@
+/* SSLServerSocketImpl.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.io.IOException;
+
+import javax.net.ssl.SSLServerSocket;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class SSLServerSocketImpl extends SSLServerSocket
+{
+ private final SSLContextImpl contextImpl;
+
+ private boolean enableSessionCreation;
+ private String[] enabledCipherSuites;
+ private String[] enabledProtocols;
+ private boolean needClientAuth;
+ private boolean wantClientAuth;
+ private boolean clientMode;
+
+ public SSLServerSocketImpl(SSLContextImpl contextImpl) throws IOException
+ {
+ super();
+ this.contextImpl = contextImpl;
+ enableSessionCreation = true;
+ enabledCipherSuites = SSLEngineImpl.defaultSuites();
+ enabledProtocols = new String[] { ProtocolVersion.SSL_3.toString(),
+ ProtocolVersion.TLS_1.toString(),
+ ProtocolVersion.TLS_1_1.toString() };
+ needClientAuth = false;
+ wantClientAuth = false;
+ clientMode = false;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocket#getEnableSessionCreation()
+ */
+ @Override public boolean getEnableSessionCreation()
+ {
+ return enableSessionCreation;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocket#getEnabledCipherSuites()
+ */
+ @Override public String[] getEnabledCipherSuites()
+ {
+ return (String[]) enabledCipherSuites.clone();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocket#getEnabledProtocols()
+ */
+ @Override public String[] getEnabledProtocols()
+ {
+ return (String[]) enabledProtocols.clone();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocket#getNeedClientAuth()
+ */
+ @Override public boolean getNeedClientAuth()
+ {
+ return needClientAuth;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocket#getSupportedCipherSuites()
+ */
+ @Override public String[] getSupportedCipherSuites()
+ {
+ return CipherSuite.availableSuiteNames().toArray(new String[0]);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocket#getSupportedProtocols()
+ */
+ @Override public String[] getSupportedProtocols()
+ {
+ return new String[] { ProtocolVersion.SSL_3.toString(),
+ ProtocolVersion.TLS_1.toString(),
+ ProtocolVersion.TLS_1_1.toString() };
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocket#getUseClientMode()
+ */
+ @Override public boolean getUseClientMode()
+ {
+ return clientMode;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocket#getWantClientAuth()
+ */
+ @Override public boolean getWantClientAuth()
+ {
+ return wantClientAuth;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocket#setEnableSessionCreation(boolean)
+ */
+ @Override public void setEnableSessionCreation(final boolean enabled)
+ {
+ enableSessionCreation = enabled;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocket#setEnabledCipherSuites(java.lang.String[])
+ */
+ @Override public void setEnabledCipherSuites(final String[] suites)
+ {
+ enabledCipherSuites = (String[]) suites.clone();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocket#setEnabledProtocols(java.lang.String[])
+ */
+ @Override public void setEnabledProtocols(final String[] protocols)
+ {
+ enabledProtocols = (String[]) protocols.clone();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocket#setNeedClientAuth(boolean)
+ */
+ @Override public void setNeedClientAuth(final boolean needAuth)
+ {
+ needClientAuth = needAuth;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocket#setUseClientMode(boolean)
+ */
+ @Override public void setUseClientMode(final boolean clientMode)
+ {
+ this.clientMode = clientMode;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLServerSocket#setWantClientAuth(boolean)
+ */
+ @Override public void setWantClientAuth(final boolean wantAuth)
+ {
+ wantClientAuth = wantAuth;
+ }
+
+ @Override public SSLSocketImpl accept() throws IOException
+ {
+ SSLSocketImpl socketImpl = new SSLSocketImpl(contextImpl, null, -1);
+ implAccept(socketImpl);
+ socketImpl.setEnableSessionCreation(enableSessionCreation);
+ socketImpl.setEnabledCipherSuites(enabledCipherSuites);
+ socketImpl.setEnabledProtocols(enabledProtocols);
+ socketImpl.setNeedClientAuth(needClientAuth);
+ socketImpl.setUseClientMode(clientMode);
+ socketImpl.setWantClientAuth(wantClientAuth);
+ return socketImpl;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocket.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocket.java
deleted file mode 100644
index d08bc50f1c9..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocket.java
+++ /dev/null
@@ -1,3515 +0,0 @@
-/* SSLSocket.java -- the SSL socket class.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.BufferedOutputStream;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintStream;
-
-import java.math.BigInteger;
-
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.SocketAddress;
-import java.net.SocketException;
-
-import java.nio.channels.SocketChannel;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.KeyPair;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Principal;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.Security;
-import java.security.SecureRandom;
-import java.security.cert.X509Certificate;
-import java.security.interfaces.DSAPrivateKey;
-import java.security.interfaces.DSAPublicKey;
-import java.security.interfaces.RSAPrivateKey;
-import java.security.interfaces.RSAPublicKey;
-
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import java.util.logging.Logger;
-
-import javax.crypto.Cipher;
-import javax.crypto.Mac;
-import javax.crypto.NoSuchPaddingException;
-import javax.crypto.interfaces.DHPublicKey;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.SecretKeySpec;
-
-import javax.net.ssl.HandshakeCompletedEvent;
-import javax.net.ssl.HandshakeCompletedListener;
-import javax.net.ssl.SSLException;
-import javax.net.ssl.SSLHandshakeException;
-import javax.net.ssl.SSLPeerUnverifiedException;
-import javax.net.ssl.SSLProtocolException;
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.X509KeyManager;
-import javax.net.ssl.X509TrustManager;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.ConfirmationCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.TextInputCallback;
-
-import gnu.classpath.debug.Component;
-import gnu.classpath.debug.SystemLogger;
-
-import gnu.java.security.Registry;
-import gnu.javax.security.auth.callback.DefaultCallbackHandler;
-import gnu.java.security.hash.HashFactory;
-import gnu.java.security.hash.IMessageDigest;
-import gnu.javax.crypto.key.IKeyAgreementParty;
-import gnu.javax.crypto.key.KeyAgreementFactory;
-import gnu.javax.crypto.key.KeyAgreementException;
-import gnu.javax.crypto.key.OutgoingMessage;
-import gnu.javax.crypto.key.IncomingMessage;
-import gnu.javax.crypto.key.dh.DiffieHellmanKeyAgreement;
-import gnu.javax.crypto.key.dh.ElGamalKeyAgreement;
-import gnu.javax.crypto.key.dh.GnuDHPrivateKey;
-import gnu.javax.crypto.key.dh.GnuDHPublicKey;
-import gnu.javax.crypto.key.srp6.SRPPrivateKey;
-import gnu.javax.crypto.key.srp6.SRPPublicKey;
-import gnu.javax.crypto.key.srp6.SRP6KeyAgreement;
-import gnu.javax.crypto.mac.IMac;
-import gnu.javax.crypto.mode.IMode;
-import gnu.javax.crypto.prng.ARCFour;
-import gnu.java.security.prng.IRandom;
-import gnu.java.security.prng.LimitReachedException;
-import gnu.javax.crypto.sasl.srp.SRPAuthInfoProvider;
-import gnu.javax.crypto.sasl.srp.SRPRegistry;
-import gnu.java.security.sig.ISignature;
-import gnu.java.security.sig.SignatureFactory;
-import gnu.java.security.sig.dss.DSSSignature;
-import gnu.java.security.sig.rsa.EME_PKCS1_V1_5;
-import gnu.java.security.sig.rsa.RSA;
-
-import gnu.javax.net.ssl.SRPTrustManager;
-
-/**
- * This is the core of the Jessie SSL implementation; it implements the {@link
- * javax.net.ssl.SSLSocket} for normal and "wrapped" sockets, and handles all
- * protocols implemented by this library.
- */
-final class SSLSocket extends javax.net.ssl.SSLSocket
-{
-
- // This class is almost unbearably large and complex, but is laid out
- // as follows:
- //
- // 1. Fields.
- // 2. Constructors.
- // 3. SSLSocket methods. These are the public methods defined in
- // javax.net.ssl.SSLSocket.
- // 4. Socket methods. These override the public methods of java.net.Socket,
- // and delegate the method call to either the underlying socket if this is
- // a wrapped socket, or to the superclass.
- // 5. Package-private methods that various pieces of Jessie use.
- // 6. Private methods. These compose the SSL handshake.
- //
- // Each part is preceeded by a form feed.
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- // Debuggery.
- private static final boolean DEBUG_HANDSHAKE_LAYER = true;
- private static final boolean DEBUG_KEY_EXCHANGE = false;
- private static final Logger logger = SystemLogger.SYSTEM;
-
- // Fields for using this class as a wrapped socket.
- private Socket underlyingSocket;
- private int underlyingPort;
- private boolean autoClose;
-
- // Cryptography fields.
- SessionContext sessionContext;
- Session session;
- LinkedList handshakeListeners;
- private boolean clientMode, wantClientAuth, needClientAuth, createSessions;
- private boolean handshakeDone;
-
- // I/O fields.
- private String remoteHost;
- private InputStream socketIn;
- private OutputStream socketOut;
- private InputStream applicationIn;
- private OutputStream applicationOut;
- private InputStream handshakeIn;
- private OutputStream handshakeOut;
-// private ThreadGroup recordLayer;
- RecordInput recordInput;
-// RecordOutput recordOutput;
- private long handshakeTime;
-
- private SocketChannel channel;
-
- static SortedSet supportedProtocols = new TreeSet();
- static List supportedSuites = new ArrayList(30);
-
- // Static initializer.
- // -------------------------------------------------------------------------
-
- static
- {
- //supportedProtocols.add(ProtocolVersion.TLS_1_1);
- supportedProtocols.add(ProtocolVersion.TLS_1);
- supportedProtocols.add(ProtocolVersion.SSL_3);
-
- // These are in preference order. It's my preference order, but I'm not
- // a total idiot.
- supportedSuites.add(CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DH_DSS_WITH_AES_256_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DH_RSA_WITH_AES_256_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DH_DSS_WITH_AES_128_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DH_RSA_WITH_AES_128_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_RSA_WITH_3DES_EDE_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_RSA_WITH_RC4_128_MD5);
- supportedSuites.add(CipherSuite.TLS_RSA_WITH_RC4_128_SHA);
- supportedSuites.add(CipherSuite.TLS_DHE_DSS_WITH_DES_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DHE_RSA_WITH_DES_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DH_DSS_WITH_DES_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DH_RSA_WITH_DES_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_RSA_WITH_DES_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_RSA_EXPORT_WITH_DES40_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_RSA_EXPORT_WITH_RC4_40_MD5);
- supportedSuites.add(CipherSuite.TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA);
- supportedSuites.add(CipherSuite.TLS_RSA_WITH_NULL_MD5);
- supportedSuites.add(CipherSuite.TLS_RSA_WITH_NULL_SHA);
- }
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- SSLSocket(Socket socket, String host, int port, boolean autoClose)
- throws IOException
- {
- underlyingSocket = socket;
- remoteHost = host;
- underlyingPort = port;
- this.autoClose = autoClose;
- initialize();
- }
-
- SSLSocket (Socket socket, SocketChannel channel) throws IOException
- {
- underlyingSocket = socket;
- this.channel = channel;
- initialize ();
- }
-
- SSLSocket() throws IOException
- {
- super();
- initialize();
- }
-
- SSLSocket(InetAddress addr, int port) throws IOException
- {
- super(addr, port);
- initialize();
- remoteHost = addr.getHostName();
- if (remoteHost == null)
- {
- remoteHost = addr.getHostAddress();
- }
- }
-
- SSLSocket(InetAddress addr, int port, InetAddress laddr, int lport)
- throws IOException
- {
- super(addr, port, laddr, lport);
- initialize();
- remoteHost = addr.getHostName();
- if (remoteHost == null)
- remoteHost = addr.getHostAddress();
- }
-
- SSLSocket(String host, int port) throws IOException
- {
- super(host, port);
- initialize();
- remoteHost = host;
- }
-
- SSLSocket(String host, int port, InetAddress laddr, int lport)
- throws IOException
- {
- super(host, port, laddr, lport);
- initialize();
- remoteHost = host;
- }
-
- private void initialize()
- {
- session = new Session();
- session.enabledSuites = new ArrayList(supportedSuites);
- session.enabledProtocols = new TreeSet(supportedProtocols);
- session.protocol = ProtocolVersion.TLS_1;
- session.params.setVersion (ProtocolVersion.TLS_1);
- handshakeListeners = new LinkedList();
- handshakeDone = false;
- }
-
- // SSL methods.
- // -------------------------------------------------------------------------
-
- public void addHandshakeCompletedListener(HandshakeCompletedListener l)
- {
- synchronized (handshakeListeners)
- {
- if (l == null)
- throw new NullPointerException();
- if (!handshakeListeners.contains(l))
- handshakeListeners.add(l);
- }
- }
-
- public void removeHandshakeCompletedListener(HandshakeCompletedListener l)
- {
- synchronized (handshakeListeners)
- {
- handshakeListeners.remove(l);
- }
- }
-
- public String[] getEnabledProtocols()
- {
- synchronized (session.enabledProtocols)
- {
- try
- {
- return (String[]) Util.transform(session.enabledProtocols.toArray(),
- String.class, "toString", null);
- }
- catch (Exception x)
- {
- RuntimeException re = new RuntimeException (x.getMessage());
- re.initCause (x);
- throw re;
- }
- }
- }
-
- public void setEnabledProtocols(String[] protocols)
- {
- if (protocols == null || protocols.length == 0)
- throw new IllegalArgumentException();
- for (int i = 0; i < protocols.length; i++)
- {
- if (!(protocols[i].equalsIgnoreCase("SSLv3") ||
- protocols[i].equalsIgnoreCase("TLSv1") ||
- protocols[i].equalsIgnoreCase("TLSv1.1")))
- {
- throw new
- IllegalArgumentException("unsupported protocol: " +
- protocols[i]);
- }
- }
- synchronized (session.enabledProtocols)
- {
- session.enabledProtocols.clear();
- for (int i = 0; i < protocols.length; i++)
- {
- if (protocols[i].equalsIgnoreCase("SSLv3"))
- {
- session.enabledProtocols.add(ProtocolVersion.SSL_3);
- }
- else if (protocols[i].equalsIgnoreCase("TLSv1"))
- {
- session.enabledProtocols.add(ProtocolVersion.TLS_1);
- }
- else
- {
- session.enabledProtocols.add(ProtocolVersion.TLS_1_1);
- }
- }
- }
- }
-
- public String[] getSupportedProtocols()
- {
- return new String[] { /* "TLSv1.1", */ "TLSv1", "SSLv3" };
- }
-
- public String[] getEnabledCipherSuites()
- {
- synchronized (session.enabledSuites)
- {
- try
- {
- return (String[]) Util.transform(session.enabledSuites.toArray(),
- String.class, "toString", null);
- }
- catch (Exception x)
- {
- RuntimeException re = new RuntimeException (x.getMessage());
- re.initCause (x);
- throw re;
- }
- }
- }
-
- public void setEnabledCipherSuites(String[] suites)
- {
- if (suites == null || suites.length == 0)
- throw new IllegalArgumentException();
- for (int i = 0; i < suites.length; i++)
- if (CipherSuite.forName(suites[i]) == null)
- throw new IllegalArgumentException("unsupported suite: " +
- suites[i]);
- synchronized (session.enabledSuites)
- {
- session.enabledSuites.clear();
- for (int i = 0; i < suites.length; i++)
- {
- CipherSuite suite = CipherSuite.forName(suites[i]);
- if (!session.enabledSuites.contains(suite))
- {
- session.enabledSuites.add(suite);
- }
- }
- }
- }
-
- public String[] getSupportedCipherSuites()
- {
- return (String[]) CipherSuite.availableSuiteNames().toArray(new String[52]);
- }
-
- public SSLSession getSession()
- {
- return session;
- }
-
- public boolean getEnableSessionCreation()
- {
- return createSessions;
- }
-
- public void setEnableSessionCreation(boolean flag)
- {
- createSessions = flag;
- }
-
- public boolean getNeedClientAuth()
- {
- return needClientAuth;
- }
-
- public void setNeedClientAuth(boolean flag)
- {
- needClientAuth = flag;
- }
-
- public boolean getWantClientAuth()
- {
- return wantClientAuth;
- }
-
- public void setWantClientAuth(boolean flag)
- {
- wantClientAuth = flag;
- }
-
- public boolean getUseClientMode()
- {
- return clientMode;
- }
-
- public void setUseClientMode(boolean flag)
- {
- this.clientMode = flag;
- }
-
- public synchronized void startHandshake() throws IOException
- {
- if (DEBUG_HANDSHAKE_LAYER)
- {
- logger.log (Component.SSL_HANDSHAKE, "startHandshake called in {0}",
- Thread.currentThread());
- handshakeTime = System.currentTimeMillis();
- }
- if (handshakeDone)
- {
- if (clientMode)
- {
- handshakeDone = false;
- doClientHandshake();
- }
- else
- {
- Handshake req = new Handshake(Handshake.Type.HELLO_REQUEST, null);
- req.write (handshakeOut, session.protocol);
- handshakeOut.flush();
-// recordOutput.setHandshakeAvail(req.write(handshakeOut, session.protocol));
- }
- return;
- }
- if (recordInput == null)
- {
- setupIO();
- }
- if (clientMode)
- {
- doClientHandshake();
- }
- else
- {
- doServerHandshake();
- }
- }
-
- // Socket methods.
- // -------------------------------------------------------------------------
-
- public InetAddress getInetAddress()
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getInetAddress();
- }
- else
- {
- return super.getInetAddress();
- }
- }
-
- public InetAddress getLocalAddress()
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getLocalAddress();
- }
- else
- {
- return super.getLocalAddress();
- }
- }
-
- public int getPort()
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getPort();
- }
- else
- {
- return super.getPort();
- }
- }
-
- public int getLocalPort()
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getLocalPort();
- }
- else
- {
- return super.getLocalPort();
- }
- }
-
- public InputStream getInputStream() throws IOException
- {
- if (applicationIn == null)
- {
- setupIO();
- }
- return applicationIn;
- }
-
- public OutputStream getOutputStream() throws IOException
- {
- if (applicationOut == null)
- {
- setupIO();
- }
- return applicationOut;
- }
-
- public void setTcpNoDelay(boolean flag) throws SocketException
- {
- if (underlyingSocket != null)
- {
- underlyingSocket.setTcpNoDelay(flag);
- }
- else
- {
- super.setTcpNoDelay(flag);
- }
- }
-
- public boolean getTcpNoDelay() throws SocketException
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getTcpNoDelay();
- }
- else
- {
- return super.getTcpNoDelay();
- }
- }
-
- public void setSoLinger(boolean flag, int linger) throws SocketException
- {
- if (underlyingSocket != null)
- {
- underlyingSocket.setSoLinger(flag, linger);
- }
- else
- {
- super.setSoLinger(flag, linger);
- }
- }
-
- public int getSoLinger() throws SocketException
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getSoLinger();
- }
- else
- {
- return super.getSoLinger();
- }
- }
-
- public void sendUrgentData(int data) throws IOException
- {
- throw new UnsupportedOperationException("not implemented");
- }
-
- public void setSoTimeout(int timeout) throws SocketException
- {
- if (underlyingSocket != null)
- {
- underlyingSocket.setSoTimeout(timeout);
- }
- else
- {
- super.setSoTimeout(timeout);
- }
- }
-
- public int getSoTimeout() throws SocketException
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getSoTimeout();
- }
- else
- {
- return super.getSoTimeout();
- }
- }
-
- public void setSendBufferSize(int size) throws SocketException
- {
- if (underlyingSocket != null)
- {
- underlyingSocket.setSendBufferSize(size);
- }
- else
- {
- super.setSendBufferSize(size);
- }
- }
-
- public int getSendBufferSize() throws SocketException
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getSendBufferSize();
- }
- else
- {
- return super.getSendBufferSize();
- }
- }
-
- public void setReceiveBufferSize(int size) throws SocketException
- {
- if (underlyingSocket != null)
- {
- underlyingSocket.setReceiveBufferSize(size);
- }
- else
- {
- super.setReceiveBufferSize(size);
- }
- }
-
- public int getReceiveBufferSize() throws SocketException
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getReceiveBufferSize();
- }
- else
- {
- return super.getReceiveBufferSize();
- }
- }
-
- public synchronized void close() throws IOException
- {
- if (recordInput == null)
- {
- if (underlyingSocket != null)
- {
- if (autoClose)
- underlyingSocket.close();
- }
- else
- super.close();
- return;
- }
-// while (recordOutput.applicationDataPending()) Thread.yield();
- Alert close = new Alert (Alert.Level.WARNING, Alert.Description.CLOSE_NOTIFY);
- sendAlert (close);
- long wait = System.currentTimeMillis() + 60000L;
- while (session.currentAlert == null && !recordInput.pollClose())
- {
-
- Thread.yield();
- if (wait <= System.currentTimeMillis())
- {
- break;
- }
- }
- boolean gotClose = session.currentAlert != null &&
- session.currentAlert.getDescription() == Alert.Description.CLOSE_NOTIFY;
-// recordInput.setRunning(false);
-// recordOutput.setRunning(false);
-// recordLayer.interrupt();
- recordInput = null;
-// recordOutput = null;
-// recordLayer = null;
- if (underlyingSocket != null)
- {
- if (autoClose)
- underlyingSocket.close();
- }
- else
- super.close();
- if (!gotClose)
- {
- session.invalidate();
- throw new SSLException("did not receive close notify");
- }
- }
-
- public String toString()
- {
- if (underlyingSocket != null)
- {
- return SSLSocket.class.getName() + " [ " + underlyingSocket + " ]";
- }
- else
- {
- return SSLSocket.class.getName() + " [ " + super.toString() + " ]";
- }
- }
-
- // Configuration insanity begins here.
-
- public void connect(SocketAddress saddr) throws IOException
- {
- if (underlyingSocket != null)
- {
- underlyingSocket.connect(saddr);
- }
- else
- {
- super.connect(saddr);
- }
- }
-
- public void connect(SocketAddress saddr, int timeout) throws IOException
- {
- if (underlyingSocket != null)
- {
- underlyingSocket.connect(saddr, timeout);
- }
- else
- {
- super.connect(saddr, timeout);
- }
- }
-
- public void bind(SocketAddress saddr) throws IOException
- {
- if (underlyingSocket != null)
- {
- underlyingSocket.bind(saddr);
- }
- else
- {
- super.bind(saddr);
- }
- }
-
- public SocketAddress getLocalSocketAddress()
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getLocalSocketAddress();
- }
- else
- {
- return super.getLocalSocketAddress();
- }
- }
-
- public SocketChannel getChannel()
- {
- return channel;
- }
-
- public boolean isBound()
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.isBound();
- }
- else
- {
- return super.isBound();
- }
- }
-
- public boolean isClosed()
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.isClosed();
- }
- else
- {
- return super.isClosed();
- }
- }
-
- public SocketAddress getRemoteSocketAddress()
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getRemoteSocketAddress();
- }
- else
- {
- return super.getRemoteSocketAddress();
- }
- }
-
- public void setOOBInline(boolean flag) throws SocketException
- {
- if (underlyingSocket != null)
- {
- underlyingSocket.setOOBInline(flag);
- }
- else
- {
- super.setOOBInline(flag);
- }
- }
-
- public boolean getOOBInline() throws SocketException
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getOOBInline();
- }
- else
- {
- return super.getOOBInline();
- }
- }
-
- public void setKeepAlive(boolean flag) throws SocketException
- {
- if (underlyingSocket != null)
- {
- underlyingSocket.setKeepAlive(flag);
- }
- else
- {
- super.setKeepAlive(flag);
- }
- }
-
- public boolean getKeepAlive() throws SocketException
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getKeepAlive();
- }
- else
- {
- return super.getKeepAlive();
- }
- }
-
- public void setTrafficClass(int clazz) throws SocketException
- {
- if (underlyingSocket != null)
- {
- underlyingSocket.setTrafficClass(clazz);
- }
- else
- {
- super.setTrafficClass(clazz);
- }
- }
-
- public int getTrafficClass() throws SocketException
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getTrafficClass();
- }
- else
- {
- return super.getTrafficClass();
- }
- }
-
- public void setReuseAddress(boolean flag) throws SocketException
- {
- if (underlyingSocket != null)
- {
- underlyingSocket.setReuseAddress(flag);
- }
- else
- {
- super.setReuseAddress(flag);
- }
- }
-
- public boolean getReuseAddress() throws SocketException
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.getReuseAddress();
- }
- else
- {
- return super.getReuseAddress();
- }
- }
-
- public void shutdownInput() throws IOException
- {
- if (underlyingSocket != null)
- {
- underlyingSocket.shutdownInput();
- }
- else
- {
- super.shutdownInput();
- }
- }
-
- public void shutdownOutput() throws IOException
- {
- if (underlyingSocket != null)
- {
- underlyingSocket.shutdownOutput();
- }
- else
- {
- super.shutdownOutput();
- }
- }
-
- public boolean isConnected()
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.isConnected();
- }
- else
- {
- return super.isConnected();
- }
- }
-
- public boolean isInputShutdown()
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.isInputShutdown();
- }
- else
- {
- return super.isInputShutdown();
- }
- }
-
- public boolean isOutputShutdown()
- {
- if (underlyingSocket != null)
- {
- return underlyingSocket.isOutputShutdown();
- }
- else
- {
- return super.isOutputShutdown();
- }
- }
-
- protected void finalize()
- {
- if (session.currentAlert == null)
- {
- try
- {
- close();
- }
- catch (Exception ignore) { }
- }
- }
-
- // Package methods.
- // -------------------------------------------------------------------------
-
- void setSessionContext(SessionContext sessionContext)
- {
- this.sessionContext = sessionContext;
- }
-
- void setEnabledCipherSuites(List suites)
- {
- session.enabledSuites = suites;
- }
-
- void setEnabledProtocols(SortedSet protocols)
- {
- session.enabledProtocols = protocols;
- }
-
- void setSRPTrustManager(SRPTrustManager srpTrustManager)
- {
- session.srpTrustManager = srpTrustManager;
- }
-
- void setTrustManager(X509TrustManager trustManager)
- {
- session.trustManager = trustManager;
- }
-
- void setKeyManager(X509KeyManager keyManager)
- {
- session.keyManager = keyManager;
- }
-
- void setRandom(SecureRandom random)
- {
- session.random = random;
- }
-
- void sendAlert (Alert alert) throws IOException
- {
- RecordOutputStream out =
- new RecordOutputStream (socketOut, ContentType.ALERT, session.params);
- out.write (alert.getEncoded ());
- }
-
- /**
- * Gets the most-recently-received alert message.
- *
- * @return The alert message.
- */
- Alert checkAlert()
- {
- return session.currentAlert;
- }
-
- synchronized void checkHandshakeDone() throws IOException
- {
- if (!handshakeDone)
- {
- startHandshake();
- }
- Alert alert = session.currentAlert;
- if (alert != null && alert.getLevel() == Alert.Level.FATAL)
- {
- throw new AlertException(alert, false);
- }
- if (handshakeIn.available() > 0 && !clientMode)
- {
- handshakeDone = false;
- startHandshake();
- }
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private static final byte[] SENDER_CLIENT =
- new byte[] { 0x43, 0x4C, 0x4E, 0x54 };
- private static final byte[] SENDER_SERVER =
- new byte[] { 0x53, 0x52, 0x56, 0x52 };
-
- private void changeCipherSpec () throws IOException
- {
- RecordOutputStream out =
- new RecordOutputStream (socketOut, ContentType.CHANGE_CIPHER_SPEC, session.params);
- out.write (1);
- }
-
- private void readChangeCipherSpec () throws IOException
- {
- RecordInputStream in =
- new RecordInputStream (recordInput, ContentType.CHANGE_CIPHER_SPEC);
- if (in.read() != 1)
- {
- throw new SSLProtocolException ("bad change cipher spec message");
- }
- }
-
- /**
- * Initializes the application data streams and starts the record layer
- * threads.
- */
- private synchronized void setupIO() throws IOException
- {
- if (recordInput != null)
- {
- return;
- }
- if (underlyingSocket != null)
- {
- socketIn = underlyingSocket.getInputStream();
- socketOut = underlyingSocket.getOutputStream();
- }
- else
- {
- socketIn = super.getInputStream();
- socketOut = super.getOutputStream();
- }
-// recordLayer = new ThreadGroup("record_layer");
-// recordInput = new RecordInput(in, session, recordLayer);
-// recordOutput = new RecordOutput(out, session, recordLayer);
-// recordInput.setRecordOutput(recordOutput);
-// recordLayer.setDaemon(true);
-// recordInput.start();
-// recordOutput.start();
- recordInput = new RecordInput (socketIn, session);
- applicationIn = new SSLSocketInputStream(
- new RecordInputStream (recordInput, ContentType.APPLICATION_DATA), this);
- applicationOut = new SSLSocketOutputStream(
- new RecordOutputStream (socketOut, ContentType.APPLICATION_DATA, session.params), this);
- handshakeIn = new SSLSocketInputStream(
- new RecordInputStream (recordInput, ContentType.HANDSHAKE), this, false);
- handshakeOut = new BufferedOutputStream (new SSLSocketOutputStream(
- new RecordOutputStream (socketOut, ContentType.HANDSHAKE, session.params), this, false), 8096);
- }
-
- private void handshakeCompleted ()
- {
- handshakeDone = true;
- HandshakeCompletedEvent event = new HandshakeCompletedEvent (this, session);
- for (Iterator it = handshakeListeners.iterator (); it.hasNext (); )
- {
- try
- {
- ((HandshakeCompletedListener) it.next ()).handshakeCompleted (event);
- }
- catch (Throwable t) { }
- }
- if (createSessions)
- {
- synchronized (session)
- {
- sessionContext.addSession (session.sessionId, session);
- session.access ();
- }
- }
-
- if (DEBUG_HANDSHAKE_LAYER)
- {
- logger.log (Component.SSL_HANDSHAKE, "Handshake finished in {0}",
- Thread.currentThread());
- handshakeTime = System.currentTimeMillis() - handshakeTime;
- logger.log (Component.SSL_HANDSHAKE, "Elapsed time {0}s",
- new Long (handshakeTime / 1000));
- }
- }
-
- /*
- * Perform the client handshake. The process looks like this:
- *
- * ClientHello -->
- * ServerHello <--
- * Certificate* <--
- * ServerKeyExchange* <--
- * CertificateRequest* <--
- * ServerHelloDone* <--
- * Certificate* -->
- * ClientKeyExchange -->
- * CertificateVerify* -->
- * [ChangeCipherSpec] -->
- * Finished -->
- * [ChangeCipherSpec] <--
- * Finished <--
- *
- * With --> denoting output and <-- denoting input. * denotes optional
- * messages.
- *
- * Alternatively, this may be an abbreviated handshake if we are resuming
- * a session:
- *
- * ClientHello -->
- * ServerHello <--
- * [ChangeCipherSpec] <--
- * Finished <--
- * [ChangeCipherSpec] -->
- * Finished -->
- */
- private void doClientHandshake() throws IOException
- {
- if (DEBUG_HANDSHAKE_LAYER)
- {
- logger.log (Component.SSL_HANDSHAKE, "starting client handshake in {0}",
- Thread.currentThread());
- }
-
- IMessageDigest md5 = HashFactory.getInstance(Registry.MD5_HASH);
- IMessageDigest sha = HashFactory.getInstance(Registry.SHA160_HASH);
- DigestInputStream din = new DigestInputStream(handshakeIn, md5, sha);
- DigestOutputStream dout = new DigestOutputStream(handshakeOut, md5, sha);
- Session continuedSession = null;
- byte[] sessionId = new byte[0];
- List extensions = null;
- String user = null;
- CertificateType certType = CertificateType.X509;
-
- // Look through the available sessions to see if an appropriate one is
- // available.
- for (Enumeration e = sessionContext.getIds(); e.hasMoreElements(); )
- {
- byte[] id = (byte[]) e.nextElement();
- continuedSession = (Session) sessionContext.getSession(id);
- if (continuedSession == null)
- {
- continue;
- }
- if (!session.enabledProtocols.contains(continuedSession.protocol))
- {
- continue;
- }
- if (continuedSession.getPeerHost().equals(remoteHost))
- {
- sessionId = id;
- break;
- }
- }
-
- // If a SRP suite is enabled, ask for a username so we can include it
- // with our extensions list.
- for (Iterator i = session.enabledSuites.iterator(); i.hasNext(); )
- {
- CipherSuite s = (CipherSuite) i.next();
- if (s.getKeyExchange() == "SRP")
- {
- extensions = new LinkedList();
- user = askUserName(remoteHost);
- byte[] b = user.getBytes("UTF-8");
- if (b.length > 255)
- {
- handshakeFailure();
- throw new SSLException("SRP username too long");
- }
- extensions.add(new Extension(Extension.Type.SRP,
- Util.concat(new byte[] { (byte) b.length }, b)));
-
- break;
- }
- }
-
- // If the jessie.fragment.length property is set, add the appropriate
- // extension to the list. The fragment length is only actually set if
- // the server responds with the same extension.
- try
- {
- int flen = Integer.parseInt(Util.getSecurityProperty("jessie.fragment.length"));
- byte[] ext = new byte[1];
- if (flen == 512)
- ext[0] = 1;
- else if (flen == 1024)
- ext[0] = 2;
- else if (flen == 2048)
- ext[0] = 3;
- else if (flen == 4096)
- ext[0] = 4;
- else
- throw new NumberFormatException();
- if (extensions == null)
- extensions = new LinkedList();
- extensions.add(new Extension(Extension.Type.MAX_FRAGMENT_LENGTH, ext));
- }
- catch (NumberFormatException nfe) { }
-
- // FIXME: set certificate types.
-
- // Send the client hello.
- ProtocolVersion version = session.protocol;
- Random clientRandom =
- new Random(Util.unixTime(), session.random.generateSeed(28));
- session.protocol = (ProtocolVersion) session.enabledProtocols.last();
- List comp = new ArrayList(2);
- comp.add(CompressionMethod.ZLIB);
- comp.add(CompressionMethod.NULL);
- ClientHello clientHello =
- new ClientHello(session.protocol, clientRandom, sessionId,
- session.enabledSuites, comp, extensions);
- Handshake msg = new Handshake(Handshake.Type.CLIENT_HELLO, clientHello);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- msg.write (dout, version);
-// recordOutput.setHandshakeAvail(msg.write(dout, version));
- dout.flush();
-// try
-// {
-// Thread.sleep(150);
-// }
-// catch (InterruptedException ie)
-// {
-// }
-
- // Receive the server hello.
- msg = Handshake.read(din);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- if (msg.getType() != Handshake.Type.SERVER_HELLO)
- {
- throwUnexpectedMessage();
- }
- ServerHello serverHello = (ServerHello) msg.getBody();
- Random serverRandom = serverHello.getRandom();
- version = serverHello.getVersion();
-
- // If we don't directly support the server's protocol version, choose
- // the highest one we support that is less than the server's version.
- if (!session.enabledProtocols.contains(version))
- {
- ProtocolVersion v1 = null, v2 = null;
- for (Iterator it = session.enabledProtocols.iterator();
- it.hasNext(); )
- {
- v1 = (ProtocolVersion) it.next();
- if (v1.compareTo(version) > 0)
- break;
- v2 = v1;
- }
- version = v1;
- }
-
- // The server's version is either unsupported by us (unlikely) or the user
- // has only enabled incompatible versions.
- if (version == null)
- {
- Alert.Description desc = null;
- if (serverHello.getVersion() == ProtocolVersion.SSL_3)
- {
- desc = Alert.Description.HANDSHAKE_FAILURE;
- }
- else
- {
- desc = Alert.Description.PROTOCOL_VERSION;
- }
- Alert alert = new Alert(Alert.Level.FATAL, desc);
- sendAlert(alert);
- session.currentAlert = alert;
- fatal();
- throw new AlertException(alert, true);
- }
-
- if (serverHello.getExtensions() != null)
- {
- for (Iterator it = serverHello.getExtensions().iterator();
- it.hasNext(); )
- {
- Extension e = (Extension) it.next();
- if (e.getType() == Extension.Type.MAX_FRAGMENT_LENGTH)
- {
- int len = Extensions.getMaxFragmentLength(e).intValue();
- session.params.setFragmentLength(len);
-// recordOutput.setFragmentLength(len);
-// recordInput.setFragmentLength(len);
- }
- else if (e.getType() == Extension.Type.CERT_TYPE)
- {
- certType = Extensions.getServerCertType(e);
- }
- }
- }
-
- CipherSuite suite = serverHello.getCipherSuite().resolve(version);
- boolean newSession = true;
- if (sessionId.length > 0 &&
- Arrays.equals(sessionId, serverHello.getSessionId()))
- {
- SecurityParameters params = session.params;
- SecureRandom random = session.random;
- session = (Session) continuedSession.clone();
- session.params = params;
- session.random = random;
- recordInput.setSession(session);
-// recordOutput.setSession(session);
- suite = session.cipherSuite;
- newSession = false;
- }
- else
- {
- sessionContext.removeSession(new Session.ID(sessionId));
- }
- if (newSession)
- {
- session.peerHost = remoteHost;
- session.sessionId = new Session.ID(serverHello.getSessionId());
- session.cipherSuite = suite;
- }
- session.params.reset();
-// session.params.setInMac(null);
-// session.params.setOutMac(null);
-// session.params.setInRandom(null);
-// session.params.setOutRandom(null);
-// session.params.setInCipher(null);
-// session.params.setOutCipher(null);
- session.currentAlert = null;
- session.valid = true;
- session.protocol = version;
-
- // If the server responded with the same session id that we sent, we
- // assume that the session will be continued, and skip the bulk of the
- // handshake.
- if (newSession)
- {
- PublicKey serverKey = null, serverKex = null;
- KeyPair clientKeys = null, clientKex = null;
- CertificateRequest certReq;
- boolean sendKeyExchange = false;
- BigInteger srp_x = null;
- IKeyAgreementParty clientKA = null;
- IncomingMessage in; // used for key agreement protocol exchange
- OutgoingMessage out = null;
-
- if (suite.getKeyExchange() == "SRP")
- {
- String password = askPassword(user);
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE,
- "SRP: password read is ''{0}''", password);
- }
- byte[] userSrpPassword = password.getBytes("UTF-8");
-
- // instantiate and setup client-side key agreement party
- clientKA = KeyAgreementFactory.getPartyAInstance(Registry.SRP_TLS_KA);
- Map clientAttributes = new HashMap();
- clientAttributes.put(SRP6KeyAgreement.HASH_FUNCTION,
- Registry.SHA160_HASH);
- clientAttributes.put(SRP6KeyAgreement.USER_IDENTITY, user);
- clientAttributes.put(SRP6KeyAgreement.USER_PASSWORD, userSrpPassword);
- try
- {
- clientKA.init(clientAttributes);
- // initiate the exchange
- out = clientKA.processMessage(null);
- }
- catch (KeyAgreementException x)
- {
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "SRP exception", x);
- }
- throwHandshakeFailure();
- }
- }
-
- if (suite.getSignature() != "anon")
- {
- msg = Handshake.read(din, certType);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- if (msg.getType() != Handshake.Type.CERTIFICATE)
- {
- throwUnexpectedMessage();
- }
- Certificate serverCertificate = (Certificate) msg.getBody();
- X509Certificate[] peerCerts = serverCertificate.getCertificates();
- try
- {
- session.trustManager.checkServerTrusted(peerCerts,
- suite.getAuthType());
- if (suite.getSignature() == "RSA" &&
- !(peerCerts[0].getPublicKey() instanceof RSAPublicKey))
- throw new InvalidKeyException("improper public key");
- if (suite.getKeyExchange() == "DH" &&
- !(peerCerts[0].getPublicKey() instanceof DHPublicKey))
- throw new InvalidKeyException("improper public key");
- if (suite.getKeyExchange() == "DHE")
- {
- if (suite.getSignature() == "RSA" &&
- !(peerCerts[0].getPublicKey() instanceof RSAPublicKey))
- throw new InvalidKeyException("improper public key");
- if (suite.getSignature() == "DSS" &&
- !(peerCerts[0].getPublicKey() instanceof DSAPublicKey))
- throw new InvalidKeyException("improper public key");
- }
- session.peerCerts = peerCerts;
- session.peerVerified = true;
- }
- catch (InvalidKeyException ike)
- {
- throwHandshakeFailure();
- }
- catch (Exception x)
- {
- if (!checkCertificates(peerCerts))
- {
- peerUnverified(peerCerts);
- SSLPeerUnverifiedException e =
- new SSLPeerUnverifiedException ("could not verify peer certificate: "+
- peerCerts[0].getSubjectDN());
- e.initCause (x);
- throw e;
- }
- session.peerCerts = peerCerts;
- session.peerVerified = true;
- }
- serverKey = peerCerts[0].getPublicKey();
- serverKex = serverKey;
- }
-
- msg = Handshake.read(din, suite, serverKey);
-
- // Receive the server's key exchange.
- if (msg.getType() == Handshake.Type.SERVER_KEY_EXCHANGE)
- {
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- ServerKeyExchange skex = (ServerKeyExchange) msg.getBody();
- serverKex = skex.getPublicKey();
- if (suite.getSignature() != "anon")
- {
- ISignature sig = null;
- if (suite.getSignature() == "RSA")
- {
- sig = new SSLRSASignature();
- }
- else if (suite.getSignature() == "DSS")
- {
- sig = SignatureFactory.getInstance(Registry.DSS_SIG);
- }
- sig.setupVerify(Collections.singletonMap(
- ISignature.VERIFIER_KEY, serverKey));
- byte[] buf = clientRandom.getEncoded();
- sig.update(buf, 0, buf.length);
- buf = serverRandom.getEncoded();
- sig.update(buf, 0, buf.length);
- if (suite.getKeyExchange() == "RSA")
- {
- updateSig(sig, ((RSAPublicKey) serverKex).getModulus());
- updateSig(sig, ((RSAPublicKey) serverKex).getPublicExponent());
- }
- else if (suite.getKeyExchange() == "DHE")
- {
- updateSig(sig, ((DHPublicKey) serverKex).getParams().getP());
- updateSig(sig, ((DHPublicKey) serverKex).getParams().getG());
- updateSig(sig, ((DHPublicKey) serverKex).getY());
- }
- else if (suite.getKeyExchange() == "SRP")
- {
- updateSig(sig, ((SRPPublicKey) serverKex).getN());
- updateSig(sig, ((SRPPublicKey) serverKex).getG());
- byte[] srpSalt = skex.getSRPSalt();
- sig.update((byte) srpSalt.length);
- sig.update(srpSalt, 0, srpSalt.length);
- updateSig(sig, ((SRPPublicKey) serverKex).getY());
- }
- if (!sig.verify(skex.getSignature().getSigValue()))
- {
- throwHandshakeFailure();
- }
- }
-
- if (suite.getKeyExchange() == "SRP")
- {
- // use server's key exchange data to continue
- // agreement protocol by faking a received incoming
- // message. again the following code can be broken
- // into multiple blocks for more accurate exception
- // handling
- try
- {
- out = new OutgoingMessage();
- out.writeMPI(((SRPPublicKey) serverKex).getN());
- out.writeMPI(((SRPPublicKey) serverKex).getG());
- out.writeMPI(new BigInteger(1, skex.getSRPSalt()));
- out.writeMPI(((SRPPublicKey) serverKex).getY());
-
- in = new IncomingMessage(out.toByteArray());
-
- out = clientKA.processMessage(in);
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "clientKA isComplete? {0}",
- Boolean.valueOf (clientKA.isComplete()));
- }
- }
- catch (KeyAgreementException x)
- {
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "SRP exception", x);
- }
- throwHandshakeFailure();
- }
- }
- msg = Handshake.read(din, suite, serverKey);
- }
-
- // See if the server wants us to send our certificates.
- certReq = null;
- if (msg.getType() == Handshake.Type.CERTIFICATE_REQUEST)
- {
- if (suite.getSignature() == "anon")
- {
- throwHandshakeFailure();
- }
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- certReq = (CertificateRequest) msg.getBody();
- msg = Handshake.read(din);
- }
-
- // Read ServerHelloDone.
- if (msg.getType() != Handshake.Type.SERVER_HELLO_DONE)
- {
- throwUnexpectedMessage();
- }
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
-
- // Send our certificate chain if the server asked for it.
- if (certReq != null)
- {
- String alias = session.keyManager.chooseClientAlias(
- certReq.getTypeStrings(), certReq.getAuthorities(), null);
- if (alias == null && version == ProtocolVersion.SSL_3)
- {
- Alert alert =
- new Alert(Alert.Level.WARNING, Alert.Description.NO_CERTIFICATE);
- sendAlert(alert);
- }
- else
- {
- X509Certificate[] chain =
- session.keyManager.getCertificateChain(alias);
- PrivateKey key = session.keyManager.getPrivateKey(alias);
- if (chain == null)
- {
- chain = new X509Certificate[0];
- }
- Certificate cert = new Certificate(chain);
- msg = new Handshake(Handshake.Type.CERTIFICATE, cert);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- msg.write(dout, version);
-// recordOutput.setHandshakeAvail(msg.write(dout, version));;
- dout.flush();
- if (chain.length > 0)
- {
- session.localCerts = chain;
- clientKeys = new KeyPair(chain[0].getPublicKey(), key);
- }
- }
- }
-
- // Send our key exchange.
- byte[] preMasterSecret = null;
- ClientKeyExchange ckex = null;
- if (suite.getKeyExchange() == "RSA")
- {
- ProtocolVersion v =
- (ProtocolVersion) session.enabledProtocols.last();
- byte[] b = new byte[46];
- session.random.nextBytes (b);
- preMasterSecret = Util.concat(v.getEncoded(), b);
- EME_PKCS1_V1_5 pkcs1 = EME_PKCS1_V1_5.getInstance((RSAPublicKey) serverKex);
- BigInteger bi = new BigInteger(1,
- pkcs1.encode(preMasterSecret, session.random));
- bi = RSA.encrypt((RSAPublicKey) serverKex, bi);
- ckex = new ClientKeyExchange(Util.trim(bi));
- }
- else if (suite.getKeyExchange().startsWith("DH"))
- {
- if (clientKeys == null ||
- !(clientKeys.getPublic() instanceof DHPublicKey))
- {
- GnuDHPrivateKey tmpKey =
- new GnuDHPrivateKey(null, ((DHPublicKey) serverKex).getParams().getP(),
- ((DHPublicKey) serverKex).getParams().getG(), null);
- clientKA = KeyAgreementFactory.getPartyBInstance(Registry.DH_KA);
- Map attr = new HashMap();
- attr.put(DiffieHellmanKeyAgreement.KA_DIFFIE_HELLMAN_OWNER_PRIVATE_KEY,
- tmpKey);
- attr.put(DiffieHellmanKeyAgreement.SOURCE_OF_RANDOMNESS,
- session.random);
- try
- {
- clientKA.init(attr);
- out = new OutgoingMessage();
- out.writeMPI(((DHPublicKey) serverKex).getY());
- in = new IncomingMessage(out.toByteArray());
- out = clientKA.processMessage(in);
- in = new IncomingMessage(out.toByteArray());
- ckex = new ClientKeyExchange(in.readMPI());
- }
- catch (KeyAgreementException kae)
- {
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "DH exception", kae);
- }
- internalError();
- RuntimeException re = new RuntimeException (kae.getMessage());
- re.initCause (kae);
- throw re;
- }
- }
- else
- {
- clientKA = KeyAgreementFactory.getPartyBInstance(Registry.ELGAMAL_KA);
- Map attr = new HashMap();
- attr.put(ElGamalKeyAgreement.KA_ELGAMAL_RECIPIENT_PRIVATE_KEY,
- clientKeys.getPrivate());
- try
- {
- // The key exchange is already complete here; our public
- // value was sent with our certificate.
- clientKA.init(attr);
- }
- catch (KeyAgreementException kae)
- {
- if (DEBUG_KEY_EXCHANGE)
- logger.log (Component.SSL_KEY_EXCHANGE, "DH exception", kae);
- internalError();
- RuntimeException re = new RuntimeException (kae.getMessage());
- re.initCause (kae);
- throw re;
- }
- ckex = new ClientKeyExchange(new byte[0]);
- }
- }
- else if (suite.getKeyExchange() == "SRP")
- {
- // at this point, out --the outgoing message-- already contains
- // what we want. so...
- BigInteger A = null;
- try
- {
- in = new IncomingMessage(out.toByteArray());
- A = in.readMPI();
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "client A:{0}", A);
- }
- }
- catch (KeyAgreementException x)
- {
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "SRP exception", x);
- }
- throwHandshakeFailure();
- }
- ckex = new ClientKeyExchange(A);
- }
- msg = new Handshake(Handshake.Type.CLIENT_KEY_EXCHANGE, ckex);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- msg.write (dout, version);
-// recordOutput.setHandshakeAvail(msg.write(dout, version));;
-
- // Generate the master secret.
- if (suite.getKeyExchange().startsWith("DH"))
- {
- try
- {
- preMasterSecret = clientKA.getSharedSecret();
- }
- catch (KeyAgreementException kae)
- {
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "DH exception", kae);
- }
- internalError();
- RuntimeException re = new RuntimeException (kae.getMessage());
- re.initCause (kae);
- throw re;
- }
- }
- else if (suite.getKeyExchange() == "SRP")
- {
- try
- {
- preMasterSecret = clientKA.getSharedSecret();
- }
- catch (KeyAgreementException x)
- {
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "SRP exception", x);
- }
- throwHandshakeFailure();
- }
- finally
- {
- clientKA = null;
- }
- }
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "preMasterSecret:\n{0}",
- Util.toHexString (preMasterSecret, ':'));
- logger.log (Component.SSL_KEY_EXCHANGE, "client.random:\n{0}",
- Util.toHexString(clientRandom.getEncoded(), ':'));
- logger.log (Component.SSL_KEY_EXCHANGE, "server.random:\n{0}",
- Util.toHexString(serverRandom.getEncoded(), ':'));
- }
- IRandom genSecret = null;
- if (version == ProtocolVersion.SSL_3)
- {
- genSecret = new SSLRandom();
- HashMap attr = new HashMap();
- attr.put(SSLRandom.SECRET, preMasterSecret);
- attr.put(SSLRandom.SEED,
- Util.concat(clientRandom.getEncoded(), serverRandom.getEncoded()));
- genSecret.init(attr);
- }
- else
- {
- genSecret = new TLSRandom();
- HashMap attr = new HashMap();
- attr.put(TLSRandom.SECRET, preMasterSecret);
- attr.put(TLSRandom.SEED,
- Util.concat(("master secret").getBytes("UTF-8"),
- Util.concat(clientRandom.getEncoded(), serverRandom.getEncoded())));
- genSecret.init(attr);
- }
- session.masterSecret = new byte[48];
- try
- {
- genSecret.nextBytes(session.masterSecret, 0, 48);
- for (int i = 0; i < preMasterSecret.length; i++)
- {
- preMasterSecret[i] = 0;
- }
- }
- catch (LimitReachedException shouldNotHappen)
- {
- internalError();
- RuntimeException re = new RuntimeException (shouldNotHappen.getMessage());
- re.initCause (shouldNotHappen);
- throw re;
- }
-
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "masterSecret: {0}",
- Util.toHexString(session.masterSecret, ':'));
- }
-
- // Send our certificate verify message.
- if (certReq != null && clientKeys != null)
- {
- IMessageDigest vMD5 = (IMessageDigest) md5.clone();
- IMessageDigest vSHA = (IMessageDigest) sha.clone();
- PrivateKey key = clientKeys.getPrivate();
- Object sig = null;
- String sigAlg = null;
- try
- {
- if (key instanceof DSAPrivateKey)
- {
- sig = DSSSignature.sign((DSAPrivateKey) key, vSHA.digest(),
- session.random);
- sigAlg = "DSS";
- }
- else if (key instanceof RSAPrivateKey)
- {
- SSLRSASignature rsa = new SSLRSASignature(vMD5, vSHA);
- rsa.setupSign(Collections.singletonMap(ISignature.SIGNER_KEY, key));
- sig = rsa.sign();
- sigAlg = "RSA";
- }
- else
- {
- throw new InvalidKeyException("no appropriate key");
- }
- }
- catch (Exception x)
- {
- throwHandshakeFailure();
- }
- CertificateVerify verify = new CertificateVerify(sig, sigAlg);
- msg = new Handshake(Handshake.Type.CERTIFICATE_VERIFY, verify);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- msg.write(dout, version);
-// recordOutput.setHandshakeAvail(msg.write(dout, version));;
- }
- dout.flush();
- }
-
- byte[][] keys = null;
- try
- {
- keys = generateKeys(serverRandom.getEncoded(),
- clientRandom.getEncoded(), version);
- }
- catch (Exception x)
- {
- internalError();
- RuntimeException re = new RuntimeException (x.getMessage());
- re.initCause (x);
- throw re;
- }
-
- session.params.setVersion (version);
-
- // Initialize the algorithms with the derived keys.
- Object readMac = null, writeMac = null;
- Object readCipher = null, writeCipher = null;
- try
- {
- if (session.params instanceof GNUSecurityParameters)
- {
- HashMap attr = new HashMap();
- writeMac = CipherSuite.getMac(suite.getMac());
- readMac = CipherSuite.getMac(suite.getMac());
- attr.put(IMac.MAC_KEY_MATERIAL, keys[0]);
- ((IMac) writeMac).init(attr);
- attr.put(IMac.MAC_KEY_MATERIAL, keys[1]);
- ((IMac) readMac).init(attr);
- if (suite.getCipher() == "RC4")
- {
- writeCipher = new ARCFour();
- readCipher = new ARCFour();
- attr.clear();
- attr.put(ARCFour.ARCFOUR_KEY_MATERIAL, keys[2]);
- ((ARCFour) writeCipher).init(attr);
- attr.put(ARCFour.ARCFOUR_KEY_MATERIAL, keys[3]);
- ((ARCFour) readCipher).init(attr);
- }
- else if (!suite.isStreamCipher())
- {
- writeCipher = CipherSuite.getCipher(suite.getCipher());
- readCipher = CipherSuite.getCipher(suite.getCipher());
- attr.clear();
- attr.put(IMode.KEY_MATERIAL, keys[2]);
- attr.put(IMode.IV, keys[4]);
- attr.put(IMode.STATE, new Integer(IMode.ENCRYPTION));
- ((IMode) writeCipher).init(attr);
- attr.put(IMode.KEY_MATERIAL, keys[3]);
- attr.put(IMode.IV, keys[5]);
- attr.put(IMode.STATE, new Integer(IMode.DECRYPTION));
- ((IMode) readCipher).init(attr);
- }
- }
- else // JCESecurityParameters
- {
- writeMac = CipherSuite.getJCEMac (suite.getMac());
- readMac = CipherSuite.getJCEMac (suite.getMac());
- writeCipher = CipherSuite.getJCECipher (suite.getCipher());
- readCipher = CipherSuite.getJCECipher (suite.getCipher());
- ((Mac) writeMac).init (new SecretKeySpec (keys[0], suite.getMac()));
- ((Mac) readMac).init (new SecretKeySpec (keys[1], suite.getMac()));
- if (!suite.isStreamCipher())
- {
- ((Cipher) writeCipher).init (Cipher.ENCRYPT_MODE,
- new SecretKeySpec (keys[2], suite.getCipher()),
- new IvParameterSpec (keys[4]));
- ((Cipher) readCipher).init (Cipher.DECRYPT_MODE,
- new SecretKeySpec (keys[3], suite.getCipher()),
- new IvParameterSpec (keys[5]));
- }
- else
- {
- ((Cipher) writeCipher).init (Cipher.ENCRYPT_MODE,
- new SecretKeySpec (keys[2], suite.getCipher()));
- ((Cipher) readCipher).init (Cipher.DECRYPT_MODE,
- new SecretKeySpec (keys[3], suite.getCipher()));
- }
- }
- }
- // These should technically never happen, if our key generation is not
- // broken.
- catch (InvalidKeyException ike)
- {
- internalError();
- RuntimeException re = new RuntimeException (ike.getMessage());
- re.initCause(ike);
- throw re;
- }
- catch (InvalidAlgorithmParameterException iape)
- {
- internalError();
- RuntimeException re = new RuntimeException (iape.getMessage());
- re.initCause (iape);
- throw re;
- }
- // These indicate a configuration error with the JCA.
- catch (NoSuchAlgorithmException nsae)
- {
- session.enabledSuites.remove (suite);
- internalError();
- SSLException x = new SSLException ("suite " + suite + " not available in this configuration");
- x.initCause (nsae);
- throw x;
- }
- catch (NoSuchPaddingException nspe)
- {
- session.enabledSuites.remove (suite);
- internalError();
- SSLException x = new SSLException ("suite " + suite + " not available in this configuration");
- x.initCause (nspe);
- throw x;
- }
-
- Finished finis = null;
-
- if (newSession)
- {
- changeCipherSpec();
- session.params.setDeflating(serverHello.getCompressionMethod() == CompressionMethod.ZLIB);
- session.params.setOutMac(writeMac);
- session.params.setOutCipher(writeCipher);
- finis = generateFinished(version, (IMessageDigest) md5.clone(),
- (IMessageDigest) sha.clone(), true);
- msg = new Handshake(Handshake.Type.FINISHED, finis);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- msg.write(dout, version);
- dout.flush();
- }
-
- if (session.currentAlert != null &&
- session.currentAlert.getLevel() == Alert.Level.FATAL)
- {
- fatal();
- throw new AlertException(session.currentAlert, false);
- }
-
- synchronized (session.params)
- {
- readChangeCipherSpec ();
- session.params.setInflating(serverHello.getCompressionMethod() == CompressionMethod.ZLIB);
- session.params.setInMac(readMac);
- session.params.setInCipher(readCipher);
- session.params.notifyAll();
- }
-
- Finished verify = generateFinished(version, (IMessageDigest) md5.clone(),
- (IMessageDigest) sha.clone(), false);
-
- msg = Handshake.read(din, suite, null);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- if (msg.getType() != Handshake.Type.FINISHED)
- {
- throwUnexpectedMessage();
- }
- finis = (Finished) msg.getBody();
- if (version == ProtocolVersion.SSL_3)
- {
- if (!Arrays.equals(finis.getMD5Hash(), verify.getMD5Hash()) ||
- !Arrays.equals(finis.getSHAHash(), verify.getSHAHash()))
- {
- throwHandshakeFailure();
- }
- }
- else
- {
- if (!Arrays.equals(finis.getVerifyData(), verify.getVerifyData()))
- {
- throwHandshakeFailure();
- }
- }
-
- if (!newSession)
- {
- changeCipherSpec();
- session.params.setDeflating(serverHello.getCompressionMethod() == CompressionMethod.ZLIB);
- session.params.setOutMac(writeMac);
- session.params.setOutCipher(writeCipher);
- finis = generateFinished(version, md5, sha, true);
- msg = new Handshake(Handshake.Type.FINISHED, finis);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- msg.write(dout, version);
- dout.flush();
- }
-
- handshakeCompleted();
- }
-
- /**
- * Perform the server handshake.
- */
- private void doServerHandshake() throws IOException
- {
- if (DEBUG_HANDSHAKE_LAYER)
- {
- logger.log (Component.SSL_HANDSHAKE, "doing server handshake in {0}",
- Thread.currentThread());
- }
-
- if (remoteHost == null)
- {
- remoteHost = getInetAddress().getHostName();
- }
- if (remoteHost == null)
- {
- remoteHost = getInetAddress().getHostAddress();
- }
-
- IMessageDigest md5 = HashFactory.getInstance(Registry.MD5_HASH);
- IMessageDigest sha = HashFactory.getInstance(Registry.SHA160_HASH);
- DigestInputStream din = new DigestInputStream(handshakeIn, md5, sha);
- DigestOutputStream dout = new DigestOutputStream(handshakeOut, md5, sha);
-
- // Read the client hello.
- Handshake msg = Handshake.read(din);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- if (msg.getType() != Handshake.Type.CLIENT_HELLO)
- {
- throwUnexpectedMessage();
- }
- ClientHello clientHello = (ClientHello) msg.getBody();
- Random clientRandom = clientHello.getRandom();
- ProtocolVersion version = clientHello.getVersion();
- ProtocolVersion server =
- (ProtocolVersion) session.enabledProtocols.last();
- CompressionMethod comp;
- if (clientHello.getCompressionMethods().contains(CompressionMethod.ZLIB))
- comp = CompressionMethod.ZLIB;
- else
- comp = CompressionMethod.NULL;
- if (!session.enabledProtocols.contains(version)
- && version.compareTo(server) < 0)
- {
- Alert alert = new Alert(Alert.Level.FATAL,
- Alert.Description.PROTOCOL_VERSION);
- sendAlert(alert);
- session.currentAlert = alert;
- throw new AlertException(alert, true);
- }
-
- // Look through the extensions sent by the client (if any), and react to
- // them appropriately.
- List extensions = null;
- String remoteUser = null;
- if (clientHello.getExtensions() != null)
- {
- for (Iterator it = clientHello.getExtensions().iterator(); it.hasNext();)
- {
- Extension ex = (Extension) it.next();
- if (ex.getType() == Extension.Type.SERVER_NAME)
- {
- if (extensions == null)
- {
- extensions = new LinkedList();
- }
- extensions.add(ex);
- }
- else if (ex.getType() == Extension.Type.MAX_FRAGMENT_LENGTH)
- {
- int maxLen = Extensions.getMaxFragmentLength(ex).intValue();
-// recordInput.setFragmentLength(maxLen);
-// recordOutput.setFragmentLength(maxLen);
- session.params.setFragmentLength(maxLen);
- if (extensions == null)
- {
- extensions = new LinkedList();
- }
- extensions.add(ex);
- }
- else if (ex.getType() == Extension.Type.SRP)
- {
- if (extensions == null)
- {
- extensions = new LinkedList();
- }
- byte[] b = ex.getValue();
- remoteUser = new String(ex.getValue(), 1, b[0] & 0xFF, "UTF-8");
- session.putValue("srp-username", remoteUser);
- }
- }
- }
-
- CipherSuite suite = selectSuite(clientHello.getCipherSuites(), version);
- if (suite == null)
- {
- return;
- }
-
- // If the selected suite turns out to be SRP, set up the key exchange
- // objects.
- IKeyAgreementParty serverKA = null;
- IncomingMessage in;
- OutgoingMessage out = null;
- if (suite.getKeyExchange() == "SRP")
- {
- // FIXME
- // Uhm, I don't think this can happen, because if remoteUser is null
- // we cannot choose an SRP ciphersuite...
- if (remoteUser == null)
- {
- Alert alert = new Alert(Alert.Level.FATAL,
- Alert.Description.MISSING_SRP_USERNAME);
- sendAlert(alert);
- throw new AlertException(alert, true);
- }
-
- SRPAuthInfoProvider srpDB = new SRPAuthInfoProvider();
- Map dbAttributes = new HashMap();
- dbAttributes.put(SRPRegistry.PASSWORD_DB,
- session.srpTrustManager.getPasswordFile());
- srpDB.activate(dbAttributes);
-
- // FIXME
- // We can also fake that the user exists, and generate a dummy (and
- // invalid) master secret, and let the handshake fail at the Finished
- // message. This is better than letting the connecting side know that
- // the username they sent isn't valid.
- //
- // But how to implement this?
- if (!srpDB.contains(remoteUser))
- {
- Alert alert = new Alert(Alert.Level.FATAL,
- Alert.Description.UNKNOWN_SRP_USERNAME);
- sendAlert(alert);
- throw new AlertException(alert, true);
- }
-
- serverKA = KeyAgreementFactory.getPartyBInstance(Registry.SRP_TLS_KA);
- Map serverAttributes = new HashMap();
- serverAttributes.put(SRP6KeyAgreement.HASH_FUNCTION,
- Registry.SHA160_HASH);
- serverAttributes.put(SRP6KeyAgreement.HOST_PASSWORD_DB, srpDB);
-
- try
- {
- serverKA.init(serverAttributes);
- out = new OutgoingMessage();
- out.writeString(remoteUser);
- in = new IncomingMessage(out.toByteArray());
- out = serverKA.processMessage(in);
- }
- catch (KeyAgreementException x)
- {
- throwHandshakeFailure();
- }
- }
-
- // Check if the session specified by the client's ID corresponds
- // to a saved session, and if so, continue it.
- boolean newSession = true;
- if (DEBUG_HANDSHAKE_LAYER)
- {
- logger.log (Component.SSL_HANDSHAKE, "saved sessions: {0}", sessionContext);
- }
- if (sessionContext.containsSessionID(
- new Session.ID(clientHello.getSessionId())))
- {
- Session old = session;
- session = (Session) sessionContext.getSession(clientHello.getSessionId());
- if (!clientHello.getCipherSuites().contains(session.cipherSuite))
- {
- throwHandshakeFailure();
- }
- if (session.getPeerHost().equals(remoteHost) &&
- old.enabledProtocols.contains(session.protocol))
- {
- session = (Session) session.clone();
- suite = session.cipherSuite;
- newSession = false;
- recordInput.setSession(session);
- session.currentAlert = null;
- session.params = old.params;
- session.random = old.random;
- }
- else
- {
- if (DEBUG_HANDSHAKE_LAYER)
- {
- logger.log (Component.SSL_HANDSHAKE, "rejected section; hosts equal? {0}, same suites? {1}",
- new Object[] { Boolean.valueOf (session.getPeerHost().equals(remoteHost)),
- Boolean.valueOf (old.enabledProtocols.contains(session.protocol)) });
- }
- session = old;
- session.peerHost = remoteHost;
- newSession = true;
- }
- }
- else if (DEBUG_HANDSHAKE_LAYER)
- {
- logger.log (Component.SSL_HANDSHAKE, "rejected session; have session id? {0}, saved sessions: {1}",
- new Object[] { Boolean.valueOf (sessionContext.containsSessionID(new Session.ID(clientHello.getSessionId()))),
- sessionContext });
- }
- if (newSession)
- {
- byte[] buf = new byte[32];
- Session.ID sid = null;
- do
- {
- session.random.nextBytes(buf);
- sid = new Session.ID(buf);
- }
- while (sessionContext.containsSessionID(sid));
- session.sessionId = sid;
- }
- session.valid = true;
- session.peerHost = remoteHost;
- session.cipherSuite = suite;
- session.protocol = version;
- session.params.setVersion (version);
-
- // Send the server hello.
- Random serverRandom = new Random(Util.unixTime(),
- session.random.generateSeed(28));
- ServerHello serverHello = new ServerHello(version, serverRandom,
- session.getId(), suite,
- comp, extensions);
- msg = new Handshake(Handshake.Type.SERVER_HELLO, serverHello);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- msg.write(dout, version);
-// recordOutput.setHandshakeAvail(msg.write(dout, version));
- dout.flush();
-
- if (newSession)
- {
- X509Certificate[] certs = null;
- PrivateKey serverKey = null;
- if (suite.getSignature() != "anon")
- {
- // Send our CA-issued certificate to the client.
- String alias = session.keyManager.chooseServerAlias(suite.getAuthType(),
- null, null);
- certs = session.keyManager.getCertificateChain(alias);
- serverKey = session.keyManager.getPrivateKey(alias);
- if (certs == null || serverKey == null)
- {
- throwHandshakeFailure();
- }
- session.localCerts = certs;
- Certificate serverCert = new Certificate(certs);
- msg = new Handshake(Handshake.Type.CERTIFICATE, serverCert);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- msg.write(dout, version);
-// recordOutput.setHandshakeAvail(msg.write(dout, version));;
- dout.flush();
- }
-
- // If the certificate we sent does not contain enough information to
- // do the key exchange (in the case of ephemeral Diffie-Hellman,
- // export RSA, and SRP) we send a signed public key to be used for the
- // key exchange.
- KeyPair signPair = null;
- if (certs != null)
- {
- signPair = new KeyPair(certs[0].getPublicKey(), serverKey);
- }
- KeyPair kexPair = signPair;
- ServerKeyExchange skex = null;
-
- // Set up our key exchange, and/or prepare our ServerKeyExchange
- // message.
- if ((suite.getKeyExchange() == "RSA" && suite.isExportable() &&
- ((RSAPrivateKey) serverKey).getModulus().bitLength() > 512))
- {
- kexPair = KeyPool.generateRSAKeyPair();
- RSAPublicKey pubkey = (RSAPublicKey) kexPair.getPublic();
- Signature s = null;
- if (suite.getSignature() != "anon")
- {
- SSLRSASignature sig = new SSLRSASignature();
- sig.setupSign(Collections.singletonMap(ISignature.SIGNER_KEY,
- signPair.getPrivate()));
- byte[] buf = clientRandom.getEncoded();
- sig.update(buf, 0, buf.length);
- buf = serverRandom.getEncoded();
- sig.update(buf, 0, buf.length);
- updateSig(sig, pubkey.getModulus());
- updateSig(sig, pubkey.getPublicExponent());
- s = new Signature(sig.sign(), "RSA");
- }
- skex = new ServerKeyExchange(pubkey, s);
- }
- else if (suite.getKeyExchange() == "DH")
- {
- serverKA = KeyAgreementFactory.getPartyBInstance(Registry.ELGAMAL_KA);
- Map attr = new HashMap();
- attr.put(ElGamalKeyAgreement.KA_ELGAMAL_RECIPIENT_PRIVATE_KEY,
- serverKey);
- try
- {
- serverKA.init(attr);
- }
- catch (KeyAgreementException kae)
- {
- if (DEBUG_KEY_EXCHANGE)
- logger.log (Component.SSL_KEY_EXCHANGE, "DH exception", kae);
- internalError();
- RuntimeException re = new RuntimeException (kae.getMessage());
- re.initCause (kae);
- throw re;
- }
- // We don't send a ServerKeyExchange for this suite.
- }
- else if (suite.getKeyExchange() == "DHE")
- {
- serverKA = KeyAgreementFactory.getPartyAInstance(Registry.DH_KA);
- Map attr = new HashMap();
- GnuDHPrivateKey servParams = DiffieHellman.getParams();
- attr.put(DiffieHellmanKeyAgreement.KA_DIFFIE_HELLMAN_OWNER_PRIVATE_KEY,
- servParams);
- attr.put(DiffieHellmanKeyAgreement.SOURCE_OF_RANDOMNESS,
- session.random);
- BigInteger serv_y = null;
- try
- {
- serverKA.init(attr);
- out = serverKA.processMessage(null);
- in = new IncomingMessage(out.toByteArray());
- serv_y = in.readMPI();
- }
- catch (KeyAgreementException kae)
- {
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "DHE exception", kae);
- }
- internalError();
- RuntimeException re = new RuntimeException (kae.getMessage());
- re.initCause (kae);
- throw re;
- }
- GnuDHPublicKey pubkey =
- new GnuDHPublicKey(null, servParams.getParams().getP(),
- servParams.getParams().getG(), serv_y);
- Signature s = null;
- if (suite.getSignature() != "anon")
- {
- ISignature sig = null;
- if (suite.getSignature() == "RSA")
- {
- sig = new SSLRSASignature();
- }
- else
- {
- sig = SignatureFactory.getInstance(Registry.DSS_SIG);
- }
- sig.setupSign(Collections.singletonMap(ISignature.SIGNER_KEY,
- signPair.getPrivate()));
- byte[] buf = clientRandom.getEncoded();
- sig.update(buf, 0, buf.length);
- buf = serverRandom.getEncoded();
- sig.update(buf, 0, buf.length);
- updateSig(sig, pubkey.getParams().getP());
- updateSig(sig, pubkey.getParams().getG());
- updateSig(sig, pubkey.getY());
- s = new Signature(sig.sign(), suite.getSignature());
- }
- skex = new ServerKeyExchange(pubkey, s);
- }
- else if (suite.getKeyExchange() == "SRP")
- {
- BigInteger N = null;
- BigInteger g = null;
- BigInteger salt = null;
- BigInteger B = null;
- try
- {
- in = new IncomingMessage(out.toByteArray());
- N = in.readMPI();
- g = in.readMPI();
- salt = in.readMPI();
- B = in.readMPI();
- }
- catch (KeyAgreementException x)
- {
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "SRP exception", x);
- }
- throwHandshakeFailure();
- }
- Signature s = null;
- final byte[] srpSalt = Util.trim(salt);
- if (suite.getSignature() != "anon")
- {
- ISignature sig = null;
- if (suite.getSignature() == "RSA")
- {
- sig = new SSLRSASignature();
- }
- else
- {
- sig = SignatureFactory.getInstance(Registry.DSS_SIG);
- }
- sig.setupSign(Collections.singletonMap(ISignature.SIGNER_KEY,
- signPair.getPrivate()));
- byte[] buf = clientRandom.getEncoded();
- sig.update(buf, 0, buf.length);
- buf = serverRandom.getEncoded();
- sig.update(buf, 0, buf.length);
- updateSig(sig, N);
- updateSig(sig, g);
- sig.update((byte) srpSalt.length);
- sig.update(srpSalt, 0, srpSalt.length);
- updateSig(sig, B);
- s = new Signature(sig.sign(), suite.getSignature());
- }
- final SRPPublicKey pubkey = new SRPPublicKey(N, g, B);
- skex = new ServerKeyExchange(pubkey, s, srpSalt);
- }
- if (skex != null)
- {
- msg = new Handshake(Handshake.Type.SERVER_KEY_EXCHANGE, skex);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- msg.write(dout, version);
-// recordOutput.setHandshakeAvail(msg.write(dout, version));;
- dout.flush();
- }
-
- // If we are configured to want or need client authentication, then
- // ask for it.
- if (wantClientAuth || needClientAuth)
- {
- Principal[] auths = null;
- CertificateRequest.ClientType[] types =
- new CertificateRequest.ClientType[] {
- CertificateRequest.ClientType.RSA_SIGN,
- CertificateRequest.ClientType.DSS_SIGN,
- CertificateRequest.ClientType.RSA_FIXED_DH,
- CertificateRequest.ClientType.DSS_FIXED_DH
- };
- try
- {
- auths = (Principal[])
- Util.transform(session.trustManager.getAcceptedIssuers(),
- Principal.class, "getSubjectDN", null);
- }
- catch (Exception x)
- {
- internalError();
- RuntimeException re = new RuntimeException (x.getMessage());
- re.initCause (x);
- throw re;
- }
- CertificateRequest req = new CertificateRequest(types, auths);
- msg = new Handshake(Handshake.Type.CERTIFICATE_REQUEST, req);
- msg.write(dout, version);
- dout.flush();
- }
-
- // Send our server hello done.
- msg = new Handshake(Handshake.Type.SERVER_HELLO_DONE, null);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- msg.write(dout, version);
- dout.flush();
-
- if (suite.getKeyExchange() == "RSA")
- {
- msg = Handshake.read(din, suite, kexPair.getPublic());
- }
- else
- {
- msg = Handshake.read(din, suite, null);
- }
- boolean clientCertOk = false;
- boolean clientCanSign = false;
- X509Certificate[] clientChain = null;
- PublicKey clientKey = null;
-
- // Read the client's certificate, if sent.
- if (msg.getType() == Handshake.Type.CERTIFICATE)
- {
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- Certificate cliCert = (Certificate) msg.getBody();
- clientChain = cliCert.getCertificates();
- try
- {
- session.trustManager.checkClientTrusted(clientChain,
- suite.getAuthType());
- session.peerCerts = clientChain;
- session.peerVerified = true;
- clientKey = clientChain[0].getPublicKey();
- }
- catch (Exception x)
- {
- }
- clientCanSign = ((clientKey instanceof DSAPublicKey) ||
- (clientKey instanceof RSAPublicKey));
- if (suite.getKeyExchange().startsWith("DH"))
- {
- msg = Handshake.read(din, suite, clientKey);
- }
- else
- {
- msg = Handshake.read(din, suite, kexPair.getPublic());
- }
- }
-
- // If we require client authentication, and the client sent an
- // unverifiable certificate or no certificate at all, drop the
- // connection.
- if (!session.peerVerified && needClientAuth)
- {
- throwHandshakeFailure();
- }
-
- // Read the client key exchange.
- if (msg.getType() != Handshake.Type.CLIENT_KEY_EXCHANGE)
- {
- throwUnexpectedMessage();
- }
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- ClientKeyExchange ckex = (ClientKeyExchange) msg.getBody();
- byte[] preMasterSecret = null;
- if (suite.getKeyExchange() == "RSA")
- {
- byte[] enc = (byte[]) ckex.getExchangeObject();
- BigInteger bi = new BigInteger(1, enc);
- try
- {
- bi = RSA.decrypt(kexPair.getPrivate(), bi);
- EME_PKCS1_V1_5 pkcs1 = EME_PKCS1_V1_5.getInstance(
- (RSAPrivateKey) kexPair.getPrivate());
- preMasterSecret = pkcs1.decode(Util.concat(new byte[1], bi.toByteArray()));
- //rsa.init(kexPair);
- //preMasterSecret = rsa.decrypt(enc);
- }
- catch (Exception x)
- {
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "RSA exception", x);
- }
- // Generate a fake pre-master secret if the RSA decryption
- // fails.
- byte[] b = new byte[46];
- session.random.nextBytes (b);
- preMasterSecret = Util.concat(version.getEncoded(), b);
- }
- }
- else if (suite.getKeyExchange().startsWith("DH"))
- {
- try
- {
- out = new OutgoingMessage();
- if (clientKey == null)
- out.writeMPI((BigInteger) ckex.getExchangeObject());
- else
- out.writeMPI(((DHPublicKey) clientKey).getY());
- in = new IncomingMessage(out.toByteArray());
- serverKA.processMessage(in);
- preMasterSecret = serverKA.getSharedSecret();
- }
- catch (KeyAgreementException kae)
- {
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "DH exception", kae);
- }
- internalError();
- RuntimeException re = new RuntimeException (kae.getMessage());
- re.initCause (kae);
- throw re;
- }
- }
- else if (suite.getKeyExchange() == "SRP")
- {
- BigInteger A = (BigInteger) ckex.getExchangeObject();
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "SRP: client A: {0}", A);
- }
- try
- {
- out = new OutgoingMessage();
- out.writeMPI(A);
- in = new IncomingMessage(out.toByteArray());
- out = serverKA.processMessage(in);
- preMasterSecret = serverKA.getSharedSecret();
- }
- catch (KeyAgreementException x)
- {
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "SRP exception", x);
- }
- throwHandshakeFailure();
- }
- finally
- {
- serverKA = null;
- }
- }
-
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "preMasterSecret:\n{0}",
- Util.toHexString(preMasterSecret, ':'));
- logger.log (Component.SSL_KEY_EXCHANGE, "client.random:\n{0}",
- Util.toHexString(clientRandom.getEncoded(), ':'));
- logger.log (Component.SSL_KEY_EXCHANGE, "server.random:\n{0}",
- Util.toHexString(serverRandom.getEncoded(), ':'));
- }
-
- // Generate the master secret.
- IRandom genSecret = null;
- if (version == ProtocolVersion.SSL_3)
- {
- genSecret = new SSLRandom();
- HashMap attr = new HashMap();
- attr.put(SSLRandom.SECRET, preMasterSecret);
- attr.put(SSLRandom.SEED, Util.concat(clientRandom.getEncoded(),
- serverRandom.getEncoded()));
- genSecret.init(attr);
- }
- else
- {
- genSecret = new TLSRandom();
- HashMap attr = new HashMap();
- attr.put(TLSRandom.SECRET, preMasterSecret);
- attr.put(TLSRandom.SEED,
- Util.concat(("master secret").getBytes("UTF-8"),
- Util.concat(clientRandom.getEncoded(),
- serverRandom.getEncoded())));
- genSecret.init(attr);
- }
- session.masterSecret = new byte[48];
- try
- {
- genSecret.nextBytes(session.masterSecret, 0, 48);
- for (int i = 0; i < preMasterSecret.length; i++)
- {
- preMasterSecret[i] = 0;
- }
- }
- catch (LimitReachedException shouldNotHappen)
- {
- internalError();
- RuntimeException re = new RuntimeException();
- re.initCause (shouldNotHappen);
- throw re;
- }
-
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "masterSecret: {0}",
- Util.toHexString(session.masterSecret, ':'));
- }
-
- // Read the client's certificate verify message, if needed.
- if (clientCanSign && (wantClientAuth || needClientAuth))
- {
- msg = Handshake.read(din);
- if (msg.getType() != Handshake.Type.CERTIFICATE_VERIFY)
- {
- throwUnexpectedMessage();
- }
- CertificateVerify verify = (CertificateVerify) msg.getBody();
- if (clientChain != null && clientChain.length > 0)
- {
- IMessageDigest cvMD5 = (IMessageDigest) md5.clone();
- IMessageDigest cvSHA = (IMessageDigest) sha.clone();
- clientKey = clientChain[0].getPublicKey();
- if (clientKey instanceof RSAPublicKey)
- {
- SSLRSASignature sig = new SSLRSASignature(cvMD5, cvSHA);
- sig.setupVerify(Collections.singletonMap(ISignature.VERIFIER_KEY, clientKey));
- if (!sig.verify(verify.getSigValue()))
- {
- handshakeFailure();
- throw new SSLHandshakeException("client certificate verify failed");
- }
- }
- else if (clientKey instanceof DSAPublicKey)
- {
- try
- {
- if (!DSSSignature.verify((DSAPublicKey) clientKey, cvSHA.digest(),
- (BigInteger[]) verify.getSigValue()))
- {
- throw new Exception("client's certificate could not be verified");
- }
- }
- catch (Exception x)
- {
- handshakeFailure();
- SSLHandshakeException e = new SSLHandshakeException (x.getMessage());
- e.initCause (x);
- throw e;
- }
- }
- }
- }
- }
-
- // Generate the session keys.
- byte[][] keys = null;
- try
- {
- keys = generateKeys(serverRandom.getEncoded(),
- clientRandom.getEncoded(), version);
- }
- catch (Exception x)
- {
- internalError();
- RuntimeException re = new RuntimeException (x.getMessage());
- re.initCause (x);
- throw re;
- }
-
- // Initialize the algorithms with the derived keys.
- Object readMac = null, writeMac = null;
- Object readCipher = null, writeCipher = null;
- try
- {
- if (session.params instanceof GNUSecurityParameters)
- {
- HashMap attr = new HashMap();
- writeMac = CipherSuite.getMac(suite.getMac());
- readMac = CipherSuite.getMac(suite.getMac());
- attr.put(IMac.MAC_KEY_MATERIAL, keys[1]);
- ((IMac) writeMac).init(attr);
- attr.put(IMac.MAC_KEY_MATERIAL, keys[0]);
- ((IMac) readMac).init(attr);
- if (suite.getCipher() == "RC4")
- {
- writeCipher = new ARCFour();
- readCipher = new ARCFour();
- attr.clear();
- attr.put(ARCFour.ARCFOUR_KEY_MATERIAL, keys[3]);
- ((ARCFour) writeCipher).init(attr);
- attr.put(ARCFour.ARCFOUR_KEY_MATERIAL, keys[2]);
- ((ARCFour) readCipher).init(attr);
- }
- else if (!suite.isStreamCipher())
- {
- writeCipher = CipherSuite.getCipher(suite.getCipher());
- readCipher = CipherSuite.getCipher(suite.getCipher());
- attr.clear();
- attr.put(IMode.KEY_MATERIAL, keys[3]);
- attr.put(IMode.IV, keys[5]);
- attr.put(IMode.STATE, new Integer(IMode.ENCRYPTION));
- ((IMode) writeCipher).init(attr);
- attr.put(IMode.KEY_MATERIAL, keys[2]);
- attr.put(IMode.IV, keys[4]);
- attr.put(IMode.STATE, new Integer(IMode.DECRYPTION));
- ((IMode) readCipher).init(attr);
- }
- }
- else // JCESecurityParameters
- {
- writeMac = CipherSuite.getJCEMac (suite.getMac());
- readMac = CipherSuite.getJCEMac (suite.getMac());
- writeCipher = CipherSuite.getJCECipher (suite.getCipher());
- readCipher = CipherSuite.getJCECipher (suite.getCipher());
- ((Mac) writeMac).init (new SecretKeySpec (keys[1], suite.getMac()));
- ((Mac) readMac).init (new SecretKeySpec (keys[0], suite.getMac()));
- if (!suite.isStreamCipher())
- {
- ((Cipher) writeCipher).init (Cipher.ENCRYPT_MODE,
- new SecretKeySpec (keys[3], suite.getCipher()),
- new IvParameterSpec (keys[5]));
- ((Cipher) readCipher).init (Cipher.DECRYPT_MODE,
- new SecretKeySpec (keys[2], suite.getCipher()),
- new IvParameterSpec (keys[4]));
- }
- else
- {
- ((Cipher) writeCipher).init (Cipher.ENCRYPT_MODE,
- new SecretKeySpec (keys[3], suite.getCipher()));
- ((Cipher) readCipher).init (Cipher.DECRYPT_MODE,
- new SecretKeySpec (keys[2], suite.getCipher()));
- }
- }
- }
- // These should technically never happen, if our key generation is not
- // broken.
- catch (InvalidKeyException ike)
- {
- internalError();
- RuntimeException re = new RuntimeException (ike.getMessage());
- re.initCause (ike);
- throw new RuntimeException (String.valueOf (ike));
- }
- catch (InvalidAlgorithmParameterException iape)
- {
- internalError();
- RuntimeException re = new RuntimeException (iape.getMessage());
- re.initCause (iape);
- throw re;
- }
- // These indicate a configuration error with the JCA.
- catch (NoSuchAlgorithmException nsae)
- {
- session.enabledSuites.remove (suite);
- internalError();
- SSLException e = new SSLException ("suite " + suite + " not available in this configuration");
- e.initCause (nsae);
- throw e;
- }
- catch (NoSuchPaddingException nspe)
- {
- session.enabledSuites.remove (suite);
- internalError();
- SSLException e = new SSLException ("suite " + suite + " not available in this configuration");
- e.initCause (nspe);
- throw e;
- }
-
- Finished finis = null;
- // If we are continuing a session, we send our Finished message first.
- if (!newSession)
- {
- changeCipherSpec();
- session.params.setDeflating(comp == CompressionMethod.ZLIB);
- session.params.setOutMac(writeMac);
- session.params.setOutCipher(writeCipher);
- finis = generateFinished(version, (IMessageDigest) md5.clone(),
- (IMessageDigest) sha.clone(), false);
- msg = new Handshake(Handshake.Type.FINISHED, finis);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- msg.write(dout, version);
- dout.flush();
- }
-
- if (session.currentAlert != null &&
- session.currentAlert.getLevel() == Alert.Level.FATAL)
- {
- fatal();
- throw new AlertException(session.currentAlert, false);
- }
-
- // Wait until we receive a ChangeCipherSpec, then change the crypto
- // algorithms for the incoming side.
- synchronized (session.params)
- {
- readChangeCipherSpec ();
- session.params.setInflating(comp == CompressionMethod.ZLIB);
- session.params.setInMac(readMac);
- session.params.setInCipher(readCipher);
- session.params.notifyAll();
- }
-
- // Receive and verify the client's finished message.
- Finished verify = generateFinished(version, (IMessageDigest) md5.clone(),
- (IMessageDigest) sha.clone(), true);
- msg = Handshake.read(din, suite, null);
- if (msg.getType() != Handshake.Type.FINISHED)
- {
- throwUnexpectedMessage();
- }
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- finis = (Finished) msg.getBody();
- if (version == ProtocolVersion.SSL_3)
- {
- if (!Arrays.equals(finis.getMD5Hash(), verify.getMD5Hash()) ||
- !Arrays.equals(finis.getSHAHash(), verify.getSHAHash()))
- {
- throwHandshakeFailure();
- }
- }
- else
- {
- if (!Arrays.equals(finis.getVerifyData(), verify.getVerifyData()))
- {
- throwHandshakeFailure();
- }
- }
-
- // Send our Finished message last for new sessions.
- if (newSession)
- {
- changeCipherSpec();
- session.params.setDeflating(comp == CompressionMethod.ZLIB);
- session.params.setOutMac(writeMac);
- session.params.setOutCipher(writeCipher);
- finis = generateFinished(version, md5, sha, false);
- msg = new Handshake(Handshake.Type.FINISHED, finis);
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}", msg);
- msg.write(dout, version);
- dout.flush();
- }
-
- handshakeCompleted();
- }
-
- /**
- * Generate the keys from the master secret.
- *
- * @param server The server's random value.
- * @param client The client's random value.
- * @param activeVersion The negotiated protocol version.
- * @return The generated keys.
- */
- private byte[][] generateKeys(byte[] server, byte[] client,
- ProtocolVersion activeVersion)
- throws LimitReachedException, IOException
- {
- CipherSuite suite = session.cipherSuite;
- int macLen = (suite.getMac().indexOf("MD5") >= 0) ? 16 : 20;
- int keyLen = suite.getKeyLength();
- int ivLen = 0;
- if (suite.getCipher().indexOf("DES") >= 0)
- {
- ivLen = 8;
- }
- else if (suite.getCipher() == "AES")
- {
- ivLen = 16;
- }
- byte[][] keyMaterial = new byte[6][];
- keyMaterial[0] = new byte[macLen]; // client_write_MAC_secret
- keyMaterial[1] = new byte[macLen]; // server_write_MAC_secret
- keyMaterial[2] = new byte[keyLen]; // client_write_key
- keyMaterial[3] = new byte[keyLen]; // server_write_key
- keyMaterial[4] = new byte[ivLen]; // client_write_IV
- keyMaterial[5] = new byte[ivLen]; // server_write_IV
- IRandom prf = null;
- if (activeVersion == ProtocolVersion.SSL_3)
- {
- prf = new SSLRandom();
- HashMap attr = new HashMap();
- attr.put(SSLRandom.SECRET, session.masterSecret);
- attr.put(SSLRandom.SEED, Util.concat(server, client));
- prf.init(attr);
- }
- else
- {
- prf = new TLSRandom();
- HashMap attr = new HashMap();
- attr.put(TLSRandom.SECRET, session.masterSecret);
- attr.put(TLSRandom.SEED, Util.concat("key expansion".getBytes("UTF-8"),
- Util.concat(server, client)));
- prf.init(attr);
- }
- for (int i = 0; i < keyMaterial.length; i++)
- {
- prf.nextBytes(keyMaterial[i], 0, keyMaterial[i].length);
- }
-
- // Exportable ciphers transform their keys once more, and use a
- // nonsecret IV for block ciphers.
- if (suite.isExportable())
- {
- int finalLen = suite.getCipher() == "DES" ? 8 : 16;
- if (activeVersion == ProtocolVersion.SSL_3)
- {
- IMessageDigest md5 = HashFactory.getInstance(Registry.MD5_HASH);
- md5.update(keyMaterial[2], 0, keyMaterial[2].length);
- md5.update(client, 0, client.length);
- md5.update(server, 0, server.length);
- keyMaterial[2] = Util.trim(md5.digest(), finalLen);
- md5.update(keyMaterial[3], 0, keyMaterial[3].length);
- md5.update(server, 0, server.length);
- md5.update(client, 0, client.length);
- keyMaterial[3] = Util.trim(md5.digest(), finalLen);
- if (!suite.isStreamCipher())
- {
- md5.update(client, 0, client.length);
- md5.update(server, 0, server.length);
- keyMaterial[4] = Util.trim(md5.digest(), ivLen);
- md5.update(server, 0, server.length);
- md5.update(client, 0, client.length);
- keyMaterial[5] = Util.trim(md5.digest(), ivLen);
- }
- }
- else
- {
- HashMap attr = new HashMap();
- attr.put(TLSRandom.SECRET, keyMaterial[2]);
- attr.put(TLSRandom.SEED,
- Util.concat("client write key".getBytes("UTF-8"),
- Util.concat(client, server)));
- prf.init(attr);
- keyMaterial[2] = new byte[finalLen];
- prf.nextBytes(keyMaterial[2], 0, finalLen);
- attr.put(TLSRandom.SECRET, keyMaterial[3]);
- attr.put(TLSRandom.SEED,
- Util.concat("server write key".getBytes("UTF-8"),
- Util.concat(client, server)));
- prf.init(attr);
- keyMaterial[3] = new byte[finalLen];
- prf.nextBytes(keyMaterial[3], 0, finalLen);
- if (!suite.isStreamCipher())
- {
- attr.put(TLSRandom.SECRET, new byte[0]);
- attr.put(TLSRandom.SEED, Util.concat("IV block".getBytes("UTF-8"),
- Util.concat(client, server)));
- prf.init(attr);
- prf.nextBytes(keyMaterial[4], 0, keyMaterial[4].length);
- prf.nextBytes(keyMaterial[5], 0, keyMaterial[5].length);
- }
- }
- }
-
- if (DEBUG_KEY_EXCHANGE)
- {
- logger.log (Component.SSL_KEY_EXCHANGE, "Generated keys:");
- for (int i = 0; i < keyMaterial.length; i++)
- logger.log (Component.SSL_KEY_EXCHANGE, "[{0}] {1}",
- new Object[] { new Integer (i),
- Util.toHexString(keyMaterial[i], ':') });
- }
-
- return keyMaterial;
- }
-
- /**
- * Generate a "finished" message, based on the hashes of the handshake
- * messages, the agreed version, and a label.
- *
- * @param version The agreed version.
- * @param md5 The current state of the handshake MD5 hash.
- * @param sha The current state of the handshake SHA hash.
- * @param client Should be true if the message is generated by the client.
- */
- private Finished generateFinished(ProtocolVersion version, IMessageDigest md5,
- IMessageDigest sha, boolean client)
- {
- if (version == ProtocolVersion.SSL_3)
- {
- if (client)
- {
- md5.update(SENDER_CLIENT, 0, 4);
- }
- else
- {
- md5.update(SENDER_SERVER, 0, 4);
- }
- byte[] ms = session.masterSecret;
- md5.update(ms, 0, ms.length);
- for (int i = 0; i < 48; i++)
- {
- md5.update(SSLHMac.PAD1);
- }
- byte[] b = md5.digest();
- md5.update(ms, 0, ms.length);
- for (int i = 0; i < 48; i++)
- {
- md5.update(SSLHMac.PAD2);
- }
- md5.update(b, 0, b.length);
-
- if (client)
- {
- sha.update(SENDER_CLIENT, 0, 4);
- }
- else
- {
- sha.update(SENDER_SERVER, 0, 4);
- }
- sha.update(ms, 0, ms.length);
- for (int i = 0; i < 40; i++)
- {
- sha.update(SSLHMac.PAD1);
- }
- b = sha.digest();
- sha.update(ms, 0, ms.length);
- for (int i = 0; i < 40; i++)
- {
- sha.update(SSLHMac.PAD2);
- }
- sha.update(b, 0, b.length);
- return new Finished(md5.digest(), sha.digest());
- }
- else
- {
- byte[] h1 = md5.digest();
- byte[] h2 = sha.digest();
- String label = client ? "client finished" : "server finished";
- byte[] seed = null;
- try
- {
- seed = Util.concat(label.getBytes("UTF-8"), Util.concat(h1, h2));
- }
- catch (java.io.UnsupportedEncodingException uee)
- {
- RuntimeException re = new RuntimeException (uee.getMessage());
- re.initCause (uee);
- throw re;
- }
- IRandom prf = new TLSRandom();
- HashMap attr = new HashMap();
- attr.put(TLSRandom.SECRET, session.masterSecret);
- attr.put(TLSRandom.SEED, seed);
- prf.init(attr);
- byte[] finishedValue = new byte[12];
- try
- {
- prf.nextBytes(finishedValue, 0, 12);
- }
- catch (LimitReachedException lre)
- {
- RuntimeException re = new RuntimeException (lre.getMessage());
- re.initCause (lre);
- throw re;
- }
- return new Finished(finishedValue);
- }
- }
-
- /**
- * Send a fatal unexpected_message alert.
- */
- private Alert unexpectedMessage() throws IOException
- {
- Alert alert = new Alert(Alert.Level.FATAL,
- Alert.Description.UNEXPECTED_MESSAGE);
- sendAlert(alert);
- fatal();
- return alert;
- }
-
- private void throwUnexpectedMessage() throws IOException
- {
- throw new AlertException(unexpectedMessage(), true);
- }
-
- /**
- * Send a fatal handshake_failure alert.
- */
- private Alert handshakeFailure() throws IOException
- {
- Alert alert = new Alert(Alert.Level.FATAL,
- Alert.Description.HANDSHAKE_FAILURE);
- sendAlert(alert);
- fatal();
- return alert;
- }
-
- private void throwHandshakeFailure() throws IOException
- {
- throw new AlertException(handshakeFailure(), true);
- }
-
- /**
- * Send an internal_error alert.
- */
- private Alert internalError() throws IOException
- {
- Alert alert = new Alert(Alert.Level.FATAL,
- Alert.Description.INTERNAL_ERROR);
- sendAlert(alert);
- fatal();
- return alert;
- }
-
- private void throwInternalError() throws IOException
- {
- throw new AlertException(internalError(), true);
- }
-
- private Alert peerUnverified(X509Certificate[] chain) throws IOException
- {
- Alert alert = new Alert(Alert.Level.FATAL,
- Alert.Description.HANDSHAKE_FAILURE);
- sendAlert(alert);
- fatal();
- return alert;
- }
-
- private void throwPeerUnverified(X509Certificate[] chain) throws IOException
- {
- peerUnverified (chain);
- throw new SSLPeerUnverifiedException("could not verify: "+
- chain[0].getSubjectDN());
- }
-
- /**
- * Grab the first suite that is both in the client's requested suites
- * and in our enabled suites, and for which we have the proper
- * credentials.
- *
- * @param suites The client's requested suites.
- * @param version The version being negotiated.
- * @return The selected cipher suite.
- * @throws SSLException If no appropriate suite can be selected.
- */
- private CipherSuite selectSuite(List suites, ProtocolVersion version)
- throws IOException
- {
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "selectSuite req:{0} suites:{1}",
- new Object[] { suites, session.enabledSuites });
- boolean srpSuiteNoUser = false;
- for (Iterator i = suites.iterator(); i.hasNext(); )
- {
- CipherSuite herSuite = (CipherSuite) i.next();
- for (Iterator j = session.enabledSuites.iterator(); j.hasNext(); )
- {
- CipherSuite mySuite = (CipherSuite) j.next();
- if (!mySuite.equals(herSuite))
- {
- continue;
- }
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0} == {1}",
- new Object[] { mySuite, herSuite });
- if (mySuite.getSignature() != "anon" && session.keyManager != null &&
- session.keyManager.chooseServerAlias(mySuite.getAuthType(), null, null) == null)
- {
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "{0}: no certificate/private key",
- mySuite);
- continue;
- }
- if (mySuite.getKeyExchange() == "SRP")
- {
- if (session.getValue("srp-username") == null)
- {
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "no SRP username");
- srpSuiteNoUser = true;
- continue;
- }
- if (session.srpTrustManager == null)
- {
- if (DEBUG_HANDSHAKE_LAYER)
- logger.log (Component.SSL_HANDSHAKE, "no SRP password file");
- continue;
- }
- }
- return mySuite.resolve(version);
- }
- }
- Alert alert = null;
- if (srpSuiteNoUser)
- {
- alert = new Alert(Alert.Level.WARNING,
- Alert.Description.MISSING_SRP_USERNAME);
- sendAlert(alert);
- return null;
- }
- else
- alert = new Alert(Alert.Level.FATAL,
- Alert.Description.INSUFFICIENT_SECURITY);
- sendAlert(alert);
- fatal();
- throw new AlertException(alert, true);
- }
-
- /**
- * Ask the user for their user name.
- *
- * @param remoteHost The remote host being connected to.
- * @return The user name.
- */
- private String askUserName(String remoteHost)
- {
- CallbackHandler handler = new DefaultCallbackHandler();
- try
- {
- Class c = Class.forName(Util.getSecurityProperty("jessie.srp.user.handler"));
- handler = (CallbackHandler) c.newInstance();
- }
- catch (Exception x) { }
- TextInputCallback user =
- new TextInputCallback("User name for " + remoteHost + ": ",
- Util.getProperty("user.name"));
- try
- {
- handler.handle(new Callback[] { user });
- }
- catch (Exception x) { }
- return user.getText();
- }
-
- /**
- * Ask the user for a password.
- *
- * @param user The user name.
- * @return The password.
- */
- private String askPassword(String user)
- {
- CallbackHandler handler = new DefaultCallbackHandler();
- try
- {
- Class c = Class.forName(Util.getSecurityProperty("jessie.srp.password.handler"));
- handler = (CallbackHandler) c.newInstance();
- }
- catch (Exception x) { }
- PasswordCallback passwd = new PasswordCallback(user + "'s password: ", false);
- try
- {
- handler.handle(new Callback[] { passwd });
- }
- catch (Exception x) { }
- return new String(passwd.getPassword());
- }
-
- /**
- * Ask the user (via a callback) if they will accept a certificate that
- * could not be verified.
- *
- * @param chain The certificate chain in question.
- * @return true if the user accepts the certificate chain.
- */
- private boolean checkCertificates(X509Certificate[] chain)
- {
- CallbackHandler handler = new DefaultCallbackHandler();
- try
- {
- Class c = Class.forName(Util.getSecurityProperty("jessie.certificate.handler"));
- handler = (CallbackHandler) c.newInstance();
- }
- catch (Exception x)
- {
- }
- String nl = Util.getProperty("line.separator");
- ConfirmationCallback confirm = new ConfirmationCallback(
- "The server's certificate could not be verified. There is no proof" + nl +
- "that this server is who it claims to be, or that their certificate" + nl +
- "is valid. Do you wish to continue connecting?",
- ConfirmationCallback.ERROR, ConfirmationCallback.YES_NO_OPTION,
- ConfirmationCallback.NO);
- try
- {
- handler.handle(new Callback[] { confirm });
- }
- catch (Exception x)
- {
- return false;
- }
- return confirm.getSelectedIndex() == ConfirmationCallback.YES;
- }
-
- /**
- * Update a signature object with a BigInteger, trimming the leading
- * "00" octet if present.
- *
- * @param sig The signature being updated.
- * @param bi The integer to feed into the signature.
- */
- private void updateSig(ISignature sig, BigInteger bi)
- {
- byte[] buf = Util.trim(bi);
- sig.update((byte) (buf.length >>> 8));
- sig.update((byte) buf.length);
- sig.update(buf, 0, buf.length);
- }
-
- /**
- * Teardown everything on fatal errors.
- */
- private void fatal() throws IOException
- {
- if (session != null)
- {
- session.invalidate();
- }
-// recordInput.setRunning(false);
-// recordOutput.setRunning(false);
- if (underlyingSocket != null)
- {
- underlyingSocket.close();
- }
- else
- {
- super.close();
- }
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketFactory.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketFactory.java
deleted file mode 100644
index 24a8389c117..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketFactory.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* SSLSocketFactory.java -- factory for SSL sockets.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.UnknownHostException;
-import java.security.SecureRandom;
-
-import javax.net.ssl.X509TrustManager;
-import javax.net.ssl.X509KeyManager;
-
-class SSLSocketFactory extends javax.net.ssl.SSLSocketFactory
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private final X509TrustManager trustManager;
- private final X509KeyManager keyManager;
- private final SecureRandom random;
- private final SessionContext sessionContext;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- SSLSocketFactory(X509TrustManager trustManager, X509KeyManager keyManager,
- SecureRandom random, SessionContext sessionContext)
- {
- this.trustManager = trustManager;
- this.keyManager = keyManager;
- this.random = random;
- this.sessionContext = sessionContext;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public String[] getDefaultCipherSuites()
- {
- return (String[]) CipherSuite.availableSuiteNames().toArray(new String[0]);
- }
-
- public String[] getSupportedCipherSuites()
- {
- return getDefaultCipherSuites();
- }
-
- public Socket createSocket(Socket socket, String host, int port, boolean autoClose)
- throws IOException
- {
- return setup(new SSLSocket(socket, host, port, autoClose));
- }
-
- public Socket createSocket() throws IOException
- {
- return setup(new SSLSocket());
- }
-
- public Socket createSocket(String host, int port)
- throws IOException, UnknownHostException
- {
- return setup(new SSLSocket(host, port));
- }
-
- public Socket createSocket(String host, int port, InetAddress localAddr, int localPort)
- throws IOException, UnknownHostException
- {
- return setup(new SSLSocket(host, port, localAddr, localPort));
- }
-
- public Socket createSocket(InetAddress address, int port) throws IOException
- {
- return setup(new SSLSocket(address, port));
- }
-
- public Socket createSocket(InetAddress address, int port,
- InetAddress localAddr, int localPort)
- throws IOException
- {
- return setup(new SSLSocket(address, port, localAddr, localPort));
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private SSLSocket setup(SSLSocket s)
- {
- s.setTrustManager(trustManager);
- s.setKeyManager(keyManager);
- s.setRandom(random);
- s.setSessionContext(sessionContext);
- s.setUseClientMode(true);
- return s;
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.java
new file mode 100644
index 00000000000..6c804f9c629
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.java
@@ -0,0 +1,137 @@
+/* SSLSocketFactoryImpl.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.net.UnknownHostException;
+
+import javax.net.ssl.SSLSocketFactory;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class SSLSocketFactoryImpl extends SSLSocketFactory
+{
+ /**
+ * The SSLContextImpl that created us.
+ */
+ private final SSLContextImpl contextImpl;
+
+ public SSLSocketFactoryImpl(SSLContextImpl contextImpl)
+ {
+ this.contextImpl = contextImpl;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocketFactory#createSocket(java.net.Socket, java.lang.String, int, boolean)
+ */
+ @Override public Socket createSocket(Socket socket, String host, int port,
+ boolean autoClose)
+ throws IOException
+ {
+ return new SSLSocketImpl(contextImpl, host, port, socket, autoClose);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocketFactory#getDefaultCipherSuites()
+ */
+ @Override public String[] getDefaultCipherSuites()
+ {
+ return SSLEngineImpl.defaultSuites();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocketFactory#getSupportedCipherSuites()
+ */
+ @Override public String[] getSupportedCipherSuites()
+ {
+ return CipherSuite.availableSuiteNames().toArray(new String[0]);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.SocketFactory#createSocket(java.lang.String, int)
+ */
+ @Override public SSLSocketImpl createSocket(String host, int port)
+ throws IOException, UnknownHostException
+ {
+ SSLSocketImpl socket = new SSLSocketImpl(contextImpl, host, port);
+ InetSocketAddress endpoint = new InetSocketAddress(host, port);
+ socket.connect(endpoint);
+ return socket;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.SocketFactory#createSocket(java.lang.String, int, java.net.InetAddress, int)
+ */
+ @Override public SSLSocketImpl createSocket(String host, int port,
+ InetAddress localHost, int localPort)
+ throws IOException, UnknownHostException
+ {
+ SSLSocketImpl socket = createSocket(host, port);
+ socket.bind(new InetSocketAddress(localHost, localPort));
+ return socket;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.SocketFactory#createSocket(java.net.InetAddress, int)
+ */
+ @Override public SSLSocketImpl createSocket(InetAddress host, int port)
+ throws IOException
+ {
+ SSLSocketImpl socket = new SSLSocketImpl(contextImpl,
+ host.getCanonicalHostName(), port);
+ socket.connect(new InetSocketAddress(host, port));
+ return socket;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.SocketFactory#createSocket(java.net.InetAddress, int, java.net.InetAddress, int)
+ */
+ @Override public SSLSocketImpl createSocket(InetAddress host, int port,
+ InetAddress localHost, int localPort)
+ throws IOException
+ {
+ SSLSocketImpl socket = createSocket(host, port);
+ socket.bind(new InetSocketAddress(localHost, localPort));
+ return socket;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketImpl.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketImpl.java
new file mode 100644
index 00000000000..0181b66d854
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketImpl.java
@@ -0,0 +1,833 @@
+/* SSLSocketImpl.java -- implementation of an SSL client socket.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.classpath.debug.Component;
+import gnu.classpath.debug.SystemLogger;
+
+import java.io.DataInputStream;
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.net.SocketAddress;
+import java.net.SocketException;
+import java.nio.ByteBuffer;
+import java.nio.channels.SocketChannel;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.net.ssl.HandshakeCompletedEvent;
+import javax.net.ssl.HandshakeCompletedListener;
+import javax.net.ssl.SSLEngineResult;
+import javax.net.ssl.SSLException;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.SSLEngineResult.HandshakeStatus;
+import javax.net.ssl.SSLEngineResult.Status;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class SSLSocketImpl extends SSLSocket
+{
+ private class SocketOutputStream extends OutputStream
+ {
+ private final ByteBuffer buffer;
+ private final OutputStream out;
+
+ SocketOutputStream() throws IOException
+ {
+ buffer = ByteBuffer.wrap(new byte[getSession().getPacketBufferSize()]);
+ if (underlyingSocket != null)
+ out = underlyingSocket.getOutputStream();
+ else
+ out = SSLSocketImpl.super.getOutputStream();
+ }
+
+ @Override public void write(byte[] buf, int off, int len) throws IOException
+ {
+ if (!initialHandshakeDone
+ || engine.getHandshakeStatus() != HandshakeStatus.NOT_HANDSHAKING)
+ {
+ doHandshake();
+ if (handshakeException != null)
+ throw handshakeException;
+ }
+
+ int k = 0;
+ while (k < len)
+ {
+ synchronized (engine)
+ {
+ int l = Math.min(len-k, getSession().getApplicationBufferSize());
+ ByteBuffer in = ByteBuffer.wrap(buf, off+k, l);
+ SSLEngineResult result = engine.wrap(in, buffer);
+ if (result.getStatus() == Status.CLOSED)
+ return;
+ if (result.getStatus() != Status.OK)
+ throw new SSLException("unexpected SSL state " + result.getStatus());
+ buffer.flip();
+ out.write(buffer.array(), 0, buffer.limit());
+ k += result.bytesConsumed();
+ buffer.clear();
+ }
+ }
+ }
+
+ @Override public void write(int b) throws IOException
+ {
+ write(new byte[] { (byte) b });
+ }
+
+ @Override public void close() throws IOException
+ {
+ SSLSocketImpl.this.close();
+ }
+ }
+
+ private class SocketInputStream extends InputStream
+ {
+ private final ByteBuffer inBuffer;
+ private final ByteBuffer appBuffer;
+ private final DataInputStream in;
+
+ SocketInputStream() throws IOException
+ {
+ inBuffer = ByteBuffer.wrap(new byte[getSession().getPacketBufferSize()]);
+ inBuffer.limit(0);
+ appBuffer = ByteBuffer.allocate(getSession().getApplicationBufferSize());
+ appBuffer.flip();
+ if (underlyingSocket != null)
+ in = new DataInputStream(underlyingSocket.getInputStream());
+ else
+ in = new DataInputStream(SSLSocketImpl.super.getInputStream());
+ }
+
+ @Override public int read(byte[] buf, int off, int len) throws IOException
+ {
+ if (!initialHandshakeDone ||
+ engine.getHandshakeStatus() != HandshakeStatus.NOT_HANDSHAKING)
+ {
+ doHandshake();
+ if (handshakeException != null)
+ throw handshakeException;
+ }
+
+ if (!appBuffer.hasRemaining())
+ {
+ int x = in.read();
+ if (x == -1)
+ return -1;
+ inBuffer.clear();
+ inBuffer.put((byte) x);
+ inBuffer.putInt(in.readInt());
+ int reclen = inBuffer.getShort(3) & 0xFFFF;
+ in.readFully(inBuffer.array(), 5, reclen);
+ inBuffer.position(0).limit(reclen + 5);
+ synchronized (engine)
+ {
+ appBuffer.clear();
+ SSLEngineResult result = engine.unwrap(inBuffer, appBuffer);
+ Status status = result.getStatus();
+ if (status == Status.CLOSED && result.bytesProduced() == 0)
+ return -1;
+ }
+ inBuffer.compact();
+ appBuffer.flip();
+ }
+ int l = Math.min(len, appBuffer.remaining());
+ appBuffer.get(buf, off, l);
+ return l;
+ }
+
+ @Override public int read() throws IOException
+ {
+ byte[] b = new byte[1];
+ if (read(b) == -1)
+ return -1;
+ return b[0] & 0xFF;
+ }
+ }
+
+ private static final SystemLogger logger = SystemLogger.getSystemLogger();
+
+ private SSLEngineImpl engine;
+ private Set<HandshakeCompletedListener> listeners;
+ private Socket underlyingSocket;
+ private boolean isHandshaking;
+ private IOException handshakeException;
+ private boolean initialHandshakeDone = false;
+ private final boolean autoClose;
+
+ public SSLSocketImpl(SSLContextImpl contextImpl, String host, int port)
+ {
+ this(contextImpl, host, port, null, false);
+ }
+
+ public SSLSocketImpl(SSLContextImpl contextImpl, String host, int port,
+ Socket underlyingSocket, boolean autoClose)
+ {
+ engine = new SSLEngineImpl(contextImpl, host, port);
+ engine.setUseClientMode(true); // default to client mode
+ listeners = new HashSet<HandshakeCompletedListener>();
+ this.underlyingSocket = underlyingSocket;
+ this.autoClose = autoClose;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#addHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener)
+ */
+ @Override
+ public void addHandshakeCompletedListener(HandshakeCompletedListener listener)
+ {
+ listeners.add(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#getEnableSessionCreation()
+ */
+ @Override public boolean getEnableSessionCreation()
+ {
+ return engine.getEnableSessionCreation();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#getEnabledCipherSuites()
+ */
+ @Override public String[] getEnabledCipherSuites()
+ {
+ return engine.getEnabledCipherSuites();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#getEnabledProtocols()
+ */
+ @Override public String[] getEnabledProtocols()
+ {
+ return engine.getEnabledProtocols();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#getNeedClientAuth()
+ */
+ @Override public boolean getNeedClientAuth()
+ {
+ return engine.getNeedClientAuth();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#getSession()
+ */
+ @Override public SSLSession getSession()
+ {
+ return engine.getSession();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#getSupportedCipherSuites()
+ */
+ @Override public String[] getSupportedCipherSuites()
+ {
+ return engine.getSupportedCipherSuites();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#getSupportedProtocols()
+ */
+ @Override public String[] getSupportedProtocols()
+ {
+ return engine.getSupportedProtocols();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#getUseClientMode()
+ */
+ @Override public boolean getUseClientMode()
+ {
+ return engine.getUseClientMode();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#getWantClientAuth()
+ */
+ @Override public boolean getWantClientAuth()
+ {
+ return engine.getWantClientAuth();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#removeHandshakeCompletedListener(javax.net.ssl.HandshakeCompletedListener)
+ */
+ @Override
+ public void removeHandshakeCompletedListener(HandshakeCompletedListener listener)
+ {
+ listeners.remove(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#setEnableSessionCreation(boolean)
+ */
+ @Override public void setEnableSessionCreation(boolean enable)
+ {
+ engine.setEnableSessionCreation(enable);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#setEnabledCipherSuites(java.lang.String[])
+ */
+ @Override public void setEnabledCipherSuites(String[] suites)
+ {
+ engine.setEnabledCipherSuites(suites);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#setEnabledProtocols(java.lang.String[])
+ */
+ @Override public void setEnabledProtocols(String[] protocols)
+ {
+ engine.setEnabledProtocols(protocols);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#setNeedClientAuth(boolean)
+ */
+ @Override public void setNeedClientAuth(boolean needAuth)
+ {
+ engine.setNeedClientAuth(needAuth);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#setUseClientMode(boolean)
+ */
+ @Override public void setUseClientMode(boolean clientMode)
+ {
+ engine.setUseClientMode(clientMode);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#setWantClientAuth(boolean)
+ */
+ @Override public void setWantClientAuth(boolean wantAuth)
+ {
+ engine.setWantClientAuth(wantAuth);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.net.ssl.SSLSocket#startHandshake()
+ */
+ @Override public void startHandshake() throws IOException
+ {
+ if (isHandshaking)
+ return;
+
+ if (handshakeException != null)
+ throw handshakeException;
+
+ Thread t = new Thread(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ doHandshake();
+ }
+ catch (IOException ioe)
+ {
+ handshakeException = ioe;
+ }
+ }
+ }, "HandshakeThread@" + System.identityHashCode(this));
+ t.start();
+ }
+
+ void doHandshake() throws IOException
+ {
+ synchronized (engine)
+ {
+ if (isHandshaking)
+ {
+ try
+ {
+ engine.wait();
+ }
+ catch (InterruptedException ie)
+ {
+ }
+ return;
+ }
+ isHandshaking = true;
+ }
+
+ if (initialHandshakeDone)
+ throw new SSLException("rehandshaking not yet implemented");
+
+ long now = -System.currentTimeMillis();
+ engine.beginHandshake();
+
+ HandshakeStatus status = engine.getHandshakeStatus();
+ assert(status != HandshakeStatus.NOT_HANDSHAKING);
+
+ ByteBuffer inBuffer = ByteBuffer.wrap(new byte[getSession().getPacketBufferSize()]);
+ inBuffer.position(inBuffer.limit());
+ ByteBuffer outBuffer = ByteBuffer.wrap(new byte[getSession().getPacketBufferSize()]);
+ ByteBuffer emptyBuffer = ByteBuffer.allocate(0);
+ SSLEngineResult result = null;
+
+ DataInputStream sockIn = null;
+ if (underlyingSocket != null)
+ sockIn = new DataInputStream(underlyingSocket.getInputStream());
+ else
+ sockIn = new DataInputStream(super.getInputStream());
+
+ OutputStream sockOut = null;
+ if (underlyingSocket != null)
+ sockOut = underlyingSocket.getOutputStream();
+ else
+ sockOut = super.getOutputStream();
+
+ try
+ {
+ while (status != HandshakeStatus.NOT_HANDSHAKING
+ && status != HandshakeStatus.FINISHED)
+ {
+ logger.logv(Component.SSL_HANDSHAKE, "socket processing state {0}",
+ status);
+
+ if (inBuffer.capacity() != getSession().getPacketBufferSize())
+ {
+ ByteBuffer b
+ = ByteBuffer.wrap(new byte[getSession().getPacketBufferSize()]);
+ if (inBuffer.hasRemaining())
+ b.put(inBuffer).flip();
+ inBuffer = b;
+ }
+ if (outBuffer.capacity() != getSession().getPacketBufferSize())
+ outBuffer
+ = ByteBuffer.wrap(new byte[getSession().getPacketBufferSize()]);
+
+ switch (status)
+ {
+ case NEED_UNWRAP:
+ // Read in a single SSL record.
+ inBuffer.clear();
+ int i = sockIn.read();
+ if (i == -1)
+ throw new EOFException();
+ if ((i & 0x80) == 0x80) // SSLv2 client hello.
+ {
+ inBuffer.put((byte) i);
+ int v2len = (i & 0x7f) << 8;
+ i = sockIn.read();
+ v2len = v2len | (i & 0xff);
+ inBuffer.put((byte) i);
+ sockIn.readFully(inBuffer.array(), 2, v2len);
+ inBuffer.position(0).limit(v2len + 2);
+ }
+ else
+ {
+ inBuffer.put((byte) i);
+ inBuffer.putInt(sockIn.readInt());
+ int reclen = inBuffer.getShort(3) & 0xFFFF;
+ sockIn.readFully(inBuffer.array(), 5, reclen);
+ inBuffer.position(0).limit(reclen + 5);
+ }
+ result = engine.unwrap(inBuffer, emptyBuffer);
+ status = result.getHandshakeStatus();
+ if (result.getStatus() != Status.OK)
+ throw new SSLException("unexpected SSL status "
+ + result.getStatus());
+ break;
+
+ case NEED_WRAP:
+ {
+ outBuffer.clear();
+ result = engine.wrap(emptyBuffer, outBuffer);
+ status = result.getHandshakeStatus();
+ if (result.getStatus() != Status.OK)
+ throw new SSLException("unexpected SSL status "
+ + result.getStatus());
+ outBuffer.flip();
+ sockOut.write(outBuffer.array(), outBuffer.position(),
+ outBuffer.limit());
+ }
+ break;
+
+ case NEED_TASK:
+ {
+ Runnable task;
+ while ((task = engine.getDelegatedTask()) != null)
+ task.run();
+ status = engine.getHandshakeStatus();
+ }
+ break;
+
+ case FINISHED:
+ break;
+ }
+ }
+
+ initialHandshakeDone = true;
+
+ HandshakeCompletedEvent hce = new HandshakeCompletedEvent(this, getSession());
+ for (HandshakeCompletedListener l : listeners)
+ {
+ try
+ {
+ l.handshakeCompleted(hce);
+ }
+ catch (ThreadDeath td)
+ {
+ throw td;
+ }
+ catch (Throwable x)
+ {
+ logger.log(Component.WARNING,
+ "HandshakeCompletedListener threw exception", x);
+ }
+ }
+
+ now += System.currentTimeMillis();
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE,
+ "handshake completed in {0}ms in thread {1}", now,
+ Thread.currentThread().getName());
+ }
+ catch (SSLException ssle)
+ {
+ handshakeException = ssle;
+ throw ssle;
+ }
+ finally
+ {
+ synchronized (engine)
+ {
+ isHandshaking = false;
+ engine.notifyAll();
+ }
+ }
+ }
+
+ // Methods overriding Socket.
+
+ @Override public void bind(SocketAddress bindpoint) throws IOException
+ {
+ if (underlyingSocket != null)
+ underlyingSocket.bind(bindpoint);
+ else
+ super.bind(bindpoint);
+ }
+
+ @Override public void connect(SocketAddress endpoint) throws IOException
+ {
+ if (underlyingSocket != null)
+ underlyingSocket.connect(endpoint);
+ else
+ super.connect(endpoint);
+ }
+
+ @Override public void connect(SocketAddress endpoint, int timeout)
+ throws IOException
+ {
+ if (underlyingSocket != null)
+ underlyingSocket.connect(endpoint, timeout);
+ else
+ super.connect(endpoint, timeout);
+ }
+
+ @Override public InetAddress getInetAddress()
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getInetAddress();
+ return super.getInetAddress();
+ }
+
+ @Override public InetAddress getLocalAddress()
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getLocalAddress();
+ return super.getLocalAddress();
+ }
+
+ @Override public int getPort()
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getPort();
+ return super.getPort();
+ }
+
+ @Override public int getLocalPort()
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getLocalPort();
+ return super.getLocalPort();
+ }
+
+ @Override public SocketAddress getRemoteSocketAddress()
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getRemoteSocketAddress();
+ return super.getRemoteSocketAddress();
+ }
+
+ public SocketAddress getLocalSocketAddress()
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getLocalSocketAddress();
+ return super.getLocalSocketAddress();
+ }
+
+ @Override public SocketChannel getChannel()
+ {
+ throw new UnsupportedOperationException("use javax.net.ssl.SSLEngine for NIO");
+ }
+
+ @Override public InputStream getInputStream() throws IOException
+ {
+ return new SocketInputStream();
+ }
+
+ @Override public OutputStream getOutputStream() throws IOException
+ {
+ return new SocketOutputStream();
+ }
+
+ @Override public void setTcpNoDelay(boolean on) throws SocketException
+ {
+ if (underlyingSocket != null)
+ underlyingSocket.setTcpNoDelay(on);
+ else
+ super.setTcpNoDelay(on);
+ }
+
+ @Override public boolean getTcpNoDelay() throws SocketException
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getTcpNoDelay();
+ return super.getTcpNoDelay();
+ }
+
+ @Override public void setSoLinger(boolean on, int linger) throws SocketException
+ {
+ if (underlyingSocket != null)
+ underlyingSocket.setSoLinger(on, linger);
+ else
+ super.setSoLinger(on, linger);
+ }
+
+ public int getSoLinger() throws SocketException
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getSoLinger();
+ return super.getSoLinger();
+ }
+
+ @Override public void sendUrgentData(int x) throws IOException
+ {
+ throw new UnsupportedOperationException("not supported");
+ }
+
+ @Override public void setOOBInline(boolean on) throws SocketException
+ {
+ if (underlyingSocket != null)
+ underlyingSocket.setOOBInline(on);
+ else
+ super.setOOBInline(on);
+ }
+
+ @Override public boolean getOOBInline() throws SocketException
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getOOBInline();
+ return super.getOOBInline();
+ }
+
+ @Override public void setSoTimeout(int timeout) throws SocketException
+ {
+ if (underlyingSocket != null)
+ underlyingSocket.setSoTimeout(timeout);
+ else
+ super.setSoTimeout(timeout);
+ }
+
+ @Override public int getSoTimeout() throws SocketException
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getSoTimeout();
+ return super.getSoTimeout();
+ }
+
+ @Override public void setSendBufferSize(int size) throws SocketException
+ {
+ if (underlyingSocket != null)
+ underlyingSocket.setSendBufferSize(size);
+ else
+ super.setSendBufferSize(size);
+ }
+
+ @Override public int getSendBufferSize() throws SocketException
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getSendBufferSize();
+ return super.getSendBufferSize();
+ }
+
+ @Override public void setReceiveBufferSize(int size) throws SocketException
+ {
+ if (underlyingSocket != null)
+ underlyingSocket.setReceiveBufferSize(size);
+ else
+ underlyingSocket.setReceiveBufferSize(size);
+ }
+
+ @Override public int getReceiveBufferSize() throws SocketException
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getReceiveBufferSize();
+ return super.getReceiveBufferSize();
+ }
+
+ @Override public void setKeepAlive(boolean on) throws SocketException
+ {
+ if (underlyingSocket != null)
+ underlyingSocket.setKeepAlive(on);
+ else
+ super.setKeepAlive(on);
+ }
+
+ @Override public boolean getKeepAlive() throws SocketException
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getKeepAlive();
+ return super.getKeepAlive();
+ }
+
+ @Override public void setTrafficClass(int tc) throws SocketException
+ {
+ if (underlyingSocket != null)
+ underlyingSocket.setTrafficClass(tc);
+ else
+ super.setTrafficClass(tc);
+ }
+
+ @Override public int getTrafficClass() throws SocketException
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getTrafficClass();
+ return super.getTrafficClass();
+ }
+
+ @Override public void setReuseAddress(boolean reuseAddress)
+ throws SocketException
+ {
+ if (underlyingSocket != null)
+ underlyingSocket.setReuseAddress(reuseAddress);
+ else
+ super.setReuseAddress(reuseAddress);
+ }
+
+ @Override public boolean getReuseAddress() throws SocketException
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.getReuseAddress();
+ return super.getReuseAddress();
+ }
+
+ @Override public void close() throws IOException
+ {
+ // XXX closure alerts.
+ if (underlyingSocket != null && autoClose)
+ underlyingSocket.close();
+ else
+ super.close();
+ }
+
+ @Override public void shutdownInput() throws IOException
+ {
+ if (underlyingSocket != null)
+ underlyingSocket.shutdownInput();
+ else
+ super.shutdownInput();
+ }
+
+ @Override public void shutdownOutput() throws IOException
+ {
+ if (underlyingSocket != null)
+ underlyingSocket.shutdownOutput();
+ else
+ super.shutdownOutput();
+ }
+
+ @Override public boolean isConnected()
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.isConnected();
+ return super.isConnected();
+ }
+
+ @Override public boolean isBound()
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.isBound();
+ return super.isBound();
+ }
+
+ @Override public boolean isClosed()
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.isClosed();
+ return super.isClosed();
+ }
+
+ @Override public boolean isInputShutdown()
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.isInputShutdown();
+ return super.isInputShutdown();
+ }
+
+ @Override public boolean isOutputShutdown()
+ {
+ if (underlyingSocket != null)
+ return underlyingSocket.isOutputShutdown();
+ return super.isOutputShutdown();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketInputStream.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketInputStream.java
deleted file mode 100644
index 69202ca33d8..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketInputStream.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/* SSLSocketInputStream.java -- InputStream for SSL sockets.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.EOFException;
-import java.io.FilterInputStream;
-import java.io.InputStream;
-import java.io.IOException;
-import javax.net.ssl.SSLException;
-
-class SSLSocketInputStream extends FilterInputStream
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private final SSLSocket socket;
- private final boolean checkHandshake;
-
- // Constructors.
- // -------------------------------------------------------------------------
-
- SSLSocketInputStream(InputStream in, SSLSocket socket)
- {
- this(in, socket, true);
- }
-
- SSLSocketInputStream(InputStream in, SSLSocket socket, boolean checkHandshake)
- {
- super(in);
- this.socket = socket;
- this.checkHandshake = checkHandshake;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public int available() throws IOException
- {
- if (checkHandshake)
- {
- socket.checkHandshakeDone();
- }
- int ret = 0;
- try
- {
- ret = super.available();
- }
- catch (AlertException ae)
- {
- Alert alert = ae.getAlert ();
- if (alert.getDescription () == Alert.Description.CLOSE_NOTIFY)
- {
- return -1;
- }
- else
- {
- throw ae;
- }
- }
- return ret;
- }
-
- public int read() throws IOException
- {
- if (checkHandshake)
- {
- socket.checkHandshakeDone();
- }
- int ret = 0;
- try
- {
- ret = in.read();
- }
- catch (AlertException ae)
- {
- Alert alert = ae.getAlert ();
- if (alert.getDescription () == Alert.Description.CLOSE_NOTIFY)
- {
- return -1;
- }
- else
- {
- throw ae;
- }
- }
- return ret;
- }
-
- public int read(byte[] buf) throws IOException
- {
- return read(buf, 0, buf.length);
- }
-
- public int read(byte[] buf, int off, int len) throws IOException
- {
- if (checkHandshake)
- {
- socket.checkHandshakeDone();
- }
- if (buf == null)
- {
- throw new NullPointerException();
- }
- if (off < 0 || len < 0 || off + len > buf.length)
- {
- throw new ArrayIndexOutOfBoundsException();
- }
- int ret = 0;
- try
- {
- ret = in.read(buf, off, len);
- }
- catch (AlertException ae)
- {
- Alert alert = ae.getAlert ();
- if (alert.getDescription () == Alert.Description.CLOSE_NOTIFY)
- {
- return -1;
- }
- else
- {
- throw ae;
- }
- }
- return ret;
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private boolean checkAlert() throws IOException
- {
- Alert alert = socket.checkAlert();
- if (alert == null) return false;
- if (alert.getLevel().equals(Alert.Level.FATAL))
- throw new AlertException(alert, false);
- if (alert.getDescription().equals(Alert.Description.CLOSE_NOTIFY))
- {
- try { return (in.available() <= 0); }
- catch (IOException ioe) { }
- }
- return false;
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketOutputStream.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketOutputStream.java
deleted file mode 100644
index fe769a85fba..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketOutputStream.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* SSLSocketOutputStream.java -- output stream for SSL sockets.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import javax.net.ssl.SSLException;
-
-class SSLSocketOutputStream extends FilterOutputStream
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private final SSLSocket socket;
- private final boolean checkHandshake;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- SSLSocketOutputStream(OutputStream out, SSLSocket socket)
- {
- this(out, socket, true);
- }
-
- SSLSocketOutputStream(OutputStream out, SSLSocket socket,
- boolean checkHandshake)
- {
- super(out);
- this.socket = socket;
- this.checkHandshake = checkHandshake;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public void write(int b) throws IOException
- {
- if (checkHandshake)
- {
- socket.checkHandshakeDone();
- }
- checkAlert();
- out.write(b);
- checkAlert();
- }
-
- public void write(byte[] buf) throws IOException
- {
- write(buf, 0, buf.length);
- }
-
- public void write(byte[] buf, int off, int len) throws IOException
- {
- if (checkHandshake)
- {
- socket.checkHandshakeDone();
- }
- if (buf == null)
- throw new NullPointerException();
- if (off < 0 || len < 0 || off + len > buf.length)
- throw new ArrayIndexOutOfBoundsException();
- checkAlert();
- out.write(buf, off, len);
- checkAlert();
- }
-
- // Own methods.
- // -------------------------------------------------------------------------
-
- private synchronized void checkAlert() throws SSLException
- {
- Alert alert = socket.checkAlert();
- if (alert == null) return;
- if (alert.getLevel().equals(Alert.Level.FATAL))
- throw new AlertException(alert, false);
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLv3HMacMD5Impl.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLv3HMacMD5Impl.java
new file mode 100644
index 00000000000..763bbaf3b77
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/SSLv3HMacMD5Impl.java
@@ -0,0 +1,116 @@
+/* SSLv3HMacMD5.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.security.InvalidAlgorithmParameterException;
+import java.security.InvalidKeyException;
+import java.security.Key;
+import java.security.spec.AlgorithmParameterSpec;
+import java.util.Collections;
+import java.util.Map;
+
+import javax.crypto.MacSpi;
+import javax.crypto.SecretKey;
+
+/**
+ * @author csm
+ */
+public class SSLv3HMacMD5Impl extends MacSpi
+{
+ private final SSLHMac adaptee;
+
+ public SSLv3HMacMD5Impl()
+ {
+ adaptee = new SSLHMac("MD5");
+ }
+
+ /* (non-Javadoc)
+ * @see javax.crypto.MacSpi#engineDoFinal()
+ */
+ @Override protected byte[] engineDoFinal()
+ {
+ return adaptee.digest();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.crypto.MacSpi#engineGetMacLength()
+ */
+ @Override protected int engineGetMacLength()
+ {
+ return adaptee.macSize();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.crypto.MacSpi#engineInit(java.security.Key, java.security.spec.AlgorithmParameterSpec)
+ */
+ @Override protected void engineInit(Key key, AlgorithmParameterSpec params)
+ throws InvalidAlgorithmParameterException, InvalidKeyException
+ {
+ if (!(key instanceof SecretKey)
+ || !key.getAlgorithm().equalsIgnoreCase("SSLv3HMac-MD5"))
+ throw new InvalidKeyException("expecting secret key with algorithm \"SSLv3HMac-MD5\"");
+ Map<String,byte[]> attr =
+ Collections.singletonMap(SSLHMac.MAC_KEY_MATERIAL, key.getEncoded());
+ adaptee.init(attr);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.crypto.MacSpi#engineReset()
+ */
+ @Override protected void engineReset()
+ {
+ adaptee.reset();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.crypto.MacSpi#engineUpdate(byte)
+ */
+ @Override protected void engineUpdate(byte input)
+ {
+ adaptee.update(input);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.crypto.MacSpi#engineUpdate(byte[], int, int)
+ */
+ @Override protected void engineUpdate(byte[] input, int offset, int length)
+ {
+ adaptee.update(input, offset, length);
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SSLv3HMacSHAImpl.java b/libjava/classpath/gnu/javax/net/ssl/provider/SSLv3HMacSHAImpl.java
new file mode 100644
index 00000000000..008a21c049d
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/SSLv3HMacSHAImpl.java
@@ -0,0 +1,116 @@
+/* SSLv3HMacSHA.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.security.InvalidAlgorithmParameterException;
+import java.security.InvalidKeyException;
+import java.security.Key;
+import java.security.spec.AlgorithmParameterSpec;
+import java.util.Collections;
+import java.util.Map;
+
+import javax.crypto.MacSpi;
+import javax.crypto.SecretKey;
+
+/**
+ * @author csm
+ */
+public class SSLv3HMacSHAImpl extends MacSpi
+{
+ private final SSLHMac adaptee;
+
+ public SSLv3HMacSHAImpl()
+ {
+ adaptee = new SSLHMac("SHA-160");
+ }
+
+ /* (non-Javadoc)
+ * @see javax.crypto.MacSpi#engineDoFinal()
+ */
+ @Override protected byte[] engineDoFinal()
+ {
+ return adaptee.digest();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.crypto.MacSpi#engineGetMacLength()
+ */
+ @Override protected int engineGetMacLength()
+ {
+ return adaptee.macSize();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.crypto.MacSpi#engineInit(java.security.Key, java.security.spec.AlgorithmParameterSpec)
+ */
+ @Override protected void engineInit(Key key, AlgorithmParameterSpec params)
+ throws InvalidAlgorithmParameterException, InvalidKeyException
+ {
+ if (!(key instanceof SecretKey)
+ || !key.getAlgorithm().equalsIgnoreCase("SSLv3HMac-SHA"))
+ throw new InvalidKeyException("expecting secret key with algorithm \"SSLv3HMac-SHA\"");
+ Map<String,byte[]> attr =
+ Collections.singletonMap(SSLHMac.MAC_KEY_MATERIAL, key.getEncoded());
+ adaptee.init(attr);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.crypto.MacSpi#engineReset()
+ */
+ @Override protected void engineReset()
+ {
+ adaptee.reset();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.crypto.MacSpi#engineUpdate(byte)
+ */
+ @Override protected void engineUpdate(byte input)
+ {
+ adaptee.update(input);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.crypto.MacSpi#engineUpdate(byte[], int, int)
+ */
+ @Override protected void engineUpdate(byte[] input, int offset, int length)
+ {
+ adaptee.update(input, offset, length);
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SecurityParameters.java b/libjava/classpath/gnu/javax/net/ssl/provider/SecurityParameters.java
deleted file mode 100644
index aa06680e200..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/SecurityParameters.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/* SecurityParameters.java -- SSL security parameters.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import javax.net.ssl.SSLException;
-
-/**
- * The interface that all security parameters used by Jessie must implement.
- * Security parameters handle all transforming of data, including encryption,
- * authentication, and compression.
- */
-interface SecurityParameters
-{
-
- // Methods.
- // -------------------------------------------------------------------------
-
- /**
- * Decrypts, verifies, and inflates a fragment received. The fragment is
- * just the data field of a text object, without the version, type, and
- * length fields. An exception is thrown if any step fails.
- *
- * @param fragment The fragment being decrypted.
- * @param version The version field of the received text.
- * @param type The type field of the received text.
- * @return The decrypted fragment.
- * @throws MacException If the MAC could not be verified, or if the padding
- * on the decrypted fragment is incorrect.
- * @throws OverflowException If the processed text overflows the configured
- * maximum fragment size.
- * @throws SSLException If any other error occurs.
- */
- byte[] decrypt (byte[] fragment, ProtocolVersion version, ContentType type)
- throws MacException, OverflowException, SSLException;
-
- /**
- * Deflates, authenticates, and encrypts a fragment to be sent.
- *
- * @param buf The fragment being encrypted.
- * @param off The offset into the buffer to start at.
- * @param len The number of bytes in this fragment.
- * @param type The content type of this text.
- * @return The encrypted fragment.
- * @throws OverflowException If deflating increases the size of the fragment
- * too much.
- * @throws SSLException If any other error occurs.
- */
- byte[] encrypt (byte[] buf, int off, int len, ContentType type)
- throws OverflowException, SSLException;
-
- /**
- * Set all crypto primitives to <code>null</code>, meaning that any calls
- * to {@link #encrypt(byte[],int,int,org.metastatic.jessie.provider.ContentType)} or
- * {@link #decrypt(byte[],org.metastatic.jessie.provider.ProtocolVersion,org.metastatic.jessie.provider.ContentType})
- * will perform the identity transformation.
- */
- void reset();
-
- /**
- * Returns the version of texts being sent.
- *
- * @return The version.
- */
- ProtocolVersion getVersion();
-
- /**
- * Sets the version of texts being sent. This affects the {@link
- * #encrypt(byte[],int,int,org.metastatic.jessie.provider.ContentType)}
- * method.
- *
- * @param version The version to set.
- */
- void setVersion (ProtocolVersion version);
-
- /**
- * Turns zlib deflating on or off.
- *
- * @param deflate Whether or not to deflate outgoing fragments.
- */
- void setDeflating (boolean deflate);
-
- /**
- * Turns zlib inflating on or off.
- *
- * @param inflate Whether or not to inflate incoming fragments.
- */
- void setInflating (boolean inflate);
-
- /**
- * Returns the maximum size that plaintext fragments may be.
- *
- * @return The fragment length.
- */
- int getFragmentLength();
-
- /**
- * Sets the maximum size that plaintext fragments may be.
- *
- * @param fragmentLength The new fragment length.
- */
- void setFragmentLength (int fragmentLength);
-
- /**
- * Set the cipher used to decrypt incoming fragments. The parameter must be
- * appropriate for the implementation.
- *
- * @param cipher The cipher.
- * @throws ClassCastException If the argument is not appropriate for the
- * implementation.
- */
- void setInCipher (Object cipher);
-
- /**
- * Set the cipher used to encrypt outgoing fragments. The parameter must be
- * appropriate for the implementation.
- *
- * @param cipher The cipher.
- * @throws ClassCastException If the argument is not appropriate for the
- * implementation.
- */
- void setOutCipher (Object cipher);
-
- /**
- * Set the MAC used to verify incoming fragments. The parameter must be
- * appropriate for the implementation.
- *
- * @param mac The MAC.
- * @throws ClassCastException If the argument is not appropriate for the
- * implementation.
- */
- void setInMac (Object mac);
-
- /**
- * Set the MAC used to authenticating outgoinging fragments. The parameter
- * must be appropriate for the implementation.
- *
- * @param mac The MAC.
- * @throws ClassCastException If the argument is not appropriate for the
- * implementation.
- */
- void setOutMac (Object mac);
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ServerDHE_PSKParameters.java b/libjava/classpath/gnu/javax/net/ssl/provider/ServerDHE_PSKParameters.java
new file mode 100644
index 00000000000..edc3ac259cb
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ServerDHE_PSKParameters.java
@@ -0,0 +1,151 @@
+/* ServerDHE_PSKParameters.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.classpath.debug.Component;
+import gnu.classpath.debug.SystemLogger;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.charset.Charset;
+
+/**
+ * <pre>
+ struct {
+ select (KeyExchangeAlgorithm) {
+ /* other cases for rsa, diffie_hellman, etc. &#42;/
+ case diffie_hellman_psk: /* NEW &#42;/
+ opaque psk_identity_hint&lt;0..2^16-1&gt;;
+ ServerDHParams params;
+ };
+ } ServerKeyExchange;</pre>
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class ServerDHE_PSKParameters implements Constructed, Builder, ServerKeyExchangeParams
+{
+ private ByteBuffer buffer;
+
+ public ServerDHE_PSKParameters(ByteBuffer buffer)
+ {
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ }
+
+ public ServerDHE_PSKParameters(String identityHint, ServerDHParams dhParams)
+ {
+ this(identityHint, dhParams.buffer());
+ }
+
+ public ServerDHE_PSKParameters(String identityHint, ByteBuffer dhParams)
+ {
+ Charset utf8 = Charset.forName("UTF-8");
+ ByteBuffer hintBuf = utf8.encode(identityHint);
+ buffer = ByteBuffer.allocate(2 + hintBuf.remaining() + dhParams.remaining());
+ buffer.putShort((short) hintBuf.remaining());
+ buffer.put(hintBuf);
+ buffer.put(dhParams);
+ }
+
+ public KeyExchangeAlgorithm algorithm()
+ {
+ return KeyExchangeAlgorithm.DHE_PSK;
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Constructed#length()
+ */
+ public int length()
+ {
+ return (buffer.getShort(0) & 0xFFFF) + 2 + params().length();
+ }
+
+ private int hintLength()
+ {
+ return (buffer.getShort(0) & 0xFFFF) + 2;
+ }
+
+ public String identityHint()
+ {
+ Charset utf8 = Charset.forName("UTF-8");
+ return utf8.decode((ByteBuffer) buffer.duplicate().position(2).limit
+ (hintLength())).toString();
+ }
+
+ public ServerDHParams params()
+ {
+ return new ServerDHParams(((ByteBuffer) buffer.duplicate().position
+ (hintLength()).limit(buffer.capacity())).slice());
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Builder#buffer()
+ */
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().rewind().limit(length());
+ }
+
+ public @Override String toString()
+ {
+ return toString(null);
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Constructed#toString(java.lang.String)
+ */
+ public String toString(String prefix)
+ {
+ StringWriter str = new StringWriter();
+ PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print(prefix);
+ out.println("struct {");
+ if (prefix != null) out.print(prefix);
+ out.print(" identity_hint = ");
+ out.print(identityHint());
+ out.println(";");
+ if (prefix != null) out.print(prefix);
+ out.println(" params =");
+ out.println(params().toString(prefix != null ? prefix + " " : " "));
+ if (prefix != null) out.print(prefix);
+ out.print("} ServerDHE_PSKParameters;");
+ return str.toString();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ServerDHParams.java b/libjava/classpath/gnu/javax/net/ssl/provider/ServerDHParams.java
new file mode 100644
index 00000000000..55d4a41da94
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ServerDHParams.java
@@ -0,0 +1,248 @@
+/* ServerDHParams.java -- The server's Diffie-Hellman parameters.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.math.BigInteger;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+/**
+ * The server's Diffie-Hellman parameters message.
+ *
+ * <pre>
+struct
+{
+ opaque dh_p&lt;1..2^16-1&gt;;
+ opaque dh_g&lt;1..2^16-1&gt;;
+ opaque dh_Ys&lt;1..2^16-1&gt;;
+} ServerDHParams;
+</pre>
+ */
+public class ServerDHParams implements Builder, ServerKeyExchangeParams
+{
+ private final ByteBuffer buffer;
+
+ public ServerDHParams (final ByteBuffer buffer)
+ {
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ }
+
+ public ServerDHParams (final BigInteger p, final BigInteger g,
+ final BigInteger y)
+ {
+ byte[] p_bytes = p.toByteArray();
+ byte[] g_bytes = g.toByteArray();
+ byte[] y_bytes = y.toByteArray();
+ int len = p_bytes.length + g_bytes.length + y_bytes.length + 6;
+
+ int p_off = 0;
+ if (p_bytes[0] == 0x00)
+ {
+ p_off = 1;
+ len--;
+ }
+ int g_off = 0;
+ if (g_bytes[0] == 0x00)
+ {
+ g_off = 1;
+ len--;
+ }
+ int y_off = 0;
+ if (y_bytes[0] == 0x00)
+ {
+ y_off = 1;
+ len--;
+ }
+ int p_len = p_bytes.length - p_off;
+ int g_len = g_bytes.length - g_off;
+ int y_len = y_bytes.length - y_off;
+
+ buffer = ByteBuffer.allocate(len);
+ buffer.putShort((short) p_len);
+ buffer.put(p_bytes, p_off, p_len);
+ buffer.putShort((short) g_len);
+ buffer.put(g_bytes, g_off, g_len);
+ buffer.putShort((short) y_len);
+ buffer.put(y_bytes, y_off, y_len);
+ }
+
+ @Deprecated public KeyExchangeAlgorithm algorithm ()
+ {
+ return null; // XXX can't support this.
+ }
+
+ public int length ()
+ {
+ int offset1 = buffer.getShort (0) & 0xFFFF;
+ int offset2 = buffer.getShort (offset1 + 2) & 0xFFFF;
+ return ((buffer.getShort (offset1 + offset2 + 4) & 0xFFFF)
+ + offset1 + offset2 + 6);
+ }
+
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().position(0).limit(length());
+ }
+
+ /**
+ * Returns the server's prime modulus.
+ *
+ * @return p.
+ */
+ public BigInteger p ()
+ {
+ int len = buffer.getShort (0) & 0xFFFF;
+ byte[] buf = new byte[len];
+ buffer.position (2);
+ buffer.get (buf);
+ return new BigInteger (1, buf);
+ }
+
+ /**
+ * Returns the server's generator value.
+ *
+ * @return g.
+ */
+ public BigInteger g ()
+ {
+ int off = (buffer.getShort (0) & 0xFFFF) + 2;
+ int len = buffer.getShort (off) & 0xFFFF;
+ byte[] buf = new byte[len];
+ buffer.position (off + 2);
+ buffer.get (buf);
+ return new BigInteger (1, buf);
+ }
+
+ /**
+ * Returns the server's public value.
+ *
+ * @return Y.
+ */
+ public BigInteger y ()
+ {
+ int offset1 = (buffer.getShort (0) & 0xFFFF) + 2;
+ int offset2 = (buffer.getShort (offset1) & 0xFFFF) + offset1 + 2;
+ int len = buffer.getShort (offset2) & 0xFFFF;
+ byte[] buf = new byte[len];
+ buffer.position (offset2 + 2);
+ buffer.get (buf);
+ return new BigInteger (1, buf);
+ }
+
+ /**
+ * Sets the server's prime modulus, p.
+ *
+ * @param p The p parameter.
+ * @throws java.nio.ReadOnlyBufferException If the underlying buffer
+ * is not writeable.
+ */
+ public void setP (final BigInteger p)
+ {
+ byte[] buf = p.toByteArray ();
+ int length = (buf[0] == 0x00 ? buf.length - 1 : buf.length);
+ int offset = (buf[0] == 0x00 ? 1 : 0);
+ buffer.putShort (0, (short) length);
+ buffer.position (2);
+ buffer.put (buf, offset, length);
+ }
+
+ /**
+ * Sets the server's generator value, g.
+ *
+ * @param g The g parameter.
+ * @throws java.nio.ReadOnlyBufferException If the underlying buffer
+ * is not writeable.
+ */
+ public void setG (final BigInteger g)
+ {
+ byte[] buf = g.toByteArray ();
+ int length = (buf[0] == 0x00 ? buf.length -1 : buf.length);
+ int offset = (buf[0] == 0x00 ? 1 : 0);
+ int where = (buffer.getShort (0) & 0xFFFF) + 2;
+ buffer.putShort (where, (short) length);
+ buffer.position (where + 2);
+ buffer.put (buf, offset, length);
+ }
+
+ /**
+ * Sets the server's public value, Y.
+ *
+ * @param y The Y parameter.
+ * @throws java.nio.ReadOnlyBufferException If the underlying buffer
+ * is not writeable.
+ */
+ public void setY (final BigInteger y)
+ {
+ int offset1 = (buffer.getShort (0) & 0xFFFF) + 2;
+ int offset2 = (buffer.getShort (offset1) & 0xFFFF) + offset1 + 2;
+ byte[] buf = y.toByteArray ();
+ int length = (buf[0] == 0x00 ? buf.length -1 : buf.length);
+ int offset = (buf[0] == 0x00 ? 1 : 0);
+ buffer.putShort (offset2, (short) length);
+ buffer.position (offset2 + 2);
+ buffer.put (buf, offset, length);
+ }
+
+ public String toString ()
+ {
+ return toString (null);
+ }
+
+ public String toString (final String prefix)
+ {
+ StringWriter str = new StringWriter ();
+ PrintWriter out = new PrintWriter (str);
+ if (prefix != null) out.print (prefix);
+ out.println ("struct {");
+ if (prefix != null) out.print (prefix);
+ out.print (" dh_p: ");
+ out.println (p ().toString (16));
+ if (prefix != null) out.print (prefix);
+ out.print (" dh_g: ");
+ out.println (g ().toString (16));
+ if (prefix != null) out.print (prefix);
+ out.print (" dh_Ys: ");
+ out.println (y ().toString (16));
+ if (prefix != null) out.print (prefix);
+ out.print ("} ServerDHParams;");
+ return str.toString ();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ServerHandshake.java b/libjava/classpath/gnu/javax/net/ssl/provider/ServerHandshake.java
new file mode 100644
index 00000000000..300012a4b30
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ServerHandshake.java
@@ -0,0 +1,1377 @@
+/* ServerHandshake.java -- the server-side handshake.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import static gnu.javax.net.ssl.provider.Handshake.Type.*;
+import static gnu.javax.net.ssl.provider.KeyExchangeAlgorithm.*;
+import static gnu.javax.net.ssl.provider.ServerHandshake.State.*;
+
+import gnu.classpath.debug.Component;
+import gnu.java.security.action.GetSecurityPropertyAction;
+import gnu.javax.crypto.key.dh.GnuDHPublicKey;
+import gnu.javax.net.ssl.AbstractSessionContext;
+import gnu.javax.net.ssl.Session;
+import gnu.javax.net.ssl.provider.Alert.Description;
+import gnu.javax.net.ssl.provider.CertificateRequest.ClientCertificateType;
+
+import java.nio.ByteBuffer;
+
+import java.security.AccessController;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.InvalidKeyException;
+import java.security.KeyManagementException;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.Principal;
+import java.security.PrivateKey;
+import java.security.SignatureException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.zip.Deflater;
+import java.util.zip.Inflater;
+
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.SecretKey;
+import javax.crypto.interfaces.DHPrivateKey;
+import javax.crypto.interfaces.DHPublicKey;
+import javax.crypto.spec.DHParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import javax.net.ssl.SSLException;
+import javax.net.ssl.SSLPeerUnverifiedException;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.X509ExtendedKeyManager;
+import javax.net.ssl.SSLEngineResult.HandshakeStatus;
+import javax.security.auth.x500.X500Principal;
+
+class ServerHandshake extends AbstractHandshake
+{
+ /**
+ * Handshake state enumeration.
+ */
+ static enum State
+ {
+ WRITE_HELLO_REQUEST (true, false),
+ WRITE_SERVER_HELLO (true, false),
+ WRITE_CERTIFICATE (true, false),
+ WRITE_SERVER_KEY_EXCHANGE (true, false),
+ WRITE_CERTIFICATE_REQUEST (true, false),
+ WRITE_SERVER_HELLO_DONE (true, false),
+ WRITE_FINISHED (true, false),
+ READ_CLIENT_HELLO (false, true),
+ READ_CERTIFICATE (false, true),
+ READ_CLIENT_KEY_EXCHANGE (false, true),
+ READ_CERTIFICATE_VERIFY (false, true),
+ READ_FINISHED (false, true),
+ DONE (false, false);
+
+ private final boolean isWriteState;
+ private final boolean isReadState;
+
+ private State(final boolean isWriteState, final boolean isReadState)
+ {
+ this.isWriteState = isWriteState;
+ this.isReadState = isReadState;
+ }
+
+ boolean isReadState()
+ {
+ return isReadState;
+ }
+
+ boolean isWriteState()
+ {
+ return isWriteState;
+ }
+ }
+
+ private State state;
+
+ /* Handshake result fields. */
+ private ByteBuffer outBuffer;
+ private boolean clientHadExtensions = false;
+ private boolean continuedSession = false;
+ private ServerNameList requestedNames = null;
+ private String keyAlias = null;
+ private X509Certificate clientCert = null;
+ private X509Certificate localCert = null;
+ private boolean helloV2 = false;
+ private KeyPair dhPair;
+ private PrivateKey serverKey;
+
+ // Delegated tasks we use.
+ private GenDH genDH;
+ private CertVerifier certVerifier;
+ private CertLoader certLoader;
+ private DelegatedTask keyExchangeTask;
+
+ ServerHandshake (boolean writeHelloRequest, final SSLEngineImpl engine)
+ throws NoSuchAlgorithmException
+ {
+ super(engine);
+ if (writeHelloRequest)
+ state = WRITE_HELLO_REQUEST;
+ else
+ state = READ_CLIENT_HELLO;
+ handshakeOffset = 0;
+ }
+
+ /**
+ * Choose the protocol version. Here we choose the largest protocol
+ * version we support that is not greater than the client's
+ * requested version.
+ */
+ private static ProtocolVersion chooseProtocol (final ProtocolVersion clientVersion,
+ final String[] enabledVersions)
+ throws SSLException
+ {
+ ProtocolVersion version = null;
+ for (int i = 0; i < enabledVersions.length; i++)
+ {
+ ProtocolVersion v = ProtocolVersion.forName (enabledVersions[i]);
+ if (v.compareTo (clientVersion) <= 0)
+ {
+ if (version == null
+ || v.compareTo (version) > 0)
+ version = v;
+ }
+ }
+
+ // The client requested a protocol version too old, or no protocol
+ // versions are enabled.
+ if (version == null)
+ throw new SSLException ("no acceptable protocol version available");
+ return version;
+ }
+
+ /**
+ * Choose the first cipher suite in the client's requested list that
+ * we have enabled.
+ */
+ private CipherSuite chooseSuite (final CipherSuiteList clientSuites,
+ final String[] enabledSuites,
+ final ProtocolVersion version)
+ throws SSLException
+ {
+ // Figure out which SignatureAlgorithms we can support.
+ HashSet<KeyExchangeAlgorithm> kexes = new HashSet<KeyExchangeAlgorithm>(8);
+
+ kexes.add(NONE);
+ X509ExtendedKeyManager km = engine.contextImpl.keyManager;
+ if (km != null)
+ {
+ if (km.getServerAliases(DH_DSS.name(), null).length > 0)
+ kexes.add(DH_DSS);
+ if (km.getServerAliases(DH_RSA.name(), null).length > 0)
+ kexes.add(DH_RSA);
+ if (km.getServerAliases(DHE_DSS.name(), null).length > 0)
+ kexes.add(DHE_DSS);
+ if (km.getServerAliases(DHE_RSA.name(), null).length > 0)
+ kexes.add(DHE_RSA);
+ if (km.getServerAliases(RSA.name(), null).length > 0)
+ kexes.add(RSA);
+ if (km.getServerAliases(RSA_PSK.name(), null).length > 0
+ && engine.contextImpl.pskManager != null)
+ kexes.add(RSA_PSK);
+ }
+ if (engine.contextImpl.pskManager != null)
+ {
+ kexes.add(DHE_PSK);
+ kexes.add(PSK);
+ }
+
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE,
+ "we have certs for key exchange algorithms {0}", kexes);
+
+ HashSet<CipherSuite> suites = new HashSet<CipherSuite>();
+ for (String s : enabledSuites)
+ {
+ CipherSuite suite = CipherSuite.forName(s);
+ if (suite == null)
+ continue;
+ if (!kexes.contains(suite.keyExchangeAlgorithm()))
+ continue;
+ suites.add(suite);
+ }
+ for (CipherSuite suite : clientSuites)
+ {
+ CipherSuite resolved = suite.resolve();
+ if (!resolved.isResolved())
+ continue;
+ if (suites.contains(resolved))
+ return resolved;
+ }
+
+ // We didn't find a match?
+ throw new AlertException(new Alert(Alert.Level.FATAL,
+ Alert.Description.INSUFFICIENT_SECURITY));
+ }
+
+ /**
+ * Choose a compression method that we support, among the client's
+ * requested compression methods. We prefer ZLIB over NONE in this
+ * implementation.
+ *
+ * XXX Maybe consider implementing lzo (GNUTLS supports that).
+ */
+ private static CompressionMethod chooseCompression (final CompressionMethodList comps)
+ throws SSLException
+ {
+ GetSecurityPropertyAction gspa
+ = new GetSecurityPropertyAction("jessie.enable.compression");
+ String enable = AccessController.doPrivileged(gspa);
+ // Scan for ZLIB first.
+ if (Boolean.valueOf(enable))
+ {
+ for (CompressionMethod cm : comps)
+ {
+ if (cm.equals (CompressionMethod.ZLIB))
+ return CompressionMethod.ZLIB;
+ }
+ }
+ for (CompressionMethod cm : comps)
+ {
+ if (cm.equals (CompressionMethod.NULL))
+ return CompressionMethod.NULL;
+ }
+
+ throw new SSLException ("no supported compression method");
+ }
+
+ protected @Override boolean doHash()
+ {
+ boolean b = helloV2;
+ helloV2 = false;
+ return (state != WRITE_HELLO_REQUEST) && !b;
+ }
+
+ public @Override HandshakeStatus implHandleInput()
+ throws SSLException
+ {
+ if (state == DONE)
+ return HandshakeStatus.FINISHED;
+
+ if (state.isWriteState()
+ || (outBuffer != null && outBuffer.hasRemaining()))
+ return HandshakeStatus.NEED_WRAP;
+
+ // Copy the current buffer, and prepare it for reading.
+ ByteBuffer buffer = handshakeBuffer.duplicate ();
+ buffer.flip();
+ buffer.position(handshakeOffset);
+ Handshake handshake = new Handshake(buffer.slice(),
+ engine.session().suite,
+ engine.session().version);
+
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "processing in state {0}:\n{1}",
+ state, handshake);
+
+ switch (state)
+ {
+ // Client Hello.
+ //
+ // This message is sent by the client to initiate a new handshake.
+ // On a new connection, it is the first handshake message sent.
+ //
+ // The state of the handshake, after this message is processed,
+ // will have a protocol version, cipher suite, compression method,
+ // session ID, and various extensions (that the server also
+ // supports).
+ case READ_CLIENT_HELLO:
+ if (handshake.type () != CLIENT_HELLO)
+ throw new AlertException(new Alert(Alert.Level.FATAL,
+ Alert.Description.UNEXPECTED_MESSAGE));
+
+ {
+ ClientHello hello = (ClientHello) handshake.body ();
+ engine.session().version
+ = chooseProtocol (hello.version (),
+ engine.getEnabledProtocols ());
+ engine.session().suite =
+ chooseSuite (hello.cipherSuites (),
+ engine.getEnabledCipherSuites (),
+ engine.session().version);
+ compression = chooseCompression (hello.compressionMethods ());
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE,
+ "chose version:{0} suite:{1} compression:{2}",
+ engine.session().version, engine.session().suite,
+ compression);
+ clientRandom = hello.random().copy();
+ byte[] sessionId = hello.sessionId();
+ if (hello.hasExtensions())
+ {
+ ExtensionList exts = hello.extensions();
+ clientHadExtensions = exts.size() > 0;
+ for (Extension e : hello.extensions())
+ {
+ Extension.Type type = e.type();
+ if (type == null)
+ continue;
+ switch (type)
+ {
+ case TRUNCATED_HMAC:
+ engine.session().setTruncatedMac(true);
+ break;
+
+ case MAX_FRAGMENT_LENGTH:
+ MaxFragmentLength len = (MaxFragmentLength) e.value();
+ engine.session().maxLength = len;
+ engine.session().setApplicationBufferSize(len.maxLength());
+ break;
+
+ case SERVER_NAME:
+ requestedNames = (ServerNameList) e.value();
+ List<String> names
+ = new ArrayList<String>(requestedNames.size());
+ for (ServerNameList.ServerName name : requestedNames)
+ names.add(name.name());
+ engine.session().putValue("gnu.javax.net.ssl.RequestedServerNames", names);
+ break;
+
+ default:
+ logger.log(Level.INFO, "skipping unsupported extension {0}", e);
+ }
+ }
+ }
+ AbstractSessionContext sessions = (AbstractSessionContext)
+ engine.contextImpl.engineGetServerSessionContext();
+ SSLSession s = sessions.getSession(sessionId);
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "looked up saved session {0}", s);
+ if (s != null && s.isValid() && (s instanceof SessionImpl))
+ {
+ engine.setSession((SessionImpl) s);
+ continuedSession = true;
+ }
+ else
+ {
+ // We *may* wind up with a badly seeded PRNG, and emit the
+ // same session ID over and over (this did happen to me,
+ // so we add this sanity check just in case).
+ if (engine.session().id().equals(new Session.ID(sessionId)))
+ {
+ byte[] newId = new byte[32];
+ engine.session().random().nextBytes(newId);
+ engine.session().setId(new Session.ID(newId));
+ }
+ sessions.put(engine.session());
+ }
+ state = WRITE_SERVER_HELLO;
+ }
+ break;
+
+ // Certificate.
+ //
+ // This message is sent by the client if the server had previously
+ // requested that the client authenticate itself with a certificate,
+ // and if the client has an appropriate certificate available.
+ //
+ // Processing this message will save the client's certificate,
+ // rejecting it if the certificate is not trusted, in preparation
+ // for the certificate verify message that will follow.
+ case READ_CERTIFICATE:
+ {
+ if (handshake.type() != CERTIFICATE)
+ {
+ if (engine.getNeedClientAuth()) // XXX throw better exception.
+ throw new SSLException("client auth required");
+ state = READ_CLIENT_KEY_EXCHANGE;
+ return HandshakeStatus.NEED_UNWRAP;
+ }
+
+ Certificate cert = (Certificate) handshake.body();
+ try
+ {
+ engine.session().setPeerVerified(false);
+ X509Certificate[] chain
+ = cert.certificates().toArray(new X509Certificate[0]);
+ if (chain.length == 0)
+ throw new CertificateException("no certificates in chain");
+ certVerifier = new CertVerifier(false, chain);
+ tasks.add(certVerifier);
+ engine.session().setPeerCertificates(chain);
+ clientCert = chain[0];
+ // Delay setting 'peerVerified' until CertificateVerify.
+ }
+ catch (CertificateException ce)
+ {
+ if (engine.getNeedClientAuth())
+ {
+ SSLPeerUnverifiedException x
+ = new SSLPeerUnverifiedException("client certificates could not be verified");
+ x.initCause(ce);
+ throw x;
+ }
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ throw new SSLException(nsae);
+ }
+ state = READ_CLIENT_KEY_EXCHANGE;
+ }
+ break;
+
+ // Client Key Exchange.
+ //
+ // The client's key exchange. This message is sent either following
+ // the certificate message, or if no certificate is available or
+ // requested, following the server's hello done message.
+ //
+ // After receipt of this message, the session keys for this
+ // session will have been created.
+ case READ_CLIENT_KEY_EXCHANGE:
+ {
+ if (handshake.type() != CLIENT_KEY_EXCHANGE)
+ throw new SSLException("expecting client key exchange");
+ ClientKeyExchange kex = (ClientKeyExchange) handshake.body();
+
+ KeyExchangeAlgorithm alg = engine.session().suite.keyExchangeAlgorithm();
+ switch (alg)
+ {
+ case DHE_DSS:
+ case DHE_RSA:
+ case DH_anon:
+ {
+ ClientDiffieHellmanPublic pub = (ClientDiffieHellmanPublic)
+ kex.exchangeKeys();
+ DHPublicKey myKey = (DHPublicKey) dhPair.getPublic();
+ DHPublicKey clientKey =
+ new GnuDHPublicKey(null, myKey.getParams().getP(),
+ myKey.getParams().getG(),
+ pub.publicValue());
+ keyExchangeTask = new DHPhase(clientKey);
+ tasks.add(keyExchangeTask);
+ }
+ break;
+
+ case RSA:
+ {
+ EncryptedPreMasterSecret secret = (EncryptedPreMasterSecret)
+ kex.exchangeKeys();
+ keyExchangeTask = new RSAKeyExchange(secret.encryptedSecret());
+ tasks.add(keyExchangeTask);
+ }
+ break;
+
+ case PSK:
+ {
+ ClientPSKParameters params = (ClientPSKParameters)
+ kex.exchangeKeys();
+ generatePSKSecret(params.identity(), null, false);
+ }
+ break;
+
+ case DHE_PSK:
+ {
+ ClientDHE_PSKParameters params = (ClientDHE_PSKParameters)
+ kex.exchangeKeys();
+ DHPublicKey serverKey = (DHPublicKey) dhPair.getPublic();
+ DHPublicKey clientKey =
+ new GnuDHPublicKey(null, serverKey.getParams().getP(),
+ serverKey.getParams().getG(),
+ params.params().publicValue());
+ SecretKey psk = null;
+ try
+ {
+ psk = engine.contextImpl.pskManager.getKey(params.identity());
+ }
+ catch (KeyManagementException kme)
+ {
+ }
+ keyExchangeTask = new DHE_PSKGen(clientKey, psk, false);
+ tasks.add(keyExchangeTask);
+ }
+ break;
+
+ case RSA_PSK:
+ {
+ ClientRSA_PSKParameters params = (ClientRSA_PSKParameters)
+ kex.exchangeKeys();
+ SecretKey psk = null;
+ try
+ {
+ psk = engine.contextImpl.pskManager.getKey(params.identity());
+ }
+ catch (KeyManagementException kme)
+ {
+ }
+ if (psk == null)
+ {
+ byte[] fakeKey = new byte[16];
+ engine.session().random().nextBytes(fakeKey);
+ psk = new SecretKeySpec(fakeKey, "DHE_PSK");
+ }
+ keyExchangeTask =
+ new RSA_PSKExchange(params.secret().encryptedSecret(), psk);
+ tasks.add(keyExchangeTask);
+ }
+ break;
+
+ case NONE:
+ {
+ Inflater inflater = null;
+ Deflater deflater = null;
+ if (compression == CompressionMethod.ZLIB)
+ {
+ inflater = new Inflater();
+ deflater = new Deflater();
+ }
+ inParams = new InputSecurityParameters(null, null, inflater,
+ engine.session(),
+ engine.session().suite);
+ outParams = new OutputSecurityParameters(null, null, deflater,
+ engine.session(),
+ engine.session().suite);
+ engine.session().privateData.masterSecret = new byte[0];
+ }
+ break;
+ }
+ // XXX SRP
+
+ if (clientCert != null)
+ state = READ_CERTIFICATE_VERIFY;
+ else
+ state = READ_FINISHED;
+ }
+ break;
+
+ // Certificate Verify.
+ //
+ // This message is sent following the client key exchange message,
+ // but only when the client included its certificate in a previous
+ // message.
+ //
+ // After receipt of this message, the client's certificate (and,
+ // to a degree, the client's identity) will have been verified.
+ case READ_CERTIFICATE_VERIFY:
+ {
+ if (handshake.type() != CERTIFICATE_VERIFY)
+ throw new SSLException("expecting certificate verify message");
+
+ CertificateVerify verify = (CertificateVerify) handshake.body();
+ try
+ {
+ verifyClient(verify.signature());
+ if (certVerifier != null && certVerifier.verified())
+ engine.session().setPeerVerified(true);
+ }
+ catch (SignatureException se)
+ {
+ if (engine.getNeedClientAuth())
+ throw new SSLException("client auth failed", se);
+ }
+ if (continuedSession)
+ {
+ engine.changeCipherSpec();
+ state = WRITE_FINISHED;
+ }
+ else
+ state = READ_FINISHED;
+ }
+ break;
+
+ // Finished.
+ //
+ // This message is sent immediately following the change cipher
+ // spec message (which is sent outside of the handshake layer).
+ // After receipt of this message, the session keys for the client
+ // side will have been verified (this is the first message the
+ // client sends encrypted and authenticated with the newly
+ // negotiated keys).
+ //
+ // In the case of a continued session, the client sends its
+ // finished message first. Otherwise, the server will send its
+ // finished message first.
+ case READ_FINISHED:
+ {
+ if (handshake.type() != FINISHED)
+ throw new AlertException(new Alert(Alert.Level.FATAL,
+ Description.UNEXPECTED_MESSAGE));
+
+ Finished clientFinished = (Finished) handshake.body();
+
+ MessageDigest md5copy = null;
+ MessageDigest shacopy = null;
+ try
+ {
+ md5copy = (MessageDigest) md5.clone();
+ shacopy = (MessageDigest) sha.clone();
+ }
+ catch (CloneNotSupportedException cnse)
+ {
+ // We're improperly configured to use a non-cloneable
+ // md5/sha-1, OR there's a runtime bug.
+ throw new SSLException(cnse);
+ }
+ Finished serverFinished =
+ new Finished(generateFinished(md5copy, shacopy,
+ true, engine.session()),
+ engine.session().version);
+
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_HANDSHAKE, "server finished: {0}",
+ serverFinished);
+
+ if (engine.session().version == ProtocolVersion.SSL_3)
+ {
+ if (!Arrays.equals(clientFinished.md5Hash(),
+ serverFinished.md5Hash())
+ || !Arrays.equals(clientFinished.shaHash(),
+ serverFinished.shaHash()))
+ {
+ engine.session().invalidate();
+ throw new SSLException("session verify failed");
+ }
+ }
+ else
+ {
+ if (!Arrays.equals(clientFinished.verifyData(),
+ serverFinished.verifyData()))
+ {
+ engine.session().invalidate();
+ throw new SSLException("session verify failed");
+ }
+ }
+
+ if (continuedSession)
+ state = DONE;
+ else
+ {
+ engine.changeCipherSpec();
+ state = WRITE_FINISHED;
+ }
+ }
+ break;
+ }
+
+ handshakeOffset += handshake.length() + 4;
+
+ if (!tasks.isEmpty())
+ return HandshakeStatus.NEED_TASK;
+ if (state.isReadState())
+ return HandshakeStatus.NEED_UNWRAP;
+ if (state.isWriteState())
+ return HandshakeStatus.NEED_WRAP;
+
+ return HandshakeStatus.FINISHED;
+ }
+
+ public @Override HandshakeStatus implHandleOutput (ByteBuffer fragment)
+ throws SSLException
+ {
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE,
+ "handle output state: {0}; output fragment: {1}",
+ state, fragment);
+
+ // Drain the output buffer, if it needs it.
+ if (outBuffer != null && outBuffer.hasRemaining())
+ {
+ int l = Math.min(fragment.remaining(), outBuffer.remaining());
+ fragment.put((ByteBuffer) outBuffer.duplicate().limit(outBuffer.position() + l));
+ outBuffer.position(outBuffer.position() + l);
+ }
+
+ if (!fragment.hasRemaining())
+ {
+ if (state.isWriteState() || outBuffer.hasRemaining())
+ return HandshakeStatus.NEED_WRAP;
+ else
+ return HandshakeStatus.NEED_UNWRAP;
+ }
+
+ // XXX what we need to do here is generate a "stream" of handshake
+ // messages, and insert them into fragment amounts that we have available.
+ // A handshake message can span multiple records, and we can put
+ // multiple records into a single record.
+ //
+ // So, we can have one of two states:
+ //
+ // 1) We have enough space in the record we are creating to push out
+ // everything we need to on this round. This is easy; we just
+ // repeatedly fill in these messages in the buffer, so we get something
+ // that looks like this:
+ // ________________________________
+ // records: |________________________________|
+ // handshakes: |______|__|__________|
+ //
+ // 2) We can put part of one handshake message in the current record,
+ // but we must put the rest of it in the following record, or possibly
+ // more than one following record. So here, we'd see this:
+ //
+ // ________________________
+ // records: |_______|_______|________|
+ // handshakes: |____|_______|_________|
+ //
+ // We *could* make this a lot easier by just only ever emitting one
+ // record per call, but then we would waste potentially a lot of space
+ // and waste a lot of TCP packets by doing it the simple way. What
+ // we desire here is that we *maximize* our usage of the resources
+ // given to us, and to use as much space in the present fragment as
+ // we can.
+ //
+ // Note that we pretty much have to support this, anyway, because SSL
+ // provides no guarantees that the record size is large enough to
+ // admit *even one* handshake message. Also, callers could call on us
+ // with a short buffer, even though they aren't supposed to.
+ //
+ // This is somewhat complicated by the fact that we don't know, a priori,
+ // how large a handshake message will be until we've built it, and our
+ // design builds the message around the byte buffer.
+ //
+ // Some ways to handle this:
+ //
+ // 1. Write our outgoing handshake messages to a private buffer,
+ // big enough per message (and, if we run out of space, resize that
+ // buffer) and push (possibly part of) this buffer out to the
+ // outgoing buffer. This isn't that great because we'd need to
+ // store and copy things unnecessarily.
+ //
+ // 2. Build outgoing handshake objects “virtually,†that is, store them
+ // as collections of objects, then compute the length, and then write
+ // them to a buffer, instead of making the objects views on
+ // ByteBuffers for both input and output. This would complicate the
+ // protocol objects a bit (although, it would amount to doing
+ // separation between client objects and server objects, which is
+ // pretty OK), and we still need to figure out how exactly to chunk
+ // those objects across record boundaries.
+ //
+ // 3. Try to build these objects on the buffer we’re given, but detect
+ // when we run out of space in the output buffer, and split the
+ // overflow message. This sounds like the best, but also probably
+ // the hardest to code.
+output_loop:
+ while (fragment.remaining() >= 4 && state.isWriteState())
+ {
+ switch (state)
+ {
+ // Hello Request.
+ //
+ // This message is sent by the server to initiate a new
+ // handshake, to establish new session keys.
+ case WRITE_HELLO_REQUEST:
+ {
+ Handshake handshake = new Handshake(fragment);
+ handshake.setType(Handshake.Type.HELLO_REQUEST);
+ handshake.setLength(0);
+ fragment.position(fragment.position() + 4);
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_HANDSHAKE, "{0}", handshake);
+ state = READ_CLIENT_HELLO;
+ }
+ break output_loop; // XXX temporary
+
+ // Server Hello.
+ //
+ // This message is sent immediately following the client hello.
+ // It informs the client of the cipher suite, compression method,
+ // session ID (which may have been a continued session), and any
+ // supported extensions.
+ case WRITE_SERVER_HELLO:
+ {
+ ServerHelloBuilder hello = new ServerHelloBuilder();
+ hello.setVersion(engine.session().version);
+ Random r = hello.random();
+ r.setGmtUnixTime(Util.unixTime());
+ byte[] nonce = new byte[28];
+ engine.session().random().nextBytes(nonce);
+ r.setRandomBytes(nonce);
+ serverRandom = r.copy();
+ hello.setSessionId(engine.session().getId());
+ hello.setCipherSuite(engine.session().suite);
+ hello.setCompressionMethod(compression);
+ if (clientHadExtensions)
+ {
+ // XXX figure this out.
+ }
+ else // Don't send any extensions.
+ hello.setDisableExtensions(true);
+
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_HANDSHAKE, "{0}", hello);
+
+ int typeLen = ((Handshake.Type.SERVER_HELLO.getValue() << 24)
+ | (hello.length() & 0xFFFFFF));
+ fragment.putInt(typeLen);
+
+ outBuffer = hello.buffer();
+ int l = Math.min(fragment.remaining(), outBuffer.remaining());
+ fragment.put((ByteBuffer) outBuffer.duplicate().limit(outBuffer.position() + l));
+ outBuffer.position(outBuffer.position() + l);
+
+ CipherSuite cs = engine.session().suite;
+ KeyExchangeAlgorithm kex = cs.keyExchangeAlgorithm();
+ if (continuedSession)
+ {
+ byte[][] keys = generateKeys(clientRandom, serverRandom,
+ engine.session());
+ setupSecurityParameters(keys, false, engine, compression);
+ engine.changeCipherSpec();
+ state = WRITE_FINISHED;
+ }
+ else if (kex == DHE_DSS || kex == DHE_RSA || kex == RSA
+ || kex == RSA_PSK)
+ {
+ certLoader = new CertLoader();
+ tasks.add(certLoader);
+ state = WRITE_CERTIFICATE;
+ if (kex == DHE_DSS || kex == DHE_RSA)
+ {
+ genDH = new GenDH();
+ tasks.add(genDH);
+ }
+ break output_loop;
+ }
+ else if (kex == PSK)
+ {
+ state = WRITE_SERVER_KEY_EXCHANGE;
+ }
+ else if (kex == DHE_PSK || kex == DH_anon)
+ {
+ genDH = new GenDH();
+ tasks.add(genDH);
+ state = WRITE_SERVER_KEY_EXCHANGE;
+ break output_loop;
+ }
+ else if (engine.getWantClientAuth() || engine.getNeedClientAuth())
+ {
+ state = WRITE_CERTIFICATE_REQUEST;
+ }
+ else
+ state = WRITE_SERVER_HELLO_DONE;
+ }
+ break;
+
+ // Certificate.
+ //
+ // This message is sent immediately following the server hello,
+ // IF the cipher suite chosen requires that the server identify
+ // itself (usually, servers must authenticate).
+ case WRITE_CERTIFICATE:
+ {
+ // We must have scheduled a certificate loader to run.
+ assert(certLoader != null);
+ assert(certLoader.hasRun());
+ if (certLoader.thrown() != null)
+ throw new AlertException(new Alert(Alert.Level.FATAL,
+ Alert.Description.HANDSHAKE_FAILURE),
+ certLoader.thrown());
+ java.security.cert.Certificate[] chain
+ = engine.session().getLocalCertificates();
+ CertificateBuilder cert = new CertificateBuilder(CertificateType.X509);
+ try
+ {
+ cert.setCertificates(Arrays.asList(chain));
+ }
+ catch (CertificateException ce)
+ {
+ throw new SSLException(ce);
+ }
+
+ if (Debug.DEBUG)
+ {
+ logger.logv(Component.SSL_HANDSHAKE, "my cert:\n{0}", localCert);
+ logger.logv(Component.SSL_HANDSHAKE, "{0}", cert);
+ }
+
+ int typeLen = ((CERTIFICATE.getValue() << 24)
+ | (cert.length() & 0xFFFFFF));
+ fragment.putInt(typeLen);
+
+ outBuffer = cert.buffer();
+ final int l = Math.min(fragment.remaining(), outBuffer.remaining());
+ fragment.put((ByteBuffer) outBuffer.duplicate().limit(outBuffer.position() + l));
+ outBuffer.position(outBuffer.position() + l);
+
+ CipherSuite s = engine.session().suite;
+ KeyExchangeAlgorithm kexalg = s.keyExchangeAlgorithm();
+ if (kexalg == DHE_DSS || kexalg == DHE_RSA)
+ {
+ genDH = new GenDH();
+ tasks.add(genDH);
+ state = WRITE_SERVER_KEY_EXCHANGE;
+ break output_loop;
+ }
+ else if (kexalg == RSA_PSK)
+ state = WRITE_SERVER_KEY_EXCHANGE;
+ else if (engine.getWantClientAuth() || engine.getNeedClientAuth())
+ {
+ state = WRITE_CERTIFICATE_REQUEST;
+ }
+ else
+ state = WRITE_SERVER_HELLO_DONE;
+ }
+ break output_loop; // XXX temporary
+
+ // Server key exchange.
+ //
+ // This message is sent, following the certificate if sent,
+ // otherwise following the server hello, IF the chosen cipher
+ // suite requires that the server send explicit key exchange
+ // parameters (that is, if the key exchange parameters are not
+ // implicit in the server's certificate).
+ case WRITE_SERVER_KEY_EXCHANGE:
+ {
+ KeyExchangeAlgorithm kex = engine.session().suite.keyExchangeAlgorithm();
+
+ ByteBuffer paramBuffer = null;
+ ByteBuffer sigBuffer = null;
+ if (kex == DHE_DSS || kex == DHE_RSA || kex == DH_anon
+ || kex == DHE_PSK)
+ {
+ assert(genDH != null);
+ assert(genDH.hasRun());
+ if (genDH.thrown() != null)
+ throw new AlertException(new Alert(Alert.Level.FATAL,
+ Alert.Description.HANDSHAKE_FAILURE),
+ genDH.thrown());
+ assert(dhPair != null);
+ initDiffieHellman((DHPrivateKey) dhPair.getPrivate(),
+ engine.session().random());
+ paramBuffer = genDH.paramsBuffer;
+ sigBuffer = genDH.sigBuffer;
+
+ if (kex == DHE_PSK)
+ {
+ String identityHint
+ = engine.contextImpl.pskManager.chooseIdentityHint();
+ ServerDHE_PSKParameters psk =
+ new ServerDHE_PSKParameters(identityHint, paramBuffer);
+ paramBuffer = psk.buffer();
+ }
+ }
+ if (kex == RSA_PSK)
+ {
+ String idHint = engine.contextImpl.pskManager.chooseIdentityHint();
+ if (idHint != null)
+ {
+ ServerRSA_PSKParameters params
+ = new ServerRSA_PSKParameters(idHint);
+ paramBuffer = params.buffer();
+ }
+ }
+ if (kex == PSK)
+ {
+ String idHint = engine.contextImpl.pskManager.chooseIdentityHint();
+ if (idHint != null)
+ {
+ ServerPSKParameters params
+ = new ServerPSKParameters(idHint);
+ paramBuffer = params.buffer();
+ }
+ }
+ // XXX handle SRP
+
+ if (paramBuffer != null)
+ {
+ ServerKeyExchangeBuilder ske
+ = new ServerKeyExchangeBuilder(engine.session().suite);
+ ske.setParams(paramBuffer);
+ if (sigBuffer != null)
+ ske.setSignature(sigBuffer);
+
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_HANDSHAKE, "{0}", ske);
+
+ outBuffer = ske.buffer();
+ int l = Math.min(fragment.remaining(), outBuffer.remaining());
+ fragment.putInt((SERVER_KEY_EXCHANGE.getValue() << 24)
+ | (ske.length() & 0xFFFFFF));
+ fragment.put((ByteBuffer) outBuffer.duplicate().limit
+ (outBuffer.position() + l));
+ outBuffer.position(outBuffer.position() + l);
+ }
+
+ if (engine.getWantClientAuth() || engine.getNeedClientAuth())
+ state = WRITE_CERTIFICATE_REQUEST;
+ else
+ state = WRITE_SERVER_HELLO_DONE;
+ }
+ break;
+
+ // Certificate Request.
+ //
+ // This message is sent when the server desires or requires
+ // client authentication with a certificate; if it is sent, it
+ // will be sent just after the Certificate or Server Key
+ // Exchange messages, whichever is sent. If neither of the
+ // above are sent, it will be the message that follows the
+ // server hello.
+ case WRITE_CERTIFICATE_REQUEST:
+ {
+ CertificateRequestBuilder req = new CertificateRequestBuilder();
+
+ List<ClientCertificateType> types
+ = new ArrayList<ClientCertificateType>(4);
+ types.add(ClientCertificateType.RSA_SIGN);
+ types.add(ClientCertificateType.RSA_FIXED_DH);
+ types.add(ClientCertificateType.DSS_SIGN);
+ types.add(ClientCertificateType.DSS_FIXED_DH);
+ req.setTypes(types);
+
+ X509Certificate[] anchors
+ = engine.contextImpl.trustManager.getAcceptedIssuers();
+ List<X500Principal> issuers
+ = new ArrayList<X500Principal>(anchors.length);
+ for (X509Certificate cert : anchors)
+ issuers.add(cert.getIssuerX500Principal());
+ req.setAuthorities(issuers);
+
+ if (Debug.DEBUG)
+ logger.log(Component.SSL_HANDSHAKE, "{0}", req);
+
+ fragment.putInt((CERTIFICATE_REQUEST.getValue() << 24)
+ | (req.length() & 0xFFFFFF));
+
+ outBuffer = req.buffer();
+ int l = Math.min(outBuffer.remaining(), fragment.remaining());
+ fragment.put((ByteBuffer) outBuffer.duplicate().limit(outBuffer.position() + l));
+ outBuffer.position(outBuffer.position() + l);
+
+ state = WRITE_SERVER_HELLO_DONE;
+ }
+ break;
+
+ // Server Hello Done.
+ //
+ // This message is always sent by the server, to terminate its
+ // side of the handshake. Since the server's handshake message
+ // may comprise multiple, optional messages, this sentinel
+ // message lets the client know when the server's message stream
+ // is complete.
+ case WRITE_SERVER_HELLO_DONE:
+ {
+ // ServerHelloDone is zero-length; just put in the type
+ // field.
+ fragment.putInt(SERVER_HELLO_DONE.getValue() << 24);
+ if (Debug.DEBUG)
+ logger.logv(Component.SSL_HANDSHAKE, "writing ServerHelloDone");
+ state = READ_CERTIFICATE;
+ }
+ break output_loop; // XXX temporary
+
+ // Finished.
+ //
+ // This is always sent by the server to verify the keys that the
+ // server will use to encrypt and authenticate. In a full
+ // handshake, this message will be sent after the client's
+ // finished message; in an abbreviated handshake (with a continued
+ // session) the server sends its finished message first.
+ //
+ // This message follows the change cipher spec message, which is
+ // sent out-of-band in a different SSL content-type.
+ //
+ // This is the first message that the server will send encrypted
+ // and authenticated with the newly negotiated session keys.
+ case WRITE_FINISHED:
+ {
+ MessageDigest md5copy = null;
+ MessageDigest shacopy = null;
+ try
+ {
+ md5copy = (MessageDigest) md5.clone();
+ shacopy = (MessageDigest) sha.clone();
+ }
+ catch (CloneNotSupportedException cnse)
+ {
+ // We're improperly configured to use a non-cloneable
+ // md5/sha-1, OR there's a runtime bug.
+ throw new SSLException(cnse);
+ }
+ outBuffer
+ = generateFinished(md5copy, shacopy, false,
+ engine.session());
+
+ fragment.putInt((FINISHED.getValue() << 24)
+ | outBuffer.remaining() & 0xFFFFFF);
+
+ int l = Math.min(outBuffer.remaining(), fragment.remaining());
+ fragment.put((ByteBuffer) outBuffer.duplicate().limit(outBuffer.position() + l));
+ outBuffer.position(outBuffer.position() + l);
+
+ if (continuedSession)
+ state = READ_FINISHED;
+ else
+ state = DONE;
+ }
+ break;
+ }
+ }
+ if (!tasks.isEmpty())
+ return HandshakeStatus.NEED_TASK;
+ if (state.isWriteState() || outBuffer.hasRemaining())
+ return HandshakeStatus.NEED_WRAP;
+ if (state.isReadState())
+ return HandshakeStatus.NEED_UNWRAP;
+
+ return HandshakeStatus.FINISHED;
+ }
+
+ @Override HandshakeStatus status()
+ {
+ if (!tasks.isEmpty())
+ return HandshakeStatus.NEED_TASK;
+ if (state.isReadState())
+ return HandshakeStatus.NEED_UNWRAP;
+ if (state.isWriteState())
+ return HandshakeStatus.NEED_WRAP;
+
+ return HandshakeStatus.FINISHED;
+ }
+
+ @Override void checkKeyExchange() throws SSLException
+ {
+ if (continuedSession) // No key exchange needed.
+ return;
+ KeyExchangeAlgorithm kex = engine.session().suite.keyExchangeAlgorithm();
+ if (kex == NONE || kex == PSK || kex == RSA_PSK) // Don't need one.
+ return;
+ if (keyExchangeTask == null) // An error if we never created one.
+ throw new AlertException(new Alert(Alert.Level.FATAL,
+ Alert.Description.INTERNAL_ERROR));
+ if (!keyExchangeTask.hasRun()) // An error if the caller never ran it.
+ throw new AlertException(new Alert(Alert.Level.FATAL,
+ Alert.Description.INTERNAL_ERROR));
+ if (keyExchangeTask.thrown() != null) // An error was thrown.
+ throw new AlertException(new Alert(Alert.Level.FATAL,
+ Alert.Description.HANDSHAKE_FAILURE),
+ keyExchangeTask.thrown());
+ }
+
+ @Override void handleV2Hello(ByteBuffer hello)
+ {
+ int len = hello.getShort(0) & 0x7FFF;
+ md5.update((ByteBuffer) hello.duplicate().position(2).limit(len+2));
+ sha.update((ByteBuffer) hello.duplicate().position(2).limit(len+2));
+ helloV2 = true;
+ }
+
+ private ByteBuffer signParams(ByteBuffer serverParams)
+ throws NoSuchAlgorithmException, InvalidKeyException, SignatureException
+ {
+ SignatureAlgorithm alg = engine.session().suite.signatureAlgorithm();
+ java.security.Signature sig
+ = java.security.Signature.getInstance(alg.algorithm());
+ PrivateKey key = engine.contextImpl.keyManager.getPrivateKey(keyAlias);
+ if (Debug.DEBUG_KEY_EXCHANGE)
+ logger.logv(Component.SSL_HANDSHAKE, "server key: {0}", key);
+ sig.initSign(key);
+ sig.update(clientRandom.buffer());
+ sig.update(serverRandom.buffer());
+ sig.update(serverParams);
+ byte[] sigVal = sig.sign();
+ Signature signature = new Signature(sigVal, engine.session().suite.signatureAlgorithm());
+ return signature.buffer();
+ }
+
+ private void verifyClient(byte[] sigValue) throws SSLException, SignatureException
+ {
+ MessageDigest md5copy = null;
+ MessageDigest shacopy = null;
+ try
+ {
+ md5copy = (MessageDigest) md5.clone();
+ shacopy = (MessageDigest) sha.clone();
+ }
+ catch (CloneNotSupportedException cnse)
+ {
+ // Mis-configured with non-cloneable digests.
+ throw new SSLException(cnse);
+ }
+ byte[] toSign = null;
+ if (engine.session().version == ProtocolVersion.SSL_3)
+ toSign = genV3CertificateVerify(md5copy, shacopy, engine.session());
+ else
+ {
+ if (engine.session().suite.signatureAlgorithm() == SignatureAlgorithm.RSA)
+ toSign = Util.concat(md5copy.digest(), shacopy.digest());
+ else
+ toSign = shacopy.digest();
+ }
+
+ try
+ {
+ java.security.Signature sig = java.security.Signature.getInstance(engine.session().suite.signatureAlgorithm().toString());
+ sig.initVerify(clientCert);
+ sig.update(toSign);
+ sig.verify(sigValue);
+ }
+ catch (InvalidKeyException ike)
+ {
+ throw new SSLException(ike);
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ throw new SSLException(nsae);
+ }
+ }
+
+ // Delegated tasks.
+
+ class CertLoader extends DelegatedTask
+ {
+ CertLoader()
+ {
+ }
+
+ public void implRun() throws SSLException
+ {
+ KeyExchangeAlgorithm kexalg = engine.session().suite.keyExchangeAlgorithm();
+ X509ExtendedKeyManager km = engine.contextImpl.keyManager;
+ Principal[] issuers = null; // XXX use TrustedAuthorities extension.
+ keyAlias = km.chooseEngineServerAlias(kexalg.name(), issuers, engine);
+ if (keyAlias == null)
+ throw new SSLException("no certificates available");
+ X509Certificate[] chain = km.getCertificateChain(keyAlias);
+ engine.session().setLocalCertificates(chain);
+ localCert = chain[0];
+ serverKey = km.getPrivateKey(keyAlias);
+ if (kexalg == DH_DSS || kexalg == DH_RSA)
+ dhPair = new KeyPair(localCert.getPublicKey(),
+ km.getPrivateKey(keyAlias));
+ }
+ }
+
+ /**
+ * Delegated task for generating Diffie-Hellman parameters.
+ */
+ private class GenDH extends DelegatedTask
+ {
+ ByteBuffer paramsBuffer;
+ ByteBuffer sigBuffer;
+
+ protected void implRun()
+ throws NoSuchAlgorithmException, InvalidAlgorithmParameterException,
+ InvalidKeyException, SignatureException
+ {
+ KeyPairGenerator dhGen = KeyPairGenerator.getInstance("DH");
+ DHParameterSpec dhparams = DiffieHellman.getParams().getParams();
+ dhGen.initialize(dhparams, engine.session().random());
+ dhPair = dhGen.generateKeyPair();
+ DHPublicKey pub = (DHPublicKey) dhPair.getPublic();
+
+ // Generate the parameters message.
+ ServerDHParams params = new ServerDHParams(pub.getParams().getP(),
+ pub.getParams().getG(),
+ pub.getY());
+ paramsBuffer = params.buffer();
+
+ // Sign the parameters, if needed.
+ if (engine.session().suite.signatureAlgorithm() != SignatureAlgorithm.ANONYMOUS)
+ {
+ sigBuffer = signParams(paramsBuffer);
+ paramsBuffer.rewind();
+ }
+ if (Debug.DEBUG_KEY_EXCHANGE)
+ logger.logv(Component.SSL_KEY_EXCHANGE,
+ "Diffie-Hellman public:{0} private:{1}",
+ dhPair.getPublic(), dhPair.getPrivate());
+ }
+ }
+
+ class RSAKeyExchange extends DelegatedTask
+ {
+ private final byte[] encryptedPreMasterSecret;
+
+ RSAKeyExchange(byte[] encryptedPreMasterSecret)
+ {
+ this.encryptedPreMasterSecret = encryptedPreMasterSecret;
+ }
+
+ public void implRun()
+ throws BadPaddingException, IllegalBlockSizeException, InvalidKeyException,
+ NoSuchAlgorithmException, NoSuchPaddingException, SSLException
+ {
+ Cipher rsa = Cipher.getInstance("RSA");
+ rsa.init(Cipher.DECRYPT_MODE, serverKey);
+ rsa.init(Cipher.DECRYPT_MODE, localCert);
+ preMasterSecret = rsa.doFinal(encryptedPreMasterSecret);
+ generateMasterSecret(clientRandom, serverRandom, engine.session());
+ byte[][] keys = generateKeys(clientRandom, serverRandom, engine.session());
+ setupSecurityParameters(keys, false, engine, compression);
+ }
+ }
+
+ class RSA_PSKExchange extends DelegatedTask
+ {
+ private final byte[] encryptedPreMasterSecret;
+ private final SecretKey psKey;
+
+ RSA_PSKExchange(byte[] encryptedPreMasterSecret, SecretKey psKey)
+ {
+ this.encryptedPreMasterSecret = encryptedPreMasterSecret;
+ this.psKey = psKey;
+ }
+
+ public @Override void implRun()
+ throws BadPaddingException, IllegalBlockSizeException, InvalidKeyException,
+ NoSuchAlgorithmException, NoSuchPaddingException, SSLException
+ {
+ Cipher rsa = Cipher.getInstance("RSA");
+ rsa.init(Cipher.DECRYPT_MODE, serverKey);
+ rsa.init(Cipher.DECRYPT_MODE, localCert);
+ byte[] rsaSecret = rsa.doFinal(encryptedPreMasterSecret);
+ byte[] psSecret = psKey.getEncoded();
+ preMasterSecret = new byte[rsaSecret.length + psSecret.length + 4];
+ preMasterSecret[0] = (byte) (rsaSecret.length >>> 8);
+ preMasterSecret[1] = (byte) rsaSecret.length;
+ System.arraycopy(rsaSecret, 0, preMasterSecret, 2, rsaSecret.length);
+ preMasterSecret[rsaSecret.length + 2] = (byte) (psSecret.length >>> 8);
+ preMasterSecret[rsaSecret.length + 3] = (byte) psSecret.length;
+ System.arraycopy(psSecret, 0, preMasterSecret, rsaSecret.length+4,
+ psSecret.length);
+
+ generateMasterSecret(clientRandom, serverRandom, engine.session());
+ byte[][] keys = generateKeys(clientRandom, serverRandom, engine.session());
+ setupSecurityParameters(keys, false, engine, compression);
+ }
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ServerHello.java b/libjava/classpath/gnu/javax/net/ssl/provider/ServerHello.java
index 8b7853c7f40..2bbce37fb3d 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/ServerHello.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ServerHello.java
@@ -38,179 +38,194 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
import java.io.PrintWriter;
-import java.io.StringReader;
import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
+import java.nio.ByteBuffer;
-import javax.net.ssl.SSLProtocolException;
-
-class ServerHello implements Handshake.Body
+/**
+ * The server hello message.
+ *
+ * <pre>
+struct
+{
+ ProtocolVersion server_version;
+ Random random;
+ SessionID session_id;
+ CipherSuite cipher_suite;
+ CompressionMethod compression_method;
+ Extensions server_hello_extension_list&lt;0..2^16-1&gt;
+} ServerHello;
+</pre>
+ *
+ * <p>Server hello messages may contain extra data after the
+ * <tt>compression_method</tt> field, which are interpreted as
+ * extensions to the basic handshake.
+ */
+public class ServerHello implements Handshake.Body
{
// Fields.
// -------------------------------------------------------------------------
- private final ProtocolVersion version;
- private final Random random;
- private final byte[] sessionId;
- private final CipherSuite suite;
- private final CompressionMethod comp;
- private final List extensions;
+ protected static final int RANDOM_OFFSET = 2;
+ protected static final int SESSID_OFFSET = 32 + RANDOM_OFFSET;
+ protected static final int SESSID_OFFSET2 = SESSID_OFFSET + 1;
+ protected ByteBuffer buffer;
+ protected boolean disableExtensions;
+
// Constructor.
// -------------------------------------------------------------------------
- ServerHello(ProtocolVersion version, Random random,
- byte[] sessionId, CipherSuite suite,
- CompressionMethod comp)
+ public ServerHello (final ByteBuffer buffer)
{
- this(version, random, sessionId, suite, comp, null);
+ this.buffer = buffer;
+ disableExtensions = false;
}
- ServerHello(ProtocolVersion version, Random random,
- byte[] sessionId, CipherSuite suite,
- CompressionMethod comp, List extensions)
+ public int length ()
{
- this.version = version;
- this.random = random;
- this.sessionId = sessionId;
- this.suite = suite;
- this.comp = comp;
- this.extensions = extensions;
+ int sessionLen = buffer.get(SESSID_OFFSET) & 0xFF;
+ int len = SESSID_OFFSET2 + sessionLen + 3;
+ int elen = 0;
+ if (!disableExtensions && len + 1 < buffer.limit()
+ && (elen = buffer.getShort(len)) != 0)
+ len += 2 + elen;
+ return len;
}
- // Class methods.
- // -------------------------------------------------------------------------
-
- static ServerHello read(InputStream in) throws IOException
+ /**
+ * Returns the server's protocol version. This will read two bytes
+ * from the beginning of the underlying buffer, and return an
+ * instance of the appropriate {@link ProtocolVersion}; if the
+ * version read is a supported version, this method returns a static
+ * constant instance.
+ *
+ * @return The server's protocol version.
+ */
+ public ProtocolVersion version()
{
- ProtocolVersion vers = ProtocolVersion.read(in);
- Random rand = Random.read(in);
- byte[] id = new byte[in.read() & 0xFF];
- in.read(id);
- CipherSuite suite = CipherSuite.read(in).resolve(vers);
- CompressionMethod comp = CompressionMethod.read(in);
- List ext = null;
- if (in.available() > 0)
- {
- ext = new LinkedList();
- int len = (in.read() >>> 8 & 0xFF) | (in.read() & 0xFF);
- int count = 0;
- while (count < len)
- {
- Extension e = Extension.read(in);
- ext.add(e);
- count += e.getValue().length + 4;
- }
- }
- return new ServerHello(vers, rand, id, suite, comp, ext);
+ return ProtocolVersion.getInstance (buffer.getShort (0));
}
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public void write(OutputStream out) throws IOException
+ /**
+ * Returns the server's random value. This method returns a
+ * lightwieght wrapper around the existing bytes; modifications to
+ * the underlying buffer will modify the returned object, and
+ * vice-versa.
+ *
+ * @return The server's random value.
+ */
+ public Random random()
{
- version.write(out);
- random.write(out);
- out.write(sessionId.length);
- out.write(sessionId);
- suite.write(out);
- out.write(comp.getValue());
- if (extensions != null)
- {
- ByteArrayOutputStream out2 = new ByteArrayOutputStream();
- for (Iterator i = extensions.iterator(); i.hasNext(); )
- ((Extension) i.next()).write(out2);
- out.write(out2.size() >>> 8 & 0xFF);
- out.write(out2.size() & 0xFF);
- out2.writeTo(out);
- }
+ ByteBuffer randomBuf =
+ ((ByteBuffer) buffer.duplicate ().position (RANDOM_OFFSET)
+ .limit (SESSID_OFFSET)).slice ();
+ return new Random (randomBuf);
}
- ProtocolVersion getVersion()
+ /**
+ * Returns the session ID. This method returns a new byte array with
+ * the session ID bytes.
+ *
+ * @return The session ID.
+ */
+ public byte[] sessionId()
{
- return version;
+ int idlen = buffer.get (SESSID_OFFSET) & 0xFF;
+ byte[] sessionId = new byte[idlen];
+ buffer.position (SESSID_OFFSET2);
+ buffer.get (sessionId);
+ return sessionId;
}
- Random getRandom()
+ /**
+ * Returns the server's chosen cipher suite. The returned cipher
+ * suite will be "resolved" to this structure's version.
+ *
+ * @return The server's chosen cipher suite.
+ */
+ public CipherSuite cipherSuite()
{
- return random;
+ int offset = SESSID_OFFSET2 + (buffer.get(SESSID_OFFSET) & 0xFF);
+ return CipherSuite.forValue(buffer.getShort(offset)).resolve();
}
- byte[] getSessionId()
+ /**
+ * Returns the server's chosen compression method.
+ *
+ * @return The chosen compression method.
+ */
+ public CompressionMethod compressionMethod()
{
- return (byte[]) sessionId.clone();
+ int offset = SESSID_OFFSET2 + (buffer.get(SESSID_OFFSET) & 0xFF) + 2;
+ return CompressionMethod.getInstance(buffer.get(offset) & 0xFF);
}
- CipherSuite getCipherSuite()
+ public int extensionsLength()
{
- return suite;
+ int offset = SESSID_OFFSET2 + (buffer.get (SESSID_OFFSET) & 0xFF) + 3;
+ if (offset + 1 >= buffer.limit())
+ return 0;
+ return buffer.getShort(offset) & 0xFFFF;
}
-
- CompressionMethod getCompressionMethod()
+
+ public ExtensionList extensions ()
{
- return comp;
+ int offset = SESSID_OFFSET2 + (buffer.get (SESSID_OFFSET) & 0xFF) + 3;
+ if (offset + 1 >= buffer.limit())
+ return null;
+ int len = buffer.getShort(offset) & 0xFFFF;
+ if (len == 0)
+ len = buffer.limit() - offset - 2;
+ ByteBuffer ebuf = ((ByteBuffer) buffer.duplicate().position(offset)
+ .limit(offset + len + 2)).slice();
+ return new ExtensionList(ebuf);
}
- List getExtensions()
+ public String toString()
{
- return extensions;
+ return toString(null);
}
- public String toString()
+ public String toString (final String prefix)
{
StringWriter str = new StringWriter();
PrintWriter out = new PrintWriter(str);
- out.println("struct {");
- out.println(" version = " + version + ";");
- BufferedReader r = new BufferedReader(new StringReader(random.toString()));
- String s;
- try
- {
- while ((s = r.readLine()) != null)
- {
- out.print(" ");
- out.println(s);
- }
- }
- catch (IOException ignored)
- {
- }
- out.println(" sessionId = " + Util.toHexString(sessionId, ':') + ";");
- out.println(" cipherSuite = " + suite + ";");
- out.println(" compressionMethod = " + comp + ";");
- if (extensions != null)
- {
- out.println(" extensions = {");
- for (Iterator i = extensions.iterator(); i.hasNext(); )
- {
- r = new BufferedReader(new StringReader(i.next().toString()));
- try
- {
- while ((s = r.readLine()) != null)
- {
- out.print(" ");
- out.println(s);
- }
- }
- catch (IOException ignored)
- {
- }
- }
- out.println(" };");
- }
- out.println("} ServerHello;");
+ if (prefix != null)
+ out.print (prefix);
+ out.println ("struct {");
+ String subprefix = " ";
+ if (prefix != null)
+ subprefix += prefix;
+ out.print (subprefix);
+ out.print ("version: ");
+ out.print (version ());
+ out.println (";");
+ out.print (subprefix);
+ out.println ("random:");
+ out.println (random ().toString (subprefix));
+ out.print (subprefix);
+ out.print ("sessionId: ");
+ out.print (Util.toHexString(sessionId (), ':'));
+ out.println (";");
+ out.print (subprefix);
+ out.print ("cipherSuite: ");
+ out.print (cipherSuite ());
+ out.println (";");
+ out.print (subprefix);
+ out.print ("compressionMethod: ");
+ out.print (compressionMethod ());
+ out.println (";");
+ ExtensionList exts = extensions ();
+ out.print (subprefix);
+ out.println ("extensions:");
+ out.println (exts != null ? exts.toString (subprefix+" ")
+ : subprefix + " (nil)");
+ if (prefix != null)
+ out.print (prefix);
+ out.print ("} ServerHello;");
return str.toString();
}
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ServerHelloBuilder.java b/libjava/classpath/gnu/javax/net/ssl/provider/ServerHelloBuilder.java
new file mode 100644
index 00000000000..09ad1d9e8a9
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ServerHelloBuilder.java
@@ -0,0 +1,131 @@
+/* ServerHelloBuilder.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.nio.ByteBuffer;
+
+/**
+ * @author csm
+ *
+ */
+public class ServerHelloBuilder extends ServerHello implements Builder
+{
+ public ServerHelloBuilder()
+ {
+ // Allocate a large enough buffer to hold a hello with the maximum
+ // size session ID, and no extensions.
+ super(ByteBuffer.allocate(SESSID_OFFSET2 + 35));
+ }
+
+ public ByteBuffer buffer()
+ {
+ return ((ByteBuffer) buffer.duplicate().position(0).limit(length())).slice();
+ }
+
+ // We don't reallocate the buffer in any of the following methods,
+ // because we always allocate a large enough buffer for the base
+ // object in the constructor.
+
+ public void setVersion (final ProtocolVersion version)
+ {
+ buffer.putShort (0, (short) version.rawValue ());
+ }
+
+ public void setSessionId (final byte[] sessionId)
+ {
+ setSessionId (sessionId, 0, sessionId.length);
+ }
+
+ public void setSessionId (final byte[] sessionId, final int offset,
+ final int length)
+ {
+ if (length < 0 || length > 32)
+ throw new IllegalArgumentException("length must be between 0 and 32");
+ buffer.put(SESSID_OFFSET, (byte) length);
+ ((ByteBuffer) buffer.duplicate().position(SESSID_OFFSET2))
+ .put(sessionId, offset, length);
+ }
+
+ public void setCipherSuite (final CipherSuite suite)
+ {
+ int offset = SESSID_OFFSET + (buffer.get(SESSID_OFFSET) & 0xFF) + 1;
+ ((ByteBuffer) buffer.duplicate().position(offset)).put(suite.id());
+ }
+
+ public void setCompressionMethod (final CompressionMethod comp)
+ {
+ int offset = SESSID_OFFSET + (buffer.get(SESSID_OFFSET) & 0xFF) + 3;
+ buffer.put (offset, (byte) comp.getValue ());
+ }
+
+ // For extensions, we do reallocate the buffer.
+
+ public void setDisableExtensions(boolean disable)
+ {
+ disableExtensions = disable;
+ }
+
+ public void setExtensionsLength (final int length)
+ {
+ if (length < 0 || length > 16384)
+ throw new IllegalArgumentException("length must be nonnegative and not exceed 16384");
+ int needed = SESSID_OFFSET2 + (buffer.get(SESSID_OFFSET) & 0xFF) + 5 + length;
+ if (buffer.capacity() < needed)
+ ensureCapacity(needed);
+ buffer.putShort (SESSID_OFFSET2 + (buffer.get (SESSID_OFFSET) & 0xFF) + 3,
+ (short) length);
+ }
+
+ public void setExtensions(ByteBuffer extensions)
+ {
+ extensions = (ByteBuffer)
+ extensions.duplicate().limit(extensions.position() + extensionsLength());
+ ((ByteBuffer) buffer.duplicate().position(SESSID_OFFSET2
+ + (buffer.get(SESSID_OFFSET) & 0xFF)
+ )).put(extensions);
+ }
+
+ public void ensureCapacity(int newCapacity)
+ {
+ ByteBuffer newBuffer = ByteBuffer.allocate(newCapacity);
+ newBuffer.put(buffer);
+ newBuffer.position(0);
+ buffer = newBuffer;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ServerHelloDone.java b/libjava/classpath/gnu/javax/net/ssl/provider/ServerHelloDone.java
new file mode 100644
index 00000000000..e09772250a5
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ServerHelloDone.java
@@ -0,0 +1,66 @@
+/* ServerHelloDone.java -- SSL ServerHelloDone message.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+/**
+ * An empty message that signals that the server is finished sending
+ * its handshake data.
+ *
+ * <pre>struct { } ServerHelloDone;</pre>
+ */
+public class ServerHelloDone implements Handshake.Body
+{
+ public ServerHelloDone () { }
+
+ public int length ()
+ {
+ return 0;
+ }
+
+ public String toString ()
+ {
+ return toString (null);
+ }
+
+ public String toString (final String prefix)
+ {
+ return ((prefix != null ? prefix : "")
+ + "struct { } ServerHelloDone;");
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ServerKeyExchange.java b/libjava/classpath/gnu/javax/net/ssl/provider/ServerKeyExchange.java
index 58304159300..1206ae6b28b 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/ServerKeyExchange.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ServerKeyExchange.java
@@ -38,249 +38,136 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
import java.io.PrintWriter;
-import java.io.StringReader;
import java.io.StringWriter;
-import java.math.BigInteger;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
-import java.security.PublicKey;
-import java.security.interfaces.RSAPublicKey;
-
-import javax.crypto.interfaces.DHPublicKey;
-import javax.crypto.spec.DHParameterSpec;
-
-import javax.net.ssl.SSLProtocolException;
-
-import gnu.javax.crypto.key.dh.GnuDHPublicKey;
-import gnu.javax.crypto.key.srp6.SRPPublicKey;
-
-class ServerKeyExchange implements Handshake.Body
+/**
+ * The server key exchange message.
+ *
+ * <pre>
+struct
{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private PublicKey publicKey;
- private Signature signature;
- private byte[] srpSalt;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- ServerKeyExchange(PublicKey publicKey, Signature signature)
- {
- this(publicKey, signature, null);
- }
-
- ServerKeyExchange(PublicKey publicKey, Signature signature, byte[] srpSalt)
+ select (KeyExchangeAlgorithm)
{
- this.publicKey = publicKey;
- this.signature = signature;
- this.srpSalt = srpSalt;
- }
-
- // Class methods.
- // -------------------------------------------------------------------------
-
- static ServerKeyExchange read(InputStream in, CipherSuite suite,
- PublicKey serverKey)
- throws IOException
- {
- DataInputStream din = new DataInputStream(in);
- PublicKey key = null;
- byte[] salt = null;
- String kex = suite.getKeyExchange();
- if (kex.equals("DHE"))
- {
- BigInteger p, g, y;
- byte[] buf = new byte[din.readUnsignedShort()];
- din.readFully(buf);
- p = new BigInteger(1, buf);
- buf = new byte[din.readUnsignedShort()];
- din.readFully(buf);
- g = new BigInteger(1, buf);
- buf = new byte[din.readUnsignedShort()];
- din.readFully(buf);
- y = new BigInteger(1, buf);
- key = new GnuDHPublicKey(null, p, g, y);
- }
- else if (kex.equals("RSA"))
- {
- BigInteger n, e;
- byte[] buf = new byte[din.readUnsignedShort()];
- din.readFully(buf);
- n = new BigInteger(1, buf);
- buf = new byte[din.readUnsignedShort()];
- din.readFully(buf);
- e = new BigInteger(1, buf);
- key = new JessieRSAPublicKey(n, e);
- }
- else if (kex.equals("SRP"))
- {
- BigInteger N, g, B;
- byte[] buf = new byte[din.readUnsignedShort()];
- din.readFully(buf);
- N = new BigInteger(1, buf);
- buf = new byte[din.readUnsignedShort()];
- din.readFully(buf);
- g = new BigInteger(1, buf);
- salt = new byte[din.readUnsignedByte()];
- din.readFully(salt);
- buf = new byte[din.readUnsignedShort()];
- din.readFully(buf);
- B = new BigInteger(1, buf);
- try
- {
- key = new SRPPublicKey(N, g, B);
- }
- catch (IllegalArgumentException iae)
- {
- throw new SSLProtocolException(iae.getMessage());
- }
- }
- else
- {
- throw new SSLProtocolException("invalid kex algorithm");
- }
-
- Signature sig = null;
- if (!suite.getSignature().equals("anon"))
- {
- sig = Signature.read(in, suite, serverKey);
- }
- return new ServerKeyExchange(key, sig, salt);
- }
+ case diffie_hellman:
+ ServerDHParams params;
+ Signature signed_params;
+ case rsa:
+ ServerRSAParams params;
+ Signature signed_params;
+ case srp:
+ ServerSRPParams params;
+ Signature signed_params;
+ };
+} ServerKeyExchange;
+</pre>
+ */
+public class ServerKeyExchange implements Handshake.Body
+{
- // Instance methods.
- // -------------------------------------------------------------------------
+ protected ByteBuffer buffer;
+ protected final CipherSuite suite;
- public void write(OutputStream out) throws IOException
+ public ServerKeyExchange(final ByteBuffer buffer, final CipherSuite suite)
{
- write(out, ProtocolVersion.TLS_1);
+ suite.getClass();
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ this.suite = suite;
}
- public void write(OutputStream out, ProtocolVersion version)
- throws IOException
+ public int length ()
{
- if (publicKey instanceof DHPublicKey)
- {
- writeBigint(out, ((DHPublicKey) publicKey).getParams().getP());
- writeBigint(out, ((DHPublicKey) publicKey).getParams().getG());
- writeBigint(out, ((DHPublicKey) publicKey).getY());
- }
- else if (publicKey instanceof RSAPublicKey)
- {
- writeBigint(out, ((RSAPublicKey) publicKey).getModulus());
- writeBigint(out, ((RSAPublicKey) publicKey).getPublicExponent());
- }
- else if (publicKey instanceof SRPPublicKey)
- {
- writeBigint(out, ((SRPPublicKey) publicKey).getN());
- writeBigint(out, ((SRPPublicKey) publicKey).getG());
- out.write(srpSalt.length);
- out.write(srpSalt);
- writeBigint(out, ((SRPPublicKey) publicKey).getY());
- }
- if (signature != null)
- {
- signature.write(out, version);
- }
+ if (suite.keyExchangeAlgorithm ().equals (KeyExchangeAlgorithm.NONE))
+ return 0;
+ int len = 0;
+ ServerKeyExchangeParams params = params();
+ Signature sig = signature();
+ if (params != null)
+ len += params.length();
+ if (sig != null)
+ len += sig.length();
+ return len;
}
- PublicKey getPublicKey()
+ /**
+ * Returns the server's key exchange parameters. The value returned will
+ * depend on the key exchange algorithm this object was created with.
+ *
+ * @return The server's key exchange parameters.
+ */
+ public ServerKeyExchangeParams params ()
{
- return publicKey;
+ KeyExchangeAlgorithm kex = suite.keyExchangeAlgorithm ();
+ if (kex == KeyExchangeAlgorithm.RSA)
+ return new ServerRSAParams(buffer.duplicate ());
+ else if (kex == KeyExchangeAlgorithm.DHE_DSS
+ || kex == KeyExchangeAlgorithm.DHE_RSA
+ || kex == KeyExchangeAlgorithm.DH_anon)
+ return new ServerDHParams(buffer.duplicate());
+// else if (kex.equals (KeyExchangeAlgorithm.SRP))
+// return new ServerSRPParams (buffer.duplicate ());
+ else if (kex == KeyExchangeAlgorithm.NONE)
+ return null;
+ else if (kex == KeyExchangeAlgorithm.DHE_PSK)
+ return new ServerDHE_PSKParameters(buffer.duplicate());
+ else if (kex == KeyExchangeAlgorithm.PSK)
+ return new ServerPSKParameters(buffer.duplicate());
+ else if (kex == KeyExchangeAlgorithm.RSA_PSK)
+ return new ServerPSKParameters(buffer.duplicate());
+ throw new IllegalArgumentException ("unsupported key exchange: " + kex);
}
- Signature getSignature()
+ /**
+ * Returns the digital signature made over the key exchange parameters.
+ *
+ * @return The signature.
+ */
+ public Signature signature ()
{
- return signature;
+ KeyExchangeAlgorithm kex = suite.keyExchangeAlgorithm();
+ if (kex == KeyExchangeAlgorithm.NONE
+ || kex == KeyExchangeAlgorithm.DH_anon
+ || kex == KeyExchangeAlgorithm.DHE_PSK
+ || kex == KeyExchangeAlgorithm.PSK
+ || kex == KeyExchangeAlgorithm.RSA_PSK)
+ return null;
+ ServerKeyExchangeParams params = params();
+ ByteBuffer sigbuf = ((ByteBuffer) buffer.position(params.length ())).slice ();
+ return new Signature (sigbuf, suite.signatureAlgorithm ());
}
- byte[] getSRPSalt()
+ public String toString()
{
- return srpSalt;
+ return toString (null);
}
- public String toString()
+ public String toString (final String prefix)
{
StringWriter str = new StringWriter();
PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print (prefix);
out.println("struct {");
- out.println(" publicKey = struct {");
- if (publicKey instanceof DHPublicKey)
- {
- out.println(" p = " +
- ((DHPublicKey) publicKey).getParams().getP().toString(16) +
- ";");
- out.println(" g = " +
- ((DHPublicKey) publicKey).getParams().getG().toString(16) +
- ";");
- out.println(" y = " + ((DHPublicKey) publicKey).getY().toString(16) +
- ";");
- out.println(" } DHPublicKey;");
- }
- else if (publicKey instanceof RSAPublicKey)
+ if (prefix != null) out.print (prefix);
+ out.print (" algorithm: ");
+ out.print (suite.keyExchangeAlgorithm ());
+ out.println (";");
+ if (!suite.keyExchangeAlgorithm ().equals (KeyExchangeAlgorithm.NONE))
{
- out.println(" modulus = " +
- ((RSAPublicKey) publicKey).getModulus().toString(16) +
- ";");
- out.println(" exponent = " +
- ((RSAPublicKey) publicKey).getPublicExponent().toString(16) +
- ";");
- out.println(" } RSAPublicKey;");
+ if (prefix != null) out.print (prefix);
+ out.println (" parameters:");
+ out.println (params ().toString (prefix != null ? prefix+" " : " "));
}
- else if (publicKey instanceof SRPPublicKey)
+ if (!suite.signatureAlgorithm ().equals (SignatureAlgorithm.ANONYMOUS))
{
- out.println(" N = "+((SRPPublicKey) publicKey).getN().toString(16)+";");
- out.println(" g = "+((SRPPublicKey) publicKey).getG().toString(16)+";");
- out.println(" salt = " + Util.toHexString(srpSalt, ':') + ";");
- out.println(" B = "+((SRPPublicKey) publicKey).getY().toString(16)+";");
- out.println(" } SRPPublicKey;");
+ if (prefix != null) out.print (prefix);
+ out.println (" signature:");
+ out.println (signature ().toString (prefix != null ? prefix+" " : " "));
}
- if (signature != null)
- {
- out.println(" signature =");
- BufferedReader r = new BufferedReader(new StringReader(signature.toString()));
- String s;
- try
- {
- while ((s = r.readLine()) != null)
- {
- out.print(" ");
- out.println(s);
- }
- }
- catch (IOException ignored)
- {
- }
- }
- out.println("} ServerKeyExchange;");
+ if (prefix != null) out.print (prefix);
+ out.print ("} ServerKeyExchange;");
return str.toString();
}
-
- private void writeBigint(OutputStream out, BigInteger bigint)
- throws IOException
- {
- byte[] b = bigint.toByteArray();
- if (b[0] == 0x00)
- {
- out.write((b.length - 1) >>> 8 & 0xFF);
- out.write((b.length - 1) & 0xFF);
- out.write(b, 1, b.length - 1);
- }
- else
- {
- out.write(b.length >>> 8 & 0xFF);
- out.write(b.length & 0xFF);
- out.write(b);
- }
- }
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ServerKeyExchangeBuilder.java b/libjava/classpath/gnu/javax/net/ssl/provider/ServerKeyExchangeBuilder.java
new file mode 100644
index 00000000000..d4b6fa39736
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ServerKeyExchangeBuilder.java
@@ -0,0 +1,89 @@
+/* ServerKeyExchangeBuilder.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.nio.ByteBuffer;
+
+/**
+ * Builder for {@link ServerKeyExchange} objects.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class ServerKeyExchangeBuilder extends ServerKeyExchange
+ implements Builder
+{
+ public ServerKeyExchangeBuilder(final CipherSuite suite)
+ {
+ super(ByteBuffer.allocate(1024), suite);
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Builder#buffer()
+ */
+ public ByteBuffer buffer()
+ {
+ return ((ByteBuffer) buffer.duplicate().position(0).limit(length())).slice();
+ }
+
+ public void setParams(ByteBuffer params)
+ {
+ if (suite.keyExchangeAlgorithm() == KeyExchangeAlgorithm.NONE)
+ throw new IllegalArgumentException("key exchange algorithm is none");
+ ensureCapacity(params.remaining());
+ buffer.duplicate().put(params);
+ }
+
+ public void setSignature(ByteBuffer signature)
+ {
+ if (suite.keyExchangeAlgorithm() == KeyExchangeAlgorithm.NONE)
+ throw new IllegalArgumentException("key exchange algorithm is none");
+ int paramsLen = params().length();
+ ensureCapacity(paramsLen + signature.remaining());
+ ((ByteBuffer) buffer.duplicate().position(paramsLen)).put(signature);
+ }
+
+ public void ensureCapacity(int capacity)
+ {
+ if (buffer.capacity() >= capacity)
+ return;
+ ByteBuffer newBuffer = ByteBuffer.allocate(capacity);
+ newBuffer.duplicate().put(buffer);
+ buffer = newBuffer;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ServerKeyExchangeParams.java b/libjava/classpath/gnu/javax/net/ssl/provider/ServerKeyExchangeParams.java
new file mode 100644
index 00000000000..cb523650f25
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ServerKeyExchangeParams.java
@@ -0,0 +1,50 @@
+/* ServerKeyExchangeParams.java -- Server key exchange parameters interface.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+/**
+ * A parameter structure sent by the server in an SSL key exchange.
+ *
+ * @see ServerRSAParams
+ * @see ServerDHParams
+ */
+interface ServerKeyExchangeParams extends Constructed
+{
+ KeyExchangeAlgorithm algorithm ();
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ServerNameList.java b/libjava/classpath/gnu/javax/net/ssl/provider/ServerNameList.java
new file mode 100644
index 00000000000..5a268f542ab
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ServerNameList.java
@@ -0,0 +1,311 @@
+/* ServerNameList.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.javax.net.ssl.provider.Extension.Value;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.CharBuffer;
+import java.nio.charset.CharacterCodingException;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetEncoder;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+/**
+ * The ServerName extension.
+ *
+ * <pre>
+ struct {
+ NameType name_type;
+ select (name_type) {
+ case host_name: HostName;
+ } name;
+} ServerName;
+
+enum {
+ host_name(0), (255)
+} NameType;
+
+opaque HostName<1..2^16-1>;
+
+struct {
+ ServerName server_name_list<1..2^16-1>
+} ServerNameList;</pre>
+ *
+ * <p><b>Implementation note: this class does not currently contain a
+ * <code>set</code> method. If you are modifying this list, then use the
+ * {@link #get(int)} method, and modify the returned {@link ServerName}.
+ *
+ * @author csm
+ */
+public class ServerNameList extends Value implements Iterable<ServerNameList.ServerName>
+{
+ private ByteBuffer buffer;
+
+ public ServerNameList (final ByteBuffer buffer)
+ {
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ }
+
+ public ServerNameList(List<ServerName> names)
+ {
+ int length = 2;
+ for (ServerName name : names)
+ length += name.length();
+ buffer = ByteBuffer.allocate(length);
+ buffer.putShort((short) (length - 2));
+ for (ServerName name : names)
+ buffer.put(name.buffer());
+ buffer.rewind();
+ }
+
+ public int length()
+ {
+ return (buffer.getShort(0) & 0xFFFF) + 2;
+ }
+
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().limit(length());
+ }
+
+ public int size()
+ {
+ int n = 0;
+ final int len = length();
+ for (int i = 2; i < len; )
+ {
+ int l = buffer.getShort(i+1);
+ i += l + 3;
+ n++;
+ }
+ return n;
+ }
+
+ public ServerName get (int index)
+ {
+ final int len = length();
+ if (len == 0)
+ throw new IndexOutOfBoundsException("0; " + index);
+ int n = 0;
+ int i;
+ int l = buffer.getShort(3);
+ for (i = 2; i < len && n < index; )
+ {
+ l = buffer.getShort(i+1);
+ i += l + 3;
+ n++;
+ }
+ if (n < index)
+ throw new IndexOutOfBoundsException(n + "; " + index);
+ ByteBuffer buf = ((ByteBuffer) buffer.duplicate().position(i).limit(i+l+3)).slice();
+ return new ServerName (buf);
+ }
+
+ public void setLength(final int newLength)
+ {
+ if (newLength < 0 || newLength > 65535)
+ throw new IllegalArgumentException("length must be between 0 and 65535");
+ buffer.putShort(0, (short) newLength);
+ }
+
+ public String toString()
+ {
+ return toString(null);
+ }
+
+ public String toString(String prefix)
+ {
+ StringWriter str = new StringWriter();
+ PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print(prefix);
+ out.println ("ServerNameList {");
+ String subprefix = " ";
+ if (prefix != null)
+ subprefix = prefix + subprefix;
+ for (ServerName name : this)
+ {
+ out.println (name.toString(subprefix));
+ }
+ if (prefix != null) out.print(prefix);
+ out.print ("};");
+ return str.toString();
+ }
+
+ public java.util.Iterator<ServerName> iterator()
+ {
+ return new Iterator();
+ }
+
+ public class Iterator implements java.util.Iterator<ServerName>
+ {
+ private int index;
+
+ public Iterator()
+ {
+ index = 0;
+ }
+
+ public boolean hasNext()
+ {
+ return index < size();
+ }
+
+ public ServerName next() throws NoSuchElementException
+ {
+ try
+ {
+ return get (index++);
+ }
+ catch (IndexOutOfBoundsException ioobe)
+ {
+ throw new NoSuchElementException();
+ }
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ public static class ServerName implements Constructed
+ {
+ private ByteBuffer buffer;
+
+ public ServerName(final ByteBuffer buffer)
+ {
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ }
+
+ public ServerName(NameType type, String name)
+ {
+ CharsetEncoder utf8 = Charset.forName("UTF-8").newEncoder();
+ ByteBuffer nameBuf = null;
+ try
+ {
+ nameBuf = utf8.encode(CharBuffer.wrap(name));
+ }
+ catch (CharacterCodingException cce)
+ {
+ // We don't expect this to happen; it's UTF-8.
+ throw new IllegalArgumentException(cce);
+ }
+ int length = 3 + nameBuf.remaining();
+ buffer = ByteBuffer.allocate(length);
+ buffer.put((byte) type.getValue());
+ buffer.putShort((short) (length - 3));
+ buffer.put(nameBuf);
+ buffer.rewind();
+ }
+
+ public int length()
+ {
+ return (buffer.getShort(1) & 0xFFFF) + 3;
+ }
+
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().limit(length());
+ }
+
+ public NameType type()
+ {
+ int v = (buffer.get(0) & 0xFF);
+ if (v == 0)
+ {
+ return NameType.HOST_NAME;
+ }
+ throw new IllegalArgumentException ("illegal name type: " + v);
+ }
+
+ public String name()
+ {
+ int len = length();
+ Charset cs = Charset.forName ("UTF-8");
+ return cs.decode(((ByteBuffer) buffer.duplicate().position(3).limit(len))).toString();
+ }
+
+ public String toString()
+ {
+ return toString (null);
+ }
+
+ public String toString(String prefix)
+ {
+ StringWriter str = new StringWriter();
+ PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print (prefix);
+ out.println ("struct {");
+ if (prefix != null) out.print (prefix);
+ out.print (" name_type = ");
+ out.print (type());
+ out.println (";");
+ if (prefix != null) out.print (prefix);
+ out.print (" server_name = ");
+ out.print (name());
+ out.println (";");
+ if (prefix != null) out.print (prefix);
+ out.print ("} ServerName;");
+ return str.toString();
+ }
+ }
+
+ public static enum NameType
+ {
+ HOST_NAME (0);
+
+ private final int value;
+
+ private NameType (int value)
+ {
+ this.value = value;
+ }
+
+ public int getValue()
+ {
+ return value;
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ServerPSKParameters.java b/libjava/classpath/gnu/javax/net/ssl/provider/ServerPSKParameters.java
new file mode 100644
index 00000000000..8acce6dde51
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ServerPSKParameters.java
@@ -0,0 +1,127 @@
+/* ServerPSKParameters.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.charset.Charset;
+
+/**
+ * <pre>
+ struct {
+ select (KeyExchangeAlgorithm) {
+ /* other cases for rsa, diffie_hellman, etc. &ast;/
+ case psk: /* NEW &ast;/
+ opaque psk_identity_hint&lt;0..2^16-1&gt;;
+ };
+ } ServerKeyExchange;</pre>
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class ServerPSKParameters implements Builder, Constructed, ServerKeyExchangeParams
+{
+ private ByteBuffer buffer;
+
+ public ServerPSKParameters(ByteBuffer buffer)
+ {
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ }
+
+ public ServerPSKParameters(String identityHint)
+ {
+ Charset utf8 = Charset.forName("UTF-8");
+ ByteBuffer identityHintBuffer = utf8.encode(identityHint);
+ buffer = ByteBuffer.allocate(2 + identityHintBuffer.remaining());
+ buffer.putShort((short) identityHintBuffer.remaining());
+ buffer.put(identityHintBuffer);
+ buffer.rewind();
+ }
+
+ public KeyExchangeAlgorithm algorithm()
+ {
+ return KeyExchangeAlgorithm.PSK;
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Builder#buffer()
+ */
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().rewind().limit(length());
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Constructed#length()
+ */
+ public int length()
+ {
+ return (buffer.getShort(0) & 0xFFFF) + 2;
+ }
+
+ public String identityHint()
+ {
+ Charset utf8 = Charset.forName("UTF-8");
+ return utf8.decode((ByteBuffer) buffer.duplicate().position(2).limit(length())).toString();
+ }
+
+ public @Override String toString()
+ {
+ return toString(null);
+ }
+
+ /* (non-Javadoc)
+ * @see gnu.javax.net.ssl.provider.Constructed#toString(java.lang.String)
+ */
+ public String toString(String prefix)
+ {
+ StringWriter str = new StringWriter();
+ PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print(prefix);
+ out.println("struct {");
+ if (prefix != null) out.print(prefix);
+ out.print(" identity_hint = ");
+ out.print(identityHint());
+ out.println(";");
+ if (prefix != null) out.print(prefix);
+ out.print("} ServerPSKParamaters;");
+ return str.toString();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ServerRSAParams.java b/libjava/classpath/gnu/javax/net/ssl/provider/ServerRSAParams.java
new file mode 100644
index 00000000000..ff265ce8aaa
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ServerRSAParams.java
@@ -0,0 +1,163 @@
+/* ServerRSAParams.java -- The server's RSA parameters.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.math.BigInteger;
+import java.nio.ByteBuffer;
+
+/**
+ * The ServerRSAParams structure.
+ *
+ * <pre>
+struct
+{
+ opaque rsa_modulus&lt;1..2^16-1&gt;;
+ opaque rsa_exponent&lt;1..2^16-1&gt;;
+} ServerRSAParams;
+</pre>
+ */
+public class ServerRSAParams implements ServerKeyExchangeParams
+{
+
+ private final ByteBuffer buffer;
+
+ public ServerRSAParams (final ByteBuffer buffer)
+ {
+ this.buffer = buffer;
+ }
+
+ public KeyExchangeAlgorithm algorithm ()
+ {
+ return KeyExchangeAlgorithm.RSA;
+ }
+
+ public int length ()
+ {
+ int offset = buffer.getShort (0) & 0xFFFF;
+ return (buffer.getShort (offset + 2) & 0xFFFF) + offset + 4;
+ }
+
+ /**
+ * Gets the modulus field.
+ *
+ * @return The modulus.
+ */
+ public BigInteger modulus ()
+ {
+ int len = buffer.getShort (0) & 0xFFFF;
+ byte[] buf = new byte[len];
+ buffer.position (2);
+ buffer.get (buf);
+ return new BigInteger (1, buf);
+ }
+
+ /**
+ * Returns the exponent field.
+ *
+ * @return The exponent.
+ */
+ public BigInteger exponent ()
+ {
+ int off = (buffer.getShort (0) & 0xFFFF) + 2;
+ int len = buffer.getShort (off) & 0xFFFF;
+ byte[] buf = new byte[len];
+ buffer.position (off + 2);
+ buffer.get (buf);
+ return new BigInteger (1, buf);
+ }
+
+ /**
+ * Sets the modulus.
+ *
+ * @param modulus The modulus.
+ * @throws java.nio.ReadOnlyBufferException If the underlying buffer
+ * is not writable.
+ */
+ public void setModulus (final BigInteger modulus)
+ {
+ byte[] buf = modulus.toByteArray ();
+ int length = (buf[0] == 0x00 ? buf.length - 1 : buf.length);
+ int offset = (buf[0] == 0x00 ? 1 : 0);
+ buffer.putShort (0, (short) length);
+ buffer.position (2);
+ buffer.put (buf, offset, length);
+ }
+
+ /**
+ * Sets the exponent.
+ *
+ * @param exponent The exponent.
+ * @throws java.nio.ReadOnlyBufferException If the underlying buffer
+ * is not writeable.
+ */
+ public void setExponent (final BigInteger exponent)
+ {
+ byte[] buf = exponent.toByteArray ();
+ int length = (buf[0] == 0x00 ? buf.length -1 : buf.length);
+ int offset = (buf[0] == 0x00 ? 1 : 0);
+ int where = (buffer.getShort (0) & 0xFFFF) + 2;
+ buffer.putShort (where, (short) length);
+ buffer.position (where + 2);
+ buffer.put (buf, offset, length);
+ }
+
+ public String toString ()
+ {
+ return toString (null);
+ }
+
+ public String toString (final String prefix)
+ {
+ StringWriter str = new StringWriter ();
+ PrintWriter out = new PrintWriter (str);
+ if (prefix != null) out.print (prefix);
+ out.println ("struct {");
+ if (prefix != null) out.print (prefix);
+ out.print (" rsa_modulus: ");
+ out.println (modulus ().toString (16));
+ if (prefix != null) out.print (prefix);
+ out.print (" rsa_exponent: ");
+ out.println (exponent ());
+ if (prefix != null) out.print (prefix);
+ out.print ("} ServerRSAParams;");
+ return str.toString ();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/ServerRSA_PSKParameters.java b/libjava/classpath/gnu/javax/net/ssl/provider/ServerRSA_PSKParameters.java
new file mode 100644
index 00000000000..0d7b590d27f
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/ServerRSA_PSKParameters.java
@@ -0,0 +1,62 @@
+/* ServerRSA_PSKParameters.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.nio.ByteBuffer;
+
+/**
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class ServerRSA_PSKParameters extends ServerPSKParameters
+{
+ public ServerRSA_PSKParameters(ByteBuffer buffer)
+ {
+ super(buffer);
+ }
+
+ public ServerRSA_PSKParameters(String identityHint)
+ {
+ super(identityHint);
+ }
+
+ public @Override KeyExchangeAlgorithm algorithm()
+ {
+ return KeyExchangeAlgorithm.RSA_PSK;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Session.java b/libjava/classpath/gnu/javax/net/ssl/provider/Session.java
deleted file mode 100644
index e13758b0330..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/Session.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/* Session.java -- SSL and TLS session data.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.security.SecureRandom;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import javax.net.ssl.SSLPeerUnverifiedException;
-import javax.net.ssl.SSLPermission;
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.SSLSessionBindingEvent;
-import javax.net.ssl.SSLSessionBindingListener;
-import javax.net.ssl.SSLSessionContext;
-import javax.net.ssl.X509KeyManager;
-import javax.net.ssl.X509TrustManager;
-import javax.security.cert.X509Certificate;
-
-import gnu.javax.net.ssl.SRPTrustManager;
-
-/**
- * A generic SSL session implementation for SSL and TLS.
- */
-final class Session implements SSLSession
-{
-
- // Constants and fields.
- // -------------------------------------------------------------------------
-
- private static final SSLPermission GET_SESSION_CONTEXT_PERMISSION =
- new SSLPermission("getSSLSessionContext");
-
- private final long creationTime;
- private Date lastAccessedTime;
- ID sessionId;
- Certificate[] localCerts;
- Certificate[] peerCerts;
- X509Certificate[] peerCertChain;
- String peerHost;
- boolean peerVerified;
- SessionContext context;
- HashMap values;
- boolean valid;
- List enabledSuites;
- CipherSuite cipherSuite;
- SortedSet enabledProtocols;
- ProtocolVersion protocol;
- byte[] masterSecret;
- SRPTrustManager srpTrustManager;
- X509TrustManager trustManager;
- X509KeyManager keyManager;
- SecureRandom random;
- SecurityParameters params;
- Alert currentAlert;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- Session()
- {
- this(System.currentTimeMillis());
- }
-
- Session(long creationTime)
- {
- peerVerified = false;
- valid = true;
- this.creationTime = creationTime;
- lastAccessedTime = new Date(0L);
- values = new HashMap();
- if (("true").equalsIgnoreCase (Util.getSecurityProperty ("jessie.with.jce")))
- params = new JCESecurityParameters();
- else
- params = new GNUSecurityParameters (this);
- }
-
- // Public instance methods.
- // -------------------------------------------------------------------------
-
- protected Object clone()
- {
- Session result = new Session(creationTime);
- result.lastAccessedTime = lastAccessedTime;
- result.sessionId = sessionId;
- result.localCerts = (localCerts != null ? (Certificate[]) localCerts.clone() : null);
- result.peerCerts = (peerCerts != null ? (Certificate[]) peerCerts.clone() : null);
- result.peerHost = peerHost;
- result.peerVerified = peerVerified;
- result.context = context;
- result.values = values;
- result.enabledSuites = new ArrayList(enabledSuites);
- result.cipherSuite = cipherSuite;
- result.enabledProtocols = new TreeSet(enabledProtocols);
- result.protocol = protocol;
- result.masterSecret = masterSecret;
- result.keyManager = keyManager;
- result.srpTrustManager = srpTrustManager;
- result.trustManager = trustManager;
- result.random = random;
- return result;
- }
-
- public String getCipherSuite()
- {
- return cipherSuite.toString();
- }
-
- public long getCreationTime()
- {
- return creationTime;
- }
-
- public byte[] getId()
- {
- return (sessionId != null ? sessionId.getId() : null);
- }
-
- public long getLastAccessedTime()
- {
- return lastAccessedTime.getTime();
- }
-
- public Certificate[] getLocalCertificates()
- {
- return (Certificate[]) (localCerts != null ? localCerts.clone() : null);
- }
-
- public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException
- {
- if (!peerVerified)
- {
- throw new SSLPeerUnverifiedException("peer not verified");
- }
- return (Certificate[]) (peerCerts != null ? peerCerts.clone() : null);
- }
-
- public X509Certificate[] getPeerCertificateChain()
- throws SSLPeerUnverifiedException
- {
- if (!peerVerified)
- {
- throw new SSLPeerUnverifiedException("peer not verified");
- }
- if (peerCerts == null)
- {
- return null;
- }
- if (peerCertChain != null)
- {
- return (X509Certificate[]) peerCertChain.clone();
- }
- try
- {
- peerCertChain = new X509Certificate[peerCerts.length];
- for (int i = 0; i < peerCerts.length; i++)
- {
- peerCertChain[i] = X509Certificate.getInstance(peerCerts[i].getEncoded());
- }
- return (X509Certificate[]) peerCertChain.clone();
- }
- catch (javax.security.cert.CertificateException ce)
- {
- return null;
- }
- catch (CertificateException ce2)
- {
- return null;
- }
- }
-
- public String getPeerHost()
- {
- return peerHost;
- }
-
- public String getProtocol()
- {
- return protocol.toString();
- }
-
- public SSLSessionContext getSessionContext()
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- sm.checkPermission(GET_SESSION_CONTEXT_PERMISSION);
- }
- return context;
- }
-
- public String[] getValueNames()
- {
- Set names = values.keySet();
- return (String[]) names.toArray(new String[names.size()]);
- }
-
- public Object getValue(String name)
- {
- return values.get(name);
- }
-
- public void putValue(String name, Object value)
- {
- values.put(name, value);
- if (value instanceof SSLSessionBindingListener)
- {
- ((SSLSessionBindingListener) value).valueBound(
- new SSLSessionBindingEvent(this, name));
- }
- }
-
- public void removeValue(String name)
- {
- Object value = values.remove(name);
- if (value != null && (value instanceof SSLSessionBindingListener))
- {
- ((SSLSessionBindingListener) value).valueUnbound(
- new SSLSessionBindingEvent(this, name));
- }
- }
-
- public void invalidate()
- {
- if (masterSecret != null)
- {
- for (int i = 0; i < masterSecret.length; i++)
- {
- masterSecret[i] = 0;
- }
- masterSecret = null;
- }
- valid = false;
- }
-
- synchronized void access()
- {
- lastAccessedTime.setTime(System.currentTimeMillis());
- context.notifyAccess(this);
- }
-
- void setLastAccessedTime(long lastAccessedTime)
- {
- this.lastAccessedTime.setTime(lastAccessedTime);
- }
-
- // Inner classes.
- // -------------------------------------------------------------------------
-
- /**
- * A byte array with appropriate <code>equals()</code>,
- * <code>hashCode()</code>, and <code>compareTo()</code> semantics.
- */
- static final class ID implements Comparable
- {
-
- // Fields.
- // -----------------------------------------------------------------------
-
- /** The ID itself. */
- private final byte[] id;
-
- // Constructor.
- // -----------------------------------------------------------------------
-
- /**
- * Creates a new ID.
- *
- * @param id The ID. The array is not cloned.
- */
- ID(byte[] id)
- {
- if (id == null)
- {
- throw new IllegalArgumentException();
- }
- this.id = id;
- }
-
- // Instance methods.
- // -----------------------------------------------------------------------
-
- public byte[] getId()
- {
- return (byte[]) id.clone();
- }
-
- public boolean equals(Object other)
- {
- if (other == null || !(other instanceof ID))
- {
- return false;
- }
- return Arrays.equals(id, ((ID) other).id);
- }
-
- public int hashCode()
- {
- int code = 0;
- for (int i = 0; i < id.length; i++)
- {
- code |= (id[i] & 0xFF) << ((i & 3) << 3);
- }
- return code;
- }
-
- public int compareTo(Object other)
- {
- if (other == null || !(other instanceof ID))
- {
- return 1;
- }
- byte[] id2 = ((ID) other).id;
- if (id.length != id2.length)
- {
- return (id.length < id2.length) ? -1 : 1;
- }
- for (int i = 0; i < id.length; i++)
- {
- if (id[i] < id2[i])
- {
- return -1;
- }
- else if (id[i] > id2[i])
- {
- return 1;
- }
- }
- return 0;
- }
-
- public String toString()
- {
- return Util.toHexString(id, ':');
- }
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SessionContext.java b/libjava/classpath/gnu/javax/net/ssl/provider/SessionContext.java
deleted file mode 100644
index 9e265429aab..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/SessionContext.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/* SessionContext.java -- Implementation of a session context.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.security.Security;
-
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Vector;
-
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.SSLSessionContext;
-
-/**
- * A collection of SSL sessions. This implementation is a memory-only
- * store; subclasses may implement persistent storage.
- */
-class SessionContext implements SSLSessionContext
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- /** The map of Session.ID objects to Sessions. */
- protected final HashMap sessions;
-
- /** The number of sessions to cache. */
- protected int cacheSize;
-
- /** The session timeout, in seconds. */
- protected int timeout;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- SessionContext()
- {
- sessions = new HashMap();
- cacheSize = 0;
- try
- {
- timeout = Integer.parseInt(Util.getSecurityProperty("jessie.session.timeout"));
- }
- catch (Exception x)
- {
- // Default 24-hour timeout.
- timeout = 86400;
- }
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public synchronized Enumeration getIds()
- {
- Vector ids = new Vector();
- for(Iterator i = sessions.keySet().iterator(); i.hasNext(); )
- {
- Session.ID id = (Session.ID) i.next();
- ids.add(id.getId());
- }
- return ids.elements();
- }
-
- public synchronized SSLSession getSession(byte[] sessionId)
- {
- Session session = (Session) sessions.get(new Session.ID(sessionId));
- if (session == null)
- return null;
- long elapsed = System.currentTimeMillis() - session.getLastAccessedTime();
- if ((int) (elapsed / 1000) > timeout)
- {
- removeSession(session.sessionId);
- session.invalidate();
- return null;
- }
- if (!session.valid)
- {
- removeSession(session.sessionId);
- session.invalidate();
- return null;
- }
- return session;
- }
-
- public int getSessionCacheSize()
- {
- return cacheSize;
- }
-
- public void setSessionCacheSize(int cacheSize)
- {
- if (cacheSize < 0)
- throw new IllegalArgumentException();
- this.cacheSize = cacheSize;
- }
-
- public int getSessionTimeout()
- {
- return timeout;
- }
-
- public void setSessionTimeout(int timeout)
- {
- if (timeout <= 0)
- throw new IllegalArgumentException();
- this.timeout = timeout;
- }
-
- public String toString()
- {
- return sessions.keySet().toString();
- }
-
- // Package methods.
- // -------------------------------------------------------------------------
-
- /**
- * Adds a session to this context. This method:
- *
- * <ol>
- * <li>Will do nothing if the cache already contains the given ID.</li>
- * <li>Will do nothing if the cache limit has been reached (and is
- * not zero).</li>
- * <li>Will remove any invalid sessions in the cache before trying to insert
- * the new one.</li>
- * <li>Will remove any expired sessions before trying to insert the new
- * one.</li>
- * </ol>
- *
- * @param sessionId This session's ID.
- * @param session The session to add.
- * @return True if the session was added, false otherwise.
- */
- synchronized boolean addSession(Session.ID sessionId, Session session)
- {
- if (sessions.containsKey(sessionId))
- return false;
- if (cacheSize > 0 && sessions.size() > cacheSize)
- {
- boolean removed = false;
- for (Iterator i = sessions.values().iterator(); i.hasNext(); )
- {
- Session s = (Session) i.next();
- long elapsed = System.currentTimeMillis() - s.getCreationTime();
- if (!s.valid)
- {
- removeSession(session.sessionId);
- removed = true;
- }
- else if ((int) (elapsed / 1000) > timeout)
- {
- removeSession(session.sessionId);
- removed = true;
- }
- }
- if (removed)
- {
- sessions.put(sessionId, session);
- session.context = this;
- session.sessionId = sessionId;
- return true;
- }
- return false;
- }
- else
- {
- sessions.put(sessionId, session);
- session.context = this;
- session.sessionId = sessionId;
- return true;
- }
- }
-
- /**
- * Returns whether or not a session with the given ID is cached by this
- * context.
- */
- synchronized boolean containsSessionID(Session.ID sessionId)
- {
- Session s = (Session) sessions.get(sessionId);
- if (s == null)
- {
- return false;
- }
- long elapsed = System.currentTimeMillis() - s.getCreationTime();
- if (!s.valid || (int) (elapsed / 1000) > timeout)
- {
- removeSession(sessionId);
- return false;
- }
- return true;
- }
-
- /**
- * Removes a session from this context.
- *
- * @param sessionId The ID of the session to remove.
- */
- synchronized boolean removeSession(Session.ID sessionId)
- {
- return sessions.remove(sessionId) != null;
- }
-
- /**
- * Notifies this context of an access event on a session.
- *
- * @param session The session that was accessed.
- */
- void notifyAccess(Session session)
- {
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SessionImpl.java b/libjava/classpath/gnu/javax/net/ssl/provider/SessionImpl.java
new file mode 100644
index 00000000000..86dcb4915cd
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/SessionImpl.java
@@ -0,0 +1,198 @@
+/* SessionImpl.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.javax.crypto.key.GnuPBEKey;
+import gnu.javax.net.ssl.Session;
+import gnu.javax.net.ssl.Session.ID;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import java.security.Certificate;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.cert.X509Certificate;
+
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.SealedObject;
+import javax.crypto.spec.PBEKeySpec;
+import javax.net.ssl.SSLException;
+
+public class SessionImpl extends Session
+{
+ static final long serialVersionUID = 8932976607588442485L;
+ CipherSuite suite;
+ ProtocolVersion version;
+ byte[] privateDataSalt;
+ SealedObject sealedPrivateData;
+ MaxFragmentLength maxLength;
+
+ transient PrivateData privateData;
+
+ public SessionImpl()
+ {
+ super();
+ privateData = new PrivateData();
+ }
+
+ SecureRandom random ()
+ {
+ return random;
+ }
+
+ public String getProtocol()
+ {
+ return version.toString();
+ }
+
+ public void prepare(char[] passwd) throws SSLException
+ {
+ try
+ {
+ privateDataSalt = new byte[32];
+ random.nextBytes(privateDataSalt);
+ GnuPBEKey key = new GnuPBEKey(passwd, privateDataSalt, 1000);
+ Cipher cipher = Cipher.getInstance("PBEWithHMacSHA256AndAES/OFB/PKCS7Padding");
+ cipher.init(Cipher.ENCRYPT_MODE, key);
+ sealedPrivateData = new SealedObject(privateData, cipher);
+ }
+ catch (IllegalBlockSizeException ibse)
+ {
+ throw new SSLException(ibse);
+ }
+ catch (InvalidKeyException ike)
+ {
+ throw new SSLException(ike);
+ }
+ catch (IOException ioe)
+ {
+ throw new SSLException(ioe);
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ throw new SSLException(nsae);
+ }
+ catch (NoSuchPaddingException nspe)
+ {
+ throw new SSLException(nspe);
+ }
+ }
+
+ public void repair(char[] passwd) throws SSLException
+ {
+ try
+ {
+ GnuPBEKey key = new GnuPBEKey(passwd, privateDataSalt, 1000);
+ privateData = (PrivateData) sealedPrivateData.getObject(key);
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ throw new SSLException(cnfe);
+ }
+ catch (InvalidKeyException ike)
+ {
+ throw new SSLException(ike);
+ }
+ catch (IOException ioe)
+ {
+ throw new SSLException(ioe);
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ throw new SSLException(nsae);
+ }
+ }
+
+ public SealedObject privateData() throws SSLException
+ {
+ if (privateData == null)
+ throw new SSLException("this session has not been prepared");
+ return sealedPrivateData;
+ }
+
+ public void setPrivateData(SealedObject so) throws SSLException
+ {
+ this.sealedPrivateData = so;
+ }
+
+ void setApplicationBufferSize(int size)
+ {
+ applicationBufferSize = size;
+ }
+
+ void setRandom(SecureRandom random)
+ {
+ this.random = random;
+ }
+
+ void setTruncatedMac(boolean truncatedMac)
+ {
+ this.truncatedMac = truncatedMac;
+ }
+
+ void setId(Session.ID id)
+ {
+ this.sessionId = id;
+ }
+
+ void setLocalCertificates(java.security.cert.Certificate[] chain)
+ {
+ this.localCerts = chain;
+ }
+
+ void setPeerCertificates(java.security.cert.Certificate[] chain)
+ {
+ this.peerCerts = chain;
+ }
+
+ void setPeerVerified(boolean peerVerified)
+ {
+ this.peerVerified = peerVerified;
+ }
+
+ static class PrivateData implements Serializable
+ {
+ static final long serialVersionUID = -8040597659545984581L;
+ byte[] masterSecret;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Signature.java b/libjava/classpath/gnu/javax/net/ssl/provider/Signature.java
index c9be641431f..8c6cfadc734 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/Signature.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/Signature.java
@@ -1,4 +1,4 @@
-/* Signature.java -- SSL signature message.
+/* Signature.java -- SSL Signature structure.
Copyright (C) 2006 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -49,6 +49,8 @@ import java.io.StringWriter;
import java.math.BigInteger;
+import java.nio.ByteBuffer;
+
import java.security.PublicKey;
import java.security.interfaces.RSAKey;
@@ -56,103 +58,115 @@ import java.util.Arrays;
import gnu.java.security.der.*;
-class Signature implements Constructed
+/**
+ * The signature structure.
+ *
+ * <pre>
+select (SignatureAlgorithm)
+{
+case anonymous:
+ struct { };
+case rsa:
+ digitally-signed struct
+ {
+ opaque md5_hash[16];
+ opaque sha_hash[20];
+ };
+case dsa:
+ digitally-signed struct
+ {
+ opaque sha_hash[20];
+ };
+} Signature;</pre>
+ */
+public class Signature implements Builder, Constructed
{
// Fields.
// -------------------------------------------------------------------------
- private final Object sigValue;
- private final String sigAlg;
+ private final ByteBuffer buffer;
+ private final SignatureAlgorithm alg;
// Constructor.
// -------------------------------------------------------------------------
- Signature(Object sigValue, String sigAlg)
+ public Signature (final ByteBuffer buffer, final SignatureAlgorithm alg)
{
- this.sigValue = sigValue;
- this.sigAlg = sigAlg;
+ this.buffer = buffer;
+ this.alg = alg;
}
-
- // Class method.
- // -------------------------------------------------------------------------
-
- static Signature read(InputStream in, CipherSuite suite, PublicKey key)
- throws IOException
+
+ public Signature (final byte[] sigValue, final SignatureAlgorithm alg)
{
- Object sigValue = null;
- DataInputStream din = new DataInputStream(in);
- int len = din.readUnsignedShort();
- sigValue = new byte[len];
- din.readFully((byte[]) sigValue);
- if (suite.getSignature() == "DSS")
- {
- DERReader der = new DERReader(new ByteArrayInputStream((byte[]) sigValue));
- if (der.read().getTag() != DER.SEQUENCE)
- {
- throw new IOException("expecting DER SEQUENCE");
- }
- BigInteger r = (BigInteger) der.read().getValue();
- BigInteger s = (BigInteger) der.read().getValue();
- sigValue = new BigInteger[] { r, s };
- }
- return new Signature(sigValue, suite.getSignature());
+ buffer = ByteBuffer.allocate(sigValue.length + 2);
+ buffer.putShort((short) sigValue.length);
+ buffer.put(sigValue);
+ buffer.position(0);
+ this.alg = alg;
}
// Instance methods.
// -------------------------------------------------------------------------
- public void write(OutputStream out) throws IOException
+ public int length ()
+ {
+ if (alg.equals (SignatureAlgorithm.ANONYMOUS))
+ return 0;
+ return (buffer.getShort (0) & 0xFFFF) + 2;
+ }
+
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().limit(length());
+ }
+
+ public byte[] signature ()
{
- write(out, ProtocolVersion.TLS_1);
+ if (alg.equals (SignatureAlgorithm.ANONYMOUS))
+ return new byte[0];
+ int length = buffer.getShort (0) & 0xFFFF;
+ byte[] buf = new byte[length];
+ ((ByteBuffer) buffer.duplicate().position(2)).get(buf);
+ return buf;
}
- public void write(OutputStream out, ProtocolVersion version)
- throws IOException
+ public void setSignature (final byte[] signature)
{
- byte[] result = null;
- if (sigValue instanceof byte[])
- {
- result = (byte[]) sigValue;
- }
- else
- {
- DERValue r = new DERValue(DER.INTEGER, ((BigInteger[]) sigValue)[0]);
- DERValue s = new DERValue(DER.INTEGER, ((BigInteger[]) sigValue)[1]);
- DERValue sig = new DERValue(DER.SEQUENCE|DER.CONSTRUCTED,
- Arrays.asList(new Object[] { r, s }));
- result = sig.getEncoded();
- }
- out.write(result.length >>> 8 & 0xFF);
- out.write(result.length & 0xFF);
- out.write(result);
+ setSignature (signature, 0, signature.length);
}
- Object getSigValue()
+ public void setSignature (final byte[] signature, final int offset, final int length)
{
- return sigValue;
+ if (alg.equals (SignatureAlgorithm.ANONYMOUS))
+ return;
+ buffer.putShort (0, (short) length);
+ buffer.position (2);
+ buffer.put (signature, offset, length);
}
- String getSigAlg()
+ public String toString ()
{
- return sigAlg;
+ return toString (null);
}
- public String toString()
+ public String toString (final String prefix)
{
StringWriter str = new StringWriter();
PrintWriter out = new PrintWriter(str);
+ if (prefix != null)
+ out.print (prefix);
out.println("struct {");
- if (sigAlg.equals("RSA"))
- {
- out.print(Util.hexDump((byte[]) sigValue, " "));
- }
- else
+ if (!alg.equals (SignatureAlgorithm.ANONYMOUS))
{
- out.println(" r = " + ((BigInteger[]) sigValue)[0].toString(16) + ";");
- out.println(" s = " + ((BigInteger[]) sigValue)[1].toString(16) + ";");
+ String subprefix = " ";
+ if (prefix != null)
+ subprefix = prefix + subprefix;
+ out.print (Util.hexDump (signature (), subprefix));
}
- out.println("} Signature;");
+ if (prefix != null)
+ out.print (prefix);
+ out.print ("} Signature;");
return str.toString();
}
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SignatureAlgorithm.java b/libjava/classpath/gnu/javax/net/ssl/provider/SignatureAlgorithm.java
new file mode 100644
index 00000000000..a789576db90
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/SignatureAlgorithm.java
@@ -0,0 +1,62 @@
+/* SignatureAlgorithm.java -- Signature algorithm enumeration.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+public enum SignatureAlgorithm
+{
+ ANONYMOUS, RSA, DSA;
+
+ /**
+ * Returns the algorithm name for this signature algorithm, which can
+ * be used with the JCA API to get a {@link java.security.Signature} for
+ * that algorithm.
+ *
+ * @return The algorithm name.
+ */
+ public String algorithm()
+ {
+ switch (this)
+ {
+ case ANONYMOUS: return null;
+ case RSA: return "TLSv1.1-RSA";
+ case DSA: return "DSS";
+ }
+ return null;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SimpleSessionContext.java b/libjava/classpath/gnu/javax/net/ssl/provider/SimpleSessionContext.java
new file mode 100644
index 00000000000..b9d0f95519d
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/SimpleSessionContext.java
@@ -0,0 +1,146 @@
+/* SimpleSessionContext.java -- memory-only session store.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.javax.net.ssl.AbstractSessionContext;
+import gnu.javax.net.ssl.Session;
+import gnu.javax.net.ssl.SessionStoreException;
+import gnu.javax.net.ssl.Session.ID;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * A simple, non-persistent SessionContext.
+ *
+ * @author csm
+ */
+public final class SimpleSessionContext
+ extends AbstractSessionContext
+{
+ /**
+ * By default, sessions last for 5 minutes.
+ */
+ public static final int DEFAULT_TIMEOUT = 300;
+
+ private final HashMap<Session.ID, Session> store;
+ private int storeLimit;
+
+ public SimpleSessionContext()
+ {
+ super(DEFAULT_TIMEOUT);
+ storeLimit = 0;
+ store = new HashMap<Session.ID, Session>();
+ }
+
+ @Override
+ protected Session implGet(byte[] sessionId)
+ {
+ return store.get(new Session.ID(sessionId));
+ }
+
+ @Override
+ public void load(char[] password) throws SessionStoreException
+ {
+ // Not supported. Memory-only.
+ }
+
+ @Override
+ public void put(Session session)
+ {
+ if (storeLimit > 0 && store.size() >= storeLimit)
+ {
+ Session oldest = null;
+ for (Map.Entry<Session.ID, Session> e : store.entrySet())
+ {
+ Session s = e.getValue();
+ long stamp = s.getLastAccessedTime();
+ if (oldest == null || oldest.getLastAccessedTime() > stamp)
+ oldest = s;
+ }
+ store.remove(oldest.id());
+ }
+ store.put(session.id(), session);
+ }
+
+ @Override
+ public void remove(byte[] sessionId)
+ {
+ store.remove(new Session.ID(sessionId));
+ }
+
+ @Override
+ public void store(char[] password) throws SessionStoreException
+ {
+ // Not supported. Memory-only.
+ }
+
+ public Enumeration getIds()
+ {
+ return new Enumeration()
+ {
+ Iterator<Session.ID> it = store.keySet().iterator();
+
+ public boolean hasMoreElements()
+ {
+ return it.hasNext();
+ }
+
+ public Object nextElement()
+ {
+ return it.next().id();
+ }
+ };
+ }
+
+ public int getSessionCacheSize()
+ {
+ return storeLimit;
+ }
+
+ public void setSessionCacheSize(int size)
+ {
+ if (size < 0)
+ throw new IllegalArgumentException("cache size must be nonnegative");
+ this.storeLimit = size;
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/SynchronizedRandom.java b/libjava/classpath/gnu/javax/net/ssl/provider/SynchronizedRandom.java
deleted file mode 100644
index 4e22f08be08..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/SynchronizedRandom.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/* SynchronizedRandom.java -- Thread-safe IRandom wrapper.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.util.Map;
-import gnu.java.security.prng.IRandom;
-import gnu.java.security.prng.LimitReachedException;
-
-class SynchronizedRandom implements IRandom
-{
-
- // Field.
- // -------------------------------------------------------------------------
-
- private final IRandom random;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- SynchronizedRandom(IRandom random)
- {
- this.random = random;
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- public String name()
- {
- return random.name();
- }
-
- public synchronized void init(Map attrib)
- {
- random.init(attrib);
- }
-
- public synchronized byte nextByte()
- throws IllegalStateException, LimitReachedException
- {
- return random.nextByte();
- }
-
- public synchronized void nextBytes(byte[] buf, int off, int len)
- throws IllegalStateException, LimitReachedException
- {
- random.nextBytes(buf, off, len);
- }
-
- public synchronized Object clone()
- throws CloneNotSupportedException
- {
- return new SynchronizedRandom((IRandom) random.clone());
- }
-
- // For future versions of GNU Crypto. No-ops.
- public void addRandomByte (byte b)
- {
- }
-
- public void addRandomBytes(byte[] buffer) {
- addRandomBytes(buffer, 0, buffer.length);
- }
-
- public void addRandomBytes (byte[] b, int i, int j)
- {
- }
-}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/TruncatedHMAC.java b/libjava/classpath/gnu/javax/net/ssl/provider/TruncatedHMAC.java
new file mode 100644
index 00000000000..0595f87a7a6
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/TruncatedHMAC.java
@@ -0,0 +1,76 @@
+/* TruncatedHMAC.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.javax.net.ssl.provider.Extension.Value;
+
+import java.nio.ByteBuffer;
+
+/**
+ * The value type for the {@link Extension.Type#TRUNCATED_HMAC} extension.
+ * This extension has an empty value; this class is thusly empty.
+ *
+ * @author csm
+ */
+public class TruncatedHMAC extends Value
+{
+
+ public int length()
+ {
+ return 0;
+ }
+
+ public ByteBuffer buffer()
+ {
+ return ByteBuffer.wrap(new byte[0]);
+ }
+
+ public String toString()
+ {
+ return toString(null);
+ }
+
+ public String toString(String prefix)
+ {
+ String s = "TruncatedHMAC;";
+ if (prefix != null)
+ s = prefix + s;
+ return s;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/TrustedAuthorities.java b/libjava/classpath/gnu/javax/net/ssl/provider/TrustedAuthorities.java
new file mode 100644
index 00000000000..1e4b173595d
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/TrustedAuthorities.java
@@ -0,0 +1,298 @@
+/* TrustedAuthorities.java
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.java.security.x509.X500DistinguishedName;
+import gnu.javax.net.ssl.provider.Extension.Value;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+import javax.security.auth.x500.X500Principal;
+
+/**
+ * The trusted authorities hello extension.
+ *
+ * <pre>
+struct {
+ TrustedAuthority trusted_authorities_list&lt;0..2^16-1&gt;;
+} TrustedAuthorities;
+
+struct {
+ IdentifierType identifier_type;
+ select (identifier_type) {
+ case pre_agreed: struct {};
+ case key_sha1_hash: SHA1Hash;
+ case x509_name: DistinguishedName;
+ case cert_sha1_hash: SHA1Hash;
+ } identifier;
+} TrustedAuthority;
+
+enum {
+ pre_agreed(0), key_sha1_hash(1), x509_name(2),
+ cert_sha1_hash(3), (255)
+} IdentifierType;
+
+opaque DistinguishedName&lt;1..2^16-1&gt;;</pre>
+ *
+ * @author csm
+ */
+public class TrustedAuthorities extends Value
+ implements Iterable<TrustedAuthorities.TrustedAuthority>
+{
+ private final ByteBuffer buffer;
+
+ public TrustedAuthorities(final ByteBuffer buffer)
+ {
+ this.buffer = buffer.duplicate().order(ByteOrder.BIG_ENDIAN);
+ }
+
+ // XXX really implement Builder.
+
+ public int length()
+ {
+ return 2 + (buffer.getShort(0) & 0xFFFF);
+ }
+
+ public ByteBuffer buffer()
+ {
+ return (ByteBuffer) buffer.duplicate().limit(length());
+ }
+
+ public int size()
+ {
+ int len = buffer.getShort(0) & 0xFFFF;
+ int n = 0;
+ for (int i = 2; i < len; i++)
+ {
+ TrustedAuthority auth =
+ new TrustedAuthority((ByteBuffer) buffer.duplicate().position(i));
+ i += auth.length();
+ n++;
+ }
+ return n;
+ }
+
+ public TrustedAuthority get(final int index)
+ {
+ int len = buffer.getShort(0) & 0xFFFF;
+ int n = 0;
+ int i = 2;
+ while (i < len && n <= index)
+ {
+ TrustedAuthority auth =
+ new TrustedAuthority((ByteBuffer) buffer.duplicate().position(i));
+ if (n == index)
+ return auth;
+ i += auth.length();
+ n++;
+ }
+ throw new IndexOutOfBoundsException();
+ }
+
+ public String toString()
+ {
+ return toString(null);
+ }
+
+ public String toString(String prefix)
+ {
+ StringWriter str = new StringWriter();
+ PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print(prefix);
+ out.println("struct {");
+ String subprefix = " ";
+ if (prefix != null)
+ subprefix = prefix + subprefix;
+ for(TrustedAuthority ta : this)
+ out.println(ta);
+ if (prefix != null) out.print(prefix);
+ out.print("} TrustedAuthorities;");
+ return str.toString();
+ }
+
+ public Iterator<TrustedAuthority> iterator()
+ {
+ return new AuthoritiesIterator();
+ }
+
+ public class AuthoritiesIterator implements Iterator<TrustedAuthority>
+ {
+ private int index;
+
+ public AuthoritiesIterator()
+ {
+ index = 0;
+ }
+
+ public TrustedAuthority next() throws NoSuchElementException
+ {
+ try
+ {
+ return get(index++);
+ }
+ catch (IndexOutOfBoundsException ioobe)
+ {
+ throw new NoSuchElementException();
+ }
+ }
+
+ public boolean hasNext()
+ {
+ return index < size();
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ public static class TrustedAuthority implements Constructed
+ {
+ private final ByteBuffer buffer;
+
+ public TrustedAuthority(final ByteBuffer buffer)
+ {
+ this.buffer = buffer;
+ }
+
+ public int length()
+ {
+ switch (type().getValue())
+ {
+ case 0: return 1;
+ case 1:
+ case 3: return 21;
+ case 2: return 3 + (buffer.getShort(1) & 0xFFFF);
+ }
+ throw new IllegalArgumentException("unknown authority type");
+ }
+
+ public byte[] sha1Hash()
+ {
+ IdentifierType t = type();
+ if (t != IdentifierType.CERT_SHA1_HASH
+ && t != IdentifierType.KEY_SHA1_HASH)
+ throw new IllegalArgumentException(t + " does not have a hash value");
+ byte[] b = new byte[20];
+ ((ByteBuffer) buffer.duplicate().position(1)).get(b);
+ return b;
+ }
+
+ public X500Principal name()
+ {
+ int len = buffer.getShort(1) & 0xFFFF;
+ byte[] b = new byte[len];
+ ((ByteBuffer) buffer.duplicate().position(3)).get(b);
+ return new X500Principal(b);
+ }
+
+ public IdentifierType type()
+ {
+ switch (buffer.get(0))
+ {
+ case 0: return IdentifierType.PRE_AGREED;
+ case 1: return IdentifierType.KEY_SHA1_HASH;
+ case 2: return IdentifierType.X509_NAME;
+ case 3: return IdentifierType.CERT_SHA1_HASH;
+ }
+
+ throw new IllegalArgumentException("invalid IdentifierType");
+ }
+
+ public String toString()
+ {
+ return toString(null);
+ }
+
+ public String toString(String prefix)
+ {
+ StringWriter str = new StringWriter();
+ PrintWriter out = new PrintWriter(str);
+ if (prefix != null) out.print(prefix);
+ out.println("struct {");
+ if (prefix != null) out.print(prefix);
+ out.print(" identifier_type = ");
+ out.print(type());
+ out.println(";");
+ switch (type().getValue())
+ {
+ case 0: break;
+ case 1:
+ case 3:
+ if (prefix != null) out.print(prefix);
+ out.print(" sha1_hash = ");
+ out.print(Util.toHexString(sha1Hash(), ':'));
+ out.println(";");
+ break;
+
+ case 2:
+ if (prefix != null) out.print(prefix);
+ out.print(" name = ");
+ out.print(name());
+ out.println(";");
+ }
+ if (prefix != null) out.print(prefix);
+ out.print("} TrustedAuthority;");
+ return str.toString();
+ }
+ }
+
+ public static enum IdentifierType
+ {
+ PRE_AGREED (0), KEY_SHA1_HASH (1), X509_NAME (2), CERT_SHA1_HASH (3);
+
+ private final int value;
+
+ private IdentifierType(final int value)
+ {
+ this.value = value;
+ }
+
+ public int getValue()
+ {
+ return value;
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/UnresolvedExtensionValue.java b/libjava/classpath/gnu/javax/net/ssl/provider/UnresolvedExtensionValue.java
new file mode 100644
index 00000000000..2094daf9098
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/UnresolvedExtensionValue.java
@@ -0,0 +1,83 @@
+/* UnresolvedExtensionValue.jav --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import gnu.javax.net.ssl.provider.Extension.Value;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.ByteBuffer;
+
+public class UnresolvedExtensionValue extends Value
+{
+ private final ByteBuffer buffer;
+
+ public UnresolvedExtensionValue (final ByteBuffer buffer)
+ {
+ this.buffer = buffer;
+ }
+
+ public int length()
+ {
+ return buffer.limit();
+ }
+
+ public ByteBuffer buffer()
+ {
+ return value();
+ }
+
+ public ByteBuffer value()
+ {
+ return buffer.slice();
+ }
+
+ public String toString()
+ {
+ return toString(null);
+ }
+
+ public String toString(final String prefix)
+ {
+ String s = Util.hexDump(buffer);
+ if (prefix != null)
+ s = prefix + s;
+ return s;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/Util.java b/libjava/classpath/gnu/javax/net/ssl/provider/Util.java
index 15790dd26f8..ba8ea7db70b 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/Util.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/Util.java
@@ -38,11 +38,16 @@ exception statement from your version. */
package gnu.javax.net.ssl.provider;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.math.BigInteger;
+import java.nio.ByteBuffer;
+
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.Security;
@@ -52,7 +57,7 @@ import java.security.Security;
*
* @author Casey Marshall (rsdio@metastatic.org)
*/
-final class Util
+public final class Util
{
// Constants.
@@ -66,13 +71,40 @@ final class Util
// Class methods.
// -------------------------------------------------------------------------
+ public static Object wrapBuffer(ByteBuffer buffer)
+ {
+ return wrapBuffer(buffer, "");
+ }
+
+ public static Object wrapBuffer(ByteBuffer buffer, String prefix)
+ {
+ return new WrappedBuffer(buffer, prefix);
+ }
+
+ private static class WrappedBuffer
+ {
+ private final ByteBuffer buffer;
+ private final String prefix;
+
+ WrappedBuffer(ByteBuffer buffer, String prefix)
+ {
+ this.buffer = buffer;
+ this.prefix = prefix;
+ }
+
+ public String toString()
+ {
+ return hexDump(buffer, prefix);
+ }
+ }
+
/**
* Convert a hexadecimal string into its byte representation.
*
* @param hex The hexadecimal string.
* @return The converted bytes.
*/
- static byte[] toByteArray(String hex)
+ public static byte[] toByteArray(String hex)
{
hex = hex.toLowerCase();
byte[] buf = new byte[hex.length() / 2];
@@ -94,7 +126,7 @@ final class Util
* @param len The number of bytes to format.
* @return A hexadecimal representation of the specified bytes.
*/
- static String toHexString(byte[] buf, int off, int len)
+ public static String toHexString(byte[] buf, int off, int len)
{
StringBuffer str = new StringBuffer();
for (int i = 0; i < len; i++)
@@ -108,7 +140,7 @@ final class Util
/**
* See {@link #toHexString(byte[],int,int)}.
*/
- static String toHexString(byte[] buf)
+ public static String toHexString(byte[] buf)
{
return Util.toHexString(buf, 0, buf.length);
}
@@ -123,7 +155,7 @@ final class Util
* @param sep The character to insert between octets.
* @return A hexadecimal representation of the specified bytes.
*/
- static String toHexString(byte[] buf, int off, int len, char sep)
+ public static String toHexString(byte[] buf, int off, int len, char sep)
{
StringBuffer str = new StringBuffer();
for (int i = 0; i < len; i++)
@@ -139,7 +171,7 @@ final class Util
/**
* See {@link #toHexString(byte[],int,int,char)}.
*/
- static String toHexString(byte[] buf, char sep)
+ public static String toHexString(byte[] buf, char sep)
{
return Util.toHexString(buf, 0, buf.length, sep);
}
@@ -159,7 +191,7 @@ final class Util
* @param prefix A string to prepend to every line.
* @return The formatted string.
*/
- static String hexDump(byte[] buf, int off, int len, String prefix)
+ public static String hexDump(byte[] buf, int off, int len, String prefix)
{
String nl = getProperty("line.separator");
StringBuffer str = new StringBuffer();
@@ -172,7 +204,7 @@ final class Util
str.append(" ");
String s = Util.toHexString(buf, i+off, Math.min(16, len-i), ' ');
str.append(s);
- for (int j = 56 - (56 - s.length()); j < 56; j++)
+ for (int j = s.length(); j < 49; j++)
str.append(" ");
for (int j = 0; j < Math.min(16, len - i); j++)
{
@@ -187,10 +219,49 @@ final class Util
return str.toString();
}
+ public static String hexDump (ByteBuffer buf)
+ {
+ return hexDump (buf, null);
+ }
+
+ public static String hexDump (ByteBuffer buf, String prefix)
+ {
+ buf = buf.duplicate();
+ StringWriter str = new StringWriter ();
+ PrintWriter out = new PrintWriter (str);
+ int i = 0;
+ int len = buf.remaining();
+ byte[] line = new byte[16];
+ while (i < len)
+ {
+ if (prefix != null)
+ out.print(prefix);
+ out.print(Util.formatInt (i, 16, 8));
+ out.print(" ");
+ int l = Math.min(16, len - i);
+ buf.get(line, 0, l);
+ String s = Util.toHexString(line, 0, l, ' ');
+ out.print(s);
+ for (int j = s.length(); j < 49; j++)
+ out.print(' ');
+ for (int j = 0; j < l; j++)
+ {
+ int c = line[j] & 0xFF;
+ if (c < 0x20 || c > 0x7E)
+ out.print('.');
+ else
+ out.print((char) c);
+ }
+ out.println();
+ i += 16;
+ }
+ return str.toString();
+ }
+
/**
* See {@link #hexDump(byte[],int,int,String)}.
*/
- static String hexDump(byte[] buf, int off, int len)
+ public static String hexDump(byte[] buf, int off, int len)
{
return hexDump(buf, off, len, "");
}
@@ -198,7 +269,7 @@ final class Util
/**
* See {@link #hexDump(byte[],int,int,String)}.
*/
- static String hexDump(byte[] buf, String prefix)
+ public static String hexDump(byte[] buf, String prefix)
{
return hexDump(buf, 0, buf.length, prefix);
}
@@ -206,7 +277,7 @@ final class Util
/**
* See {@link #hexDump(byte[],int,int,String)}.
*/
- static String hexDump(byte[] buf)
+ public static String hexDump(byte[] buf)
{
return hexDump(buf, 0, buf.length);
}
@@ -220,7 +291,7 @@ final class Util
* zero-padded to this length, but may be longer.
* @return The formatted integer.
*/
- static String formatInt(int i, int radix, int len)
+ public static String formatInt(int i, int radix, int len)
{
String s = Integer.toString(i, radix);
StringBuffer buf = new StringBuffer();
@@ -237,7 +308,7 @@ final class Util
* @param b2 The second byte array.
* @return The concatenation of b1 and b2.
*/
- static byte[] concat(byte[] b1, byte[] b2)
+ public static byte[] concat(byte[] b1, byte[] b2)
{
byte[] b3 = new byte[b1.length+b2.length];
System.arraycopy(b1, 0, b3, 0, b1.length);
@@ -248,7 +319,7 @@ final class Util
/**
* See {@link #trim(byte[],int,int)}.
*/
- static byte[] trim(byte[] buffer, int len)
+ public static byte[] trim(byte[] buffer, int len)
{
return trim(buffer, 0, len);
}
@@ -266,7 +337,7 @@ final class Util
* length.
* @return The trimmed byte array.
*/
- static byte[] trim(byte[] buffer, int off, int len)
+ public static byte[] trim(byte[] buffer, int off, int len)
{
if (off < 0 || len < 0 || off > buffer.length)
throw new IndexOutOfBoundsException("max=" + buffer.length +
@@ -286,7 +357,7 @@ final class Util
* @return The byte representation of the big integer, with any leading
* zero removed.
*/
- static byte[] trim(BigInteger bi)
+ public static byte[] trim(BigInteger bi)
{
byte[] buf = bi.toByteArray();
if (buf[0] == 0x00 && !bi.equals(BigInteger.ZERO))
@@ -305,7 +376,7 @@ final class Util
*
* @return The current time, in seconds.
*/
- static int unixTime()
+ public static int unixTime()
{
return (int) (System.currentTimeMillis() / 1000L);
}
@@ -385,7 +456,7 @@ final class Util
* @throws SecurityException If the Jessie code still does not have
* permission to read the property.
*/
- static String getProperty(final String name)
+ @Deprecated static String getProperty(final String name)
{
return (String) AccessController.doPrivileged(
new PrivilegedAction()
@@ -407,7 +478,7 @@ final class Util
* @throws SecurityException If the Jessie code still does not have
* permission to read the property.
*/
- static String getSecurityProperty(final String name)
+ @Deprecated static String getSecurityProperty(final String name)
{
return (String) AccessController.doPrivileged(
new PrivilegedAction()
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/X500PrincipalList.java b/libjava/classpath/gnu/javax/net/ssl/provider/X500PrincipalList.java
new file mode 100644
index 00000000000..1c88479cbbc
--- /dev/null
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/X500PrincipalList.java
@@ -0,0 +1,272 @@
+/* X500PrincipalList.java -- A list of X.500 names.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.net.ssl.provider;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import java.nio.ByteBuffer;
+
+import java.util.ConcurrentModificationException;
+import java.util.ListIterator;
+import java.util.NoSuchElementException;
+
+import javax.security.auth.x500.X500Principal;
+
+public final class X500PrincipalList implements Iterable<X500Principal>
+{
+ private final ByteBuffer buffer;
+ private int modCount;
+
+ public X500PrincipalList (final ByteBuffer buffer)
+ {
+ this.buffer = buffer;
+ modCount = 0;
+ }
+
+ public int size ()
+ {
+ return (buffer.getShort (0) & 0xFFFF);
+ }
+
+ public int count ()
+ {
+ int size = size ();
+ int i = 0;
+ for (int offset = 2; offset < size; i++)
+ {
+ int _size = (buffer.getShort (offset) & 0xFFFF);
+ // We don't want this going into an infinite loop if
+ // you mistakenly put a zero-length name.
+ if (_size == 0)
+ break;
+ offset += _size + 2;
+ }
+ return i;
+ }
+
+ public X500Principal get (final int index)
+ {
+ if (index < 0)
+ throw new IndexOutOfBoundsException ("negative index");
+ int size = size ();
+ int i = 0;
+ for (int offset = 2; offset < size; i++)
+ {
+ int _size = (buffer.getShort (offset) & 0xFFFF);
+ if (_size == 0)
+ throw new IndexOutOfBoundsException ("zero-length name encountered");
+ if (i == index)
+ {
+ byte[] buf = new byte[_size];
+ buffer.position (offset + 2);
+ buffer.get (buf);
+ return new X500Principal (buf);
+ }
+ offset += 2 + _size;
+ }
+ throw new IndexOutOfBoundsException ("limit: " + i + "; requested: " + index);
+ }
+
+ public void put (final int index, final X500Principal principal)
+ {
+ put (index, principal.getEncoded ());
+ }
+
+ public void put (final int index, final byte[] encoded)
+ {
+ if (index < 0)
+ throw new IndexOutOfBoundsException ("negative index");
+ int size = size ();
+ int i = 0;
+ for (int offset = 2; offset < size; i++)
+ {
+ int off = (buffer.getShort (offset) & 0xFFFF);
+ if (i == index)
+ {
+ buffer.putShort (offset, (short) encoded.length);
+ buffer.position (offset + 2);
+ buffer.put (encoded);
+ modCount++;
+ return;
+ }
+ offset += 2 + off;
+ }
+ throw new IndexOutOfBoundsException ("limit: " + (i-1) + "; requested: " + index);
+ }
+
+ public void setSize (final int numNames, final int namesSize)
+ {
+ if (numNames < 1)
+ throw new IllegalArgumentException ("must have at least one name");
+ int size = (numNames * 2) + namesSize;
+ if (size < 3 || size > buffer.capacity () || size > 0xFFFF)
+ throw new IllegalArgumentException ("size out of range; maximum: "
+ + Math.min (buffer.capacity (), 0xFFFF));
+ buffer.putShort (0, (short) size);
+ }
+
+ public String toString ()
+ {
+ return toString (null);
+ }
+
+ public String toString (final String prefix)
+ {
+ StringWriter str = new StringWriter ();
+ PrintWriter out = new PrintWriter (str);
+ if (prefix != null) out.print (prefix);
+ out.print ("[");
+ out.print (count ());
+ out.println ("] {");
+ for (Iterator it = new Iterator (); it.hasNext (); )
+ {
+ if (prefix != null) out.print (prefix);
+ out.print (" ");
+ out.println (it.next ());
+ }
+ if (prefix != null) out.print (prefix);
+ out.print ("};");
+ return str.toString ();
+ }
+
+ public boolean equals (Object o)
+ {
+ if (!(o instanceof X500PrincipalList))
+ return false;
+ X500PrincipalList that = (X500PrincipalList) o;
+
+ if (size () != that.size ())
+ return false;
+
+ for (Iterator it1 = new Iterator (), it2 = that.new Iterator ();
+ it1.hasNext () && it2.hasNext (); )
+ {
+ if (!it1.next ().equals (it2.next ()))
+ return false;
+ }
+ return true;
+ }
+
+ public java.util.Iterator<X500Principal> iterator ()
+ {
+ return new Iterator();
+ }
+
+ public class Iterator implements ListIterator<X500Principal>
+ {
+ private final int modCount;
+ private int index;
+ private final int count;
+
+ public Iterator ()
+ {
+ this.modCount = X500PrincipalList.this.modCount;
+ index = 0;
+ count = count ();
+ }
+
+ public void add (X500Principal o)
+ {
+ throw new UnsupportedOperationException ();
+ }
+
+ public boolean hasNext ()
+ {
+ return (index < count);
+ }
+
+ public boolean hasPrevious ()
+ {
+ return (index > 0);
+ }
+
+ public X500Principal next () throws NoSuchElementException
+ {
+ if (modCount != X500PrincipalList.this.modCount)
+ throw new ConcurrentModificationException ();
+ try
+ {
+ return get (index++);
+ }
+ catch (IndexOutOfBoundsException ioobe)
+ {
+ throw new NoSuchElementException ();
+ }
+ }
+
+ public int nextIndex ()
+ {
+ if (hasNext ())
+ return (index + 1);
+ return -1;
+ }
+
+ public X500Principal previous () throws NoSuchElementException
+ {
+ if (index == 0)
+ throw new NoSuchElementException ();
+ if (modCount != X500PrincipalList.this.modCount)
+ throw new ConcurrentModificationException ();
+ try
+ {
+ return get (--index);
+ }
+ catch (IndexOutOfBoundsException ioobe)
+ {
+ throw new NoSuchElementException ();
+ }
+ }
+
+ public int previousIndex ()
+ {
+ return (index - 1);
+ }
+
+ public void remove ()
+ {
+ throw new UnsupportedOperationException ();
+ }
+
+ public void set (final X500Principal o)
+ {
+ throw new UnsupportedOperationException ();
+ }
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/X509KeyManagerFactory.java b/libjava/classpath/gnu/javax/net/ssl/provider/X509KeyManagerFactory.java
index 476655c45da..dc772886697 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/X509KeyManagerFactory.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/X509KeyManagerFactory.java
@@ -54,7 +54,6 @@ import java.security.NoSuchAlgorithmException;
import java.security.Principal;
import java.security.PrivateKey;
import java.security.PublicKey;
-import java.security.Security;
import java.security.UnrecoverableKeyException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
@@ -76,6 +75,8 @@ import javax.crypto.interfaces.DHPublicKey;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactorySpi;
import javax.net.ssl.ManagerFactoryParameters;
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.X509ExtendedKeyManager;
import javax.net.ssl.X509KeyManager;
import gnu.javax.net.ssl.NullManagerParameters;
@@ -122,13 +123,17 @@ public class X509KeyManagerFactory extends KeyManagerFactorySpi
}
else if (params instanceof PrivateCredentials)
{
- List chains = ((PrivateCredentials) params).getCertChains();
- List keys = ((PrivateCredentials) params).getPrivateKeys();
+ List<X509Certificate[]> chains
+ = ((PrivateCredentials) params).getCertChains();
+ List<PrivateKey> keys
+ = ((PrivateCredentials) params).getPrivateKeys();
int i = 0;
- HashMap certMap = new HashMap();
- HashMap keyMap = new HashMap();
- Iterator c = chains.iterator();
- Iterator k = keys.iterator();
+ HashMap<String, X509Certificate[]> certMap
+ = new HashMap<String, X509Certificate[]>();
+ HashMap<String, PrivateKey> keyMap
+ = new HashMap<String, PrivateKey>();
+ Iterator<X509Certificate[]> c = chains.iterator();
+ Iterator<PrivateKey> k = keys.iterator();
while (c.hasNext() && k.hasNext())
{
certMap.put(String.valueOf(i), c.next());
@@ -171,8 +176,9 @@ public class X509KeyManagerFactory extends KeyManagerFactorySpi
}
}
- HashMap p = new HashMap();
- HashMap c = new HashMap();
+ HashMap<String, PrivateKey> p = new HashMap<String, PrivateKey>();
+ HashMap<String, X509Certificate[]> c
+ = new HashMap<String, X509Certificate[]>();
Enumeration aliases = store.aliases();
UnrecoverableKeyException exception = null;
while (aliases.hasMoreElements())
@@ -236,18 +242,19 @@ public class X509KeyManagerFactory extends KeyManagerFactorySpi
// Inner class.
// -------------------------------------------------------------------------
- private class Manager implements X509KeyManager
+ private class Manager extends X509ExtendedKeyManager
{
// Fields.
// -----------------------------------------------------------------------
- private final Map privateKeys;
- private final Map certChains;
+ private final Map<String, PrivateKey> privateKeys;
+ private final Map<String, X509Certificate[]> certChains;
// Constructor.
// -----------------------------------------------------------------------
- Manager(Map privateKeys, Map certChains)
+ Manager(Map<String, PrivateKey> privateKeys,
+ Map<String, X509Certificate[]> certChains)
{
this.privateKeys = privateKeys;
this.certChains = certChains;
@@ -267,6 +274,19 @@ public class X509KeyManagerFactory extends KeyManagerFactorySpi
}
return null;
}
+
+ public @Override String chooseEngineClientAlias(String[] keyTypes,
+ Principal[] issuers,
+ SSLEngine engine)
+ {
+ for (String type : keyTypes)
+ {
+ String[] s = getClientAliases(type, issuers);
+ if (s.length > 0)
+ return s[0];
+ }
+ return null;
+ }
public String[] getClientAliases(String keyType, Principal[] issuers)
{
@@ -281,6 +301,16 @@ public class X509KeyManagerFactory extends KeyManagerFactorySpi
return s[0];
return null;
}
+
+ public @Override String chooseEngineServerAlias(String keyType,
+ Principal[] issuers,
+ SSLEngine engine)
+ {
+ String[] s = getServerAliases(keyType, issuers);
+ if (s.length > 0)
+ return s[0];
+ return null;
+ }
public String[] getServerAliases(String keyType, Principal[] issuers)
{
@@ -289,7 +319,7 @@ public class X509KeyManagerFactory extends KeyManagerFactorySpi
private String[] getAliases(String keyType, Principal[] issuers)
{
- LinkedList l = new LinkedList();
+ LinkedList<String> l = new LinkedList<String>();
for (Iterator i = privateKeys.keySet().iterator(); i.hasNext(); )
{
String alias = (String) i.next();
@@ -300,21 +330,27 @@ public class X509KeyManagerFactory extends KeyManagerFactorySpi
if (privKey == null)
continue;
PublicKey pubKey = chain[0].getPublicKey();
- if (keyType.equals("RSA") || keyType.equals("DHE_RSA") ||
- keyType.equals("SRP_RSA") || keyType.equals("rsa_sign"))
+ if (keyType.equalsIgnoreCase("RSA")
+ || keyType.equalsIgnoreCase("DHE_RSA")
+ || keyType.equalsIgnoreCase("SRP_RSA")
+ || keyType.equalsIgnoreCase("rsa_sign")
+ || keyType.equalsIgnoreCase("RSA_PSK"))
{
if (!(privKey instanceof RSAPrivateKey) ||
!(pubKey instanceof RSAPublicKey))
continue;
}
- if (keyType.equals("DHE_DSS") || keyType.equals("dss_sign") ||
- keyType.equals("SRP_DSS"))
+ else if (keyType.equalsIgnoreCase("DHE_DSS")
+ || keyType.equalsIgnoreCase("dss_sign")
+ || keyType.equalsIgnoreCase("SRP_DSS")
+ || keyType.equalsIgnoreCase("DSA"))
{
if (!(privKey instanceof DSAPrivateKey) ||
!(pubKey instanceof DSAPublicKey))
continue;
}
- if (keyType.equals("DH_RSA") || keyType.equals("rsa_fixed_dh"))
+ else if (keyType.equalsIgnoreCase("DH_RSA")
+ || keyType.equalsIgnoreCase("rsa_fixed_dh"))
{
if (!(privKey instanceof DHPrivateKey) ||
!(pubKey instanceof DHPublicKey))
@@ -322,7 +358,8 @@ public class X509KeyManagerFactory extends KeyManagerFactorySpi
if (!chain[0].getSigAlgName().equalsIgnoreCase("RSA"))
continue;
}
- if (keyType.equals("DH_DSS") || keyType.equals("dss_fixed_dh"))
+ else if (keyType.equalsIgnoreCase("DH_DSS")
+ || keyType.equalsIgnoreCase("dss_fixed_dh"))
{
if (!(privKey instanceof DHPrivateKey) ||
!(pubKey instanceof DHPublicKey))
@@ -330,19 +367,23 @@ public class X509KeyManagerFactory extends KeyManagerFactorySpi
if (!chain[0].getSigAlgName().equalsIgnoreCase("DSA"))
continue;
}
+ else // Unknown key type; ignore it.
+ continue;
if (issuers == null || issuers.length == 0)
{
l.add(alias);
continue;
}
- for (int j = 0; j < issuers.length; j++)
- if (chain[0].getIssuerDN().equals(issuers[j]))
- {
- l.add(alias);
- break;
- }
+ for (Principal issuer : issuers)
+ {
+ if (chain[0].getIssuerDN().equals(issuer))
+ {
+ l.add(alias);
+ break;
+ }
+ }
}
- return (String[]) l.toArray(new String[l.size()]);
+ return l.toArray(new String[l.size()]);
}
public X509Certificate[] getCertificateChain(String alias)
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/X509TrustManagerFactory.java b/libjava/classpath/gnu/javax/net/ssl/provider/X509TrustManagerFactory.java
index 4f049e916d9..1a0591284a4 100644
--- a/libjava/classpath/gnu/javax/net/ssl/provider/X509TrustManagerFactory.java
+++ b/libjava/classpath/gnu/javax/net/ssl/provider/X509TrustManagerFactory.java
@@ -45,17 +45,20 @@ import java.util.Arrays;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.LinkedList;
+import java.util.Set;
+import java.security.AccessController;
import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Security;
-import java.security.SignatureException;
+import java.security.cert.CertPath;
+import java.security.cert.CertPathValidator;
+import java.security.cert.CertPathValidatorException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
+import java.security.cert.PKIXParameters;
+import java.security.cert.TrustAnchor;
import java.security.cert.X509Certificate;
import javax.net.ssl.ManagerFactoryParameters;
@@ -63,6 +66,8 @@ import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactorySpi;
import javax.net.ssl.X509TrustManager;
+import gnu.java.security.action.GetPropertyAction;
+import gnu.java.security.x509.X509CertPath;
import gnu.javax.net.ssl.NullManagerParameters;
import gnu.javax.net.ssl.StaticTrustAnchors;
@@ -76,21 +81,22 @@ public class X509TrustManagerFactory extends TrustManagerFactorySpi
// Constants and fields.
// -------------------------------------------------------------------------
+ private static final String sep
+ = AccessController.doPrivileged(new GetPropertyAction("file.separator"));
+
/**
* The location of the JSSE key store.
*/
- private static final String JSSE_CERTS = Util.getProperty("java.home")
- + Util.getProperty("file.separator") + "lib"
- + Util.getProperty("file.separator") + "security"
- + Util.getProperty("file.separator") + "jssecerts";
+ private static final String JSSE_CERTS
+ = AccessController.doPrivileged(new GetPropertyAction("java.home"))
+ + sep + "lib" + sep + "security" + sep + "jssecerts";
/**
* The location of the system key store, containing the CA certs.
*/
- private static final String CA_CERTS = Util.getProperty("java.home")
- + Util.getProperty("file.separator") + "lib"
- + Util.getProperty("file.separator") + "security"
- + Util.getProperty("file.separator") + "cacerts";
+ private static final String CA_CERTS
+ = AccessController.doPrivileged(new GetPropertyAction("java.home"))
+ + sep + "lib" + sep + "security" + sep + "cacerts";
private Manager current;
@@ -135,13 +141,14 @@ public class X509TrustManagerFactory extends TrustManagerFactorySpi
{
if (store == null)
{
- String s = Util.getProperty("javax.net.ssl.trustStoreType");
+ GetPropertyAction gpa = new GetPropertyAction("javax.net.ssl.trustStoreType");
+ String s = AccessController.doPrivileged(gpa);
if (s == null)
s = KeyStore.getDefaultType();
store = KeyStore.getInstance(s);
try
{
- s = Util.getProperty("javax.net.ssl.trustStore");
+ s = AccessController.doPrivileged(gpa.setParameters("javax.net.ssl.trustStore"));
FileInputStream in = null;
if (s == null)
{
@@ -158,24 +165,24 @@ public class X509TrustManagerFactory extends TrustManagerFactorySpi
{
in = new FileInputStream(s);
}
- String p = Util.getProperty("javax.net.ssl.trustStorePassword");
+ String p = AccessController.doPrivileged(gpa.setParameters("javax.net.ssl.trustStorePassword"));
store.load(in, p != null ? p.toCharArray() : null);
}
catch (IOException ioe)
{
- throw new KeyStoreException(ioe.toString());
+ throw new KeyStoreException(ioe);
}
catch (CertificateException ce)
{
- throw new KeyStoreException(ce.toString());
+ throw new KeyStoreException(ce);
}
catch (NoSuchAlgorithmException nsae)
{
- throw new KeyStoreException(nsae.toString());
+ throw new KeyStoreException(nsae);
}
}
- LinkedList l = new LinkedList();
+ LinkedList<X509Certificate> l = new LinkedList<X509Certificate>();
Enumeration aliases = store.aliases();
while (aliases.hasMoreElements())
{
@@ -185,10 +192,9 @@ public class X509TrustManagerFactory extends TrustManagerFactorySpi
Certificate c = store.getCertificate(alias);
if (!(c instanceof X509Certificate))
continue;
- l.add(c);
+ l.add((X509Certificate) c);
}
- current = this.new Manager((X509Certificate[])
- l.toArray(new X509Certificate[l.size()]));
+ current = this.new Manager(l.toArray(new X509Certificate[l.size()]));
}
// Inner class.
@@ -203,14 +209,21 @@ public class X509TrustManagerFactory extends TrustManagerFactorySpi
// Fields.
// -----------------------------------------------------------------------
- private final X509Certificate[] trusted;
+ private final Set<TrustAnchor> anchors;
// Constructor.
// -----------------------------------------------------------------------
Manager(X509Certificate[] trusted)
{
- this.trusted = trusted;
+ anchors = new HashSet<TrustAnchor>();
+ if (trusted != null)
+ {
+ for (X509Certificate cert : trusted)
+ {
+ anchors.add(new TrustAnchor(cert, null));
+ }
+ }
}
// Instance methodns.
@@ -230,9 +243,7 @@ public class X509TrustManagerFactory extends TrustManagerFactorySpi
public X509Certificate[] getAcceptedIssuers()
{
- if (trusted == null)
- return new X509Certificate[0];
- return (X509Certificate[]) trusted.clone();
+ return anchors.toArray(new X509Certificate[anchors.size()]);
}
// Own methods.
@@ -241,58 +252,44 @@ public class X509TrustManagerFactory extends TrustManagerFactorySpi
private void checkTrusted(X509Certificate[] chain, String authType)
throws CertificateException
{
- // NOTE: this is not a full-featured path validation algorithm.
- //
- // Step 0: check if the target is valid now.
- chain[0].checkValidity();
-
- // Step 1: verify that the chain is complete and valid.
- for (int i = 1; i < chain.length; i++)
+ CertPathValidator validator = null;
+
+ try
{
- chain[i].checkValidity();
- try
- {
- chain[i-1].verify(chain[i].getPublicKey());
- }
- catch (NoSuchAlgorithmException nsae)
- {
- throw new CertificateException(nsae.toString());
- }
- catch (NoSuchProviderException nspe)
- {
- throw new CertificateException(nspe.toString());
- }
- catch (InvalidKeyException ike)
- {
- throw new CertificateException(ike.toString());
- }
- catch (SignatureException se)
- {
- throw new CertificateException(se.toString());
- }
+ validator = CertPathValidator.getInstance("PKIX");
}
-
- // Step 2: verify that the root of the chain was issued by a trust anchor.
- if (trusted == null || trusted.length == 0)
- throw new CertificateException("no trust anchors");
- for (int i = 0; i < trusted.length; i++)
+ catch (NoSuchAlgorithmException nsae)
{
- try
- {
- trusted[i].checkValidity();
- chain[chain.length-1].verify(trusted[i].getPublicKey());
- return;
- }
- catch (Exception e)
- {
- }
- //catch (CertificateException ce) { }
- //catch (NoSuchAlgorithmException nsae) { }
- //catch (NoSuchProviderException nspe) { }
- //catch (InvalidKeyException ike) { }
- //catch (SignatureException se) { }
+ throw new CertificateException(nsae);
+ }
+
+ CertPath path = new X509CertPath(Arrays.asList(chain));
+
+ PKIXParameters params = null;
+ try
+ {
+ params = new PKIXParameters(anchors);
+ // XXX we probably do want to enable revocation, but it's a pain
+ // in the ass.
+ params.setRevocationEnabled(false);
+ }
+ catch (InvalidAlgorithmParameterException iape)
+ {
+ throw new CertificateException(iape);
+ }
+
+ try
+ {
+ validator.validate(path, params);
+ }
+ catch (CertPathValidatorException cpve)
+ {
+ throw new CertificateException(cpve);
+ }
+ catch (InvalidAlgorithmParameterException iape)
+ {
+ throw new CertificateException(iape);
}
- throw new CertificateException();
}
}
}
diff --git a/libjava/classpath/gnu/javax/net/ssl/provider/XMLSessionContext.java b/libjava/classpath/gnu/javax/net/ssl/provider/XMLSessionContext.java
deleted file mode 100644
index dcfa9d4adc9..00000000000
--- a/libjava/classpath/gnu/javax/net/ssl/provider/XMLSessionContext.java
+++ /dev/null
@@ -1,619 +0,0 @@
-/* XMLSessionContext.java -- XML-encoded persistent SSL sessions.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is a part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.net.ssl.provider;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-
-import java.security.SecureRandom;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateEncodingException;
-import java.security.cert.CertificateFactory;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeSet;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.GZIPOutputStream;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import gnu.javax.crypto.mac.IMac;
-import gnu.javax.crypto.mac.MacFactory;
-import gnu.javax.crypto.mode.IMode;
-import gnu.javax.crypto.mode.ModeFactory;
-import gnu.javax.crypto.prng.IPBE;
-import gnu.java.security.prng.IRandom;
-import gnu.java.security.prng.PRNGFactory;
-
-import gnu.javax.net.ssl.Base64;
-
-/**
- * An implementation of session contexts that stores session data on the
- * filesystem in a simple XML-encoded file.
- */
-class XMLSessionContext extends SessionContext
-{
-
- // Fields.
- // -------------------------------------------------------------------------
-
- private final File file;
- private final IRandom pbekdf;
- private final boolean compress;
- private final SecureRandom random;
- private boolean encoding;
-
- // Constructor.
- // -------------------------------------------------------------------------
-
- XMLSessionContext() throws IOException, SAXException
- {
- file = new File(Util.getSecurityProperty("jessie.SessionContext.xml.file"));
- String password = Util.getSecurityProperty("jessie.SessionContext.xml.password");
- compress = new Boolean(Util.getSecurityProperty("jessie.SessionContext.xml.compress")).booleanValue();
- if (password == null)
- {
- password = "";
- }
- pbekdf = PRNGFactory.getInstance("PBKDF2-HMAC-SHA1");
- HashMap kdfattr = new HashMap();
- kdfattr.put(IPBE.PASSWORD, password.toCharArray());
- // Dummy salt. This is replaced by a real salt when encoding.
- kdfattr.put(IPBE.SALT, new byte[8]);
- kdfattr.put(IPBE.ITERATION_COUNT, new Integer(1000));
- pbekdf.init(kdfattr);
- encoding = false;
- if (file.exists())
- {
- decode();
- }
- encoding = true;
- random = new SecureRandom ();
- }
-
- // Instance methods.
- // -------------------------------------------------------------------------
-
- synchronized boolean addSession(Session.ID sessionId, Session session)
- {
- boolean ret = super.addSession(sessionId, session);
- if (ret && encoding)
- {
- try
- {
- encode();
- }
- catch (IOException ioe)
- {
- }
- }
- return ret;
- }
-
- synchronized void notifyAccess(Session session)
- {
- try
- {
- encode();
- }
- catch (IOException ioe)
- {
- }
- }
-
- synchronized boolean removeSession(Session.ID sessionId)
- {
- if (super.removeSession(sessionId))
- {
- try
- {
- encode();
- }
- catch (Exception x)
- {
- }
- return true;
- }
- return false;
- }
-
- private void decode() throws IOException, SAXException
- {
- SAXParser parser = null;
- try
- {
- parser = SAXParserFactory.newInstance().newSAXParser();
- }
- catch (Exception x)
- {
- throw new Error(x.toString());
- }
- SAXHandler handler = new SAXHandler(this, pbekdf);
- InputStream in = null;
- if (compress)
- in = new GZIPInputStream(new FileInputStream(file));
- else
- in = new FileInputStream(file);
- parser.parse(in, handler);
- }
-
- private void encode() throws IOException
- {
- IMode cipher = ModeFactory.getInstance("CBC", "AES", 16);
- HashMap cipherAttr = new HashMap();
- IMac mac = MacFactory.getInstance("HMAC-SHA1");
- HashMap macAttr = new HashMap();
- byte[] key = new byte[32];
- byte[] iv = new byte[16];
- byte[] mackey = new byte[20];
- byte[] salt = new byte[8];
- byte[] encryptedSecret = new byte[48];
- cipherAttr.put(IMode.KEY_MATERIAL, key);
- cipherAttr.put(IMode.IV, iv);
- cipherAttr.put(IMode.STATE, new Integer(IMode.ENCRYPTION));
- macAttr.put(IMac.MAC_KEY_MATERIAL, mackey);
- PrintStream out = null;
- if (compress)
- {
- out = new PrintStream(new GZIPOutputStream(new FileOutputStream(file)));
- }
- else
- {
- out = new PrintStream(new FileOutputStream(file));
- }
- out.println("<?xml version=\"1.0\"?>");
- out.println("<!DOCTYPE sessions [");
- out.println(" <!ELEMENT sessions (session*)>");
- out.println(" <!ATTLIST sessions size CDATA \"0\">");
- out.println(" <!ATTLIST sessions timeout CDATA \"86400\">");
- out.println(" <!ELEMENT session (peer, certificates?, secret)>");
- out.println(" <!ATTLIST session id CDATA #REQUIRED>");
- out.println(" <!ATTLIST session protocol (SSLv3|TLSv1|TLSv1.1) #REQUIRED>");
- out.println(" <!ATTLIST session suite CDATA #REQUIRED>");
- out.println(" <!ATTLIST session created CDATA #REQUIRED>");
- out.println(" <!ATTLIST session timestamp CDATA #REQUIRED>");
- out.println(" <!ELEMENT peer (certificates?)>");
- out.println(" <!ATTLIST peer host CDATA #REQUIRED>");
- out.println(" <!ELEMENT certificates (#PCDATA)>");
- out.println(" <!ATTLIST certificates type CDATA \"X.509\">");
- out.println(" <!ELEMENT secret (#PCDATA)>");
- out.println(" <!ATTLIST secret salt CDATA #REQUIRED>");
- out.println("]>");
- out.println();
- out.print("<sessions size=\"");
- out.print(cacheSize);
- out.print("\" timeout=\"");
- out.print(timeout);
- out.println("\">");
- for (Iterator it = sessions.entrySet().iterator(); it.hasNext(); )
- {
- Map.Entry entry = (Map.Entry) it.next();
- Session.ID id = (Session.ID) entry.getKey();
- Session session = (Session) entry.getValue();
- if (!session.valid)
- {
- continue;
- }
- out.print("<session id=\"");
- out.print(Base64.encode(id.getId(), 0));
- out.print("\" suite=\"");
- out.print(session.getCipherSuite());
- out.print("\" protocol=\"");
- out.print(session.getProtocol());
- out.print("\" created=\"");
- out.print(session.getCreationTime());
- out.print("\" timestamp=\"");
- out.print(session.getLastAccessedTime());
- out.println("\">");
- out.print("<peer host=\"");
- out.print(session.getPeerHost());
- out.println("\">");
- Certificate[] certs = session.getPeerCertificates();
- if (certs != null && certs.length > 0)
- {
- out.print("<certificates type=\"");
- out.print(certs[0].getType());
- out.println("\">");
- for (int i = 0; i < certs.length; i++)
- {
- out.println("-----BEGIN CERTIFICATE-----");
- try
- {
- out.print(Base64.encode(certs[i].getEncoded(), 70));
- }
- catch (CertificateEncodingException cee)
- {
- throw new IOException(cee.toString());
- }
- out.println("-----END CERTIFICATE-----");
- }
- out.println("</certificates>");
- }
- out.println("</peer>");
- certs = session.getLocalCertificates();
- if (certs != null && certs.length > 0)
- {
- out.print("<certificates type=\"");
- out.print(certs[0].getType());
- out.println("\">");
- for (int i = 0; i < certs.length; i++)
- {
- out.println("-----BEGIN CERTIFICATE-----");
- try
- {
- out.print(Base64.encode(certs[i].getEncoded(), 70));
- }
- catch (CertificateEncodingException cee)
- {
- throw new IOException(cee.toString());
- }
- out.println("-----END CERTIFICATE-----");
- }
- out.println("</certificates>");
- }
- random.nextBytes (salt);
- pbekdf.init(Collections.singletonMap(IPBE.SALT, salt));
- try
- {
- pbekdf.nextBytes(key, 0, key.length);
- pbekdf.nextBytes(iv, 0, iv.length);
- pbekdf.nextBytes(mackey, 0, mackey.length);
- cipher.reset();
- cipher.init(cipherAttr);
- mac.init(macAttr);
- }
- catch (Exception ex)
- {
- throw new Error(ex.toString());
- }
- for (int i = 0; i < session.masterSecret.length; i += 16)
- {
- cipher.update(session.masterSecret, i, encryptedSecret, i);
- }
- mac.update(encryptedSecret, 0, encryptedSecret.length);
- byte[] macValue = mac.digest();
- out.print("<secret salt=\"");
- out.print(Base64.encode(salt, 0));
- out.println("\">");
- out.print(Base64.encode(Util.concat(encryptedSecret, macValue), 70));
- out.println("</secret>");
- out.println("</session>");
- }
- out.println("</sessions>");
- out.close();
- }
-
- // Inner class.
- // -------------------------------------------------------------------------
-
- private class SAXHandler extends DefaultHandler
- {
-
- // Field.
- // -----------------------------------------------------------------------
-
- private SessionContext context;
- private Session current;
- private IRandom pbekdf;
- private StringBuffer buf;
- private String certType;
- private int state;
- private IMode cipher;
- private HashMap cipherAttr;
- private IMac mac;
- private HashMap macAttr;
- private byte[] key;
- private byte[] iv;
- private byte[] mackey;
-
- private static final int START = 0;
- private static final int SESSIONS = 1;
- private static final int SESSION = 2;
- private static final int PEER = 3;
- private static final int PEER_CERTS = 4;
- private static final int CERTS = 5;
- private static final int SECRET = 6;
-
- // Constructor.
- // -----------------------------------------------------------------------
-
- SAXHandler(SessionContext context, IRandom pbekdf)
- {
- this.context = context;
- this.pbekdf = pbekdf;
- buf = new StringBuffer();
- state = START;
- cipher = ModeFactory.getInstance("CBC", "AES", 16);
- cipherAttr = new HashMap();
- mac = MacFactory.getInstance("HMAC-SHA1");
- macAttr = new HashMap();
- key = new byte[32];
- iv = new byte[16];
- mackey = new byte[20];
- cipherAttr.put(IMode.KEY_MATERIAL, key);
- cipherAttr.put(IMode.IV, iv);
- cipherAttr.put(IMode.STATE, new Integer(IMode.DECRYPTION));
- macAttr.put(IMac.MAC_KEY_MATERIAL, mackey);
- }
-
- // Instance methods.
- // -----------------------------------------------------------------------
-
- public void startElement(String u, String n, String qname, Attributes attr)
- throws SAXException
- {
- qname = qname.toLowerCase();
- switch (state)
- {
- case START:
- if (qname.equals("sessions"))
- {
- try
- {
- timeout = Integer.parseInt(attr.getValue("timeout"));
- cacheSize = Integer.parseInt(attr.getValue("size"));
- if (timeout <= 0 || cacheSize < 0)
- throw new SAXException("timeout or cache size out of range");
- }
- catch (NumberFormatException nfe)
- {
- throw new SAXException(nfe);
- }
- state = SESSIONS;
- }
- else
- throw new SAXException("expecting sessions");
- break;
-
- case SESSIONS:
- if (qname.equals("session"))
- {
- try
- {
- current = new Session(Long.parseLong(attr.getValue("created")));
- current.enabledSuites = new ArrayList(SSLSocket.supportedSuites);
- current.enabledProtocols = new TreeSet(SSLSocket.supportedProtocols);
- current.context = context;
- current.sessionId = new Session.ID(Base64.decode(attr.getValue("id")));
- current.setLastAccessedTime(Long.parseLong(attr.getValue("timestamp")));
- }
- catch (Exception ex)
- {
- throw new SAXException(ex);
- }
- String prot = attr.getValue("protocol");
- if (prot.equals("SSLv3"))
- current.protocol = ProtocolVersion.SSL_3;
- else if (prot.equals("TLSv1"))
- current.protocol = ProtocolVersion.TLS_1;
- else if (prot.equals("TLSv1.1"))
- current.protocol = ProtocolVersion.TLS_1_1;
- else
- throw new SAXException("bad protocol: " + prot);
- current.cipherSuite = CipherSuite.forName(attr.getValue("suite"));
- state = SESSION;
- }
- else
- throw new SAXException("expecting session");
- break;
-
- case SESSION:
- if (qname.equals("peer"))
- {
- current.peerHost = attr.getValue("host");
- state = PEER;
- }
- else if (qname.equals("certificates"))
- {
- certType = attr.getValue("type");
- state = CERTS;
- }
- else if (qname.equals("secret"))
- {
- byte[] salt = null;
- try
- {
- salt = Base64.decode(attr.getValue("salt"));
- }
- catch (IOException ioe)
- {
- throw new SAXException(ioe);
- }
- pbekdf.init(Collections.singletonMap(IPBE.SALT, salt));
- state = SECRET;
- }
- else
- throw new SAXException("bad element: " + qname);
- break;
-
- case PEER:
- if (qname.equals("certificates"))
- {
- certType = attr.getValue("type");
- state = PEER_CERTS;
- }
- else
- throw new SAXException("bad element: " + qname);
- break;
-
- default:
- throw new SAXException("bad element: " + qname);
- }
- }
-
- public void endElement(String uri, String name, String qname)
- throws SAXException
- {
- qname = qname.toLowerCase();
- switch (state)
- {
- case SESSIONS:
- if (qname.equals("sessions"))
- state = START;
- else
- throw new SAXException("expecting sessions");
- break;
-
- case SESSION:
- if (qname.equals("session"))
- {
- current.valid = true;
- context.addSession(current.sessionId, current);
- state = SESSIONS;
- }
- else
- throw new SAXException("expecting session");
- break;
-
- case PEER:
- if (qname.equals("peer"))
- state = SESSION;
- else
- throw new SAXException("unexpected element: " + qname);
- break;
-
- case PEER_CERTS:
- if (qname.equals("certificates"))
- {
- try
- {
- CertificateFactory fact = CertificateFactory.getInstance(certType);
- current.peerCerts = (Certificate[])
- fact.generateCertificates(new ByteArrayInputStream(
- buf.toString().getBytes())).toArray(new Certificate[0]);
- }
- catch (Exception ex)
- {
- throw new SAXException(ex);
- }
- current.peerVerified = true;
- state = PEER;
- }
- else
- throw new SAXException("unexpected element: " + qname);
- break;
-
- case CERTS:
- if (qname.equals("certificates"))
- {
- try
- {
- CertificateFactory fact = CertificateFactory.getInstance(certType);
- current.localCerts = (Certificate[])
- fact.generateCertificates(new ByteArrayInputStream(
- buf.toString().getBytes())).toArray(new Certificate[0]);
- }
- catch (Exception ex)
- {
- throw new SAXException(ex);
- }
- state = SESSION;
- }
- else
- throw new SAXException("unexpected element: " + qname);
- break;
-
- case SECRET:
- if (qname.equals("secret"))
- {
- byte[] encrypted = null;
- try
- {
- encrypted = Base64.decode(buf.toString());
- if (encrypted.length != 68)
- throw new IOException("encrypted secret not 68 bytes long");
- pbekdf.nextBytes(key, 0, key.length);
- pbekdf.nextBytes(iv, 0, iv.length);
- pbekdf.nextBytes(mackey, 0, mackey.length);
- cipher.reset();
- cipher.init(cipherAttr);
- mac.init(macAttr);
- }
- catch (Exception ex)
- {
- throw new SAXException(ex);
- }
- mac.update(encrypted, 0, 48);
- byte[] macValue = mac.digest();
- for (int i = 0; i < macValue.length; i++)
- {
- if (macValue[i] != encrypted[48+i])
- throw new SAXException("MAC mismatch");
- }
- current.masterSecret = new byte[48];
- for (int i = 0; i < current.masterSecret.length; i += 16)
- {
- cipher.update(encrypted, i, current.masterSecret, i);
- }
- state = SESSION;
- }
- else
- throw new SAXException("unexpected element: " + qname);
- break;
-
- default:
- throw new SAXException("unexpected element: " + qname);
- }
- buf.setLength(0);
- }
-
- public void characters(char[] ch, int off, int len) throws SAXException
- {
- if (state != CERTS && state != PEER_CERTS && state != SECRET)
- {
- throw new SAXException("illegal character data");
- }
- buf.append(ch, off, len);
- }
- }
-}
diff --git a/libjava/classpath/gnu/javax/rmi/CORBA/UtilDelegateImpl.java b/libjava/classpath/gnu/javax/rmi/CORBA/UtilDelegateImpl.java
index 66a4e24ff18..b9dc7a3d2a5 100644
--- a/libjava/classpath/gnu/javax/rmi/CORBA/UtilDelegateImpl.java
+++ b/libjava/classpath/gnu/javax/rmi/CORBA/UtilDelegateImpl.java
@@ -1,5 +1,5 @@
/* UtilDelegateImpl.java --
- Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.javax.rmi.CORBA;
+import gnu.classpath.VMStackWalker;
+
import gnu.CORBA.Minor;
import gnu.CORBA.ObjectCreator;
import gnu.CORBA.Poa.ORB_1_4;
@@ -70,6 +72,7 @@ import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
+import java.net.MalformedURLException;
import java.rmi.AccessException;
import java.rmi.MarshalException;
import java.rmi.NoSuchObjectException;
@@ -374,37 +377,24 @@ public class UtilDelegateImpl
throws ClassNotFoundException
{
if (loader == null)
- loader = Thread.currentThread().getContextClassLoader();
+ loader = VMStackWalker.firstNonNullClassLoader();
String p_useCodebaseOnly = System.getProperty("java.rmi.server.useCodebaseOnly");
boolean useCodebaseOnly = p_useCodebaseOnly != null
&& p_useCodebaseOnly.trim().equalsIgnoreCase("true");
- try
- {
- if (remoteCodebase != null && !useCodebaseOnly)
- return RMIClassLoader.loadClass(remoteCodebase, className);
- }
- catch (Exception e)
- {
- // This failed but try others.
- }
+ if (useCodebaseOnly)
+ remoteCodebase = null;
try
{
- if (remoteCodebase == null || useCodebaseOnly)
- return RMIClassLoader.loadClass(remoteCodebase, className);
+ return RMIClassLoader.loadClass(remoteCodebase, className, loader);
}
- catch (Exception e)
+ catch (MalformedURLException x)
{
- // This failed but try others.
+ throw new ClassNotFoundException(className, x);
}
-
- if (loader != null)
- return Class.forName(className, true, loader);
-
- throw new ClassNotFoundException(className + " at " + remoteCodebase);
}
/**
diff --git a/libjava/classpath/gnu/javax/security/auth/callback/AbstractCallbackHandler.java b/libjava/classpath/gnu/javax/security/auth/callback/AbstractCallbackHandler.java
index eeedf2605db..5144f58ea4c 100644
--- a/libjava/classpath/gnu/javax/security/auth/callback/AbstractCallbackHandler.java
+++ b/libjava/classpath/gnu/javax/security/auth/callback/AbstractCallbackHandler.java
@@ -83,65 +83,102 @@ public abstract class AbstractCallbackHandler implements CallbackHandler
this.name = name;
}
- // Class methods.
- // -------------------------------------------------------------------------
-
+ /**
+ * Create an instance of <code>CallbackHandler</code> of the designated
+ * <code>type</code> from the first Security Provider which offers it.
+ *
+ * @param type the type of callback handler to create.
+ * @return a newly created instance of <code>ClassbackHandler</code>.
+ * @throws NoSuchAlgorithmException if no security provider is found to offer
+ * an implementation of <code>CallbackHandler</code> of the
+ * designated <code>type</code>.
+ */
public static CallbackHandler getInstance(String type)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(type, p[i]);
- }
- catch (NoSuchAlgorithmException ignored)
- {
- }
- }
+ try
+ {
+ return getInstance(type, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new NoSuchAlgorithmException(type);
}
+ /**
+ * Create an instance of <code>CallbackHandler</code> of the designated
+ * <code>type</code> from the named security <code>provider</code>.
+ *
+ * @param type the type of callback handler to create.
+ * @param provider a named security provider to use.
+ * @return a newly created instance of <code>ClassbackHandler</code>.
+ * @throws NoSuchAlgorithmException if no security provider is found to offer
+ * an implementation of <code>CallbackHandler</code> of the
+ * designated <code>type</code>.
+ * @throws IllegalArgumentException if either <code>type</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>type</code> is an empty string.
+ */
public static CallbackHandler getInstance(String type, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
Provider p = Security.getProvider(provider);
if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
+ throw new NoSuchProviderException(provider);
return getInstance(type, p);
}
+ /**
+ * Create an instance of <code>CallbackHandler</code> of the designated
+ * <code>type</code> from the designated security <code>provider</code>.
+ *
+ * @param type the type of callback handler to create.
+ * @param provider a security provider to use.
+ * @return a newly created instance of <code>ClassbackHandler</code>.
+ * @throws NoSuchAlgorithmException if no security provider is found to offer
+ * an implementation of <code>CallbackHandler</code> of the
+ * designated <code>type</code>.
+ * @throws IllegalArgumentException if either <code>type</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>type</code> is an empty string.
+ */
public static CallbackHandler getInstance(String type, Provider provider)
throws NoSuchAlgorithmException
{
+ StringBuilder sb = new StringBuilder("CallbackHandler of type [")
+ .append(type).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
return (CallbackHandler) Engine.getInstance(SERVICE, type, provider);
}
- catch (InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- Throwable cause = ite.getCause();
+ cause = x.getCause();
if (cause instanceof NoSuchAlgorithmException)
throw (NoSuchAlgorithmException) cause;
- NoSuchAlgorithmException nsae = new NoSuchAlgorithmException(type);
- if (cause != null)
- nsae.initCause (cause);
- throw nsae;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- NoSuchAlgorithmException nsae = new NoSuchAlgorithmException(type);
- nsae.initCause (cce);
- throw nsae;
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
- // Instance methods.
- // -------------------------------------------------------------------------
-
public void handle(Callback[] callbacks)
throws IOException, UnsupportedCallbackException
{
diff --git a/libjava/classpath/gnu/javax/security/auth/callback/CertificateCallback.java b/libjava/classpath/gnu/javax/security/auth/callback/CertificateCallback.java
new file mode 100644
index 00000000000..fcec1196235
--- /dev/null
+++ b/libjava/classpath/gnu/javax/security/auth/callback/CertificateCallback.java
@@ -0,0 +1,64 @@
+/* CertificateCallback.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.security.auth.callback;
+
+import java.security.cert.Certificate;
+
+import javax.security.auth.callback.ConfirmationCallback;
+
+/**
+ * A {@link javax.security.auth.callback.Callback} for confirming whether or
+ * not a certificate may be used. This works similarly to
+ * {@link ConfirmationCallback}, but additionally contains the certificate
+ * being verified. Thus, handlers may present the certificate to the user, when
+ * handling this callback.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public class CertificateCallback extends ConfirmationCallback
+{
+ static final long serialVersionUID = 8343869651419225634L;
+ public final Certificate certificate;
+
+ public CertificateCallback(Certificate cert, String prompt)
+ {
+ super(prompt, ERROR, YES_NO_OPTION, NO);
+ this.certificate = cert;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/css/BorderStyle.java b/libjava/classpath/gnu/javax/swing/text/html/css/BorderStyle.java
new file mode 100644
index 00000000000..d75beea5247
--- /dev/null
+++ b/libjava/classpath/gnu/javax/swing/text/html/css/BorderStyle.java
@@ -0,0 +1,64 @@
+/* BorderStyle.java -- Utility for dealing with border styles
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.swing.text.html.css;
+
+/**
+ * Utility class for handling border styles.
+ */
+public class BorderStyle
+{
+
+ /**
+ * Determines if a given value makes up a valid border style value.
+ *
+ * @param value the value to check
+ *
+ * @return <code>true</code> when this is a valid border style,
+ * <code>false</code> otherwise
+ */
+ public static boolean isValidStyle(String value)
+ {
+ return value.equals("none") || value.equals("hidden")
+ || value.equals("dotted") || value.equals("dashed")
+ || value.equals("solid") || value.equals("double")
+ || value.equals("groove") || value.equals("ridge")
+ || value.equals("inset") || value.equals("outset");
+
+ }
+}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/css/BorderWidth.java b/libjava/classpath/gnu/javax/swing/text/html/css/BorderWidth.java
new file mode 100644
index 00000000000..ae64c21101c
--- /dev/null
+++ b/libjava/classpath/gnu/javax/swing/text/html/css/BorderWidth.java
@@ -0,0 +1,78 @@
+/* BorderWidth.java -- A CSS metric for border widths
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.swing.text.html.css;
+
+/**
+ * A special CSS metric for border widths. It basically understands everything
+ * as Length, and in addition to that provides a mapping for the border-width's
+ * thin, medium and think values.
+ */
+public class BorderWidth
+ extends Length
+{
+
+ /**
+ * Creates a new BorderWidth instance.
+ *
+ * @param val the CSS value to be interpreted
+ */
+ public BorderWidth(String val)
+ {
+ super(val);
+ if (val.equals("thin"))
+ floatValue = 1.F;
+ else if (val.equals("medium"))
+ floatValue = 2.F;
+ else if (val.equals("thick"))
+ floatValue = 3.F;
+ }
+
+ /**
+ * Checks if the specified value makes up a valid border-width value.
+ *
+ * @param value the value to check
+ *
+ * @return <code>true</code> if the value is a valid border-width
+ */
+ public static boolean isValid(String value)
+ {
+ return value.equals("thin") || value.equals("medium")
+ || value.equals("thick") || Length.isValid(value);
+ }
+}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/css/CSSColor.java b/libjava/classpath/gnu/javax/swing/text/html/css/CSSColor.java
new file mode 100644
index 00000000000..ea4b94ae0a5
--- /dev/null
+++ b/libjava/classpath/gnu/javax/swing/text/html/css/CSSColor.java
@@ -0,0 +1,170 @@
+/* CSSColor.java -- Converts CSS color values
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.swing.text.html.css;
+
+import java.awt.Color;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * Converts CSS color values into AWT Color values.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class CSSColor
+{
+
+ private static final HashMap COLOR_MAP;
+ static
+ {
+ COLOR_MAP = new HashMap();
+ COLOR_MAP.put("maroon", "#800000");
+ COLOR_MAP.put("red", "#ff0000");
+ COLOR_MAP.put("orange", "#ffa500");
+ COLOR_MAP.put("yellow", "#ffff00");
+ COLOR_MAP.put("olive", "#808000");
+ COLOR_MAP.put("purple", "#800080");
+ COLOR_MAP.put("fuchsia", "#ff00ff");
+ COLOR_MAP.put("white", "#ffffff");
+ COLOR_MAP.put("lime", "#00ff00");
+ COLOR_MAP.put("green", "#008000");
+ COLOR_MAP.put("navy", "#000080");
+ COLOR_MAP.put("blue", "#0000ff");
+ COLOR_MAP.put("aqua", "#00ffff");
+ COLOR_MAP.put("teal", "#008080");
+ COLOR_MAP.put("black", "#000000");
+ COLOR_MAP.put("silver", "#c0c0c0");
+ COLOR_MAP.put("gray", "#808080");
+ }
+
+ /**
+ * The CSS value.
+ */
+ private String value;
+
+ /**
+ * The converted color.
+ */
+ private Color color;
+
+ /**
+ * Creates a new instance.
+ *
+ * @param val the CSS value
+ */
+ public CSSColor(String val)
+ {
+ value = val;
+ color = convertValue(value);
+ }
+
+ /**
+ * Converts a CSS color value to an AWT color.
+ *
+ * @param value the CSS color value
+ *
+ * @return the converted color value
+ */
+ public static Color convertValue(String value)
+ {
+ Color color;
+ String val1 = value.toLowerCase();
+ if (val1.charAt(0) != '#')
+ val1 = (String) COLOR_MAP.get(val1);
+ if (val1 != null)
+ {
+ String hexVal = val1.substring(1).trim();
+ try
+ {
+ int rgb = Integer.parseInt(hexVal, 16);
+ color = new Color(rgb);
+ }
+ catch (NumberFormatException ex)
+ {
+ color = Color.BLACK;
+ }
+ }
+ else
+ color = null;
+ return color;
+ }
+
+ /**
+ * Returns the converted color.
+ *
+ * @return the converted color
+ */
+ public Color getValue()
+ {
+ return color;
+ }
+
+ public String toString()
+ {
+ return value;
+ }
+
+ /**
+ * Returns <code>true</code> if the specified value is a valid color value,
+ * <code>false</code> otherwise.
+ *
+ * @param val the value to check
+ *
+ * @return <code>true</code> if the specified value is a valid color value,
+ * <code>false</code> otherwise
+ */
+ public static boolean isValidColor(String val)
+ {
+ boolean ret = false;
+ if (val.charAt(0) == '#')
+ ret = true;
+ else
+ {
+ Set colors = COLOR_MAP.keySet();
+ for (Iterator i = colors.iterator(); i.hasNext() && ret == false;)
+ {
+ String color = (String) i.next();
+ if (color.equalsIgnoreCase(val))
+ ret = true;
+ }
+ }
+ return ret;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/css/CSSLexicalException.java b/libjava/classpath/gnu/javax/swing/text/html/css/CSSLexicalException.java
new file mode 100644
index 00000000000..13968e4d2cd
--- /dev/null
+++ b/libjava/classpath/gnu/javax/swing/text/html/css/CSSLexicalException.java
@@ -0,0 +1,60 @@
+/* CSSLexicalException.java -- Indicates a failure in the lexical analyser
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.swing.text.html.css;
+
+import java.io.IOException;
+
+/**
+ * Indicates a failure in the lexical analyser of the CSS parser.
+ */
+public class CSSLexicalException
+ extends IOException
+{
+
+ public CSSLexicalException()
+ {
+ super();
+ }
+
+ public CSSLexicalException(String message)
+ {
+ super(message);
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/css/CSSParser.java b/libjava/classpath/gnu/javax/swing/text/html/css/CSSParser.java
new file mode 100644
index 00000000000..5647e25069d
--- /dev/null
+++ b/libjava/classpath/gnu/javax/swing/text/html/css/CSSParser.java
@@ -0,0 +1,500 @@
+/* CSSParser.java -- A parser for CSS stylesheets
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.swing.text.html.css;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.StringTokenizer;
+
+/**
+ * A parser for CSS stylesheets.
+ *
+ * This parser is based on the simple CSS grammar describe in
+ *
+ * http://www.w3.org/TR/CSS21/syndata.html .
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+// TODO: Maybe use more restrictive grammar:
+// http://www.w3.org/TR/CSS21/grammar.html#q1
+public class CSSParser
+{
+
+ /**
+ * The scanner used to read the input streams into more usable tokens.
+ */
+ private CSSScanner scanner;
+
+ /**
+ * The parser callback.
+ */
+ private CSSParserCallback callback;
+
+ /**
+ * One lookahead token.
+ */
+ private int lookahead;
+
+ /**
+ * The parse error.
+ */
+ private String error;
+
+ /**
+ * Creates a new CSSParser that parses the specified input.
+ *
+ * @param in the source to parse
+ */
+ public CSSParser(Reader in, CSSParserCallback cb)
+ {
+ scanner = new CSSScanner(in);
+ callback = cb;
+ lookahead = -1;
+ }
+
+ /**
+ * Parses the input source specified in the constructor.
+ *
+ * @throws IOException if an IO or parse error occurs
+ */
+ public void parse()
+ throws IOException
+ {
+ boolean success = parseStylesheet();
+ if (! success)
+ {
+ throw new CSSParserException(error);
+ }
+ }
+
+ /**
+ * Parses a stylesheet.
+ *
+ * @return <code>true</code> if the stylesheet could be parsed successfully,
+ * <code>false</code> otherwise
+ *
+ * @throws IOException if an IO or parse error occurs
+ */
+ private boolean parseStylesheet()
+ throws IOException
+ {
+ int token = peekToken();
+ while (token != CSSScanner.EOF && (token == CSSScanner.CDC
+ || token == CSSScanner.CDO || token == CSSScanner.S
+ || parseStatement()))
+ {
+ if (token == CSSScanner.CDC || token == CSSScanner.CDO
+ || token == CSSScanner.S)
+ readToken();
+ token = peekToken();
+ }
+ // Last token must be EOF for valid stylesheets, I'd think.
+ return token == CSSScanner.EOF;
+ }
+
+ /**
+ * Parses a CSS statement.
+ * @return <code>true</code> if the stylesheet could be parsed successfully,
+ * <code>false</code> otherwise
+ *
+ * @throws IOException if an IO or parse error occurs
+ */
+ private boolean parseStatement()
+ throws IOException
+ {
+ return parseRuleset() || parseAtRule();
+ }
+
+ /**
+ * Parses a CSS rule set.
+ *
+ * @return <code>true</code> if the ruleset could be parsed successfully,
+ * <code>false</code> otherwise
+ *
+ * @throws IOException if an IO or parse error occurs
+ */
+ private boolean parseRuleset()
+ throws IOException
+ {
+ StringBuilder selector = new StringBuilder();
+ parseSelector(selector);
+ StringTokenizer selSplitter =
+ new StringTokenizer(selector.toString(), ",");
+ Selector[] sels = new Selector[selSplitter.countTokens()];
+ for (int i = 0; selSplitter.hasMoreTokens(); i++)
+ {
+ String sel = selSplitter.nextToken().trim();
+ sels[i] = new Selector(sel);
+ }
+ callback.startStatement(sels);
+ // Read any number of whitespace.
+ int token;
+ do
+ {
+ token = readToken();
+ } while (token == CSSScanner.S);
+ boolean ret = true;
+
+ if (token == CSSScanner.CURLY_LEFT)
+ {
+ // Read any number of whitespace.
+ do
+ {
+ token = readToken();
+ } while (token == CSSScanner.S);
+ lookahead = token;
+
+ // Maybe read declaration.
+ boolean decl = parseDeclaration();
+ token = peekToken();
+ while (token == CSSScanner.SEMICOLON)
+ {
+ readToken(); // Read the semicolon.
+ // Read any number of whitespace.
+ do
+ {
+ token = readToken();
+ } while (token == CSSScanner.S);
+ lookahead = token;
+
+ // Maybe read declaration.
+ parseDeclaration();
+ token = peekToken();
+ }
+ if (token != CSSScanner.CURLY_RIGHT)
+ {
+ error = "Expected right curly brace";
+ ret = false;
+ }
+ else
+ {
+ readToken();
+ // Read any number of whitespace.
+ do
+ {
+ token = readToken();
+ } while (token == CSSScanner.S);
+ lookahead = token;
+ callback.endStatement();
+ }
+ }
+ else
+ {
+ ret = false;
+ error = "Expected left curly brace";
+ }
+ return ret;
+ }
+
+ /**
+ * Parses a CSS declaration.
+ *
+ * @return <code>true</code> if the ruleset could be parsed successfully,
+ * <code>false</code> otherwise
+ *
+ * @throws IOException if an IO or parse error occurs
+ */
+ private boolean parseDeclaration()
+ throws IOException
+ {
+ // Maybe fetch one DELIM.
+ int token = readToken();
+ if (token == CSSScanner.DELIM)
+ token = readToken();
+
+ boolean ret = true;
+
+ // Parse property
+ String property = null;
+ if (token == CSSScanner.IDENT)
+ {
+ property = new String(scanner.parseBuffer, 0, scanner.tokenEnd);
+ // Read any number of whitespace.
+ do
+ {
+ token = readToken();
+ } while (token == CSSScanner.S);
+
+ // Read ':'.
+ if (token == CSSScanner.DELIM && scanner.parseBuffer[0] == ':')
+ {
+ // Read any number of whitespace.
+ do
+ {
+ token = readToken();
+ } while (token == CSSScanner.S);
+ lookahead = token;
+
+ StringBuilder value = new StringBuilder();
+ if (parseValue(value))
+ {
+ callback.declaration(property, value.toString().trim());
+ }
+ else
+ {
+ ret = false;
+ error = "Error while reading the property value";
+ }
+ }
+ else
+ {
+ ret = false;
+ error = "Expected colon to separate property and value";
+ }
+
+ }
+ else
+ {
+ lookahead = token;
+ ret = false;
+ error = "Expected IDENT token for property";
+ }
+ return ret;
+ }
+
+ /**
+ * Parses a property value.
+ *
+ * @param s the string builder to read the value into
+ *
+ * @return <code>true</code> if the ruleset could be parsed successfully,
+ * <code>false</code> otherwise
+ *
+ * @throws IOException if an IO or parse error occurs
+ */
+ private boolean parseValue(StringBuilder s)
+ throws IOException
+ {
+ // FIXME: Handle block and ATKEYWORD.
+ boolean success = parseAny(s);
+ while (parseAny(s));
+ return success;
+ }
+
+ /**
+ * Parses a selector.
+ *
+ * @param sel the string buffer to put the selector into
+ *
+ * @return <code>true</code> if the ruleset could be parsed successfully,
+ * <code>false</code> otherwise
+ *
+ * @throws IOException if an IO or parse error occurs
+ */
+ private boolean parseSelector(StringBuilder sel)
+ throws IOException
+ {
+ // At least one any needs to be parsed.
+ boolean ret = parseAny(sel);
+ if (ret)
+ {
+ while (parseAny(sel));
+ }
+ return ret;
+ }
+
+ /**
+ * Parses the any rule. If s is not null, then the contents of the
+ * tokens is appended verbatim.
+ *
+ * @param s the string builder to append to
+ *
+ * @return <code>true</code> if the ruleset could be parsed successfully,
+ * <code>false</code> otherwise
+ *
+ * @throws IOException if an IO or parse error occurs
+ */
+ private boolean parseAny(StringBuilder s)
+ throws IOException
+ {
+ int token = peekToken();
+ boolean ret = false;
+ if (token == CSSScanner.IDENT || token == CSSScanner.NUMBER
+ || token == CSSScanner.PERCENTAGE || token == CSSScanner.DIMENSION
+ || token == CSSScanner.STRING || token == CSSScanner.DELIM
+ || token == CSSScanner.URI || token == CSSScanner.HASH
+ || token == CSSScanner.UNICODE_RANGE || token == CSSScanner.INCLUDES
+ || token == CSSScanner.DASHMATCH)
+ {
+ if (s != null)
+ s.append(scanner.parseBuffer, 0, scanner.tokenEnd);
+ readToken();
+ ret = true;
+ }
+ else if (token == CSSScanner.FUNCTION)
+ System.err.println("Implement parseAny for FUNCTION");
+ else if (token == CSSScanner.PAREN_LEFT)
+ System.err.println("Implement parseAny for (");
+ else if (token == CSSScanner.BRACE_LEFT)
+ System.err.println("Implement parseAny for [");
+
+ // Parse any following whitespace too.
+ token = peekToken();
+ while (token == CSSScanner.S)
+ {
+ if (s != null)
+ s.append(scanner.parseBuffer, 0, scanner.tokenEnd);
+ readToken();
+ token = peekToken();
+ }
+ return ret;
+ }
+
+ /**
+ * Parses a CSS at-rule.
+ *
+ * @return <code>true</code> if the at-rule could be parsed successfully,
+ * <code>false</code> otherwise
+ *
+ * @throws IOException if an IO or parse error occurs
+ */
+ private boolean parseAtRule()
+ throws IOException
+ {
+ // FIXME: Implement.
+ return false;
+ }
+
+ /**
+ * Reads the next token, and skips the comments.
+ *
+ * @return the next non-comment token
+ */
+ private int readToken()
+ throws IOException
+ {
+ int token;
+ if (lookahead == -1)
+ {
+ do
+ {
+ token = scanner.nextToken();
+ } while (token == CSSScanner.COMMENT);
+ }
+ else
+ {
+ token = lookahead;
+ lookahead = -1;
+ }
+ return token;
+ }
+
+ /**
+ * Returns the next token to be read, without really reading it. The next
+ * call to readToken() will return the same token again.
+ *
+ * @return the next token to be read, without really reading it
+ */
+ private int peekToken()
+ throws IOException
+ {
+ int token;
+ if (lookahead == -1)
+ {
+ do
+ {
+ token = scanner.nextToken();
+ } while (token == CSSScanner.COMMENT);
+ lookahead = token;
+ }
+ else
+ token = lookahead;
+ return token;
+ }
+
+ /**
+ * For testing, we read in the default.css in javax/swing/text/html
+ *
+ * @param args
+ */
+ public static void main(String[] args)
+ {
+ try
+ {
+ InputStream in;
+ if (args.length > 0)
+ {
+ File file = new File(args[0]);
+ in = new FileInputStream(file);
+ }
+ else
+ {
+ String name = "/javax/swing/text/html/default.css";
+ in = CSSScanner.class.getResourceAsStream(name);
+ }
+ BufferedInputStream bin = new BufferedInputStream(in);
+ InputStreamReader r = new InputStreamReader(bin);
+ CSSParserCallback cb = new CSSParserCallback()
+ {
+ public void startStatement(Selector[] selector)
+ {
+ System.out.print("startStatement: ");
+ for (int i = 0; i < selector.length; i++)
+ {
+ System.out.print(selector[i]);
+ if (i < selector.length - 1)
+ System.out.print(',');
+ else
+ System.out.println();
+ }
+ }
+ public void endStatement()
+ {
+ System.out.println("endStatement");
+ }
+ public void declaration(String property, String value)
+ {
+ System.out.println("declaration: " + property + ", " + value);
+ }
+ };
+ CSSParser p = new CSSParser(r, cb);
+ p.parse();
+ }
+ catch (IOException ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/css/CSSParserCallback.java b/libjava/classpath/gnu/javax/swing/text/html/css/CSSParserCallback.java
new file mode 100644
index 00000000000..f49ffa232de
--- /dev/null
+++ b/libjava/classpath/gnu/javax/swing/text/html/css/CSSParserCallback.java
@@ -0,0 +1,81 @@
+/* CSSParserCallback.java -- Callback for parsing CSS
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.swing.text.html.css;
+
+/**
+ * Defines the callback that is used by the CSSParser to notify the
+ * backend of the parsing process.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public interface CSSParserCallback
+{
+
+ /**
+ * Signals the beginning of a statement.
+ *
+ * A CSS statement is build up like follows:
+ * <pre>
+ * <selector> {
+ * ... declarations...
+ * }
+ * </pre>
+ *
+ * After startStatement(), the callback will receive zero to n callbacks
+ * to declaration, followed by an endStatement() call.
+ *
+ * @param selector the selector of the statement.
+ */
+ void startStatement(Selector[] selector);
+
+ /**
+ * Signals the end of a statement.
+ */
+ void endStatement();
+
+ /**
+ * Signals the parsing of one declaration, which defines a mapping
+ * from a property to a value.
+ *
+ * @param property the property
+ * @param value the value
+ */
+ void declaration(String property, String value);
+
+}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/css/CSSParserException.java b/libjava/classpath/gnu/javax/swing/text/html/css/CSSParserException.java
new file mode 100644
index 00000000000..2328d539804
--- /dev/null
+++ b/libjava/classpath/gnu/javax/swing/text/html/css/CSSParserException.java
@@ -0,0 +1,62 @@
+/* CSSParserException.java -- The CSS parser exception
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.swing.text.html.css;
+
+import java.io.IOException;
+
+/**
+ * This exception is raised when the CSS parser hits a syntax error.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class CSSParserException
+ extends IOException
+{
+
+ /**
+ * Creates a new CSSParserException.
+ *
+ * @param message the exception message
+ */
+ public CSSParserException(String message)
+ {
+ super(message);
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/css/CSSScanner.java b/libjava/classpath/gnu/javax/swing/text/html/css/CSSScanner.java
new file mode 100644
index 00000000000..9cc6209a549
--- /dev/null
+++ b/libjava/classpath/gnu/javax/swing/text/html/css/CSSScanner.java
@@ -0,0 +1,718 @@
+/* CSSScanner.java -- A parser for CSS stylesheets
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.swing.text.html.css;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+
+/**
+ * A tokenizer for CSS stylesheets. This is based on the scanner definition
+ * from:
+ *
+ * http://www.w3.org/TR/CSS21/syndata.html#tokenization
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+// TODO: Maybe implement more restrictive scanner:
+// http://www.w3.org/TR/CSS21/grammar.html#q2
+class CSSScanner
+{
+
+ // The tokens. This list is taken from:
+ // http://www.w3.org/TR/CSS21/syndata.html#tokenization
+ static final int IDENT = 1;
+ static final int ATKEYWORD = 2;
+ static final int STRING = 3;
+ static final int INVALID = 4;
+ static final int HASH = 5;
+ static final int NUMBER = 6;
+ static final int PERCENTAGE = 7;
+ static final int DIMENSION = 8;
+ static final int URI = 9;
+ static final int UNICODE_RANGE = 10;
+ static final int CDO = 11;
+ static final int CDC = 12;
+ static final int SEMICOLON = 13;
+ static final int CURLY_LEFT = 14;
+ static final int CURLY_RIGHT = 15;
+ static final int PAREN_LEFT = 16;
+ static final int PAREN_RIGHT = 17;
+ static final int BRACE_LEFT = 16;
+ static final int BRACE_RIGHT = 17;
+ static final int S = 18;
+ static final int COMMENT = 19;
+ static final int FUNCTION = 20;
+ static final int INCLUDES = 21;
+ static final int DASHMATCH = 22;
+ static final int DELIM = 23;
+
+ // Additional tokens defined for convenience.
+ static final int EOF = -1;
+
+ /**
+ * The input source.
+ */
+ private Reader in;
+
+ /**
+ * The parse buffer.
+ */
+ char[] parseBuffer;
+
+ /**
+ * The end index in the parseBuffer of the current token.
+ */
+ int tokenEnd;
+
+ /**
+ * The lookahead 'buffer'.
+ */
+ private int[] lookahead;
+
+ CSSScanner(Reader r)
+ {
+ lookahead = new int[2];
+ lookahead[0] = -1;
+ lookahead[1] = -1;
+ parseBuffer = new char[2048];
+ in = r;
+ }
+
+ /**
+ * Fetches the next token. The actual character data is in the parseBuffer
+ * afterwards with the tokenStart at index 0 and the tokenEnd field
+ * pointing to the end of the token.
+ *
+ * @return the next token
+ */
+ int nextToken()
+ throws IOException
+ {
+ tokenEnd = 0;
+ int token = -1;
+ int next = read();
+ if (next != -1)
+ {
+ switch (next)
+ {
+ case ';':
+ parseBuffer[0] = (char) next;
+ tokenEnd = 1;
+ token = SEMICOLON;
+ break;
+ case '{':
+ parseBuffer[0] = (char) next;
+ tokenEnd = 1;
+ token = CURLY_LEFT;
+ break;
+ case '}':
+ parseBuffer[0] = (char) next;
+ tokenEnd = 1;
+ token = CURLY_RIGHT;
+ break;
+ case '(':
+ parseBuffer[0] = (char) next;
+ tokenEnd = 1;
+ token = PAREN_LEFT;
+ break;
+ case ')':
+ parseBuffer[0] = (char) next;
+ tokenEnd = 1;
+ token = PAREN_RIGHT;
+ break;
+ case '[':
+ parseBuffer[0] = (char) next;
+ tokenEnd = 1;
+ token = BRACE_LEFT;
+ break;
+ case ']':
+ parseBuffer[0] = (char) next;
+ tokenEnd = 1;
+ token = BRACE_RIGHT;
+ break;
+ case '@':
+ parseBuffer[0] = (char) next;
+ tokenEnd = 1;
+ readIdent();
+ token = ATKEYWORD;
+ break;
+ case '#':
+ parseBuffer[0] = (char) next;
+ tokenEnd = 1;
+ readName();
+ token = HASH;
+ break;
+ case '\'':
+ case '"':
+ lookahead[0] = next;
+ readString();
+ token = STRING;
+ break;
+ case ' ':
+ case '\t':
+ case '\r':
+ case '\n':
+ case '\f':
+ lookahead[0] = next;
+ readWhitespace();
+ token = S;
+ break;
+ // FIXME: Detecting an URI involves several characters lookahead.
+// case 'u':
+// lookahead[0] = ch;
+// readURI();
+// token = URI;
+// break;
+ case '<':
+ parseBuffer[0] = (char) next;
+ parseBuffer[1] = (char) read();
+ parseBuffer[2] = (char) read();
+ parseBuffer[3] = (char) read();
+ if (parseBuffer[1] == '!' && parseBuffer[2] == '-'
+ && parseBuffer[3] == '-')
+ {
+ token = CDO;
+ tokenEnd = 4;
+ }
+ else
+ throw new CSSLexicalException("expected CDO token");
+ break;
+ case '/':
+ lookahead[0] = next;
+ readComment();
+ token = COMMENT;
+ break;
+ case '~':
+ parseBuffer[0] = (char) next;
+ parseBuffer[1] = (char) read();
+ if (parseBuffer[1] == '=')
+ token = INCLUDES;
+ else
+ throw new CSSLexicalException("expected INCLUDES token");
+ break;
+ case '|':
+ parseBuffer[0] = (char) next;
+ parseBuffer[1] = (char) read();
+ if (parseBuffer[1] == '=')
+ token = DASHMATCH;
+ else
+ throw new CSSLexicalException("expected DASHMATCH token");
+ break;
+ case '-':
+ int ch2 = read();
+ if (ch2 == '-')
+ {
+ int ch3 = read();
+ if (ch3 == '>')
+ {
+ parseBuffer[0] = (char) next;
+ parseBuffer[1] = (char) ch2;
+ parseBuffer[2] = (char) ch3;
+ tokenEnd = 3;
+ token = CDC;
+ }
+ else
+ throw new CSSLexicalException("expected CDC token");
+ }
+ else
+ {
+ lookahead[0] = next;
+ lookahead[1] = ch2;
+ readIdent();
+ int ch3 = read();
+ if (ch3 == -1 || ch3 != '(')
+ {
+ lookahead[0] = ch3;
+ token = IDENT;
+ }
+ else
+ {
+ parseBuffer[tokenEnd] = (char) ch3;
+ tokenEnd++;
+ token = FUNCTION;
+ }
+ }
+ break;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ lookahead[0] = next;
+ readNum();
+ int ch3 = read();
+ if (ch3 == '%')
+ {
+ parseBuffer[tokenEnd] = (char) ch3;
+ tokenEnd++;
+ token = PERCENTAGE;
+ }
+ else if (ch3 == -1 || (! (ch3 == '_'
+ || (ch3 >= 'a' && ch3 <= 'z')
+ || (ch3 >= 'A' && ch3 <= 'Z')
+ || ch3 == '\\' || ch3 > 177)))
+ {
+ lookahead[0] = ch3;
+ token = NUMBER;
+ }
+ else
+ {
+ lookahead[0] = ch3;
+ readIdent();
+ token = DIMENSION;
+ }
+ break;
+ default:
+ // Handle IDENT that don't begin with '-'.
+ if (next == '_' || (next >= 'a' && next <= 'z')
+ || (next >= 'A' && next <= 'Z') || next == '\\' || next > 177)
+ {
+ lookahead[0] = next;
+ readIdent();
+ int ch4 = read();
+ if (ch4 == -1 || ch4 != '(')
+ {
+ lookahead[0] = ch4;
+ token = IDENT;
+ }
+ else
+ {
+ parseBuffer[tokenEnd] = (char) ch4;
+ tokenEnd++;
+ token = FUNCTION;
+ }
+ }
+ else
+ {
+ parseBuffer[0] = (char) next;
+ tokenEnd = 1;
+ token = DELIM;
+ }
+ break;
+ }
+ }
+ return token;
+ }
+
+ String currentTokenString()
+ {
+ return new String(parseBuffer, 0, tokenEnd);
+ }
+
+ /**
+ * Reads one character from the input stream or from the lookahead
+ * buffer, if it contains one character.
+ *
+ * @return the next character
+ *
+ * @throws IOException if problems occur on the input source
+ */
+ private int read()
+ throws IOException
+ {
+ int ret;
+ if (lookahead[0] != -1)
+ {
+ ret = lookahead[0];
+ lookahead[0] = -1;
+ }
+ else if (lookahead[1] != -1)
+ {
+ ret = lookahead[1];
+ lookahead[1] = -1;
+ }
+ else
+ {
+ ret = in.read();
+ }
+ return ret;
+ }
+
+ /**
+ * Reads and identifier.
+ *
+ * @throws IOException if something goes wrong in the input source or if
+ * the lexical analyser fails to read an identifier
+ */
+ private void readIdent()
+ throws IOException
+ {
+ int ch1 = read();
+ // Read possibly leading '-'.
+ if (ch1 == '-')
+ {
+ parseBuffer[tokenEnd] = (char) ch1;
+ tokenEnd++;
+ ch1 = read();
+ }
+ // What follows must be '_' or a-z or A-Z or nonascii (>177) or an
+ // escape.
+ if (ch1 == '_' || (ch1 >= 'a' && ch1 <= 'z')
+ || (ch1 >= 'A' && ch1 <= 'Z') || ch1 > 177)
+ {
+ parseBuffer[tokenEnd] = (char) ch1;
+ tokenEnd++;
+ }
+ else if (ch1 == '\\')
+ {
+ // Try to read an escape.
+ lookahead[0] = ch1;
+ readEscape();
+ }
+ else
+ throw new CSSLexicalException("First character of identifier incorrect");
+
+ // Read any number of [_a-zA-Z0-9-] chars.
+ int ch = read();
+ while (ch != -1 && (ch == '_' || ch == '-' || (ch >= 'a' && ch <= 'z')
+ || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9')))
+ {
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ ch = read();
+ }
+
+ // Push back last read character since it doesn't belong to the IDENT.
+ lookahead[0] = ch;
+ }
+
+ /**
+ * Reads an escape.
+ *
+ * @throws IOException if something goes wrong in the input source or if
+ * the lexical analyser fails to read an escape
+ */
+ private void readEscape()
+ throws IOException
+ {
+ int ch = read();
+ if (ch != -1 && ch == '\\')
+ {
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ ch = read();
+ if ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f'))
+ {
+ // Read unicode escape.
+ // Zero to five 0-9a-f chars can follow.
+ int hexcount = 0;
+ ch = read();
+ while (((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f'))
+ && hexcount < 5)
+ {
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ hexcount++;
+ ch = read();
+ }
+ // Now we can have a \r\n or any whitespace character following.
+ if (ch == '\r')
+ {
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ ch = read();
+ if (ch == '\n')
+ {
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ }
+ else
+ {
+ lookahead[0] = ch;
+ }
+ }
+ else if (ch == ' ' || ch == '\n' || ch == '\f' || ch == '\t')
+ {
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ }
+ else
+ {
+ lookahead[0] = ch;
+ }
+ }
+ else if (ch != '\n' && ch != '\r' && ch != '\f')
+ {
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ }
+ else
+ throw new CSSLexicalException("Can't read escape");
+ }
+ else
+ throw new CSSLexicalException("Escape must start with '\\'");
+
+ }
+
+ private void readName()
+ throws IOException
+ {
+ // Read first name character.
+ int ch = read();
+ if (ch != -1 && (ch == '_' || ch == '-' || (ch >= 'a' && ch <= 'z')
+ || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9')))
+ {
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ }
+ else
+ throw new CSSLexicalException("Invalid name");
+
+ // Read any number (at least one) of [_a-zA-Z0-9-] chars.
+ ch = read();
+ while (ch != -1 && (ch == '_' || ch == '-' || (ch >= 'a' && ch <= 'z')
+ || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9')))
+ {
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ ch = read();
+ }
+
+ // Push back last read character since it doesn't belong to the IDENT.
+ lookahead[0] = ch;
+ }
+
+ /**
+ * Reads in a string.
+ *
+ * @throws IOException
+ */
+ private void readString()
+ throws IOException
+ {
+ int ch1 = read();
+ if (ch1 != -1 && (ch1 == '\'' || ch1 == '\"'))
+ {
+ parseBuffer[tokenEnd] = (char) ch1;
+ tokenEnd++;
+
+ // Read any number of chars until we hit another chc1 char.
+ // Reject newlines, except if prefixed with \.
+ int ch = read();
+ while (ch != -1 && ch != ch1)
+ {
+ // Every non-newline and non-\ char should be ok.
+ if (ch != '\n' && ch != '\r' && ch != '\f' && ch != '\\')
+ {
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ }
+ // Ok when followed by newline or as part of escape.
+ else if (ch == '\\')
+ {
+ int ch2 = read();
+ if (ch2 == '\n' || ch2 == '\r')
+ {
+ parseBuffer[tokenEnd] = (char) ch;
+ parseBuffer[tokenEnd + 1] = (char) ch2;
+ tokenEnd += 2;
+ }
+ else
+ {
+ // Try to parse an escape.
+ lookahead[0] = ch;
+ lookahead[1] = ch2;
+ readEscape();
+ }
+ }
+ else
+ throw new CSSLexicalException("Invalid string");
+
+ ch = read();
+ }
+ if (ch != -1)
+ {
+ // Push the final char on the buffer.
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ }
+ else
+ throw new CSSLexicalException("Unterminated string");
+ }
+ else
+ throw new CSSLexicalException("Invalid string");
+ }
+
+ /**
+ * Reads a chunk of whitespace.
+ *
+ * @throws IOException
+ */
+ private void readWhitespace()
+ throws IOException
+ {
+ int ch = read();
+ while (ch != -1 && (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n'
+ || ch == '\f'))
+ {
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ ch = read();
+ }
+ // Push back last character read.
+ lookahead[0] = ch;
+
+ }
+
+ private void readURI()
+ throws IOException
+ {
+ // FIXME: Implement.
+ }
+
+ /**
+ * Reads a comment block.
+ *
+ * @throws IOException
+ */
+ private void readComment()
+ throws IOException
+ {
+ // First we need a / and a *
+ int ch = read();
+ if (ch != -1 && ch == '/')
+ {
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ ch = read();
+ if (ch != -1 && ch == '*')
+ {
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ ch = read();
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ boolean finished = false;
+ int lastChar = ch;
+ ch = read();
+ while (! finished && ch != -1)
+ {
+ if (lastChar == '*' && ch == '/')
+ finished = true;
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ lastChar = ch;
+ ch = read();
+ }
+ }
+ }
+ if (ch == -1)
+ throw new CSSLexicalException("Unterminated comment");
+
+ // Push back last character read.
+ lookahead[0] = ch;
+ }
+
+ /**
+ * Reads a number.
+ *
+ * @throws IOException
+ */
+ private void readNum()
+ throws IOException
+ {
+ boolean hadDot = false;
+ // First char must be number or .
+ int ch = read();
+ if (ch != -1 && ((ch >= '0' && ch <= '9') || ch == '.'))
+ {
+ if (ch == '.')
+ hadDot = true;
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ // Now read in any number of digits afterwards, and maybe one dot,
+ // if we hadn't one already.
+ ch = read();
+ while (ch != -1 && ((ch >= '0' && ch <= '9')
+ || (ch == '.' && ! hadDot)))
+ {
+ if (ch == '.')
+ hadDot = true;
+ parseBuffer[tokenEnd] = (char) ch;
+ tokenEnd++;
+ ch = read();
+ }
+ }
+ else
+ throw new CSSLexicalException("Invalid number");
+
+ // Check if we haven't accidentally finished with a dot.
+ if (parseBuffer[tokenEnd - 1] == '.')
+ throw new CSSLexicalException("Invalid number");
+
+ // Push back last character read.
+ lookahead[0] = ch;
+ }
+
+ /**
+ * For testing, we read in the default.css in javax/swing/text/html
+ *
+ * @param args
+ */
+ public static void main(String[] args)
+ {
+ try
+ {
+ String name = "/javax/swing/text/html/default.css";
+ InputStream in = CSSScanner.class.getResourceAsStream(name);
+ BufferedInputStream bin = new BufferedInputStream(in);
+ InputStreamReader r = new InputStreamReader(bin);
+ CSSScanner s = new CSSScanner(r);
+ int token;
+ do
+ {
+ token = s.nextToken();
+ System.out.println("token: " + token + ": "
+ + s.currentTokenString());
+ } while (token != -1);
+ }
+ catch (IOException ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/css/FontSize.java b/libjava/classpath/gnu/javax/swing/text/html/css/FontSize.java
new file mode 100644
index 00000000000..2795b678401
--- /dev/null
+++ b/libjava/classpath/gnu/javax/swing/text/html/css/FontSize.java
@@ -0,0 +1,273 @@
+/* FontSize.java -- Converts CSS font size values into real values
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.swing.text.html.css;
+
+/**
+ * Converts CSS font-size values into real (point) values.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class FontSize
+{
+
+ /**
+ * The CSS value.
+ */
+ private String value;
+
+ /**
+ * The actual font size.
+ */
+ private int size;
+
+ /**
+ * The index of one of the standard sizes that this font size maps to.
+ * This is -1 if this fontsize doesn't map to one of the standard sizes.
+ *
+ * @see #SCALE
+ */
+ private int sizeIndex;
+
+ /**
+ * True when this font size is relative.
+ */
+ private boolean isRelative;
+
+ /**
+ * The default size for 'medium' absolute size. The other absolute sizes
+ * are calculated from this.
+ */
+ public static final int DEFAULT_FONT_SIZE = 12;
+
+ /**
+ * The scaling factors relative to the medium size. Medium is at index 2.
+ */
+ private static final double[] SCALE = {0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8 };
+
+ /**
+ * Creates a new FontSize for the specified value.
+ *
+ * @param val the value to convert
+ */
+ public FontSize(String val)
+ {
+ value = val;
+ sizeIndex = -1;
+ isRelative = false;
+ size = mapValue();
+ }
+
+ /**
+ * Returns the font size value.
+ *
+ * @return the font size value
+ */
+ public int getValue(int p)
+ {
+ if (isRelative)
+ mapRelative(p);
+ return size;
+ }
+
+ public int getValue()
+ {
+ assert ! isRelative;
+ return size;
+ }
+
+ /**
+ * Returns the converted real value in point.
+ *
+ * @return the converted real value in point
+ */
+ private int mapValue()
+ {
+ int intVal;
+ if (value.contains("pt"))
+ intVal = mapPoints();
+ else if (value.contains("px"))
+ intVal = mapPixels();
+ else if (value.contains("em") || value.contains("%")
+ || value.contains("larger") || value.contains("smaller"))
+ {
+ intVal = -1;
+ isRelative = true;
+ }
+ else
+ intVal = mapAbsolute();
+ return intVal;
+ }
+
+ /**
+ * Maps point values ('XXXpt').
+ *
+ * @return the real font size
+ */
+ private int mapPoints()
+ {
+ int end = value.indexOf("pt");
+ String number = value.substring(0, end);
+ int intVal = Integer.parseInt(number);
+ return intVal;
+ }
+
+ /**
+ * Maps pixel values ('XXXpx').
+ *
+ * @return the real font size
+ */
+ private int mapPixels()
+ {
+ int end = value.indexOf("px");
+ if (end == -1)
+ end = value.length();
+ String number = value.substring(0, end);
+ try
+ {
+ int intVal = Integer.parseInt(number);
+ return intVal;
+ }
+ catch (NumberFormatException ex)
+ {
+ return DEFAULT_FONT_SIZE;
+ }
+ }
+
+ private int mapPercent(int par)
+ {
+ int end = value.indexOf("%");
+ if (end == -1)
+ end = value.length();
+ String number = value.substring(0, end);
+ try
+ {
+ int intVal = Integer.parseInt(number);
+ return intVal * par / 100;
+ }
+ catch (NumberFormatException ex)
+ {
+ System.err.println("couldn't map value: '" + value + "'");
+ return DEFAULT_FONT_SIZE;
+ }
+ }
+
+ private int mapEM(int par)
+ {
+ int end = value.indexOf("em");
+ if (end == -1)
+ end = value.length();
+ String number = value.substring(0, end);
+ try
+ {
+ float factor = Float.parseFloat(number);
+ // FIXME: Should be relative to the parent element's size.
+ return (int) (factor * par);
+ }
+ catch (NumberFormatException ex)
+ {
+ return DEFAULT_FONT_SIZE;
+ }
+ }
+
+ private int mapSmaller(int par)
+ {
+ return (int) (par * 0.9);
+ }
+
+ private int mapLarger(int par)
+ {
+ return (int) (par * 0.9);
+ }
+
+ /**
+ * Maps absolute font-size values.
+ *
+ * @return the real value
+ */
+ private int mapAbsolute()
+ {
+ int index;
+ if (value.equals("xx-small") || value.equals("x-small"))
+ index = 0;
+ else if (value.equals("small"))
+ index = 1;
+ else if (value.equals("medium"))
+ index = 2;
+ else if (value.equals("large"))
+ index = 3;
+ else if (value.equals("x-large"))
+ index = 4;
+ else if (value.equals("xx-large"))
+ index = 5;
+ else
+ index = 2;
+ double scale = SCALE[index];
+ // FIXME: Scale the real medium size of the document, rather than the
+ // constant here.
+ int intVal = (int) (scale * DEFAULT_FONT_SIZE);
+ sizeIndex = index;
+ return intVal;
+ }
+
+ /**
+ * Returns the string representation.
+ */
+ public String toString()
+ {
+ return value;
+ }
+
+ private int mapRelative(int par)
+ {
+ if (value.indexOf('%') != -1)
+ size = mapPercent(par);
+ else if (value.indexOf("em") != -1)
+ size = mapEM(par);
+ else if (value.indexOf("larger") != -1)
+ size = mapLarger(par);
+ else if (value.indexOf("smaller") != -1)
+ size = mapSmaller(par);
+ return size;
+ }
+
+ public boolean isRelative()
+ {
+ return isRelative;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/css/FontStyle.java b/libjava/classpath/gnu/javax/swing/text/html/css/FontStyle.java
new file mode 100644
index 00000000000..e52893193cb
--- /dev/null
+++ b/libjava/classpath/gnu/javax/swing/text/html/css/FontStyle.java
@@ -0,0 +1,80 @@
+/* FontStyle.java -- Converts font-size CSS values
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.swing.text.html.css;
+
+import java.awt.Font;
+
+/**
+ * Converts font-size CSS values to a form to be used by {@link java.awt.Font}.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class FontStyle
+{
+
+ /**
+ * The real value.
+ */
+ private String value;
+
+ /**
+ * Creates a new instance.
+ *
+ * @param val the CSS value
+ */
+ public FontStyle(String val)
+ {
+ value = val;
+ }
+
+ /**
+ * Returns the converted value.
+ *
+ * @return the converted value
+ */
+ public int getValue()
+ {
+ int intVal;
+ if (value.equals("italic") || value.equals("oblique"))
+ intVal = Font.ITALIC;
+ else
+ intVal = Font.PLAIN;
+ return intVal;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/css/FontWeight.java b/libjava/classpath/gnu/javax/swing/text/html/css/FontWeight.java
new file mode 100644
index 00000000000..d338c6f5514
--- /dev/null
+++ b/libjava/classpath/gnu/javax/swing/text/html/css/FontWeight.java
@@ -0,0 +1,84 @@
+/* FontWeight.java -- Converts font-weight values
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.swing.text.html.css;
+
+import java.awt.Font;
+
+/**
+ * Converts font-weight CSS values to the constants defined for
+ * {@link java.awt.Font}
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class FontWeight
+{
+
+ /**
+ * The value to convert.
+ */
+ private String value;
+
+ /**
+ * Creates a new instance.
+ *
+ * @param val the value to convert
+ */
+ public FontWeight(String val)
+ {
+ value = val;
+ }
+
+ /**
+ * Returns the converted value.
+ *
+ * @return the converted value
+ */
+ public int getValue()
+ {
+ int intVal;
+ if (value.equals("normal"))
+ intVal = Font.PLAIN;
+ else if (value.equals("bold"))
+ intVal = Font.BOLD;
+ else
+ // FIXME: Implement finer-grained weights.
+ intVal = Font.PLAIN;
+ return intVal;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/css/Length.java b/libjava/classpath/gnu/javax/swing/text/html/css/Length.java
new file mode 100644
index 00000000000..06fa36e3d29
--- /dev/null
+++ b/libjava/classpath/gnu/javax/swing/text/html/css/Length.java
@@ -0,0 +1,283 @@
+/* Length.java -- Converts CSS length values
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.swing.text.html.css;
+
+/**
+ * Converts CSS length values to usable length values.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class Length
+{
+
+ /**
+ * The original value.
+ */
+ private String value;
+
+ /**
+ * The converted value.
+ */
+ protected float floatValue;
+
+ /**
+ * Indicates when the value is a percentage value.
+ */
+ private boolean isPercentage;
+
+ /**
+ * Indicates a length value that is relative to the font size (em).
+ */
+ private boolean isFontEMRelative;
+
+ /**
+ * Indicates a length value that is relative to the font size (ex).
+ */
+ private boolean isFontEXRelative;
+
+ /**
+ * The EM base size.
+ */
+ private float emBase;
+
+ /**
+ * The EX base size.
+ */
+ private float exBase;
+
+ /**
+ * Creates a new length converter instance.
+ *
+ * @param val the CSS value
+ */
+ public Length(String val)
+ {
+ isFontEMRelative = false;
+ isFontEXRelative = false;
+ isPercentage = false;
+ value = val;
+ int i = value.indexOf("px");
+ int percent = value.indexOf("%");
+ int em = value.indexOf("em");
+ int ex = value.indexOf("ex");
+ try
+ {
+ floatValue = 0.0F;
+ if (i != -1)
+ {
+ String sub = value.substring(0, i);
+ floatValue = Float.parseFloat(sub);
+ }
+ else if (percent != -1)
+ {
+ isPercentage = true;
+ String sub = value.substring(0, percent);
+ floatValue = Float.parseFloat(sub) / 100;
+ }
+ else if (em != -1)
+ {
+ isFontEMRelative = true;
+ String sub = value.substring(0, em);
+ floatValue = Float.parseFloat(sub);
+ }
+ else if (ex != -1)
+ {
+ isFontEXRelative = true;
+ String sub = value.substring(0, ex);
+ floatValue = Float.parseFloat(sub);
+ }
+ else
+ {
+ floatValue = Float.parseFloat(value);
+ }
+ }
+ catch (NumberFormatException exc)
+ {
+ // Don't let such small problems interrupt CSS parsing.
+ System.err.println("couldn't parse: " + val);
+ }
+ }
+
+ /**
+ * Returns the value converted to pixels.
+ *
+ * @return the value converted to pixels
+ */
+ public float getValue()
+ {
+ return floatValue;
+ }
+
+ /**
+ * Returns the absolute span for the case when this length value is
+ * a relative value.
+ *
+ * @param base the base span
+ *
+ * @return the absolute span
+ */
+ public float getValue(float base)
+ {
+ float span = floatValue;
+ if (isPercentage)
+ span *= base;
+ else if (isFontEMRelative)
+ span *= emBase;
+ else if (isFontEXRelative)
+ span *= exBase;
+ return span;
+ }
+
+ /**
+ * Sets the font relative EM base.
+ *
+ * @param base the font relative EM base
+ */
+ public void setEMBase(float base)
+ {
+ emBase = base;
+ }
+
+ /**
+ * Sets the font relative EX base.
+ *
+ * @param base the font relative EX base
+ */
+ public void setEXBase(float base)
+ {
+ exBase = base;
+ }
+
+ /**
+ * Sets the font relative base values.
+ *
+ * @param emBase the EM base
+ * @param exBase the EX base
+ */
+ public void setFontBases(float emBase, float exBase)
+ {
+ setEMBase(emBase);
+ setEXBase(exBase);
+ }
+
+ /**
+ * Returns true when this length value is an em font relative value. In
+ * order to get correct results, you need the exBase property set up
+ * correctly.
+ *
+ * @return true when this length value is an ex font relative value
+ */
+ public boolean isFontEMRelative()
+ {
+ return isFontEMRelative;
+ }
+
+ /**
+ * Returns true when this length value is an ex font relative value. In
+ * order to get correct results, you need the emBase property set up
+ * correctly.
+ *
+ * @return true when this length value is an ex font relative value
+ */
+ public boolean isFontEXRelative()
+ {
+ return isFontEXRelative;
+ }
+
+ /**
+ * Returns <code>true</code> when the length value is a percentage
+ * value, <code>false</code> otherwise.
+ *
+ * @return <code>true</code> when the length value is a percentage
+ * value, <code>false</code> otherwise
+ */
+ public boolean isPercentage()
+ {
+ return isPercentage;
+ }
+
+ /**
+ * Checks if the specified value makes up a valid length value.
+ *
+ * @param value the value to check
+ *
+ * @return <code>true</code> if the value is a valid length
+ */
+ public static boolean isValid(String value)
+ {
+ boolean isValid = true;
+ int px = value.indexOf("px");
+ int em = value.indexOf("em");
+ int ex = value.indexOf("ex");
+ int pc = value.indexOf('%');
+ try
+ {
+ if (px != -1)
+ {
+ Integer.parseInt(value.substring(0, px));
+ }
+ else if (em != -1)
+ {
+ Integer.parseInt(value.substring(0, em));
+ }
+ else if (ex != -1)
+ {
+ Integer.parseInt(value.substring(0, ex));
+ }
+ else if (pc != -1)
+ {
+ Integer.parseInt(value.substring(0, ex));
+ }
+ else
+ {
+ Integer.parseInt(value);
+ }
+ }
+ catch (NumberFormatException nfe)
+ {
+ isValid = false;
+ }
+ return isValid;
+ }
+
+ public String toString()
+ {
+ return value;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/css/Selector.java b/libjava/classpath/gnu/javax/swing/text/html/css/Selector.java
new file mode 100644
index 00000000000..210df3a7b65
--- /dev/null
+++ b/libjava/classpath/gnu/javax/swing/text/html/css/Selector.java
@@ -0,0 +1,244 @@
+/* Selector.java -- A CSS selector
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.swing.text.html.css;
+
+import java.util.Map;
+import java.util.StringTokenizer;
+
+/**
+ * A CSS selector. This provides methods to interpret a selector and
+ * query matches with an actual HTML element tree.
+ */
+public class Selector
+{
+
+ /**
+ * The actual selector. The selector tokens are stored backwards, that
+ * is the last token first. This makes matching easier.
+ */
+ private String[] selector;
+
+ private String[] elements;
+ private String[] ids;
+ private String[] classes;
+
+ /**
+ * The specificity of the selector.
+ */
+ private int specificity;
+
+ /**
+ * An implicit selector has true here. This is the case for CSS rules that
+ * are attached to HTML elements directly via style="<CSS rule>".
+ */
+ private boolean implicit;
+
+ /**
+ * Creates a new Selector instance for the specified selector string.
+ *
+ * @param sel the selector
+ */
+ public Selector(String sel)
+ {
+ StringTokenizer selectorTokens = new StringTokenizer(sel, " ");
+ selector = new String[selectorTokens.countTokens()];
+ for (int i = selector.length - 1; selectorTokens.hasMoreTokens(); i--)
+ {
+ selector[i] = selectorTokens.nextToken();
+ }
+ calculateSpecificity();
+ }
+
+ /**
+ * Determines if this selector matches the element path specified in the
+ * arguments. The arguments hold the element names as well as class
+ * and id attibutes of the HTML element to be queried. The first item
+ * in the array is the deepest element and the last on the highest up (for
+ * instance, the html tag).
+ *
+ * @param tags
+ * @param classes
+ * @param ids
+ *
+ * @return <code>true</code> when this selector matches the element path,
+ * <code>false</code> otherwise
+ */
+ public boolean matches(String[] tags, Map[] attributes)
+ {
+ // TODO: This implements class, id and descendent matching. These are
+ // the most commonly used selector matchers in CSS together with HTML.
+ // However, the CSS spec defines a couple of more sophisticated matches
+ // which should be implemented.
+ // http://www.w3.org/TR/CSS21/selector.html
+
+ // All parts of the selector must match at some point.
+ boolean match = false;
+ int numTags = tags.length;
+ int numSel = selector.length;
+ if (numSel <= numTags)
+ {
+ match = true;
+ int tagIndex = 0;
+ for (int j = 0; j < numSel && match; j++)
+ {
+ boolean tagMatch = false;
+ for (; tagIndex < numTags && tagMatch == false; tagIndex++)
+ {
+ Object pathClass = attributes[tagIndex].get("class");
+ // Try pseudo class too.
+ Object pseudoClass = attributes[tagIndex].get("_pseudo");
+ Object dynClass = attributes[tagIndex].get("_dynamic");
+ Object pathId = attributes[tagIndex].get("id");
+ String tag = elements[j];
+ String clazz = classes[j];
+ String id = ids[j];
+ tagMatch = tag.equals("") || tag.equals("*")
+ || tag.equals(tags[tagIndex]);
+ tagMatch = tagMatch && (clazz.equals("*")
+ || clazz.equals(dynClass)
+ || clazz.equals(pseudoClass)
+ || clazz.equals(pathClass));
+ tagMatch = tagMatch && (id.equals("*")
+ || id.equals(pathId));
+ // For the last element in the selector we must not look
+ // further.
+ if (j == 0)
+ break;
+ }
+ // If we don't come out here with a matching tag, then we're
+ // not matching at all.
+ match = tagMatch;
+ }
+ }
+ return match;
+ }
+
+ /**
+ * Returns the specificity of the selector. This is calculated according
+ * to:
+ * http://www.w3.org/TR/CSS21/cascade.html#specificity
+ *
+ * @return the specificity of the selector
+ */
+ public int getSpecificity()
+ {
+ return specificity;
+ }
+
+ /**
+ * Returns a string representation of the selector. This tries to reconstruct
+ * the original selector as closely as possible.
+ *
+ * @return a string representation of the selector
+ */
+ public String toString()
+ {
+ StringBuilder b = new StringBuilder();
+ for (int i = selector.length - 1; i >= 0; i--)
+ {
+ b.append(selector[i]);
+ if (i > 0)
+ b.append(' ');
+ }
+ return b.toString();
+ }
+
+ /**
+ * Calculates the specificity of the selector. This is calculated according
+ * to:
+ * http://www.w3.org/TR/CSS21/cascade.html#specificity
+ */
+ private void calculateSpecificity()
+ {
+ int a = implicit ? 1 : 0;
+ int b = 0;
+ int c = 0;
+ int d = 0;
+ int numSel = selector.length;
+ elements = new String[numSel];
+ ids = new String[numSel];
+ classes = new String[numSel];
+ for (int i = 0; i < numSel; i++)
+ {
+ String sel = selector[i];
+ int clazzIndex = sel.indexOf('.');
+ // Try pseudo class too.
+ if (clazzIndex == -1)
+ clazzIndex = sel.indexOf(':');
+ int idIndex = sel.indexOf('#');
+ String clazz;
+ if (clazzIndex == -1)
+ {
+ clazz = "*";
+ clazzIndex = sel.length();
+ }
+ else
+ {
+ c++;
+ clazz = sel.substring(clazzIndex + 1,
+ idIndex > 0 ? Math.min(idIndex, sel.length())
+ : sel.length());
+ }
+ String id;
+ if (idIndex == -1)
+ {
+ id = "*";
+ idIndex = sel.length();
+ }
+ else
+ {
+ b++;
+ id = sel.substring(idIndex + 1,
+ clazzIndex > 0 ? Math.min(clazzIndex, sel.length())
+ : sel.length());
+ }
+ String tag = sel.substring(0,
+ Math.min(Math.min(clazzIndex, idIndex),
+ sel.length()));
+ if (! tag.equals("") && ! tag.equals("*"))
+ d++;
+
+ elements[i] = tag;
+ ids[i] = id;
+ classes[i] = clazz;
+ }
+ // An order of 20 should be enough for everybody.
+ specificity = a * 20 ^ 3 + b * 20 ^ 2 + c * 20 + d;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/parser/GnuParserDelegator.java b/libjava/classpath/gnu/javax/swing/text/html/parser/GnuParserDelegator.java
index 841db667e84..273461a721e 100644
--- a/libjava/classpath/gnu/javax/swing/text/html/parser/GnuParserDelegator.java
+++ b/libjava/classpath/gnu/javax/swing/text/html/parser/GnuParserDelegator.java
@@ -43,6 +43,7 @@ import java.io.Reader;
import java.io.Serializable;
import javax.swing.text.BadLocationException;
+import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.HTMLEditorKit.ParserCallback;
import javax.swing.text.html.parser.DTD;
@@ -92,7 +93,7 @@ public class GnuParserDelegator extends ParserDelegator implements Serializable
protected final void handleStartTag(TagElement tag)
{
- htmlAttributeSet attributes = gnu.getAttributes();
+ SimpleAttributeSet attributes = gnu.getAttributes();
if (tag.fictional())
attributes.addAttribute(ParserCallback.IMPLIED, Boolean.TRUE);
diff --git a/libjava/classpath/gnu/javax/swing/text/html/parser/HTML_401F.java b/libjava/classpath/gnu/javax/swing/text/html/parser/HTML_401F.java
index c3c347e36e3..1894b6a1ac6 100644
--- a/libjava/classpath/gnu/javax/swing/text/html/parser/HTML_401F.java
+++ b/libjava/classpath/gnu/javax/swing/text/html/parser/HTML_401F.java
@@ -2445,8 +2445,10 @@ public class HTML_401F
attr(VALUE, null, null, 0, IMPLIED)
}
);
+
+ // Headers in the paragraph are not allowed.
defElement(P, 0, false, true, new ContentModel( 0,
- new noTagModel(P), null),
+ new noTagModel(new String[] { P, H1, H2, H3, H4, H5, H6 }), null),
NONE
,
new String[] {
diff --git a/libjava/classpath/gnu/javax/swing/text/html/parser/HTML_401Swing.java b/libjava/classpath/gnu/javax/swing/text/html/parser/HTML_401Swing.java
deleted file mode 100644
index 9c934f647de..00000000000
--- a/libjava/classpath/gnu/javax/swing/text/html/parser/HTML_401Swing.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/* HTML_401Swing.java -- The HTML 4.01 DTD, adapted for HTML rendering in Swing
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.javax.swing.text.html.parser;
-
-import javax.swing.text.html.parser.DTD;
-
-/**
- * This class is necessary because the current implementation of the GNU
- * Classpath Swing requires always enclose the text into paragraphs.
- *
- * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
- */
-public class HTML_401Swing extends HTML_401F
-{
- /**
- * The singleton instance;
- */
- final static HTML_401Swing singleton = new HTML_401Swing();
-
- /**
- * Either takes the document (by name) from DTD table, or
- * creates a new instance and registers it in the tabe.
- * The document is registerd under name "-//W3C//DTD HTML 4.01 Frameset//EN".
- * @return The new or existing DTD for parsing HTML 4.01 Frameset.
- */
- public static DTD getInstance()
- {
- return singleton;
- }
-
- /**
- * Get elements that are allowed in the document body, at the zero level.
- * This list disallows the text at this level (the implied P tag will be
- * generated). It also disallows A, B, I, U, CITE and other similar
- * elements that have the plain text inside. They will also be placed
- * inside the generated implied P tags.
- */
- protected String[] getBodyElements()
- {
- return new String[] {
- APPLET, BASEFONT,
- BR, BUTTON,
- IFRAME, IMG,
- INPUT, LABEL, MAP, OBJECT,
- SCRIPT, SELECT,
- TEXTAREA,
- BLOCKQUOTE, CENTER, DEL, DIR,
- DIV, DL, FIELDSET, FORM, H1,
- H2, H3, H4, H5, H6,
- HR, INS, ISINDEX, MENU, NOFRAMES,
- NOSCRIPT, OL, P, PRE, TABLE,
- UL
- };
- }
-}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/parser/htmlValidator.java b/libjava/classpath/gnu/javax/swing/text/html/parser/htmlValidator.java
index 4d287a67763..7507850e8f9 100644
--- a/libjava/classpath/gnu/javax/swing/text/html/parser/htmlValidator.java
+++ b/libjava/classpath/gnu/javax/swing/text/html/parser/htmlValidator.java
@@ -153,7 +153,7 @@ public abstract class htmlValidator
* Remove the given tag from the stack or (if found) from the list
* of the forcibly closed tags.
*/
- public void closeTag(TagElement tElement)
+ public boolean closeTag(TagElement tElement)
{
HTML.Tag tag = tElement.getHTMLTag();
hTag x;
@@ -191,11 +191,12 @@ public abstract class htmlValidator
}
stack.remove(x);
- return;
+ return true;
}
}
}
s_error("Closing unopened <" + tag + ">");
+ return false;
}
/**
diff --git a/libjava/classpath/gnu/javax/swing/text/html/parser/support/Parser.java b/libjava/classpath/gnu/javax/swing/text/html/parser/support/Parser.java
index 92f9b27c5d9..3a407310e74 100644
--- a/libjava/classpath/gnu/javax/swing/text/html/parser/support/Parser.java
+++ b/libjava/classpath/gnu/javax/swing/text/html/parser/support/Parser.java
@@ -56,6 +56,7 @@ import java.util.TreeSet;
import java.util.Vector;
import javax.swing.text.ChangedCharSetException;
+import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.html.HTML;
import javax.swing.text.html.parser.AttributeList;
import javax.swing.text.html.parser.DTD;
@@ -250,9 +251,9 @@ public class Parser
* Get the attributes of the current tag.
* @return The attribute set, representing the attributes of the current tag.
*/
- public htmlAttributeSet getAttributes()
+ public SimpleAttributeSet getAttributes()
{
- return attributes;
+ return new SimpleAttributeSet(attributes);
}
/**
@@ -497,6 +498,9 @@ public class Parser
mustBe(t.kind);
}
hTag = new Token(start, last);
+
+ // Consume any whitespace immediately following a comment.
+ optional(WS);
handleComment();
}
@@ -579,6 +583,8 @@ public class Parser
);
}
}
+ // Consume any whitespace that follows the Sgml insertion.
+ optional(WS);
}
/**
@@ -658,7 +664,10 @@ public class Parser
else
text = textProcessor.preprocess(buffer);
- if (text != null && text.length > 0)
+ if (text != null && text.length > 0
+ // According to the specs we need to discard whitespace immediately
+ // before a closing tag.
+ && (text.length > 1 || text[0] != ' ' || ! TAG_CLOSE.matches(this)))
{
TagElement pcdata = new TagElement(dtd.getElement("#pcdata"));
attributes = htmlAttributeSet.EMPTY_HTML_ATTRIBUTE_SET;
@@ -889,6 +898,8 @@ public class Parser
protected void parseDocument()
throws ParseException
{
+ // Read up any initial whitespace.
+ optional(WS);
while (getTokenAhead().kind != EOF)
{
advanced = false;
@@ -979,13 +990,15 @@ public class Parser
+ next.getImage() + "'");
attrValue = value.getImage();
}
- else if (next.kind == SLASH)
- // The slash in this context is treated as the ordinary
- // character, not as a token. The slash may be part of
+ else if (next.kind == SLASH || next.kind == OTHER)
+ // The slash and other characters (like %) in this context is
+ // treated as the ordinary
+ // character, not as a token. The character may be part of
// the unquoted URL.
{
StringBuffer image = new StringBuffer(value.getImage());
- while (next.kind == NUMTOKEN || next.kind == SLASH)
+ while (next.kind == NUMTOKEN || next.kind == SLASH
+ || next.kind == OTHER)
{
image.append(getNextToken().getImage());
next = getTokenAhead();
@@ -1177,6 +1190,13 @@ public class Parser
{
validator.validateTag(tag, attributes);
handleEmptyTag(tag);
+ HTML.Tag h = tag.getHTMLTag();
+ // When a block tag is closed, consume whitespace that follows after
+ // it.
+ // For some unknown reason a FRAME tag is not treated as block element.
+ // However in this case it should be treated as such.
+ if (isBlock(h))
+ optional(WS);
}
catch (ChangedCharSetException ex)
{
@@ -1192,8 +1212,8 @@ public class Parser
*/
private void _handleEndTag(TagElement tag)
{
- validator.closeTag(tag);
- _handleEndTag_remaining(tag);
+ if (validator.closeTag(tag))
+ _handleEndTag_remaining(tag);
}
/**
@@ -1213,6 +1233,11 @@ public class Parser
if (preformatted < 0)
preformatted = 0;
+ // When a block tag is closed, consume whitespace that follows after
+ // it.
+ if (isBlock(h))
+ optional(WS);
+
if (h == HTML.Tag.TITLE)
{
titleOpen = false;
@@ -1239,6 +1264,9 @@ public class Parser
HTML.Tag h = tag.getHTMLTag();
+ if (isBlock(h))
+ optional(WS);
+
if (h.isPreformatted())
preformatted++;
@@ -1418,8 +1446,6 @@ public class Parser
hTag = new Token(start, next);
- attributes.setResolveParent(defaulter.getDefaultParameters(name.getImage()));
-
if (!end)
{
// The tag body contains errors. If additionally the tag
@@ -1457,7 +1483,12 @@ public class Parser
if (te.getElement().type == DTDConstants.EMPTY)
_handleEmptyTag(te);
else
- _handleStartTag(te);
+ {
+ // According to the specs we need to consume whitespace following
+ // immediately after a opening tag.
+ optional(WS);
+ _handleStartTag(te);
+ }
}
}
@@ -1483,4 +1514,19 @@ public class Parser
{
error("Whitespace here is not permitted");
}
+
+ /**
+ * Returns true when the specified tag should be considered a block tag
+ * wrt whitespace handling. We need this special handling, since there
+ * are a couple of tags that we must treat as block tags but which aren't
+ * officially block tags.
+ *
+ * @param tag the tag to check
+ * @return true when the specified tag should be considered a block tag
+ * wrt whitespace handling
+ */
+ private boolean isBlock(HTML.Tag tag)
+ {
+ return tag.isBlock() || tag == HTML.Tag.STYLE || tag == HTML.Tag.FRAME;
+ }
}
diff --git a/libjava/classpath/gnu/javax/swing/text/html/parser/support/low/Constants.java b/libjava/classpath/gnu/javax/swing/text/html/parser/support/low/Constants.java
index 283d32385ef..5416582adca 100644
--- a/libjava/classpath/gnu/javax/swing/text/html/parser/support/low/Constants.java
+++ b/libjava/classpath/gnu/javax/swing/text/html/parser/support/low/Constants.java
@@ -209,6 +209,17 @@ public class Constants
}
);
+ /**
+ * Ordinary HTML tag closing pattern.
+ */
+ public static final pattern TAG_CLOSE =
+ new pattern(new node[]
+ {
+ new node(BEGIN), new node(WS, true), new node(SLASH),
+ new node(WS, true), new node(NUMTOKEN)
+ }
+ );
+
/* Special tokens */
/**
diff --git a/libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java b/libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java
index cc1610585a6..6fd79e2589e 100644
--- a/libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java
+++ b/libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java
@@ -42,17 +42,17 @@ import gnu.javax.swing.text.html.parser.support.low.Constants;
/**
* Pre - processes text in text parts of the html document.
- * Not thread - safe.
+ *
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
*/
public class textPreProcessor
{
/**
- * Pre - process non-preformatted text.
- * \t, \r and \n mutate into spaces, then multiple spaces mutate
- * into single one, all whitespace around tags is consumed.
- * The content of the passed buffer is destroyed.
- * @param text A text to pre-process.
+ * Pre - process non-preformatted text. \t, \r and \n mutate into spaces, then
+ * multiple spaces mutate into single one, all whitespace around tags is
+ * consumed. The content of the passed buffer is destroyed.
+ *
+ * @param a_text A text to pre-process.
*/
public char[] preprocess(StringBuffer a_text)
{
@@ -64,18 +64,15 @@ public class textPreProcessor
int a = 0;
int b = text.length - 1;
- try
- {
- while (Constants.bWHITESPACE.get(text [ a ]))
- a++;
- while (Constants.bWHITESPACE.get(text [ b ]))
- b--;
- }
- catch (ArrayIndexOutOfBoundsException sx)
- {
- // A text fragment, consisting from line breaks only.
- return null;
- }
+ // Remove leading/trailing whitespace, leaving at most one character
+ int len = text.length;
+ while (a + 1 < len && Constants.bWHITESPACE.get(text[a])
+ && Constants.bWHITESPACE.get(text[a + 1]))
+ a++;
+
+ while (b > a && Constants.bWHITESPACE.get(text[b])
+ && Constants.bWHITESPACE.get(text[b - 1]))
+ b--;
a_text.setLength(0);
@@ -83,10 +80,9 @@ public class textPreProcessor
boolean spaceNow;
char c;
- chars:
- for (int i = a; i <= b; i++)
+ chars: for (int i = a; i <= b; i++)
{
- c = text [ i ];
+ c = text[i];
spaceNow = Constants.bWHITESPACE.get(c);
if (spacesWere && spaceNow)
continue chars;
diff --git a/libjava/classpath/gnu/test/.cvsignore b/libjava/classpath/gnu/test/.cvsignore
new file mode 100644
index 00000000000..70845e08eb0
--- /dev/null
+++ b/libjava/classpath/gnu/test/.cvsignore
@@ -0,0 +1 @@
+Makefile.in
diff --git a/libjava/classpath/gnu/xml/dom/DomAttr.java b/libjava/classpath/gnu/xml/dom/DomAttr.java
index 8673a796161..31d7af2d2f1 100644
--- a/libjava/classpath/gnu/xml/dom/DomAttr.java
+++ b/libjava/classpath/gnu/xml/dom/DomAttr.java
@@ -316,7 +316,7 @@ public class DomAttr
private void mutating(String oldValue, String newValue, short why)
{
- if (!reportMutations || parent == null)
+ if (!reportMutations || parent == null || equal(newValue, oldValue))
{
return;
}
diff --git a/libjava/classpath/gnu/xml/dom/DomNode.java b/libjava/classpath/gnu/xml/dom/DomNode.java
index f0915eb5e93..9af3f3e5498 100644
--- a/libjava/classpath/gnu/xml/dom/DomNode.java
+++ b/libjava/classpath/gnu/xml/dom/DomNode.java
@@ -668,6 +668,7 @@ public abstract class DomNode
{
insertionEvent(null, child);
}
+ length++;
}
return child;
@@ -1561,7 +1562,7 @@ public abstract class DomNode
// Climb to the top of this subtree and handle capture, letting
// each node (from the top down) capture until one stops it or
// until we get to this one.
- current = parent;
+ current = (parent == null) ? this : parent;
if (current.depth >= ANCESTORS_INIT)
{
DomNode[] newants = new DomNode[current.depth + 1];
diff --git a/libjava/classpath/gnu/xml/dom/ls/SAXEventSink.java b/libjava/classpath/gnu/xml/dom/ls/SAXEventSink.java
index aad5ac76e70..8c5b104b9f2 100644
--- a/libjava/classpath/gnu/xml/dom/ls/SAXEventSink.java
+++ b/libjava/classpath/gnu/xml/dom/ls/SAXEventSink.java
@@ -43,6 +43,7 @@ import java.util.LinkedList;
import java.util.List;
import javax.xml.XMLConstants;
import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
import org.w3c.dom.DocumentType;
import org.w3c.dom.Element;
import org.w3c.dom.Entity;
@@ -72,7 +73,7 @@ import gnu.xml.dom.DomNode;
*
* @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
*/
-class SAXEventSink
+public class SAXEventSink
implements ContentHandler, LexicalHandler, DTDHandler, DeclHandler
{
@@ -110,6 +111,11 @@ class SAXEventSink
interrupted = true;
}
+ protected Document getDocument()
+ {
+ return doc;
+ }
+
// -- ContentHandler2 --
public void setDocumentLocator(Locator locator)
diff --git a/libjava/classpath/gnu/xml/stream/SAXParser.java b/libjava/classpath/gnu/xml/stream/SAXParser.java
index e58d5fb52ff..1329ab2971c 100644
--- a/libjava/classpath/gnu/xml/stream/SAXParser.java
+++ b/libjava/classpath/gnu/xml/stream/SAXParser.java
@@ -1021,9 +1021,18 @@ public class SAXParser
SAXParser parser = new SAXParser(validating, namespaceAware,
xIncludeAware);
InputSource input = new InputSource(args[pos]);
- XMLReader reader = parser.getXMLReader();
- reader.setContentHandler(handler);
- reader.parse(input);
+ java.io.FileReader fr = new java.io.FileReader(args[pos]);
+ input.setCharacterStream(fr);
+ try
+ {
+ XMLReader reader = parser.getXMLReader();
+ reader.setContentHandler(handler);
+ reader.parse(input);
+ }
+ finally
+ {
+ fr.close();
+ }
pos++;
}
}
diff --git a/libjava/classpath/gnu/xml/stream/XMLStreamWriterImpl.java b/libjava/classpath/gnu/xml/stream/XMLStreamWriterImpl.java
index 291016e6716..4be9992a73d 100644
--- a/libjava/classpath/gnu/xml/stream/XMLStreamWriterImpl.java
+++ b/libjava/classpath/gnu/xml/stream/XMLStreamWriterImpl.java
@@ -664,12 +664,10 @@ public class XMLStreamWriterImpl
public void writeDTD(String dtd)
throws XMLStreamException
{
- // Really thoroughly pointless method...
try
{
- if (!isName(dtd))
- throw new IllegalArgumentException("illegal Name: " + dtd);
-
+ // XXX: Should we parse the doctypedecl at this point to ensure
+ // wellformedness?
writer.write("<!DOCTYPE ");
writer.write(dtd);
writer.write('>');
diff --git a/libjava/classpath/gnu/xml/transform/SAXTemplatesHandler.java b/libjava/classpath/gnu/xml/transform/SAXTemplatesHandler.java
new file mode 100644
index 00000000000..2c5a4686f10
--- /dev/null
+++ b/libjava/classpath/gnu/xml/transform/SAXTemplatesHandler.java
@@ -0,0 +1,97 @@
+/* SAXTemplatesHandler.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.xml.transform;
+
+import javax.xml.transform.Templates;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.TemplatesHandler;
+import org.w3c.dom.Document;
+import gnu.xml.dom.ls.SAXEventSink;
+
+/**
+ * A content handler that acts as a sink for SAX parse events,
+ * constructing an XSL stylesheet.
+ * Internally, this class simply creates a DOM tree from the events,
+ * and then parses the DOM into a Templates object.
+ *
+ * @author Chris Burdess (dog@gnu.org)
+ */
+class SAXTemplatesHandler
+ extends SAXEventSink
+ implements TemplatesHandler
+{
+
+ final TransformerFactoryImpl factory;
+ String systemId;
+
+ SAXTemplatesHandler(TransformerFactoryImpl factory)
+ {
+ this.factory = factory;
+ }
+
+ public String getSystemId()
+ {
+ return systemId;
+ }
+
+ public void setSystemId(String systemId)
+ {
+ this.systemId = systemId;
+ }
+
+ public Templates getTemplates()
+ {
+ Document doc = getDocument();
+ if (doc == null)
+ throw new IllegalStateException("Parsing of stylesheet incomplete");
+ DOMSource ds = new DOMSource(doc, systemId);
+ try
+ {
+ return factory.newTemplates(ds);
+ }
+ catch (TransformerConfigurationException e)
+ {
+ String msg = "Unable to construct templates from this event stream";
+ IllegalStateException e2 = new IllegalStateException(msg);
+ e2.initCause(e);
+ throw e2;
+ }
+ }
+
+}
diff --git a/libjava/classpath/gnu/xml/transform/SAXTransformerHandler.java b/libjava/classpath/gnu/xml/transform/SAXTransformerHandler.java
new file mode 100644
index 00000000000..83cc3754be9
--- /dev/null
+++ b/libjava/classpath/gnu/xml/transform/SAXTransformerHandler.java
@@ -0,0 +1,111 @@
+/* SAXTransformerHandler.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.xml.transform;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.TransformerHandler;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+import gnu.xml.dom.ls.SAXEventSink;
+
+/**
+ * A SAX event sink that processes an XML source represented as a stream of
+ * SAX events into a result tree.
+ * This works by simply buffering all the events into a DOM tree and then
+ * using this DOM tree as the source of the transformation.
+ *
+ * @author Chris Burdess (dog@gnu.org)
+ */
+class SAXTransformerHandler
+ extends SAXEventSink
+ implements TransformerHandler
+{
+
+ final TransformerFactoryImpl factory;
+ final Transformer transformer;
+ String systemId;
+ Result result;
+
+ SAXTransformerHandler(TransformerFactoryImpl factory, Transformer transformer)
+ {
+ this.factory = factory;
+ this.transformer = transformer;
+ }
+
+ public String getSystemId()
+ {
+ return systemId;
+ }
+
+ public void setSystemId(String systemId)
+ {
+ this.systemId = systemId;
+ }
+
+ public Transformer getTransformer()
+ {
+ return transformer;
+ }
+
+ public void setResult(Result result)
+ {
+ this.result = result;
+ }
+
+ public void endDocument()
+ throws SAXException
+ {
+ super.endDocument();
+ try
+ {
+ Document doc = getDocument();
+ DOMSource ds = new DOMSource(doc, systemId);
+ transformer.transform(ds, result);
+ }
+ catch (TransformerException e)
+ {
+ SAXException e2 = new SAXException(e.getMessage());
+ e2.initCause(e);
+ throw e2;
+ }
+ }
+
+}
diff --git a/libjava/classpath/gnu/xml/transform/StreamSerializer.java b/libjava/classpath/gnu/xml/transform/StreamSerializer.java
index fb8b1a601bc..26bdda8b325 100644
--- a/libjava/classpath/gnu/xml/transform/StreamSerializer.java
+++ b/libjava/classpath/gnu/xml/transform/StreamSerializer.java
@@ -324,7 +324,8 @@ public class StreamSerializer
break;
case Node.TEXT_NODE:
value = node.getNodeValue();
- if (!"yes".equals(node.getUserData("disable-output-escaping")))
+ if (!"yes".equals(node.getUserData("disable-output-escaping")) &&
+ mode != Stylesheet.OUTPUT_TEXT)
value = encode(value, false, false);
out.write(encodeText(value));
break;
diff --git a/libjava/classpath/gnu/xml/transform/TransformerFactoryImpl.java b/libjava/classpath/gnu/xml/transform/TransformerFactoryImpl.java
index 16e3363f8c6..1e8fea3e3a6 100644
--- a/libjava/classpath/gnu/xml/transform/TransformerFactoryImpl.java
+++ b/libjava/classpath/gnu/xml/transform/TransformerFactoryImpl.java
@@ -60,11 +60,15 @@ import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TemplatesHandler;
+import javax.xml.transform.sax.TransformerHandler;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
+import org.xml.sax.XMLFilter;
import gnu.xml.dom.DomDocument;
/**
@@ -73,7 +77,7 @@ import gnu.xml.dom.DomDocument;
* @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
*/
public class TransformerFactoryImpl
- extends TransformerFactory
+ extends SAXTransformerFactory
{
final XPathFactory xpathFactory;
@@ -316,7 +320,8 @@ public class TransformerFactoryImpl
StreamSource.FEATURE.equals(name) ||
StreamResult.FEATURE.equals(name) ||
DOMSource.FEATURE.equals(name) ||
- DOMResult.FEATURE.equals(name))
+ DOMResult.FEATURE.equals(name) ||
+ SAXTransformerFactory.FEATURE.equals(name))
{
return true;
}
@@ -346,6 +351,49 @@ public class TransformerFactoryImpl
return userListener;
}
+ // -- SAXTransformerFactory --
+
+ public TemplatesHandler newTemplatesHandler()
+ throws TransformerConfigurationException
+ {
+ return new SAXTemplatesHandler(this);
+ }
+
+ public TransformerHandler newTransformerHandler()
+ throws TransformerConfigurationException
+ {
+ Transformer transformer = newTransformer();
+ return new SAXTransformerHandler(this, transformer);
+ }
+
+ public TransformerHandler newTransformerHandler(Source source)
+ throws TransformerConfigurationException
+ {
+ Transformer transformer = newTransformer(source);
+ return new SAXTransformerHandler(this, transformer);
+ }
+
+ public TransformerHandler newTransformerHandler(Templates templates)
+ throws TransformerConfigurationException
+ {
+ Transformer transformer = templates.newTransformer();
+ return new SAXTransformerHandler(this, transformer);
+ }
+
+ public XMLFilter newXMLFilter(Source source)
+ throws TransformerConfigurationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public XMLFilter newXMLFilter(Templates templates)
+ throws TransformerConfigurationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ // -- SAXTransformerFactory end --
+
/**
* Syntax: TransformerFactoryImpl [<stylesheet> [<input> [<output>]]]
*/
diff --git a/libjava/classpath/gnu/xml/transform/XSLURIResolver.java b/libjava/classpath/gnu/xml/transform/XSLURIResolver.java
index 6a49caab458..8d7e3fcb485 100644
--- a/libjava/classpath/gnu/xml/transform/XSLURIResolver.java
+++ b/libjava/classpath/gnu/xml/transform/XSLURIResolver.java
@@ -53,6 +53,7 @@ import javax.xml.transform.Source;
import javax.xml.transform.TransformerException;
import javax.xml.transform.URIResolver;
import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamSource;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
@@ -118,10 +119,9 @@ class XSLURIResolver
try
{
- URL url = resolveURL(systemId, base, href);
Node node = null;
InputStream in = null;
- if (source instanceof StreamSource)
+ if (source != null && source instanceof StreamSource)
{
StreamSource ss = (StreamSource) source;
in = ss.getInputStream();
@@ -134,8 +134,25 @@ class XSLURIResolver
}
}
}
+ else if (source != null && source instanceof SAXSource)
+ {
+ SAXSource ss = (SAXSource) source;
+ if (ss.getInputSource() != null)
+ {
+ in = ss.getInputSource().getByteStream();
+ if (in == null)
+ {
+ Reader reader = ss.getInputSource().getCharacterStream();
+ if (reader != null)
+ {
+ in = new ReaderInputStream(reader);
+ }
+ }
+ }
+ }
if (in == null)
{
+ URL url = resolveURL(systemId, base, href);
if (url != null)
{
systemId = url.toString();
diff --git a/libjava/classpath/gnu/xml/xpath/Expr.java b/libjava/classpath/gnu/xml/xpath/Expr.java
index 76fd49eeff5..cafc83b0d37 100644
--- a/libjava/classpath/gnu/xml/xpath/Expr.java
+++ b/libjava/classpath/gnu/xml/xpath/Expr.java
@@ -59,6 +59,7 @@ import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -80,6 +81,38 @@ public abstract class Expr
".####################################################",
new DecimalFormatSymbols(Locale.US));
+ static class ExprNodeSet implements NodeList
+ {
+
+ private ArrayList list;
+
+ ExprNodeSet(Collection collection)
+ {
+ if (collection instanceof ArrayList)
+ list = (ArrayList) collection;
+ else
+ list = new ArrayList(collection);
+ }
+
+ public int getLength()
+ {
+ return list.size();
+ }
+
+ public Node item(int index)
+ {
+ try
+ {
+ return (Node) list.get(index);
+ }
+ catch (ArrayIndexOutOfBoundsException e)
+ {
+ return null;
+ }
+ }
+
+ }
+
public Object evaluate(Object item, QName returnType)
throws XPathExpressionException
{
@@ -132,6 +165,8 @@ public abstract class Expr
{
throw new XPathExpressionException("return value is not a node-set");
}
+ if (ret != null)
+ ret = new ExprNodeSet((Collection) ret);
}
}
return ret;
diff --git a/libjava/classpath/include/.cvsignore b/libjava/classpath/include/.cvsignore
new file mode 100644
index 00000000000..773d8af88de
--- /dev/null
+++ b/libjava/classpath/include/.cvsignore
@@ -0,0 +1,9 @@
+Makefile
+Makefile.in
+stamp-h
+config.h
+stamp-h.in
+config.h.in
+jni_md.h
+stamp-h1
+config-int.h
diff --git a/libjava/classpath/include/GtkDragSourceContextPeer.h b/libjava/classpath/include/GtkDragSourceContextPeer.h
index 4a43d811a1e..87606ec1a1c 100644
--- a/libjava/classpath/include/GtkDragSourceContextPeer.h
+++ b/libjava/classpath/include/GtkDragSourceContextPeer.h
@@ -14,7 +14,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_dnd_peer_gtk_GtkDragSourceContextPeer_n
JNIEXPORT void JNICALL Java_gnu_java_awt_dnd_peer_gtk_GtkDragSourceContextPeer_connectSignals (JNIEnv *env, jobject, jobject);
JNIEXPORT void JNICALL Java_gnu_java_awt_dnd_peer_gtk_GtkDragSourceContextPeer_create (JNIEnv *env, jobject, jobject);
JNIEXPORT void JNICALL Java_gnu_java_awt_dnd_peer_gtk_GtkDragSourceContextPeer_nativeSetCursor (JNIEnv *env, jobject, jint) ;
-
+JNIEXPORT void JNICALL Java_gnu_java_awt_dnd_peer_gtk_GtkDragSourceContextPeer_setTarget (JNIEnv *env, jobject, jobject);
#ifdef __cplusplus
}
diff --git a/libjava/classpath/include/Makefile.am b/libjava/classpath/include/Makefile.am
index cc8c963708f..e81d1443ad7 100644
--- a/libjava/classpath/include/Makefile.am
+++ b/libjava/classpath/include/Makefile.am
@@ -126,13 +126,14 @@ $(XMLJ_H_FILES) \
$(GTKPEER_H_FILES) \
$(QTPEER_H_FILES) \
$(GCONF_PREFS_FILES) \
-$(top_srcdir)/include/gnu_java_net_VMPlainDatagramSocketImpl.h \
$(top_srcdir)/include/gnu_java_net_VMPlainSocketImpl.h \
$(top_srcdir)/include/gnu_java_net_local_LocalSocketImpl.h \
+$(top_srcdir)/include/gnu_java_nio_EpollSelectorImpl.h \
+$(top_srcdir)/include/gnu_java_nio_FileChannelImpl.h \
+$(top_srcdir)/include/gnu_java_nio_KqueueSelectorImpl.h \
$(top_srcdir)/include/gnu_java_nio_VMChannel.h \
$(top_srcdir)/include/gnu_java_nio_VMPipe.h \
$(top_srcdir)/include/gnu_java_nio_VMSelector.h \
-$(top_srcdir)/include/gnu_java_nio_channels_FileChannelImpl.h \
$(top_srcdir)/include/gnu_java_nio_charset_iconv_IconvEncoder.h \
$(top_srcdir)/include/gnu_java_nio_charset_iconv_IconvDecoder.h \
$(top_srcdir)/include/java_io_VMFile.h \
@@ -179,8 +180,6 @@ $(top_srcdir)/include/gnu_javax_sound_midi_dssi_%.h: $(top_builddir)/$(CLASSDIR)
$(top_srcdir)/include/gnu_java_util_prefs_gconf_%.h: $(top_builddir)/$(CLASSDIR)/gnu/java/util/prefs/gconf/%.class
$(JAVAH) -o $@ gnu.java.util.prefs.gconf.$*
-$(top_srcdir)/include/gnu_java_net_VMPlainDatagramSocketImpl.h: $(top_srcdir)/vm/reference/gnu/java/net/VMPlainDatagramSocketImpl.java
- $(JAVAH) -o $@ gnu.java.net.VMPlainDatagramSocketImpl
$(top_srcdir)/include/gnu_java_net_VMPlainSocketImpl.h: $(top_srcdir)/vm/reference/gnu/java/net/VMPlainSocketImpl.java
$(JAVAH) -o $@ gnu.java.net.VMPlainSocketImpl
$(top_srcdir)/include/gnu_java_net_local_LocalSocketImpl.h: $(top_srcdir)/gnu/java/net/local/LocalSocketImpl.java
@@ -215,12 +214,21 @@ $(top_srcdir)/include/java_net_VMNetworkInterface.h: $(top_srcdir)/vm/reference/
$(JAVAH) -o $@ java.net.VMNetworkInterface
$(top_srcdir)/include/java_net_VMURLConnection.h: $(top_srcdir)/vm/reference/java/net/VMURLConnection.java
$(JAVAH) -o $@ java.net.VMURLConnection
+
$(top_srcdir)/include/java_nio_VMDirectByteBuffer.h: $(top_srcdir)/vm/reference/java/nio/VMDirectByteBuffer.java
$(JAVAH) -o $@ java.nio.VMDirectByteBuffer
$(top_srcdir)/include/java_nio_MappedByteBufferImpl.h: $(top_srcdir)/java/nio/MappedByteBufferImpl.java
$(JAVAH) -o $@ java.nio.MappedByteBufferImpl
-$(top_srcdir)/include/gnu_java_nio_channels_FileChannelImpl.h: $(top_srcdir)/gnu/java/nio/channels/FileChannelImpl.java
- $(JAVAH) -o $@ gnu.java.nio.channels.FileChannelImpl
+
+$(top_srcdir)/include/gnu_java_nio_FileChannelImpl.h: $(top_srcdir)/gnu/java/nio/FileChannelImpl.java
+ $(JAVAH) -o $@ gnu.java.nio.FileChannelImpl
+
+$(top_srcdir)/include/gnu_java_nio_KqueueSelectorImpl.h: $(top_srcdir)/gnu/java/nio/KqueueSelectorImpl.java
+ $(JAVAH) -o $@ gnu.java.nio.KqueueSelectorImpl
+
+$(top_srcdir)/include/gnu_java_nio_EpollSelectorImpl.h: $(top_srcdir)/gnu/java/nio/EpollSelectorImpl.java
+ $(JAVAH) -o $@ gnu.java.nio.EpollSelectorImpl
+
$(top_srcdir)/include/gnu_java_nio_charset_iconv_IconvDecoder.h: $(top_srcdir)/gnu/java/nio/charset/iconv/IconvDecoder.java
$(JAVAH) -o $@ gnu.java.nio.charset.iconv.IconvDecoder
$(top_srcdir)/include/gnu_java_nio_charset_iconv_IconvEncoder.h: $(top_srcdir)/gnu/java/nio/charset/iconv/IconvEncoder.java
diff --git a/libjava/classpath/include/Makefile.in b/libjava/classpath/include/Makefile.in
index b87dc5b7949..30286764c68 100644
--- a/libjava/classpath/include/Makefile.in
+++ b/libjava/classpath/include/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -158,6 +160,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -279,7 +283,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
DISTCLEANFILES = jni_md.h config-int.h
ARG_JNI_JAVAH = -jni
@@ -404,13 +407,14 @@ $(XMLJ_H_FILES) \
$(GTKPEER_H_FILES) \
$(QTPEER_H_FILES) \
$(GCONF_PREFS_FILES) \
-$(top_srcdir)/include/gnu_java_net_VMPlainDatagramSocketImpl.h \
$(top_srcdir)/include/gnu_java_net_VMPlainSocketImpl.h \
$(top_srcdir)/include/gnu_java_net_local_LocalSocketImpl.h \
+$(top_srcdir)/include/gnu_java_nio_EpollSelectorImpl.h \
+$(top_srcdir)/include/gnu_java_nio_FileChannelImpl.h \
+$(top_srcdir)/include/gnu_java_nio_KqueueSelectorImpl.h \
$(top_srcdir)/include/gnu_java_nio_VMChannel.h \
$(top_srcdir)/include/gnu_java_nio_VMPipe.h \
$(top_srcdir)/include/gnu_java_nio_VMSelector.h \
-$(top_srcdir)/include/gnu_java_nio_channels_FileChannelImpl.h \
$(top_srcdir)/include/gnu_java_nio_charset_iconv_IconvEncoder.h \
$(top_srcdir)/include/gnu_java_nio_charset_iconv_IconvDecoder.h \
$(top_srcdir)/include/java_io_VMFile.h \
@@ -637,8 +641,6 @@ uninstall-am: uninstall-info-am
@CREATE_JNI_HEADERS_TRUE@$(top_srcdir)/include/gnu_java_util_prefs_gconf_%.h: $(top_builddir)/$(CLASSDIR)/gnu/java/util/prefs/gconf/%.class
@CREATE_JNI_HEADERS_TRUE@ $(JAVAH) -o $@ gnu.java.util.prefs.gconf.$*
-@CREATE_JNI_HEADERS_TRUE@$(top_srcdir)/include/gnu_java_net_VMPlainDatagramSocketImpl.h: $(top_srcdir)/vm/reference/gnu/java/net/VMPlainDatagramSocketImpl.java
-@CREATE_JNI_HEADERS_TRUE@ $(JAVAH) -o $@ gnu.java.net.VMPlainDatagramSocketImpl
@CREATE_JNI_HEADERS_TRUE@$(top_srcdir)/include/gnu_java_net_VMPlainSocketImpl.h: $(top_srcdir)/vm/reference/gnu/java/net/VMPlainSocketImpl.java
@CREATE_JNI_HEADERS_TRUE@ $(JAVAH) -o $@ gnu.java.net.VMPlainSocketImpl
@CREATE_JNI_HEADERS_TRUE@$(top_srcdir)/include/gnu_java_net_local_LocalSocketImpl.h: $(top_srcdir)/gnu/java/net/local/LocalSocketImpl.java
@@ -673,12 +675,21 @@ uninstall-am: uninstall-info-am
@CREATE_JNI_HEADERS_TRUE@ $(JAVAH) -o $@ java.net.VMNetworkInterface
@CREATE_JNI_HEADERS_TRUE@$(top_srcdir)/include/java_net_VMURLConnection.h: $(top_srcdir)/vm/reference/java/net/VMURLConnection.java
@CREATE_JNI_HEADERS_TRUE@ $(JAVAH) -o $@ java.net.VMURLConnection
+
@CREATE_JNI_HEADERS_TRUE@$(top_srcdir)/include/java_nio_VMDirectByteBuffer.h: $(top_srcdir)/vm/reference/java/nio/VMDirectByteBuffer.java
@CREATE_JNI_HEADERS_TRUE@ $(JAVAH) -o $@ java.nio.VMDirectByteBuffer
@CREATE_JNI_HEADERS_TRUE@$(top_srcdir)/include/java_nio_MappedByteBufferImpl.h: $(top_srcdir)/java/nio/MappedByteBufferImpl.java
@CREATE_JNI_HEADERS_TRUE@ $(JAVAH) -o $@ java.nio.MappedByteBufferImpl
-@CREATE_JNI_HEADERS_TRUE@$(top_srcdir)/include/gnu_java_nio_channels_FileChannelImpl.h: $(top_srcdir)/gnu/java/nio/channels/FileChannelImpl.java
-@CREATE_JNI_HEADERS_TRUE@ $(JAVAH) -o $@ gnu.java.nio.channels.FileChannelImpl
+
+@CREATE_JNI_HEADERS_TRUE@$(top_srcdir)/include/gnu_java_nio_FileChannelImpl.h: $(top_srcdir)/gnu/java/nio/FileChannelImpl.java
+@CREATE_JNI_HEADERS_TRUE@ $(JAVAH) -o $@ gnu.java.nio.FileChannelImpl
+
+@CREATE_JNI_HEADERS_TRUE@$(top_srcdir)/include/gnu_java_nio_KqueueSelectorImpl.h: $(top_srcdir)/gnu/java/nio/KqueueSelectorImpl.java
+@CREATE_JNI_HEADERS_TRUE@ $(JAVAH) -o $@ gnu.java.nio.KqueueSelectorImpl
+
+@CREATE_JNI_HEADERS_TRUE@$(top_srcdir)/include/gnu_java_nio_EpollSelectorImpl.h: $(top_srcdir)/gnu/java/nio/EpollSelectorImpl.java
+@CREATE_JNI_HEADERS_TRUE@ $(JAVAH) -o $@ gnu.java.nio.EpollSelectorImpl
+
@CREATE_JNI_HEADERS_TRUE@$(top_srcdir)/include/gnu_java_nio_charset_iconv_IconvDecoder.h: $(top_srcdir)/gnu/java/nio/charset/iconv/IconvDecoder.java
@CREATE_JNI_HEADERS_TRUE@ $(JAVAH) -o $@ gnu.java.nio.charset.iconv.IconvDecoder
@CREATE_JNI_HEADERS_TRUE@$(top_srcdir)/include/gnu_java_nio_charset_iconv_IconvEncoder.h: $(top_srcdir)/gnu/java/nio/charset/iconv/IconvEncoder.java
diff --git a/libjava/classpath/include/config.h.in b/libjava/classpath/include/config.h.in
index dda8b58e96e..0b2a58e86df 100644
--- a/libjava/classpath/include/config.h.in
+++ b/libjava/classpath/include/config.h.in
@@ -36,6 +36,9 @@
/* Define to 1 if you have the <dssi.h> header file. */
#undef HAVE_DSSI_H
+/* Define to 1 if you have the `epoll_create' function. */
+#undef HAVE_EPOLL_CREATE
+
/* Define to 1 if you have the `execve' function. */
#undef HAVE_EXECVE
@@ -57,9 +60,15 @@
/* Define to 1 if you have the `ftruncate' function. */
#undef HAVE_FTRUNCATE
+/* Define to 1 if you have the `gethostbyname_r' function. */
+#undef HAVE_GETHOSTBYNAME_R
+
/* Define to 1 if you have the `gethostname' function. */
#undef HAVE_GETHOSTNAME
+/* Define to 1 if you have the `getifaddrs' function. */
+#undef HAVE_GETIFADDRS
+
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
@@ -72,6 +81,12 @@
/* Define to 1 if you have the `getsockopt' function. */
#undef HAVE_GETSOCKOPT
+/* Define if function attributes a la GCC 2.5 and higher are available. */
+#undef HAVE_GNUC25_ATTRIB
+
+/* Define if unused variables la GCC 2.5 and higher are available. */
+#undef HAVE_GNUC25_UNUSED
+
/* Define to 1 if you have the `htonl' function. */
#undef HAVE_HTONL
@@ -81,12 +96,36 @@
/* Define if you have the iconv() function. */
#undef HAVE_ICONV
+/* Define to 1 if you have the <ifaddrs.h> header file. */
+#undef HAVE_IFADDRS_H
+
+/* Define if inet6 structures are defined in netinet/in.h. */
+#undef HAVE_INET6
+
+/* Define to 1 if you have the `inet_addr' function. */
+#undef HAVE_INET_ADDR
+
+/* Define to 1 if you have the `inet_aton' function. */
+#undef HAVE_INET_ATON
+
+/* Define to 1 if you have the `inet_pton' function. */
+#undef HAVE_INET_PTON
+
/* Define to 1 if you have uint32_t */
#undef HAVE_INT32_DEFINED
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the `kevent' function. */
+#undef HAVE_KEVENT
+
+/* Define to 1 if you have the `kqueue' function. */
+#undef HAVE_KQUEUE
+
+/* Define to 1 if you have the `ltdl' library (-lltdl). */
+#undef HAVE_LIBLTDL
+
/* Define to 1 if you have the `listen' function. */
#undef HAVE_LISTEN
@@ -99,6 +138,9 @@
/* Define to 1 if you have the `lstat' function. */
#undef HAVE_LSTAT
+/* Define to 1 if you have the <ltdl.h> header file. */
+#undef HAVE_LTDL_H
+
/* Define to 1 if you have the `madvise' function. */
#undef HAVE_MADVISE
@@ -120,6 +162,9 @@
/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP
+/* Define this symbol if you have MSG_NOSIGNAL */
+#undef HAVE_MSG_NOSIGNAL
+
/* Define to 1 if you have the `msync' function. */
#undef HAVE_MSYNC
@@ -135,9 +180,15 @@
/* Define to 1 if you have the `read' function. */
#undef HAVE_READ
+/* Define to 1 if you have the `readdir_r' function. */
+#undef HAVE_READDIR_R
+
/* Define to 1 if you have the `readlink' function. */
#undef HAVE_READLINK
+/* Define to 1 if you have the `readv' function. */
+#undef HAVE_READV
+
/* Define to 1 if you have the `recvfrom' function. */
#undef HAVE_RECVFROM
@@ -159,6 +210,9 @@
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
+/* Define this symbol if you have SO_NOSIGPIPE */
+#undef HAVE_SO_NOSIGPIPE
+
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -186,6 +240,12 @@
/* Define to 1 if you have the <sys/config.h> header file. */
#undef HAVE_SYS_CONFIG_H
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+#undef HAVE_SYS_EPOLL_H
+
+/* Define to 1 if you have the <sys/event.h> header file. */
+#undef HAVE_SYS_EVENT_H
+
/* Define to 1 if you have the <sys/filio.h> header file. */
#undef HAVE_SYS_FILIO_H
@@ -236,6 +296,9 @@
/* Define to 1 if you have the `write' function. */
#undef HAVE_WRITE
+/* Define to 1 if you have the `writev' function. */
+#undef HAVE_WRITEV
+
/* Define to 1 if you have libXrandr. */
#undef HAVE_XRANDR
@@ -315,3 +378,24 @@
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
+
+/* GNU C attributes. */
+#ifndef FUNCATTR
+#ifdef HAVE_GNUC25_ATTRIB
+#define FUNCATTR(x) __attribute__(x)
+#else
+#define FUNCATTR(x)
+#endif
+#endif
+
+/* GNU C unused functions, or null. */
+#ifndef ATTRUNUSED
+#ifdef HAVE_GNUC25_UNUSED
+#define ATTRUNUSED unused
+#else
+#define ATTRUNUSED
+#endif
+#endif
+#ifndef UNUSED
+#define UNUSED FUNCATTR((ATTRUNUSED))
+#endif
diff --git a/libjava/classpath/include/gnu_java_awt_peer_gtk_CairoGraphics2D.h b/libjava/classpath/include/gnu_java_awt_peer_gtk_CairoGraphics2D.h
index a54c7117ed9..c4a7f1b0264 100644
--- a/libjava/classpath/include/gnu_java_awt_peer_gtk_CairoGraphics2D.h
+++ b/libjava/classpath/include/gnu_java_awt_peer_gtk_CairoGraphics2D.h
@@ -12,9 +12,9 @@ extern "C"
JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_init (JNIEnv *env, jobject, jlong);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_disposeNative (JNIEnv *env, jobject, jlong);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_drawPixels (JNIEnv *env, jobject, jlong, jintArray, jint, jint, jint, jdoubleArray, jdouble);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_drawPixels (JNIEnv *env, jobject, jlong, jintArray, jint, jint, jint, jdoubleArray, jdouble, jint);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_setGradient (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble, jint, jint, jint, jint, jint, jint, jint, jint, jboolean);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_setTexturePixels (JNIEnv *env, jobject, jlong, jintArray, jint, jint, jint);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_setPaintPixels (JNIEnv *env, jobject, jlong, jintArray, jint, jint, jint, jboolean, jint, jint);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetMatrix (JNIEnv *env, jobject, jlong, jdoubleArray);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoScale (JNIEnv *env, jobject, jlong, jdouble, jdouble);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetOperator (JNIEnv *env, jobject, jlong, jint);
@@ -23,6 +23,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetFillRu
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetLine (JNIEnv *env, jobject, jlong, jdouble, jint, jint, jdouble);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetDash (JNIEnv *env, jobject, jlong, jdoubleArray, jint, jdouble);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawGlyphVector (JNIEnv *env, jobject, jlong, jobject, jfloat, jfloat, jint, jintArray, jfloatArray);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetFont (JNIEnv *env, jobject, jlong, jobject);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelCurveTo (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRectangle (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoArc (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble, jdouble);
@@ -40,10 +41,21 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoFill (JNI
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoClip (JNIEnv *env, jobject, jlong);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoPreserveClip (JNIEnv *env, jobject, jlong);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoResetClip (JNIEnv *env, jobject, jlong);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSurfaceSetFilter (JNIEnv *env, jobject, jlong, jint);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawLine (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawRect (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoFillRect (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble);
+#undef gnu_java_awt_peer_gtk_CairoGraphics2D_INTERPOLATION_NEAREST
+#define gnu_java_awt_peer_gtk_CairoGraphics2D_INTERPOLATION_NEAREST 0L
+#undef gnu_java_awt_peer_gtk_CairoGraphics2D_INTERPOLATION_BILINEAR
+#define gnu_java_awt_peer_gtk_CairoGraphics2D_INTERPOLATION_BILINEAR 1L
+#undef gnu_java_awt_peer_gtk_CairoGraphics2D_INTERPOLATION_BICUBIC
+#define gnu_java_awt_peer_gtk_CairoGraphics2D_INTERPOLATION_BICUBIC 5L
+#undef gnu_java_awt_peer_gtk_CairoGraphics2D_ALPHA_INTERPOLATION_SPEED
+#define gnu_java_awt_peer_gtk_CairoGraphics2D_ALPHA_INTERPOLATION_SPEED 2L
+#undef gnu_java_awt_peer_gtk_CairoGraphics2D_ALPHA_INTERPOLATION_QUALITY
+#define gnu_java_awt_peer_gtk_CairoGraphics2D_ALPHA_INTERPOLATION_QUALITY 3L
+#undef gnu_java_awt_peer_gtk_CairoGraphics2D_ALPHA_INTERPOLATION_DEFAULT
+#define gnu_java_awt_peer_gtk_CairoGraphics2D_ALPHA_INTERPOLATION_DEFAULT 4L
#ifdef __cplusplus
}
diff --git a/libjava/classpath/include/gnu_java_awt_peer_gtk_CairoSurface.h b/libjava/classpath/include/gnu_java_awt_peer_gtk_CairoSurface.h
index 88000095d7f..38857071091 100644
--- a/libjava/classpath/include/gnu_java_awt_peer_gtk_CairoSurface.h
+++ b/libjava/classpath/include/gnu_java_awt_peer_gtk_CairoSurface.h
@@ -14,7 +14,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_create (JNIEnv *e
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_destroy (JNIEnv *env, jobject, jlong, jlong);
JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_nativeGetElem (JNIEnv *env, jobject, jlong, jint);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_nativeSetElem (JNIEnv *env, jobject, jlong, jint, jint);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_nativeDrawSurface (JNIEnv *env, jobject, jlong, jlong, jdoubleArray, jdouble);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_nativeDrawSurface (JNIEnv *env, jobject, jlong, jlong, jdoubleArray, jdouble, jint);
JNIEXPORT jintArray JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_nativeGetPixels (JNIEnv *env, jobject, jlong, jint);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_nativeSetPixels (JNIEnv *env, jobject, jlong, jintArray);
JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_getFlippedBuffer (JNIEnv *env, jobject, jlong, jint);
diff --git a/libjava/classpath/include/gnu_java_awt_peer_gtk_GdkFontPeer.h b/libjava/classpath/include/gnu_java_awt_peer_gtk_GdkFontPeer.h
index 3b9ddd44333..c23980ca55c 100644
--- a/libjava/classpath/include/gnu_java_awt_peer_gtk_GdkFontPeer.h
+++ b/libjava/classpath/include/gnu_java_awt_peer_gtk_GdkFontPeer.h
@@ -18,6 +18,22 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_getFontMetrics (JN
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTextMetrics (JNIEnv *env, jobject, jstring, jdoubleArray);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_releasePeerGraphicsResource (JNIEnv *env, jobject);
JNIEXPORT jbyteArray JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTrueTypeTable (JNIEnv *env, jobject, jbyte, jbyte, jbyte, jbyte);
+#undef gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_ASCENT
+#define gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_ASCENT 0L
+#undef gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_MAX_ASCENT
+#define gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_MAX_ASCENT 1L
+#undef gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_DESCENT
+#define gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_DESCENT 2L
+#undef gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_MAX_DESCENT
+#define gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_MAX_DESCENT 3L
+#undef gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_MAX_ADVANCE
+#define gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_MAX_ADVANCE 4L
+#undef gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_HEIGHT
+#define gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_HEIGHT 5L
+#undef gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_UNDERLINE_OFFSET
+#define gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_UNDERLINE_OFFSET 6L
+#undef gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_UNDERLINE_THICKNESS
+#define gnu_java_awt_peer_gtk_GdkFontPeer_FONT_METRICS_UNDERLINE_THICKNESS 7L
#ifdef __cplusplus
}
diff --git a/libjava/classpath/include/gnu_java_awt_peer_gtk_GtkChoicePeer.h b/libjava/classpath/include/gnu_java_awt_peer_gtk_GtkChoicePeer.h
index 5450434d880..fc6a72a5955 100644
--- a/libjava/classpath/include/gnu_java_awt_peer_gtk_GtkChoicePeer.h
+++ b/libjava/classpath/include/gnu_java_awt_peer_gtk_GtkChoicePeer.h
@@ -12,12 +12,12 @@ extern "C"
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create (JNIEnv *env, jobject);
JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeGetSelected (JNIEnv *env, jobject);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_add (JNIEnv *env, jobject, jstring, jint);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeRemove (JNIEnv *env, jobject, jint);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeRemoveAll (JNIEnv *env, jobject);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_connectSignals (JNIEnv *env, jobject);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_selectNative (JNIEnv *env, jobject, jint);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_selectNativeUnlocked (JNIEnv *env, jobject, jint);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_add (JNIEnv *env, jobject, jstring, jint);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeRemove (JNIEnv *env, jobject, jint);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeRemoveAll (JNIEnv *env, jobject);
#ifdef __cplusplus
}
diff --git a/libjava/classpath/include/gnu_java_awt_peer_gtk_GtkFramePeer.h b/libjava/classpath/include/gnu_java_awt_peer_gtk_GtkFramePeer.h
index 2095d421c6f..63b881d2f78 100644
--- a/libjava/classpath/include/gnu_java_awt_peer_gtk_GtkFramePeer.h
+++ b/libjava/classpath/include/gnu_java_awt_peer_gtk_GtkFramePeer.h
@@ -16,6 +16,10 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_setMenuBarWidth (
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_setMenuBarPeer (JNIEnv *env, jobject, jobject);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_removeMenuBarPeer (JNIEnv *env, jobject);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_gtkFixedSetVisible (JNIEnv *env, jobject, jboolean);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_maximize (JNIEnv *env, jobject);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_unmaximize (JNIEnv *env, jobject);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_iconify (JNIEnv *env, jobject);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_deiconify (JNIEnv *env, jobject);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_nativeSetIconImage (JNIEnv *env, jobject, jobject);
#ifdef __cplusplus
diff --git a/libjava/classpath/include/gnu_java_awt_peer_gtk_GtkToolkit.h b/libjava/classpath/include/gnu_java_awt_peer_gtk_GtkToolkit.h
index 6cdcc622aab..b91d54cdb09 100644
--- a/libjava/classpath/include/gnu_java_awt_peer_gtk_GtkToolkit.h
+++ b/libjava/classpath/include/gnu_java_awt_peer_gtk_GtkToolkit.h
@@ -11,12 +11,13 @@ extern "C"
#endif
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkInit (JNIEnv *env, jclass, jint);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkMain (JNIEnv *env, jclass);
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkQuit (JNIEnv *env, jclass);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkToolkit_beep (JNIEnv *env, jobject);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkToolkit_getScreenSizeDimensions (JNIEnv *env, jobject, jintArray);
JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_GtkToolkit_getScreenResolution (JNIEnv *env, jobject);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkToolkit_sync (JNIEnv *env, jobject);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkToolkit_loadSystemColors (JNIEnv *env, jobject, jintArray);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkMain (JNIEnv *env, jclass);
JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_GtkToolkit_getMouseNumberOfButtons (JNIEnv *env, jobject);
#ifdef __cplusplus
diff --git a/libjava/classpath/include/gnu_java_net_VMPlainDatagramSocketImpl.h b/libjava/classpath/include/gnu_java_net_VMPlainDatagramSocketImpl.h
deleted file mode 100644
index 2bd1f4905fd..00000000000
--- a/libjava/classpath/include/gnu_java_net_VMPlainDatagramSocketImpl.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-
-#ifndef __gnu_java_net_VMPlainDatagramSocketImpl__
-#define __gnu_java_net_VMPlainDatagramSocketImpl__
-
-#include <jni.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainDatagramSocketImpl_bind (JNIEnv *env, jclass, jobject, jint, jobject);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainDatagramSocketImpl_create (JNIEnv *env, jclass, jobject);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainDatagramSocketImpl_connect (JNIEnv *env, jclass, jobject, jobject, jint);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainDatagramSocketImpl_nativeSendTo (JNIEnv *env, jclass, jobject, jobject, jint, jbyteArray, jint, jint);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainDatagramSocketImpl_nativeReceive (JNIEnv *env, jclass, jobject, jbyteArray, jint, jint, jbyteArray, jintArray, jintArray);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainDatagramSocketImpl_setOption (JNIEnv *env, jclass, jobject, jint, jobject);
-JNIEXPORT jobject JNICALL Java_gnu_java_net_VMPlainDatagramSocketImpl_getOption (JNIEnv *env, jclass, jobject, jint);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainDatagramSocketImpl_close (JNIEnv *env, jclass, jobject);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainDatagramSocketImpl_join (JNIEnv *env, jclass, jobject, jobject);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainDatagramSocketImpl_leave (JNIEnv *env, jclass, jobject, jobject);
-#undef gnu_java_net_VMPlainDatagramSocketImpl_IP_TTL
-#define gnu_java_net_VMPlainDatagramSocketImpl_IP_TTL 7777L
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __gnu_java_net_VMPlainDatagramSocketImpl__ */
diff --git a/libjava/classpath/include/gnu_java_net_VMPlainSocketImpl.h b/libjava/classpath/include/gnu_java_net_VMPlainSocketImpl.h
index f7616c2c3bc..ef3c3a46784 100644
--- a/libjava/classpath/include/gnu_java_net_VMPlainSocketImpl.h
+++ b/libjava/classpath/include/gnu_java_net_VMPlainSocketImpl.h
@@ -10,19 +10,27 @@ extern "C"
{
#endif
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_setOption (JNIEnv *env, jclass, jobject, jint, jobject);
-JNIEXPORT jobject JNICALL Java_gnu_java_net_VMPlainSocketImpl_getOption (JNIEnv *env, jclass, jobject, jint);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_create (JNIEnv *env, jclass, jobject);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_connect (JNIEnv *env, jclass, jobject, jobject, jint);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_bind (JNIEnv *env, jclass, jobject, jobject, jint);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_listen (JNIEnv *env, jclass, jobject, jint);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_accept (JNIEnv *env, jclass, jobject, jobject);
-JNIEXPORT jint JNICALL Java_gnu_java_net_VMPlainSocketImpl_available (JNIEnv *env, jclass, jobject);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_close (JNIEnv *env, jclass, jobject);
-JNIEXPORT jint JNICALL Java_gnu_java_net_VMPlainSocketImpl_read (JNIEnv *env, jclass, jobject, jbyteArray, jint, jint);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_write (JNIEnv *env, jclass, jobject, jbyteArray, jint, jint);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_shutdownInput (JNIEnv *env, jclass, jobject);
-JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_shutdownOutput (JNIEnv *env, jclass, jobject);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_setOption (JNIEnv *env, jclass, jint, jint, jint);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_setMulticastInterface (JNIEnv *env, jclass, jint, jint, jobject);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_setMulticastInterface6 (JNIEnv *env, jclass, jint, jint, jstring);
+JNIEXPORT jint JNICALL Java_gnu_java_net_VMPlainSocketImpl_getOption (JNIEnv *env, jclass, jint, jint);
+JNIEXPORT jobject JNICALL Java_gnu_java_net_VMPlainSocketImpl_getMulticastInterface (JNIEnv *env, jclass, jint, jint);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_bind (JNIEnv *env, jclass, jint, jbyteArray, jint);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_bind6 (JNIEnv *env, jclass, jint, jbyteArray, jint);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_listen (JNIEnv *env, jclass, jint, jint);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_join (JNIEnv *env, jclass, jint, jbyteArray);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_join6 (JNIEnv *env, jclass, jint, jbyteArray);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_leave (JNIEnv *env, jclass, jint, jbyteArray);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_leave6 (JNIEnv *env, jclass, jint, jbyteArray);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_joinGroup (JNIEnv *env, jclass, jint, jbyteArray, jstring);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_joinGroup6 (JNIEnv *env, jclass, jint, jbyteArray, jstring);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_leaveGroup (JNIEnv *env, jclass, jint, jbyteArray, jstring);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_leaveGroup6 (JNIEnv *env, jclass, jint, jbyteArray, jstring);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_shutdownInput (JNIEnv *env, jclass, jint);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_shutdownOutput (JNIEnv *env, jclass, jint);
+JNIEXPORT void JNICALL Java_gnu_java_net_VMPlainSocketImpl_sendUrgentData (JNIEnv *env, jclass, jint, jint);
+#undef gnu_java_net_VMPlainSocketImpl_CP_IP_TTL
+#define gnu_java_net_VMPlainSocketImpl_CP_IP_TTL 7777L
#ifdef __cplusplus
}
diff --git a/libjava/classpath/include/gnu_java_nio_EpollSelectorImpl.h b/libjava/classpath/include/gnu_java_nio_EpollSelectorImpl.h
new file mode 100644
index 00000000000..0e43d1ce9fc
--- /dev/null
+++ b/libjava/classpath/include/gnu_java_nio_EpollSelectorImpl.h
@@ -0,0 +1,37 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+
+#ifndef __gnu_java_nio_EpollSelectorImpl__
+#define __gnu_java_nio_EpollSelectorImpl__
+
+#include <jni.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+JNIEXPORT jboolean JNICALL Java_gnu_java_nio_EpollSelectorImpl_epoll_1supported (JNIEnv *env, jclass);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_EpollSelectorImpl_sizeof_1struct (JNIEnv *env, jclass);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_EpollSelectorImpl_epoll_1create (JNIEnv *env, jclass, jint);
+JNIEXPORT void JNICALL Java_gnu_java_nio_EpollSelectorImpl_epoll_1add (JNIEnv *env, jclass, jint, jint, jint);
+JNIEXPORT void JNICALL Java_gnu_java_nio_EpollSelectorImpl_epoll_1modify (JNIEnv *env, jclass, jint, jint, jint);
+JNIEXPORT void JNICALL Java_gnu_java_nio_EpollSelectorImpl_epoll_1delete (JNIEnv *env, jclass, jint, jint);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_EpollSelectorImpl_epoll_1wait (JNIEnv *env, jclass, jint, jobject, jint, jint);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_EpollSelectorImpl_selected_1fd (JNIEnv *env, jclass, jobject);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_EpollSelectorImpl_selected_1ops (JNIEnv *env, jclass, jobject);
+#undef gnu_java_nio_EpollSelectorImpl_DEFAULT_EPOLL_SIZE
+#define gnu_java_nio_EpollSelectorImpl_DEFAULT_EPOLL_SIZE 128L
+#undef gnu_java_nio_EpollSelectorImpl_OP_ACCEPT
+#define gnu_java_nio_EpollSelectorImpl_OP_ACCEPT 16L
+#undef gnu_java_nio_EpollSelectorImpl_OP_CONNECT
+#define gnu_java_nio_EpollSelectorImpl_OP_CONNECT 8L
+#undef gnu_java_nio_EpollSelectorImpl_OP_READ
+#define gnu_java_nio_EpollSelectorImpl_OP_READ 1L
+#undef gnu_java_nio_EpollSelectorImpl_OP_WRITE
+#define gnu_java_nio_EpollSelectorImpl_OP_WRITE 4L
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gnu_java_nio_EpollSelectorImpl__ */
diff --git a/libjava/classpath/include/gnu_java_nio_FileChannelImpl.h b/libjava/classpath/include/gnu_java_nio_FileChannelImpl.h
new file mode 100644
index 00000000000..43000114cc4
--- /dev/null
+++ b/libjava/classpath/include/gnu_java_nio_FileChannelImpl.h
@@ -0,0 +1,30 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+
+#ifndef __gnu_java_nio_FileChannelImpl__
+#define __gnu_java_nio_FileChannelImpl__
+
+#include <jni.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#undef gnu_java_nio_FileChannelImpl_READ
+#define gnu_java_nio_FileChannelImpl_READ 1L
+#undef gnu_java_nio_FileChannelImpl_WRITE
+#define gnu_java_nio_FileChannelImpl_WRITE 2L
+#undef gnu_java_nio_FileChannelImpl_APPEND
+#define gnu_java_nio_FileChannelImpl_APPEND 4L
+#undef gnu_java_nio_FileChannelImpl_EXCL
+#define gnu_java_nio_FileChannelImpl_EXCL 8L
+#undef gnu_java_nio_FileChannelImpl_SYNC
+#define gnu_java_nio_FileChannelImpl_SYNC 16L
+#undef gnu_java_nio_FileChannelImpl_DSYNC
+#define gnu_java_nio_FileChannelImpl_DSYNC 32L
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gnu_java_nio_FileChannelImpl__ */
diff --git a/libjava/classpath/include/gnu_java_nio_KqueueSelectorImpl.h b/libjava/classpath/include/gnu_java_nio_KqueueSelectorImpl.h
new file mode 100644
index 00000000000..acfdeaae7f7
--- /dev/null
+++ b/libjava/classpath/include/gnu_java_nio_KqueueSelectorImpl.h
@@ -0,0 +1,39 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+
+#ifndef __gnu_java_nio_KqueueSelectorImpl__
+#define __gnu_java_nio_KqueueSelectorImpl__
+
+#include <jni.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+JNIEXPORT jboolean JNICALL Java_gnu_java_nio_KqueueSelectorImpl_kqueue_1supported (JNIEnv *env, jclass);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_KqueueSelectorImpl_sizeof_1struct_1kevent (JNIEnv *env, jclass);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_KqueueSelectorImpl_implOpen (JNIEnv *env, jclass);
+JNIEXPORT void JNICALL Java_gnu_java_nio_KqueueSelectorImpl_implClose (JNIEnv *env, jclass, jint);
+JNIEXPORT void JNICALL Java_gnu_java_nio_KqueueSelectorImpl_kevent_1set (JNIEnv *env, jclass, jobject, jint, jint, jint, jint, jint);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_KqueueSelectorImpl_kevent (JNIEnv *env, jclass, jint, jobject, jint, jint, jlong);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_KqueueSelectorImpl_fetch_1key (JNIEnv *env, jclass, jobject);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_KqueueSelectorImpl_ready_1ops (JNIEnv *env, jclass, jobject, jint);
+JNIEXPORT jboolean JNICALL Java_gnu_java_nio_KqueueSelectorImpl_check_1eof (JNIEnv *env, jclass, jobject);
+#undef gnu_java_nio_KqueueSelectorImpl_MAX_DOUBLING_CAPACITY
+#define gnu_java_nio_KqueueSelectorImpl_MAX_DOUBLING_CAPACITY 16384L
+#undef gnu_java_nio_KqueueSelectorImpl_CAP_INCREMENT
+#define gnu_java_nio_KqueueSelectorImpl_CAP_INCREMENT 1024L
+#undef gnu_java_nio_KqueueSelectorImpl_OP_ACCEPT
+#define gnu_java_nio_KqueueSelectorImpl_OP_ACCEPT 16L
+#undef gnu_java_nio_KqueueSelectorImpl_OP_CONNECT
+#define gnu_java_nio_KqueueSelectorImpl_OP_CONNECT 8L
+#undef gnu_java_nio_KqueueSelectorImpl_OP_READ
+#define gnu_java_nio_KqueueSelectorImpl_OP_READ 1L
+#undef gnu_java_nio_KqueueSelectorImpl_OP_WRITE
+#define gnu_java_nio_KqueueSelectorImpl_OP_WRITE 4L
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gnu_java_nio_KqueueSelectorImpl__ */
diff --git a/libjava/classpath/include/gnu_java_nio_VMChannel.h b/libjava/classpath/include/gnu_java_nio_VMChannel.h
index 28f9048d254..dd023816c39 100644
--- a/libjava/classpath/include/gnu_java_nio_VMChannel.h
+++ b/libjava/classpath/include/gnu_java_nio_VMChannel.h
@@ -10,12 +10,38 @@ extern "C"
{
#endif
-JNIEXPORT void JNICALL Java_gnu_java_nio_VMChannel_setBlocking (JNIEnv *env, jobject, jint, jboolean);
-JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_read (JNIEnv *env, jobject, jint, jobject);
-JNIEXPORT jlong JNICALL Java_gnu_java_nio_VMChannel_readScattering (JNIEnv *env, jobject, jint, jobjectArray, jint, jint);
-JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_write (JNIEnv *env, jobject, jint, jobject);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_stdin_1fd (JNIEnv *env, jclass);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_stdout_1fd (JNIEnv *env, jclass);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_stderr_1fd (JNIEnv *env, jclass);
+JNIEXPORT void JNICALL Java_gnu_java_nio_VMChannel_setBlocking (JNIEnv *env, jclass, jint, jboolean);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_available (JNIEnv *env, jclass, jint);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_read__ILjava_nio_ByteBuffer_2 (JNIEnv *env, jclass, jint, jobject);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_read__I (JNIEnv *env, jclass, jint);
+JNIEXPORT jlong JNICALL Java_gnu_java_nio_VMChannel_readScattering (JNIEnv *env, jclass, jint, jobjectArray, jint, jint);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_receive (JNIEnv *env, jclass, jint, jobject, jobject);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_write__ILjava_nio_ByteBuffer_2 (JNIEnv *env, jobject, jint, jobject);
JNIEXPORT jlong JNICALL Java_gnu_java_nio_VMChannel_writeGathering (JNIEnv *env, jobject, jint, jobjectArray, jint, jint);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_send (JNIEnv *env, jclass, jint, jobject, jbyteArray, jint);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_send6 (JNIEnv *env, jclass, jint, jobject, jbyteArray, jint);
+JNIEXPORT void JNICALL Java_gnu_java_nio_VMChannel_write__II (JNIEnv *env, jclass, jint, jint);
JNIEXPORT void JNICALL Java_gnu_java_nio_VMChannel_initIDs (JNIEnv *env, jclass);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_socket (JNIEnv *env, jclass, jboolean);
+JNIEXPORT jboolean JNICALL Java_gnu_java_nio_VMChannel_connect (JNIEnv *env, jclass, jint, jbyteArray, jint, jint);
+JNIEXPORT jboolean JNICALL Java_gnu_java_nio_VMChannel_connect6 (JNIEnv *env, jclass, jint, jbyteArray, jint, jint);
+JNIEXPORT void JNICALL Java_gnu_java_nio_VMChannel_disconnect (JNIEnv *env, jclass, jint);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_getsockname (JNIEnv *env, jclass, jint, jobject);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_getpeername (JNIEnv *env, jclass, jint, jobject);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_accept (JNIEnv *env, jclass, jint);
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMChannel_open (JNIEnv *env, jclass, jstring, jint);
+JNIEXPORT jlong JNICALL Java_gnu_java_nio_VMChannel_position (JNIEnv *env, jclass, jint);
+JNIEXPORT void JNICALL Java_gnu_java_nio_VMChannel_seek (JNIEnv *env, jclass, jint, jlong);
+JNIEXPORT void JNICALL Java_gnu_java_nio_VMChannel_truncate (JNIEnv *env, jclass, jint, jlong);
+JNIEXPORT jboolean JNICALL Java_gnu_java_nio_VMChannel_lock (JNIEnv *env, jclass, jint, jlong, jlong, jboolean, jboolean);
+JNIEXPORT void JNICALL Java_gnu_java_nio_VMChannel_unlock (JNIEnv *env, jclass, jint, jlong, jlong);
+JNIEXPORT jlong JNICALL Java_gnu_java_nio_VMChannel_size (JNIEnv *env, jclass, jint);
+JNIEXPORT jobject JNICALL Java_gnu_java_nio_VMChannel_map (JNIEnv *env, jclass, jint, jchar, jlong, jint);
+JNIEXPORT jboolean JNICALL Java_gnu_java_nio_VMChannel_flush (JNIEnv *env, jclass, jint, jboolean);
+JNIEXPORT void JNICALL Java_gnu_java_nio_VMChannel_close (JNIEnv *env, jclass, jint);
#ifdef __cplusplus
}
diff --git a/libjava/classpath/include/gnu_java_nio_VMPipe.h b/libjava/classpath/include/gnu_java_nio_VMPipe.h
index afa563ac818..2088e55dcd2 100644
--- a/libjava/classpath/include/gnu_java_nio_VMPipe.h
+++ b/libjava/classpath/include/gnu_java_nio_VMPipe.h
@@ -10,7 +10,7 @@ extern "C"
{
#endif
-JNIEXPORT void JNICALL Java_gnu_java_nio_VMPipe_init (JNIEnv *env, jclass, jobject, jobject);
+JNIEXPORT jintArray JNICALL Java_gnu_java_nio_VMPipe_pipe0 (JNIEnv *env, jclass);
#ifdef __cplusplus
}
diff --git a/libjava/classpath/include/gnu_java_nio_channels_FileChannelImpl.h b/libjava/classpath/include/gnu_java_nio_channels_FileChannelImpl.h
deleted file mode 100644
index 1e09c09dd72..00000000000
--- a/libjava/classpath/include/gnu_java_nio_channels_FileChannelImpl.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-
-#ifndef __gnu_java_nio_channels_FileChannelImpl__
-#define __gnu_java_nio_channels_FileChannelImpl__
-
-#include <jni.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-JNIEXPORT void JNICALL Java_gnu_java_nio_channels_FileChannelImpl_init (JNIEnv *env, jclass);
-JNIEXPORT jint JNICALL Java_gnu_java_nio_channels_FileChannelImpl_open (JNIEnv *env, jobject, jstring, jint);
-JNIEXPORT jint JNICALL Java_gnu_java_nio_channels_FileChannelImpl_available (JNIEnv *env, jobject);
-JNIEXPORT jlong JNICALL Java_gnu_java_nio_channels_FileChannelImpl_implPosition (JNIEnv *env, jobject);
-JNIEXPORT void JNICALL Java_gnu_java_nio_channels_FileChannelImpl_seek (JNIEnv *env, jobject, jlong);
-JNIEXPORT void JNICALL Java_gnu_java_nio_channels_FileChannelImpl_implTruncate (JNIEnv *env, jobject, jlong);
-JNIEXPORT void JNICALL Java_gnu_java_nio_channels_FileChannelImpl_unlock (JNIEnv *env, jobject, jlong, jlong);
-JNIEXPORT jlong JNICALL Java_gnu_java_nio_channels_FileChannelImpl_size (JNIEnv *env, jobject);
-JNIEXPORT void JNICALL Java_gnu_java_nio_channels_FileChannelImpl_implCloseChannel (JNIEnv *env, jobject);
-JNIEXPORT jint JNICALL Java_gnu_java_nio_channels_FileChannelImpl_read__ (JNIEnv *env, jobject);
-JNIEXPORT jint JNICALL Java_gnu_java_nio_channels_FileChannelImpl_read___3BII (JNIEnv *env, jobject, jbyteArray, jint, jint);
-JNIEXPORT void JNICALL Java_gnu_java_nio_channels_FileChannelImpl_write___3BII (JNIEnv *env, jobject, jbyteArray, jint, jint);
-JNIEXPORT void JNICALL Java_gnu_java_nio_channels_FileChannelImpl_write__I (JNIEnv *env, jobject, jint);
-JNIEXPORT jobject JNICALL Java_gnu_java_nio_channels_FileChannelImpl_mapImpl (JNIEnv *env, jobject, jchar, jlong, jint);
-JNIEXPORT void JNICALL Java_gnu_java_nio_channels_FileChannelImpl_force (JNIEnv *env, jobject);
-JNIEXPORT jboolean JNICALL Java_gnu_java_nio_channels_FileChannelImpl_lock (JNIEnv *env, jobject, jlong, jlong, jboolean, jboolean);
-#undef gnu_java_nio_channels_FileChannelImpl_READ
-#define gnu_java_nio_channels_FileChannelImpl_READ 1L
-#undef gnu_java_nio_channels_FileChannelImpl_WRITE
-#define gnu_java_nio_channels_FileChannelImpl_WRITE 2L
-#undef gnu_java_nio_channels_FileChannelImpl_APPEND
-#define gnu_java_nio_channels_FileChannelImpl_APPEND 4L
-#undef gnu_java_nio_channels_FileChannelImpl_EXCL
-#define gnu_java_nio_channels_FileChannelImpl_EXCL 8L
-#undef gnu_java_nio_channels_FileChannelImpl_SYNC
-#define gnu_java_nio_channels_FileChannelImpl_SYNC 16L
-#undef gnu_java_nio_channels_FileChannelImpl_DSYNC
-#define gnu_java_nio_channels_FileChannelImpl_DSYNC 32L
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __gnu_java_nio_channels_FileChannelImpl__ */
diff --git a/libjava/classpath/include/gnu_java_util_prefs_gconf_GConfNativePeer.h b/libjava/classpath/include/gnu_java_util_prefs_gconf_GConfNativePeer.h
index ec902cbb8df..cc71b4097be 100644
--- a/libjava/classpath/include/gnu_java_util_prefs_gconf_GConfNativePeer.h
+++ b/libjava/classpath/include/gnu_java_util_prefs_gconf_GConfNativePeer.h
@@ -20,8 +20,10 @@ JNIEXPORT jboolean JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_
JNIEXPORT jstring JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1get_1string (JNIEnv *env, jclass, jstring);
JNIEXPORT jboolean JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1unset (JNIEnv *env, jclass, jstring);
JNIEXPORT void JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1suggest_1sync (JNIEnv *env, jclass);
-JNIEXPORT jobject JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1gconf_1client_1all_1nodes (JNIEnv *env, jclass, jstring);
-JNIEXPORT jobject JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1gconf_1client_1all_1keys (JNIEnv *env, jclass, jstring);
+JNIEXPORT jobject JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1all_1nodes (JNIEnv *env, jclass, jstring);
+JNIEXPORT jobject JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1all_1keys (JNIEnv *env, jclass, jstring);
+JNIEXPORT jstring JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1escape_1key (JNIEnv *env, jclass, jstring);
+JNIEXPORT jstring JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1unescape_1key (JNIEnv *env, jclass, jstring);
#ifdef __cplusplus
}
diff --git a/libjava/classpath/include/java_net_VMInetAddress.h b/libjava/classpath/include/java_net_VMInetAddress.h
index 54b57f220a7..66f4735772a 100644
--- a/libjava/classpath/include/java_net_VMInetAddress.h
+++ b/libjava/classpath/include/java_net_VMInetAddress.h
@@ -14,6 +14,7 @@ JNIEXPORT jstring JNICALL Java_java_net_VMInetAddress_getLocalHostname (JNIEnv *
JNIEXPORT jbyteArray JNICALL Java_java_net_VMInetAddress_lookupInaddrAny (JNIEnv *env, jclass);
JNIEXPORT jstring JNICALL Java_java_net_VMInetAddress_getHostByAddr (JNIEnv *env, jclass, jbyteArray);
JNIEXPORT jobjectArray JNICALL Java_java_net_VMInetAddress_getHostByName (JNIEnv *env, jclass, jstring);
+JNIEXPORT jbyteArray JNICALL Java_java_net_VMInetAddress_aton (JNIEnv *env, jclass, jstring);
#ifdef __cplusplus
}
diff --git a/libjava/classpath/include/java_net_VMNetworkInterface.h b/libjava/classpath/include/java_net_VMNetworkInterface.h
index c309357f3b4..b53bda565e7 100644
--- a/libjava/classpath/include/java_net_VMNetworkInterface.h
+++ b/libjava/classpath/include/java_net_VMNetworkInterface.h
@@ -10,7 +10,8 @@ extern "C"
{
#endif
-JNIEXPORT jobject JNICALL Java_java_net_VMNetworkInterface_getInterfaces (JNIEnv *env, jclass);
+JNIEXPORT void JNICALL Java_java_net_VMNetworkInterface_initIds (JNIEnv *env, jclass);
+JNIEXPORT jobjectArray JNICALL Java_java_net_VMNetworkInterface_getVMInterfaces (JNIEnv *env, jclass);
#ifdef __cplusplus
}
diff --git a/libjava/classpath/java/applet/AppletContext.java b/libjava/classpath/java/applet/AppletContext.java
index a17508fd4a4..5b6ce452408 100644
--- a/libjava/classpath/java/applet/AppletContext.java
+++ b/libjava/classpath/java/applet/AppletContext.java
@@ -1,5 +1,5 @@
/* AppletContext.java -- access the applet's runtime environment
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,7 +52,7 @@ import java.util.Iterator;
*
* @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.0
- * @status updated to 1.4
+ * @status updated to 1.5
*/
public interface AppletContext
{
@@ -90,7 +90,7 @@ public interface AppletContext
*
* @return a list of all the applets
*/
- Enumeration getApplets();
+ Enumeration<Applet> getApplets();
/**
* Displays the web page pointed to by the specified URL in the window
@@ -150,5 +150,5 @@ public interface AppletContext
* @return an iterator over the association keys
* @since 1.4
*/
- Iterator getStreamKeys();
+ Iterator<String> getStreamKeys();
} // interface AppletContext
diff --git a/libjava/classpath/java/awt/AWTEvent.java b/libjava/classpath/java/awt/AWTEvent.java
index a6151b424c1..3f4027c2c05 100644
--- a/libjava/classpath/java/awt/AWTEvent.java
+++ b/libjava/classpath/java/awt/AWTEvent.java
@@ -97,6 +97,11 @@ public abstract class AWTEvent extends EventObject
protected boolean consumed;
/**
+ * Used for implementing a simple linked list in EventQueue.
+ */
+ transient AWTEvent queueNext;
+
+ /**
* Who knows? It's in the serial version.
*
* @serial No idea what this is for.
diff --git a/libjava/classpath/java/awt/AWTEventMulticaster.java b/libjava/classpath/java/awt/AWTEventMulticaster.java
index f7b9163cf67..07a6ffc2002 100644
--- a/libjava/classpath/java/awt/AWTEventMulticaster.java
+++ b/libjava/classpath/java/awt/AWTEventMulticaster.java
@@ -1175,16 +1175,17 @@ public class AWTEventMulticaster
* @throws IllegalArgumentException if type is Void.TYPE
* @since 1.4
*/
- public static EventListener[] getListeners(EventListener l, Class type)
+ public static <T extends EventListener> T[] getListeners(EventListener l,
+ Class<T> type)
{
- ArrayList list = new ArrayList();
+ ArrayList<EventListener> list = new ArrayList<EventListener>();
if (l instanceof AWTEventMulticaster)
((AWTEventMulticaster) l).getListeners(list, type);
else if (type.isInstance(l))
list.add(l);
EventListener[] r = (EventListener[]) Array.newInstance(type, list.size());
list.toArray(r);
- return r;
+ return (T[]) r;
}
/**
diff --git a/libjava/classpath/java/awt/AWTKeyStroke.java b/libjava/classpath/java/awt/AWTKeyStroke.java
index 0e06225219f..527e85873e0 100644
--- a/libjava/classpath/java/awt/AWTKeyStroke.java
+++ b/libjava/classpath/java/awt/AWTKeyStroke.java
@@ -1,5 +1,5 @@
/* AWTKeyStroke.java -- an immutable key stroke
- Copyright (C) 2002, 2004, 2005 Free Software Foundation
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation
This file is part of GNU Classpath.
@@ -65,6 +65,7 @@ import java.util.StringTokenizer;
* no-arg constructor (of any accessibility).
*
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @see #getAWTKeyStroke(char)
* @since 1.4
* @status updated to 1.4
@@ -85,13 +86,15 @@ public class AWTKeyStroke implements Serializable
* under the assumption that garbage collection of a new keystroke is
* easy when we find the old one that it matches in the cache.
*/
- private static final LinkedHashMap cache = new LinkedHashMap(11, 0.75f, true)
+ private static final LinkedHashMap<AWTKeyStroke,AWTKeyStroke> cache =
+ new LinkedHashMap<AWTKeyStroke,AWTKeyStroke>(11, 0.75f, true)
{
/** The largest the keystroke cache can grow. */
private static final int MAX_CACHE_SIZE = 2048;
/** Prune stale entries. */
- protected boolean removeEldestEntry(Map.Entry eldest)
+ protected boolean removeEldestEntry(Map.Entry<AWTKeyStroke,AWTKeyStroke>
+ eldest)
{ // XXX - FIXME Use Map.Entry, not just Entry as gcj 3.1 workaround.
return size() > MAX_CACHE_SIZE;
}
@@ -114,7 +117,7 @@ public class AWTKeyStroke implements Serializable
*
* @see #getAWTKeyStroke(String)
*/
- static final HashMap vktable = new HashMap();
+ static final HashMap<String,Object> vktable = new HashMap<String,Object>();
static
{
// Using reflection saves the hassle of keeping this in sync with KeyEvent,
@@ -229,7 +232,7 @@ public class AWTKeyStroke implements Serializable
* @throws IllegalArgumentException subclass doesn't have no-arg constructor
* @throws ClassCastException subclass doesn't extend AWTKeyStroke
*/
- protected static void registerSubclass(final Class subclass)
+ protected static void registerSubclass(final Class<?> subclass)
{
if (subclass == null)
throw new IllegalArgumentException();
@@ -252,7 +255,8 @@ public class AWTKeyStroke implements Serializable
throws NoSuchMethodException, InstantiationException,
IllegalAccessException, InvocationTargetException
{
- Constructor c = subclass.getDeclaredConstructor(null);
+ Constructor<?> c =
+ subclass.getDeclaredConstructor((Class<?>[])null);
c.setAccessible(true);
// Create a new instance, to make sure that we can, and
// to cause any ClassCastException.
@@ -595,7 +599,7 @@ public class AWTKeyStroke implements Serializable
*/
protected Object readResolve() throws ObjectStreamException
{
- AWTKeyStroke s = (AWTKeyStroke) cache.get(this);
+ AWTKeyStroke s = cache.get(this);
if (s != null)
return s;
cache.put(this, this);
diff --git a/libjava/classpath/java/awt/BasicStroke.java b/libjava/classpath/java/awt/BasicStroke.java
index 160a3eb0f74..ef6a7f0b7b5 100644
--- a/libjava/classpath/java/awt/BasicStroke.java
+++ b/libjava/classpath/java/awt/BasicStroke.java
@@ -43,6 +43,7 @@ import gnu.java.awt.java2d.LineSegment;
import gnu.java.awt.java2d.QuadSegment;
import gnu.java.awt.java2d.Segment;
+import java.awt.geom.FlatteningPathIterator;
import java.awt.geom.GeneralPath;
import java.awt.geom.PathIterator;
import java.awt.geom.Point2D;
@@ -486,8 +487,157 @@ public class BasicStroke implements Stroke
private Shape dashedStroke(PathIterator pi)
{
- GeneralPath out = new GeneralPath();
- return out;
+ // The choice of (flatnessSq == width / 3) is made to be consistent with
+ // the flattening in CubicSegment.getDisplacedSegments
+ FlatteningPathIterator flat = new FlatteningPathIterator(pi,
+ Math.sqrt(width / 3));
+
+ // Holds the endpoint of the current segment (or piece of a segment)
+ double[] coords = new double[2];
+
+ // Holds end of the last segment
+ double x, y, x0, y0;
+ x = x0 = y = y0 = 0;
+
+ // Various useful flags
+ boolean pathOpen = false;
+ boolean dashOn = true;
+ boolean offsetting = (phase != 0);
+
+ // How far we are into the current dash
+ double distance = 0;
+ int dashIndex = 0;
+
+ // And variables to hold the final output
+ GeneralPath output = new GeneralPath();
+ Segment[] p;
+
+ // Iterate over the FlatteningPathIterator
+ while (! flat.isDone())
+ {
+ switch (flat.currentSegment(coords))
+ {
+ case PathIterator.SEG_MOVETO:
+ x0 = x = coords[0];
+ y0 = y = coords[1];
+
+ if (pathOpen)
+ {
+ capEnds();
+ convertPath(output, start);
+ start = end = null;
+ pathOpen = false;
+ }
+
+ break;
+
+ case PathIterator.SEG_LINETO:
+ boolean segmentConsumed = false;
+
+ while (! segmentConsumed)
+ {
+ // Find the total remaining length of this segment
+ double segLength = Math.sqrt((x - coords[0]) * (x - coords[0])
+ + (y - coords[1])
+ * (y - coords[1]));
+ boolean spanBoundary = true;
+ double[] segmentEnd = null;
+
+ // The current segment fits entirely inside the current dash
+ if ((offsetting && distance + segLength <= phase)
+ || distance + segLength <= dash[dashIndex])
+ {
+ spanBoundary = false;
+ }
+
+ // Otherwise, we need to split the segment in two, as this
+ // segment spans a dash boundry
+ else
+ {
+ segmentEnd = (double[]) coords.clone();
+
+ // Calculate the remaining distance in this dash,
+ // and coordinates of the dash boundary
+ double reqLength;
+ if (offsetting)
+ reqLength = phase - distance;
+ else
+ reqLength = dash[dashIndex] - distance;
+
+ coords[0] = x + ((coords[0] - x) * reqLength / segLength);
+ coords[1] = y + ((coords[1] - y) * reqLength / segLength);
+ }
+
+ if (offsetting || ! dashOn)
+ {
+ // Dash is off, or we are in offset - treat this as a
+ // moveTo
+ x0 = x = coords[0];
+ y0 = y = coords[1];
+
+ if (pathOpen)
+ {
+ capEnds();
+ convertPath(output, start);
+ start = end = null;
+ pathOpen = false;
+ }
+ }
+ else
+ {
+ // Dash is on - treat this as a lineTo
+ p = (new LineSegment(x, y, coords[0], coords[1])).getDisplacedSegments(width / 2.0);
+
+ if (! pathOpen)
+ {
+ start = p[0];
+ end = p[1];
+ pathOpen = true;
+ }
+ else
+ addSegments(p);
+
+ x = coords[0];
+ y = coords[1];
+ }
+
+ // Update variables depending on whether we spanned a
+ // dash boundary or not
+ if (! spanBoundary)
+ {
+ distance += segLength;
+ segmentConsumed = true;
+ }
+ else
+ {
+ if (offsetting)
+ offsetting = false;
+ dashOn = ! dashOn;
+ distance = 0;
+ coords = segmentEnd;
+
+ if (dashIndex + 1 == dash.length)
+ dashIndex = 0;
+ else
+ dashIndex++;
+
+ // Since the value of segmentConsumed is still false,
+ // the next run of the while loop will complete the segment
+ }
+ }
+ break;
+
+ // This is a flattened path, so we don't need to deal with curves
+ }
+ flat.next();
+ }
+
+ if (pathOpen)
+ {
+ capEnds();
+ convertPath(output, start);
+ }
+ return output;
}
/**
@@ -611,9 +761,13 @@ public class BasicStroke implements Stroke
p1 = new double[]{a.last.P2.getX(), a.last.P2.getY()};
dx = p1[0] - p0[0];
dy = p1[1] - p0[1];
- l = Math.sqrt(dx * dx + dy * dy);
- dx = (2.0/3.0)*width*dx/l;
- dy = (2.0/3.0)*width*dy/l;
+ if (dx != 0 && dy != 0)
+ {
+ l = Math.sqrt(dx * dx + dy * dy);
+ dx = (2.0/3.0)*width*dx/l;
+ dy = (2.0/3.0)*width*dy/l;
+ }
+
c1 = new Point2D.Double(p1[0] + dx, p1[1] + dy);
c2 = new Point2D.Double(b.P1.getX() + dx, b.P1.getY() + dy);
a.add(new CubicSegment(a.last.P2, c1, c2, b.P1));
diff --git a/libjava/classpath/java/awt/Button.java b/libjava/classpath/java/awt/Button.java
index ae897a2f75f..4c246c7650b 100644
--- a/libjava/classpath/java/awt/Button.java
+++ b/libjava/classpath/java/awt/Button.java
@@ -352,11 +352,11 @@ removeActionListener(ActionListener listener)
*
* @since 1.3
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
if (listenerType == ActionListener.class)
- return getActionListeners();
- return (EventListener[]) Array.newInstance(listenerType, 0);
+ return (T[]) getActionListeners();
+ return (T[]) Array.newInstance(listenerType, 0);
}
/*************************************************************************/
diff --git a/libjava/classpath/java/awt/CardLayout.java b/libjava/classpath/java/awt/CardLayout.java
index fcb05215af9..2e3feece8d2 100644
--- a/libjava/classpath/java/awt/CardLayout.java
+++ b/libjava/classpath/java/awt/CardLayout.java
@@ -225,6 +225,8 @@ public class CardLayout implements LayoutManager2, Serializable
*/
public Dimension maximumLayoutSize (Container target)
{
+ if (target == null)
+ return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
// The JCL says that this returns Integer.MAX_VALUE for both
// dimensions. But that just seems wrong to me.
return getSize (target, MAX);
@@ -361,7 +363,7 @@ public class CardLayout implements LayoutManager2, Serializable
*/
public String toString ()
{
- return getClass ().getName () + "[" + hgap + "," + vgap + "]";
+ return getClass ().getName () + "[hgap=" + hgap + ",vgap=" + vgap + "]";
}
/**
@@ -401,11 +403,11 @@ public class CardLayout implements LayoutManager2, Serializable
{
if (comps[i].isVisible ())
{
- if (what == NEXT)
+ if (choice == i)
{
- choice = i + 1;
- if (choice == num)
- choice = 0;
+ // Do nothing if we're already looking at the right
+ // component.
+ return;
}
else if (what == PREV)
{
@@ -413,17 +415,20 @@ public class CardLayout implements LayoutManager2, Serializable
if (choice < 0)
choice = num - 1;
}
- else if (choice == i)
+ else if (what == NEXT)
{
- // Do nothing if we're already looking at the right
- // component.
- return;
+ choice = i + 1;
+ if (choice == num)
+ choice = 0;
}
comps[i].setVisible (false);
if (choice >= 0)
break;
- }
+ } else
+ {
+ comps[i].setVisible(true);
+ }
}
if (choice >= 0 && choice < num)
diff --git a/libjava/classpath/java/awt/CheckboxMenuItem.java b/libjava/classpath/java/awt/CheckboxMenuItem.java
index 2df621b71b7..c886fc67203 100644
--- a/libjava/classpath/java/awt/CheckboxMenuItem.java
+++ b/libjava/classpath/java/awt/CheckboxMenuItem.java
@@ -318,11 +318,11 @@ paramString()
* @exception ClassCastException If listenerType doesn't specify a class or
* interface that implements java.util.EventListener.
*/
- public EventListener[] getListeners (Class listenerType)
+ public <T extends EventListener> T[] getListeners (Class<T> listenerType)
{
if (listenerType == ItemListener.class)
return AWTEventMulticaster.getListeners (item_listeners, listenerType);
-
+
return super.getListeners (listenerType);
}
diff --git a/libjava/classpath/java/awt/Choice.java b/libjava/classpath/java/awt/Choice.java
index 104e30a7e82..ae89b9e9954 100644
--- a/libjava/classpath/java/awt/Choice.java
+++ b/libjava/classpath/java/awt/Choice.java
@@ -255,8 +255,8 @@ public class Choice extends Component
/**
* Adds the specified item to this choice box.
*
- * This method is oboslete since Java 2 platform 1.1. Please use @see add
- * instead.
+ * This method is oboslete since Java 2 platform 1.1. Please use
+ * {@link #add(String)} instead.
*
* @param item The item to add.
*
@@ -320,9 +320,6 @@ public class Choice extends Component
*/
public synchronized void remove(int index)
{
- if ((index < 0) || (index > getItemCount()))
- throw new IllegalArgumentException("Bad index: " + index);
-
pItems.removeElementAt(index);
if (peer != null)
@@ -332,14 +329,14 @@ public class Choice extends Component
selectedIndex = -1;
else
{
- if( selectedIndex > index )
- selectedIndex--;
- else if( selectedIndex == index )
- selectedIndex = 0;
-
- if( peer != null )
- ((ChoicePeer)peer).select( selectedIndex );
- }
+ if( selectedIndex > index )
+ selectedIndex--;
+ else if( selectedIndex == index )
+ selectedIndex = 0;
+
+ if( peer != null )
+ ((ChoicePeer)peer).select( selectedIndex );
+ }
}
/**
@@ -523,11 +520,11 @@ public class Choice extends Component
*
* @since 1.3
*/
- public EventListener[] getListeners (Class listenerType)
+ public <T extends EventListener> T[] getListeners (Class<T> listenerType)
{
if (listenerType == ItemListener.class)
return AWTEventMulticaster.getListeners (item_listeners, listenerType);
-
+
return super.getListeners (listenerType);
}
diff --git a/libjava/classpath/java/awt/Color.java b/libjava/classpath/java/awt/Color.java
index b0312924170..c3d04c04976 100644
--- a/libjava/classpath/java/awt/Color.java
+++ b/libjava/classpath/java/awt/Color.java
@@ -534,14 +534,31 @@ public class Color implements Paint, Serializable
{
// Do not inline getRGB() to this.value, because of SystemColor.
int value = getRGB();
- int red = (value & RED_MASK) >> 16;
- int green = (value & GREEN_MASK) >> 8;
- int blue = value & BLUE_MASK;
- // We have to special case 0-2 because they won't scale by division.
- red = red < 3 ? 3 : (int) Math.min(255, red / BRIGHT_SCALE);
- green = green < 3 ? 3 : (int) Math.min(255, green / BRIGHT_SCALE);
- blue = blue < 3 ? 3 : (int) Math.min(255, blue / BRIGHT_SCALE);
- return new Color(red, green, blue, 255);
+ int[] hues = new int[3];
+ hues[0] = (value & RED_MASK) >> 16;
+ hues[1] = (value & GREEN_MASK) >> 8;
+ hues[2] = value & BLUE_MASK;
+
+ // (0,0,0) is a special case.
+ if (hues[0] == 0 && hues[1] == 0 && hues[2] ==0)
+ {
+ hues[0] = 3;
+ hues[1] = 3;
+ hues[2] = 3;
+ }
+ else
+ {
+ for (int index = 0; index < 3; index++)
+ {
+
+ if (hues[index] > 2)
+ hues[index] = (int) Math.min(255, hues[index]/0.7f);
+ if (hues[index] == 1 || hues[index] == 2)
+ hues[index] = 4;
+ }
+ }
+
+ return new Color(hues[0], hues[1], hues[2], 255);
}
/**
diff --git a/libjava/classpath/java/awt/Component.java b/libjava/classpath/java/awt/Component.java
index 44f277ac783..b6eadabbb5c 100644
--- a/libjava/classpath/java/awt/Component.java
+++ b/libjava/classpath/java/awt/Component.java
@@ -39,6 +39,10 @@ exception statement from your version. */
package java.awt;
+//import gnu.java.awt.dnd.peer.gtk.GtkDropTargetContextPeer;
+
+import gnu.java.awt.ComponentReshapeEvent;
+
import java.awt.dnd.DropTarget;
import java.awt.event.ActionEvent;
import java.awt.event.AdjustmentEvent;
@@ -577,7 +581,7 @@ public abstract class Component
transient ComponentPeer peer;
/** The preferred component orientation. */
- transient ComponentOrientation orientation = ComponentOrientation.UNKNOWN;
+ transient ComponentOrientation componentOrientation = ComponentOrientation.UNKNOWN;
/**
* The associated graphics configuration.
@@ -698,6 +702,9 @@ public abstract class Component
public void setDropTarget(DropTarget dt)
{
this.dropTarget = dt;
+
+ if (peer != null)
+ dropTarget.addNotify(peer);
}
/**
@@ -741,16 +748,23 @@ public abstract class Component
*/
public Toolkit getToolkit()
{
- if (peer != null)
+ // Only heavyweight peers can handle this.
+ ComponentPeer p = peer;
+ Component comp = this;
+ while (p instanceof LightweightPeer)
{
- Toolkit tk = peer.getToolkit();
- if (tk != null)
- return tk;
+ comp = comp.parent;
+ p = comp == null ? null : comp.peer;
}
- // Get toolkit for lightweight component.
- if (parent != null)
- return parent.getToolkit();
- return Toolkit.getDefaultToolkit();
+
+ Toolkit tk = null;
+ if (p != null)
+ {
+ tk = peer.getToolkit();
+ }
+ if (tk == null)
+ tk = Toolkit.getDefaultToolkit();
+ return tk;
}
/**
@@ -809,10 +823,7 @@ public abstract class Component
*/
public boolean isShowing()
{
- if (! visible || peer == null)
- return false;
-
- return parent == null ? false : parent.isShowing();
+ return visible && peer != null && (parent == null || parent.isShowing());
}
/**
@@ -959,14 +970,14 @@ public abstract class Component
// case lightweight components are not initially painted --
// Container.paint first calls isShowing () before painting itself
// and its children.
- if(!isVisible())
+ if(! visible)
{
// Need to lock the tree here to avoid races and inconsistencies.
synchronized (getTreeLock())
{
visible = true;
// Avoid NullPointerExceptions by creating a local reference.
- ComponentPeer currentPeer=peer;
+ ComponentPeer currentPeer = peer;
if (currentPeer != null)
{
currentPeer.show();
@@ -978,7 +989,7 @@ public abstract class Component
// The JDK repaints the component before invalidating the parent.
// So do we.
- if (isLightweight())
+ if (peer instanceof LightweightPeer)
repaint();
}
@@ -1025,7 +1036,7 @@ public abstract class Component
*/
public void hide()
{
- if (isVisible())
+ if (visible)
{
// Need to lock the tree here to avoid races and inconsistencies.
synchronized (getTreeLock())
@@ -1033,7 +1044,7 @@ public abstract class Component
visible = false;
// Avoid NullPointerExceptions by creating a local reference.
- ComponentPeer currentPeer=peer;
+ ComponentPeer currentPeer = peer;
if (currentPeer != null)
{
currentPeer.hide();
@@ -1168,31 +1179,80 @@ public abstract class Component
*/
public Font getFont()
{
- Font f = font;
- if (f != null)
- return f;
+ Font f;
+ synchronized (getTreeLock())
+ {
+ f = getFontImpl();
+ }
+ return f;
+ }
- Component p = parent;
- if (p != null)
- return p.getFont();
- return null;
+ /**
+ * Implementation of getFont(). This is pulled out of getFont() to prevent
+ * client programs from overriding this. This method is executed within
+ * a tree lock, so we can assume that the hierarchy doesn't change in
+ * between.
+ *
+ * @return the font of this component
+ */
+ private final Font getFontImpl()
+ {
+ Font f = font;
+ if (f == null)
+ {
+ Component p = parent;
+ if (p != null)
+ f = p.getFontImpl();
+ else
+ f = new Font("Dialog", Font.PLAIN, 12);
+ }
+ return f;
}
/**
* Sets the font for this component to the specified font. This is a bound
* property.
*
- * @param newFont the new font for this component
+ * @param f the new font for this component
*
* @see #getFont()
*/
- public void setFont(Font newFont)
+ public void setFont(Font f)
{
- Font oldFont = font;
- font = newFont;
- if (peer != null)
- peer.setFont(font);
+ Font oldFont;
+ Font newFont;
+ // Synchronize on the tree because getFontImpl() relies on the hierarchy
+ // not beeing changed.
+ synchronized (getTreeLock())
+ {
+ // Synchronize on this here to guarantee thread safety wrt to the
+ // property values.
+ synchronized (this)
+ {
+ oldFont = font;
+ font = f;
+ newFont = f;
+ }
+ // Create local variable here for thread safety.
+ ComponentPeer p = peer;
+ if (p != null)
+ {
+ // The peer receives the real font setting, which can depend on
+ // the parent font when this component's font has been set to null.
+ f = getFont();
+ if (f != null)
+ {
+ p.setFont(f);
+ peerFont = f;
+ }
+ }
+ }
+
+ // Fire property change event.
firePropertyChange("font", oldFont, newFont);
+
+ // Invalidate when necessary as font changes can change the size of the
+ // component.
if (valid)
invalidate();
}
@@ -1292,8 +1352,26 @@ public abstract class Component
// component.
synchronized (getTreeLock())
{
- // We know peer != null here.
- return peer.getLocationOnScreen();
+ // Only a heavyweight peer can answer the question for the screen
+ // location. So we are going through the hierarchy until we find
+ // one and add up the offsets while doing so.
+ int offsX = 0;
+ int offsY = 0;
+ ComponentPeer p = peer;
+ Component comp = this;
+ while (p instanceof LightweightPeer)
+ {
+ offsX += comp.x;
+ offsY += comp.y;
+ comp = comp.parent;
+ p = comp == null ? null: comp.peer;
+ }
+ // Now we have a heavyweight component.
+ assert ! (p instanceof LightweightPeer);
+ Point loc = p.getLocationOnScreen();
+ loc.x += offsX;
+ loc.y += offsY;
+ return loc;
}
}
@@ -1533,7 +1611,17 @@ public abstract class Component
}
}
- private void notifyReshape(boolean resized, boolean moved)
+ /**
+ * Sends notification to interested listeners about resizing and/or moving
+ * the component. If this component has interested
+ * component listeners or the corresponding event mask enabled, then
+ * COMPONENT_MOVED and/or COMPONENT_RESIZED events are posted to the event
+ * queue.
+ *
+ * @param resized true if the component has been resized, false otherwise
+ * @param moved true if the component has been moved, false otherwise
+ */
+ void notifyReshape(boolean resized, boolean moved)
{
// Only post an event if this component actually has a listener
// or has this event explicitly enabled.
@@ -1544,43 +1632,16 @@ public abstract class Component
if (moved)
{
ComponentEvent ce = new ComponentEvent(this,
- ComponentEvent.COMPONENT_MOVED);
+ ComponentEvent.COMPONENT_MOVED);
getToolkit().getSystemEventQueue().postEvent(ce);
}
if (resized)
{
ComponentEvent ce = new ComponentEvent(this,
- ComponentEvent.COMPONENT_RESIZED);
+ ComponentEvent.COMPONENT_RESIZED);
getToolkit().getSystemEventQueue().postEvent(ce);
}
}
- else
- {
- // Otherwise we might need to notify child components when this is
- // a Container.
- if (this instanceof Container)
- {
- Container cont = (Container) this;
- if (resized)
- {
- for (int i = 0; i < cont.getComponentCount(); i++)
- {
- Component child = cont.getComponent(i);
- child.fireHierarchyEvent(HierarchyEvent.ANCESTOR_RESIZED,
- this, parent, 0);
- }
- }
- if (moved)
- {
- for (int i = 0; i < cont.getComponentCount(); i++)
- {
- Component child = cont.getComponent(i);
- child.fireHierarchyEvent(HierarchyEvent.ANCESTOR_MOVED,
- this, parent, 0);
- }
- }
- }
- }
}
/**
@@ -2023,7 +2084,32 @@ public abstract class Component
*/
public void validate()
{
- valid = true;
+ if (! valid)
+ {
+ // Synchronize on the tree here as this might change the layout
+ // of the hierarchy.
+ synchronized (getTreeLock())
+ {
+ // Create local variables for thread safety.
+ ComponentPeer p = peer;
+ if (p != null)
+ {
+ // Possibly update the peer's font.
+ Font newFont = getFont();
+ Font oldFont = peerFont;
+ // Only update when the font really changed.
+ if (newFont != oldFont
+ && (oldFont == null || ! oldFont.equals(newFont)))
+ {
+ p.setFont(newFont);
+ peerFont = newFont;
+ }
+ // Let the peer perform any layout.
+ p.layout();
+ }
+ }
+ valid = true;
+ }
}
/**
@@ -2063,21 +2149,28 @@ public abstract class Component
*/
public Graphics getGraphics()
{
- if (peer != null)
+ // Only heavyweight peers can handle this.
+ ComponentPeer p = peer;
+ Graphics g = null;
+ if (p instanceof LightweightPeer)
{
- Graphics gfx = peer.getGraphics();
- // Create peer for lightweights.
- if (gfx == null && parent != null)
+ if (parent != null)
{
- gfx = parent.getGraphics();
- gfx.clipRect(getX(), getY(), getWidth(), getHeight());
- gfx.translate(getX(), getY());
- return gfx;
+ g = parent.getGraphics();
+ if (g != null)
+ {
+ g.translate(x, y);
+ g.setClip(0, 0, width, height);
+ g.setFont(getFont());
+ }
}
- gfx.setFont(font);
- return gfx;
}
- return null;
+ else
+ {
+ if (p != null)
+ g = p.getGraphics();
+ }
+ return g;
}
/**
@@ -2091,8 +2184,16 @@ public abstract class Component
*/
public FontMetrics getFontMetrics(Font font)
{
- return peer == null ? getToolkit().getFontMetrics(font)
- : peer.getFontMetrics(font);
+ ComponentPeer p = peer;
+ Component comp = this;
+ while (p instanceof LightweightPeer)
+ {
+ comp = comp.parent;
+ p = comp == null ? null : comp.peer;
+ }
+
+ return p == null ? getToolkit().getFontMetrics(font)
+ : p.getFontMetrics(font);
}
/**
@@ -2111,8 +2212,18 @@ public abstract class Component
public void setCursor(Cursor cursor)
{
this.cursor = cursor;
- if (peer != null)
- peer.setCursor(cursor);
+
+ // Only heavyweight peers handle this.
+ ComponentPeer p = peer;
+ Component comp = this;
+ while (p instanceof LightweightPeer)
+ {
+ comp = comp.parent;
+ p = comp == null ? null : comp.peer;
+ }
+
+ if (p != null)
+ p.setCursor(cursor);
}
/**
@@ -2190,9 +2301,14 @@ public abstract class Component
*/
public void paintAll(Graphics g)
{
- if (! visible)
- return;
- paint(g);
+ if (isShowing())
+ {
+ validate();
+ if (peer instanceof LightweightPeer)
+ paint(g);
+ else
+ peer.paint(g);
+ }
}
/**
@@ -2263,36 +2379,32 @@ public abstract class Component
// Let the nearest heavyweight parent handle repainting for lightweight
// components.
- // This goes up the hierarchy until we hit
- // a heavyweight component that handles this and translates the
- // rectangle while doing so.
-
- // We perform some boundary checking to restrict the paint
- // region to this component.
- int px = (x < 0 ? 0 : x);
- int py = (y < 0 ? 0 : y);
- int pw = width;
- int ph = height;
- Component par = this;
- while (par != null && p instanceof LightweightPeer)
+ // We need to recursivly call repaint() on the parent here, since
+ // a (lightweight) parent component might have overridden repaint()
+ // to perform additional custom tasks.
+
+ if (p instanceof LightweightPeer)
{
- px += par.x;
- py += par.y;
// We perform some boundary checking to restrict the paint
// region to this component.
- pw = Math.min(pw, par.width);
- ph = Math.min(ph, par.height);
- par = par.parent;
- p = par.peer;
+ if (parent != null)
+ {
+ int px = this.x + Math.max(0, x);
+ int py = this.y + Math.max(0, y);
+ int pw = Math.min(this.width, width);
+ int ph = Math.min(this.height, height);
+ parent.repaint(tm, px, py, pw, ph);
+ }
}
-
- // Now send an UPDATE event to the heavyweight component that we've found.
- if (par != null && par.isVisible() && p != null && pw > 0 && ph > 0)
+ else
{
- assert ! (p instanceof LightweightPeer);
- PaintEvent pe = new PaintEvent(par, PaintEvent.UPDATE,
- new Rectangle(px, py, pw, ph));
- getToolkit().getSystemEventQueue().postEvent(pe);
+ // Now send an UPDATE event to the heavyweight component that we've found.
+ if (isVisible() && p != null && width > 0 && height > 0)
+ {
+ PaintEvent pe = new PaintEvent(this, PaintEvent.UPDATE,
+ new Rectangle(x, y, width, height));
+ getToolkit().getSystemEventQueue().postEvent(pe);
+ }
}
}
@@ -2380,11 +2492,22 @@ public abstract class Component
*/
public Image createImage(ImageProducer producer)
{
+ // Only heavyweight peers can handle this.
+ ComponentPeer p = peer;
+ Component comp = this;
+ while (p instanceof LightweightPeer)
+ {
+ comp = comp.parent;
+ p = comp == null ? null : comp.peer;
+ }
+
// Sun allows producer to be null.
- if (peer != null)
- return peer.createImage(producer);
+ Image im;
+ if (p != null)
+ im = p.createImage(producer);
else
- return getToolkit().createImage(producer);
+ im = getToolkit().createImage(producer);
+ return im;
}
/**
@@ -2400,10 +2523,17 @@ public abstract class Component
Image returnValue = null;
if (!GraphicsEnvironment.isHeadless ())
{
- if (isLightweight () && parent != null)
- returnValue = parent.createImage (width, height);
- else if (peer != null)
- returnValue = peer.createImage (width, height);
+ // Only heavyweight peers can handle this.
+ ComponentPeer p = peer;
+ Component comp = this;
+ while (p instanceof LightweightPeer)
+ {
+ comp = comp.parent;
+ p = comp == null ? null : comp.peer;
+ }
+
+ if (p != null)
+ returnValue = p.createImage(width, height);
}
return returnValue;
}
@@ -2419,9 +2549,19 @@ public abstract class Component
*/
public VolatileImage createVolatileImage(int width, int height)
{
- if (peer != null)
- return peer.createVolatileImage(width, height);
- return null;
+ // Only heavyweight peers can handle this.
+ ComponentPeer p = peer;
+ Component comp = this;
+ while (p instanceof LightweightPeer)
+ {
+ comp = comp.parent;
+ p = comp == null ? null : comp.peer;
+ }
+
+ VolatileImage im = null;
+ if (p != null)
+ im = p.createVolatileImage(width, height);
+ return im;
}
/**
@@ -2440,9 +2580,19 @@ public abstract class Component
ImageCapabilities caps)
throws AWTException
{
- if (peer != null)
- return peer.createVolatileImage(width, height);
- return null;
+ // Only heavyweight peers can handle this.
+ ComponentPeer p = peer;
+ Component comp = this;
+ while (p instanceof LightweightPeer)
+ {
+ comp = comp.parent;
+ p = comp == null ? null : comp.peer;
+ }
+
+ VolatileImage im = null;
+ if (p != null)
+ im = peer.createVolatileImage(width, height);
+ return im;
}
/**
@@ -2472,10 +2622,21 @@ public abstract class Component
public boolean prepareImage(Image image, int width, int height,
ImageObserver observer)
{
- if (peer != null)
- return peer.prepareImage(image, width, height, observer);
+ // Only heavyweight peers handle this.
+ ComponentPeer p = peer;
+ Component comp = this;
+ while (p instanceof LightweightPeer)
+ {
+ comp = comp.parent;
+ p = comp == null ? null : comp.peer;
+ }
+
+ boolean retval;
+ if (p != null)
+ retval = p.prepareImage(image, width, height, observer);
else
- return getToolkit().prepareImage(image, width, height, observer);
+ retval = getToolkit().prepareImage(image, width, height, observer);
+ return retval;
}
/**
@@ -2509,9 +2670,21 @@ public abstract class Component
public int checkImage(Image image, int width, int height,
ImageObserver observer)
{
- if (peer != null)
- return peer.checkImage(image, width, height, observer);
- return getToolkit().checkImage(image, width, height, observer);
+ // Only heavyweight peers handle this.
+ ComponentPeer p = peer;
+ Component comp = this;
+ while (p instanceof LightweightPeer)
+ {
+ comp = comp.parent;
+ p = comp == null ? null : comp.peer;
+ }
+
+ int retval;
+ if (p != null)
+ retval = p.checkImage(image, width, height, observer);
+ else
+ retval = getToolkit().checkImage(image, width, height, observer);
+ return retval;
}
/**
@@ -2657,14 +2830,6 @@ public abstract class Component
*/
public final void dispatchEvent(AWTEvent e)
{
- Event oldEvent = translateEvent(e);
- if (oldEvent != null)
- postEvent (oldEvent);
-
- // Give toolkit a chance to dispatch the event
- // to globally registered listeners.
- Toolkit.getDefaultToolkit().globalDispatchEvent(e);
-
// Some subclasses in the AWT package need to override this behavior,
// hence the use of dispatchEventImpl().
dispatchEventImpl(e);
@@ -2715,9 +2880,12 @@ public abstract class Component
*/
public synchronized void addComponentListener(ComponentListener listener)
{
- componentListener = AWTEventMulticaster.add(componentListener, listener);
- if (componentListener != null)
- enableEvents(AWTEvent.COMPONENT_EVENT_MASK);
+ if (listener != null)
+ {
+ componentListener = AWTEventMulticaster.add(componentListener,
+ listener);
+ newEventsOnly = true;
+ }
}
/**
@@ -2763,9 +2931,11 @@ public abstract class Component
*/
public synchronized void addFocusListener(FocusListener listener)
{
- focusListener = AWTEventMulticaster.add(focusListener, listener);
- if (focusListener != null)
- enableEvents(AWTEvent.FOCUS_EVENT_MASK);
+ if (listener != null)
+ {
+ focusListener = AWTEventMulticaster.add(focusListener, listener);
+ newEventsOnly = true;
+ }
}
/**
@@ -2810,16 +2980,19 @@ public abstract class Component
*/
public synchronized void addHierarchyListener(HierarchyListener listener)
{
- hierarchyListener = AWTEventMulticaster.add(hierarchyListener, listener);
- if (hierarchyListener != null)
- enableEvents(AWTEvent.HIERARCHY_EVENT_MASK);
-
- // Need to lock the tree, otherwise we might end up inconsistent.
- synchronized (getTreeLock())
+ if (listener != null)
{
- numHierarchyListeners++;
- if (parent != null)
- parent.updateHierarchyListenerCount(AWTEvent.HIERARCHY_EVENT_MASK, 1);
+ hierarchyListener = AWTEventMulticaster.add(hierarchyListener,
+ listener);
+ newEventsOnly = true;
+ // Need to lock the tree, otherwise we might end up inconsistent.
+ synchronized (getTreeLock())
+ {
+ numHierarchyListeners++;
+ if (parent != null)
+ parent.updateHierarchyListenerCount(AWTEvent.HIERARCHY_EVENT_MASK,
+ 1);
+ }
}
}
@@ -2876,19 +3049,20 @@ public abstract class Component
public synchronized void
addHierarchyBoundsListener(HierarchyBoundsListener listener)
{
- hierarchyBoundsListener =
- AWTEventMulticaster.add(hierarchyBoundsListener, listener);
- if (hierarchyBoundsListener != null)
- enableEvents(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK);
-
- // Need to lock the tree, otherwise we might end up inconsistent.
- synchronized (getTreeLock())
+ if (listener != null)
{
- numHierarchyBoundsListeners++;
- if (parent != null)
- parent.updateHierarchyListenerCount
- (AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK,
- 1);
+ hierarchyBoundsListener =
+ AWTEventMulticaster.add(hierarchyBoundsListener, listener);
+ newEventsOnly = true;
+
+ // Need to lock the tree, otherwise we might end up inconsistent.
+ synchronized (getTreeLock())
+ {
+ numHierarchyBoundsListeners++;
+ if (parent != null)
+ parent.updateHierarchyListenerCount
+ (AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK, 1);
+ }
}
}
@@ -2956,7 +3130,7 @@ public abstract class Component
case HierarchyEvent.ANCESTOR_RESIZED:
enabled = hierarchyBoundsListener != null
|| (eventMask & AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) != 0;
- break;
+ break;
default:
assert false : "Should not reach here";
}
@@ -2981,9 +3155,11 @@ public abstract class Component
*/
public synchronized void addKeyListener(KeyListener listener)
{
- keyListener = AWTEventMulticaster.add(keyListener, listener);
- if (keyListener != null)
- enableEvents(AWTEvent.KEY_EVENT_MASK);
+ if (listener != null)
+ {
+ keyListener = AWTEventMulticaster.add(keyListener, listener);
+ newEventsOnly = true;
+ }
}
/**
@@ -3028,9 +3204,11 @@ public abstract class Component
*/
public synchronized void addMouseListener(MouseListener listener)
{
- mouseListener = AWTEventMulticaster.add(mouseListener, listener);
- if (mouseListener != null)
- enableEvents(AWTEvent.MOUSE_EVENT_MASK);
+ if (listener != null)
+ {
+ mouseListener = AWTEventMulticaster.add(mouseListener, listener);
+ newEventsOnly = true;
+ }
}
/**
@@ -3075,9 +3253,12 @@ public abstract class Component
*/
public synchronized void addMouseMotionListener(MouseMotionListener listener)
{
- mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, listener);
- if (mouseMotionListener != null)
- enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK);
+ if (listener != null)
+ {
+ mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener,
+ listener);
+ newEventsOnly = true;
+ }
}
/**
@@ -3124,9 +3305,12 @@ public abstract class Component
*/
public synchronized void addMouseWheelListener(MouseWheelListener listener)
{
- mouseWheelListener = AWTEventMulticaster.add(mouseWheelListener, listener);
- if (mouseWheelListener != null)
- enableEvents(AWTEvent.MOUSE_WHEEL_EVENT_MASK);
+ if (listener != null)
+ {
+ mouseWheelListener = AWTEventMulticaster.add(mouseWheelListener,
+ listener);
+ newEventsOnly = true;
+ }
}
/**
@@ -3174,9 +3358,12 @@ public abstract class Component
*/
public synchronized void addInputMethodListener(InputMethodListener listener)
{
- inputMethodListener = AWTEventMulticaster.add(inputMethodListener, listener);
- if (inputMethodListener != null)
- enableEvents(AWTEvent.INPUT_METHOD_EVENT_MASK);
+ if (listener != null)
+ {
+ inputMethodListener = AWTEventMulticaster.add(inputMethodListener,
+ listener);
+ newEventsOnly = true;
+ }
}
/**
@@ -3235,29 +3422,29 @@ public abstract class Component
* @see #getPropertyChangeListeners()
* @since 1.3
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
if (listenerType == ComponentListener.class)
- return getComponentListeners();
+ return (T[]) getComponentListeners();
if (listenerType == FocusListener.class)
- return getFocusListeners();
+ return (T[]) getFocusListeners();
if (listenerType == HierarchyListener.class)
- return getHierarchyListeners();
+ return (T[]) getHierarchyListeners();
if (listenerType == HierarchyBoundsListener.class)
- return getHierarchyBoundsListeners();
+ return (T[]) getHierarchyBoundsListeners();
if (listenerType == KeyListener.class)
- return getKeyListeners();
+ return (T[]) getKeyListeners();
if (listenerType == MouseListener.class)
- return getMouseListeners();
+ return (T[]) getMouseListeners();
if (listenerType == MouseMotionListener.class)
- return getMouseMotionListeners();
+ return (T[]) getMouseMotionListeners();
if (listenerType == MouseWheelListener.class)
- return getMouseWheelListeners();
+ return (T[]) getMouseWheelListeners();
if (listenerType == InputMethodListener.class)
- return getInputMethodListeners();
+ return (T[]) getInputMethodListeners();
if (listenerType == PropertyChangeListener.class)
- return getPropertyChangeListeners();
- return (EventListener[]) Array.newInstance(listenerType, 0);
+ return (T[]) getPropertyChangeListeners();
+ return (T[]) Array.newInstance(listenerType, 0);
}
/**
@@ -3302,18 +3489,49 @@ public abstract class Component
*/
protected final void enableEvents(long eventsToEnable)
{
+ // Update the counter for hierarchy (bounds) listeners.
+ if ((eventsToEnable & AWTEvent.HIERARCHY_EVENT_MASK) != 0
+ && (eventMask & AWTEvent.HIERARCHY_EVENT_MASK) == 0)
+ {
+ // Need to lock the tree, otherwise we might end up inconsistent.
+ synchronized (getTreeLock())
+ {
+ numHierarchyListeners++;
+ if (parent != null)
+ parent.updateHierarchyListenerCount
+ (AWTEvent.HIERARCHY_EVENT_MASK,
+ 1);
+ }
+ }
+ if ((eventsToEnable & AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) != 0
+ && (eventMask & AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) == 0)
+ {
+ // Need to lock the tree, otherwise we might end up inconsistent.
+ synchronized (getTreeLock())
+ {
+ numHierarchyBoundsListeners++;
+ if (parent != null)
+ parent.updateHierarchyListenerCount
+ (AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK,
+ 1);
+ }
+ }
+
eventMask |= eventsToEnable;
- // TODO: Unlike Sun's implementation, I think we should try and
- // enable/disable events at the peer (gtk/X) level. This will avoid
- // clogging the event pipeline with useless mousemove events that
- // we arn't interested in, etc. This will involve extending the peer
- // interface, but thats okay because the peer interfaces have been
- // deprecated for a long time, and no longer feature in the
- // API specification at all.
- if (isLightweight() && parent != null)
- parent.enableEvents(eventsToEnable);
- else if (peer != null)
- peer.setEventMask(eventMask);
+ newEventsOnly = true;
+
+ // Only heavyweight peers handle this.
+ ComponentPeer p = peer;
+ Component comp = this;
+ while (p instanceof LightweightPeer)
+ {
+ comp = comp.parent;
+ p = comp == null ? null : comp.peer;
+ }
+
+ if (p != null)
+ p.setEventMask(eventMask);
+
}
/**
@@ -3326,8 +3544,48 @@ public abstract class Component
*/
protected final void disableEvents(long eventsToDisable)
{
+ // Update the counter for hierarchy (bounds) listeners.
+ if ((eventsToDisable & AWTEvent.HIERARCHY_EVENT_MASK) != 0
+ && (eventMask & AWTEvent.HIERARCHY_EVENT_MASK) != 0)
+ {
+ // Need to lock the tree, otherwise we might end up inconsistent.
+ synchronized (getTreeLock())
+ {
+ numHierarchyListeners--;
+ if (parent != null)
+ parent.updateHierarchyListenerCount
+ (AWTEvent.HIERARCHY_EVENT_MASK,
+ -1);
+ }
+ }
+ if ((eventsToDisable & AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) != 0
+ && (eventMask & AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) != 0)
+ {
+ // Need to lock the tree, otherwise we might end up inconsistent.
+ synchronized (getTreeLock())
+ {
+ numHierarchyBoundsListeners--;
+ if (parent != null)
+ parent.updateHierarchyListenerCount
+ (AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK,
+ -1);
+ }
+ }
+
eventMask &= ~eventsToDisable;
- // forward new event mask to peer?
+
+ // Only heavyweight peers handle this.
+ ComponentPeer p = peer;
+ Component comp = this;
+ while (p instanceof LightweightPeer)
+ {
+ comp = comp.parent;
+ p = comp == null ? null : comp.peer;
+ }
+
+ if (p != null)
+ p.setEventMask(eventMask);
+
}
/**
@@ -3343,19 +3601,42 @@ public abstract class Component
*/
protected AWTEvent coalesceEvents(AWTEvent existingEvent, AWTEvent newEvent)
{
+ AWTEvent coalesced = null;
switch (existingEvent.id)
{
case MouseEvent.MOUSE_MOVED:
case MouseEvent.MOUSE_DRAGGED:
// Just drop the old (intermediate) event and return the new one.
- return newEvent;
+ MouseEvent me1 = (MouseEvent) existingEvent;
+ MouseEvent me2 = (MouseEvent) newEvent;
+ if (me1.getModifiers() == me2.getModifiers())
+ coalesced = newEvent;
+ break;
case PaintEvent.PAINT:
case PaintEvent.UPDATE:
- return coalescePaintEvents((PaintEvent) existingEvent,
- (PaintEvent) newEvent);
+ // For heavyweights the EventQueue should ask the peer.
+ if (peer == null || peer instanceof LightweightPeer)
+ {
+ PaintEvent pe1 = (PaintEvent) existingEvent;
+ PaintEvent pe2 = (PaintEvent) newEvent;
+ Rectangle r1 = pe1.getUpdateRect();
+ Rectangle r2 = pe2.getUpdateRect();
+ if (r1.contains(r2))
+ coalesced = existingEvent;
+ else if (r2.contains(r1))
+ coalesced = newEvent;
+ }
+ else
+ {
+ // Replace the event and let the heavyweight figure out the expanding
+ // of the repaint area.
+ coalesced = newEvent;
+ }
+ break;
default:
- return null;
+ coalesced = null;
}
+ return coalesced;
}
/**
@@ -3877,16 +4158,29 @@ public abstract class Component
peer = getToolkit().createComponent(this);
else if (parent != null && parent.isLightweight())
new HeavyweightInLightweightListener(parent);
- /* Now that all the children has gotten their peers, we should
- have the event mask needed for this component and its
- lightweight subcomponents. */
+ // Now that all the children has gotten their peers, we should
+ // have the event mask needed for this component and its
+ //lightweight subcomponents.
peer.setEventMask(eventMask);
- /* We do not invalidate here, but rather leave that job up to
- the peer. For efficiency, the peer can choose not to
- invalidate if it is happy with the current dimensions,
- etc. */
- if (dropTarget != null)
- dropTarget.addNotify(peer);
+
+ // We used to leave the invalidate() to the peer. However, I put it
+ // back here for 2 reasons: 1) The RI does call invalidate() from
+ // addNotify(); 2) The peer shouldn't be bother with validation too
+ // much.
+ invalidate();
+
+ if (dropTarget != null)
+ dropTarget.addNotify(peer);
+
+ // Fetch the peerFont for later installation in validate().
+ peerFont = getFont();
+
+ // Notify hierarchy listeners.
+ long flags = HierarchyEvent.DISPLAYABILITY_CHANGED;
+ if (isHierarchyVisible())
+ flags |= HierarchyEvent.SHOWING_CHANGED;
+ fireHierarchyEvent(HierarchyEvent.HIERARCHY_CHANGED, this, parent,
+ flags);
}
}
@@ -3911,11 +4205,19 @@ public abstract class Component
ComponentPeer tmp = peer;
peer = null;
+ peerFont = null;
if (tmp != null)
{
tmp.hide();
tmp.dispose();
}
+
+ // Notify hierarchy listeners.
+ long flags = HierarchyEvent.DISPLAYABILITY_CHANGED;
+ if (isHierarchyVisible())
+ flags |= HierarchyEvent.SHOWING_CHANGED;
+ fireHierarchyEvent(HierarchyEvent.HIERARCHY_CHANGED, this, parent,
+ flags);
}
}
@@ -4034,7 +4336,8 @@ public abstract class Component
* @see KeyboardFocusManager#UP_CYCLE_TRAVERSAL_KEYS
* @since 1.4
*/
- public void setFocusTraversalKeys(int id, Set keystrokes)
+ public void setFocusTraversalKeys(int id,
+ Set<? extends AWTKeyStroke> keystrokes)
{
if (keystrokes == null)
{
@@ -4126,14 +4429,14 @@ public abstract class Component
*
* @since 1.4
*/
- public Set getFocusTraversalKeys (int id)
+ public Set<AWTKeyStroke> getFocusTraversalKeys (int id)
{
if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS)
throw new IllegalArgumentException();
- Set s = null;
+ Set<AWTKeyStroke> s = null;
if (focusTraversalKeys != null)
s = focusTraversalKeys[id];
@@ -5060,8 +5363,8 @@ p * <li>the set of backward traversal keys
public void setComponentOrientation(ComponentOrientation o)
{
- ComponentOrientation oldOrientation = orientation;
- orientation = o;
+ ComponentOrientation oldOrientation = componentOrientation;
+ componentOrientation = o;
firePropertyChange("componentOrientation", oldOrientation, o);
}
@@ -5073,7 +5376,7 @@ p * <li>the set of backward traversal keys
*/
public ComponentOrientation getComponentOrientation()
{
- return orientation;
+ return componentOrientation;
}
/**
@@ -5358,7 +5661,7 @@ p * <li>the set of backward traversal keys
oldKey = Event.UP;
break;
default:
- oldKey = (int) ((KeyEvent) e).getKeyChar();
+ oldKey = ((KeyEvent) e).getKeyChar();
}
translated = new Event (target, when, oldID,
@@ -5401,9 +5704,23 @@ p * <li>the set of backward traversal keys
*
* @param e the event to dispatch
*/
-
void dispatchEventImpl(AWTEvent e)
{
+ // Update the component's knowledge about the size.
+ // Important: Please look at the big comment in ComponentReshapeEvent
+ // to learn why we did it this way. If you change this code, make
+ // sure that the peer->AWT bounds update still works.
+ // (for instance: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29448 )
+ if (e instanceof ComponentReshapeEvent)
+ {
+ ComponentReshapeEvent reshape = (ComponentReshapeEvent) e;
+ x = reshape.x;
+ y = reshape.y;
+ width = reshape.width;
+ height = reshape.height;
+ return;
+ }
+
// Retarget focus events before dispatching it to the KeyboardFocusManager
// in order to handle lightweight components properly.
boolean dispatched = false;
@@ -5416,11 +5733,21 @@ p * <li>the set of backward traversal keys
if (! dispatched)
{
- if (eventTypeEnabled (e.id))
+ // Give toolkit a chance to dispatch the event
+ // to globally registered listeners.
+ Toolkit.getDefaultToolkit().globalDispatchEvent(e);
+
+ if (newEventsOnly)
{
- if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE)
+ if (eventTypeEnabled(e.id))
processEvent(e);
}
+ else
+ {
+ Event oldEvent = translateEvent(e);
+ if (oldEvent != null)
+ postEvent (oldEvent);
+ }
if (peer != null)
peer.handleEvent(e);
}
@@ -5493,42 +5820,23 @@ p * <li>the set of backward traversal keys
}
/**
- * Coalesce paint events. Current heuristic is: Merge if the union of
- * areas is less than twice that of the sum of the areas. The X server
- * tend to create a lot of paint events that are adjacent but not
- * overlapping.
- *
- * <pre>
- * +------+
- * | +-----+ ...will be merged
- * | | |
- * | | |
- * +------+ |
- * +-----+
+ * Returns <code>true</code> when this component and all of its ancestors
+ * are visible, <code>false</code> otherwise.
*
- * +---------------+--+
- * | | | ...will not be merged
- * +---------------+ |
- * | |
- * | |
- * | |
- * | |
- * | |
- * +--+
- * </pre>
- *
- * @param queuedEvent the first paint event
- * @param newEvent the second paint event
- * @return the combined paint event, or null
+ * @return <code>true</code> when this component and all of its ancestors
+ * are visible, <code>false</code> otherwise
*/
- private PaintEvent coalescePaintEvents(PaintEvent queuedEvent,
- PaintEvent newEvent)
+ boolean isHierarchyVisible()
{
- Rectangle r1 = queuedEvent.getUpdateRect();
- Rectangle r2 = newEvent.getUpdateRect();
- Rectangle union = r1.union(r2);
- newEvent.setUpdateRect(union);
- return newEvent;
+ boolean visible = isVisible();
+ Component comp = parent;
+ while (comp != null && visible)
+ {
+ comp = comp.parent;
+ if (comp != null)
+ visible = visible && comp.isVisible();
+ }
+ return visible;
}
/**
@@ -5671,7 +5979,7 @@ p * <li>the set of backward traversal keys
*/
public void componentHidden(ComponentEvent event)
{
- if (!isShowing())
+ if (isShowing())
peer.hide();
}
}
diff --git a/libjava/classpath/java/awt/Container.java b/libjava/classpath/java/awt/Container.java
index 409d164a13c..83d9f7b78c5 100644
--- a/libjava/classpath/java/awt/Container.java
+++ b/libjava/classpath/java/awt/Container.java
@@ -39,11 +39,11 @@ exception statement from your version. */
package java.awt;
-import java.awt.event.ComponentListener;
import java.awt.event.ContainerEvent;
import java.awt.event.ContainerListener;
import java.awt.event.HierarchyEvent;
import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
import java.awt.peer.ComponentPeer;
import java.awt.peer.ContainerPeer;
import java.awt.peer.LightweightPeer;
@@ -69,10 +69,11 @@ import javax.accessibility.Accessible;
*
* @author original author unknown
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*
* @since 1.0
*
- * @status still missing 1.4 support
+ * @status still missing 1.4 support, some generics from 1.5
*/
public class Container extends Component
{
@@ -86,8 +87,6 @@ public class Container extends Component
Component[] component;
LayoutManager layoutMgr;
- Dimension maxSize;
-
/**
* @since 1.4
*/
@@ -208,10 +207,12 @@ public class Container extends Component
*/
public Insets insets()
{
- if (peer == null)
- return new Insets (0, 0, 0, 0);
-
- return ((ContainerPeer) peer).getInsets ();
+ Insets i;
+ if (peer == null || peer instanceof LightweightPeer)
+ i = new Insets (0, 0, 0, 0);
+ else
+ i = ((ContainerPeer) peer).getInsets ();
+ return i;
}
/**
@@ -324,23 +325,6 @@ public class Container extends Component
// we are.
if (comp.parent != null)
comp.parent.remove(comp);
- comp.parent = this;
-
- if (peer != null)
- {
- // Notify the component that it has a new parent.
- comp.addNotify();
-
- if (comp.isLightweight ())
- {
- enableEvents (comp.eventMask);
- if (!isLightweight ())
- enableEvents (AWTEvent.PAINT_EVENT_MASK);
- }
- }
-
- // Invalidate the layout of the added component and its ancestors.
- comp.invalidate();
if (component == null)
component = new Component[4]; // FIXME, better initial size?
@@ -365,6 +349,9 @@ public class Container extends Component
++ncomponents;
}
+ // Give the new component a parent.
+ comp.parent = this;
+
// Update the counter for Hierarchy(Bounds)Listeners.
int childHierarchyListeners = comp.numHierarchyListeners;
if (childHierarchyListeners > 0)
@@ -375,6 +362,18 @@ public class Container extends Component
updateHierarchyListenerCount(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK,
childHierarchyListeners);
+ // Invalidate the layout of this container.
+ if (valid)
+ invalidate();
+
+ // Create the peer _after_ the component has been added, so that
+ // the peer gets to know about the component hierarchy.
+ if (peer != null)
+ {
+ // Notify the component that it has a new parent.
+ comp.addNotify();
+ }
+
// Notify the layout manager.
if (layoutMgr != null)
{
@@ -394,13 +393,15 @@ public class Container extends Component
// We previously only sent an event when this container is showing.
// Also, the event was posted to the event queue. A Mauve test shows
// that this event is not delivered using the event queue and it is
- // also sent when the container is not showing.
- ContainerEvent ce = new ContainerEvent(this,
- ContainerEvent.COMPONENT_ADDED,
- comp);
- ContainerListener[] listeners = getContainerListeners();
- for (int i = 0; i < listeners.length; i++)
- listeners[i].componentAdded(ce);
+ // also sent when the container is not showing.
+ if (containerListener != null
+ || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0)
+ {
+ ContainerEvent ce = new ContainerEvent(this,
+ ContainerEvent.COMPONENT_ADDED,
+ comp);
+ dispatchEvent(ce);
+ }
// Notify hierarchy listeners.
comp.fireHierarchyEvent(HierarchyEvent.HIERARCHY_CHANGED, comp,
@@ -417,17 +418,15 @@ public class Container extends Component
{
synchronized (getTreeLock ())
{
- Component r = component[index];
+ if (index < 0 || index >= ncomponents)
+ throw new ArrayIndexOutOfBoundsException();
- ComponentListener[] list = r.getComponentListeners();
- for (int j = 0; j < list.length; j++)
- r.removeComponentListener(list[j]);
-
- r.removeNotify();
+ Component r = component[index];
+ if (peer != null)
+ r.removeNotify();
- System.arraycopy(component, index + 1, component, index,
- ncomponents - index - 1);
- component[--ncomponents] = null;
+ if (layoutMgr != null)
+ layoutMgr.removeLayoutComponent(r);
// Update the counter for Hierarchy(Bounds)Listeners.
int childHierarchyListeners = r.numHierarchyListeners;
@@ -439,20 +438,23 @@ public class Container extends Component
updateHierarchyListenerCount(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK,
-childHierarchyListeners);
- invalidate();
+ r.parent = null;
- if (layoutMgr != null)
- layoutMgr.removeLayoutComponent(r);
+ System.arraycopy(component, index + 1, component, index,
+ ncomponents - index - 1);
+ component[--ncomponents] = null;
- r.parent = null;
+ if (valid)
+ invalidate();
- if (isShowing ())
+ if (containerListener != null
+ || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0)
{
// Post event to notify of removing the component.
ContainerEvent ce = new ContainerEvent(this,
- ContainerEvent.COMPONENT_REMOVED,
- r);
- getToolkit().getSystemEventQueue().postEvent(ce);
+ ContainerEvent.COMPONENT_REMOVED,
+ r);
+ dispatchEvent(ce);
}
// Notify hierarchy listeners.
@@ -496,36 +498,51 @@ public class Container extends Component
// super.removeAll() ).
// By doing it this way, user code cannot prevent the correct
// removal of components.
- for ( int index = 0; index < ncomponents; index++)
+ while (ncomponents > 0)
{
- Component r = component[index];
+ ncomponents--;
+ Component r = component[ncomponents];
+ component[ncomponents] = null;
- ComponentListener[] list = r.getComponentListeners();
- for (int j = 0; j < list.length; j++)
- r.removeComponentListener(list[j]);
-
- r.removeNotify();
+ if (peer != null)
+ r.removeNotify();
if (layoutMgr != null)
layoutMgr.removeLayoutComponent(r);
r.parent = null;
- if (isShowing ())
+ // Send ContainerEvent if necessary.
+ if (containerListener != null
+ || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0)
{
// Post event to notify of removing the component.
ContainerEvent ce
= new ContainerEvent(this,
ContainerEvent.COMPONENT_REMOVED,
r);
-
- getToolkit().getSystemEventQueue().postEvent(ce);
+ dispatchEvent(ce);
}
- }
-
+
+ // Update the counter for Hierarchy(Bounds)Listeners.
+ int childHierarchyListeners = r.numHierarchyListeners;
+ if (childHierarchyListeners > 0)
+ updateHierarchyListenerCount(AWTEvent.HIERARCHY_EVENT_MASK,
+ -childHierarchyListeners);
+ int childHierarchyBoundsListeners = r.numHierarchyBoundsListeners;
+ if (childHierarchyBoundsListeners > 0)
+ updateHierarchyListenerCount(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK,
+ -childHierarchyListeners);
+
+
+ // Send HierarchyEvent if necessary.
+ fireHierarchyEvent(HierarchyEvent.HIERARCHY_CHANGED, r, this,
+ HierarchyEvent.PARENT_CHANGED);
+
+ }
+
+ if (valid)
invalidate();
-
- ncomponents = 0;
}
}
@@ -590,11 +607,20 @@ public class Container extends Component
*/
public void validate()
{
- synchronized (getTreeLock ())
+ ComponentPeer p = peer;
+ if (! valid && p != null)
{
- if (! isValid() && peer != null)
+ ContainerPeer cPeer = null;
+ if (p instanceof ContainerPeer)
+ cPeer = (ContainerPeer) peer;
+ synchronized (getTreeLock ())
{
+ if (cPeer != null)
+ cPeer.beginValidate();
validateTree();
+ valid = true;
+ if (cPeer != null)
+ cPeer.endValidate();
}
}
}
@@ -602,24 +628,20 @@ public class Container extends Component
/**
* Recursively invalidates the container tree.
*/
- void invalidateTree()
+ private final void invalidateTree()
{
synchronized (getTreeLock())
{
- super.invalidate(); // Clean cached layout state.
for (int i = 0; i < ncomponents; i++)
{
Component comp = component[i];
- comp.invalidate();
if (comp instanceof Container)
((Container) comp).invalidateTree();
+ else if (comp.valid)
+ comp.invalidate();
}
-
- if (layoutMgr != null && layoutMgr instanceof LayoutManager2)
- {
- LayoutManager2 lm2 = (LayoutManager2) layoutMgr;
- lm2.invalidateLayout(this);
- }
+ if (valid)
+ invalidate();
}
}
@@ -629,40 +651,36 @@ public class Container extends Component
*/
protected void validateTree()
{
- if (valid)
- return;
-
- ContainerPeer cPeer = null;
- if (peer != null && ! (peer instanceof LightweightPeer))
+ if (!valid)
{
- cPeer = (ContainerPeer) peer;
- cPeer.beginValidate();
- }
-
- for (int i = 0; i < ncomponents; ++i)
- {
- Component comp = component[i];
-
- if (comp.getPeer () == null)
- comp.addNotify();
- }
-
- doLayout ();
- for (int i = 0; i < ncomponents; ++i)
- {
- Component comp = component[i];
+ ContainerPeer cPeer = null;
+ if (peer instanceof ContainerPeer)
+ {
+ cPeer = (ContainerPeer) peer;
+ cPeer.beginLayout();
+ }
- if (! comp.isValid())
+ doLayout ();
+ for (int i = 0; i < ncomponents; ++i)
{
- if (comp instanceof Container)
+ Component comp = component[i];
+
+ if (comp instanceof Container && ! (comp instanceof Window)
+ && ! comp.valid)
{
((Container) comp).validateTree();
}
else
{
- component[i].validate();
+ comp.validate();
}
}
+
+ if (cPeer != null)
+ {
+ cPeer = (ContainerPeer) peer;
+ cPeer.endLayout();
+ }
}
/* children will call invalidate() when they are layed out. It
@@ -670,19 +688,15 @@ public class Container extends Component
until after the children have been layed out. */
valid = true;
- if (cPeer != null)
- cPeer.endValidate();
}
public void setFont(Font f)
{
- if( (f != null && (font == null || !font.equals(f)))
- || f == null)
+ Font oldFont = getFont();
+ super.setFont(f);
+ Font newFont = getFont();
+ if (newFont != oldFont && (oldFont == null || ! oldFont.equals(newFont)))
{
- super.setFont(f);
- // FIXME: Although it might make more sense to invalidate only
- // those children whose font == null, Sun invalidates all children.
- // So we'll do the same.
invalidateTree();
}
}
@@ -784,8 +798,9 @@ public class Container extends Component
LayoutManager l = layoutMgr;
if (l instanceof LayoutManager2)
maxSize = ((LayoutManager2) l).maximumLayoutSize(this);
- else
+ else {
maxSize = super.maximumSizeImpl();
+ }
size = maxSize;
}
}
@@ -920,8 +935,8 @@ public class Container extends Component
*/
public void paintComponents(Graphics g)
{
- paint(g);
- visitChildren(g, GfxPaintAllVisitor.INSTANCE, true);
+ if (isShowing())
+ visitChildren(g, GfxPaintAllVisitor.INSTANCE, false);
}
/**
@@ -943,7 +958,12 @@ public class Container extends Component
*/
public synchronized void addContainerListener(ContainerListener listener)
{
- containerListener = AWTEventMulticaster.add(containerListener, listener);
+ if (listener != null)
+ {
+ containerListener = AWTEventMulticaster.add(containerListener,
+ listener);
+ newEventsOnly = true;
+ }
}
/**
@@ -985,10 +1005,10 @@ public class Container extends Component
*
* @since 1.3
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
if (listenerType == ContainerListener.class)
- return getContainerListeners();
+ return (T[]) getContainerListeners();
return super.getListeners(listenerType);
}
@@ -1247,8 +1267,14 @@ public class Container extends Component
{
synchronized (getTreeLock ())
{
- for (int i = 0; i < ncomponents; ++i)
- component[i].removeNotify();
+ int ncomps = ncomponents;
+ Component[] comps = component;
+ for (int i = ncomps - 1; i >= 0; --i)
+ {
+ Component comp = comps[i];
+ if (comp != null)
+ comp.removeNotify();
+ }
super.removeNotify();
}
}
@@ -1345,7 +1371,8 @@ public class Container extends Component
*
* @since 1.4
*/
- public void setFocusTraversalKeys(int id, Set keystrokes)
+ public void setFocusTraversalKeys(int id,
+ Set<? extends AWTKeyStroke> keystrokes)
{
if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
@@ -1433,7 +1460,8 @@ public class Container extends Component
if (focusTraversalKeys == null)
focusTraversalKeys = new Set[4];
- keystrokes = Collections.unmodifiableSet (new HashSet (keystrokes));
+ keystrokes =
+ Collections.unmodifiableSet(new HashSet<AWTKeyStroke>(keystrokes));
firePropertyChange (name, focusTraversalKeys[id], keystrokes);
focusTraversalKeys[id] = keystrokes;
@@ -1451,7 +1479,7 @@ public class Container extends Component
*
* @since 1.4
*/
- public Set getFocusTraversalKeys (int id)
+ public Set<AWTKeyStroke> getFocusTraversalKeys (int id)
{
if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
@@ -1866,6 +1894,7 @@ public class Container extends Component
bounds.height);
try
{
+ g2.setFont(comp.getFont());
visitor.visit(comp, g2);
}
finally
@@ -1874,20 +1903,40 @@ public class Container extends Component
}
}
+ /**
+ * Overridden to dispatch events to lightweight descendents.
+ *
+ * @param e the event to dispatch.
+ */
void dispatchEventImpl(AWTEvent e)
{
- boolean dispatched =
- LightweightDispatcher.getInstance().dispatchEvent(e);
- if (! dispatched)
+ LightweightDispatcher dispatcher = LightweightDispatcher.getInstance();
+ if (! isLightweight() && dispatcher.dispatchEvent(e))
{
- if ((e.id <= ContainerEvent.CONTAINER_LAST
- && e.id >= ContainerEvent.CONTAINER_FIRST)
- && (containerListener != null
- || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0))
- processEvent(e);
- else
- super.dispatchEventImpl(e);
+ // Some lightweight descendent got this event dispatched. Consume
+ // it and let the peer handle it.
+ e.consume();
+ ComponentPeer p = peer;
+ if (p != null)
+ p.handleEvent(e);
}
+ else
+ {
+ super.dispatchEventImpl(e);
+ }
+ }
+
+ /**
+ * This is called by the lightweight dispatcher to avoid recursivly
+ * calling into the lightweight dispatcher.
+ *
+ * @param e the event to dispatch
+ *
+ * @see LightweightDispatcher#redispatch(MouseEvent, Component, int)
+ */
+ void dispatchNoLightweight(AWTEvent e)
+ {
+ super.dispatchEventImpl(e);
}
/**
@@ -2004,6 +2053,43 @@ public class Container extends Component
parent.updateHierarchyListenerCount(type, delta);
}
+ /**
+ * Notifies interested listeners about resizing or moving the container.
+ * This performs the super behaviour (sending component events) and
+ * additionally notifies any hierarchy bounds listeners on child components.
+ *
+ * @param resized true if the component has been resized, false otherwise
+ * @param moved true if the component has been moved, false otherwise
+ */
+ void notifyReshape(boolean resized, boolean moved)
+ {
+ // Notify component listeners.
+ super.notifyReshape(resized, moved);
+
+ if (ncomponents > 0)
+ {
+ // Notify hierarchy bounds listeners.
+ if (resized)
+ {
+ for (int i = 0; i < getComponentCount(); i++)
+ {
+ Component child = getComponent(i);
+ child.fireHierarchyEvent(HierarchyEvent.ANCESTOR_RESIZED,
+ this, parent, 0);
+ }
+ }
+ if (moved)
+ {
+ for (int i = 0; i < getComponentCount(); i++)
+ {
+ Component child = getComponent(i);
+ child.fireHierarchyEvent(HierarchyEvent.ANCESTOR_MOVED,
+ this, parent, 0);
+ }
+ }
+ }
+ }
+
private void addNotifyContainerChildren()
{
synchronized (getTreeLock ())
@@ -2011,12 +2097,6 @@ public class Container extends Component
for (int i = ncomponents; --i >= 0; )
{
component[i].addNotify();
- if (component[i].isLightweight ())
- {
- enableEvents(component[i].eventMask);
- if (peer != null && !isLightweight ())
- enableEvents (AWTEvent.PAINT_EVENT_MASK);
- }
}
}
}
diff --git a/libjava/classpath/java/awt/Dialog.java b/libjava/classpath/java/awt/Dialog.java
index 55c3371e622..7df2f523c86 100644
--- a/libjava/classpath/java/awt/Dialog.java
+++ b/libjava/classpath/java/awt/Dialog.java
@@ -97,6 +97,11 @@ public class Dialog extends Window
private EventQueue eq2 = null;
/**
+ * The number used to generate the name returned by getName.
+ */
+ private static transient long next_dialog_number;
+
+ /**
* Initializes a new instance of <code>Dialog</code> with the specified
* parent, that is resizable and not modal, and which has no title.
*
@@ -190,6 +195,7 @@ public class Dialog extends Window
visible = false;
setLayout(new BorderLayout());
+ setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
/**
@@ -273,6 +279,7 @@ public class Dialog extends Window
visible = false;
setLayout(new BorderLayout());
+ setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
/**
@@ -530,5 +537,19 @@ public class Dialog extends Window
accessibleContext = new AccessibleAWTDialog();
return accessibleContext;
}
+
+ /**
+ * Generate a unique name for this <code>Dialog</code>.
+ *
+ * @return A unique name for this <code>Dialog</code>.
+ */
+ String generateName()
+ {
+ return "dialog" + getUniqueLong();
+ }
+ private static synchronized long getUniqueLong()
+ {
+ return next_dialog_number++;
+ }
}
diff --git a/libjava/classpath/java/awt/EventQueue.java b/libjava/classpath/java/awt/EventQueue.java
index 235ad2ac17c..74dbd5fb67d 100644
--- a/libjava/classpath/java/awt/EventQueue.java
+++ b/libjava/classpath/java/awt/EventQueue.java
@@ -38,10 +38,16 @@ exception statement from your version. */
package java.awt;
+import gnu.java.awt.LowPriorityEvent;
+import gnu.java.awt.peer.NativeEventLoopRunningEvent;
+
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
import java.awt.event.InputMethodEvent;
import java.awt.event.InvocationEvent;
+import java.awt.event.PaintEvent;
+import java.awt.peer.ComponentPeer;
+import java.awt.peer.LightweightPeer;
import java.lang.reflect.InvocationTargetException;
import java.util.EmptyStackException;
@@ -61,11 +67,47 @@ import java.util.EmptyStackException;
*/
public class EventQueue
{
- private static final int INITIAL_QUEUE_DEPTH = 8;
- private AWTEvent[] queue = new AWTEvent[INITIAL_QUEUE_DEPTH];
+ /**
+ * Indicates events that are processed with normal priority. This is normally
+ * all events except PaintEvents.
+ */
+ private static final int NORM_PRIORITY = 0;
+
+ /**
+ * Indicates events that are processed with lowes priority. This is normally
+ * all PaintEvents and LowPriorityEvents.
+ */
+ private static final int LOW_PRIORITY = 1;
- private int next_in = 0; // Index where next event will be added to queue
- private int next_out = 0; // Index of next event to be removed from queue
+ /**
+ * Implements the actual queue. EventQueue has 2 internal queues for
+ * different priorities:
+ * 1 PaintEvents are always dispatched with low priority.
+ * 2. All other events are dispatched with normal priority.
+ *
+ * This makes sure that the actual painting (output) is performed _after_ all
+ * available input has been processed and that the paint regions are
+ * coalesced as much as possible.
+ */
+ private class Queue
+ {
+ /**
+ * The first item in the queue. This is where events are popped from.
+ */
+ AWTEvent queueHead;
+
+ /**
+ * The last item. This is where events are posted to.
+ */
+ AWTEvent queueTail;
+ }
+
+ /**
+ * The three internal event queues.
+ *
+ * @see Queue
+ */
+ private Queue[] queues;
private EventQueue next;
private EventQueue prev;
@@ -73,31 +115,25 @@ public class EventQueue
private long lastWhen = System.currentTimeMillis();
private EventDispatchThread dispatchThread = new EventDispatchThread(this);
- private boolean shutdown = false;
-
- synchronized private void setShutdown (boolean b)
- {
- shutdown = b;
- }
+ private boolean nativeLoopRunning = false;
- synchronized boolean isShutdown ()
+ private boolean isShutdown ()
{
- if (shutdown)
- return true;
-
// This is the exact self-shutdown condition specified in J2SE:
// http://java.sun.com/j2se/1.4.2/docs/api/java/awt/doc-files/AWTThreadIssues.html
-
- // FIXME: check somewhere that the native queue is empty
- if (peekEvent() == null)
- {
- Frame[] frames = Frame.getFrames();
- for (int i = 0; i < frames.length; ++i)
- if (frames[i].isDisplayable())
- return false;
- return true;
- }
- return false;
+
+ if (nativeLoopRunning)
+ return false;
+
+ if (peekEvent() != null)
+ return false;
+
+ Frame[] frames = Frame.getFrames();
+ for (int i = 0; i < frames.length; ++i)
+ if (frames[i].isDisplayable())
+ return false;
+
+ return true;
}
/**
@@ -105,6 +141,9 @@ public class EventQueue
*/
public EventQueue()
{
+ queues = new Queue[2];
+ queues[NORM_PRIORITY] = new Queue();
+ queues[LOW_PRIORITY] = new Queue();
}
/**
@@ -122,31 +161,67 @@ public class EventQueue
if (next != null)
return next.getNextEvent();
- while (next_in == next_out)
- {
- // We are not allowed to return null from this method, yet it
- // is possible that we actually have run out of native events
- // in the enclosing while() loop, and none of the native events
- // happened to cause AWT events. We therefore ought to check
- // the isShutdown() condition here, before risking a "native
- // wait". If we check it before entering this function we may
- // wait forever for events after the shutdown condition has
- // arisen.
+ AWTEvent res = getNextEventImpl(true);
+ while (res == null)
+ {
if (isShutdown())
- throw new InterruptedException();
+ {
+ // Explicitly set dispathThread to null. If we don't do
+ // this, there is a race condition where dispatchThread
+ // can be != null even after the event dispatch thread has
+ // stopped running. If that happens, then the
+ // dispatchThread == null check in postEventImpl will
+ // fail, and a new event dispatch thread will not be
+ // created, leaving invokeAndWaits waiting indefinitely.
+ dispatchThread = null;
+
+ // Interrupt the event dispatch thread.
+ throw new InterruptedException();
+ }
wait();
+ res = getNextEventImpl(true);
}
- AWTEvent res = queue[next_out];
-
- if (++next_out == queue.length)
- next_out = 0;
return res;
}
/**
+ * Fetches and possibly removes the next event from the internal queues.
+ * This method returns immediately. When all queues are empty, this returns
+ * <code>null</code>:
+ *
+ * @param remove <true> when the event should be removed from the queue,
+ * <code>false</code> otherwise
+ *
+ * @return the next event or <code>null</code> when all internal queues
+ * are empty
+ */
+ private AWTEvent getNextEventImpl(boolean remove)
+ {
+ AWTEvent next = null;
+ for (int i = 0; i < queues.length && next == null; i++)
+ {
+ Queue q = queues[i];
+ if (q.queueHead != null)
+ {
+ // Got an event, remove it.
+ next = q.queueHead;
+ if (remove)
+ {
+ // Unlink event from the queue.
+ q.queueHead = next.queueNext;
+ if (q.queueHead == null)
+ q.queueTail = null;
+ next.queueNext = null;
+ }
+ }
+ }
+ return next;
+ }
+
+ /**
* Returns the next event in the queue without removing it from the queue.
* This method will block until an event is available or until the thread
* is interrupted.
@@ -160,10 +235,7 @@ public class EventQueue
if (next != null)
return next.peekEvent();
- if (next_in != next_out)
- return queue[next_out];
- else
- return null;
+ return getNextEventImpl(false);
}
/**
@@ -184,14 +256,18 @@ public class EventQueue
if (next != null)
return next.peekEvent(id);
- int i = next_out;
- while (i != next_in)
+ AWTEvent evt = null;
+ for (int i = 0; i < queues.length && evt == null; i++)
{
- AWTEvent qevt = queue[i];
- if (qevt.id == id)
- return qevt;
+ Queue q = queues[i];
+ evt = q.queueHead;
+ while (evt != null && evt.id != id)
+ evt = evt.queueNext;
+ // At this point we either have found an event (evt != null -> exit
+ // for loop), or we have found no event (evt == null -> search next
+ // internal queue).
}
- return null;
+ return evt;
}
/**
@@ -201,7 +277,42 @@ public class EventQueue
*
* @exception NullPointerException If event is null.
*/
- public synchronized void postEvent(AWTEvent evt)
+ public void postEvent(AWTEvent evt)
+ {
+ postEventImpl(evt);
+ }
+
+ /**
+ * Sorts events to their priority and calls
+ * {@link #postEventImpl(AWTEvent, int)}.
+ *
+ * @param evt the event to post
+ */
+ private synchronized final void postEventImpl(AWTEvent evt)
+ {
+ int priority = NORM_PRIORITY;
+ if (evt instanceof PaintEvent || evt instanceof LowPriorityEvent)
+ priority = LOW_PRIORITY;
+ // TODO: Maybe let Swing RepaintManager events also be processed with
+ // low priority.
+ if (evt instanceof NativeEventLoopRunningEvent)
+ {
+ nativeLoopRunning = ((NativeEventLoopRunningEvent) evt).isRunning();
+ notify();
+ return;
+ }
+ postEventImpl(evt, priority);
+ }
+
+ /**
+ * Actually performs the event posting. This is needed because the
+ * RI doesn't use the public postEvent() method when transferring events
+ * between event queues in push() and pop().
+ *
+ * @param evt the event to post
+ * @param priority the priority of the event
+ */
+ private final void postEventImpl(AWTEvent evt, int priority)
{
if (evt == null)
throw new NullPointerException();
@@ -212,52 +323,71 @@ public class EventQueue
return;
}
- /* Check for any events already on the queue with the same source
- and ID. */
- int i = next_out;
- while (i != next_in)
+ Object source = evt.getSource();
+
+ Queue q = queues[priority];
+ if (source instanceof Component)
{
- AWTEvent qevt = queue[i];
- Object src;
- if (qevt.id == evt.id
- && (src = qevt.getSource()) == evt.getSource()
- && src instanceof Component)
+ // For PaintEvents, ask the ComponentPeer to coalesce the event
+ // when the component is heavyweight.
+ Component comp = (Component) source;
+ ComponentPeer peer = comp.peer;
+ if (peer != null && evt instanceof PaintEvent
+ && ! (peer instanceof LightweightPeer))
+ peer.coalescePaintEvent((PaintEvent) evt);
+
+ // Check for any events already on the queue with the same source
+ // and ID.
+ AWTEvent previous = null;
+ for (AWTEvent qevt = q.queueHead; qevt != null; qevt = qevt.queueNext)
{
- /* If there are, call coalesceEvents on the source component
- to see if they can be combined. */
- Component srccmp = (Component) src;
- AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt);
- if (coalesced_evt != null)
+ Object src = qevt.getSource();
+ if (qevt.id == evt.id && src == comp)
{
- /* Yes. Replace the existing event with the combined event. */
- queue[i] = coalesced_evt;
- return;
+ // If there are, call coalesceEvents on the source component
+ // to see if they can be combined.
+ Component srccmp = (Component) src;
+ AWTEvent coalescedEvt = srccmp.coalesceEvents(qevt, evt);
+ if (coalescedEvt != null)
+ {
+ // Yes. Replace the existing event with the combined event.
+ if (qevt != coalescedEvt)
+ {
+ if (previous != null)
+ {
+ assert previous.queueNext == qevt;
+ previous.queueNext = coalescedEvt;
+ }
+ else
+ {
+ assert q.queueHead == qevt;
+ q.queueHead = coalescedEvt;
+ }
+ coalescedEvt.queueNext = qevt.queueNext;
+ if (q.queueTail == qevt)
+ q.queueTail = coalescedEvt;
+ qevt.queueNext = null;
+ }
+ return;
+ }
}
- break;
+ previous = qevt;
}
- if (++i == queue.length)
- i = 0;
}
- queue[next_in] = evt;
- if (++next_in == queue.length)
- next_in = 0;
-
- if (next_in == next_out)
+ if (q.queueHead == null)
{
- /* Queue is full. Extend it. */
- AWTEvent[] oldQueue = queue;
- queue = new AWTEvent[queue.length * 2];
-
- int len = oldQueue.length - next_out;
- System.arraycopy(oldQueue, next_out, queue, 0, len);
- if (next_out != 0)
- System.arraycopy(oldQueue, 0, queue, len, next_out);
-
- next_out = 0;
- next_in = oldQueue.length;
+ // We have an empty queue. Set this event both as head and as tail.
+ q.queueHead = evt;
+ q.queueTail = evt;
}
-
+ else
+ {
+ // Note: queueTail should not be null here.
+ q.queueTail.queueNext = evt;
+ q.queueTail = evt;
+ }
+
if (dispatchThread == null || !dispatchThread.isAlive())
{
dispatchThread = new EventDispatchThread(this);
@@ -287,15 +417,15 @@ public class EventQueue
throw new Error("Can't call invokeAndWait from event dispatch thread");
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
- Thread current = Thread.currentThread();
+ Object notifyObject = new Object();
- InvocationEvent ie =
- new InvocationEvent(eq, runnable, current, true);
+ InvocationEvent ie =
+ new InvocationEvent(eq, runnable, notifyObject, true);
- synchronized (current)
+ synchronized (notifyObject)
{
eq.postEvent(ie);
- current.wait();
+ notifyObject.wait();
}
Exception exception;
@@ -387,17 +517,26 @@ public class EventQueue
if (dispatchThread == null)
dispatchThread = new EventDispatchThread(this);
- int i = next_out;
- while (i != next_in)
+ synchronized (newEventQueue)
{
- newEventQueue.postEvent(queue[i]);
- next_out = i;
- if (++i == queue.length)
- i = 0;
+ // The RI transfers the events without calling the new eventqueue's
+ // push(), but using getNextEvent().
+ while (peekEvent() != null)
+ {
+ try
+ {
+ newEventQueue.postEventImpl(getNextEvent());
+ }
+ catch (InterruptedException ex)
+ {
+ // What should we do with this?
+ ex.printStackTrace();
+ }
+ }
+ newEventQueue.prev = this;
}
next = newEventQueue;
- newEventQueue.prev = this;
}
/** Transfer any pending events from this queue back to the parent queue that
@@ -408,36 +547,49 @@ public class EventQueue
*/
protected void pop() throws EmptyStackException
{
- if (prev == null)
- throw new EmptyStackException();
-
/* The order is important here, we must get the prev lock first,
or deadlock could occur as callers usually get here following
prev's next pointer, and thus obtain prev's lock before trying
to get this lock. */
- synchronized (prev)
+ EventQueue previous = prev;
+ if (previous == null)
+ throw new EmptyStackException();
+ synchronized (previous)
{
- prev.next = next;
- if (next != null)
- next.prev = prev;
-
synchronized (this)
{
- int i = next_out;
- while (i != next_in)
+ EventQueue nextQueue = next;
+ if (nextQueue != null)
{
- prev.postEvent(queue[i]);
- next_out = i;
- if (++i == queue.length)
- i = 0;
+ nextQueue.pop();
+ }
+ else
+ {
+ previous.next = null;
+
+ // The RI transfers the events without calling the new eventqueue's
+ // push(), so this should be OK and most effective.
+ while (peekEvent() != null)
+ {
+ try
+ {
+ previous.postEventImpl(getNextEvent());
+ }
+ catch (InterruptedException ex)
+ {
+ // What should we do with this?
+ ex.printStackTrace();
+ }
+ }
+ prev = null;
+ // Tell our EventDispatchThread that it can end
+ // execution.
+ if (dispatchThread != null)
+ {
+ dispatchThread.interrupt();
+ dispatchThread = null;
+ }
}
- // Empty the queue so it can be reused
- next_in = 0;
- next_out = 0;
-
- setShutdown(true);
- dispatchThread = null;
- this.notifyAll();
}
}
}
diff --git a/libjava/classpath/java/awt/FileDialog.java b/libjava/classpath/java/awt/FileDialog.java
index f02d06be2c9..21117700d6e 100644
--- a/libjava/classpath/java/awt/FileDialog.java
+++ b/libjava/classpath/java/awt/FileDialog.java
@@ -95,6 +95,11 @@ private FilenameFilter filter;
*/
private int mode;
+/**
+ * The number used to generate the name returned by getName.
+ */
+private static transient long next_file_dialog_number;
+
/*************************************************************************/
/*
@@ -300,7 +305,11 @@ getFile()
public synchronized void
setFile(String file)
{
- this.file = file;
+ if ("".equals(file))
+ this.file = null;
+ else
+ this.file = file;
+
if (peer != null)
{
FileDialogPeer f = (FileDialogPeer) peer;
@@ -366,5 +375,22 @@ paramString()
",mode=" + mode + "," + super.paramString());
}
+/**
+ * Generate a unique name for this <code>FileDialog</code>.
+ *
+ * @return A unique name for this <code>FileDialog</code>.
+ */
+String
+generateName()
+{
+ return "filedlg" + getUniqueLong();
+}
+
+private static synchronized long
+getUniqueLong()
+{
+ return next_file_dialog_number++;
+}
+
} // class FileDialog
diff --git a/libjava/classpath/java/awt/FlowLayout.java b/libjava/classpath/java/awt/FlowLayout.java
index 8c99195289a..70c98a29a74 100644
--- a/libjava/classpath/java/awt/FlowLayout.java
+++ b/libjava/classpath/java/awt/FlowLayout.java
@@ -337,7 +337,10 @@ public class FlowLayout implements LayoutManager, Serializable
Insets ins = parent.getInsets ();
- w += (num + 1) * hgap + ins.left + ins.right;
+ if (num == 0)
+ w += 2 * hgap + ins.left + ins.right;
+ else
+ w += (num + 1) * hgap + ins.left + ins.right;
h += 2 * vgap + ins.top + ins.bottom;
return new Dimension (w, h);
diff --git a/libjava/classpath/java/awt/Font.java b/libjava/classpath/java/awt/Font.java
index 1c22ce7b48f..29b87d6af99 100644
--- a/libjava/classpath/java/awt/Font.java
+++ b/libjava/classpath/java/awt/Font.java
@@ -44,6 +44,7 @@ import gnu.java.awt.peer.ClasspathFontPeer;
import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;
import java.awt.font.LineMetrics;
+import java.awt.font.TextAttribute;
import java.awt.font.TextLayout;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
@@ -351,7 +352,7 @@ public class Font implements Serializable
this.name = peer.getName(this);
}
- public Font(Map attrs)
+ public Font(Map<? extends AttributedCharacterIterator.Attribute, ?> attrs)
{
this(null, attrs);
}
@@ -797,7 +798,7 @@ public class Font implements Serializable
*
* @since 1.2
*/
- public Font deriveFont(Map attributes)
+ public Font deriveFont(Map<? extends AttributedCharacterIterator.Attribute, ?> attributes)
{
return peer.deriveFont(this, attributes);
}
@@ -811,7 +812,7 @@ public class Font implements Serializable
* @see java.text.AttributedCharacterIterator.Attribute
* @see java.awt.font.TextAttribute
*/
- public Map getAttributes()
+ public Map<TextAttribute, ?> getAttributes()
{
return peer.getAttributes(this);
}
@@ -890,7 +891,7 @@ public class Font implements Serializable
*
* @see java.awt.font.TextAttribute
*/
- public static Font getFont(Map attributes)
+ public static Font getFont(Map<? extends AttributedCharacterIterator.Attribute, ?> attributes)
{
return getFontFromToolkit(null, attributes);
}
@@ -1086,7 +1087,8 @@ public class Font implements Serializable
*/
public Rectangle2D getStringBounds(String str, FontRenderContext frc)
{
- return getStringBounds(str, 0, str.length() - 1, frc);
+ char[] chars = str.toCharArray();
+ return getStringBounds(chars, 0, chars.length, frc);
}
/**
@@ -1114,8 +1116,8 @@ public class Font implements Serializable
public Rectangle2D getStringBounds(String str, int begin,
int limit, FontRenderContext frc)
{
- return peer.getStringBounds(this, new StringCharacterIterator(str), begin,
- limit, frc);
+ String sub = str.substring(begin, limit);
+ return getStringBounds(sub, frc);
}
/**
@@ -1143,7 +1145,16 @@ public class Font implements Serializable
public Rectangle2D getStringBounds(CharacterIterator ci, int begin,
int limit, FontRenderContext frc)
{
- return peer.getStringBounds(this, ci, begin, limit, frc);
+ int start = ci.getBeginIndex();
+ int end = ci.getEndIndex();
+ char[] chars = new char[limit - start];
+ ci.setIndex(start);
+ for (int index = 0; index < chars.length; index++)
+ {
+ chars[index] = ci.current();
+ ci.next();
+ }
+ return getStringBounds(chars, 0, chars.length, frc);
}
/**
@@ -1171,9 +1182,10 @@ public class Font implements Serializable
public Rectangle2D getStringBounds(char[] chars, int begin,
int limit, FontRenderContext frc)
{
- return peer.getStringBounds(this,
- new StringCharacterIterator(new String(chars)),
- begin, limit, frc);
+ String str = new String(chars, begin, limit - begin);
+ TextLayout layout = new TextLayout(str, this, frc);
+ return new Rectangle2D.Float(0, -layout.getAscent(), layout.getAdvance(),
+ layout.getDescent() + layout.getLeading());
}
/**
diff --git a/libjava/classpath/java/awt/Frame.java b/libjava/classpath/java/awt/Frame.java
index 542013671aa..d5cc7f53197 100644
--- a/libjava/classpath/java/awt/Frame.java
+++ b/libjava/classpath/java/awt/Frame.java
@@ -340,13 +340,16 @@ public class Frame extends Window implements MenuContainer
parent.remove(menuBar);
menuBar.setParent(this);
- if (peer != null)
- {
- if (menuBar != null)
- menuBar.addNotify();
- invalidateTree();
- ((FramePeer) peer).setMenuBar(menuBar);
- }
+ // Create local copy for thread safety.
+ FramePeer p = (FramePeer) peer;
+ if (p != null)
+ {
+ if (menuBar != null)
+ menuBar.addNotify();
+ if (valid)
+ invalidate();
+ p.setMenuBar(menuBar);
+ }
}
}
@@ -485,7 +488,10 @@ public class Frame extends Window implements MenuContainer
private static void noteFrame(Frame f)
{
- weakFrames.add(new WeakReference(f));
+ synchronized (weakFrames)
+ {
+ weakFrames.add(new WeakReference(f));
+ }
}
public static Frame[] getFrames()
@@ -533,8 +539,7 @@ public class Frame extends Window implements MenuContainer
public int getState()
{
- // FIXME: State might have changed in the peer... Must check.
- return (state & ICONIFIED) != 0 ? ICONIFIED : NORMAL;
+ return (getExtendedState() & ICONIFIED) != 0 ? ICONIFIED : NORMAL;
}
/**
@@ -542,7 +547,13 @@ public class Frame extends Window implements MenuContainer
*/
public void setExtendedState(int state)
{
- this.state = state;
+ if (getToolkit().isFrameStateSupported(state))
+ {
+ this.state = state;
+ FramePeer p = (FramePeer) peer;
+ if (p != null)
+ p.setState(state);
+ }
}
/**
@@ -550,6 +561,9 @@ public class Frame extends Window implements MenuContainer
*/
public int getExtendedState()
{
+ FramePeer p = (FramePeer) peer;
+ if (p != null)
+ state = p.getState();
return state;
}
diff --git a/libjava/classpath/java/awt/Graphics2D.java b/libjava/classpath/java/awt/Graphics2D.java
index ada13edc512..e0a1b4756f5 100644
--- a/libjava/classpath/java/awt/Graphics2D.java
+++ b/libjava/classpath/java/awt/Graphics2D.java
@@ -183,7 +183,7 @@ public abstract class Graphics2D extends Graphics
* @see #getComposite()
*/
public abstract void setComposite(Composite comp);
-
+
/**
* Sets the paint to be used for subsequent drawing operations.
*
@@ -227,14 +227,14 @@ public abstract class Graphics2D extends Graphics
*
* @see #addRenderingHints(Map)
*/
- public abstract void setRenderingHints(Map hints);
+ public abstract void setRenderingHints(Map<?,?> hints);
/**
* Adds/updates the rendering hint.
*
* @param hints the hints to add or update.
*/
- public abstract void addRenderingHints(Map hints);
+ public abstract void addRenderingHints(Map<?,?> hints);
/**
* Returns the current rendering hints.
diff --git a/libjava/classpath/java/awt/GridBagLayout.java b/libjava/classpath/java/awt/GridBagLayout.java
index d84b7d6df6c..0415c7bd3bb 100644
--- a/libjava/classpath/java/awt/GridBagLayout.java
+++ b/libjava/classpath/java/awt/GridBagLayout.java
@@ -46,6 +46,7 @@ import java.util.Hashtable;
/**
* @author Michael Koch (konqueror@gmx.de)
* @author Jeroen Frijters (jeroen@frijters.net)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
public class GridBagLayout
implements Serializable, LayoutManager2
@@ -62,8 +63,8 @@ public class GridBagLayout
// REMAINDER constraints.
// Constraints kept in comptable are never modified, and constraints
// kept in internalcomptable can be modified internally only.
- protected Hashtable comptable;
- private Hashtable internalcomptable;
+ protected Hashtable<Component,GridBagConstraints> comptable;
+ private Hashtable<Component,GridBagConstraints> internalcomptable;
protected GridBagLayoutInfo layoutInfo;
protected GridBagConstraints defaultConstraints;
@@ -74,8 +75,8 @@ public class GridBagLayout
public GridBagLayout ()
{
- this.comptable = new Hashtable();
- this.internalcomptable = new Hashtable();
+ this.comptable = new Hashtable<Component,GridBagConstraints>();
+ this.internalcomptable = new Hashtable<Component,GridBagConstraints>();
this.defaultConstraints= new GridBagConstraints();
}
@@ -320,6 +321,16 @@ public class GridBagLayout
}
/**
+ * Return a string representation of this GridBagLayout.
+ *
+ * @return a string representation
+ */
+ public String toString()
+ {
+ return getClass().getName();
+ }
+
+ /**
* Move and resize a rectangle according to a set of grid bag
* constraints. The x, y, width and height fields of the
* rectangle argument are adjusted to the new values.
@@ -489,16 +500,18 @@ public class GridBagLayout
// Guaranteed to contain the last component added to the given row
// or column, whose gridwidth/height is not REMAINDER.
- HashMap lastInRow = new HashMap();
- HashMap lastInCol = new HashMap();
+ HashMap<Integer,Component> lastInRow = new HashMap<Integer,Component>();
+ HashMap<Integer,Component> lastInCol = new HashMap<Integer,Component>();
Component[] components = parent.getComponents();
// Components sorted by gridwidths/heights,
// smallest to largest, with REMAINDER and RELATIVE at the end.
// These are useful when determining sizes and weights.
- ArrayList sortedByWidth = new ArrayList(components.length);
- ArrayList sortedByHeight = new ArrayList(components.length);
+ ArrayList<Component> sortedByWidth =
+ new ArrayList<Component>(components.length);
+ ArrayList<Component> sortedByHeight =
+ new ArrayList<Component>(components.length);
// STEP 1: first we figure out how many rows/columns
for (int i = 0; i < components.length; i++)
@@ -763,7 +776,7 @@ public class GridBagLayout
// STEP 3: Determine sizes and weights for columns.
for (int i = 0; i < sortedByWidth.size(); i++)
{
- Component component = (Component) sortedByWidth.get(i);
+ Component component = sortedByWidth.get(i);
// If component is not visible we dont have to care about it.
if (!component.isVisible())
@@ -877,7 +890,8 @@ public class GridBagLayout
* width. Otherwise, sort by height.
* FIXME: Use a better sorting algorithm.
*/
- private void sortBySpan (Component component, int span, ArrayList list, boolean sortByWidth)
+ private void sortBySpan (Component component, int span,
+ ArrayList<Component> list, boolean sortByWidth)
{
if (span == GridBagConstraints.REMAINDER
|| span == GridBagConstraints.RELATIVE)
diff --git a/libjava/classpath/java/awt/GridLayout.java b/libjava/classpath/java/awt/GridLayout.java
index a6836681da5..65e09aa59f8 100644
--- a/libjava/classpath/java/awt/GridLayout.java
+++ b/libjava/classpath/java/awt/GridLayout.java
@@ -289,7 +289,7 @@ public class GridLayout implements LayoutManager, Serializable
public String toString ()
{
return (getClass ().getName () + "["
- + ",hgap=" + hgap + ",vgap=" + vgap
+ + "hgap=" + hgap + ",vgap=" + vgap
+ ",rows=" + rows + ",cols=" + cols
+ "]");
}
diff --git a/libjava/classpath/java/awt/KeyboardFocusManager.java b/libjava/classpath/java/awt/KeyboardFocusManager.java
index eacbceb7d50..cd138269e0b 100644
--- a/libjava/classpath/java/awt/KeyboardFocusManager.java
+++ b/libjava/classpath/java/awt/KeyboardFocusManager.java
@@ -1,5 +1,5 @@
/* KeyboardFocusManager.java -- manage component focusing via the keyboard
- Copyright (C) 2002, 2004 Free Software Foundation
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation
This file is part of GNU Classpath.
@@ -555,7 +555,9 @@ public abstract class KeyboardFocusManager
* @see #UP_CYCLE_TRAVERSAL_KEYS
* @see #DOWN_CYCLE_TRAVERSAL_KEYS
*/
- public void setDefaultFocusTraversalKeys (int id, Set keystrokes)
+ public void setDefaultFocusTraversalKeys (int id,
+ Set<? extends AWTKeyStroke>
+ keystrokes)
{
if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS &&
id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS &&
@@ -627,7 +629,7 @@ public abstract class KeyboardFocusManager
* @see #UP_CYCLE_TRAVERSAL_KEYS
* @see #DOWN_CYCLE_TRAVERSAL_KEYS
*/
- public Set getDefaultFocusTraversalKeys (int id)
+ public Set<AWTKeyStroke> getDefaultFocusTraversalKeys (int id)
{
if (id < FORWARD_TRAVERSAL_KEYS || id > DOWN_CYCLE_TRAVERSAL_KEYS)
throw new IllegalArgumentException ();
@@ -989,9 +991,9 @@ public abstract class KeyboardFocusManager
* @return A list of explicitly registered key event dispatchers.
* @see KeyboardFocusManager#addKeyEventDispatcher(java.awt.KeyEventDispatcher)
*/
- protected List getKeyEventDispatchers ()
+ protected List<KeyEventDispatcher> getKeyEventDispatchers ()
{
- return (List) keyEventDispatchers.clone ();
+ return (List<KeyEventDispatcher>) keyEventDispatchers.clone ();
}
/**
@@ -1046,9 +1048,9 @@ public abstract class KeyboardFocusManager
* @return A list of explicitly registered key event post processors.
* @see KeyboardFocusManager#addKeyEventPostProcessor(java.awt.KeyEventPostProcessor)
*/
- protected List getKeyEventPostProcessors ()
+ protected List<KeyEventPostProcessor> getKeyEventPostProcessors ()
{
- return (List) keyEventPostProcessors.clone ();
+ return (List<KeyEventPostProcessor>) keyEventPostProcessors.clone ();
}
/**
diff --git a/libjava/classpath/java/awt/LightweightDispatcher.java b/libjava/classpath/java/awt/LightweightDispatcher.java
index 3ea3f90a643..04196bd7796 100644
--- a/libjava/classpath/java/awt/LightweightDispatcher.java
+++ b/libjava/classpath/java/awt/LightweightDispatcher.java
@@ -38,7 +38,10 @@ exception statement from your version. */
package java.awt;
+import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
+import java.awt.event.MouseWheelEvent;
+import java.awt.peer.LightweightPeer;
import java.util.WeakHashMap;
/**
@@ -49,7 +52,7 @@ import java.util.WeakHashMap;
*
* @author Roman Kennke (kennke@aicas.com)
*/
-class LightweightDispatcher
+final class LightweightDispatcher
{
/**
@@ -60,26 +63,17 @@ class LightweightDispatcher
private static WeakHashMap instances = new WeakHashMap();
/**
- * The component that is the start of a mouse dragging. All MOUSE_DRAGGED
- * events that follow the initial press must have the source set to this,
- * as well as the MOUSE_RELEASED event following the dragging.
- */
- private Component dragTarget;
-
- /**
- * Stores the button number which started the drag operation. This is needed
- * because we want to handle only one drag operation and only the button that
- * started the dragging should be able to stop it (by a button release).
- */
- private int dragButton;
-
- /**
* The last mouse event target. If the target changes, additional
* MOUSE_ENTERED and MOUSE_EXITED events must be dispatched.
*/
private Component lastTarget;
/**
+ * The current mouseEventTarget.
+ */
+ private Component mouseEventTarget;
+
+ /**
* Returns an instance of LightweightDispatcher for the current thread's
* thread group.
*
@@ -113,9 +107,9 @@ class LightweightDispatcher
*
* @param event the event
*/
- public boolean dispatchEvent(AWTEvent event)
+ public boolean dispatchEvent(final AWTEvent event)
{
- if (event instanceof MouseEvent && event.getSource() instanceof Window)
+ if (event instanceof MouseEvent)
{
MouseEvent mouseEvent = (MouseEvent) event;
return handleMouseEvent(mouseEvent);
@@ -130,151 +124,49 @@ class LightweightDispatcher
* @param ev the mouse event
* @return whether or not we found a lightweight that handled the event.
*/
- private boolean handleMouseEvent(MouseEvent ev)
+ private boolean handleMouseEvent(final MouseEvent ev)
{
- Window window = (Window) ev.getSource();
- // Find the target for the mouse event. We first seach the deepest
- // component at the specified location. The we go up to its parent and
- // try to find a neighbor of the deepest component that is suitable as
- // mouse event target (it must be showing, at that location and have either
- // a MouseListener or MouseMotionListener installed). If no such component
- // is found, then we walk up the container hierarchy and find the next
- // container that has a MouseListener or MouseMotionListener installed.
- Component deepest = window.findComponentAt(ev.getX(), ev.getY());
- if (deepest == null)
- return false;
- Container parent = deepest.getParent();
- Point loc = ev.getPoint();
- loc = convertPointToChild(window, loc, parent);
- Component target = null;
- if (parent != null)
- {
- target = findTarget(parent, loc);
- while (target == null && parent != null)
- {
- if (parent.mouseListener != null
- || parent.mouseMotionListener != null
- || (parent.eventMask
- & (AWTEvent.MOUSE_EVENT_MASK
- | AWTEvent.MOUSE_MOTION_EVENT_MASK)) != 0)
- {
- target = parent;
- }
- else
- parent = parent.getParent();
- }
- }
- if (target == null || target.isLightweight())
+ Container container = (Container) ev.getSource();
+ Component target = findTarget(container, ev.getX(), ev.getY());
+ trackEnterExit(target, ev);
+ int id = ev.getID();
+
+ // Dont update the mouseEventTarget when dragging. Also, MOUSE_CLICKED
+ // must be dispatched to the original target of MOUSE_PRESSED, so don't
+ // update in this case either.
+ if (! isDragging(ev) && id != MouseEvent.MOUSE_CLICKED)
+ mouseEventTarget = (target != container) ? target : null;
+
+ if (mouseEventTarget != null)
{
- // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target
- // is different from the last event target.
- if (target != lastTarget)
+ switch (id)
{
- if (lastTarget != null)
- {
- Point p1 = convertPointToChild(window, ev.getPoint(),
- lastTarget);
- MouseEvent mouseExited =
- new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED,
- ev.getWhen(), ev.getModifiers(), p1.x, p1.y,
- ev.getClickCount(), ev.isPopupTrigger());
- //System.err.println("event: " + mouseExited);
- lastTarget.dispatchEvent(mouseExited);
- }
-
- // If a target exists dispatch the MOUSE_ENTERED event.
- // Experimenting shows that the MOUSE_ENTERED is also dispatched
- // when the mouse is dragging.
- if (target != null)
- {
- Point p = convertPointToChild(window, ev.getPoint(), target);
- MouseEvent mouseEntered =
- new MouseEvent(target,
- MouseEvent.MOUSE_ENTERED, ev.getWhen(),
- ev.getModifiers(), p.x, p.y, ev.getClickCount(),
- ev.isPopupTrigger());
- //System.err.println("event: " + mouseEntered);
- target.dispatchEvent(mouseEntered);
- }
- }
-
- switch (ev.getID())
- {
- case MouseEvent.MOUSE_PRESSED:
- // Handle the start of a drag operation or discard the event if
- // one is already in progress. This prevents focus changes with the
- // other mouse buttons when one is used for dragging.
- if (dragTarget == null)
- {
- lastTarget = dragTarget = target;
-
- // Save the button that started the drag operation.
- dragButton = ev.getButton();
- }
- else
- return false;
-
+ case MouseEvent.MOUSE_ENTERED:
+ case MouseEvent.MOUSE_EXITED:
+ // This is already handled in trackEnterExit().
break;
+ case MouseEvent.MOUSE_PRESSED:
case MouseEvent.MOUSE_RELEASED:
- // Stop the drag operation only when the button that started
- // it was released.
- if (dragTarget != null && dragButton == ev.getButton())
- {
- // Only post MOUSE_RELEASED to dragTarget (set in
- // MOUSE_PRESSED) when the dragTarget is actually visible.
- // Otherwise post the event to the normal target.
- if (dragTarget.isVisible())
- target = dragTarget;
- dragTarget = null;
- }
-
- lastTarget = target;
+ case MouseEvent.MOUSE_MOVED:
+ redispatch(ev, mouseEventTarget, id);
break;
case MouseEvent.MOUSE_CLICKED:
- // When we receive a MOUSE_CLICKED, we set the target to the
- // previous target, which must have been a MOUSE_RELEASED event.
- // This is necessary for the case when the MOUSE_RELEASED has
- // caused the original target (like an internal component) go
- // away.
- // This line is the reason why it is not possible to move the
- // 'lastTarget = target' assignment before the switch-statement.
- target = lastTarget;
+ // MOUSE_CLICKED must be dispatched to the original target of
+ // MOUSE_PRESSED.
+ if (target == mouseEventTarget)
+ redispatch(ev, mouseEventTarget, id);
break;
case MouseEvent.MOUSE_DRAGGED:
- // We consider only dragTarget for redispatching the event still
- // we have to act in a way that the newly found target component
- // was handled.
- lastTarget = target;
- target = dragTarget;
+ if (isDragging(ev))
+ redispatch(ev, mouseEventTarget, id);
break;
- default:
- // Only declare current target as the old value in all other
- // cases.
- lastTarget = target;
- break;
- }
-
- if (target != null)
- {
- Point targetCoordinates = convertPointToChild(window,
- ev.getPoint(),
- target);
- int dx = targetCoordinates.x - ev.getX();
- int dy = targetCoordinates.y - ev.getY();
- ev.translatePoint(dx, dy);
- ev.setSource(target);
- target.dispatchEvent(ev);
-
- // We reset the event, so that the normal event dispatching is not
- // influenced by this modified event.
- ev.setSource(window);
- ev.translatePoint(-dx, -dy);
+ case MouseEvent.MOUSE_WHEEL:
+ redispatch(ev, mouseEventTarget, id);
}
-
- return true;
+ ev.consume();
}
- else
- return false;
+
+ return ev.isConsumed();
}
/**
@@ -290,58 +182,180 @@ class LightweightDispatcher
* @return the actual receiver of the mouse event, or null, if no such
* component has been found
*/
- private Component findTarget(Container c, Point loc)
+ private Component findTarget(final Container c, final int x, final int y)
{
- int numComponents = c.getComponentCount();
Component target = null;
- if (c != null)
+
+ // First we check the children of the container.
+
+ // Note: It is important that we use the package private Container
+ // fields ncomponents and component here. There are applications
+ // that override getComponentCount()
+ // and getComponent() to hide internal components, which makes
+ // the LightweightDispatcher not work correctly in these cases.
+ // As a positive sideeffect this is slightly more efficient.
+ int nChildren = c.ncomponents;
+ for (int i = 0; i < nChildren && target == null; i++)
{
- for (int i = 0; i < numComponents; i++)
+ Component child = c.component[i];
+ int childX = x - child.x;
+ int childY = y - child.y;
+ if (child != null && child.visible
+ && child.peer instanceof LightweightPeer
+ && child.contains(childX, childY))
{
- Component child = c.getComponent(i);
- if (child.isShowing())
+ // Check if there's a deeper possible target.
+ if (child instanceof Container)
{
- if (child.contains(loc.x - child.getX(), loc.y - child.getY())
- && (child.mouseListener != null
- || child.mouseMotionListener != null
- || (child.eventMask
- & (AWTEvent.MOUSE_EVENT_MASK
- | AWTEvent.MOUSE_MOTION_EVENT_MASK)) != 0))
- {
- target = child;
- break;
- }
+ Component deeper = findTarget((Container) child,
+ childX, childY);
+ if (deeper != null)
+ target = deeper;
}
+ // Check if the child itself is interested in mouse events.
+ else if (isMouseListening(child))
+ target = child;
}
}
+
+ // Check the container itself, if we didn't find a target yet.
+ if (target == null && c.contains(x, y) && isMouseListening(c))
+ target = c;
+
return target;
}
/**
- * Converts a point in the parent's coordinate system to a child coordinate
- * system. The resulting point is stored in the same Point object and
- * returned.
+ * Checks if the specified component would be interested in a mouse event.
+ *
+ * @param c the component to check
+ *
+ * @return <code>true</code> if the component has mouse listeners installed,
+ * <code>false</code> otherwise
+ */
+ private boolean isMouseListening(final Component c)
+ {
+ // Note: It is important to NOT check if the component is listening
+ // for a specific event (for instance, mouse motion events). The event
+ // gets dispatched to the component if the component is listening
+ // for ANY mouse event, even when the component is not listening for the
+ // specific type of event. There are applications that depend on this
+ // (sadly).
+ return c.mouseListener != null
+ || c.mouseMotionListener != null
+ || c.mouseWheelListener != null
+ || (c.eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0
+ || (c.eventMask & AWTEvent.MOUSE_MOTION_EVENT_MASK) != 0
+ || (c.eventMask & AWTEvent.MOUSE_WHEEL_EVENT_MASK) != 0;
+ }
+
+ /**
+ * Tracks MOUSE_ENTERED and MOUSE_EXIT as well as MOUSE_MOVED and
+ * MOUSE_DRAGGED and creates synthetic MOUSE_ENTERED and MOUSE_EXITED for
+ * lightweight component.s
+ *
+ * @param target the current mouse event target
+ * @param ev the mouse event
+ */
+ private void trackEnterExit(final Component target, final MouseEvent ev)
+ {
+ int id = ev.getID();
+ if (target != lastTarget)
+ {
+ if (lastTarget != null)
+ redispatch(ev, lastTarget, MouseEvent.MOUSE_EXITED);
+ if (id == MouseEvent.MOUSE_EXITED)
+ ev.consume();
+ if (target != null)
+ redispatch(ev, target, MouseEvent.MOUSE_ENTERED);
+ if (id == MouseEvent.MOUSE_ENTERED)
+ ev.consume();
+ lastTarget = target;
+ }
+
+ }
+
+ /**
+ * Redispatches the specified mouse event to the specified target with the
+ * specified id.
*
- * @param parent the parent component
- * @param p the point
- * @param child the child component
+ * @param ev the mouse event
+ * @param target the new target
+ * @param id the new id
+ */
+ private void redispatch(MouseEvent ev, Component target, int id)
+ {
+ Component source = ev.getComponent();
+ if (target != null)
+ {
+ // Translate coordinates.
+ int x = ev.getX();
+ int y = ev.getY();
+ for (Component c = target; c != null && c != source; c = c.getParent())
+ {
+ x -= c.x;
+ y -= c.y;
+ }
+
+ // Retarget event.
+ MouseEvent retargeted;
+ if (id == MouseEvent.MOUSE_WHEEL)
+ {
+ MouseWheelEvent mwe = (MouseWheelEvent) ev;
+ retargeted = new MouseWheelEvent(target, id, ev.getWhen(),
+ ev.getModifiers()
+ | ev.getModifiersEx(), x, y,
+ ev.getClickCount(),
+ ev.isPopupTrigger(),
+ mwe.getScrollType(),
+ mwe.getScrollAmount(),
+ mwe.getWheelRotation());
+ }
+ else
+ {
+ retargeted = new MouseEvent(target, id, ev.getWhen(),
+ ev.getModifiers() | ev.getModifiersEx(),
+ x, y, ev.getClickCount(),
+ ev.isPopupTrigger(), ev.getButton());
+ }
+
+ if (target == source)
+ ((Container) target).dispatchNoLightweight(retargeted);
+ else
+ target.dispatchEvent(retargeted);
+ }
+ }
+
+ /**
+ * Determines if we are in the middle of a drag operation, that is, if
+ * any of the buttons is held down.
+ *
+ * @param ev the mouse event to check
*
- * @return the translated point
+ * @return <code>true</code> if we are in the middle of a drag operation,
+ * <code>false</code> otherwise
*/
- private Point convertPointToChild(Component parent, Point p,
- Component child)
+ private boolean isDragging(MouseEvent ev)
{
- int offX = 0;
- int offY = 0;
- Component comp = child;
- while (comp != null && comp != parent)
+ int mods = ev.getModifiersEx();
+ int id = ev.getID();
+ if (id == MouseEvent.MOUSE_PRESSED || id == MouseEvent.MOUSE_RELEASED)
{
- offX += comp.getX();
- offY += comp.getY();
- comp = comp.getParent();
+ switch (ev.getButton())
+ {
+ case MouseEvent.BUTTON1:
+ mods ^= InputEvent.BUTTON1_DOWN_MASK;
+ break;
+ case MouseEvent.BUTTON2:
+ mods ^= InputEvent.BUTTON2_DOWN_MASK;
+ break;
+ case MouseEvent.BUTTON3:
+ mods ^= InputEvent.BUTTON3_DOWN_MASK;
+ break;
+ }
}
- p.x -= offX;
- p.y -= offY;
- return p;
+ return (mods & (InputEvent.BUTTON1_DOWN_MASK
+ | InputEvent.BUTTON2_DOWN_MASK
+ | InputEvent.BUTTON3_DOWN_MASK)) != 0;
}
}
diff --git a/libjava/classpath/java/awt/List.java b/libjava/classpath/java/awt/List.java
index 86270234345..df8bffa1945 100644
--- a/libjava/classpath/java/awt/List.java
+++ b/libjava/classpath/java/awt/List.java
@@ -1,5 +1,5 @@
/* List.java -- A listbox widget
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -54,1005 +54,932 @@ import javax.accessibility.AccessibleState;
import javax.accessibility.AccessibleStateSet;
/**
- * Class that implements a listbox widget
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
+ * Class that implements a listbox widget
+ *
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ */
public class List extends Component
implements ItemSelectable, Accessible
{
-/*
- * Static Variables
- */
-
-/**
- * The number used to generate the name returned by getName.
- */
-private static transient long next_list_number;
-
-// Serialization constant
-private static final long serialVersionUID = -3304312411574666869L;
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-// FIXME: Need read/writeObject
-
-/**
- * @serial The items in the list.
- */
-private Vector items = new Vector();
-
-/**
- * @serial Indicates whether or not multiple items can be selected
- * simultaneously.
- */
-private boolean multipleMode;
-
-/**
- * @serial The number of rows in the list. This is set on creation
- * only and cannot be modified.
- */
-private int rows;
+ /**
+ * The number used to generate the name returned by getName.
+ */
+ private static transient long next_list_number;
-/**
- * @serial An array of the item indices that are selected.
- */
-private int[] selected;
+ // Serialization constant
+ private static final long serialVersionUID = -3304312411574666869L;
-/**
- * @serial An index value used by <code>makeVisible()</code> and
- * <code>getVisibleIndex</code>.
- */
-private int visibleIndex;
+ // FIXME: Need read/writeObject
-// The list of ItemListeners for this object.
-private ItemListener item_listeners;
+ /**
+ * @serial The items in the list.
+ */
+ private Vector items = new Vector();
-// The list of ActionListeners for this object.
-private ActionListener action_listeners;
+ /**
+ * @serial Indicates whether or not multiple items can be selected
+ * simultaneously.
+ */
+ private boolean multipleMode;
+ /**
+ * @serial The number of rows in the list. This is set on creation
+ * only and cannot be modified.
+ */
+ private int rows;
-/*************************************************************************/
+ /**
+ * @serial An array of the item indices that are selected.
+ */
+ private int[] selected;
-/*
- * Constructors
- */
+ /**
+ * @serial An index value used by <code>makeVisible()</code> and
+ * <code>getVisibleIndex</code>.
+ */
+ private int visibleIndex = -1;
-/**
- * Initializes a new instance of <code>List</code> with no visible lines
- * and multi-select disabled.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-List()
-{
- this(4, false);
-}
+ // The list of ItemListeners for this object.
+ private ItemListener item_listeners;
-/*************************************************************************/
+ // The list of ActionListeners for this object.
+ private ActionListener action_listeners;
-/**
- * Initializes a new instance of <code>List</code> with the specified
- * number of visible lines and multi-select disabled.
- *
- * @param rows The number of visible rows in the list.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-List(int rows)
-{
- this(rows, false);
-}
+ /**
+ * Initializes a new instance of <code>List</code> with no visible lines
+ * and multi-select disabled.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
+ * @since 1.1
+ */
+ public List()
+ {
+ this(4, false);
+ }
-/*************************************************************************/
+ /**
+ * Initializes a new instance of <code>List</code> with the specified
+ * number of visible lines and multi-select disabled.
+ *
+ * @param rows The number of visible rows in the list.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
+ */
+ public List(int rows)
+ {
+ this(rows, false);
+ }
-/**
- * Initializes a new instance of <code>List</code> with the specified
- * number of lines and the specified multi-select setting.
- *
- * @param rows The number of visible rows in the list.
- * @param multipleMode <code>true</code> if multiple lines can be selected
- * simultaneously, <code>false</code> otherwise.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-List(int rows, boolean multipleMode)
-{
- if (rows == 0)
- this.rows = 4;
- else
- this.rows = rows;
+ /**
+ * Initializes a new instance of <code>List</code> with the specified
+ * number of lines and the specified multi-select setting.
+ *
+ * @param rows The number of visible rows in the list.
+ * @param multipleMode <code>true</code> if multiple lines can be selected
+ * simultaneously, <code>false</code> otherwise.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
+ */
+ public List(int rows, boolean multipleMode)
+ {
+ if (rows == 0)
+ this.rows = 4;
+ else
+ this.rows = rows;
- this.multipleMode = multipleMode;
- selected = new int[0];
-
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
-}
-
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
+ this.multipleMode = multipleMode;
+ selected = new int[0];
-/**
- * Returns the number of items in this list.
- *
- * @return The number of items in this list.
- */
-public int
-getItemCount()
-{
- return countItems ();
-}
-
-/*************************************************************************/
+ if (GraphicsEnvironment.isHeadless())
+ throw new HeadlessException();
+
+ }
-/**
- * Returns the number of items in this list.
- *
- * @return The number of items in this list.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getItemCount()</code>
- */
-public int
-countItems()
-{
- return items.size ();
-}
+ /**
+ * Returns the number of items in this list.
+ *
+ * @return The number of items in this list.
+ *
+ * @since 1.1
+ */
+ public int getItemCount()
+ {
+ return countItems();
+ }
-/*************************************************************************/
+ /**
+ * Returns the number of items in this list.
+ *
+ * @return The number of items in this list.
+ *
+ * @deprecated This method is deprecated in favor of
+ * <code>getItemCount()</code>
+ */
+ public int countItems()
+ {
+ return items.size();
+ }
-/**
- * Returns the complete list of items.
- *
- * @return The complete list of items in the list.
- */
-public synchronized String[]
-getItems()
-{
- String[] l_items = new String[getItemCount()];
+ /**
+ * Returns the complete list of items.
+ *
+ * @return The complete list of items in the list.
+ *
+ * @since 1.1
+ */
+ public synchronized String[] getItems()
+ {
+ String[] l_items = new String[getItemCount()];
- items.copyInto(l_items);
- return(l_items);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the item at the specified index.
- *
- * @param index The index of the item to retrieve.
- *
- * @exception IndexOutOfBoundsException If the index value is not valid.
- */
-public String
-getItem(int index)
-{
- return((String)items.elementAt(index));
-}
-
-/*************************************************************************/
-
-/**
- * Returns the number of visible rows in the list.
- *
- * @return The number of visible rows in the list.
- */
-public int
-getRows()
-{
- return(rows);
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not multi-select mode is enabled.
- *
- * @return <code>true</code> if multi-select mode is enabled,
- * <code>false</code> otherwise.
- */
-public boolean
-isMultipleMode()
-{
- return allowsMultipleSelections ();
-}
-
-/*************************************************************************/
-
-/**
- * Tests whether or not multi-select mode is enabled.
- *
- * @return <code>true</code> if multi-select mode is enabled,
- * <code>false</code> otherwise.
- *
- * @deprecated This method is deprecated in favor of
- * <code>isMultipleMode()</code>.
- */
-public boolean
-allowsMultipleSelections()
-{
- return multipleMode;
-}
-
-/*************************************************************************/
-
-/**
- * This method enables or disables multiple selection mode for this
- * list.
- *
- * @param multipleMode <code>true</code> to enable multiple mode,
- * <code>false</code> otherwise.
- */
-public void
-setMultipleMode(boolean multipleMode)
-{
- setMultipleSelections (multipleMode);
-}
-
-/*************************************************************************/
-
-/**
- * This method enables or disables multiple selection mode for this
- * list.
- *
- * @param multipleMode <code>true</code> to enable multiple mode,
- * <code>false</code> otherwise.
- *
- * @deprecated
- */
-public void
-setMultipleSelections(boolean multipleMode)
-{
- this.multipleMode = multipleMode;
-
- ListPeer peer = (ListPeer) getPeer ();
- if (peer != null)
- peer.setMultipleMode (multipleMode);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the minimum size of this component.
- *
- * @return The minimum size of this component.
- */
-public Dimension
-getMinimumSize()
-{
- return getMinimumSize (getRows ());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the minimum size of this component.
- *
- * @return The minimum size of this component.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getMinimumSize</code>.
- */
-public Dimension
-minimumSize()
-{
- return minimumSize (getRows ());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the minimum size of this component assuming it had the specified
- * number of rows.
- *
- * @param rows The number of rows to size for.
- *
- * @return The minimum size of this component.
- */
-public Dimension
-getMinimumSize(int rows)
-{
- return minimumSize (rows);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the minimum size of this component assuming it had the specified
- * number of rows.
- *
- * @param rows The number of rows to size for.
- *
- * @return The minimum size of this component.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getMinimumSize(int)</code>>
- */
-public Dimension
-minimumSize(int rows)
-{
- ListPeer peer = (ListPeer) getPeer ();
- if (peer != null)
- return peer.minimumSize (rows);
- else
- return new Dimension (0, 0);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the preferred size of this component.
- *
- * @return The preferred size of this component.
- */
-public Dimension
-getPreferredSize()
-{
- return getPreferredSize (getRows ());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the preferred size of this component.
- *
- * @return The preferred size of this component.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getPreferredSize</code>.
- */
-public Dimension
-preferredSize()
-{
- return preferredSize (getRows ());
-}
-
-/*************************************************************************/
-
-/**
- * Returns the preferred size of this component assuming it had the specified
- * number of rows.
- *
- * @param rows The number of rows to size for.
- *
- * @return The preferred size of this component.
- */
-public Dimension
-getPreferredSize(int rows)
-{
- return preferredSize (rows);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the preferred size of this component assuming it had the specified
- * number of rows.
- *
- * @param rows The number of rows to size for.
- *
- * @return The preferred size of this component.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getPreferredSize(int)</code>>
- */
-public Dimension
-preferredSize(int rows)
-{
- ListPeer peer = (ListPeer) getPeer ();
- if (peer != null)
- return peer.preferredSize (rows);
- else
- return getSize();
-}
-
-/*************************************************************************/
-
-/**
- * This method adds the specified item to the end of the list.
- *
- * @param item The item to add to the list.
- */
-public void
-add(String item)
-{
- add (item, -1);
-}
-
-/*************************************************************************/
-
-/**
- * This method adds the specified item to the end of the list.
- *
- * @param item The item to add to the list.
- *
- * @deprecated Use add() instead.
- */
-public void
-addItem(String item)
-{
- addItem (item, -1);
-}
-
-/*************************************************************************/
-
-/**
- * Adds the specified item to the specified location in the list.
- * If the desired index is -1 or greater than the number of rows
- * in the list, then the item is added to the end.
- *
- * @param item The item to add to the list.
- * @param index The location in the list to add the item, or -1 to add
- * to the end.
- */
-public void
-add(String item, int index)
-{
- addItem (item, index);
-}
-
-/*************************************************************************/
-
-/**
- * Adds the specified item to the specified location in the list.
- * If the desired index is -1 or greater than the number of rows
- * in the list, then the item is added to the end.
- *
- * @param item The item to add to the list.
- * @param index The location in the list to add the item, or -1 to add
- * to the end.
- *
- * @deprecated Use add() instead.
- */
-public void
-addItem(String item, int index)
-{
- if ((index == -1) || (index >= items.size ()))
- items.addElement (item);
- else
- items.insertElementAt (item, index);
-
- ListPeer peer = (ListPeer) getPeer ();
- if (peer != null)
- peer.add (item, index);
-}
-
-/*************************************************************************/
-
-/**
- * Deletes the item at the specified index.
- *
- * @param index The index of the item to delete.
- *
- * @exception IllegalArgumentException If the index is not valid
- *
- * @deprecated
- */
-public void
-delItem(int index) throws IllegalArgumentException
-{
- items.removeElementAt (index);
-
- ListPeer peer = (ListPeer) getPeer ();
- if (peer != null)
- peer.delItems (index, index);
-}
-
-/*************************************************************************/
-
-/**
- * Deletes the item at the specified index.
- *
- * @param index The index of the item to delete.
- *
- * @exception IllegalArgumentException If the index is not valid
- */
-public void
-remove(int index) throws IllegalArgumentException
-{
- delItem (index);
-}
-
-/*************************************************************************/
-
-/**
- * Deletes all items in the specified index range.
- *
- * @param start The beginning index of the range to delete.
- * @param end The ending index of the range to delete.
- *
- * @exception IllegalArgumentException If the indexes are not valid
- *
- * @deprecated This method is deprecated for some unknown reason.
- */
-public synchronized void
-delItems(int start, int end) throws IllegalArgumentException
-{
- if ((start < 0) || (start >= items.size()))
- throw new IllegalArgumentException("Bad list start index value: " + start);
-
- if ((start < 0) || (start >= items.size()))
- throw new IllegalArgumentException("Bad list start index value: " + start);
-
- if (start > end)
- throw new IllegalArgumentException("Start is greater than end!");
-
- // We must run the loop in reverse direction.
- for (int i = end; i >= start; --i)
- items.removeElementAt (i);
- if (peer != null)
- {
- ListPeer l = (ListPeer) peer;
- l.delItems (start, end);
- }
-}
-
-/*************************************************************************/
+ items.copyInto(l_items);
+ return(l_items);
+ }
-/**
- * Deletes the first occurrence of the specified item from the list.
- *
- * @param item The item to delete.
- *
- * @exception IllegalArgumentException If the specified item does not exist.
- */
-public synchronized void
-remove(String item) throws IllegalArgumentException
-{
- int index = items.indexOf(item);
- if (index == -1)
- throw new IllegalArgumentException("List element to delete not found");
+ /**
+ * Returns the item at the specified index.
+ *
+ * @param index The index of the item to retrieve.
+ *
+ * @exception IndexOutOfBoundsException If the index value is not valid.
+ */
+ public String getItem(int index)
+ {
+ return((String) items.elementAt(index));
+ }
- remove(index);
-}
+ /**
+ * Returns the number of visible rows in the list.
+ *
+ * @return The number of visible rows in the list.
+ */
+ public int getRows()
+ {
+ return(rows);
+ }
-/*************************************************************************/
+ /**
+ * Tests whether or not multi-select mode is enabled.
+ *
+ * @return <code>true</code> if multi-select mode is enabled,
+ * <code>false</code> otherwise.
+ *
+ * @since 1.1
+ */
+ public boolean isMultipleMode()
+ {
+ return allowsMultipleSelections ();
+ }
-/**
- * Deletes all of the items from the list.
- */
-public synchronized void
-removeAll()
-{
- clear ();
-}
+ /**
+ * Tests whether or not multi-select mode is enabled.
+ *
+ * @return <code>true</code> if multi-select mode is enabled,
+ * <code>false</code> otherwise.
+ *
+ * @deprecated This method is deprecated in favor of
+ * <code>isMultipleMode()</code>.
+ */
+ public boolean allowsMultipleSelections()
+ {
+ return multipleMode;
+ }
-/*************************************************************************/
+ /**
+ * This method enables or disables multiple selection mode for this
+ * list.
+ *
+ * @param multipleMode <code>true</code> to enable multiple mode,
+ * <code>false</code> otherwise.
+ *
+ * @since 1.1
+ */
+ public void setMultipleMode(boolean multipleMode)
+ {
+ setMultipleSelections (multipleMode);
+ }
-/**
- * Deletes all of the items from the list.
- *
- * @deprecated This method is deprecated in favor of <code>removeAll()</code>.
- */
-public void
-clear()
-{
- items.clear();
+ /**
+ * This method enables or disables multiple selection mode for this
+ * list.
+ *
+ * @param multipleMode <code>true</code> to enable multiple mode,
+ * <code>false</code> otherwise.
+ *
+ * @deprecated
+ */
+ public void setMultipleSelections(boolean multipleMode)
+ {
+ this.multipleMode = multipleMode;
- ListPeer peer = (ListPeer) getPeer ();
- if (peer != null)
- peer.removeAll ();
-}
+ ListPeer peer = (ListPeer) getPeer();
+ if (peer != null)
+ peer.setMultipleMode(multipleMode);
+
+ }
-/*************************************************************************/
+ /**
+ * Returns the minimum size of this component.
+ *
+ * @return The minimum size of this component.
+ *
+ * @since 1.1
+ */
+ public Dimension getMinimumSize()
+ {
+ return getMinimumSize(getRows());
+ }
-/**
- * Replaces the item at the specified index with the specified item.
- *
- * @param item The new item value.
- * @param index The index of the item to replace.
- *
- * @exception ArrayIndexOutOfBoundsException If the index is not valid.
- */
-public synchronized void
-replaceItem(String item, int index) throws ArrayIndexOutOfBoundsException
-{
- if ((index < 0) || (index >= items.size()))
- throw new ArrayIndexOutOfBoundsException("Bad list index: " + index);
+ /**
+ * Returns the minimum size of this component.
+ *
+ * @return The minimum size of this component.
+ *
+ * @deprecated This method is deprecated in favor of
+ * <code>getMinimumSize</code>.
+ */
+ public Dimension minimumSize()
+ {
+ return minimumSize(getRows());
+ }
- items.insertElementAt(item, index + 1);
- items.removeElementAt (index);
+ /**
+ * Returns the minimum size of this component assuming it had the specified
+ * number of rows.
+ *
+ * @param rows The number of rows to size for.
+ *
+ * @return The minimum size of this component.
+ *
+ * @since 1.1
+ */
+ public Dimension getMinimumSize(int rows)
+ {
+ return minimumSize(rows);
+ }
- if (peer != null)
- {
- ListPeer l = (ListPeer) peer;
+ /**
+ * Returns the minimum size of this component assuming it had the specified
+ * number of rows.
+ *
+ * @param rows The number of rows to size for.
+ *
+ * @return The minimum size of this component.
+ *
+ * @deprecated This method is deprecated in favor of
+ * <code>getMinimumSize(int)</code>>
+ */
+ public Dimension minimumSize(int rows)
+ {
+ ListPeer peer = (ListPeer) getPeer();
+ if (peer != null)
+ return peer.minimumSize(rows);
+ else
+ return new Dimension(0, 0);
+ }
- /* We add first and then remove so that the selected
- item remains the same */
- l.add (item, index + 1);
- l.delItems (index, index);
- }
-}
+ /**
+ * Returns the preferred size of this component.
+ *
+ * @return The preferred size of this component.
+ *
+ * @since 1.1
+ */
+ public Dimension getPreferredSize()
+ {
+ return getPreferredSize(getRows());
+ }
-/*************************************************************************/
+ /**
+ * Returns the preferred size of this component.
+ *
+ * @return The preferred size of this component.
+ *
+ * @deprecated This method is deprecated in favor of
+ * <code>getPreferredSize</code>.
+ */
+ public Dimension preferredSize()
+ {
+ return preferredSize(getRows());
+ }
-/**
- * Returns the index of the currently selected item. -1 will be returned
- * if there are no selected rows or if there are multiple selected rows.
- *
- * @return The index of the selected row.
- */
-public synchronized int
-getSelectedIndex()
-{
- if (peer != null)
- {
- ListPeer l = (ListPeer) peer;
- selected = l.getSelectedIndexes ();
- }
+ /**
+ * Returns the preferred size of this component assuming it had the specified
+ * number of rows.
+ *
+ * @param rows The number of rows to size for.
+ *
+ * @return The preferred size of this component.
+ *
+ * @since 1.1
+ */
+ public Dimension getPreferredSize(int rows)
+ {
+ return preferredSize(rows);
+ }
- if (selected == null || selected.length != 1)
- return -1;
- return selected[0];
-}
+ /**
+ * Returns the preferred size of this component assuming it had the specified
+ * number of rows.
+ *
+ * @param rows The number of rows to size for.
+ *
+ * @return The preferred size of this component.
+ *
+ * @deprecated This method is deprecated in favor of
+ * <code>getPreferredSize(int)</code>>
+ */
+ public Dimension preferredSize(int rows)
+ {
+ ListPeer peer = (ListPeer)getPeer();
+ if (peer != null)
+ return peer.preferredSize(rows);
+ else
+ return getSize();
+ }
-/*************************************************************************/
+ /**
+ * This method adds the specified item to the end of the list.
+ *
+ * @param item The item to add to the list.
+ *
+ * @since 1.1
+ */
+ public void add(String item)
+ {
+ add (item, -1);
+ }
-/**
- * Returns an array containing the indexes of the rows that are
- * currently selected.
- *
- * @return A list of indexes of selected rows.
- */
-public synchronized int[]
-getSelectedIndexes()
-{
- if (peer != null)
- {
- ListPeer l = (ListPeer) peer;
- selected = l.getSelectedIndexes ();
- }
- return selected;
-}
+ /**
+ * This method adds the specified item to the end of the list.
+ *
+ * @param item The item to add to the list.
+ *
+ * @deprecated Use add() instead.
+ */
+ public void addItem(String item)
+ {
+ addItem(item, -1);
+ }
-/*************************************************************************/
+ /**
+ * Adds the specified item to the specified location in the list.
+ * If the desired index is -1 or greater than the number of rows
+ * in the list, then the item is added to the end.
+ *
+ * @param item The item to add to the list.
+ * @param index The location in the list to add the item, or -1 to add
+ * to the end.
+ *
+ * @since 1.1
+ */
+ public void add(String item, int index)
+ {
+ addItem(item, index);
+ }
-/**
- * Returns the item that is currently selected, or <code>null</code> if there
- * is no item selected. FIXME: What happens if multiple items selected?
- *
- * @return The selected item, or <code>null</code> if there is no
- * selected item.
- */
-public synchronized String
-getSelectedItem()
-{
- int index = getSelectedIndex();
- if (index == -1)
- return(null);
+ /**
+ * Adds the specified item to the specified location in the list.
+ * If the desired index is -1 or greater than the number of rows
+ * in the list, then the item is added to the end.
+ *
+ * @param item The item to add to the list.
+ * @param index The location in the list to add the item, or -1 to add
+ * to the end.
+ *
+ * @deprecated Use add() instead.
+ */
+ public void addItem(String item, int index)
+ {
+ if (item == null)
+ item = "";
+
+ if (index < -1)
+ index = -1;
+
+ if ((index == -1) || (index >= items.size ()))
+ items.addElement (item);
+ else
+ items.insertElementAt(item, index);
+
+ ListPeer peer = (ListPeer) getPeer();
+ if (peer != null)
+ peer.add (item, index);
+ }
- return((String)items.elementAt(index));
-}
+ /**
+ * Deletes the item at the specified index.
+ *
+ * @param index The index of the item to delete.
+ *
+ * @exception IllegalArgumentException If the index is not valid
+ *
+ * @deprecated
+ */
+ public void delItem(int index) throws IllegalArgumentException
+ {
+ boolean selected = false;
+ if (isSelected(index))
+ {
+ selected = true;
+ deselect(index);
+ }
+
+ items.removeElementAt (index);
+
+ if (selected)
+ select(index);
-/*************************************************************************/
+ ListPeer peer = (ListPeer) getPeer();
+ if (peer != null)
+ peer.delItems (index, index);
+ }
-/**
- * Returns the list of items that are currently selected in this list.
- *
- * @return The list of currently selected items.
- */
-public synchronized String[]
-getSelectedItems()
-{
- int[] indexes = getSelectedIndexes();
- if (indexes == null)
- return(new String[0]);
+ /**
+ * Deletes the item at the specified index.
+ *
+ * @param index The index of the item to delete.
+ *
+ * @exception IllegalArgumentException If the index is not valid
+ *
+ * @since 1.1
+ */
+ public void remove(int index) throws IllegalArgumentException
+ {
+ delItem(index);
+ }
- String[] retvals = new String[indexes.length];
- if (retvals.length > 0)
- for (int i = 0 ; i < retvals.length; i++)
- retvals[i] = (String)items.elementAt(indexes[i]);
+ /**
+ * Deletes all items in the specified index range.
+ *
+ * @param start The beginning index of the range to delete.
+ * @param end The ending index of the range to delete.
+ *
+ * @exception IllegalArgumentException If the indexes are not valid
+ *
+ * @deprecated This method is deprecated for some unknown reason.
+ */
+ public synchronized void delItems(int start, int end)
+ throws IllegalArgumentException
+ {
+ // We must run the loop in reverse direction.
+ for (int i = end; i >= start; --i)
+ items.removeElementAt (i);
+ if (peer != null)
+ {
+ ListPeer l = (ListPeer) peer;
+ l.delItems (start, end);
+ }
+ }
- return(retvals);
-}
+ /**
+ * Deletes the first occurrence of the specified item from the list.
+ *
+ * @param item The item to delete.
+ *
+ * @exception IllegalArgumentException If the specified item does not exist.
+ *
+ * @since 1.1
+ */
+ public synchronized void remove(String item) throws IllegalArgumentException
+ {
+ int index = items.indexOf(item);
+ if (index == -1)
+ throw new IllegalArgumentException("List element to delete not found");
-/*************************************************************************/
+ remove(index);
+ }
-/**
- * Returns the list of items that are currently selected in this list as
- * an array of type <code>Object[]</code> instead of <code>String[]</code>.
- *
- * @return The list of currently selected items.
- */
-public synchronized Object[]
-getSelectedObjects()
-{
- int[] indexes = getSelectedIndexes();
- if (indexes == null)
- return(new Object[0]);
+ /**
+ * Deletes all of the items from the list.
+ *
+ * @since 1.1
+ */
+ public synchronized void removeAll()
+ {
+ clear();
+ }
- Object[] retvals = new Object[indexes.length];
- if (retvals.length > 0)
- for (int i = 0 ; i < retvals.length; i++)
- retvals[i] = items.elementAt(indexes[i]);
+ /**
+ * Deletes all of the items from the list.
+ *
+ * @deprecated This method is deprecated in favor of <code>removeAll()</code>.
+ */
+ public void clear()
+ {
+ items.clear();
- return(retvals);
-}
+ ListPeer peer = (ListPeer) getPeer();
+ if (peer != null)
+ peer.removeAll();
+
+ selected = new int[0];
+ }
-/*************************************************************************/
+ /**
+ * Replaces the item at the specified index with the specified item.
+ *
+ * @param item The new item value.
+ * @param index The index of the item to replace.
+ *
+ * @exception ArrayIndexOutOfBoundsException If the index is not valid.
+ */
+ public synchronized void replaceItem(String item, int index)
+ throws ArrayIndexOutOfBoundsException
+ {
+ if ((index < 0) || (index >= items.size()))
+ throw new ArrayIndexOutOfBoundsException("Bad list index: " + index);
-/**
- * Tests whether or not the specified index is selected.
- *
- * @param index The index to test.
- *
- * @return <code>true</code> if the index is selected, <code>false</code>
- * otherwise.
- */
-public boolean
-isIndexSelected(int index)
-{
- return isSelected (index);
-}
+ items.insertElementAt(item, index + 1);
+ items.removeElementAt (index);
-/*************************************************************************/
+ if (peer != null)
+ {
+ ListPeer l = (ListPeer) peer;
-/**
- * Tests whether or not the specified index is selected.
- *
- * @param index The index to test.
- *
- * @return <code>true</code> if the index is selected, <code>false</code>
- * otherwise.
- *
- * @deprecated This method is deprecated in favor of
- * <code>isIndexSelected(int)</code>.
- */
-public boolean
-isSelected(int index)
-{
- int[] indexes = getSelectedIndexes ();
+ /* We add first and then remove so that the selected
+ item remains the same */
+ l.add (item, index + 1);
+ l.delItems (index, index);
+ }
+ }
- for (int i = 0; i < indexes.length; i++)
- if (indexes[i] == index)
- return true;
+ /**
+ * Returns the index of the currently selected item. -1 will be returned
+ * if there are no selected rows or if there are multiple selected rows.
+ *
+ * @return The index of the selected row.
+ */
+ public synchronized int getSelectedIndex()
+ {
+ if (peer != null)
+ {
+ ListPeer l = (ListPeer) peer;
+ selected = l.getSelectedIndexes ();
+ }
- return false;
-}
+ if (selected == null || selected.length != 1)
+ return -1;
+
+ return selected[0];
+ }
-/*************************************************************************/
+ /**
+ * Returns an array containing the indexes of the rows that are
+ * currently selected.
+ *
+ * @return A list of indexes of selected rows.
+ */
+ public synchronized int[] getSelectedIndexes()
+ {
+ if (peer != null)
+ {
+ ListPeer l = (ListPeer) peer;
+ selected = l.getSelectedIndexes();
+ }
+
+ return selected;
+ }
-/**
- * This method ensures that the item at the specified index is visible.
- *
- * @param index The index of the item to be made visible.
- */
-public synchronized void
-makeVisible(int index) throws IllegalArgumentException
-{
- visibleIndex = index;
- if (peer != null)
- {
- ListPeer l = (ListPeer) peer;
- l.makeVisible (index);
- }
-}
+ /**
+ * Returns the item that is currently selected, or <code>null</code> if there
+ * is no item selected. FIXME: What happens if multiple items selected?
+ *
+ * @return The selected item, or <code>null</code> if there is no
+ * selected item.
+ */
+ public synchronized String getSelectedItem()
+ {
+ int index = getSelectedIndex();
+ if (index == -1)
+ return(null);
-/*************************************************************************/
+ return((String) items.elementAt(index));
+ }
-/**
- * Returns the index of the last item that was made visible via the
- * <code>makeVisible()</code> method.
- *
- * @return The index of the last item made visible via the
- * <code>makeVisible()</code> method.
- */
-public int
-getVisibleIndex()
-{
- return(visibleIndex);
-}
+ /**
+ * Returns the list of items that are currently selected in this list.
+ *
+ * @return The list of currently selected items.
+ */
+ public synchronized String[] getSelectedItems()
+ {
+ int[] indexes = getSelectedIndexes();
+ if (indexes == null)
+ return(new String[0]);
-/*************************************************************************/
+ String[] retvals = new String[indexes.length];
+ if (retvals.length > 0)
+ for (int i = 0 ; i < retvals.length; i++)
+ retvals[i] = (String)items.elementAt(indexes[i]);
-/**
- * Makes the item at the specified index selected.
- *
- * @param index The index of the item to select.
- */
-public synchronized void
-select(int index)
-{
- ListPeer lp = (ListPeer)getPeer();
- if (lp != null)
- lp.select(index);
-}
+ return(retvals);
+ }
-/*************************************************************************/
+ /**
+ * Returns the list of items that are currently selected in this list as
+ * an array of type <code>Object[]</code> instead of <code>String[]</code>.
+ *
+ * @return The list of currently selected items.
+ */
+ public synchronized Object[] getSelectedObjects()
+ {
+ int[] indexes = getSelectedIndexes();
+ if (indexes == null)
+ return(new Object[0]);
-/**
- * Makes the item at the specified index not selected.
- *
- * @param index The index of the item to unselect.
- */
-public synchronized void
-deselect(int index)
-{
- ListPeer lp = (ListPeer)getPeer();
- if (lp != null)
- lp.deselect(index);
-}
+ Object[] retvals = new Object[indexes.length];
+ if (retvals.length > 0)
+ for (int i = 0 ; i < retvals.length; i++)
+ retvals[i] = items.elementAt(indexes[i]);
-/*************************************************************************/
+ return(retvals);
+ }
-/**
- * Notifies this object to create its native peer.
- */
-public void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit ().createList (this);
- super.addNotify ();
-}
+ /**
+ * Tests whether or not the specified index is selected.
+ *
+ * @param index The index to test.
+ *
+ * @return <code>true</code> if the index is selected, <code>false</code>
+ * otherwise.
+ *
+ * @since 1.1
+ */
+ public boolean isIndexSelected(int index)
+ {
+ return isSelected(index);
+ }
-/*************************************************************************/
+ /**
+ * Tests whether or not the specified index is selected.
+ *
+ * @param index The index to test.
+ *
+ * @return <code>true</code> if the index is selected, <code>false</code>
+ * otherwise.
+ *
+ * @deprecated This method is deprecated in favor of
+ * <code>isIndexSelected(int)</code>.
+ */
+ public boolean isSelected(int index)
+ {
+ int[] indexes = getSelectedIndexes();
-/**
- * Notifies this object to destroy its native peer.
- */
-public void
-removeNotify()
-{
- super.removeNotify();
-}
+ for (int i = 0; i < indexes.length; i++)
+ if (indexes[i] == index)
+ return true;
-/*************************************************************************/
+ return false;
+ }
-/**
- * Adds the specified <code>ActionListener</code> to the list of
- * registered listeners for this object.
- *
- * @param listener The listener to add.
- */
-public synchronized void
-addActionListener(ActionListener listener)
-{
- action_listeners = AWTEventMulticaster.add(action_listeners, listener);
-}
+ /**
+ * This method ensures that the item at the specified index is visible.
+ *
+ * @param index The index of the item to be made visible.
+ */
+ public synchronized void makeVisible(int index)
+ throws IllegalArgumentException
+ {
+ visibleIndex = index;
+ if (peer != null)
+ {
+ ListPeer l = (ListPeer) peer;
+ l.makeVisible (index);
+ }
+ }
-/*************************************************************************/
+ /**
+ * Returns the index of the last item that was made visible via the
+ * <code>makeVisible()</code> method.
+ *
+ * @return The index of the last item made visible via the
+ * <code>makeVisible()</code> method.
+ */
+ public int getVisibleIndex()
+ {
+ return visibleIndex;
+ }
-/**
- * Removes the specified <code>ActionListener</code> from the list of
- * registers listeners for this object.
- *
- * @param listener The listener to remove.
- */
-public synchronized void
-removeActionListener(ActionListener listener)
-{
- action_listeners = AWTEventMulticaster.remove(action_listeners, listener);
-}
+ /**
+ * Makes the item at the specified index selected.
+ *
+ * @param index The index of the item to select.
+ */
+ public synchronized void select(int index)
+ {
+ ListPeer lp = (ListPeer) getPeer();
+ if (lp != null)
+ lp.select(index);
+
+ if (selected != null)
+ {
+ boolean found = false;
+ for (int i = 0; i < selected.length; i++)
+ {
+ if (selected[i] == index)
+ found = true;
+ }
+ if (! found)
+ {
+ if (! isMultipleMode())
+ {
+ selected = new int[] { index };
+ return;
+ }
+ int[] temp = new int[selected.length + 1];
+ System.arraycopy(selected, 0, temp, 0, selected.length);
+ temp[selected.length] = index;
+ selected = temp;
+ }
+ }
+ else
+ {
+ selected = new int[1];
+ selected[0] = index;
+ }
+ }
-/*************************************************************************/
+ /**
+ * Makes the item at the specified index not selected.
+ *
+ * @param index The index of the item to unselect.
+ */
+ public synchronized void deselect(int index)
+ {
+ if (isSelected(index))
+ {
+ ListPeer lp = (ListPeer)getPeer();
+ if (lp != null)
+ lp.deselect(index);
+
+ int[] temp = new int[selected.length - 1];
+ for (int i = 0; i < temp.length; i++)
+ {
+ if (selected[i] != index)
+ temp[i] = selected[i];
+ else
+ {
+ System.arraycopy(selected, i + 1, temp, i,
+ selected.length - i - 1);
+ break;
+ }
+ }
+ selected = temp;
+ }
+ }
-/**
- * Adds the specified <code>ItemListener</code> to the list of
- * registered listeners for this object.
- *
- * @param listener The listener to add.
- */
-public synchronized void
-addItemListener(ItemListener listener)
-{
- item_listeners = AWTEventMulticaster.add(item_listeners, listener);
-}
+ /**
+ * Notifies this object to create its native peer.
+ */
+ public void addNotify()
+ {
+ if (peer == null)
+ peer = getToolkit ().createList(this);
+ super.addNotify ();
+ }
-/*************************************************************************/
+ /**
+ * Notifies this object to destroy its native peer.
+ */
+ public void removeNotify()
+ {
+ super.removeNotify();
+ }
-/**
- * Removes the specified <code>ItemListener</code> from the list of
- * registers listeners for this object.
- *
- * @param listener The listener to remove.
- */
-public synchronized void
-removeItemListener(ItemListener listener)
-{
- item_listeners = AWTEventMulticaster.remove(item_listeners, listener);
-}
+ /**
+ * Adds the specified <code>ActionListener</code> to the list of
+ * registered listeners for this object.
+ *
+ * @param listener The listener to add.
+ *
+ * @since 1.1
+ */
+ public synchronized void addActionListener(ActionListener listener)
+ {
+ action_listeners = AWTEventMulticaster.add(action_listeners, listener);
+ }
-/*************************************************************************/
+ /**
+ * Removes the specified <code>ActionListener</code> from the list of
+ * registers listeners for this object.
+ *
+ * @param listener The listener to remove.
+ *
+ * @since 1.1
+ */
+ public synchronized void removeActionListener(ActionListener listener)
+ {
+ action_listeners = AWTEventMulticaster.remove(action_listeners, listener);
+ }
-/**
- * Processes the specified event for this object. If the event is an
- * instance of <code>ActionEvent</code> then the
- * <code>processActionEvent()</code> method is called. Similarly, if the
- * even is an instance of <code>ItemEvent</code> then the
- * <code>processItemEvent()</code> method is called. Otherwise the
- * superclass method is called to process this event.
- *
- * @param event The event to process.
- */
-protected void
-processEvent(AWTEvent event)
-{
- if (event instanceof ActionEvent)
- processActionEvent((ActionEvent)event);
- else if (event instanceof ItemEvent)
- processItemEvent((ItemEvent)event);
- else
- super.processEvent(event);
-}
+ /**
+ * Adds the specified <code>ItemListener</code> to the list of
+ * registered listeners for this object.
+ *
+ * @param listener The listener to add.
+ *
+ * @since 1.1
+ */
+ public synchronized void addItemListener(ItemListener listener)
+ {
+ item_listeners = AWTEventMulticaster.add(item_listeners, listener);
+ }
-/*************************************************************************/
+ /**
+ * Removes the specified <code>ItemListener</code> from the list of
+ * registers listeners for this object.
+ *
+ * @param listener The listener to remove.
+ *
+ * @since 1.1
+ */
+ public synchronized void removeItemListener(ItemListener listener)
+ {
+ item_listeners = AWTEventMulticaster.remove(item_listeners, listener);
+ }
-/**
- * This method processes the specified event by dispatching it to any
- * registered listeners. Note that this method will only get called if
- * action events are enabled. This will happen automatically if any
- * listeners are added, or it can be done "manually" by calling
- * the <code>enableEvents()</code> method.
- *
- * @param event The event to process.
- */
-protected void
-processActionEvent(ActionEvent event)
-{
- if (action_listeners != null)
- action_listeners.actionPerformed(event);
-}
+ /**
+ * Processes the specified event for this object. If the event is an
+ * instance of <code>ActionEvent</code> then the
+ * <code>processActionEvent()</code> method is called. Similarly, if the
+ * even is an instance of <code>ItemEvent</code> then the
+ * <code>processItemEvent()</code> method is called. Otherwise the
+ * superclass method is called to process this event.
+ *
+ * @param event The event to process.
+ *
+ * @since 1.1
+ */
+ protected void processEvent(AWTEvent event)
+ {
+ if (event instanceof ActionEvent)
+ processActionEvent((ActionEvent)event);
+ else if (event instanceof ItemEvent)
+ processItemEvent((ItemEvent)event);
+ else
+ super.processEvent(event);
+ }
-/*************************************************************************/
+ /**
+ * This method processes the specified event by dispatching it to any
+ * registered listeners. Note that this method will only get called if
+ * action events are enabled. This will happen automatically if any
+ * listeners are added, or it can be done "manually" by calling
+ * the <code>enableEvents()</code> method.
+ *
+ * @param event The event to process.
+ *
+ * @since 1.1
+ */
+ protected void processActionEvent(ActionEvent event)
+ {
+ if (action_listeners != null)
+ action_listeners.actionPerformed(event);
+ }
-/**
- * This method processes the specified event by dispatching it to any
- * registered listeners. Note that this method will only get called if
- * item events are enabled. This will happen automatically if any
- * listeners are added, or it can be done "manually" by calling
- * the <code>enableEvents()</code> method.
- *
- * @param event The event to process.
- */
-protected void
-processItemEvent(ItemEvent event)
-{
- if (item_listeners != null)
- item_listeners.itemStateChanged(event);
-}
+ /**
+ * This method processes the specified event by dispatching it to any
+ * registered listeners. Note that this method will only get called if
+ * item events are enabled. This will happen automatically if any
+ * listeners are added, or it can be done "manually" by calling
+ * the <code>enableEvents()</code> method.
+ *
+ * @param event The event to process.
+ *
+ * @since 1.1
+ */
+ protected void processItemEvent(ItemEvent event)
+ {
+ if (item_listeners != null)
+ item_listeners.itemStateChanged(event);
+ }
-void
-dispatchEventImpl(AWTEvent e)
-{
- if (e.id <= ItemEvent.ITEM_LAST
- && e.id >= ItemEvent.ITEM_FIRST
- && (item_listeners != null
- || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0))
- processEvent(e);
- else if (e.id <= ActionEvent.ACTION_LAST
+ void dispatchEventImpl(AWTEvent e)
+ {
+ if (e.id <= ItemEvent.ITEM_LAST
+ && e.id >= ItemEvent.ITEM_FIRST
+ && (item_listeners != null
+ || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0))
+ processEvent(e);
+ else if (e.id <= ActionEvent.ACTION_LAST
&& e.id >= ActionEvent.ACTION_FIRST
&& (action_listeners != null
- || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0))
- processEvent(e);
- else
- super.dispatchEventImpl(e);
-}
-
-/*************************************************************************/
+ || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0))
+ processEvent(e);
+ else
+ super.dispatchEventImpl(e);
+ }
-/**
- * Returns a debugging string for this object.
- *
- * @return A debugging string for this object.
- */
-protected String
-paramString()
-{
- return "multiple=" + multipleMode + ",rows=" + rows + super.paramString();
-}
+ /**
+ * Returns a debugging string for this object.
+ *
+ * @return A debugging string for this object.
+ */
+ protected String paramString()
+ {
+ return "multiple=" + multipleMode + ",rows=" + rows + super.paramString();
+ }
/**
* Returns an array of all the objects currently registered as FooListeners
@@ -1061,12 +988,14 @@ paramString()
*
* @exception ClassCastException If listenerType doesn't specify a class or
* interface that implements java.util.EventListener.
+ *
+ * @since 1.3
*/
- public EventListener[] getListeners (Class listenerType)
+ public <T extends EventListener> T[] getListeners (Class<T> listenerType)
{
if (listenerType == ActionListener.class)
return AWTEventMulticaster.getListeners (action_listeners, listenerType);
-
+
if (listenerType == ItemListener.class)
return AWTEventMulticaster.getListeners (item_listeners, listenerType);
@@ -1075,6 +1004,8 @@ paramString()
/**
* Returns all action listeners registered to this object.
+ *
+ * @since 1.4
*/
public ActionListener[] getActionListeners ()
{
@@ -1083,6 +1014,8 @@ paramString()
/**
* Returns all action listeners registered to this object.
+ *
+ * @since 1.4
*/
public ItemListener[] getItemListeners ()
{
diff --git a/libjava/classpath/java/awt/Menu.java b/libjava/classpath/java/awt/Menu.java
index f900d929574..cef04a38e1a 100644
--- a/libjava/classpath/java/awt/Menu.java
+++ b/libjava/classpath/java/awt/Menu.java
@@ -54,38 +54,28 @@ import javax.accessibility.AccessibleRole;
public class Menu extends MenuItem implements MenuContainer, Serializable
{
-/*
- * Static Variables
- */
-
-/**
- * The number used to generate the name returned by getName.
- */
-private static transient long next_menu_number;
-
-// Serialization Constant
-private static final long serialVersionUID = -8809584163345499784L;
-
-/*************************************************************************/
+ /**
+ * The number used to generate the name returned by getName.
+ */
+ private static transient long next_menu_number;
-/*
- * Instance Variables
- */
+ // Serialization Constant
+ private static final long serialVersionUID = -8809584163345499784L;
-/**
- * @serial The actual items in the menu
- */
-private Vector items = new Vector();
+ /**
+ * @serial The actual items in the menu
+ */
+ private Vector items = new Vector();
-/**
- * @serial Flag indicating whether or not this menu is a tear off
- */
-private boolean tearOff;
+ /**
+ * @serial Flag indicating whether or not this menu is a tear off
+ */
+ private boolean tearOff;
-/**
- * @serial Indicates whether or not this is a help menu.
- */
-private boolean isHelpMenu;
+ /**
+ * @serial Indicates whether or not this is a help menu.
+ */
+ private boolean isHelpMenu;
/*
* @serial Unused in this implementation, but present in Sun's
@@ -93,371 +83,316 @@ private boolean isHelpMenu;
*/
private int menuSerializedDataVersion = 1;
-static final transient String separatorLabel = "-";
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>Menu</code> with no label and that
- * is not a tearoff;
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-Menu()
-{
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Menu</code> that is not a tearoff and
- * that has the specified label.
- *
- * @param label The menu label.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-Menu(String label)
-{
- this(label, false);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Menu</code> with the specified
- * label and tearoff status.
- *
- * @param label The label for this menu
- * @param isTearOff <code>true</code> if this menu is a tear off menu,
- * <code>false</code> otherwise.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
- */
-public
-Menu(String label, boolean isTearOff)
-{
- super(label);
+ static final transient String separatorLabel = "-";
- tearOff = isTearOff;
+ /**
+ * Initializes a new instance of <code>Menu</code> with no label and that
+ * is not a tearoff;
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
+ */
+ public Menu()
+ {
+ }
- if (label.equals("Help"))
- isHelpMenu = true;
+ /**
+ * Initializes a new instance of <code>Menu</code> that is not a tearoff and
+ * that has the specified label.
+ *
+ * @param label The menu label.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
+ */
+ public Menu(String label)
+ {
+ this(label, false);
+ }
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
-}
+ /**
+ * Initializes a new instance of <code>Menu</code> with the specified
+ * label and tearoff status.
+ *
+ * @param label The label for this menu
+ * @param isTearOff <code>true</code> if this menu is a tear off menu,
+ * <code>false</code> otherwise.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
+ */
+ public Menu(String label, boolean isTearOff)
+ {
+ super(label);
-/*************************************************************************/
+ tearOff = isTearOff;
-/*
- * Instance Methods
- */
+ if (label.equals("Help"))
+ isHelpMenu = true;
-/**
- * Tests whether or not this menu is a tearoff.
- *
- * @return <code>true</code> if this menu is a tearoff, <code>false</code>
- * otherwise.
- */
-public boolean
-isTearOff()
-{
- return(tearOff);
-}
+ if (GraphicsEnvironment.isHeadless())
+ throw new HeadlessException();
+ }
-/*************************************************************************/
+ /**
+ * Tests whether or not this menu is a tearoff.
+ *
+ * @return <code>true</code> if this menu is a tearoff, <code>false</code>
+ * otherwise.
+ */
+ public boolean isTearOff()
+ {
+ return(tearOff);
+ }
-/**
- * Returns the number of items in this menu.
- *
- * @return The number of items in this menu.
- */
-public int
-getItemCount()
-{
- return countItems ();
-}
+ /**
+ * Returns the number of items in this menu.
+ *
+ * @return The number of items in this menu.
+ */
+ public int getItemCount()
+ {
+ return countItems();
+ }
-/**
- * Returns the number of items in this menu.
- *
- * @return The number of items in this menu.
- *
- * @deprecated As of JDK 1.1, replaced by getItemCount().
- */
-public int countItems ()
-{
- return items.size ();
-}
+ /**
+ * Returns the number of items in this menu.
+ *
+ * @return The number of items in this menu.
+ *
+ * @deprecated As of JDK 1.1, replaced by getItemCount().
+ */
+ public int countItems()
+ {
+ return items.size();
+ }
-/*************************************************************************/
-
-/**
- * Returns the item at the specified index.
- *
- * @return The item at the specified index.
- *
- * @exception ArrayIndexOutOfBoundsException If the index value is not valid.
- */
-public MenuItem
-getItem(int index)
-{
- return((MenuItem)items.elementAt(index));
-}
-
-/*************************************************************************/
-
-/**
- * Adds the specified item to this menu. If it was previously part of
- * another menu, it is first removed from that menu.
- *
- * @param item The new item to add.
- *
- * @return The item that was added.
- */
-public MenuItem
-add(MenuItem item)
-{
- MenuContainer parent = item.getParent();
- if (parent != null)
- parent.remove(item);
-
- items.addElement(item);
- item.setParent(this);
+ /**
+ * Returns the item at the specified index.
+ *
+ * @param index the item index.
+ *
+ * @return The item at the specified index.
+ *
+ * @exception ArrayIndexOutOfBoundsException If the index value is not valid.
+ */
+ public MenuItem getItem(int index)
+ {
+ return((MenuItem) items.elementAt(index));
+ }
- if (peer != null)
- {
- item.addNotify();
- MenuPeer mp = (MenuPeer) peer;
- mp.addItem(item);
- }
+ /**
+ * Adds the specified item to this menu. If it was previously part of
+ * another menu, it is first removed from that menu.
+ *
+ * @param item The new item to add.
+ *
+ * @return The item that was added.
+ */
+ public MenuItem add(MenuItem item)
+ {
+ MenuContainer parent = item.getParent();
+ if (parent != null)
+ parent.remove(item);
- return item;
-}
+ items.addElement(item);
+ item.setParent(this);
-/*************************************************************************/
+ if (peer != null)
+ {
+ item.addNotify();
+ MenuPeer mp = (MenuPeer) peer;
+ mp.addItem(item);
+ }
-/**
- * Add an item with the specified label to this menu.
- *
- * @param label The label of the menu item to add.
- */
-public void
-add(String label)
-{
- add(new MenuItem(label));
-}
-
-/*************************************************************************/
-
-/**
- * Inserts the specified menu item into this menu at the specified index.
- *
- * @param item The menu item to add.
- * @param index The index of the menu item.
- *
- * @exception IllegalArgumentException If the index is less than zero.
- * @exception ArrayIndexOutOfBoundsException If the index is otherwise invalid.
- */
-public void
-insert(MenuItem item, int index)
-{
- if (index < 0)
- throw new IllegalArgumentException("Index is less than zero");
+ return item;
+ }
- int count = getItemCount ();
+ /**
+ * Add an item with the specified label to this menu.
+ *
+ * @param label The label of the menu item to add.
+ */
+ public void add(String label)
+ {
+ add(new MenuItem(label));
+ }
- if (index >= count)
- add(item);
- else
- {
- MenuContainer parent = item.getParent();
- if (parent != null)
- parent.remove(item);
+ /**
+ * Inserts the specified menu item into this menu at the specified index. If
+ * the index is greater than or equal to the number of items already in the
+ * menu, the new item is added as the last item in the menu.
+ *
+ * @param item The menu item to add (<code>null</code> not permitted).
+ * @param index The index of the menu item (>= 0).
+ *
+ * @throws IllegalArgumentException if the index is less than zero.
+ * @throws NullPointerException if <code>item</code> is <code>null</code>.
+ */
+ public void insert(MenuItem item, int index)
+ {
+ if (index < 0)
+ throw new IllegalArgumentException("Index is less than zero");
+
+ int count = getItemCount();
+
+ if (index >= count)
+ add(item);
+ else
+ {
+ MenuContainer parent = item.getParent();
+ if (parent != null)
+ parent.remove(item);
- items.insertElementAt(item, index);
- item.setParent(this);
-
- MenuPeer peer = (MenuPeer) getPeer();
- if (peer == null)
- return;
+ items.insertElementAt(item, index);
+ item.setParent(this);
- for (int i = count - 1; i >= index; i--)
- peer.delItem(i);
+ MenuPeer peer = (MenuPeer) getPeer();
+ if (peer == null)
+ return;
- item.addNotify();
- peer.addItem(item);
+ for (int i = count - 1; i >= index; i--)
+ peer.delItem(i);
- for (int i = index; i < count; i++)
- peer.addItem((MenuItem) items.elementAt (i));
- }
-
-}
+ item.addNotify();
+ peer.addItem(item);
-/*************************************************************************/
+ // bear in mind that count is the number of items *before* the new
+ // item was added
+ for (int i = index + 1; i <= count; i++)
+ peer.addItem((MenuItem) items.elementAt(i));
+ }
-/**
- * Inserts an item with the specified label into this menu at the specified index.
- *
- * @param label The label of the item to add.
- * @param index The index of the menu item.
- *
- * @exception IllegalArgumentException If the index is less than zero.
- * @exception ArrayIndexOutOfBoundsException If the index is otherwise invalid.
- */
-public void
-insert(String label, int index)
-{
- insert(new MenuItem(label), index);
-}
-
-/*************************************************************************/
-
-/**
- * Adds a separator bar at the current menu location.
- */
-public void
-addSeparator()
-{
- add(new MenuItem(separatorLabel));
-}
-
-/*************************************************************************/
-
-/**
- * Inserts a separator bar at the specified index value.
- *
- * @param index The index at which to insert a separator bar.
- *
- * @exception IllegalArgumentException If the index is less than zero.
- * @exception ArrayIndexOutOfBoundsException If the index is otherwise invalid.
- */
-public void
-insertSeparator(int index)
-{
- insert(new MenuItem(separatorLabel), index);
-}
+ }
-/*************************************************************************/
+ /**
+ * Inserts an item with the specified label into this menu at the specified
+ * index. If the index is greater than or equal to the number of items
+ * already in the menu, the new item is added as the last item in the menu.
+ *
+ * @param label The label of the item to add.
+ * @param index The index of the menu item (>= 0).
+ *
+ * @throws IllegalArgumentException If the index is less than zero.
+ */
+ public void insert(String label, int index)
+ {
+ insert(new MenuItem(label), index);
+ }
-/**
- * Deletes the item at the specified index from this menu.
- *
- * @param index The index of the item to remove.
- *
- * @exception ArrayIndexOutOfBoundsException If the index is otherwise invalid.
- */
-public synchronized void
-remove(int index)
-{
- MenuItem item = (MenuItem) items.remove(index);
+ /**
+ * Adds a separator bar at the current menu location.
+ */
+ public void addSeparator()
+ {
+ add(new MenuItem(separatorLabel));
+ }
- MenuPeer mp = (MenuPeer) getPeer();
- if (mp != null)
- {
- mp.delItem(index);
- item.removeNotify();
- }
- item.setParent(null);
-}
+ /**
+ * Inserts a separator bar at the specified index value.
+ *
+ * @param index The index at which to insert a separator bar.
+ *
+ * @exception IllegalArgumentException If the index is less than zero.
+ * @exception ArrayIndexOutOfBoundsException If the index is otherwise invalid.
+ */
+ public void insertSeparator(int index)
+ {
+ insert(new MenuItem(separatorLabel), index);
+ }
-/*************************************************************************/
+ /**
+ * Deletes the item at the specified index from this menu.
+ *
+ * @param index The index of the item to remove.
+ *
+ * @exception ArrayIndexOutOfBoundsException If the index is otherwise invalid.
+ */
+ public synchronized void remove(int index)
+ {
+ MenuItem item = (MenuItem) items.remove(index);
+
+ MenuPeer mp = (MenuPeer) getPeer();
+ if (mp != null)
+ {
+ mp.delItem(index);
+ item.removeNotify();
+ }
+ item.setParent(null);
+ }
-/**
- * Removes the specifed item from the menu. If the specified component
- * does not exist, this method does nothing.
- *
- * @param item The component to remove.
- */
-public void
-remove(MenuComponent item)
-{
- int index = items.indexOf(item);
- if (index == -1)
- return;
+ /**
+ * Removes the specifed item from the menu. If the specified component
+ * does not exist, this method does nothing.
+ *
+ * @param item The component to remove.
+ */
+ public void remove(MenuComponent item)
+ {
+ int index = items.indexOf(item);
+ if (index == -1)
+ return;
- remove(index);
-}
+ remove(index);
+ }
-/*************************************************************************/
+ /**
+ * Removes all the elements from this menu.
+ */
+ public synchronized void removeAll()
+ {
+ int count = getItemCount();
+ for(int i = 0; i < count; i++)
+ {
+ // We must always remove item 0.
+ remove(0);
+ }
+ }
-/**
- * Removes all the elements from this menu.
- */
-public synchronized void
-removeAll()
-{
- int count = getItemCount();
- for(int i = 0; i < count; i++)
+ /**
+ * Creates the native peer for this object.
+ */
+ public void addNotify()
+ {
+ MenuPeer peer = (MenuPeer) getPeer();
+ if (peer == null)
+ {
+ peer = getToolkit().createMenu(this);
+ setPeer(peer);
+ }
+
+ Enumeration e = items.elements();
+ while (e.hasMoreElements())
{
- // We must always remove item 0.
- remove(0);
+ MenuItem mi = (MenuItem)e.nextElement();
+ mi.addNotify();
+ peer.addItem(mi);
}
-}
-/*************************************************************************/
+ super.addNotify();
+ }
-/**
- * Creates the native peer for this object.
- */
-public void
-addNotify()
-{
- MenuPeer peer = (MenuPeer) getPeer();
- if (peer == null)
+ /**
+ * Destroys the native peer for this object.
+ */
+ public void removeNotify()
+ {
+ Enumeration e = items.elements();
+ while (e.hasMoreElements())
{
- peer = getToolkit().createMenu(this);
- setPeer(peer);
+ MenuItem mi = (MenuItem) e.nextElement();
+ mi.removeNotify();
}
-
- Enumeration e = items.elements();
- while (e.hasMoreElements())
- {
- MenuItem mi = (MenuItem)e.nextElement();
- mi.addNotify();
- peer.addItem(mi);
+ super.removeNotify();
}
- super.addNotify ();
-}
-
-/*************************************************************************/
-
-/**
- * Destroys the native peer for this object.
- */
-public void
-removeNotify()
-{
- Enumeration e = items.elements();
- while (e.hasMoreElements())
+ /**
+ * Returns a debugging string for this menu.
+ *
+ * @return A debugging string for this menu.
+ */
+ public String paramString()
{
- MenuItem mi = (MenuItem) e.nextElement();
- mi.removeNotify();
+ return (",tearOff=" + tearOff + ",isHelpMenu=" + isHelpMenu
+ + super.paramString());
}
- super.removeNotify();
-}
-
-/*************************************************************************/
-
-/**
- * Returns a debugging string for this menu.
- *
- * @return A debugging string for this menu.
- */
-public String
-paramString()
-{
- return (",tearOff=" + tearOff + ",isHelpMenu=" + isHelpMenu
- + super.paramString());
-}
/**
* Basic Accessibility class for Menu. Details get provided in derived
diff --git a/libjava/classpath/java/awt/MenuBar.java b/libjava/classpath/java/awt/MenuBar.java
index bd658cde6e3..6737d0419f2 100644
--- a/libjava/classpath/java/awt/MenuBar.java
+++ b/libjava/classpath/java/awt/MenuBar.java
@@ -272,7 +272,7 @@ public class MenuBar extends MenuComponent
*
* @return a list of all shortcuts for the menus in this menu bar
*/
- public synchronized Enumeration shortcuts()
+ public synchronized Enumeration<MenuShortcut> shortcuts()
{
Vector shortcuts = new Vector();
Enumeration e = menus.elements();
diff --git a/libjava/classpath/java/awt/MenuItem.java b/libjava/classpath/java/awt/MenuItem.java
index 7cbc9219f54..b80ee4c1a5e 100644
--- a/libjava/classpath/java/awt/MenuItem.java
+++ b/libjava/classpath/java/awt/MenuItem.java
@@ -523,11 +523,11 @@ removeActionListener(ActionListener l)
* ClassClassException is thrown.
* @since 1.3
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
if (listenerType == ActionListener.class)
- return getActionListeners();
- return (EventListener[]) Array.newInstance(listenerType, 0);
+ return (T[]) getActionListeners();
+ return (T[]) Array.newInstance(listenerType, 0);
}
/*************************************************************************/
diff --git a/libjava/classpath/java/awt/MenuShortcut.java b/libjava/classpath/java/awt/MenuShortcut.java
index adfd1d3187a..259cbf1ae98 100644
--- a/libjava/classpath/java/awt/MenuShortcut.java
+++ b/libjava/classpath/java/awt/MenuShortcut.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package java.awt;
+import java.awt.event.KeyEvent;
+
/**
* This class implements a keyboard accelerator for a menu item.
*
@@ -70,6 +72,8 @@ private int key;
*/
private boolean usesShift;
+private String keyName;
+
/*************************************************************************/
/**
@@ -99,6 +103,7 @@ MenuShortcut(int key, boolean usesShift)
{
this.key = key;
this.usesShift = usesShift;
+ setKeyName(key);
}
/*************************************************************************/
@@ -181,7 +186,11 @@ equals(Object obj)
public String
toString()
{
- return(getClass().getName() + "[" + paramString () + "]");
+ String temp = "Ctrl+";
+ if (usesShift)
+ temp = temp + "Shift+";
+ temp = temp + keyName;
+ return temp;
}
public int
@@ -204,4 +213,224 @@ paramString()
return "key=" + key + ",usesShift=" + usesShift;
}
-} // class MenuShortcut
+private void
+setKeyName(int key)
+{
+ if (key == '\n')
+ keyName = "Enter";
+ else if (key == '\b')
+ keyName = "Backspace";
+ else if (key == '\t')
+ keyName = "Tab";
+ else if (key == ' ')
+ keyName = "Space";
+ else if (key == ',')
+ keyName = "Comma";
+ else if (key == '.')
+ keyName = "Period";
+ else if (key == '/')
+ keyName = "Slash";
+ else if (key == '\\')
+ keyName = "Back Slash";
+ else if (key == ';')
+ keyName = "Semicolon";
+ else if (key == '=')
+ keyName = "Equals";
+ else if (key == '[')
+ keyName = "Open Bracket";
+ else if (key == ']')
+ keyName = "Close Bracket";
+ else if (key == '0')
+ keyName = "0";
+ else if (key == '1')
+ keyName = "1";
+ else if (key == '2')
+ keyName = "2";
+ else if (key == '3')
+ keyName = "3";
+ else if (key == '4')
+ keyName = "4";
+ else if (key == '5')
+ keyName = "5";
+ else if (key == '6')
+ keyName = "6";
+ else if (key == '7')
+ keyName = "7";
+ else if (key == '8')
+ keyName = "8";
+ else if (key == '9')
+ keyName = "9";
+ else if (key == 'A')
+ keyName = "A";
+ else if (key == 'B')
+ keyName = "B";
+ else if (key == 'C')
+ keyName = "C";
+ else if (key == 'D')
+ keyName = "D";
+ else if (key == 'E')
+ keyName = "E";
+ else if (key == 'F')
+ keyName = "F";
+ else if (key == 'G')
+ keyName = "G";
+ else if (key == 'H')
+ keyName = "H";
+ else if (key == 'I')
+ keyName = "I";
+ else if (key == 'J')
+ keyName = "J";
+ else if (key == 'K')
+ keyName = "K";
+ else if (key == 'L')
+ keyName = "L";
+ else if (key == 'M')
+ keyName = "M";
+ else if (key == 'N')
+ keyName = "N";
+ else if (key == 'O')
+ keyName = "O";
+ else if (key == 'P')
+ keyName = "P";
+ else if (key == 'Q')
+ keyName = "Q";
+ else if (key == 'R')
+ keyName = "R";
+ else if (key == 'S')
+ keyName = "S";
+ else if (key == 'T')
+ keyName = "T";
+ else if (key == 'U')
+ keyName = "U";
+ else if (key == 'V')
+ keyName = "V";
+ else if (key == 'W')
+ keyName = "W";
+ else if (key == 'X')
+ keyName = "X";
+ else if (key == 'Y')
+ keyName = "Y";
+ else if (key == 'Z')
+ keyName = "Z";
+ else if (key == 3)
+ keyName = "Cancel";
+ else if (key == 12)
+ keyName = "Clear";
+ else if (key == 16)
+ keyName = "Shift";
+ else if (key == 17)
+ keyName = "Ctrl";
+ else if (key == 18)
+ keyName = "Alt";
+ else if (key == 19)
+ keyName = "Pause";
+ else if (key == 20)
+ keyName = "Caps Lock";
+ else if (key == 21)
+ keyName = "Kana";
+ else if (key == 24)
+ keyName = "Final";
+ else if (key == 25)
+ keyName = "Kanji";
+ else if (key == 27)
+ keyName = "Escape";
+ else if (key == 28)
+ keyName = "Convert";
+ else if (key == 29)
+ keyName = "No Convert";
+ else if (key == 30)
+ keyName = "Accept";
+ else if (key == 31)
+ keyName = "Mode Change";
+ else if (key == 33)
+ keyName = "Page Up";
+ else if (key == 34)
+ keyName = "Page Down";
+ else if (key == 35)
+ keyName = "End";
+ else if (key == 36)
+ keyName = "Home";
+ else if (key == 37)
+ keyName = "Left";
+ else if (key == 38)
+ keyName = "Up";
+ else if (key == 39)
+ keyName = "Right";
+ else if (key == 40)
+ keyName = "Down";
+ else if (key == 96)
+ keyName = "NumPad-0";
+ else if (key == 97)
+ keyName = "NumPad-1";
+ else if (key == 98)
+ keyName = "NumPad-2";
+ else if (key == 99)
+ keyName = "NumPad-3";
+ else if (key == 100)
+ keyName = "NumPad-4";
+ else if (key == 101)
+ keyName = "NumPad-5";
+ else if (key == 102)
+ keyName = "NumPad-6";
+ else if (key == 103)
+ keyName = "NumPad-7";
+ else if (key == 104)
+ keyName = "NumPad-8";
+ else if (key == 105)
+ keyName = "NumPad-9";
+ else if (key == 106)
+ keyName = "NumPad *";
+ else if (key == 107)
+ keyName = "NumPad +";
+ else if (key == 108)
+ keyName = "NumPad ,";
+ else if (key == 109)
+ keyName = "NumPad -";
+ else if (key == 110)
+ keyName = "NumPad .";
+ else if (key == 111)
+ keyName = "NumPad /";
+ else if (key == 112)
+ keyName = "F1";
+ else if (key == 113)
+ keyName = "F2";
+ else if (key == 114)
+ keyName = "F3";
+ else if (key == 115)
+ keyName = "F4";
+ else if (key == 116)
+ keyName = "F5";
+ else if (key == 117)
+ keyName = "F6";
+ else if (key == 118)
+ keyName = "F7";
+ else if (key == 119)
+ keyName = "F8";
+ else if (key == 120)
+ keyName = "F9";
+ else if (key == 121)
+ keyName = "F10";
+ else if (key == 122)
+ keyName = "F11";
+ else if (key == 123)
+ keyName = "F12";
+ else if (key == 127)
+ keyName = "Delete";
+ else if (key == 144)
+ keyName = "Num Lock";
+ else if (key == 145)
+ keyName = "Scroll Lock";
+ else if (key == 154)
+ keyName = "Print Screen";
+ else if (key == 155)
+ keyName = "Insert";
+ else if (key == 156)
+ keyName = "Help";
+ else if (key == 157)
+ keyName = "Meta";
+ else if (key == 192)
+ keyName = "Back Quote";
+ else if (key == 222)
+ keyName = "Quote";
+}
+} // class MenuShortcut
diff --git a/libjava/classpath/java/awt/Rectangle.java b/libjava/classpath/java/awt/Rectangle.java
index c4ba6ba1488..ac2494ee078 100644
--- a/libjava/classpath/java/awt/Rectangle.java
+++ b/libjava/classpath/java/awt/Rectangle.java
@@ -1,5 +1,5 @@
/* Rectangle.java -- represents a graphics rectangle
- Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation
+ Copyright (C) 1999, 2000, 2001, 2002, 2006, Free Software Foundation
This file is part of GNU Classpath.
@@ -119,7 +119,6 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
* coordinates of the specified rectangle.
*
* @param r the rectangle to copy from
- * @throws NullPointerException if r is null
* @since 1.1
*/
public Rectangle(Rectangle r)
@@ -168,7 +167,6 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*
* @param p the upper left corner of the rectangle
* @param d the width and height of the rectangle
- * @throws NullPointerException if p or d is null
*/
public Rectangle(Point p, Dimension d)
{
@@ -185,7 +183,7 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
* @param p the upper left corner of the rectangle
*/
public Rectangle(Point p)
- {
+ {
x = p.x;
y = p.y;
}
@@ -198,7 +196,7 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
* @param d the width and height of the rectangle
*/
public Rectangle(Dimension d)
- {
+ {
width = d.width;
height = d.height;
}
@@ -299,8 +297,10 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
}
/**
- * Updates this rectangle to have the specified dimensions, as rounded to
- * integers.
+ * Updates this rectangle to have the specified dimensions, rounded to the
+ * integer precision used by this class (the values are rounded "outwards" so
+ * that the stored rectangle completely encloses the specified double
+ * precision rectangle).
*
* @param x the new X coordinate of the upper left hand corner
* @param y the new Y coordinate of the upper left hand corner
@@ -310,10 +310,10 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public void setRect(double x, double y, double width, double height)
{
- this.x = (int) x;
- this.y = (int) y;
- this.width = (int) width;
- this.height = (int) height;
+ this.x = (int) Math.floor(x);
+ this.y = (int) Math.floor(y);
+ this.width = (int) Math.ceil(x + width) - this.x;
+ this.height = (int) Math.ceil(y + height) - this.y;
}
/**
diff --git a/libjava/classpath/java/awt/RenderingHints.java b/libjava/classpath/java/awt/RenderingHints.java
index 0e1db72b75f..ce327e36947 100644
--- a/libjava/classpath/java/awt/RenderingHints.java
+++ b/libjava/classpath/java/awt/RenderingHints.java
@@ -54,7 +54,8 @@ import java.util.Set;
* @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
* @author Eric Blake (ebb9@email.byu.edu)
*/
-public class RenderingHints implements Map, Cloneable
+public class RenderingHints
+ implements Map<Object,Object>, Cloneable
{
/**
* The base class used to represent keys.
@@ -550,7 +551,7 @@ public class RenderingHints implements Map, Cloneable
* @param init a map containing a collection of hints (<code>null</code>
* permitted).
*/
- public RenderingHints(Map init)
+ public RenderingHints(Map<Key,?> init)
{
if (init != null)
putAll(init);
@@ -704,7 +705,7 @@ public class RenderingHints implements Map, Cloneable
* @throws IllegalArgumentException if the map contains a value that is
* not compatible with its key.
*/
- public void putAll(Map m)
+ public void putAll(Map<?,?> m)
{
// preprocess map to generate appropriate exceptions
Iterator iterator = m.keySet().iterator();
@@ -723,7 +724,7 @@ public class RenderingHints implements Map, Cloneable
*
* @return A set of keys.
*/
- public Set keySet()
+ public Set<Object> keySet()
{
return hintMap.keySet();
}
@@ -735,7 +736,7 @@ public class RenderingHints implements Map, Cloneable
*
* @return A collection of values.
*/
- public Collection values()
+ public Collection<Object> values()
{
return hintMap.values();
}
@@ -745,7 +746,7 @@ public class RenderingHints implements Map, Cloneable
*
* @return A set of entries.
*/
- public Set entrySet()
+ public Set<Map.Entry<Object,Object>> entrySet()
{
return Collections.unmodifiableSet(hintMap.entrySet());
}
diff --git a/libjava/classpath/java/awt/ScrollPane.java b/libjava/classpath/java/awt/ScrollPane.java
index 65ce484b88d..ec9746f9339 100644
--- a/libjava/classpath/java/awt/ScrollPane.java
+++ b/libjava/classpath/java/awt/ScrollPane.java
@@ -338,10 +338,15 @@ getVScrollbarWidth()
* Returns the current scroll position of the viewport.
*
* @return The current scroll position of the viewport.
+ *
+ * @throws NullPointerException if the scrollpane does have a child.
*/
public Point
getScrollPosition()
{
+ if (getComponentCount() == 0)
+ throw new NullPointerException();
+
int x = 0;
int y = 0;
@@ -380,20 +385,35 @@ setScrollPosition(Point scrollPosition) throws IllegalArgumentException
* @param x The new X coordinate of the scroll position.
* @param y The new Y coordinate of the scroll position.
*
+ * @throws NullPointerException if scrollpane does not have a child.
+ *
* @exception IllegalArgumentException If the specified value is outside
* the legal scrolling range.
*/
public void
setScrollPosition(int x, int y)
{
+ if (getComponentCount() == 0)
+ throw new NullPointerException("child is null");
+
+ if (x > (int) (getComponent(0).getWidth() - getViewportSize().getWidth()))
+ x = (int) (getComponent(0).getWidth() - getViewportSize().getWidth());
+ if (y > (int) (getComponent(0).getHeight() - getViewportSize().getHeight()))
+ y = (int) (getComponent(0).getHeight() - getViewportSize().getHeight());
+
+ if (x < 0)
+ x = 0;
+ if (y < 0)
+ y = 0;
+
Adjustable h = getHAdjustable();
Adjustable v = getVAdjustable();
-
+
if (h != null)
h.setValue(x);
if (v != null)
v.setValue(y);
-
+
ScrollPanePeer spp = (ScrollPanePeer)getPeer();
if (spp != null)
spp.setScrollPosition(x, y);
@@ -414,7 +434,7 @@ addNotify()
super.addNotify();
Component[] list = getComponents();
- if (list != null && list.length > 0 && ! (list[0] instanceof Panel))
+ if (list != null && list.length > 0 && list[0].isLightweight())
{
Panel panel = new Panel();
panel.setLayout(new BorderLayout());
@@ -453,9 +473,7 @@ removeNotify()
if ((list != null) && (list.length > 0))
remove(list[0]);
- super.addImpl(component, constraints, -1);
-
- doLayout();
+ super.addImpl(component, constraints, index);
}
/*************************************************************************/
@@ -507,6 +525,8 @@ layout()
p.y = dim.height;
setScrollPosition (p);
+
+ list[0].setLocation(new Point());
}
}
@@ -518,11 +538,12 @@ layout()
* not have layout managers.
*
* @param layoutManager Ignored
+ * @throws AWTError Always throws this error when called.
*/
public final void
setLayout(LayoutManager layoutManager)
{
- return;
+ throw new AWTError("ScrollPane controls layout");
}
/*************************************************************************/
@@ -553,16 +574,37 @@ paramString()
+ getX() + ","
+ getY() + ","
+ getWidth() + "x" + getHeight() + ","
- + "ScrollPosition=(" + scrollPosition.getX() + ","
- + scrollPosition.getY() + "),"
+ + getIsValidString() + ","
+ + "ScrollPosition=(" + scrollPosition.x + ","
+ + scrollPosition.y + "),"
+ "Insets=(" + insets.top + ","
+ insets.left + ","
+ insets.bottom + ","
+ insets.right + "),"
- + "ScrollbarDisplayPolicy=" + getScrollbarDisplayPolicy() + ","
+ + "ScrollbarDisplayPolicy=" + getScrollbarDisplayPolicyString() + ","
+ "wheelScrollingEnabled=" + isWheelScrollingEnabled();
}
+private String
+getScrollbarDisplayPolicyString()
+{
+ if (getScrollbarDisplayPolicy() == 0)
+ return "as-needed";
+ else if (getScrollbarDisplayPolicy() == 1)
+ return "always";
+ else
+ return "never";
+}
+
+private String
+getIsValidString()
+{
+ if (isValid())
+ return "valid";
+ else
+ return "invalid";
+}
+
/**
* Tells whether or not an event is enabled.
*
diff --git a/libjava/classpath/java/awt/ScrollPaneAdjustable.java b/libjava/classpath/java/awt/ScrollPaneAdjustable.java
index 21b58c36ede..ca61801bf51 100644
--- a/libjava/classpath/java/awt/ScrollPaneAdjustable.java
+++ b/libjava/classpath/java/awt/ScrollPaneAdjustable.java
@@ -145,14 +145,26 @@ public class ScrollPaneAdjustable
this.blockIncrement = blockIncrement;
}
- public void setMaximum (int maximum)
+ /**
+ * This method should never be called.
+ *
+ * @param maximum The maximum value to be set.
+ * @throws AWTError Always throws this error when called.
+ */
+ public void setMaximum (int maximum) throws AWTError
{
- this.maximum = maximum;
+ throw new AWTError("Can be set by scrollpane only");
}
+ /**
+ * This method should never be called.
+ *
+ * @param minimum The minimum value to be set.
+ * @throws AWTError Always throws this error when called.
+ */
public void setMinimum (int minimum)
{
- this.minimum = minimum;
+ throw new AWTError("Can be set by scrollpane only");
}
public void setUnitIncrement (int unitIncrement)
@@ -171,20 +183,36 @@ public class ScrollPaneAdjustable
maximum = value;
}
+ /**
+ * This method should never be called.
+ *
+ * @param visibleAmount The visible amount to be set.
+ * @throws AWTError Always throws this error when called.
+ */
public void setVisibleAmount (int visibleAmount)
{
- this.visibleAmount = visibleAmount;
+ throw new AWTError("Can be set by scrollpane only");
}
public String paramString ()
{
- return ("scrollpane=" + sp + ", orientation=" + orientation
- + ", value=" + value + ", minimum=" + minimum
- + ", maximum=" + maximum + ", visibleAmount=" + visibleAmount
- + ", unitIncrement=" + unitIncrement
- + ", blockIncrement=" + blockIncrement);
+ return paramStringHelper()
+ + ",[" + getMinimum() + ".." + getMaximum()
+ + "],val=" + getValue()
+ + ",vis=" + getVisibleAmount()
+ + ",unit=" + getUnitIncrement()
+ + ",block=" + getBlockIncrement()
+ + ",isAdjusting=" + valueIsAdjusting;
}
+ private String paramStringHelper()
+ {
+ if (getOrientation() == HORIZONTAL)
+ return "horizontal";
+ else
+ return "vertical";
+ }
+
public String toString()
{
return getClass().getName() + "[" + paramString() + "]";
@@ -209,5 +237,6 @@ public class ScrollPaneAdjustable
{
this.valueIsAdjusting = valueIsAdjusting;
}
+
} // class ScrollPaneAdjustable
diff --git a/libjava/classpath/java/awt/Scrollbar.java b/libjava/classpath/java/awt/Scrollbar.java
index c0788370b21..0cba512f605 100644
--- a/libjava/classpath/java/awt/Scrollbar.java
+++ b/libjava/classpath/java/awt/Scrollbar.java
@@ -341,17 +341,22 @@ public class Scrollbar extends Component implements Accessible, Adjustable
public synchronized void setValues(int value, int visibleAmount,
int minimum, int maximum)
{
- if (maximum < minimum)
- maximum = minimum;
+ if (visibleAmount <= 0)
+ visibleAmount = 1;
+
+ if (maximum <= minimum)
+ maximum = minimum + 1;
if (value < minimum)
value = minimum;
- if (value > maximum)
- value = maximum;
-
if (visibleAmount > maximum - minimum)
visibleAmount = maximum - minimum;
+
+ // According to documentation, the actual maximum
+ // value is (maximum - visibleAmount)
+ if (value > maximum - visibleAmount)
+ value = maximum - visibleAmount;
ScrollbarPeer peer = (ScrollbarPeer) getPeer();
if (peer != null
@@ -362,30 +367,7 @@ public class Scrollbar extends Component implements Accessible, Adjustable
this.value = value;
this.visibleAmount = visibleAmount;
this.minimum = minimum;
- this.maximum = maximum;
-
- int range = maximum - minimum;
- if (lineIncrement > range)
- {
- if (range == 0)
- lineIncrement = 1;
- else
- lineIncrement = range;
-
- if (peer != null)
- peer.setLineIncrement(lineIncrement);
- }
-
- if (pageIncrement > range)
- {
- if (range == 0)
- pageIncrement = 1;
- else
- pageIncrement = range;
-
- if (peer != null)
- peer.setPageIncrement(pageIncrement);
- }
+ this.maximum = maximum;
}
/**
@@ -437,19 +419,13 @@ public class Scrollbar extends Component implements Accessible, Adjustable
{
if (lineIncrement < 0)
throw new IllegalArgumentException("Unit increment less than zero.");
-
- int range = maximum - minimum;
- if (lineIncrement > range)
- {
- if (range == 0)
- lineIncrement = 1;
- else
- lineIncrement = range;
- }
-
- if (lineIncrement == this.lineIncrement)
+
+ if (lineIncrement == 0)
+ lineIncrement = 1;
+
+ if (lineIncrement == this.lineIncrement)
return;
-
+
this.lineIncrement = lineIncrement;
ScrollbarPeer peer = (ScrollbarPeer) getPeer();
@@ -507,15 +483,9 @@ public class Scrollbar extends Component implements Accessible, Adjustable
if (pageIncrement < 0)
throw new IllegalArgumentException("Block increment less than zero.");
- int range = maximum - minimum;
- if (pageIncrement > range)
- {
- if (range == 0)
- pageIncrement = 1;
- else
- pageIncrement = range;
- }
-
+ if (pageIncrement == 0)
+ pageIncrement = 1;
+
if (pageIncrement == this.pageIncrement)
return;
@@ -647,7 +617,7 @@ public class Scrollbar extends Component implements Accessible, Adjustable
* @exception ClassCastException If listenerType doesn't specify a class or
* interface that implements java.util.EventListener.
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
if (listenerType == AdjustmentListener.class)
return AWTEventMulticaster.getListeners(adjustment_listeners,
diff --git a/libjava/classpath/java/awt/TextArea.java b/libjava/classpath/java/awt/TextArea.java
index 7e3463ab849..30b278d0c29 100644
--- a/libjava/classpath/java/awt/TextArea.java
+++ b/libjava/classpath/java/awt/TextArea.java
@@ -284,11 +284,7 @@ public class TextArea extends TextComponent implements java.io.Serializable
}
/**
- * Retrieve the minimum size for this text area, considering the
- * text area's current row and column values. A text area's minimum
- * size depends on the number of rows and columns of text it would
- * prefer to display, and on the size of the font in which the text
- * would be displayed.
+ * Retrieve the minimum size for this text area.
*
* @return The minimum size for this text field.
*/
@@ -298,11 +294,8 @@ public class TextArea extends TextComponent implements java.io.Serializable
}
/**
- * Retrieve the minimum size that this text area would have if its
- * row and column values were equal to those specified. A text
- * area's minimum size depends on the number of rows and columns of
- * text it would prefer to display, and on the size of the font in
- * which the text would be displayed.
+ * Retrieve the minimum size for this text area. If the minimum
+ * size has been set, then rows and columns are used in the calculation.
*
* @param rows The number of rows to use in the minimum size
* calculation.
@@ -317,12 +310,8 @@ public class TextArea extends TextComponent implements java.io.Serializable
}
/**
- * Retrieve the minimum size for this text area, considering the
- * text area's current row and column values. A text area's minimum
- * size depends on the number of rows and columns of text it would
- * prefer to display, and on the size of the font in which the text
- * would be displayed.
- *
+ * Retrieve the minimum size for this text area.
+ *
* @return The minimum size for this text area.
*
* @deprecated This method is deprecated in favor of
@@ -334,11 +323,8 @@ public class TextArea extends TextComponent implements java.io.Serializable
}
/**
- * Retrieve the minimum size that this text area would have if its
- * row and column values were equal to those specified. A text
- * area's minimum size depends on the number of rows and columns of
- * text it would prefer to display, and on the size of the font in
- * which the text would be displayed.
+ * Retrieve the minimum size for this text area. If the minimum
+ * size has been set, then rows and columns are used in the calculation.
*
* @param rows The number of rows to use in the minimum size
* calculation.
@@ -352,21 +338,18 @@ public class TextArea extends TextComponent implements java.io.Serializable
*/
public Dimension minimumSize (int rows, int columns)
{
+ if (isMinimumSizeSet())
+ return new Dimension(minSize);
+
TextAreaPeer peer = (TextAreaPeer) getPeer ();
-
- // Sun returns Dimension (0,0) in this case.
if (peer == null)
- return new Dimension (0, 0);
+ return new Dimension (getWidth(), getHeight());
return peer.getMinimumSize (rows, columns);
}
/**
- * Retrieve the preferred size for this text area, considering the
- * text area's current row and column values. A text area's preferred
- * size depends on the number of rows and columns of text it would
- * prefer to display, and on the size of the font in which the text
- * would be displayed.
+ * Retrieve the preferred size for this text area.
*
* @return The preferred size for this text field.
*/
@@ -376,11 +359,8 @@ public class TextArea extends TextComponent implements java.io.Serializable
}
/**
- * Retrieve the preferred size that this text area would have if its
- * row and column values were equal to those specified. A text
- * area's preferred size depends on the number of rows and columns
- * of text it would prefer to display, and on the size of the font
- * in which the text would be displayed.
+ * Retrieve the preferred size for this text area. If the preferred
+ * size has been set, then rows and columns are used in the calculation.
*
* @param rows The number of rows to use in the preferred size
* calculation.
@@ -395,11 +375,7 @@ public class TextArea extends TextComponent implements java.io.Serializable
}
/**
- * Retrieve the preferred size for this text area, considering the
- * text area's current row and column values. A text area's preferred
- * size depends on the number of rows and columns of text it would
- * prefer to display, and on the size of the font in which the text
- * would be displayed.
+ * Retrieve the preferred size for this text area.
*
* @return The preferred size for this text field.
*
@@ -412,11 +388,8 @@ public class TextArea extends TextComponent implements java.io.Serializable
}
/**
- * Retrieve the preferred size that this text area would have if its
- * row and column values were equal to those specified. A text
- * area's preferred size depends on the number of rows and columns
- * of text it would prefer to display, and on the size of the font
- * in which the text would be displayed.
+ * Retrieve the preferred size for this text area. If the preferred
+ * size has been set, then rows and columns are used in the calculation.
*
* @param rows The number of rows to use in the preferred size
* calculation.
@@ -430,11 +403,12 @@ public class TextArea extends TextComponent implements java.io.Serializable
*/
public Dimension preferredSize (int rows, int columns)
{
+ if (isPreferredSizeSet())
+ return new Dimension(prefSize);
+
TextAreaPeer peer = (TextAreaPeer) getPeer ();
-
- // Sun returns Dimension (0,0) in this case.
if (peer == null)
- return new Dimension (0, 0);
+ return new Dimension (getWidth(), getHeight());
return peer.getPreferredSize (rows, columns);
}
diff --git a/libjava/classpath/java/awt/TextComponent.java b/libjava/classpath/java/awt/TextComponent.java
index f811122f2b2..8fdd94139fc 100644
--- a/libjava/classpath/java/awt/TextComponent.java
+++ b/libjava/classpath/java/awt/TextComponent.java
@@ -391,7 +391,9 @@ public class TextComponent extends Component
*/
public synchronized void setSelectionStart(int selectionStart)
{
- select(selectionStart, getSelectionEnd());
+ select(selectionStart,
+ (getSelectionEnd() < selectionStart)
+ ? selectionStart : getSelectionEnd());
}
/**
@@ -610,7 +612,7 @@ public class TextComponent extends Component
* @exception ClassCastException If listenerType doesn't specify a class or
* interface that implements java.util.EventListener.
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
if (listenerType == TextListener.class)
return AWTEventMulticaster.getListeners(textListener, listenerType);
diff --git a/libjava/classpath/java/awt/TextField.java b/libjava/classpath/java/awt/TextField.java
index b76f393a0b6..b1df66f7cdc 100644
--- a/libjava/classpath/java/awt/TextField.java
+++ b/libjava/classpath/java/awt/TextField.java
@@ -264,9 +264,12 @@ public class TextField extends TextComponent
*/
public Dimension minimumSize(int columns)
{
+ if (isMinimumSizeSet())
+ return new Dimension(minSize);
+
TextFieldPeer peer = (TextFieldPeer) getPeer ();
if (peer == null)
- return null; // FIXME: What do we do if there is no peer?
+ return new Dimension(getWidth(), getHeight());
return peer.getMinimumSize (columns);
}
@@ -316,10 +319,13 @@ public class TextField extends TextComponent
*/
public Dimension preferredSize(int columns)
{
+ if (isPreferredSizeSet())
+ return new Dimension(prefSize);
+
TextFieldPeer peer = (TextFieldPeer) getPeer ();
if (peer == null)
- return new Dimension (0, 0);
-
+ return new Dimension (getWidth(), getHeight());
+
return peer.getPreferredSize (columns);
}
@@ -422,7 +428,7 @@ public class TextField extends TextComponent
*
* @since 1.3
*/
- public EventListener[] getListeners (Class listenerType)
+ public <T extends EventListener> T[] getListeners (Class<T> listenerType)
{
if (listenerType == ActionListener.class)
return AWTEventMulticaster.getListeners (action_listeners, listenerType);
diff --git a/libjava/classpath/java/awt/Toolkit.java b/libjava/classpath/java/awt/Toolkit.java
index 2842091c139..69040722e72 100644
--- a/libjava/classpath/java/awt/Toolkit.java
+++ b/libjava/classpath/java/awt/Toolkit.java
@@ -41,6 +41,7 @@ package java.awt;
import gnu.classpath.SystemProperties;
import gnu.java.awt.peer.GLightweightPeer;
+import gnu.java.awt.peer.headless.HeadlessToolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.dnd.DragGestureEvent;
@@ -51,6 +52,7 @@ import java.awt.dnd.peer.DragSourceContextPeer;
import java.awt.event.AWTEventListener;
import java.awt.event.AWTEventListenerProxy;
import java.awt.event.KeyEvent;
+import java.awt.font.TextAttribute;
import java.awt.im.InputMethodHighlight;
import java.awt.image.ColorModel;
import java.awt.image.ImageObserver;
@@ -86,6 +88,7 @@ import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
+import java.util.Hashtable;
import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;
@@ -119,7 +122,8 @@ public abstract class Toolkit
/** The toolkit properties. */
private static Properties props = new Properties();
- protected final Map desktopProperties = new Properties();
+ protected final Map<String,Object> desktopProperties =
+ new Hashtable<String,Object>();
protected final PropertyChangeSupport desktopPropsSupport
= new PropertyChangeSupport(this);
@@ -131,6 +135,11 @@ public abstract class Toolkit
AWTEventListenerProxy[] awtEventListeners;
/**
+ * The shared peer for all lightweight components.
+ */
+ private GLightweightPeer lightweightPeer;
+
+ /**
* Default constructor for subclasses.
*/
public Toolkit()
@@ -379,7 +388,9 @@ public abstract class Toolkit
*/
protected LightweightPeer createComponent(Component target)
{
- return new GLightweightPeer(target);
+ if (lightweightPeer == null)
+ lightweightPeer = new GLightweightPeer();
+ return lightweightPeer;
}
/**
@@ -540,10 +551,11 @@ public abstract class Toolkit
*
* @throws AWTError If the toolkit cannot be loaded.
*/
- public static Toolkit getDefaultToolkit()
+ public static synchronized Toolkit getDefaultToolkit()
{
if (toolkit != null)
return toolkit;
+
String toolkit_name = SystemProperties.getProperty("awt.toolkit",
default_toolkit_name);
try
@@ -573,8 +585,18 @@ public abstract class Toolkit
}
catch (Throwable t)
{
- AWTError e = new AWTError("Cannot load AWT toolkit: " + toolkit_name);
- throw (AWTError) e.initCause(t);
+ // Check for the headless property.
+ if (GraphicsEnvironment.isHeadless())
+ {
+ toolkit = new HeadlessToolkit();
+ return toolkit;
+ }
+ else
+ {
+ AWTError e = new AWTError("Cannot load AWT toolkit: "
+ + toolkit_name);
+ throw (AWTError) e.initCause(t);
+ }
}
}
@@ -964,8 +986,8 @@ public abstract class Toolkit
/**
* @since 1.3
*/
- public DragGestureRecognizer
- createDragGestureRecognizer(Class recognizer, DragSource ds,
+ public <T extends DragGestureRecognizer> T
+ createDragGestureRecognizer(Class<T> recognizer, DragSource ds,
Component comp, int actions,
DragGestureListener l)
{
@@ -1252,7 +1274,8 @@ public abstract class Toolkit
/**
* @since 1.3
*/
- public abstract Map mapInputMethodHighlight(InputMethodHighlight highlight);
+ public abstract Map<TextAttribute,?>
+ mapInputMethodHighlight(InputMethodHighlight highlight);
/**
* Initializes the accessibility framework. In particular, this loads the
diff --git a/libjava/classpath/java/awt/Window.java b/libjava/classpath/java/awt/Window.java
index 8885821811d..41dff5577e0 100644
--- a/libjava/classpath/java/awt/Window.java
+++ b/libjava/classpath/java/awt/Window.java
@@ -1,5 +1,5 @@
/* Window.java --
- Copyright (C) 1999, 2000, 2002, 2003, 2004, 2006 Free Software Foundation
+ Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation
This file is part of GNU Classpath.
@@ -140,7 +140,7 @@ public class Window extends Container implements Accessible
this();
graphicsConfiguration = gc;
}
-
+
/**
* Initializes a new instance of <code>Window</code> with the specified
* parent. The window will initially be invisible.
@@ -250,13 +250,13 @@ public class Window extends Container implements Accessible
/**
* Shows on-screen this window and any of its owned windows for whom
* isVisible returns true.
+ * @specnote: Deprecated starting in 1.5.
*/
+ @Deprecated
public void show()
{
synchronized (getTreeLock())
{
- if (parent != null && ! parent.isDisplayable())
- parent.addNotify();
if (peer == null)
addNotify();
@@ -298,11 +298,24 @@ public class Window extends Container implements Accessible
if (initialFocusOwner != null)
initialFocusOwner.requestFocusInWindow();
+ // Post WINDOW_OPENED from here.
+ if (windowListener != null
+ || (eventMask & AWTEvent.WINDOW_EVENT_MASK) != 0)
+ {
+ WindowEvent ev = new WindowEvent(this,
+ WindowEvent.WINDOW_OPENED);
+ Toolkit tk = Toolkit.getDefaultToolkit();
+ tk.getSystemEventQueue().postEvent(ev);
+ }
shown = true;
}
}
}
+ /**
+ * @specnote: Deprecated starting in 1.5.
+ */
+ @Deprecated
public void hide()
{
// Hide visible owned windows.
@@ -349,9 +362,15 @@ public class Window extends Container implements Accessible
component[i].removeNotify();
this.removeNotify();
- // Post a WINDOW_CLOSED event.
- WindowEvent we = new WindowEvent(this, WindowEvent.WINDOW_CLOSED);
- getToolkit().getSystemEventQueue().postEvent(we);
+ // Post WINDOW_CLOSED from here.
+ if (windowListener != null
+ || (eventMask & AWTEvent.WINDOW_EVENT_MASK) != 0)
+ {
+ WindowEvent ev = new WindowEvent(this,
+ WindowEvent.WINDOW_CLOSED);
+ Toolkit tk = Toolkit.getDefaultToolkit();
+ tk.getSystemEventQueue().postEvent(ev);
+ }
}
}
@@ -479,7 +498,11 @@ public class Window extends Container implements Accessible
*/
public synchronized void addWindowListener(WindowListener listener)
{
- windowListener = AWTEventMulticaster.add(windowListener, listener);
+ if (listener != null)
+ {
+ newEventsOnly = true;
+ windowListener = AWTEventMulticaster.add(windowListener, listener);
+ }
}
/**
@@ -536,7 +559,12 @@ public class Window extends Container implements Accessible
*/
public void addWindowFocusListener (WindowFocusListener wfl)
{
- windowFocusListener = AWTEventMulticaster.add (windowFocusListener, wfl);
+ if (wfl != null)
+ {
+ newEventsOnly = true;
+ windowFocusListener = AWTEventMulticaster.add (windowFocusListener,
+ wfl);
+ }
}
/**
@@ -546,7 +574,12 @@ public class Window extends Container implements Accessible
*/
public void addWindowStateListener (WindowStateListener wsl)
{
- windowStateListener = AWTEventMulticaster.add (windowStateListener, wsl);
+ if (wsl != null)
+ {
+ newEventsOnly = true;
+ windowStateListener = AWTEventMulticaster.add (windowStateListener,
+ wsl);
+ }
}
/**
@@ -577,42 +610,21 @@ public class Window extends Container implements Accessible
*
* @since 1.3
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
if (listenerType == WindowListener.class)
- return getWindowListeners();
+ return (T[]) getWindowListeners();
return super.getListeners(listenerType);
}
void dispatchEventImpl(AWTEvent e)
{
- // Make use of event id's in order to avoid multiple instanceof tests.
- if (e.id <= WindowEvent.WINDOW_LAST
- && e.id >= WindowEvent.WINDOW_FIRST
- && (windowListener != null
- || windowFocusListener != null
- || windowStateListener != null
- || (eventMask & AWTEvent.WINDOW_EVENT_MASK) != 0))
- processEvent(e);
- else
+ if (e.getID() == ComponentEvent.COMPONENT_RESIZED)
{
- if (peer != null && (e.id == ComponentEvent.COMPONENT_RESIZED
- || e.id == ComponentEvent.COMPONENT_MOVED))
- {
- Rectangle bounds = peer.getBounds();
- x = bounds.x;
- y = bounds.y;
- height = bounds.height;
- width = bounds.width;
-
- if (e.id == ComponentEvent.COMPONENT_RESIZED)
- {
- invalidate();
- validate();
- }
- }
- super.dispatchEventImpl(e);
+ invalidate();
+ validate();
}
+ super.dispatchEventImpl(e);
}
/**
@@ -626,7 +638,28 @@ public class Window extends Container implements Accessible
protected void processEvent(AWTEvent evt)
{
if (evt instanceof WindowEvent)
- processWindowEvent((WindowEvent) evt);
+ {
+ WindowEvent we = (WindowEvent) evt;
+ switch (evt.getID())
+ {
+ case WindowEvent.WINDOW_OPENED:
+ case WindowEvent.WINDOW_CLOSED:
+ case WindowEvent.WINDOW_CLOSING:
+ case WindowEvent.WINDOW_ICONIFIED:
+ case WindowEvent.WINDOW_DEICONIFIED:
+ case WindowEvent.WINDOW_ACTIVATED:
+ case WindowEvent.WINDOW_DEACTIVATED:
+ processWindowEvent(we);
+ break;
+ case WindowEvent.WINDOW_GAINED_FOCUS:
+ case WindowEvent.WINDOW_LOST_FOCUS:
+ processWindowFocusEvent(we);
+ break;
+ case WindowEvent.WINDOW_STATE_CHANGED:
+ processWindowStateEvent(we);
+ break;
+ }
+ }
else
super.processEvent(evt);
}
@@ -641,54 +674,35 @@ public class Window extends Container implements Accessible
*/
protected void processWindowEvent(WindowEvent evt)
{
- int id = evt.getID();
-
- if (id == WindowEvent.WINDOW_GAINED_FOCUS
- || id == WindowEvent.WINDOW_LOST_FOCUS)
- processWindowFocusEvent (evt);
- else if (id == WindowEvent.WINDOW_STATE_CHANGED)
- processWindowStateEvent (evt);
- else
+ if (windowListener != null)
{
- if (windowListener != null)
- {
- switch (evt.getID())
- {
- case WindowEvent.WINDOW_ACTIVATED:
- windowListener.windowActivated(evt);
- break;
-
- case WindowEvent.WINDOW_CLOSED:
- windowListener.windowClosed(evt);
- break;
-
- case WindowEvent.WINDOW_CLOSING:
- windowListener.windowClosing(evt);
- break;
-
- case WindowEvent.WINDOW_DEACTIVATED:
- windowListener.windowDeactivated(evt);
- break;
-
- case WindowEvent.WINDOW_DEICONIFIED:
- windowListener.windowDeiconified(evt);
- break;
-
- case WindowEvent.WINDOW_ICONIFIED:
- windowListener.windowIconified(evt);
- break;
-
- case WindowEvent.WINDOW_OPENED:
- windowListener.windowOpened(evt);
- break;
-
- default:
- break;
- }
- }
+ switch (evt.getID())
+ {
+ case WindowEvent.WINDOW_ACTIVATED:
+ windowListener.windowActivated(evt);
+ break;
+ case WindowEvent.WINDOW_CLOSED:
+ windowListener.windowClosed(evt);
+ break;
+ case WindowEvent.WINDOW_CLOSING:
+ windowListener.windowClosing(evt);
+ break;
+ case WindowEvent.WINDOW_DEACTIVATED:
+ windowListener.windowDeactivated(evt);
+ break;
+ case WindowEvent.WINDOW_DEICONIFIED:
+ windowListener.windowDeiconified(evt);
+ break;
+ case WindowEvent.WINDOW_ICONIFIED:
+ windowListener.windowIconified(evt);
+ break;
+ case WindowEvent.WINDOW_OPENED:
+ windowListener.windowOpened(evt);
+ break;
+ }
}
}
-
+
/**
* Identifies if this window is active. The active window is a Frame or
* Dialog that has focus or owns the active window.
@@ -1233,6 +1247,42 @@ public class Window extends Container implements Accessible
return "win" + getUniqueLong();
}
+ /**
+ * Overridden to handle WindowEvents.
+ *
+ * @return <code>true</code> when the specified event type is enabled,
+ * <code>false</code> otherwise
+ */
+ boolean eventTypeEnabled(int type)
+ {
+ boolean enabled = false;
+ switch (type)
+ {
+ case WindowEvent.WINDOW_OPENED:
+ case WindowEvent.WINDOW_CLOSED:
+ case WindowEvent.WINDOW_CLOSING:
+ case WindowEvent.WINDOW_ICONIFIED:
+ case WindowEvent.WINDOW_DEICONIFIED:
+ case WindowEvent.WINDOW_ACTIVATED:
+ case WindowEvent.WINDOW_DEACTIVATED:
+ enabled = ((eventMask & AWTEvent.WINDOW_EVENT_MASK) != 0)
+ || windowListener != null;
+ break;
+ case WindowEvent.WINDOW_GAINED_FOCUS:
+ case WindowEvent.WINDOW_LOST_FOCUS:
+ enabled = ((eventMask & AWTEvent.WINDOW_FOCUS_EVENT_MASK) != 0)
+ || windowFocusListener != null;
+ break;
+ case WindowEvent.WINDOW_STATE_CHANGED:
+ enabled = ((eventMask & AWTEvent.WINDOW_STATE_EVENT_MASK) != 0)
+ || windowStateListener != null;
+ break;
+ default:
+ enabled = super.eventTypeEnabled(type);
+ }
+ return enabled;
+ }
+
private static synchronized long getUniqueLong()
{
return next_window_number++;
diff --git a/libjava/classpath/java/awt/datatransfer/DataFlavor.java b/libjava/classpath/java/awt/datatransfer/DataFlavor.java
index 0228cd5786d..baaf43d85bc 100644
--- a/libjava/classpath/java/awt/datatransfer/DataFlavor.java
+++ b/libjava/classpath/java/awt/datatransfer/DataFlavor.java
@@ -38,14 +38,13 @@ exception statement from your version. */
package java.awt.datatransfer;
-import gnu.classpath.NotImplementedException;
-
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.ObjectInput;
import java.io.ObjectOutput;
+import java.io.OptionalDataException;
import java.io.Reader;
import java.io.Serializable;
import java.io.StringReader;
@@ -76,8 +75,7 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
* deals with bytes not chars. Use <code>getRederForText()</code>.
*/
public static final DataFlavor plainTextFlavor =
- new DataFlavor(java.io.InputStream.class,
- "text/plain; charset=unicode",
+ new DataFlavor("text/plain; charset=unicode; class=java.io.InputStream",
"plain unicode text");
/**
@@ -94,8 +92,7 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
* element of the list being a <code>java.io.File</code>.
*/
public static final DataFlavor javaFileListFlavor =
- new DataFlavor(java.util.List.class,
- "application/x-java-file-list; class=java.util.List",
+ new DataFlavor("application/x-java-file-list; class=java.util.List",
"Java File List");
/**
@@ -132,10 +129,10 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*/
// The MIME type for this flavor
- private final String mimeType;
+ private MimeType mimeType;
// The representation class for this flavor
- private final Class representationClass;
+ private Class<?> representationClass;
// The human readable name of this flavor
private String humanPresentableName;
@@ -156,8 +153,8 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*
* @exception ClassNotFoundException If the class cannot be loaded.
*/
- protected static final Class tryToLoadClass(String className,
- ClassLoader classLoader)
+ protected static final Class<?> tryToLoadClass(String className,
+ ClassLoader classLoader)
throws ClassNotFoundException
{
// Bootstrap
@@ -198,62 +195,6 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
throw new ClassNotFoundException(className);
}
- private static Class getRepresentationClassFromMimeThrows(String mimeString,
- ClassLoader classLoader)
- throws ClassNotFoundException
- {
- String classname = getParameter("class", mimeString);
- if (classname != null)
- return tryToLoadClass(classname, classLoader);
- else
- return java.io.InputStream.class;
- }
-
- // Same as above, but wraps any ClassNotFoundExceptions
- private static Class getRepresentationClassFromMime(String mimeString,
- ClassLoader classLoader)
- {
- try
- {
- return getRepresentationClassFromMimeThrows(mimeString, classLoader);
- }
- catch(ClassNotFoundException cnfe)
- {
- IllegalArgumentException iae;
- iae = new IllegalArgumentException("mimeString: "
- + mimeString
- + " classLoader: "
- + classLoader);
- iae.initCause(cnfe);
- throw iae;
- }
- }
-
- /**
- * Returns the value of the named MIME type parameter, or <code>null</code>
- * if the parameter does not exist. Given the parameter name and the mime
- * string.
- *
- * @param paramName The name of the parameter.
- * @param mimeString The mime string from where the name should be found.
- *
- * @return The value of the parameter or null.
- */
- private static String getParameter(String paramName, String mimeString)
- {
- int idx = mimeString.indexOf(paramName + "=");
- if (idx == -1)
- return(null);
-
- String value = mimeString.substring(idx + paramName.length() + 1);
-
- idx = value.indexOf(";");
- if (idx == -1)
- return(value);
- else
- return(value.substring(0, idx));
- }
-
/**
* XXX - Currently returns <code>plainTextFlavor</code>.
*/
@@ -321,32 +262,7 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*/
public DataFlavor()
{
- mimeType = null;
- representationClass = null;
- humanPresentableName = null;
- }
-
- /**
- * Private constructor.
- */
- private DataFlavor(Class representationClass,
- String mimeType,
- String humanPresentableName)
- {
- this.representationClass = representationClass;
- this.mimeType = mimeType;
-
- // Do some simple validity checks
- String type = getPrimaryType() + "/" + getSubType();
- if (type.indexOf(' ') != -1
- || type.indexOf('=') != -1
- || type.indexOf(';') != -1)
- throw new IllegalArgumentException(mimeType);
-
- if (humanPresentableName != null)
- this.humanPresentableName = humanPresentableName;
- else
- this.humanPresentableName = mimeType;
+ // Used for deserialization only, nothing to do here.
}
/**
@@ -359,13 +275,23 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
* @param representationClass The representation class for this object.
* @param humanPresentableName The display name of the object.
*/
- public DataFlavor(Class representationClass, String humanPresentableName)
+ public DataFlavor(Class<?> representationClass, String humanPresentableName)
{
- this(representationClass,
- "application/x-java-serialized-object"
- + "; class="
- + representationClass.getName(),
- humanPresentableName);
+ if (representationClass == null)
+ throw new NullPointerException("representationClass must not be null");
+ try
+ {
+ mimeType = new MimeType(javaSerializedObjectMimeType);
+ }
+ catch (MimeTypeParseException ex)
+ {
+ // Must not happen as we use a constant string.
+ assert false;
+ }
+ if (humanPresentableName == null)
+ humanPresentableName = javaSerializedObjectMimeType;
+ this.humanPresentableName = humanPresentableName;
+ this.representationClass = representationClass;
}
/**
@@ -390,8 +316,7 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
ClassLoader classLoader)
throws ClassNotFoundException
{
- this(getRepresentationClassFromMimeThrows(mimeType, classLoader),
- mimeType, humanPresentableName);
+ init(mimeType, humanPresentableName, classLoader);
}
/**
@@ -412,8 +337,17 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*/
public DataFlavor(String mimeType, String humanPresentableName)
{
- this(getRepresentationClassFromMime (mimeType, null),
- mimeType, humanPresentableName);
+ try
+ {
+ init(mimeType, humanPresentableName, getClass().getClassLoader());
+ }
+ catch (ClassNotFoundException ex)
+ {
+ IllegalArgumentException iae =
+ new IllegalArgumentException("Class not found: " + ex.getMessage());
+ iae.initCause(ex);
+ throw iae;
+ }
}
/**
@@ -432,8 +366,54 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*/
public DataFlavor(String mimeType) throws ClassNotFoundException
{
- this(getRepresentationClassFromMimeThrows(mimeType, null),
- mimeType, null);
+ init(mimeType, null, getClass().getClassLoader());
+ }
+
+ /**
+ * Called by various constructors to initialize this object.
+ *
+ * @param mime the mime string
+ * @param humanPresentableName the human presentable name
+ * @param loader the class loader to use for loading the representation
+ * class
+ */
+ private void init(String mime, String humanPresentableName,
+ ClassLoader loader)
+ throws ClassNotFoundException
+ {
+ if (mime == null)
+ throw new NullPointerException("The mime type must not be null");
+ try
+ {
+ mimeType = new MimeType(mime);
+ }
+ catch (MimeTypeParseException ex)
+ {
+ IllegalArgumentException iae =
+ new IllegalArgumentException("Invalid mime type");
+ iae.initCause(ex);
+ throw iae;
+ }
+ String className = mimeType.getParameter("class");
+ if (className == null)
+ {
+ if (mimeType.getBaseType().equals(javaSerializedObjectMimeType))
+ throw new IllegalArgumentException("Serialized object type must have"
+ + " a representation class parameter");
+ else
+ representationClass = java.io.InputStream.class;
+ }
+ else
+ representationClass = tryToLoadClass(className, loader);
+ mimeType.addParameter("class", representationClass.getName());
+
+ if (humanPresentableName == null)
+ {
+ humanPresentableName = mimeType.getParameter("humanPresentableName");
+ if (humanPresentableName == null)
+ humanPresentableName = mimeType.getBaseType();
+ }
+ this.humanPresentableName = humanPresentableName;
}
/**
@@ -443,7 +423,7 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*/
public String getMimeType()
{
- return(mimeType);
+ return(mimeType.toString());
}
/**
@@ -451,7 +431,7 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*
* @return The representation class for this flavor.
*/
- public Class getRepresentationClass()
+ public Class<?> getRepresentationClass()
{
return(representationClass);
}
@@ -473,11 +453,7 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*/
public String getPrimaryType()
{
- int idx = mimeType.indexOf("/");
- if (idx == -1)
- return(mimeType);
-
- return(mimeType.substring(0, idx));
+ return(mimeType.getPrimaryType());
}
/**
@@ -487,15 +463,7 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*/
public String getSubType()
{
- int start = mimeType.indexOf("/");
- if (start == -1)
- return "";
-
- int end = mimeType.indexOf(";", start + 1);
- if (end == -1)
- return mimeType.substring(start + 1);
- else
- return mimeType.substring(start + 1, end);
+ return mimeType.getSubType();
}
/**
@@ -511,7 +479,7 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
if ("humanPresentableName".equals(paramName))
return getHumanPresentableName();
- return getParameter(paramName, mimeType);
+ return mimeType.getParameter(paramName);
}
/**
@@ -537,16 +505,22 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*/
public boolean isMimeTypeEqual(String mimeType)
{
- String mime = getMimeType();
- int i = mime.indexOf(";");
- if (i != -1)
- mime = mime.substring(0, i);
-
- i = mimeType.indexOf(";");
- if (i != -1)
- mimeType = mimeType.substring(0, i);
-
- return mime.equals(mimeType);
+ if (mimeType == null)
+ throw new NullPointerException("mimeType must not be null");
+ boolean equal = false;
+ try
+ {
+ if (this.mimeType != null)
+ {
+ MimeType other = new MimeType(mimeType);
+ equal = this.mimeType.matches(other);
+ }
+ }
+ catch (MimeTypeParseException ex)
+ {
+ // Return false in this case.
+ }
+ return equal;
}
/**
@@ -571,7 +545,7 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*/
public boolean isMimeTypeSerializedObject()
{
- return mimeType.startsWith(javaSerializedObjectMimeType);
+ return isMimeTypeEqual(javaSerializedObjectMimeType);
}
/**
@@ -617,8 +591,8 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*/
public boolean isFlavorSerializedObjectType()
{
- // FIXME: What is the diff between this and isMimeTypeSerializedObject?
- return(mimeType.startsWith(javaSerializedObjectMimeType));
+ return isRepresentationClassSerializable()
+ && isMimeTypeEqual(javaSerializedObjectMimeType);
}
/**
@@ -629,7 +603,9 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*/
public boolean isFlavorRemoteObjectType()
{
- return(mimeType.startsWith(javaRemoteObjectMimeType));
+ return isRepresentationClassRemote()
+ && isRepresentationClassSerializable()
+ && isMimeTypeEqual(javaRemoteObjectMimeType);
}
/**
@@ -770,7 +746,7 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*/
public int hashCode()
{
- return mimeType.toLowerCase().hashCode() ^ representationClass.hashCode();
+ return mimeType.toString().hashCode() ^ representationClass.hashCode();
}
/**
@@ -822,9 +798,17 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
* @exception IOException If an error occurs.
*/
public void writeExternal(ObjectOutput stream)
- throws IOException, NotImplementedException
+ throws IOException
{
- // FIXME: Implement me
+ if (mimeType != null)
+ {
+ mimeType.addParameter("humanPresentableName", humanPresentableName);
+ stream.writeObject(mimeType);
+ mimeType.removeParameter("humanPresentableName");
+ }
+ else
+ stream.writeObject(null);
+ stream.writeObject(representationClass);
}
@@ -838,9 +822,34 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
* cannot be found.
*/
public void readExternal(ObjectInput stream)
- throws IOException, ClassNotFoundException, NotImplementedException
+ throws IOException, ClassNotFoundException
{
- // FIXME: Implement me
+ mimeType = (MimeType) stream.readObject();
+ String className = null;
+ if (mimeType != null)
+ {
+ humanPresentableName =
+ mimeType.getParameter("humanPresentableName");
+ mimeType.removeParameter("humanPresentableName");
+ className = mimeType.getParameter("class");
+ if (className == null)
+ throw new IOException("No class in mime type");
+ }
+ try
+ {
+ representationClass = (Class) stream.readObject();
+ }
+ catch (OptionalDataException ex)
+ {
+ if (ex.eof && ex.length == 0)
+ {
+ if (className != null)
+ representationClass = tryToLoadClass(className,
+ getClass().getClassLoader());
+ }
+ else
+ throw ex;
+ }
}
/**
@@ -861,7 +870,7 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*
* @since 1.3
*/
- public final Class getDefaultRepresentationClass()
+ public final Class<?> getDefaultRepresentationClass()
{
return java.io.InputStream.class;
}
diff --git a/libjava/classpath/java/awt/datatransfer/FlavorMap.java b/libjava/classpath/java/awt/datatransfer/FlavorMap.java
index 59718c4513c..8842c8e55e3 100644
--- a/libjava/classpath/java/awt/datatransfer/FlavorMap.java
+++ b/libjava/classpath/java/awt/datatransfer/FlavorMap.java
@@ -58,7 +58,7 @@ public interface FlavorMap
*
* @return A <code>Map</code> of native data types.
*/
- Map getNativesForFlavors (DataFlavor[] flavors);
+ Map<DataFlavor, String> getNativesForFlavors (DataFlavor[] flavors);
/**
* Maps the specified native type names to <code>DataFlavor</code>'s.
@@ -71,5 +71,5 @@ public interface FlavorMap
*
* @return A <code>Map</code> of data flavors.
*/
- Map getFlavorsForNatives (String[] natives);
+ Map<String, DataFlavor> getFlavorsForNatives (String[] natives);
}
diff --git a/libjava/classpath/java/awt/datatransfer/FlavorTable.java b/libjava/classpath/java/awt/datatransfer/FlavorTable.java
index 11cdda06ca7..f6c43af8374 100644
--- a/libjava/classpath/java/awt/datatransfer/FlavorTable.java
+++ b/libjava/classpath/java/awt/datatransfer/FlavorTable.java
@@ -59,7 +59,7 @@ public interface FlavorTable extends FlavorMap
* @param flavor the flavor to look up, or null to return all natives
* @return the sorted list of natives
*/
- List getNativesForFlavor(DataFlavor flavor);
+ List<String> getNativesForFlavor(DataFlavor flavor);
/**
* Returns a list of flavors corresponding to the given String native. The
@@ -69,5 +69,5 @@ public interface FlavorTable extends FlavorMap
* @param name the native name to look up, or null to return all flavors
* @return the sorted list of flavors
*/
- List getFlavorsForNative(String name);
+ List<DataFlavor> getFlavorsForNative(String name);
}
diff --git a/libjava/classpath/java/awt/datatransfer/MimeType.java b/libjava/classpath/java/awt/datatransfer/MimeType.java
new file mode 100644
index 00000000000..438d78e9e73
--- /dev/null
+++ b/libjava/classpath/java/awt/datatransfer/MimeType.java
@@ -0,0 +1,281 @@
+/* MimeType.java -- A helper class for mime handling in DataFlavor
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.awt.datatransfer;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+/**
+ * A helper class for mime handling in DataFlavor.
+ *
+ * A Mauve test for DataFlavor.writeExternal() shows that a non-public
+ * class java.awt.datatransfer.MimeType gets serialized. This class
+ * is mainly here for serialization compatibility. Of course,
+ * now that we have it here, we can just as well implement some
+ * mime handling facility here.
+ */
+class MimeType
+ implements Externalizable
+{
+
+ /**
+ * The primary type.
+ */
+ private String primaryType;
+
+ /**
+ * The subtype.
+ */
+ private String subType;
+
+ /**
+ * Additional parameters to be appended to the mime string.
+ */
+ private HashMap parameters;
+
+ /**
+ * This is only here for deserialization.
+ */
+ public MimeType()
+ {
+ parameters = new HashMap();
+ }
+
+ /**
+ * Creates a new MimeType object.
+ *
+ * @param mime the mime type
+ */
+ MimeType(String mime)
+ throws MimeTypeParseException
+ {
+ this();
+ parse(mime);
+ }
+
+ /**
+ * Adds a mime parameter.
+ *
+ * @param param the parameter key
+ * @param value the parameter value
+ */
+ void addParameter(String param, String value)
+ {
+ parameters.put(param, value);
+ }
+
+ /**
+ * Removes the parameter with the specified key.
+ *
+ * @param param the parameter to remove
+ */
+ void removeParameter(String param)
+ {
+ parameters.remove(param);
+ }
+
+ /**
+ * Returns the parameter for the <code>key</code>.
+ *
+ * @param key the parameter key
+ *
+ * @return the parameter for the <code>key</code>
+ */
+ String getParameter(String key)
+ {
+ return (String) parameters.get(key);
+ }
+
+ /**
+ * Returns the primary type.
+ *
+ * @return the primary type
+ */
+ String getPrimaryType()
+ {
+ return primaryType;
+ }
+
+ String getSubType()
+ {
+ return subType;
+ }
+
+ /**
+ * Returns the base type of this mime type. This is the primary
+ * type plus the subtype, separated by '/'.
+ *
+ * @return the base type of this mime type
+ */
+ String getBaseType()
+ {
+ return primaryType + '/' + subType;
+ }
+
+ /**
+ * Returns <code>true</code> if this mime type and another mime type
+ * match. This will be true when their primary types are equal, and their
+ * subtypes are equal (or when either subtype is * ).
+ *
+ * @param other the other mime type
+ *
+ * @return <code>true</code> if the mime types match, <code>false</code>
+ * otherwise
+ */
+ boolean matches(MimeType other)
+ {
+ boolean match = false;
+ if (other != null)
+ {
+ match = primaryType.equals(other.primaryType)
+ && (subType.equals("*") || other.subType.equals("*")
+ || subType.equals(other.subType));
+ }
+ return match;
+ }
+
+ /**
+ * Serializes the mime type.
+ *
+ * @param in the input stream to read from
+ *
+ * @throws ClassNotFoundException not thrown here
+ * @throws IOException when something goes wrong on the input stream,
+ * or when the mime type can't be parsed
+ */
+ public void readExternal(ObjectInput in)
+ throws ClassNotFoundException, IOException
+ {
+ String mime = in.readUTF();
+ parameters.clear();
+ try
+ {
+ parse(mime);
+ }
+ catch (MimeTypeParseException ex)
+ {
+ IOException ioEx = new IOException();
+ ioEx.initCause(ex);
+ throw ioEx;
+ }
+ }
+
+ /**
+ * Serializes this mime type.
+ *
+ * @param out the output stream
+ *
+ * @throws IOException when something goes wrong on the output stream
+ */
+ public void writeExternal(ObjectOutput out)
+ throws IOException
+ {
+ out.writeUTF(toString());
+ }
+
+ /**
+ * Creates a string representation of this mime type.
+ *
+ * @return a string representation of this mime type
+ */
+ public String toString()
+ {
+ StringBuilder s = new StringBuilder();
+ s.append(primaryType);
+ s.append('/');
+ s.append(subType);
+ if (parameters.size() > 0)
+ {
+ Set entries = parameters.entrySet();
+ for (Iterator i = entries.iterator(); i.hasNext();)
+ {
+ s.append("; ");
+ Map.Entry entry = (Map.Entry) i.next();
+ s.append(entry.getKey());
+ s.append('=');
+ s.append(entry.getValue());
+ }
+ }
+ return s.toString();
+ }
+
+ /**
+ * Parses the specified mime type string and initializes the fields
+ * of this object.
+ *
+ * @param mime the mime type string
+ */
+ private void parse(String mime)
+ throws MimeTypeParseException
+ {
+ // FIXME: Maybe implement more sophisticated mime string parsing according
+ // to RFC 2045 and 2046.
+ StringTokenizer tokenizer = new StringTokenizer(mime);
+ try
+ {
+ primaryType = tokenizer.nextToken("/");
+ subType = tokenizer.nextToken("/;");
+ }
+ catch (NoSuchElementException ex)
+ {
+ throw new MimeTypeParseException("Expected / separator");
+ }
+
+ // Add any parameters.
+ while (tokenizer.hasMoreTokens())
+ {
+ String keyValuePair = tokenizer.nextToken(";");
+ int i = keyValuePair.indexOf('=');
+ if (i == -1)
+ throw new MimeTypeParseException("Expected = as parameter separator");
+ String key = keyValuePair.substring(0, i).trim();
+ String value = keyValuePair.substring(i + 1).trim();
+ parameters.put(key, value);
+ }
+ }
+
+}
diff --git a/libjava/classpath/java/awt/datatransfer/SystemFlavorMap.java b/libjava/classpath/java/awt/datatransfer/SystemFlavorMap.java
index a80665aee98..e163fe067e2 100644
--- a/libjava/classpath/java/awt/datatransfer/SystemFlavorMap.java
+++ b/libjava/classpath/java/awt/datatransfer/SystemFlavorMap.java
@@ -98,9 +98,9 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable
*
* @return A <code>Map</code> of native data types to data flavors.
*/
- public Map getNativesForFlavors (DataFlavor[] flavors)
+ public Map<DataFlavor, String> getNativesForFlavors (DataFlavor[] flavors)
{
- return new HashMap();
+ return new HashMap<DataFlavor, String>();
}
/**
@@ -114,9 +114,9 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable
*
* @return A <code>Map</code> of data flavors to native type names.
*/
- public Map getFlavorsForNatives (String[] natives)
+ public Map<String, DataFlavor> getFlavorsForNatives (String[] natives)
{
- return new HashMap();
+ return new HashMap<String, DataFlavor>();
}
/**
@@ -263,13 +263,13 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable
* specified native and a DataFlavor whose MIME type is a decoded
* version of the native.
*/
- public List getFlavorsForNative (String nat)
+ public List<DataFlavor> getFlavorsForNative (String nat)
throws NotImplementedException
{
throw new Error ("Not implemented");
}
- public List getNativesForFlavor (DataFlavor flav)
+ public List<String> getNativesForFlavor (DataFlavor flav)
throws NotImplementedException
{
throw new Error ("Not implemented");
diff --git a/libjava/classpath/java/awt/dnd/DragGestureEvent.java b/libjava/classpath/java/awt/dnd/DragGestureEvent.java
index 351ae540072..2a22abb12aa 100644
--- a/libjava/classpath/java/awt/dnd/DragGestureEvent.java
+++ b/libjava/classpath/java/awt/dnd/DragGestureEvent.java
@@ -59,7 +59,7 @@ public class DragGestureEvent extends EventObject
private Component component;
private final Point origin;
private final int action;
- private List events;
+ private List<InputEvent> events;
private DragGestureRecognizer dgr;
/**
@@ -71,15 +71,15 @@ public class DragGestureEvent extends EventObject
* @throws IllegalArgumentException - if input parameters are null
*/
public DragGestureEvent(DragGestureRecognizer dgr, int action, Point origin,
- List events)
- {
+ List<? extends InputEvent> events)
+ {
super(dgr);
if (origin == null || events == null || dgr == null)
throw new IllegalArgumentException();
-
+
this.origin = origin;
this.action = action;
- this.events = events;
+ this.events = (List<InputEvent>) events;
this.dgr = dgr;
this.component = dgr.getComponent();
this.dragSource = dgr.getDragSource();
@@ -130,7 +130,7 @@ public class DragGestureEvent extends EventObject
*
* @return an iterator representation of the List of events.
*/
- public Iterator iterator()
+ public Iterator<InputEvent> iterator()
{
return events.iterator();
}
@@ -155,7 +155,7 @@ public class DragGestureEvent extends EventObject
{
return events.toArray(array);
}
-
+
/**
* Gets the user's preferred action.
*
diff --git a/libjava/classpath/java/awt/dnd/DragGestureRecognizer.java b/libjava/classpath/java/awt/dnd/DragGestureRecognizer.java
index 32bbc56da5d..3973e528481 100644
--- a/libjava/classpath/java/awt/dnd/DragGestureRecognizer.java
+++ b/libjava/classpath/java/awt/dnd/DragGestureRecognizer.java
@@ -1,5 +1,5 @@
/* DragGestureRecognizer.java --
- Copyright (C) 2002,2006 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,8 +38,6 @@ exception statement from your version. */
package java.awt.dnd;
-import gnu.classpath.NotImplementedException;
-
import java.awt.Component;
import java.awt.Point;
import java.awt.event.InputEvent;
@@ -52,6 +50,8 @@ import java.util.TooManyListenersException;
/**
* STUBBED
+ * @author Michael Koch (konqueror@gmx.de)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.2
*/
public abstract class DragGestureRecognizer implements Serializable
@@ -65,7 +65,7 @@ public abstract class DragGestureRecognizer implements Serializable
protected Component component;
protected transient DragGestureListener dragGestureListener;
protected int sourceActions;
- protected ArrayList events = new ArrayList();
+ protected ArrayList<InputEvent> events = new ArrayList<InputEvent>();
protected DragGestureRecognizer(DragSource ds, Component c, int sa,
DragGestureListener dgl)
@@ -127,11 +127,12 @@ public abstract class DragGestureRecognizer implements Serializable
return events.size() > 0 ? (InputEvent) events.get(0) : null;
}
+ /**
+ * Resets the recognizer. If a gesture is currently recognize, discard it.
+ */
public void resetRecognizer()
- throws NotImplementedException
{
- events = new ArrayList();
- // FIXME: Not implemented fully.
+ events.clear();
}
/**
@@ -164,6 +165,7 @@ public abstract class DragGestureRecognizer implements Serializable
if(dragGestureListener != null)
dragGestureListener.dragGestureRecognized
(new DragGestureEvent(this, dragAction, p, events));
+ resetRecognizer();
}
protected void appendEvent(InputEvent e)
diff --git a/libjava/classpath/java/awt/dnd/DragSource.java b/libjava/classpath/java/awt/dnd/DragSource.java
index 48fa2388ee2..cd4a93a3e3f 100644
--- a/libjava/classpath/java/awt/dnd/DragSource.java
+++ b/libjava/classpath/java/awt/dnd/DragSource.java
@@ -105,16 +105,15 @@ public class DragSource implements Serializable
ds = null;
throw new HeadlessException();
}
-
+
if (ds == null)
ds = new DragSource();
return ds;
}
public static boolean isDragImageSupported()
- throws NotImplementedException
{
- // FIXME: Implement this
+ // In all cases, Sun returns false here.
return false;
}
@@ -140,8 +139,6 @@ public class DragSource implements Serializable
// This function sends the same message to the context, which then forwards
// it to the peer, passing itself as a parameter. Now, the native system has
// access to the Transferable through the context.
-
- // FIXME: Add check to determine if dragging.
try
{
@@ -228,15 +225,16 @@ public class DragSource implements Serializable
{
return flavorMap;
}
-
- public DragGestureRecognizer createDragGestureRecognizer(Class recognizer,
- Component c,
- int actions,
- DragGestureListener dgl)
+
+ public <T extends DragGestureRecognizer> T
+ createDragGestureRecognizer(Class<T> recognizer,
+ Component c,
+ int actions,
+ DragGestureListener dgl)
{
- return Toolkit.getDefaultToolkit().createDragGestureRecognizer(recognizer,
- this, c,
- actions, dgl);
+ return (T) Toolkit.getDefaultToolkit().createDragGestureRecognizer(recognizer,
+ this, c,
+ actions, dgl);
}
public DragGestureRecognizer createDefaultDragGestureRecognizer(Component c,
@@ -299,23 +297,23 @@ public class DragSource implements Serializable
/**
* @since 1.4
*/
- public EventListener[] getListeners (Class listenerType)
+ public <T extends EventListener> T[] getListeners (Class<T> listenerType)
{
if (listenerType == DragSourceListener.class)
return DnDEventMulticaster.getListeners (dragSourceListener,
- listenerType);
+ listenerType);
if (listenerType == DragSourceMotionListener.class)
return DnDEventMulticaster.getListeners (dragSourceMotionListener,
- listenerType);
+ listenerType);
// Return an empty EventListener array.
- return new EventListener [0];
+ return (T[]) new EventListener [0];
}
/**
* TODO
- * @return
+ * @return TODO
*
* @since 1.5
*/
@@ -323,6 +321,6 @@ public class DragSource implements Serializable
throws NotImplementedException
{
// FIXME: Not implemented.
- return 4;
+ return 8;
}
} // class DragSource
diff --git a/libjava/classpath/java/awt/dnd/DragSourceContext.java b/libjava/classpath/java/awt/dnd/DragSourceContext.java
index 1fee5c0c304..ed1cbaa4454 100644
--- a/libjava/classpath/java/awt/dnd/DragSourceContext.java
+++ b/libjava/classpath/java/awt/dnd/DragSourceContext.java
@@ -38,8 +38,6 @@ exception statement from your version. */
package java.awt.dnd;
-import gnu.classpath.NotImplementedException;
-
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Image;
@@ -268,7 +266,8 @@ public class DragSourceContext
for (int i = 0; i < dsl.length; i++)
dsl[i].dragExit(e);
- updateCurrentCursor(0, 0, DEFAULT);
+ updateCurrentCursor(DnDConstants.ACTION_NONE, DnDConstants.ACTION_NONE,
+ DEFAULT);
}
/**
@@ -340,26 +339,45 @@ public class DragSourceContext
* @param status - the status of the cursor (constant).
*/
protected void updateCurrentCursor(int dropOp, int targetAct, int status)
- throws NotImplementedException
{
- // FIXME: Not implemented fully
- if (!useCustomCursor)
+ if (! useCustomCursor)
{
- Cursor cursor = null;
+ Cursor newCursor = null;
switch (status)
{
+ default:
+ targetAct = DnDConstants.ACTION_NONE;
case ENTER:
- break;
case CHANGED:
- break;
case OVER:
- break;
- default:
- break;
+ int action = dropOp & targetAct;
+ if (action == DnDConstants.ACTION_NONE)
+ {
+ if ((dropOp & DnDConstants.ACTION_LINK) != 0)
+ newCursor = DragSource.DefaultLinkNoDrop;
+ else if ((dropOp & DnDConstants.ACTION_MOVE) != 0)
+ newCursor = DragSource.DefaultMoveNoDrop;
+ else
+ newCursor = DragSource.DefaultCopyNoDrop;
+ }
+ else
+ {
+ if ((dropOp & DnDConstants.ACTION_LINK) != 0)
+ newCursor = DragSource.DefaultLinkDrop;
+ else if ((dropOp & DnDConstants.ACTION_MOVE) != 0)
+ newCursor = DragSource.DefaultMoveDrop;
+ else
+ newCursor = DragSource.DefaultCopyDrop;
+ }
}
- this.cursor = cursor;
- peer.setCursor(cursor);
+ if (cursor == null || ! cursor.equals(newCursor))
+ {
+ cursor = newCursor;
+ DragSourceContextPeer p = peer;
+ if (p != null)
+ p.setCursor(cursor);
+ }
}
}
} // class DragSourceContext
diff --git a/libjava/classpath/java/awt/dnd/DropTarget.java b/libjava/classpath/java/awt/dnd/DropTarget.java
index a3650567f09..63be5ac046d 100644
--- a/libjava/classpath/java/awt/dnd/DropTarget.java
+++ b/libjava/classpath/java/awt/dnd/DropTarget.java
@@ -38,13 +38,14 @@ exception statement from your version. */
package java.awt.dnd;
-import gnu.classpath.NotImplementedException;
-
import java.awt.Component;
import java.awt.GraphicsEnvironment;
import java.awt.HeadlessException;
+import java.awt.Insets;
import java.awt.Point;
+import java.awt.Rectangle;
import java.awt.datatransfer.FlavorMap;
+import java.awt.datatransfer.SystemFlavorMap;
import java.awt.dnd.peer.DropTargetPeer;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -54,6 +55,8 @@ import java.io.Serializable;
import java.util.EventListener;
import java.util.TooManyListenersException;
+import javax.swing.Timer;
+
/**
* @author Michael Koch
* @since 1.2
@@ -69,30 +72,87 @@ public class DropTarget
protected static class DropTargetAutoScroller
implements ActionListener
{
+ /**
+ * The threshold that keeps the autoscroller running.
+ */
+ private static final int HYSTERESIS = 10;
+
+ /**
+ * The initial timer delay.
+ */
+ private static final int DELAY = 100;
+
private Component component;
private Point point;
-
+
+ /**
+ * The timer that triggers autoscrolling.
+ */
+ private Timer timer;
+
+ /**
+ * The outer region of the scroller. This is the component's size.
+ */
+ private Rectangle outer;
+
+ /**
+ * The inner region of the scroller. This is the component size without
+ * the autoscroll insets.
+ */
+ private Rectangle inner;
+
protected DropTargetAutoScroller (Component c, Point p)
{
component = c;
point = p;
+ timer = new Timer(DELAY, this);
+ timer.setCoalesce(true);
+ timer.start();
}
protected void updateLocation (Point newLocn)
{
+ Point previous = point;
point = newLocn;
+ if (Math.abs(point.x - previous.x) > HYSTERESIS
+ || Math.abs(point.y - previous.y) > HYSTERESIS)
+ {
+ if (timer.isRunning())
+ timer.stop();
+ }
+ else
+ {
+ if (! timer.isRunning())
+ timer.start();
+ }
}
protected void stop ()
- throws NotImplementedException
{
- // FIXME: implement this
+ timer.start();
}
public void actionPerformed (ActionEvent e)
- throws NotImplementedException
{
- // FIXME: implement this
+ Autoscroll autoScroll = (Autoscroll) component;
+
+ // First synchronize the inner and outer rectangles.
+ Insets i = autoScroll.getAutoscrollInsets();
+ int width = component.getWidth();
+ int height = component.getHeight();
+ if (width != outer.width || height != outer.height)
+ outer.setBounds(0, 0, width, height);
+ if (inner.x != i.left || inner.y != i.top)
+ inner.setLocation(i.left, i.top);
+ int inWidth = width - i.left - i.right;
+ int inHeight = height - i.top - i.bottom;
+ if (inWidth != inner.width || inHeight != inner.height)
+ inner.setSize(inWidth, inHeight);
+
+ // Scroll if the outer rectangle contains the location, but the
+ // inner doesn't.
+ if (outer.contains(point) && ! inner.contains(point))
+ autoScroll.autoscroll(point);
}
}
@@ -113,7 +173,7 @@ public class DropTarget
*/
public DropTarget ()
{
- this (null, 0, null, true, null);
+ this (null, DnDConstants.ACTION_COPY_OR_MOVE, null, true, null);
}
/**
@@ -124,7 +184,7 @@ public class DropTarget
*/
public DropTarget (Component c, DropTargetListener dtl)
{
- this (c, 0, dtl, true, null);
+ this (c, DnDConstants.ACTION_COPY_OR_MOVE, dtl, true, null);
}
/**
@@ -164,7 +224,11 @@ public class DropTarget
setComponent(c);
setDefaultActions(i);
dropTargetListener = dtl;
- flavorMap = fm;
+
+ if (fm == null)
+ flavorMap = SystemFlavorMap.getDefaultFlavorMap();
+ else
+ flavorMap = fm;
setActive (b);
@@ -177,6 +241,8 @@ public class DropTarget
*/
public void setComponent (Component c)
{
+ if (component != null)
+ clearAutoscroll();
component = c;
}
@@ -207,6 +273,8 @@ public class DropTarget
public void setActive (boolean active)
{
this.active = active;
+ if (! active)
+ clearAutoscroll();
}
public boolean isActive()
@@ -225,8 +293,14 @@ public class DropTarget
public void addDropTargetListener (DropTargetListener dtl)
throws TooManyListenersException
{
+ if (dtl == null)
+ return;
+
+ if (dtl.equals(this))
+ throw new IllegalArgumentException();
+
if (dropTargetListener != null)
- throw new TooManyListenersException ();
+ throw new TooManyListenersException();
dropTargetListener = dtl;
}
@@ -239,30 +313,47 @@ public class DropTarget
public void dragEnter(DropTargetDragEvent dtde)
{
- if (dropTargetListener != null)
- dropTargetListener.dragEnter(dtde);
+ if (active)
+ {
+ if (dropTargetListener != null)
+ dropTargetListener.dragEnter(dtde);
+ initializeAutoscrolling(dtde.getLocation());
+ }
}
public void dragOver(DropTargetDragEvent dtde)
{
- if (dropTargetListener != null)
- dropTargetListener.dragOver(dtde);
+ if (active)
+ {
+ if (dropTargetListener != null)
+ dropTargetListener.dragOver(dtde);
+ updateAutoscroll(dtde.getLocation());
+ }
}
public void dropActionChanged(DropTargetDragEvent dtde)
{
- if (dropTargetListener != null)
- dropTargetListener.dropActionChanged(dtde);
+ if (active)
+ {
+ if (dropTargetListener != null)
+ dropTargetListener.dropActionChanged(dtde);
+ updateAutoscroll(dtde.getLocation());
+ }
}
public void dragExit(DropTargetEvent dte)
{
- if (dropTargetListener != null)
- dropTargetListener.dragExit(dte);
+ if (active)
+ {
+ if (dropTargetListener != null)
+ dropTargetListener.dragExit(dte);
+ clearAutoscroll();
+ }
}
public void drop(DropTargetDropEvent dtde)
{
+ clearAutoscroll();
if (dropTargetListener != null)
dropTargetListener.drop(dtde);
}
@@ -321,15 +412,13 @@ public class DropTarget
protected DropTarget.DropTargetAutoScroller createDropTargetAutoScroller
(Component c, Point p)
{
- if (autoscroller == null)
- autoscroller = new DropTarget.DropTargetAutoScroller (c, p);
-
- return autoscroller;
+ return new DropTarget.DropTargetAutoScroller (c, p);
}
protected void initializeAutoscrolling(Point p)
{
- createDropTargetAutoScroller (component, p);
+ if (component instanceof Autoscroll) // Checks for null too.
+ autoscroller = createDropTargetAutoScroller (component, p);
}
protected void updateAutoscroll(Point dragCursorLocn)
@@ -340,6 +429,10 @@ public class DropTarget
protected void clearAutoscroll()
{
- autoscroller = null;
+ if (autoscroller != null)
+ {
+ autoscroller.stop();
+ autoscroller = null;
+ }
}
} // class DropTarget
diff --git a/libjava/classpath/java/awt/dnd/DropTargetContext.java b/libjava/classpath/java/awt/dnd/DropTargetContext.java
index 31945c34bb1..d970e2e0881 100644
--- a/libjava/classpath/java/awt/dnd/DropTargetContext.java
+++ b/libjava/classpath/java/awt/dnd/DropTargetContext.java
@@ -1,5 +1,5 @@
/* DropTargetContext.java --
- Copyright (C) 2002, 2003, 2004, 2006, Free Software Foundation
+ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation
This file is part of GNU Classpath.
@@ -49,6 +49,7 @@ import java.util.List;
/**
* @author Michael Koch (konqueror@gmx.de)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.2
*/
public class DropTargetContext implements Serializable
@@ -128,51 +129,51 @@ public class DropTargetContext implements Serializable
*
* @exception InvalidDnDOperationException If a drop is not outstanding.
*/
- public void dropComplete(boolean success)
+ public void dropComplete (boolean success)
{
if (dtcp != null)
dtcp.dropComplete(success);
}
- protected void acceptDrag(int dragOperation)
+ protected void acceptDrag (int dragOperation)
{
if (dtcp != null)
dtcp.acceptDrag(dragOperation);
}
- protected void rejectDrag()
+ protected void rejectDrag ()
{
if (dtcp != null)
dtcp.rejectDrag();
}
- protected void acceptDrop(int dropOperation)
+ protected void acceptDrop (int dropOperation)
{
if (dtcp != null)
dtcp.acceptDrop(dropOperation);
}
- protected void rejectDrop()
+ protected void rejectDrop ()
{
if (dtcp != null)
dtcp.rejectDrop();
}
- protected DataFlavor[] getCurrentDataFlavors()
+ protected DataFlavor[] getCurrentDataFlavors ()
{
if (dtcp != null)
dtcp.getTransferDataFlavors();
return null;
}
- protected List getCurrentDataFlavorsAsList()
+ protected List<DataFlavor> getCurrentDataFlavorsAsList ()
{
- return Arrays.asList(getCurrentDataFlavors());
+ return Arrays.asList(getCurrentDataFlavors ());
}
- protected boolean isDataFlavorSupported(DataFlavor flavor)
+ protected boolean isDataFlavorSupported (DataFlavor flavor)
{
- return getCurrentDataFlavorsAsList().contains(flavor);
+ return getCurrentDataFlavorsAsList().contains (flavor);
}
/**
diff --git a/libjava/classpath/java/awt/dnd/DropTargetDragEvent.java b/libjava/classpath/java/awt/dnd/DropTargetDragEvent.java
index 89bf1778a71..58feb438767 100644
--- a/libjava/classpath/java/awt/dnd/DropTargetDragEvent.java
+++ b/libjava/classpath/java/awt/dnd/DropTargetDragEvent.java
@@ -108,7 +108,7 @@ public class DropTargetDragEvent extends DropTargetEvent
return context.getCurrentDataFlavors ();
}
- public List getCurrentDataFlavorsAsList ()
+ public List<DataFlavor> getCurrentDataFlavorsAsList ()
{
return context.getCurrentDataFlavorsAsList ();
}
@@ -147,7 +147,6 @@ public class DropTargetDragEvent extends DropTargetEvent
*/
public Transferable getTransferable()
{
- // FIXME: Not implemented
- return null;
+ return context.getTransferable();
}
} // class DropTargetDragEvent
diff --git a/libjava/classpath/java/awt/dnd/DropTargetDropEvent.java b/libjava/classpath/java/awt/dnd/DropTargetDropEvent.java
index 9754bb11ef5..dd85ef712c5 100644
--- a/libjava/classpath/java/awt/dnd/DropTargetDropEvent.java
+++ b/libjava/classpath/java/awt/dnd/DropTargetDropEvent.java
@@ -1,5 +1,5 @@
/* DropTargetDropEvent.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -123,7 +123,7 @@ public class DropTargetDropEvent extends DropTargetEvent
return context.getCurrentDataFlavors();
}
- public List getCurrentDataFlavorsAsList()
+ public List<DataFlavor> getCurrentDataFlavorsAsList()
{
return context.getCurrentDataFlavorsAsList();
}
diff --git a/libjava/classpath/java/awt/dnd/DropTargetEvent.java b/libjava/classpath/java/awt/dnd/DropTargetEvent.java
index f75f756d037..cb2aec6402e 100644
--- a/libjava/classpath/java/awt/dnd/DropTargetEvent.java
+++ b/libjava/classpath/java/awt/dnd/DropTargetEvent.java
@@ -41,6 +41,10 @@ import java.util.EventObject;
public class DropTargetEvent extends EventObject
{
+
+ /**
+ * Serialization identifier for Sun 1.5 compatability
+ */
private static final long serialVersionUID = 2821229066521922993L;
protected DropTargetContext context;
diff --git a/libjava/classpath/java/awt/event/ComponentEvent.java b/libjava/classpath/java/awt/event/ComponentEvent.java
index ba9c2a5b3f2..6d478055aa5 100644
--- a/libjava/classpath/java/awt/event/ComponentEvent.java
+++ b/libjava/classpath/java/awt/event/ComponentEvent.java
@@ -1,5 +1,5 @@
/* ComponentEvent.java -- notification of events for components
- Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -114,24 +114,27 @@ public class ComponentEvent extends AWTEvent
*/
public String paramString()
{
+ StringBuffer s = new StringBuffer();
+
// Unlike Sun, we don't throw NullPointerException or ClassCastException
// when source was illegally changed.
- switch (id)
- {
- case COMPONENT_MOVED:
- return "COMPONENT_MOVED "
- + (source instanceof Component
- ? ((Component) source).getBounds() : (Object) "");
- case COMPONENT_RESIZED:
- return "COMPONENT_RESIZED "
- + (source instanceof Component
- ? ((Component) source).getBounds() : (Object) "");
- case COMPONENT_SHOWN:
- return "COMPONENT_SHOWN";
- case COMPONENT_HIDDEN:
- return "COMPONENT_HIDDEN";
- default:
- return "unknown type";
- }
+ if (id == COMPONENT_MOVED)
+ s.append("COMPONENT_MOVED ");
+ else if (id == COMPONENT_RESIZED)
+ s.append("COMPONENT_RESIZED ");
+ else if (id == COMPONENT_SHOWN)
+ s.append("COMPONENT_SHOWN ");
+ else if (id == COMPONENT_HIDDEN)
+ s.append("COMPONENT_HIDDEN ");
+ else
+ return "unknown type";
+
+ s.append("(").append(getComponent().getX()).append(",")
+ .append(getComponent().getY()).append(" ")
+ .append(getComponent().getWidth()).append("x")
+ .append(getComponent().getHeight()).append(")");
+
+ return s.toString();
}
+
} // class ComponentEvent
diff --git a/libjava/classpath/java/awt/font/FontRenderContext.java b/libjava/classpath/java/awt/font/FontRenderContext.java
index c50e5e5092a..c25bae3ec16 100644
--- a/libjava/classpath/java/awt/font/FontRenderContext.java
+++ b/libjava/classpath/java/awt/font/FontRenderContext.java
@@ -117,8 +117,12 @@ public class FontRenderContext
*/
public int hashCode ()
{
- // FIXME: check what SUN does here.
- return affineTransform == null ? 0 : affineTransform.hashCode ();
+ int code = ( isAntiAliased ? 1 : 0 ) + ( usesFractionalMetrics ? 2 : 0 );
+
+ if( affineTransform != null && !affineTransform.isIdentity() )
+ code ^= affineTransform.hashCode();
+
+ return code;
}
public boolean isAntiAliased ()
diff --git a/libjava/classpath/java/awt/font/TextHitInfo.java b/libjava/classpath/java/awt/font/TextHitInfo.java
index 2b23e1963cd..f6fee1addae 100644
--- a/libjava/classpath/java/awt/font/TextHitInfo.java
+++ b/libjava/classpath/java/awt/font/TextHitInfo.java
@@ -81,6 +81,9 @@ public final class TextHitInfo
public boolean equals(TextHitInfo hitInfo)
{
+ if (hitInfo == null)
+ return false;
+
return (charIndex == hitInfo.getCharIndex ())
&& (leadingEdge == hitInfo.isLeadingEdge ());
}
@@ -97,7 +100,7 @@ public final class TextHitInfo
public static TextHitInfo beforeOffset(int offset)
{
- return new TextHitInfo (offset, false);
+ return new TextHitInfo ((offset - 1), false);
}
public static TextHitInfo afterOffset(int offset)
diff --git a/libjava/classpath/java/awt/font/TextLayout.java b/libjava/classpath/java/awt/font/TextLayout.java
index b1473f25564..dc0e537eba9 100644
--- a/libjava/classpath/java/awt/font/TextLayout.java
+++ b/libjava/classpath/java/awt/font/TextLayout.java
@@ -38,18 +38,18 @@ exception statement from your version. */
package java.awt.font;
-import gnu.classpath.NotImplementedException;
-
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
+import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
import java.awt.geom.GeneralPath;
import java.awt.geom.Point2D;
import java.text.CharacterIterator;
import java.text.AttributedCharacterIterator;
import java.text.Bidi;
+import java.util.ArrayList;
import java.util.Map;
/**
@@ -57,19 +57,86 @@ import java.util.Map;
*/
public final class TextLayout implements Cloneable
{
- private GlyphVector[] runs;
- private Font font;
+ /**
+ * Holds the layout data that belongs to one run of characters.
+ */
+ private class Run
+ {
+ /**
+ * The actual glyph vector.
+ */
+ GlyphVector glyphVector;
+
+ /**
+ * The font for this text run.
+ */
+ Font font;
+
+ /**
+ * The start of the run.
+ */
+ int runStart;
+
+ /**
+ * The end of the run.
+ */
+ int runEnd;
+
+ /**
+ * The layout location of the beginning of the run.
+ */
+ float location;
+
+ /**
+ * Initializes the Run instance.
+ *
+ * @param gv the glyph vector
+ * @param start the start index of the run
+ * @param end the end index of the run
+ */
+ Run(GlyphVector gv, Font f, int start, int end)
+ {
+ glyphVector = gv;
+ font = f;
+ runStart = start;
+ runEnd = end;
+ }
+
+ /**
+ * Returns <code>true</code> when this run is left to right,
+ * <code>false</code> otherwise.
+ *
+ * @return <code>true</code> when this run is left to right,
+ * <code>false</code> otherwise
+ */
+ boolean isLeftToRight()
+ {
+ return (glyphVector.getLayoutFlags() & GlyphVector.FLAG_RUN_RTL) == 0;
+ }
+ }
+
+ /**
+ * The laid out character runs.
+ */
+ private Run[] runs;
+
private FontRenderContext frc;
- private String string;
+ private char[] string;
+ private int offset;
+ private int length;
private Rectangle2D boundsCache;
private LineMetrics lm;
/**
- * Start and end character indices of the runs.
- * First index is the run number, second is 0 or 1 for the starting
- * and ending character index of the run, respectively.
+ * The total advance of this text layout. This is cache for maximum
+ * performance.
+ */
+ private float totalAdvance = -1F;
+
+ /**
+ * The cached natural bounds.
*/
- private int[][] runIndices;
+ private Rectangle2D naturalBounds;
/**
* Character indices.
@@ -88,66 +155,98 @@ public final class TextLayout implements Cloneable
private boolean hasWhitespace = false;
/**
+ * The {@link Bidi} object that is used for reordering and by
+ * {@link #getCharacterLevel(int)}.
+ */
+ private Bidi bidi;
+
+ /**
+ * Mpas the logical position of each individual character in the original
+ * string to its visual position.
+ */
+ private int[] logicalToVisual;
+
+ /**
+ * Maps visual positions of a character to its logical position
+ * in the original string.
+ */
+ private int[] visualToLogical;
+
+ /**
+ * The cached hashCode.
+ */
+ private int hash;
+
+ /**
* The default caret policy.
*/
- public static final TextLayout.CaretPolicy DEFAULT_CARET_POLICY = new CaretPolicy();
+ public static final TextLayout.CaretPolicy DEFAULT_CARET_POLICY =
+ new CaretPolicy();
/**
* Constructs a TextLayout.
*/
- public TextLayout (String string, Font font, FontRenderContext frc)
+ public TextLayout (String str, Font font, FontRenderContext frc)
{
- this.font = font;
this.frc = frc;
- this.string = string;
- lm = font.getLineMetrics(string, frc);
+ string = str.toCharArray();
+ offset = 0;
+ length = this.string.length;
+ lm = font.getLineMetrics(this.string, offset, length, frc);
// Get base direction and whitespace info
getStringProperties();
- if( Bidi.requiresBidi( string.toCharArray(), 0, string.length() ) )
+ if (Bidi.requiresBidi(string, offset, offset + length))
{
- Bidi bidi = new Bidi( string, leftToRight ?
- Bidi.DIRECTION_LEFT_TO_RIGHT :
- Bidi.DIRECTION_RIGHT_TO_LEFT );
+ bidi = new Bidi(str, leftToRight ? Bidi.DIRECTION_LEFT_TO_RIGHT
+ : Bidi.DIRECTION_RIGHT_TO_LEFT );
int rc = bidi.getRunCount();
byte[] table = new byte[ rc ];
for(int i = 0; i < table.length; i++)
table[i] = (byte)bidi.getRunLevel(i);
- runs = new GlyphVector[ rc ];
- runIndices = new int[rc][2];
- for(int i = 0; i < runs.length; i++)
+ runs = new Run[rc];
+ for(int i = 0; i < rc; i++)
{
- runIndices[i][0] = bidi.getRunStart( i );
- runIndices[i][1] = bidi.getRunLimit( i );
- if( runIndices[i][0] != runIndices[i][1] ) // no empty runs.
+ int start = bidi.getRunStart(i);
+ int end = bidi.getRunLimit(i);
+ if(start != end) // no empty runs.
{
- runs[i] = font.layoutGlyphVector
- ( frc, string.toCharArray(),
- runIndices[i][0], runIndices[i][1],
- ((table[i] & 1) == 0) ? Font.LAYOUT_LEFT_TO_RIGHT :
- Font.LAYOUT_RIGHT_TO_LEFT );
- }
+ GlyphVector gv = font.layoutGlyphVector(frc,
+ string, start, end,
+ ((table[i] & 1) == 0) ? Font.LAYOUT_LEFT_TO_RIGHT
+ : Font.LAYOUT_RIGHT_TO_LEFT );
+ runs[i] = new Run(gv, font, start, end);
+ }
}
Bidi.reorderVisually( table, 0, runs, 0, runs.length );
+ // Clean up null runs.
+ ArrayList cleaned = new ArrayList(rc);
+ for (int i = 0; i < rc; i++)
+ {
+ if (runs[i] != null)
+ cleaned.add(runs[i]);
+ }
+ runs = new Run[cleaned.size()];
+ runs = (Run[]) cleaned.toArray(runs);
}
else
{
- runs = new GlyphVector[ 1 ];
- runIndices = new int[1][2];
- runIndices[0][0] = 0;
- runIndices[0][1] = string.length();
- runs[ 0 ] = font.layoutGlyphVector( frc, string.toCharArray(),
- 0, string.length(),
- leftToRight ?
- Font.LAYOUT_LEFT_TO_RIGHT :
- Font.LAYOUT_RIGHT_TO_LEFT );
+ GlyphVector gv = font.layoutGlyphVector( frc, string, offset, length,
+ leftToRight ? Font.LAYOUT_LEFT_TO_RIGHT
+ : Font.LAYOUT_RIGHT_TO_LEFT );
+ Run run = new Run(gv, font, 0, length);
+ runs = new Run[]{ run };
}
setCharIndices();
+ setupMappings();
+ layoutRuns();
}
- public TextLayout (String string, Map attributes, FontRenderContext frc)
+ public TextLayout (String string,
+ Map<? extends AttributedCharacterIterator.Attribute, ?> attributes,
+ FontRenderContext frc)
{
this( string, new Font( attributes ), frc );
}
@@ -165,7 +264,6 @@ public final class TextLayout implements Cloneable
*/
TextLayout(TextLayout t, int startIndex, int endIndex)
{
- font = t.font;
frc = t.frc;
boundsCache = null;
lm = t.lm;
@@ -173,30 +271,35 @@ public final class TextLayout implements Cloneable
if( endIndex > t.getCharacterCount() )
endIndex = t.getCharacterCount();
- string = t.string.substring( startIndex, endIndex );
+ string = t.string;
+ offset = startIndex + offset;
+ length = endIndex - startIndex;
int startingRun = t.charIndices[startIndex][0];
int nRuns = 1 + t.charIndices[endIndex - 1][0] - startingRun;
- runIndices = new int[ nRuns ][2];
- runs = new GlyphVector[ nRuns ];
+ runs = new Run[nRuns];
for( int i = 0; i < nRuns; i++ )
{
- GlyphVector run = t.runs[ i + startingRun ];
+ Run run = t.runs[i + startingRun];
+ GlyphVector gv = run.glyphVector;
+ Font font = run.font;
// Copy only the relevant parts of the first and last runs.
int beginGlyphIndex = (i > 0) ? 0 : t.charIndices[startIndex][1];
- int numEntries = ( i < nRuns - 1) ? run.getNumGlyphs() :
+ int numEntries = ( i < nRuns - 1) ? gv.getNumGlyphs() :
1 + t.charIndices[endIndex - 1][1] - beginGlyphIndex;
- int[] codes = run.getGlyphCodes(beginGlyphIndex, numEntries, null);
- runs[ i ] = font.createGlyphVector( frc, codes );
- runIndices[ i ][0] = t.runIndices[i + startingRun][0] - startIndex;
- runIndices[ i ][1] = t.runIndices[i + startingRun][1] - startIndex;
+ int[] codes = gv.getGlyphCodes(beginGlyphIndex, numEntries, null);
+ gv = font.createGlyphVector(frc, codes);
+ runs[i] = new Run(gv, font, run.runStart - startIndex,
+ run.runEnd - startIndex);
}
- runIndices[ nRuns - 1 ][1] = endIndex - 1;
+ runs[nRuns - 1].runEnd = endIndex - 1;
setCharIndices();
+ setupMappings();
determineWhiteSpace();
+ layoutRuns();
}
private void setCharIndices()
@@ -207,16 +310,53 @@ public final class TextLayout implements Cloneable
for(int run = 0; run < runs.length; run++)
{
currentChar = -1;
- for( int gi = 0; gi < runs[ run ].getNumGlyphs(); gi++)
- {
- if( runs[ run ].getGlyphCharIndex( gi ) != currentChar )
- {
- charIndices[ i ][0] = run;
- charIndices[ i ][1] = gi;
- currentChar = runs[ run ].getGlyphCharIndex( gi );
- i++;
- }
- }
+ Run current = runs[run];
+ GlyphVector gv = current.glyphVector;
+ for( int gi = 0; gi < gv.getNumGlyphs(); gi++)
+ {
+ if( gv.getGlyphCharIndex( gi ) != currentChar )
+ {
+ charIndices[ i ][0] = run;
+ charIndices[ i ][1] = gi;
+ currentChar = gv.getGlyphCharIndex( gi );
+ i++;
+ }
+ }
+ }
+ }
+
+ /**
+ * Initializes the logicalToVisual and visualToLogial maps.
+ */
+ private void setupMappings()
+ {
+ int numChars = getCharacterCount();
+ logicalToVisual = new int[numChars];
+ visualToLogical = new int[numChars];
+ int lIndex = 0;
+ int vIndex = 0;
+ // We scan the runs in visual order and set the mappings accordingly.
+ for (int i = 0; i < runs.length; i++)
+ {
+ Run run = runs[i];
+ if (run.isLeftToRight())
+ {
+ for (lIndex = run.runStart; lIndex < run.runEnd; lIndex++)
+ {
+ logicalToVisual[lIndex] = vIndex;
+ visualToLogical[vIndex] = lIndex;
+ vIndex++;
+ }
+ }
+ else
+ {
+ for (lIndex = run.runEnd - 1; lIndex >= run.runStart; lIndex--)
+ {
+ logicalToVisual[lIndex] = vIndex;
+ visualToLogical[vIndex] = lIndex;
+ vIndex++;
+ }
+ }
}
}
@@ -253,11 +393,11 @@ public final class TextLayout implements Cloneable
private void getStringProperties()
{
boolean gotDirection = false;
- int i = 0;
-
+ int i = offset;
+ int endOffs = offset + length;
leftToRight = true;
- while( i < string.length() && !gotDirection )
- switch( Character.getDirectionality( string.charAt( i++ ) ) )
+ while( i < endOffs && !gotDirection )
+ switch( Character.getDirectionality(string[i++]) )
{
case Character.DIRECTIONALITY_LEFT_TO_RIGHT:
case Character.DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING:
@@ -280,28 +420,30 @@ public final class TextLayout implements Cloneable
{
// Determine if there's whitespace in the thing.
// Ignore trailing chars.
- int i = string.length() - 1;
+ int i = offset + length - 1;
hasWhitespace = false;
- while( i >= 0 && Character.isWhitespace( string.charAt(i) ) )
+ while( i >= offset && Character.isWhitespace( string[i] ) )
i--;
// Check the remaining chars
- while( i >= 0 )
- if( Character.isWhitespace( string.charAt(i--) ) )
+ while( i >= offset )
+ if( Character.isWhitespace( string[i--] ) )
hasWhitespace = true;
}
protected Object clone ()
{
- return new TextLayout( string, font, frc );
+ return new TextLayout( this, 0, length);
}
public void draw (Graphics2D g2, float x, float y)
{
for(int i = 0; i < runs.length; i++)
{
- g2.drawGlyphVector(runs[i], x, y);
- Rectangle2D r = runs[i].getLogicalBounds();
- x += r.getWidth();
+ Run run = runs[i];
+ GlyphVector gv = run.glyphVector;
+ g2.drawGlyphVector(gv, x, y);
+ Rectangle2D r = gv.getLogicalBounds();
+ x += r.getWidth();
}
}
@@ -326,9 +468,16 @@ public final class TextLayout implements Cloneable
public float getAdvance ()
{
- float totalAdvance = 0f;
- for(int i = 0; i < runs.length; i++)
- totalAdvance += runs[i].getLogicalBounds().getWidth();
+ if (totalAdvance == -1F)
+ {
+ totalAdvance = 0f;
+ for(int i = 0; i < runs.length; i++)
+ {
+ Run run = runs[i];
+ GlyphVector gv = run.glyphVector;
+ totalAdvance += gv.getLogicalBounds().getWidth();
+ }
+ }
return totalAdvance;
}
@@ -363,27 +512,33 @@ public final class TextLayout implements Cloneable
double advance = 0;
for( int i = 0; i < ri; i++ )
- advance += runs[i].getLogicalBounds().getWidth();
+ {
+ Run run = runs[i];
+ GlyphVector gv = run.glyphVector;
+ advance += gv.getLogicalBounds().getWidth();
+ }
for( int i = ri; i <= charIndices[ secondEndpoint - 1 ][0]; i++ )
{
+ Run run = runs[i];
+ GlyphVector gv = run.glyphVector;
int dg;
if( i == charIndices[ secondEndpoint - 1 ][0] )
dg = charIndices[ secondEndpoint - 1][1];
else
- dg = runs[i].getNumGlyphs() - 1;
+ dg = gv.getNumGlyphs() - 1;
for( int j = 0; j <= dg; j++ )
{
- Rectangle2D r2 = (runs[i].getGlyphVisualBounds( j )).
+ Rectangle2D r2 = (gv.getGlyphVisualBounds( j )).
getBounds2D();
- Point2D p = runs[i].getGlyphPosition( j );
+ Point2D p = gv.getGlyphPosition( j );
r2.setRect( advance + r2.getX(), r2.getY(),
r2.getWidth(), r2.getHeight() );
gp.append(r2, false);
}
- advance += runs[i].getLogicalBounds().getWidth();
+ advance += gv.getLogicalBounds().getWidth();
}
return gp;
}
@@ -397,46 +552,138 @@ public final class TextLayout implements Cloneable
public float[] getCaretInfo (TextHitInfo hit)
{
- return getCaretInfo(hit, getBounds());
+ return getCaretInfo(hit, getNaturalBounds());
}
public float[] getCaretInfo (TextHitInfo hit, Rectangle2D bounds)
- throws NotImplementedException
{
- throw new Error ("not implemented");
+ float[] info = new float[2];
+ int index = hit.getCharIndex();
+ boolean leading = hit.isLeadingEdge();
+ // For the boundary cases we return the boundary runs.
+ Run run;
+
+ if (index >= length)
+ {
+ info[0] = getAdvance();
+ info[1] = 0;
+ }
+ else
+ {
+ if (index < 0)
+ {
+ run = runs[0];
+ index = 0;
+ leading = true;
+ }
+ else
+ run = findRunAtIndex(index);
+
+ int glyphIndex = index - run.runStart;
+ Shape glyphBounds = run.glyphVector.getGlyphLogicalBounds(glyphIndex);
+ Rectangle2D glyphRect = glyphBounds.getBounds2D();
+ if (isVertical())
+ {
+ if (leading)
+ info[0] = (float) glyphRect.getMinY();
+ else
+ info[0] = (float) glyphRect.getMaxY();
+ }
+ else
+ {
+ if (leading)
+ info[0] = (float) glyphRect.getMinX();
+ else
+ info[0] = (float) glyphRect.getMaxX();
+ }
+ info[0] += run.location;
+ info[1] = run.font.getItalicAngle();
+ }
+ return info;
}
- public Shape getCaretShape (TextHitInfo hit)
+ public Shape getCaretShape(TextHitInfo hit)
{
- return getCaretShape( hit, getBounds() );
+ return getCaretShape(hit, getBounds());
}
- public Shape getCaretShape (TextHitInfo hit, Rectangle2D bounds)
- throws NotImplementedException
+ public Shape getCaretShape(TextHitInfo hit, Rectangle2D bounds)
{
- throw new Error ("not implemented");
+ // TODO: Handle vertical shapes somehow.
+ float[] info = getCaretInfo(hit);
+ float x1 = info[0];
+ float y1 = (float) bounds.getMinY();
+ float x2 = info[0];
+ float y2 = (float) bounds.getMaxY();
+ if (info[1] != 0)
+ {
+ // Shift x1 and x2 according to the slope.
+ x1 -= y1 * info[1];
+ x2 -= y2 * info[1];
+ }
+ GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD, 2);
+ path.moveTo(x1, y1);
+ path.lineTo(x2, y2);
+ return path;
}
- public Shape[] getCaretShapes (int offset)
+ public Shape[] getCaretShapes(int offset)
{
- return getCaretShapes( offset, getBounds() );
+ return getCaretShapes(offset, getNaturalBounds());
}
- public Shape[] getCaretShapes (int offset, Rectangle2D bounds)
- throws NotImplementedException
+ public Shape[] getCaretShapes(int offset, Rectangle2D bounds)
{
- throw new Error ("not implemented");
+ return getCaretShapes(offset, bounds, DEFAULT_CARET_POLICY);
+ }
+
+ public Shape[] getCaretShapes(int offset, Rectangle2D bounds,
+ CaretPolicy policy)
+ {
+ // The RI returns a 2-size array even when there's only one
+ // shape in it.
+ Shape[] carets = new Shape[2];
+ TextHitInfo hit1 = TextHitInfo.afterOffset(offset);
+ int caretHit1 = hitToCaret(hit1);
+ TextHitInfo hit2 = hit1.getOtherHit();
+ int caretHit2 = hitToCaret(hit2);
+ if (caretHit1 == caretHit2)
+ {
+ carets[0] = getCaretShape(hit1);
+ carets[1] = null; // The RI returns null in this seldom case.
+ }
+ else
+ {
+ Shape caret1 = getCaretShape(hit1);
+ Shape caret2 = getCaretShape(hit2);
+ TextHitInfo strong = policy.getStrongCaret(hit1, hit2, this);
+ if (strong == hit1)
+ {
+ carets[0] = caret1;
+ carets[1] = caret2;
+ }
+ else
+ {
+ carets[0] = caret2;
+ carets[1] = caret1;
+ }
+ }
+ return carets;
}
public int getCharacterCount ()
{
- return string.length();
+ return length;
}
public byte getCharacterLevel (int index)
- throws NotImplementedException
{
- throw new Error ("not implemented");
+ byte level;
+ if( bidi == null )
+ level = 0;
+ else
+ level = (byte) bidi.getLevelAt(index);
+ return level;
}
public float getDescent ()
@@ -481,19 +728,21 @@ public final class TextLayout implements Cloneable
double advance = 0;
for( int i = 0; i < ri; i++ )
- advance += runs[i].getLogicalBounds().getWidth();
+ advance += runs[i].glyphVector.getLogicalBounds().getWidth();
for( int i = ri; i <= charIndices[ secondEndpoint - 1 ][0]; i++ )
{
+ Run run = runs[i];
+ GlyphVector gv = run.glyphVector;
int dg; // last index in this run to use.
if( i == charIndices[ secondEndpoint - 1 ][0] )
dg = charIndices[ secondEndpoint - 1][1];
else
- dg = runs[i].getNumGlyphs() - 1;
+ dg = gv.getNumGlyphs() - 1;
for(; gi <= dg; gi++ )
{
- Rectangle2D r2 = (runs[i].getGlyphLogicalBounds( gi )).
+ Rectangle2D r2 = (gv.getGlyphLogicalBounds( gi )).
getBounds2D();
if( r == null )
r = r2;
@@ -502,7 +751,7 @@ public final class TextLayout implements Cloneable
}
gi = 0; // reset glyph index into run for next run.
- advance += runs[i].getLogicalBounds().getWidth();
+ advance += gv.getLogicalBounds().getWidth();
}
return r;
@@ -510,33 +759,137 @@ public final class TextLayout implements Cloneable
public int[] getLogicalRangesForVisualSelection (TextHitInfo firstEndpoint,
TextHitInfo secondEndpoint)
- throws NotImplementedException
{
- throw new Error ("not implemented");
+ // Check parameters.
+ checkHitInfo(firstEndpoint);
+ checkHitInfo(secondEndpoint);
+
+ // Convert to visual and order correctly.
+ int start = hitToCaret(firstEndpoint);
+ int end = hitToCaret(secondEndpoint);
+ if (start > end)
+ {
+ // Swap start and end so that end >= start.
+ int temp = start;
+ start = end;
+ end = temp;
+ }
+
+ // Now walk through the visual indices and mark the included pieces.
+ boolean[] include = new boolean[length];
+ for (int i = start; i < end; i++)
+ {
+ include[visualToLogical[i]] = true;
+ }
+
+ // Count included runs.
+ int numRuns = 0;
+ boolean in = false;
+ for (int i = 0; i < length; i++)
+ {
+ if (include[i] != in) // At each run in/out point we toggle the in var.
+ {
+ in = ! in;
+ if (in) // At each run start we count up.
+ numRuns++;
+ }
+ }
+
+ // Put together the ranges array.
+ int[] ranges = new int[numRuns * 2];
+ int index = 0;
+ in = false;
+ for (int i = 0; i < length; i++)
+ {
+ if (include[i] != in)
+ {
+ ranges[index] = i;
+ index++;
+ in = ! in;
+ }
+ }
+ // If the last run ends at the very end, include that last bit too.
+ if (in)
+ ranges[index] = length;
+
+ return ranges;
+ }
+
+ public TextHitInfo getNextLeftHit(int offset)
+ {
+ return getNextLeftHit(offset, DEFAULT_CARET_POLICY);
}
- public TextHitInfo getNextLeftHit (int offset)
- throws NotImplementedException
+ public TextHitInfo getNextLeftHit(int offset, CaretPolicy policy)
{
- throw new Error ("not implemented");
+ if (policy == null)
+ throw new IllegalArgumentException("Null policy not allowed");
+ if (offset < 0 || offset > length)
+ throw new IllegalArgumentException("Offset out of bounds");
+
+ TextHitInfo hit1 = TextHitInfo.afterOffset(offset);
+ TextHitInfo hit2 = hit1.getOtherHit();
+
+ TextHitInfo strong = policy.getStrongCaret(hit1, hit2, this);
+ TextHitInfo next = getNextLeftHit(strong);
+ TextHitInfo ret = null;
+ if (next != null)
+ {
+ TextHitInfo next2 = getVisualOtherHit(next);
+ ret = policy.getStrongCaret(next2, next, this);
+ }
+ return ret;
}
public TextHitInfo getNextLeftHit (TextHitInfo hit)
- throws NotImplementedException
{
- throw new Error ("not implemented");
+ checkHitInfo(hit);
+ int index = hitToCaret(hit);
+ TextHitInfo next = null;
+ if (index != 0)
+ {
+ index--;
+ next = caretToHit(index);
+ }
+ return next;
}
- public TextHitInfo getNextRightHit (int offset)
- throws NotImplementedException
+ public TextHitInfo getNextRightHit(int offset)
{
- throw new Error ("not implemented");
+ return getNextRightHit(offset, DEFAULT_CARET_POLICY);
}
- public TextHitInfo getNextRightHit (TextHitInfo hit)
- throws NotImplementedException
+ public TextHitInfo getNextRightHit(int offset, CaretPolicy policy)
{
- throw new Error ("not implemented");
+ if (policy == null)
+ throw new IllegalArgumentException("Null policy not allowed");
+ if (offset < 0 || offset > length)
+ throw new IllegalArgumentException("Offset out of bounds");
+
+ TextHitInfo hit1 = TextHitInfo.afterOffset(offset);
+ TextHitInfo hit2 = hit1.getOtherHit();
+
+ TextHitInfo next = getNextRightHit(policy.getStrongCaret(hit1, hit2, this));
+ TextHitInfo ret = null;
+ if (next != null)
+ {
+ TextHitInfo next2 = getVisualOtherHit(next);
+ ret = policy.getStrongCaret(next2, next, this);
+ }
+ return ret;
+ }
+
+ public TextHitInfo getNextRightHit(TextHitInfo hit)
+ {
+ checkHitInfo(hit);
+ int index = hitToCaret(hit);
+ TextHitInfo next = null;
+ if (index < length)
+ {
+ index++;
+ next = caretToHit(index);
+ }
+ return next;
}
public Shape getOutline (AffineTransform tx)
@@ -545,8 +898,9 @@ public final class TextLayout implements Cloneable
GeneralPath gp = new GeneralPath();
for(int i = 0; i < runs.length; i++)
{
- gp.append( runs[i].getOutline( x, 0f ), false );
- Rectangle2D r = runs[i].getLogicalBounds();
+ GlyphVector gv = runs[i].glyphVector;
+ gp.append( gv.getOutline( x, 0f ), false );
+ Rectangle2D r = gv.getLogicalBounds();
x += r.getWidth();
}
if( tx != null )
@@ -562,27 +916,28 @@ public final class TextLayout implements Cloneable
return 0f;
// No trailing whitespace
- if( !Character.isWhitespace( string.charAt( string.length() -1 ) ) )
+ if( !Character.isWhitespace( string[offset + length - 1]) )
return getAdvance();
// Get length of all runs up to the last
for(int i = 0; i < runs.length - 1; i++)
- totalAdvance += runs[i].getLogicalBounds().getWidth();
+ totalAdvance += runs[i].glyphVector.getLogicalBounds().getWidth();
- int lastRun = runIndices[ runs.length - 1 ][0];
- int j = string.length() - 1;
- while( j >= lastRun && Character.isWhitespace( string.charAt( j ) ) ) j--;
+ int lastRun = runs[runs.length - 1].runStart;
+ int j = length - 1;
+ while( j >= lastRun && Character.isWhitespace( string[j] ) ) j--;
if( j < lastRun )
return totalAdvance; // entire last run is whitespace
int lastNonWSChar = j - lastRun;
j = 0;
- while( runs[ runs.length - 1 ].getGlyphCharIndex( j )
+ while( runs[ runs.length - 1 ].glyphVector.getGlyphCharIndex( j )
<= lastNonWSChar )
{
- totalAdvance += runs[ runs.length - 1 ].getGlyphLogicalBounds( j ).
- getBounds2D().getWidth();
+ totalAdvance += runs[ runs.length - 1 ].glyphVector
+ .getGlyphLogicalBounds( j )
+ .getBounds2D().getWidth();
j ++;
}
@@ -599,15 +954,129 @@ public final class TextLayout implements Cloneable
public Shape getVisualHighlightShape (TextHitInfo firstEndpoint,
TextHitInfo secondEndpoint,
Rectangle2D bounds)
- throws NotImplementedException
{
- throw new Error ("not implemented");
+ GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
+ Shape caret1 = getCaretShape(firstEndpoint, bounds);
+ path.append(caret1, false);
+ Shape caret2 = getCaretShape(secondEndpoint, bounds);
+ path.append(caret2, false);
+ // Append left (top) bounds to selection if necessary.
+ int c1 = hitToCaret(firstEndpoint);
+ int c2 = hitToCaret(secondEndpoint);
+ if (c1 == 0 || c2 == 0)
+ {
+ path.append(left(bounds), false);
+ }
+ // Append right (bottom) bounds if necessary.
+ if (c1 == length || c2 == length)
+ {
+ path.append(right(bounds), false);
+ }
+ return path.getBounds2D();
+ }
+
+ /**
+ * Returns the shape that makes up the left (top) edge of this text layout.
+ *
+ * @param b the bounds
+ *
+ * @return the shape that makes up the left (top) edge of this text layout
+ */
+ private Shape left(Rectangle2D b)
+ {
+ GeneralPath left = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
+ left.append(getCaretShape(TextHitInfo.beforeOffset(0)), false);
+ if (isVertical())
+ {
+ float y = (float) b.getMinY();
+ left.append(new Line2D.Float((float) b.getMinX(), y,
+ (float) b.getMaxX(), y), false);
+ }
+ else
+ {
+ float x = (float) b.getMinX();
+ left.append(new Line2D.Float(x, (float) b.getMinY(),
+ x, (float) b.getMaxY()), false);
+ }
+ return left.getBounds2D();
+ }
+
+ /**
+ * Returns the shape that makes up the right (bottom) edge of this text
+ * layout.
+ *
+ * @param b the bounds
+ *
+ * @return the shape that makes up the right (bottom) edge of this text
+ * layout
+ */
+ private Shape right(Rectangle2D b)
+ {
+ GeneralPath right = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
+ right.append(getCaretShape(TextHitInfo.afterOffset(length)), false);
+ if (isVertical())
+ {
+ float y = (float) b.getMaxY();
+ right.append(new Line2D.Float((float) b.getMinX(), y,
+ (float) b.getMaxX(), y), false);
+ }
+ else
+ {
+ float x = (float) b.getMaxX();
+ right.append(new Line2D.Float(x, (float) b.getMinY(),
+ x, (float) b.getMaxY()), false);
+ }
+ return right.getBounds2D();
}
public TextHitInfo getVisualOtherHit (TextHitInfo hit)
- throws NotImplementedException
{
- throw new Error ("not implemented");
+ checkHitInfo(hit);
+ int hitIndex = hit.getCharIndex();
+
+ int index;
+ boolean leading;
+ if (hitIndex == -1 || hitIndex == length)
+ {
+ // Boundary case.
+ int visual;
+ if (isLeftToRight() == (hitIndex == -1))
+ visual = 0;
+ else
+ visual = length - 1;
+ index = visualToLogical[visual];
+ if (isLeftToRight() == (hitIndex == -1))
+ leading = isCharacterLTR(index); // LTR.
+ else
+ leading = ! isCharacterLTR(index); // RTL.
+ }
+ else
+ {
+ // Normal case.
+ int visual = logicalToVisual[hitIndex];
+ boolean b;
+ if (isCharacterLTR(hitIndex) == hit.isLeadingEdge())
+ {
+ visual--;
+ b = false;
+ }
+ else
+ {
+ visual++;
+ b = true;
+ }
+ if (visual >= 0 && visual < length)
+ {
+ index = visualToLogical[visual];
+ leading = b == isLeftToRight();
+ }
+ else
+ {
+ index = b == isLeftToRight() ? length : -1;
+ leading = index == length;
+ }
+ }
+ return leading ? TextHitInfo.leading(index) : TextHitInfo.trailing(index);
}
/**
@@ -622,16 +1091,19 @@ public final class TextLayout implements Cloneable
int nglyphs = 0; // # of whitespace chars
// determine last non-whitespace char.
- int lastNWS = string.length() - 1;
- while( Character.isWhitespace( string.charAt( lastNWS ) ) ) lastNWS--;
+ int lastNWS = offset + length - 1;
+ while( Character.isWhitespace( string[lastNWS] ) ) lastNWS--;
// locations of the glyphs.
- int[] wsglyphs = new int[string.length() * 10];
+ int[] wsglyphs = new int[length * 10];
for(int run = 0; run < runs.length; run++ )
- for(int i = 0; i < runs[run].getNumGlyphs(); i++ )
+ {
+ Run current = runs[run];
+ for(int i = 0; i < current.glyphVector.getNumGlyphs(); i++ )
{
- int cindex = runIndices[run][0] + runs[run].getGlyphCharIndex( i );
- if( Character.isWhitespace( string.charAt( cindex ) ) )
+ int cindex = current.runStart
+ + current.glyphVector.getGlyphCharIndex( i );
+ if( Character.isWhitespace( string[cindex] ) )
// && cindex < lastNWS )
{
wsglyphs[ nglyphs * 2 ] = run;
@@ -639,34 +1111,144 @@ public final class TextLayout implements Cloneable
nglyphs++;
}
}
-
+ }
deltaW = deltaW / nglyphs; // Change in width per whitespace glyph
double w = 0;
int cws = 0;
// Shift all characters
for(int run = 0; run < runs.length; run++ )
- for(int i = 0; i < runs[ run ].getNumGlyphs(); i++ )
- {
- if( wsglyphs[ cws * 2 ] == run && wsglyphs[ cws * 2 + 1 ] == i )
- {
- cws++; // update 'current whitespace'
- w += deltaW; // increment the shift
- }
- Point2D p = runs[ run ].getGlyphPosition( i );
- p.setLocation( p.getX() + w, p.getY() );
- runs[ run ].setGlyphPosition( i, p );
- }
+ {
+ Run current = runs[run];
+ for(int i = 0; i < current.glyphVector.getNumGlyphs(); i++ )
+ {
+ if( wsglyphs[ cws * 2 ] == run && wsglyphs[ cws * 2 + 1 ] == i )
+ {
+ cws++; // update 'current whitespace'
+ w += deltaW; // increment the shift
+ }
+ Point2D p = current.glyphVector.getGlyphPosition( i );
+ p.setLocation( p.getX() + w, p.getY() );
+ current.glyphVector.setGlyphPosition( i, p );
+ }
+ }
}
public TextHitInfo hitTestChar (float x, float y)
{
- return hitTestChar(x, y, getBounds());
+ return hitTestChar(x, y, getNaturalBounds());
}
+ /**
+ * Finds the character hit at the specified point. This 'clips' this
+ * text layout against the specified <code>bounds</code> rectangle. That
+ * means that in the case where a point is outside these bounds, this method
+ * returns the leading edge of the first character or the trailing edge of
+ * the last character.
+ *
+ * @param x the X location to test
+ * @param y the Y location to test
+ * @param bounds the bounds to test against
+ *
+ * @return the character hit at the specified point
+ */
public TextHitInfo hitTestChar (float x, float y, Rectangle2D bounds)
- throws NotImplementedException
{
- throw new Error ("not implemented");
+ // Check bounds.
+ if (isVertical())
+ {
+ if (y < bounds.getMinY())
+ return TextHitInfo.leading(0);
+ else if (y > bounds.getMaxY())
+ return TextHitInfo.trailing(getCharacterCount() - 1);
+ }
+ else
+ {
+ if (x < bounds.getMinX())
+ return TextHitInfo.leading(0);
+ else if (x > bounds.getMaxX())
+ return TextHitInfo.trailing(getCharacterCount() - 1);
+ }
+
+ TextHitInfo hitInfo = null;
+ if (isVertical())
+ {
+ // Search for the run at the location.
+ // TODO: Perform binary search for maximum efficiency. However, we
+ // need the run location laid out statically to do that.
+ int numRuns = runs.length;
+ Run hitRun = null;
+ for (int i = 0; i < numRuns && hitRun == null; i++)
+ {
+ Run run = runs[i];
+ Rectangle2D lBounds = run.glyphVector.getLogicalBounds();
+ if (lBounds.getMinY() + run.location <= y
+ && lBounds.getMaxY() + run.location >= y)
+ hitRun = run;
+ }
+ // Now we have (hopefully) found a run that hits. Now find the
+ // right character.
+ if (hitRun != null)
+ {
+ GlyphVector gv = hitRun.glyphVector;
+ for (int i = hitRun.runStart;
+ i < hitRun.runEnd && hitInfo == null; i++)
+ {
+ int gi = i - hitRun.runStart;
+ Rectangle2D lBounds = gv.getGlyphLogicalBounds(gi)
+ .getBounds2D();
+ if (lBounds.getMinY() + hitRun.location <= y
+ && lBounds.getMaxY() + hitRun.location >= y)
+ {
+ // Found hit. Now check if we are leading or trailing.
+ boolean leading = true;
+ if (lBounds.getCenterY() + hitRun.location <= y)
+ leading = false;
+ hitInfo = leading ? TextHitInfo.leading(i)
+ : TextHitInfo.trailing(i);
+ }
+ }
+ }
+ }
+ else
+ {
+ // Search for the run at the location.
+ // TODO: Perform binary search for maximum efficiency. However, we
+ // need the run location laid out statically to do that.
+ int numRuns = runs.length;
+ Run hitRun = null;
+ for (int i = 0; i < numRuns && hitRun == null; i++)
+ {
+ Run run = runs[i];
+ Rectangle2D lBounds = run.glyphVector.getLogicalBounds();
+ if (lBounds.getMinX() + run.location <= x
+ && lBounds.getMaxX() + run.location >= x)
+ hitRun = run;
+ }
+ // Now we have (hopefully) found a run that hits. Now find the
+ // right character.
+ if (hitRun != null)
+ {
+ GlyphVector gv = hitRun.glyphVector;
+ for (int i = hitRun.runStart;
+ i < hitRun.runEnd && hitInfo == null; i++)
+ {
+ int gi = i - hitRun.runStart;
+ Rectangle2D lBounds = gv.getGlyphLogicalBounds(gi)
+ .getBounds2D();
+ if (lBounds.getMinX() + hitRun.location <= x
+ && lBounds.getMaxX() + hitRun.location >= x)
+ {
+ // Found hit. Now check if we are leading or trailing.
+ boolean leading = true;
+ if (lBounds.getCenterX() + hitRun.location <= x)
+ leading = false;
+ hitInfo = leading ? TextHitInfo.leading(i)
+ : TextHitInfo.trailing(i);
+ }
+ }
+ }
+ }
+ return hitInfo;
}
public boolean isLeftToRight ()
@@ -680,18 +1262,127 @@ public final class TextLayout implements Cloneable
}
public int hashCode ()
- throws NotImplementedException
{
- throw new Error ("not implemented");
+ // This is implemented in sync to equals().
+ if (hash == 0 && runs.length > 0)
+ {
+ hash = runs.length;
+ for (int i = 0; i < runs.length; i++)
+ hash ^= runs[i].glyphVector.hashCode();
+ }
+ return hash;
}
public String toString ()
{
- return "TextLayout [string:"+string+", Font:"+font+" Rendercontext:"+
+ return "TextLayout [string:"+ new String(string, offset, length)
+ +" Rendercontext:"+
frc+"]";
}
/**
+ * Returns the natural bounds of that text layout. This is made up
+ * of the ascent plus descent and the text advance.
+ *
+ * @return the natural bounds of that text layout
+ */
+ private Rectangle2D getNaturalBounds()
+ {
+ if (naturalBounds == null)
+ naturalBounds = new Rectangle2D.Float(0.0F, -getAscent(), getAdvance(),
+ getAscent() + getDescent());
+ return naturalBounds;
+ }
+
+ private void checkHitInfo(TextHitInfo hit)
+ {
+ if (hit == null)
+ throw new IllegalArgumentException("Null hit info not allowed");
+ int index = hit.getInsertionIndex();
+ if (index < 0 || index > length)
+ throw new IllegalArgumentException("Hit index out of range");
+ }
+
+ private int hitToCaret(TextHitInfo hit)
+ {
+ int index = hit.getCharIndex();
+ int ret;
+ if (index < 0)
+ ret = isLeftToRight() ? 0 : length;
+ else if (index >= length)
+ ret = isLeftToRight() ? length : 0;
+ else
+ {
+ ret = logicalToVisual[index];
+ if (hit.isLeadingEdge() != isCharacterLTR(index))
+ ret++;
+ }
+ return ret;
+ }
+
+ private TextHitInfo caretToHit(int index)
+ {
+ TextHitInfo hit;
+ if (index == 0 || index == length)
+ {
+ if ((index == length) == isLeftToRight())
+ hit = TextHitInfo.leading(length);
+ else
+ hit = TextHitInfo.trailing(-1);
+ }
+ else
+ {
+ int logical = visualToLogical[index];
+ boolean leading = isCharacterLTR(logical); // LTR.
+ hit = leading ? TextHitInfo.leading(logical)
+ : TextHitInfo.trailing(logical);
+ }
+ return hit;
+ }
+
+ private boolean isCharacterLTR(int index)
+ {
+ byte level = getCharacterLevel(index);
+ return (level & 1) == 0;
+ }
+
+ /**
+ * Finds the run that holds the specified (logical) character index. This
+ * returns <code>null</code> when the index is not inside the range.
+ *
+ * @param index the index of the character to find
+ *
+ * @return the run that holds the specified character
+ */
+ private Run findRunAtIndex(int index)
+ {
+ Run found = null;
+ // TODO: Can we do better than linear searching here?
+ for (int i = 0; i < runs.length && found == null; i++)
+ {
+ Run run = runs[i];
+ if (run.runStart <= index && run.runEnd > index)
+ found = run;
+ }
+ return found;
+ }
+
+ /**
+ * Computes the layout locations for each run.
+ */
+ private void layoutRuns()
+ {
+ float loc = 0.0F;
+ float lastWidth = 0.0F;
+ for (int i = 0; i < runs.length; i++)
+ {
+ runs[i].location = loc;
+ Rectangle2D bounds = runs[i].glyphVector.getLogicalBounds();
+ loc += isVertical() ? bounds.getHeight() : bounds.getWidth();
+ }
+ }
+
+ /**
* Inner class describing a caret policy
*/
public static class CaretPolicy
@@ -703,9 +1394,25 @@ public final class TextLayout implements Cloneable
public TextHitInfo getStrongCaret(TextHitInfo hit1,
TextHitInfo hit2,
TextLayout layout)
- throws NotImplementedException
{
- throw new Error ("not implemented");
+ byte l1 = layout.getCharacterLevel(hit1.getCharIndex());
+ byte l2 = layout.getCharacterLevel(hit2.getCharIndex());
+ TextHitInfo strong;
+ if (l1 == l2)
+ {
+ if (hit2.isLeadingEdge() && ! hit1.isLeadingEdge())
+ strong = hit2;
+ else
+ strong = hit1;
+ }
+ else
+ {
+ if (l1 < l2)
+ strong = hit1;
+ else
+ strong = hit2;
+ }
+ return strong;
}
}
}
diff --git a/libjava/classpath/java/awt/geom/AffineTransform.java b/libjava/classpath/java/awt/geom/AffineTransform.java
index 55b6883553d..5bc51ddee81 100644
--- a/libjava/classpath/java/awt/geom/AffineTransform.java
+++ b/libjava/classpath/java/awt/geom/AffineTransform.java
@@ -1401,10 +1401,10 @@ public class AffineTransform implements Cloneable, Serializable
* documented, but appears to be the same as:
* <pre>
* long l = Double.doubleToLongBits(getScaleX());
- * l = l * 31 + Double.doubleToLongBits(getShearY());
* l = l * 31 + Double.doubleToLongBits(getShearX());
- * l = l * 31 + Double.doubleToLongBits(getScaleY());
* l = l * 31 + Double.doubleToLongBits(getTranslateX());
+ * l = l * 31 + Double.doubleToLongBits(getShearY());
+ * l = l * 31 + Double.doubleToLongBits(getScaleY());
* l = l * 31 + Double.doubleToLongBits(getTranslateY());
* return (int) ((l >> 32) ^ l);
* </pre>
@@ -1413,12 +1413,12 @@ public class AffineTransform implements Cloneable, Serializable
*/
public int hashCode()
{
- long l = Double.doubleToLongBits(m00);
- l = l * 31 + Double.doubleToLongBits(m10);
- l = l * 31 + Double.doubleToLongBits(m01);
- l = l * 31 + Double.doubleToLongBits(m11);
- l = l * 31 + Double.doubleToLongBits(m02);
- l = l * 31 + Double.doubleToLongBits(m12);
+ long l = Double.doubleToLongBits(m00);
+ l = l * 31 + Double.doubleToLongBits(m01);
+ l = l * 31 + Double.doubleToLongBits(m02);
+ l = l * 31 + Double.doubleToLongBits(m10);
+ l = l * 31 + Double.doubleToLongBits(m11);
+ l = l * 31 + Double.doubleToLongBits(m12);
return (int) ((l >> 32) ^ l);
}
diff --git a/libjava/classpath/java/awt/geom/Arc2D.java b/libjava/classpath/java/awt/geom/Arc2D.java
index eff34a08144..8d5b01cd5bb 100644
--- a/libjava/classpath/java/awt/geom/Arc2D.java
+++ b/libjava/classpath/java/awt/geom/Arc2D.java
@@ -774,14 +774,9 @@ public abstract class Arc2D extends RectangularShape
y = a.getY();
w = a.getWidth();
h = a.getHeight();
- double start = a.getAngleStart() * (Math.PI / 180);
- double extent = a.getAngleExtent() * (Math.PI / 180);
+ double start = Math.toRadians(a.getAngleStart());
+ double extent = Math.toRadians(a.getAngleExtent());
- if (extent < 0)
- {
- extent = -extent;
- start = 2 * Math.PI - extent + start;
- }
this.start = start;
this.extent = extent;
@@ -790,11 +785,11 @@ public abstract class Arc2D extends RectangularShape
limit = -1;
else if (extent == 0)
limit = type;
- else if (extent <= Math.PI / 2.0)
+ else if (Math.abs(extent) <= Math.PI / 2.0)
limit = type + 1;
- else if (extent <= Math.PI)
+ else if (Math.abs(extent) <= Math.PI)
limit = type + 2;
- else if (extent <= 3.0 * (Math.PI / 2.0))
+ else if (Math.abs(extent) <= 3.0 * (Math.PI / 2.0))
limit = type + 3;
else
limit = type + 4;
@@ -909,9 +904,20 @@ public abstract class Arc2D extends RectangularShape
double kappa = (Math.sqrt(2.0) - 1.0) * (4.0 / 3.0);
double quad = (Math.PI / 2.0);
- double curr_begin = start + (current - 1) * quad;
- double curr_extent = Math.min((start + extent) - curr_begin, quad);
- double portion_of_a_quadrant = curr_extent / quad;
+ double curr_begin;
+ double curr_extent;
+ if (extent > 0)
+ {
+ curr_begin = start + (current - 1) * quad;
+ curr_extent = Math.min((start + extent) - curr_begin, quad);
+ }
+ else
+ {
+ curr_begin = start - (current - 1) * quad;
+ curr_extent = Math.max((start + extent) - curr_begin, -quad);
+ }
+
+ double portion_of_a_quadrant = Math.abs(curr_extent / quad);
double x0 = xmid + rx * Math.cos(curr_begin);
double y0 = ymid - ry * Math.sin(curr_begin);
@@ -932,7 +938,11 @@ public abstract class Arc2D extends RectangularShape
// will *subtract* the y value of this control vector from our first
// point.
cvec[0] = 0;
- cvec[1] = len;
+ if (extent > 0)
+ cvec[1] = len;
+ else
+ cvec[1] = -len;
+
trans.scale(rx, ry);
trans.rotate(angle);
trans.transform(cvec, 0, cvec, 0, 1);
@@ -942,7 +952,11 @@ public abstract class Arc2D extends RectangularShape
// control vector #2 would, ideally, be sticking out and to the
// right, in a first quadrant arc segment. again, subtraction of y.
cvec[0] = 0;
- cvec[1] = -len;
+ if (extent > 0)
+ cvec[1] = -len;
+ else
+ cvec[1] = len;
+
trans.rotate(curr_extent);
trans.transform(cvec, 0, cvec, 0, 1);
coords[2] = x1 + cvec[0];
diff --git a/libjava/classpath/java/awt/geom/GeneralPath.java b/libjava/classpath/java/awt/geom/GeneralPath.java
index e0ca8e18357..1e9ede5ee67 100644
--- a/libjava/classpath/java/awt/geom/GeneralPath.java
+++ b/libjava/classpath/java/awt/geom/GeneralPath.java
@@ -86,7 +86,7 @@ public final class GeneralPath implements Shape, Cloneable
public static final int WIND_EVEN_ODD
= java.awt.geom.PathIterator.WIND_EVEN_ODD;
- /** Same constant as {@link PathIterator.WIND_NON_ZERO}. */
+ /** Same constant as {@link PathIterator#WIND_NON_ZERO}. */
public static final int WIND_NON_ZERO
= java.awt.geom.PathIterator.WIND_NON_ZERO;
@@ -140,7 +140,11 @@ public final class GeneralPath implements Shape, Cloneable
/**
* Constructs a GeneralPath with a specific winding rule
* and the default initial capacity (20).
- * @param rule the winding rule (WIND_NON_ZERO or WIND_EVEN_ODD)
+ * @param rule the winding rule ({@link #WIND_NON_ZERO} or
+ * {@link #WIND_EVEN_ODD})
+ *
+ * @throws IllegalArgumentException if <code>rule</code> is not one of the
+ * listed values.
*/
public GeneralPath(int rule)
{
@@ -151,8 +155,12 @@ public final class GeneralPath implements Shape, Cloneable
* Constructs a GeneralPath with a specific winding rule
* and the initial capacity. The initial capacity should be
* the approximate number of path segments to be used.
- * @param rule the winding rule (WIND_NON_ZERO or WIND_EVEN_ODD)
+ * @param rule the winding rule ({@link #WIND_NON_ZERO} or
+ * {@link #WIND_EVEN_ODD})
* @param capacity the inital capacity, in path segments
+ *
+ * @throws IllegalArgumentException if <code>rule</code> is not one of the
+ * listed values.
*/
public GeneralPath(int rule, int capacity)
{
@@ -169,7 +177,10 @@ public final class GeneralPath implements Shape, Cloneable
/**
* Constructs a GeneralPath from an arbitrary shape object.
* The Shapes PathIterator path and winding rule will be used.
- * @param s the shape
+ *
+ * @param s the shape (<code>null</code> not permitted).
+ *
+ * @throws NullPointerException if <code>shape</code> is <code>null</code>.
*/
public GeneralPath(Shape s)
{
@@ -183,6 +194,9 @@ public final class GeneralPath implements Shape, Cloneable
/**
* Adds a new point to a path.
+ *
+ * @param x the x-coordinate.
+ * @param y the y-coordinate.
*/
public void moveTo(float x, float y)
{
@@ -263,6 +277,11 @@ public final class GeneralPath implements Shape, Cloneable
* Appends the segments of a Shape to the path. If <code>connect</code> is
* true, the new path segments are connected to the existing one with a line.
* The winding rule of the Shape is ignored.
+ *
+ * @param s the shape (<code>null</code> not permitted).
+ * @param connect whether to connect the new shape to the existing path.
+ *
+ * @throws NullPointerException if <code>s</code> is <code>null</code>.
*/
public void append(Shape s, boolean connect)
{
@@ -276,7 +295,7 @@ public final class GeneralPath implements Shape, Cloneable
* PathIterator#SEG_LINETO} segment.
*
* @param iter the PathIterator specifying which segments shall be
- * appended.
+ * appended (<code>null</code> not permitted).
*
* @param connect <code>true</code> for substituting the initial
* {@link PathIterator#SEG_MOVETO} segment by a {@link
@@ -327,6 +346,8 @@ public final class GeneralPath implements Shape, Cloneable
/**
* Returns the path&#x2019;s current winding rule.
+ *
+ * @return {@link #WIND_EVEN_ODD} or {@link #WIND_NON_ZERO}.
*/
public int getWindingRule()
{
@@ -338,6 +359,8 @@ public final class GeneralPath implements Shape, Cloneable
* considered &#x2019;inside&#x2019; or &#x2019;outside&#x2019; the path
* on drawing. Valid rules are WIND_EVEN_ODD for an even-odd winding rule,
* or WIND_NON_ZERO for a non-zero winding rule.
+ *
+ * @param rule the rule ({@link #WIND_EVEN_ODD} or {@link #WIND_NON_ZERO}).
*/
public void setWindingRule(int rule)
{
@@ -348,6 +371,8 @@ public final class GeneralPath implements Shape, Cloneable
/**
* Returns the current appending point of the path.
+ *
+ * @return The point.
*/
public Point2D getCurrentPoint()
{
@@ -367,6 +392,8 @@ public final class GeneralPath implements Shape, Cloneable
/**
* Applies a transform to the path.
+ *
+ * @param xform the transform (<code>null</code> not permitted).
*/
public void transform(AffineTransform xform)
{
@@ -706,6 +733,8 @@ public final class GeneralPath implements Shape, Cloneable
/**
* Helper method - ensure the size of the data arrays,
* otherwise, reallocate new ones twice the size
+ *
+ * @param size the minimum array size.
*/
private void ensureSize(int size)
{
diff --git a/libjava/classpath/java/awt/geom/RectangularShape.java b/libjava/classpath/java/awt/geom/RectangularShape.java
index 8f66dabf2e7..3ee1615413f 100644
--- a/libjava/classpath/java/awt/geom/RectangularShape.java
+++ b/libjava/classpath/java/awt/geom/RectangularShape.java
@@ -326,15 +326,12 @@ public abstract class RectangularShape implements Shape, Cloneable
/**
* Returns a bounding box for this shape, in integer format. Notice that you
- * may get a tighter bound with getBounds2D. If the frame is empty, the
- * box is the default empty box at the origin.
+ * may get a tighter bound with getBounds2D.
*
* @return a bounding box
*/
public Rectangle getBounds()
{
- if (isEmpty())
- return new Rectangle();
double x = getX();
double y = getY();
double maxx = Math.ceil(x + getWidth());
diff --git a/libjava/classpath/java/awt/geom/RoundRectangle2D.java b/libjava/classpath/java/awt/geom/RoundRectangle2D.java
index ac0e6f8128a..ac4d89fff80 100644
--- a/libjava/classpath/java/awt/geom/RoundRectangle2D.java
+++ b/libjava/classpath/java/awt/geom/RoundRectangle2D.java
@@ -1,5 +1,5 @@
/* RoundRectangle2D.java -- represents a rectangle with rounded corners
- Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
+ Copyright (C) 2000, 2002, 2003, 2004, 2006, Free Software Foundation
This file is part of GNU Classpath.
@@ -37,7 +37,6 @@ exception statement from your version. */
package java.awt.geom;
-import java.util.NoSuchElementException;
/** This class implements a rectangle with rounded corners.
@@ -46,13 +45,29 @@ import java.util.NoSuchElementException;
*/
public abstract class RoundRectangle2D extends RectangularShape
{
- /** Return the arc height of this round rectangle. */
+ /**
+ * Return the arc height of this round rectangle. The arc height and width
+ * control the roundness of the corners of the rectangle.
+ *
+ * @return The arc height.
+ *
+ * @see #getArcWidth()
+ */
public abstract double getArcHeight();
- /** Return the arc width of this round rectangle. */
+ /**
+ * Return the arc width of this round rectangle. The arc width and height
+ * control the roundness of the corners of the rectangle.
+ *
+ * @return The arc width.
+ *
+ * @see #getArcHeight()
+ */
public abstract double getArcWidth();
- /** Set the values of this round rectangle
+ /**
+ * Set the values of this round rectangle.
+ *
* @param x The x coordinate
* @param y The y coordinate
* @param w The width
@@ -63,14 +78,16 @@ public abstract class RoundRectangle2D extends RectangularShape
public abstract void setRoundRect(double x, double y, double w, double h,
double arcWidth, double arcHeight);
- /** Create a RoundRectangle2D. This is protected because this class
+ /**
+ * Create a RoundRectangle2D. This is protected because this class
* is abstract and cannot be instantiated.
*/
protected RoundRectangle2D()
{
}
- /** Return true if this object contains the specified point.
+ /**
+ * Return true if this object contains the specified point.
* @param x The x coordinate
* @param y The y coordinate
*/
@@ -106,7 +123,8 @@ public abstract class RoundRectangle2D extends RectangularShape
return dx * dx + dy * dy <= 1.0;
}
- /** Return true if this object contains the specified rectangle
+ /**
+ * Return true if this object contains the specified rectangle
* @param x The x coordinate
* @param y The y coordinate
* @param w The width
@@ -120,176 +138,185 @@ public abstract class RoundRectangle2D extends RectangularShape
&& contains(x + w, y));
}
- /** Return a new path iterator which iterates over this rectangle.
+ /**
+ * Return a new path iterator which iterates over this rectangle.
+ *
* @param at An affine transform to apply to the object
*/
- public PathIterator getPathIterator(final AffineTransform at)
+ public PathIterator getPathIterator(final AffineTransform at)
{
- final double minx = getX();
- final double miny = getY();
- final double maxx = minx + getWidth();
- final double maxy = miny + getHeight();
- final double arcwidth = getArcWidth();
- final double archeight = getArcHeight();
- return new PathIterator()
+ double arcW = Math.min(getArcWidth(), getWidth());
+ double arcH = Math.min(getArcHeight(), getHeight());
+
+ // check for special cases...
+ if (arcW <= 0 || arcH <= 0)
+ {
+ Rectangle2D r = new Rectangle2D.Double(getX(), getY(), getWidth(),
+ getHeight());
+ return r.getPathIterator(at);
+ }
+ else if (arcW >= getWidth() && arcH >= getHeight())
+ {
+ Ellipse2D e = new Ellipse2D.Double(getX(), getY(), getWidth(),
+ getHeight());
+ return e.getPathIterator(at);
+ }
+
+ // otherwise return the standard case...
+ return new PathIterator()
+ {
+ double x = getX();
+ double y = getY();
+ double w = getWidth();
+ double h = getHeight();
+ double arcW = Math.min(getArcWidth(), w);
+ double arcH = Math.min(getArcHeight(), h);
+ Arc2D.Double arc = new Arc2D.Double();
+ PathIterator corner;
+ int step = -1;
+
+ public int currentSegment(double[] coords)
+ {
+ if (corner != null) // steps 1, 3, 5 and 7
+ {
+ int r = corner.currentSegment(coords);
+ if (r == SEG_MOVETO)
+ r = SEG_LINETO;
+ return r;
+ }
+ if (step == -1)
+ {
+ // move to the start position
+ coords[0] = x + w - arcW / 2;
+ coords[1] = y;
+ }
+ else if (step == 0)
+ {
+ // top line
+ coords[0] = x + arcW / 2;
+ coords[1] = y;
+ }
+ else if (step == 2)
+ {
+ // left line
+ coords[0] = x;
+ coords[1] = y + h - arcH / 2;
+ }
+ else if (step == 4)
+ {
+ // bottom line
+ coords[0] = x + w - arcW / 2;
+ coords[1] = y + h;
+ }
+ else if (step == 6)
+ {
+ // right line
+ coords[0] = x + w;
+ coords[1] = y + arcH / 2;
+ }
+ if (at != null)
+ at.transform(coords, 0, coords, 0, 1);
+ return step == -1 ? SEG_MOVETO : SEG_LINETO;
+ }
+
+ public int currentSegment(float[] coords) {
+ if (corner != null) // steps 1, 3, 5 and 7
+ {
+ int r = corner.currentSegment(coords);
+ if (r == SEG_MOVETO)
+ r = SEG_LINETO;
+ return r;
+ }
+ if (step == -1)
+ {
+ // move to the start position
+ coords[0] = (float) (x + w - arcW / 2);
+ coords[1] = (float) y;
+ }
+ else if (step == 0)
+ {
+ // top line
+ coords[0] = (float) (x + arcW / 2);
+ coords[1] = (float) y;
+ }
+ else if (step == 2)
+ {
+ // left line
+ coords[0] = (float) x;
+ coords[1] = (float) (y + h - arcH / 2);
+ }
+ else if (step == 4)
+ {
+ // bottom line
+ coords[0] = (float) (x + w - arcW / 2);
+ coords[1] = (float) (y + h);
+ }
+ else if (step == 6)
+ {
+ // right line
+ coords[0] = (float) (x + w);
+ coords[1] = (float) (y + arcH / 2);
+ }
+ if (at != null)
+ at.transform(coords, 0, coords, 0, 1);
+ return step == -1 ? SEG_MOVETO : SEG_LINETO;
+ }
+
+ public int getWindingRule() {
+ return WIND_NON_ZERO;
+ }
+
+ public boolean isDone() {
+ return step >= 8;
+ }
+
+ public void next()
{
- /** We iterate counterclockwise around the rectangle, starting in the
- * upper right. This variable tracks our current point, which
- * can be on either side of a given corner. */
- private int current = 0;
-
- /** Child path iterator, used for corners. */
- private PathIterator corner;
-
- /** This is used when rendering the corners. We re-use the arc
- * for each corner. */
- private Arc2D arc = new Arc2D.Double();
-
- /** Temporary array used by getPoint. */
- private double[] temp = new double[2];
-
- public int getWindingRule()
- {
- return WIND_NON_ZERO;
- }
-
- public boolean isDone()
- {
- return current > 9;
- }
-
- private void getPoint(int val)
- {
- switch (val)
- {
- case 0:
- case 8:
- temp[0] = maxx;
- temp[1] = miny + archeight;
- break;
- case 7:
- temp[0] = maxx;
- temp[1] = maxy - archeight;
- break;
- case 6:
- temp[0] = maxx - arcwidth;
- temp[1] = maxy;
- break;
- case 5:
- temp[0] = minx + arcwidth;
- temp[1] = maxy;
- break;
- case 4:
- temp[0] = minx;
- temp[1] = maxy - archeight;
- break;
- case 3:
- temp[0] = minx;
- temp[1] = miny + archeight;
- break;
- case 2:
- temp[0] = minx + arcwidth;
- temp[1] = miny;
- break;
- case 1:
- temp[0] = maxx - arcwidth;
- temp[1] = miny;
- break;
- }
- }
-
- public void next()
- {
- if (current >= 8)
- ++current;
- else if (corner != null)
- {
- // We're iterating through the corner. Work on the child
- // iterator; if it finishes, reset and move to the next
- // point along the rectangle.
- corner.next();
- if (corner.isDone())
- {
- corner = null;
- ++current;
- }
- }
- else
- {
- // Make an arc between this point on the rectangle and
- // the next one, and then iterate over this arc.
- getPoint(current);
- double x1 = temp[0];
- double y1 = temp[1];
- getPoint(current + 1);
- Rectangle2D.Double r = new Rectangle2D.Double(Math.min(x1,
- temp[0]),
- Math.min(y1,
- temp[1]),
- Math.abs(x1
- - temp[0]),
- Math.abs(y1
- - temp[1]));
- arc.setArc(r, (current >> 1) * 90.0, 90.0, Arc2D.OPEN);
- corner = arc.getPathIterator(at);
- }
- }
-
- public int currentSegment(float[] coords)
- {
- if (corner != null)
- {
- int r = corner.currentSegment(coords);
- if (r == SEG_MOVETO)
- r = SEG_LINETO;
- return r;
- }
-
- if (current < 9)
- {
- getPoint(current);
- coords[0] = (float) temp[0];
- coords[1] = (float) temp[1];
- }
- else if (current == 9)
- return SEG_CLOSE;
- else
- throw new NoSuchElementException("rect iterator out of bounds");
-
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return current == 0 ? SEG_MOVETO : SEG_LINETO;
- }
-
- public int currentSegment(double[] coords)
- {
- if (corner != null)
- {
- int r = corner.currentSegment(coords);
- if (r == SEG_MOVETO)
- r = SEG_LINETO;
- return r;
- }
-
- if (current < 9)
- {
- getPoint(current);
- coords[0] = temp[0];
- coords[1] = temp[1];
- }
- else if (current == 9)
- return SEG_CLOSE;
- else
- throw new NoSuchElementException("rect iterator out of bounds");
-
- if (at != null)
- at.transform(coords, 0, coords, 0, 1);
- return current == 0 ? SEG_MOVETO : SEG_LINETO;
- }
- };
+ if (corner != null)
+ {
+ corner.next();
+ if (corner.isDone())
+ {
+ corner = null;
+ step++;
+ }
+ }
+ else
+ {
+ step++;
+ if (step == 1)
+ {
+ // create top left corner
+ arc.setArc(x, y, arcW, arcH, 90, 90, Arc2D.OPEN);
+ corner = arc.getPathIterator(at);
+ }
+ else if (step == 3)
+ {
+ // create bottom left corner
+ arc.setArc(x, y + h - arcH, arcW, arcH, 180, 90,
+ Arc2D.OPEN);
+ corner = arc.getPathIterator(at);
+ }
+ else if (step == 5)
+ {
+ // create bottom right corner
+ arc.setArc(x + w - arcW, y + h - arcH, arcW, arcH, 270, 90,
+ Arc2D.OPEN);
+ corner = arc.getPathIterator(at);
+ }
+ else if (step == 7)
+ {
+ // create top right corner
+ arc.setArc(x + w - arcW, y, arcW, arcH, 0, 90, Arc2D.OPEN);
+ corner = arc.getPathIterator(at);
+ }
+ }
+ }
+ };
}
- /** Return true if the given rectangle intersects this shape.
+ /**
+ * Return true if the given rectangle intersects this shape.
* @param x The x coordinate
* @param y The y coordinate
* @param w The width
@@ -302,7 +329,8 @@ public abstract class RoundRectangle2D extends RectangularShape
|| contains(x + w, y));
}
- /** Set the boundary of this round rectangle.
+ /**
+ * Set the boundary of this round rectangle.
* @param x The x coordinate
* @param y The y coordinate
* @param w The width
@@ -314,7 +342,8 @@ public abstract class RoundRectangle2D extends RectangularShape
setRoundRect(x, y, w, h, getArcWidth(), getArcHeight());
}
- /** Set the values of this round rectangle to be the same as those
+ /**
+ * Set the values of this round rectangle to be the same as those
* of the argument.
* @param rr The round rectangle to copy
*/
@@ -324,8 +353,10 @@ public abstract class RoundRectangle2D extends RectangularShape
rr.getArcWidth(), rr.getArcHeight());
}
- /** A subclass of RoundRectangle which keeps its parameters as
- * doubles. */
+ /**
+ * A subclass of RoundRectangle which keeps its parameters as
+ * doubles.
+ */
public static class Double extends RoundRectangle2D
{
/** The height of the corner arc. */
@@ -346,12 +377,15 @@ public abstract class RoundRectangle2D extends RectangularShape
/** The height of this object. */
public double height;
- /** Construct a new instance, with all parameters set to 0. */
+ /**
+ * Construct a new instance, with all parameters set to 0.
+ */
public Double()
{
}
- /** Construct a new instance with the given arguments.
+ /**
+ * Construct a new instance with the given arguments.
* @param x The x coordinate
* @param y The y coordinate
* @param w The width
@@ -422,8 +456,10 @@ public abstract class RoundRectangle2D extends RectangularShape
}
} // class Double
- /** A subclass of RoundRectangle which keeps its parameters as
- * floats. */
+ /**
+ * A subclass of RoundRectangle which keeps its parameters as
+ * floats.
+ */
public static class Float extends RoundRectangle2D
{
/** The height of the corner arc. */
@@ -444,12 +480,15 @@ public abstract class RoundRectangle2D extends RectangularShape
/** The height of this object. */
public float height;
- /** Construct a new instance, with all parameters set to 0. */
+ /**
+ * Construct a new instance, with all parameters set to 0.
+ */
public Float()
{
}
- /** Construct a new instance with the given arguments.
+ /**
+ * Construct a new instance with the given arguments.
* @param x The x coordinate
* @param y The y coordinate
* @param w The width
@@ -508,6 +547,18 @@ public abstract class RoundRectangle2D extends RectangularShape
return width <= 0 || height <= 0;
}
+ /**
+ * Sets the dimensions for this rounded rectangle.
+ *
+ * @param x the x-coordinate of the top left corner.
+ * @param y the y-coordinate of the top left corner.
+ * @param w the width of the rectangle.
+ * @param h the height of the rectangle.
+ * @param arcWidth the arc width.
+ * @param arcHeight the arc height.
+ *
+ * @see #setRoundRect(double, double, double, double, double, double)
+ */
public void setRoundRect(float x, float y, float w, float h,
float arcWidth, float arcHeight)
{
diff --git a/libjava/classpath/java/awt/im/InputContext.java b/libjava/classpath/java/awt/im/InputContext.java
index 3806736df3d..c81993215e8 100644
--- a/libjava/classpath/java/awt/im/InputContext.java
+++ b/libjava/classpath/java/awt/im/InputContext.java
@@ -1,5 +1,5 @@
/* InputContext.java -- provides the context for text input
- Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -76,6 +76,7 @@ import java.util.Locale;
* java.awt.im.spi.InputMethodDescriptor.
*
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @see Component#getInputContext()
* @see Component#enableInputMethods(boolean)
* @since 1.2
@@ -86,7 +87,9 @@ public class InputContext
/**
* The list of installed input method descriptors.
*/
- private static final ArrayList descriptors = new ArrayList();
+ private static final ArrayList<InputMethodDescriptor> descriptors
+ = new ArrayList<InputMethodDescriptor>();
+
static
{
Enumeration e;
@@ -123,7 +126,7 @@ public class InputContext
{
if (line.charAt(0) != '#')
{
- Class c = Class.forName(line);
+ Class<?> c = Class.forName(line);
descriptors.add((InputMethodDescriptor) c.newInstance());
}
line = in.readLine().trim();
@@ -143,7 +146,8 @@ public class InputContext
private InputMethod im;
/** Map of locales to the most recently selected input method. */
- private final HashMap recent = new HashMap();
+ private final HashMap<Locale,InputMethod> recent
+ = new HashMap<Locale,InputMethod>();
/** The list of acceptable character subsets. */
private Character.Subset[] subsets;
diff --git a/libjava/classpath/java/awt/im/InputMethodHighlight.java b/libjava/classpath/java/awt/im/InputMethodHighlight.java
index 6fbe42fe549..a2ee86d44fc 100644
--- a/libjava/classpath/java/awt/im/InputMethodHighlight.java
+++ b/libjava/classpath/java/awt/im/InputMethodHighlight.java
@@ -41,6 +41,7 @@ import java.awt.Toolkit;
import java.text.Annotation;
import java.text.AttributedCharacterIterator;
import java.util.Map;
+import java.awt.font.TextAttribute;
/**
* This describes the highlight attributes of text composed in an input method.
@@ -95,7 +96,7 @@ public class InputMethodHighlight
private final int variation;
/** The unmodifiable map of rendering styles. */
- private final Map style;
+ private final Map<TextAttribute, ?> style;
/**
* Create an input method highlight style, with variation 0 and null style
@@ -134,7 +135,7 @@ public class InputMethodHighlight
* @since 1.3
*/
public InputMethodHighlight(boolean selected, int state, int variation,
- Map style)
+ Map<TextAttribute, ?> style)
{
if (state != RAW_TEXT && state != CONVERTED_TEXT)
throw new IllegalArgumentException();
@@ -181,7 +182,7 @@ public class InputMethodHighlight
* @return the style map
* @since 1.3
*/
- public Map getStyle()
+ public Map<TextAttribute, ?> getStyle()
{
return style;
}
diff --git a/libjava/classpath/java/awt/im/spi/InputMethodContext.java b/libjava/classpath/java/awt/im/spi/InputMethodContext.java
index 17ec4f8f7ee..aed21e8d3b4 100644
--- a/libjava/classpath/java/awt/im/spi/InputMethodContext.java
+++ b/libjava/classpath/java/awt/im/spi/InputMethodContext.java
@@ -1,5 +1,5 @@
/* InputMethodContext.java -- communication between an input method and client
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,6 +53,7 @@ import javax.swing.JFrame;
* {@link InputMethod#setInputMethodContext(InputMethodContext)}.
*
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.3
* @status updated to 1.4
*/
diff --git a/libjava/classpath/java/awt/image/AffineTransformOp.java b/libjava/classpath/java/awt/image/AffineTransformOp.java
index bb4b795231b..849c5b05048 100644
--- a/libjava/classpath/java/awt/image/AffineTransformOp.java
+++ b/libjava/classpath/java/awt/image/AffineTransformOp.java
@@ -1,6 +1,6 @@
/* AffineTransformOp.java -- This class performs affine
transformation between two images or rasters in 2 dimensions.
- Copyright (C) 2004 Free Software Foundation
+ Copyright (C) 2004, 2006 Free Software Foundation
This file is part of GNU Classpath.
@@ -39,6 +39,7 @@ exception statement from your version. */
package java.awt.image;
import java.awt.Graphics2D;
+import java.awt.Point;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.geom.AffineTransform;
@@ -48,10 +49,14 @@ import java.awt.geom.Rectangle2D;
import java.util.Arrays;
/**
- * This class performs affine transformation between two images or
- * rasters in 2 dimensions.
+ * AffineTransformOp performs matrix-based transformations (translations,
+ * scales, flips, rotations, and shears).
+ *
+ * If interpolation is required, nearest neighbour, bilinear, and bicubic
+ * methods are available.
*
* @author Olga Rodimina (rodimina@redhat.com)
+ * @author Francis Kung (fkung@redhat.com)
*/
public class AffineTransformOp implements BufferedImageOp, RasterOp
{
@@ -74,6 +79,7 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
*
* @param xform AffineTransform that will applied to the source image
* @param interpolationType type of interpolation used
+ * @throws ImagingOpException if the transform matrix is noninvertible
*/
public AffineTransformOp (AffineTransform xform, int interpolationType)
{
@@ -102,6 +108,7 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
*
* @param xform AffineTransform that will applied to the source image
* @param hints rendering hints that will be used during transformation
+ * @throws ImagingOpException if the transform matrix is noninvertible
*/
public AffineTransformOp (AffineTransform xform, RenderingHints hints)
{
@@ -112,185 +119,165 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
}
/**
- * Creates empty BufferedImage with the size equal to that of the
- * transformed image and correct number of bands. The newly created
+ * Creates a new BufferedImage with the size equal to that of the
+ * transformed image and the correct number of bands. The newly created
* image is created with the specified ColorModel.
- * If the ColorModel is equal to null, then image is created
- * with the ColorModel of the source image.
+ * If a ColorModel is not specified, an appropriate ColorModel is used.
*
- * @param src source image
- * @param destCM color model for the destination image
- * @return new compatible destination image
+ * @param src the source image.
+ * @param destCM color model for the destination image (can be null).
+ * @return a new compatible destination image.
*/
public BufferedImage createCompatibleDestImage (BufferedImage src,
ColorModel destCM)
{
+ if (destCM != null)
+ return new BufferedImage(destCM,
+ createCompatibleDestRaster(src.getRaster()),
+ src.isAlphaPremultiplied(), null);
+
+ // This behaviour was determined by Mauve testcases, and is compatible
+ // with the reference implementation
+ if (src.getType() == BufferedImage.TYPE_INT_ARGB_PRE
+ || src.getType() == BufferedImage.TYPE_4BYTE_ABGR
+ || src.getType() == BufferedImage.TYPE_4BYTE_ABGR_PRE)
+ return new BufferedImage(src.getWidth(), src.getHeight(), src.getType());
- // if destCm is not specified, use color model of the source image
-
- if (destCM == null)
- destCM = src.getColorModel ();
-
- return new BufferedImage (destCM,
- createCompatibleDestRaster (src.getRaster ()),
- src.isAlphaPremultiplied (),
- null);
-
+ else
+ return new BufferedImage(src.getWidth(), src.getHeight(),
+ BufferedImage.TYPE_INT_ARGB);
}
/**
- * Creates empty WritableRaster with the size equal to the transformed
- * source raster and correct number of bands
+ * Creates a new WritableRaster with the size equal to the transformed
+ * source raster and correct number of bands .
*
- * @param src source raster
- * @throws RasterFormatException if resulting width or height of raster is 0
- * @return new compatible raster
+ * @param src the source raster.
+ * @throws RasterFormatException if resulting width or height of raster is 0.
+ * @return a new compatible raster.
*/
public WritableRaster createCompatibleDestRaster (Raster src)
{
- Rectangle rect = (Rectangle) getBounds2D (src);
+ Rectangle2D rect = getBounds2D(src);
- // throw RasterFormatException if resulting width or height of the
- // transformed raster is 0
-
- if (rect.getWidth () == 0 || rect.getHeight () == 0)
+ if (rect.getWidth() == 0 || rect.getHeight() == 0)
throw new RasterFormatException("width or height is 0");
- return src.createCompatibleWritableRaster ((int) rect.getWidth (),
- (int) rect.getHeight ());
+ return src.createCompatibleWritableRaster((int) rect.getWidth(),
+ (int) rect.getHeight());
}
/**
* Transforms source image using transform specified at the constructor.
- * The resulting transformed image is stored in the destination image.
+ * The resulting transformed image is stored in the destination image if one
+ * is provided; otherwise a new BufferedImage is created and returned.
*
* @param src source image
* @param dst destination image
- * @return transformed source image
+ * @throws IllegalArgumentException if the source and destination image are
+ * the same
+ * @return transformed source image.
*/
public final BufferedImage filter (BufferedImage src, BufferedImage dst)
{
-
if (dst == src)
- throw new IllegalArgumentException ("src image cannot be the same as the dst image");
-
- // If the destination image is null, then BufferedImage is
- // created with ColorModel of the source image
+ throw new IllegalArgumentException("src image cannot be the same as "
+ + "the dst image");
+ // If the destination image is null, then use a compatible BufferedImage
if (dst == null)
- dst = createCompatibleDestImage(src, src.getColorModel ());
-
- // FIXME: Must check if color models of src and dst images are the same.
- // If it is not, then source image should be converted to color model
- // of the destination image
+ dst = createCompatibleDestImage(src, null);
- Graphics2D gr = (Graphics2D) dst.createGraphics ();
- gr.setRenderingHints (hints);
- gr.drawImage (src, transform, null);
+ Graphics2D gr = (Graphics2D) dst.createGraphics();
+ gr.setRenderingHints(hints);
+ gr.drawImage(src, transform, null);
return dst;
-
}
/**
* Transforms source raster using transform specified at the constructor.
- * The resulting raster is stored in the destination raster.
+ * The resulting raster is stored in the destination raster if it is not
+ * null, otherwise a new raster is created and returned.
*
* @param src source raster
* @param dst destination raster
- * @return transformed raster
+ * @throws IllegalArgumentException if the source and destination are not
+ * compatible
+ * @return transformed raster.
*/
- public final WritableRaster filter (Raster src, WritableRaster dst)
+ public final WritableRaster filter(Raster src, WritableRaster dst)
{
+ // Initial checks
if (dst == src)
throw new IllegalArgumentException("src image cannot be the same as"
- + " the dst image");
+ + " the dst image");
if (dst == null)
dst = createCompatibleDestRaster(src);
if (src.getNumBands() != dst.getNumBands())
throw new IllegalArgumentException("src and dst must have same number"
- + " of bands");
+ + " of bands");
- double[] dpts = new double[dst.getWidth() * 2];
- double[] pts = new double[dst.getWidth() * 2];
+ // Optimization for rasters that can be represented in the RGB colormodel:
+ // wrap the rasters in images, and let Cairo do the transformation
+ if (ColorModel.getRGBdefault().isCompatibleSampleModel(src.getSampleModel())
+ && ColorModel.getRGBdefault().isCompatibleSampleModel(dst.getSampleModel()))
+ {
+ WritableRaster src2 = Raster.createWritableRaster(src.getSampleModel(),
+ src.getDataBuffer(),
+ new Point(src.getMinX(),
+ src.getMinY()));
+ BufferedImage iSrc = new BufferedImage(ColorModel.getRGBdefault(),
+ src2, false, null);
+ BufferedImage iDst = new BufferedImage(ColorModel.getRGBdefault(), dst,
+ false, null);
+
+ return filter(iSrc, iDst).getRaster();
+ }
+
+ // Otherwise, we need to do the transformation in java code...
+ // Create arrays to hold all the points
+ double[] dstPts = new double[dst.getHeight() * dst.getWidth() * 2];
+ double[] srcPts = new double[dst.getHeight() * dst.getWidth() * 2];
+
+ // Populate array with all points in the *destination* raster
+ int i = 0;
for (int x = 0; x < dst.getWidth(); x++)
- {
- dpts[2 * x] = x + dst.getMinX();
- dpts[2 * x + 1] = x;
- }
- Rectangle srcbounds = src.getBounds();
- if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR))
- {
- for (int y = dst.getMinY(); y < dst.getMinY() + dst.getHeight(); y++)
- {
- try {
- transform.inverseTransform(dpts, 0, pts, 0, dst.getWidth() * 2);
- } catch (NoninvertibleTransformException e) {
- // Can't happen since the constructor traps this
- e.printStackTrace();
- }
-
- for (int x = 0; x < dst.getWidth(); x++)
- {
- if (!srcbounds.contains(pts[2 * x], pts[2 * x + 1]))
- continue;
- dst.setDataElements(x + dst.getMinX(), y,
- src.getDataElements((int)pts[2 * x],
- (int)pts[2 * x + 1],
- null));
- }
- }
- }
- else if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR))
- {
- double[] tmp = new double[4 * src.getNumBands()];
- for (int y = dst.getMinY(); y < dst.getMinY() + dst.getHeight(); y++)
{
- try {
- transform.inverseTransform(dpts, 0, pts, 0, dst.getWidth() * 2);
- } catch (NoninvertibleTransformException e) {
- // Can't happen since the constructor traps this
- e.printStackTrace();
- }
-
- for (int x = 0; x < dst.getWidth(); x++)
- {
- if (!srcbounds.contains(pts[2 * x], pts[2 * x + 1]))
- continue;
- int xx = (int)pts[2 * x];
- int yy = (int)pts[2 * x + 1];
- double dx = (pts[2 * x] - xx);
- double dy = (pts[2 * x + 1] - yy);
-
- // TODO write this more intelligently
- if (xx == src.getMinX() + src.getWidth() - 1 ||
- yy == src.getMinY() + src.getHeight() - 1)
+ for (int y = 0; y < dst.getHeight(); y++)
{
- // bottom or right edge
- Arrays.fill(tmp, 0);
- src.getPixel(xx, yy, tmp);
+ dstPts[i++] = x;
+ dstPts[i++] = y;
}
- else
- {
- // Normal case
- src.getPixels(xx, yy, 2, 2, tmp);
- for (int b = 0; b < src.getNumBands(); b++)
- tmp[b] = dx * dy * tmp[b]
- + (1 - dx) * dy * tmp[b + src.getNumBands()]
- + dx * (1 - dy) * tmp[b + 2 * src.getNumBands()]
- + (1 - dx) * (1 - dy) * tmp[b + 3 * src.getNumBands()];
- }
- dst.setPixel(x, y, tmp);
- }
}
- }
- else
- {
- // Bicubic
- throw new UnsupportedOperationException("not implemented yet");
- }
+ Rectangle srcbounds = src.getBounds();
+
+ // Use an inverse transform to map each point in the destination to
+ // a point in the source. Note that, while all points in the destination
+ // matrix are integers, this is not necessarily true for points in the
+ // source (hence why interpolation is required)
+ try
+ {
+ AffineTransform inverseTx = transform.createInverse();
+ inverseTx.transform(dstPts, 0, srcPts, 0, dstPts.length / 2);
+ }
+ catch (NoninvertibleTransformException e)
+ {
+ // Shouldn't happen since the constructor traps this
+ throw new ImagingOpException(e.getMessage());
+ }
+
+ // Different interpolation methods...
+ if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR))
+ filterNearest(src, dst, dstPts, srcPts);
+ else if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR))
+ filterBilinear(src, dst, dstPts, srcPts);
+
+ else // bicubic
+ filterBicubic(src, dst, dstPts, srcPts);
+
return dst;
}
@@ -314,27 +301,22 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
*/
public final Rectangle2D getBounds2D (Raster src)
{
- // determine new size for the transformed raster.
- // Need to calculate transformed coordinates of the lower right
- // corner of the raster. The upper left corner is always (0,0)
-
- double x2 = (double) src.getWidth () + src.getMinX ();
- double y2 = (double) src.getHeight () + src.getMinY ();
- Point2D p2 = getPoint2D (new Point2D.Double (x2,y2), null);
-
- Rectangle2D rect = new Rectangle (0, 0, (int) p2.getX (), (int) p2.getY ());
- return rect.getBounds ();
+ return transform.createTransformedShape(src.getBounds()).getBounds2D();
}
/**
- * Returns interpolation type used during transformations
+ * Returns interpolation type used during transformations.
*
* @return interpolation type
*/
public final int getInterpolationType ()
{
- if(hints.containsValue (RenderingHints.VALUE_INTERPOLATION_BILINEAR))
+ if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR))
return TYPE_BILINEAR;
+
+ else if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BICUBIC))
+ return TYPE_BICUBIC;
+
else
return TYPE_NEAREST_NEIGHBOR;
}
@@ -355,7 +337,7 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
/**
* Returns rendering hints that are used during transformation.
*
- * @return rendering hints
+ * @return the rendering hints used in this Op.
*/
public final RenderingHints getRenderingHints ()
{
@@ -366,10 +348,261 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp
* Returns transform used in transformation between source and destination
* image.
*
- * @return transform
+ * @return the transform used in this Op.
*/
public final AffineTransform getTransform ()
{
return transform;
}
+
+ /**
+ * Perform nearest-neighbour filtering
+ *
+ * @param src the source raster
+ * @param dst the destination raster
+ * @param dpts array of points on the destination raster
+ * @param pts array of corresponding points on the source raster
+ */
+ private void filterNearest(Raster src, WritableRaster dst, double[] dpts,
+ double[] pts)
+ {
+ Rectangle srcbounds = src.getBounds();
+
+ // For all points on the destination raster, copy the value from the
+ // corrosponding (rounded) source point
+ for (int i = 0; i < dpts.length; i += 2)
+ {
+ int srcX = (int) Math.round(pts[i]) + src.getMinX();
+ int srcY = (int) Math.round(pts[i + 1]) + src.getMinY();
+
+ if (srcbounds.contains(srcX, srcY))
+ dst.setDataElements((int) dpts[i] + dst.getMinX(),
+ (int) dpts[i + 1] + dst.getMinY(),
+ src.getDataElements(srcX, srcY, null));
+ }
+ }
+
+ /**
+ * Perform bilinear filtering
+ *
+ * @param src the source raster
+ * @param dst the destination raster
+ * @param dpts array of points on the destination raster
+ * @param pts array of corresponding points on the source raster
+ */
+ private void filterBilinear(Raster src, WritableRaster dst, double[] dpts,
+ double[] pts)
+ {
+ Rectangle srcbounds = src.getBounds();
+
+ Object xyarr = null;
+ Object xp1arr = null;
+ Object yp1arr = null;
+ Object xyp1arr = null;
+
+ double xy;
+ double xp1;
+ double yp1;
+ double xyp1;
+
+ double[] result = new double[src.getNumBands()];
+
+ // For all points in the destination raster, use bilinear interpolation
+ // to find the value from the corrosponding source points
+ for (int i = 0; i < dpts.length; i += 2)
+ {
+ int srcX = (int) Math.round(pts[i]) + src.getMinX();
+ int srcY = (int) Math.round(pts[i + 1]) + src.getMinY();
+
+ if (srcbounds.contains(srcX, srcY))
+ {
+ // Corner case at the bottom or right edge; use nearest neighbour
+ if (pts[i] >= src.getWidth() - 1
+ || pts[i + 1] >= src.getHeight() - 1)
+ dst.setDataElements((int) dpts[i] + dst.getMinX(),
+ (int) dpts[i + 1] + dst.getMinY(),
+ src.getDataElements(srcX, srcY, null));
+
+ // Standard case, apply the bilinear formula
+ else
+ {
+ int x = (int) Math.floor(pts[i] + src.getMinX());
+ int y = (int) Math.floor(pts[i + 1] + src.getMinY());
+ double xdiff = pts[i] + src.getMinX() - x;
+ double ydiff = pts[i + 1] + src.getMinY() - y;
+
+ // Get surrounding pixels used in interpolation... optimized
+ // to use the smallest datatype possible.
+ if (src.getTransferType() == DataBuffer.TYPE_DOUBLE
+ || src.getTransferType() == DataBuffer.TYPE_FLOAT)
+ {
+ xyarr = src.getPixel(x, y, (double[])xyarr);
+ xp1arr = src.getPixel(x+1, y, (double[])xp1arr);
+ yp1arr = src.getPixel(x, y+1, (double[])yp1arr);
+ xyp1arr = src.getPixel(x+1, y+1, (double[])xyp1arr);
+ }
+ else
+ {
+ xyarr = src.getPixel(x, y, (int[])xyarr);
+ xp1arr = src.getPixel(x+1, y, (int[])xp1arr);
+ yp1arr = src.getPixel(x, y+1, (int[])yp1arr);
+ xyp1arr = src.getPixel(x+1, y+1, (int[])xyp1arr);
+ }
+ // using
+ // array[] pixels = src.getPixels(x, y, 2, 2, pixels);
+ // instead of doing four individual src.getPixel() calls
+ // should be faster, but benchmarking shows that it's not...
+
+ // Run interpolation for each band
+ for (int j = 0; j < src.getNumBands(); j++)
+ {
+ // Pull individual sample values out of array
+ if (src.getTransferType() == DataBuffer.TYPE_DOUBLE
+ || src.getTransferType() == DataBuffer.TYPE_FLOAT)
+ {
+ xy = ((double[])xyarr)[j];
+ xp1 = ((double[])xp1arr)[j];
+ yp1 = ((double[])yp1arr)[j];
+ xyp1 = ((double[])xyp1arr)[j];
+ }
+ else
+ {
+ xy = ((int[])xyarr)[j];
+ xp1 = ((int[])xp1arr)[j];
+ yp1 = ((int[])yp1arr)[j];
+ xyp1 = ((int[])xyp1arr)[j];
+ }
+
+ // If all four samples are identical, there's no need to
+ // calculate anything
+ if (xy == xp1 && xy == yp1 && xy == xyp1)
+ result[j] = xy;
+
+ // Run bilinear interpolation formula
+ else
+ result[j] = (xy * (1-xdiff) + xp1 * xdiff)
+ * (1-ydiff)
+ + (yp1 * (1-xdiff) + xyp1 * xdiff)
+ * ydiff;
+ }
+
+ dst.setPixel((int)dpts[i] + dst.getMinX(),
+ (int)dpts[i+1] + dst.getMinY(),
+ result);
+ }
+ }
+ }
+ }
+
+ /**
+ * Perform bicubic filtering
+ * based on http://local.wasp.uwa.edu.au/~pbourke/colour/bicubic/
+ *
+ * @param src the source raster
+ * @param dst the destination raster
+ * @param dpts array of points on the destination raster
+ * @param pts array of corresponding points on the source raster
+ */
+ private void filterBicubic(Raster src, WritableRaster dst, double[] dpts,
+ double[] pts)
+ {
+ Rectangle srcbounds = src.getBounds();
+ double[] result = new double[src.getNumBands()];
+ Object pixels = null;
+
+ // For all points on the destination raster, perform bicubic interpolation
+ // from corrosponding source points
+ for (int i = 0; i < dpts.length; i += 2)
+ {
+ if (srcbounds.contains((int) Math.round(pts[i]) + src.getMinX(),
+ (int) Math.round(pts[i + 1]) + src.getMinY()))
+ {
+ int x = (int) Math.floor(pts[i] + src.getMinX());
+ int y = (int) Math.floor(pts[i + 1] + src.getMinY());
+ double dx = pts[i] + src.getMinX() - x;
+ double dy = pts[i + 1] + src.getMinY() - y;
+ Arrays.fill(result, 0);
+
+ for (int m = - 1; m < 3; m++)
+ for (int n = - 1; n < 3; n++)
+ {
+ // R(x) = ( P(x+2)^3 - 4 P(x+1)^3 + 6 P(x)^3 - 4 P(x-1)^3 ) / 6
+ double r1 = 0;
+ double r2 = 0;
+
+ // Calculate R(m - dx)
+ double rx = m - dx + 2;
+ r1 += rx * rx * rx;
+
+ rx = m - dx + 1;
+ if (rx > 0)
+ r1 -= 4 * rx * rx * rx;
+
+ rx = m - dx;
+ if (rx > 0)
+ r1 += 6 * rx * rx * rx;
+
+ rx = m - dx - 1;
+ if (rx > 0)
+ r1 -= 4 * rx * rx * rx;
+
+ r1 /= 6;
+
+ // Calculate R(dy - n);
+ rx = dy - n + 2;
+ if (rx > 0)
+ r2 += rx * rx * rx;
+
+ rx = dy - n + 1;
+ if (rx > 0)
+ r2 -= 4 * rx * rx * rx;
+
+ rx = dy - n;
+ if (rx > 0)
+ r2 += 6 * rx * rx * rx;
+
+ rx = dy - n - 1;
+ if (rx > 0)
+ r2 -= 4 * rx * rx * rx;
+
+ r2 /= 6;
+
+ // Calculate F(i+m, j+n) R(m - dx) R(dy - n)
+ // Check corner cases
+ int srcX = x + m;
+ if (srcX >= src.getMinX() + src.getWidth())
+ srcX = src.getMinX() + src.getWidth() - 1;
+ else if (srcX < src.getMinX())
+ srcX = src.getMinX();
+
+ int srcY = y + n;
+ if (srcY >= src.getMinY() + src.getHeight())
+ srcY = src.getMinY() + src.getHeight() - 1;
+ else if (srcY < src.getMinY())
+ srcY = src.getMinY();
+
+ // Calculate once for each band, using the smallest
+ // datatype possible
+ if (src.getTransferType() == DataBuffer.TYPE_DOUBLE
+ || src.getTransferType() == DataBuffer.TYPE_FLOAT)
+ {
+ pixels = src.getPixel(srcX, srcY, (double[])pixels);
+ for (int j = 0; j < result.length; j++)
+ result[j] += ((double[])pixels)[j] * r1 * r2;
+ }
+ else
+ {
+ pixels = src.getPixel(srcX, srcY, (int[])pixels);
+ for (int j = 0; j < result.length; j++)
+ result[j] += ((int[])pixels)[j] * r1 * r2;
+ }
+ }
+
+ // Put it all together
+ dst.setPixel((int)dpts[i] + dst.getMinX(),
+ (int)dpts[i+1] + dst.getMinY(),
+ result);
+ }
+ }
+ }
}
diff --git a/libjava/classpath/java/awt/image/BandCombineOp.java b/libjava/classpath/java/awt/image/BandCombineOp.java
index 634125ed23f..d9ce16fad07 100644
--- a/libjava/classpath/java/awt/image/BandCombineOp.java
+++ b/libjava/classpath/java/awt/image/BandCombineOp.java
@@ -1,4 +1,5 @@
-/* Copyright (C) 2004 Free Software Foundation
+/* BandCombineOp.java - perform a combination on the bands of a raster
+ Copyright (C) 2004, 2006 Free Software Foundation
This file is part of GNU Classpath.
@@ -36,10 +37,10 @@ exception statement from your version. */
package java.awt.image;
-import java.awt.Point;
import java.awt.RenderingHints;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
+import java.util.Arrays;
/**
* Filter Raster pixels by applying a matrix.
@@ -53,6 +54,9 @@ import java.awt.geom.Rectangle2D;
* for the destination. Therefore the destination Raster must contain the
* same number of bands as the number of rows in the filter matrix.
*
+ * This Op assumes that samples are integers; floating point sample types will
+ * be rounded to their nearest integer value during filtering.
+ *
* @author Jerry Quinn (jlquinn@optonline.net)
*/
public class BandCombineOp implements RasterOp
@@ -65,52 +69,74 @@ public class BandCombineOp implements RasterOp
*
* @param matrix The matrix to filter pixels with.
* @param hints Rendering hints to apply. Ignored.
+ * @throws ArrayIndexOutOfBoundsException if the matrix is invalid
*/
public BandCombineOp(float[][] matrix, RenderingHints hints)
{
- this.matrix = matrix;
+ this.matrix = new float[matrix.length][];
+ int width = matrix[0].length;
+ for (int i = 0; i < matrix.length; i++)
+ {
+ this.matrix[i] = new float[width + 1];
+ for (int j = 0; j < width; j++)
+ this.matrix[i][j] = matrix[i][j];
+
+ // The reference implementation pads the array with a trailing zero...
+ this.matrix[i][width] = 0;
+ }
+
this.hints = hints;
}
/**
- * Filter Raster pixels through a matrix.
- *
- * Applies the Op matrix to source pixes to produce dest pixels. Each row
- * of the matrix is multiplied by the src pixel components to produce the
- * dest pixel. If matrix is one more than the number of bands in the src,
- * the last element is implicitly multiplied by 1, i.e. added to the sum
- * for that dest component.
- *
- * If dest is null, a suitable Raster is created. This implementation uses
- * createCompatibleDestRaster.
+ * Filter Raster pixels through a matrix. Applies the Op matrix to source
+ * pixes to produce dest pixels. Each row of the matrix is multiplied by the
+ * src pixel components to produce the dest pixel. If matrix is one more than
+ * the number of bands in the src, the last element is implicitly multiplied
+ * by 1, i.e. added to the sum for that dest component. If dest is null, a
+ * suitable Raster is created. This implementation uses
+ * createCompatibleDestRaster.
*
* @param src The source Raster.
- * @param dest The destination Raster, or null.
- * @returns The destination Raster or an allocated Raster.
+ * @param dest The destination Raster, or null.
+ * @throws IllegalArgumentException if the destination raster is incompatible
+ * with the source raster.
+ * @return The filtered Raster.
* @see java.awt.image.RasterOp#filter(java.awt.image.Raster,
- *java.awt.image.WritableRaster)
+ * java.awt.image.WritableRaster)
*/
public WritableRaster filter(Raster src, WritableRaster dest) {
if (dest == null)
dest = createCompatibleDestRaster(src);
-
+ else if (dest.getNumBands() != src.getNumBands()
+ || dest.getTransferType() != src.getTransferType())
+ throw new IllegalArgumentException("Destination raster is incompatible with source raster");
+
// Filter the pixels
- float[] spix = new float[matrix[0].length];
- float[] dpix = new float[matrix.length];
+ int[] spix = new int[matrix[0].length - 1];
+ int[] spix2 = new int[matrix[0].length - 1];
+ int[] dpix = new int[matrix.length];
for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
for (int x = src.getMinX(); x < src.getWidth() + src.getMinX(); x++)
- {
- // In case matrix rows have implicit translation
- spix[spix.length - 1] = 1.0f;
- src.getPixel(x, y, spix);
- for (int i = 0; i < matrix.length; i++)
{
- dpix[i] = 0;
- for (int j = 0; j < matrix[0].length; j++)
- dpix[i] += spix[j] * matrix[i][j];
+ // In case matrix rows have implicit translation
+ spix[spix.length - 1] = 1;
+ src.getPixel(x, y, spix);
+
+ // Do not re-calculate if pixel is identical to the last one
+ // (ie, blocks of the same colour)
+ if (!Arrays.equals(spix, spix2))
+ {
+ System.arraycopy(spix, 0, spix2, 0, spix.length);
+ for (int i = 0; i < matrix.length; i++)
+ {
+ dpix[i] = 0;
+ for (int j = 0; j < matrix[0].length - 1; j++)
+ dpix[i] += spix[j] * (int)matrix[i][j];
+ }
+ }
+ dest.setPixel(x, y, dpix);
}
- dest.setPixel(x, y, dpix);
- }
return dest;
}
@@ -125,28 +151,48 @@ public class BandCombineOp implements RasterOp
/**
* Creates a new WritableRaster that can be used as the destination for this
- * Op. This implementation creates a Banded Raster with data type FLOAT.
- * @see
- *java.awt.image.RasterOp#createCompatibleDestRaster(java.awt.image.Raster)
+ * Op. The number of bands in the source raster must equal the number of rows
+ * in the op matrix, which must also be equal to either the number of columns
+ * or (columns - 1) in the matrix.
+ *
+ * @param src The source raster.
+ * @return A compatible raster.
+ * @see java.awt.image.RasterOp#createCompatibleDestRaster(java.awt.image.Raster)
+ * @throws IllegalArgumentException if the raster is incompatible with the
+ * matrix.
*/
public WritableRaster createCompatibleDestRaster(Raster src)
{
- return Raster.createBandedRaster(DataBuffer.TYPE_FLOAT, src.getWidth(),
- src.getHeight(), matrix.length,
- new Point(src.getMinX(), src.getMinY()));
+ // Destination raster must have same number of bands as source
+ if (src.getNumBands() != matrix.length)
+ throw new IllegalArgumentException("Number of rows in matrix specifies an "
+ + "incompatible number of bands");
+
+ // We use -1 and -2 because we previously padded the rows with a trailing 0
+ if (src.getNumBands() != matrix[0].length - 1
+ && src.getNumBands() != matrix[0].length - 2)
+ throw new IllegalArgumentException("Incompatible number of bands: "
+ + "the number of bands in the raster must equal the number of "
+ + "columns in the matrix, optionally minus one");
+
+ return src.createCompatibleWritableRaster();
}
- /** Return corresponding destination point for source point.
+ /**
+ * Return corresponding destination point for source point. Because this is
+ * not a geometric operation, it simply returns a copy of the source.
*
- * LookupOp will return the value of src unchanged.
* @param src The source point.
* @param dst The destination point.
+ * @return dst The destination point.
* @see java.awt.image.RasterOp#getPoint2D(java.awt.geom.Point2D,
*java.awt.geom.Point2D)
*/
public final Point2D getPoint2D(Point2D src, Point2D dst)
{
- if (dst == null) return (Point2D)src.clone();
+ if (dst == null)
+ return (Point2D)src.clone();
+
dst.setLocation(src);
return dst;
}
@@ -159,7 +205,11 @@ public class BandCombineOp implements RasterOp
return hints;
}
- /** Return the matrix for this Op. */
+ /**
+ * Return the matrix used in this operation.
+ *
+ * @return The matrix used in this operation.
+ */
public final float[][] getMatrix()
{
return matrix;
diff --git a/libjava/classpath/java/awt/image/BufferedImage.java b/libjava/classpath/java/awt/image/BufferedImage.java
index 76848db0833..ef3141d0ead 100644
--- a/libjava/classpath/java/awt/image/BufferedImage.java
+++ b/libjava/classpath/java/awt/image/BufferedImage.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package java.awt.image;
+import gnu.java.awt.Buffers;
import gnu.java.awt.ComponentDataBlitOp;
import java.awt.Graphics;
@@ -79,27 +80,37 @@ public class BufferedImage extends Image
TYPE_BYTE_BINARY = 12,
TYPE_BYTE_INDEXED = 13;
- static final int[] bits3 = { 8, 8, 8 };
- static final int[] bits4 = { 8, 8, 8, 8 };
- static final int[] bits1byte = { 8 };
- static final int[] bits1ushort = { 16 };
-
- static final int[] masks_int = { 0x00ff0000,
- 0x0000ff00,
- 0x000000ff,
- DataBuffer.TYPE_INT };
- static final int[] masks_565 = { 0xf800,
- 0x07e0,
- 0x001f,
- DataBuffer.TYPE_USHORT};
- static final int[] masks_555 = { 0x7c00,
- 0x03e0,
- 0x001f,
- DataBuffer.TYPE_USHORT};
-
- Vector observers;
+ /**
+ * Vector of TileObservers (or null)
+ */
+ Vector tileObservers;
/**
+ * The image's WritableRaster
+ */
+ WritableRaster raster;
+
+ /**
+ * The associated ColorModel
+ */
+ ColorModel colorModel;
+
+ /**
+ * The image's properties (or null)
+ */
+ Hashtable properties;
+
+ /**
+ * Whether alpha is premultiplied
+ */
+ boolean isPremultiplied;
+
+ /**
+ * The predefined type, if any.
+ */
+ int type;
+
+ /**
* Creates a new <code>BufferedImage</code> with the specified width, height
* and type. Valid <code>type</code> values are:
*
@@ -119,155 +130,181 @@ public class BufferedImage extends Image
* <li>{@link #TYPE_BYTE_INDEXED}</li>
* </ul>
*
- * @param w the width (must be > 0).
- * @param h the height (must be > 0).
+ * @param width the width (must be > 0).
+ * @param height the height (must be > 0).
* @param type the image type (see the list of valid types above).
*
- * @throws IllegalArgumentException if <code>w</code> or <code>h</code> is
- * less than or equal to zero.
+ * @throws IllegalArgumentException if <code>width</code> or
+ * <code>height</code> is less than or equal to zero.
* @throws IllegalArgumentException if <code>type</code> is not one of the
* specified values.
*/
- public BufferedImage(int w, int h, int type)
+ public BufferedImage(int width, int height, int type)
{
+ SampleModel sm = null;
ColorModel cm = null;
-
- boolean alpha = false;
- boolean premultiplied = false;
- switch (type)
- {
- case TYPE_4BYTE_ABGR_PRE:
- case TYPE_INT_ARGB_PRE:
- premultiplied = true;
- // fall through
- case TYPE_INT_ARGB:
- case TYPE_4BYTE_ABGR:
- alpha = true;
- }
-
- ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
- switch (type)
+ boolean premultiplied = (type == BufferedImage.TYPE_INT_ARGB_PRE ||
+ type == BufferedImage.TYPE_4BYTE_ABGR_PRE);
+
+ switch( type )
{
- case TYPE_INT_RGB:
- case TYPE_INT_ARGB:
- case TYPE_INT_ARGB_PRE:
- case TYPE_USHORT_565_RGB:
- case TYPE_USHORT_555_RGB:
- int[] masks = null;
- switch (type)
- {
- case TYPE_INT_RGB:
- case TYPE_INT_ARGB:
- case TYPE_INT_ARGB_PRE:
- masks = masks_int;
- break;
- case TYPE_USHORT_565_RGB:
- masks = masks_565;
- break;
- case TYPE_USHORT_555_RGB:
- masks = masks_555;
- break;
- }
-
- cm = new DirectColorModel(cs,
- 32, // 32 bits in an int
- masks[0], // r
- masks[1], // g
- masks[2], // b
- alpha ? 0xff000000 : 0,
- premultiplied,
- masks[3] // data type
- );
+ case BufferedImage.TYPE_INT_RGB:
+ sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_INT,
+ width, height,
+ new int[]{ 0x00FF0000,
+ 0x0000FF00,
+ 0x000000FF } ) ;
+ cm = new DirectColorModel( 24, 0xff0000, 0xff00, 0xff );
break;
- case TYPE_INT_BGR:
- String msg =
- "FIXME: Programmer is confused. Why (and how) does a " +
- "TYPE_INT_BGR image use ComponentColorModel to store " +
- "8-bit values? Is data type TYPE_INT or TYPE_BYTE. What " +
- "is the difference between TYPE_INT_BGR and TYPE_3BYTE_BGR?";
- throw new UnsupportedOperationException(msg);
-
- case TYPE_3BYTE_BGR:
- case TYPE_4BYTE_ABGR:
- case TYPE_4BYTE_ABGR_PRE:
- case TYPE_BYTE_GRAY:
- case TYPE_USHORT_GRAY:
- int[] bits = null;
- int dataType = DataBuffer.TYPE_BYTE;
- switch (type) {
- case TYPE_3BYTE_BGR:
- bits = bits3;
- break;
- case TYPE_4BYTE_ABGR:
- case TYPE_4BYTE_ABGR_PRE:
- bits = bits4;
- break;
- case TYPE_BYTE_GRAY:
- bits = bits1byte;
- cs = ColorSpace.getInstance(ColorSpace.CS_GRAY);
- break;
- case TYPE_USHORT_GRAY:
- bits = bits1ushort;
- cs = ColorSpace.getInstance(ColorSpace.CS_GRAY);
- dataType = DataBuffer.TYPE_USHORT;
- break;
- }
- cm = new ComponentColorModel(cs, bits, alpha, premultiplied,
- alpha ?
- Transparency.TRANSLUCENT:
- Transparency.OPAQUE,
- dataType);
+ case BufferedImage.TYPE_3BYTE_BGR:
+ sm = new PixelInterleavedSampleModel( DataBuffer.TYPE_BYTE,
+ width, height,
+ 3, width * 3,
+ new int[]{ 2, 1, 0 } );
+ cm = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+ false, false,
+ BufferedImage.OPAQUE,
+ DataBuffer.TYPE_BYTE);
+ break;
+
+ case BufferedImage.TYPE_INT_ARGB:
+ case BufferedImage.TYPE_INT_ARGB_PRE:
+ sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_INT,
+ width, height,
+ new int[]{ 0x00FF0000,
+ 0x0000FF00,
+ 0x000000FF,
+ 0xFF000000 } );
+ if (premultiplied)
+ cm = new DirectColorModel( ColorSpace.getInstance(ColorSpace.CS_sRGB),
+ 32, 0xff0000, 0xff00, 0xff, 0xff000000,
+ true,
+ Buffers.smallestAppropriateTransferType(32));
+ else
+ cm = new DirectColorModel( 32, 0xff0000, 0xff00, 0xff, 0xff000000 );
+ break;
+
+ case BufferedImage.TYPE_4BYTE_ABGR:
+ case BufferedImage.TYPE_4BYTE_ABGR_PRE:
+ sm = new PixelInterleavedSampleModel(DataBuffer.TYPE_BYTE,
+ width, height,
+ 4, 4*width,
+ new int[]{3, 2, 1, 0});
+ cm = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+ true, premultiplied,
+ BufferedImage.TRANSLUCENT,
+ DataBuffer.TYPE_BYTE);
+ break;
+
+ case BufferedImage.TYPE_INT_BGR:
+ sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_INT,
+ width, height,
+ new int[]{ 0x000000FF,
+ 0x0000FF00,
+ 0x00FF0000 } ) ;
+ cm = new DirectColorModel( 24, 0xff, 0xff00, 0xff0000 );
+ break;
+
+ case BufferedImage.TYPE_USHORT_565_RGB:
+ sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_USHORT,
+ width, height,
+ new int[]{ 0xF800,
+ 0x7E0,
+ 0x1F } ) ;
+ cm = new DirectColorModel( 16, 0xF800, 0x7E0, 0x1F );
+ break;
+ case BufferedImage.TYPE_USHORT_555_RGB:
+ sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_USHORT,
+ width, height,
+ new int[]{ 0x7C00,
+ 0x3E0,
+ 0x1F } ) ;
+ cm = new DirectColorModel( 15, 0x7C00, 0x3E0, 0x1F );
break;
- case TYPE_BYTE_BINARY:
- byte[] vals = { 0, (byte) 0xff };
- cm = new IndexColorModel(8, 2, vals, vals, vals);
+
+ case BufferedImage.TYPE_BYTE_INDEXED:
+ cm = createDefaultIndexedColorModel( false );
+
+ case BufferedImage.TYPE_BYTE_GRAY:
+ sm = new PixelInterleavedSampleModel( DataBuffer.TYPE_BYTE,
+ width, height,
+ 1, width, new int[]{ 0 } );
+ break;
+
+ case BufferedImage.TYPE_USHORT_GRAY:
+ sm = new PixelInterleavedSampleModel( DataBuffer.TYPE_USHORT,
+ width, height,
+ 1, width, new int[]{ 0 } );
+ break;
+
+ case BufferedImage.TYPE_BYTE_BINARY:
+ cm = createDefaultIndexedColorModel( true );
+ sm = new MultiPixelPackedSampleModel(DataBuffer.TYPE_BYTE,
+ width, height, 1);
break;
- case TYPE_BYTE_INDEXED:
- String msg2 = "type not implemented yet";
- throw new UnsupportedOperationException(msg2);
- // FIXME: build color-cube and create color model
+
default:
- throw new IllegalArgumentException("Unknown image type " + type);
+ sm = null;
}
+
+ if( sm == null )
+ throw new IllegalArgumentException("Unknown predefined image type.");
- init(cm,
- cm.createCompatibleWritableRaster(w, h),
- premultiplied,
- null, // no properties
- type
- );
+ if( cm == null ) // only for the grayscale types
+ {
+ int buftype;
+ int[] bits = new int[1];
+ if( type == BufferedImage.TYPE_BYTE_GRAY )
+ {
+ buftype = DataBuffer.TYPE_BYTE;
+ bits[0] = 8;
+ }
+ else
+ {
+ buftype = DataBuffer.TYPE_USHORT;
+ bits[0] = 16;
+ }
+ ColorSpace graySpace = ColorSpace.getInstance( ColorSpace.CS_GRAY );
+
+ cm = new ComponentColorModel( graySpace, bits, false, false,
+ Transparency.OPAQUE, buftype );
+ }
+
+ init( cm,
+ Raster.createWritableRaster(sm, new Point( 0, 0 ) ),
+ premultiplied,
+ null, // no properties
+ type );
}
public BufferedImage(int w, int h, int type,
IndexColorModel indexcolormodel)
{
if ((type != TYPE_BYTE_BINARY) && (type != TYPE_BYTE_INDEXED))
- throw new IllegalArgumentException("type must be binary or indexed");
+ throw new IllegalArgumentException("Type must be TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED");
+ if( indexcolormodel.getMapSize() > 16 && type == TYPE_BYTE_BINARY )
+ throw new IllegalArgumentException("Type TYPE_BYTE_BINARY cannot have a larger than 16-color palette.");
+ if( indexcolormodel.getMapSize() > 256 )
+ throw new IllegalArgumentException("Byte type cannot have a larger than 256-color palette.");
- init(indexcolormodel,
- indexcolormodel.createCompatibleWritableRaster(w, h),
- false, // not premultiplied (guess)
- null, // no properties
- type);
+ init( indexcolormodel,
+ indexcolormodel.createCompatibleWritableRaster(w, h),
+ indexcolormodel.isAlphaPremultiplied(),
+ null, // no properties
+ type );
}
public BufferedImage(ColorModel colormodel,
WritableRaster writableraster,
boolean premultiplied,
- Hashtable properties)
+ Hashtable<?,?> properties)
{
init(colormodel, writableraster, premultiplied, properties,
TYPE_CUSTOM);
- // TODO: perhaps try to identify type?
}
- WritableRaster raster;
- ColorModel colorModel;
- Hashtable properties;
- boolean isPremultiplied;
- int type;
-
+
private void init(ColorModel cm,
WritableRaster writableraster,
boolean premultiplied,
@@ -280,12 +317,48 @@ public class BufferedImage extends Image
isPremultiplied = premultiplied;
this.type = type;
}
-
- //public void addTileObserver(TileObserver tileobserver) {}
+
+ /**
+ * Creates the default palettes for the predefined indexed color types
+ * (256-color or black-and-white)
+ *
+ * @param binary - If <code>true</code>, a black and white palette,
+ * otherwise a default 256-color palette is returned.
+ */
+ private IndexColorModel createDefaultIndexedColorModel( boolean binary )
+ {
+ if( binary )
+ {
+ byte[] t = new byte[]{ 0, (byte)255 };
+ return new IndexColorModel( 1, 2, t, t, t );
+ }
+
+ byte[] r = new byte[256];
+ byte[] g = new byte[256];
+ byte[] b = new byte[256];
+ int index = 0;
+ for( int i = 0; i < 6; i++ )
+ for( int j = 0; j < 6; j++ )
+ for( int k = 0; k < 6; k++ )
+ {
+ r[ index ] = (byte)(i * 51);
+ g[ index ] = (byte)(j * 51);
+ b[ index ] = (byte)(k * 51);
+ index++;
+ }
+ while( index < 256 )
+ {
+ r[ index ] = g[ index ] = b[ index ] =
+ (byte)(18 + (index - 216) * 6);
+ index++;
+ }
+ return new IndexColorModel( 8, 256, r, g, b );
+ }
public void coerceData(boolean premultiplied)
{
colorModel = colorModel.coerceData(raster, premultiplied);
+ isPremultiplied = premultiplied;
}
public WritableRaster copyData(WritableRaster dest)
@@ -555,7 +628,7 @@ public class BufferedImage extends Image
};
}
- public Vector getSources()
+ public Vector<RenderedImage> getSources()
{
return null;
}
@@ -726,10 +799,10 @@ public class BufferedImage extends Image
*/
public void addTileObserver (TileObserver to)
{
- if (observers == null)
- observers = new Vector ();
+ if (tileObservers == null)
+ tileObservers = new Vector ();
- observers.add (to);
+ tileObservers.add (to);
}
/**
@@ -741,10 +814,10 @@ public class BufferedImage extends Image
*/
public void removeTileObserver (TileObserver to)
{
- if (observers == null)
+ if (tileObservers == null)
return;
- observers.remove (to);
+ tileObservers.remove (to);
}
/**
diff --git a/libjava/classpath/java/awt/image/ColorConvertOp.java b/libjava/classpath/java/awt/image/ColorConvertOp.java
index 1f85a5ecd99..e6c85412d34 100644
--- a/libjava/classpath/java/awt/image/ColorConvertOp.java
+++ b/libjava/classpath/java/awt/image/ColorConvertOp.java
@@ -38,7 +38,10 @@ exception statement from your version. */
package java.awt.image;
+import gnu.java.awt.Buffers;
+
import java.awt.Graphics2D;
+import java.awt.Point;
import java.awt.RenderingHints;
import java.awt.color.ColorSpace;
import java.awt.color.ICC_ColorSpace;
@@ -47,9 +50,9 @@ import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
/**
- * ColorConvertOp is a filter for converting an image from one colorspace to
- * another colorspace. The filter can convert the image through a sequence
- * of colorspaces or just from source to destination.
+ * ColorConvertOp is a filter for converting images or rasters between
+ * colorspaces, either through a sequence of colorspaces or just from source to
+ * destination.
*
* Color conversion is done on the color components without alpha. Thus
* if a BufferedImage has alpha premultiplied, this is divided out before
@@ -63,24 +66,22 @@ import java.awt.geom.Rectangle2D;
*/
public class ColorConvertOp implements BufferedImageOp, RasterOp
{
- private ColorSpace srccs;
- private ColorSpace dstcs;
private RenderingHints hints;
- private ICC_Profile[] profiles;
+ private ICC_Profile[] profiles = null;
private ColorSpace[] spaces;
- private boolean rasterValid;
/**
- * Convert BufferedImage through a ColorSpace.
+ * Convert a BufferedImage through a ColorSpace.
*
- * This filter version is only valid for BufferedImages. The source image
- * is converted to cspace. If the destination is not null, it is then
- * converted to the destination colorspace. Normally this filter will only
- * be used with a null destination.
+ * Objects created with this constructor can be used to convert
+ * BufferedImage's to a destination ColorSpace. Attempts to convert Rasters
+ * with this constructor will result in an IllegalArgumentException when the
+ * filter(Raster, WritableRaster) method is called.
*
* @param cspace The target color space.
- * @param hints Rendering hints to use in conversion, or null.
+ * @param hints Rendering hints to use in conversion, if any (may be null)
+ * @throws NullPointerException if the ColorSpace is null.
*/
public ColorConvertOp(ColorSpace cspace, RenderingHints hints)
{
@@ -88,9 +89,27 @@ public class ColorConvertOp implements BufferedImageOp, RasterOp
throw new NullPointerException();
spaces = new ColorSpace[]{cspace};
this.hints = hints;
- rasterValid = false;
}
+ /**
+ * Convert from a source colorspace to a destination colorspace.
+ *
+ * This constructor takes two ColorSpace arguments as the source and
+ * destination color spaces. It is usually used with the
+ * filter(Raster, WritableRaster) method, in which case the source colorspace
+ * is assumed to correspond to the source Raster, and the destination
+ * colorspace with the destination Raster.
+ *
+ * If used with BufferedImages that do not match the source or destination
+ * colorspaces specified here, there is an implicit conversion from the
+ * source image to the source ColorSpace, or the destination ColorSpace to
+ * the destination image.
+ *
+ * @param srcCspace The source ColorSpace.
+ * @param dstCspace The destination ColorSpace.
+ * @param hints Rendering hints to use in conversion, if any (may be null).
+ * @throws NullPointerException if any ColorSpace is null.
+ */
public ColorConvertOp(ColorSpace srcCspace, ColorSpace dstCspace,
RenderingHints hints)
{
@@ -101,61 +120,77 @@ public class ColorConvertOp implements BufferedImageOp, RasterOp
}
/**
- * Convert from a source image destination image color space.
+ * Convert from a source colorspace to a destinatino colorspace.
*
* This constructor builds a ColorConvertOp from an array of ICC_Profiles.
- * The source image will be converted through the sequence of color spaces
+ * The source will be converted through the sequence of color spaces
* defined by the profiles. If the sequence of profiles doesn't give a
- * well-defined conversion, throws IllegalArgumentException.
- *
- * NOTE: Sun's docs don't clearly define what a well-defined conversion is
- * - or perhaps someone smarter can come along and sort it out.
+ * well-defined conversion, an IllegalArgumentException is thrown.
*
- * For BufferedImages, when the first and last profiles match the
- * requirements of the source and destination color space respectively, the
- * corresponding conversion is unnecessary. TODO: code this up. I don't
- * yet understand how you determine this.
+ * If used with BufferedImages that do not match the source or destination
+ * colorspaces specified here, there is an implicit conversion from the
+ * source image to the source ColorSpace, or the destination ColorSpace to
+ * the destination image.
*
* For Rasters, the first and last profiles must have the same number of
* bands as the source and destination Rasters, respectively. If this is
* not the case, or there fewer than 2 profiles, an IllegalArgumentException
* will be thrown.
*
- * @param profiles
- * @param hints
+ * @param profiles An array of ICC_Profile's to convert through.
+ * @param hints Rendering hints to use in conversion, if any (may be null).
+ * @throws NullPointerException if the profile array is null.
+ * @throws IllegalArgumentException if the array is not a well-defined
+ * conversion.
*/
public ColorConvertOp(ICC_Profile[] profiles, RenderingHints hints)
{
if (profiles == null)
throw new NullPointerException();
+
this.hints = hints;
this.profiles = profiles;
- // TODO: Determine if this is well-defined.
+
// Create colorspace array with space for src and dest colorspace
+ // Note that the ICC_ColorSpace constructor will throw an
+ // IllegalArgumentException if the profile is invalid; thus we check
+ // for a "well defined conversion"
spaces = new ColorSpace[profiles.length];
for (int i = 0; i < profiles.length; i++)
spaces[i] = new ICC_ColorSpace(profiles[i]);
}
- /** Convert from source image color space to destination image color space.
+ /**
+ * Convert from source color space to destination color space.
*
* Only valid for BufferedImage objects, this Op converts from the source
- * color space to the destination color space. The destination can't be
- * null for this operation.
+ * image's color space to the destination image's color space.
*
- * @param hints Rendering hints to use during conversion, or null.
+ * The destination in the filter(BufferedImage, BufferedImage) method cannot
+ * be null for this operation, and it also cannot be used with the
+ * filter(Raster, WritableRaster) method.
+ *
+ * @param hints Rendering hints to use in conversion, if any (may be null).
*/
public ColorConvertOp(RenderingHints hints)
{
- this.hints = hints;
- srccs = null;
- dstcs = null;
- rasterValid = false;
+ this.hints = hints;
+ spaces = new ColorSpace[0];
}
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#filter(java.awt.image.BufferedImage,
- java.awt.image.BufferedImage)
+ /**
+ * Converts the source image using the conversion path specified in the
+ * constructor. The resulting image is stored in the destination image if one
+ * is provided; otherwise a new BufferedImage is created and returned.
+ *
+ * The source and destination BufferedImage (if one is supplied) must have
+ * the same dimensions.
+ *
+ * @param src The source image.
+ * @param dst The destination image.
+ * @throws IllegalArgumentException if the rasters and/or color spaces are
+ * incompatible.
+ * @return The transformed image.
*/
public final BufferedImage filter(BufferedImage src, BufferedImage dst)
{
@@ -163,129 +198,241 @@ public class ColorConvertOp implements BufferedImageOp, RasterOp
// For now we just suck it up and create intermediate buffers.
if (dst == null && spaces.length == 0)
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("Not enough color space information "
+ + "to complete conversion.");
+
+ if (dst != null
+ && (src.getHeight() != dst.getHeight() || src.getWidth() != dst.getWidth()))
+ throw new IllegalArgumentException("Source and destination images have "
+ + "different dimensions");
// Make sure input isn't premultiplied by alpha
if (src.isAlphaPremultiplied())
- {
- BufferedImage tmp = createCompatibleDestImage(src, src.getColorModel());
- copyimage(src, tmp);
- tmp.coerceData(false);
- src = tmp;
- }
+ {
+ BufferedImage tmp = createCompatibleDestImage(src, src.getColorModel());
+ copyimage(src, tmp);
+ tmp.coerceData(false);
+ src = tmp;
+ }
- ColorModel scm = src.getColorModel();
+ // Convert through defined intermediate conversions
+ BufferedImage tmp;
for (int i = 0; i < spaces.length; i++)
- {
- BufferedImage tmp = createCompatibleDestImage(src, scm);
- copyimage(src, tmp);
- src = tmp;
- }
+ {
+ if (src.getColorModel().getColorSpace().getType() != spaces[i].getType())
+ {
+ tmp = createCompatibleDestImage(src,
+ createCompatibleColorModel(src,
+ spaces[i]));
+ copyimage(src, tmp);
+ src = tmp;
+ }
+ }
- // Intermediate conversions leave result in src
+ // No implicit conversion to destination type needed; return result from the
+ // last intermediate conversions (which was left in src)
if (dst == null)
- return src;
-
- // Apply final conversion
- copyimage(src, dst);
-
+ dst = src;
+
+ // Implicit conversion to destination image's color space
+ else
+ copyimage(src, dst);
+
return dst;
}
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#createCompatibleDestImage(java.awt.image.BufferedImage, java.awt.image.ColorModel)
+ /**
+ * Converts the source raster using the conversion path specified in the
+ * constructor. The resulting raster is stored in the destination raster if
+ * one is provided; otherwise a new WritableRaster is created and returned.
+ *
+ * This operation is not valid with every constructor of this class; see
+ * the constructors for details. Further, the source raster must have the
+ * same number of bands as the source ColorSpace, and the destination raster
+ * must have the same number of bands as the destination ColorSpace.
+ *
+ * The source and destination raster (if one is supplied) must also have the
+ * same dimensions.
+ *
+ * @param src The source raster.
+ * @param dest The destination raster.
+ * @throws IllegalArgumentException if the rasters and/or color spaces are
+ * incompatible.
+ * @return The transformed raster.
+ */
+ public final WritableRaster filter(Raster src, WritableRaster dest)
+ {
+ // Various checks to ensure that the rasters and color spaces are compatible
+ if (spaces.length < 2)
+ throw new IllegalArgumentException("Not enough information about " +
+ "source and destination colorspaces.");
+
+ if (spaces[0].getNumComponents() != src.getNumBands()
+ || (dest != null && spaces[spaces.length - 1].getNumComponents() != dest.getNumBands()))
+ throw new IllegalArgumentException("Source or destination raster " +
+ "contains the wrong number of bands.");
+
+ if (dest != null
+ && (src.getHeight() != dest.getHeight() || src.getWidth() != dest.getWidth()))
+ throw new IllegalArgumentException("Source and destination rasters " +
+ "have different dimensions");
+
+ // Need to iterate through each color space.
+ // spaces[0] corresponds to the ColorSpace of the source raster, and
+ // spaces[spaces.length - 1] corresponds to the ColorSpace of the
+ // destination, with any number (or zero) of intermediate conversions.
+
+ for (int i = 0; i < spaces.length - 2; i++)
+ {
+ WritableRaster tmp = createCompatibleDestRaster(src, spaces[i + 1],
+ false,
+ src.getTransferType());
+ copyraster(src, spaces[i], tmp, spaces[i + 1]);
+ src = tmp;
+ }
+
+ // The last conversion is done outside of the loop so that we can
+ // use the dest raster supplied, instead of creating our own temp raster
+ if (dest == null)
+ dest = createCompatibleDestRaster(src, spaces[spaces.length - 1], false,
+ DataBuffer.TYPE_BYTE);
+ copyraster(src, spaces[spaces.length - 2], dest, spaces[spaces.length - 1]);
+
+ return dest;
+ }
+
+ /**
+ * Creates an empty BufferedImage with the size equal to the source and the
+ * correct number of bands for the conversion defined in this Op. The newly
+ * created image is created with the specified ColorModel, or if no ColorModel
+ * is supplied, an appropriate one is chosen.
+ *
+ * @param src The source image.
+ * @param dstCM A color model for the destination image (may be null).
+ * @throws IllegalArgumentException if an appropriate colormodel cannot be
+ * chosen with the information given.
+ * @return The new compatible destination image.
*/
public BufferedImage createCompatibleDestImage(BufferedImage src,
- ColorModel dstCM)
+ ColorModel dstCM)
{
- // FIXME: set properties to those in src
+ if (dstCM == null && spaces.length == 0)
+ throw new IllegalArgumentException("Don't know the destination " +
+ "colormodel");
+
+ if (dstCM == null)
+ {
+ dstCM = createCompatibleColorModel(src, spaces[spaces.length - 1]);
+ }
+
return new BufferedImage(dstCM,
- src.getRaster().createCompatibleWritableRaster(),
- src.isPremultiplied,
- null);
+ createCompatibleDestRaster(src.getRaster(),
+ dstCM.getColorSpace(),
+ src.getColorModel().hasAlpha,
+ dstCM.getTransferType()),
+ src.isPremultiplied, null);
}
- public final ICC_Profile[] getICC_Profiles()
+ /**
+ * Creates a new WritableRaster with the size equal to the source and the
+ * correct number of bands.
+ *
+ * Note, the new Raster will always use a BYTE storage size, regardless of
+ * the color model or defined destination; this is for compatibility with
+ * the reference implementation.
+ *
+ * @param src The source Raster.
+ * @throws IllegalArgumentException if there isn't enough colorspace
+ * information to create a compatible Raster.
+ * @return The new compatible destination raster.
+ */
+ public WritableRaster createCompatibleDestRaster(Raster src)
{
- return profiles;
- }
+ if (spaces.length < 2)
+ throw new IllegalArgumentException("Not enough destination colorspace " +
+ "information");
- /** Return the rendering hints for this op. */
- public final RenderingHints getRenderingHints()
- {
- return hints;
+ // Create a new raster with the last ColorSpace in the conversion
+ // chain, and with no alpha (implied)
+ return createCompatibleDestRaster(src, spaces[spaces.length-1], false,
+ DataBuffer.TYPE_BYTE);
}
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#filter(java.awt.image.Raster, java.awt.image.WritableRaster)
+ /**
+ * Returns the array of ICC_Profiles used to create this Op, or null if the
+ * Op was created using ColorSpace arguments.
+ *
+ * @return The array of ICC_Profiles, or null.
*/
- public final WritableRaster filter(Raster src, WritableRaster dest)
+ public final ICC_Profile[] getICC_Profiles()
{
- if (!rasterValid)
- throw new IllegalArgumentException();
-
- // Need to iterate through each color space - there must be at least 2
- for (int i = 1; i < spaces.length - 1; i++)
- {
- // FIXME: this is wrong. tmp needs to have the same number of bands as
- // spaces[i] has.
- WritableRaster tmp = createCompatibleDestRaster(src);
- copyraster(src, spaces[i - 1], tmp, spaces[i]);
- src = tmp;
- }
-
- // FIXME: this is wrong. dst needs to have the same number of bands as
- // spaces[i] has.
- if (dest == null)
- dest = createCompatibleDestRaster(src);
- copyraster(src, spaces[spaces.length - 2],
- dest, spaces[spaces.length - 1]);
-
- return dest;
+ return profiles;
}
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#createCompatibleDestRaster(java.awt.image.Raster)
+ /**
+ * Returns the rendering hints for this op.
+ *
+ * @return The rendering hints for this Op, or null.
*/
- public WritableRaster createCompatibleDestRaster(Raster src)
+ public final RenderingHints getRenderingHints()
{
- return src.createCompatibleWritableRaster();
+ return hints;
}
- /** Return corresponding destination point for source point.
+ /**
+ * Returns the corresponding destination point for a source point.
+ * Because this is not a geometric operation, the destination and source
+ * points will be identical.
*
- * LookupOp will return the value of src unchanged.
* @param src The source point.
- * @param dst The destination point.
- * @see java.awt.image.RasterOp#getPoint2D(java.awt.geom.Point2D, java.awt.geom.Point2D)
+ * @param dst The transformed destination point.
+ * @return The transformed destination point.
*/
public final Point2D getPoint2D(Point2D src, Point2D dst)
{
- if (dst == null) return (Point2D)src.clone();
+ if (dst == null)
+ return (Point2D)src.clone();
+
dst.setLocation(src);
return dst;
}
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#getBounds2D(java.awt.image.BufferedImage)
+ /**
+ * Returns the corresponding destination boundary of a source boundary.
+ * Because this is not a geometric operation, the destination and source
+ * boundaries will be identical.
+ *
+ * @param src The source boundary.
+ * @return The boundaries of the destination.
*/
public final Rectangle2D getBounds2D(BufferedImage src)
{
return src.getRaster().getBounds();
}
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#getBounds2D(java.awt.image.Raster)
+ /**
+ * Returns the corresponding destination boundary of a source boundary.
+ * Because this is not a geometric operation, the destination and source
+ * boundaries will be identical.
+ *
+ * @param src The source boundary.
+ * @return The boundaries of the destination.
*/
public final Rectangle2D getBounds2D(Raster src)
{
return src.getBounds();
}
-
- // According to Sven de Marothy, we need to copy the src into the dest
- // using Graphics2D, in order to use the rendering hints.
+
+ /**
+ * Copy a source image to a destination image, respecting their colorspaces
+ * and performing colorspace conversions if necessary.
+ *
+ * @param src The source image.
+ * @param dst The destination image.
+ */
private void copyimage(BufferedImage src, BufferedImage dst)
{
+ // This is done using Graphics2D in order to respect the rendering hints.
Graphics2D gg = dst.createGraphics();
// If no hints are set there is no need to call
@@ -297,13 +444,23 @@ public class ColorConvertOp implements BufferedImageOp, RasterOp
gg.dispose();
}
- private void copyraster(Raster src, ColorSpace scs, WritableRaster dst,
- ColorSpace dcs)
+ /**
+ * Copy a source raster to a destination raster, performing a colorspace
+ * conversion between the two. The conversion will respect the
+ * KEY_COLOR_RENDERING rendering hint if one is present.
+ *
+ * @param src The source raster.
+ * @param scs The colorspace of the source raster.
+ * @dst The destination raster.
+ * @dcs The colorspace of the destination raster.
+ */
+ private void copyraster(Raster src, ColorSpace scs, WritableRaster dst, ColorSpace dcs)
{
float[] sbuf = new float[src.getNumBands()];
- if (hints.get(RenderingHints.KEY_COLOR_RENDERING) ==
- RenderingHints.VALUE_COLOR_RENDER_QUALITY)
+ if (hints != null
+ && hints.get(RenderingHints.KEY_COLOR_RENDERING) ==
+ RenderingHints.VALUE_COLOR_RENDER_QUALITY)
{
// use cie for accuracy
for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
@@ -321,4 +478,60 @@ public class ColorConvertOp implements BufferedImageOp, RasterOp
}
}
+ /**
+ * This method creates a color model with the same colorspace and alpha
+ * settings as the source image. The created color model will always be a
+ * ComponentColorModel and have a BYTE transfer type.
+ *
+ * @param img The source image.
+ * @param cs The ColorSpace to use.
+ * @return A color model compatible with the source image.
+ */
+ private ColorModel createCompatibleColorModel(BufferedImage img, ColorSpace cs)
+ {
+ // The choice of ComponentColorModel and DataBuffer.TYPE_BYTE is based on
+ // Mauve testing of the reference implementation.
+ return new ComponentColorModel(cs,
+ img.getColorModel().hasAlpha(),
+ img.isAlphaPremultiplied(),
+ img.getColorModel().getTransparency(),
+ DataBuffer.TYPE_BYTE);
+ }
+
+ /**
+ * This method creates a compatible Raster, given a source raster, colorspace,
+ * alpha value, and transfer type.
+ *
+ * @param src The source raster.
+ * @param cs The ColorSpace to use.
+ * @param hasAlpha Whether the raster should include a component for an alpha.
+ * @param transferType The size of a single data element.
+ * @return A compatible WritableRaster.
+ */
+ private WritableRaster createCompatibleDestRaster(Raster src, ColorSpace cs,
+ boolean hasAlpha,
+ int transferType)
+ {
+ // The use of a PixelInterleavedSampleModel weas determined using mauve
+ // tests, based on the reference implementation
+
+ int numComponents = cs.getNumComponents();
+ if (hasAlpha)
+ numComponents++;
+
+ int[] offsets = new int[numComponents];
+ for (int i = 0; i < offsets.length; i++)
+ offsets[i] = i;
+
+ DataBuffer db = Buffers.createBuffer(transferType,
+ src.getWidth() * src.getHeight() * numComponents,
+ 1);
+ return new WritableRaster(new PixelInterleavedSampleModel(transferType,
+ src.getWidth(),
+ src.getHeight(),
+ numComponents,
+ numComponents * src.getWidth(),
+ offsets),
+ db, new Point(src.getMinX(), src.getMinY()));
+ }
}
diff --git a/libjava/classpath/java/awt/image/ColorModel.java b/libjava/classpath/java/awt/image/ColorModel.java
index 9e559db37d8..e2873c5d71f 100644
--- a/libjava/classpath/java/awt/image/ColorModel.java
+++ b/libjava/classpath/java/awt/image/ColorModel.java
@@ -624,40 +624,40 @@ public abstract class ColorModel implements Transparency
return cspace;
}
- // Typically overridden
public ColorModel coerceData(WritableRaster raster,
- boolean isAlphaPremultiplied)
+ boolean isAlphaPremultiplied)
{
- if (this.isAlphaPremultiplied == isAlphaPremultiplied)
- return this;
+ // This method should always be overridden, but is not abstract.
+ throw new UnsupportedOperationException();
+ }
+ protected void coerceDataWorker(WritableRaster raster,
+ boolean isAlphaPremultiplied)
+ {
int w = raster.getWidth();
int h = raster.getHeight();
int x = raster.getMinX();
int y = raster.getMinY();
- int size = w*h;
+ int size = w * h;
int numColors = getNumColorComponents();
int numComponents = getNumComponents();
- int alphaScale = (1<<getComponentSize(numColors)) - 1;
+ int alphaScale = (1 << getComponentSize(numColors)) - 1;
double[] pixels = raster.getPixels(x, y, w, h, (double[]) null);
- for (int i=0; i<size; i++)
+ for (int i = 0; i < size; i++)
{
- double alpha = pixels[i*numComponents+numColors]*alphaScale;
- for (int c=0; c<numColors; c++)
- {
- int offset = i*numComponents+c;
- if (isAlphaPremultiplied)
- pixels[offset] = pixels[offset]/alpha;
- else
- pixels[offset] = pixels[offset]*alpha;
- }
+ double alpha = pixels[i * numComponents + numColors] / alphaScale;
+ for (int c = 0; c < numColors; c++)
+ {
+ int offset = i * numComponents + c;
+ if (isAlphaPremultiplied)
+ pixels[offset] = Math.round(pixels[offset] * alpha);
+ else
+ pixels[offset] = Math.round(pixels[offset] / alpha);
+ }
}
-
- raster.setPixels(0, 0, w, h, pixels);
- // FIXME: what can we return?
- return null;
+ raster.setPixels(0, 0, w, h, pixels);
}
/**
diff --git a/libjava/classpath/java/awt/image/ComponentColorModel.java b/libjava/classpath/java/awt/image/ComponentColorModel.java
index f56688f9362..2096800b20d 100644
--- a/libjava/classpath/java/awt/image/ComponentColorModel.java
+++ b/libjava/classpath/java/awt/image/ComponentColorModel.java
@@ -42,9 +42,11 @@ import gnu.java.awt.Buffers;
import java.awt.Point;
import java.awt.color.ColorSpace;
+import java.util.Arrays;
public class ComponentColorModel extends ColorModel
{
+ // Find sum of all elements of the array.
private static int sum(int[] values)
{
int sum = 0;
@@ -52,6 +54,22 @@ public class ComponentColorModel extends ColorModel
sum += values[i];
return sum;
}
+
+ // Create an appropriate array of bits, given a colorspace (ie, number of
+ // bands), size of the storage data type, and presence of an alpha band.
+ private static int[] findBits(ColorSpace colorSpace, int transferType,
+ boolean hasAlpha)
+ {
+ int[] bits;
+ if (hasAlpha)
+ bits = new int[colorSpace.getNumComponents()+1];
+ else
+ bits = new int[colorSpace.getNumComponents()];
+
+ Arrays.fill(bits, DataBuffer.getDataTypeSize(transferType));
+
+ return bits;
+ }
public ComponentColorModel(ColorSpace colorSpace, int[] bits,
boolean hasAlpha,
@@ -84,8 +102,8 @@ public class ComponentColorModel extends ColorModel
boolean isAlphaPremultiplied,
int transparency, int transferType)
{
- this(colorSpace, null, hasAlpha, isAlphaPremultiplied,
- transparency, transferType);
+ this(colorSpace, findBits(colorSpace, transferType, hasAlpha), hasAlpha,
+ isAlphaPremultiplied, transparency, transferType);
}
public int getRed(int pixel)
@@ -288,17 +306,16 @@ public class ComponentColorModel extends ColorModel
public ColorModel coerceData(WritableRaster raster,
boolean isAlphaPremultiplied) {
- if (this.isAlphaPremultiplied == isAlphaPremultiplied)
+ if (this.isAlphaPremultiplied == isAlphaPremultiplied || !hasAlpha())
return this;
/* TODO: provide better implementation based on the
assumptions we can make due to the specific type of the
color model. */
- super.coerceData(raster, isAlphaPremultiplied);
+ super.coerceDataWorker(raster, isAlphaPremultiplied);
- return new ComponentColorModel(cspace, bits, hasAlpha(),
- isAlphaPremultiplied, // argument
- transparency, transferType);
+ return new ComponentColorModel(cspace, hasAlpha, isAlphaPremultiplied,
+ transparency, transferType);
}
public boolean isCompatibleRaster(Raster raster)
diff --git a/libjava/classpath/java/awt/image/ConvolveOp.java b/libjava/classpath/java/awt/image/ConvolveOp.java
index ffb834874fa..cf30e762599 100644
--- a/libjava/classpath/java/awt/image/ConvolveOp.java
+++ b/libjava/classpath/java/awt/image/ConvolveOp.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package java.awt.image;
-import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
@@ -51,11 +50,13 @@ import java.awt.geom.Rectangle2D;
* with elements in the kernel to compute a new pixel.
*
* Each band in a Raster is convolved and copied to the destination Raster.
+ * For BufferedImages, convolution is applied to all components. Color
+ * conversion will be applied if needed.
*
- * For BufferedImages, convolution is applied to all components. If the
- * source is not premultiplied, the data will be premultiplied before
- * convolving. Premultiplication will be undone if the destination is not
- * premultiplied. Color conversion will be applied if needed.
+ * Note that this filter ignores whether the source or destination is alpha
+ * premultiplied. The reference spec states that data will be premultiplied
+ * prior to convolving and divided back out afterwards (if needed), but testing
+ * has shown that this is not the case with their implementation.
*
* @author jlquinn@optonline.net
*/
@@ -104,59 +105,83 @@ public class ConvolveOp implements BufferedImageOp, RasterOp
hints = null;
}
-
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#filter(java.awt.image.BufferedImage,
- * java.awt.image.BufferedImage)
+ /**
+ * Converts the source image using the kernel specified in the
+ * constructor. The resulting image is stored in the destination image if one
+ * is provided; otherwise a new BufferedImage is created and returned.
+ *
+ * The source and destination BufferedImage (if one is supplied) must have
+ * the same dimensions.
+ *
+ * @param src The source image.
+ * @param dst The destination image.
+ * @throws IllegalArgumentException if the rasters and/or color spaces are
+ * incompatible.
+ * @return The convolved image.
*/
public final BufferedImage filter(BufferedImage src, BufferedImage dst)
{
if (src == dst)
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("Source and destination images " +
+ "cannot be the same.");
if (dst == null)
dst = createCompatibleDestImage(src, src.getColorModel());
// Make sure source image is premultiplied
BufferedImage src1 = src;
- if (!src.isPremultiplied)
+ // The spec says we should do this, but mauve testing shows that Sun's
+ // implementation does not check this.
+ /*
+ if (!src.isAlphaPremultiplied())
{
src1 = createCompatibleDestImage(src, src.getColorModel());
src.copyData(src1.getRaster());
src1.coerceData(true);
}
+ */
BufferedImage dst1 = dst;
- if (!src.getColorModel().equals(dst.getColorModel()))
+ if (src1.getColorModel().getColorSpace().getType() != dst.getColorModel().getColorSpace().getType())
dst1 = createCompatibleDestImage(src, src.getColorModel());
filter(src1.getRaster(), dst1.getRaster());
+ // Since we don't coerceData above, we don't need to divide it back out.
+ // This is wrong (one mauve test specifically tests converting a non-
+ // premultiplied image to a premultiplied image, and it shows that Sun
+ // simply ignores the premultipled flag, contrary to the spec), but we
+ // mimic it for compatibility.
+ /*
+ if (! dst.isAlphaPremultiplied())
+ dst1.coerceData(false);
+ */
+
+ // Convert between color models if needed
if (dst1 != dst)
- {
- // Convert between color models.
- // TODO Check that premultiplied alpha is handled correctly here.
- Graphics2D gg = dst.createGraphics();
- gg.setRenderingHints(hints);
- gg.drawImage(dst1, 0, 0, null);
- gg.dispose();
- }
-
+ new ColorConvertOp(hints).filter(dst1, dst);
+
return dst;
}
- /* (non-Javadoc)
- * @see
- * java.awt.image.BufferedImageOp#createCompatibleDestImage(java.awt.image.BufferedImage,
- * java.awt.image.ColorModel)
+ /**
+ * Creates an empty BufferedImage with the size equal to the source and the
+ * correct number of bands. The new image is created with the specified
+ * ColorModel, or if no ColorModel is supplied, an appropriate one is chosen.
+ *
+ * @param src The source image.
+ * @param dstCM A color model for the destination image (may be null).
+ * @return The new compatible destination image.
*/
public BufferedImage createCompatibleDestImage(BufferedImage src,
- ColorModel dstCM)
+ ColorModel dstCM)
{
- // FIXME: set properties to those in src
- return new BufferedImage(dstCM,
- src.getRaster().createCompatibleWritableRaster(),
- src.isPremultiplied, null);
+ if (dstCM != null)
+ return new BufferedImage(dstCM,
+ src.getRaster().createCompatibleWritableRaster(),
+ src.isAlphaPremultiplied(), null);
+
+ return new BufferedImage(src.getWidth(), src.getHeight(), src.getType());
}
/* (non-Javadoc)
@@ -168,6 +193,8 @@ public class ConvolveOp implements BufferedImageOp, RasterOp
}
/**
+ * Get the edge condition for this Op.
+ *
* @return The edge condition.
*/
public int getEdgeCondition()
@@ -185,9 +212,22 @@ public class ConvolveOp implements BufferedImageOp, RasterOp
return (Kernel) kernel.clone();
}
- /* (non-Javadoc)
- * @see java.awt.image.RasterOp#filter(java.awt.image.Raster,
- * java.awt.image.WritableRaster)
+ /**
+ * Converts the source raster using the kernel specified in the constructor.
+ * The resulting raster is stored in the destination raster if one is
+ * provided; otherwise a new WritableRaster is created and returned.
+ *
+ * If the convolved value for a sample is outside the range of [0-255], it
+ * will be clipped.
+ *
+ * The source and destination raster (if one is supplied) cannot be the same,
+ * and must also have the same dimensions.
+ *
+ * @param src The source raster.
+ * @param dest The destination raster.
+ * @throws IllegalArgumentException if the rasters identical.
+ * @throws ImagingOpException if the convolution is not possible.
+ * @return The transformed raster.
*/
public final WritableRaster filter(Raster src, WritableRaster dest)
{
@@ -209,6 +249,11 @@ public class ConvolveOp implements BufferedImageOp, RasterOp
int top = kernel.getYOrigin();
int bottom = Math.max(kHeight - top - 1, 0);
+ // Calculate max sample values for clipping
+ int[] maxValue = src.getSampleModel().getSampleSize();
+ for (int i = 0; i < maxValue.length; i++)
+ maxValue[i] = (int)Math.pow(2, maxValue[i]) - 1;
+
// process the region that is reachable...
int regionW = src.width - left - right;
int regionH = src.height - top - bottom;
@@ -228,7 +273,14 @@ public class ConvolveOp implements BufferedImageOp, RasterOp
v += tmp[tmp.length - i - 1] * kvals[i];
// FIXME: in the above line, I've had to reverse the order of
// the samples array to make the tests pass. I haven't worked
- // out why this is necessary.
+ // out why this is necessary.
+
+ // This clipping is is undocumented, but determined by testing.
+ if (v > maxValue[b])
+ v = maxValue[b];
+ else if (v < 0)
+ v = 0;
+
dest.setSample(x + kernel.getXOrigin(), y + kernel.getYOrigin(),
b, v);
}
@@ -310,13 +362,14 @@ public class ConvolveOp implements BufferedImageOp, RasterOp
return src.getBounds();
}
- /** Return corresponding destination point for source point.
+ /**
+ * Returns the corresponding destination point for a source point. Because
+ * this is not a geometric operation, the destination and source points will
+ * be identical.
*
- * ConvolveOp will return the value of src unchanged.
* @param src The source point.
- * @param dst The destination point.
- * @see java.awt.image.RasterOp#getPoint2D(java.awt.geom.Point2D,
- * java.awt.geom.Point2D)
+ * @param dst The transformed destination point.
+ * @return The transformed destination point.
*/
public final Point2D getPoint2D(Point2D src, Point2D dst)
{
diff --git a/libjava/classpath/java/awt/image/CropImageFilter.java b/libjava/classpath/java/awt/image/CropImageFilter.java
index 4fcfdec4475..53b41562044 100644
--- a/libjava/classpath/java/awt/image/CropImageFilter.java
+++ b/libjava/classpath/java/awt/image/CropImageFilter.java
@@ -91,11 +91,12 @@ public class CropImageFilter extends ImageFilter
*
* @param props the list of properties associated with this image
*/
- public void setProperties(Hashtable props)
+ public void setProperties(Hashtable<?, ?> props)
{
- props.put("filters", "CropImageFilter");
- if (consumer != null)
- consumer.setProperties(props);
+ Hashtable<Object, Object> prop2 = (Hashtable<Object, Object>) props;
+ prop2.put("filters", "CropImageFilter");
+ if (consumer != null)
+ consumer.setProperties(prop2);
}
/**
diff --git a/libjava/classpath/java/awt/image/DirectColorModel.java b/libjava/classpath/java/awt/image/DirectColorModel.java
index 579dc97dfc7..dab15319fce 100644
--- a/libjava/classpath/java/awt/image/DirectColorModel.java
+++ b/libjava/classpath/java/awt/image/DirectColorModel.java
@@ -393,20 +393,20 @@ public class DirectColorModel extends PackedColorModel
return Buffers.getData(buffer);
}
- public final ColorModel coerceData (WritableRaster raster,
- boolean isAlphaPremultiplied)
+ public ColorModel coerceData (WritableRaster raster,
+ boolean isAlphaPremultiplied)
{
- if (this.isAlphaPremultiplied == isAlphaPremultiplied)
+ if (this.isAlphaPremultiplied == isAlphaPremultiplied || !hasAlpha())
return this;
/* TODO: provide better implementation based on the
assumptions we can make due to the specific type of the
color model. */
- super.coerceData(raster, isAlphaPremultiplied);
-
- return new ComponentColorModel(cspace, bits, hasAlpha(),
- isAlphaPremultiplied, // argument
- transparency, transferType);
+ super.coerceDataWorker(raster, isAlphaPremultiplied);
+
+ return new DirectColorModel(cspace, pixel_bits, getRedMask(),
+ getGreenMask(), getBlueMask(), getAlphaMask(),
+ isAlphaPremultiplied, transferType);
}
public boolean isCompatibleRaster(Raster raster)
diff --git a/libjava/classpath/java/awt/image/ImageConsumer.java b/libjava/classpath/java/awt/image/ImageConsumer.java
index fc5ed11e5ca..11f64f97867 100644
--- a/libjava/classpath/java/awt/image/ImageConsumer.java
+++ b/libjava/classpath/java/awt/image/ImageConsumer.java
@@ -136,7 +136,7 @@ public interface ImageConsumer
*
* @param props the list of properties associated with this image
*/
- void setProperties(Hashtable props);
+ void setProperties(Hashtable<?,?> props);
/**
* This <code>ColorModel</code> should indicate the model used by
diff --git a/libjava/classpath/java/awt/image/ImageFilter.java b/libjava/classpath/java/awt/image/ImageFilter.java
index c39c4a428f9..0ead45a4ae0 100644
--- a/libjava/classpath/java/awt/image/ImageFilter.java
+++ b/libjava/classpath/java/awt/image/ImageFilter.java
@@ -49,180 +49,178 @@ import java.util.Hashtable;
*/
public class ImageFilter implements ImageConsumer, Cloneable
{
- /**
- * The consumer this filter is filtering an image data stream for.
- * It is initialized in the method <code>getFilterInstance</code>.
- */
- protected ImageConsumer consumer = null;
-
- /**
- * The <code>ImageConsumer</code> can use this method to request
- * the pixels be delivered in top-down, left-right order.
- * <br>
- * The filter can respond in three different ways.
- * <ul>
- * <li>The default behavior is to forward the request to the
- * <code>ImageProducer</code>
- * using the method <code>requestTopDownLeftRightResend</code>
- * and using the filter as the consumer.</li>
- * <li>The filter has the pixels and can retransmit them in the
- * top-down, left-right order.</li>
- * <li>The filter can do nothing when this method is called.</li>
- * </ul>
- */
- public void resendTopDownLeftRight(ImageProducer ip)
- {
- ip.requestTopDownLeftRightResend(this);
- }
-
- /**
- * By default, returns a shallow copy of the object created by
- * <code>Object.clone()</code>
- *
- * @see java.lang.Object#clone ()
- */
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch (CloneNotSupportedException e)
- {
- // This should never happen as this class implements the
- // Cloneable interface.
- throw new InternalError ();
- }
- }
-
- /**
- * This is the only method which can set the
- * <code>ImageConsumer</code> for this filter. By default a clone
- * of this filter with the appropriate consumer set is returned.
- *
- * @see #clone ()
- */
- public ImageFilter getFilterInstance(ImageConsumer ic)
- {
- if ( ic == null )
- throw new IllegalArgumentException("null argument for ImageFilter.getFilterInstance(ImageConsumer)");
-
- consumer = ic;
- ImageFilter f = (ImageFilter)clone();
- consumer = null;
- return f;
- }
-
- /**
- * An <code>ImageProducer</code> indicates the size of the image
- * being produced using this method. A filter can override this
- * method to intercept these calls from the producer in order to
- * change either the width or the height before in turn calling
- * the consumer's <code>setDimensions</code> method.
- *
- * @param width the width of the image
- * @param height the height of the image
- */
- public void setDimensions(int width, int height)
- {
- if (consumer != null)
- consumer.setDimensions(width, height);
- }
-
- /**
- * An <code>ImageProducer</code> can set a list of properties
- * associated with this image by using this method.
- *
- * @param props the list of properties associated with this image
- */
- public void setProperties(Hashtable props)
- {
- props.put("filters", "ImageFilter");
- if (consumer != null)
- consumer.setProperties(props);
- }
-
- /**
- * Override this method to process calls to this method from the
- * <code>ImageProducer</code>. By default the <code>setColorModel</code>
- * method of the consumer is called with the specified <code>model</code>.
- *
- * @param model the color model to be used most often by setPixels
- * @see ColorModel */
- public void setColorModel(ColorModel model)
- {
- if (consumer != null)
- consumer.setColorModel(model);
- }
-
- /**
- * The <code>ImageProducer</code> should call this method with a
- * bit mask of hints from any of <code>RANDOMPIXELORDER</code>,
- * <code>TOPDOWNLEFTRIGHT</code>, <code>COMPLETESCANLINES</code>,
- * <code>SINGLEPASS</code>, <code>SINGLEFRAME</code> from the
- * <code>ImageConsumer</code> interface.
- *
- * @param flags a bit mask of hints
- * @see ImageConsumer
- */
- public void setHints(int flags)
- {
- if (consumer != null)
- consumer.setHints(flags);
- }
-
- /**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as a <code>byte</code> at
- * index (n * scansize + m + offset).
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param model the <code>ColorModel</code> used to translate the pixels
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, byte[] pixels, int offset, int scansize)
- {
- if (consumer != null)
- consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);
- }
-
- /**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as an <code>int</code> at
- * index (n * scansize + m + offset).
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param model the <code>ColorModel</code> used to translate the pixels
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, int[] pixels, int offset, int scansize)
- {
- if (consumer != null)
- consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);
- }
-
- /**
- * The <code>ImageProducer</code> calls this method to indicate a
- * single frame or the entire image is complete. The method is
- * also used to indicate an error in loading or producing the
- * image.
- */
- public void imageComplete(int status)
- {
- if (consumer != null)
- consumer.imageComplete(status);
- }
+ /**
+ * The consumer this filter is filtering an image data stream for.
+ * It is initialized in the method <code>getFilterInstance</code>.
+ */
+ protected ImageConsumer consumer = null;
+
+ /**
+ * The <code>ImageConsumer</code> can use this method to request
+ * the pixels be delivered in top-down, left-right order.
+ * <br>
+ * The filter can respond in three different ways.
+ * <ul>
+ * <li>The default behavior is to forward the request to the
+ * <code>ImageProducer</code>
+ * using the method <code>requestTopDownLeftRightResend</code>
+ * and using the filter as the consumer.</li>
+ * <li>The filter has the pixels and can retransmit them in the
+ * top-down, left-right order.</li>
+ * <li>The filter can do nothing when this method is called.</li>
+ * </ul>
+ */
+ public void resendTopDownLeftRight(ImageProducer ip)
+ {
+ ip.requestTopDownLeftRightResend(this);
+ }
+
+ /**
+ * By default, returns a shallow copy of the object created by
+ * <code>Object.clone()</code>
+ *
+ * @see java.lang.Object#clone ()
+ */
+ public Object clone()
+ {
+ try
+ {
+ return super.clone();
+ }
+ catch (CloneNotSupportedException e)
+ {
+ // This should never happen as this class implements the
+ // Cloneable interface.
+ throw new InternalError ();
+ }
+ }
+
+ /**
+ * This is the only method which can set the
+ * <code>ImageConsumer</code> for this filter. By default a clone
+ * of this filter with the appropriate consumer set is returned.
+ *
+ * @see #clone ()
+ */
+ public ImageFilter getFilterInstance(ImageConsumer ic)
+ {
+ ImageFilter f = (ImageFilter)clone();
+ f.consumer = ic;
+ return f;
+ }
+
+ /**
+ * An <code>ImageProducer</code> indicates the size of the image
+ * being produced using this method. A filter can override this
+ * method to intercept these calls from the producer in order to
+ * change either the width or the height before in turn calling
+ * the consumer's <code>setDimensions</code> method.
+ *
+ * @param width the width of the image
+ * @param height the height of the image
+ */
+ public void setDimensions(int width, int height)
+ {
+ consumer.setDimensions(width, height);
+ }
+
+ /**
+ * An <code>ImageProducer</code> can set a list of properties
+ * associated with this image by using this method.
+ *
+ * @param props the list of properties associated with this image
+ */
+ public void setProperties(Hashtable<?,?> props)
+ {
+ Hashtable copy = (Hashtable) props.clone();
+ Object o = copy.get("filters");
+ if (o == null)
+ copy.put("filters", toString());
+ else if (o instanceof String)
+ copy.put("filters", ((String) o) + toString());
+
+ consumer.setProperties(copy);
+ }
+
+ /**
+ * Override this method to process calls to this method from the
+ * <code>ImageProducer</code>. By default the <code>setColorModel</code>
+ * method of the consumer is called with the specified <code>model</code>.
+ *
+ * @param model the color model to be used most often by setPixels
+ *
+ * @see ColorModel
+ */
+ public void setColorModel(ColorModel model)
+ {
+ consumer.setColorModel(model);
+ }
+
+ /**
+ * The <code>ImageProducer</code> should call this method with a
+ * bit mask of hints from any of <code>RANDOMPIXELORDER</code>,
+ * <code>TOPDOWNLEFTRIGHT</code>, <code>COMPLETESCANLINES</code>,
+ * <code>SINGLEPASS</code>, <code>SINGLEFRAME</code> from the
+ * <code>ImageConsumer</code> interface.
+ *
+ * @param flags a bit mask of hints
+ * @see ImageConsumer
+ */
+ public void setHints(int flags)
+ {
+ consumer.setHints(flags);
+ }
+
+ /**
+ * This function delivers a rectangle of pixels where any
+ * pixel(m,n) is stored in the array as a <code>byte</code> at
+ * index (n * scansize + m + offset).
+ *
+ * @param x the x coordinate of the rectangle
+ * @param y the y coordinate of the rectangle
+ * @param w the width of the rectangle
+ * @param h the height of the rectangle
+ * @param model the <code>ColorModel</code> used to translate the pixels
+ * @param pixels the array of pixel values
+ * @param offset the index of the first pixels in the <code>pixels</code> array
+ * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
+ */
+ public void setPixels(int x, int y, int w, int h,
+ ColorModel model, byte[] pixels, int offset,
+ int scansize)
+ {
+ consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);
+ }
+
+ /**
+ * This function delivers a rectangle of pixels where any
+ * pixel(m,n) is stored in the array as an <code>int</code> at
+ * index (n * scansize + m + offset).
+ *
+ * @param x the x coordinate of the rectangle
+ * @param y the y coordinate of the rectangle
+ * @param w the width of the rectangle
+ * @param h the height of the rectangle
+ * @param model the <code>ColorModel</code> used to translate the pixels
+ * @param pixels the array of pixel values
+ * @param offset the index of the first pixels in the <code>pixels</code> array
+ * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
+ */
+ public void setPixels(int x, int y, int w, int h,
+ ColorModel model, int[] pixels, int offset,
+ int scansize)
+ {
+ consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);
+ }
+
+ /**
+ * The <code>ImageProducer</code> calls this method to indicate a
+ * single frame or the entire image is complete. The method is
+ * also used to indicate an error in loading or producing the
+ * image.
+ */
+ public void imageComplete(int status)
+ {
+ consumer.imageComplete(status);
+ }
}
-
diff --git a/libjava/classpath/java/awt/image/IndexColorModel.java b/libjava/classpath/java/awt/image/IndexColorModel.java
index 299b4dc0d86..46879cc98c9 100644
--- a/libjava/classpath/java/awt/image/IndexColorModel.java
+++ b/libjava/classpath/java/awt/image/IndexColorModel.java
@@ -134,10 +134,6 @@ public class IndexColorModel extends ColorModel
if (size < 1)
throw new IllegalArgumentException("size < 1");
map_size = size;
- if (0 <= trans && trans < size) {
- this.trans = trans;
- transparency = BITMASK;
- }
rgb = new int[size];
for (int i = 0; i < size; i++)
{
@@ -146,6 +142,9 @@ public class IndexColorModel extends ColorModel
| ((greens[i] & 0xff) << 8)
| (blues[i] & 0xff));
}
+
+ setTransparentPixel(trans);
+
// Generate a bigint with 1's for every pixel
validBits = validBits.setBit(size).subtract(BigInteger.ONE);
}
@@ -275,8 +274,6 @@ public class IndexColorModel extends ColorModel
throw new IllegalArgumentException("size < 1");
map_size = size;
opaque = !hasAlpha;
- if (0 <= trans && trans < size)
- this.trans = trans;
rgb = new int[size];
if (hasAlpha)
@@ -318,6 +315,8 @@ public class IndexColorModel extends ColorModel
transparency = BITMASK;
}
+ setTransparentPixel(trans);
+
// Generate a bigint with 1's for every pixel
validBits = validBits.setBit(size).subtract(BigInteger.ONE);
}
@@ -361,9 +360,6 @@ public class IndexColorModel extends ColorModel
throw new IllegalArgumentException("size < 1");
map_size = size;
opaque = !hasAlpha;
- if (0 <= trans && trans < size)
- this.trans = trans;
-
rgb = new int[size];
if (!hasAlpha)
for (int i = 0; i < size; i++)
@@ -371,6 +367,8 @@ public class IndexColorModel extends ColorModel
else
System.arraycopy(cmap, start, rgb, 0, size);
+ setTransparentPixel(trans);
+
// Generate a bigint with 1's for every pixel
validBits = validBits.setBit(size).subtract(BigInteger.ONE);
}
@@ -584,12 +582,7 @@ public class IndexColorModel extends ColorModel
*/
public final int getAlpha(int pixel)
{
- if (opaque && pixel != trans)
- return 255;
- if ((pixel == trans && trans != -1) || pixel >= map_size)
- return 0;
-
- return (0xFF000000 & rgb[pixel]) >> 24;
+ return (rgb[pixel] >> 24) & 0xFF;
}
/**
@@ -694,4 +687,43 @@ public class IndexColorModel extends ColorModel
return im;
}
+
+ /**
+ * Creates a {@link SampleModel} that is compatible to this color model.
+ * This will be a {@link MultiPixelPackedSampleModel} for bits/pixel of
+ * 1, 2 or 4, or a {@link ComponentColorModel} for the other cases.
+ *
+ * @param w the width of the sample model to create
+ * @param h the height of the sample model to create
+ *
+ * @return a compatible sample model
+ */
+ public SampleModel createCompatibleSampleModel(int w, int h)
+ {
+ SampleModel sm;
+ if (pixel_bits == 1 || pixel_bits == 2 || pixel_bits == 4)
+ sm = new MultiPixelPackedSampleModel(transferType, w, h, pixel_bits);
+ else
+ sm = new ComponentSampleModel(transferType, w, h, 1, w, new int[]{0});
+ return sm;
+ }
+
+ /**
+ * Sets the transparent pixel. This is called by the various constructors.
+ *
+ * @param t the transparent pixel
+ */
+ private void setTransparentPixel(int t)
+ {
+ if (t >= 0 && t < map_size)
+ {
+ rgb[t] &= 0xffffff; // Make the value transparent.
+ trans = t;
+ if (transparency == OPAQUE)
+ {
+ transparency = BITMASK;
+ hasAlpha = true;
+ }
+ }
+ }
}
diff --git a/libjava/classpath/java/awt/image/LookupOp.java b/libjava/classpath/java/awt/image/LookupOp.java
index 46e72fe6183..5b0cf783168 100644
--- a/libjava/classpath/java/awt/image/LookupOp.java
+++ b/libjava/classpath/java/awt/image/LookupOp.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package java.awt.image;
-import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
@@ -67,7 +66,8 @@ public class LookupOp implements BufferedImageOp, RasterOp
private LookupTable lut;
private RenderingHints hints;
- /** Construct a new LookupOp.
+ /**
+ * Construct a new LookupOp using the given LookupTable.
*
* @param lookup LookupTable to use.
* @param hints Rendering hints (can be null).
@@ -78,16 +78,40 @@ public class LookupOp implements BufferedImageOp, RasterOp
this.hints = hints;
}
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#filter(java.awt.image.BufferedImage, java.awt.image.BufferedImage)
+ /**
+ * Converts the source image using the lookup table specified in the
+ * constructor. The resulting image is stored in the destination image if one
+ * is provided; otherwise a new BufferedImage is created and returned.
+ *
+ * The source image cannot use an IndexColorModel, and the destination image
+ * (if one is provided) must have the same size.
+ *
+ * @param src The source image.
+ * @param dst The destination image.
+ * @throws IllegalArgumentException if the rasters and/or color spaces are
+ * incompatible.
+ * @throws ArrayIndexOutOfBoundsException if a pixel in the source is not
+ * contained in the LookupTable.
+ * @return The convolved image.
*/
public final BufferedImage filter(BufferedImage src, BufferedImage dst)
{
if (src.getColorModel() instanceof IndexColorModel)
throw new IllegalArgumentException("LookupOp.filter: IndexColorModel "
+ "not allowed");
+
+ if (lut.getNumComponents() != 1
+ && lut.getNumComponents() != src.getColorModel().getNumComponents()
+ && lut.getNumComponents() != src.getColorModel().getNumColorComponents())
+ throw new IllegalArgumentException("LookupOp.filter: Incompatible " +
+ "lookup table and source image");
+
if (dst == null)
- dst = createCompatibleDestImage(src, src.getColorModel());
+ dst = createCompatibleDestImage(src, null);
+
+ else if (src.getHeight() != dst.getHeight() || src.getWidth() != dst.getWidth())
+ throw new IllegalArgumentException("Source and destination images are " +
+ "different sizes.");
// Set up for potential colormodel mismatch
BufferedImage tgt;
@@ -116,33 +140,35 @@ public class LookupOp implements BufferedImageOp, RasterOp
sr.getPixel(x, y, dbuf);
System.arraycopy(dbuf, 0, tmp, 0, tmpBands);
dr.setPixel(x, y, lut.lookupPixel(tmp, dbuf));
+
+ /* The reference implementation does not use LookupTable.lookupPixel,
+ * but rather it seems to copy the table into a native array. The
+ * effect of this (a probable bug in their implementation) is that
+ * an out-of-bounds lookup on a ByteLookupTable will *not* throw an
+ * out of bounds exception, but will instead return random garbage.
+ * A bad lookup on a ShortLookupTable, however, will throw an
+ * exception.
+ *
+ * Instead of mimicing this behaviour, we always throw an
+ * ArrayOutofBoundsException by virtue of using
+ * LookupTable.lookupPixle.
+ */
}
}
- else if (lut.getNumComponents() != 1
- &&
- lut.getNumComponents() != src.getColorModel().getNumComponents())
- throw new IllegalArgumentException("LookupOp.filter: "
- + "Incompatible lookup "
- + "table and source image");
-
- // No alpha to ignore
- int[] dbuf = new int[src.getColorModel().getNumComponents()];
-
- // Filter the pixels
- for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
- for (int x = src.getMinX(); x < src.getWidth() + src.getMinX(); x++)
- dr.setPixel(x, y, lut.lookupPixel(sr.getPixel(x, y, dbuf), dbuf));
-
- if (tgt != dst)
+ else
{
- // Convert between color models.
- // TODO Check that premultiplied alpha is handled correctly here.
- Graphics2D gg = dst.createGraphics();
- gg.setRenderingHints(hints);
- gg.drawImage(tgt, 0, 0, null);
- gg.dispose();
+ // No alpha to ignore
+ int[] dbuf = new int[src.getColorModel().getNumComponents()];
+
+ // Filter the pixels
+ for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
+ for (int x = src.getMinX(); x < src.getWidth() + src.getMinX(); x++)
+ dr.setPixel(x, y, lut.lookupPixel(sr.getPixel(x, y, dbuf), dbuf));
}
+ if (tgt != dst)
+ new ColorConvertOp(hints).filter(tgt, dst);
+
return dst;
}
@@ -160,18 +186,27 @@ public class LookupOp implements BufferedImageOp, RasterOp
public BufferedImage createCompatibleDestImage(BufferedImage src,
ColorModel dstCM)
{
- // FIXME: set properties to those in src
- return new BufferedImage(dstCM,
- src.getRaster().createCompatibleWritableRaster(),
- src.isPremultiplied, null);
+ if (dstCM != null)
+ return new BufferedImage(dstCM,
+ src.getRaster().createCompatibleWritableRaster(),
+ src.isAlphaPremultiplied(), null);
+
+ // This is a strange exception, done for compatibility with the reference
+ // (as demonstrated by a mauve testcase)
+ int imgType = src.getType();
+ if (imgType == BufferedImage.TYPE_USHORT_GRAY)
+ imgType = BufferedImage.TYPE_BYTE_GRAY;
+
+ return new BufferedImage(src.getWidth(), src.getHeight(), imgType);
}
- /** Return corresponding destination point for source point.
+ /**
+ * Returns the corresponding destination point for a given source point.
+ *
+ * This Op will return the source point unchanged.
*
- * LookupOp will return the value of src unchanged.
* @param src The source point.
* @param dst The destination point.
- * @see java.awt.image.RasterOp#getPoint2D(java.awt.geom.Point2D, java.awt.geom.Point2D)
*/
public final Point2D getPoint2D(Point2D src, Point2D dst)
{
@@ -182,7 +217,11 @@ public class LookupOp implements BufferedImageOp, RasterOp
return dst;
}
- /** Return the LookupTable for this op. */
+ /**
+ * Return the LookupTable for this op.
+ *
+ * @return The lookup table.
+ */
public final LookupTable getTable()
{
return lut;
@@ -196,7 +235,8 @@ public class LookupOp implements BufferedImageOp, RasterOp
return hints;
}
- /** Filter a raster through a lookup table.
+ /**
+ * Filter a raster through a lookup table.
*
* Applies the lookup table for this Rasterop to each pixel of src and
* puts the results in dest. If dest is null, a new Raster is created and
@@ -206,8 +246,9 @@ public class LookupOp implements BufferedImageOp, RasterOp
* @param dest The destination raster.
* @return The WritableRaster with the filtered pixels.
* @throws IllegalArgumentException if lookup table has more than one
- * component but not the same as src and dest.
- * @see java.awt.image.RasterOp#filter(java.awt.image.Raster, java.awt.image.WritableRaster)
+ * component but not the same as src and dest.
+ * @throws ArrayIndexOutOfBoundsException if a pixel in the source is not
+ * contained in the LookupTable.
*/
public final WritableRaster filter(Raster src, WritableRaster dest)
{
@@ -216,12 +257,13 @@ public class LookupOp implements BufferedImageOp, RasterOp
dest = createCompatibleDestRaster(src);
else
if (src.getNumBands() != dest.getNumBands())
- throw new IllegalArgumentException();
-
- if (lut.getNumComponents() != 1
- && lut.getNumComponents() != src.getNumBands())
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("Source and destination rasters " +
+ "are incompatible.");
+ if (lut.getNumComponents() != 1
+ && lut.getNumComponents() != src.getNumBands())
+ throw new IllegalArgumentException("Lookup table is incompatible with " +
+ "this raster.");
// Allocate pixel storage.
int[] tmp = new int[src.getNumBands()];
@@ -230,6 +272,19 @@ public class LookupOp implements BufferedImageOp, RasterOp
for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
for (int x = src.getMinX(); x < src.getWidth() + src.getMinX(); x++)
dest.setPixel(x, y, lut.lookupPixel(src.getPixel(x, y, tmp), tmp));
+
+ /* The reference implementation does not use LookupTable.lookupPixel,
+ * but rather it seems to copy the table into a native array. The
+ * effect of this (a probable bug in their implementation) is that
+ * an out-of-bounds lookup on a ByteLookupTable will *not* throw an
+ * out of bounds exception, but will instead return random garbage.
+ * A bad lookup on a ShortLookupTable, however, will throw an
+ * exception.
+ *
+ * Instead of mimicing this behaviour, we always throw an
+ * ArrayOutofBoundsException by virtue of using
+ * LookupTable.lookupPixle.
+ */
return dest;
}
diff --git a/libjava/classpath/java/awt/image/MemoryImageSource.java b/libjava/classpath/java/awt/image/MemoryImageSource.java
index 95cd4081922..83a03ca449c 100644
--- a/libjava/classpath/java/awt/image/MemoryImageSource.java
+++ b/libjava/classpath/java/awt/image/MemoryImageSource.java
@@ -1,5 +1,5 @@
/* MemoryImageSource.java -- Java class for providing image data
- Copyright (C) 1999, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,6 +41,9 @@ package java.awt.image;
import java.util.Hashtable;
import java.util.Vector;
+/**
+ * An image producer that delivers image data from an array.
+ */
public class MemoryImageSource implements ImageProducer
{
private boolean animated = false;
@@ -73,10 +76,19 @@ public class MemoryImageSource implements ImageProducer
}
/**
- * Constructs an ImageProducer from memory
+ * Constructs an ImageProducer from memory.
+ *
+ * @param w the image width.
+ * @param h the image height.
+ * @param cm the color model.
+ * @param pix the image data.
+ * @param off the offset to the first pixel in the array.
+ * @param scan the number of array elements from a pixel on one row to the
+ * corresponding pixel on the next row.
+ * @param props image properties (<code>null</code> permitted).
*/
public MemoryImageSource(int w, int h, ColorModel cm, byte[] pix, int off,
- int scan, Hashtable props)
+ int scan, Hashtable<?,?> props)
{
width = w;
height = h;
@@ -106,10 +118,19 @@ public class MemoryImageSource implements ImageProducer
}
/**
- Constructs an ImageProducer from memory
- */
+ * Constructs an ImageProducer from memory
+ *
+ * @param w the image width.
+ * @param h the image height.
+ * @param cm the color model.
+ * @param pix the image data.
+ * @param off the offset to the first pixel in the array.
+ * @param scan the number of array elements from a pixel on one row to the
+ * corresponding pixel on the next row.
+ * @param props image properties (<code>null</code> permitted).
+ */
public MemoryImageSource(int w, int h, ColorModel cm, int[] pix, int off,
- int scan, Hashtable props)
+ int scan, Hashtable<?,?> props)
{
width = w;
height = h;
@@ -122,16 +143,32 @@ public class MemoryImageSource implements ImageProducer
}
/**
- * Constructs an ImageProducer from memory using the default RGB ColorModel
+ * Constructs an ImageProducer from memory using the default RGB ColorModel.
+ *
+ * @param w the image width.
+ * @param h the image height.
+ * @param pix the image data.
+ * @param off the offset to the first pixel in the array.
+ * @param scan the number of array elements from a pixel on one row to the
+ * corresponding pixel on the next row.
+ * @param props image properties (<code>null</code> permitted).
+
*/
public MemoryImageSource(int w, int h, int[] pix, int off, int scan,
- Hashtable props)
+ Hashtable<?,?> props)
{
this(w, h, ColorModel.getRGBdefault(), pix, off, scan, props);
}
/**
- * Constructs an ImageProducer from memory using the default RGB ColorModel
+ * Constructs an ImageProducer from memory using the default RGB ColorModel.
+ *
+ * @param w the image width.
+ * @param h the image height.
+ * @param pix the image data.
+ * @param off the offset to the first pixel in the array.
+ * @param scan the number of array elements from a pixel on one row to the
+ * corresponding pixel on the next row.
*/
public MemoryImageSource(int w, int h, int[] pix, int off, int scan)
{
@@ -141,6 +178,8 @@ public class MemoryImageSource implements ImageProducer
/**
* Used to register an <code>ImageConsumer</code> with this
* <code>ImageProducer</code>.
+ *
+ * @param ic the image consumer.
*/
public synchronized void addConsumer(ImageConsumer ic)
{
@@ -153,6 +192,8 @@ public class MemoryImageSource implements ImageProducer
/**
* Used to determine if the given <code>ImageConsumer</code> is
* already registered with this <code>ImageProducer</code>.
+ *
+ * @param ic the image consumer.
*/
public synchronized boolean isConsumer(ImageConsumer ic)
{
@@ -164,6 +205,8 @@ public class MemoryImageSource implements ImageProducer
/**
* Used to remove an <code>ImageConsumer</code> from the list of
* registered consumers for this <code>ImageProducer</code>.
+ *
+ * @param ic the image consumer.
*/
public synchronized void removeConsumer(ImageConsumer ic)
{
@@ -197,6 +240,8 @@ public class MemoryImageSource implements ImageProducer
* Used to register an <code>ImageConsumer</code> with this
* <code>ImageProducer</code> and then request that this producer
* resend the image data in the order top-down, left-right.
+ *
+ * @param ic the image consumer.
*/
public void requestTopDownLeftRightResend(ImageConsumer ic)
{
@@ -219,7 +264,7 @@ public class MemoryImageSource implements ImageProducer
* sending animation. If this flag is set then full buffers are sent
* in the newPixels methods instead of just regions.
*
- * @param fullbuffers - a flag indicating whether to send the full buffers
+ * @param fullbuffers a flag indicating whether to send the full buffers
*/
public synchronized void setFullBufferUpdates(boolean fullbuffers)
{
@@ -260,6 +305,11 @@ public class MemoryImageSource implements ImageProducer
/**
* Send an animation frame to the image consumers containing the specified
* pixels unless setFullBufferUpdates is set.
+ *
+ * @param x the x-coordinate.
+ * @param y the y-coordinate.
+ * @param w the width.
+ * @param h the height.
*/
public synchronized void newPixels(int x, int y, int w, int h)
{
@@ -306,6 +356,12 @@ public class MemoryImageSource implements ImageProducer
*
* If framenotify is set then a notification is sent when the frame
* is sent otherwise no status is sent.
+ *
+ * @param x the x-coordinate.
+ * @param y the y-coordinate.
+ * @param w the width.
+ * @param h the height.
+ * @param framenotify send notification?
*/
public synchronized void newPixels(int x, int y, int w, int h,
boolean framenotify)
diff --git a/libjava/classpath/java/awt/image/PixelGrabber.java b/libjava/classpath/java/awt/image/PixelGrabber.java
index 70a80af3cf9..fc5e0efc0a5 100644
--- a/libjava/classpath/java/awt/image/PixelGrabber.java
+++ b/libjava/classpath/java/awt/image/PixelGrabber.java
@@ -55,7 +55,7 @@ public class PixelGrabber implements ImageConsumer
ColorModel model = ColorModel.getRGBdefault();
int hints;
- Hashtable props;
+ Hashtable<?,?> props;
int int_pixel_buffer[];
boolean ints_delivered = false;
@@ -442,7 +442,7 @@ public class PixelGrabber implements ImageConsumer
* @param props a list of properties associated with the image being
* produced
*/
- public synchronized void setProperties(Hashtable props)
+ public synchronized void setProperties(Hashtable<?,?> props)
{
this.props = props;
}
diff --git a/libjava/classpath/java/awt/image/RGBImageFilter.java b/libjava/classpath/java/awt/image/RGBImageFilter.java
index ecfed0674f1..c777fecd901 100644
--- a/libjava/classpath/java/awt/image/RGBImageFilter.java
+++ b/libjava/classpath/java/awt/image/RGBImageFilter.java
@@ -46,228 +46,220 @@ package java.awt.image;
*/
public abstract class RGBImageFilter extends ImageFilter
{
- protected ColorModel origmodel;
+ protected ColorModel origmodel;
- protected ColorModel newmodel;
+ protected ColorModel newmodel;
- /**
- Specifies whether to apply the filter to the index entries of the
- IndexColorModel. Subclasses should set this to true if the filter
- does not depend on the pixel's coordinate.
- */
- protected boolean canFilterIndexColorModel = false;
+ /**
+ * Specifies whether to apply the filter to the index entries of the
+ * IndexColorModel. Subclasses should set this to true if the filter
+ * does not depend on the pixel's coordinate.
+ */
+ protected boolean canFilterIndexColorModel = false;
- /**
- Construct new RGBImageFilter.
- */
- public RGBImageFilter()
- {
- }
+ /**
+ * Construct new RGBImageFilter.
+ */
+ public RGBImageFilter()
+ {
+ }
- /**
- * Sets the ColorModel used to filter with. If the specified ColorModel is IndexColorModel
- * and canFilterIndexColorModel is true, we subsitute the ColorModel for a filtered one
- * here and in setPixels whenever the original one appears. Otherwise overrides the default
- * ColorModel of ImageProducer and specifies the default RGBColorModel
- *
- * @param model the color model to be used most often by setPixels
- * @see ColorModel */
- public void setColorModel(ColorModel model)
- {
- origmodel = model;
- newmodel = model;
+ /**
+ * Sets the ColorModel used to filter with. If the specified ColorModel is
+ * IndexColorModel and canFilterIndexColorModel is true, we subsitute the
+ * ColorModel for a filtered one here and in setPixels whenever the original
+ * one appears. Otherwise overrides the default ColorModel of ImageProducer
+ * and specifies the default RGBColorModel
+ *
+ * @param model the color model to be used most often by setPixels
+ *
+ * @see ColorModel
+ */
+ public void setColorModel(ColorModel model)
+ {
+ if ((model instanceof IndexColorModel) && canFilterIndexColorModel)
+ {
+ ColorModel newCM = filterIndexColorModel((IndexColorModel) model);
+ substituteColorModel(model, newCM);
+ consumer.setColorModel(newmodel);
+ }
+ else
+ {
+ consumer.setColorModel(ColorModel.getRGBdefault());
+ }
+ }
- if( ( model instanceof IndexColorModel) && canFilterIndexColorModel ) {
- newmodel = filterIndexColorModel( (IndexColorModel) model );
- if (consumer != null)
- consumer.setColorModel(newmodel);
- }
- else {
- if (consumer != null)
- consumer.setColorModel(ColorModel.getRGBdefault());
- }
- }
-
- /**
- Registers a new ColorModel to subsitute for the old ColorModel when
- setPixels encounters the a pixel with the old ColorModel. The pixel
- remains unchanged except for a new ColorModel.
-
- @param oldcm the old ColorModel
- @param newcm the new ColorModel
- */
- public void substituteColorModel(ColorModel oldcm,
- ColorModel newcm)
- {
- origmodel = oldcm;
- newmodel = newcm;
- }
-
- /**
- Filters an IndexColorModel through the filterRGB function. Uses
- coordinates of -1 to indicate its filtering an index and not a pixel.
-
- @param icm an IndexColorModel to filter
- */
- public IndexColorModel filterIndexColorModel(IndexColorModel icm)
- {
- int len = icm.getMapSize(), rgb;
- byte reds[] = new byte[len], greens[] = new byte[len], blues[] = new byte[len], alphas[] = new byte[len];
-
- icm.getAlphas( alphas );
- icm.getReds( reds );
- icm.getGreens( greens );
- icm.getBlues( blues );
-
- for( int i = 0; i < len; i++ )
- {
- rgb = filterRGB( -1, -1, makeColor ( alphas[i], reds[i], greens[i], blues[i] ) );
- alphas[i] = (byte)(( 0xff000000 & rgb ) >> 24);
- reds[i] = (byte)(( 0xff0000 & rgb ) >> 16);
- greens[i] = (byte)(( 0xff00 & rgb ) >> 8);
- blues[i] = (byte)(0xff & rgb);
- }
- return new IndexColorModel( icm.getPixelSize(), len, reds, greens, blues, alphas );
- }
-
- private int makeColor( byte a, byte r, byte g, byte b )
- {
- return ( 0xff000000 & (a << 24) | 0xff0000 & (r << 16) | 0xff00 & (g << 8) | 0xff & b );
- }
-
- /**
- This functions filters a set of RGB pixels through filterRGB.
-
- @param x the x coordinate of the rectangle
- @param y the y coordinate of the rectangle
- @param w the width of the rectangle
- @param h the height of the rectangle
- @param pixels the array of pixel values
- @param offset the index of the first pixels in the <code>pixels</code> array
- @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void filterRGBPixels(int x, int y, int w, int h, int[] pixels,
- int offset, int scansize)
- {
- for (int yp = 0; yp < h; yp++)
- {
- for (int xp = 0; xp < w; xp++)
- {
- pixels[offset + xp] = filterRGB(xp + x, yp + y, pixels[offset + xp]);
- }
- offset += scansize;
- }
- }
-
-
- /**
- * If the ColorModel is the same ColorModel which as already converted
- * then it converts it the converted ColorModel. Otherwise it passes the
- * array of pixels through filterRGBpixels.
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param model the <code>ColorModel</code> used to translate the pixels
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, byte[] pixels,
- int offset, int scansize)
- {
- if(model == origmodel && (model instanceof IndexColorModel) && canFilterIndexColorModel)
- {
- if (consumer != null)
- consumer.setPixels(x, y, w, h, newmodel, pixels, offset, scansize);
- }
- else
- {
- int intPixels[] =
- convertColorModelToDefault( x, y, w, h, model, pixels, offset, scansize );
- filterRGBPixels( x, y, w, h, intPixels, offset, scansize );
- if (consumer != null)
- consumer.setPixels(x, y, w, h, ColorModel.getRGBdefault(), intPixels, offset, scansize);
- }
- }
-
- /**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as an <code>int</code> at
- * index (n * scansize + m + offset).
- *
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param model the <code>ColorModel</code> used to translate the pixels
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, int[] pixels,
- int offset, int scansize)
- {
- if(model == origmodel && (model instanceof IndexColorModel) && canFilterIndexColorModel)
- {
- if (consumer != null)
- consumer.setPixels(x, y, w, h, newmodel, pixels, offset, scansize);
- }
- else
- {
- //FIXME: Store the filtered pixels in a separate temporary buffer?
- convertColorModelToDefault( x, y, w, h, model, pixels, offset, scansize );
- filterRGBPixels( x, y, w, h, pixels, offset, scansize );
- if (consumer != null)
- consumer.setPixels(x, y, w, h, ColorModel.getRGBdefault(), pixels, offset, scansize);
- }
- }
-
- private int[] convertColorModelToDefault(int x, int y, int w, int h,
- ColorModel model, byte pixels[],
- int offset, int scansize)
- {
- int intPixels[] = new int[pixels.length];
- for (int i = 0; i < pixels.length; i++)
- intPixels[i] = makeColorbyDefaultCM(model, pixels[i]);
- return intPixels;
- }
+ /**
+ * Registers a new ColorModel to subsitute for the old ColorModel when
+ * setPixels encounters the a pixel with the old ColorModel. The pixel
+ * remains unchanged except for a new ColorModel.
+ *
+ * @param oldcm the old ColorModel
+ * @param newcm the new ColorModel
+ */
+ public void substituteColorModel(ColorModel oldcm, ColorModel newcm)
+ {
+ origmodel = oldcm;
+ newmodel = newcm;
+ }
- private void convertColorModelToDefault(int x, int y, int w, int h,
- ColorModel model, int pixels[],
- int offset, int scansize)
- {
- for (int i = 0; i < pixels.length; i++)
- pixels[i] = makeColorbyDefaultCM(model, pixels[i]);
- }
+ /**
+ * Filters an IndexColorModel through the filterRGB function. Uses
+ * coordinates of -1 to indicate its filtering an index and not a pixel.
+ *
+ * @param icm an IndexColorModel to filter
+ */
+ public IndexColorModel filterIndexColorModel(IndexColorModel icm)
+ {
+ int len = icm.getMapSize();
+ byte[] reds = new byte[len];
+ byte[] greens = new byte[len];
+ byte[] blues = new byte[len];
+ byte[] alphas = new byte[len];
- private int makeColorbyDefaultCM(ColorModel model, byte rgb)
- {
- return makeColor( model.getAlpha( rgb ) * 4, model.getRed( rgb ) * 4, model.getGreen( rgb ) * 4, model.getBlue( rgb ) * 4 );
- }
+ icm.getAlphas( alphas );
+ icm.getReds( reds );
+ icm.getGreens( greens );
+ icm.getBlues( blues );
- private int makeColorbyDefaultCM(ColorModel model, int rgb)
- {
- return makeColor( model.getAlpha( rgb ), model.getRed( rgb ), model.getGreen( rgb ), model.getBlue( rgb ) );
- }
+ int transparent = icm.getTransparentPixel();
+ boolean needAlpha = false;
+ for( int i = 0; i < len; i++ )
+ {
+ int rgb = filterRGB(-1, -1, icm.getRGB(i));
+ alphas[i] = (byte) (rgb >> 24);
+ if (alphas[i] != ((byte) 0xff) && i != transparent)
+ needAlpha = true;
+ reds[i] = (byte) (rgb >> 16);
+ greens[i] = (byte) (rgb >> 8);
+ blues[i] = (byte) (rgb);
+ }
+ IndexColorModel newIcm;
+ if (needAlpha)
+ newIcm = new IndexColorModel(icm.getPixelSize(), len, reds, greens,
+ blues, alphas);
+ else
+ newIcm = new IndexColorModel(icm.getPixelSize(), len, reds, greens,
+ blues, transparent);
+ return newIcm;
+ }
- private int makeColor( int a, int r, int g, int b )
- {
- return (int)( 0xff000000 & (a << 24) | 0xff0000 & (r << 16) | 0xff00 & (g << 8) | 0xff & b );
- }
+ /**
+ * This functions filters a set of RGB pixels through filterRGB.
+ *
+ * @param x the x coordinate of the rectangle
+ * @param y the y coordinate of the rectangle
+ * @param w the width of the rectangle
+ * @param h the height of the rectangle
+ * @param pixels the array of pixel values
+ * @param offset the index of the first pixels in the
+ * <code>pixels</code> array
+ * @param scansize the width to use in extracting pixels from the
+ * <code>pixels</code> array
+ */
+ public void filterRGBPixels(int x, int y, int w, int h, int[] pixels,
+ int offset, int scansize)
+ {
+ int index = offset;
+ for (int yp = 0; yp < h; yp++)
+ {
+ for (int xp = 0; xp < w; xp++)
+ {
+ pixels[index] = filterRGB(xp + x, yp + y, pixels[index]);
+ index++;
+ }
+ index += scansize - w;
+ }
+ consumer.setPixels(x, y, w, h, ColorModel.getRGBdefault(), pixels, offset,
+ scansize);
+ }
+ /**
+ * If the ColorModel is the same ColorModel which as already converted
+ * then it converts it the converted ColorModel. Otherwise it passes the
+ * array of pixels through filterRGBpixels.
+ *
+ * @param x the x coordinate of the rectangle
+ * @param y the y coordinate of the rectangle
+ * @param w the width of the rectangle
+ * @param h the height of the rectangle
+ * @param model the <code>ColorModel</code> used to translate the pixels
+ * @param pixels the array of pixel values
+ * @param offset the index of the first pixels in the <code>pixels</code>
+ * array
+ * @param scansize the width to use in extracting pixels from the
+ * <code>pixels</code> array
+ */
+ public void setPixels(int x, int y, int w, int h, ColorModel model,
+ byte[] pixels, int offset, int scansize)
+ {
+ if (model == origmodel)
+ {
+ consumer.setPixels(x, y, w, h, newmodel, pixels, offset, scansize);
+ }
+ else
+ {
+ int[] filtered = new int[w];
+ int index = offset;
+ for (int yp = 0; yp < h; yp++)
+ {
+ for (int xp = 0; xp < w; xp++)
+ {
+ filtered[xp] = model.getRGB((pixels[index] & 0xff));
+ index++;
+ }
+ index += scansize - w;
+ filterRGBPixels(x, y + yp, w, 1, filtered, 0, w);
+ }
+ }
+ }
- /**
- Filters a single pixel from the default ColorModel.
+ /**
+ * This function delivers a rectangle of pixels where any
+ * pixel(m,n) is stored in the array as an <code>int</code> at
+ * index (n * scansize + m + offset).
+ *
+ * @param x the x coordinate of the rectangle
+ * @param y the y coordinate of the rectangle
+ * @param w the width of the rectangle
+ * @param h the height of the rectangle
+ * @param model the <code>ColorModel</code> used to translate the pixels
+ * @param pixels the array of pixel values
+ * @param offset the index of the first pixels in the <code>pixels</code>
+ * array
+ * @param scansize the width to use in extracting pixels from the
+ * <code>pixels</code> array
+ */
+ public void setPixels(int x, int y, int w, int h, ColorModel model,
+ int[] pixels, int offset, int scansize)
+ {
+ if (model == origmodel)
+ {
+ consumer.setPixels(x, y, w, h, newmodel, pixels, offset, scansize);
+ }
+ else
+ {
+ int[] filtered = new int[w];
+ int index = offset;
+ for (int yp = 0; yp < h; yp++)
+ {
+ for (int xp = 0; xp < w; xp++)
+ {
+ filtered[xp] = model.getRGB((pixels[index] & 0xff));
+ index++;
+ }
+ index += scansize - w;
+ filterRGBPixels(x, y + yp, w, 1, filtered, 0, w);
+ }
+ }
+ }
- @param x x-coordinate
- @param y y-coordinate
- @param rgb color
- */
- public abstract int filterRGB(int x,
- int y,
- int rgb);
+ /**
+ * Filters a single pixel from the default ColorModel.
+ *
+ * @param x x-coordinate
+ * @param y y-coordinate
+ * @param rgb color
+ */
+ public abstract int filterRGB(int x, int y, int rgb);
}
diff --git a/libjava/classpath/java/awt/image/Raster.java b/libjava/classpath/java/awt/image/Raster.java
index 160f8be8b51..d63e156f6ae 100644
--- a/libjava/classpath/java/awt/image/Raster.java
+++ b/libjava/classpath/java/awt/image/Raster.java
@@ -511,9 +511,10 @@ public class Raster
int height, int childMinX, int childMinY,
int[] bandList)
{
- /* FIXME: Throw RasterFormatException if child bounds extends
- beyond the bounds of this raster. */
-
+ if (parentX < minX || parentX + width > minX + this.width
+ || parentY < minY || parentY + height > minY + this.height)
+ throw new RasterFormatException("Child raster extends beyond parent");
+
SampleModel sm = (bandList == null) ?
sampleModel :
sampleModel.createSubsetSampleModel(bandList);
diff --git a/libjava/classpath/java/awt/image/RenderedImage.java b/libjava/classpath/java/awt/image/RenderedImage.java
index b35f8602129..067e9b98e38 100644
--- a/libjava/classpath/java/awt/image/RenderedImage.java
+++ b/libjava/classpath/java/awt/image/RenderedImage.java
@@ -46,7 +46,7 @@ import java.util.Vector;
*/
public interface RenderedImage
{
- Vector getSources();
+ Vector<RenderedImage> getSources();
Object getProperty(String name);
String[] getPropertyNames();
ColorModel getColorModel();
diff --git a/libjava/classpath/java/awt/image/ReplicateScaleFilter.java b/libjava/classpath/java/awt/image/ReplicateScaleFilter.java
index 6d5099dead2..5ba03f182f6 100644
--- a/libjava/classpath/java/awt/image/ReplicateScaleFilter.java
+++ b/libjava/classpath/java/awt/image/ReplicateScaleFilter.java
@@ -46,6 +46,7 @@ import java.util.Hashtable;
* exact method is not defined by Sun but some sort of fast Box filter should
* probably be correct.
* <br>
+ * Currently this filter does nothing and needs to be implemented.
*
* @author C. Brian Jones (cbj@gnu.org)
*/
@@ -116,11 +117,11 @@ public class ReplicateScaleFilter extends ImageFilter
}
else if (destWidth < 0)
{
- destWidth = (int) (width * ((double) destHeight / srcHeight));
+ destWidth = width * destHeight / srcHeight;
}
else if (destHeight < 0)
{
- destHeight = (int) (height * ((double) destWidth / srcWidth));
+ destHeight = height * destWidth / srcWidth;
}
if (consumer != null)
@@ -133,11 +134,12 @@ public class ReplicateScaleFilter extends ImageFilter
*
* @param props the list of properties associated with this image
*/
- public void setProperties(Hashtable props)
+ public void setProperties(Hashtable<?, ?> props)
{
- props.put("filters", "ReplicateScaleFilter");
- if (consumer != null)
- consumer.setProperties(props);
+ Hashtable<Object, Object> prop2 = (Hashtable<Object, Object>) props;
+ prop2.put("filters", "ReplicateScaleFilter");
+ if (consumer != null)
+ consumer.setProperties(prop2);
}
/**
@@ -157,19 +159,35 @@ public class ReplicateScaleFilter extends ImageFilter
public void setPixels(int x, int y, int w, int h,
ColorModel model, byte[] pixels, int offset, int scansize)
{
- double rx = ((double) srcWidth) / destWidth;
- double ry = ((double) srcHeight) / destHeight;
-
- int destScansize = (int) Math.round(scansize / rx);
-
- byte[] destPixels = replicatePixels(x, y, w, h,
- model, pixels, offset, scansize,
- rx, ry, destScansize);
-
- if (consumer != null)
- consumer.setPixels((int) Math.floor(x/rx), (int) Math.floor(y/ry),
- (int) Math.ceil(w/rx), (int) Math.ceil(h/ry),
- model, destPixels, 0, destScansize);
+ if (srcrows == null || srccols == null)
+ setupSources();
+ int dx1 = (2 * x * destWidth + srcWidth - 1) / (2 * destWidth);
+ int dy1 = (2 * y * destHeight + srcHeight - 1) / (2 * destHeight);
+ byte[] pix;
+ if (outpixbuf != null && outpixbuf instanceof byte[])
+ {
+ pix = (byte[]) outpixbuf;
+ }
+ else
+ {
+ pix = new byte[destWidth];
+ outpixbuf = pix;
+ }
+ int sy, sx;
+ for (int yy = dy1; (sy = srcrows[yy]) < y + h; yy++)
+ {
+ int offs = offset + scansize * (sy - y);
+ int xx;
+ for (xx = dx1; (sx = srccols[xx]) < x + w; xx++)
+ {
+ pix[xx] = pixels[offs + sx - x];
+ }
+ if (xx > dx1)
+ {
+ consumer.setPixels(dx1, yy, xx - dx1, 1, model, pix, dx1,
+ destWidth);
+ }
+ }
}
/**
@@ -189,59 +207,52 @@ public class ReplicateScaleFilter extends ImageFilter
public void setPixels(int x, int y, int w, int h,
ColorModel model, int[] pixels, int offset, int scansize)
{
- double rx = ((double) srcWidth) / destWidth;
- double ry = ((double) srcHeight) / destHeight;
-
- int destScansize = (int) Math.round(scansize / rx);
-
- int[] destPixels = replicatePixels(x, y, w, h,
- model, pixels, offset, scansize,
- rx, ry, destScansize);
-
- if (consumer != null)
- consumer.setPixels((int) Math.floor(x/rx), (int) Math.floor(y/ry),
- (int) Math.ceil(w/rx), (int) Math.ceil(h/ry),
- model, destPixels, 0, destScansize);
- }
-
- private byte[] replicatePixels(int srcx, int srcy, int srcw, int srch,
- ColorModel model, byte[] srcPixels,
- int srcOffset, int srcScansize,
- double rx, double ry, int destScansize)
- {
- byte[] destPixels =
- new byte[(int) Math.ceil(srcw/rx) * (int) Math.ceil(srch/ry)];
-
- int a, b;
- for (int i = 0; i < destPixels.length; i++)
- {
- a = (int) ((int) ( ((double) i) / destScansize) * ry) * srcScansize;
- b = (int) ((i % destScansize) * rx);
- if ((a + b + srcOffset) < srcPixels.length)
- destPixels[i] = srcPixels[a + b + srcOffset];
- }
-
- return destPixels;
+ if (srcrows == null || srccols == null)
+ setupSources();
+ int dx1 = (2 * x * destWidth + srcWidth - 1) / (2 * destWidth);
+ int dy1 = (2 * y * destHeight + srcHeight - 1) / (2 * destHeight);
+ int[] pix;
+ if (outpixbuf != null && outpixbuf instanceof int[])
+ {
+ pix = (int[]) outpixbuf;
+ }
+ else
+ {
+ pix = new int[destWidth];
+ outpixbuf = pix;
+ }
+ int sy, sx;
+ for (int yy = dy1; (sy = srcrows[yy]) < y + h; yy++)
+ {
+ int offs = offset + scansize * (sy - y);
+ int xx;
+ for (xx = dx1; (sx = srccols[xx]) < x + w; xx++)
+ {
+ pix[xx] = pixels[offs + sx - x];
+ }
+ if (xx > dx1)
+ {
+ consumer.setPixels(dx1, yy, xx - dx1, 1, model, pix, dx1,
+ destWidth);
+ }
+ }
}
- private int[] replicatePixels(int srcx, int srcy, int srcw, int srch,
- ColorModel model, int[] srcPixels,
- int srcOffset, int srcScansize,
- double rx, double ry, int destScansize)
- {
- int[] destPixels =
- new int[(int) Math.ceil(srcw/rx) * (int) Math.ceil(srch/ry)];
-
- int a, b;
- for (int i = 0; i < destPixels.length; i++)
- {
- a = (int) ((int) ( ((double) i) / destScansize) * ry) * srcScansize;
- b = (int) ((i % destScansize) * rx);
- if ((a + b + srcOffset) < srcPixels.length)
- destPixels[i] = srcPixels[a + b + srcOffset];
- }
-
- return destPixels;
- }
+ /**
+ * Sets up the srcrows and srccols arrays.
+ */
+ private void setupSources()
+ {
+ srcrows = new int[destHeight + 1];
+ for (int y = 0; y <= destHeight; y++)
+ {
+ srcrows[y] = (2 * y * srcHeight + srcHeight) / (2 * destHeight);
+ }
+ srccols = new int[destWidth + 1];
+ for (int x = 0; x <= destWidth; x++)
+ {
+ srccols[x] = (2 * x * srcWidth + srcWidth) / (2 * destWidth);
+ }
+ }
}
diff --git a/libjava/classpath/java/awt/image/RescaleOp.java b/libjava/classpath/java/awt/image/RescaleOp.java
index d5b29693caf..d56b12cb952 100644
--- a/libjava/classpath/java/awt/image/RescaleOp.java
+++ b/libjava/classpath/java/awt/image/RescaleOp.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 Free Software Foundation
+/* Copyright (C) 2004, 2006 Free Software Foundation
This file is part of GNU Classpath.
@@ -43,7 +43,23 @@ import java.awt.geom.Rectangle2D;
import java.util.Arrays;
/**
+ * RescaleOp is a filter that changes each pixel by a scaling factor and offset.
+ *
+ * For filtering Rasters, either one scaling factor and offset can be specified,
+ * which will be applied to all bands; or a scaling factor and offset can be
+ * specified for each band.
+ *
+ * For BufferedImages, the scaling may apply to both color and alpha components.
+ * If only one scaling factor is provided, or if the number of factors provided
+ * equals the number of color components, the scaling is performed on all color
+ * components. Otherwise, the scaling is performed on all components including
+ * alpha. Alpha premultiplication is ignored.
+ *
+ * After filtering, if color conversion is necessary, the conversion happens,
+ * taking alpha premultiplication into account.
+ *
* @author Jerry Quinn (jlquinn@optonline.net)
+ * @author Francis Kung (fkung@redhat.com)
*/
public class RescaleOp implements BufferedImageOp, RasterOp
{
@@ -51,15 +67,43 @@ public class RescaleOp implements BufferedImageOp, RasterOp
private float[] offsets;
private RenderingHints hints = null;
+ /**
+ * Create a new RescaleOp object using the given scale factors and offsets.
+ *
+ * The length of the arrays must be equal to the number of bands (or number of
+ * data or color components) of the raster/image that this Op will be used on,
+ * otherwise an IllegalArgumentException will be thrown when calling the
+ * filter method.
+ *
+ * @param scaleFactors an array of scale factors.
+ * @param offsets an array of offsets.
+ * @param hints any rendering hints to use (can be null).
+ * @throws NullPointerException if the scaleFactors or offsets array is null.
+ */
public RescaleOp(float[] scaleFactors,
float[] offsets,
RenderingHints hints)
{
- this.scale = scaleFactors;
- this.offsets = offsets;
+ int length = Math.min(scaleFactors.length, offsets.length);
+
+ scale = new float[length];
+ System.arraycopy(scaleFactors, 0, this.scale, 0, length);
+
+ this.offsets = new float[length];
+ System.arraycopy(offsets, 0, this.offsets, 0, length);
+
this.hints = hints;
}
+ /**
+ * Create a new RescaleOp object using the given scale factor and offset.
+ *
+ * The same scale factor and offset will be used on all bands/components.
+ *
+ * @param scaleFactor the scale factor to use.
+ * @param offset the offset to use.
+ * @param hints any rendering hints to use (can be null).
+ */
public RescaleOp(float scaleFactor,
float offset,
RenderingHints hints)
@@ -69,22 +113,47 @@ public class RescaleOp implements BufferedImageOp, RasterOp
this.hints = hints;
}
+ /**
+ * Returns the scaling factors. This method accepts an optional array, which
+ * will be used to store the factors if not null (this avoids allocating a
+ * new array). If this array is too small to hold all the scaling factors,
+ * the array will be filled and the remaining factors discarded.
+ *
+ * @param scaleFactors array to store the scaling factors in (can be null).
+ * @return an array of scaling factors.
+ */
public final float[] getScaleFactors(float[] scaleFactors)
{
if (scaleFactors == null)
scaleFactors = new float[scale.length];
- System.arraycopy(scale, 0, scaleFactors, 0, scale.length);
+ System.arraycopy(scale, 0, scaleFactors, 0, Math.min(scale.length,
+ scaleFactors.length));
return scaleFactors;
}
+ /**
+ * Returns the offsets. This method accepts an optional array, which
+ * will be used to store the offsets if not null (this avoids allocating a
+ * new array). If this array is too small to hold all the offsets, the array
+ * will be filled and the remaining factors discarded.
+ *
+ * @param offsets array to store the offsets in (can be null).
+ * @return an array of offsets.
+ */
public final float[] getOffsets(float[] offsets)
{
if (offsets == null)
offsets = new float[this.offsets.length];
- System.arraycopy(this.offsets, 0, offsets, 0, this.offsets.length);
+ System.arraycopy(this.offsets, 0, offsets, 0, Math.min(this.offsets.length,
+ offsets.length));
return offsets;
}
+ /**
+ * Returns the number of scaling factors / offsets.
+ *
+ * @return the number of scaling factors / offsets.
+ */
public final int getNumFactors()
{
return scale.length;
@@ -98,36 +167,74 @@ public class RescaleOp implements BufferedImageOp, RasterOp
return hints;
}
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#filter(java.awt.image.BufferedImage, java.awt.image.BufferedImage)
+ /**
+ * Converts the source image using the scale factors and offsets specified in
+ * the constructor. The resulting image is stored in the destination image if
+ * one is provided; otherwise a new BufferedImage is created and returned.
+ *
+ * The source image cannot use an IndexColorModel, and the destination image
+ * (if one is provided) must have the same size.
+ *
+ * If the final value of a sample is beyond the range of the color model, it
+ * will be clipped to the appropriate maximum / minimum.
+ *
+ * @param src The source image.
+ * @param dst The destination image.
+ * @throws IllegalArgumentException if the rasters and/or color spaces are
+ * incompatible.
+ * @return The rescaled image.
*/
public final BufferedImage filter(BufferedImage src, BufferedImage dst)
{
- // TODO Make sure premultiplied alpha is handled correctly.
- // TODO See that color conversion is handled.
- // TODO figure out how to use rendering hints.
- if (scale.length != offsets.length)
- throw new IllegalArgumentException();
+ // Initial checks
+ if (scale.length != 1
+ && scale.length != src.getColorModel().getNumComponents()
+ && (scale.length != src.getColorModel().getNumColorComponents()))
+ throw new IllegalArgumentException("Source image has wrong number of "
+ + "bands for these scaling factors.");
- ColorModel scm = src.getColorModel();
- if (dst == null) dst = createCompatibleDestImage(src, null);
+ if (dst == null)
+ dst = createCompatibleDestImage(src, null);
+ else if (src.getHeight() != dst.getHeight()
+ || src.getWidth() != dst.getWidth())
+ throw new IllegalArgumentException("Source and destination images are "
+ + "different sizes.");
- WritableRaster wsrc = src.getRaster();
- WritableRaster wdst = dst.getRaster();
-
- // Share constant across colors except alpha
- if (scale.length == 1 || scale.length == scm.getNumColorComponents())
+ // Prepare for possible colorspace conversion
+ BufferedImage dst2 = dst;
+ if (dst.getColorModel().getColorSpace().getType() != src.getColorModel().getColorSpace().getType())
+ dst2 = createCompatibleDestImage(src, src.getColorModel());
+
+ // Figure out how many bands to scale
+ int numBands = scale.length;
+ if (scale.length == 1)
+ numBands = src.getColorModel().getNumColorComponents();
+ boolean[] bands = new boolean[numBands];
+ // this assumes the alpha, if present, is the last band
+ Arrays.fill(bands, true);
+
+ // Perform rescaling
+ filter(src.getRaster(), dst2.getRaster(), bands);
+
+ // Copy alpha band if needed (ie if it exists and wasn't scaled)
+ // NOTE: This assumes the alpha component is the last band!
+ if (src.getColorModel().hasAlpha()
+ && numBands == src.getColorModel().getNumColorComponents())
{
- // Construct a raster that doesn't include an alpha band.
- int[] subbands = new int[scm.getNumColorComponents()];
- for (int i=0; i < subbands.length; i++) subbands[i] = i;
- wsrc =
- wsrc.createWritableChild(wsrc.minX, wsrc.minY, wsrc.width, wsrc.height,
- wsrc.minX, wsrc.minY, subbands);
+
+ dst2.getRaster().setSamples(0, 0, src.getWidth(), src.getHeight(),
+ numBands,
+ src.getRaster().getSamples(0, 0,
+ src.getWidth(),
+ src.getHeight(),
+ numBands,
+ (int[]) null));
}
- // else all color bands
- filter(wsrc, wdst);
+ // Perform colorspace conversion if needed
+ if (dst != dst2)
+ new ColorConvertOp(hints).filter(dst2, dst);
+
return dst;
}
@@ -136,50 +243,106 @@ public class RescaleOp implements BufferedImageOp, RasterOp
*/
public final WritableRaster filter(Raster src, WritableRaster dest)
{
- if (dest == null) dest = src.createCompatibleWritableRaster();
-
// Required sanity checks
- if (src.numBands != dest.numBands || scale.length != offsets.length)
- throw new IllegalArgumentException();
if (scale.length != 1 && scale.length != src.numBands)
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("Number of rasters is incompatible "
+ + "with the number of scaling "
+ + "factors provided.");
- // Create scaling arrays if needed
- float[] lscale = scale;
- float[] loff = offsets;
- if (scale.length == 1)
- {
- lscale = new float[src.numBands];
- Arrays.fill(lscale, scale[0]);
- loff = new float[src.numBands];
- Arrays.fill(loff, offsets[0]);
- }
+ if (dest == null)
+ dest = src.createCompatibleWritableRaster();
+ else if (src.getHeight() != dest.getHeight()
+ || src.getWidth() != dest.getWidth())
+ throw new IllegalArgumentException("Source and destination rasters are "
+ + "different sizes.");
+ else if (src.numBands != dest.numBands)
+ throw new IllegalArgumentException("Source and destination rasters "
+ + "are incompatible.");
+
+ // Filter all bands
+ boolean[] bands = new boolean[src.getNumBands()];
+ Arrays.fill(bands, true);
+ return filter(src, dest, bands);
+ }
+
+ /**
+ * Perform raster-based filtering on a selected number of bands.
+ *
+ * The length of the bands array should equal the number of bands; a true
+ * element indicates filtering should happen on the corresponding band, while
+ * a false element will skip the band.
+ *
+ * The rasters are assumed to be compatible and non-null.
+ *
+ * @param src the source raster.
+ * @param dest the destination raster.
+ * @param bands an array indicating which bands to filter.
+ * @throws NullPointerException if any parameter is null.
+ * @throws ArrayIndexOutOfBoundsException if the bands array is too small.
+ * @return the destination raster.
+ */
+ private WritableRaster filter(Raster src, WritableRaster dest, boolean[] bands)
+ {
+ int[] values = new int[src.getHeight() * src.getWidth()];
+ float scaleFactor, offset;
+
+ // Find max sample value, to be used for clipping later
+ int[] maxValue = src.getSampleModel().getSampleSize();
+ for (int i = 0; i < maxValue.length; i++)
+ maxValue[i] = (int)Math.pow(2, maxValue[i]) - 1;
+
+ // TODO: can this be optimized further?
+ // Filter all samples of all requested bands
+ for (int band = 0; band < bands.length; band++)
+ if (bands[band])
+ {
+ values = src.getSamples(src.getMinX(), src.getMinY(), src.getWidth(),
+ src.getHeight(), band, values);
- // TODO The efficiency here can be improved for various data storage
- // patterns, aka SampleModels.
- float[] pixel = new float[src.numBands];
- for (int y = src.minY; y < src.height + src.minY; y++)
- for (int x = src.minX; x < src.width + src.minX; x++)
- {
- src.getPixel(x, y, pixel);
- for (int b = 0; b < src.numBands; b++)
- pixel[b] = pixel[b] * lscale[b] + loff[b];
- dest.setPixel(x, y, pixel);
- }
+ if (scale.length == 1)
+ {
+ scaleFactor = scale[0];
+ offset = offsets[0];
+ }
+ else
+ {
+ scaleFactor = scale[band];
+ offset = offsets[band];
+ }
+
+ for (int i = 0; i < values.length; i++)
+ {
+ values[i] = (int) (values[i] * scaleFactor + offset);
+
+ // Clip if needed
+ if (values[i] < 0)
+ values[i] = 0;
+ if (values[i] > maxValue[band])
+ values[i] = maxValue[band];
+ }
+
+ dest.setSamples(dest.getMinX(), dest.getMinY(), dest.getWidth(),
+ dest.getHeight(), band, values);
+ }
+
return dest;
}
- /* (non-Javadoc)
- * @see java.awt.image.BufferedImageOp#createCompatibleDestImage(java.awt.image.BufferedImage, java.awt.image.ColorModel)
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.awt.image.BufferedImageOp#createCompatibleDestImage(java.awt.image.BufferedImage,
+ * java.awt.image.ColorModel)
*/
public BufferedImage createCompatibleDestImage(BufferedImage src,
ColorModel dstCM)
{
- if (dstCM == null) dstCM = src.getColorModel();
- WritableRaster wr = src.getRaster().createCompatibleWritableRaster();
- BufferedImage image
- = new BufferedImage(dstCM, wr, src.isPremultiplied, null);
- return image;
+ if (dstCM == null)
+ return new BufferedImage(src.getWidth(), src.getHeight(), src.getType());
+
+ return new BufferedImage(dstCM,
+ src.getRaster().createCompatibleWritableRaster(),
+ src.isAlphaPremultiplied(), null);
}
/* (non-Javadoc)
@@ -209,9 +372,13 @@ public class RescaleOp implements BufferedImageOp, RasterOp
/* (non-Javadoc)
* @see java.awt.image.BufferedImageOp#getPoint2D(java.awt.geom.Point2D, java.awt.geom.Point2D)
*/
- public final Point2D getPoint2D(Point2D src, Point2D dst) {
- if (dst == null) dst = (Point2D) src.clone();
- else dst.setLocation(src);
+ public final Point2D getPoint2D(Point2D src, Point2D dst)
+ {
+ if (dst == null)
+ dst = (Point2D) src.clone();
+ else
+ dst.setLocation(src);
+
return dst;
}
diff --git a/libjava/classpath/java/awt/image/SampleModel.java b/libjava/classpath/java/awt/image/SampleModel.java
index cb352bb4d85..506e78a9b87 100644
--- a/libjava/classpath/java/awt/image/SampleModel.java
+++ b/libjava/classpath/java/awt/image/SampleModel.java
@@ -246,9 +246,7 @@ public abstract class SampleModel
public void setDataElements(int x, int y, int w, int h,
Object obj, DataBuffer data)
{
- int size = w * h;
int numDataElements = getNumDataElements();
- int dataSize = numDataElements * size;
Object pixelData;
switch (getTransferType())
@@ -257,25 +255,34 @@ public abstract class SampleModel
pixelData = new byte[numDataElements];
break;
case DataBuffer.TYPE_USHORT:
+ case DataBuffer.TYPE_SHORT:
pixelData = new short[numDataElements];
break;
case DataBuffer.TYPE_INT:
pixelData = new int[numDataElements];
break;
+ case DataBuffer.TYPE_FLOAT:
+ pixelData = new float[numDataElements];
+ break;
+ case DataBuffer.TYPE_DOUBLE:
+ pixelData = new double[numDataElements];
+ break;
default:
- // Seems like the only sensible thing to do.
- throw new ClassCastException();
+ // The RI silently igores invalid types.
+ pixelData = null;
}
- int inOffset = 0;
- for (int yy = y; yy < (y + h); yy++)
+ int inOffset = 0;
+ if (pixelData != null)
{
- for (int xx = x; xx < (x + w); xx++)
+ for (int yy=y; yy<(y+h); yy++)
{
- System.arraycopy(obj, inOffset, pixelData, 0,
- numDataElements);
- setDataElements(xx, yy, pixelData, data);
- inOffset += numDataElements;
+ for (int xx=x; xx<(x+w); xx++)
+ {
+ System.arraycopy(obj, inOffset, pixelData, 0, numDataElements);
+ setDataElements(xx, yy, pixelData, data);
+ inOffset += numDataElements;
+ }
}
}
}
diff --git a/libjava/classpath/java/awt/image/SinglePixelPackedSampleModel.java b/libjava/classpath/java/awt/image/SinglePixelPackedSampleModel.java
index a37fc0bba3f..9ed948c54f3 100644
--- a/libjava/classpath/java/awt/image/SinglePixelPackedSampleModel.java
+++ b/libjava/classpath/java/awt/image/SinglePixelPackedSampleModel.java
@@ -412,110 +412,31 @@ public class SinglePixelPackedSampleModel extends SampleModel
return (samples & bitMasks[b]) >>> bitOffsets[b];
}
- /**
- * This method implements a more efficient way to set data elements than the
- * default implementation of the super class. It sets the data elements line
- * by line instead of pixel by pixel.
- *
- * @param x The x-coordinate of the data elements in <code>obj</code>.
- * @param y The y-coordinate of the data elements in <code>obj</code>.
- * @param w The width of the data elements in <code>obj</code>.
- * @param h The height of the data elements in <code>obj</code>.
- * @param obj The primitive array containing the data elements to set.
- * @param data The DataBuffer to store the data elements into.
- * @see java.awt.image.SampleModel#setDataElements(int, int, int, int,
- * java.lang.Object, java.awt.image.DataBuffer)
- */
- public void setDataElements(int x, int y, int w, int h,
- Object obj, DataBuffer data)
- {
-
- Object pixelData;
- switch (getTransferType())
- {
- case DataBuffer.TYPE_BYTE:
- pixelData = ((DataBufferByte) data).getData();
- break;
- case DataBuffer.TYPE_USHORT:
- pixelData = ((DataBufferUShort) data).getData();
- break;
- case DataBuffer.TYPE_INT:
- pixelData = ((DataBufferInt) data).getData();
- break;
- default:
- // Seems like the only sensible thing to do.
- throw new ClassCastException();
- }
-
- int inOffset = 0;
- int dataOffset = scanlineStride*y + x + data.getOffset();
- for (int yy=y; yy<(y+h); yy++)
- {
- System.arraycopy(obj,inOffset,pixelData,dataOffset,w);
- dataOffset += scanlineStride;
- inOffset += w;
- }
- }
-
-
public void setDataElements(int x, int y, Object obj, DataBuffer data)
{
- int offset = scanlineStride*y + x + data.getOffset();
int transferType = getTransferType();
- if (getTransferType() != data.getDataType())
- {
- throw new IllegalArgumentException("transfer type ("+
- getTransferType()+"), "+
- "does not match data "+
- "buffer type (" +
- data.getDataType() +
- ").");
- }
-
- try
- {
- switch (transferType)
- {
- case DataBuffer.TYPE_BYTE:
- {
- DataBufferByte out = (DataBufferByte) data;
- byte[] in = (byte[]) obj;
- out.getData()[offset] = in[0];
- return;
- }
- case DataBuffer.TYPE_USHORT:
- {
- DataBufferUShort out = (DataBufferUShort) data;
- short[] in = (short[]) obj;
- out.getData()[offset] = in[0];
- return;
- }
- case DataBuffer.TYPE_INT:
- {
- DataBufferInt out = (DataBufferInt) data;
- int[] in = (int[]) obj;
- out.getData()[offset] = in[0];
- return;
- }
- // FIXME: Fill in the other possible types.
- default:
- throw new InternalError();
- }
- }
- catch (ArrayIndexOutOfBoundsException aioobe)
- {
- String msg = "While writing data elements" +
- ", x="+x+", y="+y+
- ", width="+width+", height="+height+
- ", scanlineStride="+scanlineStride+
- ", offset="+offset+
- ", data.getSize()="+data.getSize()+
- ", data.getOffset()="+data.getOffset()+
- ": " +
- aioobe;
- throw new ArrayIndexOutOfBoundsException(msg);
- }
+ switch (transferType)
+ {
+ case DataBuffer.TYPE_BYTE:
+ {
+ byte[] in = (byte[]) obj;
+ data.setElem(y * scanlineStride + x, ((int) in[0]) & 0xff);
+ break;
+ }
+ case DataBuffer.TYPE_USHORT:
+ {
+ short[] in = (short[]) obj;
+ data.setElem(y * scanlineStride + x, ((int) in[0]) & 0xffff);
+ break;
+ }
+ case DataBuffer.TYPE_INT:
+ {
+ int[] in = (int[]) obj;
+ data.setElem(y * scanlineStride + x, in[0]);
+ break;
+ }
+ }
}
/**
diff --git a/libjava/classpath/java/awt/image/WritableRaster.java b/libjava/classpath/java/awt/image/WritableRaster.java
index 473c6fe41f9..bf8db140c7f 100644
--- a/libjava/classpath/java/awt/image/WritableRaster.java
+++ b/libjava/classpath/java/awt/image/WritableRaster.java
@@ -136,8 +136,9 @@ public class WritableRaster extends Raster
{
// This mirrors the code from the super class
- // FIXME: Throw RasterFormatException if child bounds extends
- // beyond the bounds of this raster.
+ if (parentX < minX || parentX + w > minX + width
+ || parentY < minY || parentY + h > minY + height)
+ throw new RasterFormatException("Child raster extends beyond parent");
SampleModel sm = (bandList == null) ?
sampleModel :
@@ -149,6 +150,25 @@ public class WritableRaster extends Raster
sampleModelTranslateY + childMinY - parentY),
this);
}
+
+ public Raster createChild(int parentX, int parentY, int width,
+ int height, int childMinX, int childMinY,
+ int[] bandList)
+ {
+ if (parentX < minX || parentX + width > minX + this.width
+ || parentY < minY || parentY + height > minY + this.height)
+ throw new RasterFormatException("Child raster extends beyond parent");
+
+ SampleModel sm = (bandList == null) ?
+ sampleModel :
+ sampleModel.createSubsetSampleModel(bandList);
+
+ return new WritableRaster(sm, dataBuffer,
+ new Rectangle(childMinX, childMinY, width, height),
+ new Point(sampleModelTranslateX + childMinX - parentX,
+ sampleModelTranslateY + childMinY - parentY),
+ this);
+ }
public void setDataElements(int x, int y, Object inData)
{
diff --git a/libjava/classpath/java/awt/image/renderable/ParameterBlock.java b/libjava/classpath/java/awt/image/renderable/ParameterBlock.java
index 879d3c4fb90..e484d6b8713 100644
--- a/libjava/classpath/java/awt/image/renderable/ParameterBlock.java
+++ b/libjava/classpath/java/awt/image/renderable/ParameterBlock.java
@@ -45,20 +45,20 @@ import java.util.Vector;
public class ParameterBlock implements Cloneable, Serializable
{
private static final long serialVersionUID = -7577115551785240750L;
- protected Vector sources;
- protected Vector parameters;
+ protected Vector<Object> sources;
+ protected Vector<Object> parameters;
public ParameterBlock()
{
- this(new Vector(), new Vector());
+ this(new Vector<Object>(), new Vector<Object>());
}
- public ParameterBlock(Vector sources)
+ public ParameterBlock(Vector<Object> sources)
{
- this(sources, new Vector());
+ this(sources, new Vector<Object>());
}
- public ParameterBlock(Vector sources, Vector parameters)
+ public ParameterBlock(Vector<Object> sources, Vector<Object> parameters)
{
this.sources = sources;
this.parameters = parameters;
@@ -80,9 +80,9 @@ public class ParameterBlock implements Cloneable, Serializable
{
ParameterBlock pb = (ParameterBlock) shallowClone();
if (sources != null)
- pb.sources = (Vector) sources.clone();
+ pb.sources = (Vector<Object>) sources.clone();
if (parameters != null)
- pb.parameters = (Vector) parameters.clone();
+ pb.parameters = (Vector<Object>) parameters.clone();
return pb;
}
@@ -119,12 +119,12 @@ public class ParameterBlock implements Cloneable, Serializable
return sources.size();
}
- public Vector getSources()
+ public Vector<Object> getSources()
{
return sources;
}
- public void setSources(Vector sources)
+ public void setSources(Vector<Object> sources)
{
this.sources = sources;
}
@@ -140,12 +140,12 @@ public class ParameterBlock implements Cloneable, Serializable
return parameters.size();
}
- public Vector getParameters()
+ public Vector<Object> getParameters()
{
return parameters;
}
- public void setParameters(Vector parameters)
+ public void setParameters(Vector<Object> parameters)
{
this.parameters = parameters;
}
diff --git a/libjava/classpath/java/awt/image/renderable/RenderableImage.java b/libjava/classpath/java/awt/image/renderable/RenderableImage.java
index 45d2eb7ebf0..c2f6ad8b058 100644
--- a/libjava/classpath/java/awt/image/renderable/RenderableImage.java
+++ b/libjava/classpath/java/awt/image/renderable/RenderableImage.java
@@ -46,7 +46,7 @@ public interface RenderableImage
{
String HINTS_OBSERVED = "HINTS_OBSERVED";
- Vector getSources();
+ Vector<RenderableImage> getSources();
Object getProperty(String name);
String[] getPropertyNames();
boolean isDynamic();
diff --git a/libjava/classpath/java/awt/image/renderable/RenderableImageOp.java b/libjava/classpath/java/awt/image/renderable/RenderableImageOp.java
index 5385a82a317..b9d0cd39e6e 100644
--- a/libjava/classpath/java/awt/image/renderable/RenderableImageOp.java
+++ b/libjava/classpath/java/awt/image/renderable/RenderableImageOp.java
@@ -55,7 +55,7 @@ public class RenderableImageOp implements RenderableImage
this.block = (ParameterBlock) block.clone();
}
- public Vector getSources()
+ public Vector<RenderableImage> getSources()
{
if (block.sources == null)
return null;
diff --git a/libjava/classpath/java/beans/BeanDescriptor.java b/libjava/classpath/java/beans/BeanDescriptor.java
index 21227b2fee0..b4bc6870d24 100644
--- a/libjava/classpath/java/beans/BeanDescriptor.java
+++ b/libjava/classpath/java/beans/BeanDescriptor.java
@@ -48,14 +48,14 @@ package java.beans;
**/
public class BeanDescriptor extends FeatureDescriptor {
- Class beanClass;
- Class customizerClass;
+ Class<?> beanClass;
+ Class<?> customizerClass;
/** Create a new BeanDescriptor with the given beanClass and
** no customizer class.
** @param beanClass the class of the Bean.
**/
- public BeanDescriptor(Class beanClass) {
+ public BeanDescriptor(Class<?> beanClass) {
this(beanClass,null);
}
@@ -64,7 +64,7 @@ public class BeanDescriptor extends FeatureDescriptor {
** @param beanClass the class of the Bean.
** @param customizerClass the class of the Bean's Customizer.
**/
- public BeanDescriptor(Class beanClass, Class customizerClass) {
+ public BeanDescriptor(Class<?> beanClass, Class<?> customizerClass) {
this.beanClass = beanClass;
this.customizerClass = customizerClass;
@@ -78,12 +78,12 @@ public class BeanDescriptor extends FeatureDescriptor {
}
/** Get the Bean's class. **/
- public Class getBeanClass() {
+ public Class<?> getBeanClass() {
return beanClass;
}
/** Get the Bean's customizer's class. **/
- public Class getCustomizerClass() {
+ public Class<?> getCustomizerClass() {
return customizerClass;
}
}
diff --git a/libjava/classpath/java/beans/Beans.java b/libjava/classpath/java/beans/Beans.java
index ffcb83fc1f3..b3b0a422edd 100644
--- a/libjava/classpath/java/beans/Beans.java
+++ b/libjava/classpath/java/beans/Beans.java
@@ -295,7 +295,7 @@ public class Beans
* @return the Bean as a new view, or if the operation
* could not be performed, the Bean itself.
*/
- public static Object getInstanceOf(Object bean, Class newClass)
+ public static Object getInstanceOf(Object bean, Class<?> newClass)
{
return bean;
}
@@ -314,7 +314,7 @@ public class Beans
* @return whether the Bean can be cast to the class type
* in question.
*/
- public static boolean isInstanceOf(Object bean, Class newBeanClass)
+ public static boolean isInstanceOf(Object bean, Class<?> newBeanClass)
{
return newBeanClass.isInstance(bean);
}
diff --git a/libjava/classpath/java/beans/DefaultPersistenceDelegate.java b/libjava/classpath/java/beans/DefaultPersistenceDelegate.java
index ca1041fefc9..08f6174bb6e 100644
--- a/libjava/classpath/java/beans/DefaultPersistenceDelegate.java
+++ b/libjava/classpath/java/beans/DefaultPersistenceDelegate.java
@@ -154,8 +154,8 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate
return new Expression(oldInstance, oldInstance.getClass(), "new", args);
}
- protected void initialize(Class type, Object oldInstance, Object newInstance,
- Encoder out)
+ protected void initialize(Class<?> type, Object oldInstance,
+ Object newInstance, Encoder out)
{
// Calling the supertype's implementation of initialize makes it
// possible that descendants of classes like AbstractHashMap
diff --git a/libjava/classpath/java/beans/DesignMode.java b/libjava/classpath/java/beans/DesignMode.java
index 39805d50c18..9897f022ea4 100644
--- a/libjava/classpath/java/beans/DesignMode.java
+++ b/libjava/classpath/java/beans/DesignMode.java
@@ -1,5 +1,5 @@
/* java.beans.DesignMode
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,8 @@ exception statement from your version. */
package java.beans;
/**
- * <code>BeanContextChild</code> implementors implement this to get information about whether they are in a design time or runtime environment.
+ * <code>BeanContextChild</code> implementors implement this to get information
+ * about whether they are in a design time or runtime environment.
* The reason this is restricted to <code>BeanContextChild</code>ren is that
* only things in the <code>BeanContext</code> hierarchy are given this
* information in the first place.
@@ -48,46 +49,47 @@ package java.beans;
* @since JDK1.2
* @see java.beans.beancontext.BeanContextChild
*/
+public interface DesignMode
+{
-public interface DesignMode {
- /**
- * Use this name when firing <code>PropertyChangeEvent</code>s from your Bean.
- * @fixme Check whether PROPERTYNAME is set to same value as Sun.
- */
- String PROPERTYNAME = "designTime";
+ /**
+ * Use this name when firing <code>PropertyChangeEvent</code>s from your Bean.
+ */
+ String PROPERTYNAME = "designTime";
- /**
- * The environment will call this method on your
- * <code>BeanContextChild</code> when it is registered in a parent
- * <code>BeanContext</code> or when behavior needs to switch from
- * design time to runtime behavior (or vice versa).
- * <P>
- *
- * <code>BeanContext</code>s are required to fire
- * <code>PropertyChangeEvent</code>s when properties change.
- * <code>designTime</code> is a property, and therefore when you
- * implement <code>setDesignTime()</code>, you need to fire a
- * <code>PropertyChangeEvent</code> with the old value, the new
- * value and using <code>PROPERTYNAME</code> as the property name.
- *
- * @param designTime the new value of design time,
- * <code>true</code> if it is design time,
- * <code>false</code> if it is runtime.
- *
- * @fixme I'm frankly not really sure whether it's the case that
- * the BeanContext can <em>change</em> the status of the Bean from
- * design time to runtime. But it appears that it may be so.
- *
- * @see java.util.PropertyChangeEvent
- * @see java.beans.beancontext.BeanContext
- * @see #PROPERTYNAME
- */
- void setDesignTime(boolean designTime);
+ /**
+ * The environment will call this method on your
+ * <code>BeanContextChild</code> when it is registered in a parent
+ * <code>BeanContext</code> or when behavior needs to switch from
+ * design time to runtime behavior (or vice versa).
+ * <P>
+ *
+ * <code>BeanContext</code>s are required to fire
+ * <code>PropertyChangeEvent</code>s when properties change.
+ * <code>designTime</code> is a property, and therefore when you
+ * implement <code>setDesignTime()</code>, you need to fire a
+ * <code>PropertyChangeEvent</code> with the old value, the new
+ * value and using <code>PROPERTYNAME</code> as the property name.
+ *
+ * @param designTime the new value of design time,
+ * <code>true</code> if it is design time,
+ * <code>false</code> if it is runtime.
+ *
+ * @fixme I'm frankly not really sure whether it's the case that
+ * the BeanContext can <em>change</em> the status of the Bean from
+ * design time to runtime. But it appears that it may be so.
+ *
+ * @see java.beans.PropertyChangeEvent
+ * @see java.beans.beancontext.BeanContext
+ * @see #PROPERTYNAME
+ */
+ void setDesignTime(boolean designTime);
+
+ /**
+ * This method should tell whether it is design time or runtime.
+ * @return <code>true</code> if design time, <code>false</code> if
+ * runtime.
+ */
+ boolean isDesignTime();
- /**
- * This method should tell whether it is design time or runtime.
- * @return <code>true</code> if design time, <code>false</code> if
- * runtime.
- */
- boolean isDesignTime();
}
diff --git a/libjava/classpath/java/beans/Encoder.java b/libjava/classpath/java/beans/Encoder.java
index b9d135831a8..cde1735f4fd 100644
--- a/libjava/classpath/java/beans/Encoder.java
+++ b/libjava/classpath/java/beans/Encoder.java
@@ -181,7 +181,7 @@ public class Encoder
return exceptionListener;
}
- public PersistenceDelegate getPersistenceDelegate(Class type)
+ public PersistenceDelegate getPersistenceDelegate(Class<?> type)
{
// This is not specified but the JDK behaves like this.
if (type == null)
@@ -215,7 +215,8 @@ public class Encoder
* access is thread safe.
* </p>
*/
- public void setPersistenceDelegate(Class type, PersistenceDelegate delegate)
+ public void setPersistenceDelegate(Class<?> type,
+ PersistenceDelegate delegate)
{
// If the argument is null this will cause a NullPointerException
// which is expected behavior.
diff --git a/libjava/classpath/java/beans/EventHandler.java b/libjava/classpath/java/beans/EventHandler.java
index 9c85893e0f3..318b274898a 100644
--- a/libjava/classpath/java/beans/EventHandler.java
+++ b/libjava/classpath/java/beans/EventHandler.java
@@ -463,7 +463,8 @@ public class EventHandler implements InvocationHandler
* @param action Target property or method to invoke.
* @return A constructed proxy object.
*/
- public static Object create(Class listenerInterface, Object target, String action)
+ public static <T> T create(Class<T> listenerInterface, Object target,
+ String action)
{
return create(listenerInterface, target, action, null, null);
}
@@ -552,8 +553,8 @@ public class EventHandler implements InvocationHandler
* @param eventPropertyName Name of property to extract from event.
* @return A constructed proxy object.
*/
- public static Object create(Class listenerInterface, Object target,
- String action, String eventPropertyName)
+ public static <T> T create(Class<T> listenerInterface, Object target,
+ String action, String eventPropertyName)
{
return create(listenerInterface, target, action, eventPropertyName, null);
}
@@ -587,9 +588,9 @@ public class EventHandler implements InvocationHandler
* @param listenerMethodName Listener method to implement.
* @return A constructed proxy object.
*/
- public static Object create(Class listenerInterface, Object target,
- String action, String eventPropertyName,
- String listenerMethodName)
+ public static <T> T create(Class<T> listenerInterface, Object target,
+ String action, String eventPropertyName,
+ String listenerMethodName)
{
// Create EventHandler instance
EventHandler eh = new EventHandler(target, action, eventPropertyName,
@@ -597,10 +598,9 @@ public class EventHandler implements InvocationHandler
// Create proxy object passing in the event handler
Object proxy = Proxy.newProxyInstance(listenerInterface.getClassLoader(),
- new Class[] {listenerInterface},
+ new Class<?>[] {listenerInterface},
eh);
- return proxy;
+ return (T) proxy;
}
-
}
diff --git a/libjava/classpath/java/beans/EventSetDescriptor.java b/libjava/classpath/java/beans/EventSetDescriptor.java
index 381a453031e..69c07423fa0 100644
--- a/libjava/classpath/java/beans/EventSetDescriptor.java
+++ b/libjava/classpath/java/beans/EventSetDescriptor.java
@@ -164,8 +164,8 @@ public class EventSetDescriptor extends FeatureDescriptor
* if listenerType is not an EventListener, or if methods are not
* found or are invalid.
*/
- public EventSetDescriptor(Class eventSourceClass, String eventSetName,
- Class listenerType, String listenerMethodName)
+ public EventSetDescriptor(Class<?> eventSourceClass, String eventSetName,
+ Class<?> listenerType, String listenerMethodName)
throws IntrospectionException
{
setName(eventSetName);
@@ -225,8 +225,8 @@ public class EventSetDescriptor extends FeatureDescriptor
* if listenerType is not an EventListener or if methods are not
* found or are invalid.
*/
- public EventSetDescriptor(Class eventSourceClass, String eventSetName,
- Class listenerType, String[] listenerMethodNames,
+ public EventSetDescriptor(Class<?> eventSourceClass, String eventSetName,
+ Class<?> listenerType, String[] listenerMethodNames,
String addListenerMethodName,
String removeListenerMethodName)
throws IntrospectionException
@@ -287,8 +287,8 @@ public class EventSetDescriptor extends FeatureDescriptor
* found or are invalid.
* @since 1.4
*/
- public EventSetDescriptor(Class eventSourceClass, String eventSetName,
- Class listenerType, String[] listenerMethodNames,
+ public EventSetDescriptor(Class<?> eventSourceClass, String eventSetName,
+ Class<?> listenerType, String[] listenerMethodNames,
String addListenerMethodName,
String removeListenerMethodName,
String getListenerMethodName)
@@ -357,7 +357,7 @@ public class EventSetDescriptor extends FeatureDescriptor
* methods are invalid.
* @since 1.4
*/
- public EventSetDescriptor(String eventSetName, Class listenerType,
+ public EventSetDescriptor(String eventSetName, Class<?> listenerType,
Method[] listenerMethods, Method addListenerMethod,
Method removeListenerMethod,
Method getListenerMethod)
@@ -402,7 +402,7 @@ public class EventSetDescriptor extends FeatureDescriptor
* if the listenerType is not an EventListener, or any of the
* methods are invalid.
*/
- public EventSetDescriptor(String eventSetName, Class listenerType,
+ public EventSetDescriptor(String eventSetName, Class<?> listenerType,
Method[] listenerMethods, Method addListenerMethod,
Method removeListenerMethod)
throws IntrospectionException
@@ -449,7 +449,7 @@ public class EventSetDescriptor extends FeatureDescriptor
* if the listenerType is not an EventListener, or any of the
* methods are invalid.
*/
- public EventSetDescriptor(String eventSetName, Class listenerType,
+ public EventSetDescriptor(String eventSetName, Class<?> listenerType,
MethodDescriptor[] listenerMethodDescriptors,
Method addListenerMethod,
Method removeListenerMethod)
@@ -484,7 +484,7 @@ public class EventSetDescriptor extends FeatureDescriptor
/** Returns the class that contains the event firing methods.
*/
- public Class getListenerType()
+ public Class<?> getListenerType()
{
return listenerType;
}
diff --git a/libjava/classpath/java/beans/FeatureDescriptor.java b/libjava/classpath/java/beans/FeatureDescriptor.java
index aeb40949099..050885158fa 100644
--- a/libjava/classpath/java/beans/FeatureDescriptor.java
+++ b/libjava/classpath/java/beans/FeatureDescriptor.java
@@ -68,14 +68,14 @@ public class FeatureDescriptor
boolean hidden;
boolean preferred;
- Hashtable valueHash;
+ Hashtable<String,Object> valueHash;
/**
* Instantiate this FeatureDescriptor with appropriate default values.
*/
public FeatureDescriptor()
{
- valueHash = new Hashtable();
+ valueHash = new Hashtable<String,Object>();
}
/**
@@ -225,7 +225,7 @@ public class FeatureDescriptor
* @return an Enumerator over all the programmatic key names associated
* with this feature.
*/
- public Enumeration attributeNames()
+ public Enumeration<String> attributeNames()
{
return valueHash.keys();
}
diff --git a/libjava/classpath/java/beans/IndexedPropertyDescriptor.java b/libjava/classpath/java/beans/IndexedPropertyDescriptor.java
index 0ba2ed4f493..61c3f228da0 100644
--- a/libjava/classpath/java/beans/IndexedPropertyDescriptor.java
+++ b/libjava/classpath/java/beans/IndexedPropertyDescriptor.java
@@ -76,7 +76,7 @@ import java.lang.reflect.Method;
*/
public class IndexedPropertyDescriptor extends PropertyDescriptor
{
- private Class indexedPropertyType;
+ private Class<?> indexedPropertyType;
private Method setIndex;
private Method getIndex;
@@ -112,7 +112,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor
* @exception IntrospectionException if the methods are not found or
* invalid.
*/
- public IndexedPropertyDescriptor(String name, Class beanClass)
+ public IndexedPropertyDescriptor(String name, Class<?> beanClass)
throws IntrospectionException
{
super(name);
@@ -161,7 +161,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor
*
* @exception IntrospectionException if the methods are not found or invalid.
*/
- public IndexedPropertyDescriptor(String name, Class beanClass,
+ public IndexedPropertyDescriptor(String name, Class<?> beanClass,
String getMethodName, String setMethodName,
String getIndexName, String setIndexName)
throws IntrospectionException
@@ -272,7 +272,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor
: Array.newInstance(this.indexedPropertyType,0).getClass());
}
- public Class getIndexedPropertyType()
+ public Class<?> getIndexedPropertyType()
{
return indexedPropertyType;
}
diff --git a/libjava/classpath/java/beans/Introspector.java b/libjava/classpath/java/beans/Introspector.java
index 23c3cde5e3d..28df87f677f 100644
--- a/libjava/classpath/java/beans/Introspector.java
+++ b/libjava/classpath/java/beans/Introspector.java
@@ -182,7 +182,8 @@ public class Introspector {
public static final int IGNORE_ALL_BEANINFO = 3;
static String[] beanInfoSearchPath = {"gnu.java.beans.info"};
- static Hashtable beanInfoCache = new Hashtable();
+ static Hashtable<Class<?>,BeanInfo> beanInfoCache =
+ new Hashtable<Class<?>,BeanInfo>();
private Introspector() {}
@@ -195,13 +196,13 @@ public class Introspector {
* @param beanClass the class to get BeanInfo about.
* @return the BeanInfo object representing the class.
*/
- public static BeanInfo getBeanInfo(Class beanClass)
+ public static BeanInfo getBeanInfo(Class<?> beanClass)
throws IntrospectionException
{
BeanInfo cachedInfo;
synchronized(beanClass)
{
- cachedInfo = (BeanInfo)beanInfoCache.get(beanClass);
+ cachedInfo = beanInfoCache.get(beanClass);
if(cachedInfo != null)
{
return cachedInfo;
@@ -245,7 +246,7 @@ public class Introspector {
* @throws IntrospectionException If something goes wrong while retrieving
* the bean data.
*/
- public static BeanInfo getBeanInfo(Class beanClass, int flag)
+ public static BeanInfo getBeanInfo(Class<?> beanClass, int flag)
throws IntrospectionException
{
IntrospectionIncubator ii;
@@ -312,7 +313,7 @@ public class Introspector {
* @throws NullPointerException if clz is null.
* @since 1.2
*/
- public static void flushFromCaches(Class clz)
+ public static void flushFromCaches(Class<?> clz)
{
synchronized (clz)
{
@@ -394,7 +395,7 @@ public class Introspector {
* @param stopClass the class to stop at.
* @return the BeanInfo object representing the class.
*/
- public static BeanInfo getBeanInfo(Class beanClass, Class stopClass)
+ public static BeanInfo getBeanInfo(Class<?> beanClass, Class<?> stopClass)
throws IntrospectionException
{
ExplicitInfo explicit = new ExplicitInfo(beanClass, stopClass);
diff --git a/libjava/classpath/java/beans/PersistenceDelegate.java b/libjava/classpath/java/beans/PersistenceDelegate.java
index 77953b67682..a6f71576349 100644
--- a/libjava/classpath/java/beans/PersistenceDelegate.java
+++ b/libjava/classpath/java/beans/PersistenceDelegate.java
@@ -52,8 +52,8 @@ package java.beans;
public abstract class PersistenceDelegate
{
- protected void initialize(Class type, Object oldInstance, Object newInstance,
- Encoder out)
+ protected void initialize(Class<?> type, Object oldInstance,
+ Object newInstance, Encoder out)
{
if (type != Object.class)
{
diff --git a/libjava/classpath/java/beans/PropertyDescriptor.java b/libjava/classpath/java/beans/PropertyDescriptor.java
index da2ca78ae67..4b586d915de 100644
--- a/libjava/classpath/java/beans/PropertyDescriptor.java
+++ b/libjava/classpath/java/beans/PropertyDescriptor.java
@@ -65,11 +65,11 @@ import java.lang.reflect.Method;
**/
public class PropertyDescriptor extends FeatureDescriptor
{
- Class propertyType;
+ Class<?> propertyType;
Method getMethod;
Method setMethod;
- Class propertyEditorClass;
+ Class<?> propertyEditorClass;
boolean bound;
boolean constrained;
@@ -103,7 +103,7 @@ public class PropertyDescriptor extends FeatureDescriptor
** @exception IntrospectionException if the methods are not found
** or invalid.
**/
- public PropertyDescriptor(String name, Class beanClass)
+ public PropertyDescriptor(String name, Class<?> beanClass)
throws IntrospectionException
{
setName(name);
@@ -159,7 +159,7 @@ public class PropertyDescriptor extends FeatureDescriptor
**/
public PropertyDescriptor(
String name,
- Class beanClass,
+ Class<?> beanClass,
String getMethodName,
String setMethodName)
throws IntrospectionException
@@ -213,7 +213,7 @@ public class PropertyDescriptor extends FeatureDescriptor
** This is the type the get method returns and the set method
** takes in.
**/
- public Class getPropertyType()
+ public Class<?> getPropertyType()
{
return propertyType;
}
@@ -330,7 +330,7 @@ public class PropertyDescriptor extends FeatureDescriptor
}
/** Get the PropertyEditor class. Defaults to null. **/
- public Class getPropertyEditorClass()
+ public Class<?> getPropertyEditorClass()
{
return propertyEditorClass;
}
@@ -341,7 +341,7 @@ public class PropertyDescriptor extends FeatureDescriptor
** @param propertyEditorClass the PropertyEditor class for this
** class to use.
**/
- public void setPropertyEditorClass(Class propertyEditorClass)
+ public void setPropertyEditorClass(Class<?> propertyEditorClass)
{
this.propertyEditorClass = propertyEditorClass;
}
@@ -516,10 +516,10 @@ public class PropertyDescriptor extends FeatureDescriptor
* @return The common property type of the two method.
* @throws IntrospectionException If any of the above requirements are not met.
*/
- private Class checkMethods(Method readMethod, Method writeMethod)
+ private Class<?> checkMethods(Method readMethod, Method writeMethod)
throws IntrospectionException
{
- Class newPropertyType = propertyType;
+ Class<?> newPropertyType = propertyType;
// a valid read method has zero arguments and a non-void return type.
if (readMethod != null)
diff --git a/libjava/classpath/java/beans/PropertyEditorManager.java b/libjava/classpath/java/beans/PropertyEditorManager.java
index da2a5678c5c..0dd3b176dea 100644
--- a/libjava/classpath/java/beans/PropertyEditorManager.java
+++ b/libjava/classpath/java/beans/PropertyEditorManager.java
@@ -83,7 +83,8 @@ import java.awt.Font;
public class PropertyEditorManager
{
- static java.util.Hashtable editors = new java.util.Hashtable();
+ static java.util.Hashtable<Class<?>,Class<?>> editors =
+ new java.util.Hashtable<Class<?>,Class<?>>();
static String[] editorSearchPath = { "gnu.java.beans.editors",
"sun.beans.editors" };
@@ -118,7 +119,7 @@ public class PropertyEditorManager
* will edit.
* @param editorClass the PropertyEditor class.
*/
- public static void registerEditor(Class editedClass, Class editorClass)
+ public static void registerEditor(Class<?> editedClass, Class<?> editorClass)
{
editors.put(editedClass, editorClass);
}
@@ -132,7 +133,7 @@ public class PropertyEditorManager
* @return a PropertyEditor instance that can edit the
* specified class.
*/
- public static PropertyEditor findEditor(Class editedClass)
+ public static PropertyEditor findEditor(Class<?> editedClass)
{
try
{
diff --git a/libjava/classpath/java/beans/SimpleBeanInfo.java b/libjava/classpath/java/beans/SimpleBeanInfo.java
index cfb96048498..56b1f7aa7c7 100644
--- a/libjava/classpath/java/beans/SimpleBeanInfo.java
+++ b/libjava/classpath/java/beans/SimpleBeanInfo.java
@@ -1,5 +1,5 @@
/* java.beans.SimpleBeanInfo
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,6 +40,7 @@ package java.beans;
import java.awt.Image;
import java.awt.Toolkit;
+import java.net.URL;
/**
** SimpleBeanInfo is a class you may extend to more easily
@@ -130,10 +131,16 @@ public class SimpleBeanInfo implements BeanInfo {
** and its BeanInfo are both loaded by the same
** ClassLoader, generally a reasonable assumption.
** @param location the URL relative
- ** @return the Image in question.
+ ** @return the Image in question (possibly <code>null</code>).
**/
- public Image loadImage(String location) {
- return Toolkit.getDefaultToolkit().getImage(getClass().getResource(location));
+ public Image loadImage(String location)
+ {
+ if (location == null)
+ return null;
+ URL url = getClass().getResource(location);
+ if (url == null)
+ return null;
+ return Toolkit.getDefaultToolkit().getImage(url);
}
}
diff --git a/libjava/classpath/java/beans/Statement.java b/libjava/classpath/java/beans/Statement.java
index 62a5ad7b6f8..0a01798adc2 100644
--- a/libjava/classpath/java/beans/Statement.java
+++ b/libjava/classpath/java/beans/Statement.java
@@ -1,5 +1,5 @@
/* Statement.java
- Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -346,16 +346,20 @@ public class Statement
/** Return the statement object. */
public Object getTarget() { return target; }
- /** Return a string representation. */
+ /**
+ * Returns a string representation of this <code>Statement</code>.
+ *
+ * @return A string representation of this <code>Statement</code>.
+ */
public String toString()
{
StringBuffer result = new StringBuffer();
- String targetName = target.getClass().getName();
- if ( targetName.startsWith("java"))
- {
- targetName = targetName.substring(targetName.lastIndexOf('.') + 1);
- }
+ String targetName;
+ if (target != null)
+ targetName = target.getClass().getSimpleName();
+ else
+ targetName = "null";
result.append(targetName);
result.append(".");
@@ -369,10 +373,10 @@ public class Statement
result.append(
( arguments[i] == null ) ? "null" :
( arguments[i] instanceof String ) ? "\"" + arguments[i] + "\"" :
- arguments[i].getClass().getName());
+ arguments[i].getClass().getSimpleName());
sep = ", ";
}
- result.append(")");
+ result.append(");");
return result.toString();
}
diff --git a/libjava/classpath/java/beans/beancontext/BeanContextServicesSupport.java b/libjava/classpath/java/beans/beancontext/BeanContextServicesSupport.java
index 4da523eeb06..f354ff47448 100644
--- a/libjava/classpath/java/beans/beancontext/BeanContextServicesSupport.java
+++ b/libjava/classpath/java/beans/beancontext/BeanContextServicesSupport.java
@@ -46,12 +46,21 @@ import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Locale;
+import java.util.Set;
import java.util.TooManyListenersException;
/**
+ * This is a helper class for implementing a bean context which
+ * supplies services. It is intended to be used either by
+ * subclassing or by calling methods of this implementation
+ * from another.
+ *
* @author Michael Koch
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.2
*/
public class BeanContextServicesSupport
@@ -77,38 +86,39 @@ public class BeanContextServicesSupport
{
private static final long serialVersionUID = 7078212910685744490L;
- private BCSSProxyServiceProvider()
+ private BeanContextServiceProvider provider;
+
+ private BCSSProxyServiceProvider(BeanContextServiceProvider p)
{
+ provider = p;
}
public Iterator getCurrentServiceSelectors (BeanContextServices bcs,
Class serviceClass)
- throws NotImplementedException
{
- throw new Error ("Not implemented");
+ return provider.getCurrentServiceSelectors(bcs, serviceClass);
}
public Object getService (BeanContextServices bcs,
Object requestor,
Class serviceClass,
Object serviceSelector)
- throws NotImplementedException
{
- throw new Error ("Not implemented");
+ return provider.getService(bcs, requestor, serviceClass,
+ serviceSelector);
}
public void releaseService (BeanContextServices bcs,
Object requestor,
Object service)
- throws NotImplementedException
{
- throw new Error ("Not implemented");
+ provider.releaseService(bcs, requestor, service);
}
public void serviceRevoked (BeanContextServiceRevokedEvent bcsre)
- throws NotImplementedException
{
- throw new Error ("Not implemented");
+ if (provider instanceof BeanContextServiceRevokedListener)
+ ((BeanContextServiceRevokedListener) provider).serviceRevoked(bcsre);
}
}
@@ -119,51 +129,233 @@ public class BeanContextServicesSupport
protected BeanContextServiceProvider serviceProvider;
- private BCSSServiceProvider()
+ private Class serviceClass;
+
+ private BCSSServiceProvider(Class serviceClass,
+ BeanContextServiceProvider provider)
{
+ this.serviceClass = serviceClass;
+ serviceProvider = provider;
}
protected BeanContextServiceProvider getServiceProvider()
{
return serviceProvider;
}
+
+ private Class getServiceClass()
+ {
+ return serviceClass;
+ }
+
}
- protected transient ArrayList bcsListeners;
+ /**
+ * Represents a request for a service. This is
+ * a common superclass used by the classes which maintain
+ * the listener-requestor and service-requestor relationships.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ */
+ private static abstract class Request
+ {
+ private Object requestor;
+
+ public Request(Object requestor)
+ {
+ this.requestor = requestor;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof Request)
+ {
+ Request req = (Request) obj;
+ return req.getRequestor().equals(requestor);
+ }
+ return false;
+ }
+
+ public Object getRequestor()
+ {
+ return requestor;
+ }
+
+ }
+
+ /**
+ * Represents a relationship between a service requestor
+ * and a revocation listener.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ */
+ private static class ServiceRequest
+ extends Request
+ {
+
+ private BeanContextServiceRevokedListener listener;
+
+ public ServiceRequest(Object requestor,
+ BeanContextServiceRevokedListener listener)
+ {
+ super(requestor);
+ this.listener = listener;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof ServiceRequest)
+ {
+ ServiceRequest sr = (ServiceRequest) obj;
+ return (super.equals(obj) &&
+ sr.getListener().equals(listener));
+ }
+ return false;
+ }
+
+ public BeanContextServiceRevokedListener getListener()
+ {
+ return listener;
+ }
+ }
+
+ /**
+ * Represents a relationship between a service requestor
+ * and a service instance.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ */
+ private static class ServiceLease
+ extends Request
+ {
+ private Object service;
+
+ public ServiceLease(Object requestor, Object service)
+ {
+ super(requestor);
+ this.service = service;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof ServiceLease)
+ {
+ ServiceLease sl = (ServiceLease) obj;
+ return (super.equals(obj) &&
+ sl.getService().equals(service));
+ }
+ return false;
+ }
+
+ public Object getService()
+ {
+ return service;
+ }
+ }
+
+ /**
+ * A collection of listeners who receive availability
+ * and revocation notifications.
+ */
+ protected transient ArrayList bcsListeners;
+
protected transient BCSSProxyServiceProvider proxy;
+ /**
+ * The number of serializable service providers.
+ */
protected transient int serializable;
+ /**
+ * A map of registered services, linking the service
+ * class to its associated {@link BCSSServiceProvider}.
+ */
protected transient HashMap services;
+ /**
+ * A map of children to a list of services they
+ * have obtained.
+ */
+ private transient HashMap serviceUsers;
+
+ /**
+ * A map of services to {@link ServiceRequest}s.
+ */
+ private transient HashMap serviceRequests;
+
+ /**
+ * A map of {@link ServiceLease}s to providers.
+ */
+ private transient HashMap serviceLeases;
+
+ /**
+ * Construct a {@link BeanContextServicesSupport} instance.
+ */
public BeanContextServicesSupport ()
{
super();
}
+ /**
+ * Construct a {@link BeanContextServicesSupport} instance.
+ *
+ * @param peer the bean context services peer (<code>null</code> permitted).
+ */
public BeanContextServicesSupport (BeanContextServices peer)
{
super(peer);
}
+ /**
+ * Construct a {@link BeanContextServicesSupport} instance.
+ *
+ * @param peer the bean context peer (<code>null</code> permitted).
+ * @param locale the locale (<code>null</code> permitted, equivalent to
+ * the default locale).
+ */
public BeanContextServicesSupport(BeanContextServices peer, Locale locale)
{
super(peer, locale);
}
+ /**
+ * Construct a {@link BeanContextServicesSupport} instance.
+ *
+ * @param peer the bean context peer (<code>null</code> permitted).
+ * @param locale the locale (<code>null</code> permitted, equivalent to
+ * the default locale).
+ * @param dtime a flag indicating whether or not the bean context is in
+ * design time mode.
+ */
public BeanContextServicesSupport(BeanContextServices peer, Locale locale,
boolean dtime)
{
super(peer, locale, dtime);
}
+ /**
+ * Construct a {@link BeanContextServicesSupport} instance.
+ *
+ * @param peer the bean context peer (<code>null</code> permitted).
+ * @param locale the locale (<code>null</code> permitted, equivalent to
+ * the default locale).
+ * @param dtime a flag indicating whether or not the bean context is in
+ * design time mode.
+ * @param visible initial value of the <code>okToUseGui</code> flag.
+ */
public BeanContextServicesSupport(BeanContextServices peer, Locale locale,
boolean dtime, boolean visible)
{
super(peer, locale, dtime, visible);
}
-
+
+ /**
+ * Adds a new listener for service availability and
+ * revocation events.
+ *
+ * @param listener the listener to add.
+ */
public void addBeanContextServicesListener
(BeanContextServicesListener listener)
{
@@ -174,60 +366,168 @@ public class BeanContextServicesSupport
}
}
+ /**
+ * Registers a new service from the specified service provider.
+ * The service is internally associated with the service provider
+ * and a <code>BeanContextServiceAvailableEvent</code> is fired. If
+ * the service is already registered, then this method instead
+ * returns <code>false</code>. This is equivalent to calling
+ * <code>addService(serviceClass, bcsp, true)</code>.
+ *
+ * @param serviceClass the class of the service to be registered.
+ * @param bcsp the provider of the given service.
+ * @return true if the service was registered successfully.
+ * @see #addService(Class, BeanContextServiceProvider, boolean)
+ */
public boolean addService (Class serviceClass,
BeanContextServiceProvider bcsp)
{
return addService(serviceClass, bcsp, true);
}
+ /**
+ * Registers a new service from the specified service provider.
+ * The service is internally associated with the service provider
+ * and (if <code>fireEvent</code> is true) a
+ * <code>BeanContextServiceAvailableEvent</code> is fired. If
+ * the service is already registered, then this method instead
+ * returns <code>false</code>.
+ *
+ * @param serviceClass the class of the service to be registered.
+ * @param bcsp the provider of the given service.
+ * @param fireEvent true if a service availability event should
+ * be fired.
+ * @return true if the service was registered successfully.
+ */
protected boolean addService (Class serviceClass,
BeanContextServiceProvider bcsp,
boolean fireEvent)
{
- synchronized (services)
+ synchronized (globalHierarchyLock)
{
- if (services.containsKey(serviceClass))
- return false;
- services.put(serviceClass, bcsp);
- if (bcsp instanceof Serializable)
- ++serializable;
- fireServiceAdded(serviceClass);
- return true;
+ synchronized (services)
+ {
+ if (services.containsKey(serviceClass))
+ return false;
+ services.put(serviceClass,
+ createBCSSServiceProvider(serviceClass, bcsp));
+ if (bcsp instanceof Serializable)
+ ++serializable;
+ if (fireEvent)
+ fireServiceAdded(serviceClass);
+ return true;
+ }
}
}
+ /**
+ * Deserializes any service providers which are serializable. This
+ * method is called by the <code>readObject</code> method of
+ * {@link BeanContextSupport} prior to deserialization of the children.
+ * Subclasses may envelope its behaviour in order to read further
+ * serialized data to the stream.
+ *
+ * @param oos the stream from which data is being deserialized.
+ * @throws IOException if an I/O error occurs.
+ * @throws ClassNotFoundException if the class of a deserialized object
+ * can not be found.
+ */
protected void bcsPreDeserializationHook (ObjectInputStream ois)
- throws ClassNotFoundException, IOException, NotImplementedException
+ throws ClassNotFoundException, IOException
{
- throw new Error ("Not implemented");
+ serializable = ois.readInt();
+ for (int a = 0; a < serializable; ++a)
+ {
+ BCSSServiceProvider bcsssp = (BCSSServiceProvider) ois.readObject();
+ addService(bcsssp.getServiceClass(), bcsssp.getServiceProvider());
+ }
}
+ /**
+ * Serializes any service providers which are serializable. This
+ * method is called by the <code>writeObject</code> method of
+ * {@link BeanContextSupport} prior to serialization of the children.
+ * Subclasses may envelope its behaviour in order to add further
+ * serialized data to the stream.
+ *
+ * @param oos the stream to which data is being serialized.
+ * @throws IOException if an I/O error occurs.
+ */
protected void bcsPreSerializationHook (ObjectOutputStream oos)
- throws IOException, NotImplementedException
+ throws IOException
{
- throw new Error ("Not implemented");
+ oos.writeInt(serializable);
+ synchronized (services)
+ {
+ Iterator i = services.values().iterator();
+ while (i.hasNext())
+ {
+ BCSSServiceProvider bcsssp = (BCSSServiceProvider) i.next();
+ if (bcsssp.getServiceProvider() instanceof Serializable)
+ oos.writeObject(bcsssp);
+ }
+ }
}
-
+
+ /**
+ * Revokes any services used by a child that has just been removed.
+ * The superclass ({@link BeanContextSupport}) calls this method
+ * when a child has just been successfully removed. Subclasses can
+ * extend this method in order to perform additional operations
+ * on child removal.
+ *
+ * @param child the child being removed.
+ * @param bcsc the support object for the child.
+ */
protected void childJustRemovedHook (Object child,
BeanContextSupport.BCSChild bcsc)
- throws NotImplementedException
{
- throw new Error ("Not implemented");
+ if (child instanceof BeanContextChild)
+ {
+ BeanContextChild bcchild = (BeanContextChild) child;
+ Iterator childServices = ((List) serviceUsers.get(bcchild)).iterator();
+ while (childServices.hasNext())
+ releaseService(bcchild, this, childServices.next());
+ serviceUsers.remove(bcchild);
+ }
}
+ /**
+ * Overrides the {@link BeanContextSupport#createBCSChild} method
+ * so as to use a {@link BCSSChild} instead.
+ *
+ * @param targetChild the child to create the child for.
+ * @param peer the peer which relates to the child if a proxy is used.
+ * @return a new instance of {@link BCSSChild}.
+ */
protected BeanContextSupport.BCSChild createBCSChild (Object targetChild,
Object peer)
{
return new BCSSChild(targetChild, peer);
}
+ /**
+ * Provides a hook so that subclasses can replace the
+ * {@link BCSSServiceProvider} class, used to store registered
+ * service providers, with a subclass without replacing the
+ * {@link #addService(Class, BeanContextServiceProvider)} method.
+ *
+ * @param sc the class of service being registered.
+ * @param bcsp the provider of the service.
+ * @return a instance of {@link BCSSServiceProvider} wrapping the provider.
+ */
protected BeanContextServicesSupport.BCSSServiceProvider
createBCSSServiceProvider (Class sc, BeanContextServiceProvider bcsp)
- throws NotImplementedException
{
- throw new Error ("Not implemented");
+ return new BCSSServiceProvider(sc, bcsp);
}
+ /**
+ * Sends a <code>BeanContextServiceAvailableEvent</code> to all
+ * registered listeners.
+ *
+ * @param bcssae the event to send.
+ */
protected final void fireServiceAdded (BeanContextServiceAvailableEvent bcssae)
{
synchronized (bcsListeners)
@@ -242,12 +542,25 @@ public class BeanContextServicesSupport
}
}
+ /**
+ * Sends a <code>BeanContextServiceAvailableEvent</code> to all
+ * registered listeners.
+ *
+ * @param serviceClass the service that is now available.
+ * @see #fireServiceAdded(BeanContextServiceAvailableEvent)
+ */
protected final void fireServiceAdded (Class serviceClass)
{
fireServiceAdded(new BeanContextServiceAvailableEvent(this,
serviceClass));
}
+ /**
+ * Sends a <code>BeanContextServiceRevokedEvent</code> to all
+ * registered listeners.
+ *
+ * @param event the event to send.
+ */
protected final void fireServiceRevoked(BeanContextServiceRevokedEvent event)
{
synchronized (bcsListeners)
@@ -259,9 +572,26 @@ public class BeanContextServicesSupport
= (BeanContextServicesListener) bcsListeners.get(i);
bcsl.serviceRevoked(event);
}
+ List requests = (List) serviceRequests.get(event.getServiceClass());
+ if (requests != null)
+ {
+ Iterator i = requests.iterator();
+ while (i.hasNext())
+ {
+ ServiceRequest r = (ServiceRequest) i.next();
+ r.getListener().serviceRevoked(event);
+ }
+ }
}
}
+ /**
+ * Sends a <code>BeanContextServiceRevokedEvent</code> to all
+ * registered listeners.
+ *
+ * @param serviceClass the service that has been revoked.
+ * @see #fireServiceRevoked(BeanContextServiceRevokedEvent)
+ */
protected final void fireServiceRevoked (Class serviceClass,
boolean revokeNow)
{
@@ -269,51 +599,166 @@ public class BeanContextServicesSupport
revokeNow));
}
+ /**
+ * Returns the services peer given at construction time,
+ * or <code>null</code> if no peer was given.
+ *
+ * @return the {@link BeanContextServices} peer.
+ */
public BeanContextServices getBeanContextServicesPeer ()
- throws NotImplementedException
{
- throw new Error ("Not implemented");
+ return (BeanContextServices) beanContextChildPeer;
}
+ /**
+ * Returns <code>child</code> as an instance of
+ * {@link BeanContextServicesListener}, or <code>null</code> if
+ * <code>child</code> does not implement that interface.
+ *
+ * @param child the child (<code>null</code> permitted).
+ *
+ * @return The child cast to {@link BeanContextServicesListener}.
+ */
protected static final BeanContextServicesListener
- getChildBeanContextServicesListener (Object child)
- throws NotImplementedException
+ getChildBeanContextServicesListener(Object child)
{
- throw new Error ("Not implemented");
+ if (child instanceof BeanContextServicesListener)
+ return (BeanContextServicesListener) child;
+ else
+ return null;
}
+ /**
+ * Returns an iterator over the currently available
+ * services.
+ *
+ * @return an iterator over the currently available services.
+ */
public Iterator getCurrentServiceClasses ()
{
- synchronized (services)
+ synchronized (globalHierarchyLock)
{
- return services.keySet().iterator();
+ synchronized (services)
+ {
+ return services.keySet().iterator();
+ }
}
}
+ /**
+ * Returns an iterator over the service selectors of the service
+ * provider for the given service. The iterator is actually
+ * obtained by calling the
+ * {@link BeanContextServiceProvider#getCurrentServiceSelectors}
+ * of the provider itself. If the specified service is not available,
+ * <code>null</code> is returned.
+ *
+ * @param serviceClass the service whose provider's selectors should
+ * be iterated over.
+ * @return an {@link Iterator} over the service selectors of the
+ * provider of the given service.
+ */
public Iterator getCurrentServiceSelectors (Class serviceClass)
{
- synchronized (services)
+ synchronized (globalHierarchyLock)
{
- // FIXME: what if service does not exist? Must write a test.
- BeanContextServiceProvider bcsp
- = (BeanContextServiceProvider) services.get(serviceClass);
- return bcsp.getCurrentServiceSelectors(this, serviceClass);
+ synchronized (services)
+ {
+ BeanContextServiceProvider bcsp
+ = ((BCSSServiceProvider)
+ services.get(serviceClass)).getServiceProvider();
+ if (bcsp == null)
+ return null;
+ else
+ return bcsp.getCurrentServiceSelectors(this, serviceClass);
+ }
}
}
+ /**
+ * Retrieves the specified service. If a provider for the service
+ * is registered in this context, then the request is passed on to
+ * the provider and the service returned. Otherwise, the request
+ * is delegated to a parent {@link BeanContextServices}, if possible.
+ * If the service can not be found at all, then <code>null</code>
+ * is returned.
+ *
+ * @param child the child obtaining the reference.
+ * @param requestor the requestor of the service, which may be the
+ * child itself.
+ * @param serviceClass the service being requested.
+ * @param serviceSelector an additional service-dependent parameter
+ * (may be <code>null</code> if not appropriate).
+ * @param bcsrl a listener used to notify the requestor that the service
+ * has since been revoked.
+ * @return a reference to the service requested, or <code>null</code>.
+ * @throws TooManyListenersException according to Sun's documentation.
+ */
public Object getService (BeanContextChild child, Object requestor,
Class serviceClass, Object serviceSelector,
BeanContextServiceRevokedListener bcsrl)
- throws TooManyListenersException, NotImplementedException
+ throws TooManyListenersException
{
- throw new Error ("Not implemented");
+ synchronized (globalHierarchyLock)
+ {
+ synchronized (services)
+ {
+ Object service;
+ BeanContextServiceProvider provider = ((BCSSServiceProvider)
+ services.get(serviceClass)).getServiceProvider();
+ if (provider != null)
+ {
+ service = provider.getService(this, requestor, serviceClass,
+ serviceSelector);
+ List childServices = (List) serviceUsers.get(child);
+ if (childServices == null)
+ {
+ childServices = new ArrayList();
+ serviceUsers.put(child, childServices);
+ }
+ childServices.add(serviceClass);
+ }
+ else
+ {
+ BeanContextServices peer = getBeanContextServicesPeer();
+ if (peer != null)
+ service = peer.getService(child, requestor, serviceClass,
+ serviceSelector, bcsrl);
+ else
+ service = null;
+ }
+ if (service != null)
+ {
+ ServiceRequest request = new ServiceRequest(requestor, bcsrl);
+ Set requests = (Set) serviceRequests.get(serviceClass);
+ if (requests == null)
+ {
+ requests = new HashSet();
+ serviceRequests.put(serviceClass, requests);
+ }
+ requests.add(request);
+ ServiceLease lease = new ServiceLease(requestor, service);
+ serviceLeases.put(lease, provider);
+ }
+ return service;
+ }
+ }
}
+ /**
+ * Returns true if the specified service is available.
+ *
+ * @param serviceClass the service to check for.
+ * @return true if the service is available.
+ */
public boolean hasService (Class serviceClass)
{
- synchronized (services)
+ synchronized (globalHierarchyLock)
{
- return services.containsKey(serviceClass);
+ synchronized (services)
+ {
+ return services.containsKey(serviceClass);
+ }
}
}
@@ -323,25 +768,62 @@ public class BeanContextServicesSupport
bcsListeners = new ArrayList();
services = new HashMap();
+ serviceUsers = new HashMap();
+ serviceRequests = new HashMap();
+ serviceLeases = new HashMap();
}
- protected void initializeBeanContextResources ()
- throws NotImplementedException
+ /**
+ * Subclasses may override this method to allocate resources
+ * from the nesting bean context.
+ */
+ protected void initializeBeanContextResources()
{
- throw new Error ("Not implemented");
+ /* Purposefully left empty */
}
- protected void releaseBeanContextResources ()
- throws NotImplementedException
+ /**
+ * Relinquishes any resources obtained from the parent context.
+ * Specifically, those services obtained from the parent are revoked.
+ * Subclasses may override this method to deallocate resources
+ * from the nesting bean context.
+ */
+ protected void releaseBeanContextResources()
{
- throw new Error ("Not implemented");
+ /* Purposefully left empty */
}
+ /**
+ * Releases the reference to a service held by a
+ * {@link BeanContextChild} (or an arbitrary object associated
+ * with it). It simply calls the appropriate method on the
+ * underlying provider.
+ *
+ * @param child the child who holds the reference.
+ * @param requestor the object that requested the reference.
+ * @param service the service being released.
+ */
public void releaseService (BeanContextChild child, Object requestor,
Object service)
- throws NotImplementedException
{
- throw new Error ("Not implemented");
+ synchronized (globalHierarchyLock)
+ {
+ synchronized (services)
+ {
+ ServiceLease lease = new ServiceLease(requestor, service);
+ BeanContextServiceProvider provider = (BeanContextServiceProvider)
+ serviceLeases.get(lease);
+ if (provider != null)
+ provider.releaseService(this, requestor, service);
+ else
+ {
+ BeanContextServices peer = getBeanContextServicesPeer();
+ if (peer != null)
+ peer.releaseService(child, requestor, service);
+ }
+ serviceLeases.remove(lease);
+ }
+ }
}
public void removeBeanContextServicesListener
@@ -349,17 +831,35 @@ public class BeanContextServicesSupport
{
synchronized (bcsListeners)
{
- int index = bcsListeners.indexOf(listener);
- if (index > -1)
- bcsListeners.remove(index);
+ bcsListeners.remove(listener);
}
}
+ /**
+ * Revokes the given service. A {@link BeanContextServiceRevokedEvent} is
+ * emitted to all registered {@link BeanContextServiceRevokedListener}s
+ * and {@link BeanContextServiceListener}s. If <code>revokeCurrentServicesNow</code>
+ * is true, termination of the service is immediate. Otherwise, prior
+ * acquisitions of the service by requestors remain valid.
+ *
+ * @param serviceClass the service to revoke.
+ * @param bcsp the provider of the revoked service.
+ * @param revokeCurrentServicesNow true if this is an exceptional circumstance
+ * where service should be immediately revoked.
+ */
public void revokeService (Class serviceClass, BeanContextServiceProvider bcsp,
boolean revokeCurrentServicesNow)
- throws NotImplementedException
{
- throw new Error ("Not implemented");
+ synchronized (globalHierarchyLock)
+ {
+ synchronized (services)
+ {
+ fireServiceRevoked(serviceClass, revokeCurrentServicesNow);
+ services.remove(serviceClass);
+ if (bcsp instanceof Serializable)
+ --serializable;
+ }
+ }
}
public void serviceAvailable (BeanContextServiceAvailableEvent bcssae)
diff --git a/libjava/classpath/java/beans/beancontext/BeanContextSupport.java b/libjava/classpath/java/beans/beancontext/BeanContextSupport.java
index a12c078df6a..d57f5f8842a 100644
--- a/libjava/classpath/java/beans/beancontext/BeanContextSupport.java
+++ b/libjava/classpath/java/beans/beancontext/BeanContextSupport.java
@@ -38,8 +38,6 @@ exception statement from your version. */
package java.beans.beancontext;
-import gnu.classpath.NotImplementedException;
-
import java.beans.Beans;
import java.beans.DesignMode;
import java.beans.PropertyChangeEvent;
@@ -57,6 +55,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
import java.util.Locale;
/**
@@ -74,20 +73,52 @@ public class BeanContextSupport extends BeanContextChildSupport
{
private static final long serialVersionUID = -4879613978649577204L;
- // This won't show up in japi, but we mark it as a stub anyway,
- // so that searches for NotImplementedException will find it.
+ /**
+ * Deserializes a stored bean context. Hook methods are provided to allow
+ * subclasses to perform their own deserialization after the default
+ * deserialization but prior to the deserialization of the children. Note that
+ * {@link #readChildren(ObjectInputStream)} is only called if there
+ * is no distinct peer. If there is, the peer is expected to call
+ * the method instead.
+ *
+ * @param s the stream to deserialize.
+ * @throws ClassNotFoundException if the class of an object being deserialized
+ * could not be found.
+ * @throws IOException if an I/O error occurs.
+ */
private void readObject (ObjectInputStream s)
- throws ClassNotFoundException, IOException, NotImplementedException
+ throws ClassNotFoundException, IOException
{
- throw new Error ("Not implemented");
+ s.defaultReadObject();
+ bcsPreDeserializationHook(s);
+ BeanContext peer = getBeanContextPeer();
+ if (peer == null || peer == this)
+ readChildren(s);
}
- // This won't show up in japi, but we mark it as a stub anyway,
- // so that searches for NotImplementedException will find it.
+ /**
+ * Serializes a bean context. Hook methods are provided to allow
+ * subclasses to perform their own serialization after the default
+ * serialization but prior to serialization of the children. Note that
+ * {@link #writeChildren(ObjectOutputStream)} is only called if there
+ * is no distinct peer. If there is, the peer is expected to call
+ * the method instead.
+ *
+ * @param s the stream to serialize.
+ * @throws ClassNotFoundException if the class of an object being deserialized
+ * could not be found.
+ * @throws IOException if an I/O error occurs.
+ */
private void writeObject (ObjectOutputStream s)
- throws ClassNotFoundException, IOException, NotImplementedException
+ throws ClassNotFoundException, IOException
{
- throw new Error ("Not implemented");
+ serializing = true;
+ s.defaultWriteObject();
+ bcsPreSerializationHook(s);
+ BeanContext peer = getBeanContextPeer();
+ if (peer == null || peer == this)
+ writeChildren(s);
+ serializing = false;
}
protected class BCSChild implements Serializable
@@ -102,6 +133,12 @@ public class BeanContextSupport extends BeanContextChildSupport
this.targetChild = targetChild;
this.peer = peer;
}
+
+ private Object getTargetChild()
+ {
+ return targetChild;
+ }
+
}
protected static final class BCSIterator implements Iterator
@@ -139,47 +176,68 @@ public class BeanContextSupport extends BeanContextChildSupport
protected transient boolean okToUseGui;
+ private transient boolean serializing;
+
/**
* Construct a BeanContextSupport instance.
*/
public BeanContextSupport ()
{
- this (null, null, true, true);
+ this (null, null, false, true);
}
/**
* Construct a BeanContextSupport instance.
+ *
+ * @param peer the bean context peer (<code>null</code> permitted).
*/
- public BeanContextSupport (BeanContext peer)
+ public BeanContextSupport(BeanContext peer)
{
- this (peer, null, true, true);
+ this (peer, null, false, true);
}
/**
* Construct a BeanContextSupport instance.
+ *
+ * @param peer the bean context peer (<code>null</code> permitted).
+ * @param locale the locale (<code>null</code> permitted, equivalent to
+ * the default locale).
*/
- public BeanContextSupport (BeanContext peer, Locale lcle)
+ public BeanContextSupport (BeanContext peer, Locale locale)
{
- this (peer, lcle, true, true);
+ this (peer, locale, false, true);
}
/**
* Construct a BeanContextSupport instance.
+ *
+ * @param peer the bean context peer (<code>null</code> permitted).
+ * @param locale the locale (<code>null</code> permitted, equivalent to
+ * the default locale).
+ * @param dtime a flag indicating whether or not the bean context is in
+ * design time mode.
*/
- public BeanContextSupport (BeanContext peer, Locale lcle, boolean dtime)
+ public BeanContextSupport (BeanContext peer, Locale locale, boolean dtime)
{
- this (peer, lcle, dtime, true);
+ this (peer, locale, dtime, true);
}
/**
* Construct a BeanContextSupport instance.
+ *
+ * @param peer the bean context peer (<code>null</code> permitted).
+ * @param locale the locale (<code>null</code> permitted, equivalent to
+ * the default locale).
+ * @param dtime a flag indicating whether or not the bean context is in
+ * design time mode.
+ * @param visible initial value of the <code>okToUseGui</code> flag.
*/
- public BeanContextSupport (BeanContext peer, Locale lcle, boolean dtime,
+ public BeanContextSupport (BeanContext peer, Locale locale, boolean dtime,
boolean visible)
{
super(peer);
- locale = lcle == null ? Locale.getDefault() : lcle;
+ this.locale = locale == null ? Locale.getDefault() : locale;
designTime = dtime;
okToUseGui = visible;
@@ -309,7 +367,6 @@ public class BeanContextSupport extends BeanContextChildSupport
* told not to use it.
*/
public boolean avoidingGui()
- throws NotImplementedException
{
return needsGui() && (!okToUseGui);
}
@@ -322,22 +379,49 @@ public class BeanContextSupport extends BeanContextChildSupport
}
}
+ /**
+ * Subclasses may use this method to perform their own deserialization
+ * after the default deserialization process has taken place, but
+ * prior to the deserialization of the children. It should not
+ * be used to replace the implementation of <code>readObject</code>
+ * in the subclass.
+ *
+ * @param ois the input stream.
+ * @throws ClassNotFoundException if the class of an object being deserialized
+ * could not be found.
+ * @throws IOException if an I/O error occurs.
+ */
protected void bcsPreDeserializationHook (ObjectInputStream ois)
- throws ClassNotFoundException, IOException, NotImplementedException
+ throws ClassNotFoundException, IOException
{
- throw new Error ("Not implemented");
+ /* Purposefully left empty */
}
+ /**
+ * Subclasses may use this method to perform their own serialization
+ * after the default serialization process has taken place, but
+ * prior to the serialization of the children. It should not
+ * be used to replace the implementation of <code>writeObject</code>
+ * in the subclass.
+ *
+ * @param oos the output stream.
+ * @throws IOException if an I/O error occurs.
+ */
protected void bcsPreSerializationHook (ObjectOutputStream oos)
- throws IOException, NotImplementedException
+ throws IOException
{
- throw new Error ("Not implemented");
+ /* Purposefully left empty */
}
+ /**
+ * Called when a child is deserialized.
+ *
+ * @param child the deserialized child.
+ * @param bcsc the deserialized context wrapper for the child.
+ */
protected void childDeserializedHook (Object child, BeanContextSupport.BCSChild bcsc)
- throws NotImplementedException
{
- throw new Error ("Not implemented");
+ // Do nothing in the base class.
}
protected void childJustAddedHook (Object child, BeanContextSupport.BCSChild bcsc)
@@ -404,10 +488,25 @@ public class BeanContextSupport extends BeanContextChildSupport
return new BCSChild(targetChild, peer);
}
+ /**
+ * Deserializes objects (written by {@link #serialize(ObjectOutputStream,
+ * Collection)}) and adds them to the specified collection.
+ *
+ * @param ois the input stream (<code>null</code> not permitted).
+ * @param coll the collection to add the objects to (<code>null</code> not
+ * permitted).
+ *
+ * @throws ClassNotFoundException
+ * @throws IOException
+ *
+ * @see #serialize(ObjectOutputStream, Collection)
+ */
protected final void deserialize (ObjectInputStream ois, Collection coll)
- throws ClassNotFoundException, IOException, NotImplementedException
+ throws ClassNotFoundException, IOException
{
- throw new Error ("Not implemented");
+ int itemCount = ois.readInt();
+ for (int i = 0; i < itemCount; i++)
+ coll.add(ois.readObject());
}
/**
@@ -447,46 +546,127 @@ public class BeanContextSupport extends BeanContextChildSupport
}
}
- public BeanContext getBeanContextPeer ()
- throws NotImplementedException
+ /**
+ * Returns the bean context peer.
+ *
+ * @return The bean context peer.
+ *
+ * @see BeanContextChildSupport#beanContextChildPeer
+ */
+ public BeanContext getBeanContextPeer()
{
- throw new Error ("Not implemented");
+ return (BeanContext) beanContextChildPeer;
}
- protected static final BeanContextChild getChildBeanContextChild (Object child)
- throws NotImplementedException
+ /**
+ * Returns the {@link BeanContextChild} implementation for the given child.
+ *
+ * @param child the child (<code>null</code> permitted).
+ *
+ * @return The bean context child.
+ *
+ * @throws IllegalArgumentException if <code>child</code> implements both
+ * the {@link BeanContextChild} and {@link BeanContextProxy} interfaces.
+ */
+ protected static final BeanContextChild getChildBeanContextChild(Object child)
{
- throw new Error ("Not implemented");
+ if (child == null)
+ return null;
+ if (child instanceof BeanContextChild && child instanceof BeanContextProxy)
+ throw new IllegalArgumentException("Child cannot implement "
+ + "BeanContextChild and BeanContextProxy simultaneously.");
+ if (child instanceof BeanContextChild)
+ return (BeanContextChild) child;
+ if (child instanceof BeanContextProxy)
+ return ((BeanContextProxy) child).getBeanContextProxy();
+ return null;
}
- protected static final BeanContextMembershipListener getChildBeanContextMembershipListener (Object child)
- throws NotImplementedException
+ /**
+ * Returns <code>child</code> as an instance of
+ * {@link BeanContextMembershipListener}, or <code>null</code> if
+ * <code>child</code> does not implement that interface.
+ *
+ * @param child the child (<code>null</code> permitted).
+ *
+ * @return The child cast to {@link BeanContextMembershipListener}.
+ */
+ protected static final BeanContextMembershipListener
+ getChildBeanContextMembershipListener(Object child)
{
- throw new Error ("Not implemented");
+ if (child instanceof BeanContextMembershipListener)
+ return (BeanContextMembershipListener) child;
+ else
+ return null;
}
- protected static final PropertyChangeListener getChildPropertyChangeListener (Object child)
- throws NotImplementedException
+ /**
+ * Returns <code>child</code> as an instance of
+ * {@link PropertyChangeListener}, or <code>null</code> if <code>child</code>
+ * does not implement that interface.
+ *
+ * @param child the child (<code>null</code> permitted).
+ *
+ * @return The child cast to {@link PropertyChangeListener}.
+ */
+ protected static final PropertyChangeListener getChildPropertyChangeListener(
+ Object child)
{
- throw new Error ("Not implemented");
+ if (child instanceof PropertyChangeListener)
+ return (PropertyChangeListener) child;
+ else
+ return null;
}
- protected static final Serializable getChildSerializable (Object child)
- throws NotImplementedException
+ /**
+ * Returns <code>child</code> as an instance of {@link Serializable}, or
+ * <code>null</code> if <code>child</code> does not implement that
+ * interface.
+ *
+ * @param child the child (<code>null</code> permitted).
+ *
+ * @return The child cast to {@link Serializable}.
+ */
+ protected static final Serializable getChildSerializable(Object child)
{
- throw new Error ("Not implemented");
+ if (child instanceof Serializable)
+ return (Serializable) child;
+ else
+ return null;
}
- protected static final VetoableChangeListener getChildVetoableChangeListener (Object child)
- throws NotImplementedException
+ /**
+ * Returns <code>child</code> as an instance of
+ * {@link VetoableChangeListener}, or <code>null</code> if <code>child</code>
+ * does not implement that interface.
+ *
+ * @param child the child (<code>null</code> permitted).
+ *
+ * @return The child cast to {@link VetoableChangeListener}.
+ */
+ protected static final VetoableChangeListener getChildVetoableChangeListener(
+ Object child)
{
- throw new Error ("Not implemented");
+ if (child instanceof VetoableChangeListener)
+ return (VetoableChangeListener) child;
+ else
+ return null;
}
- protected static final Visibility getChildVisibility (Object child)
- throws NotImplementedException
+ /**
+ * Returns <code>child</code> as an instance of {@link Visibility}, or
+ * <code>null</code> if <code>child</code> does not implement that interface.
+ *
+ * @param child the child (<code>null</code> permitted).
+ *
+ * @return The child cast to {@link Visibility}.
+ */
+ protected static final Visibility getChildVisibility(Object child)
{
- throw new Error ("Not implemented");
+ if (child instanceof Visibility)
+ return (Visibility) child;
+ else
+ return null;
}
public Locale getLocale ()
@@ -534,7 +714,15 @@ public class BeanContextSupport extends BeanContextChildSupport
return Beans.instantiate(getClass().getClassLoader(), beanName, this);
}
- public boolean isDesignTime ()
+ /**
+ * Returns <code>true</code> if the <code>BeanContext</code> is in
+ * design time mode, and <code>false</code> if it is in runtime mode.
+ *
+ * @return A boolean.
+ *
+ * @see #setDesignTime(boolean)
+ */
+ public boolean isDesignTime()
{
return designTime;
}
@@ -552,10 +740,15 @@ public class BeanContextSupport extends BeanContextChildSupport
}
}
- public boolean isSerializing ()
- throws NotImplementedException
+ /**
+ * Returns true if the bean context is in the process
+ * of being serialized.
+ *
+ * @return true if the context is being serialized.
+ */
+ public boolean isSerializing()
{
- throw new Error ("Not implemented");
+ return serializing;
}
public Iterator iterator ()
@@ -600,10 +793,33 @@ public class BeanContextSupport extends BeanContextChildSupport
remove(pce.getSource(), false);
}
+ /**
+ * Deerializes the children using the
+ * {@link #deserialize(ObjectInputStream, Collection} method
+ * and then calls {@link childDeserializedHook(Object, BCSChild)}
+ * for each child deserialized.
+ *
+ * @param oos the output stream.
+ * @throws IOException if an I/O error occurs.
+ */
public final void readChildren (ObjectInputStream ois)
- throws IOException, ClassNotFoundException, NotImplementedException
+ throws IOException, ClassNotFoundException
{
- throw new Error ("Not implemented");
+ List temp = new ArrayList();
+ deserialize(ois, temp);
+ Iterator i = temp.iterator();
+ synchronized (globalHierarchyLock)
+ {
+ synchronized (children)
+ {
+ while (i.hasNext())
+ {
+ BCSChild bcs = (BCSChild) i.next();
+ childDeserializedHook(bcs.getTargetChild(), bcs);
+ children.put(bcs.getTargetChild(), bcs);
+ }
+ }
+ }
}
/**
@@ -646,7 +862,7 @@ public class BeanContextSupport extends BeanContextChildSupport
* This method is synchronized over the global hierarchy lock.
* </p>
*
- * @param targetChild the child to add.
+ * @param targetChild the child to remove.
* @param callChildSetBC true if the <code>setBeanContext()</code>
* method of the child should be called.
* @return false if the child doesn't exist.
@@ -722,17 +938,55 @@ public class BeanContextSupport extends BeanContextChildSupport
throw new UnsupportedOperationException();
}
- protected final void serialize (ObjectOutputStream oos, Collection coll)
- throws IOException, NotImplementedException
+ /**
+ * Writes the items in the collection to the specified output stream. Items
+ * in the collection that are not instances of {@link Serializable}
+ * (this includes <code>null</code>) are simply ignored.
+ *
+ * @param oos the output stream (<code>null</code> not permitted).
+ * @param coll the collection (<code>null</code> not permitted).
+ *
+ * @throws IOException
+ *
+ * @see #deserialize(ObjectInputStream, Collection)
+ */
+ protected final void serialize(ObjectOutputStream oos, Collection coll)
+ throws IOException
{
- throw new Error ("Not implemented");
+ Object[] items = coll.toArray();
+ int itemCount = 0;
+ for (int i = 0; i < items.length; i++)
+ {
+ if (items[i] instanceof Serializable)
+ itemCount++;
+ }
+ oos.writeInt(itemCount);
+ for (int i = 0; i < items.length; i++)
+ {
+ if (items[i] instanceof Serializable)
+ oos.writeObject(items[i]);
+ }
}
- public void setDesignTime (boolean dtime)
+ /**
+ * Sets the flag that indicates whether or not the
+ * <code>BeanContext</code> is in design mode. If the flag changes
+ * value, a {@link PropertyChangeEvent} (with the property name 'designMode')
+ * is sent to registered listeners. Note that the property name used here
+ * does NOT match the specification in the {@link DesignMode} interface, we
+ * match the reference implementation instead - see bug parade entry 4295174.
+ *
+ * @param dtime the new value for the flag.
+ *
+ * @see #isDesignTime()
+ */
+ public void setDesignTime(boolean dtime)
{
boolean save = designTime;
designTime = dtime;
- firePropertyChange(DesignMode.PROPERTYNAME, Boolean.valueOf(save),
+ // note that we use the same property name as Sun's implementation,
+ // even though this is a known bug: see bug parade entry 4295174
+ firePropertyChange("designMode", Boolean.valueOf(save),
Boolean.valueOf(dtime));
}
@@ -755,7 +1009,12 @@ public class BeanContextSupport extends BeanContextChildSupport
}
}
- public Object[] toArray ()
+ /**
+ * Returns an array containing the children of this <code>BeanContext</code>.
+ *
+ * @return An array containing the children.
+ */
+ public Object[] toArray()
{
synchronized (children)
{
@@ -763,10 +1022,16 @@ public class BeanContextSupport extends BeanContextChildSupport
}
}
+ /**
+ * Populates, then returns, the supplied array with the children of this
+ * <code>BeanContext</code>. If the array is too short to hold the
+ * children, a new array is allocated and returned. If the array is too
+ * long, it is padded with <code>null</code> items at the end.
+ *
+ * @param array an array to populate (<code>null</code> not permitted).
+ */
public Object[] toArray(Object[] array)
- throws NotImplementedException
{
- // This implementation is incorrect, I think.
synchronized (children)
{
return children.keySet().toArray(array);
@@ -795,9 +1060,20 @@ public class BeanContextSupport extends BeanContextChildSupport
/* Purposefully left empty */
}
+ /**
+ * Serializes the children using the
+ * {@link #serialize(ObjectOutputStream, Collection} method.
+ *
+ * @param oos the output stream.
+ * @throws IOException if an I/O error occurs.
+ */
public final void writeChildren (ObjectOutputStream oos)
- throws IOException, NotImplementedException
+ throws IOException
{
- throw new Error ("Not implemented");
+ synchronized (children)
+ {
+ serialize(oos, children.values());
+ }
}
+
}
diff --git a/libjava/classpath/java/io/CharArrayWriter.java b/libjava/classpath/java/io/CharArrayWriter.java
index 68e693b4a1a..0eead3ad35d 100644
--- a/libjava/classpath/java/io/CharArrayWriter.java
+++ b/libjava/classpath/java/io/CharArrayWriter.java
@@ -267,7 +267,7 @@ public class CharArrayWriter extends Writer
* sequence is wrapped around an input buffer, the results will
* depend on the current position and length of that buffer.
*
- * @param cs the character sequence to append. If cs is null,
+ * @param seq the character sequence to append. If seq is null,
* then the string "null" (the string representation of null)
* is appended.
* @return a reference to this object.
@@ -291,10 +291,10 @@ public class CharArrayWriter extends Writer
* output stream underlying this writer, starting and ending at the
* specified positions within the sequence. The behaviour of this
* method matches the behaviour of writing the result of
- * <code>append(cs.subSequence(start,end))</code> when the sequence
+ * <code>append(seq.subSequence(start,end))</code> when the sequence
* is not null.
*
- * @param cs the character sequence to append. If cs is null,
+ * @param seq the character sequence to append. If seq is null,
* then the string "null" (the string representation of null)
* is appended.
* @param start the index of the first Unicode character to use from
diff --git a/libjava/classpath/java/io/DeleteFileHelper.java b/libjava/classpath/java/io/DeleteFileHelper.java
index d73628c4973..6e33adce801 100644
--- a/libjava/classpath/java/io/DeleteFileHelper.java
+++ b/libjava/classpath/java/io/DeleteFileHelper.java
@@ -1,5 +1,5 @@
/* DeleteFileHelper.java -- Helper class to delete files on VM exit
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,22 +40,22 @@ package java.io;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
-import java.util.Iterator;
/**
* @author Guilhem Lavaux (guilhem@kaffe.org)
* @author Jeroen Frijters (jeroen@sumatra.nl)
* @author Michael Koch (konqueror@gmx.de)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
final class DeleteFileHelper extends Thread
{
- private static ArrayList filesToDelete;
+ private static ArrayList<File> filesToDelete;
static synchronized void add(File file)
{
if (filesToDelete == null)
{
- filesToDelete = new ArrayList();
+ filesToDelete = new ArrayList<File>();
AccessController.doPrivileged(new PrivilegedAction()
{
@@ -81,13 +81,10 @@ final class DeleteFileHelper extends Thread
private static synchronized void deleteFiles()
{
- Iterator it = filesToDelete.iterator();
-
- while (it.hasNext())
+ for (File file : filesToDelete)
{
try
{
- File file = (File) it.next();
file.delete();
}
catch (Exception e)
diff --git a/libjava/classpath/java/io/File.java b/libjava/classpath/java/io/File.java
index ce56876cc22..5d1b3ec8516 100644
--- a/libjava/classpath/java/io/File.java
+++ b/libjava/classpath/java/io/File.java
@@ -60,7 +60,7 @@ import java.net.URL;
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Tom Tromey (tromey@cygnus.com)
*/
-public class File implements Serializable, Comparable
+public class File implements Serializable, Comparable<File>
{
private static final long serialVersionUID = 301077366599181567L;
@@ -286,7 +286,8 @@ public class File implements Serializable, Comparable
// example, is a valid and minimal path).
if (plen > 1 && p.charAt (plen - 1) == separatorChar)
{
- if (! (separatorChar == '\\' && plen == 3 && p.charAt (1) == ':'))
+ if (! (separatorChar == '\\' && ((plen == 3 && p.charAt(1) == ':')
+ || (plen == 2 && p.charAt(0) == separatorChar))))
return p.substring (0, plen - 1);
}
else
@@ -303,7 +304,16 @@ public class File implements Serializable, Comparable
{
dupIndex++;
if (dupIndex == plen)
- return newpath.toString();
+ {
+ if ((separatorChar == '\\'
+ && newpath.length() == 2
+ && newpath.charAt(1) == ':')
+ || (separatorChar != '\\' && newpath.length() == 0))
+ {
+ newpath.append(separatorChar);
+ }
+ return newpath.toString();
+ }
}
newpath.append(separatorChar);
last = dupIndex;
@@ -315,7 +325,9 @@ public class File implements Serializable, Comparable
int end;
if (plen > 1 && p.charAt (plen - 1) == separatorChar)
{
- if (separatorChar == '\\' && plen == 3 && p.charAt (1) == ':')
+ if (separatorChar == '\\'
+ && ((plen == 3 && p.charAt(1) == ':')
+ || (plen == 2 && p.charAt(0) == separatorChar)))
end = plen;
else
end = plen - 1;
@@ -427,45 +439,8 @@ public class File implements Serializable, Comparable
{
if (isAbsolute())
return path;
- else if (separatorChar == '\\'
- && path.length() > 0 && path.charAt (0) == '\\')
- {
- // On Windows, even if the path starts with a '\\' it is not
- // really absolute until we prefix the drive specifier from
- // the current working directory to it.
- return System.getProperty ("user.dir").substring (0, 2) + path;
- }
- else if (separatorChar == '\\'
- && path.length() > 1 && path.charAt (1) == ':'
- && ((path.charAt (0) >= 'a' && path.charAt (0) <= 'z')
- || (path.charAt (0) >= 'A' && path.charAt (0) <= 'Z')))
- {
- // On Windows, a process has a current working directory for
- // each drive and a path like "G:foo\bar" would mean the
- // absolute path "G:\wombat\foo\bar" if "\wombat" is the
- // working directory on the G drive.
- String drvDir = null;
- try
- {
- drvDir = new File (path.substring (0, 2)).getCanonicalPath();
- }
- catch (IOException e)
- {
- drvDir = path.substring (0, 2) + "\\";
- }
-
- // Note: this would return "C:\\." for the path "C:.", if "\"
- // is the working folder on the C drive, but this is
- // consistent with what Sun's JRE 1.4.1.01 actually returns!
- if (path.length() > 2)
- return drvDir + '\\' + path.substring (2, path.length());
- else
- return drvDir;
- }
- else if (path.equals(""))
- return System.getProperty ("user.dir");
else
- return System.getProperty ("user.dir") + separatorChar + path;
+ return VMFile.getAbsolutePath(path);
}
/**
@@ -657,15 +632,7 @@ public class File implements Serializable, Comparable
*/
public boolean isAbsolute()
{
- if (separatorChar == '\\')
- return path.startsWith(dupSeparator) ||
- (path.length() > 2 &&
- ((path.charAt(0) >= 'a' && path.charAt(0) <= 'z') ||
- (path.charAt(0) >= 'A' && path.charAt(0) <= 'Z')) &&
- path.charAt(1) == ':' &&
- path.charAt(2) == '\\');
- else
- return path.startsWith(separator);
+ return VMFile.isAbsolute(path);
}
/**
@@ -787,8 +754,9 @@ public class File implements Serializable, Comparable
String files[] = VMFile.list(path);
// Check if an error occured in listInternal().
+ // This is an unreadable directory, pretend there is nothing inside.
if (files == null)
- return null;
+ return new String[0];
if (filter == null)
return files;
@@ -998,14 +966,7 @@ public class File implements Serializable, Comparable
*/
public URL toURL() throws MalformedURLException
{
- // On Win32, Sun's JDK returns URLs of the form "file:/c:/foo/bar.txt",
- // while on UNIX, it returns URLs of the form "file:/foo/bar.txt".
- if (separatorChar == '\\')
- return new URL ("file:/" + getAbsolutePath().replace ('\\', '/')
- + (isDirectory() ? "/" : ""));
- else
- return new URL ("file:" + getAbsolutePath()
- + (isDirectory() ? "/" : ""));
+ return VMFile.toURL(this);
}
@@ -1292,32 +1253,6 @@ public class File implements Serializable, Comparable
}
/**
- * This method compares the specified <code>Object</code> to this one
- * to test for equality. It does this by comparing the canonical path names
- * of the files. This method is identical to <code>compareTo(File)</code>
- * except that if the <code>Object</code> passed to it is not a
- * <code>File</code>, it throws a <code>ClassCastException</code>
- * <p>
- * The canonical paths of the files are determined by calling the
- * <code>getCanonicalPath</code> method on each object.
- * <p>
- * This method returns a 0 if the specified <code>Object</code> is equal
- * to this one, a negative value if it is less than this one
- * a positive value if it is greater than this one.
- *
- * @return An integer as described above
- *
- * @exception ClassCastException If the passed <code>Object</code> is
- * not a <code>File</code>
- *
- * @since 1.2
- */
- public int compareTo(Object obj)
- {
- return compareTo((File) obj);
- }
-
- /**
* This method renames the file represented by this object to the path
* of the file represented by the argument <code>File</code>.
*
diff --git a/libjava/classpath/java/io/FileDescriptor.java b/libjava/classpath/java/io/FileDescriptor.java
index d300c9cb617..cf9ff20d564 100644
--- a/libjava/classpath/java/io/FileDescriptor.java
+++ b/libjava/classpath/java/io/FileDescriptor.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package java.io;
-import gnu.java.nio.channels.FileChannelImpl;
+import gnu.java.nio.FileChannelImpl;
import java.nio.channels.ByteChannel;
import java.nio.channels.FileChannel;
@@ -133,7 +133,8 @@ public final class FileDescriptor
* native file handle, <code>false</code> otherwise
*/
public boolean valid ()
- {
- return channel != null && channel.isOpen();
+ {
+ ByteChannel c = channel;
+ return (c != null) && (c.isOpen());
}
}
diff --git a/libjava/classpath/java/io/FileInputStream.java b/libjava/classpath/java/io/FileInputStream.java
index 8ca38b02fc4..8217668b479 100644
--- a/libjava/classpath/java/io/FileInputStream.java
+++ b/libjava/classpath/java/io/FileInputStream.java
@@ -38,8 +38,9 @@ exception statement from your version. */
package java.io;
-import gnu.java.nio.channels.FileChannelImpl;
+import gnu.java.nio.FileChannelImpl;
+import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
@@ -107,7 +108,20 @@ public class FileInputStream extends InputStream
if (s != null)
s.checkRead(file.getPath());
- ch = FileChannelImpl.create(file, FileChannelImpl.READ);
+ try
+ {
+ ch = FileChannelImpl.create(file, FileChannelImpl.READ);
+ }
+ catch (FileNotFoundException fnfe)
+ {
+ throw fnfe;
+ }
+ catch (IOException ioe)
+ {
+ FileNotFoundException fnfe = new FileNotFoundException(file.getPath());
+ fnfe.initCause(ioe);
+ throw fnfe;
+ }
}
/**
@@ -266,7 +280,7 @@ public class FileInputStream extends InputStream
|| offset + len > buf.length)
throw new ArrayIndexOutOfBoundsException();
- return ch.read(buf, offset, len);
+ return ch.read(ByteBuffer.wrap(buf, offset, len));
}
/**
diff --git a/libjava/classpath/java/io/FileOutputStream.java b/libjava/classpath/java/io/FileOutputStream.java
index 10ea6b536cb..d7561a9d79f 100644
--- a/libjava/classpath/java/io/FileOutputStream.java
+++ b/libjava/classpath/java/io/FileOutputStream.java
@@ -38,8 +38,9 @@ exception statement from your version. */
package java.io;
-import gnu.java.nio.channels.FileChannelImpl;
+import gnu.java.nio.FileChannelImpl;
+import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
@@ -155,10 +156,23 @@ public class FileOutputStream extends OutputStream
if (s != null)
s.checkWrite(file.getPath());
- ch = FileChannelImpl.create(file, (append
- ? FileChannelImpl.WRITE
- | FileChannelImpl.APPEND
- : FileChannelImpl.WRITE));
+ try
+ {
+ ch = FileChannelImpl.create(file, (append
+ ? FileChannelImpl.WRITE
+ | FileChannelImpl.APPEND
+ : FileChannelImpl.WRITE));
+ }
+ catch (FileNotFoundException fnfe)
+ {
+ throw fnfe;
+ }
+ catch (IOException ioe)
+ {
+ FileNotFoundException fnfe = new FileNotFoundException(file.getPath());
+ fnfe.initCause(ioe);
+ throw fnfe;
+ }
}
/**
@@ -266,7 +280,7 @@ public class FileOutputStream extends OutputStream
|| offset + len > buf.length)
throw new ArrayIndexOutOfBoundsException ();
- ch.write (buf, offset, len);
+ ch.write(ByteBuffer.wrap(buf, offset, len));
}
/**
diff --git a/libjava/classpath/java/io/InputStreamReader.java b/libjava/classpath/java/io/InputStreamReader.java
index 936a03c95e0..6c5297f6ba8 100644
--- a/libjava/classpath/java/io/InputStreamReader.java
+++ b/libjava/classpath/java/io/InputStreamReader.java
@@ -135,6 +135,16 @@ public class InputStreamReader extends Reader
private boolean hasSavedSurrogate = false;
/**
+ * A byte array to be reused in read(byte[], int, int).
+ */
+ private byte[] bytesCache;
+
+ /**
+ * Locks the bytesCache above in read(byte[], int, int).
+ */
+ private Object cacheLock = new Object();
+
+ /**
* This method initializes a new instance of <code>InputStreamReader</code>
* to read from the specified stream using the default encoding.
*
@@ -355,9 +365,21 @@ public class InputStreamReader extends Reader
throw new IOException("Reader has been closed");
if (isDone)
return -1;
- if(decoder != null){
- int totalBytes = (int)((double)length * maxBytesPerChar);
- byte[] bytes = new byte[totalBytes];
+ if(decoder != null)
+ {
+ int totalBytes = (int)((double) length * maxBytesPerChar);
+ if (byteBuffer != null)
+ totalBytes = Math.max(totalBytes, byteBuffer.remaining());
+ byte[] bytes;
+ // Fetch cached bytes array if available and big enough.
+ synchronized(cacheLock)
+ {
+ bytes = bytesCache;
+ if (bytes == null || bytes.length < totalBytes)
+ bytes = new byte[totalBytes];
+ else
+ bytesCache = null;
+ }
int remaining = 0;
if(byteBuffer != null)
@@ -410,12 +432,40 @@ public class InputStreamReader extends Reader
byteBuffer = null;
read = cb.position() - startPos;
- return (read <= 0) ? -1 : read;
- } else {
- byte[] bytes = new byte[length];
+
+ // Put cached bytes array back if we are finished and the cache
+ // is null or smaller than the used bytes array.
+ synchronized (cacheLock)
+ {
+ if (byteBuffer == null
+ && (bytesCache == null || bytesCache.length < bytes.length))
+ bytesCache = bytes;
+ }
+ return (read <= 0) ? -1 : read;
+ }
+ else
+ {
+ byte[] bytes;
+ // Fetch cached bytes array if available and big enough.
+ synchronized (cacheLock)
+ {
+ bytes = bytesCache;
+ if (bytes == null || length < bytes.length)
+ bytes = new byte[length];
+ else
+ bytesCache = null;
+ }
+
int read = in.read(bytes);
for(int i=0;i<read;i++)
buf[offset+i] = (char)(bytes[i]&0xFF);
+
+ // Put back byte array into cache if appropriate.
+ synchronized (cacheLock)
+ {
+ if (bytesCache == null || bytesCache.length < bytes.length)
+ bytesCache = bytes;
+ }
return read;
}
}
diff --git a/libjava/classpath/java/io/ObjectInputStream.java b/libjava/classpath/java/io/ObjectInputStream.java
index a37ad73fd86..d6c1406ea81 100644
--- a/libjava/classpath/java/io/ObjectInputStream.java
+++ b/libjava/classpath/java/io/ObjectInputStream.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package java.io;
-import gnu.java.io.ObjectIdentityWrapper;
+import gnu.classpath.VMStackWalker;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
@@ -55,6 +55,13 @@ import java.util.Iterator;
import java.util.TreeSet;
import java.util.Vector;
+/**
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Jeroen Frijters (jeroen@frijters.net)
+ * @author Guilhem Lavaux (guilhem@kaffe.org)
+ * @author Michael Koch (konqueror@gmx.de)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ */
public class ObjectInputStream extends InputStream
implements ObjectInput, ObjectStreamConstants
{
@@ -97,8 +104,8 @@ public class ObjectInputStream extends InputStream
this.blockDataInput = new DataInputStream(this);
this.realInputStream = new DataInputStream(in);
this.nextOID = baseWireHandle;
- this.objectLookupTable = new Hashtable();
- this.classLookupTable = new Hashtable();
+ this.objectLookupTable = new Vector<Object>();
+ this.classLookupTable = new Hashtable<Class,ObjectStreamClass>();
setBlockDataMode(true);
readStreamHeader();
}
@@ -197,10 +204,9 @@ public class ObjectInputStream extends InputStream
case TC_REFERENCE:
{
if(dump) dumpElement("REFERENCE ");
- Integer oid = new Integer(this.realInputStream.readInt());
- if(dump) dumpElementln(Integer.toHexString(oid.intValue()));
- ret_val = ((ObjectIdentityWrapper)
- this.objectLookupTable.get(oid)).object;
+ int oid = realInputStream.readInt();
+ if(dump) dumpElementln(Integer.toHexString(oid));
+ ret_val = lookupHandle(oid);
break;
}
@@ -348,12 +354,12 @@ public class ObjectInputStream extends InputStream
int handle = assignNewHandle(obj);
Object prevObject = this.currentObject;
ObjectStreamClass prevObjectStreamClass = this.currentObjectStreamClass;
- TreeSet prevObjectValidators = this.currentObjectValidators;
+ TreeSet<ValidatorAndPriority> prevObjectValidators =
+ this.currentObjectValidators;
this.currentObject = obj;
this.currentObjectValidators = null;
- ObjectStreamClass[] hierarchy =
- inputGetObjectStreamClasses(clazz);
+ ObjectStreamClass[] hierarchy = hierarchy(clazz);
for (int i = 0; i < hierarchy.length; i++)
{
@@ -539,8 +545,6 @@ public class ObjectInputStream extends InputStream
flags, fields);
assignNewHandle(osc);
- ClassLoader callersClassLoader = currentLoader();
-
for (int i = 0; i < field_count; i++)
{
if(dump) dumpElement(" TYPE CODE=");
@@ -560,12 +564,17 @@ public class ObjectInputStream extends InputStream
class_name = String.valueOf(type_code);
fields[i] =
- new ObjectStreamField(field_name, class_name, callersClassLoader);
+ new ObjectStreamField(field_name, class_name);
}
/* Now that fields have been read we may resolve the class
* (and read annotation if needed). */
Class clazz = resolveClass(osc);
+ ClassLoader loader = clazz.getClassLoader();
+ for (int i = 0; i < field_count; i++)
+ {
+ fields[i].resolveType(loader);
+ }
boolean oldmode = setBlockDataMode(true);
osc.setClass(clazz, lookupClass(clazz.getSuperclass()));
classLookupTable.put(clazz, osc);
@@ -753,7 +762,7 @@ public class ObjectInputStream extends InputStream
+ "ObjectInputValidation object");
if (currentObjectValidators == null)
- currentObjectValidators = new TreeSet();
+ currentObjectValidators = new TreeSet<ValidatorAndPriority>();
currentObjectValidators.add(new ValidatorAndPriority(validator, priority));
}
@@ -775,7 +784,7 @@ public class ObjectInputStream extends InputStream
*
* @see java.io.ObjectOutputStream#annotateClass (java.lang.Class)
*/
- protected Class resolveClass(ObjectStreamClass osc)
+ protected Class<?> resolveClass(ObjectStreamClass osc)
throws ClassNotFoundException, IOException
{
String name = osc.getName();
@@ -814,7 +823,7 @@ public class ObjectInputStream extends InputStream
*/
private ClassLoader currentLoader()
{
- return VMObjectInputStream.currentClassLoader();
+ return VMStackWalker.firstNonNullClassLoader();
}
/**
@@ -842,41 +851,20 @@ public class ObjectInputStream extends InputStream
}
/**
- * Reconstruct class hierarchy the same way
- * {@link java.io.ObjectStreamClass#getObjectStreamClasses(Class)} does
- * but using lookupClass instead of ObjectStreamClass.lookup. This
- * dup is necessary localize the lookup table. Hopefully some future
- * rewritings will be able to prevent this.
+ * Reconstruct class hierarchy the same way {@link
+ * java.io.ObjectStreamClass#hierarchy} does but using lookupClass
+ * instead of ObjectStreamClass.lookup.
*
* @param clazz This is the class for which we want the hierarchy.
*
* @return An array of valid {@link java.io.ObjectStreamClass} instances which
* represent the class hierarchy for clazz.
*/
- private ObjectStreamClass[] inputGetObjectStreamClasses(Class clazz)
- {
+ private ObjectStreamClass[] hierarchy(Class clazz)
+ {
ObjectStreamClass osc = lookupClass(clazz);
- if (osc == null)
- return new ObjectStreamClass[0];
- else
- {
- Vector oscs = new Vector();
-
- while (osc != null)
- {
- oscs.addElement(osc);
- osc = osc.getSuper();
- }
-
- int count = oscs.size();
- ObjectStreamClass[] sorted_oscs = new ObjectStreamClass[count];
-
- for (int i = count - 1; i >= 0; i--)
- sorted_oscs[count - i - 1] = (ObjectStreamClass) oscs.elementAt(i);
-
- return sorted_oscs;
- }
+ return osc == null ? new ObjectStreamClass[0] : osc.hierarchy();
}
/**
@@ -898,12 +886,12 @@ public class ObjectInputStream extends InputStream
}
- protected Class resolveProxyClass(String[] intfs)
+ protected Class<?> resolveProxyClass(String[] intfs)
throws IOException, ClassNotFoundException
{
ClassLoader cl = currentLoader();
- Class[] clss = new Class[intfs.length];
+ Class<?>[] clss = new Class<?>[intfs.length];
if(cl == null)
{
for (int i = 0; i < intfs.length; i++)
@@ -1560,9 +1548,47 @@ public class ObjectInputStream extends InputStream
*/
private int assignNewHandle(Object obj)
{
- this.objectLookupTable.put(new Integer(this.nextOID),
- new ObjectIdentityWrapper(obj));
- return this.nextOID++;
+ int handle = this.nextOID;
+ this.nextOID = handle + 1;
+ rememberHandle(obj,handle);
+ return handle;
+ }
+
+ /**
+ * Remember the object associated with the given handle.
+ *
+ * @param obj an object
+ *
+ * @param handle a handle, must be >= baseWireHandle
+ *
+ * @see #lookupHandle
+ */
+ private void rememberHandle(Object obj, int handle)
+ {
+ Vector olt = this.objectLookupTable;
+ handle = handle - baseWireHandle;
+
+ if (olt.size() <= handle)
+ olt.setSize(handle + 1);
+
+ olt.set(handle, obj);
+ }
+
+ /**
+ * Look up the object associated with a given handle.
+ *
+ * @param handle a handle, must be >= baseWireHandle
+ *
+ * @return the object remembered for handle or null if none.
+ *
+ * @see #rememberHandle
+ */
+ private Object lookupHandle(int handle)
+ {
+ Vector olt = this.objectLookupTable;
+ handle = handle - baseWireHandle;
+ Object result = handle < olt.size() ? olt.get(handle) : null;
+ return result;
}
private Object processResolution(ObjectStreamClass osc, Object obj, int handle)
@@ -1596,9 +1622,7 @@ public class ObjectInputStream extends InputStream
if (this.resolveEnabled)
obj = resolveObject(obj);
- this.objectLookupTable.put(new Integer(handle),
- new ObjectIdentityWrapper(obj));
-
+ rememberHandle(obj, handle);
return obj;
}
@@ -1875,10 +1899,10 @@ public class ObjectInputStream extends InputStream
{
try
{
- Iterator it = currentObjectValidators.iterator();
+ Iterator<ValidatorAndPriority> it = currentObjectValidators.iterator();
while(it.hasNext())
{
- ValidatorAndPriority vap = (ValidatorAndPriority) it.next();
+ ValidatorAndPriority vap = it.next();
ObjectInputValidation validator = vap.validator;
validator.validateObject();
}
@@ -1931,13 +1955,13 @@ public class ObjectInputStream extends InputStream
private boolean useSubclassMethod;
private int nextOID;
private boolean resolveEnabled;
- private Hashtable objectLookupTable;
+ private Vector<Object> objectLookupTable;
private Object currentObject;
private ObjectStreamClass currentObjectStreamClass;
- private TreeSet currentObjectValidators;
+ private TreeSet<ValidatorAndPriority> currentObjectValidators;
private boolean readDataFromBlock;
private boolean fieldsAlreadyRead;
- private Hashtable classLookupTable;
+ private Hashtable<Class,ObjectStreamClass> classLookupTable;
private GetField prereadFields;
private static boolean dump;
diff --git a/libjava/classpath/java/io/ObjectOutputStream.java b/libjava/classpath/java/io/ObjectOutputStream.java
index 80d196bce1b..c3c3df9a304 100644
--- a/libjava/classpath/java/io/ObjectOutputStream.java
+++ b/libjava/classpath/java/io/ObjectOutputStream.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package java.io;
-import gnu.java.io.ObjectIdentityWrapper;
+import gnu.java.io.ObjectIdentityMap2Int;
import gnu.java.lang.reflect.TypeSignature;
import gnu.java.security.action.SetAccessibleAction;
@@ -47,8 +47,7 @@ import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.util.Hashtable;
+
/**
* An <code>ObjectOutputStream</code> can be used to write objects
@@ -115,6 +114,11 @@ import java.util.Hashtable;
* @see java.io.Externalizable
* @see java.io.ObjectInputStream
* @see java.io.Serializable
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Jeroen Frijters (jeroen@frijters.net)
+ * @author Guilhem Lavaux (guilhem@kaffe.org)
+ * @author Michael Koch (konqueror@gmx.de)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
public class ObjectOutputStream extends OutputStream
implements ObjectOutput, ObjectStreamConstants
@@ -140,7 +144,7 @@ public class ObjectOutputStream extends OutputStream
replacementEnabled = false;
isSerializing = false;
nextOID = baseWireHandle;
- OIDLookupTable = new Hashtable();
+ OIDLookupTable = new ObjectIdentityMap2Int();
protocolVersion = defaultProtocolVersion;
useSubclassMethod = false;
writeStreamHeader();
@@ -207,11 +211,11 @@ public class ObjectOutputStream extends OutputStream
break;
}
- Integer handle = findHandle(obj);
- if (handle != null)
+ int handle = findHandle(obj);
+ if (handle >= 0)
{
realOutput.writeByte(TC_REFERENCE);
- realOutput.writeInt(handle.intValue());
+ realOutput.writeInt(handle);
break;
}
@@ -225,7 +229,7 @@ public class ObjectOutputStream extends OutputStream
writeObject (osc);
}
else
- {
+ {System.err.println("1");
realOutput.writeByte(TC_PROXYCLASSDESC);
Class[] intfs = cl.getInterfaces();
realOutput.writeInt(intfs.length);
@@ -338,8 +342,7 @@ public class ObjectOutputStream extends OutputStream
Object prevObject = this.currentObject;
ObjectStreamClass prevObjectStreamClass = this.currentObjectStreamClass;
currentObject = obj;
- ObjectStreamClass[] hierarchy =
- ObjectStreamClass.getObjectStreamClasses(clazz);
+ ObjectStreamClass[] hierarchy = osc.hierarchy();
for (int i = 0; i < hierarchy.length; i++)
{
@@ -604,11 +607,11 @@ public class ObjectOutputStream extends OutputStream
*
* @see ObjectInputStream#resolveClass(java.io.ObjectStreamClass)
*/
- protected void annotateClass(Class cl) throws IOException
+ protected void annotateClass(Class<?> cl) throws IOException
{
}
- protected void annotateProxyClass(Class cl) throws IOException
+ protected void annotateProxyClass(Class<?> cl) throws IOException
{
}
@@ -1104,17 +1107,16 @@ public class ObjectOutputStream extends OutputStream
// lookup the handle for OBJ, return null if OBJ doesn't have a
// handle yet
- private Integer findHandle(Object obj)
+ private int findHandle(Object obj)
{
- return (Integer)OIDLookupTable.get(new ObjectIdentityWrapper(obj));
+ return OIDLookupTable.get(obj);
}
// assigns the next availible handle to OBJ
private int assignNewHandle(Object obj)
{
- OIDLookupTable.put(new ObjectIdentityWrapper(obj),
- new Integer(nextOID));
+ OIDLookupTable.put(obj, nextOID);
return nextOID++;
}
@@ -1216,39 +1218,70 @@ public class ObjectOutputStream extends OutputStream
{
ObjectStreamField[] fields = osc.fields;
boolean oldmode = setBlockDataMode(false);
- String field_name;
- Class type;
- for (int i = 0; i < fields.length; i++)
+ try
{
- field_name = fields[i].getName();
- type = fields[i].getType();
-
- if (dump)
- dumpElementln ("WRITE FIELD: " + field_name + " type=" + type);
-
- if (type == Boolean.TYPE)
- realOutput.writeBoolean(getBooleanField(obj, osc.forClass(), field_name));
- else if (type == Byte.TYPE)
- realOutput.writeByte(getByteField(obj, osc.forClass(), field_name));
- else if (type == Character.TYPE)
- realOutput.writeChar(getCharField(obj, osc.forClass(), field_name));
- else if (type == Double.TYPE)
- realOutput.writeDouble(getDoubleField(obj, osc.forClass(), field_name));
- else if (type == Float.TYPE)
- realOutput.writeFloat(getFloatField(obj, osc.forClass(), field_name));
- else if (type == Integer.TYPE)
- realOutput.writeInt(getIntField(obj, osc.forClass(), field_name));
- else if (type == Long.TYPE)
- realOutput.writeLong(getLongField(obj, osc.forClass(), field_name));
- else if (type == Short.TYPE)
- realOutput.writeShort(getShortField(obj, osc.forClass(), field_name));
- else
- writeObject(getObjectField(obj, osc.forClass(), field_name,
- fields[i].getTypeString ()));
+ writeFields(obj,fields);
+ }
+ catch (IllegalArgumentException _)
+ {
+ InvalidClassException e = new InvalidClassException
+ ("writing fields of class " + osc.forClass().getName());
+ e.initCause(_);
+ throw e;
}
+ catch (IOException e)
+ {
+ throw e;
+ }
+ catch (Exception _)
+ {
+ IOException e = new IOException("Unexpected exception " + _);
+ e.initCause(_);
+ throw(e);
+ }
+
setBlockDataMode(oldmode);
}
+
+
+ /**
+ * Helper function for writeFields(Object,ObjectStreamClass): write
+ * fields from given fields array. Pass exception on.
+ *
+ * @param obj the object to be written
+ *
+ * @param fields the fields of obj to be written.
+ */
+ private void writeFields(Object obj, ObjectStreamField[] fields)
+ throws
+ IllegalArgumentException, IllegalAccessException, IOException
+ {
+ for (int i = 0; i < fields.length; i++)
+ {
+ ObjectStreamField osf = fields[i];
+ Field field = osf.field;
+
+ if (DEBUG && dump)
+ dumpElementln ("WRITE FIELD: " + osf.getName() + " type=" + osf.getType());
+
+ switch (osf.getTypeCode())
+ {
+ case 'Z': realOutput.writeBoolean(field.getBoolean(obj)); break;
+ case 'B': realOutput.writeByte (field.getByte (obj)); break;
+ case 'S': realOutput.writeShort (field.getShort (obj)); break;
+ case 'C': realOutput.writeChar (field.getChar (obj)); break;
+ case 'I': realOutput.writeInt (field.getInt (obj)); break;
+ case 'F': realOutput.writeFloat (field.getFloat (obj)); break;
+ case 'J': realOutput.writeLong (field.getLong (obj)); break;
+ case 'D': realOutput.writeDouble (field.getDouble (obj)); break;
+ case 'L':
+ case '[': writeObject (field.get (obj)); break;
+ default:
+ throw new IOException("Unexpected type code " + osf.getTypeCode());
+ }
+ }
+ }
// Toggles writing primitive data to block-data buffer.
@@ -1307,248 +1340,6 @@ public class ObjectOutputStream extends OutputStream
}
}
- private boolean getBooleanField(Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField(klass, field_name);
- boolean b = f.getBoolean(obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private byte getByteField (Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- byte b = f.getByte (obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private char getCharField (Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- char b = f.getChar (obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private double getDoubleField (Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- double b = f.getDouble (obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private float getFloatField (Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- float b = f.getFloat (obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private int getIntField (Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- int b = f.getInt (obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private long getLongField (Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- long b = f.getLong (obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private short getShortField (Object obj, Class klass, String field_name)
- throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- short b = f.getShort (obj);
- return b;
- }
- catch (IllegalArgumentException _)
- {
- throw new InvalidClassException
- ("invalid requested type for field " + field_name + " in class " + klass.getName());
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception _)
- {
- throw new IOException("Unexpected exception " + _);
- }
- }
-
- private Object getObjectField (Object obj, Class klass, String field_name,
- String type_code) throws IOException
- {
- try
- {
- Field f = getField (klass, field_name);
- ObjectStreamField of = new ObjectStreamField(f.getName(), f.getType());
-
- /* if of is primitive something went wrong
- * in the check for primitive classes in writeFields.
- */
- if (of.isPrimitive())
- throw new InvalidClassException
- ("invalid type code for " + field_name + " in class " + klass.getName() + " : object stream field is primitive");
-
- if (!of.getTypeString().equals(type_code))
- throw new InvalidClassException
- ("invalid type code for " + field_name + " in class " + klass.getName() + " : object stream field " + of + " has type string " + of.getTypeString() + " instead of " + type_code);
-
- Object o = f.get (obj);
- // FIXME: We should check the type_code here
- return o;
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw new IOException ();
- }
- }
-
- private Field getField (Class klass, String name)
- throws java.io.InvalidClassException
- {
- try
- {
- final Field f = klass.getDeclaredField(name);
- setAccessible.setMember(f);
- AccessController.doPrivileged(setAccessible);
- return f;
- }
- catch (java.lang.NoSuchFieldException e)
- {
- throw new InvalidClassException
- ("no field called " + name + " in class " + klass.getName());
- }
- }
-
private void dumpElementln (String msg)
{
for (int i = 0; i < depth; i++)
@@ -1576,7 +1367,7 @@ public class ObjectOutputStream extends OutputStream
private boolean replacementEnabled;
private boolean isSerializing;
private int nextOID;
- private Hashtable OIDLookupTable;
+ private ObjectIdentityMap2Int OIDLookupTable;
private int protocolVersion;
private boolean useSubclassMethod;
private SetAccessibleAction setAccessible = new SetAccessibleAction();
diff --git a/libjava/classpath/java/io/ObjectStreamClass.java b/libjava/classpath/java/io/ObjectStreamClass.java
index abb26d839ad..52a1ad42873 100644
--- a/libjava/classpath/java/io/ObjectStreamClass.java
+++ b/libjava/classpath/java/io/ObjectStreamClass.java
@@ -1,6 +1,6 @@
/* ObjectStreamClass.java -- Class used to write class information
about serialized objects.
- Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -59,8 +59,14 @@ import java.security.Security;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Hashtable;
-import java.util.Vector;
+/**
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Jeroen Frijters (jeroen@frijters.net)
+ * @author Guilhem Lavaux (guilhem@kaffe.org)
+ * @author Michael Koch (konqueror@gmx.de)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ */
public class ObjectStreamClass implements Serializable
{
static final ObjectStreamField[] INVALID_FIELDS = new ObjectStreamField[0];
@@ -80,7 +86,7 @@ public class ObjectStreamClass implements Serializable
*
* @see java.io.Serializable
*/
- public static ObjectStreamClass lookup(Class cl)
+ public static ObjectStreamClass lookup(Class<?> cl)
{
if (cl == null)
return null;
@@ -132,7 +138,7 @@ public class ObjectStreamClass implements Serializable
*
* @see java.io.ObjectInputStream
*/
- public Class forClass()
+ public Class<?> forClass()
{
return clazz;
}
@@ -235,37 +241,45 @@ public class ObjectStreamClass implements Serializable
return superClass;
}
-
- // returns an array of ObjectStreamClasses that represent the super
- // classes of CLAZZ and CLAZZ itself in order from most super to
- // CLAZZ. ObjectStreamClass[0] is the highest superclass of CLAZZ
- // that is serializable.
- static ObjectStreamClass[] getObjectStreamClasses(Class clazz)
+ /**
+ * returns an array of ObjectStreamClasses that represent the super
+ * classes of the class represented by this and the class
+ * represented by this itself in order from most super to this.
+ * ObjectStreamClass[0] is the highest superclass of this that is
+ * serializable.
+ *
+ * The result of consecutive calls this hierarchy() will be the same
+ * array instance.
+ *
+ * @return an array of ObjectStreamClass representing the
+ * super-class hierarchy of serializable classes.
+ */
+ ObjectStreamClass[] hierarchy()
{
- ObjectStreamClass osc = ObjectStreamClass.lookup(clazz);
-
- if (osc == null)
- return new ObjectStreamClass[0];
- else
- {
- Vector oscs = new Vector();
-
- while (osc != null)
- {
- oscs.addElement (osc);
- osc = osc.getSuper();
- }
-
- int count = oscs.size();
- ObjectStreamClass[] sorted_oscs = new ObjectStreamClass[ count ];
-
- for (int i = count - 1; i >= 0; i--)
- sorted_oscs[ count - i - 1 ] = (ObjectStreamClass) oscs.elementAt(i);
-
- return sorted_oscs;
+ ObjectStreamClass[] result = hierarchy;
+ if (result == null)
+ {
+ int d = 0;
+
+ for(ObjectStreamClass osc = this; osc != null; osc = osc.getSuper())
+ d++;
+
+ result = new ObjectStreamClass[d];
+
+ for (ObjectStreamClass osc = this; osc != null; osc = osc.getSuper())
+ {
+ result[--d] = osc;
+ }
+
+ hierarchy = result;
}
+ return result;
}
+ /**
+ * Cache for hierarchy() result.
+ */
+ private ObjectStreamClass[] hierarchy = null;
// Returns an integer that consists of bit-flags that indicate
// properties of the class represented by this ObjectStreamClass.
@@ -298,7 +312,7 @@ public class ObjectStreamClass implements Serializable
* already set UID is found.
*/
void setClass(Class cl, ObjectStreamClass superClass) throws InvalidClassException
- {
+ {hierarchy = null;
this.clazz = cl;
cacheMethods();
@@ -309,8 +323,8 @@ public class ObjectStreamClass implements Serializable
else
{
// Check that the actual UID of the resolved class matches the UID from
- // the stream.
- if (uid != class_uid)
+ // the stream. Mismatches for array classes are ignored.
+ if (!cl.isArray() && uid != class_uid)
{
String msg = cl +
": Local class not compatible: stream serialVersionUID="
@@ -425,6 +439,7 @@ public class ObjectStreamClass implements Serializable
void setSuperclass (ObjectStreamClass osc)
{
superClass = osc;
+ hierarchy = null;
}
void calculateOffsets()
@@ -547,21 +562,62 @@ outer:
return null;
}
- private void cacheMethods()
+ /**
+ * Helper routine to check if a class was loaded by boot or
+ * application class loader. Classes for which this is not the case
+ * should not be cached since caching prevent class file garbage
+ * collection.
+ *
+ * @param cl a class
+ *
+ * @return true if cl was loaded by boot or application class loader,
+ * false if cl was loaded by a user class loader.
+ */
+ private static boolean loadedByBootOrApplicationClassLoader(Class cl)
{
- Method[] methods = forClass().getDeclaredMethods();
+ ClassLoader l = cl.getClassLoader();
+ return
+ ( l == null /* boot loader */ )
+ || (l == ClassLoader.getSystemClassLoader() /* application loader */);
+ }
- readObjectMethod = findMethod(methods, "readObject",
- new Class[] { ObjectInputStream.class },
- Void.TYPE, true);
- writeObjectMethod = findMethod(methods, "writeObject",
- new Class[] { ObjectOutputStream.class },
- Void.TYPE, true);
+ static Hashtable methodCache = new Hashtable();
+
+ static final Class[] readObjectSignature = { ObjectInputStream.class };
+ static final Class[] writeObjectSignature = { ObjectOutputStream.class };
- // readResolve and writeReplace can be in parent classes, as long as they
- // are accessible from this class.
- readResolveMethod = findAccessibleMethod("readResolve", forClass());
- writeReplaceMethod = findAccessibleMethod("writeReplace", forClass());
+ private void cacheMethods()
+ {
+ Class cl = forClass();
+ Method[] cached = (Method[]) methodCache.get(cl);
+ if (cached == null)
+ {
+ cached = new Method[4];
+ Method[] methods = cl.getDeclaredMethods();
+
+ cached[0] = findMethod(methods, "readObject",
+ readObjectSignature,
+ Void.TYPE, true);
+ cached[1] = findMethod(methods, "writeObject",
+ writeObjectSignature,
+ Void.TYPE, true);
+
+ // readResolve and writeReplace can be in parent classes, as long as they
+ // are accessible from this class.
+ cached[2] = findAccessibleMethod("readResolve", cl);
+ cached[3] = findAccessibleMethod("writeReplace", cl);
+
+ /* put in cache if classes not loaded by user class loader.
+ * For a user class loader, the cache may otherwise grow
+ * without limit.
+ */
+ if (loadedByBootOrApplicationClassLoader(cl))
+ methodCache.put(cl,cached);
+ }
+ readObjectMethod = cached[0];
+ writeObjectMethod = cached[1];
+ readResolveMethod = cached[2];
+ writeReplaceMethod = cached[3];
}
private ObjectStreamClass(Class cl)
@@ -713,152 +769,208 @@ outer:
calculateOffsets();
}
+ static Hashtable uidCache = new Hashtable();
+
// Returns the serial version UID defined by class, or if that
// isn't present, calculates value of serial version UID.
private long getClassUID(Class cl)
{
- try
+ long result = 0;
+ Long cache = (Long) uidCache.get(cl);
+ if (cache != null)
+ result = cache.longValue();
+ else
{
- // Use getDeclaredField rather than getField, since serialVersionUID
- // may not be public AND we only want the serialVersionUID of this
- // class, not a superclass or interface.
- final Field suid = cl.getDeclaredField("serialVersionUID");
- SetAccessibleAction setAccessible = new SetAccessibleAction(suid);
- AccessController.doPrivileged(setAccessible);
- int modifiers = suid.getModifiers();
-
- if (Modifier.isStatic(modifiers)
- && Modifier.isFinal(modifiers)
- && suid.getType() == Long.TYPE)
- return suid.getLong(null);
+ try
+ {
+ result = getClassUIDFromField(cl);
+ }
+ catch (NoSuchFieldException ignore)
+ {
+ try
+ {
+ result = calculateClassUID(cl);
+ }
+ catch (NoSuchAlgorithmException e)
+ {
+ throw new RuntimeException
+ ("The SHA algorithm was not found to use in computing the Serial Version UID for class "
+ + cl.getName(), e);
+ }
+ catch (IOException ioe)
+ {
+ throw new RuntimeException(ioe);
+ }
+ }
+
+ if (loadedByBootOrApplicationClassLoader(cl))
+ uidCache.put(cl,new Long(result));
}
- catch (NoSuchFieldException ignore)
+ return result;
+ }
+
+ /**
+ * Search for a serialVersionUID field in the given class and read
+ * its value.
+ *
+ * @return the contents of the serialVersionUID field
+ *
+ * @throws NoSuchFieldException if such a field does not exist or is
+ * not static, not final, not of type Long or not accessible.
+ */
+ long getClassUIDFromField(Class cl)
+ throws NoSuchFieldException
+ {
+ long result;
+
+ try
{
+ // Use getDeclaredField rather than getField, since serialVersionUID
+ // may not be public AND we only want the serialVersionUID of this
+ // class, not a superclass or interface.
+ final Field suid = cl.getDeclaredField("serialVersionUID");
+ SetAccessibleAction setAccessible = new SetAccessibleAction(suid);
+ AccessController.doPrivileged(setAccessible);
+ int modifiers = suid.getModifiers();
+
+ if (Modifier.isStatic(modifiers)
+ && Modifier.isFinal(modifiers)
+ && suid.getType() == Long.TYPE)
+ result = suid.getLong(null);
+ else
+ throw new NoSuchFieldException();
}
catch (IllegalAccessException ignore)
{
+ throw new NoSuchFieldException();
}
- // cl didn't define serialVersionUID, so we have to compute it
- try
- {
- MessageDigest md;
- try
- {
- md = MessageDigest.getInstance("SHA");
- }
- catch (NoSuchAlgorithmException e)
- {
- // If a provider already provides SHA, use it; otherwise, use this.
- Gnu gnuProvider = new Gnu();
- Security.addProvider(gnuProvider);
- md = MessageDigest.getInstance("SHA");
- }
-
- DigestOutputStream digest_out =
- new DigestOutputStream(nullOutputStream, md);
- DataOutputStream data_out = new DataOutputStream(digest_out);
-
- data_out.writeUTF(cl.getName());
-
- int modifiers = cl.getModifiers();
- // just look at interesting bits
- modifiers = modifiers & (Modifier.ABSTRACT | Modifier.FINAL
- | Modifier.INTERFACE | Modifier.PUBLIC);
- data_out.writeInt(modifiers);
-
- // Pretend that an array has no interfaces, because when array
- // serialization was defined (JDK 1.1), arrays didn't have it.
- if (! cl.isArray())
- {
- Class[] interfaces = cl.getInterfaces();
- Arrays.sort(interfaces, interfaceComparator);
- for (int i = 0; i < interfaces.length; i++)
- data_out.writeUTF(interfaces[i].getName());
- }
-
- Field field;
- Field[] fields = cl.getDeclaredFields();
- Arrays.sort(fields, memberComparator);
- for (int i = 0; i < fields.length; i++)
- {
- field = fields[i];
- modifiers = field.getModifiers();
- if (Modifier.isPrivate(modifiers)
- && (Modifier.isStatic(modifiers)
- || Modifier.isTransient(modifiers)))
- continue;
-
- data_out.writeUTF(field.getName());
- data_out.writeInt(modifiers);
- data_out.writeUTF(TypeSignature.getEncodingOfClass (field.getType()));
- }
-
- // write class initializer method if present
- if (VMObjectStreamClass.hasClassInitializer(cl))
- {
- data_out.writeUTF("<clinit>");
- data_out.writeInt(Modifier.STATIC);
- data_out.writeUTF("()V");
- }
-
- Constructor constructor;
- Constructor[] constructors = cl.getDeclaredConstructors();
- Arrays.sort (constructors, memberComparator);
- for (int i = 0; i < constructors.length; i++)
- {
- constructor = constructors[i];
- modifiers = constructor.getModifiers();
- if (Modifier.isPrivate(modifiers))
- continue;
-
- data_out.writeUTF("<init>");
- data_out.writeInt(modifiers);
-
- // the replacement of '/' with '.' was needed to make computed
- // SUID's agree with those computed by JDK
- data_out.writeUTF
- (TypeSignature.getEncodingOfConstructor(constructor).replace('/','.'));
- }
-
- Method method;
- Method[] methods = cl.getDeclaredMethods();
- Arrays.sort(methods, memberComparator);
- for (int i = 0; i < methods.length; i++)
- {
- method = methods[i];
- modifiers = method.getModifiers();
- if (Modifier.isPrivate(modifiers))
- continue;
-
- data_out.writeUTF(method.getName());
- data_out.writeInt(modifiers);
-
- // the replacement of '/' with '.' was needed to make computed
- // SUID's agree with those computed by JDK
- data_out.writeUTF
- (TypeSignature.getEncodingOfMethod(method).replace('/', '.'));
- }
-
- data_out.close();
- byte[] sha = md.digest();
- long result = 0;
- int len = sha.length < 8 ? sha.length : 8;
- for (int i = 0; i < len; i++)
- result += (long) (sha[i] & 0xFF) << (8 * i);
+ return result;
+ }
- return result;
+ /**
+ * Calculate class serial version UID for a class that does not
+ * define serialVersionUID:
+ *
+ * @param cl a class
+ *
+ * @return the calculated serial varsion UID.
+ *
+ * @throws NoSuchAlgorithmException if SHA algorithm not found
+ *
+ * @throws IOException if writing to the DigestOutputStream causes
+ * an IOException.
+ */
+ long calculateClassUID(Class cl)
+ throws NoSuchAlgorithmException, IOException
+ {
+ long result;
+ MessageDigest md;
+ try
+ {
+ md = MessageDigest.getInstance("SHA");
}
catch (NoSuchAlgorithmException e)
{
- throw new RuntimeException
- ("The SHA algorithm was not found to use in computing the Serial Version UID for class "
- + cl.getName(), e);
+ // If a provider already provides SHA, use it; otherwise, use this.
+ Gnu gnuProvider = new Gnu();
+ Security.addProvider(gnuProvider);
+ md = MessageDigest.getInstance("SHA");
+ }
+
+ DigestOutputStream digest_out =
+ new DigestOutputStream(nullOutputStream, md);
+ DataOutputStream data_out = new DataOutputStream(digest_out);
+
+ data_out.writeUTF(cl.getName());
+
+ int modifiers = cl.getModifiers();
+ // just look at interesting bits
+ modifiers = modifiers & (Modifier.ABSTRACT | Modifier.FINAL
+ | Modifier.INTERFACE | Modifier.PUBLIC);
+ data_out.writeInt(modifiers);
+
+ // Pretend that an array has no interfaces, because when array
+ // serialization was defined (JDK 1.1), arrays didn't have it.
+ if (! cl.isArray())
+ {
+ Class[] interfaces = cl.getInterfaces();
+ Arrays.sort(interfaces, interfaceComparator);
+ for (int i = 0; i < interfaces.length; i++)
+ data_out.writeUTF(interfaces[i].getName());
+ }
+
+ Field field;
+ Field[] fields = cl.getDeclaredFields();
+ Arrays.sort(fields, memberComparator);
+ for (int i = 0; i < fields.length; i++)
+ {
+ field = fields[i];
+ modifiers = field.getModifiers();
+ if (Modifier.isPrivate(modifiers)
+ && (Modifier.isStatic(modifiers)
+ || Modifier.isTransient(modifiers)))
+ continue;
+
+ data_out.writeUTF(field.getName());
+ data_out.writeInt(modifiers);
+ data_out.writeUTF(TypeSignature.getEncodingOfClass (field.getType()));
+ }
+
+ // write class initializer method if present
+ if (VMObjectStreamClass.hasClassInitializer(cl))
+ {
+ data_out.writeUTF("<clinit>");
+ data_out.writeInt(Modifier.STATIC);
+ data_out.writeUTF("()V");
}
- catch (IOException ioe)
+
+ Constructor constructor;
+ Constructor[] constructors = cl.getDeclaredConstructors();
+ Arrays.sort (constructors, memberComparator);
+ for (int i = 0; i < constructors.length; i++)
+ {
+ constructor = constructors[i];
+ modifiers = constructor.getModifiers();
+ if (Modifier.isPrivate(modifiers))
+ continue;
+
+ data_out.writeUTF("<init>");
+ data_out.writeInt(modifiers);
+
+ // the replacement of '/' with '.' was needed to make computed
+ // SUID's agree with those computed by JDK
+ data_out.writeUTF
+ (TypeSignature.getEncodingOfConstructor(constructor).replace('/','.'));
+ }
+
+ Method method;
+ Method[] methods = cl.getDeclaredMethods();
+ Arrays.sort(methods, memberComparator);
+ for (int i = 0; i < methods.length; i++)
{
- throw new RuntimeException(ioe);
+ method = methods[i];
+ modifiers = method.getModifiers();
+ if (Modifier.isPrivate(modifiers))
+ continue;
+
+ data_out.writeUTF(method.getName());
+ data_out.writeInt(modifiers);
+
+ // the replacement of '/' with '.' was needed to make computed
+ // SUID's agree with those computed by JDK
+ data_out.writeUTF
+ (TypeSignature.getEncodingOfMethod(method).replace('/', '.'));
}
+
+ data_out.close();
+ byte[] sha = md.digest();
+ result = 0;
+ int len = sha.length < 8 ? sha.length : 8;
+ for (int i = 0; i < len; i++)
+ result += (long) (sha[i] & 0xFF) << (8 * i);
+
+ return result;
}
/**
@@ -948,7 +1060,8 @@ outer:
public static final ObjectStreamField[] NO_FIELDS = {};
- private static Hashtable classLookupTable = new Hashtable();
+ private static Hashtable<Class,ObjectStreamClass> classLookupTable
+ = new Hashtable<Class,ObjectStreamClass>();
private static final NullOutputStream nullOutputStream = new NullOutputStream();
private static final Comparator interfaceComparator = new InterfaceComparator();
private static final Comparator memberComparator = new MemberComparator();
@@ -956,7 +1069,7 @@ outer:
Class[] writeMethodArgTypes = { java.io.ObjectOutputStream.class };
private ObjectStreamClass superClass;
- private Class clazz;
+ private Class<?> clazz;
private String name;
private long uid;
private byte flags;
diff --git a/libjava/classpath/java/io/ObjectStreamField.java b/libjava/classpath/java/io/ObjectStreamField.java
index 61ccdc7db76..91f557870a5 100644
--- a/libjava/classpath/java/io/ObjectStreamField.java
+++ b/libjava/classpath/java/io/ObjectStreamField.java
@@ -1,5 +1,5 @@
/* ObjectStreamField.java -- Class used to store name and class of fields
- Copyright (C) 1998, 1999, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,17 +48,24 @@ import java.security.PrivilegedAction;
* This class intends to describe the field of a class for the serialization
* subsystem. Serializable fields in a serializable class can be explicitly
* exported using an array of ObjectStreamFields.
+ *
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Jeroen Frijters (jeroen@frijters.net)
+ * @author Guilhem Lavaux (guilhem@kaffe.org)
+ * @author Michael Koch (konqueror@gmx.de)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
-public class ObjectStreamField implements Comparable
+public class ObjectStreamField
+ implements Comparable<Object>
{
private String name;
- private Class type;
+ private Class<?> type;
private String typename;
private int offset = -1; // XXX make sure this is correct
private boolean unshared;
private boolean persistent = false;
private boolean toset = true;
- private Field field;
+ Field field;
ObjectStreamField (Field field)
{
@@ -74,7 +81,7 @@ public class ObjectStreamField implements Comparable
* @param name Name of the field to export.
* @param type Type of the field in the concerned class.
*/
- public ObjectStreamField (String name, Class type)
+ public ObjectStreamField (String name, Class<?> type)
{
this (name, type, false);
}
@@ -88,7 +95,7 @@ public class ObjectStreamField implements Comparable
* @param type Type of the field in the concerned class.
* @param unshared true if field will be unshared, false otherwise.
*/
- public ObjectStreamField (String name, Class type, boolean unshared)
+ public ObjectStreamField (String name, Class<?> type, boolean unshared)
{
if (name == null)
throw new NullPointerException();
@@ -111,28 +118,10 @@ public class ObjectStreamField implements Comparable
{
this.name = name;
this.typename = typename;
- try
- {
- type = TypeSignature.getClassForEncoding(typename);
- }
- catch(ClassNotFoundException e)
- {
- }
}
-
- /**
- * There are many cases you can not get java.lang.Class from typename
- * if your context class loader cann not load it, then use typename to
- * construct the field.
- *
- * @param name Name of the field to export.
- * @param typename The coded name of the type for this field.
- * @param loader The class loader to use to resolve class names.
- */
- ObjectStreamField (String name, String typename, ClassLoader loader)
+
+ void resolveType(ClassLoader loader)
{
- this.name = name;
- this.typename = typename;
try
{
type = TypeSignature.getClassForEncoding(typename, true, loader);
@@ -141,7 +130,7 @@ public class ObjectStreamField implements Comparable
{
}
}
-
+
/**
* This method returns the name of the field represented by the
* ObjectStreamField instance.
@@ -159,7 +148,7 @@ public class ObjectStreamField implements Comparable
*
* @return A class representing the type of the field.
*/
- public Class getType ()
+ public Class<?> getType ()
{
return type;
}
@@ -347,7 +336,7 @@ public class ObjectStreamField implements Comparable
*/
void checkFieldType() throws InvalidClassException
{
- Class ftype = field.getType();
+ Class<?> ftype = field.getType();
if (!ftype.isAssignableFrom(type))
throw new InvalidClassException
diff --git a/libjava/classpath/java/io/OutputStreamWriter.java b/libjava/classpath/java/io/OutputStreamWriter.java
index 572683834be..26363401f01 100644
--- a/libjava/classpath/java/io/OutputStreamWriter.java
+++ b/libjava/classpath/java/io/OutputStreamWriter.java
@@ -223,6 +223,7 @@ public class OutputStreamWriter extends Writer
encoder.onMalformedInput(CodingErrorAction.REPLACE);
encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
outputBuffer = CharBuffer.allocate(BUFFER_SIZE);
+ encodingName = EncodingHelper.getOldCanonical(cs.name());
}
/**
@@ -240,6 +241,11 @@ public class OutputStreamWriter extends Writer
this.out = out;
encoder = enc;
outputBuffer = CharBuffer.allocate(BUFFER_SIZE);
+ Charset cs = enc.charset();
+ if (cs == null)
+ encodingName = "US-ASCII";
+ else
+ encodingName = EncodingHelper.getOldCanonical(cs.name());
}
/**
diff --git a/libjava/classpath/java/io/PipedInputStream.java b/libjava/classpath/java/io/PipedInputStream.java
index 523ae2c70d3..c0396d206c6 100644
--- a/libjava/classpath/java/io/PipedInputStream.java
+++ b/libjava/classpath/java/io/PipedInputStream.java
@@ -279,6 +279,10 @@ public class PipedInputStream extends InputStream
if (closed)
throw new IOException ("Pipe closed");
+ // Don't block if nothing was requested.
+ if (len == 0)
+ return 0;
+
// If the buffer is empty, wait until there is something in the pipe
// to read.
try
diff --git a/libjava/classpath/java/io/PipedReader.java b/libjava/classpath/java/io/PipedReader.java
index 90fc10f672d..8a3363a6004 100644
--- a/libjava/classpath/java/io/PipedReader.java
+++ b/libjava/classpath/java/io/PipedReader.java
@@ -261,6 +261,10 @@ public class PipedReader extends Reader
if (closed)
throw new IOException ("Pipe closed");
+ // Don't block if nothing was requested.
+ if (len == 0)
+ return 0;
+
// If the buffer is empty, wait until there is something in the pipe
// to read.
try
diff --git a/libjava/classpath/java/io/PrintStream.java b/libjava/classpath/java/io/PrintStream.java
index 98461db2ba8..2d747c8c8f4 100644
--- a/libjava/classpath/java/io/PrintStream.java
+++ b/libjava/classpath/java/io/PrintStream.java
@@ -39,6 +39,9 @@ exception statement from your version. */
package java.io;
+import java.util.Locale;
+import java.util.Formatter;
+
import gnu.classpath.SystemProperties;
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
@@ -58,8 +61,9 @@ import gnu.classpath.SystemProperties;
*
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Tom Tromey (tromey@cygnus.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
-public class PrintStream extends FilterOutputStream
+public class PrintStream extends FilterOutputStream implements Appendable
{
/* Notice the implementation is quite similar to OutputStreamWriter.
* This leads to some minor duplication, because neither inherits
@@ -67,7 +71,7 @@ public class PrintStream extends FilterOutputStream
// Line separator string.
private static final char[] line_separator
- = SystemProperties.getProperty("line.separator").toCharArray();
+ = SystemProperties.getProperty("line.separator", "\n").toCharArray();
/**
* Encoding name
@@ -620,5 +624,51 @@ public class PrintStream extends FilterOutputStream
setError ();
}
}
-} // class PrintStream
+ /** @since 1.5 */
+ public PrintStream append(char c)
+ {
+ print(c);
+ return this;
+ }
+
+ /** @since 1.5 */
+ public PrintStream append(CharSequence cs)
+ {
+ print(cs == null ? "null" : cs.toString());
+ return this;
+ }
+
+ /** @since 1.5 */
+ public PrintStream append(CharSequence cs, int start, int end)
+ {
+ print(cs == null ? "null" : cs.subSequence(start, end).toString());
+ return this;
+ }
+
+ /** @since 1.5 */
+ public PrintStream printf(String format, Object... args)
+ {
+ return format(format, args);
+ }
+
+ /** @since 1.5 */
+ public PrintStream printf(Locale locale, String format, Object... args)
+ {
+ return format(locale, format, args);
+ }
+
+ /** @since 1.5 */
+ public PrintStream format(String format, Object... args)
+ {
+ return format(Locale.getDefault(), format, args);
+ }
+
+ /** @since 1.5 */
+ public PrintStream format(Locale locale, String format, Object... args)
+ {
+ Formatter f = new Formatter(this, locale);
+ f.format(format, args);
+ return this;
+ }
+} // class PrintStream
diff --git a/libjava/classpath/java/io/PrintWriter.java b/libjava/classpath/java/io/PrintWriter.java
index 5667e705004..5b4294cbaa7 100644
--- a/libjava/classpath/java/io/PrintWriter.java
+++ b/libjava/classpath/java/io/PrintWriter.java
@@ -1,5 +1,5 @@
/* PrintWriter.java -- prints primitive values and objects to a stream as text
- Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
+ Copyright (C) 1998, 1999, 2000, 2001, 2005 Free Software Foundation
This file is part of GNU Classpath.
@@ -37,6 +37,9 @@ exception statement from your version. */
package java.io;
+import java.util.Locale;
+import java.util.Formatter;
+
/* Written using "Java Class Libraries", 2nd edition, plus online
* API docs for JDK 1.2 beta from http://www.javasoft.com.
* Status: Believed complete and correct.
@@ -636,5 +639,52 @@ public class PrintWriter extends Writer
{
write(str, 0, str.length());
}
+
+ /** @since 1.5 */
+ public PrintWriter append(char c)
+ {
+ write(c);
+ return this;
+ }
+
+ /** @since 1.5 */
+ public PrintWriter append(CharSequence cs)
+ {
+ write(cs == null ? "null" : cs.toString());
+ return this;
+ }
+
+ /** @since 1.5 */
+ public PrintWriter append(CharSequence cs, int start, int end)
+ {
+ write(cs == null ? "null" : cs.subSequence(start, end).toString());
+ return this;
+ }
+
+ /** @since 1.5 */
+ public PrintWriter printf(String format, Object... args)
+ {
+ return format(format, args);
+ }
+
+ /** @since 1.5 */
+ public PrintWriter printf(Locale locale, String format, Object... args)
+ {
+ return format(locale, format, args);
+ }
+
+ /** @since 1.5 */
+ public PrintWriter format(String format, Object... args)
+ {
+ return format(Locale.getDefault(), format, args);
+ }
+
+ /** @since 1.5 */
+ public PrintWriter format(Locale locale, String format, Object... args)
+ {
+ Formatter f = new Formatter(this, locale);
+ f.format(format, args);
+ return this;
+ }
}
diff --git a/libjava/classpath/java/io/RandomAccessFile.java b/libjava/classpath/java/io/RandomAccessFile.java
index 84ee5dec01e..036fc8c6bda 100644
--- a/libjava/classpath/java/io/RandomAccessFile.java
+++ b/libjava/classpath/java/io/RandomAccessFile.java
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.io;
-import gnu.java.nio.channels.FileChannelImpl;
+import gnu.java.nio.FileChannelImpl;
import java.nio.channels.FileChannel;
@@ -58,7 +58,7 @@ import java.nio.channels.FileChannel;
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Tom Tromey (tromey@cygnus.com)
*/
-public class RandomAccessFile implements DataOutput, DataInput
+public class RandomAccessFile implements DataOutput, DataInput, Closeable
{
// The underlying file.
@@ -122,7 +122,20 @@ public class RandomAccessFile implements DataOutput, DataInput
s.checkWrite(fileName);
}
- ch = FileChannelImpl.create(file, fdmode);
+ try
+ {
+ ch = FileChannelImpl.create(file, fdmode);
+ }
+ catch (FileNotFoundException fnfe)
+ {
+ throw fnfe;
+ }
+ catch (IOException ioe)
+ {
+ FileNotFoundException fnfe = new FileNotFoundException(file.getPath());
+ fnfe.initCause(ioe);
+ throw fnfe;
+ }
fd = new FileDescriptor(ch);
if ((fdmode & FileChannelImpl.WRITE) != 0)
out = new DataOutputStream (new FileOutputStream (fd));
diff --git a/libjava/classpath/java/io/Reader.java b/libjava/classpath/java/io/Reader.java
index 7970d9a2434..6da1813c6ca 100644
--- a/libjava/classpath/java/io/Reader.java
+++ b/libjava/classpath/java/io/Reader.java
@@ -1,5 +1,5 @@
/* Reader.java -- base class of classes that read input as a stream of chars
- Copyright (C) 1998, 1999, 2000, 2003 Free Software Foundation
+ Copyright (C) 1998, 1999, 2000, 2003, 2004, 2005 Free Software Foundation
This file is part of GNU Classpath.
@@ -37,6 +37,8 @@ exception statement from your version. */
package java.io;
+import java.nio.CharBuffer;
+
/* Written using "Java Class Libraries", 2nd edition, plus online
* API docs for JDK 1.2 beta from http://www.javasoft.com.
* Status: Believed complete and correct.
@@ -53,7 +55,7 @@ package java.io;
* @date April 21, 1998.
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public abstract class Reader
+public abstract class Reader implements Closeable, Readable
{
/**
* This is the <code>Object</code> used for synchronizing critical code
@@ -152,6 +154,19 @@ public abstract class Reader
return count > 0 ? buf[0] : -1;
}
+ /** @since 1.5 */
+ public int read(CharBuffer buffer) throws IOException
+ {
+ // We want to call put(), so we don't manipulate the CharBuffer
+ // directly.
+ int rem = buffer.remaining();
+ char[] buf = new char[rem];
+ int result = read(buf, 0, rem);
+ if (result != -1)
+ buffer.put(buf, 0, result);
+ return result;
+ }
+
/**
* Closes the stream. Any futher attempts to read from the
* stream may generate an <code>IOException</code>.
diff --git a/libjava/classpath/java/io/SequenceInputStream.java b/libjava/classpath/java/io/SequenceInputStream.java
index 7fefe243263..5ff85e9893f 100644
--- a/libjava/classpath/java/io/SequenceInputStream.java
+++ b/libjava/classpath/java/io/SequenceInputStream.java
@@ -1,5 +1,5 @@
/* SequenceInputStream.java -- Reads multiple input streams in sequence
- Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -71,8 +71,11 @@ public class SequenceInputStream extends InputStream
/** Secondary input stream; not used if constructed w/ enumeration. */
private InputStream in2;
- /** The enumeration handle; not used if constructed w/ 2 explicit input streams. */
- private Enumeration e;
+ /**
+ * The enumeration handle; not used if constructed w/ 2 explicit
+ * input streams.
+ */
+ private Enumeration<? extends InputStream> e;
/**
* This method creates a new <code>SequenceInputStream</code> that obtains
@@ -82,10 +85,10 @@ public class SequenceInputStream extends InputStream
* @param e An <code>Enumeration</code> that will return a list of
* <code>InputStream</code>s to read in sequence
*/
- public SequenceInputStream(Enumeration e)
+ public SequenceInputStream(Enumeration<? extends InputStream> e)
{
this.e = e;
- in = (InputStream) e.nextElement();
+ in = e.nextElement();
in2 = null;
}
@@ -207,14 +210,13 @@ public class SequenceInputStream extends InputStream
if (e != null)
{
if (e.hasMoreElements())
- nextIn = (InputStream) e.nextElement();
+ nextIn = e.nextElement();
+ }
+ else if (in2 != null)
+ {
+ nextIn = in2;
+ in2 = null;
}
- else
- if (in2 != null)
- {
- nextIn = in2;
- in2 = null;
- }
return nextIn;
}
diff --git a/libjava/classpath/java/io/StringWriter.java b/libjava/classpath/java/io/StringWriter.java
index a1e9aeb6bd2..5a16e63ea7a 100644
--- a/libjava/classpath/java/io/StringWriter.java
+++ b/libjava/classpath/java/io/StringWriter.java
@@ -183,6 +183,27 @@ public class StringWriter extends Writer
buffer.append(str.substring(offset, offset + len));
}
+ /** @since 1.5 */
+ public StringWriter append(char c)
+ {
+ write(c);
+ return this;
+ }
+
+ /** @since 1.5 */
+ public StringWriter append(CharSequence cs)
+ {
+ write(cs == null ? "null" : cs.toString());
+ return this;
+ }
+
+ /** @since 1.5 */
+ public StringWriter append(CharSequence cs, int start, int end)
+ {
+ write(cs == null ? "null" : cs.subSequence(start, end).toString());
+ return this;
+ }
+
/**
* This is the <code>StringBuffer</code> that we use to store bytes that
* are written.
diff --git a/libjava/classpath/java/io/Writer.java b/libjava/classpath/java/io/Writer.java
index f153e31cfed..660b6908935 100644
--- a/libjava/classpath/java/io/Writer.java
+++ b/libjava/classpath/java/io/Writer.java
@@ -53,7 +53,7 @@ package java.io;
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Per Bothner (bothner@cygnus.com)
*/
-public abstract class Writer
+public abstract class Writer implements Appendable, Closeable, Flushable
{
/**
* This is the object used to synchronize criticial code sections for
@@ -188,5 +188,24 @@ public abstract class Writer
write(buf, 0, len);
}
-} // class Writer
+ /** @since 1.5 */
+ public Writer append(char c) throws IOException
+ {
+ write(c);
+ return this;
+ }
+ /** @since 1.5 */
+ public Writer append(CharSequence cs) throws IOException
+ {
+ write(cs == null ? "null" : cs.toString());
+ return this;
+ }
+
+ /** @since 1.5 */
+ public Writer append(CharSequence cs, int start, int end) throws IOException
+ {
+ write(cs == null ? "null" : cs.subSequence(start, end).toString());
+ return this;
+ }
+}
diff --git a/libjava/classpath/java/io/class-dependencies.conf b/libjava/classpath/java/io/class-dependencies.conf
new file mode 100644
index 00000000000..633bb174941
--- /dev/null
+++ b/libjava/classpath/java/io/class-dependencies.conf
@@ -0,0 +1,100 @@
+# This property file contains dependencies of classes, methods, and
+# field on other methods or classes.
+#
+# Syntax:
+#
+# <used>: <needed 1> [... <needed N>]
+#
+# means that when <used> is included, <needed 1> (... <needed N>) must
+# be included as well.
+#
+# <needed X> and <used> are of the form
+#
+# <class.methodOrField(signature)>
+#
+# or just
+#
+# <class>
+#
+# Within dependencies, variables can be used. A variable is defined as
+# follows:
+#
+# {variable}: value1 value2 ... value<n>
+#
+# variables can be used on the right side of dependencies as follows:
+#
+# <used>: com.bla.blu.{variable}.Class.m()V
+#
+# The use of the variable will expand to <n> dependencies of the form
+#
+# <used>: com.bla.blu.value1.Class.m()V
+# <used>: com.bla.blu.value2.Class.m()V
+# ...
+# <used>: com.bla.blu.value<n>.Class.m()V
+#
+# Variables can be redefined when building a system to select the
+# required support for features like encodings, protocols, etc.
+#
+# Hints:
+#
+# - For methods and fields, the signature is mandatory. For
+# specification, please see the Java Virtual Machine Specification by
+# SUN. Unlike in the spec, field signatures (types) are in brackets.
+#
+# - Package names must be separated by '/' (and not '.'). E.g.,
+# java/lang/Class (this is necessary, because the '.' is used to
+# separate method or field names from classes)
+#
+# - In case <needed> refers to a class, only the class itself will be
+# included in the resulting binary, NOT necessarily all its methods
+# and fields. If you want to refer to all methods and fields, you can
+# write class.* as an abbreviation.
+#
+# - Abbreviations for packages are also possible: my/package/* means all
+# methods and fields of all classes in my/package.
+#
+# - A line with a trailing '\' continues in the next line.
+
+java/io/File: \
+ java/lang/ClassNotFoundException.<init>(Ljava/lang/String;)V \
+ java/lang/InternalError.<init>(Ljava/lang/String;)V \
+ java/io/IOException.<init>(Ljava/lang/String;)V \
+ java/lang/IllegalArgumentException.<init>(Ljava/lang/String;)V
+
+java/io/FileDescriptor: \
+ java/lang/ClassNotFoundException.<init>(Ljava/lang/String;)V \
+ java/lang/InternalError.<init>(Ljava/lang/String;)V \
+ java/lang/IllegalArgumentException.<init>(Ljava/lang/String;)V \
+ java/io/IOException.<init>(Ljava/lang/String;)V
+
+java/io/FileInputStream: \
+ java/lang/ClassNotFoundException.<init>(Ljava/lang/String;)V \
+ java/lang/InternalError.<init>(Ljava/lang/String;)V \
+ java/io/IOException.<init>(Ljava/lang/String;)V \
+ java/io/FileNotFoundException.<init>(Ljava/lang/String;)V
+
+java/io/FileOutputStream: \
+ java/lang/ClassNotFoundException.<init>(Ljava/lang/String;)V \
+ java/lang/InternalError.<init>(Ljava/lang/String;)V \
+ java/io/FileNotFoundException.<init>(Ljava/lang/String;)V \
+ java/io/IOException.<init>(Ljava/lang/String;)V
+
+java/io/ObjectInputStream: \
+ java/lang/ClassNotFoundException.<init>(Ljava/lang/String;)V \
+ java/lang/InternalError.<init>(Ljava/lang/String;)V \
+ java/lang/SecurityManager.currentClassLoader()Ljava/lang/ClassLoader; \
+ java/lang/IllegalArgumentException.<init>(Ljava/lang/String;)V
+
+java/io/ObjectOutputStream: \
+ java/lang/ClassNotFoundException.<init>(Ljava/lang/String;)V \
+ java/lang/InternalError.<init>(Ljava/lang/String;)V \
+ java/lang/SecurityManager.currentClassLoader()Ljava/lang/ClassLoader; \
+ java/lang/IllegalArgumentException.<init>(Ljava/lang/String;)V
+
+java/io/RandomAccessFile: \
+ java/lang/ClassNotFoundException.<init>(Ljava/lang/String;)V \
+ java/lang/InternalError.<init>(Ljava/lang/String;)V \
+ java/io/FileNotFoundException.<init>(Ljava/lang/String;)V \
+ java/io/IOException.<init>(Ljava/lang/String;)V
+
+# end of file
diff --git a/libjava/classpath/java/lang/Boolean.java b/libjava/classpath/java/lang/Boolean.java
index 23992525c9d..2b0236d1b9b 100644
--- a/libjava/classpath/java/lang/Boolean.java
+++ b/libjava/classpath/java/lang/Boolean.java
@@ -1,5 +1,5 @@
/* Boolean.java -- object wrapper for boolean
- Copyright (C) 1998, 2001, 2002, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,7 +49,7 @@ import java.io.Serializable;
* @since 1.0
* @status updated to 1.5
*/
-public final class Boolean implements Serializable, Comparable
+public final class Boolean implements Serializable, Comparable<Boolean>
{
/**
* Compatible with JDK 1.0.2+.
@@ -78,7 +78,7 @@ public final class Boolean implements Serializable, Comparable
*
* @since 1.1
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass('Z');
+ public static final Class<Boolean> TYPE = (Class<Boolean>) VMClassLoader.getPrimitiveClass('Z');
/**
* The immutable value of this Boolean.
@@ -237,14 +237,6 @@ public final class Boolean implements Serializable, Comparable
}
/**
- * Bridge method
- */
- public int compareTo(Object other)
- {
- return compareTo((Boolean)other);
- }
-
- /**
* If the String argument is "true", ignoring case, return true.
* Otherwise, return false.
*
@@ -255,5 +247,5 @@ public final class Boolean implements Serializable, Comparable
{
return "true".equalsIgnoreCase(b) ? true : false;
}
-
+
}
diff --git a/libjava/classpath/java/lang/Byte.java b/libjava/classpath/java/lang/Byte.java
index 2560bfcffc3..7f53a494b95 100644
--- a/libjava/classpath/java/lang/Byte.java
+++ b/libjava/classpath/java/lang/Byte.java
@@ -1,5 +1,5 @@
/* Byte.java -- object wrapper for byte
- Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,10 +49,12 @@ package java.lang;
* @author John Keiser
* @author Per Bothner
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.1
* @status updated to 1.5
*/
-public final class Byte extends Number implements Comparable
+public final class Byte extends Number implements Comparable<Byte>
{
/**
* Compatible with JDK 1.1+.
@@ -75,7 +77,7 @@ public final class Byte extends Number implements Comparable
* The primitive type <code>byte</code> is represented by this
* <code>Class</code> object.
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass('B');
+ public static final Class<Byte> TYPE = (Class<Byte>) VMClassLoader.getPrimitiveClass('B');
/**
* The number of bits needed to represent a <code>byte</code>.
@@ -87,6 +89,7 @@ public final class Byte extends Number implements Comparable
// valueOf(). We're required to cache all possible values here.
private static Byte[] byteCache = new Byte[MAX_VALUE - MIN_VALUE + 1];
+
/**
* The immutable value of this Byte.
*
@@ -208,20 +211,18 @@ public final class Byte extends Number implements Comparable
*
* @param val the value to wrap
* @return the <code>Byte</code>
- *
- * @since 1.5
*/
public static Byte valueOf(byte val)
{
synchronized (byteCache)
{
- if (byteCache[val - MIN_VALUE] == null)
- byteCache[val - MIN_VALUE] = new Byte(val);
- return byteCache[val - MIN_VALUE];
+ if (byteCache[val - MIN_VALUE] == null)
+ byteCache[val - MIN_VALUE] = new Byte(val);
+ return byteCache[val - MIN_VALUE];
}
}
- /**
+ /**
* Convert the specified <code>String</code> into a <code>Byte</code>.
* The <code>String</code> may represent decimal, hexadecimal, or
* octal numbers.
@@ -369,19 +370,4 @@ public final class Byte extends Number implements Comparable
return value - b.value;
}
- /**
- * Behaves like <code>compareTo(Byte)</code> unless the Object
- * is not a <code>Byte</code>.
- *
- * @param o the object to compare
- * @return the comparison
- * @throws ClassCastException if the argument is not a <code>Byte</code>
- * @see #compareTo(Byte)
- * @see Comparable
- * @since 1.2
- */
- public int compareTo(Object o)
- {
- return compareTo((Byte) o);
- }
}
diff --git a/libjava/classpath/java/lang/Character.java b/libjava/classpath/java/lang/Character.java
index 59ae12f7790..b9c6f24e79f 100644
--- a/libjava/classpath/java/lang/Character.java
+++ b/libjava/classpath/java/lang/Character.java
@@ -1,5 +1,5 @@
/* java.lang.Character -- Wrapper class for char, and Unicode subsets
- Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -65,11 +65,12 @@ import java.util.Locale;
* @author Paul N. Fisher
* @author Jochen Hoenicke
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @see CharData
* @since 1.0
- * @status updated to 1.4
+ * @status partly updated to 1.5; some things still missing
*/
-public final class Character implements Serializable, Comparable
+public final class Character implements Serializable, Comparable<Character>
{
/**
* A subset of Unicode blocks.
@@ -154,10 +155,8 @@ public final class Character implements Serializable, Comparable
/** The canonical name of the block according to the Unicode standard. */
private final String canonicalName;
- /** Constants for the <code>forName()</code> method */
- private static final int CANONICAL_NAME = 0;
- private static final int NO_SPACES_NAME = 1;
- private static final int CONSTANT_NAME = 2;
+ /** Enumeration for the <code>forName()</code> method */
+ private enum NameType { CANONICAL, NO_SPACES, CONSTANT; };
/**
* Constructor for strictly defined blocks.
@@ -169,7 +168,7 @@ public final class Character implements Serializable, Comparable
* standard.
*/
private UnicodeBlock(int start, int end, String name,
- String canonicalName)
+ String canonicalName)
{
super(name);
this.start = start;
@@ -203,8 +202,8 @@ public final class Character implements Serializable, Comparable
public static UnicodeBlock of(int codePoint)
{
if (codePoint > MAX_CODE_POINT)
- throw new IllegalArgumentException("The supplied integer value is " +
- "too large to be a codepoint.");
+ throw new IllegalArgumentException("The supplied integer value is " +
+ "too large to be a codepoint.");
// Simple binary search for the correct block.
int low = 0;
int hi = sets.length - 1;
@@ -258,59 +257,51 @@ public final class Character implements Serializable, Comparable
*/
public static final UnicodeBlock forName(String blockName)
{
- int type;
+ NameType type;
if (blockName.indexOf(' ') != -1)
- type = CANONICAL_NAME;
+ type = NameType.CANONICAL;
else if (blockName.indexOf('_') != -1)
- type = CONSTANT_NAME;
+ type = NameType.CONSTANT;
else
- type = NO_SPACES_NAME;
+ type = NameType.NO_SPACES;
Collator usCollator = Collator.getInstance(Locale.US);
usCollator.setStrength(Collator.PRIMARY);
/* Special case for deprecated blocks not in sets */
switch (type)
{
- case CANONICAL_NAME:
+ case CANONICAL:
if (usCollator.compare(blockName, "Surrogates Area") == 0)
return SURROGATES_AREA;
break;
- case NO_SPACES_NAME:
+ case NO_SPACES:
if (usCollator.compare(blockName, "SurrogatesArea") == 0)
return SURROGATES_AREA;
break;
- case CONSTANT_NAME:
+ case CONSTANT:
if (usCollator.compare(blockName, "SURROGATES_AREA") == 0)
return SURROGATES_AREA;
break;
}
/* Other cases */
- int setLength = sets.length;
switch (type)
{
- case CANONICAL_NAME:
- for (int i = 0; i < setLength; i++)
- {
- UnicodeBlock block = sets[i];
- if (usCollator.compare(blockName, block.canonicalName) == 0)
- return block;
- }
+ case CANONICAL:
+ for (UnicodeBlock block : sets)
+ if (usCollator.compare(blockName, block.canonicalName) == 0)
+ return block;
break;
- case NO_SPACES_NAME:
- for (int i = 0; i < setLength; i++)
- {
- UnicodeBlock block = sets[i];
- String nsName = block.canonicalName.replaceAll(" ","");
- if (usCollator.compare(blockName, nsName) == 0)
- return block;
- }
- break;
- case CONSTANT_NAME:
- for (int i = 0; i < setLength; i++)
- {
- UnicodeBlock block = sets[i];
- if (usCollator.compare(blockName, block.toString()) == 0)
- return block;
- }
+ case NO_SPACES:
+ for (UnicodeBlock block : sets)
+ {
+ String nsName = block.canonicalName.replaceAll(" ","");
+ if (usCollator.compare(blockName, nsName) == 0)
+ return block;
+ }
+ break;
+ case CONSTANT:
+ for (UnicodeBlock block : sets)
+ if (usCollator.compare(blockName, block.toString()) == 0)
+ return block;
break;
}
throw new IllegalArgumentException("No Unicode block found for " +
@@ -1513,10 +1504,11 @@ public final class Character implements Serializable, Comparable
* this. These are also returned from calls to <code>of(int)</code>
* and <code>of(char)</code>.
*/
+ @Deprecated
public static final UnicodeBlock SURROGATES_AREA
= new UnicodeBlock(0xD800, 0xDFFF,
"SURROGATES_AREA",
- "Surrogates Area");
+ "Surrogates Area");
/**
* The defined subsets.
@@ -1979,11 +1971,78 @@ public final class Character implements Serializable, Comparable
public static final char MAX_VALUE = '\uFFFF';
/**
+ * The minimum Unicode 4.0 code point. This value is <code>0</code>.
+ * @since 1.5
+ */
+ public static final int MIN_CODE_POINT = 0;
+
+ /**
+ * The maximum Unicode 4.0 code point, which is greater than the range
+ * of the char data type.
+ * This value is <code>0x10FFFF</code>.
+ * @since 1.5
+ */
+ public static final int MAX_CODE_POINT = 0x10FFFF;
+
+ /**
+ * The minimum Unicode high surrogate code unit, or
+ * <emph>leading-surrogate</emph>, in the UTF-16 character encoding.
+ * This value is <code>'\uD800'</code>.
+ * @since 1.5
+ */
+ public static final char MIN_HIGH_SURROGATE = '\uD800';
+
+ /**
+ * The maximum Unicode high surrogate code unit, or
+ * <emph>leading-surrogate</emph>, in the UTF-16 character encoding.
+ * This value is <code>'\uDBFF'</code>.
+ * @since 1.5
+ */
+ public static final char MAX_HIGH_SURROGATE = '\uDBFF';
+
+ /**
+ * The minimum Unicode low surrogate code unit, or
+ * <emph>trailing-surrogate</emph>, in the UTF-16 character encoding.
+ * This value is <code>'\uDC00'</code>.
+ * @since 1.5
+ */
+ public static final char MIN_LOW_SURROGATE = '\uDC00';
+
+ /**
+ * The maximum Unicode low surrogate code unit, or
+ * <emph>trailing-surrogate</emph>, in the UTF-16 character encoding.
+ * This value is <code>'\uDFFF'</code>.
+ * @since 1.5
+ */
+ public static final char MAX_LOW_SURROGATE = '\uDFFF';
+
+ /**
+ * The minimum Unicode surrogate code unit in the UTF-16 character encoding.
+ * This value is <code>'\uD800'</code>.
+ * @since 1.5
+ */
+ public static final char MIN_SURROGATE = MIN_HIGH_SURROGATE;
+
+ /**
+ * The maximum Unicode surrogate code unit in the UTF-16 character encoding.
+ * This value is <code>'\uDFFF'</code>.
+ * @since 1.5
+ */
+ public static final char MAX_SURROGATE = MAX_LOW_SURROGATE;
+
+ /**
+ * The lowest possible supplementary Unicode code point (the first code
+ * point outside the basic multilingual plane (BMP)).
+ * This value is <code>0x10000</code>.
+ */
+ public static final int MIN_SUPPLEMENTARY_CODE_POINT = 0x10000;
+
+ /**
* Class object representing the primitive char data type.
*
* @since 1.1
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass('C');
+ public static final Class<Character> TYPE = (Class<Character>) VMClassLoader.getPrimitiveClass('C');
/**
* The number of bits needed to represent a <code>char</code>.
@@ -2378,7 +2437,7 @@ public final class Character implements Serializable, Comparable
* Stores unicode attribute offset lookup table. Exploit package visibility
* of String.value to avoid copying the array.
* @see CharData#DATA
- */
+ */
private static final char[][] data =
new char[][]{
String.zeroBasedStringValue(CharData.DATA[0]),
@@ -2528,71 +2587,6 @@ public final class Character implements Serializable, Comparable
private static final int MIRROR_MASK = 0x40;
/**
- * Min value for supplementary code point.
- *
- * @since 1.5
- */
- public static final int MIN_SUPPLEMENTARY_CODE_POINT = 0x10000;
-
- /**
- * Min value for code point.
- *
- * @since 1.5
- */
- public static final int MIN_CODE_POINT = 0;
-
-
- /**
- * Max value for code point.
- *
- * @since 1.5
- */
- public static final int MAX_CODE_POINT = 0x010ffff;
-
-
- /**
- * Minimum high surrogate code in UTF-16 encoding.
- *
- * @since 1.5
- */
- public static final char MIN_HIGH_SURROGATE = '\ud800';
-
- /**
- * Maximum high surrogate code in UTF-16 encoding.
- *
- * @since 1.5
- */
- public static final char MAX_HIGH_SURROGATE = '\udbff';
-
- /**
- * Minimum low surrogate code in UTF-16 encoding.
- *
- * @since 1.5
- */
- public static final char MIN_LOW_SURROGATE = '\udc00';
-
- /**
- * Maximum low surrogate code in UTF-16 encoding.
- *
- * @since 1.5
- */
- public static final char MAX_LOW_SURROGATE = '\udfff';
-
- /**
- * Minimum surrogate code in UTF-16 encoding.
- *
- * @since 1.5
- */
- public static final char MIN_SURROGATE = MIN_HIGH_SURROGATE;
-
- /**
- * Maximum low surrogate code in UTF-16 encoding.
- *
- * @since 1.5
- */
- public static final char MAX_SURROGATE = MAX_LOW_SURROGATE;
-
- /**
* Grabs an attribute offset from the Unicode attribute database. The lower
* 5 bits are the character type, the next 2 bits are flags, and the top
* 9 bits are the offset into the attribute tables.
@@ -2605,6 +2599,7 @@ public final class Character implements Serializable, Comparable
* @see CharData#DATA
* @see CharData#SHIFT
*/
+ // Package visible for use in String.
static char readCodePoint(int codePoint)
{
int plane = codePoint >>> 16;
@@ -2778,7 +2773,7 @@ public final class Character implements Serializable, Comparable
{
return isTitleCase((int)ch);
}
-
+
/**
* Determines if a character is a Unicode titlecase letter. For example,
* the character "Lj" (Latin capital L with small letter j) is titlecase.
@@ -3282,7 +3277,7 @@ public final class Character implements Serializable, Comparable
| (1 << CURRENCY_SYMBOL)
| (1 << CONNECTOR_PUNCTUATION))) != 0;
}
-
+
/**
* Determines if a character can follow the first letter in
* a Java identifier. This is the combination of isJavaLetter (isLetter,
@@ -3468,6 +3463,7 @@ public final class Character implements Serializable, Comparable
{
return isIdentifierIgnorable((int)ch);
}
+
/**
* Determines if a character is ignorable in a Unicode identifier. This
* includes the non-whitespace ISO control characters (<code>'\u0000'</code>
@@ -3610,7 +3606,7 @@ public final class Character implements Serializable, Comparable
return title[i + 1];
return toUpperCase(ch);
}
-
+
/**
* Converts a Unicode character into its titlecase equivalent mapping.
* If a mapping does not exist, then the character passed is returned.
@@ -4103,6 +4099,7 @@ public final class Character implements Serializable, Comparable
// The result will correctly be signed.
return getDirectionality((int)ch);
}
+
/**
* Returns the Unicode directionality property of the character. This
@@ -4198,30 +4195,13 @@ public final class Character implements Serializable, Comparable
}
/**
- * Compares an object to this Character. Assuming the object is a
- * Character object, this method performs the same comparison as
- * compareTo(Character).
- *
- * @param o object to compare
- * @return the comparison value
- * @throws ClassCastException if o is not a Character object
- * @throws NullPointerException if o is null
- * @see #compareTo(Character)
- * @since 1.2
- */
- public int compareTo(Object o)
- {
- return compareTo((Character) o);
- }
-
- /**
* Returns an <code>Character</code> object wrapping the value.
* In contrast to the <code>Character</code> constructor, this method
* will cache some values. It is used by boxing conversion.
*
* @param val the value to wrap
* @return the <code>Character</code>
- *
+ *
* @since 1.5
*/
public static Character valueOf(char val)
@@ -4230,9 +4210,9 @@ public final class Character implements Serializable, Comparable
return new Character(val);
synchronized (charCache)
{
- if (charCache[val - MIN_VALUE] == null)
- charCache[val - MIN_VALUE] = new Character(val);
- return charCache[val - MIN_VALUE];
+ if (charCache[val - MIN_VALUE] == null)
+ charCache[val - MIN_VALUE] = new Character(val);
+ return charCache[val - MIN_VALUE];
}
}
diff --git a/libjava/classpath/java/lang/Class.java b/libjava/classpath/java/lang/Class.java
index 090ac234a48..f44782f9692 100644
--- a/libjava/classpath/java/lang/Class.java
+++ b/libjava/classpath/java/lang/Class.java
@@ -42,17 +42,14 @@ import gnu.classpath.VMStackWalker;
import gnu.java.lang.reflect.ClassSignatureParser;
import java.io.InputStream;
-import java.io.ObjectStreamClass;
import java.io.Serializable;
import java.lang.annotation.Annotation;
-import java.lang.reflect.Array;
+import java.lang.annotation.Inherited;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.GenericDeclaration;
-import java.lang.reflect.GenericSignatureFormatError;
import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.MalformedParameterizedTypeException;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
@@ -66,6 +63,7 @@ import java.security.PrivilegedAction;
import java.security.ProtectionDomain;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
@@ -97,11 +95,10 @@ import java.util.HashSet;
* @author Eric Blake (ebb9@email.byu.edu)
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @author Tom Tromey (tromey@cygnus.com)
* @since 1.0
* @see ClassLoader
*/
-public final class Class
+public final class Class<T>
implements Serializable, Type, AnnotatedElement, GenericDeclaration
{
/**
@@ -147,7 +144,7 @@ public final class Class
final transient Object vmdata;
/** newInstance() caches the default constructor */
- private transient Constructor constructor;
+ private transient Constructor<T> constructor;
/**
* Class is non-instantiable from Java code; only the VM can create
@@ -184,7 +181,7 @@ public final class Class
* @throws ExceptionInInitializerError if the class loads, but an exception
* occurs during initialization
*/
- public static Class forName(String name) throws ClassNotFoundException
+ public static Class<?> forName(String name) throws ClassNotFoundException
{
return VMClass.forName(name, true, VMStackWalker.getCallingClassLoader());
}
@@ -216,8 +213,8 @@ public final class Class
* @see ClassLoader
* @since 1.2
*/
- public static Class forName(String name, boolean initialize,
- ClassLoader classloader)
+ public static Class<?> forName(String name, boolean initialize,
+ ClassLoader classloader)
throws ClassNotFoundException
{
if (classloader == null)
@@ -232,7 +229,7 @@ public final class Class
sm.checkPermission(new RuntimePermission("getClassLoader"));
}
}
- return VMClass.forName(name, initialize, classloader);
+ return (Class<?>) VMClass.forName(name, initialize, classloader);
}
/**
@@ -247,7 +244,7 @@ public final class Class
* @throws SecurityException if the security check fails
* @since 1.1
*/
- public Class[] getClasses()
+ public Class<?>[] getClasses()
{
memberAccessCheck(Member.PUBLIC);
return internalGetClasses();
@@ -256,14 +253,14 @@ public final class Class
/**
* Like <code>getClasses()</code> but without the security checks.
*/
- private Class[] internalGetClasses()
+ private Class<?>[] internalGetClasses()
{
- ArrayList list = new ArrayList();
+ ArrayList<Class> list = new ArrayList<Class>();
list.addAll(Arrays.asList(getDeclaredClasses(true)));
Class superClass = getSuperclass();
if (superClass != null)
list.addAll(Arrays.asList(superClass.internalGetClasses()));
- return (Class[])list.toArray(new Class[list.size()]);
+ return list.toArray(new Class<?>[list.size()]);
}
/**
@@ -307,7 +304,7 @@ public final class Class
* @see Array
* @since 1.1
*/
- public Class getComponentType()
+ public Class<?> getComponentType()
{
return VMClass.getComponentType (this);
}
@@ -326,7 +323,8 @@ public final class Class
* @see #getConstructors()
* @since 1.1
*/
- public Constructor getConstructor(Class[] types) throws NoSuchMethodException
+ public Constructor<T> getConstructor(Class<?>... types)
+ throws NoSuchMethodException
{
memberAccessCheck(Member.PUBLIC);
Constructor[] constructors = getDeclaredConstructors(true);
@@ -351,7 +349,7 @@ public final class Class
* @throws SecurityException if the security check fails
* @since 1.1
*/
- public Constructor[] getConstructors()
+ public Constructor<?>[] getConstructors()
{
memberAccessCheck(Member.PUBLIC);
return getDeclaredConstructors(true);
@@ -371,7 +369,7 @@ public final class Class
* @see #getDeclaredConstructors()
* @since 1.1
*/
- public Constructor getDeclaredConstructor(Class[] types)
+ public Constructor<T> getDeclaredConstructor(Class<?>... types)
throws NoSuchMethodException
{
memberAccessCheck(Member.DECLARED);
@@ -397,13 +395,13 @@ public final class Class
* @throws SecurityException if the security check fails
* @since 1.1
*/
- public Class[] getDeclaredClasses()
+ public Class<?>[] getDeclaredClasses()
{
memberAccessCheck(Member.DECLARED);
return getDeclaredClasses(false);
}
- Class[] getDeclaredClasses (boolean publicOnly)
+ Class<?>[] getDeclaredClasses (boolean publicOnly)
{
return VMClass.getDeclaredClasses (this, publicOnly);
}
@@ -420,13 +418,13 @@ public final class Class
* @throws SecurityException if the security check fails
* @since 1.1
*/
- public Constructor[] getDeclaredConstructors()
+ public Constructor<?>[] getDeclaredConstructors()
{
memberAccessCheck(Member.DECLARED);
return getDeclaredConstructors(false);
}
- Constructor[] getDeclaredConstructors (boolean publicOnly)
+ Constructor<?>[] getDeclaredConstructors (boolean publicOnly)
{
return VMClass.getDeclaredConstructors (this, publicOnly);
}
@@ -500,7 +498,7 @@ public final class Class
* @see #getDeclaredMethods()
* @since 1.1
*/
- public Method getDeclaredMethod(String methodName, Class[] types)
+ public Method getDeclaredMethod(String methodName, Class<?>... types)
throws NoSuchMethodException
{
memberAccessCheck(Member.DECLARED);
@@ -544,7 +542,7 @@ public final class Class
* @return the declaring class of this class
* @since 1.1
*/
- public Class getDeclaringClass()
+ public Class<?> getDeclaringClass()
{
return VMClass.getDeclaringClass (this);
}
@@ -597,7 +595,7 @@ public final class Class
*/
private Field[] internalGetFields()
{
- HashSet set = new HashSet();
+ HashSet<Field> set = new HashSet<Field>();
set.addAll(Arrays.asList(getDeclaredFields(true)));
Class[] interfaces = getInterfaces();
for (int i = 0; i < interfaces.length; i++)
@@ -605,7 +603,7 @@ public final class Class
Class superClass = getSuperclass();
if (superClass != null)
set.addAll(Arrays.asList(superClass.internalGetFields()));
- return (Field[])set.toArray(new Field[set.size()]);
+ return set.toArray(new Field[set.size()]);
}
/**
@@ -633,7 +631,7 @@ public final class Class
*
* @return the interfaces this class directly implements
*/
- public Class[] getInterfaces()
+ public Class<?>[] getInterfaces()
{
return VMClass.getInterfaces (this);
}
@@ -663,7 +661,7 @@ public final class Class
{
MethodKey m = (MethodKey) o;
if (m.name.equals(name) && m.params.length == params.length
- && m.returnType == returnType)
+ && m.returnType == returnType)
{
for (int i = 0; i < params.length; i++)
{
@@ -704,7 +702,7 @@ public final class Class
* @see #getMethods()
* @since 1.1
*/
- public Method getMethod(String methodName, Class[] types)
+ public Method getMethod(String methodName, Class<?>... types)
throws NoSuchMethodException
{
memberAccessCheck(Member.PUBLIC);
@@ -821,7 +819,7 @@ public final class Class
*/
private Method[] internalGetMethods()
{
- HashMap map = new HashMap();
+ HashMap<MethodKey,Method> map = new HashMap<MethodKey,Method>();
Method[] methods;
Class[] interfaces = getInterfaces();
for(int i = 0; i < interfaces.length; i++)
@@ -846,7 +844,7 @@ public final class Class
{
map.put(new MethodKey(methods[i]), methods[i]);
}
- return (Method[])map.values().toArray(new Method[map.size()]);
+ return map.values().toArray(new Method[map.size()]);
}
/**
@@ -1003,7 +1001,7 @@ public final class Class
*
* @return the direct superclass of this class
*/
- public Class getSuperclass()
+ public Class<? super T> getSuperclass()
{
return VMClass.getSuperclass (this);
}
@@ -1033,7 +1031,7 @@ public final class Class
* @throws NullPointerException if c is null
* @since 1.1
*/
- public boolean isAssignableFrom(Class c)
+ public boolean isAssignableFrom(Class<?> c)
{
return VMClass.isAssignableFrom (this, c);
}
@@ -1103,11 +1101,11 @@ public final class Class
* @throws ExceptionInInitializerError if class initialization caused by
* this call fails with an exception
*/
- public Object newInstance()
+ public T newInstance()
throws InstantiationException, IllegalAccessException
{
memberAccessCheck(Member.PUBLIC);
- Constructor constructor;
+ Constructor<T> constructor;
synchronized(this)
{
constructor = this.constructor;
@@ -1307,12 +1305,11 @@ public final class Class
* type, <code>U</code>.
* @since 1.5
*/
- /* FIXME[GENERICS]: Should be <U> Class<? extends U> asSubClass(Class<U> klass */
- public Class asSubclass(Class klass)
+ public <U> Class<? extends U> asSubclass(Class<U> klass)
{
if (! klass.isAssignableFrom(this))
throw new ClassCastException();
- return this; /* FIXME[GENERICS]: Should cast to Class<? extends U> */
+ return (Class<? extends U>) this;
}
/**
@@ -1322,12 +1319,11 @@ public final class Class
* @throws ClassCastException if obj is not an instance of this class
* @since 1.5
*/
- /* FIXME[GENERICS]: Should be T cast(Object obj) */
- public Object cast(Object obj)
+ public T cast(Object obj)
{
if (obj != null && ! isInstance(obj))
throw new ClassCastException();
- return obj; /* FIXME[GENERICS]: Should be cast to T */
+ return (T) obj;
}
/**
@@ -1395,15 +1391,13 @@ public final class Class
* class is not an <code>enum</code>.
* @since 1.5
*/
- /* FIXME[GENERICS]: T[] getEnumConstants() */
- public Object[] getEnumConstants()
+ public T[] getEnumConstants()
{
if (isEnum())
{
try
{
- return (Object[])
- getMethod("values", new Class[0]).invoke(null, new Object[0]);
+ return (T[]) getMethod("values").invoke(null);
}
catch (NoSuchMethodException exception)
{
@@ -1490,14 +1484,13 @@ public final class Class
* <code>null</code> if no such annotation exists.
* @since 1.5
*/
- /* FIXME[GENERICS]: <T extends Annotation> T getAnnotation(Class <T>) */
- public Annotation getAnnotation(Class annotationClass)
+ public <A extends Annotation> A getAnnotation(Class<A> annotationClass)
{
- Annotation foundAnnotation = null;
+ A foundAnnotation = null;
Annotation[] annotations = getAnnotations();
- for (int i = 0; i < annotations.length; i++)
- if (annotations[i].annotationType() == annotationClass)
- foundAnnotation = annotations[i];
+ for (Annotation annotation : annotations)
+ if (annotation.annotationType() == annotationClass)
+ foundAnnotation = (A) annotation;
return foundAnnotation;
}
@@ -1514,15 +1507,22 @@ public final class Class
*/
public Annotation[] getAnnotations()
{
- HashSet set = new HashSet();
- set.addAll(Arrays.asList(getDeclaredAnnotations()));
- Class[] interfaces = getInterfaces();
- for (int i = 0; i < interfaces.length; i++)
- set.addAll(Arrays.asList(interfaces[i].getAnnotations()));
- Class superClass = getSuperclass();
- if (superClass != null)
- set.addAll(Arrays.asList(superClass.getAnnotations()));
- return (Annotation[]) set.toArray(new Annotation[set.size()]);
+ HashMap<Class, Annotation> map = new HashMap<Class, Annotation>();
+ for (Annotation a : getDeclaredAnnotations())
+ map.put((Class) a.annotationType(), a);
+ for (Class<? super T> s = getSuperclass();
+ s != null;
+ s = s.getSuperclass())
+ {
+ for (Annotation a : s.getDeclaredAnnotations())
+ {
+ Class k = (Class) a.annotationType();
+ if (! map.containsKey(k) && k.isAnnotationPresent(Inherited.class))
+ map.put(k, a);
+ }
+ }
+ Collection<Annotation> v = map.values();
+ return v.toArray(new Annotation[v.size()]);
}
/**
@@ -1588,8 +1588,7 @@ public final class Class
* a top-level class.
* @since 1.5
*/
- /* FIXME[GENERICS]: Should return Class<?> */
- public Class getEnclosingClass()
+ public Class<?> getEnclosingClass()
{
return VMClass.getEnclosingClass(this);
}
@@ -1605,8 +1604,7 @@ public final class Class
* is returned.
* @since 1.5
*/
- /* FIXME[GENERICS]: Should return Constructor<?> */
- public Constructor getEnclosingConstructor()
+ public Constructor<?> getEnclosingConstructor()
{
return VMClass.getEnclosingConstructor(this);
}
@@ -1731,12 +1729,11 @@ public final class Class
* specification, version 3.
* @since 1.5
*/
- /* FIXME[GENERICS]: Should return TypeVariable<Class<T>> */
- public TypeVariable[] getTypeParameters()
+ public TypeVariable<Class<T>>[] getTypeParameters()
{
String sig = VMClass.getClassSignature(this);
if (sig == null)
- return new TypeVariable[0];
+ return (TypeVariable<Class<T>>[])new TypeVariable[0];
ClassSignatureParser p = new ClassSignatureParser(this, sig);
return p.getTypeParameters();
@@ -1751,8 +1748,7 @@ public final class Class
* @return true if an annotation exists for the specified type.
* @since 1.5
*/
- /* FIXME[GENERICS]: Should be Class<? extends Annotation> */
- public boolean isAnnotationPresent(Class
+ public boolean isAnnotationPresent(Class<? extends Annotation>
annotationClass)
{
return getAnnotation(annotationClass) != null;
diff --git a/libjava/classpath/java/lang/ClassLoader.java b/libjava/classpath/java/lang/ClassLoader.java
index 83ef98da342..3d7c32cc935 100644
--- a/libjava/classpath/java/lang/ClassLoader.java
+++ b/libjava/classpath/java/lang/ClassLoader.java
@@ -120,7 +120,6 @@ import java.util.StringTokenizer;
* @author Eric Blake (ebb9@email.byu.edu)
* @see Class
* @since 1.0
- * @status still missing 1.4 functionality
*/
public abstract class ClassLoader
{
@@ -128,7 +127,7 @@ public abstract class ClassLoader
* All packages defined by this classloader. It is not private in order to
* allow native code (and trusted subclasses) access to this field.
*/
- final HashMap definedPackages = new HashMap();
+ final HashMap<String, Package> definedPackages = new HashMap<String, Package>();
/**
* The classloader that is consulted before this classloader.
@@ -227,7 +226,7 @@ public abstract class ClassLoader
* by the null key. This map must be synchronized on this instance.
*/
// Package visible for use by Class.
- Map packageAssertionStatus;
+ Map<String, Boolean> packageAssertionStatus;
/**
* The map of class assertion status overrides, or null if no class
@@ -236,7 +235,7 @@ public abstract class ClassLoader
* instance.
*/
// Package visible for use by Class.
- Map classAssertionStatus;
+ Map<String, Boolean> classAssertionStatus;
/**
* VM private data.
@@ -289,7 +288,7 @@ public abstract class ClassLoader
* @return the loaded class
* @throws ClassNotFoundException if the class cannot be found
*/
- public Class loadClass(String name) throws ClassNotFoundException
+ public Class<?> loadClass(String name) throws ClassNotFoundException
{
return loadClass(name, false);
}
@@ -314,11 +313,11 @@ public abstract class ClassLoader
* @return the loaded class
* @throws ClassNotFoundException if the class cannot be found
*/
- protected synchronized Class loadClass(String name, boolean resolve)
+ protected synchronized Class<?> loadClass(String name, boolean resolve)
throws ClassNotFoundException
{
// Have we already loaded this class?
- Class c = findLoadedClass(name);
+ Class<?> c = findLoadedClass(name);
if (c == null)
{
// Can the class be loaded by a parent?
@@ -335,11 +334,11 @@ public abstract class ClassLoader
return parent.loadClass(name, resolve);
}
}
- catch (ClassNotFoundException e)
+ catch (ClassNotFoundException e)
{
}
- // Still not found, we have to do it ourself.
- c = findClass(name);
+ // Still not found, we have to do it ourself.
+ c = findClass(name);
}
if (resolve)
resolveClass(c);
@@ -388,7 +387,7 @@ public abstract class ClassLoader
* @throws ClassNotFoundException when the class can not be found
* @since 1.2
*/
- protected Class findClass(String name) throws ClassNotFoundException
+ protected Class<?> findClass(String name) throws ClassNotFoundException
{
throw new ClassNotFoundException(name);
}
@@ -406,7 +405,7 @@ public abstract class ClassLoader
* offset + len exceeds data
* @deprecated use {@link #defineClass(String, byte[], int, int)} instead
*/
- protected final Class defineClass(byte[] data, int offset, int len)
+ protected final Class<?> defineClass(byte[] data, int offset, int len)
throws ClassFormatError
{
return defineClass(null, data, offset, len);
@@ -431,8 +430,8 @@ public abstract class ClassLoader
* @throws SecurityException if name starts with "java."
* @since 1.1
*/
- protected final Class defineClass(String name, byte[] data, int offset,
- int len) throws ClassFormatError
+ protected final Class<?> defineClass(String name, byte[] data, int offset,
+ int len) throws ClassFormatError
{
return defineClass(name, data, offset, len, null);
}
@@ -460,9 +459,9 @@ public abstract class ClassLoader
* do not match up
* @since 1.2
*/
- protected final synchronized Class defineClass(String name, byte[] data,
- int offset, int len,
- ProtectionDomain domain)
+ protected final synchronized Class<?> defineClass(String name, byte[] data,
+ int offset, int len,
+ ProtectionDomain domain)
throws ClassFormatError
{
checkInitialized();
@@ -493,8 +492,8 @@ public abstract class ClassLoader
* do not match up
* @since 1.5
*/
- protected final Class defineClass(String name, ByteBuffer buf,
- ProtectionDomain domain)
+ protected final Class<?> defineClass(String name, ByteBuffer buf,
+ ProtectionDomain domain)
throws ClassFormatError
{
byte[] data = new byte[buf.remaining()];
@@ -510,7 +509,7 @@ public abstract class ClassLoader
* @throws NullPointerException if c is null
* @throws LinkageError if linking fails
*/
- protected final void resolveClass(Class c)
+ protected final void resolveClass(Class<?> c)
{
checkInitialized();
VMClassLoader.resolveClass(c);
@@ -525,7 +524,7 @@ public abstract class ClassLoader
* @return the found class
* @throws ClassNotFoundException if the class cannot be found
*/
- protected final Class findSystemClass(String name)
+ protected final Class<?> findSystemClass(String name)
throws ClassNotFoundException
{
checkInitialized();
@@ -563,7 +562,7 @@ public abstract class ClassLoader
* @param signers the signers to set
* @since 1.1
*/
- protected final void setSigners(Class c, Object[] signers)
+ protected final void setSigners(Class<?> c, Object[] signers)
{
checkInitialized();
c.setSigners(signers);
@@ -576,7 +575,7 @@ public abstract class ClassLoader
* @return the found Class, or null if it is not found
* @since 1.1
*/
- protected final synchronized Class findLoadedClass(String name)
+ protected final synchronized Class<?> findLoadedClass(String name)
{
checkInitialized();
return VMClassLoader.findLoadedClass(this, name);
@@ -631,14 +630,14 @@ public abstract class ClassLoader
* @since 1.2
* @specnote this was <code>final</code> prior to 1.5
*/
- public Enumeration getResources(String name) throws IOException
+ public Enumeration<URL> getResources(String name) throws IOException
{
- Enumeration parentResources;
+ Enumeration<URL> parentResources;
if (parent == null)
parentResources = VMClassLoader.getResources(name);
else
parentResources = parent.getResources(name);
- return new DoubleEnumeration(parentResources, findResources(name));
+ return new DoubleEnumeration<URL>(parentResources, findResources(name));
}
/**
@@ -658,9 +657,9 @@ public abstract class ClassLoader
* @throws IOException if I/O errors occur in the process
* @since 1.2
*/
- protected Enumeration findResources(String name) throws IOException
+ protected Enumeration<URL> findResources(String name) throws IOException
{
- return EmptyEnumeration.getInstance();
+ return (Enumeration<URL>) EmptyEnumeration.getInstance();
}
/**
@@ -705,7 +704,8 @@ public abstract class ClassLoader
* @throws IOException if I/O errors occur in the process
* @since 1.2
*/
- public static Enumeration getSystemResources(String name) throws IOException
+ public static Enumeration<URL> getSystemResources(String name)
+ throws IOException
{
return StaticData.systemClassLoader.getResources(name);
}
@@ -865,7 +865,7 @@ public abstract class ClassLoader
{
synchronized (definedPackages)
{
- p = (Package) definedPackages.get(name);
+ p = definedPackages.get(name);
}
}
return p;
@@ -955,7 +955,7 @@ public abstract class ClassLoader
{
if (packageAssertionStatus == null)
packageAssertionStatus
- = new HashMap(StaticData.systemPackageAssertionStatus);
+ = new HashMap<String, Boolean>(StaticData.systemPackageAssertionStatus);
packageAssertionStatus.put(name, Boolean.valueOf(enabled));
}
@@ -975,8 +975,8 @@ public abstract class ClassLoader
boolean enabled)
{
if (classAssertionStatus == null)
- classAssertionStatus =
- new HashMap(StaticData.systemClassAssertionStatus);
+ classAssertionStatus
+ = new HashMap<String, Boolean>(StaticData.systemClassAssertionStatus);
// The toString() hack catches null, as required.
classAssertionStatus.put(name.toString(), Boolean.valueOf(enabled));
}
@@ -994,8 +994,8 @@ public abstract class ClassLoader
public synchronized void clearAssertionStatus()
{
defaultAssertionStatus = false;
- packageAssertionStatus = new HashMap();
- classAssertionStatus = new HashMap();
+ packageAssertionStatus = null;
+ classAssertionStatus = null;
}
/**
@@ -1147,4 +1147,5 @@ public abstract class ClassLoader
if (! initialized)
throw new SecurityException("attempt to use uninitialized class loader");
}
+
}
diff --git a/libjava/classpath/java/lang/Comparable.java b/libjava/classpath/java/lang/Comparable.java
index a8afe1ec33e..4ad39af833a 100644
--- a/libjava/classpath/java/lang/Comparable.java
+++ b/libjava/classpath/java/lang/Comparable.java
@@ -1,5 +1,5 @@
/* Comparable.java -- Interface for comparaing objects to obtain an ordering
- Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -66,9 +66,9 @@ package java.lang;
* @see java.util.TreeSet
* @see java.util.TreeMap
* @since 1.2
- * @status updated to 1.4
+ * @status updated to 1.5
*/
-public interface Comparable
+public interface Comparable<T>
{
/**
* Compares this object with another, and returns a numerical result based
@@ -94,5 +94,5 @@ public interface Comparable
* @throws NullPointerException if o is null
* @throws ClassCastException if o cannot be compared
*/
- int compareTo(Object o);
+ int compareTo(T o);
}
diff --git a/libjava/classpath/java/lang/Compiler.java b/libjava/classpath/java/lang/Compiler.java
index 56fb951bbd9..0d990e93853 100644
--- a/libjava/classpath/java/lang/Compiler.java
+++ b/libjava/classpath/java/lang/Compiler.java
@@ -74,7 +74,7 @@ public final class Compiler
* compilation failed, <code>true</code> if compilation succeeded
* @throws NullPointerException if oneClass is null
*/
- public static boolean compileClass(Class oneClass)
+ public static boolean compileClass(Class<?> oneClass)
{
return VMCompiler.compileClass(oneClass);
}
diff --git a/libjava/classpath/java/lang/Deprecated.java b/libjava/classpath/java/lang/Deprecated.java
new file mode 100644
index 00000000000..a52abdb4ea2
--- /dev/null
+++ b/libjava/classpath/java/lang/Deprecated.java
@@ -0,0 +1,56 @@
+/* Deprecated - Annotation to mark elements as deprecated
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.lang;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * This annotation is used as a marker to indicate that the annotated
+ * declaration is deprecated and should not be used in new code.
+ * This replaces the old "@deprecated" javadoc tag.
+ *
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+@Documented @Retention(RUNTIME)
+public @interface Deprecated
+{
+}
diff --git a/libjava/classpath/java/lang/Double.java b/libjava/classpath/java/lang/Double.java
index 03c56068921..c716203148b 100644
--- a/libjava/classpath/java/lang/Double.java
+++ b/libjava/classpath/java/lang/Double.java
@@ -1,5 +1,5 @@
/* Double.java -- object wrapper for double
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,10 +49,12 @@ package java.lang;
* @author Paul Fisher
* @author Andrew Haley (aph@cygnus.com)
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.0
- * @status updated to 1.4
+ * @status partly updated to 1.5
*/
-public final class Double extends Number implements Comparable
+public final class Double extends Number implements Comparable<Double>
{
/**
* Compatible with JDK 1.0+.
@@ -98,7 +100,7 @@ public final class Double extends Number implements Comparable
* <code>Class</code> object.
* @since 1.1
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass('D');
+ public static final Class<Double> TYPE = (Class<Double>) VMClassLoader.getPrimitiveClass('D');
/**
* The immutable value of this Double.
@@ -254,7 +256,6 @@ public final class Double extends Number implements Comparable
*
* @param val the value to wrap
* @return the <code>Double</code>
- *
* @since 1.5
*/
public static Double valueOf(double val)
@@ -575,22 +576,6 @@ public final class Double extends Number implements Comparable
}
/**
- * Behaves like <code>compareTo(Double)</code> unless the Object
- * is not an <code>Double</code>.
- *
- * @param o the object to compare
- * @return the comparison
- * @throws ClassCastException if the argument is not a <code>Double</code>
- * @see #compareTo(Double)
- * @see Comparable
- * @since 1.2
- */
- public int compareTo(Object o)
- {
- return compare(value, ((Double) o).value);
- }
-
- /**
* Behaves like <code>new Double(x).compareTo(new Double(y))</code>; in
* other words this compares two doubles, special casing NaN and zero,
* without the overhead of objects.
diff --git a/libjava/classpath/java/lang/Enum.java b/libjava/classpath/java/lang/Enum.java
index 5344d5c7201..f141619be4d 100644
--- a/libjava/classpath/java/lang/Enum.java
+++ b/libjava/classpath/java/lang/Enum.java
@@ -48,10 +48,8 @@ import java.lang.reflect.Field;
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.5
*/
-/* FIXME[GENERICS]: Should be Enum<T extends Enum<T>>
- and Comparable<T> */
-public abstract class Enum
- implements Comparable, Serializable
+public abstract class Enum<T extends Enum<T>>
+ implements Comparable<T>, Serializable
{
/**
@@ -62,13 +60,13 @@ public abstract class Enum
/**
* The name of this enum constant.
*/
- String name;
+ final String name;
/**
* The number of this enum constant. Each constant is given a number
* which matches the order in which it was declared, starting with zero.
*/
- int ordinal;
+ final int ordinal;
/**
* This constructor is used by the compiler to create enumeration constants.
@@ -91,8 +89,8 @@ public abstract class Enum
* @exception IllegalArgumentException when there is no value s in
* the enum etype.
*/
- /* FIXME[GENERICS]: Should be <S extends Enum<S>> S valueOf(Class<S>) */
- public static Enum valueOf(Class etype, String s)
+ @SuppressWarnings("unchecked")
+ public static <S extends Enum<S>> S valueOf(Class<S> etype, String s)
{
if (etype == null || s == null)
throw new NullPointerException();
@@ -102,8 +100,7 @@ public abstract class Enum
Field f = etype.getDeclaredField(s);
if (! f.isEnumConstant())
throw new IllegalArgumentException(s);
- /* FIXME[GENERICS]: Should cast to S */
- return (Enum) f.get(null);
+ return (S) f.get(null);
}
catch (NoSuchFieldException exception)
{
@@ -167,7 +164,7 @@ public abstract class Enum
* @throws ClassCastException if <code>e</code> is not an enumeration
* constant of the same class.
*/
- public final int compareTo(Enum e)
+ public final int compareTo(T e)
{
if (getDeclaringClass() != e.getDeclaringClass())
throw new ClassCastException();
@@ -175,27 +172,6 @@ public abstract class Enum
}
/**
- * Returns an integer which represents the relative ordering of this
- * enumeration constant. Enumeration constants are ordered by their
- * ordinals, which represents their declaration order. So, comparing
- * two identical constants yields zero, while one declared prior to
- * this returns a positive integer and one declared after yields a
- * negative integer.
- *
- * @param o the enumeration constant to compare.
- * @return a negative integer if <code>e.ordinal < this.ordinal</code>,
- * zero if <code>e.ordinal == this.ordinal</code> and a positive
- * integer if <code>e.ordinal > this.ordinal</code>.
- * @throws ClassCastException if <code>e</code> is not an enumeration
- * constant of the same class.
- */
- /* FIXME[GENERICS]: Remove this method */
- public final int compareTo(Object o)
- {
- return compareTo((Enum)o);
- }
-
- /**
* Cloning of enumeration constants is prevented, to maintain their
* singleton status.
*
@@ -235,8 +211,7 @@ public abstract class Enum
*
* @return the type of this enumeration constant.
*/
- /* FIXME[GENERICS]: Should return Class<T> */
- public final Class getDeclaringClass()
+ public final Class<T> getDeclaringClass()
{
Class k = getClass();
// We might be in an anonymous subclass of the enum class, so go
diff --git a/libjava/classpath/java/lang/EnumConstantNotPresentException.java b/libjava/classpath/java/lang/EnumConstantNotPresentException.java
index 12b30fda599..4586c372cca 100644
--- a/libjava/classpath/java/lang/EnumConstantNotPresentException.java
+++ b/libjava/classpath/java/lang/EnumConstantNotPresentException.java
@@ -54,7 +54,7 @@ public class EnumConstantNotPresentException extends RuntimeException
* The enum's type. Note that the name is fixed by the
* serialization spec.
*/
- private Class enumType;
+ private Class<? extends Enum> enumType;
/**
* The name of the missing enum constant. Note that the name is
@@ -68,7 +68,8 @@ public class EnumConstantNotPresentException extends RuntimeException
* @param theEnum the enum's class
* @param name the name of the missing enum constant
*/
- public EnumConstantNotPresentException(Class theEnum, String name)
+ public EnumConstantNotPresentException(Class<? extends Enum> theEnum,
+ String name)
{
super("enum " + theEnum + " is missing the constant " + name);
enumType = theEnum;
@@ -88,7 +89,7 @@ public class EnumConstantNotPresentException extends RuntimeException
* Return the enum type which is missing a constant.
* @return the enum type which is missing a constant
*/
- public Class enumType()
+ public Class<? extends Enum> enumType()
{
return enumType;
}
diff --git a/libjava/classpath/java/lang/Float.java b/libjava/classpath/java/lang/Float.java
index dcd5b221197..1e85922be72 100644
--- a/libjava/classpath/java/lang/Float.java
+++ b/libjava/classpath/java/lang/Float.java
@@ -1,5 +1,5 @@
/* Float.java -- object wrapper for float
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,10 +49,12 @@ package java.lang;
* @author Paul Fisher
* @author Andrew Haley (aph@cygnus.com)
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.0
- * @status updated to 1.4
+ * @status partly updated to 1.5
*/
-public final class Float extends Number implements Comparable
+public final class Float extends Number implements Comparable<Float>
{
/**
* Compatible with JDK 1.0+.
@@ -91,7 +93,7 @@ public final class Float extends Number implements Comparable
* <code>Class</code> object.
* @since 1.1
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass('F');
+ public static final Class<Float> TYPE = (Class<Float>) VMClassLoader.getPrimitiveClass('F');
/**
* The number of bits needed to represent a <code>float</code>.
@@ -281,7 +283,6 @@ public final class Float extends Number implements Comparable
*
* @param val the value to wrap
* @return the <code>Float</code>
- *
* @since 1.5
*/
public static Float valueOf(float val)
@@ -584,22 +585,6 @@ public final class Float extends Number implements Comparable
}
/**
- * Behaves like <code>compareTo(Float)</code> unless the Object
- * is not an <code>Float</code>.
- *
- * @param o the object to compare
- * @return the comparison
- * @throws ClassCastException if the argument is not a <code>Float</code>
- * @see #compareTo(Float)
- * @see Comparable
- * @since 1.2
- */
- public int compareTo(Object o)
- {
- return compare(value, ((Float) o).value);
- }
-
- /**
* Behaves like <code>new Float(x).compareTo(new Float(y))</code>; in
* other words this compares two floats, special casing NaN and zero,
* without the overhead of objects.
diff --git a/libjava/classpath/java/lang/InheritableThreadLocal.java b/libjava/classpath/java/lang/InheritableThreadLocal.java
index b9c7624ef44..2079a4c20ff 100644
--- a/libjava/classpath/java/lang/InheritableThreadLocal.java
+++ b/libjava/classpath/java/lang/InheritableThreadLocal.java
@@ -1,5 +1,5 @@
/* InheritableThreadLocal -- a ThreadLocal which inherits values across threads
- Copyright (C) 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -54,12 +54,15 @@ import java.util.Iterator;
*
* @author Mark Wielaard (mark@klomp.org)
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @see ThreadLocal
* @since 1.2
* @status updated to 1.4
*/
-public class InheritableThreadLocal extends ThreadLocal
+public class InheritableThreadLocal<T> extends ThreadLocal<T>
{
+
/**
* Creates a new InheritableThreadLocal that has no values associated
* with it yet.
@@ -77,7 +80,7 @@ public class InheritableThreadLocal extends ThreadLocal
* the moment of creation of the child
* @return the initial value for the child thread
*/
- protected Object childValue(Object parentValue)
+ protected T childValue(T parentValue)
{
return parentValue;
}
@@ -85,7 +88,7 @@ public class InheritableThreadLocal extends ThreadLocal
/**
* Generates the childValues of all <code>InheritableThreadLocal</code>s
* that are in the heritage of the current Thread for the newly created
- * childThread. Should be called from the contructor Thread.
+ * childThread. Should be called from the constructor Thread.
*
* @param childThread the newly created thread, to inherit from this thread
* @see Thread#Thread(ThreadGroup, Runnable, String)
@@ -102,14 +105,14 @@ public class InheritableThreadLocal extends ThreadLocal
Object key = keys.next();
if (key instanceof InheritableThreadLocal)
{
- InheritableThreadLocal local = (InheritableThreadLocal)key;
+ InheritableThreadLocal local = (InheritableThreadLocal)key;
Object parentValue = parentThread.locals.get(key);
- Object childValue = local.childValue(parentValue == NULL
- ? null : parentValue);
+ Object childValue = local.childValue(parentValue == sentinel
+ ? null : parentValue);
if (childThread.locals == null)
childThread.locals = new WeakIdentityHashMap();
childThread.locals.put(key, (childValue == null
- ? NULL : childValue));
+ ? sentinel : childValue));
}
}
}
diff --git a/libjava/classpath/java/lang/Integer.java b/libjava/classpath/java/lang/Integer.java
index f3fe85f5041..e38eb53edd3 100644
--- a/libjava/classpath/java/lang/Integer.java
+++ b/libjava/classpath/java/lang/Integer.java
@@ -51,10 +51,11 @@ package java.lang;
* @author Warren Levy
* @author Eric Blake (ebb9@email.byu.edu)
* @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.0
- * @status largely updated to 1.5
+ * @status updated to 1.5
*/
-public final class Integer extends Number implements Comparable
+public final class Integer extends Number implements Comparable<Integer>
{
/**
* Compatible with JDK 1.0.2+.
@@ -78,7 +79,7 @@ public final class Integer extends Number implements Comparable
* <code>Class</code> object.
* @since 1.1
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass('I');
+ public static final Class<Integer> TYPE = (Class<Integer>) VMClassLoader.getPrimitiveClass('I');
/**
* The number of bits needed to represent an <code>int</code>.
@@ -526,22 +527,6 @@ public final class Integer extends Number implements Comparable
}
/**
- * Behaves like <code>compareTo(Integer)</code> unless the Object
- * is not an <code>Integer</code>.
- *
- * @param o the object to compare
- * @return the comparison
- * @throws ClassCastException if the argument is not an <code>Integer</code>
- * @see #compareTo(Integer)
- * @see Comparable
- * @since 1.2
- */
- public int compareTo(Object o)
- {
- return compareTo((Integer) o);
- }
-
- /**
* Return the number of bits set in x.
* @param x value to examine
* @since 1.5
diff --git a/libjava/classpath/java/lang/Iterable.java b/libjava/classpath/java/lang/Iterable.java
index 35c426484bb..ea593e88e73 100644
--- a/libjava/classpath/java/lang/Iterable.java
+++ b/libjava/classpath/java/lang/Iterable.java
@@ -49,12 +49,12 @@ import java.util.*;
* @author Tom Tromey <tromey@redhat.com>
* @since 1.5
*/
-public interface Iterable
+public interface Iterable<E>
{
/**
* Returns an iterator for the collection.
*
* @return an iterator.
*/
- Iterator iterator ();
+ Iterator<E> iterator ();
}
diff --git a/libjava/classpath/java/lang/Long.java b/libjava/classpath/java/lang/Long.java
index 74e2a52df7c..f0fbc904c36 100644
--- a/libjava/classpath/java/lang/Long.java
+++ b/libjava/classpath/java/lang/Long.java
@@ -1,5 +1,5 @@
/* Long.java -- object wrapper for long
- Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,10 +49,12 @@ package java.lang;
* @author John Keiser
* @author Warren Levy
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.0
* @status updated to 1.5
*/
-public final class Long extends Number implements Comparable
+public final class Long extends Number implements Comparable<Long>
{
/**
* Compatible with JDK 1.0.2+.
@@ -76,7 +78,7 @@ public final class Long extends Number implements Comparable
* <code>Class</code> object.
* @since 1.1
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass ('J');
+ public static final Class<Long> TYPE = (Class<Long>) VMClassLoader.getPrimitiveClass ('J');
/**
* The number of bits needed to represent a <code>long</code>.
@@ -292,7 +294,6 @@ public final class Long extends Number implements Comparable
*
* @param val the value to wrap
* @return the <code>Long</code>
- *
* @since 1.5
*/
public static synchronized Long valueOf(long val)
@@ -517,22 +518,6 @@ public final class Long extends Number implements Comparable
}
/**
- * Behaves like <code>compareTo(Long)</code> unless the Object
- * is not a <code>Long</code>.
- *
- * @param o the object to compare
- * @return the comparison
- * @throws ClassCastException if the argument is not a <code>Long</code>
- * @see #compareTo(Long)
- * @see Comparable
- * @since 1.2
- */
- public int compareTo(Object o)
- {
- return compareTo((Long) o);
- }
-
- /**
* Return the number of bits set in x.
* @param x value to examine
* @since 1.5
diff --git a/libjava/classpath/java/lang/Object.java b/libjava/classpath/java/lang/Object.java
index 6212d7dfe72..fbd1dc77d9f 100644
--- a/libjava/classpath/java/lang/Object.java
+++ b/libjava/classpath/java/lang/Object.java
@@ -326,7 +326,7 @@ public class Object
*
* @return the class of this Object
*/
- public final Class getClass()
+ public final Class<? extends Object> getClass()
{
return VMObject.getClass(this);
}
diff --git a/libjava/classpath/java/lang/Override.java b/libjava/classpath/java/lang/Override.java
new file mode 100644
index 00000000000..16581045abf
--- /dev/null
+++ b/libjava/classpath/java/lang/Override.java
@@ -0,0 +1,56 @@
+/* Override - Annotation to indicate that a method should be an override
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.lang;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+import static java.lang.annotation.ElementType.METHOD;
+
+/**
+ * This annotation is used as a marker to indicate that the annotated
+ * method declaration is intended to override another method in the
+ * class hierarchy. If this is not the case, the compiler will emit a
+ * warning.
+ *
+ * @since 1.5
+ */
+@Retention(SOURCE) @Target(METHOD)
+public @interface Override
+{
+}
diff --git a/libjava/classpath/java/lang/Package.java b/libjava/classpath/java/lang/Package.java
index 38bb3240de4..1141a0722ee 100644
--- a/libjava/classpath/java/lang/Package.java
+++ b/libjava/classpath/java/lang/Package.java
@@ -345,14 +345,13 @@ public class Package
* <code>null</code> if no such annotation exists.
* @since 1.5
*/
- /* FIXME[GENERICS]: <T extends Annotation> T getAnnotation(Class <T>) */
- public Annotation getAnnotation(Class annotationClass)
+ public <A extends Annotation> A getAnnotation(Class<A> annotationClass)
{
- Annotation foundAnnotation = null;
+ A foundAnnotation = null;
Annotation[] annotations = getAnnotations();
- for (int i = 0; i < annotations.length; i++)
- if (annotations[i].annotationType() == annotationClass)
- foundAnnotation = annotations[i];
+ for (Annotation annotation : annotations)
+ if (annotation.annotationType() == annotationClass)
+ foundAnnotation = (A) annotation;
return foundAnnotation;
}
@@ -406,8 +405,7 @@ public class Package
* @return true if an annotation exists for the specified type.
* @since 1.5
*/
- /* FIXME[GENERICS]: Signature is Class<? extends Annotation> */
- public boolean isAnnotationPresent(Class
+ public boolean isAnnotationPresent(Class<? extends Annotation>
annotationClass)
{
return getAnnotation(annotationClass) != null;
diff --git a/libjava/classpath/java/lang/ProcessBuilder.java b/libjava/classpath/java/lang/ProcessBuilder.java
new file mode 100644
index 00000000000..9ffe24cde16
--- /dev/null
+++ b/libjava/classpath/java/lang/ProcessBuilder.java
@@ -0,0 +1,337 @@
+/* ProcessBuilder.java - Represent spawned system process
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.lang;
+
+import java.io.File;
+import java.io.IOException;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * This class is used to construct new operating system processes.
+ * A <code>ProcessBuilder</code> instance basically represent a
+ * template for a new process. Actual processes are generated from
+ * this template via use of the <code>start()</code> method, which
+ * may be invoked multiple times, with each invocation spawning a
+ * new process with the current attributes of the
+ * <code>ProcessBuilder</code> object. Each spawned process is
+ * independent of the <code>ProcessBuilder</code> object, and is
+ * unaffected by changes in its attributes.
+ * </p>
+ * <p>
+ * The following attributes define a process:
+ * </p>
+ * <ul>
+ * <li>The <emphasis>working directory</emphasis>; the activities of a
+ * process begin with the current directory set to this. By default,
+ * this is the working directory of the current process, as defined
+ * by the <code>user.dir</code> property.</li>
+ * <li>The <emphasis>command</emphasis> which invokes the process. This
+ * usually consists of the name of the program binary followed by an
+ * arbitrary number of arguments. For example, <code>find -type f</code>
+ * invokes the <code>find</code> binary with the arguments "-type" and "f".
+ * The command is provided a list, the elements of which are defined in a
+ * system dependent manner; the layout is affected by expected operating
+ * system conventions. A common method is to split the command on each
+ * space within the string. Thus, <code>find -type f</code> forms a
+ * three element list. However, in some cases, the expectation is that
+ * this split is performed by the program itself; thus, the list consists
+ * of only two elements (the program name and its arguments).</li>
+ * <li>The <emphasis>environment map</emphasis>, which links environment
+ * variables to their corresponding values. The initial contents of the map
+ * are the current environment values i.e. it contains the contents of the
+ * map returned by <code>System.getenv()</code>.</li>
+ * <li>The <emphasis>redirection flag</emphasis>, which specifies whether
+ * or not the contents of the error stream should be redirected to standard
+ * output. By default, this is false, and there are two output streams, one
+ * for normal data ({@link Process#getOutputStream()}) and one for error data
+ * ({@link Process#getErrorStream()}). When set to true, the two are merged,
+ * which simplifies the interleaving of the two streams. Data is read using
+ * the stream returned by {@link Process#getOutputStream()}, and the
+ * stream returned by {@link Process#getErrorStream()} throws an immediate
+ * end-of-file exception.</li>
+ * </ul>
+ * <p>
+ * All checks on attribute validity are delayed until <code>start()</code>
+ * is called. <code>ProcessBuilder</code> objects are <strong>not
+ * synchronized</strong>; the user must provide external synchronization
+ * where multiple threads may interact with the same
+ * <code>ProcessBuilder</code> object.
+ * </p>
+ *
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @see Process
+ * @see System#getenv()
+ * @since 1.5
+ */
+public final class ProcessBuilder
+{
+
+ /**
+ * The working directory of the process.
+ */
+ private File directory = new File(System.getProperty("user.dir"));
+
+ /**
+ * The command line syntax for invoking the process.
+ */
+ private List<String> command;
+
+ /**
+ * The mapping of environment variables to values.
+ */
+ private Map<String, String> environment =
+ new System.EnvironmentMap(System.getenv());
+
+ /**
+ * A flag indicating whether to redirect the error stream to standard
+ * output.
+ */
+ private boolean redirect = false;
+
+ /**
+ * Constructs a new <code>ProcessBuilder</code> with the specified
+ * command being used to invoke the process. The list is used directly;
+ * external changes are reflected in the <code>ProcessBuilder</code>.
+ *
+ * @param command the name of the program followed by its arguments.
+ */
+ public ProcessBuilder(List<String> command)
+ {
+ this.command = command;
+ }
+
+ /**
+ * Constructs a new <code>ProcessBuilder</code> with the specified
+ * command being used to invoke the process. This constructor
+ * simplifies creating a new <code>ProcessBuilder</code> by
+ * converting the provided series of constructor arguments into a
+ * list of command-line arguments.
+ *
+ * @param command the name of the program followed by its arguments.
+ */
+ public ProcessBuilder(String... command)
+ {
+ this.command = Arrays.asList(command);
+ }
+
+ /**
+ * Returns the current command line, used to invoke the process.
+ * The return value is simply a reference to the list of command
+ * line arguments used by the <code>ProcessBuilder</code> object;
+ * any changes made to it will be reflected in the operation of
+ * the <code>ProcessBuilder</code>.
+ *
+ * @return the list of command-line arguments.
+ */
+ public List<String> command()
+ {
+ return command;
+ }
+
+ /**
+ * Sets the command-line arguments to those specified. The list is
+ * used directly; external changes are reflected in the
+ * <code>ProcessBuilder</code>.
+ *
+ * @param command the name of the program followed by its arguments.
+ * @return a reference to this process builder.
+ */
+ public ProcessBuilder command(List<String> command)
+ {
+ this.command = command;
+ return this;
+ }
+
+ /**
+ * Sets the command-line arguments to those specified.
+ * This simplifies modifying the arguments by converting
+ * the provided series of constructor arguments into a
+ * list of command-line arguments.
+ *
+ * @param command the name of the program followed by its arguments.
+ * @return a reference to this process builder.
+ */
+ public ProcessBuilder command(String... command)
+ {
+ this.command = Arrays.asList(command);
+ return this;
+ }
+
+ /**
+ * Returns the working directory of the process. The
+ * returned value may be <code>null</code>; this
+ * indicates that the default behaviour of using the
+ * working directory of the current process should
+ * be adopted.
+ *
+ * @return the working directory.
+ */
+ public File directory()
+ {
+ return directory;
+ }
+
+ /**
+ * Sets the working directory to that specified.
+ * The supplied argument may be <code>null</code>,
+ * which indicates the default value should be used.
+ * The default is the working directory of the current
+ * process.
+ *
+ * @param directory the new working directory.
+ * @return a reference to this process builder.
+ */
+ public ProcessBuilder directory(File directory)
+ {
+ this.directory = directory;
+ return this;
+ }
+
+ /**
+ * <p>
+ * Returns the system environment variables of the process.
+ * If the underlying system does not support environment variables,
+ * an empty map is returned.
+ * </p>
+ * <p>
+ * The returned map does not accept queries using
+ * null keys or values, or those of a type other than
+ * <code>String</code>. Attempts to pass in a null value will
+ * throw a <code>NullPointerException</code>. Types other than
+ * <code>String</code> throw a <code>ClassCastException</code>.
+ * </p>
+ * <p>
+ * As the returned map is generated using data from the underlying
+ * platform, it may not comply with the <code>equals()</code>
+ * and <code>hashCode()</code> contracts. It is also likely that
+ * the keys of this map will be case-sensitive.
+ * </p>
+ * <p>
+ * Modification of the map is reliant on the underlying platform;
+ * some may not allow any changes to the environment variables or
+ * may prevent certain values being used. Attempts to do so will
+ * throw an <code>UnsupportedOperationException</code> or
+ * <code>IllegalArgumentException</code>, respectively.
+ * </p>
+ * <p>
+ * Use of this method may require a security check for the
+ * RuntimePermission "getenv.*".
+ * </p>
+ *
+ * @return a map of the system environment variables for the process.
+ * @throws SecurityException if the checkPermission method of
+ * an installed security manager prevents access to
+ * the system environment variables.
+ * @since 1.5
+ */
+ public Map<String, String> environment()
+ {
+ return environment;
+ }
+
+ /**
+ * Returns true if the output stream and error stream of the
+ * process will be merged to form one composite stream. The
+ * default return value is <code>false</code>.
+ *
+ * @return true if the output stream and error stream are to
+ * be merged.
+ */
+ public boolean redirectErrorStream()
+ {
+ return redirect;
+ }
+
+ /**
+ * Sets the error stream redirection flag. If set, the output
+ * and error streams are merged to form one composite stream.
+ *
+ * @param redirect the new value of the redirection flag.
+ * @return a reference to this process builder.
+ */
+ public ProcessBuilder redirectErrorStream(boolean redirect)
+ {
+ this.redirect = redirect;
+ return this;
+ }
+
+ /**
+ * <p>
+ * Starts execution of a new process, based on the attributes of
+ * this <code>ProcessBuilder</code> object. This is the point
+ * at which the command-line arguments are checked. The list
+ * must be non-empty and contain only non-null string objects.
+ * The other attributes have default values which are used in
+ * cases where their values are not explicitly specified.
+ * </p>
+ * <p>
+ * If a security manager is in place, then the
+ * {@link SecurityManager#checkExec()} method is called to
+ * ensure that permission is given to execute the process.
+ * </p>
+ * <p>
+ * The execution of the process is system-dependent. Various
+ * exceptions may result, due to problems at the operating system
+ * level. These are all returned as a form of {@link IOException}.
+ * </p>
+ *
+ * @return a <code>Process</code> object, representing the spawned
+ * subprocess.
+ * @throws IOException if a problem occurs with executing the process
+ * at the operating system level.
+ * @throws IndexOutOfBoundsException if the command to execute is
+ * actually an empty list.
+ * @throws NullPointerException if the command to execute is null
+ * or the list contains null elements.
+ * @throws SecurityException if a security manager exists and prevents
+ * execution of the subprocess.
+ */
+ public Process start() throws IOException
+ {
+ SecurityManager sm = SecurityManager.current; // Be thread-safe!
+ if (sm != null)
+ sm.checkExec(command.get(0));
+ return VMProcess.exec(command, environment, directory, redirect);
+ }
+}
diff --git a/libjava/classpath/java/lang/SecurityManager.java b/libjava/classpath/java/lang/SecurityManager.java
index 999fe83dda1..61b4612b1aa 100644
--- a/libjava/classpath/java/lang/SecurityManager.java
+++ b/libjava/classpath/java/lang/SecurityManager.java
@@ -1,5 +1,5 @@
/* SecurityManager.java -- security checks for privileged actions
- Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -240,7 +240,7 @@ public class SecurityManager
* @return the most recent non-system Class on the execution stack
* @deprecated use {@link #checkPermission(Permission)} instead
*/
- protected Class currentLoadedClass()
+ protected Class<?> currentLoadedClass()
{
int i = classLoaderDepth();
return i >= 0 ? getClassContext()[i] : null;
@@ -983,7 +983,7 @@ public class SecurityManager
* @see Member#PUBLIC
* @since 1.1
*/
- public void checkMemberAccess(Class c, int memberType)
+ public void checkMemberAccess(Class<?> c, int memberType)
{
if (c == null)
throw new NullPointerException();
diff --git a/libjava/classpath/java/lang/Short.java b/libjava/classpath/java/lang/Short.java
index eb40cd9e0e6..41a31e26082 100644
--- a/libjava/classpath/java/lang/Short.java
+++ b/libjava/classpath/java/lang/Short.java
@@ -1,5 +1,5 @@
/* Short.java -- object wrapper for short
- Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,10 +48,12 @@ package java.lang;
* @author Paul Fisher
* @author John Keiser
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.1
- * @status updated to 1.4
+ * @status updated to 1.5
*/
-public final class Short extends Number implements Comparable
+public final class Short extends Number implements Comparable<Short>
{
/**
* Compatible with JDK 1.1+.
@@ -74,7 +76,7 @@ public final class Short extends Number implements Comparable
* The primitive type <code>short</code> is represented by this
* <code>Class</code> object.
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass('S');
+ public static final Class<Short> TYPE = (Class<Short>) VMClassLoader.getPrimitiveClass('S');
/**
* The number of bits needed to represent a <code>short</code>.
@@ -208,7 +210,6 @@ public final class Short extends Number implements Comparable
*
* @param val the value to wrap
* @return the <code>Short</code>
- *
* @since 1.5
*/
public static Short valueOf(short val)
@@ -217,9 +218,9 @@ public final class Short extends Number implements Comparable
return new Short(val);
synchronized (shortCache)
{
- if (shortCache[val - MIN_CACHE] == null)
- shortCache[val - MIN_CACHE] = new Short(val);
- return shortCache[val - MIN_CACHE];
+ if (shortCache[val - MIN_CACHE] == null)
+ shortCache[val - MIN_CACHE] = new Short(val);
+ return shortCache[val - MIN_CACHE];
}
}
@@ -371,22 +372,6 @@ public final class Short extends Number implements Comparable
}
/**
- * Behaves like <code>compareTo(Short)</code> unless the Object
- * is not a <code>Short</code>.
- *
- * @param o the object to compare
- * @return the comparison
- * @throws ClassCastException if the argument is not a <code>Short</code>
- * @see #compareTo(Short)
- * @see Comparable
- * @since 1.2
- */
- public int compareTo(Object o)
- {
- return compareTo((Short)o);
- }
-
- /**
* Reverse the bytes in val.
* @since 1.5
*/
diff --git a/libjava/classpath/java/lang/StrictMath.java b/libjava/classpath/java/lang/StrictMath.java
index 0f066216787..ec74ca4133b 100644
--- a/libjava/classpath/java/lang/StrictMath.java
+++ b/libjava/classpath/java/lang/StrictMath.java
@@ -633,6 +633,94 @@ public final strictfp class StrictMath
}
/**
+ * Returns the hyperbolic sine of <code>x</code> which is defined as
+ * (exp(x) - exp(-x)) / 2.
+ *
+ * Special cases:
+ * <ul>
+ * <li>If the argument is NaN, the result is NaN</li>
+ * <li>If the argument is positive infinity, the result is positive
+ * infinity.</li>
+ * <li>If the argument is negative infinity, the result is negative
+ * infinity.</li>
+ * <li>If the argument is zero, the result is zero.</li>
+ * </ul>
+ *
+ * @param x the argument to <em>sinh</em>
+ * @return the hyperbolic sine of <code>x</code>
+ *
+ * @since 1.5
+ */
+ public static double sinh(double x)
+ {
+ // Method :
+ // mathematically sinh(x) if defined to be (exp(x)-exp(-x))/2
+ // 1. Replace x by |x| (sinh(-x) = -sinh(x)).
+ // 2.
+ // E + E/(E+1)
+ // 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x)
+ // 2
+ //
+ // 22 <= x <= lnovft : sinh(x) := exp(x)/2
+ // lnovft <= x <= ln2ovft: sinh(x) := exp(x/2)/2 * exp(x/2)
+ // ln2ovft < x : sinh(x) := +inf (overflow)
+
+ double t, w, h;
+
+ long bits;
+ long h_bits;
+ long l_bits;
+
+ // handle special cases
+ if (x != x)
+ return x;
+ if (x == Double.POSITIVE_INFINITY)
+ return Double.POSITIVE_INFINITY;
+ if (x == Double.NEGATIVE_INFINITY)
+ return Double.NEGATIVE_INFINITY;
+
+ if (x < 0)
+ h = - 0.5;
+ else
+ h = 0.5;
+
+ bits = Double.doubleToLongBits(x);
+ h_bits = getHighDWord(bits) & 0x7fffffffL; // ignore sign
+ l_bits = getLowDWord(bits);
+
+ // |x| in [0, 22], return sign(x) * 0.5 * (E+E/(E+1))
+ if (h_bits < 0x40360000L) // |x| < 22
+ {
+ if (h_bits < 0x3e300000L) // |x| < 2^-28
+ return x; // for tiny arguments return x
+
+ t = expm1(abs(x));
+
+ if (h_bits < 0x3ff00000L)
+ return h * (2.0 * t - t * t / (t + 1.0));
+
+ return h * (t + t / (t + 1.0));
+ }
+
+ // |x| in [22, log(Double.MAX_VALUE)], return 0.5 * exp(|x|)
+ if (h_bits < 0x40862e42L)
+ return h * exp(abs(x));
+
+ // |x| in [log(Double.MAX_VALUE), overflowthreshold]
+ if ((h_bits < 0x408633ceL)
+ || ((h_bits == 0x408633ceL) && (l_bits <= 0x8fb9f87dL)))
+ {
+ w = exp(0.5 * abs(x));
+ t = h * w;
+
+ return t * w;
+ }
+
+ // |x| > overflowthershold
+ return h * Double.POSITIVE_INFINITY;
+ }
+
+ /**
* Returns the hyperbolic cosine of <code>x</code>, which is defined as
* (exp(x) + exp(-x)) / 2.
*
@@ -670,36 +758,36 @@ public final strictfp class StrictMath
double t, w;
long bits;
- int hx;
- int lx;
+ long hx;
+ long lx;
// handle special cases
if (x != x)
- return Double.NaN;
+ return x;
if (x == Double.POSITIVE_INFINITY)
return Double.POSITIVE_INFINITY;
if (x == Double.NEGATIVE_INFINITY)
return Double.POSITIVE_INFINITY;
bits = Double.doubleToLongBits(x);
- hx = getHighDWord(bits) & 0x7fffffff; // ignore sign
+ hx = getHighDWord(bits) & 0x7fffffffL; // ignore sign
lx = getLowDWord(bits);
// |x| in [0, 0.5 * ln(2)], return 1 + expm1(|x|)^2 / (2 * exp(|x|))
- if (hx < 0x3fd62e43)
+ if (hx < 0x3fd62e43L)
{
t = expm1(abs(x));
w = 1.0 + t;
// for tiny arguments return 1.
- if (hx < 0x3c800000)
+ if (hx < 0x3c800000L)
return w;
return 1.0 + (t * t) / (w + w);
}
// |x| in [0.5 * ln(2), 22], return exp(|x|)/2 + 1 / (2 * exp(|x|))
- if (hx < 0x40360000)
+ if (hx < 0x40360000L)
{
t = exp(abs(x));
@@ -707,16 +795,13 @@ public final strictfp class StrictMath
}
// |x| in [22, log(Double.MAX_VALUE)], return 0.5 * exp(|x|)
- if (hx < 0x40862e42)
+ if (hx < 0x40862e42L)
return 0.5 * exp(abs(x));
// |x| in [log(Double.MAX_VALUE), overflowthreshold],
// return exp(x/2)/2 * exp(x/2)
-
- // we need to force an unsigned <= compare, thus can not use lx.
- if ((hx < 0x408633ce)
- || ((hx == 0x408633ce)
- && ((bits & 0x00000000ffffffffL) <= 0x8fb9f87dL)))
+ if ((hx < 0x408633ceL)
+ || ((hx == 0x408633ceL) && (lx <= 0x8fb9f87dL)))
{
w = exp(0.5 * abs(x));
t = 0.5 * w;
@@ -729,13 +814,82 @@ public final strictfp class StrictMath
}
/**
+ * Returns the hyperbolic tangent of <code>x</code>, which is defined as
+ * (exp(x) - exp(-x)) / (exp(x) + exp(-x)), i.e. sinh(x) / cosh(x).
+ *
+ Special cases:
+ * <ul>
+ * <li>If the argument is NaN, the result is NaN</li>
+ * <li>If the argument is positive infinity, the result is 1.</li>
+ * <li>If the argument is negative infinity, the result is -1.</li>
+ * <li>If the argument is zero, the result is zero.</li>
+ * </ul>
+ *
+ * @param x the argument to <em>tanh</em>
+ * @return the hyperbolic tagent of <code>x</code>
+ *
+ * @since 1.5
+ */
+ public static double tanh(double x)
+ {
+ // Method :
+ // 0. tanh(x) is defined to be (exp(x) - exp(-x)) / (exp(x) + exp(-x))
+ // 1. reduce x to non-negative by tanh(-x) = -tanh(x).
+ // 2. 0 <= x <= 2^-55 : tanh(x) := x * (1.0 + x)
+ // -t
+ // 2^-55 < x <= 1 : tanh(x) := -----; t = expm1(-2x)
+ // t + 2
+ // 2
+ // 1 <= x <= 22.0 : tanh(x) := 1 - ----- ; t=expm1(2x)
+ // t + 2
+ // 22.0 < x <= INF : tanh(x) := 1.
+
+ double t, z;
+
+ long bits;
+ long h_bits;
+
+ // handle special cases
+ if (x != x)
+ return x;
+ if (x == Double.POSITIVE_INFINITY)
+ return 1.0;
+ if (x == Double.NEGATIVE_INFINITY)
+ return -1.0;
+
+ bits = Double.doubleToLongBits(x);
+ h_bits = getHighDWord(bits) & 0x7fffffffL; // ingnore sign
+
+ if (h_bits < 0x40360000L) // |x| < 22
+ {
+ if (h_bits < 0x3c800000L) // |x| < 2^-55
+ return x * (1.0 + x);
+
+ if (h_bits >= 0x3ff00000L) // |x| >= 1
+ {
+ t = expm1(2.0 * abs(x));
+ z = 1.0 - 2.0 / (t + 2.0);
+ }
+ else // |x| < 1
+ {
+ t = expm1(-2.0 * abs(x));
+ z = -t / (t + 2.0);
+ }
+ }
+ else // |x| >= 22
+ z = 1.0;
+
+ return (x >= 0) ? z : -z;
+ }
+
+ /**
* Returns the lower two words of a long. This is intended to be
* used like this:
* <code>getLowDWord(Double.doubleToLongBits(x))</code>.
*/
- private static int getLowDWord(long x)
+ private static long getLowDWord(long x)
{
- return (int) (x & 0x00000000ffffffffL);
+ return x & 0x00000000ffffffffL;
}
/**
@@ -743,19 +897,19 @@ public final strictfp class StrictMath
* used like this:
* <code>getHighDWord(Double.doubleToLongBits(x))</code>.
*/
- private static int getHighDWord(long x)
+ private static long getHighDWord(long x)
{
- return (int) ((x & 0xffffffff00000000L) >> 32);
+ return (x & 0xffffffff00000000L) >> 32;
}
/**
* Returns a double with the IEEE754 bit pattern given in the lower
* and higher two words <code>lowDWord</code> and <code>highDWord</code>.
*/
- private static double buildDouble(int lowDWord, int highDWord)
+ private static double buildDouble(long lowDWord, long highDWord)
{
- return Double.longBitsToDouble((((long) highDWord & 0xffffffffL) << 32)
- | ((long) lowDWord & 0xffffffffL));
+ return Double.longBitsToDouble(((highDWord & 0xffffffffL) << 32)
+ | (lowDWord & 0xffffffffL));
}
/**
@@ -788,12 +942,12 @@ public final strictfp class StrictMath
double w;
long bits;
- int l;
- int h;
+ long l;
+ long h;
// handle the special cases
if (x != x)
- return Double.NaN;
+ return x;
if (x == Double.POSITIVE_INFINITY)
return Double.POSITIVE_INFINITY;
if (x == Double.NEGATIVE_INFINITY)
@@ -847,7 +1001,7 @@ public final strictfp class StrictMath
s = t * t; // t * t is exact
r = x / s;
w = t + t;
- r = (r - t) / (w + r); // r - s is exact
+ r = (r - t) / (w + r); // r - t is exact
t = t + t * r;
return negative ? -t : t;
@@ -1008,8 +1162,8 @@ public final strictfp class StrictMath
int k;
long bits;
- int h_bits;
- int l_bits;
+ long h_bits;
+ long l_bits;
c = 0.0;
y = abs(x);
@@ -1019,14 +1173,14 @@ public final strictfp class StrictMath
l_bits = getLowDWord(bits);
// handle special cases and large arguments
- if (h_bits >= 0x4043687a) // if |x| >= 56 * ln(2)
+ if (h_bits >= 0x4043687aL) // if |x| >= 56 * ln(2)
{
- if (h_bits >= 0x40862e42) // if |x| >= EXP_LIMIT_H
+ if (h_bits >= 0x40862e42L) // if |x| >= EXP_LIMIT_H
{
- if (h_bits >= 0x7ff00000)
+ if (h_bits >= 0x7ff00000L)
{
- if (((h_bits & 0x000fffff) | (l_bits & 0xffffffff)) != 0)
- return Double.NaN; // exp(NaN) = NaN
+ if (((h_bits & 0x000fffffL) | (l_bits & 0xffffffffL)) != 0)
+ return x; // exp(NaN) = NaN
else
return negative ? -1.0 : x; // exp({+-inf}) = {+inf, -1}
}
@@ -1040,9 +1194,9 @@ public final strictfp class StrictMath
}
// argument reduction
- if (h_bits > 0x3fd62e42) // |x| > 0.5 * ln(2)
+ if (h_bits > 0x3fd62e42L) // |x| > 0.5 * ln(2)
{
- if (h_bits < 0x3ff0a2b2) // |x| < 1.5 * ln(2)
+ if (h_bits < 0x3ff0a2b2L) // |x| < 1.5 * ln(2)
{
if (negative)
{
@@ -1069,7 +1223,7 @@ public final strictfp class StrictMath
c = (hi - x) - lo;
}
- else if (h_bits < 0x3c900000) // |x| < 2^-54 return x
+ else if (h_bits < 0x3c900000L) // |x| < 2^-54 return x
return x;
else
k = 0;
@@ -1124,7 +1278,7 @@ public final strictfp class StrictMath
if (k < 20)
{
bits = Double.doubleToLongBits(t);
- h_bits = 0x3ff00000 - (0x00200000 >> k);
+ h_bits = 0x3ff00000L - (0x00200000L >> k);
l_bits = getLowDWord(bits);
t = buildDouble(l_bits, h_bits); // t = 1 - 2^(-k)
@@ -1141,7 +1295,7 @@ public final strictfp class StrictMath
else
{
bits = Double.doubleToLongBits(t);
- h_bits = (0x000003ff - k) << 20;
+ h_bits = (0x000003ffL - k) << 20;
l_bits = getLowDWord(bits);
t = buildDouble(l_bits, h_bits); // t = 2^(-k)
diff --git a/libjava/classpath/java/lang/String.java b/libjava/classpath/java/lang/String.java
index dbc3f7d8bf4..28b77c0aa56 100644
--- a/libjava/classpath/java/lang/String.java
+++ b/libjava/classpath/java/lang/String.java
@@ -1,5 +1,5 @@
/* String.java -- immutable character sequences; the object of string literals
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -54,6 +54,7 @@ import java.nio.charset.IllegalCharsetNameException;
import java.nio.charset.UnsupportedCharsetException;
import java.text.Collator;
import java.util.Comparator;
+import java.util.Formatter;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -82,10 +83,13 @@ import java.util.regex.PatternSyntaxException;
* @author Paul N. Fisher
* @author Eric Blake (ebb9@email.byu.edu)
* @author Per Bothner (bothner@cygnus.com)
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.0
* @status updated to 1.4; but could use better data sharing via offset field
*/
-public final class String implements Serializable, Comparable, CharSequence
+public final class String
+ implements Serializable, Comparable<String>, CharSequence
{
// WARNING: String is a CORE class in the bootstrap cycle. See the comments
// in vm/reference/java/lang/Runtime for implications of this fact.
@@ -144,7 +148,7 @@ public final class String implements Serializable, Comparable, CharSequence
* compatibility with Sun's JDK.
*/
private static final class CaseInsensitiveComparator
- implements Comparator, Serializable
+ implements Comparator<String>, Serializable
{
/**
* Compatible with JDK 1.2.
@@ -168,9 +172,9 @@ public final class String implements Serializable, Comparable, CharSequence
* @throws ClassCastException if either argument is not a String
* @see #compareToIgnoreCase(String)
*/
- public int compare(Object o1, Object o2)
+ public int compare(String o1, String o2)
{
- return ((String) o1).compareToIgnoreCase((String) o2);
+ return o1.compareToIgnoreCase(o2);
}
} // class CaseInsensitiveComparator
@@ -182,7 +186,7 @@ public final class String implements Serializable, Comparable, CharSequence
* @see Collator#compare(String, String)
* @since 1.2
*/
- public static final Comparator CASE_INSENSITIVE_ORDER
+ public static final Comparator<String> CASE_INSENSITIVE_ORDER
= new CaseInsensitiveComparator();
/**
@@ -919,22 +923,6 @@ public final class String implements Serializable, Comparable, CharSequence
}
/**
- * Behaves like <code>compareTo(java.lang.String)</code> unless the Object
- * is not a <code>String</code>. Then it throws a
- * <code>ClassCastException</code>.
- *
- * @param o the object to compare against
- * @return the comparison
- * @throws NullPointerException if o is null
- * @throws ClassCastException if o is not a <code>String</code>
- * @since 1.2
- */
- public int compareTo(Object o)
- {
- return compareTo((String) o);
- }
-
- /**
* Compares this String and another String (case insensitive). This
* comparison is <em>similar</em> to equalsIgnoreCase, in that it ignores
* locale and multi-characater capitalization, and compares characters
@@ -1674,7 +1662,6 @@ public final class String implements Serializable, Comparable, CharSequence
* @return String containing the chars from data[offset..offset+count]
* @throws NullPointerException if data is null
* @throws IndexOutOfBoundsException if (offset &lt; 0 || count &lt; 0
- * || offset + count &lt; 0 (overflow)
* || offset + count &gt; data.length)
* (while unspecified, this is a StringIndexOutOfBoundsException)
* @see #String(char[], int, int)
@@ -1696,6 +1683,7 @@ public final class String implements Serializable, Comparable, CharSequence
* @throws NullPointerException if data is null
* @throws IndexOutOfBoundsException if (offset &lt; 0 || count &lt; 0
* || offset + count &lt; 0 (overflow)
+ * || offset + count &lt; 0 (overflow)
* || offset + count &gt; data.length)
* (while unspecified, this is a StringIndexOutOfBoundsException)
* @see #String(char[], int, int)
@@ -1792,6 +1780,20 @@ public final class String implements Serializable, Comparable, CharSequence
return Double.toString(d);
}
+
+ /** @since 1.5 */
+ public static String format(Locale locale, String format, Object... args)
+ {
+ Formatter f = new Formatter(locale);
+ return f.format(format, args).toString();
+ }
+
+ /** @since 1.5 */
+ public static String format(String format, Object... args)
+ {
+ return format(Locale.getDefault(), format, args);
+ }
+
/**
* If two Strings are considered equal, by the equals() method,
* then intern() will return the same String instance. ie.
diff --git a/libjava/classpath/java/lang/StringBuffer.java b/libjava/classpath/java/lang/StringBuffer.java
index caffd6e7050..3aa84a21e12 100644
--- a/libjava/classpath/java/lang/StringBuffer.java
+++ b/libjava/classpath/java/lang/StringBuffer.java
@@ -72,8 +72,12 @@ import java.io.Serializable;
* @since 1.0
* @status updated to 1.4
*/
-public final class StringBuffer implements Serializable, CharSequence
+public final class StringBuffer
+ implements Serializable, CharSequence, Appendable
{
+ // Implementation note: if you change this class, you usually will
+ // want to change StringBuilder as well.
+
/**
* Compatible with JDK 1.0+.
*/
@@ -148,21 +152,22 @@ public final class StringBuffer implements Serializable, CharSequence
}
/**
- * Create a new <code>StringBuffer</code> with the characters from the
+ * Create a new <code>StringBuffer</code> with the characters in the
* specified <code>CharSequence</code>. Initial capacity will be the
- * size of the CharSequence plus 16.
+ * length of the sequence plus 16; if the sequence reports a length
+ * less than or equal to 0, then the initial capacity will be 16.
*
- * @param sequence the <code>String</code> to convert
+ * @param seq the initializing <code>CharSequence</code>
* @throws NullPointerException if str is null
- *
* @since 1.5
*/
- public StringBuffer(CharSequence sequence)
+ public StringBuffer(CharSequence seq)
{
- count = Math.max(0, sequence.length());
+ int len = seq.length();
+ count = len <= 0 ? 0 : len;
value = new char[count + DEFAULT_CAPACITY];
- for (int i = 0; i < count; ++i)
- value[i] = sequence.charAt(i);
+ for (int i = 0; i < len; ++i)
+ value[i] = seq.charAt(i);
}
/**
@@ -391,46 +396,6 @@ public final class StringBuffer implements Serializable, CharSequence
}
/**
- * Append the <code>CharSequence</code> value of the argument to this
- * <code>StringBuffer</code>.
- *
- * @param sequence the <code>CharSequence</code> to append
- * @return this <code>StringBuffer</code>
- * @see #append(Object)
- * @since 1.5
- */
- public synchronized StringBuffer append(CharSequence sequence)
- {
- if (sequence == null)
- sequence = "null";
- return append(sequence, 0, sequence.length());
- }
-
- /**
- * Append the specified subsequence of the <code>CharSequence</code>
- * argument to this <code>StringBuffer</code>.
- *
- * @param sequence the <code>CharSequence</code> to append
- * @param start the starting index
- * @param end one past the ending index
- * @return this <code>StringBuffer</code>
- * @see #append(Object)
- * @since 1.5
- */
- public synchronized StringBuffer append(CharSequence sequence,
- int start, int end)
- {
- if (sequence == null)
- sequence = "null";
- if (start < 0 || end < 0 || start > end || end > sequence.length())
- throw new IndexOutOfBoundsException();
- ensureCapacity_unsynchronized(this.count + end - start);
- for (int i = start; i < end; ++i)
- value[count++] = sequence.charAt(i);
- return this;
- }
-
- /**
* Append the <code>char</code> array to this <code>StringBuffer</code>.
* This is similar (but more efficient) than
* <code>append(new String(data))</code>, except in the case of null.
@@ -470,6 +435,25 @@ public final class StringBuffer implements Serializable, CharSequence
}
/**
+ * Append the code point to this <code>StringBuffer</code>.
+ * This is like #append(char), but will append two characters
+ * if a supplementary code point is given.
+ *
+ * @param code the code point to append
+ * @return this <code>StringBuffer</code>
+ * @see Character#toChars(int, char[], int)
+ * @since 1.5
+ */
+ public synchronized StringBuffer appendCodePoint(int code)
+ {
+ int len = Character.charCount(code);
+ ensureCapacity_unsynchronized(count + len);
+ Character.toChars(code, value, count);
+ count += len;
+ return this;
+ }
+
+ /**
* Append the <code>String</code> value of the argument to this
* <code>StringBuffer</code>. Uses <code>String.valueOf()</code> to convert
* to <code>String</code>.
@@ -497,21 +481,39 @@ public final class StringBuffer implements Serializable, CharSequence
}
/**
- * Append the code point to this <code>StringBuffer</code>.
- * This is like #append(char), but will append two characters
- * if a supplementary code point is given.
+ * Append the characters in the <code>CharSequence</code> to this
+ * buffer.
*
- * @param code the code point to append
+ * @param seq the <code>CharSequence</code> providing the characters
* @return this <code>StringBuffer</code>
- * @see Character#toChars(int, char[], int)
* @since 1.5
*/
- public synchronized StringBuffer appendCodePoint(int code)
+ public synchronized StringBuffer append(CharSequence seq)
{
- int len = Character.charCount(code);
- ensureCapacity_unsynchronized(count + len);
- Character.toChars(code, value, count);
- count += len;
+ return append(seq, 0, seq.length());
+ }
+
+ /**
+ * Append some characters from the <code>CharSequence</code> to this
+ * buffer. If the argument is null, the four characters "null" are
+ * appended.
+ *
+ * @param seq the <code>CharSequence</code> providing the characters
+ * @param start the starting index
+ * @param end one past the final index
+ * @return this <code>StringBuffer</code>
+ * @since 1.5
+ */
+ public synchronized StringBuffer append(CharSequence seq, int start, int end)
+ {
+ if (seq == null)
+ return append("null");
+ if (end - start > 0)
+ {
+ ensureCapacity_unsynchronized(count + end - start);
+ for (; start < end; ++start)
+ value[count++] = seq.charAt(start);
+ }
return this;
}
diff --git a/libjava/classpath/java/lang/StringBuilder.java b/libjava/classpath/java/lang/StringBuilder.java
index 98af48f8fb0..95d04d1e766 100644
--- a/libjava/classpath/java/lang/StringBuilder.java
+++ b/libjava/classpath/java/lang/StringBuilder.java
@@ -74,9 +74,8 @@ import java.io.Serializable;
*
* @since 1.5
*/
-// FIX15: Implement Appendable when co-variant methods are available
public final class StringBuilder
- implements Serializable, CharSequence
+ implements Serializable, CharSequence, Appendable
{
// Implementation note: if you change this class, you usually will
// want to change StringBuffer as well.
diff --git a/libjava/classpath/java/lang/SuppressWarnings.java b/libjava/classpath/java/lang/SuppressWarnings.java
new file mode 100644
index 00000000000..35b01a85130
--- /dev/null
+++ b/libjava/classpath/java/lang/SuppressWarnings.java
@@ -0,0 +1,69 @@
+/* SuppressWarnings - Annotation to avoid compiler warnings
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.lang;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+import static java.lang.annotation.ElementType.*;
+
+/**
+ * Tell the compiler that a given warning should be suppressed when it
+ * pertains to the marked program element and its sub-elements.
+ *
+ * Note that warning suppression is additive. For instance if a
+ * constructor has a warning suppressed, and a local variable in the
+ * constructor has a different warning suppressed, then the resulting
+ * set of suppressed warnings for that variable will be both warnings.
+ *
+ * @since 1.5
+ */
+@Retention(SOURCE)
+@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
+public @interface SuppressWarnings
+{
+ /**
+ * The list of warnings to suppress.
+ *
+ * It is valid to list a name more than once. Unrecognized names
+ * are not a compile-time error. At the present there is no
+ * standard for the names to be recognized by compilers; consult
+ * your compiler's documentation for this information.
+ */
+ String[] value ();
+}
diff --git a/libjava/classpath/java/lang/System.java b/libjava/classpath/java/lang/System.java
index 19278aa32cd..ca390bf161b 100644
--- a/libjava/classpath/java/lang/System.java
+++ b/libjava/classpath/java/lang/System.java
@@ -44,6 +44,14 @@ import gnu.classpath.VMStackWalker;
import java.io.InputStream;
import java.io.PrintStream;
+import java.util.AbstractCollection;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.Properties;
import java.util.PropertyPermission;
@@ -98,6 +106,11 @@ public final class System
public static final PrintStream err = VMSystem.makeStandardErrorStream();
/**
+ * A cached copy of the environment variable map.
+ */
+ private static Map<String,String> environmentMap;
+
+ /**
* This class is uninstantiable.
*/
private System()
@@ -118,6 +131,7 @@ public final class System
SecurityManager sm = SecurityManager.current; // Be thread-safe.
if (sm != null)
sm.checkPermission(new RuntimePermission("setIO"));
+
VMSystem.setIn(in);
}
@@ -134,8 +148,7 @@ public final class System
{
SecurityManager sm = SecurityManager.current; // Be thread-safe.
if (sm != null)
- sm.checkPermission(new RuntimePermission("setIO"));
-
+ sm.checkPermission(new RuntimePermission("setIO"));
VMSystem.setOut(out);
}
@@ -221,7 +234,7 @@ public final class System
{
return VMSystem.currentTimeMillis();
}
-
+
/**
* <p>
* Returns the current value of a nanosecond-precise system timer.
@@ -493,6 +506,60 @@ public final class System
}
/**
+ * <p>
+ * Returns an unmodifiable view of the system environment variables.
+ * If the underlying system does not support environment variables,
+ * an empty map is returned.
+ * </p>
+ * <p>
+ * The returned map is read-only and does not accept queries using
+ * null keys or values, or those of a type other than <code>String</code>.
+ * Attempts to modify the map will throw an
+ * <code>UnsupportedOperationException</code>, while attempts
+ * to pass in a null value will throw a
+ * <code>NullPointerException</code>. Types other than <code>String</code>
+ * throw a <code>ClassCastException</code>.
+ * </p>
+ * <p>
+ * As the returned map is generated using data from the underlying
+ * platform, it may not comply with the <code>equals()</code>
+ * and <code>hashCode()</code> contracts. It is also likely that
+ * the keys of this map will be case-sensitive.
+ * </p>
+ * <p>
+ * Use of this method may require a security check for the
+ * RuntimePermission "getenv.*".
+ * </p>
+ *
+ * @return a map of the system environment variables.
+ * @throws SecurityException if the checkPermission method of
+ * an installed security manager prevents access to
+ * the system environment variables.
+ * @since 1.5
+ */
+ public static Map<String, String> getenv()
+ {
+ SecurityManager sm = SecurityManager.current; // Be thread-safe.
+ if (sm != null)
+ sm.checkPermission(new RuntimePermission("getenv.*"));
+ if (environmentMap == null)
+ {
+ List<String> environ = (List<String>)VMSystem.environ();
+ Map<String,String> variables = new EnvironmentMap();
+ for (String pair : environ)
+ {
+ String[] parts = pair.split("=");
+ if (parts.length == 2)
+ variables.put(parts[0], parts[1]);
+ else
+ variables.put(parts[0], "");
+ }
+ environmentMap = Collections.unmodifiableMap(variables);
+ }
+ return environmentMap;
+ }
+
+ /**
* Terminate the Virtual Machine. This just calls
* <code>Runtime.getRuntime().exit(status)</code>, and never returns.
* Obviously, a security check is in order, <code>checkExit</code>.
@@ -604,4 +671,419 @@ public final class System
return VMRuntime.mapLibraryName(libname);
}
+
+ /**
+ * This is a specialised <code>Collection</code>, providing
+ * the necessary provisions for the collections used by the
+ * environment variable map. Namely, it prevents
+ * querying anything but <code>String</code>s.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ */
+ private static class EnvironmentCollection
+ extends AbstractCollection<String>
+ {
+
+ /**
+ * The wrapped collection.
+ */
+ protected Collection<String> c;
+
+ /**
+ * Constructs a new environment collection, which
+ * wraps the elements of the supplied collection.
+ *
+ * @param coll the collection to use as a base for
+ * this collection.
+ */
+ public EnvironmentCollection(Collection<String> coll)
+ {
+ c = coll;
+ }
+
+ /**
+ * Blocks queries containing a null object or an object which
+ * isn't of type <code>String</code>. All other queries
+ * are forwarded to the underlying collection.
+ *
+ * @param obj the object to look for.
+ * @return true if the object exists in the collection.
+ * @throws NullPointerException if the specified object is null.
+ * @throws ClassCastException if the specified object is not a String.
+ */
+ public boolean contains(Object obj)
+ {
+ if (obj == null)
+ throw new
+ NullPointerException("This collection does not support " +
+ "null values.");
+ if (!(obj instanceof String))
+ throw new
+ ClassCastException("This collection only supports Strings.");
+ return c.contains(obj);
+ }
+
+ /**
+ * Blocks queries where the collection contains a null object or
+ * an object which isn't of type <code>String</code>. All other
+ * queries are forwarded to the underlying collection.
+ *
+ * @param coll the collection of objects to look for.
+ * @return true if the collection contains all elements in the collection.
+ * @throws NullPointerException if the collection is null.
+ * @throws NullPointerException if any collection entry is null.
+ * @throws ClassCastException if any collection entry is not a String.
+ */
+ public boolean containsAll(Collection<?> coll)
+ {
+ for (Object o: coll)
+ {
+ if (o == null)
+ throw new
+ NullPointerException("This collection does not support " +
+ "null values.");
+ if (!(o instanceof String))
+ throw new
+ ClassCastException("This collection only supports Strings.");
+ }
+ return c.containsAll(coll);
+ }
+
+ /**
+ * This returns an iterator over the map elements, with the
+ * same provisions as for the collection and underlying map.
+ *
+ * @return an iterator over the map elements.
+ */
+ public Iterator<String> iterator()
+ {
+ return c.iterator();
+ }
+
+ /**
+ * Blocks the removal of elements from the collection.
+ *
+ * @return true if the removal was sucessful.
+ * @throws NullPointerException if the collection is null.
+ * @throws NullPointerException if any collection entry is null.
+ * @throws ClassCastException if any collection entry is not a String.
+ */
+ public boolean remove(Object key)
+ {
+ if (key == null)
+ throw new
+ NullPointerException("This collection does not support " +
+ "null values.");
+ if (!(key instanceof String))
+ throw new
+ ClassCastException("This collection only supports Strings.");
+ return c.contains(key);
+ }
+
+ /**
+ * Blocks the removal of all elements in the specified
+ * collection from the collection.
+ *
+ * @param coll the collection of elements to remove.
+ * @return true if the elements were removed.
+ * @throws NullPointerException if the collection is null.
+ * @throws NullPointerException if any collection entry is null.
+ * @throws ClassCastException if any collection entry is not a String.
+ */
+ public boolean removeAll(Collection<?> coll)
+ {
+ for (Object o: coll)
+ {
+ if (o == null)
+ throw new
+ NullPointerException("This collection does not support " +
+ "null values.");
+ if (!(o instanceof String))
+ throw new
+ ClassCastException("This collection only supports Strings.");
+ }
+ return c.removeAll(coll);
+ }
+
+ /**
+ * Blocks the retention of all elements in the specified
+ * collection from the collection.
+ *
+ * @param c the collection of elements to retain.
+ * @return true if the other elements were removed.
+ * @throws NullPointerException if the collection is null.
+ * @throws NullPointerException if any collection entry is null.
+ * @throws ClassCastException if any collection entry is not a String.
+ */
+ public boolean retainAll(Collection<?> coll)
+ {
+ for (Object o: coll)
+ {
+ if (o == null)
+ throw new
+ NullPointerException("This collection does not support " +
+ "null values.");
+ if (!(o instanceof String))
+ throw new
+ ClassCastException("This collection only supports Strings.");
+ }
+ return c.containsAll(coll);
+ }
+
+ /**
+ * This simply calls the same method on the wrapped
+ * collection.
+ *
+ * @return the size of the underlying collection.
+ */
+ public int size()
+ {
+ return c.size();
+ }
+
+ } // class EnvironmentCollection<String>
+
+ /**
+ * This is a specialised <code>HashMap</code>, which
+ * prevents the addition or querying of anything other than
+ * <code>String</code> objects.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ */
+ static class EnvironmentMap
+ extends HashMap<String,String>
+ {
+
+ /**
+ * Cache the entry set.
+ */
+ private transient Set<Map.Entry<String,String>> entries;
+
+ /**
+ * Cache the key set.
+ */
+ private transient Set<String> keys;
+
+ /**
+ * Cache the value collection.
+ */
+ private transient Collection<String> values;
+
+ /**
+ * Constructs a new empty <code>EnvironmentMap</code>.
+ */
+ EnvironmentMap()
+ {
+ super();
+ }
+
+ /**
+ * Constructs a new <code>EnvironmentMap</code> containing
+ * the contents of the specified map.
+ *
+ * @param m the map to be added to this.
+ * @throws NullPointerException if a key or value is null.
+ * @throws ClassCastException if a key or value is not a String.
+ */
+ EnvironmentMap(Map<String,String> m)
+ {
+ super(m);
+ }
+
+ /**
+ * Blocks queries containing a null key or one which is not
+ * of type <code>String</code>. All other queries
+ * are forwarded to the superclass.
+ *
+ * @param key the key to look for in the map.
+ * @return true if the key exists in the map.
+ * @throws NullPointerException if the specified key is null.
+ */
+ public boolean containsKey(Object key)
+ {
+ if (key == null)
+ throw new
+ NullPointerException("This map does not support null keys.");
+ if (!(key instanceof String))
+ throw new
+ ClassCastException("This map only allows queries using Strings.");
+ return super.containsKey(key);
+ }
+
+ /**
+ * Blocks queries using a null or non-<code>String</code> value.
+ * All other queries are forwarded to the superclass.
+ *
+ * @param value the value to look for in the map.
+ * @return true if the value exists in the map.
+ * @throws NullPointerException if the specified value is null.
+ */
+ public boolean containsValue(Object value)
+ {
+ if (value == null)
+ throw new
+ NullPointerException("This map does not support null values.");
+ if (!(value instanceof String))
+ throw new
+ ClassCastException("This map only allows queries using Strings.");
+ return super.containsValue(value);
+ }
+
+ /**
+ * Returns a set view of the map entries, with the same
+ * provisions as for the underlying map.
+ *
+ * @return a set containing the map entries.
+ */
+ public Set<Map.Entry<String,String>> entrySet()
+ {
+ if (entries == null)
+ entries = super.entrySet();
+ return entries;
+ }
+
+ /**
+ * Blocks queries containing a null or non-<code>String</code> key.
+ * All other queries are passed on to the superclass.
+ *
+ * @param key the key to retrieve the value for.
+ * @return the value associated with the given key.
+ * @throws NullPointerException if the specified key is null.
+ * @throws ClassCastException if the specified key is not a String.
+ */
+ public String get(Object key)
+ {
+ if (key == null)
+ throw new
+ NullPointerException("This map does not support null keys.");
+ if (!(key instanceof String))
+ throw new
+ ClassCastException("This map only allows queries using Strings.");
+ return super.get(key);
+ }
+
+ /**
+ * Returns a set view of the keys, with the same
+ * provisions as for the underlying map.
+ *
+ * @return a set containing the keys.
+ */
+ public Set<String> keySet()
+ {
+ if (keys == null)
+ keys = new EnvironmentSet(super.keySet());
+ return keys;
+ }
+
+ /**
+ * Associates the given key to the given value. If the
+ * map already contains the key, its value is replaced.
+ * The map does not accept null keys or values, or keys
+ * and values not of type {@link String}.
+ *
+ * @param key the key to map.
+ * @param value the value to be mapped.
+ * @return the previous value of the key, or null if there was no mapping
+ * @throws NullPointerException if a key or value is null.
+ * @throws ClassCastException if a key or value is not a String.
+ */
+ public String put(String key, String value)
+ {
+ if (key == null)
+ throw new NullPointerException("A new key is null.");
+ if (value == null)
+ throw new NullPointerException("A new value is null.");
+ if (!(key instanceof String))
+ throw new ClassCastException("A new key is not a String.");
+ if (!(value instanceof String))
+ throw new ClassCastException("A new value is not a String.");
+ return super.put(key, value);
+ }
+
+ /**
+ * Removes a key-value pair from the map. The queried key may not
+ * be null or of a type other than a <code>String</code>.
+ *
+ * @param key the key of the entry to remove.
+ * @return the removed value.
+ * @throws NullPointerException if the specified key is null.
+ * @throws ClassCastException if the specified key is not a String.
+ */
+ public String remove(Object key)
+ {
+ if (key == null)
+ throw new
+ NullPointerException("This map does not support null keys.");
+ if (!(key instanceof String))
+ throw new
+ ClassCastException("This map only allows queries using Strings.");
+ return super.remove(key);
+ }
+
+ /**
+ * Returns a collection view of the values, with the same
+ * provisions as for the underlying map.
+ *
+ * @return a collection containing the values.
+ */
+ public Collection<String> values()
+ {
+ if (values == null)
+ values = new EnvironmentCollection(super.values());
+ return values;
+ }
+
+ }
+
+ /**
+ * This is a specialised <code>Set</code>, providing
+ * the necessary provisions for the collections used by the
+ * environment variable map. Namely, it prevents
+ * modifications and the use of queries with null
+ * or non-<code>String</code> values.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ */
+ private static class EnvironmentSet
+ extends EnvironmentCollection
+ implements Set<String>
+ {
+
+ /**
+ * Constructs a new environment set, which
+ * wraps the elements of the supplied set.
+ *
+ * @param set the set to use as a base for
+ * this set.
+ */
+ public EnvironmentSet(Set<String> set)
+ {
+ super(set);
+ }
+
+ /**
+ * This simply calls the same method on the wrapped
+ * collection.
+ *
+ * @param obj the object to compare with.
+ * @return true if the two objects are equal.
+ */
+ public boolean equals(Object obj)
+ {
+ return c.equals(obj);
+ }
+
+ /**
+ * This simply calls the same method on the wrapped
+ * collection.
+ *
+ * @return the hashcode of the collection.
+ */
+ public int hashCode()
+ {
+ return c.hashCode();
+ }
+
+ } // class EnvironmentSet<String>
+
} // class System
diff --git a/libjava/classpath/java/lang/Thread.java b/libjava/classpath/java/lang/Thread.java
index 36b7c3303a9..01b380b67b5 100644
--- a/libjava/classpath/java/lang/Thread.java
+++ b/libjava/classpath/java/lang/Thread.java
@@ -143,6 +143,9 @@ public class Thread implements Runnable
/** This thread's ID. */
private final long threadId;
+
+ /** The park blocker. See LockSupport. */
+ Object parkBlocker;
/** The next thread number to use. */
private static int numAnonymousThreadsCreated;
@@ -352,9 +355,9 @@ public class Thread implements Runnable
if (group == null)
{
if (sm != null)
- group = sm.getThreadGroup();
+ group = sm.getThreadGroup();
if (group == null)
- group = current.group;
+ group = current.group;
}
if (sm != null)
sm.checkAccess(group);
@@ -398,7 +401,7 @@ public class Thread implements Runnable
this.vmThread = vmThread;
this.runnable = null;
if (name == null)
- name = createAnonymousThreadName();
+ name = createAnonymousThreadName();
this.name = name;
this.priority = priority;
this.daemon = daemon;
@@ -413,11 +416,11 @@ public class Thread implements Runnable
// (and, as above, the constructiong sequence calls Thread.currenThread()).
contextClassLoaderIsSystemClassLoader = true;
synchronized (Thread.class)
- {
- this.threadId = ++totalThreadsCreated;
- }
+ {
+ this.threadId = ++totalThreadsCreated;
+ }
}
-
+
/**
* Generate a name for an anonymous thread.
*/
@@ -466,7 +469,7 @@ public class Thread implements Runnable
{
VMThread t = vmThread;
if (t == null || group == null)
- throw new IllegalThreadStateException();
+ throw new IllegalThreadStateException();
return t.countStackFrames();
}
@@ -610,7 +613,7 @@ public class Thread implements Runnable
checkAccess();
VMThread t = vmThread;
if (t != null)
- t.interrupt();
+ t.interrupt();
}
/**
@@ -701,12 +704,12 @@ public class Thread implements Runnable
*/
public final void join(long ms, int ns) throws InterruptedException
{
- if(ms < 0 || ns < 0 || ns > 999999)
- throw new IllegalArgumentException();
+ if (ms < 0 || ns < 0 || ns > 999999)
+ throw new IllegalArgumentException();
VMThread t = vmThread;
- if(t != null)
- t.join(ms, ns);
+ if (t != null)
+ t.join(ms, ns);
}
/**
@@ -724,7 +727,7 @@ public class Thread implements Runnable
checkAccess();
VMThread t = vmThread;
if (t != null)
- t.resume();
+ t.resume();
}
/**
@@ -828,9 +831,9 @@ public class Thread implements Runnable
throw new NullPointerException();
VMThread t = vmThread;
if (t != null)
- t.setName(name);
+ t.setName(name);
else
- this.name = name;
+ this.name = name;
}
/**
@@ -850,11 +853,13 @@ public class Thread implements Runnable
* are no guarantees which thread will be next to run, but most VMs will
* choose the highest priority thread that has been waiting longest.
*
- * @param ms the number of milliseconds to sleep.
+ * @param ms the number of milliseconds to sleep, or 0 for forever
* @throws InterruptedException if the Thread is (or was) interrupted;
* it's <i>interrupted status</i> will be cleared
* @throws IllegalArgumentException if ms is negative
* @see #interrupt()
+ * @see #notify()
+ * @see #wait(long)
*/
public static void sleep(long ms) throws InterruptedException
{
@@ -874,17 +879,18 @@ public class Thread implements Runnable
* immediately when time expires, because some other thread may be
* active. So don't expect real-time performance.
*
- * @param ms the number of milliseconds to sleep
+ * @param ms the number of milliseconds to sleep, or 0 for forever
* @param ns the number of extra nanoseconds to sleep (0-999999)
* @throws InterruptedException if the Thread is (or was) interrupted;
* it's <i>interrupted status</i> will be cleared
* @throws IllegalArgumentException if ms or ns is negative
* or ns is larger than 999999.
* @see #interrupt()
+ * @see #notify()
+ * @see #wait(long, int)
*/
public static void sleep(long ms, int ns) throws InterruptedException
{
-
// Check parameters
if (ms < 0 )
throw new IllegalArgumentException("Negative milliseconds: " + ms);
@@ -909,7 +915,7 @@ public class Thread implements Runnable
public synchronized void start()
{
if (vmThread != null || group == null)
- throw new IllegalThreadStateException();
+ throw new IllegalThreadStateException();
VMThread.create(this, stacksize);
}
@@ -1006,7 +1012,7 @@ public class Thread implements Runnable
checkAccess();
VMThread t = vmThread;
if (t != null)
- t.suspend();
+ t.suspend();
}
/**
@@ -1033,9 +1039,9 @@ public class Thread implements Runnable
priority = Math.min(priority, group.getMaxPriority());
VMThread t = vmThread;
if (t != null)
- t.setPriority(priority);
+ t.setPriority(priority);
else
- this.priority = priority;
+ this.priority = priority;
}
/**
@@ -1229,6 +1235,37 @@ public class Thread implements Runnable
void uncaughtException(Thread thr, Throwable exc);
}
+ /**
+ * <p>
+ * Represents the current state of a thread, according to the VM rather
+ * than the operating system. It can be one of the following:
+ * </p>
+ * <ul>
+ * <li>NEW -- The thread has just been created but is not yet running.</li>
+ * <li>RUNNABLE -- The thread is currently running or can be scheduled
+ * to run.</li>
+ * <li>BLOCKED -- The thread is blocked waiting on an I/O operation
+ * or to obtain a lock.</li>
+ * <li>WAITING -- The thread is waiting indefinitely for another thread
+ * to do something.</li>
+ * <li>TIMED_WAITING -- The thread is waiting for a specific amount of time
+ * for another thread to do something.</li>
+ * <li>TERMINATED -- The thread has exited.</li>
+ * </ul>
+ *
+ * @since 1.5
+ */
+ public enum State
+ {
+ BLOCKED, NEW, RUNNABLE, TERMINATED, TIMED_WAITING, WAITING;
+
+ /**
+ * For compatability with Sun's JDK
+ */
+ private static final long serialVersionUID = 605505746047245783L;
+ }
+
+
/**
* Returns the current state of the thread. This
* is designed for monitoring thread behaviour, rather
@@ -1236,14 +1273,14 @@ public class Thread implements Runnable
*
* @return the current thread state.
*/
- public String getState()
+ public State getState()
{
VMThread t = vmThread;
if (t != null)
- return t.getState();
+ return State.valueOf(t.getState());
if (group == null)
- return "TERMINATED";
- return "NEW";
+ return State.TERMINATED;
+ return State.NEW;
}
/**
@@ -1279,7 +1316,7 @@ public class Thread implements Runnable
* @since 1.5
* @see #getStackTrace()
*/
- public static Map getAllStackTraces()
+ public static Map<Thread, StackTraceElement[]> getAllStackTraces()
{
ThreadGroup group = currentThread().group;
while (group.getParent() != null)
diff --git a/libjava/classpath/java/lang/ThreadLocal.java b/libjava/classpath/java/lang/ThreadLocal.java
index 64df8c3dd26..6c4ba176a41 100644
--- a/libjava/classpath/java/lang/ThreadLocal.java
+++ b/libjava/classpath/java/lang/ThreadLocal.java
@@ -1,5 +1,5 @@
/* ThreadLocal -- a variable with a unique value per thread
- Copyright (C) 2000, 2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -84,16 +84,16 @@ import java.util.Map;
* @author Mark Wielaard (mark@klomp.org)
* @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
- * @status updated to 1.4
+ * @status updated to 1.5
*/
-public class ThreadLocal
+public class ThreadLocal<T>
{
/**
* Placeholder to distinguish between uninitialized and null set by the
* user. Do not expose this to the public. Package visible for use by
* InheritableThreadLocal
*/
- static final Object NULL = new Object();
+ static final Object sentinel = new Object();
/**
* Creates a ThreadLocal object without associating any value to it yet.
@@ -110,7 +110,7 @@ public class ThreadLocal
*
* @return the initial value of the variable in this thread
*/
- protected Object initialValue()
+ protected T initialValue()
{
return null;
}
@@ -123,18 +123,18 @@ public class ThreadLocal
*
* @return the value of the variable in this thread
*/
- public Object get()
+ public T get()
{
- Map map = Thread.getThreadLocals();
+ Map<ThreadLocal<T>,T> map = (Map<ThreadLocal<T>,T>) Thread.getThreadLocals();
// Note that we don't have to synchronize, as only this thread will
// ever modify the map.
- Object value = map.get(this);
+ T value = map.get(this);
if (value == null)
{
value = initialValue();
- map.put(this, value == null ? NULL : value);
+ map.put(this, (T) (value == null ? sentinel : value));
}
- return value == NULL ? null : value;
+ return value == (T) sentinel ? null : value;
}
/**
@@ -145,12 +145,12 @@ public class ThreadLocal
*
* @param value the value to set this thread's view of the variable to
*/
- public void set(Object value)
+ public void set(T value)
{
Map map = Thread.getThreadLocals();
// Note that we don't have to synchronize, as only this thread will
// ever modify the map.
- map.put(this, value == null ? NULL : value);
+ map.put(this, value == null ? sentinel : value);
}
/**
diff --git a/libjava/classpath/java/lang/Void.java b/libjava/classpath/java/lang/Void.java
index 15035426830..05ed98503fb 100644
--- a/libjava/classpath/java/lang/Void.java
+++ b/libjava/classpath/java/lang/Void.java
@@ -1,5 +1,5 @@
/* Void.class - defines void.class
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,7 +49,7 @@ package java.lang;
* @author John Keiser
* @author Eric Blake (ebb9@email.byu.edu)
* @since 1.1
- * @status updated to 1.4
+ * @status updated to 1.5
*/
public final class Void
{
@@ -57,7 +57,7 @@ public final class Void
* The return type <code>void</code> is represented by this
* <code>Class</code> object.
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass('V');
+ public static final Class<Void> TYPE = (Class<Void>) VMClassLoader.getPrimitiveClass('V');
/**
* Void is non-instantiable.
diff --git a/libjava/classpath/java/lang/annotation/Annotation.java b/libjava/classpath/java/lang/annotation/Annotation.java
index 01e23930eea..cc334ec3bb6 100644
--- a/libjava/classpath/java/lang/annotation/Annotation.java
+++ b/libjava/classpath/java/lang/annotation/Annotation.java
@@ -54,8 +54,7 @@ public interface Annotation
*
* @return the class of which this annotation is an instance.
*/
- /* FIXME[GENERICS]: Should return Class<? extends Annotation> */
- Class annotationType();
+ Class<? extends Annotation> annotationType();
/**
* <p>
diff --git a/libjava/classpath/java/lang/annotation/Documented.java b/libjava/classpath/java/lang/annotation/Documented.java
new file mode 100644
index 00000000000..9a51bc2f036
--- /dev/null
+++ b/libjava/classpath/java/lang/annotation/Documented.java
@@ -0,0 +1,50 @@
+/* Documented.java - Indicates documented source element
+ Copyright (C) 2004, 2005 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.lang.annotation;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+@Documented @Retention(RUNTIME)
+public @interface Documented
+{
+}
diff --git a/libjava/classpath/java/lang/annotation/ElementType.java b/libjava/classpath/java/lang/annotation/ElementType.java
new file mode 100644
index 00000000000..3ab89c94610
--- /dev/null
+++ b/libjava/classpath/java/lang/annotation/ElementType.java
@@ -0,0 +1,59 @@
+/* ElementType.java - Enum listing Java source elements
+ Copyright (C) 2004 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.lang.annotation;
+
+/**
+ * @since 1.5
+ */
+public enum ElementType
+{
+ ANNOTATION_TYPE,
+ CONSTRUCTOR,
+ FIELD,
+ LOCAL_VARIABLE,
+ METHOD,
+ PACKAGE,
+ PARAMETER,
+ TYPE;
+
+ /**
+ * For compatability with Sun's JDK
+ */
+ private static final long serialVersionUID = 2798216111136361587L;
+
+}
diff --git a/libjava/classpath/java/lang/annotation/IncompleteAnnotationException.java b/libjava/classpath/java/lang/annotation/IncompleteAnnotationException.java
index a35df0c09b8..5b20650d1cf 100644
--- a/libjava/classpath/java/lang/annotation/IncompleteAnnotationException.java
+++ b/libjava/classpath/java/lang/annotation/IncompleteAnnotationException.java
@@ -58,7 +58,8 @@ public class IncompleteAnnotationException extends RuntimeException
* @param type the type of annotation from which an element is missing.
* @param name the name of the missing element.
*/
- public IncompleteAnnotationException(Class type, String name)
+ public IncompleteAnnotationException(Class<? extends Annotation> type,
+ String name)
{
this.annotationType = type;
this.elementName = name;
@@ -70,7 +71,7 @@ public class IncompleteAnnotationException extends RuntimeException
*
* @return the type of annotation.
*/
- public Class annotationType()
+ public Class<? extends Annotation> annotationType()
{
return annotationType;
}
@@ -94,7 +95,7 @@ public class IncompleteAnnotationException extends RuntimeException
* @serial the type of the annotation from which an
* element was missing.
*/
- private Class annotationType;
+ private Class<? extends Annotation> annotationType;
/**
* The name of the missing element.
diff --git a/libjava/classpath/java/lang/annotation/Inherited.java b/libjava/classpath/java/lang/annotation/Inherited.java
new file mode 100644
index 00000000000..34acbf47ccc
--- /dev/null
+++ b/libjava/classpath/java/lang/annotation/Inherited.java
@@ -0,0 +1,51 @@
+/* Inherited.java - Indicates inherited annotation
+ Copyright (C) 2004, 2005 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.lang.annotation;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+
+/**
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+@Documented @Retention(RUNTIME) @Target(ANNOTATION_TYPE)
+public @interface Inherited
+{
+}
diff --git a/libjava/classpath/java/lang/annotation/Retention.java b/libjava/classpath/java/lang/annotation/Retention.java
new file mode 100644
index 00000000000..8d8a79dbc36
--- /dev/null
+++ b/libjava/classpath/java/lang/annotation/Retention.java
@@ -0,0 +1,59 @@
+/* Retention.java - Retention policy for an annotation
+ Copyright (C) 2004, 2005 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.lang.annotation;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+
+/**
+ * This annotation is used to specify the desired lifetime of another
+ * annotation.
+ *
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @see RetentionPolicy
+ * @since 1.5
+ */
+@Documented @Retention(RUNTIME) @Target(ANNOTATION_TYPE)
+public @interface Retention
+{
+ /**
+ * The value holds the lifetime of the annotation.
+ */
+ RetentionPolicy value();
+}
diff --git a/libjava/classpath/java/lang/annotation/RetentionPolicy.java b/libjava/classpath/java/lang/annotation/RetentionPolicy.java
new file mode 100644
index 00000000000..56d2af1b7b3
--- /dev/null
+++ b/libjava/classpath/java/lang/annotation/RetentionPolicy.java
@@ -0,0 +1,66 @@
+/* RetentionPolicy.java - Enum listing lifetimes for an annotation
+ Copyright (C) 2004 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.lang.annotation;
+
+/**
+ * This enum is used to control the lifetime of an annotation.
+ *
+ * @see Retention
+ *
+ * @since 1.5
+ */
+public enum RetentionPolicy
+{
+ /** Indicates that the annotation should be stored in class files. */
+ CLASS,
+
+ /** Indicates that the annotation should be available at runtime. */
+ RUNTIME,
+
+ /**
+ * Indicates that the annotation should only be available when
+ * parsing the source code.
+ */
+ SOURCE;
+
+ /**
+ * For compatability with Sun's JDK
+ */
+ private static final long serialVersionUID = -1700821648800605045L;
+
+}
diff --git a/libjava/classpath/java/lang/annotation/Target.java b/libjava/classpath/java/lang/annotation/Target.java
new file mode 100644
index 00000000000..c9d9686325e
--- /dev/null
+++ b/libjava/classpath/java/lang/annotation/Target.java
@@ -0,0 +1,52 @@
+/* Target.java - Indicate where an annotation may be applied
+ Copyright (C) 2004, 2005 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.lang.annotation;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+
+/**
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+@Documented @Retention(RUNTIME) @Target(ANNOTATION_TYPE)
+public @interface Target
+{
+ ElementType[] value();
+}
diff --git a/libjava/classpath/java/lang/class-dependencies.conf b/libjava/classpath/java/lang/class-dependencies.conf
new file mode 100644
index 00000000000..4fbf75eb1ce
--- /dev/null
+++ b/libjava/classpath/java/lang/class-dependencies.conf
@@ -0,0 +1,58 @@
+# This property file contains dependencies of classes, methods, and
+# field on other methods or classes.
+#
+# Syntax:
+#
+# <used>: <needed 1> [... <needed N>]
+#
+# means that when <used> is included, <needed 1> (... <needed N>) must
+# be included as well.
+#
+# <needed X> and <used> are of the form
+#
+# <class.methodOrField(signature)>
+#
+# or just
+#
+# <class>
+#
+# Within dependencies, variables can be used. A variable is defined as
+# follows:
+#
+# {variable}: value1 value2 ... value<n>
+#
+# variables can be used on the right side of dependencies as follows:
+#
+# <used>: com.bla.blu.{variable}.Class.m()V
+#
+# The use of the variable will expand to <n> dependencies of the form
+#
+# <used>: com.bla.blu.value1.Class.m()V
+# <used>: com.bla.blu.value2.Class.m()V
+# ...
+# <used>: com.bla.blu.value<n>.Class.m()V
+#
+# Variables can be redefined when building a system to select the
+# required support for features like encodings, protocols, etc.
+#
+# Hints:
+#
+# - For methods and fields, the signature is mandatory. For
+# specification, please see the Java Virtual Machine Specification by
+# SUN. Unlike in the spec, field signatures (types) are in brackets.
+#
+# - Package names must be separated by '/' (and not '.'). E.g.,
+# java/lang/Class (this is necessary, because the '.' is used to
+# separate method or field names from classes)
+#
+# - In case <needed> refers to a class, only the class itself will be
+# included in the resulting binary, NOT necessarily all its methods
+# and fields. If you want to refer to all methods and fields, you can
+# write class.* as an abbreviation.
+#
+# - Abbreviations for packages are also possible: my/package/* means all
+# methods and fields of all classes in my/package.
+#
+# - A line with a trailing '\' continues in the next line.
+
+# end of file
diff --git a/libjava/classpath/java/lang/instrument/ClassDefinition.java b/libjava/classpath/java/lang/instrument/ClassDefinition.java
index 841597c31ed..f2fbf929667 100644
--- a/libjava/classpath/java/lang/instrument/ClassDefinition.java
+++ b/libjava/classpath/java/lang/instrument/ClassDefinition.java
@@ -60,8 +60,7 @@ public final class ClassDefinition
* @param theClassFile the new class file
* @throws NullPointerException if one of the argument is null
*/
- /* FIXME[GENERICS]: Signature should be (Class<?>, byte[]) */
- public ClassDefinition(Class theClass, byte[] theClassFile)
+ public ClassDefinition(Class<?> theClass, byte[] theClassFile)
{
if (theClass == null || theClassFile == null)
throw new NullPointerException();
@@ -72,8 +71,7 @@ public final class ClassDefinition
/**
* @return the Class
*/
- /* FIXME[GENERICS]: Should return Class<?> */
- public Class getDefinitionClass()
+ public Class<?> getDefinitionClass()
{
return theClass;
}
diff --git a/libjava/classpath/java/lang/instrument/ClassFileTransformer.java b/libjava/classpath/java/lang/instrument/ClassFileTransformer.java
index 68638d71971..01b2f8aaaf5 100644
--- a/libjava/classpath/java/lang/instrument/ClassFileTransformer.java
+++ b/libjava/classpath/java/lang/instrument/ClassFileTransformer.java
@@ -75,10 +75,9 @@ public interface ClassFileTransformer
* @see Instrumentation#redefineClasses(java.lang.instrument.ClassDefinition[])
*
*/
- /* FIXME[GENERICS]: Class should be Class<?> */
byte[] transform(ClassLoader loader,
String className,
- Class classBeingRedefined,
+ Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer)
throws IllegalClassFormatException;
diff --git a/libjava/classpath/java/lang/management/ManagementFactory.java b/libjava/classpath/java/lang/management/ManagementFactory.java
index 6e7af0f274e..a51ca0f4c9f 100644
--- a/libjava/classpath/java/lang/management/ManagementFactory.java
+++ b/libjava/classpath/java/lang/management/ManagementFactory.java
@@ -50,9 +50,18 @@ import gnu.java.lang.management.RuntimeMXBeanImpl;
import gnu.java.lang.management.ThreadMXBeanImpl;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
+import java.util.logging.LogManager;
+
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.MalformedObjectNameException;
import javax.management.NotCompliantMBeanException;
+import javax.management.ObjectName;
/**
* <p>
@@ -66,7 +75,55 @@ import javax.management.NotCompliantMBeanException;
* <ol>
* <li>Calling the appropriate static method of this factory.
* </li>
+ * <li>Using the platform {@link javax.management.MBeanServer}
+ * to access the beans locally, or an
+ * {@link javax.management.MBeanServerConnection} for remote
+ * access. The attributes and operations use the limited
+ * range of data types specified below.</li>
* </ol>
+ * <h2>Open Data Types</h2>
+ * <p>
+ * The data types used by the management beans are restricted
+ * to <emph>open</emph> data types to aid interoperability. This
+ * allows the beans to be accessed remotely, including from non-Java
+ * clients. Below is a table which lists the types used by the beans
+ * on the left, and the types they are converted to when returned via
+ * a bean server on the right. Type information is provided for each
+ * bean by obtaining its instance of {@link javax.management.MBeanInfo}.
+ * </p>
+ * <table>
+ * <th><td>Data Type Used</td><td>Data Type Returned</td></th>
+ * <tr>
+ * <td>Primitive types (<code>int</code>, <code>char</code>, etc.)</td>
+ * <td>Same</td>
+ * </tr><tr>
+ * <td>Wrapper classes ({@link{java.lang.Integer},
+ * @link{java.lang.Character}, etc.)</td>
+ * <td>Same</td>
+ * </tr><tr>
+ * <td>An {@link java.lang.Enum}</td>
+ * <td>The <code>name</code> of the enumeration constant</td>
+ * </tr><tr>
+ * <td>An array of type <code>E</code></td>
+ * <td>An array of the same dimensions with this mapping applied
+ * to <code>E</code>.</td>
+ * </tr><tr>
+ * <td>A class with `getter' methods and a
+ * <code>from({@link javax.management.openmbean.CompositeData})</code>
+ * method.</td>
+ * <td>The equivalent {@link javax.management.openmbean.CompositeData}
+ * instance, specified by the <code>from</code> method.</td>
+ * </tr><tr>
+ * <td>A map with keys of type <code>K</code> and values of
+ * type <code>V</code>.</td>
+ * <td>A {@link javax.management.openmbean.TabularData} instance,
+ * with the row type containing two items, <code>"key"</code> and
+ * <code>"value"</code> with the types <code>K</code> and <code>V</code>
+ * respectively (with translation applied).</td>
+ * </tr><tr>
+ * <td>A list of type <code>E</code>.</td>
+ * <td>An array with this mapping applied to <code>E</code>.</td>
+ * </tr></table>
*
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.5
@@ -75,6 +132,60 @@ public class ManagementFactory
{
/**
+ * The object name for the class loading bean.
+ */
+ public static final String CLASS_LOADING_MXBEAN_NAME =
+ "java.lang:type=ClassLoading";
+
+ /**
+ * The object name for the compilation bean.
+ */
+ public static final String COMPILATION_MXBEAN_NAME =
+ "java.lang:type=Compilation";
+
+ /**
+ * The domain for the garbage collecting beans.
+ */
+ public static final String GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE =
+ "java.lang:type=GarbageCollector";
+
+ /**
+ * The domain for the memory manager beans.
+ */
+ public static final String MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE =
+ "java.lang:type=MemoryManager";
+
+ /**
+ * The object name for the memory bean.
+ */
+ public static final String MEMORY_MXBEAN_NAME =
+ "java.lang:type=Memory";
+
+ /**
+ * The domain for the memory pool beans.
+ */
+ public static final String MEMORY_POOL_MXBEAN_DOMAIN_TYPE =
+ "java.lang:type=MemoryPool";
+
+ /**
+ * The object name for the operating system bean.
+ */
+ public static final String OPERATING_SYSTEM_MXBEAN_NAME =
+ "java.lang:type=OperatingSystem";
+
+ /**
+ * The object name for the runtime bean.
+ */
+ public static final String RUNTIME_MXBEAN_NAME =
+ "java.lang:type=Runtime";
+
+ /**
+ * The object name for the threading bean.
+ */
+ public static final String THREAD_MXBEAN_NAME =
+ "java.lang:type=Threading";
+
+ /**
* The operating system management bean.
*/
private static OperatingSystemMXBean osBean;
@@ -105,6 +216,11 @@ public class ManagementFactory
private static CompilationMXBean compilationBean;
/**
+ * The platform server.
+ */
+ private static MBeanServer platformServer;
+
+ /**
* Private constructor to prevent instance creation.
*/
private ManagementFactory() {}
@@ -258,9 +374,10 @@ public class ManagementFactory
*
* @return a list of memory pool beans, one for each pool.
*/
- public static List getMemoryPoolMXBeans()
+ public static List<MemoryPoolMXBean> getMemoryPoolMXBeans()
{
- List poolBeans = new ArrayList();
+ List<MemoryPoolMXBean> poolBeans =
+ new ArrayList<MemoryPoolMXBean>();
String[] names = VMManagementFactory.getMemoryPoolNames();
for (int a = 0; a < names.length; ++a)
try
@@ -283,9 +400,10 @@ public class ManagementFactory
*
* @return a list of memory manager beans, one for each manager.
*/
- public static List getMemoryManagerMXBeans()
+ public static List<MemoryManagerMXBean> getMemoryManagerMXBeans()
{
- List managerBeans = new ArrayList();
+ List<MemoryManagerMXBean> managerBeans =
+ new ArrayList<MemoryManagerMXBean>();
String[] names = VMManagementFactory.getMemoryManagerNames();
for (int a = 0; a < names.length; ++a)
try
@@ -309,9 +427,10 @@ public class ManagementFactory
*
* @return a list of garbage collector beans, one for each pool.
*/
- public static List getGarbageCollectorMXBeans()
+ public static List<GarbageCollectorMXBean> getGarbageCollectorMXBeans()
{
- List gcBeans = new ArrayList();
+ List<GarbageCollectorMXBean> gcBeans =
+ new ArrayList<GarbageCollectorMXBean>();
String[] names = VMManagementFactory.getGarbageCollectorNames();
for (int a = 0; a < names.length; ++a)
try
@@ -328,4 +447,106 @@ public class ManagementFactory
return gcBeans;
}
+ /**
+ * <p>
+ * Returns the platform {@link javax.management.MBeanServer}. On the
+ * first call to this method, a server instance is retrieved from
+ * the {@link javax.management.MBeanServerFactory} and each of the
+ * beans are registered with it. Subsequent calls return the existing
+ * instance. If the property <code>javax.management.builder.initial</code>
+ * is set, its value will be used as the name of the class which is used
+ * to provide the server instance.
+ * </p>
+ * <p>
+ * It is recommended that the platform server is used for other beans as
+ * well, in order to simplify their discovery and publication. Name conflicts
+ * should be avoided.
+ * </p>
+ *
+ * @return the platform {@link javax.management.MBeanServer}
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanServerPermission(String)}("createMBeanServer")
+ * @see javax.management.MBeanServerFactory
+ * @see javax.management.MBeanServerFactory#createMBeanServer()
+ */
+ public static MBeanServer getPlatformMBeanServer()
+ {
+ if (platformServer == null)
+ {
+ platformServer = MBeanServerFactory.createMBeanServer();
+ try
+ {
+ platformServer.registerMBean(getOperatingSystemMXBean(),
+ new ObjectName(OPERATING_SYSTEM_MXBEAN_NAME));
+ platformServer.registerMBean(getRuntimeMXBean(),
+ new ObjectName(RUNTIME_MXBEAN_NAME));
+ platformServer.registerMBean(getClassLoadingMXBean(),
+ new ObjectName(CLASS_LOADING_MXBEAN_NAME));
+ platformServer.registerMBean(getThreadMXBean(),
+ new ObjectName(THREAD_MXBEAN_NAME));
+ platformServer.registerMBean(getMemoryMXBean(),
+ new ObjectName(MEMORY_MXBEAN_NAME));
+ CompilationMXBean compBean = getCompilationMXBean();
+ if (compBean != null)
+ platformServer.registerMBean(compBean,
+ new ObjectName(COMPILATION_MXBEAN_NAME));
+ Iterator beans = getMemoryPoolMXBeans().iterator();
+ while (beans.hasNext())
+ {
+ MemoryPoolMXBean bean = (MemoryPoolMXBean) beans.next();
+ platformServer.registerMBean(bean,
+ new ObjectName(MEMORY_POOL_MXBEAN_DOMAIN_TYPE +
+ ",name=" +
+ bean.getName()));
+ }
+ beans = getMemoryManagerMXBeans().iterator();
+ while (beans.hasNext())
+ {
+ MemoryManagerMXBean bean = (MemoryManagerMXBean) beans.next();
+ platformServer.registerMBean(bean,
+ new ObjectName(MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE +
+ ",name=" +
+ bean.getName()));
+ }
+ beans = getGarbageCollectorMXBeans().iterator();
+ while (beans.hasNext())
+ {
+ GarbageCollectorMXBean bean = (GarbageCollectorMXBean) beans.next();
+ platformServer.registerMBean(bean,
+ new ObjectName(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE +
+ ",name=" +
+ bean.getName()));
+ }
+ platformServer.registerMBean(LogManager.getLoggingMXBean(),
+ new ObjectName(LogManager.LOGGING_MXBEAN_NAME));
+ }
+ catch (InstanceAlreadyExistsException e)
+ {
+ throw (Error)
+ (new InternalError("One of the management beans is " +
+ "already registered.").initCause(e));
+ }
+ catch (MBeanRegistrationException e)
+ {
+ throw (Error)
+ (new InternalError("One of the management beans' preRegister " +
+ "methods threw an exception.").initCause(e));
+ }
+ catch (NotCompliantMBeanException e)
+ {
+ throw (Error)
+ (new InternalError("One of the management beans is " +
+ "not compliant.").initCause(e));
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw (Error)
+ (new InternalError("The object name of a management bean is " +
+ "not compliant.").initCause(e));
+ }
+ }
+ return platformServer;
+ }
+
}
diff --git a/libjava/classpath/java/lang/management/MemoryPoolMXBean.java b/libjava/classpath/java/lang/management/MemoryPoolMXBean.java
index 5b04c64d3b8..36a8236dc01 100644
--- a/libjava/classpath/java/lang/management/MemoryPoolMXBean.java
+++ b/libjava/classpath/java/lang/management/MemoryPoolMXBean.java
@@ -162,7 +162,7 @@ public interface MemoryPoolMXBean
*
* @return the type of this pool.
*/
- String getType();
+ MemoryType getType();
/**
* Returns memory usage statistics for the current memory usage
diff --git a/libjava/classpath/java/lang/management/MemoryType.java b/libjava/classpath/java/lang/management/MemoryType.java
new file mode 100644
index 00000000000..4422b329836
--- /dev/null
+++ b/libjava/classpath/java/lang/management/MemoryType.java
@@ -0,0 +1,51 @@
+/* MemoryType.java - Enumeration of the types of memory pools.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.lang.management;
+
+/**
+ * Enumerates the possible types of memory pools. A value of this
+ * type is returned by {@link MemoryPoolMXBean#getMemoryType()}.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public enum MemoryType
+{
+ HEAP, NON_HEAP;
+}
+
diff --git a/libjava/classpath/java/lang/management/RuntimeMXBean.java b/libjava/classpath/java/lang/management/RuntimeMXBean.java
index cee1d805f89..a2931d12783 100644
--- a/libjava/classpath/java/lang/management/RuntimeMXBean.java
+++ b/libjava/classpath/java/lang/management/RuntimeMXBean.java
@@ -106,7 +106,7 @@ public interface RuntimeMXBean
* denies ManagementPermission("monitor").
* @see java.lang.management.ManagementPermission
*/
- List getInputArguments();
+ List<String> getInputArguments();
/**
* Returns the library path. This is equivalent to obtaining the
@@ -212,7 +212,7 @@ public interface RuntimeMXBean
*
* @return the map of system properties.
*/
- Map getSystemProperties();
+ Map<String,String> getSystemProperties();
/**
* Returns the uptime of the virtual machine in milliseconds.
diff --git a/libjava/classpath/java/lang/management/ThreadInfo.java b/libjava/classpath/java/lang/management/ThreadInfo.java
index 4bf35a4cbeb..428aca3fac8 100644
--- a/libjava/classpath/java/lang/management/ThreadInfo.java
+++ b/libjava/classpath/java/lang/management/ThreadInfo.java
@@ -102,7 +102,7 @@ public class ThreadInfo
/**
* The state of the thread which this instance concerns.
*/
- private String threadState;
+ private Thread.State threadState;
/**
* The number of times the thread has been blocked.
@@ -200,10 +200,12 @@ public class ThreadInfo
long waitedTime, boolean isInNative, boolean isSuspended,
StackTraceElement[] trace)
{
- this(thread.getId(), thread.getName(), thread.getState(), blockedCount,
- blockedTime, lock.getClass().getName() + "@" +
- Integer.toHexString(System.identityHashCode(lock)), lockOwner.getId(),
- lockOwner.getName(), waitedCount, waitedTime, isInNative, isSuspended,
+ this(thread.getId(), thread.getName(), thread.getState(), blockedCount, blockedTime,
+ lock == null ? null : lock.getClass().getName() + "@" +
+ Integer.toHexString(System.identityHashCode(lock)),
+ lockOwner == null ? -1 : lockOwner.getId(),
+ lockOwner == null ? null : lockOwner.getName(),
+ waitedCount, waitedTime, isInNative, isSuspended,
trace);
}
@@ -240,7 +242,7 @@ public class ThreadInfo
* @param trace the stack trace of the thread to a pre-determined
* depth (see VMThreadMXBeanImpl)
*/
- private ThreadInfo(long threadId, String threadName, String threadState,
+ private ThreadInfo(long threadId, String threadName, Thread.State threadState,
long blockedCount, long blockedTime, String lockName,
long lockOwnerId, String lockOwnerName, long waitedCount,
long waitedTime, boolean isInNative, boolean isSuspended,
@@ -387,7 +389,7 @@ public class ThreadInfo
dTraces[a].get("lineNumber")).intValue());
return new ThreadInfo(((Long) data.get("threadId")).longValue(),
(String) data.get("threadName"),
- (String) data.get("threadState"),
+ Thread.State.valueOf((String) data.get("threadState")),
((Long) data.get("blockedCount")).longValue(),
((Long) data.get("blockedTime")).longValue(),
(String) data.get("lockName"),
@@ -484,7 +486,7 @@ public class ThreadInfo
*/
public String getLockName()
{
- if (threadState.equals("BLOCKED"))
+ if (threadState != Thread.State.BLOCKED)
return null;
return lockName;
}
@@ -502,7 +504,7 @@ public class ThreadInfo
*/
public long getLockOwnerId()
{
- if (threadState.equals("BLOCKED"))
+ if (threadState != Thread.State.BLOCKED)
return -1;
return lockOwnerId;
}
@@ -520,7 +522,7 @@ public class ThreadInfo
*/
public String getLockOwnerName()
{
- if (threadState.equals("BLOCKED"))
+ if (threadState != Thread.State.BLOCKED)
return null;
return lockOwnerName;
}
@@ -577,7 +579,7 @@ public class ThreadInfo
*
* @return the thread's state.
*/
- public String getThreadState()
+ public Thread.State getThreadState()
{
return threadState;
}
@@ -695,7 +697,7 @@ public class ThreadInfo
", waitedCount=" + waitedCount +
", isInNative=" + isInNative +
", isSuspended=" + isSuspended +
- (threadState.equals("BLOCKED") ?
+ (threadState == Thread.State.BLOCKED ?
", lockOwnerId=" + lockOwnerId +
", lockOwnerName=" + lockOwnerName : "") +
"]";
diff --git a/libjava/classpath/java/lang/ref/PhantomReference.java b/libjava/classpath/java/lang/ref/PhantomReference.java
index 4d929c29c58..67e97d399cd 100644
--- a/libjava/classpath/java/lang/ref/PhantomReference.java
+++ b/libjava/classpath/java/lang/ref/PhantomReference.java
@@ -1,5 +1,5 @@
/* java.lang.ref.PhantomReference
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,8 +46,8 @@ package java.lang.ref;
*
* @author Jochen Hoenicke
*/
-public class PhantomReference
- extends Reference
+public class PhantomReference<T>
+ extends Reference<T>
{
/**
* Creates a new phantom reference.
@@ -56,7 +56,7 @@ public class PhantomReference
* finalized. This mustn't be <code>null</code>.
* @exception NullPointerException if q is null.
*/
- public PhantomReference(Object referent, ReferenceQueue q)
+ public PhantomReference(T referent, ReferenceQueue<? super T> q)
{
super(referent, q);
}
@@ -66,7 +66,7 @@ public class PhantomReference
* @return <code>null</code>, since the refered object may be
* finalized and thus not accessible.
*/
- public Object get()
+ public T get()
{
return null;
}
diff --git a/libjava/classpath/java/lang/ref/Reference.java b/libjava/classpath/java/lang/ref/Reference.java
index 4b6a3adbcc1..ce224b891f9 100644
--- a/libjava/classpath/java/lang/ref/Reference.java
+++ b/libjava/classpath/java/lang/ref/Reference.java
@@ -1,5 +1,5 @@
/* java.lang.ref.Reference
- Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -70,19 +70,19 @@ package java.lang.ref;
* @author Jochen Hoenicke
* @see java.util.WeakHashMap
*/
-public abstract class Reference
+public abstract class Reference<T>
{
/**
* The underlying object. This field is handled in a special way by
* the garbage collector.
*/
- Object referent;
+ T referent;
/**
* The queue this reference is registered on. This is null, if this
* wasn't registered to any queue or reference was already enqueued.
*/
- ReferenceQueue queue;
+ volatile ReferenceQueue<? super T> queue;
/**
* Link to the next entry on the queue. If this is null, this
@@ -91,7 +91,7 @@ public abstract class Reference
* (not to null, that value is used to mark a not enqueued
* reference).
*/
- Reference nextOnQueue;
+ volatile Reference nextOnQueue;
/**
* This lock should be taken by the garbage collector, before
@@ -106,7 +106,7 @@ public abstract class Reference
* class in a different package.
* @param ref the object we refer to.
*/
- Reference(Object ref)
+ Reference(T ref)
{
referent = ref;
}
@@ -119,7 +119,7 @@ public abstract class Reference
* @param q the reference queue to register on.
* @exception NullPointerException if q is null.
*/
- Reference(Object ref, ReferenceQueue q)
+ Reference(T ref, ReferenceQueue<? super T> q)
{
if (q == null)
throw new NullPointerException();
@@ -132,7 +132,7 @@ public abstract class Reference
* @return the object, this reference refers to, or null if the
* reference was cleared.
*/
- public Object get()
+ public T get()
{
synchronized (lock)
{
@@ -166,11 +166,10 @@ public abstract class Reference
*/
public boolean enqueue()
{
- if (queue != null && nextOnQueue == null)
+ ReferenceQueue q = queue;
+ if (q != null)
{
- queue.enqueue(this);
- queue = null;
- return true;
+ return q.enqueue(this);
}
return false;
}
diff --git a/libjava/classpath/java/lang/ref/ReferenceQueue.java b/libjava/classpath/java/lang/ref/ReferenceQueue.java
index f4729f282be..28162877905 100644
--- a/libjava/classpath/java/lang/ref/ReferenceQueue.java
+++ b/libjava/classpath/java/lang/ref/ReferenceQueue.java
@@ -1,5 +1,5 @@
/* java.lang.ref.ReferenceQueue
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ package java.lang.ref;
* @author Jochen Hoenicke
* @see Reference#enqueue()
*/
-public class ReferenceQueue
+public class ReferenceQueue<T>
{
/**
* This is a linked list of references. If this is null, the list is
@@ -60,7 +60,13 @@ public class ReferenceQueue
* itself (not to null, since <code>nextOnQueue</code> is used to
* determine if a reference is enqueued).
*/
- private Reference first;
+ private Reference<? extends T> first;
+
+ /**
+ * This is the lock that protects our linked list and is used to signal
+ * a thread waiting in remove().
+ */
+ private final Object lock = new Object();
/**
* Creates a new empty reference queue.
@@ -76,7 +82,7 @@ public class ReferenceQueue
* @return a reference on the queue, if there is one,
* <code>null</code> otherwise.
*/
- public synchronized Reference poll()
+ public Reference<? extends T> poll()
{
return dequeue();
}
@@ -84,29 +90,41 @@ public class ReferenceQueue
/**
* This is called by reference to enqueue itself on this queue.
* @param ref the reference that should be enqueued.
+ * @return true if successful, false if not.
*/
- synchronized void enqueue(Reference ref)
- {
- /* last reference will point to itself */
- ref.nextOnQueue = first == null ? ref : first;
- first = ref;
- /* this wakes only one remove thread. */
- notify();
+ final boolean enqueue(Reference<? extends T> ref)
+ {
+ synchronized (lock)
+ {
+ if (ref.queue != this)
+ return false;
+
+ /* last reference will point to itself */
+ ref.nextOnQueue = first == null ? ref : first;
+ ref.queue = null;
+ first = ref;
+ /* this wakes only one remove thread. */
+ lock.notify();
+ return true;
+ }
}
/**
* Remove a reference from the queue, if there is one.
* @return the first element of the queue, or null if there isn't any.
*/
- private Reference dequeue()
+ private Reference<? extends T> dequeue()
{
- if (first == null)
- return null;
-
- Reference result = first;
- first = (first == first.nextOnQueue) ? null : first.nextOnQueue;
- result.nextOnQueue = null;
- return result;
+ synchronized (lock)
+ {
+ if (first == null)
+ return null;
+
+ Reference<? extends T> result = first;
+ first = (first == first.nextOnQueue) ? null : first.nextOnQueue;
+ result.nextOnQueue = null;
+ return result;
+ }
}
/**
@@ -118,12 +136,13 @@ public class ReferenceQueue
* <code>null</code> if timeout period expired.
* @exception InterruptedException if the wait was interrupted.
*/
- public synchronized Reference remove(long timeout)
+ public Reference<? extends T> remove(long timeout)
throws InterruptedException
{
- if (first == null)
+ synchronized (lock)
{
- wait(timeout);
+ if (first == null)
+ lock.wait(timeout);
}
return dequeue();
@@ -137,7 +156,7 @@ public class ReferenceQueue
* @return the reference removed from the queue.
* @exception InterruptedException if the wait was interrupted.
*/
- public Reference remove()
+ public Reference<? extends T> remove()
throws InterruptedException
{
return remove(0L);
diff --git a/libjava/classpath/java/lang/ref/SoftReference.java b/libjava/classpath/java/lang/ref/SoftReference.java
index 97395eacdfa..077dc173ddd 100644
--- a/libjava/classpath/java/lang/ref/SoftReference.java
+++ b/libjava/classpath/java/lang/ref/SoftReference.java
@@ -1,5 +1,5 @@
/* java.lang.ref.SoftReference
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,14 +47,14 @@ package java.lang.ref;
*
* @author Jochen Hoenicke
*/
-public class SoftReference
- extends Reference
+public class SoftReference<T>
+ extends Reference<T>
{
/**
* Create a new soft reference, that is not registered to any queue.
* @param referent the object we refer to.
*/
- public SoftReference(Object referent)
+ public SoftReference(T referent)
{
super(referent);
}
@@ -65,7 +65,7 @@ public class SoftReference
* @param q the reference queue to register on.
* @exception NullPointerException if q is null.
*/
- public SoftReference(Object referent, ReferenceQueue q)
+ public SoftReference(T referent, ReferenceQueue<? super T> q)
{
super(referent, q);
}
@@ -75,7 +75,7 @@ public class SoftReference
* @return the object, this reference refers to, or null if the
* reference was cleared.
*/
- public Object get()
+ public T get()
{
/* Why is this overloaded???
* Maybe for a kind of LRU strategy. */
diff --git a/libjava/classpath/java/lang/ref/WeakReference.java b/libjava/classpath/java/lang/ref/WeakReference.java
index b4018fbb55e..563563bf164 100644
--- a/libjava/classpath/java/lang/ref/WeakReference.java
+++ b/libjava/classpath/java/lang/ref/WeakReference.java
@@ -1,5 +1,5 @@
/* java.lang.ref.WeakReference
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -54,14 +54,14 @@ package java.lang.ref;
* @author Jochen Hoenicke
* @see java.util.WeakHashMap
*/
-public class WeakReference
- extends Reference
+public class WeakReference<T>
+ extends Reference<T>
{
/**
* Create a new weak reference, that is not registered to any queue.
* @param referent the object we refer to.
*/
- public WeakReference(Object referent)
+ public WeakReference(T referent)
{
super(referent);
}
@@ -72,7 +72,7 @@ public class WeakReference
* @param q the reference queue to register on.
* @exception NullPointerException if q is null.
*/
- public WeakReference(Object referent, ReferenceQueue q)
+ public WeakReference(T referent, ReferenceQueue<? super T> q)
{
super(referent, q);
}
diff --git a/libjava/classpath/java/lang/reflect/AccessibleObject.java b/libjava/classpath/java/lang/reflect/AccessibleObject.java
index 8f09eac1b0b..fd46a53dc8c 100644
--- a/libjava/classpath/java/lang/reflect/AccessibleObject.java
+++ b/libjava/classpath/java/lang/reflect/AccessibleObject.java
@@ -160,8 +160,7 @@ public class AccessibleObject
this.flag = flag;
}
- /* FIXME[GENERICS]: <T extends Annotation> T getAnnotation(Class <T>) */
- public Annotation getAnnotation(Class annotationClass)
+ public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
{
throw new AssertionError("Subclass must override this method");
}
@@ -176,8 +175,7 @@ public class AccessibleObject
throw new AssertionError("Subclass must override this method");
}
- /* FIXME[GENERICS]: Signature is Class<? extends Annotation> */
- public boolean isAnnotationPresent(Class annotationClass)
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
{
return getAnnotation(annotationClass) != null;
}
diff --git a/libjava/classpath/java/lang/reflect/AnnotatedElement.java b/libjava/classpath/java/lang/reflect/AnnotatedElement.java
index 69a64a02827..8f2a8b6f5c8 100644
--- a/libjava/classpath/java/lang/reflect/AnnotatedElement.java
+++ b/libjava/classpath/java/lang/reflect/AnnotatedElement.java
@@ -74,8 +74,7 @@ public interface AnnotatedElement
* <code>null</code> if no such annotation exists.
* @throws NullPointerException if the annotation class is <code>null</code>.
*/
- /* FIXME[GENERICS]: <T extends Annotation> T getAnnotation(Class <T>) */
- Annotation getAnnotation(Class annotationClass);
+ <T extends Annotation> T getAnnotation(Class<T> annotationClass);
/**
* Returns all annotations associated with the element. If there are
@@ -111,7 +110,6 @@ public interface AnnotatedElement
* @return true if an annotation exists for the specified type.
* @since 1.5
*/
- /* FIXME[GENERICS]: Signature is Class<? extends Annotation> */
- boolean isAnnotationPresent(Class annotationClass);
+ boolean isAnnotationPresent(Class<? extends Annotation> annotationClass);
}
diff --git a/libjava/classpath/java/lang/reflect/Array.java b/libjava/classpath/java/lang/reflect/Array.java
index ae65ffbf240..373bf204c8e 100644
--- a/libjava/classpath/java/lang/reflect/Array.java
+++ b/libjava/classpath/java/lang/reflect/Array.java
@@ -95,7 +95,7 @@ public final class Array
* @throws NegativeArraySizeException when length is less than 0
* @throws OutOfMemoryError if memory allocation fails
*/
- public static Object newInstance(Class componentType, int length)
+ public static Object newInstance(Class<?> componentType, int length)
{
if (! componentType.isPrimitive())
return VMArray.createObjectArray(componentType, length);
@@ -143,7 +143,7 @@ public final class Array
* than 0
* @throws OutOfMemoryError if memory allocation fails
*/
- public static Object newInstance(Class componentType, int[] dimensions)
+ public static Object newInstance(Class<?> componentType, int[] dimensions)
{
if (dimensions.length <= 0)
throw new IllegalArgumentException ("Empty dimensions array.");
diff --git a/libjava/classpath/java/lang/reflect/GenericDeclaration.java b/libjava/classpath/java/lang/reflect/GenericDeclaration.java
index 14f5ba8326b..244befd8810 100644
--- a/libjava/classpath/java/lang/reflect/GenericDeclaration.java
+++ b/libjava/classpath/java/lang/reflect/GenericDeclaration.java
@@ -58,6 +58,5 @@ public interface GenericDeclaration
* class file does not conform to that specified in the 3rd edition
* of the Java Virtual Machine Specification.
*/
- /* FIXME[GENERICS]: Should be TypeVariable<?>[] */
- TypeVariable[] getTypeParameters();
+ TypeVariable<?>[] getTypeParameters();
}
diff --git a/libjava/classpath/java/lang/reflect/Proxy.java b/libjava/classpath/java/lang/reflect/Proxy.java
index 94aa0bbb2a0..ef743f6bcb0 100644
--- a/libjava/classpath/java/lang/reflect/Proxy.java
+++ b/libjava/classpath/java/lang/reflect/Proxy.java
@@ -156,7 +156,7 @@ import java.util.Set;
* @see Class
* @author Eric Blake (ebb9@email.byu.edu)
* @since 1.3
- * @status updated to 1.4, except for the use of ProtectionDomain
+ * @status updated to 1.5, except for the use of ProtectionDomain
*/
public class Proxy implements Serializable
{
@@ -255,8 +255,8 @@ public class Proxy implements Serializable
*/
// synchronized so that we aren't trying to build the same class
// simultaneously in two threads
- public static synchronized Class getProxyClass(ClassLoader loader,
- Class[] interfaces)
+ public static synchronized Class<?> getProxyClass(ClassLoader loader,
+ Class<?>... interfaces)
{
interfaces = (Class[]) interfaces.clone();
ProxyType pt = new ProxyType(loader, interfaces);
@@ -310,7 +310,7 @@ public class Proxy implements Serializable
* @see Constructor#newInstance(Object[])
*/
public static Object newProxyInstance(ClassLoader loader,
- Class[] interfaces,
+ Class<?>[] interfaces,
InvocationHandler handler)
{
try
@@ -358,7 +358,7 @@ public class Proxy implements Serializable
*/
// This is synchronized on the off chance that another thread is
// trying to add a class to the map at the same time we read it.
- public static synchronized boolean isProxyClass(Class clazz)
+ public static synchronized boolean isProxyClass(Class<?> clazz)
{
if (! Proxy.class.isAssignableFrom(clazz))
return false;
diff --git a/libjava/classpath/java/lang/reflect/TypeVariable.java b/libjava/classpath/java/lang/reflect/TypeVariable.java
index 4ecc20c9d9e..ec6af69db4f 100644
--- a/libjava/classpath/java/lang/reflect/TypeVariable.java
+++ b/libjava/classpath/java/lang/reflect/TypeVariable.java
@@ -58,9 +58,7 @@ package java.lang.reflect;
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.5
*/
-/* FIXME[GENERICS]: Should be TypeVariable<T extends GenericDeclaration> */
-public interface TypeVariable
- extends Type
+public interface TypeVariable<T extends GenericDeclaration> extends Type
{
/**
@@ -86,8 +84,7 @@ public interface TypeVariable
* @return the <code>GenericDeclaration</code> object for this type
* variable.
*/
- /* FIXME[GENERICS]: Should return type T */
- GenericDeclaration getGenericDeclaration();
+ T getGenericDeclaration();
/**
* Returns the name of the type variable, as written in the source
diff --git a/libjava/classpath/java/math/BigDecimal.java b/libjava/classpath/java/math/BigDecimal.java
index bca9b12c28b..28c4d45d3eb 100644
--- a/libjava/classpath/java/math/BigDecimal.java
+++ b/libjava/classpath/java/math/BigDecimal.java
@@ -37,7 +37,7 @@ exception statement from your version. */
package java.math;
-public class BigDecimal extends Number implements Comparable
+public class BigDecimal extends Number implements Comparable<BigDecimal>
{
private BigInteger intVal;
private int scale;
@@ -672,7 +672,38 @@ public class BigDecimal extends Number implements Comparable
{
return divide (val, scale, roundingMode);
}
-
+
+ /**
+ * Returns a BigDecimal whose value is (this / val), with the specified scale
+ * and rounding according to the RoundingMode
+ * @param val the divisor
+ * @param scale the scale of the BigDecimal returned
+ * @param roundingMode the rounding mode to use
+ * @return a BigDecimal whose value is approximately (this / val)
+ * @throws ArithmeticException if divisor is zero or the rounding mode is
+ * UNNECESSARY but the specified scale cannot represent the value exactly
+ * @since 1.5
+ */
+ public BigDecimal divide(BigDecimal val,
+ int scale, RoundingMode roundingMode)
+ {
+ return divide (val, scale, roundingMode.ordinal());
+ }
+
+ /**
+ * Returns a BigDecimal whose value is (this / val) rounded according to the
+ * RoundingMode
+ * @param val the divisor
+ * @param roundingMode the rounding mode to use
+ * @return a BigDecimal whose value is approximately (this / val)
+ * @throws ArithmeticException if divisor is zero or the rounding mode is
+ * UNNECESSARY but the specified scale cannot represent the value exactly
+ */
+ public BigDecimal divide (BigDecimal val, RoundingMode roundingMode)
+ {
+ return divide (val, scale, roundingMode.ordinal());
+ }
+
public BigDecimal divide(BigDecimal val, int newScale, int roundingMode)
throws ArithmeticException, IllegalArgumentException
{
@@ -823,12 +854,7 @@ public class BigDecimal extends Number implements Comparable
return this;
}
- public int compareTo (Object obj)
- {
- return compareTo((BigDecimal) obj);
- }
-
- public int compareTo (BigDecimal val)
+ public int compareTo (BigDecimal val)
{
if (scale == val.scale)
return intVal.compareTo (val.intVal);
@@ -973,7 +999,7 @@ public class BigDecimal extends Number implements Comparable
{
return round(mc);
}
-
+
/**
* Returns a BigDecimal which is this BigDecimal rounded according to the
* MathContext rounding settings.
@@ -993,12 +1019,12 @@ public class BigDecimal extends Number implements Comparable
// Make a new BigDecimal which is the correct power of 10 to chop off
// the required number of digits and then call divide.
BigDecimal div = new BigDecimal(BigInteger.TEN.pow(numToChop));
- BigDecimal rounded = divide(div, scale, 4);
+ BigDecimal rounded = divide(div, scale, mc.getRoundingMode().ordinal());
rounded.scale -= numToChop;
rounded.precision = mcPrecision;
return rounded;
}
-
+
/**
* Returns the precision of this BigDecimal (the number of digits in the
* unscaled value). The precision of a zero value is 1.
@@ -1350,7 +1376,24 @@ public class BigDecimal extends Number implements Comparable
if( scale < 0 ) throw new ArithmeticException("Scale parameter < 0.");
return divide (ONE, scale, roundingMode);
}
-
+
+ /**
+ * Returns a BigDecimal whose value is the same as this BigDecimal but whose
+ * representation has a scale of <code>newScale</code>. If the scale is
+ * reduced then rounding may occur, according to the RoundingMode.
+ * @param newScale
+ * @param roundingMode
+ * @return a BigDecimal whose scale is as given, whose value is
+ * <code>this</code> with possible rounding
+ * @throws ArithmeticException if the rounding mode is UNNECESSARY but
+ * rounding is required
+ * @since 1.5
+ */
+ public BigDecimal setScale(int newScale, RoundingMode roundingMode)
+ {
+ return setScale(newScale, roundingMode.ordinal());
+ }
+
/**
* Returns a new BigDecimal constructed from the BigDecimal(String)
* constructor using the Double.toString(double) method to obtain
diff --git a/libjava/classpath/java/math/BigInteger.java b/libjava/classpath/java/math/BigInteger.java
index b57cf607e34..c897d8bf48d 100644
--- a/libjava/classpath/java/math/BigInteger.java
+++ b/libjava/classpath/java/math/BigInteger.java
@@ -1,5 +1,5 @@
/* java.math.BigInteger -- Arbitary precision integers
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,7 +57,7 @@ import java.util.Random;
* @date December 20, 1999.
* @status believed complete and correct.
*/
-public class BigInteger extends Number implements Comparable
+public class BigInteger extends Number implements Comparable<BigInteger>
{
/** All integers are stored in 2's-complement form.
* If words == null, the ival is the value of this BigInteger.
@@ -83,7 +83,8 @@ public class BigInteger extends Number implements Comparable
private static final int numFixNum = maxFixNum-minFixNum+1;
private static final BigInteger[] smallFixNums = new BigInteger[numFixNum];
- static {
+ static
+ {
for (int i = numFixNum; --i >= 0; )
smallFixNums[i] = new BigInteger(i + minFixNum);
}
@@ -92,14 +93,14 @@ public class BigInteger extends Number implements Comparable
* The constant zero as a BigInteger.
* @since 1.2
*/
- public static final BigInteger ZERO = smallFixNums[-minFixNum];
+ public static final BigInteger ZERO = smallFixNums[0 - minFixNum];
/**
* The constant one as a BigInteger.
* @since 1.2
*/
public static final BigInteger ONE = smallFixNums[1 - minFixNum];
-
+
/**
* The constant ten as a BigInteger.
* @since 1.5
@@ -197,8 +198,20 @@ public class BigInteger extends Number implements Comparable
private void init(int numBits, Random rnd)
{
int highbits = numBits & 31;
+ // minimum number of bytes to store the above number of bits
+ int highBitByteCount = (highbits + 7) / 8;
+ // number of bits to discard from the last byte
+ int discardedBitCount = highbits % 8;
+ if (discardedBitCount != 0)
+ discardedBitCount = 8 - discardedBitCount;
+ byte[] highBitBytes = new byte[highBitByteCount];
if (highbits > 0)
- highbits = rnd.nextInt() >>> (32 - highbits);
+ {
+ rnd.nextBytes(highBitBytes);
+ highbits = (highBitBytes[highBitByteCount - 1] & 0xFF) >>> discardedBitCount;
+ for (int i = highBitByteCount - 2; i >= 0; i--)
+ highbits = (highbits << 8) | (highBitBytes[i] & 0xFF);
+ }
int nwords = numBits / 32;
while (highbits == 0 && nwords > 0)
@@ -225,8 +238,13 @@ public class BigInteger extends Number implements Comparable
this(bitLength, rnd);
// Keep going until we find a probable prime.
+ BigInteger result;
while (true)
{
+ // ...but first ensure that BI has bitLength bits
+ result = setBit(bitLength - 1);
+ this.ival = result.ival;
+ this.words = result.words;
if (isProbablePrime(certainty))
return;
@@ -377,14 +395,7 @@ public class BigInteger extends Number implements Comparable
return MPN.cmp(x.words, y.words, x_len);
}
- // JDK1.2
- public int compareTo(Object obj)
- {
- if (obj instanceof BigInteger)
- return compareTo(this, (BigInteger) obj);
- throw new ClassCastException();
- }
-
+ /** @since 1.2 */
public int compareTo(BigInteger val)
{
return compareTo(this, val);
@@ -1589,24 +1600,31 @@ public class BigInteger extends Number implements Comparable
// but slightly more expensive, for little practical gain.
if (len <= 15 && radix <= 16)
return valueOf(Long.parseLong(s, radix));
-
+
+ int i, digit;
+ boolean negative;
+ byte[] bytes;
+ char ch = s.charAt(0);
+ if (ch == '-')
+ {
+ negative = true;
+ i = 1;
+ bytes = new byte[len - 1];
+ }
+ else
+ {
+ negative = false;
+ i = 0;
+ bytes = new byte[len];
+ }
int byte_len = 0;
- byte[] bytes = new byte[len];
- boolean negative = false;
- for (int i = 0; i < len; i++)
+ for ( ; i < len; i++)
{
- char ch = s.charAt(i);
- if (ch == '-')
- negative = true;
- else if (ch == '_' || (byte_len == 0 && (ch == ' ' || ch == '\t')))
- continue;
- else
- {
- int digit = Character.digit(ch, radix);
- if (digit < 0)
- break;
- bytes[byte_len++] = (byte) digit;
- }
+ ch = s.charAt(i);
+ digit = Character.digit(ch, radix);
+ if (digit < 0)
+ throw new NumberFormatException();
+ bytes[byte_len++] = (byte) digit;
}
return valueOf(bytes, byte_len, negative, radix);
}
diff --git a/libjava/classpath/java/math/MathContext.java b/libjava/classpath/java/math/MathContext.java
index 417d9c2e270..533ab13acf3 100644
--- a/libjava/classpath/java/math/MathContext.java
+++ b/libjava/classpath/java/math/MathContext.java
@@ -48,6 +48,30 @@ import java.io.Serializable;
*/
public final class MathContext implements Serializable
{
+ /** A MathContext for unlimited precision arithmetic * */
+ public static final MathContext UNLIMITED =
+ new MathContext(0, RoundingMode.HALF_UP);
+
+ /**
+ * A MathContext for the IEEE 754R Decimal32 format - 7 digit preicision and
+ * HALF_EVEN rounding.
+ */
+ public static final MathContext DECIMAL32 =
+ new MathContext(7, RoundingMode.HALF_EVEN);
+
+ /**
+ * A MathContext for the IEEE 754R Decimal64 format - 16 digit preicision and
+ * HALF_EVEN rounding.
+ */
+ public static final MathContext DECIMAL64 =
+ new MathContext(16, RoundingMode.HALF_EVEN);
+
+ /**
+ * A MathContext for the IEEE 754R Decimal128 format - 34 digit preicision and
+ * HALF_EVEN rounding.
+ */
+ public static final MathContext DECIMAL128 =
+ new MathContext(34, RoundingMode.HALF_EVEN);
/**
* This is the serialVersionUID reported here:
@@ -56,7 +80,9 @@ public final class MathContext implements Serializable
private static final long serialVersionUID = 5579720004786848255L;
private int precision;
-
+
+ private RoundingMode roundMode;
+
/**
* Constructs a new MathContext with the specified precision and with HALF_UP
* rounding.
@@ -66,11 +92,25 @@ public final class MathContext implements Serializable
*/
public MathContext(int setPrecision)
{
+ this(setPrecision, RoundingMode.HALF_UP);
+ }
+
+ /**
+ * Constructs a new MathContext with the specified precision and rounding
+ * mode.
+ * @param setPrecision the precision
+ * @param setRoundingMode the rounding mode
+ *
+ * @throws IllegalArgumentException if precision is < 0.
+ */
+ public MathContext(int setPrecision, RoundingMode setRoundingMode)
+ {
if (setPrecision < 0)
throw new IllegalArgumentException("Precision cannot be less than zero.");
precision = setPrecision;
+ roundMode = setRoundingMode;
}
-
+
/**
* Constructs a MathContext from a String that has the same form as one
* produced by the toString() method.
@@ -85,6 +125,7 @@ public final class MathContext implements Serializable
{
int roundingModeIndex = val.indexOf("roundingMode", 10);
precision = Integer.parseInt(val.substring(10, roundingModeIndex - 1));
+ roundMode = RoundingMode.valueOf(val.substring(roundingModeIndex + 13));
}
catch (NumberFormatException nfe)
{
@@ -109,7 +150,8 @@ public final class MathContext implements Serializable
if (!(x instanceof MathContext))
return false;
MathContext mc = (MathContext)x;
- return mc.precision == this.precision;
+ return mc.precision == this.precision
+ && mc.roundMode.equals(this.roundMode);
}
/**
@@ -122,6 +164,18 @@ public final class MathContext implements Serializable
}
/**
+ * Returns the rounding mode setting. This will be one of
+ * RoundingMode.CEILING, RoundingMode.DOWN, RoundingMode.FLOOR,
+ * RoundingMode.HALF_DOWN, RoundingMode.HALF_EVEN, RoundingMode.HALF_UP,
+ * RoundingMode.UNNECESSARY, or RoundingMode.UP.
+ * @return the rounding mode setting.
+ */
+ public RoundingMode getRoundingMode()
+ {
+ return roundMode;
+ }
+
+ /**
* Returns "precision=p roundingMode=MODE" where p is an int giving the
* precision and MODE is UP, DOWN, HALF_UP, HALF_DOWN, HALF_EVEN, CEILING,
* FLOOR, or UNNECESSARY corresponding to rounding modes.
@@ -130,7 +184,7 @@ public final class MathContext implements Serializable
*/
public String toString()
{
- return "precision="+precision;
+ return "precision="+precision+" roundingMode="+roundMode;
}
/**
@@ -139,6 +193,6 @@ public final class MathContext implements Serializable
*/
public int hashCode()
{
- return precision;
+ return precision ^ roundMode.hashCode();
}
}
diff --git a/libjava/classpath/java/math/RoundingMode.java b/libjava/classpath/java/math/RoundingMode.java
new file mode 100644
index 00000000000..c85bf4ff533
--- /dev/null
+++ b/libjava/classpath/java/math/RoundingMode.java
@@ -0,0 +1,89 @@
+/* RoundingMode.java -- An Enum to replace BigDecimal rounding constants.
+ Copyright (C) 1999, 2000, 2002, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.math;
+
+/**
+ * An enum to specify rounding behaviour for numerical operations that may
+ * discard precision.
+ * @author Anthony Balkissoon abalkiss at redhat dot com
+ *
+ */
+public enum RoundingMode
+{
+ UP, DOWN, CEILING, FLOOR, HALF_UP, HALF_DOWN, HALF_EVEN, UNNECESSARY;
+
+ /**
+ * For compatability with Sun's JDK
+ */
+ private static final long serialVersionUID = 432302042773881265L;
+
+ /**
+ * Returns the RoundingMode object corresponding to the legacy rounding modes
+ * in BigDecimal.
+ * @param rm the legacy rounding mode
+ * @return the corresponding RoundingMode
+ */
+ public static RoundingMode valueOf(int rm)
+ {
+ switch (rm)
+ {
+ case BigDecimal.ROUND_CEILING:
+ return CEILING;
+ case BigDecimal.ROUND_FLOOR:
+ return FLOOR;
+ case BigDecimal.ROUND_DOWN:
+ return DOWN;
+ case BigDecimal.ROUND_UP:
+ return UP;
+ case BigDecimal.ROUND_HALF_UP:
+ return HALF_UP;
+ case BigDecimal.ROUND_HALF_DOWN:
+ return HALF_DOWN;
+ case BigDecimal.ROUND_HALF_EVEN:
+ return HALF_EVEN;
+ case BigDecimal.ROUND_UNNECESSARY:
+ return UNNECESSARY;
+ default:
+ throw new
+ IllegalArgumentException("invalid argument: " + rm +
+ ". Argument should be one of the " +
+ "rounding modes defined in BigDecimal.");
+ }
+ }
+}
diff --git a/libjava/classpath/java/math/class-dependencies.conf b/libjava/classpath/java/math/class-dependencies.conf
new file mode 100644
index 00000000000..4fbf75eb1ce
--- /dev/null
+++ b/libjava/classpath/java/math/class-dependencies.conf
@@ -0,0 +1,58 @@
+# This property file contains dependencies of classes, methods, and
+# field on other methods or classes.
+#
+# Syntax:
+#
+# <used>: <needed 1> [... <needed N>]
+#
+# means that when <used> is included, <needed 1> (... <needed N>) must
+# be included as well.
+#
+# <needed X> and <used> are of the form
+#
+# <class.methodOrField(signature)>
+#
+# or just
+#
+# <class>
+#
+# Within dependencies, variables can be used. A variable is defined as
+# follows:
+#
+# {variable}: value1 value2 ... value<n>
+#
+# variables can be used on the right side of dependencies as follows:
+#
+# <used>: com.bla.blu.{variable}.Class.m()V
+#
+# The use of the variable will expand to <n> dependencies of the form
+#
+# <used>: com.bla.blu.value1.Class.m()V
+# <used>: com.bla.blu.value2.Class.m()V
+# ...
+# <used>: com.bla.blu.value<n>.Class.m()V
+#
+# Variables can be redefined when building a system to select the
+# required support for features like encodings, protocols, etc.
+#
+# Hints:
+#
+# - For methods and fields, the signature is mandatory. For
+# specification, please see the Java Virtual Machine Specification by
+# SUN. Unlike in the spec, field signatures (types) are in brackets.
+#
+# - Package names must be separated by '/' (and not '.'). E.g.,
+# java/lang/Class (this is necessary, because the '.' is used to
+# separate method or field names from classes)
+#
+# - In case <needed> refers to a class, only the class itself will be
+# included in the resulting binary, NOT necessarily all its methods
+# and fields. If you want to refer to all methods and fields, you can
+# write class.* as an abbreviation.
+#
+# - Abbreviations for packages are also possible: my/package/* means all
+# methods and fields of all classes in my/package.
+#
+# - A line with a trailing '\' continues in the next line.
+
+# end of file
diff --git a/libjava/classpath/java/net/DatagramSocket.java b/libjava/classpath/java/net/DatagramSocket.java
index d8837c006b5..d7aad7222c7 100644
--- a/libjava/classpath/java/net/DatagramSocket.java
+++ b/libjava/classpath/java/net/DatagramSocket.java
@@ -1,5 +1,5 @@
/* DatagramSocket.java -- A class to model UDP sockets
- Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005
+ Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -180,7 +180,18 @@ public class DatagramSocket
if (factory != null)
impl = factory.createDatagramSocketImpl();
else
- impl = new PlainDatagramSocketImpl();
+ {
+ try
+ {
+ impl = new PlainDatagramSocketImpl();
+ }
+ catch (IOException ioe)
+ {
+ SocketException se = new SocketException();
+ se.initCause(ioe);
+ throw se;
+ }
+ }
}
else
try
@@ -194,7 +205,16 @@ public class DatagramSocket
{
System.err.println("Could not instantiate class: java.net."
+ propVal + "DatagramSocketImpl");
- impl = new PlainDatagramSocketImpl();
+ try
+ {
+ impl = new PlainDatagramSocketImpl();
+ }
+ catch (IOException ioe)
+ {
+ SocketException se = new SocketException();
+ se.initCause(ioe);
+ throw se;
+ }
}
if (address != null)
@@ -305,7 +325,7 @@ public class DatagramSocket
SecurityManager s = System.getSecurityManager();
if (s != null)
- s.checkConnect(localAddr.getHostName(), -1);
+ s.checkConnect(localAddr.getHostAddress(), -1);
}
catch (SecurityException e)
{
@@ -505,7 +525,7 @@ public class DatagramSocket
SecurityManager sm = System.getSecurityManager();
if (sm != null)
- sm.checkConnect(address.getHostName(), port);
+ sm.checkConnect(address.getHostAddress(), port);
try
{
@@ -578,11 +598,17 @@ public class DatagramSocket
&& ! ((DatagramChannelImpl) getChannel()).isInChannelOperation())
throw new IllegalBlockingModeException();
- getImpl().receive(p);
+ DatagramPacket p2 = new DatagramPacket(p.getData(), p.getOffset(), p.maxlen);
+ getImpl().receive(p2);
+ p.length = p2.length;
+ if (p2.getAddress() != null)
+ p.setAddress(p2.getAddress());
+ if (p2.getPort() != -1)
+ p.setPort(p2.getPort());
SecurityManager s = System.getSecurityManager();
if (s != null && isConnected())
- s.checkAccept(p.getAddress().getHostName(), p.getPort());
+ s.checkAccept(p.getAddress().getHostAddress(), p.getPort());
}
/**
@@ -649,6 +675,9 @@ public class DatagramSocket
{
if (isClosed())
throw new SocketException("socket is closed");
+
+ if (address == null)
+ address = new InetSocketAddress(InetAddress.ANY_IF, 0);
if (! (address instanceof InetSocketAddress))
throw new IllegalArgumentException("unsupported address type");
diff --git a/libjava/classpath/java/net/Inet6Address.java b/libjava/classpath/java/net/Inet6Address.java
index ef3c4431acb..f4893eb09f3 100644
--- a/libjava/classpath/java/net/Inet6Address.java
+++ b/libjava/classpath/java/net/Inet6Address.java
@@ -121,7 +121,7 @@ public final class Inet6Address extends InetAddress
*/
public boolean isMulticastAddress()
{
- return ipaddress[0] == 0xFF;
+ return ipaddress[0] == (byte) 0xFF;
}
/**
diff --git a/libjava/classpath/java/net/InetAddress.java b/libjava/classpath/java/net/InetAddress.java
index f6f97285fe6..1f266798045 100644
--- a/libjava/classpath/java/net/InetAddress.java
+++ b/libjava/classpath/java/net/InetAddress.java
@@ -59,7 +59,7 @@ import java.io.Serializable;
* @author Per Bothner
* @author Gary Benson (gbenson@redhat.com)
*
- * @specnote This class is not final since JK 1.4
+ * @specnote This class is not final since JDK 1.4
*/
public class InetAddress implements Serializable
{
@@ -87,7 +87,7 @@ public class InetAddress implements Serializable
}
catch (UnknownHostException e)
{
- throw new RuntimeException("should never happen", e);
+ throw (InternalError) new InternalError().initCause(e);
}
ANY_IF.hostName = ANY_IF.getHostName();
}
@@ -104,7 +104,7 @@ public class InetAddress implements Serializable
}
catch (UnknownHostException e)
{
- throw new RuntimeException("should never happen", e);
+ throw (InternalError) new InternalError().initCause(e);
}
}
@@ -522,7 +522,7 @@ public class InetAddress implements Serializable
}
catch (UnknownHostException e)
{
- throw new RuntimeException("should never happen", e);
+ throw (InternalError) new InternalError().initCause(e);
}
}
diff --git a/libjava/classpath/java/net/MulticastSocket.java b/libjava/classpath/java/net/MulticastSocket.java
index 03bdf1e77d9..2841192db61 100644
--- a/libjava/classpath/java/net/MulticastSocket.java
+++ b/libjava/classpath/java/net/MulticastSocket.java
@@ -202,13 +202,41 @@ public class MulticastSocket extends DatagramSocket
{
if (isClosed())
throw new SocketException("socket is closed");
-
- Enumeration e = netIf.getInetAddresses();
-
- if (! e.hasMoreElements())
- throw new SocketException("no network devices found");
-
- InetAddress address = (InetAddress) e.nextElement();
+
+ InetAddress address;
+ if (netIf != null)
+ out:
+ {
+ Enumeration e = netIf.getInetAddresses();
+ if (getLocalAddress() instanceof Inet4Address)
+ {
+ // Search for a IPv4 address.
+ while (e.hasMoreElements())
+ {
+ address = (InetAddress) e.nextElement();
+ if (address instanceof Inet4Address)
+ break out;
+ }
+ throw new SocketException("interface " + netIf.getName() + " has no IPv6 address");
+ }
+ else if (getLocalAddress() instanceof Inet6Address)
+ {
+ // Search for a IPv6 address.
+ while (e.hasMoreElements())
+ {
+ address = (InetAddress) e.nextElement();
+ if (address instanceof Inet6Address)
+ break out;
+ }
+ throw new SocketException("interface " + netIf.getName() + " has no IPv6 address");
+ }
+ else
+ throw new SocketException("interface " + netIf.getName() + " has no suitable IP address");
+ }
+ else
+ address = InetAddress.ANY_IF;
+
+
getImpl().setOption(SocketOptions.IP_MULTICAST_IF, address);
}
@@ -230,6 +258,10 @@ public class MulticastSocket extends DatagramSocket
InetAddress address =
(InetAddress) getImpl().getOption(SocketOptions.IP_MULTICAST_IF);
+
+ if (address.isAnyLocalAddress())
+ return NetworkInterface.createAnyInterface();
+
NetworkInterface netIf = NetworkInterface.getByInetAddress(address);
return netIf;
diff --git a/libjava/classpath/java/net/NetworkInterface.java b/libjava/classpath/java/net/NetworkInterface.java
index 47b1c67cae7..6c78ead5b4c 100644
--- a/libjava/classpath/java/net/NetworkInterface.java
+++ b/libjava/classpath/java/net/NetworkInterface.java
@@ -1,5 +1,5 @@
/* NetworkInterface.java --
- Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,8 @@ exception statement from your version. */
package java.net;
+import gnu.classpath.SystemProperties;
+
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
@@ -58,25 +60,23 @@ import java.util.Vector;
*/
public final class NetworkInterface
{
- private String name;
- private Vector inetAddresses;
-
- NetworkInterface(String name, InetAddress address)
- {
- this.name = name;
- this.inetAddresses = new Vector(1, 1);
- this.inetAddresses.add(address);
- }
-
- NetworkInterface(String name, InetAddress[] addresses)
+ private final VMNetworkInterface netif;
+
+ private NetworkInterface(VMNetworkInterface netif)
+ {
+ this.netif = netif;
+ }
+
+ /** Creates an NetworkInterface instance which
+ * represents any interface in the system. Its only
+ * address is <code>0.0.0.0/0.0.0.0</code>. This
+ * method is needed by {@link MulticastSocket#getNetworkInterface}
+ */
+ static NetworkInterface createAnyInterface()
{
- this.name = name;
- this.inetAddresses = new Vector(addresses.length, 1);
-
- for (int i = 0; i < addresses.length; i++)
- this.inetAddresses.add(addresses[i]);
+ return new NetworkInterface(new VMNetworkInterface());
}
-
+
/**
* Returns the name of the network interface
*
@@ -84,7 +84,7 @@ public final class NetworkInterface
*/
public String getName()
{
- return name;
+ return netif.name;
}
/**
@@ -97,22 +97,23 @@ public final class NetworkInterface
*
* @return An enumeration of all addresses.
*/
- public Enumeration getInetAddresses()
+ public Enumeration<InetAddress> getInetAddresses()
{
SecurityManager s = System.getSecurityManager();
+ Vector inetAddresses = new Vector(netif.addresses);
if (s == null)
return inetAddresses.elements();
- Vector tmpInetAddresses = new Vector(1, 1);
+ Vector<InetAddress> tmpInetAddresses = new Vector<InetAddress>(1, 1);
- for (Enumeration addresses = inetAddresses.elements();
+ for (Enumeration<InetAddress> addresses = inetAddresses.elements();
addresses.hasMoreElements();)
{
- InetAddress addr = (InetAddress) addresses.nextElement();
+ InetAddress addr = addresses.nextElement();
try
{
- s.checkConnect(addr.getHostAddress(), 58000);
+ s.checkConnect(addr.getHostAddress(), -1);
tmpInetAddresses.add(addr);
}
catch (SecurityException e)
@@ -131,7 +132,7 @@ public final class NetworkInterface
*/
public String getDisplayName()
{
- return name;
+ return netif.name;
}
/**
@@ -148,15 +149,14 @@ public final class NetworkInterface
public static NetworkInterface getByName(String name)
throws SocketException
{
- for (Enumeration e = getNetworkInterfaces(); e.hasMoreElements();)
+ if (name == null)
+ throw new NullPointerException();
+ VMNetworkInterface[] netifs = VMNetworkInterface.getVMInterfaces();
+ for (int i = 0; i < netifs.length; i++)
{
- NetworkInterface tmp = (NetworkInterface) e.nextElement();
-
- if (name.equals(tmp.getName()))
- return tmp;
+ if (netifs[i].name.equals(name))
+ return new NetworkInterface(netifs[i]);
}
-
- // No interface with the given name found.
return null;
}
@@ -173,55 +173,15 @@ public final class NetworkInterface
public static NetworkInterface getByInetAddress(InetAddress addr)
throws SocketException
{
- for (Enumeration interfaces = getNetworkInterfaces();
- interfaces.hasMoreElements();)
+ if (addr == null)
+ throw new NullPointerException();
+ VMNetworkInterface[] netifs = VMNetworkInterface.getVMInterfaces();
+ for (int i = 0; i < netifs.length; i++)
{
- NetworkInterface tmp = (NetworkInterface) interfaces.nextElement();
-
- for (Enumeration addresses = tmp.inetAddresses.elements();
- addresses.hasMoreElements();)
- {
- if (addr.equals((InetAddress) addresses.nextElement()))
- return tmp;
- }
+ if (netifs[i].addresses.contains(addr))
+ return new NetworkInterface(netifs[i]);
}
-
- throw new SocketException("no network interface is bound to such an IP address");
- }
-
- static private Collection condense(Collection interfaces)
- {
- final Map condensed = new HashMap();
-
- final Iterator interfs = interfaces.iterator();
- while (interfs.hasNext()) {
-
- final NetworkInterface face = (NetworkInterface) interfs.next();
- final String name = face.getName();
-
- if (condensed.containsKey(name))
- {
- final NetworkInterface conface = (NetworkInterface) condensed.get(name);
- if (!conface.inetAddresses.containsAll(face.inetAddresses))
- {
- final Iterator faceAddresses = face.inetAddresses.iterator();
- while (faceAddresses.hasNext())
- {
- final InetAddress faceAddress = (InetAddress) faceAddresses.next();
- if (!conface.inetAddresses.contains(faceAddress))
- {
- conface.inetAddresses.add(faceAddress);
- }
- }
- }
- }
- else
- {
- condensed.put(name, face);
- }
- }
-
- return condensed.values();
+ return null;
}
/**
@@ -231,16 +191,18 @@ public final class NetworkInterface
*
* @exception SocketException If an error occurs
*/
- public static Enumeration getNetworkInterfaces() throws SocketException
+ public static Enumeration<NetworkInterface> getNetworkInterfaces()
+ throws SocketException
{
- Vector networkInterfaces = VMNetworkInterface.getInterfaces();
-
- if (networkInterfaces.isEmpty())
- return null;
-
- Collection condensed = condense(networkInterfaces);
-
- return Collections.enumeration(condensed);
+ VMNetworkInterface[] netifs = VMNetworkInterface.getVMInterfaces();
+ Vector<NetworkInterface> networkInterfaces =
+ new Vector<NetworkInterface>(netifs.length);
+ for (int i = 0; i < netifs.length; i++)
+ {
+ if (!netifs[i].addresses.isEmpty())
+ networkInterfaces.add(new NetworkInterface(netifs[i]));
+ }
+ return networkInterfaces.elements();
}
/**
@@ -256,8 +218,12 @@ public final class NetworkInterface
return false;
NetworkInterface tmp = (NetworkInterface) obj;
+
+ if (netif.name == null)
+ return tmp.netif.name == null;
- return (name.equals(tmp.name) && inetAddresses.equals(tmp.inetAddresses));
+ return (netif.name.equals(tmp.netif.name)
+ && (netif.addresses.equals(tmp.netif.addresses)));
}
/**
@@ -268,7 +234,12 @@ public final class NetworkInterface
public int hashCode()
{
// FIXME: hash correctly
- return name.hashCode() + inetAddresses.hashCode();
+ int hc = netif.addresses.hashCode();
+
+ if (netif.name != null)
+ hc += netif.name.hashCode();
+
+ return hc;
}
/**
@@ -279,19 +250,22 @@ public final class NetworkInterface
public String toString()
{
// FIXME: check if this is correct
- String result;
- String separator = System.getProperty("line.separator");
+ StringBuffer result;
+ String separator = SystemProperties.getProperty("line.separator");
- result =
- "name: " + getDisplayName() + " (" + getName() + ") addresses:"
- + separator;
+ result = new StringBuffer();
+
+ result.append("name: ");
+ result.append(getDisplayName());
+ result.append(" (").append(getName()).append(") addresses:");
+ result.append(separator);
- for (Enumeration e = inetAddresses.elements(); e.hasMoreElements();)
+ for (Iterator it = netif.addresses.iterator(); it.hasNext(); )
{
- InetAddress address = (InetAddress) e.nextElement();
- result += address.toString() + ";" + separator;
+ InetAddress address = (InetAddress) it.next();
+ result.append(address.toString()).append(";").append(separator);
}
- return result;
+ return result.toString();
}
}
diff --git a/libjava/classpath/java/net/Proxy.java b/libjava/classpath/java/net/Proxy.java
new file mode 100644
index 00000000000..7b4ef299206
--- /dev/null
+++ b/libjava/classpath/java/net/Proxy.java
@@ -0,0 +1,137 @@
+/* Proxy.java -- Represends a proxy for a network connection
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.net;
+
+
+/**
+ * Defines a proxy setting. This setting contains a type (https, socks,
+ * direct) and a socket address.
+ *
+ * @since 1.5
+ */
+public class Proxy
+{
+ /**
+ * Represents the proxy type.
+ */
+ public enum Type
+ {
+ DIRECT, HTTP, SOCKS;
+
+ /**
+ * For compatability with Sun's JDK
+ */
+ private static final long serialVersionUID = -2231209257930100533L;
+ };
+
+ public static final Proxy NO_PROXY = new Proxy(Type.DIRECT, null);
+
+ private Type type;
+ private SocketAddress address;
+
+ /**
+ * Creates a new <code>Proxy</code> object.
+ *
+ * @param type The type for this proxy
+ * @param address The address of this proxy
+ */
+ public Proxy(Type type, SocketAddress address)
+ {
+ this.type = type;
+ this.address = address;
+ }
+
+ /**
+ * Returns the socket address for this proxy object.
+ *
+ * @return the socket address
+ */
+ public SocketAddress address()
+ {
+ return address;
+ }
+
+ /**
+ * Returns the of this proxy instance.
+ *
+ * @return the type
+ *
+ * @see Type
+ */
+ public Type type()
+ {
+ return type;
+ }
+
+ /**
+ * Compares the given object with this object.
+ *
+ * @return <code>true</code> if both objects or equals,
+ * <code>false</code> otherwise.
+ */
+ public final boolean equals(Object obj)
+ {
+ if (! (obj instanceof Proxy))
+ return false;
+
+ Proxy tmp = (Proxy) obj;
+
+ return (type.equals(tmp.type)
+ && address.equals(tmp.address));
+ }
+
+ /**
+ * Returns the hashcode for this <code>Proxy</code> object.
+ *
+ * @return the hashcode
+ */
+ public final int hashCode()
+ {
+ return type.hashCode() ^ address.hashCode();
+ }
+
+ /**
+ * Returns a string representation of this <code>Proxy</code> object.
+ *
+ * @return the string
+ */
+ public String toString()
+ {
+ return type.toString() + ":" + address.toString();
+ }
+}
diff --git a/libjava/classpath/java/net/ProxySelector.java b/libjava/classpath/java/net/ProxySelector.java
new file mode 100644
index 00000000000..78592a24441
--- /dev/null
+++ b/libjava/classpath/java/net/ProxySelector.java
@@ -0,0 +1,117 @@
+/* ProxySelector.java -- A proxy selector class
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.net;
+
+import gnu.java.net.DefaultProxySelector;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Class for handling proxies for different connections.
+ *
+ * @since 1.5
+ */
+public abstract class ProxySelector
+{
+ /**
+ * Default proxy selector.
+ */
+ private static ProxySelector defaultSelector = new DefaultProxySelector();
+
+ /**
+ * Creates a new <code>ProxySelector</code> object.
+ */
+ public ProxySelector()
+ {
+ // Do nothing here.
+ }
+
+ /**
+ * Returns the default proxy selector.
+ *
+ * @return the default proxy selector
+ *
+ * @throws SecurityException If a security manager is installed and it
+ * denies NetPermission("getProxySelector")
+ */
+ public static ProxySelector getDefault()
+ {
+ SecurityManager sm = System.getSecurityManager();
+
+ if (sm != null)
+ sm.checkPermission(new NetPermission("getProxySelector"));
+
+ return defaultSelector;
+ }
+
+ /**
+ * Sets the default proxy selector.
+ *
+ * @param selector the defualt proxy selector
+ *
+ * @throws SecurityException If a security manager is installed and it
+ * denies NetPermission("setProxySelector")
+ */
+ public static void setDefault(ProxySelector selector)
+ {
+ SecurityManager sm = System.getSecurityManager();
+
+ if (sm != null)
+ sm.checkPermission(new NetPermission("setProxySelector"));
+
+ defaultSelector = selector;
+ }
+
+ /**
+ * Signals to the selector that a proxy was no available.
+ *
+ * @throws IllegalArgumentException If one argument is null
+ */
+ public abstract void connectFailed(URI uri, SocketAddress address,
+ IOException exception);
+
+ /**
+ * Returns the list of proxy settings for a given URI.
+ *
+ * @return list of proxy settings
+ *
+ * @throws IllegalArgumentException If uri is null
+ */
+ public abstract List<Proxy> select(URI uri);
+}
diff --git a/libjava/classpath/java/net/ServerSocket.java b/libjava/classpath/java/net/ServerSocket.java
index 2b889531a7c..d5f2a176b81 100644
--- a/libjava/classpath/java/net/ServerSocket.java
+++ b/libjava/classpath/java/net/ServerSocket.java
@@ -79,6 +79,7 @@ public class ServerSocket
* We need to retain the local address even after the socket is closed.
*/
private InetSocketAddress local;
+ private int port;
/*
* This constructor is only used by java.nio.
@@ -93,6 +94,7 @@ public class ServerSocket
this.impl = impl;
this.impl.create(true);
+ setReuseAddress(true);
}
/*
@@ -219,43 +221,53 @@ public class ServerSocket
if (isClosed())
throw new SocketException("ServerSocket is closed");
- if (! (endpoint instanceof InetSocketAddress))
- throw new IllegalArgumentException("Address type not supported");
+ if (isBound())
+ throw new SocketException("Already bound");
- InetSocketAddress tmp = (InetSocketAddress) endpoint;
+ InetAddress addr;
+ int port;
+
+ if (endpoint == null)
+ {
+ addr = InetAddress.ANY_IF;
+ port = 0;
+ }
+ else if (! (endpoint instanceof InetSocketAddress))
+ {
+ throw new IllegalArgumentException("Address type not supported");
+ }
+ else
+ {
+ InetSocketAddress tmp = (InetSocketAddress) endpoint;
+ if (tmp.isUnresolved())
+ throw new SocketException("Unresolved address");
+ addr = tmp.getAddress();
+ port = tmp.getPort();
+ }
SecurityManager s = System.getSecurityManager();
if (s != null)
- s.checkListen(tmp.getPort());
-
- InetAddress addr = tmp.getAddress();
-
- // Initialize addr with 0.0.0.0.
- if (addr == null)
- addr = InetAddress.ANY_IF;
+ s.checkListen(port);
try
{
- impl.bind(addr, tmp.getPort());
+ impl.bind(addr, port);
impl.listen(backlog);
- local = new InetSocketAddress(
+ this.port = port;
+ local = new InetSocketAddress(
(InetAddress) impl.getOption(SocketOptions.SO_BINDADDR),
impl.getLocalPort());
}
- catch (IOException exception)
- {
- close();
- throw exception;
- }
- catch (RuntimeException exception)
- {
- close();
- throw exception;
- }
- catch (Error error)
+ finally
{
- close();
- throw error;
+ try
+ {
+ if (local == null)
+ close();
+ }
+ catch (IOException _)
+ {
+ }
}
}
@@ -333,6 +345,19 @@ public class ServerSocket
throw e;
}
+ catch (SecurityException e)
+ {
+ try
+ {
+ socket.close();
+ }
+ catch (IOException e2)
+ {
+ // Ignore.
+ }
+
+ throw e;
+ }
return socket;
}
@@ -355,9 +380,6 @@ public class ServerSocket
if (isClosed())
throw new SocketException("ServerSocket is closed");
- // FIXME: Add a security check to make sure we're allowed to
- // connect to the remote host.
-
// The Sun spec says that if we have an associated channel and
// it is in non-blocking mode, we throw an IllegalBlockingModeException.
// However, in our implementation if the channel itself initiated this
@@ -367,8 +389,12 @@ public class ServerSocket
throw new IllegalBlockingModeException();
impl.accept(socket.impl);
- socket.implCreated = true;
socket.bound = true;
+
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ sm.checkAccept(socket.getInetAddress().getHostAddress(),
+ socket.getPort());
}
/**
@@ -378,14 +404,11 @@ public class ServerSocket
*/
public void close() throws IOException
{
- if (isClosed())
- return;
-
- impl.close();
- impl = null;
-
- if (getChannel() != null)
- getChannel().close();
+ if (impl != null)
+ {
+ impl.close();
+ impl = null;
+ }
}
/**
@@ -425,7 +448,8 @@ public class ServerSocket
*/
public boolean isClosed()
{
- return impl == null;
+ ServerSocketChannel channel = getChannel();
+ return impl == null || (channel != null && ! channel.isOpen());
}
/**
@@ -573,7 +597,7 @@ public class ServerSocket
return "ServerSocket[unbound]";
return ("ServerSocket[addr=" + getInetAddress() + ",port="
- + impl.getPort() + ",localport=" + impl.getLocalPort() + "]");
+ + port + ",localport=" + getLocalPort() + "]");
}
/**
@@ -594,6 +618,13 @@ public class ServerSocket
public static synchronized void setSocketFactory(SocketImplFactory fac)
throws IOException
{
+ if (factory != null)
+ throw new SocketException("SocketFactory already defined");
+
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ sm.checkSetFactory();
+
factory = fac;
}
}
diff --git a/libjava/classpath/java/net/Socket.java b/libjava/classpath/java/net/Socket.java
index b2249ffaa0d..f4f25fe1c1b 100644
--- a/libjava/classpath/java/net/Socket.java
+++ b/libjava/classpath/java/net/Socket.java
@@ -1,5 +1,5 @@
/* Socket.java -- Client socket implementation
- Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004
+ Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2006
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -83,13 +83,6 @@ public class Socket
SocketImpl impl;
/**
- * True if socket implementation was created by calling their
- * create() method.
- */
- // package-private because ServerSocket.implAccept() needs to access it.
- boolean implCreated;
-
- /**
* True if the socket is bound.
* Package private so it can be set from ServerSocket when accept is called.
*/
@@ -298,15 +291,33 @@ public class Socket
SecurityManager sm = System.getSecurityManager();
if (sm != null)
- sm.checkConnect(raddr.getHostName(), rport);
+ sm.checkConnect(raddr.getHostAddress(), rport);
// bind socket
SocketAddress bindaddr =
laddr == null ? null : new InetSocketAddress(laddr, lport);
bind(bindaddr);
- // connect socket
- connect(new InetSocketAddress(raddr, rport));
+ // Connect socket in case of Exceptions we must close the socket
+ // because an exception in the constructor means that the caller will
+ // not have a reference to this instance.
+ // Note: You may have the idea that the exception treatment
+ // should be moved into connect() but there is a Mauve test which
+ // shows that a failed connect should not close the socket.
+ try
+ {
+ connect(new InetSocketAddress(raddr, rport));
+ }
+ catch (IOException ioe)
+ {
+ impl.close();
+ throw ioe;
+ }
+ catch (RuntimeException re)
+ {
+ impl.close();
+ throw re;
+ }
// FIXME: JCL p. 1586 says if localPort is unspecified, bind to any port,
// i.e. '0' and if localAddr is unspecified, use getLocalAddress() as
@@ -315,21 +326,6 @@ public class Socket
private SocketImpl getImpl() throws SocketException
{
- try
- {
- if (! implCreated)
- {
- impl.create(true);
- implCreated = true;
- }
- }
- catch (IOException e)
- {
- SocketException se = new SocketException(e.toString());
- se.initCause(e);
- throw se;
- }
-
return impl;
}
@@ -363,6 +359,7 @@ public class Socket
// bind to address/port
try
{
+ getImpl().create(true);
getImpl().bind(tmp.getAddress(), tmp.getPort());
bound = true;
}
@@ -479,16 +476,22 @@ public class Socket
InetAddress addr = null;
- try
+ if (impl instanceof PlainSocketImpl)
+ addr = ((PlainSocketImpl) impl).getLocalAddress().getAddress();
+
+ if (addr == null)
{
- addr = (InetAddress) getImpl().getOption(SocketOptions.SO_BINDADDR);
- }
- catch (SocketException e)
- {
- // (hopefully) shouldn't happen
- // throw new java.lang.InternalError
- // ("Error in PlainSocketImpl.getOption");
- return null;
+ try
+ {
+ addr = (InetAddress) getImpl().getOption(SocketOptions.SO_BINDADDR);
+ }
+ catch (SocketException e)
+ {
+ // (hopefully) shouldn't happen
+ // throw new java.lang.InternalError
+ // ("Error in PlainSocketImpl.getOption");
+ return null;
+ }
}
// FIXME: According to libgcj, checkConnect() is supposed to be called
@@ -707,10 +710,10 @@ public class Socket
if (linger > 65535)
linger = 65535;
- getImpl().setOption(SocketOptions.SO_LINGER, new Integer(linger));
+ getImpl().setOption(SocketOptions.SO_LINGER, Integer.valueOf(linger));
}
else
- getImpl().setOption(SocketOptions.SO_LINGER, Boolean.valueOf(false));
+ getImpl().setOption(SocketOptions.SO_LINGER, Integer.valueOf(-1));
}
/**
@@ -1001,12 +1004,8 @@ public class Socket
if (isClosed())
return;
- getImpl().close();
+ impl.close();
impl = null;
- bound = false;
-
- if (getChannel() != null)
- getChannel().close();
}
/**
@@ -1019,16 +1018,17 @@ public class Socket
try
{
if (isConnected())
- return ("Socket[addr=" + getImpl().getInetAddress() + ",port="
- + getImpl().getPort() + ",localport="
- + getImpl().getLocalPort() + "]");
+ return (super.toString()
+ + " [addr=" + getImpl().getInetAddress() + ",port="
+ + getImpl().getPort() + ",localport="
+ + getImpl().getLocalPort() + "]");
}
catch (SocketException e)
{
// This cannot happen as we are connected.
}
- return "Socket[unconnected]";
+ return super.toString() + " [unconnected]";
}
/**
@@ -1206,17 +1206,10 @@ public class Socket
*/
public boolean isConnected()
{
- try
- {
- if (getImpl() == null)
- return false;
-
- return getImpl().getInetAddress() != null;
- }
- catch (SocketException e)
- {
- return false;
- }
+ if (impl == null)
+ return false;
+
+ return impl.getInetAddress() != null;
}
/**
@@ -1228,6 +1221,13 @@ public class Socket
*/
public boolean isBound()
{
+ if (isClosed())
+ return false;
+ if (impl instanceof PlainSocketImpl)
+ {
+ InetSocketAddress addr = ((PlainSocketImpl) impl).getLocalAddress();
+ return addr != null && addr.getAddress() != null;
+ }
return bound;
}
@@ -1240,7 +1240,9 @@ public class Socket
*/
public boolean isClosed()
{
- return impl == null;
+ SocketChannel channel = getChannel();
+
+ return impl == null || (channel != null && ! channel.isOpen());
}
/**
diff --git a/libjava/classpath/java/net/URI.java b/libjava/classpath/java/net/URI.java
index 401352fcf3c..689843c0bf9 100644
--- a/libjava/classpath/java/net/URI.java
+++ b/libjava/classpath/java/net/URI.java
@@ -156,7 +156,7 @@ import java.util.regex.Pattern;
* @since 1.4
*/
public final class URI
- implements Comparable, Serializable
+ implements Comparable<URI>, Serializable
{
/**
* For serialization compatability.
@@ -1229,7 +1229,7 @@ public final class URI
}
/**
- * Compare the URI with another object that must also be a URI.
+ * Compare the URI with another URI.
* Undefined components are taken to be less than any other component.
* The following criteria are observed:
* </p>
@@ -1265,16 +1265,14 @@ public final class URI
* </ul>
* </ul>
*
- * @param obj This object to compare this URI with
+ * @param uri The other URI to compare this URI with
* @return a negative integer, zero or a positive integer depending
* on whether this URI is less than, equal to or greater
* than that supplied, respectively.
- * @throws ClassCastException if the given object is not a URI
*/
- public int compareTo(Object obj)
+ public int compareTo(URI uri)
throws ClassCastException
{
- URI uri = (URI) obj;
if (scheme == null && uri.getScheme() != null)
return -1;
if (scheme != null)
diff --git a/libjava/classpath/java/net/URL.java b/libjava/classpath/java/net/URL.java
index ed7decc7992..8f72d0687e4 100644
--- a/libjava/classpath/java/net/URL.java
+++ b/libjava/classpath/java/net/URL.java
@@ -322,7 +322,8 @@ public final class URL implements Serializable
*/
public URL(String spec) throws MalformedURLException
{
- this((URL) null, spec != null ? spec : "", (URLStreamHandler) null);
+ this((URL) null, spec != null ? spec : "", (URLStreamHandler) null,
+ false);
}
/**
@@ -343,7 +344,9 @@ public final class URL implements Serializable
*/
public URL(URL context, String spec) throws MalformedURLException
{
- this(context, spec, (context == null) ? (URLStreamHandler)null : context.ph);
+ this(context, spec,
+ (context == null) ? (URLStreamHandler) null : context.ph,
+ false);
}
/**
@@ -377,6 +380,23 @@ public final class URL implements Serializable
public URL(URL context, String spec, URLStreamHandler ph)
throws MalformedURLException
{
+ this(context, spec, ph, true);
+ }
+
+ /**
+ * Private constructor called by all other constructors taking
+ * a context and spec.
+ *
+ * @param context The context in which to parse the specification
+ * @param spec The string to parse as an URL
+ * @param ph The stream handler for the URL
+ * @param phFromUser Whether or not the user supplied the URLStreamHandler
+ *
+ */
+ private URL(URL context, String spec, URLStreamHandler ph,
+ boolean phFromUser)
+ throws MalformedURLException
+ {
/* A protocol is defined by the doc as the substring before a ':'
* as long as the ':' occurs before any '/'.
*
@@ -397,7 +417,11 @@ public final class URL implements Serializable
if ((colon = spec.indexOf("://", 1)) > 0
&& ((colon < slash || slash < 0))
&& ! spec.regionMatches(colon, "://:", 0, 4))
- context = null;
+ {
+ context = null;
+ if (! phFromUser)
+ ph = null;
+ }
boolean protocolSpecified = false;
@@ -458,7 +482,7 @@ public final class URL implements Serializable
if (ph != null)
{
SecurityManager s = System.getSecurityManager();
- if (s != null)
+ if (s != null && phFromUser)
s.checkPermission(new NetPermission("specifyStreamHandler"));
this.ph = ph;
diff --git a/libjava/classpath/java/net/URLClassLoader.java b/libjava/classpath/java/net/URLClassLoader.java
index 403f7485c79..7e2353ac27e 100644
--- a/libjava/classpath/java/net/URLClassLoader.java
+++ b/libjava/classpath/java/net/URLClassLoader.java
@@ -508,7 +508,7 @@ public class URLClassLoader extends SecureClassLoader
* loaded
* @return a Class object representing the found class
*/
- protected Class findClass(final String className)
+ protected Class<?> findClass(final String className)
throws ClassNotFoundException
{
// Just try to find the resource by the (almost) same name
@@ -714,10 +714,10 @@ public class URLClassLoader extends SecureClassLoader
* @exception IOException when an error occurs accessing one of the
* locations
*/
- public Enumeration findResources(String resourceName)
+ public Enumeration<URL> findResources(String resourceName)
throws IOException
{
- Vector resources = new Vector();
+ Vector<URL> resources = new Vector<URL>();
int max = urlinfos.size();
for (int i = 0; i < max; i++)
{
diff --git a/libjava/classpath/java/net/URLConnection.java b/libjava/classpath/java/net/URLConnection.java
index 28142b10aad..67405801416 100644
--- a/libjava/classpath/java/net/URLConnection.java
+++ b/libjava/classpath/java/net/URLConnection.java
@@ -49,6 +49,7 @@ import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
+import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.StringTokenizer;
@@ -174,9 +175,14 @@ public abstract class URLConnection
private static boolean dateformats_initialized;
/**
- * The timeout period.
+ * The connection timeout period.
*/
- private int timeout;
+ private int connectTimeout;
+
+ /**
+ * The read timeout period.
+ */
+ private int readTimeout;
/* Cached ParsePosition, used when parsing dates. */
private ParsePosition position;
@@ -216,8 +222,8 @@ public abstract class URLConnection
}
/**
- * Returns the connection timeout speed, in milliseconds, or zero if the timeout
- * is infinite or not set.
+ * Returns the connection timeout speed, in milliseconds, or zero if
+ * the timeout is infinite or not set.
*
* @return The timeout.
*
@@ -225,7 +231,7 @@ public abstract class URLConnection
*/
public int getConnectTimeout()
{
- return timeout;
+ return connectTimeout;
}
/**
@@ -235,7 +241,7 @@ public abstract class URLConnection
*
* Throws an <code>IllegalArgumentException</code> if timeout < 0.
*
- * @param timeout - The timeout, in milliseconds.
+ * @param timeout the timeout, in milliseconds.
*
* @since 1.5
*/
@@ -244,7 +250,45 @@ public abstract class URLConnection
{
if( timeout < 0 )
throw new IllegalArgumentException("Timeout must be 0 or positive.");
- this.timeout = timeout;
+ connectTimeout = timeout;
+ }
+
+ /**
+ * Returns the read timeout, in milliseconds, or zero if the timeout
+ * is infinite or not set.
+ *
+ * @return The timeout.
+ *
+ * @see #setReadTimeout
+ *
+ * @since 1.5
+ */
+ public int getReadTimeout()
+ {
+ return readTimeout;
+ }
+
+ /**
+ * Set the read timeout, in milliseconds, or zero if the timeout
+ * is to be considered infinite. Note that in certain socket
+ * implementations/platforms this method may not have any effect.
+ *
+ * Throws an <code>IllegalArgumentException</code> if timeout < 0.
+ *
+ * @param timeout - The timeout, in milliseconds.
+ *
+ * @throws IllegalArgumentException if timeout is negative.
+ *
+ * @see #getReadTimeout
+ *
+ * @since 1.5
+ */
+ public void setReadTimeout(int timeout)
+ throws IllegalArgumentException
+ {
+ if( timeout < 0 )
+ throw new IllegalArgumentException("Timeout must be 0 or positive.");
+ readTimeout = timeout;
}
/**
@@ -359,10 +403,10 @@ public abstract class URLConnection
*
* @since 1.4
*/
- public Map getHeaderFields()
+ public Map<String,List<String>> getHeaderFields()
{
// Subclasses for specific protocols override this.
- return Collections.EMPTY_MAP;
+ return Collections.emptyMap();
}
/**
@@ -862,14 +906,14 @@ public abstract class URLConnection
*
* @since 1.4
*/
- public Map getRequestProperties()
+ public Map<String,List<String>> getRequestProperties()
{
if (connected)
throw new IllegalStateException("Already connected");
// Overridden by subclasses that support reading header fields from the
// request.
- return Collections.EMPTY_MAP;
+ return Collections.emptyMap();
}
/**
diff --git a/libjava/classpath/java/net/class-dependencies.conf b/libjava/classpath/java/net/class-dependencies.conf
new file mode 100644
index 00000000000..8b130f53684
--- /dev/null
+++ b/libjava/classpath/java/net/class-dependencies.conf
@@ -0,0 +1,122 @@
+# This property file contains dependencies of classes, methods, and
+# field on other methods or classes.
+#
+# Syntax:
+#
+# <used>: <needed 1> [... <needed N>]
+#
+# means that when <used> is included, <needed 1> (... <needed N>) must
+# be included as well.
+#
+# <needed X> and <used> are of the form
+#
+# <class.methodOrField(signature)>
+#
+# or just
+#
+# <class>
+#
+# Within dependencies, variables can be used. A variable is defined as
+# follows:
+#
+# {variable}: value1 value2 ... value<n>
+#
+# variables can be used on the right side of dependencies as follows:
+#
+# <used>: com.bla.blu.{variable}.Class.m()V
+#
+# The use of the variable will expand to <n> dependencies of the form
+#
+# <used>: com.bla.blu.value1.Class.m()V
+# <used>: com.bla.blu.value2.Class.m()V
+# ...
+# <used>: com.bla.blu.value<n>.Class.m()V
+#
+# Variables can be redefined when building a system to select the
+# required support for features like encodings, protocols, etc.
+#
+# Hints:
+#
+# - For methods and fields, the signature is mandatory. For
+# specification, please see the Java Virtual Machine Specification by
+# SUN. Unlike in the spec, field signatures (types) are in brackets.
+#
+# - Package names must be separated by '/' (and not '.'). E.g.,
+# java/lang/Class (this is necessary, because the '.' is used to
+# separate method or field names from classes)
+#
+# - In case <needed> refers to a class, only the class itself will be
+# included in the resulting binary, NOT necessarily all its methods
+# and fields. If you want to refer to all methods and fields, you can
+# write class.* as an abbreviation.
+#
+# - Abbreviations for packages are also possible: my/package/* means all
+# methods and fields of all classes in my/package.
+#
+# - A line with a trailing '\' continues in the next line.
+
+java/net/InetAddress: \
+ java/lang/ClassNotFoundException.<init>(Ljava/lang/String;)V \
+ java/lang/InternalError.<init>(Ljava/lang/String;)V \
+ java/net/UnknownHostException.<init>(Ljava/lang/String;)V
+
+java/net/DatagramSocketImpl: \
+ java/net/DatagramSocketImpl.fd(Ljava/io/FileDescriptor;) \
+ java/net/DatagramSocketImpl.localPort(I)
+
+java/net/PlainDatagramSocketImpl: \
+ java/lang/ClassNotFoundException.<init>(Ljava/lang/String;)V \
+ java/lang/InternalError.<init>(Ljava/lang/String;)V \
+ java/io/IOException.<init>(Ljava/lang/String;)V \
+ java/io/FileDescriptor.<init>()V \
+ java/lang/Boolean.<init>(Z)V \
+ java/lang/Integer.<init>(I)V \
+ java/net/InetAddress.getByName(Ljava/lang/String;)Ljava/net/InetAddress; \
+ java/net/InetAddress.getAddress()[B \
+ java/lang/Boolean.booleanValue()Z \
+ java/lang/Integer.intValue()I \
+ java/net/SocketException.<init>(Ljava/lang/String;)V \
+ java/net/DatagramPacket.getData()[B \
+ java/net/SocketImpl.address(Ljava/net/InetAddress;) \
+ java/net/PlainSocketImpl.native_fd(I) \
+ java/net/SocketImpl.fd(Ljava/io/FileDescriptor;) \
+ java/net/SocketImpl.address(Ljava/net/InetAddress;) \
+ java/net/PlainDatagramSocketImpl.native_fd(I) \
+ java/net/SocketImpl.localport(I) \
+ java/net/SocketImpl.port(I)
+
+java/net/PlainSocketImpl: \
+ java/lang/ClassNotFoundException.<init>(Ljava/lang/String;)V \
+ java/lang/InternalError.<init>(Ljava/lang/String;)V \
+ java/io/IOException.<init>(Ljava/lang/String;)V \
+ java/io/FileDescriptor.<init>()V \
+ java/lang/Boolean.<init>(Z)V \
+ java/lang/Integer.<init>(I)V \
+ java/net/InetAddress.getByName(Ljava/lang/String;)Ljava/net/InetAddress; \
+ java/net/InetAddress.getAddress()[B \
+ java/lang/Boolean.booleanValue()Z \
+ java/lang/Integer.intValue()I \
+ java/net/SocketException.<init>(Ljava/lang/String;)V \
+ java/net/DatagramPacket.getData()[B \
+ java/net/SocketImpl.address(Ljava/net/InetAddress;) \
+ java/net/PlainSocketImpl.native_fd(I) \
+ java/net/SocketImpl.fd(Ljava/io/FileDescriptor;) \
+ java/net/SocketImpl.address(Ljava/net/InetAddress;) \
+ java/net/PlainDatagramSocketImpl.native_fd(I) \
+ java/net/SocketImpl.localport(I) \
+ java/net/SocketImpl.port(I)
+
+# All protocols supported are loaded via URL.getURLStreamHandler from
+# class gnu.java.net.protocol.<protocol>.Handler.
+#
+# This introduces a dependency for all protocols. To allow an easy selection
+# and addition of protocols, the library variable {protocols} can be set to
+# the set of supported protocols.
+#
+{protocols}: http file jar
+
+java/net/URL.getURLStreamHandler(Ljava/lang/String;)Ljava/net/URLStreamHandler;: \
+ gnu/java/net/protocol/{protocols}/Handler.* \
+ com/aicas/java/net/protocol/rom/Handler.*
+
+# end of file
diff --git a/libjava/classpath/java/nio/ByteBuffer.java b/libjava/classpath/java/nio/ByteBuffer.java
index 0ccf7663cfa..78ad4471836 100644
--- a/libjava/classpath/java/nio/ByteBuffer.java
+++ b/libjava/classpath/java/nio/ByteBuffer.java
@@ -1,5 +1,5 @@
/* ByteBuffer.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.nio;
* @since 1.4
*/
public abstract class ByteBuffer extends Buffer
- implements Comparable
+ implements Comparable<ByteBuffer>
{
ByteOrder endian = ByteOrder.BIG_ENDIAN;
@@ -290,7 +290,7 @@ public abstract class ByteBuffer extends Buffer
{
if (obj instanceof ByteBuffer)
{
- return compareTo (obj) == 0;
+ return compareTo ((ByteBuffer) obj) == 0;
}
return false;
@@ -302,10 +302,8 @@ public abstract class ByteBuffer extends Buffer
* @exception ClassCastException If obj is not an object derived from
* <code>ByteBuffer</code>.
*/
- public int compareTo (Object obj)
+ public int compareTo (ByteBuffer other)
{
- ByteBuffer other = (ByteBuffer) obj;
-
int num = Math.min(remaining(), other.remaining());
int pos_this = position();
int pos_other = other.position();
diff --git a/libjava/classpath/java/nio/CharBuffer.java b/libjava/classpath/java/nio/CharBuffer.java
index 356a920eea0..34f429f62f7 100644
--- a/libjava/classpath/java/nio/CharBuffer.java
+++ b/libjava/classpath/java/nio/CharBuffer.java
@@ -1,5 +1,5 @@
/* CharBuffer.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,11 +38,13 @@ exception statement from your version. */
package java.nio;
+import java.io.IOException;
+
/**
* @since 1.4
*/
public abstract class CharBuffer extends Buffer
- implements Comparable, CharSequence
+ implements Comparable<CharBuffer>, CharSequence, Readable, Appendable
{
int array_offset;
char[] backing_buffer;
@@ -163,6 +165,18 @@ public abstract class CharBuffer extends Buffer
return this;
}
+ /** @since 1.5 */
+ public int read(CharBuffer buffer) throws IOException
+ {
+ // We want to call put(), so we don't manipulate the CharBuffer
+ // directly.
+ int rem = Math.min(buffer.remaining(), remaining());
+ char[] buf = new char[rem];
+ get(buf);
+ buffer.put(buf);
+ return rem;
+ }
+
/**
* This method transfers <code>char</code>s from this buffer into the given
* destination array.
@@ -323,7 +337,7 @@ public abstract class CharBuffer extends Buffer
{
if (obj instanceof CharBuffer)
{
- return compareTo (obj) == 0;
+ return compareTo ((CharBuffer) obj) == 0;
}
return false;
@@ -335,10 +349,8 @@ public abstract class CharBuffer extends Buffer
* @exception ClassCastException If obj is not an object derived from
* <code>CharBuffer</code>.
*/
- public int compareTo (Object obj)
+ public int compareTo (CharBuffer other)
{
- CharBuffer other = (CharBuffer) obj;
-
int num = Math.min(remaining(), other.remaining());
int pos_this = position();
int pos_other = other.position();
@@ -503,4 +515,25 @@ public abstract class CharBuffer extends Buffer
return get (position () + index);
}
+
+ /** @since 1.5 */
+ public CharBuffer append(char c)
+ {
+ put(c);
+ return this;
+ }
+
+ /** @since 1.5 */
+ public CharBuffer append(CharSequence cs)
+ {
+ put(cs == null ? "null" : cs.toString());
+ return this;
+ }
+
+ /** @since 1.5 */
+ public CharBuffer append(CharSequence cs, int start, int end)
+ {
+ put(cs == null ? "null" : cs.subSequence(start, end).toString());
+ return this;
+ }
}
diff --git a/libjava/classpath/java/nio/DirectByteBufferImpl.java b/libjava/classpath/java/nio/DirectByteBufferImpl.java
index 3a9036f3148..8c907f597f0 100644
--- a/libjava/classpath/java/nio/DirectByteBufferImpl.java
+++ b/libjava/classpath/java/nio/DirectByteBufferImpl.java
@@ -233,7 +233,7 @@ abstract class DirectByteBufferImpl extends ByteBuffer
{
int pos = position();
if (this.mark != -1)
- reset();
+ reset();
int mark = position();
position(pos);
DirectByteBufferImpl result;
diff --git a/libjava/classpath/java/nio/DoubleBuffer.java b/libjava/classpath/java/nio/DoubleBuffer.java
index 381bb716636..be7861cbd5e 100644
--- a/libjava/classpath/java/nio/DoubleBuffer.java
+++ b/libjava/classpath/java/nio/DoubleBuffer.java
@@ -1,5 +1,5 @@
/* DoubleBuffer.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.nio;
* @since 1.4
*/
public abstract class DoubleBuffer extends Buffer
- implements Comparable
+ implements Comparable<DoubleBuffer>
{
int array_offset;
double[] backing_buffer;
@@ -273,7 +273,7 @@ public abstract class DoubleBuffer extends Buffer
{
if (obj instanceof DoubleBuffer)
{
- return compareTo (obj) == 0;
+ return compareTo ((DoubleBuffer) obj) == 0;
}
return false;
@@ -285,10 +285,8 @@ public abstract class DoubleBuffer extends Buffer
* @exception ClassCastException If obj is not an object derived from
* <code>DoubleBuffer</code>.
*/
- public int compareTo (Object obj)
+ public int compareTo (DoubleBuffer other)
{
- DoubleBuffer other = (DoubleBuffer) obj;
-
int num = Math.min(remaining(), other.remaining());
int pos_this = position();
int pos_other = other.position();
diff --git a/libjava/classpath/java/nio/FloatBuffer.java b/libjava/classpath/java/nio/FloatBuffer.java
index 8042333cbac..62e353a6818 100644
--- a/libjava/classpath/java/nio/FloatBuffer.java
+++ b/libjava/classpath/java/nio/FloatBuffer.java
@@ -1,5 +1,5 @@
/* FloatBuffer.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.nio;
* @since 1.4
*/
public abstract class FloatBuffer extends Buffer
- implements Comparable
+ implements Comparable<FloatBuffer>
{
int array_offset;
float[] backing_buffer;
@@ -273,7 +273,7 @@ public abstract class FloatBuffer extends Buffer
{
if (obj instanceof FloatBuffer)
{
- return compareTo (obj) == 0;
+ return compareTo ((FloatBuffer) obj) == 0;
}
return false;
@@ -285,10 +285,8 @@ public abstract class FloatBuffer extends Buffer
* @exception ClassCastException If obj is not an object derived from
* <code>FloatBuffer</code>.
*/
- public int compareTo (Object obj)
+ public int compareTo (FloatBuffer other)
{
- FloatBuffer other = (FloatBuffer) obj;
-
int num = Math.min(remaining(), other.remaining());
int pos_this = position();
int pos_other = other.position();
diff --git a/libjava/classpath/java/nio/IntBuffer.java b/libjava/classpath/java/nio/IntBuffer.java
index 1e1fe9c7565..d6fcb51ddf0 100644
--- a/libjava/classpath/java/nio/IntBuffer.java
+++ b/libjava/classpath/java/nio/IntBuffer.java
@@ -1,5 +1,5 @@
/* IntBuffer.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.nio;
* @since 1.4
*/
public abstract class IntBuffer extends Buffer
- implements Comparable
+ implements Comparable<IntBuffer>
{
int array_offset;
int[] backing_buffer;
@@ -273,7 +273,7 @@ public abstract class IntBuffer extends Buffer
{
if (obj instanceof IntBuffer)
{
- return compareTo (obj) == 0;
+ return compareTo ((IntBuffer) obj) == 0;
}
return false;
@@ -285,10 +285,8 @@ public abstract class IntBuffer extends Buffer
* @exception ClassCastException If obj is not an object derived from
* <code>IntBuffer</code>.
*/
- public int compareTo (Object obj)
+ public int compareTo (IntBuffer other)
{
- IntBuffer other = (IntBuffer) obj;
-
int num = Math.min(remaining(), other.remaining());
int pos_this = position();
int pos_other = other.position();
diff --git a/libjava/classpath/java/nio/LongBuffer.java b/libjava/classpath/java/nio/LongBuffer.java
index b3d3557edcf..9c3bfa62741 100644
--- a/libjava/classpath/java/nio/LongBuffer.java
+++ b/libjava/classpath/java/nio/LongBuffer.java
@@ -1,5 +1,5 @@
/* LongBuffer.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.nio;
* @since 1.4
*/
public abstract class LongBuffer extends Buffer
- implements Comparable
+ implements Comparable<LongBuffer>
{
int array_offset;
long[] backing_buffer;
@@ -273,7 +273,7 @@ public abstract class LongBuffer extends Buffer
{
if (obj instanceof LongBuffer)
{
- return compareTo (obj) == 0;
+ return compareTo ((LongBuffer) obj) == 0;
}
return false;
@@ -285,10 +285,8 @@ public abstract class LongBuffer extends Buffer
* @exception ClassCastException If obj is not an object derived from
* <code>LongBuffer</code>.
*/
- public int compareTo (Object obj)
+ public int compareTo (LongBuffer other)
{
- LongBuffer other = (LongBuffer) obj;
-
int num = Math.min(remaining(), other.remaining());
int pos_this = position();
int pos_other = other.position();
diff --git a/libjava/classpath/java/nio/ShortBuffer.java b/libjava/classpath/java/nio/ShortBuffer.java
index 958fe8cd6b6..33e458a4b1e 100644
--- a/libjava/classpath/java/nio/ShortBuffer.java
+++ b/libjava/classpath/java/nio/ShortBuffer.java
@@ -1,5 +1,5 @@
/* ShortBuffer.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.nio;
* @since 1.4
*/
public abstract class ShortBuffer extends Buffer
- implements Comparable
+ implements Comparable<ShortBuffer>
{
int array_offset;
short[] backing_buffer;
@@ -273,7 +273,7 @@ public abstract class ShortBuffer extends Buffer
{
if (obj instanceof ShortBuffer)
{
- return compareTo (obj) == 0;
+ return compareTo ((ShortBuffer) obj) == 0;
}
return false;
@@ -285,10 +285,8 @@ public abstract class ShortBuffer extends Buffer
* @exception ClassCastException If obj is not an object derived from
* <code>ShortBuffer</code>.
*/
- public int compareTo (Object obj)
+ public int compareTo (ShortBuffer other)
{
- ShortBuffer other = (ShortBuffer) obj;
-
int num = Math.min(remaining(), other.remaining());
int pos_this = position();
int pos_other = other.position();
diff --git a/libjava/classpath/java/nio/channels/Channel.java b/libjava/classpath/java/nio/channels/Channel.java
index d488bd27dd0..33fcf31743d 100644
--- a/libjava/classpath/java/nio/channels/Channel.java
+++ b/libjava/classpath/java/nio/channels/Channel.java
@@ -1,5 +1,5 @@
/* Channel.java --
- Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,8 +39,9 @@ exception statement from your version. */
package java.nio.channels;
import java.io.IOException;
+import java.io.Closeable;
-public interface Channel
+public interface Channel extends Closeable
{
/**
* Tells whether this channel is open or not
diff --git a/libjava/classpath/java/nio/channels/Selector.java b/libjava/classpath/java/nio/channels/Selector.java
index 2c883efd1a1..1c09db70236 100644
--- a/libjava/classpath/java/nio/channels/Selector.java
+++ b/libjava/classpath/java/nio/channels/Selector.java
@@ -82,7 +82,7 @@ public abstract class Selector
*
* @exception ClosedSelectorException If this selector is closed.
*/
- public abstract Set keys();
+ public abstract Set<SelectionKey> keys();
/**
* Returns the SelectorProvider that created the selector.
@@ -115,7 +115,7 @@ public abstract class Selector
*
* @exception ClosedSelectorException If this selector is closed.
*/
- public abstract Set selectedKeys();
+ public abstract Set<SelectionKey> selectedKeys();
/**
* Selects a set of keys whose corresponding channels are ready
diff --git a/libjava/classpath/java/nio/channels/spi/AbstractSelectableChannel.java b/libjava/classpath/java/nio/channels/spi/AbstractSelectableChannel.java
index 847c02cce06..5d5277b4a68 100644
--- a/libjava/classpath/java/nio/channels/spi/AbstractSelectableChannel.java
+++ b/libjava/classpath/java/nio/channels/spi/AbstractSelectableChannel.java
@@ -44,6 +44,7 @@ import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.IllegalBlockingModeException;
+import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
@@ -106,7 +107,15 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
*/
protected final void implCloseChannel() throws IOException
{
- implCloseSelectableChannel();
+ try
+ {
+ implCloseSelectableChannel();
+ }
+ finally
+ {
+ for (Iterator it = keys.iterator(); it.hasNext(); )
+ ((SelectionKey) it.next()).cancel();
+ }
}
/**
@@ -234,8 +243,8 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
if (key != null && key.isValid())
{
- if (att != null)
- key.attach(att);
+ key.interestOps(ops);
+ key.attach(att);
}
else
{
diff --git a/libjava/classpath/java/nio/channels/spi/AbstractSelector.java b/libjava/classpath/java/nio/channels/spi/AbstractSelector.java
index 78380738a2c..73f5077df92 100644
--- a/libjava/classpath/java/nio/channels/spi/AbstractSelector.java
+++ b/libjava/classpath/java/nio/channels/spi/AbstractSelector.java
@@ -1,5 +1,5 @@
/* AbstractSelector.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,7 +49,7 @@ public abstract class AbstractSelector extends Selector
{
private boolean closed;
private SelectorProvider provider;
- private HashSet cancelledKeys;
+ private HashSet<SelectionKey> cancelledKeys;
/**
* Initializes the slector.
@@ -59,7 +59,7 @@ public abstract class AbstractSelector extends Selector
protected AbstractSelector(SelectorProvider provider)
{
this.provider = provider;
- this.cancelledKeys = new HashSet();
+ this.cancelledKeys = new HashSet<SelectionKey>();
}
/**
@@ -115,7 +115,7 @@ public abstract class AbstractSelector extends Selector
*
* @return the cancelled keys set
*/
- protected final Set cancelledKeys()
+ protected final Set<SelectionKey> cancelledKeys()
{
if (! isOpen())
throw new ClosedSelectorException();
diff --git a/libjava/classpath/java/nio/charset/Charset.java b/libjava/classpath/java/nio/charset/Charset.java
index 3637703a32c..556e4707eeb 100644
--- a/libjava/classpath/java/nio/charset/Charset.java
+++ b/libjava/classpath/java/nio/charset/Charset.java
@@ -60,7 +60,7 @@ import java.util.TreeMap;
* @since 1.4
* @status updated to 1.5
*/
-public abstract class Charset implements Comparable
+public abstract class Charset implements Comparable<Charset>
{
private CharsetEncoder cachedEncoder;
private CharsetDecoder cachedDecoder;
@@ -219,19 +219,20 @@ public abstract class Charset implements Comparable
return cs;
}
- public static SortedMap availableCharsets()
+ public static SortedMap<String, Charset> availableCharsets()
{
- TreeMap charsets = new TreeMap(String.CASE_INSENSITIVE_ORDER);
- for (Iterator i = provider().charsets(); i.hasNext(); )
+ TreeMap<String, Charset> charsets
+ = new TreeMap(String.CASE_INSENSITIVE_ORDER);
+ for (Iterator<Charset> i = provider().charsets(); i.hasNext(); )
{
- Charset cs = (Charset) i.next();
+ Charset cs = i.next();
charsets.put(cs.name(), cs);
}
CharsetProvider[] providers = providers2();
for (int j = 0; j < providers.length; j++)
{
- for (Iterator i = providers[j].charsets(); i.hasNext(); )
+ for (Iterator<Charset> i = providers[j].charsets(); i.hasNext(); )
{
Charset cs = (Charset) i.next();
charsets.put(cs.name(), cs);
@@ -284,14 +285,14 @@ public abstract class Charset implements Comparable
return canonicalName;
}
- public final Set aliases ()
+ public final Set<String> aliases ()
{
if (aliases == null)
- return Collections.EMPTY_SET;
+ return Collections.<String>emptySet();
// should we cache the aliasSet instead?
int n = aliases.length;
- HashSet aliasSet = new HashSet (n);
+ HashSet<String> aliasSet = new HashSet<String> (n);
for (int i = 0; i < n; ++i)
aliasSet.add (aliases[i]);
return Collections.unmodifiableSet (aliasSet);
@@ -376,9 +377,9 @@ public abstract class Charset implements Comparable
}
}
- public final int compareTo (Object ob)
+ public final int compareTo (Charset other)
{
- return canonicalName.compareToIgnoreCase (((Charset) ob).canonicalName);
+ return canonicalName.compareToIgnoreCase (other.canonicalName);
}
public final int hashCode ()
diff --git a/libjava/classpath/java/nio/charset/spi/CharsetProvider.java b/libjava/classpath/java/nio/charset/spi/CharsetProvider.java
index 496ccf92789..03653f807d8 100644
--- a/libjava/classpath/java/nio/charset/spi/CharsetProvider.java
+++ b/libjava/classpath/java/nio/charset/spi/CharsetProvider.java
@@ -1,5 +1,5 @@
/* CharsetProvider.java -- charset service provider interface
- Copyright (C) 2002, 2006 Free Software Foundation
+ Copyright (C) 2002, 2005, 2006 Free Software Foundation
This file is part of GNU Classpath.
@@ -82,7 +82,7 @@ public abstract class CharsetProvider
* @return the iterator
* @see Charset#availableCharsets()
*/
- public abstract Iterator charsets();
+ public abstract Iterator<Charset> charsets();
/**
* Returns the named charset, by canonical name or alias.
diff --git a/libjava/classpath/java/nio/class-dependencies.conf b/libjava/classpath/java/nio/class-dependencies.conf
new file mode 100644
index 00000000000..4fbf75eb1ce
--- /dev/null
+++ b/libjava/classpath/java/nio/class-dependencies.conf
@@ -0,0 +1,58 @@
+# This property file contains dependencies of classes, methods, and
+# field on other methods or classes.
+#
+# Syntax:
+#
+# <used>: <needed 1> [... <needed N>]
+#
+# means that when <used> is included, <needed 1> (... <needed N>) must
+# be included as well.
+#
+# <needed X> and <used> are of the form
+#
+# <class.methodOrField(signature)>
+#
+# or just
+#
+# <class>
+#
+# Within dependencies, variables can be used. A variable is defined as
+# follows:
+#
+# {variable}: value1 value2 ... value<n>
+#
+# variables can be used on the right side of dependencies as follows:
+#
+# <used>: com.bla.blu.{variable}.Class.m()V
+#
+# The use of the variable will expand to <n> dependencies of the form
+#
+# <used>: com.bla.blu.value1.Class.m()V
+# <used>: com.bla.blu.value2.Class.m()V
+# ...
+# <used>: com.bla.blu.value<n>.Class.m()V
+#
+# Variables can be redefined when building a system to select the
+# required support for features like encodings, protocols, etc.
+#
+# Hints:
+#
+# - For methods and fields, the signature is mandatory. For
+# specification, please see the Java Virtual Machine Specification by
+# SUN. Unlike in the spec, field signatures (types) are in brackets.
+#
+# - Package names must be separated by '/' (and not '.'). E.g.,
+# java/lang/Class (this is necessary, because the '.' is used to
+# separate method or field names from classes)
+#
+# - In case <needed> refers to a class, only the class itself will be
+# included in the resulting binary, NOT necessarily all its methods
+# and fields. If you want to refer to all methods and fields, you can
+# write class.* as an abbreviation.
+#
+# - Abbreviations for packages are also possible: my/package/* means all
+# methods and fields of all classes in my/package.
+#
+# - A line with a trailing '\' continues in the next line.
+
+# end of file
diff --git a/libjava/classpath/java/rmi/server/LoaderHandler.java b/libjava/classpath/java/rmi/server/LoaderHandler.java
index 0489cd16634..8e966156475 100644
--- a/libjava/classpath/java/rmi/server/LoaderHandler.java
+++ b/libjava/classpath/java/rmi/server/LoaderHandler.java
@@ -42,6 +42,7 @@ import java.net.URL;
/**
* @deprecated
+ * @since 1.1
*/
public interface LoaderHandler
{
@@ -54,13 +55,13 @@ public interface LoaderHandler
/**
* @deprecated
*/
- Class loadClass(String name)
+ Class<?> loadClass(String name)
throws MalformedURLException, ClassNotFoundException;
/**
* @deprecated
*/
- Class loadClass(URL codebase, String name)
+ Class<?> loadClass(URL codebase, String name)
throws MalformedURLException, ClassNotFoundException;
/**
diff --git a/libjava/classpath/java/rmi/server/RMIClassLoader.java b/libjava/classpath/java/rmi/server/RMIClassLoader.java
index 33c44198d37..7b69d2f2c72 100644
--- a/libjava/classpath/java/rmi/server/RMIClassLoader.java
+++ b/libjava/classpath/java/rmi/server/RMIClassLoader.java
@@ -51,6 +51,7 @@ import java.util.Iterator;
* network-based class loading in RMI. These methods are called by RMI's
* internal marshal streams to implement the dynamic class loading of types for
* RMI parameters and return values.
+ * @since 1.1
*/
public class RMIClassLoader
{
@@ -62,13 +63,13 @@ public class RMIClassLoader
/**
* @deprecated
*/
- public static Class loadClass(String name)
+ public static Class<?> loadClass(String name)
throws MalformedURLException, ClassNotFoundException
{
return loadClass("", name);
}
- public static Class loadClass(String codebase, String name)
+ public static Class<?> loadClass(String codebase, String name)
throws MalformedURLException, ClassNotFoundException
{
RMIClassLoaderSpi spi = getProviderInstance();
@@ -77,8 +78,8 @@ public class RMIClassLoader
return spi.loadClass(codebase, name, null);
}
- public static Class loadClass(String codebase, String name,
- ClassLoader defaultLoader)
+ public static Class<?> loadClass(String codebase, String name,
+ ClassLoader defaultLoader)
throws MalformedURLException, ClassNotFoundException
{
RMIClassLoaderSpi spi = getProviderInstance();
@@ -87,8 +88,8 @@ public class RMIClassLoader
return spi.loadClass(codebase, name, defaultLoader);
}
- public static Class loadProxyClass (String codeBase, String[] interfaces,
- ClassLoader defaultLoader)
+ public static Class<?> loadProxyClass (String codeBase, String[] interfaces,
+ ClassLoader defaultLoader)
throws MalformedURLException, ClassNotFoundException
{
RMIClassLoaderSpi spi = getProviderInstance();
@@ -114,7 +115,7 @@ public class RMIClassLoader
* @throws MalformedURLException if the URL is not well formed
* @throws ClassNotFoundException if the requested class cannot be found
*/
- public static Class loadClass(URL codeBase, String name)
+ public static Class<?> loadClass(URL codeBase, String name)
throws MalformedURLException, ClassNotFoundException
{
RMIClassLoaderSpi spi = getProviderInstance();
@@ -151,7 +152,7 @@ public class RMIClassLoader
* @return a space seperated list of URLs where the class-definition
* of cl may be found
*/
- public static String getClassAnnotation(Class cl)
+ public static String getClassAnnotation(Class<?> cl)
{
RMIClassLoaderSpi spi = getProviderInstance();
if (spi == null)
diff --git a/libjava/classpath/java/rmi/server/RMIClassLoaderSpi.java b/libjava/classpath/java/rmi/server/RMIClassLoaderSpi.java
index 372d81879f9..ec2c204f1a9 100644
--- a/libjava/classpath/java/rmi/server/RMIClassLoaderSpi.java
+++ b/libjava/classpath/java/rmi/server/RMIClassLoaderSpi.java
@@ -49,16 +49,16 @@ public abstract class RMIClassLoaderSpi
{
}
- public abstract Class loadClass (String codeBase, String name,
- ClassLoader defaultLoader)
+ public abstract Class<?> loadClass (String codeBase, String name,
+ ClassLoader defaultLoader)
throws MalformedURLException, ClassNotFoundException;
- public abstract Class loadProxyClass (String codeBase, String[] interfaces,
- ClassLoader defaultLoader)
+ public abstract Class<?> loadProxyClass (String codeBase, String[] interfaces,
+ ClassLoader defaultLoader)
throws MalformedURLException, ClassNotFoundException;
public abstract ClassLoader getClassLoader (String codebase)
throws MalformedURLException;
- public abstract String getClassAnnotation (Class cl);
+ public abstract String getClassAnnotation (Class<?> cl);
}
diff --git a/libjava/classpath/java/security/AccessControlContext.java b/libjava/classpath/java/security/AccessControlContext.java
index 3b51e94125b..ffcfc0e41af 100644
--- a/libjava/classpath/java/security/AccessControlContext.java
+++ b/libjava/classpath/java/security/AccessControlContext.java
@@ -89,12 +89,30 @@ public final class AccessControlContext
public AccessControlContext(AccessControlContext acc,
DomainCombiner combiner)
{
+ AccessControlContext acc2 = null;
SecurityManager sm = System.getSecurityManager ();
if (sm != null)
{
- sm.checkPermission (new SecurityPermission ("createAccessControlContext"));
+ Permission perm =
+ new SecurityPermission ("createAccessControlContext");
+
+ // The default SecurityManager.checkPermission(perm) just calls
+ // AccessController.checkPermission(perm) which in turn just
+ // calls AccessController.getContext().checkPermission(perm).
+ // This means AccessController.getContext() is called twice,
+ // once for the security check and once by us. It's a very
+ // expensive call (on gcj at least) so if we're using the
+ // default security manager we avoid this duplication.
+ if (sm.getClass() == SecurityManager.class)
+ {
+ acc2 = AccessController.getContext ();
+ acc2.checkPermission (perm);
+ }
+ else
+ sm.checkPermission (perm);
}
- AccessControlContext acc2 = AccessController.getContext();
+ if (acc2 == null)
+ acc2 = AccessController.getContext ();
protectionDomains = combiner.combine (acc2.protectionDomains,
acc.protectionDomains);
this.combiner = combiner;
diff --git a/libjava/classpath/java/security/AccessController.java b/libjava/classpath/java/security/AccessController.java
index 93e34b87c22..6f8b3ecbd41 100644
--- a/libjava/classpath/java/security/AccessController.java
+++ b/libjava/classpath/java/security/AccessController.java
@@ -88,7 +88,7 @@ public final class AccessController
* should be be called.
* @return the result of the <code>action.run()</code> method.
*/
- public static Object doPrivileged(PrivilegedAction action)
+ public static <T> T doPrivileged(PrivilegedAction<T> action)
{
VMAccessController.pushContext(null);
try
@@ -115,8 +115,8 @@ public final class AccessController
* domains should be added to the protection domain of the calling class.
* @return the result of the <code>action.run()</code> method.
*/
- public static Object doPrivileged(PrivilegedAction action,
- AccessControlContext context)
+ public static <T> T doPrivileged(PrivilegedAction<T> action,
+ AccessControlContext context)
{
VMAccessController.pushContext(context);
try
@@ -145,7 +145,7 @@ public final class AccessController
* @exception PrivilegedActionException wrapped around any checked exception
* that is thrown in the <code>run()</code> method.
*/
- public static Object doPrivileged(PrivilegedExceptionAction action)
+ public static <T> T doPrivileged(PrivilegedExceptionAction<T> action)
throws PrivilegedActionException
{
VMAccessController.pushContext(null);
@@ -185,8 +185,8 @@ public final class AccessController
* @exception PrivilegedActionException wrapped around any checked exception
* that is thrown in the <code>run()</code> method.
*/
- public static Object doPrivileged(PrivilegedExceptionAction action,
- AccessControlContext context)
+ public static <T> T doPrivileged(PrivilegedExceptionAction<T> action,
+ AccessControlContext context)
throws PrivilegedActionException
{
VMAccessController.pushContext(context);
diff --git a/libjava/classpath/java/security/AlgorithmParameterGenerator.java b/libjava/classpath/java/security/AlgorithmParameterGenerator.java
index e33fbaf81db..e2a17d4bf9c 100644
--- a/libjava/classpath/java/security/AlgorithmParameterGenerator.java
+++ b/libjava/classpath/java/security/AlgorithmParameterGenerator.java
@@ -40,6 +40,7 @@ package java.security;
import gnu.java.security.Engine;
+import java.lang.reflect.InvocationTargetException;
import java.security.spec.AlgorithmParameterSpec;
/**
@@ -97,26 +98,29 @@ public class AlgorithmParameterGenerator
* Returns a new <code>AlgorithmParameterGenerator</code> instance which
* generates algorithm parameters for the specified algorithm.
*
- * @param algorithm
- * the name of algorithm to use.
+ * @param algorithm the name of algorithm to use.
* @return the new instance.
- * @throws NoSuchAlgorithmException
- * if <code>algorithm</code> is not implemented by any provider.
+ * @throws NoSuchAlgorithmException if <code>algorithm</code> is not
+ * implemented by any provider.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static AlgorithmParameterGenerator getInstance(String algorithm)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
for (int i = 0; i < p.length; i++)
try
{
return getInstance(algorithm, p[i]);
}
- catch (NoSuchAlgorithmException e)
- {
- // Ignore.
- }
-
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new NoSuchAlgorithmException(algorithm);
}
@@ -124,27 +128,27 @@ public class AlgorithmParameterGenerator
* Returns a new <code>AlgorithmParameterGenerator</code> instance which
* generates algorithm parameters for the specified algorithm.
*
- * @param algorithm
- * the name of algorithm to use.
- * @param provider
- * the name of the {@link Provider} to use.
+ * @param algorithm the name of algorithm to use.
+ * @param provider the name of the {@link Provider} to use.
* @return the new instance.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by the named provider.
- * @throws NoSuchProviderException
- * if the named provider was not found.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by the
+ * named provider.
+ * @throws NoSuchProviderException if the named provider was not found.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code> or empty.
*/
public static AlgorithmParameterGenerator getInstance(String algorithm,
- String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ String provider)
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
- if (provider == null || provider.length() == 0)
- throw new IllegalArgumentException("Illegal provider");
-
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
+ provider = provider.trim();
+ if (provider.length() == 0)
+ throw new IllegalArgumentException("provider MUST NOT be empty");
Provider p = Security.getProvider(provider);
if (p == null)
throw new NoSuchProviderException(provider);
-
return getInstance(algorithm, p);
}
@@ -152,38 +156,50 @@ public class AlgorithmParameterGenerator
* Returns a new <code>AlgorithmParameterGenerator</code> instance which
* generates algorithm parameters for the specified algorithm.
*
- * @param algorithm
- * the name of algorithm to use.
- * @param provider
- * the {@link Provider} to use.
+ * @param algorithm the name of algorithm to use.
+ * @param provider the {@link Provider} to use.
* @return the new instance.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by {@link Provider}.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by
+ * {@link Provider}.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
* @since 1.4
* @see Provider
*/
public static AlgorithmParameterGenerator getInstance(String algorithm,
Provider provider)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
-
+ StringBuilder sb = new StringBuilder()
+ .append("AlgorithmParameterGenerator for algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- return new AlgorithmParameterGenerator(
- (AlgorithmParameterGeneratorSpi) Engine.getInstance(
- ALGORITHM_PARAMETER_GENERATOR, algorithm, provider),
- provider, algorithm);
+ Object spi = Engine.getInstance(ALGORITHM_PARAMETER_GENERATOR,
+ algorithm,
+ provider);
+ return new AlgorithmParameterGenerator((AlgorithmParameterGeneratorSpi) spi,
+ provider,
+ algorithm);
}
- catch (java.lang.reflect.InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
/** @return the {@link Provider} of this generator. */
diff --git a/libjava/classpath/java/security/AlgorithmParameters.java b/libjava/classpath/java/security/AlgorithmParameters.java
index c4655aefacb..f5e5063a17d 100644
--- a/libjava/classpath/java/security/AlgorithmParameters.java
+++ b/libjava/classpath/java/security/AlgorithmParameters.java
@@ -41,6 +41,7 @@ package java.security;
import gnu.java.security.Engine;
import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidParameterSpecException;
@@ -91,106 +92,115 @@ public class AlgorithmParameters
/**
* Returns a new instance of <code>AlgorithmParameters</code> representing
* the specified algorithm parameters.
+ * <p>
+ * The returned <code>AlgorithmParameters</code> must still be initialized
+ * with an <code>init()</code> method.
*
- * <p>The returned <code>AlgorithmParameters</code> must still be initialized
- * with an <code>init()</code> method.</p>
- *
- * @param algorithm
- * the algorithm to use.
+ * @param algorithm the algorithm to use.
* @return the new instance repesenting the desired algorithm.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by any provider.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by any
+ * provider.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static AlgorithmParameters getInstance(String algorithm)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
Provider[] p = Security.getProviders();
-
+ NoSuchAlgorithmException lastException = null;
for (int i = 0; i < p.length; i++)
try
{
return getInstance(algorithm, p[i]);
}
- catch (NoSuchAlgorithmException e)
- {
- // Ignore this.
- }
-
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new NoSuchAlgorithmException(algorithm);
}
/**
* Returns a new instance of <code>AlgorithmParameters</code> representing
* the specified algorithm parameters from a named provider.
+ * <p>
+ * The returned <code>AlgorithmParameters</code> must still be intialized
+ * with an <code>init()</code> method.
+ * </p>
*
- * <p>The returned <code>AlgorithmParameters</code> must still be intialized
- * with an <code>init()</code> method.</p>
- *
- * @param algorithm
- * the algorithm to use.
- * @param provider
- * the name of the {@link Provider} to use.
+ * @param algorithm the algorithm to use.
+ * @param provider the name of the {@link Provider} to use.
* @return the new instance repesenting the desired algorithm.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by the named provider.
- * @throws NoSuchProviderException
- * if the named provider was not found.
- * @throws IllegalArgumentException
- * if <code>provider</code> is <code>null</code> or is an empty
- * string.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by the
+ * named provider.
+ * @throws NoSuchProviderException if the named provider was not found.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code> or empty.
*/
- public static AlgorithmParameters getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ public static AlgorithmParameters getInstance(String algorithm,
+ String provider)
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
- if (provider == null || provider.length() == 0)
- throw new IllegalArgumentException("Illegal provider");
-
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
+ provider = provider.trim();
+ if (provider.length() == 0)
+ throw new IllegalArgumentException("provider MUST NOT be empty");
Provider p = Security.getProvider(provider);
if (p == null)
throw new NoSuchProviderException(provider);
-
return getInstance(algorithm, p);
}
/**
* Returns a new instance of <code>AlgorithmParameters</code> representing
* the specified algorithm parameters from the specified {@link Provider}.
+ * <p>
+ * The returned <code>AlgorithmParameters</code> must still be intialized
+ * with an <code>init()</code> method.
*
- * <p>The returned <code>AlgorithmParameters</code> must still be intialized
- * with an <code>init()</code> method.</p>
- *
- * @param algorithm
- * the algorithm to use.
- * @param provider
- * the {@link Provider} to use.
+ * @param algorithm the algorithm to use.
+ * @param provider the {@link Provider} to use.
* @return the new instance repesenting the desired algorithm.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by the {@link Provider}.
- * @throws IllegalArgumentException
- * if <code>provider</code> is <code>null</code>.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by the
+ * {@link Provider}.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
* @since 1.4
*/
public static AlgorithmParameters getInstance(String algorithm,
Provider provider)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
-
+ StringBuilder sb = new StringBuilder("AlgorithmParameters for algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- return new AlgorithmParameters((AlgorithmParametersSpi)
- Engine.getInstance(ALGORITHM_PARAMETERS, algorithm, provider),
- provider, algorithm);
+ Object spi = Engine.getInstance(ALGORITHM_PARAMETERS, algorithm, provider);
+ return new AlgorithmParameters((AlgorithmParametersSpi) spi,
+ provider,
+ algorithm);
}
- catch (java.lang.reflect.InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
/** @return the provider of this parameter object. */
@@ -258,7 +268,8 @@ public class AlgorithmParameters
* @throws InvalidParameterSpecException
* if <code>paramSpec</code> is invalid.
*/
- public final AlgorithmParameterSpec getParameterSpec(Class paramSpec)
+ public final <T extends AlgorithmParameterSpec>
+ T getParameterSpec(Class<T> paramSpec)
throws InvalidParameterSpecException
{
return paramSpi.engineGetParameterSpec(paramSpec);
diff --git a/libjava/classpath/java/security/AlgorithmParametersSpi.java b/libjava/classpath/java/security/AlgorithmParametersSpi.java
index a9faa154374..bd61ce7df01 100644
--- a/libjava/classpath/java/security/AlgorithmParametersSpi.java
+++ b/libjava/classpath/java/security/AlgorithmParametersSpi.java
@@ -113,8 +113,8 @@ public abstract class AlgorithmParametersSpi
* @throws InvalidParameterSpecException if the paramSpec is an
* invalid parameter class
*/
- protected abstract AlgorithmParameterSpec engineGetParameterSpec(Class
- paramSpec)
+ protected abstract <T extends AlgorithmParameterSpec>
+ T engineGetParameterSpec(Class<T> paramSpec)
throws InvalidParameterSpecException;
diff --git a/libjava/classpath/java/security/IdentityScope.java b/libjava/classpath/java/security/IdentityScope.java
index d1ea1f29500..610d3534c26 100644
--- a/libjava/classpath/java/security/IdentityScope.java
+++ b/libjava/classpath/java/security/IdentityScope.java
@@ -201,7 +201,7 @@ public abstract class IdentityScope extends Identity
*
* @return an {@link Enumeration} of the identities in this scope.
*/
- public abstract Enumeration identities();
+ public abstract Enumeration<Identity> identities();
/**
* Returns a string representing this instance. It includes the name, the
diff --git a/libjava/classpath/java/security/KeyFactory.java b/libjava/classpath/java/security/KeyFactory.java
index edb2a87dafb..043dd59a151 100644
--- a/libjava/classpath/java/security/KeyFactory.java
+++ b/libjava/classpath/java/security/KeyFactory.java
@@ -40,6 +40,7 @@ package java.security;
import gnu.java.security.Engine;
+import java.lang.reflect.InvocationTargetException;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;
@@ -93,26 +94,29 @@ public class KeyFactory
* Returns a new instance of <code>KeyFactory</code> representing the
* specified key factory.
*
- * @param algorithm
- * the name of algorithm to use.
+ * @param algorithm the name of algorithm to use.
* @return a new instance repesenting the desired algorithm.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by any provider.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by any
+ * provider.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static KeyFactory getInstance(String algorithm)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
for (int i = 0; i < p.length; i++)
try
{
return getInstance(algorithm, p[i]);
}
- catch (NoSuchAlgorithmException e)
- {
- // Ignore.
- }
-
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new NoSuchAlgorithmException(algorithm);
}
@@ -120,29 +124,26 @@ public class KeyFactory
* Returns a new instance of <code>KeyFactory</code> representing the
* specified key factory from the specified provider.
*
- * @param algorithm
- * the name of algorithm to use.
- * @param provider
- * the name of the provider to use.
+ * @param algorithm the name of algorithm to use.
+ * @param provider the name of the provider to use.
* @return a new instance repesenting the desired algorithm.
- * @throws IllegalArgumentException
- * if <code>provider</code> is <code>null</code> or is an empty
- * string.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by the named provider.
- * @throws NoSuchProviderException
- * if the named provider was not found.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by the
+ * named provider.
+ * @throws NoSuchProviderException if the named provider was not found.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code> or empty.
*/
public static KeyFactory getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
- if (provider == null || provider.length() == 0)
- throw new IllegalArgumentException("Illegal provider");
-
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
+ provider = provider.trim();
+ if (provider.length() == 0)
+ throw new IllegalArgumentException("provider MUST NOT be empty");
Provider p = Security.getProvider(provider);
if (p == null)
throw new NoSuchProviderException(provider);
-
return getInstance(algorithm, p);
}
@@ -150,38 +151,44 @@ public class KeyFactory
* Returns a new instance of <code>KeyFactory</code> representing the
* specified key factory from the designated {@link Provider}.
*
- * @param algorithm
- * the name of algorithm to use.
- * @param provider
- * the {@link Provider} to use.
+ * @param algorithm the name of algorithm to use.
+ * @param provider the {@link Provider} to use.
* @return a new instance repesenting the desired algorithm.
- * @throws IllegalArgumentException
- * if <code>provider</code> is <code>null</code>.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by {@link Provider}.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by
+ * {@link Provider}.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
* @since 1.4
* @see Provider
*/
public static KeyFactory getInstance(String algorithm, Provider provider)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
-
+ StringBuilder sb = new StringBuilder("KeyFactory for algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- return new KeyFactory((KeyFactorySpi)
- Engine.getInstance(KEY_FACTORY, algorithm, provider),
- provider, algorithm);
+ Object spi = Engine.getInstance(KEY_FACTORY, algorithm, provider);
+ return new KeyFactory((KeyFactorySpi) spi, provider, algorithm);
}
- catch (java.lang.reflect.InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new NoSuchAlgorithmException(algorithm);
- }
+ cause = x;
+ }
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
/**
@@ -248,7 +255,7 @@ public class KeyFactory
* the requested key specification is inappropriate for this key or
* the key is unrecognized.
*/
- public final KeySpec getKeySpec(Key key, Class keySpec)
+ public final <T extends KeySpec> T getKeySpec(Key key, Class<T> keySpec)
throws InvalidKeySpecException
{
return keyFacSpi.engineGetKeySpec(key, keySpec);
diff --git a/libjava/classpath/java/security/KeyFactorySpi.java b/libjava/classpath/java/security/KeyFactorySpi.java
index 1894fad08df..fa56378121b 100644
--- a/libjava/classpath/java/security/KeyFactorySpi.java
+++ b/libjava/classpath/java/security/KeyFactorySpi.java
@@ -113,7 +113,8 @@ public abstract class KeyFactorySpi
* is inappropriate for this key or the key is
* unrecognized.
*/
- protected abstract KeySpec engineGetKeySpec(Key key, Class keySpec)
+ protected abstract <T extends KeySpec> T engineGetKeySpec(Key key,
+ Class<T> keySpec)
throws InvalidKeySpecException;
@@ -121,11 +122,11 @@ public abstract class KeyFactorySpi
* Translates the key from an unknown or untrusted provider
* into a key for this key factory.
*
- * @param the key from an unknown or untrusted provider
+ * @param key key from an unknown or untrusted provider
*
* @return the translated key
*
- * @throws InvalidKeySpecException if the key cannot be
+ * @throws InvalidKeyException if the key cannot be
* processed by this key factory
*/
protected abstract Key engineTranslateKey(Key key)
diff --git a/libjava/classpath/java/security/KeyPairGenerator.java b/libjava/classpath/java/security/KeyPairGenerator.java
index 357d7a75f2f..6974035fd6b 100644
--- a/libjava/classpath/java/security/KeyPairGenerator.java
+++ b/libjava/classpath/java/security/KeyPairGenerator.java
@@ -40,6 +40,7 @@ package java.security;
import gnu.java.security.Engine;
+import java.lang.reflect.InvocationTargetException;
import java.security.spec.AlgorithmParameterSpec;
/**
@@ -90,28 +91,29 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi
* Returns a new instance of <code>KeyPairGenerator</code> which generates
* key-pairs for the specified algorithm.
*
- * @param algorithm
- * the name of the algorithm to use.
+ * @param algorithm the name of the algorithm to use.
* @return a new instance repesenting the desired algorithm.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by any provider.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by any
+ * provider.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static KeyPairGenerator getInstance(String algorithm)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignored.
- }
- }
-
+ try
+ {
+ return getInstance(algorithm, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new NoSuchAlgorithmException(algorithm);
}
@@ -119,23 +121,26 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi
* Returns a new instance of <code>KeyPairGenerator</code> which generates
* key-pairs for the specified algorithm from a named provider.
*
- * @param algorithm
- * the name of the algorithm to use.
- * @param provider
- * the name of a {@link Provider} to use.
+ * @param algorithm the name of the algorithm to use.
+ * @param provider the name of a {@link Provider} to use.
* @return a new instance repesenting the desired algorithm.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by the named provider.
- * @throws NoSuchProviderException
- * if the named provider was not found.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by the
+ * named provider.
+ * @throws NoSuchProviderException if the named provider was not found.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code> or empty.
*/
public static KeyPairGenerator getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
+ provider = provider.trim();
+ if (provider.length() == 0)
+ throw new IllegalArgumentException("provider MUST NOT be empty");
Provider p = Security.getProvider(provider);
if (p == null)
throw new NoSuchProviderException(provider);
-
return getInstance(algorithm, p);
}
@@ -148,10 +153,11 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi
* @param provider
* the {@link Provider} to use.
* @return a new insatnce repesenting the desired algorithm.
- * @throws IllegalArgumentException
- * if <code>provider</code> is <code>null</code>.
* @throws NoSuchAlgorithmException
* if the algorithm is not implemented by the {@link Provider}.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
* @since 1.4
* @see Provider
*/
@@ -159,20 +165,27 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi
Provider provider)
throws NoSuchAlgorithmException
{
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
-
- Object o = null;
+ StringBuilder sb = new StringBuilder("KeyPairGenerator for algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] ");
+ Object o;
try
{
o = Engine.getInstance(KEY_PAIR_GENERATOR, algorithm, provider);
}
- catch (java.lang.reflect.InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ Throwable cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
+ sb.append("could not be created");
+ NoSuchAlgorithmException y = new NoSuchAlgorithmException(sb.toString());
+ y.initCause(cause);
+ throw y;
}
-
- KeyPairGenerator result = null;
+ KeyPairGenerator result;
if (o instanceof KeyPairGenerator)
{
result = (KeyPairGenerator) o;
@@ -180,7 +193,11 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi
}
else if (o instanceof KeyPairGeneratorSpi)
result = new DummyKeyPairGenerator((KeyPairGeneratorSpi) o, algorithm);
-
+ else
+ {
+ sb.append("is of an unexpected Type: ").append(o.getClass().getName());
+ throw new NoSuchAlgorithmException(sb.toString());
+ }
result.provider = provider;
return result;
}
diff --git a/libjava/classpath/java/security/KeyStore.java b/libjava/classpath/java/security/KeyStore.java
index 8681d826590..1d036c31ce2 100644
--- a/libjava/classpath/java/security/KeyStore.java
+++ b/libjava/classpath/java/security/KeyStore.java
@@ -43,6 +43,7 @@ import gnu.java.security.Engine;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.lang.reflect.InvocationTargetException;
import java.security.cert.CertificateException;
import java.util.Date;
import java.util.Enumeration;
@@ -108,105 +109,100 @@ public class KeyStore
this.type = type;
}
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Gets an instance of the KeyStore class representing
- * the specified keystore. If the type is not
- * found then, it throws KeyStoreException.
- *
- * @param type the type of keystore to choose
- * @return a KeyStore repesenting the desired type
- * @throws KeyStoreException if the type of keystore is not implemented
- * by providers or the implementation cannot be instantiated.
+ /**
+ * Returns an instance of a <code>KeyStore</code> representing the specified
+ * type, from the first provider that implements it.
+ *
+ * @param type the type of keystore to create.
+ * @return a <code>KeyStore</code> repesenting the desired type.
+ * @throws KeyStoreException if the designated type of is not implemented by
+ * any provider, or the implementation could not be instantiated.
+ * @throws IllegalArgumentException if <code>type</code> is
+ * <code>null</code> or is an empty string.
*/
public static KeyStore getInstance(String type) throws KeyStoreException
{
Provider[] p = Security.getProviders();
-
+ KeyStoreException lastException = null;
for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(type, p[i]);
- }
- catch (KeyStoreException e)
- {
- // Ignore.
- }
- }
-
+ try
+ {
+ return getInstance(type, p[i]);
+ }
+ catch (KeyStoreException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new KeyStoreException(type);
}
- /**
- * Gets an instance of the KeyStore class representing
- * the specified key store from the specified provider.
- * If the type is not found then, it throws KeyStoreException.
- * If the provider is not found, then it throws
- * NoSuchProviderException.
- *
- * @param type the type of keystore to choose
- * @param provider the provider name
- * @return a KeyStore repesenting the desired type
- * @throws KeyStoreException if the type of keystore is not
- * implemented by the given provider
- * @throws NoSuchProviderException if the provider is not found
- * @throws IllegalArgumentException if the provider string is
- * null or empty
+ /**
+ * Returns an instance of a <code>KeyStore</code> representing the specified
+ * type, from the named provider.
+ *
+ * @param type the type of keystore to create.
+ * @param provider the name of the provider to use.
+ * @return a <code>KeyStore</code> repesenting the desired type.
+ * @throws KeyStoreException if the designated type is not implemented by the
+ * given provider.
+ * @throws NoSuchProviderException if the provider is not found.
+ * @throws IllegalArgumentException if either <code>type</code> or
+ * <code>provider</code> is <code>null</code> or empty.
*/
public static KeyStore getInstance(String type, String provider)
throws KeyStoreException, NoSuchProviderException
{
- if (provider == null || provider.length() == 0)
- throw new IllegalArgumentException("Illegal provider");
-
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
+ provider = provider.trim();
+ if (provider.length() == 0)
+ throw new IllegalArgumentException("provider MUST NOT be empty");
Provider p = Security.getProvider(provider);
if (p == null)
throw new NoSuchProviderException(provider);
-
return getInstance(type, p);
}
- /**
- * Gets an instance of the KeyStore class representing
- * the specified key store from the specified provider.
- * If the type is not found then, it throws KeyStoreException.
- * If the provider is not found, then it throws
- * NoSuchProviderException.
- *
- * @param type the type of keystore to choose
- * @param provider the keystore provider
- * @return a KeyStore repesenting the desired type
- * @throws KeyStoreException if the type of keystore is not
- * implemented by the given provider
- * @throws IllegalArgumentException if the provider object is null
+ /**
+ * Returns an instance of a <code>KeyStore</code> representing the specified
+ * type, from the specified provider.
+ *
+ * @param type the type of keystore to create.
+ * @param provider the provider to use.
+ * @return a <code>KeyStore</code> repesenting the desired type.
+ * @throws KeyStoreException if the designated type is not implemented by the
+ * given provider.
+ * @throws IllegalArgumentException if either <code>type</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>type</code> is an empty string.
* @since 1.4
*/
public static KeyStore getInstance(String type, Provider provider)
- throws KeyStoreException
+ throws KeyStoreException
{
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
+ Throwable cause;
try
{
- return new KeyStore(
- (KeyStoreSpi) Engine.getInstance(KEY_STORE, type, provider),
- provider, type);
+ Object spi = Engine.getInstance(KEY_STORE, type, provider);
+ return new KeyStore((KeyStoreSpi) spi, provider, type);
}
- catch (NoSuchAlgorithmException nsae)
+ catch (NoSuchAlgorithmException x)
{
- throw new KeyStoreException(type);
+ cause = x;
}
- catch (java.lang.reflect.InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- throw new KeyStoreException(type);
+ cause = x.getCause() != null ? x.getCause() : x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new KeyStoreException(type);
+ cause = x;
}
+ KeyStoreException x = new KeyStoreException(type);
+ x.initCause(cause);
+ throw x;
}
/**
@@ -392,7 +388,7 @@ public class KeyStore
@return an Enumeration of the aliases
*/
- public final Enumeration aliases() throws KeyStoreException
+ public final Enumeration<String> aliases() throws KeyStoreException
{
return keyStoreSpi.engineAliases();
}
diff --git a/libjava/classpath/java/security/KeyStoreSpi.java b/libjava/classpath/java/security/KeyStoreSpi.java
index a16008f9960..c8d23166321 100644
--- a/libjava/classpath/java/security/KeyStoreSpi.java
+++ b/libjava/classpath/java/security/KeyStoreSpi.java
@@ -187,7 +187,7 @@ public abstract class KeyStoreSpi
*
* @return an Enumeration of the aliases
*/
- public abstract Enumeration engineAliases();
+ public abstract Enumeration<String> engineAliases();
/**
* Determines if the keystore contains the specified alias.
diff --git a/libjava/classpath/java/security/MessageDigest.java b/libjava/classpath/java/security/MessageDigest.java
index b817759f547..0f8e934e5e9 100644
--- a/libjava/classpath/java/security/MessageDigest.java
+++ b/libjava/classpath/java/security/MessageDigest.java
@@ -38,6 +38,9 @@ exception statement from your version. */
package java.security;
import gnu.java.security.Engine;
+import java.nio.ByteBuffer;
+
+import java.lang.reflect.InvocationTargetException;
/**
* Message digests are secure one-way hash functions that take arbitrary-sized
@@ -72,28 +75,29 @@ public abstract class MessageDigest extends MessageDigestSpi
* Returns a new instance of <code>MessageDigest</code> representing the
* specified algorithm.
*
- * @param algorithm
- * the name of the digest algorithm to use.
+ * @param algorithm the name of the digest algorithm to use.
* @return a new instance representing the desired algorithm.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by any provider.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by any
+ * provider.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static MessageDigest getInstance(String algorithm)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException ignored)
- {
- // Ignore.
- }
- }
-
+ try
+ {
+ return getInstance(algorithm, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new NoSuchAlgorithmException(algorithm);
}
@@ -101,29 +105,26 @@ public abstract class MessageDigest extends MessageDigestSpi
* Returns a new instance of <code>MessageDigest</code> representing the
* specified algorithm from a named provider.
*
- * @param algorithm
- * the name of the digest algorithm to use.
- * @param provider
- * the name of the provider to use.
+ * @param algorithm the name of the digest algorithm to use.
+ * @param provider the name of the provider to use.
* @return a new instance representing the desired algorithm.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by the named provider.
- * @throws NoSuchProviderException
- * if the named provider was not found.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by the
+ * named provider.
+ * @throws NoSuchProviderException if the named provider was not found.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code> or empty.
*/
public static MessageDigest getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
- if (provider != null)
- provider = provider.trim();
-
- if (provider == null || provider.length() == 0)
- throw new IllegalArgumentException("Illegal provider");
-
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
+ provider = provider.trim();
+ if (provider.length() == 0)
+ throw new IllegalArgumentException("provider MUST NOT be empty");
Provider p = Security.getProvider(provider);
if (p == null)
throw new NoSuchProviderException(provider);
-
return getInstance(algorithm, p);
}
@@ -131,39 +132,43 @@ public abstract class MessageDigest extends MessageDigestSpi
* Returns a new instance of <code>MessageDigest</code> representing the
* specified algorithm from a designated {@link Provider}.
*
- * @param algorithm
- * the name of the digest algorithm to use.
- * @param provider
- * the {@link Provider} to use.
+ * @param algorithm the name of the digest algorithm to use.
+ * @param provider the {@link Provider} to use.
* @return a new instance representing the desired algorithm.
- * @throws IllegalArgumentException
- * if <code>provider</code> is <code>null</code>.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by {@link Provider}.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by
+ * {@link Provider}.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
* @since 1.4
* @see Provider
*/
public static MessageDigest getInstance(String algorithm, Provider provider)
throws NoSuchAlgorithmException
{
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
-
- MessageDigest result = null;
- Object o = null;
+ StringBuilder sb = new StringBuilder("MessageDigest for algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] ");
+ Object o;
try
{
o = Engine.getInstance(MESSAGE_DIGEST, algorithm, provider);
}
- catch (java.lang.reflect.InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ Throwable cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
+ sb.append("could not be created");
+ NoSuchAlgorithmException y = new NoSuchAlgorithmException(sb.toString());
+ y.initCause(cause);
+ throw y;
}
-
+ MessageDigest result;
if (o instanceof MessageDigestSpi)
- {
- result = new DummyMessageDigest((MessageDigestSpi) o, algorithm);
- }
+ result = new DummyMessageDigest((MessageDigestSpi) o, algorithm);
else if (o instanceof MessageDigest)
{
result = (MessageDigest) o;
@@ -171,7 +176,8 @@ public abstract class MessageDigest extends MessageDigestSpi
}
else
{
- throw new NoSuchAlgorithmException(algorithm);
+ sb.append("is of an unexpected Type: ").append(o.getClass().getName());
+ throw new NoSuchAlgorithmException(sb.toString());
}
result.provider = provider;
return result;
@@ -224,6 +230,17 @@ public abstract class MessageDigest extends MessageDigestSpi
}
/**
+ * Updates the digest with the remaining bytes of a buffer.
+ *
+ * @param input The input byte buffer.
+ * @since 1.5
+ */
+ public void update (ByteBuffer input)
+ {
+ engineUpdate (input);
+ }
+
+ /**
* Computes the final digest of the stored data.
*
* @return a byte array representing the message digest.
diff --git a/libjava/classpath/java/security/MessageDigestSpi.java b/libjava/classpath/java/security/MessageDigestSpi.java
index df3bd3ead02..6615b1d93b0 100644
--- a/libjava/classpath/java/security/MessageDigestSpi.java
+++ b/libjava/classpath/java/security/MessageDigestSpi.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package java.security;
+import java.nio.ByteBuffer;
+
/**
This is the Service Provider Interface (SPI) for MessageDigest
class in java.security. It provides the back end functionality
@@ -98,6 +100,23 @@ public abstract class MessageDigestSpi
protected abstract void engineUpdate(byte[]input, int offset, int len);
/**
+ * Updates this digest with the remaining bytes of a byte buffer.
+ *
+ * @param input The input buffer.
+ * @since 1.5
+ */
+ protected void engineUpdate (ByteBuffer input)
+ {
+ byte[] buf = new byte[1024];
+ while (input.hasRemaining())
+ {
+ int n = Math.min(input.remaining(), buf.length);
+ input.get (buf, 0, n);
+ engineUpdate (buf, 0, n);
+ }
+ }
+
+ /**
Computes the final digest of the stored bytes and returns
them. It performs any necessary padding. The message digest
should reset sensitive data after performing the digest.
diff --git a/libjava/classpath/java/security/PermissionCollection.java b/libjava/classpath/java/security/PermissionCollection.java
index 4e8ffe57948..c5849830ad7 100644
--- a/libjava/classpath/java/security/PermissionCollection.java
+++ b/libjava/classpath/java/security/PermissionCollection.java
@@ -120,7 +120,7 @@ public abstract class PermissionCollection implements Serializable
*
* @return an <code>Enumeration</code> of this collection's objects
*/
- public abstract Enumeration elements();
+ public abstract Enumeration<Permission> elements();
/**
* This method sets this <code>PermissionCollection</code> object to be
@@ -159,7 +159,7 @@ public abstract class PermissionCollection implements Serializable
StringBuffer sb = new StringBuffer(super.toString());
sb.append(" (\n");
- Enumeration e = elements();
+ Enumeration<Permission> e = elements();
while (e.hasMoreElements())
sb.append(' ').append(e.nextElement()).append('\n');
return sb.append(")\n").toString();
diff --git a/libjava/classpath/java/security/Permissions.java b/libjava/classpath/java/security/Permissions.java
index e3fd06970ab..56f5ad8f5a0 100644
--- a/libjava/classpath/java/security/Permissions.java
+++ b/libjava/classpath/java/security/Permissions.java
@@ -150,7 +150,7 @@ public final class Permissions extends PermissionCollection
*
* @return an <code>Enumeration</code> of this collection's elements
*/
- public Enumeration elements()
+ public Enumeration<Permission> elements()
{
return new Enumeration()
{
diff --git a/libjava/classpath/java/security/PrivilegedAction.java b/libjava/classpath/java/security/PrivilegedAction.java
index c3a41346f9c..1a51eaade78 100644
--- a/libjava/classpath/java/security/PrivilegedAction.java
+++ b/libjava/classpath/java/security/PrivilegedAction.java
@@ -47,9 +47,9 @@ package java.security;
* @see AccessController
* @see PrivilegedExceptionAction
* @since 1.1
- * @status updated to 1.4
+ * @status updated to 1.5
*/
-public interface PrivilegedAction
+public interface PrivilegedAction<T>
{
/**
* This method performs an operation that requires higher privileges to
@@ -60,5 +60,5 @@ public interface PrivilegedAction
* @see AccessController#doPrivileged(PrivilegedAction)
* @see AccessController#doPrivileged(PrivilegedAction, AccessControlContext)
*/
- Object run();
+ T run();
} // interface PrivilegedAction
diff --git a/libjava/classpath/java/security/PrivilegedExceptionAction.java b/libjava/classpath/java/security/PrivilegedExceptionAction.java
index d3d0478fd48..351438e0be2 100644
--- a/libjava/classpath/java/security/PrivilegedExceptionAction.java
+++ b/libjava/classpath/java/security/PrivilegedExceptionAction.java
@@ -46,9 +46,9 @@ package java.security;
*
* @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.1
- * @status updated to 1.4
+ * @status updated to 1.5
*/
-public interface PrivilegedExceptionAction
+public interface PrivilegedExceptionAction<T>
{
/**
* This method performs an operation that requires higher privileges to
@@ -61,5 +61,5 @@ public interface PrivilegedExceptionAction
* @see AccessController#doPrivileged(PrivilegedExceptionAction,
* AccessControlContext)
*/
- Object run() throws Exception;
+ T run() throws Exception;
} // interface PrivilegedExceptionAction
diff --git a/libjava/classpath/java/security/SecureClassLoader.java b/libjava/classpath/java/security/SecureClassLoader.java
index 9d1fac79749..dfc1758b52f 100644
--- a/libjava/classpath/java/security/SecureClassLoader.java
+++ b/libjava/classpath/java/security/SecureClassLoader.java
@@ -1,5 +1,5 @@
/* SecureClassLoader.java --- A Secure Class Loader
- Copyright (C) 1999, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,6 +37,11 @@ exception statement from your version. */
package java.security;
+import java.util.WeakHashMap;
+
+import java.nio.ByteBuffer;
+import java.util.HashMap;
+
/**
* A Secure Class Loader for loading classes with additional
* support for specifying code source and permissions when
@@ -48,21 +53,16 @@ package java.security;
*/
public class SecureClassLoader extends ClassLoader
{
- java.util.WeakHashMap protectionDomainCache = new java.util.WeakHashMap();
+ private final HashMap<CodeSource,ProtectionDomain> protectionDomainCache
+ = new HashMap<CodeSource, ProtectionDomain>();
protected SecureClassLoader(ClassLoader parent)
{
super(parent);
- SecurityManager sm = System.getSecurityManager();
- if(sm != null)
- sm.checkCreateClassLoader();
}
protected SecureClassLoader()
{
- SecurityManager sm = System.getSecurityManager();
- if(sm != null)
- sm.checkCreateClassLoader();
}
/**
@@ -79,13 +79,38 @@ public class SecureClassLoader extends ClassLoader
*
* @exception ClassFormatError if the byte array is not in proper classfile format.
*/
- protected final Class defineClass(String name, byte[] b, int off, int len,
+ protected final Class<?> defineClass(String name, byte[] b, int off, int len,
CodeSource cs)
{
+ return super.defineClass(name, b, off, len, getProtectionDomain(cs));
+ }
+
+ /**
+ * Creates a class using an ByteBuffer and a
+ * CodeSource.
+ *
+ * @param name the name to give the class. null if unknown.
+ * @param b the data representing the classfile, in classfile format.
+ * @param cs the CodeSource for the class or null when unknown.
+ *
+ * @return the class that was defined and optional CodeSource.
+ *
+ * @exception ClassFormatError if the byte array is not in proper classfile format.
+ *
+ * @since 1.5
+ */
+ protected final Class defineClass(String name, ByteBuffer b, CodeSource cs)
+ {
+ return super.defineClass(name, b, getProtectionDomain(cs));
+ }
+
+ /* Lookup or create a protection domain for the CodeSource,
+ * if CodeSource is null it will return null. */
+ private ProtectionDomain getProtectionDomain(CodeSource cs)
+ {
+ ProtectionDomain protectionDomain = null;
if (cs != null)
{
- ProtectionDomain protectionDomain;
-
synchronized (protectionDomainCache)
{
protectionDomain = (ProtectionDomain)protectionDomainCache.get(cs);
@@ -105,10 +130,8 @@ public class SecureClassLoader extends ClassLoader
protectionDomain = domain;
}
}
- return super.defineClass(name, b, off, len, protectionDomain);
- }
- else
- return super.defineClass(name, b, off, len);
+ }
+ return protectionDomain;
}
/**
@@ -117,7 +140,7 @@ public class SecureClassLoader extends ClassLoader
* java.security.Policy.getPermissions.
*
* This method is called by defineClass that takes a CodeSource
- * arguement to build a proper ProtectionDomain for the class
+ * argument to build a proper ProtectionDomain for the class
* being defined.
*/
protected PermissionCollection getPermissions(CodeSource cs)
diff --git a/libjava/classpath/java/security/SecureRandom.java b/libjava/classpath/java/security/SecureRandom.java
index c66963e8f96..005f4670efc 100644
--- a/libjava/classpath/java/security/SecureRandom.java
+++ b/libjava/classpath/java/security/SecureRandom.java
@@ -45,6 +45,7 @@ import gnu.java.security.jce.prng.Sha160RandomSpi;
import java.io.IOException;
import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Enumeration;
@@ -187,101 +188,106 @@ public class SecureRandom extends Random
this.algorithm = algorithm;
}
- // Class methods.
- // ------------------------------------------------------------------------
-
/**
- * Returns an instance of a SecureRandom. It creates the class from
- * the first provider that implements it.
- *
+ * Returns an instance of a <code>SecureRandom</code> from the first provider
+ * that implements it.
+ *
* @param algorithm The algorithm name.
- * @return A new SecureRandom implementing the given algorithm.
- * @throws NoSuchAlgorithmException If no installed provider implements
- * the given algorithm.
+ * @return A new <code>SecureRandom</code> implementing the given algorithm.
+ * @throws NoSuchAlgorithmException If no installed provider implements the
+ * given algorithm.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static SecureRandom getInstance(String algorithm)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
Provider[] p = Security.getProviders();
-
+ NoSuchAlgorithmException lastException = null;
for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignore.
- }
- }
-
- // None found.
+ try
+ {
+ return getInstance(algorithm, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new NoSuchAlgorithmException(algorithm);
}
/**
- * Returns an instance of a SecureRandom. It creates the class
- * for the specified algorithm from the named provider.
- *
+ * Returns an instance of a <code>SecureRandom</code> for the specified
+ * algorithm from the named provider.
+ *
* @param algorithm The algorithm name.
- * @param provider The provider name.
- * @return A new SecureRandom implementing the chosen algorithm.
+ * @param provider The provider name.
+ * @return A new <code>SecureRandom</code> implementing the chosen
+ * algorithm.
* @throws NoSuchAlgorithmException If the named provider does not implement
- * the algorithm, or if the implementation cannot be
- * instantiated.
- * @throws NoSuchProviderException If no provider named
- * <code>provider</code> is currently installed.
- * @throws IllegalArgumentException If <code>provider</code> is null
- * or is empty.
+ * the algorithm, or if the implementation cannot be instantiated.
+ * @throws NoSuchProviderException If no provider named <code>provider</code>
+ * is currently installed.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code> or empty.
*/
public static SecureRandom getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
- if (provider == null || provider.length() == 0)
- throw new IllegalArgumentException("Illegal provider");
-
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
+ provider = provider.trim();
+ if (provider.length() == 0)
+ throw new IllegalArgumentException("provider MUST NOT be empty");
Provider p = Security.getProvider(provider);
if (p == null)
throw new NoSuchProviderException(provider);
-
return getInstance(algorithm, p);
}
/**
- * Returns an instance of a SecureRandom. It creates the class for
- * the specified algorithm from the given provider.
- *
- * @param algorithm The SecureRandom algorithm to create.
- * @param provider The provider to get the instance from.
- * @throws NoSuchAlgorithmException If the algorithm cannot be found, or
- * if the class cannot be instantiated.
- * @throws IllegalArgumentException If <code>provider</code> is null.
+ * Returns an instance of a <code>SecureRandom</code> for the specified
+ * algorithm from the given provider.
+ *
+ * @param algorithm The <code>SecureRandom</code> algorithm to create.
+ * @param provider The provider to use.
+ * @throws NoSuchAlgorithmException If the algorithm cannot be found, or if
+ * the class cannot be instantiated.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
public static SecureRandom getInstance(String algorithm, Provider provider)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
+ StringBuilder sb = new StringBuilder("SecureRandom for algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- return new SecureRandom((SecureRandomSpi)
- Engine.getInstance(SECURE_RANDOM, algorithm, provider),
- provider, algorithm);
+ Object spi = Engine.getInstance(SECURE_RANDOM, algorithm, provider);
+ return new SecureRandom((SecureRandomSpi) spi, provider, algorithm);
}
- catch (java.lang.reflect.InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
- // Instance methods.
- // ------------------------------------------------------------------------
-
/**
Returns the provider being used by the current SecureRandom class.
diff --git a/libjava/classpath/java/security/Security.java b/libjava/classpath/java/security/Security.java
index d99c451499a..d3d2c1ebcf9 100644
--- a/libjava/classpath/java/security/Security.java
+++ b/libjava/classpath/java/security/Security.java
@@ -138,7 +138,7 @@ public final class Security
Exception exception = null;
try
{
- ClassLoader sys = ClassLoader.getSystemClassLoader();
+ ClassLoader sys = ClassLoader.getSystemClassLoader();
providers.addElement(Class.forName(name, true, sys).newInstance());
}
catch (ClassNotFoundException x)
@@ -408,9 +408,9 @@ public final class Security
* {@link Provider}s.
* @since 1.4
*/
- public static Set getAlgorithms(String serviceName)
+ public static Set<String> getAlgorithms(String serviceName)
{
- HashSet result = new HashSet();
+ HashSet<String> result = new HashSet<String>();
if (serviceName == null || serviceName.length() == 0)
return result;
@@ -541,7 +541,7 @@ public final class Security
* {@link Map}'s <i>keys</i>.
* @see #getProviders(String)
*/
- public static Provider[] getProviders(Map filter)
+ public static Provider[] getProviders(Map<String,String> filter)
{
if (providers == null || providers.isEmpty())
return null;
@@ -549,7 +549,7 @@ public final class Security
if (filter == null)
return getProviders();
- Set querries = filter.keySet();
+ Set<String> querries = filter.keySet();
if (querries == null || querries.isEmpty())
return getProviders();
@@ -572,7 +572,7 @@ public final class Security
throw new InvalidParameterException(
"missing dot in '" + String.valueOf(querry)+"'");
- value = (String) filter.get(querry);
+ value = filter.get(querry);
// deconstruct querry into [service, algorithm, attribute]
if (value == null || value.trim().length() == 0) // <service>.<algorithm>
{
diff --git a/libjava/classpath/java/security/Signature.java b/libjava/classpath/java/security/Signature.java
index 845a77a8b8f..1245707f7af 100644
--- a/libjava/classpath/java/security/Signature.java
+++ b/libjava/classpath/java/security/Signature.java
@@ -40,6 +40,8 @@ package java.security;
import gnu.java.security.Engine;
+import java.lang.reflect.InvocationTargetException;
+import java.nio.ByteBuffer;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.security.spec.AlgorithmParameterSpec;
@@ -127,28 +129,29 @@ public abstract class Signature extends SignatureSpi
* Returns an instance of <code>Signature</code> representing the specified
* signature.
*
- * @param algorithm
- * the algorithm to use.
+ * @param algorithm the algorithm to use.
* @return a new instance repesenting the desired algorithm.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by any provider.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by any
+ * provider.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static Signature getInstance(String algorithm)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignored.
- }
- }
-
+ try
+ {
+ return getInstance(algorithm, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new NoSuchAlgorithmException(algorithm);
}
@@ -156,28 +159,26 @@ public abstract class Signature extends SignatureSpi
* Returns an instance of <code>Signature</code> representing the specified
* signature from the named provider.
*
- * @param algorithm
- * the algorithm to use.
- * @param provider
- * the name of the provider to use.
+ * @param algorithm the algorithm to use.
+ * @param provider the name of the provider to use.
* @return a new instance repesenting the desired algorithm.
- * @throws IllegalArgumentException if <code>provider</code> is
- * <code>null</code> or is an empty string.
- * @throws NoSuchProviderException
- * if the named provider was not found.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by the named provider.
+ * @throws NoSuchProviderException if the named provider was not found.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by the
+ * named provider.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code> or empty.
*/
public static Signature getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
- if (provider == null || provider.length() == 0)
- throw new IllegalArgumentException("Illegal provider");
-
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
+ provider = provider.trim();
+ if (provider.length() == 0)
+ throw new IllegalArgumentException("provider MUST NOT be empty");
Provider p = Security.getProvider(provider);
if (p == null)
throw new NoSuchProviderException(provider);
-
return getInstance(algorithm, p);
}
@@ -185,35 +186,41 @@ public abstract class Signature extends SignatureSpi
* Returns an instance of <code>Signature</code> representing the specified
* signature from the specified {@link Provider}.
*
- * @param algorithm
- * the algorithm to use.
- * @param provider
- * the {@link Provider} to use.
+ * @param algorithm the algorithm to use.
+ * @param provider the {@link Provider} to use.
* @return a new instance repesenting the desired algorithm.
- * @throws NoSuchAlgorithmException
- * if the algorithm is not implemented by the {@link Provider}.
+ * @throws NoSuchAlgorithmException if the algorithm is not implemented by the
+ * {@link Provider}.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
public static Signature getInstance(String algorithm, Provider provider)
throws NoSuchAlgorithmException
{
- if (provider == null)
- throw new IllegalArgumentException("Illegal provider");
-
- Signature result = null;
- Object o = null;
+ StringBuilder sb = new StringBuilder("Signature algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] ");
+ Object o;
try
{
o = Engine.getInstance(SIGNATURE, algorithm, provider);
}
- catch (java.lang.reflect.InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ Throwable cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
+ sb.append("could not be created");
+ NoSuchAlgorithmException y = new NoSuchAlgorithmException(sb.toString());
+ y.initCause(cause);
+ throw y;
}
-
+ Signature result;
if (o instanceof SignatureSpi)
- {
- result = new DummySignature((SignatureSpi) o, algorithm);
- }
+ result = new DummySignature((SignatureSpi) o, algorithm);
else if (o instanceof Signature)
{
result = (Signature) o;
@@ -221,7 +228,8 @@ public abstract class Signature extends SignatureSpi
}
else
{
- throw new NoSuchAlgorithmException(algorithm);
+ sb.append("is of an unexpected Type: ").append(o.getClass().getName());
+ throw new NoSuchAlgorithmException(sb.toString());
}
result.provider = provider;
return result;
@@ -467,6 +475,22 @@ public abstract class Signature extends SignatureSpi
else
throw new SignatureException();
}
+
+ /**
+ * Update this signature with the {@link java.nio.Buffer#remaining()}
+ * bytes of the input buffer.
+ *
+ * @param input The input buffer.
+ * @throws SignatureException If this instance was not properly
+ * initialized.
+ */
+ public final void update(ByteBuffer input) throws SignatureException
+ {
+ if (state != UNINITIALIZED)
+ engineUpdate(input);
+ else
+ throw new SignatureException("not initialized");
+ }
/**
* Returns the name of the algorithm currently used. The names of algorithms
diff --git a/libjava/classpath/java/security/SignatureSpi.java b/libjava/classpath/java/security/SignatureSpi.java
index 25d49dedd43..3b46815eca9 100644
--- a/libjava/classpath/java/security/SignatureSpi.java
+++ b/libjava/classpath/java/security/SignatureSpi.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package java.security;
+import java.nio.ByteBuffer;
import java.security.spec.AlgorithmParameterSpec;
/**
@@ -131,6 +132,24 @@ public abstract class SignatureSpi
throws SignatureException;
/**
+ * Update this signature with the {@link java.nio.Buffer#remaining()}
+ * bytes of the given buffer.
+ *
+ * @param input The input buffer.
+ * @throws SignatureException
+ */
+ protected void engineUpdate(ByteBuffer input) throws SignatureException
+ {
+ byte[] buf = new byte[4096];
+ while (input.hasRemaining())
+ {
+ int l = Math.min(input.remaining(), buf.length);
+ input.get(buf, 0, l);
+ engineUpdate(buf, 0, l);
+ }
+ }
+
+ /**
* Returns the signature bytes of all the data fed to this instance. The
* format of the output depends on the underlying signature algorithm.
*
diff --git a/libjava/classpath/java/security/acl/Acl.java b/libjava/classpath/java/security/acl/Acl.java
index ff139afd6c0..6a3f7d52a87 100644
--- a/libjava/classpath/java/security/acl/Acl.java
+++ b/libjava/classpath/java/security/acl/Acl.java
@@ -117,7 +117,7 @@ public interface Acl extends Owner
*
* @return An enumeration of the ACL entries
*/
- Enumeration entries();
+ Enumeration<AclEntry> entries();
/**
* This method tests whether or not the specified <code>Principal</code>
@@ -142,7 +142,7 @@ public interface Acl extends Owner
*
* @return A list of permissions for the <code>Principal</code>.
*/
- Enumeration getPermissions(Principal user);
+ Enumeration<Permission> getPermissions(Principal user);
/**
* This method returns the ACL as a <code>String</code>
diff --git a/libjava/classpath/java/security/acl/AclEntry.java b/libjava/classpath/java/security/acl/AclEntry.java
index 7b1bcf54db9..ea906f184d8 100644
--- a/libjava/classpath/java/security/acl/AclEntry.java
+++ b/libjava/classpath/java/security/acl/AclEntry.java
@@ -94,7 +94,7 @@ public interface AclEntry extends Cloneable
/**
* This method adds the specified permission to this ACL entry.
*
- * @param perm The <code>Permission</code> to add
+ * @param permission The <code>Permission</code> to add
*
* @return <code>true</code> if the permission was added or <code>false</code> if it was already set for this entry
*/
@@ -113,7 +113,7 @@ public interface AclEntry extends Cloneable
* This method tests whether or not the specified permission is associated
* with this ACL entry.
*
- * @param perm The <code>Permission</code> to test
+ * @param permission The <code>Permission</code> to test
*
* @return <code>true</code> if this permission is associated with this entry or <code>false</code> otherwise
*/
@@ -125,7 +125,7 @@ public interface AclEntry extends Cloneable
*
* @return A list of permissions for this ACL entry
*/
- Enumeration permissions();
+ Enumeration<Permission> permissions();
/**
* This method returns this object as a <code>String</code>.
diff --git a/libjava/classpath/java/security/acl/Group.java b/libjava/classpath/java/security/acl/Group.java
index 3ffdf15a4ce..ed6d56a572e 100644
--- a/libjava/classpath/java/security/acl/Group.java
+++ b/libjava/classpath/java/security/acl/Group.java
@@ -74,7 +74,7 @@ public interface Group extends Principal
* This method tests whether or not a given <code>Principal</code> is a
* member of this group.
*
- * @param user The <code>Principal</code> to test for membership
+ * @param member The <code>Principal</code> to test for membership
*
* @return <code>true</code> if the user is member, <code>false</code> otherwise
*/
@@ -86,5 +86,5 @@ public interface Group extends Principal
*
* @return The list of all members of the group
*/
- Enumeration members();
+ Enumeration<? extends Principal> members();
}
diff --git a/libjava/classpath/java/security/cert/CertPath.java b/libjava/classpath/java/security/cert/CertPath.java
index e818763aab4..781eb3e2776 100644
--- a/libjava/classpath/java/security/cert/CertPath.java
+++ b/libjava/classpath/java/security/cert/CertPath.java
@@ -161,7 +161,7 @@ public abstract class CertPath implements Serializable
*
* @return the iterator of supported encodings in the path
*/
- public abstract Iterator getEncodings();
+ public abstract Iterator<String> getEncodings();
/**
* Compares this path to another for semantic equality. To be equal, both
@@ -226,7 +226,7 @@ public abstract class CertPath implements Serializable
*
* @return the list of certificates, non-null but possibly empty
*/
- public abstract List getCertificates();
+ public abstract List<? extends Certificate> getCertificates();
/**
* Serializes the path in its encoded form, to ensure reserialization with
diff --git a/libjava/classpath/java/security/cert/CertPathBuilder.java b/libjava/classpath/java/security/cert/CertPathBuilder.java
index f6965205f53..519ed2b6c52 100644
--- a/libjava/classpath/java/security/cert/CertPathBuilder.java
+++ b/libjava/classpath/java/security/cert/CertPathBuilder.java
@@ -40,6 +40,7 @@ package java.security.cert;
import gnu.java.security.Engine;
+import java.lang.reflect.InvocationTargetException;
import java.security.InvalidAlgorithmParameterException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
@@ -111,50 +112,54 @@ public class CertPathBuilder
}
/**
- * Get an instance of a named CertPathBuilder, from the first provider
- * that implements it.
- *
- * @param algorithm The name of the CertPathBuilder to create.
+ * Returns an instance of a named <code>CertPathBuilder</code> from the
+ * first provider that implements it.
+ *
+ * @param algorithm The name of the <code>CertPathBuilder</code> to create.
* @return The new instance.
- * @throws NoSuchAlgorithmException If no installed provider
- * implements the named algorithm.
+ * @throws NoSuchAlgorithmException If no installed provider implements the
+ * named algorithm.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static CertPathBuilder getInstance(String algorithm)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
Provider[] p = Security.getProviders();
-
+ NoSuchAlgorithmException lastException = null;
for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignored.
- }
- }
-
+ try
+ {
+ return getInstance(algorithm, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new NoSuchAlgorithmException(algorithm);
}
/**
- * Get an instance of a named CertPathBuilder from the named
+ * Returns an instance of a named <code>CertPathBuilder</code> from a named
* provider.
- *
- * @param algorithm The name of the CertPathBuilder to create.
- * @param provider The name of the provider from which to get the
- * implementation.
+ *
+ * @param algorithm The name of the <code>CertPathBuilder</code> to create.
+ * @param provider The name of the provider to use.
* @return The new instance.
- * @throws NoSuchAlgorithmException If no installed provider
- * implements the named algorithm.
- * @throws NoSuchProviderException If the named provider does not
- * exist.
+ * @throws NoSuchAlgorithmException If no installed provider implements the
+ * named algorithm.
+ * @throws NoSuchProviderException If the named provider does not exist.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
public static CertPathBuilder getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
Provider p = Security.getProvider(provider);
if (p == null)
throw new NoSuchProviderException(provider);
@@ -162,41 +167,47 @@ public class CertPathBuilder
}
/**
- * Get an instance of a named CertPathBuilder from the specified
- * provider.
- *
- * @param algorithm The name of the CertPathBuilder to create.
- * @param provider The provider from which to get the implementation.
+ * Returns an instance of a named <code>CertPathBuilder</code> from the
+ * specified provider.
+ *
+ * @param algorithm The name of the <code>CertPathBuilder</code> to create.
+ * @param provider The provider to use.
* @return The new instance.
- * @throws NoSuchAlgorithmException If no installed provider
- * implements the named algorithm.
- * @throws IllegalArgumentException If <i>provider</i> in
- * <tt>null</tt>.
+ * @throws NoSuchAlgorithmException If no installed provider implements the
+ * named algorithm.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
public static CertPathBuilder getInstance(String algorithm, Provider provider)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
- if (provider == null)
- throw new IllegalArgumentException("null provider");
+ StringBuilder sb = new StringBuilder("CertPathBuilder for algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- return new CertPathBuilder((CertPathBuilderSpi)
- Engine.getInstance(CERT_PATH_BUILDER, algorithm, provider),
- provider, algorithm);
+ Object spi = Engine.getInstance(CERT_PATH_BUILDER, algorithm, provider);
+ return new CertPathBuilder((CertPathBuilderSpi) spi, provider, algorithm);
}
- catch (java.lang.reflect.InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
- // Instance methods.
- // ------------------------------------------------------------------------
-
/**
* Return the name of this CertPathBuilder algorithm.
*
diff --git a/libjava/classpath/java/security/cert/CertPathValidator.java b/libjava/classpath/java/security/cert/CertPathValidator.java
index 5fed19e9a78..bf7c9746e24 100644
--- a/libjava/classpath/java/security/cert/CertPathValidator.java
+++ b/libjava/classpath/java/security/cert/CertPathValidator.java
@@ -40,6 +40,7 @@ package java.security.cert;
import gnu.java.security.Engine;
+import java.lang.reflect.InvocationTargetException;
import java.security.AccessController;
import java.security.InvalidAlgorithmParameterException;
import java.security.NoSuchAlgorithmException;
@@ -124,91 +125,103 @@ public class CertPathValidator {
}
/**
- * Get an instance of the given validator from the first provider that
+ * Returns an instance of the given validator from the first provider that
* implements it.
- *
+ *
* @param algorithm The name of the algorithm to get.
* @return The new instance.
- * @throws NoSuchAlgorithmException If no installed provider
- * implements the requested algorithm.
+ * @throws NoSuchAlgorithmException If no installed provider implements the
+ * requested algorithm.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static CertPathValidator getInstance(String algorithm)
throws NoSuchAlgorithmException
{
Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(algorithm, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignored.
- }
- }
+ try
+ {
+ return getInstance(algorithm, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new NoSuchAlgorithmException(algorithm);
}
/**
- * Get an instance of the given validator from the named provider.
- *
+ * Returns an instance of the given validator from the named provider.
+ *
* @param algorithm The name of the algorithm to get.
- * @param provider The name of the provider from which to get the
- * implementation.
+ * @param provider The name of the provider from which to get the
+ * implementation.
* @return The new instance.
- * @throws NoSuchAlgorithmException If the named provider does not
- * implement the algorithm.
- * @throws NoSuchProviderException If no provider named
- * <i>provider</i> is installed.
+ * @throws NoSuchAlgorithmException If the named provider does not implement
+ * the algorithm.
+ * @throws NoSuchProviderException If no provider named <i>provider</i> is
+ * installed.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
- public static CertPathValidator getInstance(String algorithm,
- String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ public static CertPathValidator getInstance(String algorithm, String provider)
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
Provider p = Security.getProvider(provider);
if (p == null)
throw new NoSuchProviderException(provider);
-
return getInstance(algorithm, p);
}
/**
- * Get an instance of the given validator from the given provider.
- *
+ * Returns an instance of the given validator from the given provider.
+ *
* @param algorithm The name of the algorithm to get.
- * @param provider The provider from which to get the implementation.
+ * @param provider The provider from which to get the implementation.
* @return The new instance.
- * @throws NoSuchAlgorithmException If the provider does not implement
- * the algorithm.
- * @throws IllegalArgumentException If <i>provider</i> is null.
+ * @throws NoSuchAlgorithmException If the provider does not implement the
+ * algorithm.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
public static CertPathValidator getInstance(String algorithm,
Provider provider)
throws NoSuchAlgorithmException
{
- if (provider == null)
- throw new IllegalArgumentException("null provider");
-
+ StringBuilder sb = new StringBuilder("CertPathValidator for algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- return new CertPathValidator((CertPathValidatorSpi)
- Engine.getInstance(CERT_PATH_VALIDATOR, algorithm, provider),
- provider, algorithm);
+ Object spi = Engine.getInstance(CERT_PATH_VALIDATOR, algorithm, provider);
+ return new CertPathValidator((CertPathValidatorSpi) spi, provider, algorithm);
}
- catch (java.lang.reflect.InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
- // Instance methods.
- // ------------------------------------------------------------------------
-
/**
* Return the name of this validator.
*
diff --git a/libjava/classpath/java/security/cert/CertStore.java b/libjava/classpath/java/security/cert/CertStore.java
index 864da868f19..a27086562e6 100644
--- a/libjava/classpath/java/security/cert/CertStore.java
+++ b/libjava/classpath/java/security/cert/CertStore.java
@@ -40,6 +40,7 @@ package java.security.cert;
import gnu.java.security.Engine;
+import java.lang.reflect.InvocationTargetException;
import java.security.InvalidAlgorithmParameterException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
@@ -52,7 +53,7 @@ import java.util.Collection;
* A CertStore is a read-only repository for certificates and
* certificate revocation lists.
*
- * @since JDK 1.4
+ * @since 1.4
*/
public class CertStore
{
@@ -123,59 +124,63 @@ public class CertStore
}
/**
- * Get an instance of the given certificate store from the first
+ * Returns an instance of the given certificate store type from the first
* installed provider.
- *
- * @param type The type of CertStore to create.
- * @param params The parameters to initialize this cert store with.
+ *
+ * @param type The type of <code>CertStore</code> to create.
+ * @param params The parameters to initialize this cert store with.
* @return The new instance.
- * @throws InvalidAlgorithmParameterException If the instance rejects
- * the specified parameters.
- * @throws NoSuchAlgorithmException If no installed provider
- * implements the specified CertStore.
- * @throws IllegalArgumentException If <i>provider</i> is null.
+ * @throws InvalidAlgorithmParameterException If the instance rejects the
+ * specified parameters.
+ * @throws NoSuchAlgorithmException If no installed provider implements the
+ * specified CertStore.
+ * @throws IllegalArgumentException if <code>type</code> is
+ * <code>null</code> or is an empty string.
*/
public static CertStore getInstance(String type, CertStoreParameters params)
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException
{
Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(type, params, p[i]);
- }
- catch (NoSuchAlgorithmException e)
- {
- // Ignored.
- }
- }
-
+ try
+ {
+ return getInstance(type, params, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new NoSuchAlgorithmException(type);
}
/**
- * Get an instance of the given certificate store from the named
+ * Returns an instance of the given certificate store type from a named
* provider.
- *
- * @param type The type of CertStore to create.
- * @param params The parameters to initialize this cert store with.
- * @param provider The name of the provider from which to get the
- * implementation.
+ *
+ * @param type The type of <code>CertStore</code> to create.
+ * @param params The parameters to initialize this cert store with.
+ * @param provider The name of the provider to use.
* @return The new instance.
- * @throws InvalidAlgorithmParameterException If the instance rejects
- * the specified parameters.
+ * @throws InvalidAlgorithmParameterException If the instance rejects the
+ * specified parameters.
* @throws NoSuchAlgorithmException If the specified provider does not
- * implement the specified CertStore.
- * @throws NoSuchProviderException If no provider named
- * <i>provider</i> is installed.
- * @throws IllegalArgumentException If <i>provider</i> is null.
+ * implement the specified CertStore.
+ * @throws NoSuchProviderException If no provider named <i>provider</i> is
+ * installed.
+ * @throws IllegalArgumentException if either <code>type</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>type</code> is an empty string.
*/
public static CertStore getInstance(String type, CertStoreParameters params,
String provider)
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException,
NoSuchProviderException
{
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
Provider p = Security.getProvider(provider);
if (p == null)
throw new NoSuchProviderException(provider);
@@ -183,48 +188,52 @@ public class CertStore
}
/**
- * Get an instance of the given certificate store from the given
+ * Returns an instance of the given certificate store type from a given
* provider.
*
- * @param type The type of CertStore to create.
+ * @param type The type of <code>CertStore</code> to create.
* @param params The parameters to initialize this cert store with.
- * @param provider The provider from which to get the implementation.
+ * @param provider The provider to use.
* @return The new instance.
* @throws InvalidAlgorithmParameterException If the instance rejects
* the specified parameters.
* @throws NoSuchAlgorithmException If the specified provider does not
* implement the specified CertStore.
- * @throws IllegalArgumentException If <i>provider</i> is null.
+ * @throws IllegalArgumentException if either <code>type</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>type</code> is an empty string.
*/
public static CertStore getInstance(String type, CertStoreParameters params,
Provider provider)
- throws InvalidAlgorithmParameterException, NoSuchAlgorithmException
+ throws InvalidAlgorithmParameterException, NoSuchAlgorithmException
{
- if (provider == null)
- throw new IllegalArgumentException("null provider");
-
+ StringBuilder sb = new StringBuilder("CertStore of type [")
+ .append(type).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- return new CertStore((CertStoreSpi) Engine.getInstance(CERT_STORE,
- type, provider, new Object[] { params }), provider, type, params);
+ Object[] args = new Object[] { params };
+ Object spi = Engine.getInstance(CERT_STORE, type, provider, args);
+ return new CertStore((CertStoreSpi) spi, provider, type, params);
}
- catch (ClassCastException cce)
+ catch (InvocationTargetException x)
{
- throw new NoSuchAlgorithmException(type);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (java.lang.reflect.InvocationTargetException ite)
+ catch (ClassCastException x)
{
- Throwable cause = ite.getCause();
- if (cause instanceof InvalidAlgorithmParameterException)
- throw (InvalidAlgorithmParameterException) cause;
- else
- throw new NoSuchAlgorithmException(type);
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
- // Instance methods.
- // ------------------------------------------------------------------------
-
/**
* Return the type of certificate store this instance represents.
*
@@ -268,7 +277,7 @@ public class CertStore
* @return The collection of certificates.
* @throws CertStoreException If the certificates cannot be retrieved.
*/
- public final Collection getCertificates(CertSelector selector)
+ public final Collection<? extends Certificate> getCertificates(CertSelector selector)
throws CertStoreException
{
return storeSpi.engineGetCertificates(selector);
@@ -286,7 +295,7 @@ public class CertStore
* @return The collection of certificate revocation lists.
* @throws CertStoreException If the CRLs cannot be retrieved.
*/
- public final Collection getCRLs(CRLSelector selector)
+ public final Collection<? extends CRL> getCRLs(CRLSelector selector)
throws CertStoreException
{
return storeSpi.engineGetCRLs(selector);
diff --git a/libjava/classpath/java/security/cert/CertStoreSpi.java b/libjava/classpath/java/security/cert/CertStoreSpi.java
index a69545f0d32..976d65ce922 100644
--- a/libjava/classpath/java/security/cert/CertStoreSpi.java
+++ b/libjava/classpath/java/security/cert/CertStoreSpi.java
@@ -50,7 +50,7 @@ import java.util.Collection;
* implement the {@link CertStoreParameters} interface, if they require
* parameters.
*
- * @since JDK 1.4
+ * @since 1.4
* @see CertStore
* @see CollectionCertStoreParameters
* @see LDAPCertStoreParameters
@@ -86,7 +86,7 @@ public abstract class CertStoreSpi
* @return A (non-null) collection of certificates.
* @throws CertStoreException If the certificates cannot be retrieved.
*/
- public abstract Collection engineGetCertificates(CertSelector selector)
+ public abstract Collection<? extends Certificate> engineGetCertificates(CertSelector selector)
throws CertStoreException;
/**
@@ -98,6 +98,6 @@ public abstract class CertStoreSpi
* @return A (non-null) collection of certificate revocation list.
* @throws CertStoreException If the CRLs cannot be retrieved.
*/
- public abstract Collection engineGetCRLs(CRLSelector selector)
+ public abstract Collection<? extends CRL> engineGetCRLs(CRLSelector selector)
throws CertStoreException;
}
diff --git a/libjava/classpath/java/security/cert/CertificateFactory.java b/libjava/classpath/java/security/cert/CertificateFactory.java
index aedeff53573..8139c6ec5c3 100644
--- a/libjava/classpath/java/security/cert/CertificateFactory.java
+++ b/libjava/classpath/java/security/cert/CertificateFactory.java
@@ -41,6 +41,8 @@ package java.security.cert;
import gnu.java.security.Engine;
import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.Provider;
@@ -56,7 +58,7 @@ import java.util.List;
*
* @author Mark Benvenuto
* @author Casey Marshall
- * @since JDK 1.2
+ * @since 1.2
* @status Fully compatible with JDK 1.4.
*/
public class CertificateFactory
@@ -84,106 +86,102 @@ public class CertificateFactory
this.type = type;
}
- // Class methods.
- // ------------------------------------------------------------------------
-
- /**
- * Gets an instance of the CertificateFactory class representing
- * the specified certificate factory. If the type is not
- * found then, it throws CertificateException.
- *
- * @param type The type of certificate factory to create.
- * @return a CertificateFactory repesenting the desired type
- * @throws CertificateException If the type of certificate is not
- * implemented by any installed provider.
+ /**
+ * Returns an instance of a <code>CertificateFactory</code> representing the
+ * specified certificate factory type.
+ *
+ * @param type The type of certificate factory to create.
+ * @return A <code>CertificateFactory</code> of the desired type.
+ * @throws CertificateException If the type of certificate factory is not
+ * implemented by any installed provider.
+ * @throws IllegalArgumentException if <code>type</code> is
+ * <code>null</code> or is an empty string.
*/
public static final CertificateFactory getInstance(String type)
- throws CertificateException
+ throws CertificateException
{
Provider[] p = Security.getProviders();
-
+ CertificateException lastException = null;
for (int i = 0; i < p.length; i++)
- {
- try
- {
- return getInstance(type, p[i]);
- }
- catch (CertificateException e)
- {
- // Ignored.
- }
- }
-
+ try
+ {
+ return getInstance(type, p[i]);
+ }
+ catch (CertificateException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new CertificateException(type);
}
- /**
- * Gets an instance of the CertificateFactory class representing
- * the specified certificate factory from the specified provider.
- * If the type is not found then, it throws {@link CertificateException}.
- * If the provider is not found, then it throws
- * {@link java.security.NoSuchProviderException}.
- *
- * @param type The type of certificate factory to create.
- * @param provider The name of the provider from which to get the
- * implementation.
- * @return A CertificateFactory for the desired type.
- * @throws CertificateException If the type of certificate is not
- * implemented by the named provider.
+ /**
+ * Returns an instance of a <code>CertificateFactory</code> representing the
+ * specified certificate factory type from the named provider.
+ *
+ * @param type The type of certificate factory to create.
+ * @param provider The name of the provider to use.
+ * @return A <code>CertificateFactory</code> for the desired type.
+ * @throws CertificateException If the type of certificate is not implemented
+ * by the named provider.
* @throws NoSuchProviderException If the named provider is not installed.
+ * @throws IllegalArgumentException if either <code>type</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>type</code> is an empty string.
*/
public static final CertificateFactory getInstance(String type,
String provider)
throws CertificateException, NoSuchProviderException
{
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
Provider p = Security.getProvider(provider);
- if( p == null)
+ if (p == null)
throw new NoSuchProviderException(provider);
-
return getInstance(type, p);
}
/**
- * Get a certificate factory for the given certificate type from the
- * given provider.
- *
- * @param type The type of certificate factory to create.
+ * Returns an instance of a <code>CertificateFactory</code> representing the
+ * specified certificate factory type from the designated provider.
+ *
+ * @param type The type of certificate factory to create.
* @param provider The provider from which to get the implementation.
- * @return A CertificateFactory for the desired type.
- * @throws CertificateException If the type of certificate is not
- * implemented by the provider.
- * @throws IllegalArgumentException If the provider is null.
+ * @return A <code>CertificateFactory</code> for the desired type.
+ * @throws CertificateException If the type of certificate is not implemented
+ * by the provider.
+ * @throws IllegalArgumentException if either <code>type</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>type</code> is an empty string.
*/
public static final CertificateFactory getInstance(String type,
Provider provider)
- throws CertificateException
+ throws CertificateException
{
- if (provider == null)
- throw new IllegalArgumentException("null provider");
-
+ Throwable cause;
try
{
- return new CertificateFactory((CertificateFactorySpi)
- Engine.getInstance(CERTIFICATE_FACTORY, type, provider),
- provider, type);
+ Object spi = Engine.getInstance(CERTIFICATE_FACTORY, type, provider);
+ return new CertificateFactory((CertificateFactorySpi) spi, provider, type);
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new CertificateException(type);
+ cause = x;
}
- catch (java.lang.reflect.InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- throw new CertificateException(type);
+ cause = x.getCause() != null ? x.getCause() : x;
}
- catch (NoSuchAlgorithmException nsae)
+ catch (NoSuchAlgorithmException x)
{
- throw new CertificateException(nsae.getMessage());
+ cause = x;
}
+ CertificateException x = new CertificateException(type);
+ x.initCause(cause);
+ throw x;
}
- // Instance methods.
- // ------------------------------------------------------------------------
-
/**
* Gets the provider of this implementation.
*
@@ -249,7 +247,7 @@ public class CertificateFactory
* @throws CertificateException If an error occurs decoding the
* certificates.
*/
- public final Collection generateCertificates(InputStream inStream)
+ public final Collection<? extends Certificate> generateCertificates(InputStream inStream)
throws CertificateException
{
return certFacSpi.engineGenerateCertificates(inStream);
@@ -291,7 +289,7 @@ public class CertificateFactory
* InputStream data.
* @throws CRLException If an error occurs decoding the CRLs.
*/
- public final Collection generateCRLs(InputStream inStream)
+ public final Collection<? extends CRL> generateCRLs(InputStream inStream)
throws CRLException
{
return certFacSpi.engineGenerateCRLs( inStream );
@@ -338,7 +336,7 @@ public class CertificateFactory
* @throws CertificateException If an error occurs generating the
* CertPath.
*/
- public final CertPath generateCertPath(List certificates)
+ public final CertPath generateCertPath(List<? extends Certificate> certificates)
throws CertificateException
{
return certFacSpi.engineGenerateCertPath(certificates);
@@ -351,7 +349,7 @@ public class CertificateFactory
*
* @return The Iterator of supported encodings.
*/
- public final Iterator getCertPathEncodings()
+ public final Iterator<String> getCertPathEncodings()
{
return certFacSpi.engineGetCertPathEncodings();
}
diff --git a/libjava/classpath/java/security/cert/CertificateFactorySpi.java b/libjava/classpath/java/security/cert/CertificateFactorySpi.java
index beea9646a67..e6a22b4ebf8 100644
--- a/libjava/classpath/java/security/cert/CertificateFactorySpi.java
+++ b/libjava/classpath/java/security/cert/CertificateFactorySpi.java
@@ -54,7 +54,7 @@ import java.util.List;
Certificate factories are used to generate certificates and
certificate revocation lists (CRL) from their encoding.
- @since JDK 1.2
+ @since 1.2
@author Mark Benvenuto
*/
@@ -117,7 +117,7 @@ public abstract class CertificateFactorySpi
@throws CertificateException Certificate parsing error
*/
- public abstract Collection engineGenerateCertificates(InputStream inStream)
+ public abstract Collection<? extends Certificate> engineGenerateCertificates(InputStream inStream)
throws CertificateException;
/**
@@ -157,7 +157,7 @@ public abstract class CertificateFactorySpi
@throws CRLException CRL parsing error
*/
- public abstract Collection engineGenerateCRLs(InputStream inStream)
+ public abstract Collection<? extends CRL> engineGenerateCRLs(InputStream inStream)
throws CRLException;
// 1.4 instance methods.
@@ -204,7 +204,7 @@ public abstract class CertificateFactorySpi
* @throws CertificateException If an error occurs generating the
* CertPath.
*/
- public CertPath engineGenerateCertPath(List certificates)
+ public CertPath engineGenerateCertPath(List<? extends Certificate> certificates)
throws CertificateException
{
throw new UnsupportedOperationException("not implemented");
@@ -217,7 +217,7 @@ public abstract class CertificateFactorySpi
*
* @return The Iterator of supported encodings.
*/
- public Iterator engineGetCertPathEncodings()
+ public Iterator<String> engineGetCertPathEncodings()
{
throw new UnsupportedOperationException("not implemented");
}
diff --git a/libjava/classpath/java/security/cert/CollectionCertStoreParameters.java b/libjava/classpath/java/security/cert/CollectionCertStoreParameters.java
index bac1e3b3e4f..b3ee93235f8 100644
--- a/libjava/classpath/java/security/cert/CollectionCertStoreParameters.java
+++ b/libjava/classpath/java/security/cert/CollectionCertStoreParameters.java
@@ -51,6 +51,7 @@ import java.util.Collections;
* collection may be changed at any time.
*
* @see CertStore
+ * @since 1.4
*/
public class CollectionCertStoreParameters implements CertStoreParameters
{
@@ -81,7 +82,7 @@ public class CollectionCertStoreParameters implements CertStoreParameters
* @param collection The collection.
* @throws NullPointerException If <i>collection</i> is null.
*/
- public CollectionCertStoreParameters(Collection collection)
+ public CollectionCertStoreParameters(Collection<?> collection)
{
if (collection == null)
throw new NullPointerException();
@@ -103,7 +104,7 @@ public class CollectionCertStoreParameters implements CertStoreParameters
*
* @return The collection.
*/
- public Collection getCollection()
+ public Collection<?> getCollection()
{
return collection;
}
diff --git a/libjava/classpath/java/security/cert/PKIXBuilderParameters.java b/libjava/classpath/java/security/cert/PKIXBuilderParameters.java
index 38b3df5e78a..5e234cec158 100644
--- a/libjava/classpath/java/security/cert/PKIXBuilderParameters.java
+++ b/libjava/classpath/java/security/cert/PKIXBuilderParameters.java
@@ -48,6 +48,7 @@ import java.util.Set;
* Parameters for building certificate paths using the PKIX algorithm.
*
* @see CertPathBuilder
+ * @since 1.4
*/
public class PKIXBuilderParameters extends PKIXParameters
{
@@ -97,7 +98,8 @@ public class PKIXBuilderParameters extends PKIXParameters
* @throws ClassCastException If every element in <i>trustAnchors</i>
* is not a {@link TrustAnchor}.
*/
- public PKIXBuilderParameters(Set trustAnchors, CertSelector targetConstraints)
+ public PKIXBuilderParameters(Set<TrustAnchor> trustAnchors,
+ CertSelector targetConstraints)
throws InvalidAlgorithmParameterException
{
super(trustAnchors);
diff --git a/libjava/classpath/java/security/cert/PKIXCertPathChecker.java b/libjava/classpath/java/security/cert/PKIXCertPathChecker.java
index a6eef41a298..a69347fcd0b 100644
--- a/libjava/classpath/java/security/cert/PKIXCertPathChecker.java
+++ b/libjava/classpath/java/security/cert/PKIXCertPathChecker.java
@@ -59,6 +59,7 @@ import java.util.Set;
* the most-trusted certificate.
*
* @see PKIXParameters
+ * @since 1.4
*/
public abstract class PKIXCertPathChecker implements Cloneable
{
@@ -116,7 +117,7 @@ public abstract class PKIXCertPathChecker implements Cloneable
* @return An immutable set of Strings of the supported X.509 OIDs, or
* null if no extensions are supported.
*/
- public abstract Set getSupportedExtensions();
+ public abstract Set<String> getSupportedExtensions();
/**
* Checks a certificate, removing any critical extensions that are
@@ -128,6 +129,6 @@ public abstract class PKIXCertPathChecker implements Cloneable
* @throws CertPathValidatorException If this certificate fails this
* check.
*/
- public abstract void check(Certificate cert, Collection unresolvedCritExts)
+ public abstract void check(Certificate cert, Collection<String> unresolvedCritExts)
throws CertPathValidatorException;
}
diff --git a/libjava/classpath/java/security/cert/PKIXParameters.java b/libjava/classpath/java/security/cert/PKIXParameters.java
index 16ef07f8870..bb68cb93726 100644
--- a/libjava/classpath/java/security/cert/PKIXParameters.java
+++ b/libjava/classpath/java/security/cert/PKIXParameters.java
@@ -56,6 +56,7 @@ import java.util.Set;
* (Public-Key Infrastructure (X.509)) algorithm.
*
* @see CertPathBuilder
+ * @since 1.4
*/
public class PKIXParameters implements CertPathParameters
{
@@ -144,7 +145,7 @@ public class PKIXParameters implements CertPathParameters
* @throws ClassCastException If every element in <i>trustAnchors</i>
* is not a {@link TrustAnchor}.
*/
- public PKIXParameters(Set trustAnchors)
+ public PKIXParameters(Set<TrustAnchor> trustAnchors)
throws InvalidAlgorithmParameterException
{
this();
@@ -199,7 +200,7 @@ public class PKIXParameters implements CertPathParameters
*
* @return A (never null, never empty) immutable set of trust anchors.
*/
- public Set getTrustAnchors()
+ public Set<TrustAnchor> getTrustAnchors()
{
return Collections.unmodifiableSet(trustAnchors);
}
@@ -216,7 +217,7 @@ public class PKIXParameters implements CertPathParameters
* @throws ClassCastException If every element in <i>trustAnchors</i>
* is not a {@link TrustAnchor}.
*/
- public void setTrustAnchors(Set trustAnchors)
+ public void setTrustAnchors(Set<TrustAnchor> trustAnchors)
throws InvalidAlgorithmParameterException
{
if (trustAnchors.isEmpty())
@@ -235,7 +236,7 @@ public class PKIXParameters implements CertPathParameters
* @return An immutable set of initial policy OID strings, or the
* empty set if any policy is acceptable.
*/
- public Set getInitialPolicies()
+ public Set<String> getInitialPolicies()
{
return Collections.unmodifiableSet(initPolicies);
}
@@ -249,7 +250,7 @@ public class PKIXParameters implements CertPathParameters
* @throws ClassCastException If any element in <i>initPolicies</i> is
* not a string.
*/
- public void setInitialPolicies(Set initPolicies)
+ public void setInitialPolicies(Set<String> initPolicies)
{
this.initPolicies.clear();
if (initPolicies == null)
@@ -277,7 +278,7 @@ public class PKIXParameters implements CertPathParameters
*
* @return The list of cert stores.
*/
- public List getCertStores()
+ public List<CertStore> getCertStores()
{
return Collections.unmodifiableList(certStores);
}
@@ -288,7 +289,7 @@ public class PKIXParameters implements CertPathParameters
*
* @param certStores The cert stores.
*/
- public void setCertStores(List certStores)
+ public void setCertStores(List<CertStore> certStores)
{
this.certStores.clear();
if (certStores == null)
@@ -446,7 +447,7 @@ public class PKIXParameters implements CertPathParameters
*
* @return An immutable list of all certificate path checkers.
*/
- public List getCertPathCheckers()
+ public List<PKIXCertPathChecker> getCertPathCheckers()
{
return Collections.unmodifiableList(pathCheckers);
}
@@ -459,7 +460,7 @@ public class PKIXParameters implements CertPathParameters
* @throws ClassCastException If any element of <i>pathCheckers</i> is
* not a {@link PKIXCertPathChecker}.
*/
- public void setCertPathCheckers(List pathCheckers)
+ public void setCertPathCheckers(List<PKIXCertPathChecker> pathCheckers)
{
this.pathCheckers.clear();
if (pathCheckers == null)
diff --git a/libjava/classpath/java/security/cert/PolicyNode.java b/libjava/classpath/java/security/cert/PolicyNode.java
index 58d411cd3ad..b1196037e87 100644
--- a/libjava/classpath/java/security/cert/PolicyNode.java
+++ b/libjava/classpath/java/security/cert/PolicyNode.java
@@ -38,6 +38,12 @@ exception statement from your version. */
package java.security.cert;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * @since 1.4
+ */
public interface PolicyNode
{
@@ -47,7 +53,7 @@ public interface PolicyNode
*
* @return An iterator over the child nodes.
*/
- java.util.Iterator getChildren();
+ Iterator<? extends PolicyNode> getChildren();
/**
* Get the depth of this node within the tree, starting at 0 for the
@@ -64,7 +70,7 @@ public interface PolicyNode
*
* @return The set of expected policies.
*/
- java.util.Set getExpectedPolicies();
+ Set<String> getExpectedPolicies();
/**
* Returns the parent node of this node, or null if this is the root
@@ -81,7 +87,7 @@ public interface PolicyNode
*
* @return The set of {@link PolicyQualifierInfo} objects.
*/
- java.util.Set getPolicyQualifiers();
+ Set<? extends PolicyQualifierInfo> getPolicyQualifiers();
/**
* Get the policy OID this node represents. The root node should return
diff --git a/libjava/classpath/java/security/cert/PolicyQualifierInfo.java b/libjava/classpath/java/security/cert/PolicyQualifierInfo.java
index 7dcf2315632..b50f3f31245 100644
--- a/libjava/classpath/java/security/cert/PolicyQualifierInfo.java
+++ b/libjava/classpath/java/security/cert/PolicyQualifierInfo.java
@@ -59,9 +59,10 @@ import java.io.IOException;
* PolicyQualifierId ::= OBJECT IDENTIFIER
* </pre>
*
- * @since JDK 1.4
+ * @since 1.4
+ * @specnote this class was final in 1.4, but beginning with 1.5 is not
*/
-public final class PolicyQualifierInfo
+public class PolicyQualifierInfo
{
// Fields.
diff --git a/libjava/classpath/java/security/cert/X509CRL.java b/libjava/classpath/java/security/cert/X509CRL.java
index 5657b3eb3f5..a00706e678f 100644
--- a/libjava/classpath/java/security/cert/X509CRL.java
+++ b/libjava/classpath/java/security/cert/X509CRL.java
@@ -97,7 +97,7 @@ import javax.security.auth.x500.X500Principal;
@author Mark Benvenuto
- @since JDK 1.2
+ @since 1.2
*/
public abstract class X509CRL extends CRL implements X509Extension
{
@@ -304,7 +304,7 @@ public abstract class X509CRL extends CRL implements X509Extension
@return a set of revoked certificates.
*/
- public abstract Set getRevokedCertificates();
+ public abstract Set<? extends X509CRLEntry> getRevokedCertificates();
/**
Returns the DER ASN.1 encoded tbsCertList which is
diff --git a/libjava/classpath/java/security/cert/X509CRLSelector.java b/libjava/classpath/java/security/cert/X509CRLSelector.java
index 3c79fba9cb8..56b171369fb 100644
--- a/libjava/classpath/java/security/cert/X509CRLSelector.java
+++ b/libjava/classpath/java/security/cert/X509CRLSelector.java
@@ -69,6 +69,7 @@ import javax.security.auth.x500.X500Principal;
* use or modify this class then they need to synchronize on the object.
*
* @author Casey Marshall (csm@gnu.org)
+ * @since 1.4
*/
public class X509CRLSelector implements CRLSelector, Cloneable
{
@@ -157,7 +158,7 @@ public class X509CRLSelector implements CRLSelector, Cloneable
* @throws IOException If any of the elements in the collection is not
* a valid name.
*/
- public void setIssuerNames(Collection names) throws IOException
+ public void setIssuerNames(Collection<?> names) throws IOException
{
if (names == null)
{
@@ -224,7 +225,7 @@ public class X509CRLSelector implements CRLSelector, Cloneable
*
* @return The set of issuer names.
*/
- public Collection getIssuerNames()
+ public Collection<Object> getIssuerNames()
{
if (issuerNames != null)
return Collections.unmodifiableList(issuerNames);
diff --git a/libjava/classpath/java/security/cert/X509CertSelector.java b/libjava/classpath/java/security/cert/X509CertSelector.java
index 175e4c673c9..154ed2e4d98 100644
--- a/libjava/classpath/java/security/cert/X509CertSelector.java
+++ b/libjava/classpath/java/security/cert/X509CertSelector.java
@@ -76,6 +76,7 @@ import javax.security.auth.x500.X500Principal;
* use or modify this class then they need to synchronize on the object.
*
* @author Casey Marshall (csm@gnu.org)
+ * @since 1.4
*/
public class X509CertSelector implements CertSelector, Cloneable
{
@@ -573,7 +574,7 @@ public class X509CertSelector implements CertSelector, Cloneable
*
* @return The set of key purpose OIDs (strings).
*/
- public Set getExtendedKeyUsage()
+ public Set<String> getExtendedKeyUsage()
{
if (keyPurposeSet != null)
return Collections.unmodifiableSet(keyPurposeSet);
@@ -588,7 +589,7 @@ public class X509CertSelector implements CertSelector, Cloneable
* @param keyPurposeSet The set of key purpose OIDs.
* @throws IOException If any element of the set is not a valid OID string.
*/
- public void setExtendedKeyUsage(Set keyPurposeSet) throws IOException
+ public void setExtendedKeyUsage(Set<String> keyPurposeSet) throws IOException
{
if (keyPurposeSet == null)
{
@@ -653,7 +654,7 @@ public class X509CertSelector implements CertSelector, Cloneable
* @param altNames The alternative names.
* @throws IOException If any element of the argument is invalid.
*/
- public void setSubjectAlternativeNames(Collection altNames)
+ public void setSubjectAlternativeNames(Collection<List<?>> altNames)
throws IOException
{
if (altNames == null)
@@ -786,7 +787,7 @@ public class X509CertSelector implements CertSelector, Cloneable
// certificate, and check it against the specified set.
// FIXME
-// public void setPolicy(Set policy) throws IOException
+// public void setPolicy(Set<String> policy) throws IOException
// {
// if (policy != null)
// {
@@ -807,7 +808,7 @@ public class X509CertSelector implements CertSelector, Cloneable
// }
// FIXME
-// public void setPathToNames(Collection names) throws IOException
+// public void setPathToNames(Collection<List<?>> names) throws IOException
// {
// if (names == null)
// {
@@ -843,19 +844,19 @@ public class X509CertSelector implements CertSelector, Cloneable
// }
// FIXME
-// public Collection getSubjectAlternativeNames()
+// public Collection<List<?>> getSubjectAlternativeNames()
// {
// return null;
// }
// FIXME
-// public Set getPolicy()
+// public Set<String> getPolicy()
// {
// return null;
// }
// FIXME
-// public Collection getPathToNames()
+// public Collection<List<?>> getPathToNames()
// {
// return null;
// }
diff --git a/libjava/classpath/java/security/cert/X509Certificate.java b/libjava/classpath/java/security/cert/X509Certificate.java
index f6c6fcfb9a4..bc1b5c2351c 100644
--- a/libjava/classpath/java/security/cert/X509Certificate.java
+++ b/libjava/classpath/java/security/cert/X509Certificate.java
@@ -41,6 +41,7 @@ package java.security.cert;
import java.math.BigInteger;
import java.security.Principal;
import java.util.Date;
+import java.util.List;
/**
* X509Certificate is the abstract class for X.509 certificates.
@@ -131,7 +132,7 @@ import java.util.Date;
* Profile</a></i>.</li>
* </ol>
*
- * @since JDK 1.2
+ * @since 1.2
* @author Mark Benvenuto
* @author Casey Marshall (rsdio@metastatic.org)
*/
@@ -487,7 +488,7 @@ public abstract class X509Certificate
* @throws CertificateParsingException If this extension cannot be
* parsed from its encoded form.
*/
- public java.util.List getExtendedKeyUsage()
+ public java.util.List<String> getExtendedKeyUsage()
throws CertificateParsingException
{
throw new UnsupportedOperationException();
@@ -531,7 +532,7 @@ public abstract class X509Certificate
* be parsed.
* @since JDK 1.4
*/
- public java.util.Collection getSubjectAlternativeNames()
+ public java.util.Collection<List<?>> getSubjectAlternativeNames()
throws CertificateParsingException
{
throw new UnsupportedOperationException();
@@ -558,7 +559,7 @@ public abstract class X509Certificate
* be parsed.
* @since JDK 1.4
*/
- public java.util.Collection getIssuerAlternativeNames()
+ public java.util.Collection<List<?>> getIssuerAlternativeNames()
throws CertificateParsingException
{
throw new UnsupportedOperationException();
diff --git a/libjava/classpath/java/security/cert/X509Extension.java b/libjava/classpath/java/security/cert/X509Extension.java
index d2cb80a9f57..bd9473782e4 100644
--- a/libjava/classpath/java/security/cert/X509Extension.java
+++ b/libjava/classpath/java/security/cert/X509Extension.java
@@ -70,7 +70,7 @@ import java.util.Set;
@author Mark Benvenuto
- @since JDK 1.2
+ @since 1.2
*/
public interface X509Extension
{
@@ -91,7 +91,7 @@ public interface X509Extension
@return A Set containing the OIDs. If there are no CRITICAL
extensions or extensions at all this returns null.
*/
- Set getCriticalExtensionOIDs();
+ Set<String> getCriticalExtensionOIDs();
/**
Returns a set of the NON-CRITICAL extension OIDs from the
@@ -101,7 +101,7 @@ public interface X509Extension
@return A Set containing the OIDs. If there are no NON-CRITICAL
extensions or extensions at all this returns null.
*/
- Set getNonCriticalExtensionOIDs();
+ Set<String> getNonCriticalExtensionOIDs();
/**
Returns the DER encoded OCTET string for the specified
diff --git a/libjava/classpath/java/sql/Array.java b/libjava/classpath/java/sql/Array.java
index c3c42d9cb57..cdd60a42f12 100644
--- a/libjava/classpath/java/sql/Array.java
+++ b/libjava/classpath/java/sql/Array.java
@@ -84,7 +84,7 @@ public interface Array
* @return The contents of the array as an array of Java objects.
* @exception SQLException If an error occurs.
*/
- Object getArray(Map map) throws SQLException;
+ Object getArray(Map<String, Class<?>> map) throws SQLException;
/**
* Returns a portion of this array starting at <code>start</code>
@@ -94,7 +94,7 @@ public interface Array
* The object returned will be an array of Java objects of
* the appropriate types.
*
- * @param start The index into this array to start returning elements from.
+ * @param start The offset into this array to start returning elements from.
* @param count The requested number of elements to return.
* @return The requested portion of the array.
* @exception SQLException If an error occurs.
@@ -110,13 +110,14 @@ public interface Array
* <code>Map</code> will be used for overriding selected SQL type to
* Java class mappings.
*
- * @param start The index into this array to start returning elements from.
+ * @param start The offset into this array to start returning elements from.
* @param count The requested number of elements to return.
* @param map A mapping of SQL types to Java classes.
* @return The requested portion of the array.
* @exception SQLException If an error occurs.
*/
- Object getArray(long start, int count, Map map) throws SQLException;
+ Object getArray(long start, int count, Map<String, Class<?>> map)
+ throws SQLException;
/**
* Returns the elements in the array as a <code>ResultSet</code>.
@@ -143,7 +144,7 @@ public interface Array
* @exception SQLException If an error occurs.
* @see ResultSet
*/
- ResultSet getResultSet(Map map) throws SQLException;
+ ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException;
/**
* This method returns a portion of the array as a <code>ResultSet</code>.
@@ -180,6 +181,6 @@ public interface Array
* @exception SQLException If an error occurs.
* @see ResultSet
*/
- ResultSet getResultSet(long start, int count, Map map)
+ ResultSet getResultSet(long start, int count, Map<String, Class<?>> map)
throws SQLException;
}
diff --git a/libjava/classpath/java/sql/CallableStatement.java b/libjava/classpath/java/sql/CallableStatement.java
index 75eade77480..e605b381d5b 100644
--- a/libjava/classpath/java/sql/CallableStatement.java
+++ b/libjava/classpath/java/sql/CallableStatement.java
@@ -250,7 +250,7 @@ public interface CallableStatement extends PreparedStatement
* @exception SQLException If an error occurs.
* @since 1.2
*/
- Object getObject(int index, Map map) throws SQLException;
+ Object getObject(int index, Map<String, Class<?>> map) throws SQLException;
/**
* This method returns the value of the specified parameter as a Java
@@ -865,7 +865,7 @@ public interface CallableStatement extends PreparedStatement
* @exception SQLException If an error occurs.
* @since 1.4
*/
- Object getObject(String name, Map map) throws SQLException;
+ Object getObject(String name, Map<String, Class<?>> map) throws SQLException;
/**
* This method returns the value of the specified parameter as a Java
diff --git a/libjava/classpath/java/sql/Connection.java b/libjava/classpath/java/sql/Connection.java
index d827e75b089..8dc7544c760 100644
--- a/libjava/classpath/java/sql/Connection.java
+++ b/libjava/classpath/java/sql/Connection.java
@@ -339,7 +339,7 @@ public interface Connection
* @return The SQL type to Java class mapping.
* @exception SQLException If an error occurs.
*/
- Map getTypeMap() throws SQLException;
+ Map<String, Class<?>> getTypeMap() throws SQLException;
/**
* This method sets the mapping table for SQL types to Java classes.
@@ -348,7 +348,7 @@ public interface Connection
* @param map The new SQL mapping table.
* @exception SQLException If an error occurs.
*/
- void setTypeMap(Map map) throws SQLException;
+ void setTypeMap(Map<String, Class<?>> map) throws SQLException;
/**
* Sets the default holdability of <code>ResultSet</code>S that are created
diff --git a/libjava/classpath/java/sql/DriverManager.java b/libjava/classpath/java/sql/DriverManager.java
index 94f743b92da..7d1ef07c1a0 100644
--- a/libjava/classpath/java/sql/DriverManager.java
+++ b/libjava/classpath/java/sql/DriverManager.java
@@ -264,7 +264,7 @@ public class DriverManager
*
* @return An <code>Enumeration</code> of all currently loaded JDBC drivers.
*/
- public static Enumeration getDrivers()
+ public static Enumeration<Driver> getDrivers()
{
Vector v = new Vector();
Enumeration e = drivers.elements();
diff --git a/libjava/classpath/java/sql/Ref.java b/libjava/classpath/java/sql/Ref.java
index 4ebd5e64898..c5c54eefef1 100644
--- a/libjava/classpath/java/sql/Ref.java
+++ b/libjava/classpath/java/sql/Ref.java
@@ -61,7 +61,7 @@ public interface Ref
/**
* @since 1.4
*/
- Object getObject(Map map) throws SQLException;
+ Object getObject(Map<String, Class<?>> map) throws SQLException;
/**
* @since 1.4
diff --git a/libjava/classpath/java/sql/ResultSet.java b/libjava/classpath/java/sql/ResultSet.java
index 79cba63d419..573deb3e105 100644
--- a/libjava/classpath/java/sql/ResultSet.java
+++ b/libjava/classpath/java/sql/ResultSet.java
@@ -1309,7 +1309,8 @@ public interface ResultSet
* @return The value of the column as an <code>Object</code>.
* @exception SQLException If an error occurs.
*/
- Object getObject(int columnIndex, Map map) throws SQLException;
+ Object getObject(int columnIndex, Map<String, Class<?>> map)
+ throws SQLException;
/**
* This method returns a <code>Ref</code> for the specified column which
@@ -1357,7 +1358,8 @@ public interface ResultSet
* @return The value of the column as an <code>Object</code>.
* @exception SQLException If an error occurs.
*/
- Object getObject(String columnName, Map map) throws SQLException;
+ Object getObject(String columnName, Map<String, Class<?>> map)
+ throws SQLException;
/**
* This method returns a <code>Ref</code> for the specified column which
diff --git a/libjava/classpath/java/sql/Struct.java b/libjava/classpath/java/sql/Struct.java
index 5cbc88e133a..ce8db22bb55 100644
--- a/libjava/classpath/java/sql/Struct.java
+++ b/libjava/classpath/java/sql/Struct.java
@@ -73,5 +73,5 @@ public interface Struct
* @return The attributes of this structure type.
* @exception SQLException If a error occurs.
*/
- Object[] getAttributes(Map map) throws SQLException;
+ Object[] getAttributes(Map<String, Class<?>> map) throws SQLException;
}
diff --git a/libjava/classpath/java/sql/Timestamp.java b/libjava/classpath/java/sql/Timestamp.java
index 66a57641a02..18ccda5577d 100644
--- a/libjava/classpath/java/sql/Timestamp.java
+++ b/libjava/classpath/java/sql/Timestamp.java
@@ -1,5 +1,5 @@
/* Time.java -- Wrapper around java.util.Date
- Copyright (C) 1999, 2000, 2003, 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -312,7 +312,7 @@ public class Timestamp extends java.util.Date
* @see #compareTo(Timestamp)
* @since 1.2
*/
- public int compareTo(Object obj)
+ public int compareTo(java.util.Date obj)
{
return compareTo((Timestamp) obj);
}
diff --git a/libjava/classpath/java/text/AttributedCharacterIterator.java b/libjava/classpath/java/text/AttributedCharacterIterator.java
index 37c7450b2c8..4f9c762b3cd 100644
--- a/libjava/classpath/java/text/AttributedCharacterIterator.java
+++ b/libjava/classpath/java/text/AttributedCharacterIterator.java
@@ -1,5 +1,5 @@
/* AttributedCharacterIterator.java -- Iterate over attributes
- Copyright (C) 1998, 1999, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2004, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,10 @@ import java.util.Set;
* that is defined for a particular value across an entire range of
* characters or which is undefined over a range of characters.
*
+ * @since 1.2
+ *
* @author Aaron M. Renn (arenn@urbanophile.com)
+ * @since 1.2
*/
public interface AttributedCharacterIterator extends CharacterIterator
{
@@ -68,7 +71,7 @@ public interface AttributedCharacterIterator extends CharacterIterator
* This is the attribute for the language of the text. The value of
* attributes of this key type are instances of <code>Locale</code>.
*/
- public static final Attribute LANGUAGE = new Attribute ("LANGUAGE");
+ public static final Attribute LANGUAGE = new Attribute("language");
/**
* This is the attribute for the reading form of text. This is used
@@ -77,7 +80,7 @@ public interface AttributedCharacterIterator extends CharacterIterator
* instances of <code>Annotation</code> which wrappers a
* <code>String</code>.
*/
- public static final Attribute READING = new Attribute ("READING");
+ public static final Attribute READING = new Attribute("reading");
/**
* This is the attribute for input method segments. The value of attributes
@@ -85,7 +88,7 @@ public interface AttributedCharacterIterator extends CharacterIterator
* a <code>String</code>.
*/
public static final Attribute INPUT_METHOD_SEGMENT =
- new Attribute ("INPUT_METHOD_SEGMENT");
+ new Attribute("input_method_segment");
/**
* The name of the attribute key
@@ -98,7 +101,7 @@ public interface AttributedCharacterIterator extends CharacterIterator
*
* @param name The name of this attribute key.
*/
- protected Attribute (String name)
+ protected Attribute(String name)
{
this.name = name;
}
@@ -156,7 +159,7 @@ public interface AttributedCharacterIterator extends CharacterIterator
* @return <code>true</code> if the specified object is equal to this one,
* <code>false</code> otherwise.
*/
- public final boolean equals (Object obj)
+ public final boolean equals(Object obj)
{
if (obj == this)
return true;
@@ -192,7 +195,7 @@ public interface AttributedCharacterIterator extends CharacterIterator
*
* @return A list of keys
*/
- Set getAllAttributeKeys();
+ Set<Attribute> getAllAttributeKeys();
/**
* Returns a <code>Map</code> of the attributes defined for the current
@@ -200,7 +203,7 @@ public interface AttributedCharacterIterator extends CharacterIterator
*
* @return A <code>Map</code> of the attributes for the current character.
*/
- Map getAttributes();
+ Map<Attribute, Object> getAttributes();
/**
* Returns the value of the specified attribute for the
@@ -211,7 +214,7 @@ public interface AttributedCharacterIterator extends CharacterIterator
*
* @return The value of the specified attribute
*/
- Object getAttribute (AttributedCharacterIterator.Attribute attrib);
+ Object getAttribute(AttributedCharacterIterator.Attribute attrib);
/**
* Returns the index of the first character in the run that
@@ -230,7 +233,7 @@ public interface AttributedCharacterIterator extends CharacterIterator
*
* @return The start index of the run.
*/
- int getRunStart (Set attribs);
+ int getRunStart(Set<? extends Attribute> attribs);
/**
* Returns the index of the first character in the run that
@@ -240,7 +243,7 @@ public interface AttributedCharacterIterator extends CharacterIterator
*
* @return The start index of the run.
*/
- int getRunStart (AttributedCharacterIterator.Attribute attrib);
+ int getRunStart(AttributedCharacterIterator.Attribute attrib);
/**
* Returns the index of the character after the end of the run
@@ -259,7 +262,7 @@ public interface AttributedCharacterIterator extends CharacterIterator
*
* @return The end index of the run.
*/
- int getRunLimit (Set attribs);
+ int getRunLimit(Set<? extends Attribute> attribs);
/**
* Returns the index of the character after the end of the run
@@ -269,6 +272,6 @@ public interface AttributedCharacterIterator extends CharacterIterator
*
* @return The end index of the run.
*/
- int getRunLimit (AttributedCharacterIterator.Attribute attrib);
+ int getRunLimit(AttributedCharacterIterator.Attribute attrib);
} // interface AttributedCharacterIterator
diff --git a/libjava/classpath/java/text/AttributedString.java b/libjava/classpath/java/text/AttributedString.java
index 497b557fcf3..6785bd3c58f 100644
--- a/libjava/classpath/java/text/AttributedString.java
+++ b/libjava/classpath/java/text/AttributedString.java
@@ -1,5 +1,5 @@
/* AttributedString.java -- Models text with attributes
- Copyright (C) 1998, 1999, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2004, 2005, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,8 +50,11 @@ import java.util.Set;
* This class models a <code>String</code> with attributes over various
* subranges of the string. It allows applications to access this
* information via the <code>AttributedCharacterIterator</code> interface.
+ *
+ * @since 1.2
*
* @author Aaron M. Renn (arenn@urbanophile.com)
+ * @since 1.2
*/
public class AttributedString
{
@@ -66,23 +69,23 @@ public class AttributedString
Map attribs;
/** The beginning index of the attributes */
- int begin_index;
+ int beginIndex;
/** The ending index of the attributes */
- int end_index;
+ int endIndex;
/**
* Creates a new attribute range.
*
* @param attribs the attributes.
- * @param begin_index the start index.
- * @param end_index the end index.
+ * @param beginIndex the start index.
+ * @param endIndex the end index.
*/
- AttributeRange(Map attribs, int begin_index, int end_index)
+ AttributeRange(Map attribs, int beginIndex, int endIndex)
{
this.attribs = attribs;
- this.begin_index = begin_index;
- this.end_index = end_index;
+ this.beginIndex = beginIndex;
+ this.endIndex = endIndex;
}
} // Inner class AttributeRange
@@ -116,7 +119,8 @@ public class AttributedString
* @param str The <code>String</code> to be attributed.
* @param attributes The attribute list.
*/
- public AttributedString(String str, Map attributes)
+ public AttributedString(String str,
+ Map<? extends AttributedCharacterIterator.Attribute, ?> attributes)
{
this(str);
@@ -147,13 +151,13 @@ public class AttributedString
*
* @param aci The <code>AttributedCharacterIterator</code> containing the
* text and attribute information.
- * @param begin_index The beginning index of the text subrange.
- * @param end_index The ending index of the text subrange.
+ * @param beginIndex The beginning index of the text subrange.
+ * @param endIndex The ending index of the text subrange.
*/
- public AttributedString(AttributedCharacterIterator aci, int begin_index,
- int end_index)
+ public AttributedString(AttributedCharacterIterator aci, int beginIndex,
+ int endIndex)
{
- this(aci, begin_index, end_index, null);
+ this(aci, beginIndex, endIndex, null);
}
/**
@@ -181,9 +185,9 @@ public class AttributedString
StringBuffer sb = new StringBuffer("");
// Get the valid attribute list
- Set all_attribs = aci.getAllAttributeKeys();
+ Set allAttribs = aci.getAllAttributeKeys();
if (attributes != null)
- all_attribs.retainAll(Arrays.asList(attributes));
+ allAttribs.retainAll(Arrays.asList(attributes));
// Loop through and extract the attributes
char c = aci.setIndex(begin);
@@ -193,7 +197,7 @@ public class AttributedString
{
sb.append(c);
- Iterator iter = all_attribs.iterator();
+ Iterator iter = allAttribs.iterator();
while(iter.hasNext())
{
Object obj = iter.next();
@@ -206,9 +210,10 @@ public class AttributedString
(AttributedCharacterIterator.Attribute)obj;
// Make sure the attribute is defined.
- int rl = aci.getRunLimit(attrib);
- if (rl == -1)
+ Object attribObj = aci.getAttribute(attrib);
+ if (attribObj == null)
continue;
+ int rl = aci.getRunLimit(attrib);
if (rl > end)
rl = end;
rl -= begin;
@@ -220,22 +225,21 @@ public class AttributedString
// If the attribute run starts before the beginning index, we
// need to junk it if it is an Annotation.
- Object attrib_obj = aci.getAttribute(attrib);
- rs -= begin;
+ rs -= begin;
if (rs < 0)
{
- if (attrib_obj instanceof Annotation)
+ if (attribObj instanceof Annotation)
continue;
rs = 0;
}
// Create a map object. Yes this will only contain one attribute
- Map new_map = new Hashtable();
- new_map.put(attrib, attrib_obj);
+ Map newMap = new Hashtable();
+ newMap.put(attrib, attribObj);
// Add it to the attribute list.
- accum.add(new AttributeRange(new_map, rs, rl));
+ accum.add(new AttributeRange(newMap, rs, rl));
}
c = aci.next();
@@ -290,27 +294,28 @@ public class AttributedString
* specified subrange of the string.
*
* @param attributes The list of attributes.
- * @param begin_index The beginning index.
- * @param end_index The ending index
+ * @param beginIndex The beginning index.
+ * @param endIndex The ending index
*
* @throws NullPointerException if <code>attributes</code> is
* <code>null</code>.
* @throws IllegalArgumentException if the subrange is not valid.
*/
- public void addAttributes(Map attributes, int begin_index, int end_index)
+ public void addAttributes(Map<? extends AttributedCharacterIterator.Attribute, ?> attributes,
+ int beginIndex, int endIndex)
{
if (attributes == null)
throw new NullPointerException("null attribute");
- if ((begin_index < 0) || (end_index > sci.getEndIndex()) ||
- (end_index <= begin_index))
+ if ((beginIndex < 0) || (endIndex > sci.getEndIndex()) ||
+ (endIndex <= beginIndex))
throw new IllegalArgumentException("bad range");
AttributeRange[] new_list = new AttributeRange[attribs.length + 1];
System.arraycopy(attribs, 0, new_list, 0, attribs.length);
attribs = new_list;
- attribs[attribs.length - 1] = new AttributeRange(attributes, begin_index,
- end_index);
+ attribs[attribs.length - 1] = new AttributeRange(attributes, beginIndex,
+ endIndex);
}
/**
@@ -351,20 +356,20 @@ public class AttributedString
* returned.
*
* @param attributes A list of attributes to include in the returned iterator.
- * @param begin_index The beginning index of the subrange.
- * @param end_index The ending index of the subrange.
+ * @param beginIndex The beginning index of the subrange.
+ * @param endIndex The ending index of the subrange.
*
* @return An <code>AttributedCharacterIterator</code> for this string.
*/
public AttributedCharacterIterator getIterator(
AttributedCharacterIterator.Attribute[] attributes,
- int begin_index, int end_index)
+ int beginIndex, int endIndex)
{
- if ((begin_index < 0) || (end_index > sci.getEndIndex()) ||
- (end_index < begin_index))
+ if ((beginIndex < 0) || (endIndex > sci.getEndIndex()) ||
+ (endIndex < beginIndex))
throw new IllegalArgumentException("bad range");
- return(new AttributedStringIterator(sci, attribs, begin_index, end_index,
+ return(new AttributedStringIterator(sci, attribs, beginIndex, endIndex,
attributes));
}
diff --git a/libjava/classpath/java/text/AttributedStringIterator.java b/libjava/classpath/java/text/AttributedStringIterator.java
index f6b9b186831..422876c0948 100644
--- a/libjava/classpath/java/text/AttributedStringIterator.java
+++ b/libjava/classpath/java/text/AttributedStringIterator.java
@@ -1,5 +1,5 @@
/* AttributedStringIterator.java -- Class to iterate over AttributedString
- Copyright (C) 1998, 1999, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2004, 2005, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -71,12 +71,21 @@ class AttributedStringIterator implements AttributedCharacterIterator
/*************************************************************************/
+ /**
+ * Creates a new instance.
+ *
+ * @param sci an iterator for the string content.
+ * @param attribs the attribute ranges.
+ * @param beginIndex the start index.
+ * @param endIndex the end index.
+ * @param restricts the attributes that the user is interested in.
+ */
AttributedStringIterator(StringCharacterIterator sci,
AttributedString.AttributeRange[] attribs,
- int begin_index, int end_index,
+ int beginIndex, int endIndex,
AttributedCharacterIterator.Attribute[] restricts)
{
- this.ci = new StringCharacterIterator(sci, begin_index, end_index);
+ this.ci = new StringCharacterIterator(sci, beginIndex, endIndex);
this.attribs = attribs;
this.restricts = restricts;
}
@@ -154,8 +163,8 @@ class AttributedStringIterator implements AttributedCharacterIterator
for (int i = 0; i < attribs.length; i++)
{
- if (attribs[i].begin_index > getEndIndex()
- || attribs[i].end_index <= getBeginIndex())
+ if (attribs[i].beginIndex > getEndIndex()
+ || attribs[i].endIndex <= getBeginIndex())
continue;
Set key_set = attribs[i].attribs.keySet();
@@ -178,7 +187,7 @@ class AttributedStringIterator implements AttributedCharacterIterator
public int getRunLimit()
{
- return(getRunLimit(getAttributes().keySet()));
+ return getRunLimit(getAllAttributeKeys());
}
public int getRunLimit(AttributedCharacterIterator.Attribute attrib)
@@ -333,7 +342,7 @@ class AttributedStringIterator implements AttributedCharacterIterator
return null;
for (int i = attribs.length - 1; i >= 0; i--)
{
- if (pos >= attribs[i].begin_index && pos < attribs[i].end_index)
+ if (pos >= attribs[i].beginIndex && pos < attribs[i].endIndex)
{
Set keys = attribs[i].attribs.keySet();
if (keys.contains(key))
@@ -373,8 +382,8 @@ class AttributedStringIterator implements AttributedCharacterIterator
for (int i = 0; i < attribs.length; i++)
{
- if ((ci.getIndex() >= attribs[i].begin_index) &&
- (ci.getIndex() < attribs[i].end_index))
+ if ((ci.getIndex() >= attribs[i].beginIndex) &&
+ (ci.getIndex() < attribs[i].endIndex))
m.putAll(attribs[i].attribs);
}
diff --git a/libjava/classpath/java/text/Bidi.java b/libjava/classpath/java/text/Bidi.java
index 05b10f52d6a..491f9e36ef7 100644
--- a/libjava/classpath/java/text/Bidi.java
+++ b/libjava/classpath/java/text/Bidi.java
@@ -991,7 +991,8 @@ public final class Bidi
&& dir != Character.DIRECTIONALITY_ARABIC_NUMBER
&& dir != Character.DIRECTIONALITY_COMMON_NUMBER_SEPARATOR
&& dir != Character.DIRECTIONALITY_SEGMENT_SEPARATOR
- && dir != Character.DIRECTIONALITY_WHITESPACE)
+ && dir != Character.DIRECTIONALITY_WHITESPACE
+ && dir != Character.DIRECTIONALITY_PARAGRAPH_SEPARATOR)
return true;
}
diff --git a/libjava/classpath/java/text/CollationKey.java b/libjava/classpath/java/text/CollationKey.java
index a467869b881..1ae8abc556c 100644
--- a/libjava/classpath/java/text/CollationKey.java
+++ b/libjava/classpath/java/text/CollationKey.java
@@ -65,7 +65,7 @@ import java.util.Arrays;
* @author Tom Tromey (tromey@cygnus.com)
* @date March 25, 1999
*/
-public final class CollationKey implements Comparable
+public class CollationKey implements Comparable<CollationKey>
{
/**
* This is the <code>Collator</code> this object was created from.
@@ -112,21 +112,6 @@ public final class CollationKey implements Comparable
}
/**
- * This method compares the specified object to this one. The specified
- * object must be an instance of <code>CollationKey</code> or an exception
- * will be thrown. An integer is returned which indicates whether the
- * specified object is less than, greater than, or equal to this object.
- *
- * @param obj The <code>Object</code> to compare against this one.
- *
- * @return A negative integer if this object is less than the specified object, 0 if it is equal or a positive integer if it is greater than the specified object.
- */
- public int compareTo (Object obj)
- {
- return compareTo ((CollationKey) obj);
- }
-
- /**
* This method tests the specified <code>Object</code> for equality with
* this object. This will be true if and only if:
* <p>
diff --git a/libjava/classpath/java/text/Collator.java b/libjava/classpath/java/text/Collator.java
index 08739163a64..95236132440 100644
--- a/libjava/classpath/java/text/Collator.java
+++ b/libjava/classpath/java/text/Collator.java
@@ -70,7 +70,7 @@ import java.util.ResourceBundle;
* @author Aaron M. Renn (arenn@urbanophile.com)
* @date March 18, 1999
*/
-public abstract class Collator implements Comparator, Cloneable
+public abstract class Collator implements Comparator<Object>, Cloneable
{
/**
* This constant is a strength value which indicates that only primary
diff --git a/libjava/classpath/java/text/DecimalFormat.java b/libjava/classpath/java/text/DecimalFormat.java
index f64249b6755..529e571331f 100644
--- a/libjava/classpath/java/text/DecimalFormat.java
+++ b/libjava/classpath/java/text/DecimalFormat.java
@@ -35,387 +35,157 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+/*
+ * This class contains few bits from ICU4J (http://icu.sourceforge.net/),
+ * Copyright by IBM and others and distributed under the
+ * distributed under MIT/X.
+ */
+
package java.text;
-import gnu.java.text.AttributedFormatBuffer;
-import gnu.java.text.FormatBuffer;
-import gnu.java.text.FormatCharacterIterator;
-import gnu.java.text.StringFormatBuffer;
+import java.math.BigDecimal;
+import java.math.BigInteger;
-import java.io.IOException;
-import java.io.ObjectInputStream;
+import java.util.ArrayList;
import java.util.Currency;
-import java.util.HashMap;
import java.util.Locale;
-/**
+/*
+ * This note is here for historical reasons and because I had not the courage
+ * to remove it :)
+ *
* @author Tom Tromey (tromey@cygnus.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @date March 4, 1999
- */
-/* Written using "Java Class Libraries", 2nd edition, plus online
+ *
+ * Written using "Java Class Libraries", 2nd edition, plus online
* API docs for JDK 1.2 from http://www.javasoft.com.
* Status: Believed complete and correct to 1.2.
* Note however that the docs are very unclear about how format parsing
* should work. No doubt there are problems here.
*/
+
+/**
+ * This class is a concrete implementation of NumberFormat used to format
+ * decimal numbers. The class can format numbers given a specific locale.
+ * Generally, to get an instance of DecimalFormat you should call the factory
+ * methods in the <code>NumberFormat</code> base class.
+ *
+ * @author Mario Torre <neugens@limasoftware.net>
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ */
public class DecimalFormat extends NumberFormat
{
- // This is a helper for applyPatternWithSymbols. It reads a prefix
- // or a suffix. It can cause some side-effects.
- private int scanFix (String pattern, int index, FormatBuffer buf,
- String patChars, DecimalFormatSymbols syms,
- boolean is_suffix)
- {
- int len = pattern.length();
- boolean quoteStarted = false;
- buf.clear();
-
- boolean multiplierSet = false;
- while (index < len)
- {
- char c = pattern.charAt(index);
-
- if (quoteStarted)
- {
- if (c == '\'')
- quoteStarted = false;
- else
- buf.append(c);
- index++;
- continue;
- }
-
- if (c == '\'' && index + 1 < len
- && pattern.charAt(index + 1) == '\'')
- {
- buf.append(c);
- index++;
- }
- else if (c == '\'')
- {
- quoteStarted = true;
- }
- else if (c == '\u00a4')
- {
- /* Currency interpreted later */
- buf.append(c);
- }
- else if (c == syms.getPercent())
- {
- if (multiplierSet)
- throw new IllegalArgumentException ("multiplier already set " +
- "- index: " + index);
- multiplierSet = true;
- multiplier = 100;
- buf.append(c, NumberFormat.Field.PERCENT);
- }
- else if (c == syms.getPerMill())
- {
- if (multiplierSet)
- throw new IllegalArgumentException ("multiplier already set " +
- "- index: " + index);
- multiplierSet = true;
- multiplier = 1000;
- buf.append(c, NumberFormat.Field.PERMILLE);
- }
- else if (patChars.indexOf(c) != -1)
- {
- // This is a pattern character.
- break;
- }
- else
- {
- buf.append(c);
- }
- index++;
- }
-
- if (quoteStarted)
- throw new IllegalArgumentException ("pattern is lacking a closing quote");
-
- return index;
- }
-
- // A helper which reads a number format.
- private int scanFormat (String pattern, int index, String patChars,
- DecimalFormatSymbols syms, boolean is_positive)
- {
- int max = pattern.length();
-
- int countSinceGroup = 0;
- int zeroCount = 0;
- boolean saw_group = false;
-
- //
- // Scan integer part.
- //
- while (index < max)
- {
- char c = pattern.charAt(index);
-
- if (c == syms.getDigit())
- {
- if (zeroCount > 0)
- throw new IllegalArgumentException ("digit mark following " +
- "zero - index: " + index);
- ++countSinceGroup;
- }
- else if (c == syms.getZeroDigit())
- {
- ++zeroCount;
- ++countSinceGroup;
- }
- else if (c == syms.getGroupingSeparator())
- {
- countSinceGroup = 0;
- saw_group = true;
- }
- else
- break;
-
- ++index;
- }
-
- // We can only side-effect when parsing the positive format.
- if (is_positive)
- {
- groupingUsed = saw_group;
- groupingSize = (byte) countSinceGroup;
- // Checking "zeroCount > 0" avoids 0 being formatted into "" with "#".
- if (zeroCount > 0)
- minimumIntegerDigits = zeroCount;
- }
-
- // Early termination.
- if (index == max || pattern.charAt(index) == syms.getGroupingSeparator())
- {
- if (is_positive)
- decimalSeparatorAlwaysShown = false;
- return index;
- }
-
- if (pattern.charAt(index) == syms.getDecimalSeparator())
- {
- ++index;
-
- //
- // Scan fractional part.
- //
- int hashCount = 0;
- zeroCount = 0;
- while (index < max)
- {
- char c = pattern.charAt(index);
- if (c == syms.getZeroDigit())
- {
- if (hashCount > 0)
- throw new IllegalArgumentException ("zero mark " +
- "following digit - index: " + index);
- ++zeroCount;
- }
- else if (c == syms.getDigit())
- {
- ++hashCount;
- }
- else if (c != syms.getExponential()
- && c != syms.getPatternSeparator()
- && c != syms.getPercent()
- && c != syms.getPerMill()
- && patChars.indexOf(c) != -1)
- throw new IllegalArgumentException ("unexpected special " +
- "character - index: " + index);
- else
- break;
-
- ++index;
- }
-
- if (is_positive)
- {
- maximumFractionDigits = hashCount + zeroCount;
- minimumFractionDigits = zeroCount;
- }
-
- if (index == max)
- return index;
- }
-
- if (pattern.charAt(index) == syms.getExponential())
- {
- //
- // Scan exponential format.
- //
- zeroCount = 0;
- ++index;
- while (index < max)
- {
- char c = pattern.charAt(index);
- if (c == syms.getZeroDigit())
- ++zeroCount;
- else if (c == syms.getDigit())
- {
- if (zeroCount > 0)
- throw new
- IllegalArgumentException ("digit mark following zero " +
- "in exponent - index: " +
- index);
- }
- else if (patChars.indexOf(c) != -1)
- throw new IllegalArgumentException ("unexpected special " +
- "character - index: " +
- index);
- else
- break;
-
- ++index;
- }
-
- if (is_positive)
- {
- useExponentialNotation = true;
- minExponentDigits = (byte) zeroCount;
- }
-
- maximumIntegerDigits = groupingSize;
- groupingSize = 0;
- if (maximumIntegerDigits > minimumIntegerDigits && maximumIntegerDigits > 0)
- {
- minimumIntegerDigits = 1;
- exponentRound = maximumIntegerDigits;
- }
- else
- exponentRound = 1;
- }
-
- return index;
- }
-
- // This helper function creates a string consisting of all the
- // characters which can appear in a pattern and must be quoted.
- private String patternChars (DecimalFormatSymbols syms)
- {
- StringBuffer buf = new StringBuffer ();
- buf.append(syms.getDecimalSeparator());
- buf.append(syms.getDigit());
- buf.append(syms.getExponential());
- buf.append(syms.getGroupingSeparator());
- // Adding this one causes pattern application to fail.
- // Of course, omitting is causes toPattern to fail.
- // ... but we already have bugs there. FIXME.
- // buf.append(syms.getMinusSign());
- buf.append(syms.getPatternSeparator());
- buf.append(syms.getPercent());
- buf.append(syms.getPerMill());
- buf.append(syms.getZeroDigit());
- buf.append('\u00a4');
- return buf.toString();
- }
-
- private void applyPatternWithSymbols(String pattern, DecimalFormatSymbols syms)
- {
- // Initialize to the state the parser expects.
- negativePrefix = "";
- negativeSuffix = "";
- positivePrefix = "";
- positiveSuffix = "";
- decimalSeparatorAlwaysShown = false;
- groupingSize = 0;
- minExponentDigits = 0;
- multiplier = 1;
- useExponentialNotation = false;
- groupingUsed = false;
- maximumFractionDigits = 0;
- maximumIntegerDigits = MAXIMUM_INTEGER_DIGITS;
- minimumFractionDigits = 0;
- minimumIntegerDigits = 1;
-
- AttributedFormatBuffer buf = new AttributedFormatBuffer ();
- String patChars = patternChars (syms);
-
- int max = pattern.length();
- int index = scanFix (pattern, 0, buf, patChars, syms, false);
- buf.sync();
- positivePrefix = buf.getBuffer().toString();
- positivePrefixRanges = buf.getRanges();
- positivePrefixAttrs = buf.getAttributes();
-
- index = scanFormat (pattern, index, patChars, syms, true);
-
- index = scanFix (pattern, index, buf, patChars, syms, true);
- buf.sync();
- positiveSuffix = buf.getBuffer().toString();
- positiveSuffixRanges = buf.getRanges();
- positiveSuffixAttrs = buf.getAttributes();
-
- if (index == pattern.length())
- {
- // No negative info.
- negativePrefix = null;
- negativeSuffix = null;
- }
- else
- {
- if (pattern.charAt(index) != syms.getPatternSeparator())
- throw new IllegalArgumentException ("separator character " +
- "expected - index: " + index);
-
- index = scanFix (pattern, index + 1, buf, patChars, syms, false);
- buf.sync();
- negativePrefix = buf.getBuffer().toString();
- negativePrefixRanges = buf.getRanges();
- negativePrefixAttrs = buf.getAttributes();
-
- // We parse the negative format for errors but we don't let
- // it side-effect this object.
- index = scanFormat (pattern, index, patChars, syms, false);
-
- index = scanFix (pattern, index, buf, patChars, syms, true);
- buf.sync();
- negativeSuffix = buf.getBuffer().toString();
- negativeSuffixRanges = buf.getRanges();
- negativeSuffixAttrs = buf.getAttributes();
-
- if (index != pattern.length())
- throw new IllegalArgumentException ("end of pattern expected " +
- "- index: " + index);
- }
- }
-
- public void applyLocalizedPattern (String pattern)
- {
- // JCL p. 638 claims this throws a ParseException but p. 629
- // contradicts this. Empirical tests with patterns of "0,###.0"
- // and "#.#.#" corroborate the p. 629 statement that an
- // IllegalArgumentException is thrown.
- applyPatternWithSymbols (pattern, symbols);
- }
-
- public void applyPattern (String pattern)
- {
- // JCL p. 638 claims this throws a ParseException but p. 629
- // contradicts this. Empirical tests with patterns of "0,###.0"
- // and "#.#.#" corroborate the p. 629 statement that an
- // IllegalArgumentException is thrown.
- applyPatternWithSymbols (pattern, nonLocalizedSymbols);
- }
-
- public Object clone ()
- {
- DecimalFormat c = (DecimalFormat) super.clone ();
- c.symbols = (DecimalFormatSymbols) symbols.clone ();
- return c;
- }
+ /** serialVersionUID for serializartion. */
+ private static final long serialVersionUID = 864413376551465018L;
+
+ /** Defines the default number of digits allowed while formatting integers. */
+ private static final int DEFAULT_INTEGER_DIGITS = 309;
/**
+ * Defines the default number of digits allowed while formatting
+ * fractions.
+ */
+ private static final int DEFAULT_FRACTION_DIGITS = 340;
+
+ /**
+ * Locale-independent pattern symbols.
+ */
+ // Happen to be the same as the US symbols.
+ private static final DecimalFormatSymbols nonLocalizedSymbols
+ = new DecimalFormatSymbols (Locale.US);
+
+ /**
+ * Defines if parse should return a BigDecimal or not.
+ */
+ private boolean parseBigDecimal;
+
+ /**
+ * Defines if we have to use the monetary decimal separator or
+ * the decimal separator while formatting numbers.
+ */
+ private boolean useCurrencySeparator;
+
+ /** Defines if the decimal separator is always shown or not. */
+ private boolean decimalSeparatorAlwaysShown;
+
+ /**
+ * Defines if the decimal separator has to be shown.
+ *
+ * This is different then <code>decimalSeparatorAlwaysShown</code>,
+ * as it defines if the format string contains a decimal separator or no.
+ */
+ private boolean showDecimalSeparator;
+
+ /**
+ * This field is used to determine if the grouping
+ * separator is included in the format string or not.
+ * This is only needed to match the behaviour of the RI.
+ */
+ private boolean groupingSeparatorInPattern;
+
+ /** Defines the size of grouping groups when grouping is used. */
+ private byte groupingSize;
+
+ /**
+ * This is an internal parameter used to keep track of the number
+ * of digits the form the exponent, when exponential notation is used.
+ * It is used with <code>exponentRound</code>
+ */
+ private byte minExponentDigits;
+
+ /** This field is used to set the exponent in the engineering notation. */
+ private int exponentRound;
+
+ /** Multiplier used in percent style formats. */
+ private int multiplier;
+
+ /** Multiplier used in percent style formats. */
+ private int negativePatternMultiplier;
+
+ /** The negative prefix. */
+ private String negativePrefix;
+
+ /** The negative suffix. */
+ private String negativeSuffix;
+
+ /** The positive prefix. */
+ private String positivePrefix;
+
+ /** The positive suffix. */
+ private String positiveSuffix;
+
+ /** Decimal Format Symbols for the given locale. */
+ private DecimalFormatSymbols symbols;
+
+ /** Determine if we have to use exponential notation or not. */
+ private boolean useExponentialNotation;
+
+ /**
+ * Defines the maximum number of integer digits to show when we use
+ * the exponential notation.
+ */
+ private int maxIntegerDigitsExponent;
+
+ /** Defines if the format string has a negative prefix or not. */
+ private boolean hasNegativePrefix;
+
+ /** Defines if the format string has a fractional pattern or not. */
+ private boolean hasFractionalPattern;
+
+ /** Stores a list of attributes for use by formatToCharacterIterator. */
+ private ArrayList attributes = new ArrayList();
+
+ /**
* Constructs a <code>DecimalFormat</code> which uses the default
* pattern and symbols.
*/
- public DecimalFormat ()
+ public DecimalFormat()
{
this ("#,##0.###");
}
-
+
/**
* Constructs a <code>DecimalFormat</code> which uses the given
* pattern and the default symbols for formatting and parsing.
@@ -424,9 +194,9 @@ public class DecimalFormat extends NumberFormat
* @throws NullPointerException if any argument is null.
* @throws IllegalArgumentException if the pattern is invalid.
*/
- public DecimalFormat (String pattern)
+ public DecimalFormat(String pattern)
{
- this (pattern, new DecimalFormatSymbols ());
+ this (pattern, new DecimalFormatSymbols());
}
/**
@@ -442,14 +212,38 @@ public class DecimalFormat extends NumberFormat
public DecimalFormat(String pattern, DecimalFormatSymbols symbols)
{
this.symbols = (DecimalFormatSymbols) symbols.clone();
- applyPattern(pattern);
+ applyPatternWithSymbols(pattern, nonLocalizedSymbols);
+ }
+
+ /**
+ * Apply the given localized patern to the current DecimalFormat object.
+ *
+ * @param pattern The localized pattern to apply.
+ * @throws IllegalArgumentException if the given pattern is invalid.
+ * @throws NullPointerException if the input pattern is null.
+ */
+ public void applyLocalizedPattern (String pattern)
+ {
+ applyPatternWithSymbols(pattern, this.symbols);
}
- private boolean equals(String s1, String s2)
+ /**
+ * Apply the given localized pattern to the current DecimalFormat object.
+ *
+ * @param pattern The localized pattern to apply.
+ * @throws IllegalArgumentException if the given pattern is invalid.
+ * @throws NullPointerException if the input pattern is null.
+ */
+ public void applyPattern(String pattern)
{
- if (s1 == null || s2 == null)
- return s1 == s2;
- return s1.equals(s2);
+ applyPatternWithSymbols(pattern, nonLocalizedSymbols);
+ }
+
+ public Object clone()
+ {
+ DecimalFormat c = (DecimalFormat) super.clone();
+ c.symbols = (DecimalFormatSymbols) symbols.clone();
+ return c;
}
/**
@@ -471,8 +265,9 @@ public class DecimalFormat extends NumberFormat
return false;
DecimalFormat dup = (DecimalFormat) obj;
return (decimalSeparatorAlwaysShown == dup.decimalSeparatorAlwaysShown
- && groupingUsed == dup.groupingUsed
- && groupingSize == dup.groupingSize
+ && groupingUsed == dup.groupingUsed
+ && groupingSeparatorInPattern == dup.groupingSeparatorInPattern
+ && groupingSize == dup.groupingSize
&& multiplier == dup.multiplier
&& useExponentialNotation == dup.useExponentialNotation
&& minExponentDigits == dup.minExponentDigits
@@ -480,6 +275,14 @@ public class DecimalFormat extends NumberFormat
&& maximumIntegerDigits == dup.maximumIntegerDigits
&& minimumFractionDigits == dup.minimumFractionDigits
&& maximumFractionDigits == dup.maximumFractionDigits
+ && parseBigDecimal == dup.parseBigDecimal
+ && useCurrencySeparator == dup.useCurrencySeparator
+ && showDecimalSeparator == dup.showDecimalSeparator
+ && exponentRound == dup.exponentRound
+ && negativePatternMultiplier == dup.negativePatternMultiplier
+ && maxIntegerDigitsExponent == dup.maxIntegerDigitsExponent
+ // XXX: causes equivalent patterns to fail
+ // && hasNegativePrefix == dup.hasNegativePrefix
&& equals(negativePrefix, dup.negativePrefix)
&& equals(negativeSuffix, dup.negativeSuffix)
&& equals(positivePrefix, dup.positivePrefix)
@@ -487,306 +290,163 @@ public class DecimalFormat extends NumberFormat
&& symbols.equals(dup.symbols));
}
- private void formatInternal (double number, FormatBuffer dest,
- FieldPosition fieldPos)
+ /**
+ * Returns a hash code for this object.
+ *
+ * @return A hash code.
+ */
+ public int hashCode()
{
- // A very special case.
- if (Double.isNaN(number))
- {
- dest.append(symbols.getNaN());
- if (fieldPos != null &&
- (fieldPos.getField() == INTEGER_FIELD ||
- fieldPos.getFieldAttribute() == NumberFormat.Field.INTEGER))
- {
- int index = dest.length();
- fieldPos.setBeginIndex(index - symbols.getNaN().length());
- fieldPos.setEndIndex(index);
- }
- return;
- }
-
- boolean is_neg = number < 0;
- if (is_neg)
- {
- if (negativePrefix != null)
- {
- dest.append(substituteCurrency(negativePrefix, number),
- negativePrefixRanges, negativePrefixAttrs);
- }
- else
- {
- dest.append(symbols.getMinusSign(), NumberFormat.Field.SIGN);
- dest.append(substituteCurrency(positivePrefix, number),
- positivePrefixRanges, positivePrefixAttrs);
- }
- number = - number;
- }
- else
- {
- dest.append(substituteCurrency(positivePrefix, number),
- positivePrefixRanges, positivePrefixAttrs);
- }
- int integerBeginIndex = dest.length();
- int integerEndIndex = 0;
- int zeroStart = symbols.getZeroDigit() - '0';
-
- if (Double.isInfinite (number))
+ return toPattern().hashCode();
+ }
+
+ /**
+ * Produce a formatted {@link String} representation of this object.
+ * The passed object must be of type number.
+ *
+ * @param obj The {@link Number} to format.
+ * @param sbuf The destination String; text will be appended to this String.
+ * @param pos If used on input can be used to define an alignment
+ * field. If used on output defines the offsets of the alignment field.
+ * @return The String representation of this long.
+ */
+ public StringBuffer format(Object obj, StringBuffer sbuf, FieldPosition pos)
+ {
+ if (obj instanceof BigInteger)
{
- dest.append(symbols.getInfinity());
- integerEndIndex = dest.length();
+ BigDecimal decimal = new BigDecimal((BigInteger) obj);
+ formatInternal(decimal, true, sbuf, pos);
+ return sbuf;
}
- else
+ else if (obj instanceof BigDecimal)
{
- number *= multiplier;
-
- // Compute exponent.
- long exponent = 0;
- double baseNumber;
- if (useExponentialNotation && number > 0)
- {
- exponent = (long) Math.floor (Math.log10(number));
- exponent = exponent - (exponent % exponentRound);
- if (minimumIntegerDigits > 0)
- exponent -= minimumIntegerDigits - 1;
- baseNumber = (number / Math.pow(10.0, exponent));
- }
- else
- baseNumber = number;
-
- // Round to the correct number of digits.
- baseNumber += 5 * Math.pow(10.0, - maximumFractionDigits - 1);
-
- int index = dest.length();
- //double intPart = Math.floor(baseNumber);
- String intPart = Long.toString((long)Math.floor(baseNumber));
- int count, groupPosition = intPart.length();
-
- dest.setDefaultAttribute(NumberFormat.Field.INTEGER);
-
- for (count = 0; count < minimumIntegerDigits-intPart.length(); count++)
- dest.append(symbols.getZeroDigit());
-
- for (count = 0;
- count < maximumIntegerDigits && count < intPart.length();
- count++)
- {
- int dig = intPart.charAt(count);
-
- // Append group separator if required.
- if (groupingUsed && count > 0 && groupingSize != 0 && groupPosition % groupingSize == 0)
- {
- dest.append(symbols.getGroupingSeparator(), NumberFormat.Field.GROUPING_SEPARATOR);
- dest.setDefaultAttribute(NumberFormat.Field.INTEGER);
- }
- dest.append((char) (zeroStart + dig));
-
- groupPosition--;
- }
- dest.setDefaultAttribute(null);
-
- integerEndIndex = dest.length();
-
- int decimal_index = integerEndIndex;
- int consecutive_zeros = 0;
- int total_digits = 0;
-
- int localMaximumFractionDigits = maximumFractionDigits;
-
- if (useExponentialNotation)
- localMaximumFractionDigits += minimumIntegerDigits - count;
-
- // Strip integer part from NUMBER.
- double fracPart = baseNumber - Math.floor(baseNumber);
-
- if ( ((fracPart != 0 || minimumFractionDigits > 0) && localMaximumFractionDigits > 0)
- || decimalSeparatorAlwaysShown)
- {
- dest.append (symbols.getDecimalSeparator(), NumberFormat.Field.DECIMAL_SEPARATOR);
- }
-
- int fraction_begin = dest.length();
- dest.setDefaultAttribute(NumberFormat.Field.FRACTION);
- for (count = 0;
- count < localMaximumFractionDigits
- && (fracPart != 0 || count < minimumFractionDigits);
- ++count)
- {
- ++total_digits;
- fracPart *= 10;
- long dig = (long) fracPart;
- if (dig == 0)
- ++consecutive_zeros;
- else
- consecutive_zeros = 0;
- dest.append((char) (symbols.getZeroDigit() + dig));
-
- // Strip integer part from FRACPART.
- fracPart = fracPart - Math.floor (fracPart);
- }
-
- // Strip extraneous trailing `0's. We can't always detect
- // these in the loop.
- int extra_zeros = Math.min (consecutive_zeros,
- total_digits - minimumFractionDigits);
- if (extra_zeros > 0)
- {
- dest.cutTail(extra_zeros);
- total_digits -= extra_zeros;
- if (total_digits == 0 && !decimalSeparatorAlwaysShown)
- dest.cutTail(1);
- }
-
- if (fieldPos != null && fieldPos.getField() == FRACTION_FIELD)
- {
- fieldPos.setBeginIndex(fraction_begin);
- fieldPos.setEndIndex(dest.length());
- }
-
- // Finally, print the exponent.
- if (useExponentialNotation)
- {
- dest.append(symbols.getExponential(), NumberFormat.Field.EXPONENT_SYMBOL);
- if (exponent < 0)
- {
- dest.append (symbols.getMinusSign (), NumberFormat.Field.EXPONENT_SIGN);
- exponent = - exponent;
- }
- index = dest.length();
- dest.setDefaultAttribute(NumberFormat.Field.EXPONENT);
- String exponentString = Long.toString ((long) exponent);
-
- for (count = 0; count < minExponentDigits-exponentString.length();
- count++)
- dest.append((char) symbols.getZeroDigit());
-
- for (count = 0;
- count < exponentString.length();
- ++count)
- {
- int dig = exponentString.charAt(count);
- dest.append((char) (zeroStart + dig));
- }
- }
+ formatInternal((BigDecimal) obj, true, sbuf, pos);
+ return sbuf;
}
-
- if (fieldPos != null &&
- (fieldPos.getField() == INTEGER_FIELD ||
- fieldPos.getFieldAttribute() == NumberFormat.Field.INTEGER))
+
+ return super.format(obj, sbuf, pos);
+ }
+
+ /**
+ * Produce a formatted {@link String} representation of this double.
+ *
+ * @param number The double to format.
+ * @param dest The destination String; text will be appended to this String.
+ * @param fieldPos If used on input can be used to define an alignment
+ * field. If used on output defines the offsets of the alignment field.
+ * @return The String representation of this long.
+ * @throws NullPointerException if <code>dest</code> or fieldPos are null
+ */
+ public StringBuffer format(double number, StringBuffer dest,
+ FieldPosition fieldPos)
+ {
+ // special cases for double: NaN and negative or positive infinity
+ if (Double.isNaN(number))
{
- fieldPos.setBeginIndex(integerBeginIndex);
- fieldPos.setEndIndex(integerEndIndex);
+ // 1. NaN
+ String nan = symbols.getNaN();
+ dest.append(nan);
+
+ // update field position if required
+ if ((fieldPos.getField() == INTEGER_FIELD ||
+ fieldPos.getFieldAttribute() == NumberFormat.Field.INTEGER))
+ {
+ int index = dest.length();
+ fieldPos.setBeginIndex(index - nan.length());
+ fieldPos.setEndIndex(index);
+ }
}
-
- if (is_neg && negativeSuffix != null)
+ else if (Double.isInfinite(number))
{
- dest.append(substituteCurrency(negativeSuffix, number),
- negativeSuffixRanges, negativeSuffixAttrs);
+ // 2. Infinity
+ if (number < 0)
+ dest.append(this.negativePrefix);
+ else
+ dest.append(this.positivePrefix);
+
+ dest.append(symbols.getInfinity());
+
+ if (number < 0)
+ dest.append(this.negativeSuffix);
+ else
+ dest.append(this.positiveSuffix);
+
+ if ((fieldPos.getField() == INTEGER_FIELD ||
+ fieldPos.getFieldAttribute() == NumberFormat.Field.INTEGER))
+ {
+ fieldPos.setBeginIndex(dest.length());
+ fieldPos.setEndIndex(0);
+ }
}
else
{
- dest.append(substituteCurrency(positiveSuffix, number),
- positiveSuffixRanges, positiveSuffixAttrs);
+ // get the number as a BigDecimal
+ BigDecimal bigDecimal = new BigDecimal(String.valueOf(number));
+ formatInternal(bigDecimal, false, dest, fieldPos);
}
+
+ return dest;
}
- public StringBuffer format (double number, StringBuffer dest,
- FieldPosition fieldPos)
+ /**
+ * Produce a formatted {@link String} representation of this long.
+ *
+ * @param number The long to format.
+ * @param dest The destination String; text will be appended to this String.
+ * @param fieldPos If used on input can be used to define an alignment
+ * field. If used on output defines the offsets of the alignment field.
+ * @return The String representation of this long.
+ */
+ public StringBuffer format(long number, StringBuffer dest,
+ FieldPosition fieldPos)
{
- formatInternal (number, new StringFormatBuffer(dest), fieldPos);
+ BigDecimal bigDecimal = new BigDecimal(String.valueOf(number));
+ formatInternal(bigDecimal, true, dest, fieldPos);
return dest;
}
-
- public AttributedCharacterIterator formatToCharacterIterator (Object value)
+
+ /**
+ * Return an <code>AttributedCharacterIterator</code> as a result of
+ * the formatting of the passed {@link Object}.
+ *
+ * @return An {@link AttributedCharacterIterator}.
+ * @throws NullPointerException if value is <code>null</code>.
+ * @throws IllegalArgumentException if value is not an instance of
+ * {@link Number}.
+ */
+ public AttributedCharacterIterator formatToCharacterIterator(Object value)
{
- AttributedFormatBuffer sbuf = new AttributedFormatBuffer();
-
- if (value instanceof Number)
- formatInternal(((Number) value).doubleValue(), sbuf, null);
- else
- throw new IllegalArgumentException
- ("Cannot format given Object as a Number");
+ /*
+ * This method implementation derives directly from the
+ * ICU4J (http://icu.sourceforge.net/) library, distributed under MIT/X.
+ */
- sbuf.sync();
- return new FormatCharacterIterator(sbuf.getBuffer().toString(),
- sbuf.getRanges(),
- sbuf.getAttributes());
- }
-
- public StringBuffer format (long number, StringBuffer dest,
- FieldPosition fieldPos)
- {
- // If using exponential notation, we just format as a double.
- if (useExponentialNotation)
- return format ((double) number, dest, fieldPos);
-
- boolean is_neg = number < 0;
- if (is_neg)
- {
- if (negativePrefix != null)
- dest.append(substituteCurrency(negativePrefix, number));
- else
- {
- dest.append(symbols.getMinusSign());
- dest.append(substituteCurrency(positivePrefix, number));
- }
- number = - number;
- }
- else
- dest.append(substituteCurrency(positivePrefix, number));
-
- int integerBeginIndex = dest.length();
- int index = dest.length();
- int count = 0;
-
- /* Handle percentages, etc. */
- number *= multiplier;
- while (count < maximumIntegerDigits
- && (number > 0 || count < minimumIntegerDigits))
- {
- long dig = number % 10;
- number /= 10;
- // NUMBER and DIG will be less than 0 if the original number
- // was the most negative long.
- if (dig < 0)
- {
- dig = - dig;
- number = - number;
- }
-
- // Append group separator if required.
- if (groupingUsed && count > 0 && groupingSize != 0 && count % groupingSize == 0)
- dest.insert(index, symbols.getGroupingSeparator());
-
- dest.insert(index, (char) (symbols.getZeroDigit() + dig));
-
- ++count;
- }
+ if (value == null)
+ throw new NullPointerException("Passed Object is null");
+
+ if (!(value instanceof Number)) throw new
+ IllegalArgumentException("Cannot format given Object as a Number");
+
+ StringBuffer text = new StringBuffer();
+ attributes.clear();
+ super.format(value, text, new FieldPosition(0));
- if (fieldPos != null && fieldPos.getField() == INTEGER_FIELD)
- {
- fieldPos.setBeginIndex(integerBeginIndex);
- fieldPos.setEndIndex(dest.length());
- }
+ AttributedString as = new AttributedString(text.toString());
- if (decimalSeparatorAlwaysShown || minimumFractionDigits > 0)
+ // add NumberFormat field attributes to the AttributedString
+ for (int i = 0; i < attributes.size(); i++)
{
- dest.append(symbols.getDecimalSeparator());
- if (fieldPos != null && fieldPos.getField() == FRACTION_FIELD)
- {
- fieldPos.setBeginIndex(dest.length());
- fieldPos.setEndIndex(dest.length() + minimumFractionDigits);
- }
+ FieldPosition pos = (FieldPosition) attributes.get(i);
+ Format.Field attribute = pos.getFieldAttribute();
+
+ as.addAttribute(attribute, attribute, pos.getBeginIndex(), pos
+ .getEndIndex());
}
-
- for (count = 0; count < minimumFractionDigits; ++count)
- dest.append(symbols.getZeroDigit());
-
- dest.append((is_neg && negativeSuffix != null)
- ? substituteCurrency(negativeSuffix, number)
- : substituteCurrency(positiveSuffix, number));
- return dest;
+
+ // return the CharacterIterator from AttributedString
+ return as.getIterator();
}
-
+
/**
* Returns the currency corresponding to the currency symbol stored
* in the instance of <code>DecimalFormatSymbols</code> used by this
@@ -799,7 +459,7 @@ public class DecimalFormat extends NumberFormat
{
return symbols.getCurrency();
}
-
+
/**
* Returns a copy of the symbols used by this instance.
*
@@ -809,351 +469,326 @@ public class DecimalFormat extends NumberFormat
{
return (DecimalFormatSymbols) symbols.clone();
}
-
- public int getGroupingSize ()
+
+ /**
+ * Gets the interval used between a grouping separator and the next.
+ * For example, a grouping size of 3 means that the number 1234 is
+ * formatted as 1,234.
+ *
+ * The actual character used as grouping separator depends on the
+ * locale and is defined by {@link DecimalFormatSymbols#getDecimalSeparator()}
+ *
+ * @return The interval used between a grouping separator and the next.
+ */
+ public int getGroupingSize()
{
return groupingSize;
}
- public int getMultiplier ()
+ /**
+ * Gets the multiplier used in percent and similar formats.
+ *
+ * @return The multiplier used in percent and similar formats.
+ */
+ public int getMultiplier()
{
return multiplier;
}
-
- public String getNegativePrefix ()
+
+ /**
+ * Gets the negative prefix.
+ *
+ * @return The negative prefix.
+ */
+ public String getNegativePrefix()
{
return negativePrefix;
}
- public String getNegativeSuffix ()
+ /**
+ * Gets the negative suffix.
+ *
+ * @return The negative suffix.
+ */
+ public String getNegativeSuffix()
{
return negativeSuffix;
}
-
- public String getPositivePrefix ()
+
+ /**
+ * Gets the positive prefix.
+ *
+ * @return The positive prefix.
+ */
+ public String getPositivePrefix()
{
return positivePrefix;
}
-
- public String getPositiveSuffix ()
+
+ /**
+ * Gets the positive suffix.
+ *
+ * @return The positive suffix.
+ */
+ public String getPositiveSuffix()
{
return positiveSuffix;
}
-
+
+ public boolean isDecimalSeparatorAlwaysShown()
+ {
+ return decimalSeparatorAlwaysShown;
+ }
+
/**
- * Returns a hash code for this object.
- *
- * @return A hash code.
+ * Define if <code>parse(java.lang.String, java.text.ParsePosition)</code>
+ * should return a {@link BigDecimal} or not.
+ *
+ * @param newValue
*/
- public int hashCode()
+ public void setParseBigDecimal(boolean newValue)
{
- return toPattern().hashCode();
+ this.parseBigDecimal = newValue;
}
-
- public boolean isDecimalSeparatorAlwaysShown ()
+
+ /**
+ * Returns <code>true</code> if
+ * <code>parse(java.lang.String, java.text.ParsePosition)</code> returns
+ * a <code>BigDecimal</code>, <code>false</code> otherwise.
+ * The default return value for this method is <code>false</code>.
+ *
+ * @return <code>true</code> if the parse method returns a {@link BigDecimal},
+ * <code>false</code> otherwise.
+ * @since 1.5
+ * @see #setParseBigDecimal(boolean)
+ */
+ public boolean isParseBigDecimal()
{
- return decimalSeparatorAlwaysShown;
+ return this.parseBigDecimal;
}
-
- public Number parse (String str, ParsePosition pos)
+
+ /**
+ * This method parses the specified string into a <code>Number</code>.
+ *
+ * The parsing starts at <code>pos</code>, which is updated as the parser
+ * consume characters in the passed string.
+ * On error, the <code>Position</code> object index is not updated, while
+ * error position is set appropriately, an <code>null</code> is returned.
+ *
+ * @param str The string to parse.
+ * @param pos The desired <code>ParsePosition</code>.
+ *
+ * @return The parsed <code>Number</code>
+ */
+ public Number parse(String str, ParsePosition pos)
{
- /*
- * Our strategy is simple: copy the text into separate buffers: one for the int part,
- * one for the fraction part and for the exponential part.
- * We translate or omit locale-specific information.
- * If exponential is sufficiently big we merge the fraction and int part and
- * remove the '.' and then we use Long to convert the number. In the other
- * case, we use Double to convert the full number.
- */
-
- boolean is_neg = false;
- int index = pos.getIndex();
- StringBuffer int_buf = new StringBuffer ();
-
- // We have to check both prefixes, because one might be empty. We
- // want to pick the longest prefix that matches.
- boolean got_pos = str.startsWith(positivePrefix, index);
- String np = (negativePrefix != null
- ? negativePrefix
- : positivePrefix + symbols.getMinusSign());
- boolean got_neg = str.startsWith(np, index);
-
- if (got_pos && got_neg)
+ // a special values before anything else
+ // NaN
+ if (str.contains(this.symbols.getNaN()))
+ return Double.valueOf(Double.NaN);
+
+ // this will be our final number
+ StringBuffer number = new StringBuffer();
+
+ // special character
+ char minus = symbols.getMinusSign();
+
+ // starting parsing position
+ int start = pos.getIndex();
+
+ // validate the string, it have to be in the
+ // same form as the format string or parsing will fail
+ String _negativePrefix = (this.negativePrefix.compareTo("") == 0
+ ? minus + positivePrefix
+ : this.negativePrefix);
+
+ // we check both prefixes, because one might be empty.
+ // We want to pick the longest prefix that matches.
+ int positiveLen = positivePrefix.length();
+ int negativeLen = _negativePrefix.length();
+
+ boolean isNegative = str.startsWith(_negativePrefix);
+ boolean isPositive = str.startsWith(positivePrefix);
+
+ if (isPositive && isNegative)
{
- // By checking this way, we preserve ambiguity in the case
- // where the negative format differs only in suffix. We
- // check this again later.
- if (np.length() > positivePrefix.length())
- {
- is_neg = true;
- index += np.length();
- }
- else
- index += positivePrefix.length();
+ // By checking this way, we preserve ambiguity in the case
+ // where the negative format differs only in suffix.
+ if (negativeLen > positiveLen)
+ {
+ start += _negativePrefix.length();
+ isNegative = true;
+ }
+ else
+ {
+ start += positivePrefix.length();
+ isPositive = true;
+ if (negativeLen < positiveLen)
+ isNegative = false;
+ }
}
- else if (got_neg)
+ else if (isNegative)
{
- is_neg = true;
- index += np.length();
+ start += _negativePrefix.length();
+ isPositive = false;
+ }
+ else if (isPositive)
+ {
+ start += positivePrefix.length();
+ isNegative = false;
}
- else if (got_pos)
- index += positivePrefix.length();
else
{
- pos.setErrorIndex (index);
- return null;
+ pos.setErrorIndex(start);
+ return null;
}
-
- // FIXME: handle Inf and NaN.
-
- // FIXME: do we have to respect minimum digits?
- // What about multiplier?
-
- StringBuffer buf = int_buf;
- StringBuffer frac_buf = null;
- StringBuffer exp_buf = null;
- int start_index = index;
- int max = str.length();
- int exp_index = -1;
- int last = index + maximumIntegerDigits;
-
- if (maximumFractionDigits > 0)
- last += maximumFractionDigits + 1;
+
+ // other special characters used by the parser
+ char decimalSeparator = symbols.getDecimalSeparator();
+ char zero = symbols.getZeroDigit();
+ char exponent = symbols.getExponential();
+
+ // stop parsing position in the string
+ int stop = start + this.maximumIntegerDigits + maximumFractionDigits + 2;
if (useExponentialNotation)
- last += minExponentDigits + 1;
-
- if (last > 0 && max > last)
- max = last;
+ stop += minExponentDigits + 1;
+
+ boolean inExponent = false;
- char zero = symbols.getZeroDigit();
- int last_group = -1;
- boolean int_part = true;
- boolean exp_part = false;
- for (; index < max; ++index)
+ // correct the size of the end parsing flag
+ int len = str.length();
+ if (len < stop) stop = len;
+
+ int i = start;
+ while (i < stop)
{
- char c = str.charAt(index);
-
- // FIXME: what about grouping size?
- if (groupingUsed && c == symbols.getGroupingSeparator())
- {
- if (last_group != -1
- && groupingSize != 0
- && (index - last_group) % groupingSize != 0)
- {
- pos.setErrorIndex(index);
- return null;
- }
- last_group = index+1;
- }
- else if (c >= zero && c <= zero + 9)
- {
- buf.append((char) (c - zero + '0'));
- }
- else if (parseIntegerOnly)
- break;
- else if (c == symbols.getDecimalSeparator())
- {
- if (last_group != -1
- && groupingSize != 0
- && (index - last_group) % groupingSize != 0)
- {
- pos.setErrorIndex(index);
- return null;
- }
- buf = frac_buf = new StringBuffer();
- frac_buf.append('.');
- int_part = false;
- }
- else if (c == symbols.getExponential())
- {
- buf = exp_buf = new StringBuffer();
- int_part = false;
- exp_part = true;
- exp_index = index+1;
- }
- else if (exp_part
- && (c == '+' || c == '-' || c == symbols.getMinusSign()))
- {
- // For exponential notation.
- buf.append(c);
- }
- else
- break;
+ char ch = str.charAt(i);
+ i++;
+
+ if (ch >= zero && ch <= (zero + 9))
+ {
+ number.append(ch);
+ }
+ else if (this.parseIntegerOnly)
+ {
+ break;
+ }
+ else if (ch == decimalSeparator)
+ {
+ number.append('.');
+ }
+ else if (ch == exponent)
+ {
+ number.append(ch);
+ inExponent = !inExponent;
+ }
+ else if ((ch == '+' || ch == '-' || ch == minus))
+ {
+ if (inExponent)
+ number.append(ch);
+ else
+ break;
+ }
}
- if (index == start_index)
+ // 2nd special case: infinity
+ // XXX: need to be tested
+ if (str.contains(symbols.getInfinity()))
{
- // Didn't see any digits.
- pos.setErrorIndex(index);
- return null;
- }
+ int inf = str.indexOf(symbols.getInfinity());
+ pos.setIndex(inf);
+
+ // FIXME: ouch, this is really ugly and lazy code...
+ if (this.parseBigDecimal)
+ {
+ if (isNegative)
+ return new BigDecimal(Double.NEGATIVE_INFINITY);
+
+ return new BigDecimal(Double.POSITIVE_INFINITY);
+ }
+
+ if (isNegative)
+ return new Double(Double.NEGATIVE_INFINITY);
- // Check the suffix. We must do this before converting the
- // buffer to a number to handle the case of a number which is
- // the most negative Long.
- boolean got_pos_suf = str.startsWith(positiveSuffix, index);
- String ns = (negativePrefix == null ? positiveSuffix : negativeSuffix);
- boolean got_neg_suf = str.startsWith(ns, index);
- if (is_neg)
- {
- if (! got_neg_suf)
- {
- pos.setErrorIndex(index);
- return null;
- }
+ return new Double(Double.POSITIVE_INFINITY);
}
- else if (got_pos && got_neg && got_neg_suf)
- {
- is_neg = true;
- }
- else if (got_pos != got_pos_suf && got_neg != got_neg_suf)
- {
- pos.setErrorIndex(index);
- return null;
- }
- else if (! got_pos_suf)
+
+ // no number...
+ if (i == start || number.length() == 0)
{
- pos.setErrorIndex(index);
- return null;
+ pos.setErrorIndex(i);
+ return null;
}
- String suffix = is_neg ? ns : positiveSuffix;
- long parsedMultiplier = 1;
- boolean use_long;
-
- if (is_neg)
- int_buf.insert(0, '-');
+ // now we have to check the suffix, done here after number parsing
+ // or the index will not be updated correctly...
+ boolean isNegativeSuffix = str.endsWith(this.negativeSuffix);
+ boolean isPositiveSuffix = str.endsWith(this.positiveSuffix);
+ boolean positiveEqualsNegative = negativeSuffix.equals(positiveSuffix);
- // Now handle the exponential part if there is one.
- if (exp_buf != null)
+ positiveLen = positiveSuffix.length();
+ negativeLen = negativeSuffix.length();
+
+ if (isNegative && !isNegativeSuffix)
{
- int exponent_value;
-
- try
- {
- exponent_value = Integer.parseInt(exp_buf.toString());
- }
- catch (NumberFormatException x1)
- {
- pos.setErrorIndex(exp_index);
- return null;
- }
-
- if (frac_buf == null)
- {
- // We only have to add some zeros to the int part.
- // Build a multiplier.
- for (int i = 0; i < exponent_value; i++)
- int_buf.append('0');
-
- use_long = true;
- }
- else
- {
- boolean long_sufficient;
-
- if (exponent_value < frac_buf.length()-1)
- {
- int lastNonNull = -1;
- /* We have to check the fraction buffer: it may only be full of '0'
- * or be sufficiently filled with it to convert the number into Long.
- */
- for (int i = 1; i < frac_buf.length(); i++)
- if (frac_buf.charAt(i) != '0')
- lastNonNull = i;
-
- long_sufficient = (lastNonNull < 0 || lastNonNull <= exponent_value);
- }
- else
- long_sufficient = true;
-
- if (long_sufficient)
- {
- for (int i = 1; i < frac_buf.length() && i < exponent_value; i++)
- int_buf.append(frac_buf.charAt(i));
- for (int i = frac_buf.length()-1; i < exponent_value; i++)
- int_buf.append('0');
- use_long = true;
- }
- else
- {
- /*
- * A long type is not sufficient, we build the full buffer to
- * be parsed by Double.
- */
- int_buf.append(frac_buf);
- int_buf.append('E');
- int_buf.append(exp_buf);
- use_long = false;
- }
- }
+ pos.setErrorIndex(i);
+ return null;
}
- else
+ else if (isNegativeSuffix &&
+ !positiveEqualsNegative &&
+ (negativeLen > positiveLen))
{
- if (frac_buf != null)
- {
- /* Check whether the fraction buffer contains only '0' */
- int i;
- for (i = 1; i < frac_buf.length(); i++)
- if (frac_buf.charAt(i) != '0')
- break;
-
- if (i != frac_buf.length())
- {
- use_long = false;
- int_buf.append(frac_buf);
- }
- else
- use_long = true;
- }
- else
- use_long = true;
+ isNegative = true;
}
-
- String t = int_buf.toString();
- Number result = null;
- if (use_long)
+ else if (!isPositiveSuffix)
{
- try
- {
- result = new Long (t);
- }
- catch (NumberFormatException x1)
- {
- }
+ pos.setErrorIndex(i);
+ return null;
}
- else
+
+ if (isNegative) number.insert(0, '-');
+
+ pos.setIndex(i - 1);
+
+ // now we handle the return type
+ BigDecimal bigDecimal = new BigDecimal(number.toString());
+ if (this.parseBigDecimal)
+ return bigDecimal;
+
+ // want integer?
+ if (this.parseIntegerOnly)
+ return new Long(bigDecimal.longValue());
+
+ // 3th special case -0.0
+ if (isNegative && (bigDecimal.compareTo(BigDecimal.ZERO) == 0))
+ return new Double(-0.0);
+
+ try
{
- try
- {
- result = new Double (t);
- }
- catch (NumberFormatException x2)
- {
- }
+ BigDecimal integer
+ = bigDecimal.setScale(0, BigDecimal.ROUND_UNNECESSARY);
+ return new Long(integer.longValue());
}
- if (result == null)
+ catch (ArithmeticException e)
{
- pos.setErrorIndex(index);
- return null;
+ return new Double(bigDecimal.doubleValue());
}
-
- pos.setIndex(index + suffix.length());
-
- return result;
}
/**
* Sets the <code>Currency</code> on the
* <code>DecimalFormatSymbols</code> used, which also sets the
* currency symbols on those symbols.
+ *
+ * @param currency The new <code>Currency</code> on the
+ * <code>DecimalFormatSymbols</code>.
*/
public void setCurrency(Currency currency)
{
symbols.setCurrency(currency);
}
-
+
/**
* Sets the symbols used by this instance. This method makes a copy of
* the supplied symbols.
@@ -1164,274 +799,1442 @@ public class DecimalFormat extends NumberFormat
{
symbols = (DecimalFormatSymbols) newSymbols.clone();
}
-
- public void setDecimalSeparatorAlwaysShown (boolean newValue)
+
+ /**
+ * Define if the decimal separator should be always visible or only
+ * visible when needed. This method as effect only on integer values.
+ * Pass <code>true</code> if you want the decimal separator to be
+ * always shown, <code>false</code> otherwise.
+ *
+ * @param newValue true</code> if you want the decimal separator to be
+ * always shown, <code>false</code> otherwise.
+ */
+ public void setDecimalSeparatorAlwaysShown(boolean newValue)
{
decimalSeparatorAlwaysShown = newValue;
}
-
- public void setGroupingSize (int groupSize)
+
+ /**
+ * Sets the number of digits used to group portions of the integer part of
+ * the number. For example, the number <code>123456</code>, with a grouping
+ * size of 3, is rendered <code>123,456</code>.
+ *
+ * @param groupSize The number of digits used while grouping portions
+ * of the integer part of a number.
+ */
+ public void setGroupingSize(int groupSize)
{
groupingSize = (byte) groupSize;
}
-
- public void setMaximumFractionDigits (int newValue)
+
+ /**
+ * Sets the maximum number of digits allowed in the integer
+ * portion of a number to the specified value.
+ * The new value will be the choosen as the minimum between
+ * <code>newvalue</code> and 309. Any value below zero will be
+ * replaced by zero.
+ *
+ * @param newValue The new maximum integer digits value.
+ */
+ public void setMaximumIntegerDigits(int newValue)
{
- super.setMaximumFractionDigits(Math.min(newValue, 340));
+ newValue = (newValue > 0) ? newValue : 0;
+ super.setMaximumIntegerDigits(Math.min(newValue, DEFAULT_INTEGER_DIGITS));
}
-
- public void setMaximumIntegerDigits (int newValue)
+
+ /**
+ * Sets the minimum number of digits allowed in the integer
+ * portion of a number to the specified value.
+ * The new value will be the choosen as the minimum between
+ * <code>newvalue</code> and 309. Any value below zero will be
+ * replaced by zero.
+ *
+ * @param newValue The new minimum integer digits value.
+ */
+ public void setMinimumIntegerDigits(int newValue)
{
- super.setMaximumIntegerDigits(Math.min(newValue, 309));
+ newValue = (newValue > 0) ? newValue : 0;
+ super.setMinimumIntegerDigits(Math.min(newValue, DEFAULT_INTEGER_DIGITS));
}
-
- public void setMinimumFractionDigits (int newValue)
+
+ /**
+ * Sets the maximum number of digits allowed in the fraction
+ * portion of a number to the specified value.
+ * The new value will be the choosen as the minimum between
+ * <code>newvalue</code> and 309. Any value below zero will be
+ * replaced by zero.
+ *
+ * @param newValue The new maximum fraction digits value.
+ */
+ public void setMaximumFractionDigits(int newValue)
{
- super.setMinimumFractionDigits(Math.min(newValue, 340));
+ newValue = (newValue > 0) ? newValue : 0;
+ super.setMaximumFractionDigits(Math.min(newValue, DEFAULT_FRACTION_DIGITS));
}
-
- public void setMinimumIntegerDigits (int newValue)
+
+ /**
+ * Sets the minimum number of digits allowed in the fraction
+ * portion of a number to the specified value.
+ * The new value will be the choosen as the minimum between
+ * <code>newvalue</code> and 309. Any value below zero will be
+ * replaced by zero.
+ *
+ * @param newValue The new minimum fraction digits value.
+ */
+ public void setMinimumFractionDigits(int newValue)
{
- super.setMinimumIntegerDigits(Math.min(newValue, 309));
+ newValue = (newValue > 0) ? newValue : 0;
+ super.setMinimumFractionDigits(Math.min(newValue, DEFAULT_FRACTION_DIGITS));
}
-
- public void setMultiplier (int newValue)
+
+ /**
+ * Sets the multiplier for use in percent and similar formats.
+ * For example, for percent set the multiplier to 100, for permille, set the
+ * miltiplier to 1000.
+ *
+ * @param newValue the new value for multiplier.
+ */
+ public void setMultiplier(int newValue)
{
multiplier = newValue;
}
-
- public void setNegativePrefix (String newValue)
+
+ /**
+ * Sets the negative prefix.
+ *
+ * @param newValue The new negative prefix.
+ */
+ public void setNegativePrefix(String newValue)
{
negativePrefix = newValue;
}
- public void setNegativeSuffix (String newValue)
+ /**
+ * Sets the negative suffix.
+ *
+ * @param newValue The new negative suffix.
+ */
+ public void setNegativeSuffix(String newValue)
{
negativeSuffix = newValue;
}
-
- public void setPositivePrefix (String newValue)
+
+ /**
+ * Sets the positive prefix.
+ *
+ * @param newValue The new positive prefix.
+ */
+ public void setPositivePrefix(String newValue)
{
positivePrefix = newValue;
}
-
- public void setPositiveSuffix (String newValue)
+
+ /**
+ * Sets the new positive suffix.
+ *
+ * @param newValue The new positive suffix.
+ */
+ public void setPositiveSuffix(String newValue)
{
positiveSuffix = newValue;
}
+
+ /**
+ * This method returns a string with the formatting pattern being used
+ * by this object. The string is localized.
+ *
+ * @return A localized <code>String</code> with the formatting pattern.
+ * @see #toPattern()
+ */
+ public String toLocalizedPattern()
+ {
+ return computePattern(this.symbols);
+ }
+
+ /**
+ * This method returns a string with the formatting pattern being used
+ * by this object. The string is not localized.
+ *
+ * @return A <code>String</code> with the formatting pattern.
+ * @see #toLocalizedPattern()
+ */
+ public String toPattern()
+ {
+ return computePattern(nonLocalizedSymbols);
+ }
+
+ /* ***** private methods ***** */
+
+ /**
+ * This is an shortcut helper method used to test if two given strings are
+ * equals.
+ *
+ * @param s1 The first string to test for equality.
+ * @param s2 The second string to test for equality.
+ * @return <code>true</code> if the strings are both <code>null</code> or
+ * equals.
+ */
+ private boolean equals(String s1, String s2)
+ {
+ if (s1 == null || s2 == null)
+ return s1 == s2;
+ return s1.equals(s2);
+ }
+
+
+ /* ****** PATTERN ****** */
+
+ /**
+ * This helper function creates a string consisting of all the
+ * characters which can appear in a pattern and must be quoted.
+ */
+ private String patternChars (DecimalFormatSymbols syms)
+ {
+ StringBuffer buf = new StringBuffer ();
+
+ buf.append(syms.getDecimalSeparator());
+ buf.append(syms.getDigit());
+ buf.append(syms.getExponential());
+ buf.append(syms.getGroupingSeparator());
+ buf.append(syms.getMinusSign());
+ buf.append(syms.getPatternSeparator());
+ buf.append(syms.getPercent());
+ buf.append(syms.getPerMill());
+ buf.append(syms.getZeroDigit());
+ buf.append('\'');
+ buf.append('\u00a4');
+
+ return buf.toString();
+ }
- private void quoteFix(StringBuffer buf, String text, String patChars)
+ /**
+ * Quote special characters as defined by <code>patChars</code> in the
+ * input string.
+ *
+ * @param text
+ * @param patChars
+ * @return A StringBuffer with special characters quoted.
+ */
+ private StringBuffer quoteFix(String text, String patChars)
{
+ StringBuffer buf = new StringBuffer();
+
int len = text.length();
+ char ch;
for (int index = 0; index < len; ++index)
{
- char c = text.charAt(index);
- if (patChars.indexOf(c) != -1)
- {
- buf.append('\'');
- buf.append(c);
- buf.append('\'');
- }
- else
- buf.append(c);
+ ch = text.charAt(index);
+ if (patChars.indexOf(ch) != -1)
+ {
+ buf.append('\'');
+ buf.append(ch);
+ if (ch != '\'') buf.append('\'');
+ }
+ else
+ {
+ buf.append(ch);
+ }
}
+
+ return buf;
}
-
- private String computePattern(DecimalFormatSymbols syms)
+
+ /**
+ * Returns the format pattern, localized to follow the given
+ * symbols.
+ */
+ private String computePattern(DecimalFormatSymbols symbols)
{
- StringBuffer mainPattern = new StringBuffer ();
+ StringBuffer mainPattern = new StringBuffer();
+
// We have to at least emit a zero for the minimum number of
- // digits. Past that we need hash marks up to the grouping
+ // digits. Past that we need hash marks up to the grouping
// separator (and one beyond).
- int total_digits = Math.max(minimumIntegerDigits,
- groupingUsed ? groupingSize + 1: groupingSize);
- for (int i = 0; i < total_digits - minimumIntegerDigits; ++i)
- mainPattern.append(syms.getDigit());
- for (int i = total_digits - minimumIntegerDigits; i < total_digits; ++i)
- mainPattern.append(syms.getZeroDigit());
- // Inserting the gropuing operator afterwards is easier.
+ int _groupingSize = groupingUsed ? groupingSize + 1: groupingSize;
+ int totalDigits = Math.max(minimumIntegerDigits, _groupingSize);
+
+ // if it is not in exponential notiation,
+ // we always have a # prebended
+ if (!useExponentialNotation) mainPattern.append(symbols.getDigit());
+
+ for (int i = 1; i < totalDigits - minimumIntegerDigits; i++)
+ mainPattern.append(symbols.getDigit());
+
+ for (int i = totalDigits - minimumIntegerDigits; i < totalDigits; i++)
+ mainPattern.append(symbols.getZeroDigit());
+
if (groupingUsed)
- mainPattern.insert(mainPattern.length() - groupingSize,
- syms.getGroupingSeparator());
+ {
+ mainPattern.insert(mainPattern.length() - groupingSize,
+ symbols.getGroupingSeparator());
+ }
+
// See if we need decimal info.
- if (minimumFractionDigits > 0 || maximumFractionDigits > 0
- || decimalSeparatorAlwaysShown)
- mainPattern.append(syms.getDecimalSeparator());
+ if (minimumFractionDigits > 0 || maximumFractionDigits > 0 ||
+ decimalSeparatorAlwaysShown)
+ {
+ mainPattern.append(symbols.getDecimalSeparator());
+ }
+
for (int i = 0; i < minimumFractionDigits; ++i)
- mainPattern.append(syms.getZeroDigit());
+ mainPattern.append(symbols.getZeroDigit());
+
for (int i = minimumFractionDigits; i < maximumFractionDigits; ++i)
- mainPattern.append(syms.getDigit());
+ mainPattern.append(symbols.getDigit());
+
if (useExponentialNotation)
{
- mainPattern.append(syms.getExponential());
- for (int i = 0; i < minExponentDigits; ++i)
- mainPattern.append(syms.getZeroDigit());
- if (minExponentDigits == 0)
- mainPattern.append(syms.getDigit());
+ mainPattern.append(symbols.getExponential());
+
+ for (int i = 0; i < minExponentDigits; ++i)
+ mainPattern.append(symbols.getZeroDigit());
+
+ if (minExponentDigits == 0)
+ mainPattern.append(symbols.getDigit());
}
-
- String main = mainPattern.toString();
- String patChars = patternChars (syms);
- mainPattern.setLength(0);
-
- quoteFix (mainPattern, positivePrefix, patChars);
- mainPattern.append(main);
- quoteFix (mainPattern, positiveSuffix, patChars);
-
- if (negativePrefix != null)
+
+ // save the pattern
+ String pattern = mainPattern.toString();
+
+ // so far we have the pattern itself, now we need to add
+ // the positive and the optional negative prefixes and suffixes
+ String patternChars = patternChars(symbols);
+ mainPattern.insert(0, quoteFix(positivePrefix, patternChars));
+ mainPattern.append(quoteFix(positiveSuffix, patternChars));
+
+ if (hasNegativePrefix)
{
- quoteFix (mainPattern, negativePrefix, patChars);
- mainPattern.append(main);
- quoteFix (mainPattern, negativeSuffix, patChars);
+ mainPattern.append(symbols.getPatternSeparator());
+ mainPattern.append(quoteFix(negativePrefix, patternChars));
+ mainPattern.append(pattern);
+ mainPattern.append(quoteFix(negativeSuffix, patternChars));
}
-
+
+ // finally, return the pattern string
return mainPattern.toString();
}
-
- public String toLocalizedPattern ()
+
+ /* ****** FORMAT PARSING ****** */
+
+ /**
+ * Scan the input string and define a pattern suitable for use
+ * with this decimal format.
+ *
+ * @param pattern
+ * @param symbols
+ */
+ private void applyPatternWithSymbols(String pattern,
+ DecimalFormatSymbols symbols)
{
- return computePattern (symbols);
+ // The pattern string is described by a BNF diagram.
+ // we could use a recursive parser to read and prepare
+ // the string, but this would be too slow and resource
+ // intensive, while this code is quite critical as it is
+ // called always when the class is instantiated and every
+ // time a new pattern is given.
+ // Our strategy is to divide the string into section as given by
+ // the BNF diagram, iterating through the string and setting up
+ // the parameters we need for formatting (which is basicly what
+ // a descendent recursive parser would do - but without recursion).
+ // I'm sure that there are smarter methods to do this.
+
+ // Restore default values. Most of these will be overwritten
+ // but we want to be sure that nothing is left out.
+ setDefaultValues();
+
+ int len = pattern.length();
+ if (len == 0)
+ {
+ // this is another special case...
+ this.minimumIntegerDigits = 1;
+ this.maximumIntegerDigits = DEFAULT_INTEGER_DIGITS;
+ this.minimumFractionDigits = 0;
+ this.maximumFractionDigits = DEFAULT_FRACTION_DIGITS;
+
+ // FIXME: ...and these values may not be valid in all locales
+ this.minExponentDigits = 0;
+ this.showDecimalSeparator = true;
+ this.groupingUsed = true;
+ this.groupingSize = 3;
+
+ return;
+ }
+
+ int start = scanFix(pattern, symbols, 0, true);
+ if (start < len) start = scanNumberInteger(pattern, symbols, start);
+ if (start < len)
+ {
+ start = scanFractionalPortion(pattern, symbols, start);
+ }
+ else
+ {
+ // special case, pattern that ends here does not have a fractional
+ // portion
+ this.minimumFractionDigits = 0;
+ this.maximumFractionDigits = 0;
+ //this.decimalSeparatorAlwaysShown = false;
+ //this.showDecimalSeparator = false;
+ }
+
+ // XXX: this fixes a compatibility test with the RI.
+ // If new uses cases fail, try removing this line first.
+ //if (!this.hasIntegerPattern && !this.hasFractionalPattern)
+ // throw new IllegalArgumentException("No valid pattern found!");
+
+ if (start < len) start = scanExponent(pattern, symbols, start);
+ if (start < len) start = scanFix(pattern, symbols, start, false);
+ if (start < len) scanNegativePattern(pattern, symbols, start);
+
+ if (useExponentialNotation &&
+ (maxIntegerDigitsExponent > minimumIntegerDigits) &&
+ (maxIntegerDigitsExponent > 1))
+ {
+ minimumIntegerDigits = 1;
+ exponentRound = maxIntegerDigitsExponent;
+ }
+
+ if (useExponentialNotation)
+ maximumIntegerDigits = maxIntegerDigitsExponent;
+
+ if (!this.hasFractionalPattern && this.showDecimalSeparator == true)
+ {
+ this.decimalSeparatorAlwaysShown = true;
+ }
+ }
+
+ /**
+ * Scans for the prefix or suffix portion of the pattern string.
+ * This method handles the positive subpattern of the pattern string.
+ *
+ * @param pattern The pattern string to parse.
+ * @return The position in the pattern string where parsing ended.
+ */
+ private int scanFix(String pattern, DecimalFormatSymbols sourceSymbols,
+ int start, boolean prefix)
+ {
+ StringBuffer buffer = new StringBuffer();
+
+ // the number portion is always delimited by one of those
+ // characters
+ char decimalSeparator = sourceSymbols.getDecimalSeparator();
+ char patternSeparator = sourceSymbols.getPatternSeparator();
+ char groupingSeparator = sourceSymbols.getGroupingSeparator();
+ char digit = sourceSymbols.getDigit();
+ char zero = sourceSymbols.getZeroDigit();
+ char minus = sourceSymbols.getMinusSign();
+
+ // other special characters, cached here to avoid method calls later
+ char percent = sourceSymbols.getPercent();
+ char permille = sourceSymbols.getPerMill();
+
+ String currencySymbol = this.symbols.getCurrencySymbol();
+
+ boolean quote = false;
+
+ char ch = pattern.charAt(start);
+ if (ch == patternSeparator)
+ {
+ // negative subpattern
+ this.hasNegativePrefix = true;
+ ++start;
+ return start;
+ }
+
+ int len = pattern.length();
+ int i;
+ for (i = start; i < len; i++)
+ {
+ ch = pattern.charAt(i);
+
+ // we are entering into the negative subpattern
+ if (!quote && ch == patternSeparator)
+ {
+ if (this.hasNegativePrefix)
+ {
+ throw new IllegalArgumentException("Invalid pattern found: "
+ + start);
+ }
+
+ this.hasNegativePrefix = true;
+ ++i;
+ break;
+ }
+
+ // this means we are inside the number portion
+ if (!quote &&
+ (ch == minus || ch == digit || ch == zero ||
+ ch == groupingSeparator))
+ break;
+
+ if (!quote && ch == decimalSeparator)
+ {
+ this.showDecimalSeparator = true;
+ break;
+ }
+ else if (quote && ch != '\'')
+ {
+ buffer.append(ch);
+ continue;
+ }
+
+ if (ch == '\u00A4')
+ {
+ // CURRENCY
+ currencySymbol = this.symbols.getCurrencySymbol();
+
+ // if \u00A4 is doubled, we use the international currency symbol
+ if (i < len && pattern.charAt(i + 1) == '\u00A4')
+ {
+ currencySymbol = this.symbols.getInternationalCurrencySymbol();
+ i++;
+ }
+
+ this.useCurrencySeparator = true;
+ buffer.append(currencySymbol);
+ }
+ else if (ch == percent)
+ {
+ // PERCENT
+ this.multiplier = 100;
+ buffer.append(this.symbols.getPercent());
+ }
+ else if (ch == permille)
+ {
+ // PERMILLE
+ this.multiplier = 1000;
+ buffer.append(this.symbols.getPerMill());
+ }
+ else if (ch == '\'')
+ {
+ // QUOTE
+ if (i < len && pattern.charAt(i + 1) == '\'')
+ {
+ // we need to add ' to the buffer
+ buffer.append(ch);
+ i++;
+ }
+ else
+ {
+ quote = !quote;
+ continue;
+ }
+ }
+ else
+ {
+ buffer.append(ch);
+ }
+ }
+
+ if (prefix)
+ {
+ this.positivePrefix = buffer.toString();
+ this.negativePrefix = minus + "" + positivePrefix;
+ }
+ else
+ {
+ this.positiveSuffix = buffer.toString();
+ }
+
+ return i;
}
+
+ /**
+ * Scan the given string for number patterns, starting
+ * from <code>start</code>.
+ * This method searches the integer part of the pattern only.
+ *
+ * @param pattern The pattern string to parse.
+ * @param start The starting parse position in the string.
+ * @return The position in the pattern string where parsing ended,
+ * counted from the beginning of the string (that is, 0).
+ */
+ private int scanNumberInteger(String pattern, DecimalFormatSymbols symbols,
+ int start)
+ {
+ char digit = symbols.getDigit();
+ char zero = symbols.getZeroDigit();
+ char groupingSeparator = symbols.getGroupingSeparator();
+ char decimalSeparator = symbols.getDecimalSeparator();
+ char exponent = symbols.getExponential();
+ char patternSeparator = symbols.getPatternSeparator();
+
+ // count the number of zeroes in the pattern
+ // this number defines the minum digits in the integer portion
+ int zeros = 0;
+
+ // count the number of digits used in grouping
+ int _groupingSize = 0;
+
+ this.maxIntegerDigitsExponent = 0;
+
+ boolean intPartTouched = false;
+
+ char ch;
+ int len = pattern.length();
+ int i;
+ for (i = start; i < len; i++)
+ {
+ ch = pattern.charAt(i);
+
+ // break on decimal separator or exponent or pattern separator
+ if (ch == decimalSeparator || ch == exponent)
+ break;
+
+ if (this.hasNegativePrefix && ch == patternSeparator)
+ throw new IllegalArgumentException("Invalid pattern found: "
+ + start);
+
+ if (ch == digit)
+ {
+ // in our implementation we could relax this strict
+ // requirement, but this is used to keep compatibility with
+ // the RI
+ if (zeros > 0) throw new
+ IllegalArgumentException("digit mark following zero in " +
+ "positive subpattern, not allowed. Position: " + i);
+
+ _groupingSize++;
+ intPartTouched = true;
+ this.maxIntegerDigitsExponent++;
+ }
+ else if (ch == zero)
+ {
+ zeros++;
+ _groupingSize++;
+ this.maxIntegerDigitsExponent++;
+ }
+ else if (ch == groupingSeparator)
+ {
+ this.groupingSeparatorInPattern = true;
+ this.groupingUsed = true;
+ _groupingSize = 0;
+ }
+ else
+ {
+ // any other character not listed above
+ // means we are in the suffix portion
+ break;
+ }
+ }
+
+ if (groupingSeparatorInPattern) this.groupingSize = (byte) _groupingSize;
+ this.minimumIntegerDigits = zeros;
+
+ // XXX: compatibility code with the RI: the number of minimum integer
+ // digits is at least one when maximumIntegerDigits is more than zero
+ if (intPartTouched && this.maximumIntegerDigits > 0 &&
+ this.minimumIntegerDigits == 0)
+ this.minimumIntegerDigits = 1;
- public String toPattern ()
+ return i;
+ }
+
+ /**
+ * Scan the given string for number patterns, starting
+ * from <code>start</code>.
+ * This method searches the fractional part of the pattern only.
+ *
+ * @param pattern The pattern string to parse.
+ * @param start The starting parse position in the string.
+ * @return The position in the pattern string where parsing ended,
+ * counted from the beginning of the string (that is, 0).
+ */
+ private int scanFractionalPortion(String pattern,
+ DecimalFormatSymbols symbols,
+ int start)
+ {
+ char digit = symbols.getDigit();
+ char zero = symbols.getZeroDigit();
+ char groupingSeparator = symbols.getGroupingSeparator();
+ char decimalSeparator = symbols.getDecimalSeparator();
+ char exponent = symbols.getExponential();
+ char patternSeparator = symbols.getPatternSeparator();
+
+ // first character needs to be '.' otherwise we are not parsing the
+ // fractional portion
+ char ch = pattern.charAt(start);
+ if (ch != decimalSeparator)
+ {
+ this.minimumFractionDigits = 0;
+ this.maximumFractionDigits = 0;
+ return start;
+ }
+
+ ++start;
+
+ this.hasFractionalPattern = true;
+
+ this.minimumFractionDigits = 0;
+ int digits = 0;
+
+ int len = pattern.length();
+ int i;
+ for (i = start; i < len; i++)
+ {
+ ch = pattern.charAt(i);
+
+ // we hit the exponential or negative subpattern
+ if (ch == exponent || ch == patternSeparator)
+ break;
+
+ // pattern error
+ if (ch == groupingSeparator || ch == decimalSeparator) throw new
+ IllegalArgumentException("unexpected character '" + ch + "' " +
+ "in fractional subpattern. Position: " + i);
+
+ if (ch == digit)
+ {
+ digits++;
+ }
+ else if (ch == zero)
+ {
+ if (digits > 0) throw new
+ IllegalArgumentException("digit mark following zero in " +
+ "positive subpattern, not allowed. Position: " + i);
+
+ this.minimumFractionDigits++;
+ }
+ else
+ {
+ // we are in the suffix section of pattern
+ break;
+ }
+ }
+
+ if (i == start) this.hasFractionalPattern = false;
+
+ this.maximumFractionDigits = this.minimumFractionDigits + digits;
+ this.showDecimalSeparator = true;
+
+ return i;
+ }
+
+ /**
+ * Scan the given string for number patterns, starting
+ * from <code>start</code>.
+ * This method searches the expoential part of the pattern only.
+ *
+ * @param pattern The pattern string to parse.
+ * @param start The starting parse position in the string.
+ * @return The position in the pattern string where parsing ended,
+ * counted from the beginning of the string (that is, 0).
+ */
+ private int scanExponent(String pattern, DecimalFormatSymbols symbols,
+ int start)
+ {
+ char digit = symbols.getDigit();
+ char zero = symbols.getZeroDigit();
+ char groupingSeparator = symbols.getGroupingSeparator();
+ char decimalSeparator = symbols.getDecimalSeparator();
+ char exponent = symbols.getExponential();
+
+ char ch = pattern.charAt(start);
+
+ if (ch == decimalSeparator)
+ {
+ // ignore dots
+ ++start;
+ }
+
+ if (ch != exponent)
+ {
+ this.useExponentialNotation = false;
+ return start;
+ }
+
+ ++start;
+
+ this.minExponentDigits = 0;
+
+ int len = pattern.length();
+ int i;
+ for (i = start; i < len; i++)
+ {
+ ch = pattern.charAt(i);
+
+ if (ch == groupingSeparator || ch == decimalSeparator ||
+ ch == digit || ch == exponent) throw new
+ IllegalArgumentException("unexpected character '" + ch + "' " +
+ "in exponential subpattern. Position: " + i);
+
+ if (ch == zero)
+ {
+ this.minExponentDigits++;
+ }
+ else
+ {
+ // any character other than zero is an exit point
+ break;
+ }
+ }
+
+ this.useExponentialNotation = true;
+
+ return i;
+ }
+
+ /**
+ * Scan the given string for number patterns, starting
+ * from <code>start</code>.
+ * This method searches the negative part of the pattern only and scan
+ * throught the end of the string.
+ *
+ * @param pattern The pattern string to parse.
+ * @param start The starting parse position in the string.
+ */
+ private void scanNegativePattern(String pattern,
+ DecimalFormatSymbols sourceSymbols,
+ int start)
{
- return computePattern (nonLocalizedSymbols);
+ StringBuffer buffer = new StringBuffer();
+
+ // the number portion is always delimited by one of those
+ // characters
+ char decimalSeparator = sourceSymbols.getDecimalSeparator();
+ char patternSeparator = sourceSymbols.getPatternSeparator();
+ char groupingSeparator = sourceSymbols.getGroupingSeparator();
+ char digit = sourceSymbols.getDigit();
+ char zero = sourceSymbols.getZeroDigit();
+ char minus = sourceSymbols.getMinusSign();
+
+ // other special charcaters, cached here to avoid method calls later
+ char percent = sourceSymbols.getPercent();
+ char permille = sourceSymbols.getPerMill();
+
+ String CURRENCY_SYMBOL = this.symbols.getCurrencySymbol();
+ String currencySymbol = CURRENCY_SYMBOL;
+
+ boolean quote = false;
+ boolean prefixDone = false;
+
+ int len = pattern.length();
+ if (len > 0) this.hasNegativePrefix = true;
+
+ char ch = pattern.charAt(start);
+ if (ch == patternSeparator)
+ {
+ // no pattern separator in the negative pattern
+ if ((start + 1) > len) throw new
+ IllegalArgumentException("unexpected character '" + ch + "' " +
+ "in negative subpattern.");
+ start++;
+ }
+
+ int i;
+ for (i = start; i < len; i++)
+ {
+ ch = pattern.charAt(i);
+
+ // this means we are inside the number portion
+ if (!quote &&
+ (ch == digit || ch == zero || ch == decimalSeparator ||
+ ch == patternSeparator || ch == groupingSeparator))
+ {
+ if (!prefixDone)
+ {
+ this.negativePrefix = buffer.toString();
+ buffer.delete(0, buffer.length());
+ prefixDone = true;
+ }
+ }
+ else if (ch == minus)
+ {
+ buffer.append(this.symbols.getMinusSign());
+ }
+ else if (quote && ch != '\'')
+ {
+ buffer.append(ch);
+ }
+ else if (ch == '\u00A4')
+ {
+ // CURRENCY
+ currencySymbol = CURRENCY_SYMBOL;
+
+ // if \u00A4 is doubled, we use the international currency symbol
+ if ((i + 1) < len && pattern.charAt(i + 1) == '\u00A4')
+ {
+ currencySymbol = this.symbols.getInternationalCurrencySymbol();
+ i = i + 2;
+ }
+
+ // FIXME: not sure about this, the specs says that we only have to
+ // change prefix and suffix, so leave it as commented
+ // unless in case of bug report/errors
+ //this.useCurrencySeparator = true;
+
+ buffer.append(currencySymbol);
+ }
+ else if (ch == percent)
+ {
+ // PERCENT
+ this.negativePatternMultiplier = 100;
+ buffer.append(this.symbols.getPercent());
+ }
+ else if (ch == permille)
+ {
+ // PERMILLE
+ this.negativePatternMultiplier = 1000;
+ buffer.append(this.symbols.getPerMill());
+ }
+ else if (ch == '\'')
+ {
+ // QUOTE
+ if (i < len && pattern.charAt(i + 1) == '\'')
+ {
+ // we need to add ' to the buffer
+ buffer.append(ch);
+ i++;
+ }
+ else
+ {
+ quote = !quote;
+ }
+ }
+ else if (ch == patternSeparator)
+ {
+ // no pattern separator in the negative pattern
+ throw new IllegalArgumentException("unexpected character '" + ch +
+ "' in negative subpattern.");
+ }
+ else
+ {
+ buffer.append(ch);
+ }
+ }
+
+ if (prefixDone)
+ this.negativeSuffix = buffer.toString();
+ else
+ this.negativePrefix = buffer.toString();
}
+
+ /* ****** FORMATTING ****** */
+
+ /**
+ * Handles the real formatting.
+ *
+ * We use a BigDecimal to format the number without precision loss.
+ * All the rounding is done by methods in BigDecimal.
+ * The <code>isLong</code> parameter is used to determine if we are
+ * formatting a long or BigInteger. In this case, we avoid to format
+ * the fractional part of the number (unless specified otherwise in the
+ * format string) that would consist only of a 0 digit.
+ *
+ * @param number A BigDecimal representation fo the input number.
+ * @param dest The destination buffer.
+ * @param isLong A boolean that indicates if this BigDecimal is a real
+ * decimal or an integer.
+ * @param fieldPos Use to keep track of the formatting position.
+ */
+ private void formatInternal(BigDecimal number, boolean isLong,
+ StringBuffer dest, FieldPosition fieldPos)
+ {
+ // The specs says that fieldPos should not be null, and that we
+ // should throw a NPE, but it seems that in few classes that
+ // reference this one, fieldPos is set to null.
+ // This is even defined in the javadoc, see for example MessageFormat.
+ // I think the best here is to check for fieldPos and build one if it is
+ // null. If it cause harms or regressions, just remove this line and
+ // fix the classes in the point of call, insted.
+ if (fieldPos == null) fieldPos = new FieldPosition(0);
+
+ int _multiplier = this.multiplier;
+
+ // used to track attribute starting position for each attribute
+ int attributeStart = -1;
+
+ // now get the sign this will be used by the special case Inifinity
+ // and by the normal cases.
+ boolean isNegative = (number.signum() < 0) ? true : false;
+ if (isNegative)
+ {
+ attributeStart = dest.length();
+
+ // append the negative prefix to the string
+ dest.append(negativePrefix);
+
+ // once got the negative prefix, we can use
+ // the absolute value.
+ number = number.abs();
+
+ _multiplier = negativePatternMultiplier;
+
+ addAttribute(Field.SIGN, attributeStart, dest.length());
+ }
+ else
+ {
+ // not negative, use the positive prefix
+ dest.append(positivePrefix);
+ }
+
+ // these are used ot update the field position
+ int beginIndexInt = dest.length();
+ int endIndexInt = 0;
+ int beginIndexFract = 0;
+ int endIndexFract = 0;
+
+ // compute the multiplier to use with percent and similar
+ number = number.multiply(new BigDecimal(_multiplier));
+
+ // XXX: special case, not sure if it belongs here or if it is
+ // correct at all. There may be other special cases as well
+ // these should be handled in the format string parser.
+ if (this.maximumIntegerDigits == 0 && this.maximumFractionDigits == 0)
+ {
+ number = BigDecimal.ZERO;
+ this.maximumIntegerDigits = 1;
+ this.minimumIntegerDigits = 1;
+ }
+
+ // get the absolute number
+ number = number.abs();
- private static final int MAXIMUM_INTEGER_DIGITS = 309;
+ // the scaling to use while formatting this number
+ int scale = this.maximumFractionDigits;
+
+ // this is the actual number we will use
+ // it is corrected later on to handle exponential
+ // notation, if needed
+ long exponent = 0;
+
+ // are we using exponential notation?
+ if (this.useExponentialNotation)
+ {
+ exponent = getExponent(number);
+ number = number.movePointLeft((int) exponent);
+
+ // FIXME: this makes the test ##.###E0 to pass,
+ // but all all the other tests to fail...
+ // this should be really something like
+ // min + max - what is already shown...
+ //scale = this.minimumIntegerDigits + this.maximumFractionDigits;
+ }
+
+ // round the number to the nearest neighbor
+ number = number.setScale(scale, BigDecimal.ROUND_HALF_EVEN);
- // These names are fixed by the serialization spec.
- private boolean decimalSeparatorAlwaysShown;
- private byte groupingSize;
- private byte minExponentDigits;
- private int exponentRound;
- private int multiplier;
- private String negativePrefix;
- private String negativeSuffix;
- private String positivePrefix;
- private String positiveSuffix;
- private int[] negativePrefixRanges, positivePrefixRanges;
- private HashMap[] negativePrefixAttrs, positivePrefixAttrs;
- private int[] negativeSuffixRanges, positiveSuffixRanges;
- private HashMap[] negativeSuffixAttrs, positiveSuffixAttrs;
- private int serialVersionOnStream = 1;
- private DecimalFormatSymbols symbols;
- private boolean useExponentialNotation;
- private static final long serialVersionUID = 864413376551465018L;
+ // now get the integer and fractional part of the string
+ // that will be processed later
+ String plain = number.toPlainString();
+
+ String intPart = null;
+ String fractPart = null;
+
+ // remove - from the integer part, this is needed as
+ // the Narrowing Primitive Conversions algorithm used may loose
+ // information about the sign
+ int minusIndex = plain.lastIndexOf('-', 0);
+ if (minusIndex > -1) plain = plain.substring(minusIndex + 1);
+
+ // strip the decimal portion
+ int dot = plain.indexOf('.');
+ if (dot > -1)
+ {
+ intPart = plain.substring(0, dot);
+ dot++;
+
+ if (useExponentialNotation)
+ fractPart = plain.substring(dot, dot + scale);
+ else
+ fractPart = plain.substring(dot);
+ }
+ else
+ {
+ intPart = plain;
+ }
+
+ // used in various places later on
+ int intPartLen = intPart.length();
+ endIndexInt = intPartLen;
+
+ // if the number of digits in our intPart is not greater than the
+ // minimum we have to display, we append zero to the destination
+ // buffer before adding the integer portion of the number.
+ int zeroes = minimumIntegerDigits - intPartLen;
+ if (zeroes > 0)
+ {
+ attributeStart = Math.max(dest.length() - 1, 0);
+ appendZero(dest, zeroes, minimumIntegerDigits);
+ }
- private void readObject(ObjectInputStream stream)
- throws IOException, ClassNotFoundException
- {
- stream.defaultReadObject();
- if (serialVersionOnStream < 1)
+ if (this.useExponentialNotation)
{
- useExponentialNotation = false;
- serialVersionOnStream = 1;
+ // For exponential numbers, the significant in mantissa are
+ // the sum of the minimum integer and maximum fraction
+ // digits, and does not take into account the maximun integer
+ // digits to display.
+
+ if (attributeStart < 0)
+ attributeStart = Math.max(dest.length() - 1, 0);
+ appendDigit(intPart, dest, this.groupingUsed);
+ }
+ else
+ {
+ // non exponential notation
+ intPartLen = intPart.length();
+ int canary = Math.min(intPartLen, this.maximumIntegerDigits);
+
+ // remove from the string the number in excess
+ // use only latest digits
+ intPart = intPart.substring(intPartLen - canary);
+ endIndexInt = intPart.length() + 1;
+
+ // append it
+ if (maximumIntegerDigits > 0 &&
+ !(this.minimumIntegerDigits == 0 &&
+ intPart.compareTo(String.valueOf(symbols.getZeroDigit())) == 0))
+ {
+ if (attributeStart < 0)
+ attributeStart = Math.max(dest.length() - 1, 0);
+ appendDigit(intPart, dest, this.groupingUsed);
+ }
+ }
+
+ // add the INTEGER attribute
+ addAttribute(Field.INTEGER, attributeStart, dest.length());
+
+ // ...update field position, if needed, and return...
+ if ((fieldPos.getField() == INTEGER_FIELD ||
+ fieldPos.getFieldAttribute() == NumberFormat.Field.INTEGER))
+ {
+ fieldPos.setBeginIndex(beginIndexInt);
+ fieldPos.setEndIndex(endIndexInt);
+ }
+
+ handleFractionalPart(dest, fractPart, fieldPos, isLong);
+
+ // and the exponent
+ if (this.useExponentialNotation)
+ {
+ attributeStart = dest.length();
+
+ dest.append(symbols.getExponential());
+
+ addAttribute(Field.EXPONENT_SYMBOL, attributeStart, dest.length());
+ attributeStart = dest.length();
+
+ if (exponent < 0)
+ {
+ dest.append(symbols.getMinusSign());
+ exponent = -exponent;
+
+ addAttribute(Field.EXPONENT_SIGN, attributeStart, dest.length());
+ }
+
+ attributeStart = dest.length();
+
+ String exponentString = String.valueOf(exponent);
+ int exponentLength = exponentString.length();
+
+ for (int i = 0; i < minExponentDigits - exponentLength; i++)
+ dest.append(symbols.getZeroDigit());
+
+ for (int i = 0; i < exponentLength; ++i)
+ dest.append(exponentString.charAt(i));
+
+ addAttribute(Field.EXPONENT, attributeStart, dest.length());
+ }
+
+ // now include the suffixes...
+ if (isNegative)
+ {
+ dest.append(negativeSuffix);
+ }
+ else
+ {
+ dest.append(positiveSuffix);
}
}
- // The locale-independent pattern symbols happen to be the same as
- // the US symbols.
- private static final DecimalFormatSymbols nonLocalizedSymbols
- = new DecimalFormatSymbols (Locale.US);
+ /**
+ * Add to the input buffer the result of formatting the fractional
+ * portion of the number.
+ *
+ * @param dest
+ * @param fractPart
+ * @param fieldPos
+ * @param isLong
+ */
+ private void handleFractionalPart(StringBuffer dest, String fractPart,
+ FieldPosition fieldPos, boolean isLong)
+ {
+ int dotStart = 0;
+ int dotEnd = 0;
+ boolean addDecimal = false;
+
+ if (this.decimalSeparatorAlwaysShown ||
+ ((!isLong || this.useExponentialNotation) &&
+ this.showDecimalSeparator && this.maximumFractionDigits > 0) ||
+ this.minimumFractionDigits > 0)
+ {
+ dotStart = dest.length();
+
+ if (this.useCurrencySeparator)
+ dest.append(symbols.getMonetaryDecimalSeparator());
+ else
+ dest.append(symbols.getDecimalSeparator());
+
+ dotEnd = dest.length();
+ addDecimal = true;
+ }
+
+ // now handle the fraction portion of the number
+ int fractStart = 0;
+ int fractEnd = 0;
+ boolean addFractional = false;
+
+ if ((!isLong || this.useExponentialNotation)
+ && this.maximumFractionDigits > 0
+ || this.minimumFractionDigits > 0)
+ {
+ fractStart = dest.length();
+ fractEnd = fractStart;
+
+ int digits = this.minimumFractionDigits;
+
+ if (this.useExponentialNotation)
+ {
+ digits = (this.minimumIntegerDigits + this.minimumFractionDigits)
+ - dest.length();
+ if (digits < 0) digits = 0;
+ }
+
+ fractPart = adjustTrailingZeros(fractPart, digits);
+
+ // FIXME: this code must be improved
+ // now check if the factional part is just 0, in this case
+ // we need to remove the '.' unless requested
+ boolean allZeros = true;
+ char fracts[] = fractPart.toCharArray();
+ for (int i = 0; i < fracts.length; i++)
+ {
+ if (fracts[i] != '0')
+ allZeros = false;
+ }
+
+ if (!allZeros || (minimumFractionDigits > 0))
+ {
+ appendDigit(fractPart, dest, false);
+ fractEnd = dest.length();
+
+ addDecimal = true;
+ addFractional = true;
+ }
+ else if (!this.decimalSeparatorAlwaysShown)
+ {
+ dest.deleteCharAt(dest.length() - 1);
+ addDecimal = false;
+ }
+ else
+ {
+ fractEnd = dest.length();
+ addFractional = true;
+ }
+ }
+
+ if (addDecimal)
+ addAttribute(Field.DECIMAL_SEPARATOR, dotStart, dotEnd);
+
+ if (addFractional)
+ addAttribute(Field.FRACTION, fractStart, fractEnd);
+
+ if ((fieldPos.getField() == FRACTION_FIELD ||
+ fieldPos.getFieldAttribute() == NumberFormat.Field.FRACTION))
+ {
+ fieldPos.setBeginIndex(fractStart);
+ fieldPos.setEndIndex(fractEnd);
+ }
+ }
+
+ /**
+ * Append to <code>dest</code>the give number of zeros.
+ * Grouping is added if needed.
+ * The integer totalDigitCount defines the total number of digits
+ * of the number to which we are appending zeroes.
+ */
+ private void appendZero(StringBuffer dest, int zeroes, int totalDigitCount)
+ {
+ char ch = symbols.getZeroDigit();
+ char gSeparator = symbols.getGroupingSeparator();
+
+ int i = 0;
+ int gPos = totalDigitCount;
+ for (i = 0; i < zeroes; i++, gPos--)
+ {
+ if (this.groupingSeparatorInPattern &&
+ (this.groupingUsed && this.groupingSize != 0) &&
+ (gPos % groupingSize == 0 && i > 0))
+ dest.append(gSeparator);
+
+ dest.append(ch);
+ }
+
+ // special case, that requires adding an additional separator
+ if (this.groupingSeparatorInPattern &&
+ (this.groupingUsed && this.groupingSize != 0) &&
+ (gPos % groupingSize == 0))
+ dest.append(gSeparator);
+ }
+
+ /**
+ * Append src to <code>dest</code>.
+ *
+ * Grouping is added if <code>groupingUsed</code> is set
+ * to <code>true</code>.
+ */
+ private void appendDigit(String src, StringBuffer dest,
+ boolean groupingUsed)
+ {
+ int zero = symbols.getZeroDigit() - '0';
+
+ int ch;
+ char gSeparator = symbols.getGroupingSeparator();
+
+ int len = src.length();
+ for (int i = 0, gPos = len; i < len; i++, gPos--)
+ {
+ ch = src.charAt(i);
+ if (groupingUsed && this.groupingSize != 0 &&
+ gPos % groupingSize == 0 && i > 0)
+ dest.append(gSeparator);
+ dest.append((char) (zero + ch));
+ }
+ }
+
/**
- * <p>
- * Substitutes the currency symbol into the given string,
- * based on the value used. Currency symbols can either
- * be a simple series of characters (e.g. '$'), which are
- * simply used as is, or they can be of a more complex
- * form:
- * </p>
- * <p>
- * (lower bound)|(mid value)|(upper bound)
- * </p>
- * <p>
- * where each bound has the syntax '(value)(# or <)(symbol)',
- * to indicate the bounding value and the symbol used.
- * </p>
- * <p>
- * The currency symbol replaces the currency specifier, '\u00a4',
- * an unlocalised character, which thus is used as such in all formats.
- * If this symbol occurs twice, the international currency code is used
- * instead.
- * </p>
- *
- * @param string The string containing the currency specifier, '\u00a4'.
- * @param number the number being formatted.
- * @return a string formatted for the correct currency.
+ * Calculate the exponent to use if eponential notation is used.
+ * The exponent is calculated as a power of ten.
+ * <code>number</code> should be positive, if is zero, or less than zero,
+ * zero is returned.
*/
- private String substituteCurrency(String string, double number)
+ private long getExponent(BigDecimal number)
{
- int index;
- int length;
- char currentChar;
- StringBuffer buf;
+ long exponent = 0;
- index = 0;
- length = string.length();
- buf = new StringBuffer();
+ if (number.signum() > 0)
+ {
+ double _number = number.doubleValue();
+ exponent = (long) Math.floor (Math.log10(_number));
+
+ // get the right value for the exponent
+ exponent = exponent - (exponent % this.exponentRound);
+
+ // if the minimumIntegerDigits is more than zero
+ // we display minimumIntegerDigits of digits.
+ // so, for example, if minimumIntegerDigits == 2
+ // and the actual number is 0.123 it will be
+ // formatted as 12.3E-2
+ // this means that the exponent have to be shifted
+ // to the correct value.
+ if (minimumIntegerDigits > 0)
+ exponent -= minimumIntegerDigits - 1;
+ }
+
+ return exponent;
+ }
+
+ /**
+ * Remove contiguos zeros from the end of the <code>src</code> string,
+ * if src contains more than <code>minimumDigits</code> digits.
+ * if src contains less that <code>minimumDigits</code>,
+ * then append zeros to the string.
+ *
+ * Only the first block of zero digits is removed from the string
+ * and only if they fall in the src.length - minimumDigits
+ * portion of the string.
+ *
+ * @param src The string with the correct number of zeros.
+ */
+ private String adjustTrailingZeros(String src, int minimumDigits)
+ {
+ int len = src.length();
+ String result;
- while (index < length)
+ // remove all trailing zero
+ if (len > minimumDigits)
{
- currentChar = string.charAt(index);
- if (string.charAt(index) == '\u00a4')
- {
- if ((index + 1) < length && string.charAt(index + 1) == '\u00a4')
- {
- buf.append(symbols.getInternationalCurrencySymbol());
- index += 2;
- }
- else
- {
- String symbol;
-
- symbol = symbols.getCurrencySymbol();
- if (symbol.startsWith("="))
- {
- String[] bounds;
- int[] boundValues;
- String[] boundSymbols;
-
- bounds = symbol.substring(1).split("\\|");
- boundValues = new int[3];
- boundSymbols = new String[3];
- for (int a = 0; a < 3; ++a)
- {
- String[] bound;
-
- bound = bounds[a].split("[#<]");
- boundValues[a] = Integer.parseInt(bound[0]);
- boundSymbols[a] = bound[1];
- }
- if (number <= boundValues[0])
- {
- buf.append(boundSymbols[0]);
- }
- else if (number >= boundValues[2])
- {
- buf.append(boundSymbols[2]);
- }
- else
- {
- buf.append(boundSymbols[1]);
- }
- ++index;
- }
- else
- {
- buf.append(symbol);
- ++index;
- }
- }
- }
- else
- {
- buf.append(string.charAt(index));
- ++index;
- }
+ int zeros = 0;
+ for (int i = len - 1; i > minimumDigits; i--)
+ {
+ if (src.charAt(i) == '0')
+ ++zeros;
+ else
+ break;
+ }
+ result = src.substring(0, len - zeros);
}
- return buf.toString();
+ else
+ {
+ char zero = symbols.getZeroDigit();
+ StringBuffer _result = new StringBuffer(src);
+ for (int i = len; i < minimumDigits; i++)
+ {
+ _result.append(zero);
+ }
+ result = _result.toString();
+ }
+
+ return result;
+ }
+
+ /**
+ * Adds an attribute to the attributes list.
+ *
+ * @param field
+ * @param begin
+ * @param end
+ */
+ private void addAttribute(Field field, int begin, int end)
+ {
+ /*
+ * This method and its implementation derives directly from the
+ * ICU4J (http://icu.sourceforge.net/) library, distributed under MIT/X.
+ */
+
+ FieldPosition pos = new FieldPosition(field);
+ pos.setBeginIndex(begin);
+ pos.setEndIndex(end);
+ attributes.add(pos);
}
+ /**
+ * Sets the default values for the various properties in this DecimaFormat.
+ */
+ private void setDefaultValues()
+ {
+ // Maybe we should add these values to the message bundle and take
+ // the most appropriate for them for any locale.
+ // Anyway, these seem to be good values for a default in most languages.
+ // Note that most of these will change based on the format string.
+
+ this.negativePrefix = String.valueOf(symbols.getMinusSign());
+ this.negativeSuffix = "";
+ this.positivePrefix = "";
+ this.positiveSuffix = "";
+
+ this.multiplier = 1;
+ this.negativePatternMultiplier = 1;
+ this.exponentRound = 1;
+
+ this.hasNegativePrefix = false;
+
+ this.minimumIntegerDigits = 1;
+ this.maximumIntegerDigits = DEFAULT_INTEGER_DIGITS;
+ this.minimumFractionDigits = 0;
+ this.maximumFractionDigits = DEFAULT_FRACTION_DIGITS;
+ this.minExponentDigits = 0;
+
+ this.groupingSize = 0;
+
+ this.decimalSeparatorAlwaysShown = false;
+ this.showDecimalSeparator = false;
+ this.useExponentialNotation = false;
+ this.groupingUsed = false;
+ this.groupingSeparatorInPattern = false;
+
+ this.useCurrencySeparator = false;
+
+ this.hasFractionalPattern = false;
+ }
}
diff --git a/libjava/classpath/java/text/DecimalFormatSymbols.java b/libjava/classpath/java/text/DecimalFormatSymbols.java
index a8735d36171..29d2d7ed337 100644
--- a/libjava/classpath/java/text/DecimalFormatSymbols.java
+++ b/libjava/classpath/java/text/DecimalFormatSymbols.java
@@ -63,13 +63,13 @@ import java.util.ResourceBundle;
* API docs for JDK 1.2 from http://www.javasoft.com.
* Status: Believed complete and correct to 1.2.
*/
-public final class DecimalFormatSymbols implements Cloneable, Serializable
+public class DecimalFormatSymbols implements Cloneable, Serializable
{
public Object clone ()
{
try
{
- return super.clone ();
+ return super.clone();
}
catch(CloneNotSupportedException e)
{
diff --git a/libjava/classpath/java/text/MessageFormat.java b/libjava/classpath/java/text/MessageFormat.java
index f59cfd5ca3e..3d428ac7e51 100644
--- a/libjava/classpath/java/text/MessageFormat.java
+++ b/libjava/classpath/java/text/MessageFormat.java
@@ -396,7 +396,7 @@ public class MessageFormat extends Format
* @param pattern The pattern used when formatting.
* @param arguments The array containing the objects to be formatted.
*/
- public static String format (String pattern, Object arguments[])
+ public static String format (String pattern, Object... arguments)
{
MessageFormat mf = new MessageFormat (pattern);
StringBuffer sb = new StringBuffer ();
diff --git a/libjava/classpath/java/text/NumberFormat.java b/libjava/classpath/java/text/NumberFormat.java
index a42e9b3d9c8..1bef97ffea9 100644
--- a/libjava/classpath/java/text/NumberFormat.java
+++ b/libjava/classpath/java/text/NumberFormat.java
@@ -218,18 +218,21 @@ public abstract class NumberFormat extends Format implements Cloneable
public final String format (long number)
{
StringBuffer sbuf = new StringBuffer(50);
- format (number, sbuf, null);
+ format (number, sbuf, new FieldPosition(0));
return sbuf.toString();
}
- public final StringBuffer format (Object obj, StringBuffer sbuf,
- FieldPosition pos)
+ /**
+ * @specnote this method was final in releases before 1.5
+ */
+ public StringBuffer format (Object obj, StringBuffer sbuf,
+ FieldPosition pos)
{
if (obj instanceof Number)
return format(((Number) obj).doubleValue(), sbuf, pos);
- else
- throw new IllegalArgumentException
- ("Cannot format given Object as a Number");
+
+ throw new
+ IllegalArgumentException("Cannot format given Object as a Number");
}
/**
@@ -351,7 +354,7 @@ public abstract class NumberFormat extends Format implements Cloneable
{
NumberFormat format;
- format = computeInstance (loc, "currencyFormat", "$#,##0.00;($#,##0.00)");
+ format = computeInstance (loc, "currencyFormat", "\u00A4#,##0.00;(\u00A4#,##0.00)");
format.setMaximumFractionDigits(format.getCurrency().getDefaultFractionDigits());
return format;
}
@@ -720,7 +723,9 @@ public abstract class NumberFormat extends Format implements Cloneable
public final String format (double number)
{
StringBuffer sbuf = new StringBuffer(50);
- format (number, sbuf, null);
+ FieldPosition position = new FieldPosition(0);
+
+ format (number, sbuf, position);
return sbuf.toString();
}
diff --git a/libjava/classpath/java/text/SimpleDateFormat.java b/libjava/classpath/java/text/SimpleDateFormat.java
index 2825c7bed24..1e195256990 100644
--- a/libjava/classpath/java/text/SimpleDateFormat.java
+++ b/libjava/classpath/java/text/SimpleDateFormat.java
@@ -917,7 +917,25 @@ public class SimpleDateFormat extends DateFormat
|| ((ch < 'a' || ch > 'z')
&& (ch < 'A' || ch > 'Z')))
{
- if (! expect (dateStr, pos, ch))
+ if (quote_start == -1 && ch == ' ')
+ {
+ // A single unquoted space in the pattern may match
+ // any number of spaces in the input.
+ int index = pos.getIndex();
+ int save = index;
+ while (index < dateStr.length()
+ && Character.isWhitespace(dateStr.charAt(index)))
+ ++index;
+ if (index > save)
+ pos.setIndex(index);
+ else
+ {
+ // Didn't see any whitespace.
+ pos.setErrorIndex(index);
+ return null;
+ }
+ }
+ else if (! expect (dateStr, pos, ch))
return null;
continue;
}
diff --git a/libjava/classpath/java/util/.cvsignore b/libjava/classpath/java/util/.cvsignore
new file mode 100644
index 00000000000..d41ae8d8147
--- /dev/null
+++ b/libjava/classpath/java/util/.cvsignore
@@ -0,0 +1 @@
+LocaleData.java
diff --git a/libjava/classpath/java/util/AbstractCollection.java b/libjava/classpath/java/util/AbstractCollection.java
index 3ae98e07311..ef74342237a 100644
--- a/libjava/classpath/java/util/AbstractCollection.java
+++ b/libjava/classpath/java/util/AbstractCollection.java
@@ -1,5 +1,5 @@
/* AbstractCollection.java -- Abstract implementation of most of Collection
- Copyright (C) 1998, 2000, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -62,13 +62,16 @@ import java.lang.reflect.Array;
* @author Original author unknown
* @author Bryce McKinlay
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @see Collection
* @see AbstractSet
* @see AbstractList
* @since 1.2
* @status updated to 1.4
*/
-public abstract class AbstractCollection implements Collection
+public abstract class AbstractCollection<E>
+ implements Collection<E>, Iterable<E>
{
/**
* The main constructor, for use by subclasses.
@@ -84,7 +87,7 @@ public abstract class AbstractCollection implements Collection
*
* @return an iterator
*/
- public abstract Iterator iterator();
+ public abstract Iterator<E> iterator();
/**
* Return the number of elements in this collection. If there are more than
@@ -110,7 +113,7 @@ public abstract class AbstractCollection implements Collection
* @throws IllegalArgumentException if some aspect of the object prevents
* it from being added
*/
- public boolean add(Object o)
+ public boolean add(E o)
{
throw new UnsupportedOperationException();
}
@@ -138,9 +141,9 @@ public abstract class AbstractCollection implements Collection
* collection doesn't allow null values.
* @see #add(Object)
*/
- public boolean addAll(Collection c)
+ public boolean addAll(Collection<? extends E> c)
{
- Iterator itr = c.iterator();
+ Iterator<? extends E> itr = c.iterator();
boolean modified = false;
int pos = c.size();
while (--pos >= 0)
@@ -162,7 +165,7 @@ public abstract class AbstractCollection implements Collection
*/
public void clear()
{
- Iterator itr = iterator();
+ Iterator<E> itr = iterator();
int pos = size();
while (--pos >= 0)
{
@@ -184,7 +187,7 @@ public abstract class AbstractCollection implements Collection
*/
public boolean contains(Object o)
{
- Iterator itr = iterator();
+ Iterator<E> itr = iterator();
int pos = size();
while (--pos >= 0)
if (equals(o, itr.next()))
@@ -204,9 +207,9 @@ public abstract class AbstractCollection implements Collection
* @throws NullPointerException if the given collection is null
* @see #contains(Object)
*/
- public boolean containsAll(Collection c)
+ public boolean containsAll(Collection<?> c)
{
- Iterator itr = c.iterator();
+ Iterator<?> itr = c.iterator();
int pos = c.size();
while (--pos >= 0)
if (!contains(itr.next()))
@@ -247,7 +250,7 @@ public abstract class AbstractCollection implements Collection
*/
public boolean remove(Object o)
{
- Iterator itr = iterator();
+ Iterator<E> itr = iterator();
int pos = size();
while (--pos >= 0)
if (equals(o, itr.next()))
@@ -273,7 +276,7 @@ public abstract class AbstractCollection implements Collection
* @throws NullPointerException if the collection, c, is null.
* @see Iterator#remove()
*/
- public boolean removeAll(Collection c)
+ public boolean removeAll(Collection<?> c)
{
return removeAllInternal(c);
}
@@ -295,9 +298,9 @@ public abstract class AbstractCollection implements Collection
* @see Iterator#remove()
*/
// Package visible for use throughout java.util.
- boolean removeAllInternal(Collection c)
+ boolean removeAllInternal(Collection<?> c)
{
- Iterator itr = iterator();
+ Iterator<E> itr = iterator();
boolean modified = false;
int pos = size();
while (--pos >= 0)
@@ -324,7 +327,7 @@ public abstract class AbstractCollection implements Collection
* @throws NullPointerException if the collection, c, is null.
* @see Iterator#remove()
*/
- public boolean retainAll(Collection c)
+ public boolean retainAll(Collection<?> c)
{
return retainAllInternal(c);
}
@@ -347,9 +350,9 @@ public abstract class AbstractCollection implements Collection
* @see Iterator#remove()
*/
// Package visible for use throughout java.util.
- boolean retainAllInternal(Collection c)
+ boolean retainAllInternal(Collection<?> c)
{
- Iterator itr = iterator();
+ Iterator<E> itr = iterator();
boolean modified = false;
int pos = size();
while (--pos >= 0)
@@ -372,7 +375,7 @@ public abstract class AbstractCollection implements Collection
*/
public Object[] toArray()
{
- Iterator itr = iterator();
+ Iterator<E> itr = iterator();
int size = size();
Object[] a = new Object[size];
for (int pos = 0; pos < size; pos++)
@@ -402,19 +405,18 @@ public abstract class AbstractCollection implements Collection
* @throws ArrayStoreException if the type of the array precludes holding
* one of the elements of the Collection
*/
- public Object[] toArray(Object[] a)
+ public <T> T[] toArray(T[] a)
{
int size = size();
if (a.length < size)
- a = (Object[]) Array.newInstance(a.getClass().getComponentType(),
+ a = (T[]) Array.newInstance(a.getClass().getComponentType(),
size);
else if (a.length > size)
a[size] = null;
- Iterator itr = iterator();
+ Iterator<E> itr = iterator();
for (int pos = 0; pos < size; pos++)
- a[pos] = itr.next();
-
+ a[pos] = (T) (itr.next());
return a;
}
diff --git a/libjava/classpath/java/util/AbstractList.java b/libjava/classpath/java/util/AbstractList.java
index 114712eeeaf..c47b59b21ad 100644
--- a/libjava/classpath/java/util/AbstractList.java
+++ b/libjava/classpath/java/util/AbstractList.java
@@ -1,5 +1,6 @@
/* AbstractList.java -- Abstract implementation of most of List
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -68,7 +69,9 @@ package java.util;
* @since 1.2
* @status updated to 1.4
*/
-public abstract class AbstractList extends AbstractCollection implements List
+public abstract class AbstractList<E>
+ extends AbstractCollection<E>
+ implements List<E>
{
/**
* A count of the number of structural modifications that have been made to
@@ -101,7 +104,7 @@ public abstract class AbstractList extends AbstractCollection implements List
* @return the element at that position
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
- public abstract Object get(int index);
+ public abstract E get(int index);
/**
* Insert an element into the list at a given position (optional operation).
@@ -123,7 +126,7 @@ public abstract class AbstractList extends AbstractCollection implements List
* some other reason
* @see #modCount
*/
- public void add(int index, Object o)
+ public void add(int index, E o)
{
throw new UnsupportedOperationException();
}
@@ -144,7 +147,7 @@ public abstract class AbstractList extends AbstractCollection implements List
* some other reason
* @see #add(int, Object)
*/
- public boolean add(Object o)
+ public boolean add(E o)
{
add(size(), o);
return true;
@@ -173,9 +176,9 @@ public abstract class AbstractList extends AbstractCollection implements List
* @throws NullPointerException if the specified collection is null
* @see #add(int, Object)
*/
- public boolean addAll(int index, Collection c)
+ public boolean addAll(int index, Collection<? extends E> c)
{
- Iterator itr = c.iterator();
+ Iterator<? extends E> itr = c.iterator();
int size = c.size();
for (int pos = size; pos > 0; pos--)
add(index++, itr.next());
@@ -227,7 +230,7 @@ public abstract class AbstractList extends AbstractCollection implements List
if (size != ((List) o).size())
return false;
- Iterator itr1 = iterator();
+ Iterator<E> itr1 = iterator();
Iterator itr2 = ((List) o).iterator();
while (--size >= 0)
@@ -259,7 +262,7 @@ while (i.hasNext())
public int hashCode()
{
int hashCode = 1;
- Iterator itr = iterator();
+ Iterator<E> itr = iterator();
int pos = size();
while (--pos >= 0)
hashCode = 31 * hashCode + hashCode(itr.next());
@@ -277,7 +280,7 @@ while (i.hasNext())
*/
public int indexOf(Object o)
{
- ListIterator itr = listIterator();
+ ListIterator<E> itr = listIterator();
int size = size();
for (int pos = 0; pos < size; pos++)
if (equals(o, itr.next()))
@@ -297,10 +300,10 @@ while (i.hasNext())
* @return an Iterator over the elements of this list, in order
* @see #modCount
*/
- public Iterator iterator()
+ public Iterator<E> iterator()
{
// Bah, Sun's implementation forbids using listIterator(0).
- return new Iterator()
+ return new Iterator<E>()
{
private int pos = 0;
private int size = size();
@@ -342,7 +345,7 @@ while (i.hasNext())
* @throws ConcurrentModificationException if the
* list has been modified elsewhere.
*/
- public Object next()
+ public E next()
{
checkMod();
if (pos == size)
@@ -388,7 +391,7 @@ while (i.hasNext())
public int lastIndexOf(Object o)
{
int pos = size();
- ListIterator itr = listIterator(pos);
+ ListIterator<E> itr = listIterator(pos);
while (--pos >= 0)
if (equals(o, itr.previous()))
return pos;
@@ -402,7 +405,7 @@ while (i.hasNext())
* @return a ListIterator over the elements of this list, in order, starting
* at the beginning
*/
- public ListIterator listIterator()
+ public ListIterator<E> listIterator()
{
return listIterator(0);
}
@@ -425,13 +428,13 @@ while (i.hasNext())
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
* @see #modCount
*/
- public ListIterator listIterator(final int index)
+ public ListIterator<E> listIterator(final int index)
{
if (index < 0 || index > size())
throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
+ size());
- return new ListIterator()
+ return new ListIterator<E>()
{
private int knownMod = modCount;
private int position = index;
@@ -485,7 +488,7 @@ while (i.hasNext())
* @throws ConcurrentModificationException if the
* list has been modified elsewhere.
*/
- public Object next()
+ public E next()
{
checkMod();
if (position == size)
@@ -503,7 +506,7 @@ while (i.hasNext())
* @throws ConcurrentModificationException if the
* list has been modified elsewhere.
*/
- public Object previous()
+ public E previous()
{
checkMod();
if (position == 0)
@@ -577,7 +580,7 @@ while (i.hasNext())
* @throws ConcurrentModificationException if the list
* has been modified elsewhere.
*/
- public void set(Object o)
+ public void set(E o)
{
checkMod();
if (lastReturned < 0)
@@ -599,7 +602,7 @@ while (i.hasNext())
* @throws ConcurrentModificationException if the list
* has been modified elsewhere.
*/
- public void add(Object o)
+ public void add(E o)
{
checkMod();
AbstractList.this.add(position++, o);
@@ -624,7 +627,7 @@ while (i.hasNext())
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
* @see #modCount
*/
- public Object remove(int index)
+ public E remove(int index)
{
throw new UnsupportedOperationException();
}
@@ -650,7 +653,7 @@ while (i.hasNext())
*/
protected void removeRange(int fromIndex, int toIndex)
{
- ListIterator itr = listIterator(fromIndex);
+ ListIterator<E> itr = listIterator(fromIndex);
for (int index = fromIndex; index < toIndex; index++)
{
itr.next();
@@ -673,7 +676,7 @@ while (i.hasNext())
* @throws IllegalArgumentException if o cannot be added to this list for
* some other reason
*/
- public Object set(int index, Object o)
+ public E set(int index, E o)
{
throw new UnsupportedOperationException();
}
@@ -722,7 +725,7 @@ while (i.hasNext())
* @see ConcurrentModificationException
* @see RandomAccess
*/
- public List subList(int fromIndex, int toIndex)
+ public List<E> subList(int fromIndex, int toIndex)
{
// This follows the specification of AbstractList, but is inconsistent
// with the one in List. Don't you love Sun's inconsistencies?
@@ -732,8 +735,8 @@ while (i.hasNext())
throw new IndexOutOfBoundsException();
if (this instanceof RandomAccess)
- return new RandomAccessSubList(this, fromIndex, toIndex);
- return new SubList(this, fromIndex, toIndex);
+ return new RandomAccessSubList<E>(this, fromIndex, toIndex);
+ return new SubList<E>(this, fromIndex, toIndex);
}
/**
@@ -744,16 +747,16 @@ while (i.hasNext())
* @author Original author unknown
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static class SubList extends AbstractList
+ private static class SubList<E> extends AbstractList<E>
{
// Package visible, for use by iterator.
/** The original list. */
- final AbstractList backingList;
+ final AbstractList<E> backingList;
/** The index of the first element of the sublist. */
final int offset;
/** The size of the sublist. */
int size;
-
+
/**
* Construct the sublist.
*
@@ -761,14 +764,14 @@ while (i.hasNext())
* @param fromIndex the lower bound, inclusive
* @param toIndex the upper bound, exclusive
*/
- SubList(AbstractList backing, int fromIndex, int toIndex)
+ SubList(AbstractList<E> backing, int fromIndex, int toIndex)
{
backingList = backing;
modCount = backing.modCount;
offset = fromIndex;
size = toIndex - fromIndex;
}
-
+
/**
* This method checks the two modCount fields to ensure that there has
* not been a concurrent modification, returning if all is okay.
@@ -780,9 +783,9 @@ while (i.hasNext())
void checkMod()
{
if (modCount != backingList.modCount)
- throw new ConcurrentModificationException();
+ throw new ConcurrentModificationException();
}
-
+
/**
* This method checks that a value is between 0 and size (inclusive). If
* it is not, an exception is thrown.
@@ -794,10 +797,10 @@ while (i.hasNext())
private void checkBoundsInclusive(int index)
{
if (index < 0 || index > size)
- throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
- + size);
+ throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
+ + size);
}
-
+
/**
* This method checks that a value is between 0 (inclusive) and size
* (exclusive). If it is not, an exception is thrown.
@@ -809,10 +812,10 @@ while (i.hasNext())
private void checkBoundsExclusive(int index)
{
if (index < 0 || index >= size)
- throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
- + size);
+ throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
+ + size);
}
-
+
/**
* Specified by AbstractList.subList to return the private field size.
*
@@ -825,7 +828,7 @@ while (i.hasNext())
checkMod();
return size;
}
-
+
/**
* Specified by AbstractList.subList to delegate to the backing list.
*
@@ -842,13 +845,13 @@ while (i.hasNext())
* @throws IllegalArgumentException if o cannot be added to the backing list
* for some other reason
*/
- public Object set(int index, Object o)
+ public E set(int index, E o)
{
checkMod();
checkBoundsExclusive(index);
return backingList.set(index + offset, o);
}
-
+
/**
* Specified by AbstractList.subList to delegate to the backing list.
*
@@ -858,13 +861,13 @@ while (i.hasNext())
* modified externally to this sublist
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
- public Object get(int index)
+ public E get(int index)
{
checkMod();
checkBoundsExclusive(index);
return backingList.get(index + offset);
}
-
+
/**
* Specified by AbstractList.subList to delegate to the backing list.
*
@@ -880,7 +883,7 @@ while (i.hasNext())
* @throws IllegalArgumentException if o cannot be added to the backing
* list for some other reason.
*/
- public void add(int index, Object o)
+ public void add(int index, E o)
{
checkMod();
checkBoundsInclusive(index);
@@ -888,7 +891,7 @@ while (i.hasNext())
size++;
modCount = backingList.modCount;
}
-
+
/**
* Specified by AbstractList.subList to delegate to the backing list.
*
@@ -900,16 +903,16 @@ while (i.hasNext())
* @throws UnsupportedOperationException if the backing list does not
* support the remove operation
*/
- public Object remove(int index)
+ public E remove(int index)
{
checkMod();
checkBoundsExclusive(index);
- Object o = backingList.remove(index + offset);
+ E o = backingList.remove(index + offset);
size--;
modCount = backingList.modCount;
return o;
}
-
+
/**
* Specified by AbstractList.subList to delegate to the backing list.
* This does no bounds checking, as it assumes it will only be called
@@ -925,12 +928,12 @@ while (i.hasNext())
protected void removeRange(int fromIndex, int toIndex)
{
checkMod();
-
+
backingList.removeRange(offset + fromIndex, offset + toIndex);
size -= toIndex - fromIndex;
modCount = backingList.modCount;
}
-
+
/**
* Specified by AbstractList.subList to delegate to the backing list.
*
@@ -948,7 +951,7 @@ while (i.hasNext())
* to this list for some other reason
* @throws NullPointerException if the specified collection is null
*/
- public boolean addAll(int index, Collection c)
+ public boolean addAll(int index, Collection<? extends E> c)
{
checkMod();
checkBoundsInclusive(index);
@@ -958,7 +961,7 @@ while (i.hasNext())
modCount = backingList.modCount;
return result;
}
-
+
/**
* Specified by AbstractList.subList to return addAll(size, c).
*
@@ -974,21 +977,21 @@ while (i.hasNext())
* to this list for some other reason
* @throws NullPointerException if the specified collection is null
*/
- public boolean addAll(Collection c)
+ public boolean addAll(Collection<? extends E> c)
{
return addAll(size, c);
}
-
+
/**
* Specified by AbstractList.subList to return listIterator().
*
* @return an iterator over the sublist
*/
- public Iterator iterator()
+ public Iterator<E> iterator()
{
return listIterator();
}
-
+
/**
* Specified by AbstractList.subList to return a wrapper around the
* backing list's iterator.
@@ -999,179 +1002,180 @@ while (i.hasNext())
* modified externally to this sublist
* @throws IndexOutOfBoundsException if the value is out of range
*/
- public ListIterator listIterator(final int index)
+ public ListIterator<E> listIterator(final int index)
{
checkMod();
checkBoundsInclusive(index);
-
- return new ListIterator()
- {
- private final ListIterator i = backingList.listIterator(index + offset);
- private int position = index;
-
- /**
- * Tests to see if there are any more objects to
- * return.
- *
- * @return True if the end of the list has not yet been
- * reached.
- */
- public boolean hasNext()
- {
- return position < size;
- }
-
- /**
- * Tests to see if there are objects prior to the
- * current position in the list.
- *
- * @return True if objects exist prior to the current
- * position of the iterator.
- */
- public boolean hasPrevious()
- {
- return position > 0;
- }
-
- /**
- * Retrieves the next object from the list.
- *
- * @return The next object.
- * @throws NoSuchElementException if there are no
- * more objects to retrieve.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public Object next()
- {
- if (position == size)
- throw new NoSuchElementException();
- position++;
- return i.next();
- }
-
- /**
- * Retrieves the previous object from the list.
- *
- * @return The next object.
- * @throws NoSuchElementException if there are no
- * previous objects to retrieve.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public Object previous()
- {
- if (position == 0)
- throw new NoSuchElementException();
- position--;
- return i.previous();
- }
-
- /**
- * Returns the index of the next element in the
- * list, which will be retrieved by <code>next()</code>
- *
- * @return The index of the next element.
- */
- public int nextIndex()
- {
- return i.nextIndex() - offset;
- }
-
- /**
- * Returns the index of the previous element in the
- * list, which will be retrieved by <code>previous()</code>
- *
- * @return The index of the previous element.
- */
- public int previousIndex()
- {
- return i.previousIndex() - offset;
- }
-
- /**
- * Removes the last object retrieved by <code>next()</code>
- * from the list, if the list supports object removal.
- *
- * @throws IllegalStateException if the iterator is positioned
- * before the start of the list or the last object has already
- * been removed.
- * @throws UnsupportedOperationException if the list does
- * not support removing elements.
- */
- public void remove()
- {
- i.remove();
- size--;
- position = nextIndex();
- modCount = backingList.modCount;
- }
-
-
- /**
- * Replaces the last object retrieved by <code>next()</code>
- * or <code>previous</code> with o, if the list supports object
- * replacement and an add or remove operation has not already
- * been performed.
- *
- * @throws IllegalStateException if the iterator is positioned
- * before the start of the list or the last object has already
- * been removed.
- * @throws UnsupportedOperationException if the list doesn't support
- * the addition or removal of elements.
- * @throws ClassCastException if the type of o is not a valid type
- * for this list.
- * @throws IllegalArgumentException if something else related to o
- * prevents its addition.
- * @throws ConcurrentModificationException if the list
- * has been modified elsewhere.
- */
- public void set(Object o)
- {
- i.set(o);
- }
-
- /**
- * Adds the supplied object before the element that would be returned
- * by a call to <code>next()</code>, if the list supports addition.
- *
- * @param o The object to add to the list.
- * @throws UnsupportedOperationException if the list doesn't support
- * the addition of new elements.
- * @throws ClassCastException if the type of o is not a valid type
- * for this list.
- * @throws IllegalArgumentException if something else related to o
- * prevents its addition.
- * @throws ConcurrentModificationException if the list
- * has been modified elsewhere.
- */
- public void add(Object o)
- {
- i.add(o);
- size++;
- position++;
- modCount = backingList.modCount;
- }
-
- // Here is the reason why the various modCount fields are mostly
- // ignored in this wrapper listIterator.
- // If the backing listIterator is failfast, then the following holds:
- // Using any other method on this list will call a corresponding
- // method on the backing list *after* the backing listIterator
- // is created, which will in turn cause a ConcurrentModException
- // when this listIterator comes to use the backing one. So it is
- // implicitly failfast.
- // If the backing listIterator is NOT failfast, then the whole of
- // this list isn't failfast, because the modCount field of the
- // backing list is not valid. It would still be *possible* to
- // make the iterator failfast wrt modifications of the sublist
- // only, but somewhat pointless when the list can be changed under
- // us.
- // Either way, no explicit handling of modCount is needed.
- // However modCount = backingList.modCount must be executed in add
- // and remove, and size must also be updated in these two methods,
- // since they do not go through the corresponding methods of the subList.
- };
+
+ return new ListIterator<E>()
+ {
+ private final ListIterator<E> i
+ = backingList.listIterator(index + offset);
+ private int position = index;
+
+ /**
+ * Tests to see if there are any more objects to
+ * return.
+ *
+ * @return True if the end of the list has not yet been
+ * reached.
+ */
+ public boolean hasNext()
+ {
+ return position < size;
+ }
+
+ /**
+ * Tests to see if there are objects prior to the
+ * current position in the list.
+ *
+ * @return True if objects exist prior to the current
+ * position of the iterator.
+ */
+ public boolean hasPrevious()
+ {
+ return position > 0;
+ }
+
+ /**
+ * Retrieves the next object from the list.
+ *
+ * @return The next object.
+ * @throws NoSuchElementException if there are no
+ * more objects to retrieve.
+ * @throws ConcurrentModificationException if the
+ * list has been modified elsewhere.
+ */
+ public E next()
+ {
+ if (position == size)
+ throw new NoSuchElementException();
+ position++;
+ return i.next();
+ }
+
+ /**
+ * Retrieves the previous object from the list.
+ *
+ * @return The next object.
+ * @throws NoSuchElementException if there are no
+ * previous objects to retrieve.
+ * @throws ConcurrentModificationException if the
+ * list has been modified elsewhere.
+ */
+ public E previous()
+ {
+ if (position == 0)
+ throw new NoSuchElementException();
+ position--;
+ return i.previous();
+ }
+
+ /**
+ * Returns the index of the next element in the
+ * list, which will be retrieved by <code>next()</code>
+ *
+ * @return The index of the next element.
+ */
+ public int nextIndex()
+ {
+ return i.nextIndex() - offset;
+ }
+
+ /**
+ * Returns the index of the previous element in the
+ * list, which will be retrieved by <code>previous()</code>
+ *
+ * @return The index of the previous element.
+ */
+ public int previousIndex()
+ {
+ return i.previousIndex() - offset;
+ }
+
+ /**
+ * Removes the last object retrieved by <code>next()</code>
+ * from the list, if the list supports object removal.
+ *
+ * @throws IllegalStateException if the iterator is positioned
+ * before the start of the list or the last object has already
+ * been removed.
+ * @throws UnsupportedOperationException if the list does
+ * not support removing elements.
+ */
+ public void remove()
+ {
+ i.remove();
+ size--;
+ position = nextIndex();
+ modCount = backingList.modCount;
+ }
+
+
+ /**
+ * Replaces the last object retrieved by <code>next()</code>
+ * or <code>previous</code> with o, if the list supports object
+ * replacement and an add or remove operation has not already
+ * been performed.
+ *
+ * @throws IllegalStateException if the iterator is positioned
+ * before the start of the list or the last object has already
+ * been removed.
+ * @throws UnsupportedOperationException if the list doesn't support
+ * the addition or removal of elements.
+ * @throws ClassCastException if the type of o is not a valid type
+ * for this list.
+ * @throws IllegalArgumentException if something else related to o
+ * prevents its addition.
+ * @throws ConcurrentModificationException if the list
+ * has been modified elsewhere.
+ */
+ public void set(E o)
+ {
+ i.set(o);
+ }
+
+ /**
+ * Adds the supplied object before the element that would be returned
+ * by a call to <code>next()</code>, if the list supports addition.
+ *
+ * @param o The object to add to the list.
+ * @throws UnsupportedOperationException if the list doesn't support
+ * the addition of new elements.
+ * @throws ClassCastException if the type of o is not a valid type
+ * for this list.
+ * @throws IllegalArgumentException if something else related to o
+ * prevents its addition.
+ * @throws ConcurrentModificationException if the list
+ * has been modified elsewhere.
+ */
+ public void add(E o)
+ {
+ i.add(o);
+ size++;
+ position++;
+ modCount = backingList.modCount;
+ }
+
+ // Here is the reason why the various modCount fields are mostly
+ // ignored in this wrapper listIterator.
+ // If the backing listIterator is failfast, then the following holds:
+ // Using any other method on this list will call a corresponding
+ // method on the backing list *after* the backing listIterator
+ // is created, which will in turn cause a ConcurrentModException
+ // when this listIterator comes to use the backing one. So it is
+ // implicitly failfast.
+ // If the backing listIterator is NOT failfast, then the whole of
+ // this list isn't failfast, because the modCount field of the
+ // backing list is not valid. It would still be *possible* to
+ // make the iterator failfast wrt modifications of the sublist
+ // only, but somewhat pointless when the list can be changed under
+ // us.
+ // Either way, no explicit handling of modCount is needed.
+ // However modCount = backingList.modCount must be executed in add
+ // and remove, and size must also be updated in these two methods,
+ // since they do not go through the corresponding methods of the subList.
+ };
}
} // class SubList
@@ -1181,7 +1185,7 @@ while (i.hasNext())
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class RandomAccessSubList extends SubList
+ private static final class RandomAccessSubList<E> extends SubList<E>
implements RandomAccess
{
/**
@@ -1191,10 +1195,10 @@ while (i.hasNext())
* @param fromIndex the lower bound, inclusive
* @param toIndex the upper bound, exclusive
*/
- RandomAccessSubList(AbstractList backing, int fromIndex, int toIndex)
+ RandomAccessSubList(AbstractList<E> backing, int fromIndex, int toIndex)
{
super(backing, fromIndex, toIndex);
}
} // class RandomAccessSubList
-
+
} // class AbstractList
diff --git a/libjava/classpath/java/util/AbstractMap.java b/libjava/classpath/java/util/AbstractMap.java
index b4ab882addf..29249e1dc22 100644
--- a/libjava/classpath/java/util/AbstractMap.java
+++ b/libjava/classpath/java/util/AbstractMap.java
@@ -1,5 +1,6 @@
/* AbstractMap.java -- Abstract implementation of most of Map
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +39,8 @@ exception statement from your version. */
package java.util;
+import java.io.Serializable;
+
/**
* An abstract implementation of Map to make it easier to create your own
* implementations. In order to create an unmodifiable Map, subclass
@@ -64,9 +67,43 @@ package java.util;
* @since 1.2
* @status updated to 1.4
*/
-public abstract class AbstractMap implements Map
+public abstract class AbstractMap<K, V> implements Map<K, V>
{
- /** An "enum" of iterator types. */
+ /** @since 1.6 */
+ public static class SimpleImmutableEntry<K, V>
+ implements Entry<K, V>, Serializable
+ {
+ K key;
+ V value;
+
+ public SimpleImmutableEntry(K key, V value)
+ {
+ this.key = key;
+ this.value = value;
+ }
+
+ public SimpleImmutableEntry(Entry<? extends K, ? extends V> entry)
+ {
+ this(entry.getKey(), entry.getValue());
+ }
+
+ public K getKey()
+ {
+ return key;
+ }
+
+ public V getValue()
+ {
+ return value;
+ }
+
+ public V setValue(V value)
+ {
+ throw new UnsupportedOperationException("setValue not supported on immutable entry");
+ }
+ }
+
+/** An "enum" of iterator types. */
// Package visible for use by subclasses.
static final int KEYS = 0,
VALUES = 1,
@@ -76,13 +113,13 @@ public abstract class AbstractMap implements Map
* The cache for {@link #keySet()}.
*/
// Package visible for use by subclasses.
- Set keys;
+ Set<K> keys;
/**
* The cache for {@link #values()}.
*/
// Package visible for use by subclasses.
- Collection values;
+ Collection<V> values;
/**
* The main constructor, for use by subclasses.
@@ -104,7 +141,7 @@ public abstract class AbstractMap implements Map
* @return the entry set
* @see Map.Entry
*/
- public abstract Set entrySet();
+ public abstract Set<Map.Entry<K, V>> entrySet();
/**
* Remove all entries from this Map (optional operation). This default
@@ -133,7 +170,7 @@ public abstract class AbstractMap implements Map
*/
protected Object clone() throws CloneNotSupportedException
{
- AbstractMap copy = (AbstractMap) super.clone();
+ AbstractMap<K, V> copy = (AbstractMap<K, V>) super.clone();
// Clear out the caches; they are stale.
copy.keys = null;
copy.values = null;
@@ -155,10 +192,10 @@ public abstract class AbstractMap implements Map
*/
public boolean containsKey(Object key)
{
- Iterator entries = entrySet().iterator();
+ Iterator<Map.Entry<K, V>> entries = entrySet().iterator();
int pos = size();
while (--pos >= 0)
- if (equals(key, ((Map.Entry) entries.next()).getKey()))
+ if (equals(key, entries.next().getKey()))
return true;
return false;
}
@@ -178,10 +215,10 @@ public abstract class AbstractMap implements Map
*/
public boolean containsValue(Object value)
{
- Iterator entries = entrySet().iterator();
+ Iterator<Map.Entry<K, V>> entries = entrySet().iterator();
int pos = size();
while (--pos >= 0)
- if (equals(value, ((Map.Entry) entries.next()).getValue()))
+ if (equals(value, entries.next().getValue()))
return true;
return false;
}
@@ -198,9 +235,9 @@ public abstract class AbstractMap implements Map
*/
public boolean equals(Object o)
{
- return (o == this ||
- (o instanceof Map &&
- entrySet().equals(((Map) o).entrySet())));
+ return (o == this
+ || (o instanceof Map
+ && entrySet().equals(((Map<K, V>) o).entrySet())));
}
/**
@@ -215,13 +252,13 @@ public abstract class AbstractMap implements Map
* @throws NullPointerException if this map does not accept null keys
* @see #containsKey(Object)
*/
- public Object get(Object key)
+ public V get(Object key)
{
- Iterator entries = entrySet().iterator();
+ Iterator<Map.Entry<K, V>> entries = entrySet().iterator();
int pos = size();
while (--pos >= 0)
{
- Map.Entry entry = (Map.Entry) entries.next();
+ Map.Entry<K, V> entry = entries.next();
if (equals(key, entry.getKey()))
return entry.getValue();
}
@@ -273,10 +310,10 @@ public abstract class AbstractMap implements Map
* @see #containsKey(Object)
* @see #values()
*/
- public Set keySet()
+ public Set<K> keySet()
{
if (keys == null)
- keys = new AbstractSet()
+ keys = new AbstractSet<K>()
{
/**
* Retrieves the number of keys in the backing map.
@@ -294,7 +331,7 @@ public abstract class AbstractMap implements Map
*
* @param key The key to search for.
* @return True if the key was found, false otherwise.
- */
+ */
public boolean contains(Object key)
{
return containsKey(key);
@@ -307,14 +344,15 @@ public abstract class AbstractMap implements Map
*
* @return An iterator over the keys.
*/
- public Iterator iterator()
+ public Iterator<K> iterator()
{
- return new Iterator()
+ return new Iterator<K>()
{
/**
* The iterator returned by <code>entrySet()</code>.
*/
- private final Iterator map_iterator = entrySet().iterator();
+ private final Iterator<Map.Entry<K, V>> map_iterator
+ = entrySet().iterator();
/**
* Returns true if a call to <code>next()</code> will
@@ -333,10 +371,10 @@ public abstract class AbstractMap implements Map
* by the underlying <code>entrySet()</code> iterator.
*
* @return The next key.
- */
- public Object next()
+ */
+ public K next()
{
- return ((Map.Entry) map_iterator.next()).getKey();
+ return map_iterator.next().getKey();
}
/**
@@ -374,7 +412,7 @@ public abstract class AbstractMap implements Map
* @throws NullPointerException if the map forbids null keys or values
* @see #containsKey(Object)
*/
- public Object put(Object key, Object value)
+ public V put(K key, V value)
{
throw new UnsupportedOperationException();
}
@@ -396,13 +434,16 @@ public abstract class AbstractMap implements Map
* @throws NullPointerException if <code>m</code> is null.
* @see #put(Object, Object)
*/
- public void putAll(Map m)
+ public void putAll(Map<? extends K, ? extends V> m)
{
- Iterator entries = m.entrySet().iterator();
+ // FIXME: bogus circumlocution.
+ Iterator entries2 = m.entrySet().iterator();
+ Iterator<Map.Entry<? extends K, ? extends V>> entries
+ = (Iterator<Map.Entry<? extends K, ? extends V>>) entries2;
int pos = m.size();
while (--pos >= 0)
{
- Map.Entry entry = (Map.Entry) entries.next();
+ Map.Entry<? extends K, ? extends V> entry = entries.next();
put(entry.getKey(), entry.getValue());
}
}
@@ -424,17 +465,17 @@ public abstract class AbstractMap implements Map
* @throws UnsupportedOperationException if deletion is unsupported
* @see Iterator#remove()
*/
- public Object remove(Object key)
+ public V remove(Object key)
{
- Iterator entries = entrySet().iterator();
+ Iterator<Map.Entry<K, V>> entries = entrySet().iterator();
int pos = size();
while (--pos >= 0)
{
- Map.Entry entry = (Map.Entry) entries.next();
+ Map.Entry<K, V> entry = entries.next();
if (equals(key, entry.getKey()))
{
// Must get the value before we remove it from iterator.
- Object r = entry.getValue();
+ V r = entry.getValue();
entries.remove();
return r;
}
@@ -469,11 +510,11 @@ public abstract class AbstractMap implements Map
*/
public String toString()
{
- Iterator entries = entrySet().iterator();
+ Iterator<Map.Entry<K, V>> entries = entrySet().iterator();
StringBuffer r = new StringBuffer("{");
for (int pos = size(); pos > 0; pos--)
{
- Map.Entry entry = (Map.Entry) entries.next();
+ Map.Entry<K, V> entry = entries.next();
r.append(entry.getKey());
r.append('=');
r.append(entry.getValue());
@@ -504,18 +545,18 @@ public abstract class AbstractMap implements Map
* @see #containsValue(Object)
* @see #keySet()
*/
- public Collection values()
+ public Collection<V> values()
{
if (values == null)
- values = new AbstractCollection()
+ values = new AbstractCollection<V>()
{
- /**
+ /**
* Returns the number of values stored in
* the backing map.
*
* @return The number of values.
*/
- public int size()
+ public int size()
{
return AbstractMap.this.size();
}
@@ -539,46 +580,47 @@ public abstract class AbstractMap implements Map
*
* @return An iterator over the values.
*/
- public Iterator iterator()
+ public Iterator<V> iterator()
{
- return new Iterator()
+ return new Iterator<V>()
{
/**
* The iterator returned by <code>entrySet()</code>.
*/
- private final Iterator map_iterator = entrySet().iterator();
-
- /**
- * Returns true if a call to <code>next()</call> will
- * return another value.
- *
- * @return True if the iterator has not yet reached
- * the last value.
- */
+ private final Iterator<Map.Entry<K, V>> map_iterator
+ = entrySet().iterator();
+
+ /**
+ * Returns true if a call to <code>next()</call> will
+ * return another value.
+ *
+ * @return True if the iterator has not yet reached
+ * the last value.
+ */
public boolean hasNext()
{
return map_iterator.hasNext();
}
- /**
- * Returns the value from the next entry retrieved
- * by the underlying <code>entrySet()</code> iterator.
- *
- * @return The next value.
- */
- public Object next()
+ /**
+ * Returns the value from the next entry retrieved
+ * by the underlying <code>entrySet()</code> iterator.
+ *
+ * @return The next value.
+ */
+ public V next()
{
- return ((Map.Entry) map_iterator.next()).getValue();
+ return map_iterator.next().getValue();
}
- /**
- * Removes the map entry which has a key equal
- * to that returned by the last call to
- * <code>next()</code>.
- *
- * @throws UnsupportedOperationException if the
- * map doesn't support removal.
- */
+ /**
+ * Removes the map entry which has a key equal
+ * to that returned by the last call to
+ * <code>next()</code>.
+ *
+ * @throws UnsupportedOperationException if the
+ * map doesn't support removal.
+ */
public void remove()
{
map_iterator.remove();
@@ -623,31 +665,36 @@ public abstract class AbstractMap implements Map
*
* @author Jon Zeppieri
* @author Eric Blake (ebb9@email.byu.edu)
+ *
+ * @since 1.6
*/
- // XXX - FIXME Use fully qualified implements as gcj 3.1 workaround.
- // Bug still exists in 3.4.1
- static class BasicMapEntry implements Map.Entry
+ public static class SimpleEntry<K, V> implements Entry<K, V>, Serializable
{
/**
* The key. Package visible for direct manipulation.
*/
- Object key;
+ K key;
/**
* The value. Package visible for direct manipulation.
*/
- Object value;
+ V value;
/**
* Basic constructor initializes the fields.
* @param newKey the key
* @param newValue the value
*/
- BasicMapEntry(Object newKey, Object newValue)
+ public SimpleEntry(K newKey, V newValue)
{
key = newKey;
value = newValue;
}
+
+ public SimpleEntry(Entry<? extends K, ? extends V> entry)
+ {
+ this(entry.getKey(), entry.getValue());
+ }
/**
* Compares the specified object with this entry. Returns true only if
@@ -662,14 +709,14 @@ public abstract class AbstractMap implements Map
* @param o the object to compare
* @return <code>true</code> if it is equal
*/
- public final boolean equals(Object o)
+ public boolean equals(Object o)
{
if (! (o instanceof Map.Entry))
return false;
// Optimize for our own entries.
- if (o instanceof BasicMapEntry)
+ if (o instanceof SimpleEntry)
{
- BasicMapEntry e = (BasicMapEntry) o;
+ SimpleEntry e = (SimpleEntry) o;
return (AbstractMap.equals(key, e.key)
&& AbstractMap.equals(value, e.value));
}
@@ -683,7 +730,7 @@ public abstract class AbstractMap implements Map
*
* @return the key
*/
- public final Object getKey()
+ public final K getKey()
{
return key;
}
@@ -694,7 +741,7 @@ public abstract class AbstractMap implements Map
*
* @return the value
*/
- public final Object getValue()
+ public final V getValue()
{
return value;
}
@@ -728,9 +775,9 @@ public abstract class AbstractMap implements Map
* @throws IllegalArgumentException if something else about this
* value prevents it being stored in the map.
*/
- public Object setValue(Object newVal)
+ public V setValue(V newVal)
{
- Object r = value;
+ V r = value;
value = newVal;
return r;
}
@@ -745,5 +792,7 @@ public abstract class AbstractMap implements Map
{
return key + "=" + value;
}
- } // class BasicMapEntry
+ } // class SimpleEntry
+
+
}
diff --git a/libjava/classpath/java/util/AbstractSequentialList.java b/libjava/classpath/java/util/AbstractSequentialList.java
index 79583228d96..81b0714e1ba 100644
--- a/libjava/classpath/java/util/AbstractSequentialList.java
+++ b/libjava/classpath/java/util/AbstractSequentialList.java
@@ -1,5 +1,5 @@
/* AbstractSequentialList.java -- List implementation for sequential access
- Copyright (C) 1998, 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -71,7 +71,7 @@ package java.util;
* @since 1.2
* @status updated to 1.4
*/
-public abstract class AbstractSequentialList extends AbstractList
+public abstract class AbstractSequentialList<E> extends AbstractList<E>
{
/**
* The main constructor, for use by subclasses.
@@ -88,7 +88,7 @@ public abstract class AbstractSequentialList extends AbstractList
* @return the list iterator
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
*/
- public abstract ListIterator listIterator(int index);
+ public abstract ListIterator<E> listIterator(int index);
/**
* Insert an element into the list at a given position (optional operation).
@@ -109,7 +109,7 @@ public abstract class AbstractSequentialList extends AbstractList
* @throws NullPointerException if o is null and the list does not permit
* the addition of null values.
*/
- public void add(int index, Object o)
+ public void add(int index, E o)
{
listIterator(index).add(o);
}
@@ -143,11 +143,11 @@ public abstract class AbstractSequentialList extends AbstractList
* does not permit the addition of null values.
* @see #add(int, Object)
*/
- public boolean addAll(int index, Collection c)
+ public boolean addAll(int index, Collection<? extends E> c)
{
- Iterator ci = c.iterator();
+ Iterator<? extends E> ci = c.iterator();
int size = c.size();
- ListIterator i = listIterator(index);
+ ListIterator<E> i = listIterator(index);
for (int pos = size; pos > 0; pos--)
i.add(ci.next());
return size > 0;
@@ -161,7 +161,7 @@ public abstract class AbstractSequentialList extends AbstractList
* @return the element at index index in this list
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
- public Object get(int index)
+ public E get(int index)
{
// This is a legal listIterator position, but an illegal get.
if (index == size())
@@ -176,7 +176,7 @@ public abstract class AbstractSequentialList extends AbstractList
*
* @return an Iterator over the elements of this list, in order
*/
- public Iterator iterator()
+ public Iterator<E> iterator()
{
return listIterator();
}
@@ -192,14 +192,14 @@ public abstract class AbstractSequentialList extends AbstractList
* remove operation
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
- public Object remove(int index)
+ public E remove(int index)
{
// This is a legal listIterator position, but an illegal remove.
if (index == size())
throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
+ size());
- ListIterator i = listIterator(index);
- Object removed = i.next();
+ ListIterator<E> i = listIterator(index);
+ E removed = i.next();
i.remove();
return removed;
}
@@ -221,14 +221,14 @@ public abstract class AbstractSequentialList extends AbstractList
* @throws NullPointerException if o is null and the list does not allow
* a value to be set to null.
*/
- public Object set(int index, Object o)
+ public E set(int index, E o)
{
// This is a legal listIterator position, but an illegal set.
if (index == size())
throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
+ size());
- ListIterator i = listIterator(index);
- Object old = i.next();
+ ListIterator<E> i = listIterator(index);
+ E old = i.next();
i.set(o);
return old;
}
diff --git a/libjava/classpath/java/util/AbstractSet.java b/libjava/classpath/java/util/AbstractSet.java
index f0d7cb19908..423ac8083a6 100644
--- a/libjava/classpath/java/util/AbstractSet.java
+++ b/libjava/classpath/java/util/AbstractSet.java
@@ -1,5 +1,6 @@
/* AbstractSet.java -- Abstract implementation of most of Set
- Copyright (C) 1998, 2000, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2001, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -58,7 +59,9 @@ package java.util;
* @since 1.2
* @status updated to 1.4
*/
-public abstract class AbstractSet extends AbstractCollection implements Set
+public abstract class AbstractSet<E>
+ extends AbstractCollection<E>
+ implements Set<E>
{
/**
* The main constructor, for use by subclasses.
@@ -79,9 +82,9 @@ public abstract class AbstractSet extends AbstractCollection implements Set
*/
public boolean equals(Object o)
{
- return (o == this ||
- (o instanceof Set && ((Set) o).size() == size()
- && containsAll((Collection) o)));
+ return (o == this
+ || (o instanceof Set && ((Set) o).size() == size()
+ && containsAll((Collection) o)));
}
/**
@@ -94,7 +97,7 @@ public abstract class AbstractSet extends AbstractCollection implements Set
*/
public int hashCode()
{
- Iterator itr = iterator();
+ Iterator<E> itr = iterator();
int hash = 0;
int pos = size();
while (--pos >= 0)
@@ -119,21 +122,25 @@ public abstract class AbstractSet extends AbstractCollection implements Set
* @see Collection#contains(Object)
* @see Iterator#remove()
*/
- public boolean removeAll(Collection c)
+ public boolean removeAll(Collection<?> c)
{
int oldsize = size();
int count = c.size();
- Iterator i;
if (oldsize < count)
{
+ Iterator<E> i;
for (i = iterator(), count = oldsize; count > 0; count--)
- if (c.contains(i.next()))
- i.remove();
+ {
+ if (c.contains(i.next()))
+ i.remove();
+ }
}
else
- for (i = c.iterator(); count > 0; count--)
- remove(i.next());
+ {
+ Iterator<?> i;
+ for (i = c.iterator(); count > 0; count--)
+ remove(i.next());
+ }
return oldsize != size();
}
-
}
diff --git a/libjava/classpath/java/util/ArrayList.java b/libjava/classpath/java/util/ArrayList.java
index 50b5638ede0..0693049b53a 100644
--- a/libjava/classpath/java/util/ArrayList.java
+++ b/libjava/classpath/java/util/ArrayList.java
@@ -81,8 +81,8 @@ import java.lang.reflect.Array;
* @see AbstractList
* @status updated to 1.4
*/
-public class ArrayList extends AbstractList
- implements List, RandomAccess, Cloneable, Serializable
+public class ArrayList<E> extends AbstractList<E>
+ implements List<E>, RandomAccess, Cloneable, Serializable
{
/**
* Compatible with JDK 1.2
@@ -103,7 +103,7 @@ public class ArrayList extends AbstractList
/**
* Where the data is stored.
*/
- private transient Object[] data;
+ private transient E[] data;
/**
* Construct a new ArrayList with the supplied initial capacity.
@@ -116,7 +116,7 @@ public class ArrayList extends AbstractList
// Must explicitly check, to get correct exception.
if (capacity < 0)
throw new IllegalArgumentException();
- data = new Object[capacity];
+ data = (E[]) new Object[capacity];
}
/**
@@ -135,7 +135,7 @@ public class ArrayList extends AbstractList
* @param c the collection whose elements will initialize this list
* @throws NullPointerException if c is null
*/
- public ArrayList(Collection c)
+ public ArrayList(Collection<? extends E> c)
{
this((int) (c.size() * 1.1f));
addAll(c);
@@ -151,7 +151,7 @@ public class ArrayList extends AbstractList
// so don't update modCount.
if (size != data.length)
{
- Object[] newData = new Object[size];
+ E[] newData = (E[]) new Object[size];
System.arraycopy(data, 0, newData, 0, size);
data = newData;
}
@@ -173,7 +173,7 @@ public class ArrayList extends AbstractList
if (minCapacity > current)
{
- Object[] newData = new Object[Math.max(current * 2, minCapacity)];
+ E[] newData = (E[]) new Object[Math.max(current * 2, minCapacity)];
System.arraycopy(data, 0, newData, 0, size);
data = newData;
}
@@ -247,11 +247,11 @@ public class ArrayList extends AbstractList
*/
public Object clone()
{
- ArrayList clone = null;
+ ArrayList<E> clone = null;
try
{
- clone = (ArrayList) super.clone();
- clone.data = (Object[]) data.clone();
+ clone = (ArrayList<E>) super.clone();
+ clone.data = (E[]) data.clone();
}
catch (CloneNotSupportedException e)
{
@@ -268,7 +268,7 @@ public class ArrayList extends AbstractList
*/
public Object[] toArray()
{
- Object[] array = new Object[size];
+ E[] array = (E[]) new Object[size];
System.arraycopy(data, 0, array, 0, size);
return array;
}
@@ -287,11 +287,10 @@ public class ArrayList extends AbstractList
* an element in this list
* @throws NullPointerException if a is null
*/
- public Object[] toArray(Object[] a)
+ public <T> T[] toArray(T[] a)
{
if (a.length < size)
- a = (Object[]) Array.newInstance(a.getClass().getComponentType(),
- size);
+ a = (T[]) Array.newInstance(a.getClass().getComponentType(), size);
else if (a.length > size)
a[size] = null;
System.arraycopy(data, 0, a, 0, size);
@@ -304,7 +303,7 @@ public class ArrayList extends AbstractList
* @param index the index of the element we are fetching
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
- public Object get(int index)
+ public E get(int index)
{
checkBoundExclusive(index);
return data[index];
@@ -319,10 +318,10 @@ public class ArrayList extends AbstractList
* @return the element previously at the specified index
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= 0
*/
- public Object set(int index, Object e)
+ public E set(int index, E e)
{
checkBoundExclusive(index);
- Object result = data[index];
+ E result = data[index];
data[index] = e;
return result;
}
@@ -334,7 +333,7 @@ public class ArrayList extends AbstractList
* @param e the element to be appended to this list
* @return true, the add will always succeed
*/
- public boolean add(Object e)
+ public boolean add(E e)
{
modCount++;
if (size == data.length)
@@ -352,7 +351,7 @@ public class ArrayList extends AbstractList
* @param e the item being added
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
*/
- public void add(int index, Object e)
+ public void add(int index, E e)
{
checkBoundInclusive(index);
modCount++;
@@ -371,10 +370,10 @@ public class ArrayList extends AbstractList
* @return the removed Object
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
- public Object remove(int index)
+ public E remove(int index)
{
checkBoundExclusive(index);
- Object r = data[index];
+ E r = data[index];
modCount++;
if (index != --size)
System.arraycopy(data, index + 1, data, index, size - index);
@@ -407,7 +406,7 @@ public class ArrayList extends AbstractList
* @return true if the list was modified, in other words c is not empty
* @throws NullPointerException if c is null
*/
- public boolean addAll(Collection c)
+ public boolean addAll(Collection<? extends E> c)
{
return addAll(size, c);
}
@@ -422,10 +421,10 @@ public class ArrayList extends AbstractList
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; 0
* @throws NullPointerException if c is null
*/
- public boolean addAll(int index, Collection c)
+ public boolean addAll(int index, Collection<? extends E> c)
{
checkBoundInclusive(index);
- Iterator itr = c.iterator();
+ Iterator<? extends E> itr = c.iterator();
int csize = c.size();
modCount++;
@@ -502,7 +501,7 @@ public class ArrayList extends AbstractList
* @return true if this list changed
* @throws NullPointerException if c is null
*/
- boolean removeAllInternal(Collection c)
+ boolean removeAllInternal(Collection<?> c)
{
int i;
int j;
@@ -530,7 +529,7 @@ public class ArrayList extends AbstractList
* @throws NullPointerException if c is null
* @since 1.2
*/
- boolean retainAllInternal(Collection c)
+ boolean retainAllInternal(Collection<?> c)
{
int i;
int j;
@@ -584,8 +583,8 @@ public class ArrayList extends AbstractList
// the `size' field.
s.defaultReadObject();
int capacity = s.readInt();
- data = new Object[capacity];
+ data = (E[]) new Object[capacity];
for (int i = 0; i < size; i++)
- data[i] = s.readObject();
+ data[i] = (E) s.readObject();
}
}
diff --git a/libjava/classpath/java/util/Arrays.java b/libjava/classpath/java/util/Arrays.java
index 1fa59594193..fbbf43f209b 100644
--- a/libjava/classpath/java/util/Arrays.java
+++ b/libjava/classpath/java/util/Arrays.java
@@ -362,7 +362,7 @@ public class Arrays
* @throws NullPointerException if a null element is compared with natural
* ordering (only possible when c is null)
*/
- public static int binarySearch(Object[] a, Object key, Comparator c)
+ public static <T> int binarySearch(T[] a, T key, Comparator<? super T> c)
{
int low = 0;
int hi = a.length - 1;
@@ -2163,7 +2163,7 @@ public class Arrays
* @throws NullPointerException if a null element is compared with natural
* ordering (only possible when c is null)
*/
- public static void sort(Object[] a, Comparator c)
+ public static <T> void sort(T[] a, Comparator<? super T> c)
{
sort(a, 0, a.length, c);
}
@@ -2213,7 +2213,8 @@ public class Arrays
* @throws NullPointerException if a null element is compared with natural
* ordering (only possible when c is null)
*/
- public static void sort(Object[] a, int fromIndex, int toIndex, Comparator c)
+ public static <T> void sort(T[] a, int fromIndex, int toIndex,
+ Comparator<? super T> c)
{
if (fromIndex > toIndex)
throw new IllegalArgumentException("fromIndex " + fromIndex
@@ -2235,7 +2236,7 @@ public class Arrays
{
// not already sorted
int j = i;
- Object elem = a[j];
+ T elem = a[j];
do
{
a[j] = a[j - 1];
@@ -2253,9 +2254,9 @@ public class Arrays
if (len <= 6)
return;
- Object[] src = a;
- Object[] dest = new Object[len];
- Object[] t = null; // t is used for swapping src and dest
+ T[] src = a;
+ T[] dest = (T[]) new Object[len];
+ T[] t = null; // t is used for swapping src and dest
// The difference of the fromIndex of the src and dest array.
int srcDestDiff = -fromIndex;
@@ -2349,7 +2350,7 @@ public class Arrays
* @see RandomAccess
* @see Arrays.ArrayList
*/
- public static List asList(final Object[] a)
+ public static <T> List<T> asList(final T... a)
{
return new Arrays.ArrayList(a);
}
@@ -2546,11 +2547,10 @@ public class Arrays
}
/**
- * Returns the hashcode of an array of integer numbers. If two arrays
+ * Returns the hashcode of an array of objects. If two arrays
* are equal, according to <code>equals()</code>, they should have the
* same hashcode. The hashcode returned by the method is equal to that
- * obtained by the corresponding <code>List</code> object. This has the same
- * data, but represents ints in their wrapper class, <code>Integer</code>.
+ * obtained by the corresponding <code>List</code> object.
* For <code>null</code>, 0 is returned.
*
* @param v an array of integer numbers for which the hash code should be
@@ -2571,7 +2571,6 @@ public class Arrays
return result;
}
- /** @since 1.5 */
public static int deepHashCode(Object[] v)
{
if (v == null)
@@ -2914,7 +2913,7 @@ public class Arrays
* @author Eric Blake (ebb9@email.byu.edu)
* @status updated to 1.4
*/
- private static final class ArrayList extends AbstractList
+ private static final class ArrayList<E> extends AbstractList<E>
implements Serializable, RandomAccess
{
// We override the necessary methods, plus others which will be much
@@ -2929,14 +2928,14 @@ public class Arrays
* The array we are viewing.
* @serial the array
*/
- private final Object[] a;
+ private final E[] a;
/**
* Construct a list view of the array.
* @param a the array to view
* @throws NullPointerException if a is null
*/
- ArrayList(Object[] a)
+ ArrayList(E[] a)
{
// We have to explicitly check.
if (a == null)
@@ -2951,7 +2950,7 @@ public class Arrays
* @param index The index to retrieve an object from.
* @return The object at the array index specified.
*/
- public Object get(int index)
+ public E get(int index)
{
return a[index];
}
@@ -2974,9 +2973,9 @@ public class Arrays
* @param element The new object.
* @return The object replaced by this operation.
*/
- public Object set(int index, Object element)
+ public E set(int index, E element)
{
- Object old = a[index];
+ E old = a[index];
a[index] = element;
return old;
}
@@ -3047,12 +3046,12 @@ public class Arrays
* @return The array containing the objects in this list,
* which may or may not be == to array.
*/
- public Object[] toArray(Object[] array)
+ public <T> T[] toArray(T[] array)
{
int size = a.length;
if (array.length < size)
- array = (Object[])
- Array.newInstance(array.getClass().getComponentType(), size);
+ array = (T[]) Array.newInstance(array.getClass().getComponentType(),
+ size);
else if (array.length > size)
array[size] = null;
diff --git a/libjava/classpath/java/util/BitSet.java b/libjava/classpath/java/util/BitSet.java
index f1b5aaa06ee..e4f923b7f22 100644
--- a/libjava/classpath/java/util/BitSet.java
+++ b/libjava/classpath/java/util/BitSet.java
@@ -741,4 +741,15 @@ public class BitSet implements Cloneable, Serializable
bits = nd;
}
}
+
+ // This is used by EnumSet for efficiency.
+ final boolean containsAll(BitSet other)
+ {
+ for (int i = other.bits.length - 1; i >= 0; i--)
+ {
+ if ((bits[i] & other.bits[i]) != other.bits[i])
+ return false;
+ }
+ return true;
+ }
}
diff --git a/libjava/classpath/java/util/Calendar.java b/libjava/classpath/java/util/Calendar.java
index d4bbcd08e76..8c46c01936c 100644
--- a/libjava/classpath/java/util/Calendar.java
+++ b/libjava/classpath/java/util/Calendar.java
@@ -1,5 +1,6 @@
/* Calendar.java --
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006,
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -103,7 +104,8 @@ day_of_week + week_of_year</pre>
* @see TimeZone
* @see java.text.DateFormat
*/
-public abstract class Calendar implements Serializable, Cloneable
+public abstract class Calendar
+ implements Serializable, Cloneable, Comparable<Calendar>
{
/**
* Constant representing the era time field.
@@ -483,6 +485,8 @@ public abstract class Calendar implements Serializable, Cloneable
/**
* Creates a calendar representing the actual time, using the default
* time zone and locale.
+ *
+ * @return The new calendar.
*/
public static synchronized Calendar getInstance()
{
@@ -492,7 +496,12 @@ public abstract class Calendar implements Serializable, Cloneable
/**
* Creates a calendar representing the actual time, using the given
* time zone and the default locale.
- * @param zone a time zone.
+ *
+ * @param zone a time zone (<code>null</code> not permitted).
+ *
+ * @return The new calendar.
+ *
+ * @throws NullPointerException if <code>zone</code> is <code>null</code>.
*/
public static synchronized Calendar getInstance(TimeZone zone)
{
@@ -502,7 +511,12 @@ public abstract class Calendar implements Serializable, Cloneable
/**
* Creates a calendar representing the actual time, using the default
* time zone and the given locale.
- * @param locale a locale.
+ *
+ * @param locale a locale (<code>null</code> not permitted).
+ *
+ * @return The new calendar.
+ *
+ * @throws NullPointerException if <code>locale</code> is <code>null</code>.
*/
public static synchronized Calendar getInstance(Locale locale)
{
@@ -524,8 +538,14 @@ public abstract class Calendar implements Serializable, Cloneable
/**
* Creates a calendar representing the actual time, using the given
* time zone and locale.
- * @param zone a time zone.
- * @param locale a locale.
+ *
+ * @param zone a time zone (<code>null</code> not permitted).
+ * @param locale a locale (<code>null</code> not permitted).
+ *
+ * @return The new calendar.
+ *
+ * @throws NullPointerException if <code>zone</code> or <code>locale</code>
+ * is <code>null</code>.
*/
public static synchronized Calendar getInstance(TimeZone zone, Locale locale)
{
@@ -617,6 +637,10 @@ public abstract class Calendar implements Serializable, Cloneable
/**
* Sets this Calendar's time to the given Date. All time fields
* are invalidated by this method.
+ *
+ * @param date the date (<code>null</code> not permitted).
+ *
+ * @throws NullPointerException if <code>date</code> is <code>null</code>.
*/
public final void setTime(Date date)
{
@@ -1196,6 +1220,31 @@ public abstract class Calendar implements Serializable, Cloneable
}
/**
+ * Compares the time of two calendar instances.
+ * @param calendar the calendar to which the time should be compared.
+ * @return 0 if the two calendars are set to the same time,
+ * less than 0 if the time of this calendar is before that of
+ * <code>cal</code>, or more than 0 if the time of this calendar is after
+ * that of <code>cal</code>.
+ *
+ * @param cal the calendar to compare this instance with.
+ * @throws NullPointerException if <code>cal</code> is null.
+ * @throws IllegalArgumentException if either calendar has fields set to
+ * invalid values.
+ * @since 1.5
+ */
+ public int compareTo(Calendar cal)
+ {
+ long t1 = getTimeInMillis();
+ long t2 = cal.getTimeInMillis();
+ if(t1 == t2)
+ return 0;
+ if(t1 > t2)
+ return 1;
+ return -1;
+ }
+
+ /**
* Return a clone of this object.
*/
public Object clone()
diff --git a/libjava/classpath/java/util/Collection.java b/libjava/classpath/java/util/Collection.java
index f7db708c16d..b57566f7032 100644
--- a/libjava/classpath/java/util/Collection.java
+++ b/libjava/classpath/java/util/Collection.java
@@ -1,5 +1,5 @@
/* Collection.java -- Interface that represents a collection of objects
- Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -67,6 +67,8 @@ package java.util;
*
* @author Original author unknown
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @see List
* @see Set
* @see Map
@@ -81,9 +83,9 @@ package java.util;
* @see Arrays
* @see AbstractCollection
* @since 1.2
- * @status updated to 1.5 (minus generics)
+ * @status updated to 1.4
*/
-public interface Collection extends Iterable
+public interface Collection<E> extends Iterable<E>
{
/**
* Add an element to this collection.
@@ -99,7 +101,7 @@ public interface Collection extends Iterable
* @throws IllegalArgumentException if o cannot be added to this
* collection for some other reason.
*/
- boolean add(Object o);
+ boolean add(E o);
/**
* Add the contents of a given collection to this collection.
@@ -116,7 +118,7 @@ public interface Collection extends Iterable
* @throws IllegalArgumentException if some element of c cannot be added
* to this collection for some other reason.
*/
- boolean addAll(Collection c);
+ boolean addAll(Collection<? extends E> c);
/**
* Clear the collection, such that a subsequent call to isEmpty() would
@@ -152,7 +154,7 @@ public interface Collection extends Iterable
* collection does not support null values.
* @throws NullPointerException if c itself is null.
*/
- boolean containsAll(Collection c);
+ boolean containsAll(Collection<?> c);
/**
* Test whether this collection is equal to some object. The Collection
@@ -200,7 +202,7 @@ public interface Collection extends Iterable
*
* @return an Iterator over the elements of this collection, in any order.
*/
- Iterator iterator();
+ Iterator<E> iterator();
/**
* Remove a single occurrence of an object from this collection. That is,
@@ -233,7 +235,7 @@ public interface Collection extends Iterable
* collection does not support removing null values.
* @throws NullPointerException if c itself is null.
*/
- boolean removeAll(Collection c);
+ boolean removeAll(Collection<?> c);
/**
* Remove all elements of this collection that are not contained in a given
@@ -249,7 +251,7 @@ public interface Collection extends Iterable
* collection does not support retaining null values.
* @throws NullPointerException if c itself is null.
*/
- boolean retainAll(Collection c);
+ boolean retainAll(Collection<?> c);
/**
* Get the number of elements in this collection.
@@ -284,5 +286,5 @@ public interface Collection extends Iterable
* @throws ArrayStoreException if the type of any element of the
* collection is not a subtype of the element type of a.
*/
- Object[] toArray(Object[] a);
+ <T> T[] toArray(T[] a);
}
diff --git a/libjava/classpath/java/util/Collections.java b/libjava/classpath/java/util/Collections.java
index a2538cf1db8..c15fa092bb2 100644
--- a/libjava/classpath/java/util/Collections.java
+++ b/libjava/classpath/java/util/Collections.java
@@ -62,13 +62,15 @@ import java.io.Serializable;
*
* @author Original author unknown
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @see Collection
* @see Set
* @see List
* @see Map
* @see Arrays
* @since 1.2
- * @status updated to 1.4
+ * @status updated to 1.5
*/
public class Collections
{
@@ -90,7 +92,7 @@ public class Collections
* @param l the list to check
* @return <code>true</code> if it should be treated as sequential-access
*/
- private static boolean isSequential(List l)
+ private static boolean isSequential(List<?> l)
{
return ! (l instanceof RandomAccess) && l.size() > LARGE_LIST_SIZE;
}
@@ -109,12 +111,26 @@ public class Collections
public static final Set EMPTY_SET = new EmptySet();
/**
+ * Returns an immutable, serializable parameterized empty set.
+ * Unlike the constant <code>EMPTY_SET</code>, the set returned by
+ * this method is type-safe.
+ *
+ * @return an empty parameterized set.
+ * @since 1.5
+ */
+ public static final <T> Set<T> emptySet()
+ {
+ /* FIXME: Could this be optimized? */
+ return new EmptySet<T>();
+ }
+
+ /**
* The implementation of {@link #EMPTY_SET}. This class name is required
* for compatibility with Sun's JDK serializability.
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class EmptySet extends AbstractSet
+ private static final class EmptySet<T> extends AbstractSet<T>
implements Serializable
{
/**
@@ -143,9 +159,9 @@ public class Collections
* @return A non-iterating iterator.
*/
// This is really cheating! I think it's perfectly valid, though.
- public Iterator iterator()
+ public Iterator<T> iterator()
{
- return EMPTY_LIST.iterator();
+ return (Iterator<T>) EMPTY_LIST.iterator();
}
// The remaining methods are optional, but provide a performance
@@ -166,7 +182,7 @@ public class Collections
* against the members of this set.
* @return <code>true</code> if c is empty.
*/
- public boolean containsAll(Collection c)
+ public boolean containsAll(Collection<?> c)
{
return c.isEmpty();
}
@@ -206,7 +222,7 @@ public class Collections
* all be removed from this set.
* @return <code>false</code>.
*/
- public boolean removeAll(Collection c)
+ public boolean removeAll(Collection<?> c)
{
return false;
}
@@ -217,7 +233,7 @@ public class Collections
* all be retained within this set.
* @return <code>false</code>.
*/
- public boolean retainAll(Collection c)
+ public boolean retainAll(Collection<?> c)
{
return false;
}
@@ -237,7 +253,7 @@ public class Collections
* @return The original array with any existing
* initial element set to null.
*/
- public Object[] toArray(Object[] a)
+ public <E> E[] toArray(E[] a)
{
if (a.length > 0)
a[0] = null;
@@ -263,12 +279,26 @@ public class Collections
public static final List EMPTY_LIST = new EmptyList();
/**
+ * Returns an immutable, serializable parameterized empty list.
+ * Unlike the constant <code>EMPTY_LIST</code>, the list returned by
+ * this method is type-safe.
+ *
+ * @return an empty parameterized list.
+ * @since 1.5
+ */
+ public static final <T> List<T> emptyList()
+ {
+ /* FIXME: Could this be optimized? */
+ return new EmptyList<T>();
+ }
+
+ /**
* The implementation of {@link #EMPTY_LIST}. This class name is required
* for compatibility with Sun's JDK serializability.
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class EmptyList extends AbstractList
+ private static final class EmptyList<T> extends AbstractList<T>
implements Serializable, RandomAccess
{
/**
@@ -301,7 +331,7 @@ public class Collections
* @throws IndexOutOfBoundsException as any given index
* is outside the bounds of an empty array.
*/
- public Object get(int index)
+ public T get(int index)
{
throw new IndexOutOfBoundsException();
}
@@ -324,7 +354,7 @@ public class Collections
* against the members of this list.
* @return <code>true</code> if c is also empty.
*/
- public boolean containsAll(Collection c)
+ public boolean containsAll(Collection<?> c)
{
return c.isEmpty();
}
@@ -385,7 +415,7 @@ public class Collections
* all be removed from this list.
* @return <code>false</code>.
*/
- public boolean removeAll(Collection c)
+ public boolean removeAll(Collection<?> c)
{
return false;
}
@@ -396,7 +426,7 @@ public class Collections
* all be retained within this list.
* @return <code>false</code>.
*/
- public boolean retainAll(Collection c)
+ public boolean retainAll(Collection<?> c)
{
return false;
}
@@ -416,7 +446,7 @@ public class Collections
* @return The original array with any existing
* initial element set to null.
*/
- public Object[] toArray(Object[] a)
+ public <E> E[] toArray(E[] a)
{
if (a.length > 0)
a[0] = null;
@@ -441,12 +471,26 @@ public class Collections
public static final Map EMPTY_MAP = new EmptyMap();
/**
+ * Returns an immutable, serializable parameterized empty map.
+ * Unlike the constant <code>EMPTY_MAP</code>, the map returned by
+ * this method is type-safe.
+ *
+ * @return an empty parameterized map.
+ * @since 1.5
+ */
+ public static final <K,V> Map<K,V> emptyMap()
+ {
+ /* FIXME: Could this be optimized? */
+ return new EmptyMap<K,V>();
+ }
+
+ /**
* The implementation of {@link #EMPTY_MAP}. This class name is required
* for compatibility with Sun's JDK serializability.
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class EmptyMap extends AbstractMap
+ private static final class EmptyMap<K, V> extends AbstractMap<K, V>
implements Serializable
{
/**
@@ -465,7 +509,7 @@ public class Collections
* There are no entries.
* @return The empty set.
*/
- public Set entrySet()
+ public Set<Map.Entry<K, V>> entrySet()
{
return EMPTY_SET;
}
@@ -508,7 +552,7 @@ public class Collections
* @param o The key of the object to retrieve.
* @return null.
*/
- public Object get(Object o)
+ public V get(Object o)
{
return null;
}
@@ -526,7 +570,7 @@ public class Collections
* No entries.
* @return The empty set.
*/
- public Set keySet()
+ public Set<K> keySet()
{
return EMPTY_SET;
}
@@ -536,7 +580,7 @@ public class Collections
* @param o The key of the mapping to remove.
* @return null, as there is never a mapping for o.
*/
- public Object remove(Object o)
+ public V remove(Object o)
{
return null;
}
@@ -555,7 +599,7 @@ public class Collections
* Collection, will work. Besides, that's what the JDK uses!
* @return The empty set.
*/
- public Collection values()
+ public Collection<V> values()
{
return EMPTY_SET;
}
@@ -578,7 +622,7 @@ public class Collections
* clever, but worth it for removing a duplicate of the search code.
* Note: This code is also used in Arrays (for sort as well as search).
*/
- static final int compare(Object o1, Object o2, Comparator c)
+ static final <T> int compare(T o1, T o2, Comparator<? super T> c)
{
return c == null ? ((Comparable) o1).compareTo(o2) : c.compare(o1, o2);
}
@@ -607,7 +651,8 @@ public class Collections
* @throws NullPointerException if a null element has compareTo called
* @see #sort(List)
*/
- public static int binarySearch(List l, Object key)
+ public static <T> int binarySearch(List<? extends Comparable<? super T>> l,
+ T key)
{
return binarySearch(l, key, null);
}
@@ -639,7 +684,8 @@ public class Collections
* ordering (only possible when c is null)
* @see #sort(List, Comparator)
*/
- public static int binarySearch(List l, Object key, Comparator c)
+ public static <T> int binarySearch(List<? extends T> l, T key,
+ Comparator<? super T> c)
{
int pos = 0;
int low = 0;
@@ -649,9 +695,9 @@ public class Collections
// if the list is sequential-access.
if (isSequential(l))
{
- ListIterator itr = l.listIterator();
+ ListIterator<T> itr = ((List<T>) l).listIterator();
int i = 0;
- Object o = itr.next(); // Assumes list is not empty (see isSequential)
+ T o = itr.next(); // Assumes list is not empty (see isSequential)
boolean forward = true;
while (low <= hi)
{
@@ -685,7 +731,7 @@ public class Collections
while (low <= hi)
{
pos = (low + hi) >>> 1;
- final int d = compare(l.get(pos), key, c);
+ final int d = compare(((List<T>) l).get(pos), key, c);
if (d == 0)
return pos;
else if (d > 0)
@@ -712,14 +758,14 @@ public class Collections
* @throws UnsupportedOperationException if dest.listIterator() does not
* support the set operation
*/
- public static void copy(List dest, List source)
+ public static <T> void copy(List<? super T> dest, List<? extends T> source)
{
int pos = source.size();
if (dest.size() < pos)
throw new IndexOutOfBoundsException("Source does not fit in dest");
- Iterator i1 = source.iterator();
- ListIterator i2 = dest.listIterator();
+ Iterator<? extends T> i1 = source.iterator();
+ ListIterator<? super T> i2 = dest.listIterator();
while (--pos >= 0)
{
@@ -735,10 +781,10 @@ public class Collections
* @param c the Collection to iterate over
* @return an Enumeration backed by an Iterator over c
*/
- public static Enumeration enumeration(Collection c)
+ public static <T> Enumeration<T> enumeration(Collection<T> c)
{
- final Iterator i = c.iterator();
- return new Enumeration()
+ final Iterator<T> i = c.iterator();
+ return new Enumeration<T>()
{
/**
* Returns <code>true</code> if there are more elements to
@@ -758,7 +804,7 @@ public class Collections
* @return The result of <code>next()</code>
* called on the underlying iterator.
*/
- public final Object nextElement()
+ public final T nextElement()
{
return i.next();
}
@@ -774,9 +820,9 @@ public class Collections
* @throws UnsupportedOperationException if l.listIterator() does not
* support the set operation.
*/
- public static void fill(List l, Object val)
+ public static <T> void fill(List<? super T> l, T val)
{
- ListIterator itr = l.listIterator();
+ ListIterator<? super T> itr = l.listIterator();
for (int i = l.size() - 1; i >= 0; --i)
{
itr.next();
@@ -797,7 +843,7 @@ public class Collections
* @return the index where found, or -1
* @since 1.4
*/
- public static int indexOfSubList(List source, List target)
+ public static int indexOfSubList(List<?> source, List<?> target)
{
int ssize = source.size();
for (int i = 0, j = target.size(); j <= ssize; i++, j++)
@@ -819,7 +865,7 @@ public class Collections
* @return the index where found, or -1
* @since 1.4
*/
- public static int lastIndexOfSubList(List source, List target)
+ public static int lastIndexOfSubList(List<?> source, List<?> target)
{
int ssize = source.size();
for (int i = ssize - target.size(), j = ssize; i >= 0; i--, j--)
@@ -838,9 +884,9 @@ public class Collections
* @see ArrayList
* @since 1.4
*/
- public static ArrayList list(Enumeration e)
+ public static <T> ArrayList<T> list(Enumeration<T> e)
{
- ArrayList l = new ArrayList();
+ ArrayList<T> l = new ArrayList<T>();
while (e.hasMoreElements())
l.add(e.nextElement());
return l;
@@ -857,7 +903,8 @@ public class Collections
* @exception ClassCastException if elements in c are not mutually comparable
* @exception NullPointerException if null.compareTo is called
*/
- public static Object max(Collection c)
+ public static <T extends Object & Comparable<? super T>>
+ T max(Collection<? extends T> c)
{
return max(c, null);
}
@@ -876,14 +923,15 @@ public class Collections
* @throws NullPointerException if null is compared by natural ordering
* (only possible when order is null)
*/
- public static Object max(Collection c, Comparator order)
+ public static <T> T max(Collection<? extends T> c,
+ Comparator<? super T> order)
{
- Iterator itr = c.iterator();
- Object max = itr.next(); // throws NoSuchElementException
+ Iterator<? extends T> itr = c.iterator();
+ T max = itr.next(); // throws NoSuchElementException
int csize = c.size();
for (int i = 1; i < csize; i++)
{
- Object o = itr.next();
+ T o = itr.next();
if (compare(max, o, order) < 0)
max = o;
}
@@ -901,7 +949,8 @@ public class Collections
* @throws ClassCastException if elements in c are not mutually comparable
* @throws NullPointerException if null.compareTo is called
*/
- public static Object min(Collection c)
+ public static <T extends Object & Comparable<? super T>>
+ T min(Collection<? extends T> c)
{
return min(c, null);
}
@@ -920,14 +969,15 @@ public class Collections
* @throws NullPointerException if null is compared by natural ordering
* (only possible when order is null)
*/
- public static Object min(Collection c, Comparator order)
+ public static <T> T min(Collection<? extends T> c,
+ Comparator<? super T> order)
{
- Iterator itr = c.iterator();
- Object min = itr.next(); // throws NoSuchElementExcception
+ Iterator<? extends T> itr = c.iterator();
+ T min = itr.next(); // throws NoSuchElementExcception
int csize = c.size();
for (int i = 1; i < csize; i++)
{
- Object o = itr.next();
+ T o = itr.next();
if (compare(min, o, order) > 0)
min = o;
}
@@ -949,9 +999,9 @@ public class Collections
* @see Serializable
* @see RandomAccess
*/
- public static List nCopies(final int n, final Object o)
+ public static <T> List<T> nCopies(final int n, final T o)
{
- return new CopiesList(n, o);
+ return new CopiesList<T>(n, o);
}
/**
@@ -960,7 +1010,7 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class CopiesList extends AbstractList
+ private static final class CopiesList<T> extends AbstractList<T>
implements Serializable, RandomAccess
{
/**
@@ -978,7 +1028,7 @@ public class Collections
* The repeated list element.
* @serial the list contents
*/
- private final Object element;
+ private final T element;
/**
* Constructs the list.
@@ -987,7 +1037,7 @@ public class Collections
* @param o the object
* @throws IllegalArgumentException if n &lt; 0
*/
- CopiesList(int n, Object o)
+ CopiesList(int n, T o)
{
if (n < 0)
throw new IllegalArgumentException();
@@ -1010,7 +1060,7 @@ public class Collections
* as the list contains only copies of <code>element</code>).
* @return The element used by this list.
*/
- public Object get(int index)
+ public T get(int index)
{
if (index < 0 || index >= n)
throw new IndexOutOfBoundsException();
@@ -1058,11 +1108,11 @@ public class Collections
* elements, all of which are equal to the element
* used by this list.
*/
- public List subList(int from, int to)
+ public List<T> subList(int from, int to)
{
if (from < 0 || to > n)
throw new IndexOutOfBoundsException();
- return new CopiesList(to - from, element);
+ return new CopiesList<T>(to - from, element);
}
/**
@@ -1108,9 +1158,9 @@ public class Collections
* it being added to the list
* @since 1.4
*/
- public static boolean replaceAll(List list, Object oldval, Object newval)
+ public static <T> boolean replaceAll(List<T> list, T oldval, T newval)
{
- ListIterator itr = list.listIterator();
+ ListIterator<T> itr = list.listIterator();
boolean replace_occured = false;
for (int i = list.size(); --i >= 0; )
if (AbstractCollection.equals(oldval, itr.next()))
@@ -1128,7 +1178,7 @@ public class Collections
* @throws UnsupportedOperationException if l.listIterator() does not
* support the set operation
*/
- public static void reverse(List l)
+ public static void reverse(List<?> l)
{
ListIterator i1 = l.listIterator();
int pos1 = 1;
@@ -1136,15 +1186,43 @@ public class Collections
ListIterator i2 = l.listIterator(pos2);
while (pos1 < pos2)
{
- Object o = i1.next();
- i1.set(i2.previous());
- i2.set(o);
+ Object o1 = i1.next();
+ Object o2 = i2.previous();
+ i1.set(o2);
+ i2.set(o1);
++pos1;
--pos2;
}
}
/**
+ * Get a comparator that implements the reverse of the ordering
+ * specified by the given Comparator. If the Comparator is null,
+ * this is equivalent to {@link #reverseOrder()}. The return value
+ * of this method is Serializable, if the specified Comparator is
+ * either Serializable or null.
+ *
+ * @param c the comparator to invert
+ * @return a comparator that imposes reverse ordering
+ * @see Comparable
+ * @see Serializable
+ *
+ * @since 1.5
+ */
+ public static <T> Comparator<T> reverseOrder(final Comparator<T> c)
+ {
+ if (c == null)
+ return (Comparator<T>) rcInstance;
+ return new ReverseComparator<T> ()
+ {
+ public int compare(T a, T b)
+ {
+ return - c.compare(a, b);
+ }
+ };
+ }
+
+ /**
* Get a comparator that implements the reverse of natural ordering. In
* other words, this sorts Comparable objects opposite of how their
* compareTo method would sort. This makes it easy to sort into reverse
@@ -1155,9 +1233,9 @@ public class Collections
* @see Comparable
* @see Serializable
*/
- public static Comparator reverseOrder()
+ public static <T> Comparator<T> reverseOrder()
{
- return rcInstance;
+ return (Comparator<T>) rcInstance;
}
/**
@@ -1171,8 +1249,8 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class ReverseComparator
- implements Comparator, Serializable
+ private static class ReverseComparator<T>
+ implements Comparator<T>, Serializable
{
/**
* Compatible with JDK 1.4.
@@ -1193,7 +1271,7 @@ public class Collections
* @param b the second object
* @return &lt;, ==, or &gt; 0 according to b.compareTo(a)
*/
- public int compare(Object a, Object b)
+ public int compare(T a, T b)
{
return ((Comparable) b).compareTo(a);
}
@@ -1229,7 +1307,7 @@ public class Collections
* @throws UnsupportedOperationException if the list does not support set
* @since 1.4
*/
- public static void rotate(List list, int distance)
+ public static void rotate(List<?> list, int distance)
{
int size = list.size();
if (size == 0)
@@ -1262,12 +1340,13 @@ public class Collections
// Now, make the swaps. We must take the remainder every time through
// the inner loop so that we don't overflow i to negative values.
+ List<Object> objList = (List<Object>) list;
while (--lcm >= 0)
{
- Object o = list.get(lcm);
+ Object o = objList.get(lcm);
for (int i = lcm + distance; i != lcm; i = (i + distance) % size)
- o = list.set(i, o);
- list.set(lcm, o);
+ o = objList.set(i, o);
+ objList.set(lcm, o);
}
}
}
@@ -1293,15 +1372,15 @@ public class Collections
* @throws UnsupportedOperationException if l.listIterator() does not
* support the set operation
*/
- public static void shuffle(List l)
+ public static void shuffle(List<?> l)
{
if (defaultRandom == null)
{
synchronized (Collections.class)
- {
- if (defaultRandom == null)
- defaultRandom = new Random();
- }
+ {
+ if (defaultRandom == null)
+ defaultRandom = new Random();
+ }
}
shuffle(l, defaultRandom);
}
@@ -1336,15 +1415,16 @@ public class Collections
* @throws UnsupportedOperationException if l.listIterator() does not
* support the set operation
*/
- public static void shuffle(List l, Random r)
+ public static void shuffle(List<?> l, Random r)
{
int lsize = l.size();
- ListIterator i = l.listIterator(lsize);
+ List<Object> list = (List<Object>) l;
+ ListIterator<Object> i = list.listIterator(lsize);
boolean sequential = isSequential(l);
Object[] a = null; // stores a copy of the list for the sequential case
if (sequential)
- a = l.toArray();
+ a = list.toArray();
for (int pos = lsize - 1; pos > 0; --pos)
{
@@ -1360,12 +1440,94 @@ public class Collections
a[swap] = i.previous();
}
else
- o = l.set(swap, i.previous());
+ o = list.set(swap, i.previous());
i.set(o);
}
}
+ /**
+ * Returns the frequency of the specified object within the supplied
+ * collection. The frequency represents the number of occurrences of
+ * elements within the collection which return <code>true</code> when
+ * compared with the object using the <code>equals</code> method.
+ *
+ * @param c the collection to scan for occurrences of the object.
+ * @param o the object to locate occurrances of within the collection.
+ * @throws NullPointerException if the collection is <code>null</code>.
+ * @since 1.5
+ */
+ public static int frequency (Collection<?> c, Object o)
+ {
+ int result = 0;
+ for (Object v : c)
+ {
+ if (AbstractCollection.equals(o, v))
+ ++result;
+ }
+ return result;
+ }
+
+ /**
+ * Adds all the specified elements to the given collection, in a similar
+ * way to the <code>addAll</code> method of the <code>Collection</code>.
+ * However, this is a variable argument method which allows the new elements
+ * to be specified individually or in array form, as opposed to the list
+ * required by the collection's <code>addAll</code> method. This has
+ * benefits in both simplicity (multiple elements can be added without
+ * having to be wrapped inside a grouping structure) and efficiency
+ * (as a redundant list doesn't have to be created to add an individual
+ * set of elements or an array).
+ *
+ * @param c the collection to which the elements should be added.
+ * @param a the elements to be added to the collection.
+ * @return true if the collection changed its contents as a result.
+ * @throws UnsupportedOperationException if the collection does not support
+ * addition.
+ * @throws NullPointerException if one or more elements in a are null,
+ * and the collection does not allow null
+ * elements. This exception is also thrown
+ * if either <code>c</code> or <code>a</code>
+ * are null.
+ * @throws IllegalArgumentException if the collection won't allow an element
+ * to be added for some other reason.
+ * @since 1.5
+ */
+ public static <T> boolean addAll(Collection<? super T> c, T... a)
+ {
+ boolean overall = false;
+
+ for (T element : a)
+ {
+ boolean result = c.add(element);
+ if (result)
+ overall = true;
+ }
+ return overall;
+ }
+
+ /**
+ * Returns true if the two specified collections have no elements in
+ * common. This method may give unusual results if one or both collections
+ * use a non-standard equality test. In the trivial case of comparing
+ * a collection with itself, this method returns true if, and only if,
+ * the collection is empty.
+ *
+ * @param c1 the first collection to compare.
+ * @param c2 the second collection to compare.
+ * @return true if the collections are disjoint.
+ * @throws NullPointerException if either collection is null.
+ * @since 1.5
+ */
+ public static boolean disjoint(Collection<?> c1, Collection<?> c2)
+ {
+ Collection<Object> oc1 = (Collection<Object>) c1;
+ for (Object o : oc1)
+ if (c2.contains(o))
+ return false;
+ return true;
+ }
+
/**
* Obtain an immutable Set consisting of a single element. The return value
@@ -1375,9 +1537,9 @@ public class Collections
* @return an immutable Set containing only o
* @see Serializable
*/
- public static Set singleton(Object o)
+ public static <T> Set<T> singleton(T o)
{
- return new SingletonSet(o);
+ return new SingletonSet<T>(o);
}
/**
@@ -1386,7 +1548,7 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class SingletonSet extends AbstractSet
+ private static final class SingletonSet<T> extends AbstractSet<T>
implements Serializable
{
/**
@@ -1399,13 +1561,13 @@ public class Collections
* The single element; package visible for use in nested class.
* @serial the singleton
*/
- final Object element;
+ final T element;
/**
* Construct a singleton.
* @param o the element
*/
- SingletonSet(Object o)
+ SingletonSet(T o)
{
element = o;
}
@@ -1422,9 +1584,9 @@ public class Collections
/**
* Returns an iterator over the lone element.
*/
- public Iterator iterator()
+ public Iterator<T> iterator()
{
- return new Iterator()
+ return new Iterator<T>()
{
/**
* Flag to indicate whether or not the element has
@@ -1450,7 +1612,7 @@ public class Collections
* @throws NoSuchElementException if the object
* has already been retrieved.
*/
- public Object next()
+ public T next()
{
if (hasNext)
{
@@ -1497,9 +1659,9 @@ public class Collections
* @return <code>true</code> if c only contains either no elements or
* elements equal to the element in this singleton.
*/
- public boolean containsAll(Collection c)
+ public boolean containsAll(Collection<?> c)
{
- Iterator i = c.iterator();
+ Iterator<?> i = c.iterator();
int pos = c.size();
while (--pos >= 0)
if (! equals(i.next(), element))
@@ -1549,9 +1711,9 @@ public class Collections
* @see RandomAccess
* @since 1.3
*/
- public static List singletonList(Object o)
+ public static <T> List<T> singletonList(T o)
{
- return new SingletonList(o);
+ return new SingletonList<T>(o);
}
/**
@@ -1560,7 +1722,7 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class SingletonList extends AbstractList
+ private static final class SingletonList<T> extends AbstractList<T>
implements Serializable, RandomAccess
{
/**
@@ -1572,13 +1734,13 @@ public class Collections
* The single element.
* @serial the singleton
*/
- private final Object element;
+ private final T element;
/**
* Construct a singleton.
* @param o the element
*/
- SingletonList(Object o)
+ SingletonList(T o)
{
element = o;
}
@@ -1601,7 +1763,7 @@ public class Collections
* @throws IndexOutOfBoundsException if
* index is not 0.
*/
- public Object get(int index)
+ public T get(int index)
{
if (index == 0)
return element;
@@ -1628,9 +1790,9 @@ public class Collections
* @return <code>true</code> if c only contains either no elements or
* elements equal to the element in this singleton.
*/
- public boolean containsAll(Collection c)
+ public boolean containsAll(Collection<?> c)
{
- Iterator i = c.iterator();
+ Iterator<?> i = c.iterator();
int pos = c.size();
while (--pos >= 0)
if (! equals(i.next(), element))
@@ -1682,7 +1844,7 @@ public class Collections
* @throws IndexOutOfBoundsException if either bound is greater
* than 1.
*/
- public List subList(int from, int to)
+ public List<T> subList(int from, int to)
{
if (from == to && (to == 0 || to == 1))
return EMPTY_LIST;
@@ -1725,9 +1887,9 @@ public class Collections
* @see Serializable
* @since 1.3
*/
- public static Map singletonMap(Object key, Object value)
+ public static <K, V> Map<K, V> singletonMap(K key, V value)
{
- return new SingletonMap(key, value);
+ return new SingletonMap<K, V>(key, value);
}
/**
@@ -1736,7 +1898,7 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class SingletonMap extends AbstractMap
+ private static final class SingletonMap<K, V> extends AbstractMap<K, V>
implements Serializable
{
/**
@@ -1748,25 +1910,25 @@ public class Collections
* The single key.
* @serial the singleton key
*/
- private final Object k;
+ private final K k;
/**
* The corresponding value.
* @serial the singleton value
*/
- private final Object v;
+ private final V v;
/**
* Cache the entry set.
*/
- private transient Set entries;
+ private transient Set<Map.Entry<K, V>> entries;
/**
* Construct a singleton.
* @param key the key
* @param value the value
*/
- SingletonMap(Object key, Object value)
+ SingletonMap(K key, V value)
{
k = key;
v = value;
@@ -1777,25 +1939,28 @@ public class Collections
*
* @return A singleton containing the map entry.
*/
- public Set entrySet()
+ public Set<Map.Entry<K, V>> entrySet()
{
if (entries == null)
- entries = singleton(new AbstractMap.BasicMapEntry(k, v)
- {
- /**
- * Sets the value of the map entry to the supplied value.
- * An exception is always thrown, as the map is immutable.
- *
- * @param o The new value.
- * @return The old value.
- * @throws UnsupportedOperationException as setting the value
- * is not supported.
- */
- public Object setValue(Object o)
- {
- throw new UnsupportedOperationException();
- }
- });
+ {
+ Map.Entry<K,V> entry = new AbstractMap.SimpleEntry<K, V>(k, v)
+ {
+ /**
+ * Sets the value of the map entry to the supplied value.
+ * An exception is always thrown, as the map is immutable.
+ *
+ * @param o The new value.
+ * @return The old value.
+ * @throws UnsupportedOperationException as setting the value
+ * is not supported.
+ */
+ public V setValue(V o)
+ {
+ throw new UnsupportedOperationException();
+ }
+ };
+ entries = singleton(entry);
+ }
return entries;
}
@@ -1832,7 +1997,7 @@ public class Collections
* @return The singleton value if the key is the same as the
* singleton key, null otherwise.
*/
- public Object get(Object key)
+ public V get(Object key)
{
return equals(key, k) ? v : null;
}
@@ -1853,7 +2018,7 @@ public class Collections
*
* @return A singleton containing the key.
*/
- public Set keySet()
+ public Set<K> keySet()
{
if (keys == null)
keys = singleton(k);
@@ -1876,7 +2041,7 @@ public class Collections
*
* @return A singleton containing the value.
*/
- public Collection values()
+ public Collection<V> values()
{
if (values == null)
values = singleton(v);
@@ -1903,13 +2068,14 @@ public class Collections
* sorts the array, and then iterates over the list setting each element from
* the array.
*
- * @param l the List to sort
+ * @param l the List to sort (<code>null</code> not permitted)
* @throws ClassCastException if some items are not mutually comparable
* @throws UnsupportedOperationException if the List is not modifiable
- * @throws NullPointerException if some element is null
+ * @throws NullPointerException if the list is <code>null</code>, or contains
+ * some element that is <code>null</code>.
* @see Arrays#sort(Object[])
*/
- public static void sort(List l)
+ public static <T extends Comparable<? super T>> void sort(List<T> l)
{
sort(l, null);
}
@@ -1922,24 +2088,26 @@ public class Collections
* sorts the array, and then iterates over the list setting each element from
* the array.
*
- * @param l the List to sort
+ * @param l the List to sort (<code>null</code> not permitted)
* @param c the Comparator specifying the ordering for the elements, or
- * null for natural ordering
+ * <code>null</code> for natural ordering
* @throws ClassCastException if c will not compare some pair of items
* @throws UnsupportedOperationException if the List is not modifiable
- * @throws NullPointerException if null is compared by natural ordering
- * (only possible when c is null)
+ * @throws NullPointerException if the List is <code>null</code> or
+ * <code>null</code> is compared by natural ordering (only possible
+ * when c is <code>null</code>)
+ *
* @see Arrays#sort(Object[], Comparator)
*/
- public static void sort(List l, Comparator c)
+ public static <T> void sort(List<T> l, Comparator<? super T> c)
{
- Object[] a = l.toArray();
+ T[] a = (T[]) l.toArray();
Arrays.sort(a, c);
- ListIterator i = l.listIterator();
+ ListIterator<T> i = l.listIterator();
for (int pos = 0, alen = a.length; pos < alen; pos++)
{
- i.next();
- i.set(a[pos]);
+ i.next();
+ i.set(a[pos]);
}
}
@@ -1955,9 +2123,10 @@ public class Collections
* list.size()
* @since 1.4
*/
- public static void swap(List l, int i, int j)
+ public static void swap(List<?> l, int i, int j)
{
- l.set(i, l.set(j, l.get(i)));
+ List<Object> list = (List<Object>) l;
+ list.set(i, list.set(j, list.get(i)));
}
@@ -1988,9 +2157,9 @@ public class Collections
* @return a synchronized view of the collection
* @see Serializable
*/
- public static Collection synchronizedCollection(Collection c)
+ public static <T> Collection<T> synchronizedCollection(Collection<T> c)
{
- return new SynchronizedCollection(c);
+ return new SynchronizedCollection<T>(c);
}
/**
@@ -2001,8 +2170,8 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- static class SynchronizedCollection
- implements Collection, Serializable
+ static class SynchronizedCollection<T>
+ implements Collection<T>, Serializable
{
/**
* Compatible with JDK 1.4.
@@ -2013,7 +2182,7 @@ public class Collections
* The wrapped collection. Package visible for use by subclasses.
* @serial the real collection
*/
- final Collection c;
+ final Collection<T> c;
/**
* The object to synchronize on. When an instance is created via public
@@ -2028,7 +2197,7 @@ public class Collections
* @param c the collection to wrap
* @throws NullPointerException if c is null
*/
- SynchronizedCollection(Collection c)
+ SynchronizedCollection(Collection<T> c)
{
this.c = c;
mutex = this;
@@ -2042,7 +2211,7 @@ public class Collections
* @param sync the mutex
* @param c the collection
*/
- SynchronizedCollection(Object sync, Collection c)
+ SynchronizedCollection(Object sync, Collection<T> c)
{
this.c = c;
mutex = sync;
@@ -2064,7 +2233,7 @@ public class Collections
* @throws IllegalArgumentException if o cannot be added to this
* collection for some other reason.
*/
- public boolean add(Object o)
+ public boolean add(T o)
{
synchronized (mutex)
{
@@ -2089,7 +2258,7 @@ public class Collections
* @throws IllegalArgumentException if some element of col cannot be added
* to this collection for some other reason.
*/
- public boolean addAll(Collection col)
+ public boolean addAll(Collection<? extends T> col)
{
synchronized (mutex)
{
@@ -2146,7 +2315,7 @@ public class Collections
* collection does not support null values.
* @throws NullPointerException if cl itself is null.
*/
- public boolean containsAll(Collection c1)
+ public boolean containsAll(Collection<?> c1)
{
synchronized (mutex)
{
@@ -2177,11 +2346,11 @@ public class Collections
* @return An iterator over the elements in the underlying collection,
* which returns each element in any order.
*/
- public Iterator iterator()
+ public Iterator<T> iterator()
{
synchronized (mutex)
{
- return new SynchronizedIterator(mutex, c.iterator());
+ return new SynchronizedIterator<T>(mutex, c.iterator());
}
}
@@ -2223,7 +2392,7 @@ public class Collections
* collection does not support removing null values.
* @throws NullPointerException if c itself is null.
*/
- public boolean removeAll(Collection col)
+ public boolean removeAll(Collection<?> col)
{
synchronized (mutex)
{
@@ -2248,7 +2417,7 @@ public class Collections
* collection does not support removing null values.
* @throws NullPointerException if c itself is null.
*/
- public boolean retainAll(Collection col)
+ public boolean retainAll(Collection<?> col)
{
synchronized (mutex)
{
@@ -2304,7 +2473,7 @@ public class Collections
* @throws ArrayStoreException if the type of any element of the
* collection is not a subtype of the element type of a.
*/
- public Object[] toArray(Object[] a)
+ public <T> T[] toArray(T[] a)
{
synchronized (mutex)
{
@@ -2334,7 +2503,7 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static class SynchronizedIterator implements Iterator
+ private static class SynchronizedIterator<T> implements Iterator<T>
{
/**
* The object to synchronize on. Package visible for use by subclass.
@@ -2344,14 +2513,14 @@ public class Collections
/**
* The wrapped iterator.
*/
- private final Iterator i;
+ private final Iterator<T> i;
/**
* Only trusted code creates a wrapper, with the specified sync.
* @param sync the mutex
* @param i the wrapped iterator
*/
- SynchronizedIterator(Object sync, Iterator i)
+ SynchronizedIterator(Object sync, Iterator<T> i)
{
this.i = i;
mutex = sync;
@@ -2364,7 +2533,7 @@ public class Collections
* @return The next object in the collection.
* @throws NoSuchElementException if there are no more elements
*/
- public Object next()
+ public T next()
{
synchronized (mutex)
{
@@ -2438,11 +2607,11 @@ public class Collections
* @see Serializable
* @see RandomAccess
*/
- public static List synchronizedList(List l)
+ public static <T> List<T> synchronizedList(List<T> l)
{
if (l instanceof RandomAccess)
- return new SynchronizedRandomAccessList(l);
- return new SynchronizedList(l);
+ return new SynchronizedRandomAccessList<T>(l);
+ return new SynchronizedList<T>(l);
}
/**
@@ -2453,8 +2622,8 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- static class SynchronizedList extends SynchronizedCollection
- implements List
+ static class SynchronizedList<T> extends SynchronizedCollection<T>
+ implements List<T>
{
/**
* Compatible with JDK 1.4.
@@ -2466,14 +2635,14 @@ public class Collections
* excessive casting. Package visible for use by subclass.
* @serial the wrapped list
*/
- final List list;
+ final List<T> list;
/**
* Wrap a given list.
* @param l the list to wrap
* @throws NullPointerException if l is null
*/
- SynchronizedList(List l)
+ SynchronizedList(List<T> l)
{
super(l);
list = l;
@@ -2484,7 +2653,7 @@ public class Collections
* @param sync the mutex
* @param l the list
*/
- SynchronizedList(Object sync, List l)
+ SynchronizedList(Object sync, List<T> l)
{
super(sync, l);
list = l;
@@ -2509,7 +2678,7 @@ public class Collections
* @throws NullPointerException if o is null and this list doesn't support
* the addition of null values.
*/
- public void add(int index, Object o)
+ public void add(int index, T o)
{
synchronized (mutex)
{
@@ -2535,7 +2704,7 @@ public class Collections
* @throws NullPointerException if o is null and this list doesn't support
* the addition of null values.
*/
- public boolean addAll(int index, Collection c)
+ public boolean addAll(int index, Collection<? extends T> c)
{
synchronized (mutex)
{
@@ -2571,7 +2740,7 @@ public class Collections
* @return the element at index index in this list
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
- public Object get(int index)
+ public T get(int index)
{
synchronized (mutex)
{
@@ -2648,11 +2817,11 @@ public class Collections
* to be performed, in addition to those supplied by the
* standard iterator.
*/
- public ListIterator listIterator()
+ public ListIterator<T> listIterator()
{
synchronized (mutex)
{
- return new SynchronizedListIterator(mutex, list.listIterator());
+ return new SynchronizedListIterator<T>(mutex, list.listIterator());
}
}
@@ -2673,11 +2842,12 @@ public class Collections
* standard iterator.
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
*/
- public ListIterator listIterator(int index)
+ public ListIterator<T> listIterator(int index)
{
synchronized (mutex)
{
- return new SynchronizedListIterator(mutex, list.listIterator(index));
+ return new SynchronizedListIterator<T>(mutex,
+ list.listIterator(index));
}
}
@@ -2692,7 +2862,7 @@ public class Collections
* remove operation
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
- public Object remove(int index)
+ public T remove(int index)
{
synchronized (mutex)
{
@@ -2718,7 +2888,7 @@ public class Collections
* @throws NullPointerException if o is null and this
* list does not support null values.
*/
- public Object set(int index, Object o)
+ public T set(int index, T o)
{
synchronized (mutex)
{
@@ -2744,11 +2914,12 @@ public class Collections
* @throws IndexOutOfBoundsException if fromIndex &lt; 0
* || toIndex &gt; size() || fromIndex &gt; toIndex
*/
- public List subList(int fromIndex, int toIndex)
+ public List<T> subList(int fromIndex, int toIndex)
{
synchronized (mutex)
{
- return new SynchronizedList(mutex, list.subList(fromIndex, toIndex));
+ return new SynchronizedList<T>(mutex,
+ list.subList(fromIndex, toIndex));
}
}
} // class SynchronizedList
@@ -2760,8 +2931,8 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class SynchronizedRandomAccessList
- extends SynchronizedList implements RandomAccess
+ private static final class SynchronizedRandomAccessList<T>
+ extends SynchronizedList<T> implements RandomAccess
{
/**
* Compatible with JDK 1.4.
@@ -2773,7 +2944,7 @@ public class Collections
* @param l the list to wrap
* @throws NullPointerException if l is null
*/
- SynchronizedRandomAccessList(List l)
+ SynchronizedRandomAccessList(List<T> l)
{
super(l);
}
@@ -2784,7 +2955,7 @@ public class Collections
* @param sync the mutex
* @param l the list
*/
- SynchronizedRandomAccessList(Object sync, List l)
+ SynchronizedRandomAccessList(Object sync, List<T> l)
{
super(sync, l);
}
@@ -2808,13 +2979,13 @@ public class Collections
* @throws IndexOutOfBoundsException if fromIndex &lt; 0
* || toIndex &gt; size() || fromIndex &gt; toIndex
*/
- public List subList(int fromIndex, int toIndex)
+ public List<T> subList(int fromIndex, int toIndex)
{
synchronized (mutex)
{
- return new SynchronizedRandomAccessList(mutex,
- list.subList(fromIndex,
- toIndex));
+ return new SynchronizedRandomAccessList<T>(mutex,
+ list.subList(fromIndex,
+ toIndex));
}
}
} // class SynchronizedRandomAccessList
@@ -2825,21 +2996,21 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class SynchronizedListIterator
- extends SynchronizedIterator implements ListIterator
+ private static final class SynchronizedListIterator<T>
+ extends SynchronizedIterator<T> implements ListIterator<T>
{
/**
* The wrapped iterator, stored both here and in the superclass to
* avoid excessive casting.
*/
- private final ListIterator li;
+ private final ListIterator<T> li;
/**
* Only trusted code creates a wrapper, with the specified sync.
* @param sync the mutex
* @param li the wrapped iterator
*/
- SynchronizedListIterator(Object sync, ListIterator li)
+ SynchronizedListIterator(Object sync, ListIterator<T> li)
{
super(sync, li);
this.li = li;
@@ -2863,7 +3034,7 @@ public class Collections
* @throws UnsupportedOperationException if this ListIterator does not
* support the add operation.
*/
- public void add(Object o)
+ public void add(T o)
{
synchronized (mutex)
{
@@ -2913,7 +3084,7 @@ public class Collections
* @return the next element in the list in the reverse direction
* @throws NoSuchElementException if there are no more elements
*/
- public Object previous()
+ public T previous()
{
synchronized (mutex)
{
@@ -2955,7 +3126,7 @@ public class Collections
* @throws UnsupportedOperationException if this ListIterator does not
* support the set operation
*/
- public void set(Object o)
+ public void set(T o)
{
synchronized (mutex)
{
@@ -2989,9 +3160,9 @@ public class Collections
* @return a synchronized view of the map
* @see Serializable
*/
- public static Map synchronizedMap(Map m)
+ public static <K, V> Map<K, V> synchronizedMap(Map<K, V> m)
{
- return new SynchronizedMap(m);
+ return new SynchronizedMap<K, V>(m);
}
/**
@@ -3000,7 +3171,7 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static class SynchronizedMap implements Map, Serializable
+ private static class SynchronizedMap<K, V> implements Map<K, V>, Serializable
{
/**
* Compatible with JDK 1.4.
@@ -3011,7 +3182,7 @@ public class Collections
* The wrapped map.
* @serial the real map
*/
- private final Map m;
+ private final Map<K, V> m;
/**
* The object to synchronize on. When an instance is created via public
@@ -3025,24 +3196,24 @@ public class Collections
/**
* Cache the entry set.
*/
- private transient Set entries;
+ private transient Set<Map.Entry<K, V>> entries;
/**
* Cache the key set.
*/
- private transient Set keys;
+ private transient Set<K> keys;
/**
* Cache the value collection.
*/
- private transient Collection values;
+ private transient Collection<V> values;
/**
* Wrap a given map.
* @param m the map to wrap
* @throws NullPointerException if m is null
*/
- SynchronizedMap(Map m)
+ SynchronizedMap(Map<K, V> m)
{
this.m = m;
mutex = this;
@@ -3055,7 +3226,7 @@ public class Collections
* @param sync the mutex
* @param m the map
*/
- SynchronizedMap(Object sync, Map m)
+ SynchronizedMap(Object sync, Map<K, V> m)
{
this.m = m;
mutex = sync;
@@ -3119,15 +3290,15 @@ public class Collections
// means "return a SynchronizedSet, except that the iterator() method
// returns an SynchronizedIterator whose next() method returns a
// synchronized wrapper around its normal return value".
- public Set entrySet()
+ public Set<Map.Entry<K, V>> entrySet()
{
// Define this here to spare some nesting.
- class SynchronizedMapEntry implements Map.Entry
+ class SynchronizedMapEntry<K, V> implements Map.Entry<K, V>
{
- final Map.Entry e;
- SynchronizedMapEntry(Object o)
+ final Map.Entry<K, V> e;
+ SynchronizedMapEntry(Map.Entry<K, V> o)
{
- e = (Map.Entry) o;
+ e = o;
}
/**
@@ -3152,7 +3323,7 @@ public class Collections
*
* @return The key of the underlying map entry.
*/
- public Object getKey()
+ public K getKey()
{
synchronized (mutex)
{
@@ -3166,7 +3337,7 @@ public class Collections
*
* @return The value of the underlying map entry.
*/
- public Object getValue()
+ public V getValue()
{
synchronized (mutex)
{
@@ -3207,7 +3378,7 @@ public class Collections
* prevents it from existing in this map.
* @throws NullPointerException if the map forbids null values.
*/
- public Object setValue(Object value)
+ public V setValue(V value)
{
synchronized (mutex)
{
@@ -3234,7 +3405,7 @@ public class Collections
if (entries == null)
synchronized (mutex)
{
- entries = new SynchronizedSet(mutex, m.entrySet())
+ entries = new SynchronizedSet<Map.Entry<K, V>>(mutex, m.entrySet())
{
/**
* Returns an iterator over the set. The iterator has no specific order,
@@ -3244,11 +3415,12 @@ public class Collections
*
* @return A synchronized set iterator.
*/
- public Iterator iterator()
+ public Iterator<Map.Entry<K, V>> iterator()
{
synchronized (super.mutex)
{
- return new SynchronizedIterator(super.mutex, c.iterator())
+ return new SynchronizedIterator<Map.Entry<K, V>>(super.mutex,
+ c.iterator())
{
/**
* Retrieves the next map entry from the iterator.
@@ -3258,11 +3430,11 @@ public class Collections
*
* @return A synchronized map entry.
*/
- public Object next()
+ public Map.Entry<K, V> next()
{
synchronized (super.mutex)
{
- return new SynchronizedMapEntry(super.next());
+ return new SynchronizedMapEntry<K, V>(super.next());
}
}
};
@@ -3306,7 +3478,7 @@ public class Collections
* @throws ClassCastException if the key is an inappropriate type.
* @throws NullPointerException if this map does not accept null keys.
*/
- public Object get(Object key)
+ public V get(Object key)
{
synchronized (mutex)
{
@@ -3356,12 +3528,12 @@ public class Collections
*
* @return A synchronized set containing the keys of the underlying map.
*/
- public Set keySet()
+ public Set<K> keySet()
{
if (keys == null)
synchronized (mutex)
{
- keys = new SynchronizedSet(mutex, m.keySet());
+ keys = new SynchronizedSet<K>(mutex, m.keySet());
}
return keys;
}
@@ -3384,7 +3556,7 @@ public class Collections
* and the map forbids null keys or values
* @see #containsKey(Object)
*/
- public Object put(Object key, Object value)
+ public V put(K key, V value)
{
synchronized (mutex)
{
@@ -3406,7 +3578,7 @@ public class Collections
* if <code>m</code> is null.
* @see #put(Object, Object)
*/
- public void putAll(Map map)
+ public void putAll(Map<? extends K, ? extends V> map)
{
synchronized (mutex)
{
@@ -3429,7 +3601,7 @@ public class Collections
* @throws ClassCastException if the type of the key is not a valid type
* for this map.
*/
- public Object remove(Object o)
+ public V remove(Object o)
{
synchronized (mutex)
{
@@ -3482,12 +3654,12 @@ public class Collections
*
* @return the collection of all values in the underlying map.
*/
- public Collection values()
+ public Collection<V> values()
{
if (values == null)
synchronized (mutex)
{
- values = new SynchronizedCollection(mutex, m.values());
+ values = new SynchronizedCollection<V>(mutex, m.values());
}
return values;
}
@@ -3517,9 +3689,9 @@ public class Collections
* @return a synchronized view of the set
* @see Serializable
*/
- public static Set synchronizedSet(Set s)
+ public static <T> Set<T> synchronizedSet(Set<T> s)
{
- return new SynchronizedSet(s);
+ return new SynchronizedSet<T>(s);
}
/**
@@ -3530,8 +3702,8 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- static class SynchronizedSet extends SynchronizedCollection
- implements Set
+ static class SynchronizedSet<T> extends SynchronizedCollection<T>
+ implements Set<T>
{
/**
* Compatible with JDK 1.4.
@@ -3543,7 +3715,7 @@ public class Collections
* @param s the set to wrap
* @throws NullPointerException if s is null
*/
- SynchronizedSet(Set s)
+ SynchronizedSet(Set<T> s)
{
super(s);
}
@@ -3553,7 +3725,7 @@ public class Collections
* @param sync the mutex
* @param s the set
*/
- SynchronizedSet(Object sync, Set s)
+ SynchronizedSet(Object sync, Set<T> s)
{
super(sync, s);
}
@@ -3623,9 +3795,9 @@ public class Collections
* @return a synchronized view of the sorted map
* @see Serializable
*/
- public static SortedMap synchronizedSortedMap(SortedMap m)
+ public static <K, V> SortedMap<K, V> synchronizedSortedMap(SortedMap<K, V> m)
{
- return new SynchronizedSortedMap(m);
+ return new SynchronizedSortedMap<K, V>(m);
}
/**
@@ -3634,8 +3806,9 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class SynchronizedSortedMap extends SynchronizedMap
- implements SortedMap
+ private static final class SynchronizedSortedMap<K, V>
+ extends SynchronizedMap<K, V>
+ implements SortedMap<K, V>
{
/**
* Compatible with JDK 1.4.
@@ -3647,14 +3820,14 @@ public class Collections
* excessive casting.
* @serial the wrapped map
*/
- private final SortedMap sm;
+ private final SortedMap<K, V> sm;
/**
* Wrap a given map.
* @param sm the map to wrap
* @throws NullPointerException if sm is null
*/
- SynchronizedSortedMap(SortedMap sm)
+ SynchronizedSortedMap(SortedMap<K, V> sm)
{
super(sm);
this.sm = sm;
@@ -3665,7 +3838,7 @@ public class Collections
* @param sync the mutex
* @param sm the map
*/
- SynchronizedSortedMap(Object sync, SortedMap sm)
+ SynchronizedSortedMap(Object sync, SortedMap<K, V> sm)
{
super(sync, sm);
this.sm = sm;
@@ -3678,7 +3851,7 @@ public class Collections
*
* @return the sorting comparator.
*/
- public Comparator comparator()
+ public Comparator<? super K> comparator()
{
synchronized (mutex)
{
@@ -3693,7 +3866,7 @@ public class Collections
* @return the first key.
* @throws NoSuchElementException if this map is empty.
*/
- public Object firstKey()
+ public K firstKey()
{
synchronized (mutex)
{
@@ -3720,11 +3893,11 @@ public class Collections
* @throws NullPointerException if toKey is null. but the map does not allow
* null keys.
*/
- public SortedMap headMap(Object toKey)
+ public SortedMap<K, V> headMap(K toKey)
{
synchronized (mutex)
{
- return new SynchronizedSortedMap(mutex, sm.headMap(toKey));
+ return new SynchronizedSortedMap<K, V>(mutex, sm.headMap(toKey));
}
}
@@ -3735,7 +3908,7 @@ public class Collections
* @return the last key.
* @throws NoSuchElementException if this map is empty.
*/
- public Object lastKey()
+ public K lastKey()
{
synchronized (mutex)
{
@@ -3761,11 +3934,12 @@ public class Collections
* @throws NullPointerException if fromKey or toKey is null. but the map does
* not allow null keys.
*/
- public SortedMap subMap(Object fromKey, Object toKey)
+ public SortedMap<K, V> subMap(K fromKey, K toKey)
{
synchronized (mutex)
{
- return new SynchronizedSortedMap(mutex, sm.subMap(fromKey, toKey));
+ return new SynchronizedSortedMap<K, V>(mutex,
+ sm.subMap(fromKey, toKey));
}
}
@@ -3785,11 +3959,11 @@ public class Collections
* @throws NullPointerException if fromKey is null. but the map does not allow
* null keys.
*/
- public SortedMap tailMap(Object fromKey)
+ public SortedMap<K, V> tailMap(K fromKey)
{
synchronized (mutex)
{
- return new SynchronizedSortedMap(mutex, sm.tailMap(fromKey));
+ return new SynchronizedSortedMap<K, V>(mutex, sm.tailMap(fromKey));
}
}
} // class SynchronizedSortedMap
@@ -3819,9 +3993,9 @@ public class Collections
* @return a synchronized view of the sorted set
* @see Serializable
*/
- public static SortedSet synchronizedSortedSet(SortedSet s)
+ public static <T> SortedSet<T> synchronizedSortedSet(SortedSet<T> s)
{
- return new SynchronizedSortedSet(s);
+ return new SynchronizedSortedSet<T>(s);
}
/**
@@ -3830,8 +4004,9 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class SynchronizedSortedSet extends SynchronizedSet
- implements SortedSet
+ private static final class SynchronizedSortedSet<T>
+ extends SynchronizedSet<T>
+ implements SortedSet<T>
{
/**
* Compatible with JDK 1.4.
@@ -3843,14 +4018,14 @@ public class Collections
* excessive casting.
* @serial the wrapped set
*/
- private final SortedSet ss;
+ private final SortedSet<T> ss;
/**
* Wrap a given set.
* @param ss the set to wrap
* @throws NullPointerException if ss is null
*/
- SynchronizedSortedSet(SortedSet ss)
+ SynchronizedSortedSet(SortedSet<T> ss)
{
super(ss);
this.ss = ss;
@@ -3861,7 +4036,7 @@ public class Collections
* @param sync the mutex
* @param ss the set
*/
- SynchronizedSortedSet(Object sync, SortedSet ss)
+ SynchronizedSortedSet(Object sync, SortedSet<T> ss)
{
super(sync, ss);
this.ss = ss;
@@ -3874,7 +4049,7 @@ public class Collections
*
* @return the sorting comparator.
*/
- public Comparator comparator()
+ public Comparator<? super T> comparator()
{
synchronized (mutex)
{
@@ -3889,7 +4064,7 @@ public class Collections
* @return the first element.
* @throws NoSuchElementException if this set is empty.
*/
- public Object first()
+ public T first()
{
synchronized (mutex)
{
@@ -3916,11 +4091,11 @@ public class Collections
* @throws NullPointerException if toElement is null. but the set does not allow
* null elements.
*/
- public SortedSet headSet(Object toElement)
+ public SortedSet<T> headSet(T toElement)
{
synchronized (mutex)
{
- return new SynchronizedSortedSet(mutex, ss.headSet(toElement));
+ return new SynchronizedSortedSet<T>(mutex, ss.headSet(toElement));
}
}
@@ -3931,7 +4106,7 @@ public class Collections
* @return the last element.
* @throws NoSuchElementException if this set is empty.
*/
- public Object last()
+ public T last()
{
synchronized (mutex)
{
@@ -3957,12 +4132,13 @@ public class Collections
* @throws NullPointerException if fromElement or toElement is null. but the set does
* not allow null elements.
*/
- public SortedSet subSet(Object fromElement, Object toElement)
+ public SortedSet<T> subSet(T fromElement, T toElement)
{
synchronized (mutex)
{
- return new SynchronizedSortedSet(mutex,
- ss.subSet(fromElement, toElement));
+ return new SynchronizedSortedSet<T>(mutex,
+ ss.subSet(fromElement,
+ toElement));
}
}
@@ -3982,11 +4158,11 @@ public class Collections
* @throws NullPointerException if fromElement is null. but the set does not allow
* null elements.
*/
- public SortedSet tailSet(Object fromElement)
+ public SortedSet<T> tailSet(T fromElement)
{
synchronized (mutex)
{
- return new SynchronizedSortedSet(mutex, ss.tailSet(fromElement));
+ return new SynchronizedSortedSet<T>(mutex, ss.tailSet(fromElement));
}
}
} // class SynchronizedSortedSet
@@ -4011,9 +4187,9 @@ public class Collections
* @return a read-only view of the collection
* @see Serializable
*/
- public static Collection unmodifiableCollection(Collection c)
+ public static <T> Collection<T> unmodifiableCollection(Collection<? extends T> c)
{
- return new UnmodifiableCollection(c);
+ return new UnmodifiableCollection<T>(c);
}
/**
@@ -4022,8 +4198,8 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static class UnmodifiableCollection
- implements Collection, Serializable
+ private static class UnmodifiableCollection<T>
+ implements Collection<T>, Serializable
{
/**
* Compatible with JDK 1.4.
@@ -4034,14 +4210,14 @@ public class Collections
* The wrapped collection. Package visible for use by subclasses.
* @serial the real collection
*/
- final Collection c;
+ final Collection<? extends T> c;
/**
* Wrap a given collection.
* @param c the collection to wrap
* @throws NullPointerException if c is null
*/
- UnmodifiableCollection(Collection c)
+ UnmodifiableCollection(Collection<? extends T> c)
{
this.c = c;
if (c == null)
@@ -4057,7 +4233,7 @@ public class Collections
* @throws UnsupportedOperationException as an unmodifiable collection does not
* support the add operation.
*/
- public boolean add(Object o)
+ public boolean add(T o)
{
throw new UnsupportedOperationException();
}
@@ -4071,7 +4247,7 @@ public class Collections
* @throws UnsupportedOperationException as an unmodifiable collection does not
* support the <code>addAll</code> operation.
*/
- public boolean addAll(Collection c)
+ public boolean addAll(Collection<? extends T> c)
{
throw new UnsupportedOperationException();
}
@@ -4119,7 +4295,7 @@ public class Collections
* collection does not support null values.
* @throws NullPointerException if c itself is null.
*/
- public boolean containsAll(Collection c1)
+ public boolean containsAll(Collection<?> c1)
{
return c.containsAll(c1);
}
@@ -4142,9 +4318,9 @@ public class Collections
* @return an UnmodifiableIterator over the elements of the underlying
* collection, in any order.
*/
- public Iterator iterator()
+ public Iterator<T> iterator()
{
- return new UnmodifiableIterator(c.iterator());
+ return new UnmodifiableIterator<T>(c.iterator());
}
/**
@@ -4172,7 +4348,7 @@ public class Collections
* @throws UnsupportedOperationException as an unmodifiable collection
* does not support the <code>removeAll()</code> operation.
*/
- public boolean removeAll(Collection c)
+ public boolean removeAll(Collection<?> c)
{
throw new UnsupportedOperationException();
}
@@ -4187,7 +4363,7 @@ public class Collections
* @throws UnsupportedOperationException as an unmodifiable collection
* does not support the <code>retainAll()</code> operation.
*/
- public boolean retainAll(Collection c)
+ public boolean retainAll(Collection<?> c)
{
throw new UnsupportedOperationException();
}
@@ -4231,7 +4407,7 @@ public class Collections
* @throws ArrayStoreException if the type of any element of the
* collection is not a subtype of the element type of a.
*/
- public Object[] toArray(Object[] a)
+ public <S> S[] toArray(S[] a)
{
return c.toArray(a);
}
@@ -4253,18 +4429,18 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static class UnmodifiableIterator implements Iterator
+ private static class UnmodifiableIterator<T> implements Iterator<T>
{
/**
* The wrapped iterator.
*/
- private final Iterator i;
+ private final Iterator<? extends T> i;
/**
* Only trusted code creates a wrapper.
* @param i the wrapped iterator
*/
- UnmodifiableIterator(Iterator i)
+ UnmodifiableIterator(Iterator<? extends T> i)
{
this.i = i;
}
@@ -4275,10 +4451,11 @@ public class Collections
* @return the next element in the collection.
* @throws NoSuchElementException if there are no more elements.
*/
- public Object next()
+ public T next()
{
return i.next();
}
+
/**
* Tests whether there are still elements to be retrieved from the
* underlying collection by <code>next()</code>. When this method
@@ -4325,11 +4502,11 @@ public class Collections
* @see Serializable
* @see RandomAccess
*/
- public static List unmodifiableList(List l)
+ public static <T> List<T> unmodifiableList(List<? extends T> l)
{
if (l instanceof RandomAccess)
- return new UnmodifiableRandomAccessList(l);
- return new UnmodifiableList(l);
+ return new UnmodifiableRandomAccessList<T>(l);
+ return new UnmodifiableList<T>(l);
}
/**
@@ -4339,8 +4516,8 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static class UnmodifiableList extends UnmodifiableCollection
- implements List
+ private static class UnmodifiableList<T> extends UnmodifiableCollection<T>
+ implements List<T>
{
/**
* Compatible with JDK 1.4.
@@ -4353,17 +4530,17 @@ public class Collections
* excessive casting. Package visible for use by subclass.
* @serial the wrapped list
*/
- final List list;
+ final List<T> list;
/**
* Wrap a given list.
* @param l the list to wrap
* @throws NullPointerException if l is null
*/
- UnmodifiableList(List l)
+ UnmodifiableList(List<? extends T> l)
{
super(l);
- list = l;
+ list = (List<T>) l;
}
/**
@@ -4376,7 +4553,7 @@ public class Collections
* @throws UnsupportedOperationException as an unmodifiable
* list doesn't support the <code>add()</code> operation.
*/
- public void add(int index, Object o)
+ public void add(int index, T o)
{
throw new UnsupportedOperationException();
}
@@ -4391,7 +4568,7 @@ public class Collections
* @throws UnsupportedOperationException as an unmodifiable
* list doesn't support the <code>addAll()</code> operation.
*/
- public boolean addAll(int index, Collection c)
+ public boolean addAll(int index, Collection<? extends T> c)
{
throw new UnsupportedOperationException();
}
@@ -4416,7 +4593,7 @@ public class Collections
* @return the element at index index in this list
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
- public Object get(int index)
+ public T get(int index)
{
return list.get(index);
}
@@ -4474,9 +4651,9 @@ public class Collections
* @return a <code>UnmodifiableListIterator</code> over the elements of the
* underlying list, in order, starting at the beginning.
*/
- public ListIterator listIterator()
+ public ListIterator<T> listIterator()
{
- return new UnmodifiableListIterator(list.listIterator());
+ return new UnmodifiableListIterator<T>(list.listIterator());
}
/**
@@ -4493,9 +4670,9 @@ public class Collections
* underlying list, in order, starting at the specified index.
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
*/
- public ListIterator listIterator(int index)
+ public ListIterator<T> listIterator(int index)
{
- return new UnmodifiableListIterator(list.listIterator(index));
+ return new UnmodifiableListIterator<T>(list.listIterator(index));
}
/**
@@ -4508,7 +4685,7 @@ public class Collections
* list does not support the <code>remove()</code>
* operation.
*/
- public Object remove(int index)
+ public T remove(int index)
{
throw new UnsupportedOperationException();
}
@@ -4524,7 +4701,7 @@ public class Collections
* list does not support the <code>set()</code>
* operation.
*/
- public Object set(int index, Object o)
+ public T set(int index, T o)
{
throw new UnsupportedOperationException();
}
@@ -4544,7 +4721,7 @@ public class Collections
* @throws IndexOutOfBoundsException if fromIndex &lt; 0
* || toIndex &gt; size() || fromIndex &gt; toIndex.
*/
- public List subList(int fromIndex, int toIndex)
+ public List<T> subList(int fromIndex, int toIndex)
{
return unmodifiableList(list.subList(fromIndex, toIndex));
}
@@ -4557,8 +4734,8 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class UnmodifiableRandomAccessList
- extends UnmodifiableList implements RandomAccess
+ private static final class UnmodifiableRandomAccessList<T>
+ extends UnmodifiableList<T> implements RandomAccess
{
/**
* Compatible with JDK 1.4.
@@ -4570,7 +4747,7 @@ public class Collections
* @param l the list to wrap
* @throws NullPointerException if l is null
*/
- UnmodifiableRandomAccessList(List l)
+ UnmodifiableRandomAccessList(List<? extends T> l)
{
super(l);
}
@@ -4581,20 +4758,20 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class UnmodifiableListIterator
- extends UnmodifiableIterator implements ListIterator
+ private static final class UnmodifiableListIterator<T>
+ extends UnmodifiableIterator<T> implements ListIterator<T>
{
/**
* The wrapped iterator, stored both here and in the superclass to
* avoid excessive casting.
*/
- private final ListIterator li;
+ private final ListIterator<T> li;
/**
* Only trusted code creates a wrapper.
* @param li the wrapped iterator
*/
- UnmodifiableListIterator(ListIterator li)
+ UnmodifiableListIterator(ListIterator<T> li)
{
super(li);
this.li = li;
@@ -4608,7 +4785,7 @@ public class Collections
* @throws UnsupportedOperationException as the iterator of an unmodifiable
* list does not support the <code>add()</code> operation.
*/
- public void add(Object o)
+ public void add(T o)
{
throw new UnsupportedOperationException();
}
@@ -4645,7 +4822,7 @@ public class Collections
* @return the previous element in the list.
* @throws NoSuchElementException if there are no more prior elements.
*/
- public Object previous()
+ public T previous()
{
return li.previous();
}
@@ -4671,7 +4848,7 @@ public class Collections
* @throws UnsupportedOperationException as the iterator of an unmodifiable
* list does not support the <code>set()</code> operation.
*/
- public void set(Object o)
+ public void set(T o)
{
throw new UnsupportedOperationException();
}
@@ -4694,9 +4871,10 @@ public class Collections
* @return a read-only view of the map
* @see Serializable
*/
- public static Map unmodifiableMap(Map m)
+ public static <K, V> Map<K, V> unmodifiableMap(Map<? extends K,
+ ? extends V> m)
{
- return new UnmodifiableMap(m);
+ return new UnmodifiableMap<K, V>(m);
}
/**
@@ -4705,7 +4883,7 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static class UnmodifiableMap implements Map, Serializable
+ private static class UnmodifiableMap<K, V> implements Map<K, V>, Serializable
{
/**
* Compatible with JDK 1.4.
@@ -4716,31 +4894,31 @@ public class Collections
* The wrapped map.
* @serial the real map
*/
- private final Map m;
+ private final Map<K, V> m;
/**
* Cache the entry set.
*/
- private transient Set entries;
+ private transient Set<Map.Entry<K, V>> entries;
/**
* Cache the key set.
*/
- private transient Set keys;
+ private transient Set<K> keys;
/**
* Cache the value collection.
*/
- private transient Collection values;
+ private transient Collection<V> values;
/**
* Wrap a given map.
* @param m the map to wrap
* @throws NullPointerException if m is null
*/
- UnmodifiableMap(Map m)
+ UnmodifiableMap(Map<? extends K, ? extends V> m)
{
- this.m = m;
+ this.m = (Map<K,V>) m;
if (m == null)
throw new NullPointerException();
}
@@ -4801,10 +4979,10 @@ public class Collections
* @return the unmodifiable set view of all mapping entries.
* @see Map.Entry
*/
- public Set entrySet()
+ public Set<Map.Entry<K, V>> entrySet()
{
if (entries == null)
- entries = new UnmodifiableEntrySet(m.entrySet());
+ entries = new UnmodifiableEntrySet<K,V>(m.entrySet());
return entries;
}
@@ -4814,17 +4992,18 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class UnmodifiableEntrySet extends UnmodifiableSet
+ private static final class UnmodifiableEntrySet<K,V>
+ extends UnmodifiableSet<Map.Entry<K,V>>
implements Serializable
{
// Unmodifiable implementation of Map.Entry used as return value for
// UnmodifiableEntrySet accessors (iterator, toArray, toArray(Object[]))
- private static final class UnmodifiableMapEntry
- implements Map.Entry
+ private static final class UnmodifiableMapEntry<K,V>
+ implements Map.Entry<K,V>
{
- private final Map.Entry e;
+ private final Map.Entry<K,V> e;
- private UnmodifiableMapEntry(Map.Entry e)
+ private UnmodifiableMapEntry(Map.Entry<K,V> e)
{
super();
this.e = e;
@@ -4847,7 +5026,7 @@ public class Collections
*
* @return the key.
*/
- public Object getKey()
+ public K getKey()
{
return e.getKey();
}
@@ -4857,7 +5036,7 @@ public class Collections
*
* @return the value.
*/
- public Object getValue()
+ public V getValue()
{
return e.getValue();
}
@@ -4882,7 +5061,7 @@ public class Collections
* @throws UnsupportedOperationException as an unmodifiable map entry
* does not support the <code>setValue()</code> operation.
*/
- public Object setValue(Object value)
+ public V setValue(V value)
{
throw new UnsupportedOperationException();
}
@@ -4907,15 +5086,15 @@ public class Collections
* Wrap a given set.
* @param s the set to wrap
*/
- UnmodifiableEntrySet(Set s)
+ UnmodifiableEntrySet(Set<Map.Entry<K,V>> s)
{
super(s);
}
// The iterator must return unmodifiable map entries.
- public Iterator iterator()
+ public Iterator<Map.Entry<K,V>> iterator()
{
- return new UnmodifiableIterator(c.iterator())
+ return new UnmodifiableIterator<Map.Entry<K,V>>(c.iterator())
{
/**
* Obtains the next element from the underlying set of
@@ -4924,49 +5103,45 @@ public class Collections
* @return the next element in the collection.
* @throws NoSuchElementException if there are no more elements.
*/
- public Object next()
+ public Map.Entry<K,V> next()
{
- final Map.Entry e = (Map.Entry) super.next();
- return new UnmodifiableMapEntry(e);
- }
+ final Map.Entry<K,V> e = super.next();
+ return new UnmodifiableMapEntry<K,V>(e);
+ }
};
}
// The array returned is an array of UnmodifiableMapEntry instead of
// Map.Entry
- public Object[] toArray()
+ public Map.Entry<K,V>[] toArray()
{
- Object[] mapEntryResult = super.toArray();
- UnmodifiableMapEntry result[] = null;
-
+ Map.Entry<K,V>[] mapEntryResult = (Map.Entry<K,V>[]) super.toArray();
+ UnmodifiableMapEntry<K,V> result[] = null;
+
if (mapEntryResult != null)
{
- result = new UnmodifiableMapEntry[mapEntryResult.length];
- for (int i = 0; i < mapEntryResult.length; i++)
- {
- Map.Entry r = (Map.Entry) mapEntryResult[i];
- result[i] = new UnmodifiableMapEntry(r);
- }
- }
+ result = (UnmodifiableMapEntry<K,V>[])
+ new UnmodifiableMapEntry[mapEntryResult.length];
+ for (int i = 0; i < mapEntryResult.length; ++i)
+ result[i] = new UnmodifiableMapEntry(mapEntryResult[i]);
+ }
return result;
}
-
+
// The array returned is an array of UnmodifiableMapEntry instead of
// Map.Entry
- public Object[] toArray(Object[] array)
+ public Map.Entry<K,V>[] toArray(Map.Entry<K,V>[] array)
{
super.toArray(array);
-
+
if (array != null)
- {
- for (int i = 0; i < array.length; i++)
- {
- array[i] = new UnmodifiableMapEntry((Map.Entry) array[i]);
- }
- }
+ for (int i = 0; i < array.length; i++)
+ array[i] =
+ new UnmodifiableMapEntry<K,V>(array[i]);
return array;
}
+
} // class UnmodifiableEntrySet
/**
@@ -4994,7 +5169,7 @@ public class Collections
* @throws NullPointerException if this map does not accept null keys.
* @see #containsKey(Object)
*/
- public Object get(Object key)
+ public V get(Object key)
{
return m.get(key);
}
@@ -5009,7 +5184,7 @@ public class Collections
* @throws UnsupportedOperationException as an unmodifiable
* map does not support the <code>put()</code> operation.
*/
- public Object put(Object key, Object value)
+ public V put(K key, V value)
{
throw new UnsupportedOperationException();
}
@@ -5045,10 +5220,10 @@ public class Collections
*
* @return the set view of all keys.
*/
- public Set keySet()
+ public Set<K> keySet()
{
if (keys == null)
- keys = new UnmodifiableSet(m.keySet());
+ keys = new UnmodifiableSet<K>(m.keySet());
return keys;
}
@@ -5061,7 +5236,7 @@ public class Collections
* @throws UnsupportedOperationException as an unmodifiable
* map does not support the <code>putAll</code> operation.
*/
- public void putAll(Map m)
+ public void putAll(Map<? extends K, ? extends V> m)
{
throw new UnsupportedOperationException();
}
@@ -5077,7 +5252,7 @@ public class Collections
* @throws UnsupportedOperationException as an unmodifiable
* map does not support the <code>remove</code> operation.
*/
- public Object remove(Object o)
+ public V remove(Object o)
{
throw new UnsupportedOperationException();
}
@@ -5114,10 +5289,10 @@ public class Collections
*
* @return the collection view of all values.
*/
- public Collection values()
+ public Collection<V> values()
{
if (values == null)
- values = new UnmodifiableCollection(m.values());
+ values = new UnmodifiableCollection<V>(m.values());
return values;
}
} // class UnmodifiableMap
@@ -5139,9 +5314,9 @@ public class Collections
* @return a read-only view of the set
* @see Serializable
*/
- public static Set unmodifiableSet(Set s)
+ public static <T> Set<T> unmodifiableSet(Set<? extends T> s)
{
- return new UnmodifiableSet(s);
+ return new UnmodifiableSet<T>(s);
}
/**
@@ -5150,8 +5325,8 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static class UnmodifiableSet extends UnmodifiableCollection
- implements Set
+ private static class UnmodifiableSet<T> extends UnmodifiableCollection<T>
+ implements Set<T>
{
/**
* Compatible with JDK 1.4.
@@ -5163,7 +5338,7 @@ public class Collections
* @param s the set to wrap
* @throws NullPointerException if s is null
*/
- UnmodifiableSet(Set s)
+ UnmodifiableSet(Set<? extends T> s)
{
super(s);
}
@@ -5208,9 +5383,10 @@ public class Collections
* @return a read-only view of the map
* @see Serializable
*/
- public static SortedMap unmodifiableSortedMap(SortedMap m)
+ public static <K, V> SortedMap<K, V> unmodifiableSortedMap(SortedMap<K,
+ ? extends V> m)
{
- return new UnmodifiableSortedMap(m);
+ return new UnmodifiableSortedMap<K, V>(m);
}
/**
@@ -5219,8 +5395,9 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static class UnmodifiableSortedMap extends UnmodifiableMap
- implements SortedMap
+ private static class UnmodifiableSortedMap<K, V>
+ extends UnmodifiableMap<K, V>
+ implements SortedMap<K, V>
{
/**
* Compatible with JDK 1.4.
@@ -5232,17 +5409,17 @@ public class Collections
* excessive casting.
* @serial the wrapped map
*/
- private final SortedMap sm;
+ private final SortedMap<K, V> sm;
/**
* Wrap a given map.
* @param sm the map to wrap
* @throws NullPointerException if sm is null
*/
- UnmodifiableSortedMap(SortedMap sm)
+ UnmodifiableSortedMap(SortedMap<K, ? extends V> sm)
{
super(sm);
- this.sm = sm;
+ this.sm = (SortedMap<K,V>) sm;
}
/**
@@ -5251,7 +5428,7 @@ public class Collections
*
* @return the sorting comparator.
*/
- public Comparator comparator()
+ public Comparator<? super K> comparator()
{
return sm.comparator();
}
@@ -5262,7 +5439,7 @@ public class Collections
* @return the first key.
* @throws NoSuchElementException if this map is empty.
*/
- public Object firstKey()
+ public K firstKey()
{
return sm.firstKey();
}
@@ -5289,9 +5466,9 @@ public class Collections
* @throws NullPointerException if toKey is null but the map does not allow
* null keys.
*/
- public SortedMap headMap(Object toKey)
+ public SortedMap<K, V> headMap(K toKey)
{
- return new UnmodifiableSortedMap(sm.headMap(toKey));
+ return new UnmodifiableSortedMap<K, V>(sm.headMap(toKey));
}
/**
@@ -5300,7 +5477,7 @@ public class Collections
* @return the last key.
* @throws NoSuchElementException if this map is empty.
*/
- public Object lastKey()
+ public K lastKey()
{
return sm.lastKey();
}
@@ -5331,9 +5508,9 @@ public class Collections
* @throws NullPointerException if fromKey or toKey is null but the map
* does not allow null keys.
*/
- public SortedMap subMap(Object fromKey, Object toKey)
+ public SortedMap<K, V> subMap(K fromKey, K toKey)
{
- return new UnmodifiableSortedMap(sm.subMap(fromKey, toKey));
+ return new UnmodifiableSortedMap<K, V>(sm.subMap(fromKey, toKey));
}
/**
@@ -5358,9 +5535,9 @@ public class Collections
* @throws NullPointerException if fromKey is null but the map does not allow
* null keys
*/
- public SortedMap tailMap(Object fromKey)
+ public SortedMap<K, V> tailMap(K fromKey)
{
- return new UnmodifiableSortedMap(sm.tailMap(fromKey));
+ return new UnmodifiableSortedMap<K, V>(sm.tailMap(fromKey));
}
} // class UnmodifiableSortedMap
@@ -5381,9 +5558,9 @@ public class Collections
* @return a read-only view of the set
* @see Serializable
*/
- public static SortedSet unmodifiableSortedSet(SortedSet s)
+ public static <T> SortedSet<T> unmodifiableSortedSet(SortedSet<T> s)
{
- return new UnmodifiableSortedSet(s);
+ return new UnmodifiableSortedSet<T>(s);
}
/**
@@ -5392,8 +5569,8 @@ public class Collections
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static class UnmodifiableSortedSet extends UnmodifiableSet
- implements SortedSet
+ private static class UnmodifiableSortedSet<T> extends UnmodifiableSet<T>
+ implements SortedSet<T>
{
/**
* Compatible with JDK 1.4.
@@ -5405,14 +5582,14 @@ public class Collections
* excessive casting.
* @serial the wrapped set
*/
- private SortedSet ss;
+ private SortedSet<T> ss;
/**
* Wrap a given set.
* @param ss the set to wrap
* @throws NullPointerException if ss is null
*/
- UnmodifiableSortedSet(SortedSet ss)
+ UnmodifiableSortedSet(SortedSet<T> ss)
{
super(ss);
this.ss = ss;
@@ -5424,7 +5601,7 @@ public class Collections
*
* @return the sorting comparator
*/
- public Comparator comparator()
+ public Comparator<? super T> comparator()
{
return ss.comparator();
}
@@ -5436,7 +5613,7 @@ public class Collections
* @return the first element.
* @throws NoSuchElementException if the set is empty.
*/
- public Object first()
+ public T first()
{
return ss.first();
}
@@ -5464,9 +5641,9 @@ public class Collections
* @throws NullPointerException if toElement is null but the set does not
* allow null elements.
*/
- public SortedSet headSet(Object toElement)
+ public SortedSet<T> headSet(T toElement)
{
- return new UnmodifiableSortedSet(ss.headSet(toElement));
+ return new UnmodifiableSortedSet<T>(ss.headSet(toElement));
}
/**
@@ -5476,7 +5653,7 @@ public class Collections
* @return the last element.
* @throws NoSuchElementException if the set is empty.
*/
- public Object last()
+ public T last()
{
return ss.last();
}
@@ -5507,9 +5684,9 @@ public class Collections
* @throws NullPointerException if fromElement or toElement is null but the
* set does not allow null elements.
*/
- public SortedSet subSet(Object fromElement, Object toElement)
+ public SortedSet<T> subSet(T fromElement, T toElement)
{
- return new UnmodifiableSortedSet(ss.subSet(fromElement, toElement));
+ return new UnmodifiableSortedSet<T>(ss.subSet(fromElement, toElement));
}
/**
@@ -5533,9 +5710,1717 @@ public class Collections
* @throws NullPointerException if fromElement is null but the set does not
* allow null elements.
*/
- public SortedSet tailSet(Object fromElement)
+ public SortedSet<T> tailSet(T fromElement)
{
- return new UnmodifiableSortedSet(ss.tailSet(fromElement));
+ return new UnmodifiableSortedSet<T>(ss.tailSet(fromElement));
}
} // class UnmodifiableSortedSet
+
+ /**
+ * <p>
+ * Returns a dynamically typesafe view of the given collection,
+ * where any modification is first checked to ensure that the type
+ * of the new data is appropriate. Although the addition of
+ * generics and parametrically-typed collections prevents an
+ * incorrect type of element being added to a collection at
+ * compile-time, via static type checking, this can be overridden by
+ * casting. In contrast, wrapping the collection within a
+ * dynamically-typesafe wrapper, using this and associated methods,
+ * <emph>guarantees</emph> that the collection will only contain
+ * elements of an appropriate type (provided it only contains such
+ * at the type of wrapping, and all subsequent access is via the
+ * wrapper). This can be useful for debugging the cause of a
+ * <code>ClassCastException</code> caused by erroneous casting, or
+ * for protecting collections from corruption by external libraries.
+ * </p>
+ * <p>
+ * Since the collection might be a List or a Set, and those
+ * have incompatible equals and hashCode requirements, this relies
+ * on Object's implementation rather than passing those calls on to
+ * the wrapped collection. The returned Collection implements
+ * Serializable, but can only be serialized if the collection it
+ * wraps is likewise Serializable.
+ * </p>
+ *
+ * @param c the collection to wrap in a dynamically typesafe wrapper
+ * @param type the type of elements the collection should hold.
+ * @return a dynamically typesafe view of the collection.
+ * @see Serializable
+ * @since 1.5
+ */
+ public static <E> Collection<E> checkedCollection(Collection<E> c,
+ Class<E> type)
+ {
+ return new CheckedCollection<E>(c, type);
+ }
+
+ /**
+ * The implementation of {@link #checkedCollection(Collection,Class)}. This
+ * class name is required for compatibility with Sun's JDK serializability.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+ private static class CheckedCollection<E>
+ implements Collection<E>, Serializable
+ {
+ /**
+ * Compatible with JDK 1.5.
+ */
+ private static final long serialVersionUID = 1578914078182001775L;
+
+ /**
+ * The wrapped collection. Package visible for use by subclasses.
+ * @serial the real collection
+ */
+ final Collection<E> c;
+
+ /**
+ * The type of the elements of this collection.
+ * @serial the element type.
+ */
+ final Class<E> type;
+
+ /**
+ * Wrap a given collection.
+ * @param c the collection to wrap
+ * @param type the type to wrap
+ * @throws NullPointerException if c is null
+ */
+ CheckedCollection(Collection<E> c, Class<E> type)
+ {
+ this.c = c;
+ this.type = type;
+ if (c == null)
+ throw new NullPointerException();
+ }
+
+ /**
+ * Adds the supplied object to the collection, on the condition that
+ * it is of the correct type.
+ *
+ * @param o the object to add.
+ * @return <code>true</code> if the collection was modified as a result
+ * of this action.
+ * @throws ClassCastException if the object is not of the correct type.
+ */
+ public boolean add(E o)
+ {
+ if (type.isInstance(o))
+ return c.add(o);
+ else
+ throw new ClassCastException("The element is of the incorrect type.");
+ }
+
+ /**
+ * Adds the elements of the specified collection to the backing collection,
+ * provided they are all of the correct type.
+ *
+ * @param coll the collection to add.
+ * @return <code>true</code> if the collection was modified as a result
+ * of this action.
+ * @throws ClassCastException if <code>c</code> contained elements of an
+ * incorrect type.
+ */
+ public boolean addAll(Collection<? extends E> coll)
+ {
+ Collection<E> typedColl = (Collection<E>) c;
+ for (E element : typedColl)
+ {
+ if (!type.isInstance(element))
+ throw new ClassCastException("A member of the collection is not of the correct type.");
+ }
+ return c.addAll(typedColl);
+ }
+
+ /**
+ * Removes all elements from the underlying collection.
+ */
+ public void clear()
+ {
+ c.clear();
+ }
+
+ /**
+ * Test whether the underlying collection contains a given object as one
+ * of its elements.
+ *
+ * @param o the element to look for.
+ * @return <code>true</code> if the underlying collection contains at least
+ * one element e such that
+ * <code>o == null ? e == null : o.equals(e)</code>.
+ * @throws ClassCastException if the type of o is not a valid type for the
+ * underlying collection.
+ * @throws NullPointerException if o is null and the underlying collection
+ * doesn't support null values.
+ */
+ public boolean contains(Object o)
+ {
+ return c.contains(o);
+ }
+
+ /**
+ * Test whether the underlying collection contains every element in a given
+ * collection.
+ *
+ * @param coll the collection to test for.
+ * @return <code>true</code> if for every element o in c, contains(o) would
+ * return <code>true</code>.
+ * @throws ClassCastException if the type of any element in c is not a
+ * valid type for the underlying collection.
+ * @throws NullPointerException if some element of c is null and the
+ * underlying collection does not support
+ * null values.
+ * @throws NullPointerException if c itself is null.
+ */
+ public boolean containsAll(Collection<?> coll)
+ {
+ return c.containsAll(coll);
+ }
+
+ /**
+ * Tests whether the underlying collection is empty, that is,
+ * if size() == 0.
+ *
+ * @return <code>true</code> if this collection contains no elements.
+ */
+ public boolean isEmpty()
+ {
+ return c.isEmpty();
+ }
+
+ /**
+ * Obtain an Iterator over the underlying collection, which maintains
+ * its checked nature.
+ *
+ * @return a Iterator over the elements of the underlying
+ * collection, in any order.
+ */
+ public Iterator<E> iterator()
+ {
+ return new CheckedIterator<E>(c.iterator(), type);
+ }
+
+ /**
+ * Removes the supplied object from the collection, if it exists.
+ *
+ * @param o The object to remove.
+ * @return <code>true</code> if the object was removed (i.e. the underlying
+ * collection returned 1 or more instances of o).
+ */
+ public boolean remove(Object o)
+ {
+ return c.remove(o);
+ }
+
+ /**
+ * Removes all objects in the supplied collection from the backing
+ * collection, if they exist within it.
+ *
+ * @param coll the collection of objects to remove.
+ * @return <code>true</code> if the collection was modified.
+ */
+ public boolean removeAll(Collection<?> coll)
+ {
+ return c.removeAll(coll);
+ }
+
+ /**
+ * Retains all objects specified by the supplied collection which exist
+ * within the backing collection, and removes all others.
+ *
+ * @param coll the collection of objects to retain.
+ * @return <code>true</code> if the collection was modified.
+ */
+ public boolean retainAll(Collection<?> coll)
+ {
+ return c.retainAll(coll);
+ }
+
+ /**
+ * Retrieves the number of elements in the underlying collection.
+ *
+ * @return the number of elements in the collection.
+ */
+ public int size()
+ {
+ return c.size();
+ }
+
+ /**
+ * Copy the current contents of the underlying collection into an array.
+ *
+ * @return an array of type Object[] with a length equal to the size of the
+ * underlying collection and containing the elements currently in
+ * the underlying collection, in any order.
+ */
+ public Object[] toArray()
+ {
+ return c.toArray();
+ }
+
+ /**
+ * <p>
+ * Copy the current contents of the underlying collection into an array. If
+ * the array passed as an argument has length less than the size of the
+ * underlying collection, an array of the same run-time type as a, with a
+ * length equal to the size of the underlying collection, is allocated
+ * using reflection.
+ * </p>
+ * <p>
+ * Otherwise, a itself is used. The elements of the underlying collection
+ * are copied into it, and if there is space in the array, the following
+ * element is set to null. The resultant array is returned.
+ * </p>
+ * <p>
+ * <emph>Note</emph>: The fact that the following element is set to null
+ * is only useful if it is known that this collection does not contain
+ * any null elements.
+ *
+ * @param a the array to copy this collection into.
+ * @return an array containing the elements currently in the underlying
+ * collection, in any order.
+ * @throws ArrayStoreException if the type of any element of the
+ * collection is not a subtype of the element type of a.
+ */
+ public <S> S[] toArray(S[] a)
+ {
+ return c.toArray(a);
+ }
+
+ /**
+ * A textual representation of the unmodifiable collection.
+ *
+ * @return The checked collection in the form of a <code>String</code>.
+ */
+ public String toString()
+ {
+ return c.toString();
+ }
+ } // class CheckedCollection
+
+ /**
+ * The implementation of the various iterator methods in the
+ * checked classes.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+ private static class CheckedIterator<E>
+ implements Iterator<E>
+ {
+ /**
+ * The wrapped iterator.
+ */
+ private final Iterator<E> i;
+
+ /**
+ * The type of the elements of this collection.
+ * @serial the element type.
+ */
+ final Class<E> type;
+
+ /**
+ * Only trusted code creates a wrapper.
+ * @param i the wrapped iterator
+ * @param type the type of the elements within the checked list.
+ */
+ CheckedIterator(Iterator<E> i, Class<E> type)
+ {
+ this.i = i;
+ this.type = type;
+ }
+
+ /**
+ * Obtains the next element in the underlying collection.
+ *
+ * @return the next element in the collection.
+ * @throws NoSuchElementException if there are no more elements.
+ */
+ public E next()
+ {
+ return i.next();
+ }
+
+ /**
+ * Tests whether there are still elements to be retrieved from the
+ * underlying collection by <code>next()</code>. When this method
+ * returns <code>true</code>, an exception will not be thrown on calling
+ * <code>next()</code>.
+ *
+ * @return <code>true</code> if there is at least one more element in the
+ * underlying collection.
+ */
+ public boolean hasNext()
+ {
+ return i.hasNext();
+ }
+
+ /**
+ * Removes the next element from the collection.
+ */
+ public void remove()
+ {
+ i.remove();
+ }
+ } // class CheckedIterator
+
+ /**
+ * <p>
+ * Returns a dynamically typesafe view of the given list,
+ * where any modification is first checked to ensure that the type
+ * of the new data is appropriate. Although the addition of
+ * generics and parametrically-typed collections prevents an
+ * incorrect type of element being added to a collection at
+ * compile-time, via static type checking, this can be overridden by
+ * casting. In contrast, wrapping the collection within a
+ * dynamically-typesafe wrapper, using this and associated methods,
+ * <emph>guarantees</emph> that the collection will only contain
+ * elements of an appropriate type (provided it only contains such
+ * at the type of wrapping, and all subsequent access is via the
+ * wrapper). This can be useful for debugging the cause of a
+ * <code>ClassCastException</code> caused by erroneous casting, or
+ * for protecting collections from corruption by external libraries.
+ * </p>
+ * <p>
+ * The returned List implements Serializable, but can only be serialized if
+ * the list it wraps is likewise Serializable. In addition, if the wrapped
+ * list implements RandomAccess, this does too.
+ * </p>
+ *
+ * @param l the list to wrap
+ * @param type the type of the elements within the checked list.
+ * @return a dynamically typesafe view of the list
+ * @see Serializable
+ * @see RandomAccess
+ */
+ public static <E> List<E> checkedList(List<E> l, Class<E> type)
+ {
+ if (l instanceof RandomAccess)
+ return new CheckedRandomAccessList<E>(l, type);
+ return new CheckedList<E>(l, type);
+ }
+
+ /**
+ * The implementation of {@link #checkedList(List,Class)} for sequential
+ * lists. This class name is required for compatibility with Sun's JDK
+ * serializability.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+ private static class CheckedList<E>
+ extends CheckedCollection<E>
+ implements List<E>
+ {
+ /**
+ * Compatible with JDK 1.5.
+ */
+ private static final long serialVersionUID = 65247728283967356L;
+
+ /**
+ * The wrapped list; stored both here and in the superclass to avoid
+ * excessive casting. Package visible for use by subclass.
+ * @serial the wrapped list
+ */
+ final List<E> list;
+
+ /**
+ * Wrap a given list.
+ * @param l the list to wrap
+ * @param type the type of the elements within the checked list.
+ * @throws NullPointerException if l is null
+ */
+ CheckedList(List<E> l, Class<E> type)
+ {
+ super(l, type);
+ list = l;
+ }
+
+ /**
+ * Adds the supplied element to the underlying list at the specified
+ * index, provided it is of the right type.
+ *
+ * @param index The index at which to place the new element.
+ * @param o the object to add.
+ * @throws ClassCastException if the type of the object is not a
+ * valid type for the underlying collection.
+ */
+ public void add(int index, E o)
+ {
+ if (type.isInstance(o))
+ list.add(index, o);
+ else
+ throw new ClassCastException("The object is of the wrong type.");
+ }
+
+ /**
+ * Adds the members of the supplied collection to the underlying
+ * collection at the specified index, provided they are all of the
+ * correct type.
+ *
+ * @param index the index at which to place the new element.
+ * @param c the collections of objects to add.
+ * @throws ClassCastException if the type of any element in c is not a
+ * valid type for the underlying collection.
+ */
+ public boolean addAll(int index, Collection<? extends E> coll)
+ {
+ Collection<E> typedColl = (Collection<E>) coll;
+ for (E element : typedColl)
+ {
+ if (!type.isInstance(element))
+ throw new ClassCastException("A member of the collection is not of the correct type.");
+ }
+ return list.addAll(index, coll);
+ }
+
+ /**
+ * Returns <code>true</code> if the object, o, is an instance of
+ * <code>List</code> with the same size and elements
+ * as the underlying list.
+ *
+ * @param o The object to compare.
+ * @return <code>true</code> if o is equivalent to the underlying list.
+ */
+ public boolean equals(Object o)
+ {
+ return list.equals(o);
+ }
+
+ /**
+ * Retrieves the element at a given index in the underlying list.
+ *
+ * @param index the index of the element to be returned
+ * @return the element at the specified index in the underlying list
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
+ */
+ public E get(int index)
+ {
+ return list.get(index);
+ }
+
+ /**
+ * Computes the hash code for the underlying list.
+ * The exact computation is described in the documentation
+ * of the <code>List</code> interface.
+ *
+ * @return The hash code of the underlying list.
+ * @see List#hashCode()
+ */
+ public int hashCode()
+ {
+ return list.hashCode();
+ }
+
+ /**
+ * Obtain the first index at which a given object is to be found in the
+ * underlying list.
+ *
+ * @param o the object to search for
+ * @return the least integer n such that <code>o == null ? get(n) == null :
+ * o.equals(get(n))</code>, or -1 if there is no such index.
+ * @throws ClassCastException if the type of o is not a valid
+ * type for the underlying list.
+ * @throws NullPointerException if o is null and the underlying
+ * list does not support null values.
+ */
+ public int indexOf(Object o)
+ {
+ return list.indexOf(o);
+ }
+
+ /**
+ * Obtain the last index at which a given object is to be found in the
+ * underlying list.
+ *
+ * @return the greatest integer n such that
+ * <code>o == null ? get(n) == null : o.equals(get(n))</code>,
+ * or -1 if there is no such index.
+ * @throws ClassCastException if the type of o is not a valid
+ * type for the underlying list.
+ * @throws NullPointerException if o is null and the underlying
+ * list does not support null values.
+ */
+ public int lastIndexOf(Object o)
+ {
+ return list.lastIndexOf(o);
+ }
+
+ /**
+ * Obtains a list iterator over the underlying list, starting at the
+ * beginning and maintaining the checked nature of this list.
+ *
+ * @return a <code>CheckedListIterator</code> over the elements of the
+ * underlying list, in order, starting at the beginning.
+ */
+ public ListIterator<E> listIterator()
+ {
+ return new CheckedListIterator<E>(list.listIterator(), type);
+ }
+
+ /**
+ * Obtains a list iterator over the underlying list, starting at the
+ * specified index and maintaining the checked nature of this list. An
+ * initial call to <code>next()</code> will retrieve the element at the
+ * specified index, and an initial call to <code>previous()</code> will
+ * retrieve the element at index - 1.
+ *
+ * @param index the position, between 0 and size() inclusive, to begin the
+ * iteration from.
+ * @return a <code>CheckedListIterator</code> over the elements of the
+ * underlying list, in order, starting at the specified index.
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
+ */
+ public ListIterator<E> listIterator(int index)
+ {
+ return new CheckedListIterator<E>(list.listIterator(index), type);
+ }
+
+ /**
+ * Removes the element at the specified index.
+ *
+ * @param index The index of the element to remove.
+ * @return the removed element.
+ */
+ public E remove(int index)
+ {
+ return list.remove(index);
+ }
+
+ /**
+ * Replaces the element at the specified index in the underlying list
+ * with that supplied.
+ *
+ * @param index the index of the element to replace.
+ * @param o the new object to place at the specified index.
+ * @return the replaced element.
+ */
+ public E set(int index, E o)
+ {
+ return list.set(index, o);
+ }
+
+ /**
+ * Obtain a List view of a subsection of the underlying list, from
+ * fromIndex (inclusive) to toIndex (exclusive). If the two indices
+ * are equal, the sublist is empty. The returned list will be
+ * checked, like this list. Changes to the elements of the
+ * returned list will be reflected in the underlying list. The effect
+ * of structural modifications is undefined.
+ *
+ * @param fromIndex the index that the returned list should start from
+ * (inclusive).
+ * @param toIndex the index that the returned list should go
+ * to (exclusive).
+ * @return a List backed by a subsection of the underlying list.
+ * @throws IndexOutOfBoundsException if fromIndex &lt; 0
+ * || toIndex &gt; size() || fromIndex &gt; toIndex.
+ */
+ public List<E> subList(int fromIndex, int toIndex)
+ {
+ return checkedList(list.subList(fromIndex, toIndex), type);
+ }
+ } // class CheckedList
+
+ /**
+ * The implementation of {@link #checkedList(List)} for random-access
+ * lists. This class name is required for compatibility with Sun's JDK
+ * serializability.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+ private static final class CheckedRandomAccessList<E>
+ extends CheckedList<E>
+ implements RandomAccess
+ {
+ /**
+ * Compatible with JDK 1.5.
+ */
+ private static final long serialVersionUID = 1638200125423088369L;
+
+ /**
+ * Wrap a given list.
+ * @param l the list to wrap
+ * @param type the type of the elements within the checked list.
+ * @throws NullPointerException if l is null
+ */
+ CheckedRandomAccessList(List<E> l, Class<E> type)
+ {
+ super(l, type);
+ }
+ } // class CheckedRandomAccessList
+
+ /**
+ * The implementation of {@link CheckedList#listIterator()}.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+ private static final class CheckedListIterator<E>
+ extends CheckedIterator<E>
+ implements ListIterator<E>
+ {
+ /**
+ * The wrapped iterator, stored both here and in the superclass to
+ * avoid excessive casting.
+ */
+ private final ListIterator<E> li;
+
+ /**
+ * Only trusted code creates a wrapper.
+ * @param li the wrapped iterator
+ */
+ CheckedListIterator(ListIterator<E> li, Class<E> type)
+ {
+ super(li, type);
+ this.li = li;
+ }
+
+ /**
+ * Adds the supplied object at the current iterator position, provided
+ * it is of the correct type.
+ *
+ * @param o the object to add.
+ * @throws ClassCastException if the type of the object is not a
+ * valid type for the underlying collection.
+ */
+ public void add(E o)
+ {
+ if (type.isInstance(o))
+ li.add(o);
+ else
+ throw new ClassCastException("The object is of the wrong type.");
+ }
+
+ /**
+ * Tests whether there are still elements to be retrieved from the
+ * underlying collection by <code>previous()</code>. When this method
+ * returns <code>true</code>, an exception will not be thrown on calling
+ * <code>previous()</code>.
+ *
+ * @return <code>true</code> if there is at least one more element prior
+ * to the current position in the underlying list.
+ */
+ public boolean hasPrevious()
+ {
+ return li.hasPrevious();
+ }
+
+ /**
+ * Find the index of the element that would be returned by a call to next.
+ * If <code>hasNext()</code> returns <code>false</code>, this returns the
+ * list size.
+ *
+ * @return the index of the element that would be returned by
+ * <code>next()</code>.
+ */
+ public int nextIndex()
+ {
+ return li.nextIndex();
+ }
+
+ /**
+ * Obtains the previous element in the underlying list.
+ *
+ * @return the previous element in the list.
+ * @throws NoSuchElementException if there are no more prior elements.
+ */
+ public E previous()
+ {
+ return li.previous();
+ }
+
+ /**
+ * Find the index of the element that would be returned by a call to
+ * previous. If <code>hasPrevious()</code> returns <code>false</code>,
+ * this returns -1.
+ *
+ * @return the index of the element that would be returned by
+ * <code>previous()</code>.
+ */
+ public int previousIndex()
+ {
+ return li.previousIndex();
+ }
+
+ /**
+ * Sets the next element to that supplied, provided that it is of the
+ * correct type.
+ *
+ * @param o The new object to replace the existing one.
+ * @throws ClassCastException if the type of the object is not a
+ * valid type for the underlying collection.
+ */
+ public void set(E o)
+ {
+ if (type.isInstance(o))
+ li.set(o);
+ else
+ throw new ClassCastException("The object is of the wrong type.");
+ }
+ } // class CheckedListIterator
+
+ /**
+ * <p>
+ * Returns a dynamically typesafe view of the given map,
+ * where any modification is first checked to ensure that the type
+ * of the new data is appropriate. Although the addition of
+ * generics and parametrically-typed collections prevents an
+ * incorrect type of element being added to a collection at
+ * compile-time, via static type checking, this can be overridden by
+ * casting. In contrast, wrapping the collection within a
+ * dynamically-typesafe wrapper, using this and associated methods,
+ * <emph>guarantees</emph> that the collection will only contain
+ * elements of an appropriate type (provided it only contains such
+ * at the type of wrapping, and all subsequent access is via the
+ * wrapper). This can be useful for debugging the cause of a
+ * <code>ClassCastException</code> caused by erroneous casting, or
+ * for protecting collections from corruption by external libraries.
+ * </p>
+ * <p>
+ * The returned Map implements Serializable, but can only be serialized if
+ * the map it wraps is likewise Serializable.
+ * </p>
+ *
+ * @param m the map to wrap
+ * @param keyType the dynamic type of the map's keys.
+ * @param valueType the dynamic type of the map's values.
+ * @return a dynamically typesafe view of the map
+ * @see Serializable
+ */
+ public static <K, V> Map<K, V> checkedMap(Map<K, V> m, Class<K> keyType,
+ Class<V> valueType)
+ {
+ return new CheckedMap<K, V>(m, keyType, valueType);
+ }
+
+ /**
+ * The implementation of {@link #checkedMap(Map)}. This
+ * class name is required for compatibility with Sun's JDK serializability.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+ private static class CheckedMap<K, V>
+ implements Map<K, V>, Serializable
+ {
+ /**
+ * Compatible with JDK 1.5.
+ */
+ private static final long serialVersionUID = 5742860141034234728L;
+
+ /**
+ * The wrapped map.
+ * @serial the real map
+ */
+ private final Map<K, V> m;
+
+ /**
+ * The type of the map's keys.
+ * @serial the key type.
+ */
+ final Class<K> keyType;
+
+ /**
+ * The type of the map's values.
+ * @serial the value type.
+ */
+ final Class<V> valueType;
+
+ /**
+ * Cache the entry set.
+ */
+ private transient Set<Map.Entry<K, V>> entries;
+
+ /**
+ * Cache the key set.
+ */
+ private transient Set<K> keys;
+
+ /**
+ * Cache the value collection.
+ */
+ private transient Collection<V> values;
+
+ /**
+ * Wrap a given map.
+ * @param m the map to wrap
+ * @param keyType the dynamic type of the map's keys.
+ * @param valueType the dynamic type of the map's values.
+ * @throws NullPointerException if m is null
+ */
+ CheckedMap(Map<K, V> m, Class<K> keyType, Class<V> valueType)
+ {
+ this.m = m;
+ this.keyType = keyType;
+ this.valueType = valueType;
+ if (m == null)
+ throw new NullPointerException();
+ }
+
+ /**
+ * Clears all pairs from the map.
+ */
+ public void clear()
+ {
+ m.clear();
+ }
+
+ /**
+ * Returns <code>true</code> if the underlying map contains a mapping for
+ * the given key.
+ *
+ * @param key the key to search for
+ * @return <code>true</code> if the map contains the key
+ * @throws ClassCastException if the key is of an inappropriate type
+ * @throws NullPointerException if key is <code>null</code> but the map
+ * does not permit null keys
+ */
+ public boolean containsKey(Object key)
+ {
+ return m.containsKey(key);
+ }
+
+ /**
+ * Returns <code>true</code> if the underlying map contains at least one
+ * mapping with the given value. In other words, it returns
+ * <code>true</code> if a value v exists where
+ * <code>(value == null ? v == null : value.equals(v))</code>.
+ * This usually requires linear time.
+ *
+ * @param value the value to search for
+ * @return <code>true</code> if the map contains the value
+ * @throws ClassCastException if the type of the value is not a valid type
+ * for this map.
+ * @throws NullPointerException if the value is null and the map doesn't
+ * support null values.
+ */
+ public boolean containsValue(Object value)
+ {
+ return m.containsValue(value);
+ }
+
+ /**
+ * <p>
+ * Returns a checked set view of the entries in the underlying map.
+ * Each element in the set is a unmodifiable variant of
+ * <code>Map.Entry</code>.
+ * </p>
+ * <p>
+ * The set is backed by the map, so that changes in one show up in the
+ * other. Modifications made while an iterator is in progress cause
+ * undefined behavior.
+ * </p>
+ *
+ * @return the checked set view of all mapping entries.
+ * @see Map.Entry
+ */
+ public Set<Map.Entry<K, V>> entrySet()
+ {
+ if (entries == null)
+ {
+ Class<Map.Entry<K,V>> klass =
+ (Class<Map.Entry<K,V>>) (Class) Map.Entry.class;
+ entries = new CheckedEntrySet<Map.Entry<K,V>,K,V>(m.entrySet(),
+ klass,
+ keyType,
+ valueType);
+ }
+ return entries;
+ }
+
+ /**
+ * The implementation of {@link CheckedMap#entrySet()}. This class
+ * is <emph>not</emph> serializable.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+ private static final class CheckedEntrySet<E,SK,SV>
+ extends CheckedSet<E>
+ {
+ /**
+ * The type of the map's keys.
+ * @serial the key type.
+ */
+ private final Class<SK> keyType;
+
+ /**
+ * The type of the map's values.
+ * @serial the value type.
+ */
+ private final Class<SV> valueType;
+
+ /**
+ * Wrap a given set of map entries.
+ *
+ * @param s the set to wrap.
+ * @param type the type of the set's entries.
+ * @param keyType the type of the map's keys.
+ * @param valueType the type of the map's values.
+ */
+ CheckedEntrySet(Set<E> s, Class<E> type, Class<SK> keyType,
+ Class<SV> valueType)
+ {
+ super(s, type);
+ this.keyType = keyType;
+ this.valueType = valueType;
+ }
+
+ // The iterator must return checked map entries.
+ public Iterator<E> iterator()
+ {
+ return new CheckedIterator<E>(c.iterator(), type)
+ {
+ /**
+ * Obtains the next element from the underlying set of
+ * map entries.
+ *
+ * @return the next element in the collection.
+ * @throws NoSuchElementException if there are no more elements.
+ */
+ public E next()
+ {
+ final Map.Entry e = (Map.Entry) super.next();
+ return (E) new Map.Entry()
+ {
+ /**
+ * Returns <code>true</code> if the object, o, is also a map
+ * entry with an identical key and value.
+ *
+ * @param o the object to compare.
+ * @return <code>true</code> if o is an equivalent map entry.
+ */
+ public boolean equals(Object o)
+ {
+ return e.equals(o);
+ }
+
+ /**
+ * Returns the key of this map entry.
+ *
+ * @return the key.
+ */
+ public Object getKey()
+ {
+ return e.getKey();
+ }
+
+ /**
+ * Returns the value of this map entry.
+ *
+ * @return the value.
+ */
+ public Object getValue()
+ {
+ return e.getValue();
+ }
+
+ /**
+ * Computes the hash code of this map entry.
+ * The computation is described in the <code>Map</code>
+ * interface documentation.
+ *
+ * @return the hash code of this entry.
+ * @see Map#hashCode()
+ */
+ public int hashCode()
+ {
+ return e.hashCode();
+ }
+
+ /**
+ * Sets the value of this map entry, provided it is of the
+ * right type.
+ *
+ * @param value The new value.
+ * @throws ClassCastException if the type of the value is not
+ * a valid type for the underlying
+ * map.
+ */
+ public Object setValue(Object value)
+ {
+ if (valueType.isInstance(value))
+ return e.setValue(value);
+ else
+ throw new ClassCastException("The value is of the wrong type.");
+ }
+
+ /**
+ * Returns a textual representation of the map entry.
+ *
+ * @return The map entry as a <code>String</code>.
+ */
+ public String toString()
+ {
+ return e.toString();
+ }
+ };
+ }
+ };
+ }
+ } // class CheckedEntrySet
+
+ /**
+ * Returns <code>true</code> if the object, o, is also an instance
+ * of <code>Map</code> with an equal set of map entries.
+ *
+ * @param o The object to compare.
+ * @return <code>true</code> if o is an equivalent map.
+ */
+ public boolean equals(Object o)
+ {
+ return m.equals(o);
+ }
+
+ /**
+ * Returns the value associated with the supplied key or
+ * null if no such mapping exists. An ambiguity can occur
+ * if null values are accepted by the underlying map.
+ * In this case, <code>containsKey()</code> can be used
+ * to separate the two possible cases of a null result.
+ *
+ * @param key The key to look up.
+ * @return the value associated with the key, or null if key not in map.
+ * @throws ClassCastException if the key is an inappropriate type.
+ * @throws NullPointerException if this map does not accept null keys.
+ * @see #containsKey(Object)
+ */
+ public V get(Object key)
+ {
+ return m.get(key);
+ }
+
+ /**
+ * Adds a new pair to the map, provided both the key and the value are
+ * of the correct types.
+ *
+ * @param key The new key.
+ * @param value The new value.
+ * @return the previous value of the key, or null if there was no mapping.
+ * @throws ClassCastException if the type of the key or the value is
+ * not a valid type for the underlying map.
+ */
+ public V put(K key, V value)
+ {
+ if (keyType.isInstance(key))
+ {
+ if (valueType.isInstance(value))
+ return m.put(key,value);
+ else
+ throw new ClassCastException("The value is of the wrong type.");
+ }
+ throw new ClassCastException("The key is of the wrong type.");
+ }
+
+ /**
+ * Computes the hash code for the underlying map, as the sum
+ * of the hash codes of all entries.
+ *
+ * @return The hash code of the underlying map.
+ * @see Map.Entry#hashCode()
+ */
+ public int hashCode()
+ {
+ return m.hashCode();
+ }
+
+ /**
+ * Returns <code>true</code> if the underlying map contains no entries.
+ *
+ * @return <code>true</code> if the map is empty.
+ */
+ public boolean isEmpty()
+ {
+ return m.isEmpty();
+ }
+
+ /**
+ * <p>
+ * Returns a checked set view of the keys in the underlying map.
+ * The set is backed by the map, so that changes in one show up in the
+ * other.
+ * </p>
+ * <p>
+ * Modifications made while an iterator is in progress cause undefined
+ * behavior. These modifications are again limited to the values of
+ * the keys.
+ * </p>
+ *
+ * @return the set view of all keys.
+ */
+ public Set<K> keySet()
+ {
+ if (keys == null)
+ keys = new CheckedSet<K>(m.keySet(), keyType);
+ return keys;
+ }
+
+ /**
+ * Adds all pairs within the supplied map to the underlying map,
+ * provided they are all have the correct key and value types.
+ *
+ * @param m the map, the entries of which should be added
+ * to the underlying map.
+ * @throws ClassCastException if the type of a key or value is
+ * not a valid type for the underlying map.
+ */
+ public void putAll(Map<? extends K, ? extends V> map)
+ {
+ Map<K,V> typedMap = (Map<K,V>) map;
+ for (Map.Entry<K,V> entry : typedMap.entrySet())
+ {
+ if (!keyType.isInstance(entry.getKey()))
+ throw new ClassCastException("A key is of the wrong type.");
+ if (!valueType.isInstance(entry.getValue()))
+ throw new ClassCastException("A value is of the wrong type.");
+ }
+ m.putAll(typedMap);
+ }
+
+ /**
+ * Removes a pair from the map.
+ *
+ * @param o The key of the entry to remove.
+ * @return The value the key was associated with, or null
+ * if no such mapping existed. Null is also returned
+ * if the removed entry had a null key.
+ * @throws UnsupportedOperationException as an unmodifiable
+ * map does not support the <code>remove</code> operation.
+ */
+ public V remove(Object o)
+ {
+ return m.remove(o);
+ }
+
+
+ /**
+ * Returns the number of key-value mappings in the underlying map.
+ * If there are more than Integer.MAX_VALUE mappings, Integer.MAX_VALUE
+ * is returned.
+ *
+ * @return the number of mappings.
+ */
+ public int size()
+ {
+ return m.size();
+ }
+
+ /**
+ * Returns a textual representation of the map.
+ *
+ * @return The map in the form of a <code>String</code>.
+ */
+ public String toString()
+ {
+ return m.toString();
+ }
+
+ /**
+ * <p>
+ * Returns a unmodifiable collection view of the values in the underlying
+ * map. The collection is backed by the map, so that changes in one show
+ * up in the other.
+ * </p>
+ * <p>
+ * Modifications made while an iterator is in progress cause undefined
+ * behavior. These modifications are again limited to the values of
+ * the keys.
+ * </p>
+ *
+ * @return the collection view of all values.
+ */
+ public Collection<V> values()
+ {
+ if (values == null)
+ values = new CheckedCollection<V>(m.values(), valueType);
+ return values;
+ }
+ } // class CheckedMap
+
+ /**
+ * <p>
+ * Returns a dynamically typesafe view of the given set,
+ * where any modification is first checked to ensure that the type
+ * of the new data is appropriate. Although the addition of
+ * generics and parametrically-typed collections prevents an
+ * incorrect type of element being added to a collection at
+ * compile-time, via static type checking, this can be overridden by
+ * casting. In contrast, wrapping the collection within a
+ * dynamically-typesafe wrapper, using this and associated methods,
+ * <emph>guarantees</emph> that the collection will only contain
+ * elements of an appropriate type (provided it only contains such
+ * at the type of wrapping, and all subsequent access is via the
+ * wrapper). This can be useful for debugging the cause of a
+ * <code>ClassCastException</code> caused by erroneous casting, or
+ * for protecting collections from corruption by external libraries.
+ * </p>
+ * <p>
+ * The returned Set implements Serializable, but can only be serialized if
+ * the set it wraps is likewise Serializable.
+ * </p>
+ *
+ * @param s the set to wrap.
+ * @param type the type of the elements within the checked list.
+ * @return a dynamically typesafe view of the set
+ * @see Serializable
+ */
+ public static <E> Set<E> checkedSet(Set<E> s, Class<E> type)
+ {
+ return new CheckedSet<E>(s, type);
+ }
+
+ /**
+ * The implementation of {@link #checkedSet(Set)}. This class
+ * name is required for compatibility with Sun's JDK serializability.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+ private static class CheckedSet<E>
+ extends CheckedCollection<E>
+ implements Set<E>
+ {
+ /**
+ * Compatible with JDK 1.5.
+ */
+ private static final long serialVersionUID = 4694047833775013803L;
+
+ /**
+ * Wrap a given set.
+ *
+ * @param s the set to wrap
+ * @throws NullPointerException if s is null
+ */
+ CheckedSet(Set<E> s, Class<E> type)
+ {
+ super(s, type);
+ }
+
+ /**
+ * Returns <code>true</code> if the object, o, is also an instance of
+ * <code>Set</code> of the same size and with the same entries.
+ *
+ * @return <code>true</code> if o is an equivalent set.
+ */
+ public boolean equals(Object o)
+ {
+ return c.equals(o);
+ }
+
+ /**
+ * Computes the hash code of this set, as the sum of the
+ * hash codes of all elements within the set.
+ *
+ * @return the hash code of the set.
+ */
+ public int hashCode()
+ {
+ return c.hashCode();
+ }
+ } // class CheckedSet
+
+ /**
+ * <p>
+ * Returns a dynamically typesafe view of the given sorted map,
+ * where any modification is first checked to ensure that the type
+ * of the new data is appropriate. Although the addition of
+ * generics and parametrically-typed collections prevents an
+ * incorrect type of element being added to a collection at
+ * compile-time, via static type checking, this can be overridden by
+ * casting. In contrast, wrapping the collection within a
+ * dynamically-typesafe wrapper, using this and associated methods,
+ * <emph>guarantees</emph> that the collection will only contain
+ * elements of an appropriate type (provided it only contains such
+ * at the type of wrapping, and all subsequent access is via the
+ * wrapper). This can be useful for debugging the cause of a
+ * <code>ClassCastException</code> caused by erroneous casting, or
+ * for protecting collections from corruption by external libraries.
+ * </p>
+ * <p>
+ * The returned SortedMap implements Serializable, but can only be
+ * serialized if the map it wraps is likewise Serializable.
+ * </p>
+ *
+ * @param m the map to wrap.
+ * @param keyType the dynamic type of the map's keys.
+ * @param valueType the dynamic type of the map's values.
+ * @return a dynamically typesafe view of the map
+ * @see Serializable
+ */
+ public static <K, V> SortedMap<K, V> checkedSortedMap(SortedMap<K, V> m,
+ Class<K> keyType,
+ Class<V> valueType)
+ {
+ return new CheckedSortedMap<K, V>(m, keyType, valueType);
+ }
+
+ /**
+ * The implementation of {@link #checkedSortedMap(SortedMap,Class,Class)}.
+ * This class name is required for compatibility with Sun's JDK
+ * serializability.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ */
+ private static class CheckedSortedMap<K, V>
+ extends CheckedMap<K, V>
+ implements SortedMap<K, V>
+ {
+ /**
+ * Compatible with JDK 1.5.
+ */
+ private static final long serialVersionUID = 1599671320688067438L;
+
+ /**
+ * The wrapped map; stored both here and in the superclass to avoid
+ * excessive casting.
+ * @serial the wrapped map
+ */
+ private final SortedMap<K, V> sm;
+
+ /**
+ * Wrap a given map.
+ *
+ * @param sm the map to wrap
+ * @param keyType the dynamic type of the map's keys.
+ * @param valueType the dynamic type of the map's values.
+ * @throws NullPointerException if sm is null
+ */
+ CheckedSortedMap(SortedMap<K, V> sm, Class<K> keyType, Class<V> valueType)
+ {
+ super(sm, keyType, valueType);
+ this.sm = sm;
+ }
+
+ /**
+ * Returns the comparator used in sorting the underlying map,
+ * or null if it is the keys' natural ordering.
+ *
+ * @return the sorting comparator.
+ */
+ public Comparator<? super K> comparator()
+ {
+ return sm.comparator();
+ }
+
+ /**
+ * Returns the first (lowest sorted) key in the map.
+ *
+ * @return the first key.
+ * @throws NoSuchElementException if this map is empty.
+ */
+ public K firstKey()
+ {
+ return sm.firstKey();
+ }
+
+ /**
+ * <p>
+ * Returns a checked view of the portion of the map strictly less
+ * than toKey. The view is backed by the underlying map, so changes in
+ * one show up in the other. The submap supports all optional operations
+ * of the original. This operation is equivalent to
+ * <code>subMap(firstKey(), toKey)</code>.
+ * </p>
+ * <p>
+ * The returned map throws an IllegalArgumentException any time a key is
+ * used which is out of the range of toKey. Note that the endpoint, toKey,
+ * is not included; if you want this value to be included, pass its
+ * successor object in to toKey. For example, for Integers, you could
+ * request <code>headMap(new Integer(limit.intValue() + 1))</code>.
+ * </p>
+ *
+ * @param toKey the exclusive upper range of the submap.
+ * @return the submap.
+ * @throws ClassCastException if toKey is not comparable to the map
+ * contents.
+ * @throws IllegalArgumentException if this is a subMap, and toKey is out
+ * of range.
+ * @throws NullPointerException if toKey is null but the map does not allow
+ * null keys.
+ */
+ public SortedMap<K, V> headMap(K toKey)
+ {
+ return new CheckedSortedMap<K, V>(sm.headMap(toKey), keyType, valueType);
+ }
+
+ /**
+ * Returns the last (highest sorted) key in the map.
+ *
+ * @return the last key.
+ * @throws NoSuchElementException if this map is empty.
+ */
+ public K lastKey()
+ {
+ return sm.lastKey();
+ }
+
+ /**
+ * <p>
+ * Returns a checked view of the portion of the map greater than or
+ * equal to fromKey, and strictly less than toKey. The view is backed by
+ * the underlying map, so changes in one show up in the other. The submap
+ * supports all optional operations of the original.
+ * </p>
+ * <p>
+ * The returned map throws an IllegalArgumentException any time a key is
+ * used which is out of the range of fromKey and toKey. Note that the
+ * lower endpoint is included, but the upper is not; if you want to
+ * change the inclusion or exclusion of an endpoint, pass its successor
+ * object in instead. For example, for Integers, you could request
+ * <code>subMap(new Integer(lowlimit.intValue() + 1),
+ * new Integer(highlimit.intValue() + 1))</code> to reverse
+ * the inclusiveness of both endpoints.
+ * </p>
+ *
+ * @param fromKey the inclusive lower range of the submap.
+ * @param toKey the exclusive upper range of the submap.
+ * @return the submap.
+ * @throws ClassCastException if fromKey or toKey is not comparable to
+ * the map contents.
+ * @throws IllegalArgumentException if this is a subMap, and fromKey or
+ * toKey is out of range.
+ * @throws NullPointerException if fromKey or toKey is null but the map
+ * does not allow null keys.
+ */
+ public SortedMap<K, V> subMap(K fromKey, K toKey)
+ {
+ return new CheckedSortedMap<K, V>(sm.subMap(fromKey, toKey), keyType,
+ valueType);
+ }
+
+ /**
+ * <p>
+ * Returns a checked view of the portion of the map greater than or
+ * equal to fromKey. The view is backed by the underlying map, so changes
+ * in one show up in the other. The submap supports all optional operations
+ * of the original.
+ * </p>
+ * <p>
+ * The returned map throws an IllegalArgumentException any time a key is
+ * used which is out of the range of fromKey. Note that the endpoint,
+ * fromKey, is included; if you do not want this value to be included,
+ * pass its successor object in to fromKey. For example, for Integers,
+ * you could request
+ * <code>tailMap(new Integer(limit.intValue() + 1))</code>.
+ * </p>
+ *
+ * @param fromKey the inclusive lower range of the submap
+ * @return the submap
+ * @throws ClassCastException if fromKey is not comparable to the map
+ * contents
+ * @throws IllegalArgumentException if this is a subMap, and fromKey is out
+ * of range
+ * @throws NullPointerException if fromKey is null but the map does not
+ * allow null keys
+ */
+ public SortedMap<K, V> tailMap(K fromKey)
+ {
+ return new CheckedSortedMap<K, V>(sm.tailMap(fromKey), keyType,
+ valueType);
+ }
+ } // class CheckedSortedMap
+
+ /**
+ * <p>
+ * Returns a dynamically typesafe view of the given sorted set,
+ * where any modification is first checked to ensure that the type
+ * of the new data is appropriate. Although the addition of
+ * generics and parametrically-typed collections prevents an
+ * incorrect type of element being added to a collection at
+ * compile-time, via static type checking, this can be overridden by
+ * casting. In contrast, wrapping the collection within a
+ * dynamically-typesafe wrapper, using this and associated methods,
+ * <emph>guarantees</emph> that the collection will only contain
+ * elements of an appropriate type (provided it only contains such
+ * at the type of wrapping, and all subsequent access is via the
+ * wrapper). This can be useful for debugging the cause of a
+ * <code>ClassCastException</code> caused by erroneous casting, or
+ * for protecting collections from corruption by external libraries.
+ * </p>
+ * <p>
+ * The returned SortedSet implements Serializable, but can only be
+ * serialized if the set it wraps is likewise Serializable.
+ * </p>
+ *
+ * @param s the set to wrap.
+ * @param type the type of the set's elements.
+ * @return a dynamically typesafe view of the set
+ * @see Serializable
+ */
+ public static <E> SortedSet<E> checkedSortedSet(SortedSet<E> s,
+ Class<E> type)
+ {
+ return new CheckedSortedSet<E>(s, type);
+ }
+
+ /**
+ * The implementation of {@link #checkedSortedSet(SortedSet,Class)}. This
+ * class name is required for compatibility with Sun's JDK serializability.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+ private static class CheckedSortedSet<E>
+ extends CheckedSet<E>
+ implements SortedSet<E>
+ {
+ /**
+ * Compatible with JDK 1.4.
+ */
+ private static final long serialVersionUID = 1599911165492914959L;
+
+ /**
+ * The wrapped set; stored both here and in the superclass to avoid
+ * excessive casting.
+ *
+ * @serial the wrapped set
+ */
+ private SortedSet<E> ss;
+
+ /**
+ * Wrap a given set.
+ *
+ * @param ss the set to wrap.
+ * @param type the type of the set's elements.
+ * @throws NullPointerException if ss is null
+ */
+ CheckedSortedSet(SortedSet<E> ss, Class<E> type)
+ {
+ super(ss, type);
+ this.ss = ss;
+ }
+
+ /**
+ * Returns the comparator used in sorting the underlying set,
+ * or null if it is the elements' natural ordering.
+ *
+ * @return the sorting comparator
+ */
+ public Comparator<? super E> comparator()
+ {
+ return ss.comparator();
+ }
+
+ /**
+ * Returns the first (lowest sorted) element in the underlying
+ * set.
+ *
+ * @return the first element.
+ * @throws NoSuchElementException if the set is empty.
+ */
+ public E first()
+ {
+ return ss.first();
+ }
+
+ /**
+ * <p>
+ * Returns a checked view of the portion of the set strictly
+ * less than toElement. The view is backed by the underlying set,
+ * so changes in one show up in the other. The subset supports
+ * all optional operations of the original. This operation
+ * is equivalent to <code>subSet(first(), toElement)</code>.
+ * </p>
+ * <p>
+ * The returned set throws an IllegalArgumentException any time an
+ * element is used which is out of the range of toElement. Note that
+ * the endpoint, toElement, is not included; if you want this value
+ * included, pass its successor object in to toElement. For example,
+ * for Integers, you could request
+ * <code>headSet(new Integer(limit.intValue() + 1))</code>.
+ * </p>
+ *
+ * @param toElement the exclusive upper range of the subset
+ * @return the subset.
+ * @throws ClassCastException if toElement is not comparable to the set
+ * contents.
+ * @throws IllegalArgumentException if this is a subSet, and toElement is
+ * out of range.
+ * @throws NullPointerException if toElement is null but the set does not
+ * allow null elements.
+ */
+ public SortedSet<E> headSet(E toElement)
+ {
+ return new CheckedSortedSet<E>(ss.headSet(toElement), type);
+ }
+
+ /**
+ * Returns the last (highest sorted) element in the underlying
+ * set.
+ *
+ * @return the last element.
+ * @throws NoSuchElementException if the set is empty.
+ */
+ public E last()
+ {
+ return ss.last();
+ }
+
+ /**
+ * <p>
+ * Returns a checked view of the portion of the set greater than or
+ * equal to fromElement, and strictly less than toElement. The view is
+ * backed by the underlying set, so changes in one show up in the other.
+ * The subset supports all optional operations of the original.
+ * </p>
+ * <p>
+ * The returned set throws an IllegalArgumentException any time an
+ * element is used which is out of the range of fromElement and toElement.
+ * Note that the lower endpoint is included, but the upper is not; if you
+ * want to change the inclusion or exclusion of an endpoint, pass its
+ * successor object in instead. For example, for Integers, you can request
+ * <code>subSet(new Integer(lowlimit.intValue() + 1),
+ * new Integer(highlimit.intValue() + 1))</code> to reverse
+ * the inclusiveness of both endpoints.
+ * </p>
+ *
+ * @param fromElement the inclusive lower range of the subset.
+ * @param toElement the exclusive upper range of the subset.
+ * @return the subset.
+ * @throws ClassCastException if fromElement or toElement is not comparable
+ * to the set contents.
+ * @throws IllegalArgumentException if this is a subSet, and fromElement or
+ * toElement is out of range.
+ * @throws NullPointerException if fromElement or toElement is null but the
+ * set does not allow null elements.
+ */
+ public SortedSet<E> subSet(E fromElement, E toElement)
+ {
+ return new CheckedSortedSet<E>(ss.subSet(fromElement, toElement), type);
+ }
+
+ /**
+ * <p>
+ * Returns a checked view of the portion of the set greater than or equal
+ * to fromElement. The view is backed by the underlying set, so changes in
+ * one show up in the other. The subset supports all optional operations
+ * of the original.
+ * </p>
+ * <p>
+ * The returned set throws an IllegalArgumentException any time an
+ * element is used which is out of the range of fromElement. Note that
+ * the endpoint, fromElement, is included; if you do not want this value
+ * to be included, pass its successor object in to fromElement. For
+ * example, for Integers, you could request
+ * <code>tailSet(new Integer(limit.intValue() + 1))</code>.
+ * </p>
+ *
+ * @param fromElement the inclusive lower range of the subset
+ * @return the subset.
+ * @throws ClassCastException if fromElement is not comparable to the set
+ * contents.
+ * @throws IllegalArgumentException if this is a subSet, and fromElement is
+ * out of range.
+ * @throws NullPointerException if fromElement is null but the set does not
+ * allow null elements.
+ */
+ public SortedSet<E> tailSet(E fromElement)
+ {
+ return new CheckedSortedSet<E>(ss.tailSet(fromElement), type);
+ }
+ } // class CheckedSortedSet
+
} // class Collections
diff --git a/libjava/classpath/java/util/Comparator.java b/libjava/classpath/java/util/Comparator.java
index 386bdc1d6a2..ca414e7b13f 100644
--- a/libjava/classpath/java/util/Comparator.java
+++ b/libjava/classpath/java/util/Comparator.java
@@ -1,5 +1,5 @@
/* Comparator.java -- Interface for objects that specify an ordering
- Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -71,7 +71,7 @@ package java.util;
* @since 1.2
* @status updated to 1.4
*/
-public interface Comparator
+public interface Comparator<T>
{
/**
* Return an integer that is negative, zero or positive depending on whether
@@ -102,7 +102,7 @@ public interface Comparator
* @throws ClassCastException if the elements are not of types that can be
* compared by this ordering.
*/
- int compare(Object o1, Object o2);
+ int compare(T o1, T o2);
/**
* Return true if the object is equal to this object. To be
diff --git a/libjava/classpath/java/util/Date.java b/libjava/classpath/java/util/Date.java
index aecca29b39e..5c43bf3c154 100644
--- a/libjava/classpath/java/util/Date.java
+++ b/libjava/classpath/java/util/Date.java
@@ -108,7 +108,7 @@ import java.text.SimpleDateFormat;
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
public class Date
- implements Cloneable, Comparable, Serializable
+ implements Cloneable, Comparable<Date>, Serializable
{
/**
* This is the serialization UID for this class
@@ -354,24 +354,6 @@ public class Date
}
/**
- * Compares this Date to another object. This behaves like
- * <code>compareTo(Date)</code>, but it takes a generic object
- * and throws a <code>ClassCastException</code> if obj is
- * not a <code>Date</code>.
- *
- * @param obj the other date.
- * @return 0, if the date represented
- * by obj is exactly the same as the time represented by this
- * object, a negative if this Date is before the other Date, and
- * a positive value otherwise.
- * @exception ClassCastException if obj is not of type Date.
- */
- public int compareTo(Object obj)
- {
- return compareTo((Date) obj);
- }
-
- /**
* Computes the hash code of this <code>Date</code> as the
* XOR of the most significant and the least significant
* 32 bits of the 64 bit milliseconds value.
diff --git a/libjava/classpath/java/util/Dictionary.java b/libjava/classpath/java/util/Dictionary.java
index 0d44ab67de1..7b82a9f644d 100644
--- a/libjava/classpath/java/util/Dictionary.java
+++ b/libjava/classpath/java/util/Dictionary.java
@@ -1,6 +1,6 @@
/* Dictionary.java -- an abstract (and essentially worthless)
class which is Hashtable's superclass
- Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,7 +57,7 @@ package java.util;
* @since 1.0
* @status updated to 1.4
*/
-public abstract class Dictionary
+public abstract class Dictionary<K, V>
{
// WARNING: Dictionary is a CORE class in the bootstrap cycle. See the
// comments in vm/reference/java/lang/Runtime for implications of this fact.
@@ -75,7 +75,7 @@ public abstract class Dictionary
* @return an Enumeration of the values
* @see #keys()
*/
- public abstract Enumeration elements();
+ public abstract Enumeration<V> elements();
/**
* Returns the value associated with the supplied key, or null
@@ -87,7 +87,7 @@ public abstract class Dictionary
* @throws NullPointerException if key is null
* @see #put(Object, Object)
*/
- public abstract Object get(Object key);
+ public abstract V get(Object key);
/**
* Returns true when there are no elements in this Dictionary.
@@ -102,7 +102,7 @@ public abstract class Dictionary
* @return an Enumeration of the keys
* @see #elements()
*/
- public abstract Enumeration keys();
+ public abstract Enumeration<K> keys();
/**
* Inserts a new value into this Dictionary, located by the
@@ -115,7 +115,7 @@ public abstract class Dictionary
* @throws NullPointerException if key or value is null
* @see #get(Object)
*/
- public abstract Object put(Object key, Object value);
+ public abstract V put(K key, V value);
/**
* Removes from the Dictionary the value located by the given key. A null
@@ -125,7 +125,7 @@ public abstract class Dictionary
* @return the value associated with the removed key
* @throws NullPointerException if key is null
*/
- public abstract Object remove(Object key);
+ public abstract V remove(Object key);
/**
* Returns the number of values currently in this Dictionary.
diff --git a/libjava/classpath/java/util/EnumMap.java b/libjava/classpath/java/util/EnumMap.java
new file mode 100644
index 00000000000..477dff8e0ab
--- /dev/null
+++ b/libjava/classpath/java/util/EnumMap.java
@@ -0,0 +1,394 @@
+/* EnumMap.java - Map where keys are enum constants
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.util;
+
+import java.io.Serializable;
+
+/**
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+
+public class EnumMap<K extends Enum<K>, V>
+ extends AbstractMap<K, V>
+ implements Cloneable, Serializable
+{
+ private static final long serialVersionUID = 458661240069192865L;
+
+ V[] store;
+ int cardinality;
+ Class<K> enumClass;
+
+ /**
+ * The cache for {@link #entrySet()}.
+ */
+ transient Set<Map.Entry<K, V>> entries;
+
+ static final Object emptySlot = new Object();
+
+ public EnumMap(Class<K> keyType)
+ {
+ store = (V[]) new Object[keyType.getEnumConstants().length];
+ Arrays.fill(store, emptySlot);
+ cardinality = 0;
+ enumClass = keyType;
+ }
+
+ public EnumMap(EnumMap<K, ? extends V> map)
+ {
+ store = (V[]) map.store.clone();
+ cardinality = map.cardinality;
+ enumClass = map.enumClass;
+ }
+
+ public EnumMap(Map<K, ? extends V> map)
+ {
+ if (map instanceof EnumMap)
+ {
+ EnumMap<K, ? extends V> other = (EnumMap<K, ? extends V>) map;
+ store = (V[]) other.store.clone();
+ cardinality = other.cardinality;
+ enumClass = other.enumClass;
+ }
+ else
+ {
+ for (K key : map.keySet())
+ {
+ V value = map.get(key);
+ if (store == null)
+ {
+ enumClass = key.getDeclaringClass();
+ store = (V[]) new Object[enumClass.getEnumConstants().length];
+ }
+ int o = key.ordinal();
+ if (store[o] == emptySlot)
+ ++cardinality;
+ store[o] = value;
+ }
+ // There must be a single element.
+ if (store == null)
+ throw new IllegalArgumentException("no elements in map");
+ }
+ }
+
+ public int size()
+ {
+ return cardinality;
+ }
+
+ public boolean containsValue(Object value)
+ {
+ for (V i : store)
+ {
+ if (i != emptySlot && AbstractCollection.equals(i , value))
+ return true;
+ }
+ return false;
+ }
+
+ public boolean containsKey(Object key)
+ {
+ if (! (key instanceof Enum))
+ return false;
+ Enum<K> e = (Enum<K>) key;
+ if (e.getDeclaringClass() != enumClass)
+ return false;
+ return store[e.ordinal()] != emptySlot;
+ }
+
+ public V get(Object key)
+ {
+ if (! (key instanceof Enum))
+ return null;
+ Enum<K> e = (Enum<K>) key;
+ if (e.getDeclaringClass() != enumClass)
+ return null;
+ return store[e.ordinal()];
+ }
+
+ public V put(K key, V value)
+ {
+ int o = key.ordinal();
+ V result;
+ if (store[o] == emptySlot)
+ {
+ result = null;
+ ++cardinality;
+ }
+ else
+ result = store[o];
+ store[o] = value;
+ return result;
+ }
+
+ public V remove(Object key)
+ {
+ if (! (key instanceof Enum))
+ return null;
+ Enum<K> e = (Enum<K>) key;
+ if (e.getDeclaringClass() != enumClass)
+ return null;
+ V result = store[e.ordinal()];
+ if (result == emptySlot)
+ result = null;
+ else
+ --cardinality;
+ store[e.ordinal()] = (V) emptySlot;
+ return result;
+ }
+
+ public void putAll(Map<? extends K, ? extends V> map)
+ {
+ for (K key : map.keySet())
+ {
+ V value = map.get(key);
+
+ int o = key.ordinal();
+ if (store[o] == emptySlot)
+ ++cardinality;
+ store[o] = value;
+ }
+ }
+
+ public void clear()
+ {
+ Arrays.fill(store, emptySlot);
+ cardinality = 0;
+ }
+
+ public Set<K> keySet()
+ {
+ if (keys == null)
+ {
+ keys = new AbstractSet<K>()
+ {
+ public int size()
+ {
+ return cardinality;
+ }
+
+ public Iterator<K> iterator()
+ {
+ return new Iterator<K>()
+ {
+ int count = 0;
+ int index = -1;
+
+ public boolean hasNext()
+ {
+ return count < cardinality;
+ }
+
+ public K next()
+ {
+ ++count;
+ for (++index; store[index] == emptySlot; ++index)
+ ;
+ return enumClass.getEnumConstants()[index];
+ }
+
+ public void remove()
+ {
+ --cardinality;
+ store[index] = (V) emptySlot;
+ }
+ };
+ }
+
+ public void clear()
+ {
+ EnumMap.this.clear();
+ }
+
+ public boolean contains(Object o)
+ {
+ return contains(o);
+ }
+
+ public boolean remove(Object o)
+ {
+ return EnumMap.this.remove(o) != null;
+ }
+ };
+ }
+ return keys;
+ }
+
+ public Collection<V> values()
+ {
+ if (values == null)
+ {
+ values = new AbstractCollection<V>()
+ {
+ public int size()
+ {
+ return cardinality;
+ }
+
+ public Iterator<V> iterator()
+ {
+ return new Iterator<V>()
+ {
+ int count = 0;
+ int index = -1;
+
+ public boolean hasNext()
+ {
+ return count < cardinality;
+ }
+
+ public V next()
+ {
+ ++count;
+ for (++index; store[index] == emptySlot; ++index)
+ ;
+ return store[index];
+ }
+
+ public void remove()
+ {
+ --cardinality;
+ store[index] = (V) emptySlot;
+ }
+ };
+ }
+
+ public void clear()
+ {
+ EnumMap.this.clear();
+ }
+ };
+ }
+ return values;
+ }
+
+ public Set<Map.Entry<K, V>> entrySet()
+ {
+ if (entries == null)
+ {
+ entries = new AbstractSet<Map.Entry<K, V>>()
+ {
+ public int size()
+ {
+ return cardinality;
+ }
+
+ public Iterator<Map.Entry<K, V>> iterator()
+ {
+ return new Iterator<Map.Entry<K, V>>()
+ {
+ int count = 0;
+ int index = -1;
+
+ public boolean hasNext()
+ {
+ return count < cardinality;
+ }
+
+ public Map.Entry<K,V> next()
+ {
+ ++count;
+ for (++index; store[index] == emptySlot; ++index)
+ ;
+ // FIXME: we could just return something that
+ // only knows the index. That would be cleaner.
+ return new AbstractMap.SimpleEntry<K, V>(enumClass.getEnumConstants()[index],
+ store[index])
+ {
+ public V setValue(V newVal)
+ {
+ value = newVal;
+ return put(key, newVal);
+ }
+ };
+ }
+
+ public void remove()
+ {
+ --cardinality;
+ store[index] = (V) emptySlot;
+ }
+ };
+ }
+
+ public void clear()
+ {
+ EnumMap.this.clear();
+ }
+
+ public boolean contains(Object o)
+ {
+ if (! (o instanceof Map.Entry))
+ return false;
+ Map.Entry<K, V> other = (Map.Entry<K, V>) o;
+ return (containsKey(other.getKey())
+ && AbstractCollection.equals(get(other.getKey()),
+ other.getValue()));
+ }
+
+ public boolean remove(Object o)
+ {
+ if (! (o instanceof Map.Entry))
+ return false;
+ Map.Entry<K, V> other = (Map.Entry<K, V>) o;
+ return EnumMap.this.remove(other.getKey()) != null;
+ }
+ };
+ }
+ return entries;
+ }
+
+ public boolean equals(Object o)
+ {
+ if (! (o instanceof EnumMap))
+ return false;
+ EnumMap<K, V> other = (EnumMap<K, V>) o;
+ if (other.enumClass != enumClass || other.cardinality != cardinality)
+ return false;
+ return Arrays.equals(store, other.store);
+ }
+
+ public EnumMap<K, V> clone()
+ {
+ /* This constructor provides this functionality */
+ return new EnumMap(this);
+ }
+
+}
diff --git a/libjava/classpath/java/util/EnumSet.java b/libjava/classpath/java/util/EnumSet.java
new file mode 100644
index 00000000000..44ae370ba0b
--- /dev/null
+++ b/libjava/classpath/java/util/EnumSet.java
@@ -0,0 +1,365 @@
+/* EnumSet.java - Set of enum objects
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.util;
+
+import java.io.Serializable;
+
+/**
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+
+// FIXME: serialization is special.
+public class EnumSet<T extends Enum<T>>
+ extends AbstractSet<T>
+ implements Cloneable, Serializable
+{
+ private static final long serialVersionUID = 4782406773684236311L;
+
+ BitSet store;
+ int cardinality;
+ Class<T> enumClass;
+
+ EnumSet()
+ {
+ }
+
+ public EnumSet<T> clone()
+ {
+ EnumSet<T> r;
+
+ try
+ {
+ r = (EnumSet<T>) super.clone();
+ }
+ catch (CloneNotSupportedException _)
+ {
+ /* Can't happen */
+ return null;
+ }
+ r.store = (BitSet) store.clone();
+ return r;
+ }
+
+ public int size()
+ {
+ return cardinality;
+ }
+
+ public Iterator<T> iterator()
+ {
+ return new Iterator<T>()
+ {
+ int next = -1;
+ int count = 0;
+
+ public boolean hasNext()
+ {
+ return count < cardinality;
+ }
+
+ public T next()
+ {
+ next = store.nextSetBit(next + 1);
+ ++count;
+ return enumClass.getEnumConstants()[next];
+ }
+
+ public void remove()
+ {
+ if (! store.get(next))
+ {
+ store.clear(next);
+ --cardinality;
+ }
+ }
+ };
+ }
+
+ public boolean add(T val)
+ {
+ if (store.get(val.ordinal()))
+ return false;
+ store.set(val.ordinal());
+ ++cardinality;
+ return true;
+ }
+
+ public boolean addAll(Collection<? extends T> c)
+ {
+ boolean result = false;
+ if (c instanceof EnumSet)
+ {
+ EnumSet<T> other = (EnumSet<T>) c;
+ if (enumClass == other.enumClass)
+ {
+ store.or(other.store);
+ int save = cardinality;
+ cardinality = store.cardinality();
+ result = save != cardinality;
+ }
+ }
+ else
+ {
+ for (T val : c)
+ {
+ if (add (val))
+ result = true;
+ }
+ }
+ return result;
+ }
+
+ public void clear()
+ {
+ store.clear();
+ cardinality = 0;
+ }
+
+ public boolean contains(Object o)
+ {
+ if (! (o instanceof Enum))
+ return false;
+ Enum<T> e = (Enum<T>) o;
+ if (e.getDeclaringClass() != enumClass)
+ return false;
+ return store.get(e.ordinal());
+ }
+
+ public boolean containsAll(Collection<?> c)
+ {
+ if (c instanceof EnumSet)
+ {
+ EnumSet<T> other = (EnumSet<T>) c;
+ if (enumClass == other.enumClass)
+ return store.containsAll(other.store);
+ return false;
+ }
+ return super.containsAll(c);
+ }
+
+ public boolean remove(Object o)
+ {
+ if (! (o instanceof Enum))
+ return false;
+ Enum<T> e = (Enum<T>) o;
+ if (e.getDeclaringClass() != enumClass)
+ return false;
+ store.clear(e.ordinal());
+ --cardinality;
+ return true;
+ }
+
+ public boolean removeAll(Collection<?> c)
+ {
+ if (c instanceof EnumSet)
+ {
+ EnumSet<T> other = (EnumSet<T>) c;
+ if (enumClass != other.enumClass)
+ return false;
+ store.andNot(other.store);
+ int save = cardinality;
+ cardinality = store.cardinality();
+ return save != cardinality;
+ }
+ return super.removeAll(c);
+ }
+
+ public boolean retainAll(Collection<?> c)
+ {
+ if (c instanceof EnumSet)
+ {
+ EnumSet<T> other = (EnumSet<T>) c;
+ if (enumClass != other.enumClass)
+ return false;
+ store.and(other.store);
+ int save = cardinality;
+ cardinality = store.cardinality();
+ return save != cardinality;
+ }
+ return super.retainAll(c);
+ }
+
+ public static <T extends Enum<T>> EnumSet<T> allOf(Class<T> eltType)
+ {
+ EnumSet<T> r = new EnumSet<T>();
+ r.store = new BitSet(eltType.getEnumConstants().length);
+ r.store.set(0, r.store.size());
+ r.cardinality = r.store.size();
+ r.enumClass = eltType;
+ return r;
+ }
+
+ public static <T extends Enum<T>> EnumSet<T> noneOf(Class<T> eltType)
+ {
+ EnumSet<T> r = new EnumSet<T>();
+ r.store = new BitSet(eltType.getEnumConstants().length);
+ r.enumClass = eltType;
+ return r;
+ }
+
+ public static <T extends Enum<T>> EnumSet<T> copyOf(EnumSet<T> other)
+ {
+ // We can't just use `other.clone' since we don't want to make a
+ // subclass.
+ EnumSet<T> r = new EnumSet<T>();
+ r.store = (BitSet) other.store.clone();
+ r.cardinality = other.cardinality;
+ r.enumClass = other.enumClass;
+ return r;
+ }
+
+ public static <T extends Enum<T>> EnumSet<T> copyOf(Collection<T> other)
+ {
+ if (other instanceof EnumSet)
+ return copyOf((EnumSet<T>) other);
+ EnumSet<T> r = new EnumSet<T>();
+ for (T val : other)
+ {
+ if (r.store == null)
+ {
+ r.enumClass = val.getDeclaringClass();
+ r.store = new BitSet(r.enumClass.getEnumConstants().length);
+ }
+ r.store.set(val.ordinal());
+ }
+ // The collection must contain at least one element.
+ if (r.store == null)
+ throw new IllegalArgumentException();
+ r.cardinality = r.store.cardinality();
+ return r;
+ }
+
+ public static <T extends Enum<T>> EnumSet<T> complementOf(EnumSet<T> other)
+ {
+ EnumSet<T> r = new EnumSet<T>();
+ r.store = (BitSet) other.store.clone();
+ r.store.flip(0, r.store.size());
+ r.cardinality = r.store.size() - other.cardinality;
+ r.enumClass = other.enumClass;
+ return r;
+ }
+
+ public static <T extends Enum<T>> EnumSet<T> of(T first)
+ {
+ EnumSet<T> r = new EnumSet<T>();
+ r.enumClass = first.getDeclaringClass();
+ r.store = new BitSet(r.enumClass.getEnumConstants().length);
+ r.store.set(first.ordinal());
+ r.cardinality = 1;
+ return r;
+ }
+
+ public static <T extends Enum<T>> EnumSet<T> of(T first, T second)
+ {
+ EnumSet<T> r = new EnumSet<T>();
+ r.enumClass = first.getDeclaringClass();
+ r.store = new BitSet(r.enumClass.getEnumConstants().length);
+ r.store.set(first.ordinal());
+ r.store.set(second.ordinal());
+ r.cardinality = r.store.cardinality();
+ return r;
+ }
+
+ public static <T extends Enum<T>> EnumSet<T> of(T first, T second, T third)
+ {
+ EnumSet<T> r = new EnumSet<T>();
+ r.enumClass = first.getDeclaringClass();
+ r.store = new BitSet(r.enumClass.getEnumConstants().length);
+ r.store.set(first.ordinal());
+ r.store.set(second.ordinal());
+ r.store.set(third.ordinal());
+ r.cardinality = r.store.cardinality();
+ return r;
+ }
+
+ public static <T extends Enum<T>> EnumSet<T> of(T first, T second, T third,
+ T fourth)
+ {
+ EnumSet<T> r = new EnumSet<T>();
+ r.enumClass = first.getDeclaringClass();
+ r.store = new BitSet(r.enumClass.getEnumConstants().length);
+ r.store.set(first.ordinal());
+ r.store.set(second.ordinal());
+ r.store.set(third.ordinal());
+ r.store.set(fourth.ordinal());
+ r.cardinality = r.store.cardinality();
+ return r;
+ }
+
+ public static <T extends Enum<T>> EnumSet<T> of(T first, T second, T third,
+ T fourth, T fifth)
+ {
+ EnumSet<T> r = new EnumSet<T>();
+ r.enumClass = first.getDeclaringClass();
+ r.store = new BitSet(r.enumClass.getEnumConstants().length);
+ r.store.set(first.ordinal());
+ r.store.set(second.ordinal());
+ r.store.set(third.ordinal());
+ r.store.set(fourth.ordinal());
+ r.store.set(fifth.ordinal());
+ r.cardinality = r.store.cardinality();
+ return r;
+ }
+
+ public static <T extends Enum<T>> EnumSet<T> of(T first, T... rest)
+ {
+ EnumSet<T> r = new EnumSet<T>();
+ r.enumClass = first.getDeclaringClass();
+ r.store = new BitSet(r.enumClass.getEnumConstants().length);
+ r.store.set(first.ordinal());
+ for (T val : rest)
+ r.store.set(val.ordinal());
+ r.cardinality = r.store.cardinality();
+ return r;
+ }
+
+ public static <T extends Enum<T>> EnumSet<T> range(T from, T to)
+ {
+ if (from.compareTo(to) > 0)
+ throw new IllegalArgumentException();
+ EnumSet<T> r = new EnumSet<T>();
+ r.store = new BitSet(from.getDeclaringClass().getEnumConstants().length);
+ r.store.set(from.ordinal(), to.ordinal() + 1);
+ r.enumClass = from.getDeclaringClass();
+ r.cardinality = to.ordinal() - from.ordinal() + 1;
+ return r;
+ }
+}
diff --git a/libjava/classpath/java/util/Enumeration.java b/libjava/classpath/java/util/Enumeration.java
index 1365bbb2f0f..2aec31b6f8d 100644
--- a/libjava/classpath/java/util/Enumeration.java
+++ b/libjava/classpath/java/util/Enumeration.java
@@ -1,5 +1,6 @@
/* Enumeration.java -- Interface for enumerating lists of objects
- Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -60,7 +61,7 @@ package java.util;
* @since 1.0
* @status updated to 1.4
*/
-public interface Enumeration
+public interface Enumeration<E>
{
/**
* Tests whether there are elements remaining in the enumeration.
@@ -77,5 +78,5 @@ public interface Enumeration
* @return the next element in the enumeration
* @throws NoSuchElementException if there are no more elements
*/
- Object nextElement();
+ E nextElement();
}
diff --git a/libjava/classpath/java/util/Formatter.java b/libjava/classpath/java/util/Formatter.java
index 01d54631508..12b705bce06 100644
--- a/libjava/classpath/java/util/Formatter.java
+++ b/libjava/classpath/java/util/Formatter.java
@@ -89,7 +89,7 @@ public final class Formatter
/**
* The output of the formatter.
*/
- private StringBuilder out;
+ private Appendable out;
/**
* The locale used by the formatter.
@@ -143,6 +143,15 @@ public final class Formatter
= SystemProperties.getProperty("line.separator");
/**
+ * The type of numeric output format for a {@link BigDecimal}.
+ */
+ public enum BigDecimalLayoutForm
+ {
+ DECIMAL_FLOAT,
+ SCIENTIFIC
+ }
+
+ /**
* Constructs a new <code>Formatter</code> using the default
* locale and a {@link StringBuilder} as the output stream.
*/
@@ -170,7 +179,7 @@ public final class Formatter
*
* @param app the output stream to use.
*/
- public Formatter(StringBuilder app)
+ public Formatter(Appendable app)
{
this(app, Locale.getDefault());
}
@@ -183,13 +192,189 @@ public final class Formatter
* @param app the output stream to use.
* @param loc the locale to use.
*/
- public Formatter(StringBuilder app, Locale loc)
+ public Formatter(Appendable app, Locale loc)
{
this.out = app == null ? new StringBuilder() : app;
this.locale = loc;
}
/**
+ * Constructs a new <code>Formatter</code> using the default
+ * locale and character set, with the specified file as the
+ * output stream.
+ *
+ * @param file the file to use for output.
+ * @throws FileNotFoundException if the file does not exist
+ * and can not be created.
+ * @throws SecurityException if a security manager is present
+ * and doesn't allow writing to the file.
+ */
+ public Formatter(File file)
+ throws FileNotFoundException
+ {
+ this(new OutputStreamWriter(new FileOutputStream(file)));
+ }
+
+ /**
+ * Constructs a new <code>Formatter</code> using the default
+ * locale, with the specified file as the output stream
+ * and the supplied character set.
+ *
+ * @param file the file to use for output.
+ * @param charset the character set to use for output.
+ * @throws FileNotFoundException if the file does not exist
+ * and can not be created.
+ * @throws SecurityException if a security manager is present
+ * and doesn't allow writing to the file.
+ * @throws UnsupportedEncodingException if the supplied character
+ * set is not supported.
+ */
+ public Formatter(File file, String charset)
+ throws FileNotFoundException, UnsupportedEncodingException
+ {
+ this(file, charset, Locale.getDefault());
+ }
+
+ /**
+ * Constructs a new <code>Formatter</code> using the specified
+ * file as the output stream with the supplied character set
+ * and locale. If the locale is <code>null</code>, then no
+ * localization is applied.
+ *
+ * @param file the file to use for output.
+ * @param charset the character set to use for output.
+ * @param loc the locale to use.
+ * @throws FileNotFoundException if the file does not exist
+ * and can not be created.
+ * @throws SecurityException if a security manager is present
+ * and doesn't allow writing to the file.
+ * @throws UnsupportedEncodingException if the supplied character
+ * set is not supported.
+ */
+ public Formatter(File file, String charset, Locale loc)
+ throws FileNotFoundException, UnsupportedEncodingException
+ {
+ this(new OutputStreamWriter(new FileOutputStream(file), charset),
+ loc);
+ }
+
+ /**
+ * Constructs a new <code>Formatter</code> using the default
+ * locale and character set, with the specified output stream.
+ *
+ * @param out the output stream to use.
+ */
+ public Formatter(OutputStream out)
+ {
+ this(new OutputStreamWriter(out));
+ }
+
+ /**
+ * Constructs a new <code>Formatter</code> using the default
+ * locale, with the specified file output stream and the
+ * supplied character set.
+ *
+ * @param out the output stream.
+ * @param charset the character set to use for output.
+ * @throws UnsupportedEncodingException if the supplied character
+ * set is not supported.
+ */
+ public Formatter(OutputStream out, String charset)
+ throws UnsupportedEncodingException
+ {
+ this(out, charset, Locale.getDefault());
+ }
+
+ /**
+ * Constructs a new <code>Formatter</code> using the specified
+ * output stream with the supplied character set and locale.
+ * If the locale is <code>null</code>, then no localization is
+ * applied.
+ *
+ * @param file the output stream.
+ * @param charset the character set to use for output.
+ * @param loc the locale to use.
+ * @throws UnsupportedEncodingException if the supplied character
+ * set is not supported.
+ */
+ public Formatter(OutputStream out, String charset, Locale loc)
+ throws UnsupportedEncodingException
+ {
+ this(new OutputStreamWriter(out, charset), loc);
+ }
+
+ /**
+ * Constructs a new <code>Formatter</code> using the default
+ * locale with the specified output stream. The character
+ * set used is that of the output stream.
+ *
+ * @param out the output stream to use.
+ */
+ public Formatter(PrintStream out)
+ {
+ this((Appendable) out);
+ }
+
+ /**
+ * Constructs a new <code>Formatter</code> using the default
+ * locale and character set, with the specified file as the
+ * output stream.
+ *
+ * @param file the file to use for output.
+ * @throws FileNotFoundException if the file does not exist
+ * and can not be created.
+ * @throws SecurityException if a security manager is present
+ * and doesn't allow writing to the file.
+ */
+ public Formatter(String file) throws FileNotFoundException
+ {
+ this(new OutputStreamWriter(new FileOutputStream(file)));
+ }
+
+ /**
+ * Constructs a new <code>Formatter</code> using the default
+ * locale, with the specified file as the output stream
+ * and the supplied character set.
+ *
+ * @param file the file to use for output.
+ * @param charset the character set to use for output.
+ * @throws FileNotFoundException if the file does not exist
+ * and can not be created.
+ * @throws SecurityException if a security manager is present
+ * and doesn't allow writing to the file.
+ * @throws UnsupportedEncodingException if the supplied character
+ * set is not supported.
+ */
+ public Formatter(String file, String charset)
+ throws FileNotFoundException, UnsupportedEncodingException
+ {
+ this(file, charset, Locale.getDefault());
+ }
+
+ /**
+ * Constructs a new <code>Formatter</code> using the specified
+ * file as the output stream with the supplied character set
+ * and locale. If the locale is <code>null</code>, then no
+ * localization is applied.
+ *
+ * @param file the file to use for output.
+ * @param charset the character set to use for output.
+ * @param loc the locale to use.
+ * @throws FileNotFoundException if the file does not exist
+ * and can not be created.
+ * @throws SecurityException if a security manager is present
+ * and doesn't allow writing to the file.
+ * @throws UnsupportedEncodingException if the supplied character
+ * set is not supported.
+ */
+ public Formatter(String file, String charset, Locale loc)
+ throws FileNotFoundException, UnsupportedEncodingException
+ {
+ this(new OutputStreamWriter(new FileOutputStream(file), charset),
+ loc);
+ }
+
+ /**
* Closes the formatter, so as to release used resources.
* If the underlying output stream supports the {@link Closeable}
* interface, then this is also closed. Attempts to use
@@ -201,6 +386,16 @@ public final class Formatter
{
if (closed)
return;
+ try
+ {
+ if (out instanceof Closeable)
+ ((Closeable) out).close();
+ }
+ catch (IOException _)
+ {
+ // FIXME: do we ignore these or do we set ioException?
+ // The docs seem to indicate that we should ignore.
+ }
closed = true;
}
@@ -215,6 +410,16 @@ public final class Formatter
{
if (closed)
throw new FormatterClosedException();
+ try
+ {
+ if (out instanceof Flushable)
+ ((Flushable) out).flush();
+ }
+ catch (IOException _)
+ {
+ // FIXME: do we ignore these or do we set ioException?
+ // The docs seem to indicate that we should ignore.
+ }
}
/**
@@ -544,9 +749,6 @@ public final class Formatter
noPrecision(precision);
// Some error checking.
- if ((flags & FormattableFlags.ZERO) != 0
- && (flags & FormattableFlags.LEFT_JUSTIFY) == 0)
- throw new IllegalFormatFlagsException(getName(flags));
if ((flags & FormattableFlags.PLUS) != 0
&& (flags & FormattableFlags.SPACE) != 0)
throw new IllegalFormatFlagsException(getName(flags));
@@ -984,7 +1186,7 @@ public final class Formatter
advance();
if (start == index)
return -1;
- return Integer.decode(format.substring(start, index)).intValue();
+ return Integer.decode(format.substring(start, index));
}
/**
@@ -1090,7 +1292,7 @@ public final class Formatter
* between it and the arguments.
* @throws FormatterClosedException if the formatter is closed.
*/
- public Formatter format(Locale loc, String fmt, Object[] args)
+ public Formatter format(Locale loc, String fmt, Object... args)
{
if (closed)
throw new FormatterClosedException();
@@ -1233,7 +1435,7 @@ public final class Formatter
* between it and the arguments.
* @throws FormatterClosedException if the formatter is closed.
*/
- public Formatter format(String format, Object[] args)
+ public Formatter format(String format, Object... args)
{
return format(locale, format, args);
}
@@ -1269,7 +1471,7 @@ public final class Formatter
* @return the formatter's output stream.
* @throws FormatterClosedException if the formatter is closed.
*/
- public StringBuilder out()
+ public Appendable out()
{
if (closed)
throw new FormatterClosedException();
diff --git a/libjava/classpath/java/util/GregorianCalendar.java b/libjava/classpath/java/util/GregorianCalendar.java
index 83ac00e77e0..4a66d6e08ef 100644
--- a/libjava/classpath/java/util/GregorianCalendar.java
+++ b/libjava/classpath/java/util/GregorianCalendar.java
@@ -935,11 +935,10 @@ public class GregorianCalendar extends Calendar
fields[MONTH] += 12;
fields[YEAR]--;
}
+ isTimeSet = false;
int maxDay = getActualMaximum(DAY_OF_MONTH);
if (fields[DAY_OF_MONTH] > maxDay)
fields[DAY_OF_MONTH] = maxDay;
- set(YEAR, fields[YEAR]);
- set(MONTH, fields[MONTH]);
break;
case DAY_OF_MONTH:
case DAY_OF_YEAR:
diff --git a/libjava/classpath/java/util/HashMap.java b/libjava/classpath/java/util/HashMap.java
index a734af48405..92022a7d55e 100644
--- a/libjava/classpath/java/util/HashMap.java
+++ b/libjava/classpath/java/util/HashMap.java
@@ -96,8 +96,8 @@ import java.io.Serializable;
* @since 1.2
* @status updated to 1.4
*/
-public class HashMap extends AbstractMap
- implements Map, Cloneable, Serializable
+public class HashMap<K, V> extends AbstractMap<K, V>
+ implements Map<K, V>, Cloneable, Serializable
{
/**
* Default number of buckets. This is the value the JDK 1.3 uses. Some
@@ -136,7 +136,7 @@ public class HashMap extends AbstractMap
* Array containing the actual key-value mappings.
* Package visible for use by nested and subclasses.
*/
- transient HashEntry[] buckets;
+ transient HashEntry<K, V>[] buckets;
/**
* Counts the number of modifications this HashMap has undergone, used
@@ -154,7 +154,7 @@ public class HashMap extends AbstractMap
/**
* The cache for {@link #entrySet()}.
*/
- private transient Set entries;
+ private transient Set<Map.Entry<K, V>> entries;
/**
* Class to represent an entry in the hash table. Holds a single key-value
@@ -162,19 +162,19 @@ public class HashMap extends AbstractMap
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- static class HashEntry extends AbstractMap.BasicMapEntry
+ static class HashEntry<K, V> extends AbstractMap.SimpleEntry<K, V>
{
/**
* The next entry in the linked list. Package visible for use by subclass.
*/
- HashEntry next;
+ HashEntry<K, V> next;
/**
* Simple constructor.
* @param key the key
* @param value the value
*/
- HashEntry(Object key, Object value)
+ HashEntry(K key, V value)
{
super(key, value);
}
@@ -194,7 +194,7 @@ public class HashMap extends AbstractMap
*
* @return the value of this key as it is removed
*/
- Object cleanup()
+ V cleanup()
{
return value;
}
@@ -220,7 +220,7 @@ public class HashMap extends AbstractMap
* <b>NOTE: key / value pairs are not cloned in this constructor.</b>
* @throws NullPointerException if m is null
*/
- public HashMap(Map m)
+ public HashMap(Map<? extends K, ? extends V> m)
{
this(Math.max(m.size() * 2, DEFAULT_CAPACITY), DEFAULT_LOAD_FACTOR);
putAll(m);
@@ -256,7 +256,7 @@ public class HashMap extends AbstractMap
if (initialCapacity == 0)
initialCapacity = 1;
- buckets = new HashEntry[initialCapacity];
+ buckets = (HashEntry<K, V>[]) new HashEntry[initialCapacity];
this.loadFactor = loadFactor;
threshold = (int) (initialCapacity * loadFactor);
}
@@ -292,10 +292,10 @@ public class HashMap extends AbstractMap
* @see #put(Object, Object)
* @see #containsKey(Object)
*/
- public Object get(Object key)
+ public V get(Object key)
{
int idx = hash(key);
- HashEntry e = buckets[idx];
+ HashEntry<K, V> e = buckets[idx];
while (e != null)
{
if (equals(key, e.key))
@@ -316,7 +316,7 @@ public class HashMap extends AbstractMap
public boolean containsKey(Object key)
{
int idx = hash(key);
- HashEntry e = buckets[idx];
+ HashEntry<K, V> e = buckets[idx];
while (e != null)
{
if (equals(key, e.key))
@@ -339,17 +339,17 @@ public class HashMap extends AbstractMap
* @see #get(Object)
* @see Object#equals(Object)
*/
- public Object put(Object key, Object value)
+ public V put(K key, V value)
{
int idx = hash(key);
- HashEntry e = buckets[idx];
+ HashEntry<K, V> e = buckets[idx];
while (e != null)
{
if (equals(key, e.key))
{
e.access(); // Must call this for bookkeeping in LinkedHashMap.
- Object r = e.value;
+ V r = e.value;
e.value = value;
return r;
}
@@ -378,23 +378,25 @@ public class HashMap extends AbstractMap
*
* @param m the map to be hashed into this
*/
- public void putAll(Map m)
+ public void putAll(Map<? extends K, ? extends V> m)
{
- Iterator itr = m.entrySet().iterator();
- while (itr.hasNext())
+ Map<K,V> addMap;
+
+ addMap = (Map<K,V>) m;
+ for (Map.Entry<K,V> e : addMap.entrySet())
{
- Map.Entry e = (Map.Entry) itr.next();
// Optimize in case the Entry is one of our own.
- if (e instanceof AbstractMap.BasicMapEntry)
+ if (e instanceof AbstractMap.SimpleEntry)
{
- AbstractMap.BasicMapEntry entry = (AbstractMap.BasicMapEntry) e;
+ AbstractMap.SimpleEntry<? extends K, ? extends V> entry
+ = (AbstractMap.SimpleEntry<? extends K, ? extends V>) e;
put(entry.key, entry.value);
}
else
put(e.getKey(), e.getValue());
}
}
-
+
/**
* Removes from the HashMap and returns the value which is mapped by the
* supplied key. If the key maps to nothing, then the HashMap remains
@@ -405,11 +407,11 @@ public class HashMap extends AbstractMap
* @param key the key used to locate the value to remove
* @return whatever the key mapped to, if present
*/
- public Object remove(Object key)
+ public V remove(Object key)
{
int idx = hash(key);
- HashEntry e = buckets[idx];
- HashEntry last = null;
+ HashEntry<K, V> e = buckets[idx];
+ HashEntry<K, V> last = null;
while (e != null)
{
@@ -455,7 +457,7 @@ public class HashMap extends AbstractMap
{
for (int i = buckets.length - 1; i >= 0; i--)
{
- HashEntry e = buckets[i];
+ HashEntry<K, V> e = buckets[i];
while (e != null)
{
if (equals(value, e.value))
@@ -474,16 +476,16 @@ public class HashMap extends AbstractMap
*/
public Object clone()
{
- HashMap copy = null;
+ HashMap<K, V> copy = null;
try
{
- copy = (HashMap) super.clone();
+ copy = (HashMap<K, V>) super.clone();
}
catch (CloneNotSupportedException x)
{
// This is impossible.
}
- copy.buckets = new HashEntry[buckets.length];
+ copy.buckets = (HashEntry<K, V>[]) new HashEntry[buckets.length];
copy.putAllInternal(this);
// Clear the entry cache. AbstractMap.clone() does the others.
copy.entries = null;
@@ -499,19 +501,19 @@ public class HashMap extends AbstractMap
* @see #values()
* @see #entrySet()
*/
- public Set keySet()
+ public Set<K> keySet()
{
if (keys == null)
// Create an AbstractSet with custom implementations of those methods
// that can be overridden easily and efficiently.
- keys = new AbstractSet()
+ keys = new AbstractSet<K>()
{
public int size()
{
return size;
}
- public Iterator iterator()
+ public Iterator<K> iterator()
{
// Cannot create the iterator directly, because of LinkedHashMap.
return HashMap.this.iterator(KEYS);
@@ -550,19 +552,19 @@ public class HashMap extends AbstractMap
* @see #keySet()
* @see #entrySet()
*/
- public Collection values()
+ public Collection<V> values()
{
if (values == null)
// We don't bother overriding many of the optional methods, as doing so
// wouldn't provide any significant performance advantage.
- values = new AbstractCollection()
+ values = new AbstractCollection<V>()
{
public int size()
{
return size;
}
- public Iterator iterator()
+ public Iterator<V> iterator()
{
// Cannot create the iterator directly, because of LinkedHashMap.
return HashMap.this.iterator(VALUES);
@@ -589,19 +591,19 @@ public class HashMap extends AbstractMap
* @see #values()
* @see Map.Entry
*/
- public Set entrySet()
+ public Set<Map.Entry<K, V>> entrySet()
{
if (entries == null)
// Create an AbstractSet with custom implementations of those methods
// that can be overridden easily and efficiently.
- entries = new AbstractSet()
+ entries = new AbstractSet<Map.Entry<K, V>>()
{
public int size()
{
return size;
}
- public Iterator iterator()
+ public Iterator<Map.Entry<K, V>> iterator()
{
// Cannot create the iterator directly, because of LinkedHashMap.
return HashMap.this.iterator(ENTRIES);
@@ -619,7 +621,7 @@ public class HashMap extends AbstractMap
public boolean remove(Object o)
{
- HashEntry e = getEntry(o);
+ HashEntry<K, V> e = getEntry(o);
if (e != null)
{
HashMap.this.remove(e.key);
@@ -641,9 +643,9 @@ public class HashMap extends AbstractMap
* @param callRemove whether to call the removeEldestEntry method
* @see #put(Object, Object)
*/
- void addEntry(Object key, Object value, int idx, boolean callRemove)
+ void addEntry(K key, V value, int idx, boolean callRemove)
{
- HashEntry e = new HashEntry(key, value);
+ HashEntry<K, V> e = new HashEntry<K, V>(key, value);
e.next = buckets[idx];
buckets[idx] = e;
}
@@ -657,14 +659,14 @@ public class HashMap extends AbstractMap
* @see #entrySet()
*/
// Package visible, for use in nested classes.
- final HashEntry getEntry(Object o)
+ final HashEntry<K, V> getEntry(Object o)
{
if (! (o instanceof Map.Entry))
return null;
- Map.Entry me = (Map.Entry) o;
- Object key = me.getKey();
+ Map.Entry<K, V> me = (Map.Entry<K, V>) o;
+ K key = me.getKey();
int idx = hash(key);
- HashEntry e = buckets[idx];
+ HashEntry<K, V> e = buckets[idx];
while (e != null)
{
if (equals(e.key, key))
@@ -693,9 +695,10 @@ public class HashMap extends AbstractMap
* @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES}
* @return the appropriate iterator
*/
- Iterator iterator(int type)
+ <T> Iterator<T> iterator(int type)
{
- return new HashIterator(type);
+ // FIXME: bogus cast here.
+ return new HashIterator<T>(type);
}
/**
@@ -705,15 +708,16 @@ public class HashMap extends AbstractMap
*
* @param m the map to initialize this from
*/
- void putAllInternal(Map m)
+ void putAllInternal(Map<? extends K, ? extends V> m)
{
- Iterator itr = m.entrySet().iterator();
+ Map<K,V> addMap;
+
+ addMap = (Map<K,V>) m;
size = 0;
- while (itr.hasNext())
+ for (Map.Entry<K,V> e : addMap.entrySet())
{
size++;
- Map.Entry e = (Map.Entry) itr.next();
- Object key = e.getKey();
+ K key = e.getKey();
int idx = hash(key);
addEntry(key, e.getValue(), idx, false);
}
@@ -730,20 +734,20 @@ public class HashMap extends AbstractMap
*/
private void rehash()
{
- HashEntry[] oldBuckets = buckets;
+ HashEntry<K, V>[] oldBuckets = buckets;
int newcapacity = (buckets.length * 2) + 1;
threshold = (int) (newcapacity * loadFactor);
- buckets = new HashEntry[newcapacity];
+ buckets = (HashEntry<K, V>[]) new HashEntry[newcapacity];
for (int i = oldBuckets.length - 1; i >= 0; i--)
{
- HashEntry e = oldBuckets[i];
+ HashEntry<K, V> e = oldBuckets[i];
while (e != null)
{
int idx = hash(e.key);
- HashEntry dest = buckets[idx];
- HashEntry next = e.next;
+ HashEntry<K, V> dest = buckets[idx];
+ HashEntry<K, V> next = e.next;
e.next = buckets[idx];
buckets[idx] = e;
e = next;
@@ -769,10 +773,10 @@ public class HashMap extends AbstractMap
s.writeInt(buckets.length);
s.writeInt(size);
// Avoid creating a wasted Set by creating the iterator directly.
- Iterator it = iterator(ENTRIES);
+ Iterator<HashEntry<K, V>> it = iterator(ENTRIES);
while (it.hasNext())
{
- HashEntry entry = (HashEntry) it.next();
+ HashEntry<K, V> entry = it.next();
s.writeObject(entry.key);
s.writeObject(entry.value);
}
@@ -796,13 +800,13 @@ public class HashMap extends AbstractMap
s.defaultReadObject();
// Read and use capacity, followed by key/value pairs.
- buckets = new HashEntry[s.readInt()];
+ buckets = (HashEntry<K, V>[]) new HashEntry[s.readInt()];
int len = s.readInt();
size = len;
while (len-- > 0)
{
Object key = s.readObject();
- addEntry(key, s.readObject(), hash(key), false);
+ addEntry((K) key, (V) s.readObject(), hash(key), false);
}
}
@@ -813,7 +817,7 @@ public class HashMap extends AbstractMap
*
* @author Jon Zeppieri
*/
- private final class HashIterator implements Iterator
+ private final class HashIterator<T> implements Iterator<T>
{
/**
* The type of this Iterator: {@link #KEYS}, {@link #VALUES},
@@ -861,7 +865,7 @@ public class HashMap extends AbstractMap
* @throws ConcurrentModificationException if the HashMap was modified
* @throws NoSuchElementException if there is none
*/
- public Object next()
+ public T next()
{
if (knownMod != modCount)
throw new ConcurrentModificationException();
@@ -876,10 +880,10 @@ public class HashMap extends AbstractMap
next = e.next;
last = e;
if (type == VALUES)
- return e.value;
+ return (T) e.value;
if (type == KEYS)
- return e.key;
- return e;
+ return (T) e.key;
+ return (T) e;
}
/**
diff --git a/libjava/classpath/java/util/HashSet.java b/libjava/classpath/java/util/HashSet.java
index 681d5bb1b07..c08b6db5abb 100644
--- a/libjava/classpath/java/util/HashSet.java
+++ b/libjava/classpath/java/util/HashSet.java
@@ -76,8 +76,8 @@ import java.io.Serializable;
* @since 1.2
* @status updated to 1.4
*/
-public class HashSet extends AbstractSet
- implements Set, Cloneable, Serializable
+public class HashSet<T> extends AbstractSet<T>
+ implements Set<T>, Cloneable, Serializable
{
/**
* Compatible with JDK 1.2.
@@ -87,7 +87,7 @@ public class HashSet extends AbstractSet
/**
* The HashMap which backs this Set.
*/
- private transient HashMap map;
+ private transient HashMap<T, String> map;
/**
* Construct a new, empty HashSet whose backing HashMap has the default
@@ -133,7 +133,7 @@ public class HashSet extends AbstractSet
* @param c a collection of initial set elements
* @throws NullPointerException if c is null
*/
- public HashSet(Collection c)
+ public HashSet(Collection<? extends T> c)
{
this(Math.max(2 * c.size(), HashMap.DEFAULT_CAPACITY));
addAll(c);
@@ -146,7 +146,7 @@ public class HashSet extends AbstractSet
* @param o the Object to add to this Set
* @return true if the set did not already contain o
*/
- public boolean add(Object o)
+ public boolean add(T o)
{
return map.put(o, "") == null;
}
@@ -167,16 +167,16 @@ public class HashSet extends AbstractSet
*/
public Object clone()
{
- HashSet copy = null;
+ HashSet<T> copy = null;
try
{
- copy = (HashSet) super.clone();
+ copy = (HashSet<T>) super.clone();
}
catch (CloneNotSupportedException x)
{
// Impossible to get here.
}
- copy.map = (HashMap) map.clone();
+ copy.map = (HashMap<T, String>) map.clone();
return copy;
}
@@ -210,7 +210,7 @@ public class HashSet extends AbstractSet
* @return a set iterator
* @see ConcurrentModificationException
*/
- public Iterator iterator()
+ public Iterator<T> iterator()
{
// Avoid creating intermediate keySet() object by using non-public API.
return map.iterator(HashMap.KEYS);
@@ -263,7 +263,7 @@ public class HashSet extends AbstractSet
{
s.defaultWriteObject();
// Avoid creating intermediate keySet() object by using non-public API.
- Iterator it = map.iterator(HashMap.KEYS);
+ Iterator<T> it = map.iterator(HashMap.KEYS);
s.writeInt(map.buckets.length);
s.writeFloat(map.loadFactor);
s.writeInt(map.size);
@@ -288,6 +288,6 @@ public class HashSet extends AbstractSet
map = init(s.readInt(), s.readFloat());
for (int size = s.readInt(); size > 0; size--)
- map.put(s.readObject(), "");
+ map.put((T) s.readObject(), "");
}
}
diff --git a/libjava/classpath/java/util/Hashtable.java b/libjava/classpath/java/util/Hashtable.java
index 4c00d18a8e2..2e265a47387 100644
--- a/libjava/classpath/java/util/Hashtable.java
+++ b/libjava/classpath/java/util/Hashtable.java
@@ -100,8 +100,8 @@ import java.io.Serializable;
* @since 1.0
* @status updated to 1.4
*/
-public class Hashtable extends Dictionary
- implements Map, Cloneable, Serializable
+public class Hashtable<K, V> extends Dictionary<K, V>
+ implements Map<K, V>, Cloneable, Serializable
{
// WARNING: Hashtable is a CORE class in the bootstrap cycle. See the
// comments in vm/reference/java/lang/Runtime for implications of this fact.
@@ -139,7 +139,7 @@ public class Hashtable extends Dictionary
* Array containing the actual key-value mappings.
*/
// Package visible for use by nested classes.
- transient HashEntry[] buckets;
+ transient HashEntry<K, V>[] buckets;
/**
* Counts the number of modifications this Hashtable has undergone, used
@@ -157,34 +157,35 @@ public class Hashtable extends Dictionary
/**
* The cache for {@link #keySet()}.
*/
- private transient Set keys;
+ private transient Set<K> keys;
/**
* The cache for {@link #values()}.
*/
- private transient Collection values;
+ private transient Collection<V> values;
/**
* The cache for {@link #entrySet()}.
*/
- private transient Set entries;
+ private transient Set<Map.Entry<K, V>> entries;
/**
* Class to represent an entry in the hash table. Holds a single key-value
* pair. A Hashtable Entry is identical to a HashMap Entry, except that
* `null' is not allowed for keys and values.
*/
- private static final class HashEntry extends AbstractMap.BasicMapEntry
+ private static final class HashEntry<K, V>
+ extends AbstractMap.SimpleEntry<K, V>
{
/** The next entry in the linked list. */
- HashEntry next;
+ HashEntry<K, V> next;
/**
* Simple constructor.
* @param key the key, already guaranteed non-null
* @param value the value, already guaranteed non-null
*/
- HashEntry(Object key, Object value)
+ HashEntry(K key, V value)
{
super(key, value);
}
@@ -195,7 +196,7 @@ public class Hashtable extends Dictionary
* @return the prior value
* @throws NullPointerException if <code>newVal</code> is null
*/
- public Object setValue(Object newVal)
+ public V setValue(V newVal)
{
if (newVal == null)
throw new NullPointerException();
@@ -226,7 +227,7 @@ public class Hashtable extends Dictionary
* to or from `null'.
* @since 1.2
*/
- public Hashtable(Map m)
+ public Hashtable(Map<? extends K, ? extends V> m)
{
this(Math.max(m.size() * 2, DEFAULT_CAPACITY), DEFAULT_LOAD_FACTOR);
putAll(m);
@@ -263,7 +264,7 @@ public class Hashtable extends Dictionary
if (initialCapacity == 0)
initialCapacity = 1;
- buckets = new HashEntry[initialCapacity];
+ buckets = (HashEntry<K, V>[]) new HashEntry[initialCapacity];
this.loadFactor = loadFactor;
threshold = (int) (initialCapacity * loadFactor);
}
@@ -295,7 +296,7 @@ public class Hashtable extends Dictionary
* @see #elements()
* @see #keySet()
*/
- public Enumeration keys()
+ public Enumeration<K> keys()
{
return new KeyEnumerator();
}
@@ -309,7 +310,7 @@ public class Hashtable extends Dictionary
* @see #keys()
* @see #values()
*/
- public Enumeration elements()
+ public Enumeration<V> elements()
{
return new ValueEnumerator();
}
@@ -333,7 +334,7 @@ public class Hashtable extends Dictionary
for (int i = buckets.length - 1; i >= 0; i--)
{
- HashEntry e = buckets[i];
+ HashEntry<K, V> e = buckets[i];
while (e != null)
{
if (e.value.equals(value))
@@ -341,7 +342,7 @@ public class Hashtable extends Dictionary
e = e.next;
}
}
-
+
return false;
}
@@ -376,7 +377,7 @@ public class Hashtable extends Dictionary
public synchronized boolean containsKey(Object key)
{
int idx = hash(key);
- HashEntry e = buckets[idx];
+ HashEntry<K, V> e = buckets[idx];
while (e != null)
{
if (e.key.equals(key))
@@ -396,10 +397,10 @@ public class Hashtable extends Dictionary
* @see #put(Object, Object)
* @see #containsKey(Object)
*/
- public synchronized Object get(Object key)
+ public synchronized V get(Object key)
{
int idx = hash(key);
- HashEntry e = buckets[idx];
+ HashEntry<K, V> e = buckets[idx];
while (e != null)
{
if (e.key.equals(key))
@@ -421,10 +422,10 @@ public class Hashtable extends Dictionary
* @see #get(Object)
* @see Object#equals(Object)
*/
- public synchronized Object put(Object key, Object value)
+ public synchronized V put(K key, V value)
{
int idx = hash(key);
- HashEntry e = buckets[idx];
+ HashEntry<K, V> e = buckets[idx];
// Check if value is null since it is not permitted.
if (value == null)
@@ -435,7 +436,7 @@ public class Hashtable extends Dictionary
if (e.key.equals(key))
{
// Bypass e.setValue, since we already know value is non-null.
- Object r = e.value;
+ V r = e.value;
e.value = value;
return r;
}
@@ -454,7 +455,7 @@ public class Hashtable extends Dictionary
idx = hash(key);
}
- e = new HashEntry(key, value);
+ e = new HashEntry<K, V>(key, value);
e.next = buckets[idx];
buckets[idx] = e;
@@ -470,11 +471,11 @@ public class Hashtable extends Dictionary
* @param key the key used to locate the value to remove
* @return whatever the key mapped to, if present
*/
- public synchronized Object remove(Object key)
+ public synchronized V remove(Object key)
{
int idx = hash(key);
- HashEntry e = buckets[idx];
- HashEntry last = null;
+ HashEntry<K, V> e = buckets[idx];
+ HashEntry<K, V> last = null;
while (e != null)
{
@@ -502,17 +503,19 @@ public class Hashtable extends Dictionary
* @param m the map to be hashed into this
* @throws NullPointerException if m is null, or contains null keys or values
*/
- public synchronized void putAll(Map m)
+ public synchronized void putAll(Map<? extends K, ? extends V> m)
{
- Iterator itr = m.entrySet().iterator();
+ Map<K,V> addMap;
+
+ addMap = (Map<K,V>) m;
- while (itr.hasNext())
+ for (Map.Entry<K,V> e : addMap.entrySet())
{
- Map.Entry e = (Map.Entry) itr.next();
// Optimize in case the Entry is one of our own.
- if (e instanceof AbstractMap.BasicMapEntry)
+ if (e instanceof AbstractMap.SimpleEntry)
{
- AbstractMap.BasicMapEntry entry = (AbstractMap.BasicMapEntry) e;
+ AbstractMap.SimpleEntry<? extends K, ? extends V> entry
+ = (AbstractMap.SimpleEntry<? extends K, ? extends V>) e;
put(entry.key, entry.value);
}
else
@@ -543,16 +546,16 @@ public class Hashtable extends Dictionary
*/
public synchronized Object clone()
{
- Hashtable copy = null;
+ Hashtable<K, V> copy = null;
try
{
- copy = (Hashtable) super.clone();
+ copy = (Hashtable<K, V>) super.clone();
}
catch (CloneNotSupportedException x)
{
// This is impossible.
}
- copy.buckets = new HashEntry[buckets.length];
+ copy.buckets = (HashEntry<K, V>[]) new HashEntry[buckets.length];
copy.putAllInternal(this);
// Clear the caches.
copy.keys = null;
@@ -576,7 +579,7 @@ public class Hashtable extends Dictionary
// Since we are already synchronized, and entrySet().iterator()
// would repeatedly re-lock/release the monitor, we directly use the
// unsynchronized EntryIterator instead.
- Iterator entries = new EntryIterator();
+ Iterator<Map.Entry<K, V>> entries = new EntryIterator();
StringBuffer r = new StringBuffer("{");
for (int pos = size; pos > 0; pos--)
{
@@ -603,20 +606,20 @@ public class Hashtable extends Dictionary
* @see #entrySet()
* @since 1.2
*/
- public Set keySet()
+ public Set<K> keySet()
{
if (keys == null)
{
// Create a synchronized AbstractSet with custom implementations of
// those methods that can be overridden easily and efficiently.
- Set r = new AbstractSet()
+ Set<K> r = new AbstractSet<K>()
{
public int size()
{
return size;
}
- public Iterator iterator()
+ public Iterator<K> iterator()
{
return new KeyIterator();
}
@@ -640,7 +643,7 @@ public class Hashtable extends Dictionary
};
// We must specify the correct object to synchronize upon, hence the
// use of a non-public API
- keys = new Collections.SynchronizedSet(this, r);
+ keys = new Collections.SynchronizedSet<K>(this, r);
}
return keys;
}
@@ -661,20 +664,20 @@ public class Hashtable extends Dictionary
* @see #entrySet()
* @since 1.2
*/
- public Collection values()
+ public Collection<V> values()
{
if (values == null)
{
// We don't bother overriding many of the optional methods, as doing so
// wouldn't provide any significant performance advantage.
- Collection r = new AbstractCollection()
+ Collection<V> r = new AbstractCollection<V>()
{
public int size()
{
return size;
}
- public Iterator iterator()
+ public Iterator<V> iterator()
{
return new ValueIterator();
}
@@ -686,7 +689,7 @@ public class Hashtable extends Dictionary
};
// We must specify the correct object to synchronize upon, hence the
// use of a non-public API
- values = new Collections.SynchronizedCollection(this, r);
+ values = new Collections.SynchronizedCollection<V>(this, r);
}
return values;
}
@@ -713,20 +716,20 @@ public class Hashtable extends Dictionary
* @see Map.Entry
* @since 1.2
*/
- public Set entrySet()
+ public Set<Map.Entry<K, V>> entrySet()
{
if (entries == null)
{
// Create an AbstractSet with custom implementations of those methods
// that can be overridden easily and efficiently.
- Set r = new AbstractSet()
+ Set<Map.Entry<K, V>> r = new AbstractSet<Map.Entry<K, V>>()
{
public int size()
{
return size;
}
- public Iterator iterator()
+ public Iterator<Map.Entry<K, V>> iterator()
{
return new EntryIterator();
}
@@ -743,7 +746,7 @@ public class Hashtable extends Dictionary
public boolean remove(Object o)
{
- HashEntry e = getEntry(o);
+ HashEntry<K, V> e = getEntry(o);
if (e != null)
{
Hashtable.this.remove(e.key);
@@ -754,7 +757,7 @@ public class Hashtable extends Dictionary
};
// We must specify the correct object to synchronize upon, hence the
// use of a non-public API
- entries = new Collections.SynchronizedSet(this, r);
+ entries = new Collections.SynchronizedSet<Map.Entry<K, V>>(this, r);
}
return entries;
}
@@ -772,7 +775,7 @@ public class Hashtable extends Dictionary
*/
public boolean equals(Object o)
{
- // no need to synchronize, entrySet().equals() does that
+ // no need to synchronize, entrySet().equals() does that.
if (o == this)
return true;
if (!(o instanceof Map))
@@ -793,7 +796,7 @@ public class Hashtable extends Dictionary
// Since we are already synchronized, and entrySet().iterator()
// would repeatedly re-lock/release the monitor, we directly use the
// unsynchronized EntryIterator instead.
- Iterator itr = new EntryIterator();
+ Iterator<Map.Entry<K, V>> itr = new EntryIterator();
int hashcode = 0;
for (int pos = size; pos > 0; pos--)
hashcode += itr.next().hashCode();
@@ -826,16 +829,16 @@ public class Hashtable extends Dictionary
* @see #entrySet()
*/
// Package visible, for use in nested classes.
- HashEntry getEntry(Object o)
+ HashEntry<K, V> getEntry(Object o)
{
if (! (o instanceof Map.Entry))
return null;
- Object key = ((Map.Entry) o).getKey();
+ K key = ((Map.Entry<K, V>) o).getKey();
if (key == null)
return null;
int idx = hash(key);
- HashEntry e = buckets[idx];
+ HashEntry<K, V> e = buckets[idx];
while (e != null)
{
if (e.equals(o))
@@ -852,18 +855,19 @@ public class Hashtable extends Dictionary
*
* @param m the map to initialize this from
*/
- void putAllInternal(Map m)
+ void putAllInternal(Map<? extends K, ? extends V> m)
{
- Iterator itr = m.entrySet().iterator();
+ Map<K,V> addMap;
+
+ addMap = (Map<K,V>) m;
size = 0;
- while (itr.hasNext())
+ for (Map.Entry<K,V> e : addMap.entrySet())
{
size++;
- Map.Entry e = (Map.Entry) itr.next();
- Object key = e.getKey();
+ K key = e.getKey();
int idx = hash(key);
- HashEntry he = new HashEntry(key, e.getValue());
+ HashEntry<K, V> he = new HashEntry<K, V>(key, e.getValue());
he.next = buckets[idx];
buckets[idx] = he;
}
@@ -882,19 +886,19 @@ public class Hashtable extends Dictionary
*/
protected void rehash()
{
- HashEntry[] oldBuckets = buckets;
+ HashEntry<K, V>[] oldBuckets = buckets;
int newcapacity = (buckets.length * 2) + 1;
threshold = (int) (newcapacity * loadFactor);
- buckets = new HashEntry[newcapacity];
+ buckets = (HashEntry<K, V>[]) new HashEntry[newcapacity];
for (int i = oldBuckets.length - 1; i >= 0; i--)
{
- HashEntry e = oldBuckets[i];
+ HashEntry<K, V> e = oldBuckets[i];
while (e != null)
{
int idx = hash(e.key);
- HashEntry dest = buckets[idx];
+ HashEntry<K, V> dest = buckets[idx];
if (dest != null)
{
@@ -911,7 +915,7 @@ public class Hashtable extends Dictionary
buckets[idx] = e;
}
- HashEntry next = e.next;
+ HashEntry<K, V> next = e.next;
e.next = null;
e = next;
}
@@ -939,10 +943,10 @@ public class Hashtable extends Dictionary
// Since we are already synchronized, and entrySet().iterator()
// would repeatedly re-lock/release the monitor, we directly use the
// unsynchronized EntryIterator instead.
- Iterator it = new EntryIterator();
+ Iterator<Map.Entry<K, V>> it = new EntryIterator();
while (it.hasNext())
{
- HashEntry entry = (HashEntry) it.next();
+ HashEntry<K, V> entry = (HashEntry<K, V>) it.next();
s.writeObject(entry.key);
s.writeObject(entry.value);
}
@@ -966,13 +970,13 @@ public class Hashtable extends Dictionary
s.defaultReadObject();
// Read and use capacity.
- buckets = new HashEntry[s.readInt()];
+ buckets = (HashEntry<K, V>[]) new HashEntry[s.readInt()];
int len = s.readInt();
// Read and use key/value pairs.
// TODO: should we be defensive programmers, and check for illegal nulls?
while (--len >= 0)
- put(s.readObject(), s.readObject());
+ put((K) s.readObject(), (V) s.readObject());
}
/**
@@ -987,7 +991,8 @@ public class Hashtable extends Dictionary
* @author Jon Zeppieri
* @author Fridjof Siebert
*/
- private class EntryIterator implements Iterator
+ private class EntryIterator
+ implements Iterator<Entry<K,V>>
{
/**
* The number of modifications to the backing Hashtable that we know about.
@@ -998,16 +1003,16 @@ public class Hashtable extends Dictionary
/** Current index in the physical hash table. */
int idx = buckets.length;
/** The last Entry returned by a next() call. */
- HashEntry last;
+ HashEntry<K, V> last;
/**
* The next entry that should be returned by next(). It is set to something
* if we're iterating through a bucket that contains multiple linked
* entries. It is null if next() needs to find a new bucket.
*/
- HashEntry next;
+ HashEntry<K, V> next;
/**
- * Construct a new EtryIterator
+ * Construct a new EntryIterator
*/
EntryIterator()
{
@@ -1029,14 +1034,14 @@ public class Hashtable extends Dictionary
* @throws ConcurrentModificationException if the hashtable was modified
* @throws NoSuchElementException if there is none
*/
- public Object next()
+ public Map.Entry<K,V> next()
{
if (knownMod != modCount)
throw new ConcurrentModificationException();
if (count == 0)
throw new NoSuchElementException();
count--;
- HashEntry e = next;
+ HashEntry<K, V> e = next;
while (e == null)
if (idx <= 0)
@@ -1070,12 +1075,43 @@ public class Hashtable extends Dictionary
/**
* A class which implements the Iterator interface and is used for
- * iterating over keys in Hashtables.
+ * iterating over keys in Hashtables. This class uses an
+ * <code>EntryIterator</code> to obtain the keys of each entry.
*
* @author Fridtjof Siebert
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
- private class KeyIterator extends EntryIterator
+ private class KeyIterator
+ implements Iterator<K>
{
+
+ /**
+ * This entry iterator is used for most operations. Only
+ * <code>next()</code> gives a different result, by returning just
+ * the key rather than the whole element.
+ */
+ private EntryIterator iterator;
+
+ /**
+ * Construct a new KeyIterator
+ */
+ KeyIterator()
+ {
+ iterator = new EntryIterator();
+ }
+
+
+ /**
+ * Returns true if the entry iterator has more elements.
+ *
+ * @return true if there are more elements
+ * @throws ConcurrentModificationException if the hashtable was modified
+ */
+ public boolean hasNext()
+ {
+ return iterator.hasNext();
+ }
+
/**
* Returns the next element in the Iterator's sequential view.
*
@@ -1084,34 +1120,88 @@ public class Hashtable extends Dictionary
* @throws ConcurrentModificationException if the hashtable was modified
* @throws NoSuchElementException if there is none
*/
- public Object next()
+ public K next()
{
- return ((HashEntry)super.next()).key;
+ return ((HashEntry<K,V>) iterator.next()).key;
}
- } // class KeyIterator
-
-
+ /**
+ * Removes the last element used by the <code>next()</code> method
+ * using the entry iterator.
+ *
+ * @throws ConcurrentModificationException if the hashtable was modified
+ * @throws IllegalStateException if called when there is no last element
+ */
+ public void remove()
+ {
+ iterator.remove();
+ }
+ } // class KeyIterator
+
/**
* A class which implements the Iterator interface and is used for
- * iterating over values in Hashtables.
+ * iterating over values in Hashtables. This class uses an
+ * <code>EntryIterator</code> to obtain the values of each entry.
*
* @author Fridtjof Siebert
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
- private class ValueIterator extends EntryIterator
+ private class ValueIterator
+ implements Iterator<V>
{
+
/**
- * Returns the next element in the Iterator's sequential view.
+ * This entry iterator is used for most operations. Only
+ * <code>next()</code> gives a different result, by returning just
+ * the value rather than the whole element.
+ */
+ private EntryIterator iterator;
+
+ /**
+ * Construct a new KeyIterator
+ */
+ ValueIterator()
+ {
+ iterator = new EntryIterator();
+ }
+
+
+ /**
+ * Returns true if the entry iterator has more elements.
*
- * @return the next element
+ * @return true if there are more elements
+ * @throws ConcurrentModificationException if the hashtable was modified
+ */
+ public boolean hasNext()
+ {
+ return iterator.hasNext();
+ }
+
+ /**
+ * Returns the value of the next element in the iterator's sequential view.
+ *
+ * @return the next value
*
* @throws ConcurrentModificationException if the hashtable was modified
* @throws NoSuchElementException if there is none
*/
- public Object next()
+ public V next()
+ {
+ return ((HashEntry<K,V>) iterator.next()).value;
+ }
+
+ /**
+ * Removes the last element used by the <code>next()</code> method
+ * using the entry iterator.
+ *
+ * @throws ConcurrentModificationException if the hashtable was modified
+ * @throws IllegalStateException if called when there is no last element
+ */
+ public void remove()
{
- return ((HashEntry)super.next()).value;
+ iterator.remove();
}
+
} // class ValueIterator
/**
@@ -1128,7 +1218,8 @@ public class Hashtable extends Dictionary
* @author Jon Zeppieri
* @author Fridjof Siebert
*/
- private class EntryEnumerator implements Enumeration
+ private class EntryEnumerator
+ implements Enumeration<Entry<K,V>>
{
/** The number of elements remaining to be returned by next(). */
int count = size;
@@ -1139,7 +1230,7 @@ public class Hashtable extends Dictionary
* set if we are iterating through a bucket with multiple entries, or null
* if we must look in the next bucket.
*/
- HashEntry next;
+ HashEntry<K, V> next;
/**
* Construct the enumeration.
@@ -1163,12 +1254,12 @@ public class Hashtable extends Dictionary
* @return the next element
* @throws NoSuchElementException if there is none.
*/
- public Object nextElement()
+ public Map.Entry<K,V> nextElement()
{
if (count == 0)
throw new NoSuchElementException("Hashtable Enumerator");
count--;
- HashEntry e = next;
+ HashEntry<K, V> e = next;
while (e == null)
if (idx <= 0)
@@ -1195,18 +1286,47 @@ public class Hashtable extends Dictionary
*
* @author Jon Zeppieri
* @author Fridjof Siebert
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
- private final class KeyEnumerator extends EntryEnumerator
+ private final class KeyEnumerator
+ implements Enumeration<K>
{
/**
+ * This entry enumerator is used for most operations. Only
+ * <code>nextElement()</code> gives a different result, by returning just
+ * the key rather than the whole element.
+ */
+ private EntryEnumerator enumerator;
+
+ /**
+ * Construct a new KeyEnumerator
+ */
+ KeyEnumerator()
+ {
+ enumerator = new EntryEnumerator();
+ }
+
+
+ /**
+ * Returns true if the entry enumerator has more elements.
+ *
+ * @return true if there are more elements
+ * @throws ConcurrentModificationException if the hashtable was modified
+ */
+ public boolean hasMoreElements()
+ {
+ return enumerator.hasMoreElements();
+ }
+
+ /**
* Returns the next element.
* @return the next element
* @throws NoSuchElementException if there is none.
*/
- public Object nextElement()
+ public K nextElement()
{
- HashEntry entry = (HashEntry) super.nextElement();
- Object retVal = null;
+ HashEntry<K,V> entry = (HashEntry<K,V>) enumerator.nextElement();
+ K retVal = null;
if (entry != null)
retVal = entry.key;
return retVal;
@@ -1227,18 +1347,47 @@ public class Hashtable extends Dictionary
*
* @author Jon Zeppieri
* @author Fridjof Siebert
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
- private final class ValueEnumerator extends EntryEnumerator
+ private final class ValueEnumerator
+ implements Enumeration<V>
{
/**
+ * This entry enumerator is used for most operations. Only
+ * <code>nextElement()</code> gives a different result, by returning just
+ * the value rather than the whole element.
+ */
+ private EntryEnumerator enumerator;
+
+ /**
+ * Construct a new ValueEnumerator
+ */
+ ValueEnumerator()
+ {
+ enumerator = new EntryEnumerator();
+ }
+
+
+ /**
+ * Returns true if the entry enumerator has more elements.
+ *
+ * @return true if there are more elements
+ * @throws ConcurrentModificationException if the hashtable was modified
+ */
+ public boolean hasMoreElements()
+ {
+ return enumerator.hasMoreElements();
+ }
+
+ /**
* Returns the next element.
* @return the next element
* @throws NoSuchElementException if there is none.
*/
- public Object nextElement()
+ public V nextElement()
{
- HashEntry entry = (HashEntry) super.nextElement();
- Object retVal = null;
+ HashEntry<K,V> entry = (HashEntry<K,V>) enumerator.nextElement();
+ V retVal = null;
if (entry != null)
retVal = entry.value;
return retVal;
diff --git a/libjava/classpath/java/util/IdentityHashMap.java b/libjava/classpath/java/util/IdentityHashMap.java
index 89ef034159b..8dead96c193 100644
--- a/libjava/classpath/java/util/IdentityHashMap.java
+++ b/libjava/classpath/java/util/IdentityHashMap.java
@@ -90,23 +90,20 @@ import java.io.Serializable;
* @since 1.4
* @status updated to 1.4
*/
-public class IdentityHashMap extends AbstractMap
- implements Map, Serializable, Cloneable
+public class IdentityHashMap<K,V> extends AbstractMap<K,V>
+ implements Map<K,V>, Serializable, Cloneable
{
/** The default capacity. */
private static final int DEFAULT_CAPACITY = 21;
/**
- * This object is used to mark deleted items. Package visible for use by
- * nested classes.
+ * This object is used to mark a slot whose key or value is 'null'.
+ * This is more efficient than using a special value to mark an empty
+ * slot, because null entries are rare, empty slots are common, and
+ * the JVM will clear new arrays for us.
+ * Package visible for use by nested classes.
*/
- static final Object tombstone = new Object();
-
- /**
- * This object is used to mark empty slots. We need this because
- * using null is ambiguous. Package visible for use by nested classes.
- */
- static final Object emptyslot = new Object();
+ static final Object nullslot = new Object();
/**
* Compatible with JDK 1.4.
@@ -134,7 +131,7 @@ public class IdentityHashMap extends AbstractMap
/**
* The cache for {@link #entrySet()}.
*/
- private transient Set entries;
+ private transient Set<Map.Entry<K,V>> entries;
/**
* The threshold for rehashing, which is 75% of (table.length / 2).
@@ -166,7 +163,6 @@ public class IdentityHashMap extends AbstractMap
if (max < 2)
max = 2;
table = new Object[max << 1];
- Arrays.fill(table, emptyslot);
threshold = (max >> 2) * 3;
}
@@ -177,7 +173,7 @@ public class IdentityHashMap extends AbstractMap
* @param m The map whose elements are to be put in this map
* @throws NullPointerException if m is null
*/
- public IdentityHashMap(Map m)
+ public IdentityHashMap(Map<? extends K, ? extends V> m)
{
this(Math.max(m.size() << 1, DEFAULT_CAPACITY));
putAll(m);
@@ -191,7 +187,7 @@ public class IdentityHashMap extends AbstractMap
if (size != 0)
{
modCount++;
- Arrays.fill(table, emptyslot);
+ Arrays.fill(table, null);
size = 0;
}
}
@@ -227,6 +223,7 @@ public class IdentityHashMap extends AbstractMap
*/
public boolean containsKey(Object key)
{
+ key = xform(key);
return key == table[hash(key)];
}
@@ -241,6 +238,7 @@ public class IdentityHashMap extends AbstractMap
*/
public boolean containsValue(Object value)
{
+ value = xform(value);
for (int i = table.length - 1; i > 0; i -= 2)
if (table[i] == value)
return true;
@@ -274,19 +272,19 @@ public class IdentityHashMap extends AbstractMap
* @see #values()
* @see Map.Entry
*/
- public Set entrySet()
+ public Set<Map.Entry<K,V>> entrySet()
{
if (entries == null)
- entries = new AbstractSet()
+ entries = new AbstractSet<Map.Entry<K,V>>()
{
public int size()
{
return size;
}
- public Iterator iterator()
+ public Iterator<Map.Entry<K,V>> iterator()
{
- return new IdentityIterator(ENTRIES);
+ return new IdentityIterator<Map.Entry<K,V>>(ENTRIES);
}
public void clear()
@@ -299,7 +297,9 @@ public class IdentityHashMap extends AbstractMap
if (! (o instanceof Map.Entry))
return false;
Map.Entry m = (Map.Entry) o;
- return m.getValue() == table[hash(m.getKey()) + 1];
+ Object value = xform(m.getValue());
+ Object key = xform(m.getKey());
+ return value == table[hash(key) + 1];
}
public int hashCode()
@@ -311,14 +311,13 @@ public class IdentityHashMap extends AbstractMap
{
if (! (o instanceof Map.Entry))
return false;
- Object key = ((Map.Entry) o).getKey();
+ Object key = xform(((Map.Entry) o).getKey());
int h = hash(key);
if (table[h] == key)
{
size--;
modCount++;
- table[h] = tombstone;
- table[h + 1] = tombstone;
+ IdentityHashMap.this.removeAtIndex(h);
return true;
}
return false;
@@ -358,10 +357,11 @@ public class IdentityHashMap extends AbstractMap
* @see #put(Object, Object)
* @see #containsKey(Object)
*/
- public Object get(Object key)
+ public V get(Object key)
{
+ key = xform(key);
int h = hash(key);
- return table[h] == key ? table[h + 1] : null;
+ return (V) (table[h] == key ? unxform(table[h + 1]) : null);
}
/**
@@ -378,10 +378,11 @@ public class IdentityHashMap extends AbstractMap
for (int i = table.length - 2; i >= 0; i -= 2)
{
Object key = table[i];
- if (key == emptyslot || key == tombstone)
+ if (key == null)
continue;
- hash += (System.identityHashCode(key)
- ^ System.identityHashCode(table[i + 1]));
+ // FIXME: this is a lame computation.
+ hash += (System.identityHashCode(unxform(key))
+ ^ System.identityHashCode(unxform(table[i + 1])));
}
return hash;
}
@@ -414,19 +415,19 @@ public class IdentityHashMap extends AbstractMap
* @see #values()
* @see #entrySet()
*/
- public Set keySet()
+ public Set<K> keySet()
{
if (keys == null)
- keys = new AbstractSet()
+ keys = new AbstractSet<K>()
{
public int size()
{
return size;
}
- public Iterator iterator()
+ public Iterator<K> iterator()
{
- return new IdentityIterator(KEYS);
+ return new IdentityIterator<K>(KEYS);
}
public void clear()
@@ -445,23 +446,22 @@ public class IdentityHashMap extends AbstractMap
for (int i = table.length - 2; i >= 0; i -= 2)
{
Object key = table[i];
- if (key == emptyslot || key == tombstone)
+ if (key == null)
continue;
- hash += System.identityHashCode(key);
+ hash += System.identityHashCode(unxform(key));
}
return hash;
-
}
public boolean remove(Object o)
{
+ o = xform(o);
int h = hash(o);
if (table[h] == o)
{
size--;
modCount++;
- table[h] = tombstone;
- table[h + 1] = tombstone;
+ removeAtIndex(h);
return true;
}
return false;
@@ -484,8 +484,20 @@ public class IdentityHashMap extends AbstractMap
* @return the prior mapping of the key, or null if there was none
* @see #get(Object)
*/
- public Object put(Object key, Object value)
+ public V put(K key, V value)
{
+ key = (K) xform(key);
+ value = (V) xform(value);
+
+ // We don't want to rehash if we're overwriting an existing slot.
+ int h = hash(key);
+ if (table[h] == key)
+ {
+ V r = (V) unxform(table[h + 1]);
+ table[h + 1] = value;
+ return r;
+ }
+
// Rehash if the load factor is too high.
if (size > threshold)
{
@@ -493,25 +505,25 @@ public class IdentityHashMap extends AbstractMap
// This isn't necessarily prime, but it is an odd number of key/value
// slots, which has a higher probability of fewer collisions.
table = new Object[(old.length * 2) + 2];
- Arrays.fill(table, emptyslot);
size = 0;
threshold = (table.length >>> 3) * 3;
for (int i = old.length - 2; i >= 0; i -= 2)
{
- Object oldkey = old[i];
- if (oldkey != tombstone && oldkey != emptyslot)
- // Just use put. This isn't very efficient, but it is ok.
- put(oldkey, old[i + 1]);
+ K oldkey = (K) old[i];
+ if (oldkey != null)
+ {
+ h = hash(oldkey);
+ table[h] = oldkey;
+ table[h + 1] = old[i + 1];
+ ++size;
+ // No need to update modCount here, we'll do it
+ // just after the loop.
+ }
}
- }
- int h = hash(key);
- if (table[h] == key)
- {
- Object r = table[h + 1];
- table[h + 1] = value;
- return r;
+ // Now that we've resize, recompute the hash value.
+ h = hash(key);
}
// At this point, we add a new mapping.
@@ -529,13 +541,47 @@ public class IdentityHashMap extends AbstractMap
* @param m the map to copy
* @throws NullPointerException if m is null
*/
- public void putAll(Map m)
+ public void putAll(Map<? extends K, ? extends V> m)
{
// Why did Sun specify this one? The superclass does the right thing.
super.putAll(m);
}
/**
+ * Remove the element at index and update the table to compensate.
+ * This is package-private for use by inner classes.
+ * @param i index of the removed element
+ */
+ final void removeAtIndex(int i)
+ {
+ // This is Algorithm R from Knuth, section 6.4.
+ // Variable names are taken directly from the text.
+ while (true)
+ {
+ table[i] = null;
+ table[i + 1] = null;
+ int j = i;
+ int r;
+ do
+ {
+ i -= 2;
+ if (i < 0)
+ i = table.length - 2;
+ Object key = table[i];
+ if (key == null)
+ return;
+ r = Math.abs(System.identityHashCode(key)
+ % (table.length >> 1)) << 1;
+ }
+ while ((i <= r && r < j)
+ || (r < j && j < i)
+ || (j < i && i <= r));
+ table[j] = table[i];
+ table[j + 1] = table[i + 1];
+ }
+ }
+
+ /**
* Removes from the HashMap and returns the value which is mapped by
* the supplied key. If the key maps to nothing, then the HashMap
* remains unchanged, and <code>null</code> is returned.
@@ -549,17 +595,17 @@ public class IdentityHashMap extends AbstractMap
* @param key the key used to locate the value to remove
* @return whatever the key mapped to, if present
*/
- public Object remove(Object key)
+ public V remove(Object key)
{
+ key = xform(key);
int h = hash(key);
if (table[h] == key)
{
modCount++;
size--;
- Object r = table[h + 1];
- table[h] = tombstone;
- table[h + 1] = tombstone;
- return r;
+ Object r = unxform(table[h + 1]);
+ removeAtIndex(h);
+ return (V) r;
}
return null;
}
@@ -591,19 +637,19 @@ public class IdentityHashMap extends AbstractMap
* @see #keySet()
* @see #entrySet()
*/
- public Collection values()
+ public Collection<V> values()
{
if (values == null)
- values = new AbstractCollection()
+ values = new AbstractCollection<V>()
{
public int size()
{
return size;
}
- public Iterator iterator()
+ public Iterator<V> iterator()
{
- return new IdentityIterator(VALUES);
+ return new IdentityIterator<V>(VALUES);
}
public void clear()
@@ -613,13 +659,14 @@ public class IdentityHashMap extends AbstractMap
public boolean remove(Object o)
{
+ o = xform(o);
+ // This approach may look strange, but it is ok.
for (int i = table.length - 1; i > 0; i -= 2)
if (table[i] == o)
{
modCount++;
- table[i - 1] = tombstone;
- table[i] = tombstone;
size--;
+ IdentityHashMap.this.removeAtIndex(i - 1);
return true;
}
return false;
@@ -629,8 +676,31 @@ public class IdentityHashMap extends AbstractMap
}
/**
+ * Transform a reference from its external form to its internal form.
+ * This is package-private for use by inner classes.
+ */
+ final Object xform(Object o)
+ {
+ if (o == null)
+ o = nullslot;
+ return o;
+ }
+
+ /**
+ * Transform a reference from its internal form to its external form.
+ * This is package-private for use by inner classes.
+ */
+ final Object unxform(Object o)
+ {
+ if (o == nullslot)
+ o = null;
+ return o;
+ }
+
+ /**
* Helper method which computes the hash code, then traverses the table
- * until it finds the key, or the spot where the key would go.
+ * until it finds the key, or the spot where the key would go. the key
+ * must already be in its internal form.
*
* @param key the key to check
* @return the index where the key belongs
@@ -638,36 +708,23 @@ public class IdentityHashMap extends AbstractMap
* @see #put(Object, Object)
*/
// Package visible for use by nested classes.
- int hash(Object key)
+ final int hash(Object key)
{
- // Implementation note: it is feasible for the table to have no
- // emptyslots, if it is full with entries and tombstones, so we must
- // remember where we started. If we encounter the key or an emptyslot,
- // we are done. If we encounter a tombstone, the key may still be in
- // the array. If we don't encounter the key, we use the first emptyslot
- // or tombstone we encountered as the location where the key would go.
- // By requiring at least 2 key/value slots, and rehashing at 75%
- // capacity, we guarantee that there will always be either an emptyslot
- // or a tombstone somewhere in the table.
int h = Math.abs(System.identityHashCode(key) % (table.length >> 1)) << 1;
- int del = -1;
- int save = h;
- do
+ while (true)
{
- if (table[h] == key)
+ // By requiring at least 2 key/value slots, and rehashing at 75%
+ // capacity, we guarantee that there will always be either an empty
+ // slot somewhere in the table.
+ if (table[h] == key || table[h] == null)
return h;
- if (table[h] == emptyslot)
- break;
- if (table[h] == tombstone && del < 0)
- del = h;
+ // We use linear probing as it is friendlier to the cache and
+ // it lets us efficiently remove entries.
h -= 2;
if (h < 0)
h = table.length - 2;
}
- while (h != save);
-
- return del < 0 ? h : del;
}
/**
@@ -679,7 +736,7 @@ public class IdentityHashMap extends AbstractMap
* @author Tom Tromey (tromey@redhat.com)
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private class IdentityIterator implements Iterator
+ private class IdentityIterator<I> implements Iterator<I>
{
/**
* The type of this Iterator: {@link #KEYS}, {@link #VALUES},
@@ -717,7 +774,7 @@ public class IdentityHashMap extends AbstractMap
* @throws ConcurrentModificationException if the Map was modified
* @throws NoSuchElementException if there is none
*/
- public Object next()
+ public I next()
{
if (knownMod != modCount)
throw new ConcurrentModificationException();
@@ -731,10 +788,11 @@ public class IdentityHashMap extends AbstractMap
loc -= 2;
key = table[loc];
}
- while (key == emptyslot || key == tombstone);
-
- return type == KEYS ? key : (type == VALUES ? table[loc + 1]
- : new IdentityEntry(loc));
+ while (key == null);
+
+ return (I) (type == KEYS ? unxform(key)
+ : (type == VALUES ? unxform(table[loc + 1])
+ : new IdentityEntry(loc)));
}
/**
@@ -748,12 +806,11 @@ public class IdentityHashMap extends AbstractMap
{
if (knownMod != modCount)
throw new ConcurrentModificationException();
- if (loc == table.length || table[loc] == tombstone)
+ if (loc == table.length)
throw new IllegalStateException();
modCount++;
size--;
- table[loc] = tombstone;
- table[loc + 1] = tombstone;
+ removeAtIndex(loc);
knownMod++;
}
} // class IdentityIterator
@@ -768,7 +825,7 @@ public class IdentityHashMap extends AbstractMap
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private final class IdentityEntry implements Map.Entry
+ private final class IdentityEntry<EK,EV> implements Map.Entry<EK,EV>
{
/** The location of this entry. */
final int loc;
@@ -797,12 +854,13 @@ public class IdentityHashMap extends AbstractMap
*/
public boolean equals(Object o)
{
- if (knownMod != modCount || table[loc] == tombstone)
+ if (knownMod != modCount)
throw new ConcurrentModificationException();
if (! (o instanceof Map.Entry))
return false;
Map.Entry e = (Map.Entry) o;
- return table[loc] == e.getKey() && table[loc + 1] == e.getValue();
+ return table[loc] == xform(e.getKey())
+ && table[loc + 1] == xform(e.getValue());
}
/**
@@ -812,11 +870,11 @@ public class IdentityHashMap extends AbstractMap
* @throws ConcurrentModificationException if the entry was invalidated
* by modifying the Map or calling Iterator.remove()
*/
- public Object getKey()
+ public EK getKey()
{
- if (knownMod != modCount || table[loc] == tombstone)
+ if (knownMod != modCount)
throw new ConcurrentModificationException();
- return table[loc];
+ return (EK) unxform(table[loc]);
}
/**
@@ -826,11 +884,11 @@ public class IdentityHashMap extends AbstractMap
* @throws ConcurrentModificationException if the entry was invalidated
* by modifying the Map or calling Iterator.remove()
*/
- public Object getValue()
+ public EV getValue()
{
- if (knownMod != modCount || table[loc] == tombstone)
+ if (knownMod != modCount)
throw new ConcurrentModificationException();
- return table[loc + 1];
+ return (EV) unxform(table[loc + 1]);
}
/**
@@ -844,10 +902,10 @@ public class IdentityHashMap extends AbstractMap
*/
public int hashCode()
{
- if (knownMod != modCount || table[loc] == tombstone)
+ if (knownMod != modCount)
throw new ConcurrentModificationException();
- return (System.identityHashCode(table[loc])
- ^ System.identityHashCode(table[loc + 1]));
+ return (System.identityHashCode(unxform(table[loc]))
+ ^ System.identityHashCode(unxform(table[loc + 1])));
}
/**
@@ -858,12 +916,12 @@ public class IdentityHashMap extends AbstractMap
* @throws ConcurrentModificationException if the entry was invalidated
* by modifying the Map or calling Iterator.remove()
*/
- public Object setValue(Object value)
+ public EV setValue(EV value)
{
- if (knownMod != modCount || table[loc] == tombstone)
+ if (knownMod != modCount)
throw new ConcurrentModificationException();
- Object r = table[loc + 1];
- table[loc + 1] = value;
+ EV r = (EV) unxform(table[loc + 1]);
+ table[loc + 1] = xform(value);
return r;
}
@@ -877,9 +935,9 @@ public class IdentityHashMap extends AbstractMap
*/
public String toString()
{
- if (knownMod != modCount || table[loc] == tombstone)
+ if (knownMod != modCount)
throw new ConcurrentModificationException();
- return table[loc] + "=" + table[loc + 1];
+ return unxform(table[loc]) + "=" + unxform(table[loc + 1]);
}
} // class IdentityEntry
@@ -902,7 +960,7 @@ public class IdentityHashMap extends AbstractMap
table = new Object[Math.max(num << 1, DEFAULT_CAPACITY) << 1];
// Read key/value pairs.
while (--num >= 0)
- put(s.readObject(), s.readObject());
+ put((K) s.readObject(), (V) s.readObject());
}
/**
@@ -922,10 +980,10 @@ public class IdentityHashMap extends AbstractMap
for (int i = table.length - 2; i >= 0; i -= 2)
{
Object key = table[i];
- if (key != tombstone && key != emptyslot)
+ if (key != null)
{
- s.writeObject(key);
- s.writeObject(table[i + 1]);
+ s.writeObject(unxform(key));
+ s.writeObject(unxform(table[i + 1]));
}
}
}
diff --git a/libjava/classpath/java/util/IllegalFormatConversionException.java b/libjava/classpath/java/util/IllegalFormatConversionException.java
index 2f981f26e45..d59c0a4b18f 100644
--- a/libjava/classpath/java/util/IllegalFormatConversionException.java
+++ b/libjava/classpath/java/util/IllegalFormatConversionException.java
@@ -67,7 +67,7 @@ public class IllegalFormatConversionException
* @serial the mismatching argument type.
*/
// Note: name fixed by serialization.
- Class arg;
+ Class<?> arg;
/**
* Constructs a new <code>IllegalFormatConversionException</code>
@@ -78,7 +78,7 @@ public class IllegalFormatConversionException
* @param arg the type which doesn't match the conversion character.
* @throws NullPointerException if <code>arg</code> is null.
*/
- public IllegalFormatConversionException(char c, Class arg)
+ public IllegalFormatConversionException(char c, Class<?> arg)
{
super("The type, " + arg + ", is invalid for the conversion character, " +
c + ".");
@@ -103,7 +103,7 @@ public class IllegalFormatConversionException
*
* @return the type of the mismatched argument.
*/
- public Class getArgumentClass()
+ public Class<?> getArgumentClass()
{
return arg;
}
diff --git a/libjava/classpath/java/util/Iterator.java b/libjava/classpath/java/util/Iterator.java
index 31ecff8a257..41111a52d39 100644
--- a/libjava/classpath/java/util/Iterator.java
+++ b/libjava/classpath/java/util/Iterator.java
@@ -1,5 +1,5 @@
/* Iterator.java -- Interface for iterating over collections
- Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -54,7 +54,7 @@ package java.util;
* @since 1.2
* @status updated to 1.4
*/
-public interface Iterator
+public interface Iterator<E>
{
/**
* Tests whether there are elements remaining in the collection. In other
@@ -70,7 +70,7 @@ public interface Iterator
* @return the next element in the collection
* @throws NoSuchElementException if there are no more elements
*/
- Object next();
+ E next();
/**
* Remove from the underlying collection the last element returned by next
diff --git a/libjava/classpath/java/util/LinkedHashMap.java b/libjava/classpath/java/util/LinkedHashMap.java
index 2b002b27296..6ec06a949d8 100644
--- a/libjava/classpath/java/util/LinkedHashMap.java
+++ b/libjava/classpath/java/util/LinkedHashMap.java
@@ -97,6 +97,8 @@ package java.util;
* non-deterministic behavior.
*
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @see Object#hashCode()
* @see Collection
* @see Map
@@ -106,7 +108,7 @@ package java.util;
* @since 1.4
* @status updated to 1.4
*/
-public class LinkedHashMap extends HashMap
+public class LinkedHashMap<K,V> extends HashMap<K,V>
{
/**
* Compatible with JDK 1.4.
@@ -130,16 +132,16 @@ public class LinkedHashMap extends HashMap
* Class to represent an entry in the hash table. Holds a single key-value
* pair and the doubly-linked insertion order list.
*/
- class LinkedHashEntry extends HashEntry
+ class LinkedHashEntry<K,V> extends HashEntry<K,V>
{
/**
* The predecessor in the iteration list. If this entry is the root
* (eldest), pred points to the newest entry.
*/
- LinkedHashEntry pred;
+ LinkedHashEntry<K,V> pred;
/** The successor in the iteration list, null if this is the newest. */
- LinkedHashEntry succ;
+ LinkedHashEntry<K,V> succ;
/**
* Simple constructor.
@@ -147,7 +149,7 @@ public class LinkedHashMap extends HashMap
* @param key the key
* @param value the value
*/
- LinkedHashEntry(Object key, Object value)
+ LinkedHashEntry(K key, V value)
{
super(key, value);
if (root == null)
@@ -186,7 +188,7 @@ public class LinkedHashMap extends HashMap
succ = null;
pred = root.pred;
pred.succ = this;
- root.pred = this;
+ root.pred = this;
}
}
}
@@ -197,7 +199,7 @@ public class LinkedHashMap extends HashMap
*
* @return the value of this key as it is removed
*/
- Object cleanup()
+ V cleanup()
{
if (this == root)
{
@@ -243,7 +245,7 @@ public class LinkedHashMap extends HashMap
* are not cloned in this constructor.</b>
* @throws NullPointerException if m is null
*/
- public LinkedHashMap(Map m)
+ public LinkedHashMap(Map<? extends K, ? extends V> m)
{
super(m);
accessOrder = false;
@@ -335,10 +337,10 @@ public class LinkedHashMap extends HashMap
* @see #put(Object, Object)
* @see #containsKey(Object)
*/
- public Object get(Object key)
+ public V get(Object key)
{
int idx = hash(key);
- HashEntry e = buckets[idx];
+ HashEntry<K,V> e = buckets[idx];
while (e != null)
{
if (equals(key, e.key))
@@ -390,7 +392,7 @@ public class LinkedHashMap extends HashMap
* earliest element inserted.
* @return true if <code>eldest</code> should be removed
*/
- protected boolean removeEldestEntry(Map.Entry eldest)
+ protected boolean removeEldestEntry(Map.Entry<K,V> eldest)
{
return false;
}
@@ -407,7 +409,7 @@ public class LinkedHashMap extends HashMap
* @see #removeEldestEntry(Map.Entry)
* @see LinkedHashEntry#LinkedHashEntry(Object, Object)
*/
- void addEntry(Object key, Object value, int idx, boolean callRemove)
+ void addEntry(K key, V value, int idx, boolean callRemove)
{
LinkedHashEntry e = new LinkedHashEntry(key, value);
e.next = buckets[idx];
diff --git a/libjava/classpath/java/util/LinkedHashSet.java b/libjava/classpath/java/util/LinkedHashSet.java
index 6c68195c3bd..a0b32f34964 100644
--- a/libjava/classpath/java/util/LinkedHashSet.java
+++ b/libjava/classpath/java/util/LinkedHashSet.java
@@ -1,6 +1,6 @@
/* LinkedHashSet.java -- a set backed by a LinkedHashMap, for linked
list traversal.
- Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -88,8 +88,8 @@ import java.io.Serializable;
* @since 1.4
* @status updated to 1.4
*/
-public class LinkedHashSet extends HashSet
- implements Set, Cloneable, Serializable
+public class LinkedHashSet<T> extends HashSet<T>
+ implements Set<T>, Cloneable, Serializable
{
/**
* Compatible with JDK 1.4.
@@ -140,7 +140,7 @@ public class LinkedHashSet extends HashSet
* @param c a collection of initial set elements
* @throws NullPointerException if c is null
*/
- public LinkedHashSet(Collection c)
+ public LinkedHashSet(Collection<? extends T> c)
{
super(c);
}
@@ -152,9 +152,8 @@ public class LinkedHashSet extends HashSet
* @param load the initial load factor
* @return the backing HashMap
*/
- HashMap init(int capacity, float load)
+ HashMap<T, String> init(int capacity, float load)
{
- return new LinkedHashMap(capacity, load);
+ return new LinkedHashMap<T, String>(capacity, load);
}
-
}
diff --git a/libjava/classpath/java/util/LinkedList.java b/libjava/classpath/java/util/LinkedList.java
index e77ae536b64..2d78573d08c 100644
--- a/libjava/classpath/java/util/LinkedList.java
+++ b/libjava/classpath/java/util/LinkedList.java
@@ -71,8 +71,8 @@ import java.lang.reflect.Array;
* @since 1.2
* @status missing javadoc, but complete to 1.4
*/
-public class LinkedList extends AbstractSequentialList
- implements List, Cloneable, Serializable
+public class LinkedList<T> extends AbstractSequentialList<T>
+ implements List<T>, Queue<T>, Cloneable, Serializable
{
/**
* Compatible with JDK 1.2.
@@ -82,12 +82,12 @@ public class LinkedList extends AbstractSequentialList
/**
* The first element in the list.
*/
- transient Entry first;
+ transient Entry<T> first;
/**
* The last element in the list.
*/
- transient Entry last;
+ transient Entry<T> last;
/**
* The current length of the list.
@@ -97,22 +97,22 @@ public class LinkedList extends AbstractSequentialList
/**
* Class to represent an entry in the list. Holds a single element.
*/
- private static final class Entry
+ private static final class Entry<T>
{
/** The element in the list. */
- Object data;
+ T data;
/** The next list entry, null if this is last. */
- Entry next;
+ Entry<T> next;
/** The previous list entry, null if this is first. */
- Entry previous;
+ Entry<T> previous;
/**
* Construct an entry.
* @param data the list element
*/
- Entry(Object data)
+ Entry(T data)
{
this.data = data;
}
@@ -131,9 +131,9 @@ public class LinkedList extends AbstractSequentialList
* @return the entry at position n
*/
// Package visible for use in nested classes.
- Entry getEntry(int n)
+ Entry<T> getEntry(int n)
{
- Entry e;
+ Entry<T> e;
if (n < size / 2)
{
e = first;
@@ -158,7 +158,7 @@ public class LinkedList extends AbstractSequentialList
* @param e the entry to remove
*/
// Package visible for use in nested classes.
- void removeEntry(Entry e)
+ void removeEntry(Entry<T> e)
{
modCount++;
size--;
@@ -224,7 +224,7 @@ public class LinkedList extends AbstractSequentialList
* @param c the collection to populate this list from
* @throws NullPointerException if c is null
*/
- public LinkedList(Collection c)
+ public LinkedList(Collection<? extends T> c)
{
addAll(c);
}
@@ -235,7 +235,7 @@ public class LinkedList extends AbstractSequentialList
* @return the first list element
* @throws NoSuchElementException if the list is empty
*/
- public Object getFirst()
+ public T getFirst()
{
if (size == 0)
throw new NoSuchElementException();
@@ -248,7 +248,7 @@ public class LinkedList extends AbstractSequentialList
* @return the last list element
* @throws NoSuchElementException if the list is empty
*/
- public Object getLast()
+ public T getLast()
{
if (size == 0)
throw new NoSuchElementException();
@@ -261,13 +261,13 @@ public class LinkedList extends AbstractSequentialList
* @return the former first element in the list
* @throws NoSuchElementException if the list is empty
*/
- public Object removeFirst()
+ public T removeFirst()
{
if (size == 0)
throw new NoSuchElementException();
modCount++;
size--;
- Object r = first.data;
+ T r = first.data;
if (first.next != null)
first.next.previous = null;
@@ -285,13 +285,13 @@ public class LinkedList extends AbstractSequentialList
* @return the former last element in the list
* @throws NoSuchElementException if the list is empty
*/
- public Object removeLast()
+ public T removeLast()
{
if (size == 0)
throw new NoSuchElementException();
modCount++;
size--;
- Object r = last.data;
+ T r = last.data;
if (last.previous != null)
last.previous.next = null;
@@ -308,9 +308,9 @@ public class LinkedList extends AbstractSequentialList
*
* @param o the element to insert
*/
- public void addFirst(Object o)
+ public void addFirst(T o)
{
- Entry e = new Entry(o);
+ Entry<T> e = new Entry(o);
modCount++;
if (size == 0)
@@ -329,9 +329,9 @@ public class LinkedList extends AbstractSequentialList
*
* @param o the element to insert
*/
- public void addLast(Object o)
+ public void addLast(T o)
{
- addLastEntry(new Entry(o));
+ addLastEntry(new Entry<T>(o));
}
/**
@@ -339,7 +339,7 @@ public class LinkedList extends AbstractSequentialList
*
* @param e the entry to add
*/
- private void addLastEntry(Entry e)
+ private void addLastEntry(Entry<T> e)
{
modCount++;
if (size == 0)
@@ -362,7 +362,7 @@ public class LinkedList extends AbstractSequentialList
*/
public boolean contains(Object o)
{
- Entry e = first;
+ Entry<T> e = first;
while (e != null)
{
if (equals(o, e.data))
@@ -388,9 +388,9 @@ public class LinkedList extends AbstractSequentialList
* @param o the entry to add
* @return true, as it always succeeds
*/
- public boolean add(Object o)
+ public boolean add(T o)
{
- addLastEntry(new Entry(o));
+ addLastEntry(new Entry<T>(o));
return true;
}
@@ -403,7 +403,7 @@ public class LinkedList extends AbstractSequentialList
*/
public boolean remove(Object o)
{
- Entry e = first;
+ Entry<T> e = first;
while (e != null)
{
if (equals(o, e.data))
@@ -425,7 +425,7 @@ public class LinkedList extends AbstractSequentialList
* @return true if the list was modified
* @throws NullPointerException if c is null
*/
- public boolean addAll(Collection c)
+ public boolean addAll(Collection<? extends T> c)
{
return addAll(size, c);
}
@@ -440,7 +440,7 @@ public class LinkedList extends AbstractSequentialList
* @throws NullPointerException if c is null
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
*/
- public boolean addAll(int index, Collection c)
+ public boolean addAll(int index, Collection<? extends T> c)
{
checkBoundsInclusive(index);
int csize = c.size();
@@ -448,13 +448,13 @@ public class LinkedList extends AbstractSequentialList
if (csize == 0)
return false;
- Iterator itr = c.iterator();
+ Iterator<? extends T> itr = c.iterator();
// Get the entries just before and after index. If index is at the start
// of the list, BEFORE is null. If index is at the end of the list, AFTER
// is null. If the list is empty, both are null.
- Entry after = null;
- Entry before = null;
+ Entry<T> after = null;
+ Entry<T> before = null;
if (index != size)
{
after = getEntry(index);
@@ -467,15 +467,15 @@ public class LinkedList extends AbstractSequentialList
// to the first entry, in order to deal with the case where (c == this).
// [Actually, we don't have to handle this case to fufill the
// contract for addAll(), but Sun's implementation appears to.]
- Entry e = new Entry(itr.next());
+ Entry<T> e = new Entry<T>(itr.next());
e.previous = before;
- Entry prev = e;
- Entry firstNew = e;
+ Entry<T> prev = e;
+ Entry<T> firstNew = e;
// Create and link all the remaining entries.
for (int pos = 1; pos < csize; pos++)
{
- e = new Entry(itr.next());
+ e = new Entry<T>(itr.next());
e.previous = prev;
prev.next = e;
prev = e;
@@ -518,7 +518,7 @@ public class LinkedList extends AbstractSequentialList
* @return the element at index
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
- public Object get(int index)
+ public T get(int index)
{
checkBoundsExclusive(index);
return getEntry(index).data;
@@ -532,11 +532,11 @@ public class LinkedList extends AbstractSequentialList
* @return the prior element
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
- public Object set(int index, Object o)
+ public T set(int index, T o)
{
checkBoundsExclusive(index);
- Entry e = getEntry(index);
- Object old = e.data;
+ Entry<T> e = getEntry(index);
+ T old = e.data;
e.data = o;
return old;
}
@@ -548,15 +548,15 @@ public class LinkedList extends AbstractSequentialList
* @param o the element to insert
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
*/
- public void add(int index, Object o)
+ public void add(int index, T o)
{
checkBoundsInclusive(index);
- Entry e = new Entry(o);
+ Entry<T> e = new Entry<T>(o);
if (index < size)
{
modCount++;
- Entry after = getEntry(index);
+ Entry<T> after = getEntry(index);
e.next = after;
e.previous = after.previous;
if (after.previous == null)
@@ -577,10 +577,10 @@ public class LinkedList extends AbstractSequentialList
* @return the removed element
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
*/
- public Object remove(int index)
+ public T remove(int index)
{
checkBoundsExclusive(index);
- Entry e = getEntry(index);
+ Entry<T> e = getEntry(index);
removeEntry(e);
return e.data;
}
@@ -594,7 +594,7 @@ public class LinkedList extends AbstractSequentialList
public int indexOf(Object o)
{
int index = 0;
- Entry e = first;
+ Entry<T> e = first;
while (e != null)
{
if (equals(o, e.data))
@@ -614,7 +614,7 @@ public class LinkedList extends AbstractSequentialList
public int lastIndexOf(Object o)
{
int index = size - 1;
- Entry e = last;
+ Entry<T> e = last;
while (e != null)
{
if (equals(o, e.data))
@@ -634,10 +634,10 @@ public class LinkedList extends AbstractSequentialList
* next(), or size() to be initially positioned at the end of the list
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
*/
- public ListIterator listIterator(int index)
+ public ListIterator<T> listIterator(int index)
{
checkBoundsInclusive(index);
- return new LinkedListItr(index);
+ return new LinkedListItr<T>(index);
}
/**
@@ -648,10 +648,10 @@ public class LinkedList extends AbstractSequentialList
*/
public Object clone()
{
- LinkedList copy = null;
+ LinkedList<T> copy = null;
try
{
- copy = (LinkedList) super.clone();
+ copy = (LinkedList<T>) super.clone();
}
catch (CloneNotSupportedException ex)
{
@@ -669,7 +669,7 @@ public class LinkedList extends AbstractSequentialList
public Object[] toArray()
{
Object[] array = new Object[size];
- Entry e = first;
+ Entry<T> e = first;
for (int i = 0; i < size; i++)
{
array[i] = e.data;
@@ -692,22 +692,66 @@ public class LinkedList extends AbstractSequentialList
* an element in this list
* @throws NullPointerException if a is null
*/
- public Object[] toArray(Object[] a)
+ public <S> S[] toArray(S[] a)
{
if (a.length < size)
- a = (Object[]) Array.newInstance(a.getClass().getComponentType(), size);
+ a = (S[]) Array.newInstance(a.getClass().getComponentType(), size);
else if (a.length > size)
a[size] = null;
- Entry e = first;
+ Entry<T> e = first;
for (int i = 0; i < size; i++)
{
- a[i] = e.data;
+ a[i] = (S) e.data;
e = e.next;
}
return a;
}
/**
+ * @since 1.5
+ */
+ public boolean offer(T value)
+ {
+ return add(value);
+ }
+
+ /**
+ * @since 1.5
+ */
+ public T element()
+ {
+ return getFirst();
+ }
+
+ /**
+ * @since 1.5
+ */
+ public T peek()
+ {
+ if (size == 0)
+ return null;
+ return getFirst();
+ }
+
+ /**
+ * @since 1.5
+ */
+ public T poll()
+ {
+ if (size == 0)
+ return null;
+ return removeFirst();
+ }
+
+ /**
+ * @since 1.5
+ */
+ public T remove()
+ {
+ return removeFirst();
+ }
+
+ /**
* Serializes this object to the given stream.
*
* @param s the stream to write to
@@ -719,7 +763,7 @@ public class LinkedList extends AbstractSequentialList
{
s.defaultWriteObject();
s.writeInt(size);
- Entry e = first;
+ Entry<T> e = first;
while (e != null)
{
s.writeObject(e.data);
@@ -742,7 +786,7 @@ public class LinkedList extends AbstractSequentialList
s.defaultReadObject();
int i = s.readInt();
while (--i >= 0)
- addLastEntry(new Entry(s.readObject()));
+ addLastEntry(new Entry<T>((T) s.readObject()));
}
/**
@@ -752,19 +796,20 @@ public class LinkedList extends AbstractSequentialList
* @author Original author unknown
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private final class LinkedListItr implements ListIterator
+ private final class LinkedListItr<I>
+ implements ListIterator<I>
{
/** Number of modifications we know about. */
private int knownMod = modCount;
/** Entry that will be returned by next(). */
- private Entry next;
+ private Entry<I> next;
/** Entry that will be returned by previous(). */
- private Entry previous;
+ private Entry<I> previous;
/** Entry that will be affected by remove() or set(). */
- private Entry lastReturned;
+ private Entry<I> lastReturned;
/** Index of `next'. */
private int position;
@@ -779,11 +824,11 @@ public class LinkedList extends AbstractSequentialList
if (index == size)
{
next = null;
- previous = last;
+ previous = (Entry<I>) last;
}
else
{
- next = getEntry(index);
+ next = (Entry<I>) getEntry(index);
previous = next.previous;
}
position = index;
@@ -847,7 +892,7 @@ public class LinkedList extends AbstractSequentialList
* @throws ConcurrentModificationException if the list was modified
* @throws NoSuchElementException if there is no next
*/
- public Object next()
+ public I next()
{
checkMod();
if (next == null)
@@ -865,7 +910,7 @@ public class LinkedList extends AbstractSequentialList
* @throws ConcurrentModificationException if the list was modified
* @throws NoSuchElementException if there is no previous
*/
- public Object previous()
+ public I previous()
{
checkMod();
if (previous == null)
@@ -895,7 +940,7 @@ public class LinkedList extends AbstractSequentialList
next = lastReturned.next;
previous = lastReturned.previous;
- removeEntry(lastReturned);
+ removeEntry((Entry<T>) lastReturned);
knownMod++;
lastReturned = null;
@@ -907,26 +952,26 @@ public class LinkedList extends AbstractSequentialList
* @param o the element to add
* @throws ConcurrentModificationException if the list was modified
*/
- public void add(Object o)
+ public void add(I o)
{
checkMod();
modCount++;
knownMod++;
size++;
position++;
- Entry e = new Entry(o);
+ Entry<I> e = new Entry<I>(o);
e.previous = previous;
e.next = next;
if (previous != null)
previous.next = e;
else
- first = e;
+ first = (Entry<T>) e;
if (next != null)
next.previous = e;
else
- last = e;
+ last = (Entry<T>) e;
previous = e;
lastReturned = null;
@@ -939,7 +984,7 @@ public class LinkedList extends AbstractSequentialList
* @throws ConcurrentModificationException if the list was modified
* @throws IllegalStateException if there was no last element
*/
- public void set(Object o)
+ public void set(I o)
{
checkMod();
if (lastReturned == null)
diff --git a/libjava/classpath/java/util/List.java b/libjava/classpath/java/util/List.java
index 445811292ac..0a1c4098c80 100644
--- a/libjava/classpath/java/util/List.java
+++ b/libjava/classpath/java/util/List.java
@@ -1,5 +1,5 @@
/* List.java -- An ordered collection which allows indexed access
- Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -80,7 +80,7 @@ package java.util;
* @since 1.2
* @status updated to 1.4
*/
-public interface List extends Collection
+public interface List<E> extends Collection<E>
{
/**
* Insert an element into the list at a given position (optional operation).
@@ -100,7 +100,7 @@ public interface List extends Collection
* @throws NullPointerException if o is null and this list doesn't support
* the addition of null values.
*/
- void add(int index, Object o);
+ void add(int index, E o);
/**
* Add an element to the end of the list (optional operation). If the list
@@ -118,7 +118,7 @@ public interface List extends Collection
* @throws NullPointerException if o is null and this list doesn't support
* the addition of null values.
*/
- boolean add(Object o);
+ boolean add(E o);
/**
* Insert the contents of a collection into the list at a given position
@@ -143,7 +143,7 @@ public interface List extends Collection
* @throws NullPointerException if the specified collection is null
* @see #add(int, Object)
*/
- boolean addAll(int index, Collection c);
+ boolean addAll(int index, Collection<? extends E> c);
/**
* Add the contents of a collection to the end of the list (optional
@@ -165,7 +165,7 @@ public interface List extends Collection
* doesn't support the addition of null values.
* @see #add(Object)
*/
- boolean addAll(Collection c);
+ boolean addAll(Collection<? extends E> c);
/**
* Clear the list, such that a subsequent call to isEmpty() would return
@@ -202,7 +202,7 @@ public interface List extends Collection
* list does not support null values.
* @see #contains(Object)
*/
- boolean containsAll(Collection c);
+ boolean containsAll(Collection<?> c);
/**
* Test whether this list is equal to another object. A List is defined to be
@@ -226,7 +226,7 @@ public interface List extends Collection
* @return the element at index index in this list
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
- Object get(int index);
+ E get(int index);
/**
* Obtains a hash code for this list. In order to obey the general
@@ -276,7 +276,7 @@ while (i.hasNext())
*
* @return an Iterator over the elements of this list, in order
*/
- Iterator iterator();
+ Iterator<E> iterator();
/**
* Obtain the last index at which a given object is to be found in this
@@ -297,7 +297,7 @@ while (i.hasNext())
* @return a ListIterator over the elements of this list, in order, starting
* at the beginning
*/
- ListIterator listIterator();
+ ListIterator<E> listIterator();
/**
* Obtain a ListIterator over this list, starting at a given position.
@@ -310,7 +310,7 @@ while (i.hasNext())
* at index
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
*/
- ListIterator listIterator(int index);
+ ListIterator<E> listIterator(int index);
/**
* Remove the element at a given position in this list (optional operation).
@@ -322,7 +322,7 @@ while (i.hasNext())
* remove operation
* @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
- Object remove(int index);
+ E remove(int index);
/**
* Remove the first occurence of an object from this list (optional
@@ -357,7 +357,7 @@ while (i.hasNext())
* @see #remove(Object)
* @see #contains(Object)
*/
- boolean removeAll(Collection c);
+ boolean removeAll(Collection<?> c);
/**
* Remove all elements of this list that are not contained in a given
@@ -376,7 +376,7 @@ while (i.hasNext())
* @see #remove(Object)
* @see #contains(Object)
*/
- boolean retainAll(Collection c);
+ boolean retainAll(Collection<?> c);
/**
* Replace an element of this list with another object (optional operation).
@@ -394,7 +394,7 @@ while (i.hasNext())
* @throws NullPointerException if o is null and this
* list does not support null values.
*/
- Object set(int index, Object o);
+ E set(int index, E o);
/**
* Get the number of elements in this list. If the list contains more
@@ -420,7 +420,7 @@ while (i.hasNext())
* @throws IndexOutOfBoundsException if fromIndex &lt; 0
* || toIndex &gt; size() || fromIndex &gt; toIndex
*/
- List subList(int fromIndex, int toIndex);
+ List<E> subList(int fromIndex, int toIndex);
/**
* Copy the current contents of this list into an array.
@@ -447,5 +447,5 @@ while (i.hasNext())
* collection is not a subtype of the element type of a
* @throws NullPointerException if the specified array is null
*/
- Object[] toArray(Object[] a);
+ <T> T[] toArray(T[] a);
}
diff --git a/libjava/classpath/java/util/ListIterator.java b/libjava/classpath/java/util/ListIterator.java
index 5e17108c991..9b74528c51a 100644
--- a/libjava/classpath/java/util/ListIterator.java
+++ b/libjava/classpath/java/util/ListIterator.java
@@ -1,5 +1,5 @@
/* ListIterator.java -- Extended Iterator for iterating over ordered lists
- Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -59,7 +59,7 @@ package java.util;
* @since 1.2
* @status updated to 1.4
*/
-public interface ListIterator extends Iterator
+public interface ListIterator<E> extends Iterator<E>
{
/**
* Tests whether there are elements remaining in the list in the forward
@@ -88,7 +88,7 @@ public interface ListIterator extends Iterator
* @return the next element in the list in the forward direction
* @throws NoSuchElementException if there are no more elements
*/
- Object next();
+ E next();
/**
* Obtain the next element in the list in the reverse direction. Repeated
@@ -100,7 +100,7 @@ public interface ListIterator extends Iterator
* @return the next element in the list in the reverse direction
* @throws NoSuchElementException if there are no more elements
*/
- Object previous();
+ E previous();
/**
* Find the index of the element that would be returned by a call to next.
@@ -134,7 +134,7 @@ public interface ListIterator extends Iterator
* @throws UnsupportedOperationException if this ListIterator does not
* support the add operation.
*/
- void add(Object o);
+ void add(E o);
/**
* Remove from the list the element last returned by a call to next or
@@ -166,5 +166,5 @@ public interface ListIterator extends Iterator
* @throws UnsupportedOperationException if this ListIterator does not
* support the set operation
*/
- void set(Object o);
+ void set(E o);
}
diff --git a/libjava/classpath/java/util/ListResourceBundle.java b/libjava/classpath/java/util/ListResourceBundle.java
index 2bc51c3b013..2e48a22b50a 100644
--- a/libjava/classpath/java/util/ListResourceBundle.java
+++ b/libjava/classpath/java/util/ListResourceBundle.java
@@ -108,21 +108,21 @@ public abstract class ListResourceBundle extends ResourceBundle
*
* @return an enumeration of the keys
*/
- public Enumeration getKeys()
+ public Enumeration<String> getKeys()
{
// We make a new Set that holds all the keys, then return an enumeration
// for that. This prevents modifications from ruining the enumeration,
// as well as ignoring duplicates.
final Object[][] contents = getContents();
- Set s = new HashSet();
+ Set<String> s = new HashSet<String>();
int i = contents.length;
while (--i >= 0)
- s.add(contents[i][0]);
+ s.add((String) contents[i][0]);
ResourceBundle bundle = parent;
// Eliminate tail recursion.
while (bundle != null)
{
- Enumeration e = bundle.getKeys();
+ Enumeration<String> e = bundle.getKeys();
while (e.hasMoreElements())
s.add(e.nextElement());
bundle = bundle.parent;
diff --git a/libjava/classpath/java/util/Locale.java b/libjava/classpath/java/util/Locale.java
index d2aead43c68..4c91eeb0a48 100644
--- a/libjava/classpath/java/util/Locale.java
+++ b/libjava/classpath/java/util/Locale.java
@@ -1,5 +1,5 @@
/* Locale.java -- i18n locales
- Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -192,7 +192,7 @@ public final class Locale implements Serializable, Cloneable
*
* @serial should be -1 in serial streams
*/
- private transient int hashcode;
+ private int hashcode;
/**
* Array storing all available locales.
@@ -917,8 +917,8 @@ public final class Locale implements Serializable, Cloneable
return false;
Locale l = (Locale) obj;
- return (language == l.language
- && country == l.country
+ return (language == l.language
+ && country == l.country
&& variant == l.variant);
}
@@ -935,11 +935,9 @@ public final class Locale implements Serializable, Cloneable
private void writeObject(ObjectOutputStream s)
throws IOException
{
- s.writeObject(language);
- s.writeObject(country);
- s.writeObject(variant);
- // Hashcode field is always written as -1.
- s.writeInt(-1);
+ ObjectOutputStream.PutField fields = s.putFields();
+ fields.put("hashcode", -1);
+ s.defaultWriteObject();
}
/**
@@ -953,10 +951,10 @@ public final class Locale implements Serializable, Cloneable
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException
{
- language = ((String) s.readObject()).intern();
- country = ((String) s.readObject()).intern();
- variant = ((String) s.readObject()).intern();
- // Recompute hashcode.
+ s.defaultReadObject();
+ language = language.intern();
+ country = country.intern();
+ variant = variant.intern();
hashcode = language.hashCode() ^ country.hashCode() ^ variant.hashCode();
}
} // class Locale
diff --git a/libjava/classpath/java/util/Map.java b/libjava/classpath/java/util/Map.java
index 986ab9a84b4..67b3d8aa507 100644
--- a/libjava/classpath/java/util/Map.java
+++ b/libjava/classpath/java/util/Map.java
@@ -78,7 +78,7 @@ package java.util;
* @since 1.2
* @status updated to 1.4
*/
-public interface Map
+public interface Map<K, V>
{
/**
* Remove all entries from this Map (optional operation).
@@ -127,7 +127,7 @@ public interface Map
* @return the set view of all mapping entries
* @see Map.Entry
*/
- Set entrySet();
+ Set<Map.Entry<K, V>> entrySet();
/**
* Compares the specified object with this map for equality. Returns
@@ -153,7 +153,7 @@ public interface Map
* @throws NullPointerException if this map does not accept null keys
* @see #containsKey(Object)
*/
- Object get(Object key);
+ V get(Object key);
/**
* Associates the given key to the given value (optional operation). If the
@@ -172,7 +172,7 @@ public interface Map
* and the map forbids null keys or values
* @see #containsKey(Object)
*/
- Object put(Object key, Object value);
+ V put(K key, V value);
/**
* Returns the hash code for this map. This is the sum of all hashcodes
@@ -204,7 +204,7 @@ public interface Map
*
* @return the set view of all keys
*/
- Set keySet();
+ Set<K> keySet();
/**
* Copies all entries of the given map to this one (optional operation). If
@@ -219,7 +219,7 @@ public interface Map
* if <code>m</code> is null.
* @see #put(Object, Object)
*/
- void putAll(Map m);
+ void putAll(Map<? extends K, ? extends V> m);
/**
* Removes the mapping for this key if present (optional operation). If
@@ -234,7 +234,7 @@ public interface Map
* @throws ClassCastException if the type of the key is not a valid type
* for this map.
*/
- Object remove(Object key);
+ V remove(Object o);
/**
* Returns the number of key-value mappings in the map. If there are more
@@ -257,7 +257,7 @@ public interface Map
*
* @return the collection view of all values
*/
- Collection values();
+ Collection<V> values();
/**
* A map entry (key-value pair). The Map.entrySet() method returns a set
@@ -273,14 +273,14 @@ public interface Map
* @since 1.2
* @status updated to 1.4
*/
- interface Entry
+ interface Entry<K, V>
{
/**
* Get the key corresponding to this entry.
*
* @return the key
*/
- Object getKey();
+ K getKey();
/**
* Get the value corresponding to this entry. If you already called
@@ -288,7 +288,7 @@ public interface Map
*
* @return the value
*/
- Object getValue();
+ V getValue();
/**
* Replaces the value with the specified object (optional operation).
@@ -303,7 +303,7 @@ public interface Map
* prevents it from existing in this map
* @throws NullPointerException if the map forbids null values
*/
- Object setValue(Object value);
+ V setValue(V value);
/**
diff --git a/libjava/classpath/java/util/PriorityQueue.java b/libjava/classpath/java/util/PriorityQueue.java
new file mode 100644
index 00000000000..c9cfd8b0fba
--- /dev/null
+++ b/libjava/classpath/java/util/PriorityQueue.java
@@ -0,0 +1,335 @@
+/* PriorityQueue.java -- Unbounded priority queue
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.util;
+
+import java.io.Serializable;
+
+/**
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class PriorityQueue<E> extends AbstractQueue<E> implements Serializable
+{
+ private static final int DEFAULT_CAPACITY = 11;
+
+ private static final long serialVersionUID = -7720805057305804111L;
+
+ /** Number of elements actually used in the storage array. */
+ int used;
+
+ /**
+ * This is the storage for the underlying binomial heap.
+ * The idea is, each node is less than or equal to its children.
+ * A node at index N (0-based) has two direct children, at
+ * nodes 2N+1 and 2N+2.
+ */
+ E[] storage;
+
+ /**
+ * The comparator we're using, or null for natural ordering.
+ */
+ Comparator<? super E> comparator;
+
+ public PriorityQueue()
+ {
+ this(DEFAULT_CAPACITY, null);
+ }
+
+ public PriorityQueue(Collection<? extends E> c)
+ {
+ this(Math.max(1, (int) (1.1 * c.size())), null);
+
+ // Special case where we can find the comparator to use.
+ if (c instanceof SortedSet)
+ {
+ SortedSet<? extends E> ss = (SortedSet<? extends E>) c;
+ this.comparator = (Comparator<? super E>) ss.comparator();
+ // We can insert the elements directly, since they are sorted.
+ int i = 0;
+ for (E val : ss)
+ {
+ if (val == null)
+ throw new NullPointerException();
+ storage[i++] = val;
+ }
+ }
+ else if (c instanceof PriorityQueue)
+ {
+ PriorityQueue<? extends E> pq = (PriorityQueue<? extends E>) c;
+ this.comparator = (Comparator<? super E>)pq.comparator();
+ // We can just copy the contents.
+ System.arraycopy(pq.storage, 0, storage, 0, pq.storage.length);
+ }
+
+ addAll(c);
+ }
+
+ public PriorityQueue(int cap)
+ {
+ this(cap, null);
+ }
+
+ public PriorityQueue(int cap, Comparator<? super E> comp)
+ {
+ if (cap < 1)
+ throw new IllegalArgumentException();
+ this.used = 0;
+ this.storage = (E[]) new Object[cap];
+ this.comparator = comp;
+ }
+
+ public PriorityQueue(PriorityQueue<? extends E> c)
+ {
+ this(Math.max(1, (int) (1.1 * c.size())),
+ (Comparator<? super E>)c.comparator());
+ // We can just copy the contents.
+ System.arraycopy(c.storage, 0, storage, 0, c.storage.length);
+ }
+
+ public PriorityQueue(SortedSet<? extends E> c)
+ {
+ this(Math.max(1, (int) (1.1 * c.size())),
+ (Comparator<? super E>)c.comparator());
+ // We can insert the elements directly, since they are sorted.
+ int i = 0;
+ for (E val : c)
+ {
+ if (val == null)
+ throw new NullPointerException();
+ storage[i++] = val;
+ }
+ }
+
+ public void clear()
+ {
+ Arrays.fill(storage, null);
+ used = 0;
+ }
+
+ public Comparator<? super E> comparator()
+ {
+ return comparator;
+ }
+
+ public Iterator<E> iterator()
+ {
+ return new Iterator<E>()
+ {
+ int index = -1;
+ int count = 0;
+
+ public boolean hasNext()
+ {
+ return count < used;
+ }
+
+ public E next()
+ {
+ while (storage[++index] == null)
+ ;
+ ++count;
+ return storage[index];
+ }
+
+ public void remove()
+ {
+ PriorityQueue.this.remove(index);
+ index--;
+ }
+ };
+ }
+
+ public boolean offer(E o)
+ {
+ if (o == null)
+ throw new NullPointerException();
+
+ int slot = findSlot(-1);
+
+ storage[slot] = o;
+ ++used;
+ bubbleUp(slot);
+
+ return true;
+ }
+
+ public E peek()
+ {
+ return used == 0 ? null : storage[0];
+ }
+
+ public E poll()
+ {
+ if (used == 0)
+ return null;
+ E result = storage[0];
+ remove(0);
+ return result;
+ }
+
+ public boolean remove(Object o)
+ {
+ if (o != null)
+ {
+ for (int i = 0; i < storage.length; ++i)
+ {
+ if (o.equals(storage[i]))
+ {
+ remove(i);
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public int size()
+ {
+ return used;
+ }
+
+ // It is more efficient to implement this locally -- less searching
+ // for free slots.
+ public boolean addAll(Collection<? extends E> c)
+ {
+ if (c == this)
+ throw new IllegalArgumentException();
+
+ int newSlot = -1;
+ int save = used;
+ for (E val : c)
+ {
+ if (val == null)
+ throw new NullPointerException();
+ newSlot = findSlot(newSlot);
+ storage[newSlot] = val;
+ ++used;
+ bubbleUp(newSlot);
+ }
+
+ return save != used;
+ }
+
+ int findSlot(int start)
+ {
+ int slot;
+ if (used == storage.length)
+ {
+ resize();
+ slot = used;
+ }
+ else
+ {
+ for (slot = start + 1; slot < storage.length; ++slot)
+ {
+ if (storage[slot] == null)
+ break;
+ }
+ // We'll always find a slot.
+ }
+ return slot;
+ }
+
+ void remove(int index)
+ {
+ // Remove the element at INDEX. We do this by finding the least
+ // child and moving it into place, then iterating until we reach
+ // the bottom of the tree.
+ while (storage[index] != null)
+ {
+ int child = 2 * index + 1;
+
+ // See if we went off the end.
+ if (child >= storage.length)
+ {
+ storage[index] = null;
+ break;
+ }
+
+ // Find which child we want to promote. If one is not null,
+ // we pick it. If both are null, it doesn't matter, we're
+ // about to leave. If neither is null, pick the lesser.
+ if (child + 1 >= storage.length || storage[child + 1] == null)
+ {
+ // Nothing.
+ }
+ else if (storage[child] == null
+ || (Collections.compare(storage[child], storage[child + 1],
+ comparator) > 0))
+ ++child;
+ storage[index] = storage[child];
+ index = child;
+ }
+ --used;
+ }
+
+ void bubbleUp(int index)
+ {
+ // The element at INDEX was inserted into a blank spot. Now move
+ // it up the tree to its natural resting place.
+ while (index > 0)
+ {
+ // This works regardless of whether we're at 2N+1 or 2N+2.
+ int parent = (index - 1) / 2;
+ if (Collections.compare(storage[parent], storage[index], comparator)
+ <= 0)
+ {
+ // Parent is the same or smaller than this element, so the
+ // invariant is preserved. Note that if the new element
+ // is smaller than the parent, then it is necessarily
+ // smaller than the parent's other child.
+ break;
+ }
+
+ E temp = storage[index];
+ storage[index] = storage[parent];
+ storage[parent] = temp;
+
+ index = parent;
+ }
+ }
+
+ void resize()
+ {
+ E[] new_data = (E[]) new Object[2 * storage.length];
+ System.arraycopy(storage, 0, new_data, 0, storage.length);
+ storage = new_data;
+ }
+}
diff --git a/libjava/classpath/java/util/Properties.java b/libjava/classpath/java/util/Properties.java
index eb208f5a93d..e294fee7ea9 100644
--- a/libjava/classpath/java/util/Properties.java
+++ b/libjava/classpath/java/util/Properties.java
@@ -104,7 +104,7 @@ s16=1,3</pre>
* @see PropertyResourceBundle
* @status updated to 1.4
*/
-public class Properties extends Hashtable
+public class Properties extends Hashtable<Object, Object>
{
// WARNING: Properties is a CORE class in the bootstrap cycle. See the
// comments in vm/reference/java/lang/Runtime for implications of this fact.
@@ -370,6 +370,7 @@ label = Name:\\u0020</pre>
* value that are not strings
* @deprecated use {@link #store(OutputStream, String)} instead
*/
+ @Deprecated
public void save(OutputStream out, String header)
{
try
@@ -489,7 +490,7 @@ label = Name:\\u0020</pre>
*
* @return an Enumeration of all defined keys
*/
- public Enumeration propertyNames()
+ public Enumeration<?> propertyNames()
{
// We make a new Set that holds all the keys, then return an enumeration
// for that. This prevents modifications from ruining the enumeration,
diff --git a/libjava/classpath/java/util/PropertyResourceBundle.java b/libjava/classpath/java/util/PropertyResourceBundle.java
index aaff0766a35..53a1af5360b 100644
--- a/libjava/classpath/java/util/PropertyResourceBundle.java
+++ b/libjava/classpath/java/util/PropertyResourceBundle.java
@@ -126,15 +126,17 @@ public class PropertyResourceBundle extends ResourceBundle
*
* @return an enumeration of the keys
*/
- public Enumeration getKeys()
+ public Enumeration<String> getKeys()
{
if (parent == null)
- return properties.propertyNames();
+ // FIXME: bogus cast.
+ return (Enumeration<String>) properties.propertyNames();
// We make a new Set that holds all the keys, then return an enumeration
// for that. This prevents modifications from ruining the enumeration,
// as well as ignoring duplicates.
- Set s = new HashSet();
- Enumeration e = properties.propertyNames();
+ Set<String> s = new HashSet<String>();
+ // FIXME: bogus cast.
+ Enumeration<String> e = (Enumeration<String>) properties.propertyNames();
while (e.hasMoreElements())
s.add(e.nextElement());
ResourceBundle bundle = parent;
diff --git a/libjava/classpath/java/util/ResourceBundle.java b/libjava/classpath/java/util/ResourceBundle.java
index 4dcb9ad16f8..9b82bc80152 100644
--- a/libjava/classpath/java/util/ResourceBundle.java
+++ b/libjava/classpath/java/util/ResourceBundle.java
@@ -91,6 +91,14 @@ baseName</pre>
public abstract class ResourceBundle
{
/**
+ * Maximum size of our cache of <code>ResourceBundle</code>s keyed by
+ * {@link BundleKey} instances.
+ *
+ * @see BundleKey
+ */
+ private static final int CACHE_SIZE = 100;
+
+ /**
* The parent bundle. This is consulted when you call getObject and there
* is no such resource in the current bundle. This field may be null.
*/
@@ -104,21 +112,22 @@ public abstract class ResourceBundle
private Locale locale;
/**
- * The resource bundle cache.
- */
- private static Map bundleCache;
-
- /**
- * The last default Locale we saw. If this ever changes then we have to
- * reset our caches.
- */
- private static Locale lastDefaultLocale;
-
- /**
- * The `empty' locale is created once in order to optimize
- * tryBundle().
+ * A VM-wide cache of resource bundles already fetched.
+ * <p>
+ * This {@link Map} is a Least Recently Used (LRU) cache, of the last
+ * {@link #CACHE_SIZE} accessed <code>ResourceBundle</code>s keyed by the
+ * tuple: default locale, resource-bundle name, resource-bundle locale, and
+ * classloader.
+ *
+ * @see BundleKey
*/
- private static final Locale emptyLocale = new Locale("");
+ private static Map bundleCache = new LinkedHashMap(CACHE_SIZE + 1, 0.75F, true)
+ {
+ public boolean removeEldestEntry(Map.Entry entry)
+ {
+ return size() > CACHE_SIZE;
+ }
+ };
/**
* The constructor. It does nothing special.
@@ -246,6 +255,7 @@ public abstract class ResourceBundle
by the combination of bundle name, locale, and class loader. */
private static class BundleKey
{
+ Locale defaultLocale;
String baseName;
Locale locale;
ClassLoader classLoader;
@@ -253,18 +263,19 @@ public abstract class ResourceBundle
BundleKey() {}
- BundleKey(String s, Locale l, ClassLoader cl)
+ BundleKey(Locale dl, String s, Locale l, ClassLoader cl)
{
- set(s, l, cl);
+ set(dl, s, l, cl);
}
- void set(String s, Locale l, ClassLoader cl)
+ void set(Locale dl, String s, Locale l, ClassLoader cl)
{
+ defaultLocale = dl;
baseName = s;
locale = l;
classLoader = cl;
- hashcode = baseName.hashCode() ^ locale.hashCode() ^
- classLoader.hashCode();
+ hashcode = defaultLocale.hashCode() ^ baseName.hashCode()
+ ^ locale.hashCode() ^ classLoader.hashCode();
}
public int hashCode()
@@ -277,10 +288,11 @@ public abstract class ResourceBundle
if (! (o instanceof BundleKey))
return false;
BundleKey key = (BundleKey) o;
- return hashcode == key.hashcode &&
- baseName.equals(key.baseName) &&
- locale.equals(key.locale) &&
- classLoader.equals(key.classLoader);
+ return hashcode == key.hashcode
+ && defaultLocale.equals(key.defaultLocale)
+ && baseName.equals(key.baseName)
+ && locale.equals(key.locale)
+ && classLoader.equals(key.classLoader);
}
}
@@ -370,61 +382,39 @@ public abstract class ResourceBundle
public static synchronized ResourceBundle getBundle
(String baseName, Locale locale, ClassLoader classLoader)
{
- // If the default locale changed since the last time we were called,
- // all cache entries are invalidated.
Locale defaultLocale = Locale.getDefault();
- if (defaultLocale != lastDefaultLocale)
- {
- bundleCache = new HashMap();
- lastDefaultLocale = defaultLocale;
- }
-
// This will throw NullPointerException if any arguments are null.
- lookupKey.set(baseName, locale, classLoader);
-
+ lookupKey.set(defaultLocale, baseName, locale, classLoader);
Object obj = bundleCache.get(lookupKey);
- ResourceBundle rb = null;
-
if (obj instanceof ResourceBundle)
+ return (ResourceBundle) obj;
+
+ if (obj == nullEntry)
+ throw new MissingResourceException("Bundle " + baseName
+ + " not found for locale " + locale
+ + " by classloader " + classLoader,
+ baseName, "");
+ // First, look for a bundle for the specified locale. We don't want
+ // the base bundle this time.
+ boolean wantBase = locale.equals(defaultLocale);
+ ResourceBundle bundle = tryBundle(baseName, locale, classLoader, wantBase);
+ // Try the default locale if neccessary.
+ if (bundle == null && ! wantBase)
+ bundle = tryBundle(baseName, defaultLocale, classLoader, true);
+
+ BundleKey key = new BundleKey(defaultLocale, baseName, locale, classLoader);
+ if (bundle == null)
{
- return (ResourceBundle) obj;
- }
- else if (obj == nullEntry)
- {
- // Lookup has failed previously. Fall through.
+ // Cache the fact that this lookup has previously failed.
+ bundleCache.put(key, nullEntry);
+ throw new MissingResourceException("Bundle " + baseName
+ + " not found for locale " + locale
+ + " by classloader " + classLoader,
+ baseName, "");
}
- else
- {
- // First, look for a bundle for the specified locale. We don't want
- // the base bundle this time.
- boolean wantBase = locale.equals(defaultLocale);
- ResourceBundle bundle = tryBundle(baseName, locale, classLoader,
- wantBase);
-
- // Try the default locale if neccessary.
- if (bundle == null && !locale.equals(defaultLocale))
- bundle = tryBundle(baseName, defaultLocale, classLoader, true);
-
- BundleKey key = new BundleKey(baseName, locale, classLoader);
- if (bundle == null)
- {
- // Cache the fact that this lookup has previously failed.
- bundleCache.put(key, nullEntry);
- }
- else
- {
- // Cache the result and return it.
- bundleCache.put(key, bundle);
- return bundle;
- }
- }
-
- throw new MissingResourceException("Bundle " + baseName
- + " not found for locale "
- + locale
- + " by classloader "
- + classLoader,
- baseName, "");
+ // Cache the result and return it.
+ bundleCache.put(key, bundle);
+ return bundle;
}
/**
@@ -447,7 +437,7 @@ public abstract class ResourceBundle
*
* @return an enumeration of the keys
*/
- public abstract Enumeration getKeys();
+ public abstract Enumeration<String> getKeys();
/**
* Tries to load a class or a property file with the specified name.
diff --git a/libjava/classpath/java/util/Set.java b/libjava/classpath/java/util/Set.java
index 839959e620c..35f75b5e798 100644
--- a/libjava/classpath/java/util/Set.java
+++ b/libjava/classpath/java/util/Set.java
@@ -1,5 +1,6 @@
/* Set.java -- A collection that prohibits duplicates
- Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -66,7 +67,7 @@ package java.util;
* @since 1.2
* @status updated to 1.4
*/
-public interface Set extends Collection
+public interface Set<E> extends Collection<E>
{
/**
* Adds the specified element to the set if it is not already present
@@ -83,7 +84,7 @@ public interface Set extends Collection
* being added
* @throws NullPointerException if null is not permitted in this set
*/
- boolean add(Object o);
+ boolean add(E o);
/**
* Adds all of the elements of the given collection to this set (optional
@@ -102,7 +103,7 @@ public interface Set extends Collection
* if the argument c is null
* @see #add(Object)
*/
- boolean addAll(Collection c);
+ boolean addAll(Collection<? extends E> c);
/**
* Removes all elements from this set (optional operation). This set will
@@ -139,7 +140,7 @@ public interface Set extends Collection
* set doesn't support null values.
* @see #contains(Object)
*/
- boolean containsAll(Collection c);
+ boolean containsAll(Collection<?> c);
/**
* Compares the specified object to this for equality. For sets, the object
@@ -173,7 +174,7 @@ public interface Set extends Collection
*
* @return a set iterator
*/
- Iterator iterator();
+ Iterator<E> iterator();
/**
* Removes the specified element from this set (optional operation). If
@@ -205,7 +206,7 @@ public interface Set extends Collection
* set doesn't support removing null values.
* @see #remove(Object)
*/
- boolean removeAll(Collection c);
+ boolean removeAll(Collection<?> c);
/**
* Retains only the elements in this set that are also in the specified
@@ -222,7 +223,7 @@ public interface Set extends Collection
* set doesn't support retaining null values.
* @see #remove(Object)
*/
- boolean retainAll(Collection c);
+ boolean retainAll(Collection<?> c);
/**
* Returns the number of elements in the set. If there are more
@@ -260,5 +261,5 @@ public interface Set extends Collection
* @throws NullPointerException if a is null
* @see #toArray()
*/
- Object[] toArray(Object[] a);
+ <T> T[] toArray(T[] a);
}
diff --git a/libjava/classpath/java/util/SortedMap.java b/libjava/classpath/java/util/SortedMap.java
index acfbd0d3639..2b98848f4de 100644
--- a/libjava/classpath/java/util/SortedMap.java
+++ b/libjava/classpath/java/util/SortedMap.java
@@ -1,5 +1,5 @@
/* SortedMap.java -- A map that makes guarantees about the order of its keys
- Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -72,7 +72,7 @@ package java.util;
* @since 1.2
* @status updated to 1.4
*/
-public interface SortedMap extends Map
+public interface SortedMap<K, V> extends Map<K, V>
{
/**
* Returns the comparator used in sorting this map, or null if it is
@@ -80,7 +80,7 @@ public interface SortedMap extends Map
*
* @return the sorting comparator
*/
- Comparator comparator();
+ Comparator<? super K> comparator();
/**
* Returns the first (lowest sorted) key in the map.
@@ -88,7 +88,7 @@ public interface SortedMap extends Map
* @return the first key
* @throws NoSuchElementException if this map is empty.
*/
- Object firstKey();
+ K firstKey();
/**
* Returns a view of the portion of the map strictly less than toKey. The
@@ -110,7 +110,7 @@ public interface SortedMap extends Map
* @throws NullPointerException if toKey is null but the map does not allow
* null keys
*/
- SortedMap headMap(Object toKey);
+ SortedMap<K, V> headMap(K toKey);
/**
* Returns the last (highest sorted) key in the map.
@@ -118,7 +118,7 @@ public interface SortedMap extends Map
* @return the last key
* @throws NoSuchElementException if this map is empty.
*/
- Object lastKey();
+ K lastKey();
/**
* Returns a view of the portion of the map greater than or equal to
@@ -146,7 +146,7 @@ public interface SortedMap extends Map
* @throws NullPointerException if fromKey or toKey is null but the map
* does not allow null keys
*/
- SortedMap subMap(Object fromKey, Object toKey);
+ SortedMap<K, V> subMap(K fromKey, K toKey);
/**
* Returns a view of the portion of the map greater than or equal to
@@ -169,5 +169,5 @@ public interface SortedMap extends Map
* @throws NullPointerException if fromKey is null but the map does not allow
* null keys
*/
- SortedMap tailMap(Object fromKey);
+ SortedMap<K, V> tailMap(K fromKey);
}
diff --git a/libjava/classpath/java/util/SortedSet.java b/libjava/classpath/java/util/SortedSet.java
index 48a24a8e0f9..89f155a0dc0 100644
--- a/libjava/classpath/java/util/SortedSet.java
+++ b/libjava/classpath/java/util/SortedSet.java
@@ -1,6 +1,6 @@
/* SortedSet.java -- A set that makes guarantees about the order of its
elements
- Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -74,7 +74,7 @@ package java.util;
* @since 1.2
* @status updated to 1.4
*/
-public interface SortedSet extends Set
+public interface SortedSet<E> extends Set<E>
{
/**
* Returns the comparator used in sorting this set, or null if it is
@@ -82,7 +82,7 @@ public interface SortedSet extends Set
*
* @return the sorting comparator
*/
- Comparator comparator();
+ Comparator<? super E> comparator();
/**
* Returns the first (lowest sorted) element in the set.
@@ -90,7 +90,7 @@ public interface SortedSet extends Set
* @return the first element
* @throws NoSuchElementException if the set is empty.
*/
- Object first();
+ E first();
/**
* Returns a view of the portion of the set strictly less than toElement. The
@@ -113,7 +113,7 @@ public interface SortedSet extends Set
* @throws NullPointerException if toElement is null but the set does not
* allow null elements
*/
- SortedSet headSet(Object toElement);
+ SortedSet<E> headSet(E toElement);
/**
* Returns the last (highest sorted) element in the set.
@@ -121,7 +121,7 @@ public interface SortedSet extends Set
* @return the last element
* @throws NoSuchElementException if the set is empty.
*/
- Object last();
+ E last();
/**
* Returns a view of the portion of the set greater than or equal to
@@ -149,7 +149,7 @@ public interface SortedSet extends Set
* @throws NullPointerException if fromElement or toElement is null but the
* set does not allow null elements
*/
- SortedSet subSet(Object fromElement, Object toElement);
+ SortedSet<E> subSet(E fromElement, E toElement);
/**
* Returns a view of the portion of the set greater than or equal to
@@ -172,5 +172,5 @@ public interface SortedSet extends Set
* @throws NullPointerException if fromElement is null but the set does not
* allow null elements
*/
- SortedSet tailSet(Object fromElement);
+ SortedSet<E> tailSet(E fromElement);
}
diff --git a/libjava/classpath/java/util/Stack.java b/libjava/classpath/java/util/Stack.java
index 730ce177cd1..404a146c272 100644
--- a/libjava/classpath/java/util/Stack.java
+++ b/libjava/classpath/java/util/Stack.java
@@ -1,6 +1,7 @@
/* Stack.java - Class that provides a Last In First Out (LIFO)
datatype, known more commonly as a Stack
- Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -58,7 +59,7 @@ package java.util;
* @since 1.0
* @status updated to 1.4
*/
-public class Stack extends Vector
+public class Stack<T> extends Vector<T>
{
// We could use Vector methods internally for the following methods,
// but have used Vector fields directly for efficiency (i.e. this
@@ -84,7 +85,7 @@ public class Stack extends Vector
* @return the Object pushed onto the stack
* @see Vector#addElement(Object)
*/
- public Object push(Object item)
+ public T push(T item)
{
// When growing the Stack, use the Vector routines in case more
// memory is needed.
@@ -101,13 +102,13 @@ public class Stack extends Vector
* @return the Object popped from the stack
* @throws EmptyStackException if the stack is empty
*/
- public synchronized Object pop()
+ public synchronized T pop()
{
if (elementCount == 0)
throw new EmptyStackException();
modCount++;
- Object obj = elementData[--elementCount];
+ T obj = elementData[--elementCount];
// Set topmost element to null to assist the gc in cleanup.
elementData[elementCount] = null;
@@ -120,7 +121,7 @@ public class Stack extends Vector
* @return the top Object on the stack
* @throws EmptyStackException if the stack is empty
*/
- public synchronized Object peek()
+ public synchronized T peek()
{
if (elementCount == 0)
throw new EmptyStackException();
diff --git a/libjava/classpath/java/util/StringTokenizer.java b/libjava/classpath/java/util/StringTokenizer.java
index 21298c75ec7..0b59abe2fda 100644
--- a/libjava/classpath/java/util/StringTokenizer.java
+++ b/libjava/classpath/java/util/StringTokenizer.java
@@ -58,7 +58,7 @@ package java.util;
* @see java.io.StreamTokenizer
* @status updated to 1.4
*/
-public class StringTokenizer implements Enumeration
+public class StringTokenizer implements Enumeration<Object>
{
// WARNING: StringTokenizer is a CORE class in the bootstrap cycle. See the
// comments in vm/reference/java/lang/Runtime for implications of this fact.
diff --git a/libjava/classpath/java/util/Timer.java b/libjava/classpath/java/util/Timer.java
index 01a6fe8eab3..9b23a8fe709 100644
--- a/libjava/classpath/java/util/Timer.java
+++ b/libjava/classpath/java/util/Timer.java
@@ -306,50 +306,50 @@ public class Timer
// Null out any elements that are canceled. Skip element 0 as
// it is the sentinel.
for (int i = elements; i > 0; --i)
- {
- if (heap[i].scheduled < 0)
- {
- ++removed;
-
- // Remove an element by pushing the appropriate child
- // into place, and then iterating to the bottom of the
- // tree.
- int index = i;
- while (heap[index] != null)
- {
- int child = 2 * index;
- if (child >= heap.length)
- {
- // Off end; we're done.
- heap[index] = null;
- break;
- }
-
- if (child + 1 >= heap.length || heap[child + 1] == null)
- {
- // Nothing -- we're done.
- }
- else if (heap[child] == null
- || (heap[child].scheduled
- > heap[child + 1].scheduled))
- ++child;
- heap[index] = heap[child];
- index = child;
- }
- }
- }
-
+ {
+ if (heap[i].scheduled < 0)
+ {
+ ++removed;
+
+ // Remove an element by pushing the appropriate child
+ // into place, and then iterating to the bottom of the
+ // tree.
+ int index = i;
+ while (heap[index] != null)
+ {
+ int child = 2 * index;
+ if (child >= heap.length)
+ {
+ // Off end; we're done.
+ heap[index] = null;
+ break;
+ }
+
+ if (child + 1 >= heap.length || heap[child + 1] == null)
+ {
+ // Nothing -- we're done.
+ }
+ else if (heap[child] == null
+ || (heap[child].scheduled
+ > heap[child + 1].scheduled))
+ ++child;
+ heap[index] = heap[child];
+ index = child;
+ }
+ }
+ }
+
// Make a new heap if we shrank enough.
int newLen = heap.length;
while (elements - removed + DEFAULT_SIZE / 2 <= newLen / 4)
- newLen /= 2;
+ newLen /= 2;
if (newLen != heap.length)
- {
- TimerTask[] newHeap = new TimerTask[newLen];
- System.arraycopy(heap, 0, newHeap, 0, elements + 1);
- heap = newHeap;
- }
-
+ {
+ TimerTask[] newHeap = new TimerTask[newLen];
+ System.arraycopy(heap, 0, newHeap, 0, elements + 1);
+ heap = newHeap;
+ }
+
return removed;
}
} // TaskQueue
@@ -474,11 +474,11 @@ public class Timer
this(daemon, Thread.NORM_PRIORITY);
}
- /**
+ /**
* Create a new Timer whose Thread has the indicated name. It will have
* normal priority and will not be a daemon thread.
* @param name the name of the Thread
- * @since 1.5
+ * @since 1.5
*/
public Timer(String name)
{
@@ -691,7 +691,7 @@ public class Timer
{
queue.setNullOnEmpty(true);
}
-
+
/**
* Removes all cancelled tasks from the queue.
* @return the number of tasks removed
diff --git a/libjava/classpath/java/util/TreeMap.java b/libjava/classpath/java/util/TreeMap.java
index 60d0a4d50a1..88abce10d8d 100644
--- a/libjava/classpath/java/util/TreeMap.java
+++ b/libjava/classpath/java/util/TreeMap.java
@@ -90,8 +90,8 @@ import java.io.Serializable;
* @since 1.2
* @status updated to 1.4
*/
-public class TreeMap extends AbstractMap
- implements SortedMap, Cloneable, Serializable
+public class TreeMap<K, V> extends AbstractMap<K, V>
+ implements SortedMap<K, V>, Cloneable, Serializable
{
// Implementation note:
// A red-black tree is a binary search tree with the additional properties
@@ -140,7 +140,7 @@ public class TreeMap extends AbstractMap
/**
* The cache for {@link #entrySet()}.
*/
- private transient Set entries;
+ private transient Set<Map.Entry<K,V>> entries;
/**
* Counts the number of modifications this TreeMap has undergone, used
@@ -154,7 +154,7 @@ public class TreeMap extends AbstractMap
* Package visible for use by nested classes.
* @serial the comparator ordering this tree, or null
*/
- final Comparator comparator;
+ final Comparator<? super K> comparator;
/**
* Class to represent an entry in the tree. Holds a single key-value pair,
@@ -162,25 +162,25 @@ public class TreeMap extends AbstractMap
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private static final class Node extends AbstractMap.BasicMapEntry
+ private static final class Node<K, V> extends AbstractMap.SimpleEntry<K, V>
{
// All fields package visible for use by nested classes.
/** The color of this node. */
int color;
/** The left child node. */
- Node left = nil;
+ Node<K, V> left = nil;
/** The right child node. */
- Node right = nil;
+ Node<K, V> right = nil;
/** The parent node. */
- Node parent = nil;
+ Node<K, V> parent = nil;
/**
* Simple constructor.
* @param key the key
* @param value the value
*/
- Node(Object key, Object value, int color)
+ Node(K key, V value, int color)
{
super(key, value);
this.color = color;
@@ -210,7 +210,7 @@ public class TreeMap extends AbstractMap
* @param c the sort order for the keys of this map, or null
* for the natural order
*/
- public TreeMap(Comparator c)
+ public TreeMap(Comparator<? super K> c)
{
comparator = c;
fabricateTree(0);
@@ -230,7 +230,7 @@ public class TreeMap extends AbstractMap
* @throws NullPointerException if map is null
* @see Comparable
*/
- public TreeMap(Map map)
+ public TreeMap(Map<? extends K, ? extends V> map)
{
this((Comparator) null);
putAll(map);
@@ -244,7 +244,7 @@ public class TreeMap extends AbstractMap
* @param sm a SortedMap, whose entries will be put into this TreeMap
* @throws NullPointerException if sm is null
*/
- public TreeMap(SortedMap sm)
+ public TreeMap(SortedMap<K, ? extends V> sm)
{
this(sm.comparator());
int pos = sm.size();
@@ -313,7 +313,7 @@ public class TreeMap extends AbstractMap
*
* @return the map's comparator
*/
- public Comparator comparator()
+ public Comparator<? super K> comparator()
{
return comparator;
}
@@ -329,7 +329,7 @@ public class TreeMap extends AbstractMap
*/
public boolean containsKey(Object key)
{
- return getNode(key) != nil;
+ return getNode((K) key) != nil;
}
/**
@@ -364,19 +364,19 @@ public class TreeMap extends AbstractMap
* @see #values()
* @see Map.Entry
*/
- public Set entrySet()
+ public Set<Map.Entry<K,V>> entrySet()
{
if (entries == null)
// Create an AbstractSet with custom implementations of those methods
// that can be overriden easily and efficiently.
- entries = new AbstractSet()
+ entries = new AbstractSet<Map.Entry<K,V>>()
{
public int size()
{
return size;
}
- public Iterator iterator()
+ public Iterator<Map.Entry<K,V>> iterator()
{
return new TreeIterator(ENTRIES);
}
@@ -390,8 +390,8 @@ public class TreeMap extends AbstractMap
{
if (! (o instanceof Map.Entry))
return false;
- Map.Entry me = (Map.Entry) o;
- Node n = getNode(me.getKey());
+ Map.Entry<K,V> me = (Map.Entry<K,V>) o;
+ Node<K,V> n = getNode(me.getKey());
return n != nil && AbstractSet.equals(me.getValue(), n.value);
}
@@ -399,8 +399,8 @@ public class TreeMap extends AbstractMap
{
if (! (o instanceof Map.Entry))
return false;
- Map.Entry me = (Map.Entry) o;
- Node n = getNode(me.getKey());
+ Map.Entry<K,V> me = (Map.Entry<K,V>) o;
+ Node<K,V> n = getNode(me.getKey());
if (n != nil && AbstractSet.equals(me.getValue(), n.value))
{
removeNode(n);
@@ -418,7 +418,7 @@ public class TreeMap extends AbstractMap
* @return the first key
* @throws NoSuchElementException if the map is empty
*/
- public Object firstKey()
+ public K firstKey()
{
if (root == nil)
throw new NoSuchElementException();
@@ -439,10 +439,10 @@ public class TreeMap extends AbstractMap
* @see #put(Object, Object)
* @see #containsKey(Object)
*/
- public Object get(Object key)
+ public V get(Object key)
{
// Exploit fact that nil.value == null.
- return getNode(key).value;
+ return getNode((K) key).value;
}
/**
@@ -460,9 +460,9 @@ public class TreeMap extends AbstractMap
* @throws NullPointerException if toKey is null, but the comparator does not
* tolerate null elements
*/
- public SortedMap headMap(Object toKey)
+ public SortedMap<K, V> headMap(K toKey)
{
- return new SubMap(nil, toKey);
+ return new SubMap((K)(Object)nil, toKey);
}
/**
@@ -474,19 +474,19 @@ public class TreeMap extends AbstractMap
* @see #values()
* @see #entrySet()
*/
- public Set keySet()
+ public Set<K> keySet()
{
if (keys == null)
// Create an AbstractSet with custom implementations of those methods
// that can be overriden easily and efficiently.
- keys = new AbstractSet()
+ keys = new AbstractSet<K>()
{
public int size()
{
return size;
}
- public Iterator iterator()
+ public Iterator<K> iterator()
{
return new TreeIterator(KEYS);
}
@@ -503,7 +503,7 @@ public class TreeMap extends AbstractMap
public boolean remove(Object key)
{
- Node n = getNode(key);
+ Node<K,V> n = getNode((K) key);
if (n == nil)
return false;
removeNode(n);
@@ -519,7 +519,7 @@ public class TreeMap extends AbstractMap
* @return the last key
* @throws NoSuchElementException if the map is empty
*/
- public Object lastKey()
+ public K lastKey()
{
if (root == nil)
throw new NoSuchElementException("empty");
@@ -542,10 +542,10 @@ public class TreeMap extends AbstractMap
* @see #get(Object)
* @see Object#equals(Object)
*/
- public Object put(Object key, Object value)
+ public V put(K key, V value)
{
- Node current = root;
- Node parent = nil;
+ Node<K,V> current = root;
+ Node<K,V> parent = nil;
int comparison = 0;
// Find new node's parent.
@@ -595,13 +595,13 @@ public class TreeMap extends AbstractMap
* @throws NullPointerException if a key in m is null, and the comparator
* does not tolerate nulls
*/
- public void putAll(Map m)
+ public void putAll(Map<? extends K, ? extends V> m)
{
Iterator itr = m.entrySet().iterator();
int pos = m.size();
while (--pos >= 0)
{
- Map.Entry e = (Map.Entry) itr.next();
+ Map.Entry<K,V> e = (Map.Entry<K,V>) itr.next();
put(e.getKey(), e.getValue());
}
}
@@ -619,13 +619,13 @@ public class TreeMap extends AbstractMap
* @throws NullPointerException if key is null, but the comparator does
* not tolerate nulls
*/
- public Object remove(Object key)
+ public V remove(Object key)
{
- Node n = getNode(key);
+ Node<K, V> n = getNode((K)key);
if (n == nil)
return null;
// Note: removeNode can alter the contents of n, so save value now.
- Object result = n.value;
+ V result = n.value;
removeNode(n);
return result;
}
@@ -659,7 +659,7 @@ public class TreeMap extends AbstractMap
* comparator does not tolerate null elements
* @throws IllegalArgumentException if fromKey is greater than toKey
*/
- public SortedMap subMap(Object fromKey, Object toKey)
+ public SortedMap<K, V> subMap(K fromKey, K toKey)
{
return new SubMap(fromKey, toKey);
}
@@ -679,9 +679,9 @@ public class TreeMap extends AbstractMap
* @throws NullPointerException if fromKey is null, but the comparator
* does not tolerate null elements
*/
- public SortedMap tailMap(Object fromKey)
+ public SortedMap<K, V> tailMap(K fromKey)
{
- return new SubMap(fromKey, nil);
+ return new SubMap(fromKey, (K)(Object)nil);
}
/**
@@ -694,19 +694,19 @@ public class TreeMap extends AbstractMap
* @see #keySet()
* @see #entrySet()
*/
- public Collection values()
+ public Collection<V> values()
{
if (values == null)
// We don't bother overriding many of the optional methods, as doing so
// wouldn't provide any significant performance advantage.
- values = new AbstractCollection()
+ values = new AbstractCollection<V>()
{
public int size()
{
return size;
}
- public Iterator iterator()
+ public Iterator<V> iterator()
{
return new TreeIterator(VALUES);
}
@@ -729,7 +729,7 @@ public class TreeMap extends AbstractMap
* or are not Comparable with natural ordering
* @throws NullPointerException if o1 or o2 is null with natural ordering
*/
- final int compare(Object o1, Object o2)
+ final int compare(K o1, K o2)
{
return (comparator == null
? ((Comparable) o1).compareTo(o2)
@@ -742,7 +742,7 @@ public class TreeMap extends AbstractMap
* @param node the child of the node just deleted, possibly nil
* @param parent the parent of the node just deleted, never nil
*/
- private void deleteFixup(Node node, Node parent)
+ private void deleteFixup(Node<K,V> node, Node<K,V> parent)
{
// if (parent == nil)
// throw new InternalError();
@@ -754,7 +754,7 @@ public class TreeMap extends AbstractMap
if (node == parent.left)
{
// Rebalance left side.
- Node sibling = parent.right;
+ Node<K,V> sibling = parent.right;
// if (sibling == nil)
// throw new InternalError();
if (sibling.color == RED)
@@ -798,7 +798,7 @@ public class TreeMap extends AbstractMap
else
{
// Symmetric "mirror" of left-side case.
- Node sibling = parent.left;
+ Node<K,V> sibling = parent.left;
// if (sibling == nil)
// throw new InternalError();
if (sibling.color == RED)
@@ -931,7 +931,7 @@ public class TreeMap extends AbstractMap
*
* @return the first node
*/
- final Node firstNode()
+ final Node<K, V> firstNode()
{
// Exploit fact that nil.left == nil.
Node node = root;
@@ -947,9 +947,9 @@ public class TreeMap extends AbstractMap
* @param key the key to search for
* @return the node where the key is found, or nil
*/
- final Node getNode(Object key)
+ final Node<K, V> getNode(K key)
{
- Node current = root;
+ Node<K,V> current = root;
while (current != nil)
{
int comparison = compare(key, current.key);
@@ -970,13 +970,13 @@ public class TreeMap extends AbstractMap
* @param key the upper bound, exclusive
* @return the previous node
*/
- final Node highestLessThan(Object key)
+ final Node<K,V> highestLessThan(K key)
{
if (key == nil)
return lastNode();
- Node last = nil;
- Node current = root;
+ Node<K,V> last = nil;
+ Node<K,V> current = root;
int comparison = 0;
while (current != nil)
@@ -998,7 +998,7 @@ public class TreeMap extends AbstractMap
*
* @param n the newly inserted node
*/
- private void insertFixup(Node n)
+ private void insertFixup(Node<K,V> n)
{
// Only need to rebalance when parent is a RED node, and while at least
// 2 levels deep into the tree (ie: node has a grandparent). Remember
@@ -1073,7 +1073,7 @@ public class TreeMap extends AbstractMap
*
* @return the last node
*/
- private Node lastNode()
+ private Node<K,V> lastNode()
{
// Exploit fact that nil.right == nil.
Node node = root;
@@ -1091,13 +1091,13 @@ public class TreeMap extends AbstractMap
* @param first true to return the first element instead of nil for nil key
* @return the next node
*/
- final Node lowestGreaterThan(Object key, boolean first)
+ final Node<K,V> lowestGreaterThan(K key, boolean first)
{
if (key == nil)
return first ? firstNode() : nil;
- Node last = nil;
- Node current = root;
+ Node<K,V> last = nil;
+ Node<K,V> current = root;
int comparison = 0;
while (current != nil)
@@ -1120,7 +1120,7 @@ public class TreeMap extends AbstractMap
* @param node the current node, not nil
* @return the prior node in sorted order
*/
- private Node predecessor(Node node)
+ private Node<K,V> predecessor(Node<K,V> node)
{
if (node.left != nil)
{
@@ -1169,21 +1169,21 @@ public class TreeMap extends AbstractMap
/**
* Construct a tree from sorted keys in linear time, with values of "".
- * Package visible for use by TreeSet.
+ * Package visible for use by TreeSet, which uses a value type of String.
*
* @param keys the iterator over the sorted keys
* @param count the number of nodes to insert
* @see TreeSet#TreeSet(SortedSet)
*/
- final void putKeysLinear(Iterator keys, int count)
+ final void putKeysLinear(Iterator<K> keys, int count)
{
fabricateTree(count);
- Node node = firstNode();
+ Node<K,V> node = firstNode();
while (--count >= 0)
{
node.key = keys.next();
- node.value = "";
+ node.value = (V) "";
node = successor(node);
}
}
@@ -1211,10 +1211,10 @@ public class TreeMap extends AbstractMap
*
* @param node the node to remove
*/
- final void removeNode(Node node)
+ final void removeNode(Node<K,V> node)
{
- Node splice;
- Node child;
+ Node<K,V> splice;
+ Node<K,V> child;
modCount++;
size--;
@@ -1268,7 +1268,7 @@ public class TreeMap extends AbstractMap
*
* @param node the node to rotate
*/
- private void rotateLeft(Node node)
+ private void rotateLeft(Node<K,V> node)
{
Node child = node.right;
// if (node == nil || child == nil)
@@ -1301,7 +1301,7 @@ public class TreeMap extends AbstractMap
*
* @param node the node to rotate
*/
- private void rotateRight(Node node)
+ private void rotateRight(Node<K,V> node)
{
Node child = node.left;
// if (node == nil || child == nil)
@@ -1336,7 +1336,7 @@ public class TreeMap extends AbstractMap
* @param node the current node, not nil
* @return the next node in sorted order
*/
- final Node successor(Node node)
+ final Node<K,V> successor(Node<K,V> node)
{
if (node.right != nil)
{
@@ -1346,7 +1346,7 @@ public class TreeMap extends AbstractMap
return node;
}
- Node parent = node.parent;
+ Node<K,V> parent = node.parent;
// Exploit fact that nil.right == nil and node is non-nil.
while (node == parent.right)
{
@@ -1489,24 +1489,26 @@ public class TreeMap extends AbstractMap
*
* @author Eric Blake (ebb9@email.byu.edu)
*/
- private final class SubMap extends AbstractMap implements SortedMap
+ private final class SubMap<SK extends K,SV extends V>
+ extends AbstractMap<SK,SV>
+ implements SortedMap<SK,SV>
{
/**
* The lower range of this view, inclusive, or nil for unbounded.
* Package visible for use by nested classes.
*/
- final Object minKey;
+ final SK minKey;
/**
* The upper range of this view, exclusive, or nil for unbounded.
* Package visible for use by nested classes.
*/
- final Object maxKey;
+ final SK maxKey;
/**
* The cache for {@link #entrySet()}.
*/
- private Set entries;
+ private Set<Map.Entry<SK,SV>> entries;
/**
* Create a SubMap representing the elements between minKey (inclusive)
@@ -1517,9 +1519,9 @@ public class TreeMap extends AbstractMap
* @param maxKey the upper bound
* @throws IllegalArgumentException if minKey &gt; maxKey
*/
- SubMap(Object minKey, Object maxKey)
+ SubMap(SK minKey, SK maxKey)
{
- if (minKey != nil && maxKey != nil && compare(minKey, maxKey) > 0)
+ if (minKey != nil && maxKey != nil && compare((K) minKey, (K) maxKey) > 0)
throw new IllegalArgumentException("fromKey > toKey");
this.minKey = minKey;
this.maxKey = maxKey;
@@ -1533,10 +1535,10 @@ public class TreeMap extends AbstractMap
* @param key the key to check
* @return true if the key is in range
*/
- boolean keyInRange(Object key)
+ boolean keyInRange(SK key)
{
- return ((minKey == nil || compare(key, minKey) >= 0)
- && (maxKey == nil || compare(key, maxKey) < 0));
+ return ((minKey == nil || compare((K) key, (K) minKey) >= 0)
+ && (maxKey == nil || compare((K) key, (K) maxKey) < 0));
}
public void clear()
@@ -1551,14 +1553,14 @@ public class TreeMap extends AbstractMap
}
}
- public Comparator comparator()
+ public Comparator<? super SK> comparator()
{
return comparator;
}
public boolean containsKey(Object key)
{
- return keyInRange(key) && TreeMap.this.containsKey(key);
+ return keyInRange((SK) key) && TreeMap.this.containsKey(key);
}
public boolean containsValue(Object value)
@@ -1574,19 +1576,19 @@ public class TreeMap extends AbstractMap
return false;
}
- public Set entrySet()
+ public Set<Map.Entry<SK,SV>> entrySet()
{
if (entries == null)
// Create an AbstractSet with custom implementations of those methods
// that can be overriden easily and efficiently.
- entries = new AbstractSet()
+ entries = new AbstractSet<Map.Entry<SK,SV>>()
{
public int size()
{
return SubMap.this.size();
}
- public Iterator iterator()
+ public Iterator<Map.Entry<SK,SV>> iterator()
{
Node first = lowestGreaterThan(minKey, true);
Node max = lowestGreaterThan(maxKey, false);
@@ -1602,11 +1604,11 @@ public class TreeMap extends AbstractMap
{
if (! (o instanceof Map.Entry))
return false;
- Map.Entry me = (Map.Entry) o;
- Object key = me.getKey();
+ Map.Entry<SK,SV> me = (Map.Entry<SK,SV>) o;
+ SK key = me.getKey();
if (! keyInRange(key))
return false;
- Node n = getNode(key);
+ Node<K,V> n = getNode((K) key);
return n != nil && AbstractSet.equals(me.getValue(), n.value);
}
@@ -1614,11 +1616,11 @@ public class TreeMap extends AbstractMap
{
if (! (o instanceof Map.Entry))
return false;
- Map.Entry me = (Map.Entry) o;
- Object key = me.getKey();
+ Map.Entry<SK,SV> me = (Map.Entry<SK,SV>) o;
+ SK key = me.getKey();
if (! keyInRange(key))
return false;
- Node n = getNode(key);
+ Node<K,V> n = getNode((K) key);
if (n != nil && AbstractSet.equals(me.getValue(), n.value))
{
removeNode(n);
@@ -1630,29 +1632,29 @@ public class TreeMap extends AbstractMap
return entries;
}
- public Object firstKey()
+ public SK firstKey()
{
- Node node = lowestGreaterThan(minKey, true);
+ Node<SK,SV> node = (Node<SK,SV>) lowestGreaterThan(minKey, true);
if (node == nil || ! keyInRange(node.key))
throw new NoSuchElementException();
return node.key;
}
- public Object get(Object key)
+ public SV get(Object key)
{
- if (keyInRange(key))
- return TreeMap.this.get(key);
+ if (keyInRange((SK) key))
+ return (SV) TreeMap.this.get(key);
return null;
}
- public SortedMap headMap(Object toKey)
+ public SortedMap<SK,SV> headMap(SK toKey)
{
if (! keyInRange(toKey))
throw new IllegalArgumentException("key outside range");
return new SubMap(minKey, toKey);
}
- public Set keySet()
+ public Set<SK> keySet()
{
if (this.keys == null)
// Create an AbstractSet with custom implementations of those methods
@@ -1664,7 +1666,7 @@ public class TreeMap extends AbstractMap
return SubMap.this.size();
}
- public Iterator iterator()
+ public Iterator<SK> iterator()
{
Node first = lowestGreaterThan(minKey, true);
Node max = lowestGreaterThan(maxKey, false);
@@ -1678,16 +1680,16 @@ public class TreeMap extends AbstractMap
public boolean contains(Object o)
{
- if (! keyInRange(o))
+ if (! keyInRange((SK) o))
return false;
- return getNode(o) != nil;
+ return getNode((K) o) != nil;
}
public boolean remove(Object o)
{
- if (! keyInRange(o))
+ if (! keyInRange((SK) o))
return false;
- Node n = getNode(o);
+ Node n = getNode((K) o);
if (n != nil)
{
removeNode(n);
@@ -1699,25 +1701,25 @@ public class TreeMap extends AbstractMap
return this.keys;
}
- public Object lastKey()
+ public SK lastKey()
{
- Node node = highestLessThan(maxKey);
+ Node<SK,SV> node = (Node<SK,SV>) highestLessThan(maxKey);
if (node == nil || ! keyInRange(node.key))
throw new NoSuchElementException();
- return node.key;
+ return (SK) node.key;
}
- public Object put(Object key, Object value)
+ public SV put(SK key, SV value)
{
if (! keyInRange(key))
throw new IllegalArgumentException("Key outside range");
- return TreeMap.this.put(key, value);
+ return (SV) TreeMap.this.put(key, value);
}
- public Object remove(Object key)
+ public SV remove(Object key)
{
- if (keyInRange(key))
- return TreeMap.this.remove(key);
+ if (keyInRange((SK)key))
+ return (SV) TreeMap.this.remove(key);
return null;
}
@@ -1734,21 +1736,21 @@ public class TreeMap extends AbstractMap
return count;
}
- public SortedMap subMap(Object fromKey, Object toKey)
+ public SortedMap<SK, SV> subMap(SK fromKey, SK toKey)
{
if (! keyInRange(fromKey) || ! keyInRange(toKey))
throw new IllegalArgumentException("key outside range");
return new SubMap(fromKey, toKey);
}
- public SortedMap tailMap(Object fromKey)
+ public SortedMap<SK, SV> tailMap(SK fromKey)
{
if (! keyInRange(fromKey))
throw new IllegalArgumentException("key outside range");
return new SubMap(fromKey, maxKey);
}
- public Collection values()
+ public Collection<SV> values()
{
if (this.values == null)
// Create an AbstractCollection with custom implementations of those
@@ -1760,7 +1762,7 @@ public class TreeMap extends AbstractMap
return SubMap.this.size();
}
- public Iterator iterator()
+ public Iterator<SV> iterator()
{
Node first = lowestGreaterThan(minKey, true);
Node max = lowestGreaterThan(maxKey, false);
diff --git a/libjava/classpath/java/util/TreeSet.java b/libjava/classpath/java/util/TreeSet.java
index 34cb39acc07..2851e4a5a8f 100644
--- a/libjava/classpath/java/util/TreeSet.java
+++ b/libjava/classpath/java/util/TreeSet.java
@@ -1,5 +1,5 @@
/* TreeSet.java -- a class providing a TreeMap-backed SortedSet
- Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -68,6 +68,8 @@ import java.io.Serializable;
* @author Jon Zeppieri
* @author Bryce McKinlay
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @see Collection
* @see Set
* @see HashSet
@@ -79,8 +81,8 @@ import java.io.Serializable;
* @since 1.2
* @status updated to 1.4
*/
-public class TreeSet extends AbstractSet
- implements SortedSet, Cloneable, Serializable
+public class TreeSet<T> extends AbstractSet<T>
+ implements SortedSet<T>, Cloneable, Serializable
{
/**
* Compatible with JDK 1.2.
@@ -92,7 +94,7 @@ public class TreeSet extends AbstractSet
*/
// Not final because of readObject. This will always be one of TreeMap or
// TreeMap.SubMap, which both extend AbstractMap.
- private transient SortedMap map;
+ private transient SortedMap<T, String> map;
/**
* Construct a new TreeSet whose backing TreeMap using the "natural"
@@ -103,7 +105,7 @@ public class TreeSet extends AbstractSet
*/
public TreeSet()
{
- map = new TreeMap();
+ map = new TreeMap<T, String>();
}
/**
@@ -113,9 +115,9 @@ public class TreeSet extends AbstractSet
*
* @param comparator the Comparator this Set will use
*/
- public TreeSet(Comparator comparator)
+ public TreeSet(Comparator<? super T> comparator)
{
- map = new TreeMap(comparator);
+ map = new TreeMap<T, String>(comparator);
}
/**
@@ -130,9 +132,9 @@ public class TreeSet extends AbstractSet
* @throws NullPointerException if the collection is null
* @see Comparable
*/
- public TreeSet(Collection collection)
+ public TreeSet(Collection<? extends T> collection)
{
- map = new TreeMap();
+ map = new TreeMap<T, String>();
addAll(collection);
}
@@ -145,11 +147,14 @@ public class TreeSet extends AbstractSet
* and will initialize itself with all its elements
* @throws NullPointerException if sortedSet is null
*/
- public TreeSet(SortedSet sortedSet)
+ public TreeSet(SortedSet<T> sortedSet)
{
- map = new TreeMap(sortedSet.comparator());
- Iterator itr = sortedSet.iterator();
- ((TreeMap) map).putKeysLinear(itr, sortedSet.size());
+ Iterator<T> itr;
+
+ map = new TreeMap<T, String>
+ ((Comparator<? super T>)sortedSet.comparator());
+ itr = ((SortedSet<T>) sortedSet).iterator();
+ ((TreeMap<T, String>) map).putKeysLinear(itr, sortedSet.size());
}
/**
@@ -158,7 +163,7 @@ public class TreeSet extends AbstractSet
*
* @param backingMap the submap
*/
- private TreeSet(SortedMap backingMap)
+ private TreeSet(SortedMap<T,String> backingMap)
{
map = backingMap;
}
@@ -171,7 +176,7 @@ public class TreeSet extends AbstractSet
* @throws ClassCastException if the element cannot be compared with objects
* already in the set
*/
- public boolean add(Object obj)
+ public boolean add(T obj)
{
return map.put(obj, "") == null;
}
@@ -185,11 +190,11 @@ public class TreeSet extends AbstractSet
* @throws ClassCastException if an element in c cannot be compared with
* objects already in the set
*/
- public boolean addAll(Collection c)
+ public boolean addAll(Collection<? extends T> c)
{
boolean result = false;
int pos = c.size();
- Iterator itr = c.iterator();
+ Iterator<? extends T> itr = c.iterator();
while (--pos >= 0)
result |= (map.put(itr.next(), "") == null);
return result;
@@ -210,12 +215,12 @@ public class TreeSet extends AbstractSet
*/
public Object clone()
{
- TreeSet copy = null;
+ TreeSet<T> copy = null;
try
{
- copy = (TreeSet) super.clone();
+ copy = (TreeSet<T>) super.clone();
// Map may be either TreeMap or TreeMap.SubMap, hence the ugly casts.
- copy.map = (SortedMap) ((AbstractMap) map).clone();
+ copy.map = (SortedMap<T, String>) ((AbstractMap<T, String>) map).clone();
}
catch (CloneNotSupportedException x)
{
@@ -229,7 +234,7 @@ public class TreeSet extends AbstractSet
*
* @return the comparator, or null if the set uses natural ordering
*/
- public Comparator comparator()
+ public Comparator<? super T> comparator()
{
return map.comparator();
}
@@ -253,7 +258,7 @@ public class TreeSet extends AbstractSet
* @return the first element
* @throws NoSuchElementException if the set is empty
*/
- public Object first()
+ public T first()
{
return map.firstKey();
}
@@ -273,9 +278,9 @@ public class TreeSet extends AbstractSet
* @throws NullPointerException if to is null, but the comparator does not
* tolerate null elements
*/
- public SortedSet headSet(Object to)
+ public SortedSet<T> headSet(T to)
{
- return new TreeSet(map.headMap(to));
+ return new TreeSet<T>(map.headMap(to));
}
/**
@@ -294,7 +299,7 @@ public class TreeSet extends AbstractSet
*
* @return an iterator
*/
- public Iterator iterator()
+ public Iterator<T> iterator()
{
return map.keySet().iterator();
}
@@ -305,7 +310,7 @@ public class TreeSet extends AbstractSet
* @return the last element
* @throws NoSuchElementException if the set is empty
*/
- public Object last()
+ public T last()
{
return map.lastKey();
}
@@ -351,9 +356,9 @@ public class TreeSet extends AbstractSet
* does not tolerate null elements
* @throws IllegalArgumentException if from is greater than to
*/
- public SortedSet subSet(Object from, Object to)
+ public SortedSet<T> subSet(T from, T to)
{
- return new TreeSet(map.subMap(from, to));
+ return new TreeSet<T>(map.subMap(from, to));
}
/**
@@ -371,9 +376,9 @@ public class TreeSet extends AbstractSet
* @throws NullPointerException if from is null, but the comparator
* does not tolerate null elements
*/
- public SortedSet tailSet(Object from)
+ public SortedSet<T> tailSet(T from)
{
- return new TreeSet(map.tailMap(from));
+ return new TreeSet<T>(map.tailMap(from));
}
/**
@@ -387,7 +392,7 @@ public class TreeSet extends AbstractSet
private void writeObject(ObjectOutputStream s) throws IOException
{
s.defaultWriteObject();
- Iterator itr = map.keySet().iterator();
+ Iterator<T> itr = map.keySet().iterator();
int pos = map.size();
s.writeObject(map.comparator());
s.writeInt(pos);
@@ -408,9 +413,9 @@ public class TreeSet extends AbstractSet
throws IOException, ClassNotFoundException
{
s.defaultReadObject();
- Comparator comparator = (Comparator) s.readObject();
+ Comparator<? super T> comparator = (Comparator<? super T>) s.readObject();
int size = s.readInt();
- map = new TreeMap(comparator);
- ((TreeMap) map).putFromObjStream(s, size, false);
+ map = new TreeMap<T, String>(comparator);
+ ((TreeMap<T, String>) map).putFromObjStream(s, size, false);
}
}
diff --git a/libjava/classpath/java/util/UUID.java b/libjava/classpath/java/util/UUID.java
index 6a57d27b448..9a402d15922 100644
--- a/libjava/classpath/java/util/UUID.java
+++ b/libjava/classpath/java/util/UUID.java
@@ -77,7 +77,7 @@ import java.security.NoSuchAlgorithmException;
*/
public final class UUID
extends Object
- implements Serializable, Comparable // genericizeme!
+ implements Serializable, Comparable<UUID>
{
private static final long serialVersionUID = -4856846361193249489L;
@@ -127,17 +127,6 @@ public final class UUID
*
* @return -1 if this < val, 0 if they are equal, 1 if this > val.
*/
- public int compareTo(Object val)
- {
- return compareTo((UUID)val);
- }
-
- /**
- * Compare this UUID to another.
- * The comparison is performed as between two 128-bit integers.
- *
- * @return -1 if this < val, 0 if they are equal, 1 if this > val.
- */
public int compareTo(UUID o)
{
if( mostSigBits < o.mostSigBits )
diff --git a/libjava/classpath/java/util/Vector.java b/libjava/classpath/java/util/Vector.java
index eb72ae49df8..ea29ce09315 100644
--- a/libjava/classpath/java/util/Vector.java
+++ b/libjava/classpath/java/util/Vector.java
@@ -82,8 +82,8 @@ import java.lang.reflect.Array;
* @since 1.0
* @status updated to 1.4
*/
-public class Vector extends AbstractList
- implements List, RandomAccess, Cloneable, Serializable
+public class Vector<T> extends AbstractList<T>
+ implements List<T>, RandomAccess, Cloneable, Serializable
{
/**
* Compatible with JDK 1.0+.
@@ -95,7 +95,7 @@ public class Vector extends AbstractList
* in positions 0 through elementCount - 1, and all remaining slots are null.
* @serial the elements
*/
- protected Object[] elementData;
+ protected T[] elementData;
/**
* The number of elements currently in the vector, also returned by
@@ -130,10 +130,10 @@ public class Vector extends AbstractList
* @throws NullPointerException if c is null
* @since 1.2
*/
- public Vector(Collection c)
+ public Vector(Collection<? extends T> c)
{
elementCount = c.size();
- elementData = c.toArray(new Object[elementCount]);
+ elementData = c.toArray((T[]) new Object[elementCount]);
}
/**
@@ -149,7 +149,7 @@ public class Vector extends AbstractList
{
if (initialCapacity < 0)
throw new IllegalArgumentException();
- elementData = new Object[initialCapacity];
+ elementData = (T[]) new Object[initialCapacity];
this.capacityIncrement = capacityIncrement;
}
@@ -192,7 +192,7 @@ public class Vector extends AbstractList
// vector since that is a much less likely case; it's more efficient to
// not do the check and lose a bit of performance in that infrequent case
- Object[] newArray = new Object[elementCount];
+ T[] newArray = (T[]) new Object[elementCount];
System.arraycopy(elementData, 0, newArray, 0, elementCount);
elementData = newArray;
}
@@ -218,7 +218,7 @@ public class Vector extends AbstractList
else
newCapacity = elementData.length + capacityIncrement;
- Object[] newArray = new Object[Math.max(newCapacity, minCapacity)];
+ T[] newArray = (T[]) new Object[Math.max(newCapacity, minCapacity)];
System.arraycopy(elementData, 0, newArray, 0, elementCount);
elementData = newArray;
@@ -284,9 +284,9 @@ public class Vector extends AbstractList
* @see #iterator()
*/
// No need to synchronize as the Enumeration is not thread-safe!
- public Enumeration elements()
+ public Enumeration<T> elements()
{
- return new Enumeration()
+ return new Enumeration<T>()
{
private int i = 0;
@@ -295,7 +295,7 @@ public class Vector extends AbstractList
return i < elementCount;
}
- public Object nextElement()
+ public T nextElement()
{
if (i >= elementCount)
throw new NoSuchElementException();
@@ -385,7 +385,7 @@ public class Vector extends AbstractList
* @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt;= size()
* @see #get(int)
*/
- public synchronized Object elementAt(int index)
+ public synchronized T elementAt(int index)
{
checkBoundExclusive(index);
return elementData[index];
@@ -397,7 +397,7 @@ public class Vector extends AbstractList
* @return the first Object in the Vector
* @throws NoSuchElementException the Vector is empty
*/
- public synchronized Object firstElement()
+ public synchronized T firstElement()
{
if (elementCount == 0)
throw new NoSuchElementException();
@@ -411,7 +411,7 @@ public class Vector extends AbstractList
* @return the last Object in the Vector
* @throws NoSuchElementException the Vector is empty
*/
- public synchronized Object lastElement()
+ public synchronized T lastElement()
{
if (elementCount == 0)
throw new NoSuchElementException();
@@ -427,7 +427,7 @@ public class Vector extends AbstractList
* @throws ArrayIndexOutOfBoundsException the index is out of range
* @see #set(int, Object)
*/
- public void setElementAt(Object obj, int index)
+ public void setElementAt(T obj, int index)
{
set(index, obj);
}
@@ -454,7 +454,7 @@ public class Vector extends AbstractList
* @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt; size()
* @see #add(int, Object)
*/
- public synchronized void insertElementAt(Object obj, int index)
+ public synchronized void insertElementAt(T obj, int index)
{
checkBoundInclusive(index);
if (elementCount == elementData.length)
@@ -472,7 +472,7 @@ public class Vector extends AbstractList
*
* @param obj the object to add to the Vector
*/
- public synchronized void addElement(Object obj)
+ public synchronized void addElement(T obj)
{
if (elementCount == elementData.length)
ensureCapacity(elementCount + 1);
@@ -570,11 +570,11 @@ public class Vector extends AbstractList
* @throws NullPointerException if <code>a</code> is null
* @since 1.2
*/
- public synchronized Object[] toArray(Object[] a)
+ public synchronized <S> S[] toArray(S[] a)
{
if (a.length < elementCount)
- a = (Object[]) Array.newInstance(a.getClass().getComponentType(),
- elementCount);
+ a = (S[]) Array.newInstance(a.getClass().getComponentType(),
+ elementCount);
else if (a.length > elementCount)
a[elementCount] = null;
System.arraycopy(elementData, 0, a, 0, elementCount);
@@ -589,7 +589,7 @@ public class Vector extends AbstractList
* @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt;= size()
* @since 1.2
*/
- public Object get(int index)
+ public T get(int index)
{
return elementAt(index);
}
@@ -604,10 +604,10 @@ public class Vector extends AbstractList
* @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt;= size()
* @since 1.2
*/
- public synchronized Object set(int index, Object element)
+ public synchronized T set(int index, T element)
{
checkBoundExclusive(index);
- Object temp = elementData[index];
+ T temp = elementData[index];
elementData[index] = element;
return temp;
}
@@ -619,7 +619,7 @@ public class Vector extends AbstractList
* @return true, as specified by List
* @since 1.2
*/
- public boolean add(Object o)
+ public boolean add(T o)
{
addElement(o);
return true;
@@ -647,7 +647,7 @@ public class Vector extends AbstractList
* @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt; size()
* @since 1.2
*/
- public void add(int index, Object element)
+ public void add(int index, T element)
{
insertElementAt(element, index);
}
@@ -660,10 +660,10 @@ public class Vector extends AbstractList
* @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt;= size()
* @since 1.2
*/
- public synchronized Object remove(int index)
+ public synchronized T remove(int index)
{
checkBoundExclusive(index);
- Object temp = elementData[index];
+ T temp = elementData[index];
modCount++;
elementCount--;
if (index < elementCount)
@@ -689,7 +689,7 @@ public class Vector extends AbstractList
* @throws NullPointerException if c is null
* @since 1.2
*/
- public synchronized boolean containsAll(Collection c)
+ public synchronized boolean containsAll(Collection<?> c)
{
// Here just for the sychronization.
return super.containsAll(c);
@@ -705,7 +705,7 @@ public class Vector extends AbstractList
* @throws NullPointerException if c is null
* @since 1.2
*/
- public synchronized boolean addAll(Collection c)
+ public synchronized boolean addAll(Collection<? extends T> c)
{
return addAll(elementCount, c);
}
@@ -718,10 +718,12 @@ public class Vector extends AbstractList
* @throws NullPointerException if c is null
* @since 1.2
*/
- public synchronized boolean removeAll(Collection c)
+ public synchronized boolean removeAll(Collection<?> c)
{
- if (c == null)
- throw new NullPointerException();
+ // The NullPointerException is thrown implicitly when the Vector
+ // is not empty and c is null. The RI allows null arguments when
+ // the vector is empty. See Mauve test:
+ // gnu/testlet/java/util/Vector/removeAll.java
int i;
int j;
@@ -747,10 +749,12 @@ public class Vector extends AbstractList
* @throws NullPointerException if c is null
* @since 1.2
*/
- public synchronized boolean retainAll(Collection c)
+ public synchronized boolean retainAll(Collection<?> c)
{
- if (c == null)
- throw new NullPointerException();
+ // The NullPointerException is thrown implicitly when the Vector
+ // is not empty and c is null. The RI allows null arguments when
+ // the vector is empty. See Mauve test:
+ // gnu/testlet/java/util/Vector/retainAll.java
int i;
int j;
@@ -779,10 +783,10 @@ public class Vector extends AbstractList
* @throws ArrayIndexOutOfBoundsException index &lt; 0 || index &gt; size()
* @since 1.2
*/
- public synchronized boolean addAll(int index, Collection c)
+ public synchronized boolean addAll(int index, Collection<? extends T> c)
{
checkBoundInclusive(index);
- Iterator itr = c.iterator();
+ Iterator<? extends T> itr = c.iterator();
int csize = c.size();
modCount++;
@@ -853,12 +857,12 @@ public class Vector extends AbstractList
* @see ConcurrentModificationException
* @since 1.2
*/
- public synchronized List subList(int fromIndex, int toIndex)
+ public synchronized List<T> subList(int fromIndex, int toIndex)
{
- List sub = super.subList(fromIndex, toIndex);
+ List<T> sub = super.subList(fromIndex, toIndex);
// We must specify the correct object to synchronize upon, hence the
// use of a non-public API
- return new Collections.SynchronizedList(this, sub);
+ return new Collections.SynchronizedList<T>(this, sub);
}
/**
diff --git a/libjava/classpath/java/util/WeakHashMap.java b/libjava/classpath/java/util/WeakHashMap.java
index ef2444c0409..1f460291558 100644
--- a/libjava/classpath/java/util/WeakHashMap.java
+++ b/libjava/classpath/java/util/WeakHashMap.java
@@ -1,6 +1,6 @@
/* WeakHashMap -- a hashtable that keeps only weak references
to its keys, allowing the virtual machine to reclaim them
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -77,14 +77,16 @@ import java.lang.ref.WeakReference;
*
* @author Jochen Hoenicke
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*
* @see HashMap
* @see WeakReference
* @see LinkedHashMap
* @since 1.2
- * @status updated to 1.4
+ * @status updated to 1.4 (partial 1.5)
*/
-public class WeakHashMap extends AbstractMap implements Map
+public class WeakHashMap<K,V> extends AbstractMap<K,V>
{
// WARNING: WeakHashMap is a CORE class in the bootstrap cycle. See the
// comments in vm/reference/java/lang/Runtime for implications of this fact.
@@ -349,19 +351,19 @@ public class WeakHashMap extends AbstractMap implements Map
*
* @author Jochen Hoenicke
*/
- private static class WeakBucket extends WeakReference
+ private static class WeakBucket<K, V> extends WeakReference<K>
{
/**
* The value of this entry. The key is stored in the weak
* reference that we extend.
*/
- Object value;
+ V value;
/**
* The next bucket describing another entry that uses the same
* slot.
*/
- WeakBucket next;
+ WeakBucket<K, V> next;
/**
* The slot of this entry. This should be
@@ -384,7 +386,7 @@ public class WeakHashMap extends AbstractMap implements Map
* @param slot the slot. This must match the slot where this bucket
* will be enqueued.
*/
- public WeakBucket(Object key, ReferenceQueue queue, Object value,
+ public WeakBucket(K key, ReferenceQueue queue, V value,
int slot)
{
super(key, queue);
@@ -397,18 +399,18 @@ public class WeakHashMap extends AbstractMap implements Map
* current bucket. It also keeps a strong reference to the
* key; bad things may happen otherwise.
*/
- class WeakEntry implements Map.Entry
+ class WeakEntry implements Map.Entry<K, V>
{
/**
* The strong ref to the key.
*/
- Object key;
+ K key;
/**
* Creates a new entry for the key.
* @param key the key
*/
- public WeakEntry(Object key)
+ public WeakEntry(K key)
{
this.key = key;
}
@@ -426,7 +428,7 @@ public class WeakHashMap extends AbstractMap implements Map
* Returns the key.
* @return the key
*/
- public Object getKey()
+ public K getKey()
{
return key == NULL_KEY ? null : key;
}
@@ -435,7 +437,7 @@ public class WeakHashMap extends AbstractMap implements Map
* Returns the value.
* @return the value
*/
- public Object getValue()
+ public V getValue()
{
return value;
}
@@ -446,9 +448,9 @@ public class WeakHashMap extends AbstractMap implements Map
* @param newVal the new value
* @return the old value
*/
- public Object setValue(Object newVal)
+ public V setValue(V newVal)
{
- Object oldVal = value;
+ V oldVal = value;
value = newVal;
return oldVal;
}
@@ -491,7 +493,7 @@ public class WeakHashMap extends AbstractMap implements Map
*/
WeakEntry getEntry()
{
- final Object key = this.get();
+ final K key = this.get();
if (key == null)
return null;
return new WeakEntry(key);
@@ -559,7 +561,7 @@ public class WeakHashMap extends AbstractMap implements Map
* @throws NullPointerException if m is null
* @since 1.3
*/
- public WeakHashMap(Map m)
+ public WeakHashMap(Map<? extends K, ? extends V> m)
{
this(m.size(), DEFAULT_LOAD_FACTOR);
putAll(m);
@@ -754,10 +756,10 @@ public class WeakHashMap extends AbstractMap implements Map
* the key wasn't in this map, or if the mapped value was
* explicitly set to null.
*/
- public Object get(Object key)
+ public V get(Object key)
{
cleanQueue();
- WeakBucket.WeakEntry entry = internalGet(key);
+ WeakBucket<K, V>.WeakEntry entry = internalGet(key);
return entry == null ? null : entry.getValue();
}
@@ -769,10 +771,10 @@ public class WeakHashMap extends AbstractMap implements Map
* null if the key wasn't in this map, or if the mapped value
* was explicitly set to null.
*/
- public Object put(Object key, Object value)
+ public V put(K key, V value)
{
cleanQueue();
- WeakBucket.WeakEntry entry = internalGet(key);
+ WeakBucket<K, V>.WeakEntry entry = internalGet(key);
if (entry != null)
return entry.setValue(value);
@@ -791,10 +793,10 @@ public class WeakHashMap extends AbstractMap implements Map
* null if the key wasn't in this map, or if the mapped value was
* explicitly set to null.
*/
- public Object remove(Object key)
+ public V remove(Object key)
{
cleanQueue();
- WeakBucket.WeakEntry entry = internalGet(key);
+ WeakBucket<K, V>.WeakEntry entry = internalGet(key);
if (entry == null)
return null;
@@ -811,7 +813,7 @@ public class WeakHashMap extends AbstractMap implements Map
* this weak hash map.
* @return a set representation of the entries.
*/
- public Set entrySet()
+ public Set<Map.Entry<K,V>> entrySet()
{
cleanQueue();
return theEntrySet;
@@ -846,7 +848,7 @@ public class WeakHashMap extends AbstractMap implements Map
* this weak hash map.
* @return a set representation of the keys.
*/
- public Set keySet()
+ public Set<K> keySet()
{
cleanQueue();
return super.keySet();
@@ -857,7 +859,7 @@ public class WeakHashMap extends AbstractMap implements Map
* key already exists in this map, its value is replaced.
* @param m the map to copy in
*/
- public void putAll(Map m)
+ public void putAll(Map<? extends K, ? extends V> m)
{
super.putAll(m);
}
@@ -870,7 +872,7 @@ public class WeakHashMap extends AbstractMap implements Map
* this weak hash map.
* @return a collection representation of the values.
*/
- public Collection values()
+ public Collection<V> values()
{
cleanQueue();
return super.values();
diff --git a/libjava/classpath/java/util/class-dependencies.conf b/libjava/classpath/java/util/class-dependencies.conf
new file mode 100644
index 00000000000..39f96062744
--- /dev/null
+++ b/libjava/classpath/java/util/class-dependencies.conf
@@ -0,0 +1,78 @@
+# This property file contains dependencies of classes, methods, and
+# field on other methods or classes.
+#
+# Syntax:
+#
+# <used>: <needed 1> [... <needed N>]
+#
+# means that when <used> is included, <needed 1> (... <needed N>) must
+# be included as well.
+#
+# <needed X> and <used> are of the form
+#
+# <class.methodOrField(signature)>
+#
+# or just
+#
+# <class>
+#
+# Within dependencies, variables can be used. A variable is defined as
+# follows:
+#
+# {variable}: value1 value2 ... value<n>
+#
+# variables can be used on the right side of dependencies as follows:
+#
+# <used>: com.bla.blu.{variable}.Class.m()V
+#
+# The use of the variable will expand to <n> dependencies of the form
+#
+# <used>: com.bla.blu.value1.Class.m()V
+# <used>: com.bla.blu.value2.Class.m()V
+# ...
+# <used>: com.bla.blu.value<n>.Class.m()V
+#
+# Variables can be redefined when building a system to select the
+# required support for features like encodings, protocols, etc.
+#
+# Hints:
+#
+# - For methods and fields, the signature is mandatory. For
+# specification, please see the Java Virtual Machine Specification by
+# SUN. Unlike in the spec, field signatures (types) are in brackets.
+#
+# - Package names must be separated by '/' (and not '.'). E.g.,
+# java/lang/Class (this is necessary, because the '.' is used to
+# separate method or field names from classes)
+#
+# - In case <needed> refers to a class, only the class itself will be
+# included in the resulting binary, NOT necessarily all its methods
+# and fields. If you want to refer to all methods and fields, you can
+# write class.* as an abbreviation.
+#
+# - Abbreviations for packages are also possible: my/package/* means all
+# methods and fields of all classes in my/package.
+#
+# - A line with a trailing '\' continues in the next line.
+
+
+# All calendars supported are loaded via java/util/Calendar.getBundle or
+# java/util/GregorianCalendar.getBundle from class
+# gnu/java/locale/Calendar_{locale_id}
+#
+# This introduces a dependency for the localized calendars. To allow an easy
+# selection and addition of locales, the library variable {calendar_locales}
+# can be set to the set of supported calendar locales.
+#
+
+{calendar_locales}: de en nl
+
+java/util/Calendar.getBundle(Ljava/util/Locale;)Ljava/util/ResourceBundle;: \
+ gnu/java/locale/Calendar.* \
+ gnu/java/locale/Calendar_{calendar_locales}.*
+
+java/util/GregorianCalendar.getBundle(Ljava/util/Locale;)Ljava/util/ResourceBundle;: \
+ gnu/java/locale/Calendar.* \
+ gnu/java/locale/Calendar_{calendar_locales}.*
+
+# end of file
diff --git a/libjava/classpath/java/util/concurrent/CopyOnWriteArrayList.java b/libjava/classpath/java/util/concurrent/CopyOnWriteArrayList.java
new file mode 100644
index 00000000000..5ef37d94916
--- /dev/null
+++ b/libjava/classpath/java/util/concurrent/CopyOnWriteArrayList.java
@@ -0,0 +1,490 @@
+/* CopyOnWriteArrayList.java
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.util.concurrent;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.lang.reflect.Array;
+import java.util.AbstractList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.RandomAccess;
+
+/** @since 1.5 */
+public class CopyOnWriteArrayList<E> extends AbstractList<E> implements
+ List<E>, RandomAccess, Cloneable, Serializable
+{
+ /**
+ * Where the data is stored.
+ */
+ private transient E[] data;
+
+ /**
+ * Construct a new ArrayList with the default capacity (16).
+ */
+ public CopyOnWriteArrayList()
+ {
+ data = (E[]) new Object[0];
+ }
+
+ /**
+ * Construct a new ArrayList, and initialize it with the elements in the
+ * supplied Collection. The initial capacity is 110% of the Collection's size.
+ *
+ * @param c
+ * the collection whose elements will initialize this list
+ * @throws NullPointerException
+ * if c is null
+ */
+ public CopyOnWriteArrayList(Collection< ? extends E> c)
+ {
+ // FIXME ... correct? use c.toArray()
+ data = (E[]) new Object[c.size()];
+ int index = 0;
+ for (E value : c)
+ data[index++] = value;
+ }
+
+ /**
+ * Construct a new ArrayList, and initialize it with the elements in the
+ * supplied array.
+ *
+ * @param array
+ * the array used to initialize this list
+ * @throws NullPointerException
+ * if array is null
+ */
+ public CopyOnWriteArrayList(E[] array)
+ {
+ data = (E[]) array.clone();
+ }
+
+ /**
+ * Returns the number of elements in this list.
+ *
+ * @return the list size
+ */
+ public int size()
+ {
+ return data.length;
+ }
+
+ /**
+ * Checks if the list is empty.
+ *
+ * @return true if there are no elements
+ */
+ public boolean isEmpty()
+ {
+ return data.length == 0;
+ }
+
+ /**
+ * Returns true iff element is in this ArrayList.
+ *
+ * @param e
+ * the element whose inclusion in the List is being tested
+ * @return true if the list contains e
+ */
+ public boolean contains(Object e)
+ {
+ return indexOf(e) != -1;
+ }
+
+ /**
+ * Returns the lowest index at which element appears in this List, or -1 if it
+ * does not appear.
+ *
+ * @param e
+ * the element whose inclusion in the List is being tested
+ * @return the index where e was found
+ */
+ public int indexOf(Object e)
+ {
+ E[] data = this.data;
+ for (int i = 0; i < data.length; i++)
+ if (equals(e, data[i]))
+ return i;
+ return -1;
+ }
+
+ /**
+ * Return the lowest index greater equal <code>index</code> at which
+ * <code>e</code> appears in this List, or -1 if it does not
+ * appear.
+ *
+ * @param e the element whose inclusion in the list is being tested
+ * @param index the index at which the search begins
+ * @return the index where <code>e</code> was found
+ */
+ public int indexOf(E e, int index)
+ {
+ E[] data = this.data;
+
+ for (int i = index; i < data.length; i++)
+ if (equals(e, data[i]))
+ return i;
+ return -1;
+ }
+
+ /**
+ * Returns the highest index at which element appears in this List, or -1 if
+ * it does not appear.
+ *
+ * @param e
+ * the element whose inclusion in the List is being tested
+ * @return the index where e was found
+ */
+ public int lastIndexOf(Object e)
+ {
+ E[] data = this.data;
+ for (int i = data.length - 1; i >= 0; i--)
+ if (equals(e, data[i]))
+ return i;
+ return -1;
+ }
+
+ /**
+ * Returns the highest index lesser equal <code>index</code> at
+ * which <code>e</code> appears in this List, or -1 if it does not
+ * appear.
+ *
+ * @param e the element whose inclusion in the list is being tested
+ * @param index the index at which the search begins
+ * @return the index where <code>e</code> was found
+ */
+ public int lastIndexOf(E e, int index)
+ {
+ E[] data = this.data;
+
+ for (int i = index; i >= 0; i--)
+ if (equals(e, data[i]))
+ return i;
+ return -1;
+ }
+
+ /**
+ * Creates a shallow copy of this ArrayList (elements are not cloned).
+ *
+ * @return the cloned object
+ */
+ public Object clone()
+ {
+ CopyOnWriteArrayList<E> clone = null;
+ try
+ {
+ clone = (CopyOnWriteArrayList<E>) super.clone();
+ clone.data = (E[]) data.clone();
+ }
+ catch (CloneNotSupportedException e)
+ {
+ // Impossible to get here.
+ }
+ return clone;
+ }
+
+ /**
+ * Returns an Object array containing all of the elements in this ArrayList.
+ * The array is independent of this list.
+ *
+ * @return an array representation of this list
+ */
+ public Object[] toArray()
+ {
+ E[] data = this.data;
+ E[] array = (E[]) new Object[data.length];
+ System.arraycopy(data, 0, array, 0, data.length);
+ return array;
+ }
+
+ /**
+ * Returns an Array whose component type is the runtime component type of the
+ * passed-in Array. The returned Array is populated with all of the elements
+ * in this ArrayList. If the passed-in Array is not large enough to store all
+ * of the elements in this List, a new Array will be created and returned; if
+ * the passed-in Array is <i>larger</i> than the size of this List, then
+ * size() index will be set to null.
+ *
+ * @param a
+ * the passed-in Array
+ * @return an array representation of this list
+ * @throws ArrayStoreException
+ * if the runtime type of a does not allow an element in this list
+ * @throws NullPointerException
+ * if a is null
+ */
+ public <T> T[] toArray(T[] a)
+ {
+ E[] data = this.data;
+ if (a.length < data.length)
+ a = (T[]) Array.newInstance(a.getClass().getComponentType(), data.length);
+ else if (a.length > data.length)
+ a[data.length] = null;
+ System.arraycopy(data, 0, a, 0, data.length);
+ return a;
+ }
+
+ /**
+ * Retrieves the element at the user-supplied index.
+ *
+ * @param index
+ * the index of the element we are fetching
+ * @throws IndexOutOfBoundsException
+ * if index &lt; 0 || index &gt;= size()
+ */
+ public E get(int index)
+ {
+ return data[index];
+ }
+
+ /**
+ * Sets the element at the specified index. The new element, e, can be an
+ * object of any type or null.
+ *
+ * @param index
+ * the index at which the element is being set
+ * @param e
+ * the element to be set
+ * @return the element previously at the specified index
+ * @throws IndexOutOfBoundsException
+ * if index &lt; 0 || index &gt;= 0
+ */
+ public synchronized E set(int index, E e)
+ {
+ E result = data[index];
+ E[] newData = (E[]) data.clone();
+ newData[index] = e;
+ data = newData;
+ return result;
+ }
+
+ /**
+ * Appends the supplied element to the end of this list. The element, e, can
+ * be an object of any type or null.
+ *
+ * @param e
+ * the element to be appended to this list
+ * @return true, the add will always succeed
+ */
+ public synchronized boolean add(E e)
+ {
+ E[] data = this.data;
+ E[] newData = (E[]) new Object[data.length + 1];
+ System.arraycopy(data, 0, newData, 0, data.length);
+ newData[data.length] = e;
+ this.data = newData;
+ return true;
+ }
+
+ /**
+ * Adds the supplied element at the specified index, shifting all elements
+ * currently at that index or higher one to the right. The element, e, can be
+ * an object of any type or null.
+ *
+ * @param index
+ * the index at which the element is being added
+ * @param e
+ * the item being added
+ * @throws IndexOutOfBoundsException
+ * if index &lt; 0 || index &gt; size()
+ */
+ public synchronized void add(int index, E e)
+ {
+ E[] data = this.data;
+ E[] newData = (E[]) new Object[data.length + 1];
+ System.arraycopy(data, 0, newData, 0, index);
+ newData[index] = e;
+ System.arraycopy(data, index, newData, index + 1, data.length - index);
+ this.data = newData;
+ }
+
+ /**
+ * Removes the element at the user-supplied index.
+ *
+ * @param index
+ * the index of the element to be removed
+ * @return the removed Object
+ * @throws IndexOutOfBoundsException
+ * if index &lt; 0 || index &gt;= size()
+ */
+ public synchronized E remove(int index)
+ {
+ E[] data = this.data;
+ E[] newData = (E[]) new Object[data.length - 1];
+ System.arraycopy(data, 0, newData, 0, index - 1);
+ System.arraycopy(data, index + 1, newData, index,
+ data.length - index - 1);
+ E r = data[index];
+ this.data = newData;
+ return r;
+ }
+
+ /**
+ * Removes all elements from this List
+ */
+ public synchronized void clear()
+ {
+ data = (E[]) new Object[0];
+ }
+
+ /**
+ * Add each element in the supplied Collection to this List. It is undefined
+ * what happens if you modify the list while this is taking place; for
+ * example, if the collection contains this list. c can contain objects of any
+ * type, as well as null values.
+ *
+ * @param c
+ * a Collection containing elements to be added to this List
+ * @return true if the list was modified, in other words c is not empty
+ * @throws NullPointerException
+ * if c is null
+ */
+ public synchronized boolean addAll(Collection< ? extends E> c)
+ {
+ return addAll(data.length, c);
+ }
+
+ /**
+ * Add all elements in the supplied collection, inserting them beginning at
+ * the specified index. c can contain objects of any type, as well as null
+ * values.
+ *
+ * @param index
+ * the index at which the elements will be inserted
+ * @param c
+ * the Collection containing the elements to be inserted
+ * @throws IndexOutOfBoundsException
+ * if index &lt; 0 || index &gt; 0
+ * @throws NullPointerException
+ * if c is null
+ */
+ public synchronized boolean addAll(int index, Collection< ? extends E> c)
+ {
+ E[] data = this.data;
+ Iterator<? extends E> itr = c.iterator();
+ int csize = c.size();
+ if (csize == 0)
+ return false;
+
+ E[] newData = (E[]) new Object[data.length + csize];
+ System.arraycopy(data, 0, newData, 0, data.length);
+ int end = data.length;
+ for (E value : c)
+ newData[end++] = value;
+ this.data = newData;
+ return true;
+ }
+
+ public synchronized boolean addIfAbsent(E val)
+ {
+ if (contains(val))
+ return false;
+ add(val);
+ return true;
+ }
+
+ public synchronized int addAllAbsent(Collection<? extends E> c)
+ {
+ int result = 0;
+ for (E val : c)
+ {
+ if (addIfAbsent(val))
+ ++result;
+ }
+ return result;
+ }
+
+ /**
+ * Serializes this object to the given stream.
+ *
+ * @param s
+ * the stream to write to
+ * @throws IOException
+ * if the underlying stream fails
+ * @serialData the size field (int), the length of the backing array (int),
+ * followed by its elements (Objects) in proper order.
+ */
+ private void writeObject(ObjectOutputStream s) throws IOException
+ {
+ // The 'size' field.
+ s.defaultWriteObject();
+ // We serialize unused list entries to preserve capacity.
+ int len = data.length;
+ s.writeInt(len);
+ // it would be more efficient to just write "size" items,
+ // this need readObject read "size" items too.
+ for (int i = 0; i < data.length; i++)
+ s.writeObject(data[i]);
+ }
+
+ /**
+ * Deserializes this object from the given stream.
+ *
+ * @param s
+ * the stream to read from
+ * @throws ClassNotFoundException
+ * if the underlying stream fails
+ * @throws IOException
+ * if the underlying stream fails
+ * @serialData the size field (int), the length of the backing array (int),
+ * followed by its elements (Objects) in proper order.
+ */
+ private void readObject(ObjectInputStream s) throws IOException,
+ ClassNotFoundException
+ {
+ // the `size' field.
+ s.defaultReadObject();
+ int capacity = s.readInt();
+ data = (E[]) new Object[capacity];
+ for (int i = 0; i < capacity; i++)
+ data[i] = (E) s.readObject();
+ }
+
+ static final boolean equals(Object o1, Object o2)
+ {
+ return o1 == null ? o2 == null : o1.equals(o2);
+ }
+
+ Object[] getArray()
+ {
+ return data;
+ }
+}
diff --git a/libjava/classpath/java/util/jar/Attributes.java b/libjava/classpath/java/util/jar/Attributes.java
index 92d29cf49b9..329fe6323b7 100644
--- a/libjava/classpath/java/util/jar/Attributes.java
+++ b/libjava/classpath/java/util/jar/Attributes.java
@@ -67,8 +67,8 @@ import java.util.Set;
* @see java.util.jar.Attributes.Name
* @author Mark Wielaard (mark@klomp.org)
*/
-public class Attributes
- implements Cloneable, java.util.Map // Fully qualified for jikes 1.22
+public class Attributes
+ implements Cloneable, Map<Object, Object>
{
// Fields
@@ -78,7 +78,7 @@ public class Attributes
* implementation it is actually a Hashtable, but that can be different in
* other implementations.
*/
- protected Map map;
+ protected Map<Object, Object> map;
// Inner class
@@ -492,7 +492,7 @@ public class Attributes
*
* @return a set of attribute name value pairs
*/
- public Set entrySet()
+ public Set<Map.Entry<Object, Object>> entrySet()
{
return map.entrySet();
}
@@ -558,7 +558,7 @@ public class Attributes
/**
* Gives a Set of all the values of defined attribute names.
*/
- public Set keySet()
+ public Set<Object> keySet()
{
return map.keySet();
}
@@ -587,7 +587,7 @@ public class Attributes
* @exception ClassCastException if the supplied map is not an instance of
* Attributes
*/
- public void putAll(Map attr)
+ public void putAll(Map<?, ?> attr)
{
if (!(attr instanceof Attributes))
{
@@ -622,7 +622,7 @@ public class Attributes
* Returns all the values of the defined attribute name/value pairs as a
* Collection.
*/
- public Collection values()
+ public Collection<Object> values()
{
return map.values();
}
diff --git a/libjava/classpath/java/util/jar/JarEntry.java b/libjava/classpath/java/util/jar/JarEntry.java
index 722a283bba3..515b45fa9b4 100644
--- a/libjava/classpath/java/util/jar/JarEntry.java
+++ b/libjava/classpath/java/util/jar/JarEntry.java
@@ -1,5 +1,5 @@
/* JarEntry.java - Represents an entry in a jar file
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,6 +39,7 @@ package java.util.jar;
import java.io.IOException;
import java.security.cert.Certificate;
+import java.util.Set;
import java.util.zip.ZipEntry;
/**
@@ -60,7 +61,7 @@ public class JarEntry extends ZipEntry
// (Package local) fields
Attributes attr;
- Certificate certs[];
+ JarFile jarfile;
// Constructors
@@ -79,7 +80,7 @@ public class JarEntry extends ZipEntry
{
super(name);
attr = null;
- certs = null;
+ jarfile = null;
}
/**
@@ -93,7 +94,7 @@ public class JarEntry extends ZipEntry
{
super(entry);
attr = null;
- certs = null;
+ jarfile = null;
}
/**
@@ -112,7 +113,7 @@ public class JarEntry extends ZipEntry
catch (IOException _)
{
}
- certs = entry.getCertificates();
+ jarfile = entry.jarfile;
}
// Methods
@@ -153,13 +154,19 @@ public class JarEntry extends ZipEntry
*/
public Certificate[] getCertificates()
{
- if (certs != null)
+ if (jarfile != null)
{
- return (Certificate[])certs.clone();
- }
- else
- {
- return null;
+ synchronized (jarfile)
+ {
+ if (jarfile.entryCerts != null)
+ {
+ Set certs = (Set) jarfile.entryCerts.get(getName());
+ if (certs != null
+ && jarfile.verified.get(getName()) == Boolean.TRUE)
+ return (Certificate[]) certs.toArray(new Certificate[certs.size()]);
+ }
+ }
}
+ return null;
}
}
diff --git a/libjava/classpath/java/util/jar/JarFile.java b/libjava/classpath/java/util/jar/JarFile.java
index 88814f1d6bf..6807736590a 100644
--- a/libjava/classpath/java/util/jar/JarFile.java
+++ b/libjava/classpath/java/util/jar/JarFile.java
@@ -68,6 +68,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
@@ -149,6 +151,12 @@ public class JarFile extends ZipFile
*/
HashMap entryCerts;
+ /**
+ * A {@link Map} of message digest algorithm names to their implementation.
+ * Used to reduce object (algorithm implementation) instantiation.
+ */
+ private HashMap digestAlgorithms = new HashMap();
+
static boolean DEBUG = false;
static void debug(Object msg)
{
@@ -313,7 +321,7 @@ public class JarFile extends ZipFile
*
* @exception IllegalStateException when the JarFile is already closed
*/
- public Enumeration entries() throws IllegalStateException
+ public Enumeration<JarEntry> entries() throws IllegalStateException
{
return new JarEnumeration(super.entries(), this);
}
@@ -322,13 +330,13 @@ public class JarFile extends ZipFile
* Wraps a given Zip Entries Enumeration. For every zip entry a
* JarEntry is created and the corresponding Attributes are looked up.
*/
- private static class JarEnumeration implements Enumeration
+ private static class JarEnumeration implements Enumeration<JarEntry>
{
- private final Enumeration entries;
+ private final Enumeration<? extends ZipEntry> entries;
private final JarFile jarfile;
- JarEnumeration(Enumeration e, JarFile f)
+ JarEnumeration(Enumeration<? extends ZipEntry> e, JarFile f)
{
entries = e;
jarfile = f;
@@ -339,7 +347,7 @@ public class JarFile extends ZipFile
return entries.hasMoreElements();
}
- public Object nextElement()
+ public JarEntry nextElement()
{
ZipEntry zip = (ZipEntry) entries.nextElement();
JarEntry jar = new JarEntry(zip);
@@ -374,19 +382,8 @@ public class JarFile extends ZipFile
}
jarfile.signaturesRead = true; // fudge it.
}
-
- // Include the certificates only if we have asserted that the
- // signatures are valid. This means the certificates will not be
- // available if the entry hasn't been read yet.
- if (jarfile.entryCerts != null
- && jarfile.verified.get(zip.getName()) == Boolean.TRUE)
- {
- Set certs = (Set) jarfile.entryCerts.get(jar.getName());
- if (certs != null)
- jar.certs = (Certificate[])
- certs.toArray(new Certificate[certs.size()]);
- }
}
+ jar.jarfile = jarfile;
return jar;
}
}
@@ -431,18 +428,7 @@ public class JarFile extends ZipFile
}
signaturesRead = true;
}
- // See the comments in the JarEnumeration for why we do this
- // check.
- if (DEBUG)
- debug("entryCerts=" + entryCerts + " verified " + name
- + " ? " + verified.get(name));
- if (entryCerts != null && verified.get(name) == Boolean.TRUE)
- {
- Set certs = (Set) entryCerts.get(name);
- if (certs != null)
- jarEntry.certs = (Certificate[])
- certs.toArray(new Certificate[certs.size()]);
- }
+ jarEntry.jarfile = this;
return jarEntry;
}
return null;
@@ -599,6 +585,31 @@ public class JarFile extends ZipFile
validCerts.clear();
}
+ // Read the manifest into a HashMap (String fileName, String entry)
+ // The fileName might be split into multiple lines in the manifest.
+ // Such additional lines will start with a space.
+ InputStream in = super.getInputStream(super.getEntry(MANIFEST_NAME));
+ ByteArrayOutputStream baStream = new ByteArrayOutputStream();
+ byte[] ba = new byte[1024];
+ while (true)
+ {
+ int len = in.read(ba);
+ if (len < 0)
+ break;
+ baStream.write(ba, 0, len);
+ }
+ in.close();
+
+ HashMap hmManifestEntries = new HashMap();
+ Pattern p = Pattern.compile("Name: (.+?\r?\n(?: .+?\r?\n)*)"
+ + ".+?-Digest: .+?\r?\n\r?\n");
+ Matcher m = p.matcher(baStream.toString());
+ while (m.find())
+ {
+ String fileName = m.group(1).replaceAll("\r?\n ?", "");
+ hmManifestEntries.put(fileName, m.group());
+ }
+
// Phase 3: verify the signature file signatures against the manifest,
// mapping the entry name to the target certificates.
this.entryCerts = new HashMap();
@@ -614,7 +625,7 @@ public class JarFile extends ZipFile
Map.Entry e2 = (Map.Entry) it2.next();
String entryname = String.valueOf(e2.getKey());
Attributes attr = (Attributes) e2.getValue();
- if (verifyHashes(entryname, attr))
+ if (verifyHashes(entryname, attr, hmManifestEntries))
{
if (DEBUG)
debug("entry " + entryname + " has certificates " + certificates);
@@ -721,39 +732,29 @@ public class JarFile extends ZipFile
}
/**
- * Verifies that the digest(s) in a signature file were, in fact, made
- * over the manifest entry for ENTRY.
- *
+ * Verifies that the digest(s) in a signature file were, in fact, made over
+ * the manifest entry for ENTRY.
+ *
* @param entry The entry name.
* @param attr The attributes from the signature file to verify.
+ * @param hmManifestEntries Mappings of Jar file entry names to their manifest
+ * entry text; i.e. the base-64 encoding of their
*/
- private boolean verifyHashes(String entry, Attributes attr)
+ private boolean verifyHashes(String entry, Attributes attr,
+ HashMap hmManifestEntries)
{
int verified = 0;
- // The bytes for ENTRY's manifest entry, which are signed in the
- // signature file.
- byte[] entryBytes = null;
- try
- {
- ZipEntry e = super.getEntry(entry);
- if (e == null)
- {
- if (DEBUG)
- debug("verifyHashes: no entry '" + entry + "'");
- return false;
- }
- entryBytes = readManifestEntry(e);
- }
- catch (IOException ioe)
+ String stringEntry = (String) hmManifestEntries.get(entry);
+ if (stringEntry == null)
{
if (DEBUG)
- {
- debug(ioe);
- ioe.printStackTrace();
- }
+ debug("could not find " + entry + " in manifest");
return false;
}
+ // The bytes for ENTRY's manifest entry, which are signed in the
+ // signature file.
+ byte[] entryBytes = stringEntry.getBytes();
for (Iterator it = attr.entrySet().iterator(); it.hasNext(); )
{
@@ -765,9 +766,14 @@ public class JarFile extends ZipFile
try
{
byte[] hash = Base64InputStream.decode((String) e.getValue());
- MessageDigest md = MessageDigest.getInstance(alg, provider);
- md.update(entryBytes);
- byte[] hash2 = md.digest();
+ MessageDigest md = (MessageDigest) digestAlgorithms.get(alg);
+ if (md == null)
+ {
+ md = MessageDigest.getInstance(alg, provider);
+ digestAlgorithms.put(alg, md);
+ }
+ md.reset();
+ byte[] hash2 = md.digest(entryBytes);
if (DEBUG)
debug("verifying SF entry " + entry + " alg: " + md.getAlgorithm()
+ " expect=" + new java.math.BigInteger(hash).toString(16)
@@ -801,100 +807,6 @@ public class JarFile extends ZipFile
}
/**
- * Read the raw bytes that comprise a manifest entry. We can't use the
- * Manifest object itself, because that loses information (such as line
- * endings, and order of entries).
- */
- private byte[] readManifestEntry(ZipEntry entry) throws IOException
- {
- InputStream in = super.getInputStream(super.getEntry(MANIFEST_NAME));
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- byte[] target = ("Name: " + entry.getName()).getBytes();
- int t = 0, c, prev = -1, state = 0, l = -1;
-
- while ((c = in.read()) != -1)
- {
-// if (DEBUG)
-// debug("read "
-// + (c == '\n' ? "\\n" : (c == '\r' ? "\\r" : String.valueOf((char) c)))
-// + " state=" + state + " prev="
-// + (prev == '\n' ? "\\n" : (prev == '\r' ? "\\r" : String.valueOf((char) prev)))
-// + " t=" + t + (t < target.length ? (" target[t]=" + (char) target[t]) : "")
-// + " l=" + l);
- switch (state)
- {
-
- // Step 1: read until we find the "target" bytes: the start
- // of the entry we need to read.
- case 0:
- if (((byte) c) != target[t])
- t = 0;
- else
- {
- t++;
- if (t == target.length)
- {
- out.write(target);
- state = 1;
- }
- }
- break;
-
- // Step 2: assert that there is a newline character after
- // the "target" bytes.
- case 1:
- if (c != '\n' && c != '\r')
- {
- out.reset();
- t = 0;
- state = 0;
- }
- else
- {
- out.write(c);
- state = 2;
- }
- break;
-
- // Step 3: read this whole entry, until we reach an empty
- // line.
- case 2:
- if (c == '\n')
- {
- out.write(c);
- // NL always terminates a line.
- if (l == 0 || (l == 1 && prev == '\r'))
- return out.toByteArray();
- l = 0;
- }
- else
- {
- // Here we see a blank line terminated by a CR,
- // followed by the next entry. Technically, `c' should
- // always be 'N' at this point.
- if (l == 1 && prev == '\r')
- return out.toByteArray();
- out.write(c);
- l++;
- }
- prev = c;
- break;
-
- default:
- throw new RuntimeException("this statement should be unreachable");
- }
- }
-
- // The last entry, with a single CR terminating the line.
- if (state == 2 && prev == '\r' && l == 0)
- return out.toByteArray();
-
- // We should not reach this point, we didn't find the entry (or, possibly,
- // it is the last entry and is malformed).
- throw new IOException("could not find " + entry + " in manifest");
- }
-
- /**
* A utility class that verifies jar entries as they are read.
*/
private static class EntryInputStream extends FilterInputStream
diff --git a/libjava/classpath/java/util/jar/Manifest.java b/libjava/classpath/java/util/jar/Manifest.java
index 64a0c476a91..8effc2878ce 100644
--- a/libjava/classpath/java/util/jar/Manifest.java
+++ b/libjava/classpath/java/util/jar/Manifest.java
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.util.jar;
import gnu.java.util.jar.JarUtils;
-
+
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -60,7 +60,7 @@ public class Manifest implements Cloneable
private final Attributes mainAttr;
/** A map of atrributes for all entries described in this Manifest. */
- private final Map entries;
+ private final Map<String, Attributes> entries;
// Constructors
@@ -70,7 +70,7 @@ public class Manifest implements Cloneable
public Manifest()
{
mainAttr = new Attributes();
- entries = new Hashtable();
+ entries = new Hashtable<String, Attributes>();
}
/**
@@ -104,7 +104,7 @@ public class Manifest implements Cloneable
public Manifest(Manifest man)
{
mainAttr = new Attributes(man.getMainAttributes());
- entries = new Hashtable(man.getEntries());
+ entries = new Hashtable<String, Attributes>(man.getEntries());
}
// Methods
@@ -122,7 +122,7 @@ public class Manifest implements Cloneable
* in this manifest. Adding, changing or removing from this entries map
* changes the entries of this manifest.
*/
- public Map getEntries()
+ public Map<String, Attributes> getEntries()
{
return entries;
}
diff --git a/libjava/classpath/java/util/logging/LogManager.java b/libjava/classpath/java/util/logging/LogManager.java
index e434651f87d..fbc0fe78abf 100644
--- a/libjava/classpath/java/util/logging/LogManager.java
+++ b/libjava/classpath/java/util/logging/LogManager.java
@@ -129,7 +129,7 @@ public class LogManager
* The registered named loggers; maps the name of a Logger to
* a WeakReference to it.
*/
- private Map loggers;
+ private Map<String, WeakReference<Logger>> loggers;
/**
* The properties for the logging framework which have been
@@ -150,7 +150,7 @@ public class LogManager
* this case.
*/
private final PropertyChangeSupport pcs = new PropertyChangeSupport( /* source bean */
- LogManager.class);
+ LogManager.class);
protected LogManager()
{
@@ -269,7 +269,7 @@ public class LogManager
*/
name = logger.getName();
- ref = (WeakReference) loggers.get(name);
+ ref = loggers.get(name);
if (ref != null)
{
if (ref.get() != null)
@@ -286,7 +286,7 @@ public class LogManager
checkAccess();
Logger parent = findAncestor(logger);
- loggers.put(name, new WeakReference(logger));
+ loggers.put(name, new WeakReference<Logger>(logger));
if (parent != logger.getParent())
logger.setParent(parent);
@@ -318,26 +318,23 @@ public class LogManager
* When adding "foo.bar", the logger "foo.bar.baz" should change
* its parent to "foo.bar".
*/
- if (parent != Logger.root)
+ for (Iterator iter = loggers.keySet().iterator(); iter.hasNext();)
{
- for (Iterator iter = loggers.keySet().iterator(); iter.hasNext();)
- {
- Logger possChild = (Logger) ((WeakReference) loggers.get(iter.next()))
- .get();
- if ((possChild == null) || (possChild == logger)
- || (possChild.getParent() != parent))
- continue;
-
- if (! possChild.getName().startsWith(name))
- continue;
-
- if (possChild.getName().charAt(name.length()) != '.')
- continue;
-
- possChild.setParent(logger);
- }
+ Logger possChild = (Logger) ((WeakReference) loggers.get(iter.next()))
+ .get();
+ if ((possChild == null) || (possChild == logger)
+ || (possChild.getParent() != parent))
+ continue;
+
+ if (! possChild.getName().startsWith(name))
+ continue;
+
+ if (possChild.getName().charAt(name.length()) != '.')
+ continue;
+
+ possChild.setParent(logger);
}
-
+
return true;
}
@@ -365,15 +362,13 @@ public class LogManager
int bestNameLength = 0;
Logger cand;
- String candName;
int candNameLength;
if (child == Logger.root)
return null;
- for (Iterator iter = loggers.keySet().iterator(); iter.hasNext();)
+ for (String candName : loggers.keySet())
{
- candName = (String) iter.next();
candNameLength = candName.length();
if (candNameLength > bestNameLength
@@ -381,7 +376,7 @@ public class LogManager
&& childName.startsWith(candName)
&& childName.charAt(candNameLength) == '.')
{
- cand = (Logger) ((WeakReference) loggers.get(candName)).get();
+ cand = loggers.get(candName).get();
if ((cand == null) || (cand == child))
continue;
@@ -406,14 +401,14 @@ public class LogManager
*/
public synchronized Logger getLogger(String name)
{
- WeakReference ref;
+ WeakReference<Logger> ref;
/* Throw a NullPointerException if name is null. */
name.getClass();
- ref = (WeakReference) loggers.get(name);
+ ref = loggers.get(name);
if (ref != null)
- return (Logger) ref.get();
+ return ref.get();
else
return null;
}
@@ -426,7 +421,7 @@ public class LogManager
* @return an Enumeration with the names of the currently
* registered Loggers.
*/
- public synchronized Enumeration getLoggerNames()
+ public synchronized Enumeration<String> getLoggerNames()
{
return Collections.enumeration(loggers.keySet());
}
@@ -449,16 +444,16 @@ public class LogManager
properties = new Properties();
- Iterator iter = loggers.values().iterator();
+ Iterator<WeakReference<Logger>> iter = loggers.values().iterator();
while (iter.hasNext())
+ for (WeakReference<Logger> ref : loggers.values())
{
- WeakReference ref;
Logger logger;
- ref = (WeakReference) iter.next();
+ ref = iter.next();
if (ref != null)
{
- logger = (Logger) ref.get();
+ logger = ref.get();
if (logger == null)
iter.remove();
@@ -713,7 +708,11 @@ public class LogManager
{
try
{
- return Level.parse(getLogManager().getProperty(propertyName));
+ String value = getLogManager().getProperty(propertyName);
+ if (value != null)
+ return Level.parse(getLogManager().getProperty(propertyName));
+ else
+ return defaultValue;
}
catch (Exception ex)
{
diff --git a/libjava/classpath/java/util/logging/LoggingMXBean.java b/libjava/classpath/java/util/logging/LoggingMXBean.java
index 5f866c980d7..3e0a7276db3 100644
--- a/libjava/classpath/java/util/logging/LoggingMXBean.java
+++ b/libjava/classpath/java/util/logging/LoggingMXBean.java
@@ -60,7 +60,7 @@ public interface LoggingMXBean
/**
* Return a list of all logger names.
*/
- List/*<String>*/ getLoggerNames();
+ List<String> getLoggerNames();
/**
* Return the name of the parent of the indicated logger.
diff --git a/libjava/classpath/java/util/prefs/Preferences.java b/libjava/classpath/java/util/prefs/Preferences.java
index 297759d88a4..e53e4fc7938 100644
--- a/libjava/classpath/java/util/prefs/Preferences.java
+++ b/libjava/classpath/java/util/prefs/Preferences.java
@@ -251,7 +251,7 @@ public abstract class Preferences {
* @exception SecurityException when a security manager is installed and
* the caller does not have <code>RuntimePermission("preferences")</code>.
*/
- public static Preferences systemNodeForPackage(Class c)
+ public static Preferences systemNodeForPackage(Class<?> c)
throws SecurityException
{
return nodeForPackage(c, systemRoot());
@@ -270,7 +270,7 @@ public abstract class Preferences {
* @exception SecurityException when a security manager is installed and
* the caller does not have <code>RuntimePermission("preferences")</code>.
*/
- public static Preferences userNodeForPackage(Class c)
+ public static Preferences userNodeForPackage(Class<?> c)
throws SecurityException
{
return nodeForPackage(c, userRoot());
diff --git a/libjava/classpath/java/util/regex/Matcher.java b/libjava/classpath/java/util/regex/Matcher.java
index 25e73810e95..bf833673b0e 100644
--- a/libjava/classpath/java/util/regex/Matcher.java
+++ b/libjava/classpath/java/util/regex/Matcher.java
@@ -218,7 +218,7 @@ public final class Matcher implements MatchResult
public boolean lookingAt ()
{
- match = pattern.getRE().getMatch(inputCharIndexed, 0);
+ match = pattern.getRE().getMatch(inputCharIndexed, 0, RE.REG_FIX_STARTING_POSITION, null);
if (match != null)
{
if (match.getStartIndex() == 0)
@@ -243,7 +243,7 @@ public final class Matcher implements MatchResult
*/
public boolean matches ()
{
- match = pattern.getRE().getMatch(inputCharIndexed, 0, RE.REG_TRY_ENTIRE_MATCH);
+ match = pattern.getRE().getMatch(inputCharIndexed, 0, RE.REG_TRY_ENTIRE_MATCH|RE.REG_FIX_STARTING_POSITION, null);
if (match != null)
{
if (match.getStartIndex() == 0)
@@ -278,6 +278,7 @@ public final class Matcher implements MatchResult
public Matcher reset (CharSequence input)
{
this.input = input;
+ this.inputCharIndexed = RE.makeCharIndexed(input, 0);
return reset();
}
@@ -309,6 +310,28 @@ public final class Matcher implements MatchResult
return match.getStartIndex(group);
}
+ /**
+ * @return True if and only if the matcher hit the end of input.
+ */
+ public boolean hitEnd()
+ {
+ return inputCharIndexed.hitEnd();
+ }
+
+ /**
+ * @return A string expression of this matcher.
+ */
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.append(this.getClass().getName())
+ .append("[pattern=").append(pattern.pattern())
+ .append(" region=").append("0").append(",").append(input.length())
+ .append(" lastmatch=").append(match == null ? "" : match.toString())
+ .append("]");
+ return sb.toString();
+ }
+
private void assertMatchOp()
{
if (match == null) throw new IllegalStateException();
diff --git a/libjava/classpath/java/util/zip/Deflater.java b/libjava/classpath/java/util/zip/Deflater.java
index a4ec0e64303..e97c6054ff4 100644
--- a/libjava/classpath/java/util/zip/Deflater.java
+++ b/libjava/classpath/java/util/zip/Deflater.java
@@ -1,5 +1,5 @@
/* Deflater.java - Compress a data stream
- Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -150,7 +150,7 @@ public class Deflater
private int state;
/** The total bytes of output written. */
- private int totalOut;
+ private long totalOut;
/** The pending output. */
private DeflaterPending pending;
@@ -241,16 +241,36 @@ public class Deflater
/**
* Gets the number of input bytes processed so far.
*/
+ @Deprecated
public int getTotalIn()
{
+ return (int) engine.getTotalIn();
+ }
+
+ /**
+ * Gets the number of input bytes processed so far.
+ * @since 1.5
+ */
+ public long getBytesRead()
+ {
return engine.getTotalIn();
}
/**
* Gets the number of output bytes so far.
*/
+ @Deprecated
public int getTotalOut()
{
+ return (int) totalOut;
+ }
+
+ /**
+ * Gets the number of output bytes so far.
+ * @since 1.5
+ */
+ public long getBytesWritten()
+ {
return totalOut;
}
diff --git a/libjava/classpath/java/util/zip/DeflaterEngine.java b/libjava/classpath/java/util/zip/DeflaterEngine.java
index f79e47742bb..51587165e7c 100644
--- a/libjava/classpath/java/util/zip/DeflaterEngine.java
+++ b/libjava/classpath/java/util/zip/DeflaterEngine.java
@@ -1,5 +1,5 @@
/* DeflaterEngine.java --
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -92,7 +92,7 @@ class DeflaterEngine implements DeflaterConstants
private byte[] inputBuf;
/** The total bytes of input read. */
- private int totalIn;
+ private long totalIn;
/** The offset into inputBuf, where input data starts. */
private int inputOff;
@@ -163,7 +163,7 @@ class DeflaterEngine implements DeflaterConstants
return chksum;
}
- public final int getTotalIn()
+ public final long getTotalIn()
{
return totalIn;
}
diff --git a/libjava/classpath/java/util/zip/Inflater.java b/libjava/classpath/java/util/zip/Inflater.java
index f1616d60199..509b9576429 100644
--- a/libjava/classpath/java/util/zip/Inflater.java
+++ b/libjava/classpath/java/util/zip/Inflater.java
@@ -140,13 +140,13 @@ public class Inflater
/**
* The total number of inflated bytes.
*/
- private int totalOut;
+ private long totalOut;
/**
* The total number of bytes set with setInput(). This is not the
* value returned by getTotalIn(), since this also includes the
* unprocessed input.
*/
- private int totalIn;
+ private long totalIn;
/**
* This variable stores the nowrap flag that was given to the constructor.
* True means, that the inflated stream doesn't contain a header nor the
@@ -246,8 +246,19 @@ public class Inflater
* Gets the total number of processed compressed input bytes.
* @return the total number of bytes of processed input bytes.
*/
+ @Deprecated
public int getTotalIn()
{
+ return (int) (totalIn - getRemaining());
+ }
+
+ /**
+ * Gets the total number of processed compressed input bytes.
+ * @return the total number of bytes of processed input bytes.
+ * @since 1.5
+ */
+ public long getBytesRead()
+ {
return totalIn - getRemaining();
}
@@ -255,8 +266,19 @@ public class Inflater
* Gets the total number of output bytes returned by inflate().
* @return the total number of output bytes.
*/
+ @Deprecated
public int getTotalOut()
{
+ return (int) totalOut;
+ }
+
+ /**
+ * Gets the total number of output bytes returned by inflate().
+ * @return the total number of output bytes.
+ * @since 1.5
+ */
+ public long getBytesWritten()
+ {
return totalOut;
}
diff --git a/libjava/classpath/java/util/zip/ZipFile.java b/libjava/classpath/java/util/zip/ZipFile.java
index 47ced0fb84f..3b34bd1f50b 100644
--- a/libjava/classpath/java/util/zip/ZipFile.java
+++ b/libjava/classpath/java/util/zip/ZipFile.java
@@ -48,6 +48,9 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.io.UnsupportedEncodingException;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.LinkedHashMap;
@@ -88,7 +91,7 @@ public class ZipFile implements ZipConstants
private final RandomAccessFile raf;
// The entries of this zip file when initialized and not yet closed.
- private LinkedHashMap entries;
+ private LinkedHashMap<String, ZipEntry> entries;
private boolean closed = false;
@@ -250,7 +253,7 @@ public class ZipFile implements ZipConstants
throw new EOFException(name);
int centralOffset = inp.readLeInt();
- entries = new LinkedHashMap(count+count/2);
+ entries = new LinkedHashMap<String, ZipEntry> (count+count/2);
inp.seek(centralOffset);
for (int i = 0; i < count; i++)
@@ -327,7 +330,7 @@ public class ZipFile implements ZipConstants
*
* @exception IllegalStateException when the ZipFile has already been closed
*/
- public Enumeration entries()
+ public Enumeration<? extends ZipEntry> entries()
{
checkClosed();
@@ -347,7 +350,7 @@ public class ZipFile implements ZipConstants
* @exception IllegalStateException when the ZipFile has already been closed.
* @exception IOException when the entries could not be read.
*/
- private LinkedHashMap getEntries() throws IOException
+ private LinkedHashMap<String, ZipEntry> getEntries() throws IOException
{
synchronized(raf)
{
@@ -375,11 +378,11 @@ public class ZipFile implements ZipConstants
try
{
- LinkedHashMap entries = getEntries();
- ZipEntry entry = (ZipEntry) entries.get(name);
+ LinkedHashMap<String, ZipEntry> entries = getEntries();
+ ZipEntry entry = entries.get(name);
// If we didn't find it, maybe it's a directory.
if (entry == null && !name.endsWith("/"))
- entry = (ZipEntry) entries.get(name + '/');
+ entry = entries.get(name + '/');
return entry != null ? new ZipEntry(entry, name) : null;
}
catch (IOException ioe)
@@ -414,9 +417,9 @@ public class ZipFile implements ZipConstants
{
checkClosed();
- LinkedHashMap entries = getEntries();
+ LinkedHashMap<String, ZipEntry> entries = getEntries();
String name = entry.getName();
- ZipEntry zipEntry = (ZipEntry) entries.get(name);
+ ZipEntry zipEntry = entries.get(name);
if (zipEntry == null)
return null;
@@ -491,11 +494,11 @@ public class ZipFile implements ZipConstants
}
}
- private static class ZipEntryEnumeration implements Enumeration
+ private static class ZipEntryEnumeration implements Enumeration<ZipEntry>
{
- private final Iterator elements;
+ private final Iterator<ZipEntry> elements;
- public ZipEntryEnumeration(Iterator elements)
+ public ZipEntryEnumeration(Iterator<ZipEntry> elements)
{
this.elements = elements;
}
@@ -505,17 +508,27 @@ public class ZipFile implements ZipConstants
return elements.hasNext();
}
- public Object nextElement()
+ public ZipEntry nextElement()
{
/* We return a clone, just to be safe that the user doesn't
* change the entry.
*/
- return ((ZipEntry)elements.next()).clone();
+ return (ZipEntry) (elements.next().clone());
}
}
private static final class PartialInputStream extends InputStream
{
+ /**
+ * The UTF-8 charset use for decoding the filenames.
+ */
+ private static final Charset UTF8CHARSET = Charset.forName("UTF-8");
+
+ /**
+ * The actual UTF-8 decoder. Created on demand.
+ */
+ private CharsetDecoder utf8Decoder;
+
private final RandomAccessFile raf;
private final byte[] buffer;
private long bufferOffset;
@@ -652,23 +665,86 @@ public class ZipFile implements ZipConstants
int readLeShort() throws IOException
{
- int b0 = read();
- int b1 = read();
- if (b1 == -1)
- throw new EOFException();
- return (b0 & 0xff) | (b1 & 0xff) << 8;
+ int result;
+ if(pos + 1 < buffer.length)
+ {
+ result = ((buffer[pos + 0] & 0xff) | (buffer[pos + 1] & 0xff) << 8);
+ pos += 2;
+ }
+ else
+ {
+ int b0 = read();
+ int b1 = read();
+ if (b1 == -1)
+ throw new EOFException();
+ result = (b0 & 0xff) | (b1 & 0xff) << 8;
+ }
+ return result;
}
int readLeInt() throws IOException
{
- int b0 = read();
- int b1 = read();
- int b2 = read();
- int b3 = read();
- if (b3 == -1)
- throw new EOFException();
- return ((b0 & 0xff) | (b1 & 0xff) << 8)
- | ((b2 & 0xff) | (b3 & 0xff) << 8) << 16;
+ int result;
+ if(pos + 3 < buffer.length)
+ {
+ result = (((buffer[pos + 0] & 0xff) | (buffer[pos + 1] & 0xff) << 8)
+ | ((buffer[pos + 2] & 0xff)
+ | (buffer[pos + 3] & 0xff) << 8) << 16);
+ pos += 4;
+ }
+ else
+ {
+ int b0 = read();
+ int b1 = read();
+ int b2 = read();
+ int b3 = read();
+ if (b3 == -1)
+ throw new EOFException();
+ result = (((b0 & 0xff) | (b1 & 0xff) << 8) | ((b2 & 0xff)
+ | (b3 & 0xff) << 8) << 16);
+ }
+ return result;
+ }
+
+ /**
+ * Decode chars from byte buffer using UTF8 encoding. This
+ * operation is performance-critical since a jar file contains a
+ * large number of strings for the name of each file in the
+ * archive. This routine therefore avoids using the expensive
+ * utf8Decoder when decoding is straightforward.
+ *
+ * @param buffer the buffer that contains the encoded character
+ * data
+ * @param pos the index in buffer of the first byte of the encoded
+ * data
+ * @param length the length of the encoded data in number of
+ * bytes.
+ *
+ * @return a String that contains the decoded characters.
+ */
+ private String decodeChars(byte[] buffer, int pos, int length)
+ throws IOException
+ {
+ String result;
+ int i=length - 1;
+ while ((i >= 0) && (buffer[i] <= 0x7f))
+ {
+ i--;
+ }
+ if (i < 0)
+ {
+ result = new String(buffer, 0, pos, length);
+ }
+ else
+ {
+ ByteBuffer bufferBuffer = ByteBuffer.wrap(buffer, pos, length);
+ if (utf8Decoder == null)
+ utf8Decoder = UTF8CHARSET.newDecoder();
+ utf8Decoder.reset();
+ char [] characters = utf8Decoder.decode(bufferBuffer).array();
+ result = String.valueOf(characters);
+ }
+ return result;
}
String readString(int length) throws IOException
@@ -676,25 +752,26 @@ public class ZipFile implements ZipConstants
if (length > end - (bufferOffset + pos))
throw new EOFException();
+ String result = null;
try
{
if (buffer.length - pos >= length)
{
- String s = new String(buffer, pos, length, "UTF-8");
+ result = decodeChars(buffer, pos, length);
pos += length;
- return s;
}
else
{
byte[] b = new byte[length];
readFully(b);
- return new String(b, 0, length, "UTF-8");
+ result = decodeChars(b, 0, length);
}
}
catch (UnsupportedEncodingException uee)
{
throw new AssertionError(uee);
}
+ return result;
}
public void addDummyByte()
diff --git a/libjava/classpath/javax/accessibility/AccessibleRelationSet.java b/libjava/classpath/javax/accessibility/AccessibleRelationSet.java
index 8c33eaa7298..768c9cd791c 100644
--- a/libjava/classpath/javax/accessibility/AccessibleRelationSet.java
+++ b/libjava/classpath/javax/accessibility/AccessibleRelationSet.java
@@ -64,7 +64,8 @@ public class AccessibleRelationSet
* @see #toArray()
* @see #clear()
*/
- protected Vector relations = new Vector();
+ protected Vector<AccessibleRelation> relations
+ = new Vector<AccessibleRelation>();
/**
* Create an empty relation set.
diff --git a/libjava/classpath/javax/accessibility/AccessibleStateSet.java b/libjava/classpath/javax/accessibility/AccessibleStateSet.java
index 29fd2ed970f..783f5412742 100644
--- a/libjava/classpath/javax/accessibility/AccessibleStateSet.java
+++ b/libjava/classpath/javax/accessibility/AccessibleStateSet.java
@@ -62,7 +62,7 @@ public class AccessibleStateSet
* @see #toArray()
* @see #clear()
*/
- protected Vector states = new Vector();
+ protected Vector<AccessibleState> states = new Vector<AccessibleState>();
/**
* Create an empty state set.
diff --git a/libjava/classpath/javax/crypto/Cipher.java b/libjava/classpath/javax/crypto/Cipher.java
index 1b56a07f4aa..7c18e6f6ab3 100644
--- a/libjava/classpath/javax/crypto/Cipher.java
+++ b/libjava/classpath/javax/crypto/Cipher.java
@@ -157,161 +157,159 @@ public class Cipher
/** Our current state (encrypting, wrapping, etc.) */
private int state;
-
- // Class methods.
- // ------------------------------------------------------------------------
-
/**
- * <p>Creates a new cipher instance for the given transformation.</p>
- *
- * <p>The installed providers are tried in order for an
- * implementation, and the first appropriate instance is returned. If
- * no installed provider can provide the implementation, an
- * appropriate exception is thrown.</p>
- *
+ * Creates a new cipher instance for the given transformation.
+ * <p>
+ * The installed providers are tried in order for an implementation, and the
+ * first appropriate instance is returned. If no installed provider can
+ * provide the implementation, an appropriate exception is thrown.
+ *
* @param transformation The transformation to create.
* @return An appropriate cipher for this transformation.
- * @throws java.security.NoSuchAlgorithmException If no installed
- * provider can supply the appropriate cipher or mode.
- * @throws javax.crypto.NoSuchPaddingException If no installed
- * provider can supply the appropriate padding.
+ * @throws NoSuchAlgorithmException If no installed provider can supply the
+ * appropriate cipher or mode.
+ * @throws NoSuchPaddingException If no installed provider can supply the
+ * appropriate padding.
*/
public static final Cipher getInstance(String transformation)
- throws NoSuchAlgorithmException, NoSuchPaddingException
+ throws NoSuchAlgorithmException, NoSuchPaddingException
{
- Provider[] providers = Security.getProviders();
- NoSuchPaddingException ex = null;
- String msg = "";
- for (int i = 0; i < providers.length; i++)
- {
- try
- {
- return getInstance(transformation, providers[i]);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- msg = nsae.getMessage();
- ex = null;
- }
- catch (NoSuchPaddingException nspe)
- {
- ex = nspe;
- }
- }
- if (ex != null)
- {
- throw ex;
- }
- throw new NoSuchAlgorithmException(msg);
+ Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
+ NoSuchPaddingException lastPaddingException = null;
+ for (int i = 0; i < p.length; i++)
+ try
+ {
+ return getInstance(transformation, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ lastPaddingException = null;
+ }
+ catch (NoSuchPaddingException x)
+ {
+ lastPaddingException = x;
+ }
+ if (lastPaddingException != null)
+ throw lastPaddingException;
+ if (lastException != null)
+ throw lastException;
+ throw new NoSuchAlgorithmException(transformation);
}
/**
- * <p>Creates a new cipher instance for the given transformation and
- * the named provider.</p>
- *
+ * Creates a new cipher instance for the given transformation and the named
+ * provider.
+ *
* @param transformation The transformation to create.
- * @param provider The name of the provider to use.
+ * @param provider The name of the provider to use.
* @return An appropriate cipher for this transformation.
- * @throws java.security.NoSuchAlgorithmException If the provider cannot
- * supply the appropriate cipher or mode.
- * @throws java.security.NoSuchProviderException If the named provider
- * is not installed.
- * @throws javax.crypto.NoSuchPaddingException If the provider cannot
- * supply the appropriate padding.
+ * @throws NoSuchAlgorithmException If the provider cannot supply the
+ * appropriate cipher or mode.
+ * @throws NoSuchProviderException If the named provider is not installed.
+ * @throws NoSuchPaddingException If the provider cannot supply the
+ * appropriate padding.
+ * @throws IllegalArgumentException if either <code>transformation</code> or
+ * <code>provider</code> is <code>null</code>.
*/
public static final Cipher getInstance(String transformation, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException,
- NoSuchPaddingException
+ throws NoSuchAlgorithmException, NoSuchProviderException,
+ NoSuchPaddingException
{
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
Provider p = Security.getProvider(provider);
if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
+ throw new NoSuchProviderException(provider);
return getInstance(transformation, p);
}
/**
- * Creates a new cipher instance for the given transform and the given
+ * Creates a new cipher instance for a given transformation from a given
* provider.
- *
+ *
* @param transformation The transformation to create.
- * @param provider The provider to use.
+ * @param provider The provider to use.
* @return An appropriate cipher for this transformation.
- * @throws java.security.NoSuchAlgorithmException If the given
- * provider cannot supply the appropriate cipher or mode.
- * @throws javax.crypto.NoSuchPaddingException If the given
- * provider cannot supply the appropriate padding scheme.
+ * @throws NoSuchAlgorithmException If the given provider cannot supply the
+ * appropriate cipher or mode.
+ * @throws NoSuchPaddingException If the given provider cannot supply the
+ * appropriate padding scheme.
*/
- public static final Cipher getInstance(String transformation, Provider provider)
- throws NoSuchAlgorithmException, NoSuchPaddingException
+ public static final Cipher getInstance(String transformation,
+ Provider provider)
+ throws NoSuchAlgorithmException, NoSuchPaddingException
{
- CipherSpi result = null;
- String key = null;
- String alg = null, mode = null, pad = null;
- String msg = "";
+ StringBuilder sb = new StringBuilder().append("Cipher transformation [")
+ .append(transformation).append("] from provider [")
+ .append(provider).append("] ");
+ Throwable cause;
+ Object spi;
+ CipherSpi result;
if (transformation.indexOf('/') < 0)
{
try
{
- result = (CipherSpi) Engine.getInstance(SERVICE, transformation,
- provider);
- return new Cipher(result, provider, transformation);
+ spi = Engine.getInstance(SERVICE, transformation, provider);
+ return new Cipher((CipherSpi) spi, provider, transformation);
}
catch (Exception e)
{
- msg = e.getMessage();
+ if (e instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) e;
+ cause = e;
}
}
else
{
StringTokenizer tok = new StringTokenizer(transformation, "/");
if (tok.countTokens() != 3)
- {
- throw new NoSuchAlgorithmException("badly formed transformation");
- }
- alg = tok.nextToken();
- mode = tok.nextToken();
- pad = tok.nextToken();
+ throw new NoSuchAlgorithmException(sb.append("is malformed").toString());
+
+ String alg = tok.nextToken();
+ String mode = tok.nextToken();
+ String pad = tok.nextToken();
try
{
- result = (CipherSpi) Engine.getInstance(SERVICE, transformation,
- provider);
- return new Cipher(result, provider, transformation);
+ spi = Engine.getInstance(SERVICE, transformation, provider);
+ return new Cipher((CipherSpi) spi, provider, transformation);
}
catch (Exception e)
{
- msg = e.getMessage();
+ cause = e;
}
+
try
{
- result = (CipherSpi) Engine.getInstance(SERVICE, alg + '/' + mode,
- provider);
+ spi = Engine.getInstance(SERVICE, alg + '/' + mode, provider);
+ result = (CipherSpi) spi;
result.engineSetPadding(pad);
return new Cipher(result, provider, transformation);
}
catch (Exception e)
{
if (e instanceof NoSuchPaddingException)
- {
- throw (NoSuchPaddingException) e;
- }
- msg = e.getMessage();
+ throw (NoSuchPaddingException) e;
+ cause = e;
}
+
try
{
- result = (CipherSpi) Engine.getInstance(SERVICE, alg + "//" + pad,
- provider);
+ spi = Engine.getInstance(SERVICE, alg + "//" + pad, provider);
+ result = (CipherSpi) spi;
result.engineSetMode(mode);
return new Cipher(result, provider, transformation);
}
catch (Exception e)
{
- msg = e.getMessage();
+ cause = e;
}
+
try
{
- result = (CipherSpi) Engine.getInstance(SERVICE, alg, provider);
+ spi = Engine.getInstance(SERVICE, alg, provider);
+ result = (CipherSpi) spi;
result.engineSetMode(mode);
result.engineSetPadding(pad);
return new Cipher(result, provider, transformation);
@@ -319,18 +317,16 @@ public class Cipher
catch (Exception e)
{
if (e instanceof NoSuchPaddingException)
- {
- throw (NoSuchPaddingException) e;
- }
- msg = e.getMessage();
+ throw (NoSuchPaddingException) e;
+ cause = e;
}
}
- throw new NoSuchAlgorithmException(transformation + ": " + msg);
+ sb.append("could not be created");
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
- // Constructor.
- // ------------------------------------------------------------------------
-
/**
* Create a cipher.
*
@@ -347,9 +343,6 @@ public class Cipher
state = INITIAL_STATE;
}
- // Public instance methods.
- // ------------------------------------------------------------------------
-
/**
* Get the name that this cipher instance was created with; this is
* equivalent to the "transformation" argument given to any of the
diff --git a/libjava/classpath/javax/crypto/CipherOutputStream.java b/libjava/classpath/javax/crypto/CipherOutputStream.java
index adeb6e5ed38..5d1e57a16d2 100644
--- a/libjava/classpath/javax/crypto/CipherOutputStream.java
+++ b/libjava/classpath/javax/crypto/CipherOutputStream.java
@@ -45,59 +45,25 @@ import java.io.OutputStream;
/**
* A filtered output stream that transforms data written to it with a
* {@link Cipher} before sending it to the underlying output stream.
- *
+ *
* @author Casey Marshall (csm@gnu.org)
*/
public class CipherOutputStream extends FilterOutputStream
{
-
- // Fields.
- // ------------------------------------------------------------------------
-
/** The underlying cipher. */
private Cipher cipher;
- private byte[][] inBuffer;
-
- private int inLength;
-
- private byte[] outBuffer;
-
- private static final int FIRST_TIME = 0;
- private static final int SECOND_TIME = 1;
- private static final int SEASONED = 2;
- private int state;
-
- /** True if the cipher is a stream cipher (blockSize == 1) */
- private boolean isStream;
-
- // Constructors.
- // ------------------------------------------------------------------------
-
/**
- * Create a new cipher output stream. The cipher argument must have
- * already been initialized.
- *
- * @param out The sink for transformed data.
+ * Create a new cipher output stream. The cipher argument must have already
+ * been initialized.
+ *
+ * @param out The sink for transformed data.
* @param cipher The cipher to transform data with.
*/
public CipherOutputStream(OutputStream out, Cipher cipher)
{
super(out);
- if (cipher != null)
- {
- this.cipher = cipher;
- if (!(isStream = cipher.getBlockSize() == 1))
- {
- inBuffer = new byte[2][];
- inBuffer[0] = new byte[cipher.getBlockSize()];
- inBuffer[1] = new byte[cipher.getBlockSize()];
- inLength = 0;
- state = FIRST_TIME;
- }
- }
- else
- this.cipher = new NullCipher();
+ this.cipher = (cipher != null) ? cipher : new NullCipher();
}
/**
@@ -110,52 +76,36 @@ public class CipherOutputStream extends FilterOutputStream
super(out);
}
- // Instance methods.
- // ------------------------------------------------------------------------
-
/**
* Close this output stream, and the sink output stream.
- *
- * <p>This method will first invoke the {@link Cipher#doFinal()}
- * method of the underlying {@link Cipher}, and writes the output of
- * that method to the sink output stream.
- *
- * @throws java.io.IOException If an I/O error occurs, or if an error
- * is caused by finalizing the transformation.
+ * <p>
+ * This method will first invoke the {@link Cipher#doFinal()} method of the
+ * underlying {@link Cipher}, and writes the output of that method to the
+ * sink output stream.
+ *
+ * @throws IOException If an I/O error occurs, or if an error is caused by
+ * finalizing the transformation.
*/
public void close() throws IOException
{
try
{
- int len;
- if (state != FIRST_TIME)
- {
- len = cipher.update(inBuffer[0], 0, inBuffer[0].length, outBuffer);
- out.write(outBuffer, 0, len);
- }
- len = cipher.doFinal(inBuffer[0], 0, inLength, outBuffer);
- out.write(outBuffer, 0, len);
- }
- catch (javax.crypto.IllegalBlockSizeException ibse)
- {
- throw new IOException(ibse.toString());
+ out.write(cipher.doFinal());
+ out.flush();
+ out.close();
}
- catch (javax.crypto.BadPaddingException bpe)
+ catch (Exception cause)
{
- throw new IOException(bpe.toString());
+ IOException ioex = new IOException(String.valueOf(cause));
+ ioex.initCause(cause);
+ throw ioex;
}
- catch (ShortBufferException sbe)
- {
- throw new IOException(sbe.toString());
- }
- out.flush();
- out.close();
}
/**
* Flush any pending output.
*
- * @throws java.io.IOException If an I/O error occurs.
+ * @throws IOException If an I/O error occurs.
*/
public void flush() throws IOException
{
@@ -164,40 +114,22 @@ public class CipherOutputStream extends FilterOutputStream
/**
* Write a single byte to the output stream.
- *
+ *
* @param b The next byte.
- * @throws java.io.IOException If an I/O error occurs, or if the
- * underlying cipher is not in the correct state to transform
- * data.
+ * @throws IOException If an I/O error occurs, or if the underlying cipher is
+ * not in the correct state to transform data.
*/
public void write(int b) throws IOException
{
- if (isStream)
- {
- byte[] buf = new byte[] { (byte) b };
- try
- {
- cipher.update(buf, 0, 1, buf, 0);
- }
- catch (ShortBufferException sbe)
- {
- throw new IOException(sbe.toString());
- }
- out.write(buf);
- return;
- }
- inBuffer[1][inLength++] = (byte) b;
- if (inLength == inBuffer[1].length)
- process();
+ write(new byte[] { (byte) b }, 0, 1);
}
/**
* Write a byte array to the output stream.
- *
+ *
* @param buf The next bytes.
- * @throws java.io.IOException If an I/O error occurs, or if the
- * underlying cipher is not in the correct state to transform
- * data.
+ * @throws IOException If an I/O error occurs, or if the underlying cipher is
+ * not in the correct state to transform data.
*/
public void write(byte[] buf) throws IOException
{
@@ -206,63 +138,15 @@ public class CipherOutputStream extends FilterOutputStream
/**
* Write a portion of a byte array to the output stream.
- *
+ *
* @param buf The next bytes.
* @param off The offset in the byte array to start.
* @param len The number of bytes to write.
- * @throws java.io.IOException If an I/O error occurs, or if the
- * underlying cipher is not in the correct state to transform
- * data.
+ * @throws IOException If an I/O error occurs, or if the underlying cipher is
+ * not in the correct state to transform data.
*/
public void write(byte[] buf, int off, int len) throws IOException
{
- if (isStream)
- {
- out.write(cipher.update(buf, off, len));
- return;
- }
- int count = 0;
- while (count < len)
- {
- int l = Math.min(inBuffer[1].length - inLength, len - count);
- System.arraycopy(buf, off+count, inBuffer[1], inLength, l);
- count += l;
- inLength += l;
- if (inLength == inBuffer[1].length)
- process();
- }
- }
-
- // Own method.
- // -------------------------------------------------------------------------
-
- private void process() throws IOException
- {
- if (state == SECOND_TIME)
- {
- state = SEASONED;
- }
- else
- {
- byte[] temp = inBuffer[0];
- inBuffer[0] = inBuffer[1];
- inBuffer[1] = temp;
- }
- if (state == FIRST_TIME)
- {
- inLength = 0;
- state = SECOND_TIME;
- return;
- }
- try
- {
- cipher.update(inBuffer[0], 0, inBuffer[0].length, outBuffer);
- }
- catch (ShortBufferException sbe)
- {
- throw new IOException(sbe.toString());
- }
- out.write(outBuffer);
- inLength = 0;
+ out.write(cipher.update(buf, off, len));
}
}
diff --git a/libjava/classpath/javax/crypto/ExemptionMechanism.java b/libjava/classpath/javax/crypto/ExemptionMechanism.java
index b6cb02c63c8..baf6bad99e0 100644
--- a/libjava/classpath/javax/crypto/ExemptionMechanism.java
+++ b/libjava/classpath/javax/crypto/ExemptionMechanism.java
@@ -87,66 +87,111 @@ public class ExemptionMechanism
virgin = true;
}
- // Class methods.
- // ------------------------------------------------------------------------
-
+ /**
+ * Create an instance of <code>ExemptionMechanism</code> for a designated
+ * <code>mechanism</code> from the first Security Provider offering it.
+ *
+ * @param mechanism the name of the exemption mechanism to create.
+ * @return a newly created instance of <code>ExemptionMechanism</code>.
+ * @throws IllegalArgumentException if the provider is null.
+ * @throws NoSuchAlgorithmException if no such exemption mechanism is
+ * available from any known Security Provider.
+ * @throws IllegalArgumentException if <code>mechanism</code> is
+ * <code>null</code> or is an empty string.
+ */
public static final ExemptionMechanism getInstance(String mechanism)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
- Provider[] provs = Security.getProviders();
- String msg = "";
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(mechanism, provs[i]);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- msg = nsae.getMessage();
- }
- }
- throw new NoSuchAlgorithmException(msg);
+ Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
+ for (int i = 0; i < p.length; i++)
+ try
+ {
+ return getInstance(mechanism, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
+ throw new NoSuchAlgorithmException(mechanism);
}
+ /**
+ * Create an instance of <code>ExemptionMechanism</code> for a designated
+ * <code>mechanism</code> from a named <code>provider</code>.
+ *
+ * @param mechanism the name of the exemption mechanism to create.
+ * @param provider the security provider to provide the exemption
+ * <code>mechanism</code>.
+ * @return a newly created instance of <code>ExemptionMechanism</code>.
+ * @throws NoSuchAlgorithmException if no such exemption mechanism is
+ * available from the named <code>provider</code>.
+ * @throws NoSuchProviderException if no Security Provider with the designated
+ * name is known to the underlying JVM.
+ * @throws IllegalArgumentException if either <code>mechanism</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>mechanism</code> is an empty string.
+ */
public static final ExemptionMechanism getInstance(String mechanism,
String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
Provider p = Security.getProvider(provider);
if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
+ throw new NoSuchProviderException(provider);
return getInstance(mechanism, p);
}
+ /**
+ * Create an instance of <code>ExemptionMechanism</code> for a designated
+ * <code>mechanism</code> from a designated <code>provider</code>.
+ *
+ * @param mechanism the name of the exemption mechanism to create.
+ * @param provider the security provider to provide the exemption
+ * <code>mechanism</code>.
+ * @return a newly created instance of <code>ExemptionMechanism</code>.
+ * @throws NoSuchAlgorithmException if an exemption mechanism could not be
+ * created.
+ * @throws IllegalArgumentException if either <code>mechanism</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>mechanism</code> is an empty string.
+ */
public static final ExemptionMechanism getInstance(String mechanism,
Provider provider)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
+ StringBuilder sb = new StringBuilder("ExemptionMechanism [")
+ .append(mechanism).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- return new ExemptionMechanism((ExemptionMechanismSpi)
- Engine.getInstance(SERVICE, mechanism, provider),
- provider, mechanism);
+ Object spi = Engine.getInstance(SERVICE, mechanism, provider);
+ return new ExemptionMechanism((ExemptionMechanismSpi) spi,
+ provider,
+ mechanism);
}
- catch (InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- if (ite.getCause() instanceof NoSuchAlgorithmException)
- throw (NoSuchAlgorithmException) ite.getCause();
- else
- throw new NoSuchAlgorithmException(mechanism);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new NoSuchAlgorithmException(mechanism);
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
- // Instance methods.
- // ------------------------------------------------------------------------
-
public final byte[] genExemptionBlob()
throws IllegalStateException, ExemptionMechanismException
{
diff --git a/libjava/classpath/javax/crypto/KeyAgreement.java b/libjava/classpath/javax/crypto/KeyAgreement.java
index d71743e3e63..49003109106 100644
--- a/libjava/classpath/javax/crypto/KeyAgreement.java
+++ b/libjava/classpath/javax/crypto/KeyAgreement.java
@@ -101,97 +101,103 @@ public class KeyAgreement
virgin = true;
}
- // Class methods.
- // ------------------------------------------------------------------------
-
/**
* Get an implementation of an algorithm from the first provider that
* implements it.
- *
+ *
* @param algorithm The name of the algorithm to get.
* @return The proper KeyAgreement instacne, if found.
- * @throws java.security.NoSuchAlgorithmException If the specified
- * algorithm is not implemented by any installed provider.
+ * @throws NoSuchAlgorithmException If the specified algorithm is not
+ * implemented by any installed provider.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static final KeyAgreement getInstance(String algorithm)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
- Provider[] provs = Security.getProviders();
- String msg = algorithm;
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(algorithm, provs[i]);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- msg = nsae.getMessage();
- }
- }
- throw new NoSuchAlgorithmException(msg);
+ Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
+ for (int i = 0; i < p.length; i++)
+ try
+ {
+ return getInstance(algorithm, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
+ throw new NoSuchAlgorithmException(algorithm);
}
/**
- * Get an implementation of an algorithm from a named provider.
- *
- * @param algorithm The name of the algorithm to get.
- * @param provider The name of the provider from which to get the
- * implementation.
+ * Return an implementation of an algorithm from a named provider.
+ *
+ * @param algorithm The name of the algorithm to create.
+ * @param provider The name of the provider from which to get the
+ * implementation.
* @return The proper KeyAgreement instance, if found.
- * @throws java.security.NoSuchAlgorithmException If the named provider
- * does not implement the algorithm.
- * @throws java.security.NoSuchProviderException If the named provider
- * does not exist.
+ * @throws NoSuchAlgorithmException If the named provider does not implement
+ * the algorithm.
+ * @throws NoSuchProviderException If the named provider does not exist.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
- public static final KeyAgreement getInstance(String algorithm,
- String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ public static final KeyAgreement getInstance(String algorithm, String provider)
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
Provider p = Security.getProvider(provider);
if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
+ throw new NoSuchProviderException(provider);
return getInstance(algorithm, p);
}
/**
- * Get an implementation of an algorithm from a specific provider.
- *
+ * Return an implementation of an algorithm from a specific provider.
+ *
* @param algorithm The name of the algorithm to get.
- * @param provider The provider from which to get the implementation.
+ * @param provider The provider from which to get the implementation.
* @return The proper KeyAgreement instance, if found.
- * @throws java.security.NoSuchAlgorithmException If this provider
- * does not implement the algorithm.
+ * @throws NoSuchAlgorithmException If this provider does not implement the
+ * algorithm.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
public static final KeyAgreement getInstance(String algorithm,
Provider provider)
throws NoSuchAlgorithmException
{
+ StringBuilder sb = new StringBuilder("KeyAgreement algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- return new KeyAgreement((KeyAgreementSpi)
- Engine.getInstance(SERVICE, algorithm, provider),
- provider, algorithm);
+ Object spi = Engine.getInstance(SERVICE, algorithm, provider);
+ return new KeyAgreement((KeyAgreementSpi) spi, provider, algorithm);
}
- catch (InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- if (ite.getCause() == null)
- throw new NoSuchAlgorithmException(algorithm);
- if (ite.getCause() instanceof NoSuchAlgorithmException)
- throw (NoSuchAlgorithmException) ite.getCause();
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
- // Instance methods.
- // ------------------------------------------------------------------------
-
/**
* Do a phase in the key agreement. The number of times this method is
* called depends upon the algorithm and the number of parties
diff --git a/libjava/classpath/javax/crypto/KeyGenerator.java b/libjava/classpath/javax/crypto/KeyGenerator.java
index e824c64522e..79334e9e05e 100644
--- a/libjava/classpath/javax/crypto/KeyGenerator.java
+++ b/libjava/classpath/javax/crypto/KeyGenerator.java
@@ -94,95 +94,103 @@ public class KeyGenerator
this.algorithm = algorithm;
}
- // Class methods.
- // ------------------------------------------------------------------------
-
/**
- * Create a new key generator, returning the first available
- * implementation.
- *
+ * Create a new key generator, returning the first available implementation.
+ *
* @param algorithm The generator algorithm name.
- * @throws java.security.NoSuchAlgorithmException If the specified
- * algorithm does not exist.
+ * @throws NoSuchAlgorithmException If the specified algorithm does not exist.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static final KeyGenerator getInstance(String algorithm)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
- Provider[] provs = Security.getProviders();
- String msg = algorithm;
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(algorithm, provs[i]);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- msg = nsae.getMessage();
- }
- }
- throw new NoSuchAlgorithmException(msg);
+ Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
+ for (int i = 0; i < p.length; i++)
+ try
+ {
+ return getInstance(algorithm, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
+ throw new NoSuchAlgorithmException(algorithm);
}
/**
* Create a new key generator from the named provider.
- *
+ *
* @param algorithm The generator algorithm name.
- * @param provider The name of the provider to use.
+ * @param provider The name of the provider to use.
* @return An appropriate key generator, if found.
- * @throws java.security.NoSuchAlgorithmException If the specified
- * algorithm is not implemented by the named provider.
- * @throws java.security.NoSuchProviderException If the named provider
- * does not exist.
+ * @throws NoSuchAlgorithmException If the specified algorithm is not
+ * implemented by the named provider.
+ * @throws NoSuchProviderException If the named provider does not exist.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
public static final KeyGenerator getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
Provider p = Security.getProvider(provider);
if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
+ throw new NoSuchProviderException(provider);
return getInstance(algorithm, p);
}
/**
* Create a new key generator from the supplied provider.
- *
+ *
* @param algorithm The generator algorithm name.
- * @param provider The provider to use.
+ * @param provider The provider to use.
* @return An appropriate key generator, if found.
- * @throws java.security.NoSuchAlgorithmException If the specified
- * algorithm is not implemented by the provider.
+ * @throws NoSuchAlgorithmException If the specified algorithm is not
+ * implemented by the provider.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
- public static final KeyGenerator getInstance(String algorithm, Provider provider)
- throws NoSuchAlgorithmException
+ public static final KeyGenerator getInstance(String algorithm,
+ Provider provider)
+ throws NoSuchAlgorithmException
{
+ StringBuilder sb = new StringBuilder("KeyGenerator algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- KeyGenerator instance = new KeyGenerator((KeyGeneratorSpi)
- Engine.getInstance(SERVICE, algorithm, provider),
- provider, algorithm);
+ Object spi = Engine.getInstance(SERVICE, algorithm, provider);
+ KeyGenerator instance = new KeyGenerator((KeyGeneratorSpi) spi,
+ provider,
+ algorithm);
instance.init(new SecureRandom());
return instance;
}
- catch (InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- if (ite.getCause() == null)
- throw new NoSuchAlgorithmException(algorithm);
- if (ite.getCause() instanceof NoSuchAlgorithmException)
- throw (NoSuchAlgorithmException) ite.getCause();
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
- // Instance methods.
- // ------------------------------------------------------------------------
-
/**
* Generate a key.
*
diff --git a/libjava/classpath/javax/crypto/Mac.java b/libjava/classpath/javax/crypto/Mac.java
index abbff8b2387..2a269ab8084 100644
--- a/libjava/classpath/javax/crypto/Mac.java
+++ b/libjava/classpath/javax/crypto/Mac.java
@@ -41,6 +41,7 @@ package javax.crypto;
import gnu.java.security.Engine;
import java.lang.reflect.InvocationTargetException;
+import java.nio.ByteBuffer;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.Key;
@@ -107,96 +108,104 @@ public class Mac implements Cloneable
virgin = true;
}
- // Class methods.
- // ------------------------------------------------------------------------
-
/**
- * Get an instance of the named algorithm from the first provider with
- * an appropriate implementation.
- *
+ * Create an instance of the named algorithm from the first provider with an
+ * appropriate implementation.
+ *
* @param algorithm The name of the algorithm.
- * @return An appropriate Mac instance, if the specified algorithm
- * is implemented by a provider.
- * @throws java.security.NoSuchAlgorithmException If no implementation
- * of the named algorithm is installed.
+ * @return An appropriate Mac instance, if the specified algorithm is
+ * implemented by a provider.
+ * @throws NoSuchAlgorithmException If no implementation of the named
+ * algorithm is installed.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static final Mac getInstance(String algorithm)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
- Provider[] provs = Security.getProviders();
- String msg = "";
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(algorithm, provs[i]);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- msg = nsae.getMessage();
- }
- }
- throw new NoSuchAlgorithmException(msg);
+ Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
+ for (int i = 0; i < p.length; i++)
+ try
+ {
+ return getInstance(algorithm, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
+ throw new NoSuchAlgorithmException(algorithm);
}
/**
- * Get an instance of the named algorithm from the named provider.
- *
+ * Create an instance of the named algorithm from the named provider.
+ *
* @param algorithm The name of the algorithm.
- * @param provider The name of the provider.
+ * @param provider The name of the provider.
* @return An appropriate Mac instance, if the specified algorithm is
* implemented by the named provider.
- * @throws java.security.NoSuchAlgorithmException If the named provider
- * has no implementation of the algorithm.
- * @throws java.security.NoSuchProviderException If the named provider
- * does not exist.
+ * @throws NoSuchAlgorithmException If the named provider has no
+ * implementation of the algorithm.
+ * @throws NoSuchProviderException If the named provider does not exist.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
public static final Mac getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
Provider p = Security.getProvider(provider);
if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
+ throw new NoSuchProviderException(provider);
return getInstance(algorithm, p);
}
/**
- * Get an instance of the named algorithm from a provider.
- *
+ * Create an instance of the named algorithm from a provider.
+ *
* @param algorithm The name of the algorithm.
- * @param provider The provider.
+ * @param provider The provider.
* @return An appropriate Mac instance, if the specified algorithm is
* implemented by the provider.
- * @throws java.security.NoSuchAlgorithmException If the provider
- * has no implementation of the algorithm.
+ * @throws NoSuchAlgorithmException If the provider has no implementation of
+ * the algorithm.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
public static final Mac getInstance(String algorithm, Provider provider)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
+ StringBuilder sb = new StringBuilder("Mac algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- return new Mac((MacSpi) Engine.getInstance(SERVICE, algorithm, provider),
- provider, algorithm);
+ Object spi = Engine.getInstance(SERVICE, algorithm, provider);
+ return new Mac((MacSpi) spi, provider, algorithm);
}
- catch (InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- if (ite.getCause() == null)
- throw new NoSuchAlgorithmException(algorithm);
- if (ite.getCause() instanceof NoSuchAlgorithmException)
- throw (NoSuchAlgorithmException) ite.getCause();
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
- // Instance methods.
- // ------------------------------------------------------------------------
-
/**
* Finishes the computation of a MAC and returns the digest.
*
@@ -398,6 +407,18 @@ public class Mac implements Cloneable
}
/**
+ * Update this MAC with the remaining bytes in the given buffer
+ * @param buffer The input buffer.
+ * @since 1.5
+ */
+ public final void update (final ByteBuffer buffer)
+ {
+ if (virgin)
+ throw new IllegalStateException ("not initialized");
+ macSpi.engineUpdate(buffer);
+ }
+
+ /**
* Clone this instance, if the underlying implementation supports it.
*
* @return A clone of this instance.
diff --git a/libjava/classpath/javax/crypto/MacSpi.java b/libjava/classpath/javax/crypto/MacSpi.java
index b0f96bff367..853bd66aa0f 100644
--- a/libjava/classpath/javax/crypto/MacSpi.java
+++ b/libjava/classpath/javax/crypto/MacSpi.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.crypto;
+import java.nio.ByteBuffer;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.Key;
@@ -142,4 +143,21 @@ public abstract class MacSpi
* @param length The number of bytes to update.
*/
protected abstract void engineUpdate(byte[] input, int offset, int length);
+
+ /**
+ * Update this MAC with the remaining bytes of a buffer.
+ *
+ * @param buffer The input buffer.
+ * @since 1.5
+ */
+ protected void engineUpdate (final ByteBuffer buffer)
+ {
+ byte[] buf = new byte[1024];
+ while (buffer.hasRemaining ())
+ {
+ int n = Math.min (buffer.remaining (), buf.length);
+ buffer.get (buf, 0, n);
+ engineUpdate (buf, 0, n);
+ }
+ }
}
diff --git a/libjava/classpath/javax/crypto/SecretKeyFactory.java b/libjava/classpath/javax/crypto/SecretKeyFactory.java
index 0a63ef06745..1c857d274a8 100644
--- a/libjava/classpath/javax/crypto/SecretKeyFactory.java
+++ b/libjava/classpath/javax/crypto/SecretKeyFactory.java
@@ -94,94 +94,102 @@ public class SecretKeyFactory
this.algorithm = algorithm;
}
- // Class methods.
- // ------------------------------------------------------------------------
-
/**
- * Create a new secret key factory from the first appropriate
- * instance.
- *
+ * Create a new secret key factory from the first appropriate instance.
+ *
* @param algorithm The algorithm name.
* @return The appropriate key factory, if found.
- * @throws java.security.NoSuchAlgorithmException If no provider
- * implements the specified algorithm.
+ * @throws NoSuchAlgorithmException If no provider implements the specified
+ * algorithm.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static final SecretKeyFactory getInstance(String algorithm)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
- Provider[] provs = Security.getProviders();
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(algorithm, provs[i]);
- }
- catch (NoSuchAlgorithmException nsae)
- {
- }
- }
- throw new NoSuchAlgorithmException(algorithm);
+ Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
+ for (int i = 0; i < p.length; i++)
+ try
+ {
+ return getInstance(algorithm, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
+ throw new NoSuchAlgorithmException(algorithm);
}
/**
* Create a new secret key factory from the named provider.
- *
+ *
* @param algorithm The algorithm name.
- * @param provider The provider name.
+ * @param provider The provider name.
* @return The appropriate key factory, if found.
- * @throws java.security.NoSuchAlgorithmException If the named
- * provider does not implement the algorithm.
- * @throws java.security.NoSuchProviderException If the named provider
- * does not exist.
+ * @throws NoSuchAlgorithmException If the named provider does not implement
+ * the algorithm.
+ * @throws NoSuchProviderException If the named provider does not exist.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
public static final SecretKeyFactory getInstance(String algorithm,
String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
+ if (provider == null)
+ throw new IllegalArgumentException("provider MUST NOT be null");
Provider p = Security.getProvider(provider);
if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
+ throw new NoSuchProviderException(provider);
return getInstance(algorithm, p);
}
/**
* Create a new secret key factory from the specified provider.
- *
+ *
* @param algorithm The algorithm name.
- * @param provider The provider.
+ * @param provider The provider.
* @return The appropriate key factory, if found.
- * @throws java.security.NoSuchAlgorithmException If the provider
- * does not implement the algorithm.
+ * @throws NoSuchAlgorithmException If the provider does not implement the
+ * algorithm.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
public static final SecretKeyFactory getInstance(String algorithm,
Provider provider)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
+ StringBuilder sb = new StringBuilder("SecretKeyFactory algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- return new SecretKeyFactory((SecretKeyFactorySpi)
- Engine.getInstance(SERVICE, algorithm, provider),
- provider, algorithm);
+ Object spi = Engine.getInstance(SERVICE, algorithm, provider);
+ return new SecretKeyFactory((SecretKeyFactorySpi) spi, provider, algorithm);
}
- catch (InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- if (ite.getCause() == null)
- throw new NoSuchAlgorithmException(algorithm);
- if (ite.getCause() instanceof NoSuchAlgorithmException)
- throw (NoSuchAlgorithmException) ite.getCause();
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
- // Instance methods.
- // ------------------------------------------------------------------------
-
/**
* Generate a secret key from a key specification, if possible.
*
diff --git a/libjava/classpath/javax/imageio/IIOImage.java b/libjava/classpath/javax/imageio/IIOImage.java
index 0d987476239..bd69bae5f1e 100644
--- a/libjava/classpath/javax/imageio/IIOImage.java
+++ b/libjava/classpath/javax/imageio/IIOImage.java
@@ -79,8 +79,7 @@ public class IIOImage
/**
* A list of BufferedImage thumbnails of this image.
*/
- // for 1.5 these lists are List<? extends BufferedImage>
- protected List thumbnails;
+ protected List<? extends BufferedImage> thumbnails;
/**
* Construct an IIOImage containing raster image data, thumbnails
@@ -92,7 +91,8 @@ public class IIOImage
*
* @exception IllegalArgumentException if raster is null
*/
- public IIOImage (Raster raster, List thumbnails, IIOMetadata metadata)
+ public IIOImage (Raster raster, List<? extends BufferedImage> thumbnails,
+ IIOMetadata metadata)
{
if (raster == null)
throw new IllegalArgumentException ("raster may not be null");
@@ -112,7 +112,8 @@ public class IIOImage
*
* @exception IllegalArgumentException if image is null
*/
- public IIOImage (RenderedImage image, List thumbnails, IIOMetadata metadata)
+ public IIOImage (RenderedImage image, List<? extends BufferedImage> thumbnails,
+ IIOMetadata metadata)
{
if (image == null)
throw new IllegalArgumentException ("image may not be null");
@@ -192,7 +193,7 @@ public class IIOImage
*
* @return a list of thumbnails or null
*/
- public List getThumbnails()
+ public List<? extends BufferedImage> getThumbnails()
{
return thumbnails;
}
@@ -260,7 +261,7 @@ public class IIOImage
*
* @param thumbnails a new list of thumbnails or null
*/
- public void setThumbnails (List thumbnails)
+ public void setThumbnails (List<? extends BufferedImage> thumbnails)
{
this.thumbnails = thumbnails;
}
diff --git a/libjava/classpath/javax/imageio/ImageIO.java b/libjava/classpath/javax/imageio/ImageIO.java
index b2304a78304..a3d967726b9 100644
--- a/libjava/classpath/javax/imageio/ImageIO.java
+++ b/libjava/classpath/javax/imageio/ImageIO.java
@@ -315,27 +315,37 @@ public final class ImageIO
}
}
- private static final class ImageReaderIterator implements Iterator
+ private static final class ImageReaderIterator
+ implements Iterator<ImageReader>
{
- Iterator it;
+ Iterator<ImageReaderSpi> it;
Object readerExtension;
- public ImageReaderIterator(Iterator it, Object readerExtension)
+ public ImageReaderIterator(Iterator<ImageReaderSpi> it,
+ Object readerExtension)
{
this.it = it;
this.readerExtension = readerExtension;
}
+
+ public ImageReaderIterator(Iterator<ImageReaderSpi> it)
+ {
+ this.it = it;
+ }
public boolean hasNext()
{
return it.hasNext();
}
- public Object next()
+ public ImageReader next()
{
try
{
- return ((ImageReaderSpi) it.next()).createReaderInstance(readerExtension);
+ ImageReaderSpi spi = it.next();
+ return (readerExtension == null
+ ? spi.createReaderInstance()
+ : spi.createReaderInstance(readerExtension));
}
catch (IOException e)
{
@@ -349,27 +359,37 @@ public final class ImageIO
}
}
- private static final class ImageWriterIterator implements Iterator
+ private static final class ImageWriterIterator
+ implements Iterator<ImageWriter>
{
- Iterator it;
+ Iterator<ImageWriterSpi> it;
Object writerExtension;
- public ImageWriterIterator(Iterator it, Object writerExtension)
+ public ImageWriterIterator(Iterator<ImageWriterSpi> it,
+ Object writerExtension)
{
this.it = it;
this.writerExtension = writerExtension;
}
+
+ public ImageWriterIterator(Iterator<ImageWriterSpi> it)
+ {
+ this.it = it;
+ }
public boolean hasNext()
{
return it.hasNext();
}
- public Object next()
+ public ImageWriter next()
{
try
{
- return ((ImageWriterSpi) it.next()).createWriterInstance(writerExtension);
+ ImageWriterSpi spi = it.next();
+ return (writerExtension == null
+ ? spi.createWriterInstance()
+ : spi.createWriterInstance(writerExtension));
}
catch (IOException e)
{
@@ -386,13 +406,14 @@ public final class ImageIO
private static File cacheDirectory;
private static boolean useCache = true;
- private static Iterator getReadersByFilter(Class type,
- ServiceRegistry.Filter filter,
- Object readerExtension)
+ private static Iterator<ImageReader> getReadersByFilter(Class<ImageReaderSpi> type,
+ ServiceRegistry.Filter filter,
+ Object readerExtension)
{
try
{
- Iterator it = getRegistry().getServiceProviders(type, filter, true);
+ Iterator<ImageReaderSpi> it
+ = getRegistry().getServiceProviders(type, filter, true);
return new ImageReaderIterator(it, readerExtension);
}
catch (IllegalArgumentException e)
@@ -401,13 +422,14 @@ public final class ImageIO
}
}
- private static Iterator getWritersByFilter(Class type,
- ServiceRegistry.Filter filter,
- Object writerExtension)
+ private static Iterator<ImageWriter> getWritersByFilter(Class<ImageWriterSpi> type,
+ ServiceRegistry.Filter filter,
+ Object writerExtension)
{
try
{
- Iterator it = getRegistry().getServiceProviders(type, filter, true);
+ Iterator<ImageWriterSpi> it
+ = getRegistry().getServiceProviders(type, filter, true);
return new ImageWriterIterator(it, writerExtension);
}
catch (IllegalArgumentException e)
@@ -436,7 +458,7 @@ public final class ImageIO
*
* @exception IllegalArgumentException if formatName is null
*/
- public static Iterator getImageReadersByFormatName(String formatName)
+ public static Iterator<ImageReader> getImageReadersByFormatName(String formatName)
{
if (formatName == null)
throw new IllegalArgumentException("formatName may not be null");
@@ -457,7 +479,7 @@ public final class ImageIO
*
* @exception IllegalArgumentException if MIMEType is null
*/
- public static Iterator getImageReadersByMIMEType(String MIMEType)
+ public static Iterator<ImageReader> getImageReadersByMIMEType(String MIMEType)
{
if (MIMEType == null)
throw new IllegalArgumentException("MIMEType may not be null");
@@ -477,7 +499,7 @@ public final class ImageIO
*
* @exception IllegalArgumentException if fileSuffix is null
*/
- public static Iterator getImageReadersBySuffix(String fileSuffix)
+ public static Iterator<ImageReader> getImageReadersBySuffix(String fileSuffix)
{
if (fileSuffix == null)
throw new IllegalArgumentException("formatName may not be null");
@@ -497,7 +519,7 @@ public final class ImageIO
*
* @exception IllegalArgumentException if formatName is null
*/
- public static Iterator getImageWritersByFormatName(String formatName)
+ public static Iterator<ImageWriter> getImageWritersByFormatName(String formatName)
{
if (formatName == null)
throw new IllegalArgumentException("formatName may not be null");
@@ -518,7 +540,7 @@ public final class ImageIO
*
* @exception IllegalArgumentException if MIMEType is null
*/
- public static Iterator getImageWritersByMIMEType(String MIMEType)
+ public static Iterator<ImageWriter> getImageWritersByMIMEType(String MIMEType)
{
if (MIMEType == null)
throw new IllegalArgumentException("MIMEType may not be null");
@@ -538,7 +560,7 @@ public final class ImageIO
*
* @exception IllegalArgumentException if fileSuffix is null
*/
- public static Iterator getImageWritersBySuffix(String fileSuffix)
+ public static Iterator<ImageWriter> getImageWritersBySuffix(String fileSuffix)
{
if (fileSuffix == null)
throw new IllegalArgumentException("fileSuffix may not be null");
@@ -1068,8 +1090,7 @@ public final class ImageIO
if (writer == null)
throw new IllegalArgumentException ("null argument");
- ImageWriterSpi spi = (ImageWriterSpi) getRegistry()
- .getServiceProviderByClass(writer.getClass());
+ ImageWriterSpi spi = writer.getOriginatingProvider();
String[] readerSpiNames = spi.getImageReaderSpiNames();
@@ -1098,14 +1119,16 @@ public final class ImageIO
*
* @return an iterator over a collection of image readers
*/
- public static Iterator getImageReaders (Object input)
+ public static Iterator<ImageReader> getImageReaders (Object input)
{
if (input == null)
throw new IllegalArgumentException ("null argument");
- return getRegistry().getServiceProviders (ImageReaderSpi.class,
- new ReaderObjectFilter(input),
- true);
+ Iterator<ImageReaderSpi> spiIterator
+ = getRegistry().getServiceProviders (ImageReaderSpi.class,
+ new ReaderObjectFilter(input),
+ true);
+ return new ImageReaderIterator(spiIterator);
}
/**
@@ -1118,16 +1141,18 @@ public final class ImageIO
*
* @return an iterator over a collection of image writers
*/
- public static Iterator getImageWriters (ImageTypeSpecifier type,
+ public static Iterator<ImageWriter> getImageWriters (ImageTypeSpecifier type,
String formatName)
{
if (type == null || formatName == null)
throw new IllegalArgumentException ("null argument");
- return getRegistry().getServiceProviders (ImageWriterSpi.class,
- new WriterObjectFilter(type,
- formatName),
- true);
+ final Iterator<ImageWriterSpi> spiIterator
+ = getRegistry().getServiceProviders (ImageWriterSpi.class,
+ new WriterObjectFilter(type,
+ formatName),
+ true);
+ return new ImageWriterIterator(spiIterator);
}
/**
@@ -1149,8 +1174,7 @@ public final class ImageIO
if (reader == null)
throw new IllegalArgumentException ("null argument");
- ImageReaderSpi spi = (ImageReaderSpi) getRegistry()
- .getServiceProviderByClass(reader.getClass());
+ ImageReaderSpi spi = reader.getOriginatingProvider();
String[] writerSpiNames = spi.getImageWriterSpiNames();
@@ -1184,15 +1208,33 @@ public final class ImageIO
* @exception IllegalArgumentException if either reader or writer is
* null
*/
- public static Iterator getImageTranscoders (ImageReader reader,
- ImageWriter writer)
+ public static Iterator<ImageTranscoder> getImageTranscoders (ImageReader reader,
+ ImageWriter writer)
{
if (reader == null || writer == null)
throw new IllegalArgumentException ("null argument");
- return getRegistry().getServiceProviders (ImageTranscoderSpi.class,
- new TranscoderFilter (reader,
- writer),
- true);
+ final Iterator<ImageTranscoderSpi> spiIterator
+ = getRegistry().getServiceProviders (ImageTranscoderSpi.class,
+ new TranscoderFilter (reader,
+ writer),
+ true);
+ return new Iterator<ImageTranscoder>()
+ {
+ public boolean hasNext()
+ {
+ return spiIterator.hasNext();
+ }
+
+ public ImageTranscoder next()
+ {
+ return spiIterator.next().createTranscoderInstance();
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+ };
}
}
diff --git a/libjava/classpath/javax/imageio/ImageReader.java b/libjava/classpath/javax/imageio/ImageReader.java
index cdd77d52bad..c7eed06fbdc 100644
--- a/libjava/classpath/javax/imageio/ImageReader.java
+++ b/libjava/classpath/javax/imageio/ImageReader.java
@@ -116,7 +116,7 @@ public abstract class ImageReader
* A list of installed progress listeners. Initially null, meaning
* no installed listeners.
*/
- protected List progressListeners = null;
+ protected List<IIOReadProgressListener> progressListeners = null;
/**
* true if this reader should only read data further ahead in the
@@ -129,19 +129,19 @@ public abstract class ImageReader
* A list of installed update listeners. Initially null, meaning no
* installed listeners.
*/
- protected List updateListeners = null;
+ protected List<IIOReadUpdateListener> updateListeners = null;
/**
* A list of installed warning listeners. Initially null, meaning
* no installed listeners.
*/
- protected List warningListeners = null;
+ protected List<IIOReadWarningListener> warningListeners = null;
/**
* A list of warning locales corresponding with the list of
* installed warning listeners. Initially null, meaning no locales.
*/
- protected List warningLocales = null;
+ protected List<Locale> warningLocales = null;
/**
* Construct an image reader.
@@ -371,7 +371,7 @@ public abstract class ImageReader
* out-of-bounds
* @exception IOException if a read error occurs
*/
- public abstract Iterator getImageTypes(int imageIndex)
+ public abstract Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex)
throws IOException;
/**
@@ -1594,7 +1594,7 @@ public abstract class ImageReader
* height is greater than Integer.MAX_VALUE
*/
protected static BufferedImage getDestination (ImageReadParam param,
- Iterator imageTypes,
+ Iterator<ImageTypeSpecifier> imageTypes,
int width,
int height)
throws IIOException
@@ -1694,7 +1694,7 @@ public abstract class ImageReader
*/
public IIOMetadata getImageMetadata (int imageIndex,
String formatName,
- Set nodeNames)
+ Set<String> nodeNames)
throws IOException
{
if (formatName == null || nodeNames == null)
@@ -1808,7 +1808,7 @@ public abstract class ImageReader
* @exception IOException if a read error occurs
*/
public IIOMetadata getStreamMetadata (String formatName,
- Set nodeNames)
+ Set<String> nodeNames)
throws IOException
{
if (formatName == null || nodeNames == null)
@@ -1915,7 +1915,7 @@ public abstract class ImageReader
* destination image regions are empty
* @exception IOException if a read error occurs
*/
- public Iterator readAll (Iterator params)
+ public Iterator<IIOImage> readAll (Iterator<? extends ImageReadParam> params)
throws IOException
{
List l = new ArrayList ();
diff --git a/libjava/classpath/javax/imageio/ImageWriter.java b/libjava/classpath/javax/imageio/ImageWriter.java
index ef352154164..b49e081f002 100644
--- a/libjava/classpath/javax/imageio/ImageWriter.java
+++ b/libjava/classpath/javax/imageio/ImageWriter.java
@@ -40,6 +40,7 @@ package javax.imageio;
import java.awt.Dimension;
import java.awt.Rectangle;
+import java.awt.image.BufferedImage;
import java.awt.image.Raster;
import java.awt.image.RenderedImage;
import java.io.IOException;
@@ -102,19 +103,19 @@ public abstract class ImageWriter
* A list of installed progress listeners. Initially null, meaning
* no installed listeners.
*/
- protected List progressListeners = null;
+ protected List<IIOWriteProgressListener> progressListeners = null;
/**
* A list of installed warning listeners. Initially null, meaning
* no installed listeners.
*/
- protected List warningListeners = null;
+ protected List<IIOWriteWarningListener> warningListeners = null;
/**
* A list of warning locales corresponding with the list of
* installed warning listeners. Initially null, meaning no locales.
*/
- protected List warningLocales = null;
+ protected List<Locale> warningLocales = null;
/**
* Construct an image writer.
@@ -1076,7 +1077,7 @@ public abstract class ImageWriter
public void prepareInsertEmpty (int imageIndex, ImageTypeSpecifier imageType,
int width, int height,
IIOMetadata imageMetadata,
- List thumbnails,
+ List<? extends BufferedImage> thumbnails,
ImageWriteParam param)
throws IOException
{
@@ -1149,7 +1150,7 @@ public abstract class ImageWriter
ImageTypeSpecifier imageType,
int width, int height,
IIOMetadata imageMetadata,
- List thumbnails,
+ List<? extends BufferedImage> thumbnails,
ImageWriteParam param)
throws IOException
{
diff --git a/libjava/classpath/javax/imageio/metadata/IIOMetadataFormat.java b/libjava/classpath/javax/imageio/metadata/IIOMetadataFormat.java
index 76e0950a3df..15f2ceb0ba7 100644
--- a/libjava/classpath/javax/imageio/metadata/IIOMetadataFormat.java
+++ b/libjava/classpath/javax/imageio/metadata/IIOMetadataFormat.java
@@ -106,15 +106,15 @@ public interface IIOMetadataFormat
int getObjectArrayMinLength (String elementName);
- Class getObjectClass (String elementName);
+ Class<?> getObjectClass (String elementName);
Object getObjectDefaultValue (String elementName);
Object[] getObjectEnumerations (String elementName);
- Comparable getObjectMaxValue (String elementName);
+ Comparable<?> getObjectMaxValue (String elementName);
- Comparable getObjectMinValue (String elementName);
+ Comparable<?> getObjectMinValue (String elementName);
int getObjectValueType (String elementName);
diff --git a/libjava/classpath/javax/imageio/metadata/IIOMetadataFormatImpl.java b/libjava/classpath/javax/imageio/metadata/IIOMetadataFormatImpl.java
index aad30447c2f..78fad1a15f0 100644
--- a/libjava/classpath/javax/imageio/metadata/IIOMetadataFormatImpl.java
+++ b/libjava/classpath/javax/imageio/metadata/IIOMetadataFormatImpl.java
@@ -462,7 +462,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat
int dataType,
boolean required,
String defaultValue,
- List enumeratedValues)
+ List<String> enumeratedValues)
{
IIOMetadataNode node = (IIOMetadataNode) nodes.get (elementName);
node.setAttributeNode (new IIOMetadataNodeAttrEnumerated (node,
@@ -568,8 +568,8 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat
node.setUserObject (null);
}
- protected void addObjectValue (String elementName, Class classType,
- boolean required, Object defaultValue)
+ protected <T> void addObjectValue (String elementName, Class<T> classType,
+ boolean required, T defaultValue)
{
IIOMetadataNode node = (IIOMetadataNode) nodes.get (elementName);
addNodeObject (node, new NodeObject (node,
@@ -578,9 +578,9 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat
defaultValue));
}
- protected void addObjectValue (String elementName, Class classType,
- boolean required, Object defaultValue,
- List enumeratedValues)
+ protected <T> void addObjectValue (String elementName, Class<T> classType,
+ boolean required, T defaultValue,
+ List<? extends T> enumeratedValues)
{
IIOMetadataNode node = (IIOMetadataNode) nodes.get (elementName);
addNodeObject (node, new NodeObjectEnumerated (node,
@@ -590,12 +590,13 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat
enumeratedValues));
}
- protected void addObjectValue (String elementName, Class classType,
- Object defaultValue,
- Comparable minValue,
- Comparable maxValue,
- boolean minInclusive,
- boolean maxInclusive)
+ protected <T extends Object & Comparable<? super T>>
+ void addObjectValue (String elementName, Class<T> classType,
+ T defaultValue,
+ Comparable<? super T> minValue,
+ Comparable<? super T> maxValue,
+ boolean minInclusive,
+ boolean maxInclusive)
{
IIOMetadataNode node = (IIOMetadataNode) nodes.get (elementName);
addNodeObject (node, new NodeObjectBounded (node,
@@ -607,7 +608,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat
maxInclusive));
}
- protected void addObjectValue (String elementName, Class classType,
+ protected void addObjectValue (String elementName, Class<?> classType,
int arrayMinLength, int arrayMaxLength)
{
IIOMetadataNode node = (IIOMetadataNode) nodes.get (elementName);
@@ -836,7 +837,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat
return ((Integer) ((NodeObjectArray) getNodeObject (node)).getArrayMinLength ()).intValue();
}
- public Class getObjectClass (String elementName)
+ public Class<?> getObjectClass (String elementName)
{
IIOMetadataNode node = (IIOMetadataNode) nodes.get (elementName);
return getNodeObject (node).getClassType ();
@@ -854,13 +855,13 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat
return ((NodeObjectEnumerated) getNodeObject (node)).getEnumerations ();
}
- public Comparable getObjectMaxValue (String elementName)
+ public Comparable<?> getObjectMaxValue (String elementName)
{
IIOMetadataNode node = (IIOMetadataNode) nodes.get (elementName);
return ((NodeObjectBounded) getNodeObject (node)).getMaxValue ();
}
- public Comparable getObjectMinValue (String elementName)
+ public Comparable<?> getObjectMinValue (String elementName)
{
IIOMetadataNode node = (IIOMetadataNode) nodes.get (elementName);
return ((NodeObjectBounded) getNodeObject (node)).getMinValue ();
diff --git a/libjava/classpath/javax/imageio/spi/IIORegistry.java b/libjava/classpath/javax/imageio/spi/IIORegistry.java
index e762a96279f..fc3087f0cd6 100644
--- a/libjava/classpath/javax/imageio/spi/IIORegistry.java
+++ b/libjava/classpath/javax/imageio/spi/IIORegistry.java
@@ -39,7 +39,6 @@ exception statement from your version. */
package javax.imageio.spi;
import gnu.classpath.ServiceFactory;
-import gnu.java.awt.ClasspathToolkit;
import java.awt.Toolkit;
import java.util.HashMap;
@@ -92,8 +91,6 @@ public final class IIORegistry extends ServiceRegistry
registerServiceProvider(new BMPImageWriterSpi());
Toolkit toolkit = Toolkit.getDefaultToolkit();
- if (toolkit instanceof ClasspathToolkit)
- ((ClasspathToolkit)toolkit).registerImageIOSpis(this);
registerApplicationClasspathSpis();
}
diff --git a/libjava/classpath/javax/imageio/spi/IIOServiceProvider.java b/libjava/classpath/javax/imageio/spi/IIOServiceProvider.java
index 1ec59d5263e..48fa7d41489 100644
--- a/libjava/classpath/javax/imageio/spi/IIOServiceProvider.java
+++ b/libjava/classpath/javax/imageio/spi/IIOServiceProvider.java
@@ -110,7 +110,7 @@ public abstract class IIOServiceProvider
* @param category the service category for which this provider has
* been registered as an implementor.
*/
- public void onRegistration(ServiceRegistry registry, Class category)
+ public void onRegistration(ServiceRegistry registry, Class<?> category)
{
}
@@ -128,7 +128,7 @@ public abstract class IIOServiceProvider
* @param category the service category for which this provider has
* been registered as an implementor.
*/
- public void onDeregistration(ServiceRegistry registry, Class category)
+ public void onDeregistration(ServiceRegistry registry, Class<?> category)
{
}
diff --git a/libjava/classpath/javax/imageio/spi/ImageInputStreamSpi.java b/libjava/classpath/javax/imageio/spi/ImageInputStreamSpi.java
index 51c58395fc0..2b60868a54c 100644
--- a/libjava/classpath/javax/imageio/spi/ImageInputStreamSpi.java
+++ b/libjava/classpath/javax/imageio/spi/ImageInputStreamSpi.java
@@ -59,7 +59,7 @@ public abstract class ImageInputStreamSpi
* Indicates which kind of input is processable by the streams
* created by {@link #createInputStreamInstance(Object)}.
*/
- protected Class inputClass;
+ protected Class<?> inputClass;
/**
@@ -80,7 +80,7 @@ public abstract class ImageInputStreamSpi
* or <code>version</code> is <code>null</code>.
*/
public ImageInputStreamSpi(String vendorName, String version,
- Class inputClass)
+ Class<?> inputClass)
{
super(vendorName, version);
this.inputClass = inputClass;
@@ -91,7 +91,7 @@ public abstract class ImageInputStreamSpi
* Determines which kind of input is processable by the streams
* created by {@link #createInputStreamInstance(Object)}.
*/
- public Class getInputClass()
+ public Class<?> getInputClass()
{
return inputClass;
}
diff --git a/libjava/classpath/javax/imageio/spi/ImageOutputStreamSpi.java b/libjava/classpath/javax/imageio/spi/ImageOutputStreamSpi.java
index 0f1d3cdb2c1..872e7181e2b 100644
--- a/libjava/classpath/javax/imageio/spi/ImageOutputStreamSpi.java
+++ b/libjava/classpath/javax/imageio/spi/ImageOutputStreamSpi.java
@@ -59,7 +59,7 @@ public abstract class ImageOutputStreamSpi
* Indicates which kind of output is produced by the streams
* created by {@link #createOutputStreamInstance(Object)}.
*/
- protected Class outputClass;
+ protected Class<?> outputClass;
/**
@@ -80,7 +80,7 @@ public abstract class ImageOutputStreamSpi
* or <code>version</code> is <code>null</code>.
*/
public ImageOutputStreamSpi(String vendorName, String version,
- Class outputClass)
+ Class<?> outputClass)
{
super(vendorName, version);
this.outputClass = outputClass;
@@ -91,7 +91,7 @@ public abstract class ImageOutputStreamSpi
* Determines which kind of output is produced by the streams
* created by {@link #createOutputStreamInstance(Object)}.
*/
- public Class getOutputClass()
+ public Class<?> getOutputClass()
{
return outputClass;
}
diff --git a/libjava/classpath/javax/imageio/spi/RegisterableService.java b/libjava/classpath/javax/imageio/spi/RegisterableService.java
index ccf734e69ac..7be5a1beace 100644
--- a/libjava/classpath/javax/imageio/spi/RegisterableService.java
+++ b/libjava/classpath/javax/imageio/spi/RegisterableService.java
@@ -62,7 +62,7 @@ public interface RegisterableService
* @param category the service category for which this provider has
* been registered as an implementor.
*/
- void onRegistration(ServiceRegistry registry, Class category);
+ void onRegistration(ServiceRegistry registry, Class<?> category);
/**
@@ -78,6 +78,6 @@ public interface RegisterableService
* @param category the service category for which this provider has
* been registered as an implementor.
*/
- void onDeregistration(ServiceRegistry registry, Class category);
+ void onDeregistration(ServiceRegistry registry, Class<?> category);
}
diff --git a/libjava/classpath/javax/imageio/spi/ServiceRegistry.java b/libjava/classpath/javax/imageio/spi/ServiceRegistry.java
index 031b666046c..4848bc6dbab 100644
--- a/libjava/classpath/javax/imageio/spi/ServiceRegistry.java
+++ b/libjava/classpath/javax/imageio/spi/ServiceRegistry.java
@@ -121,7 +121,7 @@ public class ServiceRegistry
* @throws ClassCastException if <code>categories</code> does not
* iterate over instances of {@link java.lang.Class}.
*/
- public ServiceRegistry(Iterator categories)
+ public ServiceRegistry(Iterator<Class<?>> categories)
{
ArrayList cats = new ArrayList(/* expected size */ 10);
@@ -178,8 +178,8 @@ public class ServiceRegistry
* @throws IllegalArgumentException if <code>spi</code> is
* <code>null</code>.
*/
- public static Iterator lookupProviders(Class spi,
- ClassLoader loader)
+ public static <T> Iterator<T> lookupProviders(Class<T> spi,
+ ClassLoader loader)
{
return ServiceFactory.lookupProviders(spi, loader);
}
@@ -200,7 +200,7 @@ public class ServiceRegistry
*
* @see #lookupProviders(Class, ClassLoader)
*/
- public static Iterator lookupProviders(Class spi)
+ public static <T> Iterator<T> lookupProviders(Class<T> spi)
{
return ServiceFactory.lookupProviders(spi);
}
@@ -212,7 +212,7 @@ public class ServiceRegistry
* @return an unmodifiable {@link
* java.util.Iterator}&lt;{@link java.lang.Class}&gt;.
*/
- public Iterator getCategories()
+ public Iterator<Class<?>> getCategories()
{
return new Iterator()
{
@@ -317,8 +317,8 @@ public class ServiceRegistry
* @throws ClassCastException if <code>provider</code> does not
* implement <code>category</code>.
*/
- public synchronized boolean registerServiceProvider(Object provider,
- Class category)
+ public synchronized <T> boolean registerServiceProvider(T provider,
+ Class<T> category)
{
for (int i = 0; i < categories.length; i++)
if (categories[i] == category)
@@ -383,7 +383,7 @@ public class ServiceRegistry
* #ServiceRegistry(Iterator) constructor} of this
* <code>ServiceRegistry</code>.
*/
- public synchronized void registerServiceProviders(Iterator providers)
+ public synchronized void registerServiceProviders(Iterator<?> providers)
{
if (providers == null)
throw new IllegalArgumentException();
@@ -467,8 +467,8 @@ public class ServiceRegistry
* @throws ClassCastException if <code>provider</code> does not
* implement <code>category</code>.
*/
- public synchronized boolean deregisterServiceProvider(Object provider,
- Class category)
+ public synchronized <T> boolean deregisterServiceProvider(T provider,
+ Class<T> category)
{
for (int i = 0; i < categories.length; i++)
if (categories[i] == category)
@@ -535,7 +535,7 @@ public class ServiceRegistry
* #ServiceRegistry(Iterator) constructor} of this
* <code>ServiceRegistry</code>.
*/
- public synchronized void deregisterAll(Class category)
+ public synchronized void deregisterAll(Class<?> category)
{
boolean ok = false;
@@ -663,7 +663,8 @@ public class ServiceRegistry
*
* @see #getServiceProviders(Class, Filter, boolean)
*/
- public Iterator getServiceProviders(Class category, boolean useOrdering)
+ public <T> Iterator<T> getServiceProviders(Class<T> category,
+ boolean useOrdering)
{
return getServiceProviders(category, null, useOrdering);
}
@@ -691,9 +692,9 @@ public class ServiceRegistry
* #ServiceRegistry(Iterator) constructor} of this
* <code>ServiceRegistry</code>.
*/
- public synchronized Iterator getServiceProviders(Class category,
- Filter filter,
- boolean useOrdering)
+ public synchronized <T> Iterator<T> getServiceProviders(Class<T> category,
+ Filter filter,
+ boolean useOrdering)
{
int catid;
LinkedList provs;
@@ -751,7 +752,7 @@ public class ServiceRegistry
*
* @param providerClass a class to search for.
*/
- public synchronized Object getServiceProviderByClass(Class providerClass)
+ public synchronized <T> T getServiceProviderByClass(Class<T> providerClass)
{
if (providerClass == null)
throw new IllegalArgumentException();
@@ -772,7 +773,7 @@ public class ServiceRegistry
{
Object provider = iter.next();
if (providerClass.isInstance(provider))
- return provider;
+ return (T) provider;
}
}
@@ -799,9 +800,9 @@ public class ServiceRegistry
* @see #unsetOrdering
* @see #getServiceProviders(Class, Filter, boolean)
*/
- public synchronized boolean setOrdering(Class category,
- Object firstProvider,
- Object secondProvider)
+ public synchronized <T> boolean setOrdering(Class<T> category,
+ T firstProvider,
+ T secondProvider)
{
return addConstraint(getCategoryID(category), firstProvider,
secondProvider);
@@ -826,9 +827,9 @@ public class ServiceRegistry
*
* @see #setOrdering
*/
- public synchronized boolean unsetOrdering(Class category,
- Object firstProvider,
- Object secondProvider)
+ public synchronized <T> boolean unsetOrdering(Class<T> category,
+ T firstProvider,
+ T secondProvider)
{
return removeConstraint(getCategoryID(category),
firstProvider, secondProvider);
diff --git a/libjava/classpath/javax/management/BadAttributeValueExpException.java b/libjava/classpath/javax/management/BadAttributeValueExpException.java
new file mode 100644
index 00000000000..fbdf1decad2
--- /dev/null
+++ b/libjava/classpath/javax/management/BadAttributeValueExpException.java
@@ -0,0 +1,91 @@
+/* BadAttributeValueExpException.java -- Thrown by invalid query attributes.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+/**
+ * Thrown when the value of an a attribute passed to a query proves to
+ * be invalid. This exception is only used internally by the Java
+ * management API and is not exposed to user code.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class BadAttributeValueExpException
+ extends Exception
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = -3105272988410493376L;
+
+ /**
+ * The attribute value that caused the exception.
+ */
+ private Object val;
+
+ /**
+ * Constructs a new <code>BadAttributeValueExpException</code>
+ * using the specified object to represent the invalid value.
+ *
+ * @param val the inappropriate value.
+ */
+ public BadAttributeValueExpException(Object val)
+ {
+ super();
+ this.val = val;
+ }
+
+ /**
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.BadAttributeValueExpException</code>)
+ * and the invalid value.
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ public String toString()
+ {
+ return getClass().getName()
+ + "[val=" + val
+ + "]";
+ }
+
+}
+
diff --git a/libjava/classpath/javax/management/BadBinaryOpValueExpException.java b/libjava/classpath/javax/management/BadBinaryOpValueExpException.java
new file mode 100644
index 00000000000..5e1f5dbbed4
--- /dev/null
+++ b/libjava/classpath/javax/management/BadBinaryOpValueExpException.java
@@ -0,0 +1,102 @@
+/* BadBinaryOpValueExpException.java -- Thrown by invalid query expressions.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+/**
+ * Thrown when the expression passed to a method for constructing a
+ * query proves to be invalid. This exception is only used internally
+ * by the Java management API and is not exposed to user code.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class BadBinaryOpValueExpException
+ extends Exception
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = 5068475589449021227L;
+
+ /**
+ * The value expression that caused the exception.
+ */
+ private ValueExp exp;
+
+ /**
+ * Constructs a new <code>BadBinaryOpValueExpException</code>
+ * using the specified expression to represent the invalid one.
+ *
+ * @param exp the inappropriate value expression.
+ */
+ public BadBinaryOpValueExpException(ValueExp exp)
+ {
+ super();
+ this.exp = exp;
+ }
+
+ /**
+ * Returns the inappropriate value expression associated
+ * with this exception.
+ *
+ * @return the value expression.
+ */
+ public ValueExp getExp()
+ {
+ return exp;
+ }
+
+ /**
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.BadBinaryOpValueExpException</code>)
+ * and the invalid value expression.
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ public String toString()
+ {
+ return getClass().getName()
+ + "[exp=" + exp
+ + "]";
+ }
+
+}
+
diff --git a/libjava/classpath/javax/management/BadStringOperationException.java b/libjava/classpath/javax/management/BadStringOperationException.java
new file mode 100644
index 00000000000..8e5949ef791
--- /dev/null
+++ b/libjava/classpath/javax/management/BadStringOperationException.java
@@ -0,0 +1,92 @@
+/* BadStringOperationException.java -- Thrown by invalid query attributes.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+/**
+ * Thrown when a string-based operation passed to a query proves to
+ * be invalid. This exception is only used internally by the Java
+ * management API and is not exposed to user code.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class BadStringOperationException
+ extends Exception
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = 7802201238441662100L;
+
+ /**
+ * The operation that caused the exception.
+ */
+ private String op;
+
+ /**
+ * Constructs a new <code>BadStringOperationException</code>
+ * using the specified object to represent the invalid string
+ * operation.
+ *
+ * @param op the inappropriate string operation.
+ */
+ public BadStringOperationException(String op)
+ {
+ super();
+ this.op = op;
+ }
+
+ /**
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.BadStringOperationException</code>)
+ * and the invalid string operation.
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ public String toString()
+ {
+ return getClass().getName()
+ + "[op=" + op
+ + "]";
+ }
+
+}
+
diff --git a/libjava/classpath/javax/management/InstanceAlreadyExistsException.java b/libjava/classpath/javax/management/InstanceAlreadyExistsException.java
new file mode 100644
index 00000000000..c783208cb49
--- /dev/null
+++ b/libjava/classpath/javax/management/InstanceAlreadyExistsException.java
@@ -0,0 +1,76 @@
+/* InstanceAlreadyExistsException.java -- Thrown by invalid values.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+/**
+ * Thrown when an attempt to register a bean is made, and
+ * the bean is already registered.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class InstanceAlreadyExistsException
+ extends OperationsException
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = 8893743928912733931L;
+
+ /**
+ * Constructs a new <code>InstanceAlreadyExistsException</code>.
+ */
+ public InstanceAlreadyExistsException()
+ {
+ super();
+ }
+
+ /**
+ * Constructs a new <code>InstanceAlreadyExistsException</code>
+ * with the specified message.
+ *
+ * @param message the error message to give to the user.
+ */
+ public InstanceAlreadyExistsException(String message)
+ {
+ super(message);
+ }
+
+}
+
diff --git a/libjava/classpath/javax/management/InstanceNotFoundException.java b/libjava/classpath/javax/management/InstanceNotFoundException.java
new file mode 100644
index 00000000000..4d209fc471f
--- /dev/null
+++ b/libjava/classpath/javax/management/InstanceNotFoundException.java
@@ -0,0 +1,76 @@
+/* InstanceNotFoundException.java -- Thrown by invalid values.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+/**
+ * Thrown when an attempt to locate a bean is made, and
+ * the bean does not exist in the repository.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class InstanceNotFoundException
+ extends OperationsException
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = -882579438394773049L;
+
+ /**
+ * Constructs a new <code>InstanceNotFoundException</code>.
+ */
+ public InstanceNotFoundException()
+ {
+ super();
+ }
+
+ /**
+ * Constructs a new <code>InstanceNotFoundException</code>
+ * with the specified message.
+ *
+ * @param message the error message to give to the user.
+ */
+ public InstanceNotFoundException(String message)
+ {
+ super(message);
+ }
+
+}
+
diff --git a/libjava/classpath/javax/management/InvalidApplicationException.java b/libjava/classpath/javax/management/InvalidApplicationException.java
new file mode 100644
index 00000000000..0bcf2d6cb0c
--- /dev/null
+++ b/libjava/classpath/javax/management/InvalidApplicationException.java
@@ -0,0 +1,92 @@
+/* InvalidApplicationException.java -- Thrown by invalid query attributes.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+/**
+ * Thrown when a query or attribute is applied to a management bean
+ * which is of the wrong class. This exception is only used
+ * internally by the Java management API and is not exposed to user
+ * code.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class InvalidApplicationException
+ extends Exception
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = -3048022274675537269L;
+
+ /**
+ * The attribute value that caused the exception.
+ */
+ private Object val;
+
+ /**
+ * Constructs a new <code>InvalidApplicationException</code>
+ * using the specified object to represent the invalid value.
+ *
+ * @param val the inappropriate expression.
+ */
+ public InvalidApplicationException(Object val)
+ {
+ super();
+ this.val = val;
+ }
+
+ /**
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.InvalidApplicationException</code>)
+ * and the invalid expression.
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ public String toString()
+ {
+ return getClass().getName()
+ + "[val=" + val
+ + "]";
+ }
+
+}
+
diff --git a/libjava/classpath/javax/management/MBeanAttributeInfo.java b/libjava/classpath/javax/management/MBeanAttributeInfo.java
index bded7e41a07..2d7c100b560 100644
--- a/libjava/classpath/javax/management/MBeanAttributeInfo.java
+++ b/libjava/classpath/javax/management/MBeanAttributeInfo.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.management;
import java.lang.reflect.Method;
+import java.lang.reflect.Type;
/**
* Describes the attributes of a management bean.
@@ -109,13 +110,21 @@ public class MBeanAttributeInfo
"not be null.");
if (getter == null)
{
- attributeType = setter.getParameterTypes()[0].getName();
+ Type t = setter.getGenericParameterTypes()[0];
+ if (t instanceof Class)
+ attributeType = ((Class) t).getName();
+ else
+ attributeType = t.toString();
isRead = false;
is = false;
}
else
{
- attributeType = getter.getReturnType().getName();
+ Type t = getter.getGenericReturnType();
+ if (t instanceof Class)
+ attributeType = ((Class) t).getName();
+ else
+ attributeType = t.toString();
isRead = true;
is = getter.getName().startsWith("is");
}
diff --git a/libjava/classpath/javax/management/MBeanConstructorInfo.java b/libjava/classpath/javax/management/MBeanConstructorInfo.java
index 832a3296d6b..15c8227c246 100644
--- a/libjava/classpath/javax/management/MBeanConstructorInfo.java
+++ b/libjava/classpath/javax/management/MBeanConstructorInfo.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.management;
import java.lang.reflect.Constructor;
+import java.lang.reflect.Type;
import java.util.Arrays;
@@ -77,22 +78,29 @@ public class MBeanConstructorInfo
public MBeanConstructorInfo(String desc, Constructor cons)
{
super(cons.getName(), desc);
- Class[] paramTypes = cons.getParameterTypes();
+ Type[] paramTypes = cons.getGenericParameterTypes();
signature = new MBeanParameterInfo[paramTypes.length];
for (int a = 0; a < paramTypes.length; ++a)
- signature[a] = new MBeanParameterInfo(null,
- paramTypes[a].getName(),
- null);
+ {
+ Type t = paramTypes[a];
+ if (t instanceof Class)
+ signature[a] = new MBeanParameterInfo(null,
+ ((Class) t).getName(),
+ null);
+ else
+ signature[a] = new MBeanParameterInfo(null, t.toString(), null);
+ }
}
/**
* Constructs a @link{MBeanConstructorInfo} with the specified
* name, description and parameter information. A <code>null</code>
* value for the parameter information is the same as passing in
- * an empty array.
+ * an empty array. A copy of the parameter array is taken, so
+ * later changes have no effect.
*
* @param name the name of the constructor.
- * @param desc a description of the attribute.
+ * @param desc a description of the constructor.
* @param sig the signature of the constructor, as a series
* of {@link MBeanParameterInfo} objects, one for
* each parameter.
@@ -104,7 +112,10 @@ public class MBeanConstructorInfo
if (sig == null)
signature = new MBeanParameterInfo[0];
else
- signature = sig;
+ {
+ signature = new MBeanParameterInfo[sig.length];
+ System.arraycopy(sig, 0, signature, 0, sig.length);
+ }
}
/**
diff --git a/libjava/classpath/javax/management/MBeanFeatureInfo.java b/libjava/classpath/javax/management/MBeanFeatureInfo.java
index 4f0243e1894..74a03038740 100644
--- a/libjava/classpath/javax/management/MBeanFeatureInfo.java
+++ b/libjava/classpath/javax/management/MBeanFeatureInfo.java
@@ -79,7 +79,7 @@ public class MBeanFeatureInfo
/**
* The <code>toString()</code> result of this instance.
*/
- protected transient String string;
+ transient String string;
/**
* Constructs a new {@link MBeanFeatureInfo} with the specified
diff --git a/libjava/classpath/javax/management/MBeanInfo.java b/libjava/classpath/javax/management/MBeanInfo.java
index e6f03f0656e..d30de0499aa 100644
--- a/libjava/classpath/javax/management/MBeanInfo.java
+++ b/libjava/classpath/javax/management/MBeanInfo.java
@@ -140,7 +140,8 @@ public class MBeanInfo
* can be loaded by the MBean server or class loader; it merely
* has to be a syntactically correct class name. Any of the
* arrays may be <code>null</code>; this will be treated as if
- * an empty array was supplied.
+ * an empty array was supplied. A copy of the arrays is
+ * taken, so later changes have no effect.
*
* @param name the name of the class this instance describes.
* @param desc a description of the bean.
@@ -162,19 +163,31 @@ public class MBeanInfo
if (attribs == null)
attributes = new MBeanAttributeInfo[0];
else
- attributes = attribs;
+ {
+ attributes = new MBeanAttributeInfo[attribs.length];
+ System.arraycopy(attribs, 0, attributes, 0, attribs.length);
+ }
if (cons == null)
constructors = new MBeanConstructorInfo[0];
else
- constructors = cons;
+ {
+ constructors = new MBeanConstructorInfo[cons.length];
+ System.arraycopy(cons, 0, constructors, 0, cons.length);
+ }
if (ops == null)
operations = new MBeanOperationInfo[0];
else
- operations = ops;
+ {
+ operations = new MBeanOperationInfo[ops.length];
+ System.arraycopy(ops, 0, operations, 0, ops.length);
+ }
if (notifs == null)
notifications = new MBeanNotificationInfo[0];
else
- notifications = notifs;
+ {
+ notifications = new MBeanNotificationInfo[notifs.length];
+ System.arraycopy(notifs, 0, notifications, 0, notifs.length);
+ }
}
/**
diff --git a/libjava/classpath/javax/management/MBeanOperationInfo.java b/libjava/classpath/javax/management/MBeanOperationInfo.java
index a2db8d1b064..6495072e627 100644
--- a/libjava/classpath/javax/management/MBeanOperationInfo.java
+++ b/libjava/classpath/javax/management/MBeanOperationInfo.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.management;
import java.lang.reflect.Method;
+import java.lang.reflect.Type;
import java.util.Arrays;
@@ -113,13 +114,23 @@ public class MBeanOperationInfo
public MBeanOperationInfo(String desc, Method method)
{
super(method.getName(), desc);
- Class[] paramTypes = method.getParameterTypes();
+ Type[] paramTypes = method.getGenericParameterTypes();
signature = new MBeanParameterInfo[paramTypes.length];
for (int a = 0; a < paramTypes.length; ++a)
- signature[a] = new MBeanParameterInfo(null,
- paramTypes[a].getName(),
- null);
- type = method.getReturnType().getName();
+ {
+ Type t = paramTypes[a];
+ if (t instanceof Class)
+ signature[a] = new MBeanParameterInfo(null,
+ ((Class) t).getName(),
+ null);
+ else
+ signature[a] = new MBeanParameterInfo(null, t.toString(), null);
+ }
+ Type retType = method.getGenericReturnType();
+ if (retType instanceof Class)
+ type = ((Class) retType).getName();
+ else
+ type = retType.toString();
if (method.getReturnType() == Void.TYPE)
{
if (paramTypes.length == 0)
@@ -140,7 +151,8 @@ public class MBeanOperationInfo
* Constructs a @link{MBeanOperationInfo} with the specified name,
* description, parameter information, return type and impact. A
* <code>null</code> value for the parameter information is the same
- * as passing in an empty array.
+ * as passing in an empty array. A copy of the parameter array is
+ * taken, so later changes have no effect.
*
* @param name the name of the constructor.
* @param desc a description of the attribute.
@@ -158,7 +170,10 @@ public class MBeanOperationInfo
if (sig == null)
signature = new MBeanParameterInfo[0];
else
- signature = sig;
+ {
+ signature = new MBeanParameterInfo[sig.length];
+ System.arraycopy(sig, 0, signature, 0, sig.length);
+ }
this.type = type;
this.impact = impact;
}
diff --git a/libjava/classpath/javax/management/MBeanPermission.java b/libjava/classpath/javax/management/MBeanPermission.java
new file mode 100644
index 00000000000..2c8dfbd622d
--- /dev/null
+++ b/libjava/classpath/javax/management/MBeanPermission.java
@@ -0,0 +1,562 @@
+/* MBeanPermission.java -- Permissions controlling server access.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+import java.security.Permission;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.TreeSet;
+
+/**
+ * <p>
+ * Represents the permissions required to perform
+ * operations using the {@link MBeanServer}. As with
+ * all {@link java.security.Permission} objects, an
+ * instance of this class either represents a permission
+ * already held or one that is required to access a
+ * particular service. In the case of {@link MBeanPermission}s,
+ * implication checks are made using an instance of this class
+ * when a user requests an operation from the server, and a
+ * {@link SecurityManager} is in place.
+ * </p>
+ * <p>
+ * An {@link MBeanPermission} consists of four elements,
+ * which all have to match for the permission to be implied.
+ * These are as follows:
+ * </p>
+ * <ol>
+ * <li><strong>The action</strong>. For a required permission,
+ * this is a single value. For a permission held by the user,
+ * this is a list of comma-separated actions (with spaces allowed),
+ * or <code>*</code> (representing all actions). {@link #getActions()}
+ * returns this value.</li>
+ * <li><strong>The class name</strong>. For a required permission,
+ * this is the class name of the bean being accessed, if any. If
+ * a bean isn't involved in this action, the value is <code>null</code>.
+ * For a permission held by the user, it has one of three values:
+ * <ol>
+ * <li>The empty string, implying any class.</li>
+ * <li><code>*</code>, also implying any class.</li>
+ * <li>A class name pattern, which may specify a single class
+ * (e.g. <code>java.lang.Object</code>) or a series of classes
+ * using the wildcard character <code>*</code> (e.g.
+ * <code>javax.swing.*</code>.)</li>
+ * </ol></li>
+ * <li><strong>The member</strong>. For a required permission,
+ * this is the member of the bean being accessed (an attribute
+ * or operation), if any. If a member of the bean isn't involved
+ * in this action, the value is <code>null</code>.
+ * For a permission held by the user, it has one of three values:
+ * <ol>
+ * <li>The empty string, implying any member.</li>
+ * <li><code>*</code>, also implying any member.</li>
+ * <li>The name of a member.</li>
+ * </ol></li>
+ * <li>The object name</strong>. For a required permission,
+ * this is the {@link ObjectName} of the bean being accessed, if
+ * any. If a bean isn't involved in this action, the value is
+ * <code>null</code>. The name may not be a pattern.
+ * For a permission held by the user, it may be the empty
+ * string (allowing everything) or an {@link ObjectName}
+ * pattern.
+ * </li></ol>
+ * {@link #getName()} returns the latter three of these as a
+ * single string:
+ * </p>
+ * <p><code>className#member[objectName]</code></p>
+ * <p>
+ * where <code>""</code> is disallowed, as, although any of
+ * the elements may be omitted, not all of them should be
+ * left out simultaneously. <code>"-"</code> is used to
+ * represent <code>null</code>. When this occurs in a
+ * required permission, anything may match it. When this
+ * forms part of a permission held by the user, it only
+ * matches another <code>null</code> value.
+ * </p>
+ * <p>The list of valid actions is as follows:</p>
+ * <ul>
+ * <li>addNotificationListener</li>
+ * <li>getAttribute</li>
+ * <li>getClassLoader</li>
+ * <li>getClassLoaderFor</li>
+ * <li>getClassLoaderRepository</li>
+ * <li>getDomains</li>
+ * <li>getMBeanInfo</li>
+ * <li>getObjectInstance</li>
+ * <li>instantiate</li>
+ * <li>invoke</li>
+ * <li>isInstanceOf</li>
+ * <li>queryMBeans</li>
+ * <li>queryNames</li>
+ * <li>registerMBean</li>
+ * <li>removeNotificationListener</li>
+ * <li>setAttribute</li>
+ * <li>unregisterMBean</li>
+ * </ul>
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class MBeanPermission
+ extends Permission
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = -2416928705275160661L;
+
+ /**
+ * The list of actions associated with this permission.
+ */
+ private String actions;
+
+ /**
+ * The list of actions as an ordered set.
+ */
+ private transient Set actionSet;
+
+ /**
+ * The set of valid actions.
+ */
+ private static final Set validSet;
+
+ /**
+ * Initialise the set of valid actions.
+ */
+ static
+ {
+ validSet = new HashSet();
+ validSet.add("addNotificationListener");
+ validSet.add("getAttribute");
+ validSet.add("getClassLoader");
+ validSet.add("getClassLoaderFor");
+ validSet.add("getClassLoaderRepository");
+ validSet.add("getDomains");
+ validSet.add("getMBeanInfo");
+ validSet.add("getObjectInstance");
+ validSet.add("instantiate");
+ validSet.add("invoke");
+ validSet.add("isInstanceOf");
+ validSet.add("queryMBeans");
+ validSet.add("queryNames");
+ validSet.add("registerMBean");
+ validSet.add("removeNotificationListener");
+ validSet.add("setAttribute");
+ validSet.add("unregisterMBean");
+ }
+
+ /**
+ * Constructs a new {@link MBeanPermission} with the specified name
+ * and actions. The name is of the form <code>className#member[objectName]</code>,
+ * where each element is optional, but a completely empty or <code>null</code>
+ * name is disallowed. Actions are specified as a comma-separated list
+ * and may also not be empty or <code>null</code>.
+ *
+ * @param name the name of the permission.
+ * @param actions the actions associated with this permission.
+ * @throws IllegalArgumentException if the name or actions are invalid.
+ */
+ public MBeanPermission(String name, String actions)
+ {
+ super(name);
+ if (name == null || name.length() == 0)
+ throw new IllegalArgumentException("The supplied name was null or empty.");
+ if (actions == null || actions.length() == 0)
+ throw new IllegalArgumentException("The supplied action list was null or empty.");
+ this.actions = actions;
+ updateActionSet();
+ }
+
+ /**
+ * Constructs a new {@link MBeanPermission} with the specified class name,
+ * member, object name and actions. The name of the permission is created
+ * using the form <code>className#member[objectName]</code>,
+ * where each element is optional, but an empty or <code>null</code>
+ * name is disallowed. Actions are specified as a comma-separated list
+ * and may also not be empty or <code>null</code>.
+ *
+ * @param className the name of the class to which this permission applies,
+ * or either <code>null</code> or <code>"-"</code> for a
+ * value which may be implied by any class name, but not
+ * imply any class name itself.
+ * @param member the member of the class to which this permission applies,
+ * or either <code>null</code> or <code>"-"</code> for a
+ * value which may be implied by any member, but not
+ * imply any member itself.
+ * @param objectName the {@link ObjectName} to which this permission applies,
+ * or <code>null</code> for a value which may be implied by
+ * any object name, but not imply any object name itself.
+ * @param actions the actions associated with this permission.
+ */
+ public MBeanPermission(String className, String member,
+ ObjectName name, String actions)
+ {
+ this((className == null ? "-" : className) + "#"
+ + (member == null ? "-" : member) + "["
+ + (name == null ? "-" : name.toString()) + "]", actions);
+ }
+
+ /**
+ * Returns true if the given object is also an {@link MBeanPermission}
+ * with the same name and actions.
+ *
+ * @param obj the object to test.
+ * @return true if the object is an {@link MBeanPermission} with
+ * the same name and actions.
+ */
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof MBeanPermission)
+ {
+ MBeanPermission p = (MBeanPermission) obj;
+ return (p.getName().equals(getName()) &&
+ p.getActions().equals(actions));
+ }
+ return false;
+ }
+
+ /**
+ * Returns the list of actions in alphabetical order.
+ *
+ * @return the list of actions.
+ */
+ public String getActions()
+ {
+ Iterator it = actionSet.iterator();
+ StringBuilder builder = new StringBuilder();
+ while (it.hasNext())
+ {
+ builder.append(it.next());
+ if (it.hasNext())
+ builder.append(",");
+ }
+ return builder.toString();
+ }
+
+ /**
+ * Returns the hashcode of the permission as the sum
+ * of the hashcodes of the name and actions.
+ *
+ * @return the hashcode of the permission.
+ */
+ public int hashCode()
+ {
+ return getName().hashCode() + actions.hashCode();
+ }
+
+ /**
+ * <p>
+ * Returns true if this permission implies the supplied permission.
+ * This happens if the following holds:
+ * </p>
+ * <ul>
+ * <li>The supplied permission is an {@link MBeanPermission}</li>
+ * <li>The supplied permission has either a <code>null</code> classname
+ * or its classname matches the classname of this permission. A
+ * classname of <code>"*"</code> for this permission always matches
+ * the classname of the supplied permission. Generally, <code>'*'</code>
+ * acts as a wildcard, so <code>".*"</code> matches <code>'.'</code>
+ * followed by anything.</li>
+ * <li>The supplied permission has either a <code>null</code> member
+ * or its member matches the member of this permission. A member of
+ * <code>"*"</code> for this permission always matches the member
+ * of the supplied permission.</li>
+ * <li>The supplied permission has either a <code>null</code> object name
+ * or its object name matches the object name of this permission. If the
+ * object name of this permission is a pattern, {@link ObjectName#apply(ObjectName)}
+ * may be used as well.</li>
+ * <li>The supplied permission's actions are a subset of the actions
+ * of this permission. If the <code>queryMBeans</code> action is presented,
+ * the <code>queryNames</code> action is implied.</li>
+ * </ul>
+ *
+ * @param p the permission to check that this permission implies.
+ * @return true if this permission implies <code>p</code>.
+ */
+ public boolean implies(Permission p)
+ {
+ if (p instanceof MBeanPermission)
+ {
+ MBeanPermission mp = (MBeanPermission) p;
+ NameHolder pName = new NameHolder(mp.getName());
+ NameHolder name = new NameHolder(getName());
+ if (!(name.equals(pName)))
+ return false;
+ Iterator i = mp.getActionSet().iterator();
+ while (i.hasNext())
+ {
+ String nextAction = (String) i.next();
+ boolean found = actions.contains(nextAction);
+ if (!found)
+ if (nextAction.equals("queryNames"))
+ found = actions.contains("queryMBeans");
+ if (!found)
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Small helper class to handle deconstruction of the name.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ */
+ private class NameHolder
+ {
+
+ /**
+ * The class name.
+ */
+ private String className;
+
+ /**
+ * The member.
+ */
+ private String member;
+
+ /**
+ * The object name.
+ */
+ private ObjectName objectName;
+
+ /**
+ * Constructs a broken-down name from a given name.
+ *
+ * @param name the name to break down.
+ */
+ public NameHolder(String name)
+ {
+ String objectName = null;
+ int memberIndex = name.indexOf("#");
+ int onIndex = name.indexOf("[");
+ if (onIndex == -1)
+ {
+ if (memberIndex == -1)
+ className = name;
+ else
+ {
+ className = name.substring(0, memberIndex);
+ member = name.substring(memberIndex + 1);
+ }
+ }
+ else
+ {
+ if (memberIndex == -1)
+ {
+ className = name.substring(0, onIndex);
+ objectName = name.substring(onIndex + 1,
+ name.length() - 1);
+ }
+ else
+ {
+ className = name.substring(0, memberIndex);
+ member = name.substring(memberIndex + 1, onIndex);
+ objectName = name.substring(onIndex + 1,
+ name.length() - 1);
+ }
+ }
+ if (className.equals("-"))
+ className = null;
+ if (member.equals("-"))
+ member = null;
+ if (objectName == null || objectName.equals("-"))
+ this.objectName = null;
+ else
+ try
+ {
+ this.objectName = new ObjectName(objectName);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw (Error)
+ (new InternalError("Invalid object name.").initCause(e));
+ }
+ }
+
+ /**
+ * <p>
+ * Returns true if the supplied object is also a
+ * {@link NameHolder} and the following holds:
+ * </p>
+ * <ul>
+ * <li>The supplied classname is <code>null</code> or the two match. A
+ * classname of <code>"*"</code> for this holder always matches
+ * the classname of the supplied holder. Generally, <code>'*'</code>
+ * acts as a wildcard, so <code>".*"</code> matches <code>'.'</code>
+ * followed by anything.</li>
+ * <li>The supplied name holder has either a <code>null</code> member
+ * or its member matches the member of this name holder. A member of
+ * <code>"*"</code> for this name holder always matches the member
+ * of the supplied name holder.</li>
+ * <li>The supplied name holder has either a <code>null</code> object name
+ * or its object name matches the object name of this name holder. If the
+ * object name of this name holder is a pattern,
+ * {@link ObjectName#apply(ObjectName)} may be used as well.</li>
+ * </ul>
+ *
+ * @param obj the object to compare with this.
+ * @return true if the above holds.
+ */
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof NameHolder)
+ {
+ NameHolder nh = (NameHolder) obj;
+ boolean cn = false;
+ String ocn = nh.getClassName();
+ if (ocn == null || className.equals("*"))
+ cn = true;
+ else
+ {
+ int wcIndex = className.indexOf("*");
+ if (wcIndex != -1)
+ cn = ocn.startsWith(className.substring(0, wcIndex));
+ else
+ cn = ocn.equals(className);
+ }
+ boolean m = false;
+ String om = nh.getMember();
+ if (om == null || member.equals("*"))
+ m = true;
+ else
+ m = om.equals(member);
+ boolean on = false;
+ ObjectName oon = nh.getObjectName();
+ if (oon == null)
+ on = true;
+ else if (objectName.isPattern())
+ on = objectName.apply(oon);
+ else
+ on = oon.equals(objectName);
+ return (cn && m && on);
+ }
+ return false;
+ }
+
+ /**
+ * Returns the class name.
+ */
+ public String getClassName()
+ {
+ return className;
+ }
+
+ /**
+ * Returns the member.
+ */
+ public String getMember()
+ {
+ return member;
+ }
+
+ /**
+ * Returns the object name.
+ */
+ public ObjectName getObjectName()
+ {
+ return objectName;
+ }
+ }
+
+ /**
+ * Returns the set of actions.
+ *
+ * @return the actions as an ordered set.
+ */
+ Set getActionSet()
+ {
+ return actionSet;
+ }
+
+ /**
+ * Updates the action set from the current value of
+ * the actions string.
+ */
+ private void updateActionSet()
+ {
+ String[] actionsArray = actions.split(",");
+ actionSet = new TreeSet();
+ for (int a = 0; a < actionsArray.length; ++a)
+ actionSet.add(actionsArray[a].trim());
+ }
+
+ /**
+ * Reads the object from a stream and ensures the incoming
+ * data is valid.
+ *
+ * @param in the input stream.
+ * @throws IOException if an I/O error occurs.
+ * @throws ClassNotFoundException if a class used by the object
+ * can not be found.
+ */
+ private void readObject(ObjectInputStream in)
+ throws IOException, ClassNotFoundException
+ {
+ in.defaultReadObject();
+ updateActionSet();
+ checkActions();
+ }
+
+ /**
+ * Checks that the actions used in this permission
+ * are from the valid set.
+ *
+ * @throws IllegalArgumentException if the name or actions are invalid.
+ */
+ private void checkActions()
+ {
+ Iterator it = actionSet.iterator();
+ while (it.hasNext())
+ {
+ String action = (String) it.next();
+ if (!(validSet.contains(action)))
+ throw new IllegalArgumentException("Invalid action "
+ + action + " found.");
+ }
+ }
+
+}
+
diff --git a/libjava/classpath/javax/management/MBeanRegistration.java b/libjava/classpath/javax/management/MBeanRegistration.java
new file mode 100644
index 00000000000..5a181ca4921
--- /dev/null
+++ b/libjava/classpath/javax/management/MBeanRegistration.java
@@ -0,0 +1,95 @@
+/* MBeanRegistration.java -- Interface for beans to hook into registration.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+/**
+ * Beans may implement this interface in order to perform
+ * operations immediately prior to or after their registration
+ * or deregistration.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public interface MBeanRegistration
+{
+
+ /**
+ * This method is called following deregistration of the bean
+ * by the server.
+ */
+ void postDeregister();
+
+ /**
+ * This method is called following both successful and unsuccessful
+ * attempts to register the bean. The supplied boolean value indicates
+ * the result of the attempt relative to this call.
+ *
+ * @param successful true if the registration was successful.
+ */
+ void postRegister(Boolean successful);
+
+ /**
+ * This method is called prior to de-registration, and may throw
+ * an exception.
+ *
+ * @throws Exception if something goes wrong during the bean's pre-deregistration
+ * operation. The server will re-throw this exception
+ * as an {@link MBeanRegistrationException}.
+ */
+ void preDeregister()
+ throws Exception;
+
+ /**
+ * This method is called prior to registration, with a reference to the
+ * server and {@link ObjectName} supplied to the server for registration.
+ * This method may be used to replace this name by one chosen by the bean.
+ * Such behaviour is expected if the supplied name is <code>null</code>,
+ * but may occur in all cases. The method may throw an exception, which
+ * will cause registration to be aborted.
+ *
+ * @param server the server with which the bean is being registered.
+ * @param name the name the server was supplied with for registration,
+ * which may be <code>null</code>.
+ * @throws Exception if something goes wrong during the bean's pre-registration
+ * operation. The server will re-throw this exception
+ * as an {@link MBeanRegistrationException}.
+ */
+ ObjectName preRegister(MBeanServer server, ObjectName name)
+ throws Exception;
+
+}
diff --git a/libjava/classpath/javax/management/MBeanRegistrationException.java b/libjava/classpath/javax/management/MBeanRegistrationException.java
new file mode 100644
index 00000000000..9f62b9aa04f
--- /dev/null
+++ b/libjava/classpath/javax/management/MBeanRegistrationException.java
@@ -0,0 +1,84 @@
+/* MBeanRegistrationException.java -- A bean registration exception.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+/**
+ * Represents an arbitrary exception thrown during registration of a
+ * management bean. When registering a bean causes an exception to be
+ * thrown, the resulting exception is wrapped inside an {@link
+ * MBeanRegistrationException}. Calling {@link getTargetException()}
+ * will return the wrapped exception.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class MBeanRegistrationException
+ extends MBeanException
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = 4482382455277067805L;
+
+ /**
+ * Constructs a new <code>MBeanRegistrationException</code> wrapping
+ * the specified exception.
+ *
+ * @param e the exception to be wrapped.
+ */
+ public MBeanRegistrationException(Exception e)
+ {
+ super(e);
+ }
+
+ /**
+ * Constructs a new <code>MBeanRegistrationException</code> wrapping
+ * the specified exception and using the supplied message.
+ *
+ * @param e the exception to be wrapped.
+ * @param message the error message to give to the user.
+ */
+ public MBeanRegistrationException(Exception e, String message)
+ {
+ super(e, message);
+ }
+
+
+}
+
diff --git a/libjava/classpath/javax/management/MBeanServer.java b/libjava/classpath/javax/management/MBeanServer.java
new file mode 100644
index 00000000000..73a28e3b85a
--- /dev/null
+++ b/libjava/classpath/javax/management/MBeanServer.java
@@ -0,0 +1,1199 @@
+/* MBeanServer.java -- Represents a management server.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+import java.io.ObjectInputStream;
+
+import java.util.Set;
+
+import javax.management.loading.ClassLoaderRepository;
+
+/**
+ * <p>
+ * This interface represents a server for management beans,
+ * providing facilities for the creation, registration and
+ * removal of such beans. This interface is central to the
+ * Java management architecture. Users do not usually implement
+ * this class. Instead, implementations of this class
+ * may be obtained using an {@link MBeanServerFactory}.
+ * </p>
+ * <p>
+ * Registering a bean with the server makes its attributes and
+ * operations accessible via the server. Only JMX compliant
+ * beans may be registered with the server. When a bean
+ * is registered or unregistered, an {@link MBeanServerNotification}
+ * is emitted by the server's {@link MBeanServerDelegate}.
+ * Listeners may be registered with this bean in order to
+ * obtain such notifications. It has the {@link ObjectName}
+ * <code>JMImplementation:type=MBeanServerDelegate</code>.
+ * </p>
+ * <p>
+ * Security checks are applied on the methods of the server,
+ * as detailed below, if it is obtained using the
+ * {@link MBeanServerFactory#createMBeanServer()} or
+ * {@link MBeanServerFactory#newMBeanServer()} methods and
+ * {@link System.getSecurityManager()} returns a non-<code>null</code>
+ * value. If a check fails, a {@link SecurityException}
+ * is thrown. Note than the class name used in the exception
+ * is that of the bean, and thus, as a result, an
+ * {@link InstanceNotFoundException}
+ * precludes these security checks, due to the class name
+ * that would be used in the exception being unavailable.
+ * </p>
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public interface MBeanServer
+ extends MBeanServerConnection
+{
+
+ /**
+ * Registers the supplied listener with the specified management
+ * bean. Notifications emitted by the management bean are forwarded
+ * to the listener via the server, which will convert any MBean
+ * references in the source to portable {@link ObjectName}
+ * instances. The notification is otherwise unchanged.
+ *
+ * @param name the name of the management bean with which the listener
+ * should be registered.
+ * @param listener the listener which will handle notifications from
+ * the bean.
+ * @param filter the filter to apply to incoming notifications, or
+ * <code>null</code> if no filtering should be applied.
+ * @param passback an object to be passed to the listener when a
+ * notification is emitted.
+ * @throws InstanceNotFoundException if the name of the management bean
+ * could not be resolved.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "addNotificationListener")</code>}.
+ * @see #removeNotificationListener(ObjectName, NotificationListener)
+ * @see #removeNotificationListener(ObjectName, NotificationListener,
+ * NotificationFilter, Object)
+ * @see NotificationBroadcaster#addNotificationListener(NotificationListener,
+ * NotificationFilter,
+ * Object)
+ */
+ void addNotificationListener(ObjectName name, NotificationListener listener,
+ NotificationFilter filter, Object passback)
+ throws InstanceNotFoundException;
+
+ /**
+ * <p>
+ * Registers the supplied listener with the specified management
+ * bean. Notifications emitted by the management bean are forwarded
+ * to the listener via the server, which will convert any MBean
+ * references in the source to portable {@link ObjectName}
+ * instances. The notification is otherwise unchanged.
+ * </p>
+ * <p>
+ * The listener that receives notifications will be the one that is
+ * registered with the given name at the time this method is called.
+ * Even if it later unregisters and ceases to use that name, it will
+ * still receive notifications.
+ * </p>
+ *
+ * @param name the name of the management bean with which the listener
+ * should be registered.
+ * @param listener the name of the listener which will handle
+ * notifications from the bean.
+ * @param filter the filter to apply to incoming notifications, or
+ * <code>null</code> if no filtering should be applied.
+ * @param passback an object to be passed to the listener when a
+ * notification is emitted.
+ * @throws InstanceNotFoundException if the name of the management bean
+ * could not be resolved.
+ * @throws RuntimeOperationsException if the bean associated with the given
+ * object name is not a
+ * {@link NotificationListener}. This
+ * exception wraps an
+ * {@link IllegalArgumentException}.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "addNotificationListener")</code>}.
+ * @see #removeNotificationListener(ObjectName, NotificationListener)
+ * @see #removeNotificationListener(ObjectName, NotificationListener,
+ * NotificationFilter, Object)
+ * @see NotificationBroadcaster#addNotificationListener(NotificationListener,
+ * NotificationFilter,
+ * Object)
+ */
+ void addNotificationListener(ObjectName name, ObjectName listener,
+ NotificationFilter filter, Object passback)
+ throws InstanceNotFoundException;
+
+ /**
+ * <p>
+ * Instantiates a new instance of the specified management bean
+ * using the default constructor and registers it with the server
+ * under the supplied name. The class is loaded using the
+ * {@link javax.management.loading.ClassLoaderRepository default
+ * loader repository} of the server.
+ * </p>
+ * <p>
+ * If the name supplied is <code>null</code>, then the bean is
+ * expected to implement the {@link MBeanRegistration} interface.
+ * The {@link MBeanRegistration#preRegister preRegister} method
+ * of this interface will be used to obtain the name in this case.
+ * </p>
+ * <p>
+ * This method is equivalent to calling {@link
+ * #createMBean(String, ObjectName, Object[], String[])
+ * <code>createMBean(className, name, (Object[]) null,
+ * (String[]) null)</code>} with <code>null</code> parameters
+ * and signature.
+ * </p>
+ *
+ * @param className the class of the management bean, of which
+ * an instance should be created.
+ * @param name the name to register the new bean with.
+ * @return an {@link ObjectInstance} containing the {@link ObjectName}
+ * and Java class name of the created instance.
+ * @throws ReflectionException if an exception occurs in creating
+ * an instance of the bean.
+ * @throws InstanceAlreadyExistsException if a matching instance
+ * already exists.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preRegister
+ * method.
+ * @throws MBeanException if the bean's constructor throws an exception.
+ * @throws NotCompliantMBeanException if the created bean is not
+ * compliant with the JMX specification.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> class name or object
+ * name or if the object name is a pattern.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply the
+ * use of the <code>instantiate</code>
+ * and <code>registerMBean</code> methods.
+ * @see #createMBean(String, ObjectName, Object[], String[])
+ */
+ ObjectInstance createMBean(String className, ObjectName name)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException,
+ NotCompliantMBeanException;
+
+ /**
+ * <p>
+ * Instantiates a new instance of the specified management bean
+ * using the given constructor and registers it with the server
+ * under the supplied name. The class is loaded using the
+ * {@link javax.management.loading.ClassLoaderRepository default
+ * loader repository} of the server.
+ * </p>
+ * <p>
+ * If the name supplied is <code>null</code>, then the bean is
+ * expected to implement the {@link MBeanRegistration} interface.
+ * The {@link MBeanRegistration#preRegister preRegister} method
+ * of this interface will be used to obtain the name in this case.
+ * </p>
+ *
+ * @param className the class of the management bean, of which
+ * an instance should be created.
+ * @param name the name to register the new bean with.
+ * @param params the parameters for the bean's constructor.
+ * @param sig the signature of the constructor to use.
+ * @return an {@link ObjectInstance} containing the {@link ObjectName}
+ * and Java class name of the created instance.
+ * @throws ReflectionException if an exception occurs in creating
+ * an instance of the bean.
+ * @throws InstanceAlreadyExistsException if a matching instance
+ * already exists.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preRegister
+ * method.
+ * @throws MBeanException if the bean's constructor throws an exception.
+ * @throws NotCompliantMBeanException if the created bean is not
+ * compliant with the JMX specification.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> class name or object
+ * name or if the object name is a pattern.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply the
+ * use of the <code>instantiate</code>
+ * and <code>registerMBean</code> methods.
+ */
+ ObjectInstance createMBean(String className, ObjectName name,
+ Object[] params, String[] sig)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException,
+ NotCompliantMBeanException;
+
+ /**
+ * <p>
+ * Instantiates a new instance of the specified management bean
+ * using the default constructor and registers it with the server
+ * under the supplied name. The class is loaded using the
+ * given class loader. If this argument is <code>null</code>,
+ * then the same class loader as was used to load the server
+ * is used.
+ * </p>
+ * <p>
+ * If the name supplied is <code>null</code>, then the bean is
+ * expected to implement the {@link MBeanRegistration} interface.
+ * The {@link MBeanRegistration#preRegister preRegister} method
+ * of this interface will be used to obtain the name in this case.
+ * </p>
+ * <p>
+ * This method is equivalent to calling {@link
+ * #createMBean(String, ObjectName, ObjectName, Object[], String)
+ * <code>createMBean(className, name, loaderName, (Object[]) null,
+ * (String) null)</code>} with <code>null</code> parameters
+ * and signature.
+ * </p>
+ *
+ * @param className the class of the management bean, of which
+ * an instance should be created.
+ * @param name the name to register the new bean with.
+ * @param loaderName the name of the class loader.
+ * @return an {@link ObjectInstance} containing the {@link ObjectName}
+ * and Java class name of the created instance.
+ * @throws ReflectionException if an exception occurs in creating
+ * an instance of the bean.
+ * @throws InstanceAlreadyExistsException if a matching instance
+ * already exists.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preRegister
+ * method.
+ * @throws MBeanException if the bean's constructor throws an exception.
+ * @throws NotCompliantMBeanException if the created bean is not
+ * compliant with the JMX specification.
+ * @throws InstanceNotFoundException if the specified class loader is not
+ * registered with the server.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> class name or object
+ * name or if the object name is a pattern.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply the
+ * use of the <code>instantiate</code>
+ * and <code>registerMBean</code> methods.
+ * @see #createMBean(String, ObjectName, ObjectName, Object[], String[])
+ */
+ ObjectInstance createMBean(String className, ObjectName name,
+ ObjectName loaderName)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException,
+ NotCompliantMBeanException, InstanceNotFoundException;
+
+ /**
+ * <p>
+ * Instantiates a new instance of the specified management bean
+ * using the given constructor and registers it with the server
+ * under the supplied name. The class is loaded using the
+ * given class loader. If this argument is <code>null</code>,
+ * then the same class loader as was used to load the server
+ * is used.
+ * </p>
+ * <p>
+ * If the name supplied is <code>null</code>, then the bean is
+ * expected to implement the {@link MBeanRegistration} interface.
+ * The {@link MBeanRegistration#preRegister preRegister} method
+ * of this interface will be used to obtain the name in this case.
+ * </p>
+ *
+ * @param className the class of the management bean, of which
+ * an instance should be created.
+ * @param name the name to register the new bean with.
+ * @param loaderName the name of the class loader.
+ * @param params the parameters for the bean's constructor.
+ * @param sig the signature of the constructor to use.
+ * @return an {@link ObjectInstance} containing the {@link ObjectName}
+ * and Java class name of the created instance.
+ * @throws ReflectionException if an exception occurs in creating
+ * an instance of the bean.
+ * @throws InstanceAlreadyExistsException if a matching instance
+ * already exists.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preRegister
+ * method.
+ * @throws MBeanException if the bean's constructor throws an exception.
+ * @throws NotCompliantMBeanException if the created bean is not
+ * compliant with the JMX specification.
+ * @throws InstanceNotFoundException if the specified class loader is not
+ * registered with the server.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> class name or object
+ * name or if the object name is a pattern.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply the
+ * use of the <code>instantiate</code>
+ * and <code>registerMBean</code> methods.
+ */
+ ObjectInstance createMBean(String className, ObjectName name,
+ ObjectName loaderName, Object[] params,
+ String[] sig)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException,
+ NotCompliantMBeanException, InstanceNotFoundException;
+
+ /**
+ * Deserializes a byte array using the class loader of the specified
+ * management bean as its context.
+ *
+ * @param name the name of the bean whose class loader should be used.
+ * @param data the byte array to be deserialized.
+ * @return the deserialized object stream.
+ * @deprecated {@link #getClassLoaderFor(ObjectName)} should be used
+ * to obtain the class loader of the bean, which can then
+ * be used to perform deserialization in the user's code.
+ * @throws InstanceNotFoundException if the specified bean is not
+ * registered with the server.
+ * @throws OperationsException if any I/O error is thrown by the
+ * deserialization process.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "getClassLoaderFor")</code>
+ */
+ ObjectInputStream deserialize(ObjectName name, byte[] data)
+ throws InstanceNotFoundException, OperationsException;
+
+ /**
+ * Deserializes a byte array using the same class loader for its context
+ * as was used to load the given class. This class loader is obtained by
+ * loading the specified class using the {@link
+ * javax.management.loading.ClassLoaderRepository Class Loader Repository}
+ * and then using the class loader of the resulting {@link Class} instance.
+ *
+ * @param name the name of the class which should be loaded to obtain the
+ * class loader.
+ * @param data the byte array to be deserialized.
+ * @return the deserialized object stream.
+ * @deprecated {@link #getClassLoaderRepository} should be used
+ * to obtain the class loading repository, which can then
+ * be used to obtain the {@link Class} instance and deserialize
+ * the array using its class loader.
+ * @throws OperationsException if any I/O error is thrown by the
+ * deserialization process.
+ * @throws ReflectionException if an error occurs in obtaining the
+ * {@link Class} instance.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(null, null, null,
+ * "getClassLoaderRepository")</code>
+ */
+ ObjectInputStream deserialize(String name, byte[] data)
+ throws OperationsException, ReflectionException;
+
+ /**
+ * Deserializes a byte array using the same class loader for its context
+ * as was used to load the given class. The name of the class loader to
+ * be used is supplied, and may be <code>null</code> if the server's
+ * class loader should be used instead.
+ *
+ * @param name the name of the class which should be loaded to obtain the
+ * class loader.
+ * @param loader the name of the class loader to use, or <code>null</code>
+ * if the class loader of the server should be used.
+ * @param data the byte array to be deserialized.
+ * @return the deserialized object stream.
+ * @deprecated {@link #getClassLoader(ObjectName} can be used to obtain
+ * the named class loader and deserialize the array.
+ * @throws InstanceNotFoundException if the specified class loader is not
+ * registered with the server.
+ * @throws OperationsException if any I/O error is thrown by the
+ * deserialization process.
+ * @throws ReflectionException if an error occurs in obtaining the
+ * {@link Class} instance.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, loader,
+ * "getClassLoader")</code>
+ */
+ ObjectInputStream deserialize(String name, ObjectName loader, byte[] data)
+ throws InstanceNotFoundException, ReflectionException,
+ OperationsException;
+
+ /**
+ * Returns the value of the supplied attribute from the specified
+ * management bean.
+ *
+ * @param bean the bean to retrieve the value from.
+ * @param name the name of the attribute to retrieve.
+ * @return the value of the attribute.
+ * @throws AttributeNotFoundException if the attribute could not be
+ * accessed from the bean.
+ * @throws MBeanException if the management bean's accessor throws
+ * an exception.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ReflectionException if an exception was thrown in trying
+ * to invoke the bean's accessor.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean or attribute
+ * name.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, name, bean,
+ * "getAttribute")</code>}.
+ * @see DynamicMBean#getAttribute(String)
+ */
+ Object getAttribute(ObjectName bean, String name)
+ throws MBeanException, AttributeNotFoundException,
+ InstanceNotFoundException, ReflectionException;
+
+ /**
+ * Returns the values of the named attributes from the specified
+ * management bean.
+ *
+ * @param bean the bean to retrieve the value from.
+ * @param names the names of the attributes to retrieve.
+ * @return the values of the attributes.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ReflectionException if an exception was thrown in trying
+ * to invoke the bean's accessor.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean or attribute
+ * name.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, bean,
+ * "getAttribute")</code>}. Additionally,
+ * for an attribute name, <code>n</code>, the
+ * caller's permission must imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, n, bean,
+ * "getAttribute")</code>} or that attribute will
+ * not be included.
+ *
+ * @see DynamicMBean#getAttributes(String[])
+ */
+ AttributeList getAttributes(ObjectName bean, String[] names)
+ throws InstanceNotFoundException, ReflectionException;
+
+ /**
+ * Returns the specified class loader. If the specified value is
+ * <code>null</code>, then the class loader of the server will be
+ * returned. If <code>l</code> is the requested class loader,
+ * and <code>r</code> is the actual class loader returned, then
+ * either <code>l</code> and <code>r</code> will be identical,
+ * or they will at least return the same class from
+ * {@link ClassLoader#loadClass(String)} for any given string.
+ * They may not be identical due to one or the other
+ * being wrapped in another class loader (e.g. for security).
+ *
+ * @param name the name of the class loader to return.
+ * @return the class loader.
+ * @throws InstanceNotFoundException if the class loader can not
+ * be found.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "getClassLoader")</code>
+ */
+ ClassLoader getClassLoader(ObjectName name)
+ throws InstanceNotFoundException;
+
+ /**
+ * Returns the class loader of the specified management bean. If
+ * <code>l</code> is the requested class loader, and <code>r</code>
+ * is the actual class loader returned, then either <code>l</code>
+ * and <code>r</code> will be identical, or they will at least
+ * return the same class from {@link ClassLoader#loadClass(String)}
+ * for any given string. They may not be identical due to one or
+ * the other being wrapped in another class loader (e.g. for
+ * security).
+ *
+ * @param name the name of the bean whose class loader should be
+ * returned.
+ * @return the class loader.
+ * @throws InstanceNotFoundException if the bean is not registered
+ * with the server.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "getClassLoaderFor")</code>
+ */
+ ClassLoader getClassLoaderFor(ObjectName name)
+ throws InstanceNotFoundException;
+
+ /**
+ * Returns the class loader repository used by this server.
+ *
+ * @return the class loader repository.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(null, null, null,
+ * "getClassLoaderRepository")</code>
+ */
+ ClassLoaderRepository getClassLoaderRepository();
+
+ /**
+ * Returns the default domain this server applies to beans that have
+ * no specified domain.
+ *
+ * @return the default domain.
+ */
+ String getDefaultDomain();
+
+ /**
+ * Returns an array containing all the domains used by beans registered
+ * with this server. The ordering of the array is undefined.
+ *
+ * @return the list of domains.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(null, null, name,
+ * "getDomains")</code>}. Additionally,
+ * for an domain, <code>d</code>, the
+ * caller's permission must imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(null, null,
+ * new ObjectName("d:x=x"), "getDomains")</code>}
+ * or that domain will not be included. Note
+ * that "x=x" is an arbitrary key-value pair
+ * provided to satisfy the constructor.
+ * @see ObjectName#getDomain()
+ */
+ String[] getDomains();
+
+ /**
+ * Returns the number of management beans registered with this server.
+ * This may be less than the real number if the caller's access is
+ * restricted.
+ *
+ * @return the number of registered beans.
+ */
+ Integer getMBeanCount();
+
+ /**
+ * Returns information on the given management bean.
+ *
+ * @param name the name of the management bean.
+ * @return an instance of {@link MBeanInfo} for the bean.
+ * @throws IntrospectionException if an exception occurs in examining
+ * the bean.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ReflectionException if an exception occurs when trying
+ * to invoke {@link DynamicMBean#getMBeanInfo()}
+ * on the bean.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "getMBeanInfo")</code>}.
+ * @see DynamicMBean#getMBeanInfo()
+ */
+ MBeanInfo getMBeanInfo(ObjectName name)
+ throws InstanceNotFoundException, IntrospectionException,
+ ReflectionException;
+
+ /**
+ * Returns the {@link ObjectInstance} created for the specified
+ * management bean on registration.
+ *
+ * @param name the name of the bean.
+ * @return the corresponding {@link ObjectInstance} instance.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "getObjectInstance")</code>
+ * @see #createMBean(String, ObjectName)
+ */
+ ObjectInstance getObjectInstance(ObjectName name)
+ throws InstanceNotFoundException;
+
+ /**
+ * <p>
+ * Creates an instance of the specified class using the list of
+ * class loaders from the {@link
+ * javax.management.loading.ClassLoaderRepository Class Loader
+ * Repository}. The class should have a public constructor
+ * with no arguments. A reference to the new instance is returned,
+ * but the instance is not yet registered with the server.
+ * </p>
+ * <p>
+ * This method is equivalent to calling {@link
+ * #instantiate(String, Object[], String[])
+ * <code>instantiate(name, (Object[]) null, (String[]) null)</code>}
+ * with <code>null</code> parameters and signature.
+ * </p>
+ *
+ * @param name the name of the class of bean to be instantiated.
+ * @return an instance of the given class.
+ * @throws ReflectionException if an exception is thrown during
+ * loading the class or calling the
+ * constructor.
+ * @throws MBeanException if the constructor throws an exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> name.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, null,
+ * "instantiate")</code>}.
+ * @see #instantiate(String, Object[], String[])
+ */
+ Object instantiate(String name)
+ throws ReflectionException, MBeanException;
+
+ /**
+ * Creates an instance of the specified class using the list of
+ * class loaders from the {@link
+ * javax.management.loading.ClassLoaderRepository Class Loader
+ * Repository}. The class should have a public constructor
+ * matching the supplied signature. A reference to the new
+ * instance is returned, but the instance is not yet
+ * registered with the server.
+ *
+ * @param name the name of the class of bean to be instantiated.
+ * @param params the parameters for the constructor.
+ * @param sig the signature of the constructor.
+ * @return an instance of the given class.
+ * @throws ReflectionException if an exception is thrown during
+ * loading the class or calling the
+ * constructor.
+ * @throws MBeanException if the constructor throws an exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> name.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, null,
+ * "instantiate")</code>}.
+ */
+ Object instantiate(String name, Object[] params, String[] sig)
+ throws ReflectionException, MBeanException;
+
+ /**
+ * <p>
+ * Creates an instance of the specified class using the supplied
+ * class loader. If the class loader given is <code>null</code>,
+ * then the class loader of the server will be used. The class
+ * should have a public constructor with no arguments. A reference
+ * to the new instance is returned, but the instance is not yet
+ * registered with the server.
+ * </p>
+ * <p>
+ * This method is equivalent to calling {@link
+ * #instantiate(String, ObjectName, Object[], String[])
+ * <code>instantiate(name, loaderName, (Object[]) null,
+ * (String[]) null)</code>} with <code>null</code> parameters
+ * and signature.
+ * </p>
+ *
+ * @param name the name of the class of bean to be instantiated.
+ * @param loaderName the name of the class loader to use.
+ * @return an instance of the given class.
+ * @throws InstanceNotFoundException if the class loader is not
+ * registered with the server.
+ * @throws ReflectionException if an exception is thrown during
+ * loading the class or calling the
+ * constructor.
+ * @throws MBeanException if the constructor throws an exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> name.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, null,
+ * "instantiate")</code>}.
+ * @see #instantiate(String, Object[], String[])
+ */
+ Object instantiate(String name, ObjectName loaderName)
+ throws InstanceNotFoundException, ReflectionException,
+ MBeanException;
+
+ /**
+ * Creates an instance of the specified class using the supplied
+ * class loader. If the class loader given is <code>null</code>,
+ * then the class loader of the server will be used. The class
+ * should have a public constructor matching the supplied
+ * signature. A reference to the new instance is returned,
+ * but the instance is not yet registered with the server.
+ *
+ * @param name the name of the class of bean to be instantiated.
+ * @param loaderName the name of the class loader to use.
+ * @param params the parameters for the constructor.
+ * @param sig the signature of the constructor.
+ * @return an instance of the given class.
+ * @throws InstanceNotFoundException if the class loader is not
+ * registered with the server.
+ * @throws ReflectionException if an exception is thrown during
+ * loading the class or calling the
+ * constructor.
+ * @throws MBeanException if the constructor throws an exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> name.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, null,
+ * "instantiate")</code>}.
+ */
+ Object instantiate(String name, ObjectName loaderName,
+ Object[] params, String[] sig)
+ throws InstanceNotFoundException, ReflectionException,
+ MBeanException;
+
+ /**
+ * Invokes the supplied operation on the specified management
+ * bean. The class objects specified in the signature are loaded
+ * using the same class loader as was used for the management bean.
+ *
+ * @param bean the management bean whose operation should be invoked.
+ * @param name the name of the operation to invoke.
+ * @param params the parameters of the operation.
+ * @param sig the signature of the operation.
+ * @return the return value of the method.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws MBeanException if the method invoked throws an exception.
+ * @throws ReflectionException if an exception is thrown in invoking the
+ * method.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, name, bean,
+ * "invoke")</code>}.
+ * @see DynamicMBean#invoke(String, Object[], String[])
+ */
+ Object invoke(ObjectName bean, String name, Object[] params, String[] sig)
+ throws InstanceNotFoundException, MBeanException,
+ ReflectionException;
+
+ /**
+ * <p>
+ * Returns true if the specified management bean is an instance
+ * of the supplied class.
+ * </p>
+ * <p>
+ * A bean, B, is an instance of a class, C, if either of the following
+ * conditions holds:
+ * </p>
+ * <ul>
+ * <li>The class name in B's {@link MBeanInfo} is equal to the supplied
+ * name.</li>
+ * <li>Both the class of B and C were loaded by the same class loader,
+ * and B is assignable to C.</li>
+ * </ul>
+ *
+ * @param name the name of the management bean.
+ * @param className the name of the class to test if <code>name</code> is
+ * an instance of.
+ * @return true if either B is directly an instance of the named class,
+ * or B is assignable to the class, given that both it and B's
+ * current class were loaded using the same class loader.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "isInstanceOf")</code>
+ */
+ boolean isInstanceOf(ObjectName name, String className)
+ throws InstanceNotFoundException;
+
+ /**
+ * Returns true if the specified management bean is registered with
+ * the server.
+ *
+ * @param name the name of the management bean.
+ * @return true if the bean is registered.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean name.
+ */
+ boolean isRegistered(ObjectName name);
+
+ /**
+ * <p>
+ * Returns a set of {@link ObjectInstance}s matching the specified
+ * criteria. The full set of beans registered with the server
+ * are passed through two filters:
+ * </p>
+ * <ol>
+ * <li>Pattern matching is performed using the supplied
+ * {@link ObjectName}.</li>
+ * <li>The supplied query expression is applied.</li>
+ * </ol>
+ * <p>
+ * If both the object name and the query expression are <code>null</code>,
+ * or the object name has no domain and no key properties,
+ * no filtering will be performed and all beans are returned.
+ * </p>
+ *
+ * @param name an {@link ObjectName} to use as a filter.
+ * @param query a query expression to apply to each of the beans that match
+ * the given object name.
+ * @return a set of {@link ObjectInstance}s matching the filtered beans.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(null, null, name,
+ * "queryMBeans")</code>}. Additionally,
+ * for an bean, <code>b</code>, the
+ * caller's permission must imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, b, name,
+ * "queryMBeans")</code>} or that bean will
+ * not be included. Such an exception may also
+ * arise from the execution of the query, in which
+ * case that particular bean will again be excluded.
+ */
+ Set queryMBeans(ObjectName name, QueryExp query);
+
+ /**
+ * <p>
+ * Returns a set of {@link ObjectName}s matching the specified
+ * criteria. The full set of beans registered with the server
+ * are passed through two filters:
+ * </p>
+ * <ol>
+ * <li>Pattern matching is performed using the supplied
+ * {@link ObjectName}.</li>
+ * <li>The supplied query expression is applied.</li>
+ * </ol>
+ * <p>
+ * If both the object name and the query expression are <code>null</code>,
+ * or the object name has no domain and no key properties,
+ * no filtering will be performed and all beans are returned.
+ * </p>
+ *
+ * @param name an {@link ObjectName} to use as a filter.
+ * @param query a query expression to apply to each of the beans that match
+ * the given object name.
+ * @return a set of {@link ObjectName}s matching the filtered beans.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(null, null, name,
+ * "queryNames")</code>}. Additionally,
+ * for an name, <code>n</code>, the
+ * caller's permission must imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, n, name,
+ * "queryNames")</code>} or that name will
+ * not be included. Such an exception may also
+ * arise from the execution of the query, in which
+ * case that particular bean will again be excluded.
+ * Note that these permissions are implied if the
+ * <code>queryMBeans</code> permissions are available.
+ */
+ Set queryNames(ObjectName name, QueryExp query);
+
+ /**
+ * Registers the supplied instance with the server, using the specified
+ * {@link ObjectName}. If the name given is <code>null</code>, then
+ * the bean supplied is expected to implement the {@link MBeanRegistration}
+ * interface and provide the name via the
+ * {@link MBeanRegistration#preRegister preRegister} method
+ * of this interface.
+ *
+ * @param obj the object to register with the server.
+ * @param name the name under which to register the object,
+ * or <code>null</code> if the {@link MBeanRegistration}
+ * interface should be used.
+ * @throws InstanceAlreadyExistsException if a matching instance
+ * already exists.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preRegister
+ * method.
+ * @throws NotCompliantMBeanException if the created bean is not
+ * compliant with the JMX specification.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> object.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "registerMBean")</code>}. <code>className</code>
+ * here corresponds to the result of
+ * {@link MBeanInfo#getClassName()} for objects of
+ * this class. If this check succeeds, a check
+ * is also made on its
+ * {@link java.security.ProtectionDomain} to ensure
+ * it implies {@link MBeanTrustPermission(String)
+ * <code>MBeanTrustPermission("register")</code>}.
+ * The use of the {@link MBeanRegistration} interface
+ * results in another {@link MBeanPermission} check
+ * being made on the returned {@link ObjectName}.
+ */
+ ObjectInstance registerMBean(Object obj, ObjectName name)
+ throws InstanceAlreadyExistsException, MBeanRegistrationException,
+ NotCompliantMBeanException;
+
+ /**
+ * Removes the specified listener from the list of recipients
+ * of notifications from the supplied bean. This includes all
+ * combinations of filters and passback objects registered for
+ * this listener. For more specific removal of listeners, see
+ * {@link #removeNotificationListener(ObjectName,
+ * NotificationListener,NotificationFilter,Object)}
+ *
+ * @param name the name of the management bean from which the
+ * listener should be removed.
+ * @param listener the listener to remove.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ListenerNotFoundException if the specified listener
+ * is not registered with the bean.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "removeNotificationListener")</code>}.
+ * @see #addNotificationListener(NotificationListener, NotificationFilter,
+ * java.lang.Object)
+ * @see NotificationBroadcaster#removeNotificationListener(NotificationListener)
+ */
+ void removeNotificationListener(ObjectName name,
+ NotificationListener listener)
+ throws InstanceNotFoundException, ListenerNotFoundException;
+
+ /**
+ * Removes the specified listener from the list of recipients
+ * of notifications from the supplied bean. Only the first instance with
+ * the supplied filter and passback object is removed.
+ * <code>null</code> is used as a valid value for these parameters,
+ * rather than as a way to remove all registration instances for
+ * the specified listener; for this behaviour instead, see
+ * {@link #removeNotificationListener(ObjectName, NotificationListener)}.
+ *
+ * @param name the name of the management bean from which the
+ * listener should be removed.
+ * @param listener the listener to remove.
+ * @param filter the filter of the listener to remove.
+ * @param passback the passback object of the listener to remove.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ListenerNotFoundException if the specified listener
+ * is not registered with the bean.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "removeNotificationListener")</code>}.
+ * @see #addNotificationListener(ObjectName, NotificationListener,
+ * NotificationFilter, Object)
+ * @see NotificationEmitter#removeNotificationListener(NotificationListener,
+ * NotificationFilter,
+ * Object)
+ */
+ void removeNotificationListener(ObjectName name,
+ NotificationListener listener,
+ NotificationFilter filter,
+ Object passback)
+ throws InstanceNotFoundException, ListenerNotFoundException;
+
+ /**
+ * Removes the specified listener from the list of recipients
+ * of notifications from the supplied bean. This includes all
+ * combinations of filters and passback objects registered for
+ * this listener. For more specific removal of listeners, see
+ * {@link #removeNotificationListener(ObjectName,
+ * ObjectName,NotificationFilter,Object)}
+ *
+ * @param name the name of the management bean from which the
+ * listener should be removed.
+ * @param listener the name of the listener to remove.
+ * @throws InstanceNotFoundException if a name doesn't match a registered
+ * bean.
+ * @throws ListenerNotFoundException if the specified listener
+ * is not registered with the bean.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "removeNotificationListener")</code>}.
+ * @see #addNotificationListener(NotificationListener, NotificationFilter,
+ * java.lang.Object)
+ * @see NotificationBroadcaster#removeNotificationListener(NotificationListener)
+ */
+ void removeNotificationListener(ObjectName name, ObjectName listener)
+ throws InstanceNotFoundException, ListenerNotFoundException;
+
+ /**
+ * Removes the specified listener from the list of recipients
+ * of notifications from the supplied bean. Only the first instance with
+ * the supplied filter and passback object is removed.
+ * <code>null</code> is used as a valid value for these parameters,
+ * rather than as a way to remove all registration instances for
+ * the specified listener; for this behaviour instead, see
+ * {@link #removeNotificationListener(ObjectName, ObjectName)}.
+ *
+ * @param name the name of the management bean from which the
+ * listener should be removed.
+ * @param listener the name of the listener to remove.
+ * @param filter the filter of the listener to remove.
+ * @param passback the passback object of the listener to remove.
+ * @throws InstanceNotFoundException if a name doesn't match a registered
+ * bean.
+ * @throws ListenerNotFoundException if the specified listener
+ * is not registered with the bean.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "removeNotificationListener")</code>}.
+ * @see #addNotificationListener(ObjectName, NotificationListener,
+ * NotificationFilter, Object)
+ * @see NotificationEmitter#removeNotificationListener(NotificationListener,
+ * NotificationFilter,
+ * Object)
+ */
+ void removeNotificationListener(ObjectName name,
+ ObjectName listener,
+ NotificationFilter filter,
+ Object passback)
+ throws InstanceNotFoundException, ListenerNotFoundException;
+
+ /**
+ * Sets the value of the specified attribute of the supplied
+ * management bean.
+ *
+ * @param name the name of the management bean.
+ * @param attribute the attribute to set.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws AttributeNotFoundException if the attribute does not
+ * correspond to an attribute
+ * of the bean.
+ * @throws InvalidAttributeValueException if the value is invalid
+ * for this particular
+ * attribute of the bean.
+ * @throws MBeanException if setting the attribute causes
+ * the bean to throw an exception (which
+ * becomes the cause of this exception).
+ * @throws ReflectionException if an exception occurred in trying
+ * to use the reflection interface
+ * to lookup the attribute. The
+ * thrown exception is the cause of
+ * this exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean or attribute
+ * name.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, name, bean,
+ * "setAttribute")</code>}.
+ * @see #getAttribute(ObjectName, String)
+ * @see DynamicMBean#setAttribute(Attribute)
+ */
+ void setAttribute(ObjectName name, Attribute attribute)
+ throws InstanceNotFoundException, AttributeNotFoundException,
+ InvalidAttributeValueException, MBeanException,
+ ReflectionException;
+
+ /**
+ * Sets the value of each of the specified attributes
+ * of the supplied management bean to that specified by
+ * the {@link Attribute} object. The returned list contains
+ * the attributes that were set and their new values.
+ *
+ * @param name the name of the management bean.
+ * @param attributes the attributes to set.
+ * @return a list of the changed attributes.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ReflectionException if an exception occurred in trying
+ * to use the reflection interface
+ * to lookup the attribute. The
+ * thrown exception is the cause of
+ * this exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean or attribute
+ * list.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, bean,
+ * "setAttribute")</code>}. Additionally,
+ * for an attribute name, <code>n</code>, the
+ * caller's permission must imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, n, bean,
+ * "setAttribute")</code>} or that attribute will
+ * not be included.
+ * @see #getAttributes(ObjectName, String[])
+ * @see DynamicMBean#setAttributes(AttributeList)
+ */
+ AttributeList setAttributes(ObjectName name, AttributeList attributes)
+ throws InstanceNotFoundException, ReflectionException;
+
+ /**
+ * Unregisters the specified management bean. Following this operation,
+ * the bean instance is no longer accessible from the server via this
+ * name. Prior to unregistering the bean, the
+ * {@link MBeanRegistration#preDeregister()} method will be called if
+ * the bean implements the {@link MBeanRegistration} interface.
+ *
+ * @param name the name of the management bean.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preDeregister
+ * method.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean name or a
+ * request being made to unregister the
+ * {@link MBeanServerDelegate} bean.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(className, null, name,
+ * "unregisterMBean")</code>}.
+ */
+ void unregisterMBean(ObjectName name)
+ throws InstanceNotFoundException, MBeanRegistrationException;
+
+}
diff --git a/libjava/classpath/javax/management/MBeanServerBuilder.java b/libjava/classpath/javax/management/MBeanServerBuilder.java
new file mode 100644
index 00000000000..4e280682900
--- /dev/null
+++ b/libjava/classpath/javax/management/MBeanServerBuilder.java
@@ -0,0 +1,102 @@
+/* MBeanServerBuilder.java -- Creates a default management server.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+import gnu.javax.management.Server;
+
+/**
+ * Constructs a default implementation of an {@link MBeanServer}.
+ * The {@link MBeanServerFactory} allows custom implementations of
+ * {@link MBeanServer} to be used by providing subclasses of this.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class MBeanServerBuilder
+{
+
+ /**
+ * Constructs a new {@link MBeanServerBuilder}.
+ */
+ public MBeanServerBuilder()
+ {
+ }
+
+ /**
+ * <p>
+ * Creates a new {@link MBeanServer} implementation with the specified
+ * default domain, delegate and outer server. The latter is the server
+ * passed to the {@link MBeanRegistration} interface of management beans,
+ * allowing an {@link MBeanServer} implementation to wrap another in order
+ * to provide additional checks, etc. If this value is <code>null</code>,
+ * <code>this</code> is passed to beans instead.
+ * </p>
+ * <p>
+ * The {@link MBeanServerFactory} calls this method after having first
+ * created a delegate using the {@link #newMBeanServerDelegate()} method.
+ * However, the delegate used in the call to this method may not be the
+ * same as that returned by {@link #newMBeanServerDelegate()} as the factory
+ * can optionally wrap the delegate before calling this method.
+ * </p>
+ *
+ * @param defaultDomain the default domain used by the new server.
+ * @param outer the {@link MBeanServer} passed to the {@link MBeanRegistration}
+ * interface of management beans.
+ * @param delegate the delegate bean associated with the server, which must
+ * be registered as a management bean by the server.
+ * @return a new instance of a server implementation.
+ */
+ public MBeanServer newMBeanServer(String defaultDomain, MBeanServer outer,
+ MBeanServerDelegate delegate)
+ {
+ return new Server(defaultDomain, outer, delegate);
+ }
+
+ /**
+ * Creates a new {@link MBeanServerDelegate}, which will be used by
+ * a management server. The returned delegate may either be used directly
+ * by the server, or may be further wrapped to add additional checks.
+ *
+ * @return a new instance of {@link MBeanServerDelegate}.
+ */
+ public MBeanServerDelegate newMBeanServerDelegate()
+ {
+ return new MBeanServerDelegate();
+ }
+
+}
diff --git a/libjava/classpath/javax/management/MBeanServerConnection.java b/libjava/classpath/javax/management/MBeanServerConnection.java
new file mode 100644
index 00000000000..dff03e8c0d4
--- /dev/null
+++ b/libjava/classpath/javax/management/MBeanServerConnection.java
@@ -0,0 +1,768 @@
+/* MBeanServerConnection.java -- Represents a connection to a management server.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+import java.io.IOException;
+
+import java.util.Set;
+
+/**
+ * This interface represents a communication mechanism which may
+ * be used to access an MBean server, whether this be local or
+ * remote. The {@link MBeanServer} interface extends this with
+ * additional methods that apply only to local servers.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public interface MBeanServerConnection
+{
+
+ /**
+ * Registers the supplied listener with the specified management
+ * bean. Notifications emitted by the management bean are forwarded
+ * to the listener via the server, which will convert any MBean
+ * references in the source to portable {@link ObjectName}
+ * instances. The notification is otherwise unchanged.
+ *
+ * @param name the name of the management bean with which the listener
+ * should be registered.
+ * @param listener the listener which will handle notifications from
+ * the bean.
+ * @param filter the filter to apply to incoming notifications, or
+ * <code>null</code> if no filtering should be applied.
+ * @param passback an object to be passed to the listener when a
+ * notification is emitted.
+ * @throws InstanceNotFoundException if the name of the management bean
+ * could not be resolved.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see #removeNotificationListener(ObjectName, NotificationListener)
+ * @see #removeNotificationListener(ObjectName, NotificationListener,
+ * NotificationFilter, Object)
+ * @see NotificationBroadcaster#addNotificationListener(NotificationListener,
+ * NotificationFilter,
+ * Object)
+ */
+ void addNotificationListener(ObjectName name, NotificationListener listener,
+ NotificationFilter filter, Object passback)
+ throws InstanceNotFoundException, IOException;
+
+ /**
+ * <p>
+ * Registers the supplied listener with the specified management
+ * bean. Notifications emitted by the management bean are forwarded
+ * to the listener via the server, which will convert any MBean
+ * references in the source to portable {@link ObjectName}
+ * instances. The notification is otherwise unchanged.
+ * </p>
+ * <p>
+ * The listener that receives notifications will be the one that is
+ * registered with the given name at the time this method is called.
+ * Even if it later unregisters and ceases to use that name, it will
+ * still receive notifications.
+ * </p>
+ *
+ * @param name the name of the management bean with which the listener
+ * should be registered.
+ * @param listener the name of the listener which will handle
+ * notifications from the bean.
+ * @param filter the filter to apply to incoming notifications, or
+ * <code>null</code> if no filtering should be applied.
+ * @param passback an object to be passed to the listener when a
+ * notification is emitted.
+ * @throws InstanceNotFoundException if the name of the management bean
+ * could not be resolved.
+ * @throws RuntimeOperationsException if the bean associated with the given
+ * object name is not a
+ * {@link NotificationListener}. This
+ * exception wraps an
+ * {@link IllegalArgumentException}.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see #removeNotificationListener(ObjectName, NotificationListener)
+ * @see #removeNotificationListener(ObjectName, NotificationListener,
+ * NotificationFilter, Object)
+ * @see NotificationBroadcaster#addNotificationListener(NotificationListener,
+ * NotificationFilter,
+ * Object)
+ */
+ void addNotificationListener(ObjectName name, ObjectName listener,
+ NotificationFilter filter, Object passback)
+ throws InstanceNotFoundException, RuntimeOperationsException, IOException;
+
+ /**
+ * <p>
+ * Instantiates a new instance of the specified management bean
+ * using the default constructor and registers it with the server
+ * under the supplied name. The class is loaded using the
+ * {@link javax.management.loading.ClassLoaderRepository default
+ * loader repository} of the server.
+ * </p>
+ * <p>
+ * If the name supplied is <code>null</code>, then the bean is
+ * expected to implement the {@link MBeanRegistration} interface.
+ * The {@link MBeanRegistration#preRegister preRegister} method
+ * of this interface will be used to obtain the name in this case.
+ * </p>
+ * <p>
+ * This method is equivalent to calling {@link
+ * #createMBean(String, ObjectName, Object[], String[])
+ * <code>createMBean(className, name, (Object[]) null,
+ * (String[]) null)</code>} with <code>null</code> parameters
+ * and signature.
+ * </p>
+ *
+ * @param className the class of the management bean, of which
+ * an instance should be created.
+ * @param name the name to register the new bean with.
+ * @return an {@link ObjectInstance} containing the {@link ObjectName}
+ * and Java class name of the created instance.
+ * @throws ReflectionException if an exception occurs in creating
+ * an instance of the bean.
+ * @throws InstanceAlreadyExistsException if a matching instance
+ * already exists.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preRegister
+ * method.
+ * @throws MBeanException if the bean's constructor throws an exception.
+ * @throws NotCompliantMBeanException if the created bean is not
+ * compliant with the JMX specification.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> class name or object
+ * name or if the object name is a pattern.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see #createMBean(String, ObjectName, Object[], String[])
+ */
+ ObjectInstance createMBean(String className, ObjectName name)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException,
+ NotCompliantMBeanException, IOException;
+
+ /**
+ * <p>
+ * Instantiates a new instance of the specified management bean
+ * using the given constructor and registers it with the server
+ * under the supplied name. The class is loaded using the
+ * {@link javax.management.loading.ClassLoaderRepository default
+ * loader repository} of the server.
+ * </p>
+ * <p>
+ * If the name supplied is <code>null</code>, then the bean is
+ * expected to implement the {@link MBeanRegistration} interface.
+ * The {@link MBeanRegistration#preRegister preRegister} method
+ * of this interface will be used to obtain the name in this case.
+ * </p>
+ *
+ * @param className the class of the management bean, of which
+ * an instance should be created.
+ * @param name the name to register the new bean with.
+ * @param params the parameters for the bean's constructor.
+ * @param sig the signature of the constructor to use.
+ * @return an {@link ObjectInstance} containing the {@link ObjectName}
+ * and Java class name of the created instance.
+ * @throws ReflectionException if an exception occurs in creating
+ * an instance of the bean.
+ * @throws InstanceAlreadyExistsException if a matching instance
+ * already exists.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preRegister
+ * method.
+ * @throws MBeanException if the bean's constructor throws an exception.
+ * @throws NotCompliantMBeanException if the created bean is not
+ * compliant with the JMX specification.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> class name or object
+ * name or if the object name is a pattern.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ */
+ ObjectInstance createMBean(String className, ObjectName name,
+ Object[] params, String[] sig)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException,
+ NotCompliantMBeanException, IOException;
+
+ /**
+ * <p>
+ * Instantiates a new instance of the specified management bean
+ * using the default constructor and registers it with the server
+ * under the supplied name. The class is loaded using the
+ * given class loader. If this argument is <code>null</code>,
+ * then the same class loader as was used to load the server
+ * is used.
+ * </p>
+ * <p>
+ * If the name supplied is <code>null</code>, then the bean is
+ * expected to implement the {@link MBeanRegistration} interface.
+ * The {@link MBeanRegistration#preRegister preRegister} method
+ * of this interface will be used to obtain the name in this case.
+ * </p>
+ * <p>
+ * This method is equivalent to calling {@link
+ * #createMBean(String, ObjectName, ObjectName, Object[], String)
+ * <code>createMBean(className, name, loaderName, (Object[]) null,
+ * (String) null)</code>} with <code>null</code> parameters
+ * and signature.
+ * </p>
+ *
+ * @param className the class of the management bean, of which
+ * an instance should be created.
+ * @param name the name to register the new bean with.
+ * @param loaderName the name of the class loader.
+ * @return an {@link ObjectInstance} containing the {@link ObjectName}
+ * and Java class name of the created instance.
+ * @throws ReflectionException if an exception occurs in creating
+ * an instance of the bean.
+ * @throws InstanceAlreadyExistsException if a matching instance
+ * already exists.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preRegister
+ * method.
+ * @throws MBeanException if the bean's constructor throws an exception.
+ * @throws NotCompliantMBeanException if the created bean is not
+ * compliant with the JMX specification.
+ * @throws InstanceNotFoundException if the specified class loader is not
+ * registered with the server.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> class name or object
+ * name or if the object name is a pattern.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see #createMBean(String, ObjectName, ObjectName, Object[], String[])
+ */
+ ObjectInstance createMBean(String className, ObjectName name,
+ ObjectName loaderName)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException,
+ NotCompliantMBeanException, InstanceNotFoundException,
+ IOException;
+
+ /**
+ * <p>
+ * Instantiates a new instance of the specified management bean
+ * using the given constructor and registers it with the server
+ * under the supplied name. The class is loaded using the
+ * given class loader. If this argument is <code>null</code>,
+ * then the same class loader as was used to load the server
+ * is used.
+ * </p>
+ * <p>
+ * If the name supplied is <code>null</code>, then the bean is
+ * expected to implement the {@link MBeanRegistration} interface.
+ * The {@link MBeanRegistration#preRegister preRegister} method
+ * of this interface will be used to obtain the name in this case.
+ * </p>
+ *
+ * @param className the class of the management bean, of which
+ * an instance should be created.
+ * @param name the name to register the new bean with.
+ * @param loaderName the name of the class loader.
+ * @param params the parameters for the bean's constructor.
+ * @param sig the signature of the constructor to use.
+ * @return an {@link ObjectInstance} containing the {@link ObjectName}
+ * and Java class name of the created instance.
+ * @throws ReflectionException if an exception occurs in creating
+ * an instance of the bean.
+ * @throws InstanceAlreadyExistsException if a matching instance
+ * already exists.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preRegister
+ * method.
+ * @throws MBeanException if the bean's constructor throws an exception.
+ * @throws NotCompliantMBeanException if the created bean is not
+ * compliant with the JMX specification.
+ * @throws InstanceNotFoundException if the specified class loader is not
+ * registered with the server.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> class name or object
+ * name or if the object name is a pattern.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ */
+ ObjectInstance createMBean(String className, ObjectName name,
+ ObjectName loaderName, Object[] params,
+ String[] sig)
+ throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException,
+ NotCompliantMBeanException, InstanceNotFoundException,
+ IOException;
+
+ /**
+ * Returns the value of the supplied attribute from the specified
+ * management bean.
+ *
+ * @param bean the bean to retrieve the value from.
+ * @param name the name of the attribute to retrieve.
+ * @return the value of the attribute.
+ * @throws AttributeNotFoundException if the attribute could not be
+ * accessed from the bean.
+ * @throws MBeanException if the management bean's accessor throws
+ * an exception.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ReflectionException if an exception was thrown in trying
+ * to invoke the bean's accessor.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean or attribute
+ * name.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see DynamicMBean#getAttribute(String)
+ */
+ Object getAttribute(ObjectName bean, String name)
+ throws MBeanException, AttributeNotFoundException,
+ InstanceNotFoundException, ReflectionException,
+ IOException;
+
+ /**
+ * Returns the values of the named attributes from the specified
+ * management bean.
+ *
+ * @param bean the bean to retrieve the value from.
+ * @param names the names of the attributes to retrieve.
+ * @return the values of the attributes.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ReflectionException if an exception was thrown in trying
+ * to invoke the bean's accessor.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean or attribute
+ * name.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see DynamicMBean#getAttributes(String[])
+ */
+ AttributeList getAttributes(ObjectName bean, String[] names)
+ throws InstanceNotFoundException, ReflectionException,
+ IOException;
+
+ /**
+ * Returns the default domain this server applies to beans that have
+ * no specified domain.
+ *
+ * @return the default domain.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ */
+ String getDefaultDomain()
+ throws IOException;
+
+ /**
+ * Returns an array containing all the domains used by beans registered
+ * with this server. The ordering of the array is undefined.
+ *
+ * @return the list of domains.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see ObjectName#getDomain()
+ */
+ String[] getDomains()
+ throws IOException;
+
+ /**
+ * Returns the number of management beans registered with this server.
+ *
+ * @return the number of registered beans.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ */
+ Integer getMBeanCount()
+ throws IOException;
+
+ /**
+ * Returns information on the given management bean.
+ *
+ * @param name the name of the management bean.
+ * @return an instance of {@link MBeanInfo} for the bean.
+ * @throws IntrospectionException if an exception occurs in examining
+ * the bean.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ReflectionException if an exception occurs when trying
+ * to invoke {@link DynamicMBean#getMBeanInfo()}
+ * on the bean.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see DynamicMBean#getMBeanInfo()
+ */
+ MBeanInfo getMBeanInfo(ObjectName name)
+ throws InstanceNotFoundException, IntrospectionException,
+ ReflectionException, IOException;
+
+ /**
+ * Returns the {@link ObjectInstance} created for the specified
+ * management bean on registration.
+ *
+ * @param name the name of the bean.
+ * @return the corresponding {@link ObjectInstance} instance.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see #createMBean(String, ObjectName)
+ */
+ ObjectInstance getObjectInstance(ObjectName name)
+ throws InstanceNotFoundException, IOException;
+
+ /**
+ * Invokes the supplied operation on the specified management
+ * bean. The class objects specified in the signature are loaded
+ * using the same class loader as was used for the management bean.
+ *
+ * @param bean the management bean whose operation should be invoked.
+ * @param name the name of the operation to invoke.
+ * @param params the parameters of the operation.
+ * @param sig the signature of the operation.
+ * @return the return value of the method.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws MBeanException if the method invoked throws an exception.
+ * @throws ReflectionException if an exception is thrown in invoking the
+ * method.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see DynamicMBean#invoke(String, Object[], String[])
+ */
+ Object invoke(ObjectName bean, String name, Object[] params, String[] sig)
+ throws InstanceNotFoundException, MBeanException,
+ ReflectionException, IOException;
+
+ /**
+ * <p>
+ * Returns true if the specified management bean is an instance
+ * of the supplied class.
+ * </p>
+ * <p>
+ * A bean, B, is an instance of a class, C, if either of the following
+ * conditions holds:
+ * </p>
+ * <ul>
+ * <li>The class name in B's {@link MBeanInfo} is equal to the supplied
+ * name.</li>
+ * <li>Both the class of B and C were loaded by the same class loader,
+ * and B is assignable to C.</li>
+ * </ul>
+ *
+ * @param name the name of the management bean.
+ * @param className the name of the class to test if <code>name</code> is
+ * an instance of.
+ * @return true if either B is directly an instance of the named class,
+ * or B is assignable to the class, given that both it and B's
+ * current class were loaded using the same class loader.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ */
+ boolean isInstanceOf(ObjectName name, String className)
+ throws InstanceNotFoundException, IOException;
+
+ /**
+ * Returns true if the specified management bean is registered with
+ * the server.
+ *
+ * @param name the name of the management bean.
+ * @return true if the bean is registered.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean name.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ */
+ boolean isRegistered(ObjectName name)
+ throws IOException;
+
+ /**
+ * <p>
+ * Returns a set of {@link ObjectInstance}s matching the specified
+ * criteria. The full set of beans registered with the server
+ * are passed through two filters:
+ * </p>
+ * <ol>
+ * <li>Pattern matching is performed using the supplied
+ * {@link ObjectName}.</li>
+ * <li>The supplied query expression is applied.</li>
+ * </ol>
+ * <p>
+ * If both the object name and the query expression are <code>null</code>,
+ * or the object name has no domain and no key properties,
+ * no filtering will be performed and all beans are returned.
+ * </p>
+ *
+ * @param name an {@link ObjectName} to use as a filter.
+ * @param query a query expression to apply to each of the beans that match
+ * the given object name.
+ * @return a set of {@link ObjectInstance}s matching the filtered beans.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ */
+ Set queryMBeans(ObjectName name, QueryExp query)
+ throws IOException;
+
+ /**
+ * <p>
+ * Returns a set of {@link ObjectName}s matching the specified
+ * criteria. The full set of beans registered with the server
+ * are passed through two filters:
+ * </p>
+ * <ol>
+ * <li>Pattern matching is performed using the supplied
+ * {@link ObjectName}.</li>
+ * <li>The supplied query expression is applied.</li>
+ * </ol>
+ * <p>
+ * If both the object name and the query expression are <code>null</code>,
+ * or the object name has no domain and no key properties,
+ * no filtering will be performed and all beans are returned.
+ * </p>
+ *
+ * @param name an {@link ObjectName} to use as a filter.
+ * @param query a query expression to apply to each of the beans that match
+ * the given object name.
+ * @return a set of {@link ObjectName}s matching the filtered beans.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ */
+ Set queryNames(ObjectName name, QueryExp query)
+ throws IOException;
+
+ /**
+ * Removes the specified listener from the list of recipients
+ * of notifications from the supplied bean. This includes all
+ * combinations of filters and passback objects registered for
+ * this listener. For more specific removal of listeners, see
+ * {@link #removeNotificationListener(ObjectName,
+ * NotificationListener,NotificationFilter,Object)}
+ *
+ * @param name the name of the management bean from which the
+ * listener should be removed.
+ * @param listener the listener to remove.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ListenerNotFoundException if the specified listener
+ * is not registered with the bean.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see #addNotificationListener(NotificationListener, NotificationFilter,
+ * java.lang.Object)
+ * @see NotificationBroadcaster#removeNotificationListener(NotificationListener)
+ */
+ void removeNotificationListener(ObjectName name,
+ NotificationListener listener)
+ throws InstanceNotFoundException, ListenerNotFoundException,
+ IOException;
+
+ /**
+ * Removes the specified listener from the list of recipients
+ * of notifications from the supplied bean. Only the first instance with
+ * the supplied filter and passback object is removed.
+ * <code>null</code> is used as a valid value for these parameters,
+ * rather than as a way to remove all registration instances for
+ * the specified listener; for this behaviour instead, see
+ * {@link #removeNotificationListener(ObjectName, NotificationListener)}.
+ *
+ * @param name the name of the management bean from which the
+ * listener should be removed.
+ * @param listener the listener to remove.
+ * @param filter the filter of the listener to remove.
+ * @param passback the passback object of the listener to remove.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ListenerNotFoundException if the specified listener
+ * is not registered with the bean.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see #addNotificationListener(ObjectName, NotificationListener,
+ * NotificationFilter, Object)
+ * @see NotificationEmitter#removeNotificationListener(NotificationListener,
+ * NotificationFilter,
+ * Object)
+ */
+ void removeNotificationListener(ObjectName name,
+ NotificationListener listener,
+ NotificationFilter filter,
+ Object passback)
+ throws InstanceNotFoundException, ListenerNotFoundException,
+ IOException;
+
+ /**
+ * Removes the specified listener from the list of recipients
+ * of notifications from the supplied bean. This includes all
+ * combinations of filters and passback objects registered for
+ * this listener. For more specific removal of listeners, see
+ * {@link #removeNotificationListener(ObjectName,
+ * ObjectName,NotificationFilter,Object)}
+ *
+ * @param name the name of the management bean from which the
+ * listener should be removed.
+ * @param listener the name of the listener to remove.
+ * @throws InstanceNotFoundException if a name doesn't match a registered
+ * bean.
+ * @throws ListenerNotFoundException if the specified listener
+ * is not registered with the bean.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see #addNotificationListener(NotificationListener, NotificationFilter,
+ * java.lang.Object)
+ * @see NotificationBroadcaster#removeNotificationListener(NotificationListener)
+ */
+ void removeNotificationListener(ObjectName name, ObjectName listener)
+ throws InstanceNotFoundException, ListenerNotFoundException,
+ IOException;
+
+ /**
+ * Removes the specified listener from the list of recipients
+ * of notifications from the supplied bean. Only the first instance with
+ * the supplied filter and passback object is removed.
+ * <code>null</code> is used as a valid value for these parameters,
+ * rather than as a way to remove all registration instances for
+ * the specified listener; for this behaviour instead, see
+ * {@link #removeNotificationListener(ObjectName, ObjectName)}.
+ *
+ * @param name the name of the management bean from which the
+ * listener should be removed.
+ * @param listener the name of the listener to remove.
+ * @param filter the filter of the listener to remove.
+ * @param passback the passback object of the listener to remove.
+ * @throws InstanceNotFoundException if a name doesn't match a registered
+ * bean.
+ * @throws ListenerNotFoundException if the specified listener
+ * is not registered with the bean.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see #addNotificationListener(ObjectName, NotificationListener,
+ * NotificationFilter, Object)
+ * @see NotificationEmitter#removeNotificationListener(NotificationListener,
+ * NotificationFilter,
+ * Object)
+ */
+ void removeNotificationListener(ObjectName name,
+ ObjectName listener,
+ NotificationFilter filter,
+ Object passback)
+ throws InstanceNotFoundException, ListenerNotFoundException,
+ IOException;
+
+ /**
+ * Sets the value of the specified attribute of the supplied
+ * management bean.
+ *
+ * @param name the name of the management bean.
+ * @param attribute the attribute to set.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws AttributeNotFoundException if the attribute does not
+ * correspond to an attribute
+ * of the bean.
+ * @throws InvalidAttributeValueException if the value is invalid
+ * for this particular
+ * attribute of the bean.
+ * @throws MBeanException if setting the attribute causes
+ * the bean to throw an exception (which
+ * becomes the cause of this exception).
+ * @throws ReflectionException if an exception occurred in trying
+ * to use the reflection interface
+ * to lookup the attribute. The
+ * thrown exception is the cause of
+ * this exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean or attribute
+ * name.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see #getAttribute(ObjectName, String)
+ * @see DynamicMBean#setAttribute(Attribute)
+ */
+ void setAttribute(ObjectName name, Attribute attribute)
+ throws InstanceNotFoundException, AttributeNotFoundException,
+ InvalidAttributeValueException, MBeanException,
+ ReflectionException, IOException;
+
+ /**
+ * Sets the value of each of the specified attributes
+ * of the supplied management bean to that specified by
+ * the {@link Attribute} object. The returned list contains
+ * the attributes that were set and their new values.
+ *
+ * @param name the name of the management bean.
+ * @param attributes the attributes to set.
+ * @return a list of the changed attributes.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws ReflectionException if an exception occurred in trying
+ * to use the reflection interface
+ * to lookup the attribute. The
+ * thrown exception is the cause of
+ * this exception.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean or attribute
+ * list.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ * @see #getAttributes(ObjectName, String[])
+ * @see DynamicMBean#setAttributes(AttributeList)
+ */
+ AttributeList setAttributes(ObjectName name, AttributeList attributes)
+ throws InstanceNotFoundException, ReflectionException,
+ IOException;
+
+ /**
+ * Unregisters the specified management bean. Following this operation,
+ * the bean instance is no longer accessible from the server via this
+ * name. Prior to unregistering the bean, the
+ * {@link MBeanRegistration#preDeregister()} method will be called if
+ * the bean implements the {@link MBeanRegistration} interface.
+ *
+ * @param name the name of the management bean.
+ * @throws InstanceNotFoundException if the bean can not be found.
+ * @throws MBeanRegistrationException if an exception occurs in
+ * calling the preDeregister
+ * method.
+ * @throws RuntimeOperationsException if an {@link IllegalArgumentException}
+ * is thrown by the server due to a
+ * <code>null</code> bean name or a
+ * request being made to unregister the
+ * {@link MBeanServerDelegate} bean.
+ * @throws IOException if an I/O error occurred in communicating with
+ * the bean server.
+ */
+ void unregisterMBean(ObjectName name)
+ throws InstanceNotFoundException, MBeanRegistrationException,
+ IOException;
+
+}
diff --git a/libjava/classpath/javax/management/MBeanServerDelegate.java b/libjava/classpath/javax/management/MBeanServerDelegate.java
new file mode 100644
index 00000000000..bf3f5f89420
--- /dev/null
+++ b/libjava/classpath/javax/management/MBeanServerDelegate.java
@@ -0,0 +1,308 @@
+/* MBeanServerDelegate.java -- The management server delegate.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+import gnu.classpath.ListenerData;
+import gnu.classpath.SystemProperties;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Provides an implementation of a delegate bean, which is associated
+ * with a management server. The delegate bean is responsible
+ * for providing metadata about the server and handling the
+ * registration and deregistration notifications.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class MBeanServerDelegate
+ implements MBeanServerDelegateMBean, NotificationEmitter
+{
+
+ /**
+ * The identifier of the server associated with this delegate.
+ */
+ private String id;
+
+ /**
+ * The listeners registered with the delegate.
+ */
+ private List listeners;
+
+ /**
+ * The sequence identifier used by the delegate.
+ */
+ private long seqNo;
+
+ /**
+ * Default constructor which generates the id.
+ */
+ public MBeanServerDelegate()
+ {
+ String hostName;
+ try
+ {
+ hostName = InetAddress.getLocalHost().getHostName();
+ }
+ catch (UnknownHostException e)
+ {
+ hostName = "Unknown host";
+ }
+ id = hostName + "_" + new Date().getTime();
+ }
+
+ /**
+ * Registers the specified listener as a new recipient of
+ * notifications from the delegate. If non-null, the filter
+ * argument will be used to select which notifications are
+ * delivered. The supplied object will also be passed to
+ * the recipient with each notification. This should not
+ * be modified by the broadcaster, but instead should be
+ * passed unmodified to the listener.
+ *
+ * @param listener the new listener, who will receive
+ * notifications from this broadcasting bean.
+ * @param filter a filter to determine which notifications are
+ * delivered to the listener, or <code>null</code>
+ * if no filtering is required.
+ * @param passback an object to be passed to the listener with
+ * each notification.
+ * @throws IllegalArgumentException if <code>listener</code> is
+ * <code>null</code>.
+ * @see #removeNotificationListener(NotificationListener)
+ */
+ public void addNotificationListener(NotificationListener listener,
+ NotificationFilter filter,
+ Object passback)
+ throws IllegalArgumentException
+ {
+ if (listener == null)
+ throw new IllegalArgumentException("A null listener was supplied.");
+ if (listeners == null)
+ listeners = new ArrayList();
+ listeners.add(new ListenerData(listener, filter, passback));
+ }
+
+ /**
+ * Returns the name of this Java Management eXtensions (JMX) implementation.
+ *
+ * @return the implementation name.
+ */
+ public String getImplementationName()
+ {
+ return "GNU JMX";
+ }
+
+ /**
+ * Returns the vendor of this Java Management eXtensions (JMX) implementation.
+ *
+ * @return the implementation vendor.
+ */
+ public String getImplementationVendor()
+ {
+ return "The GNU Classpath Project";
+ }
+
+ /**
+ * Returns the version of this Java Management eXtensions (JMX) implementation.
+ *
+ * @return the implementation version.
+ */
+ public String getImplementationVersion()
+ {
+ return SystemProperties.getProperty("gnu.classpath.version");
+ }
+
+ /**
+ * Returns the unique identifier for this management server.
+ *
+ * @return the unique id of the server.
+ */
+ public String getMBeanServerId()
+ {
+ return id;
+ }
+
+ /**
+ * Returns an array describing the notifications this
+ * bean may send to its registered listeners. Ideally, this
+ * array should be complete, but in some cases, this may
+ * not be possible. However, be aware that some listeners
+ * may expect this to be so.
+ *
+ * @return the array of possible notifications.
+ */
+ public MBeanNotificationInfo[] getNotificationInfo()
+ {
+ return new MBeanNotificationInfo[]
+ {
+ new MBeanNotificationInfo(new String[]
+ {
+ MBeanServerNotification.REGISTRATION_NOTIFICATION,
+ MBeanServerNotification.UNREGISTRATION_NOTIFICATION,
+ },
+ MBeanServerNotification.class.getName(),
+ "Server registration notifications")
+ };
+ }
+
+ /**
+ * Returns the name of this Java Management eXtensions (JMX) specification.
+ *
+ * @return the specification name.
+ */
+ public String getSpecificationName()
+ {
+ return "JMX";
+ }
+
+
+ /**
+ * Returns the vendor of this Java Management eXtensions (JMX) specification.
+ *
+ * @return the specification vendor.
+ */
+ public String getSpecificationVendor()
+ {
+ return "Sun Microsystems";
+ }
+
+ /**
+ * Returns the version of this Java Management eXtensions (JMX) specification.
+ *
+ * @return the specification version.
+ */
+ public String getSpecificationVersion()
+ {
+ return "1.2";
+ }
+
+ /**
+ * Removes the specified listener from the list of recipients
+ * of notifications from this bean. This includes all combinations
+ * of filters and passback objects registered for this listener.
+ * For more specific removal of listeners, see
+ * {@link #removeNotificationListener(NotificationListener,
+ * NotificationFilter, java.lang.Object)}
+ *
+ * @param listener the listener to remove.
+ * @throws ListenerNotFoundException if the specified listener
+ * is not registered with this bean.
+ * @see #addNotificationListener(NotificationListener, NotificationFilter,
+ * java.lang.Object)
+ */
+ public void removeNotificationListener(NotificationListener listener)
+ throws ListenerNotFoundException
+ {
+ Iterator it = listeners.iterator();
+ boolean foundOne = false;
+ while (it.hasNext())
+ {
+ ListenerData data = (ListenerData) it.next();
+ if (data.getListener() == listener)
+ {
+ it.remove();
+ foundOne = true;
+ }
+ }
+ if (!foundOne)
+ throw new ListenerNotFoundException("The specified listener, " + listener +
+ "is not registered with this bean.");
+ }
+
+ /**
+ * Removes the specified listener from the list of recipients
+ * of notifications from this delegate. Only the first instance with
+ * the supplied filter and passback object is removed.
+ * <code>null</code> is used as a valid value for these parameters,
+ * rather than as a way to remove all registration instances for
+ * the specified listener; for this behaviour instead, see
+ * {@link #removeNotificationListener(NotificationListener)}.
+ *
+ * @param listener the listener to remove.
+ * @param filter the filter of the listener to remove.
+ * @param passback the passback object of the listener to remove.
+ * @throws ListenerNotFoundException if the specified listener
+ * is not registered with this bean.
+ * @see #addNotificationListener(NotificationListener, NotificationFilter,
+ * java.lang.Object)
+ * @see #removeNotificationListener(NotificationListener)
+ */
+ public void removeNotificationListener(NotificationListener listener,
+ NotificationFilter filter,
+ Object passback)
+ throws ListenerNotFoundException
+ {
+ if (!(listeners.remove(new ListenerData(listener, filter, passback))))
+ {
+ throw new ListenerNotFoundException("The specified listener, " + listener +
+ " with filter " + filter +
+ "and passback " + passback +
+ ", is not registered with this bean.");
+ }
+ }
+
+ /**
+ * Allows the server to use the delegate to send a notification.
+ * If the supplied notification has a sequence number <= 0, then
+ * it is replaced with the delegate's own sequence number.
+ *
+ * @param notification the notification to send.
+ */
+ public void sendNotification(Notification notification)
+ {
+ if (notification.getSequenceNumber() <= 0)
+ notification.setSequenceNumber(++seqNo);
+ Iterator it = listeners.iterator();
+ while (it.hasNext())
+ {
+ ListenerData ldata = (ListenerData) it.next();
+ NotificationFilter filter = ldata.getFilter();
+ if (filter == null || filter.isNotificationEnabled(notification))
+ ldata.getListener().handleNotification(notification, ldata.getPassback());
+ }
+ }
+
+}
diff --git a/libjava/classpath/javax/management/MBeanServerDelegateMBean.java b/libjava/classpath/javax/management/MBeanServerDelegateMBean.java
new file mode 100644
index 00000000000..aa7b2730085
--- /dev/null
+++ b/libjava/classpath/javax/management/MBeanServerDelegateMBean.java
@@ -0,0 +1,101 @@
+/* MBeanServerDelegateMBean.java -- The interface of a management server delegate.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+/**
+ * Defines the interface for the delegate bean associated
+ * with a management server. The delegate bean is responsible
+ * for providing metadata about the server and handling the
+ * registration and deregistration notifications.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public interface MBeanServerDelegateMBean
+{
+
+ /**
+ * Returns the name of this Java Management eXtensions (JMX) implementation.
+ *
+ * @return the implementation name.
+ */
+ String getImplementationName();
+
+ /**
+ * Returns the vendor of this Java Management eXtensions (JMX) implementation.
+ *
+ * @return the implementation vendor.
+ */
+ String getImplementationVendor();
+
+ /**
+ * Returns the version of this Java Management eXtensions (JMX) implementation.
+ *
+ * @return the implementation version.
+ */
+ String getImplementationVersion();
+
+ /**
+ * Returns the unique identifier for this management server.
+ *
+ * @return the unique id of the server.
+ */
+ String getMBeanServerId();
+
+ /**
+ * Returns the name of this Java Management eXtensions (JMX) specification.
+ *
+ * @return the specification name.
+ */
+ String getSpecificationName();
+
+ /**
+ * Returns the vendor of this Java Management eXtensions (JMX) specification.
+ *
+ * @return the specification vendor.
+ */
+ String getSpecificationVendor();
+
+ /**
+ * Returns the version of this Java Management eXtensions (JMX) specification.
+ *
+ * @return the specification version.
+ */
+ String getSpecificationVersion();
+
+}
diff --git a/libjava/classpath/javax/management/MBeanServerFactory.java b/libjava/classpath/javax/management/MBeanServerFactory.java
new file mode 100644
index 00000000000..accbc56fc78
--- /dev/null
+++ b/libjava/classpath/javax/management/MBeanServerFactory.java
@@ -0,0 +1,413 @@
+/* MBeanServerFactory.java -- Manages server instances.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+import gnu.classpath.SystemProperties;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.management.loading.ClassLoaderRepository;
+
+/**
+ * <p>
+ * Creates and maintains a set of {@link MBeanServer} instances.
+ * Server instances, as of JMX 1.2, are created using a subclass
+ * of {@link MBeanServerBuilder}. The exact class used is controlled
+ * by the property <code>javax.management.builder.initial</code>,
+ * and allows the instances created by {@link MBeanServerBuilder}
+ * to be wrapped, thus providing additional functionality.
+ * </p>
+ * <p>
+ * The property is used as follows:
+ * </p>
+ * <ol>
+ * <li>If the property has no value, then an instance of
+ * {@link MBeanServerBuilder} is used.</li>
+ * <li>If a value is given, then:
+ * <ol>
+ * <li>The class is loaded using
+ * <code>Thread.currentThread().getContextClassLoader()</code>, or,
+ * if this is <code>null</code>, by <code>Class.forName()</code>.</li>
+ * <li><code>Class.newInstance()</code> is used to create an instance
+ * of the class. The class must be public and have a public empty
+ * constructor. If an exception is thrown, it is propogated as
+ * a {@link JMRuntimeException} and no new server instances may be
+ * created until the property is set to a valid value.</li>
+ * </ol></li>
+ * <li>The value is checked on each successive request for a server.
+ * If it differs from the class of the existing instance of
+ * {@link MBeanServerBuilder}, then the value is used to create
+ * a new instance.</li>
+ * </ol>
+ */
+public class MBeanServerFactory
+{
+
+ /**
+ * The last builder instance.
+ */
+ private static MBeanServerBuilder builder;
+
+ /**
+ * The map of registered servers (identifiers to servers).
+ */
+ private static Map servers;
+
+ /**
+ * Private constructor to prevent instance creation.
+ */
+ private MBeanServerFactory() {}
+
+ /**
+ * Returns a server implementation using the default domain name
+ * of <code>"DefaultDomain"</code>. The default domain name is
+ * used when the domain name specified by the user is <code>null</code.
+ * A reference to the created server is retained, so that it can
+ * be retrieved at a later date using {@link #findMBeanServer}.
+ * Calling this method is equivalent to calling
+ * {@link createMBeanServer(String)} with a <code>null</code> value.
+ *
+ * @return a new {@link MBeanServer} instance.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanServerPermission(String)}("createMBeanServer")
+ * @throws JMRuntimeException if the property
+ * <code>javax.management.builder.initial</code>
+ * exists but names a class which either can not be
+ * instantiated or provides an implementation that returns
+ * <code>null</code> from either
+ * {@link MBeanServerBuilder#newMBeanServerDelegate()}
+ * or {@link MBeanServerBuilder#newMBeanServer()}
+ * @throws ClassCastException if the property
+ * <code>javax.management.builder.initial</code>
+ * exists but names a class which is not a subclass
+ * of {@link MBeanServerBuilder}.
+ * @see #createMBeanServer(String)
+ */
+ public static MBeanServer createMBeanServer()
+ {
+ return createMBeanServer(null);
+ }
+
+ /**
+ * Returns a server implementation using the default domain name
+ * given, or <code>"DefaultDomain"</code> if this is <code>null</code>.
+ * The default domain name is used when the domain name specified by
+ * the user is <code>null</code. A reference to the created server is
+ * retained, so that it can be retrieved at a later date using
+ * {@link #findMBeanServer}.
+ *
+ * @param domain the default domain name of the server.
+ * @return a new {@link MBeanServer} instance.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanServerPermission(String)}("createMBeanServer")
+ * @throws JMRuntimeException if the property
+ * <code>javax.management.builder.initial</code>
+ * exists but names a class which either can not be
+ * instantiated or provides an implementation that returns
+ * <code>null</code> from either
+ * {@link MBeanServerBuilder#newMBeanServerDelegate()}
+ * or {@link MBeanServerBuilder#newMBeanServer()}
+ * @throws ClassCastException if the property
+ * <code>javax.management.builder.initial</code>
+ * exists but names a class which is not a subclass
+ * of {@link MBeanServerBuilder}.
+ */
+ public static MBeanServer createMBeanServer(String domain)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ sm.checkPermission(new MBeanServerPermission("createMBeanServer"));
+ MBeanServer server = createServer(domain);
+ if (servers == null)
+ servers = new HashMap();
+ try
+ {
+ ObjectName dn = new
+ ObjectName("JMImplementation:type=MBeanServerDelegate");
+ servers.put(server.getAttribute(dn, "MBeanServerId"), server);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw (Error)
+ (new InternalError("Malformed delegate bean name.").initCause(e));
+ }
+ catch (MBeanException e)
+ {
+ throw (Error)
+ (new InternalError("Exception in getMBeanServerId().").initCause(e));
+ }
+ catch (AttributeNotFoundException e)
+ {
+ throw (Error)
+ (new InternalError("Could not find MBeanServerId attribute.").initCause(e));
+ }
+ catch (InstanceNotFoundException e)
+ {
+ throw (Error)
+ (new InternalError("Could not find the delegate bean.").initCause(e));
+ }
+ catch (ReflectionException e)
+ {
+ throw (Error)
+ (new InternalError("Could not call getMBeanServerId().").initCause(e));
+ }
+ return server;
+ }
+
+ /**
+ * Returns the specified server, or, if <code>id</code> is <code>null</code>,
+ * a list of all registered servers. A registered server is one that
+ * was created using {@link #createMBeanServer()} or
+ * {@link #createMBeanServer(String)} and has not yet been released
+ * using {@link releaseMBeanServer(MBeanServer)}.
+ *
+ * @param id the id of the server to retrieve, or <code>null</code>
+ * to return all servers.
+ * @return a list of {@link MBeanServer}s.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanServerPermission(String)}("findMBeanServer")
+ */
+ public static ArrayList findMBeanServer(String id)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ sm.checkPermission(new MBeanServerPermission("findMBeanServer"));
+ if (id == null)
+ return new ArrayList(servers.values());
+ ArrayList list = new ArrayList();
+ MBeanServer server = (MBeanServer) servers.get(id);
+ if (server != null)
+ list.add(servers.get(id));
+ return list;
+ }
+
+ /**
+ * Returns the class loader repository used by the specified server.
+ * This is equivalent to calling {@link MBeanServer#getClassLoaderRepository()}
+ * on the given server.
+ *
+ * @param server the server whose class loader repository should be
+ * retrieved.
+ * @throws NullPointerException if <code>server</code> is <code>null</code>.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanPermission(String,String,ObjectName,String)
+ * <code>MBeanPermission(null, null, null,
+ * "getClassLoaderRepository")</code>
+ */
+ public static ClassLoaderRepository getClassLoaderRepository(MBeanServer server)
+ {
+ return server.getClassLoaderRepository();
+ }
+
+ /**
+ * Returns a server implementation using the default domain name
+ * of <code>"DefaultDomain"</code>. The default domain name is
+ * used when the domain name specified by the user is <code>null</code.
+ * No reference to the created server is retained, so the server is
+ * garbage collected when it is no longer used, but it can not be
+ * retrieved at a later date using {@link #findMBeanServer}.
+ * Calling this method is equivalent to calling
+ * {@link newMBeanServer(String)} with a <code>null</code> value.
+ *
+ * @return a new {@link MBeanServer} instance.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanServerPermission(String)}("newMBeanServer")
+ * @throws JMRuntimeException if the property
+ * <code>javax.management.builder.initial</code>
+ * exists but names a class which either can not be
+ * instantiated or provides an implementation that returns
+ * <code>null</code> from either
+ * {@link MBeanServerBuilder#newMBeanServerDelegate()}
+ * or {@link MBeanServerBuilder#newMBeanServer()}
+ * @throws ClassCastException if the property
+ * <code>javax.management.builder.initial</code>
+ * exists but names a class which is not a subclass
+ * of {@link MBeanServerBuilder}.
+ * @see #newMBeanServer(String)
+ */
+ public static MBeanServer newMBeanServer()
+ {
+ return newMBeanServer(null);
+ }
+
+ /**
+ * Returns a server implementation using the default domain name
+ * given, or <code>"DefaultDomain"</code> if this is <code>null</code>.
+ * The default domain name is used when the domain name specified by
+ * the user is <code>null</code. No reference to the created server is
+ * retained, so the server is garbage collected when it is no longer
+ * used, but it can not be retrieved at a later date using
+ * {@link #findMBeanServer}.
+ *
+ * @param domain the default domain name of the server.
+ * @return a new {@link MBeanServer} instance.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanServerPermission(String)}("newMBeanServer")
+ * @throws JMRuntimeException if the property
+ * <code>javax.management.builder.initial</code>
+ * exists but names a class which either can not be
+ * instantiated or provides an implementation that returns
+ * <code>null</code> from either
+ * {@link MBeanServerBuilder#newMBeanServerDelegate()}
+ * or {@link MBeanServerBuilder#newMBeanServer()}
+ * @throws ClassCastException if the property
+ * <code>javax.management.builder.initial</code>
+ * exists but names a class which is not a subclass
+ * of {@link MBeanServerBuilder}.
+ */
+ public static MBeanServer newMBeanServer(String domain)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ sm.checkPermission(new MBeanServerPermission("newMBeanServer"));
+ return createServer(domain);
+ }
+
+ /**
+ * Common method to create a server for the {@link #createMBeanServer(String)}
+ * and {@link #newMBeanServer(String)} methods above.
+ *
+ * @param domain the default domain name of the server.
+ * @throws JMRuntimeException if the property
+ * <code>javax.management.builder.initial</code>
+ * exists but names a class which either can not be
+ * instantiated or provides an implementation that returns
+ * <code>null</code> from either
+ * {@link MBeanServerBuilder#newMBeanServerDelegate()}
+ * or {@link MBeanServerBuilder#newMBeanServer()}
+ * @throws ClassCastException if the property
+ * <code>javax.management.builder.initial</code>
+ * exists but names a class which is not a subclass
+ * of {@link MBeanServerBuilder}.
+ */
+ private static MBeanServer createServer(String domain)
+ {
+ if (domain == null)
+ domain = "DefaultDomain";
+ String builderClass =
+ SystemProperties.getProperty("javax.management.builder.initial");
+ if (builderClass == null)
+ {
+ if (builder == null ||
+ builder.getClass() != MBeanServerBuilder.class)
+ builder = new MBeanServerBuilder();
+ }
+ else if (!(builderClass.equals(builder.getClass().getName())))
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ if (cl == null)
+ cl = MBeanServerFactory.class.getClassLoader();
+ try
+ {
+ Class bClass = Class.forName(builderClass, true, cl);
+ builder = (MBeanServerBuilder) bClass.newInstance();
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw (JMRuntimeException) (new JMRuntimeException("The builder class, "
+ + builderClass +
+ ", could not be found."))
+ .initCause(e);
+ }
+ catch (InstantiationException e)
+ {
+ throw (JMRuntimeException) (new JMRuntimeException("The builder class, "
+ + builderClass +
+ ", could not be instantiated."))
+ .initCause(e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw (JMRuntimeException) (new JMRuntimeException("The builder class, "
+ + builderClass +
+ ", could not be accessed."))
+ .initCause(e);
+ }
+ }
+ MBeanServerDelegate delegate = builder.newMBeanServerDelegate();
+ if (delegate == null)
+ throw new JMRuntimeException("A delegate could not be created.");
+ MBeanServer server = builder.newMBeanServer("DefaultDomain", null, delegate);
+ if (server == null)
+ throw new JMRuntimeException("A server could not be created.");
+ return server;
+ }
+
+ /**
+ * Removes the reference to the specified server, thus allowing it to
+ * be garbage collected.
+ *
+ * @param server the server to remove.
+ * @throws IllegalArgumentException if a reference to the server is not
+ * held (i.e. it wasn't created by
+ * {@link #createMBeanServer(String)}
+ * or this method has already been called
+ * on it.
+ * @throws SecurityException if a security manager exists and the
+ * caller's permissions don't imply {@link
+ * MBeanServerPermission(String)}("releaseMBeanServer")
+ */
+ public static void releaseMBeanServer(MBeanServer server)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ sm.checkPermission(new MBeanServerPermission("releaseMBeanServer"));
+ Iterator i = servers.values().iterator();
+ while (i.hasNext())
+ {
+ MBeanServer s = (MBeanServer) i.next();
+ if (server == s)
+ {
+ i.remove();
+ return;
+ }
+ }
+ throw new IllegalArgumentException("The server given is not referenced.");
+ }
+
+
+}
diff --git a/libjava/classpath/javax/management/MBeanServerNotification.java b/libjava/classpath/javax/management/MBeanServerNotification.java
new file mode 100644
index 00000000000..820fd61b354
--- /dev/null
+++ b/libjava/classpath/javax/management/MBeanServerNotification.java
@@ -0,0 +1,103 @@
+/* MBeanServerNotification.java -- The registration notification.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+/**
+ * The notification emitted by a management server on a registration
+ * or de-registration event. Events are emitted via the delegate
+ * management bean of the server. Other objects can listen for
+ * such events by registering their interest with the delegate
+ * bean. The bean can be obtained via the {@link ObjectName}
+ * <code>JMImplementation:type=MBeanServerDelegate</code>.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class MBeanServerNotification
+ extends Notification
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = 2876477500475969677L;
+
+ /**
+ * Notification type for the registration event.
+ */
+ public static final String REGISTRATION_NOTIFICATION = "JMX.mbean.registered";
+
+ /**
+ * Notification type for the de-registration event.
+ */
+ public static final String UNREGISTRATION_NOTIFICATION = "JMX.mbean.unregistered";
+
+ /**
+ * The name of the bean which forms the subject of this notification.
+ */
+ private ObjectName objectName;
+
+ /**
+ * Constructs a new {@link MBeanServerNotification} of the specified
+ * type for an event relating to the supplied bean, with the given
+ * source and sequence number.
+ *
+ * @param type the type of notification (registration or de-registration).
+ * @param source the source of the notification.
+ * @param seqNo the sequence number of this notification, used to order
+ * multiple such notifications.
+ * @param name the name of the bean concerned by this event.
+ */
+ public MBeanServerNotification(String type, Object source, long seqNo,
+ ObjectName name)
+ {
+ super(type, source, seqNo);
+ objectName = name;
+ }
+
+ /**
+ * Returns the name of the bean this notification concerns.
+ *
+ * @return the name of the bean.
+ */
+ public ObjectName getMBeanName()
+ {
+ return objectName;
+ }
+
+}
diff --git a/libjava/classpath/javax/management/MBeanServerPermission.java b/libjava/classpath/javax/management/MBeanServerPermission.java
new file mode 100644
index 00000000000..e6227814443
--- /dev/null
+++ b/libjava/classpath/javax/management/MBeanServerPermission.java
@@ -0,0 +1,470 @@
+/* MBeanServerPermission.java -- Permissions controlling server creation.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+import java.security.BasicPermission;
+import java.security.Permission;
+import java.security.PermissionCollection;
+
+import java.util.Enumeration;
+import java.util.NoSuchElementException;
+
+/**
+ * <p>
+ * Represents the permissions required to perform
+ * operations provided by the {@link MBeanServerFactory}.
+ * As with all {@link java.security.Permission} objects, an
+ * instance of this class either represents a permission
+ * already held or one that is required to access a
+ * particular service. In the case of {@link MBeanServerPermission}s,
+ * implication checks are made using an instance of this class
+ * when a user requests an operation from the factory, and a
+ * {@link SecurityManager} is in place.
+ * </p>
+ * <p>
+ * The permission is defined by its name, which may be
+ * either a <code>'*'</code> (to allow all) or one or
+ * more of the following, separated by a <code>','</code>:
+ * </p>
+ * <ul>
+ * <li><code>createMBeanServer</code> -- allows a registered
+ * instance of a server to be obtained from the factory.</li>
+ * <li><code>findMBeanServer</code> -- allows all or one
+ * particular server instance to be retrieved from the factory.</li>
+ * <li><code>newMBeanServer</code> -- allows an unregistered
+ * instance of a server to be obtained from the factory.</li>
+ * <li><code>releaseMBeanServer</code> -- allows a reference to
+ * a server instance to be removed from the factory.</li>
+ * </ul>
+ * <p>
+ * The names may be surrounded by arbitrary amounts of whitespace.
+ * <code>createMBeanServer</code> implies <code>newMBeanServer</code>.
+ * </p>
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class MBeanServerPermission
+ extends BasicPermission
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = -5661980843569388590L;
+
+ /**
+ * <p>
+ * Constructs a new {@link MBeanServerPermission} with
+ * the given name. The name must not be <code>null</code>
+ * and must be equal to either <code>"*"</code> or a
+ * comma-separated list of valid permissions. The four
+ * valid constraints are:
+ * </p>
+ * <ol>
+ * <li><code>createMBeanServer</code></li>
+ * <li><code>findMBeanServer</code></li>
+ * <li><code>newMBeanServer</code></li>
+ * <li><code>releaseMBeanServer</code></li>
+ * </ol>
+ * <p>
+ * Calling this constructor is equivalent to calling
+ * <code>MBeanPermission(name, null)</code>.
+ * </p>
+ *
+ * @param name the name of this permission.
+ * @throws NullPointerException if <code>name</code>
+ * is <code>null</code>.
+ * @throws IllegalArgumentException if <code>name</code>
+ * is not either equal to
+ * <code>"*"</code> or forms
+ * a comma-separated list of
+ * valid constraints.
+ * @see #MBeanServerPermission(String,String)
+ */
+ public MBeanServerPermission(String name)
+ {
+ this(name, null);
+ }
+
+ /**
+ * <p>
+ * Constructs a new {@link MBeanServerPermission} with
+ * the given name and actions. The actions are unused,
+ * and must be either <code>null</code> or the empty
+ * string. The name must not be <code>null</code>
+ * and must be equal to either <code>"*"</code> or a
+ * comma-separated list of valid permissions. The four
+ * valid constraints are:
+ * </p>
+ * <ol>
+ * <li><code>createMBeanServer</code></li>
+ * <li><code>findMBeanServer</code></li>
+ * <li><code>newMBeanServer</code></li>
+ * <li><code>releaseMBeanServer</code></li>
+ * </ol>
+ * <p>
+ * Calling this constructor is equivalent to calling
+ * <code>MBeanPermission(name, null)</code>.
+ * </p>
+ *
+ * @param name the name of this permission.
+ * @throws NullPointerException if <code>name</code>
+ * is <code>null</code>.
+ * @throws IllegalArgumentException if <code>name</code>
+ * is not either equal to
+ * <code>"*"</code> or forms
+ * a comma-separated list of
+ * valid constraints, or if
+ * <code>actions</code> is not
+ * <code>null</code> or the
+ * empty string.
+ * @see #MBeanServerPermission(String,String)
+ */
+ public MBeanServerPermission(String name, String actions)
+ {
+ super(checkName(name), actions);
+ if (actions != null && actions.length() > 0)
+ throw new IllegalArgumentException("The supplied action list " +
+ "was not equal to null or the " +
+ "empty string.");
+ }
+
+ /**
+ * Returns true if the given object is also an {@link MBeanServerPermission}
+ * with the same name.
+ *
+ * @param obj the object to compare with this one.
+ * @return true if the object is an {@link MBeanPermission}
+ * with the same name.
+ */
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof MBeanServerPermission)
+ {
+ MBeanServerPermission o = (MBeanServerPermission) obj;
+ return o.getName().equals(getName());
+ }
+ return false;
+ }
+
+ /**
+ * Returns a unique hash code for this permission.
+ * This is simply the hashcode of {@link BasicPermission#getName()}.
+ *
+ * @return the hashcode of this permission.
+ */
+ public int hashCode()
+ {
+ return getName().hashCode();
+ }
+
+ /**
+ * Returns true if this {@link MBeanServerPermission} implies
+ * the given permission. This occurs if the given permission
+ * is also an {@link MBeanServerPermission} and its target names
+ * are a subset of the target names of this permission. Note that
+ * the name <code>createMBeanServer</code> implies
+ * <code>newMBeanServer</code>.
+ *
+ * @param p the permission to check for implication.
+ * @return true if this permission implies <code>p</code>.
+ */
+ public boolean implies(Permission p)
+ {
+ if (p instanceof MBeanServerPermission)
+ {
+ if (getName().equals("*"))
+ return true;
+ MBeanServerPermission msp = (MBeanServerPermission) p;
+ String[] thisCaps = getName().split(",");
+ String[] mspCaps = msp.getName().split(",");
+ for (int a = 0; a < mspCaps.length; ++a)
+ {
+ boolean found = false;
+ String mc = mspCaps[a].trim();
+ for (int b = 0; b < thisCaps.length; ++b)
+ {
+ String tc = thisCaps[b].trim();
+ if (tc.equals(mc))
+ found = true;
+ if (tc.equals("createMBeanServer") &&
+ mc.equals("newMBeanServer"))
+ found = true;
+ }
+ if (!found)
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns a {@link PermissionCollection} which stores
+ * a series of {@link MBeanServerPermission}s as the union
+ * of their capabilities.
+ *
+ * @return a collection for {@link MBeanServerPermission}s.
+ */
+ public PermissionCollection newPermissionCollection()
+ {
+ return new MBeanServerPermissionCollection();
+ }
+
+ /**
+ * A collection of {@link MBeanServerPermission}s, stored
+ * as a single permission with the union of the capabilities
+ * as its capabilities.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+ private class MBeanServerPermissionCollection
+ extends PermissionCollection
+ {
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = -5661980843569388590L;
+
+ /**
+ * The collected permission. This is <code>null</code> or
+ * the union of the permissions held by all the collected
+ * permissions.
+ */
+ private MBeanServerPermission collectionPermission;
+
+ /**
+ * Adds a new permission by unifying it with the existing
+ * collection permission.
+ *
+ * @param p the permission to add.
+ * @throws SecurityException if the collection is read only.
+ * @see #isReadOnly()
+ * @see #setReadOnly(boolean)
+ */
+ public void add(Permission p)
+ {
+ if (isReadOnly())
+ throw new SecurityException("This collection is read only.");
+ if (p instanceof MBeanServerPermission)
+ {
+ MBeanServerPermission msp = (MBeanServerPermission) p;
+ if (collectionPermission == null)
+ collectionPermission = msp;
+ else
+ {
+ String finalString = collectionPermission.getName();
+ String[] cp = finalString.split(",");
+ String[] np = msp.getName().split(",");
+ int createms = finalString.indexOf("createMBeanServer");
+ int newms = finalString.indexOf("newMBeanServer");
+ for (int a = 0; a < np.length; ++a)
+ {
+ boolean found = false;
+ String nps = np[a].trim();
+ for (int b = 0; b < cp.length; ++b)
+ {
+ String cps = cp[b].trim();
+ if (cps.equals(nps))
+ found = true;
+ if (np.equals("newMBeanServer")
+ && createms != -1)
+ found = true;
+ if (np.equals("createMBeanServer")
+ && newms != -1)
+ finalString.replace("newMBeanServer",
+ "createMBeanServer");
+ }
+ if (!found)
+ finalString += "," + nps;
+ }
+ collectionPermission =
+ new MBeanServerPermission(finalString);
+ }
+ }
+ }
+
+ /**
+ * Returns an enumeration over the single permission.
+ *
+ * @return an enumeration over the collection permission.
+ */
+ public Enumeration elements()
+ {
+ return new
+ MBeanServerPermissionEnumeration(collectionPermission);
+ }
+
+ /**
+ * Provides an enumeration over a comma-separated list
+ * of capabilities.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+ private class MBeanServerPermissionEnumeration
+ implements Enumeration
+ {
+
+ /**
+ * The collected permission.
+ */
+ private MBeanServerPermission p;
+
+ /**
+ * True if we have returned the permission.
+ */
+ private boolean done;
+
+ /**
+ * Constructs a new {@link MBeanServerPermissionEnumeration}
+ * using the given collected permission.
+ *
+ * @param p the collected permission.
+ */
+ public MBeanServerPermissionEnumeration(MBeanServerPermission p)
+ {
+ this.p = p;
+ done = false;
+ }
+
+ /**
+ * Returns true if there are more capabilities to return.
+ *
+ * @return true if there are more capabilities available.
+ */
+ public boolean hasMoreElements()
+ {
+ return !done;
+ }
+
+ /**
+ * Returns the next capability.
+ *
+ * @return the next capability.
+ */
+ public Object nextElement()
+ {
+ if (hasMoreElements())
+ {
+ done = true;
+ return p;
+ }
+ else
+ throw new NoSuchElementException("No more elements are available.");
+ }
+
+ }
+
+ /**
+ * Returns true if the collected {@link MBeanServerPermission}
+ * implies the given permission. This occurs if the given permission
+ * is also an {@link MBeanServerPermission} and its target names
+ * are a subset of the target names of this permission. Note that
+ * the name <code>createMBeanServer</code> implies
+ * <code>newMBeanServer</code>.
+ *
+ * @param p the permission to check for implication.
+ * @return true if this permission implies <code>p</code>.
+ */
+ public boolean implies(Permission p)
+ {
+ return collectionPermission.implies(p);
+ }
+ }
+
+ /**
+ * Checks the name is valid, including removing
+ * the <code>newMBeanServer</code> permission when
+ * <code>createMBeanServer</code> is present.
+ *
+ * @param name the name to check.
+ * @throws NullPointerException if <code>name</code>
+ * is <code>null</code>.
+ * @throws IllegalArgumentException if <code>name</code>
+ * is not either equal to
+ * <code>"*"</code> or forms
+ * a comma-separated list of
+ * valid constraints.
+ */
+ private static String checkName(String name)
+ {
+ if (!(name.equals("*")))
+ {
+ String[] constraints = name.split(",");
+ name = "";
+ boolean seenCreate = false;
+ boolean seenNew = false;
+ boolean start = true;
+ for (int a = 0; a < constraints.length; ++a)
+ {
+ String next = constraints[a].trim();
+ if (!(next.equals("createMBeanServer") ||
+ next.equals("findMBeanServer") ||
+ next.equals("newMBeanServer") ||
+ next.equals("releaseMBeanServer")))
+ throw new IllegalArgumentException("An invalid constraint, " +
+ next + ", was specified.");
+ if (next.equals("newMBeanServer"))
+ seenNew = true;
+ else if (next.equals("createMBeanServer"))
+ seenCreate = true;
+ else
+ {
+ if (!start)
+ name += ",";
+ name += next;
+ start = false;
+ }
+ }
+ if (seenNew && !seenCreate)
+ name += (start ? "" : ",") + "newMBeanServer";
+ else if (seenCreate)
+ name += (start ? "" : ",") + "createMBeanServer";
+ }
+ return name;
+ }
+
+}
+
+
+
+
diff --git a/libjava/classpath/javax/management/MBeanTrustPermission.java b/libjava/classpath/javax/management/MBeanTrustPermission.java
new file mode 100644
index 00000000000..57d0e6889b0
--- /dev/null
+++ b/libjava/classpath/javax/management/MBeanTrustPermission.java
@@ -0,0 +1,105 @@
+/* MBeanTrustPermission.java -- Represents a trusted bean source.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+import java.security.BasicPermission;
+
+/**
+ * Represents the permission held by a trusted source of
+ * management beans. For a bean to be added to a management
+ * server, the source of that bean must hold this permission.
+ * It has a target, but no actions. Valid values for the target
+ * are <code>"register"</code> and <code>"*"</code>, the latter
+ * representing both the existing <code>"register"</code> target
+ * and any future targets.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class MBeanTrustPermission
+ extends BasicPermission
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = -2952178077029018140L;
+
+ /**
+ * Constructs a {@link MBeanTrustPermission} with the given target.
+ * The target must be either <code>"register"</code> or <code>"*"</code>.
+ * The actions of the permission default to <code>null</code>,
+ * so this is equivalent to calling
+ * <code>MBeanTrustPermission(target, null)</code>.
+ *
+ * @param target the target of this permission.
+ * @throws NullPointerException if <code>target</code> is null.
+ * @throws IllegalArgumentException if the target is other than
+ * <code>"register"</code> or <code>"*"</code>.
+ * @see #MBeanTrustPermission(String, String)
+ */
+ public MBeanTrustPermission(String target)
+ {
+ this(target, null);
+ }
+
+ /**
+ * Constructs a {@link MBeanTrustPermission} with the given target
+ * and actions. The target must be either <code>"register"</code>
+ * or <code>"*"</code>. The actions must be either <code>null</code>
+ * or the empty string, <code>""</code>.
+ *
+ * @param target the target of this permission.
+ * @param actions the actions for this permission.
+ * @throws NullPointerException if <code>target</code> is null.
+ * @throws IllegalArgumentException if the target is other than
+ * <code>"register"</code> or <code>"*"</code>
+ * or actions is other than
+ * <code>null</code> or <code>""</code>.
+ */
+ public MBeanTrustPermission(String target, String actions)
+ {
+ super(target, actions);
+ if ((!(target.equals("register"))) &&
+ (!(target.equals("*"))))
+ throw new IllegalArgumentException("The target must be 'register' or '*'");
+ if (actions != null && !(actions.length() == 0))
+ throw new IllegalArgumentException("The actions must be null or ''");
+ }
+
+}
diff --git a/libjava/classpath/javax/management/MalformedObjectNameException.java b/libjava/classpath/javax/management/MalformedObjectNameException.java
new file mode 100644
index 00000000000..e2f5774908c
--- /dev/null
+++ b/libjava/classpath/javax/management/MalformedObjectNameException.java
@@ -0,0 +1,76 @@
+/* MalformedObjectNameException.java -- Thrown by invalid values.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+/**
+ * Thrown when a string used as an {@link ObjectName}
+ * is invalid.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class MalformedObjectNameException
+ extends OperationsException
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = -572689714442915824L;
+
+ /**
+ * Constructs a new <code>MalformedObjectNameException</code>.
+ */
+ public MalformedObjectNameException()
+ {
+ super();
+ }
+
+ /**
+ * Constructs a new <code>MalformedObjectNameException</code>
+ * with the specified message.
+ *
+ * @param message the error message to give to the user.
+ */
+ public MalformedObjectNameException(String message)
+ {
+ super(message);
+ }
+
+}
+
diff --git a/libjava/classpath/javax/management/ObjectInstance.java b/libjava/classpath/javax/management/ObjectInstance.java
new file mode 100644
index 00000000000..df364cffc89
--- /dev/null
+++ b/libjava/classpath/javax/management/ObjectInstance.java
@@ -0,0 +1,147 @@
+/* ObjectInstance.java -- Represent the bean instance used by a server.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+import java.io.Serializable;
+
+/**
+ * A simple class used to link a bean instance to its class name.
+ * If the bean is a {@link DynamicMBean}, the class name may be
+ * obtained using {@link MBeanInfo#getClassName()}.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class ObjectInstance
+ implements Serializable
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = -4099952623687795850L;
+
+ /**
+ * The name of the bean.
+ */
+ private ObjectName name;
+
+ /**
+ * The class name of the bean.
+ */
+ private String className;
+
+ /**
+ * Constructs a new {@link ObjectInstance} for the specified bean
+ * with the supplied class name. The class name should include
+ * the full package name.
+ *
+ * @param name the name of the bean.
+ * @param className the class name of the bean.
+ */
+ public ObjectInstance(ObjectName name, String className)
+ {
+ this.name = name;
+ this.className = className;
+ }
+
+ /**
+ * Constructs a new {@link ObjectInstance} for the specified bean
+ * with the supplied class name. The class name should include
+ * the full package name.
+ *
+ * @param name the name of the bean.
+ * @param className the class name of the bean.
+ * @throws MalformedObjectNameException if the name of the bean
+ * does not match the syntax
+ * of an {@link ObjectName}.
+ */
+ public ObjectInstance(String name, String className)
+ throws MalformedObjectNameException
+ {
+ this(new ObjectName(name), className);
+ }
+
+ /**
+ * Returns true if the supplied object is also an {@link ObjectInstance}
+ * with the same bean and class name.
+ *
+ * @param obj the object to compare.
+ * @return true if the the supplied object is equal to <code>this</code>.
+ */
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof ObjectInstance))
+ return false;
+ ObjectInstance i = (ObjectInstance) obj;
+ return (i.getClassName().equals(className) &&
+ i.getObjectName().equals(name));
+ }
+
+ /**
+ * Returns the class name of the bean.
+ *
+ * @return the class name.
+ */
+ public String getClassName()
+ {
+ return className;
+ }
+
+ /**
+ * Returns the name of the bean.
+ *
+ * @return the name of the bean.
+ */
+ public ObjectName getObjectName()
+ {
+ return name;
+ }
+
+ /**
+ * Returns a hash code for this instance. This is calculated as
+ * the sum of the hashcodes for the bean's name and the class name.
+ *
+ * @return the hash code of this instance.
+ */
+ public int hashCode()
+ {
+ return name.hashCode() + className.hashCode();
+ }
+
+}
diff --git a/libjava/classpath/javax/management/ObjectName.java b/libjava/classpath/javax/management/ObjectName.java
new file mode 100644
index 00000000000..0e6bf2fd9cf
--- /dev/null
+++ b/libjava/classpath/javax/management/ObjectName.java
@@ -0,0 +1,775 @@
+/* ObjectName.java -- Represent the name of a bean, or a pattern for a name.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+import java.io.Serializable;
+
+import java.util.Collections;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * <p>
+ * An {@link ObjectName} instance represents the name of a management
+ * bean, or a pattern which may match the name of one or more
+ * management beans. Patterns are distinguished from names by the
+ * presence of the '?' and '*' characters (which match a single
+ * character and a series of zero or more characters, respectively).
+ * </p>
+ * <p>
+ * Each name begins with a domain element, which is terminated by
+ * a ':' character. The domain may be empty. If so, it will be
+ * replaced by the default domain of the bean server in certain
+ * contexts. The domain is a pattern, if it contains either '?'
+ * or '*'. To avoid collisions, it is usual to use reverse
+ * DNS names for the domain, as in Java package and property names.
+ * </p>
+ * <p>
+ * Following the ':' character is a series of properties. The list
+ * is separated by commas, and largely consists of unordered key-value
+ * pairs, separated by an equals sign ('='). At most one element may
+ * be an asterisk ('*'), which turns the {@link ObjectName} instance
+ * into a <emph>property pattern</emph>. In this situation, the pattern
+ * matches a name if the name contains at least those key-value pairs
+ * given and has the same domain.
+ * </p>
+ * <p>
+ * A <emph>key</emph> is a string of characters which doesn't include
+ * any of those used as delimiters or in patterns (':', '=', ',', '?'
+ * and '*'). Keys must be unique.
+ * </p>
+ * <p>
+ * A value may be <emph>quoted</emph> or <emph>unquoted</emph>. Unquoted
+ * values obey the same rules as given for keys above. Quoted values are
+ * surrounded by quotation marks ("), and use a backslash ('\') character
+ * to include quotes ('\"'), backslashes ('\\'), newlines ('\n'), and
+ * the pattern characters ('\?' and '\*'). The quotes and backslashes
+ * (after expansion) are considered part of the value.
+ * </p>
+ * <p>
+ * Spaces are maintained within the different parts of the name. Thus,
+ * '<code>domain: key1 = value1 </code>' has a key ' key1 ' with value
+ * ' value1 '. Newlines are disallowed, except where escaped in quoted
+ * values.
+ * </p>
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class ObjectName
+ implements Serializable, QueryExp
+{
+
+ /**
+ * The domain of the name.
+ */
+ private String domain;
+
+ /**
+ * The properties, as key-value pairs.
+ */
+ private TreeMap properties;
+
+ /**
+ * The properties as a string (stored for ordering).
+ */
+ private String propertyListString;
+
+ /**
+ * True if this object name is a property pattern.
+ */
+ private boolean propertyPattern;
+
+ /**
+ * The management server associated with this object name.
+ */
+ private MBeanServer server;
+
+ /**
+ * Constructs an {@link ObjectName} instance from the given string,
+ * which should be of the form
+ * &lt;domain&gt;:&lt;properties&gt;&lt;wild&gt;. &lt;domain&gt;
+ * represents the domain section of the name. &lt;properties&gt;
+ * represents the key-value pairs, as returned by {@link
+ * #getKeyPropertyListString()}. &lt;wild&gt; is the optional
+ * asterisk present in the property list. If the string doesn't
+ * represent a property pattern, it will be empty. If it does,
+ * it will be either ',*' or '*', depending on whether other
+ * properties are present or not, respectively.
+ *
+ * @param name the string to use to construct this instance.
+ * @throws MalformedObjectNameException if the string is of the
+ * wrong format.
+ * @throws NullPointerException if <code>name</code> is
+ * <code>null</code>.
+ */
+ public ObjectName(String name)
+ throws MalformedObjectNameException
+ {
+ int domainSep = name.indexOf(':');
+ if (domainSep == -1)
+ throw new MalformedObjectNameException("No domain separator was found.");
+ domain = name.substring(0, domainSep);
+ String rest = name.substring(domainSep + 1);
+ if (rest.equals("*"))
+ propertyPattern = true;
+ else
+ {
+ if (rest.endsWith(",*"))
+ {
+ propertyPattern = true;
+ propertyListString = rest.substring(0, rest.length() - 2);
+ }
+ else
+ propertyListString = rest;
+ String[] pairs = propertyListString.split(",");
+ if (pairs.length == 0 && !isPattern())
+ throw new MalformedObjectNameException("A name that is not a " +
+ "pattern must contain at " +
+ "least one key-value pair.");
+ properties = new TreeMap();
+ for (int a = 0; a < pairs.length; ++a)
+ {
+ int sep = pairs[a].indexOf('=');
+ String key = pairs[a].substring(0, sep);
+ if (properties.containsKey(key))
+ throw new MalformedObjectNameException("The same key occurs " +
+ "more than once.");
+ properties.put(key, pairs[a].substring(sep + 1));
+ }
+ }
+ checkComponents();
+ }
+
+ /**
+ * Constructs an {@link ObjectName} instance using the given
+ * domain and the one specified property.
+ *
+ * @param domain the domain part of the object name.
+ * @param key the key of the property.
+ * @param value the value of the property.
+ * @throws MalformedObjectNameException the domain, key or value
+ * contains an illegal
+ * character or the value
+ * does not follow the quoting
+ * specifications.
+ * @throws NullPointerException if one of the parameters is
+ * <code>null</code>.
+ */
+ public ObjectName(String domain, String key, String value)
+ throws MalformedObjectNameException
+ {
+ this.domain = domain;
+ properties = new TreeMap();
+ properties.put(key, value);
+ checkComponents();
+ }
+
+ /**
+ * Constructs an {@link ObjectName} instance using the given
+ * domain and properties.
+ *
+ * @param domain the domain part of the object name.
+ * @param properties the key-value property pairs.
+ * @throws MalformedObjectNameException the domain, a key or a value
+ * contains an illegal
+ * character or a value
+ * does not follow the quoting
+ * specifications.
+ * @throws NullPointerException if one of the parameters is
+ * <code>null</code>.
+ */
+ public ObjectName(String domain, Hashtable properties)
+ throws MalformedObjectNameException
+ {
+ this.domain = domain;
+ this.properties.putAll(properties);
+ checkComponents();
+ }
+
+ /**
+ * Checks the legality of the domain and the properties.
+ *
+ * @throws MalformedObjectNameException the domain, a key or a value
+ * contains an illegal
+ * character or a value
+ * does not follow the quoting
+ * specifications.
+ */
+ private void checkComponents()
+ throws MalformedObjectNameException
+ {
+ if (domain.indexOf(':') != -1)
+ throw new MalformedObjectNameException("The domain includes a ':' " +
+ "character.");
+ if (domain.indexOf('\n') != -1)
+ throw new MalformedObjectNameException("The domain includes a newline " +
+ "character.");
+ char[] chars = new char[] { ':', ',', '*', '?', '=' };
+ Iterator i = properties.entrySet().iterator();
+ while (i.hasNext())
+ {
+ Map.Entry entry = (Map.Entry) i.next();
+ String key = (String) entry.getKey();
+ for (int a = 0; a < chars.length; ++a)
+ if (key.indexOf(chars[a]) != -1)
+ throw new MalformedObjectNameException("A key contains a '" +
+ chars[a] + "' " +
+ "character.");
+ String value = (String) entry.getValue();
+ int quote = value.indexOf('"');
+ if (quote == 0)
+ {
+ try
+ {
+ unquote(value);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new MalformedObjectNameException("The quoted value is " +
+ "invalid.");
+ }
+ }
+ else if (quote != -1)
+ throw new MalformedObjectNameException("A value contains " +
+ "a '\"' character.");
+ else
+ {
+ for (int a = 0; a < chars.length; ++a)
+ if (value.indexOf(chars[a]) != -1)
+ throw new MalformedObjectNameException("A value contains " +
+ "a '" + chars[a] + "' " +
+ "character.");
+ }
+ }
+ }
+
+ /**
+ * <p>
+ * Attempts to find a match between this name and the one supplied.
+ * The following criteria are used:
+ * </p>
+ * <ul>
+ * <li>If the supplied name is a pattern, <code>false</code> is
+ * returned.</li>
+ * <li>If this name is a pattern, this method returns <code>true</code>
+ * if the supplied name matches the pattern.</li>
+ * <li>If this name is not a pattern, the result of
+ * <code>equals(name)</code> is returned.
+ * </ul>
+ *
+ * @param name the name to find a match with.
+ * @return true if the name either matches this pattern or is
+ * equivalent to this name under the criteria of
+ * {@link #equals(java.lang.Object)}
+ * @throws NullPointerException if <code>name</code> is <code>null</code>.
+ */
+ public boolean apply(ObjectName name)
+ {
+ if (name.isPattern())
+ return false;
+ if (isPattern())
+ {
+ boolean domainMatch, propMatch;
+ if (isDomainPattern())
+ {
+ String oDomain = name.getDomain();
+ int oLength = oDomain.length();
+ for (int a = 0; a < domain.length(); ++a)
+ {
+ char n = domain.charAt(a);
+ if (oLength == a && n != '*')
+ return false;
+ if (n == '?')
+ continue;
+ if (n == '*')
+ if ((a + 1) < domain.length())
+ {
+ if (oLength == a)
+ return false;
+ char next;
+ do
+ {
+ next = domain.charAt(a + 1);
+ } while (next == '*');
+ if (next == '?')
+ continue;
+ int pos = a;
+ while (oDomain.charAt(pos) != next)
+ {
+ ++pos;
+ if (pos == oLength)
+ return false;
+ }
+ }
+ if (n != oDomain.charAt(a))
+ return false;
+ }
+ domainMatch = true;
+ }
+ else
+ domainMatch = domain.equals(name.getDomain());
+ if (isPropertyPattern())
+ {
+ Hashtable oProps = name.getKeyPropertyList();
+ Iterator i = properties.entrySet().iterator();
+ while (i.hasNext())
+ {
+ Map.Entry entry = (Map.Entry) i.next();
+ String key = (String) entry.getKey();
+ if (!(oProps.containsKey(key)))
+ return false;
+ String val = (String) entry.getValue();
+ if (!(val.equals(oProps.get(key))))
+ return false;
+ }
+ propMatch = true;
+ }
+ else
+ propMatch =
+ getCanonicalKeyPropertyListString().equals
+ (name.getCanonicalKeyPropertyListString());
+ return domainMatch && propMatch;
+ }
+ return equals(name);
+ }
+
+ /**
+ * Compares the specified object with this one. The two
+ * are judged to be equivalent if the given object is an
+ * instance of {@link ObjectName} and has an equal canonical
+ * form (as returned by {@link #getCanonicalName()}).
+ *
+ * @param obj the object to compare with this.
+ * @return true if the object is also an {@link ObjectName}
+ * with an equivalent canonical form.
+ */
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof ObjectName)
+ {
+ ObjectName o = (ObjectName) obj;
+ return getCanonicalName().equals(o.getCanonicalName());
+ }
+ return false;
+ }
+
+ /**
+ * Returns the property list in canonical form. The keys
+ * are ordered using the lexicographic ordering used by
+ * {@link java.lang.String#compareTo(java.lang.Object)}.
+ *
+ * @return the property list, with the keys in lexicographic
+ * order.
+ */
+ public String getCanonicalKeyPropertyListString()
+ {
+ StringBuilder builder = new StringBuilder();
+ Iterator i = properties.entrySet().iterator();
+ while (i.hasNext())
+ {
+ Map.Entry entry = (Map.Entry) i.next();
+ builder.append(entry.getKey() + "=" + entry.getValue());
+ if (i.hasNext())
+ builder.append(",");
+ }
+ return builder.toString();
+ }
+
+ /**
+ * <p>
+ * Returns the name as a string in canonical form. More precisely,
+ * this returns a string of the format
+ * &lt;domain&gt;:&lt;properties&gt;&lt;wild&gt;. &lt;properties&gt;
+ * is the same value as returned by
+ * {@link #getCanonicalKeyPropertyListString()}. &lt;wild&gt;
+ * is:
+ * </p>
+ * <ul>
+ * <li>an empty string, if the object name is not a property pattern.</li>
+ * <li>'*' if &lt;properties&gt; is empty.</li>
+ * <li>',*' if there is at least one key-value pair.</li>
+ * </ul>
+ *
+ * @return the canonical string form of the object name, as specified
+ * above.
+ */
+ public String getCanonicalName()
+ {
+ return domain + ":" +
+ getCanonicalKeyPropertyListString() +
+ (isPropertyPattern() ? (properties.isEmpty() ? "*" : ",*") : "");
+ }
+
+ /**
+ * Returns the domain part of the object name.
+ *
+ * @return the domain.
+ */
+ public String getDomain()
+ {
+ return domain;
+ }
+
+ /**
+ * Returns an {@link ObjectName} instance that is substitutable for the
+ * one given. The instance returned may be a subclass of {@link ObjectName},
+ * but is not guaranteed to be of the same type as the given name, if that
+ * should also turn out to be a subclass. The returned instance may or may
+ * not be equivalent to the one given. The purpose of this method is to provide
+ * an instance of {@link ObjectName} with a well-defined semantics, such as may
+ * be used in cases where the given name is not trustworthy.
+ *
+ * @param name the {@link ObjectName} to provide a substitute for.
+ * @return a substitute for the given name, which may or may not be a subclass
+ * of {@link ObjectName}. In either case, the returned object is
+ * guaranteed to have the semantics defined here.
+ * @throws NullPointerException if <code>name</code> is <code>null</code>.
+ */
+ public static ObjectName getInstance(ObjectName name)
+ {
+ try
+ {
+ return new ObjectName(name.getCanonicalName());
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw (InternalError)
+ (new InternalError("The canonical name of " +
+ "the given name is invalid.").initCause(e));
+ }
+ }
+
+ /**
+ * Returns an {@link ObjectName} instance for the specified name, represented
+ * as a {@link java.lang.String}. The instance returned may be a subclass of
+ * {@link ObjectName} and may or may not be equivalent to earlier instances
+ * returned by this method for the same string.
+ *
+ * @param name the {@link ObjectName} to provide an instance of.
+ * @return a instance for the given name, which may or may not be a subclass
+ * of {@link ObjectName}.
+ * @throws MalformedObjectNameException the domain, a key or a value
+ * contains an illegal
+ * character or a value
+ * does not follow the quoting
+ * specifications.
+ * @throws NullPointerException if <code>name</code> is <code>null</code>.
+ */
+ public static ObjectName getInstance(String name)
+ throws MalformedObjectNameException
+ {
+ return new ObjectName(name);
+ }
+
+ /**
+ * Returns an {@link ObjectName} instance for the specified name, represented
+ * as a series of {@link java.lang.String} objects for the domain and a single
+ * property, as a key-value pair. The instance returned may be a subclass of
+ * {@link ObjectName} and may or may not be equivalent to earlier instances
+ * returned by this method for the same parameters.
+ *
+ * @param domain the domain part of the object name.
+ * @param key the key of the property.
+ * @param value the value of the property.
+ * @return a instance for the given name, which may or may not be a subclass
+ * of {@link ObjectName}.
+ * @throws MalformedObjectNameException the domain, a key or a value
+ * contains an illegal
+ * character or a value
+ * does not follow the quoting
+ * specifications.
+ * @throws NullPointerException if <code>name</code> is <code>null</code>.
+ */
+ public static ObjectName getInstance(String domain, String key, String value)
+ throws MalformedObjectNameException
+ {
+ return new ObjectName(domain, key, value);
+ }
+
+ /**
+ * Returns an {@link ObjectName} instance for the specified name, represented
+ * as a domain {@link java.lang.String} and a table of properties. The
+ * instance returned may be a subclass of {@link ObjectName} and may or may
+ * not be equivalent to earlier instances returned by this method for the
+ * same string.
+ *
+ * @param domain the domain part of the object name.
+ * @param properties the key-value property pairs.
+ * @return a instance for the given name, which may or may not be a subclass
+ * of {@link ObjectName}.
+ * @throws MalformedObjectNameException the domain, a key or a value
+ * contains an illegal
+ * character or a value
+ * does not follow the quoting
+ * specifications.
+ * @throws NullPointerException if <code>name</code> is <code>null</code>.
+ */
+ public static ObjectName getInstance(String domain, Hashtable properties)
+ throws MalformedObjectNameException
+ {
+ return new ObjectName(domain, properties);
+ }
+
+ /**
+ * Returns the property value corresponding to the given key.
+ *
+ * @param key the key of the property to be obtained.
+ * @return the value of the specified property.
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
+ */
+ public String getKeyProperty(String key)
+ {
+ if (key == null)
+ throw new NullPointerException("Null key given in request for a value.");
+ return (String) properties.get(key);
+ }
+
+ /**
+ * Returns the properties in a {@link java.util.Hashtable}. The table
+ * contains each of the properties as keys mapped to their value. The
+ * returned table may be unmodifiable. If the case that the table is
+ * modifiable, changes made to it will not be reflected in the object
+ * name.
+ *
+ * @return a {@link java.util.Hashtable}, containing each of the object
+ * name's properties.
+ */
+ public Hashtable getKeyPropertyList()
+ {
+ return (Hashtable) Collections.unmodifiableMap(new Hashtable(properties));
+ }
+
+ /**
+ * Returns a {@link java.lang.String} representation of the property
+ * list. If the object name was created using {@link
+ * ObjectName(String)}, then this string will contain the properties
+ * in the same order they were given in at creation.
+ *
+ * @return the property list.
+ */
+ public String getKeyPropertyListString()
+ {
+ if (propertyListString != null)
+ return propertyListString;
+ return getCanonicalKeyPropertyListString();
+ }
+
+ /**
+ * Returns a hash code for this object name. This is calculated as the
+ * summation of the hash codes of the domain and the properties.
+ *
+ * @return a hash code for this object name.
+ */
+ public int hashCode()
+ {
+ return domain.hashCode() + properties.hashCode();
+ }
+
+ /**
+ * Returns true if the domain of this object name is a pattern.
+ * This is the case if it contains one or more wildcard characters
+ * ('*' or '?').
+ *
+ * @return true if the domain is a pattern.
+ */
+ public boolean isDomainPattern()
+ {
+ return domain.contains("?") || domain.contains("*");
+ }
+
+ /**
+ * Returns true if this is an object name pattern. An object
+ * name pattern has a domain containing a wildcard character
+ * ('*' or '?') and/or a '*' in the list of properties.
+ * This method will return true if either {@link #isDomainPattern()}
+ * or {@link #isPropertyPattern()} does.
+ *
+ * @return true if this is an object name pattern.
+ */
+ public boolean isPattern()
+ {
+ return isDomainPattern() || isPropertyPattern();
+ }
+
+ /**
+ * Returns true if this object name is a property pattern. This is
+ * the case if the list of properties contains an '*'.
+ *
+ * @return true if this is a property pattern.
+ */
+ public boolean isPropertyPattern()
+ {
+ return propertyPattern;
+ }
+
+ /**
+ * <p>
+ * Returns a quoted version of the supplied string. The string may
+ * contain any character. The resulting quoted version is guaranteed
+ * to be usable as the value of a property, so this method provides
+ * a good way of ensuring that a value is legal.
+ * </p>
+ * <p>
+ * The string is transformed as follows:
+ * </p>
+ * <ul>
+ * <li>The string is prefixed with an opening quote character, '"'.
+ * <li>For each character, s:
+ * <ul>
+ * <li>If s is a quote ('"'), it is replaced by a backslash
+ * followed by a quote.</li>
+ * <li>If s is a star ('*'), it is replaced by a backslash followed
+ * by a star.</li>
+ * <li>If s is a question mark ('?'), it is replaced by a backslash
+ * followed by a question mark.</li>
+ * <li>If s is a backslash ('\'), it is replaced by two backslashes.</li>
+ * <li>If s is a newline character, it is replaced by a backslash followed by
+ * a '\n'.</li>
+ * <li>Otherwise, s is used verbatim.
+ * </ul></li>
+ * <li>The string is terminated with a closing quote character, '"'.</li>
+ * </ul>
+ *
+ * @param string the string to quote.
+ * @return a quoted version of the supplied string.
+ * @throws NullPointerException if <code>string</code> is <code>null</code>.
+ */
+ public static String quote(String string)
+ {
+ StringBuilder builder = new StringBuilder('"');
+ for (int a = 0; a < string.length(); ++a)
+ {
+ char s = string.charAt(a);
+ switch (s)
+ {
+ case '"':
+ builder.append("\\\"");
+ break;
+ case '*':
+ builder.append("\\*");
+ break;
+ case '?':
+ builder.append("\\?");
+ break;
+ case '\\':
+ builder.append("\\\\");
+ break;
+ case '\n':
+ builder.append("\\\n");
+ break;
+ default:
+ builder.append(s);
+ }
+ }
+ builder.append('"');
+ return builder.toString();
+ }
+
+ /**
+ * Changes the {@link MBeanServer} on which this query is performed.
+ *
+ * @param server the new server to use.
+ */
+ public void setMBeanServer(MBeanServer server)
+ {
+ this.server = server;
+ }
+
+ /**
+ * Returns a textual representation of the object name.
+ * The format is unspecified, but it should be expected that
+ * two equivalent object names will return the same string
+ * from this method.
+ *
+ * @return a textual representation of the object name.
+ */
+ public String toString()
+ {
+ return getClass().toString() +
+ "[domain = " + domain +
+ ",properties = " + properties +
+ ",propertyPattern = " + propertyPattern +
+ "]";
+ }
+
+ /**
+ * Unquotes the supplied string. The quotation marks are removed as
+ * are the backslashes preceding the escaped characters ('"', '?',
+ * '*', '\n', '\\'). A one-to-one mapping exists between quoted and
+ * unquoted values. As a result, a string <code>s</code> should be
+ * equal to <code>unquote(quote(s))</code>.
+ *
+ * @param q the quoted string to unquote.
+ * @return the unquoted string.
+ * @throws NullPointerException if <code>q</code> is <code>null</code>.
+ * @throws IllegalArgumentException if the string is not a valid
+ * quoted string i.e. it is not
+ * surrounded by quotation marks
+ * and/or characters are not properly
+ * escaped.
+ */
+ public static String unquote(String q)
+ {
+ if (q.charAt(0) != '"')
+ throw new IllegalArgumentException("The string does " +
+ "not start with a quote.");
+ if (q.charAt(q.length() - 1) != '"')
+ throw new IllegalArgumentException("The string does " +
+ "not end with a quote.");
+ StringBuilder builder = new StringBuilder();
+ for (int a = 1; a < (q.length() - 1); ++a)
+ {
+ char n = q.charAt(a);
+ if (n == '\\')
+ {
+ n = q.charAt(++a);
+ if (n != '"' && n != '?' && n != '*' &&
+ n != '\n' && n != '\\')
+ throw new IllegalArgumentException("Illegal escaped character: "
+ + n);
+ }
+ builder.append(n);
+ }
+
+ return builder.toString();
+ }
+
+}
diff --git a/libjava/classpath/javax/management/QueryExp.java b/libjava/classpath/javax/management/QueryExp.java
new file mode 100644
index 00000000000..124228c784a
--- /dev/null
+++ b/libjava/classpath/javax/management/QueryExp.java
@@ -0,0 +1,87 @@
+/* QueryExp.java -- Represents a query expression.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+import java.io.Serializable;
+
+/**
+ * Applies the type of relational constraints seen in the
+ * <code>where</code> clauses of databases to an
+ * {@link ObjectName}. Instances of this class are usually
+ * returned by the static methods of the {@link Query} classes.
+ * If a custom implementation is required, it is better to
+ * extend the {@link QueryEval} class, rather than simply
+ * implementing this interface, in order to ensure that
+ * the {@link #setMBeanServer(MBeanServer)} method functions
+ * correctly.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public interface QueryExp
+ extends Serializable
+{
+
+ /**
+ * Applies the query to the specified management bean.
+ *
+ * @param name the name of the management bean.
+ * @return true if the query was applied successfully.
+ * @throws BadStringOperationException if an invalid string
+ * operation is used by
+ * the query.
+ * @throws BadBinaryOpValueExpException if an invalid expression
+ * is used by the query.
+ * @throws BadAttributeValueExpException if an invalid attribute
+ * is used by the query.
+ * @throws InvalidApplicationException if the query is applied
+ * to the wrong type of bean.
+ */
+ boolean apply(ObjectName name)
+ throws BadStringOperationException, BadBinaryOpValueExpException,
+ BadAttributeValueExpException, InvalidApplicationException;
+
+ /**
+ * Changes the {@link MBeanServer} on which this query is performed.
+ *
+ * @param server the new server to use.
+ */
+ void setMBeanServer(MBeanServer server);
+
+}
+
diff --git a/libjava/classpath/javax/management/RuntimeErrorException.java b/libjava/classpath/javax/management/RuntimeErrorException.java
new file mode 100644
index 00000000000..811dc40f2fb
--- /dev/null
+++ b/libjava/classpath/javax/management/RuntimeErrorException.java
@@ -0,0 +1,115 @@
+/* RuntimeErrorException.java -- A user-defined management error.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+/**
+ * Represents an arbitrary error thrown by a management
+ * bean. When a management bean executes code that causes
+ * an error to be thrown, the resulting error is
+ * wrapped inside an {@link RuntimeErrorException}. Calling
+ * {@link getTargetError()} will return the wrapped
+ * exception.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class RuntimeErrorException
+ extends JMRuntimeException
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = 704338937753949796L;
+
+ /**
+ * The target error.
+ *
+ * @serial the target error.
+ */
+ private Error error;
+
+ /**
+ * Constructs a new <code>RuntimeErrorException</code> wrapping
+ * the specified error.
+ *
+ * @param e the error to be wrapped.
+ */
+ public RuntimeErrorException(Error e)
+ {
+ super();
+ error = e;
+ }
+
+ /**
+ * Constructs a new <code>RuntimeErrorException</code> wrapping
+ * the specified error and using the supplied message.
+ *
+ * @param e the error to be wrapped.
+ * @param message the error message to give to the user.
+ */
+ public RuntimeErrorException(Error e, String message)
+ {
+ super(message);
+ error = e;
+ }
+
+ /**
+ * Returns the true cause of this error, the wrapped
+ * error.
+ *
+ * @return the wrapped error.
+ */
+ public Throwable getCause()
+ {
+ return error;
+ }
+
+ /**
+ * Returns the true cause of this error, the wrapped
+ * error.
+ *
+ * @return the wrapped error.
+ */
+ public Error getTargetError()
+ {
+ return error;
+ }
+
+}
+
diff --git a/libjava/classpath/javax/management/RuntimeMBeanException.java b/libjava/classpath/javax/management/RuntimeMBeanException.java
new file mode 100644
index 00000000000..95225a80ab7
--- /dev/null
+++ b/libjava/classpath/javax/management/RuntimeMBeanException.java
@@ -0,0 +1,114 @@
+/* RuntimeMBeanException.java -- A user-defined management exception.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+/**
+ * Represents an arbitrary runtime exception thrown by a management
+ * bean. When a management bean executes code that causes a runtime
+ * exception to be thrown, the resulting exception is wrapped inside a
+ * {@link RuntimeMBeanException}. Calling {@link
+ * getTargetException()} will return the wrapped exception.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class RuntimeMBeanException
+ extends JMRuntimeException
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = 5274912751982730171L;
+
+ /**
+ * The target exception.
+ *
+ * @serial the target exception.
+ */
+ private RuntimeException runtimeException;
+
+ /**
+ * Constructs a new <code>RuntimeMBeanException</code> wrapping
+ * the specified exception.
+ *
+ * @param e the exception to be wrapped.
+ */
+ public RuntimeMBeanException(RuntimeException e)
+ {
+ super();
+ runtimeException = e;
+ }
+
+ /**
+ * Constructs a new <code>RuntimeMBeanException</code> wrapping
+ * the specified exception and using the supplied message.
+ *
+ * @param e the exception to be wrapped.
+ * @param message the error message to give to the user.
+ */
+ public RuntimeMBeanException(RuntimeException e, String message)
+ {
+ super(message);
+ runtimeException = e;
+ }
+
+ /**
+ * Returns the true cause of this exception, the wrapped runtime
+ * exception.
+ *
+ * @return the wrapped exception.
+ */
+ public Throwable getCause()
+ {
+ return runtimeException;
+ }
+
+ /**
+ * Returns the true cause of this exception, the wrapped runtime
+ * exception.
+ *
+ * @return the wrapped exception.
+ */
+ public RuntimeException getTargetException()
+ {
+ return runtimeException;
+ }
+
+}
+
diff --git a/libjava/classpath/javax/management/ServiceNotFoundException.java b/libjava/classpath/javax/management/ServiceNotFoundException.java
new file mode 100644
index 00000000000..602e1490db4
--- /dev/null
+++ b/libjava/classpath/javax/management/ServiceNotFoundException.java
@@ -0,0 +1,75 @@
+/* ServiceNotFoundException.java -- Thrown by invalid values.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+/**
+ * Thrown when a requested service is unsupported.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class ServiceNotFoundException
+ extends OperationsException
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = -3990675661956646827L;
+
+ /**
+ * Constructs a new <code>ServiceNotFoundException</code>.
+ */
+ public ServiceNotFoundException()
+ {
+ super();
+ }
+
+ /**
+ * Constructs a new <code>ServiceNotFoundException</code>
+ * with the specified message.
+ *
+ * @param message the error message to give to the user.
+ */
+ public ServiceNotFoundException(String message)
+ {
+ super(message);
+ }
+
+}
+
diff --git a/libjava/classpath/javax/management/StandardMBean.java b/libjava/classpath/javax/management/StandardMBean.java
index 736192ee2ac..16b6f0b6687 100644
--- a/libjava/classpath/javax/management/StandardMBean.java
+++ b/libjava/classpath/javax/management/StandardMBean.java
@@ -205,17 +205,13 @@ public class StandardMBean
Method getter;
try
{
- getter = iface.getMethod("get" +
- name.substring(0, 1).toUpperCase() +
- name.substring(1), null);
+ getter = iface.getMethod("get" + name, null);
}
catch (NoSuchMethodException e)
{
try
{
- getter = iface.getMethod("is" +
- name.substring(0, 1).toUpperCase() +
- name.substring(1), null);
+ getter = iface.getMethod("is" + name, null);
}
catch (NoSuchMethodException ex)
{
@@ -564,11 +560,9 @@ public class StandardMBean
Method[] amethods;
String attrib;
if (name.startsWith("is"))
- attrib = name.substring(2,3).toLowerCase()
- + name.substring(3);
+ attrib = name.substring(2);
else
- attrib = name.substring(3,4).toLowerCase()
- + name.substring(4);
+ attrib = name.substring(3);
if (attributes.containsKey(attrib))
amethods = (Method[]) attributes.get(attrib);
else
@@ -583,8 +577,7 @@ public class StandardMBean
methods[a].getParameterTypes().length == 1)
{
Method[] amethods;
- String attrib = name.substring(3,4).toLowerCase()
- + name.substring(4);
+ String attrib = name.substring(3);
if (attributes.containsKey(attrib))
amethods = (Method[]) attributes.get(attrib);
else
@@ -595,7 +588,8 @@ public class StandardMBean
amethods[1] = methods[a];
}
else
- operations.add(new MBeanOperationInfo("", methods[a]));
+ operations.add(new MBeanOperationInfo(methods[a].getName(),
+ methods[a]));
}
List attribs = new ArrayList(attributes.size());
Iterator it = attributes.entrySet().iterator();
@@ -605,7 +599,8 @@ public class StandardMBean
Method[] amethods = (Method[]) entry.getValue();
try
{
- attribs.add(new MBeanAttributeInfo((String) entry.getKey(), "",
+ attribs.add(new MBeanAttributeInfo((String) entry.getKey(),
+ (String) entry.getKey(),
amethods[0], amethods[1]));
}
catch (IntrospectionException e)
@@ -632,7 +627,8 @@ public class StandardMBean
MBeanConstructorInfo[] cinfo = new MBeanConstructorInfo[cons.length];
for (int a = 0; a < cinfo.length; ++a)
{
- MBeanConstructorInfo oldInfo = new MBeanConstructorInfo("", cons[a]);
+ MBeanConstructorInfo oldInfo = new MBeanConstructorInfo(cons[a].getName(),
+ cons[a]);
String desc = getDescription(oldInfo);
MBeanParameterInfo[] params = oldInfo.getSignature();
MBeanParameterInfo[] pinfo = new MBeanParameterInfo[params.length];
@@ -665,8 +661,8 @@ public class StandardMBean
oinfo[a] = new MBeanOperationInfo(oldInfo.getName(), desc, pinfo,
oldInfo.getReturnType(), impact);
}
- info = new MBeanInfo(impl.getClass().getName(), "", ainfo, cinfo,
- oinfo, null);
+ info = new MBeanInfo(impl.getClass().getName(), impl.getClass().getName(),
+ ainfo, cinfo, oinfo, null);
String cname = getClassName(info);
String desc = getDescription(info);
info = new MBeanInfo(cname, desc, ainfo, cinfo, oinfo, null);
@@ -679,7 +675,7 @@ public class StandardMBean
*
* @return the management interface.
*/
- public Class getMBeanInterface()
+ public final Class getMBeanInterface()
{
return iface;
}
diff --git a/libjava/classpath/javax/management/ValueExp.java b/libjava/classpath/javax/management/ValueExp.java
new file mode 100644
index 00000000000..503f2322194
--- /dev/null
+++ b/libjava/classpath/javax/management/ValueExp.java
@@ -0,0 +1,86 @@
+/* ValueExp.java -- Represents values that can be passed to queries.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management;
+
+import java.io.Serializable;
+
+/**
+ * Represents values that may be passed as arguments to
+ * {@link QueryExp}s. Strings, numbers and bean attributes
+ * are all valid argument types for query expressions, and
+ * so should be represented as implementations of this
+ * interface.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public interface ValueExp
+ extends Serializable
+{
+
+ /**
+ * Applies the value expression to the specified management bean.
+ *
+ * @param name the name of the management bean.
+ * @return the value expression.
+ * @throws BadStringOperationException if an invalid string
+ * operation is used by
+ * the value expression.
+ * @throws BadBinaryOpValueExpException if an invalid expression
+ * is used by the value expression.
+ * @throws BadAttributeValueExpException if an invalid attribute
+ * is used by the value expression.
+ * @throws InvalidApplicationException if the value expression is applied
+ * to the wrong type of bean.
+ */
+ ValueExp apply(ObjectName name)
+ throws BadStringOperationException, BadBinaryOpValueExpException,
+ BadAttributeValueExpException, InvalidApplicationException;
+
+ /**
+ * Changes the {@link MBeanServer} on which this query is performed.
+ *
+ * @param server the new server to use.
+ * @deprecated This method is superfluous, as the {@link ValueExp}
+ * can access the server using
+ * {@link QueryEval#getMBeanServer()}.
+ */
+ void setMBeanServer(MBeanServer server);
+
+}
+
diff --git a/libjava/classpath/javax/management/loading/ClassLoaderRepository.java b/libjava/classpath/javax/management/loading/ClassLoaderRepository.java
new file mode 100644
index 00000000000..e2c8b7c5bf7
--- /dev/null
+++ b/libjava/classpath/javax/management/loading/ClassLoaderRepository.java
@@ -0,0 +1,139 @@
+/* ClassLoaderRepository.java -- Represents a collection of class loadersx.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management.loading;
+
+/**
+ * Implementations of this interface maintain a list of
+ * {@link ClassLoader}s for use by the management servers,
+ * allowing classes to be loaded by the first {@link ClassLoader}
+ * that will do so. A class loader is added to the list
+ * whenever a {@link ClassLoader} instance is registered with
+ * the management server, and it does not implement the
+ * {@link PrivateClassLoader} interface. They are removed when
+ * unregistered. The first class loader in the list is always
+ * the one which was used to load the management server itself.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ * @see MBeanServerFactory
+ */
+public interface ClassLoaderRepository
+{
+
+ /**
+ * Attempts to load the given class using class loaders
+ * supplied by the list. The {@link ClassLoader#loadClass(String)}
+ * method of each class loader is called. If the method
+ * returns successfully, then the returned {@link Class} instance
+ * is returned. If a {@link ClassNotFoundException} is thrown,
+ * then the next loader is tried. Any other exception thrown
+ * by the method is passed back to the caller. This method
+ * throws a {@link ClassNotFoundException} itself if all the
+ * class loaders listed prove fruitless.
+ *
+ * @param name the name of the class to load.
+ * @return the loaded class.
+ * @throws ClassNotFoundException if all the class loaders fail
+ * to load the class.
+ */
+ Class loadClass(String name)
+ throws ClassNotFoundException;
+
+ /**
+ * <p>
+ * Attempts to load the given class using class loaders
+ * supplied by the list, stopping when the specified
+ * loader is reached. The {@link ClassLoader#loadClass(String)}
+ * method of each class loader is called. If the method
+ * returns successfully, then the returned {@link Class} instance
+ * is returned. If a {@link ClassNotFoundException} is thrown,
+ * then the next loader is tried. Any other exception thrown
+ * by the method is passed back to the caller. This method
+ * throws a {@link ClassNotFoundException} itself if all the
+ * class loaders listed prove fruitless.
+ * </p>
+ * <p>
+ * This method is usually used by the class loader specified
+ * by the <code>stop</code> argument to load classes using the
+ * loaders that appear before it in the list. By stopping when
+ * the loader is reached, the deadlock that occurs when the loader
+ * is merely skipped is avoided.
+ * </p>
+ *
+ * @param stop the class loader at which to stop, or <code>null</code>
+ * to obtain the same behaviour as {@link #loadClass(String)}.
+ * @param name the name of the class to load.
+ * @return the loaded class.
+ * @throws ClassNotFoundException if all the class loaders fail
+ * to load the class.
+ */
+ Class loadClassBefore(ClassLoader stop, String name)
+ throws ClassNotFoundException;
+
+ /**
+ * <p>
+ * Attempts to load the given class using class loaders
+ * supplied by the list, excluding the one specified.
+ * The {@link ClassLoader#loadClass(String)}
+ * method of each class loader is called. If the method
+ * returns successfully, then the returned {@link Class} instance
+ * is returned. If a {@link ClassNotFoundException} is thrown,
+ * then the next loader is tried. Any other exception thrown
+ * by the method is passed back to the caller. This method
+ * throws a {@link ClassNotFoundException} itself if all the
+ * class loaders listed prove fruitless.
+ * </p>
+ * <p>
+ * Note that this method may deadlock if called simultaneously
+ * by two class loaders in the list.
+ * {@link loadClassBefore(ClassLoader, String)} should be used
+ * in preference to this method to avoid this.
+ * </p>
+ *
+ * @param exclude the class loader to exclude, or <code>null</code>
+ * to obtain the same behaviour as {@link #loadClass(String)}.
+ * @param name the name of the class to load.
+ * @return the loaded class.
+ * @throws ClassNotFoundException if all the class loaders fail
+ * to load the class.
+ */
+ Class loadClassWithout(ClassLoader exclude, String name)
+ throws ClassNotFoundException;
+
+}
+
diff --git a/libjava/classpath/javax/management/openmbean/InvalidOpenTypeException.java b/libjava/classpath/javax/management/openmbean/InvalidOpenTypeException.java
new file mode 100644
index 00000000000..9c9ff8cfab8
--- /dev/null
+++ b/libjava/classpath/javax/management/openmbean/InvalidOpenTypeException.java
@@ -0,0 +1,76 @@
+/* InvalidOpenTypeException.java -- Thrown by an invalid open type.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management.openmbean;
+
+/**
+ * Thrown when a open data value has an erroneous open
+ * type.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class InvalidOpenTypeException
+ extends IllegalArgumentException
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = -2837312755412327534L;
+
+ /**
+ * Constructs a new <code>InvalidOpenTypeException</code>.
+ */
+ public InvalidOpenTypeException()
+ {
+ super();
+ }
+
+ /**
+ * Constructs a new <code>InvalidOpenTypeException</code>
+ * with the specified message.
+ *
+ * @param message the error message to give to the user.
+ */
+ public InvalidOpenTypeException(String message)
+ {
+ super(message);
+ }
+
+}
+
diff --git a/libjava/classpath/javax/management/openmbean/KeyAlreadyExistsException.java b/libjava/classpath/javax/management/openmbean/KeyAlreadyExistsException.java
new file mode 100644
index 00000000000..cc6bba63621
--- /dev/null
+++ b/libjava/classpath/javax/management/openmbean/KeyAlreadyExistsException.java
@@ -0,0 +1,77 @@
+/* KeyAlreadyExistsException.java -- Thrown when a key clashes with another.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management.openmbean;
+
+/**
+ * Thrown when a key (a field name or row index) is passed to a method
+ * of the {@link CompositeData} or {@link TabularData} classes and it
+ * is found to already be in use.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class KeyAlreadyExistsException
+ extends IllegalArgumentException
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = 1845183636745282866L;
+
+ /**
+ * Constructs a new <code>KeyAlreadyExistsException</code>.
+ */
+ public KeyAlreadyExistsException()
+ {
+ super();
+ }
+
+ /**
+ * Constructs a new <code>KeyAlreadyExistsException</code>
+ * with the specified message.
+ *
+ * @param message the error message to give to the user.
+ */
+ public KeyAlreadyExistsException(String message)
+ {
+ super(message);
+ }
+
+}
+
diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfo.java b/libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfo.java
new file mode 100644
index 00000000000..1b276fd197f
--- /dev/null
+++ b/libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfo.java
@@ -0,0 +1,120 @@
+/* OpenMBeanAttributeInfo.java -- Open typed info about an attribute.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management.openmbean;
+
+/**
+ * Describes an attribute associated with an open management bean.
+ * This interface includes those methods specified by {@link
+ * javax.management.MBeanAttributeInfo}, so implementations should
+ * extend this class.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public interface OpenMBeanAttributeInfo
+ extends OpenMBeanParameterInfo
+{
+
+ /**
+ * Compares this attribute with the supplied object. This returns
+ * true iff the object is an instance of {@link OpenMBeanAttributeInfo}
+ * with an equal name and open type, the same default, minimum,
+ * maximum and legal values and the same access properties
+ * ({@link #isIs()}, {@link #isReadable()}, {@link #isWritable()}).
+ *
+ * @param obj the object to compare.
+ * @return true if the object is a {@link OpenMBeanParameterInfo}
+ * instance,
+ * <code>name.equals(object.getName())</code>,
+ * <code>openType.equals(object.getOpenType())</code>,
+ * <code>defaultValue.equals(object.getDefaultValue())</code>,
+ * <code>minValue.equals(object.getMinValue())</code>,
+ * <code>maxValue.equals(object.getMaxValue())</code>,
+ * <code>legalValues.equals(object.getLegalValues())</code>,
+ * <code>is == object.isIs()</code>,
+ * <code>isRead == object.isReadable()</code>,
+ * and <code>isWrite == object.isWritable()</code>.
+ */
+ boolean equals(Object obj);
+
+ /**
+ * Returns the hashcode of the attribute information as the sum of
+ * the hashcodes of the name, open type, default value, maximum
+ * value, minimum value, the set of legal values and the access
+ * properties.
+ *
+ * @return the hashcode of the attribute information.
+ */
+ int hashCode();
+
+ /**
+ * Returns true if the accessor method of this attribute
+ * is of the form <code>isXXX</code>.
+ *
+ * @return true if the accessor takes the form <code>isXXX</code>.
+ */
+ boolean isIs();
+
+ /**
+ * Returns true if value of this attribute can be read.
+ *
+ * @return true if the value of the attribute can be read.
+ */
+ boolean isReadable();
+
+ /**
+ * Returns true if the value of this attribute can be changed.
+ *
+ * @return true if the value of the attribute can be changed.
+ */
+ boolean isWritable();
+
+ /**
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.openmbean.OpenMBeanAttributeInfo</code>)
+ * along with the name, open type, default, minimum, maximum
+ * and legal values of the parameter and the access permissions
+ * ({@link #isIs()}, {@link #isReadable()}, {@link #isWritable()}).
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ String toString();
+
+}
diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java b/libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java
new file mode 100644
index 00000000000..83e043640b4
--- /dev/null
+++ b/libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java
@@ -0,0 +1,546 @@
+/* OpenMBeanAttributeInfoSupport.java -- Open typed info about an attribute.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management.openmbean;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.management.MBeanAttributeInfo;
+
+/**
+ * Describes an attribute of an open management bean.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class OpenMBeanAttributeInfoSupport
+ extends MBeanAttributeInfo
+ implements OpenMBeanAttributeInfo
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = -4867215622149721849L;
+
+ /**
+ * The open type of the attribute.
+ */
+ private OpenType openType;
+
+ /**
+ * The default value of the attribute (may be <code>null</code>).
+ */
+ private Object defaultValue;
+
+ /**
+ * The possible legal values of the attribute (may be <code>null</code>).
+ */
+ private Set legalValues;
+
+ /**
+ * The minimum value of the attribute (may be <code>null</code>).
+ */
+ private Comparable minValue;
+
+ /**
+ * The maximum value of the attribute (may be <code>null</code>).
+ */
+ private Comparable maxValue;
+
+ /**
+ * The hash code of this instance.
+ */
+ private transient Integer hashCode;
+
+ /**
+ * The <code>toString()</code> result of this instance.
+ */
+ private transient String string;
+
+ /**
+ * Constructs a new {@link OpenMBeanAttributeInfo} using the
+ * specified name, description, open type and access properties.
+ * The name, description and open type may not be <code>null</code>
+ * and the name and description may not be equal to the empty
+ * string.
+ *
+ * @param name the name of the attribute.
+ * @param desc a description of the attribute.
+ * @param type the open type of the attribute.
+ * @param isReadable true if the attribute's value can be read.
+ * @param isWritable true if the attribute's value can be changed.
+ * @param isIs true if the attribute uses an accessor of the form isXXX.
+ * @throws IllegalArgumentException if the name, description or
+ * open type are <code>null</code>
+ * or the name or description are
+ * the empty string.
+ */
+ public OpenMBeanAttributeInfoSupport(String name, String desc, OpenType type,
+ boolean isReadable, boolean isWritable,
+ boolean isIs)
+ {
+ super(name, type == null ? null : type.getClassName(), desc, isReadable,
+ isWritable, isIs);
+ if (name == null)
+ throw new IllegalArgumentException("The name may not be null.");
+ if (desc == null)
+ throw new IllegalArgumentException("The description may not be null.");
+ if (type == null)
+ throw new IllegalArgumentException("The type may not be null.");
+ if (name.length() == 0)
+ throw new IllegalArgumentException("The name may not be the empty string.");
+ if (desc.length() == 0)
+ throw new IllegalArgumentException("The description may not be the " +
+ "empty string.");
+ }
+
+ /**
+ * Constructs a new {@link OpenMBeanAttributeInfo} using the
+ * specified name, description, open type and default value. The
+ * name, description and open type cannot be <code>null</code> and
+ * the name and description may not be equal to the empty string.
+ * The default value may be <code>null</code>. If non-null, it must
+ * be a valid value of the given open type. Default values are not
+ * applicable to the open types, {@link ArrayType} and {@link
+ * TabularType}.
+ *
+ * @param name the name of the attribute.
+ * @param desc a description of the attribute.
+ * @param type the open type of the attribute.
+ * @param isReadable true if the attribute's value can be read.
+ * @param isWritable true if the attribute's value can be changed.
+ * @param isIs true if the attribute uses an accessor of the form isXXX.
+ * @param defaultValue the default value of the attribute.
+ * @throws IllegalArgumentException if the name, description or
+ * open type are <code>null</code>
+ * or the name or description are
+ * the empty string.
+ * @throws OpenDataException if <code>defaultValue<code> is non-null
+ * and is either not a value of the given
+ * open type or the open type is an instance
+ * of {@link ArrayType} or {@link TabularType}.
+ */
+ public OpenMBeanAttributeInfoSupport(String name, String desc, OpenType type,
+ boolean isReadable, boolean isWritable,
+ boolean isIs, Object defaultValue)
+ throws OpenDataException
+ {
+ this(name, desc, type, isReadable, isWritable, isIs, defaultValue, null);
+ }
+
+ /**
+ * <p>
+ * Constructs a new {@link OpenMBeanAttributeInfo} using the
+ * specified name, description, open type, access properties,
+ * default, maximum and minimum values. The name, description
+ * and open type cannot be <code>null</code> and the name and
+ * description may not be equal to the empty string. The
+ * default, maximum and minimum values may be <code>null</code>.
+ * The following conditions apply when the attributes mentioned
+ * are non-null:
+ * </p>
+ * <ul>
+ * <li>The values must be valid values for the given open type.</li>
+ * <li>Default values are not applicable to the open types, {@link
+ * ArrayType} and {@link TabularType}.</li>
+ * <li>The minimum value must be smaller than or equal to the maximum value
+ * (literally, <code>minValue.compareTo(maxValue) <= 0</code>.</li>
+ * <li>The minimum value must be smaller than or equal to the default value
+ * (literally, <code>minValue.compareTo(defaultValue) <= 0</code>.</li>
+ * <li>The default value must be smaller than or equal to the maximum value
+ * (literally, <code>defaultValue.compareTo(maxValue) <= 0</code>.</li>
+ * </ul>
+ *
+ * @param name the name of the attribute.
+ * @param desc a description of the attribute.
+ * @param type the open type of the attribute.
+ * @param isReadable true if the attribute's value can be read.
+ * @param isWritable true if the attribute's value can be changed.
+ * @param isIs true if the attribute uses an accessor of the form isXXX.
+ * @param defaultValue the default value of the attribute, or <code>null</code>.
+ * @param minimumValue the minimum value of the attribute, or <code>null</code>.
+ * @param maximumValue the maximum value of the attribute, or <code>null</code>.
+ * @throws IllegalArgumentException if the name, description or
+ * open type are <code>null</code>
+ * or the name or description are
+ * the empty string.
+ * @throws OpenDataException if any condition in the list above is broken.
+ */
+ public OpenMBeanAttributeInfoSupport(String name, String desc, OpenType type,
+ boolean isReadable, boolean isWritable,
+ boolean isIs, Object defaultValue,
+ Comparable minimumValue,
+ Comparable maximumValue)
+ throws OpenDataException
+ {
+ this(name, desc, type, isReadable, isWritable, isIs);
+ if (defaultValue != null && !(type.isValue(defaultValue)))
+ throw new OpenDataException("The default value is not a member of the " +
+ "open type given.");
+ if (minimumValue != null && !(type.isValue(minimumValue)))
+ throw new OpenDataException("The minimum value is not a member of the " +
+ "open type given.");
+ if (maximumValue != null && !(type.isValue(maximumValue)))
+ throw new OpenDataException("The maximum value is not a member of the " +
+ "open type given.");
+ if (defaultValue != null && (type instanceof ArrayType ||
+ type instanceof TabularType))
+ throw new OpenDataException("Default values are not applicable for " +
+ "array or tabular types.");
+ if (minValue != null && maxValue != null
+ && minValue.compareTo(maxValue) > 0)
+ throw new OpenDataException("The minimum value is greater than the " +
+ "maximum.");
+ if (minValue != null && defaultValue != null
+ && minValue.compareTo(defaultValue) > 0)
+ throw new OpenDataException("The minimum value is greater than the " +
+ "default.");
+ if (defaultValue != null && maxValue != null
+ && maxValue.compareTo(defaultValue) < 0)
+ throw new OpenDataException("The default value is greater than the " +
+ "maximum.");
+
+ openType = type;
+ this.defaultValue = defaultValue;
+ minValue = minimumValue;
+ maxValue = maximumValue;
+ }
+
+ /**
+ * <p>
+ * Constructs a new {@link OpenMBeanAttributeInfo} using the
+ * specified name, description, open type, access properties, default
+ * value and set of legal values. The name, description and open type
+ * cannot be <code>null</code> and the name and description may not be
+ * equal to the empty string. The default, maximum and minimum values
+ * may be <code>null</code>. The following conditions apply when the
+ * attributes mentioned are non-null:
+ * </p>
+ * <ul>
+ * <li>The default value and each of the legal values must be a valid
+ * value for the given open type.</li>
+ * <li>Default and legal values are not applicable to the open types, {@link
+ * ArrayType} and {@link TabularType}.</li>
+ * <li>The default value is not in the set of legal values.</li>
+ * </ul>
+ * <p>
+ * The legal values are copied from the array into a unmodifiable set,
+ * so future modifications to the array have no effect.
+ * </p>
+ *
+ * @param name the name of the attribute.
+ * @param desc a description of the attribute.
+ * @param type the open type of the attribute.
+ * @param isReadable true if the attribute's value can be read.
+ * @param isWritable true if the attribute's value can be changed.
+ * @param isIs true if the attribute uses an accessor of the form isXXX.
+ * @param defaultValue the default value of the attribute, or <code>null</code>.
+ * @param legalValues the legal values of the attribute. May be
+ * <code>null</code> or an empty array.
+ * @throws IllegalArgumentException if the name, description or
+ * open type are <code>null</code>
+ * or the name or description are
+ * the empty string.
+ * @throws OpenDataException if any condition in the list above is broken.
+ */
+ public OpenMBeanAttributeInfoSupport(String name, String desc, OpenType type,
+ boolean isReadable, boolean isWritable,
+ boolean isIs, Object defaultValue,
+ Object[] legalValues)
+ throws OpenDataException
+ {
+ this(name, desc, type, isReadable, isWritable, isIs);
+ if (defaultValue != null && !(type.isValue(defaultValue)))
+ throw new OpenDataException("The default value is not a member of the " +
+ "open type given.");
+ if (defaultValue != null && (type instanceof ArrayType ||
+ type instanceof TabularType))
+ throw new OpenDataException("Default values are not applicable for " +
+ "array or tabular types.");
+ if (legalValues != null && (type instanceof ArrayType ||
+ type instanceof TabularType))
+ throw new OpenDataException("Legal values are not applicable for " +
+ "array or tabular types.");
+ if (legalValues != null && legalValues.length > 0)
+ {
+ Set lv = new HashSet(legalValues.length);
+ for (int a = 0; a < legalValues.length; ++a)
+ {
+ if (legalValues[a] != null &&
+ !(type.isValue(legalValues[a])))
+ throw new OpenDataException("The legal value, "
+ + legalValues[a] +
+ "is not a member of the " +
+ "open type given.");
+ lv.add(legalValues[a]);
+ }
+ if (defaultValue != null && !(lv.contains(defaultValue)))
+ throw new OpenDataException("The default value is not in the set " +
+ "of legal values.");
+ this.legalValues = Collections.unmodifiableSet(lv);
+ }
+ openType = type;
+ this.defaultValue = defaultValue;
+ }
+
+ /**
+ * Compares this attribute with the supplied object. This returns
+ * true iff the object is an instance of {@link OpenMBeanAttributeInfo}
+ * with an equal name and open type and the same default, minimum,
+ * maximum and legal values and the same access properties.
+ *
+ * @param obj the object to compare.
+ * @return true if the object is a {@link OpenMBeanAttributeInfo}
+ * instance,
+ * <code>name.equals(object.getName())</code>,
+ * <code>openType.equals(object.getOpenType())</code>,
+ * <code>isRead == object.isReadable()</code>,
+ * <code>isWrite == object.isWritable()</code>,
+ * <code>isIs == object.isIs()</code>,
+ * <code>defaultValue.equals(object.getDefaultValue())</code>,
+ * <code>minValue.equals(object.getMinValue())</code>,
+ * <code>maxValue.equals(object.getMaxValue())</code>,
+ * and <code>legalValues.equals(object.getLegalValues())</code>.
+ */
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof OpenMBeanAttributeInfo))
+ return false;
+ OpenMBeanAttributeInfo o = (OpenMBeanAttributeInfo) obj;
+ return getName().equals(o.getName()) &&
+ openType.equals(o.getOpenType()) &&
+ isReadable() == o.isReadable() &&
+ isWritable() == o.isWritable() &&
+ isIs() == o.isIs() &&
+ (defaultValue == null ? o.getDefaultValue() == null :
+ defaultValue.equals(o.getDefaultValue())) &&
+ (minValue == null ? o.getMinValue() == null :
+ minValue.equals(o.getMinValue())) &&
+ (maxValue == null ? o.getMaxValue() == null :
+ maxValue.equals(o.getMaxValue())) &&
+ (legalValues == null ? o.getLegalValues() == null :
+ legalValues.equals(o.getLegalValues()));
+ }
+
+ /**
+ * Returns the default value of this attribute, or <code>null</code>
+ * if there is no default value.
+ *
+ * @return the default value of the attribute, or <code>null</code>
+ * if there is no default.
+ */
+ public Object getDefaultValue()
+ {
+ return defaultValue;
+ }
+
+ /**
+ * Returns a {@link java.util.Set} enumerating the legal values
+ * of this attribute, or <code>null</code> if no such limited
+ * set exists for this attribute.
+ *
+ * @return a set of legal values, or <code>null</code> if no such
+ * set exists.
+ */
+ public Set getLegalValues()
+ {
+ return legalValues;
+ }
+
+ /**
+ * Returns the maximum value of this attribute, or <code>null</code>
+ * if there is no maximum.
+ *
+ * @return the maximum value, or <code>null</code> if none exists.
+ */
+ public Comparable getMaxValue()
+ {
+ return maxValue;
+ }
+
+ /**
+ * Returns the minimum value of this attribute, or <code>null</code>
+ * if there is no minimum.
+ *
+ * @return the minimum value, or <code>null</code> if none exists.
+ */
+ public Comparable getMinValue()
+ {
+ return minValue;
+ }
+
+ /**
+ * Returns the open type instance which represents the type of this
+ * attribute.
+ *
+ * @return the open type of this attribute.
+ */
+ public OpenType getOpenType()
+ {
+ return openType;
+ }
+
+ /**
+ * Returns true if this attribute has a default value
+ * (i.e. the value is non-null).
+ *
+ * @return true if this attribute has a default.
+ */
+ public boolean hasDefaultValue()
+ {
+ return defaultValue != null;
+ }
+
+ /**
+ * <p>
+ * Returns the hashcode of the attribute information as the sum of
+ * the hashcodes of the name, open type, default value, maximum
+ * value, minimum value and the set of legal values.
+ * </p>
+ * <p>
+ * As instances of this class are immutable, the hash code
+ * is computed just once for each instance and reused
+ * throughout its life.
+ * </p>
+ *
+ * @return the hashcode of the attribute information.
+ */
+ public int hashCode()
+ {
+ if (hashCode == null)
+ hashCode = Integer.valueOf(getName().hashCode() +
+ openType.hashCode() +
+ Boolean.valueOf(isReadable()).hashCode() +
+ (2 *
+ Boolean.valueOf(isWritable()).hashCode()) +
+ (4 * Boolean.valueOf(isIs()).hashCode()) +
+ (defaultValue == null ? 0 :
+ defaultValue.hashCode()) +
+ (minValue == null ? 0 :
+ minValue.hashCode()) +
+ (maxValue == null ? 0 :
+ maxValue.hashCode()) +
+ (legalValues == null ? 0 :
+ legalValues.hashCode()));
+ return hashCode.intValue();
+ }
+
+ /**
+ * Returns true if there is a set of legal values for this
+ * attribute (i.e. the value is non-null).
+ *
+ * @return true if a set of legal values exists for this
+ * attribute.
+ */
+ public boolean hasLegalValues()
+ {
+ return legalValues != null;
+ }
+
+ /**
+ * Returns true if there is a maximum value for this attribute
+ * (i.e. the value is non-null).
+ *
+ * @return true if a maximum value exists for this attribute.
+ */
+ public boolean hasMaxValue()
+ {
+ return maxValue != null;
+ }
+
+ /**
+ * Returns true if there is a minimum value for this attribute.
+ * (i.e. the value is non-null).
+ *
+ * @return true if a minimum value exists for this attribute.
+ */
+ public boolean hasMinValue()
+ {
+ return minValue != null;
+ }
+
+ /**
+ * Returns true if the specified object is a valid value for
+ * this attribute.
+ *
+ * @param obj the object to test.
+ * @return true if <code>obj</code> is a valid value for this
+ * attribute.
+ */
+ public boolean isValue(Object obj)
+ {
+ return openType.isValue(obj);
+ }
+
+ /**
+ * <p>
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.openmbean.OpenMBeanAttributeInfo</code>)
+ * along with the name, open type, access properties, default,
+ * minimum, maximum and legal values of the attribute.
+ * </p>
+ * <p>
+ * As instances of this class are immutable, the return value
+ * is computed just once for each instance and reused
+ * throughout its life.
+ * </p>
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ public String toString()
+ {
+ if (string == null)
+ string = getClass().getName()
+ + "[name=" + getName()
+ + ",openType=" + openType
+ + ",isReadable=" + isReadable()
+ + ",isWritable=" + isWritable()
+ + ",isIs=" + isIs()
+ + ",defaultValue=" + defaultValue
+ + ",minValue=" + minValue
+ + ",maxValue=" + maxValue
+ + ",legalValues=" + legalValues
+ + "]";
+ return string;
+ }
+
+}
diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfo.java b/libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfo.java
new file mode 100644
index 00000000000..34cef131f26
--- /dev/null
+++ b/libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfo.java
@@ -0,0 +1,112 @@
+/* OpenMBeanConstructorInfo.java -- Open typed info about a constructor.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management.openmbean;
+
+import javax.management.MBeanParameterInfo;
+
+/**
+ * Describes a constructor for an open management bean.
+ * This interface includes those methods specified by {@link
+ * javax.management.MBeanConstructorInfo}, so implementations should
+ * extend this class. The {@link #getSignature()} method should
+ * return an array containing instances of {@link OpenMBeanParameterInfo}.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public interface OpenMBeanConstructorInfo
+{
+
+ /**
+ * Compares this attribute with the supplied object. This returns
+ * true iff the object is an instance of {@link OpenMBeanConstructorInfo}
+ * with an equal name and signature.
+ *
+ * @param obj the object to compare.
+ * @return true if the object is a {@link OpenMBeanParameterInfo}
+ * instance,
+ * <code>name.equals(object.getName())</code>,
+ * and <code>signature.equals(object.getSignature())</code>.
+ */
+ boolean equals(Object obj);
+
+ /**
+ * Returns a description of this constructor.
+ *
+ * @return a human-readable description.
+ */
+ String getDescription();
+
+ /**
+ * Returns the name of this constructor.
+ *
+ * @return the name of the constructor.
+ */
+ String getName();
+
+ /**
+ * Returns the constructor's signature, in the form of
+ * information on each parameter. Each parameter is
+ * described by an instance of {@link OpenMBeanParameterInfo}.
+ *
+ * @return an array of {@link OpenMBeanParameterInfo} objects,
+ * describing the constructor parameters.
+ */
+ MBeanParameterInfo[] getSignature();
+
+ /**
+ * Returns the hashcode of the constructor information as the sum of
+ * the hashcodes of the name and signature (calculated by
+ * <code>java.util.Arrays.asList(signature).hashCode()</code>).
+ *
+ * @return the hashcode of the constructor information.
+ */
+ int hashCode();
+
+ /**
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.openmbean.OpenMBeanConstructorInfo</code>)
+ * along with the name and signature.
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ String toString();
+
+}
diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java b/libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java
new file mode 100644
index 00000000000..9dac01a596a
--- /dev/null
+++ b/libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java
@@ -0,0 +1,174 @@
+/* OpenMBeanConstructorInfoSupport.java -- Open typed info about an constructor.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management.openmbean;
+
+import java.util.Arrays;
+
+import javax.management.MBeanConstructorInfo;
+import javax.management.MBeanParameterInfo;
+
+/**
+ * Describes a constructor for an open management bean.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class OpenMBeanConstructorInfoSupport
+ extends MBeanConstructorInfo
+ implements OpenMBeanConstructorInfo
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = -4400441579007477003L;
+
+ /**
+ * The hash code of this instance.
+ */
+ private transient Integer hashCode;
+
+ /**
+ * The <code>toString()</code> result of this instance.
+ */
+ private transient String string;
+
+ /**
+ * Constructs a @link{OpenMBeanConstructorInfo} with the specified
+ * name, description and parameter information. A <code>null</code>
+ * value for the parameter information is the same as passing in
+ * an empty array. Neither the name nor the description may be
+ * null or equal to the empty string. A copy of the parameter array
+ * is taken, so later changes have no effect.
+ *
+ * @param name the name of the constructor.
+ * @param desc a description of the constructor.
+ * @param sig the signature of the constructor, as a series
+ * of {@link MBeanParameterInfo} objects, one for
+ * each parameter.
+ * @throws IllegalArgumentException if the name or description is
+ * either <code>null</code>
+ * or the empty string.
+ * @throws ArrayStoreException if the members of the signature array
+ * are not assignable to
+ * {@link javax.management.MBeanParameterInfo}
+ */
+ public OpenMBeanConstructorInfoSupport(String name, String desc,
+ OpenMBeanParameterInfo[] sig)
+ {
+ super(name, desc, (MBeanParameterInfo[]) sig);
+ if (name == null)
+ throw new IllegalArgumentException("The name may not be null.");
+ if (desc == null)
+ throw new IllegalArgumentException("The description may not be null.");
+ if (name.length() == 0)
+ throw new IllegalArgumentException("The name may not be the empty string.");
+ if (desc.length() == 0)
+ throw new IllegalArgumentException("The description may not be the " +
+ "empty string.");
+ }
+
+ /**
+ * Compares this attribute with the supplied object. This returns
+ * true iff the object is an instance of {@link OpenMBeanConstructorInfo}
+ * with an equal name and signature.
+ *
+ * @param obj the object to compare.
+ * @return true if the object is a {@link OpenMBeanParameterInfo}
+ * instance,
+ * <code>name.equals(object.getName())</code>,
+ * and <code>signature.equals(object.getSignature())</code>.
+ */
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof OpenMBeanConstructorInfo))
+ return false;
+ OpenMBeanConstructorInfo o = (OpenMBeanConstructorInfo) obj;
+ return getName().equals(o.getName()) &&
+ getSignature().equals(o.getSignature());
+ }
+
+ /**
+ * <p>
+ * Returns the hashcode of the constructor information as the sum of
+ * the hashcodes of the name and signature (calculated by
+ * <code>java.util.Arrays.asList(signature).hashCode()</code>).
+ * </p>
+ * <p>
+ * As instances of this class are immutable, the return value
+ * is computed just once for each instance and reused
+ * throughout its life.
+ * </p>
+ *
+ * @return the hashcode of the constructor information.
+ */
+ public int hashCode()
+ {
+ if (hashCode == null)
+ hashCode = Integer.valueOf(getName().hashCode() +
+ Arrays.asList(getSignature()).hashCode());
+ return hashCode.intValue();
+ }
+
+ /**
+ * <p>
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.openmbean.OpenMBeanConstructorInfo</code>)
+ * along with the name and signature.
+ * </p>
+ * <p>
+ * As instances of this class are immutable, the return value
+ * is computed just once for each instance and reused
+ * throughout its life.
+ * </p>
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ public String toString()
+ {
+ if (string == null)
+ string = getClass().getName()
+ + "[name=" + getName()
+ + ",signature=" + Arrays.toString(getSignature())
+ + "]";
+ return string;
+ }
+
+}
diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanInfo.java b/libjava/classpath/javax/management/openmbean/OpenMBeanInfo.java
new file mode 100644
index 00000000000..5aa4df4511c
--- /dev/null
+++ b/libjava/classpath/javax/management/openmbean/OpenMBeanInfo.java
@@ -0,0 +1,154 @@
+/* OpenMBeanInfo.java -- Open typed info about a management bean.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management.openmbean;
+
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanConstructorInfo;
+import javax.management.MBeanNotificationInfo;
+import javax.management.MBeanOperationInfo;
+
+/**
+ * Describes an open management bean. Open management beans are
+ * management beans where {@link
+ * javax.management.DynamicMBean#getMBeanInfo()} returns an
+ * implementation of this interface. This interface includes those
+ * methods specified by {@link javax.management.MBeanInfo},
+ * so implementations should extend this class. Each method
+ * which returns an array of one of the <code>MBeanXXXInfo</code>
+ * classes should return an array containing instances
+ * of the equivalent open version (<code>OpenMBeanXXXInfo</code>).
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public interface OpenMBeanInfo
+{
+
+ /**
+ * Compares this attribute with the supplied object. This returns
+ * true iff the object is an instance of {@link OpenMBeanInfo}
+ * with the same class name and equal instances of the info classes.
+ *
+ * @param obj the object to compare.
+ * @return true if the object is a {@link OpenMBeanInfo}
+ * instance,
+ * <code>className.equals(object.getClassName())</code>
+ * and each info class has an equal in the other object.
+ */
+ boolean equals(Object obj);
+
+ /**
+ * Returns descriptions of each of the attributes provided by this
+ * management bean. The elements should be implementations of the
+ * {@link OpenMBeanAttributeInfo} class.
+ *
+ * @return an array of {@link OpenMBeanAttributeInfo} objects,
+ * representing the attributes emitted by this
+ * management bean.
+ */
+ MBeanAttributeInfo[] getAttributes();
+
+ /**
+ * Returns the class name of the management bean.
+ *
+ * @return the bean's class name.
+ */
+ String getClassName();
+
+ /**
+ * Returns descriptions of each of the constructors provided by this
+ * management bean. The elements should be implementations of the
+ * {@link OpenMBeanConstructorInfo} class.
+ *
+ * @return an array of {@link OpenMBeanConstructorInfo} objects,
+ * representing the constructors emitted by this
+ * management bean.
+ */
+ MBeanConstructorInfo[] getConstructors();
+
+ /**
+ * Returns a description of this operation.
+ *
+ * @return a human-readable description.
+ */
+ String getDescription();
+
+ /**
+ * Returns descriptions of each of the notifications provided by this
+ * management bean. The elements should be implementations of the
+ * {@link OpenMBeanNotificationInfo} class.
+ *
+ * @return an array of {@link OpenMBeanNotificationInfo} objects,
+ * representing the notifications emitted by this
+ * management bean.
+ */
+ MBeanNotificationInfo[] getNotifications();
+
+ /**
+ * Returns descriptions of each of the operations provided by this
+ * management bean. The elements should be implementations of the
+ * {@link OpenMBeanOperationInfo} class.
+ *
+ * @return an array of {@link OpenMBeanOperationInfo} objects,
+ * representing the operations emitted by this
+ * management bean.
+ */
+ MBeanOperationInfo[] getOperations();
+
+ /**
+ * Returns the hashcode of the bean information as the sum of the
+ * hashcodes of the class name and each array (calculated using
+ * java.util.HashSet(<code>java.util.Arrays.asList(signature)).hashCode()</code>).
+ *
+ * @return the hashcode of the bean information.
+ */
+ int hashCode();
+
+ /**
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.openmbean.OpenMBeanInfo</code>)
+ * along with the class name and textual representations
+ * of each array.
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ String toString();
+
+}
diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanInfoSupport.java b/libjava/classpath/javax/management/openmbean/OpenMBeanInfoSupport.java
new file mode 100644
index 00000000000..5f8d55b8377
--- /dev/null
+++ b/libjava/classpath/javax/management/openmbean/OpenMBeanInfoSupport.java
@@ -0,0 +1,191 @@
+/* OpenMBeanInfoSupport.java -- Open typed info about a bean.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management.openmbean;
+
+import java.util.Arrays;
+import java.util.HashSet;
+
+import javax.management.MBeanInfo;
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanConstructorInfo;
+import javax.management.MBeanNotificationInfo;
+import javax.management.MBeanOperationInfo;
+
+/**
+ * Describes an open management bean.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class OpenMBeanInfoSupport
+ extends MBeanInfo
+ implements OpenMBeanInfo
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = 4349395935420511492L;
+
+ /**
+ * The hash code of this instance.
+ */
+ private transient Integer hashCode;
+
+ /**
+ * The <code>toString()</code> result of this instance.
+ */
+ private transient String string;
+
+ /**
+ * Constructs a new {@link OpenMBeanInfo} using the supplied
+ * class name and description with the given attributes,
+ * operations, constructors and notifications. The class
+ * name does not have to actually specify a valid class that
+ * can be loaded by the MBean server or class loader; it merely
+ * has to be a syntactically correct class name. Any of the
+ * arrays may be <code>null</code>; this will be treated as if
+ * an empty array was supplied. A copy of the arrays is
+ * taken, so later changes have no effect.
+ *
+ * @param name the name of the class this instance describes.
+ * @param desc a description of the bean.
+ * @param attribs the attribute descriptions for the bean,
+ * or <code>null</code>.
+ * @param cons the constructor descriptions for the bean,
+ * or <code>null</code>.
+ * @param ops the operation descriptions for the bean,
+ * or <code>null</code>.
+ * @param notifs the notification descriptions for the bean,
+ * or <code>null</code>.
+ * @throws ArrayStoreException if a members of an array
+ * is not assignable to the equivalent
+ * <code>MBeanXXXInfo</code> class.
+ */
+ public OpenMBeanInfoSupport(String name, String desc,
+ OpenMBeanAttributeInfo[] attribs,
+ OpenMBeanConstructorInfo[] cons,
+ OpenMBeanOperationInfo[] ops,
+ MBeanNotificationInfo[] notifs)
+ {
+ super(name, desc, (MBeanAttributeInfo[]) attribs,
+ (MBeanConstructorInfo[]) cons,
+ (MBeanOperationInfo[]) ops,
+ notifs);
+ }
+
+ /**
+ * Compares this attribute with the supplied object. This returns
+ * true iff the object is an instance of {@link OpenMBeanInfo}
+ * with the same class name and equal instances of the info classes.
+ *
+ * @param obj the object to compare.
+ * @return true if the object is a {@link OpenMBeanInfo}
+ * instance,
+ * <code>className.equals(object.getClassName())</code>
+ * and each info class has an equal in the other object.
+ */
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof OpenMBeanInfo))
+ return false;
+ OpenMBeanInfo o = (OpenMBeanInfo) obj;
+ return getClassName().equals(o.getClassName()) &&
+ getAttributes().equals(o.getAttributes()) &&
+ getConstructors().equals(o.getConstructors()) &&
+ getNotifications().equals(o.getNotifications()) &&
+ getOperations().equals(o.getOperations());
+ }
+
+ /**
+ * <p>
+ * Returns the hashcode of the bean information as the sum of the
+ * hashcodes of the class name and each array (calculated using
+ * java.util.HashSet(<code>java.util.Arrays.asList(signature)).hashCode()</code>).
+ * </p>
+ * <p>
+ * As instances of this class are immutable, the return value
+ * is computed just once for each instance and reused
+ * throughout its life.
+ * </p>
+ *
+ * @return the hashcode of the bean information.
+ */
+ public int hashCode()
+ {
+ if (hashCode == null)
+ hashCode =
+ Integer.valueOf(getClassName().hashCode() +
+ new HashSet(Arrays.asList(getAttributes())).hashCode() +
+ new HashSet(Arrays.asList(getConstructors())).hashCode() +
+ new HashSet(Arrays.asList(getNotifications())).hashCode() +
+ new HashSet(Arrays.asList(getOperations())).hashCode());
+ return hashCode.intValue();
+ }
+
+ /**
+ * <p>
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.openmbean.OpenMBeanInfo</code>)
+ * along with the class name and textual representations
+ * of each array.
+ * </p>
+ * <p>
+ * As instances of this class are immutable, the return value
+ * is computed just once for each instance and reused
+ * throughout its life.
+ * </p>
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ public String toString()
+ {
+ if (string == null)
+ string = getClass().getName()
+ + "[className=" + getClassName()
+ + ",attributes=" + Arrays.toString(getAttributes())
+ + ",constructors=" + Arrays.toString(getConstructors())
+ + ",notifications=" + Arrays.toString(getNotifications())
+ + ",operations=" + Arrays.toString(getOperations())
+ + "]";
+ return string;
+ }
+
+}
diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfo.java b/libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfo.java
new file mode 100644
index 00000000000..8b61329d966
--- /dev/null
+++ b/libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfo.java
@@ -0,0 +1,154 @@
+/* OpenMBeanOperationInfo.java -- Open typed info about a operation.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management.openmbean;
+
+import javax.management.MBeanParameterInfo;
+
+/**
+ * Describes a operation for an open management bean.
+ * This interface includes those methods specified by {@link
+ * javax.management.MBeanOperationInfo}, so implementations should
+ * extend this class. The {@link #getSignature()} method should
+ * return an array containing instances of {@link OpenMBeanParameterInfo}.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public interface OpenMBeanOperationInfo
+{
+
+ /**
+ * Compares this attribute with the supplied object. This returns
+ * true iff the object is an instance of {@link OpenMBeanOperationInfo}
+ * with an equal name, signature, open return type and impact.
+ *
+ * @param obj the object to compare.
+ * @return true if the object is a {@link OpenMBeanParameterInfo}
+ * instance,
+ * <code>name.equals(object.getName())</code>,
+ * <code>signature.equals(object.getSignature())</code>,
+ * <code>returnOpenType.equals(object.getReturnOpenType())</code>,
+ * and <code>impact == object.getImpact()</code>.
+ */
+ boolean equals(Object obj);
+
+ /**
+ * Returns a description of this operation.
+ *
+ * @return a human-readable description.
+ */
+ String getDescription();
+
+ /**
+ * <p>
+ * Returns the impact of performing this operation.
+ * The value is equal to one of the following:
+ * </p>
+ * <ol>
+ * <li>{@link javax.management.MBeanOperationInfo#INFO}
+ * &mdash; the method just returns
+ * information (akin to an accessor).</li>
+ * <li>{@link javax.management.MBeanOperationInfo#ACTION}
+ * the method just alters the state of the bean, without
+ * returning a value (akin to a mutator).</li>
+ * <li>{@link javax.management.MBeanOperationInfo#ACTION_INFO}
+ * the method both makes state changes and returns a value.</li>
+ * <li>{@link javax.management.MBeanOperationInfo#UNKNOWN}
+ * the behaviour of the operation is unknown.</li>
+ * </ol>
+ *
+ * @return the impact of performing the operation.
+ */
+ int getImpact();
+
+ /**
+ * Returns the name of this operation.
+ *
+ * @return the name of the operation.
+ */
+ String getName();
+
+ /**
+ * Returns the open type instance which represents the type of the
+ * return value.
+ *
+ * @return the open type of the return value.
+ */
+ OpenType getReturnOpenType();
+
+ /**
+ * Returns the return type of the operation, as the class
+ * name. This should be identical to
+ * <code>getReturnOpenType.getClassName()</code>.
+ *
+ * @return the return type.
+ */
+ String getReturnType();
+
+ /**
+ * Returns the operation's signature, in the form of
+ * information on each parameter. Each parameter is
+ * described by an instance of {@link OpenMBeanParameterInfo}.
+ *
+ * @return an array of {@link OpenMBeanParameterInfo} objects,
+ * describing the operation parameters.
+ */
+ MBeanParameterInfo[] getSignature();
+
+ /**
+ * Returns the hashcode of the operation information as the sum of
+ * the hashcodes of the name, open return type, impact and signature
+ * (calculated by
+ * <code>java.util.Arrays.asList(signature).hashCode()</code>).
+ *
+ * @return the hashcode of the operation information.
+ */
+ int hashCode();
+
+ /**
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.openmbean.OpenMBeanOperationInfo</code>)
+ * along with the name, signature, open return type and impact.
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ String toString();
+
+}
diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfoSupport.java b/libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfoSupport.java
new file mode 100644
index 00000000000..07564897c2c
--- /dev/null
+++ b/libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfoSupport.java
@@ -0,0 +1,240 @@
+/* OpenMBeanOperationInfoSupport.java -- Open typed info about an operation.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management.openmbean;
+
+import java.util.Arrays;
+
+import javax.management.MBeanOperationInfo;
+import javax.management.MBeanParameterInfo;
+
+/**
+ * Describes a operation for an open management bean.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class OpenMBeanOperationInfoSupport
+ extends MBeanOperationInfo
+ implements OpenMBeanOperationInfo
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = 4996859732565369366L;
+
+ /**
+ * The open type representing the return value.
+ */
+ private OpenType returnOpenType;
+
+ /**
+ * The hash code of this instance.
+ */
+ private transient Integer hashCode;
+
+ /**
+ * The <code>toString()</code> result of this instance.
+ */
+ private transient String string;
+
+ /**
+ * Constructs a @link{OpenMBeanOperationInfo} with the specified name,
+ * description, parameter information, open return type and impact. A
+ * <code>null</code> value for the parameter information is the same
+ * as passing in an empty array. A copy of the parameter array is
+ * taken, so later changes have no effect. The name and the
+ * description may not be equal to the empty string, and neither
+ * the name, description nor the open return type may be
+ * <code>null</code>. The value of <code>impact</code> must be
+ * one of the four valid values
+ * ({@link javax.management.MBeanOperationInfo#INFO},
+ * {@link javax.management.MBeanOperationInfo#ACTION},
+ * {@link javax.management.MBeanOperationInfo#ACTION_INFO} and
+ * {@link javax.management.MBeanOperationInfo#UNKNOWN}).
+ *
+ *
+ * @param name the name of the constructor.
+ * @param desc a description of the attribute.
+ * @param sig the signature of the method, as a series
+ * of {@link MBeanParameterInfo} objects, one for
+ * each parameter.
+ * @param type the open return type of the method.
+ * @param impact the impact of performing the operation.
+ * @throws IllegalArgumentException if the name, description or
+ * open return type is <code>null</code>,
+ * the name or description are equal to
+ * the empty string, or the impact factor
+ * is not one of the values enumerated
+ * above.
+ * @throws ArrayStoreException if the members of the signature array
+ * are not assignable to
+ * {@link javax.management.MBeanParameterInfo}
+ */
+ public OpenMBeanOperationInfoSupport(String name, String desc,
+ OpenMBeanParameterInfo[] sig,
+ OpenType type, int impact)
+ {
+ super(name, desc, (MBeanParameterInfo[]) sig,
+ type == null ? null : type.getClassName(), impact);
+ if (name == null)
+ throw new IllegalArgumentException("The name may not be null.");
+ if (desc == null)
+ throw new IllegalArgumentException("The description may not be null.");
+ if (type == null)
+ throw new IllegalArgumentException("The type may not be null.");
+ if (name.length() == 0)
+ throw new IllegalArgumentException("The name may not be the empty string.");
+ if (desc.length() == 0)
+ throw new IllegalArgumentException("The description may not be the " +
+ "empty string.");
+ if (impact != ACTION && impact != INFO &&
+ impact != ACTION_INFO && impact != UNKNOWN)
+ throw new IllegalArgumentException("The impact factor is an invalid value.");
+ returnOpenType = type;
+ }
+
+ /**
+ * Compares this attribute with the supplied object. This returns
+ * true iff the object is an instance of {@link OpenMBeanOperationInfo}
+ * with an equal name, signature, open return type and impact.
+ *
+ * @param obj the object to compare.
+ * @return true if the object is a {@link OpenMBeanParameterInfo}
+ * instance,
+ * <code>name.equals(object.getName())</code>,
+ * <code>signature.equals(object.getSignature())</code>,
+ * <code>returnOpenType.equals(object.getReturnOpenType())</code>,
+ * and <code>impact == object.getImpact()</code>.
+ */
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof OpenMBeanOperationInfo))
+ return false;
+ OpenMBeanOperationInfo o = (OpenMBeanOperationInfo) obj;
+ return getName().equals(o.getName()) &&
+ getSignature().equals(o.getSignature()) &&
+ returnOpenType.equals(o.getReturnOpenType()) &&
+ getImpact() == o.getImpact();
+ }
+
+ /**
+ * Returns the open type instance which represents the type of the
+ * return value.
+ *
+ * @return the open type of the return value.
+ */
+ public OpenType getReturnOpenType()
+ {
+ return returnOpenType;
+ }
+
+ /**
+ * <p>
+ * Returns the hashcode of the operation information as the sum of
+ * the hashcodes of the name, open return type, impact and signature
+ * (calculated by
+ * <code>java.util.Arrays.asList(signature).hashCode()</code>).
+ * </p>
+ * <p>
+ * As instances of this class are immutable, the return value
+ * is computed just once for each instance and reused
+ * throughout its life.
+ * </p>
+ *
+ * @return the hashcode of the operation information.
+ */
+ public int hashCode()
+ {
+ if (hashCode == null)
+ hashCode = Integer.valueOf(getName().hashCode() +
+ returnOpenType.hashCode() +
+ Integer.valueOf(getImpact()).hashCode() +
+ Arrays.asList(getSignature()).hashCode());
+ return hashCode.intValue();
+ }
+
+ /**
+ * <p>
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.openmbean.OpenMBeanOperationInfo</code>)
+ * along with the name, signature, open return type and impact.
+ * </p>
+ * <p>
+ * As instances of this class are immutable, the return value
+ * is computed just once for each instance and reused
+ * throughout its life.
+ * </p>
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ public String toString()
+ {
+ if (string == null)
+ {
+ String impactString;
+ switch (getImpact())
+ {
+ case INFO:
+ impactString = "INFO";
+ break;
+ case ACTION:
+ impactString = "ACTION";
+ break;
+ case ACTION_INFO:
+ impactString = "ACTION_INFO";
+ break;
+ case UNKNOWN:
+ impactString = "UNKNOWN";
+ break;
+ default:
+ impactString = "ERRONEOUS VALUE";
+ }
+ string = getClass().getName()
+ + "[name=" + getName()
+ + ",signature=" + Arrays.toString(getSignature())
+ + ",returnOpenType=" + returnOpenType
+ + ",impact=" + impactString
+ + "]";
+ }
+ return string;
+ }
+
+}
diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfo.java b/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfo.java
new file mode 100644
index 00000000000..780e8ba1159
--- /dev/null
+++ b/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfo.java
@@ -0,0 +1,190 @@
+/* OpenMBeanParameterInfo.java -- Open typed info about a parameter.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management.openmbean;
+
+import java.util.Set;
+
+/**
+ * Describes the parameters of a constructor or operation associated
+ * with an open management bean. This interface includes those methods
+ * specified by {@link javax.management.MBeanParameterInfo}, so
+ * implementations should extend this class.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public interface OpenMBeanParameterInfo
+{
+
+ /**
+ * Compares this parameter with the supplied object. This returns
+ * true iff the object is an instance of {@link OpenMBeanParameterInfo}
+ * with an equal name and open type and the same default, minimum,
+ * maximum and legal values.
+ *
+ * @param obj the object to compare.
+ * @return true if the object is a {@link OpenMBeanParameterInfo}
+ * instance,
+ * <code>name.equals(object.getName())</code>,
+ * <code>openType.equals(object.getOpenType())</code>,
+ * <code>defaultValue.equals(object.getDefaultValue())</code>,
+ * <code>minValue.equals(object.getMinValue())</code>,
+ * <code>maxValue.equals(object.getMaxValue())</code>,
+ * and <code>legalValues.equals(object.getLegalValues())</code>.
+ */
+ boolean equals(Object obj);
+
+ /**
+ * Returns the default value of this parameter, or <code>null</code>
+ * if there is no default value.
+ *
+ * @return the default value of the parameter, or <code>null</code>
+ * if there is no default.
+ */
+ Object getDefaultValue();
+
+ /**
+ * Returns a description of this parameter.
+ *
+ * @return a human-readable description.
+ */
+ String getDescription();
+
+ /**
+ * Returns a {@link java.util.Set} enumerating the legal values
+ * of this parameter, or <code>null</code> if no such limited
+ * set exists for this parameter.
+ *
+ * @return a set of legal values, or <code>null</code> if no such
+ * set exists.
+ */
+ Set getLegalValues();
+
+ /**
+ * Returns the maximum value of this parameter, or <code>null</code>
+ * if there is no maximum.
+ *
+ * @return the maximum value, or <code>null</code> if none exists.
+ */
+ Comparable getMaxValue();
+
+ /**
+ * Returns the minimum value of this parameter, or <code>null</code>
+ * if there is no minimum.
+ *
+ * @return the minimum value, or <code>null</code> if none exists.
+ */
+ Comparable getMinValue();
+
+ /**
+ * Returns the name of this parameter.
+ *
+ * @return the name of the parameter.
+ */
+ String getName();
+
+ /**
+ * Returns the open type instance which represents the type of this
+ * parameter.
+ *
+ * @return the open type of this parameter.
+ */
+ OpenType getOpenType();
+
+ /**
+ * Returns true if this parameter has a default value.
+ *
+ * @return true if this parameter has a default.
+ */
+ boolean hasDefaultValue();
+
+ /**
+ * Returns the hashcode of the parameter information as the sum of
+ * the hashcodes of the name, open type, default value, maximum
+ * value, minimum value and the set of legal values.
+ *
+ * @return the hashcode of the parameter information.
+ */
+ int hashCode();
+
+ /**
+ * Returns true if there is a set of legal values for this
+ * parameter.
+ *
+ * @return true if a set of legal values exists for this
+ * parameter.
+ */
+ boolean hasLegalValues();
+
+ /**
+ * Returns true if there is a maximum value for this parameter.
+ *
+ * @return true if a maximum value exists for this parameter.
+ */
+ boolean hasMaxValue();
+
+ /**
+ * Returns true if there is a minimum value for this parameter.
+ *
+ * @return true if a minimum value exists for this parameter.
+ */
+ boolean hasMinValue();
+
+ /**
+ * Returns true if the specified object is a valid value for
+ * this parameter.
+ *
+ * @param obj the object to test.
+ * @return true if <code>obj</code> is a valid value for this
+ * parameter.
+ */
+ boolean isValue(Object obj);
+
+ /**
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.openmbean.OpenMBeanParameterInfo</code>)
+ * along with the name, open type, default, minimum, maximum
+ * and legal values of the parameter.
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ String toString();
+
+}
diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java b/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java
new file mode 100644
index 00000000000..af3bda6c738
--- /dev/null
+++ b/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java
@@ -0,0 +1,511 @@
+/* OpenMBeanParameterInfoSupport.java -- Open typed info about a parameter.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management.openmbean;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.management.MBeanParameterInfo;
+
+/**
+ * Describes the parameters of a constructor or operation associated
+ * with an open management bean.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class OpenMBeanParameterInfoSupport
+ extends MBeanParameterInfo
+ implements OpenMBeanParameterInfo
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = -7235016873758443122L;
+
+ /**
+ * The open type of the parameter.
+ */
+ private OpenType openType;
+
+ /**
+ * The default value of the parameter (may be <code>null</code>).
+ */
+ private Object defaultValue;
+
+ /**
+ * The possible legal values of the parameter (may be <code>null</code>).
+ */
+ private Set legalValues;
+
+ /**
+ * The minimum value of the parameter (may be <code>null</code>).
+ */
+ private Comparable minValue;
+
+ /**
+ * The maximum value of the parameter (may be <code>null</code>).
+ */
+ private Comparable maxValue;
+
+ /**
+ * The hash code of this instance.
+ */
+ private transient Integer hashCode;
+
+ /**
+ * The <code>toString()</code> result of this instance.
+ */
+ private transient String string;
+
+ /**
+ * Constructs a new {@link OpenMBeanParameterInfo} using the specified
+ * name, description and open type. None of these values may be
+ * <code>null</code> and the name and description may not be equal
+ * to the empty string.
+ *
+ * @param name the name of the parameter.
+ * @param desc a description of the parameter.
+ * @param type the open type of the parameter.
+ * @throws IllegalArgumentException if the name, description or
+ * open type are <code>null</code>
+ * or the name or description are
+ * the empty string.
+ */
+ public OpenMBeanParameterInfoSupport(String name, String desc, OpenType type)
+ {
+ super(name, type == null ? null : type.getClassName(), desc);
+ if (name == null)
+ throw new IllegalArgumentException("The name may not be null.");
+ if (desc == null)
+ throw new IllegalArgumentException("The description may not be null.");
+ if (type == null)
+ throw new IllegalArgumentException("The type may not be null.");
+ if (name.length() == 0)
+ throw new IllegalArgumentException("The name may not be the empty string.");
+ if (desc.length() == 0)
+ throw new IllegalArgumentException("The description may not be the " +
+ "empty string.");
+ openType = type;
+ }
+
+ /**
+ * Constructs a new {@link OpenMBeanParameterInfo} using the
+ * specified name, description, open type and default value. The
+ * name, description and open type cannot be <code>null</code> and
+ * the name and description may not be equal to the empty string.
+ * The default value may be <code>null</code>. If non-null, it must
+ * be a valid value of the given open type. Default values are not
+ * applicable to the open types, {@link ArrayType} and {@link
+ * TabularType}.
+ *
+ * @param name the name of the parameter.
+ * @param desc a description of the parameter.
+ * @param type the open type of the parameter.
+ * @param defaultValue the default value of the parameter.
+ * @throws IllegalArgumentException if the name, description or
+ * open type are <code>null</code>
+ * or the name or description are
+ * the empty string.
+ * @throws OpenDataException if <code>defaultValue<code> is non-null
+ * and is either not a value of the given
+ * open type or the open type is an instance
+ * of {@link ArrayType} or {@link TabularType}.
+ */
+ public OpenMBeanParameterInfoSupport(String name, String desc, OpenType type,
+ Object defaultValue)
+ throws OpenDataException
+ {
+ this(name, desc, type, defaultValue, null);
+ }
+
+ /**
+ * <p>
+ * Constructs a new {@link OpenMBeanParameterInfo} using the
+ * specified name, description, open type, default, maximum and
+ * minimum values. The name, description and open type cannot be
+ * <code>null</code> and the name and description may not be equal
+ * to the empty string. The default, maximum and minimum values may
+ * be <code>null</code>. The following conditions apply when the
+ * parameters mentioned are non-null:
+ * </p>
+ * <ul>
+ * <li>The values must be valid values for the given open type.</li>
+ * <li>Default values are not applicable to the open types, {@link
+ * ArrayType} and {@link TabularType}.</li>
+ * <li>The minimum value must be smaller than or equal to the maximum value
+ * (literally, <code>minValue.compareTo(maxValue) <= 0</code>.</li>
+ * <li>The minimum value must be smaller than or equal to the default value
+ * (literally, <code>minValue.compareTo(defaultValue) <= 0</code>.</li>
+ * <li>The default value must be smaller than or equal to the maximum value
+ * (literally, <code>defaultValue.compareTo(maxValue) <= 0</code>.</li>
+ * </ul>
+ *
+ * @param name the name of the parameter.
+ * @param desc a description of the parameter.
+ * @param type the open type of the parameter.
+ * @param defaultValue the default value of the parameter, or <code>null</code>.
+ * @param minimumValue the minimum value of the parameter, or <code>null</code>.
+ * @param maximumValue the maximum value of the parameter, or <code>null</code>.
+ * @throws IllegalArgumentException if the name, description or
+ * open type are <code>null</code>
+ * or the name or description are
+ * the empty string.
+ * @throws OpenDataException if any condition in the list above is broken.
+ */
+ public OpenMBeanParameterInfoSupport(String name, String desc, OpenType type,
+ Object defaultValue, Comparable minimumValue,
+ Comparable maximumValue)
+ throws OpenDataException
+ {
+ this(name, desc, type);
+ if (defaultValue != null && !(type.isValue(defaultValue)))
+ throw new OpenDataException("The default value is not a member of the " +
+ "open type given.");
+ if (minimumValue != null && !(type.isValue(minimumValue)))
+ throw new OpenDataException("The minimum value is not a member of the " +
+ "open type given.");
+ if (maximumValue != null && !(type.isValue(maximumValue)))
+ throw new OpenDataException("The maximum value is not a member of the " +
+ "open type given.");
+ if (defaultValue != null && (type instanceof ArrayType ||
+ type instanceof TabularType))
+ throw new OpenDataException("Default values are not applicable for " +
+ "array or tabular types.");
+ if (minValue != null && maxValue != null
+ && minValue.compareTo(maxValue) > 0)
+ throw new OpenDataException("The minimum value is greater than the " +
+ "maximum.");
+ if (minValue != null && defaultValue != null
+ && minValue.compareTo(defaultValue) > 0)
+ throw new OpenDataException("The minimum value is greater than the " +
+ "default.");
+ if (defaultValue != null && maxValue != null
+ && maxValue.compareTo(defaultValue) < 0)
+ throw new OpenDataException("The default value is greater than the " +
+ "maximum.");
+
+ this.defaultValue = defaultValue;
+ minValue = minimumValue;
+ maxValue = maximumValue;
+ }
+
+ /**
+ * <p>
+ * Constructs a new {@link OpenMBeanParameterInfo} using the
+ * specified name, description, open type, default value and
+ * set of legal values. The name, description and open type cannot be
+ * <code>null</code> and the name and description may not be equal
+ * to the empty string. The default, maximum and minimum values may
+ * be <code>null</code>. The following conditions apply when the
+ * parameters mentioned are non-null:
+ * </p>
+ * <ul>
+ * <li>The default value and each of the legal values must be a valid
+ * value for the given open type.</li>
+ * <li>Default and legal values are not applicable to the open types, {@link
+ * ArrayType} and {@link TabularType}.</li>
+ * <li>The default value is not in the set of legal values.</li>
+ * </ul>
+ * <p>
+ * The legal values are copied from the array into a unmodifiable set,
+ * so future modifications to the array have no effect.
+ * </p>
+ *
+ * @param name the name of the parameter.
+ * @param desc a description of the parameter.
+ * @param type the open type of the parameter.
+ * @param defaultValue the default value of the parameter, or <code>null</code>.
+ * @param legalValues the legal values of the parameter. May be
+ * <code>null</code> or an empty array.
+ * @throws IllegalArgumentException if the name, description or
+ * open type are <code>null</code>
+ * or the name or description are
+ * the empty string.
+ * @throws OpenDataException if any condition in the list above is broken.
+ */
+ public OpenMBeanParameterInfoSupport(String name, String desc, OpenType type,
+ Object defaultValue, Object[] legalValues)
+ throws OpenDataException
+ {
+ this(name, desc, type);
+ if (defaultValue != null && !(type.isValue(defaultValue)))
+ throw new OpenDataException("The default value is not a member of the " +
+ "open type given.");
+ if (defaultValue != null && (type instanceof ArrayType ||
+ type instanceof TabularType))
+ throw new OpenDataException("Default values are not applicable for " +
+ "array or tabular types.");
+ if (legalValues != null && (type instanceof ArrayType ||
+ type instanceof TabularType))
+ throw new OpenDataException("Legal values are not applicable for " +
+ "array or tabular types.");
+ if (legalValues != null && legalValues.length > 0)
+ {
+ Set lv = new HashSet(legalValues.length);
+ for (int a = 0; a < legalValues.length; ++a)
+ {
+ if (legalValues[a] != null &&
+ !(type.isValue(legalValues[a])))
+ throw new OpenDataException("The legal value, "
+ + legalValues[a] +
+ "is not a member of the " +
+ "open type given.");
+ lv.add(legalValues[a]);
+ }
+ if (defaultValue != null && !(lv.contains(defaultValue)))
+ throw new OpenDataException("The default value is not in the set " +
+ "of legal values.");
+ this.legalValues = Collections.unmodifiableSet(lv);
+ }
+ this.defaultValue = defaultValue;
+ }
+
+ /**
+ * Compares this parameter with the supplied object. This returns
+ * true iff the object is an instance of {@link OpenMBeanParameterInfo}
+ * with an equal name and open type and the same default, minimum,
+ * maximum and legal values.
+ *
+ * @param obj the object to compare.
+ * @return true if the object is a {@link OpenMBeanParameterInfo}
+ * instance,
+ * <code>name.equals(object.getName())</code>,
+ * <code>openType.equals(object.getOpenType())</code>,
+ * <code>defaultValue.equals(object.getDefaultValue())</code>,
+ * <code>minValue.equals(object.getMinValue())</code>,
+ * <code>maxValue.equals(object.getMaxValue())</code>,
+ * and <code>legalValues.equals(object.getLegalValues())</code>.
+ */
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof OpenMBeanParameterInfo))
+ return false;
+ OpenMBeanParameterInfo o = (OpenMBeanParameterInfo) obj;
+ return getName().equals(o.getName()) &&
+ openType.equals(o.getOpenType()) &&
+ (defaultValue == null ? o.getDefaultValue() == null :
+ defaultValue.equals(o.getDefaultValue())) &&
+ (minValue == null ? o.getMinValue() == null :
+ minValue.equals(o.getMinValue())) &&
+ (maxValue == null ? o.getMaxValue() == null :
+ maxValue.equals(o.getMaxValue())) &&
+ (legalValues == null ? o.getLegalValues() == null :
+ legalValues.equals(o.getLegalValues()));
+ }
+
+ /**
+ * Returns the default value of this parameter, or <code>null</code>
+ * if there is no default value.
+ *
+ * @return the default value of the parameter, or <code>null</code>
+ * if there is no default.
+ */
+ public Object getDefaultValue()
+ {
+ return defaultValue;
+ }
+
+ /**
+ * Returns a {@link java.util.Set} enumerating the legal values
+ * of this parameter, or <code>null</code> if no such limited
+ * set exists for this parameter.
+ *
+ * @return a set of legal values, or <code>null</code> if no such
+ * set exists.
+ */
+ public Set getLegalValues()
+ {
+ return legalValues;
+ }
+
+ /**
+ * Returns the maximum value of this parameter, or <code>null</code>
+ * if there is no maximum.
+ *
+ * @return the maximum value, or <code>null</code> if none exists.
+ */
+ public Comparable getMaxValue()
+ {
+ return maxValue;
+ }
+
+ /**
+ * Returns the minimum value of this parameter, or <code>null</code>
+ * if there is no minimum.
+ *
+ * @return the minimum value, or <code>null</code> if none exists.
+ */
+ public Comparable getMinValue()
+ {
+ return minValue;
+ }
+
+ /**
+ * Returns the open type instance which represents the type of this
+ * parameter.
+ *
+ * @return the open type of this parameter.
+ */
+ public OpenType getOpenType()
+ {
+ return openType;
+ }
+
+ /**
+ * Returns true if this parameter has a default value
+ * (i.e. the value is non-null).
+ *
+ * @return true if this parameter has a default.
+ */
+ public boolean hasDefaultValue()
+ {
+ return defaultValue != null;
+ }
+
+ /**
+ * <p>
+ * Returns the hashcode of the parameter information as the sum of
+ * the hashcodes of the name, open type, default value, maximum
+ * value, minimum value and the set of legal values.
+ * </p>
+ * <p>
+ * As instances of this class are immutable, the hash code
+ * is computed just once for each instance and reused
+ * throughout its life.
+ * </p>
+ *
+ * @return the hashcode of the parameter information.
+ */
+ public int hashCode()
+ {
+ if (hashCode == null)
+ hashCode = Integer.valueOf(getName().hashCode() +
+ openType.hashCode() +
+ (defaultValue == null ? 0 :
+ defaultValue.hashCode()) +
+ (minValue == null ? 0 :
+ minValue.hashCode()) +
+ (maxValue == null ? 0 :
+ maxValue.hashCode()) +
+ (legalValues == null ? 0 :
+ legalValues.hashCode()));
+ return hashCode.intValue();
+ }
+
+ /**
+ * Returns true if there is a set of legal values for this
+ * parameter (i.e. the value is non-null).
+ *
+ * @return true if a set of legal values exists for this
+ * parameter.
+ */
+ public boolean hasLegalValues()
+ {
+ return legalValues != null;
+ }
+
+ /**
+ * Returns true if there is a maximum value for this parameter
+ * (i.e. the value is non-null).
+ *
+ * @return true if a maximum value exists for this parameter.
+ */
+ public boolean hasMaxValue()
+ {
+ return maxValue != null;
+ }
+
+ /**
+ * Returns true if there is a minimum value for this parameter.
+ * (i.e. the value is non-null).
+ *
+ * @return true if a minimum value exists for this parameter.
+ */
+ public boolean hasMinValue()
+ {
+ return minValue != null;
+ }
+
+ /**
+ * Returns true if the specified object is a valid value for
+ * this parameter.
+ *
+ * @param obj the object to test.
+ * @return true if <code>obj</code> is a valid value for this
+ * parameter.
+ */
+ public boolean isValue(Object obj)
+ {
+ return openType.isValue(obj);
+ }
+
+ /**
+ * <p>
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.openmbean.OpenMBeanParameterInfo</code>)
+ * along with the name, open type, default, minimum, maximum
+ * and legal values of the parameter.
+ * </p>
+ * <p>
+ * As instances of this class are immutable, the return value
+ * is computed just once for each instance and reused
+ * throughout its life.
+ * </p>
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ public String toString()
+ {
+ if (string == null)
+ string = getClass().getName()
+ + "[name=" + getName()
+ + ",openType=" + openType
+ + ",defaultValue=" + defaultValue
+ + ",minValue=" + minValue
+ + ",maxValue=" + maxValue
+ + ",legalValues=" + legalValues
+ + "]";
+ return string;
+ }
+
+}
diff --git a/libjava/classpath/javax/management/openmbean/OpenType.java b/libjava/classpath/javax/management/openmbean/OpenType.java
index b08c40cccce..13c9e8a3e01 100644
--- a/libjava/classpath/javax/management/openmbean/OpenType.java
+++ b/libjava/classpath/javax/management/openmbean/OpenType.java
@@ -133,11 +133,11 @@ public abstract class OpenType
testString = className;
boolean openTypeFound = false;
for (int a = 0; a < ALLOWED_CLASSNAMES.length; ++a)
- if (ALLOWED_CLASSNAMES[a].equals(className))
+ if (ALLOWED_CLASSNAMES[a].equals(testString))
openTypeFound = true;
if (!openTypeFound)
- throw new OpenDataException("The class name does not specify " +
- "a valid open type.");
+ throw new OpenDataException("The class name, " + testString +
+ ", does not specify a valid open type.");
this.className = className;
typeName = name;
description = desc;
diff --git a/libjava/classpath/javax/management/openmbean/SimpleType.java b/libjava/classpath/javax/management/openmbean/SimpleType.java
index 3962909d4bb..39753f1c6ea 100644
--- a/libjava/classpath/javax/management/openmbean/SimpleType.java
+++ b/libjava/classpath/javax/management/openmbean/SimpleType.java
@@ -53,7 +53,7 @@ import java.io.ObjectStreamException;
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.5
*/
-public class SimpleType
+public final class SimpleType
extends OpenType
{
diff --git a/libjava/classpath/javax/management/openmbean/TabularData.java b/libjava/classpath/javax/management/openmbean/TabularData.java
index 17c8de98109..7e57e0fd815 100644
--- a/libjava/classpath/javax/management/openmbean/TabularData.java
+++ b/libjava/classpath/javax/management/openmbean/TabularData.java
@@ -55,12 +55,14 @@ public interface TabularData
/**
* Calculates the index the specified {@link CompositeData} value
* would have, if it was to be added to this {@link TabularData}
- * instance. This method includes a check that the type of
- * the given value is the same as the row type of this instance,
- * but not a check for existing instances of the given value.
- * The value must also not be <code>null</code>. Possible indices
- * are returned by the {@link TabularType#getIndexNames()} method
- * of this instance's tabular type.
+ * instance. This method includes a check that the type of the
+ * given value is the same as the row type of this instance, but not
+ * a check for existing instances of the given value. The value
+ * must also not be <code>null</code>. Possible indices are
+ * returned by the {@link TabularType#getIndexNames()} method of
+ * this instance's tabular type. The returned indices are the
+ * values of the fields in the supplied {@link CompositeData}
+ * instance that match the names given in the {@link TabularType}.
*
* @param val the {@link CompositeData} value whose index should
* be calculated.
@@ -106,7 +108,7 @@ public interface TabularData
* Compares the specified object with this object for equality.
* The object is judged equivalent if it is non-null, and also
* an instance of {@link TabularData} with the same row type,
- * and index to value mappings. The two compared instances may
+ * and {@link CompositeData} values. The two compared instances may
* be equivalent even if they represent different implementations
* of {@link TabularData}.
*
@@ -123,9 +125,9 @@ public interface TabularData
* @return the matching {@link CompositeData} value, or
* <code>null</code> if one does not exist.
* @throws NullPointerException if the key is <code>null</code>.
- * @throws InvalidOpenTypeException if the key does not match
- * the {@link TabularType} of this
- * instance.
+ * @throws InvalidKeyException if the key does not match
+ * the {@link TabularType} of this
+ * instance.
*/
CompositeData get(Object[] key);
@@ -138,14 +140,12 @@ public interface TabularData
TabularType getTabularType();
/**
- * Returns the hash code of the composite data type.
- * This is computed as the sum of the hash codes of the
- * each index and its value, together with the hash
- * code of the tabular type. These are the same elements
- * of the type that are compared as part of the
- * {@link #equals(java.lang.Object)} method, thus ensuring
- * that the hashcode is compatible with the equality
- * test.
+ * Returns the hash code of the composite data type. This is
+ * computed as the sum of the hash codes of each value, together
+ * with the hash code of the tabular type. These are the same
+ * elements of the type that are compared as part of the {@link
+ * #equals(java.lang.Object)} method, thus ensuring that the
+ * hashcode is compatible with the equality test.
*
* @return the hash code of this instance.
*/
@@ -196,15 +196,16 @@ public interface TabularData
* values in the array, as well as from the existing values
* in the table. The operation should be atomic; if one
* value can not be added, then none of the values should
- * be.
+ * be. If the array is <code>null</code> or empty, the
+ * method simply returns.
*
* @param vals the {@link CompositeData} values to add.
- * @throws NullPointerException if <code>val</code> is
+ * @throws NullPointerException if a value from the array is
* <code>null</code>.
- * @throws InvalidOpenTypeException if the type of the
+ * @throws InvalidOpenTypeException if the type of a
* given value does not
* match the row type.
- * @throws KeyAlreadyExistsException if the value has the
+ * @throws KeyAlreadyExistsException if a value has the
* same calculated index
* as an existing value or
* of one of the other
diff --git a/libjava/classpath/javax/management/openmbean/TabularDataSupport.java b/libjava/classpath/javax/management/openmbean/TabularDataSupport.java
new file mode 100644
index 00000000000..9dc8a0e9727
--- /dev/null
+++ b/libjava/classpath/javax/management/openmbean/TabularDataSupport.java
@@ -0,0 +1,652 @@
+/* TabularDataSupport.java -- Tables of composite data structures.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.management.openmbean;
+
+import java.io.Serializable;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Provides an implementation of the {@link TabularData}
+ * interface using a {@link java.util.HashMap}.
+ *
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ * @since 1.5
+ */
+public class TabularDataSupport
+ implements TabularData, Serializable, Cloneable, Map
+{
+
+ /**
+ * Compatible with JDK 1.5
+ */
+ private static final long serialVersionUID = 5720150593236309827L;
+
+ /**
+ * Mapping of rows to column values.
+ *
+ * @serial the map of rows to column values.
+ */
+ private Map dataMap;
+
+ /**
+ * The tabular type which represents this tabular data instance.
+ *
+ * @serial the type information for this instance.
+ */
+ private TabularType tabularType;
+
+ /**
+ * Constructs a new empty {@link TabularDataSupport} with the
+ * specified type. The type may not be null. This constructor
+ * simply calls the other, with the default initial capacity of
+ * <code>101</code> and default load factor of <code>0.75</code>.
+ *
+ * @param type the tabular type of this tabular data instance.
+ * @throws IllegalArgumentException if <code>type</code> is
+ * <code>null</code>.
+ */
+ public TabularDataSupport(TabularType type)
+ {
+ this(type, 101, 0.75f);
+ }
+
+ /**
+ * Constructs a new empty {@link TabularDataSupport} with the
+ * specified type and the supplied initial capacity and load factor
+ * being used for the underlying {@link java.util.HashMap}. The
+ * type may not be null and the initial capacity and load factor
+ * must be positive.
+ *
+ * @param type the tabular type of this tabular data instance.
+ * @param cap the initial capacity of the underlying map.
+ * @param lf the load factor of the underlying map.
+ * @throws IllegalArgumentException if <code>type</code> is
+ * <code>null</code>, or
+ * <code>cap</code> or
+ * <code>lf</code> are
+ * negative.
+ */
+ public TabularDataSupport(TabularType type, int cap, float lf)
+ {
+ if (type == null)
+ throw new IllegalArgumentException("The type may not be null.");
+ tabularType = type;
+ dataMap = new HashMap(cap, lf);
+ }
+
+ /**
+ * Calculates the index the specified {@link CompositeData} value
+ * would have, if it was to be added to this {@link TabularData}
+ * instance. This method includes a check that the type of the
+ * given value is the same as the row type of this instance, but not
+ * a check for existing instances of the given value. The value
+ * must also not be <code>null</code>. Possible indices are
+ * selected by the {@link TabularType#getIndexNames()} method of
+ * this instance's tabular type. The returned indices are the
+ * values of the fields in the supplied {@link CompositeData}
+ * instance that match the names given in the {@link TabularType}.
+ *
+ * @param val the {@link CompositeData} value whose index should
+ * be calculated.
+ * @return the index the value would take on, if it were to be added.
+ * @throws NullPointerException if the value is <code>null</code>.
+ * @throws InvalidOpenTypeException if the value does not match the
+ * row type of this instance.
+ */
+ public Object[] calculateIndex(CompositeData val)
+ {
+ if (!(val.getCompositeType().equals(tabularType.getRowType())))
+ throw new InvalidOpenTypeException("The type of the given value " +
+ "does not match the row type " +
+ "of this instance.");
+ List indexNames = tabularType.getIndexNames();
+ List matchingIndicies = new ArrayList(indexNames.size());
+ Iterator it = indexNames.iterator();
+ while (it.hasNext())
+ {
+ String name = (String) it.next();
+ matchingIndicies.add(val.get(name));
+ }
+ return matchingIndicies.toArray();
+ }
+
+ /**
+ * Removes all {@link CompositeData} values from the table.
+ */
+ public void clear()
+ {
+ dataMap.clear();
+ }
+
+ /**
+ * Returns a shallow clone of the information, as obtained by the
+ * {@link Object} implementation of {@link Object#clone()}. The map
+ * is also cloned, but it still references the same objects.
+ *
+ * @return a shallow clone of this {@link TabularDataSupport}.
+ */
+ public Object clone()
+ {
+ TabularDataSupport clone = null;
+ try
+ {
+ clone = (TabularDataSupport) super.clone();
+ clone.setMap((HashMap) ((HashMap) dataMap).clone());
+ }
+ catch (CloneNotSupportedException e)
+ {
+ /* This won't happen as we implement Cloneable */
+ }
+ return clone;
+ }
+
+ /**
+ * Returns true iff this instance of the {@link TabularData} class
+ * contains a {@link CompositeData} value at the specified index.
+ * The method returns <code>false</code> if the given key can
+ * not be cast to an {@link java.lang.Object} array; otherwise
+ * it returns the result of {@link #containsKey(java.lang.Object[])}.
+ *
+ *
+ * @param key the key to test for.
+ * @return true if the key maps to a {@link CompositeData} value.
+ */
+ public boolean containsKey(Object key)
+ {
+ if (key instanceof Object[])
+ return containsKey((Object[]) key);
+ else
+ return false;
+ }
+
+ /**
+ * Returns true iff this instance of the {@link TabularData} class
+ * contains a {@link CompositeData} value at the specified index.
+ * In any other circumstance, including if the given key
+ * is <code>null</code> or of the incorrect type, according to
+ * the {@link TabularType} of this instance, this method returns
+ * false.
+ *
+ * @param key the key to test for.
+ * @return true if the key maps to a {@link CompositeData} value.
+ */
+ public boolean containsKey(Object[] key)
+ {
+ if (key == null)
+ return false;
+ if (!(isKeyValid(key)))
+ return false;
+ return dataMap.containsKey(key);
+ }
+
+ /**
+ * Returns true iff this instance of the {@link TabularData} class
+ * contains the specified {@link CompositeData} value. If the given
+ * value is not an instance of {@link CompositeData}, this method
+ * simply returns false.
+ *
+ * @param val the value to test for.
+ * @return true if the value exists.
+ */
+ public boolean containsValue(Object val)
+ {
+ if (val instanceof CompositeData)
+ return containsValue((CompositeData) val);
+ else
+ return false;
+ }
+
+ /**
+ * Returns true iff this instance of the {@link TabularData} class
+ * contains the specified {@link CompositeData} value.
+ * In any other circumstance, including if the given value
+ * is <code>null</code> or of the incorrect type, according to
+ * the {@link TabularType} of this instance, this method returns
+ * false.
+ *
+ * @param val the value to test for.
+ * @return true if the value exists.
+ */
+ public boolean containsValue(CompositeData val)
+ {
+ if (val == null)
+ return false;
+ if (!(val.getCompositeType().equals(tabularType.getRowType())))
+ return false;
+ return dataMap.containsValue(val);
+ }
+
+ /**
+ * <p>
+ * Returns a set view of the mappings in this Map. Each element in the
+ * set is a Map.Entry. The set is backed by the map, so that changes in
+ * one show up in the other. Modifications made while an iterator is
+ * in progress cause undefined behavior. If the set supports removal,
+ * these methods remove the underlying mapping from the map:
+ * <code>Iterator.remove</code>, <code>Set.remove</code>,
+ * <code>removeAll</code>, <code>retainAll</code>, and <code>clear</code>.
+ * Element addition, via <code>add</code> or <code>addAll</code>, is
+ * not supported via this set.
+ * </p>
+ * <p>
+ * <strong>Note</strong>: using the
+ * {@link java.util.Map.Entry#setValue(Object) will cause corruption of
+ * the index to row mappings.
+ * </p>
+ *
+ * @return the set view of all mapping entries
+ * @see java.util.Map.Entry
+ */
+ public Set entrySet()
+ {
+ return dataMap.entrySet();
+ }
+
+ /**
+ * Compares the specified object with this object for equality.
+ * The object is judged equivalent if it is non-null, and also
+ * an instance of {@link TabularData} with the same row type,
+ * and {@link CompositeData} values. The two compared instances may
+ * be equivalent even if they represent different implementations
+ * of {@link TabularData}.
+ *
+ * @param obj the object to compare for equality.
+ * @return true if <code>obj</code> is equal to <code>this</code>.
+ */
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof TabularData))
+ return false;
+ TabularData data = (TabularData) obj;
+ return tabularType.equals(data.getTabularType()) &&
+ dataMap.values().equals(data.values());
+ }
+
+ /**
+ * Retrieves the value for the specified key by simply
+ * calling <code>get((Object[]) key)</code>.
+ *
+ * @param key the key whose value should be returned.
+ * @return the matching {@link CompositeData} value, or
+ * <code>null</code> if one does not exist.
+ * @throws NullPointerException if the key is <code>null</code>.
+ * @throws ClassCastException if the key is not an instance
+ * of <code>Object[]</code>.
+ * @throws InvalidKeyException if the key does not match
+ * the {@link TabularType} of this
+ * instance.
+ */
+ public Object get(Object key)
+ {
+ return get((Object[]) key);
+ }
+
+ /**
+ * Retrieves the {@link CompositeData} value for the specified
+ * key, or <code>null</code> if no such mapping exists.
+ *
+ * @param key the key whose value should be returned.
+ * @return the matching {@link CompositeData} value, or
+ * <code>null</code> if one does not exist.
+ * @throws NullPointerException if the key is <code>null</code>.
+ * @throws InvalidKeyException if the key does not match
+ * the {@link TabularType} of this
+ * instance.
+ */
+ public CompositeData get(Object[] key)
+ {
+ if (!(isKeyValid(key)))
+ throw new InvalidKeyException("The key does not match the " +
+ "tabular type of this instance.");
+ return (CompositeData) dataMap.get(key);
+ }
+
+ /**
+ * Returns the tabular type which corresponds to this instance
+ * of {@link TabularData}.
+ *
+ * @return the tabular type for this instance.
+ */
+ public TabularType getTabularType()
+ {
+ return tabularType;
+ }
+
+ /**
+ * Returns the hash code of the composite data type. This is
+ * computed as the sum of the hash codes of each value, together
+ * with the hash code of the tabular type. These are the same
+ * elements of the type that are compared as part of the {@link
+ * #equals(java.lang.Object)} method, thus ensuring that the
+ * hashcode is compatible with the equality test.
+ *
+ * @return the hash code of this instance.
+ */
+ public int hashCode()
+ {
+ return tabularType.hashCode() + dataMap.values().hashCode();
+ }
+
+ /**
+ * Returns true if this {@link TabularData} instance
+ * contains no {@link CompositeData} values.
+ *
+ * @return true if the instance is devoid of rows.
+ */
+ public boolean isEmpty()
+ {
+ return dataMap.isEmpty();
+ }
+
+ /**
+ * Returns true if the given key is valid for the
+ * @link{TabularType} of this instance.
+ *
+ * @return true if the key is valid.
+ * @throws NullPointerException if <code>key</code>
+ * is null.
+ */
+ private boolean isKeyValid(Object[] key)
+ {
+ Iterator it = tabularType.getIndexNames().iterator();
+ CompositeType rowType = tabularType.getRowType();
+ for (int a = 0; it.hasNext(); ++a)
+ {
+ OpenType type = rowType.getType((String) it.next());
+ if (!(type.isValue(key[a])))
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Returns a set view of the keys in this Map. The set is backed by the
+ * map, so that changes in one show up in the other. Modifications made
+ * while an iterator is in progress cause undefined behavior. If the set
+ * supports removal, these methods remove the underlying mapping from
+ * the map: <code>Iterator.remove</code>, <code>Set.remove</code>,
+ * <code>removeAll</code>, <code>retainAll</code>, and <code>clear</code>.
+ * Element addition, via <code>add</code> or <code>addAll</code>, is
+ * not supported via this set.
+ *
+ * @return the set view of all keys
+ */
+ public Set keySet()
+ {
+ return dataMap.keySet();
+ }
+
+ /**
+ * Adds the specified {@link CompositeData} value to the
+ * table. The value must be non-null, of the same type
+ * as the row type of this instance, and must not have
+ * the same index as an existing value. The index is
+ * calculated using the index names of the
+ * {@link TabularType} for this instance.
+ *
+ * @param val the {@link CompositeData} value to add.
+ * @throws NullPointerException if <code>val</code> is
+ * <code>null</code>.
+ * @throws InvalidOpenTypeException if the type of the
+ * given value does not
+ * match the row type.
+ * @throws KeyAlreadyExistsException if the value has the
+ * same calculated index
+ * as an existing value.
+ */
+ public void put(CompositeData val)
+ {
+ Object[] key = calculateIndex(val);
+ if (dataMap.containsKey(key))
+ throw new KeyAlreadyExistsException("A value with this index " +
+ "already exists.");
+ dataMap.put(key, val);
+ }
+
+ /**
+ * Adds the specified {@link CompositeData} value to the
+ * table, ignoring the supplied key, by simply calling
+ * <code>put((CompositeData) val)</code>.
+ *
+ * @param key ignored.
+ * @param val the {@link CompositeData} value to add.
+ * @return the {@link CompositeData} value.
+ * @throws NullPointerException if <code>val</code> is
+ * <code>null</code>.
+ * @throws InvalidOpenTypeException if the type of the
+ * given value does not
+ * match the row type.
+ * @throws KeyAlreadyExistsException if the value has the
+ * same calculated index
+ * as an existing value.
+ */
+ public Object put(Object key, Object val)
+ {
+ put((CompositeData) val);
+ return val;
+ }
+
+ /**
+ * Adds each of the specified {@link CompositeData} values
+ * to the table. Each element of the array must meet the
+ * conditions given for the {@link #put(CompositeData)}
+ * method. In addition, the index of each value in the
+ * array must be distinct from the index of the other
+ * values in the array, as well as from the existing values
+ * in the table. The operation should be atomic; if one
+ * value can not be added, then none of the values should
+ * be. If the array is <code>null</code> or empty, the
+ * method simply returns.
+ *
+ * @param vals the {@link CompositeData} values to add.
+ * @throws NullPointerException if a value from the array is
+ * <code>null</code>.
+ * @throws InvalidOpenTypeException if the type of a
+ * given value does not
+ * match the row type.
+ * @throws KeyAlreadyExistsException if a value has the
+ * same calculated index
+ * as an existing value or
+ * of one of the other
+ * specified values.
+ */
+ public void putAll(CompositeData[] vals)
+ {
+ if (vals == null || vals.length == 0)
+ return;
+ Map mapToAdd = new HashMap(vals.length);
+ for (int a = 0; a < vals.length; ++a)
+ {
+ Object[] key = calculateIndex(vals[a]);
+ if (dataMap.containsKey(key))
+ throw new KeyAlreadyExistsException("Element " + a + ": A " +
+ "value with this index " +
+ "already exists.");
+ mapToAdd.put(key, vals[a]);
+ }
+ dataMap.putAll(mapToAdd);
+ }
+
+ /**
+ * Converts each value from the specified map to a member of an
+ * array of {@link CompositeData} values and adds them using {@link
+ * #put(CompositeData[])}, if possible. As in {@link
+ * #put(Object,Object)}, the keys are simply ignored. This method
+ * is useful for adding the {@link CompositeData} values from a
+ * different {@link TabularData} instance, which uses the same
+ * {@link TabularType} but a different selection of index names, to
+ * this one. If the map is <code>null</code> or empty, the method
+ * simply returns.
+ *
+ * @param m the map to add. Only the values are used and must
+ * all be instances of {@link CompositeData}.
+ * @throws NullPointerException if a value from the map is
+ * <code>null</code>.
+ * @throws ClassCastException if a value from the map is not
+ * an instance of {@link CompositeData}.
+ * @throws InvalidOpenTypeException if the type of the
+ * given value does not
+ * match the row type.
+ * @throws KeyAlreadyExistsException if the value has the
+ * same calculated index
+ * as an existing value or
+ * of one of the other
+ * specified values.
+ */
+ public void putAll(Map m)
+ {
+ if (m == null || m.size() == 0)
+ return;
+ Collection vals = m.values();
+ CompositeData[] data = new CompositeData[vals.size()];
+ Iterator it = vals.iterator();
+ for (int a = 0; it.hasNext(); ++a)
+ {
+ data[a] = (CompositeData) it.next();
+ }
+ putAll(data);
+ }
+
+ /**
+ * Removes the value for the specified key by simply
+ * calling <code>remove((Object[]) key)</code>.
+ *
+ * @param key the key whose value should be removed.
+ * @return the removed value, or <code>null</code> if
+ * there is no value for the given key.
+ * @throws NullPointerException if the key is <code>null</code>.
+ * @throws ClassCastException if the key is not an instance
+ * of <code>Object[]</code>.
+ * @throws InvalidOpenTypeException if the key does not match
+ * the {@link TabularType} of this
+ * instance.
+ */
+ public Object remove(Object key)
+ {
+ return remove((Object[]) key);
+ }
+
+ /**
+ * Removes the {@link CompositeData} value located at the
+ * specified index. <code>null</code> is returned if the
+ * value does not exist. Otherwise, the removed value is
+ * returned.
+ *
+ * @param key the key of the value to remove.
+ * @return the removed value, or <code>null</code> if
+ * there is no value for the given key.
+ * @throws NullPointerException if the key is <code>null</code>.
+ * @throws InvalidOpenTypeException if the key does not match
+ * the {@link TabularType} of this
+ * instance.
+ */
+ public CompositeData remove(Object[] key)
+ {
+ if (!(isKeyValid(key)))
+ throw new InvalidKeyException("The key does not match the " +
+ "tabular type of this instance.");
+ return (CompositeData) dataMap.remove(key);
+ }
+
+ /**
+ * Package-private method to set the internal {@link java.util.Map}
+ * instance (used in cloning).
+ *
+ * @param map the new map used.
+ */
+ void setMap(Map map)
+ {
+ dataMap = map;
+ }
+
+ /**
+ * Returns the number of {@link CompositeData} values or rows
+ * in the table.
+ *
+ * @return the number of rows in the table.
+ */
+ public int size()
+ {
+ return dataMap.size();
+ }
+
+ /**
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.openmbean.TabularDataSupport</code>)
+ * and the result of calling <code>toString()</code> on the
+ * tabular type and underlying hash map instance.
+ *
+ * @return a {@link java.lang.String} representation of the
+ * object.
+ */
+ public String toString()
+ {
+ return getClass().getName()
+ + "[tabularType=" + tabularType
+ + ",dataMap=" + dataMap
+ + "]";
+ }
+
+ /**
+ * Returns a collection (or bag) view of the values in this Map. The
+ * collection is backed by the map, so that changes in one show up in
+ * the other. Modifications made while an iterator is in progress cause
+ * undefined behavior. If the collection supports removal, these methods
+ * remove the underlying mapping from the map: <code>Iterator.remove</code>,
+ * <code>Collection.remove</code>, <code>removeAll</code>,
+ * <code>retainAll</code>, and <code>clear</code>. Element addition, via
+ * <code>add</code> or <code>addAll</code>, is not supported via this
+ * collection.
+ *
+ * @return the collection view of all values
+ */
+ public Collection values()
+ {
+ return dataMap.values();
+ }
+
+}
+
diff --git a/libjava/classpath/javax/naming/CannotProceedException.java b/libjava/classpath/javax/naming/CannotProceedException.java
index 27868e21ea2..bc2085879cc 100644
--- a/libjava/classpath/javax/naming/CannotProceedException.java
+++ b/libjava/classpath/javax/naming/CannotProceedException.java
@@ -51,7 +51,7 @@ public class CannotProceedException extends NamingException
// Serialized fields.
protected Name remainingNewName;
- protected Hashtable environment;
+ protected Hashtable<?, ?> environment;
protected Name altName;
protected Context altNameCtx;
@@ -65,12 +65,12 @@ public class CannotProceedException extends NamingException
super (msg);
}
- public Hashtable getEnvironment()
+ public Hashtable<?, ?> getEnvironment()
{
return environment;
}
- public void setEnvironment(Hashtable environment)
+ public void setEnvironment(Hashtable<?, ?> environment)
{
this.environment = environment;
}
diff --git a/libjava/classpath/javax/naming/CompositeName.java b/libjava/classpath/javax/naming/CompositeName.java
index 322f63279a2..612932152da 100644
--- a/libjava/classpath/javax/naming/CompositeName.java
+++ b/libjava/classpath/javax/naming/CompositeName.java
@@ -65,7 +65,7 @@ public class CompositeName implements Name, Cloneable, Serializable
elts = new Vector ();
}
- protected CompositeName (Enumeration comps)
+ protected CompositeName (Enumeration<String> comps)
{
elts = new Vector ();
try
@@ -230,7 +230,7 @@ public class CompositeName implements Name, Cloneable, Serializable
return (String) elts.get (posn);
}
- public Enumeration getAll ()
+ public Enumeration<String> getAll ()
{
return elts.elements ();
}
diff --git a/libjava/classpath/javax/naming/CompoundName.java b/libjava/classpath/javax/naming/CompoundName.java
index 556edfc33f2..703d44e4700 100644
--- a/libjava/classpath/javax/naming/CompoundName.java
+++ b/libjava/classpath/javax/naming/CompoundName.java
@@ -73,7 +73,7 @@ public class CompoundName implements Name, Cloneable, Serializable
initializeSyntax ();
}
- protected CompoundName (Enumeration comps, Properties syntax)
+ protected CompoundName (Enumeration<String> comps, Properties syntax)
{
elts = new Vector ();
mySyntax = syntax;
@@ -289,7 +289,7 @@ public class CompoundName implements Name, Cloneable, Serializable
return (String) elts.get (posn);
}
- public Enumeration getAll ()
+ public Enumeration<String> getAll ()
{
return elts.elements ();
}
diff --git a/libjava/classpath/javax/naming/Context.java b/libjava/classpath/javax/naming/Context.java
index 46b540304b4..4b87b9e01e6 100644
--- a/libjava/classpath/javax/naming/Context.java
+++ b/libjava/classpath/javax/naming/Context.java
@@ -270,7 +270,7 @@ public interface Context
* @return the enumeration over the names, known for the given subcontext.
* @throws NamingException
*/
- NamingEnumeration list(Name name) throws NamingException;
+ NamingEnumeration<NameClassPair> list(Name name) throws NamingException;
/**
* Creates and returns the enumeration over the name bindings that are present
@@ -284,7 +284,7 @@ public interface Context
* @return the enumeration over the names, known for the given subcontext.
* @throws NamingException
*/
- NamingEnumeration list(String name) throws NamingException;
+ NamingEnumeration<NameClassPair> list(String name) throws NamingException;
/**
* Creates and returns the enumeration over the name - object bindings that
@@ -297,7 +297,7 @@ public interface Context
* @return the enumeration over the names, known for the given subcontext.
* @throws NamingException
*/
- NamingEnumeration listBindings(Name name) throws NamingException;
+ NamingEnumeration<Binding> listBindings(Name name) throws NamingException;
/**
* Creates and returns the enumeration over the name - object bindings that
@@ -310,7 +310,7 @@ public interface Context
* @return the enumeration over the names, known for the given subcontext.
* @throws NamingException
*/
- NamingEnumeration listBindings(String name) throws NamingException;
+ NamingEnumeration<Binding> listBindings(String name) throws NamingException;
/**
* Creates the new naming subcontext and binds it to the current (this)
@@ -467,7 +467,7 @@ public interface Context
* @return the table, representing the environment of this context
* @throws NamingException
*/
- Hashtable getEnvironment() throws NamingException;
+ Hashtable<?,?> getEnvironment() throws NamingException;
/**
* Releases all resources, associated with this context. The close() method
diff --git a/libjava/classpath/javax/naming/InitialContext.java b/libjava/classpath/javax/naming/InitialContext.java
index d4a9587f21c..1a3b1e38b03 100644
--- a/libjava/classpath/javax/naming/InitialContext.java
+++ b/libjava/classpath/javax/naming/InitialContext.java
@@ -73,7 +73,7 @@ public class InitialContext implements Context
/**
* The environment, associated with this initial context.
*/
- protected Hashtable myProps;
+ protected Hashtable<Object,Object> myProps;
/**
* The list of the properties, to that the second alternative value must
@@ -111,7 +111,7 @@ public class InitialContext implements Context
* created.
* @throws NamingException
*/
- public InitialContext(Hashtable environment) throws NamingException
+ public InitialContext(Hashtable<?,?> environment) throws NamingException
{
init(environment);
}
@@ -166,13 +166,13 @@ public class InitialContext implements Context
* not later reuse this structure for other purposes.
* @since 1.3
*/
- protected void init(Hashtable environment) throws NamingException
+ protected void init(Hashtable<?, ?> environment) throws NamingException
{
// If is documented that the caller should not modify the environment.
if (environment != null)
- myProps = environment;
+ myProps = (Hashtable<Object, Object>) environment;
else
- myProps = new Hashtable();
+ myProps = new Hashtable<Object, Object>();
Applet napplet = (Applet) myProps.get(Context.APPLET);
@@ -424,25 +424,25 @@ public class InitialContext implements Context
}
/** @inheritDoc */
- public NamingEnumeration list (Name name) throws NamingException
+ public NamingEnumeration<NameClassPair> list (Name name) throws NamingException
{
return getURLOrDefaultInitCtx (name).list (name);
}
/** @inheritDoc */
- public NamingEnumeration list (String name) throws NamingException
+ public NamingEnumeration<NameClassPair> list (String name) throws NamingException
{
return getURLOrDefaultInitCtx (name).list (name);
}
/** @inheritDoc */
- public NamingEnumeration listBindings (Name name) throws NamingException
+ public NamingEnumeration<Binding> listBindings (Name name) throws NamingException
{
return getURLOrDefaultInitCtx (name).listBindings (name);
}
/** @inheritDoc */
- public NamingEnumeration listBindings (String name) throws NamingException
+ public NamingEnumeration<Binding> listBindings (String name) throws NamingException
{
return getURLOrDefaultInitCtx (name).listBindings (name);
}
@@ -522,7 +522,7 @@ public class InitialContext implements Context
}
/** @inheritDoc */
- public Hashtable getEnvironment () throws NamingException
+ public Hashtable<?,?> getEnvironment () throws NamingException
{
return myProps;
}
diff --git a/libjava/classpath/javax/naming/Name.java b/libjava/classpath/javax/naming/Name.java
index f0475766a97..687ebd6fbde 100644
--- a/libjava/classpath/javax/naming/Name.java
+++ b/libjava/classpath/javax/naming/Name.java
@@ -60,8 +60,10 @@ import java.util.Enumeration;
* @author Anthony Green (green@redhat.com)
* @author Mark Wielaard (mark@klomp.org)
*/
-public interface Name extends Cloneable, Serializable, Comparable
+public interface Name extends Cloneable, Serializable, Comparable<Object>
{
+ // This class is implemented as gnu.javax.naming.ictxImpl.trans.GnuName
+
long serialVersionUID = -3617482732056931635L;
/**
@@ -80,7 +82,7 @@ public interface Name extends Cloneable, Serializable, Comparable
* Returns a non-null (but possibly empty) <code>Enumeration</code> of the
* components of the <code>Name</code> as <code>String</code>s.
*/
- Enumeration getAll();
+ Enumeration<String> getAll();
/**
* Gets the component at the given index.
@@ -94,22 +96,27 @@ public interface Name extends Cloneable, Serializable, Comparable
* Returns the components till the given index as a <code>Name</code>.
* The returned <code>Name</code> can be modified without changing the
* original.
+ *
+ * @param posn the ending position, exclusive
*
* @exception ArrayIndexOutOfBoundsException if the given index is smaller
* then zero or greater then or equal to <code>size()</code>.
*/
- Name getPrefix(int i);
+ Name getPrefix(int posn);
/**
* Returns the components from the given index till the end as a
* <code>Name</code>.
* The returned <code>Name</code> can be modified without changing the
* original.
+ *
+ * @param posn the starting position, inclusive. If it is equal to the size
+ * of the name, the empty name is returned.
*
* @exception ArrayIndexOutOfBoundsException if the given index is smaller
* then zero or greater then or equal to <code>size()</code>.
*/
- Name getSuffix(int i);
+ Name getSuffix(int posn);
/**
* Adds the given <code>String</code> component to the end of this
@@ -145,7 +152,8 @@ public interface Name extends Cloneable, Serializable, Comparable
/**
* Inserts all the components of the given <code>Name</code> to this
- * <code>Name</code> at the given index. The method modifies the current
+ * <code>Name</code> at the given index. Components after this index
+ * (if any) are shifted up. The method modifies the current
* <code>Name</code> and then returns it.
*
* @exception ArrayIndexOutOfBoundsException if the given index is smaller
diff --git a/libjava/classpath/javax/naming/NamingEnumeration.java b/libjava/classpath/javax/naming/NamingEnumeration.java
index 86b1dfb414d..a7c57706f8b 100644
--- a/libjava/classpath/javax/naming/NamingEnumeration.java
+++ b/libjava/classpath/javax/naming/NamingEnumeration.java
@@ -52,7 +52,7 @@ import java.util.Enumeration;
* exception has been thrown, not other method should be called of that
* enumeration.</p>
*/
-public interface NamingEnumeration extends Enumeration
+public interface NamingEnumeration<T> extends Enumeration<T>
{
/**
* Returns the next element in this enumeration. The naming - specific
@@ -62,7 +62,7 @@ public interface NamingEnumeration extends Enumeration
* @return the next element of this enumeration
* @throws NamingException
*/
- Object next() throws NamingException;
+ T next() throws NamingException;
/**
* Checks if there are more unvisited elements in the enumeration, throwing
diff --git a/libjava/classpath/javax/naming/Reference.java b/libjava/classpath/javax/naming/Reference.java
index 0fdecc19ec7..3379bd5a837 100644
--- a/libjava/classpath/javax/naming/Reference.java
+++ b/libjava/classpath/javax/naming/Reference.java
@@ -58,7 +58,7 @@ public class Reference implements Cloneable, Serializable
* The list of addresses, stored in this reference. The object may be
* have by several different addresses.
*/
- protected Vector addrs;
+ protected Vector<RefAddr> addrs;
/**
* The name of the class factory to create an instance of the object,
@@ -218,7 +218,7 @@ public class Reference implements Cloneable, Serializable
/**
* Get the enumeration over all defined addresses of the object.
*/
- public Enumeration getAll ()
+ public Enumeration<RefAddr> getAll ()
{
return addrs.elements ();
}
diff --git a/libjava/classpath/javax/naming/ReferralException.java b/libjava/classpath/javax/naming/ReferralException.java
index ec2178e77e6..c264d637f18 100644
--- a/libjava/classpath/javax/naming/ReferralException.java
+++ b/libjava/classpath/javax/naming/ReferralException.java
@@ -61,7 +61,7 @@ public abstract class ReferralException extends NamingException
public abstract Object getReferralInfo();
public abstract Context getReferralContext() throws NamingException;
- public abstract Context getReferralContext(Hashtable env)
+ public abstract Context getReferralContext(Hashtable<?, ?> env)
throws NamingException;
public abstract boolean skipReferral();
public abstract void retryReferral();
diff --git a/libjava/classpath/javax/naming/directory/Attribute.java b/libjava/classpath/javax/naming/directory/Attribute.java
index 59bf66dabc8..d29e1eae0b2 100644
--- a/libjava/classpath/javax/naming/directory/Attribute.java
+++ b/libjava/classpath/javax/naming/directory/Attribute.java
@@ -51,7 +51,7 @@ public interface Attribute extends Cloneable, Serializable
{
long serialVersionUID = 8707690322213556804L;
- NamingEnumeration getAll() throws NamingException;
+ NamingEnumeration<?> getAll() throws NamingException;
Object get() throws NamingException;
int size();
String getID();
diff --git a/libjava/classpath/javax/naming/directory/Attributes.java b/libjava/classpath/javax/naming/directory/Attributes.java
index 3d5ef9f4fa7..2dc2c610155 100644
--- a/libjava/classpath/javax/naming/directory/Attributes.java
+++ b/libjava/classpath/javax/naming/directory/Attributes.java
@@ -52,8 +52,8 @@ public interface Attributes extends Cloneable, Serializable
boolean isCaseIgnored();
int size();
Attribute get(String attrID);
- NamingEnumeration getAll();
- NamingEnumeration getIDs();
+ NamingEnumeration<? extends Attribute> getAll();
+ NamingEnumeration<String> getIDs();
Attribute put(String attrID, Object val);
Attribute put(Attribute attr);
Attribute remove(String attrID);
diff --git a/libjava/classpath/javax/naming/directory/BasicAttribute.java b/libjava/classpath/javax/naming/directory/BasicAttribute.java
index c6419794f10..5a1bb0e881f 100644
--- a/libjava/classpath/javax/naming/directory/BasicAttribute.java
+++ b/libjava/classpath/javax/naming/directory/BasicAttribute.java
@@ -62,7 +62,7 @@ public class BasicAttribute implements Attribute
/** True if this attribute's values are ordered. */
protected boolean ordered;
/** Values for this attribute. */
- protected transient Vector values;
+ protected transient Vector<Object> values;
// Used by cloning.
private BasicAttribute ()
@@ -182,7 +182,7 @@ public class BasicAttribute implements Attribute
return values.get (index);
}
- public NamingEnumeration getAll ()
+ public NamingEnumeration<?> getAll ()
throws NamingException
{
return new BasicAttributeEnumeration ();
diff --git a/libjava/classpath/javax/naming/directory/BasicAttributes.java b/libjava/classpath/javax/naming/directory/BasicAttributes.java
index 9318fbb2be7..6880f5b3362 100644
--- a/libjava/classpath/javax/naming/directory/BasicAttributes.java
+++ b/libjava/classpath/javax/naming/directory/BasicAttributes.java
@@ -126,12 +126,12 @@ public class BasicAttributes implements Attributes
return null;
}
- public NamingEnumeration getAll ()
+ public NamingEnumeration<Attribute> getAll ()
{
return new BasicAttributesEnumeration (false);
}
- public NamingEnumeration getIDs ()
+ public NamingEnumeration<String> getIDs ()
{
return new BasicAttributesEnumeration (true);
}
diff --git a/libjava/classpath/javax/naming/directory/DirContext.java b/libjava/classpath/javax/naming/directory/DirContext.java
index 002cb78a913..d7d94a3456b 100644
--- a/libjava/classpath/javax/naming/directory/DirContext.java
+++ b/libjava/classpath/javax/naming/directory/DirContext.java
@@ -72,12 +72,32 @@ public interface DirContext extends Context
DirContext getSchema(String name) throws NamingException;
DirContext getSchemaClassDefinition(Name name) throws NamingException;
DirContext getSchemaClassDefinition(String name) throws NamingException;
- NamingEnumeration search(Name name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException;
- NamingEnumeration search(String name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException;
- NamingEnumeration search(Name name, Attributes matchingAttributes) throws NamingException;
- NamingEnumeration search(String name, Attributes matchingAttributes) throws NamingException;
- NamingEnumeration search(Name name, String filter, SearchControls cons) throws NamingException;
- NamingEnumeration search(String name, String filter, SearchControls cons) throws NamingException;
- NamingEnumeration search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException;
- NamingEnumeration search(String name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException;
+ NamingEnumeration<SearchResult> search(Name name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn)
+ throws NamingException;
+ NamingEnumeration<SearchResult> search(String name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn)
+ throws NamingException;
+ NamingEnumeration<SearchResult> search(Name name,
+ Attributes matchingAttributes)
+ throws NamingException;
+ NamingEnumeration<SearchResult> search(String name,
+ Attributes matchingAttributes)
+ throws NamingException;
+ NamingEnumeration<SearchResult> search(Name name, String filter,
+ SearchControls cons)
+ throws NamingException;
+ NamingEnumeration<SearchResult> search(String name, String filter,
+ SearchControls cons)
+ throws NamingException;
+ NamingEnumeration<SearchResult> search(Name name, String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons)
+ throws NamingException;
+ NamingEnumeration<SearchResult> search(String name, String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons)
+ throws NamingException;
}
diff --git a/libjava/classpath/javax/naming/directory/InitialDirContext.java b/libjava/classpath/javax/naming/directory/InitialDirContext.java
index c946f416bff..8c7852fbba6 100644
--- a/libjava/classpath/javax/naming/directory/InitialDirContext.java
+++ b/libjava/classpath/javax/naming/directory/InitialDirContext.java
@@ -66,7 +66,7 @@ public class InitialDirContext extends InitialContext implements DirContext
super (lazy);
}
- public InitialDirContext (Hashtable environment)
+ public InitialDirContext (Hashtable<?, ?> environment)
throws NamingException
{
super (environment);
@@ -205,58 +205,65 @@ public class InitialDirContext extends InitialContext implements DirContext
return getURLOrDefaultInitDirCtx (name).getSchemaClassDefinition (name);
}
- public NamingEnumeration search(Name name, Attributes matchingAttributes,
- String[] attributesToReturn)
+ public NamingEnumeration<SearchResult> search(Name name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn)
throws NamingException
{
return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes,
attributesToReturn);
}
- public NamingEnumeration search(String name, Attributes matchingAttributes,
- String[] attributesToReturn)
+ public NamingEnumeration<SearchResult> search(String name,
+ Attributes matchingAttributes,
+ String[] attributesToReturn)
throws NamingException
{
return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes,
attributesToReturn);
}
- public NamingEnumeration search(Name name, Attributes matchingAttributes)
+ public NamingEnumeration<SearchResult> search(Name name,
+ Attributes matchingAttributes)
throws NamingException
{
return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes);
}
- public NamingEnumeration search(String name, Attributes matchingAttributes)
+ public NamingEnumeration<SearchResult> search(String name,
+ Attributes matchingAttributes)
throws NamingException
{
return getURLOrDefaultInitDirCtx (name).search (name, matchingAttributes);
}
- public NamingEnumeration search(Name name, String filter,
- SearchControls cons)
+ public NamingEnumeration<SearchResult> search(Name name, String filter,
+ SearchControls cons)
throws NamingException
{
return getURLOrDefaultInitDirCtx (name).search (name, filter, cons);
}
- public NamingEnumeration search(String name, String filter,
- SearchControls cons)
+ public NamingEnumeration<SearchResult> search(String name, String filter,
+ SearchControls cons)
throws NamingException
{
return getURLOrDefaultInitDirCtx (name).search (name, filter, cons);
}
- public NamingEnumeration search(Name name, String filterExpr,
- Object[] filterArgs, SearchControls cons)
+ public NamingEnumeration<SearchResult> search(Name name, String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons)
throws NamingException
{
return getURLOrDefaultInitDirCtx (name).search (name, filterExpr,
filterArgs, cons);
}
- public NamingEnumeration search(String name, String filterExpr,
- Object[] filterArgs, SearchControls cons)
+ public NamingEnumeration<SearchResult> search(String name,
+ String filterExpr,
+ Object[] filterArgs,
+ SearchControls cons)
throws NamingException
{
return getURLOrDefaultInitDirCtx (name).search (name, filterExpr,
diff --git a/libjava/classpath/javax/naming/ldap/ControlFactory.java b/libjava/classpath/javax/naming/ldap/ControlFactory.java
index f72e67a7587..b8151640fc6 100644
--- a/libjava/classpath/javax/naming/ldap/ControlFactory.java
+++ b/libjava/classpath/javax/naming/ldap/ControlFactory.java
@@ -59,7 +59,7 @@ public abstract class ControlFactory
public static Control getControlInstance (Control control,
Context ctx,
- Hashtable env)
+ Hashtable<?, ?> env)
throws NamingException
{
String path = (String) env.get (LdapContext.CONTROL_FACTORIES);
diff --git a/libjava/classpath/javax/naming/ldap/InitialLdapContext.java b/libjava/classpath/javax/naming/ldap/InitialLdapContext.java
index 45a9eae1af5..f9493c3b29c 100644
--- a/libjava/classpath/javax/naming/ldap/InitialLdapContext.java
+++ b/libjava/classpath/javax/naming/ldap/InitialLdapContext.java
@@ -60,22 +60,24 @@ public class InitialLdapContext
this (null, null);
}
- public InitialLdapContext (Hashtable environment, Control[] connControls)
+ public InitialLdapContext (Hashtable<?, ?> environment,
+ Control[] connControls)
throws NamingException
{
super (false);
+ Hashtable myenv = null;
if (connControls != null)
{
if (environment == null)
- environment = new Hashtable ();
+ myenv = new Hashtable ();
else
- environment = (Hashtable) environment.clone ();
- environment.put ("java.naming.ldap.control.connect",
+ myenv = (Hashtable) environment.clone ();
+ myenv.put ("java.naming.ldap.control.connect",
connControls);
}
- init (environment);
+ init (myenv);
}
private LdapContext getDefaultInitLdapCtx ()
diff --git a/libjava/classpath/javax/naming/ldap/LdapReferralException.java b/libjava/classpath/javax/naming/ldap/LdapReferralException.java
index 61a2b8e440c..87942b9fce4 100644
--- a/libjava/classpath/javax/naming/ldap/LdapReferralException.java
+++ b/libjava/classpath/javax/naming/ldap/LdapReferralException.java
@@ -61,8 +61,9 @@ public abstract class LdapReferralException extends ReferralException
}
public abstract Context getReferralContext() throws NamingException;
- public abstract Context getReferralContext(Hashtable env)
+ public abstract Context getReferralContext(Hashtable<?, ?> env)
throws NamingException;
- public abstract Context getReferralContext(Hashtable env, Control[] reqCtls)
+ public abstract Context getReferralContext(Hashtable<?, ?> env,
+ Control[] reqCtls)
throws NamingException;
}
diff --git a/libjava/classpath/javax/naming/spi/DirObjectFactory.java b/libjava/classpath/javax/naming/spi/DirObjectFactory.java
index ea0e69706cc..1a71c28f7df 100644
--- a/libjava/classpath/javax/naming/spi/DirObjectFactory.java
+++ b/libjava/classpath/javax/naming/spi/DirObjectFactory.java
@@ -51,6 +51,6 @@ import javax.naming.directory.Attributes;
public interface DirObjectFactory extends ObjectFactory
{
Object getObjectInstance(Object obj, Name name, Context nameCtx,
- Hashtable environment, Attributes attrs)
+ Hashtable<?, ?> environment, Attributes attrs)
throws Exception;
}
diff --git a/libjava/classpath/javax/naming/spi/DirStateFactory.java b/libjava/classpath/javax/naming/spi/DirStateFactory.java
index b5add91cba7..6ddd12f3655 100644
--- a/libjava/classpath/javax/naming/spi/DirStateFactory.java
+++ b/libjava/classpath/javax/naming/spi/DirStateFactory.java
@@ -77,7 +77,7 @@ public interface DirStateFactory extends StateFactory
DirStateFactory.Result getStateToBind(Object obj, Name name,
Context nameCtx,
- Hashtable environment,
+ Hashtable<?, ?> environment,
Attributes inAttrs)
throws NamingException;
}
diff --git a/libjava/classpath/javax/naming/spi/DirectoryManager.java b/libjava/classpath/javax/naming/spi/DirectoryManager.java
index fd482efb5c6..a6d91b20cfa 100644
--- a/libjava/classpath/javax/naming/spi/DirectoryManager.java
+++ b/libjava/classpath/javax/naming/spi/DirectoryManager.java
@@ -93,7 +93,7 @@ public class DirectoryManager extends NamingManager
public static Object getObjectInstance (Object refInfo, Name name,
Context nameCtx,
- Hashtable environment,
+ Hashtable<?, ?> environment,
Attributes attrs)
throws Exception
{
@@ -186,7 +186,7 @@ public class DirectoryManager extends NamingManager
public static DirStateFactory.Result getStateToBind (Object obj,
Name name,
Context nameCtx,
- Hashtable environment,
+ Hashtable<?, ?> environment,
Attributes attrs)
throws NamingException
{
diff --git a/libjava/classpath/javax/naming/spi/InitialContextFactory.java b/libjava/classpath/javax/naming/spi/InitialContextFactory.java
index d9b3336dcc2..f715327ef50 100644
--- a/libjava/classpath/javax/naming/spi/InitialContextFactory.java
+++ b/libjava/classpath/javax/naming/spi/InitialContextFactory.java
@@ -66,5 +66,6 @@ public interface InitialContextFactory
* @return the new initial context
* @throws NamingException if the naming exception has occured
*/
- Context getInitialContext(Hashtable environment) throws NamingException;
+ Context getInitialContext (Hashtable<?, ?> environment)
+ throws NamingException;
}
diff --git a/libjava/classpath/javax/naming/spi/InitialContextFactoryBuilder.java b/libjava/classpath/javax/naming/spi/InitialContextFactoryBuilder.java
index 4696cecb8e7..31bafe6dc06 100644
--- a/libjava/classpath/javax/naming/spi/InitialContextFactoryBuilder.java
+++ b/libjava/classpath/javax/naming/spi/InitialContextFactoryBuilder.java
@@ -53,14 +53,14 @@ import javax.naming.NamingException;
public interface InitialContextFactoryBuilder
{
/**
- * Create the new inital context factory
+ * Create the new initial context factory
*
- * @param environment the properties, used for creation of the initial context
- * factory. The parameter is owned by the caller: it is safe to reuse
- * the table for other purposes after the method returns.
+ * @param environment the properties, used for creation of the initial
+ * context factory. The parameter is owned by the caller: it is safe to reuse
+ * the table for other purposes after the method returns.
* @return the created initial context factory, never null.
* @throws NamingException on failure
*/
- InitialContextFactory createInitialContextFactory (Hashtable environment)
+ InitialContextFactory createInitialContextFactory (Hashtable<?, ?> environment)
throws NamingException;
}
diff --git a/libjava/classpath/javax/naming/spi/NamingManager.java b/libjava/classpath/javax/naming/spi/NamingManager.java
index a36d519d75a..3dfba0f668d 100644
--- a/libjava/classpath/javax/naming/spi/NamingManager.java
+++ b/libjava/classpath/javax/naming/spi/NamingManager.java
@@ -79,7 +79,7 @@ public class NamingManager
NamingManager ()
{
}
-
+
/**
* Checks if the initial context factory builder has been set.
*
@@ -110,7 +110,7 @@ public class NamingManager
* class, named by this property, cannot be instantiated.
* @throws NamingException if throws by the context factory
*/
- public static Context getInitialContext (Hashtable environment)
+ public static Context getInitialContext (Hashtable<?, ?> environment)
throws NamingException
{
InitialContextFactory icf = null;
@@ -151,7 +151,7 @@ public class NamingManager
return icf.getInitialContext (environment);
}
-
+
/**
* <p>
* Creates the URL context for the given URL scheme id.
@@ -187,23 +187,26 @@ public class NamingManager
* @throws NamingException if thrown by the factory when creating the context.
*/
static Context getURLContext(Object refInfo, Name name, Context nameCtx,
- String scheme, Hashtable environment)
+ String scheme, Hashtable<?,?> environment)
throws NamingException
{
- // Specified as the default in the docs. Unclear if this is
- // right for us.
- String defaultPrefix = "com.sun.jndi.url";
+ // Doc specifies com.sun.jndi.url as the final destination, but we cannot
+ // put our classes into such namespace.
+ String defaultPrefix = "gnu.javax.naming.jndi.url";
+ // The final default location, as specified in the documentation.
+ String finalPrefix = "com.sun.jndi.url";
+
StringBuffer allPrefixes = new StringBuffer();
String prefixes;
- if (environment != null)
- {
+ if (environment != null)
+ {
prefixes = (String) environment.get(Context.URL_PKG_PREFIXES);
if (prefixes != null)
allPrefixes.append(prefixes);
- }
-
+ }
+
prefixes = System.getProperty(Context.URL_PKG_PREFIXES);
if (prefixes != null)
{
@@ -215,12 +218,14 @@ public class NamingManager
if (allPrefixes.length() > 0)
allPrefixes.append(':');
allPrefixes.append(defaultPrefix);
+ allPrefixes.append(':');
+ allPrefixes.append(finalPrefix);
- scheme = scheme + "." + scheme + "URLContextFactory";
-
+ scheme = scheme + "." + scheme + "URLContextFactory";
+
StringTokenizer tokens = new StringTokenizer(allPrefixes.toString(), ":");
while (tokens.hasMoreTokens())
- {
+ {
String aTry = tokens.nextToken();
try
{
@@ -228,12 +233,21 @@ public class NamingManager
Class factoryClass = forName(tryClass);
if (factoryClass != null)
{
- ObjectFactory factory = (ObjectFactory) factoryClass.newInstance();
- Object obj = factory.getObjectInstance(refInfo, name, nameCtx,
- environment);
- Context ctx = (Context) obj;
- if (ctx != null)
- return ctx;
+ Object obj;
+ try
+ {
+ ObjectFactory factory = (ObjectFactory) factoryClass.newInstance();
+ obj = factory.getObjectInstance(refInfo, name, nameCtx,
+ environment);
+ Context ctx = (Context) obj;
+ if (ctx != null)
+ return ctx;
+ }
+ catch (RuntimeException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
}
catch (ClassNotFoundException _1)
@@ -263,11 +277,11 @@ public class NamingManager
{
// Anything from getObjectInstance.
}
- }
-
+ }
+
return null;
}
-
+
/**
* Load the class with the given name. This method tries to use the context
* class loader first. If this fails, it searches for the suitable class
@@ -315,15 +329,15 @@ public class NamingManager
* </p>
* <p>
* The class name of the factory that creates the context has the naming
- * pattern scheme-idURLContextFactory. For instance, the factory for the "ftp"
- * sheme should be named "ftpURLContextFactory". The Context.URL_PKG_PREFIXES
- * environment property contains the colon-separated list of the possible
- * package prefixes. The package name is constructed concatenating the package
- * prefix with the scheme id.
+ * pattern scheme-idURLContextFactory. For instance, the factory for the
+ * "ftp" scheme should be named "ftpURLContextFactory".
+ * The Context.URL_PKG_PREFIXES environment property contains the
+ * colon-separated list of the possible package prefixes. The package name
+ * is constructed by concatenating the package prefix with the scheme id.
* </p>
* <p>
- * If the factory class cannot be found in the specified packages, system will
- * try to use the default internal factory for the given scheme.
+ * If the factory class cannot be found in the specified packages, the
+ * system will try to use the default internal factory for the given scheme.
* </p>
* <p>
* After the factory is instantiated, its method
@@ -331,13 +345,14 @@ public class NamingManager
* is called to create and return the object instance.
*
* @param scheme the url scheme that must be supported by the given context
- * @param environment the properties for creating the factory and context (may
- * be null)
+ * @param environment the properties for creating the factory and context
+ * (may be null)
* @return the created context
- * @throws NamingException if thrown by the factory when creating the context.
+ * @throws NamingException if thrown by the factory when creating the
+ * context.
*/
public static Context getURLContext (String scheme,
- Hashtable environment)
+ Hashtable<?, ?> environment)
throws NamingException
{
return getURLContext (null, null, null, scheme, environment);
@@ -436,7 +451,7 @@ public class NamingManager
public static Object getObjectInstance (Object refInfo,
Name name,
Context nameCtx,
- Hashtable environment)
+ Hashtable<?, ?> environment)
throws Exception
{
ObjectFactory factory = null;
@@ -609,7 +624,7 @@ public class NamingManager
* @throws NamingException
*/
public static Object getStateToBind (Object obj, Name name,
- Context nameCtx, Hashtable environment)
+ Context nameCtx, Hashtable<?, ?> environment)
throws NamingException
{
StringTokenizer tokens = getPlusPath (Context.STATE_FACTORIES,
diff --git a/libjava/classpath/javax/naming/spi/ObjectFactory.java b/libjava/classpath/javax/naming/spi/ObjectFactory.java
index 27771b6cbbd..4534481a75a 100644
--- a/libjava/classpath/javax/naming/spi/ObjectFactory.java
+++ b/libjava/classpath/javax/naming/spi/ObjectFactory.java
@@ -70,6 +70,7 @@ public interface ObjectFactory
*
* @see NamingManager#getObjectInstance(Object, Name, Context, Hashtable)
*/
- Object getObjectInstance(Object refObj, Name name, Context nameCtx,
- Hashtable environment) throws Exception;
+ Object getObjectInstance (Object refObj, Name name, Context nameCtx,
+ Hashtable<?, ?> environment)
+ throws Exception;
}
diff --git a/libjava/classpath/javax/naming/spi/ObjectFactoryBuilder.java b/libjava/classpath/javax/naming/spi/ObjectFactoryBuilder.java
index cb20c666e71..6a528b17a06 100644
--- a/libjava/classpath/javax/naming/spi/ObjectFactoryBuilder.java
+++ b/libjava/classpath/javax/naming/spi/ObjectFactoryBuilder.java
@@ -52,7 +52,7 @@ import javax.naming.Referenceable;
* @author Warren Levy (warrenl@redhat.com)
*/
public interface ObjectFactoryBuilder
-{
+{
/**
* Create a new object using the supplied environment.
*
@@ -65,6 +65,6 @@ public interface ObjectFactoryBuilder
* @throws NamingException
*/
ObjectFactory createObjectFactory(Object refInfo,
- Hashtable environment)
+ Hashtable<?, ?> environment)
throws NamingException;
}
diff --git a/libjava/classpath/javax/naming/spi/Resolver.java b/libjava/classpath/javax/naming/spi/Resolver.java
index eb3eeb56079..f01790502ed 100644
--- a/libjava/classpath/javax/naming/spi/Resolver.java
+++ b/libjava/classpath/javax/naming/spi/Resolver.java
@@ -44,41 +44,20 @@ import javax.naming.NamingException;
import javax.naming.NotContextException;
/**
- * <p>Represents the object, capable for the at least partial name resolution.
- * The object is not necessay capable for the complete name resolution and
- * need not implement the {@link Context}.</p>
- * <p>
- * Both passed parameters and returned results are owned by the caller.</p>
- *
++ * <p>Represents the object, capable for the at least partial name resolution.
++ * The object is not necessay capable for the complete name resolution and
++ * need not implement the {@link Context}.</p>
++ * <p>
++ * Both passed parameters and returned results are owned by the caller.</p>
++ *
* @author Warren Levy (warrenl@redhat.com)
*/
public interface Resolver
{
- /**
- * Partially resolve the name, stopping at the first instance of the context
- * that is an instance of the contextType
- *
- * @param name the name to resolve
- * @param contextType the class of the context, on that the resolution should
- * be terminated
- * @return the complete or partial name resolution
- * @throws NotContextException if the context of the contextType is not found
- * @throws NamingException on other failure
- */
- ResolveResult resolveToClass(Name name, Class contextType)
+ ResolveResult resolveToClass(Name name,
+ Class<? extends Context> contextType)
throws NamingException;
-
- /**
- * Partially resolve the name, stopping at the first instance of the context
- * that is an instance of the contextType
- *
- * @param name the name to resolve
- * @param contextType the class of the context, on that the resolution should
- * be terminated
- * @return the complete or partial name resolution
- * @throws NotContextException if the context of the contextType is not found
- * @throws NamingException on other failure
- */
- ResolveResult resolveToClass(String name, Class contextType)
+ ResolveResult resolveToClass(String name,
+ Class<? extends Context> contextType)
throws NamingException;
}
diff --git a/libjava/classpath/javax/naming/spi/StateFactory.java b/libjava/classpath/javax/naming/spi/StateFactory.java
index 5694f8a1a09..0c48309e3d5 100644
--- a/libjava/classpath/javax/naming/spi/StateFactory.java
+++ b/libjava/classpath/javax/naming/spi/StateFactory.java
@@ -75,5 +75,5 @@ public interface StateFactory
* @see DirectoryManager#getStateToBind
*/
Object getStateToBind(Object obj, Name name, Context nameCtx,
- Hashtable environment) throws NamingException;
+ Hashtable<?, ?> environment) throws NamingException;
}
diff --git a/libjava/classpath/javax/net/ssl/CertPathTrustManagerParameters.java b/libjava/classpath/javax/net/ssl/CertPathTrustManagerParameters.java
new file mode 100644
index 00000000000..b6dc135e119
--- /dev/null
+++ b/libjava/classpath/javax/net/ssl/CertPathTrustManagerParameters.java
@@ -0,0 +1,71 @@
+/* CertPathTrustManagerParameters.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.net.ssl;
+
+import java.security.cert.CertPathParameters;
+
+/**
+ * Trust manager parameters for certification paths.
+ */
+public class CertPathTrustManagerParameters implements ManagerFactoryParameters
+{
+ private final CertPathParameters params;
+
+ /**
+ * Creates a new trust manager parameter instance. The argument is
+ * cloned to prevent modification of this instance.
+ *
+ * @param params The certificate path parameters.
+ * @throws NullPointerException If params is null.
+ */
+ public CertPathTrustManagerParameters (final CertPathParameters params)
+ {
+ this.params = (CertPathParameters) params.clone ();
+ }
+
+ /**
+ * Returns a copy of the certificate path parameters.
+ *
+ * @return A copy of the certificate path parameters.
+ */
+ public CertPathParameters getParameters ()
+ {
+ return (CertPathParameters) params.clone ();
+ }
+}
diff --git a/libjava/classpath/javax/net/ssl/HandshakeCompletedEvent.java b/libjava/classpath/javax/net/ssl/HandshakeCompletedEvent.java
index 743f1372672..b65dff06c8e 100644
--- a/libjava/classpath/javax/net/ssl/HandshakeCompletedEvent.java
+++ b/libjava/classpath/javax/net/ssl/HandshakeCompletedEvent.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.net.ssl;
+import java.security.Principal;
import java.security.cert.Certificate;
import javax.security.cert.X509Certificate;
@@ -108,6 +109,20 @@ public class HandshakeCompletedEvent extends java.util.EventObject
}
/**
+ * Returns the local identity used in this connection, or
+ * <code>null</code> if there is none.
+ *
+ * @return The local identity.
+ * @since 1.5
+ */
+ public Principal getLocalPrincipal ()
+ {
+ if (session != null)
+ return session.getLocalPrincipal ();
+ return null;
+ }
+
+ /**
* Returns the peer's certificates being used in this connection.
*
* @return The peer's certificates.
@@ -129,6 +144,22 @@ public class HandshakeCompletedEvent extends java.util.EventObject
}
/**
+ * Returns the peer's identity, or <code>null</code> if there is
+ * none.
+ *
+ * @return The peer's identity.
+ * @throws SSLPeerUnverifiedException If the remote peer's identity
+ * could not be verified.
+ * @since 1.5
+ */
+ public Principal getPeerPrincipal () throws SSLPeerUnverifiedException
+ {
+ if (session != null)
+ return session.getPeerPrincipal ();
+ return null;
+ }
+
+ /**
* Returns the SSL session object associated with this connection.
*
* @return The session object.
diff --git a/libjava/classpath/javax/net/ssl/HttpsURLConnection.java b/libjava/classpath/javax/net/ssl/HttpsURLConnection.java
index 3f30dc1b800..7d68162c96a 100644
--- a/libjava/classpath/javax/net/ssl/HttpsURLConnection.java
+++ b/libjava/classpath/javax/net/ssl/HttpsURLConnection.java
@@ -38,9 +38,12 @@ exception statement from your version. */
package javax.net.ssl;
+import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
+import java.security.Principal;
import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
/**
* A URL connection that connects via the <i>Secure Socket Layer</i>
@@ -245,6 +248,48 @@ public abstract class HttpsURLConnection extends HttpURLConnection
this.factory = factory;
}
+ /**
+ * Returns the local principal for this connection.
+ *
+ * <p>The default implementation will return the {@link
+ * javax.security.x500.X500Principal} for the end entity certificate
+ * in the local certificate chain if those certificates are of type
+ * {@link java.security.cert.X509Certificate}. Otherwise, this
+ * method returns <code>null</code>.
+ *
+ * @return The local principal.
+ * @since 1.5
+ */
+ public Principal getLocalPrincipal ()
+ {
+ Certificate[] c = getLocalCertificates ();
+ if (c != null && c.length > 0 && (c[0] instanceof X509Certificate))
+ return ((X509Certificate) c[0]).getSubjectX500Principal ();
+ return null;
+ }
+
+ /**
+ * Returns the remote peer's principal for this connection.
+ *
+ * <p>The default implementation will return the {@link
+ * javax.security.x500.X500Principal} for the end entity certificate
+ * in the remote peer's certificate chain if those certificates are
+ * of type {@link java.security.cert.X509Certificate}. Otherwise,
+ * this method returns <code>null</code>.
+ *
+ * @return The remote principal.
+ * @throws SSLPeerUnverifiedException If the remote peer has not
+ * been verified.
+ * @since 1.5
+ */
+ public Principal getPeerPrincipal () throws SSLPeerUnverifiedException
+ {
+ Certificate[] c = getServerCertificates ();
+ if (c != null && c.length > 0 && (c[0] instanceof X509Certificate))
+ return ((X509Certificate) c[0]).getSubjectX500Principal ();
+ return null;
+ }
+
// Abstract methods.
// -------------------------------------------------------------------
diff --git a/libjava/classpath/javax/net/ssl/KeyManagerFactory.java b/libjava/classpath/javax/net/ssl/KeyManagerFactory.java
index ab8abd6264c..33f2fda9c7f 100644
--- a/libjava/classpath/javax/net/ssl/KeyManagerFactory.java
+++ b/libjava/classpath/javax/net/ssl/KeyManagerFactory.java
@@ -132,49 +132,55 @@ public class KeyManagerFactory
}
/**
- * Get an instance of the named key manager factory, from the first
+ * Create an instance of the named key manager factory, from the first
* provider that implements it.
- *
+ *
* @param algorithm The type of key manager factory to get.
* @return An appropriate implementation of that algoritm.
- * @throws NoSuchAlgorithmException If no provider implements the
- * requested algorithm.
+ * @throws NoSuchAlgorithmException If no provider implements the requested
+ * algorithm.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static final KeyManagerFactory getInstance(String algorithm)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
- Provider[] provs = Security.getProviders();
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(algorithm, provs[i]);
- }
- catch (NoSuchAlgorithmException ignore)
- {
- }
- }
+ Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
+ for (int i = 0; i < p.length; i++)
+ try
+ {
+ return getInstance(algorithm, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new NoSuchAlgorithmException(algorithm);
}
/**
- * Get an instance of the named key manager factory, from the named
+ * Create an instance of the named key manager factory, from the named
* provider.
- *
+ *
* @param algorithm The type of key manager factory to get.
- * @param provider The name of the provider to get the
- * implementation from.
+ * @param provider The name of the provider to get the implementation from.
* @return An appropriate implementation of that algorithm.
- * @throws NoSuchAlgorithmException If the provider does not
- * implement the requested algorithm.
- * @throws NoSuchProviderException If the named provider does not
- * exist.
+ * @throws NoSuchAlgorithmException If the provider does not implement the
+ * requested algorithm.
+ * @throws NoSuchProviderException If the named provider does not exist.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
- public static final KeyManagerFactory getInstance(String algorithm, String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ public static final KeyManagerFactory getInstance(String algorithm,
+ String provider)
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
if (provider == null)
- throw new IllegalArgumentException("provider is null");
+ throw new IllegalArgumentException("provider MUST NOT be null");
Provider p = Security.getProvider(provider);
if (p == null)
throw new NoSuchProviderException(provider);
@@ -182,40 +188,48 @@ public class KeyManagerFactory
}
/**
- * Get an instance of the named key manager factory, from the given
+ * Create an instance of the named key manager factory, from the given
* provider.
- *
+ *
* @param algorithm The type of key manager factory to get.
* @param provider The provider to get the implementation from.
* @return An appropriate implementation of that algorithm.
- * @throws NoSuchAlgorithmException If the provider does not
- * implement the requested algorithm.
- * @throws IllegalArgumentException If <i>provider</i> is null.
+ * @throws NoSuchAlgorithmException If the provider does not implement the
+ * requested algorithm.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
- public static final KeyManagerFactory getInstance(String algorithm, Provider provider)
- throws NoSuchAlgorithmException
+ public static final KeyManagerFactory getInstance(String algorithm,
+ Provider provider)
+ throws NoSuchAlgorithmException
{
- if (provider == null)
- throw new IllegalArgumentException("provider is null");
+ StringBuilder sb = new StringBuilder("KeyManagerFactory algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- return new KeyManagerFactory((KeyManagerFactorySpi)
- Engine.getInstance(KEY_MANAGER_FACTORY, algorithm, provider),
- provider, algorithm);
+ Object spi = Engine.getInstance(KEY_MANAGER_FACTORY, algorithm, provider);
+ return new KeyManagerFactory((KeyManagerFactorySpi) spi, provider, algorithm);
}
- catch (InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
- // Instance methods.
- // -------------------------------------------------------------------
-
/**
* Returns the name of this key manager factory algorithm.
*
diff --git a/libjava/classpath/javax/net/ssl/KeyStoreBuilderParameters.java b/libjava/classpath/javax/net/ssl/KeyStoreBuilderParameters.java
new file mode 100644
index 00000000000..2aa665ed5ea
--- /dev/null
+++ b/libjava/classpath/javax/net/ssl/KeyStoreBuilderParameters.java
@@ -0,0 +1,48 @@
+/* KeyStoreBuilderParameters.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.net.ssl;
+
+/**
+ * <p style="color: red;"><b>FIXME</b> this class is currently a stub;
+ * it depends on an implementation of {@link
+ * java.security.KeyStore.Builder}</p>.
+ */
+public class KeyStoreBuilderParameters implements ManagerFactoryParameters
+{
+}
diff --git a/libjava/classpath/javax/net/ssl/SSLContext.java b/libjava/classpath/javax/net/ssl/SSLContext.java
index eaf3e3638e2..dcc85080956 100644
--- a/libjava/classpath/javax/net/ssl/SSLContext.java
+++ b/libjava/classpath/javax/net/ssl/SSLContext.java
@@ -91,101 +91,127 @@ public class SSLContext
this.protocol = protocol;
}
- // Class methods.
- // ------------------------------------------------------------------
-
/**
- * Get an instance of a context for the specified protocol from the
- * first provider that implements it.
- *
+ * Get an instance of a context for the specified protocol from the first
+ * provider that implements it.
+ *
* @param protocol The name of the protocol to get a context for.
* @return The new context.
- * @throws NoSuchAlgorithm If no provider implements the given
- * protocol.
+ * @throws NoSuchAlgorithmException If no provider implements the given
+ * protocol.
+ * @throws IllegalArgumentException if <code>protocol</code> is
+ * <code>null</code> or is an empty string.
*/
public static final SSLContext getInstance(String protocol)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
- Provider[] provs = Security.getProviders();
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(protocol, provs[i]);
- }
- catch (NoSuchAlgorithmException ignore)
- {
- }
- }
+ Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
+ for (int i = 0; i < p.length; i++)
+ try
+ {
+ return getInstance(protocol, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new NoSuchAlgorithmException(protocol);
}
/**
- * Get an instance of a context for the specified protocol from the
- * named provider.
- *
+ * Get an instance of a context for the specified protocol from the named
+ * provider.
+ *
* @param protocol The name of the protocol to get a context for.
- * @param provider The name of the provider to get the
- * implementation from.
+ * @param provider The name of the provider to get the implementation from.
* @return The new context.
- * @throws NoSuchAlgorithmException If the provider does not
- * implement the given protocol.
- * @throws NoSuchProviderException If the named provider does not
- * exist.
- * @throws IllegalArgumentException If <i>provider</i> is null.
+ * @throws NoSuchAlgorithmException If the provider does not implement the
+ * given protocol.
+ * @throws NoSuchProviderException If the named provider does not exist.
+ * @throws IllegalArgumentException if either <code>protocol</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>protocol</code> is an empty string.
*/
- public static final SSLContext getInstance(String protocol,
- String provider)
- throws NoSuchAlgorithmException, NoSuchProviderException
+ public static final SSLContext getInstance(String protocol, String provider)
+ throws NoSuchAlgorithmException, NoSuchProviderException
{
if (provider == null)
- {
- throw new IllegalArgumentException("null provider");
- }
+ throw new IllegalArgumentException("provider MUST NOT be null");
Provider p = Security.getProvider(provider);
if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
+ throw new NoSuchProviderException(provider);
return getInstance(protocol, p);
}
/**
- * Get an instance of a context for the specified protocol from the
- * specified provider.
- *
+ * Get an instance of a context for the specified protocol from the specified
+ * provider.
+ *
* @param protocol The name of the protocol to get a context for.
- * @param provider The name of the provider to get the
- * implementation from.
+ * @param provider The name of the provider to get the implementation from.
* @return The new context.
- * @throws NoSuchAlgorithmException If the provider does not
- * implement the given protocol.
- * @throws IllegalArgumentException If <i>provider</i> is null.
+ * @throws NoSuchAlgorithmException If the provider does not implement the
+ * given protocol.
+ * @throws IllegalArgumentException if either <code>protocol</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>protocol</code> is an empty string.
*/
- public static final SSLContext getInstance(String protocol,
- Provider provider)
- throws NoSuchAlgorithmException
+ public static final SSLContext getInstance(String protocol, Provider provider)
+ throws NoSuchAlgorithmException
{
+ StringBuilder sb = new StringBuilder("SSLContext for protocol [")
+ .append(protocol).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- return new SSLContext((SSLContextSpi)
- Engine.getInstance(SSL_CONTEXT, protocol, provider),
- provider, protocol);
+ Object spi = Engine.getInstance(SSL_CONTEXT, protocol, provider);
+ return new SSLContext((SSLContextSpi) spi, provider, protocol);
}
- catch (InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- NoSuchAlgorithmException nsae = new NoSuchAlgorithmException(protocol);
- throw (NoSuchAlgorithmException) nsae.initCause(ite);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- NoSuchAlgorithmException nsae = new NoSuchAlgorithmException(protocol);
- throw (NoSuchAlgorithmException) nsae.initCause(cce);
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
- // Instance methods.
- // -----------------------------------------------------------------
+ /**
+ * Creates a new {@link SSLEngine} for this context.
+ *
+ * @return The new SSLEngine.
+ * @since 1.5
+ */
+ public final SSLEngine createSSLEngine ()
+ {
+ return ctxSpi.engineCreateSSLEngine ();
+ }
+
+ /**
+ * Creates a new {@link SSLEngine} for this context, with a given
+ * host name and port number.
+ *
+ * @param host The local host name.
+ * @param port The local port number.
+ * @return The new SSLEngine.
+ * @since 1.5
+ */
+ public final SSLEngine createSSLEngine (final String host, final int port)
+ {
+ return ctxSpi.engineCreateSSLEngine (host, port);
+ }
/**
* Returns the set of SSL contexts available for client connections.
diff --git a/libjava/classpath/javax/net/ssl/SSLContextSpi.java b/libjava/classpath/javax/net/ssl/SSLContextSpi.java
index a6b0c758117..03c44f85e9c 100644
--- a/libjava/classpath/javax/net/ssl/SSLContextSpi.java
+++ b/libjava/classpath/javax/net/ssl/SSLContextSpi.java
@@ -64,6 +64,28 @@ public abstract class SSLContextSpi
// Abstract methods.
// -------------------------------------------------------------------
+ // Sun, you've broken existing applications by introducing new
+ // abstract methods! Goodjob!!!
+
+ /**
+ * Returns a new {@link SSLEngine} for this context.
+ *
+ * @return A new SSLEngine.
+ * @since 1.5
+ */
+ protected abstract SSLEngine engineCreateSSLEngine ();
+
+ /**
+ * Returns a new {@link SSLEngine} for this context, for the given
+ * host name and port number.
+ *
+ * @param host The local host name.
+ * @param port The local port number.
+ * @return A new SSLEngine.
+ * @since 1.5
+ */
+ protected abstract SSLEngine engineCreateSSLEngine (String host, int port);
+
/**
* Returns the set of SSL sessions available for client connections.
*
diff --git a/libjava/classpath/javax/net/ssl/SSLEngine.java b/libjava/classpath/javax/net/ssl/SSLEngine.java
new file mode 100644
index 00000000000..efab9725b59
--- /dev/null
+++ b/libjava/classpath/javax/net/ssl/SSLEngine.java
@@ -0,0 +1,442 @@
+/* SSLEngine.java -- advanced, generic utility for manipulating SSL messages.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.net.ssl;
+
+import java.nio.ByteBuffer;
+
+/**
+ * A class for low-level message wrapping and unwrapping of SSL
+ * messages.
+ *
+ * @author Casey Marshall (csm@gnu.org)
+ * @since 1.5
+ */
+public abstract class SSLEngine
+{
+ private final String peerHost;
+ private final int peerPort;
+
+ /**
+ * Creates a new SSLEngine with no peer host name or port number.
+ */
+ protected SSLEngine ()
+ {
+ this (null, -1);
+ }
+
+ /**
+ * Creates a new SSLEngine with the specified peer host name and
+ * port number.
+ *
+ * @param peerHost The peer's host name.
+ * @param peerPort The peer's port number.
+ */
+ protected SSLEngine (String peerHost, int peerPort)
+ {
+ this.peerHost = peerHost;
+ this.peerPort = peerPort;
+ }
+
+
+
+ /**
+ * Begin, or restart, the SSL handshake.
+ *
+ * @throws SSLException
+ */
+ public abstract void beginHandshake () throws SSLException;
+
+ /**
+ * Close the inbound state.
+ *
+ * @throws SSLException
+ */
+ public abstract void closeInbound () throws SSLException;
+
+ /**
+ * Close the outbound state.
+ */
+ public abstract void closeOutbound ();
+
+ /**
+ *
+ */
+ public abstract Runnable getDelegatedTask ();
+
+ /**
+ * Returns the peer host name this SSL session is connected to, or
+ * <code>null</code> if this value was not set.
+ *
+ * @return The peer host's name.
+ */
+ public String getPeerHost ()
+ {
+ return peerHost;
+ }
+
+ /**
+ * Returns the peer IP port number this SSL session in communicating
+ * on, or -1 if this value was not set.
+ *
+ * @return The peer's port number.
+ */
+ public int getPeerPort ()
+ {
+ return peerPort;
+ }
+
+ /**
+ * Returns a list of SSL cipher suite names this SSLEngine is
+ * configured to use.
+ *
+ * @return The list of enabled cipher suite names.
+ */
+ public abstract String[] getEnabledCipherSuites();
+
+ /**
+ * Returns a list of SSL protocol version names this SSLEngine is
+ * configured to use.
+ *
+ * @return The list of enabled protocol names.
+ */
+ public abstract String[] getEnabledProtocols ();
+
+ /**
+ * Tells if sessions will be created by this engine, and therefore
+ * may be resumed at a later time.
+ *
+ * @return True if sessions will be created.
+ */
+ public abstract boolean getEnableSessionCreation();
+
+ /**
+ * Return the current handshake status.
+ *
+ * @return The current handshake status.
+ */
+ public abstract SSLEngineResult.HandshakeStatus getHandshakeStatus ();
+
+ /**
+ * Tells if this SSLEngine is configured to require client
+ * authentication when in server mode.
+ *
+ * @return True iff client authentication is required.
+ */
+ public abstract boolean getNeedClientAuth ();
+
+ /**
+ * Return the {@link SSLSession} object this connection represents.
+ *
+ * @return The SSL session.
+ */
+ public abstract SSLSession getSession ();
+
+ /**
+ * Returns a list of SSL cipher suite names this SSLEngine
+ * implementation supports.
+ *
+ * @return The list of cipher suite names supported by this
+ * implementation.
+ */
+ public abstract String[] getSupportedCipherSuites ();
+
+ /**
+ * Returns a list of SSL protocol version names this SSLEngine
+ * implementation supports. SSL protocol names include things like
+ * "SSLv3" or "TLSv1".
+ *
+ * @return The list of SSL protocol names
+ */
+ public abstract String[] getSupportedProtocols ();
+
+ /**
+ * Tells if this SSLEngine is a "client" session.
+ *
+ * @return True iff this session is configured for client mode.
+ */
+ public abstract boolean getUseClientMode ();
+
+ /**
+ * Tells if client authentication is requested, but not required,
+ * for sessions in server mode. If true, a server session will
+ * request an authentication message from connecting clients, but
+ * will still allow clients to connect if they cannot be
+ * authenticated.
+ *
+ * @return True iff client authentication is requested.
+ */
+ public abstract boolean getWantClientAuth ();
+
+ /**
+ * Tells if the incoming data stream is finished, and thus if no
+ * more data will be available to be unwrapped.
+ *
+ * @return True if no more data is to be unwrapped.
+ */
+ public abstract boolean isInboundDone ();
+
+ /**
+ * Tells if the outgoing data stream is finished, and thus if no
+ * more data may be wrapped.
+ *
+ * @return True if no more data may be wrapped.
+ */
+ public abstract boolean isOutboundDone ();
+
+ /**
+ * Sets the list of enabled cipher suites. The argument is an array
+ * of strings of the canonical suite names.
+ *
+ * @param suites The cipher suites to enable.
+ * @throws IllegalArgumentException If any of the specified suite
+ * strings is not supported by this implementation, or if the
+ * argument is null.
+ */
+ public abstract void setEnabledCipherSuites (String[] suites);
+
+ /**
+ * Sets the list of enabled protocol versions. The argument is an
+ * array of strings of the canonical protocol version names, such as
+ * "TLSv1".
+ *
+ * @param protocols The protocol versions to enable.
+ * @throws IllegalArgumentException If any of the specified
+ * protocols are not supported, or if the argument is null.
+ */
+ public abstract void setEnabledProtocols (String[] protocols);
+
+ /**
+ * Enables or disables session creation. If enabled, each connection
+ * will create session that may be resumed by another connection.
+ *
+ * @param create Whether or not to enable session creation.
+ */
+ public abstract void setEnableSessionCreation (boolean create);
+
+ /**
+ * Enables client or server mode. If the argument is true, this
+ * engine will run in client mode; if false, server mode.
+ *
+ * @param clientMode Whether or not to use client mode.
+ */
+ public abstract void setUseClientMode (boolean clientMode);
+
+ /**
+ * Enables or disables required client authentication. If enabled,
+ * clients may only connect if they provide proper identification.
+ *
+ * <p>This parameter is only used in server mode.
+ *
+ * @param needAuth Whether or not client authentication is required.
+ */
+ public abstract void setNeedClientAuth (boolean needAuth);
+
+ /**
+ * Enables or disables requested client authentication. If enabled,
+ * clients will be asked to provide proper identification, but will
+ * still be allowed to connect if they do not provide it.
+ *
+ * <p>This parameter is only used in server mode.
+ *
+ * @param wantAuth Whether or not client authentication will be
+ * requested, but not required.
+ */
+ public abstract void setWantClientAuth (boolean wantAuth);
+
+ /**
+ * Unwraps a byte buffer recieved from the network, storing the
+ * decrypted, unwrapped bytes into the given buffer.
+ *
+ * <p>This call is exactly equivalent to <code>unwrap (source, new
+ * ByteBuffer[] { sink }, 0, 1)</code>.
+ *
+ * @param source The source bytes, coming from the network.
+ * @param sink The buffer to hold the unwrapped message.
+ * @return An engine result object for the operation.
+ * @throws SSLException If an SSL message parsing error occurs.
+ * @throws java.nio.ReadOnlyBufferException If 'sink' is not
+ * writable.
+ * @throws IllegalArgumentException If either 'source' or 'sink' is
+ * null.
+ * @throws IllegalStateException If this engine has not been put
+ * into client or server mode.
+ */
+ public SSLEngineResult unwrap (ByteBuffer source, ByteBuffer sink)
+ throws SSLException
+ {
+ return unwrap (source, new ByteBuffer[] { sink }, 0, 1);
+ }
+
+ /**
+ * Unwraps a byte buffer recieved from the network, storing the
+ * decrypted, unwrapped bytes into the given buffers.
+ *
+ * <p>This call is exactly equivalent to <code>unwrap (source,
+ * sinks, 0, sinks.length)</code>.
+ *
+ * @param source The source bytes, coming from the network.
+ * @param sinks The buffers to hold the unwrapped message.
+ * @return An engine result object for the operation.
+ * @throws SSLException If an SSL message parsing error occurs.
+ * @throws java.nio.ReadOnlyBufferException If any buffer in 'sinks'
+ * is not writable.
+ * @throws IllegalArgumentException If either 'source' or 'sinks' is
+ * null.
+ * @throws IllegalStateException If this engine has not been put
+ * into client or server mode.
+ */
+ public SSLEngineResult unwrap (ByteBuffer source, ByteBuffer[] sinks)
+ throws SSLException
+ {
+ return unwrap (source, sinks, 0, sinks.length);
+ }
+
+ /**
+ * Unwraps a byte buffer received from the network, storing the
+ * decrypted, unwrapped bytes into the given buffers. After
+ * unwrapping, the bytes placed into the sink buffers are ready for
+ * consumption by the application.
+ *
+ * <p>This method may place no bytes in the destination buffer; for
+ * example, if this engine is still performing the SSL handshake,
+ * only handshake data will be consumed, and no application data.
+ *
+ * <p>It is stated that this method may modify the source buffer,
+ * and that it must not be passed to another SSLEngine (SSL
+ * connections are independent, so another SSLEngine will not have
+ * the parameters or state to handle messages meant for this
+ * engine).
+ *
+ * @param source The source bytes, coming from the network.
+ * @param sinks The buffers to hold the unwrapped message.
+ * @param offset The index of the first buffer in 'sinks' to use.
+ * @param length The number of buffers in 'sinks' to use.
+ * @return An engine result object for the operation.
+ * @throws SSLException If an SSL message parsing error occurs.
+ * @throws java.nio.ReadOnlyBufferException If any buffer in 'sinks'
+ * is not writable.
+ * @throws IllegalArgumentException If either 'source' or 'sinks' is
+ * null.
+ * @throws IllegalStateException If this engine has not been put
+ * into client or server mode.
+ * @throws IndexOutOfBoundsException If 'offset' or 'length' is
+ * negative, or if 'length+offset' is greater than 'sinks.length'.
+ */
+ public abstract SSLEngineResult unwrap (ByteBuffer source,
+ ByteBuffer[] sinks, int offset,
+ int length)
+ throws javax.net.ssl.SSLException;
+
+ /**
+ * Wraps a byte buffer into an SSL message, for preparation to send
+ * it over the network.
+ *
+ * <p>This method is exactly equivalent to <code>wrap (new
+ * ByteBuffer[] { source }, 0, 1, sink)</code>.
+ *
+ * @param source The source buffer with application data.
+ * @param sink The buffer to hold the wrapped data.
+ * @return An engine result object for the operation.
+ * @throws SSLException If an SSL error occurs.
+ * @throws java.nio.ReadOnlyBufferException If 'sink' is read-only.
+ * @throws IllegalArgumentException If either 'source' or 'sink' is
+ * null.
+ * @throws IllegalStateException If this engine has not been put
+ * into client or server mode.
+ */
+ public SSLEngineResult wrap (ByteBuffer source, ByteBuffer sink)
+ throws SSLException
+ {
+ return wrap (new ByteBuffer[] { source }, 0, 1, sink);
+ }
+
+ /**
+ * Wraps byte buffers into an SSL message, for preparation to send
+ * them over the network.
+ *
+ * <p>This method is exactly equivalent to <code>wrap (sources, 0,
+ * 1, sink)</code>.
+ *
+ * @param sources The source buffers with application data.
+ * @param sink The buffer to hold the wrapped data.
+ * @return An engine result object for the operation.
+ * @throws SSLException If an SSL error occurs.
+ * @throws java.nio.ReadOnlyBufferException If 'sink' is read-only.
+ * @throws IllegalArgumentException If either 'sources' or 'sink' is
+ * null.
+ * @throws IllegalStateException If this engine has not been put
+ * into client or server mode.
+ */
+ public SSLEngineResult wrap (ByteBuffer[] sources, ByteBuffer sink)
+ throws SSLException
+ {
+ return wrap (sources, 0, sources.length, sink);
+ }
+
+ /**
+ * Wraps byte buffers into an SSL message, for preparation to send
+ * them over the network. After wrapping, the data in the sink
+ * buffer is ready to be sent over the transport layer.
+ *
+ * <p>This method may consume no data from the source buffers, and
+ * yet still produce output that should be sent accross the wire;
+ * for example if this engine has not yet completed the SSL
+ * handshake, the sink buffer will be filled with handshake
+ * messages.
+ *
+ * @param sources The source buffers with application data.
+ * @param offset The offset into the source buffers to start reading
+ * application data.
+ * @param length The number of buffers to read from 'sources'.
+ * @param sink The buffer to hold the wrapped data.
+ * @return An engine result object for the operation.
+ * @throws SSLException If an SSL error occurs.
+ * @throws java.nio.ReadOnlyBufferException If 'sink' is read-only.
+ * @throws IllegalArgumentException If either 'sources' or 'sink' is
+ * null.
+ * @throws IllegalStateException If this engine has not been put
+ * into client or server mode.
+ * @throws IndexOutOfBoundsException If 'offset' or 'length' is
+ * negative, or if 'length+offset' is greater than 'sources.length'.
+ */
+ public abstract SSLEngineResult wrap (ByteBuffer[] sources, int offset,
+ int length, ByteBuffer sink)
+ throws SSLException;
+
+}
diff --git a/libjava/classpath/javax/net/ssl/SSLEngineResult.java b/libjava/classpath/javax/net/ssl/SSLEngineResult.java
new file mode 100644
index 00000000000..0d6a435dd87
--- /dev/null
+++ b/libjava/classpath/javax/net/ssl/SSLEngineResult.java
@@ -0,0 +1,194 @@
+/* SSLEngineResult.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.net.ssl;
+
+/**
+ * A result from an {@link SSLEngine} <code>wrap</code> or
+ * <code>unwrap</code> operation. This class conveys a possibly
+ * intermediate result, and may ask for more input data or request
+ * that output data be sent over a connection.
+ */
+public class SSLEngineResult
+{
+ private final HandshakeStatus handshakeStatus;
+ private final Status status;
+ private final int bytesConsumed;
+ private final int bytesProduced;
+
+ /**
+ * Creates a new SSL engine result.
+ *
+ * @param status The status of the SSL connection.
+ * @param handshakeStatus The status of the SSL handshake.
+ * @param bytesConsumed The number of bytes consumed by the previous
+ * operation.
+ * @param bytesProduced The number of bytes produced by the previous
+ * operation.
+ * @throws IllegalArgumentException If either enum value is
+ * <code>null</code>, or if either integer is negative.
+ */
+ public SSLEngineResult (Status status, HandshakeStatus handshakeStatus,
+ int bytesConsumed, int bytesProduced)
+ {
+ if (status == null)
+ throw new IllegalArgumentException ("'status' may not be null");
+ if (handshakeStatus == null)
+ throw new IllegalArgumentException ("'handshakeStatus' may not be null");
+ if (bytesConsumed < 0)
+ throw new IllegalArgumentException ("'bytesConumed' must be nonnegative");
+ if (bytesProduced < 0)
+ throw new IllegalArgumentException ("'bytesProduced' must be nonnegative");
+ this.status = status;
+ this.handshakeStatus = handshakeStatus;
+ this.bytesConsumed = bytesConsumed;
+ this.bytesProduced = bytesProduced;
+ }
+
+
+
+ /**
+ * An enumeration of possible general states.
+ */
+ public static enum Status
+ {
+
+ /**
+ * There were not enough input bytes available to complete the
+ * operation.
+ */
+ BUFFER_UNDERFLOW,
+
+ /**
+ * There was not enough space for the output message.
+ */
+ BUFFER_OVERFLOW,
+
+ /**
+ * Okay. No error.
+ */
+ OK,
+
+ /**
+ * The connection is closed.
+ */
+ CLOSED
+ }
+
+ /**
+ * An enumeration of possible handshake status states.
+ */
+ public static enum HandshakeStatus
+ {
+
+ /**
+ * Not currently handshaking.
+ */
+ NOT_HANDSHAKING,
+
+ /**
+ * The handshake is finished.
+ */
+ FINISHED,
+
+ /**
+ * Needs the status of one or more delegated tasks.
+ */
+ NEED_TASK,
+
+ /**
+ * Has data prepared for output, and needs a new call to
+ * <code>wrap</code>.
+ */
+ NEED_WRAP,
+
+ /**
+ * Is waiting for more input.
+ */
+ NEED_UNWRAP
+ }
+
+
+
+ /**
+ * Returns the number of bytes consumed by the previous operation.
+ *
+ * @return The number of bytes consumed.
+ */
+ public int bytesConsumed ()
+ {
+ return bytesConsumed;
+ }
+
+ /**
+ * Returns the number of bytes produced by the previous operation.
+ *
+ * @return The number of bytes produced.
+ */
+ public int bytesProduced ()
+ {
+ return bytesProduced;
+ }
+
+ /**
+ * Returns the handshake status.
+ *
+ * @return The handshake status.
+ */
+ public HandshakeStatus getHandshakeStatus ()
+ {
+ return handshakeStatus;
+ }
+
+ /**
+ * Returns the connection status.
+ *
+ * @return The connection status.
+ */
+ public Status getStatus ()
+ {
+ return status;
+ }
+
+ public String toString ()
+ {
+ return (super.toString () + " [ status: " + status + "; handshakeStatus: "
+ + handshakeStatus + "; bytesConsumed: " + bytesConsumed
+ + "; bytesProduced: " + bytesProduced + " ]");
+ }
+}
diff --git a/libjava/classpath/javax/net/ssl/SSLSession.java b/libjava/classpath/javax/net/ssl/SSLSession.java
index 9400a1a512d..c8a4785f96d 100644
--- a/libjava/classpath/javax/net/ssl/SSLSession.java
+++ b/libjava/classpath/javax/net/ssl/SSLSession.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.net.ssl;
+import java.security.Principal;
import java.security.cert.Certificate;
import javax.security.cert.X509Certificate;
@@ -48,6 +49,20 @@ import javax.security.cert.X509Certificate;
*/
public interface SSLSession
{
+
+ /**
+ * Returns the size of the largest application data buffer that can
+ * occur in this session.
+ *
+ * <p>Buffers passed to handle the incoming data for the
+ * <code>unwrap</code> method of SSLEngine must be at least this
+ * large.
+ *
+ * @return The size of application buffers.
+ * @since 1.5
+ */
+ int getApplicationBufferSize ();
+
/**
* Returns this session's cihper suite.
*
@@ -87,6 +102,28 @@ public interface SSLSession
Certificate[] getLocalCertificates();
/**
+ * Returns the {@link Principal} representing the local identity
+ * used in this session, or <code>null</code> if there is no local
+ * identity.
+ *
+ * @return The local principal.
+ */
+ Principal getLocalPrincipal ();
+
+ /**
+ * Returns the size of the largest SSL message that will be
+ * generated by this session.
+ *
+ * <p>Callers of <code>wrap</code> and <code>unwrap</code> should
+ * use this value to determine the size of buffers for data coming
+ * into, or going out over, the network.
+ *
+ * @returns The maximum network packet size.
+ * @since 1.5
+ */
+ int getPacketBufferSize ();
+
+ /**
* Returns the chain of certificates that the remote side used in
* the handshake, or null if none were used.
*
@@ -115,6 +152,27 @@ public interface SSLSession
String getPeerHost();
/**
+ * Returns the port number the remote peer is using for this
+ * session.
+ *
+ * @return The peer's port number.
+ * @since 1.5
+ */
+ int getPeerPort ();
+
+ /**
+ * Returns the {@link Principal} representing the identity of the
+ * remote peer, or <code>null</code> if the remote peer has no known
+ * identity.
+ *
+ * @return The remote peer's principal.
+ * @throws SSLPeerUnverifiedException If the remote peer's identity
+ * could not be verified.
+ * @since 1.5
+ */
+ Principal getPeerPrincipal () throws SSLPeerUnverifiedException;
+
+ /**
* Returns the protocol this session uses.
*
* @return The protocol.
@@ -152,6 +210,15 @@ public interface SSLSession
void invalidate();
/**
+ * Tells if this session is currently valid, and may be resumed.
+ *
+ * @return True if this session is valid.
+ * @since 1.5
+ * @see #invalidate()
+ */
+ boolean isValid ();
+
+ /**
* Binds a value to this session, with the given name.
*
* @param name The name to bind the object with.
diff --git a/libjava/classpath/javax/net/ssl/SSLSocketFactory.java b/libjava/classpath/javax/net/ssl/SSLSocketFactory.java
index d5d9b6e145a..7348b2ee478 100644
--- a/libjava/classpath/javax/net/ssl/SSLSocketFactory.java
+++ b/libjava/classpath/javax/net/ssl/SSLSocketFactory.java
@@ -142,7 +142,7 @@ public abstract class SSLSocketFactory extends SocketFactory
catch (Exception ex)
{
throw new RuntimeException("error instantiating default socket factory: "
- + ex.toString());
+ + ex.toString(), ex);
}
}
try
diff --git a/libjava/classpath/javax/net/ssl/TrustManagerFactory.java b/libjava/classpath/javax/net/ssl/TrustManagerFactory.java
index 62ab1c2df05..f868ae75b70 100644
--- a/libjava/classpath/javax/net/ssl/TrustManagerFactory.java
+++ b/libjava/classpath/javax/net/ssl/TrustManagerFactory.java
@@ -93,96 +93,105 @@ public class TrustManagerFactory
this.algorithm = algorithm;
}
- // Class methods.
- // -------------------------------------------------------------------------
-
/**
- * Returns an instance of a trust manager factory for the given algorithm
- * from the first provider that implements it.
- *
+ * Returns an instance of a trust manager factory for the given algorithm from
+ * the first provider that implements it.
+ *
* @param algorithm The name of the algorithm to get.
* @return The instance of the trust manager factory.
* @throws NoSuchAlgorithmException If no provider implements the given
- * algorithm.
+ * algorithm.
+ * @throws IllegalArgumentException if <code>algorithm</code> is
+ * <code>null</code> or is an empty string.
*/
public static final TrustManagerFactory getInstance(String algorithm)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
- Provider[] provs = Security.getProviders();
- for (int i = 0; i < provs.length; i++)
- {
- try
- {
- return getInstance(algorithm, provs[i]);
- }
- catch (NoSuchAlgorithmException ignore)
- {
- }
- }
+ Provider[] p = Security.getProviders();
+ NoSuchAlgorithmException lastException = null;
+ for (int i = 0; i < p.length; i++)
+ try
+ {
+ return getInstance(algorithm, p[i]);
+ }
+ catch (NoSuchAlgorithmException x)
+ {
+ lastException = x;
+ }
+ if (lastException != null)
+ throw lastException;
throw new NoSuchAlgorithmException(algorithm);
}
/**
- * Returns an instance of a trust manager factory for the given algorithm
- * from the named provider.
- *
+ * Returns an instance of a trust manager factory for the given algorithm from
+ * the named provider.
+ *
* @param algorithm The name of the algorithm to get.
* @param provider The name of the provider to get the instance from.
* @return The instance of the trust manager factory.
* @throws NoSuchAlgorithmException If the provider does not implement the
- * given algorithm.
+ * given algorithm.
* @throws NoSuchProviderException If there is no such named provider.
- * @throws IllegalArgumentException If the provider argument is null.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
public static final TrustManagerFactory getInstance(String algorithm,
String provider)
throws NoSuchAlgorithmException, NoSuchProviderException
{
if (provider == null)
- {
- throw new IllegalArgumentException();
- }
+ throw new IllegalArgumentException("provider MUST NOT be null");
Provider p = Security.getProvider(provider);
if (p == null)
- {
- throw new NoSuchProviderException(provider);
- }
+ throw new NoSuchProviderException(provider);
return getInstance(algorithm, p);
}
/**
- * Returns an instance of a trust manager factory for the given algorithm
- * from the specified provider.
- *
+ * Returns an instance of a trust manager factory for the given algorithm from
+ * the specified provider.
+ *
* @param algorithm The name of the algorithm to get.
* @param provider The provider to get the instance from.
* @return The instance of the trust manager factory.
* @throws NoSuchAlgorithmException If the provider does not implement the
- * given algorithm.
- * @throws IllegalArgumentException If the provider argument is null.
+ * given algorithm.
+ * @throws IllegalArgumentException if either <code>algorithm</code> or
+ * <code>provider</code> is <code>null</code>, or if
+ * <code>algorithm</code> is an empty string.
*/
public static final TrustManagerFactory getInstance(String algorithm,
Provider provider)
- throws NoSuchAlgorithmException
+ throws NoSuchAlgorithmException
{
- if (provider == null)
- {
- throw new IllegalArgumentException();
- }
+ StringBuilder sb = new StringBuilder("TrustManagerFactory algorithm [")
+ .append(algorithm).append("] from provider[")
+ .append(provider).append("] could not be created");
+ Throwable cause;
try
{
- return new TrustManagerFactory((TrustManagerFactorySpi)
- Engine.getInstance(TRUST_MANAGER_FACTORY, algorithm, provider),
- provider, algorithm);
+ Object spi = Engine.getInstance(TRUST_MANAGER_FACTORY, algorithm, provider);
+ return new TrustManagerFactory((TrustManagerFactorySpi) spi,
+ provider,
+ algorithm);
}
- catch (InvocationTargetException ite)
+ catch (InvocationTargetException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x.getCause();
+ if (cause instanceof NoSuchAlgorithmException)
+ throw (NoSuchAlgorithmException) cause;
+ if (cause == null)
+ cause = x;
}
- catch (ClassCastException cce)
+ catch (ClassCastException x)
{
- throw new NoSuchAlgorithmException(algorithm);
+ cause = x;
}
+ NoSuchAlgorithmException x = new NoSuchAlgorithmException(sb.toString());
+ x.initCause(cause);
+ throw x;
}
/**
diff --git a/libjava/classpath/javax/net/ssl/X509ExtendedKeyManager.java b/libjava/classpath/javax/net/ssl/X509ExtendedKeyManager.java
new file mode 100644
index 00000000000..ccd146f822c
--- /dev/null
+++ b/libjava/classpath/javax/net/ssl/X509ExtendedKeyManager.java
@@ -0,0 +1,96 @@
+/* X509ExtendedKeyManager.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.net.ssl;
+
+import java.security.Principal;
+
+/**
+ * An extended {@link X509KeyManager} for use with {@link SSLEngine}.
+ *
+ * @since 1.5
+ * @author Casey Marshall (csm@gnu.org)
+ */
+public abstract class X509ExtendedKeyManager implements X509KeyManager
+{
+
+ /**
+ * Default constructor.
+ */
+ protected X509ExtendedKeyManager ()
+ {
+ }
+
+ /**
+ * Return a client alias given a list of key types, a list of
+ * allowable issuers, and the SSLEngine being used.
+ *
+ * <p>This implementation always returns <code>null</code>.
+ *
+ * @param keyTypes The list of desired key types.
+ * @param issuers The list of desired key issuers.
+ * @param engine This client's SSLEngine.
+ * @return A key alias that matches the given parameters, or
+ * <code>null</code> if the parameters were not matched.
+ */
+ public String chooseEngineClientAlias (final String[] keyTypes,
+ final Principal[] issuers,
+ final SSLEngine engine)
+ {
+ return null;
+ }
+
+ /**
+ * Return a server alias given a key type, a list of allowable
+ * issuers, and the SSLEngine being used.
+ *
+ * <p>This implementation always returns <code>null</code>.
+ *
+ * @param keyType The desired key type.
+ * @param issuers The list of desired key issuers.
+ * @param engine The server's SSLEngine.
+ * @return A key alias that matches the given parameters, or
+ * <code>null</code> if the parameters were not matched.
+ */
+ public String chooseEngineServerAlias (final String keyType,
+ final Principal[] issuers,
+ final SSLEngine engine)
+ {
+ return null;
+ }
+}
diff --git a/libjava/classpath/javax/print/PrintService.java b/libjava/classpath/javax/print/PrintService.java
index b5fe004a730..125d27083b3 100644
--- a/libjava/classpath/javax/print/PrintService.java
+++ b/libjava/classpath/javax/print/PrintService.java
@@ -89,7 +89,7 @@ public interface PrintService
* @throws IllegalArgumentException if category is not a class that
* implements <code>PrintServiceAttribute</code>.
*/
- PrintServiceAttribute getAttribute(Class category);
+ <T extends PrintServiceAttribute> T getAttribute(Class<T> category);
/**
* Returns the attributes describing this print service. The returned
@@ -123,7 +123,7 @@ public interface PrintService
* @throws IllegalArgumentException if <code>category</code> is a class
* not implementing <code>Attribute</code>
*/
- Object getDefaultAttributeValue(Class category);
+ Object getDefaultAttributeValue(Class<? extends Attribute> category);
/**
* Returns the name of this print service.
@@ -145,7 +145,7 @@ public interface PrintService
*
* @return The class array of all supported attribute categories.
*/
- Class[] getSupportedAttributeCategories();
+ Class<?>[] getSupportedAttributeCategories();
/**
* Determines and returns all supported attribute values of a given
@@ -177,7 +177,9 @@ public interface PrintService
* implementing <code>Attribute</code>, or if <code>flavor</code> is not
* supported
*/
- Object getSupportedAttributeValues(Class category, DocFlavor flavor, AttributeSet attributes);
+ Object getSupportedAttributeValues(Class<? extends Attribute> category,
+ DocFlavor flavor,
+ AttributeSet attributes);
/**
* Determines and returns an array of all supported document flavors which
@@ -189,7 +191,7 @@ public interface PrintService
* the specific doc flavor and attributes set.
* </p>
*
- * @return The supported document flavors.
+ * @return the supported document flavors
*/
DocFlavor[] getSupportedDocFlavors();
@@ -240,7 +242,7 @@ public interface PrintService
* @throws IllegalArgumentException if <code>category</code> is a class not
* implementing <code>Attribute</code>.
*/
- boolean isAttributeCategorySupported(Class category);
+ boolean isAttributeCategorySupported(Class<? extends Attribute> category);
/**
* Determines if a given attribute value is supported when creating a print
diff --git a/libjava/classpath/javax/print/attribute/Attribute.java b/libjava/classpath/javax/print/attribute/Attribute.java
index 7ce0247cea1..8b98377ba22 100644
--- a/libjava/classpath/javax/print/attribute/Attribute.java
+++ b/libjava/classpath/javax/print/attribute/Attribute.java
@@ -52,7 +52,7 @@ public interface Attribute extends Serializable
*
* @return The concrete {@link Class} instance of the attribute class.
*/
- Class getCategory ();
+ Class< ? extends Attribute> getCategory ();
/**
* Returns the descriptive name of the attribute category.
diff --git a/libjava/classpath/javax/print/attribute/AttributeSet.java b/libjava/classpath/javax/print/attribute/AttributeSet.java
index b4bdecad254..c8130c19f14 100644
--- a/libjava/classpath/javax/print/attribute/AttributeSet.java
+++ b/libjava/classpath/javax/print/attribute/AttributeSet.java
@@ -110,7 +110,7 @@ public interface AttributeSet
* @return <code>true</code> if an attribute of the category is contained
* in the set, <code>false</code> otherwise.
*/
- boolean containsKey (Class category);
+ boolean containsKey (Class<?> category);
/**
* Checks if this attribute set contains the given attribute.
@@ -143,7 +143,7 @@ public interface AttributeSet
* @throws ClassCastException if category is not implementing
* <code>Attribute</code>.
*/
- Attribute get (Class category);
+ Attribute get (Class<?> category);
/**
* Returns the hashcode value. The hashcode value is the sum of all hashcodes
@@ -178,7 +178,7 @@ public interface AttributeSet
* @return <code>true</code> if an attribute is removed, false in all other cases.
* @throws UnmodifiableSetException if the set does not support modification.
*/
- boolean remove (Class category);
+ boolean remove (Class<?> category);
/**
* Returns the number of elements in this attribute set.
diff --git a/libjava/classpath/javax/print/attribute/AttributeSetUtilities.java b/libjava/classpath/javax/print/attribute/AttributeSetUtilities.java
index f6a64ebc531..95c11a6ed1a 100644
--- a/libjava/classpath/javax/print/attribute/AttributeSetUtilities.java
+++ b/libjava/classpath/javax/print/attribute/AttributeSetUtilities.java
@@ -435,8 +435,8 @@ public final class AttributeSetUtilities
* that implements interfaceName
* @exception NullPointerException if object is null
*/
- public static Class verifyAttributeCategory(Object object,
- Class interfaceName)
+ public static Class<?> verifyAttributeCategory(Object object,
+ Class<?> interfaceName)
{
if (object == null)
throw new NullPointerException("object may not be null");
@@ -461,7 +461,7 @@ public final class AttributeSetUtilities
* @exception NullPointerException if object is null
*/
public static Attribute verifyAttributeValue(Object object,
- Class interfaceName)
+ Class<?> interfaceName)
{
if (object == null)
throw new NullPointerException("object may not be null");
@@ -482,7 +482,7 @@ public final class AttributeSetUtilities
* @exception IllegalArgumentException if the categories are not equal
* @exception NullPointerException if category is null
*/
- public static void verifyCategoryForValue(Class category,
+ public static void verifyCategoryForValue(Class<?> category,
Attribute attribute)
{
if (category == null || attribute == null)
diff --git a/libjava/classpath/javax/print/attribute/HashAttributeSet.java b/libjava/classpath/javax/print/attribute/HashAttributeSet.java
index 65371ea9fa2..0f6b00730a8 100644
--- a/libjava/classpath/javax/print/attribute/HashAttributeSet.java
+++ b/libjava/classpath/javax/print/attribute/HashAttributeSet.java
@@ -110,7 +110,7 @@ public class HashAttributeSet implements AttributeSet, Serializable
*
* @exception NullPointerException if interfaceName is null
*/
- protected HashAttributeSet(Class interfaceName)
+ protected HashAttributeSet(Class<?> interfaceName)
{
if (interfaceName == null)
throw new NullPointerException("interfaceName may not be null");
@@ -129,7 +129,7 @@ public class HashAttributeSet implements AttributeSet, Serializable
* interfaceName
* @exception NullPointerException if attribute or interfaceName is null
*/
- protected HashAttributeSet(Attribute attribute, Class interfaceName)
+ protected HashAttributeSet(Attribute attribute, Class<?> interfaceName)
{
this(interfaceName);
@@ -151,7 +151,7 @@ public class HashAttributeSet implements AttributeSet, Serializable
* interface of interfaceName
* @exception NullPointerException if attributes or interfaceName is null
*/
- protected HashAttributeSet(Attribute[] attributes, Class interfaceName)
+ protected HashAttributeSet(Attribute[] attributes, Class<?> interfaceName)
{
this(interfaceName);
@@ -173,7 +173,7 @@ public class HashAttributeSet implements AttributeSet, Serializable
* @exception ClassCastException if any element of attributes is not an
* interface of interfaceName
*/
- protected HashAttributeSet(AttributeSet attributes, Class interfaceName)
+ protected HashAttributeSet(AttributeSet attributes, Class<?> interfaceName)
{
this(interfaceName);
@@ -256,7 +256,7 @@ public class HashAttributeSet implements AttributeSet, Serializable
* @return <code>true</code> if an attribute of the category is contained
* in the set, <code>false</code> otherwise.
*/
- public boolean containsKey(Class category)
+ public boolean containsKey(Class<?> category)
{
return attributeMap.containsKey(category);
}
@@ -301,7 +301,7 @@ public class HashAttributeSet implements AttributeSet, Serializable
* @throws ClassCastException if category is not implementing
* <code>Attribute</code>.
*/
- public Attribute get(Class category)
+ public Attribute get(Class<?> category)
{
if (category == null)
throw new NullPointerException("category may not be null");
@@ -359,7 +359,7 @@ public class HashAttributeSet implements AttributeSet, Serializable
* @return <code>true</code> if an attribute is removed, false in all other cases.
* @throws UnmodifiableSetException if the set does not support modification.
*/
- public boolean remove(Class category)
+ public boolean remove(Class<?> category)
{
if (category == null)
return false;
diff --git a/libjava/classpath/javax/print/attribute/standard/Chromaticity.java b/libjava/classpath/javax/print/attribute/standard/Chromaticity.java
index cc834f680a2..3dec79893b4 100644
--- a/libjava/classpath/javax/print/attribute/standard/Chromaticity.java
+++ b/libjava/classpath/javax/print/attribute/standard/Chromaticity.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -94,7 +95,7 @@ public final class Chromaticity extends EnumSyntax
*
* @return The class <code>Chromaticity</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return Chromaticity.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/ColorSupported.java b/libjava/classpath/javax/print/attribute/standard/ColorSupported.java
index bca932dd735..c5e251a5044 100644
--- a/libjava/classpath/javax/print/attribute/standard/ColorSupported.java
+++ b/libjava/classpath/javax/print/attribute/standard/ColorSupported.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintServiceAttribute;
@@ -88,7 +89,7 @@ public final class ColorSupported extends EnumSyntax
*
* @return The class <code>ColorSupported</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return ColorSupported.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/Compression.java b/libjava/classpath/javax/print/attribute/standard/Compression.java
index 01891fe2369..f2f4f1cc142 100644
--- a/libjava/classpath/javax/print/attribute/standard/Compression.java
+++ b/libjava/classpath/javax/print/attribute/standard/Compression.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
@@ -91,7 +92,7 @@ public class Compression extends EnumSyntax
*
* @return The class <code>Compression</code> itself.
*/
- public final Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return Compression.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/Copies.java b/libjava/classpath/javax/print/attribute/standard/Copies.java
index 78ca6c6cc63..ea9a0990a31 100644
--- a/libjava/classpath/javax/print/attribute/standard/Copies.java
+++ b/libjava/classpath/javax/print/attribute/standard/Copies.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
@@ -97,7 +98,7 @@ public final class Copies extends IntegerSyntax
*
* @return The class <code>Copies</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return Copies.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/CopiesSupported.java b/libjava/classpath/javax/print/attribute/standard/CopiesSupported.java
index fec426becd4..1f62f48a87f 100644
--- a/libjava/classpath/javax/print/attribute/standard/CopiesSupported.java
+++ b/libjava/classpath/javax/print/attribute/standard/CopiesSupported.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.SetOfIntegerSyntax;
import javax.print.attribute.SupportedValuesAttribute;
@@ -112,7 +113,7 @@ public final class CopiesSupported extends SetOfIntegerSyntax
*
* @return The class <code>CopiesSupported</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return CopiesSupported.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/DateTimeAtCompleted.java b/libjava/classpath/javax/print/attribute/standard/DateTimeAtCompleted.java
index 36b740ef30f..324bab73b8d 100644
--- a/libjava/classpath/javax/print/attribute/standard/DateTimeAtCompleted.java
+++ b/libjava/classpath/javax/print/attribute/standard/DateTimeAtCompleted.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Date;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DateTimeSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -92,7 +93,7 @@ public final class DateTimeAtCompleted extends DateTimeSyntax
*
* @return The class <code>DateTimeAtCompleted</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return DateTimeAtCompleted.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/DateTimeAtCreation.java b/libjava/classpath/javax/print/attribute/standard/DateTimeAtCreation.java
index b463c40ac88..5e975b64ae7 100644
--- a/libjava/classpath/javax/print/attribute/standard/DateTimeAtCreation.java
+++ b/libjava/classpath/javax/print/attribute/standard/DateTimeAtCreation.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Date;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DateTimeSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -92,7 +93,7 @@ public final class DateTimeAtCreation extends DateTimeSyntax
*
* @return The class <code>DateTimeAtCreation</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return DateTimeAtCreation.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/DateTimeAtProcessing.java b/libjava/classpath/javax/print/attribute/standard/DateTimeAtProcessing.java
index 42dee8048eb..b407d2b2aa0 100644
--- a/libjava/classpath/javax/print/attribute/standard/DateTimeAtProcessing.java
+++ b/libjava/classpath/javax/print/attribute/standard/DateTimeAtProcessing.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Date;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DateTimeSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -92,7 +93,7 @@ public final class DateTimeAtProcessing extends DateTimeSyntax
*
* @return The class <code>DateTimeAtProcessing</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return DateTimeAtProcessing.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/Destination.java b/libjava/classpath/javax/print/attribute/standard/Destination.java
index 1a4e79dd8f8..a82aa4b369d 100644
--- a/libjava/classpath/javax/print/attribute/standard/Destination.java
+++ b/libjava/classpath/javax/print/attribute/standard/Destination.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.net.URI;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.URISyntax;
@@ -104,7 +105,7 @@ public final class Destination extends URISyntax
*
* @return The class <code>Destination</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return Destination.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/DocumentName.java b/libjava/classpath/javax/print/attribute/standard/DocumentName.java
index d1428ed8b79..6a377d5be70 100644
--- a/libjava/classpath/javax/print/attribute/standard/DocumentName.java
+++ b/libjava/classpath/javax/print/attribute/standard/DocumentName.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Locale;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.TextSyntax;
@@ -98,7 +99,7 @@ public final class DocumentName extends TextSyntax
*
* @return The class <code>DocumentName</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return DocumentName.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/Fidelity.java b/libjava/classpath/javax/print/attribute/standard/Fidelity.java
index 02e292f58b4..5e25f5b882b 100644
--- a/libjava/classpath/javax/print/attribute/standard/Fidelity.java
+++ b/libjava/classpath/javax/print/attribute/standard/Fidelity.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
@@ -107,7 +108,7 @@ public final class Fidelity extends EnumSyntax
*
* @return The class <code>Fidelity</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return Fidelity.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/Finishings.java b/libjava/classpath/javax/print/attribute/standard/Finishings.java
index 963485e7b87..cd8f6753b30 100644
--- a/libjava/classpath/javax/print/attribute/standard/Finishings.java
+++ b/libjava/classpath/javax/print/attribute/standard/Finishings.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -238,7 +239,7 @@ public class Finishings extends EnumSyntax
*
* @return the class <code>Finishings</code> itself
*/
- public final Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return Finishings.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobHoldUntil.java b/libjava/classpath/javax/print/attribute/standard/JobHoldUntil.java
index 768600f8065..7c137ccd171 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobHoldUntil.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobHoldUntil.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Date;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DateTimeSyntax;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
@@ -98,7 +99,7 @@ public final class JobHoldUntil extends DateTimeSyntax
*
* @return The class <code>JobHoldUntil</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobHoldUntil.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobImpressions.java b/libjava/classpath/javax/print/attribute/standard/JobImpressions.java
index 0da3e59cf24..a2c7d4dd653 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobImpressions.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobImpressions.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
@@ -110,7 +111,7 @@ public final class JobImpressions extends IntegerSyntax
*
* @return The class <code>JobImpressions</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobImpressions.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobImpressionsCompleted.java b/libjava/classpath/javax/print/attribute/standard/JobImpressionsCompleted.java
index 82da507a044..55d3fd6b991 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobImpressionsCompleted.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobImpressionsCompleted.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -101,7 +102,7 @@ public final class JobImpressionsCompleted extends IntegerSyntax
*
* @return The class <code>JobImpressionsCompleted</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobImpressionsCompleted.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobImpressionsSupported.java b/libjava/classpath/javax/print/attribute/standard/JobImpressionsSupported.java
index bd10457513c..5be3fc0a6f2 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobImpressionsSupported.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobImpressionsSupported.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.SetOfIntegerSyntax;
import javax.print.attribute.SupportedValuesAttribute;
@@ -96,7 +97,7 @@ public final class JobImpressionsSupported extends SetOfIntegerSyntax
*
* @return The class <code>JobImpressionsSupported</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobImpressionsSupported.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobKOctets.java b/libjava/classpath/javax/print/attribute/standard/JobKOctets.java
index b380aa17ce9..ac9a7eff6ae 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobKOctets.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobKOctets.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
@@ -110,7 +111,7 @@ public final class JobKOctets extends IntegerSyntax
*
* @return The class <code>JobKOctets</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobKOctets.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobKOctetsProcessed.java b/libjava/classpath/javax/print/attribute/standard/JobKOctetsProcessed.java
index 762369565e2..34616edfeaa 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobKOctetsProcessed.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobKOctetsProcessed.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -102,7 +103,7 @@ public final class JobKOctetsProcessed extends IntegerSyntax
*
* @return The class <code>JobKOctetsProcessed</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobKOctetsProcessed.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobKOctetsSupported.java b/libjava/classpath/javax/print/attribute/standard/JobKOctetsSupported.java
index 8a4cbfc8c16..4936fd49f72 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobKOctetsSupported.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobKOctetsSupported.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.SetOfIntegerSyntax;
import javax.print.attribute.SupportedValuesAttribute;
@@ -96,7 +97,7 @@ public final class JobKOctetsSupported extends SetOfIntegerSyntax
*
* @return The class <code>JobKOctetsSupported</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobKOctetsSupported.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobMediaSheets.java b/libjava/classpath/javax/print/attribute/standard/JobMediaSheets.java
index 04b83069c2a..17cf96f33b6 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobMediaSheets.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobMediaSheets.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
@@ -107,7 +108,7 @@ public class JobMediaSheets extends IntegerSyntax
*
* @return The class <code>JobMediaSheets</code> itself.
*/
- public final Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobMediaSheets.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsCompleted.java b/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsCompleted.java
index 85b9ab0481e..353c044ec1a 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsCompleted.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsCompleted.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -96,7 +97,7 @@ public final class JobMediaSheetsCompleted extends IntegerSyntax
*
* @return The class <code>JobMediaSheetsCompleted</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobMediaSheetsCompleted.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsSupported.java b/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsSupported.java
index cb06af6fabe..d9a0ed2dfca 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsSupported.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobMediaSheetsSupported.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.SetOfIntegerSyntax;
import javax.print.attribute.SupportedValuesAttribute;
@@ -96,7 +97,7 @@ public final class JobMediaSheetsSupported extends SetOfIntegerSyntax
*
* @return The class <code>JobMediaSheetsSupported</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobMediaSheetsSupported.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobMessageFromOperator.java b/libjava/classpath/javax/print/attribute/standard/JobMessageFromOperator.java
index 8eaae357c88..f2a589af42f 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobMessageFromOperator.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobMessageFromOperator.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Locale;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.TextSyntax;
@@ -95,7 +96,7 @@ public final class JobMessageFromOperator extends TextSyntax
*
* @return The class <code>JobMessageFromOperator</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobMessageFromOperator.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobName.java b/libjava/classpath/javax/print/attribute/standard/JobName.java
index c848a63d35e..5f5310e9676 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobName.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobName.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Locale;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.TextSyntax;
@@ -93,7 +94,7 @@ public final class JobName extends TextSyntax
*
* @return The class <code>JobName</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobName.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobOriginatingUserName.java b/libjava/classpath/javax/print/attribute/standard/JobOriginatingUserName.java
index 2d6e79df654..62073daa6db 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobOriginatingUserName.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobOriginatingUserName.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Locale;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.TextSyntax;
@@ -92,7 +93,7 @@ public final class JobOriginatingUserName extends TextSyntax
*
* @return The class <code>JobOriginatingUserName</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobOriginatingUserName.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobPriority.java b/libjava/classpath/javax/print/attribute/standard/JobPriority.java
index bcfb239ed9b..88fc685b8ea 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobPriority.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobPriority.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
@@ -97,7 +98,7 @@ public final class JobPriority extends IntegerSyntax
*
* @return The class <code>JobPriority</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobPriority.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobPrioritySupported.java b/libjava/classpath/javax/print/attribute/standard/JobPrioritySupported.java
index 0db7107b304..e7ebca2db73 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobPrioritySupported.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobPrioritySupported.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.SupportedValuesAttribute;
@@ -99,7 +100,7 @@ public final class JobPrioritySupported extends IntegerSyntax
*
* @return The class <code>JobPrioritySupported</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobPrioritySupported.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobSheets.java b/libjava/classpath/javax/print/attribute/standard/JobSheets.java
index f2cfacc9ecd..a930f63cf50 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobSheets.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobSheets.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
@@ -88,7 +89,7 @@ public class JobSheets extends EnumSyntax
*
* @return The class <code>JobSheets</code> itself.
*/
- public final Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobSheets.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobState.java b/libjava/classpath/javax/print/attribute/standard/JobState.java
index 8289569c35c..fa769bbf33d 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobState.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobState.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -137,7 +138,7 @@ public class JobState extends EnumSyntax
*
* @return The class <code>JobState</code> itself.
*/
- public final Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobState.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobStateReason.java b/libjava/classpath/javax/print/attribute/standard/JobStateReason.java
index 967a6bf2e53..b8420b18012 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobStateReason.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobStateReason.java
@@ -262,7 +262,7 @@ public class JobStateReason extends EnumSyntax
*
* @return The class <code>JobStateReason</code> itself.
*/
- public final Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobStateReason.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java b/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java
index 32f942b6bd7..997dcbc3779 100644
--- a/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java
+++ b/libjava/classpath/javax/print/attribute/standard/JobStateReasons.java
@@ -42,6 +42,7 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintJobAttribute;
/**
@@ -56,7 +57,7 @@ import javax.print.attribute.PrintJobAttribute;
* @author Michael Koch (konqueror@gmx.de)
* @author Wolfgang Baer (WBaer@gmx.de)
*/
-public final class JobStateReasons extends HashSet
+public final class JobStateReasons extends HashSet<JobStateReason>
implements PrintJobAttribute
{
private static final long serialVersionUID = 8849088261264331812L;
@@ -108,12 +109,11 @@ public final class JobStateReasons extends HashSet
* @throws ClassCastException if values of collection are not of type
* <code>JobStateReason</code>.
*/
- public JobStateReasons(Collection collection)
+ public JobStateReasons(Collection<JobStateReason> collection)
{
super(collection.size(), 0.75f);
- Iterator it = collection.iterator();
- while (it.hasNext())
- add(it.next());
+ for (JobStateReason reason : collection)
+ add(reason);
}
/**
@@ -126,12 +126,12 @@ public final class JobStateReasons extends HashSet
* @throws ClassCastException if given object is not an instance of
* <code>JobStateReason</code>.
*/
- public boolean add(Object o)
+ public boolean add(JobStateReason o)
{
if (o == null)
throw new NullPointerException("reason is null");
- return super.add((JobStateReason) o);
+ return add(o);
}
/**
@@ -139,7 +139,7 @@ public final class JobStateReasons extends HashSet
*
* @return The class <code>JobStateReasons</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return JobStateReasons.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/Media.java b/libjava/classpath/javax/print/attribute/standard/Media.java
index 37132e72706..4c0af0ed11b 100644
--- a/libjava/classpath/javax/print/attribute/standard/Media.java
+++ b/libjava/classpath/javax/print/attribute/standard/Media.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -105,7 +106,7 @@ public abstract class Media extends EnumSyntax
*
* @return The class <code>Media</code> itself.
*/
- public final Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return Media.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/MediaPrintableArea.java b/libjava/classpath/javax/print/attribute/standard/MediaPrintableArea.java
index e0366f589ad..84ebd61ce87 100644
--- a/libjava/classpath/javax/print/attribute/standard/MediaPrintableArea.java
+++ b/libjava/classpath/javax/print/attribute/standard/MediaPrintableArea.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
@@ -152,7 +153,7 @@ public final class MediaPrintableArea
*
* @return The class <code>MediaPrintableArea</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return MediaPrintableArea.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/MediaSize.java b/libjava/classpath/javax/print/attribute/standard/MediaSize.java
index 982b5c5ef7b..be3f1567812 100644
--- a/libjava/classpath/javax/print/attribute/standard/MediaSize.java
+++ b/libjava/classpath/javax/print/attribute/standard/MediaSize.java
@@ -66,13 +66,13 @@ public class MediaSize extends Size2DSyntax
implements Attribute
{
private static final long serialVersionUID = -1967958664615414771L;
-
- private static ArrayList mediaCache;
+
+ private static ArrayList<MediaSize> mediaCache;
static
{
- mediaCache = new ArrayList();
-
+ mediaCache = new ArrayList<MediaSize>();
+
// We call one instance of every container class to make sure it gets
// loaded during class initialization and therefore all other static
// fields of this container class also.
@@ -86,7 +86,7 @@ public class MediaSize extends Size2DSyntax
tmp = MediaSize.NA.LEGAL;
tmp = MediaSize.Other.EXECUTIVE;
}
-
+
private MediaSizeName mediaName;
/**
@@ -180,10 +180,11 @@ public class MediaSize extends Size2DSyntax
*
* @return The class <code>MediaSize</code> itself.
*/
- public final Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return MediaSize.class;
}
+
/**
* Searches for a MediaSize object with the given dimensions.
@@ -201,7 +202,7 @@ public class MediaSize extends Size2DSyntax
if (x <= 0.0f || y <= 0.0f)
throw new IllegalArgumentException(
"x and/or y may not be less or equal 0");
-
+
if (units < 1)
throw new IllegalArgumentException("units may not be less then 1");
diff --git a/libjava/classpath/javax/print/attribute/standard/MultipleDocumentHandling.java b/libjava/classpath/javax/print/attribute/standard/MultipleDocumentHandling.java
index 1a89fd01aef..3ee1b4126e7 100644
--- a/libjava/classpath/javax/print/attribute/standard/MultipleDocumentHandling.java
+++ b/libjava/classpath/javax/print/attribute/standard/MultipleDocumentHandling.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
@@ -108,7 +109,7 @@ public class MultipleDocumentHandling extends EnumSyntax
*
* @return The class <code>MultipleDocumentHandling</code> itself.
*/
- public final Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return MultipleDocumentHandling.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/NumberOfDocuments.java b/libjava/classpath/javax/print/attribute/standard/NumberOfDocuments.java
index b9363eb9101..1121a1f0f79 100644
--- a/libjava/classpath/javax/print/attribute/standard/NumberOfDocuments.java
+++ b/libjava/classpath/javax/print/attribute/standard/NumberOfDocuments.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -90,7 +91,7 @@ public final class NumberOfDocuments extends IntegerSyntax
*
* @return The class <code>NumberOfDocuments</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return NumberOfDocuments.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/NumberOfInterveningJobs.java b/libjava/classpath/javax/print/attribute/standard/NumberOfInterveningJobs.java
index d3c0952fcae..b968f9a7bf1 100644
--- a/libjava/classpath/javax/print/attribute/standard/NumberOfInterveningJobs.java
+++ b/libjava/classpath/javax/print/attribute/standard/NumberOfInterveningJobs.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -91,7 +92,7 @@ public final class NumberOfInterveningJobs extends IntegerSyntax
*
* @return The class <code>NumberOfInterveningJobs</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return NumberOfInterveningJobs.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/NumberUp.java b/libjava/classpath/javax/print/attribute/standard/NumberUp.java
index aa2324040af..219a1c1a8b7 100644
--- a/libjava/classpath/javax/print/attribute/standard/NumberUp.java
+++ b/libjava/classpath/javax/print/attribute/standard/NumberUp.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -95,7 +96,7 @@ public final class NumberUp extends IntegerSyntax
*
* @return The class <code>NumberUp</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return NumberUp.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/NumberUpSupported.java b/libjava/classpath/javax/print/attribute/standard/NumberUpSupported.java
index 71392a9ef52..20bd9c93b59 100644
--- a/libjava/classpath/javax/print/attribute/standard/NumberUpSupported.java
+++ b/libjava/classpath/javax/print/attribute/standard/NumberUpSupported.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.SetOfIntegerSyntax;
import javax.print.attribute.SupportedValuesAttribute;
@@ -128,7 +129,7 @@ public final class NumberUpSupported extends SetOfIntegerSyntax
*
* @return The class <code>NumberUpSupported</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return NumberUpSupported.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/OrientationRequested.java b/libjava/classpath/javax/print/attribute/standard/OrientationRequested.java
index 1f9f0bf6f7e..8d346855664 100644
--- a/libjava/classpath/javax/print/attribute/standard/OrientationRequested.java
+++ b/libjava/classpath/javax/print/attribute/standard/OrientationRequested.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -112,7 +113,7 @@ public final class OrientationRequested extends EnumSyntax
*
* @return The class <code>OrientationRequested</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return OrientationRequested.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/OutputDeviceAssigned.java b/libjava/classpath/javax/print/attribute/standard/OutputDeviceAssigned.java
index 917064f5446..df8a5453f15 100644
--- a/libjava/classpath/javax/print/attribute/standard/OutputDeviceAssigned.java
+++ b/libjava/classpath/javax/print/attribute/standard/OutputDeviceAssigned.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Locale;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.TextSyntax;
@@ -98,7 +99,7 @@ public final class OutputDeviceAssigned extends TextSyntax
*
* @return The class <code>OutputDeviceAssigned</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return OutputDeviceAssigned.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PDLOverrideSupported.java b/libjava/classpath/javax/print/attribute/standard/PDLOverrideSupported.java
index ee07edb1af5..02c9c198c0b 100644
--- a/libjava/classpath/javax/print/attribute/standard/PDLOverrideSupported.java
+++ b/libjava/classpath/javax/print/attribute/standard/PDLOverrideSupported.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintServiceAttribute;
@@ -91,7 +92,7 @@ public class PDLOverrideSupported extends EnumSyntax
*
* @return The class <code>PDLOverrideSupported</code> itself.
*/
- public final Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PDLOverrideSupported.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PageRanges.java b/libjava/classpath/javax/print/attribute/standard/PageRanges.java
index 3aa1b562549..9637a917f89 100644
--- a/libjava/classpath/javax/print/attribute/standard/PageRanges.java
+++ b/libjava/classpath/javax/print/attribute/standard/PageRanges.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
@@ -154,7 +155,7 @@ public final class PageRanges extends SetOfIntegerSyntax
*
* @return The class <code>PageRanges</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PageRanges.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PagesPerMinute.java b/libjava/classpath/javax/print/attribute/standard/PagesPerMinute.java
index c06fb9746af..6305842c010 100644
--- a/libjava/classpath/javax/print/attribute/standard/PagesPerMinute.java
+++ b/libjava/classpath/javax/print/attribute/standard/PagesPerMinute.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintServiceAttribute;
@@ -92,7 +93,7 @@ public final class PagesPerMinute extends IntegerSyntax
*
* @return The class <code>PagesPerMinute</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PagesPerMinute.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PagesPerMinuteColor.java b/libjava/classpath/javax/print/attribute/standard/PagesPerMinuteColor.java
index 80a397e6381..3d5fa2ca559 100644
--- a/libjava/classpath/javax/print/attribute/standard/PagesPerMinuteColor.java
+++ b/libjava/classpath/javax/print/attribute/standard/PagesPerMinuteColor.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintServiceAttribute;
@@ -91,7 +92,7 @@ public final class PagesPerMinuteColor extends IntegerSyntax
*
* @return The class <code>PagesPerMinuteColor</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PagesPerMinuteColor.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PresentationDirection.java b/libjava/classpath/javax/print/attribute/standard/PresentationDirection.java
index 3a479abfac4..14d560533a6 100644
--- a/libjava/classpath/javax/print/attribute/standard/PresentationDirection.java
+++ b/libjava/classpath/javax/print/attribute/standard/PresentationDirection.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
@@ -138,7 +139,7 @@ public final class PresentationDirection extends EnumSyntax
*
* @return The class <code>PresentationDirection</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PresentationDirection.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PrintQuality.java b/libjava/classpath/javax/print/attribute/standard/PrintQuality.java
index c581d5f9dbe..bc94d532b8b 100644
--- a/libjava/classpath/javax/print/attribute/standard/PrintQuality.java
+++ b/libjava/classpath/javax/print/attribute/standard/PrintQuality.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -92,7 +93,7 @@ public class PrintQuality extends EnumSyntax
*
* @return The class <code>PrintQuality</code> itself.
*/
- public final Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PrintQuality.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PrinterInfo.java b/libjava/classpath/javax/print/attribute/standard/PrinterInfo.java
index 2cd496cf0c7..e287f8ce9e1 100644
--- a/libjava/classpath/javax/print/attribute/standard/PrinterInfo.java
+++ b/libjava/classpath/javax/print/attribute/standard/PrinterInfo.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Locale;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
@@ -92,7 +93,7 @@ public final class PrinterInfo extends TextSyntax
*
* @return The class <code>PrinterInfo</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PrinterInfo.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PrinterIsAcceptingJobs.java b/libjava/classpath/javax/print/attribute/standard/PrinterIsAcceptingJobs.java
index 96dbc57ce32..1c9c3993029 100644
--- a/libjava/classpath/javax/print/attribute/standard/PrinterIsAcceptingJobs.java
+++ b/libjava/classpath/javax/print/attribute/standard/PrinterIsAcceptingJobs.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintServiceAttribute;
@@ -93,7 +94,7 @@ public final class PrinterIsAcceptingJobs extends EnumSyntax
*
* @return The class <code>PrinterIsAcceptingJobs</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PrinterIsAcceptingJobs.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PrinterLocation.java b/libjava/classpath/javax/print/attribute/standard/PrinterLocation.java
index 35b61e4e5d1..7a446adcb99 100644
--- a/libjava/classpath/javax/print/attribute/standard/PrinterLocation.java
+++ b/libjava/classpath/javax/print/attribute/standard/PrinterLocation.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Locale;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
@@ -92,7 +93,7 @@ public final class PrinterLocation extends TextSyntax
*
* @return The class <code>PrinterLocation</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PrinterLocation.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PrinterMakeAndModel.java b/libjava/classpath/javax/print/attribute/standard/PrinterMakeAndModel.java
index 7010746a522..77fd84b4a5b 100644
--- a/libjava/classpath/javax/print/attribute/standard/PrinterMakeAndModel.java
+++ b/libjava/classpath/javax/print/attribute/standard/PrinterMakeAndModel.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Locale;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
@@ -92,7 +93,7 @@ public final class PrinterMakeAndModel extends TextSyntax
*
* @return The class <code>PrinterMakeAndModel</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PrinterMakeAndModel.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PrinterMessageFromOperator.java b/libjava/classpath/javax/print/attribute/standard/PrinterMessageFromOperator.java
index b4f5d88bd45..55bc7406a0e 100644
--- a/libjava/classpath/javax/print/attribute/standard/PrinterMessageFromOperator.java
+++ b/libjava/classpath/javax/print/attribute/standard/PrinterMessageFromOperator.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Locale;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
@@ -95,7 +96,7 @@ public final class PrinterMessageFromOperator extends TextSyntax
*
* @return The class <code>PrinterMessageFromOperator</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PrinterMessageFromOperator.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfo.java b/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfo.java
index 28abd4e3fb6..de330fe0bfa 100644
--- a/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfo.java
+++ b/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfo.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.net.URI;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.URISyntax;
@@ -94,7 +95,7 @@ public final class PrinterMoreInfo extends URISyntax
*
* @return The class <code>PrinterMoreInfo</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PrinterMoreInfo.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java b/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
index df0232e167d..73a627eb308 100644
--- a/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
+++ b/libjava/classpath/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.net.URI;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.URISyntax;
@@ -98,7 +99,7 @@ public final class PrinterMoreInfoManufacturer extends URISyntax
*
* @return The class <code>PrinterMoreInfoManufacturer</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PrinterMoreInfoManufacturer.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PrinterName.java b/libjava/classpath/javax/print/attribute/standard/PrinterName.java
index 5b7da605969..b084c2c0fd4 100644
--- a/libjava/classpath/javax/print/attribute/standard/PrinterName.java
+++ b/libjava/classpath/javax/print/attribute/standard/PrinterName.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Locale;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.TextSyntax;
@@ -94,7 +95,7 @@ public final class PrinterName extends TextSyntax
*
* @return The class <code>PrinterName</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PrinterName.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PrinterResolution.java b/libjava/classpath/javax/print/attribute/standard/PrinterResolution.java
index f4cde0f5e72..7b60a0cada4 100644
--- a/libjava/classpath/javax/print/attribute/standard/PrinterResolution.java
+++ b/libjava/classpath/javax/print/attribute/standard/PrinterResolution.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
@@ -95,7 +96,7 @@ public final class PrinterResolution extends ResolutionSyntax
*
* @return The class <code>PrinterResolution</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PrinterResolution.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PrinterState.java b/libjava/classpath/javax/print/attribute/standard/PrinterState.java
index 6fd4c3f4643..4b85c01896f 100644
--- a/libjava/classpath/javax/print/attribute/standard/PrinterState.java
+++ b/libjava/classpath/javax/print/attribute/standard/PrinterState.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintServiceAttribute;
@@ -108,7 +109,7 @@ public final class PrinterState extends EnumSyntax
*
* @return The class <code>PrinterState</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PrinterState.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PrinterStateReason.java b/libjava/classpath/javax/print/attribute/standard/PrinterStateReason.java
index 340bfbabf51..1abb7c6aa3e 100644
--- a/libjava/classpath/javax/print/attribute/standard/PrinterStateReason.java
+++ b/libjava/classpath/javax/print/attribute/standard/PrinterStateReason.java
@@ -293,7 +293,7 @@ public class PrinterStateReason extends EnumSyntax
*
* @return The class <code>PrintStateReason</code> itself.
*/
- public final Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PrinterStateReason.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PrinterStateReasons.java b/libjava/classpath/javax/print/attribute/standard/PrinterStateReasons.java
index 40c6f1b7151..c58dd53795e 100644
--- a/libjava/classpath/javax/print/attribute/standard/PrinterStateReasons.java
+++ b/libjava/classpath/javax/print/attribute/standard/PrinterStateReasons.java
@@ -45,6 +45,7 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintServiceAttribute;
/**
@@ -68,7 +69,8 @@ import javax.print.attribute.PrintServiceAttribute;
* @author Michael Koch (konqueror@gmx.de)
* @author Wolfgang Baer (WBaer@gmx.de)
*/
-public final class PrinterStateReasons extends HashMap
+public final class PrinterStateReasons
+ extends HashMap<PrinterStateReason, Severity>
implements PrintServiceAttribute
{
private static final long serialVersionUID = -3731791085163619457L;
@@ -121,13 +123,11 @@ public final class PrinterStateReasons extends HashMap
* <code>PrinterStateReason</code> and keys are not of type
* <code>Severity</code>.
*/
- public PrinterStateReasons(Map map)
+ public PrinterStateReasons(Map<PrinterStateReason,Severity> map)
{
super(map.size(), 0.75f);
- Iterator it = map.entrySet().iterator();
- while (it.hasNext())
+ for (Map.Entry<PrinterStateReason,Severity> entry : map.entrySet())
{
- Map.Entry entry = (Map.Entry) it.next();
put(entry.getKey(), entry.getValue());
}
}
@@ -139,7 +139,7 @@ public final class PrinterStateReasons extends HashMap
* @param severity the severity level for the constructed set.
* @return The set of printer state reasons.
*/
- public Set printerStateReasonSet(Severity severity)
+ public Set<PrinterStateReason> printerStateReasonSet(Severity severity)
{
if (severity == null)
throw new NullPointerException("severity is null");
@@ -171,7 +171,7 @@ public final class PrinterStateReasons extends HashMap
* <code>PrinterStateReason</code> and severity is not a
* <code>Severity</code> instance.
*/
- public Object put(Object reason, Object severity)
+ public Severity put(PrinterStateReason reason,Severity severity)
{
if (reason == null)
throw new NullPointerException("reason is null");
@@ -186,7 +186,7 @@ public final class PrinterStateReasons extends HashMap
*
* @return The class <code>PrintStateReasons</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PrinterStateReasons.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/PrinterURI.java b/libjava/classpath/javax/print/attribute/standard/PrinterURI.java
index 0deca90bed2..017e6b85a39 100644
--- a/libjava/classpath/javax/print/attribute/standard/PrinterURI.java
+++ b/libjava/classpath/javax/print/attribute/standard/PrinterURI.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.net.URI;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintServiceAttribute;
import javax.print.attribute.URISyntax;
@@ -94,7 +95,7 @@ public final class PrinterURI extends URISyntax
*
* @return The class <code>PrinterURI</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return PrinterURI.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/QueuedJobCount.java b/libjava/classpath/javax/print/attribute/standard/QueuedJobCount.java
index 8ff46a95459..d024b3dcc97 100644
--- a/libjava/classpath/javax/print/attribute/standard/QueuedJobCount.java
+++ b/libjava/classpath/javax/print/attribute/standard/QueuedJobCount.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintServiceAttribute;
@@ -93,7 +94,7 @@ public final class QueuedJobCount extends IntegerSyntax
*
* @return The class <code>QueuedJobCount</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return QueuedJobCount.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/ReferenceUriSchemesSupported.java b/libjava/classpath/javax/print/attribute/standard/ReferenceUriSchemesSupported.java
index aeccaac5b5a..9d2354bd6ba 100644
--- a/libjava/classpath/javax/print/attribute/standard/ReferenceUriSchemesSupported.java
+++ b/libjava/classpath/javax/print/attribute/standard/ReferenceUriSchemesSupported.java
@@ -128,7 +128,7 @@ public class ReferenceUriSchemesSupported extends EnumSyntax
*
* @return The class <code>ReferenceUriSchemesSupported</code> itself.
*/
- public final Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return ReferenceUriSchemesSupported.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/RequestingUserName.java b/libjava/classpath/javax/print/attribute/standard/RequestingUserName.java
index 8b947036c45..b7b85abbdaa 100644
--- a/libjava/classpath/javax/print/attribute/standard/RequestingUserName.java
+++ b/libjava/classpath/javax/print/attribute/standard/RequestingUserName.java
@@ -40,6 +40,7 @@ package javax.print.attribute.standard;
import java.util.Locale;
+import javax.print.attribute.Attribute;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.TextSyntax;
@@ -92,7 +93,7 @@ public final class RequestingUserName extends TextSyntax
*
* @return The class <code>RequestingUserName</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return RequestingUserName.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/Severity.java b/libjava/classpath/javax/print/attribute/standard/Severity.java
index 5569816de8e..019c8c6fcbb 100644
--- a/libjava/classpath/javax/print/attribute/standard/Severity.java
+++ b/libjava/classpath/javax/print/attribute/standard/Severity.java
@@ -97,7 +97,7 @@ public final class Severity extends EnumSyntax
*
* @return The class <code>Severity</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return Severity.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/SheetCollate.java b/libjava/classpath/javax/print/attribute/standard/SheetCollate.java
index 5343bc6df1b..886b8d6c921 100644
--- a/libjava/classpath/javax/print/attribute/standard/SheetCollate.java
+++ b/libjava/classpath/javax/print/attribute/standard/SheetCollate.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -97,7 +98,7 @@ public final class SheetCollate extends EnumSyntax
*
* @return The class <code>SheetCollate</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return SheetCollate.class;
}
diff --git a/libjava/classpath/javax/print/attribute/standard/Sides.java b/libjava/classpath/javax/print/attribute/standard/Sides.java
index 816365aedea..02fe4a1e5d1 100644
--- a/libjava/classpath/javax/print/attribute/standard/Sides.java
+++ b/libjava/classpath/javax/print/attribute/standard/Sides.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.print.attribute.standard;
+import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
@@ -108,7 +109,7 @@ public final class Sides extends EnumSyntax
*
* @return The class <code>Sides</code> itself.
*/
- public Class getCategory()
+ public Class< ? extends Attribute> getCategory()
{
return Sides.class;
}
diff --git a/libjava/classpath/javax/rmi/CORBA/Tie.java b/libjava/classpath/javax/rmi/CORBA/Tie.java
index b8611838822..af9ddd3d44a 100644
--- a/libjava/classpath/javax/rmi/CORBA/Tie.java
+++ b/libjava/classpath/javax/rmi/CORBA/Tie.java
@@ -103,7 +103,7 @@ public interface Tie
/**
* Get the object that delegates calls to this tie.
*
- * @see org.omg.PortableServer.Servant#_this_object
+ * @see org.omg.PortableServer.Servant#_this_object()
*/
org.omg.CORBA.Object thisObject();
@@ -112,12 +112,12 @@ public interface Tie
* Depending on the POA policies, it may be possible to activate the Tie
* again. The ties that are not derived from
* {@link org.omg.PortableServer.Servant} deactivate themselves by
- * {@link ORB.disconnect}.
+ * {@link ORB#disconnect}.
*
* @throws NoSuchObjectException if there are no objects served by this Tie,
* or if the these objects are already deactivated.
*
- * @see org.omg.PortableServer.POA#deactivate_object
+ * @see org.omg.PortableServer.POAOperations#deactivate_object
*/
void deactivate()
throws NoSuchObjectException;
diff --git a/libjava/classpath/javax/security/auth/Subject.java b/libjava/classpath/javax/security/auth/Subject.java
index 1659c6425fe..03836345862 100644
--- a/libjava/classpath/javax/security/auth/Subject.java
+++ b/libjava/classpath/javax/security/auth/Subject.java
@@ -91,8 +91,9 @@ public final class Subject implements Serializable
readOnly = false;
}
- public Subject (final boolean readOnly, final Set principals,
- final Set pubCred, final Set privCred)
+ public Subject (final boolean readOnly,
+ final Set<? extends Principal> principals,
+ final Set<?> pubCred, final Set<?> privCred)
{
if (principals == null || pubCred == null || privCred == null)
{
@@ -265,12 +266,12 @@ public final class Subject implements Serializable
privCred.containsAll (that.getPrivateCredentials());
}
- public Set getPrincipals()
+ public Set<Principal> getPrincipals()
{
return principals;
}
- public Set getPrincipals(Class clazz)
+ public <T extends Principal> Set<T> getPrincipals(Class<T> clazz)
{
HashSet result = new HashSet (principals.size());
for (Iterator it = principals.iterator(); it.hasNext(); )
@@ -284,12 +285,12 @@ public final class Subject implements Serializable
return Collections.unmodifiableSet (result);
}
- public Set getPrivateCredentials()
+ public Set<Object> getPrivateCredentials()
{
return privCred;
}
- public Set getPrivateCredentials (Class clazz)
+ public <T> Set<T> getPrivateCredentials (Class<T> clazz)
{
HashSet result = new HashSet (privCred.size());
for (Iterator it = privCred.iterator(); it.hasNext(); )
@@ -303,12 +304,12 @@ public final class Subject implements Serializable
return Collections.unmodifiableSet (result);
}
- public Set getPublicCredentials()
+ public Set<Object> getPublicCredentials()
{
return pubCred;
}
- public Set getPublicCredentials (Class clazz)
+ public <T> Set<T> getPublicCredentials (Class<T> clazz)
{
HashSet result = new HashSet (pubCred.size());
for (Iterator it = pubCred.iterator(); it.hasNext(); )
diff --git a/libjava/classpath/javax/security/auth/login/AppConfigurationEntry.java b/libjava/classpath/javax/security/auth/login/AppConfigurationEntry.java
index b455dbb6c24..3c8b64d4c99 100644
--- a/libjava/classpath/javax/security/auth/login/AppConfigurationEntry.java
+++ b/libjava/classpath/javax/security/auth/login/AppConfigurationEntry.java
@@ -56,7 +56,7 @@ public class AppConfigurationEntry
public AppConfigurationEntry (final String loginModuleName,
final LoginModuleControlFlag controlFlag,
- final Map options)
+ final Map<String, ?> options)
{
if (loginModuleName == null || loginModuleName.length() == 0)
throw new IllegalArgumentException ("module name cannot be null nor empty");
@@ -88,7 +88,7 @@ public class AppConfigurationEntry
return loginModuleName;
}
- public Map getOptions()
+ public Map<String, ?> getOptions()
{
return options;
}
diff --git a/libjava/classpath/javax/security/auth/spi/LoginModule.java b/libjava/classpath/javax/security/auth/spi/LoginModule.java
index 00b33c517e4..197cd692e37 100644
--- a/libjava/classpath/javax/security/auth/spi/LoginModule.java
+++ b/libjava/classpath/javax/security/auth/spi/LoginModule.java
@@ -95,7 +95,7 @@ public interface LoginModule
* @param options A mapping of options given to this module.
*/
void initialize(Subject subject, CallbackHandler handler,
- Map sharedState, Map options);
+ Map<String, ?> sharedState, Map<String, ?> options);
/**
* Authenticates a subject to the system. This is the primary
diff --git a/libjava/classpath/javax/security/sasl/Sasl.java b/libjava/classpath/javax/security/sasl/Sasl.java
index dbe4cc8c2ae..52210d971ac 100644
--- a/libjava/classpath/javax/security/sasl/Sasl.java
+++ b/libjava/classpath/javax/security/sasl/Sasl.java
@@ -356,7 +356,8 @@ public class Sasl
public static SaslClient createSaslClient(String[] mechanisms,
String authorizationID,
String protocol,
- String serverName, Map props,
+ String serverName,
+ Map<String, ?> props,
CallbackHandler cbh)
throws SaslException
{
@@ -444,7 +445,7 @@ public class Sasl
* {@link SaslClient} instance.
* @see #createSaslClient(String[],String,String,String,Map,CallbackHandler)
*/
- public static Enumeration getSaslClientFactories()
+ public static Enumeration<SaslClientFactory> getSaslClientFactories()
{
Vector result = new Vector();
HashSet names = new HashSet();
@@ -559,7 +560,8 @@ public class Sasl
*/
public static SaslServer createSaslServer(String mechanism, String protocol,
String serverName,
- Map props, CallbackHandler cbh)
+ Map<String, ?> props,
+ CallbackHandler cbh)
throws SaslException
{
if (mechanism == null)
@@ -636,7 +638,7 @@ public class Sasl
* {@link SaslServer} instance.
* @see #createSaslServer(String,String,String,Map,CallbackHandler)
*/
- public static Enumeration getSaslServerFactories()
+ public static Enumeration<SaslServerFactory> getSaslServerFactories()
{
Vector result = new Vector();
HashSet names = new HashSet();
diff --git a/libjava/classpath/javax/security/sasl/SaslClientFactory.java b/libjava/classpath/javax/security/sasl/SaslClientFactory.java
index ae36171c56e..be80fd9f1c9 100644
--- a/libjava/classpath/javax/security/sasl/SaslClientFactory.java
+++ b/libjava/classpath/javax/security/sasl/SaslClientFactory.java
@@ -97,8 +97,8 @@ public interface SaslClientFactory
* because of an error.
*/
SaslClient createSaslClient(String[] mechanisms, String authorizationID,
- String protocol, String serverName, Map props,
- CallbackHandler cbh)
+ String protocol, String serverName,
+ Map<String, ?> props, CallbackHandler cbh)
throws SaslException;
/**
@@ -114,5 +114,5 @@ public interface SaslClientFactory
* properties, if present in props, are ignored.
* @return a non-null array containing IANA-registered SASL mechanism names.
*/
- String[] getMechanismNames(Map props);
+ String[] getMechanismNames(Map<String, ?> props);
}
diff --git a/libjava/classpath/javax/security/sasl/SaslServerFactory.java b/libjava/classpath/javax/security/sasl/SaslServerFactory.java
index fc43fb636e9..b51ce3dbaf0 100644
--- a/libjava/classpath/javax/security/sasl/SaslServerFactory.java
+++ b/libjava/classpath/javax/security/sasl/SaslServerFactory.java
@@ -95,7 +95,8 @@ public interface SaslServerFactory
* of an error.
*/
SaslServer createSaslServer(String mechanism, String protocol,
- String serverName, Map props, CallbackHandler cbh)
+ String serverName, Map<String, ?> props,
+ CallbackHandler cbh)
throws SaslException;
/**
@@ -111,5 +112,5 @@ public interface SaslServerFactory
* properties, if present in props, are ignored.
* @return a non-null array containing IANA-registered SASL mechanism names.
*/
- String[] getMechanismNames(Map props);
+ String[] getMechanismNames(Map<String, ?> props);
}
diff --git a/libjava/classpath/javax/sound/midi/Instrument.java b/libjava/classpath/javax/sound/midi/Instrument.java
index 3402e8289c9..f2821db6484 100644
--- a/libjava/classpath/javax/sound/midi/Instrument.java
+++ b/libjava/classpath/javax/sound/midi/Instrument.java
@@ -59,7 +59,7 @@ public abstract class Instrument extends SoundbankResource
* @param dataClass the class used to represent sample data for this instrument
*/
protected Instrument(Soundbank soundbank, Patch patch,
- String name, Class dataClass)
+ String name, Class<?> dataClass)
{
super(soundbank, name, dataClass);
this.patch = patch;
diff --git a/libjava/classpath/javax/sound/midi/Sequence.java b/libjava/classpath/javax/sound/midi/Sequence.java
index 1a43d207ce6..2ea201cb2a4 100644
--- a/libjava/classpath/javax/sound/midi/Sequence.java
+++ b/libjava/classpath/javax/sound/midi/Sequence.java
@@ -65,7 +65,7 @@ public class Sequence
/**
* The MIDI tracks used by this sequence.
*/
- protected Vector tracks;
+ protected Vector<Track> tracks;
/**
* Tempo-based timing. Resolution is specified in ticks per beat.
@@ -107,7 +107,7 @@ public class Sequence
this.divisionType = divisionType;
this.resolution = resolution;
- tracks = new Vector(numTracks);
+ tracks = new Vector<Track>(numTracks);
while (numTracks > 0)
tracks.set(--numTracks, new Track());
}
@@ -189,7 +189,7 @@ public class Sequence
*/
public Track[] getTracks()
{
- return (Track[]) tracks.toArray(new Track[tracks.size()]);
+ return tracks.toArray(new Track[tracks.size()]);
}
/**
@@ -224,10 +224,10 @@ public class Sequence
public long getTickLength()
{
long length = 0;
- Iterator itr = tracks.iterator();
+ Iterator<Track> itr = tracks.iterator();
while (itr.hasNext())
{
- Track track = (Track) itr.next();
+ Track track = itr.next();
long trackTicks = track.ticks();
if (trackTicks > length)
length = trackTicks;
diff --git a/libjava/classpath/javax/sound/midi/SoundbankResource.java b/libjava/classpath/javax/sound/midi/SoundbankResource.java
index 435017e4cf2..93f42e48e1d 100644
--- a/libjava/classpath/javax/sound/midi/SoundbankResource.java
+++ b/libjava/classpath/javax/sound/midi/SoundbankResource.java
@@ -58,7 +58,7 @@ public abstract class SoundbankResource
* @param name the name of the resource
* @param dataClass the class used to represent the audio data
*/
- protected SoundbankResource(Soundbank soundbank, String name, Class dataClass)
+ protected SoundbankResource(Soundbank soundbank, String name, Class<?> dataClass)
{
this.soundbank = soundbank;
this.name = name;
@@ -90,7 +90,7 @@ public abstract class SoundbankResource
*
* @return the class used to represent the audio data for this resource
*/
- public Class getDataClass()
+ public Class<?> getDataClass()
{
return dataClass;
}
diff --git a/libjava/classpath/javax/sound/sampled/AudioFileFormat.java b/libjava/classpath/javax/sound/sampled/AudioFileFormat.java
index 81bbe4ecf10..37c2df4652c 100644
--- a/libjava/classpath/javax/sound/sampled/AudioFileFormat.java
+++ b/libjava/classpath/javax/sound/sampled/AudioFileFormat.java
@@ -153,7 +153,7 @@ public class AudioFileFormat
* @param properties the properties
*/
public AudioFileFormat(Type type, AudioFormat fmt, int frameLen,
- Map properties)
+ Map<String, Object> properties)
{
this.byteLength = AudioSystem.NOT_SPECIFIED;
this.format = fmt;
@@ -226,7 +226,7 @@ public class AudioFileFormat
* Return the properties associated with this format, as a Map.
* The returned Map is unmodifiable.
*/
- public Map properties()
+ public Map<String, Object> properties()
{
return properties;
}
diff --git a/libjava/classpath/javax/sound/sampled/AudioFormat.java b/libjava/classpath/javax/sound/sampled/AudioFormat.java
index 5199d71c3a3..a474ff9a5c4 100644
--- a/libjava/classpath/javax/sound/sampled/AudioFormat.java
+++ b/libjava/classpath/javax/sound/sampled/AudioFormat.java
@@ -177,7 +177,7 @@ public class AudioFormat
*/
public AudioFormat(Encoding encoding, float sampleRate, int sampleSizeInBits,
int channels, int frameSize, float frameRate,
- boolean bigEndian, Map properties)
+ boolean bigEndian, Map<String, Object> properties)
{
this.encoding = encoding;
this.sampleRate = sampleRate;
@@ -319,7 +319,7 @@ public class AudioFormat
* Return a read-only Map holding the properties associated with
* this format.
*/
- public Map properties()
+ public Map<String, Object> properties()
{
return properties;
}
diff --git a/libjava/classpath/javax/sound/sampled/DataLine.java b/libjava/classpath/javax/sound/sampled/DataLine.java
index f755958fe87..aa99a046ce4 100644
--- a/libjava/classpath/javax/sound/sampled/DataLine.java
+++ b/libjava/classpath/javax/sound/sampled/DataLine.java
@@ -64,7 +64,7 @@ public interface DataLine extends Line
* @param klass the class of the line
* @param fmt the supported format
*/
- public Info(Class klass, AudioFormat fmt)
+ public Info(Class<?> klass, AudioFormat fmt)
{
super(klass);
this.minBufferSize = AudioSystem.NOT_SPECIFIED;
@@ -80,7 +80,7 @@ public interface DataLine extends Line
* @param minSize the minimum buffer size
* @param maxSize the maximum buffer size
*/
- public Info(Class klass, AudioFormat[] fmts, int minSize, int maxSize)
+ public Info(Class<?> klass, AudioFormat[] fmts, int minSize, int maxSize)
{
super(klass);
this.minBufferSize = minSize;
@@ -96,7 +96,7 @@ public interface DataLine extends Line
* @param fmt the supported format
* @param size the buffer size
*/
- public Info(Class klass, AudioFormat fmt, int size)
+ public Info(Class<?> klass, AudioFormat fmt, int size)
{
super(klass);
this.minBufferSize = size;
diff --git a/libjava/classpath/javax/sound/sampled/Line.java b/libjava/classpath/javax/sound/sampled/Line.java
index 69bb9084f10..536752a1cc1 100644
--- a/libjava/classpath/javax/sound/sampled/Line.java
+++ b/libjava/classpath/javax/sound/sampled/Line.java
@@ -57,7 +57,7 @@ public interface Line
* for instance TargetDataLine.class.
* @param klass the class of the line
*/
- public Info(Class klass)
+ public Info(Class<?> klass)
{
this.klass = klass;
}
@@ -65,7 +65,7 @@ public interface Line
/**
* Return the line's class.
*/
- public Class getLineClass()
+ public Class<?> getLineClass()
{
return klass;
}
diff --git a/libjava/classpath/javax/sound/sampled/Port.java b/libjava/classpath/javax/sound/sampled/Port.java
index fb39e6c07ee..fc0bf71d9da 100644
--- a/libjava/classpath/javax/sound/sampled/Port.java
+++ b/libjava/classpath/javax/sound/sampled/Port.java
@@ -89,7 +89,7 @@ public interface Port extends Line
* @param name the name of the line
* @param isSource true if this is an input source
*/
- public Info(Class klass, String name, boolean isSource)
+ public Info(Class<?> klass, String name, boolean isSource)
{
super(klass);
this.name = name;
diff --git a/libjava/classpath/javax/sql/RowSet.java b/libjava/classpath/javax/sql/RowSet.java
index 46b776b3c10..2a9ad2784ee 100644
--- a/libjava/classpath/javax/sql/RowSet.java
+++ b/libjava/classpath/javax/sql/RowSet.java
@@ -78,9 +78,9 @@ public interface RowSet extends ResultSet
void setTransactionIsolation(int level) throws SQLException;
- Map getTypeMap() throws SQLException;
+ Map<String, Class<?>> getTypeMap() throws SQLException;
- void setTypeMap(Map map) throws SQLException;
+ void setTypeMap(Map<String, Class<?>> map) throws SQLException;
String getCommand();
diff --git a/libjava/classpath/javax/swing/AbstractButton.java b/libjava/classpath/javax/swing/AbstractButton.java
index 63f827a1ae0..cb0f458b89f 100644
--- a/libjava/classpath/javax/swing/AbstractButton.java
+++ b/libjava/classpath/javax/swing/AbstractButton.java
@@ -37,8 +37,6 @@ exception statement from your version. */
package javax.swing;
-import gnu.classpath.NotImplementedException;
-
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Image;
@@ -74,7 +72,10 @@ import javax.swing.plaf.ButtonUI;
import javax.swing.plaf.basic.BasicHTML;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.Element;
import javax.swing.text.Position;
+import javax.swing.text.StyledDocument;
import javax.swing.text.View;
@@ -187,9 +188,32 @@ public abstract class AbstractButton extends JComponent
*/
public void stateChanged(ChangeEvent ev)
{
- AbstractButton.this.fireStateChanged();
+ getEventHandler().stateChanged(ev);
+ }
+ }
+
+ /**
+ * The combined event handler for ActionEvent, ChangeEvent and
+ * ItemEvent. This combines ButtonChangeListener, ActionListener
+ */
+ private class EventHandler
+ implements ActionListener, ChangeListener, ItemListener
+ {
+ public void actionPerformed(ActionEvent ev)
+ {
+ fireActionPerformed(ev);
+ }
+
+ public void stateChanged(ChangeEvent ev)
+ {
+ fireStateChanged();
repaint();
}
+
+ public void itemStateChanged(ItemEvent ev)
+ {
+ fireItemStateChanged(ev);
+ }
}
/** The icon displayed by default. */
@@ -264,16 +288,29 @@ public abstract class AbstractButton extends JComponent
*/
int mnemonicIndex;
- /** Listener the button uses to receive ActionEvents from its model. */
+ /**
+ * Listener the button uses to receive ActionEvents from its model.
+ */
protected ActionListener actionListener;
- /** Listener the button uses to receive ItemEvents from its model. */
+ /**
+ * Listener the button uses to receive ItemEvents from its model.
+ */
protected ItemListener itemListener;
- /** Listener the button uses to receive ChangeEvents from its model. */
+ /**
+ * Listener the button uses to receive ChangeEvents from its model.
+ */
protected ChangeListener changeListener;
/**
+ * The event handler for ActionEvent, ItemEvent and ChangeEvent.
+ * This replaces the above three handlers and combines them
+ * into one for efficiency.
+ */
+ private EventHandler eventHandler;
+
+ /**
* The time in milliseconds in which clicks get coalesced into a single
* <code>ActionEvent</code>.
*/
@@ -768,22 +805,127 @@ public abstract class AbstractButton extends JComponent
return -1;
}
- public String getAtIndex(int value0, int value1)
- throws NotImplementedException
+ /**
+ * Returns the character, word or sentence at the specified index. The
+ * <code>part</code> parameter determines what is returned, the character,
+ * word or sentence after the index.
+ *
+ * @param part one of {@link AccessibleText#CHARACTER},
+ * {@link AccessibleText#WORD} or
+ * {@link AccessibleText#SENTENCE}, specifying what is returned
+ * @param index the index
+ *
+ * @return the character, word or sentence after <code>index</code>
+ */
+ public String getAtIndex(int part, int index)
{
- return null; // TODO
+ String result = "";
+ int startIndex = -1;
+ int endIndex = -1;
+ switch(part)
+ {
+ case AccessibleText.CHARACTER:
+ result = String.valueOf(text.charAt(index));
+ break;
+ case AccessibleText.WORD:
+ startIndex = text.lastIndexOf(' ', index);
+ endIndex = text.indexOf(' ', startIndex + 1);
+ if (endIndex == -1)
+ endIndex = startIndex + 1;
+ result = text.substring(startIndex + 1, endIndex);
+ break;
+ case AccessibleText.SENTENCE:
+ default:
+ startIndex = text.lastIndexOf('.', index);
+ endIndex = text.indexOf('.', startIndex + 1);
+ if (endIndex == -1)
+ endIndex = startIndex + 1;
+ result = text.substring(startIndex + 1, endIndex);
+ break;
+ }
+ return result;
}
- public String getAfterIndex(int value0, int value1)
- throws NotImplementedException
+ /**
+ * Returns the character, word or sentence after the specified index. The
+ * <code>part</code> parameter determines what is returned, the character,
+ * word or sentence after the index.
+ *
+ * @param part one of {@link AccessibleText#CHARACTER},
+ * {@link AccessibleText#WORD} or
+ * {@link AccessibleText#SENTENCE}, specifying what is returned
+ * @param index the index
+ *
+ * @return the character, word or sentence after <code>index</code>
+ */
+ public String getAfterIndex(int part, int index)
{
- return null; // TODO
+ String result = "";
+ int startIndex = -1;
+ int endIndex = -1;
+ switch(part)
+ {
+ case AccessibleText.CHARACTER:
+ result = String.valueOf(text.charAt(index + 1));
+ break;
+ case AccessibleText.WORD:
+ startIndex = text.indexOf(' ', index);
+ endIndex = text.indexOf(' ', startIndex + 1);
+ if (endIndex == -1)
+ endIndex = startIndex + 1;
+ result = text.substring(startIndex + 1, endIndex);
+ break;
+ case AccessibleText.SENTENCE:
+ default:
+ startIndex = text.indexOf('.', index);
+ endIndex = text.indexOf('.', startIndex + 1);
+ if (endIndex == -1)
+ endIndex = startIndex + 1;
+ result = text.substring(startIndex + 1, endIndex);
+ break;
+ }
+ return result;
}
- public String getBeforeIndex(int value0, int value1)
- throws NotImplementedException
+ /**
+ * Returns the character, word or sentence before the specified index. The
+ * <code>part</code> parameter determines what is returned, the character,
+ * word or sentence before the index.
+ *
+ * @param part one of {@link AccessibleText#CHARACTER},
+ * {@link AccessibleText#WORD} or
+ * {@link AccessibleText#SENTENCE}, specifying what is returned
+ * @param index the index
+ *
+ * @return the character, word or sentence before <code>index</code>
+ */
+ public String getBeforeIndex(int part, int index)
{
- return null; // TODO
+ String result = "";
+ int startIndex = -1;
+ int endIndex = -1;
+ switch(part)
+ {
+ case AccessibleText.CHARACTER:
+ result = String.valueOf(text.charAt(index - 1));
+ break;
+ case AccessibleText.WORD:
+ endIndex = text.lastIndexOf(' ', index);
+ if (endIndex == -1)
+ endIndex = 0;
+ startIndex = text.lastIndexOf(' ', endIndex - 1);
+ result = text.substring(startIndex + 1, endIndex);
+ break;
+ case AccessibleText.SENTENCE:
+ default:
+ endIndex = text.lastIndexOf('.', index);
+ if (endIndex == -1)
+ endIndex = 0;
+ startIndex = text.lastIndexOf('.', endIndex - 1);
+ result = text.substring(startIndex + 1, endIndex);
+ break;
+ }
+ return result;
}
/**
@@ -801,7 +943,14 @@ public abstract class AbstractButton extends JComponent
View view = (View) getClientProperty(BasicHTML.propertyKey);
if (view != null)
{
-
+ Document doc = view.getDocument();
+ if (doc instanceof StyledDocument)
+ {
+ StyledDocument sDoc = (StyledDocument) doc;
+ Element charEl = sDoc.getCharacterElement(i);
+ if (charEl != null)
+ atts = charEl.getAttributes();
+ }
}
return atts;
}
@@ -855,10 +1004,6 @@ public abstract class AbstractButton extends JComponent
*/
public AbstractButton()
{
- actionListener = createActionListener();
- changeListener = createChangeListener();
- itemListener = createItemListener();
-
horizontalAlignment = CENTER;
horizontalTextPosition = TRAILING;
verticalAlignment = CENTER;
@@ -872,7 +1017,10 @@ public abstract class AbstractButton extends JComponent
setDisplayedMnemonicIndex(-1);
setOpaque(true);
text = "";
- updateUI();
+ // testing on JRE1.5 shows that the iconTextGap default value is
+ // hard-coded here and the 'Button.iconTextGap' setting in the
+ // UI defaults is ignored, at least by the MetalLookAndFeel
+ iconTextGap = 4;
}
/**
@@ -900,15 +1048,21 @@ public abstract class AbstractButton extends JComponent
if (model != null)
{
model.removeActionListener(actionListener);
+ actionListener = null;
model.removeChangeListener(changeListener);
+ changeListener = null;
model.removeItemListener(itemListener);
+ itemListener = null;
}
ButtonModel old = model;
model = newModel;
if (model != null)
{
+ actionListener = createActionListener();
model.addActionListener(actionListener);
+ changeListener = createChangeListener();
model.addChangeListener(changeListener);
+ itemListener = createItemListener();
model.addItemListener(itemListener);
}
firePropertyChange(MODEL_CHANGED_PROPERTY, old, model);
@@ -927,6 +1081,8 @@ public abstract class AbstractButton extends JComponent
if (icon != null)
default_icon = icon;
+
+ updateUI();
}
/**
@@ -1923,13 +2079,7 @@ public abstract class AbstractButton extends JComponent
*/
protected ActionListener createActionListener()
{
- return new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- AbstractButton.this.fireActionPerformed(e);
- }
- };
+ return getEventHandler();
}
/**
@@ -1995,7 +2145,7 @@ public abstract class AbstractButton extends JComponent
*/
protected ChangeListener createChangeListener()
{
- return new ButtonChangeListener();
+ return getEventHandler();
}
/**
@@ -2021,13 +2171,7 @@ public abstract class AbstractButton extends JComponent
*/
protected ItemListener createItemListener()
{
- return new ItemListener()
- {
- public void itemStateChanged(ItemEvent e)
- {
- AbstractButton.this.fireItemStateChanged(e);
- }
- };
+ return getEventHandler();
}
/**
@@ -2490,4 +2634,17 @@ public abstract class AbstractButton extends JComponent
super.setUIProperty(propertyName, value);
}
}
+
+ /**
+ * Returns the combined event handler. The instance is created if
+ * necessary.
+ *
+ * @return the combined event handler
+ */
+ EventHandler getEventHandler()
+ {
+ if (eventHandler == null)
+ eventHandler = new EventHandler();
+ return eventHandler;
+ }
}
diff --git a/libjava/classpath/javax/swing/AbstractListModel.java b/libjava/classpath/javax/swing/AbstractListModel.java
index 4b89689ddda..7d4b2bb2a87 100644
--- a/libjava/classpath/javax/swing/AbstractListModel.java
+++ b/libjava/classpath/javax/swing/AbstractListModel.java
@@ -164,7 +164,7 @@ public abstract class AbstractListModel implements ListModel, Serializable
*
* @return The set of listeners of the specified type
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
return listenerList.getListeners(listenerType);
}
diff --git a/libjava/classpath/javax/swing/AbstractSpinnerModel.java b/libjava/classpath/javax/swing/AbstractSpinnerModel.java
index 089e2048da2..d247a33136a 100644
--- a/libjava/classpath/javax/swing/AbstractSpinnerModel.java
+++ b/libjava/classpath/javax/swing/AbstractSpinnerModel.java
@@ -1,5 +1,5 @@
/* AbstractSpinnerModel.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,6 +47,8 @@ import javax.swing.event.EventListenerList;
/**
* Provides standard implementations for some of the methods in
* {@link SpinnerModel}.
+ *
+ * @since 1.4
*
* @author Ka-Hing Cheung
*/
@@ -54,6 +56,7 @@ public abstract class AbstractSpinnerModel implements SpinnerModel
{
private ChangeEvent changeEvent = new ChangeEvent(this);
+ /** Stores the listeners registered with the model. */
protected EventListenerList listenerList = new EventListenerList();
/**
@@ -65,9 +68,10 @@ public abstract class AbstractSpinnerModel implements SpinnerModel
}
/**
- * Adds a <code>ChangeListener</code>.
+ * Registers a <code>ChangeListener</code> with the model so that it will
+ * receive {@link ChangeEvent} notifications when the model changes.
*
- * @param listener the listener to add
+ * @param listener the listener to add (<code>null</code> is ignored).
*/
public void addChangeListener(ChangeListener listener)
{
@@ -80,7 +84,7 @@ public abstract class AbstractSpinnerModel implements SpinnerModel
* @param c the type of listener
* @return the listeners that are of the specific type
*/
- public EventListener[] getListeners(Class c)
+ public <T extends EventListener> T[] getListeners(Class<T> c)
{
return listenerList.getListeners(c);
}
diff --git a/libjava/classpath/javax/swing/ButtonGroup.java b/libjava/classpath/javax/swing/ButtonGroup.java
index efa36b5f641..6a474f98d28 100644
--- a/libjava/classpath/javax/swing/ButtonGroup.java
+++ b/libjava/classpath/javax/swing/ButtonGroup.java
@@ -68,7 +68,7 @@ public class ButtonGroup implements Serializable
private static final long serialVersionUID = 4259076101881721375L;
/** Stores references to the buttons added to this button group. */
- protected Vector buttons = new Vector();
+ protected Vector<AbstractButton> buttons = new Vector<AbstractButton>();
/** The currently selected button model. */
ButtonModel sel;
@@ -129,7 +129,7 @@ public class ButtonGroup implements Serializable
*
* @return <code>Enumeration</code> over all added buttons
*/
- public Enumeration getElements()
+ public Enumeration<AbstractButton> getElements()
{
return buttons.elements();
}
@@ -183,6 +183,10 @@ public class ButtonGroup implements Serializable
if (old != null)
old.setSelected(false);
+
+ if (m != null)
+ sel.setSelected(true);
+
AbstractButton button = findButton(old);
if (button != null)
button.repaint();
diff --git a/libjava/classpath/javax/swing/DefaultBoundedRangeModel.java b/libjava/classpath/javax/swing/DefaultBoundedRangeModel.java
index efca148f449..786e4ee9204 100644
--- a/libjava/classpath/javax/swing/DefaultBoundedRangeModel.java
+++ b/libjava/classpath/javax/swing/DefaultBoundedRangeModel.java
@@ -424,7 +424,7 @@ public class DefaultBoundedRangeModel
*
* @since 1.3
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
return listenerList.getListeners(listenerType);
}
diff --git a/libjava/classpath/javax/swing/DefaultButtonModel.java b/libjava/classpath/javax/swing/DefaultButtonModel.java
index 020c904a4e9..c0eaea239b5 100644
--- a/libjava/classpath/javax/swing/DefaultButtonModel.java
+++ b/libjava/classpath/javax/swing/DefaultButtonModel.java
@@ -166,7 +166,7 @@ public class DefaultButtonModel implements ButtonModel, Serializable
*
* @return array of listeners
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
return listenerList.getListeners(listenerType);
}
@@ -425,7 +425,7 @@ public class DefaultButtonModel implements ButtonModel, Serializable
public void setRollover(boolean r)
{
// if this call does not represent a CHANGE in state, then return
- if ((r && isRollover()) || (!r && !isRollover()))
+ if (r == isRollover())
return;
// cannot set ROLLOVER property unless button is enabled
diff --git a/libjava/classpath/javax/swing/DefaultComboBoxModel.java b/libjava/classpath/javax/swing/DefaultComboBoxModel.java
index ef785f34dec..9b5bdb60d18 100644
--- a/libjava/classpath/javax/swing/DefaultComboBoxModel.java
+++ b/libjava/classpath/javax/swing/DefaultComboBoxModel.java
@@ -104,7 +104,7 @@ public class DefaultComboBoxModel extends AbstractListModel
*
* @throws NullPointerException if <code>vector</code> is <code>null</code>.
*/
- public DefaultComboBoxModel(Vector vector)
+ public DefaultComboBoxModel(Vector<?> vector)
{
this.list = vector;
if (getSize() > 0)
@@ -224,18 +224,26 @@ public class DefaultComboBoxModel extends AbstractListModel
*/
public void setSelectedItem(Object object)
{
- if (selectedItem == null)
- {
- if (object == null)
- return;
- }
- else
- {
- if (selectedItem.equals(object))
- return;
- }
+ // No item is selected and object is null, so no change required.
+ if (selectedItem == null && object == null)
+ return;
+
+ // object is already selected so no change required.
+ if (selectedItem != null && selectedItem.equals(object))
+ return;
+
+ // Simply return if object is not in the list.
+ if (object != null && getIndexOf(object) == -1)
+ return;
+
+ // Here we know that object is either an item in the list or null.
+
+ // Handle the three change cases: selectedItem is null, object is
+ // non-null; selectedItem is non-null, object is null;
+ // selectedItem is non-null, object is non-null and they're not
+ // equal.
selectedItem = object;
- fireContentsChanged(this, -1, -1);
+ fireContentsChanged(this, -1, -1);
}
/**
diff --git a/libjava/classpath/javax/swing/DefaultListModel.java b/libjava/classpath/javax/swing/DefaultListModel.java
index 2d02874a7e4..674864cce3a 100644
--- a/libjava/classpath/javax/swing/DefaultListModel.java
+++ b/libjava/classpath/javax/swing/DefaultListModel.java
@@ -309,7 +309,7 @@ public class DefaultListModel extends AbstractListModel
*
* @return A new enumeration which iterates over the list
*/
- public Enumeration elements()
+ public Enumeration<?> elements()
{
return elements.elements();
}
diff --git a/libjava/classpath/javax/swing/DefaultListSelectionModel.java b/libjava/classpath/javax/swing/DefaultListSelectionModel.java
index 482ce2cc224..d1e2da85fe8 100644
--- a/libjava/classpath/javax/swing/DefaultListSelectionModel.java
+++ b/libjava/classpath/javax/swing/DefaultListSelectionModel.java
@@ -815,7 +815,7 @@ public class DefaultListSelectionModel implements Cloneable,
* @see #getListSelectionListeners
* @since 1.3
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
return listenerList.getListeners(listenerType);
}
diff --git a/libjava/classpath/javax/swing/DefaultSingleSelectionModel.java b/libjava/classpath/javax/swing/DefaultSingleSelectionModel.java
index 1c6f473fdd3..3f79f0deed5 100644
--- a/libjava/classpath/javax/swing/DefaultSingleSelectionModel.java
+++ b/libjava/classpath/javax/swing/DefaultSingleSelectionModel.java
@@ -174,7 +174,7 @@ public class DefaultSingleSelectionModel
*
* @since 1.3
*/
- public EventListener[] getListeners(Class listenerClass)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerClass)
{
return listenerList.getListeners(listenerClass);
}
diff --git a/libjava/classpath/javax/swing/JButton.java b/libjava/classpath/javax/swing/JButton.java
index 787adb87cf1..878cfa68397 100644
--- a/libjava/classpath/javax/swing/JButton.java
+++ b/libjava/classpath/javax/swing/JButton.java
@@ -132,8 +132,8 @@ public class JButton extends AbstractButton
public JButton(String text, Icon icon)
{
super();
- init(text, icon);
setModel(new DefaultButtonModel());
+ init(text, icon);
defaultCapable = true;
}
diff --git a/libjava/classpath/javax/swing/JComboBox.java b/libjava/classpath/javax/swing/JComboBox.java
index c75a94bdc36..fa6941cf977 100644
--- a/libjava/classpath/javax/swing/JComboBox.java
+++ b/libjava/classpath/javax/swing/JComboBox.java
@@ -196,7 +196,7 @@ public class JComboBox extends JComponent implements ItemSelectable,
*
* @param itemVector vector containing list of items for this JComboBox.
*/
- public JComboBox(Vector itemVector)
+ public JComboBox(Vector<?> itemVector)
{
this(new DefaultComboBoxModel(itemVector));
diff --git a/libjava/classpath/javax/swing/JComponent.java b/libjava/classpath/javax/swing/JComponent.java
index fa83502946d..5ec5079223e 100644
--- a/libjava/classpath/javax/swing/JComponent.java
+++ b/libjava/classpath/javax/swing/JComponent.java
@@ -69,6 +69,7 @@ import java.beans.PropertyVetoException;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.EventListener;
import java.util.Hashtable;
import java.util.Locale;
@@ -503,27 +504,6 @@ public abstract class JComponent extends Container implements Serializable
}
}
- /**
- * An explicit value for the component's preferred size; if not set by a
- * user, this is calculated on the fly by delegating to the {@link
- * ComponentUI#getPreferredSize} method on the {@link #ui} property.
- */
- Dimension preferredSize;
-
- /**
- * An explicit value for the component's minimum size; if not set by a
- * user, this is calculated on the fly by delegating to the {@link
- * ComponentUI#getMinimumSize} method on the {@link #ui} property.
- */
- Dimension minimumSize;
-
- /**
- * An explicit value for the component's maximum size; if not set by a
- * user, this is calculated on the fly by delegating to the {@link
- * ComponentUI#getMaximumSize} method on the {@link #ui} property.
- */
- Dimension maximumSize;
-
/**
* A value between 0.0 and 1.0 indicating the preferred horizontal
* alignment of the component, relative to its siblings. The values
@@ -561,14 +541,6 @@ public abstract class JComponent extends Container implements Serializable
*/
Border border;
- /**
- * The text to show in the tooltip associated with this component.
- *
- * @see #setToolTipText
- * @see #getToolTipText()
- */
- String toolTipText;
-
/**
* The popup menu for the component.
*
@@ -687,7 +659,7 @@ public abstract class JComponent extends Container implements Serializable
* Indicates whether we are calling paintDoubleBuffered() from
* paintImmadiately (RepaintManager) or from paint() (AWT refresh).
*/
- static private boolean isRepainting = false;
+ static boolean isRepainting = false;
/**
* Listeners for events other than {@link PropertyChangeEvent} are
@@ -783,6 +755,13 @@ public abstract class JComponent extends Container implements Serializable
*/
public static final int WHEN_IN_FOCUSED_WINDOW = 2;
+
+ /**
+ * Used to optimize painting. This is set in paintImmediately2() to specify
+ * the exact component path to be painted by paintChildren.
+ */
+ Component paintChild;
+
/**
* Indicates if the opaque property has been set by a client program or by
* the UI.
@@ -868,7 +847,12 @@ public abstract class JComponent extends Container implements Serializable
t.put(key, value);
else
t.remove(key);
- firePropertyChange(key.toString(), old, value);
+
+ // When both old and new value are null, no event is fired. This is
+ // different from what firePropertyChange() normally does, so we add this
+ // check here.
+ if (old != null || value != null)
+ firePropertyChange(key.toString(), old, value);
}
/**
@@ -943,12 +927,12 @@ public abstract class JComponent extends Container implements Serializable
*
* @since 1.3
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
if (listenerType == PropertyChangeListener.class)
- return getPropertyChangeListeners();
+ return (T[]) getPropertyChangeListeners();
else if (listenerType == VetoableChangeListener.class)
- return getVetoableChangeListeners();
+ return (T[]) getVetoableChangeListeners();
else
return listenerList.getListeners(listenerType);
}
@@ -1270,37 +1254,38 @@ public abstract class JComponent extends Container implements Serializable
}
/**
- * Get the component's maximum size. If the {@link #maximumSize} property
- * has been explicitly set, it is returned. If the {@link #maximumSize}
+ * Get the component's maximum size. If the <code>maximumSize</code> property
+ * has been explicitly set, it is returned. If the <code>maximumSize</code>
* property has not been set but the {@link #ui} property has been, the
* result of {@link ComponentUI#getMaximumSize} is returned. If neither
* property has been set, the result of {@link Container#getMaximumSize}
* is returned.
*
- * @return The maximum size of the component
+ * @return the maximum size of the component
*
- * @see #maximumSize
- * @see #setMaximumSize
+ * @see Component#setMaximumSize
+ * @see Component#getMaximumSize()
+ * @see Component#isMaximumSizeSet()
+ * @see ComponentUI#getMaximumSize(JComponent)
*/
public Dimension getMaximumSize()
{
- if (maximumSize != null)
- return maximumSize;
-
- if (ui != null)
+ Dimension size = null;
+ if (isMaximumSizeSet())
+ size = super.getMaximumSize();
+ else
{
- Dimension s = ui.getMaximumSize(this);
- if (s != null)
- return s;
+ if (ui != null)
+ size = ui.getMaximumSize(this);
+ if (size == null)
+ size = super.getMaximumSize();
}
-
- Dimension p = super.getMaximumSize();
- return p;
+ return size;
}
/**
- * Get the component's minimum size. If the {@link #minimumSize} property
- * has been explicitly set, it is returned. If the {@link #minimumSize}
+ * Get the component's minimum size. If the <code>minimumSize</code> property
+ * has been explicitly set, it is returned. If the <code>minimumSize</code>
* property has not been set but the {@link #ui} property has been, the
* result of {@link ComponentUI#getMinimumSize} is returned. If neither
* property has been set, the result of {@link Container#getMinimumSize}
@@ -1308,97 +1293,57 @@ public abstract class JComponent extends Container implements Serializable
*
* @return The minimum size of the component
*
- * @see #minimumSize
- * @see #setMinimumSize
+ * @see Component#setMinimumSize
+ * @see Component#getMinimumSize()
+ * @see Component#isMinimumSizeSet()
+ * @see ComponentUI#getMinimumSize(JComponent)
*/
public Dimension getMinimumSize()
{
- if (minimumSize != null)
- return minimumSize;
-
- if (ui != null)
+ Dimension size = null;
+ if (isMinimumSizeSet())
+ size = super.getMinimumSize();
+ else
{
- Dimension s = ui.getMinimumSize(this);
- if (s != null)
- return s;
+ if (ui != null)
+ size = ui.getMinimumSize(this);
+ if (size == null)
+ size = super.getMinimumSize();
}
-
- Dimension p = super.getMinimumSize();
- return p;
+ return size;
}
/**
- * Get the component's preferred size. If the {@link #preferredSize}
- * property has been explicitly set, it is returned. If the {@link
- * #preferredSize} property has not been set but the {@link #ui} property
- * has been, the result of {@link ComponentUI#getPreferredSize} is
+ * Get the component's preferred size. If the <code>preferredSize</code>
+ * property has been explicitly set, it is returned. If the
+ * <code>preferredSize</code> property has not been set but the {@link #ui}
+ * property has been, the result of {@link ComponentUI#getPreferredSize} is
* returned. If neither property has been set, the result of {@link
* Container#getPreferredSize} is returned.
*
* @return The preferred size of the component
*
- * @see #preferredSize
- * @see #setPreferredSize
+ * @see Component#setPreferredSize
+ * @see Component#getPreferredSize()
+ * @see Component#isPreferredSizeSet()
+ * @see ComponentUI#getPreferredSize(JComponent)
*/
public Dimension getPreferredSize()
{
- Dimension prefSize = null;
- if (preferredSize != null)
- prefSize = new Dimension(preferredSize);
-
- else if (ui != null)
+ Dimension size = null;
+ if (isPreferredSizeSet())
+ size = super.getPreferredSize();
+ else
{
- Dimension s = ui.getPreferredSize(this);
- if (s != null)
- prefSize = s;
+ if (ui != null)
+ size = ui.getPreferredSize(this);
+ if (size == null)
+ size = super.getPreferredSize();
}
-
- if (prefSize == null)
- prefSize = super.getPreferredSize();
-
- return prefSize;
+ return size;
}
/**
- * Checks if a maximum size was explicitely set on the component.
- *
- * @return <code>true</code> if a maximum size was set,
- * <code>false</code> otherwise
- *
- * @since 1.3
- */
- public boolean isMaximumSizeSet()
- {
- return maximumSize != null;
- }
-
- /**
- * Checks if a minimum size was explicitely set on the component.
- *
- * @return <code>true</code> if a minimum size was set,
- * <code>false</code> otherwise
- *
- * @since 1.3
- */
- public boolean isMinimumSizeSet()
- {
- return minimumSize != null;
- }
-
- /**
- * Checks if a preferred size was explicitely set on the component.
- *
- * @return <code>true</code> if a preferred size was set,
- * <code>false</code> otherwise
- *
- * @since 1.3
- */
- public boolean isPreferredSizeSet()
- {
- return preferredSize != null;
- }
-
- /**
* Return the value of the <code>nextFocusableComponent</code> property.
*
* @return The current value of the property, or <code>null</code>
@@ -1491,14 +1436,12 @@ public abstract class JComponent extends Container implements Serializable
{
JToolTip toolTip = new JToolTip();
toolTip.setComponent(this);
- toolTip.setTipText(toolTipText);
-
return toolTip;
}
/**
- * Return the location at which the {@link #toolTipText} property should be
- * displayed, when triggered by a particular mouse event.
+ * Return the location at which the <code>toolTipText</code> property should
+ * be displayed, when triggered by a particular mouse event.
*
* @param event The event the tooltip is being presented in response to
*
@@ -1511,53 +1454,56 @@ public abstract class JComponent extends Container implements Serializable
}
/**
- * Set the value of the {@link #toolTipText} property.
+ * Set the tooltip text for this component. If a non-<code>null</code>
+ * value is set, this component is registered in the
+ * <code>ToolTipManager</code> in order to turn on tooltips for this
+ * component. If a <code>null</code> value is set, tooltips are turne off
+ * for this component.
*
- * @param text The new property value
+ * @param text the tooltip text for this component
*
* @see #getToolTipText()
+ * @see #getToolTipText(MouseEvent)
*/
public void setToolTipText(String text)
{
+ String old = getToolTipText();
+ putClientProperty(TOOL_TIP_TEXT_KEY, text);
+ ToolTipManager ttm = ToolTipManager.sharedInstance();
if (text == null)
- {
- ToolTipManager.sharedInstance().unregisterComponent(this);
- toolTipText = null;
- return;
- }
-
- // XXX: The tip text doesn't get updated unless you set it to null
- // and then to something not-null. This is consistent with the behaviour
- // of Sun's ToolTipManager.
-
- String oldText = toolTipText;
- toolTipText = text;
-
- if (oldText == null)
- ToolTipManager.sharedInstance().registerComponent(this);
+ ttm.unregisterComponent(this);
+ else if (old == null)
+ ttm.registerComponent(this);
}
/**
- * Get the value of the {@link #toolTipText} property.
+ * Returns the current tooltip text for this component, or <code>null</code>
+ * if none has been set.
*
- * @return The current property value
+ * @return the current tooltip text for this component, or <code>null</code>
+ * if none has been set
*
* @see #setToolTipText
+ * @see #getToolTipText(MouseEvent)
*/
public String getToolTipText()
{
- return toolTipText;
+ return (String) getClientProperty(TOOL_TIP_TEXT_KEY);
}
/**
- * Get the value of the {@link #toolTipText} property, in response to a
- * particular mouse event.
+ * Returns the tooltip text for this component for a particular mouse
+ * event. This can be used to support context sensitive tooltips that can
+ * change with the mouse location. By default this returns the static
+ * tooltip text returned by {@link #getToolTipText()}.
*
- * @param event The mouse event which triggered the tooltip
+ * @param event the mouse event which triggered the tooltip
*
- * @return The current property value
+ * @return the tooltip text for this component for a particular mouse
+ * event
*
* @see #setToolTipText
+ * @see #getToolTipText()
*/
public String getToolTipText(MouseEvent event)
{
@@ -1850,7 +1796,7 @@ public abstract class JComponent extends Container implements Serializable
&& rm.isDoubleBufferingEnabled())
{
Rectangle clip = g.getClipBounds();
- paintDoubleBuffered(clip);
+ paintDoubleBuffered(clip.x, clip.y, clip.width, clip.height);
}
else
{
@@ -1865,8 +1811,22 @@ public abstract class JComponent extends Container implements Serializable
dragBuffer = null;
}
- if (g.getClip() == null)
- g.setClip(0, 0, getWidth(), getHeight());
+ Rectangle clip = g.getClipBounds();
+ int clipX, clipY, clipW, clipH;
+ if (clip == null)
+ {
+ clipX = 0;
+ clipY = 0;
+ clipW = getWidth();
+ clipH = getHeight();
+ }
+ else
+ {
+ clipX = clip.x;
+ clipY = clip.y;
+ clipW = clip.width;
+ clipH = clip.height;
+ }
if (dragBuffer != null && dragBufferInitialized)
{
g.drawImage(dragBuffer, 0, 0, this);
@@ -1874,14 +1834,51 @@ public abstract class JComponent extends Container implements Serializable
else
{
Graphics g2 = getComponentGraphics(g);
- paintComponent(g2);
- paintBorder(g2);
+ if (! isOccupiedByChild(clipX, clipY, clipW, clipH))
+ {
+ paintComponent(g2);
+ paintBorder(g2);
+ }
paintChildren(g2);
}
}
}
/**
+ * Determines if a region of this component is completely occupied by
+ * an opaque child component, in which case we don't need to bother
+ * painting this component at all.
+ *
+ * @param x the area, x coordinate
+ * @param y the area, y coordinate
+ * @param w the area, width
+ * @param h the area, height
+ *
+ * @return <code>true</code> if the specified area is completely covered
+ * by a child component, <code>false</code> otherwise
+ */
+ private boolean isOccupiedByChild(int x, int y, int w, int h)
+ {
+ boolean occupied = false;
+ int count = getComponentCount();
+ for (int i = 0; i < count; i++)
+ {
+ Component child = getComponent(i);
+ int cx = child.getX();
+ int cy = child.getY();
+ int cw = child.getWidth();
+ int ch = child.getHeight();
+ if (child.isVisible() && x >= cx && x + w <= cx + cw && y >= cy
+ && y + h <= cy + ch)
+ {
+ occupied = child.isOpaque();
+ break;
+ }
+ }
+ return occupied;
+ }
+
+ /**
* Initializes the drag buffer by creating a new image and painting this
* component into it.
*/
@@ -1940,7 +1937,14 @@ public abstract class JComponent extends Container implements Serializable
// Need to lock the tree to avoid problems with AWT and concurrency.
synchronized (getTreeLock())
{
- for (int i = getComponentCount() - 1; i >= 0; i--)
+ // Fast forward to the child to paint, if set by
+ // paintImmediately2()
+ int i = getComponentCount() - 1;
+ if (paintChild != null && paintChild.isOpaque())
+ {
+ for (; i >= 0 && getComponent(i) != paintChild; i--);
+ }
+ for (; i >= 0; i--)
{
Component child = getComponent(i);
if (child != null && child.isLightweight()
@@ -1958,7 +1962,8 @@ public abstract class JComponent extends Container implements Serializable
Rectangle clip = g.getClipBounds(); // A copy.
SwingUtilities.computeIntersection(cx, cy, cw, ch,
clip);
- if (isCompletelyObscured(i, clip))
+ if (isCompletelyObscured(i, clip.x, clip.y,
+ clip.width, clip.height))
continue; // Continues the for-loop.
}
Graphics cg = g.create(cx, cy, cw, ch);
@@ -1984,12 +1989,15 @@ public abstract class JComponent extends Container implements Serializable
* of its siblings.
*
* @param index the index of the child component
- * @param rect the region to check
+ * @param x the region to check, x coordinate
+ * @param y the region to check, y coordinate
+ * @param w the region to check, width
+ * @param h the region to check, height
*
* @return <code>true</code> if the region is completely obscured by a
* sibling, <code>false</code> otherwise
*/
- private boolean isCompletelyObscured(int index, Rectangle rect)
+ private boolean isCompletelyObscured(int index, int x, int y, int w, int h)
{
boolean obscured = false;
for (int i = index - 1; i >= 0 && obscured == false; i--)
@@ -1998,10 +2006,10 @@ public abstract class JComponent extends Container implements Serializable
if (sib.isVisible())
{
Rectangle sibRect = sib.getBounds(rectCache);
- if (sib.isOpaque() && rect.x >= sibRect.x
- && (rect.x + rect.width) <= (sibRect.x + sibRect.width)
- && rect.y >= sibRect.y
- && (rect.y + rect.height) <= (sibRect.y + sibRect.height))
+ if (sib.isOpaque() && x >= sibRect.x
+ && (x + w) <= (sibRect.x + sibRect.width)
+ && y >= sibRect.y
+ && (y + h) <= (sibRect.y + sibRect.height))
{
obscured = true;
}
@@ -2011,6 +2019,39 @@ public abstract class JComponent extends Container implements Serializable
}
/**
+ * Checks if a component/rectangle is partially obscured by one of its
+ * siblings.
+ * Note that this doesn't check for completely obscured, this is
+ * done by isCompletelyObscured() and should probably also be checked.
+ *
+ * @param i the component index from which to start searching
+ * @param x the x coordinate of the rectangle to check
+ * @param y the y coordinate of the rectangle to check
+ * @param w the width of the rectangle to check
+ * @param h the height of the rectangle to check
+ *
+ * @return <code>true</code> if the rectangle is partially obscured
+ */
+ private boolean isPartiallyObscured(int i, int x, int y, int w, int h)
+ {
+ boolean obscured = false;
+ for (int j = i - 1; j >= 0 && ! obscured; j--)
+ {
+ Component sibl = getComponent(j);
+ if (sibl.isVisible())
+ {
+ Rectangle rect = sibl.getBounds(rectCache);
+ if (!(x + w <= rect.x)
+ || (y + h <= rect.y)
+ || (x >= rect.x + rect.width)
+ || (y >= rect.y + rect.height))
+ obscured = true;
+ }
+ }
+ return obscured;
+ }
+
+ /**
* Paint the component's body. This usually means calling {@link
* ComponentUI#update} on the {@link #ui} property of the component, if
* it is non-<code>null</code>. You may override this if you wish to
@@ -2050,7 +2091,26 @@ public abstract class JComponent extends Container implements Serializable
*/
public void paintImmediately(int x, int y, int w, int h)
{
- paintImmediately(new Rectangle(x, y, w, h));
+ // Find opaque parent and call paintImmediately2() on it.
+ if (isShowing())
+ {
+ Component c = this;
+ Component p;
+ while (c != null && ! c.isOpaque())
+ {
+ p = c.getParent();
+ if (p != null)
+ {
+ x += c.getX();
+ y += c.getY();
+ c = p;
+ }
+ }
+ if (c instanceof JComponent)
+ ((JComponent) c).paintImmediately2(x, y, w, h);
+ else
+ c.repaint(x, y, w, h);
+ }
}
/**
@@ -2073,60 +2133,202 @@ public abstract class JComponent extends Container implements Serializable
*/
public void paintImmediately(Rectangle r)
{
- // Try to find a root pane for this component.
- //Component root = findPaintRoot(r);
- Component root = findPaintRoot(r);
- // If no paint root is found, then this component is completely overlapped
- // by another component and we don't need repainting.
- if (root == null|| !root.isShowing())
- return;
- SwingUtilities.convertRectangleToAncestor(this, r, root);
- if (root instanceof JComponent)
- ((JComponent) root).paintImmediately2(r);
- else
- root.repaint(r.x, r.y, r.width, r.height);
+ paintImmediately(r.x, r.y, r.width, r.height);
}
/**
* Performs the actual work of paintImmediatly on the repaint root.
*
- * @param r the area to be repainted
+ * @param x the area to be repainted, X coordinate
+ * @param y the area to be repainted, Y coordinate
*/
- void paintImmediately2(Rectangle r)
+ void paintImmediately2(int x, int y, int w, int h)
{
- isRepainting = true;
+ // Optimization for components that are always painted on top.
+ boolean onTop = onTop() && isOpaque();
+
+ // Fetch the RepaintManager.
RepaintManager rm = RepaintManager.currentManager(this);
- if (rm.isDoubleBufferingEnabled() && isPaintingDoubleBuffered())
- paintDoubleBuffered(r);
- else
- paintSimple(r);
- isRepainting = false;
+
+ // The painting clip;
+ int paintX = x;
+ int paintY = y;
+ int paintW = w;
+ int paintH = h;
+
+ // If we should paint buffered or not.
+ boolean haveBuffer = false;
+
+ // The component that is finally triggered for painting.
+ JComponent paintRoot = this;
+
+ // Stores the component and all its parents. This will be used to limit
+ // the actually painted components in paintChildren by setting
+ // the field paintChild.
+ int pIndex = -1;
+ int pCount = 0;
+ ArrayList components = new ArrayList();
+
+ // Offset to subtract from the paintRoot rectangle when painting.
+ int offsX = 0;
+ int offsY = 0;
+
+ // The current component and its child.
+ Component child;
+ Container c;
+
+ // Find appropriate paint root.
+ for (c = this, child = null;
+ c != null && ! (c instanceof Window) && ! (c instanceof Applet);
+ child = c, c = c.getParent())
+ {
+ JComponent jc = c instanceof JComponent ? (JComponent) c : null;
+ components.add(c);
+ if (! onTop && jc != null && ! jc.isOptimizedDrawingEnabled())
+ {
+ // Indicates whether we reset the paint root to be the current
+ // component.
+ boolean updatePaintRoot = false;
+
+ // Check obscured state of the child.
+ // Generally, we have 3 cases here:
+ // 1. Not obscured. No need to paint from the parent.
+ // 2. Partially obscured. Paint from the parent.
+ // 3. Completely obscured. No need to paint anything.
+ if (c != this)
+ {
+ if (jc.isPaintRoot())
+ updatePaintRoot = true;
+ else
+ {
+ int count = c.getComponentCount();
+ int i = 0;
+ for (; i < count && c.getComponent(i) != child; i++);
+
+ if (jc.isCompletelyObscured(i, paintX, paintY, paintW,
+ paintH))
+ return; // No need to paint anything.
+ else if (jc.isPartiallyObscured(i, paintX, paintY, paintW,
+ paintH))
+ updatePaintRoot = true;
+
+ }
+ }
+ if (updatePaintRoot)
+ {
+ // Paint from parent.
+ paintRoot = jc;
+ pIndex = pCount;
+ offsX = 0;
+ offsY = 0;
+ haveBuffer = false;
+ }
+ }
+ pCount++;
+ // Check if component is double buffered.
+ if (rm.isDoubleBufferingEnabled() && jc != null
+ && jc.isDoubleBuffered())
+ {
+ haveBuffer = true;
+ }
+
+ // Clip the paint region with the parent.
+ if (! onTop)
+ {
+ paintX = Math.max(0, paintX);
+ paintY = Math.max(0, paintY);
+ paintW = Math.min(c.getWidth(), paintW + paintX) - paintX;
+ paintH = Math.min(c.getHeight(), paintH + paintY) - paintY;
+ int dx = c.getX();
+ int dy = c.getY();
+ paintX += dx;
+ paintY += dy;
+ offsX += dx;
+ offsY += dy;
+ }
+ }
+ if (c != null && c.getPeer() != null && paintW > 0 && paintH > 0)
+ {
+ isRepainting = true;
+ paintX -= offsX;
+ paintY -= offsY;
+
+ // Set the painting path so that paintChildren paints only what we
+ // want.
+ if (paintRoot != this)
+ {
+ for (int i = pIndex; i > 0; i--)
+ {
+ Component paintParent = (Component) components.get(i);
+ if (paintParent instanceof JComponent)
+ ((JComponent) paintParent).paintChild =
+ (Component) components.get(i - 1);
+ }
+ }
+
+ // Actually trigger painting.
+ if (haveBuffer)
+ paintRoot.paintDoubleBuffered(paintX, paintY, paintW, paintH);
+ else
+ {
+ Graphics g = paintRoot.getGraphics();
+ try
+ {
+ g.setClip(paintX, paintY, paintW, paintH);
+ paintRoot.paint(g);
+ }
+ finally
+ {
+ g.dispose();
+ }
+ }
+
+ // Reset the painting path.
+ if (paintRoot != this)
+ {
+ for (int i = pIndex; i > 0; i--)
+ {
+ Component paintParent = (Component) components.get(i);
+ if (paintParent instanceof JComponent)
+ ((JComponent) paintParent).paintChild = null;
+ }
+ }
+
+ isRepainting = false;
+ }
}
/**
- * Returns true if we must paint double buffered, that is, when this
- * component or any of it's ancestors are double buffered.
+ * Returns <code>true</code> if the component is guaranteed to be painted
+ * on top of others. This returns false by default and is overridden by
+ * components like JMenuItem, JPopupMenu and JToolTip to return true for
+ * added efficiency.
*
- * @return true if we must paint double buffered, that is, when this
- * component or any of it's ancestors are double buffered
+ * @return <code>true</code> if the component is guaranteed to be painted
+ * on top of others
*/
- private boolean isPaintingDoubleBuffered()
+ boolean onTop()
{
- boolean doubleBuffered = isDoubleBuffered();
- Component parent = getParent();
- while (! doubleBuffered && parent != null)
- {
- doubleBuffered = parent instanceof JComponent
- && ((JComponent) parent).isDoubleBuffered();
- parent = parent.getParent();
- }
- return doubleBuffered;
+ return false;
+ }
+
+ /**
+ * This returns true when a component needs to force itself as a paint
+ * origin. This is used for example in JViewport to make sure that it
+ * gets to update its backbuffer.
+ *
+ * @return true when a component needs to force itself as a paint
+ * origin
+ */
+ boolean isPaintRoot()
+ {
+ return false;
}
/**
* Performs double buffered repainting.
*/
- private void paintDoubleBuffered(Rectangle r)
+ private void paintDoubleBuffered(int x, int y, int w, int h)
{
RepaintManager rm = RepaintManager.currentManager(this);
@@ -2143,7 +2345,7 @@ public abstract class JComponent extends Container implements Serializable
//Rectangle targetClip = SwingUtilities.convertRectangle(this, r, root);
Graphics g2 = buffer.getGraphics();
clipAndTranslateGraphics(root, this, g2);
- g2.clipRect(r.x, r.y, r.width, r.height);
+ g2.clipRect(x, y, w, h);
g2 = getComponentGraphics(g2);
paintingDoubleBuffered = true;
try
@@ -2164,7 +2366,7 @@ public abstract class JComponent extends Container implements Serializable
}
// Paint the buffer contents on screen.
- rm.commitBuffer(this, r);
+ rm.commitBuffer(this, x, y, w, h);
}
/**
@@ -2577,7 +2779,7 @@ public abstract class JComponent extends Container implements Serializable
KeyEvent e,
int condition,
boolean pressed)
- {
+ {
if (isEnabled())
{
Action act = null;
@@ -2591,7 +2793,7 @@ public abstract class JComponent extends Container implements Serializable
if (cmd instanceof ActionListenerProxy)
act = (Action) cmd;
else
- act = (Action) getActionMap().get(cmd);
+ act = getActionMap().get(cmd);
}
}
if (act != null && act.isEnabled())
@@ -2741,9 +2943,25 @@ public abstract class JComponent extends Container implements Serializable
*/
public void scrollRectToVisible(Rectangle r)
{
- Component p = getParent();
- if (p instanceof JComponent)
- ((JComponent) p).scrollRectToVisible(r);
+ // Search nearest JComponent.
+ int xOffs = getX();
+ int yOffs = getY();
+ Component p;
+ for (p = getParent(); p != null && ! (p instanceof JComponent);
+ p = p.getParent())
+ {
+ xOffs += p.getX();
+ yOffs += p.getY();
+ }
+ if (p != null)
+ {
+ r.x += xOffs;
+ r.y += yOffs;
+ JComponent jParent = (JComponent) p;
+ jParent.scrollRectToVisible(r);
+ r.x -= xOffs;
+ r.y -= yOffs;
+ }
}
/**
@@ -2862,57 +3080,6 @@ public abstract class JComponent extends Container implements Serializable
}
/**
- * Set the value of the {@link #maximumSize} property. The passed value is
- * copied, the later direct changes on the argument have no effect on the
- * property value.
- *
- * @param max The new value of the property
- */
- public void setMaximumSize(Dimension max)
- {
- Dimension oldMaximumSize = maximumSize;
- if (max != null)
- maximumSize = new Dimension(max);
- else
- maximumSize = null;
- firePropertyChange("maximumSize", oldMaximumSize, maximumSize);
- }
-
- /**
- * Set the value of the {@link #minimumSize} property. The passed value is
- * copied, the later direct changes on the argument have no effect on the
- * property value.
- *
- * @param min The new value of the property
- */
- public void setMinimumSize(Dimension min)
- {
- Dimension oldMinimumSize = minimumSize;
- if (min != null)
- minimumSize = new Dimension(min);
- else
- minimumSize = null;
- firePropertyChange("minimumSize", oldMinimumSize, minimumSize);
- }
-
- /**
- * Set the value of the {@link #preferredSize} property. The passed value is
- * copied, the later direct changes on the argument have no effect on the
- * property value.
- *
- * @param pref The new value of the property
- */
- public void setPreferredSize(Dimension pref)
- {
- Dimension oldPreferredSize = preferredSize;
- if (pref != null)
- preferredSize = new Dimension(pref);
- else
- preferredSize = null;
- firePropertyChange("preferredSize", oldPreferredSize, preferredSize);
- }
-
- /**
* Set the specified component to be the next component in the
* focus cycle, overriding the {@link FocusTraversalPolicy} for
* this component.
@@ -3571,130 +3738,6 @@ public abstract class JComponent extends Container implements Serializable
jc.fireAncestorEvent(ancestor, id);
}
}
-
- /**
- * Finds a suitable paint root for painting this component. This method first
- * checks if this component is overlapped using
- * {@link #findOverlapFreeParent(Rectangle)}. The returned paint root is then
- * feeded to {@link #findOpaqueParent(Component)} to find the nearest opaque
- * component for this paint root. If no paint is necessary, then we return
- * <code>null</code>.
- *
- * @param c the clip of this component
- *
- * @return the paint root or <code>null</code> if no painting is necessary
- */
- private Component findPaintRoot(Rectangle c)
- {
- Component p = findOverlapFreeParent(c);
- if (p == null)
- return null;
- Component root = findOpaqueParent(p);
- return root;
- }
-
- /**
- * Scans the containment hierarchy upwards for components that overlap the
- * this component in the specified clip. This method returns
- * <code>this</code>, if no component overlaps this component. It returns
- * <code>null</code> if another component completely covers this component
- * in the specified clip (no repaint necessary). If another component partly
- * overlaps this component in the specified clip, then the parent of this
- * component is returned (this is the component that must be used as repaint
- * root). For efficient lookup, the method
- * {@link #isOptimizedDrawingEnabled()} is used.
- *
- * @param clip the clip of this component
- *
- * @return the paint root, or <code>null</code> if no paint is necessary
- */
- private Component findOverlapFreeParent(Rectangle clip)
- {
- Rectangle currentClip = clip;
- Component found = this;
- Container parent = this;
-
- while (parent != null && !(parent instanceof Window))
- {
- Container newParent = parent.getParent();
- if (newParent == null || newParent instanceof Window)
- break;
- // If the parent is optimizedDrawingEnabled, then its children are
- // tiled and cannot have an overlapping child. Go directly to next
- // parent.
- if ((newParent instanceof JComponent
- && ((JComponent) newParent).isOptimizedDrawingEnabled()))
-
- {
- parent = newParent;
- continue;
- }
-
- // If the parent is not optimizedDrawingEnabled, we must check if the
- // parent or some neighbor overlaps the current clip.
-
- // This is the current clip converted to the parent's coordinate
- // system. TODO: We can do this more efficiently by succesively
- // cumulating the parent-child translations.
- Rectangle target = SwingUtilities.convertRectangle(found,
- currentClip,
- newParent);
-
- // We have an overlap if either:
- // - The new parent itself doesn't completely cover the clip
- // (this can be the case with viewports).
- // - If some higher-level (than the current) children of the new parent
- // intersect the target rectangle.
- Rectangle parentRect = SwingUtilities.getLocalBounds(newParent);
- boolean haveOverlap =
- ! SwingUtilities.isRectangleContainingRectangle(parentRect, target);
- if (! haveOverlap)
- {
- Component child;
- for (int i = 0; (child = newParent.getComponent(i)) != parent && !haveOverlap; i++)
- {
- Rectangle childRect = child.getBounds();
- haveOverlap = target.intersects(childRect);
- }
- }
- if (haveOverlap)
- {
- found = newParent;
- currentClip = target;
- }
- parent = newParent;
- }
- //System.err.println("overlapfree parent: " + found);
- return found;
- }
-
- /**
- * Finds the nearest component to <code>c</code> (upwards in the containment
- * hierarchy), that is opaque. If <code>c</code> itself is opaque,
- * this returns <code>c</code> itself.
- *
- * @param c the start component for the search
- * @return the nearest component to <code>c</code> (upwards in the containment
- * hierarchy), that is opaque; If <code>c</code> itself is opaque,
- * this returns <code>c</code> itself
- */
- private Component findOpaqueParent(Component c)
- {
- Component found = c;
- while (true)
- {
- if ((found instanceof JComponent) && ((JComponent) found).isOpaque())
- break;
- else if (!(found instanceof JComponent) && !found.isLightweight())
- break;
- Container p = found.getParent();
- if (p == null)
- break;
- else
- found = p;
- }
- return found;
- }
/**
* This is the method that gets called when the WHEN_IN_FOCUSED_WINDOW map
diff --git a/libjava/classpath/javax/swing/JDialog.java b/libjava/classpath/javax/swing/JDialog.java
index 08dada2fd81..495c9c791d7 100644
--- a/libjava/classpath/javax/swing/JDialog.java
+++ b/libjava/classpath/javax/swing/JDialog.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.swing;
+import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dialog;
@@ -97,7 +98,7 @@ public class JDialog extends Dialog implements Accessible, WindowConstants,
protected boolean rootPaneCheckingEnabled = false;
/** The default action taken when closed. */
- private int close_action = HIDE_ON_CLOSE;
+ private int closeAction = HIDE_ON_CLOSE;
/** Whether JDialogs are decorated by the Look and Feel. */
private static boolean decorated;
@@ -245,6 +246,10 @@ public class JDialog extends Dialog implements Accessible, WindowConstants,
*/
protected void dialogInit()
{
+ // We need to explicitly enable events here so that our processKeyEvent()
+ // and processWindowEvent() gets called.
+ enableEvents(AWTEvent.WINDOW_EVENT_MASK);
+
// FIXME: Do a check on GraphicsEnvironment.isHeadless()
setLocale(JComponent.getDefaultLocale());
getRootPane(); // Will do set/create.
@@ -507,37 +512,23 @@ public class JDialog extends Dialog implements Accessible, WindowConstants,
*/
protected void processWindowEvent(WindowEvent e)
{
- // System.out.println("PROCESS_WIN_EV-1: " + e);
super.processWindowEvent(e);
- // System.out.println("PROCESS_WIN_EV-2: " + e);
- switch (e.getID())
+ if (e.getID() == WindowEvent.WINDOW_CLOSING)
{
- case WindowEvent.WINDOW_CLOSING:
- {
- switch (getDefaultCloseOperation())
- {
- case DISPOSE_ON_CLOSE:
- {
- dispose();
- break;
- }
- case HIDE_ON_CLOSE:
- {
- setVisible(false);
- break;
- }
- case DO_NOTHING_ON_CLOSE:
- break;
- }
- break;
- }
- case WindowEvent.WINDOW_CLOSED:
- case WindowEvent.WINDOW_OPENED:
- case WindowEvent.WINDOW_ICONIFIED:
- case WindowEvent.WINDOW_DEICONIFIED:
- case WindowEvent.WINDOW_ACTIVATED:
- case WindowEvent.WINDOW_DEACTIVATED:
- break;
+ switch (closeAction)
+ {
+ case EXIT_ON_CLOSE:
+ System.exit(0);
+ break;
+ case DISPOSE_ON_CLOSE:
+ dispose();
+ break;
+ case HIDE_ON_CLOSE:
+ setVisible(false);
+ break;
+ case DO_NOTHING_ON_CLOSE:
+ break;
+ }
}
}
@@ -554,7 +545,7 @@ public class JDialog extends Dialog implements Accessible, WindowConstants,
must return the invalid code, and the behaviour
defaults to DO_NOTHING_ON_CLOSE. processWindowEvent
above handles this */
- close_action = operation;
+ closeAction = operation;
}
/**
@@ -565,7 +556,7 @@ public class JDialog extends Dialog implements Accessible, WindowConstants,
*/
public int getDefaultCloseOperation()
{
- return close_action;
+ return closeAction;
}
/**
diff --git a/libjava/classpath/javax/swing/JEditorPane.java b/libjava/classpath/javax/swing/JEditorPane.java
index 4ae3c5a1c6b..38b0761f00f 100644
--- a/libjava/classpath/javax/swing/JEditorPane.java
+++ b/libjava/classpath/javax/swing/JEditorPane.java
@@ -40,6 +40,8 @@ package javax.swing;
import java.awt.Container;
import java.awt.Dimension;
+import java.io.BufferedInputStream;
+import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -47,6 +49,7 @@ import java.io.Reader;
import java.io.StringReader;
import java.net.MalformedURLException;
import java.net.URL;
+import java.net.URLConnection;
import java.util.HashMap;
import javax.accessibility.AccessibleContext;
@@ -56,6 +59,8 @@ import javax.accessibility.AccessibleStateSet;
import javax.accessibility.AccessibleText;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
+import javax.swing.plaf.TextUI;
+import javax.swing.text.AbstractDocument;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultEditorKit;
import javax.swing.text.Document;
@@ -482,6 +487,34 @@ public class JEditorPane extends JTextComponent
}
/**
+ * Used to store a mapping for content-type to editor kit class.
+ */
+ private static class EditorKitMapping
+ {
+ /**
+ * The classname of the editor kit.
+ */
+ String className;
+
+ /**
+ * The classloader with which the kit is to be loaded.
+ */
+ ClassLoader classLoader;
+
+ /**
+ * Creates a new EditorKitMapping object.
+ *
+ * @param cn the classname
+ * @param cl the classloader
+ */
+ EditorKitMapping(String cn, ClassLoader cl)
+ {
+ className = cn;
+ classLoader = cl;
+ }
+ }
+
+ /**
* An EditorKit used for plain text. This is the default editor kit for
* JEditorPanes.
*
@@ -505,19 +538,159 @@ public class JEditorPane extends JTextComponent
}
}
+ /**
+ * A special stream that can be cancelled.
+ */
+ private class PageStream
+ extends FilterInputStream
+ {
+ /**
+ * True when the stream has been cancelled, false otherwise.
+ */
+ private boolean cancelled;
+
+ protected PageStream(InputStream in)
+ {
+ super(in);
+ cancelled = false;
+ }
+
+ private void checkCancelled()
+ throws IOException
+ {
+ if (cancelled)
+ throw new IOException("Stream has been cancelled");
+ }
+
+ void cancel()
+ {
+ cancelled = true;
+ }
+
+ public int read()
+ throws IOException
+ {
+ checkCancelled();
+ return super.read();
+ }
+
+ public int read(byte[] b, int off, int len)
+ throws IOException
+ {
+ checkCancelled();
+ return super.read(b, off, len);
+ }
+
+ public long skip(long n)
+ throws IOException
+ {
+ checkCancelled();
+ return super.skip(n);
+ }
+
+ public int available()
+ throws IOException
+ {
+ checkCancelled();
+ return super.available();
+ }
+
+ public void reset()
+ throws IOException
+ {
+ checkCancelled();
+ super.reset();
+ }
+ }
+
+ /**
+ * The thread that loads documents asynchronously.
+ */
+ private class PageLoader
+ implements Runnable
+ {
+ private Document doc;
+ private PageStream in;
+ private URL old;
+ URL page;
+ PageLoader(Document doc, InputStream in, URL old, URL page)
+ {
+ this.doc = doc;
+ this.in = new PageStream(in);
+ this.old = old;
+ this.page = page;
+ }
+
+ public void run()
+ {
+ try
+ {
+ read(in, doc);
+ }
+ catch (IOException ex)
+ {
+ UIManager.getLookAndFeel().provideErrorFeedback(JEditorPane.this);
+ }
+ finally
+ {
+ if (SwingUtilities.isEventDispatchThread())
+ firePropertyChange("page", old, page);
+ else
+ {
+ SwingUtilities.invokeLater(new Runnable()
+ {
+ public void run()
+ {
+ firePropertyChange("page", old, page);
+ }
+ });
+ }
+ }
+ }
+
+ void cancel()
+ {
+ in.cancel();
+ }
+ }
+
private static final long serialVersionUID = 3140472492599046285L;
- private URL page;
private EditorKit editorKit;
boolean focus_root;
+ /**
+ * Maps content-types to editor kit instances.
+ */
+ static HashMap editorKits;
+
// A mapping between content types and registered EditorKit types
static HashMap registerMap;
-
+
+ static
+ {
+ registerMap = new HashMap();
+ editorKits = new HashMap();
+ registerEditorKitForContentType("application/rtf",
+ "javax.swing.text.rtf.RTFEditorKit");
+ registerEditorKitForContentType("text/plain",
+ "javax.swing.JEditorPane$PlainEditorKit");
+ registerEditorKitForContentType("text/html",
+ "javax.swing.text.html.HTMLEditorKit");
+ registerEditorKitForContentType("text/rtf",
+ "javax.swing.text.rtf.RTFEditorKit");
+
+ }
+
// A mapping between content types and used EditorKits
HashMap editorMap;
+ /**
+ * The currently loading stream, if any.
+ */
+ private PageLoader loader;
+
public JEditorPane()
{
init();
@@ -550,15 +723,6 @@ public class JEditorPane extends JTextComponent
void init()
{
editorMap = new HashMap();
- registerMap = new HashMap();
- registerEditorKitForContentType("application/rtf",
- "javax.swing.text.rtf.RTFEditorKit");
- registerEditorKitForContentType("text/plain",
- "javax.swing.JEditorPane$PlainEditorKit");
- registerEditorKitForContentType("text/html",
- "javax.swing.text.html.HTMLEditorKit");
- registerEditorKitForContentType("text/rtf",
- "javax.swing.text.rtf.RTFEditorKit");
}
protected EditorKit createDefaultEditorKit()
@@ -578,20 +742,28 @@ public class JEditorPane extends JTextComponent
*/
public static EditorKit createEditorKitForContentType(String type)
{
- // TODO: Have to handle the case where a ClassLoader was specified
- // when the EditorKit was registered
- EditorKit e = null;
- String className = (String) registerMap.get(type);
- if (className != null)
+ // Try cached instance.
+ EditorKit e = (EditorKit) editorKits.get(type);
+ if (e == null)
{
- try
- {
- e = (EditorKit) Class.forName(className).newInstance();
- }
- catch (Exception e2)
- {
- // TODO: Not sure what to do here.
- }
+ EditorKitMapping m = (EditorKitMapping) registerMap.get(type);
+ if (m != null)
+ {
+ String className = m.className;
+ ClassLoader loader = m.classLoader;
+ try
+ {
+ e = (EditorKit) loader.loadClass(className).newInstance();
+ }
+ catch (Exception e2)
+ {
+ // The reference implementation returns null when class is not
+ // loadable or instantiatable.
+ }
+ }
+ // Cache this for later retrieval.
+ if (e != null)
+ editorKits.put(type, e);
}
return e;
}
@@ -652,7 +824,9 @@ public class JEditorPane extends JTextComponent
*/
public static String getEditorKitClassNameForContentType(String type)
{
- return (String) registerMap.get(type);
+ EditorKitMapping m = (EditorKitMapping) registerMap.get(type);
+ String kitName = m != null ? m.className : null;
+ return kitName;
}
/**
@@ -675,10 +849,14 @@ public class JEditorPane extends JTextComponent
EditorKit e = (EditorKit) editorMap.get(type);
// Then check to see if we can create one.
if (e == null)
- e = createEditorKitForContentType(type);
+ {
+ e = createEditorKitForContentType(type);
+ if (e != null)
+ setEditorKitForContentType(type, e);
+ }
// Otherwise default to PlainEditorKit.
if (e == null)
- e = new PlainEditorKit();
+ e = createDefaultEditorKit();
return e;
}
@@ -695,10 +873,28 @@ public class JEditorPane extends JTextComponent
public Dimension getPreferredSize()
{
Dimension pref = super.getPreferredSize();
- if (getScrollableTracksViewportWidth())
- pref.width = getUI().getMinimumSize(this).width;
- if (getScrollableTracksViewportHeight())
- pref.height = getUI().getMinimumSize(this).height;
+ Container parent = getParent();
+ if (parent instanceof JViewport)
+ {
+ JViewport vp = (JViewport) getParent();
+ TextUI ui = getUI();
+ Dimension min = null;
+ if (! getScrollableTracksViewportWidth())
+ {
+ min = ui.getMinimumSize(this);
+ int vpWidth = vp.getWidth();
+ if (vpWidth != 0 && vpWidth < min.width)
+ pref.width = min.width;
+ }
+ if (! getScrollableTracksViewportHeight())
+ {
+ if (min == null)
+ min = ui.getMinimumSize(this);
+ int vpHeight = vp.getHeight();
+ if (vpHeight != 0 && vpHeight < min.height)
+ pref.height = min.height;
+ }
+ }
return pref;
}
@@ -716,8 +912,11 @@ public class JEditorPane extends JTextComponent
// Tests show that this returns true when the parent is a JViewport
// and has a height > minimum UI height.
Container parent = getParent();
+ int height = parent.getHeight();
+ TextUI ui = getUI();
return parent instanceof JViewport
- && parent.getHeight() > getUI().getMinimumSize(this).height;
+ && height >= ui.getMinimumSize(this).height
+ && height <= ui.getMaximumSize(this).height;
}
/**
@@ -740,13 +939,19 @@ public class JEditorPane extends JTextComponent
public URL getPage()
{
- return page;
+ return loader != null ? loader.page : null;
}
protected InputStream getStream(URL page)
throws IOException
{
- return page.openStream();
+ URLConnection conn = page.openConnection();
+ // Try to detect the content type of the stream data.
+ String type = conn.getContentType();
+ if (type != null)
+ setContentType(type);
+ InputStream stream = conn.getInputStream();
+ return new BufferedInputStream(stream);
}
public String getText()
@@ -777,10 +982,12 @@ public class JEditorPane extends JTextComponent
EditorKit kit = getEditorKit();
if (kit instanceof HTMLEditorKit && desc instanceof HTMLDocument)
{
- Document doc = (Document) desc;
+ HTMLDocument doc = (HTMLDocument) desc;
+ setDocument(doc);
try
{
- kit.read(in, doc, 0);
+ InputStreamReader reader = new InputStreamReader(in);
+ kit.read(reader, doc, 0);
}
catch (BadLocationException ex)
{
@@ -805,7 +1012,8 @@ public class JEditorPane extends JTextComponent
public static void registerEditorKitForContentType(String type,
String classname)
{
- registerMap.put(type, classname);
+ registerEditorKitForContentType(type, classname,
+ Thread.currentThread().getContextClassLoader());
}
/**
@@ -815,7 +1023,7 @@ public class JEditorPane extends JTextComponent
String classname,
ClassLoader loader)
{
- // TODO: Implement this properly.
+ registerMap.put(type, new EditorKitMapping(classname, loader));
}
/**
@@ -839,6 +1047,13 @@ public class JEditorPane extends JTextComponent
public final void setContentType(String type)
{
+ // Strip off content type parameters.
+ int paramIndex = type.indexOf(';');
+ if (paramIndex > -1)
+ {
+ // TODO: Handle character encoding.
+ type = type.substring(0, paramIndex).trim();
+ }
if (editorKit != null
&& editorKit.getContentType().equals(type))
return;
@@ -899,14 +1114,45 @@ public class JEditorPane extends JTextComponent
if (page == null)
throw new IOException("invalid url");
- try
+ URL old = getPage();
+ // Only reload if the URL doesn't point to the same file.
+ // This is not the same as equals because there might be different
+ // URLs on the same file with different anchors.
+ if (old == null || ! old.sameFile(page))
{
- this.page = page;
- getEditorKit().read(page.openStream(), getDocument(), 0);
- }
- catch (BadLocationException e)
- {
- // Ignored. '0' is always a valid offset.
+ InputStream in = getStream(page);
+ if (editorKit != null)
+ {
+ Document doc = editorKit.createDefaultDocument();
+ doc.putProperty(Document.StreamDescriptionProperty, page);
+
+ if (loader != null)
+ loader.cancel();
+ loader = new PageLoader(doc, in, old, page);
+
+ int prio = -1;
+ if (doc instanceof AbstractDocument)
+ {
+ AbstractDocument aDoc = (AbstractDocument) doc;
+ prio = aDoc.getAsynchronousLoadPriority();
+ }
+ if (prio >= 0)
+ {
+ // Load asynchronously.
+ setDocument(doc);
+ Thread loadThread = new Thread(loader,
+ "JEditorPane.PageLoader");
+ loadThread.setDaemon(true);
+ loadThread.setPriority(prio);
+ loadThread.start();
+ }
+ else
+ {
+ // Load synchronously.
+ loader.run();
+ setDocument(doc);
+ }
+ }
}
}
diff --git a/libjava/classpath/javax/swing/JFrame.java b/libjava/classpath/javax/swing/JFrame.java
index 1371525ddf2..0ae23f101fa 100644
--- a/libjava/classpath/javax/swing/JFrame.java
+++ b/libjava/classpath/javax/swing/JFrame.java
@@ -157,6 +157,10 @@ public class JFrame extends Frame
protected void frameInit()
{
+ // We need to explicitly enable events here so that our processKeyEvent()
+ // and processWindowEvent() gets called.
+ enableEvents(AWTEvent.WINDOW_EVENT_MASK | AWTEvent.KEY_EVENT_MASK);
+
super.setLayout(new BorderLayout());
setBackground(UIManager.getDefaults().getColor("control"));
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
@@ -351,39 +355,22 @@ public class JFrame extends Frame
protected void processWindowEvent(WindowEvent e)
{
super.processWindowEvent(e);
- switch (e.getID())
+ if (e.getID() == WindowEvent.WINDOW_CLOSING)
{
- case WindowEvent.WINDOW_CLOSING:
- {
- switch (closeAction)
- {
- case EXIT_ON_CLOSE:
- {
- System.exit(0);
- break;
- }
- case DISPOSE_ON_CLOSE:
- {
- dispose();
- break;
- }
- case HIDE_ON_CLOSE:
- {
- setVisible(false);
- break;
- }
- case DO_NOTHING_ON_CLOSE:
- break;
- }
- break;
- }
- case WindowEvent.WINDOW_CLOSED:
- case WindowEvent.WINDOW_OPENED:
- case WindowEvent.WINDOW_ICONIFIED:
- case WindowEvent.WINDOW_DEICONIFIED:
- case WindowEvent.WINDOW_ACTIVATED:
- case WindowEvent.WINDOW_DEACTIVATED:
- break;
+ switch (closeAction)
+ {
+ case EXIT_ON_CLOSE:
+ System.exit(0);
+ break;
+ case DISPOSE_ON_CLOSE:
+ dispose();
+ break;
+ case HIDE_ON_CLOSE:
+ setVisible(false);
+ break;
+ case DO_NOTHING_ON_CLOSE:
+ break;
+ }
}
}
diff --git a/libjava/classpath/javax/swing/JLabel.java b/libjava/classpath/javax/swing/JLabel.java
index fcf0fd7cb13..721287b21df 100644
--- a/libjava/classpath/javax/swing/JLabel.java
+++ b/libjava/classpath/javax/swing/JLabel.java
@@ -38,13 +38,14 @@ exception statement from your version. */
package javax.swing;
-import gnu.classpath.NotImplementedException;
-
import java.awt.Component;
import java.awt.Font;
+import java.awt.FontMetrics;
import java.awt.Image;
+import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
+import java.awt.Shape;
import java.awt.event.KeyEvent;
import java.beans.PropertyChangeEvent;
@@ -54,8 +55,12 @@ import javax.accessibility.AccessibleExtendedComponent;
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleText;
import javax.swing.plaf.LabelUI;
+import javax.swing.plaf.basic.BasicHTML;
import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Position;
import javax.swing.text.SimpleAttributeSet;
+import javax.swing.text.View;
/**
* A component that displays a static text message and/or an icon.
@@ -303,10 +308,52 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
* @return the bounding box of the character at the specified index
*/
public Rectangle getCharacterBounds(int index)
- throws NotImplementedException
{
- // FIXME: Implement this correctly.
- return new Rectangle();
+ Rectangle bounds = null;
+ View view = (View) getClientProperty(BasicHTML.propertyKey);
+ if (view != null)
+ {
+ Rectangle textR = getTextRectangle();
+ try
+ {
+ Shape s = view.modelToView(index, textR, Position.Bias.Forward);
+ bounds = s.getBounds();
+ }
+ catch (BadLocationException ex)
+ {
+ // Can't return something reasonable in this case.
+ }
+ }
+ return bounds;
+ }
+
+ /**
+ * Returns the rectangle inside the JLabel, in which the actual text is
+ * rendered. This method has been adopted from the Mauve testcase
+ * gnu.testlet.javax.swing.JLabel.AccessibleJLabel.getCharacterBounds.
+ *
+ * @return the rectangle inside the JLabel, in which the actual text is
+ * rendered
+ */
+ private Rectangle getTextRectangle()
+ {
+ JLabel l = JLabel.this;
+ Rectangle textR = new Rectangle();
+ Rectangle iconR = new Rectangle();
+ Insets i = l.getInsets();
+ int w = l.getWidth();
+ int h = l.getHeight();
+ Rectangle viewR = new Rectangle(i.left, i.top, w - i.left - i.right,
+ h - i.top - i.bottom);
+ FontMetrics fm = l.getFontMetrics(l.getFont());
+ SwingUtilities.layoutCompoundLabel(l, fm, l.getText(), l.getIcon(),
+ l.getVerticalAlignment(),
+ l.getHorizontalAlignment(),
+ l.getVerticalTextPosition(),
+ l.getHorizontalTextPosition(),
+ viewR, iconR, textR,
+ l.getIconTextGap());
+ return textR;
}
/**
@@ -319,10 +366,15 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
* point
*/
public int getIndexAtPoint(Point point)
- throws NotImplementedException
{
- // FIXME: Implement this correctly.
- return 0;
+ int index = -1;
+ View view = (View) getClientProperty(BasicHTML.propertyKey);
+ if (view != null)
+ {
+ Rectangle r = getTextRectangle();
+ index = view.viewToModel(point.x, point.y, r, new Position.Bias[0]);
+ }
+ return index;
}
}
@@ -379,11 +431,11 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
* Creates a new vertically and horizontally centered
* JLabel object with no text and the given icon.
*
- * @param image The icon to use with the label.
+ * @param image The icon to use with the label, <code>null</code> permitted.
*/
public JLabel(Icon image)
{
- this("", image, CENTER);
+ this(null, image, CENTER);
}
/**
@@ -391,19 +443,21 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
* given icon and horizontal alignment. By default, the text is TRAILING
* the image.
*
- * @param image The icon to use with the label.
- * @param horizontalAlignment The horizontal alignment of the label.
+ * @param image The icon to use with the label, <code>null</code> premitted.
+ * @param horizontalAlignment The horizontal alignment of the label, must be
+ * either <code>CENTER</code>, <code>LEFT</code>, <code>RIGHT</code>,
+ * <code>LEADING</code> or <code>TRAILING</code>.
*/
public JLabel(Icon image, int horizontalAlignment)
{
- this("", image, horizontalAlignment);
+ this(null, image, horizontalAlignment);
}
/**
* Creates a new horizontally leading and vertically centered JLabel
* object with no icon and the given text.
*
- * @param text The text to use with the label.
+ * @param text The text to use with the label, <code>null</code> permitted.
*/
public JLabel(String text)
{
@@ -414,8 +468,10 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
* Creates a new vertically centered JLabel object with no icon and the
* given text and horizontal alignment.
*
- * @param text The text to use with the label.
- * @param horizontalAlignment The horizontal alignment of the label.
+ * @param text The text to use with the label, <code>null</code> permitted.
+ * @param horizontalAlignment The horizontal alignment of the label, must be
+ * either <code>CENTER</code>, <code>LEFT</code>, <code>RIGHT</code>,
+ * <code>LEADING</code> or <code>TRAILING</code>.
*/
public JLabel(String text, int horizontalAlignment)
{
@@ -426,12 +482,21 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
* Creates a new vertically centered JLabel object with the given text,
* icon, and horizontal alignment.
*
- * @param text The text to use with the label.
- * @param icon The icon to use with the label.
- * @param horizontalAlignment The horizontal alignment of the label.
+ * @param text The text to use with the label, <code>null</code> permitted.
+ * @param icon The icon to use with the label, <code>null</code> premitted.
+ * @param horizontalAlignment The horizontal alignment of the label, must be
+ * either <code>CENTER</code>, <code>LEFT</code>, <code>RIGHT</code>,
+ * <code>LEADING</code> or <code>TRAILING</code>.
*/
public JLabel(String text, Icon icon, int horizontalAlignment)
{
+ if (horizontalAlignment != SwingConstants.LEFT
+ && horizontalAlignment != SwingConstants.RIGHT
+ && horizontalAlignment != SwingConstants.CENTER
+ && horizontalAlignment != SwingConstants.LEADING
+ && horizontalAlignment != SwingConstants.TRAILING)
+ throw new IllegalArgumentException();
+
this.text = text;
this.icon = icon;
this.horizontalAlignment = horizontalAlignment;
diff --git a/libjava/classpath/javax/swing/JLayeredPane.java b/libjava/classpath/javax/swing/JLayeredPane.java
index ca913e97fed..d981788ec7d 100644
--- a/libjava/classpath/javax/swing/JLayeredPane.java
+++ b/libjava/classpath/javax/swing/JLayeredPane.java
@@ -406,7 +406,7 @@ public class JLayeredPane extends JComponent implements Accessible
* Return a hashtable mapping child components of this container to
* Integer objects representing the component's layer assignments.
*/
- protected Hashtable getComponentToLayer()
+ protected Hashtable<Component, Integer> getComponentToLayer()
{
return componentToLayer;
}
diff --git a/libjava/classpath/javax/swing/JList.java b/libjava/classpath/javax/swing/JList.java
index 6a98770eeda..ff1b239217a 100644
--- a/libjava/classpath/javax/swing/JList.java
+++ b/libjava/classpath/javax/swing/JList.java
@@ -1041,7 +1041,7 @@ public class JList extends JComponent implements Accessible, Scrollable
*
* @param items the initial list items.
*/
- public JList(Vector items)
+ public JList(Vector<?> items)
{
init(createListModel(items));
}
@@ -1643,9 +1643,20 @@ public class JList extends JComponent implements Accessible, Scrollable
* @param listData The object array to build a new list model on
* @see #setModel
*/
- public void setListData(Vector listData)
+ public void setListData(final Vector<?> listData)
{
- setModel(createListModel(listData));
+ setModel(new AbstractListModel()
+ {
+ public int getSize()
+ {
+ return listData.size();
+ }
+
+ public Object getElementAt(int i)
+ {
+ return listData.elementAt(i);
+ }
+ });
}
/**
@@ -1935,72 +1946,74 @@ public class JList extends JComponent implements Accessible, Scrollable
public int getScrollableUnitIncrement(Rectangle visibleRect,
int orientation, int direction)
{
- ListUI lui = this.getUI();
+ int unit = -1;
if (orientation == SwingConstants.VERTICAL)
{
- if (direction > 0)
+ int row = getFirstVisibleIndex();
+ if (row == -1)
+ unit = 0;
+ else if (direction > 0)
+ {
+ // Scrolling down.
+ Rectangle bounds = getCellBounds(row, row);
+ if (bounds != null)
+ unit = bounds.height - (visibleRect.y - bounds.y);
+ else
+ unit = 0;
+ }
+ else
{
- // Scrolling down
- Point bottomLeft = new Point(visibleRect.x,
- visibleRect.y + visibleRect.height);
- int curIdx = lui.locationToIndex(this, bottomLeft);
- Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx);
- if (curBounds.y + curBounds.height == bottomLeft.y)
+ // Scrolling up.
+ Rectangle bounds = getCellBounds(row, row);
+ // First row.
+ if (row == 0 && bounds.y == visibleRect.y)
+ unit = 0; // No need to scroll.
+ else if (bounds.y == visibleRect.y)
{
- // we are at the exact bottom of the current cell, so we
- // are being asked to scroll to the end of the next one
- if (curIdx + 1 < model.getSize())
- {
- // there *is* a next item in the list
- Rectangle nxtBounds = lui.getCellBounds(this, curIdx + 1, curIdx + 1);
- return nxtBounds.height;
- }
+ // Scroll to previous row.
+ Point loc = bounds.getLocation();
+ loc.y--;
+ int prev = locationToIndex(loc);
+ Rectangle prevR = getCellBounds(prev, prev);
+ if (prevR == null || prevR.y >= bounds.y)
+ unit = 0; // For multicolumn lists.
else
- {
- // no next item, no advance possible
- return 0;
- }
+ unit = prevR.height;
}
else
- {
- // we are part way through an existing cell, so we are being
- // asked to scroll to the bottom of it
- return (curBounds.y + curBounds.height) - bottomLeft.y;
- }
+ unit = visibleRect.y - bounds.y;
}
- else
+ }
+ else if (orientation == SwingConstants.HORIZONTAL && getLayoutOrientation() != VERTICAL)
+ {
+ // Horizontal scrolling.
+ int i = locationToIndex(visibleRect.getLocation());
+ if (i != -1)
{
- // scrolling up
- Point topLeft = new Point(visibleRect.x, visibleRect.y);
- int curIdx = lui.locationToIndex(this, topLeft);
- Rectangle curBounds = lui.getCellBounds(this, curIdx, curIdx);
- if (curBounds.y == topLeft.y)
+ Rectangle b = getCellBounds(i, i);
+ if (b != null)
{
- // we are at the exact top of the current cell, so we
- // are being asked to scroll to the top of the previous one
- if (curIdx > 0)
+ if (b.x != visibleRect.x)
{
- // there *is* a previous item in the list
- Rectangle nxtBounds = lui.getCellBounds(this, curIdx - 1, curIdx - 1);
- return -nxtBounds.height;
+ if (direction < 0)
+ unit = Math.abs(b.x - visibleRect.x);
+ else
+ unit = b.width + b.x - visibleRect.x;
}
else
- {
- // no previous item, no advance possible
- return 0;
- }
+ unit = b.width;
}
- else
- {
- // we are part way through an existing cell, so we are being
- // asked to scroll to the top of it
- return curBounds.y - topLeft.y;
- }
}
}
- // FIXME: handle horizontal scrolling (also wrapping?)
- return 1;
+ if (unit == -1)
+ {
+ // This fallback seems to be used by the RI for the degenerate cases
+ // not covered above.
+ Font f = getFont();
+ unit = f != null ? f.getSize() : 1;
+ }
+ return unit;
}
/**
@@ -2029,10 +2042,120 @@ public class JList extends JComponent implements Accessible, Scrollable
public int getScrollableBlockIncrement(Rectangle visibleRect,
int orientation, int direction)
{
- if (orientation == VERTICAL)
- return visibleRect.height * direction;
- else
- return visibleRect.width * direction;
+ int block = -1;
+ if (orientation == SwingConstants.VERTICAL)
+ {
+ // Default block scroll. Special cases are handled below for
+ // better usability.
+ block = visibleRect.height;
+ if (direction > 0)
+ {
+ // Scroll down.
+ // Scroll so that after scrolling the last line aligns with
+ // the lower boundary of the visible area.
+ Point p = new Point(visibleRect.x,
+ visibleRect.y + visibleRect.height - 1);
+ int last = locationToIndex(p);
+ if (last != -1)
+ {
+ Rectangle lastR = getCellBounds(last, last);
+ if (lastR != null)
+ {
+ block = lastR.y - visibleRect.y;
+ if (block == 0&& last < getModel().getSize() - 1)
+ block = lastR.height;
+ }
+ }
+ }
+ else
+ {
+ // Scroll up.
+ // Scroll so that after scrolling the first line aligns with
+ // the upper boundary of the visible area.
+ Point p = new Point(visibleRect.x,
+ visibleRect.y - visibleRect.height);
+ int newFirst = locationToIndex(p);
+ if (newFirst != -1)
+ {
+ int first = getFirstVisibleIndex();
+ if (first == -1)
+ first = locationToIndex(visibleRect.getLocation());
+ Rectangle newFirstR = getCellBounds(newFirst, newFirst);
+ Rectangle firstR = getCellBounds(first, first);
+ if (newFirstR != null && firstR != null)
+ {
+ // Search first item that would left the current first
+ // item visible when scrolled to.
+ while (newFirstR.y + visibleRect.height
+ < firstR.y + firstR.height
+ && newFirstR.y < firstR.y)
+ {
+ newFirst++;
+ newFirstR = getCellBounds(newFirst, newFirst);
+ }
+ block = visibleRect.y - newFirstR.y;
+ if (block <= 0 && newFirstR.y > 0)
+ {
+ newFirst--;
+ newFirstR = getCellBounds(newFirst, newFirst);
+ if (newFirstR != null)
+ block = visibleRect.y - newFirstR.y;
+ }
+ }
+ }
+ }
+ }
+ else if (orientation == SwingConstants.HORIZONTAL
+ && getLayoutOrientation() != VERTICAL)
+ {
+ // Default block increment. Special cases are handled below for
+ // better usability.
+ block = visibleRect.width;
+ if (direction > 0)
+ {
+ // Scroll right.
+ Point p = new Point(visibleRect.x + visibleRect.width + 1,
+ visibleRect.y);
+ int last = locationToIndex(p);
+ if (last != -1)
+ {
+ Rectangle lastR = getCellBounds(last, last);
+ if (lastR != null)
+ {
+ block = lastR.x - visibleRect.x;
+ if (block < 0)
+ block += lastR.width;
+ else if (block == 0 && last < getModel().getSize() - 1)
+ block = lastR.width;
+ }
+ }
+ }
+ else
+ {
+ // Scroll left.
+ Point p = new Point(visibleRect.x - visibleRect.width,
+ visibleRect.y);
+ int first = locationToIndex(p);
+ if (first != -1)
+ {
+ Rectangle firstR = getCellBounds(first, first);
+ if (firstR != null)
+ {
+ if (firstR.x < visibleRect.x - visibleRect.width)
+ {
+ if (firstR.x + firstR.width > visibleRect.x)
+ block = visibleRect.x - firstR.x;
+ else
+ block = visibleRect.x - firstR.x - firstR.width;
+ }
+ else
+ block = visibleRect.x - firstR.x;
+ }
+ }
+ }
+ }
+
+ return block;
}
/**
diff --git a/libjava/classpath/javax/swing/JMenu.java b/libjava/classpath/javax/swing/JMenu.java
index 0840509f906..7e627f1181d 100644
--- a/libjava/classpath/javax/swing/JMenu.java
+++ b/libjava/classpath/javax/swing/JMenu.java
@@ -39,8 +39,14 @@ exception statement from your version. */
package javax.swing;
import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Insets;
import java.awt.Point;
-import java.awt.PopupMenu;
+import java.awt.Rectangle;
+import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
@@ -54,6 +60,8 @@ import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleSelection;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
import javax.swing.plaf.MenuItemUI;
@@ -72,6 +80,36 @@ import javax.swing.plaf.MenuItemUI;
*/
public class JMenu extends JMenuItem implements Accessible, MenuElement
{
+ /**
+ * Receives notifications when the JMenu's ButtonModel is changed and
+ * fires menuSelected or menuDeselected events when appropriate.
+ */
+ private class MenuChangeListener
+ implements ChangeListener
+ {
+ /**
+ * Indicates the last selected state.
+ */
+ private boolean selected;
+
+ /**
+ * Receives notification when the JMenu's ButtonModel changes.
+ */
+ public void stateChanged(ChangeEvent ev)
+ {
+ ButtonModel m = (ButtonModel) ev.getSource();
+ boolean s = m.isSelected();
+ if (s != selected)
+ {
+ if (s)
+ fireMenuSelected();
+ else
+ fireMenuDeselected();
+ selected = s;
+ }
+ }
+ }
+
private static final long serialVersionUID = 4227225638931828014L;
/** A Popup menu associated with this menu, which pops up when menu is selected */
@@ -88,18 +126,26 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
/* PopupListener */
protected WinListener popupListener;
- /** Location at which popup menu associated with this menu will be
- displayed */
+ /**
+ * Location at which popup menu associated with this menu will be
+ * displayed
+ */
private Point menuLocation;
/**
+ * The ChangeListener for the ButtonModel.
+ *
+ * @see MenuChangeListener
+ */
+ private ChangeListener menuChangeListener;
+
+ /**
* Creates a new JMenu object.
*/
public JMenu()
{
super();
setOpaque(false);
- setDelay(200);
}
/**
@@ -113,7 +159,6 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
popupMenu = new JPopupMenu();
popupMenu.setInvoker(this);
setOpaque(false);
- setDelay(200);
}
/**
@@ -129,7 +174,6 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
popupMenu = new JPopupMenu();
popupMenu.setInvoker(this);
setOpaque(false);
- setDelay(200);
}
/**
@@ -143,7 +187,6 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
{
// FIXME: tearoff not implemented
this(text);
- setDelay(200);
}
/**
@@ -193,7 +236,7 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
*/
public JMenuItem add(String text)
{
- return getPopupMenu().add(text);
+ return add(new JMenuItem(text));
}
/**
@@ -205,7 +248,10 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
*/
public JMenuItem add(Action action)
{
- return getPopupMenu().add(action);
+ JMenuItem i = createActionComponent(action);
+ i.setAction(action);
+ add(i);
+ return i;
}
/**
@@ -328,7 +374,18 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
*/
public void setModel(ButtonModel model)
{
+ ButtonModel oldModel = getModel();
+ if (oldModel != null && menuChangeListener != null)
+ oldModel.removeChangeListener(menuChangeListener);
+
super.setModel(model);
+
+ if (model != null)
+ {
+ if (menuChangeListener == null)
+ menuChangeListener = new MenuChangeListener();
+ model.addChangeListener(menuChangeListener);
+ }
}
/**
@@ -342,63 +399,6 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
}
/**
- * A helper method to handle setSelected calls from both mouse events and
- * direct calls to setSelected. Direct calls shouldn't expand the popup
- * menu and should select the JMenu even if it is disabled. Mouse events
- * only select the JMenu if it is enabled and should expand the popup menu
- * associated with this JMenu.
- * @param selected whether or not the JMenu was selected
- * @param menuEnabled whether or not selecting the menu is "enabled". This
- * is always true for direct calls, and is set to isEnabled() for mouse
- * based calls.
- * @param showMenu whether or not to show the popup menu
- */
- private void setSelectedHelper(boolean selected, boolean menuEnabled, boolean showMenu)
- {
- // If menu is selected and enabled, activates the menu and
- // displays associated popup.
- if (selected && menuEnabled)
- {
- super.setArmed(true);
- super.setSelected(true);
-
- // FIXME: The popup menu should be shown on the screen after certain
- // number of seconds pass. The 'delay' property of this menu indicates
- // this amount of seconds. 'delay' property is 0 by default.
- if (isShowing())
- {
- fireMenuSelected();
-
- int x = 0;
- int y = 0;
- if (showMenu)
- if (menuLocation == null)
- {
- // Calculate correct position of the popup. Note that location of the popup
- // passed to show() should be relative to the popup's invoker
- if (isTopLevelMenu())
- y = this.getHeight();
- else
- x = this.getWidth();
- getPopupMenu().show(this, x, y);
- }
- else
- {
- getPopupMenu().show(this, menuLocation.x, menuLocation.y);
- }
- }
- }
-
- else
- {
- super.setSelected(false);
- super.setArmed(false);
- fireMenuDeselected();
- getPopupMenu().setVisible(false);
- }
- }
-
- /**
* Changes this menu selected state if selected is true and false otherwise
* This method fires menuEvents to menu's registered listeners.
*
@@ -406,7 +406,9 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
*/
public void setSelected(boolean selected)
{
- setSelectedHelper(selected, true, false);
+ ButtonModel m = getModel();
+ if (selected != m.isSelected())
+ m.setSelected(selected);
}
/**
@@ -427,23 +429,126 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
*/
public void setPopupMenuVisible(boolean popup)
{
- if (getModel().isEnabled())
- getPopupMenu().setVisible(popup);
+ if (popup != isPopupMenuVisible() && (isEnabled() || ! popup))
+ {
+ if (popup && isShowing())
+ {
+ // Set location as determined by getPopupLocation().
+ Point loc = menuLocation == null ? getPopupMenuOrigin()
+ : menuLocation;
+ getPopupMenu().show(this, loc.x, loc.y);
+ }
+ else
+ getPopupMenu().setVisible(false);
+ }
}
/**
- * Returns origin point of the popup menu
+ * Returns origin point of the popup menu. This takes the screen bounds
+ * into account and places the popup where it fits best.
*
- * @return Point containing
+ * @return the origin of the popup menu
*/
protected Point getPopupMenuOrigin()
{
- // if menu in the menu bar
+ // The menu's screen location and size.
+ Point screenLoc = getLocationOnScreen();
+ Dimension size = getSize();
+
+ // Determine the popup's size.
+ JPopupMenu popup = getPopupMenu();
+ Dimension popupSize = popup.getSize();
+ if (popupSize.width == 0 || popupSize.height == 0)
+ popupSize = popup.getPreferredSize();
+
+ // Determine screen bounds.
+ Toolkit tk = Toolkit.getDefaultToolkit();
+ Rectangle screenBounds = new Rectangle(tk.getScreenSize());
+ GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ GraphicsDevice gd = ge.getDefaultScreenDevice();
+ GraphicsConfiguration gc = gd.getDefaultConfiguration();
+ Insets screenInsets = tk.getScreenInsets(gc);
+ screenBounds.x -= screenInsets.left;
+ screenBounds.width -= screenInsets.left + screenInsets.right;
+ screenBounds.y -= screenInsets.top;
+ screenBounds.height -= screenInsets.top + screenInsets.bottom;
+ screenLoc.x -= screenInsets.left;
+ screenLoc.y -= screenInsets.top;
+
+ Point point = new Point();
if (isTopLevelMenu())
- return new Point(0, this.getHeight());
-
- // if submenu
- return new Point(this.getWidth(), 0);
+ {
+ // If menu in the menu bar.
+ int xOffset = UIManager.getInt("Menu.menuPopupOffsetX");
+ int yOffset = UIManager.getInt("Menu.menuPopupOffsetY");
+ // Determine X location.
+ if (getComponentOrientation().isLeftToRight())
+ {
+ // Prefer popup to the right.
+ point.x = xOffset;
+ // Check if it fits, otherwise place popup wherever it fits.
+ if (screenLoc.x + point.x + popupSize.width
+ > screenBounds.width + screenBounds.width
+ && screenBounds.width - size.width
+ < 2 * (screenLoc.x - screenBounds.x))
+ // Popup to the right if there's not enough room.
+ point.x = size.width - xOffset - popupSize.width;
+ }
+ else
+ {
+ // Prefer popup to the left.
+ point.x = size.width - xOffset - popupSize.width;
+ if (screenLoc.x + point.x < screenBounds.x
+ && screenBounds.width - size.width
+ > 2 * (screenLoc.x - screenBounds.x))
+ // Popup to the left if there's not enough room.
+ point.x = xOffset;
+ }
+ // Determine Y location. Prefer popping down.
+ point.y = size.height + yOffset;
+ if (screenLoc.y + point.y + popupSize.height >= screenBounds.height
+ && screenBounds.height - size.height
+ < 2 * (screenLoc.y - screenBounds.y))
+ // Position above if there's not enough room below.
+ point.y = - yOffset - popupSize.height;
+ }
+ else
+ {
+ // If submenu.
+ int xOffset = UIManager.getInt("Menu.submenuPopupOffsetX");
+ int yOffset = UIManager.getInt("Menu.submenuPopupOffsetY");
+ // Determine X location.
+ if (getComponentOrientation().isLeftToRight())
+ {
+ // Prefer popup to the right.
+ point.x = size.width + xOffset;
+ if (screenLoc.x + point.x + popupSize.width
+ >= screenBounds.x + screenBounds.width
+ && screenBounds.width - size.width
+ < 2 * (screenLoc.x - screenBounds.x))
+ // Position to the left if there's not enough room on the right.
+ point.x = - xOffset - popupSize.width;
+ }
+ else
+ {
+ // Prefer popup on the left side.
+ point.x = - xOffset - popupSize.width;
+ if (screenLoc.x + point.x < screenBounds.x
+ && screenBounds.width - size.width
+ > 2 * (screenLoc.x - screenBounds.x))
+ // Popup to the right if there's not enough room.
+ point.x = size.width + xOffset;
+ }
+ // Determine Y location. Prefer popping down.
+ point.y = yOffset;
+ if (screenLoc.y + point.y + popupSize.height
+ >= screenBounds.y + screenBounds.height
+ && screenBounds.height - size.height
+ < 2 * (screenLoc.y - screenBounds.y))
+ // Pop up if there's not enough room below.
+ point.y = size.height - yOffset - popupSize.height;
+ }
+ return point;
}
/**
@@ -483,6 +588,8 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
public void setMenuLocation(int x, int y)
{
menuLocation = new Point(x, y);
+ if (popupMenu != null)
+ popupMenu.setLocation(x, y);
}
/**
@@ -600,7 +707,7 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
if (getPopupMenu() == null || getMenuComponentCount() == 0)
return null;
- return (Component) popupMenu.getComponentAtIndex(index);
+ return popupMenu.getComponentAtIndex(index);
}
/**
@@ -748,7 +855,7 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
{
// if this menu selection is true, then activate this menu and
// display popup associated with this menu
- setSelectedHelper(changed, isEnabled(), true);
+ setSelected(changed);
}
/**
diff --git a/libjava/classpath/javax/swing/JMenuBar.java b/libjava/classpath/javax/swing/JMenuBar.java
index 35f129377f1..73b409e42db 100644
--- a/libjava/classpath/javax/swing/JMenuBar.java
+++ b/libjava/classpath/javax/swing/JMenuBar.java
@@ -298,19 +298,25 @@ public class JMenuBar extends JComponent implements Accessible, MenuElement
}
/**
- * DOCUMENT ME!
+ * This method is not implemented and will throw an {@link Error} if called.
*
- * @return DOCUMENT ME!
+ * @return This method never returns anything, it throws an exception.
*/
public JMenu getHelpMenu()
{
- return null;
+ // the following error matches the behaviour of the reference
+ // implementation...
+ throw new Error("getHelpMenu() is not implemented");
}
/**
- * Returns margin betweeen menu bar's border and its menues
+ * Returns the margin between the menu bar's border and its menus. If the
+ * margin is <code>null</code>, this method returns
+ * <code>new Insets(0, 0, 0, 0)</code>.
*
- * @return margin between menu bar's border and its menues
+ * @return The margin (never <code>null</code>).
+ *
+ * @see #setMargin(Insets)
*/
public Insets getMargin()
{
@@ -617,21 +623,20 @@ public class JMenuBar extends JComponent implements Accessible, MenuElement
}
/**
- * Sets the menu bar's "margin" bound property, which represents
- * distance between the menubar's border and its menus.
- * icon. When marging property is modified, PropertyChangeEvent will
- * be fired to menuBar's PropertyChangeListener's.
- *
- * @param m distance between the menubar's border and its menus.
+ * Sets the margin between the menu bar's border and its menus (this is a
+ * bound property with the name 'margin').
*
+ * @param m the margin (<code>null</code> permitted).
+ *
+ * @see #getMargin()
*/
public void setMargin(Insets m)
{
if (m != margin)
{
- Insets oldMargin = margin;
- margin = m;
- firePropertyChange("margin", oldMargin, margin);
+ Insets oldMargin = margin;
+ margin = m;
+ firePropertyChange("margin", oldMargin, margin);
}
}
diff --git a/libjava/classpath/javax/swing/JMenuItem.java b/libjava/classpath/javax/swing/JMenuItem.java
index f7f93bf00d7..ffdccdcef1a 100644
--- a/libjava/classpath/javax/swing/JMenuItem.java
+++ b/libjava/classpath/javax/swing/JMenuItem.java
@@ -39,7 +39,6 @@ exception statement from your version. */
package javax.swing;
import java.awt.Component;
-import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
@@ -77,12 +76,16 @@ public class JMenuItem extends AbstractButton implements Accessible,
private KeyStroke accelerator;
/**
+ * Indicates if we are currently dragging the mouse.
+ */
+ private boolean isDragging;
+
+ /**
* Creates a new JMenuItem object.
*/
public JMenuItem()
{
- super();
- init(null, null);
+ this(null, null);
}
/**
@@ -94,8 +97,7 @@ public class JMenuItem extends AbstractButton implements Accessible,
{
// FIXME: The requestedFocusEnabled property should
// be set to false, when only icon is set for menu item.
- super();
- init(null, icon);
+ this(null, icon);
}
/**
@@ -117,6 +119,7 @@ public class JMenuItem extends AbstractButton implements Accessible,
{
super();
super.setAction(action);
+ setModel(new DefaultButtonModel());
init(null, null);
if (action != null)
{
@@ -148,6 +151,7 @@ public class JMenuItem extends AbstractButton implements Accessible,
public JMenuItem(String text, Icon icon)
{
super();
+ setModel(new DefaultButtonModel());
init(text, icon);
}
@@ -174,7 +178,6 @@ public class JMenuItem extends AbstractButton implements Accessible,
protected void init(String text, Icon icon)
{
super.init(text, icon);
- setModel(new DefaultButtonModel());
// Initializes properties for this menu item, that are different
// from Abstract button properties.
@@ -320,71 +323,21 @@ public class JMenuItem extends AbstractButton implements Accessible,
/**
* Process mouse events forwarded from MenuSelectionManager.
*
- * @param event event forwarded from MenuSelectionManager
+ * @param ev event forwarded from MenuSelectionManager
* @param path path to the menu element from which event was generated
* @param manager MenuSelectionManager for the current menu hierarchy
*/
- public void processMouseEvent(MouseEvent event, MenuElement[] path,
+ public void processMouseEvent(MouseEvent ev, MenuElement[] path,
MenuSelectionManager manager)
{
- // Fire MenuDragMouseEvents if mouse is being dragged.
- boolean dragged
- = (event.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0;
- if (dragged)
- processMenuDragMouseEvent(createMenuDragMouseEvent(event, path, manager));
-
- switch (event.getID())
- {
- case MouseEvent.MOUSE_CLICKED:
- break;
- case MouseEvent.MOUSE_ENTERED:
- if (isRolloverEnabled())
- model.setRollover(true);
- break;
- case MouseEvent.MOUSE_EXITED:
- if (isRolloverEnabled())
- model.setRollover(false);
-
- // for JMenu last element on the path is its popupMenu.
- // JMenu shouldn't me disarmed.
- if (! (path[path.length - 1] instanceof JPopupMenu) && ! dragged)
- setArmed(false);
- break;
- case MouseEvent.MOUSE_PRESSED:
- if ((event.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0)
- {
- model.setArmed(true);
- model.setPressed(true);
- }
- break;
- case MouseEvent.MOUSE_RELEASED:
- break;
- case MouseEvent.MOUSE_MOVED:
- break;
- case MouseEvent.MOUSE_DRAGGED:
- break;
- }
- }
-
- /**
- * Creates MenuDragMouseEvent.
- *
- * @param event MouseEvent that occured while mouse was pressed.
- * @param path Path the the menu element where the dragging event was
- * originated
- * @param manager MenuSelectionManager for the current menu hierarchy.
- *
- * @return new MenuDragMouseEvent
- */
- private MenuDragMouseEvent createMenuDragMouseEvent(MouseEvent event,
- MenuElement[] path,
- MenuSelectionManager manager)
- {
- return new MenuDragMouseEvent((Component) event.getSource(),
- event.getID(), event.getWhen(),
- event.getModifiers(), event.getX(),
- event.getY(), event.getClickCount(),
- event.isPopupTrigger(), path, manager);
+ MenuDragMouseEvent e = new MenuDragMouseEvent(ev.getComponent(),
+ ev.getID(), ev.getWhen(),
+ ev.getModifiers(), ev.getX(),
+ ev.getY(),
+ ev.getClickCount(),
+ ev.isPopupTrigger(), path,
+ manager);
+ processMenuDragMouseEvent(e);
}
/**
@@ -420,16 +373,20 @@ public class JMenuItem extends AbstractButton implements Accessible,
switch (event.getID())
{
case MouseEvent.MOUSE_ENTERED:
+ isDragging = false;
fireMenuDragMouseEntered(event);
break;
case MouseEvent.MOUSE_EXITED:
+ isDragging = false;
fireMenuDragMouseExited(event);
break;
case MouseEvent.MOUSE_DRAGGED:
+ isDragging = true;
fireMenuDragMouseDragged(event);
break;
case MouseEvent.MOUSE_RELEASED:
- fireMenuDragMouseReleased(event);
+ if (isDragging)
+ fireMenuDragMouseReleased(event);
break;
}
}
@@ -833,4 +790,20 @@ public class JMenuItem extends AbstractButton implements Accessible,
return AccessibleRole.MENU_ITEM;
}
}
+
+ /**
+ * Returns <code>true</code> if the component is guaranteed to be painted
+ * on top of others. This returns false by default and is overridden by
+ * components like JMenuItem, JPopupMenu and JToolTip to return true for
+ * added efficiency.
+ *
+ * @return <code>true</code> if the component is guaranteed to be painted
+ * on top of others
+ */
+ boolean onTop()
+ {
+ return SwingUtilities.getAncestorOfClass(JInternalFrame.class, this)
+ == null;
+ }
+
}
diff --git a/libjava/classpath/javax/swing/JPopupMenu.java b/libjava/classpath/javax/swing/JPopupMenu.java
index d46015afdf3..1ae8adad02a 100644
--- a/libjava/classpath/javax/swing/JPopupMenu.java
+++ b/libjava/classpath/javax/swing/JPopupMenu.java
@@ -820,7 +820,14 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
*/
public void menuSelectionChanged(boolean changed)
{
- if (! changed)
+ if (invoker instanceof JMenu)
+ {
+ // We need to special case this since the JMenu calculates the
+ // position etc of the popup.
+ JMenu menu = (JMenu) invoker;
+ menu.setPopupMenuVisible(changed);
+ }
+ else if (! changed)
setVisible(false);
}
@@ -895,6 +902,20 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
}
}
+ /**
+ * Returns <code>true</code> if the component is guaranteed to be painted
+ * on top of others. This returns false by default and is overridden by
+ * components like JMenuItem, JPopupMenu and JToolTip to return true for
+ * added efficiency.
+ *
+ * @return <code>true</code> if the component is guaranteed to be painted
+ * on top of others
+ */
+ boolean onTop()
+ {
+ return true;
+ }
+
protected class AccessibleJPopupMenu extends AccessibleJComponent
{
private static final long serialVersionUID = 7423261328879849768L;
diff --git a/libjava/classpath/javax/swing/JRootPane.java b/libjava/classpath/javax/swing/JRootPane.java
index a2cd9c7a000..10fdf10c0ec 100644
--- a/libjava/classpath/javax/swing/JRootPane.java
+++ b/libjava/classpath/javax/swing/JRootPane.java
@@ -505,15 +505,21 @@ public class JRootPane extends JComponent implements Accessible
}
/**
- * DOCUMENT ME!
+ * Set the layered pane for the root pane.
*
- * @param f DOCUMENT ME!
+ * @param f The JLayeredPane to be used.
+ *
+ * @throws IllegalComponentStateException if JLayeredPane
+ * parameter is null.
*/
public void setLayeredPane(JLayeredPane f)
{
+ if (f == null)
+ throw new IllegalComponentStateException();
+
if (layeredPane != null)
remove(layeredPane);
-
+
layeredPane = f;
add(f, -1);
}
diff --git a/libjava/classpath/javax/swing/JScrollBar.java b/libjava/classpath/javax/swing/JScrollBar.java
index bf0803ab5a1..1f21aa13ff5 100644
--- a/libjava/classpath/javax/swing/JScrollBar.java
+++ b/libjava/classpath/javax/swing/JScrollBar.java
@@ -50,6 +50,8 @@ import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleState;
import javax.accessibility.AccessibleStateSet;
import javax.accessibility.AccessibleValue;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
import javax.swing.plaf.ScrollBarUI;
/**
@@ -172,6 +174,28 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
}
}
+ /**
+ * Listens for changes on the model and fires them to interested
+ * listeners on the JScrollBar, after re-sourcing them.
+ */
+ private class ScrollBarChangeListener
+ implements ChangeListener
+ {
+
+ public void stateChanged(ChangeEvent event)
+ {
+ Object o = event.getSource();
+ if (o instanceof BoundedRangeModel)
+ {
+ BoundedRangeModel m = (BoundedRangeModel) o;
+ fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
+ AdjustmentEvent.TRACK, m.getValue(),
+ m.getValueIsAdjusting());
+ }
+ }
+
+ }
+
private static final long serialVersionUID = -8195169869225066566L;
/** How much the thumb moves when moving in a block. */
@@ -186,6 +210,12 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
/** How much the thumb moves when moving in a unit. */
protected int unitIncrement = 1;
+ /**
+ * This ChangeListener forwards events fired from the model and re-sources
+ * them to originate from this JScrollBar.
+ */
+ private ChangeListener sbChangeListener;
+
/**
* Creates a new horizontal JScrollBar object with a minimum
* of 0, a maxmium of 100, a value of 0 and an extent of 10.
@@ -220,6 +250,8 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
public JScrollBar(int orientation, int value, int extent, int min, int max)
{
model = new DefaultBoundedRangeModel(value, extent, min, max);
+ sbChangeListener = new ScrollBarChangeListener();
+ model.addChangeListener(sbChangeListener);
if (orientation != SwingConstants.HORIZONTAL
&& orientation != SwingConstants.VERTICAL)
throw new IllegalArgumentException(orientation
@@ -319,12 +351,13 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
public void setModel(BoundedRangeModel newModel)
{
- if (model != newModel)
- {
- BoundedRangeModel oldModel = model;
- model = newModel;
- firePropertyChange("model", oldModel, model);
- }
+ BoundedRangeModel oldModel = model;
+ if (oldModel != null)
+ oldModel.removeChangeListener(sbChangeListener);
+ model = newModel;
+ if (model != null)
+ model.addChangeListener(sbChangeListener);
+ firePropertyChange("model", oldModel, model);
}
/**
@@ -424,12 +457,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
public void setValue(int value)
{
- if (isEnabled() && value != getValue())
- {
- model.setValue(value);
- fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
- AdjustmentEvent.TRACK, value);
- }
+ model.setValue(value);
}
/**
@@ -451,12 +479,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
public void setVisibleAmount(int extent)
{
- if (extent != getVisibleAmount())
- {
- model.setExtent(extent);
- fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
- AdjustmentEvent.TRACK, extent);
- }
+ model.setExtent(extent);
}
/**
@@ -476,12 +499,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
public void setMinimum(int minimum)
{
- if (minimum != getMinimum())
- {
- model.setMinimum(minimum);
- fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
- AdjustmentEvent.TRACK, minimum);
- }
+ model.setMinimum(minimum);
}
/**
@@ -501,12 +519,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
public void setMaximum(int maximum)
{
- if (maximum != getMaximum())
- {
- model.setMaximum(maximum);
- fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
- AdjustmentEvent.TRACK, maximum);
- }
+ model.setMaximum(maximum);
}
/**
@@ -540,17 +553,8 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
public void setValues(int newValue, int newExtent, int newMin, int newMax)
{
- if (!isEnabled())
- newValue = model.getValue();
- // It seems to be that on any change the value is fired.
- if (newValue != getValue() || newExtent != getVisibleAmount() ||
- newMin != getMinimum() || newMax != getMaximum())
- {
- model.setRangeProperties(newValue, newExtent, newMin, newMax,
- model.getValueIsAdjusting());
- fireAdjustmentValueChanged(AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
- AdjustmentEvent.TRACK, newValue);
- }
+ model.setRangeProperties(newValue, newExtent, newMin, newMax,
+ model.getValueIsAdjusting());
}
/**
@@ -596,15 +600,30 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
*/
protected void fireAdjustmentValueChanged(int id, int type, int value)
{
+ fireAdjustmentValueChanged(id, type, value, getValueIsAdjusting());
+ }
+
+ /**
+ * Helper method for firing adjustment events that can have their
+ * isAdjusting field modified.
+ *
+ * This is package private to avoid an accessor method.
+ *
+ * @param id the ID of the event
+ * @param type the type of the event
+ * @param value the value
+ * @param isAdjusting if the scrollbar is adjusting or not
+ */
+ void fireAdjustmentValueChanged(int id, int type, int value,
+ boolean isAdjusting)
+ {
Object[] adjustmentListeners = listenerList.getListenerList();
- AdjustmentEvent adjustmentEvent = new AdjustmentEvent(this,
- AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
- AdjustmentEvent.TRACK,
- value);
+ AdjustmentEvent adjustmentEvent = new AdjustmentEvent(this, id, type,
+ value, isAdjusting);
for (int i = adjustmentListeners.length - 2; i >= 0; i -= 2)
{
- if (adjustmentListeners[i] == AdjustmentListener.class)
- ((AdjustmentListener) adjustmentListeners[i + 1]).adjustmentValueChanged(adjustmentEvent);
+ if (adjustmentListeners[i] == AdjustmentListener.class)
+ ((AdjustmentListener) adjustmentListeners[i + 1]).adjustmentValueChanged(adjustmentEvent);
}
}
diff --git a/libjava/classpath/javax/swing/JScrollPane.java b/libjava/classpath/javax/swing/JScrollPane.java
index 45df1d9190e..f6d37c7b47d 100644
--- a/libjava/classpath/javax/swing/JScrollPane.java
+++ b/libjava/classpath/javax/swing/JScrollPane.java
@@ -161,9 +161,10 @@ public class JScrollPane extends JComponent
protected int verticalScrollBarPolicy;
protected JViewport viewport;
-
- Border viewportBorder;
- boolean wheelScrollingEnabled;
+
+ private Border viewportBorder;
+
+ private boolean wheelScrollingEnabled;
public JViewport getColumnHeader()
{
@@ -595,6 +596,7 @@ public class JScrollPane extends JComponent
*/
public JScrollPane(Component view, int vsbPolicy, int hsbPolicy)
{
+ wheelScrollingEnabled = true;
setVerticalScrollBarPolicy(vsbPolicy);
setVerticalScrollBar(createVerticalScrollBar());
setHorizontalScrollBarPolicy(hsbPolicy);
diff --git a/libjava/classpath/javax/swing/JSlider.java b/libjava/classpath/javax/swing/JSlider.java
index 8a06d4f0116..948a9629b4c 100644
--- a/libjava/classpath/javax/swing/JSlider.java
+++ b/libjava/classpath/javax/swing/JSlider.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package javax.swing;
-import java.awt.Dimension;
import java.awt.MenuContainer;
import java.awt.image.ImageObserver;
import java.beans.PropertyChangeEvent;
@@ -56,6 +55,7 @@ import javax.accessibility.AccessibleValue;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.SliderUI;
+import javax.swing.plaf.UIResource;
/**
* A visual component that allows selection of a value within a
@@ -112,6 +112,22 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
ImageObserver,
MenuContainer, Serializable
{
+
+ /**
+ * A little testing shows that the reference implementation creates
+ * labels from a class named LabelUIResource.
+ */
+ private class LabelUIResource
+ extends JLabel
+ implements UIResource
+ {
+ LabelUIResource(String text, int align)
+ {
+ super(text, align);
+ setName("Slider.label");
+ }
+ }
+
private static final long serialVersionUID = -1441275936141218479L;
/**
@@ -425,6 +441,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
*/
public void updateUI()
{
+ updateLabelUIs();
setUI((SliderUI) UIManager.getUI(this));
}
@@ -721,6 +738,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
int oldOrientation = this.orientation;
this.orientation = orientation;
firePropertyChange("orientation", oldOrientation, this.orientation);
+ revalidate();
}
}
@@ -751,7 +769,10 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
{
Dictionary oldTable = labelTable;
labelTable = table;
+ updateLabelUIs();
firePropertyChange("labelTable", oldTable, labelTable);
+ revalidate();
+ repaint();
}
}
@@ -761,12 +782,18 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
*/
protected void updateLabelUIs()
{
- if (labelTable == null)
- return;
- for (Enumeration list = labelTable.elements(); list.hasMoreElements();)
+ if (labelTable != null)
{
- JLabel label = (JLabel) list.nextElement();
- label.updateUI();
+ for (Enumeration list = labelTable.elements(); list.hasMoreElements();)
+ {
+ Object o = list.nextElement();
+ if (o instanceof JComponent)
+ {
+ JComponent jc = (JComponent) o;
+ jc.updateUI();
+ jc.setSize(jc.getPreferredSize());
+ }
+ }
}
}
@@ -810,23 +837,11 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
if (start < getMinimum() || start > getMaximum())
throw new IllegalArgumentException("The 'start' value is out of range.");
Hashtable table = new Hashtable();
- JLabel label;
- Dimension dim;
-
- int max = sliderModel.getMaximum();
-
+ int max = getMaximum();
for (int i = start; i <= max; i += increment)
{
- label = new JLabel(String.valueOf(i));
- label.setVerticalAlignment(CENTER);
- label.setHorizontalAlignment(CENTER);
-
- // Make sure these labels have the width and height
- // they want.
- dim = label.getPreferredSize();
- label.setBounds(label.getX(), label.getY(),
- (int) dim.getWidth(),
- (int) dim.getHeight());
+ LabelUIResource label = new LabelUIResource(String.valueOf(i),
+ JLabel.CENTER);
table.put(new Integer(i), label);
}
return table;
@@ -867,6 +882,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
boolean oldInverted = isInverted;
isInverted = inverted;
firePropertyChange("inverted", oldInverted, isInverted);
+ repaint();
}
}
@@ -898,7 +914,11 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
{
int oldSpacing = majorTickSpacing;
majorTickSpacing = spacing;
+ if (labelTable == null && majorTickSpacing > 0 && getPaintLabels())
+ setLabelTable(createStandardLabels(majorTickSpacing));
firePropertyChange("majorTickSpacing", oldSpacing, majorTickSpacing);
+ if (getPaintTicks())
+ repaint();
}
}
@@ -932,6 +952,8 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
int oldSpacing = minorTickSpacing;
minorTickSpacing = spacing;
firePropertyChange("minorTickSpacing", oldSpacing, minorTickSpacing);
+ if (getPaintTicks())
+ repaint();
}
}
@@ -1001,6 +1023,8 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
boolean oldPaintTicks = paintTicks;
paintTicks = paint;
firePropertyChange("paintTicks", oldPaintTicks, paintTicks);
+ revalidate();
+ repaint();
}
}
@@ -1031,6 +1055,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
{
paintTrack = paint;
firePropertyChange("paintTrack", !paint, paint);
+ repaint();
}
}
@@ -1062,8 +1087,10 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
{
paintLabels = paint;
if (paint && majorTickSpacing > 0 && labelTable == null)
- labelTable = createStandardLabels(majorTickSpacing);
+ setLabelTable(createStandardLabels(majorTickSpacing));
firePropertyChange("paintLabels", !paint, paint);
+ revalidate();
+ repaint();
}
}
diff --git a/libjava/classpath/javax/swing/JSplitPane.java b/libjava/classpath/javax/swing/JSplitPane.java
index 5b77f5176ae..fcdc1c04128 100644
--- a/libjava/classpath/javax/swing/JSplitPane.java
+++ b/libjava/classpath/javax/swing/JSplitPane.java
@@ -247,6 +247,11 @@ public class JSplitPane extends JComponent implements Accessible
/** The component on the right or bottom. */
protected Component rightComponent;
+ /**
+ * The divider location.
+ */
+ private int dividerLocation;
+
/** Determines how extra space should be allocated. */
private transient double resizeWeight;
@@ -288,7 +293,7 @@ public class JSplitPane extends JComponent implements Accessible
continuousLayout = newContinuousLayout;
setLeftComponent(newLeftComponent);
setRightComponent(newRightComponent);
-
+ dividerLocation = -1;
updateUI();
}
@@ -355,10 +360,6 @@ public class JSplitPane extends JComponent implements Accessible
*/
protected void addImpl(Component comp, Object constraints, int index)
{
- int left = 0;
- int right = 1;
- int div = 2;
- int place;
if (constraints == null)
{
if (leftComponent == null)
@@ -431,10 +432,7 @@ public class JSplitPane extends JComponent implements Accessible
*/
public int getDividerLocation()
{
- if (ui != null)
- return ((SplitPaneUI) ui).getDividerLocation(this);
- else
- return -1;
+ return dividerLocation;
}
/**
@@ -722,17 +720,13 @@ public class JSplitPane extends JComponent implements Accessible
*/
public void setDividerLocation(int location)
{
- if (ui != null && location != getDividerLocation())
- {
- int oldLocation = getDividerLocation();
- if (location < 0)
- ((SplitPaneUI) ui).resetToPreferredSizes(this);
- else
- ((SplitPaneUI) ui).setDividerLocation(this, location);
-
- firePropertyChange(DIVIDER_LOCATION_PROPERTY, oldLocation,
- getDividerLocation());
- }
+ int oldLocation = dividerLocation;
+ dividerLocation = location;
+ SplitPaneUI ui = getUI();
+ if (ui != null)
+ ui.setDividerLocation(this, location);
+ firePropertyChange(DIVIDER_LOCATION_PROPERTY, oldLocation,
+ location);
}
/**
diff --git a/libjava/classpath/javax/swing/JTabbedPane.java b/libjava/classpath/javax/swing/JTabbedPane.java
index 5c8d0474852..c7244bf2b71 100644
--- a/libjava/classpath/javax/swing/JTabbedPane.java
+++ b/libjava/classpath/javax/swing/JTabbedPane.java
@@ -760,11 +760,7 @@ public class JTabbedPane extends JComponent implements Serializable,
this.tabPlacement = tabPlacement;
layoutPolicy = tabLayoutPolicy;
- changeEvent = new ChangeEvent(this);
- changeListener = createChangeListener();
-
- model = new DefaultSingleSelectionModel();
- model.addChangeListener(changeListener);
+ setModel(new DefaultSingleSelectionModel());
updateUI();
}
@@ -877,16 +873,24 @@ public class JTabbedPane extends JComponent implements Serializable,
/**
* This method changes the model property of the JTabbedPane.
*
- * @param model The new model to use with the JTabbedPane.
+ * @param m The new model to use with the JTabbedPane.
*/
- public void setModel(SingleSelectionModel model)
+ public void setModel(SingleSelectionModel m)
{
- if (model != this.model)
+ if (m != model)
{
SingleSelectionModel oldModel = this.model;
- this.model.removeChangeListener(changeListener);
- this.model = model;
- this.model.addChangeListener(changeListener);
+ if (oldModel != null && changeListener != null)
+ oldModel.removeChangeListener(changeListener);
+
+ model = m;
+
+ if (model != null)
+ {
+ if (changeListener == null)
+ changeListener = createChangeListener();
+ model.addChangeListener(changeListener);
+ }
firePropertyChange("model", oldModel, this.model);
}
}
@@ -1050,7 +1054,10 @@ public class JTabbedPane extends JComponent implements Serializable,
}
if (getSelectedIndex() == -1)
- setSelectedIndex(0);
+ {
+ setSelectedIndex(0);
+ fireStateChanged();
+ }
revalidate();
repaint();
diff --git a/libjava/classpath/javax/swing/JTable.java b/libjava/classpath/javax/swing/JTable.java
index 5c7bff5d019..42563e6a2ca 100644
--- a/libjava/classpath/javax/swing/JTable.java
+++ b/libjava/classpath/javax/swing/JTable.java
@@ -2635,6 +2635,7 @@ public class JTable
setModel(dm == null ? createDefaultDataModel() : dm);
setAutoCreateColumnsFromModel(autoCreate);
initializeLocalVars();
+
// The following four lines properly set the lead selection indices.
// After this, the UI will handle the lead selection indices.
// FIXME: this should probably not be necessary, if the UI is installed
@@ -2642,11 +2643,13 @@ public class JTable
// own, but certain variables need to be set before the UI can be installed
// so we must get the correct order for all the method calls in this
// constructor.
- selectionModel.setAnchorSelectionIndex(0);
- selectionModel.setLeadSelectionIndex(0);
- columnModel.getSelectionModel().setAnchorSelectionIndex(0);
- columnModel.getSelectionModel().setLeadSelectionIndex(0);
- updateUI();
+ // These four lines are not needed. A Mauve test that shows this is
+ // gnu.testlet.javax.swing.JTable.constructors(linesNotNeeded).
+ // selectionModel.setAnchorSelectionIndex(-1);
+ // selectionModel.setLeadSelectionIndex(-1);
+ // columnModel.getSelectionModel().setAnchorSelectionIndex(-1);
+ // columnModel.getSelectionModel().setLeadSelectionIndex(-1);
+ updateUI();
}
/**
@@ -2675,10 +2678,12 @@ public class JTable
setRowHeight(16);
this.rowMargin = 1;
this.rowSelectionAllowed = true;
+
// this.accessibleContext = new AccessibleJTable();
this.cellEditor = null;
+
// COMPAT: Both Sun and IBM have drag enabled
- this.dragEnabled = true;
+ this.dragEnabled = false;
this.preferredViewportSize = new Dimension(450,400);
this.showHorizontalLines = true;
this.showVerticalLines = true;
@@ -3267,7 +3272,7 @@ public class JTable
cellRect.x += cMargin / 2;
cellRect.width -= cMargin;
}
- }
+ }
return cellRect;
}
@@ -3303,10 +3308,21 @@ public class JTable
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
{
- if (orientation == SwingConstants.VERTICAL)
- return visibleRect.height * direction;
+ int block;
+ if (orientation == SwingConstants.HORIZONTAL)
+ {
+ block = visibleRect.width;
+ }
else
- return visibleRect.width * direction;
+ {
+ int rowHeight = getRowHeight();
+ if (rowHeight > 0)
+ block = Math.max(rowHeight, // Little hack for useful rounding.
+ (visibleRect.height / rowHeight) * rowHeight);
+ else
+ block = visibleRect.height;
+ }
+ return block;
}
/**
@@ -3345,24 +3361,40 @@ public class JTable
* The values greater than one means that more mouse wheel or similar
* events were generated, and hence it is better to scroll the longer
* distance.
- * @author Audrius Meskauskas (audriusa@bioinformatics.org)
+ *
+ * @author Roman Kennke (kennke@aicas.com)
*/
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation,
int direction)
{
- int h = (rowHeight + rowMargin);
- int delta = h * direction;
-
- // Round so that the top would start from the row boundary
- if (orientation == SwingConstants.VERTICAL)
+ int unit;
+ if (orientation == SwingConstants.HORIZONTAL)
+ unit = 100;
+ else
{
- // Completely expose the top row
- int near = ((visibleRect.y + delta + h / 2) / h) * h;
- int diff = visibleRect.y + delta - near;
- delta -= diff;
+ unit = getRowHeight();
+ // The following adjustment doesn't work for variable height rows.
+ // It fully exposes partially visible rows in the scrolling direction.
+ if (rowHeights == null)
+ {
+ if (direction > 0)
+ {
+ // Scroll down.
+ // How much pixles are exposed from the last item?
+ int exposed = (visibleRect.y + visibleRect.height) % unit;
+ if (exposed > 0 && exposed < unit - 1)
+ unit = unit - exposed - 1;
+ }
+ else
+ {
+ // Scroll up.
+ int exposed = visibleRect.y % unit;
+ if (exposed > 0 && exposed < unit)
+ unit = exposed;
+ }
+ }
}
- return delta;
- // TODO when scrollng horizontally, scroll into the column boundary.
+ return unit;
}
/**
@@ -3397,7 +3429,7 @@ public class JTable
*
* @return the editor, suitable for editing this data type
*/
- public TableCellEditor getDefaultEditor(Class columnClass)
+ public TableCellEditor getDefaultEditor(Class<?> columnClass)
{
if (defaultEditorsByColumnClass.containsKey(columnClass))
return (TableCellEditor) defaultEditorsByColumnClass.get(columnClass);
@@ -3409,7 +3441,7 @@ public class JTable
return r;
}
}
-
+
/**
* Get the cell renderer for rendering the given cell.
*
@@ -3419,7 +3451,9 @@ public class JTable
*/
public TableCellRenderer getCellRenderer(int row, int column)
{
- TableCellRenderer renderer = columnModel.getColumn(column).getCellRenderer();
+ TableCellRenderer renderer = null;
+ if (columnModel.getColumnCount() > 0)
+ renderer = columnModel.getColumn(column).getCellRenderer();
if (renderer == null)
{
int mcolumn = convertColumnIndexToModel(column);
@@ -3427,7 +3461,7 @@ public class JTable
}
return renderer;
}
-
+
/**
* Set default renderer for rendering the given data type.
*
@@ -3435,11 +3469,11 @@ public class JTable
* rendered.
* @param rend the renderer that will rend this data type
*/
- public void setDefaultRenderer(Class columnClass, TableCellRenderer rend)
+ public void setDefaultRenderer(Class<?> columnClass, TableCellRenderer rend)
{
defaultRenderersByColumnClass.put(columnClass, rend);
}
-
+
/**
* Get the default renderer for rendering the given data type.
*
@@ -3447,7 +3481,7 @@ public class JTable
*
* @return the appropriate defauld renderer for rendering that data type.
*/
- public TableCellRenderer getDefaultRenderer(Class columnClass)
+ public TableCellRenderer getDefaultRenderer(Class<?> columnClass)
{
if (defaultRenderersByColumnClass.containsKey(columnClass))
return (TableCellRenderer) defaultRenderersByColumnClass.get(columnClass);
@@ -3536,7 +3570,7 @@ public class JTable
return renderer.getTableCellRendererComponent(this,
dataModel.getValueAt(row,
- convertColumnIndexToModel(column)),
+ convertColumnIndexToModel(column)),
isSel,
hasFocus,
row, column);
@@ -4414,7 +4448,7 @@ public class JTable
{
TableColumn resizingColumn = null;
- int ncols = getColumnCount();
+ int ncols = columnModel.getColumnCount();
if (ncols < 1)
return;
@@ -4423,7 +4457,7 @@ public class JTable
if (tableHeader != null)
resizingColumn = tableHeader.getResizingColumn();
-
+
for (int i = 0; i < ncols; ++i)
{
TableColumn col = columnModel.getColumn(i);
@@ -4432,7 +4466,7 @@ public class JTable
if (resizingColumn == col)
rCol = i;
}
-
+
int spill = getWidth() - prefSum;
if (resizingColumn != null)
@@ -4498,9 +4532,11 @@ public class JTable
}
else
{
- TableColumn [] cols = new TableColumn[ncols];
+ TableColumn[] cols = new TableColumn[ncols];
+
for (int i = 0; i < ncols; ++i)
cols[i] = columnModel.getColumn(i);
+
distributeSpill(cols, spill);
}
@@ -4588,7 +4624,7 @@ public class JTable
{
setUI((TableUI) UIManager.getUI(this));
}
-
+
/**
* Get the class (datatype) of the column. The cells are rendered and edited
* differently, depending from they data type.
@@ -4598,7 +4634,7 @@ public class JTable
* @return the class, defining data type of that column (String.class for
* String, Boolean.class for boolean and so on).
*/
- public Class getColumnClass(int column)
+ public Class<?> getColumnClass(int column)
{
return getModel().getColumnClass(convertColumnIndexToModel(column));
}
@@ -4619,7 +4655,7 @@ public class JTable
int modelColumn = columnModel.getColumn(column).getModelIndex();
return dataModel.getColumnName(modelColumn);
}
-
+
/**
* Get the column, currently being edited
*
@@ -4629,7 +4665,7 @@ public class JTable
{
return editingColumn;
}
-
+
/**
* Set the column, currently being edited
*
@@ -4649,7 +4685,7 @@ public class JTable
{
return editingRow;
}
-
+
/**
* Set the row currently being edited.
*
@@ -4680,7 +4716,7 @@ public class JTable
{
return editorComp != null;
}
-
+
/**
* Set the default editor for the given column class (column data type).
* By default, String is handled by text field and Boolean is handled by
@@ -4691,7 +4727,7 @@ public class JTable
*
* @see TableModel#getColumnClass(int)
*/
- public void setDefaultEditor(Class columnClass, TableCellEditor editor)
+ public void setDefaultEditor(Class<?> columnClass, TableCellEditor editor)
{
if (editor != null)
defaultEditorsByColumnClass.put(columnClass, editor);
@@ -4713,7 +4749,7 @@ public class JTable
if ((index0 < 0 || index0 > (getRowCount()-1)
|| index1 < 0 || index1 > (getRowCount()-1)))
throw new IllegalArgumentException("Row index out of range.");
-
+
getSelectionModel().addSelectionInterval(index0, index1);
}
diff --git a/libjava/classpath/javax/swing/JTextField.java b/libjava/classpath/javax/swing/JTextField.java
index 367503b739f..ace358f8922 100644
--- a/libjava/classpath/javax/swing/JTextField.java
+++ b/libjava/classpath/javax/swing/JTextField.java
@@ -270,7 +270,8 @@ public class JTextField extends JTextComponent
*/
protected void fireActionPerformed()
{
- ActionEvent event = new ActionEvent(this, 0, getText());
+ ActionEvent event = new ActionEvent(this, 0,
+ actionCommand == null ? getText() : actionCommand);
ActionListener[] listeners = getActionListeners();
for (int index = 0; index < listeners.length; ++index)
diff --git a/libjava/classpath/javax/swing/JTextPane.java b/libjava/classpath/javax/swing/JTextPane.java
index c0a5f80cfc8..05968fc8c20 100644
--- a/libjava/classpath/javax/swing/JTextPane.java
+++ b/libjava/classpath/javax/swing/JTextPane.java
@@ -214,20 +214,11 @@ public class JTextPane
*/
public void insertIcon(Icon icon)
{
- SimpleAttributeSet atts = new SimpleAttributeSet();
- atts.addAttribute(StyleConstants.IconAttribute, icon);
- atts.addAttribute(StyleConstants.NameAttribute,
- StyleConstants.IconElementName);
- try
- {
- getDocument().insertString(getCaret().getDot(), " ", atts);
- }
- catch (BadLocationException ex)
- {
- AssertionError err = new AssertionError("Unexpected bad location");
- err.initCause(ex);
- throw err;
- }
+ MutableAttributeSet inputAtts = getInputAttributes();
+ inputAtts.removeAttributes(inputAtts);
+ StyleConstants.setIcon(inputAtts, icon);
+ replaceSelection(" ");
+ inputAtts.removeAttributes(inputAtts);
}
/**
diff --git a/libjava/classpath/javax/swing/JToggleButton.java b/libjava/classpath/javax/swing/JToggleButton.java
index 1769c5ee08a..60c44896019 100644
--- a/libjava/classpath/javax/swing/JToggleButton.java
+++ b/libjava/classpath/javax/swing/JToggleButton.java
@@ -1,5 +1,5 @@
/* JToggleButton.java --
- Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -291,9 +291,8 @@ public class JToggleButton extends AbstractButton implements Accessible
public JToggleButton (String text, Icon icon, boolean selected)
{
super();
+ setModel(new ToggleButtonModel());
init(text, icon);
-
- setModel(new ToggleButtonModel());
model.setSelected(selected);
setAlignmentX(LEFT_ALIGNMENT);
}
diff --git a/libjava/classpath/javax/swing/JToolTip.java b/libjava/classpath/javax/swing/JToolTip.java
index 836c122c6bf..3153894da81 100644
--- a/libjava/classpath/javax/swing/JToolTip.java
+++ b/libjava/classpath/javax/swing/JToolTip.java
@@ -225,4 +225,18 @@ public class JToolTip extends JComponent implements Accessible
{
setUI((ToolTipUI) UIManager.getUI(this));
}
+
+ /**
+ * Returns <code>true</code> if the component is guaranteed to be painted
+ * on top of others. This returns false by default and is overridden by
+ * components like JMenuItem, JPopupMenu and JToolTip to return true for
+ * added efficiency.
+ *
+ * @return <code>true</code> if the component is guaranteed to be painted
+ * on top of others
+ */
+ boolean onTop()
+ {
+ return true;
+ }
}
diff --git a/libjava/classpath/javax/swing/JTree.java b/libjava/classpath/javax/swing/JTree.java
index fa898c5a940..332ec74247d 100644
--- a/libjava/classpath/javax/swing/JTree.java
+++ b/libjava/classpath/javax/swing/JTree.java
@@ -1230,8 +1230,32 @@ public class JTree extends JComponent implements Scrollable, Accessible
*/
public void treeNodesRemoved(TreeModelEvent ev)
{
- // TODO: The API docs suggest that this method should do something
- // but I cannot really see what has to be done here ...
+ if (ev != null)
+ {
+ TreePath parent = ev.getTreePath();
+ Object[] children = ev.getChildren();
+ TreeSelectionModel sm = getSelectionModel();
+ if (children != null)
+ {
+ TreePath path;
+ Vector toRemove = new Vector();
+ // Collect items that we must remove.
+ for (int i = children.length - 1; i >= 0; i--)
+ {
+ path = parent.pathByAddingChild(children[i]);
+ if (nodeStates.containsKey(path))
+ toRemove.add(path);
+ // Clear selection while we are at it.
+ if (sm != null)
+ removeDescendantSelectedPaths(path, true);
+ }
+ if (toRemove.size() > 0)
+ removeDescendantToggledPaths(toRemove.elements());
+ TreeModel model = getModel();
+ if (model == null || model.isLeaf(parent.getLastPathComponent()))
+ nodeStates.remove(parent);
+ }
+ }
}
/**
@@ -1243,9 +1267,38 @@ public class JTree extends JComponent implements Scrollable, Accessible
*/
public void treeStructureChanged(TreeModelEvent ev)
{
- // Set state of new path.
- TreePath path = ev.getTreePath();
- setExpandedState(path, isExpanded(path));
+ if (ev != null)
+ {
+ TreePath parent = ev.getTreePath();
+ if (parent != null)
+ {
+ if (parent.getPathCount() == 1)
+ {
+ // We have a new root, clear everything.
+ clearToggledPaths();
+ Object root = treeModel.getRoot();
+ if (root != null && treeModel.isLeaf(root))
+ nodeStates.put(parent, Boolean.TRUE);
+ }
+ else if (nodeStates.containsKey(parent))
+ {
+ Vector toRemove = new Vector();
+ boolean expanded = isExpanded(parent);
+ toRemove.add(parent);
+ removeDescendantToggledPaths(toRemove.elements());
+ if (expanded)
+ {
+ TreeModel model = getModel();
+ if (model != null
+ || model.isLeaf(parent.getLastPathComponent()))
+ collapsePath(parent);
+ else
+ nodeStates.put(parent, Boolean.TRUE);
+ }
+ }
+ removeDescendantSelectedPaths(parent, false);
+ }
+ }
}
}
@@ -1279,13 +1332,6 @@ public class JTree extends JComponent implements Scrollable, Accessible
TreeSelectionEvent rewritten =
(TreeSelectionEvent) ev.cloneWithSource(JTree.this);
fireValueChanged(rewritten);
-
- // Only repaint the changed nodes.
- TreePath[] changed = ev.getPaths();
- for (int i = 0; i < changed.length; i++)
- {
- repaint(getPathBounds(changed[i]));
- }
}
}
@@ -1406,8 +1452,10 @@ public class JTree extends JComponent implements Scrollable, Accessible
* This contains the state of all nodes in the tree. Al/ entries map the
* TreePath of a note to to its state. Valid states are EXPANDED and
* COLLAPSED. Nodes not in this Hashtable are assumed state COLLAPSED.
+ *
+ * This is package private to avoid accessor methods.
*/
- private Hashtable nodeStates = new Hashtable();
+ Hashtable nodeStates = new Hashtable();
protected transient TreeCellEditor cellEditor;
@@ -1486,7 +1534,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
*
* @param value the initial nodes in the tree
*/
- public JTree(Hashtable value)
+ public JTree(Hashtable<?, ?> value)
{
this(createTreeModel(value));
}
@@ -1509,8 +1557,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
public JTree(TreeModel model)
{
setRootVisible(true);
- setSelectionModel(new EmptySelectionModel());
- selectionModel.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
+ setSelectionModel( new DefaultTreeSelectionModel() );
// The root node appears expanded by default.
nodeStates = new Hashtable();
@@ -1554,7 +1601,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
*
* @param value the initial nodes in the tree
*/
- public JTree(Vector value)
+ public JTree(Vector<?> value)
{
this(createTreeModel(value));
}
@@ -1685,29 +1732,52 @@ public class JTree extends JComponent implements Scrollable, Accessible
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation,
int direction)
{
- int delta;
+ int delta = 0;
// Round so that the top would start from the row boundary
if (orientation == SwingConstants.VERTICAL)
{
- // One pixel down, otherwise picks another row too high.
- int row = getClosestRowForLocation(visibleRect.x, visibleRect.y + 1);
- row = row + direction;
- if (row < 0)
- row = 0;
-
- Rectangle newTop = getRowBounds(row);
- delta = newTop.y - visibleRect.y;
+ int row = getClosestRowForLocation(0, visibleRect.y);
+ if (row != -1)
+ {
+ Rectangle b = getRowBounds(row);
+ if (b.y != visibleRect.y)
+ {
+ if (direction < 0)
+ delta = Math.max(0, visibleRect.y - b.y);
+ else
+ delta = b.y + b.height - visibleRect.y;
+ }
+ else
+ {
+ if (direction < 0)
+ {
+ if (row != 0)
+ {
+ b = getRowBounds(row - 1);
+ delta = b.height;
+ }
+ }
+ else
+ delta = b.height;
+ }
+ }
}
else
- delta = direction * rowHeight == 0 ? 20 : rowHeight;
+ // The RI always returns 4 for HORIZONTAL scrolling.
+ delta = 4;
return delta;
}
public int getScrollableBlockIncrement(Rectangle visibleRect,
int orientation, int direction)
{
- return getScrollableUnitIncrement(visibleRect, orientation, direction);
+ int block;
+ if (orientation == SwingConstants.VERTICAL)
+ block = visibleRect.height;
+ else
+ block = visibleRect.width;
+ return block;
}
public boolean getScrollableTracksViewportHeight()
@@ -2050,14 +2120,16 @@ public class JTree extends JComponent implements Scrollable, Accessible
if (selectionModel == model)
return;
+ if( model == null )
+ model = EmptySelectionModel.sharedInstance();
+
if (selectionModel != null)
selectionModel.removeTreeSelectionListener(selectionRedirector);
TreeSelectionModel oldValue = selectionModel;
selectionModel = model;
- if (selectionModel != null)
- selectionModel.addTreeSelectionListener(selectionRedirector);
+ selectionModel.addTreeSelectionListener(selectionRedirector);
firePropertyChange(SELECTION_MODEL_PROPERTY, oldValue, model);
revalidate();
@@ -2184,20 +2256,35 @@ public class JTree extends JComponent implements Scrollable, Accessible
public void setSelectionPath(TreePath path)
{
+ clearSelectionPathStates();
selectionModel.setSelectionPath(path);
}
public void setSelectionPaths(TreePath[] paths)
{
+ clearSelectionPathStates();
selectionModel.setSelectionPaths(paths);
}
+
+ /**
+ * This method, and all calls to it, should be removed once the
+ * DefaultTreeModel fires events properly. Maintenance of the nodeStates
+ * table should really be done in the TreeModelHandler.
+ */
+ private void clearSelectionPathStates()
+ {
+ TreePath[] oldPaths = selectionModel.getSelectionPaths();
+ if (oldPaths != null)
+ for (int i = 0; i < oldPaths.length; i++)
+ nodeStates.remove(oldPaths[i]);
+ }
public void setSelectionRow(int row)
{
TreePath path = getPathForRow(row);
if (path != null)
- selectionModel.setSelectionPath(path);
+ setSelectionPath(path);
}
public void setSelectionRows(int[] rows)
@@ -2272,11 +2359,13 @@ public class JTree extends JComponent implements Scrollable, Accessible
public void removeSelectionPath(TreePath path)
{
+ clearSelectionPathStates();
selectionModel.removeSelectionPath(path);
}
public void removeSelectionPaths(TreePath[] paths)
{
+ clearSelectionPathStates();
selectionModel.removeSelectionPaths(paths);
}
@@ -2285,7 +2374,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
TreePath path = getPathForRow(row);
if (path != null)
- selectionModel.removeSelectionPath(path);
+ removeSelectionPath(path);
}
public void removeSelectionRows(int[] rows)
@@ -2331,7 +2420,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
if (selectionModel != null)
{
TreePath oldValue = selectionModel.getLeadSelectionPath();
- if (path.equals(oldValue))
+ if (path == oldValue || path != null && path.equals(oldValue))
return;
// Repaint the previous and current rows with the lead selection path.
@@ -2409,9 +2498,19 @@ public class JTree extends JComponent implements Scrollable, Accessible
return selectionModel.isPathSelected(path);
}
+ /**
+ * Returns <code>true</code> when the specified row is selected,
+ * <code>false</code> otherwise. This call is delegated to the
+ * {@link TreeSelectionModel#isRowSelected(int)} method.
+ *
+ * @param row the row to check
+ *
+ * @return <code>true</code> when the specified row is selected,
+ * <code>false</code> otherwise
+ */
public boolean isRowSelected(int row)
{
- return selectionModel.isPathSelected(getPathForRow(row));
+ return selectionModel.isRowSelected(row);
}
public boolean isSelectionEmpty()
@@ -2725,7 +2824,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
nodeStates.clear();
}
- protected Enumeration getDescendantToggledPaths(TreePath parent)
+ protected Enumeration<TreePath> getDescendantToggledPaths(TreePath parent)
{
if (parent == null)
return null;
@@ -2874,7 +2973,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
*
* @return An Enumeration containing TreePath objects
*/
- public Enumeration getExpandedDescendants(TreePath path)
+ public Enumeration<TreePath> getExpandedDescendants(TreePath path)
{
Enumeration paths = nodeStates.keys();
Vector relevantPaths = new Vector();
@@ -3002,7 +3101,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
* @param toRemove - Enumeration of TreePaths that need to be removed from
* cache of toggled tree paths.
*/
- protected void removeDescendantToggledPaths(Enumeration toRemove)
+ protected void removeDescendantToggledPaths(Enumeration<TreePath> toRemove)
{
while (toRemove.hasMoreElements())
{
diff --git a/libjava/classpath/javax/swing/JViewport.java b/libjava/classpath/javax/swing/JViewport.java
index 7cf393996c3..d90da1d157b 100644
--- a/libjava/classpath/javax/swing/JViewport.java
+++ b/libjava/classpath/javax/swing/JViewport.java
@@ -157,6 +157,9 @@ public class JViewport extends JComponent implements Accessible
*/
public void componentResized(ComponentEvent ev)
{
+ // Fire state change, because resizing the view means changing the
+ // extentSize.
+ fireStateChanged();
revalidate();
}
}
@@ -198,22 +201,6 @@ public class JViewport extends JComponent implements Accessible
int scrollMode;
- /**
- * The width and height of the Viewport's area in terms of view
- * coordinates. Typically this will be the same as the width and height
- * of the viewport's bounds, unless the viewport transforms units of
- * width and height, which it may do, for example if it magnifies or
- * rotates its view.
- *
- * @see #toViewCoordinates(Dimension)
- */
- Dimension extentSize;
-
- /**
- * The width and height of the view in its own coordinate space.
- */
- Dimension viewSize;
-
/**
* The ViewListener instance.
*/
@@ -265,8 +252,7 @@ public class JViewport extends JComponent implements Accessible
static
{
String scrollModeProp =
- SystemProperties.getProperty("gnu.javax.swing.JViewport.scrollMode",
- "BLIT");
+ SystemProperties.getProperty("gnu.swing.scrollmode", "BACKINGSTORE");
if (scrollModeProp.equalsIgnoreCase("simple"))
defaultScrollMode = SIMPLE_SCROLL_MODE;
else if (scrollModeProp.equalsIgnoreCase("backingstore"))
@@ -290,10 +276,7 @@ public class JViewport extends JComponent implements Accessible
public Dimension getExtentSize()
{
- if (extentSize == null)
- return toViewCoordinates(getSize());
- else
- return extentSize;
+ return getSize();
}
public Dimension toViewCoordinates(Dimension size)
@@ -310,8 +293,12 @@ public class JViewport extends JComponent implements Accessible
public void setExtentSize(Dimension newSize)
{
- extentSize = newSize;
- fireStateChanged();
+ Dimension oldExtent = getExtentSize();
+ if (! newSize.equals(oldExtent))
+ {
+ setSize(newSize);
+ fireStateChanged();
+ }
}
/**
@@ -321,32 +308,34 @@ public class JViewport extends JComponent implements Accessible
*/
public Dimension getViewSize()
{
- if (isViewSizeSet)
- return viewSize;
- else
+ Dimension size;
+ Component view = getView();
+ if (view != null)
{
- Component view = getView();
- if (view != null)
- return view.getPreferredSize();
- else
- return new Dimension();
+ if (isViewSizeSet)
+ size = view.getSize();
+ else
+ size = view.getPreferredSize();
}
+ else
+ size = new Dimension(0, 0);
+ return size;
}
public void setViewSize(Dimension newSize)
{
- viewSize = newSize;
Component view = getView();
if (view != null)
{
- if (newSize != view.getSize())
+ if (! newSize.equals(view.getSize()))
{
- view.setSize(viewSize);
+ scrollUnderway = false;
+ view.setSize(newSize);
+ isViewSizeSet = true;
fireStateChanged();
}
}
- isViewSizeSet = true;
}
/**
@@ -371,23 +360,18 @@ public class JViewport extends JComponent implements Accessible
public void setViewPosition(Point p)
{
- if (getViewPosition().equals(p))
- return;
Component view = getView();
- if (view != null)
+ if (view != null && ! p.equals(getViewPosition()))
{
- Point q = new Point(-p.x, -p.y);
- view.setLocation(q);
- isViewSizeSet = false;
+ scrollUnderway = true;
+ view.setLocation(-p.x, -p.y);
fireStateChanged();
}
- repaint();
}
public Rectangle getViewRect()
{
- return new Rectangle(getViewPosition(),
- getExtentSize());
+ return new Rectangle(getViewPosition(), getExtentSize());
}
/**
@@ -495,7 +479,6 @@ public class JViewport extends JComponent implements Accessible
if (view == null)
return;
- Point pos = getViewPosition();
Rectangle viewBounds = view.getBounds();
Rectangle portBounds = getBounds();
@@ -643,19 +626,11 @@ public class JViewport extends JComponent implements Accessible
*/
public void repaint(long tm, int x, int y, int w, int h)
{
-// Component parent = getParent();
-// if (parent != null)
-// parent.repaint(tm, x + getX(), y + getY(), w, h);
-// else
-// super.repaint(tm, x, y, w, h);
-
- // The specs suggest to implement something like the above. This however
- // breaks blit painting, because the parent (most likely a JScrollPane)
- // clears the background of the offscreen area of the JViewport, thus
- // destroying the pieces that we want to clip. So we simply call super here
- // instead.
- super.repaint(tm, x, y, w, h);
-
+ Component parent = getParent();
+ if (parent != null)
+ parent.repaint(tm, x + getX(), y + getY(), w, h);
+ else
+ super.repaint(tm, x, y, w, h);
}
protected void addImpl(Component comp, Object constraints, int index)
@@ -862,10 +837,13 @@ public class JViewport extends JComponent implements Accessible
if (canBlit)
{
// Copy the part that remains visible during scrolling.
- g2.copyArea(cachedBlitFrom.x, cachedBlitFrom.y,
- cachedBlitSize.width, cachedBlitSize.height,
- cachedBlitTo.x - cachedBlitFrom.x,
- cachedBlitTo.y - cachedBlitFrom.y);
+ if (cachedBlitSize.width > 0 && cachedBlitSize.height > 0)
+ {
+ g2.copyArea(cachedBlitFrom.x, cachedBlitFrom.y,
+ cachedBlitSize.width, cachedBlitSize.height,
+ cachedBlitTo.x - cachedBlitFrom.x,
+ cachedBlitTo.y - cachedBlitFrom.y);
+ }
// Now paint the part that becomes newly visible.
g2.setClip(cachedBlitPaint.x, cachedBlitPaint.y,
cachedBlitPaint.width, cachedBlitPaint.height);
@@ -913,10 +891,13 @@ public class JViewport extends JComponent implements Accessible
if (canBlit && isPaintRoot)
{
// Copy the part that remains visible during scrolling.
- g.copyArea(cachedBlitFrom.x, cachedBlitFrom.y,
- cachedBlitSize.width, cachedBlitSize.height,
- cachedBlitTo.x - cachedBlitFrom.x,
- cachedBlitTo.y - cachedBlitFrom.y);
+ if (cachedBlitSize.width > 0 && cachedBlitSize.width > 0)
+ {
+ g.copyArea(cachedBlitFrom.x, cachedBlitFrom.y,
+ cachedBlitSize.width, cachedBlitSize.height,
+ cachedBlitTo.x - cachedBlitFrom.x,
+ cachedBlitTo.y - cachedBlitFrom.y);
+ }
// Now paint the part that becomes newly visible.
Shape oldClip = g.getClip();
g.clipRect(cachedBlitPaint.x, cachedBlitPaint.y,
@@ -940,12 +921,24 @@ public class JViewport extends JComponent implements Accessible
/**
* Overridden from JComponent to set the {@link #isPaintRoot} flag.
*
- * @param r the rectangle to paint
+ * @param x the rectangle to paint, X coordinate
+ * @param y the rectangle to paint, Y coordinate
+ * @param w the rectangle to paint, width
+ * @param h the rectangle to paint, height
*/
- void paintImmediately2(Rectangle r)
+ void paintImmediately2(int x, int y, int w, int h)
{
isPaintRoot = true;
- super.paintImmediately2(r);
+ super.paintImmediately2(x, y, w, h);
isPaintRoot = false;
}
+
+ /**
+ * Returns true when the JViewport is using a backbuffer, so that we
+ * can update our backbuffer correctly.
+ */
+ boolean isPaintRoot()
+ {
+ return scrollMode == BACKINGSTORE_SCROLL_MODE;
+ }
}
diff --git a/libjava/classpath/javax/swing/JWindow.java b/libjava/classpath/javax/swing/JWindow.java
index 19d830ed1f7..b36b8cf2a60 100644
--- a/libjava/classpath/javax/swing/JWindow.java
+++ b/libjava/classpath/javax/swing/JWindow.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.swing;
+import java.awt.AWTEvent;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
@@ -158,6 +159,10 @@ public class JWindow extends Window implements Accessible, RootPaneContainer
protected void windowInit()
{
+ // We need to explicitly enable events here so that our processKeyEvent()
+ // and processWindowEvent() gets called.
+ enableEvents(AWTEvent.KEY_EVENT_MASK);
+
super.setLayout(new BorderLayout(1, 1));
getRootPane(); // will do set/create
// Now we're done init stage, adds and layouts go to content pane.
diff --git a/libjava/classpath/javax/swing/LookAndFeel.java b/libjava/classpath/javax/swing/LookAndFeel.java
index be543439636..d995bc9e981 100644
--- a/libjava/classpath/javax/swing/LookAndFeel.java
+++ b/libjava/classpath/javax/swing/LookAndFeel.java
@@ -284,7 +284,7 @@ public abstract class LookAndFeel
* @return A {@link UIDefaults.LazyValue} that serves up an
* {@link IconUIResource}.
*/
- public static Object makeIcon(Class baseClass, String gifFile)
+ public static Object makeIcon(Class<?> baseClass, String gifFile)
{
final URL file = baseClass.getResource(gifFile);
return new UIDefaults.LazyValue()
diff --git a/libjava/classpath/javax/swing/Popup.java b/libjava/classpath/javax/swing/Popup.java
index 308cd662d8d..5074d64186c 100644
--- a/libjava/classpath/javax/swing/Popup.java
+++ b/libjava/classpath/javax/swing/Popup.java
@@ -284,7 +284,7 @@ public class Popup
panel.setSize(contents.getSize());
Point layeredPaneLoc = layeredPane.getLocationOnScreen();
panel.setLocation(x - layeredPaneLoc.x, y - layeredPaneLoc.y);
- layeredPane.add(panel, JLayeredPane.POPUP_LAYER);
+ layeredPane.add(panel, JLayeredPane.POPUP_LAYER, 0);
panel.repaint();
}
diff --git a/libjava/classpath/javax/swing/RepaintManager.java b/libjava/classpath/javax/swing/RepaintManager.java
index 80f0a3481cd..773371489d9 100644
--- a/libjava/classpath/javax/swing/RepaintManager.java
+++ b/libjava/classpath/javax/swing/RepaintManager.java
@@ -38,21 +38,29 @@ exception statement from your version. */
package javax.swing;
+import gnu.classpath.SystemProperties;
+import gnu.java.awt.LowPriorityEvent;
+
+import java.applet.Applet;
import java.awt.Component;
import java.awt.Dimension;
+import java.awt.EventQueue;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Rectangle;
+import java.awt.Toolkit;
import java.awt.Window;
+import java.awt.event.InvocationEvent;
import java.awt.image.VolatileImage;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
+import javax.swing.text.JTextComponent;
+
/**
* <p>The repaint manager holds a set of dirty regions, invalid components,
* and a double buffer surface. The dirty regions and invalid components
@@ -64,6 +72,7 @@ import java.util.WeakHashMap;
* <p>See <a
* href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">this
* document</a> for more details.</p>
+ * document</a> for more details.</p>
*
* @author Roman Kennke (kennke@aicas.com)
* @author Graydon Hoare (graydon@redhat.com)
@@ -72,6 +81,44 @@ import java.util.WeakHashMap;
public class RepaintManager
{
/**
+ * An InvocationEvent subclass that implements LowPriorityEvent. This is used
+ * to defer the execution of RepaintManager requests as long as possible on
+ * the event queue. This way we make sure that all available input is
+ * processed before getting active with the RepaintManager. This allows
+ * for better optimization (more validate and repaint requests can be
+ * coalesced) and thus has a positive effect on performance for GUI
+ * applications under heavy load.
+ */
+ private static class RepaintWorkerEvent
+ extends InvocationEvent
+ implements LowPriorityEvent
+ {
+
+ /**
+ * Creates a new RepaintManager event.
+ *
+ * @param source the source
+ * @param runnable the runnable to execute
+ */
+ public RepaintWorkerEvent(Object source, Runnable runnable,
+ Object notifier, boolean catchEx)
+ {
+ super(source, runnable, notifier, catchEx);
+ }
+
+ /**
+ * An application that I met implements its own event dispatching and
+ * calls dispatch() via reflection, and only checks declared methods,
+ * that is, it expects this method to be in the event's class, not
+ * in a superclass. So I put this in here... sigh.
+ */
+ public void dispatch()
+ {
+ super.dispatch();
+ }
+ }
+
+ /**
* The current repaint managers, indexed by their ThreadGroups.
*/
static WeakHashMap currentRepaintManagers;
@@ -197,19 +244,6 @@ public class RepaintManager
private WeakHashMap offscreenBuffers;
/**
- * Indicates if the RepaintManager is currently repainting an area.
- */
- private boolean repaintUnderway;
-
- /**
- * This holds buffer commit requests when the RepaintManager is working.
- * This maps Component objects (the top level components) to Rectangle
- * objects (the area of the corresponding buffer that must be blitted on
- * the component).
- */
- private HashMap commitRequests;
-
- /**
* The maximum width and height to allocate as a double buffer. Requests
* beyond this size are ignored.
*
@@ -230,10 +264,10 @@ public class RepaintManager
invalidComponents = new ArrayList();
repaintWorker = new RepaintWorker();
doubleBufferMaximumSize = new Dimension(2000,2000);
- doubleBufferingEnabled = true;
+ doubleBufferingEnabled =
+ SystemProperties.getProperty("gnu.swing.doublebuffering", "true")
+ .equals("true");
offscreenBuffers = new WeakHashMap();
- repaintUnderway = false;
- commitRequests = new HashMap();
}
/**
@@ -355,7 +389,7 @@ public class RepaintManager
if (! repaintWorker.isLive())
{
repaintWorker.setLive(true);
- SwingUtilities.invokeLater(repaintWorker);
+ invokeLater(repaintWorker);
}
}
@@ -397,23 +431,21 @@ public class RepaintManager
{
if (w <= 0 || h <= 0 || !component.isShowing())
return;
-
- Component parent = component.getParent();
-
component.computeVisibleRect(rectCache);
SwingUtilities.computeIntersection(x, y, w, h, rectCache);
if (! rectCache.isEmpty())
{
- if (dirtyComponents.containsKey(component))
+ synchronized (dirtyComponents)
{
- SwingUtilities.computeUnion(rectCache.x, rectCache.y,
- rectCache.width, rectCache.height,
- (Rectangle) dirtyComponents.get(component));
- }
- else
- {
- synchronized (dirtyComponents)
+ Rectangle dirtyRect = (Rectangle)dirtyComponents.get(component);
+ if (dirtyRect != null)
+ {
+ SwingUtilities.computeUnion(rectCache.x, rectCache.y,
+ rectCache.width, rectCache.height,
+ dirtyRect);
+ }
+ else
{
dirtyComponents.put(component, rectCache.getBounds());
}
@@ -422,7 +454,7 @@ public class RepaintManager
if (! repaintWorker.isLive())
{
repaintWorker.setLive(true);
- SwingUtilities.invokeLater(repaintWorker);
+ invokeLater(repaintWorker);
}
}
}
@@ -536,7 +568,7 @@ public class RepaintManager
*/
public void paintDirtyRegions()
{
- // Short cicuit if there is nothing to paint.
+ // Short circuit if there is nothing to paint.
if (dirtyComponents.size() == 0)
return;
@@ -557,7 +589,6 @@ public class RepaintManager
compileRepaintRoots(dirtyComponentsWork, dirty, repaintRoots);
}
- repaintUnderway = true;
for (Iterator i = repaintRoots.iterator(); i.hasNext();)
{
JComponent comp = (JComponent) i.next();
@@ -567,13 +598,11 @@ public class RepaintManager
comp.paintImmediately(damaged);
}
dirtyComponentsWork.clear();
- repaintUnderway = false;
- commitRemainingBuffers();
}
-
+
/**
* Compiles a list of components that really get repainted. This is called
- * once for each component in the dirtyComponents HashMap, each time with
+ * once for each component in the dirtyRegions HashMap, each time with
* another <code>dirty</code> parameter. This searches up the component
* hierarchy of <code>dirty</code> to find the highest parent that is also
* marked dirty and merges the dirty regions.
@@ -588,6 +617,29 @@ public class RepaintManager
Component current = dirty;
Component root = dirty;
+ // This will contain the dirty region in the root coordinate system,
+ // possibly clipped by ancestor's bounds.
+ Rectangle originalDirtyRect = (Rectangle) dirtyRegions.get(dirty);
+ rectCache.setBounds(originalDirtyRect);
+
+ // The bounds of the current component.
+ int x = dirty.getX();
+ int y = dirty.getY();
+ int w = dirty.getWidth();
+ int h = dirty.getHeight();
+
+ // Do nothing if dirty region is clipped away by the component's bounds.
+ rectCache = SwingUtilities.computeIntersection(0, 0, w, h, rectCache);
+ if (rectCache.isEmpty())
+ return;
+
+ // The cumulated offsets.
+ int dx = 0;
+ int dy = 0;
+ // The actual offset for the found root.
+ int rootDx = 0;
+ int rootDy = 0;
+
// Search the highest component that is also marked dirty.
Component parent;
while (true)
@@ -597,10 +649,29 @@ public class RepaintManager
break;
current = parent;
+ // Update the offset.
+ dx += x;
+ dy += y;
+ rectCache.x += x;
+ rectCache.y += y;
+
+ x = current.getX();
+ y = current.getY();
+ w = current.getWidth();
+ h = current.getHeight();
+ rectCache = SwingUtilities.computeIntersection(0, 0, w, h, rectCache);
+
+ // Don't paint if the dirty regions is clipped away by any of
+ // its ancestors.
+ if (rectCache.isEmpty())
+ return;
+
// We can skip to the next up when this parent is not dirty.
if (dirtyRegions.containsKey(parent))
{
root = current;
+ rootDx = dx;
+ rootDy = dy;
}
}
@@ -608,15 +679,16 @@ public class RepaintManager
// the are different.
if (root != dirty)
{
- Rectangle dirtyRect = (Rectangle) dirtyRegions.get(dirty);
- dirtyRect = SwingUtilities.convertRectangle(dirty, dirtyRect, root);
- Rectangle rootRect = (Rectangle) dirtyRegions.get(root);
- SwingUtilities.computeUnion(dirtyRect.x, dirtyRect.y, dirtyRect.width,
- dirtyRect.height, rootRect);
+ rectCache.x += rootDx - dx;
+ rectCache.y += rootDy - dy;
+ Rectangle dirtyRect = (Rectangle) dirtyRegions.get(root);
+ SwingUtilities.computeUnion(rectCache.x, rectCache.y, rectCache.width,
+ rectCache.height, dirtyRect);
}
// Adds the root to the roots set.
- roots.add(root);
+ if (! roots.contains(root))
+ roots.add(root);
}
/**
@@ -643,128 +715,43 @@ public class RepaintManager
width = Math.min(doubleBufferMaximumSize.width, width);
int height = Math.max(proposedHeight, root.getHeight());
height = Math.min(doubleBufferMaximumSize.height, height);
- buffer = root.createImage(width, height);
+ buffer = component.createImage(width, height);
offscreenBuffers.put(root, buffer);
}
return buffer;
}
/**
- * Blits the back buffer of the specified root component to the screen. If
- * the RepaintManager is currently working on a paint request, the commit
- * requests are queued up and committed at once when the paint request is
- * done (by {@link #commitRemainingBuffers}). This is package private because
- * it must get called by JComponent.
+ * Blits the back buffer of the specified root component to the screen.
+ * This is package private because it must get called by JComponent.
*
* @param comp the component to be painted
- * @param area the area to paint on screen, in comp coordinates
- */
- void commitBuffer(Component comp, Rectangle area)
- {
- // Determine the component that we finally paint the buffer upon.
- // We need to paint on the nearest heavyweight component, so that Swing
- // hierarchies inside (non-window) heavyweights get painted correctly.
- // Otherwise we would end up blitting the backbuffer behind the heavyweight
- // which is wrong.
- Component root = getHeavyweightParent(comp);
- // FIXME: Optimize this.
- Rectangle rootRect = SwingUtilities.convertRectangle(comp, area, root);
-
- // We synchronize on dirtyComponents here because that is what
- // paintDirtyRegions also synchronizes on while painting.
- synchronized (dirtyComponents)
- {
- // If the RepaintManager is not currently painting, then directly
- // blit the requested buffer on the screen.
- if (true || ! repaintUnderway)
- {
- blitBuffer(root, rootRect);
- }
-
- // Otherwise queue this request up, until all the RepaintManager work
- // is done.
- else
- {
- if (commitRequests.containsKey(root))
- SwingUtilities.computeUnion(rootRect.x, rootRect.y,
- rootRect.width, rootRect.height,
- (Rectangle) commitRequests.get(root));
- else
- commitRequests.put(root, rootRect);
- }
- }
- }
-
- /**
- * Copies the buffer to the screen. Note that the root component here is
- * not necessarily the component with which the offscreen buffer is
- * associated. The offscreen buffers are always allocated for the toplevel
- * windows. However, painted is performed on lower-level heavyweight
- * components too, if they contain Swing components.
- *
- * @param root the heavyweight component to blit upon
- * @param rootRect the rectangle in the root component's coordinate space
+ * @param x the area to paint on screen, in comp coordinates
+ * @param y the area to paint on screen, in comp coordinates
+ * @param w the area to paint on screen, in comp coordinates
+ * @param h the area to paint on screen, in comp coordinates
*/
- private void blitBuffer(Component root, Rectangle rootRect)
+ void commitBuffer(Component comp, int x, int y, int w, int h)
{
- if (! root.isShowing())
- return;
-
- // Find the Window from which we use the backbuffer.
- Component bufferRoot = root;
- Rectangle bufferRect = rootRect.getBounds();
- if (!(bufferRoot instanceof Window))
+ Component root = comp;
+ while (root != null
+ && ! (root instanceof Window || root instanceof Applet))
{
- bufferRoot = SwingUtilities.getWindowAncestor(bufferRoot);
- SwingUtilities.convertRectangleToAncestor(root, rootRect, bufferRoot);
+ x += root.getX();
+ y += root.getY();
+ root = root.getParent();
}
- Graphics g = root.getGraphics();
- Image buffer = (Image) offscreenBuffers.get(bufferRoot);
-
- // Make sure we have a sane clip at this point.
- g.clipRect(rootRect.x, rootRect.y, rootRect.width, rootRect.height);
- g.drawImage(buffer, rootRect.x - bufferRect.x, rootRect.y - bufferRect.y,
- root);
- g.dispose();
-
- }
-
- /**
- * Finds and returns the nearest heavyweight parent for the specified
- * component. If the component isn't contained inside a heavyweight parent,
- * this returns null.
- *
- * @param comp the component
- *
- * @return the nearest heavyweight parent for the specified component or
- * null if the component has no heavyweight ancestor
- */
- private Component getHeavyweightParent(Component comp)
- {
- while (comp != null && comp.isLightweight())
- comp = comp.getParent();
- return comp;
- }
-
- /**
- * Commits the queued up back buffers to screen all at once.
- */
- private void commitRemainingBuffers()
- {
- // We synchronize on dirtyComponents here because that is what
- // paintDirtyRegions also synchronizes on while painting.
- synchronized (dirtyComponents)
+ if (root != null)
{
- Set entrySet = commitRequests.entrySet();
- Iterator i = entrySet.iterator();
- while (i.hasNext())
+ Graphics g = root.getGraphics();
+ Image buffer = (Image) offscreenBuffers.get(root);
+ if (buffer != null)
{
- Map.Entry entry = (Map.Entry) i.next();
- Component root = (Component) entry.getKey();
- Rectangle area = (Rectangle) entry.getValue();
- blitBuffer(root, area);
- i.remove();
+ // Make sure we have a sane clip at this point.
+ g.clipRect(x, y, w, h);
+ g.drawImage(buffer, 0, 0, root);
+ g.dispose();
}
}
}
@@ -858,4 +845,18 @@ public class RepaintManager
{
return "RepaintManager";
}
+
+ /**
+ * Sends an RepaintManagerEvent to the event queue with the specified
+ * runnable. This is similar to SwingUtilities.invokeLater(), only that the
+ * event is a low priority event in order to defer the execution a little
+ * more.
+ */
+ private void invokeLater(Runnable runnable)
+ {
+ Toolkit tk = Toolkit.getDefaultToolkit();
+ EventQueue evQueue = tk.getSystemEventQueue();
+ InvocationEvent ev = new RepaintWorkerEvent(evQueue, runnable, null, false);
+ evQueue.postEvent(ev);
+ }
}
diff --git a/libjava/classpath/javax/swing/ScrollPaneLayout.java b/libjava/classpath/javax/swing/ScrollPaneLayout.java
index 8ce8fd86f7a..2a16f26eae9 100644
--- a/libjava/classpath/javax/swing/ScrollPaneLayout.java
+++ b/libjava/classpath/javax/swing/ScrollPaneLayout.java
@@ -46,6 +46,8 @@ import java.awt.LayoutManager;
import java.awt.Rectangle;
import java.io.Serializable;
+import javax.swing.border.Border;
+
/**
* ScrollPaneLayout
* @author Andrew Selkirk
@@ -277,6 +279,16 @@ public class ScrollPaneLayout
width += rowHead.getPreferredSize().width;
if (colHead != null && colHead.isVisible())
height += colHead.getPreferredSize().height;
+
+ // Add insets of viewportBorder if present.
+ Border vpBorder = sc.getViewportBorder();
+ if (vpBorder != null)
+ {
+ Insets i = vpBorder.getBorderInsets(sc);
+ width += i.left + i.right;
+ height += i.top + i.bottom;
+ }
+
Insets i = sc.getInsets();
return new Dimension(width + i.left + i.right,
height + i.left + i.right);
@@ -300,6 +312,15 @@ public class ScrollPaneLayout
!= JScrollPane.HORIZONTAL_SCROLLBAR_NEVER)
height += sc.getHorizontalScrollBar().getMinimumSize().height;
+ // Add insets of viewportBorder if present.
+ Border vpBorder = sc.getViewportBorder();
+ if (vpBorder != null)
+ {
+ i = vpBorder.getBorderInsets(sc);
+ width += i.left + i.right;
+ height += i.top + i.bottom;
+ }
+
return new Dimension(width, height);
}
@@ -342,6 +363,15 @@ public class ScrollPaneLayout
int y1 = 0, y2 = 0, y3 = 0, y4 = 0;
Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null);
+ // If there is a viewportBorder, remove its insets from the available
+ // space.
+ Border vpBorder = sc.getViewportBorder();
+ Insets vpi;
+ if (vpBorder != null)
+ vpi = vpBorder.getBorderInsets(sc);
+ else
+ vpi = new Insets(0, 0, 0, 0);
+
x1 = scrollPaneBounds.x;
y1 = scrollPaneBounds.y;
x4 = scrollPaneBounds.x + scrollPaneBounds.width;
@@ -404,7 +434,9 @@ public class ScrollPaneLayout
// now set the layout
if (viewport != null)
- viewport.setBounds(new Rectangle(x2, y2, x3 - x2, y3 - y2));
+ viewport.setBounds(new Rectangle(x2 + vpi.left, y2 + vpi.top,
+ x3 - x2 - vpi.left - vpi.right,
+ y3 - y2 - vpi.top - vpi.bottom));
if (colHead != null)
colHead.setBounds(new Rectangle(x2, y1, x3 - x2, y2 - y1));
@@ -415,7 +447,7 @@ public class ScrollPaneLayout
if (showVsb)
{
vsb.setVisible(true);
- vsb.setBounds(new Rectangle(x3, y2, x4 - x3, y3 - y2));
+ vsb.setBounds(new Rectangle(x3, y2, x4 - x3, y3 - y2 ));
}
else if (vsb != null)
vsb.setVisible(false);
@@ -423,7 +455,7 @@ public class ScrollPaneLayout
if (showHsb)
{
hsb.setVisible(true);
- hsb.setBounds(new Rectangle(x2, y3, x3 - x2, y4 - y3));
+ hsb.setBounds(new Rectangle(x2 , y3, x3 - x2, y4 - y3));
}
else if (hsb != null)
hsb.setVisible(false);
diff --git a/libjava/classpath/javax/swing/SizeSequence.java b/libjava/classpath/javax/swing/SizeSequence.java
index a5f34710c76..cb6c8bc25df 100644
--- a/libjava/classpath/javax/swing/SizeSequence.java
+++ b/libjava/classpath/javax/swing/SizeSequence.java
@@ -129,14 +129,18 @@ public class SizeSequence
}
/**
- * Returns the size of the specified element.
+ * Returns the size of the specified element, or 0 if the element index is
+ * outside the defined range.
*
* @param index the element index.
*
- * @return The size of the specified element.
+ * @return The size of the specified element, or 0 if the element index is
+ * outside the defined range.
*/
public int getSize(int index)
{
+ if (index < 0 || index >= sizes.length)
+ return 0;
return sizes[index];
}
diff --git a/libjava/classpath/javax/swing/SortingFocusTraversalPolicy.java b/libjava/classpath/javax/swing/SortingFocusTraversalPolicy.java
index 96ef3832955..d14ee1d30a4 100644
--- a/libjava/classpath/javax/swing/SortingFocusTraversalPolicy.java
+++ b/libjava/classpath/javax/swing/SortingFocusTraversalPolicy.java
@@ -91,7 +91,7 @@ public class SortingFocusTraversalPolicy
*
* @param comparator the comparator to set
*/
- public SortingFocusTraversalPolicy(Comparator comparator)
+ public SortingFocusTraversalPolicy(Comparator<? super Component> comparator)
{
this.comparator = comparator;
}
@@ -119,7 +119,7 @@ public class SortingFocusTraversalPolicy
*
* @see #setComparator
*/
- protected Comparator getComparator()
+ protected Comparator<? super Component> getComparator()
{
return comparator;
}
@@ -131,7 +131,7 @@ public class SortingFocusTraversalPolicy
*
* @see #getComparator
*/
- protected void setComparator(Comparator comparator)
+ protected void setComparator(Comparator<? super Component> comparator)
{
this.comparator = comparator;
}
diff --git a/libjava/classpath/javax/swing/SpinnerListModel.java b/libjava/classpath/javax/swing/SpinnerListModel.java
index d8e2f22d585..52ac360e924 100644
--- a/libjava/classpath/javax/swing/SpinnerListModel.java
+++ b/libjava/classpath/javax/swing/SpinnerListModel.java
@@ -118,7 +118,7 @@ public class SpinnerListModel extends AbstractSpinnerModel
* @see SpinnerListModel#getNextValue()
* @see SpinnerListModel#getValue()
*/
- public SpinnerListModel(List list)
+ public SpinnerListModel(List<?> list)
{
// Retain a reference to the valid list.
setList(list);
@@ -163,7 +163,7 @@ public class SpinnerListModel extends AbstractSpinnerModel
*
* @return The backing list.
*/
- public List getList()
+ public List<?> getList()
{
return list;
}
@@ -239,7 +239,7 @@ public class SpinnerListModel extends AbstractSpinnerModel
*
* @see ChangeEvent
*/
- public void setList(List list)
+ public void setList(List<?> list)
{
// Check for null or zero size list.
if (list == null || list.size() == 0)
diff --git a/libjava/classpath/javax/swing/SwingUtilities.java b/libjava/classpath/javax/swing/SwingUtilities.java
index ccd37d03a55..6ff0b3346df 100644
--- a/libjava/classpath/javax/swing/SwingUtilities.java
+++ b/libjava/classpath/javax/swing/SwingUtilities.java
@@ -40,7 +40,6 @@ package javax.swing;
import java.applet.Applet;
import java.awt.Component;
-import java.awt.ComponentOrientation;
import java.awt.Container;
import java.awt.FontMetrics;
import java.awt.Frame;
@@ -61,6 +60,8 @@ import javax.accessibility.Accessible;
import javax.accessibility.AccessibleStateSet;
import javax.swing.plaf.ActionMapUIResource;
import javax.swing.plaf.InputMapUIResource;
+import javax.swing.plaf.basic.BasicHTML;
+import javax.swing.text.View;
/**
* A number of static utility functions which are
@@ -324,7 +325,7 @@ public class SwingUtilities
* @see #getAncestorOfClass
* @see #windowForComponent
*/
- public static Container getAncestorOfClass(Class c, Component comp)
+ public static Container getAncestorOfClass(Class<?> c, Component comp)
{
while (comp != null && (! c.isInstance(comp)))
comp = comp.getParent();
@@ -719,44 +720,41 @@ public class SwingUtilities
// Fix up the orientation-based horizontal positions.
- if (horizontalTextPosition == LEADING)
- {
- if (c.getComponentOrientation() == ComponentOrientation.RIGHT_TO_LEFT)
- horizontalTextPosition = RIGHT;
- else
- horizontalTextPosition = LEFT;
- }
- else if (horizontalTextPosition == TRAILING)
+ boolean ltr = true;
+ if (c != null && ! c.getComponentOrientation().isLeftToRight())
+ ltr = false;
+
+ switch (horizontalTextPosition)
{
- if (c.getComponentOrientation() == ComponentOrientation.RIGHT_TO_LEFT)
- horizontalTextPosition = LEFT;
- else
- horizontalTextPosition = RIGHT;
+ case LEADING:
+ horizontalTextPosition = ltr ? LEFT : RIGHT;
+ break;
+ case TRAILING:
+ horizontalTextPosition = ltr ? RIGHT : LEFT;
+ break;
+ default:
+ // Nothing to do in the other cases.
}
// Fix up the orientation-based alignments.
-
- if (horizontalAlignment == LEADING)
- {
- if (c.getComponentOrientation() == ComponentOrientation.RIGHT_TO_LEFT)
- horizontalAlignment = RIGHT;
- else
- horizontalAlignment = LEFT;
- }
- else if (horizontalAlignment == TRAILING)
+ switch (horizontalAlignment)
{
- if (c.getComponentOrientation() == ComponentOrientation.RIGHT_TO_LEFT)
- horizontalAlignment = LEFT;
- else
- horizontalAlignment = RIGHT;
+ case LEADING:
+ horizontalAlignment = ltr ? LEFT : RIGHT;
+ break;
+ case TRAILING:
+ horizontalAlignment = ltr ? RIGHT : LEFT;
+ break;
+ default:
+ // Nothing to do in the other cases.
}
-
- return layoutCompoundLabel(fm, text, icon,
- verticalAlignment,
- horizontalAlignment,
- verticalTextPosition,
- horizontalTextPosition,
- viewR, iconR, textR, textIconGap);
+
+ return layoutCompoundLabelImpl(c, fm, text, icon,
+ verticalAlignment,
+ horizontalAlignment,
+ verticalTextPosition,
+ horizontalTextPosition,
+ viewR, iconR, textR, textIconGap);
}
/**
@@ -829,6 +827,82 @@ public class SwingUtilities
Rectangle textR,
int textIconGap)
{
+ return layoutCompoundLabelImpl(null, fm, text, icon, verticalAlignment,
+ horizontalAlignment, verticalTextPosition,
+ horizontalTextPosition, viewR, iconR, textR,
+ textIconGap);
+ }
+
+ /**
+ * <p>Layout a "compound label" consisting of a text string and an icon
+ * which is to be placed near the rendered text. Once the text and icon
+ * are laid out, the text rectangle and icon rectangle parameters are
+ * altered to store the calculated positions.</p>
+ *
+ * <p>The size of the text is calculated from the provided font metrics
+ * object. This object should be the metrics of the font you intend to
+ * paint the label with.</p>
+ *
+ * <p>The position values control where the text is placed relative to
+ * the icon. The horizontal position value should be one of the constants
+ * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>. The
+ * vertical position value should be one fo the constants
+ * <code>TOP</code>, <code>BOTTOM</code> or <code>CENTER</code>.</p>
+ *
+ * <p>The text-icon gap value controls the number of pixels between the
+ * icon and the text.</p>
+ *
+ * <p>The alignment values control where the text and icon are placed, as
+ * a combined unit, within the view rectangle. The horizontal alignment
+ * value should be one of the constants <code>LEFT</code>, <code>RIGHT</code> or
+ * <code>CENTER</code>. The vertical alignment valus should be one of the
+ * constants <code>TOP</code>, <code>BOTTOM</code> or
+ * <code>CENTER</code>.</p>
+ *
+ * <p>If the text and icon are equal to or larger than the view
+ * rectangle, the horizontal and vertical alignment values have no
+ * affect.</p>
+ *
+ * <p>Note that this method does <em>not</em> know how to deal with
+ * horizontal alignments or positions given as <code>LEADING</code> or
+ * <code>TRAILING</code> values. Use the other overloaded variant of this
+ * method if you wish to use such values.
+ *
+ * @param fm The font metrics used to measure the text
+ * @param text The text to place in the compound label
+ * @param icon The icon to place next to the text
+ * @param verticalAlignment The vertical alignment of the label relative
+ * to its component
+ * @param horizontalAlignment The horizontal alignment of the label
+ * relative to its component
+ * @param verticalTextPosition The vertical position of the label's text
+ * relative to its icon
+ * @param horizontalTextPosition The horizontal position of the label's
+ * text relative to its icon
+ * @param viewR The view rectangle, specifying the area which layout is
+ * constrained to
+ * @param iconR A rectangle which is modified to hold the laid-out
+ * position of the icon
+ * @param textR A rectangle which is modified to hold the laid-out
+ * position of the text
+ * @param textIconGap The distance between text and icon
+ *
+ * @return The string of characters, possibly truncated with an elipsis,
+ * which is laid out in this label
+ */
+ private static String layoutCompoundLabelImpl(JComponent c,
+ FontMetrics fm,
+ String text,
+ Icon icon,
+ int verticalAlignment,
+ int horizontalAlignment,
+ int verticalTextPosition,
+ int horizontalTextPosition,
+ Rectangle viewR,
+ Rectangle iconR,
+ Rectangle textR,
+ int textIconGap)
+ {
// Work out basic height and width.
@@ -843,94 +917,108 @@ public class SwingUtilities
iconR.width = icon.getIconWidth();
iconR.height = icon.getIconHeight();
}
+
if (text == null || text.equals(""))
{
textIconGap = 0;
textR.width = 0;
textR.height = 0;
+ text = "";
}
else
{
- int fromIndex = 0;
- textR.width = fm.stringWidth(text);
- textR.height = fm.getHeight();
- while (text.indexOf('\n', fromIndex) != -1)
+ int availableWidth = viewR.width;
+ if (horizontalTextPosition != CENTER)
+ availableWidth -= iconR.width + textIconGap;
+ View html = c == null ? null
+ : (View) c.getClientProperty(BasicHTML.propertyKey);
+ if (html != null)
+ {
+ textR.width = (int) html.getPreferredSpan(View.X_AXIS);
+ textR.width = Math.min(availableWidth, textR.width);
+ textR.height = (int) html.getPreferredSpan(View.Y_AXIS);
+ }
+ else
{
- textR.height += fm.getHeight();
- fromIndex = text.indexOf('\n', fromIndex) + 1;
+ int fromIndex = 0;
+ textR.width = fm.stringWidth(text);
+ textR.height = fm.getHeight();
+ if (textR.width > availableWidth)
+ {
+ text = clipString(c, fm, text, availableWidth);
+ textR.width = fm.stringWidth(text);
+ }
}
}
- // Work out the position of text and icon, assuming the top-left coord
+ // Work out the position of text, assuming the top-left coord
// starts at (0,0). We will fix that up momentarily, after these
// "position" decisions are made and we look at alignment.
- switch (horizontalTextPosition)
+ switch (verticalTextPosition)
{
- case LEFT:
- textR.x = 0;
- iconR.x = textR.width + textIconGap;
+ case TOP:
+ textR.y = horizontalTextPosition == CENTER ?
+ - textR.height - textIconGap : 0;
break;
- case RIGHT:
- iconR.x = 0;
- textR.x = iconR.width + textIconGap;
+ case BOTTOM:
+ textR.y = horizontalTextPosition == CENTER ?
+ iconR.height + textIconGap : iconR.height - textR.height;
break;
case CENTER:
- int centerLine = Math.max(textR.width, iconR.width) / 2;
- textR.x = centerLine - textR.width/2;
- iconR.x = centerLine - iconR.width/2;
+ textR.y = iconR.height / 2 - textR.height / 2;
break;
}
- switch (verticalTextPosition)
+ switch (horizontalTextPosition)
{
- case TOP:
- textR.y = 0;
- iconR.y = (horizontalTextPosition == CENTER
- ? textR.height + textIconGap : 0);
+ case LEFT:
+ textR.x = -(textR.width + textIconGap);
break;
- case BOTTOM:
- iconR.y = 0;
- textR.y = (horizontalTextPosition == CENTER
- ? iconR.height + textIconGap
- : Math.max(iconR.height - textR.height, 0));
+ case RIGHT:
+ textR.x = iconR.width + textIconGap;
break;
case CENTER:
- int centerLine = Math.max(textR.height, iconR.height) / 2;
- textR.y = centerLine - textR.height/2;
- iconR.y = centerLine - iconR.height/2;
+ textR.x = iconR.width / 2 - textR.width / 2;
break;
}
+
// The two rectangles are laid out correctly now, but only assuming
// that their upper left corner is at (0,0). If we have any alignment other
// than TOP and LEFT, we need to adjust them.
- Rectangle u = textR.union(iconR);
- int horizontalAdjustment = viewR.x;
- int verticalAdjustment = viewR.y;
+ // These coordinates specify the rectangle that contains both the
+ // icon and text. Move it so that it fullfills the alignment properties.
+ int lx = Math.min(iconR.x, textR.x);
+ int lw = Math.max(iconR.x + iconR.width, textR.x + textR.width) - lx;
+ int ly = Math.min(iconR.y, textR.y);
+ int lh = Math.max(iconR.y + iconR.height, textR.y + textR.height) - ly;
+ int horizontalAdjustment = 0;
+ int verticalAdjustment = 0;
switch (verticalAlignment)
{
case TOP:
+ verticalAdjustment = viewR.y - ly;
break;
case BOTTOM:
- verticalAdjustment += (viewR.height - u.height);
+ verticalAdjustment = viewR.y + viewR.height - ly - lh;
break;
case CENTER:
- verticalAdjustment += ((viewR.height/2) - (u.height/2));
+ verticalAdjustment = viewR.y + viewR.height / 2 - ly - lh / 2;
break;
}
switch (horizontalAlignment)
{
case LEFT:
+ horizontalAdjustment = viewR.x - lx;
break;
case RIGHT:
- horizontalAdjustment += (viewR.width - u.width);
+ horizontalAdjustment = viewR.x + viewR.width - lx - lw;
break;
case CENTER:
- horizontalAdjustment += ((viewR.width/2) - (u.width/2));
+ horizontalAdjustment = (viewR.x + (viewR.width / 2)) - (lx + (lw / 2));
break;
}
-
iconR.x += horizontalAdjustment;
iconR.y += verticalAdjustment;
@@ -940,6 +1028,48 @@ public class SwingUtilities
return text;
}
+ /**
+ * The method clips the specified string so that it fits into the
+ * available width. It is only called when the text really doesn't fit,
+ * so we don't need to check that again.
+ *
+ * @param c the component
+ * @param fm the font metrics
+ * @param text the text
+ * @param availableWidth the available width
+ *
+ * @return the clipped string
+ */
+ private static String clipString(JComponent c, FontMetrics fm, String text,
+ int availableWidth)
+ {
+ String dots = "...";
+ int dotsWidth = fm.stringWidth(dots);
+ char[] string = text.toCharArray();
+ int endIndex = string.length;
+ while (fm.charsWidth(string, 0, endIndex) + dotsWidth > availableWidth
+ && endIndex > 0)
+ endIndex--;
+ String clipped;
+ if (string.length >= endIndex + 3)
+ {
+ string[endIndex] = '.';
+ string[endIndex + 1] = '.';
+ string[endIndex + 2] = '.';
+ clipped = new String(string, 0, endIndex + 3);
+ }
+ else
+ {
+ char[] clippedChars = new char[string.length + 3];
+ System.arraycopy(string, 0, clippedChars, 0, string.length);
+ clippedChars[endIndex] = '.';
+ clippedChars[endIndex + 1] = '.';
+ clippedChars[endIndex + 2] = '.';
+ clipped = new String(clippedChars, 0, endIndex + 3);
+ }
+ return clipped;
+ }
+
/**
* Calls {@link java.awt.EventQueue#invokeLater} with the
* specified {@link Runnable}.
diff --git a/libjava/classpath/javax/swing/Timer.java b/libjava/classpath/javax/swing/Timer.java
index acd22624947..acd1eb49359 100644
--- a/libjava/classpath/javax/swing/Timer.java
+++ b/libjava/classpath/javax/swing/Timer.java
@@ -228,7 +228,7 @@ public class Timer
* fired by this timer
* @since 1.3
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
return listenerList.getListeners(listenerType);
}
diff --git a/libjava/classpath/javax/swing/ToolTipManager.java b/libjava/classpath/javax/swing/ToolTipManager.java
index 963ccf88117..152fc03430f 100644
--- a/libjava/classpath/javax/swing/ToolTipManager.java
+++ b/libjava/classpath/javax/swing/ToolTipManager.java
@@ -163,16 +163,21 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener
private static ToolTipManager shared;
/** The current component the tooltip is being displayed for. */
- private static Component currentComponent;
+ private JComponent currentComponent;
/** The current tooltip. */
- private static JToolTip currentTip;
+ private JToolTip currentTip;
+
+ /**
+ * The tooltip text.
+ */
+ private String toolTipText;
/** The last known position of the mouse cursor. */
- private static Point currentPoint;
-
+ private Point currentPoint;
+
/** */
- private static Popup popup;
+ private Popup popup;
/**
* Creates a new ToolTipManager and sets up the timers.
@@ -364,8 +369,8 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener
return;
currentPoint = event.getPoint();
- currentComponent = (Component) event.getSource();
-
+ currentComponent = (JComponent) event.getSource();
+ toolTipText = currentComponent.getToolTipText(event);
if (exitTimer.isRunning())
{
exitTimer.stop();
@@ -443,8 +448,52 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener
public void mouseMoved(MouseEvent event)
{
currentPoint = event.getPoint();
- if (enterTimer.isRunning())
- enterTimer.restart();
+ if (currentTip != null && currentTip.isShowing())
+ checkTipUpdate(event);
+ else
+ {
+ if (enterTimer.isRunning())
+ enterTimer.restart();
+ }
+ }
+
+ /**
+ * Checks if the tooltip's text or location changes when the mouse is moved
+ * over the component.
+ */
+ private void checkTipUpdate(MouseEvent ev)
+ {
+ JComponent comp = (JComponent) ev.getSource();
+ String newText = comp.getToolTipText(ev);
+ String oldText = toolTipText;
+ if (newText != null)
+ {
+ if (((newText != null && newText.equals(oldText)) || newText == null))
+ {
+ // No change at all. Restart timers.
+ if (popup == null)
+ enterTimer.restart();
+ else
+ insideTimer.restart();
+ }
+ else
+ {
+ // Update the tooltip.
+ toolTipText = newText;
+ hideTip();
+ showTip();
+ exitTimer.stop();
+ }
+ }
+ else
+ {
+ // Hide tooltip.
+ currentTip = null;
+ currentPoint = null;
+ hideTip();
+ enterTimer.stop();
+ exitTimer.stop();
+ }
}
/**
@@ -461,9 +510,9 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener
return;
}
- if (currentTip == null || currentTip.getComponent() != currentComponent
- && currentComponent instanceof JComponent)
- currentTip = ((JComponent) currentComponent).createToolTip();
+ if (currentTip == null || currentTip.getComponent() != currentComponent)
+ currentTip = currentComponent.createToolTip();
+ currentTip.setTipText(toolTipText);
Point p = currentPoint;
Point cP = currentComponent.getLocationOnScreen();
@@ -531,8 +580,8 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener
private Component getContentPaneDeepestComponent(MouseEvent e)
{
Component source = (Component) e.getSource();
- Container parent = (Container) SwingUtilities.getAncestorOfClass(JRootPane.class,
- currentComponent);
+ Container parent = SwingUtilities.getAncestorOfClass(JRootPane.class,
+ currentComponent);
if (parent == null)
return null;
parent = ((JRootPane) parent).getContentPane();
diff --git a/libjava/classpath/javax/swing/TransferHandler.java b/libjava/classpath/javax/swing/TransferHandler.java
index 40a36b27d24..d594a8244bb 100644
--- a/libjava/classpath/javax/swing/TransferHandler.java
+++ b/libjava/classpath/javax/swing/TransferHandler.java
@@ -44,12 +44,117 @@ import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
+import java.beans.BeanInfo;
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.io.IOException;
import java.io.Serializable;
+import java.lang.reflect.Method;
public class TransferHandler implements Serializable
{
+
+ /**
+ * An implementation of {@link Transferable} that can be used to export
+ * data from a component's property.
+ */
+ private static class PropertyTransferable
+ implements Transferable
+ {
+ /**
+ * The component from which we export.
+ */
+ private JComponent component;
+
+ /**
+ * The property descriptor of the property that we handle.
+ */
+ private PropertyDescriptor property;
+
+ /**
+ * Creates a new PropertyTransferable.
+ *
+ * @param c the component from which we export
+ * @param prop the property from which we export
+ */
+ PropertyTransferable(JComponent c, PropertyDescriptor prop)
+ {
+ component = c;
+ property = prop;
+ }
+
+ /**
+ * Returns the data flavors supported by the Transferable.
+ *
+ * @return the data flavors supported by the Transferable
+ */
+ public DataFlavor[] getTransferDataFlavors()
+ {
+ DataFlavor[] flavors;
+ Class propClass = property.getPropertyType();
+ String mime = DataFlavor.javaJVMLocalObjectMimeType + "; class="
+ + propClass.getName();
+ try
+ {
+ DataFlavor flavor = new DataFlavor(mime);
+ flavors = new DataFlavor[]{ flavor };
+ }
+ catch (ClassNotFoundException ex)
+ {
+ flavors = new DataFlavor[0];
+ }
+ return flavors;
+ }
+
+ /**
+ * Returns <code>true</code> when the specified data flavor is supported,
+ * <code>false</code> otherwise.
+ *
+ * @return <code>true</code> when the specified data flavor is supported,
+ * <code>false</code> otherwise
+ */
+ public boolean isDataFlavorSupported(DataFlavor flavor)
+ {
+ Class propClass = property.getPropertyType();
+ return flavor.getPrimaryType().equals("application")
+ && flavor.getSubType().equals("x-java-jvm-local-objectref")
+ && propClass.isAssignableFrom(flavor.getRepresentationClass());
+ }
+
+ /**
+ * Returns the actual transfer data.
+ *
+ * @param flavor the data flavor
+ *
+ * @return the actual transfer data
+ */
+ public Object getTransferData(DataFlavor flavor)
+ throws UnsupportedFlavorException, IOException
+ {
+ if (isDataFlavorSupported(flavor))
+ {
+ Method getter = property.getReadMethod();
+ Object o;
+ try
+ {
+ o = getter.invoke(component, null);
+ return o;
+ }
+ catch (Exception ex)
+ {
+ throw new IOException("Property read failed: "
+ + property.getName());
+ }
+ }
+ else
+ throw new UnsupportedFlavorException(flavor);
+ }
+ }
+
static class TransferAction extends AbstractAction
{
private String command;
@@ -123,7 +228,13 @@ public class TransferHandler implements Serializable
private int sourceActions;
private Icon visualRepresentation;
-
+
+ /**
+ * The name of the property into/from which this TransferHandler
+ * imports/exports.
+ */
+ private String propertyName;
+
public static Action getCopyAction()
{
return copyAction;
@@ -146,19 +257,78 @@ public class TransferHandler implements Serializable
public TransferHandler(String property)
{
+ propertyName = property;
this.sourceActions = property != null ? COPY : NONE;
}
+ /**
+ * Returns <code>true</code> if the data in this TransferHandler can be
+ * imported into the specified component. This will be the case when:
+ * <ul>
+ * <li>The component has a readable and writable property with the property
+ * name specified in the TransferHandler constructor.</li>
+ * <li>There is a dataflavor with a mime type of
+ * <code>application/x-java-jvm-local-object-ref</code>.</li>
+ * <li>The dataflavor's representation class matches the class of the
+ * property in the component.</li>
+ * </li>
+ *
+ * @param c the component to check
+ * @param flavors the possible data flavors
+ *
+ * @return <code>true</code> if the data in this TransferHandler can be
+ * imported into the specified component, <code>false</code>
+ * otherwise
+ */
public boolean canImport(JComponent c, DataFlavor[] flavors)
- throws NotImplementedException
{
- return false;
+ PropertyDescriptor propDesc = getPropertyDescriptor(c);
+ boolean canImport = false;
+ if (propDesc != null)
+ {
+ // Check if the property is writable. The readable check is already
+ // done in getPropertyDescriptor().
+ Method writer = propDesc.getWriteMethod();
+ if (writer != null)
+ {
+ Class[] params = writer.getParameterTypes();
+ if (params.length == 1)
+ {
+ // Number of parameters ok, now check mime type and
+ // representation class.
+ DataFlavor flavor = getPropertyDataFlavor(params[0], flavors);
+ if (flavor != null)
+ canImport = true;
+ }
+ }
+ }
+ return canImport;
}
+ /**
+ * Creates a {@link Transferable} that can be used to export data
+ * from the specified component.
+ *
+ * This method returns <code>null</code> when the specified component
+ * doesn't have a readable property that matches the property name
+ * specified in the <code>TransferHandler</code> constructor.
+ *
+ * @param c the component to create a transferable for
+ *
+ * @return a {@link Transferable} that can be used to export data
+ * from the specified component, or null if the component doesn't
+ * have a readable property like the transfer handler
+ */
protected Transferable createTransferable(JComponent c)
- throws NotImplementedException
{
- return null;
+ Transferable transferable = null;
+ if (propertyName != null)
+ {
+ PropertyDescriptor prop = getPropertyDescriptor(c);
+ if (prop != null)
+ transferable = new PropertyTransferable(c, prop);
+ }
+ return transferable;
}
public void exportAsDrag(JComponent c, InputEvent e, int action)
@@ -167,16 +337,64 @@ public class TransferHandler implements Serializable
// TODO: Implement this properly
}
- protected void exportDone(JComponent c, Transferable data, int action)
- throws NotImplementedException
+ /**
+ * This method is invoked after data has been exported.
+ * Subclasses should implement this method to remove the data that has been
+ * transferred when the action was <code>MOVE</code>.
+ *
+ * The default implementation does nothing because MOVE is not supported.
+ *
+ * @param c the source component
+ * @param data the data that has been transferred or <code>null</code>
+ * when the action is NONE
+ * @param action the action that has been performed
+ */
+ protected void exportDone(JComponent c, Transferable data, int action)
{
- // TODO: Implement this properly
+ // Nothing to do in the default implementation.
}
+ /**
+ * Exports the property of the component <code>c</code> that was
+ * specified for this TransferHandler to the clipboard, performing
+ * the specified action.
+ *
+ * This will check if the action is allowed by calling
+ * {@link #getSourceActions(JComponent)}. If the action is not allowed,
+ * then no export is performed.
+ *
+ * In either case the method {@link #exportDone} will be called with
+ * the action that has been performed, or {@link #NONE} if the action
+ * was not allowed or could otherwise not be completed.
+ * Any IllegalStateException that is thrown by the Clipboard due to
+ * beeing unavailable will be propagated through this method.
+ *
+ * @param c the component from which to export
+ * @param clip the clipboard to which the data will be exported
+ * @param action the action to perform
+ *
+ * @throws IllegalStateException when the clipboard is not available
+ */
public void exportToClipboard(JComponent c, Clipboard clip, int action)
- throws NotImplementedException
+ throws IllegalStateException
{
- // TODO: Implement this properly
+ action &= getSourceActions(c);
+ Transferable transferable = createTransferable(c);
+ if (transferable != null && action != NONE)
+ {
+ try
+ {
+ clip.setContents(transferable, null);
+ exportDone(c, transferable, action);
+ }
+ catch (IllegalStateException ex)
+ {
+ exportDone(c, transferable, NONE);
+ throw ex;
+ }
+ }
+ else
+ exportDone(c, null, NONE);
}
public int getSourceActions(JComponent c)
@@ -189,9 +407,124 @@ public class TransferHandler implements Serializable
return visualRepresentation;
}
+ /**
+ * Imports the transfer data represented by <code>t</code> into the specified
+ * component <code>c</code> by setting the property of this TransferHandler
+ * on that component. If this succeeds, this method returns
+ * <code>true</code>, otherwise <code>false</code>.
+ *
+ *
+ * @param c the component to import into
+ * @param t the transfer data to import
+ *
+ * @return <code>true</code> if the transfer succeeds, <code>false</code>
+ * otherwise
+ */
public boolean importData(JComponent c, Transferable t)
- throws NotImplementedException
{
- return false;
+ boolean ok = false;
+ PropertyDescriptor prop = getPropertyDescriptor(c);
+ if (prop != null)
+ {
+ Method writer = prop.getWriteMethod();
+ if (writer != null)
+ {
+ Class[] params = writer.getParameterTypes();
+ if (params.length == 1)
+ {
+ DataFlavor flavor = getPropertyDataFlavor(params[0],
+ t.getTransferDataFlavors());
+ if (flavor != null)
+ {
+ try
+ {
+ Object value = t.getTransferData(flavor);
+ writer.invoke(c, new Object[]{ value });
+ ok = true;
+ }
+ catch (Exception ex)
+ {
+ // If anything goes wrong here, do nothing and return
+ // false;
+ }
+ }
+ }
+ }
+ }
+ return ok;
+ }
+
+ /**
+ * Returns the property descriptor for the property of this TransferHandler
+ * in the specified component, or <code>null</code> if no such property
+ * exists in the component. This method only returns properties that are
+ * at least readable (that is, it has a public no-arg getter method).
+ *
+ * @param c the component to check
+ *
+ * @return the property descriptor for the property of this TransferHandler
+ * in the specified component, or <code>null</code> if no such
+ * property exists in the component
+ */
+ private PropertyDescriptor getPropertyDescriptor(JComponent c)
+ {
+ PropertyDescriptor prop = null;
+ if (propertyName != null)
+ {
+ Class clazz = c.getClass();
+ BeanInfo beanInfo;
+ try
+ {
+ beanInfo = Introspector.getBeanInfo(clazz);
+ }
+ catch (IntrospectionException ex)
+ {
+ beanInfo = null;
+ }
+ if (beanInfo != null)
+ {
+ PropertyDescriptor[] props = beanInfo.getPropertyDescriptors();
+ for (int i = 0; i < props.length && prop == null; i++)
+ {
+ PropertyDescriptor desc = props[i];
+ if (desc.getName().equals(propertyName))
+ {
+ Method reader = desc.getReadMethod();
+ if (reader != null)
+ {
+ Class[] params = reader.getParameterTypes();
+ if (params == null || params.length == 0)
+ prop = desc;
+ }
+ }
+ }
+ }
+ }
+ return prop;
+ }
+
+ /**
+ * Searches <code>flavors</code> to find a suitable data flavor that
+ * has the mime type application/x-java-jvm-local-objectref and a
+ * representation class that is the same as the specified <code>clazz</code>.
+ * When no such data flavor is found, this returns <code>null</code>.
+ *
+ * @param clazz the representation class required for the data flavor
+ * @param flavors the possible data flavors
+ *
+ * @return the suitable data flavor or null if none is found
+ */
+ private DataFlavor getPropertyDataFlavor(Class clazz, DataFlavor[] flavors)
+ {
+ DataFlavor found = null;
+ for (int i = 0; i < flavors.length && found == null; i++)
+ {
+ DataFlavor flavor = flavors[i];
+ if (flavor.getPrimaryType().equals("application")
+ && flavor.getSubType().equals("x-java-jvm-local-objectref")
+ && clazz.isAssignableFrom(flavor.getRepresentationClass()))
+ found = flavor;
+ }
+ return found;
}
}
diff --git a/libjava/classpath/javax/swing/UIDefaults.java b/libjava/classpath/javax/swing/UIDefaults.java
index bf5242f6552..9766cb05cec 100644
--- a/libjava/classpath/javax/swing/UIDefaults.java
+++ b/libjava/classpath/javax/swing/UIDefaults.java
@@ -63,7 +63,7 @@ import javax.swing.plaf.InputMapUIResource;
*
* @author Ronald Veldema (rveldema@cs.vu.nl)
*/
-public class UIDefaults extends Hashtable
+public class UIDefaults extends Hashtable<Object, Object>
{
/** Our ResourceBundles. */
@@ -672,7 +672,7 @@ public class UIDefaults extends Hashtable
*
* @return the UI class for <code>id</code>
*/
- public Class getUIClass(String id, ClassLoader loader)
+ public Class<? extends ComponentUI> getUIClass(String id, ClassLoader loader)
{
String className = (String) get(id);
if (className == null)
@@ -681,7 +681,7 @@ public class UIDefaults extends Hashtable
{
if (loader == null)
loader = ClassLoader.getSystemClassLoader();
- return loader.loadClass (className);
+ return (Class<? extends ComponentUI>) loader.loadClass (className);
}
catch (Exception e)
{
@@ -698,7 +698,7 @@ public class UIDefaults extends Hashtable
*
* @return the UI class for <code>id</code>
*/
- public Class getUIClass(String id)
+ public Class<? extends ComponentUI> getUIClass(String id)
{
return getUIClass (id, null);
}
diff --git a/libjava/classpath/javax/swing/UIManager.java b/libjava/classpath/javax/swing/UIManager.java
index 77be44afcbb..3b1b3f72b38 100644
--- a/libjava/classpath/javax/swing/UIManager.java
+++ b/libjava/classpath/javax/swing/UIManager.java
@@ -154,8 +154,16 @@ public class UIManager implements Serializable
UIDefaults fallback;
+ /**
+ * Creates a new <code>MultiplexUIDefaults</code> instance with
+ * <code>d</code> as the fallback defaults.
+ *
+ * @param d the fallback defaults (<code>null</code> not permitted).
+ */
MultiplexUIDefaults(UIDefaults d)
{
+ if (d == null)
+ throw new NullPointerException();
fallback = d;
}
@@ -400,6 +408,8 @@ public class UIManager implements Serializable
* @param key the key.
*
* @return The object.
+ *
+ * @since 1.4
*/
public static Object get(Object key, Locale locale)
{
@@ -407,61 +417,120 @@ public class UIManager implements Serializable
}
/**
- * Returns a boolean value from the defaults table,
- * <code>false</code> if key is not present.
+ * Returns a boolean value from the defaults table. If there is no value
+ * for the specified key, or the value is not an instance of {@link Boolean},
+ * this method returns <code>false</code>.
+ *
+ * @param key the key (<code>null</code> not permitted).
*
+ * @return The boolean value associated with the specified key.
+ *
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
+ *
* @since 1.4
*/
public static boolean getBoolean(Object key)
{
- Boolean value = (Boolean) get(key);
- return value != null ? value.booleanValue() : false;
+ Object value = get(key);
+ if (value instanceof Boolean)
+ return ((Boolean) value).booleanValue();
+ return false;
}
/**
- * Returns a boolean value from the defaults table,
- * <code>false</code> if key is not present.
+ * Returns a boolean value from the defaults table. If there is no value
+ * for the specified key, or the value is not an instance of {@link Boolean},
+ * this method returns <code>false</code>.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ * @param locale the locale.
*
+ * @return The boolean value associated with the specified key.
+ *
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
+ *
* @since 1.4
*/
public static boolean getBoolean(Object key, Locale locale)
{
- Boolean value = (Boolean) get(key, locale);
- return value != null ? value.booleanValue() : false;
+ Object value = get(key, locale);
+ if (value instanceof Boolean)
+ return ((Boolean) value).booleanValue();
+ return false;
}
/**
* Returns a border from the defaults table.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ *
+ * @return The border associated with the given key, or <code>null</code>.
+ *
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
*/
public static Border getBorder(Object key)
{
- return (Border) get(key);
+ Object value = get(key);
+ if (value instanceof Border)
+ return (Border) value;
+ return null;
}
/**
- * Returns a border from the defaults table.
+ * Returns a border from the defaults table.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ * @param locale the locale.
+ *
+ * @return The border associated with the given key, or <code>null</code>.
+ *
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
*
* @since 1.4
*/
public static Border getBorder(Object key, Locale locale)
{
- return (Border) get(key, locale);
+ Object value = get(key, locale);
+ if (value instanceof Border)
+ return (Border) value;
+ return null;
}
/**
* Returns a drawing color from the defaults table.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ *
+ * @return The color associated with the given key, or <code>null</code>.
+ *
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
*/
public static Color getColor(Object key)
{
- return (Color) get(key);
+ Object value = get(key);
+ if (value instanceof Color)
+ return (Color) value;
+ return null;
}
/**
* Returns a drawing color from the defaults table.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ * @param locale the locale.
+ *
+ * @return The color associated with the given key, or <code>null</code>.
+ *
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
+ *
+ * @since 1.4
*/
public static Color getColor(Object key, Locale locale)
{
- return (Color) get(key);
+ Object value = get(key, locale);
+ if (value instanceof Color)
+ return (Color) value;
+ return null;
}
/**
@@ -483,24 +552,44 @@ public class UIManager implements Serializable
public static UIDefaults getDefaults()
{
if (currentUIDefaults == null)
- currentUIDefaults = new MultiplexUIDefaults(null);
+ currentUIDefaults = new MultiplexUIDefaults(new UIDefaults());
return currentUIDefaults;
}
/**
* Returns a dimension from the defaults table.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ *
+ * @return The color associated with the given key, or <code>null</code>.
+ *
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
*/
public static Dimension getDimension(Object key)
{
- return (Dimension) get(key);
+ Object value = get(key);
+ if (value instanceof Dimension)
+ return (Dimension) value;
+ return null;
}
/**
* Returns a dimension from the defaults table.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ * @param locale the locale.
+ *
+ * @return The color associated with the given key, or <code>null</code>.
+ *
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
+ * @since 1.4
*/
public static Dimension getDimension(Object key, Locale locale)
{
- return (Dimension) get(key, locale);
+ Object value = get(key, locale);
+ if (value instanceof Dimension)
+ return (Dimension) value;
+ return null;
}
/**
@@ -510,10 +599,17 @@ public class UIManager implements Serializable
* @param key an Object that specifies the font. Typically,
* this is a String such as
* <code>TitledBorder.font</code>.
+ *
+ * @return The font associated with the given key, or <code>null</code>.
+ *
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
*/
public static Font getFont(Object key)
{
- return (Font) get(key);
+ Object value = get(key);
+ if (value instanceof Font)
+ return (Font) value;
+ return null;
}
/**
@@ -523,30 +619,66 @@ public class UIManager implements Serializable
* @param key an Object that specifies the font. Typically,
* this is a String such as
* <code>TitledBorder.font</code>.
+ * @param locale the locale.
+ *
+ * @return The font associated with the given key, or <code>null</code>.
+ *
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
+ *
+ * @since 1.4
*/
public static Font getFont(Object key, Locale locale)
{
- return (Font) get(key, locale);
+ Object value = get(key, locale);
+ if (value instanceof Font)
+ return (Font) value;
+ return null;
}
/**
- * Returns an Icon from the defaults table.
+ * Returns an icon from the defaults table.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ *
+ * @return The icon associated with the given key, or <code>null</code>.
+ *
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
*/
public static Icon getIcon(Object key)
{
- return (Icon) get(key);
+ Object value = get(key);
+ if (value instanceof Icon)
+ return (Icon) value;
+ return null;
}
/**
- * Returns an Icon from the defaults table.
+ * Returns an icon from the defaults table.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ * @param locale the locale.
+ *
+ * @return The icon associated with the given key, or <code>null</code>.
+ *
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
+ * @since 1.4
*/
public static Icon getIcon(Object key, Locale locale)
{
- return (Icon) get(key, locale);
+ Object value = get(key, locale);
+ if (value instanceof Icon)
+ return (Icon) value;
+ return null;
}
/**
* Returns an Insets object from the defaults table.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ *
+ * @return The insets associated with the given key, or <code>null</code>.
+ *
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
*/
public static Insets getInsets(Object key)
{
@@ -559,6 +691,14 @@ public class UIManager implements Serializable
/**
* Returns an Insets object from the defaults table.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ * @param locale the locale.
+ *
+ * @return The insets associated with the given key, or <code>null</code>.
+ *
+ * @throws NullPointerException if <code>key</code> is <code>null</code>.
+ * @since 1.4
*/
public static Insets getInsets(Object key, Locale locale)
{
@@ -580,20 +720,41 @@ public class UIManager implements Serializable
return installed;
}
+ /**
+ * Returns the integer value of the {@link Integer} associated with the
+ * given key. If there is no value, or the value is not an instance of
+ * {@link Integer}, this method returns 0.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ *
+ * @return The integer value associated with the given key, or 0.
+ */
public static int getInt(Object key)
{
- Integer x = (Integer) get(key);
- if (x == null)
- return 0;
- return x.intValue();
+ Object x = get(key);
+ if (x instanceof Integer)
+ return ((Integer) x).intValue();
+ return 0;
}
+ /**
+ * Returns the integer value of the {@link Integer} associated with the
+ * given key. If there is no value, or the value is not an instance of
+ * {@link Integer}, this method returns 0.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ * @param locale the locale.
+ *
+ * @return The integer value associated with the given key, or 0.
+ *
+ * @since 1.4
+ */
public static int getInt(Object key, Locale locale)
{
- Integer x = (Integer) get(key, locale);
- if (x == null)
- return 0;
- return x.intValue();
+ Object x = get(key, locale);
+ if (x instanceof Integer)
+ return ((Integer) x).intValue();
+ return 0;
}
/**
@@ -620,19 +781,38 @@ public class UIManager implements Serializable
}
/**
- * Returns a string from the defaults table.
+ * Returns the {@link String} associated with the given key. If the value
+ * is not a {@link String}, this method returns <code>null</code>.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ *
+ * @return The string associated with the given key, or <code>null</code>.
*/
public static String getString(Object key)
{
- return (String) get(key);
+ Object s = get(key);
+ if (s instanceof String)
+ return (String) s;
+ return null;
}
/**
- * Returns a string from the defaults table.
+ * Returns the {@link String} associated with the given key. If the value
+ * is not a {@link String}, this method returns <code>null</code>.
+ *
+ * @param key the key (<code>null</code> not permitted).
+ * @param locale the locale.
+ *
+ * @return The string associated with the given key, or <code>null</code>.
+ *
+ * @since 1.4
*/
public static String getString(Object key, Locale locale)
{
- return (String) get(key, locale);
+ Object s = get(key, locale);
+ if (s instanceof String)
+ return (String) s;
+ return null;
}
/**
@@ -686,6 +866,9 @@ public class UIManager implements Serializable
/**
* Stores an object in the defaults table.
+ *
+ * @param key the key.
+ * @param value the value.
*/
public static Object put(Object key, Object value)
{
diff --git a/libjava/classpath/javax/swing/border/CompoundBorder.java b/libjava/classpath/javax/swing/border/CompoundBorder.java
index 2ee639cf9a3..ba2e745aab5 100644
--- a/libjava/classpath/javax/swing/border/CompoundBorder.java
+++ b/libjava/classpath/javax/swing/border/CompoundBorder.java
@@ -115,15 +115,24 @@ public class CompoundBorder extends AbstractBorder
*/
public boolean isBorderOpaque()
{
- // While it would be safe to assume true for the opacity of
- // a null border, this behavior would not be according to
- // the API specification. Also, it is pathological to have
- // null borders anyway.
- if ((insideBorder == null) || (outsideBorder == null))
- return false;
-
- return insideBorder.isBorderOpaque()
- && outsideBorder.isBorderOpaque();
+ // Although the API specification states that this method
+ // returns true if both the inside and outside borders are non-null
+ // and opaque, and false otherwise, a mauve test shows that if both
+ // the inside or outside borders are null, then true is returned.
+ if ((insideBorder == null) && (outsideBorder == null))
+ return true;
+
+ // A mauve test shows that if the inside border has a null value,
+ // then true is returned if the outside border is opaque; if the
+ // outside border has a null value, then true is returned if the
+ // inside border is opaque; else, true is returned if both the
+ // inside and outside borders are opaque.
+ if (insideBorder == null)
+ return outsideBorder.isBorderOpaque();
+ else if (outsideBorder == null)
+ return insideBorder.isBorderOpaque();
+ else
+ return insideBorder.isBorderOpaque() && outsideBorder.isBorderOpaque();
}
/**
diff --git a/libjava/classpath/javax/swing/event/EventListenerList.java b/libjava/classpath/javax/swing/event/EventListenerList.java
index bde8b3c7e4f..1568039f0ff 100644
--- a/libjava/classpath/javax/swing/event/EventListenerList.java
+++ b/libjava/classpath/javax/swing/event/EventListenerList.java
@@ -37,6 +37,9 @@ exception statement from your version. */
package javax.swing.event;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.lang.reflect.Array;
import java.util.EventListener;
@@ -136,7 +139,7 @@ public class EventListenerList
*
* @throws NullPointerException if <code>t</code> is <code>null</code>.
*/
- public void add(Class t, EventListener listener)
+ public <T extends EventListener> void add(Class<T> t, T listener)
{
int oldLength;
Object[] newList;
@@ -175,7 +178,7 @@ public class EventListenerList
* <code>t</code>. Thus, subclasses of <code>t</code> will not be
* counted.
*/
- public int getListenerCount(Class t)
+ public int getListenerCount(Class<?> t)
{
int result = 0;
for (int i = 0; i < listenerList.length; i += 2)
@@ -224,7 +227,7 @@ public class EventListenerList
*
* @since 1.3
*/
- public EventListener[] getListeners(Class c)
+ public <T extends EventListener> T[] getListeners(Class<T> c)
{
int count, f;
EventListener[] result;
@@ -236,7 +239,7 @@ public class EventListenerList
if (listenerList[i] == c)
result[f++] = (EventListener) listenerList[i + 1];
- return result;
+ return (T[]) result;
}
@@ -253,7 +256,7 @@ public class EventListenerList
*
* @throws NullPointerException if <code>t</code> is <code>null</code>.
*/
- public void remove(Class t, EventListener listener)
+ public <T extends EventListener> void remove(Class<T> t, T listener)
{
Object[] oldList, newList;
int oldLength;
@@ -304,4 +307,51 @@ public class EventListenerList
}
return buf.toString();
}
+
+ /**
+ * Serializes an instance to an ObjectOutputStream.
+ *
+ * @param out the stream to serialize to
+ *
+ * @throws IOException if something goes wrong
+ */
+ private void writeObject(ObjectOutputStream out)
+ throws IOException
+ {
+ out.defaultWriteObject();
+ for (int i = 0; i < listenerList.length; i += 2)
+ {
+ Class cl = (Class) listenerList[i];
+ EventListener l = (EventListener) listenerList[i + 1];
+ if (l != null && l instanceof Serializable)
+ {
+ out.writeObject(cl.getName());
+ out.writeObject(l);
+ }
+ }
+ // Write end marker.
+ out.writeObject(null);
+ }
+
+ /**
+ * Deserializes an instance from an ObjectInputStream.
+ *
+ * @param in the input stream
+ *
+ * @throws ClassNotFoundException if a serialized class can't be found
+ * @throws IOException if something goes wrong
+ */
+ private <T extends EventListener> void readObject(ObjectInputStream in)
+ throws ClassNotFoundException, IOException
+ {
+ listenerList = NO_LISTENERS;
+ in.defaultReadObject();
+ Object type;
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ while ((type = in.readObject()) != null)
+ {
+ EventListener l = (EventListener) in.readObject();
+ add(((Class<T>) Class.forName((String) type, true, cl)), (T) l);
+ }
+ }
}
diff --git a/libjava/classpath/javax/swing/filechooser/FileSystemView.java b/libjava/classpath/javax/swing/filechooser/FileSystemView.java
index 84b80dd402c..41d865a964b 100644
--- a/libjava/classpath/javax/swing/filechooser/FileSystemView.java
+++ b/libjava/classpath/javax/swing/filechooser/FileSystemView.java
@@ -172,13 +172,8 @@ public abstract class FileSystemView
{
if (defaultFileSystemView == null)
{
- if (File.separator.equals("/"))
- defaultFileSystemView = new UnixFileSystemView();
- // FIXME: need to implement additional views
- // else if (File.Separator.equals("\"))
- // return new Win32FileSystemView();
- // else
- // return new GenericFileSystemView();
+ // FIXME: We need to support other file systems too.
+ defaultFileSystemView = new UnixFileSystemView();
}
return defaultFileSystemView;
}
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicButtonListener.java b/libjava/classpath/javax/swing/plaf/basic/BasicButtonListener.java
index 84895821518..c99de2c708c 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicButtonListener.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicButtonListener.java
@@ -54,15 +54,79 @@ import java.beans.PropertyChangeListener;
import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
+import javax.swing.Action;
+import javax.swing.ActionMap;
import javax.swing.ButtonModel;
+import javax.swing.InputMap;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
+import javax.swing.plaf.ActionMapUIResource;
+import javax.swing.plaf.ButtonUI;
-public class BasicButtonListener implements MouseListener, MouseMotionListener,
- FocusListener, ChangeListener, PropertyChangeListener
+public class BasicButtonListener
+ implements MouseListener, MouseMotionListener, FocusListener, ChangeListener,
+ PropertyChangeListener
{
+ /**
+ * Implements the keyboard action for Swing buttons.
+ */
+ private class ButtonAction
+ extends AbstractAction
+ {
+ /**
+ * The key for pressed action.
+ */
+ static final String PRESSED = "pressed";
+
+ /**
+ * The key for released action.
+ */
+ static final String RELEASED = "released";
+
+ /**
+ * Performs the action.
+ */
+ public void actionPerformed(ActionEvent event)
+ {
+ Object cmd = getValue("__command__");
+ AbstractButton b = (AbstractButton) event.getSource();
+ ButtonModel m = b.getModel();
+ if (PRESSED.equals(cmd))
+ {
+ m.setArmed(true);
+ m.setPressed(true);
+ if (! b.isFocusOwner())
+ b.requestFocus();
+ }
+ else if (RELEASED.equals(cmd))
+ {
+ m.setPressed(false);
+ m.setArmed(false);
+ }
+ }
+
+ /**
+ * Indicates if this action is enabled.
+ *
+ * @param source the source of the action
+ *
+ * @return <code>true</code> when enabled, <code>false</code> otherwise
+ */
+ public boolean isEnabled(Object source)
+ {
+ boolean enabled = true;
+ if (source instanceof AbstractButton)
+ {
+ AbstractButton b = (AbstractButton) source;
+ enabled = b.isEnabled();
+ }
+ return enabled;
+ }
+ }
+
public BasicButtonListener(AbstractButton b)
{
// Do nothing here.
@@ -73,12 +137,12 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener,
// Store the TextLayout for this in a client property for speed-up
// painting of the label.
String property = e.getPropertyName();
+ AbstractButton b = (AbstractButton) e.getSource();
if ((property.equals(AbstractButton.TEXT_CHANGED_PROPERTY)
|| property.equals("font"))
&& SystemProperties.getProperty("gnu.javax.swing.noGraphics2D")
== null)
{
- AbstractButton b = (AbstractButton) e.getSource();
String text = b.getText();
if (text == null)
text = "";
@@ -86,12 +150,25 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener,
false, false);
TextLayout layout = new TextLayout(text, b.getFont(), frc);
b.putClientProperty(BasicGraphicsUtils.CACHED_TEXT_LAYOUT, layout);
+
+ // Update HTML renderer.
+ BasicHTML.updateRenderer(b, b.getText());
+ }
+ else if (property.equals(AbstractButton.CONTENT_AREA_FILLED_CHANGED_PROPERTY))
+ {
+ checkOpacity(b);
}
}
-
+
+ /**
+ * Checks the <code>contentAreaFilled</code> property and updates the
+ * opaque property of the button.
+ *
+ * @param b the button to check
+ */
protected void checkOpacity(AbstractButton b)
{
- // TODO: What should be done here?
+ b.setOpaque(b.isContentAreaFilled());
}
public void focusGained(FocusEvent e)
@@ -116,6 +193,26 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener,
public void installKeyboardActions(JComponent c)
{
+ ButtonUI ui = ((AbstractButton) c).getUI();
+ if (ui instanceof BasicButtonUI)
+ {
+ // Install InputMap.
+ BasicButtonUI basicUI = (BasicButtonUI) ui;
+ String prefix = basicUI.getPropertyPrefix();
+ InputMap focusInputMap =
+ (InputMap) UIManager.get(prefix + "focusInputMap");
+ SwingUtilities.replaceUIInputMap(c, JComponent.WHEN_FOCUSED,
+ focusInputMap);
+
+ ActionMap am = (ActionMap) UIManager.get(prefix + "actionMap");
+ if (am == null)
+ {
+ am = createDefaultActionMap();
+ UIManager.put(prefix + "actionMap", am);
+ }
+ SwingUtilities.replaceUIActionMap(c, am);
+ }
+
c.getActionMap().put("pressed",
new AbstractAction()
{
@@ -142,31 +239,46 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener,
}
});
}
-
+
+ /**
+ * Creates and returns the default action map for Swing buttons.
+ *
+ * @return the default action map for Swing buttons
+ */
+ private ActionMap createDefaultActionMap()
+ {
+ Action action = new ButtonAction();
+ ActionMapUIResource am = new ActionMapUIResource();
+ am.put(ButtonAction.PRESSED, action);
+ am.put(ButtonAction.RELEASED, action);
+ return am;
+ }
+
public void uninstallKeyboardActions(JComponent c)
{
- c.getActionMap().put("pressed", null);
- c.getActionMap().put("released", null);
+ SwingUtilities.replaceUIActionMap(c, null);
+ SwingUtilities.replaceUIInputMap(c, JComponent.WHEN_FOCUSED, null);
}
public void stateChanged(ChangeEvent e)
{
- // TODO: What should be done here, if anything?
+ // Need to repaint when the button state changes.
+ ((AbstractButton) e.getSource()).repaint();
}
public void mouseMoved(MouseEvent e)
{
- // TODO: What should be done here, if anything?
+ // Nothing to do here.
}
public void mouseDragged(MouseEvent e)
{
- // TODO: What should be done here, if anything?
+ // Nothing to do here.
}
public void mouseClicked(MouseEvent e)
{
- // TODO: What should be done here, if anything?
+ // Nothing to do here.
}
/**
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicButtonUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicButtonUI.java
index d531133ba26..9f685bb7bfd 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicButtonUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicButtonUI.java
@@ -42,12 +42,14 @@ import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
+import java.awt.Insets;
import java.awt.Rectangle;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
import javax.swing.Icon;
-import javax.swing.InputMap;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.LookAndFeel;
@@ -56,6 +58,7 @@ import javax.swing.UIManager;
import javax.swing.plaf.ButtonUI;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource;
+import javax.swing.text.View;
/**
* A UI delegate for the {@link JButton} component.
@@ -63,6 +66,39 @@ import javax.swing.plaf.UIResource;
public class BasicButtonUI extends ButtonUI
{
/**
+ * Cached rectangle for layouting the label. Used in paint() and
+ * BasicGraphicsUtils.getPreferredButtonSize().
+ */
+ static Rectangle viewR = new Rectangle();
+
+ /**
+ * Cached rectangle for layouting the label. Used in paint() and
+ * BasicGraphicsUtils.getPreferredButtonSize().
+ */
+ static Rectangle iconR = new Rectangle();
+
+ /**
+ * Cached rectangle for layouting the label. Used in paint() and
+ * BasicGraphicsUtils.getPreferredButtonSize().
+ */
+ static Rectangle textR = new Rectangle();
+
+ /**
+ * Cached Insets instance, used in paint().
+ */
+ static Insets cachedInsets;
+
+ /**
+ * The shared button UI.
+ */
+ private static BasicButtonUI sharedUI;
+
+ /**
+ * The shared BasicButtonListener.
+ */
+ private static BasicButtonListener sharedListener;
+
+ /**
* A constant used to pad out elements in the button's layout and
* preferred size calculations.
*/
@@ -86,7 +122,9 @@ public class BasicButtonUI extends ButtonUI
*/
public static ComponentUI createUI(final JComponent c)
{
- return new BasicButtonUI();
+ if (sharedUI == null)
+ sharedUI = new BasicButtonUI();
+ return sharedUI;
}
/**
@@ -153,14 +191,29 @@ public class BasicButtonUI extends ButtonUI
protected void installDefaults(AbstractButton b)
{
String prefix = getPropertyPrefix();
+ // Install colors and font.
LookAndFeel.installColorsAndFont(b, prefix + "background",
prefix + "foreground", prefix + "font");
+ // Install border.
LookAndFeel.installBorder(b, prefix + "border");
+
+ // Install margin property.
if (b.getMargin() == null || b.getMargin() instanceof UIResource)
b.setMargin(UIManager.getInsets(prefix + "margin"));
- b.setIconTextGap(UIManager.getInt(prefix + "textIconGap"));
- b.setInputMap(JComponent.WHEN_FOCUSED,
- (InputMap) UIManager.get(prefix + "focusInputMap"));
+
+ // Install rollover property.
+ Object rollover = UIManager.get(prefix + "rollover");
+ if (rollover != null)
+ LookAndFeel.installProperty(b, "rolloverEnabled", rollover);
+
+ // Fetch default textShiftOffset.
+ defaultTextShiftOffset = UIManager.getInt(prefix + "textShiftOffset");
+
+ // Make button opaque if needed.
+ if (b.isContentAreaFilled())
+ LookAndFeel.installProperty(b, "opaque", Boolean.TRUE);
+ else
+ LookAndFeel.installProperty(b, "opaque", Boolean.FALSE);
}
/**
@@ -170,21 +223,10 @@ public class BasicButtonUI extends ButtonUI
*/
protected void uninstallDefaults(AbstractButton b)
{
- if (b.getFont() instanceof UIResource)
- b.setFont(null);
- if (b.getForeground() instanceof UIResource)
- b.setForeground(null);
- if (b.getBackground() instanceof UIResource)
- b.setBackground(null);
- if (b.getBorder() instanceof UIResource)
- b.setBorder(null);
- b.setIconTextGap(defaultTextIconGap);
- if (b.getMargin() instanceof UIResource)
- b.setMargin(null);
+ // The other properties aren't uninstallable.
+ LookAndFeel.uninstallBorder(b);
}
- protected BasicButtonListener listener;
-
/**
* Creates and returns a new instance of {@link BasicButtonListener}. This
* method provides a hook to make it easy for subclasses to install a
@@ -196,7 +238,13 @@ public class BasicButtonUI extends ButtonUI
*/
protected BasicButtonListener createButtonListener(AbstractButton b)
{
- return new BasicButtonListener(b);
+ // Note: The RI always returns a new instance here. However,
+ // the BasicButtonListener class is perfectly suitable to be shared
+ // between multiple buttons, so we return a shared instance here
+ // for efficiency.
+ if (sharedListener == null)
+ sharedListener = new BasicButtonListener(b);
+ return sharedListener;
}
/**
@@ -206,12 +254,19 @@ public class BasicButtonUI extends ButtonUI
*/
protected void installListeners(AbstractButton b)
{
- listener = createButtonListener(b);
- b.addChangeListener(listener);
- b.addPropertyChangeListener(listener);
- b.addFocusListener(listener);
- b.addMouseListener(listener);
- b.addMouseMotionListener(listener);
+ BasicButtonListener listener = createButtonListener(b);
+ if (listener != null)
+ {
+ b.addChangeListener(listener);
+ b.addPropertyChangeListener(listener);
+ b.addFocusListener(listener);
+ b.addMouseListener(listener);
+ b.addMouseMotionListener(listener);
+ }
+ // Fire synthetic property change event to let the listener update
+ // the TextLayout cache.
+ listener.propertyChange(new PropertyChangeEvent(b, "font", null,
+ b.getFont()));
}
/**
@@ -221,21 +276,29 @@ public class BasicButtonUI extends ButtonUI
*/
protected void uninstallListeners(AbstractButton b)
{
- b.removeChangeListener(listener);
- b.removePropertyChangeListener(listener);
- b.removeFocusListener(listener);
- b.removeMouseListener(listener);
- b.removeMouseMotionListener(listener);
+ BasicButtonListener listener = getButtonListener(b);
+ if (listener != null)
+ {
+ b.removeChangeListener(listener);
+ b.removePropertyChangeListener(listener);
+ b.removeFocusListener(listener);
+ b.removeMouseListener(listener);
+ b.removeMouseMotionListener(listener);
+ }
}
protected void installKeyboardActions(AbstractButton b)
{
- listener.installKeyboardActions(b);
+ BasicButtonListener listener = getButtonListener(b);
+ if (listener != null)
+ listener.installKeyboardActions(b);
}
protected void uninstallKeyboardActions(AbstractButton b)
{
- listener.uninstallKeyboardActions(b);
+ BasicButtonListener listener = getButtonListener(b);
+ if (listener != null)
+ listener.uninstallKeyboardActions(b);
}
/**
@@ -253,9 +316,75 @@ public class BasicButtonUI extends ButtonUI
{
AbstractButton b = (AbstractButton) c;
installDefaults(b);
+ // It is important to install the listeners before installing
+ // the keyboard actions, because the keyboard actions
+ // are actually installed on the listener instance.
installListeners(b);
installKeyboardActions(b);
+ BasicHTML.updateRenderer(b, b.getText());
+ }
+ }
+
+ /**
+ * Uninstalls the UI from the component.
+ *
+ * @param c the component from which to uninstall the UI
+ */
+ public void uninstallUI(JComponent c)
+ {
+ if (c instanceof AbstractButton)
+ {
+ AbstractButton b = (AbstractButton) c;
+ uninstallKeyboardActions(b);
+ uninstallListeners(b);
+ uninstallDefaults(b);
+ BasicHTML.updateRenderer(b, "");
+ b.putClientProperty(BasicGraphicsUtils.CACHED_TEXT_LAYOUT, null);
+ }
+ }
+
+ /**
+ * Calculates the minimum size for the specified component.
+ *
+ * @param c the component for which to compute the minimum size
+ *
+ * @return the minimum size for the specified component
+ */
+ public Dimension getMinimumSize(JComponent c)
+ {
+ Dimension size = getPreferredSize(c);
+ // When the HTML view has a minimum width different from the preferred
+ // width, then substract this here accordingly. The height is not
+ // affected by that.
+ View html = (View) c.getClientProperty(BasicHTML.propertyKey);
+ if (html != null)
+ {
+ size.width -= html.getPreferredSpan(View.X_AXIS)
+ - html.getPreferredSpan(View.X_AXIS);
}
+ return size;
+ }
+
+ /**
+ * Calculates the maximum size for the specified component.
+ *
+ * @param c the component for which to compute the maximum size
+ *
+ * @return the maximum size for the specified component
+ */
+ public Dimension getMaximumSize(JComponent c)
+ {
+ Dimension size = getPreferredSize(c);
+ // When the HTML view has a maximum width different from the preferred
+ // width, then add this here accordingly. The height is not
+ // affected by that.
+ View html = (View) c.getClientProperty(BasicHTML.propertyKey);
+ if (html != null)
+ {
+ size.width += html.getMaximumSpan(View.X_AXIS)
+ - html.getPreferredSpan(View.X_AXIS);
+ }
+ return size;
}
/**
@@ -269,8 +398,8 @@ public class BasicButtonUI extends ButtonUI
public Dimension getPreferredSize(JComponent c)
{
AbstractButton b = (AbstractButton) c;
- Dimension d = BasicGraphicsUtils.getPreferredButtonSize(b,
- defaultTextIconGap + defaultTextShiftOffset);
+ Dimension d = BasicGraphicsUtils.getPreferredButtonSize(b,
+ b.getIconTextGap());
return d;
}
@@ -315,38 +444,50 @@ public class BasicButtonUI extends ButtonUI
{
AbstractButton b = (AbstractButton) c;
- Rectangle tr = new Rectangle();
- Rectangle ir = new Rectangle();
- Rectangle vr = new Rectangle();
+ Insets i = c.getInsets(cachedInsets);
+ viewR.x = i.left;
+ viewR.y = i.top;
+ viewR.width = c.getWidth() - i.left - i.right;
+ viewR.height = c.getHeight() - i.top - i.bottom;
+ textR.x = 0;
+ textR.y = 0;
+ textR.width = 0;
+ textR.height = 0;
+ iconR.x = 0;
+ iconR.y = 0;
+ iconR.width = 0;
+ iconR.height = 0;
Font f = c.getFont();
-
g.setFont(f);
+ Icon icon = b.getIcon();
+ String text = b.getText();
+ text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f),
+ text, icon,
+ b.getVerticalAlignment(),
+ b.getHorizontalAlignment(),
+ b.getVerticalTextPosition(),
+ b.getHorizontalTextPosition(),
+ viewR, iconR, textR,
+ text == null ? 0
+ : b.getIconTextGap());
- if (b.isBorderPainted())
- SwingUtilities.calculateInnerArea(b, vr);
- else
- vr = SwingUtilities.getLocalBounds(b);
- String text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f),
- b.getText(),
- currentIcon(b),
- b.getVerticalAlignment(),
- b.getHorizontalAlignment(),
- b.getVerticalTextPosition(),
- b.getHorizontalTextPosition(),
- vr, ir, tr,
- b.getIconTextGap()
- + defaultTextShiftOffset);
-
- if ((b.getModel().isArmed() && b.getModel().isPressed())
- || b.isSelected())
+ ButtonModel model = b.getModel();
+ if (model.isArmed() && model.isPressed())
paintButtonPressed(g, b);
-
- paintIcon(g, c, ir);
+
+ if (icon != null)
+ paintIcon(g, c, iconR);
if (text != null)
- paintText(g, b, tr, text);
+ {
+ View html = (View) b.getClientProperty(BasicHTML.propertyKey);
+ if (html != null)
+ html.paint(g, textR);
+ else
+ paintText(g, b, textR, text);
+ }
if (b.isFocusOwner() && b.isFocusPainted())
- paintFocus(g, b, vr, tr, ir);
+ paintFocus(g, b, viewR, textR, iconR);
}
/**
@@ -386,7 +527,16 @@ public class BasicButtonUI extends ButtonUI
Icon i = currentIcon(b);
if (i != null)
- i.paintIcon(c, g, iconRect.x, iconRect.y);
+ {
+ ButtonModel m = b.getModel();
+ if (m.isPressed() && m.isArmed())
+ {
+ int offs = getTextShiftOffset();
+ i.paintIcon(c, g, iconRect.x + offs, iconRect.y + offs);
+ }
+ else
+ i.paintIcon(c, g, iconRect.x, iconRect.y);
+ }
}
/**
@@ -419,22 +569,7 @@ public class BasicButtonUI extends ButtonUI
protected void paintText(Graphics g, JComponent c, Rectangle textRect,
String text)
{
- paintText(g, (AbstractButton) c, textRect, text);
- }
-
- /**
- * Paints the "text" property of an {@link AbstractButton}.
- *
- * @param g The graphics context to paint with
- * @param b The button to paint the state of
- * @param textRect The area in which to paint the text
- * @param text The text to paint
- *
- * @since 1.4
- */
- protected void paintText(Graphics g, AbstractButton b, Rectangle textRect,
- String text)
- {
+ AbstractButton b = (AbstractButton) c;
Font f = b.getFont();
g.setFont(f);
FontMetrics fm = g.getFontMetrics(f);
@@ -454,5 +589,48 @@ public class BasicButtonUI extends ButtonUI
BasicGraphicsUtils.drawString(b, g, text, -1, textRect.x,
textRect.y + fm.getAscent());
}
+ }
+
+ /**
+ * Paints the "text" property of an {@link AbstractButton}.
+ *
+ * @param g The graphics context to paint with
+ * @param b The button to paint the state of
+ * @param textRect The area in which to paint the text
+ * @param text The text to paint
+ *
+ * @since 1.4
+ */
+ protected void paintText(Graphics g, AbstractButton b, Rectangle textRect,
+ String text)
+ {
+ paintText(g, (JComponent) b, textRect, text);
}
+
+ /**
+ * A helper method that finds the BasicButtonListener for the specified
+ * button. This is there because this UI class is stateless and
+ * shared for all buttons, and thus can't store the listener
+ * as instance field. (We store our shared instance in sharedListener,
+ * however, subclasses may override createButtonListener() and we would
+ * be lost in this case).
+ *
+ * @param b the button
+ *
+ * @return the UI event listener
+ */
+ private BasicButtonListener getButtonListener(AbstractButton b)
+ {
+ // The listener gets installed as PropertyChangeListener,
+ // so look for it in the list of property change listeners.
+ PropertyChangeListener[] listeners = b.getPropertyChangeListeners();
+ BasicButtonListener l = null;
+ for (int i = 0; listeners != null && l == null && i < listeners.length;
+ i++)
+ {
+ if (listeners[i] instanceof BasicButtonListener)
+ l = (BasicButtonListener) listeners[i];
+ }
+ return l;
+ }
}
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicDirectoryModel.java b/libjava/classpath/javax/swing/plaf/basic/BasicDirectoryModel.java
index ed916cb5f1a..de82bd47bb6 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicDirectoryModel.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicDirectoryModel.java
@@ -381,7 +381,7 @@ public class BasicDirectoryModel extends AbstractListModel
*
* @return a Vector
*/
- public Vector getDirectories()
+ public Vector<File> getDirectories()
{
// Synchronize this with the UpdateSwingRequest for the case when
// contents is modified.
@@ -418,7 +418,7 @@ public class BasicDirectoryModel extends AbstractListModel
*
* @return a Vector
*/
- public Vector getFiles()
+ public Vector<File> getFiles()
{
synchronized (contents)
{
@@ -562,7 +562,7 @@ public class BasicDirectoryModel extends AbstractListModel
*
* @param v The Vector to sort.
*/
- protected void sort(Vector v)
+ protected void sort(Vector<? extends File> v)
{
Collections.sort(v, comparator);
}
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java
index dc1c051225c..e1f8e4b28ba 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java
@@ -183,7 +183,7 @@ public class BasicFileChooserUI extends FileChooserUI
protected class BasicFileView extends FileView
{
/** Storage for cached icons. */
- protected Hashtable iconCache = new Hashtable();
+ protected Hashtable<File, Icon> iconCache = new Hashtable<File, Icon>();
/**
* Creates a new instance.
@@ -444,10 +444,10 @@ public class BasicFileChooserUI extends FileChooserUI
setDirectory(null);
}
lastSelected = path;
- parentPath = path.substring(0, path.lastIndexOf("/") + 1);
+ parentPath = f.getParent();
if (f.isFile())
- setFileName(path.substring(path.lastIndexOf("/") + 1));
+ setFileName(f.getName());
else if (filechooser.getFileSelectionMode() !=
JFileChooser.FILES_ONLY)
setFileName(path);
@@ -827,9 +827,9 @@ public class BasicFileChooserUI extends FileChooserUI
installComponents(fc);
installListeners(fc);
- Object path = filechooser.getCurrentDirectory();
+ File path = filechooser.getCurrentDirectory();
if (path != null)
- parentPath = path.toString().substring(path.toString().lastIndexOf("/"));
+ parentPath = path.getParent();
}
}
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicGraphicsUtils.java b/libjava/classpath/javax/swing/plaf/basic/BasicGraphicsUtils.java
index 1e84be93282..4c270682d88 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicGraphicsUtils.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicGraphicsUtils.java
@@ -748,7 +748,6 @@ public class BasicGraphicsUtils
}
}
-
/**
* Determines the preferred width and height of an AbstractButton,
* given the gap between the button&#x2019;s text and icon.
@@ -769,24 +768,31 @@ public class BasicGraphicsUtils
public static Dimension getPreferredButtonSize(AbstractButton b,
int textIconGap)
{
- Rectangle contentRect;
- Rectangle viewRect;
- Rectangle iconRect = new Rectangle();
- Rectangle textRect = new Rectangle();
- Insets insets = b.getInsets();
-
- viewRect = new Rectangle();
-
- /* java.awt.Toolkit.getFontMetrics is deprecated. However, it
- * seems not obvious how to get to the correct FontMetrics object
- * otherwise. The real problem probably is that the method
- * javax.swing.SwingUtilities.layoutCompundLabel should take a
- * LineMetrics, not a FontMetrics argument. But fixing this that
- * would change the public API.
- */
+ // These cached rectangles are use here and in BasicButtonUI.paint(),
+ // so these two methods must never be executed concurrently. Maybe
+ // we must use other Rectangle instances here. OTOH, Swing is
+ // designed to be not thread safe, and every layout and paint operation
+ // should be performed from the EventDispatchThread, so it _should_ be
+ // OK to do this optimization.
+ Rectangle viewRect = BasicButtonUI.viewR;
+ viewRect.x = 0;
+ viewRect.y = 0;
+ viewRect.width = Short.MAX_VALUE;
+ viewRect.height = Short.MAX_VALUE;
+ Rectangle iconRect = BasicButtonUI.iconR;
+ iconRect.x = 0;
+ iconRect.y = 0;
+ iconRect.width = 0;
+ iconRect.height = 0;
+ Rectangle textRect = BasicButtonUI.textR;
+ textRect.x = 0;
+ textRect.y = 0;
+ textRect.width = 0;
+ textRect.height = 0;
+
SwingUtilities.layoutCompoundLabel(
b, // for the component orientation
- b.getToolkit().getFontMetrics(b.getFont()), // see comment above
+ b.getFontMetrics(b.getFont()), // see comment above
b.getText(),
b.getIcon(),
b.getVerticalAlignment(),
@@ -804,13 +810,12 @@ public class BasicGraphicsUtils
* +------------------------+ +------------------------+
*/
- contentRect = textRect.union(iconRect);
-
- return new Dimension(insets.left
- + contentRect.width
- + insets.right + b.getHorizontalAlignment(),
- insets.top
- + contentRect.height
- + insets.bottom);
+ Rectangle contentRect =
+ SwingUtilities.computeUnion(textRect.x, textRect.y, textRect.width,
+ textRect.height, iconRect);
+
+ Insets insets = b.getInsets();
+ return new Dimension(insets.left + contentRect.width + insets.right,
+ insets.top + contentRect.height + insets.bottom);
}
}
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicHTML.java b/libjava/classpath/javax/swing/plaf/basic/BasicHTML.java
index 98c9cb277f4..6e26d5355a2 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicHTML.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicHTML.java
@@ -48,6 +48,7 @@ import java.io.StringReader;
import javax.swing.JComponent;
import javax.swing.SwingConstants;
import javax.swing.event.DocumentEvent;
+import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.EditorKit;
@@ -107,6 +108,7 @@ public class BasicHTML
editorKit = kit;
document = doc;
setView(view);
+ setSize(view.getPreferredSpan(X_AXIS), view.getPreferredSpan(Y_AXIS));
}
/**
@@ -151,6 +153,14 @@ public class BasicHTML
}
/**
+ * Overridden to forward to real view.
+ */
+ public void setSize(float w, float h)
+ {
+ view.setSize(w, h);
+ }
+
+ /**
* Returns the real root view, regardless of the index.
*
* @param index not used here
@@ -346,6 +356,22 @@ public class BasicHTML
{
return document;
}
+
+ /**
+ * Overridden to return null, as a RootView has no attributes on its own.
+ */
+ public AttributeSet getAttributes()
+ {
+ return null;
+ }
+
+ /**
+ * Overridden to provide an element for the view.
+ */
+ public Element getElement()
+ {
+ return view.getElement();
+ }
}
/**
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java b/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
index 11980f6ca2e..ea8b4603691 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
@@ -177,9 +177,15 @@ public class BasicInternalFrameTitlePane extends JComponent
try
{
if (frame.isMaximizable() && ! frame.isMaximum())
- frame.setMaximum(true);
+ {
+ frame.setMaximum(true);
+ maxButton.setIcon(minIcon);
+ }
else if (frame.isMaximum())
- frame.setMaximum(false);
+ {
+ frame.setMaximum(false);
+ maxButton.setIcon(maxIcon);
+ }
}
catch (PropertyVetoException pve)
{
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java
index 8f2181336cb..87c5268c8c7 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java
@@ -459,18 +459,12 @@ public class BasicInternalFrameUI extends InternalFrameUI
{
if (frame.isMaximum())
{
- JDesktopPane pane = (JDesktopPane) e.getSource();
- Insets insets = pane.getInsets();
- Rectangle bounds = pane.getBounds();
-
- frame.setBounds(bounds.x + insets.left, bounds.y + insets.top,
- bounds.width - insets.left - insets.right,
- bounds.height - insets.top - insets.bottom);
- frame.revalidate();
- frame.repaint();
+ Container parent = frame.getParent();
+ Insets i = parent.getInsets();
+ int width = parent.getWidth() - i.left - i.right;
+ int height = parent.getHeight() - i.top - i.bottom;
+ frame.setBounds(0, 0, width, height);
}
-
- // Sun also resizes the icons. but it doesn't seem to do anything.
}
/**
@@ -949,17 +943,25 @@ public class BasicInternalFrameUI extends InternalFrameUI
{
if (evt.getNewValue() == Boolean.TRUE)
{
+ Container parent = frame.getParent();
+ if (parent != null)
+ parent.removeComponentListener(componentListener);
closeFrame(frame);
}
}
- /*
- * FIXME: need to add ancestor properties to JComponents. else if
- * (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if
- * (desktopPane != null)
- * desktopPane.removeComponentListener(componentListener); desktopPane =
- * frame.getDesktopPane(); if (desktopPane != null)
- * desktopPane.addComponentListener(componentListener); }
- */
+ else if (property.equals("ancestor"))
+ {
+ Container newParent = (Container) evt.getNewValue();
+ Container oldParent = (Container) evt.getOldValue();
+ if (newParent != null)
+ {
+ newParent.addComponentListener(componentListener);
+ }
+ else if (oldParent != null)
+ {
+ oldParent.removeComponentListener(componentListener);
+ }
+ }
}
}
@@ -1258,6 +1260,12 @@ public class BasicInternalFrameUI extends InternalFrameUI
frame.addPropertyChangeListener(propertyChangeListener);
frame.getRootPane().getGlassPane().addMouseListener(glassPaneDispatcher);
frame.getRootPane().getGlassPane().addMouseMotionListener(glassPaneDispatcher);
+
+ Container parent = frame.getParent();
+ if (parent != null)
+ {
+ parent.addComponentListener(componentListener);
+ }
}
/**
@@ -1286,8 +1294,13 @@ public class BasicInternalFrameUI extends InternalFrameUI
*/
protected void uninstallListeners()
{
- if (desktopPane != null)
- desktopPane.removeComponentListener(componentListener);
+
+ Container parent = frame.getParent();
+ if (parent != null)
+ {
+ parent.removeComponentListener(componentListener);
+ }
+ componentListener = null;
frame.getRootPane().getGlassPane().removeMouseMotionListener(glassPaneDispatcher);
frame.getRootPane().getGlassPane().removeMouseListener(glassPaneDispatcher);
@@ -1298,7 +1311,7 @@ public class BasicInternalFrameUI extends InternalFrameUI
frame.removeMouseListener(borderListener);
propertyChangeListener = null;
- componentListener = null;
+
borderListener = null;
internalFrameListener = null;
glassPaneDispatcher = null;
@@ -1581,6 +1594,13 @@ public class BasicInternalFrameUI extends InternalFrameUI
{
replacePane(northPane, c);
northPane = c;
+ // the following is needed to make internal frames draggable when using
+ // the JGoodies PlasticLookAndFeel, because it overrides the
+ // createNorthPane() method and doesn't assign anything to the titlePane
+ // field. It is possible there is another way to make this work, but
+ // I didn't find it...
+ if (c instanceof BasicInternalFrameTitlePane)
+ titlePane = (BasicInternalFrameTitlePane) c;
}
/**
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicLabelUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicLabelUI.java
index 304e13ad735..1ec020b1c0b 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicLabelUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicLabelUI.java
@@ -119,13 +119,37 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener
{
JLabel lab = (JLabel) c;
Insets insets = lab.getInsets();
- FontMetrics fm = lab.getFontMetrics(lab.getFont());
- layoutCL(lab, fm, lab.getText(), lab.getIcon(), vr, ir, tr);
- Rectangle cr = SwingUtilities.computeUnion(tr.x, tr.y, tr.width, tr.height,
- ir);
- return new Dimension(insets.left + cr.width + insets.right, insets.top
- + cr.height + insets.bottom);
-
+ int insetsX = insets.left + insets.right;
+ int insetsY = insets.top + insets.bottom;
+ Icon icon = lab.getIcon();
+ String text = lab.getText();
+ Dimension ret;
+ if (icon == null && text == null)
+ ret = new Dimension(insetsX, insetsY);
+ else if (icon != null && text == null)
+ ret = new Dimension(icon.getIconWidth() + insetsX,
+ icon.getIconHeight() + insetsY);
+ else
+ {
+ FontMetrics fm = lab.getFontMetrics(lab.getFont());
+ ir.x = 0;
+ ir.y = 0;
+ ir.width = 0;
+ ir.height = 0;
+ tr.x = 0;
+ tr.y = 0;
+ tr.width = 0;
+ tr.height = 0;
+ vr.x = 0;
+ vr.y = 0;
+ vr.width = Short.MAX_VALUE;
+ vr.height = Short.MAX_VALUE;
+ layoutCL(lab, fm, text, icon, vr, ir, tr);
+ Rectangle cr = SwingUtilities.computeUnion(tr.x, tr.y, tr.width,
+ tr.height, ir);
+ ret = new Dimension(cr.width + insetsX, cr.height + insetsY);
+ }
+ return ret;
}
/**
@@ -166,13 +190,20 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener
{
JLabel b = (JLabel) c;
FontMetrics fm = g.getFontMetrics();
- vr = SwingUtilities.calculateInnerArea(c, vr);
-
- if (vr.width < 0)
- vr.width = 0;
- if (vr.height < 0)
- vr.height = 0;
+ Insets i = c.getInsets();
+ vr.x = i.left;
+ vr.y = i.right;
+ vr.width = c.getWidth() - i.left + i.right;
+ vr.height = c.getHeight() - i.top + i.bottom;
+ ir.x = 0;
+ ir.y = 0;
+ ir.width = 0;
+ ir.height = 0;
+ tr.x = 0;
+ tr.y = 0;
+ tr.width = 0;
+ tr.height = 0;
Icon icon = (b.isEnabled()) ? b.getIcon() : b.getDisabledIcon();
String text = layoutCL(b, fm, b.getText(), icon, vr, ir, tr);
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicListUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicListUI.java
index 493fc0578e3..befc227364a 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicListUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicListUI.java
@@ -921,7 +921,7 @@ public class BasicListUI extends ListUI
*/
protected void maybeUpdateLayoutState()
{
- if (updateLayoutStateNeeded != 0)
+ if (updateLayoutStateNeeded != 0 || !list.isValid())
{
updateLayoutState();
updateLayoutStateNeeded = 0;
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java b/libjava/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java
index c056a2403f9..15430945468 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java
@@ -1062,8 +1062,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel
"ProgressBar.repaintInterval", new Integer(50),
"ProgressBar.cycleTime", new Integer(3000),
"RadioButton.background", new ColorUIResource(light),
- "RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null,
- null),
+ "RadioButton.border", BasicBorders.getRadioButtonBorder(),
"RadioButton.darkShadow", new ColorUIResource(shadow),
"RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
KeyStroke.getKeyStroke("SPACE"), "pressed",
@@ -1183,6 +1182,10 @@ public abstract class BasicLookAndFeel extends LookAndFeel
"Slider.thumbHeight", new Integer(20),
"Slider.thumbWidth", new Integer(11),
"Slider.tickHeight", new Integer(12),
+ "Slider.horizontalSize", new Dimension(200, 21),
+ "Slider.verticalSize", new Dimension(21, 200),
+ "Slider.minimumHorizontalSize", new Dimension(36, 21),
+ "Slider.minimumVerticalSize", new Dimension(21, 36),
"Spinner.background", new ColorUIResource(light),
"Spinner.foreground", new ColorUIResource(light),
"Spinner.arrowButtonSize", new DimensionUIResource(16, 5),
@@ -1218,10 +1221,10 @@ public abstract class BasicLookAndFeel extends LookAndFeel
"ctrl UP", "requestFocus",
"ctrl KP_UP", "requestFocus"
}),
- "TabbedPane.background", new ColorUIResource(light),
+ "TabbedPane.background", new ColorUIResource(192, 192, 192),
"TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3),
- "TabbedPane.darkShadow", new ColorUIResource(shadow),
- "TabbedPane.focus", new ColorUIResource(darkShadow),
+ "TabbedPane.darkShadow", new ColorUIResource(Color.black),
+ "TabbedPane.focus", new ColorUIResource(Color.black),
"TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
KeyStroke.getKeyStroke("ctrl DOWN"), "requestFocusForVisibleComponent",
KeyStroke.getKeyStroke("KP_UP"), "navigateUp",
@@ -1235,17 +1238,16 @@ public abstract class BasicLookAndFeel extends LookAndFeel
KeyStroke.getKeyStroke("DOWN"), "navigateDown"
}),
"TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12),
- "TabbedPane.foreground", new ColorUIResource(darkShadow),
- "TabbedPane.highlight", new ColorUIResource(highLight),
- "TabbedPane.light", new ColorUIResource(highLight),
+ "TabbedPane.foreground", new ColorUIResource(Color.black),
+ "TabbedPane.highlight", new ColorUIResource(Color.white),
+ "TabbedPane.light", new ColorUIResource(192, 192, 192),
"TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1),
- "TabbedPane.shadow", new ColorUIResource(shadow),
- "TabbedPane.tabbedPaneContentBorderInsets", new InsetsUIResource(3, 2, 1, 2),
- "TabbedPane.tabbedPaneTabPadInsets", new InsetsUIResource(1, 1, 1, 1),
+ "TabbedPane.shadow", new ColorUIResource(128, 128, 128),
"TabbedPane.tabsOpaque", Boolean.TRUE,
"TabbedPane.tabAreaInsets", new InsetsUIResource(3, 2, 0, 2),
"TabbedPane.tabInsets", new InsetsUIResource(0, 4, 1, 4),
"TabbedPane.tabRunOverlay", new Integer(2),
+ "TabbedPane.tabsOverlapBorder", Boolean.FALSE,
"TabbedPane.textIconGap", new Integer(4),
"Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
"ctrl DOWN", "selectNextRowChangeLead",
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicMenuItemUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicMenuItemUI.java
index bbc08535cdc..5fafb4108b2 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicMenuItemUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicMenuItemUI.java
@@ -180,17 +180,9 @@ public class BasicMenuItemUI extends MenuItemUI
private ItemListener itemListener;
/**
- * Number of spaces between accelerator and menu item's label.
+ * A PropertyChangeListener to make UI updates after property changes.
*/
- private int defaultAcceleratorLabelGap = 10;
-
- /**
- * The gap between different menus on the MenuBar.
- */
- private int MenuGap = 10;
-
- /** A PropertyChangeListener to make UI updates after property changes **/
- PropertyChangeHandler propertyChangeListener;
+ private PropertyChangeHandler propertyChangeListener;
/**
* The view rectangle used for layout of the menu item.
@@ -262,7 +254,6 @@ public class BasicMenuItemUI extends MenuItemUI
|| property.equals("font"))
&& SystemProperties.getProperty("gnu.javax.swing.noGraphics2D")
== null)
-
{
AbstractButton b = (AbstractButton) e.getSource();
String text = b.getText();
@@ -373,7 +364,7 @@ public class BasicMenuItemUI extends MenuItemUI
*/
protected void doClick(MenuSelectionManager msm)
{
- menuItem.doClick();
+ menuItem.doClick(0);
msm.clearSelectedPath();
}
@@ -411,14 +402,10 @@ public class BasicMenuItemUI extends MenuItemUI
{
ArrayList path = new ArrayList();
- // Path to menu should also include its popup menu.
- if (menuItem instanceof JMenu)
- path.add(((JMenu) menuItem).getPopupMenu());
-
Component c = menuItem;
while (c instanceof MenuElement)
{
- path.add(0, (MenuElement) c);
+ path.add(0, c);
if (c instanceof JPopupMenu)
c = ((JPopupMenu) c).getInvoker();
@@ -453,6 +440,7 @@ public class BasicMenuItemUI extends MenuItemUI
// Layout the menu item. The result gets stored in the rectangle
// fields of this class.
+ resetRectangles(null);
layoutMenuItem(m, accelText);
// The union of the text and icon areas is the label area.
@@ -606,6 +594,11 @@ public class BasicMenuItemUI extends MenuItemUI
menuItem.addMenuKeyListener(menuKeyListener);
menuItem.addItemListener(itemListener);
menuItem.addPropertyChangeListener(propertyChangeListener);
+ // Fire synthetic property change event to let the listener update
+ // the TextLayout cache.
+ propertyChangeListener.propertyChange(new PropertyChangeEvent(menuItem,
+ "font", null,
+ menuItem.getFont()));
}
/**
@@ -704,6 +697,8 @@ public class BasicMenuItemUI extends MenuItemUI
// Layout menu item. The result gets stored in the rectangle fields
// of this class.
+ resetRectangles(m);
+
layoutMenuItem(m, accelText);
// Paint the background.
@@ -936,6 +931,7 @@ public class BasicMenuItemUI extends MenuItemUI
uninstallListeners();
uninstallDefaults();
uninstallComponents(menuItem);
+ c.putClientProperty(BasicGraphicsUtils.CACHED_TEXT_LAYOUT, null);
menuItem = null;
}
@@ -953,47 +949,6 @@ public class BasicMenuItemUI extends MenuItemUI
}
/**
- * Return text representation of the specified accelerator
- *
- * @param accelerator
- * Accelerator for which to return string representation
- * @return $String$ Text representation of the given accelerator
- */
- private String getAcceleratorText(KeyStroke accelerator)
- {
- // convert keystroke into string format
- String modifiersText = "";
- int modifiers = accelerator.getModifiers();
- char keyChar = accelerator.getKeyChar();
- int keyCode = accelerator.getKeyCode();
-
- if (modifiers != 0)
- modifiersText = KeyEvent.getKeyModifiersText(modifiers)
- + acceleratorDelimiter;
-
- if (keyCode == KeyEvent.VK_UNDEFINED)
- return modifiersText + keyChar;
- else
- return modifiersText + KeyEvent.getKeyText(keyCode);
- }
-
- /**
- * Calculates and return rectange in which accelerator should be displayed
- *
- * @param accelerator
- * accelerator for which to return the display rectangle
- * @param fm
- * The font metrics used to measure the text
- * @return $Rectangle$ reactangle which will be used to display accelerator
- */
- private Rectangle getAcceleratorRect(KeyStroke accelerator, FontMetrics fm)
- {
- int width = fm.stringWidth(getAcceleratorText(accelerator));
- int height = fm.getHeight();
- return new Rectangle(0, 0, width, height);
- }
-
- /**
* This class handles mouse events occuring inside the menu item. Most of the
* events are forwarded for processing to MenuSelectionManager of the current
* menu hierarchy.
@@ -1103,15 +1058,14 @@ public class BasicMenuItemUI extends MenuItemUI
*/
public void mouseReleased(MouseEvent e)
{
- Rectangle size = menuItem.getBounds();
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- if (e.getX() > 0 && e.getX() < size.width && e.getY() > 0
- && e.getY() < size.height)
+ int x = e.getX();
+ int y = e.getY();
+ if (x > 0 && x < menuItem.getWidth() && y > 0
+ && y < menuItem.getHeight())
{
- manager.clearSelectedPath();
- menuItem.doClick();
+ doClick(manager);
}
-
else
manager.processMouseEvent(e);
}
@@ -1130,7 +1084,7 @@ public class BasicMenuItemUI extends MenuItemUI
*/
public void menuDragMouseDragged(MenuDragMouseEvent e)
{
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
+ MenuSelectionManager manager = e.getMenuSelectionManager();
manager.setSelectedPath(e.getPath());
}
@@ -1143,7 +1097,7 @@ public class BasicMenuItemUI extends MenuItemUI
*/
public void menuDragMouseEntered(MenuDragMouseEvent e)
{
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
+ MenuSelectionManager manager = e.getMenuSelectionManager();
manager.setSelectedPath(e.getPath());
}
@@ -1155,7 +1109,7 @@ public class BasicMenuItemUI extends MenuItemUI
*/
public void menuDragMouseExited(MenuDragMouseEvent e)
{
- // TODO: What should be done here, if anything?
+ // Nothing to do here yet.
}
/**
@@ -1167,13 +1121,14 @@ public class BasicMenuItemUI extends MenuItemUI
*/
public void menuDragMouseReleased(MenuDragMouseEvent e)
{
- MenuElement[] path = e.getPath();
-
- if (path[path.length - 1] instanceof JMenuItem)
- ((JMenuItem) path[path.length - 1]).doClick();
-
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.clearSelectedPath();
+ MenuSelectionManager manager = e.getMenuSelectionManager();
+ int x = e.getX();
+ int y = e.getY();
+ if (x >= 0 && x < menuItem.getWidth() && y >= 0
+ && y < menuItem.getHeight())
+ doClick(manager);
+ else
+ manager.clearSelectedPath();
}
}
@@ -1275,32 +1230,41 @@ public class BasicMenuItemUI extends MenuItemUI
}
/**
- * A helper method that lays out the menu item. The layout is stored
- * in the fields of this class.
+ * Resets the cached layout rectangles. If <code>i</code> is not null, then
+ * the view rectangle is set to the inner area of the component, otherwise
+ * it is set to (0, 0, Short.MAX_VALUE, Short.MAX_VALUE), this is needed
+ * for layouting.
*
- * @param m the menu item to layout
- * @param accelText the accelerator text
+ * @param i the component for which to initialize the rectangles
*/
- private void layoutMenuItem(JMenuItem m, String accelText)
+ private void resetRectangles(JMenuItem i)
{
- int width = m.getWidth();
- int height = m.getHeight();
-
// Reset rectangles.
iconRect.setBounds(0, 0, 0, 0);
textRect.setBounds(0, 0, 0, 0);
accelRect.setBounds(0, 0, 0, 0);
checkIconRect.setBounds(0, 0, 0, 0);
arrowIconRect.setBounds(0, 0, 0, 0);
- viewRect.setBounds(0, 0, width, height);
-
- // Substract insets to the view rect.
- Insets insets = m.getInsets();
- viewRect.x += insets.left;
- viewRect.y += insets.top;
- viewRect.width -= insets.left + insets.right;
- viewRect.height -= insets.top + insets.bottom;
+ if (i == null)
+ viewRect.setBounds(0, 0, Short.MAX_VALUE, Short.MAX_VALUE);
+ else
+ {
+ Insets insets = i.getInsets();
+ viewRect.setBounds(insets.left, insets.top,
+ i.getWidth() - insets.left - insets.right,
+ i.getHeight() - insets.top - insets.bottom);
+ }
+ }
+ /**
+ * A helper method that lays out the menu item. The layout is stored
+ * in the fields of this class.
+ *
+ * @param m the menu item to layout
+ * @param accelText the accelerator text
+ */
+ private void layoutMenuItem(JMenuItem m, String accelText)
+ {
// Fetch the fonts.
Font font = m.getFont();
FontMetrics fm = m.getFontMetrics(font);
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicMenuUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicMenuUI.java
index 7d8784fd15a..355e0435ec8 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicMenuUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicMenuUI.java
@@ -41,16 +41,22 @@ package javax.swing.plaf.basic;
import gnu.classpath.NotImplementedException;
import java.awt.Component;
+import java.awt.Container;
import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeListener;
+import javax.swing.AbstractAction;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JPopupMenu;
import javax.swing.LookAndFeel;
+import javax.swing.MenuElement;
import javax.swing.MenuSelectionManager;
+import javax.swing.Timer;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
@@ -69,6 +75,32 @@ import javax.swing.plaf.ComponentUI;
*/
public class BasicMenuUI extends BasicMenuItemUI
{
+ /**
+ * Selects a menu. This is used to delay menu selection.
+ */
+ class SelectMenuAction
+ extends AbstractAction
+ {
+ /**
+ * Performs the action.
+ */
+ public void actionPerformed(ActionEvent event)
+ {
+ JMenu menu = (JMenu) menuItem;
+ MenuSelectionManager defaultManager =
+ MenuSelectionManager.defaultManager();
+ MenuElement path[] = defaultManager.getSelectedPath();
+ if(path.length > 0 && path[path.length - 1] == menu)
+ {
+ MenuElement newPath[] = new MenuElement[path.length + 1];
+ System.arraycopy(path, 0, newPath, 0, path.length);
+ newPath[path.length] = menu.getPopupMenu();
+ defaultManager.setSelectedPath(newPath);
+ }
+ }
+
+ }
+
protected ChangeListener changeListener;
/* MenuListener listens to MenuEvents fired by JMenu */
@@ -201,6 +233,7 @@ public class BasicMenuUI extends BasicMenuItemUI
*/
protected void installDefaults()
{
+
LookAndFeel.installBorder(menuItem, "Menu.border");
LookAndFeel.installColorsAndFont(menuItem, "Menu.background",
"Menu.foreground", "Menu.font");
@@ -212,6 +245,7 @@ public class BasicMenuUI extends BasicMenuItemUI
selectionForeground = UIManager.getColor("Menu.selectionForeground");
arrowIcon = UIManager.getIcon("Menu.arrowIcon");
oldBorderPainted = UIManager.getBoolean("Menu.borderPainted");
+ ((JMenu) menuItem).setDelay(200);
}
/**
@@ -234,9 +268,10 @@ public class BasicMenuUI extends BasicMenuItemUI
}
protected void setupPostTimer(JMenu menu)
- throws NotImplementedException
{
- // TODO: Implement this properly.
+ Timer timer = new Timer(menu.getDelay(), new SelectMenuAction());
+ timer.setRepeats(false);
+ timer.start();
}
/**
@@ -285,8 +320,7 @@ public class BasicMenuUI extends BasicMenuItemUI
{
public void mouseClicked(MouseEvent e)
{
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.processMouseEvent(e);
+ // Nothing to do here.
}
public void mouseDragged(MouseEvent e)
@@ -313,29 +347,46 @@ public class BasicMenuUI extends BasicMenuItemUI
public void mouseEntered(MouseEvent e)
{
- /* When mouse enters menu item, it should be considered selected
-
- if (i) if this menu is a submenu in some other menu
- (ii) or if this menu is in a menu bar and some other menu in a
- menu bar was just selected and has its popup menu visible.
- (If nothing was selected, menu should be pressed before
- it will be selected)
- */
JMenu menu = (JMenu) menuItem;
-
- // NOTE: the following if used to require !menu.isArmed but I could find
- // no reason for this and it was preventing some JDK-compatible behaviour.
- // Specifically, if a menu is selected but its popup menu not visible,
- // and then another menu is selected whose popup menu IS visible, when
- // the mouse is moved over the first menu, its popup menu should become
- // visible.
-
- if (! menu.isTopLevelMenu() || popupVisible())
+ if (menu.isEnabled())
{
- // set new selection and forward this event to MenuSelectionManager
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.setSelectedPath(getPath());
- manager.processMouseEvent(e);
+ MenuSelectionManager manager =
+ MenuSelectionManager.defaultManager();
+ MenuElement[] selectedPath = manager.getSelectedPath();
+ if (! menu.isTopLevelMenu())
+ {
+ // Open the menu immediately or delayed, depending on the
+ // delay value.
+ if(! (selectedPath.length > 0
+ && selectedPath[selectedPath.length - 1] == menu.getPopupMenu()))
+ {
+ if(menu.getDelay() == 0)
+ {
+ MenuElement[] path = getPath();
+ MenuElement[] newPath = new MenuElement[path.length + 1];
+ System.arraycopy(path, 0, newPath, 0, path.length);
+ newPath[path.length] = menu.getPopupMenu();
+ manager.setSelectedPath(newPath);
+ }
+ else
+ {
+ manager.setSelectedPath(getPath());
+ setupPostTimer(menu);
+ }
+ }
+ }
+ else
+ {
+ if(selectedPath.length > 0
+ && selectedPath[0] == menu.getParent())
+ {
+ MenuElement[] newPath = new MenuElement[3];
+ newPath[0] = (MenuElement) menu.getParent();
+ newPath[1] = menu;
+ newPath[2] = menu.getPopupMenu();
+ manager.setSelectedPath(newPath);
+ }
+ }
}
}
@@ -354,29 +405,48 @@ public class BasicMenuUI extends BasicMenuItemUI
{
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
JMenu menu = (JMenu) menuItem;
- manager.processMouseEvent(e);
-
- // Menu should be displayed when the menu is pressed only if
- // it is top-level menu
- if (menu.isTopLevelMenu())
+ if (menu.isEnabled())
{
- if (menu.getPopupMenu().isVisible())
- // If menu is visible and menu button was pressed..
- // then need to cancel the menu
- manager.clearSelectedPath();
- else
- {
- // Display the menu
- int x = 0;
- int y = menu.getHeight();
-
- manager.setSelectedPath(getPath());
-
- JMenuBar mb = (JMenuBar) menu.getParent();
-
- // set selectedIndex of the selectionModel of a menuBar
- mb.getSelectionModel().setSelectedIndex(mb.getComponentIndex(menu));
- }
+ // Open up the menu immediately if it's a toplevel menu.
+ // But not yet the popup, which might be opened delayed, see below.
+ if (menu.isTopLevelMenu())
+ {
+ if (menu.isSelected())
+ manager.clearSelectedPath();
+ else
+ {
+ Container cnt = menu.getParent();
+ if (cnt != null && cnt instanceof JMenuBar)
+ {
+ MenuElement[] me = new MenuElement[2];
+ me[0] = (MenuElement) cnt;
+ me[1] = menu;
+ manager.setSelectedPath(me);
+ }
+ }
+ }
+
+ // Open the menu's popup. Either do that immediately if delay == 0,
+ // or delayed when delay > 0.
+ MenuElement[] selectedPath = manager.getSelectedPath();
+ if (selectedPath.length > 0
+ && selectedPath[selectedPath.length - 1] != menu.getPopupMenu())
+ {
+ if(menu.isTopLevelMenu() || menu.getDelay() == 0)
+ {
+ MenuElement[] newPath =
+ new MenuElement[selectedPath.length + 1];
+ System.arraycopy(selectedPath, 0, newPath, 0,
+ selectedPath.length);
+ newPath[selectedPath.length] = menu.getPopupMenu();
+ manager.setSelectedPath(newPath);
+ }
+ else
+ {
+ setupPostTimer(menu);
+ }
+ }
+
}
}
@@ -493,8 +563,44 @@ public class BasicMenuUI extends BasicMenuItemUI
*/
public void menuDragMouseDragged(MenuDragMouseEvent e)
{
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.setSelectedPath(e.getPath());
+ if (menuItem.isEnabled())
+ {
+ MenuSelectionManager manager = e.getMenuSelectionManager();
+ MenuElement path[] = e.getPath();
+
+ Point p = e.getPoint();
+ if(p.x >= 0 && p.x < menuItem.getWidth()
+ && p.y >= 0 && p.y < menuItem.getHeight())
+ {
+ JMenu menu = (JMenu) menuItem;
+ MenuElement[] selectedPath = manager.getSelectedPath();
+ if(! (selectedPath.length > 0
+ && selectedPath[selectedPath.length-1]
+ == menu.getPopupMenu()))
+ {
+ if(menu.isTopLevelMenu() || menu.getDelay() == 0
+ || e.getID() == MouseEvent.MOUSE_DRAGGED)
+ {
+ MenuElement[] newPath = new MenuElement[path.length + 1];
+ System.arraycopy(path, 0, newPath, 0, path.length);
+ newPath[path.length] = menu.getPopupMenu();
+ manager.setSelectedPath(newPath);
+ }
+ else
+ {
+ manager.setSelectedPath(path);
+ setupPostTimer(menu);
+ }
+ }
+ }
+ else if (e.getID() == MouseEvent.MOUSE_RELEASED)
+ {
+ Component comp = manager.componentForPoint(e.getComponent(),
+ e.getPoint());
+ if (comp == null)
+ manager.clearSelectedPath();
+ }
+ }
}
/**
@@ -505,8 +611,7 @@ public class BasicMenuUI extends BasicMenuItemUI
*/
public void menuDragMouseEntered(MenuDragMouseEvent e)
{
- MenuSelectionManager manager = MenuSelectionManager.defaultManager();
- manager.setSelectedPath(e.getPath());
+ // Nothing to do here.
}
/**
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java
index aed4d69d6d5..bfb9e98dbc9 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java
@@ -52,6 +52,7 @@ import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
+import javax.swing.text.View;
/**
* The BasicLookAndFeel UI implementation for
@@ -81,7 +82,7 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
*/
public BasicRadioButtonUI()
{
- icon = getDefaultIcon();
+ // nothing to do
}
/**
@@ -93,6 +94,7 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
protected void installDefaults(AbstractButton b)
{
super.installDefaults(b);
+ icon = UIManager.getIcon(getPropertyPrefix() + "icon");
}
/**
@@ -116,7 +118,7 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
*/
public Icon getDefaultIcon()
{
- return UIManager.getIcon(getPropertyPrefix() + "icon");
+ return icon;
}
/**
@@ -128,40 +130,92 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
public void paint(Graphics g, JComponent c)
{
AbstractButton b = (AbstractButton) c;
-
- Rectangle tr = new Rectangle();
- Rectangle ir = new Rectangle();
- Rectangle vr = new Rectangle();
+ Dimension size = c.getSize();
+ Insets i = b.getInsets();
+ textR.x = 0;
+ textR.y = 0;
+ textR.width = 0;
+ textR.height = 0;
+ iconR.x = 0;
+ iconR.y = 0;
+ iconR.width = 0;
+ iconR.height = 0;
+ viewR.x = i.left;
+ viewR.y = i.right;
+ viewR.width = size.width - i.left - i.right;
+ viewR.height = size.height - i.top - i.bottom;
Font f = c.getFont();
g.setFont(f);
ButtonModel m = b.getModel();
- // FIXME: Do a filtering on any customized icon if the following property
- // is set.
- boolean enabled = b.isEnabled();
-
- Icon currentIcon = b.getIcon();
- if (currentIcon == null)
- {
- currentIcon = getDefaultIcon();
- }
-
- SwingUtilities.calculateInnerArea(b, vr);
+ // This is the icon that we use for layout.
+ Icon icon = b.getIcon();
+ if (icon == null)
+ icon = getDefaultIcon();
+
+ // Do the layout.
String text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f),
- b.getText(), currentIcon,
+ b.getText(), icon,
b.getVerticalAlignment(), b.getHorizontalAlignment(),
b.getVerticalTextPosition(), b.getHorizontalTextPosition(),
- vr, ir, tr, b.getIconTextGap() + defaultTextShiftOffset);
-
- currentIcon.paintIcon(c, g, ir.x, ir.y);
-
+ viewR, iconR, textR, b.getIconTextGap());
+
+ // Figure out the correct icon.
+ icon = b.getIcon();
+ if (icon == null)
+ icon = getDefaultIcon();
+ else
+ {
+ if (! m.isEnabled())
+ {
+ if (m.isSelected())
+ icon = b.getDisabledSelectedIcon();
+ else
+ icon = b.getDisabledIcon();
+ }
+ else if (m.isArmed() && m.isPressed())
+ {
+ icon = b.getPressedIcon();
+ if (icon == null)
+ icon = b.getSelectedIcon();
+ }
+ else if (m.isSelected())
+ {
+ if (b.isRolloverEnabled() && m.isRollover())
+ {
+ icon = b.getRolloverSelectedIcon();
+ if (icon == null)
+ icon = b.getSelectedIcon();
+ }
+ else
+ icon = b.getSelectedIcon();
+ }
+ else if (b.isRolloverEnabled() && m.isRollover())
+ icon = b.getRolloverIcon();
+ if (icon == null)
+ icon = b.getIcon();
+ }
+ // .. and paint it.
+ icon.paintIcon(c, g, iconR.x, iconR.y);
+
+ // Paint text and focus indicator.
if (text != null)
- paintText(g, b, tr, text);
- if (b.hasFocus() && b.isFocusPainted() && m.isEnabled())
- paintFocus(g, tr, c.getSize());
+ {
+ // Maybe render HTML in the radio button.
+ View v = (View) c.getClientProperty(BasicHTML.propertyKey);
+ if (v != null)
+ v.paint(g, textR);
+ else
+ paintText(g, b, textR, text);
+
+ // Paint focus indicator if necessary.
+ if (b.hasFocus() && b.isFocusPainted()
+ && textR.width > 0 && textR.height > 0)
+ paintFocus(g, textR, size);
+ }
}
public Dimension getPreferredSize(JComponent c)
@@ -174,38 +228,40 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
// The other icon properties are ignored.
AbstractButton b = (AbstractButton) c;
- Rectangle contentRect;
- Rectangle viewRect;
- Rectangle iconRect = new Rectangle();
- Rectangle textRect = new Rectangle();
Insets insets = b.getInsets();
-
+
+ String text = b.getText();
Icon i = b.getIcon();
if (i == null)
i = getDefaultIcon();
- viewRect = new Rectangle();
-
- SwingUtilities.layoutCompoundLabel(
- b, // for the component orientation
- b.getFontMetrics(b.getFont()),
- b.getText(),
- i,
- b.getVerticalAlignment(),
- b.getHorizontalAlignment(),
- b.getVerticalTextPosition(),
- b.getHorizontalTextPosition(),
- viewRect, iconRect, textRect,
- defaultTextIconGap + defaultTextShiftOffset);
-
- contentRect = textRect.union(iconRect);
-
- return new Dimension(insets.left
- + contentRect.width
- + insets.right + b.getHorizontalAlignment(),
- insets.top
- + contentRect.height
- + insets.bottom);
+ textR.x = 0;
+ textR.y = 0;
+ textR.width = 0;
+ textR.height = 0;
+ iconR.x = 0;
+ iconR.y = 0;
+ iconR.width = 0;
+ iconR.height = 0;
+ viewR.x = 0;
+ viewR.y = 0;
+ viewR.width = Short.MAX_VALUE;
+ viewR.height = Short.MAX_VALUE;
+
+ SwingUtilities.layoutCompoundLabel(b, // for the component orientation
+ b.getFontMetrics(b.getFont()),
+ text, i, b.getVerticalAlignment(),
+ b.getHorizontalAlignment(),
+ b.getVerticalTextPosition(),
+ b.getHorizontalTextPosition(),
+ viewR, iconR, textR,
+ text == null ? 0 : b.getIconTextGap());
+
+ Rectangle r = SwingUtilities.computeUnion(textR.x, textR.y, textR.width,
+ textR.height, iconR);
+
+ return new Dimension(insets.left + r.width + insets.right,
+ insets.top + r.height + insets.bottom);
}
/**
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java
index 78e5168fc80..400ede03ce9 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java
@@ -760,10 +760,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
scrollbar.setOpaque(true);
scrollbar.setLayout(this);
- thumbColor = UIManager.getColor("ScrollBar.thumb");
- thumbDarkShadowColor = UIManager.getColor("ScrollBar.thumbDarkShadow");
- thumbHighlightColor = UIManager.getColor("ScrollBar.thumbHighlight");
- thumbLightShadowColor = UIManager.getColor("ScrollBar.thumbShadow");
+ configureScrollBarColors();
maximumThumbSize = UIManager.getDimension("ScrollBar.maximumThumbSize");
minimumThumbSize = UIManager.getDimension("ScrollBar.minimumThumbSize");
@@ -1228,8 +1225,36 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
*/
protected void scrollByBlock(int direction)
{
- scrollbar.setValue(scrollbar.getValue()
- + scrollbar.getBlockIncrement(direction));
+ scrollByBlock(scrollbar, direction);
+ }
+
+ /**
+ * Scrolls the specified <code>scrollBar</code> by one block (according
+ * to the scrollable protocol) in the specified <code>direction</code>.
+ *
+ * This method is here statically to support wheel scrolling from the
+ * BasicScrollPaneUI without code duplication.
+ *
+ * @param scrollBar the scrollbar to scroll
+ * @param direction the scroll direction
+ */
+ static final void scrollByBlock(JScrollBar scrollBar, int direction)
+ {
+ int delta;
+ if (direction > 0)
+ delta = scrollBar.getBlockIncrement(direction);
+ else
+ delta = - scrollBar.getBlockIncrement(direction);
+ int oldValue = scrollBar.getValue();
+ int newValue = oldValue + delta;
+
+ // Overflow check.
+ if (delta > 0 && newValue < oldValue)
+ newValue = scrollBar.getMaximum();
+ else if (delta < 0 && newValue > oldValue)
+ newValue = scrollBar.getMinimum();
+
+ scrollBar.setValue(newValue);
}
/**
@@ -1239,8 +1264,46 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
*/
protected void scrollByUnit(int direction)
{
- scrollbar.setValue(scrollbar.getValue()
- + scrollbar.getUnitIncrement(direction));
+ scrollByUnits(scrollbar, direction, 1);
+ }
+
+ /**
+ * Scrolls the specified <code>scrollbac/code> by <code>units</code> units
+ * in the specified <code>direction</code>.
+ *
+ * This method is here statically to support wheel scrolling from the
+ * BasicScrollPaneUI without code duplication.
+ *
+ * @param scrollBar the scrollbar to scroll
+ * @param direction the direction
+ * @param units the number of units to scroll
+ */
+ static final void scrollByUnits(JScrollBar scrollBar, int direction,
+ int units)
+ {
+ // Do this inside a loop so that we don't clash with the scrollable
+ // interface, which can return different units at times. For instance,
+ // a Scrollable could return a unit of 2 pixels only to adjust the
+ // visibility of an item. If we would simply multiply this by units,
+ // then we would only get 6 pixels, which is complete crap.
+ for (int i = 0; i < units; i++)
+ {
+ int delta;
+ if (direction > 0)
+ delta = scrollBar.getUnitIncrement(direction);
+ else
+ delta = - scrollBar.getUnitIncrement(direction);
+ int oldValue = scrollBar.getValue();
+ int newValue = oldValue + delta;
+
+ // Overflow check.
+ if (delta > 0 && newValue < oldValue)
+ newValue = scrollBar.getMaximum();
+ else if (delta < 0 && newValue > oldValue)
+ newValue = scrollBar.getMinimum();
+
+ scrollBar.setValue(newValue);
+ }
}
/**
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java
index a0616a8c1cf..a7194284050 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java
@@ -38,9 +38,6 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import gnu.classpath.NotImplementedException;
-
-import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
@@ -54,7 +51,6 @@ import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.AbstractAction;
-import javax.swing.Action;
import javax.swing.ActionMap;
import javax.swing.InputMap;
import javax.swing.JComponent;
@@ -65,15 +61,15 @@ import javax.swing.JViewport;
import javax.swing.LookAndFeel;
import javax.swing.ScrollPaneConstants;
import javax.swing.ScrollPaneLayout;
-import javax.swing.Scrollable;
-import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
+import javax.swing.border.Border;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.ActionMapUIResource;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.ScrollPaneUI;
+import javax.swing.plaf.UIResource;
/**
* A UI delegate for the {@link JScrollPane} component.
@@ -102,19 +98,8 @@ public class BasicScrollPaneUI extends ScrollPaneUI
JScrollBar hsb = scrollpane.getHorizontalScrollBar();
JViewport vp = scrollpane.getViewport();
Point viewPosition = vp.getViewPosition();
- int xpos = hsb.getValue();
-
- if (xpos != viewPosition.x)
- {
- viewPosition.x = xpos;
- vp.setViewPosition(viewPosition);
- }
-
- viewPosition.y = 0;
- JViewport columnHeader = scrollpane.getColumnHeader();
- if (columnHeader != null
- && !columnHeader.getViewPosition().equals(viewPosition))
- columnHeader.setViewPosition(viewPosition);
+ viewPosition.x = hsb.getValue();
+ vp.setViewPosition(viewPosition);
}
}
@@ -139,18 +124,8 @@ public class BasicScrollPaneUI extends ScrollPaneUI
JScrollBar vsb = scrollpane.getVerticalScrollBar();
JViewport vp = scrollpane.getViewport();
Point viewPosition = vp.getViewPosition();
- int ypos = vsb.getValue();
- if (ypos != viewPosition.y)
- {
- viewPosition.y = ypos;
- vp.setViewPosition(viewPosition);
- }
-
- viewPosition.x = 0;
- JViewport rowHeader = scrollpane.getRowHeader();
- if (rowHeader != null
- && !rowHeader.getViewPosition().equals(viewPosition))
- rowHeader.setViewPosition(viewPosition);
+ viewPosition.y = vsb.getValue();
+ vp.setViewPosition(viewPosition);
}
}
@@ -174,9 +149,6 @@ public class BasicScrollPaneUI extends ScrollPaneUI
*/
public void stateChanged(ChangeEvent event)
{
- JViewport vp = scrollpane.getViewport();
- JScrollBar hsb = scrollpane.getHorizontalScrollBar();
- JScrollBar vsb = scrollpane.getVerticalScrollBar();
syncScrollPaneWithViewport();
}
@@ -254,103 +226,24 @@ public class BasicScrollPaneUI extends ScrollPaneUI
*/
public void mouseWheelMoved(MouseWheelEvent e)
{
- if (scrollpane.getViewport().getComponentCount() == 0)
- return;
-
- Component target = scrollpane.getViewport().getComponent(0);
- JScrollBar bar = scrollpane.getVerticalScrollBar();
- Scrollable scrollable = (target instanceof Scrollable) ? (Scrollable) target
- : null;
-
- boolean tracksHeight = scrollable != null
- && scrollable.getScrollableTracksViewportHeight();
- int wheel = e.getWheelRotation() * ROWS_PER_WHEEL_CLICK;
- int delta;
-
- // If possible, scroll vertically.
- if (bar != null && ! tracksHeight)
+ if (scrollpane.isWheelScrollingEnabled() && e.getScrollAmount() != 0)
{
- if (scrollable != null)
+ // Try to scroll vertically first.
+ JScrollBar scrollBar = scrollpane.getVerticalScrollBar();
+ if (scrollBar == null || ! scrollBar.isVisible())
+ scrollBar = scrollpane.getHorizontalScrollBar();
+ if (scrollBar != null && scrollBar.isVisible())
{
- bounds(target);
- delta = scrollable.getScrollableUnitIncrement(
- rect, SwingConstants.VERTICAL, wheel);
- }
- else
- {
- // Scroll non scrollables.
- delta = wheel * SCROLL_NON_SCROLLABLES;
- }
- scroll(bar, delta);
- }
- // If not, try to scroll horizontally
- else
- {
- bar = scrollpane.getHorizontalScrollBar();
- boolean tracksWidth = scrollable != null
- && scrollable.getScrollableTracksViewportWidth();
-
- if (bar != null && ! tracksWidth)
- {
- if (scrollable != null)
- {
- bounds(target);
- delta = scrollable.getScrollableUnitIncrement(
- rect, SwingConstants.HORIZONTAL, wheel);
- }
- else
- {
- // Scroll non scrollables.
- delta = wheel * SCROLL_NON_SCROLLABLES;
- }
- scroll(bar, delta);
+ int direction = e.getWheelRotation() < 0 ? -1 : 1;
+ int scrollType = e.getScrollType();
+ if (scrollType == MouseWheelEvent.WHEEL_UNIT_SCROLL)
+ BasicScrollBarUI.scrollByUnits(scrollBar, direction,
+ e.getScrollAmount());
+ else if (scrollType == MouseWheelEvent.WHEEL_BLOCK_SCROLL)
+ BasicScrollBarUI.scrollByBlock(scrollBar, direction);
}
}
}
-
- /**
- * Place the component bounds into rect. The x and y values
- * need to be reversed.
- *
- * @param target the target being scrolled
- */
- final void bounds(Component target)
- {
- // Viewport bounds, translated by the scroll bar positions.
- target.getParent().getBounds(rect);
- rect.x = getValue(scrollpane.getHorizontalScrollBar());
- rect.y = getValue(scrollpane.getVerticalScrollBar());
- }
-
- /**
- * Get the scroll bar value or 0 if there is no such scroll bar.
- *
- * @param bar the scroll bar (<code>null</code> permitted).
- *
- * @return The scroll bar value, or 0.
- */
- final int getValue(JScrollBar bar)
- {
- return bar != null ? bar.getValue() : 0;
- }
-
- /**
- * Scroll the given distance.
- *
- * @param bar the scrollbar to scroll
- * @param delta the distance
- */
- final void scroll(JScrollBar bar, int delta)
- {
- int y = bar.getValue() + delta;
-
- if (y < bar.getMinimum())
- y = bar.getMinimum();
- if (y > bar.getMaximum())
- y = bar.getMaximum();
-
- bar.setValue(y);
- }
}
/**
@@ -436,16 +329,24 @@ public class BasicScrollPaneUI extends ScrollPaneUI
"ScrollPane.foreground",
"ScrollPane.font");
LookAndFeel.installBorder(p, "ScrollPane.border");
+
+ // Install Viewport border.
+ Border vpBorder = p.getViewportBorder();
+ if (vpBorder == null || vpBorder instanceof UIResource)
+ {
+ vpBorder = UIManager.getBorder("ScrollPane.viewportBorder");
+ p.setViewportBorder(vpBorder);
+ }
+
p.setOpaque(true);
}
protected void uninstallDefaults(JScrollPane p)
{
- p.setForeground(null);
- p.setBackground(null);
- p.setFont(null);
- p.setBorder(null);
- scrollpane = null;
+ LookAndFeel.uninstallBorder(p);
+ Border vpBorder = p.getViewportBorder();
+ if (vpBorder != null && vpBorder instanceof UIResource)
+ p.setViewportBorder(null);
}
public void installUI(final JComponent c)
@@ -770,9 +671,8 @@ public class BasicScrollPaneUI extends ScrollPaneUI
public void uninstallUI(final JComponent c)
{
- super.uninstallUI(c);
- this.uninstallDefaults((JScrollPane) c);
- uninstallListeners((JScrollPane) c);
+ uninstallDefaults((JScrollPane) c);
+ uninstallListeners(c);
installKeyboardActions((JScrollPane) c);
}
@@ -808,29 +708,65 @@ public class BasicScrollPaneUI extends ScrollPaneUI
}
public void paint(Graphics g, JComponent c)
- {
- // do nothing; the normal painting-of-children algorithm, along with
- // ScrollPaneLayout, does all the relevant work.
+ {
+ Border vpBorder = scrollpane.getViewportBorder();
+ if (vpBorder != null)
+ {
+ Rectangle r = scrollpane.getViewportBorderBounds();
+ vpBorder.paintBorder(scrollpane, g, r.x, r.y, r.width, r.height);
+ }
}
/**
- * Synchronizes the scrollbars with the viewport's extents.
+ * Synchronizes the scrollbar and header settings positions and extent
+ * with the viewport's view position and extent.
*/
protected void syncScrollPaneWithViewport()
{
JViewport vp = scrollpane.getViewport();
- // Update the horizontal scrollbar.
- JScrollBar hsb = scrollpane.getHorizontalScrollBar();
- hsb.setMaximum(vp.getViewSize().width);
- hsb.setValue(vp.getViewPosition().x);
- hsb.setVisibleAmount(vp.getExtentSize().width);
-
- // Update the vertical scrollbar.
- JScrollBar vsb = scrollpane.getVerticalScrollBar();
- vsb.setMaximum(vp.getViewSize().height);
- vsb.setValue(vp.getViewPosition().y);
- vsb.setVisibleAmount(vp.getExtentSize().height);
+ if (vp != null)
+ {
+ Dimension extentSize = vp.getExtentSize();
+ Point viewPos = vp.getViewPosition();
+ Dimension viewSize = vp.getViewSize();
+
+ // Update the vertical scrollbar.
+ JScrollBar vsb = scrollpane.getVerticalScrollBar();
+ if (vsb != null)
+ {
+ int extent = extentSize.height;
+ int max = viewSize.height;
+ int val = Math.max(0, Math.min(viewPos.y, max - extent));
+ vsb.setValues(val, extent, 0, max);
+ }
+
+ // Update the horizontal scrollbar.
+ JScrollBar hsb = scrollpane.getHorizontalScrollBar();
+ if (hsb != null)
+ {
+ int extent = extentSize.width;
+ int max = viewSize.width;
+ int val = Math.max(0, Math.min(viewPos.x, max - extent));
+ hsb.setValues(val, extent, 0, max);
+ }
+
+ // Update the row header.
+ JViewport rowHeader = scrollpane.getRowHeader();
+ if (rowHeader != null)
+ {
+ Point p = new Point(0, viewPos.y);
+ rowHeader.setViewPosition(p);
+ }
+
+ // Update the column header.
+ JViewport colHeader = scrollpane.getColumnHeader();
+ if (colHeader != null)
+ {
+ Point p = new Point(viewPos.x, 0);
+ colHeader.setViewPosition(p);
+ }
+ }
}
/**
@@ -863,7 +799,8 @@ public class BasicScrollPaneUI extends ScrollPaneUI
*/
protected void updateScrollBarDisplayPolicy(PropertyChangeEvent ev)
{
- // TODO: Find out what should be done here. Or is this only a hook?
+ scrollpane.revalidate();
+ scrollpane.repaint();
}
/**
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java
index 3811eebdfd6..474a4225640 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java
@@ -40,7 +40,6 @@ package javax.swing.plaf.basic;
import java.awt.Color;
import java.awt.Component;
-import java.awt.ComponentOrientation;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Insets;
@@ -65,7 +64,6 @@ import javax.swing.ActionMap;
import javax.swing.BoundedRangeModel;
import javax.swing.InputMap;
import javax.swing.JComponent;
-import javax.swing.JLabel;
import javax.swing.JSlider;
import javax.swing.LookAndFeel;
import javax.swing.SwingUtilities;
@@ -185,8 +183,6 @@ public class BasicSliderUI extends SliderUI
public void componentResized(ComponentEvent e)
{
calculateGeometry();
-
- slider.revalidate();
slider.repaint();
}
}
@@ -209,7 +205,6 @@ public class BasicSliderUI extends SliderUI
public void focusGained(FocusEvent e)
{
slider.repaint();
- hasFocus = true;
}
/**
@@ -221,7 +216,6 @@ public class BasicSliderUI extends SliderUI
public void focusLost(FocusEvent e)
{
slider.repaint();
- hasFocus = false;
}
}
@@ -240,25 +234,27 @@ public class BasicSliderUI extends SliderUI
public void propertyChange(PropertyChangeEvent e)
{
// Check for orientation changes.
- if (e.getPropertyName().equals("orientation"))
- recalculateIfOrientationChanged();
+ String prop = e.getPropertyName();
+ if (prop.equals("orientation")
+ || prop.equals("inverted")
+ || prop.equals("labelTable")
+ || prop.equals("majorTickSpacing")
+ || prop.equals("minorTickSpacing")
+ || prop.equals("paintTicks")
+ || prop.equals("paintTrack")
+ || prop.equals("paintLabels"))
+ {
+ calculateGeometry();
+ slider.repaint();
+ }
else if (e.getPropertyName().equals("model"))
{
BoundedRangeModel oldModel = (BoundedRangeModel) e.getOldValue();
oldModel.removeChangeListener(changeListener);
slider.getModel().addChangeListener(changeListener);
calculateThumbLocation();
+ slider.repaint();
}
- else if (e.getPropertyName().equals("paintTicks"))
- calculateGeometry();
-
- // elif the componentOrientation changes (this is a bound property,
- // just undocumented) we change leftToRightCache. In Sun's
- // implementation, the LTR cache changes on a repaint. This is strange
- // since there is no need to do so. We could events here and
- // update the cache.
- // elif the border/insets change, we recalculateInsets.
- slider.repaint();
}
}
@@ -466,6 +462,7 @@ public class BasicSliderUI extends SliderUI
if (scrollTimer != null)
scrollTimer.stop();
}
+ slider.repaint();
}
/**
@@ -592,10 +589,7 @@ public class BasicSliderUI extends SliderUI
/** The focus color. */
private transient Color focusColor;
-
- /** True if the slider has focus. */
- private transient boolean hasFocus;
-
+
/** True if the user is dragging the slider. */
boolean dragging;
@@ -935,36 +929,10 @@ public class BasicSliderUI extends SliderUI
*/
public Dimension getPreferredHorizontalSize()
{
- Insets insets = slider.getInsets();
-
- // The width should cover all the labels (which are usually the
- // deciding factor of the width)
- int width = getWidthOfWidestLabel() * (slider.getLabelTable() == null ? 0
- : slider.getLabelTable().size());
-
- // If there are not enough labels.
- // This number is pretty much arbitrary, but it looks nice.
- if (width < 200)
- width = 200;
-
- // We can only draw inside of the focusRectangle, so we have to
- // pad it with insets.
- width += insets.left + insets.right + focusInsets.left + focusInsets.right;
-
- // Height is determined by the thumb, the ticks and the labels.
- int height = getThumbSize().height;
-
- if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0
- || slider.getMinorTickSpacing() > 0)
- height += getTickLength();
-
- if (slider.getPaintLabels())
- height += getHeightOfTallestLabel();
-
- height += insets.top + insets.bottom + focusInsets.top
- + focusInsets.bottom;
-
- return new Dimension(width, height);
+ Dimension dim = UIManager.getDimension("Slider.horizontalSize");
+ if (dim == null) // Just to be sure we mirror the default.
+ dim = new Dimension(200, 21);
+ return dim;
}
/**
@@ -975,30 +943,10 @@ public class BasicSliderUI extends SliderUI
*/
public Dimension getPreferredVerticalSize()
{
- Insets insets = slider.getInsets();
-
- int height = getHeightOfTallestLabel() * (slider.getLabelTable() == null
- ? 0 : slider.getLabelTable()
- .size());
-
- if (height < 200)
- height = 200;
-
- height += insets.top + insets.bottom + focusInsets.top
- + focusInsets.bottom;
-
- int width = getThumbSize().width;
-
- if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0
- || slider.getMinorTickSpacing() > 0)
- width += getTickLength();
-
- if (slider.getPaintLabels())
- width += getWidthOfWidestLabel();
-
- width += insets.left + insets.right + focusInsets.left + focusInsets.right;
-
- return new Dimension(width, height);
+ Dimension dim = UIManager.getDimension("Slider.verticalSize");
+ if (dim == null) // Just to be sure we mirror the default.
+ dim = new Dimension(21, 200);
+ return dim;
}
/**
@@ -1009,21 +957,10 @@ public class BasicSliderUI extends SliderUI
*/
public Dimension getMinimumHorizontalSize()
{
- Insets insets = slider.getInsets();
- // Height is determined by the thumb, the ticks and the labels.
- int height = getThumbSize().height;
-
- if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0
- || slider.getMinorTickSpacing() > 0)
- height += getTickLength();
-
- if (slider.getPaintLabels())
- height += getHeightOfTallestLabel();
-
- height += insets.top + insets.bottom + focusInsets.top
- + focusInsets.bottom;
-
- return new Dimension(36, height);
+ Dimension dim = UIManager.getDimension("Slider.minimumHorizontalSize");
+ if (dim == null) // Just to be sure we mirror the default.
+ dim = new Dimension(36, 21);
+ return dim;
}
/**
@@ -1034,19 +971,10 @@ public class BasicSliderUI extends SliderUI
*/
public Dimension getMinimumVerticalSize()
{
- Insets insets = slider.getInsets();
- int width = getThumbSize().width;
-
- if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0
- || slider.getMinorTickSpacing() > 0)
- width += getTickLength();
-
- if (slider.getPaintLabels())
- width += getWidthOfWidestLabel();
-
- width += insets.left + insets.right + focusInsets.left + focusInsets.right;
-
- return new Dimension(width, 36);
+ Dimension dim = UIManager.getDimension("Slider.minimumVerticalSize");
+ if (dim == null) // Just to be sure we mirror the default.
+ dim = new Dimension(21, 36);
+ return dim;
}
/**
@@ -1060,10 +988,25 @@ public class BasicSliderUI extends SliderUI
*/
public Dimension getPreferredSize(JComponent c)
{
+ recalculateIfInsetsChanged();
+ Dimension dim;
if (slider.getOrientation() == JSlider.HORIZONTAL)
- return getPreferredHorizontalSize();
+ {
+ // Create copy here to protect the UIManager value.
+ dim = new Dimension(getPreferredHorizontalSize());
+ dim.height = insetCache.top + insetCache.bottom;
+ dim.height += focusInsets.top + focusInsets.bottom;
+ dim.height += trackRect.height + tickRect.height + labelRect.height;
+ }
else
- return getPreferredVerticalSize();
+ {
+ // Create copy here to protect the UIManager value.
+ dim = new Dimension(getPreferredVerticalSize());
+ dim.width = insetCache.left + insetCache.right;
+ dim.width += focusInsets.left + focusInsets.right;
+ dim.width += trackRect.width + tickRect.width + labelRect.width;
+ }
+ return dim;
}
/**
@@ -1077,10 +1020,25 @@ public class BasicSliderUI extends SliderUI
*/
public Dimension getMinimumSize(JComponent c)
{
+ recalculateIfInsetsChanged();
+ Dimension dim;
if (slider.getOrientation() == JSlider.HORIZONTAL)
- return getMinimumHorizontalSize();
+ {
+ // Create copy here to protect the UIManager value.
+ dim = new Dimension(getMinimumHorizontalSize());
+ dim.height = insetCache.top + insetCache.bottom;
+ dim.height += focusInsets.top + focusInsets.bottom;
+ dim.height += trackRect.height + tickRect.height + labelRect.height;
+ }
else
- return getMinimumVerticalSize();
+ {
+ // Create copy here to protect the UIManager value.
+ dim = new Dimension(getMinimumVerticalSize());
+ dim.width = insetCache.left + insetCache.right;
+ dim.width += focusInsets.left + focusInsets.right;
+ dim.width += trackRect.width + tickRect.width + labelRect.width;
+ }
+ return dim;
}
/**
@@ -1093,40 +1051,12 @@ public class BasicSliderUI extends SliderUI
*/
public Dimension getMaximumSize(JComponent c)
{
- Insets insets = slider.getInsets();
+ Dimension dim = getPreferredSize(c);
if (slider.getOrientation() == JSlider.HORIZONTAL)
- {
- // Height is determined by the thumb, the ticks and the labels.
- int height = getThumbSize().height;
-
- if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0
- || slider.getMinorTickSpacing() > 0)
- height += getTickLength();
-
- if (slider.getPaintLabels())
- height += getHeightOfTallestLabel();
-
- height += insets.top + insets.bottom + focusInsets.top
- + focusInsets.bottom;
-
- return new Dimension(32767, height);
- }
+ dim.width = Short.MAX_VALUE;
else
- {
- int width = getThumbSize().width;
-
- if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0
- || slider.getMinorTickSpacing() > 0)
- width += getTickLength();
-
- if (slider.getPaintLabels())
- width += getWidthOfWidestLabel();
-
- width += insets.left + insets.right + focusInsets.left
- + focusInsets.right;
-
- return new Dimension(width, 32767);
- }
+ dim.height = Short.MAX_VALUE;
+ return dim;
}
/**
@@ -1151,12 +1081,10 @@ public class BasicSliderUI extends SliderUI
*/
protected void calculateFocusRect()
{
- insetCache = slider.getInsets();
- focusRect = SwingUtilities.calculateInnerArea(slider, focusRect);
- if (focusRect.width < 0)
- focusRect.width = 0;
- if (focusRect.height < 0)
- focusRect.height = 0;
+ focusRect.x = insetCache.left;
+ focusRect.y = insetCache.top;
+ focusRect.width = slider.getWidth() - insetCache.left - insetCache.right;
+ focusRect.height = slider.getHeight() - insetCache.top - insetCache.bottom;
}
/**
@@ -1181,13 +1109,8 @@ public class BasicSliderUI extends SliderUI
contentRect.y = focusRect.y + focusInsets.top;
contentRect.width = focusRect.width - focusInsets.left - focusInsets.right;
- contentRect.height = focusRect.height - focusInsets.top
- - focusInsets.bottom;
-
- if (contentRect.width < 0)
- contentRect.width = 0;
- if (contentRect.height < 0)
- contentRect.height = 0;
+ contentRect.height = focusRect.height - focusInsets.top
+ - focusInsets.bottom;
}
/**
@@ -1258,26 +1181,24 @@ public class BasicSliderUI extends SliderUI
{
if (slider.getOrientation() == JSlider.HORIZONTAL)
{
- trackRect.x = contentRect.x + trackBuffer;
- int h = getThumbSize().height;
- if (slider.getPaintTicks() && (slider.getMajorTickSpacing() > 0
- || slider.getMinorTickSpacing() > 0))
- h += getTickLength();
+ int center = thumbRect.height;
+ if (slider.getPaintTicks())
+ center += getTickLength();
if (slider.getPaintLabels())
- h += getHeightOfTallestLabel();
- trackRect.y = contentRect.y + (contentRect.height - h) / 2 - 1;
+ center += getHeightOfTallestLabel();
+ trackRect.x = contentRect.x + trackBuffer;
+ trackRect.y = contentRect.y + (contentRect.height - center - 1) / 2;
trackRect.width = contentRect.width - 2 * trackBuffer;
trackRect.height = thumbRect.height;
}
else
{
- int w = getThumbSize().width;
- if (slider.getPaintTicks() && (slider.getMajorTickSpacing() > 0
- || slider.getMinorTickSpacing() > 0))
- w += getTickLength();
+ int center = thumbRect.width;
+ if (slider.getPaintTicks())
+ center += getTickLength();
if (slider.getPaintLabels())
- w += getWidthOfWidestLabel();
- trackRect.x = contentRect.x + (contentRect.width - w) / 2 - 1;
+ center += getWidthOfWidestLabel();
+ trackRect.x = contentRect.x + (contentRect.width - center - 1) / 2;
trackRect.y = contentRect.y + trackBuffer;
trackRect.width = thumbRect.width;
trackRect.height = contentRect.height - 2 * trackBuffer;
@@ -1310,28 +1231,28 @@ public class BasicSliderUI extends SliderUI
tickRect.x = trackRect.x;
tickRect.y = trackRect.y + trackRect.height;
tickRect.width = trackRect.width;
- tickRect.height = slider.getPaintTicks() ? getTickLength() : 0;
+ tickRect.height = getTickLength();
// this makes our Mauve tests pass...can't explain it!
if (!slider.getPaintTicks())
- tickRect.y--;
-
- if (tickRect.y + tickRect.height > contentRect.y + contentRect.height)
- tickRect.height = contentRect.y + contentRect.height - tickRect.y;
+ {
+ tickRect.y--;
+ tickRect.height = 0;
+ }
}
else
{
tickRect.x = trackRect.x + trackRect.width;
tickRect.y = trackRect.y;
- tickRect.width = slider.getPaintTicks() ? getTickLength() : 0;
+ tickRect.width = getTickLength();
tickRect.height = trackRect.height;
// this makes our Mauve tests pass...can't explain it!
if (!slider.getPaintTicks())
- tickRect.x--;
-
- if (tickRect.x + tickRect.width > contentRect.x + contentRect.width)
- tickRect.width = contentRect.x + contentRect.width - tickRect.x;
+ {
+ tickRect.x--;
+ tickRect.width = 0;
+ }
}
}
@@ -1345,33 +1266,35 @@ public class BasicSliderUI extends SliderUI
{
if (slider.getPaintLabels())
{
- labelRect.x = contentRect.x;
- labelRect.y = tickRect.y + tickRect.height - 1;
- labelRect.width = contentRect.width;
+ labelRect.x = tickRect.x - trackBuffer;
+ labelRect.y = tickRect.y + tickRect.height;
+ labelRect.width = tickRect.width + trackBuffer * 2;
+ labelRect.height = getHeightOfTallestLabel();
}
else
{
- labelRect.x = trackRect.x;
+ labelRect.x = tickRect.x;
labelRect.y = tickRect.y + tickRect.height;
- labelRect.width = trackRect.width;
+ labelRect.width = tickRect.width;
+ labelRect.height = 0;
}
- labelRect.height = getHeightOfTallestLabel();
}
else
{
if (slider.getPaintLabels())
{
- labelRect.x = tickRect.x + tickRect.width - 1;
- labelRect.y = contentRect.y;
- labelRect.height = contentRect.height;
+ labelRect.x = tickRect.x + tickRect.width;
+ labelRect.y = tickRect.y - trackBuffer;
+ labelRect.width = getWidthOfWidestLabel();
+ labelRect.height = tickRect.height + trackBuffer * 2;
}
else
{
labelRect.x = tickRect.x + tickRect.width;
- labelRect.y = trackRect.y;
- labelRect.height = trackRect.height;
+ labelRect.y = tickRect.y;
+ labelRect.width = 0;
+ labelRect.height = tickRect.height;
}
- labelRect.width = getWidthOfWidestLabel();
}
}
@@ -1384,22 +1307,15 @@ public class BasicSliderUI extends SliderUI
protected int getWidthOfWidestLabel()
{
int widest = 0;
- Component label;
-
- if (slider.getLabelTable() == null)
- return 0;
-
- Dimension pref;
- for (Enumeration list = slider.getLabelTable().elements();
- list.hasMoreElements();)
+ Dictionary table = slider.getLabelTable();
+ if (table != null)
{
- Object comp = list.nextElement();
- if (! (comp instanceof Component))
- continue;
- label = (Component) comp;
- pref = label.getPreferredSize();
- if (pref != null && pref.width > widest)
- widest = pref.width;
+ for (Enumeration list = slider.getLabelTable().elements();
+ list.hasMoreElements();)
+ {
+ Component label = (Component) list.nextElement();
+ widest = Math.max(label.getPreferredSize().width, widest);
+ }
}
return widest;
}
@@ -1576,23 +1492,18 @@ public class BasicSliderUI extends SliderUI
*/
public void paint(Graphics g, JComponent c)
{
- // FIXME: Move this to propertyChangeEvent handler, when we get those.
- leftToRightCache = slider.getComponentOrientation()
- != ComponentOrientation.RIGHT_TO_LEFT;
- // FIXME: This next line is only here because the above line is here.
- calculateGeometry();
-
- if (slider.getPaintTrack())
+ recalculateIfInsetsChanged();
+ recalculateIfOrientationChanged();
+ if (slider.getPaintTrack() && hitClip(g, trackRect))
paintTrack(g);
- if (slider.getPaintTicks())
+ if (slider.getPaintTicks() && hitClip(g, tickRect))
paintTicks(g);
- if (slider.getPaintLabels())
+ if (slider.getPaintLabels() && hitClip(g, labelRect))
paintLabels(g);
-
- paintThumb(g);
-
- if (hasFocus)
+ if (slider.hasFocus() && hitClip(g, focusRect))
paintFocus(g);
+ if (hitClip(g, thumbRect))
+ paintThumb(g);
}
/**
@@ -1601,18 +1512,12 @@ public class BasicSliderUI extends SliderUI
*/
protected void recalculateIfInsetsChanged()
{
- // Examining a test program shows that either Sun calls private
- // methods that we don't know about, or these don't do anything.
- calculateFocusRect();
-
- calculateContentRect();
- calculateThumbSize();
- calculateTrackBuffer();
- calculateTrackRect();
- calculateThumbLocation();
-
- calculateTickRect();
- calculateLabelRect();
+ Insets insets = slider.getInsets();
+ if (! insets.equals(insetCache))
+ {
+ insetCache = insets;
+ calculateGeometry();
+ }
}
/**
@@ -1863,45 +1768,30 @@ public class BasicSliderUI extends SliderUI
*/
public void paintLabels(Graphics g)
{
- if (slider.getLabelTable() != null)
+ Dictionary table = slider.getLabelTable();
+ if (table != null)
{
- Dictionary table = slider.getLabelTable();
- Integer tmpKey;
- Object key;
- Object element;
- Component label;
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- {
- for (Enumeration list = table.keys(); list.hasMoreElements();)
- {
- key = list.nextElement();
- if (! (key instanceof Integer))
- continue;
- tmpKey = (Integer) key;
- element = table.get(tmpKey);
- // We won't paint them if they're not
- // JLabels so continue anyway
- if (! (element instanceof JLabel))
- continue;
- label = (Component) element;
- paintHorizontalLabel(g, tmpKey.intValue(), label);
- }
- }
- else
+ int min = slider.getMinimum();
+ int max = slider.getMaximum();
+ for (Enumeration list = table.keys(); list.hasMoreElements();)
{
- for (Enumeration list = table.keys(); list.hasMoreElements();)
+ Integer key = (Integer) list.nextElement();
+ int value = key.intValue();
+ if (value >= min && value <= max)
{
- key = list.nextElement();
- if (! (key instanceof Integer))
- continue;
- tmpKey = (Integer) key;
- element = table.get(tmpKey);
- // We won't paint them if they're not
- // JLabels so continue anyway
- if (! (element instanceof JLabel))
- continue;
- label = (Component) element;
- paintVerticalLabel(g, tmpKey.intValue(), label);
+ Component label = (Component) table.get(key);
+ if (slider.getOrientation() == JSlider.HORIZONTAL)
+ {
+ g.translate(0, labelRect.y);
+ paintHorizontalLabel(g, value, label);
+ g.translate(0, -labelRect.y);
+ }
+ else
+ {
+ g.translate(labelRect.x, 0);
+ paintVerticalLabel(g, value, label);
+ g.translate(-labelRect.x, 0);
+ }
}
}
}
@@ -1920,51 +1810,11 @@ public class BasicSliderUI extends SliderUI
*/
protected void paintHorizontalLabel(Graphics g, int value, Component label)
{
- // This relies on clipping working properly or we'll end up
- // painting all over the place. If our preferred size is ignored, then
- // the labels may not fit inside the slider's bounds. Rather than mucking
- // with font sizes and possible icon sizes, we'll set the bounds for
- // the label and let it get clipped.
- Dimension dim = label.getPreferredSize();
- int w = (int) dim.getWidth();
- int h = (int) dim.getHeight();
-
- int max = slider.getMaximum();
- int min = slider.getMinimum();
-
- if (value > max || value < min)
- return;
-
- // value
- // |
- // ------------
- // | |
- // | |
- // | |
- // The label must move w/2 to the right to fit directly under the value.
- int xpos = xPositionForValue(value) - w / 2;
- int ypos = labelRect.y;
-
- // We want to center the label around the xPositionForValue
- // So we use xpos - w / 2. However, if value is min and the label
- // is large, we run the risk of going out of bounds. So we bring it back
- // to 0 if it becomes negative.
- if (xpos < 0)
- xpos = 0;
-
- // If the label + starting x position is greater than
- // the x space in the label rectangle, we reset it to the largest
- // amount possible in the rectangle. This means ugliness.
- if (xpos + w > labelRect.x + labelRect.width)
- w = labelRect.x + labelRect.width - xpos;
-
- // If the label is too tall. We reset it to the height of the label
- // rectangle.
- if (h > labelRect.height)
- h = labelRect.height;
-
- label.setBounds(xpos, ypos, w, h);
- SwingUtilities.paintComponent(g, label, null, label.getBounds());
+ int center = xPositionForValue(value);
+ int left = center - label.getPreferredSize().width / 2;
+ g.translate(left, 0);
+ label.paint(g);
+ g.translate(-left, 0);
}
/**
@@ -1980,30 +1830,11 @@ public class BasicSliderUI extends SliderUI
*/
protected void paintVerticalLabel(Graphics g, int value, Component label)
{
- Dimension dim = label.getPreferredSize();
- int w = (int) dim.getWidth();
- int h = (int) dim.getHeight();
-
- int max = slider.getMaximum();
- int min = slider.getMinimum();
-
- if (value > max || value < min)
- return;
-
- int xpos = labelRect.x;
- int ypos = yPositionForValue(value) - h / 2;
-
- if (ypos < 0)
- ypos = 0;
-
- if (ypos + h > labelRect.y + labelRect.height)
- h = labelRect.y + labelRect.height - ypos;
-
- if (w > labelRect.width)
- w = labelRect.width;
-
- label.setBounds(xpos, ypos, w, h);
- SwingUtilities.paintComponent(g, label, null, label.getBounds());
+ int center = yPositionForValue(value);
+ int top = center - label.getPreferredSize().height / 2;
+ g.translate(0, top);
+ label.paint(g);
+ g.translate(0, -top);
}
/**
@@ -2118,8 +1949,11 @@ public class BasicSliderUI extends SliderUI
*/
public void setThumbLocation(int x, int y)
{
- thumbRect.x = x;
- thumbRect.y = y;
+ Rectangle union = new Rectangle(thumbRect);
+ thumbRect.setLocation(x, y);
+ SwingUtilities.computeUnion(thumbRect.x, thumbRect.y, thumbRect.width,
+ thumbRect.height, union);
+ slider.repaint(union);
}
/**
@@ -2197,21 +2031,21 @@ public class BasicSliderUI extends SliderUI
*/
protected int xPositionForValue(int value)
{
- double min = slider.getMinimum();
- if (value < min)
- value = (int) min;
- double max = slider.getMaximum();
- if (value > max)
- value = (int) max;
- double len = trackRect.width;
- if ((max - min) <= 0.0)
- return 0;
- int xPos = (int) ((value - min) / (max - min) * len + 0.5);
-
- if (drawInverted())
- return trackRect.x + Math.max(trackRect.width - xPos - 1, 0);
+ int min = slider.getMinimum();
+ int max = slider.getMaximum();
+ int len = trackRect.width;
+ double range = max - min;
+ double pixPerVal = len / range;
+ int left = trackRect.x;
+ int right = left + trackRect.width - 1;
+ int xpos;
+ if (! drawInverted())
+ xpos = left + (int) Math.round(pixPerVal * ((double) value - min));
else
- return trackRect.x + Math.min(xPos, trackRect.width - 1);
+ xpos = right - (int) Math.round(pixPerVal * ((double) value - min));
+ xpos = Math.max(left, xpos);
+ xpos = Math.min(right, xpos);
+ return xpos;
}
/**
@@ -2225,22 +2059,21 @@ public class BasicSliderUI extends SliderUI
*/
protected int yPositionForValue(int value)
{
- double min = slider.getMinimum();
- if (value < min)
- value = (int) min;
- double max = slider.getMaximum();
- if (value > max)
- value = (int) max;
+ int min = slider.getMinimum();
+ int max = slider.getMaximum();
int len = trackRect.height;
- if ((max - min) <= 0.0)
- return 0;
-
- int yPos = (int) ((value - min) / (max - min) * len + 0.5);
-
+ double range = max - min;
+ double pixPerVal = len / range;
+ int top = trackRect.y;
+ int bottom = top + trackRect.height - 1;
+ int ypos;
if (! drawInverted())
- return trackRect.y + trackRect.height - Math.max(yPos, 1);
+ ypos = top + (int) Math.round(pixPerVal * ((double) max - value));
else
- return trackRect.y + Math.min(yPos, trackRect.height - 1);
+ ypos = top + (int) Math.round(pixPerVal * ((double) value - min));
+ ypos = Math.max(top, ypos);
+ ypos = Math.min(bottom, ypos);
+ return ypos;
}
/**
@@ -2494,4 +2327,13 @@ public class BasicSliderUI extends SliderUI
);
return map;
}
+
+ /**
+ * Small utility method to save me from typing the hell out of myself in
+ * paint().
+ */
+ private boolean hitClip(Graphics g, Rectangle r)
+ {
+ return g.hitClip(r.x, r.y, r.width, r.height);
+ }
}
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneDivider.java b/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneDivider.java
index 06d32984efb..95468caa972 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneDivider.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneDivider.java
@@ -38,12 +38,15 @@ exception statement from your version. */
package javax.swing.plaf.basic;
+import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.LayoutManager;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
@@ -52,7 +55,7 @@ import java.beans.PropertyChangeListener;
import javax.swing.JButton;
import javax.swing.JSplitPane;
-import javax.swing.SwingConstants;
+import javax.swing.UIManager;
import javax.swing.border.Border;
/**
@@ -72,6 +75,207 @@ public class BasicSplitPaneDivider extends Container
implements PropertyChangeListener
{
/**
+ * The buttons used as one touch buttons.
+ */
+ private class BasicOneTouchButton
+ extends JButton
+ {
+ /**
+ * Denotes a left button.
+ */
+ static final int LEFT = 0;
+
+ /**
+ * Denotes a right button.
+ */
+ static final int RIGHT = 1;
+
+ /**
+ * The x points for the arrow.
+ */
+ private int[] xpoints;
+
+ /**
+ * The y points for the arrow.
+ */
+ private int[] ypoints;
+
+ /**
+ * Either LEFT or RIGHT.
+ */
+ private int direction;
+
+ /**
+ * Creates a new instance.
+ *
+ * @param dir either LEFT or RIGHT
+ */
+ BasicOneTouchButton(int dir)
+ {
+ direction = dir;
+ xpoints = new int[3];
+ ypoints = new int[3];
+ }
+
+ /**
+ * Never allow borders.
+ */
+ public void setBorder(Border b)
+ {
+ }
+
+ /**
+ * Never allow focus traversal.
+ */
+ public boolean isFocusTraversable()
+ {
+ return false;
+ }
+
+ /**
+ * Paints the one touch button.
+ */
+ public void paint(Graphics g)
+ {
+ if (splitPane != null)
+ {
+ // Fill background.
+ g.setColor(splitPane.getBackground());
+ g.fillRect(0, 0, getWidth(), getHeight());
+
+ // Draw arrow.
+ int size;
+ if (direction == LEFT)
+ {
+ if (orientation == JSplitPane.VERTICAL_SPLIT)
+ {
+ size = Math.min(getHeight(), ONE_TOUCH_SIZE);
+ xpoints[0] = 0;
+ xpoints[1] = size / 2;
+ xpoints[2] = size;
+ ypoints[0] = size;
+ ypoints[1] = 0;
+ ypoints[2] = size;
+ }
+ else
+ {
+ size = Math.min(getWidth(), ONE_TOUCH_SIZE);
+ xpoints[0] = size;
+ xpoints[1] = 0;
+ xpoints[2] = size;
+ ypoints[0] = 0;
+ ypoints[1] = size / 2;
+ ypoints[2] = size;
+ }
+ }
+ else
+ {
+ if (orientation == JSplitPane.VERTICAL_SPLIT)
+ {
+ size = Math.min(getHeight(), ONE_TOUCH_SIZE);
+ xpoints[0] = 0;
+ xpoints[1] = size / 2;
+ xpoints[2] = size;
+ ypoints[0] = 0;
+ ypoints[1] = size;
+ ypoints[2] = 0;
+ }
+ else
+ {
+ size = Math.min(getWidth(), ONE_TOUCH_SIZE);
+ xpoints[0] = 0;
+ xpoints[1] = size;
+ xpoints[2] = 0;
+ ypoints[0] = 0;
+ ypoints[1] = size / 2;
+ ypoints[2] = size;
+ }
+ }
+ g.setColor(Color.BLACK);
+ g.fillPolygon(xpoints, ypoints, 3);
+ }
+ }
+ }
+
+ /**
+ * Listens for actions on the one touch buttons.
+ */
+ private class OneTouchAction
+ implements ActionListener
+ {
+
+ public void actionPerformed(ActionEvent ev)
+ {
+ Insets insets = splitPane.getInsets();
+ int lastLoc = splitPane.getLastDividerLocation();
+ int currentLoc = splitPaneUI.getDividerLocation(splitPane);
+ int newLoc;
+
+ if (ev.getSource() == leftButton)
+ {
+ if (orientation == JSplitPane.VERTICAL_SPLIT)
+ {
+ if (currentLoc
+ >= splitPane.getHeight() - insets.bottom - getHeight())
+ {
+ newLoc = Math.min(splitPane.getMaximumDividerLocation(),
+ lastLoc);
+ }
+ else
+ {
+ newLoc = insets.top;
+ }
+ }
+ else
+ {
+ if (currentLoc
+ >= splitPane.getWidth() - insets.right - getWidth())
+ {
+ newLoc = Math.min(splitPane.getMaximumDividerLocation(),
+ lastLoc);
+ }
+ else
+ {
+ newLoc = insets.left;
+ }
+ }
+ }
+ else
+ {
+ if (orientation == JSplitPane.VERTICAL_SPLIT)
+ {
+ if (currentLoc == insets.top)
+ {
+ newLoc = Math.min(splitPane.getMaximumDividerLocation(),
+ lastLoc);
+ }
+ else
+ {
+ newLoc = splitPane.getHeight() - insets.top - getHeight();
+ }
+ }
+ else
+ {
+ if (currentLoc == insets.left)
+ {
+ newLoc = Math.min(splitPane.getMaximumDividerLocation(),
+ lastLoc);
+ }
+ else
+ {
+ newLoc = splitPane.getWidth() - insets.left - getWidth();
+ }
+ }
+ }
+ if (currentLoc != newLoc)
+ {
+ splitPane.setDividerLocation(newLoc);
+ splitPane.setLastDividerLocation(currentLoc);
+ }
+ }
+ }
+
+ /**
* Determined using the <code>serialver</code> tool of Apple/Sun JDK 1.3.1
* on MacOS X 10.1.5.
*/
@@ -161,6 +365,14 @@ public class BasicSplitPaneDivider extends Container
transient int currentDividerLocation = 1;
/**
+ * Indicates if the ont touch buttons are laid out centered or at the
+ * top/left.
+ *
+ * Package private to avoid accessor method.
+ */
+ boolean centerOneTouchButtons;
+
+ /**
* Constructs a new divider.
*
* @param ui the UI delegate of the enclosing <code>JSplitPane</code>.
@@ -170,6 +382,8 @@ public class BasicSplitPaneDivider extends Container
setLayout(new DividerLayout());
setBasicSplitPaneUI(ui);
setDividerSize(splitPane.getDividerSize());
+ centerOneTouchButtons =
+ UIManager.getBoolean("SplitPane.centerOneTouchButtons");
}
/**
@@ -202,7 +416,8 @@ public class BasicSplitPaneDivider extends Container
addMouseMotionListener(mouseHandler);
hiddenDivider = splitPaneUI.getNonContinuousLayoutDivider();
orientation = splitPane.getOrientation();
- oneTouchExpandableChanged();
+ if (splitPane.isOneTouchExpandable())
+ oneTouchExpandableChanged();
}
}
@@ -293,7 +508,12 @@ public class BasicSplitPaneDivider extends Container
*/
public Dimension getPreferredSize()
{
- return getLayout().preferredLayoutSize(this);
+ Dimension d;
+ if (orientation == JSplitPane.HORIZONTAL_SPLIT)
+ d = new Dimension(getDividerSize(), 1);
+ else
+ d = new Dimension(1, getDividerSize());
+ return d;
}
/**
@@ -320,11 +540,9 @@ public class BasicSplitPaneDivider extends Container
else if (e.getPropertyName().equals(JSplitPane.ORIENTATION_PROPERTY))
{
orientation = splitPane.getOrientation();
- if (splitPane.isOneTouchExpandable())
- {
- layout();
- repaint();
- }
+ invalidate();
+ if (splitPane != null)
+ splitPane.revalidate();
}
else if (e.getPropertyName().equals(JSplitPane.DIVIDER_SIZE_PROPERTY))
dividerSize = splitPane.getDividerSize();
@@ -345,11 +563,6 @@ public class BasicSplitPaneDivider extends Container
dividerSize = getSize();
border.paintBorder(this, g, 0, 0, dividerSize.width, dividerSize.height);
}
- if (splitPane.isOneTouchExpandable())
- {
- ((BasicArrowButton) rightButton).paint(g);
- ((BasicArrowButton) leftButton).paint(g);
- }
}
/**
@@ -361,31 +574,23 @@ public class BasicSplitPaneDivider extends Container
if (splitPane.isOneTouchExpandable())
{
leftButton = createLeftOneTouchButton();
- rightButton = createRightOneTouchButton();
- add(leftButton);
- add(rightButton);
+ if (leftButton != null)
+ leftButton.addActionListener(new OneTouchAction());
- leftButton.addMouseListener(mouseHandler);
- rightButton.addMouseListener(mouseHandler);
+ rightButton = createRightOneTouchButton();
+ if (rightButton != null)
+ rightButton.addActionListener(new OneTouchAction());
- // Set it to 1.
- currentDividerLocation = 1;
- }
- else
- {
+ // Only add them when both are non-null.
if (leftButton != null && rightButton != null)
- {
- leftButton.removeMouseListener(mouseHandler);
- rightButton.removeMouseListener(mouseHandler);
-
- remove(leftButton);
- remove(rightButton);
- leftButton = null;
- rightButton = null;
+ {
+ add(leftButton);
+ add(rightButton);
}
}
- layout();
- repaint();
+ invalidate();
+ if (splitPane != null)
+ splitPane.revalidate();
}
/**
@@ -396,12 +601,9 @@ public class BasicSplitPaneDivider extends Container
*/
protected JButton createLeftOneTouchButton()
{
- int dir = SwingConstants.WEST;
- if (orientation == JSplitPane.VERTICAL_SPLIT)
- dir = SwingConstants.NORTH;
- JButton button = new BasicArrowButton(dir);
- button.setBorder(null);
-
+ JButton button = new BasicOneTouchButton(BasicOneTouchButton.LEFT);
+ button.setMinimumSize(new Dimension(ONE_TOUCH_SIZE, ONE_TOUCH_SIZE));
+ button.setRequestFocusEnabled(false);
return button;
}
@@ -413,11 +615,9 @@ public class BasicSplitPaneDivider extends Container
*/
protected JButton createRightOneTouchButton()
{
- int dir = SwingConstants.EAST;
- if (orientation == JSplitPane.VERTICAL_SPLIT)
- dir = SwingConstants.SOUTH;
- JButton button = new BasicArrowButton(dir);
- button.setBorder(null);
+ JButton button = new BasicOneTouchButton(BasicOneTouchButton.RIGHT);
+ button.setMinimumSize(new Dimension(ONE_TOUCH_SIZE, ONE_TOUCH_SIZE));
+ button.setRequestFocusEnabled(false);
return button;
}
@@ -521,25 +721,6 @@ public class BasicSplitPaneDivider extends Container
*/
public void mousePressed(MouseEvent e)
{
- if (splitPane.isOneTouchExpandable())
- {
- if (e.getSource() == leftButton)
- {
- currentDividerLocation--;
- if (currentDividerLocation < 0)
- currentDividerLocation = 0;
- moveDividerTo(currentDividerLocation);
- return;
- }
- else if (e.getSource() == rightButton)
- {
- currentDividerLocation++;
- if (currentDividerLocation > 2)
- currentDividerLocation = 2;
- moveDividerTo(currentDividerLocation);
- return;
- }
- }
isDragging = true;
currentDividerLocation = 1;
if (orientation == JSplitPane.HORIZONTAL_SPLIT)
@@ -797,10 +978,64 @@ public class BasicSplitPaneDivider extends Container
*/
public void layoutContainer(Container c)
{
- if (splitPane.isOneTouchExpandable())
+ if (leftButton != null && rightButton != null
+ && c == BasicSplitPaneDivider.this)
{
- changeButtonOrientation();
- positionButtons();
+ if (splitPane.isOneTouchExpandable())
+ {
+ Insets insets = getInsets();
+ if (orientation == JSplitPane.HORIZONTAL_SPLIT)
+ {
+ int size = getWidth() - insets.left - insets.right;
+ size = Math.max(size, 0);
+ size = Math.min(size, ONE_TOUCH_SIZE);
+ int x, y;
+ if (centerOneTouchButtons)
+ {
+ y = insets.top;
+ x = (getWidth() - size) / 2;
+ }
+ else
+ {
+ x = insets.left;
+ y = 0;
+ }
+
+ leftButton.setBounds(x, y + ONE_TOUCH_OFFSET, size,
+ size * 2);
+ rightButton.setBounds(x, y + ONE_TOUCH_OFFSET
+ + ONE_TOUCH_SIZE * 2, size, size * 2);
+ }
+ else
+ {
+ int size = getHeight() - insets.top - insets.bottom;
+ size = Math.max(size, 0);
+ size = Math.min(size, ONE_TOUCH_SIZE);
+ int x, y;
+ if (centerOneTouchButtons)
+ {
+ x = insets.left;
+ y = (getHeight() - size) / 2;
+ }
+ else
+ {
+ x = 0;
+ y = insets.top;
+ }
+ leftButton.setBounds(x + ONE_TOUCH_OFFSET, y, size * 2,
+ size);
+ rightButton.setBounds(x + ONE_TOUCH_OFFSET
+ + ONE_TOUCH_SIZE * 2, y, size * 2,
+ size);
+ }
+ }
+ else
+ {
+ // The JDK sets this bounds for disabled one touch buttons, so
+ // do we.
+ leftButton.setBounds(-5, -5, 1, 1);
+ rightButton.setBounds(-5, -5, 1, 1);
+ }
}
}
@@ -838,50 +1073,5 @@ public class BasicSplitPaneDivider extends Container
// Do nothing.
}
- /**
- * This method changes the button orientation when the orientation of the
- * SplitPane changes.
- */
- private void changeButtonOrientation()
- {
- if (orientation == JSplitPane.HORIZONTAL_SPLIT)
- {
- ((BasicArrowButton) rightButton).setDirection(SwingConstants.EAST);
- ((BasicArrowButton) leftButton).setDirection(SwingConstants.WEST);
- }
- else
- {
- ((BasicArrowButton) rightButton).setDirection(SwingConstants.SOUTH);
- ((BasicArrowButton) leftButton).setDirection(SwingConstants.NORTH);
- }
- }
-
- /**
- * This method sizes and positions the buttons.
- */
- private void positionButtons()
- {
- int w = 0;
- int h = 0;
- if (orientation == JSplitPane.HORIZONTAL_SPLIT)
- {
- rightButton.setLocation(ONE_TOUCH_OFFSET, ONE_TOUCH_OFFSET);
- leftButton.setLocation(ONE_TOUCH_OFFSET,
- ONE_TOUCH_OFFSET + 2 * ONE_TOUCH_SIZE);
- w = dividerSize - 2 * ONE_TOUCH_OFFSET;
- h = 2 * ONE_TOUCH_SIZE;
- }
- else
- {
- leftButton.setLocation(ONE_TOUCH_OFFSET, ONE_TOUCH_OFFSET);
- rightButton.setLocation(ONE_TOUCH_OFFSET + 2 * ONE_TOUCH_SIZE,
- ONE_TOUCH_OFFSET);
- h = dividerSize - 2 * ONE_TOUCH_OFFSET;
- w = 2 * ONE_TOUCH_SIZE;
- }
- Dimension dims = new Dimension(w, h);
- leftButton.setSize(dims);
- rightButton.setSize(dims);
- }
}
}
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java
index 2d595597424..b7cc425482d 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java
@@ -63,6 +63,7 @@ import javax.swing.JSlider;
import javax.swing.JSplitPane;
import javax.swing.KeyStroke;
import javax.swing.LookAndFeel;
+import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.plaf.ActionMapUIResource;
@@ -107,13 +108,34 @@ public class BasicSplitPaneUI extends SplitPaneUI
protected int[] sizes = new int[3];
/**
+ * This is used to determine if we are vertical or horizontal layout.
+ * In the JDK, the BasicVerticalLayoutManager seems to have no more
+ * methods implemented (as of JDK5), so we keep this state here.
+ */
+ private int axis;
+
+ /**
* Creates a new instance. This is package private because the reference
* implementation has no public constructor either. Still, we need to
* call it from BasicVerticalLayoutManager.
*/
BasicHorizontalLayoutManager()
{
- // Nothing to do here.
+ this(SwingConstants.HORIZONTAL);
+ }
+
+ /**
+ * Creates a new instance for a specified axis. This is provided for
+ * compatibility, since the BasicVerticalLayoutManager seems to have
+ * no more implementation in the RI, according to the specs. So
+ * we handle all the axis specific stuff here.
+ *
+ * @param a the axis, either SwingConstants#HORIZONTAL,
+ * or SwingConstants#VERTICAL
+ */
+ BasicHorizontalLayoutManager(int a)
+ {
+ axis = a;
}
/**
@@ -167,7 +189,12 @@ public class BasicSplitPaneUI extends SplitPaneUI
*/
protected int getAvailableSize(Dimension containerSize, Insets insets)
{
- return containerSize.width - insets.left - insets.right;
+ int size;
+ if (axis == SwingConstants.HORIZONTAL)
+ size = containerSize.width - insets.left - insets.right;
+ else
+ size = containerSize.height - insets.top - insets.bottom;
+ return size;
}
/**
@@ -180,9 +207,15 @@ public class BasicSplitPaneUI extends SplitPaneUI
*/
protected int getInitialLocation(Insets insets)
{
+ int loc = 0;
if (insets != null)
- return insets.left;
- return 0;
+ {
+ if (axis == SwingConstants.HORIZONTAL)
+ loc = insets.left;
+ else
+ loc = insets.top;
+ }
+ return loc;
}
/**
@@ -195,7 +228,7 @@ public class BasicSplitPaneUI extends SplitPaneUI
*/
public float getLayoutAlignmentX(Container target)
{
- return target.getAlignmentX();
+ return 0.0f;
}
/**
@@ -208,7 +241,7 @@ public class BasicSplitPaneUI extends SplitPaneUI
*/
public float getLayoutAlignmentY(Container target)
{
- return target.getAlignmentY();
+ return 0.0f;
}
/**
@@ -220,10 +253,19 @@ public class BasicSplitPaneUI extends SplitPaneUI
*/
protected int getPreferredSizeOfComponent(Component c)
{
+ int size = 0;
Dimension dims = c.getPreferredSize();
- if (dims != null)
- return dims.width;
- return 0;
+ if (axis == SwingConstants.HORIZONTAL)
+ {
+ if (dims != null)
+ size = dims.width;
+ }
+ else
+ {
+ if (dims != null)
+ size = dims.height;
+ }
+ return size;
}
/**
@@ -235,7 +277,12 @@ public class BasicSplitPaneUI extends SplitPaneUI
*/
protected int getSizeOfComponent(Component c)
{
- return c.getWidth();
+ int size;
+ if (axis == SwingConstants.HORIZONTAL)
+ size = c.getHeight();
+ else
+ size = c.getWidth();
+ return size;
}
/**
@@ -273,8 +320,17 @@ public class BasicSplitPaneUI extends SplitPaneUI
Dimension dims = split.getSize();
int loc = getInitialLocation(insets);
int available = getAvailableSize(dims, insets);
- sizes[0] = getDividerLocation(split) - loc;
+ sizes[0] = split.getDividerLocation();
sizes[1] = available - sizes[0] - sizes[2];
+
+ // According to a Mauve test we only honour the minimum
+ // size of the components, when the dividerLocation hasn't
+ // been excplicitly set.
+ if (! dividerLocationSet)
+ {
+ sizes[0] = Math.max(sizes[0], minimumSizeOfComponent(0));
+ sizes[1] = Math.max(sizes[1], minimumSizeOfComponent(1));
+ }
// The size of the divider won't change.
// Layout component#1.
@@ -313,27 +369,30 @@ public class BasicSplitPaneUI extends SplitPaneUI
*/
public Dimension minimumLayoutSize(Container target)
{
+ Dimension dim = new Dimension();
if (target instanceof JSplitPane)
{
- JSplitPane split = (JSplitPane) target;
- Insets insets = target.getInsets();
-
- int height = 0;
- int width = 0;
+ int primary = 0;
+ int secondary = 0;
for (int i = 0; i < components.length; i++)
{
- if (components[i] == null)
- continue;
- Dimension dims = components[i].getMinimumSize();
- if (dims != null)
+ if (components[i] != null)
{
- width += dims.width;
- height = Math.max(height, dims.height);
+ Dimension dims = components[i].getMinimumSize();
+ primary += axis == SwingConstants.HORIZONTAL ? dims.width
+ : dims.height;
+ int sec = axis == SwingConstants.HORIZONTAL ? dims.height
+ : dims.width;
+ secondary = Math.max(sec, secondary);
}
}
- return new Dimension(width, height);
+ int width = axis == SwingConstants.HORIZONTAL ? primary : secondary;
+ int height = axis == SwingConstants.VERTICAL ? secondary : primary;
+
+ Insets i = splitPane.getInsets();
+ dim.setSize(width + i.left + i.right, height + i.top + i.bottom);
}
- return null;
+ return dim;
}
/**
@@ -347,28 +406,30 @@ public class BasicSplitPaneUI extends SplitPaneUI
*/
public Dimension preferredLayoutSize(Container target)
{
+ Dimension dim = new Dimension();
if (target instanceof JSplitPane)
{
- JSplitPane split = (JSplitPane) target;
- Insets insets = target.getInsets();
-
- int height = 0;
- int width = 0;
+ int primary = 0;
+ int secondary = 0;
for (int i = 0; i < components.length; i++)
{
- if (components[i] == null)
- continue;
- Dimension dims = components[i].getPreferredSize();
- if (dims != null)
+ if (components[i] != null)
{
- width += dims.width;
- if (!(components[i] instanceof BasicSplitPaneDivider))
- height = Math.max(height, dims.height);
+ Dimension dims = components[i].getPreferredSize();
+ primary += axis == SwingConstants.HORIZONTAL ? dims.width
+ : dims.height;
+ int sec = axis == SwingConstants.HORIZONTAL ? dims.height
+ : dims.width;
+ secondary = Math.max(sec, secondary);
}
}
- return new Dimension(width, height);
+ int width = axis == SwingConstants.HORIZONTAL ? primary : secondary;
+ int height = axis == SwingConstants.VERTICAL ? secondary : primary;
+
+ Insets i = splitPane.getInsets();
+ dim.setSize(width + i.left + i.right, height + i.top + i.bottom);
}
- return null;
+ return dim;
}
/**
@@ -406,8 +467,6 @@ public class BasicSplitPaneUI extends SplitPaneUI
{
for (int i = 0; i < components.length; i++)
resetSizeAt(i);
- setDividerLocation(splitPane,
- getInitialLocation(splitPane.getInsets()) + sizes[0]);
}
/**
@@ -425,11 +484,23 @@ public class BasicSplitPaneUI extends SplitPaneUI
protected void setComponentToSize(Component c, int size, int location,
Insets insets, Dimension containerSize)
{
- int w = size;
- int h = containerSize.height - insets.top - insets.bottom;
- int x = location;
- int y = insets.top;
- c.setBounds(x, y, w, h);
+ if (insets != null)
+ {
+ if (axis == SwingConstants.HORIZONTAL)
+ c.setBounds(location, insets.top, size,
+ containerSize.height - insets.top - insets.bottom);
+ else
+ c.setBounds(insets.left, location,
+ containerSize.width - insets.left - insets.right,
+ size);
+ }
+ else
+ {
+ if (axis == SwingConstants.HORIZONTAL)
+ c.setBounds(location, 0, size, containerSize.height);
+ else
+ c.setBounds(0, location, containerSize.width, size);
+ }
}
/**
@@ -462,7 +533,6 @@ public class BasicSplitPaneUI extends SplitPaneUI
resetSizeAt(1);
}
components[2] = divider;
- resetSizeAt(2);
}
/**
@@ -485,10 +555,13 @@ public class BasicSplitPaneUI extends SplitPaneUI
int minimumSizeOfComponent(int index)
{
Dimension dims = components[index].getMinimumSize();
+ int size = 0;
if (dims != null)
- return dims.width;
- else
- return 0;
+ if (axis == SwingConstants.HORIZONTAL)
+ size = dims.width;
+ else
+ size = dims.height;
+ return size;
}
} //end BasicHorizontalLayoutManager
@@ -504,163 +577,11 @@ public class BasicSplitPaneUI extends SplitPaneUI
extends BasicHorizontalLayoutManager
{
/**
- * This method returns the height of the container minus the top and
- * bottom inset.
- *
- * @param containerSize The size of the container.
- * @param insets The insets of the container.
- *
- * @return The height minus top and bottom inset.
- */
- protected int getAvailableSize(Dimension containerSize, Insets insets)
- {
- return containerSize.height - insets.top - insets.bottom;
- }
-
- /**
- * This method returns the top inset.
- *
- * @param insets The Insets to use.
- *
- * @return The top inset.
- */
- protected int getInitialLocation(Insets insets)
- {
- return insets.top;
- }
-
- /**
- * This method returns the preferred height of the component.
- *
- * @param c The component to measure.
- *
- * @return The preferred height of the component.
- */
- protected int getPreferredSizeOfComponent(Component c)
- {
- Dimension dims = c.getPreferredSize();
- if (dims != null)
- return dims.height;
- return 0;
- }
-
- /**
- * This method returns the current height of the component.
- *
- * @param c The component to measure.
- *
- * @return The current height of the component.
- */
- protected int getSizeOfComponent(Component c)
- {
- return c.getHeight();
- }
-
- /**
- * This method returns the minimum layout size. The minimum height is the
- * sum of all the components' minimum heights. The minimum width is the
- * maximum of all the components' minimum widths.
- *
- * @param container The container to measure.
- *
- * @return The minimum size.
+ * Creates a new instance.
*/
- public Dimension minimumLayoutSize(Container container)
+ public BasicVerticalLayoutManager()
{
- if (container instanceof JSplitPane)
- {
- JSplitPane split = (JSplitPane) container;
- Insets insets = container.getInsets();
-
- int height = 0;
- int width = 0;
- for (int i = 0; i < components.length; i++)
- {
- if (components[i] == null)
- continue;
- Dimension dims = components[i].getMinimumSize();
- if (dims != null)
- {
- height += dims.height;
- width = Math.max(width, dims.width);
- }
- }
- return new Dimension(width, height);
- }
- return null;
- }
-
- /**
- * This method returns the preferred layout size. The preferred height is
- * the sum of all the components' preferred heights. The preferred width
- * is the maximum of all the components' preferred widths.
- *
- * @param container The container to measure.
- *
- * @return The preferred size.
- */
- public Dimension preferredLayoutSize(Container container)
- {
- if (container instanceof JSplitPane)
- {
- JSplitPane split = (JSplitPane) container;
- Insets insets = container.getInsets();
-
- int height = 0;
- int width = 0;
- for (int i = 0; i < components.length; i++)
- {
- if (components[i] == null)
- continue;
- Dimension dims = components[i].getPreferredSize();
- if (dims != null)
- {
- height += dims.height;
- width = Math.max(width, dims.width);
- }
- }
- return new Dimension(width, height);
- }
- return null;
- }
-
- /**
- * This method sets the bounds of the given component. The y coordinate is
- * the location given. The x coordinate is the left inset. The height is
- * the size given. The width is the container size minus the left and
- * right inset.
- *
- * @param c The component to set bounds for.
- * @param size The height.
- * @param location The y coordinate.
- * @param insets The insets to use.
- * @param containerSize The container's size.
- */
- protected void setComponentToSize(Component c, int size, int location,
- Insets insets, Dimension containerSize)
- {
- int y = location;
- int x = insets.left;
- int h = size;
- int w = containerSize.width - insets.left - insets.right;
- c.setBounds(x, y, w, h);
- }
-
- /**
- * This method returns the minimum height of the component at the given
- * index.
- *
- * @param index The index of the component to check.
- *
- * @return The minimum height of the given component.
- */
- int minimumSizeOfComponent(int index)
- {
- Dimension dims = components[index].getMinimumSize();
- if (dims != null)
- return dims.height;
- else
- return 0;
+ super(SwingConstants.VERTICAL);
}
}
@@ -941,7 +862,13 @@ public class BasicSplitPaneUI extends SplitPaneUI
/** The JSplitPane that this UI draws. */
protected JSplitPane splitPane;
- private int dividerLocation;
+ /**
+ * True, when setDividerLocation() has been called at least
+ * once on the JSplitPane, false otherwise.
+ *
+ * This is package private to avoid a synthetic accessor method.
+ */
+ boolean dividerLocationSet;
/**
* Creates a new BasicSplitPaneUI object.
@@ -973,6 +900,7 @@ public class BasicSplitPaneUI extends SplitPaneUI
if (c instanceof JSplitPane)
{
splitPane = (JSplitPane) c;
+ dividerLocationSet = false;
installDefaults();
installListeners();
installKeyboardActions();
@@ -990,6 +918,7 @@ public class BasicSplitPaneUI extends SplitPaneUI
uninstallListeners();
uninstallDefaults();
+ dividerLocationSet = false;
splitPane = null;
}
@@ -1007,8 +936,10 @@ public class BasicSplitPaneUI extends SplitPaneUI
nonContinuousLayoutDivider = createDefaultNonContinuousLayoutDivider();
splitPane.add(divider, JSplitPane.DIVIDER);
- // There is no need to add the nonContinuousLayoutDivider
- splitPane.setDividerSize(UIManager.getInt("SplitPane.dividerSize"));
+ // There is no need to add the nonContinuousLayoutDivider.
+ dividerSize = UIManager.getInt("SplitPane.dividerSize");
+ splitPane.setDividerSize(dividerSize);
+ divider.setDividerSize(dividerSize);
splitPane.setOpaque(true);
}
@@ -1136,8 +1067,10 @@ public class BasicSplitPaneUI extends SplitPaneUI
new AbstractAction("negativeIncrement") {
public void actionPerformed(ActionEvent event)
{
- setDividerLocation(splitPane, Math.max(dividerLocation
- - KEYBOARD_DIVIDER_MOVE_OFFSET, 0));
+ int oldLoc = splitPane.getDividerLocation();
+ int newLoc =
+ Math.max(oldLoc - KEYBOARD_DIVIDER_MOVE_OFFSET, 0);
+ splitPane.setDividerLocation(newLoc);
}
}
);
@@ -1145,8 +1078,10 @@ public class BasicSplitPaneUI extends SplitPaneUI
new AbstractAction("positiveIncrement") {
public void actionPerformed(ActionEvent event)
{
- setDividerLocation(splitPane, dividerLocation
- + KEYBOARD_DIVIDER_MOVE_OFFSET);
+ int oldLoc = splitPane.getDividerLocation();
+ int newLoc =
+ Math.max(oldLoc + KEYBOARD_DIVIDER_MOVE_OFFSET, 0);
+ splitPane.setDividerLocation(newLoc);
}
}
);
@@ -1436,7 +1371,7 @@ public class BasicSplitPaneUI extends SplitPaneUI
*/
public void setDividerLocation(JSplitPane jc, int location)
{
- dividerLocation = location;
+ dividerLocationSet = true;
splitPane.revalidate();
splitPane.repaint();
}
@@ -1450,7 +1385,12 @@ public class BasicSplitPaneUI extends SplitPaneUI
*/
public int getDividerLocation(JSplitPane jc)
{
- return dividerLocation;
+ int loc;
+ if (jc.getOrientation() == JSplitPane.HORIZONTAL_SPLIT)
+ loc = divider.getX();
+ else
+ loc = divider.getY();
+ return loc;
}
/**
@@ -1523,7 +1463,7 @@ public class BasicSplitPaneUI extends SplitPaneUI
*/
public Dimension getPreferredSize(JComponent jc)
{
- return layoutManager.preferredLayoutSize((Container) jc);
+ return layoutManager.preferredLayoutSize(jc);
}
/**
@@ -1535,7 +1475,7 @@ public class BasicSplitPaneUI extends SplitPaneUI
*/
public Dimension getMinimumSize(JComponent jc)
{
- return layoutManager.minimumLayoutSize((Container) jc);
+ return layoutManager.minimumLayoutSize(jc);
}
/**
@@ -1547,7 +1487,7 @@ public class BasicSplitPaneUI extends SplitPaneUI
*/
public Dimension getMaximumSize(JComponent jc)
{
- return layoutManager.maximumLayoutSize((Container) jc);
+ return layoutManager.maximumLayoutSize(jc);
}
/**
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java
index 11f25167d21..0d1fa1eed9b 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java
@@ -76,7 +76,6 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.ActionMapUIResource;
import javax.swing.plaf.ComponentUI;
-import javax.swing.plaf.PanelUI;
import javax.swing.plaf.TabbedPaneUI;
import javax.swing.plaf.UIResource;
import javax.swing.text.View;
@@ -252,7 +251,16 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
{
public void mouseReleased(MouseEvent e)
{
- // Nothing to do here.
+ Object s = e.getSource();
+
+ // Event may originate from the viewport in
+ // SCROLL_TAB_LAYOUT mode. It is redisptached
+ // through the tabbed pane then.
+ if (tabPane != e.getSource())
+ {
+ redispatchEvent(e);
+ e.setSource(s);
+ }
}
/**
@@ -264,6 +272,16 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
public void mousePressed(MouseEvent e)
{
Object s = e.getSource();
+
+ // Event may originate from the viewport in
+ // SCROLL_TAB_LAYOUT mode. It is redisptached
+ // through the tabbed pane then.
+ if (tabPane != e.getSource())
+ {
+ redispatchEvent(e);
+ e.setSource(s);
+ }
+
int placement = tabPane.getTabPlacement();
if (s == incrButton)
@@ -298,47 +316,61 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
if(!decrButton.isEnabled())
return;
- // The scroll location may be zero but the offset
- // greater than zero because of an adjustement to
- // make a partially visible tab completely visible.
- if (currentScrollLocation > 0)
- currentScrollLocation--;
-
- // Set the offset back to 0 and recompute it.
- currentScrollOffset = 0;
-
- switch (placement)
- {
- case JTabbedPane.TOP:
- case JTabbedPane.BOTTOM:
- // Take the tab area inset into account.
- if (currentScrollLocation > 0)
- currentScrollOffset = getTabAreaInsets(placement).left;
- // Recompute scroll offset.
- for (int i = 0; i < currentScrollLocation; i++)
- currentScrollOffset += rects[i].width;
- break;
- default:
- // Take the tab area inset into account.
- if (currentScrollLocation > 0)
- currentScrollOffset = getTabAreaInsets(placement).top;
+ // The scroll location may be zero but the offset
+ // greater than zero because of an adjustement to
+ // make a partially visible tab completely visible.
+ if (currentScrollLocation > 0)
+ currentScrollLocation--;
- for (int i = 0; i < currentScrollLocation; i++)
- currentScrollOffset += rects[i].height;
- }
+ // Set the offset back to 0 and recompute it.
+ currentScrollOffset = 0;
+
+ switch (placement)
+ {
+ case JTabbedPane.TOP:
+ case JTabbedPane.BOTTOM:
+ // Take the tab area inset into account.
+ if (currentScrollLocation > 0)
+ currentScrollOffset = getTabAreaInsets(placement).left;
+ // Recompute scroll offset.
+ for (int i = 0; i < currentScrollLocation; i++)
+ currentScrollOffset += rects[i].width;
+ break;
+ default:
+ // Take the tab area inset into account.
+ if (currentScrollLocation > 0)
+ currentScrollOffset = getTabAreaInsets(placement).top;
+
+ for (int i = 0; i < currentScrollLocation; i++)
+ currentScrollOffset += rects[i].height;
+ }
- updateViewPosition();
- updateButtons();
+ updateViewPosition();
+ updateButtons();
- tabPane.repaint();
- } else if (tabPane.isEnabled())
+ tabPane.repaint();
+ }
+ else if (tabPane.isEnabled())
{
int index = tabForCoordinate(tabPane, e.getX(), e.getY());
+ if (!tabPane.isEnabledAt(index))
+ return;
+
if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT
&& s == panel)
+ {
scrollTab(index, placement);
+
+ tabPane.setSelectedIndex(index);
+ tabPane.repaint();
+ }
+ else
+ {
+ tabPane.setSelectedIndex(index);
+ tabPane.revalidate();
+ tabPane.repaint();
+ }
- tabPane.setSelectedIndex(index);
}
}
@@ -347,11 +379,22 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
* Receives notification when the mouse pointer has entered the tabbed
* pane.
*
- * @param ev the mouse event
+ * @param e the mouse event
*/
- public void mouseEntered(MouseEvent ev)
+ public void mouseEntered(MouseEvent e)
{
- int tabIndex = tabForCoordinate(tabPane, ev.getX(), ev.getY());
+ Object s = e.getSource();
+
+ // Event may originate from the viewport in
+ // SCROLL_TAB_LAYOUT mode. It is redisptached
+ // through the tabbed pane then.
+ if (tabPane != e.getSource())
+ {
+ redispatchEvent(e);
+ e.setSource(s);
+ }
+
+ int tabIndex = tabForCoordinate(tabPane, e.getX(), e.getY());
setRolloverTab(tabIndex);
}
@@ -359,10 +402,21 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
* Receives notification when the mouse pointer has exited the tabbed
* pane.
*
- * @param ev the mouse event
+ * @param e the mouse event
*/
- public void mouseExited(MouseEvent ev)
+ public void mouseExited(MouseEvent e)
{
+ Object s = e.getSource();
+
+ // Event may originate from the viewport in
+ // SCROLL_TAB_LAYOUT mode. It is redisptached
+ // through the tabbed pane then.
+ if (tabPane != e.getSource())
+ {
+ redispatchEvent(e);
+ e.setSource(s);
+ }
+
setRolloverTab(-1);
}
@@ -374,9 +428,37 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
*/
public void mouseMoved(MouseEvent ev)
{
+ Object s = ev.getSource();
+
+ if (tabPane != ev.getSource())
+ {
+ ev.setSource(tabPane);
+ tabPane.dispatchEvent(ev);
+
+ ev.setSource(s);
+ }
+
int tabIndex = tabForCoordinate(tabPane, ev.getX(), ev.getY());
setRolloverTab(tabIndex);
}
+
+ /** Modifies the mouse event to originate from
+ * the tabbed pane and redispatches it.
+ *
+ * @param me
+ */
+ void redispatchEvent(MouseEvent me)
+ {
+ me.setSource(tabPane);
+ Point viewPos = viewport.getViewPosition();
+ viewPos.x -= viewport.getX();
+ viewPos.y -= viewport.getY();
+ me.translatePoint(-viewPos.x, -viewPos.y);
+ tabPane.dispatchEvent(me);
+
+ me.translatePoint(viewPos.x, viewPos.y);
+ }
+
}
/**
@@ -396,20 +478,56 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
*/
public void propertyChange(PropertyChangeEvent e)
{
- if (e.getPropertyName().equals("tabLayoutPolicy"))
+ out:
{
- currentScrollLocation = currentScrollOffset = 0;
-
- layoutManager = createLayoutManager();
-
- tabPane.setLayout(layoutManager);
- }
- else if (e.getPropertyName().equals("tabPlacement")
- && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
- {
- incrButton = createIncreaseButton();
- decrButton = createDecreaseButton();
+ if (e.getPropertyName().equals("tabLayoutPolicy"))
+ {
+ currentScrollLocation = currentScrollOffset = 0;
+
+ layoutManager = createLayoutManager();
+
+ tabPane.setLayout(layoutManager);
+ }
+ else if (e.getPropertyName().equals("tabPlacement")
+ && tabPane.getTabLayoutPolicy()
+ == JTabbedPane.SCROLL_TAB_LAYOUT)
+ {
+ incrButton = createIncreaseButton();
+ decrButton = createDecreaseButton();
+
+ // If the tab placement value was changed of a tabbed pane
+ // in SCROLL_TAB_LAYOUT mode we investigate the change to
+ // implement the following behavior which was observed in
+ // the RI:
+ // The scrolling offset will be reset if we change to
+ // a direction which is orthogonal to the current
+ // direction and stays the same if it is parallel.
+
+ int oldPlacement = ((Integer) e.getOldValue()).intValue();
+ int newPlacement = ((Integer) e.getNewValue()).intValue();
+ switch (newPlacement)
+ {
+ case JTabbedPane.TOP:
+ case JTabbedPane.BOTTOM:
+ if (oldPlacement == JTabbedPane.TOP
+ || oldPlacement == JTabbedPane.BOTTOM)
+ break out;
+
+ currentScrollOffset = getTabAreaInsets(newPlacement).left;
+ break;
+ default:
+ if (oldPlacement == JTabbedPane.LEFT
+ || oldPlacement == JTabbedPane.RIGHT)
+ break out;
+
+ currentScrollOffset = getTabAreaInsets(newPlacement).top;
+ }
+
+ updateViewPosition();
+ updateButtons();
+ }
}
+
tabPane.revalidate();
tabPane.repaint();
}
@@ -784,6 +902,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
default:
tabAreaHeight = calculateTabAreaHeight(tabPlacement, runCount,
maxTabHeight);
+
compX = insets.left + contentBorderInsets.left;
compY = tabAreaHeight + insets.top + contentBorderInsets.top;
}
@@ -838,83 +957,51 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start,
int max)
{
- Insets tabAreaInsets = getTabAreaInsets(tabPlacement);
- if (tabPlacement == SwingUtilities.TOP
- || tabPlacement == SwingUtilities.BOTTOM)
+ boolean horizontal = tabPlacement == TOP || tabPlacement == BOTTOM;
+ int currentRun = runCount - 1;
+ double weight = 1.25;
+ for (boolean adjust = true; adjust == true;)
{
- // We should only do this for runCount - 1, cause we can
- // only shift that many times between runs.
- for (int i = 1; i < runCount; i++)
+ int last = lastTabInRun(tabCount, currentRun);
+ int prevLast = lastTabInRun(tabCount, currentRun - 1);
+ int end;
+ int prevLength;
+ if (horizontal)
{
- Rectangle currRun = rects[lastTabInRun(tabCount, i)];
- Rectangle nextRun = rects[lastTabInRun(tabCount,
- getNextTabRun(i))];
- int spaceInCurr = currRun.x + currRun.width;
- int spaceInNext = nextRun.x + nextRun.width;
-
- int diffNow = spaceInCurr - spaceInNext;
- int diffLater = (spaceInCurr - currRun.width)
- - (spaceInNext + currRun.width);
-
- while (Math.abs(diffLater) < Math.abs(diffNow)
- && spaceInNext + currRun.width < max)
- {
- tabRuns[i]--;
- spaceInNext += currRun.width;
- spaceInCurr -= currRun.width;
- currRun = rects[lastTabInRun(tabCount, i)];
- diffNow = spaceInCurr - spaceInNext;
- diffLater = (spaceInCurr - currRun.width)
- - (spaceInNext + currRun.width);
- }
-
- // Fixes the bounds of all tabs in the current
- // run.
- int first = tabRuns[i];
- int last = lastTabInRun(tabCount, i);
- int currX = start;
- for (int j = first; j <= last; j++)
- {
- rects[j].x = currX;
- currX += rects[j].width;
- }
+ end = rects[last].x + rects[last].width;
+ prevLength = (int) (maxTabWidth * weight);
}
- }
- else
- {
- for (int i = 1; i < runCount; i++)
+ else
{
- Rectangle currRun = rects[lastTabInRun(tabCount, i)];
- Rectangle nextRun = rects[lastTabInRun(tabCount,
- getNextTabRun(i))];
- int spaceInCurr = currRun.y + currRun.height;
- int spaceInNext = nextRun.y + nextRun.height;
-
- int diffNow = spaceInCurr - spaceInNext;
- int diffLater = (spaceInCurr - currRun.height)
- - (spaceInNext + currRun.height);
- while (Math.abs(diffLater) < Math.abs(diffNow)
- && spaceInNext + currRun.height < max)
- {
- tabRuns[i]--;
- spaceInNext += currRun.height;
- spaceInCurr -= currRun.height;
- currRun = rects[lastTabInRun(tabCount, i)];
- diffNow = spaceInCurr - spaceInNext;
- diffLater = (spaceInCurr - currRun.height)
- - (spaceInNext + currRun.height);
- }
-
- // Fixes the bounds of tabs in the current run.
- int first = tabRuns[i];
- int last = lastTabInRun(tabCount, i);
- int currY = start;
- for (int j = first; j <= last; j++)
+ end = rects[last].y + rects[last].height;
+ prevLength = (int) (maxTabWidth * weight * 2);
+ }
+ if (max - end > prevLength)
+ {
+ tabRuns[currentRun] = prevLast;
+ if (horizontal)
+ rects[prevLast].x = start;
+ else
+ rects[prevLast].y = start;
+ for (int i = prevLast + 1; i <= last; i++)
{
- rects[j].y = currY;
- currY += rects[j].height;
+ if (horizontal)
+ rects[i].x = rects[i - 1].x + rects[i - 1].width;
+ else
+ rects[i].y = rects[i - 1].y + rects[i - 1].height;
}
}
+ else if (currentRun == runCount - 1)
+ adjust = false;
+ if (currentRun - 1 > 0)
+ currentRun -= 1;
+ else
+ {
+ // Check again, but with higher ratio to avoid
+ // clogging up the last run.
+ currentRun = runCount - 1;
+ weight += 0.25;
+ }
}
}
@@ -1325,7 +1412,6 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
{
super.layoutContainer(pane);
int tabCount = tabPane.getTabCount();
- Point p = null;
if (tabCount == 0)
return;
int tabPlacement = tabPane.getTabPlacement();
@@ -1512,7 +1598,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
*/
public void updateUI()
{
- setUI((PanelUI) new ScrollingPanelUI());
+ setUI(new ScrollingPanelUI());
}
}
@@ -1892,15 +1978,19 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
final void updateViewPosition()
{
Point p = viewport.getViewPosition();
-
+
+ // The unneeded coordinate must be set to zero
+ // in order to correctly handle placement changes.
switch (tabPane.getTabPlacement())
{
case JTabbedPane.LEFT:
case JTabbedPane.RIGHT:
+ p.x = 0;
p.y = currentScrollOffset;
break;
default:
p.x = currentScrollOffset;
+ p.y = 0;
}
viewport.setViewPosition(p);
@@ -2331,7 +2421,6 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
paintTabBorder(g, tabPlacement, tabIndex, rect.x, rect.y, rect.width,
rect.height, isSelected);
-
// Layout label.
FontMetrics fm = getFontMetrics();
Icon icon = getIconForTab(tabIndex);
@@ -2369,7 +2458,17 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
Rectangle tabRect, Rectangle iconRect,
Rectangle textRect, boolean isSelected)
{
- SwingUtilities.layoutCompoundLabel(metrics, title, icon,
+ // Reset the icon and text rectangles, as the result is not specified
+ // when the locations are not (0,0).
+ textRect.x = 0;
+ textRect.y = 0;
+ textRect.width = 0;
+ textRect.height = 0;
+ iconRect.x = 0;
+ iconRect.y = 0;
+ iconRect.width = 0;
+ iconRect.height = 0;
+ SwingUtilities.layoutCompoundLabel(tabPane, metrics, title, icon,
SwingConstants.CENTER,
SwingConstants.CENTER,
SwingConstants.CENTER,
@@ -2764,7 +2863,6 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
int width = tabPane.getWidth();
int height = tabPane.getHeight();
Insets insets = tabPane.getInsets();
- Insets tabAreaInsets = getTabAreaInsets(tabPlacement);
// Calculate coordinates of content area.
int x = insets.left;
@@ -2869,8 +2967,6 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
int endgap = rects[selectedIndex].y + rects[selectedIndex].height
- currentScrollOffset;
- int diff = 0;
-
if (tabPlacement == SwingConstants.LEFT && startgap >= 0)
{
g.drawLine(x, y, x, startgap);
@@ -2957,8 +3053,6 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
int endgap = rects[selectedIndex].y + rects[selectedIndex].height
- currentScrollOffset;
- int diff = 0;
-
if (tabPlacement == SwingConstants.RIGHT && startgap >= 0)
{
g.setColor(shadow);
@@ -2988,8 +3082,13 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
}
/**
- * This method returns the tab bounds for the given index.
- *
+ * <p>This method returns the bounds of a tab for the given index
+ * and shifts it by the current scrolling offset if the tabbed
+ * pane is in scrolling tab layout mode.</p>
+ *
+ * <p>Subclassses should retrievs a tab's bounds by this method
+ * if they want to find out whether the tab is currently visible.</p>
+ *
* @param pane The JTabbedPane.
* @param i The index to look for.
*
@@ -3000,6 +3099,26 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
// Need to re-layout container if tab does not exist.
if (i >= rects.length)
layoutManager.layoutContainer(pane);
+
+ // Properly shift coordinates if scrolling has taken
+ // place.
+ if (pane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
+ {
+ Rectangle r = new Rectangle(rects[i]);
+
+ switch(pane.getTabPlacement())
+ {
+ case SwingConstants.TOP:
+ case SwingConstants.BOTTOM:
+ r.x -= currentScrollOffset;
+ break;
+ default:
+ r.y -= currentScrollOffset;
+ }
+
+ return r;
+ }
+
return rects[i];
}
@@ -3048,7 +3167,10 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
}
/**
- * This method returns the tab bounds in the given rectangle.
+ * <p>This method returns the tab bounds in the given rectangle.</p>
+ *
+ * <p>The returned rectangle will be shifted by the current scroll
+ * offset if the tabbed pane is in scrolling tab layout mode.</p>.
*
* @param tabIndex The index to get bounds for.
* @param dest The rectangle to store bounds in.
@@ -3324,21 +3446,20 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
Icon icon = getIconForTab(tabIndex);
Insets insets = getTabInsets(tabPlacement, tabIndex);
- int width = 0;
+ int width = insets.bottom + insets.right + 3;
if (icon != null)
{
- Rectangle vr = new Rectangle();
- Rectangle ir = new Rectangle();
- Rectangle tr = new Rectangle();
- layoutLabel(tabPlacement, getFontMetrics(), tabIndex,
- tabPane.getTitleAt(tabIndex), icon, vr, ir, tr,
- tabIndex == tabPane.getSelectedIndex());
- width = tr.union(ir).width;
+ width += icon.getIconWidth() + textIconGap;
}
- else
- width = metrics.stringWidth(tabPane.getTitleAt(tabIndex));
- width += insets.left + insets.right;
+ View v = getTextViewForTab(tabIndex);
+ if (v != null)
+ width += v.getPreferredSpan(View.X_AXIS);
+ else
+ {
+ String label = tabPane.getTitleAt(tabIndex);
+ width += metrics.stringWidth(label);
+ }
return width;
}
@@ -3377,7 +3498,8 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
{
Insets insets = getTabAreaInsets(tabPlacement);
int tabAreaHeight = horizRunCount * maxTabHeight
- - (horizRunCount - 1) * tabRunOverlay;
+ - (horizRunCount - 1)
+ * getTabRunOverlay(tabPlacement);
tabAreaHeight += insets.top + insets.bottom;
@@ -3399,7 +3521,8 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
{
Insets insets = getTabAreaInsets(tabPlacement);
int tabAreaWidth = vertRunCount * maxTabWidth
- - (vertRunCount - 1) * tabRunOverlay;
+ - (vertRunCount - 1)
+ * getTabRunOverlay(tabPlacement);
tabAreaWidth += insets.left + insets.right;
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicTableHeaderUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicTableHeaderUI.java
index abe7cab43b3..8a8eeb837fe 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicTableHeaderUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicTableHeaderUI.java
@@ -38,8 +38,6 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import gnu.classpath.NotImplementedException;
-
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
@@ -415,9 +413,8 @@ public class BasicTableHeaderUI extends TableHeaderUI
}
protected void installKeyboardActions()
- throws NotImplementedException
{
- // TODO: Implement this properly.
+ // AFAICS, the RI does nothing here.
}
/**
@@ -448,9 +445,8 @@ public class BasicTableHeaderUI extends TableHeaderUI
}
protected void uninstallKeyboardActions()
- throws NotImplementedException
{
- // TODO: Implement this properly.
+ // AFAICS, the RI does nothing here.
}
/**
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java
index 15be4d57e62..a672173c725 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java
@@ -443,11 +443,14 @@ public class BasicTableUI extends TableUI
public Dimension getPreferredSize(JComponent comp)
{
int prefTotalColumnWidth = 0;
- for (int i = 0; i < table.getColumnCount(); i++)
+ TableColumnModel tcm = table.getColumnModel();
+
+ for (int i = 0; i < tcm.getColumnCount(); i++)
{
- TableColumn col = table.getColumnModel().getColumn(i);
+ TableColumn col = tcm.getColumn(i);
prefTotalColumnWidth += col.getPreferredWidth();
}
+
return new Dimension(prefTotalColumnWidth, getHeight());
}
@@ -455,7 +458,7 @@ public class BasicTableUI extends TableUI
* Returns the table height. This helper method is used by
* {@link #getMinimumSize(JComponent)}, {@link #getPreferredSize(JComponent)}
* and {@link #getMaximumSize(JComponent)} to determine the table height.
- *
+ *
* @return the table height
*/
private int getHeight()
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicTextUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicTextUI.java
index 8e9c8c949f3..e152a3034d5 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicTextUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicTextUI.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package javax.swing.plaf.basic;
+import gnu.classpath.SystemProperties;
+
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
@@ -71,6 +73,7 @@ import javax.swing.plaf.InputMapUIResource;
import javax.swing.plaf.TextUI;
import javax.swing.plaf.UIResource;
import javax.swing.text.AbstractDocument;
+import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.Caret;
import javax.swing.text.DefaultCaret;
@@ -120,6 +123,140 @@ public abstract class BasicTextUI extends TextUI
}
}
+ private static class FocusHandler
+ implements FocusListener
+ {
+ public void focusGained(FocusEvent e)
+ {
+ // Nothing to do here.
+ }
+ public void focusLost(FocusEvent e)
+ {
+ JTextComponent textComponent = (JTextComponent) e.getComponent();
+ // Integrates Swing text components with the system clipboard:
+ // The idea is that if one wants to copy text around X11-style
+ // (select text and middle-click in the target component) the focus
+ // will move to the new component which gives the old focus owner the
+ // possibility to paste its selection into the clipboard.
+ if (!e.isTemporary()
+ && textComponent.getSelectionStart()
+ != textComponent.getSelectionEnd())
+ {
+ SecurityManager sm = System.getSecurityManager();
+ try
+ {
+ if (sm != null)
+ sm.checkSystemClipboardAccess();
+
+ Clipboard cb = Toolkit.getDefaultToolkit().getSystemSelection();
+ if (cb != null)
+ {
+ StringSelection selection = new StringSelection(
+ textComponent.getSelectedText());
+ cb.setContents(selection, selection);
+ }
+ }
+ catch (SecurityException se)
+ {
+ // Not allowed to access the clipboard: Ignore and
+ // do not access it.
+ }
+ catch (HeadlessException he)
+ {
+ // There is no AWT: Ignore and do not access the
+ // clipboard.
+ }
+ catch (IllegalStateException ise)
+ {
+ // Clipboard is currently unavaible.
+ }
+ }
+ }
+ }
+
+ /**
+ * This FocusListener triggers repaints on focus shift.
+ */
+ private static FocusListener focusListener;
+
+ /**
+ * Receives notifications when properties of the text component change.
+ */
+ private class Handler
+ implements PropertyChangeListener, DocumentListener
+ {
+ /**
+ * Notifies when a property of the text component changes.
+ *
+ * @param event the PropertyChangeEvent describing the change
+ */
+ public void propertyChange(PropertyChangeEvent event)
+ {
+ if (event.getPropertyName().equals("document"))
+ {
+ // Document changed.
+ Object oldValue = event.getOldValue();
+ if (oldValue != null)
+ {
+ Document oldDoc = (Document) oldValue;
+ oldDoc.removeDocumentListener(handler);
+ }
+ Object newValue = event.getNewValue();
+ if (newValue != null)
+ {
+ Document newDoc = (Document) newValue;
+ newDoc.addDocumentListener(handler);
+ }
+ modelChanged();
+ }
+
+ BasicTextUI.this.propertyChange(event);
+ }
+
+ /**
+ * Notification about a document change event.
+ *
+ * @param ev the DocumentEvent describing the change
+ */
+ public void changedUpdate(DocumentEvent ev)
+ {
+ // Updates are forwarded to the View even if 'getVisibleEditorRect'
+ // method returns null. This means the View classes have to be
+ // aware of that possibility.
+ rootView.changedUpdate(ev, getVisibleEditorRect(),
+ rootView.getViewFactory());
+ }
+
+ /**
+ * Notification about a document insert event.
+ *
+ * @param ev the DocumentEvent describing the insertion
+ */
+ public void insertUpdate(DocumentEvent ev)
+ {
+ // Updates are forwarded to the View even if 'getVisibleEditorRect'
+ // method returns null. This means the View classes have to be
+ // aware of that possibility.
+ rootView.insertUpdate(ev, getVisibleEditorRect(),
+ rootView.getViewFactory());
+ }
+
+ /**
+ * Notification about a document removal event.
+ *
+ * @param ev the DocumentEvent describing the removal
+ */
+ public void removeUpdate(DocumentEvent ev)
+ {
+ // Updates are forwarded to the View even if 'getVisibleEditorRect'
+ // method returns null. This means the View classes have to be
+ // aware of that possibility.
+ rootView.removeUpdate(ev, getVisibleEditorRect(),
+ rootView.getViewFactory());
+ }
+
+ }
+
/**
* This view forms the root of the View hierarchy. However, it delegates
* most calls to another View which is the real root of the hierarchy.
@@ -226,19 +363,14 @@ public abstract class BasicTextUI extends TextUI
}
/**
- * Returns the preferred span along the specified <code>axis</code>.
- * This is delegated to the real root view.
- *
- * @param axis the axis for which the preferred span is queried
- *
- * @return the preferred span along the axis
+ * Sets the size of the renderer. This is synchronized because that
+ * potentially triggers layout and we don't want more than one thread
+ * playing with the layout information.
*/
- public float getPreferredSpan(int axis)
+ public synchronized void setSize(float w, float h)
{
if (view != null)
- return view.getPreferredSpan(axis);
-
- return Integer.MAX_VALUE;
+ view.setSize(w, h);
}
/**
@@ -251,8 +383,8 @@ public abstract class BasicTextUI extends TextUI
{
if (view != null)
{
- Rectangle b = s.getBounds();
- view.setSize(b.width, b.height);
+ Rectangle b = s instanceof Rectangle ? (Rectangle) s : s.getBounds();
+ setSize(b.width, b.height);
view.paint(g, s);
}
}
@@ -312,7 +444,8 @@ public abstract class BasicTextUI extends TextUI
*/
public void insertUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
{
- view.insertUpdate(ev, shape, vf);
+ if (view != null)
+ view.insertUpdate(ev, shape, vf);
}
/**
@@ -325,7 +458,8 @@ public abstract class BasicTextUI extends TextUI
*/
public void removeUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
{
- view.removeUpdate(ev, shape, vf);
+ if (view != null)
+ view.removeUpdate(ev, shape, vf);
}
/**
@@ -338,7 +472,8 @@ public abstract class BasicTextUI extends TextUI
*/
public void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
{
- view.changedUpdate(ev, shape, vf);
+ if (view != null)
+ view.changedUpdate(ev, shape, vf);
}
/**
@@ -400,116 +535,73 @@ public abstract class BasicTextUI extends TextUI
{
return textComponent.getDocument();
}
- }
- /**
- * Receives notifications when properties of the text component change.
- */
- private class PropertyChangeHandler implements PropertyChangeListener
- {
/**
- * Notifies when a property of the text component changes.
- *
- * @param event the PropertyChangeEvent describing the change
+ * Returns the attributes, which is null for the RootView.
*/
- public void propertyChange(PropertyChangeEvent event)
+ public AttributeSet getAttributes()
{
- if (event.getPropertyName().equals("document"))
- {
- // Document changed.
- Object oldValue = event.getOldValue();
- if (oldValue != null)
- {
- Document oldDoc = (Document) oldValue;
- oldDoc.removeDocumentListener(documentHandler);
- }
- Object newValue = event.getNewValue();
- if (newValue != null)
- {
- Document newDoc = (Document) newValue;
- newDoc.addDocumentListener(documentHandler);
- }
- modelChanged();
- }
-
- BasicTextUI.this.propertyChange(event);
+ return null;
}
- }
- /**
- * Listens for changes on the underlying model and forwards notifications
- * to the View. This also updates the caret position of the text component.
- *
- * TODO: Maybe this should somehow be handled through EditorKits
- */
- class DocumentHandler implements DocumentListener
- {
/**
- * Notification about a document change event.
- *
- * @param ev the DocumentEvent describing the change
+ * Overridden to forward to the view.
*/
- public void changedUpdate(DocumentEvent ev)
+ public float getPreferredSpan(int axis)
{
- // Updates are forwarded to the View even if 'getVisibleEditorRect'
- // method returns null. This means the View classes have to be
- // aware of that possibility.
- rootView.changedUpdate(ev, getVisibleEditorRect(),
- rootView.getViewFactory());
+ // The RI returns 10 in the degenerate case.
+ float span = 10;
+ if (view != null)
+ span = view.getPreferredSpan(axis);
+ return span;
}
/**
- * Notification about a document insert event.
- *
- * @param ev the DocumentEvent describing the insertion
+ * Overridden to forward to the real view.
*/
- public void insertUpdate(DocumentEvent ev)
+ public float getMinimumSpan(int axis)
{
- // Updates are forwarded to the View even if 'getVisibleEditorRect'
- // method returns null. This means the View classes have to be
- // aware of that possibility.
- rootView.insertUpdate(ev, getVisibleEditorRect(),
- rootView.getViewFactory());
+ // The RI returns 10 in the degenerate case.
+ float span = 10;
+ if (view != null)
+ span = view.getMinimumSpan(axis);
+ return span;
}
/**
- * Notification about a document removal event.
- *
- * @param ev the DocumentEvent describing the removal
+ * Overridden to return Integer.MAX_VALUE.
*/
- public void removeUpdate(DocumentEvent ev)
+ public float getMaximumSpan(int axis)
{
- // Updates are forwarded to the View even if 'getVisibleEditorRect'
- // method returns null. This means the View classes have to be
- // aware of that possibility.
- rootView.removeUpdate(ev, getVisibleEditorRect(),
- rootView.getViewFactory());
+ // The RI returns Integer.MAX_VALUE here, regardless of the real view's
+ // maximum size.
+ return Integer.MAX_VALUE;
}
}
/**
* The EditorKit used by this TextUI.
*/
- // FIXME: should probably be non-static.
- static EditorKit kit = new DefaultEditorKit();
+ private static EditorKit kit;
/**
- * The root view.
+ * The combined event handler for text components.
+ *
+ * This is package private to avoid accessor methods.
*/
- RootView rootView = new RootView();
+ Handler handler;
/**
- * The text component that we handle.
+ * The root view.
+ *
+ * This is package private to avoid accessor methods.
*/
- JTextComponent textComponent;
+ RootView rootView;
/**
- * Receives notification when the model changes.
+ * The text component that we handle.
*/
- private PropertyChangeHandler updateHandler = new PropertyChangeHandler();
-
- /** The DocumentEvent handler. */
- DocumentHandler documentHandler = new DocumentHandler();
+ JTextComponent textComponent;
/**
* Creates a new <code>BasicTextUI</code> instance.
@@ -558,17 +650,31 @@ public abstract class BasicTextUI extends TextUI
public void installUI(final JComponent c)
{
textComponent = (JTextComponent) c;
+
+ if (rootView == null)
+ rootView = new RootView();
+
installDefaults();
- textComponent.addPropertyChangeListener(updateHandler);
+ installFixedDefaults();
+
+ // These listeners must be installed outside of installListeners(),
+ // because overriding installListeners() doesn't prevent installing
+ // these in the RI, but overriding isntallUI() does.
+ if (handler == null)
+ handler = new Handler();
+ textComponent.addPropertyChangeListener(handler);
Document doc = textComponent.getDocument();
if (doc == null)
{
+ // The Handler takes care of installing the necessary listeners
+ // on the document here.
doc = getEditorKit(textComponent).createDefaultDocument();
textComponent.setDocument(doc);
}
else
{
- doc.addDocumentListener(documentHandler);
+ // Must install the document listener.
+ doc.addDocumentListener(handler);
modelChanged();
}
@@ -586,7 +692,6 @@ public abstract class BasicTextUI extends TextUI
LookAndFeel.installColorsAndFont(textComponent, prefix + ".background",
prefix + ".foreground", prefix + ".font");
LookAndFeel.installBorder(textComponent, prefix + ".border");
- textComponent.setMargin(UIManager.getInsets(prefix + ".margin"));
// Some additional text component only properties.
Color color = textComponent.getCaretColor();
@@ -600,7 +705,7 @@ public abstract class BasicTextUI extends TextUI
color = textComponent.getDisabledTextColor();
if (color == null || color instanceof UIResource)
{
- color = UIManager.getColor(prefix + ".inactiveBackground");
+ color = UIManager.getColor(prefix + ".inactiveForeground");
textComponent.setDisabledTextColor(color);
}
color = textComponent.getSelectedTextColor();
@@ -623,6 +728,15 @@ public abstract class BasicTextUI extends TextUI
textComponent.setMargin(margin);
}
+ }
+
+ /**
+ * Installs defaults that can't be overridden by overriding
+ * installDefaults().
+ */
+ private void installFixedDefaults()
+ {
+ String prefix = getPropertyPrefix();
Caret caret = textComponent.getCaret();
if (caret == null || caret instanceof UIResource)
{
@@ -638,64 +752,18 @@ public abstract class BasicTextUI extends TextUI
}
/**
- * This FocusListener triggers repaints on focus shift.
- */
- private FocusListener focuslistener = new FocusListener() {
- public void focusGained(FocusEvent e)
- {
- textComponent.repaint();
- }
- public void focusLost(FocusEvent e)
- {
- textComponent.repaint();
-
- // Integrates Swing text components with the system clipboard:
- // The idea is that if one wants to copy text around X11-style
- // (select text and middle-click in the target component) the focus
- // will move to the new component which gives the old focus owner the
- // possibility to paste its selection into the clipboard.
- if (!e.isTemporary()
- && textComponent.getSelectionStart()
- != textComponent.getSelectionEnd())
- {
- SecurityManager sm = System.getSecurityManager();
- try
- {
- if (sm != null)
- sm.checkSystemClipboardAccess();
-
- Clipboard cb = Toolkit.getDefaultToolkit().getSystemSelection();
- if (cb != null)
- {
- StringSelection selection = new StringSelection(
- textComponent.getSelectedText());
- cb.setContents(selection, selection);
- }
- }
- catch (SecurityException se)
- {
- // Not allowed to access the clipboard: Ignore and
- // do not access it.
- }
- catch (HeadlessException he)
- {
- // There is no AWT: Ignore and do not access the
- // clipboard.
- }
- catch (IllegalStateException ise)
- {
- // Clipboard is currently unavaible.
- }
- }
- }
- };
-
- /**
* Install all listeners on the text component.
*/
protected void installListeners()
{
- textComponent.addFocusListener(focuslistener);
+ //
+ if (SystemProperties.getProperty("gnu.swing.text.no-xlike-clipboard")
+ == null)
+ {
+ if (focusListener == null)
+ focusListener = new FocusHandler();
+ textComponent.addFocusListener(focusListener);
+ }
}
/**
@@ -834,10 +902,12 @@ public abstract class BasicTextUI extends TextUI
*/
public void uninstallUI(final JComponent component)
{
- super.uninstallUI(component);
+ textComponent.removePropertyChangeListener(handler);
+ textComponent.getDocument().removeDocumentListener(handler);
rootView.setView(null);
uninstallDefaults();
+ uninstallFixedDefaults();
uninstallListeners();
uninstallKeyboardActions();
@@ -850,7 +920,29 @@ public abstract class BasicTextUI extends TextUI
*/
protected void uninstallDefaults()
{
- // Do nothing here.
+ if (textComponent.getCaretColor() instanceof UIResource)
+ textComponent.setCaretColor(null);
+ if (textComponent.getSelectionColor() instanceof UIResource)
+ textComponent.setSelectionColor(null);
+ if (textComponent.getDisabledTextColor() instanceof UIResource)
+ textComponent.setDisabledTextColor(null);
+ if (textComponent.getSelectedTextColor() instanceof UIResource)
+ textComponent.setSelectedTextColor(null);
+ LookAndFeel.uninstallBorder(textComponent);
+ if (textComponent.getMargin() instanceof UIResource)
+ textComponent.setMargin(null);
+ }
+
+ /**
+ * Uninstalls additional fixed defaults that were installed
+ * by installFixedDefaults().
+ */
+ private void uninstallFixedDefaults()
+ {
+ if (textComponent.getCaret() instanceof UIResource)
+ textComponent.setCaret(null);
+ if (textComponent.getHighlighter() instanceof UIResource)
+ textComponent.setHighlighter(null);
}
/**
@@ -859,7 +951,10 @@ public abstract class BasicTextUI extends TextUI
*/
protected void uninstallListeners()
{
- textComponent.removeFocusListener(focuslistener);
+ // Don't nullify the focusListener field, as it is static and shared
+ // between components.
+ if (focusListener != null)
+ textComponent.removeFocusListener(focusListener);
}
/**
@@ -891,14 +986,38 @@ public abstract class BasicTextUI extends TextUI
*/
public Dimension getPreferredSize(JComponent c)
{
- View v = getRootView(textComponent);
-
- float w = v.getPreferredSpan(View.X_AXIS);
- float h = v.getPreferredSpan(View.Y_AXIS);
-
+ Dimension d = c.getSize();
Insets i = c.getInsets();
- return new Dimension((int) w + i.left + i.right,
+ // We need to lock here, since we require the view hierarchy to _not_
+ // change in between.
+ float w;
+ float h;
+ Document doc = textComponent.getDocument();
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readLock();
+ try
+ {
+ if (d.width > (i.left + i.right) && d.height > (i.top + i.bottom))
+ {
+ rootView.setSize(d.width - i.left - i.right,
+ d.height - i.top - i.bottom);
+ }
+ else
+ {
+ // Not laid out yet. Force some pseudo size.
+ rootView.setSize(Integer.MAX_VALUE, Integer.MAX_VALUE);
+ }
+ w = rootView.getPreferredSpan(View.X_AXIS);
+ h = rootView.getPreferredSpan(View.Y_AXIS);
+ }
+ finally
+ {
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readUnlock();
+ }
+ Dimension size = new Dimension((int) w + i.left + i.right,
(int) h + i.top + i.bottom);
+ return size;
}
/**
@@ -912,8 +1031,27 @@ public abstract class BasicTextUI extends TextUI
*/
public Dimension getMaximumSize(JComponent c)
{
- // Sun's implementation returns Integer.MAX_VALUE here, so do we.
- return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
+ Dimension d = new Dimension();
+ Insets i = c.getInsets();
+ Document doc = textComponent.getDocument();
+ // We need to lock here, since we require the view hierarchy to _not_
+ // change in between.
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readLock();
+ try
+ {
+ // Check for overflow here.
+ d.width = (int) Math.min((long) rootView.getMaximumSpan(View.X_AXIS)
+ + i.left + i.right, Integer.MAX_VALUE);
+ d.height = (int) Math.min((long) rootView.getMaximumSpan(View.Y_AXIS)
+ + i.top + i.bottom, Integer.MAX_VALUE);
+ }
+ finally
+ {
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readUnlock();
+ }
+ return d;
}
/**
@@ -924,8 +1062,26 @@ public abstract class BasicTextUI extends TextUI
*/
public Dimension getMinimumSize(JComponent c)
{
+ Dimension d = new Dimension();
+ Document doc = textComponent.getDocument();
+ // We need to lock here, since we require the view hierarchy to _not_
+ // change in between.
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readLock();
+ try
+ {
+ d.width = (int) rootView.getMinimumSpan(View.X_AXIS);
+ d.height = (int) rootView.getMinimumSpan(View.Y_AXIS);
+ }
+ finally
+ {
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readUnlock();
+ }
Insets i = c.getInsets();
- return new Dimension(i.left + i.right, i.top + i.bottom);
+ d.width += i.left + i.right;
+ d.height += i.top + i.bottom;
+ return d;
}
/**
@@ -946,7 +1102,6 @@ public abstract class BasicTextUI extends TextUI
AbstractDocument aDoc = (AbstractDocument) doc;
aDoc.readLock();
}
-
paintSafely(g);
}
finally
@@ -996,7 +1151,6 @@ public abstract class BasicTextUI extends TextUI
g.setColor(oldColor);
}
-
rootView.paint(g, getVisibleEditorRect());
if (caret != null && textComponent.hasFocus())
@@ -1104,6 +1258,8 @@ public abstract class BasicTextUI extends TextUI
*/
public EditorKit getEditorKit(JTextComponent t)
{
+ if (kit == null)
+ kit = new DefaultEditorKit();
return kit;
}
@@ -1126,12 +1282,26 @@ public abstract class BasicTextUI extends TextUI
Position.Bias[] biasRet)
throws BadLocationException
{
- // A comment in the spec of NavigationFilter.getNextVisualPositionFrom()
- // suggests that this method should be implemented by forwarding the call
- // the root view.
- return rootView.getNextVisualPositionFrom(pos, b,
- getVisibleEditorRect(),
- direction, biasRet);
+ int offset = -1;
+ Document doc = textComponent.getDocument();
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readLock();
+ try
+ {
+ Rectangle alloc = getVisibleEditorRect();
+ if (alloc != null)
+ {
+ rootView.setSize(alloc.width, alloc.height);
+ offset = rootView.getNextVisualPositionFrom(pos, b, alloc,
+ direction, biasRet);
+ }
+ }
+ finally
+ {
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readUnlock();
+ }
+ return offset;
}
/**
@@ -1224,7 +1394,7 @@ public abstract class BasicTextUI extends TextUI
*/
public int viewToModel(JTextComponent t, Point pt)
{
- return viewToModel(t, pt, null);
+ return viewToModel(t, pt, new Position.Bias[1]);
}
/**
@@ -1241,7 +1411,25 @@ public abstract class BasicTextUI extends TextUI
*/
public int viewToModel(JTextComponent t, Point pt, Position.Bias[] biasReturn)
{
- return rootView.viewToModel(pt.x, pt.y, getVisibleEditorRect(), biasReturn);
+ int offset = -1;
+ Document doc = textComponent.getDocument();
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readLock();
+ try
+ {
+ Rectangle alloc = getVisibleEditorRect();
+ if (alloc != null)
+ {
+ rootView.setSize(alloc.width, alloc.height);
+ offset = rootView.viewToModel(pt.x, pt.y, alloc, biasReturn);
+ }
+ }
+ finally
+ {
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readUnlock();
+ }
+ return offset;
}
/**
@@ -1273,6 +1461,11 @@ public abstract class BasicTextUI extends TextUI
}
/**
+ * A cached Insets instance to be reused below.
+ */
+ private Insets cachedInsets;
+
+ /**
* Returns the allocation to give the root view.
*
* @return the allocation to give the root view
@@ -1290,7 +1483,7 @@ public abstract class BasicTextUI extends TextUI
if (width <= 0 || height <= 0)
return null;
- Insets insets = textComponent.getInsets();
+ Insets insets = textComponent.getInsets(cachedInsets);
return new Rectangle(insets.left, insets.top,
width - insets.left - insets.right,
height - insets.top - insets.bottom);
@@ -1341,4 +1534,5 @@ public abstract class BasicTextUI extends TextUI
{
// The default implementation does nothing.
}
+
}
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java
index 1c36b408d5a..7be69ec2576 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java
@@ -898,7 +898,8 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
b.setRolloverEnabled(false);
// Save old border in hashtable.
- borders.put(b, b.getBorder());
+ if (b.getBorder() != null)
+ borders.put(b, b.getBorder());
b.setBorder(nonRolloverBorder);
}
@@ -932,7 +933,8 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
b.setRolloverEnabled(false);
// Save old border in hashtable.
- borders.put(b, b.getBorder());
+ if (b.getBorder() != null)
+ borders.put(b, b.getBorder());
b.setBorder(rolloverBorder);
}
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicToolTipUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicToolTipUI.java
index 5cec2e33365..94e7bc322f6 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicToolTipUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicToolTipUI.java
@@ -40,19 +40,20 @@ package javax.swing.plaf.basic;
import java.awt.Color;
import java.awt.Dimension;
+import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle;
-import java.awt.Toolkit;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import javax.swing.JComponent;
import javax.swing.JToolTip;
import javax.swing.LookAndFeel;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.ToolTipUI;
+import javax.swing.text.View;
/**
* This is the Basic Look and Feel UI class for JToolTip.
@@ -60,6 +61,28 @@ import javax.swing.plaf.ToolTipUI;
public class BasicToolTipUI extends ToolTipUI
{
+ /**
+ * Receives notification when a property of the JToolTip changes.
+ * This updates the HTML renderer if appropriate.
+ */
+ private class PropertyChangeHandler
+ implements PropertyChangeListener
+ {
+
+ public void propertyChange(PropertyChangeEvent e)
+ {
+ String prop = e.getPropertyName();
+ if (prop.equals("tiptext") || prop.equals("font")
+ || prop.equals("foreground"))
+ {
+ JToolTip tip = (JToolTip) e.getSource();
+ String text = tip.getTipText();
+ BasicHTML.updateRenderer(tip, text);
+ }
+ }
+
+ }
+
/** The shared instance of BasicToolTipUI used for all ToolTips. */
private static BasicToolTipUI shared;
@@ -67,6 +90,11 @@ public class BasicToolTipUI extends ToolTipUI
private String text;
/**
+ * Handles property changes.
+ */
+ private PropertyChangeListener propertyChangeHandler;
+
+ /**
* Creates a new BasicToolTipUI object.
*/
public BasicToolTipUI()
@@ -98,7 +126,12 @@ public class BasicToolTipUI extends ToolTipUI
*/
public Dimension getMaximumSize(JComponent c)
{
- return getPreferredSize(c);
+ Dimension d = getPreferredSize(c);
+ View view = (View) c.getClientProperty(BasicHTML.propertyKey);
+ if (view != null)
+ d.width += view.getMaximumSpan(View.X_AXIS)
+ - view.getPreferredSpan(View.X_AXIS);
+ return d;
}
/**
@@ -110,7 +143,12 @@ public class BasicToolTipUI extends ToolTipUI
*/
public Dimension getMinimumSize(JComponent c)
{
- return getPreferredSize(c);
+ Dimension d = getPreferredSize(c);
+ View view = (View) c.getClientProperty(BasicHTML.propertyKey);
+ if (view != null)
+ d.width -= view.getPreferredSpan(View.X_AXIS)
+ - view.getMinimumSpan(View.X_AXIS);
+ return d;
}
/**
@@ -123,22 +161,25 @@ public class BasicToolTipUI extends ToolTipUI
public Dimension getPreferredSize(JComponent c)
{
JToolTip tip = (JToolTip) c;
- FontMetrics fm;
- Toolkit g = tip.getToolkit();
- text = tip.getTipText();
-
- Rectangle vr = new Rectangle();
- Rectangle ir = new Rectangle();
- Rectangle tr = new Rectangle();
- Insets insets = tip.getInsets();
- fm = g.getFontMetrics(tip.getFont());
- SwingUtilities.layoutCompoundLabel(tip, fm, text, null,
- SwingConstants.CENTER,
- SwingConstants.CENTER,
- SwingConstants.CENTER,
- SwingConstants.CENTER, vr, ir, tr, 0);
- return new Dimension(insets.left + tr.width + insets.right,
- insets.top + tr.height + insets.bottom);
+ String str = tip.getTipText();
+ FontMetrics fm = c.getFontMetrics(c.getFont());
+ Insets i = c.getInsets();
+ Dimension d = new Dimension(i.left + i.right, i.top + i.bottom);
+ if (str != null && ! str.equals(""))
+ {
+ View view = (View) c.getClientProperty(BasicHTML.propertyKey);
+ if (view != null)
+ {
+ d.width += (int) view.getPreferredSpan(View.X_AXIS);
+ d.height += (int) view.getPreferredSpan(View.Y_AXIS);
+ }
+ else
+ {
+ d.width += fm.stringWidth(str) + 6;
+ d.height += fm.getHeight();
+ }
+ }
+ return d;
}
/**
@@ -160,7 +201,8 @@ public class BasicToolTipUI extends ToolTipUI
*/
protected void installListeners(JComponent c)
{
- // TODO: Implement this properly.
+ propertyChangeHandler = new PropertyChangeHandler();
+ c.addPropertyChangeListener(propertyChangeHandler);
}
/**
@@ -172,6 +214,7 @@ public class BasicToolTipUI extends ToolTipUI
{
c.setOpaque(true);
installDefaults(c);
+ BasicHTML.updateRenderer(c, ((JToolTip) c).getTipText());
installListeners(c);
}
@@ -186,26 +229,25 @@ public class BasicToolTipUI extends ToolTipUI
JToolTip tip = (JToolTip) c;
String text = tip.getTipText();
- Toolkit t = tip.getToolkit();
- if (text == null)
- return;
-
- Rectangle vr = new Rectangle();
- vr = SwingUtilities.calculateInnerArea(tip, vr);
- Rectangle ir = new Rectangle();
- Rectangle tr = new Rectangle();
- FontMetrics fm = t.getFontMetrics(tip.getFont());
+ Font font = c.getFont();
+ FontMetrics fm = c.getFontMetrics(font);
int ascent = fm.getAscent();
- SwingUtilities.layoutCompoundLabel(tip, fm, text, null,
- SwingConstants.CENTER,
- SwingConstants.CENTER,
- SwingConstants.CENTER,
- SwingConstants.CENTER, vr, ir, tr, 0);
+ Insets i = c.getInsets();
+ Dimension size = c.getSize();
+ Rectangle paintR = new Rectangle(i.left, i.top,
+ size.width - i.left - i.right,
+ size.height - i.top - i.bottom);
Color saved = g.getColor();
+ Font oldFont = g.getFont();
g.setColor(Color.BLACK);
- g.drawString(text, vr.x, vr.y + ascent);
+ View view = (View) c.getClientProperty(BasicHTML.propertyKey);
+ if (view != null)
+ view.paint(g, paintR);
+ else
+ g.drawString(text, paintR.x + 3, paintR.y + ascent);
+ g.setFont(oldFont);
g.setColor(saved);
}
@@ -229,7 +271,11 @@ public class BasicToolTipUI extends ToolTipUI
*/
protected void uninstallListeners(JComponent c)
{
- // TODO: Implement this properly.
+ if (propertyChangeHandler != null)
+ {
+ c.removePropertyChangeListener(propertyChangeHandler);
+ propertyChangeHandler = null;
+ }
}
/**
@@ -240,6 +286,7 @@ public class BasicToolTipUI extends ToolTipUI
public void uninstallUI(JComponent c)
{
uninstallDefaults(c);
+ BasicHTML.updateRenderer(c, "");
uninstallListeners(c);
}
}
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicTreeUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicTreeUI.java
index 9a193986ac5..5b0ffce09b6 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicTreeUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicTreeUI.java
@@ -38,17 +38,16 @@
package javax.swing.plaf.basic;
-import gnu.classpath.NotImplementedException;
import gnu.javax.swing.tree.GnuPath;
import java.awt.Color;
import java.awt.Component;
+import java.awt.Container;
import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Label;
+import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -196,7 +195,7 @@ public class BasicTreeUI
protected AbstractLayoutCache treeState;
/** Used for minimizing the drawing of vertical lines. */
- protected Hashtable drawingCache;
+ protected Hashtable<TreePath, Boolean> drawingCache;
/**
* True if doing optimizations for a largeModel. Subclasses that don't support
@@ -275,13 +274,6 @@ public class BasicTreeUI
TreeModelListener treeModelListener;
/**
- * This timer fires the editing action after about 1200 ms if not reset during
- * that time. It handles the editing start with the single mouse click (and
- * not the double mouse click) on the selected tree node.
- */
- Timer startEditTimer;
-
- /**
* The zero size icon, used for expand controls, if they are not visible.
*/
static Icon nullIcon;
@@ -428,6 +420,7 @@ public class BasicTreeUI
{
if (largeModel != this.largeModel)
{
+ completeEditing();
tree.removeComponentListener(componentListener);
this.largeModel = largeModel;
tree.addComponentListener(componentListener);
@@ -451,6 +444,7 @@ public class BasicTreeUI
*/
protected void setRowHeight(int rowHeight)
{
+ completeEditing();
if (rowHeight == 0)
rowHeight = getMaxHeight(tree);
treeState.setRowHeight(rowHeight);
@@ -544,6 +538,7 @@ public class BasicTreeUI
*/
protected void setRootVisible(boolean newValue)
{
+ completeEditing();
tree.setRootVisible(newValue);
}
@@ -590,8 +585,7 @@ public class BasicTreeUI
*/
protected void setCellEditor(TreeCellEditor editor)
{
- cellEditor = editor;
- createdCellEditor = true;
+ updateCellEditor();
}
/**
@@ -611,7 +605,7 @@ public class BasicTreeUI
*/
protected void setEditable(boolean newValue)
{
- tree.setEditable(newValue);
+ updateCellEditor();
}
/**
@@ -632,6 +626,7 @@ public class BasicTreeUI
*/
protected void setSelectionModel(TreeSelectionModel newLSM)
{
+ completeEditing();
if (newLSM != null)
{
treeSelectionModel = newLSM;
@@ -787,12 +782,13 @@ public class BasicTreeUI
*/
public boolean stopEditing(JTree tree)
{
- if (isEditing(tree))
+ boolean ret = false;
+ if (editingComponent != null && cellEditor.stopCellEditing())
{
completeEditing(false, false, true);
- finish();
+ ret = true;
}
- return ! isEditing(tree);
+ return ret;
}
/**
@@ -805,8 +801,8 @@ public class BasicTreeUI
// There is no need to send the cancel message to the editor,
// as the cancellation event itself arrives from it. This would
// only be necessary when cancelling the editing programatically.
- completeEditing(false, false, false);
- finish();
+ if (editingComponent != null)
+ completeEditing(false, true, false);
}
/**
@@ -818,7 +814,9 @@ public class BasicTreeUI
*/
public void startEditingAtPath(JTree tree, TreePath path)
{
- startEditing(path, null);
+ tree.scrollPathToVisible(path);
+ if (path != null && tree.isVisible(path))
+ startEditing(path, null);
}
/**
@@ -842,6 +840,7 @@ public class BasicTreeUI
preferredSize = new Dimension();
largeModel = tree.isLargeModel();
preferredSize = new Dimension();
+ stopEditingInCompleteEditing = true;
setModel(tree.getModel());
}
@@ -1136,6 +1135,7 @@ public class BasicTreeUI
*/
protected void updateExpandedDescendants(TreePath path)
{
+ completeEditing();
Enumeration expanded = tree.getExpandedDescendants(path);
while (expanded.hasMoreElements())
treeState.setExpandedState((TreePath) expanded.nextElement(), true);
@@ -1167,9 +1167,33 @@ public class BasicTreeUI
*/
protected void updateCellEditor()
{
- if (tree.isEditable() && cellEditor == null)
- setCellEditor(createDefaultCellEditor());
- createdCellEditor = true;
+ completeEditing();
+ TreeCellEditor newEd = null;
+ if (tree != null && tree.isEditable())
+ {
+ newEd = tree.getCellEditor();
+ if (newEd == null)
+ {
+ newEd = createDefaultCellEditor();
+ if (newEd != null)
+ {
+ tree.setCellEditor(newEd);
+ createdCellEditor = true;
+ }
+ }
+ }
+ // Update listeners.
+ if (newEd != cellEditor)
+ {
+ if (cellEditor != null && cellEditorListener != null)
+ cellEditor.removeCellEditorListener(cellEditorListener);
+ cellEditor = newEd;
+ if (cellEditorListener == null)
+ cellEditorListener = createCellEditorListener();
+ if (cellEditor != null && cellEditorListener != null)
+ cellEditor.addCellEditorListener(cellEditorListener);
+ createdCellEditor = false;
+ }
}
/**
@@ -1563,12 +1587,15 @@ public class BasicTreeUI
for (int i = startIndex; i <= endIndex; i++, k++)
{
path[k] = treeState.getPathForRow(i);
- isLeaf[k] = treeModel.isLeaf(path[k].getLastPathComponent());
- isExpanded[k] = tree.isExpanded(path[k]);
- bounds[k] = getPathBounds(tree, path[k]);
-
- paintHorizontalPartOfLeg(g, clip, insets, bounds[k], path[k], i,
- isExpanded[k], false, isLeaf[k]);
+ if (path[k] != null)
+ {
+ isLeaf[k] = treeModel.isLeaf(path[k].getLastPathComponent());
+ isExpanded[k] = tree.isExpanded(path[k]);
+ bounds[k] = getPathBounds(tree, path[k]);
+
+ paintHorizontalPartOfLeg(g, clip, insets, bounds[k], path[k],
+ i, isExpanded[k], false, isLeaf[k]);
+ }
if (isLastChild(path[k]))
paintVerticalPartOfLeg(g, clip, insets, path[k]);
}
@@ -1576,8 +1603,9 @@ public class BasicTreeUI
k = 0;
for (int i = startIndex; i <= endIndex; i++, k++)
{
- paintRow(g, clip, insets, bounds[k], path[k], i, isExpanded[k],
- false, isLeaf[k]);
+ if (path[k] != null)
+ paintRow(g, clip, insets, bounds[k], path[k], i, isExpanded[k],
+ false, isLeaf[k]);
}
}
}
@@ -1587,7 +1615,9 @@ public class BasicTreeUI
*/
private boolean isLastChild(TreePath path)
{
- if (path instanceof GnuPath)
+ if (path == null)
+ return false;
+ else if (path instanceof GnuPath)
{
// Except the seldom case when the layout cache is changed, this
// optimized code will be executed.
@@ -1719,6 +1749,10 @@ public class BasicTreeUI
*/
protected void completeEditing()
{
+ if (tree.getInvokesStopCellEditing() && stopEditingInCompleteEditing
+ && editingComponent != null)
+ cellEditor.stopCellEditing();
+
completeEditing(false, true, false);
}
@@ -1736,28 +1770,35 @@ public class BasicTreeUI
boolean messageTree)
{
// Make no attempt to complete the non existing editing session.
- if (!isEditing(tree))
- return;
-
- if (messageStop)
+ if (stopEditingInCompleteEditing && editingComponent != null)
{
- getCellEditor().stopCellEditing();
- stopEditingInCompleteEditing = true;
- }
-
- if (messageCancel)
- {
- getCellEditor().cancelCellEditing();
- stopEditingInCompleteEditing = true;
- }
+ Component comp = editingComponent;
+ TreePath p = editingPath;
+ editingComponent = null;
+ editingPath = null;
+ if (messageStop)
+ cellEditor.stopCellEditing();
+ else if (messageCancel)
+ cellEditor.cancelCellEditing();
+
+ tree.remove(comp);
+
+ if (editorHasDifferentSize)
+ {
+ treeState.invalidatePathBounds(p);
+ updateSize();
+ }
+ else
+ {
+ // Need to refresh the tree.
+ Rectangle b = getPathBounds(tree, p);
+ tree.repaint(0, b.y, tree.getWidth(), b.height);
+ }
- if (messageTree)
- {
- TreeCellEditor editor = getCellEditor();
- if (editor != null)
+ if (messageTree)
{
- Object value = editor.getCellEditorValue();
- treeModel.valueForPathChanged(tree.getLeadSelectionPath(), value);
+ Object value = cellEditor.getCellEditorValue();
+ treeModel.valueForPathChanged(p, value);
}
}
}
@@ -1772,47 +1813,105 @@ public class BasicTreeUI
*/
protected boolean startEditing(TreePath path, MouseEvent event)
{
- updateCellEditor();
- TreeCellEditor ed = getCellEditor();
+ // Maybe cancel editing.
+ if (isEditing(tree) && tree.getInvokesStopCellEditing()
+ && ! stopEditing(tree))
+ return false;
- if (ed != null && (event == EDIT || ed.shouldSelectCell(event))
- && ed.isCellEditable(event))
+ completeEditing();
+ TreeCellEditor ed = cellEditor;
+ if (ed != null && tree.isPathEditable(path))
{
- Rectangle bounds = getPathBounds(tree, path);
-
- // Extend the right boundary till the tree width.
- bounds.width = tree.getWidth() - bounds.x;
-
- editingPath = path;
- editingRow = tree.getRowForPath(editingPath);
-
- Object value = editingPath.getLastPathComponent();
-
- stopEditingInCompleteEditing = false;
- boolean expanded = tree.isExpanded(editingPath);
- isEditing = true;
- editingComponent = ed.getTreeCellEditorComponent(tree, value, true,
- expanded,
- isLeaf(editingRow),
- editingRow);
-
- // Remove all previous components (if still present). Only one
- // container with the editing component inside is allowed in the tree.
- tree.removeAll();
-
- // The editing component must be added to its container. We add the
- // container, not the editing component itself.
- Component container = editingComponent.getParent();
- container.setBounds(bounds);
- tree.add(container);
- editingComponent.requestFocus();
+ if (ed.isCellEditable(event))
+ {
+ editingRow = getRowForPath(tree, path);
+ Object value = path.getLastPathComponent();
+ boolean isSelected = tree.isPathSelected(path);
+ boolean isExpanded = tree.isExpanded(editingPath);
+ boolean isLeaf = treeModel.isLeaf(value);
+ editingComponent = ed.getTreeCellEditorComponent(tree, value,
+ isSelected,
+ isExpanded,
+ isLeaf,
+ editingRow);
+
+ Rectangle bounds = getPathBounds(tree, path);
+
+ Dimension size = editingComponent.getPreferredSize();
+ int rowHeight = getRowHeight();
+ if (size.height != bounds.height && rowHeight > 0)
+ size.height = rowHeight;
+
+ if (size.width != bounds.width || size.height != bounds.height)
+ {
+ editorHasDifferentSize = true;
+ treeState.invalidatePathBounds(path);
+ updateSize();
+ }
+ else
+ editorHasDifferentSize = false;
+
+ // The editing component must be added to its container. We add the
+ // container, not the editing component itself.
+ tree.add(editingComponent);
+ editingComponent.setBounds(bounds.x, bounds.y, size.width,
+ size.height);
+ editingComponent.validate();
+ editingPath = path;
+
+ if (ed.shouldSelectCell(event))
+ {
+ stopEditingInCompleteEditing = false;
+ tree.setSelectionRow(editingRow);
+ stopEditingInCompleteEditing = true;
+ }
+
+ editorRequestFocus(editingComponent);
+ // Register MouseInputHandler to redispatch initial mouse events
+ // correctly.
+ if (event instanceof MouseEvent)
+ {
+ Point p = SwingUtilities.convertPoint(tree, event.getX(), event.getY(),
+ editingComponent);
+ Component active =
+ SwingUtilities.getDeepestComponentAt(editingComponent, p.x, p.y);
+ if (active != null)
+ {
+ MouseInputHandler ih = new MouseInputHandler(tree, active, event);
+
+ }
+ }
- return true;
+ return true;
+ }
+ else
+ editingComponent = null;
}
return false;
}
/**
+ * Requests focus on the editor. The method is necessary since the
+ * DefaultTreeCellEditor returns a container that contains the
+ * actual editor, and we want to request focus on the editor, not the
+ * container.
+ */
+ private void editorRequestFocus(Component c)
+ {
+ if (c instanceof Container)
+ {
+ // TODO: Maybe do something more reasonable here, like queriying the
+ // FocusTraversalPolicy.
+ Container cont = (Container) c;
+ if (cont.getComponentCount() > 0)
+ cont.getComponent(0).requestFocus();
+ }
+ else if (c.isFocusable())
+ c.requestFocus();
+
+ }
+
+ /**
* If the <code>mouseX</code> and <code>mouseY</code> are in the expand or
* collapse region of the row, this will toggle the row.
*
@@ -2180,7 +2279,7 @@ public class BasicTreeUI
*/
public void editingStopped(ChangeEvent e)
{
- stopEditing(tree);
+ completeEditing(false, false, true);
}
/**
@@ -2191,7 +2290,7 @@ public class BasicTreeUI
*/
public void editingCanceled(ChangeEvent e)
{
- cancelEditing(tree);
+ completeEditing(false, false, false);
}
} // CellEditorHandler
@@ -2347,9 +2446,15 @@ public class BasicTreeUI
* events.
*/
public class MouseHandler
- extends MouseAdapter
- implements MouseMotionListener
+ extends MouseAdapter
+ implements MouseMotionListener
{
+
+ /**
+ * If the cell has been selected on mouse press.
+ */
+ private boolean selectedOnPress;
+
/**
* Constructor
*/
@@ -2365,76 +2470,15 @@ public class BasicTreeUI
*/
public void mousePressed(MouseEvent e)
{
- // Any mouse click cancels the previous waiting edit action, initiated
- // by the single click on the selected node.
- if (startEditTimer != null)
+ if (! e.isConsumed())
{
- startEditTimer.stop();
- startEditTimer = null;
+ handleEvent(e);
+ selectedOnPress = true;
}
-
- if (tree != null && tree.isEnabled())
+ else
{
- // Always end the current editing session if clicked on the
- // tree and outside the bounds of the editing component.
- if (isEditing(tree))
- if (!stopEditing(tree))
- // Return if we have failed to cancel the editing session.
- return;
-
- int x = e.getX();
- int y = e.getY();
- TreePath path = getClosestPathForLocation(tree, x, y);
-
- if (path != null)
- {
- Rectangle bounds = getPathBounds(tree, path);
- if (SwingUtilities.isLeftMouseButton(e))
- checkForClickInExpandControl(path, x, y);
-
- if (x > bounds.x && x <= (bounds.x + bounds.width))
- {
- TreePath currentLead = tree.getLeadSelectionPath();
- if (currentLead != null && currentLead.equals(path)
- && e.getClickCount() == 1 && tree.isEditable())
- {
- // Schedule the editing session.
- final TreePath editPath = path;
-
- // The code below handles the required click-pause-click
- // functionality which must be present in the tree UI.
- // If the next click comes after the
- // time longer than the double click interval AND
- // the same node stays focused for the WAIT_TILL_EDITING
- // duration, the timer starts the editing session.
- if (startEditTimer != null)
- startEditTimer.stop();
-
- startEditTimer = new Timer(WAIT_TILL_EDITING,
- new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- startEditing(editPath, EDIT);
- }
- });
-
- startEditTimer.setRepeats(false);
- startEditTimer.start();
- }
- else
- {
- if (e.getClickCount() == 2)
- toggleExpandState(path);
- else
- selectPathForEvent(path, e);
- }
- }
- }
+ selectedOnPress = false;
}
-
- // We need to request the focus.
- tree.requestFocusInWindow();
}
/**
@@ -2446,9 +2490,8 @@ public class BasicTreeUI
* @param e is the mouse event that occured
*/
public void mouseDragged(MouseEvent e)
- throws NotImplementedException
{
- // TODO: What should be done here, if anything?
+ // Nothing to do here.
}
/**
@@ -2458,9 +2501,8 @@ public class BasicTreeUI
* @param e the mouse event that occured
*/
public void mouseMoved(MouseEvent e)
- throws NotImplementedException
{
- // TODO: What should be done here, if anything?
+ // Nothing to do here.
}
/**
@@ -2469,9 +2511,46 @@ public class BasicTreeUI
* @param e is the mouse event that occured
*/
public void mouseReleased(MouseEvent e)
- throws NotImplementedException
{
- // TODO: What should be done here, if anything?
+ if (! e.isConsumed() && ! selectedOnPress)
+ handleEvent(e);
+ }
+
+ /**
+ * Handles press and release events.
+ *
+ * @param e the mouse event
+ */
+ private void handleEvent(MouseEvent e)
+ {
+ if (tree != null && tree.isEnabled())
+ {
+ // Maybe stop editing.
+ if (isEditing(tree) && tree.getInvokesStopCellEditing()
+ && ! stopEditing(tree))
+ return;
+
+ // Explicitly request focus.
+ tree.requestFocusInWindow();
+
+ int x = e.getX();
+ int y = e.getY();
+ TreePath path = getClosestPathForLocation(tree, x, y);
+ if (path != null)
+ {
+ Rectangle b = getPathBounds(tree, path);
+ if (y <= b.y + b.height)
+ {
+ if (SwingUtilities.isLeftMouseButton(e))
+ checkForClickInExpandControl(path, x, y);
+ if (x > b.x && x <= b.x + b.width)
+ {
+ if (! startEditing(path, e))
+ selectPathForEvent(path, e);
+ }
+ }
+ }
+ }
}
}
@@ -2501,6 +2580,9 @@ public class BasicTreeUI
{
this.source = source;
this.destination = destination;
+ source.addMouseListener(this);
+ source.addMouseMotionListener(this);
+ dispatch(e);
}
/**
@@ -2510,9 +2592,8 @@ public class BasicTreeUI
* @param e mouse event that occured
*/
public void mouseClicked(MouseEvent e)
- throws NotImplementedException
{
- // TODO: What should be done here, if anything?
+ dispatch(e);
}
/**
@@ -2521,9 +2602,8 @@ public class BasicTreeUI
* @param e mouse event that occured
*/
public void mousePressed(MouseEvent e)
- throws NotImplementedException
{
- // TODO: What should be done here, if anything?
+ // Nothing to do here.
}
/**
@@ -2532,9 +2612,9 @@ public class BasicTreeUI
* @param e mouse event that occured
*/
public void mouseReleased(MouseEvent e)
- throws NotImplementedException
{
- // TODO: What should be done here, if anything?
+ dispatch(e);
+ removeFromSource();
}
/**
@@ -2543,9 +2623,9 @@ public class BasicTreeUI
* @param e mouse event that occured
*/
public void mouseEntered(MouseEvent e)
- throws NotImplementedException
{
- // TODO: What should be done here, if anything?
+ if (! SwingUtilities.isLeftMouseButton(e))
+ removeFromSource();
}
/**
@@ -2554,9 +2634,9 @@ public class BasicTreeUI
* @param e mouse event that occured
*/
public void mouseExited(MouseEvent e)
- throws NotImplementedException
{
- // TODO: What should be done here, if anything?
+ if (! SwingUtilities.isLeftMouseButton(e))
+ removeFromSource();
}
/**
@@ -2568,9 +2648,8 @@ public class BasicTreeUI
* @param e mouse event that occured
*/
public void mouseDragged(MouseEvent e)
- throws NotImplementedException
{
- // TODO: What should be done here, if anything?
+ dispatch(e);
}
/**
@@ -2580,18 +2659,37 @@ public class BasicTreeUI
* @param e mouse event that occured
*/
public void mouseMoved(MouseEvent e)
- throws NotImplementedException
{
- // TODO: What should be done here, if anything?
+ removeFromSource();
}
/**
* Removes event from the source
*/
protected void removeFromSource()
- throws NotImplementedException
{
- // TODO: Implement this properly.
+ if (source != null)
+ {
+ source.removeMouseListener(this);
+ source.removeMouseMotionListener(this);
+ }
+ source = null;
+ destination = null;
+ }
+
+ /**
+ * Redispatches mouse events to the destination.
+ *
+ * @param e the mouse event to redispatch
+ */
+ private void dispatch(MouseEvent e)
+ {
+ if (destination != null)
+ {
+ MouseEvent e2 = SwingUtilities.convertMouseEvent(source, e,
+ destination);
+ destination.dispatchEvent(e2);
+ }
}
}
@@ -2627,24 +2725,42 @@ public class BasicTreeUI
public Rectangle getNodeDimensions(Object cell, int row, int depth,
boolean expanded, Rectangle size)
{
- if (size == null || cell == null)
- return null;
-
- String s = cell.toString();
- Font f = tree.getFont();
- FontMetrics fm = tree.getToolkit().getFontMetrics(f);
-
- if (s != null)
+ Dimension prefSize;
+ if (editingComponent != null && editingRow == row)
+ {
+ // Editing, ask editor for preferred size.
+ prefSize = editingComponent.getPreferredSize();
+ int rowHeight = getRowHeight();
+ if (rowHeight > 0 && rowHeight != prefSize.height)
+ prefSize.height = rowHeight;
+ }
+ else
+ {
+ // Not editing, ask renderer for preferred size.
+ Component rend =
+ currentCellRenderer.getTreeCellRendererComponent(tree, cell,
+ tree.isRowSelected(row),
+ expanded,
+ treeModel.isLeaf(cell),
+ row, false);
+ // Make sure the layout is valid.
+ rendererPane.add(rend);
+ rend.validate();
+ prefSize = rend.getPreferredSize();
+ }
+ if (size != null)
{
- TreePath path = treeState.getPathForRow(row);
size.x = getRowX(row, depth);
- size.width = SwingUtilities.computeStringWidth(fm, s);
- size.width = size.width + getCurrentControlIcon(path).getIconWidth()
- + gap + getNodeIcon(path).getIconWidth();
- size.height = getMaxHeight(tree);
- size.y = size.height * row;
+ // FIXME: This should be handled by the layout cache.
+ size.y = prefSize.height * row;
+ size.width = prefSize.width;
+ size.height = prefSize.height;
}
-
+ else
+ // FIXME: The y should be handled by the layout cache.
+ size = new Rectangle(getRowX(row, depth), prefSize.height * row, prefSize.width,
+ prefSize.height);
+
return size;
}
@@ -2706,6 +2822,9 @@ public class BasicTreeUI
if (treeState != null)
treeState.invalidateSizes();
}
+ else if (property.equals(JTree.EDITABLE_PROPERTY))
+ setEditable(((Boolean) event.getNewValue()).booleanValue());
+
}
}
@@ -2714,7 +2833,7 @@ public class BasicTreeUI
* properties of the model change.
*/
public class SelectionModelPropertyChangeHandler
- implements PropertyChangeListener
+ implements PropertyChangeListener
{
/**
@@ -2732,9 +2851,8 @@ public class BasicTreeUI
* the property that has changed.
*/
public void propertyChange(PropertyChangeEvent event)
- throws NotImplementedException
{
- // TODO: What should be done here, if anything?
+ treeSelectionModel.resetRowSelection();
}
}
@@ -2804,6 +2922,7 @@ public class BasicTreeUI
*/
public void treeCollapsed(TreeExpansionEvent event)
{
+ completeEditing();
validCachedPreferredSize = false;
treeState.setExpandedState(event.getPath(), false);
// The maximal cell height may change
@@ -3269,8 +3388,7 @@ public class BasicTreeUI
*/
public void valueChanged(TreeSelectionEvent event)
{
- if (tree.isEditing())
- tree.cancelEditing();
+ completeEditing();
TreePath op = event.getOldLeadSelectionPath();
TreePath np = event.getNewLeadSelectionPath();
@@ -3808,25 +3926,6 @@ public class BasicTreeUI
}
/**
- * Finish the editing session.
- */
- void finish()
- {
- treeState.invalidatePathBounds(treeState.getPathForRow(editingRow));
- editingPath = null;
- editingRow = - 1;
- stopEditingInCompleteEditing = false;
- isEditing = false;
- Rectangle bounds = editingComponent.getParent().getBounds();
- tree.removeAll();
- validCachedPreferredSize = false;
- // Repaint the region, where was the editing component.
- tree.repaint(bounds);
- editingComponent = null;
- tree.requestFocus();
- }
-
- /**
* Returns the amount to indent the given row
*
* @return amount to indent the given row.
diff --git a/libjava/classpath/javax/swing/plaf/metal/DefaultMetalTheme.java b/libjava/classpath/javax/swing/plaf/metal/DefaultMetalTheme.java
index 673aec1e418..672676fa081 100644
--- a/libjava/classpath/javax/swing/plaf/metal/DefaultMetalTheme.java
+++ b/libjava/classpath/javax/swing/plaf/metal/DefaultMetalTheme.java
@@ -38,8 +38,11 @@ exception statement from your version. */
package javax.swing.plaf.metal;
+import gnu.classpath.SystemProperties;
+
import java.awt.Font;
+import javax.swing.UIManager;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.FontUIResource;
@@ -63,10 +66,6 @@ public class DefaultMetalTheme extends MetalTheme
private static final ColorUIResource SECONDARY3 =
new ColorUIResource(204, 204, 204);
- private static final FontUIResource CONTROL_TEXT_FONT =
- new FontUIResource("Dialog", Font.BOLD, 12);
- private static final FontUIResource MENU_TEXT_FONT =
- new FontUIResource("Dialog", Font.BOLD, 12);
private static final FontUIResource SUB_TEXT_FONT =
new FontUIResource("Dialog", Font.PLAIN, 10);
private static final FontUIResource SYSTEM_TEXT_FONT =
@@ -77,6 +76,40 @@ public class DefaultMetalTheme extends MetalTheme
new FontUIResource("Dialog", Font.BOLD, 12);
/**
+ * The control text font for swing.boldMetal=false.
+ */
+ private static final FontUIResource PLAIN_CONTROL_TEXT_FONT =
+ new FontUIResource("Dialog", Font.PLAIN, 12);
+
+ /**
+ * The standard control text font.
+ */
+ private static final FontUIResource BOLD_CONTROL_TEXT_FONT =
+ new FontUIResource("Dialog", Font.BOLD, 12);
+
+ /**
+ * The menu text font for swing.boldMetal=false.
+ */
+ private static final FontUIResource PLAIN_MENU_TEXT_FONT =
+ new FontUIResource("Dialog", Font.PLAIN, 12);
+
+ /**
+ * The menu control text font.
+ */
+ private static final FontUIResource BOLD_MENU_TEXT_FONT =
+ new FontUIResource("Dialog", Font.BOLD, 12);
+
+ /**
+ * Indicates the control text font.
+ */
+ static final int CONTROL_TEXT_FONT = 1;
+
+ /**
+ * Indicates the menu text font.
+ */
+ static final int MENU_TEXT_FONT = 2;
+
+ /**
* Creates a new instance of this theme.
*/
public DefaultMetalTheme()
@@ -156,23 +189,28 @@ public class DefaultMetalTheme extends MetalTheme
/**
* Returns the font used for text on controls. In this case, the font is
- * <code>FontUIResource("Dialog", Font.BOLD, 12)</code>.
+ * <code>FontUIResource("Dialog", Font.BOLD, 12)</code>, unless the
+ * <code>swing.boldMetal</code> UI default is set to {@link Boolean#FALSE}
+ * in which case it is <code>FontUIResource("Dialog", Font.PLAIN, 12)</code>.
*
* @return The font.
*/
public FontUIResource getControlTextFont()
{
- return CONTROL_TEXT_FONT;
+ return getFont(CONTROL_TEXT_FONT);
}
+
/**
* Returns the font used for text in menus. In this case, the font is
- * <code>FontUIResource("Dialog", Font.BOLD, 12)</code>.
+ * <code>FontUIResource("Dialog", Font.BOLD, 12)</code>, unless the
+ * <code>swing.boldMetal</code> UI default is set to {@link Boolean#FALSE}
+ * in which case it is <code>FontUIResource("Dialog", Font.PLAIN, 12)</code>.
*
* @return The font used for text in menus.
*/
public FontUIResource getMenuTextFont()
{
- return MENU_TEXT_FONT;
+ return getFont(MENU_TEXT_FONT);
}
/**
@@ -218,4 +256,50 @@ public class DefaultMetalTheme extends MetalTheme
{
return WINDOW_TITLE_FONT;
}
+
+ /**
+ * Returns the appropriate font. The font type to return is identified
+ * by the specified id.
+ *
+ * @param id the font type to return
+ *
+ * @return the correct font
+ */
+ private FontUIResource getFont(int id)
+ {
+ FontUIResource font = null;
+ switch (id)
+ {
+ case CONTROL_TEXT_FONT:
+ if (isBoldMetal())
+ font = BOLD_CONTROL_TEXT_FONT;
+ else
+ font = PLAIN_CONTROL_TEXT_FONT;
+ break;
+ case MENU_TEXT_FONT:
+ if (isBoldMetal())
+ font = BOLD_MENU_TEXT_FONT;
+ else
+ font = PLAIN_MENU_TEXT_FONT;
+ break;
+ // TODO: Add other font types and their mapping here.
+ }
+ return font;
+ }
+
+ /**
+ * Determines if the theme should be bold or not. The theme is bold by
+ * default, this can be turned off by setting the system property
+ * swing.boldMetal to true, or by putting the property with the same name
+ * into the current UIManager's defaults.
+ *
+ * @return <code>true</code>, when the theme is bold, <code>false</code>
+ * otherwise
+ */
+ private boolean isBoldMetal()
+ {
+ Object boldMetal = UIManager.get("swing.boldMetal");
+ return (boldMetal == null || ! Boolean.FALSE.equals(boldMetal))
+ && ! ("false".equals(SystemProperties.getProperty("swing.boldMetal")));
+ }
}
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalBorders.java b/libjava/classpath/javax/swing/plaf/metal/MetalBorders.java
index 7c41180aeae..d4e3a849781 100644
--- a/libjava/classpath/javax/swing/plaf/metal/MetalBorders.java
+++ b/libjava/classpath/javax/swing/plaf/metal/MetalBorders.java
@@ -926,15 +926,11 @@ public class MetalBorders
/** The border insets. */
protected static Insets borderInsets = new Insets(1, 0, 1, 0);
- // TODO: find where this color really comes from
- private static Color borderColor = new Color(153, 153, 153);
-
/**
* Creates a new border instance.
*/
public MenuBarBorder()
{
- // Nothing to do here.
}
/**
@@ -951,7 +947,17 @@ public class MetalBorders
public void paintBorder(Component c, Graphics g, int x, int y, int w,
int h)
{
- g.setColor(borderColor);
+ // Although it is not correct to decide on the static property
+ // currentTheme which color to use the RI does it like that.
+ // The trouble is that by simply changing the current theme to
+ // e.g. DefaultMetalLookAndFeel this method will use another color
+ // although a change in painting behavior should be expected only
+ // after setting a new look and feel and updating all components.
+ if(MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme)
+ g.setColor(UIManager.getColor("MenuBar.borderColor"));
+ else
+ g.setColor(MetalLookAndFeel.getControlShadow());
+
g.drawLine(x, y + h - 1, x + w, y + h - 1);
}
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java
index 8addfc66c72..be9607927ba 100644
--- a/libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java
+++ b/libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java
@@ -54,7 +54,6 @@ import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource;
-import javax.swing.plaf.basic.BasicButtonListener;
import javax.swing.plaf.basic.BasicButtonUI;
/**
@@ -66,24 +65,46 @@ public class MetalButtonUI
extends BasicButtonUI
{
- /** The color used to draw the focus rectangle around the text and/or icon. */
+ /**
+ * The shared button UI.
+ */
+ private static MetalButtonUI sharedUI;
+
+ /**
+ * The color used to draw the focus rectangle around the text and/or icon.
+ */
protected Color focusColor;
- /** The background color for the button when it is pressed. */
+ /**
+ * The background color for the button when it is pressed.
+ */
protected Color selectColor;
- /** The color for disabled button labels. */
+ /**
+ * The color for disabled button labels.
+ */
protected Color disabledTextColor;
/**
+ * Returns a UI delegate for the specified component.
+ *
+ * @param c the component (should be a subclass of {@link AbstractButton}).
+ *
+ * @return A new instance of <code>MetalButtonUI</code>.
+ */
+ public static ComponentUI createUI(JComponent c)
+ {
+ if (sharedUI == null)
+ sharedUI = new MetalButtonUI();
+ return sharedUI;
+ }
+
+ /**
* Creates a new instance.
*/
public MetalButtonUI()
{
super();
- focusColor = UIManager.getColor(getPropertyPrefix() + "focus");
- selectColor = UIManager.getColor(getPropertyPrefix() + "select");
- disabledTextColor = UIManager.getColor(getPropertyPrefix() + "disabledText");
}
/**
@@ -93,6 +114,7 @@ public class MetalButtonUI
*/
protected Color getFocusColor()
{
+ focusColor = UIManager.getColor(getPropertyPrefix() + "focus");
return focusColor;
}
@@ -103,6 +125,7 @@ public class MetalButtonUI
*/
protected Color getSelectColor()
{
+ selectColor = UIManager.getColor(getPropertyPrefix() + "select");
return selectColor;
}
@@ -113,22 +136,12 @@ public class MetalButtonUI
*/
protected Color getDisabledTextColor()
{
+ disabledTextColor = UIManager.getColor(getPropertyPrefix()
+ + "disabledText");
return disabledTextColor;
}
/**
- * Returns a UI delegate for the specified component.
- *
- * @param c the component (should be a subclass of {@link AbstractButton}).
- *
- * @return A new instance of <code>MetalButtonUI</code>.
- */
- public static ComponentUI createUI(JComponent c)
- {
- return new MetalButtonUI();
- }
-
- /**
* Installs the default settings for the specified button.
*
* @param button the button.
@@ -137,33 +150,20 @@ public class MetalButtonUI
*/
public void installDefaults(AbstractButton button)
{
+ // This is overridden to be public, for whatever reason.
super.installDefaults(button);
- button.setRolloverEnabled(UIManager.getBoolean(
- getPropertyPrefix() + "rollover"));
}
-
+
/**
* Removes the defaults added by {@link #installDefaults(AbstractButton)}.
*/
public void uninstallDefaults(AbstractButton button)
{
+ // This is overridden to be public, for whatever reason.
super.uninstallDefaults(button);
- button.setRolloverEnabled(false);
}
/**
- * Returns a button listener for the specified button.
- *
- * @param button the button.
- *
- * @return A button listener.
- */
- protected BasicButtonListener createButtonListener(AbstractButton button)
- {
- return new MetalButtonListener(button);
- }
-
- /**
* Paints the background of the button to indicate that it is in the
* "pressed" state.
*
@@ -175,7 +175,7 @@ public class MetalButtonUI
if (b.isContentAreaFilled())
{
Rectangle area = b.getVisibleRect();
- g.setColor(selectColor);
+ g.setColor(getSelectColor());
g.fillRect(area.x, area.y, area.width, area.height);
}
}
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalCheckBoxIcon.java b/libjava/classpath/javax/swing/plaf/metal/MetalCheckBoxIcon.java
index fb8280e44da..30ee93162a9 100644
--- a/libjava/classpath/javax/swing/plaf/metal/MetalCheckBoxIcon.java
+++ b/libjava/classpath/javax/swing/plaf/metal/MetalCheckBoxIcon.java
@@ -1,5 +1,5 @@
/* MetalCheckBoxIcon.java -- An icon for JCheckBoxes in the Metal L&F
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,8 +42,8 @@ import java.awt.Component;
import java.awt.Graphics;
import java.io.Serializable;
+import javax.swing.AbstractButton;
import javax.swing.Icon;
-import javax.swing.JCheckBox;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.plaf.UIResource;
@@ -134,8 +134,9 @@ public class MetalCheckBoxIcon
MetalUtils.paintGradient(g, x, y, getIconWidth(), getIconHeight(),
SwingConstants.VERTICAL, "CheckBox.gradient");
border.paintBorder(c, g, x, y, getIconWidth(), getIconHeight());
- JCheckBox cb = (JCheckBox) c;
- if (cb.isSelected())
- drawCheck(c, g, x, y);
+
+ AbstractButton b = (AbstractButton) c;
+ if (b.isSelected())
+ drawCheck(b, g, x, y);
}
}
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalIconFactory.java b/libjava/classpath/javax/swing/plaf/metal/MetalIconFactory.java
index 30ec7e72b28..2817336a8f1 100644
--- a/libjava/classpath/javax/swing/plaf/metal/MetalIconFactory.java
+++ b/libjava/classpath/javax/swing/plaf/metal/MetalIconFactory.java
@@ -54,7 +54,6 @@ import javax.swing.JRadioButtonMenuItem;
import javax.swing.JSlider;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
-import javax.swing.plaf.IconUIResource;
import javax.swing.plaf.UIResource;
@@ -569,8 +568,8 @@ public class MetalIconFactory implements Serializable
*/
public void paintIcon(Component c, Graphics g, int x, int y)
{
- // TODO: pick up appropriate UI colors
- g.setColor(Color.black);
+ y = y + getShift();
+ g.setColor(MetalLookAndFeel.getBlack());
g.drawLine(x, y, x + 9, y);
g.drawLine(x, y + 1, x, y + 15);
g.drawLine(x, y + 15, x + 12, y + 15);
@@ -580,7 +579,7 @@ public class MetalIconFactory implements Serializable
g.drawLine(x + 7, y + 2, x + 11, y + 6);
g.drawLine(x + 8, y + 1, x + 9, y + 1);
- g.setColor(new Color(204, 204, 255));
+ g.setColor(MetalLookAndFeel.getPrimaryControl());
g.drawLine(x + 1, y + 1, x + 7, y + 1);
g.drawLine(x + 1, y + 1, x + 1, y + 14);
g.drawLine(x + 1, y + 14, x + 11, y + 14);
@@ -601,7 +600,9 @@ public class MetalIconFactory implements Serializable
}
/**
- * Returns the shift (???).
+ * Returns the vertical shift, in pixels, applied when painting the icon.
+ * The default value is zero, but subclasses may override this (for
+ * example, see {@link TreeLeafIcon}).
*
* @return The shift.
*/
@@ -649,21 +650,21 @@ public class MetalIconFactory implements Serializable
*/
public void paintIcon(Component c, Graphics g, int x, int y)
{
- // TODO: pick up appropriate UI colors
- g.setColor(Color.black);
- g.drawLine(x, y + 3, x, y + 12);
- g.drawLine(x, y + 12, x + 15, y + 12);
- g.drawLine(x + 15, y + 12, x + 15, y + 2);
- g.drawLine(x + 14, y + 3, x + 9, y + 3);
- g.drawLine(x + 8, y + 2, x + 1, y + 2);
- g.setColor(new Color(204, 204, 255));
- g.fillRect(x + 2, y + 4, 7, 8);
- g.fillRect(x + 9, y + 5, 6, 7);
- g.setColor(new Color(102, 102, 153));
- g.drawLine(x + 9, y + 2, x + 14, y + 2);
- g.setColor(new Color(50, 50, 120));
- g.drawLine(x + 9, y + 1, x + 15, y + 1);
- g.drawLine(x + 10, y, x + 15, y);
+ y = y + getShift();
+ g.setColor(MetalLookAndFeel.getBlack());
+ g.drawLine(x, y + 6, x, y + 15);
+ g.drawLine(x, y + 15, x + 15, y + 15);
+ g.drawLine(x + 15, y + 15, x + 15, y + 5);
+ g.drawLine(x + 14, y + 6, x + 9, y + 6);
+ g.drawLine(x + 8, y + 5, x + 1, y + 5);
+ g.setColor(MetalLookAndFeel.getPrimaryControl());
+ g.fillRect(x + 2, y + 7, 7, 8);
+ g.fillRect(x + 9, y + 8, 6, 7);
+ g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
+ g.drawLine(x + 9, y + 5, x + 14, y + 5);
+ g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
+ g.drawLine(x + 9, y + 4, x + 15, y + 4);
+ g.drawLine(x + 10, y + 3, x + 15, y + 3);
}
/**
@@ -679,7 +680,9 @@ public class MetalIconFactory implements Serializable
}
/**
- * Returns the shift (???).
+ * Returns the vertical shift, in pixels, applied when painting the icon.
+ * The default value is zero, but subclasses may override this (for
+ * example, see {@link TreeFolderIcon}).
*
* @return The shift.
*/
@@ -1036,20 +1039,22 @@ public class MetalIconFactory implements Serializable
g.drawLine(x + 6, y + 14, x, y + 8);
g.drawLine(x, y + 7, x, y + 1);
- // Fill the icon.
- if (MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme
- && enabled)
- {
- String gradient;
- if (focus)
- gradient = "Slider.focusGradient";
- else
- gradient = "Slider.gradient";
- MetalUtils.paintGradient(g, x + 1, y + 2, 12, 13,
- SwingConstants.VERTICAL, gradient,
- gradientMask);
- }
- else
+// The following is commented out until the masking for the gradient painting
+// is working correctly
+// // Fill the icon.
+// if (MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme
+// && enabled)
+// {
+// String gradient;
+// if (focus)
+// gradient = "Slider.focusGradient";
+// else
+// gradient = "Slider.gradient";
+// MetalUtils.paintGradient(g, x + 1, y + 2, 12, 13,
+// SwingConstants.VERTICAL, gradient,
+// gradientMask);
+// }
+// else
{
if (focus)
g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
@@ -1268,23 +1273,23 @@ public class MetalIconFactory implements Serializable
*/
public void paintIcon(Component c, Graphics g, int x, int y)
{
- g.setColor(new Color(102, 102, 153));
+ g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
g.fillRect(x + 1, y, 14, 2);
g.fillRect(x, y + 1, 2, 14);
g.fillRect(x + 1, y + 14, 14, 2);
g.fillRect(x + 14, y + 1, 2, 14);
g.drawLine(x + 2, y + 5, x + 14, y + 5);
- g.setColor(new Color(204, 204, 255));
+ g.setColor(MetalLookAndFeel.getPrimaryControl());
g.fillRect(x + 2, y + 2, 12, 3);
- g.setColor(new Color(102, 102, 153));
+ g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow());
g.drawLine(x + 3, y + 3, x + 3, y + 3);
g.drawLine(x + 6, y + 3, x + 6, y + 3);
g.drawLine(x + 9, y + 3, x + 9, y + 3);
g.drawLine(x + 12, y + 3, x + 12, y + 3);
- g.setColor(Color.white);
+ g.setColor(MetalLookAndFeel.getWhite());
g.fillRect(x + 2, y + 6, 12, 8);
g.drawLine(x + 2, y + 2, x + 2, y + 2);
g.drawLine(x + 5, y + 2, x + 5, y + 2);
@@ -1697,20 +1702,22 @@ public class MetalIconFactory implements Serializable
g.drawLine(x + 8, y + 14, x + 1, y + 14);
g.drawLine(x, y + 13, x, y + 1);
- // Fill the icon.
- if (MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme
- && enabled)
- {
- String gradient;
- if (focus)
- gradient = "Slider.focusGradient";
- else
- gradient = "Slider.gradient";
- MetalUtils.paintGradient(g, x + 2, y + 1, 13, 12,
- SwingConstants.HORIZONTAL, gradient,
- gradientMask);
- }
- else
+// The following is commented out until the masking for the gradient painting
+// is working correctly
+// // Fill the icon.
+// if (MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme
+// && enabled)
+// {
+// String gradient;
+// if (focus)
+// gradient = "Slider.focusGradient";
+// else
+// gradient = "Slider.gradient";
+// MetalUtils.paintGradient(g, x + 2, y + 1, 13, 12,
+// SwingConstants.HORIZONTAL, gradient,
+// gradientMask);
+// }
+// else
{
if (focus)
g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
@@ -1883,7 +1890,8 @@ public class MetalIconFactory implements Serializable
}
/**
- * Returns the shift (???).
+ * Returns the vertical shift, in pixels, applied when painting the icon.
+ * This overridden method returns <code>-1</code>.
*
* @return The shift.
*/
@@ -1918,7 +1926,8 @@ public class MetalIconFactory implements Serializable
}
/**
- * Returns the shift (???).
+ * Returns the vertical shift, in pixels, applied when painting the icon.
+ * This overridden method returns <code>2</code>.
*
* @return The shift.
*/
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java b/libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java
index 8a5a61107c1..a9a6790931f 100644
--- a/libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java
+++ b/libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package javax.swing.plaf.metal;
+import gnu.classpath.SystemProperties;
+
import java.awt.Color;
import java.awt.Font;
@@ -81,16 +83,15 @@ public class MetalLookAndFeel extends BasicLookAndFeel
*/
public MetalLookAndFeel()
{
- createDefaultTheme();
+ // Nothing to do here.
}
/**
- * Sets the current theme to a new instance of {@link OceanTheme}.
+ * Sets the current theme to a new instance of {@link DefaultMetalTheme}.
*/
protected void createDefaultTheme()
{
- if (theme == null)
- setCurrentTheme(new OceanTheme());
+ getCurrentTheme();
}
/**
@@ -149,6 +150,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
public UIDefaults getDefaults()
{
+ createDefaultTheme();
if (LAF_defaults == null)
{
LAF_defaults = super.getDefaults();
@@ -887,7 +889,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
"CheckBox.border", MetalBorders.getButtonBorder(),
"CheckBox.disabledText", getInactiveControlTextColor(),
"CheckBox.focus", getFocusColor(),
- "CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12),
+ "CheckBox.font", getControlTextFont(),
"CheckBox.foreground", getControlTextColor(),
"CheckBox.icon",
new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalCheckBoxIcon"),
@@ -903,7 +905,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
"CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav",
"CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(),
"CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(),
- "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12),
+ "CheckBoxMenuItem.font", getMenuTextFont(),
"CheckBoxMenuItem.foreground", getMenuForeground(),
"CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(),
"CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(),
@@ -922,7 +924,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
"ComboBox.buttonShadow", getControlShadow(),
"ComboBox.disabledBackground", getControl(),
"ComboBox.disabledForeground", getInactiveSystemTextColor(),
- "ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12),
+ "ComboBox.font", getControlTextFont(),
"ComboBox.foreground", getControlTextColor(),
"ComboBox.selectionBackground", getPrimaryControlShadow(),
"ComboBox.selectionForeground", getControlTextColor(),
@@ -933,10 +935,11 @@ public class MetalLookAndFeel extends BasicLookAndFeel
"DesktopIcon.foreground", getControlTextColor(),
"DesktopIcon.width", new Integer(160),
"DesktopIcon.border", MetalBorders.getDesktopIconBorder(),
+ "DesktopIcon.font", getControlTextFont(),
"EditorPane.background", getWindowBackground(),
"EditorPane.caretForeground", getUserTextColor(),
- "EditorPane.font", new FontUIResource("Dialog", Font.BOLD, 12),
+ "EditorPane.font", getControlTextFont(),
"EditorPane.foreground", getUserTextColor(),
"EditorPane.inactiveForeground", getInactiveSystemTextColor(),
"EditorPane.selectionBackground", getTextHighlightColor(),
@@ -1021,7 +1024,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
"Menu.borderPainted", Boolean.TRUE,
"MenuItem.commandSound", "sounds/MenuItemCommand.wav",
"Menu.disabledForeground", getMenuDisabledForeground(),
- "Menu.font", getControlTextFont(),
+ "Menu.font", getMenuTextFont(),
"Menu.foreground", getMenuForeground(),
"Menu.selectionBackground", getMenuSelectedBackground(),
"Menu.selectionForeground", getMenuSelectedForeground(),
@@ -1030,7 +1033,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
"MenuBar.background", getMenuBackground(),
"MenuBar.border", new MetalBorders.MenuBarBorder(),
- "MenuBar.font", getControlTextFont(),
+ "MenuBar.font", getMenuTextFont(),
"MenuBar.foreground", getMenuForeground(),
"MenuBar.highlight", getControlHighlight(),
"MenuBar.shadow", getControlShadow(),
@@ -1044,7 +1047,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
"MenuItem.border", new MetalBorders.MenuItemBorder(),
"MenuItem.borderPainted", Boolean.TRUE,
"MenuItem.disabledForeground", getMenuDisabledForeground(),
- "MenuItem.font", getControlTextFont(),
+ "MenuItem.font", getMenuTextFont(),
"MenuItem.foreground", getMenuForeground(),
"MenuItem.selectionBackground", getMenuSelectedBackground(),
"MenuItem.selectionForeground", getMenuSelectedForeground(),
@@ -1085,13 +1088,13 @@ public class MetalLookAndFeel extends BasicLookAndFeel
"PopupMenu.background", getMenuBackground(),
"PopupMenu.border", new MetalBorders.PopupMenuBorder(),
- "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12),
+ "PopupMenu.font", getMenuTextFont(),
"PopupMenu.foreground", getMenuForeground(),
"PopupMenu.popupSound", "sounds/PopupMenuPopup.wav",
"ProgressBar.background", getControl(),
"ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1),
- "ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12),
+ "ProgressBar.font", getControlTextFont(),
"ProgressBar.foreground", getPrimaryControlShadow(),
"ProgressBar.selectionBackground", getPrimaryControlDarkShadow(),
"ProgressBar.selectionForeground", getControl(),
@@ -1125,7 +1128,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
MetalIconFactory.getRadioButtonMenuItemIcon(),
"RadioButtonMenuItem.commandSound", "sounds/MenuItemCommand.wav",
"RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(),
- "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(),
+ "RadioButtonMenuItem.font", getMenuTextFont(),
"RadioButtonMenuItem.foreground", getMenuForeground(),
"RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
"RadioButtonMenuItem.selectionBackground",
@@ -1172,7 +1175,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
"Spinner.arrowButtonInsets", new InsetsUIResource(0, 0, 0, 0),
"Spinner.background", getControl(),
"Spinner.border", MetalBorders.getTextFieldBorder(),
- "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12),
+ "Spinner.font", getControlTextFont(),
"Spinner.foreground", getControl(),
"SplitPane.background", getControl(),
@@ -1189,7 +1192,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
"TabbedPane.contentOpaque", Boolean.TRUE,
"TabbedPane.darkShadow", getControlDarkShadow(),
"TabbedPane.focus", getPrimaryControlDarkShadow(),
- "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12),
+ "TabbedPane.font", getControlTextFont(),
"TabbedPane.foreground", getControlTextColor(),
"TabbedPane.highlight", getControlHighlight(),
"TabbedPane.light", getControl(),
@@ -1200,7 +1203,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
"TabbedPane.tabAreaBackground", getControl(), // overridden in OceanTheme
"TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), // dito
"TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9),
-
+
// new properties in OceanTheme:
// TabbedPane.contentAreaColor
// TabbedPane.unselectedBackground
@@ -1252,7 +1255,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
"TextPane.selectionForeground", getHighlightedTextColor(),
"TitledBorder.border", new LineBorderUIResource(getPrimaryControl(), 1),
- "TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12),
+ "TitledBorder.font", getControlTextFont(),
"TitledBorder.titleColor", getSystemTextColor(),
"ToggleButton.background", getControl(),
@@ -1274,7 +1277,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel
"ToolBar.dockingForeground", getPrimaryControlDarkShadow(),
"ToolBar.floatingBackground", getMenuBackground(),
"ToolBar.floatingForeground", getPrimaryControl(),
- "ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12),
+ "ToolBar.font", getMenuTextFont(),
"ToolBar.foreground", getMenuForeground(),
"ToolBar.highlight", getControlHighlight(),
"ToolBar.light", getControlHighlight(),
@@ -1354,7 +1357,14 @@ public class MetalLookAndFeel extends BasicLookAndFeel
public static MetalTheme getCurrentTheme()
{
if (theme == null)
- theme = new OceanTheme();
+ {
+ // swing.metalTheme property documented here:
+ // http://java.sun.com/j2se/1.5.0/docs/guide/swing/1.5/index.html
+ if ("steel".equals(SystemProperties.getProperty("swing.metalTheme")))
+ theme = new DefaultMetalTheme();
+ else
+ theme = new OceanTheme();
+ }
return theme;
}
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalMenuBarUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalMenuBarUI.java
index ff763ea9da9..40661946b1a 100644
--- a/libjava/classpath/javax/swing/plaf/metal/MetalMenuBarUI.java
+++ b/libjava/classpath/javax/swing/plaf/metal/MetalMenuBarUI.java
@@ -1,5 +1,5 @@
/* MetalMenuBarUI.java -- MenuBar UI for the Metal L&F
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -76,12 +76,15 @@ public class MetalMenuBarUI extends BasicMenuBarUI
*/
public void update(Graphics g, JComponent c)
{
+ int height = c.getHeight();
if (c.isOpaque()
&& UIManager.get("MenuBar.gradient") != null
- && c.getBackground() instanceof UIResource)
+ && c.getBackground() instanceof UIResource
+ && height > 2)
{
- MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(),
+ MetalUtils.paintGradient(g, 0, 0, c.getWidth(), height - 2,
SwingConstants.VERTICAL, "MenuBar.gradient");
+
paint(g, c);
}
else
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalRadioButtonUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalRadioButtonUI.java
index 046e4942ee1..57f5bbe3e0a 100644
--- a/libjava/classpath/javax/swing/plaf/metal/MetalRadioButtonUI.java
+++ b/libjava/classpath/javax/swing/plaf/metal/MetalRadioButtonUI.java
@@ -177,7 +177,7 @@ public class MetalRadioButtonUI
protected void paintFocus(Graphics g, Rectangle t, Dimension d)
{
g.setColor(focusColor);
- g.drawRect(t.x - 1, t.y - 1, t.width + 2, t.height + 2);
+ g.drawRect(t.x - 1, t.y - 1, t.width + 1, t.height + 1);
}
}
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalScrollBarUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalScrollBarUI.java
index 75f2750ae9c..4c75fcb4f14 100644
--- a/libjava/classpath/javax/swing/plaf/metal/MetalScrollBarUI.java
+++ b/libjava/classpath/javax/swing/plaf/metal/MetalScrollBarUI.java
@@ -1,5 +1,5 @@
/* MetalScrollBarUI.java
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -169,6 +169,7 @@ public class MetalScrollBarUI extends BasicScrollBarUI
Boolean prop = (Boolean) scrollbar.getClientProperty(FREE_STANDING_PROP);
isFreeStanding = prop == null ? true : prop.booleanValue();
scrollBarShadowColor = UIManager.getColor("ScrollBar.shadow");
+ scrollBarWidth = UIManager.getInt("ScrollBar.width");
super.installDefaults();
}
@@ -187,7 +188,10 @@ public class MetalScrollBarUI extends BasicScrollBarUI
/**
* Creates a new button to use as the control at the lower end of the
- * {@link JScrollBar}.
+ * {@link JScrollBar}. This method assigns the new button (an instance of
+ * {@link MetalScrollButton} to the {@link #decreaseButton} field, and also
+ * returns the button. The button width is determined by the
+ * <code>ScrollBar.width</code> setting in the UI defaults.
*
* @param orientation the orientation of the button ({@link #NORTH},
* {@link #SOUTH}, {@link #EAST} or {@link #WEST}).
@@ -196,7 +200,6 @@ public class MetalScrollBarUI extends BasicScrollBarUI
*/
protected JButton createDecreaseButton(int orientation)
{
- scrollBarWidth = UIManager.getInt("ScrollBar.width");
decreaseButton = new MetalScrollButton(orientation, scrollBarWidth,
isFreeStanding);
return decreaseButton;
@@ -204,7 +207,10 @@ public class MetalScrollBarUI extends BasicScrollBarUI
/**
* Creates a new button to use as the control at the upper end of the
- * {@link JScrollBar}.
+ * {@link JScrollBar}. This method assigns the new button (an instance of
+ * {@link MetalScrollButton} to the {@link #increaseButton} field, and also
+ * returns the button. The button width is determined by the
+ * <code>ScrollBar.width</code> setting in the UI defaults.
*
* @param orientation the orientation of the button ({@link #NORTH},
* {@link #SOUTH}, {@link #EAST} or {@link #WEST}).
@@ -213,7 +219,6 @@ public class MetalScrollBarUI extends BasicScrollBarUI
*/
protected JButton createIncreaseButton(int orientation)
{
- scrollBarWidth = UIManager.getInt("ScrollBar.width");
increaseButton = new MetalScrollButton(orientation, scrollBarWidth,
isFreeStanding);
return increaseButton;
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalSliderUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalSliderUI.java
index 0f824418c5d..b3e8707c94d 100644
--- a/libjava/classpath/javax/swing/plaf/metal/MetalSliderUI.java
+++ b/libjava/classpath/javax/swing/plaf/metal/MetalSliderUI.java
@@ -352,7 +352,10 @@ public class MetalSliderUI extends BasicSliderUI
*/
public int getTickLength()
{
- return tickLength + TICK_BUFFER;
+ int len = tickLength + TICK_BUFFER + 1;
+ if (slider.getOrientation() == JSlider.VERTICAL)
+ len += 2;
+ return len;
}
/**
@@ -406,9 +409,9 @@ public class MetalSliderUI extends BasicSliderUI
// Note the incoming 'g' has a translation in place to get us to the
// start of the tick rect already...
if (slider.isEnabled())
- g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
+ g.setColor(slider.getForeground());
else
- g.setColor(MetalLookAndFeel.getControlDisabled());
+ g.setColor(MetalLookAndFeel.getControlShadow());
g.drawLine(x, TICK_BUFFER, x, TICK_BUFFER + tickLength / 2);
}
@@ -425,10 +428,10 @@ public class MetalSliderUI extends BasicSliderUI
// Note the incoming 'g' has a translation in place to get us to the
// start of the tick rect already...
if (slider.isEnabled())
- g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
+ g.setColor(slider.getForeground());
else
- g.setColor(MetalLookAndFeel.getControlDisabled());
- g.drawLine(x, TICK_BUFFER, x, TICK_BUFFER + tickLength);
+ g.setColor(MetalLookAndFeel.getControlShadow());
+ g.drawLine(x, TICK_BUFFER, x, TICK_BUFFER + tickLength - 1);
}
/**
@@ -444,10 +447,10 @@ public class MetalSliderUI extends BasicSliderUI
// Note the incoming 'g' has a translation in place to get us to the
// start of the tick rect already...
if (slider.isEnabled())
- g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
+ g.setColor(slider.getForeground());
else
- g.setColor(MetalLookAndFeel.getControlDisabled());
- g.drawLine(TICK_BUFFER - 1, y, TICK_BUFFER - 1 + tickLength / 2, y);
+ g.setColor(MetalLookAndFeel.getControlShadow());
+ g.drawLine(TICK_BUFFER, y, TICK_BUFFER + tickLength / 2, y);
}
/**
@@ -463,10 +466,10 @@ public class MetalSliderUI extends BasicSliderUI
// Note the incoming 'g' has a translation in place to get us to the
// start of the tick rect already...
if (slider.isEnabled())
- g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
+ g.setColor(slider.getForeground());
else
- g.setColor(MetalLookAndFeel.getControlDisabled());
- g.drawLine(TICK_BUFFER - 1, y, TICK_BUFFER - 1 + tickLength, y);
+ g.setColor(MetalLookAndFeel.getControlShadow());
+ g.drawLine(TICK_BUFFER, y, TICK_BUFFER + tickLength, y);
}
}
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalSplitPaneDivider.java b/libjava/classpath/javax/swing/plaf/metal/MetalSplitPaneDivider.java
index 6081c355c37..a3069daa9c5 100644
--- a/libjava/classpath/javax/swing/plaf/metal/MetalSplitPaneDivider.java
+++ b/libjava/classpath/javax/swing/plaf/metal/MetalSplitPaneDivider.java
@@ -38,18 +38,14 @@ exception statement from your version. */
package javax.swing.plaf.metal;
import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
-import java.awt.LayoutManager;
-import java.awt.Point;
+import java.awt.Insets;
+import javax.swing.JButton;
import javax.swing.JSplitPane;
-import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.border.Border;
-import javax.swing.plaf.basic.BasicArrowButton;
import javax.swing.plaf.basic.BasicSplitPaneDivider;
/**
@@ -59,6 +55,143 @@ import javax.swing.plaf.basic.BasicSplitPaneDivider;
*/
class MetalSplitPaneDivider extends BasicSplitPaneDivider
{
+ /**
+ * The button pixel data, as indices into the colors array below.
+ * This is the version for 'left' buttons.
+ *
+ * This is slightly different from the icon in Sun's version, it is
+ * one pixel smaller and is more consistent with BUTTON_SPRITE_R.
+ */
+ static final byte[][] BUTTON_SPRITE_L = {{ 0, 0, 0, 2, 0, 0, 0, 0 },
+ { 0, 0, 2, 1, 1, 0, 0, 0 },
+ { 0, 2, 1, 1, 1, 1, 0, 0 },
+ { 2, 1, 1, 1, 1, 1, 1, 0 },
+ { 0, 3, 3, 3, 3, 3, 3, 3 }};
+
+ /**
+ * The button pixel data, as indices into the colors array below.
+ * This is the version for 'right' buttons.
+ */
+ static final byte[][] BUTTON_SPRITE_R = {{ 2, 2, 2, 2, 2, 2, 2, 2 },
+ { 0, 1, 1, 1, 1, 1, 1, 3 },
+ { 0, 0, 1, 1, 1, 1, 3, 0 },
+ { 0, 0, 0, 1, 1, 3, 0, 0 },
+ { 0, 0, 0, 0, 3, 0, 0, 0 }};
+
+ private class MetalOneTouchButton
+ extends JButton
+ {
+ /**
+ * Denotes a left button.
+ */
+ static final int LEFT = 0;
+
+ /**
+ * Denotes a right button.
+ */
+ static final int RIGHT = 1;
+
+ /**
+ * The colors for the button sprite.
+ */
+ private Color[] colors;
+
+ /**
+ * Either LEFT or RIGHT.
+ */
+ private int direction;
+
+ /**
+ * Creates a new instance.
+ *
+ * @param dir either LEFT or RIGHT
+ */
+ MetalOneTouchButton(int dir)
+ {
+ direction = dir;
+ colors = new Color[4];
+ }
+
+ /**
+ * Never allow borders.
+ */
+ public void setBorder(Border b)
+ {
+ }
+
+ /**
+ * Never allow focus traversal.
+ */
+ public boolean isFocusTraversable()
+ {
+ return false;
+ }
+
+ /**
+ * Paints the one touch button.
+ */
+ public void paint(Graphics g)
+ {
+ if (splitPane != null)
+ {
+ // Update colors here to reflect dynamic changes to the theme.
+ colors[0] = getBackground();
+ colors[1] = MetalLookAndFeel.getPrimaryControlDarkShadow();
+ colors[2] = MetalLookAndFeel.getPrimaryControlInfo();
+ colors[3] = MetalLookAndFeel.getPrimaryControlHighlight();
+
+ // Fill background.
+ g.setColor(getBackground());
+ g.fillRect(0, 0, getWidth(), getHeight());
+
+ // Pressed buttons have slightly different color mapping.
+ if (getModel().isPressed())
+ colors[1] = colors[2];
+
+ byte[][] sprite;
+ if (direction == LEFT)
+ sprite = BUTTON_SPRITE_L;
+ else
+ sprite = BUTTON_SPRITE_R;
+
+ if (orientation == JSplitPane.VERTICAL_SPLIT)
+ {
+ // Draw the sprite as it is.
+ for (int y = 0; y < sprite.length; y++)
+ {
+ byte[] line = sprite[y];
+ for (int x = 0; x < line.length; x++)
+ {
+ int c = line[x];
+ if (c != 0)
+ {
+ g.setColor(colors[c]);
+ g.fillRect(x + 1, y + 1, 1, 1);
+ }
+ }
+ }
+ }
+ else
+ {
+ // Draw the sprite with swapped X and Y axis.
+ for (int y = 0; y < sprite.length; y++)
+ {
+ byte[] line = sprite[y];
+ for (int x = 0; x < line.length; x++)
+ {
+ int c = line[x];
+ if (c != 0)
+ {
+ g.setColor(colors[c]);
+ g.fillRect(y + 1, x + 1, 1, 1);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
/** The dark color in the pattern. */
Color dark;
@@ -79,7 +212,6 @@ class MetalSplitPaneDivider extends BasicSplitPaneDivider
public MetalSplitPaneDivider(MetalSplitPaneUI ui, Color light, Color dark)
{
super(ui);
- setLayout(new MetalDividerLayout());
this.splitPane = super.splitPane;
this.orientation = super.orientation;
this.light = light;
@@ -106,126 +238,27 @@ class MetalSplitPaneDivider extends BasicSplitPaneDivider
if (border != null)
border.paintBorder(this, g, 0, 0, s.width, s.height);
- MetalUtils.fillMetalPattern(splitPane, g, 2, 2, s.width - 4, s.height - 4,
+ Insets i = getInsets();
+ MetalUtils.fillMetalPattern(splitPane, g, i.left + 2, i.top + 2,
+ s.width - i.left - i.right - 4,
+ s.height - i.top - i.bottom - 4,
light, dark);
- if (splitPane.isOneTouchExpandable())
- {
- ((BasicArrowButton) rightButton).paint(g);
- ((BasicArrowButton) leftButton).paint(g);
- }
+ super.paint(g);
}
-
- /**
- * This helper class acts as the Layout Manager for the divider.
- */
- public class MetalDividerLayout implements LayoutManager
- {
- /** The right button. */
- BasicArrowButton rb;
-
- /** The left button. */
- BasicArrowButton lb;
-
- /**
- * Creates a new DividerLayout object.
- */
- public MetalDividerLayout()
- {
- // Nothing to do here
- }
-
- /**
- * This method is called when a Component is added.
- *
- * @param string The constraints string.
- * @param c The Component to add.
- */
- public void addLayoutComponent(String string, Component c)
- {
- // Nothing to do here, constraints are set depending on
- // orientation in layoutContainer
- }
-
- /**
- * This method is called to lay out the container.
- *
- * @param c The container to lay out.
- */
- public void layoutContainer(Container c)
- {
- // The only components we care about setting up are the
- // one touch buttons.
- if (splitPane.isOneTouchExpandable())
- {
- if (c.getComponentCount() == 2)
- {
- Component c1 = c.getComponent(0);
- Component c2 = c.getComponent(1);
- if ((c1 instanceof BasicArrowButton)
- && (c2 instanceof BasicArrowButton))
- {
- lb = (BasicArrowButton) c1;
- rb = (BasicArrowButton) c2;
- }
- }
- if (rb != null && lb != null)
- {
- Point p = getLocation();
- lb.setSize(lb.getPreferredSize());
- rb.setSize(rb.getPreferredSize());
- lb.setLocation(p.x, p.y);
-
- if (orientation == JSplitPane.HORIZONTAL_SPLIT)
- {
- rb.setDirection(SwingConstants.EAST);
- lb.setDirection(SwingConstants.WEST);
- rb.setLocation(p.x, p.y + lb.getHeight());
- }
- else
- {
- rb.setDirection(SwingConstants.SOUTH);
- lb.setDirection(SwingConstants.NORTH);
- rb.setLocation(p.x + lb.getWidth(), p.y);
- }
- }
- }
- }
-
- /**
- * This method returns the minimum layout size.
- *
- * @param c The container to calculate for.
- *
- * @return The minimum layout size.
- */
- public Dimension minimumLayoutSize(Container c)
- {
- return preferredLayoutSize(c);
- }
- /**
- * This method returns the preferred layout size.
- *
- * @param c The container to calculate for.
- *
- * @return The preferred layout size.
- */
- public Dimension preferredLayoutSize(Container c)
- {
- int dividerSize = getDividerSize();
- return new Dimension(dividerSize, dividerSize);
- }
+ protected JButton createLeftOneTouchButton()
+ {
+ JButton b = new MetalOneTouchButton(MetalOneTouchButton.LEFT);
+ b.setMinimumSize(new Dimension(ONE_TOUCH_SIZE, ONE_TOUCH_SIZE));
+ b.setRequestFocusEnabled(false);
+ return b;
+ }
- /**
- * This method is called when a component is removed.
- *
- * @param c The component to remove.
- */
- public void removeLayoutComponent(Component c)
- {
- // Nothing to do here. If buttons are removed
- // they will not be layed out when layoutContainer is
- // called.
- }
+ protected JButton createRightOneTouchButton()
+ {
+ JButton b = new MetalOneTouchButton(MetalOneTouchButton.RIGHT);
+ b.setMinimumSize(new Dimension(ONE_TOUCH_SIZE, ONE_TOUCH_SIZE));
+ b.setRequestFocusEnabled(false);
+ return b;
}
}
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalTabbedPaneUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalTabbedPaneUI.java
index 20135fc857e..53eaa3cac5a 100644
--- a/libjava/classpath/javax/swing/plaf/metal/MetalTabbedPaneUI.java
+++ b/libjava/classpath/javax/swing/plaf/metal/MetalTabbedPaneUI.java
@@ -1159,7 +1159,7 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI
g.drawLine(x + 1, y + 1, x + 1, rect.y + 1);
if (rect.y + rect.height < y + h - 2)
{
- g.drawLine(x + y, rect.y + rect.height + 1, x + 1, y + h + 2);
+ g.drawLine(x + 1, rect.y + rect.height + 1, x + 1, y + h + 2);
}
}
}
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalToolTipUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalToolTipUI.java
index d1040347fc6..6647cc02d16 100644
--- a/libjava/classpath/javax/swing/plaf/metal/MetalToolTipUI.java
+++ b/libjava/classpath/javax/swing/plaf/metal/MetalToolTipUI.java
@@ -43,9 +43,6 @@ import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import java.awt.Toolkit;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
@@ -54,8 +51,6 @@ import javax.swing.JComponent;
import javax.swing.JMenuItem;
import javax.swing.JToolTip;
import javax.swing.KeyStroke;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.plaf.ComponentUI;
@@ -192,32 +187,14 @@ public class MetalToolTipUI
*/
public Dimension getPreferredSize(JComponent c)
{
- if (isAcceleratorHidden())
- return super.getPreferredSize(c);
- else
+ Dimension d = super.getPreferredSize(c);
+ String acc = getAcceleratorString();
+ if (acc != null && ! acc.equals(""))
{
- Insets insets = c.getInsets();
- JToolTip tt = (JToolTip) c;
- String tipText = tt.getTipText();
- if (tipText != null)
- {
- FontMetrics fm = c.getFontMetrics(c.getFont());
- int prefH = fm.getHeight() + insets.top + insets.bottom;
- int prefW = fm.stringWidth(tipText) + insets.left + insets.right;
-
- // this seems to be the first opportunity we have to get the
- // accelerator string from the component (if it has one)
- acceleratorString = fetchAcceleratorString(c);
- if (acceleratorString != null)
- {
- prefW += padSpaceBetweenStrings;
- fm = c.getFontMetrics(acceleratorFont);
- prefW += fm.stringWidth(acceleratorString);
- }
- return new Dimension(prefW, prefH);
- }
- else return new Dimension(0, 0);
+ FontMetrics fm = c.getFontMetrics(c.getFont());
+ d.width += fm.stringWidth(acc);
}
+ return d;
}
/**
@@ -228,39 +205,8 @@ public class MetalToolTipUI
*/
public void paint(Graphics g, JComponent c)
{
- JToolTip tip = (JToolTip) c;
-
- String text = tip.getTipText();
- Toolkit t = tip.getToolkit();
- if (text == null)
- return;
-
- Rectangle vr = new Rectangle();
- vr = SwingUtilities.calculateInnerArea(tip, vr);
- Rectangle ir = new Rectangle();
- Rectangle tr = new Rectangle();
- FontMetrics fm = t.getFontMetrics(tip.getFont());
- int ascent = fm.getAscent();
- SwingUtilities.layoutCompoundLabel(tip, fm, text, null,
- SwingConstants.CENTER, SwingConstants.LEFT,
- SwingConstants.CENTER, SwingConstants.CENTER, vr, ir, tr, 0);
- Color saved = g.getColor();
- g.setColor(Color.BLACK);
-
- g.drawString(text, vr.x, vr.y + ascent);
-
- // paint accelerator
- if (acceleratorString != null)
- {
- g.setFont(acceleratorFont);
- g.setColor(acceleratorForeground);
- fm = t.getFontMetrics(acceleratorFont);
- int width = fm.stringWidth(acceleratorString);
- g.drawString(acceleratorString, vr.x + vr.width - width
- - padSpaceBetweenStrings / 2, vr.y + vr.height - fm.getDescent());
- }
-
- g.setColor(saved);
+ super.paint(g, c);
+ // Somehow paint accelerator. Keep care for possible HTML rendering.
}
/**
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalTreeUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalTreeUI.java
index 3ea37c82f18..ed1e5b4d825 100644
--- a/libjava/classpath/javax/swing/plaf/metal/MetalTreeUI.java
+++ b/libjava/classpath/javax/swing/plaf/metal/MetalTreeUI.java
@@ -38,14 +38,15 @@ exception statement from your version. */
package javax.swing.plaf.metal;
-import gnu.classpath.NotImplementedException;
-
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import javax.swing.JComponent;
import javax.swing.JTree;
+import javax.swing.UIManager;
import javax.swing.tree.TreePath;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicTreeUI;
@@ -56,6 +57,68 @@ import javax.swing.plaf.basic.BasicTreeUI;
public class MetalTreeUI extends BasicTreeUI
{
/**
+ * Listens for property changes of the line style and updates the
+ * internal setting.
+ */
+ private class LineStyleListener
+ implements PropertyChangeListener
+ {
+
+ public void propertyChange(PropertyChangeEvent e)
+ {
+ if (e.getPropertyName().equals(LINE_STYLE_PROPERTY))
+ decodeLineStyle(e.getNewValue());
+ }
+
+ }
+
+ /**
+ * The key to the lineStyle client property.
+ */
+ private static final String LINE_STYLE_PROPERTY = "JTree.lineStyle";
+
+ /**
+ * The property value indicating no line style.
+ */
+ private static final String LINE_STYLE_VALUE_NONE = "None";
+
+ /**
+ * The property value indicating angled line style.
+ */
+ private static final String LINE_STYLE_VALUE_ANGLED = "Angled";
+
+ /**
+ * The property value indicating horizontal line style.
+ */
+ private static final String LINE_STYLE_VALUE_HORIZONTAL = "Horizontal";
+
+ /**
+ * The line style for None.
+ */
+ private static final int LINE_STYLE_NONE = 0;
+
+ /**
+ * The line style for Angled.
+ */
+ private static final int LINE_STYLE_ANGLED = 1;
+
+ /**
+ * The line style for Horizontal.
+ */
+ private static final int LINE_STYLE_HORIZONTAL = 2;
+
+ /**
+ * The current line style.
+ */
+ private int lineStyle;
+
+ /**
+ * Listens for changes on the line style property and updates the
+ * internal settings.
+ */
+ private PropertyChangeListener lineStyleListener;
+
+ /**
* Constructs a new instance of <code>MetalTreeUI</code>.
*/
public MetalTreeUI()
@@ -103,8 +166,13 @@ public class MetalTreeUI extends BasicTreeUI
*/
public void installUI(JComponent c)
{
- // TODO: What to do here, if anything?
super.installUI(c);
+
+ Object lineStyleProp = c.getClientProperty(LINE_STYLE_PROPERTY);
+ decodeLineStyle(lineStyleProp);
+ if (lineStyleListener == null)
+ lineStyleListener = new LineStyleListener();
+ c.addPropertyChangeListener(lineStyleListener);
}
/**
@@ -124,8 +192,10 @@ public class MetalTreeUI extends BasicTreeUI
*/
public void uninstallUI(JComponent c)
{
- // TODO: What to do here?
super.uninstallUI(c);
+ if (lineStyleListener != null)
+ c.removePropertyChangeListener(lineStyleListener);
+ lineStyleListener = null;
}
/**
@@ -135,9 +205,15 @@ public class MetalTreeUI extends BasicTreeUI
* @param lineStyleFlag - String representation
*/
protected void decodeLineStyle(Object lineStyleFlag)
- throws NotImplementedException
{
- // FIXME: not implemented
+ if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED))
+ lineStyle = LINE_STYLE_ANGLED;
+ else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL))
+ lineStyle = LINE_STYLE_HORIZONTAL;
+ else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE))
+ lineStyle = LINE_STYLE_NONE;
+ else
+ lineStyle = LINE_STYLE_ANGLED;
}
/**
@@ -170,6 +246,9 @@ public class MetalTreeUI extends BasicTreeUI
// Calls BasicTreeUI's paint since it takes care of painting all
// types of icons.
super.paint(g, c);
+
+ if (lineStyle == LINE_STYLE_HORIZONTAL)
+ paintHorizontalSeparators(g, c);
}
/**
@@ -179,9 +258,28 @@ public class MetalTreeUI extends BasicTreeUI
* @param c - the current component to draw
*/
protected void paintHorizontalSeparators(Graphics g, JComponent c)
- throws NotImplementedException
{
- // FIXME: not implemented
+ g.setColor(UIManager.getColor("Tree.line"));
+ Rectangle clip = g.getClipBounds();
+ int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y));
+ int row1 =
+ getRowForPath(tree, getClosestPathForLocation(tree, 0,
+ clip.y + clip.height - 1));
+ if (row0 >= 0 && row1 >= 0)
+ {
+ for (int i = row0; i <= row1; i++)
+ {
+ TreePath p = getPathForRow(tree, i);
+ if (p != null && p.getPathCount() == 2)
+ {
+ Rectangle r = getPathBounds(tree, getPathForRow(tree, i));
+ if (r != null)
+ {
+ g.drawLine(clip.x, r.y, clip.x + clip.width, r.y);
+ }
+ }
+ }
+ }
}
@@ -197,7 +295,8 @@ public class MetalTreeUI extends BasicTreeUI
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds,
Insets insets, TreePath path)
{
- super.paintVerticalPartOfLeg(g, clipBounds, insets, path);
+ if (lineStyle == LINE_STYLE_ANGLED)
+ super.paintVerticalPartOfLeg(g, clipBounds, insets, path);
}
/**
@@ -211,7 +310,8 @@ public class MetalTreeUI extends BasicTreeUI
boolean isExpanded, boolean hasBeenExpanded,
boolean isLeaf)
{
- super.paintHorizontalPartOfLeg(g, clipBounds, insets, bounds, path, row,
- isExpanded, hasBeenExpanded, isLeaf);
+ if (lineStyle == LINE_STYLE_ANGLED)
+ super.paintHorizontalPartOfLeg(g, clipBounds, insets, bounds, path, row,
+ isExpanded, hasBeenExpanded, isLeaf);
}
}
diff --git a/libjava/classpath/javax/swing/plaf/metal/OceanTheme.java b/libjava/classpath/javax/swing/plaf/metal/OceanTheme.java
index 9d76ff7e808..1ea0bc24385 100644
--- a/libjava/classpath/javax/swing/plaf/metal/OceanTheme.java
+++ b/libjava/classpath/javax/swing/plaf/metal/OceanTheme.java
@@ -266,6 +266,8 @@ public class OceanTheme extends DefaultMetalTheme
defaults.put("Tree.selectionBorderColor", PRIMARY1);
// Borders.
+ defaults.put("List.focusCellHighlightBorder",
+ new LineBorderUIResource(getPrimary1()));
defaults.put("Table.focusCellHighlightBorder",
new LineBorderUIResource(getPrimary1()));
diff --git a/libjava/classpath/javax/swing/plaf/synth/SynthLookAndFeel.java b/libjava/classpath/javax/swing/plaf/synth/SynthLookAndFeel.java
index 1a2489e7ea6..46a95f09860 100644
--- a/libjava/classpath/javax/swing/plaf/synth/SynthLookAndFeel.java
+++ b/libjava/classpath/javax/swing/plaf/synth/SynthLookAndFeel.java
@@ -216,9 +216,7 @@ public class SynthLookAndFeel
* @throws IllegalArgumentException if one of the parameters is
* <code>null</code>
*/
- // FIXME: The signature in the JDK has a Class<?> here. Should be fixed as
- // soon as we switch to the generics branch.
- public void load(InputStream in, Class resourceBase)
+ public void load(InputStream in, Class<?> resourceBase)
throws ParseException, IllegalArgumentException, NotImplementedException
{
// FIXME: Implement this correctly.
diff --git a/libjava/classpath/javax/swing/table/AbstractTableModel.java b/libjava/classpath/javax/swing/table/AbstractTableModel.java
index 7914e0b3f46..66b6a0743b6 100644
--- a/libjava/classpath/javax/swing/table/AbstractTableModel.java
+++ b/libjava/classpath/javax/swing/table/AbstractTableModel.java
@@ -125,7 +125,7 @@ public abstract class AbstractTableModel implements TableModel, Serializable
*
* @return The class.
*/
- public Class getColumnClass(int columnIndex)
+ public Class<?> getColumnClass(int columnIndex)
{
return Object.class;
}
@@ -294,7 +294,7 @@ public abstract class AbstractTableModel implements TableModel, Serializable
*
* @return An array of listeners (possibly empty).
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
return listenerList.getListeners(listenerType);
}
diff --git a/libjava/classpath/javax/swing/table/DefaultTableColumnModel.java b/libjava/classpath/javax/swing/table/DefaultTableColumnModel.java
index 33e68ea9fcd..e4e7201b184 100644
--- a/libjava/classpath/javax/swing/table/DefaultTableColumnModel.java
+++ b/libjava/classpath/javax/swing/table/DefaultTableColumnModel.java
@@ -71,7 +71,7 @@ public class DefaultTableColumnModel
/**
* Storage for the table columns.
*/
- protected Vector tableColumns;
+ protected Vector<TableColumn> tableColumns;
/**
* A selection model that keeps track of column selections.
@@ -187,7 +187,7 @@ public class DefaultTableColumnModel
throw new IllegalArgumentException("Index 'i' out of range.");
if (j < 0 || j >= columnCount)
throw new IllegalArgumentException("Index 'j' out of range.");
- Object column = tableColumns.remove(i);
+ TableColumn column = tableColumns.remove(i);
tableColumns.add(j, column);
fireColumnMoved(new TableColumnModelEvent(this, i, j));
}
@@ -221,7 +221,7 @@ public class DefaultTableColumnModel
*
* @return An enumeration of the columns in the model.
*/
- public Enumeration getColumns()
+ public Enumeration<TableColumn> getColumns()
{
return tableColumns.elements();
}
@@ -597,7 +597,7 @@ public class DefaultTableColumnModel
* @return An array containing the listeners (of the specified type) that
* are registered with this model.
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
return listenerList.getListeners(listenerType);
}
diff --git a/libjava/classpath/javax/swing/table/DefaultTableModel.java b/libjava/classpath/javax/swing/table/DefaultTableModel.java
index 79285903c00..1b68ce2be81 100644
--- a/libjava/classpath/javax/swing/table/DefaultTableModel.java
+++ b/libjava/classpath/javax/swing/table/DefaultTableModel.java
@@ -625,7 +625,7 @@ public class DefaultTableModel extends AbstractTableModel
if (columnCount > columnIdentifiers.size())
columnIdentifiers.setSize(columnCount);
- if (rowCount > dataVector.size())
+ if (dataVector != null && rowCount > dataVector.size())
{
int rowsToAdd = rowCount - dataVector.size();
addExtraRows(rowsToAdd, columnCount);
diff --git a/libjava/classpath/javax/swing/table/TableColumnModel.java b/libjava/classpath/javax/swing/table/TableColumnModel.java
index 986c0253323..7e8a70c3a5b 100644
--- a/libjava/classpath/javax/swing/table/TableColumnModel.java
+++ b/libjava/classpath/javax/swing/table/TableColumnModel.java
@@ -102,7 +102,7 @@ public interface TableColumnModel
*
* @return An enumeration of the columns in the model.
*/
- Enumeration getColumns();
+ Enumeration<TableColumn> getColumns();
/**
* Returns the index of the {@link TableColumn} with the given identifier.
diff --git a/libjava/classpath/javax/swing/table/TableModel.java b/libjava/classpath/javax/swing/table/TableModel.java
index 016ae171dd4..7629fa4e404 100644
--- a/libjava/classpath/javax/swing/table/TableModel.java
+++ b/libjava/classpath/javax/swing/table/TableModel.java
@@ -84,7 +84,7 @@ public interface TableModel
*
* @return The class.
*/
- Class getColumnClass(int columnIndex);
+ Class<?> getColumnClass(int columnIndex);
/**
* Returns <code>true</code> if the cell is editable, and <code>false</code>
diff --git a/libjava/classpath/javax/swing/text/AbstractDocument.java b/libjava/classpath/javax/swing/text/AbstractDocument.java
index eb46a8c42f6..eead8de5261 100644
--- a/libjava/classpath/javax/swing/text/AbstractDocument.java
+++ b/libjava/classpath/javax/swing/text/AbstractDocument.java
@@ -38,11 +38,15 @@ exception statement from your version. */
package javax.swing.text;
+import java.awt.font.TextAttribute;
import java.io.PrintStream;
import java.io.Serializable;
+import java.text.Bidi;
+import java.util.ArrayList;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.EventListener;
+import java.util.HashMap;
import java.util.Hashtable;
import java.util.Vector;
@@ -105,6 +109,21 @@ public abstract class AbstractDocument implements Document, Serializable
public static final String ElementNameAttribute = "$ename";
/**
+ * Standard name for the bidi root element.
+ */
+ private static final String BidiRootName = "bidi root";
+
+ /**
+ * Key for storing the asynchronous load priority.
+ */
+ private static final String AsyncLoadPriority = "load priority";
+
+ /**
+ * Key for storing the I18N state.
+ */
+ private static final String I18N = "i18n";
+
+ /**
* The actual content model of this <code>Document</code>.
*/
Content content;
@@ -140,14 +159,10 @@ public abstract class AbstractDocument implements Document, Serializable
private int numReaders = 0;
/**
- * Tells if there are one or more writers waiting.
+ * The number of current writers. If this is > 1 then the same thread entered
+ * the write lock more than once.
*/
- private int numWritersWaiting = 0;
-
- /**
- * A condition variable that readers and writers wait on.
- */
- private Object documentCV = new Object();
+ private int numWriters = 0;
/** An instance of a DocumentFilter.FilterBypass which allows calling
* the insert, remove and replace method without checking for an installed
@@ -158,7 +173,13 @@ public abstract class AbstractDocument implements Document, Serializable
/**
* The bidi root element.
*/
- private Element bidiRoot;
+ private BidiRootElement bidiRoot;
+
+ /**
+ * True when we are currently notifying any listeners. This is used
+ * to detect illegal situations in writeLock().
+ */
+ private transient boolean notifyListeners;
/**
* Creates a new <code>AbstractDocument</code> with the specified
@@ -191,12 +212,25 @@ public abstract class AbstractDocument implements Document, Serializable
content = doc;
context = ctx;
+ // FIXME: Fully implement bidi.
+ bidiRoot = new BidiRootElement();
+
// FIXME: This is determined using a Mauve test. Make the document
// actually use this.
- putProperty("i18n", Boolean.FALSE);
+ putProperty(I18N, Boolean.FALSE);
- // FIXME: Fully implement bidi.
- bidiRoot = new BranchElement(null, null);
+ // Add one child to the bidi root.
+ writeLock();
+ try
+ {
+ Element[] children = new Element[1];
+ children[0] = new BidiElement(bidiRoot, 0, 1, 0);
+ bidiRoot.replace(0, 0, children);
+ }
+ finally
+ {
+ writeUnlock();
+ }
}
/** Returns the DocumentFilter.FilterBypass instance for this
@@ -284,7 +318,8 @@ public abstract class AbstractDocument implements Document, Serializable
* @throws BadLocationException if <code>offset</code> is not a valid
* location in the documents content model
*/
- public Position createPosition(final int offset) throws BadLocationException
+ public synchronized Position createPosition(final int offset)
+ throws BadLocationException
{
return content.createPosition(offset);
}
@@ -296,10 +331,17 @@ public abstract class AbstractDocument implements Document, Serializable
*/
protected void fireChangedUpdate(DocumentEvent event)
{
- DocumentListener[] listeners = getDocumentListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].changedUpdate(event);
+ notifyListeners = true;
+ try
+ {
+ DocumentListener[] listeners = getDocumentListeners();
+ for (int index = 0; index < listeners.length; ++index)
+ listeners[index].changedUpdate(event);
+ }
+ finally
+ {
+ notifyListeners = false;
+ }
}
/**
@@ -310,10 +352,17 @@ public abstract class AbstractDocument implements Document, Serializable
*/
protected void fireInsertUpdate(DocumentEvent event)
{
- DocumentListener[] listeners = getDocumentListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].insertUpdate(event);
+ notifyListeners = true;
+ try
+ {
+ DocumentListener[] listeners = getDocumentListeners();
+ for (int index = 0; index < listeners.length; ++index)
+ listeners[index].insertUpdate(event);
+ }
+ finally
+ {
+ notifyListeners = false;
+ }
}
/**
@@ -324,10 +373,17 @@ public abstract class AbstractDocument implements Document, Serializable
*/
protected void fireRemoveUpdate(DocumentEvent event)
{
- DocumentListener[] listeners = getDocumentListeners();
-
- for (int index = 0; index < listeners.length; ++index)
- listeners[index].removeUpdate(event);
+ notifyListeners = true;
+ try
+ {
+ DocumentListener[] listeners = getDocumentListeners();
+ for (int index = 0; index < listeners.length; ++index)
+ listeners[index].removeUpdate(event);
+ }
+ finally
+ {
+ notifyListeners = false;
+ }
}
/**
@@ -352,7 +408,11 @@ public abstract class AbstractDocument implements Document, Serializable
*/
public int getAsynchronousLoadPriority()
{
- return 0;
+ Object val = getProperty(AsyncLoadPriority);
+ int prio = -1;
+ if (val != null)
+ prio = ((Integer) val).intValue();
+ return prio;
}
/**
@@ -397,7 +457,7 @@ public abstract class AbstractDocument implements Document, Serializable
* @return the thread that currently modifies this <code>Document</code>
* if there is one, otherwise <code>null</code>
*/
- protected final Thread getCurrentWriter()
+ protected final synchronized Thread getCurrentWriter()
{
return currentWriter;
}
@@ -407,7 +467,7 @@ public abstract class AbstractDocument implements Document, Serializable
*
* @return the properties of this <code>Document</code>
*/
- public Dictionary getDocumentProperties()
+ public Dictionary<Object, Object> getDocumentProperties()
{
// FIXME: make me thread-safe
if (properties == null)
@@ -425,14 +485,17 @@ public abstract class AbstractDocument implements Document, Serializable
*/
public final Position getEndPosition()
{
- // FIXME: Properly implement this by calling Content.createPosition().
- return new Position()
- {
- public int getOffset()
- {
- return getLength();
- }
- };
+ Position p;
+ try
+ {
+ p = createPosition(content.length());
+ }
+ catch (BadLocationException ex)
+ {
+ // Shouldn't really happen.
+ p = null;
+ }
+ return p;
}
/**
@@ -455,7 +518,7 @@ public abstract class AbstractDocument implements Document, Serializable
*
* @return all registered listeners of the specified type
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
return listenerList.getListeners(listenerType);
}
@@ -504,14 +567,17 @@ public abstract class AbstractDocument implements Document, Serializable
*/
public final Position getStartPosition()
{
- // FIXME: Properly implement this using Content.createPosition().
- return new Position()
- {
- public int getOffset()
- {
- return 0;
- }
- };
+ Position p;
+ try
+ {
+ p = createPosition(0);
+ }
+ catch (BadLocationException ex)
+ {
+ // Shouldn't really happen.
+ p = null;
+ }
+ return p;
}
/**
@@ -574,11 +640,19 @@ public abstract class AbstractDocument implements Document, Serializable
// Bail out if we have a bogus insertion (Behavior observed in RI).
if (text == null || text.length() == 0)
return;
-
- if (documentFilter == null)
- insertStringImpl(offset, text, attributes);
- else
- documentFilter.insertString(getBypass(), offset, text, attributes);
+
+ writeLock();
+ try
+ {
+ if (documentFilter == null)
+ insertStringImpl(offset, text, attributes);
+ else
+ documentFilter.insertString(getBypass(), offset, text, attributes);
+ }
+ finally
+ {
+ writeUnlock();
+ }
}
void insertStringImpl(int offset, String text, AttributeSet attributes)
@@ -591,23 +665,30 @@ public abstract class AbstractDocument implements Document, Serializable
new DefaultDocumentEvent(offset, text.length(),
DocumentEvent.EventType.INSERT);
- try
- {
- writeLock();
- UndoableEdit undo = content.insertString(offset, text);
- if (undo != null)
- event.addEdit(undo);
-
- insertUpdate(event, attributes);
+ UndoableEdit undo = content.insertString(offset, text);
+ if (undo != null)
+ event.addEdit(undo);
- fireInsertUpdate(event);
- if (undo != null)
- fireUndoableEditUpdate(new UndoableEditEvent(this, undo));
- }
- finally
+ // Check if we need bidi layout.
+ if (getProperty(I18N).equals(Boolean.FALSE))
{
- writeUnlock();
+ Object dir = getProperty(TextAttribute.RUN_DIRECTION);
+ if (TextAttribute.RUN_DIRECTION_RTL.equals(dir))
+ putProperty(I18N, Boolean.TRUE);
+ else
+ {
+ char[] chars = text.toCharArray();
+ if (Bidi.requiresBidi(chars, 0, chars.length))
+ putProperty(I18N, Boolean.TRUE);
+ }
}
+
+ insertUpdate(event, attributes);
+
+ fireInsertUpdate(event);
+
+ if (undo != null)
+ fireUndoableEditUpdate(new UndoableEditEvent(this, undo));
}
/**
@@ -620,7 +701,8 @@ public abstract class AbstractDocument implements Document, Serializable
*/
protected void insertUpdate(DefaultDocumentEvent chng, AttributeSet attr)
{
- // Do nothing here. Subclasses may want to override this.
+ if (Boolean.TRUE.equals(getProperty(I18N)))
+ updateBidi(chng);
}
/**
@@ -632,7 +714,8 @@ public abstract class AbstractDocument implements Document, Serializable
*/
protected void postRemoveUpdate(DefaultDocumentEvent chng)
{
- // Do nothing here. Subclasses may want to override this.
+ if (Boolean.TRUE.equals(getProperty(I18N)))
+ updateBidi(chng);
}
/**
@@ -647,31 +730,338 @@ public abstract class AbstractDocument implements Document, Serializable
if (properties == null)
properties = new Hashtable();
- properties.put(key, value);
+ if (value == null)
+ properties.remove(key);
+ else
+ properties.put(key, value);
+
+ // Update bidi structure if the RUN_DIRECTION is set.
+ if (TextAttribute.RUN_DIRECTION.equals(key))
+ {
+ if (TextAttribute.RUN_DIRECTION_RTL.equals(value)
+ && Boolean.FALSE.equals(getProperty(I18N)))
+ putProperty(I18N, Boolean.TRUE);
+
+ if (Boolean.TRUE.equals(getProperty(I18N)))
+ {
+ writeLock();
+ try
+ {
+ DefaultDocumentEvent ev =
+ new DefaultDocumentEvent(0, getLength(),
+ DocumentEvent.EventType.INSERT);
+ updateBidi(ev);
+ }
+ finally
+ {
+ writeUnlock();
+ }
+ }
+ }
}
/**
- * Blocks until a read lock can be obtained. Must block if there is
- * currently a writer modifying the <code>Document</code>.
+ * Updates the bidi element structure.
+ *
+ * @param ev the document event for the change
*/
- public final void readLock()
+ private void updateBidi(DefaultDocumentEvent ev)
{
- if (currentWriter != null && currentWriter.equals(Thread.currentThread()))
- return;
- synchronized (documentCV)
+ // Determine start and end offset of the paragraphs to be scanned.
+ int start = 0;
+ int end = 0;
+ DocumentEvent.EventType type = ev.getType();
+ if (type == DocumentEvent.EventType.INSERT
+ || type == DocumentEvent.EventType.CHANGE)
+ {
+ int offs = ev.getOffset();
+ int endOffs = offs + ev.getLength();
+ start = getParagraphElement(offs).getStartOffset();
+ end = getParagraphElement(endOffs).getEndOffset();
+ }
+ else if (type == DocumentEvent.EventType.REMOVE)
{
- while (currentWriter != null || numWritersWaiting > 0)
+ Element par = getParagraphElement(ev.getOffset());
+ start = par.getStartOffset();
+ end = par.getEndOffset();
+ }
+ else
+ assert false : "Unknown event type";
+
+ // Determine the bidi levels for the affected range.
+ Bidi[] bidis = getBidis(start, end);
+
+ int removeFrom = 0;
+ int removeTo = 0;
+
+ int offs = 0;
+ int lastRunStart = 0;
+ int lastRunEnd = 0;
+ int lastRunLevel = 0;
+ ArrayList newEls = new ArrayList();
+ for (int i = 0; i < bidis.length; i++)
+ {
+ Bidi bidi = bidis[i];
+ int numRuns = bidi.getRunCount();
+ for (int r = 0; r < numRuns; r++)
{
- try
+ if (r == 0 && i == 0)
+ {
+ if (start > 0)
+ {
+ // Try to merge with the previous element if it has the
+ // same bidi level as the first run.
+ int prevElIndex = bidiRoot.getElementIndex(start - 1);
+ removeFrom = prevElIndex;
+ Element prevEl = bidiRoot.getElement(prevElIndex);
+ AttributeSet atts = prevEl.getAttributes();
+ int prevElLevel = StyleConstants.getBidiLevel(atts);
+ if (prevElLevel == bidi.getRunLevel(r))
+ {
+ // Merge previous element with current run.
+ lastRunStart = prevEl.getStartOffset() - start;
+ lastRunEnd = bidi.getRunLimit(r);
+ lastRunLevel = bidi.getRunLevel(r);
+ }
+ else if (prevEl.getEndOffset() > start)
+ {
+ // Split previous element and replace by 2 new elements.
+ lastRunStart = 0;
+ lastRunEnd = bidi.getRunLimit(r);
+ lastRunLevel = bidi.getRunLevel(r);
+ newEls.add(new BidiElement(bidiRoot,
+ prevEl.getStartOffset(),
+ start, prevElLevel));
+ }
+ else
+ {
+ // Simply start new run at start location.
+ lastRunStart = 0;
+ lastRunEnd = bidi.getRunLimit(r);
+ lastRunLevel = bidi.getRunLevel(r);
+ removeFrom++;
+ }
+ }
+ else
+ {
+ // Simply start new run at start location.
+ lastRunStart = 0;
+ lastRunEnd = bidi.getRunLimit(r);
+ lastRunLevel = bidi.getRunLevel(r);
+ removeFrom = 0;
+ }
+ }
+ if (i == bidis.length - 1 && r == numRuns - 1)
{
- documentCV.wait();
+ if (end <= getLength())
+ {
+ // Try to merge last element with next element.
+ int nextIndex = bidiRoot.getElementIndex(end);
+ Element nextEl = bidiRoot.getElement(nextIndex);
+ AttributeSet atts = nextEl.getAttributes();
+ int nextLevel = StyleConstants.getBidiLevel(atts);
+ int level = bidi.getRunLevel(r);
+ if (lastRunLevel == level && level == nextLevel)
+ {
+ // Merge runs together.
+ if (lastRunStart + start == nextEl.getStartOffset())
+ removeTo = nextIndex - 1;
+ else
+ {
+ newEls.add(new BidiElement(bidiRoot, start + lastRunStart,
+ nextEl.getEndOffset(), level));
+ removeTo = nextIndex;
+ }
+ }
+ else if (lastRunLevel == level)
+ {
+ // Merge current and last run.
+ int endOffs = offs + bidi.getRunLimit(r);
+ newEls.add(new BidiElement(bidiRoot, start + lastRunStart,
+ start + endOffs, level));
+ if (start + endOffs == nextEl.getStartOffset())
+ removeTo = nextIndex - 1;
+ else
+ {
+ newEls.add(new BidiElement(bidiRoot, start + endOffs,
+ nextEl.getEndOffset(),
+ nextLevel));
+ removeTo = nextIndex;
+ }
+ }
+ else if (level == nextLevel)
+ {
+ // Merge current and next run.
+ newEls.add(new BidiElement(bidiRoot, start + lastRunStart,
+ start + lastRunEnd,
+ lastRunLevel));
+ newEls.add(new BidiElement(bidiRoot, start + lastRunEnd,
+ nextEl.getEndOffset(), level));
+ removeTo = nextIndex;
+ }
+ else
+ {
+ // Split next element.
+ int endOffs = offs + bidi.getRunLimit(r);
+ newEls.add(new BidiElement(bidiRoot, start + lastRunStart,
+ start + lastRunEnd,
+ lastRunLevel));
+ newEls.add(new BidiElement(bidiRoot, start + lastRunEnd,
+ start + endOffs, level));
+ newEls.add(new BidiElement(bidiRoot, start + endOffs,
+ nextEl.getEndOffset(),
+ nextLevel));
+ removeTo = nextIndex;
+ }
+ }
+ else
+ {
+ removeTo = bidiRoot.getElementIndex(end);
+ int level = bidi.getRunLevel(r);
+ int runEnd = offs + bidi.getRunLimit(r);
+
+ if (level == lastRunLevel)
+ {
+ // Merge with previous.
+ lastRunEnd = offs + runEnd;
+ newEls.add(new BidiElement(bidiRoot,
+ start + lastRunStart,
+ start + runEnd, level));
+ }
+ else
+ {
+ // Create element for last run and current run.
+ newEls.add(new BidiElement(bidiRoot, start + lastRunStart,
+ start + lastRunEnd,
+ lastRunLevel));
+ newEls.add(new BidiElement(bidiRoot,
+ start + lastRunEnd,
+ start + runEnd,
+ level));
+ }
+ }
}
- catch (InterruptedException ie)
+ else
{
- throw new Error("interrupted trying to get a readLock");
+ int level = bidi.getRunLevel(r);
+ int runEnd = bidi.getRunLimit(r);
+
+ if (level == lastRunLevel)
+ {
+ // Merge with previous.
+ lastRunEnd = offs + runEnd;
+ }
+ else
+ {
+ // Create element for last run and update values for
+ // current run.
+ newEls.add(new BidiElement(bidiRoot, start + lastRunStart,
+ start + lastRunEnd,
+ lastRunLevel));
+ lastRunStart = lastRunEnd;
+ lastRunEnd = offs + runEnd;
+ lastRunLevel = level;
+ }
}
}
- numReaders++;
+ offs += bidi.getLength();
+ }
+
+ // Determine the bidi elements which are to be removed.
+ int numRemoved = 0;
+ if (bidiRoot.getElementCount() > 0)
+ numRemoved = removeTo - removeFrom + 1;
+ Element[] removed = new Element[numRemoved];
+ for (int i = 0; i < numRemoved; i++)
+ removed[i] = bidiRoot.getElement(removeFrom + i);
+
+ Element[] added = new Element[newEls.size()];
+ added = (Element[]) newEls.toArray(added);
+
+ // Update the event.
+ ElementEdit edit = new ElementEdit(bidiRoot, removeFrom, removed, added);
+ ev.addEdit(edit);
+
+ // Update the structure.
+ bidiRoot.replace(removeFrom, numRemoved, added);
+ }
+
+ /**
+ * Determines the Bidi objects for the paragraphs in the specified range.
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ *
+ * @return the Bidi analysers for the paragraphs in the range
+ */
+ private Bidi[] getBidis(int start, int end)
+ {
+ // Determine the default run direction from the document property.
+ Boolean defaultDir = null;
+ Object o = getProperty(TextAttribute.RUN_DIRECTION);
+ if (o instanceof Boolean)
+ defaultDir = (Boolean) o;
+
+ // Scan paragraphs and add their level arrays to the overall levels array.
+ ArrayList bidis = new ArrayList();
+ Segment s = new Segment();
+ for (int i = start; i < end;)
+ {
+ Element par = getParagraphElement(i);
+ int pStart = par.getStartOffset();
+ int pEnd = par.getEndOffset();
+
+ // Determine the default run direction of the paragraph.
+ Boolean dir = defaultDir;
+ o = par.getAttributes().getAttribute(TextAttribute.RUN_DIRECTION);
+ if (o instanceof Boolean)
+ dir = (Boolean) o;
+
+ // Bidi over the paragraph.
+ try
+ {
+ getText(pStart, pEnd - pStart, s);
+ }
+ catch (BadLocationException ex)
+ {
+ assert false : "Must not happen";
+ }
+ int flag = Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT;
+ if (dir != null)
+ {
+ if (TextAttribute.RUN_DIRECTION_LTR.equals(dir))
+ flag = Bidi.DIRECTION_LEFT_TO_RIGHT;
+ else
+ flag = Bidi.DIRECTION_RIGHT_TO_LEFT;
+ }
+ Bidi bidi = new Bidi(s.array, s.offset, null, 0, s.count, flag);
+ bidis.add(bidi);
+ i = pEnd;
+ }
+ Bidi[] ret = new Bidi[bidis.size()];
+ ret = (Bidi[]) bidis.toArray(ret);
+ return ret;
+ }
+
+ /**
+ * Blocks until a read lock can be obtained. Must block if there is
+ * currently a writer modifying the <code>Document</code>.
+ */
+ public final synchronized void readLock()
+ {
+ try
+ {
+ while (currentWriter != null)
+ {
+ if (currentWriter == Thread.currentThread())
+ return;
+ wait();
+ }
+ numReaders++;
+ }
+ catch (InterruptedException ex)
+ {
+ throw new Error("Interrupted during grab read lock");
}
}
@@ -679,7 +1069,7 @@ public abstract class AbstractDocument implements Document, Serializable
* Releases the read lock. If this was the only reader on this
* <code>Document</code>, writing may begin now.
*/
- public final void readUnlock()
+ public final synchronized void readUnlock()
{
// Note we could have a problem here if readUnlock was called without a
// prior call to readLock but the specs simply warn users to ensure that
@@ -706,21 +1096,14 @@ public abstract class AbstractDocument implements Document, Serializable
// FIXME: the reference implementation throws a
// javax.swing.text.StateInvariantError here
- if (numReaders == 0)
+ if (numReaders <= 0)
throw new IllegalStateException("document lock failure");
- synchronized (documentCV)
- {
- // If currentWriter is not null, the application code probably had a
- // writeLock and then tried to obtain a readLock, in which case
- // numReaders wasn't incremented
- if (currentWriter == null)
- {
- numReaders --;
- if (numReaders == 0 && numWritersWaiting != 0)
- documentCV.notify();
- }
- }
+ // If currentWriter is not null, the application code probably had a
+ // writeLock and then tried to obtain a readLock, in which case
+ // numReaders wasn't incremented
+ numReaders--;
+ notify();
}
/**
@@ -744,12 +1127,21 @@ public abstract class AbstractDocument implements Document, Serializable
*/
public void remove(int offset, int length) throws BadLocationException
{
- if (documentFilter == null)
- removeImpl(offset, length);
- else
- documentFilter.remove(getBypass(), offset, length);
+ writeLock();
+ try
+ {
+ DocumentFilter f = getDocumentFilter();
+ if (f == null)
+ removeImpl(offset, length);
+ else
+ f.remove(getBypass(), offset, length);
+ }
+ finally
+ {
+ writeUnlock();
+ }
}
-
+
void removeImpl(int offset, int length) throws BadLocationException
{
// The RI silently ignores all requests that have a negative length.
@@ -766,21 +1158,12 @@ public abstract class AbstractDocument implements Document, Serializable
new DefaultDocumentEvent(offset, length,
DocumentEvent.EventType.REMOVE);
- try
- {
- writeLock();
-
- // The order of the operations below is critical!
- removeUpdate(event);
- UndoableEdit temp = content.remove(offset, length);
-
- postRemoveUpdate(event);
- fireRemoveUpdate(event);
- }
- finally
- {
- writeUnlock();
- }
+ // The order of the operations below is critical!
+ removeUpdate(event);
+ UndoableEdit temp = content.remove(offset, length);
+
+ postRemoveUpdate(event);
+ fireRemoveUpdate(event);
}
}
@@ -814,21 +1197,28 @@ public abstract class AbstractDocument implements Document, Serializable
if (length == 0
&& (text == null || text.length() == 0))
return;
-
- if (documentFilter == null)
+
+ writeLock();
+ try
{
- // It is important to call the methods which again do the checks
- // of the arguments and the DocumentFilter because subclasses may
- // have overridden these methods and provide crucial behavior
- // which would be skipped if we call the non-checking variants.
- // An example for this is PlainDocument where insertString can
- // provide a filtering of newlines.
- remove(offset, length);
- insertString(offset, text, attributes);
+ if (documentFilter == null)
+ {
+ // It is important to call the methods which again do the checks
+ // of the arguments and the DocumentFilter because subclasses may
+ // have overridden these methods and provide crucial behavior
+ // which would be skipped if we call the non-checking variants.
+ // An example for this is PlainDocument where insertString can
+ // provide a filtering of newlines.
+ remove(offset, length);
+ insertString(offset, text, attributes);
+ }
+ else
+ documentFilter.replace(getBypass(), offset, length, text, attributes);
+ }
+ finally
+ {
+ writeUnlock();
}
- else
- documentFilter.replace(getBypass(), offset, length, text, attributes);
-
}
void replaceImpl(int offset, int length, String text,
@@ -948,7 +1338,8 @@ public abstract class AbstractDocument implements Document, Serializable
*/
public void setAsynchronousLoadPriority(int p)
{
- // TODO: Implement this properly.
+ Integer val = p >= 0 ? new Integer(p) : null;
+ putProperty(AsyncLoadPriority, val);
}
/**
@@ -956,7 +1347,7 @@ public abstract class AbstractDocument implements Document, Serializable
*
* @param p the document properties to set
*/
- public void setDocumentProperties(Dictionary p)
+ public void setDocumentProperties(Dictionary<Object, Object> p)
{
// FIXME: make me thread-safe
properties = p;
@@ -966,26 +1357,27 @@ public abstract class AbstractDocument implements Document, Serializable
* Blocks until a write lock can be obtained. Must wait if there are
* readers currently reading or another thread is currently writing.
*/
- protected final void writeLock()
+ protected synchronized final void writeLock()
{
- if (currentWriter != null && currentWriter.equals(Thread.currentThread()))
- return;
- synchronized (documentCV)
+ try
{
- numWritersWaiting++;
- while (numReaders > 0)
+ while (numReaders > 0 || currentWriter != null)
{
- try
- {
- documentCV.wait();
- }
- catch (InterruptedException ie)
+ if (Thread.currentThread() == currentWriter)
{
- throw new Error("interruped while trying to obtain write lock");
+ if (notifyListeners)
+ throw new IllegalStateException("Mutation during notify");
+ numWriters++;
+ return;
}
+ wait();
}
- numWritersWaiting --;
currentWriter = Thread.currentThread();
+ numWriters = 1;
+ }
+ catch (InterruptedException ex)
+ {
+ throw new Error("Interupted during grab write lock");
}
}
@@ -993,16 +1385,14 @@ public abstract class AbstractDocument implements Document, Serializable
* Releases the write lock. This allows waiting readers or writers to
* obtain the lock.
*/
- protected final void writeUnlock()
+ protected final synchronized void writeUnlock()
{
- synchronized (documentCV)
- {
- if (Thread.currentThread().equals(currentWriter))
- {
- currentWriter = null;
- documentCV.notifyAll();
- }
- }
+ if (--numWriters <= 0)
+ {
+ numWriters = 0;
+ currentWriter = null;
+ notifyAll();
+ }
}
/**
@@ -1039,6 +1429,7 @@ public abstract class AbstractDocument implements Document, Serializable
public void dump(PrintStream out)
{
((AbstractElement) getDefaultRootElement()).dump(out, 0);
+ ((AbstractElement) getBidiRootElement()).dump(out, 0);
}
/**
@@ -1130,7 +1521,7 @@ public abstract class AbstractDocument implements Document, Serializable
* @return the attributes of <code>old</code> minus the attributes in
* <code>attributes</code>
*/
- AttributeSet removeAttributes(AttributeSet old, Enumeration names);
+ AttributeSet removeAttributes(AttributeSet old, Enumeration<?> names);
}
/**
@@ -1255,7 +1646,7 @@ public abstract class AbstractDocument implements Document, Serializable
AttributeContext ctx = getAttributeContext();
attributes = ctx.getEmptySet();
if (s != null)
- attributes = ctx.addAttributes(attributes, s);
+ addAttributes(s);
}
/**
@@ -1386,7 +1777,7 @@ public abstract class AbstractDocument implements Document, Serializable
*
* @param names the names of the attributes to be removed
*/
- public void removeAttributes(Enumeration names)
+ public void removeAttributes(Enumeration<?> names)
{
attributes = getAttributeContext().removeAttributes(attributes, names);
}
@@ -1481,7 +1872,7 @@ public abstract class AbstractDocument implements Document, Serializable
*
* @return the names of the attributes of this element
*/
- public Enumeration getAttributeNames()
+ public Enumeration<?> getAttributeNames()
{
return attributes.getAttributeNames();
}
@@ -1567,7 +1958,7 @@ public abstract class AbstractDocument implements Document, Serializable
*/
public String getName()
{
- return (String) getAttribute(NameAttribute);
+ return (String) attributes.getAttribute(ElementNameAttribute);
}
/**
@@ -1644,6 +2035,11 @@ public abstract class AbstractDocument implements Document, Serializable
b.append('\n');
}
}
+ if (getAttributeCount() > 0)
+ {
+ for (int i = 0; i < indent; ++i)
+ b.append(' ');
+ }
b.append(">\n");
// Dump element content for leaf elements.
@@ -1705,6 +2101,11 @@ public abstract class AbstractDocument implements Document, Serializable
private int numChildren;
/**
+ * The last found index in getElementIndex(). Used for faster searching.
+ */
+ private int lastIndex;
+
+ /**
* Creates a new <code>BranchElement</code> with the specified
* parent and attributes.
*
@@ -1717,6 +2118,7 @@ public abstract class AbstractDocument implements Document, Serializable
super(parent, attributes);
children = new Element[1];
numChildren = 0;
+ lastIndex = -1;
}
/**
@@ -1726,7 +2128,7 @@ public abstract class AbstractDocument implements Document, Serializable
*/
public Enumeration children()
{
- if (children.length == 0)
+ if (numChildren == 0)
return null;
Vector tmp = new Vector();
@@ -1785,35 +2187,73 @@ public abstract class AbstractDocument implements Document, Serializable
*/
public int getElementIndex(int offset)
{
- // If offset is less than the start offset of our first child,
- // return 0
- if (offset < getStartOffset())
- return 0;
+ // Implemented using an improved linear search.
+ // This makes use of the fact that searches are not random but often
+ // close to the previous search. So we try to start the binary
+ // search at the last found index.
- // XXX: There is surely a better algorithm
- // as beginning from first element each time.
- for (int index = 0; index < numChildren - 1; ++index)
+ int i0 = 0; // The lower bounds.
+ int i1 = numChildren - 1; // The upper bounds.
+ int index = -1; // The found index.
+
+ int p0 = getStartOffset();
+ int p1; // Start and end offset local variables.
+
+ if (numChildren == 0)
+ index = 0;
+ else if (offset >= getEndOffset())
+ index = numChildren - 1;
+ else
{
- Element elem = children[index];
-
- if ((elem.getStartOffset() <= offset)
- && (offset < elem.getEndOffset()))
- return index;
- // If the next element's start offset is greater than offset
- // then we have to return the closest Element, since no Elements
- // will contain the offset
- if (children[index + 1].getStartOffset() > offset)
+ // Try lastIndex.
+ if (lastIndex >= i0 && lastIndex <= i1)
{
- if ((offset - elem.getEndOffset()) > (children[index + 1].getStartOffset() - offset))
- return index + 1;
+ Element last = getElement(lastIndex);
+ p0 = last.getStartOffset();
+ p1 = last.getEndOffset();
+ if (offset >= p0 && offset < p1)
+ index = lastIndex;
else
- return index;
+ {
+ // Narrow the search bounds using the lastIndex, even
+ // if it hasn't been a hit.
+ if (offset < p0)
+ i1 = lastIndex;
+ else
+ i0 = lastIndex;
+ }
+ }
+ // The actual search.
+ int i = 0;
+ while (i0 <= i1 && index == -1)
+ {
+ i = i0 + (i1 - i0) / 2;
+ Element el = getElement(i);
+ p0 = el.getStartOffset();
+ p1 = el.getEndOffset();
+ if (offset >= p0 && offset < p1)
+ {
+ // Found it!
+ index = i;
+ }
+ else if (offset < p0)
+ i1 = i - 1;
+ else
+ i0 = i + 1;
}
- }
- // If offset is greater than the index of the last element, return
- // the index of the last element.
- return getElementCount() - 1;
+ if (index == -1)
+ {
+ // Didn't find it. Return the boundary index.
+ if (offset < p0)
+ index = i;
+ else
+ index = i + 1;
+ }
+
+ lastIndex = index;
+ }
+ return index;
}
/**
@@ -1957,6 +2397,11 @@ public abstract class AbstractDocument implements Document, Serializable
/** The serialization UID (compatible with JDK1.5). */
private static final long serialVersionUID = 5230037221564563284L;
+ /**
+ * The threshold that indicates when we switch to using a Hashtable.
+ */
+ private static final int THRESHOLD = 10;
+
/** The starting offset of the change. */
private int offset;
@@ -1967,15 +2412,18 @@ public abstract class AbstractDocument implements Document, Serializable
private DocumentEvent.EventType type;
/**
- * Maps <code>Element</code> to their change records.
+ * Maps <code>Element</code> to their change records. This is only
+ * used when the changes array gets too big. We can use an
+ * (unsync'ed) HashMap here, since changes to this are (should) always
+ * be performed inside a write lock.
*/
- Hashtable changes;
+ private HashMap changes;
/**
* Indicates if this event has been modified or not. This is used to
* determine if this event is thrown.
*/
- boolean modified;
+ private boolean modified;
/**
* Creates a new <code>DefaultDocumentEvent</code>.
@@ -1990,7 +2438,6 @@ public abstract class AbstractDocument implements Document, Serializable
this.offset = offset;
this.length = length;
this.type = type;
- changes = new Hashtable();
modified = false;
}
@@ -2004,9 +2451,27 @@ public abstract class AbstractDocument implements Document, Serializable
public boolean addEdit(UndoableEdit edit)
{
// XXX - Fully qualify ElementChange to work around gcj bug #2499.
- if (edit instanceof DocumentEvent.ElementChange)
+
+ // Start using Hashtable when we pass a certain threshold. This
+ // gives a good memory/performance compromise.
+ if (changes == null && edits.size() > THRESHOLD)
+ {
+ changes = new HashMap();
+ int count = edits.size();
+ for (int i = 0; i < count; i++)
+ {
+ Object o = edits.elementAt(i);
+ if (o instanceof DocumentEvent.ElementChange)
+ {
+ DocumentEvent.ElementChange ec =
+ (DocumentEvent.ElementChange) o;
+ changes.put(ec.getElement(), ec);
+ }
+ }
+ }
+
+ if (changes != null && edit instanceof DocumentEvent.ElementChange)
{
- modified = true;
DocumentEvent.ElementChange elEdit =
(DocumentEvent.ElementChange) edit;
changes.put(elEdit.getElement(), elEdit);
@@ -2065,7 +2530,27 @@ public abstract class AbstractDocument implements Document, Serializable
public DocumentEvent.ElementChange getChange(Element elem)
{
// XXX - Fully qualify ElementChange to work around gcj bug #2499.
- return (DocumentEvent.ElementChange) changes.get(elem);
+ DocumentEvent.ElementChange change = null;
+ if (changes != null)
+ {
+ change = (DocumentEvent.ElementChange) changes.get(elem);
+ }
+ else
+ {
+ int count = edits.size();
+ for (int i = 0; i < count && change == null; i++)
+ {
+ Object o = edits.get(i);
+ if (o instanceof DocumentEvent.ElementChange)
+ {
+ DocumentEvent.ElementChange ec =
+ (DocumentEvent.ElementChange) o;
+ if (elem.equals(ec.getElement()))
+ change = ec;
+ }
+ }
+ }
+ return change;
}
/**
@@ -2333,7 +2818,63 @@ public abstract class AbstractDocument implements Document, Serializable
+ getStartOffset() + "," + getEndOffset() + "\n");
}
}
-
+
+ /**
+ * The root element for bidirectional text.
+ */
+ private class BidiRootElement
+ extends BranchElement
+ {
+ /**
+ * Creates a new bidi root element.
+ */
+ BidiRootElement()
+ {
+ super(null, null);
+ }
+
+ /**
+ * Returns the name of the element.
+ *
+ * @return the name of the element
+ */
+ public String getName()
+ {
+ return BidiRootName;
+ }
+ }
+
+ /**
+ * A leaf element for the bidi structure.
+ */
+ private class BidiElement
+ extends LeafElement
+ {
+ /**
+ * Creates a new BidiElement.
+ *
+ * @param parent the parent element
+ * @param start the start offset
+ * @param end the end offset
+ * @param level the bidi level
+ */
+ BidiElement(Element parent, int start, int end, int level)
+ {
+ super(parent, new SimpleAttributeSet(), start, end);
+ addAttribute(StyleConstants.BidiLevel, new Integer(level));
+ }
+
+ /**
+ * Returns the name of the element.
+ *
+ * @return the name of the element
+ */
+ public String getName()
+ {
+ return BidiElementName;
+ }
+ }
+
/** A class whose methods delegate to the insert, remove and replace methods
* of this document which do not check for an installed DocumentFilter.
*/
diff --git a/libjava/classpath/javax/swing/text/AttributeSet.java b/libjava/classpath/javax/swing/text/AttributeSet.java
index 01d148c067b..2d39881c28b 100644
--- a/libjava/classpath/javax/swing/text/AttributeSet.java
+++ b/libjava/classpath/javax/swing/text/AttributeSet.java
@@ -158,7 +158,7 @@ public interface AttributeSet
* @return the names of the attributes that are stored in this
* <code>AttributeSet</code>
*/
- Enumeration getAttributeNames();
+ Enumeration<?> getAttributeNames();
/**
* Returns the resolving parent of this <code>AttributeSet</code>.
diff --git a/libjava/classpath/javax/swing/text/BoxView.java b/libjava/classpath/javax/swing/text/BoxView.java
index 27e3c0f9a1b..0754d9b9b8b 100644
--- a/libjava/classpath/javax/swing/text/BoxView.java
+++ b/libjava/classpath/javax/swing/text/BoxView.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.swing.text;
+import java.awt.Container;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.Shape;
@@ -92,11 +93,6 @@ public class BoxView
private int[] span = new int[2];
/**
- * The SizeRequirements of the child views along the X_AXIS and Y_AXIS.
- */
- private SizeRequirements[][] childReqs = new SizeRequirements[2][];
-
- /**
* Creates a new <code>BoxView</code> for the given
* <code>Element</code> and axis. Valid values for the axis are
* {@link View#X_AXIS} and {@link View#Y_AXIS}.
@@ -110,6 +106,8 @@ public class BoxView
myAxis = axis;
layoutValid[0] = false;
layoutValid[1] = false;
+ requirementsValid[X_AXIS] = false;
+ requirementsValid[Y_AXIS] = false;
span[0] = 0;
span[1] = 0;
requirements[0] = new SizeRequirements();
@@ -146,7 +144,10 @@ public class BoxView
*/
public void setAxis(int axis)
{
+ boolean changed = axis != myAxis;
myAxis = axis;
+ if (changed)
+ preferenceChanged(null, true, true);
}
/**
@@ -227,56 +228,49 @@ public class BoxView
*/
public void replace(int offset, int length, View[] views)
{
- int numViews = 0;
- if (views != null)
- numViews = views.length;
+ // Actually perform the replace.
+ super.replace(offset, length, views);
// Resize and copy data for cache arrays.
- // The spansX cache.
- int oldSize = getViewCount();
-
- int[] newSpansX = new int[oldSize - length + numViews];
- System.arraycopy(spans[X_AXIS], 0, newSpansX, 0, offset);
- System.arraycopy(spans[X_AXIS], offset + length, newSpansX,
- offset + numViews,
- oldSize - (offset + length));
- spans[X_AXIS] = newSpansX;
-
- // The spansY cache.
- int[] newSpansY = new int[oldSize - length + numViews];
- System.arraycopy(spans[Y_AXIS], 0, newSpansY, 0, offset);
- System.arraycopy(spans[Y_AXIS], offset + length, newSpansY,
- offset + numViews,
- oldSize - (offset + length));
- spans[Y_AXIS] = newSpansY;
-
- // The offsetsX cache.
- int[] newOffsetsX = new int[oldSize - length + numViews];
- System.arraycopy(offsets[X_AXIS], 0, newOffsetsX, 0, offset);
- System.arraycopy(offsets[X_AXIS], offset + length, newOffsetsX,
- offset + numViews,
- oldSize - (offset + length));
- offsets[X_AXIS] = newOffsetsX;
-
- // The offsetsY cache.
- int[] newOffsetsY = new int[oldSize - length + numViews];
- System.arraycopy(offsets[Y_AXIS], 0, newOffsetsY, 0, offset);
- System.arraycopy(offsets[Y_AXIS], offset + length, newOffsetsY,
- offset + numViews,
- oldSize - (offset + length));
- offsets[Y_AXIS] = newOffsetsY;
+ int newItems = views != null ? views.length : 0;
+ int minor = 1 - myAxis;
+ offsets[myAxis] = replaceLayoutArray(offsets[myAxis], offset, newItems);
+ spans[myAxis] = replaceLayoutArray(spans[myAxis], offset, newItems);
+ layoutValid[myAxis] = false;
+ requirementsValid[myAxis] = false;
+ offsets[minor] = replaceLayoutArray(offsets[minor], offset, newItems);
+ spans[minor] = replaceLayoutArray(spans[minor], offset, newItems);
+ layoutValid[minor] = false;
+ requirementsValid[minor] = false;
+ }
- // Actually perform the replace.
- super.replace(offset, length, views);
+ /**
+ * Helper method. This updates the layout cache arrays in response
+ * to a call to {@link #replace(int, int, View[])}.
+ *
+ * @param oldArray the old array
+ *
+ * @return the replaced array
+ */
+ private int[] replaceLayoutArray(int[] oldArray, int offset, int newItems)
- // Invalidate layout information.
- layoutValid[X_AXIS] = false;
- requirementsValid[X_AXIS] = false;
- layoutValid[Y_AXIS] = false;
- requirementsValid[Y_AXIS] = false;
+ {
+ int num = getViewCount();
+ int[] newArray = new int[num];
+ System.arraycopy(oldArray, 0, newArray, 0, offset);
+ System.arraycopy(oldArray, offset, newArray, offset + newItems,
+ num - newItems - offset);
+ return newArray;
}
/**
+ * A Rectangle instance to be reused in the paint() method below.
+ */
+ private final Rectangle tmpRect = new Rectangle();
+
+ private Rectangle clipRect = new Rectangle();
+
+ /**
* Renders the <code>Element</code> that is associated with this
* <code>View</code>.
*
@@ -285,26 +279,20 @@ public class BoxView
*/
public void paint(Graphics g, Shape a)
{
- Rectangle alloc;
- if (a instanceof Rectangle)
- alloc = (Rectangle) a;
- else
- alloc = a.getBounds();
+ // Try to avoid allocation if possible (almost all cases).
+ Rectangle alloc = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
- int x = alloc.x + getLeftInset();
- int y = alloc.y + getTopInset();
+ // This returns a cached instance.
+ alloc = getInsideAllocation(alloc);
- Rectangle clip = g.getClipBounds();
- Rectangle tmp = new Rectangle();
int count = getViewCount();
- for (int i = 0; i < count; ++i)
+ for (int i = 0; i < count; i++)
{
- tmp.x = x + getOffset(X_AXIS, i);
- tmp.y = y + getOffset(Y_AXIS, i);
- tmp.width = getSpan(X_AXIS, i);
- tmp.height = getSpan(Y_AXIS, i);
- if (tmp.intersects(clip))
- paintChild(g, tmp, i);
+ View child = getView(i);
+ tmpRect.setBounds(alloc);
+ childAllocation(i, tmpRect);
+ if (g.hitClip(tmpRect.x, tmpRect.y, tmpRect.width, tmpRect.height))
+ paintChild(g, tmpRect, i);
}
}
@@ -373,9 +361,9 @@ public class BoxView
}
/**
- * This method is obsolete and no longer in use. It is replaced by
- * {@link #calculateMajorAxisRequirements(int, SizeRequirements)} and
- * {@link #calculateMinorAxisRequirements(int, SizeRequirements)}.
+ * Calculates size requirements for a baseline layout. This is not
+ * used by the BoxView itself, but by subclasses that wish to perform
+ * a baseline layout, like the FlowView's rows.
*
* @param axis the axis that is examined
* @param sr the <code>SizeRequirements</code> object to hold the result,
@@ -387,50 +375,94 @@ public class BoxView
protected SizeRequirements baselineRequirements(int axis,
SizeRequirements sr)
{
- updateChildRequirements(axis);
+ // Create new instance if sr == null.
+ if (sr == null)
+ sr = new SizeRequirements();
+ sr.alignment = 0.5F;
+
+ // Calculate overall ascent and descent.
+ int totalAscentMin = 0;
+ int totalAscentPref = 0;
+ int totalAscentMax = 0;
+ int totalDescentMin = 0;
+ int totalDescentPref = 0;
+ int totalDescentMax = 0;
+
+ int count = getViewCount();
+ for (int i = 0; i < count; i++)
+ {
+ View v = getView(i);
+ float align = v.getAlignment(axis);
+ int span = (int) v.getPreferredSpan(axis);
+ int ascent = (int) (align * span);
+ int descent = span - ascent;
+
+ totalAscentPref = Math.max(ascent, totalAscentPref);
+ totalDescentPref = Math.max(descent, totalDescentPref);
+ if (v.getResizeWeight(axis) > 0)
+ {
+ // If the view is resizable, then use the min and max size
+ // of the view.
+ span = (int) v.getMinimumSpan(axis);
+ ascent = (int) (align * span);
+ descent = span - ascent;
+ totalAscentMin = Math.max(ascent, totalAscentMin);
+ totalDescentMin = Math.max(descent, totalDescentMin);
+
+ span = (int) v.getMaximumSpan(axis);
+ ascent = (int) (align * span);
+ descent = span - ascent;
+ totalAscentMax = Math.max(ascent, totalAscentMax);
+ totalDescentMax = Math.max(descent, totalDescentMax);
+ }
+ else
+ {
+ // If the view is not resizable, use the preferred span.
+ totalAscentMin = Math.max(ascent, totalAscentMin);
+ totalDescentMin = Math.max(descent, totalDescentMin);
+ totalAscentMax = Math.max(ascent, totalAscentMax);
+ totalDescentMax = Math.max(descent, totalDescentMax);
+ }
+ }
- SizeRequirements res = sr;
- if (res == null)
- res = new SizeRequirements();
+ // Preferred overall span is the sum of the preferred ascent and descent.
+ // With overflow check.
+ sr.preferred = (int) Math.min((long) totalAscentPref
+ + (long) totalDescentPref,
+ Integer.MAX_VALUE);
+
+ // Align along the baseline.
+ if (sr.preferred > 0)
+ sr.alignment = (float) totalAscentPref / sr.preferred;
- float minLeft = 0;
- float minRight = 0;
- float prefLeft = 0;
- float prefRight = 0;
- float maxLeft = 0;
- float maxRight = 0;
- for (int i = 0; i < childReqs[axis].length; i++)
+ if (sr.alignment == 0)
{
- float myMinLeft = childReqs[axis][i].minimum * childReqs[axis][i].alignment;
- float myMinRight = childReqs[axis][i].minimum - myMinLeft;
- minLeft = Math.max(myMinLeft, minLeft);
- minRight = Math.max(myMinRight, minRight);
- float myPrefLeft = childReqs[axis][i].preferred * childReqs[axis][i].alignment;
- float myPrefRight = childReqs[axis][i].preferred - myPrefLeft;
- prefLeft = Math.max(myPrefLeft, prefLeft);
- prefRight = Math.max(myPrefRight, prefRight);
- float myMaxLeft = childReqs[axis][i].maximum * childReqs[axis][i].alignment;
- float myMaxRight = childReqs[axis][i].maximum - myMaxLeft;
- maxLeft = Math.max(myMaxLeft, maxLeft);
- maxRight = Math.max(myMaxRight, maxRight);
+ // Nothing above the baseline, use the descent.
+ sr.minimum = totalDescentMin;
+ sr.maximum = totalDescentMax;
}
- int minSize = (int) (minLeft + minRight);
- int prefSize = (int) (prefLeft + prefRight);
- int maxSize = (int) (maxLeft + maxRight);
- float align = prefLeft / (prefRight + prefLeft);
- if (Float.isNaN(align))
- align = 0;
-
- res.alignment = align;
- res.maximum = maxSize;
- res.preferred = prefSize;
- res.minimum = minSize;
- return res;
+ else if (sr.alignment == 1.0F)
+ {
+ // Nothing below the baseline, use the descent.
+ sr.minimum = totalAscentMin;
+ sr.maximum = totalAscentMax;
+ }
+ else
+ {
+ sr.minimum = Math.max((int) (totalAscentMin / sr.alignment),
+ (int) (totalDescentMin / (1.0F - sr.alignment)));
+ sr.maximum = Math.min((int) (totalAscentMax / sr.alignment),
+ (int) (totalDescentMax / (1.0F - sr.alignment)));
+ }
+ return sr;
}
/**
- * Calculates the layout of the children of this <code>BoxView</code> along
- * the specified axis.
+ * Calculates the baseline layout of the children of this
+ * <code>BoxView</code> along the specified axis.
+ *
+ * This is not used by the BoxView itself, but by subclasses that wish to
+ * perform a baseline layout, like the FlowView's rows.
*
* @param span the target span
* @param axis the axis that is examined
@@ -440,13 +472,36 @@ public class BoxView
protected void baselineLayout(int span, int axis, int[] offsets,
int[] spans)
{
- updateChildRequirements(axis);
- updateRequirements(axis);
+ int totalAscent = (int) (span * getAlignment(axis));
+ int totalDescent = span - totalAscent;
- // Calculate the spans and offsets using the SizeRequirements uility
- // methods.
- SizeRequirements.calculateAlignedPositions(span, requirements[axis],
- childReqs[axis], offsets, spans);
+ int count = getViewCount();
+ for (int i = 0; i < count; i++)
+ {
+ View v = getView(i);
+ float align = v.getAlignment(axis);
+ int viewSpan;
+ if (v.getResizeWeight(axis) > 0)
+ {
+ // If possible, then resize for best fit.
+ int min = (int) v.getMinimumSpan(axis);
+ int max = (int) v.getMaximumSpan(axis);
+ if (align == 0.0F)
+ viewSpan = Math.max(Math.min(max, totalDescent), min);
+ else if (align == 1.0F)
+ viewSpan = Math.max(Math.min(max, totalAscent), min);
+ else
+ {
+ int fit = (int) Math.min(totalAscent / align,
+ totalDescent / (1.0F - align));
+ viewSpan = Math.max(Math.min(max, fit), min);
+ }
+ }
+ else
+ viewSpan = (int) v.getPreferredSpan(axis);
+ offsets[i] = totalAscent - (int) (viewSpan * align);
+ spans[i] = viewSpan;
+ }
}
/**
@@ -476,8 +531,8 @@ public class BoxView
{
View child = getView(i);
min += child.getMinimumSpan(axis);
- pref = child.getPreferredSpan(axis);
- max = child.getMaximumSpan(axis);
+ pref += child.getPreferredSpan(axis);
+ max += child.getMaximumSpan(axis);
}
res.minimum = (int) min;
@@ -509,7 +564,7 @@ public class BoxView
res.minimum = 0;
res.preferred = 0;
- res.maximum = 0;
+ res.maximum = Integer.MAX_VALUE;
res.alignment = 0.5F;
int n = getViewCount();
for (int i = 0; i < n; i++)
@@ -568,9 +623,9 @@ public class BoxView
boolean result = false;
if (myAxis == X_AXIS)
- result = x > r.x;
+ result = x > r.x + r.width;
else
- result = y > r.y;
+ result = y > r.y + r.height;
return result;
}
@@ -589,24 +644,54 @@ public class BoxView
{
View result = null;
int count = getViewCount();
- Rectangle copy = new Rectangle(r);
-
- for (int i = 0; i < count; ++i)
+ if (myAxis == X_AXIS)
{
- copy.setBounds(r);
- // The next call modifies copy.
- childAllocation(i, copy);
- if (copy.contains(x, y))
+ // Border case. Requested point is left from the box.
+ if (x < r.x + offsets[X_AXIS][0])
{
- // Modify r on success.
- r.setBounds(copy);
- result = getView(i);
- break;
+ childAllocation(0, r);
+ result = getView(0);
+ }
+ else
+ {
+ // Search views inside box.
+ for (int i = 0; i < count && result == null; i++)
+ {
+ if (x < r.x + offsets[X_AXIS][i])
+ {
+ childAllocation(i - 1, r);
+ result = getView(i - 1);
+ }
+ }
}
}
-
- if (result == null && count > 0)
- return getView(count - 1);
+ else // Same algorithm for Y_AXIS.
+ {
+ // Border case. Requested point is above the box.
+ if (y < r.y + offsets[Y_AXIS][0])
+ {
+ childAllocation(0, r);
+ result = getView(0);
+ }
+ else
+ {
+ // Search views inside box.
+ for (int i = 0; i < count && result == null; i++)
+ {
+ if (y < r.y + offsets[Y_AXIS][i])
+ {
+ childAllocation(i - 1, r);
+ result = getView(i - 1);
+ }
+ }
+ }
+ }
+ // Not found, other border case: point is right from or below the box.
+ if (result == null)
+ {
+ childAllocation(count - 1, r);
+ result = getView(count - 1);
+ }
return result;
}
@@ -623,9 +708,6 @@ public class BoxView
*/
protected void childAllocation(int index, Rectangle a)
{
- if (! isAllocationValid())
- layout(a.width, a.height);
-
a.x += offsets[X_AXIS][index];
a.y += offsets[Y_AXIS][index];
a.width = spans[X_AXIS][index];
@@ -643,49 +725,32 @@ public class BoxView
*/
protected void layout(int width, int height)
{
- int[] newSpan = new int[]{ width, height };
- int count = getViewCount();
-
- // Update minor axis as appropriate. We need to first update the minor
- // axis layout because that might affect the children's preferences along
- // the major axis.
- int minorAxis = myAxis == X_AXIS ? Y_AXIS : X_AXIS;
- if ((! isLayoutValid(minorAxis)) || newSpan[minorAxis] != span[minorAxis])
- {
- layoutValid[minorAxis] = false;
- span[minorAxis] = newSpan[minorAxis];
- layoutMinorAxis(span[minorAxis], minorAxis, offsets[minorAxis],
- spans[minorAxis]);
-
- // Update the child view's sizes.
- for (int i = 0; i < count; ++i)
- {
- getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]);
- }
- layoutValid[minorAxis] = true;
- }
-
+ layoutAxis(X_AXIS, width);
+ layoutAxis(Y_AXIS, height);
+ }
- // Update major axis as appropriate.
- if ((! isLayoutValid(myAxis)) || newSpan[myAxis] != span[myAxis])
+ private void layoutAxis(int axis, int s)
+ {
+ if (span[axis] != s)
+ layoutValid[axis] = false;
+ if (! layoutValid[axis])
{
- layoutValid[myAxis] = false;
- span[myAxis] = newSpan[myAxis];
- layoutMajorAxis(span[myAxis], myAxis, offsets[myAxis],
- spans[myAxis]);
+ span[axis] = s;
+ updateRequirements(axis);
+ if (axis == myAxis)
+ layoutMajorAxis(span[axis], axis, offsets[axis], spans[axis]);
+ else
+ layoutMinorAxis(span[axis], axis, offsets[axis], spans[axis]);
+ layoutValid[axis] = true;
- // Update the child view's sizes.
- for (int i = 0; i < count; ++i)
+ // Push out child layout.
+ int viewCount = getViewCount();
+ for (int i = 0; i < viewCount; i++)
{
- getView(i).setSize(spans[X_AXIS][i], spans[Y_AXIS][i]);
+ View v = getView(i);
+ v.setSize(spans[X_AXIS][i], spans[Y_AXIS][i]);
}
- layoutValid[myAxis] = true;
}
-
- if (layoutValid[myAxis] == false)
- System.err.println("WARNING: Major axis layout must be valid after layout");
- if (layoutValid[minorAxis] == false)
- System.err.println("Minor axis layout must be valid after layout");
}
/**
@@ -708,7 +773,7 @@ public class BoxView
{
View child = getView(i);
spans[i] = (int) child.getPreferredSpan(axis);
- sumPref = spans[i];
+ sumPref += spans[i];
}
// Try to adjust the spans so that we fill the targetSpan.
@@ -776,7 +841,7 @@ public class BoxView
View child = getView(i);
int max = (int) child.getMaximumSpan(axis);
if (max < targetSpan)
- {System.err.println("align: " + child);
+ {
// Align child when it can't be made as wide as the target span.
float align = child.getAlignment(axis);
offsets[i] = (int) ((targetSpan - max) * align);
@@ -811,7 +876,9 @@ public class BoxView
*/
public int getWidth()
{
- return span[X_AXIS];
+ // The RI returns the following here, however, I'd think that is a bug.
+ // return span[X_AXIS] + getLeftInset() - getRightInset();
+ return span[X_AXIS] + getLeftInset() + getRightInset();
}
/**
@@ -821,7 +888,9 @@ public class BoxView
*/
public int getHeight()
{
- return span[Y_AXIS];
+ // The RI returns the following here, however, I'd think that is a bug.
+ // return span[Y_AXIS] + getTopInset() - getBottomInset();
+ return span[Y_AXIS] + getTopInset() + getBottomInset();
}
/**
@@ -833,7 +902,8 @@ public class BoxView
*/
public void setSize(float width, float height)
{
- layout((int) width, (int) height);
+ layout((int) (width - getLeftInset() - getRightInset()),
+ (int) (height - getTopInset() - getBottomInset()));
}
/**
@@ -944,9 +1014,11 @@ public class BoxView
{
if (axis != X_AXIS && axis != Y_AXIS)
throw new IllegalArgumentException("Illegal axis argument");
- int weight = 1;
- if (axis == myAxis)
- weight = 0;
+ updateRequirements(axis);
+ int weight = 0;
+ if ((requirements[axis].preferred != requirements[axis].minimum)
+ || (requirements[axis].preferred != requirements[axis].maximum))
+ weight = 1;
return weight;
}
@@ -973,13 +1045,39 @@ public class BoxView
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent e,
Shape a, ViewFactory vf)
{
- // FIXME: What to do here?
+ boolean wasValid = isLayoutValid(myAxis);
super.forwardUpdate(ec, e, a, vf);
+ // Trigger repaint when one of the children changed the major axis.
+ if (wasValid && ! isLayoutValid(myAxis))
+ {
+ Container c = getContainer();
+ if (a != null && c != null)
+ {
+ int pos = e.getOffset();
+ int index = getViewIndexAtPosition(pos);
+ Rectangle r = getInsideAllocation(a);
+ if (myAxis == X_AXIS)
+ {
+ r.x += offsets[myAxis][index];
+ r.width -= offsets[myAxis][index];
+ }
+ else
+ {
+ r.y += offsets[myAxis][index];
+ r.height -= offsets[myAxis][index];
+ }
+ c.repaint(r.x, r.y, r.width, r.height);
+ }
+ }
}
public int viewToModel(float x, float y, Shape a, Position.Bias[] bias)
{
- // FIXME: What to do here?
+ if (! isAllocationValid())
+ {
+ Rectangle r = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
+ setSize(r.width, r.height);
+ }
return super.viewToModel(x, y, a, bias);
}
@@ -990,32 +1088,6 @@ public class BoxView
}
/**
- * Updates the child requirements along the specified axis. The requirements
- * are only updated if the layout for the specified axis is marked as
- * invalid.
- *
- * @param axis the axis to be updated
- */
- private void updateChildRequirements(int axis)
- {
- if (! isLayoutValid(axis))
- {
- int numChildren = getViewCount();
- if (childReqs[axis] == null || childReqs[axis].length != numChildren)
- childReqs[axis] = new SizeRequirements[numChildren];
- for (int i = 0; i < numChildren; ++i)
- {
- View child = getView(i);
- childReqs[axis][i] =
- new SizeRequirements((int) child.getMinimumSpan(axis),
- (int) child.getPreferredSpan(axis),
- (int) child.getMaximumSpan(axis),
- child.getAlignment(axis));
- }
- }
- }
-
- /**
* Updates the view's cached requirements along the specified axis if
* necessary. The requirements are only updated if the layout for the
* specified axis is marked as invalid.
@@ -1024,6 +1096,8 @@ public class BoxView
*/
private void updateRequirements(int axis)
{
+ if (axis != Y_AXIS && axis != X_AXIS)
+ throw new IllegalArgumentException("Illegal axis: " + axis);
if (! requirementsValid[axis])
{
if (axis == myAxis)
diff --git a/libjava/classpath/javax/swing/text/ComponentView.java b/libjava/classpath/javax/swing/text/ComponentView.java
index a7d237ab73a..8de4de60fa3 100644
--- a/libjava/classpath/javax/swing/text/ComponentView.java
+++ b/libjava/classpath/javax/swing/text/ComponentView.java
@@ -39,11 +39,11 @@ package javax.swing.text;
import java.awt.Component;
import java.awt.Container;
+import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.Shape;
-import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
/**
@@ -62,11 +62,161 @@ public class ComponentView extends View
{
/**
+ * A special container that sits between the component and the hosting
+ * container. This is used to propagate invalidate requests and cache
+ * the component's layout sizes.
+ */
+ private class Interceptor
+ extends Container
+ {
+ Dimension min;
+ Dimension pref;
+ Dimension max;
+ float alignX;
+ float alignY;
+
+ /**
+ * Creates a new instance that hosts the specified component.
+ */
+ Interceptor(Component c)
+ {
+ setLayout(null);
+ add(c);
+ cacheComponentSizes();
+ }
+
+ /**
+ * Intercepts the normal invalidate call and propagates the invalidate
+ * request up using the View's preferenceChanged().
+ */
+ public void invalidate()
+ {
+ super.invalidate();
+ if (getParent() != null)
+ preferenceChanged(null, true, true);
+ }
+
+ /**
+ * This is overridden to simply cache the layout sizes.
+ */
+ public void doLayout()
+ {
+ cacheComponentSizes();
+ }
+
+ /**
+ * Overridden to also reshape the component itself.
+ */
+ public void reshape(int x, int y, int w, int h)
+ {
+ super.reshape(x, y, w, h);
+ if (getComponentCount() > 0)
+ getComponent(0).setSize(w, h);
+ cacheComponentSizes();
+ }
+
+ /**
+ * Overridden to also show the component.
+ */
+ public void show()
+ {
+ super.show();
+ if (getComponentCount() > 0)
+ getComponent(0).setVisible(true);
+ }
+
+ /**
+ * Overridden to also hide the component.
+ */
+ public void hide()
+ {
+ super.hide();
+ if (getComponentCount() > 0)
+ getComponent(0).setVisible(false);
+ }
+
+ /**
+ * Overridden to return the cached value.
+ */
+ public Dimension getMinimumSize()
+ {
+ maybeValidate();
+ return min;
+ }
+
+ /**
+ * Overridden to return the cached value.
+ */
+ public Dimension getPreferredSize()
+ {
+ maybeValidate();
+ return pref;
+ }
+
+ /**
+ * Overridden to return the cached value.
+ */
+ public Dimension getMaximumSize()
+ {
+ maybeValidate();
+ return max;
+ }
+
+ /**
+ * Overridden to return the cached value.
+ */
+ public float getAlignmentX()
+ {
+ maybeValidate();
+ return alignX;
+ }
+
+ /**
+ * Overridden to return the cached value.
+ */
+ public float getAlignmentY()
+ {
+ maybeValidate();
+ return alignY;
+ }
+
+ /**
+ * Validates the container only when necessary.
+ */
+ private void maybeValidate()
+ {
+ if (! isValid())
+ validate();
+ }
+
+ /**
+ * Fetches the component layout sizes into the cache.
+ */
+ private void cacheComponentSizes()
+ {
+ if (getComponentCount() > 0)
+ {
+ Component c = getComponent(0);
+ min = c.getMinimumSize();
+ pref = c.getPreferredSize();
+ max = c.getMaximumSize();
+ alignX = c.getAlignmentX();
+ alignY = c.getAlignmentY();
+ }
+ }
+ }
+
+ /**
* The component that is displayed by this view.
*/
private Component comp;
/**
+ * The intercepting container.
+ */
+ private Interceptor interceptor;
+
+ /**
* Creates a new instance of <code>ComponentView</code> for the specified
* <code>Element</code>.
*
@@ -99,13 +249,20 @@ public class ComponentView extends View
*/
public float getAlignment(int axis)
{
- float align;
- if (axis == X_AXIS)
- align = getComponent().getAlignmentX();
- else if (axis == Y_AXIS)
- align = getComponent().getAlignmentY();
+ float align = 0.0F;
+ // I'd rather throw an IllegalArgumentException for illegal axis,
+ // but the Harmony testsuite indicates fallback to super behaviour.
+ if (interceptor != null && (axis == X_AXIS || axis == Y_AXIS))
+ {
+ if (axis == X_AXIS)
+ align = interceptor.getAlignmentX();
+ else if (axis == Y_AXIS)
+ align = interceptor.getAlignmentY();
+ else
+ assert false : "Must not reach here";
+ }
else
- throw new IllegalArgumentException();
+ align = super.getAlignment(axis);
return align;
}
@@ -118,8 +275,6 @@ public class ComponentView extends View
*/
public final Component getComponent()
{
- if (comp == null)
- comp = createComponent();
return comp;
}
@@ -135,49 +290,70 @@ public class ComponentView extends View
*/
public float getMaximumSpan(int axis)
{
- float span;
- if (axis == X_AXIS)
- span = getComponent().getMaximumSize().width;
- else if (axis == Y_AXIS)
- span = getComponent().getMaximumSize().height;
- else
- throw new IllegalArgumentException();
+ if (axis != X_AXIS && axis != Y_AXIS)
+ throw new IllegalArgumentException("Illegal axis");
+ float span = 0;
+ if (interceptor != null)
+ {
+ if (axis == X_AXIS)
+ span = interceptor.getMaximumSize().width;
+ else if (axis == Y_AXIS)
+ span = interceptor.getMaximumSize().height;
+ else
+ assert false : "Must not reach here";
+ }
return span;
}
public float getMinimumSpan(int axis)
{
- float span;
- if (axis == X_AXIS)
- span = getComponent().getMinimumSize().width;
- else if (axis == Y_AXIS)
- span = getComponent().getMinimumSize().height;
- else
- throw new IllegalArgumentException();
+ if (axis != X_AXIS && axis != Y_AXIS)
+ throw new IllegalArgumentException("Illegal axis");
+ float span = 0;
+ if (interceptor != null)
+ {
+ if (axis == X_AXIS)
+ span = interceptor.getMinimumSize().width;
+ else if (axis == Y_AXIS)
+ span = interceptor.getMinimumSize().height;
+ else
+ assert false : "Must not reach here";
+ }
return span;
}
public float getPreferredSpan(int axis)
{
- float span;
- if (axis == X_AXIS)
- span = getComponent().getPreferredSize().width;
- else if (axis == Y_AXIS)
- span = getComponent().getPreferredSize().height;
- else
- throw new IllegalArgumentException();
+ if (axis != X_AXIS && axis != Y_AXIS)
+ throw new IllegalArgumentException("Illegal axis");
+ float span = 0;
+ if (interceptor != null)
+ {
+ if (axis == X_AXIS)
+ span = interceptor.getPreferredSize().width;
+ else if (axis == Y_AXIS)
+ span = interceptor.getPreferredSize().height;
+ else
+ assert false : "Must not reach here";
+ }
return span;
}
public Shape modelToView(int pos, Shape a, Position.Bias b)
throws BadLocationException
{
- Element el = getElement();
- if (pos < el.getStartOffset() || pos >= el.getEndOffset())
- throw new BadLocationException("Illegal offset for this view", pos);
- Rectangle r = a.getBounds();
- Component c = getComponent();
- return new Rectangle(r.x, r.y, c.getWidth(), c.getHeight());
+ int p0 = getStartOffset();
+ int p1 = getEndOffset();
+ if (pos >= p0 && pos <= p1)
+ {
+ Rectangle viewRect = a.getBounds();
+ if (pos == p1)
+ viewRect.x += viewRect.width;
+ viewRect.width = 0;
+ return viewRect;
+ }
+ else
+ throw new BadLocationException("Illegal position", pos);
}
/**
@@ -191,8 +367,11 @@ public class ComponentView extends View
*/
public void paint(Graphics g, Shape a)
{
- Rectangle r = a.getBounds();
- getComponent().setBounds(r.x, r.y, r.width, r.height);
+ if (interceptor != null)
+ {
+ Rectangle r = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
+ interceptor.setBounds(r.x, r.y, r.width, r.height);
+ }
}
/**
@@ -209,15 +388,33 @@ public class ComponentView extends View
*/
public void setParent(final View p)
{
+ super.setParent(p);
if (SwingUtilities.isEventDispatchThread())
- setParentImpl(p);
+ setParentImpl();
else
SwingUtilities.invokeLater
(new Runnable()
{
public void run()
{
- setParentImpl(p);
+ Document doc = getDocument();
+ try
+ {
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readLock();
+ setParentImpl();
+ Container host = getContainer();
+ if (host != null)
+ {
+ preferenceChanged(null, true, true);
+ host.repaint();
+ }
+ }
+ finally
+ {
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readUnlock();
+ }
}
});
}
@@ -225,23 +422,41 @@ public class ComponentView extends View
/**
* The implementation of {@link #setParent}. This is package private to
* avoid a synthetic accessor method.
- *
- * @param p the parent view to set
*/
- private void setParentImpl(View p)
+ void setParentImpl()
{
- super.setParent(p);
+ View p = getParent();
if (p != null)
{
- Component c = getComponent();
- p.getContainer().add(c);
+ Container c = getContainer();
+ if (c != null)
+ {
+ if (interceptor == null)
+ {
+ // Create component and put it inside the interceptor.
+ Component created = createComponent();
+ if (created != null)
+ {
+ comp = created;
+ interceptor = new Interceptor(comp);
+ }
+ }
+ if (interceptor != null)
+ {
+ // Add the interceptor to the hosting container.
+ if (interceptor.getParent() == null)
+ c.add(interceptor, this);
+ }
+ }
}
else
{
- Component c = getComponent();
- Container parent = c.getParent();
- parent.remove(c);
- comp = null;
+ if (interceptor != null)
+ {
+ Container parent = interceptor.getParent();
+ if (parent != null)
+ parent.remove(interceptor);
+ }
}
}
@@ -259,10 +474,21 @@ public class ComponentView extends View
*/
public int viewToModel(float x, float y, Shape a, Position.Bias[] b)
{
- // The element should only have one character position and it is clear
- // that this position is the position that best matches the given screen
- // coordinates, simply because this view has only this one position.
- Element el = getElement();
- return el.getStartOffset();
+ int pos;
+ // I'd rather do the following. The harmony testsuite indicates
+ // that a simple cast is performed.
+ //Rectangle r = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
+ Rectangle r = (Rectangle) a;
+ if (x < r.x + r.width / 2)
+ {
+ b[0] = Position.Bias.Forward;
+ pos = getStartOffset();
+ }
+ else
+ {
+ b[0] = Position.Bias.Backward;
+ pos = getEndOffset();
+ }
+ return pos;
}
}
diff --git a/libjava/classpath/javax/swing/text/CompositeView.java b/libjava/classpath/javax/swing/text/CompositeView.java
index 6f487b8981e..570fc955c88 100644
--- a/libjava/classpath/javax/swing/text/CompositeView.java
+++ b/libjava/classpath/javax/swing/text/CompositeView.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package javax.swing.text;
-import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.Shape;
@@ -57,20 +56,28 @@ public abstract class CompositeView
/**
* The child views of this <code>CompositeView</code>.
*/
- View[] children;
+ private View[] children;
+
+ /**
+ * The number of child views.
+ */
+ private int numChildren;
/**
* The allocation of this <code>View</code> minus its insets. This is
* initialized in {@link #getInsideAllocation} and reused and modified in
* {@link #childAllocation(int, Rectangle)}.
*/
- Rectangle insideAllocation;
+ private final Rectangle insideAllocation = new Rectangle();
/**
* The insets of this <code>CompositeView</code>. This is initialized
* in {@link #setInsets}.
*/
- Insets insets;
+ private short top;
+ private short bottom;
+ private short left;
+ private short right;
/**
* Creates a new <code>CompositeView</code> for the given
@@ -82,7 +89,10 @@ public abstract class CompositeView
{
super(element);
children = new View[0];
- insets = new Insets(0, 0, 0, 0);
+ top = 0;
+ bottom = 0;
+ left = 0;
+ right = 0;
}
/**
@@ -96,16 +106,22 @@ public abstract class CompositeView
*/
protected void loadChildren(ViewFactory f)
{
- Element el = getElement();
- int count = el.getElementCount();
- View[] newChildren = new View[count];
- for (int i = 0; i < count; ++i)
+ if (f != null)
{
- Element child = el.getElement(i);
- View view = f.create(child);
- newChildren[i] = view;
+ Element el = getElement();
+ int count = el.getElementCount();
+ View[] newChildren = new View[count];
+ for (int i = 0; i < count; ++i)
+ {
+ Element child = el.getElement(i);
+ View view = f.create(child);
+ newChildren[i] = view;
+ }
+ // I'd have called replace(0, getViewCount(), newChildren) here
+ // in order to replace all existing views. However according to
+ // Harmony's tests this is not what the RI does.
+ replace(0, 0, newChildren);
}
- replace(0, getViewCount(), newChildren);
}
/**
@@ -118,7 +134,7 @@ public abstract class CompositeView
public void setParent(View parent)
{
super.setParent(parent);
- if (parent != null && ((children == null) || children.length == 0))
+ if (parent != null && numChildren == 0)
loadChildren(getViewFactory());
}
@@ -129,7 +145,7 @@ public abstract class CompositeView
*/
public int getViewCount()
{
- return children.length;
+ return numChildren;
}
/**
@@ -156,24 +172,42 @@ public abstract class CompositeView
*/
public void replace(int offset, int length, View[] views)
{
- // Check for null views to add.
- for (int i = 0; i < views.length; ++i)
- if (views[i] == null)
- throw new NullPointerException("Added views must not be null");
-
- int endOffset = offset + length;
+ // Make sure we have an array. The Harmony testsuite indicates that we
+ // have to do something like this.
+ if (views == null)
+ views = new View[0];
// First we set the parent of the removed children to null.
+ int endOffset = offset + length;
for (int i = offset; i < endOffset; ++i)
- children[i].setParent(null);
+ {
+ if (children[i].getParent() == this)
+ children[i].setParent(null);
+ children[i] = null;
+ }
- View[] newChildren = new View[children.length - length + views.length];
- System.arraycopy(children, 0, newChildren, 0, offset);
- System.arraycopy(views, 0, newChildren, offset, views.length);
- System.arraycopy(children, offset + length, newChildren,
- offset + views.length,
- children.length - (offset + length));
- children = newChildren;
+ // Update the children array.
+ int delta = views.length - length;
+ int src = offset + length;
+ int numMove = numChildren - src;
+ int dst = src + delta;
+ if (numChildren + delta > children.length)
+ {
+ // Grow array.
+ int newLength = Math.max(2 * children.length, numChildren + delta);
+ View[] newChildren = new View[newLength];
+ System.arraycopy(children, 0, newChildren, 0, offset);
+ System.arraycopy(views, 0, newChildren, offset, views.length);
+ System.arraycopy(children, src, newChildren, dst, numMove);
+ children = newChildren;
+ }
+ else
+ {
+ // Patch existing array.
+ System.arraycopy(children, src, children, dst, numMove);
+ System.arraycopy(views, 0, children, offset, views.length);
+ }
+ numChildren += delta;
// Finally we set the parent of the added children to this.
for (int i = 0; i < views.length; ++i)
@@ -248,34 +282,13 @@ public abstract class CompositeView
}
}
}
- else
- {
- throw new BadLocationException("Position " + pos
- + " is not represented by view.", pos);
- }
}
- return ret;
- }
- /**
- * A helper method for {@link #modelToView(int, Position.Bias, int,
- * Position.Bias, Shape)}. This creates a default location when there is
- * no child view that can take responsibility for mapping the position to
- * view coordinates. Depending on the specified bias this will be the
- * left or right edge of this view's allocation.
- *
- * @param a the allocation for this view
- * @param bias the bias
- *
- * @return a default location
- */
- private Shape createDefaultLocation(Shape a, Position.Bias bias)
- {
- Rectangle alloc = a.getBounds();
- Rectangle location = new Rectangle(alloc.x, alloc.y, 1, alloc.height);
- if (bias == Position.Bias.Forward)
- location.x = alloc.x + alloc.width;
- return location;
+ if (ret == null)
+ throw new BadLocationException("Position " + pos
+ + " is not represented by view.", pos);
+
+ return ret;
}
/**
@@ -394,7 +407,7 @@ public abstract class CompositeView
*/
public int getViewIndex(int pos, Position.Bias b)
{
- if (b == Position.Bias.Backward && pos != 0)
+ if (b == Position.Bias.Backward)
pos -= 1;
int i = -1;
if (pos >= getStartOffset() && pos < getEndOffset())
@@ -514,24 +527,17 @@ public abstract class CompositeView
if (a == null)
return null;
- Rectangle alloc = a.getBounds();
+ // Try to avoid allocation of Rectangle here.
+ Rectangle alloc = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
+
// Initialize the inside allocation rectangle. This is done inside
// a synchronized block in order to avoid multiple threads creating
// this instance simultanously.
- Rectangle inside;
- synchronized(this)
- {
- inside = insideAllocation;
- if (inside == null)
- {
- inside = new Rectangle();
- insideAllocation = inside;
- }
- }
- inside.x = alloc.x + insets.left;
- inside.y = alloc.y + insets.top;
- inside.width = alloc.width - insets.left - insets.right;
- inside.height = alloc.height - insets.top - insets.bottom;
+ Rectangle inside = insideAllocation;
+ inside.x = alloc.x + getLeftInset();
+ inside.y = alloc.y + getTopInset();
+ inside.width = alloc.width - getLeftInset() - getRightInset();
+ inside.height = alloc.height - getTopInset() - getBottomInset();
return inside;
}
@@ -546,39 +552,26 @@ public abstract class CompositeView
*/
protected void setParagraphInsets(AttributeSet attributes)
{
- Float l = (Float) attributes.getAttribute(StyleConstants.LeftIndent);
- short left = 0;
- if (l != null)
- left = l.shortValue();
- Float r = (Float) attributes.getAttribute(StyleConstants.RightIndent);
- short right = 0;
- if (r != null)
- right = r.shortValue();
- Float t = (Float) attributes.getAttribute(StyleConstants.SpaceAbove);
- short top = 0;
- if (t != null)
- top = t.shortValue();
- Float b = (Float) attributes.getAttribute(StyleConstants.SpaceBelow);
- short bottom = 0;
- if (b != null)
- bottom = b.shortValue();
- setInsets(top, left, bottom, right);
+ top = (short) StyleConstants.getSpaceAbove(attributes);
+ bottom = (short) StyleConstants.getSpaceBelow(attributes);
+ left = (short) StyleConstants.getLeftIndent(attributes);
+ right = (short) StyleConstants.getRightIndent(attributes);
}
/**
* Sets the insets of this <code>CompositeView</code>.
*
- * @param top the top inset
- * @param left the left inset
- * @param bottom the bottom inset
- * @param right the right inset
+ * @param t the top inset
+ * @param l the left inset
+ * @param b the bottom inset
+ * @param r the right inset
*/
- protected void setInsets(short top, short left, short bottom, short right)
+ protected void setInsets(short t, short l, short b, short r)
{
- insets.top = top;
- insets.left = left;
- insets.bottom = bottom;
- insets.right = right;
+ top = t;
+ left = l;
+ bottom = b;
+ right = r;
}
/**
@@ -588,7 +581,7 @@ public abstract class CompositeView
*/
protected short getLeftInset()
{
- return (short) insets.left;
+ return left;
}
/**
@@ -598,7 +591,7 @@ public abstract class CompositeView
*/
protected short getRightInset()
{
- return (short) insets.right;
+ return right;
}
/**
@@ -608,7 +601,7 @@ public abstract class CompositeView
*/
protected short getTopInset()
{
- return (short) insets.top;
+ return top;
}
/**
@@ -618,7 +611,7 @@ public abstract class CompositeView
*/
protected short getBottomInset()
{
- return (short) insets.bottom;
+ return bottom;
}
/**
diff --git a/libjava/classpath/javax/swing/text/DefaultCaret.java b/libjava/classpath/javax/swing/text/DefaultCaret.java
index 84f47f120de..c4c2580c398 100644
--- a/libjava/classpath/javax/swing/text/DefaultCaret.java
+++ b/libjava/classpath/javax/swing/text/DefaultCaret.java
@@ -804,7 +804,7 @@ public class DefaultCaret extends Rectangle
}
}
}
-
+
private void handleHighlight()
{
Highlighter highlighter = textComponent.getHighlighter();
@@ -946,7 +946,7 @@ public class DefaultCaret extends Rectangle
*
* @return all registered event listeners of the specified type
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
return listenerList.getListeners(listenerType);
}
@@ -1075,8 +1075,6 @@ public class DefaultCaret extends Rectangle
handleHighlight();
appear();
-
- adjustVisibility(this);
}
}
@@ -1114,8 +1112,6 @@ public class DefaultCaret extends Rectangle
clearHighlight();
appear();
-
- adjustVisibility(this);
}
}
@@ -1154,7 +1150,12 @@ public class DefaultCaret extends Rectangle
// e.printStackTrace();
}
if (area != null)
- damage(area);
+ {
+ adjustVisibility(area);
+ if (getMagicCaretPosition() == null)
+ setMagicCaretPosition(new Point(area.x, area.y));
+ damage(area);
+ }
}
repaint();
}
diff --git a/libjava/classpath/javax/swing/text/DefaultEditorKit.java b/libjava/classpath/javax/swing/text/DefaultEditorKit.java
index 8602e69f8e7..aa69deca545 100644
--- a/libjava/classpath/javax/swing/text/DefaultEditorKit.java
+++ b/libjava/classpath/javax/swing/text/DefaultEditorKit.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package javax.swing.text;
-import java.awt.Point;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
@@ -312,19 +311,21 @@ public class DefaultEditorKit extends EditorKit
public void actionPerformed(ActionEvent event)
{
JTextComponent t = getTextComponent(event);
- int offs = t.getDocument().getLength();
- Caret c = t.getCaret();
- c.setDot(0);
- c.moveDot(offs);
-
- try
- {
- c.setMagicCaretPosition(t.modelToView(offs).getLocation());
- }
- catch(BadLocationException ble)
- {
- // Can't happen.
- }
+ if (t != null)
+ {
+ int offs = t.getDocument().getLength();
+ Caret c = t.getCaret();
+ c.setDot(0);
+ c.moveDot(offs);
+ try
+ {
+ c.setMagicCaretPosition(t.modelToView(offs).getLocation());
+ }
+ catch(BadLocationException ble)
+ {
+ // Can't happen.
+ }
+ }
}
}
@@ -339,15 +340,18 @@ public class DefaultEditorKit extends EditorKit
public void actionPerformed(ActionEvent event)
{
JTextComponent t = getTextComponent(event);
- Caret c = t.getCaret();
- c.moveDot(0);
- try
- {
- c.setMagicCaretPosition(t.modelToView(0).getLocation());
- }
- catch(BadLocationException ble)
+ if (t != null)
{
- // Can't happen.
+ Caret c = t.getCaret();
+ c.moveDot(0);
+ try
+ {
+ c.setMagicCaretPosition(t.modelToView(0).getLocation());
+ }
+ catch(BadLocationException ble)
+ {
+ // Can't happen.
+ }
}
}
}
@@ -363,16 +367,19 @@ public class DefaultEditorKit extends EditorKit
public void actionPerformed(ActionEvent event)
{
JTextComponent t = getTextComponent(event);
- int offs = t.getDocument().getLength();
- Caret c = t.getCaret();
- c.moveDot(offs);
- try
- {
- c.setMagicCaretPosition(t.modelToView(offs).getLocation());
- }
- catch(BadLocationException ble)
+ if (t != null)
{
- // Can't happen.
+ int offs = t.getDocument().getLength();
+ Caret c = t.getCaret();
+ c.moveDot(offs);
+ try
+ {
+ c.setMagicCaretPosition(t.modelToView(offs).getLocation());
+ }
+ catch(BadLocationException ble)
+ {
+ // Can't happen.
+ }
}
}
}
@@ -389,17 +396,19 @@ public class DefaultEditorKit extends EditorKit
public void actionPerformed(ActionEvent event)
{
JTextComponent t = getTextComponent(event);
- Caret c = t.getCaret();
- try
+ if (t != null)
{
- int offs = Utilities.getRowStart(t, c.getDot());
- c.setMagicCaretPosition(t.modelToView(offs).getLocation());
+ Caret c = t.getCaret();
+ try
+ {
+ int offs = Utilities.getRowStart(t, c.getDot());
+ c.setMagicCaretPosition(t.modelToView(offs).getLocation());
+ }
+ catch(BadLocationException ble)
+ {
+ // Can't happen.
+ }
}
- catch(BadLocationException ble)
- {
- // Can't happen.
- }
-
}
}
@@ -414,17 +423,19 @@ public class DefaultEditorKit extends EditorKit
public void actionPerformed(ActionEvent event)
{
JTextComponent t = getTextComponent(event);
- Caret c = t.getCaret();
- try
- {
- int offs = Utilities.getRowEnd(t, c.getDot());
- c.setMagicCaretPosition(t.modelToView(offs).getLocation());
- }
- catch(BadLocationException ble)
+ if (t != null)
{
- // Can't happen.
+ Caret c = t.getCaret();
+ try
+ {
+ int offs = Utilities.getRowEnd(t, c.getDot());
+ c.setMagicCaretPosition(t.modelToView(offs).getLocation());
+ }
+ catch(BadLocationException ble)
+ {
+ // Can't happen.
+ }
}
-
}
}
@@ -438,20 +449,21 @@ public class DefaultEditorKit extends EditorKit
public void actionPerformed(ActionEvent event)
{
JTextComponent t = getTextComponent(event);
- Caret c = t.getCaret();
- try
- {
- int offs1 = Utilities.getRowStart(t, c.getDot());
- int offs2 = Utilities.getRowEnd(t, c.getDot());
-
- c.setDot(offs2);
- c.moveDot(offs1);
-
- c.setMagicCaretPosition(t.modelToView(offs2).getLocation());
- }
- catch(BadLocationException ble)
+ if (t != null)
{
- // Can't happen.
+ Caret c = t.getCaret();
+ try
+ {
+ int offs1 = Utilities.getRowStart(t, c.getDot());
+ int offs2 = Utilities.getRowEnd(t, c.getDot());
+ c.setDot(offs2);
+ c.moveDot(offs1);
+ c.setMagicCaretPosition(t.modelToView(offs2).getLocation());
+ }
+ catch(BadLocationException ble)
+ {
+ // Can't happen.
+ }
}
}
}
@@ -466,51 +478,52 @@ public class DefaultEditorKit extends EditorKit
public void actionPerformed(ActionEvent event)
{
JTextComponent t = getTextComponent(event);
- Caret c = t.getCaret();
- int dot = c.getDot();
-
- try
+ if (t != null)
{
- int wordStart = Utilities.getWordStart(t, dot);
-
- if (dot == wordStart)
- {
- // Current cursor position is on the first character in a word.
- c.setDot(wordStart);
- c.moveDot(Utilities.getWordEnd(t, wordStart));
- }
- else
+ Caret c = t.getCaret();
+ int dot = c.getDot();
+ try
{
- // Current cursor position is not on the first character
- // in a word.
- int nextWord = Utilities.getNextWord(t, dot);
- int previousWord = Utilities.getPreviousWord(t, dot);
- int previousWordEnd = Utilities.getWordEnd(t, previousWord);
-
- // Cursor position is in the space between two words. In such a
- // situation just select the space.
- if (dot >= previousWordEnd && dot <= nextWord)
+ int wordStart = Utilities.getWordStart(t, dot);
+
+ if (dot == wordStart)
{
- c.setDot(previousWordEnd);
- c.moveDot(nextWord);
+ // Current cursor position is on the first character in a word.
+ c.setDot(wordStart);
+ c.moveDot(Utilities.getWordEnd(t, wordStart));
}
else
{
- // Cursor position is inside a word. Just select it then.
- c.setDot(previousWord);
- c.moveDot(previousWordEnd);
+ // Current cursor position is not on the first character
+ // in a word.
+ int nextWord = Utilities.getNextWord(t, dot);
+ int previousWord = Utilities.getPreviousWord(t, dot);
+ int previousWordEnd = Utilities.getWordEnd(t, previousWord);
+
+ // Cursor position is in the space between two words. In such a
+ // situation just select the space.
+ if (dot >= previousWordEnd && dot <= nextWord)
+ {
+ c.setDot(previousWordEnd);
+ c.moveDot(nextWord);
+ }
+ else
+ {
+ // Cursor position is inside a word. Just select it then.
+ c.setDot(previousWord);
+ c.moveDot(previousWordEnd);
+ }
}
- }
- // If the position was updated change the magic caret position
- // as well.
- if (c.getDot() != dot)
- c.setMagicCaretPosition(t.modelToView(c.getDot()).getLocation());
-
- }
- catch(BadLocationException ble)
- {
- // Can't happen.
+ // If the position was updated change the magic caret position
+ // as well.
+ if (c.getDot() != dot)
+ c.setMagicCaretPosition(t.modelToView(c.getDot()).getLocation());
+ }
+ catch(BadLocationException ble)
+ {
+ // Can't happen.
+ }
}
}
}
@@ -715,21 +728,23 @@ public class DefaultEditorKit extends EditorKit
public void actionPerformed(ActionEvent event)
{
JTextComponent t = getTextComponent(event);
- try
- {
- int offs = Utilities.getRowEnd(t, t.getCaretPosition());
-
- if (offs > -1)
- {
- Caret c = t.getCaret();
- c.setDot(offs);
- c.setMagicCaretPosition(t.modelToView(offs).getLocation());
- }
- }
- catch (BadLocationException ble)
- {
- // Nothing to do here
- }
+ if (t != null)
+ {
+ try
+ {
+ int offs = Utilities.getRowEnd(t, t.getCaretPosition());
+ if (offs > -1)
+ {
+ Caret c = t.getCaret();
+ c.setDot(offs);
+ c.setMagicCaretPosition(t.modelToView(offs).getLocation());
+ }
+ }
+ catch (BadLocationException ble)
+ {
+ // Nothing to do here
+ }
+ }
}
}
@@ -744,21 +759,23 @@ public class DefaultEditorKit extends EditorKit
public void actionPerformed(ActionEvent event)
{
JTextComponent t = getTextComponent(event);
- try
- {
- int offs = Utilities.getRowStart(t, t.getCaretPosition());
-
- if (offs > -1)
- {
- Caret c = t.getCaret();
- c.setDot(offs);
- c.setMagicCaretPosition(t.modelToView(offs).getLocation());
- }
- }
- catch (BadLocationException ble)
- {
- // Do nothing here.
- }
+ if (t != null)
+ {
+ try
+ {
+ int offs = Utilities.getRowStart(t, t.getCaretPosition());
+ if (offs > -1)
+ {
+ Caret c = t.getCaret();
+ c.setDot(offs);
+ c.setMagicCaretPosition(t.modelToView(offs).getLocation());
+ }
+ }
+ catch (BadLocationException ble)
+ {
+ // Do nothing here.
+ }
+ }
}
}
@@ -773,16 +790,19 @@ public class DefaultEditorKit extends EditorKit
public void actionPerformed(ActionEvent event)
{
JTextComponent t = getTextComponent(event);
- Caret c = t.getCaret();
- c.setDot(0);
- try
- {
- c.setMagicCaretPosition(t.modelToView(0).getLocation());
- }
- catch(BadLocationException ble)
- {
- // Can't happen.
- }
+ if (t != null)
+ {
+ Caret c = t.getCaret();
+ c.setDot(0);
+ try
+ {
+ c.setMagicCaretPosition(t.modelToView(0).getLocation());
+ }
+ catch(BadLocationException ble)
+ {
+ // Can't happen.
+ }
+ }
}
}
@@ -797,16 +817,19 @@ public class DefaultEditorKit extends EditorKit
public void actionPerformed(ActionEvent event)
{
JTextComponent t = getTextComponent(event);
- int offs = t.getDocument().getLength();
- Caret c = t.getCaret();
- c.setDot(offs);
- try
- {
- c.setMagicCaretPosition(t.modelToView(offs).getLocation());
- }
- catch(BadLocationException ble)
+ if (t != null)
{
- // Can't happen.
+ int offs = t.getDocument().getLength();
+ Caret c = t.getCaret();
+ c.setDot(offs);
+ try
+ {
+ c.setMagicCaretPosition(t.modelToView(offs).getLocation());
+ }
+ catch(BadLocationException ble)
+ {
+ // Can't happen.
+ }
}
}
}
@@ -862,7 +885,9 @@ public class DefaultEditorKit extends EditorKit
*/
public void actionPerformed(ActionEvent event)
{
- getTextComponent(event).copy();
+ JTextComponent target = getTextComponent(event);
+ if (target != null)
+ target.copy();
}
}
@@ -893,7 +918,9 @@ public class DefaultEditorKit extends EditorKit
*/
public void actionPerformed(ActionEvent event)
{
- getTextComponent(event).cut();
+ JTextComponent target = getTextComponent(event);
+ if (target != null)
+ target.cut();
}
}
@@ -922,7 +949,9 @@ public class DefaultEditorKit extends EditorKit
*/
public void actionPerformed(ActionEvent event)
{
- getTextComponent(event).paste();
+ JTextComponent target = getTextComponent(event);
+ if (target != null)
+ target.paste();
}
}
@@ -957,14 +986,26 @@ public class DefaultEditorKit extends EditorKit
{
// first we filter the following events:
// - control characters
- // - key events with the ALT modifier (FIXME: filter that too!)
- int cp = event.getActionCommand().codePointAt(0);
- if (Character.isISOControl(cp))
- return;
-
- JTextComponent t = getTextComponent(event);
- if (t != null && t.isEnabled() && t.isEditable())
- t.replaceSelection(event.getActionCommand());
+ // - key events with the ALT modifier
+ JTextComponent target = getTextComponent(event);
+ if ((target != null) && (event != null))
+ {
+ if ((target.isEditable()) && (target.isEnabled()))
+ {
+ String content = event.getActionCommand();
+ int mod = event.getModifiers();
+ if ((content != null) && (content.length() > 0)
+ && (mod & ActionEvent.ALT_MASK) == 0
+ && (mod & ActionEvent.CTRL_MASK) == 0)
+ {
+ char c = content.charAt(0);
+ if ((c >= 0x20) && (c != 0x7F))
+ {
+ target.replaceSelection(content);
+ }
+ }
+ }
+ }
}
}
@@ -992,7 +1033,8 @@ public class DefaultEditorKit extends EditorKit
public void actionPerformed(ActionEvent event)
{
JTextComponent t = getTextComponent(event);
- t.replaceSelection("\n");
+ if (t != null)
+ t.replaceSelection("\n");
}
}
@@ -1047,7 +1089,8 @@ public class DefaultEditorKit extends EditorKit
public void actionPerformed(ActionEvent event)
{
JTextComponent t = getTextComponent(event);
- t.replaceSelection("\t");
+ if (t != null)
+ t.replaceSelection("\t");
}
}
diff --git a/libjava/classpath/javax/swing/text/DefaultFormatter.java b/libjava/classpath/javax/swing/text/DefaultFormatter.java
index e42b1698af8..bf7c02a004d 100644
--- a/libjava/classpath/javax/swing/text/DefaultFormatter.java
+++ b/libjava/classpath/javax/swing/text/DefaultFormatter.java
@@ -216,7 +216,7 @@ public class DefaultFormatter extends JFormattedTextField.AbstractFormatter
*/
public DefaultFormatter()
{
- commitsOnValidEdit = true;
+ commitsOnValidEdit = false;
overwriteMode = true;
allowsInvalid = true;
}
@@ -330,7 +330,7 @@ public class DefaultFormatter extends JFormattedTextField.AbstractFormatter
*
* @return the class that is used for values
*/
- public Class getValueClass()
+ public Class<?> getValueClass()
{
return valueClass;
}
@@ -342,7 +342,7 @@ public class DefaultFormatter extends JFormattedTextField.AbstractFormatter
*
* @see #getValueClass()
*/
- public void setValueClass(Class valueClass)
+ public void setValueClass(Class<?> valueClass)
{
this.valueClass = valueClass;
}
diff --git a/libjava/classpath/javax/swing/text/DefaultHighlighter.java b/libjava/classpath/javax/swing/text/DefaultHighlighter.java
index 59f77316e87..69563e473ac 100644
--- a/libjava/classpath/javax/swing/text/DefaultHighlighter.java
+++ b/libjava/classpath/javax/swing/text/DefaultHighlighter.java
@@ -1,4 +1,4 @@
-/* DefaultHighlighter.java --
+/* DefaultHighlighter.java -- The default highlight for Swing
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,18 +38,21 @@ exception statement from your version. */
package javax.swing.text;
-import gnu.classpath.NotImplementedException;
-
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.Shape;
import java.util.ArrayList;
+import java.util.Iterator;
import javax.swing.SwingUtilities;
import javax.swing.plaf.TextUI;
+/**
+ * The default highlight for Swing text components. It highlights text
+ * by filling the background with a rectangle.
+ */
public class DefaultHighlighter extends LayeredHighlighter
{
public static class DefaultHighlightPainter
@@ -68,11 +71,6 @@ public class DefaultHighlighter extends LayeredHighlighter
return color;
}
- private void paintHighlight(Graphics g, Rectangle rect)
- {
- g.fillRect(rect.x, rect.y, rect.width, rect.height);
- }
-
public void paint(Graphics g, int p0, int p1, Shape bounds,
JTextComponent t)
{
@@ -81,30 +79,31 @@ public class DefaultHighlighter extends LayeredHighlighter
Rectangle rect = bounds.getBounds();
- if (color == null)
- g.setColor(t.getSelectionColor());
- else
- g.setColor(color);
+ Color col = getColor();
+ if (col == null)
+ col = t.getSelectionColor();
+ g.setColor(col);
TextUI ui = t.getUI();
try
- {
-
- Rectangle l0 = ui.modelToView(t, p0, null);
- Rectangle l1 = ui.modelToView(t, p1, null);
-
- // Note: The computed locations may lie outside of the allocation
- // area if the text is scrolled.
+ {
+
+ Rectangle l0 = ui.modelToView(t, p0, null);
+ Rectangle l1 = ui.modelToView(t, p1, null);
- if (l0.y == l1.y)
+ // Note: The computed locations may lie outside of the allocation
+ // area if the text is scrolled.
+
+ if (l0.y == l1.y)
{
SwingUtilities.computeUnion(l0.x, l0.y, l0.width, l0.height, l1);
// Paint only inside the allocation area.
- SwingUtilities.computeIntersection(rect.x, rect.y, rect.width, rect.height, l1);
+ SwingUtilities.computeIntersection(rect.x, rect.y, rect.width,
+ rect.height, l1);
- paintHighlight(g, l1);
+ g.fillRect(l1.x, l1.y, l1.width, l1.height);
}
else
{
@@ -115,77 +114,71 @@ public class DefaultHighlighter extends LayeredHighlighter
// out the bounds.
// 3. The final line is painted from the left border to the
// position of p1.
-
- // Highlight first line until the end.
- // If rect.x is non-zero the calculation will properly adjust the
- // area to be painted.
- l0.x -= rect.x;
- l0.width = rect.width - l0.x - rect.x;
-
- paintHighlight(g, l0);
-
- int posBelow = Utilities.getPositionBelow(t, p0, l0.x);
- int p1RowStart = Utilities.getRowStart(t, p1);
- if (posBelow != -1
- && posBelow != p0
- && Utilities.getRowStart(t, posBelow)
- != p1RowStart)
- {
- Rectangle grow = ui.modelToView(t, posBelow);
- grow.x = rect.x;
- grow.width = rect.width;
-
- // Find further lines which have to be highlighted completely.
- int nextPosBelow = posBelow;
- while (nextPosBelow != -1
- && Utilities.getRowStart(t, nextPosBelow) != p1RowStart)
- {
- posBelow = nextPosBelow;
- nextPosBelow = Utilities.getPositionBelow(t, posBelow, l0.x);
-
- if (nextPosBelow == posBelow)
- break;
- }
- // Now posBelow is an offset on the last line which has to be painted
- // completely. (newPosBelow is on the same line as p1)
-
- // Retrieve the rectangle of posBelow and use its y and height
- // value to calculate the final height of the multiple line
- // spanning rectangle.
- Rectangle end = ui.modelToView(t, posBelow);
- grow.height = end.y + end.height - grow.y;
-
- paintHighlight(g, grow);
- }
-
- // Paint last line from its beginning to the position of p1.
- l1.width = l1.x + l1.width - rect.x;
- l1.x = rect.x;
- paintHighlight(g, l1);
- }
+
+ int firstLineWidth = rect.x + rect.width - l0.x;
+ g.fillRect(l0.x, l0.y, firstLineWidth, l0.height);
+ if (l0.y + l0.height != l1.y)
+ {
+ g.fillRect(rect.x, l0.y + l0.height, rect.width,
+ l1.y - l0.y - l0.height);
+ }
+ g.fillRect(rect.x, l1.y, l1.x - rect.x, l1.height);
+ }
}
catch (BadLocationException ex)
{
- AssertionError err = new AssertionError("Unexpected bad location exception");
- err.initCause(ex);
- throw err;
+ // Can't render. Comment out for debugging.
+ // ex.printStackTrace();
}
}
public Shape paintLayer(Graphics g, int p0, int p1, Shape bounds,
JTextComponent c, View view)
{
- throw new InternalError();
+ Color col = getColor();
+ if (col == null)
+ col = c.getSelectionColor();
+ g.setColor(col);
+
+ Rectangle rect = null;
+ if (p0 == view.getStartOffset() && p1 == view.getEndOffset())
+ {
+ // Paint complete bounds region.
+ rect = bounds instanceof Rectangle ? (Rectangle) bounds
+ : bounds.getBounds();
+ }
+ else
+ {
+ // Only partly inside the view.
+ try
+ {
+ Shape s = view.modelToView(p0, Position.Bias.Forward,
+ p1, Position.Bias.Backward,
+ bounds);
+ rect = s instanceof Rectangle ? (Rectangle) s : s.getBounds();
+ }
+ catch (BadLocationException ex)
+ {
+ // Can't render the highlight.
+ }
+ }
+
+ if (rect != null)
+ {
+ g.fillRect(rect.x, rect.y, rect.width, rect.height);
+ }
+ return rect;
}
}
private class HighlightEntry implements Highlighter.Highlight
{
- int p0;
- int p1;
+ Position p0;
+ Position p1;
Highlighter.HighlightPainter painter;
- public HighlightEntry(int p0, int p1, Highlighter.HighlightPainter painter)
+ public HighlightEntry(Position p0, Position p1,
+ Highlighter.HighlightPainter painter)
{
this.p0 = p0;
this.p1 = p1;
@@ -194,12 +187,12 @@ public class DefaultHighlighter extends LayeredHighlighter
public int getStartOffset()
{
- return p0;
+ return p0.getOffset();
}
public int getEndOffset()
{
- return p1;
+ return p1.getOffset();
}
public Highlighter.HighlightPainter getPainter()
@@ -209,6 +202,58 @@ public class DefaultHighlighter extends LayeredHighlighter
}
/**
+ * A HighlightEntry that is used for LayerPainter painters. In addition
+ * to the info maintained by the HighlightEntry, this class maintains
+ * a painting rectangle. This is used as repaint region when the
+ * highlight changes and the text component needs repainting.
+ */
+ private class LayerHighlightEntry
+ extends HighlightEntry
+ {
+
+ /**
+ * The paint rectangle.
+ */
+ Rectangle paintRect = new Rectangle();
+
+ LayerHighlightEntry(Position p0, Position p1,
+ Highlighter.HighlightPainter p)
+ {
+ super(p0, p1, p);
+ }
+
+ /**
+ * Paints the highlight by calling the LayerPainter. This
+ * restricts the area to be painted by startOffset and endOffset
+ * and manages the paint rectangle.
+ */
+ void paintLayeredHighlight(Graphics g, int p0, int p1, Shape bounds,
+ JTextComponent tc, View view)
+ {
+ p0 = Math.max(getStartOffset(), p0);
+ p1 = Math.min(getEndOffset(), p1);
+
+ Highlighter.HighlightPainter painter = getPainter();
+ if (painter instanceof LayerPainter)
+ {
+ LayerPainter layerPainter = (LayerPainter) painter;
+ Shape area = layerPainter.paintLayer(g, p0, p1, bounds, tc, view);
+ Rectangle rect;
+ if (area instanceof Rectangle && paintRect != null)
+ rect = (Rectangle) area;
+ else
+ rect = area.getBounds();
+
+ if (paintRect.width == 0 || paintRect.height == 0)
+ paintRect = rect.getBounds();
+ else
+ paintRect = SwingUtilities.computeUnion(rect.x, rect.y, rect.width,
+ rect.height, paintRect);
+ }
+ }
+ }
+
+ /**
* @specnote final as of 1.4
*/
public static final LayeredHighlighter.LayerPainter DefaultPainter =
@@ -254,11 +299,19 @@ public class DefaultHighlighter extends LayeredHighlighter
textComponent = null;
}
- public Object addHighlight(int p0, int p1, Highlighter.HighlightPainter painter)
+ public Object addHighlight(int p0, int p1,
+ Highlighter.HighlightPainter painter)
throws BadLocationException
{
checkPositions(p0, p1);
- HighlightEntry entry = new HighlightEntry(p0, p1, painter);
+ HighlightEntry entry;
+ Document doc = textComponent.getDocument();
+ Position pos0 = doc.createPosition(p0);
+ Position pos1 = doc.createPosition(p1);
+ if (getDrawsLayeredHighlights() && painter instanceof LayerPainter)
+ entry = new LayerHighlightEntry(pos0, pos1, painter);
+ else
+ entry = new HighlightEntry(pos0, pos1, painter);
highlights.add(entry);
textComponent.getUI().damageRange(textComponent, p0, p1);
@@ -268,16 +321,67 @@ public class DefaultHighlighter extends LayeredHighlighter
public void removeHighlight(Object tag)
{
+ HighlightEntry entry = (HighlightEntry) tag;
+ if (entry instanceof LayerHighlightEntry)
+ {
+ LayerHighlightEntry lEntry = (LayerHighlightEntry) entry;
+ Rectangle paintRect = lEntry.paintRect;
+ textComponent.repaint(paintRect.x, paintRect.y, paintRect.width,
+ paintRect.height);
+ }
+ else
+ {
+ textComponent.getUI().damageRange(textComponent,
+ entry.getStartOffset(),
+ entry.getEndOffset());
+ }
highlights.remove(tag);
- HighlightEntry entry = (HighlightEntry) tag;
- textComponent.getUI().damageRange(textComponent,
- entry.p0,
- entry.p1);
}
public void removeAllHighlights()
{
+ // Repaint damaged region.
+ int minX = 0;
+ int maxX = 0;
+ int minY = 0;
+ int maxY = 0;
+ int p0 = -1;
+ int p1 = -1;
+ for (Iterator i = highlights.iterator(); i.hasNext();)
+ {
+ HighlightEntry e = (HighlightEntry) i.next();
+ if (e instanceof LayerHighlightEntry)
+ {
+ LayerHighlightEntry le = (LayerHighlightEntry) e;
+ Rectangle r = le.paintRect;
+ minX = Math.min(r.x, minX);
+ maxX = Math.max(r.x + r.width, maxX);
+ minY = Math.min(r.y, minY);
+ maxY = Math.max(r.y + r.height, maxY);
+ }
+ else
+ {
+ if (p0 == -1 || p1 == -1)
+ {
+ p0 = e.getStartOffset();
+ p1 = e.getEndOffset();
+ }
+ else
+ {
+ p0 = Math.min(p0, e.getStartOffset());
+ p1 = Math.max(p1, e.getEndOffset());
+ }
+ }
+ if (minX != maxX && minY != maxY)
+ textComponent.repaint(minX, minY, maxX - minX, maxY - minY);
+ if (p0 != -1 && p1 != -1)
+ {
+ TextUI ui = textComponent.getUI();
+ ui.damageRange(textComponent, p0, p1);
+ }
+
+ }
highlights.clear();
}
@@ -290,94 +394,61 @@ public class DefaultHighlighter extends LayeredHighlighter
public void changeHighlight(Object tag, int n0, int n1)
throws BadLocationException
{
- int o0, o1;
-
- checkPositions(n0, n1);
- HighlightEntry entry = (HighlightEntry) tag;
- o0 = entry.p0;
- o1 = entry.p1;
-
- // Prevent useless write & repaint operations.
- if (o0 == n0 && o1 == n1)
- return;
-
- entry.p0 = n0;
- entry.p1 = n1;
-
+ Document doc = textComponent.getDocument();
TextUI ui = textComponent.getUI();
-
- // Special situation where the old area has to be cleared simply.
- if (n0 == n1)
- ui.damageRange(textComponent, o0, o1);
- // Calculates the areas where a change is really neccessary
- else if ((o1 > n0 && o1 <= n1)
- || (n1 > o0 && n1 <= o1))
+ if (tag instanceof LayerHighlightEntry)
{
- // [fds, fde) - the first damage region
- // [sds, sde] - the second damage region
- int fds, sds;
- int fde, sde;
-
- // Calculate first damaged region.
- if(o0 < n0)
- {
- // Damaged region will be cleared as
- // the old highlight region starts first.
- fds = o0;
- fde = n0;
- }
- else
- {
- // Damaged region will be painted as
- // the new highlight region starts first.
- fds = n0;
- fde = o0;
- }
-
- if (o1 < n1)
+ LayerHighlightEntry le = (LayerHighlightEntry) tag;
+ Rectangle r = le.paintRect;
+ if (r.width > 0 && r.height > 0)
+ textComponent.repaint(r.x, r.y, r.width, r.height);
+ r.width = 0;
+ r.height = 0;
+ le.p0 = doc.createPosition(n0);
+ le.p1 = doc.createPosition(n1);
+ ui.damageRange(textComponent, Math.min(n0, n1), Math.max(n0, n1));
+ }
+ else if (tag instanceof HighlightEntry)
+ {
+ HighlightEntry e = (HighlightEntry) tag;
+ int p0 = e.getStartOffset();
+ int p1 = e.getEndOffset();
+ if (p0 == n0)
{
- // Final region will be painted as the
- // old highlight region finishes first
- sds = o1;
- sde = n1;
+ ui.damageRange(textComponent, Math.min(p1, n1),
+ Math.max(p1, n1));
}
- else
+ else if (n1 == p1)
{
- // Final region will be cleared as the
- // new highlight region finishes first.
- sds = n1;
- sde = o1;
+ ui.damageRange(textComponent, Math.min(p0, n0),
+ Math.max(p0, n0));
}
-
- // If there is no undamaged region in between
- // call damageRange only once.
- if (fde == sds)
- ui.damageRange(textComponent, fds, sde);
else
{
- if (fds != fde)
- ui.damageRange(textComponent, fds, fde);
-
- if (sds != sde)
- ui.damageRange(textComponent, sds, sde);
+ ui.damageRange(textComponent, p0, p1);
+ ui.damageRange(textComponent, n0, n1);
}
+ e.p0 = doc.createPosition(n0);
+ e.p1 = doc.createPosition(n1);
}
- else
- {
- // The two regions do not overlap. So mark
- // both areas as damaged.
- ui.damageRange(textComponent, o0, o1);
- ui.damageRange(textComponent, n0, n1);
- }
-
}
public void paintLayeredHighlights(Graphics g, int p0, int p1,
Shape viewBounds, JTextComponent editor,
View view)
- throws NotImplementedException
{
- // TODO: Implement this properly.
+ for (Iterator i = highlights.iterator(); i.hasNext();)
+ {
+ Object o = i.next();
+ if (o instanceof LayerHighlightEntry)
+ {
+ LayerHighlightEntry entry = (LayerHighlightEntry) o;
+ int start = entry.getStartOffset();
+ int end = entry.getEndOffset();
+ if ((p0 < start && p1 > start) || (p0 >= start && p0 < end))
+ entry.paintLayeredHighlight(g, p0, p1, viewBounds, editor, view);
+ }
+ }
}
public void paint(Graphics g)
@@ -399,7 +470,9 @@ public class DefaultHighlighter extends LayeredHighlighter
for (int index = 0; index < size; ++index)
{
HighlightEntry entry = (HighlightEntry) highlights.get(index);
- entry.painter.paint(g, entry.p0, entry.p1, bounds, textComponent);
+ if (! (entry instanceof LayerHighlightEntry))
+ entry.painter.paint(g, entry.getStartOffset(), entry.getEndOffset(),
+ bounds, textComponent);
}
}
}
diff --git a/libjava/classpath/javax/swing/text/DefaultStyledDocument.java b/libjava/classpath/javax/swing/text/DefaultStyledDocument.java
index bd21e55c6fb..3156ca67f66 100644
--- a/libjava/classpath/javax/swing/text/DefaultStyledDocument.java
+++ b/libjava/classpath/javax/swing/text/DefaultStyledDocument.java
@@ -41,7 +41,9 @@ package javax.swing.text;
import java.awt.Color;
import java.awt.Font;
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Stack;
import java.util.Vector;
@@ -424,6 +426,58 @@ public class DefaultStyledDocument extends AbstractDocument implements
*/
public class ElementBuffer implements Serializable
{
+ /**
+ * Instance of all editing information for an object in the Vector. This class
+ * is used to add information to the DocumentEvent associated with an
+ * insertion/removal/change as well as to store the changes that need to be
+ * made so they can be made all at the same (appropriate) time.
+ */
+ class Edit
+ {
+ /** The element to edit . */
+ Element e;
+
+ /** The index of the change. */
+ int index;
+
+ /** The removed elements. */
+ ArrayList removed = new ArrayList();
+
+ /** The added elements. */
+ ArrayList added = new ArrayList();
+
+ /**
+ * Indicates if this edit contains a fracture.
+ */
+ boolean isFracture;
+
+ /**
+ * Creates a new Edit for the specified element at index i.
+ *
+ * @param el the element
+ * @param i the index
+ */
+ Edit(Element el, int i)
+ {
+ this(el, i, false);
+ }
+
+ /**
+ * Creates a new Edit for the specified element at index i.
+ *
+ * @param el the element
+ * @param i the index
+ * @param frac if this is a fracture edit or not
+ */
+ Edit(Element el, int i, boolean frac)
+ {
+ e = el;
+ index = i;
+ isFracture = frac;
+ }
+
+ }
+
/** The serialization UID (compatible with JDK1.5). */
private static final long serialVersionUID = 1688745877691146623L;
@@ -442,11 +496,20 @@ public class DefaultStyledDocument extends AbstractDocument implements
/** Holds the position of the change. */
private int pos;
- /** Holds the element that was last fractured. */
- private Element lastFractured;
-
- /** True if a fracture was not created during a insertFracture call. */
- private boolean fracNotCreated;
+ /**
+ * The parent of the fracture.
+ */
+ private Element fracturedParent;
+
+ /**
+ * The fractured child.
+ */
+ private Element fracturedChild;
+
+ /**
+ * Indicates if a fracture has been created.
+ */
+ private boolean createdFracture;
/**
* The current position in the element tree. This is used for bulk inserts
@@ -454,10 +517,17 @@ public class DefaultStyledDocument extends AbstractDocument implements
*/
private Stack elementStack;
+ private Edit[] insertPath;
+
+ private boolean recreateLeafs;
+
/**
- * The ElementChange that describes the latest changes.
+ * Vector that contains all the edits. Maybe replace by a HashMap.
*/
- DefaultDocumentEvent documentEvent;
+ private ArrayList edits;
+
+ private boolean offsetLastIndex;
+ private boolean offsetLastIndexReplace;
/**
* Creates a new <code>ElementBuffer</code> for the specified
@@ -469,7 +539,6 @@ public class DefaultStyledDocument extends AbstractDocument implements
public ElementBuffer(Element root)
{
this.root = root;
- elementStack = new Stack();
}
/**
@@ -495,13 +564,9 @@ public class DefaultStyledDocument extends AbstractDocument implements
*/
public void remove(int offs, int len, DefaultDocumentEvent ev)
{
- if (len == 0)
- return;
- offset = offs;
- length = len;
- pos = offset;
- documentEvent = ev;
+ prepareEdit(offs, len);
removeUpdate();
+ finishEdit(ev);
}
/**
@@ -511,109 +576,293 @@ public class DefaultStyledDocument extends AbstractDocument implements
*/
protected void removeUpdate()
{
- int startParagraph = root.getElementIndex(offset);
- int endParagraph = root.getElementIndex(offset + length);
- Element[] empty = new Element[0];
- int removeStart = -1;
- int removeEnd = -1;
- for (int i = startParagraph; i < endParagraph; i++)
+ removeElements(root, offset, endOffset);
+ }
+
+ private boolean removeElements(Element elem, int rmOffs0, int rmOffs1)
+ {
+ boolean ret = false;
+ if (! elem.isLeaf())
{
- BranchElement paragraph = (BranchElement) root.getElement(i);
- int contentStart = paragraph.getElementIndex(offset);
- int contentEnd = paragraph.getElementIndex(offset + length);
- if (contentStart == paragraph.getStartOffset()
- && contentEnd == paragraph.getEndOffset())
+ // Update stack for changes.
+ int index0 = elem.getElementIndex(rmOffs0);
+ int index1 = elem.getElementIndex(rmOffs1);
+ elementStack.push(new Edit(elem, index0));
+ Edit ec = (Edit) elementStack.peek();
+
+ // If the range is contained by one element,
+ // we just forward the request
+ if (index0 == index1)
{
- // In this case we only need to remove the whole paragraph. We
- // do this in one go after this loop and only record the indices
- // here.
- if (removeStart == -1)
+ Element child0 = elem.getElement(index0);
+ if(rmOffs0 <= child0.getStartOffset()
+ && rmOffs1 >= child0.getEndOffset())
{
- removeStart = i;
- removeEnd = i;
+ // Element totally removed.
+ ec.removed.add(child0);
+ }
+ else if (removeElements(child0, rmOffs0, rmOffs1))
+ {
+ ec.removed.add(child0);
}
- else
- removeEnd = i;
}
else
{
- // In this case we remove a couple of child elements from this
- // paragraph.
- int removeLen = contentEnd - contentStart;
- Element[] removed = new Element[removeLen];
- for (int j = contentStart; j < contentEnd; j++)
- removed[j] = paragraph.getElement(j);
- Edit edit = getEditForParagraphAndIndex(paragraph, contentStart);
- edit.addRemovedElements(removed);
+ // The removal range spans elements. If we can join
+ // the two endpoints, do it. Otherwise we remove the
+ // interior and forward to the endpoints.
+ Element child0 = elem.getElement(index0);
+ Element child1 = elem.getElement(index1);
+ boolean containsOffs1 = (rmOffs1 < elem.getEndOffset());
+ if (containsOffs1 && canJoin(child0, child1))
+ {
+ // Remove and join.
+ for (int i = index0; i <= index1; i++)
+ {
+ ec.removed.add(elem.getElement(i));
+ }
+ Element e = join(elem, child0, child1, rmOffs0, rmOffs1);
+ ec.added.add(e);
}
+ else
+ {
+ // Remove interior and forward.
+ int rmIndex0 = index0 + 1;
+ int rmIndex1 = index1 - 1;
+ if (child0.getStartOffset() == rmOffs0
+ || (index0 == 0 && child0.getStartOffset() > rmOffs0
+ && child0.getEndOffset() <= rmOffs1))
+ {
+ // Start element completely consumed.
+ child0 = null;
+ rmIndex0 = index0;
+ }
+ if (! containsOffs1)
+ {
+ child1 = null;
+ rmIndex1++;
+ }
+ else if (child1.getStartOffset() == rmOffs1)
+ {
+ // End element not touched.
+ child1 = null;
+ }
+ if (rmIndex0 <= rmIndex1)
+ {
+ ec.index = rmIndex0;
+ }
+ for (int i = rmIndex0; i <= rmIndex1; i++)
+ {
+ ec.removed.add(elem.getElement(i));
+ }
+ if (child0 != null)
+ {
+ if(removeElements(child0, rmOffs0, rmOffs1))
+ {
+ ec.removed.add(0, child0);
+ ec.index = index0;
+ }
+ }
+ if (child1 != null)
+ {
+ if(removeElements(child1, rmOffs0, rmOffs1))
+ {
+ ec.removed.add(child1);
+ }
+ }
+ }
+ }
+
+ // Perform changes.
+ pop();
+
+ // Return true if we no longer have any children.
+ if(elem.getElementCount() == (ec.removed.size() - ec.added.size()))
+ ret = true;
}
- // Now we remove paragraphs from the root that have been tagged for
- // removal.
- if (removeStart != -1)
- {
- int removeLen = removeEnd - removeStart;
- Element[] removed = new Element[removeLen];
- for (int i = removeStart; i < removeEnd; i++)
- removed[i] = root.getElement(i);
- Edit edit = getEditForParagraphAndIndex((BranchElement) root,
- removeStart);
- edit.addRemovedElements(removed);
- }
+ return ret;
}
/**
- * Performs the actual work for {@link #change}. The elements at the
- * interval boundaries are split up (if necessary) so that the interval
- * boundaries are located at element boundaries.
+ * Creates a document in response to a call to
+ * {@link DefaultStyledDocument#create(ElementSpec[])}.
+ *
+ * @param len the length of the inserted text
+ * @param data the specs for the elements
+ * @param ev the document event
*/
- protected void changeUpdate()
+ void create(int len, ElementSpec[] data, DefaultDocumentEvent ev)
+ {
+ prepareEdit(offset, len);
+ Element el = root;
+ int index = el.getElementIndex(0);
+ while (! el.isLeaf())
+ {
+ Element child = el.getElement(index);
+ Edit edit = new Edit(el, index, false);
+ elementStack.push(edit);
+ el = child;
+ index = el.getElementIndex(0);
+ }
+ Edit ed = (Edit) elementStack.peek();
+ Element child = ed.e.getElement(ed.index);
+ ed.added.add(createLeafElement(ed.e, child.getAttributes(), getLength(),
+ child.getEndOffset()));
+ ed.removed.add(child);
+ while (elementStack.size() > 1)
+ pop();
+ int n = data.length;
+
+ // Reset root element's attributes.
+ AttributeSet newAtts = null;
+ if (n > 0 && data[0].getType() == ElementSpec.StartTagType)
+ newAtts = data[0].getAttributes();
+ if (newAtts == null)
+ newAtts = SimpleAttributeSet.EMPTY;
+ MutableAttributeSet mAtts = (MutableAttributeSet) root.getAttributes();
+ ev.addEdit(new AttributeUndoableEdit(root, newAtts, true));
+ mAtts.removeAttributes(mAtts);
+ mAtts.addAttributes(newAtts);
+
+ // Insert the specified elements.
+ for (int i = 1; i < n; i++)
+ insertElement(data[i]);
+
+ // Pop remaining stack.
+ while (elementStack.size() > 0)
+ pop();
+
+ finishEdit(ev);
+ }
+
+ private boolean canJoin(Element e0, Element e1)
+ {
+ boolean ret = false;
+ if ((e0 != null) && (e1 != null))
+ {
+ // Don't join a leaf to a branch.
+ boolean isLeaf0 = e0.isLeaf();
+ boolean isLeaf1 = e1.isLeaf();
+ if(isLeaf0 == isLeaf1)
+ {
+ if (isLeaf0)
+ {
+ // Only join leaves if the attributes match, otherwise
+ // style information will be lost.
+ ret = e0.getAttributes().isEqual(e1.getAttributes());
+ }
+ else
+ {
+ // Only join non-leafs if the names are equal. This may result
+ // in loss of style information, but this is typically
+ // acceptable for non-leafs.
+ String name0 = e0.getName();
+ String name1 = e1.getName();
+ if (name0 != null)
+ ret = name0.equals(name1);
+ else if (name1 != null)
+ ret = name1.equals(name0);
+ else // Both names null.
+ ret = true;
+ }
+ }
+ }
+ return ret;
+ }
+
+ private Element join(Element p, Element left, Element right, int rmOffs0,
+ int rmOffs1)
{
- // Split up the element at the start offset if necessary.
- Element el = getCharacterElement(offset);
- Element[] res = split(el, offset, 0, el.getElementIndex(offset));
- BranchElement par = (BranchElement) el.getParentElement();
- int index = par.getElementIndex(offset);
- Edit edit = getEditForParagraphAndIndex(par, index);
- if (res[1] != null)
+ Element joined = null;
+ if (left.isLeaf() && right.isLeaf())
+ {
+ joined = createLeafElement(p, left.getAttributes(),
+ left.getStartOffset(),
+ right.getEndOffset());
+ }
+ else if ((! left.isLeaf()) && (! right.isLeaf()))
{
- Element[] removed;
- Element[] added;
- if (res[0] == null)
+ // Join two branch elements. This copies the children before
+ // the removal range on the left element, and after the removal
+ // range on the right element. The two elements on the edge
+ // are joined if possible and needed.
+ joined = createBranchElement(p, left.getAttributes());
+ int ljIndex = left.getElementIndex(rmOffs0);
+ int rjIndex = right.getElementIndex(rmOffs1);
+ Element lj = left.getElement(ljIndex);
+ if (lj.getStartOffset() >= rmOffs0)
+ {
+ lj = null;
+ }
+ Element rj = right.getElement(rjIndex);
+ if (rj.getStartOffset() == rmOffs1)
{
- removed = new Element[0];
- added = new Element[] { res[1] };
- index++;
+ rj = null;
+ }
+ ArrayList children = new ArrayList();
+ // Transfer the left.
+ for (int i = 0; i < ljIndex; i++)
+ {
+ children.add(clone(joined, left.getElement(i)));
+ }
+
+ // Transfer the join/middle.
+ if (canJoin(lj, rj))
+ {
+ Element e = join(joined, lj, rj, rmOffs0, rmOffs1);
+ children.add(e);
}
else
{
- removed = new Element[] { el };
- added = new Element[] { res[0], res[1] };
+ if (lj != null)
+ {
+ children.add(cloneAsNecessary(joined, lj, rmOffs0, rmOffs1));
+ }
+ if (rj != null)
+ {
+ children.add(cloneAsNecessary(joined, rj, rmOffs0, rmOffs1));
+ }
+ }
+
+ // Transfer the right.
+ int n = right.getElementCount();
+ for (int i = (rj == null) ? rjIndex : rjIndex + 1; i < n; i++)
+ {
+ children.add(clone(joined, right.getElement(i)));
}
- edit.addRemovedElements(removed);
- edit.addAddedElements(added);
+ // Install the children.
+ Element[] c = new Element[children.size()];
+ c = (Element[]) children.toArray(c);
+ ((BranchElement) joined).replace(0, 0, c);
+ }
+ else
+ {
+ assert false : "Must not happen";
}
+ return joined;
+ }
- int endOffset = offset + length;
- el = getCharacterElement(endOffset);
- res = split(el, endOffset, 0, el.getElementIndex(endOffset));
- par = (BranchElement) el.getParentElement();
- if (res[0] != null)
+ /**
+ * Performs the actual work for {@link #change}. The elements at the
+ * interval boundaries are split up (if necessary) so that the interval
+ * boundaries are located at element boundaries.
+ */
+ protected void changeUpdate()
+ {
+ boolean didEnd = split(offset, length);
+ if (! didEnd)
{
- Element[] removed;
- Element[] added;
- if (res[1] == null)
- {
- removed = new Element[0];
- added = new Element[] { res[1] };
- }
- else
+ // need to do the other end
+ while (elementStack.size() != 0)
{
- removed = new Element[] { el };
- added = new Element[] { res[0], res[1] };
+ pop();
}
- edit.addRemovedElements(removed);
- edit.addAddedElements(added);
+ split(offset + length, 0);
+ }
+ while (elementStack.size() != 0)
+ {
+ pop();
}
}
@@ -633,13 +882,9 @@ public class DefaultStyledDocument extends AbstractDocument implements
*/
public void change(int offset, int length, DefaultDocumentEvent ev)
{
- if (length == 0)
- return;
- this.offset = offset;
- this.pos = offset;
- this.length = length;
- documentEvent = ev;
+ prepareEdit(offset, length);
changeUpdate();
+ finishEdit(ev);
}
/**
@@ -683,6 +928,39 @@ public class DefaultStyledDocument extends AbstractDocument implements
return clone;
}
+ private Element cloneAsNecessary(Element parent, Element clonee,
+ int rmOffs0, int rmOffs1)
+ {
+ Element cloned;
+ if (clonee.isLeaf())
+ {
+ cloned = createLeafElement(parent, clonee.getAttributes(),
+ clonee.getStartOffset(),
+ clonee.getEndOffset());
+ }
+ else
+ {
+ Element e = createBranchElement(parent, clonee.getAttributes());
+ int n = clonee.getElementCount();
+ ArrayList childrenList = new ArrayList(n);
+ for (int i = 0; i < n; i++)
+ {
+ Element elem = clonee.getElement(i);
+ if (elem.getStartOffset() < rmOffs0
+ || elem.getEndOffset() > rmOffs1)
+ {
+ childrenList.add(cloneAsNecessary(e, elem, rmOffs0,
+ rmOffs1));
+ }
+ }
+ Element[] children = new Element[childrenList.size()];
+ children = (Element[]) childrenList.toArray(children);
+ ((BranchElement) e).replace(0, 0, children);
+ cloned = e;
+ }
+ return cloned;
+ }
+
/**
* Inserts new <code>Element</code> in the document at the specified
* position. Most of the work is done by {@link #insertUpdate}, after some
@@ -701,70 +979,100 @@ public class DefaultStyledDocument extends AbstractDocument implements
public void insert(int offset, int length, ElementSpec[] data,
DefaultDocumentEvent ev)
{
- if (length == 0)
- return;
-
+ if (length > 0)
+ {
+ prepareEdit(offset, length);
+ insertUpdate(data);
+ finishEdit(ev);
+ }
+ }
+
+ /**
+ * Prepares the state of this object for performing an insert.
+ *
+ * @param offset the offset at which is inserted
+ * @param length the length of the inserted region
+ */
+ private void prepareEdit(int offset, int length)
+ {
this.offset = offset;
this.pos = offset;
this.endOffset = offset + length;
this.length = length;
- documentEvent = ev;
-
- edits.removeAllElements();
- elementStack.removeAllElements();
- lastFractured = null;
- fracNotCreated = false;
- insertUpdate(data);
+
+ if (edits == null)
+ edits = new ArrayList();
+ else
+ edits.clear();
+
+ if (elementStack == null)
+ elementStack = new Stack();
+ else
+ elementStack.clear();
+
+ fracturedParent = null;
+ fracturedChild = null;
+ offsetLastIndex = false;
+ offsetLastIndexReplace = false;
+ }
+
+ /**
+ * Finishes an insert. This applies all changes and updates
+ * the DocumentEvent.
+ *
+ * @param ev the document event
+ */
+ private void finishEdit(DefaultDocumentEvent ev)
+ {
// This for loop applies all the changes that were made and updates the
// DocumentEvent.
- int size = edits.size();
- for (int i = 0; i < size; i++)
- {
- Edit curr = (Edit) edits.get(i);
- BranchElement e = (BranchElement) curr.e;
- Element[] removed = curr.getRemovedElements();
- Element[] added = curr.getAddedElements();
- // FIXME: We probably shouldn't create the empty Element[] in the
- // first place.
- if (removed.length > 0 || added.length > 0)
- {
- if (curr.index + removed.length <= e.getElementCount())
- {
- e.replace(curr.index, removed.length, added);
- ElementEdit ee = new ElementEdit(e, curr.index, removed, added);
- ev.addEdit(ee);
- }
- else
- {
- System.err.println("WARNING: Tried to replace elements ");
- System.err.print("beyond boundaries: elementCount: ");
- System.err.println(e.getElementCount());
- System.err.print("index: " + curr.index);
- System.err.println(", removed.length: " + removed.length);
- }
- }
- }
+ for (Iterator i = edits.iterator(); i.hasNext();)
+ {
+ Edit edits = (Edit) i.next();
+ Element[] removed = new Element[edits.removed.size()];
+ removed = (Element[]) edits.removed.toArray(removed);
+ Element[] added = new Element[edits.added.size()];
+ added = (Element[]) edits.added.toArray(added);
+ int index = edits.index;
+ BranchElement parent = (BranchElement) edits.e;
+ parent.replace(index, removed.length, added);
+ ElementEdit ee = new ElementEdit(parent, index, removed, added);
+ ev.addEdit(ee);
+ }
+ edits.clear();
+ elementStack.clear();
}
/**
- * Inserts new content
+ * Inserts new content.
*
- * @param data
- * the element specifications for the elements to be inserted
+ * @param data the element specifications for the elements to be inserted
*/
protected void insertUpdate(ElementSpec[] data)
{
- // Push the root and the paragraph at offset onto the element stack.
+ // Push the current path to the stack.
Element current = root;
- int index;
- while (!current.isLeaf())
+ int index = current.getElementIndex(offset);
+ while (! current.isLeaf())
{
+ Element child = current.getElement(index);
+ int editIndex = child.isLeaf() ? index : index + 1;
+ Edit edit = new Edit(current, editIndex);
+ elementStack.push(edit);
+ current = child;
index = current.getElementIndex(offset);
- elementStack.push(current);
- current = current.getElement(index);
}
-
+
+ // Create a copy of the original path.
+ insertPath = new Edit[elementStack.size()];
+ insertPath = (Edit[]) elementStack.toArray(insertPath);
+
+ // No fracture yet.
+ createdFracture = false;
+
+ // Insert first content tag.
int i = 0;
+ recreateLeafs = false;
int type = data[0].getType();
if (type == ElementSpec.ContentType)
{
@@ -780,127 +1088,132 @@ public class DefaultStyledDocument extends AbstractDocument implements
createFracture(data);
i = 0;
}
-
+
// Handle each ElementSpec individually.
for (; i < data.length; i++)
{
- BranchElement paragraph = (BranchElement) elementStack.peek();
- switch (data[i].getType())
- {
- case ElementSpec.StartTagType:
- switch (data[i].getDirection())
- {
- case ElementSpec.JoinFractureDirection:
- // Fracture the tree and ensure the appropriate element
- // is on top of the stack.
- fracNotCreated = false;
- insertFracture(data[i]);
- if (fracNotCreated)
- {
- if (lastFractured != null)
- elementStack.push(lastFractured.getParentElement());
- else
- elementStack.push(paragraph.getElement(0));
- }
- break;
- case ElementSpec.JoinNextDirection:
- // Push the next paragraph element onto the stack so
- // future insertions are added to it.
- int ix = paragraph.getElementIndex(pos) + 1;
- elementStack.push(paragraph.getElement(ix));
- break;
- default:
- Element br = null;
- if (data.length > i + 1)
- {
- // leaves will be added to paragraph later
- int x = 0;
- if (paragraph.getElementCount() > 0)
- x = paragraph.getElementIndex(pos) + 1;
- Edit e = getEditForParagraphAndIndex(paragraph, x);
- br = (BranchElement) createBranchElement(paragraph,
- data[i].getAttributes());
- e.added.add(br);
- elementStack.push(br);
- }
- else
- // need to add leaves to paragraph now
- br = insertParagraph(paragraph, pos);
- break;
- }
- break;
- case ElementSpec.EndTagType:
- elementStack.pop();
- break;
- case ElementSpec.ContentType:
- insertContentTag(data[i]);
- offset = pos;
- break;
- }
+ insertElement(data[i]);
+ }
+
+ // Fracture if we haven't done yet.
+ if (! createdFracture)
+ fracture(-1);
+
+ // Pop the remaining stack.
+ while (elementStack.size() != 0)
+ pop();
+
+ // Offset last index if necessary.
+ if (offsetLastIndex && offsetLastIndexReplace)
+ insertPath[insertPath.length - 1].index++;
+
+ // Make sure we havea an Edit for each path item that has a change.
+ for (int p = insertPath.length - 1; p >= 0; p--)
+ {
+ Edit edit = insertPath[p];
+ if (edit.e == fracturedParent)
+ edit.added.add(fracturedChild);
+ if ((edit.added.size() > 0 || edit.removed.size() > 0)
+ && ! edits.contains(edit))
+ edits.add(edit);
+ }
+
+ // Remove element that would be created by an insert at 0 with
+ // an initial end tag.
+ if (offset == 0 && fracturedParent != null
+ && data[0].getType() == ElementSpec.EndTagType)
+ {
+ int p;
+ for (p = 0;
+ p < data.length && data[p].getType() == ElementSpec.EndTagType;
+ p++);
+ Edit edit = insertPath[insertPath.length - p - 1];
+ edit.index--;
+ edit.removed.add(0, edit.e.getElement(edit.index));
}
}
-
- /**
- * Inserts a new paragraph.
- *
- * @param par -
- * the parent
- * @param offset -
- * the offset
- * @return the new paragraph
- */
- private Element insertParagraph(BranchElement par, int offset)
+
+ private void pop()
+ {
+ Edit edit = (Edit) elementStack.peek();
+ elementStack.pop();
+ if ((edit.added.size() > 0) || (edit.removed.size() > 0))
+ {
+ edits.add(edit);
+ }
+ else if (! elementStack.isEmpty())
+ {
+ Element e = edit.e;
+ if (e.getElementCount() == 0)
+ {
+ // If we pushed a branch element that didn't get
+ // used, make sure its not marked as having been added.
+ edit = (Edit) elementStack.peek();
+ edit.added.remove(e);
+ }
+ }
+ }
+
+ private void insertElement(ElementSpec spec)
{
- int index = par.getElementIndex(offset);
- Element current = par.getElement(index);
- Element[] res = split(current, offset, 0, 0);
- Edit e = getEditForParagraphAndIndex(par, index + 1);
- Element ret;
- if (res[1] != null)
+ Edit edit = (Edit) elementStack.peek();
+ switch (spec.getType())
{
- Element[] removed;
- Element[] added;
- if (res[0] == null)
+ case ElementSpec.StartTagType:
+ switch (spec.getDirection())
{
- removed = new Element[0];
- if (res[1] instanceof BranchElement)
+ case ElementSpec.JoinFractureDirection:
+ // Fracture the tree and ensure the appropriate element
+ // is on top of the stack.
+ if (! createdFracture)
{
- added = new Element[] { res[1] };
- ret = res[1];
+ fracture(elementStack.size() - 1);
}
- else
+ if (! edit.isFracture)
{
- ret = createBranchElement(par, null);
- added = new Element[] { ret, res[1] };
+ // If the parent isn't a fracture, then the fracture is
+ // in fracturedChild.
+ Edit newEdit = new Edit(fracturedChild, 0, true);
+ elementStack.push(newEdit);
}
- index++;
- }
- else
- {
- removed = new Element[] { current };
- if (res[1] instanceof BranchElement)
+ else
{
- ret = res[1];
- added = new Element[] { res[0], res[1] };
+ // Otherwise use the parent's first child.
+ Element el = edit.e.getElement(0);
+ Edit newEdit = new Edit(el, 0, true);
+ elementStack.push(newEdit);
}
- else
+ break;
+ case ElementSpec.JoinNextDirection:
+ // Push the next paragraph element onto the stack so
+ // future insertions are added to it.
+ Element parent = edit.e.getElement(edit.index);
+ if (parent.isLeaf())
{
- ret = createBranchElement(par, null);
- added = new Element[] { res[0], ret, res[1] };
+ if (edit.index + 1 < edit.e.getElementCount())
+ parent = edit.e.getElement(edit.index + 1);
+ else
+ assert false; // Must not happen.
}
+ elementStack.push(new Edit(parent, 0, true));
+ break;
+ default:
+ Element branch = createBranchElement(edit.e,
+ spec.getAttributes());
+ edit.added.add(branch);
+ elementStack.push(new Edit(branch, 0));
+ break;
}
-
- e.addAddedElements(added);
- e.addRemovedElements(removed);
- }
- else
- {
- ret = createBranchElement(par, null);
- e.addAddedElement(ret);
+ break;
+ case ElementSpec.EndTagType:
+ pop();
+ break;
+ case ElementSpec.ContentType:
+ insertContentTag(spec, edit);
+ break;
}
- return ret;
}
-
+
/**
* Inserts the first tag into the document.
*
@@ -910,67 +1223,71 @@ public class DefaultStyledDocument extends AbstractDocument implements
private void insertFirstContentTag(ElementSpec[] data)
{
ElementSpec first = data[0];
- BranchElement paragraph = (BranchElement) elementStack.peek();
- int index = paragraph.getElementIndex(pos);
- Element current = paragraph.getElement(index);
- int newEndOffset = pos + first.length;
+ Edit edit = (Edit) elementStack.peek();
+ Element current = edit.e.getElement(edit.index);
+ int firstEndOffset = offset + first.length;
boolean onlyContent = data.length == 1;
- Edit edit = getEditForParagraphAndIndex(paragraph, index);
switch (first.getDirection())
{
case ElementSpec.JoinPreviousDirection:
- if (current.getEndOffset() != newEndOffset && !onlyContent)
+ if (current.getEndOffset() != firstEndOffset && ! onlyContent)
{
- Element newEl1 = createLeafElement(paragraph,
+ Element newEl1 = createLeafElement(edit.e,
current.getAttributes(),
current.getStartOffset(),
- newEndOffset);
- edit.addAddedElement(newEl1);
- edit.addRemovedElement(current);
- offset = newEndOffset;
+ firstEndOffset);
+ edit.added.add(newEl1);
+ edit.removed.add(current);
+ if (current.getEndOffset() != endOffset)
+ recreateLeafs = true;
+ else
+ offsetLastIndex = true;
+ }
+ else
+ {
+ offsetLastIndex = true;
+ offsetLastIndexReplace = true;
}
break;
case ElementSpec.JoinNextDirection:
- if (pos != 0)
+ if (offset != 0)
{
- Element newEl1 = createLeafElement(paragraph,
+ Element newEl1 = createLeafElement(edit.e,
current.getAttributes(),
current.getStartOffset(),
- pos);
- edit.addAddedElement(newEl1);
- Element next = paragraph.getElement(index + 1);
-
+ offset);
+ edit.added.add(newEl1);
+ Element next = edit.e.getElement(edit.index + 1);
if (onlyContent)
- newEl1 = createLeafElement(paragraph, next.getAttributes(),
- pos, next.getEndOffset());
+ newEl1 = createLeafElement(edit.e, next.getAttributes(),
+ offset, next.getEndOffset());
else
{
- newEl1 = createLeafElement(paragraph, next.getAttributes(),
- pos, newEndOffset);
- pos = newEndOffset;
+ newEl1 = createLeafElement(edit.e, next.getAttributes(),
+ offset, firstEndOffset);
}
- edit.addAddedElement(newEl1);
- edit.addRemovedElement(current);
- edit.addRemovedElement(next);
+ edit.added.add(newEl1);
+ edit.removed.add(current);
+ edit.removed.add(next);
}
break;
- default:
- if (current.getStartOffset() != pos)
+ default: // OriginateDirection.
+ if (current.getStartOffset() != offset)
{
- Element newEl = createLeafElement(paragraph,
+ Element newEl = createLeafElement(edit.e,
current.getAttributes(),
current.getStartOffset(),
- pos);
- edit.addAddedElement(newEl);
+ offset);
+ edit.added.add(newEl);
}
- edit.addRemovedElement(current);
- Element newEl1 = createLeafElement(paragraph, first.getAttributes(),
- pos, newEndOffset);
- edit.addAddedElement(newEl1);
+ edit.removed.add(current);
+ Element newEl1 = createLeafElement(edit.e, first.getAttributes(),
+ offset, firstEndOffset);
+ edit.added.add(newEl1);
if (current.getEndOffset() != endOffset)
- recreateLeaves(newEndOffset, paragraph, onlyContent);
+ recreateLeafs = true;
else
- offset = newEndOffset;
+ offsetLastIndex = true;
break;
}
}
@@ -981,630 +1298,356 @@ public class DefaultStyledDocument extends AbstractDocument implements
* @param tag -
* the element spec
*/
- private void insertContentTag(ElementSpec tag)
+ private void insertContentTag(ElementSpec tag, Edit edit)
{
- BranchElement paragraph = (BranchElement) elementStack.peek();
int len = tag.getLength();
int dir = tag.getDirection();
- AttributeSet tagAtts = tag.getAttributes();
-
if (dir == ElementSpec.JoinNextDirection)
{
- int index = paragraph.getElementIndex(pos);
- Element target = paragraph.getElement(index);
- Edit edit = getEditForParagraphAndIndex(paragraph, index);
-
- if (paragraph.getStartOffset() > pos)
- {
- Element first = paragraph.getElement(0);
- Element newEl = createLeafElement(paragraph,
- first.getAttributes(), pos,
- first.getEndOffset());
- edit.addAddedElement(newEl);
- edit.addRemovedElement(first);
- }
- else if (paragraph.getElementCount() > (index + 1)
- && (pos == target.getStartOffset() && !target.equals(lastFractured)))
+ if (! edit.isFracture)
{
- Element next = paragraph.getElement(index + 1);
- Element newEl = createLeafElement(paragraph,
- next.getAttributes(), pos,
- next.getEndOffset());
- edit.addAddedElement(newEl);
- edit.addRemovedElement(next);
- edit.addRemovedElement(target);
+ Element first = null;
+ if (insertPath != null)
+ {
+ for (int p = insertPath.length - 1; p >= 0; p--)
+ {
+ if (insertPath[p] == edit)
+ {
+ if (p != insertPath.length - 1)
+ first = edit.e.getElement(edit.index);
+ break;
+ }
+ }
+ }
+ if (first == null)
+ first = edit.e.getElement(edit.index + 1);
+ Element leaf = createLeafElement(edit.e, first.getAttributes(),
+ pos, first.getEndOffset());
+ edit.added.add(leaf);
+ edit.removed.add(first);
}
else
{
- BranchElement parent = (BranchElement) paragraph.getParentElement();
- int i = parent.getElementIndex(pos);
- BranchElement next = (BranchElement) parent.getElement(i + 1);
- AttributeSet atts = tag.getAttributes();
-
- if (next != null)
- {
- Element nextLeaf = next.getElement(0);
- Edit e = getEditForParagraphAndIndex(next, 0);
- Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset());
- e.addAddedElement(newEl2);
- e.addRemovedElement(nextLeaf);
- }
+ Element first = edit.e.getElement(0);
+ Element leaf = createLeafElement(edit.e, first.getAttributes(),
+ pos, first.getEndOffset());
+ edit.added.add(leaf);
+ edit.removed.add(first);
}
}
else
{
- int end = pos + len;
- Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end);
-
- // Check for overlap with other leaves/branches
- if (paragraph.getElementCount() > 0)
- {
- int index = paragraph.getElementIndex(pos);
- Element target = paragraph.getElement(index);
- boolean onlyContent = target.isLeaf();
-
- BranchElement toRec = paragraph;
- if (!onlyContent)
- toRec = (BranchElement) target;
-
- // Check if we should place the leaf before or after target
- if (pos > target.getStartOffset())
- index++;
-
- Edit edit = getEditForParagraphAndIndex(paragraph, index);
- edit.addAddedElement(leaf);
- }
- else
- paragraph.replace(0, 0, new Element[] { leaf });
+ Element leaf = createLeafElement(edit.e, tag.getAttributes(), pos,
+ pos + len);
+ edit.added.add(leaf);
}
-
+
pos += len;
+
}
/**
- * This method fractures the child at offset.
+ * This method fractures bottomost leaf in the elementStack. This
+ * happens when the first inserted tag is not content.
*
* @param data
* the ElementSpecs used for the entire insertion
*/
private void createFracture(ElementSpec[] data)
{
- BranchElement paragraph = (BranchElement) elementStack.peek();
- int index = paragraph.getElementIndex(offset);
- Element child = paragraph.getElement(index);
- Edit edit = getEditForParagraphAndIndex(paragraph, index);
- AttributeSet atts = child.getAttributes();
-
+ Edit edit = (Edit) elementStack.peek();
+ Element child = edit.e.getElement(edit.index);
if (offset != 0)
{
- Element newEl1 = createLeafElement(paragraph, atts,
- child.getStartOffset(), offset);
- edit.addAddedElement(newEl1);
- edit.addRemovedElement(child);
- }
- }
-
- /**
- * Recreates a specified part of a the tree after a new leaf
- * has been inserted.
- *
- * @param start - where to start recreating from
- * @param paragraph - the paragraph to recreate
- * @param onlyContent - true if this is the only content
- */
- private void recreateLeaves(int start, BranchElement paragraph, boolean onlyContent)
- {
- int index = paragraph.getElementIndex(start);
- Element child = paragraph.getElement(index);
- AttributeSet atts = child.getAttributes();
-
- if (!onlyContent)
- {
- BranchElement newBranch = (BranchElement) createBranchElement(paragraph,
- atts);
- Element newLeaf = createLeafElement(newBranch, atts, start,
- child.getEndOffset());
- newBranch.replace(0, 0, new Element[] { newLeaf });
-
- BranchElement parent = (BranchElement) paragraph.getParentElement();
- int parSize = parent.getElementCount();
- Edit edit = getEditForParagraphAndIndex(parent, parSize);
- edit.addAddedElement(newBranch);
-
- int paragraphSize = paragraph.getElementCount();
- Element[] removed = new Element[paragraphSize - (index + 1)];
- int s = 0;
- for (int j = index + 1; j < paragraphSize; j++)
- removed[s++] = paragraph.getElement(j);
-
- edit = getEditForParagraphAndIndex(paragraph, index);
- edit.addRemovedElements(removed);
- Element[] added = recreateAfterFracture(removed, newBranch, 0, child.getEndOffset());
- newBranch.replace(1, 0, added);
-
- lastFractured = newLeaf;
- pos = newBranch.getEndOffset();
+ Element newChild = createLeafElement(edit.e, child.getAttributes(),
+ child.getStartOffset(), offset);
+ edit.added.add(newChild);
}
+ edit.removed.add(child);
+ if (child.getEndOffset() != endOffset)
+ recreateLeafs = true;
else
- {
- Element newLeaf = createLeafElement(paragraph, atts, start,
- child.getEndOffset());
- Edit edit = getEditForParagraphAndIndex(paragraph, index);
- edit.addAddedElement(newLeaf);
- }
+ offsetLastIndex = true;
}
-
- /**
- * Splits an element if <code>offset</code> is not already at its
- * boundary.
- *
- * @param el
- * the Element to possibly split
- * @param offset
- * the offset at which to possibly split
- * @param space
- * the amount of space to create between the splitted parts
- * @param editIndex
- * the index of the edit to use
- * @return An array of elements which represent the split result. This array
- * has two elements, the two parts of the split. The first element
- * might be null, which means that the element which should be
- * splitted can remain in place. The second element might also be
- * null, which means that the offset is already at an element
- * boundary and the element doesn't need to be splitted.
- */
- private Element[] split(Element el, int offset, int space, int editIndex)
+
+ private void fracture(int depth)
{
- // If we are at an element boundary, then return an empty array.
- if ((offset == el.getStartOffset() || offset == el.getEndOffset())
- && space == 0 && el.isLeaf())
- return new Element[2];
-
- // If the element is an instance of BranchElement, then we
- // recursivly
- // call this method to perform the split.
- Element[] res = new Element[2];
- if (el instanceof BranchElement)
+ int len = insertPath.length;
+ int lastIndex = -1;
+ boolean recreate = recreateLeafs;
+ Edit lastEdit = insertPath[len - 1];
+ boolean childChanged = lastEdit.index + 1 < lastEdit.e.getElementCount();
+ int deepestChangedIndex = recreate ? len : - 1;
+ int lastChangedIndex = len - 1;
+ createdFracture = true;
+ for (int i = len - 2; i >= 0; i--)
{
- int index = el.getElementIndex(offset);
- Element child = el.getElement(index);
- Element[] result = split(child, offset, space, editIndex);
- Element[] removed;
- Element[] added;
- Element[] newAdded;
-
- int count = el.getElementCount();
- if (result[1] != null)
+ Edit edit = insertPath[i];
+ if (edit.added.size() > 0 || i == depth)
{
- // This is the case when we can keep the first element.
- if (result[0] == null)
- {
- removed = new Element[count - index - 1];
- newAdded = new Element[count - index - 1];
- added = new Element[] {};
-
- }
- // This is the case when we may not keep the first
- // element.
- else
- {
- removed = new Element[count - index];
- newAdded = new Element[count - index];
- added = new Element[] { result[0] };
- }
- newAdded[0] = result[1];
- for (int i = index; i < count; i++)
+ lastIndex = i;
+ if (! recreate && childChanged)
{
- Element el2 = el.getElement(i);
- int ind = i - count + removed.length;
- removed[ind] = el2;
- if (ind != 0)
- newAdded[ind] = el2;
+ recreate = true;
+ if (deepestChangedIndex == -1)
+ deepestChangedIndex = lastChangedIndex + 1;
}
-
- Edit edit = getEditForParagraphAndIndex((BranchElement) el, editIndex);
- edit.addRemovedElements(removed);
- edit.addAddedElements(added);
-
- BranchElement newPar =
- (BranchElement) createBranchElement(el.getParentElement(),
- el.getAttributes());
- newPar.replace(0, 0, newAdded);
- res = new Element[] { null, newPar };
}
- else
+ if (! childChanged && edit.index < edit.e.getElementCount())
{
- removed = new Element[count - index];
- for (int i = index; i < count; ++i)
- removed[i - index] = el.getElement(i);
-
- Edit edit = getEditForParagraphAndIndex((BranchElement) el, editIndex);
- edit.addRemovedElements(removed);
-
- BranchElement newPar = (BranchElement) createBranchElement(el.getParentElement(),
- el.getAttributes());
- newPar.replace(0, 0, removed);
- res = new Element[] { null, newPar };
+ childChanged = true;
+ lastChangedIndex = i;
}
}
- else if (el instanceof LeafElement)
+ if (recreate)
{
- BranchElement par = (BranchElement) el.getParentElement();
- Element el1 = createLeafElement(par, el.getAttributes(),
- el.getStartOffset(), offset);
-
- Element el2 = createLeafElement(par, el.getAttributes(),
- offset + space,
- el.getEndOffset());
- res = new Element[] { el1, el2 };
+ if (lastIndex == -1)
+ lastIndex = len - 1;
+ recreate(lastIndex, deepestChangedIndex);
}
- return res;
}
- /**
- * Inserts a fracture into the document structure.
- *
- * @param tag -
- * the element spec.
- */
- private void insertFracture(ElementSpec tag)
+ private void recreate(int startIndex, int endIndex)
{
- // insert the fracture at offset.
- BranchElement parent = (BranchElement) elementStack.peek();
- int parentIndex = parent.getElementIndex(pos);
- AttributeSet parentAtts = parent.getAttributes();
- Element toFracture = parent.getElement(parentIndex);
- int parSize = parent.getElementCount();
- Edit edit = getEditForParagraphAndIndex(parent, parentIndex);
- Element frac = toFracture;
- int leftIns = 0;
- int indexOfFrac = toFracture.getElementIndex(pos);
- int size = toFracture.getElementCount();
-
- // gets the leaf that falls along the fracture
- frac = toFracture.getElement(indexOfFrac);
- while (!frac.isLeaf())
- frac = frac.getElement(frac.getElementIndex(pos));
-
- AttributeSet atts = frac.getAttributes();
- int fracStart = frac.getStartOffset();
- int fracEnd = frac.getEndOffset();
- if (pos >= fracStart && pos < fracEnd)
+ // Recreate the element representing the inserted index.
+ Edit edit = insertPath[startIndex];
+ Element child;
+ Element newChild;
+ int changeLength = insertPath.length;
+
+ if (startIndex + 1 == changeLength)
+ child = edit.e.getElement(edit.index);
+ else
+ child = edit.e.getElement(edit.index - 1);
+
+ if(child.isLeaf())
+ {
+ newChild = createLeafElement(edit.e, child.getAttributes(),
+ Math.max(endOffset, child.getStartOffset()),
+ child.getEndOffset());
+ }
+ else
{
- // recreate left-side of branch and all its children before offset
- // add the fractured leaves to the right branch
- BranchElement rightBranch =
- (BranchElement) createBranchElement(parent, parentAtts);
-
- // Check if left branch has already been edited. If so, we only
- // need to create the right branch.
- BranchElement leftBranch = null;
- Element[] added = null;
- if (edit.added.size() > 0 || edit.removed.size() > 0)
+ newChild = createBranchElement(edit.e, child.getAttributes());
+ }
+ fracturedParent = edit.e;
+ fracturedChild = newChild;
+
+ // Recreate all the elements to the right of the insertion point.
+ Element parent = newChild;
+ while (++startIndex < endIndex)
+ {
+ boolean isEnd = (startIndex + 1) == endIndex;
+ boolean isEndLeaf = (startIndex + 1) == changeLength;
+
+ // Create the newChild, a duplicate of the elment at
+ // index. This isn't done if isEnd and offsetLastIndex are true
+ // indicating a join previous was done.
+ edit = insertPath[startIndex];
+
+ // Determine the child to duplicate, won't have to duplicate
+ // if at end of fracture, or offseting index.
+ if(isEnd)
{
- added = new Element[] { rightBranch };
-
- // don't try to remove left part of tree
- parentIndex++;
+ if(offsetLastIndex || ! isEndLeaf)
+ child = null;
+ else
+ child = edit.e.getElement(edit.index);
}
else
{
- leftBranch =
- (BranchElement) createBranchElement(parent, parentAtts);
- added = new Element[] { leftBranch, rightBranch };
-
- // add fracture to leftBranch
- if (fracStart != pos)
- {
- Element leftFracturedLeaf =
- createLeafElement(leftBranch, atts, fracStart, pos);
- leftBranch.replace(leftIns, 0,
- new Element[] { leftFracturedLeaf });
- }
+ child = edit.e.getElement(edit.index - 1);
}
- if (!toFracture.isLeaf())
+ // Duplicate it.
+ if(child != null)
{
- // add all non-fracture elements to the branches
- if (indexOfFrac > 0 && leftBranch != null)
+ if(child.isLeaf())
{
- Element[] add = new Element[indexOfFrac];
- for (int i = 0; i < indexOfFrac; i++)
- add[i] = toFracture.getElement(i);
- leftIns = add.length;
- leftBranch.replace(0, 0, add);
+ newChild = createLeafElement(parent, child.getAttributes(),
+ Math.max(endOffset, child.getStartOffset()),
+ child.getEndOffset());
}
-
- int count = size - indexOfFrac - 1;
- if (count > 0)
+ else
{
- Element[] add = new Element[count];
- int j = 0;
- int i = indexOfFrac + 1;
- while (j < count)
- add[j++] = toFracture.getElement(i++);
- rightBranch.replace(0, 0, add);
+ newChild = createBranchElement(parent,
+ child.getAttributes());
}
}
-
- // add to fracture to rightBranch
- // Check if we can join the right frac leaf with the next leaf
- int rm = 0;
- int end = fracEnd;
- Element next = rightBranch.getElement(0);
- if (next != null && next.isLeaf()
- && next.getAttributes().isEqual(atts))
- {
- end = next.getEndOffset();
- rm = 1;
- }
+ else
+ newChild = null;
- Element rightFracturedLeaf = createLeafElement(rightBranch, atts,
- pos, end);
- rightBranch.replace(0, rm, new Element[] { rightFracturedLeaf });
+ // Recreate the remaining children (there may be none).
+ int childrenToMove = edit.e.getElementCount() - edit.index;
+ Element[] children;
+ int moveStartIndex;
+ int childStartIndex = 1;
- // recreate those elements after parentIndex and add/remove all
- // new/old elements to parent
- int remove = parSize - parentIndex;
- Element[] removed = new Element[0];
- Element[] added2 = new Element[0];
- if (remove > 0)
- {
- removed = new Element[remove];
- int s = 0;
- for (int j = parentIndex; j < parSize; j++)
- removed[s++] = parent.getElement(j);
- edit.addRemovedElements(removed);
- added2 = recreateAfterFracture(removed, parent, 1,
- rightBranch.getEndOffset());
+ if (newChild == null)
+ {
+ // Last part of fracture.
+ if (isEndLeaf)
+ {
+ childrenToMove--;
+ moveStartIndex = edit.index + 1;
+ }
+ else
+ {
+ moveStartIndex = edit.index;
+ }
+ childStartIndex = 0;
+ children = new Element[childrenToMove];
+ }
+ else
+ {
+ if (! isEnd)
+ {
+ // Branch.
+ childrenToMove++;
+ moveStartIndex = edit.index;
}
-
- edit.addAddedElements(added);
- edit.addAddedElements(added2);
- elementStack.push(rightBranch);
- lastFractured = rightFracturedLeaf;
+ else
+ {
+ // Last leaf, need to recreate part of it.
+ moveStartIndex = edit.index + 1;
+ }
+ children = new Element[childrenToMove];
+ children[0] = newChild;
}
- else
- fracNotCreated = true;
+
+ for (int c = childStartIndex; c < childrenToMove; c++)
+ {
+ Element toMove = edit.e.getElement(moveStartIndex++);
+ children[c] = recreateFracturedElement(parent, toMove);
+ edit.removed.add(toMove);
+ }
+ ((BranchElement) parent).replace(0, 0, children);
+ parent = newChild;
+ }
+
}
- /**
- * Recreates all the elements from the parent to the element on the top of
- * the stack, starting from startFrom with the starting offset of
- * startOffset.
- *
- * @param recreate -
- * the elements to recreate
- * @param parent -
- * the element to add the new elements to
- * @param startFrom -
- * where to start recreating from
- * @param startOffset -
- * the offset of the first element
- * @return the array of added elements
- */
- private Element[] recreateAfterFracture(Element[] recreate,
- BranchElement parent, int startFrom,
- int startOffset)
+ private Element recreateFracturedElement(Element parent, Element toCopy)
{
- Element[] added = new Element[recreate.length - startFrom];
- int j = 0;
- for (int i = startFrom; i < recreate.length; i++)
+ Element recreated;
+ if(toCopy.isLeaf())
{
- Element curr = recreate[i];
- int len = curr.getEndOffset() - curr.getStartOffset();
- if (curr instanceof LeafElement)
- added[j] = createLeafElement(parent, curr.getAttributes(),
- startOffset, startOffset + len);
- else
+ recreated = createLeafElement(parent, toCopy.getAttributes(),
+ Math.max(toCopy.getStartOffset(), endOffset),
+ toCopy.getEndOffset());
+ }
+ else
+ {
+ Element newParent = createBranchElement(parent,
+ toCopy.getAttributes());
+ int childCount = toCopy.getElementCount();
+ Element[] newChildren = new Element[childCount];
+ for (int i = 0; i < childCount; i++)
{
- BranchElement br =
- (BranchElement) createBranchElement(parent,
- curr.getAttributes());
- int bSize = curr.getElementCount();
- for (int k = 0; k < bSize; k++)
- {
- Element bCurr = curr.getElement(k);
- Element[] add = recreateAfterFracture(new Element[] { bCurr }, br, 0,
- startOffset);
- br.replace(0, 0, add);
-
- }
- added[j] = br;
+ newChildren[i] = recreateFracturedElement(newParent,
+ toCopy.getElement(i));
}
- startOffset += len;
- j++;
+ ((BranchElement) newParent).replace(0, 0, newChildren);
+ recreated = newParent;
}
-
- return added;
- }
- }
-
- /**
- * This method looks through the Vector of Edits to see if there is already an
- * Edit object associated with the given paragraph. If there is, then we
- * return it. Otherwise we create a new Edit object, add it to the vector, and
- * return it. Note: this method is package private to avoid accessors.
- *
- * @param index
- * the index associated with the Edit we want to create
- * @param para
- * the paragraph associated with the Edit we want
- * @return the found or created Edit object
- */
- Edit getEditForParagraphAndIndex(BranchElement para, int index)
- {
- Edit curr;
- int size = edits.size();
- for (int i = 0; i < size; i++)
- {
- curr = (Edit) edits.elementAt(i);
- if (curr.e.equals(para))
- return curr;
- }
- curr = new Edit(para, index, null, null);
- edits.add(curr);
-
- return curr;
- }
- /**
- * Instance of all editing information for an object in the Vector. This class
- * is used to add information to the DocumentEvent associated with an
- * insertion/removal/change as well as to store the changes that need to be
- * made so they can be made all at the same (appropriate) time.
- */
- class Edit
- {
- /** The element to edit . */
- Element e;
-
- /** The index of the change. */
- int index;
-
- /** The removed elements. */
- Vector removed = new Vector();
-
- /** The added elements. */
- Vector added = new Vector();
-
- /**
- * Return an array containing the Elements that have been removed from the
- * paragraph associated with this Edit.
- *
- * @return an array of removed Elements
- */
- public Element[] getRemovedElements()
- {
- int size = removed.size();
- Element[] removedElements = new Element[size];
- for (int i = 0; i < size; i++)
- removedElements[i] = (Element) removed.elementAt(i);
- return removedElements;
+ return recreated;
}
- /**
- * Return an array containing the Elements that have been added to the
- * paragraph associated with this Edit.
- *
- * @return an array of added Elements
- */
- public Element[] getAddedElements()
+ private boolean split(int offs, int len)
{
- int size = added.size();
- Element[] addedElements = new Element[size];
- for (int i = 0; i < size; i++)
- addedElements[i] = (Element) added.elementAt(i);
- return addedElements;
- }
-
- /**
- * Checks if e is already in the vector.
- *
- * @param e - the Element to look for
- * @param v - the vector to search
- * @return true if e is in v.
- */
- private boolean contains(Vector v, Element e)
- {
- if (e == null)
- return false;
-
- int i = v.size();
- for (int j = 0; j < i; j++)
+ boolean splitEnd = false;
+ // Push the path to the stack.
+ Element e = root;
+ int index = e.getElementIndex(offs);
+ while (! e.isLeaf())
{
- Element e1 = (Element) v.get(j);
- if ((e1 != null) && (e1.getAttributes().isEqual(e.getAttributes()))
- && (e1.getName().equals(e.getName()))
- && (e1.getStartOffset() == e.getStartOffset())
- && (e1.getEndOffset() == e.getEndOffset())
- && (e1.getParentElement().equals(e.getParentElement()))
- && (e1.getElementCount() == e.getElementCount()))
- return true;
+ elementStack.push(new Edit(e, index));
+ e = e.getElement(index);
+ index = e.getElementIndex(offs);
}
- return false;
- }
- /**
- * Adds one Element to the vector of removed Elements.
- *
- * @param e
- * the Element to add
- */
- public void addRemovedElement(Element e)
- {
- if (!contains(removed, e))
- removed.add(e);
- }
-
- /**
- * Adds each Element in the given array to the vector of removed Elements
- *
- * @param e
- * the array containing the Elements to be added
- */
- public void addRemovedElements(Element[] e)
- {
- if (e == null || e.length == 0)
- return;
- for (int i = 0; i < e.length; i++)
+ Edit ec = (Edit) elementStack.peek();
+ Element child = ec.e.getElement(ec.index);
+ // Make sure there is something to do. If the
+ // offset is already at a boundary then there is
+ // nothing to do.
+ if (child.getStartOffset() < offs && offs < child.getEndOffset())
{
- if (!contains(removed, e[i]))
- removed.add(e[i]);
- }
- }
+ // We need to split, now see if the other end is within
+ // the same parent.
+ int index0 = ec.index;
+ int index1 = index0;
+ if (((offs + len) < ec.e.getEndOffset()) && (len != 0))
+ {
+ // It's a range split in the same parent.
+ index1 = ec.e.getElementIndex(offs+len);
+ if (index1 == index0)
+ {
+ // It's a three-way split.
+ ec.removed.add(child);
+ e = createLeafElement(ec.e, child.getAttributes(),
+ child.getStartOffset(), offs);
+ ec.added.add(e);
+ e = createLeafElement(ec.e, child.getAttributes(),
+ offs, offs + len);
+ ec.added.add(e);
+ e = createLeafElement(ec.e, child.getAttributes(),
+ offs + len, child.getEndOffset());
+ ec.added.add(e);
+ return true;
+ }
+ else
+ {
+ child = ec.e.getElement(index1);
+ if ((offs + len) == child.getStartOffset())
+ {
+ // End is already on a boundary.
+ index1 = index0;
+ }
+ }
+ splitEnd = true;
+ }
- /**
- * Adds one Element to the vector of added Elements.
- *
- * @param e
- * the Element to add
- */
- public void addAddedElement(Element e)
- {
- if (!contains(added, e))
- added.add(e);
- }
+ // Split the first location.
+ pos = offs;
+ child = ec.e.getElement(index0);
+ ec.removed.add(child);
+ e = createLeafElement(ec.e, child.getAttributes(),
+ child.getStartOffset(), pos);
+ ec.added.add(e);
+ e = createLeafElement(ec.e, child.getAttributes(),
+ pos, child.getEndOffset());
+ ec.added.add(e);
+
+ // Pick up things in the middle.
+ for (int i = index0 + 1; i < index1; i++)
+ {
+ child = ec.e.getElement(i);
+ ec.removed.add(child);
+ ec.added.add(child);
+ }
- /**
- * Adds each Element in the given array to the vector of added Elements.
- *
- * @param e
- * the array containing the Elements to be added
- */
- public void addAddedElements(Element[] e)
- {
- if (e == null || e.length == 0)
- return;
- for (int i = 0; i < e.length; i++)
- {
- if (!contains(added, e[i]))
- added.add(e[i]);
+ if (index1 != index0)
+ {
+ child = ec.e.getElement(index1);
+ pos = offs + len;
+ ec.removed.add(child);
+ e = createLeafElement(ec.e, child.getAttributes(),
+ child.getStartOffset(), pos);
+ ec.added.add(e);
+ e = createLeafElement(ec.e, child.getAttributes(),
+ pos, child.getEndOffset());
+
+ ec.added.add(e);
+ }
}
+ return splitEnd;
+
}
- /**
- * Creates a new Edit object with the given parameters
- *
- * @param e
- * the paragraph Element associated with this Edit
- * @param i
- * the index within the paragraph where changes are started
- * @param removed
- * an array containing Elements that should be removed from the
- * paragraph Element
- * @param added
- * an array containing Elements that should be added to the
- * paragraph Element
- */
- public Edit(Element e, int i, Element[] removed, Element[] added)
- {
- this.e = e;
- this.index = i;
- addRemovedElements(removed);
- addAddedElements(added);
- }
}
+
/**
* An element type for sections. This is a simple BranchElement with a unique
* name.
@@ -1674,11 +1717,6 @@ public class DefaultStyledDocument extends AbstractDocument implements
private StyleChangeListener styleChangeListener;
/**
- * Vector that contains all the edits. Maybe replace by a HashMap.
- */
- Vector edits = new Vector();
-
- /**
* Creates a new <code>DefaultStyledDocument</code>.
*/
public DefaultStyledDocument()
@@ -1939,7 +1977,6 @@ public class DefaultStyledDocument extends AbstractDocument implements
// start and ends at an element end.
buffer.change(offset, length, ev);
- Element root = getDefaultRootElement();
// Visit all paragraph elements within the specified interval
int end = offset + length;
Element curr;
@@ -2079,147 +2116,220 @@ public class DefaultStyledDocument extends AbstractDocument implements
*/
protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr)
{
- super.insertUpdate(ev, attr);
- // If the attribute set is null, use an empty attribute set.
+ int offs = ev.getOffset();
+ int len = ev.getLength();
+ int endOffs = offs + len;
if (attr == null)
attr = SimpleAttributeSet.EMPTY;
- int offset = ev.getOffset();
- int length = ev.getLength();
- int endOffset = offset + length;
- AttributeSet paragraphAttributes = getParagraphElement(endOffset).getAttributes();
- Segment txt = new Segment();
+
+ // Paragraph attributes are fetched from the point _after_ the insertion.
+ Element paragraph = getParagraphElement(endOffs);
+ AttributeSet pAttr = paragraph.getAttributes();
+ // Character attributes are fetched from the actual insertion point.
+ Element paragraph2 = getParagraphElement(offs);
+ int contIndex = paragraph2.getElementIndex(offs);
+ Element content = paragraph2.getElement(contIndex);
+ AttributeSet cAttr = content.getAttributes();
+
+ boolean insertAtBoundary = content.getEndOffset() == endOffs;
try
{
- getText(offset, length, txt);
- }
- catch (BadLocationException ex)
- {
- AssertionError ae = new AssertionError("Unexpected bad location");
- ae.initCause(ex);
- throw ae;
- }
+ Segment s = new Segment();
+ ArrayList buf = new ArrayList();
+ ElementSpec lastStartTag = null;
+ boolean insertAfterNewline = false;
+ short lastStartDir = ElementSpec.OriginateDirection;
+
+ // Special handle if we are inserting after a newline.
+ if (offs > 0)
+ {
+ getText(offs - 1, 1, s);
+ if (s.array[s.offset] == '\n')
+ {
+ insertAfterNewline = true;
+ lastStartDir = insertAfterNewline(paragraph, paragraph2,
+ pAttr, buf, offs,
+ endOffs);
+ // Search last start tag.
+ for (int i = buf.size() - 1; i >= 0 && lastStartTag == null;
+ i--)
+ {
+ ElementSpec tag = (ElementSpec) buf.get(i);
+ if (tag.getType() == ElementSpec.StartTagType)
+ {
+ lastStartTag = tag;
+ }
+ }
+ }
- int len = 0;
- Vector specs = new Vector();
- ElementSpec finalStartTag = null;
- short finalStartDirection = ElementSpec.OriginateDirection;
- boolean prevCharWasNewline = false;
- Element prev = getCharacterElement(offset);
- Element next = getCharacterElement(endOffset);
- Element prevParagraph = getParagraphElement(offset);
- Element paragraph = getParagraphElement(endOffset);
+ }
- int segmentEnd = txt.offset + txt.count;
+ // If we are not inserting after a newline, the paragraph attributes
+ // come from the paragraph under the insertion point.
+ if (! insertAfterNewline)
+ pAttr = paragraph2.getAttributes();
- // Check to see if we're inserting immediately after a newline.
- if (offset > 0)
- {
- try
+ // Scan text and build up the specs.
+ getText(offs, len, s);
+ int end = s.offset + s.count;
+ int last = s.offset;
+ for (int i = s.offset; i < end; i++)
{
- String s = getText(offset - 1, 1);
- if (s.equals("\n"))
+ if (s.array[i] == '\n')
{
- finalStartDirection = handleInsertAfterNewline(specs, offset,
- endOffset,
- prevParagraph,
- paragraph,
- paragraphAttributes);
-
- prevCharWasNewline = true;
- // Find the final start tag from the ones just created.
- for (int i = 0; i < specs.size(); i++)
- if (((ElementSpec) specs.get(i)).getType() == ElementSpec.StartTagType)
- finalStartTag = (ElementSpec) specs.get(i);
+ int breakOffs = i + 1;
+ buf.add(new ElementSpec(attr, ElementSpec.ContentType,
+ breakOffs - last));
+ buf.add(new ElementSpec(null, ElementSpec.EndTagType));
+ lastStartTag = new ElementSpec(pAttr,
+ ElementSpec.StartTagType);
+ buf.add(lastStartTag);
+ last = breakOffs;
}
}
- catch (BadLocationException ble)
+
+ // Need to add a tailing content tag if we didn't finish at a boundary.
+ if (last < end)
{
- // This shouldn't happen.
- AssertionError ae = new AssertionError();
- ae.initCause(ble);
- throw ae;
+ buf.add(new ElementSpec(attr, ElementSpec.ContentType,
+ end - last));
}
- }
- for (int i = txt.offset; i < segmentEnd; ++i)
- {
- len++;
- if (txt.array[i] == '\n')
+ // Now we need to fix up the directions of the specs.
+ ElementSpec first = (ElementSpec) buf.get(0);
+ int doclen = getLength();
+
+ // Maybe join-previous the first tag if it is content and has
+ // the same attributes as the previous character run.
+ if (first.getType() == ElementSpec.ContentType && cAttr.isEqual(attr))
+ first.setDirection(ElementSpec.JoinPreviousDirection);
+
+ // Join-fracture or join-next the last start tag if necessary.
+ if (lastStartTag != null)
+ {
+ if (insertAfterNewline)
+ lastStartTag.setDirection(lastStartDir);
+ else if (paragraph2.getEndOffset() != endOffs)
+ lastStartTag.setDirection(ElementSpec.JoinFractureDirection);
+ else
+ {
+ Element par = paragraph2.getParentElement();
+ int par2Index = par.getElementIndex(offs);
+ if (par2Index + 1 < par.getElementCount()
+ && ! par.getElement(par2Index + 1).isLeaf())
+ lastStartTag.setDirection(ElementSpec.JoinNextDirection);
+ }
+ }
+
+ // Join-next last tag if possible.
+ if (insertAtBoundary && endOffs < doclen)
{
- // Add the ElementSpec for the content.
- specs.add(new ElementSpec(attr, ElementSpec.ContentType, len));
-
- // Add ElementSpecs for the newline.
- specs.add(new ElementSpec(null, ElementSpec.EndTagType));
- finalStartTag = new ElementSpec(paragraphAttributes,
- ElementSpec.StartTagType);
- specs.add(finalStartTag);
- len = 0;
+ ElementSpec lastTag = (ElementSpec) buf.get(buf.size() - 1);
+ if (lastTag.getType() == ElementSpec.ContentType
+ && ((lastStartTag == null
+ && (paragraph == paragraph2 || insertAfterNewline))
+ || (lastStartTag != null
+ && lastStartTag.getDirection() != ElementSpec.OriginateDirection)))
+ {
+ int nextIndex = paragraph.getElementIndex(endOffs);
+ Element nextRun = paragraph.getElement(nextIndex);
+ if (nextRun.isLeaf() && attr.isEqual(nextRun.getAttributes()))
+ lastTag.setDirection(ElementSpec.JoinNextDirection);
+ }
+ }
+
+ else if (! insertAtBoundary && lastStartTag != null
+ && lastStartTag.getDirection() == ElementSpec.JoinFractureDirection)
+ {
+ ElementSpec lastTag = (ElementSpec) buf.get(buf.size() - 1);
+ if (lastTag.getType() == ElementSpec.ContentType
+ && lastTag.getDirection() != ElementSpec.JoinPreviousDirection
+ && attr.isEqual(cAttr))
+ {
+ lastTag.setDirection(ElementSpec.JoinNextDirection);
+ }
}
- }
- // Create last element if last character hasn't been a newline.
- if (len > 0)
- specs.add(new ElementSpec(attr, ElementSpec.ContentType, len));
+ ElementSpec[] specs = new ElementSpec[buf.size()];
+ specs = (ElementSpec[]) buf.toArray(specs);
+ buffer.insert(offs, len, specs, ev);
+ }
+ catch (BadLocationException ex)
+ {
+ // Ignore this. Comment out for debugging.
+ ex.printStackTrace();
+ }
+ super.insertUpdate(ev, attr);
+ }
- // Set the direction of the last spec of type StartTagType.
- // If we are inserting after a newline then this value comes from
- // handleInsertAfterNewline.
- if (finalStartTag != null)
+ private short insertAfterNewline(Element par1, Element par2,
+ AttributeSet attr, ArrayList buf,
+ int offs, int endOffs)
+ {
+ short dir = 0;
+ if (par1.getParentElement() == par2.getParentElement())
{
- if (prevCharWasNewline)
- finalStartTag.setDirection(finalStartDirection);
- else if (prevParagraph.getEndOffset() != endOffset)
- finalStartTag.setDirection(ElementSpec.JoinFractureDirection);
+ ElementSpec tag = new ElementSpec(attr, ElementSpec.EndTagType);
+ buf.add(tag);
+ tag = new ElementSpec(attr, ElementSpec.StartTagType);
+ buf.add(tag);
+ if (par2.getEndOffset() != endOffs)
+ dir = ElementSpec.JoinFractureDirection;
else
{
- // If there is an element AFTER this one, then set the
- // direction to JoinNextDirection.
- Element parent = prevParagraph.getParentElement();
- int index = parent.getElementIndex(offset);
- if (index + 1 < parent.getElementCount()
- && !parent.getElement(index + 1).isLeaf())
- finalStartTag.setDirection(ElementSpec.JoinNextDirection);
+ Element par = par2.getParentElement();
+ if (par.getElementIndex(offs) + 1 < par.getElementCount())
+ dir = ElementSpec.JoinNextDirection;
}
}
-
- // If we are at the last index, then check if we could probably be
- // joined with the next element.
- // This means:
- // - we must be a ContentTag
- // - if there is a next Element, we must have the same attributes
- // - if there is no next Element, but one will be created,
- // we must have the same attributes as the higher-level run.
- ElementSpec last = (ElementSpec) specs.lastElement();
- if (last.getType() == ElementSpec.ContentType)
+ else
{
- Element currentRun = prevParagraph.getElement(prevParagraph.getElementIndex(offset));
- if (currentRun.getEndOffset() == endOffset)
+ // For text with more than 2 levels, find the common parent of
+ // par1 and par2.
+ ArrayList parentsLeft = new ArrayList();
+ ArrayList parentsRight = new ArrayList();
+ Element e = par2;
+ while (e != null)
{
- if (endOffset < getLength() && next.getAttributes().isEqual(attr)
- && last.getType() == ElementSpec.ContentType)
- last.setDirection(ElementSpec.JoinNextDirection);
+ parentsLeft.add(e);
+ e = e.getParentElement();
}
- else
+ e = par1;
+ int leftIndex = -1;
+ while (e != null && (leftIndex = parentsLeft.indexOf(e)) == 1)
{
- if (finalStartTag != null
- && finalStartTag.getDirection() == ElementSpec.JoinFractureDirection
- && currentRun.getAttributes().isEqual(attr))
+ parentsRight.add(e);
+ e = e.getParentElement();
+ }
+
+ if (e != null)
+
+ {
+ // e is now the common parent.
+ // Insert the end tags.
+ for (int c = 0; c < leftIndex; c++)
+ {
+ buf.add(new ElementSpec(null, ElementSpec.EndTagType));
+ }
+ // Insert the start tags.
+ for (int c = parentsRight.size() - 1; c >= 0; c--)
{
- last.setDirection(ElementSpec.JoinNextDirection);
+ Element el = (Element) parentsRight.get(c);
+ ElementSpec tag = new ElementSpec(el.getAttributes(),
+ ElementSpec.StartTagType);
+ if (c > 0)
+ tag.setDirection(ElementSpec.JoinNextDirection);
+ buf.add(tag);
}
+ if (parentsRight.size() > 0)
+ dir = ElementSpec.JoinNextDirection;
+ else
+ dir = ElementSpec.JoinFractureDirection;
}
+ else
+ assert false;
}
-
- // If we are at the first new element, then check if it could be
- // joined with the previous element.
- ElementSpec first = (ElementSpec) specs.firstElement();
- if (prev.getAttributes().isEqual(attr)
- && first.getType() == ElementSpec.ContentType)
- first.setDirection(ElementSpec.JoinPreviousDirection);
-
- ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]);
- buffer.insert(offset, length, elSpecs, ev);
+ return dir;
}
/**
@@ -2267,7 +2377,7 @@ public class DefaultStyledDocument extends AbstractDocument implements
*
* @return an enumeration of all style names
*/
- public Enumeration getStyleNames()
+ public Enumeration<?> getStyleNames()
{
StyleContext context = (StyleContext) getAttributeContext();
return context.getStyleNames();
@@ -2322,18 +2432,24 @@ public class DefaultStyledDocument extends AbstractDocument implements
if (length == 0)
return;
- UndoableEdit edit = content.insertString(offset,
- contentBuffer.toString());
+ Content c = getContent();
+ UndoableEdit edit = c.insertString(offset,
+ contentBuffer.toString());
// Create the DocumentEvent with the ElementEdit added
DefaultDocumentEvent ev = new DefaultDocumentEvent(offset,
length,
DocumentEvent.EventType.INSERT);
+
ev.addEdit(edit);
// Finally we must update the document structure and fire the insert
// update event.
buffer.insert(offset, length, data, ev);
+
+ super.insertUpdate(ev, null);
+
+ ev.end();
fireInsertUpdate(ev);
fireUndoableEditUpdate(new UndoableEditEvent(this, ev));
}
@@ -2353,14 +2469,16 @@ public class DefaultStyledDocument extends AbstractDocument implements
*/
protected void create(ElementSpec[] data)
{
- writeLock();
try
{
+
// Clear content if there is some.
int len = getLength();
if (len > 0)
remove(0, len);
+ writeLock();
+
// Now we insert the content.
StringBuilder b = new StringBuilder();
for (int i = 0; i < data.length; ++i)
@@ -2372,38 +2490,18 @@ public class DefaultStyledDocument extends AbstractDocument implements
Content content = getContent();
UndoableEdit cEdit = content.insertString(0, b.toString());
+ len = b.length();
DefaultDocumentEvent ev =
new DefaultDocumentEvent(0, b.length(),
DocumentEvent.EventType.INSERT);
ev.addEdit(cEdit);
- // We do a little trick here to get the new structure: We instantiate
- // a new ElementBuffer with a new root element, insert into that root
- // and then reparent the newly created elements to the old root
- // element.
- BranchElement createRoot =
- (BranchElement) createBranchElement(null, null);
- Element dummyLeaf = createLeafElement(createRoot, null, 0, 1);
- createRoot.replace(0, 0, new Element[]{ dummyLeaf });
- ElementBuffer createBuffer = new ElementBuffer(createRoot);
- createBuffer.insert(0, b.length(), data, new DefaultDocumentEvent(0, b.length(), DocumentEvent.EventType.INSERT));
- // Now the new root is the first child of the createRoot.
- Element newRoot = createRoot.getElement(0);
- BranchElement root = (BranchElement) getDefaultRootElement();
- Element[] added = new Element[newRoot.getElementCount()];
- for (int i = 0; i < added.length; ++i)
- {
- added[i] = newRoot.getElement(i);
- ((AbstractElement) added[i]).element_parent = root;
- }
- Element[] removed = new Element[root.getElementCount()];
- for (int i = 0; i < removed.length; ++i)
- removed[i] = root.getElement(i);
+ buffer.create(len, data, ev);
- // Replace the old elements in root with the new and update the event.
- root.replace(0, removed.length, added);
- ev.addEdit(new ElementEdit(root, 0, removed, added));
+ // For the bidi update.
+ super.insertUpdate(ev, null);
+ ev.end();
fireInsertUpdate(ev);
fireUndoableEditUpdate(new UndoableEditEvent(this, ev));
}
diff --git a/libjava/classpath/javax/swing/text/ElementIterator.java b/libjava/classpath/javax/swing/text/ElementIterator.java
index a6a5ff618bd..112d55e96d0 100644
--- a/libjava/classpath/javax/swing/text/ElementIterator.java
+++ b/libjava/classpath/javax/swing/text/ElementIterator.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package javax.swing.text;
+import java.util.Stack;
+
/**
* This class can be used to iterate over the {@link Element} tree of
* a {@link Document} or an {@link Element}. This iterator performs
@@ -46,20 +48,41 @@ package javax.swing.text;
*/
public class ElementIterator implements Cloneable
{
+ /**
+ * Uses to track the iteration on the stack.
+ */
+ private class ElementRef
+ {
+ /**
+ * The element.
+ */
+ Element element;
+
+ /**
+ * The child index. -1 means the element itself. >= 0 values mean the
+ * n-th child of the element.
+ */
+ int index;
+
+ /**
+ * Creates a new ElementRef.
+ *
+ * @param el the element
+ */
+ ElementRef(Element el)
+ {
+ element = el;
+ index = -1;
+ }
+ }
+
// The root element.
private Element root;
- // The current element.
- private Element currentElement;
- // The depth to which we have descended in the tree.
- private int currentDepth;
-
- // This is at least as big as the current depth, and at index N
- // contains the index of the child element we're currently
- // examining.
- private int[] state;
- // The previous item.
- private Element previousItem;
+ /**
+ * Holds ElementRefs.
+ */
+ private Stack stack;
/**
* Create a new ElementIterator to iterate over the given document.
@@ -67,9 +90,7 @@ public class ElementIterator implements Cloneable
*/
public ElementIterator(Document document)
{
- this.root = document.getDefaultRootElement();
- this.currentElement = root;
- this.state = new int[5];
+ root = document.getDefaultRootElement();
}
/**
@@ -79,8 +100,6 @@ public class ElementIterator implements Cloneable
public ElementIterator(Element root)
{
this.root = root;
- this.currentElement = root;
- this.state = new int[5];
}
/**
@@ -105,7 +124,24 @@ public class ElementIterator implements Cloneable
*/
public Element current()
{
- return currentElement;
+ Element current;
+ if (stack == null)
+ current = first();
+ else
+ {
+ current = null;
+ if (! stack.isEmpty())
+ {
+ ElementRef ref = (ElementRef) stack.peek();
+ Element el = ref.element;
+ int index = ref.index;
+ if (index == -1)
+ current = el;
+ else
+ current = el.getElement(index);
+ }
+ }
+ return current;
}
/**
@@ -113,7 +149,10 @@ public class ElementIterator implements Cloneable
*/
public int depth()
{
- return currentDepth;
+ int depth = 0;
+ if (stack != null)
+ depth = stack.size();
+ return depth;
}
/**
@@ -121,11 +160,15 @@ public class ElementIterator implements Cloneable
*/
public Element first()
{
- // Reset the iterator.
- currentElement = root;
- currentDepth = 0;
- previousItem = null;
- return root;
+ Element first = null;
+ if (root != null)
+ {
+ stack = new Stack();
+ if (root.getElementCount() > 0)
+ stack.push(new ElementRef(root));
+ first = root;
+ }
+ return first;
}
/**
@@ -134,48 +177,96 @@ public class ElementIterator implements Cloneable
*/
public Element next()
{
- previousItem = currentElement;
- if (currentElement == null)
- return null;
- if (! currentElement.isLeaf())
+ Element next;
+ if (stack == null)
+ next = first();
+ else
{
- ++currentDepth;
- if (currentDepth > state.length)
- {
- int[] newState = new int[state.length * 2];
- System.arraycopy(state, 0, newState, 0, state.length);
- state = newState;
- }
- state[currentDepth] = 0;
- currentElement = currentElement.getElement(0);
- return currentElement;
+ next = null;
+ if (! stack.isEmpty())
+ {
+ ElementRef ref = (ElementRef) stack.peek();
+ Element el = ref.element;
+ int index = ref.index;
+ if (el.getElementCount() > index + 1)
+ {
+ Element child = el.getElement(index + 1);
+ if (child.isLeaf())
+ ref.index++;
+ else
+ stack.push(new ElementRef(child));
+ next = child;
+ next = child;
+ }
+ else
+ {
+ stack.pop();
+ if (! stack.isEmpty())
+ {
+ ElementRef top = (ElementRef) stack.peek();
+ top.index++;
+ next = next();
+ }
+ }
+ }
+ // else return null.
}
+ return next;
+ }
- while (currentDepth > 0)
+ /**
+ * Returns the previous item. Does not modify the iterator state.
+ */
+ public Element previous()
+ {
+ Element previous = null;
+ int stackSize;
+ if (stack != null && (stackSize = stack.size()) > 0)
{
- // At a leaf, or done with a non-leaf's children, so go up a
- // level.
- --currentDepth;
- currentElement = currentElement.getParentElement();
- ++state[currentDepth];
- if (state[currentDepth] < currentElement.getElementCount())
- {
- currentElement = currentElement.getElement(state[currentDepth]);
- return currentElement;
- }
+ ElementRef ref = (ElementRef) stack.peek();
+ Element el = ref.element;
+ int index = ref.index;
+ if (index > 0)
+ {
+ previous = deepestLeaf(el.getElement(--index));
+ }
+ else if (index == 0)
+ {
+ previous = el;
+ }
+ else if (index == -1)
+ {
+ ElementRef top = (ElementRef) stack.pop();
+ ElementRef item = (ElementRef) stack.peek();
+ stack.push(top);
+ index = item.index;
+ el = item.element;
+ previous = index == -1 ? el : deepestLeaf(el.getElement(index));
+ }
}
-
- currentElement = null;
- return currentElement;
+ return previous;
}
/**
- * Returns the previous item. Does not modify the iterator state.
+ * Determines and returns the deepest leaf of the element <code>el</code>.
+ *
+ * @param el the base element
+ *
+ * @returnthe deepest leaf of the element <code>el</code>
*/
- public Element previous()
+ private Element deepestLeaf(Element el)
{
- if (currentElement == null || currentElement == root)
- return null;
- return previousItem;
+ Element leaf;
+ if (el.isLeaf())
+ leaf = el;
+ else
+ {
+ int count = el.getElementCount();
+ if (count == 0)
+ leaf = el;
+ else
+ leaf = deepestLeaf(el.getElement(count - 1));
+ }
+ return leaf;
}
}
diff --git a/libjava/classpath/javax/swing/text/FieldView.java b/libjava/classpath/javax/swing/text/FieldView.java
index f41f9013092..0a078e53dca 100644
--- a/libjava/classpath/javax/swing/text/FieldView.java
+++ b/libjava/classpath/javax/swing/text/FieldView.java
@@ -45,8 +45,6 @@ import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.Shape;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
import javax.swing.BoundedRangeModel;
import javax.swing.JTextField;
@@ -225,7 +223,7 @@ public class FieldView extends PlainView
public int getResizeWeight(int axis)
{
- return axis = axis == X_AXIS ? 1 : 0;
+ return axis == X_AXIS ? 1 : 0;
}
public Shape modelToView(int pos, Shape a, Position.Bias bias)
diff --git a/libjava/classpath/javax/swing/text/FlowView.java b/libjava/classpath/javax/swing/text/FlowView.java
index 3de95ed7f8d..c2bed399f3a 100644
--- a/libjava/classpath/javax/swing/text/FlowView.java
+++ b/libjava/classpath/javax/swing/text/FlowView.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package javax.swing.text;
+import java.awt.Component;
+import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.Shape;
@@ -85,7 +87,17 @@ public abstract class FlowView extends BoxView
*/
public void insertUpdate(FlowView fv, DocumentEvent e, Rectangle alloc)
{
- // The default implementation does nothing.
+ if (alloc == null)
+ {
+ fv.layoutChanged(X_AXIS);
+ fv.layoutChanged(Y_AXIS);
+ }
+ else
+ {
+ Component host = fv.getContainer();
+ if (host != null)
+ host.repaint(alloc.x, alloc.y, alloc.width, alloc.height);
+ }
}
/**
@@ -101,7 +113,17 @@ public abstract class FlowView extends BoxView
*/
public void removeUpdate(FlowView fv, DocumentEvent e, Rectangle alloc)
{
- // The default implementation does nothing.
+ if (alloc == null)
+ {
+ fv.layoutChanged(X_AXIS);
+ fv.layoutChanged(Y_AXIS);
+ }
+ else
+ {
+ Component host = fv.getContainer();
+ if (host != null)
+ host.repaint(alloc.x, alloc.y, alloc.width, alloc.height);
+ }
}
/**
@@ -117,7 +139,17 @@ public abstract class FlowView extends BoxView
*/
public void changedUpdate(FlowView fv, DocumentEvent e, Rectangle alloc)
{
- // The default implementation does nothing.
+ if (alloc == null)
+ {
+ fv.layoutChanged(X_AXIS);
+ fv.layoutChanged(Y_AXIS);
+ }
+ else
+ {
+ Component host = fv.getContainer();
+ if (host != null)
+ host.repaint(alloc.x, alloc.y, alloc.width, alloc.height);
+ }
}
/**
@@ -143,18 +175,35 @@ public abstract class FlowView extends BoxView
*/
public void layout(FlowView fv)
{
+ int start = fv.getStartOffset();
+ int end = fv.getEndOffset();
+
+ // Preserve the views from the logical view from beeing removed.
+ View lv = getLogicalView(fv);
+ int viewCount = lv.getViewCount();
+ for (int i = 0; i < viewCount; i++)
+ {
+ View v = lv.getView(i);
+ v.setParent(lv);
+ }
+
+ // Then remove all views from the flow view.
fv.removeAll();
- Element el = fv.getElement();
- int rowStart = el.getStartOffset();
- int end = el.getEndOffset();
- int rowIndex = 0;
- while (rowStart >= 0 && rowStart < end)
+ for (int rowIndex = 0; start < end; rowIndex++)
{
View row = fv.createRow();
fv.append(row);
- rowStart = layoutRow(fv, rowIndex, rowStart);
- rowIndex++;
+ int next = layoutRow(fv, rowIndex, start);
+ if (row.getViewCount() == 0)
+ {
+ row.append(createView(fv, start, Integer.MAX_VALUE, rowIndex));
+ next = row.getEndOffset();
+ }
+ if (start < next)
+ start = next;
+ else
+ assert false: "May not happen";
}
}
@@ -179,46 +228,69 @@ public abstract class FlowView extends BoxView
int axis = fv.getFlowAxis();
int span = fv.getFlowSpan(rowIndex);
int x = fv.getFlowStart(rowIndex);
- int offset = pos;
- View logicalView = getLogicalView(fv);
- // Special case when span == 0. We need to layout the row as if it had
- // a span of Integer.MAX_VALUE.
- if (span == 0)
- span = Integer.MAX_VALUE;
-
- Row: while (span > 0)
+ int end = fv.getEndOffset();
+
+ // Needed for adjusting indentation in adjustRow().
+ int preX = x;
+ int availableSpan = span;
+
+ TabExpander tabExp = fv instanceof TabExpander ? (TabExpander) fv : null;
+
+ boolean forcedBreak = false;
+ while (pos < end && span >= 0)
{
- if (logicalView.getViewIndex(offset, Position.Bias.Forward) == - 1)
- break;
- View view = createView(fv, offset, span, rowIndex);
- if (view == null)
+ View view = createView(fv, pos, span, rowIndex);
+ if (view == null
+ || (span == 0 && view.getPreferredSpan(axis) > 0))
break;
- int viewSpan = (int) view.getPreferredSpan(axis);
- int breakWeight = view.getBreakWeight(axis, x, span);
-
- row.append(view);
- offset += (view.getEndOffset() - view.getStartOffset());
- x += viewSpan;
- span -= viewSpan;
+ int viewSpan;
+ if (axis == X_AXIS && view instanceof TabableView)
+ viewSpan = (int) ((TabableView) view).getTabbedSpan(x, tabExp);
+ else
+ viewSpan = (int) view.getPreferredSpan(axis);
// Break if the line if the view does not fit in this row or the
// line just must be broken.
- if (span < 0 || breakWeight >= View.ForcedBreakWeight)
+ int breakWeight = view.getBreakWeight(axis, pos, span);
+ if (breakWeight >= ForcedBreakWeight)
{
- int flowStart = fv.getFlowStart(axis);
- int flowSpan = fv.getFlowSpan(axis);
- adjustRow(fv, rowIndex, flowSpan, flowStart);
int rowViewCount = row.getViewCount();
if (rowViewCount > 0)
- offset = row.getView(rowViewCount - 1).getEndOffset();
- else
- offset = - 1;
- break Row;
+ {
+ view = view.breakView(axis, pos, x, span);
+ if (view != null)
+ {
+ if (axis == X_AXIS && view instanceof TabableView)
+ viewSpan =
+ (int) ((TabableView) view).getTabbedSpan(x, tabExp);
+ else
+ viewSpan = (int) view.getPreferredSpan(axis);
+ }
+ else
+ viewSpan = 0;
+ }
+ forcedBreak = true;
+ }
+ span -= viewSpan;
+ x += viewSpan;
+ if (view != null)
+ {
+ row.append(view);
+ pos = view.getEndOffset();
}
+ if (forcedBreak)
+ break;
}
- return offset != pos ? offset : - 1;
+ if (span < 0)
+ adjustRow(fv, rowIndex, availableSpan, preX);
+ else if (row.getViewCount() == 0)
+ {
+ View view = createView(fv, pos, Integer.MAX_VALUE, rowIndex);
+ row.append(view);
+ }
+ return row.getEndOffset();
}
/**
@@ -246,15 +318,11 @@ public abstract class FlowView extends BoxView
int rowIndex)
{
View logicalView = getLogicalView(fv);
- // FIXME: Handle the bias thing correctly.
- int index = logicalView.getViewIndex(startOffset, Position.Bias.Forward);
- View retVal = null;
- if (index >= 0)
- {
- retVal = logicalView.getView(index);
- if (retVal.getStartOffset() != startOffset)
- retVal = retVal.createFragment(startOffset, retVal.getEndOffset());
- }
+ int index = logicalView.getViewIndex(startOffset,
+ Position.Bias.Forward);
+ View retVal = logicalView.getView(index);
+ if (retVal.getStartOffset() != startOffset)
+ retVal = retVal.createFragment(startOffset, retVal.getEndOffset());
return retVal;
}
@@ -279,37 +347,82 @@ public abstract class FlowView extends BoxView
View row = fv.getView(rowIndex);
int count = row.getViewCount();
int breakIndex = -1;
- int maxBreakWeight = View.BadBreakWeight;
- int breakX = x;
- int breakSpan = desiredSpan;
- int currentX = x;
- int currentSpan = desiredSpan;
+ int breakWeight = BadBreakWeight;
+ int breakSpan = 0;
+ int currentSpan = 0;
for (int i = 0; i < count; ++i)
{
View view = row.getView(i);
- int weight = view.getBreakWeight(axis, currentX, currentSpan);
- if (weight >= maxBreakWeight)
+ int spanLeft = desiredSpan - currentSpan;
+ int weight = view.getBreakWeight(axis, x + currentSpan, spanLeft);
+ if (weight >= breakWeight && weight > BadBreakWeight)
{
breakIndex = i;
- breakX = currentX;
breakSpan = currentSpan;
- maxBreakWeight = weight;
+ breakWeight = weight;
+ if (weight >= ForcedBreakWeight)
+ // Don't search further.
+ break;
}
- int size = (int) view.getPreferredSpan(axis);
- currentX += size;
- currentSpan -= size;
+ currentSpan += view.getPreferredSpan(axis);
}
// If there is a potential break location found, break the row at
// this location.
- if (breakIndex > -1)
+ if (breakIndex >= 0)
{
+ int spanLeft = desiredSpan - breakSpan;
View toBeBroken = row.getView(breakIndex);
View brokenView = toBeBroken.breakView(axis,
toBeBroken.getStartOffset(),
- breakX, breakSpan);
+ x + breakSpan, spanLeft);
+ View lv = getLogicalView(fv);
+ for (int i = breakIndex; i < count; i++)
+ {
+ View tmp = row.getView(i);
+ if (contains(lv, tmp))
+ tmp.setParent(lv);
+ else if (tmp.getViewCount() > 0)
+ reparent(tmp, lv);
+ }
row.replace(breakIndex, count - breakIndex,
- new View[]{brokenView});
+ new View[]{ brokenView });
+ }
+
+ }
+
+ /**
+ * Helper method to determine if one view contains another as child.
+ */
+ private boolean contains(View view, View child)
+ {
+ boolean ret = false;
+ int n = view.getViewCount();
+ for (int i = 0; i < n && ret == false; i++)
+ {
+ if (view.getView(i) == child)
+ ret = true;
+ }
+ return ret;
+ }
+
+ /**
+ * Helper method that reparents the <code>view</code> and all of its
+ * decendents to the <code>parent</code> (the logical view).
+ *
+ * @param view the view to reparent
+ * @param parent the new parent
+ */
+ private void reparent(View view, View parent)
+ {
+ int n = view.getViewCount();
+ for (int i = 0; i < n; i++)
+ {
+ View tmp = view.getView(i);
+ if (contains(parent, tmp))
+ tmp.setParent(parent);
+ else
+ reparent(tmp, parent);
}
}
}
@@ -320,14 +433,135 @@ public abstract class FlowView extends BoxView
* visual representation, this is handled by the physical view implemented
* in the <code>FlowView</code>.
*/
- class LogicalView extends BoxView
+ class LogicalView extends CompositeView
{
/**
* Creates a new LogicalView instance.
*/
- LogicalView(Element el, int axis)
+ LogicalView(Element el)
+ {
+ super(el);
+ }
+
+ /**
+ * Overridden to return the attributes of the parent
+ * (== the FlowView instance).
+ */
+ public AttributeSet getAttributes()
+ {
+ View p = getParent();
+ return p != null ? p.getAttributes() : null;
+ }
+
+ protected void childAllocation(int index, Rectangle a)
+ {
+ // Nothing to do here (not visual).
+ }
+
+ protected View getViewAtPoint(int x, int y, Rectangle r)
+ {
+ // Nothing to do here (not visual).
+ return null;
+ }
+
+ protected boolean isAfter(int x, int y, Rectangle r)
+ {
+ // Nothing to do here (not visual).
+ return false;
+ }
+
+ protected boolean isBefore(int x, int y, Rectangle r)
+ {
+ // Nothing to do here (not visual).
+ return false;
+ }
+
+ public float getPreferredSpan(int axis)
+ {
+ float max = 0;
+ float pref = 0;
+ int n = getViewCount();
+ for (int i = 0; i < n; i++)
+ {
+ View v = getView(i);
+ pref += v.getPreferredSpan(axis);
+ if (v.getBreakWeight(axis, 0, Integer.MAX_VALUE)
+ >= ForcedBreakWeight)
+ {
+ max = Math.max(max, pref);
+ pref = 0;
+ }
+ }
+ max = Math.max(max, pref);
+ return max;
+ }
+
+ public float getMinimumSpan(int axis)
+ {
+ float max = 0;
+ float min = 0;
+ boolean wrap = true;
+ int n = getViewCount();
+ for (int i = 0; i < n; i++)
+ {
+ View v = getView(i);
+ if (v.getBreakWeight(axis, 0, Integer.MAX_VALUE)
+ == BadBreakWeight)
+ {
+ min += v.getPreferredSpan(axis);
+ wrap = false;
+ }
+ else if (! wrap)
+ {
+ max = Math.max(min, max);
+ wrap = true;
+ min = 0;
+ }
+ }
+ max = Math.max(max, min);
+ return max;
+ }
+
+ public void paint(Graphics g, Shape s)
+ {
+ // Nothing to do here (not visual).
+ }
+
+ /**
+ * Overridden to handle possible leaf elements.
+ */
+ protected void loadChildren(ViewFactory f)
{
- super(el, axis);
+ Element el = getElement();
+ if (el.isLeaf())
+ {
+ View v = new LabelView(el);
+ append(v);
+ }
+ else
+ super.loadChildren(f);
+ }
+
+ /**
+ * Overridden to reparent the children to this logical view, in case
+ * they have been parented by a row.
+ */
+ protected void forwardUpdateToView(View v, DocumentEvent e, Shape a,
+ ViewFactory f)
+ {
+ v.setParent(this);
+ super.forwardUpdateToView(v, e, a, f);
+ }
+
+ /**
+ * Overridden to handle possible leaf element.
+ */
+ protected int getViewIndexAtPosition(int pos)
+ {
+ int index = 0;
+ if (! getElement().isLeaf())
+ index = super.getViewIndexAtPosition(pos);
+ return index;
}
}
@@ -357,11 +591,6 @@ public abstract class FlowView extends BoxView
protected FlowStrategy strategy;
/**
- * Indicates if the flow should be rebuild during the next layout.
- */
- private boolean layoutDirty;
-
- /**
* Creates a new <code>FlowView</code> for the given
* <code>Element</code> and <code>axis</code>.
*
@@ -374,7 +603,7 @@ public abstract class FlowView extends BoxView
{
super(element, axis);
strategy = sharedStrategy;
- layoutDirty = true;
+ layoutSpan = Short.MAX_VALUE;
}
/**
@@ -423,7 +652,7 @@ public abstract class FlowView extends BoxView
*/
public int getFlowStart(int index)
{
- return getLeftInset(); // TODO: Is this correct?
+ return 0;
}
/**
@@ -449,9 +678,11 @@ public abstract class FlowView extends BoxView
{
if (layoutPool == null)
{
- layoutPool = new LogicalView(getElement(), getAxis());
- layoutPool.setParent(this);
+ layoutPool = new LogicalView(getElement());
}
+ layoutPool.setParent(this);
+ // Initialize the flow strategy.
+ strategy.insertUpdate(this, null, null);
}
/**
@@ -466,32 +697,33 @@ public abstract class FlowView extends BoxView
protected void layout(int width, int height)
{
int flowAxis = getFlowAxis();
+ int span;
if (flowAxis == X_AXIS)
- {
- if (layoutSpan != width)
- {
- layoutChanged(Y_AXIS);
- layoutSpan = width;
- }
- }
+ span = (int) width;
else
+ span = (int) height;
+
+ if (layoutSpan != span)
{
- if (layoutSpan != height)
- {
- layoutChanged(X_AXIS);
- layoutSpan = height;
- }
+ layoutChanged(flowAxis);
+ layoutChanged(getAxis());
+ layoutSpan = span;
}
- if (layoutDirty)
+ if (! isLayoutValid(flowAxis))
{
+ int axis = getAxis();
+ int oldSpan = axis == X_AXIS ? getWidth() : getHeight();
strategy.layout(this);
- layoutDirty = false;
+ int newSpan = (int) getPreferredSpan(axis);
+ if (oldSpan != newSpan)
+ {
+ View parent = getParent();
+ if (parent != null)
+ parent.preferenceChanged(this, axis == X_AXIS, axis == Y_AXIS);
+ }
}
- if (getPreferredSpan(getAxis()) != height)
- preferenceChanged(this, false, true);
-
super.layout(width, height);
}
@@ -510,7 +742,6 @@ public abstract class FlowView extends BoxView
// be updated accordingly.
layoutPool.insertUpdate(changes, a, vf);
strategy.insertUpdate(this, changes, getInsideAllocation(a));
- layoutDirty = true;
}
/**
@@ -526,7 +757,6 @@ public abstract class FlowView extends BoxView
{
layoutPool.removeUpdate(changes, a, vf);
strategy.removeUpdate(this, changes, getInsideAllocation(a));
- layoutDirty = true;
}
/**
@@ -542,7 +772,6 @@ public abstract class FlowView extends BoxView
{
layoutPool.changedUpdate(changes, a, vf);
strategy.changedUpdate(this, changes, getInsideAllocation(a));
- layoutDirty = true;
}
/**
@@ -604,7 +833,7 @@ public abstract class FlowView extends BoxView
res = new SizeRequirements();
res.minimum = (int) layoutPool.getMinimumSpan(axis);
res.preferred = Math.max(res.minimum,
- (int) layoutPool.getMinimumSpan(axis));
+ (int) layoutPool.getPreferredSpan(axis));
res.maximum = Integer.MAX_VALUE;
res.alignment = 0.5F;
return res;
diff --git a/libjava/classpath/javax/swing/text/GapContent.java b/libjava/classpath/javax/swing/text/GapContent.java
index 760e396a223..08a318d8bb4 100644
--- a/libjava/classpath/javax/swing/text/GapContent.java
+++ b/libjava/classpath/javax/swing/text/GapContent.java
@@ -39,16 +39,13 @@ exception statement from your version. */
package javax.swing.text;
import java.io.Serializable;
-import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import java.util.Set;
import java.util.Vector;
-import java.util.WeakHashMap;
import javax.swing.undo.AbstractUndoableEdit;
import javax.swing.undo.CannotRedoException;
@@ -71,7 +68,7 @@ public class GapContent
/**
* A {@link Position} implementation for <code>GapContent</code>.
*/
- private class GapContentPosition
+ class GapContentPosition
implements Position
{
@@ -82,39 +79,6 @@ public class GapContent
Mark mark;
/**
- * Creates a new GapContentPosition object.
- *
- * @param offset the offset of this Position
- */
- GapContentPosition(int offset)
- {
- // Try to find the mark in the positionMarks array, and store the index
- // to it.
- synchronized (GapContent.this)
- {
- // Try to make space.
- garbageCollect();
- Mark m = new Mark(offset);
- int i = search(marks, m);
- if (i >= 0) // mark found
- {
- m = (Mark) marks.get(i);
- }
- else
- {
- i = -i - 1;
- marks.add(i, m);
- }
- m.refCount++;
- mark = m;
- }
-
- // Register this position in the death queue, so we can cleanup the marks
- // when this position object gets GC'ed.
- new WeakReference(this, queueOfDeath);
- }
-
- /**
* Returns the current offset of this Position within the content.
*
* @return the current offset of this Position within the content.
@@ -133,7 +97,7 @@ public class GapContent
* be garbage collected while we still hold a reference to the Mark object.
*/
private class Mark
- implements Comparable
+ extends WeakReference
{
/**
* The actual mark into the buffer.
@@ -141,21 +105,20 @@ public class GapContent
int mark;
/**
- * The number of GapContentPosition object that reference this mark. If
- * it reaches zero, it get's deleted by {@link GapContent#garbageCollect()}.
- */
- int refCount;
-
- /**
* Creates a new Mark object for the specified offset.
*
* @param offset the offset
*/
Mark(int offset)
{
+ super(null);
+ mark = offset;
+ }
+
+ Mark(int offset, GapContentPosition pos, ReferenceQueue queue)
+ {
+ super(pos, queue);
mark = offset;
- if (mark >= gapStart && mark != 0)
- mark += (gapEnd - gapStart);
}
/**
@@ -165,33 +128,62 @@ public class GapContent
*/
int getOffset()
{
- assert mark == 0 || mark < gapStart || mark >= gapEnd :
- "Invalid mark: " + mark + ", gapStart: " + gapStart
- + ", gapEnd: " + gapEnd;
-
int res = mark;
- if (mark >= gapEnd)
+ if (mark >= gapStart)
res -= (gapEnd - gapStart);
- return res;
+ return Math.max(0, res);
+ }
+
+ /**
+ * Returns the GapContentPosition that is associated ith this mark.
+ * This fetches the weakly referenced position object.
+ *
+ * @return the GapContentPosition that is associated ith this mark
+ */
+ GapContentPosition getPosition()
+ {
+ return (GapContentPosition) get();
}
+ }
+
+ /**
+ * Stores a reference to a mark that can be resetted to the original value
+ * after a mark has been moved. This is used for undoing actions.
+ */
+ private class UndoPosRef
+ {
+ /**
+ * The mark that might need to be reset.
+ */
+ private Mark mark;
+
/**
- * Implementation of Comparable.
+ * The original offset to reset the mark to.
*/
- public int compareTo(Object o)
+ private int undoOffset;
+
+ /**
+ * Creates a new UndoPosRef.
+ *
+ * @param m the mark
+ */
+ UndoPosRef(Mark m)
{
- Mark other = (Mark) o;
- return mark - other.mark;
+ mark = m;
+ undoOffset = mark.getOffset();
}
+
/**
- * Adjustment for equals().
+ * Resets the position of the mark to the value that it had when
+ * creating this UndoPosRef.
*/
- public boolean equals(Object o)
+ void reset()
{
- if (o == null || !(o instanceof Mark))
- return false;
+ if (undoOffset <= gapStart)
+ mark.mark = undoOffset;
else
- return ((Mark) o).mark == mark;
+ mark.mark = (gapEnd - gapStart) + undoOffset;
}
}
@@ -199,6 +191,8 @@ public class GapContent
{
public int where, length;
String text;
+ private Vector positions;
+
public InsertUndo(int start, int len)
{
where = start;
@@ -209,27 +203,33 @@ public class GapContent
{
super.undo();
try
- {
- text = getString(where, length);
- remove(where, length);
- }
+ {
+ positions = getPositionsInRange(null, where, length);
+ text = getString(where, length);
+ remove(where, length);
+ }
catch (BadLocationException ble)
- {
- throw new CannotUndoException();
- }
+ {
+ throw new CannotUndoException();
+ }
}
public void redo () throws CannotUndoException
{
super.redo();
try
- {
- insertString(where, text);
- }
+ {
+ insertString(where, text);
+ if (positions != null)
+ {
+ updateUndoPositions(positions, where, length);
+ positions = null;
+ }
+ }
catch (BadLocationException ble)
- {
- throw new CannotRedoException();
- }
+ {
+ throw new CannotRedoException();
+ }
}
}
@@ -238,10 +238,17 @@ public class GapContent
{
public int where;
String text;
+
+ /**
+ * The positions in the removed range.
+ */
+ private Vector positions;
+
public UndoRemove(int start, String removedText)
{
where = start;
text = removedText;
+ positions = getPositionsInRange(null, start, removedText.length());
}
public void undo () throws CannotUndoException
@@ -250,6 +257,8 @@ public class GapContent
try
{
insertString(where, text);
+ if (positions != null)
+ updateUndoPositions(positions, where, text.length());
}
catch (BadLocationException ble)
{
@@ -261,13 +270,15 @@ public class GapContent
{
super.redo();
try
- {
- remove(where, text.length());
- }
+ {
+ text = getString(where, text.length());
+ positions = getPositionsInRange(null, where, text.length());
+ remove(where, text.length());
+ }
catch (BadLocationException ble)
- {
- throw new CannotRedoException();
- }
+ {
+ throw new CannotRedoException();
+ }
}
}
@@ -308,7 +319,15 @@ public class GapContent
*/
ArrayList marks;
- WeakHashMap positions;
+ /**
+ * The number of unused marks.
+ */
+ private int garbageMarks;
+
+ /**
+ * A 'static' mark that is used for searching.
+ */
+ private Mark searchMark = new Mark(0);
/**
* Queues all references to GapContentPositions that are about to be
@@ -339,7 +358,6 @@ public class GapContent
gapStart = 1;
gapEnd = size;
buffer[0] = '\n';
- positions = new WeakHashMap();
marks = new ArrayList();
queueOfDeath = new ReferenceQueue();
}
@@ -403,9 +421,10 @@ public class GapContent
throw new BadLocationException("The where argument cannot be greater"
+ " than the content length", where);
+ InsertUndo undo = new InsertUndo(where, strLen);
replace(where, 0, str.toCharArray(), strLen);
- return new InsertUndo(where, strLen);
+ return undo;
}
/**
@@ -429,9 +448,10 @@ public class GapContent
+ " than the content length", where + nitems);
String removedText = getString(where, nitems);
+ UndoRemove undoRemove = new UndoRemove(where, removedText);
replace(where, nitems, null, 0);
- return new UndoRemove(where, removedText);
+ return undoRemove;
}
/**
@@ -495,29 +515,43 @@ public class GapContent
if (len < 0)
throw new BadLocationException("negative length not allowed: ", len);
- // check if requested segment is contiguous
- if ((where < gapStart) && ((gapStart - where) < len))
- {
- // requested segment is not contiguous -> copy the pieces together
- char[] copy = new char[len];
- int lenFirst = gapStart - where; // the length of the first segment
- System.arraycopy(buffer, where, copy, 0, lenFirst);
- System.arraycopy(buffer, gapEnd, copy, lenFirst, len - lenFirst);
- txt.array = copy;
- txt.offset = 0;
- txt.count = len;
- }
- else
- {
- // requested segment is contiguous -> we can simply return the
- // actual content
- txt.array = buffer;
- if (where < gapStart)
+ // Optimized to copy only when really needed.
+ if (where + len <= gapStart)
+ {
+ // Simple case: completely before gap.
+ txt.array = buffer;
txt.offset = where;
- else
- txt.offset = where + (gapEnd - gapStart);
- txt.count = len;
- }
+ txt.count = len;
+ }
+ else if (where > gapStart)
+ {
+ // Completely after gap, adjust offset.
+ txt.array = buffer;
+ txt.offset = gapEnd + where - gapStart;
+ txt.count = len;
+ }
+ else
+ {
+ // Spans the gap.
+ int beforeGap = gapStart - where;
+ if (txt.isPartialReturn())
+ {
+ // Return the part before the gap when partial return is allowed.
+ txt.array = buffer;
+ txt.offset = where;
+ txt.count = beforeGap;
+ }
+ else
+ {
+ // Copy pieces together otherwise.
+ txt.array = new char[len];
+ txt.offset = 0;
+ System.arraycopy(buffer, where, txt.array, 0, beforeGap);
+ System.arraycopy(buffer, gapEnd, txt.array, beforeGap,
+ len - beforeGap);
+ txt.count = len;
+ }
+ }
}
/**
@@ -537,27 +571,33 @@ public class GapContent
// and luckily enough the GapContent can very well deal with offsets
// outside the buffer bounds. So I removed that check.
+ // First do some garbage collections.
+ while (queueOfDeath.poll() != null)
+ garbageMarks++;
+ if (garbageMarks > Math.max(5, marks.size() / 10))
+ garbageCollect();
+
// We try to find a GapContentPosition at the specified offset and return
// that. Otherwise we must create a new one.
- GapContentPosition pos = null;
- Set positionSet = positions.keySet();
- for (Iterator i = positionSet.iterator(); i.hasNext();)
- {
- GapContentPosition p = (GapContentPosition) i.next();
- if (p.getOffset() == offset)
- {
- pos = p;
- break;
- }
- }
-
- // If none was found, then create and return a new one.
- if (pos == null)
+ Mark m;
+ GapContentPosition pos;
+ int index = offset;
+ if (offset >= gapStart)
+ index += (gapEnd - gapStart);
+ searchMark.mark = index;
+ int insertIndex = search(searchMark);
+ if (!(insertIndex < marks.size()
+ && (m = (Mark) marks.get(insertIndex)).mark == index
+ && (pos = m.getPosition()) != null))
{
- pos = new GapContentPosition(offset);
- positions.put(pos, null);
+ // Create new position if none was found.
+ pos = new GapContentPosition();
+ m = new Mark(index, pos, queueOfDeath);
+ pos.mark = m;
+ marks.add(insertIndex, m);
}
-
+ // Otherwise use the found position.
+
return pos;
}
@@ -574,18 +614,29 @@ public class GapContent
assert newSize > (gapEnd - gapStart) : "The new gap size must be greater "
+ "than the old gap size";
- int delta = newSize - gapEnd + gapStart;
- // Update the marks after the gapEnd.
- adjustPositionsInRange(gapEnd, -1, delta);
+ int oldEnd = getGapEnd();
+ int oldSize = getArrayLength();
+ int upper = oldSize - oldEnd;
+ int size = (newSize + 1) * 2;
+ int newEnd = size - upper;
// Copy the data around.
- char[] newBuf = (char[]) allocateArray(length() + newSize);
- System.arraycopy(buffer, 0, newBuf, 0, gapStart);
- System.arraycopy(buffer, gapEnd, newBuf, gapStart + newSize, buffer.length
- - gapEnd);
- gapEnd = gapStart + newSize;
+ char[] newBuf = (char[]) allocateArray(size);
+ System.arraycopy(buffer, 0, newBuf, 0, Math.min(size, oldSize));
buffer = newBuf;
-
+ gapEnd = newEnd;
+ if (upper != 0)
+ System.arraycopy(buffer, oldEnd, buffer, newEnd, upper);
+
+ // Adjust marks.
+ int delta = gapEnd - oldEnd;
+ int adjIndex = searchFirst(oldEnd);
+ int count = marks.size();
+ for (int i = adjIndex; i < count; i++)
+ {
+ Mark m = (Mark) marks.get(i);
+ m.mark += delta;
+ }
}
/**
@@ -595,28 +646,44 @@ public class GapContent
*/
protected void shiftGap(int newGapStart)
{
- if (newGapStart == gapStart)
- return;
- int newGapEnd = newGapStart + gapEnd - gapStart;
- if (newGapStart < gapStart)
+ int oldStart = gapStart;
+ int delta = newGapStart - oldStart;
+ int oldEnd = gapEnd;
+ int newGapEnd = oldEnd + delta;
+ int size = oldEnd - oldStart;
+
+ // Shift gap in array.
+ gapStart = newGapStart;
+ gapEnd = newGapEnd;
+ if (delta > 0)
+ System.arraycopy(buffer, oldEnd, buffer, oldStart, delta);
+ else
+ System.arraycopy(buffer, newGapStart, buffer, newGapEnd, -delta);
+
+ // Adjust marks.
+ if (delta > 0)
{
- // Update the positions between newGapStart and (old) gapStart. The marks
- // must be shifted by (gapEnd - gapStart).
- adjustPositionsInRange(newGapStart, gapStart, gapEnd - gapStart);
- System.arraycopy(buffer, newGapStart, buffer, newGapEnd, gapStart
- - newGapStart);
- gapStart = newGapStart;
- gapEnd = newGapEnd;
+ int adjIndex = searchFirst(oldStart);
+ int count = marks.size();
+ for (int i = adjIndex; i < count; i++)
+ {
+ Mark m = (Mark) marks.get(i);
+ if (m.mark >= newGapEnd)
+ break;
+ m.mark -= size;
+ }
}
- else
+ else if (delta < 0)
{
- // Update the positions between newGapEnd and (old) gapEnd. The marks
- // must be shifted by (gapEnd - gapStart).
- adjustPositionsInRange(gapEnd, newGapEnd, -(gapEnd - gapStart));
- System.arraycopy(buffer, gapEnd, buffer, gapStart, newGapStart
- - gapStart);
- gapStart = newGapStart;
- gapEnd = newGapEnd;
+ int adjIndex = searchFirst(newGapStart);
+ int count = marks.size();
+ for (int i = adjIndex; i < count; i++)
+ {
+ Mark m = (Mark) marks.get(i);
+ if (m.mark >= oldEnd)
+ break;
+ m.mark += size;
+ }
}
resetMarksAtZero();
}
@@ -636,7 +703,18 @@ public class GapContent
assert newGapStart < gapStart : "The new gap start must be less than the "
+ "old gap start.";
- setPositionsInRange(newGapStart, gapStart, false);
+
+ // Adjust positions.
+ int adjIndex = searchFirst(newGapStart);
+ int count = marks.size();
+ for (int i = adjIndex; i < count; i++)
+ {
+ Mark m = (Mark) marks.get(i);
+ if (m.mark > gapStart)
+ break;
+ m.mark = gapEnd;
+ }
+
gapStart = newGapStart;
resetMarksAtZero();
}
@@ -656,7 +734,19 @@ public class GapContent
assert newGapEnd > gapEnd : "The new gap end must be greater than the "
+ "old gap end.";
- setPositionsInRange(gapEnd, newGapEnd, false);
+
+ // Adjust marks.
+ int adjIndex = searchFirst(gapEnd);
+ int count = marks.size();
+ for (int i = adjIndex; i < count; i++)
+ {
+ Mark m = (Mark) marks.get(i);
+ if (m.mark >= newGapEnd)
+ break;
+ m.mark = newGapEnd;
+ }
+
+
gapEnd = newGapEnd;
resetMarksAtZero();
}
@@ -682,23 +772,88 @@ public class GapContent
protected void replace(int position, int rmSize, Object addItems,
int addSize)
{
- if (gapStart != position)
- shiftGap(position);
-
- // Remove content
- if (rmSize > 0)
- shiftGapEndUp(gapEnd + rmSize);
+ if (addSize == 0)
+ {
+ removeImpl(position, rmSize);
+ return;
+ }
+ else if (rmSize > addSize)
+ {
+ removeImpl(position + addSize, rmSize - addSize);
+ }
+ else
+ {
+ int endSize = addSize - rmSize;
+ int end = addImpl(position + rmSize, endSize);
+ System.arraycopy(addItems, rmSize, buffer, end, endSize);
+ addSize = rmSize;
+ }
+ System.arraycopy(addItems, 0, buffer, position, addSize);
+ }
+
+ /**
+ * Adjusts the positions and gap in response to a remove operation.
+ *
+ * @param pos the position at which to remove
+ * @param num the number of removed items
+ */
+ private void removeImpl(int pos, int num)
+ {
+ if (num > 0)
+ {
+ int end = pos + num;
+ int newGapSize = (gapEnd - gapStart) + num;
+ if (end <= gapStart)
+ {
+ if (gapStart != end)
+ {
+ shiftGap(end);
+ }
+ shiftGapStartDown(gapStart - num);
+ }
+ else if (pos >= gapStart)
+ {
+ if (gapStart != pos)
+ {
+ shiftGap(pos);
+ }
+ shiftGapEndUp(gapStart + newGapSize);
+ }
+ else
+ {
+ shiftGapStartDown(pos);
+ shiftGapEndUp(gapStart + newGapSize);
+ }
+ }
+ }
- // If gap is too small, enlarge the gap.
- if ((gapEnd - gapStart) <= addSize)
- shiftEnd((addSize - gapEnd + gapStart + 1) * 2 + gapEnd + DEFAULT_BUFSIZE);
+ /**
+ * Adjusts the positions and gap in response to an add operation.
+ *
+ * @param pos the position at which to add
+ * @param num the number of added items
+ *
+ * @return the adjusted position
+ */
+ private int addImpl(int pos, int num)
+ {
+ int size = gapEnd - gapStart;
+ if (num == 0)
+ {
+ if (pos > gapStart)
+ pos += size;
+ return pos;
+ }
- // Add new items to the buffer.
- if (addItems != null)
+ shiftGap(pos);
+ if (num >= size)
{
- System.arraycopy(addItems, 0, buffer, gapStart, addSize);
- gapStart += addSize;
+ shiftEnd(getArrayLength() - size + num);
+ size = gapEnd - gapStart;
}
+
+ gapStart += num;
+ return pos;
}
/**
@@ -733,97 +888,34 @@ public class GapContent
*/
protected Vector getPositionsInRange(Vector v, int offset, int length)
{
- Vector res = v;
- if (res == null)
- res = new Vector();
- else
- res.clear();
-
- int endOffs = offset + length;
-
- Set positionSet = positions.keySet();
- for (Iterator i = positionSet.iterator(); i.hasNext();)
+ int end = offset + length;
+ int startIndex;
+ int endIndex;
+ if (offset < gapStart)
{
- GapContentPosition p = (GapContentPosition) i.next();
- int offs = p.getOffset();
- if (offs >= offset && offs < endOffs)
- res.add(p);
+ if (offset == 0)
+ startIndex = 0;
+ else
+ startIndex = searchFirst(offset);
+ if (end >= gapStart)
+ endIndex = searchFirst(end + (gapEnd - gapStart) + 1);
+ else
+ endIndex = searchFirst(end + 1);
}
-
- return res;
- }
-
- /**
- * Crunches all positions in the specified range to either the start or
- * end of that interval. The interval boundaries are meant to be inclusive
- * [start, end].
- *
- * @param start the start offset of the range
- * @param end the end offset of the range
- * @param toStart a boolean indicating if the positions should be crunched
- * to the start (true) or to the end (false)
- */
- private void setPositionsInRange(int start, int end, boolean toStart)
- {
- synchronized (this)
+ else
{
- // Find the start and end indices in the positionMarks array.
- Mark m = new Mark(0); // For comparison / search only.
- m.mark = start;
- int startIndex = search(marks, m);
- if (startIndex < 0) // Translate to insertion index, if not found.
- startIndex = - startIndex - 1;
- m.mark = end;
- int endIndex = search(marks, m);
- if (endIndex < 0) // Translate to insertion index - 1, if not found.
- endIndex = - endIndex - 2;
-
- // Actually adjust the marks.
- for (int i = startIndex; i <= endIndex; i++)
- ((Mark) marks.get(i)).mark = toStart ? start : end;
+ startIndex = searchFirst(offset + (gapEnd - gapStart));
+ endIndex = searchFirst(end + (gapEnd - gapStart) + 1);
}
-
- }
-
- /**
- * Adjusts the mark of all <code>Position</code>s that are in the range
- * specified by <code>offset</code> and </code>length</code> within
- * the buffer array by <code>increment</code>
- *
- * @param startOffs the start offset of the range to search
- * @param endOffs the length of the range to search, -1 means all to the end
- * @param incr the increment
- */
- private void adjustPositionsInRange(int startOffs, int endOffs, int incr)
- {
- synchronized (this)
+ if (v == null)
+ v = new Vector();
+ for (int i = startIndex; i < endIndex; i++)
{
- // Find the start and end indices in the positionMarks array.
- Mark m = new Mark(0); // For comparison / search only.
-
- m.mark = startOffs;
- int startIndex = search(marks, m);
- if (startIndex < 0) // Translate to insertion index, if not found.
- startIndex = - startIndex - 1;
-
- m.mark = endOffs;
- int endIndex;
- if (endOffs == -1)
- endIndex = marks.size() - 1;
- else
- {
- endIndex = search(marks, m);
- if (endIndex < 0) // Translate to insertion index - 1, if not found.
- endIndex = - endIndex - 2;
- }
- // Actually adjust the marks.
- for (int i = startIndex; i <= endIndex; i++) {
- ((Mark) marks.get(i)).mark += incr;
- }
+ v.add(new UndoPosRef((Mark) marks.get(i)));
}
-
+ return v;
}
-
+
/**
* Resets all <code>Position</code> that have an offset of <code>0</code>,
* to also have an array index of <code>0</code>. This might be necessary
@@ -844,14 +936,26 @@ public class GapContent
}
/**
- * @specnote This method is not very well specified and the positions vector
- * is implementation specific. The undo positions are managed
- * differently in this implementation, this method is only here
- * for binary compatibility.
+ * Resets the positions in the specified range to their original offset
+ * after a undo operation is performed. For example, after removing some
+ * content, the positions in the removed range will all be set to one
+ * offset. This method restores the positions to their original offsets
+ * after an undo.
+ *
+ * @param positions the positions to update
+ * @param offset
+ * @param length
*/
protected void updateUndoPositions(Vector positions, int offset, int length)
{
- // We do nothing here.
+ for (Iterator i = positions.iterator(); i.hasNext();)
+ {
+ UndoPosRef undoPosRef = (UndoPosRef) i.next();
+ undoPosRef.reset();
+ }
+
+ // Resort marks.
+ Collections.sort(marks);
}
/**
@@ -892,30 +996,6 @@ public class GapContent
}
/**
- * Polls the queue of death for GapContentPositions, updates the
- * corresponding reference count and removes the corresponding mark
- * if the refcount reaches zero.
- *
- * This is package private to avoid accessor synthetic methods.
- */
- void garbageCollect()
- {
- Reference ref = queueOfDeath.poll();
- while (ref != null)
- {
- if (ref != null)
- {
- GapContentPosition pos = (GapContentPosition) ref.get();
- Mark m = pos.mark;
- m.refCount--;
- if (m.refCount == 0)
- marks.remove(m);
- }
- ref = queueOfDeath.poll();
- }
- }
-
- /**
* Searches the first occurance of object <code>o</code> in list
* <code>l</code>. This performs a binary search by calling
* {@link Collections#binarySearch(List, Object)} and when an object has been
@@ -923,22 +1003,93 @@ public class GapContent
* list. The meaning of the return value is the same as in
* <code>Collections.binarySearch()</code>.
*
- * @param l the list to search through
* @param o the object to be searched
*
* @return the index of the first occurance of o in l, or -i + 1 if not found
*/
- private int search(List l, Object o)
+ int search(Mark o)
{
- int i = Collections.binarySearch(l, o);
- while (i > 0)
+ int foundInd = 0;
+ boolean found = false;
+ int low = 0;
+ int up = marks.size() - 1;
+ int mid = 0;
+ if (up > -1)
{
- Object o2 = l.get(i - 1);
- if (o2.equals(o))
- i--;
+ int cmp = 0;
+ Mark last = (Mark) marks.get(up);
+ cmp = compare(o, last);
+ if (cmp > 0)
+ {
+ foundInd = up + 1;
+ found = true;
+ }
else
+ {
+ while (low <= up && ! found)
+ {
+ mid = low + (up - low) / 2;
+ Mark m = (Mark) marks.get(mid);
+ cmp = compare(o, m);
+ if (cmp == 0)
+ {
+ foundInd = mid;
+ found = true;
+ }
+ else if (cmp < 0)
+ up = mid - 1;
+ else
+ low = mid + 1;
+ }
+
+ if (! found)
+ foundInd = cmp < 0 ? mid : mid + 1;
+ }
+ }
+ return foundInd;
+ }
+
+ private int searchFirst(int index)
+ {
+ searchMark.mark = Math.max(index, 1);
+ int i = search(searchMark);
+ for (int j = i - 1; j >= 0; j--)
+ {
+ Mark m = (Mark) marks.get(j);
+ if (m.mark != index)
break;
+ i--;
}
return i;
}
+
+ /**
+ * Compares two marks.
+ *
+ * @param m1 the first mark
+ * @param m2 the second mark
+ *
+ * @return negative when m1 < m2, positive when m1 > m2 and 0 when equal
+ */
+ private int compare(Mark m1, Mark m2)
+ {
+ return m1.mark - m2.mark;
+ }
+
+ /**
+ * Collects and frees unused marks.
+ */
+ private void garbageCollect()
+ {
+ int count = marks.size();
+ ArrayList clean = new ArrayList();
+ for (int i = 0; i < count; i++)
+ {
+ Mark m = (Mark) marks.get(i);
+ if (m.get() != null)
+ clean.add(m);
+ }
+ marks = clean;
+ garbageMarks = 0;
+ }
}
diff --git a/libjava/classpath/javax/swing/text/GlyphView.java b/libjava/classpath/javax/swing/text/GlyphView.java
index d505274c91f..1e418d2e06a 100644
--- a/libjava/classpath/javax/swing/text/GlyphView.java
+++ b/libjava/classpath/javax/swing/text/GlyphView.java
@@ -38,14 +38,21 @@ exception statement from your version. */
package javax.swing.text;
+import gnu.classpath.SystemProperties;
+
import java.awt.Color;
+import java.awt.Container;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
+import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.Toolkit;
-import java.text.BreakIterator;
+import java.awt.font.FontRenderContext;
+import java.awt.font.TextHitInfo;
+import java.awt.font.TextLayout;
+import java.awt.geom.Rectangle2D;
import javax.swing.SwingConstants;
import javax.swing.event.DocumentEvent;
@@ -248,10 +255,164 @@ public class GlyphView extends View implements TabableView, Cloneable
}
/**
+ * A GlyphPainter implementation based on TextLayout. This should give
+ * better performance in Java2D environments.
+ */
+ private static class J2DGlyphPainter
+ extends GlyphPainter
+ {
+
+ /**
+ * The text layout.
+ */
+ TextLayout textLayout;
+
+ /**
+ * Creates a new J2DGlyphPainter.
+ *
+ * @param str the string
+ * @param font the font
+ * @param frc the font render context
+ */
+ J2DGlyphPainter(String str, Font font, FontRenderContext frc)
+ {
+ textLayout = new TextLayout(str, font, frc);
+ }
+
+ /**
+ * Returns null so that GlyphView.checkPainter() creates a new instance.
+ */
+ public GlyphPainter getPainter(GlyphView v, int p0, int p1)
+ {
+ return null;
+ }
+
+ /**
+ * Delegates to the text layout.
+ */
+ public float getAscent(GlyphView v)
+ {
+ return textLayout.getAscent();
+ }
+
+ /**
+ * Delegates to the text layout.
+ */
+ public int getBoundedPosition(GlyphView v, int p0, float x, float len)
+ {
+ int pos;
+ TextHitInfo hit = textLayout.hitTestChar(len, 0);
+ if (hit.getCharIndex() == -1 && ! textLayout.isLeftToRight())
+ pos = v.getEndOffset();
+ else
+ {
+ pos = hit.isLeadingEdge() ? hit.getInsertionIndex()
+ : hit.getInsertionIndex() - 1;
+ pos += v.getStartOffset();
+ }
+ return pos;
+ }
+
+ /**
+ * Delegates to the text layout.
+ */
+ public float getDescent(GlyphView v)
+ {
+ return textLayout.getDescent();
+ }
+
+ /**
+ * Delegates to the text layout.
+ */
+ public float getHeight(GlyphView view)
+ {
+ return textLayout.getAscent() + textLayout.getDescent()
+ + textLayout.getLeading();
+ }
+
+ /**
+ * Delegates to the text layout.
+ */
+ public float getSpan(GlyphView v, int p0, int p1, TabExpander te, float x)
+ {
+ float span;
+ if (p0 == v.getStartOffset() && p1 == v.getEndOffset())
+ span = textLayout.getAdvance();
+ else
+ {
+ int start = v.getStartOffset();
+ int i0 = p0 - start;
+ int i1 = p1 - start;
+ TextHitInfo hit0 = TextHitInfo.afterOffset(i0);
+ TextHitInfo hit1 = TextHitInfo.afterOffset(i1);
+ float x0 = textLayout.getCaretInfo(hit0)[0];
+ float x1 = textLayout.getCaretInfo(hit1)[0];
+ span = Math.abs(x1 - x0);
+ }
+ return span;
+ }
+
+ /**
+ * Delegates to the text layout.
+ */
+ public Shape modelToView(GlyphView v, int pos, Bias b, Shape a)
+ throws BadLocationException
+ {
+ int offs = pos - v.getStartOffset();
+ // Create copy here to protect original shape.
+ Rectangle2D bounds = a.getBounds2D();
+ TextHitInfo hit =
+ b == Position.Bias.Forward ? TextHitInfo.afterOffset(offs)
+ : TextHitInfo.beforeOffset(offs);
+ float[] loc = textLayout.getCaretInfo(hit);
+ bounds.setRect(bounds.getX() + loc[0], bounds.getY(), 1,
+ bounds.getHeight());
+ return bounds;
+ }
+
+ /**
+ * Delegates to the text layout.
+ */
+ public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1)
+ {
+ // Can't paint this with plain graphics.
+ if (g instanceof Graphics2D)
+ {
+ Graphics2D g2d = (Graphics2D) g;
+ Rectangle2D b = a instanceof Rectangle2D ? (Rectangle2D) a
+ : a.getBounds2D();
+ float x = (float) b.getX();
+ float y = (float) b.getY() + textLayout.getAscent()
+ + textLayout.getLeading();
+ // TODO: Try if clipping makes things faster for narrow views.
+ textLayout.draw(g2d, x, y);
+ }
+ }
+
+ /**
+ * Delegates to the text layout.
+ */
+ public int viewToModel(GlyphView v, float x, float y, Shape a,
+ Bias[] biasRet)
+ {
+ Rectangle2D bounds = a instanceof Rectangle2D ? (Rectangle2D) a
+ : a.getBounds2D();
+ TextHitInfo hit = textLayout.hitTestChar(x - (float) bounds.getX(), 0);
+ int pos = hit.getInsertionIndex();
+ biasRet[0] = hit.isLeadingEdge() ? Position.Bias.Forward
+ : Position.Bias.Backward;
+ return pos + v.getStartOffset();
+ }
+
+ }
+
+ /**
* The default <code>GlyphPainter</code> used in <code>GlyphView</code>.
*/
static class DefaultGlyphPainter extends GlyphPainter
{
+ FontMetrics fontMetrics;
+
/**
* Returns the full height of the rendered text.
*
@@ -259,9 +420,8 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public float getHeight(GlyphView view)
{
- Font font = view.getFont();
- FontMetrics metrics = Toolkit.getDefaultToolkit().getFontMetrics(font);
- float height = metrics.getHeight();
+ updateFontMetrics(view);
+ float height = fontMetrics.getHeight();
return height;
}
@@ -277,53 +437,27 @@ public class GlyphView extends View implements TabableView, Cloneable
public void paint(GlyphView view, Graphics g, Shape a, int p0,
int p1)
{
- Color oldColor = g.getColor();
- int height = (int) getHeight(view);
+ updateFontMetrics(view);
+ Rectangle r = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
+ TabExpander tabEx = view.getTabExpander();
Segment txt = view.getText(p0, p1);
- Rectangle bounds = a.getBounds();
- TabExpander tabEx = null;
- View parent = view.getParent();
- if (parent instanceof TabExpander)
- tabEx = (TabExpander) parent;
-
- int width = Utilities.getTabbedTextWidth(txt, g.getFontMetrics(),
- bounds.x, tabEx, txt.offset);
- // Fill the background of the text run.
- Color background = view.getBackground();
- if (background != null)
- {
- g.setColor(background);
- g.fillRect(bounds.x, bounds.y, width, height);
- }
- // Draw the actual text.
- g.setColor(view.getForeground());
- g.setFont(view.getFont());
- int ascent = g.getFontMetrics().getAscent();
- if (view.isSuperscript())
- // TODO: Adjust font for superscripting.
- Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent - height / 2,
- g, tabEx, txt.offset);
- else if (view.isSubscript())
- // TODO: Adjust font for subscripting.
- Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent + height / 2,
- g, tabEx, txt.offset);
- else
- Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent, g, tabEx,
- txt.offset);
- if (view.isStrikeThrough())
- {
- int strikeHeight = (int) (getAscent(view) / 2);
- g.drawLine(bounds.x, bounds.y + strikeHeight, bounds.height + width,
- bounds.y + strikeHeight);
- }
- if (view.isUnderline())
+ // Find out the X location at which we have to paint.
+ int x = r.x;
+ int p = view.getStartOffset();
+ if (p != p0)
{
- int lineHeight = (int) getAscent(view);
- g.drawLine(bounds.x, bounds.y + lineHeight, bounds.height + width,
- bounds.y + lineHeight);
+ int width = Utilities.getTabbedTextWidth(txt, fontMetrics,x, tabEx,
+ p);
+ x += width;
}
- g.setColor(oldColor);
+ // Find out Y location.
+ int y = r.y + fontMetrics.getHeight() - fontMetrics.getDescent();
+
+ // Render the thing.
+ g.setFont(fontMetrics.getFont());
+ Utilities.drawTabbedText(txt, x, y, g, tabEx, p0);
+
}
/**
@@ -350,15 +484,18 @@ public class GlyphView extends View implements TabableView, Cloneable
Shape a)
throws BadLocationException
{
+ updateFontMetrics(view);
Element el = view.getElement();
- Font font = view.getFont();
- FontMetrics fm = view.getContainer().getFontMetrics(font);
Segment txt = view.getText(el.getStartOffset(), pos);
- int width = fm.charsWidth(txt.array, txt.offset, txt.count);
- int height = fm.getHeight();
- Rectangle bounds = a.getBounds();
+ Rectangle bounds = a instanceof Rectangle ? (Rectangle) a
+ : a.getBounds();
+ TabExpander expander = view.getTabExpander();
+ int width = Utilities.getTabbedTextWidth(txt, fontMetrics, bounds.x,
+ expander,
+ view.getStartOffset());
+ int height = fontMetrics.getHeight();
Rectangle result = new Rectangle(bounds.x + width, bounds.y,
- bounds.x + width, height);
+ 0, height);
return result;
}
@@ -381,11 +518,10 @@ public class GlyphView extends View implements TabableView, Cloneable
public float getSpan(GlyphView view, int p0, int p1,
TabExpander te, float x)
{
- Element el = view.getElement();
- Font font = view.getFont();
- FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(font);
+ updateFontMetrics(view);
Segment txt = view.getText(p0, p1);
- int span = Utilities.getTabbedTextWidth(txt, fm, (int) x, te, p0);
+ int span = Utilities.getTabbedTextWidth(txt, fontMetrics, (int) x, te,
+ p0);
return span;
}
@@ -402,9 +538,8 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public float getAscent(GlyphView v)
{
- Font font = v.getFont();
- FontMetrics fm = v.getContainer().getFontMetrics(font);
- return fm.getAscent();
+ updateFontMetrics(v);
+ return fontMetrics.getAscent();
}
/**
@@ -420,9 +555,8 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public float getDescent(GlyphView v)
{
- Font font = v.getFont();
- FontMetrics fm = v.getContainer().getFontMetrics(font);
- return fm.getDescent();
+ updateFontMetrics(v);
+ return fontMetrics.getDescent();
}
/**
@@ -437,13 +571,12 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public int getBoundedPosition(GlyphView v, int p0, float x, float len)
{
+ updateFontMetrics(v);
TabExpander te = v.getTabExpander();
Segment txt = v.getText(p0, v.getEndOffset());
- Font font = v.getFont();
- FontMetrics fm = v.getContainer().getFontMetrics(font);
- int pos = Utilities.getTabbedTextOffset(txt, fm, (int) x,
+ int pos = Utilities.getTabbedTextOffset(txt, fontMetrics, (int) x,
(int) (x + len), te, p0, false);
- return pos;
+ return pos + p0;
}
/**
@@ -460,9 +593,33 @@ public class GlyphView extends View implements TabableView, Cloneable
public int viewToModel(GlyphView v, float x, float y, Shape a,
Bias[] biasRet)
{
- Rectangle b = a.getBounds();
- int pos = getBoundedPosition(v, v.getStartOffset(), b.x, x - b.x);
- return pos;
+ Rectangle r = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
+ int p0 = v.getStartOffset();
+ int p1 = v.getEndOffset();
+ TabExpander te = v.getTabExpander();
+ Segment s = v.getText(p0, p1);
+ int offset = Utilities.getTabbedTextOffset(s, fontMetrics, r.x, (int) x,
+ te, p0);
+ int ret = p0 + offset;
+ if (ret == p1)
+ ret--;
+ biasRet[0] = Position.Bias.Forward;
+ return ret;
+ }
+
+ private void updateFontMetrics(GlyphView v)
+ {
+ Font font = v.getFont();
+ if (fontMetrics == null || ! font.equals(fontMetrics.getFont()))
+ {
+ Container c = v.getContainer();
+ FontMetrics fm;
+ if (c != null)
+ fm = c.getFontMetrics(font);
+ else
+ fm = Toolkit.getDefaultToolkit().getFontMetrics(font);
+ fontMetrics = fm;
+ }
}
}
@@ -474,12 +631,22 @@ public class GlyphView extends View implements TabableView, Cloneable
/**
* The start offset within the document for this view.
*/
- private int startOffset;
+ private int offset;
/**
* The end offset within the document for this view.
*/
- private int endOffset;
+ private int length;
+
+ /**
+ * The x location against which the tab expansion is done.
+ */
+ private float tabX;
+
+ /**
+ * The tab expander that is used in this view.
+ */
+ private TabExpander tabExpander;
/**
* Creates a new <code>GlyphView</code> for the given <code>Element</code>.
@@ -489,8 +656,8 @@ public class GlyphView extends View implements TabableView, Cloneable
public GlyphView(Element element)
{
super(element);
- startOffset = -1;
- endOffset = -1;
+ offset = 0;
+ length = 0;
}
/**
@@ -524,7 +691,21 @@ public class GlyphView extends View implements TabableView, Cloneable
protected void checkPainter()
{
if (glyphPainter == null)
- glyphPainter = new DefaultGlyphPainter();
+ {
+ if ("true".equals(
+ SystemProperties.getProperty("gnu.javax.swing.noGraphics2D")))
+ {
+ glyphPainter = new DefaultGlyphPainter();
+ }
+ else
+ {
+ Segment s = getText(getStartOffset(), getEndOffset());
+ glyphPainter = new J2DGlyphPainter(s.toString(), getFont(),
+ new FontRenderContext(null,
+ false,
+ false));
+ }
+ }
}
/**
@@ -536,9 +717,80 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public void paint(Graphics g, Shape a)
{
- Element el = getElement();
checkPainter();
- getGlyphPainter().paint(this, g, a, getStartOffset(), getEndOffset());
+ int p0 = getStartOffset();
+ int p1 = getEndOffset();
+
+ Rectangle r = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
+ Container c = getContainer();
+
+ Color fg = getForeground();
+ JTextComponent tc = null;
+ if (c instanceof JTextComponent)
+ {
+ tc = (JTextComponent) c;
+ if (! tc.isEnabled())
+ fg = tc.getDisabledTextColor();
+ }
+ Color bg = getBackground();
+ if (bg != null)
+ {
+ g.setColor(bg);
+ System.err.println("fill background: " + bg);
+ g.fillRect(r.x, r.y, r.width, r.height);
+ }
+
+
+ // Paint layered highlights if there are any.
+ if (tc != null)
+ {
+ Highlighter h = tc.getHighlighter();
+ if (h instanceof LayeredHighlighter)
+ {
+ LayeredHighlighter lh = (LayeredHighlighter) h;
+ lh.paintLayeredHighlights(g, p0, p1, a, tc, this);
+ }
+ }
+
+ g.setColor(fg);
+ glyphPainter.paint(this, g, a, p0, p1);
+ boolean underline = isUnderline();
+ boolean striked = isStrikeThrough();
+ if (underline || striked)
+ {
+ View parent = getParent();
+ // X coordinate.
+ if (parent != null && parent.getEndOffset() == p1)
+ {
+ // Strip whitespace.
+ Segment s = getText(p0, p1);
+ while (s.count > 0 && Character.isWhitespace(s.array[s.count - 1]))
+ {
+ p1--;
+ s.count--;
+ }
+ }
+ int x0 = r.x;
+ int p = getStartOffset();
+ TabExpander tabEx = getTabExpander();
+ if (p != p0)
+ x0 += (int) glyphPainter.getSpan(this, p, p0, tabEx, x0);
+ int x1 = x0 + (int) glyphPainter.getSpan(this, p0, p1, tabEx, x0);
+ // Y coordinate.
+ int y = r.y + r.height - (int) glyphPainter.getDescent(this);
+ if (underline)
+ {
+ int yTmp = y;
+ yTmp += 1;
+ g.drawLine(x0, yTmp, x1, yTmp);
+ }
+ if (striked)
+ {
+ int yTmp = y;
+ yTmp -= (int) glyphPainter.getAscent(this);
+ g.drawLine(x0, yTmp, x1, yTmp);
+ }
+ }
}
@@ -555,19 +807,24 @@ public class GlyphView extends View implements TabableView, Cloneable
float span = 0;
checkPainter();
GlyphPainter painter = getGlyphPainter();
- if (axis == X_AXIS)
+ switch (axis)
{
- Element el = getElement();
+ case X_AXIS:
TabExpander tabEx = null;
View parent = getParent();
if (parent instanceof TabExpander)
tabEx = (TabExpander) parent;
span = painter.getSpan(this, getStartOffset(), getEndOffset(),
tabEx, 0.F);
+ break;
+ case Y_AXIS:
+ span = painter.getHeight(this);
+ if (isSuperscript())
+ span += span / 3;
+ break;
+ default:
+ throw new IllegalArgumentException("Illegal axis");
}
- else
- span = painter.getHeight(this);
-
return span;
}
@@ -623,13 +880,7 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public TabExpander getTabExpander()
{
- TabExpander te = null;
- View parent = getParent();
-
- if (parent instanceof TabExpander)
- te = (TabExpander) parent;
-
- return te;
+ return tabExpander;
}
/**
@@ -642,9 +893,17 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public float getTabbedSpan(float x, TabExpander te)
{
- Element el = getElement();
- return getGlyphPainter().getSpan(this, el.getStartOffset(),
- el.getEndOffset(), te, x);
+ checkPainter();
+ TabExpander old = tabExpander;
+ tabExpander = te;
+ if (tabExpander != old)
+ {
+ // Changing the tab expander will lead to a relayout in the X_AXIS.
+ preferenceChanged(null, true, false);
+ }
+ tabX = x;
+ return getGlyphPainter().getSpan(this, getStartOffset(),
+ getEndOffset(), tabExpander, x);
}
/**
@@ -658,23 +917,8 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public float getPartialSpan(int p0, int p1)
{
- Element el = getElement();
- Document doc = el.getDocument();
- Segment seg = new Segment();
- try
- {
- doc.getText(p0, p1 - p0, seg);
- }
- catch (BadLocationException ex)
- {
- AssertionError ae;
- ae = new AssertionError("BadLocationException must not be thrown "
- + "here");
- ae.initCause(ex);
- throw ae;
- }
- FontMetrics fm = null; // Fetch font metrics somewhere.
- return Utilities.getTabbedTextWidth(seg, fm, 0, null, p0);
+ checkPainter();
+ return glyphPainter.getSpan(this, p0, p1, tabExpander, tabX);
}
/**
@@ -686,10 +930,11 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public int getStartOffset()
{
- int start = startOffset;
- if (start < 0)
- start = super.getStartOffset();
- return start;
+ Element el = getElement();
+ int offs = el.getStartOffset();
+ if (length > 0)
+ offs += offset;
+ return offs;
}
/**
@@ -701,12 +946,17 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public int getEndOffset()
{
- int end = endOffset;
- if (end < 0)
- end = super.getEndOffset();
- return end;
+ Element el = getElement();
+ int offs;
+ if (length > 0)
+ offs = el.getStartOffset() + offset + length;
+ else
+ offs = el.getEndOffset();
+ return offs;
}
+ private Segment cached = new Segment();
+
/**
* Returns the text segment that this view is responsible for.
*
@@ -717,10 +967,9 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public Segment getText(int p0, int p1)
{
- Segment txt = new Segment();
try
{
- getDocument().getText(p0, p1 - p0, txt);
+ getDocument().getText(p0, p1 - p0, cached);
}
catch (BadLocationException ex)
{
@@ -731,7 +980,7 @@ public class GlyphView extends View implements TabableView, Cloneable
throw ae;
}
- return txt;
+ return cached;
}
/**
@@ -743,16 +992,19 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public Font getFont()
{
- Element el = getElement();
- AttributeSet atts = el.getAttributes();
- String family = StyleConstants.getFontFamily(atts);
- int size = StyleConstants.getFontSize(atts);
- int style = Font.PLAIN;
- if (StyleConstants.isBold(atts))
- style |= Font.BOLD;
- if (StyleConstants.isItalic(atts))
- style |= Font.ITALIC;
- Font font = new Font(family, style, size);
+ Document doc = getDocument();
+ Font font = null;
+ if (doc instanceof StyledDocument)
+ {
+ StyledDocument styledDoc = (StyledDocument) doc;
+ font = styledDoc.getFont(getAttributes());
+ }
+ else
+ {
+ Container c = getContainer();
+ if (c != null)
+ font = c.getFont();
+ }
return font;
}
@@ -885,33 +1137,21 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public View breakView(int axis, int p0, float pos, float len)
{
- if (axis == Y_AXIS)
- return this;
-
- checkPainter();
- GlyphPainter painter = getGlyphPainter();
-
- // Try to find a suitable line break.
- BreakIterator lineBreaker = BreakIterator.getLineInstance();
- Segment txt = new Segment();
- try
- {
- int start = getStartOffset();
- int length = getEndOffset() - start;
- getDocument().getText(start, length, txt);
- }
- catch (BadLocationException ex)
+ View brokenView = this;
+ if (axis == X_AXIS)
{
- AssertionError err = new AssertionError("BadLocationException must not "
- + "be thrown here.");
- err.initCause(ex);
- throw err;
+ checkPainter();
+ int end = glyphPainter.getBoundedPosition(this, p0, pos, len);
+ int breakLoc = getBreakLocation(p0, end);
+ if (breakLoc != -1)
+ end = breakLoc;
+ if (p0 != getStartOffset() || end != getEndOffset())
+ {
+ brokenView = createFragment(p0, end);
+ if (brokenView instanceof GlyphView)
+ ((GlyphView) brokenView).tabX = pos;
+ }
}
- int breakLocation =
- Utilities.getBreakLocation(txt, getContainer().getFontMetrics(getFont()),
- (int) pos, (int) (pos + len),
- getTabExpander(), p0);
- View brokenView = createFragment(p0, breakLocation);
return brokenView;
}
@@ -937,28 +1177,36 @@ public class GlyphView extends View implements TabableView, Cloneable
weight = super.getBreakWeight(axis, pos, len);
else
{
- // FIXME: Commented out because the Utilities.getBreakLocation method
- // is still buggy. The GoodBreakWeight is a reasonable workaround for
- // now.
-// int startOffset = getStartOffset();
-// int endOffset = getEndOffset() - 1;
-// Segment s = getText(startOffset, endOffset);
-// Container c = getContainer();
-// FontMetrics fm = c.getFontMetrics(c.getFont());
-// int x0 = (int) pos;
-// int x = (int) (pos + len);
-// int breakLoc = Utilities.getBreakLocation(s, fm, x0, x,
-// getTabExpander(),
-// startOffset);
-// if (breakLoc == startOffset || breakLoc == endOffset)
-// weight = GoodBreakWeight;
-// else
-// weight = ExcellentBreakWeight;
- weight = GoodBreakWeight;
+ checkPainter();
+ int start = getStartOffset();
+ int end = glyphPainter.getBoundedPosition(this, start, pos, len);
+ if (end == 0)
+ weight = BadBreakWeight;
+ else
+ {
+ if (getBreakLocation(start, end) != -1)
+ weight = ExcellentBreakWeight;
+ else
+ weight = GoodBreakWeight;
+ }
}
return weight;
}
+ private int getBreakLocation(int start, int end)
+ {
+ int loc = -1;
+ Segment s = getText(start, end);
+ for (char c = s.last(); c != Segment.DONE && loc == -1; c = s.previous())
+ {
+ if (Character.isWhitespace(c))
+ {
+ loc = s.getIndex() - s.getBeginIndex() + 1 + start;
+ }
+ }
+ return loc;
+ }
+
/**
* Receives notification that some text attributes have changed within the
* text fragment that this view is responsible for. This calls
@@ -971,7 +1219,7 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory vf)
{
- preferenceChanged(this, true, true);
+ preferenceChanged(null, true, true);
}
/**
@@ -986,7 +1234,7 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public void insertUpdate(DocumentEvent e, Shape a, ViewFactory vf)
{
- preferenceChanged(this, true, false);
+ preferenceChanged(null, true, false);
}
/**
@@ -1001,7 +1249,7 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public void removeUpdate(DocumentEvent e, Shape a, ViewFactory vf)
{
- preferenceChanged(this, true, false);
+ preferenceChanged(null, true, false);
}
/**
@@ -1015,11 +1263,12 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public View createFragment(int p0, int p1)
{
+ checkPainter();
+ Element el = getElement();
GlyphView fragment = (GlyphView) clone();
- if (p0 != getStartOffset())
- fragment.startOffset = p0;
- if (p1 != getEndOffset())
- fragment.endOffset = p1;
+ fragment.offset = p0 - el.getStartOffset();
+ fragment.length = p1 - p0;
+ fragment.glyphPainter = glyphPainter.getPainter(fragment, p0, p1);
return fragment;
}
@@ -1031,14 +1280,21 @@ public class GlyphView extends View implements TabableView, Cloneable
*/
public float getAlignment(int axis)
{
+ checkPainter();
float align;
if (axis == Y_AXIS)
{
- checkPainter();
GlyphPainter painter = getGlyphPainter();
float height = painter.getHeight(this);
float descent = painter.getDescent(this);
- align = (height - descent) / height;
+ float ascent = painter.getAscent(this);
+ if (isSuperscript())
+ align = 1.0F;
+ else if (isSubscript())
+ align = height > 0 ? (height - (descent + (ascent / 2))) / height
+ : 0;
+ else
+ align = height > 0 ? (height - descent) / height : 0;
}
else
align = super.getAlignment(axis);
diff --git a/libjava/classpath/javax/swing/text/InternationalFormatter.java b/libjava/classpath/javax/swing/text/InternationalFormatter.java
index 8db435c18f3..d6f2359e6f7 100644
--- a/libjava/classpath/javax/swing/text/InternationalFormatter.java
+++ b/libjava/classpath/javax/swing/text/InternationalFormatter.java
@@ -285,7 +285,7 @@ public class InternationalFormatter
if (minimum != null && minimum.compareTo(o) > 0)
throw new ParseException("The value may not be less than the"
+ " specified minimum", 0);
- if (maximum != null && minimum.compareTo(o) < 0)
+ if (maximum != null && maximum.compareTo(o) < 0)
throw new ParseException("The value may not be greater than the"
+ " specified maximum", 0);
return o;
diff --git a/libjava/classpath/javax/swing/text/JTextComponent.java b/libjava/classpath/javax/swing/text/JTextComponent.java
index 6da84bfe7d8..68ba1f4284c 100644
--- a/libjava/classpath/javax/swing/text/JTextComponent.java
+++ b/libjava/classpath/javax/swing/text/JTextComponent.java
@@ -38,8 +38,6 @@ exception statement from your version. */
package javax.swing.text;
-import gnu.classpath.NotImplementedException;
-
import java.awt.AWTEvent;
import java.awt.Color;
import java.awt.Container;
@@ -47,6 +45,7 @@ import java.awt.Dimension;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
+import java.awt.Shape;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.StringSelection;
@@ -59,6 +58,7 @@ import java.awt.event.MouseEvent;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
+import java.text.BreakIterator;
import java.util.Enumeration;
import java.util.Hashtable;
@@ -67,6 +67,7 @@ import javax.accessibility.AccessibleAction;
import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleEditableText;
import javax.accessibility.AccessibleRole;
+import javax.accessibility.AccessibleState;
import javax.accessibility.AccessibleStateSet;
import javax.accessibility.AccessibleText;
import javax.swing.Action;
@@ -105,12 +106,7 @@ public abstract class JTextComponent extends JComponent
/**
* The caret's offset.
*/
- int dot = 0;
-
- /**
- * The current JTextComponent.
- */
- JTextComponent textComp = JTextComponent.this;
+ private int caretDot;
/**
* Construct an AccessibleJTextComponent.
@@ -118,7 +114,8 @@ public abstract class JTextComponent extends JComponent
public AccessibleJTextComponent()
{
super();
- textComp.addCaretListener(this);
+ JTextComponent.this.addCaretListener(this);
+ caretDot = getCaretPosition();
}
/**
@@ -129,8 +126,7 @@ public abstract class JTextComponent extends JComponent
*/
public int getCaretPosition()
{
- dot = textComp.getCaretPosition();
- return dot;
+ return JTextComponent.this.getCaretPosition();
}
/**
@@ -141,7 +137,7 @@ public abstract class JTextComponent extends JComponent
*/
public String getSelectedText()
{
- return textComp.getSelectedText();
+ return JTextComponent.this.getSelectedText();
}
/**
@@ -156,9 +152,10 @@ public abstract class JTextComponent extends JComponent
*/
public int getSelectionStart()
{
- if (getSelectedText() == null || (textComp.getText().equals("")))
+ if (getSelectedText() == null
+ || (JTextComponent.this.getText().equals("")))
return 0;
- return textComp.getSelectionStart();
+ return JTextComponent.this.getSelectionStart();
}
/**
@@ -173,9 +170,7 @@ public abstract class JTextComponent extends JComponent
*/
public int getSelectionEnd()
{
- if (getSelectedText() == null || (textComp.getText().equals("")))
- return 0;
- return textComp.getSelectionEnd();
+ return JTextComponent.this.getSelectionEnd();
}
/**
@@ -185,10 +180,20 @@ public abstract class JTextComponent extends JComponent
* @param e - the caret update event
*/
public void caretUpdate(CaretEvent e)
- throws NotImplementedException
{
- // TODO: fire appropriate event.
- dot = e.getDot();
+ int dot = e.getDot();
+ int mark = e.getMark();
+ if (caretDot != dot)
+ {
+ firePropertyChange(ACCESSIBLE_CARET_PROPERTY, new Integer(caretDot),
+ new Integer(dot));
+ caretDot = dot;
+ }
+ if (mark != dot)
+ {
+ firePropertyChange(ACCESSIBLE_SELECTION_PROPERTY, null,
+ getSelectedText());
+ }
}
/**
@@ -197,10 +202,10 @@ public abstract class JTextComponent extends JComponent
* @return the accessible state set of this component
*/
public AccessibleStateSet getAccessibleStateSet()
- throws NotImplementedException
{
AccessibleStateSet state = super.getAccessibleStateSet();
- // TODO: Figure out what state must be added here to the super's state.
+ if (isEditable())
+ state.add(AccessibleState.EDITABLE);
return state;
}
@@ -248,9 +253,9 @@ public abstract class JTextComponent extends JComponent
* @param e - the insertion event
*/
public void insertUpdate(DocumentEvent e)
- throws NotImplementedException
{
- // TODO
+ firePropertyChange(ACCESSIBLE_TEXT_PROPERTY, null,
+ new Integer(e.getOffset()));
}
/**
@@ -261,9 +266,9 @@ public abstract class JTextComponent extends JComponent
* @param e - the removal event
*/
public void removeUpdate(DocumentEvent e)
- throws NotImplementedException
{
- // TODO
+ firePropertyChange(ACCESSIBLE_TEXT_PROPERTY, null,
+ new Integer(e.getOffset()));
}
/**
@@ -274,9 +279,9 @@ public abstract class JTextComponent extends JComponent
* @param e - text change event
*/
public void changedUpdate(DocumentEvent e)
- throws NotImplementedException
{
- // TODO
+ firePropertyChange(ACCESSIBLE_TEXT_PROPERTY, null,
+ new Integer(e.getOffset()));
}
/**
@@ -289,9 +294,8 @@ public abstract class JTextComponent extends JComponent
* @return a character index, or -1
*/
public int getIndexAtPoint(Point p)
- throws NotImplementedException
{
- return 0; // TODO
+ return viewToModel(p);
}
/**
@@ -305,9 +309,51 @@ public abstract class JTextComponent extends JComponent
* @return a character's bounding box, or null
*/
public Rectangle getCharacterBounds(int index)
- throws NotImplementedException
{
- return null; // TODO
+ // This is basically the same as BasicTextUI.modelToView().
+
+ Rectangle bounds = null;
+ if (index >= 0 && index < doc.getLength() - 1)
+ {
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readLock();
+ try
+ {
+ TextUI ui = getUI();
+ if (ui != null)
+ {
+ // Get editor rectangle.
+ Rectangle rect = new Rectangle();
+ Insets insets = getInsets();
+ rect.x = insets.left;
+ rect.y = insets.top;
+ rect.width = getWidth() - insets.left - insets.right;
+ rect.height = getHeight() - insets.top - insets.bottom;
+ View rootView = ui.getRootView(JTextComponent.this);
+ if (rootView != null)
+ {
+ rootView.setSize(rect.width, rect.height);
+ Shape s = rootView.modelToView(index,
+ Position.Bias.Forward,
+ index + 1,
+ Position.Bias.Backward,
+ rect);
+ if (s != null)
+ bounds = s.getBounds();
+ }
+ }
+ }
+ catch (BadLocationException ex)
+ {
+ // Ignore (return null).
+ }
+ finally
+ {
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readUnlock();
+ }
+ }
+ return bounds;
}
/**
@@ -317,7 +363,7 @@ public abstract class JTextComponent extends JComponent
*/
public int getCharCount()
{
- return textComp.getText().length();
+ return JTextComponent.this.getText().length();
}
/**
@@ -329,9 +375,26 @@ public abstract class JTextComponent extends JComponent
* @return the character's attributes
*/
public AttributeSet getCharacterAttribute(int index)
- throws NotImplementedException
{
- return null; // TODO
+ AttributeSet atts;
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readLock();
+ try
+ {
+ Element el = doc.getDefaultRootElement();
+ while (! el.isLeaf())
+ {
+ int i = el.getElementIndex(index);
+ el = el.getElement(i);
+ }
+ atts = el.getAttributes();
+ }
+ finally
+ {
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readUnlock();
+ }
+ return atts;
}
/**
@@ -344,9 +407,8 @@ public abstract class JTextComponent extends JComponent
* @return the part of text at that index, or null
*/
public String getAtIndex(int part, int index)
- throws NotImplementedException
{
- return null; // TODO
+ return getAtIndexImpl(part, index, 0);
}
/**
@@ -359,9 +421,8 @@ public abstract class JTextComponent extends JComponent
* @return the part of text after that index, or null
*/
public String getAfterIndex(int part, int index)
- throws NotImplementedException
{
- return null; // TODO
+ return getAtIndexImpl(part, index, 1);
}
/**
@@ -374,11 +435,84 @@ public abstract class JTextComponent extends JComponent
* @return the part of text before that index, or null
*/
public String getBeforeIndex(int part, int index)
- throws NotImplementedException
{
- return null; // TODO
+ return getAtIndexImpl(part, index, -1);
}
-
+
+ /**
+ * Implements getAtIndex(), getBeforeIndex() and getAfterIndex().
+ *
+ * @param part the part to return, either CHARACTER, WORD or SENTENCE
+ * @param index the index
+ * @param dir the direction, -1 for backwards, 0 for here, +1 for forwards
+ *
+ * @return the resulting string
+ */
+ private String getAtIndexImpl(int part, int index, int dir)
+ {
+ String ret = null;
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readLock();
+ try
+ {
+ BreakIterator iter = null;
+ switch (part)
+ {
+ case CHARACTER:
+ iter = BreakIterator.getCharacterInstance(getLocale());
+ break;
+ case WORD:
+ iter = BreakIterator.getWordInstance(getLocale());
+ break;
+ case SENTENCE:
+ iter = BreakIterator.getSentenceInstance(getLocale());
+ break;
+ default:
+ break;
+ }
+ String text = doc.getText(0, doc.getLength() - 1);
+ iter.setText(text);
+ int start = index;
+ int end = index;
+ switch (dir)
+ {
+ case 0:
+ if (iter.isBoundary(index))
+ {
+ start = index;
+ end = iter.following(index);
+ }
+ else
+ {
+ start = iter.preceding(index);
+ end = iter.next();
+ }
+ break;
+ case 1:
+ start = iter.following(index);
+ end = iter.next();
+ break;
+ case -1:
+ end = iter.preceding(index);
+ start = iter.previous();
+ break;
+ default:
+ assert false;
+ }
+ ret = text.substring(start, end);
+ }
+ catch (BadLocationException ex)
+ {
+ // Ignore (return null).
+ }
+ finally
+ {
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readUnlock();
+ }
+ return ret;
+ }
+
/**
* Returns the number of actions for this object. The zero-th
* object represents the default action.
@@ -386,9 +520,8 @@ public abstract class JTextComponent extends JComponent
* @return the number of actions (0-based).
*/
public int getAccessibleActionCount()
- throws NotImplementedException
{
- return 0; // TODO
+ return getActions().length;
}
/**
@@ -400,10 +533,12 @@ public abstract class JTextComponent extends JComponent
* @return description of the i-th action
*/
public String getAccessibleActionDescription(int i)
- throws NotImplementedException
{
- // TODO: Not implemented fully
- return super.getAccessibleDescription();
+ String desc = null;
+ Action[] actions = getActions();
+ if (i >= 0 && i < actions.length)
+ desc = (String) actions[i].getValue(Action.NAME);
+ return desc;
}
/**
@@ -415,9 +550,17 @@ public abstract class JTextComponent extends JComponent
* @return true if the action was performed successfully
*/
public boolean doAccessibleAction(int i)
- throws NotImplementedException
{
- return false; // TODO
+ boolean ret = false;
+ Action[] actions = getActions();
+ if (i >= 0 && i < actions.length)
+ {
+ ActionEvent ev = new ActionEvent(JTextComponent.this,
+ ActionEvent.ACTION_PERFORMED, null);
+ actions[i].actionPerformed(ev);
+ ret = true;
+ }
+ return ret;
}
/**
@@ -426,9 +569,8 @@ public abstract class JTextComponent extends JComponent
* @param s - the new text contents.
*/
public void setTextContents(String s)
- throws NotImplementedException
{
- // TODO
+ setText(s);
}
/**
@@ -438,9 +580,16 @@ public abstract class JTextComponent extends JComponent
* @param s - the new text
*/
public void insertTextAtIndex(int index, String s)
- throws NotImplementedException
{
- replaceText(index, index, s);
+ try
+ {
+ doc.insertString(index, s, null);
+ }
+ catch (BadLocationException ex)
+ {
+ // What should we do with this?
+ ex.printStackTrace();
+ }
}
/**
@@ -453,7 +602,7 @@ public abstract class JTextComponent extends JComponent
{
try
{
- return textComp.getText(start, end - start);
+ return JTextComponent.this.getText(start, end - start);
}
catch (BadLocationException ble)
{
@@ -481,8 +630,8 @@ public abstract class JTextComponent extends JComponent
*/
public void cut(int start, int end)
{
- textComp.select(start, end);
- textComp.cut();
+ JTextComponent.this.select(start, end);
+ JTextComponent.this.cut();
}
/**
@@ -492,8 +641,8 @@ public abstract class JTextComponent extends JComponent
*/
public void paste(int start)
{
- textComp.setCaretPosition(start);
- textComp.paste();
+ JTextComponent.this.setCaretPosition(start);
+ JTextComponent.this.paste();
}
/**
@@ -506,8 +655,8 @@ public abstract class JTextComponent extends JComponent
*/
public void replaceText(int start, int end, String s)
{
- textComp.select(start, end);
- textComp.replaceSelection(s);
+ JTextComponent.this.select(start, end);
+ JTextComponent.this.replaceSelection(s);
}
/**
@@ -518,7 +667,7 @@ public abstract class JTextComponent extends JComponent
*/
public void selectText(int start, int end)
{
- textComp.select(start, end);
+ JTextComponent.this.select(start, end);
}
/**
@@ -529,9 +678,12 @@ public abstract class JTextComponent extends JComponent
* @param s - the new attribute set for the text in the range
*/
public void setAttributes(int start, int end, AttributeSet s)
- throws NotImplementedException
{
- // TODO
+ if (doc instanceof StyledDocument)
+ {
+ StyledDocument sdoc = (StyledDocument) doc;
+ sdoc.setCharacterAttributes(start, end - start, s, true);
+ }
}
}
diff --git a/libjava/classpath/javax/swing/text/LabelView.java b/libjava/classpath/javax/swing/text/LabelView.java
index 03279c4b2b5..7cfeae86229 100644
--- a/libjava/classpath/javax/swing/text/LabelView.java
+++ b/libjava/classpath/javax/swing/text/LabelView.java
@@ -39,9 +39,11 @@ exception statement from your version. */
package javax.swing.text;
import java.awt.Color;
+import java.awt.Container;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Shape;
+import java.awt.Toolkit;
import javax.swing.event.DocumentEvent;
@@ -90,6 +92,11 @@ public class LabelView extends GlyphView
boolean superscript;
/**
+ * Indicates if the attributes must be refetched.
+ */
+ private boolean valid;
+
+ /**
* Creates a new <code>GlyphView</code> for the given <code>Element</code>.
*
* @param element the element that is rendered by this GlyphView
@@ -97,7 +104,7 @@ public class LabelView extends GlyphView
public LabelView(Element element)
{
super(element);
- setPropertiesFromAttributes();
+ valid = false;
}
/**
@@ -107,28 +114,25 @@ public class LabelView extends GlyphView
*/
protected void setPropertiesFromAttributes()
{
- Element el = getElement();
- AttributeSet atts = el.getAttributes();
- // We cannot use StyleConstants.getBackground() here, because that returns
- // BLACK as default (when background == null). What we need is the
- // background setting of the text component instead, which is what we get
- // when background == null anyway.
- background = (Color) atts.getAttribute(StyleConstants.Background);
- foreground = StyleConstants.getForeground(atts);
- strikeThrough = StyleConstants.isStrikeThrough(atts);
- subscript = StyleConstants.isSubscript(atts);
- superscript = StyleConstants.isSuperscript(atts);
- underline = StyleConstants.isUnderline(atts);
-
- // Determine the font.
- String family = StyleConstants.getFontFamily(atts);
- int size = StyleConstants.getFontSize(atts);
- int style = Font.PLAIN;
- if (StyleConstants.isBold(atts))
- style |= Font.BOLD;
- if (StyleConstants.isItalic(atts))
- style |= Font.ITALIC;
- font = new Font(family, style, size);
+ AttributeSet atts = getAttributes();
+ setStrikeThrough(StyleConstants.isStrikeThrough(atts));
+ setSubscript(StyleConstants.isSubscript(atts));
+ setSuperscript(StyleConstants.isSuperscript(atts));
+ setUnderline(StyleConstants.isUnderline(atts));
+
+ // Determine the font and colors.
+ Document d = getDocument();
+ if (d instanceof StyledDocument)
+ {
+ StyledDocument doc = (StyledDocument) d;
+ font = doc.getFont(atts);
+ if (atts.isDefined(StyleConstants.Background))
+ background = doc.getBackground(atts);
+ else
+ background = null;
+ foreground = doc.getForeground(atts);
+ }
+ valid = true;
}
/**
@@ -142,7 +146,8 @@ public class LabelView extends GlyphView
*/
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory vf)
{
- setPropertiesFromAttributes();
+ valid = false;
+ super.changedUpdate(e, a, vf);
}
/**
@@ -152,6 +157,8 @@ public class LabelView extends GlyphView
*/
public Color getBackground()
{
+ if (! valid)
+ setPropertiesFromAttributes();
return background;
}
@@ -175,6 +182,8 @@ public class LabelView extends GlyphView
*/
public Color getForeground()
{
+ if (! valid)
+ setPropertiesFromAttributes();
return foreground;
}
@@ -185,6 +194,8 @@ public class LabelView extends GlyphView
*/
public Font getFont()
{
+ if (! valid)
+ setPropertiesFromAttributes();
return font;
}
@@ -197,7 +208,16 @@ public class LabelView extends GlyphView
*/
protected FontMetrics getFontMetrics()
{
- return getContainer().getGraphics().getFontMetrics(font);
+ if (! valid)
+ setPropertiesFromAttributes();
+
+ Container c = getContainer();
+ FontMetrics fm;
+ if (c != null)
+ fm = c.getFontMetrics(font);
+ else
+ fm = Toolkit.getDefaultToolkit().getFontMetrics(font);
+ return fm;
}
/**
@@ -209,6 +229,8 @@ public class LabelView extends GlyphView
*/
public boolean isUnderline()
{
+ if (! valid)
+ setPropertiesFromAttributes();
return underline;
}
@@ -232,6 +254,8 @@ public class LabelView extends GlyphView
*/
public boolean isSubscript()
{
+ if (! valid)
+ setPropertiesFromAttributes();
return subscript;
}
@@ -255,6 +279,8 @@ public class LabelView extends GlyphView
*/
public boolean isSuperscript()
{
+ if (! valid)
+ setPropertiesFromAttributes();
return superscript;
}
@@ -278,6 +304,8 @@ public class LabelView extends GlyphView
*/
public boolean isStrikeThrough()
{
+ if (! valid)
+ setPropertiesFromAttributes();
return strikeThrough;
}
diff --git a/libjava/classpath/javax/swing/text/MaskFormatter.java b/libjava/classpath/javax/swing/text/MaskFormatter.java
index d12b9ea29d7..581cceb617d 100644
--- a/libjava/classpath/javax/swing/text/MaskFormatter.java
+++ b/libjava/classpath/javax/swing/text/MaskFormatter.java
@@ -110,9 +110,7 @@ public class MaskFormatter extends DefaultFormatter
*/
public MaskFormatter (String mask) throws java.text.ParseException
{
- // Override super's default behaviour, in MaskFormatter the default
- // is not to allow invalid values
- setAllowsInvalid(false);
+ this();
setMask (mask);
}
@@ -307,60 +305,124 @@ public class MaskFormatter extends DefaultFormatter
*/
public Object stringToValue (String value) throws ParseException
{
- int vLength = value.length();
-
- // For value to be a valid it must be the same length as the mask
- // note this doesn't take into account symbols that occupy more than
- // one character, this is something we may possibly need to fix.
- if (maskLength != vLength)
- throw new ParseException ("stringToValue passed invalid value", vLength);
-
- // Check if the value is valid according to the mask and valid/invalid
- // sets.
- try
- {
- convertValue(value, false);
- }
- catch (ParseException pe)
- {
- throw new ParseException("stringToValue passed invalid value",
- pe.getErrorOffset());
- }
-
- if (!getValueContainsLiteralCharacters())
- value = stripLiterals(value);
- return super.stringToValue(value);
+ return super.stringToValue(convertStringToValue(value));
}
- /**
- * Strips the literal characters from the given String.
- * @param value the String to strip
- * @return the stripped String
- */
- String stripLiterals(String value)
+ private String convertStringToValue(String value)
+ throws ParseException
{
StringBuffer result = new StringBuffer();
- for (int i = 0; i < value.length(); i++)
+ char valueChar;
+ boolean isPlaceHolder;
+
+ int length = mask.length();
+ for (int i = 0, j = 0; j < length; j++)
{
- // Only append the characters that don't correspond to literal
- // characters in the mask.
- switch (mask.charAt(i))
+ char maskChar = mask.charAt(j);
+
+ if (i < value.length())
+ {
+ isPlaceHolder = false;
+ valueChar = value.charAt(i);
+ if (maskChar != ESCAPE_CHAR && maskChar != valueChar)
+ {
+ if (invalidChars != null
+ && invalidChars.indexOf(valueChar) != -1)
+ throw new ParseException("Invalid character: " + valueChar, i);
+ if (validChars != null
+ && validChars.indexOf(valueChar) == -1)
+ throw new ParseException("Invalid character: " + valueChar, i);
+ }
+ }
+ else if (placeHolder != null && i < placeHolder.length())
+ {
+ isPlaceHolder = true;
+ valueChar = placeHolder.charAt(i);
+ }
+ else
+ {
+ isPlaceHolder = true;
+ valueChar = placeHolderChar;
+ }
+
+ // This switch block on the mask character checks that the character
+ // within <code>value</code> at that point is valid according to the
+ // mask and also converts to upper/lowercase as needed.
+ switch (maskChar)
{
case NUM_CHAR:
+ if (! Character.isDigit(valueChar))
+ throw new ParseException("Number expected: " + valueChar, i);
+ result.append(valueChar);
+ i++;
+ break;
case UPPERCASE_CHAR:
+ if (! Character.isLetter(valueChar))
+ throw new ParseException("Letter expected", i);
+ result.append(Character.toUpperCase(valueChar));
+ i++;
+ break;
case LOWERCASE_CHAR:
+ if (! Character.isLetter(valueChar))
+ throw new ParseException("Letter expected", i);
+ result.append(Character.toLowerCase(valueChar));
+ i++;
+ break;
case ALPHANUM_CHAR:
+ if (! Character.isLetterOrDigit(valueChar))
+ throw new ParseException("Letter or number expected", i);
+ result.append(valueChar);
+ i++;
+ break;
case LETTER_CHAR:
+ if (! Character.isLetter(valueChar))
+ throw new ParseException("Letter expected", i);
+ result.append(valueChar);
+ i++;
+ break;
case HEX_CHAR:
+ if (hexString.indexOf(valueChar) == -1 && ! isPlaceHolder)
+ throw new ParseException("Hexadecimal character expected", i);
+ result.append(valueChar);
+ i++;
+ break;
case ANYTHING_CHAR:
- result.append(value.charAt(i));
+ result.append(valueChar);
+ i++;
+ break;
+ case ESCAPE_CHAR:
+ // Escape character, check the next character to make sure that
+ // the literals match
+ j++;
+ if (j < length)
+ {
+ maskChar = mask.charAt(j);
+ if (! isPlaceHolder && getValueContainsLiteralCharacters()
+ && valueChar != maskChar)
+ throw new ParseException ("Invalid character: "+ valueChar, i);
+ if (getValueContainsLiteralCharacters())
+ {
+ result.append(maskChar);
+ }
+ i++;
+ }
+ else if (! isPlaceHolder)
+ throw new ParseException("Bad match at trailing escape: ", i);
break;
default:
+ if (! isPlaceHolder && getValueContainsLiteralCharacters()
+ && valueChar != maskChar)
+ throw new ParseException ("Invalid character: "+ valueChar, i);
+ if (getValueContainsLiteralCharacters())
+ {
+ result.append(maskChar);
+ }
+ i++;
}
}
return result.toString();
}
-
+
/**
* Returns a String representation of the Object value based on the mask.
*
@@ -368,21 +430,10 @@ public class MaskFormatter extends DefaultFormatter
* @throws ParseException if value is invalid for this mask and valid/invalid
* character sets
*/
- public String valueToString (Object value) throws ParseException
+ public String valueToString(Object value) throws ParseException
{
- String result = super.valueToString(value);
- int rLength = result.length();
-
- // If value is longer than the mask, truncate it. Note we may need to
- // account for symbols that are more than one character long.
- if (rLength > maskLength)
- result = result.substring(0, maskLength);
-
- // Verify the validity and convert to upper/lowercase as needed.
- result = convertValue(result, true);
- if (rLength < maskLength)
- return pad(result, rLength);
- return result;
+ String string = value != null ? value.toString() : "";
+ return convertValueToString(string);
}
/**
@@ -390,194 +441,116 @@ public class MaskFormatter extends DefaultFormatter
* sure that it is valid. If <code>convert</code> is true, it also
* converts letters to upper/lowercase as required by the mask.
* @param value the String to convert
- * @param convert true if we should convert letters to upper/lowercase
* @return the converted String
* @throws ParseException if the given String isn't valid for the mask
*/
- String convertValue(String value, boolean convert) throws ParseException
+ private String convertValueToString(String value)
+ throws ParseException
{
- StringBuffer result = new StringBuffer(value);
- char markChar;
- char resultChar;
- boolean literal;
-
- // this boolean is specifically to avoid calling the isCharValid method
- // when neither invalidChars or validChars has been set
- boolean checkCharSets = (invalidChars != null || validChars != null);
+ StringBuffer result = new StringBuffer();
+ char valueChar;
+ boolean isPlaceHolder;
- for (int i = 0, j = 0; i < value.length(); i++, j++)
+ int length = mask.length();
+ for (int i = 0, j = 0; j < length; j++)
{
- literal = false;
- resultChar = result.charAt(i);
+ char maskChar = mask.charAt(j);
+ if (i < value.length())
+ {
+ isPlaceHolder = false;
+ valueChar = value.charAt(i);
+ if (maskChar != ESCAPE_CHAR && valueChar != maskChar)
+ {
+ if (invalidChars != null
+ && invalidChars.indexOf(valueChar) != -1)
+ throw new ParseException("Invalid character: " + valueChar,
+ i);
+ if (validChars != null && validChars.indexOf(valueChar) == -1)
+ throw new ParseException("Invalid character: " + valueChar +" maskChar: " + maskChar,
+ i);
+ }
+ }
+ else if (placeHolder != null && i < placeHolder.length())
+ {
+ isPlaceHolder = true;
+ valueChar = placeHolder.charAt(i);
+ }
+ else
+ {
+ isPlaceHolder = true;
+ valueChar = placeHolderChar;
+ }
+
// This switch block on the mask character checks that the character
// within <code>value</code> at that point is valid according to the
// mask and also converts to upper/lowercase as needed.
- switch (mask.charAt(j))
+ switch (maskChar)
{
case NUM_CHAR:
- if (!Character.isDigit(resultChar))
- throw new ParseException("Number expected", i);
+ if ( ! isPlaceHolder && ! Character.isDigit(valueChar))
+ throw new ParseException("Number expected: " + valueChar, i);
+ result.append(valueChar);
+ i++;
break;
case UPPERCASE_CHAR:
- if (!Character.isLetter(resultChar))
+ if (! Character.isLetter(valueChar))
throw new ParseException("Letter expected", i);
- if (convert)
- result.setCharAt(i, Character.toUpperCase(resultChar));
+ result.append(Character.toUpperCase(valueChar));
+ i++;
break;
case LOWERCASE_CHAR:
- if (!Character.isLetter(resultChar))
+ if (! Character.isLetter(valueChar))
throw new ParseException("Letter expected", i);
- if (convert)
- result.setCharAt(i, Character.toLowerCase(resultChar));
+ result.append(Character.toLowerCase(valueChar));
+ i++;
break;
case ALPHANUM_CHAR:
- if (!Character.isLetterOrDigit(resultChar))
+ if (! Character.isLetterOrDigit(valueChar))
throw new ParseException("Letter or number expected", i);
+ result.append(valueChar);
+ i++;
break;
case LETTER_CHAR:
- if (!Character.isLetter(resultChar))
+ if (! Character.isLetter(valueChar))
throw new ParseException("Letter expected", i);
+ result.append(valueChar);
+ i++;
break;
case HEX_CHAR:
- if (hexString.indexOf(resultChar) == -1)
+ if (hexString.indexOf(valueChar) == -1 && ! isPlaceHolder)
throw new ParseException("Hexadecimal character expected", i);
+ result.append(valueChar);
+ i++;
break;
case ANYTHING_CHAR:
+ result.append(valueChar);
+ i++;
break;
case ESCAPE_CHAR:
// Escape character, check the next character to make sure that
// the literals match
j++;
- literal = true;
- if (resultChar != mask.charAt(j))
- throw new ParseException ("Invalid character: "+resultChar, i);
+ if (j < length)
+ {
+ maskChar = mask.charAt(j);
+ if (! isPlaceHolder && getValueContainsLiteralCharacters()
+ && valueChar != maskChar)
+ throw new ParseException ("Invalid character: "+ valueChar, i);
+ if (getValueContainsLiteralCharacters())
+ i++;
+ result.append(maskChar);
+ }
break;
default:
- literal = true;
- if (!getValueContainsLiteralCharacters() && convert)
- throw new ParseException ("Invalid character: "+resultChar, i);
- else if (resultChar != mask.charAt(j))
- throw new ParseException ("Invalid character: "+resultChar, i);
+ if (! isPlaceHolder && getValueContainsLiteralCharacters()
+ && valueChar != maskChar)
+ throw new ParseException ("Invalid character: "+ valueChar, i);
+ if (getValueContainsLiteralCharacters())
+ i++;
+ result.append(maskChar);
}
- // If necessary, check if the character is valid.
- if (!literal && checkCharSets && !isCharValid(resultChar))
- throw new ParseException("invalid character: "+resultChar, i);
-
- }
- return result.toString();
- }
-
- /**
- * Convenience method used by many other methods to check if a character is
- * valid according to the mask, the validChars, and the invalidChars. To
- * be valid a character must:
- * 1. be allowed by the mask
- * 2. be present in any non-null validChars String
- * 3. not be present in any non-null invalidChars String
- * @param testChar the character to test
- * @return true if the character is valid
- */
- boolean isCharValid(char testChar)
- {
- char lower = Character.toLowerCase(testChar);
- char upper = Character.toUpperCase(testChar);
- // If validChars isn't null, the character must appear in it.
- if (validChars != null)
- if (validChars.indexOf(lower) == -1 && validChars.indexOf(upper) == -1)
- return false;
- // If invalidChars isn't null, the character must not appear in it.
- if (invalidChars != null)
- if (invalidChars.indexOf(lower) != -1
- || invalidChars.indexOf(upper) != -1)
- return false;
- return true;
- }
-
- /**
- * Pads the value with literals, the placeholder String and/or placeholder
- * character as appropriate.
- * @param value the value to pad
- * @param currLength the current length of the value
- * @return the padded String
- */
- String pad (String value, int currLength)
- {
- StringBuffer result = new StringBuffer(value);
- int index = currLength;
- while (result.length() < maskLength)
- {
- // The character used to pad may be a literal, a character from the
- // place holder string, or the place holder character. getPadCharAt
- // will find the proper one for us.
- result.append (getPadCharAt(index));
- index++;
}
return result.toString();
}
- /**
- * Returns the character with which to pad the value at the given index
- * position. If the mask has a literal at this position, this is returned
- * otherwise if the place holder string is initialized and is longer than
- * <code>i</code> characters then the character at position <code>i</code>
- * from this String is returned. Else, the place holder character is
- * returned.
- * @param i the index at which we want to pad the value
- * @return the character with which we should pad the value
- */
- char getPadCharAt(int i)
- {
- boolean escaped = false;
- int target = i;
- char maskChar;
- int holderLength = placeHolder == null ? -1 : placeHolder.length();
- // We must iterate through the mask from the beginning, because the given
- // index doesn't account for escaped characters. For example, with the
- // mask "1A'A''A1" index 2 refers to the literalized A, not to the
- // single quotation.
- for (int n = 0; n < mask.length(); n++)
- {
- maskChar = mask.charAt(n);
- if (maskChar == ESCAPE_CHAR && !escaped)
- {
- target++;
- escaped = true;
- }
- else if (escaped == true)
- {
- // Check if target == n which means we've come to the character
- // we want to return and since it is a literal (because escaped
- // is true), we return it.
- if (target == n)
- return maskChar;
- escaped = false;
- }
- if (target == n)
- {
- // We've come to the character we want to return. It wasn't
- // escaped so if it isn't a literal we should return either
- // the character from place holder string or the place holder
- // character, depending on whether or not the place holder
- // string is long enough.
- switch (maskChar)
- {
- case NUM_CHAR:
- case UPPERCASE_CHAR:
- case LOWERCASE_CHAR:
- case ALPHANUM_CHAR:
- case LETTER_CHAR:
- case HEX_CHAR:
- case ANYTHING_CHAR:
- if (holderLength > i)
- return placeHolder.charAt(i);
- else
- return placeHolderChar;
- default:
- return maskChar;
- }
- }
- }
- // This shouldn't happen
- throw new AssertionError("MaskFormatter.getMaskCharAt failed");
- }
}
diff --git a/libjava/classpath/javax/swing/text/MutableAttributeSet.java b/libjava/classpath/javax/swing/text/MutableAttributeSet.java
index 3728b9ce126..5dd2406a3a9 100644
--- a/libjava/classpath/javax/swing/text/MutableAttributeSet.java
+++ b/libjava/classpath/javax/swing/text/MutableAttributeSet.java
@@ -90,7 +90,7 @@ public interface MutableAttributeSet extends AttributeSet
* @throws NullPointerException if <code>names</code> is <code>null</code>
* or contains any <code>null</code> values.
*/
- void removeAttributes(Enumeration names);
+ void removeAttributes(Enumeration<?> names);
/**
* Removes attributes from this set if they are found in the
diff --git a/libjava/classpath/javax/swing/text/ParagraphView.java b/libjava/classpath/javax/swing/text/ParagraphView.java
index c4857863d35..fb4ac65d835 100644
--- a/libjava/classpath/javax/swing/text/ParagraphView.java
+++ b/libjava/classpath/javax/swing/text/ParagraphView.java
@@ -38,8 +38,12 @@ exception statement from your version. */
package javax.swing.text;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Rectangle;
import java.awt.Shape;
+import javax.swing.SizeRequirements;
import javax.swing.event.DocumentEvent;
/**
@@ -64,30 +68,45 @@ public class ParagraphView extends FlowView implements TabExpander
super(el, X_AXIS);
}
+ /**
+ * Overridden to adjust when we are the first line, and firstLineIndent
+ * is not 0.
+ */
+ public short getLeftInset()
+ {
+ short leftInset = super.getLeftInset();
+ View parent = getParent();
+ if (parent != null)
+ {
+ if (parent.getView(0) == this)
+ leftInset += firstLineIndent;
+ }
+ return leftInset;
+ }
+
public float getAlignment(int axis)
{
float align;
if (axis == X_AXIS)
- align = 0.0F; // TODO: Implement according to justification
+ switch (justification)
+ {
+ case StyleConstants.ALIGN_RIGHT:
+ align = 1.0F;
+ break;
+ case StyleConstants.ALIGN_CENTER:
+ case StyleConstants.ALIGN_JUSTIFIED:
+ align = 0.5F;
+ break;
+ case StyleConstants.ALIGN_LEFT:
+ default:
+ align = 0.0F;
+ }
else
align = super.getAlignment(axis);
return align;
}
/**
- * Allows rows to span the whole parent view.
- */
- public float getMaximumSpan(int axis)
- {
- float max;
- if (axis == X_AXIS)
- max = Float.MAX_VALUE;
- else
- max = super.getMaximumSpan(axis);
- return max;
- }
-
- /**
* Overridden because child views are not necessarily laid out in model
* order.
*/
@@ -107,10 +126,63 @@ public class ParagraphView extends FlowView implements TabExpander
return index;
}
+
+ /**
+ * Overridden to perform a baseline layout. The normal BoxView layout
+ * isn't completely suitable for rows.
+ */
+ protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets,
+ int[] spans)
+ {
+ baselineLayout(targetSpan, axis, offsets, spans);
+ }
+
+ /**
+ * Overridden to perform a baseline layout. The normal BoxView layout
+ * isn't completely suitable for rows.
+ */
+ protected SizeRequirements calculateMinorAxisRequirements(int axis,
+ SizeRequirements r)
+ {
+ return baselineRequirements(axis, r);
+ }
+
protected void loadChildren(ViewFactory vf)
{
// Do nothing here. The children are added while layouting.
}
+
+ /**
+ * Overridden to determine the minimum start offset of the row's children.
+ */
+ public int getStartOffset()
+ {
+ // Determine minimum start offset of the children.
+ int offset = Integer.MAX_VALUE;
+ int n = getViewCount();
+ for (int i = 0; i < n; i++)
+ {
+ View v = getView(i);
+ offset = Math.min(offset, v.getStartOffset());
+ }
+ return offset;
+ }
+
+ /**
+ * Overridden to determine the maximum end offset of the row's children.
+ */
+ public int getEndOffset()
+ {
+ // Determine minimum start offset of the children.
+ int offset = 0;
+ int n = getViewCount();
+ for (int i = 0; i < n; i++)
+ {
+ View v = getView(i);
+ offset = Math.max(offset, v.getEndOffset());
+ }
+ return offset;
+ }
}
/**
@@ -192,11 +264,14 @@ public class ParagraphView extends FlowView implements TabExpander
*
* @param ev the document event
* @param a the allocation of this view
- * @param fv the view factory to use for creating new child views
+ * @param vf the view factory to use for creating new child views
*/
- public void changedUpdate(DocumentEvent ev, Shape a, ViewFactory fv)
+ public void changedUpdate(DocumentEvent ev, Shape a, ViewFactory vf)
{
setPropertiesFromAttributes();
+ layoutChanged(X_AXIS);
+ layoutChanged(Y_AXIS);
+ super.changedUpdate(ev, a, vf);
}
/**
diff --git a/libjava/classpath/javax/swing/text/PlainView.java b/libjava/classpath/javax/swing/text/PlainView.java
index 48fe37ce880..e048d5f7168 100644
--- a/libjava/classpath/javax/swing/text/PlainView.java
+++ b/libjava/classpath/javax/swing/text/PlainView.java
@@ -87,6 +87,16 @@ public class PlainView extends View implements TabExpander
*/
private transient Segment lineBuffer;
+ /**
+ * The base offset for tab calculations.
+ */
+ private int tabBase;
+
+ /**
+ * The tab size.
+ */
+ private int tabSize;
+
public PlainView(Element elem)
{
super(elem);
@@ -104,6 +114,7 @@ public class PlainView extends View implements TabExpander
{
this.font = font;
metrics = component.getFontMetrics(font);
+ tabSize = getTabSize() * metrics.charWidth('m');
}
}
@@ -115,7 +126,7 @@ public class PlainView extends View implements TabExpander
// Ensure metrics are up-to-date.
updateMetrics();
- Rectangle rect = a.getBounds();
+ Rectangle rect = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
int fontHeight = metrics.getHeight();
return new Rectangle(rect.x, rect.y + (line * fontHeight),
rect.width, fontHeight);
@@ -132,13 +143,14 @@ public class PlainView extends View implements TabExpander
// Get rectangle of the line containing position.
int lineIndex = getElement().getElementIndex(position);
Rectangle rect = lineToRect(a, lineIndex);
+ tabBase = rect.x;
// Get the rectangle for position.
Element line = getElement().getElement(lineIndex);
int lineStart = line.getStartOffset();
Segment segment = getLineBuffer();
document.getText(lineStart, position - lineStart, segment);
- int xoffset = Utilities.getTabbedTextWidth(segment, metrics, rect.x,
+ int xoffset = Utilities.getTabbedTextWidth(segment, metrics, tabBase,
this, lineStart);
// Calc the real rectangle.
@@ -262,17 +274,47 @@ public class PlainView extends View implements TabExpander
selectionStart = textComponent.getSelectionStart();
selectionEnd = textComponent.getSelectionEnd();
- Rectangle rect = s.getBounds();
+ Rectangle rect = s instanceof Rectangle ? (Rectangle) s : s.getBounds();
+ tabBase = rect.x;
// FIXME: Text may be scrolled.
Document document = textComponent.getDocument();
- Element root = document.getDefaultRootElement();
- int y = rect.y + metrics.getAscent();
+ Element root = getElement();
int height = metrics.getHeight();
-
+
+ // For layered highlighters we need to paint the layered highlights
+ // before painting any text.
+ LayeredHighlighter hl = null;
+ Highlighter h = textComponent.getHighlighter();
+ if (h instanceof LayeredHighlighter)
+ hl = (LayeredHighlighter) h;
+
int count = root.getElementCount();
- for (int i = 0; i < count; i++)
+
+ // Determine first and last line inside the clip.
+ Rectangle clip = g.getClipBounds();
+ SwingUtilities.computeIntersection(rect.x, rect.y, rect.width, rect.height,
+ clip);
+ int line0 = (clip.y - rect.y) / height;
+ line0 = Math.max(0, Math.min(line0, count - 1));
+ int line1 = (clip.y + clip.height - rect.y) / height;
+ line1 = Math.max(0, Math.min(line1, count - 1));
+ int y = rect.y + metrics.getAscent() + height * line0;
+ for (int i = line0; i <= line1; i++)
{
+ if (hl != null)
+ {
+ Element lineEl = root.getElement(i);
+ // Exclude the trailing newline from beeing highlighted.
+ if (i == count)
+ hl.paintLayeredHighlights(g, lineEl.getStartOffset(),
+ lineEl.getEndOffset(), s, textComponent,
+ this);
+ else
+ hl.paintLayeredHighlights(g, lineEl.getStartOffset(),
+ lineEl.getEndOffset() - 1, s,
+ textComponent, this);
+ }
drawLine(i, g, rect.x, y);
y += height;
}
@@ -303,8 +345,13 @@ public class PlainView extends View implements TabExpander
*/
public float nextTabStop(float x, int tabStop)
{
- float tabSizePixels = getTabSize() * metrics.charWidth('m');
- return (float) (Math.floor(x / tabSizePixels) + 1) * tabSizePixels;
+ float next = x;
+ if (tabSize != 0)
+ {
+ int numTabs = (((int) x) - tabBase) / tabSize;
+ next = tabBase + (numTabs + 1) * tabSize;
+ }
+ return next;
}
/**
@@ -390,41 +437,58 @@ public class PlainView extends View implements TabExpander
*/
public int viewToModel(float x, float y, Shape a, Position.Bias[] b)
{
- Rectangle rec = a.getBounds();
- Document doc = getDocument();
- Element root = doc.getDefaultRootElement();
-
- // PlainView doesn't support line-wrapping so we can find out which
- // Element was clicked on just by the y-position.
- // Since the coordinates may be outside of the coordinate space
- // of the allocation area (e.g. user dragged mouse outside
- // the component) we have to limit the values.
- // This has the nice effect that the user can drag the
- // mouse above or below the component and it will still
- // react to the x values (e.g. when selecting).
- int lineClicked
- = Math.min(Math.max((int) (y - rec.y) / metrics.getHeight(), 0),
- root.getElementCount() - 1);
-
- Element line = root.getElement(lineClicked);
-
- Segment s = getLineBuffer();
- int start = line.getStartOffset();
- // We don't want the \n at the end of the line.
- int end = line.getEndOffset() - 1;
- try
- {
- doc.getText(start, end - start, s);
- }
- catch (BadLocationException ble)
+ Rectangle rec = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
+ tabBase = rec.x;
+
+ int pos;
+ if ((int) y < rec.y)
+ // Above our area vertically. Return start offset.
+ pos = getStartOffset();
+ else if ((int) y > rec.y + rec.height)
+ // Below our area vertically. Return end offset.
+ pos = getEndOffset() - 1;
+ else
{
- AssertionError ae = new AssertionError("Unexpected bad location");
- ae.initCause(ble);
- throw ae;
+ // Inside the allocation vertically. Determine line and X offset.
+ Document doc = getDocument();
+ Element root = doc.getDefaultRootElement();
+ int line = Math.abs(((int) y - rec.y) / metrics.getHeight());
+ if (line >= root.getElementCount())
+ pos = getEndOffset() - 1;
+ else
+ {
+ Element lineEl = root.getElement(line);
+ if (x < rec.x)
+ // To the left of the allocation area.
+ pos = lineEl.getStartOffset();
+ else if (x > rec.x + rec.width)
+ // To the right of the allocation area.
+ pos = lineEl.getEndOffset() - 1;
+ else
+ {
+ try
+ {
+ int p0 = lineEl.getStartOffset();
+ int p1 = lineEl.getEndOffset();
+ Segment s = new Segment();
+ doc.getText(p0, p1 - p0, s);
+ tabBase = rec.x;
+ pos = p0 + Utilities.getTabbedTextOffset(s, metrics,
+ tabBase, (int) x,
+ this, p0);
+ }
+ catch (BadLocationException ex)
+ {
+ // Should not happen.
+ pos = -1;
+ }
+ }
+
+ }
}
-
- int pos = Utilities.getTabbedTextOffset(s, metrics, rec.x, (int)x, this, start);
- return Math.max (0, pos);
+ // Bias is always forward.
+ b[0] = Position.Bias.Forward;
+ return pos;
}
/**
@@ -654,7 +718,7 @@ public class PlainView extends View implements TabExpander
throw err;
}
- return Utilities.getTabbedTextWidth(buffer, metrics, 0, this,
+ return Utilities.getTabbedTextWidth(buffer, metrics, tabBase, this,
lineEl.getStartOffset());
}
}
diff --git a/libjava/classpath/javax/swing/text/Position.java b/libjava/classpath/javax/swing/text/Position.java
index bb1449e187a..d02eb834dd9 100644
--- a/libjava/classpath/javax/swing/text/Position.java
+++ b/libjava/classpath/javax/swing/text/Position.java
@@ -42,8 +42,8 @@ public interface Position
{
static final class Bias
{
- public static final Bias Backward = new Bias("backward");
- public static final Bias Forward = new Bias("forward");
+ public static final Bias Backward = new Bias("Backward");
+ public static final Bias Forward = new Bias("Forward");
private String name;
diff --git a/libjava/classpath/javax/swing/text/SimpleAttributeSet.java b/libjava/classpath/javax/swing/text/SimpleAttributeSet.java
index 8684ef87d34..701fa8a7c90 100644
--- a/libjava/classpath/javax/swing/text/SimpleAttributeSet.java
+++ b/libjava/classpath/javax/swing/text/SimpleAttributeSet.java
@@ -123,9 +123,17 @@ public class SimpleAttributeSet
*/
public Object clone()
{
- SimpleAttributeSet s = new SimpleAttributeSet();
- s.tab = (Hashtable) tab.clone();
- return s;
+ SimpleAttributeSet attr = null;
+ try
+ {
+ attr = (SimpleAttributeSet) super.clone();
+ attr.tab = (Hashtable) tab.clone();
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ assert false;
+ }
+ return attr;
}
/**
@@ -253,7 +261,7 @@ public class SimpleAttributeSet
*
* @return An enumeration of the attribute names.
*/
- public Enumeration getAttributeNames()
+ public Enumeration<?> getAttributeNames()
{
return tab.keys();
}
@@ -367,7 +375,7 @@ public class SimpleAttributeSet
* @throws NullPointerException if <code>names</code> is <code>null</code>
* or contains any <code>null</code> values.
*/
- public void removeAttributes(Enumeration names)
+ public void removeAttributes(Enumeration<?> names)
{
while (names.hasMoreElements())
{
diff --git a/libjava/classpath/javax/swing/text/StringContent.java b/libjava/classpath/javax/swing/text/StringContent.java
index 8014dc3bce6..4a3f9d75222 100644
--- a/libjava/classpath/javax/swing/text/StringContent.java
+++ b/libjava/classpath/javax/swing/text/StringContent.java
@@ -39,6 +39,9 @@ exception statement from your version. */
package javax.swing.text;
import java.io.Serializable;
+import java.lang.ref.Reference;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.WeakReference;
import java.util.Iterator;
import java.util.Vector;
@@ -57,6 +60,76 @@ import javax.swing.undo.UndoableEdit;
public final class StringContent
implements AbstractDocument.Content, Serializable
{
+ /**
+ * Stores a reference to a mark that can be resetted to the original value
+ * after a mark has been moved. This is used for undoing actions.
+ */
+ private class UndoPosRef
+ {
+ /**
+ * The mark that might need to be reset.
+ */
+ private Mark mark;
+
+ /**
+ * The original offset to reset the mark to.
+ */
+ private int undoOffset;
+
+ /**
+ * Creates a new UndoPosRef.
+ *
+ * @param m the mark
+ */
+ UndoPosRef(Mark m)
+ {
+ mark = m;
+ undoOffset = mark.mark;
+ }
+
+ /**
+ * Resets the position of the mark to the value that it had when
+ * creating this UndoPosRef.
+ */
+ void reset()
+ {
+ mark.mark = undoOffset;
+ }
+ }
+
+ /**
+ * Holds a mark into the buffer that is used by StickyPosition to find
+ * the actual offset of the position. This is pulled out of the
+ * GapContentPosition object so that the mark and position can be handled
+ * independently, and most important, so that the StickyPosition can
+ * be garbage collected while we still hold a reference to the Mark object.
+ */
+ private class Mark
+ {
+ /**
+ * The actual mark into the buffer.
+ */
+ int mark;
+
+
+ /**
+ * The number of GapContentPosition object that reference this mark. If
+ * it reaches zero, it get's deleted by
+ * {@link StringContent#garbageCollect()}.
+ */
+ int refCount;
+
+ /**
+ * Creates a new Mark object for the specified offset.
+ *
+ * @param offset the offset
+ */
+ Mark(int offset)
+ {
+ mark = offset;
+ }
+ }
+
/** The serialization UID (compatible with JDK1.5). */
private static final long serialVersionUID = 4755994433709540381L;
@@ -65,7 +138,12 @@ public final class StringContent
private int count;
- private Vector positions = new Vector();
+ /**
+ * Holds the marks for the positions.
+ *
+ * This is package private to avoid accessor methods.
+ */
+ Vector marks;
private class InsertUndo extends AbstractUndoableEdit
{
@@ -75,6 +153,8 @@ public final class StringContent
private String redoContent;
+ private Vector positions;
+
public InsertUndo(int start, int length)
{
super();
@@ -87,10 +167,10 @@ public final class StringContent
super.undo();
try
{
- StringContent.this.checkLocation(this.start, this.length);
- this.redoContent = new String(StringContent.this.content, this.start,
- this.length);
- StringContent.this.remove(this.start, this.length);
+ if (marks != null)
+ positions = getPositionsInRange(null, start, length);
+ redoContent = getString(start, length);
+ remove(start, length);
}
catch (BadLocationException b)
{
@@ -103,7 +183,13 @@ public final class StringContent
super.redo();
try
{
- StringContent.this.insertString(this.start, this.redoContent);
+ insertString(start, redoContent);
+ redoContent = null;
+ if (positions != null)
+ {
+ updateUndoPositions(positions);
+ positions = null;
+ }
}
catch (BadLocationException b)
{
@@ -115,14 +201,19 @@ public final class StringContent
private class RemoveUndo extends AbstractUndoableEdit
{
private int start;
-
+ private int len;
private String undoString;
+ Vector positions;
+
public RemoveUndo(int start, String str)
{
super();
this.start = start;
+ len = str.length();
this.undoString = str;
+ if (marks != null)
+ positions = getPositionsInRange(null, start, str.length());
}
public void undo()
@@ -131,6 +222,12 @@ public final class StringContent
try
{
StringContent.this.insertString(this.start, this.undoString);
+ if (positions != null)
+ {
+ updateUndoPositions(positions);
+ positions = null;
+ }
+ undoString = null;
}
catch (BadLocationException bad)
{
@@ -143,8 +240,10 @@ public final class StringContent
super.redo();
try
{
- int end = this.undoString.length();
- StringContent.this.remove(this.start, end);
+ undoString = getString(start, len);
+ if (marks != null)
+ positions = getPositionsInRange(null, start, len);
+ remove(this.start, len);
}
catch (BadLocationException bad)
{
@@ -155,17 +254,18 @@ public final class StringContent
private class StickyPosition implements Position
{
- private int offset = -1;
+ Mark mark;
public StickyPosition(int offset)
{
- this.offset = offset;
- }
+ // Try to make space.
+ garbageCollect();
- // This is package-private to avoid an accessor method.
- void setOffset(int offset)
- {
- this.offset = this.offset >= 0 ? offset : -1;
+ mark = new Mark(offset);
+ mark.refCount++;
+ marks.add(mark);
+
+ new WeakReference(this, queueOfDeath);
}
/**
@@ -173,11 +273,25 @@ public final class StringContent
*/
public int getOffset()
{
- return offset < 0 ? 0 : offset;
+ return mark.mark;
}
}
/**
+ * Used in {@link #remove(int,int)}.
+ */
+ private static final char[] EMPTY = new char[0];
+
+ /**
+ * Queues all references to GapContentPositions that are about to be
+ * GC'ed. This is used to remove the corresponding marks from the
+ * positionMarks array if the number of references to that mark reaches zero.
+ *
+ * This is package private to avoid accessor synthetic methods.
+ */
+ ReferenceQueue queueOfDeath;
+
+ /**
* Creates a new instance containing the string "\n". This is equivalent
* to calling {@link #StringContent(int)} with an <code>initialLength</code>
* of 10.
@@ -196,6 +310,7 @@ public final class StringContent
public StringContent(int initialLength)
{
super();
+ queueOfDeath = new ReferenceQueue();
if (initialLength < 1)
initialLength = 1;
this.content = new char[initialLength];
@@ -207,14 +322,13 @@ public final class StringContent
int offset,
int length)
{
- Vector refPos = new Vector();
- Iterator iter = this.positions.iterator();
+ Vector refPos = v == null ? new Vector() : v;
+ Iterator iter = marks.iterator();
while(iter.hasNext())
{
- Position p = (Position) iter.next();
- if ((offset <= p.getOffset())
- && (p.getOffset() <= (offset + length)))
- refPos.add(p);
+ Mark m = (Mark) iter.next();
+ if (offset <= m.mark && m.mark <= offset + length)
+ refPos.add(new UndoPosRef(m));
}
return refPos;
}
@@ -231,10 +345,10 @@ public final class StringContent
*/
public Position createPosition(int offset) throws BadLocationException
{
- if (offset < this.count || offset > this.count)
- checkLocation(offset, 0);
+ // Lazily create marks vector.
+ if (marks == null)
+ marks = new Vector();
StickyPosition sp = new StickyPosition(offset);
- this.positions.add(sp);
return sp;
}
@@ -246,7 +360,7 @@ public final class StringContent
*/
public int length()
{
- return this.count;
+ return count;
}
/**
@@ -268,27 +382,23 @@ public final class StringContent
if (str == null)
throw new NullPointerException();
char[] insert = str.toCharArray();
- char[] temp = new char[this.content.length + insert.length];
- this.count += insert.length;
- // Copy array and insert the string.
- if (where > 0)
- System.arraycopy(this.content, 0, temp, 0, where);
- System.arraycopy(insert, 0, temp, where, insert.length);
- System.arraycopy(this.content, where, temp, (where + insert.length),
- (temp.length - where - insert.length));
- if (this.content.length < temp.length)
- this.content = new char[temp.length];
- // Copy the result in the original char array.
- System.arraycopy(temp, 0, this.content, 0, temp.length);
+ replace(where, 0, insert);
+
// Move all the positions.
- Vector refPos = getPositionsInRange(this.positions, where,
- temp.length - where);
- Iterator iter = refPos.iterator();
- while (iter.hasNext())
+ if (marks != null)
{
- StickyPosition p = (StickyPosition)iter.next();
- p.setOffset(p.getOffset() + str.length());
+ Iterator iter = marks.iterator();
+ int start = where;
+ if (start == 0)
+ start = 1;
+ while (iter.hasNext())
+ {
+ Mark m = (Mark) iter.next();
+ if (m.mark >= start)
+ m.mark += str.length();
+ }
}
+
InsertUndo iundo = new InsertUndo(where, insert.length);
return iundo;
}
@@ -308,32 +418,51 @@ public final class StringContent
public UndoableEdit remove(int where, int nitems) throws BadLocationException
{
checkLocation(where, nitems + 1);
- char[] temp = new char[(this.content.length - nitems)];
- this.count = this.count - nitems;
RemoveUndo rundo = new RemoveUndo(where, new String(this.content, where,
nitems));
- // Copy array.
- System.arraycopy(this.content, 0, temp, 0, where);
- System.arraycopy(this.content, where + nitems, temp, where,
- this.content.length - where - nitems);
- this.content = new char[temp.length];
- // Then copy the result in the original char array.
- System.arraycopy(temp, 0, this.content, 0, this.content.length);
+
+ replace(where, nitems, EMPTY);
// Move all the positions.
- Vector refPos = getPositionsInRange(this.positions, where,
- this.content.length + nitems - where);
- Iterator iter = refPos.iterator();
- while (iter.hasNext())
+ if (marks != null)
{
- StickyPosition p = (StickyPosition)iter.next();
- int result = p.getOffset() - nitems;
- p.setOffset(result);
- if (result < 0)
- this.positions.remove(p);
+ Iterator iter = marks.iterator();
+ while (iter.hasNext())
+ {
+ Mark m = (Mark) iter.next();
+ if (m.mark >= where + nitems)
+ m.mark -= nitems;
+ else if (m.mark >= where)
+ m.mark = where;
+ }
}
return rundo;
}
-
+
+ private void replace(int offs, int numRemove, char[] insert)
+ {
+ int insertLength = insert.length;
+ int delta = insertLength - numRemove;
+ int src = offs + numRemove;
+ int numMove = count - src;
+ int dest = src + delta;
+ if (count + delta >= content.length)
+ {
+ // Grow data array.
+ int newLength = Math.max(2 * content.length, count + delta);
+ char[] newContent = new char[newLength];
+ System.arraycopy(content, 0, newContent, 0, offs);
+ System.arraycopy(insert, 0, newContent, offs, insertLength);
+ System.arraycopy(content, src, newContent, dest, numMove);
+ content = newContent;
+ }
+ else
+ {
+ System.arraycopy(content, src, content, dest, numMove);
+ System.arraycopy(insert, 0, content, offs, insertLength);
+ }
+ count += delta;
+ }
+
/**
* Returns a new <code>String</code> containing the characters in the
* specified range.
@@ -348,6 +477,8 @@ public final class StringContent
*/
public String getString(int where, int len) throws BadLocationException
{
+ // The RI throws a StringIndexOutOfBoundsException here, which
+ // smells like a bug. We throw a BadLocationException instead.
checkLocation(where, len);
return new String(this.content, where, len);
}
@@ -368,22 +499,28 @@ public final class StringContent
public void getChars(int where, int len, Segment txt)
throws BadLocationException
{
- checkLocation(where, len);
- txt.array = this.content;
+ if (where + len > count)
+ throw new BadLocationException("Invalid location", where + len);
+ txt.array = content;
txt.offset = where;
txt.count = len;
}
/**
- * @specnote This method is not very well specified and the positions vector
- * is implementation specific. The undo positions are managed
- * differently in this implementation, this method is only here
- * for binary compatibility.
+ * Resets the positions in the specified vector to their original offset
+ * after a undo operation is performed. For example, after removing some
+ * content, the positions in the removed range will all be set to one
+ * offset. This method restores the positions to their original offsets
+ * after an undo.
*/
protected void updateUndoPositions(Vector positions)
{
- // We do nothing here.
+ for (Iterator i = positions.iterator(); i.hasNext();)
+ {
+ UndoPosRef pos = (UndoPosRef) i.next();
+ pos.reset();
+ }
}
/**
@@ -405,6 +542,29 @@ public final class StringContent
else if ((where + len) > this.count)
throw new BadLocationException("Invalid range", this.count);
}
-
+
+ /**
+ * Polls the queue of death for GapContentPositions, updates the
+ * corresponding reference count and removes the corresponding mark
+ * if the refcount reaches zero.
+ *
+ * This is package private to avoid accessor synthetic methods.
+ */
+ void garbageCollect()
+ {
+ Reference ref = queueOfDeath.poll();
+ while (ref != null)
+ {
+ if (ref != null)
+ {
+ StickyPosition pos = (StickyPosition) ref.get();
+ Mark m = pos.mark;
+ m.refCount--;
+ if (m.refCount == 0)
+ marks.remove(m);
+ }
+ ref = queueOfDeath.poll();
+ }
+ }
}
diff --git a/libjava/classpath/javax/swing/text/StyleConstants.java b/libjava/classpath/javax/swing/text/StyleConstants.java
index c7906b8ad32..4e5005c6bb2 100644
--- a/libjava/classpath/javax/swing/text/StyleConstants.java
+++ b/libjava/classpath/javax/swing/text/StyleConstants.java
@@ -40,6 +40,7 @@ package javax.swing.text;
import java.awt.Color;
import java.awt.Component;
+import java.util.ArrayList;
import javax.swing.Icon;
@@ -163,6 +164,12 @@ public class StyleConstants
public static final Object ResolveAttribute = new StyleConstants("resolver");
+ /**
+ * All StyleConstants keys. This is used in StyleContext to register
+ * all known keys as static attribute keys for serialization.
+ */
+ static ArrayList keys;
+
String keyname;
// Package-private to avoid accessor constructor for use by
@@ -170,6 +177,9 @@ public class StyleConstants
StyleConstants(String k)
{
keyname = k;
+ if (keys == null)
+ keys = new ArrayList();
+ keys.add(this);
}
/**
@@ -729,6 +739,7 @@ public class StyleConstants
*/
public static void setIcon(MutableAttributeSet a, Icon c)
{
+ a.addAttribute(AbstractDocument.ElementNameAttribute, IconElementName);
a.addAttribute(IconAttribute, c);
}
diff --git a/libjava/classpath/javax/swing/text/StyleContext.java b/libjava/classpath/javax/swing/text/StyleContext.java
index 63df3df6a91..4dded0d0402 100644
--- a/libjava/classpath/javax/swing/text/StyleContext.java
+++ b/libjava/classpath/javax/swing/text/StyleContext.java
@@ -43,19 +43,25 @@ import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Toolkit;
import java.io.IOException;
+import java.io.NotSerializableException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
+import java.lang.ref.WeakReference;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.EventListener;
import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.WeakHashMap;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList;
public class StyleContext
- implements Serializable, AbstractDocument.AttributeContext
+ implements Serializable, AbstractDocument.AttributeContext
{
/** The serialization UID (compatible with JDK1.5). */
private static final long serialVersionUID = 8042858831190784241L;
@@ -66,11 +72,10 @@ public class StyleContext
/** The serialization UID (compatible with JDK1.5). */
private static final long serialVersionUID = -6690628971806226374L;
- protected ChangeEvent changeEvent;
+ protected transient ChangeEvent changeEvent;
protected EventListenerList listenerList;
- AttributeSet attributes;
- String name;
+ private transient AttributeSet attributes;
public NamedStyle()
{
@@ -84,22 +89,26 @@ public class StyleContext
public NamedStyle(String name, Style parent)
{
- this.name = name;
- this.attributes = getEmptySet();
- this.changeEvent = new ChangeEvent(this);
- this.listenerList = new EventListenerList();
- setResolveParent(parent);
+ attributes = getEmptySet();
+ listenerList = new EventListenerList();
+ if (name != null)
+ setName(name);
+ if (parent != null)
+ setResolveParent(parent);
}
public String getName()
{
+ String name = null;
+ if (isDefined(StyleConstants.NameAttribute))
+ name = getAttribute(StyleConstants.NameAttribute).toString();
return name;
}
public void setName(String n)
{
- name = n;
- fireStateChanged();
+ if (n != null)
+ addAttribute(StyleConstants.NameAttribute, n);
}
public void addChangeListener(ChangeListener l)
@@ -112,7 +121,7 @@ public class StyleContext
listenerList.remove(ChangeListener.class, l);
}
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
return listenerList.getListeners(listenerType);
}
@@ -127,6 +136,9 @@ public class StyleContext
ChangeListener[] listeners = getChangeListeners();
for (int i = 0; i < listeners.length; ++i)
{
+ // Lazily create event.
+ if (changeEvent == null)
+ changeEvent = new ChangeEvent(this);
listeners[i].stateChanged(changeEvent);
}
}
@@ -155,7 +167,10 @@ public class StyleContext
public AttributeSet copyAttributes()
{
- return attributes.copyAttributes();
+ // The RI returns a NamedStyle as copy, so do we.
+ NamedStyle copy = new NamedStyle();
+ copy.attributes = attributes.copyAttributes();
+ return copy;
}
public Object getAttribute(Object attrName)
@@ -168,7 +183,7 @@ public class StyleContext
return attributes.getAttributeCount();
}
- public Enumeration getAttributeNames()
+ public Enumeration<?> getAttributeNames()
{
return attributes.getAttributeNames();
}
@@ -195,7 +210,7 @@ public class StyleContext
fireStateChanged();
}
- public void removeAttributes(Enumeration names)
+ public void removeAttributes(Enumeration<?> names)
{
attributes = StyleContext.this.removeAttributes(attributes, names);
fireStateChanged();
@@ -210,112 +225,125 @@ public class StyleContext
public void setResolveParent(AttributeSet parent)
{
if (parent != null)
- {
- attributes = StyleContext.this.addAttribute
- (attributes, ResolveAttribute, parent);
- }
- fireStateChanged();
+ addAttribute(StyleConstants.ResolveAttribute, parent);
+ else
+ removeAttribute(StyleConstants.ResolveAttribute);
}
public String toString()
{
- return ("[NamedStyle: name=" + name + ", attrs=" + attributes.toString() + "]");
- }
+ return "NamedStyle:" + getName() + " " + attributes;
+ }
+
+ private void writeObject(ObjectOutputStream s)
+ throws IOException
+ {
+ s.defaultWriteObject();
+ writeAttributeSet(s, attributes);
+ }
+
+ private void readObject(ObjectInputStream s)
+ throws ClassNotFoundException, IOException
+ {
+ s.defaultReadObject();
+ attributes = SimpleAttributeSet.EMPTY;
+ readAttributeSet(s, this);
+ }
}
public class SmallAttributeSet
implements AttributeSet
{
final Object [] attrs;
+ private AttributeSet resolveParent;
public SmallAttributeSet(AttributeSet a)
{
- if (a == null)
- attrs = new Object[0];
- else
+ int n = a.getAttributeCount();
+ int i = 0;
+ attrs = new Object[n * 2];
+ Enumeration e = a.getAttributeNames();
+ while (e.hasMoreElements())
{
- int n = a.getAttributeCount();
- int i = 0;
- attrs = new Object[n * 2];
- Enumeration e = a.getAttributeNames();
- while (e.hasMoreElements())
- {
- Object name = e.nextElement();
- attrs[i++] = name;
- attrs[i++] = a.getAttribute(name);
- }
+ Object name = e.nextElement();
+ Object value = a.getAttribute(name);
+ if (name == ResolveAttribute)
+ resolveParent = (AttributeSet) value;
+ attrs[i++] = name;
+ attrs[i++] = value;
}
}
public SmallAttributeSet(Object [] a)
{
- if (a == null)
- attrs = new Object[0];
- else
+ attrs = a;
+ for (int i = 0; i < attrs.length; i += 2)
{
- attrs = new Object[a.length];
- System.arraycopy(a, 0, attrs, 0, a.length);
+ if (attrs[i] == ResolveAttribute)
+ resolveParent = (AttributeSet) attrs[i + 1];
}
}
public Object clone()
{
- return new SmallAttributeSet(this.attrs);
+ return this;
}
public boolean containsAttribute(Object name, Object value)
{
- for (int i = 0; i < attrs.length; i += 2)
- {
- if (attrs[i].equals(name) &&
- attrs[i+1].equals(value))
- return true;
- }
- return false;
+ return value.equals(getAttribute(name));
}
public boolean containsAttributes(AttributeSet a)
{
+ boolean res = true;
Enumeration e = a.getAttributeNames();
- while (e.hasMoreElements())
+ while (e.hasMoreElements() && res)
{
Object name = e.nextElement();
- Object val = a.getAttribute(name);
- if (!containsAttribute(name, val))
- return false;
+ res = a.getAttribute(name).equals(getAttribute(name));
}
- return true;
+ return res;
}
public AttributeSet copyAttributes()
{
- return (AttributeSet) clone();
+ return this;
}
public boolean equals(Object obj)
{
- return
- (obj instanceof AttributeSet)
- && this.isEqual((AttributeSet)obj);
+ boolean eq = false;
+ if (obj instanceof AttributeSet)
+ {
+ AttributeSet atts = (AttributeSet) obj;
+ eq = getAttributeCount() == atts.getAttributeCount()
+ && containsAttributes(atts);
+ }
+ return eq;
}
public Object getAttribute(Object key)
{
- for (int i = 0; i < attrs.length; i += 2)
+ Object att = null;
+ if (key == StyleConstants.ResolveAttribute)
+ att = resolveParent;
+
+ for (int i = 0; i < attrs.length && att == null; i += 2)
{
if (attrs[i].equals(key))
- return attrs[i+1];
+ att = attrs[i + 1];
}
-
+
// Check the resolve parent, unless we're looking for the
- // ResolveAttribute, which would cause an infinite loop
- if (!(key.equals(ResolveAttribute)))
+ // ResolveAttribute, which must not be looked up
+ if (att == null)
{
- Object p = getResolveParent();
- if (p != null && p instanceof AttributeSet)
- return (((AttributeSet)p).getAttribute(key));
+ AttributeSet parent = getResolveParent();
+ if (parent != null)
+ att = parent.getAttribute(key);
}
- return null;
+ return att;
}
public int getAttributeCount()
@@ -323,7 +351,7 @@ public class StyleContext
return attrs.length / 2;
}
- public Enumeration getAttributeNames()
+ public Enumeration<?> getAttributeNames()
{
return new Enumeration()
{
@@ -342,7 +370,7 @@ public class StyleContext
public AttributeSet getResolveParent()
{
- return (AttributeSet) getAttribute(ResolveAttribute);
+ return resolveParent;
}
public int hashCode()
@@ -362,68 +390,96 @@ public class StyleContext
public boolean isEqual(AttributeSet attr)
{
- return getAttributeCount() == attr.getAttributeCount()
+ boolean eq;
+ // If the other one is also a SmallAttributeSet, it is only considered
+ // equal if it's the same instance.
+ if (attr instanceof SmallAttributeSet)
+ eq = attr == this;
+ else
+ eq = getAttributeCount() == attr.getAttributeCount()
&& this.containsAttributes(attr);
+ return eq;
}
public String toString()
{
- StringBuffer sb = new StringBuffer();
- sb.append("[StyleContext.SmallattributeSet:");
- for (int i = 0; i < attrs.length - 1; ++i)
+ StringBuilder sb = new StringBuilder();
+ sb.append('{');
+ for (int i = 0; i < attrs.length; i += 2)
{
- sb.append(" (");
- sb.append(attrs[i].toString());
- sb.append("=");
- sb.append(attrs[i+1].toString());
- sb.append(")");
+ if (attrs[i + 1] instanceof AttributeSet)
+ {
+ sb.append(attrs[i]);
+ sb.append("=AttributeSet,");
+ }
+ else
+ {
+ sb.append(attrs[i]);
+ sb.append('=');
+ sb.append(attrs[i + 1]);
+ sb.append(',');
+ }
}
- sb.append("]");
+ sb.append("}");
return sb.toString();
}
}
- // FIXME: official javadocs suggest that these might be more usefully
- // implemented using a WeakHashMap, but not sure if that works most
- // places or whether it really matters anyways.
- //
- // FIXME: also not sure if these tables ought to be static (singletons),
- // shared across all StyleContexts. I think so, but it's not clear in
- // docs. revert to non-shared if you think it matters.
-
/**
- * The name of the default style.
+ * Register StyleConstant keys as static attribute keys for serialization.
*/
- public static final String DEFAULT_STYLE = "default";
-
+ static
+ {
+ // Don't let problems while doing this prevent class loading.
+ try
+ {
+ for (Iterator i = StyleConstants.keys.iterator(); i.hasNext();)
+ registerStaticAttributeKey(i.next());
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ }
+ }
+
/**
- * The default style for this style context.
+ * The name of the default style.
*/
- NamedStyle defaultStyle = new NamedStyle(DEFAULT_STYLE, null);
+ public static final String DEFAULT_STYLE = "default";
static Hashtable sharedAttributeSets = new Hashtable();
static Hashtable sharedFonts = new Hashtable();
- static StyleContext defaultStyleContext = new StyleContext();
+ static StyleContext defaultStyleContext;
static final int compressionThreshold = 9;
/**
* These attribute keys are handled specially in serialization.
*/
- private static Hashtable staticAttributeKeys = new Hashtable();
+ private static Hashtable writeAttributeKeys;
+ private static Hashtable readAttributeKeys;
+
+ private NamedStyle styles;
+
+ /**
+ * Used for searching attributes in the pool.
+ */
+ private transient MutableAttributeSet search = new SimpleAttributeSet();
+
+ /**
+ * A pool of immutable AttributeSets.
+ */
+ private transient Map attributeSetPool =
+ Collections.synchronizedMap(new WeakHashMap());
- EventListenerList listenerList;
- Hashtable styleTable;
-
/**
* Creates a new instance of the style context. Add the default style
* to the style table.
*/
public StyleContext()
{
- listenerList = new EventListenerList();
- styleTable = new Hashtable();
- styleTable.put(DEFAULT_STYLE, defaultStyle);
+ styles = new NamedStyle(null);
+ addStyle(DEFAULT_STYLE, null);
}
protected SmallAttributeSet createSmallAttributeSet(AttributeSet a)
@@ -438,30 +494,30 @@ public class StyleContext
public void addChangeListener(ChangeListener listener)
{
- listenerList.add(ChangeListener.class, listener);
+ styles.addChangeListener(listener);
}
public void removeChangeListener(ChangeListener listener)
{
- listenerList.remove(ChangeListener.class, listener);
+ styles.removeChangeListener(listener);
}
public ChangeListener[] getChangeListeners()
{
- return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
+ return styles.getChangeListeners();
}
public Style addStyle(String name, Style parent)
{
Style newStyle = new NamedStyle(name, parent);
if (name != null)
- styleTable.put(name, newStyle);
+ styles.addAttribute(name, newStyle);
return newStyle;
}
public void removeStyle(String name)
{
- styleTable.remove(name);
+ styles.removeAttribute(name);
}
/**
@@ -476,16 +532,31 @@ public class StyleContext
*/
public Style getStyle(String name)
{
- return (Style) styleTable.get(name);
+ return (Style) styles.getAttribute(name);
}
/**
* Get the names of the style. The returned enumeration always
* contains at least one member, the default style.
*/
- public Enumeration getStyleNames()
+ public Enumeration<?> getStyleNames()
+ {
+ return styles.getAttributeNames();
+ }
+
+ private void readObject(ObjectInputStream in)
+ throws ClassNotFoundException, IOException
{
- return styleTable.keys();
+ search = new SimpleAttributeSet();
+ attributeSetPool = Collections.synchronizedMap(new WeakHashMap());
+ in.defaultReadObject();
+ }
+
+ private void writeObject(ObjectOutputStream out)
+ throws IOException
+ {
+ cleanupPool();
+ out.defaultWriteObject();
}
//
@@ -577,132 +648,125 @@ public class StyleContext
public static StyleContext getDefaultStyleContext()
{
+ if (defaultStyleContext == null)
+ defaultStyleContext = new StyleContext();
return defaultStyleContext;
}
- public AttributeSet addAttribute(AttributeSet old, Object name, Object value)
+ public synchronized AttributeSet addAttribute(AttributeSet old, Object name,
+ Object value)
{
- if (old instanceof MutableAttributeSet)
+ AttributeSet ret;
+ if (old.getAttributeCount() + 1 < getCompressionThreshold())
{
- ((MutableAttributeSet)old).addAttribute(name, value);
- return old;
+ search.removeAttributes(search);
+ search.addAttributes(old);
+ search.addAttribute(name, value);
+ reclaim(old);
+ ret = searchImmutableSet();
}
- else
+ else
{
- MutableAttributeSet mutable = createLargeAttributeSet(old);
- mutable.addAttribute(name, value);
- if (mutable.getAttributeCount() >= getCompressionThreshold())
- return mutable;
- else
- {
- SmallAttributeSet small = createSmallAttributeSet(mutable);
- if (sharedAttributeSets.containsKey(small))
- small = (SmallAttributeSet) sharedAttributeSets.get(small);
- else
- sharedAttributeSets.put(small,small);
- return small;
- }
+ MutableAttributeSet mas = getMutableAttributeSet(old);
+ mas.addAttribute(name, value);
+ ret = mas;
}
+ return ret;
}
- public AttributeSet addAttributes(AttributeSet old, AttributeSet attributes)
+ public synchronized AttributeSet addAttributes(AttributeSet old,
+ AttributeSet attributes)
{
- if (old instanceof MutableAttributeSet)
+ AttributeSet ret;
+ if (old.getAttributeCount() + attributes.getAttributeCount()
+ < getCompressionThreshold())
{
- ((MutableAttributeSet)old).addAttributes(attributes);
- return old;
+ search.removeAttributes(search);
+ search.addAttributes(old);
+ search.addAttributes(attributes);
+ reclaim(old);
+ ret = searchImmutableSet();
}
- else
+ else
{
- MutableAttributeSet mutable = createLargeAttributeSet(old);
- mutable.addAttributes(attributes);
- if (mutable.getAttributeCount() >= getCompressionThreshold())
- return mutable;
- else
- {
- SmallAttributeSet small = createSmallAttributeSet(mutable);
- if (sharedAttributeSets.containsKey(small))
- small = (SmallAttributeSet) sharedAttributeSets.get(small);
- else
- sharedAttributeSets.put(small,small);
- return small;
- }
+ MutableAttributeSet mas = getMutableAttributeSet(old);
+ mas.addAttributes(attributes);
+ ret = mas;
}
+ return ret;
}
public AttributeSet getEmptySet()
{
- AttributeSet e = createSmallAttributeSet(null);
- if (sharedAttributeSets.containsKey(e))
- e = (AttributeSet) sharedAttributeSets.get(e);
- else
- sharedAttributeSets.put(e, e);
- return e;
+ return SimpleAttributeSet.EMPTY;
}
public void reclaim(AttributeSet attributes)
{
- if (sharedAttributeSets.containsKey(attributes))
- sharedAttributeSets.remove(attributes);
+ cleanupPool();
}
- public AttributeSet removeAttribute(AttributeSet old, Object name)
+ public synchronized AttributeSet removeAttribute(AttributeSet old,
+ Object name)
{
- if (old instanceof MutableAttributeSet)
+ AttributeSet ret;
+ if (old.getAttributeCount() - 1 <= getCompressionThreshold())
{
- ((MutableAttributeSet)old).removeAttribute(name);
- if (old.getAttributeCount() < getCompressionThreshold())
- {
- SmallAttributeSet small = createSmallAttributeSet(old);
- if (!sharedAttributeSets.containsKey(small))
- sharedAttributeSets.put(small,small);
- old = (AttributeSet) sharedAttributeSets.get(small);
- }
- return old;
+ search.removeAttributes(search);
+ search.addAttributes(old);
+ search.removeAttribute(name);
+ reclaim(old);
+ ret = searchImmutableSet();
}
- else
- {
- MutableAttributeSet mutable = createLargeAttributeSet(old);
- mutable.removeAttribute(name);
- SmallAttributeSet small = createSmallAttributeSet(mutable);
- if (sharedAttributeSets.containsKey(small))
- small = (SmallAttributeSet) sharedAttributeSets.get(small);
- else
- sharedAttributeSets.put(small,small);
- return small;
+ else
+ {
+ MutableAttributeSet mas = getMutableAttributeSet(old);
+ mas.removeAttribute(name);
+ ret = mas;
}
+ return ret;
}
- public AttributeSet removeAttributes(AttributeSet old, AttributeSet attributes)
+ public synchronized AttributeSet removeAttributes(AttributeSet old,
+ AttributeSet attributes)
{
- return removeAttributes(old, attributes.getAttributeNames());
+ AttributeSet ret;
+ if (old.getAttributeCount() <= getCompressionThreshold())
+ {
+ search.removeAttributes(search);
+ search.addAttributes(old);
+ search.removeAttributes(attributes);
+ reclaim(old);
+ ret = searchImmutableSet();
+ }
+ else
+ {
+ MutableAttributeSet mas = getMutableAttributeSet(old);
+ mas.removeAttributes(attributes);
+ ret = mas;
+ }
+ return ret;
}
- public AttributeSet removeAttributes(AttributeSet old, Enumeration names)
+ public synchronized AttributeSet removeAttributes(AttributeSet old,
+ Enumeration<?> names)
{
- if (old instanceof MutableAttributeSet)
+ AttributeSet ret;
+ if (old.getAttributeCount() <= getCompressionThreshold())
{
- ((MutableAttributeSet)old).removeAttributes(names);
- if (old.getAttributeCount() < getCompressionThreshold())
- {
- SmallAttributeSet small = createSmallAttributeSet(old);
- if (!sharedAttributeSets.containsKey(small))
- sharedAttributeSets.put(small,small);
- old = (AttributeSet) sharedAttributeSets.get(small);
- }
- return old;
+ search.removeAttributes(search);
+ search.addAttributes(old);
+ search.removeAttributes(names);
+ reclaim(old);
+ ret = searchImmutableSet();
}
- else
- {
- MutableAttributeSet mutable = createLargeAttributeSet(old);
- mutable.removeAttributes(names);
- SmallAttributeSet small = createSmallAttributeSet(mutable);
- if (sharedAttributeSets.containsKey(small))
- small = (SmallAttributeSet) sharedAttributeSets.get(small);
- else
- sharedAttributeSets.put(small,small);
- return small;
- }
+ else
+ {
+ MutableAttributeSet mas = getMutableAttributeSet(old);
+ mas.removeAttributes(names);
+ ret = mas;
+ }
+ return ret;
}
/**
@@ -715,7 +779,7 @@ public class StyleContext
{
if (key == null)
return null;
- return staticAttributeKeys.get(key);
+ return readAttributeKeys.get(key);
}
/**
@@ -742,27 +806,25 @@ public class StyleContext
* stream
* @throws IOException - any I/O error
*/
- public static void readAttributeSet(ObjectInputStream in, MutableAttributeSet a)
+ public static void readAttributeSet(ObjectInputStream in,
+ MutableAttributeSet a)
throws ClassNotFoundException, IOException
{
- if (in == null || a == null)
- return;
-
- Object key = in.readObject();
- Object val = in.readObject();
- while (key != null && val != null)
+ int count = in.readInt();
+ for (int i = 0; i < count; i++)
{
- Object staticKey = staticAttributeKeys.get(key);
- Object staticVal = staticAttributeKeys.get(val);
-
- if (staticKey != null)
- key = staticKey;
- if (staticVal != null)
- val = staticVal;
-
+ Object key = in.readObject();
+ Object val = in.readObject();
+ if (readAttributeKeys != null)
+ {
+ Object staticKey = readAttributeKeys.get(key);
+ if (staticKey != null)
+ key = staticKey;
+ Object staticVal = readAttributeKeys.get(val);
+ if (staticVal != null)
+ val = staticVal;
+ }
a.addAttribute(key, val);
- key = in.readObject();
- val = in.readObject();
}
}
@@ -778,18 +840,35 @@ public class StyleContext
public static void writeAttributeSet(ObjectOutputStream out, AttributeSet a)
throws IOException
{
+ int count = a.getAttributeCount();
+ out.writeInt(count);
Enumeration e = a.getAttributeNames();
while (e.hasMoreElements())
{
- Object oldKey = e.nextElement();
- Object newKey = getStaticAttribute(oldKey);
- Object key = (newKey == null) ? oldKey : newKey;
-
- out.writeObject(key);
- out.writeObject(a.getAttribute(oldKey));
+ Object key = e.nextElement();
+ // Write key.
+ if (key instanceof Serializable)
+ out.writeObject(key);
+ else
+ {
+ Object io = writeAttributeKeys.get(key);
+ if (io == null)
+ throw new NotSerializableException(key.getClass().getName()
+ + ", key: " + key);
+ out.writeObject(io);
+ }
+ // Write value.
+ Object val = a.getAttribute(key);
+ Object io = writeAttributeKeys.get(val);
+ if (val instanceof Serializable)
+ out.writeObject(io != null ? io : val);
+ else
+ {
+ if (io == null)
+ throw new NotSerializableException(val.getClass().getName());
+ out.writeObject(io);
+ }
}
- out.writeObject(null);
- out.writeObject(null);
}
/**
@@ -833,8 +912,79 @@ public class StyleContext
*/
public static void registerStaticAttributeKey(Object key)
{
- if (key != null)
- staticAttributeKeys.put(key.getClass().getName() + "." + key.toString(),
- key);
+ String io = key.getClass().getName() + "." + key.toString();
+ if (writeAttributeKeys == null)
+ writeAttributeKeys = new Hashtable();
+ if (readAttributeKeys == null)
+ readAttributeKeys = new Hashtable();
+ writeAttributeKeys.put(key, io);
+ readAttributeKeys.put(io, key);
+ }
+
+ /**
+ * Returns a string representation of this StyleContext.
+ *
+ * @return a string representation of this StyleContext
+ */
+ public String toString()
+ {
+ cleanupPool();
+ StringBuilder b = new StringBuilder();
+ Iterator i = attributeSetPool.keySet().iterator();
+ while (i.hasNext())
+ {
+ Object att = i.next();
+ b.append(att);
+ b.append('\n');
+ }
+ return b.toString();
+ }
+
+ /**
+ * Searches the AttributeSet pool and returns a pooled instance if available,
+ * or pool a new one.
+ *
+ * @return an immutable attribute set that equals the current search key
+ */
+ private AttributeSet searchImmutableSet()
+ {
+ SmallAttributeSet k = createSmallAttributeSet(search);
+ WeakReference ref = (WeakReference) attributeSetPool.get(k);
+ SmallAttributeSet a;
+ if (ref == null || (a = (SmallAttributeSet) ref.get()) == null)
+ {
+ a = k;
+ attributeSetPool.put(a, new WeakReference(a));
+ }
+ return a;
+ }
+
+ /**
+ * Cleans up the attribute set pool from entries that are no longer
+ * referenced.
+ */
+ private void cleanupPool()
+ {
+ // TODO: How else can we force cleaning up the WeakHashMap?
+ attributeSetPool.size();
+ }
+
+ /**
+ * Returns a MutableAttributeSet that holds a. If a itself is mutable,
+ * this returns a itself, otherwise it creates a new SimpleAtttributeSet
+ * via {@link #createLargeAttributeSet(AttributeSet)}.
+ *
+ * @param a the AttributeSet to create a mutable set for
+ *
+ * @return a mutable attribute set that corresponds to a
+ */
+ private MutableAttributeSet getMutableAttributeSet(AttributeSet a)
+ {
+ MutableAttributeSet mas;
+ if (a instanceof MutableAttributeSet)
+ mas = (MutableAttributeSet) a;
+ else
+ mas = createLargeAttributeSet(a);
+ return mas;
}
}
diff --git a/libjava/classpath/javax/swing/text/StyledEditorKit.java b/libjava/classpath/javax/swing/text/StyledEditorKit.java
index c4eef4463fb..568694387f3 100644
--- a/libjava/classpath/javax/swing/text/StyledEditorKit.java
+++ b/libjava/classpath/javax/swing/text/StyledEditorKit.java
@@ -142,7 +142,7 @@ public class StyledEditorKit extends DefaultEditorKit
Element el = doc.getCharacterElement(editor.getSelectionStart());
boolean isBold = StyleConstants.isBold(el.getAttributes());
SimpleAttributeSet atts = new SimpleAttributeSet();
- StyleConstants.setItalic(atts, ! isBold);
+ StyleConstants.setBold(atts, ! isBold);
setCharacterAttributes(editor, atts, false);
}
}
@@ -335,35 +335,21 @@ public class StyledEditorKit extends DefaultEditorKit
AttributeSet atts,
boolean replace)
{
- Document doc = editor.getDocument();
- if (doc instanceof StyledDocument)
- {
- StyledDocument styleDoc = (StyledDocument) editor.getDocument();
- EditorKit kit = editor.getEditorKit();
- if (!(kit instanceof StyledEditorKit))
- {
- StyledEditorKit styleKit = (StyledEditorKit) kit;
- int start = editor.getSelectionStart();
- int end = editor.getSelectionEnd();
- int dot = editor.getCaret().getDot();
- if (start == dot && end == dot)
- {
- // If there is no selection, then we only update the
- // input attributes.
- MutableAttributeSet inputAttributes =
- styleKit.getInputAttributes();
- inputAttributes.addAttributes(atts);
- }
- else
- styleDoc.setCharacterAttributes(start, end, atts, replace);
- }
- else
- throw new AssertionError("The EditorKit for StyledTextActions "
- + "is expected to be a StyledEditorKit");
- }
- else
- throw new AssertionError("The Document for StyledTextActions is "
- + "expected to be a StyledDocument.");
+ int p0 = editor.getSelectionStart();
+ int p1 = editor.getSelectionEnd();
+ if (p0 != p1)
+ {
+ StyledDocument doc = getStyledDocument(editor);
+ doc.setCharacterAttributes(p0, p1 - p0, atts, replace);
+ }
+ // Update input attributes.
+ StyledEditorKit kit = getStyledEditorKit(editor);
+ MutableAttributeSet inputAtts = kit.getInputAttributes();
+ if (replace)
+ {
+ inputAtts.removeAttributes(inputAtts);
+ }
+ inputAtts.addAttributes(atts);
}
/**
diff --git a/libjava/classpath/javax/swing/text/TextAction.java b/libjava/classpath/javax/swing/text/TextAction.java
index 144166e9cdb..49c49cb9d7f 100644
--- a/libjava/classpath/javax/swing/text/TextAction.java
+++ b/libjava/classpath/javax/swing/text/TextAction.java
@@ -38,14 +38,15 @@ exception statement from your version. */
package javax.swing.text;
+import java.awt.Component;
+import java.awt.KeyboardFocusManager;
import java.awt.Point;
import java.awt.event.ActionEvent;
-import java.util.ArrayList;
-import java.util.HashSet;
+import java.util.HashMap;
+import java.util.Iterator;
import javax.swing.AbstractAction;
import javax.swing.Action;
-import javax.swing.SwingConstants;
/**
* TextAction
@@ -73,10 +74,16 @@ public abstract class TextAction extends AbstractAction
*/
protected final JTextComponent getTextComponent(ActionEvent event)
{
- if (event.getSource() instanceof JTextComponent)
- return (JTextComponent) event.getSource();
-
- return getFocusedComponent();
+ JTextComponent target = null;
+ if (event != null)
+ {
+ Object source = event.getSource();
+ if (source instanceof JTextComponent)
+ target = (JTextComponent) source;
+ }
+ if (target == null)
+ target = getFocusedComponent();
+ return target;
}
/**
@@ -89,16 +96,28 @@ public abstract class TextAction extends AbstractAction
*/
public static final Action[] augmentList(Action[] list1, Action[] list2)
{
- HashSet actionSet = new HashSet();
+ HashMap<Object,Action> actions = new HashMap<Object,Action>();
for (int i = 0; i < list1.length; ++i)
- actionSet.add(list1[i]);
+ {
+ Action a = list1[i];
+ Object name = a.getValue(Action.NAME);
+ actions.put(name != null ? name : "", a);
+ }
for (int i = 0; i < list2.length; ++i)
- actionSet.add(list2[i]);
+ {
+ Action a = list2[i];
+ Object name = a.getValue(Action.NAME);
+ actions.put(name != null ? name : "", a);
+ }
+ Action[] augmented = new Action[actions.size()];
+
+ int i = 0;
+ for (Iterator<Action> it = actions.values().iterator(); it.hasNext(); i++)
+ augmented[i] = it.next();
+ return augmented;
- ArrayList list = new ArrayList(actionSet);
- return (Action[]) list.toArray(new Action[actionSet.size()]);
}
/**
@@ -108,7 +127,13 @@ public abstract class TextAction extends AbstractAction
*/
protected final JTextComponent getFocusedComponent()
{
- return null; // TODO
+ KeyboardFocusManager kfm =
+ KeyboardFocusManager.getCurrentKeyboardFocusManager();
+ Component focused = kfm.getPermanentFocusOwner();
+ JTextComponent textComp = null;
+ if (focused instanceof JTextComponent)
+ textComp = (JTextComponent) focused;
+ return textComp;
}
/** Abstract helper class which implements everything needed for an
diff --git a/libjava/classpath/javax/swing/text/Utilities.java b/libjava/classpath/javax/swing/text/Utilities.java
index 36361f49796..d49d806cfa3 100644
--- a/libjava/classpath/javax/swing/text/Utilities.java
+++ b/libjava/classpath/javax/swing/text/Utilities.java
@@ -43,7 +43,6 @@ import java.awt.Graphics;
import java.awt.Point;
import java.text.BreakIterator;
-import javax.swing.SwingConstants;
import javax.swing.text.Position.Bias;
/**
@@ -55,10 +54,6 @@ import javax.swing.text.Position.Bias;
*/
public class Utilities
{
- /**
- * The length of the char buffer that holds the characters to be drawn.
- */
- private static final int BUF_LENGTH = 64;
/**
* Creates a new <code>Utilities</code> object.
@@ -94,13 +89,12 @@ public class Utilities
// The font metrics of the current selected font.
FontMetrics metrics = g.getFontMetrics();
+
int ascent = metrics.getAscent();
// The current x and y pixel coordinates.
int pixelX = x;
- int pixelY = y - ascent;
- int pixelWidth = 0;
int pos = s.offset;
int len = 0;
@@ -109,44 +103,43 @@ public class Utilities
for (int offset = s.offset; offset < end; ++offset)
{
char c = buffer[offset];
- if (c == '\t' || c == '\n')
+ switch (c)
{
+ case '\t':
if (len > 0) {
- g.drawChars(buffer, pos, len, pixelX, pixelY + ascent);
- pixelX += pixelWidth;
- pixelWidth = 0;
+ g.drawChars(buffer, pos, len, pixelX, y);
+ pixelX += metrics.charsWidth(buffer, pos, len);
+ len = 0;
}
pos = offset+1;
- len = 0;
+ if (e != null)
+ pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset
+ - s.offset);
+ else
+ pixelX += metrics.charWidth(' ');
+ x = pixelX;
+ break;
+ case '\n':
+ case '\r':
+ if (len > 0) {
+ g.drawChars(buffer, pos, len, pixelX, y);
+ pixelX += metrics.charsWidth(buffer, pos, len);
+ len = 0;
+ }
+ x = pixelX;
+ break;
+ default:
+ len += 1;
}
-
- switch (c)
- {
- case '\t':
- // In case we have a tab, we just 'jump' over the tab.
- // When we have no tab expander we just use the width of ' '.
- if (e != null)
- pixelX = (int) e.nextTabStop((float) pixelX,
- startOffset + offset - s.offset);
- else
- pixelX += metrics.charWidth(' ');
- break;
- case '\n':
- // In case we have a newline, we must jump to the next line.
- pixelY += metrics.getHeight();
- pixelX = x;
- break;
- default:
- ++len;
- pixelWidth += metrics.charWidth(buffer[offset]);
- break;
- }
}
if (len > 0)
- g.drawChars(buffer, pos, len, pixelX, pixelY + ascent);
+ {
+ g.drawChars(buffer, pos, len, pixelX, y);
+ pixelX += metrics.charsWidth(buffer, pos, len);
+ }
- return pixelX + pixelWidth;
+ return pixelX;
}
/**
@@ -174,7 +167,9 @@ public class Utilities
// The current maximum width.
int maxWidth = 0;
- for (int offset = s.offset; offset < (s.offset + s.count); ++offset)
+ int end = s.offset + s.count;
+ int count = 0;
+ for (int offset = s.offset; offset < end; offset++)
{
switch (buffer[offset])
{
@@ -182,7 +177,7 @@ public class Utilities
// In case we have a tab, we just 'jump' over the tab.
// When we have no tab expander we just use the width of 'm'.
if (e != null)
- pixelX = (int) e.nextTabStop((float) pixelX,
+ pixelX = (int) e.nextTabStop(pixelX,
startOffset + offset - s.offset);
else
pixelX += metrics.charWidth(' ');
@@ -190,21 +185,18 @@ public class Utilities
case '\n':
// In case we have a newline, we must 'draw'
// the buffer and jump on the next line.
- pixelX += metrics.charWidth(buffer[offset]);
- maxWidth = Math.max(maxWidth, pixelX - x);
- pixelX = x;
- break;
- default:
- // Here we draw the char.
- pixelX += metrics.charWidth(buffer[offset]);
- break;
- }
+ pixelX += metrics.charsWidth(buffer, offset - count, count);
+ count = 0;
+ break;
+ default:
+ count++;
+ }
}
// Take the last line into account.
- maxWidth = Math.max(maxWidth, pixelX - x);
+ pixelX += metrics.charsWidth(buffer, end - count, count);
- return maxWidth;
+ return pixelX - x;
}
/**
@@ -239,43 +231,41 @@ public class Utilities
int x, TabExpander te, int p0,
boolean round)
{
- // At the end of the for loop, this holds the requested model location
- int pos;
+ int found = s.count;
int currentX = x0;
- int width = 0;
+ int nextX = currentX;
- for (pos = 0; pos < s.count; pos++)
+ int end = s.offset + s.count;
+ for (int pos = s.offset; pos < end && found == s.count; pos++)
{
- char nextChar = s.array[s.offset+pos];
-
- if (nextChar == 0)
- break;
+ char nextChar = s.array[pos];
if (nextChar != '\t')
- width = fm.charWidth(nextChar);
+ nextX += fm.charWidth(nextChar);
else
{
if (te == null)
- width = fm.charWidth(' ');
+ nextX += fm.charWidth(' ');
else
- width = ((int) te.nextTabStop(currentX, pos)) - currentX;
+ nextX += ((int) te.nextTabStop(nextX, p0 + pos - s.offset));
}
- if (round)
+ if (x >= currentX && x < nextX)
{
- if (currentX + (width>>1) > x)
- break;
- }
- else
- {
- if (currentX + width > x)
- break;
+ // Found position.
+ if ((! round) || ((x - currentX) < (nextX - x)))
+ {
+ found = pos - s.offset;
+ }
+ else
+ {
+ found = pos + 1 - s.offset;
+ }
}
-
- currentX += width;
+ currentX = nextX;
}
- return pos + p0;
+ return found;
}
/**
@@ -543,28 +533,39 @@ public class Utilities
int x0, int x, TabExpander e,
int startOffset)
{
- int mark = Utilities.getTabbedTextOffset(s, metrics, x0, x, e, startOffset, false);
- BreakIterator breaker = BreakIterator.getWordInstance();
- breaker.setText(s);
-
- // If startOffset and s.offset differ then we need to use
- // that difference two convert the offset between the two metrics.
- int shift = startOffset - s.offset;
-
+ int mark = Utilities.getTabbedTextOffset(s, metrics, x0, x, e, startOffset,
+ false);
+ int breakLoc = mark;
// If mark is equal to the end of the string, just use that position.
- if (mark >= shift + s.count)
- return mark;
-
- // Try to find a word boundary previous to the mark at which we
- // can break the text.
- int preceding = breaker.preceding(mark + 1 - shift);
-
- if (preceding != 0)
- return preceding + shift;
-
- // If preceding is 0 we couldn't find a suitable word-boundary so
- // just break it on the character boundary
- return mark;
+ if (mark < s.count - 1)
+ {
+ for (int i = s.offset + mark; i >= s.offset; i--)
+ {
+ char ch = s.array[i];
+ if (ch < 256)
+ {
+ // For ASCII simply scan backwards for whitespace.
+ if (Character.isWhitespace(ch))
+ {
+ breakLoc = i - s.offset + 1;
+ break;
+ }
+ }
+ else
+ {
+ // Only query BreakIterator for complex chars.
+ BreakIterator bi = BreakIterator.getLineInstance();
+ bi.setText(s);
+ int pos = bi.preceding(i + 1);
+ if (pos > s.offset)
+ {
+ breakLoc = breakLoc - s.offset;
+ }
+ break;
+ }
+ }
+ }
+ return breakLoc;
}
/**
@@ -712,12 +713,12 @@ public class Utilities
offset,
Bias.Forward,
direction,
- null)
+ new Position.Bias[1])
: t.getUI().getNextVisualPositionFrom(t,
offset,
Bias.Forward,
direction,
- null);
+ new Position.Bias[1]);
}
catch (BadLocationException ble)
{
diff --git a/libjava/classpath/javax/swing/text/View.java b/libjava/classpath/javax/swing/text/View.java
index 55a63f6b668..c63ddbce776 100644
--- a/libjava/classpath/javax/swing/text/View.java
+++ b/libjava/classpath/javax/swing/text/View.java
@@ -57,7 +57,6 @@ public abstract class View implements SwingConstants
public static final int X_AXIS = 0;
public static final int Y_AXIS = 1;
- private float width, height;
private Element elt;
private View parent;
@@ -93,7 +92,14 @@ public abstract class View implements SwingConstants
{
int numChildren = getViewCount();
for (int i = 0; i < numChildren; i++)
- getView(i).setParent(null);
+ {
+ View child = getView(i);
+ // It is important that we only reset the parent on views that
+ // actually belong to us. In FlowView the child may already be
+ // reparented.
+ if (child.getParent() == this)
+ child.setParent(null);
+ }
}
this.parent = parent;
@@ -263,7 +269,7 @@ public abstract class View implements SwingConstants
public void removeAll()
{
- replace(0, getViewCount(), new View[0]);
+ replace(0, getViewCount(), null);
}
public void remove(int index)
@@ -307,15 +313,16 @@ public abstract class View implements SwingConstants
{
int index = getViewIndex(x, y, allocation);
- if (index < -1)
- return null;
-
- Shape childAllocation = getChildAllocation(index, allocation);
-
- if (childAllocation.getBounds().contains(x, y))
- return getView(index).getToolTipText(x, y, childAllocation);
-
- return null;
+ String text = null;
+ if (index >= 0)
+ {
+ allocation = getChildAllocation(index, allocation);
+ Rectangle r = allocation instanceof Rectangle ? (Rectangle) allocation
+ : allocation.getBounds();
+ if (r.contains(x, y))
+ text = getView(index).getToolTipText(x, y, allocation);
+ }
+ return text;
}
/**
@@ -328,13 +335,17 @@ public abstract class View implements SwingConstants
public void preferenceChanged(View child, boolean width, boolean height)
{
- if (parent != null)
- parent.preferenceChanged(this, width, height);
+ View p = getParent();
+ if (p != null)
+ p.preferenceChanged(this, width, height);
}
public int getBreakWeight(int axis, float pos, float len)
{
- return BadBreakWeight;
+ int weight = BadBreakWeight;
+ if (len > getPreferredSpan(axis))
+ weight = GoodBreakWeight;
+ return weight;
}
public View breakView(int axis, int offset, float pos, float len)
@@ -370,12 +381,18 @@ public abstract class View implements SwingConstants
*/
public void insertUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
{
- Element el = getElement();
- DocumentEvent.ElementChange ec = ev.getChange(el);
- if (ec != null)
- updateChildren(ec, ev, vf);
- forwardUpdate(ec, ev, shape, vf);
- updateLayout(ec, ev, shape);
+ if (getViewCount() > 0)
+ {
+ Element el = getElement();
+ DocumentEvent.ElementChange ec = ev.getChange(el);
+ if (ec != null)
+ {
+ if (! updateChildren(ec, ev, vf))
+ ec = null;
+ }
+ forwardUpdate(ec, ev, shape, vf);
+ updateLayout(ec, ev, shape);
+ }
}
/**
@@ -429,12 +446,18 @@ public abstract class View implements SwingConstants
*/
public void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
{
- Element el = getElement();
- DocumentEvent.ElementChange ec = ev.getChange(el);
- if (ec != null)
- updateChildren(ec, ev, vf);
- forwardUpdate(ec, ev, shape, vf);
- updateLayout(ec, ev, shape);
+ if (getViewCount() > 0)
+ {
+ Element el = getElement();
+ DocumentEvent.ElementChange ec = ev.getChange(el);
+ if (ec != null)
+ {
+ if (! updateChildren(ec, ev, vf))
+ ec = null;
+ }
+ forwardUpdate(ec, ev, shape, vf);
+ updateLayout(ec, ev, shape);
+ }
}
/**
@@ -465,10 +488,15 @@ public abstract class View implements SwingConstants
Element[] removed = ec.getChildrenRemoved();
int index = ec.getIndex();
- View[] newChildren = new View[added.length];
- for (int i = 0; i < added.length; ++i)
- newChildren[i] = vf.create(added[i]);
- replace(index, removed.length, newChildren);
+ View[] newChildren = null;
+ if (added != null)
+ {
+ newChildren = new View[added.length];
+ for (int i = 0; i < added.length; ++i)
+ newChildren[i] = vf.create(added[i]);
+ }
+ int numRemoved = removed != null ? removed.length : 0;
+ replace(index, numRemoved, newChildren);
return true;
}
@@ -598,10 +626,12 @@ public abstract class View implements SwingConstants
DocumentEvent ev, Shape shape)
{
if (ec != null && shape != null)
- preferenceChanged(null, true, true);
- Container c = getContainer();
- if (c != null)
- c.repaint();
+ {
+ preferenceChanged(null, true, true);
+ Container c = getContainer();
+ if (c != null)
+ c.repaint();
+ }
}
/**
@@ -750,7 +780,9 @@ public abstract class View implements SwingConstants
*/
public int viewToModel(float x, float y, Shape a)
{
- return viewToModel(x, y, a, new Position.Bias[0]);
+ Position.Bias[] biasRet = new Position.Bias[1];
+ biasRet[0] = Position.Bias.Forward;
+ return viewToModel(x, y, a, biasRet);
}
/**
diff --git a/libjava/classpath/javax/swing/text/WrappedPlainView.java b/libjava/classpath/javax/swing/text/WrappedPlainView.java
index a6c369a4c25..00e12b1129e 100644
--- a/libjava/classpath/javax/swing/text/WrappedPlainView.java
+++ b/libjava/classpath/javax/swing/text/WrappedPlainView.java
@@ -83,7 +83,17 @@ public class WrappedPlainView extends BoxView implements TabExpander
/** The height of the line (used while painting) **/
int lineHeight;
-
+
+ /**
+ * The base offset for tab calculations.
+ */
+ private int tabBase;
+
+ /**
+ * The tab size.
+ */
+ private int tabSize;
+
/**
* The instance returned by {@link #getLineBuffer()}.
*/
@@ -121,10 +131,13 @@ public class WrappedPlainView extends BoxView implements TabExpander
*/
public float nextTabStop(float x, int tabStop)
{
- JTextComponent host = (JTextComponent)getContainer();
- float tabSizePixels = getTabSize()
- * host.getFontMetrics(host.getFont()).charWidth('m');
- return (float) (Math.floor(x / tabSizePixels) + 1) * tabSizePixels;
+ int next = (int) x;
+ if (tabSize != 0)
+ {
+ int numTabs = ((int) x - tabBase) / tabSize;
+ next = tabBase + (numTabs + 1) * tabSize;
+ }
+ return next;
}
/**
@@ -274,44 +287,32 @@ public class WrappedPlainView extends BoxView implements TabExpander
*/
protected int calculateBreakPosition(int p0, int p1)
{
- Container c = getContainer();
-
- int li = getLeftInset();
- int ti = getTopInset();
-
- Rectangle alloc = new Rectangle(li, ti,
- getWidth()-getRightInset()-li,
- getHeight()-getBottomInset()-ti);
-
- // Mimic a behavior observed in the RI.
- if (alloc.isEmpty())
- return 0;
-
- updateMetrics();
-
+ Segment s = new Segment();
try
{
- getDocument().getText(p0, p1 - p0, getLineBuffer());
+ getDocument().getText(p0, p1 - p0, s);
}
- catch (BadLocationException ble)
+ catch (BadLocationException ex)
{
- // this shouldn't happen
- throw new InternalError("Invalid offsets p0: " + p0 + " - p1: " + p1);
+ assert false : "Couldn't load text";
}
-
+ int width = getWidth();
+ int pos;
if (wordWrap)
- return Utilities.getBreakLocation(lineBuffer, metrics, alloc.x,
- alloc.x + alloc.width, this, p0);
+ pos = p0 + Utilities.getBreakLocation(s, metrics, tabBase,
+ tabBase + width, this, p0);
else
- return p0 + Utilities.getTabbedTextOffset(lineBuffer, metrics, alloc.x,
- alloc.x + alloc.width, this, 0,
- true);
+ pos = p0 + Utilities.getTabbedTextOffset(s, metrics, tabBase,
+ tabBase + width, this, p0,
+ false);
+ return pos;
}
void updateMetrics()
{
Container component = getContainer();
metrics = component.getFontMetrics(component.getFont());
+ tabSize = getTabSize()* metrics.charWidth('m');
}
/**
@@ -350,9 +351,15 @@ public class WrappedPlainView extends BoxView implements TabExpander
*/
public void insertUpdate (DocumentEvent e, Shape a, ViewFactory f)
{
- super.insertUpdate(e, a, viewFactory);
+ // Update children efficiently.
+ updateChildren(e, a);
- // No repaint needed, as this is done by the WrappedLine instances.
+ // Notify children.
+ Rectangle r = a != null && isAllocationValid() ? getInsideAllocation(a)
+ : null;
+ View v = getViewAtPosition(e.getOffset(), r);
+ if (v != null)
+ v.insertUpdate(e, r, f);
}
/**
@@ -361,9 +368,15 @@ public class WrappedPlainView extends BoxView implements TabExpander
*/
public void removeUpdate (DocumentEvent e, Shape a, ViewFactory f)
{
- super.removeUpdate(e, a, viewFactory);
-
- // No repaint needed, as this is done by the WrappedLine instances.
+ // Update children efficiently.
+ updateChildren(e, a);
+
+ // Notify children.
+ Rectangle r = a != null && isAllocationValid() ? getInsideAllocation(a)
+ : null;
+ View v = getViewAtPosition(e.getOffset(), r);
+ if (v != null)
+ v.removeUpdate(e, r, f);
}
/**
@@ -373,11 +386,39 @@ public class WrappedPlainView extends BoxView implements TabExpander
*/
public void changedUpdate (DocumentEvent e, Shape a, ViewFactory f)
{
- super.changedUpdate(e, a, viewFactory);
-
- // No repaint needed, as this is done by the WrappedLine instances.
+ // Update children efficiently.
+ updateChildren(e, a);
}
-
+
+ /**
+ * Helper method. Updates the child views in response to
+ * insert/remove/change updates. This is here to be a little more efficient
+ * than the BoxView implementation.
+ *
+ * @param ev the document event
+ * @param a the shape
+ */
+ private void updateChildren(DocumentEvent ev, Shape a)
+ {
+ Element el = getElement();
+ DocumentEvent.ElementChange ec = ev.getChange(el);
+ if (ec != null)
+ {
+ Element[] removed = ec.getChildrenRemoved();
+ Element[] added = ec.getChildrenAdded();
+ View[] addedViews = new View[added.length];
+ for (int i = 0; i < added.length; i++)
+ addedViews[i] = new WrappedLine(added[i]);
+ replace(ec.getIndex(), removed.length, addedViews);
+ if (a != null)
+ {
+ preferenceChanged(null, true, true);
+ getContainer().repaint();
+ }
+ }
+ updateMetrics();
+ }
+
class WrappedLineCreator implements ViewFactory
{
// Creates a new WrappedLine
@@ -397,6 +438,9 @@ public class WrappedPlainView extends BoxView implements TabExpander
*/
public void paint(Graphics g, Shape a)
{
+ Rectangle r = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
+ tabBase = r.x;
+
JTextComponent comp = (JTextComponent)getContainer();
// Ensure metrics are up-to-date.
updateMetrics();
@@ -434,7 +478,6 @@ public class WrappedPlainView extends BoxView implements TabExpander
public WrappedLine(Element elem)
{
super(elem);
- determineNumLines();
}
/**
@@ -449,10 +492,34 @@ public class WrappedPlainView extends BoxView implements TabExpander
int currStart = getStartOffset();
int currEnd;
int count = 0;
+
+ // Determine layered highlights.
+ Container c = getContainer();
+ LayeredHighlighter lh = null;
+ JTextComponent tc = null;
+ if (c instanceof JTextComponent)
+ {
+ tc = (JTextComponent) c;
+ Highlighter h = tc.getHighlighter();
+ if (h instanceof LayeredHighlighter)
+ lh = (LayeredHighlighter) h;
+ }
+
while (currStart < end)
{
currEnd = calculateBreakPosition(currStart, end);
+ // Paint layered highlights, if any.
+ if (lh != null)
+ {
+ // Exclude trailing newline in last line.
+ if (currEnd == end)
+ lh.paintLayeredHighlights(g, currStart, currEnd - 1, s, tc,
+ this);
+ else
+ lh.paintLayeredHighlights(g, currStart, currEnd, s, tc, this);
+
+ }
drawLine(currStart, currEnd, g, rect.x, rect.y + metrics.getAscent());
rect.y += lineHeight;
@@ -472,37 +539,29 @@ public class WrappedPlainView extends BoxView implements TabExpander
}
}
-
+
/**
* Calculates the number of logical lines that the Element
* needs to be displayed and updates the variable numLines
* accordingly.
*/
- void determineNumLines()
+ private int determineNumLines()
{
- numLines = 0;
+ int nLines = 0;
int end = getEndOffset();
- if (end == 0)
- return;
-
- int breakPoint;
for (int i = getStartOffset(); i < end;)
{
- numLines ++;
+ nLines++;
// careful: check that there's no off-by-one problem here
// depending on which position calculateBreakPosition returns
- breakPoint = calculateBreakPosition(i, end);
-
- if (breakPoint == 0)
- return;
+ int breakPoint = calculateBreakPosition(i, end);
- // If breakPoint is equal to the current index no further
- // line is needed and we can end the loop.
if (breakPoint == i)
- break;
+ i = breakPoint + 1;
else
i = breakPoint;
}
+ return nLines;
}
/**
@@ -547,7 +606,7 @@ public class WrappedPlainView extends BoxView implements TabExpander
// Throwing a BadLocationException is an observed behavior of the RI.
if (rect.isEmpty())
throw new BadLocationException("Unable to calculate view coordinates "
- + "when allocation area is empty.", 5);
+ + "when allocation area is empty.", pos);
Segment s = getLineBuffer();
int lineHeight = metrics.getHeight();
@@ -624,7 +683,7 @@ public class WrappedPlainView extends BoxView implements TabExpander
return currLineStart;
if (y > rect.y + rect.height)
- return end;
+ return end - 1;
// Note: rect.x and rect.width do not represent the width of painted
// text but the area where text *may* be painted. This means the width
@@ -685,22 +744,14 @@ public class WrappedPlainView extends BoxView implements TabExpander
*/
void updateDamage (Rectangle a)
{
- // If the allocation area is empty we can't do anything useful.
- // As determining the number of lines is impossible in that state we
- // reset it to an invalid value which can then be recalculated at a
- // later point.
- if (a == null || a.isEmpty())
+ int nLines = determineNumLines();
+ if (numLines != nLines)
{
- numLines = 1;
- return;
+ numLines = nLines;
+ preferenceChanged(this, false, true);
+ getContainer().repaint();
}
-
- int oldNumLines = numLines;
- determineNumLines();
-
- if (numLines != oldNumLines)
- preferenceChanged(this, false, true);
- else
+ else if (a != null)
getContainer().repaint(a.x, a.y, a.width, a.height);
}
@@ -714,7 +765,8 @@ public class WrappedPlainView extends BoxView implements TabExpander
*/
public void insertUpdate (DocumentEvent changes, Shape a, ViewFactory f)
{
- updateDamage((Rectangle)a);
+ Rectangle r = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
+ updateDamage(r);
}
/**
@@ -736,7 +788,8 @@ public class WrappedPlainView extends BoxView implements TabExpander
// However this seems to cause no trouble and as it reduces the
// number of method calls it can stay this way.
- updateDamage((Rectangle)a);
+ Rectangle r = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
+ updateDamage(r);
}
}
}
diff --git a/libjava/classpath/javax/swing/text/ZoneView.java b/libjava/classpath/javax/swing/text/ZoneView.java
new file mode 100644
index 00000000000..6cabc6c200c
--- /dev/null
+++ b/libjava/classpath/javax/swing/text/ZoneView.java
@@ -0,0 +1,442 @@
+/* ZoneView.java -- An effective BoxView subclass
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.text;
+
+import java.awt.Shape;
+import java.util.ArrayList;
+import java.util.LinkedList;
+
+import javax.swing.event.DocumentEvent;
+
+/**
+ * A View implementation that delays loading of sub views until they are
+ * needed for display or internal transformations. This can be used for
+ * editors that need to handle large documents more effectivly than the
+ * standard {@link BoxView}.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ *
+ * @since 1.3
+ */
+public class ZoneView
+ extends BoxView
+{
+
+ /**
+ * The default zone view implementation. The specs suggest that this is
+ * a subclass of AsyncBoxView, so do we.
+ */
+ static class Zone
+ extends AsyncBoxView
+ {
+ /**
+ * The start position for this zone.
+ */
+ private Position p0;
+
+ /**
+ * The end position for this zone.
+ */
+ private Position p1;
+
+ /**
+ * Creates a new Zone for the specified element, start and end positions.
+ *
+ * @param el the element
+ * @param pos0 the start position
+ * @param pos1 the end position
+ * @param axis the major axis
+ */
+ Zone(Element el, Position pos0, Position pos1, int axis)
+ {
+ super(el, axis);
+ p0 = pos0;
+ p1 = pos1;
+ }
+
+ /**
+ * Returns the start offset of the zone.
+ *
+ * @return the start offset of the zone
+ */
+ public int getStartOffset()
+ {
+ return p0.getOffset();
+ }
+
+ /**
+ * Returns the end offset of the zone.
+ *
+ * @return the end offset of the zone
+ */
+ public int getEndOffset()
+ {
+ return p1.getOffset();
+ }
+ }
+
+ /**
+ * The maximumZoneSize.
+ */
+ private int maximumZoneSize;
+
+ /**
+ * The maximum number of loaded zones.
+ */
+ private int maxZonesLoaded;
+
+ /**
+ * A queue of loaded zones. When the number of loaded zones exceeds the
+ * maximum number of zones, the oldest zone(s) get unloaded.
+ */
+ private LinkedList loadedZones;
+
+ /**
+ * Creates a new ZoneView for the specified element and axis.
+ *
+ * @param element the element for which to create a ZoneView
+ * @param axis the major layout axis for the box
+ */
+ public ZoneView(Element element, int axis)
+ {
+ super(element, axis);
+ maximumZoneSize = 8192;
+ maxZonesLoaded = 3;
+ loadedZones = new LinkedList();
+ }
+
+ /**
+ * Sets the maximum zone size. Note that zones might still become larger
+ * then the size specified when a singe child view is larger for itself,
+ * because zones are formed on child view boundaries.
+ *
+ * @param size the maximum zone size to set
+ *
+ * @see #getMaximumZoneSize()
+ */
+ public void setMaximumZoneSize(int size)
+ {
+ maximumZoneSize = size;
+ }
+
+ /**
+ * Returns the maximum zone size. Note that zones might still become larger
+ * then the size specified when a singe child view is larger for itself,
+ * because zones are formed on child view boundaries.
+ *
+ * @return the maximum zone size
+ *
+ * @see #setMaximumZoneSize(int)
+ */
+ public int getMaximumZoneSize()
+ {
+ return maximumZoneSize;
+ }
+
+ /**
+ * Sets the maximum number of zones that are allowed to be loaded at the
+ * same time. If the new number of allowed zones is smaller then the
+ * previous settings, this unloads all zones the aren't allowed to be
+ * loaded anymore.
+ *
+ * @param num the number of zones allowed to be loaded at the same time
+ *
+ * @throws IllegalArgumentException if <code>num &lt;= 0</code>
+ *
+ * @see #getMaxZonesLoaded()
+ */
+ public void setMaxZonesLoaded(int num)
+ {
+ if (num < 1)
+ throw new IllegalArgumentException("Illegal number of zones");
+ maxZonesLoaded = num;
+ unloadOldestZones();
+ }
+
+ /**
+ * Returns the number of zones that are allowed to be loaded.
+ *
+ * @return the number of zones that are allowed to be loaded
+ *
+ * @see #setMaxZonesLoaded(int)
+ */
+ public int getMaxZonesLoaded()
+ {
+ return maxZonesLoaded;
+ }
+
+ /**
+ * Gets called after a zone has been loaded. This unloads the oldest zone(s)
+ * when the maximum number of zones is reached.
+ *
+ * @param zone the zone that has been loaded
+ */
+ protected void zoneWasLoaded(View zone)
+ {
+ loadedZones.addLast(zone);
+ unloadOldestZones();
+ }
+
+ /**
+ * This unloads the specified zone. This is implemented to simply remove
+ * all child views from that zone.
+ *
+ * @param zone the zone to be unloaded
+ */
+ protected void unloadZone(View zone)
+ {
+ zone.removeAll();
+ }
+
+ /**
+ * Returns <code>true</code> when the specified zone is loaded,
+ * <code>false</code> otherwise. The default implementation checks if
+ * the zone view has child elements.
+ *
+ * @param zone the zone view to check
+ *
+ * @return <code>true</code> when the specified zone is loaded,
+ * <code>false</code> otherwise
+ */
+ protected boolean isZoneLoaded(View zone)
+ {
+ return zone.getViewCount() > 0;
+ }
+
+ /**
+ * Creates a zone for the specified range. Subclasses can override this
+ * to provide a custom implementation for the zones.
+ *
+ * @param p0 the start of the range
+ * @param p1 the end of the range
+ *
+ * @return the zone
+ */
+ protected View createZone(int p0, int p1)
+ {
+ Document doc = getDocument();
+ Position pos0 = null;
+ Position pos1 = null;
+ try
+ {
+ pos0 = doc.createPosition(p0);
+ pos1 = doc.createPosition(p1);
+ }
+ catch (BadLocationException ex)
+ {
+ assert false : "Must not happen";
+ }
+ Zone zone = new Zone(getElement(), pos0, pos1, getAxis());
+ return zone;
+ }
+
+ // --------------------------------------------------------------------------
+ // CompositeView methods.
+ // --------------------------------------------------------------------------
+
+ /**
+ * Overridden to not load all the child views. This methods creates
+ * initial zones without actually loading them.
+ *
+ * @param vf not used
+ */
+ protected void loadChildren(ViewFactory vf)
+ {
+ int p0 = getStartOffset();
+ int p1 = getEndOffset();
+ append(createZone(p0, p1));
+ checkZoneAt(p0);
+ }
+
+ /**
+ * Returns the index of the child view at the document position
+ * <code>pos</code>.
+ *
+ * This overrides the CompositeView implementation because the ZoneView does
+ * not provide a one to one mapping from Elements to Views.
+ *
+ * @param pos the document position
+ *
+ * @return the index of the child view at the document position
+ * <code>pos</code>
+ */
+ protected int getViewIndexAtPosition(int pos)
+ {
+ int index = -1;
+ boolean found = false;
+ if (pos >= getStartOffset() && pos <= getEndOffset())
+ {
+ int upper = getViewCount() - 1;
+ int lower = 0;
+ index = (upper - lower) / 2 + lower;
+ int bias = 0;
+ do
+ {
+ View child = getView(index);
+ int childStart = child.getStartOffset();
+ int childEnd = child.getEndOffset();
+ if (pos >= childStart && pos < childEnd)
+ found = true;
+ else if (pos < childStart)
+ {
+ upper = index;
+ bias = -1;
+ }
+ else if (pos >= childEnd)
+ {
+ lower = index;
+ bias = 1;
+ }
+ if (! found)
+ {
+ int newIndex = (upper - lower) / 2 + lower;
+ if (newIndex == index)
+ index = newIndex + bias;
+ else
+ index = newIndex;
+ }
+ } while (upper != lower && ! found);
+ }
+ // If no child view actually covers the specified offset, reset index to
+ // -1.
+ if (! found)
+ index = -1;
+ return index;
+ }
+
+ // --------------------------------------------------------------------------
+ // View methods.
+ // --------------------------------------------------------------------------
+
+ public void insertUpdate(DocumentEvent e, Shape a, ViewFactory vf)
+ {
+ // TODO: Implement this.
+ }
+
+ public void removeUpdate(DocumentEvent e, Shape a, ViewFactory vf)
+ {
+ // TODO: Implement this.
+ }
+
+ protected boolean updateChildren(DocumentEvent.ElementChange ec,
+ DocumentEvent e, ViewFactory vf)
+ {
+ // TODO: Implement this.
+ return false;
+ }
+
+ // --------------------------------------------------------------------------
+ // Internal helper methods.
+ // --------------------------------------------------------------------------
+
+ /**
+ * A helper method to unload the oldest zones when there are more loaded
+ * zones then allowed.
+ */
+ private void unloadOldestZones()
+ {
+ int maxZones = getMaxZonesLoaded();
+ while (loadedZones.size() > maxZones)
+ {
+ View zone = (View) loadedZones.removeFirst();
+ unloadZone(zone);
+ }
+ }
+
+ /**
+ * Checks if the zone view at position <code>pos</code> should be split
+ * (its size is greater than maximumZoneSize) and tries to split it.
+ *
+ * @param pos the document position to check
+ */
+ private void checkZoneAt(int pos)
+ {
+ int viewIndex = getViewIndexAtPosition(pos); //, Position.Bias.Forward);
+ View view = getView(viewIndex);
+ int p0 = view.getStartOffset();
+ int p1 = view.getEndOffset();
+ if (p1 - p0 > maximumZoneSize)
+ splitZone(viewIndex, p0, p1);
+ }
+
+ /**
+ * Tries to break the view at the specified index and inside the specified
+ * range into pieces that are acceptable with respect to the maximum zone
+ * size.
+ *
+ * @param index the index of the view to split
+ * @param p0 the start offset
+ * @param p1 the end offset
+ */
+ private void splitZone(int index, int p0, int p1)
+ {
+ ArrayList newZones = new ArrayList();
+ int p = p0;
+ do
+ {
+ p0 = p;
+ p = Math.min(getPreferredZoneEnd(p0), p1);
+ newZones.add(createZone(p0, p));
+ } while (p < p1);
+ View[] newViews = new View[newZones.size()];
+ newViews = (View[]) newZones.toArray(newViews);
+ replace(index, 1, newViews);
+ }
+
+ /**
+ * Calculates the positions at which a zone split is performed. This
+ * tries to create zones sized close to half the maximum zone size.
+ *
+ * @param start the start offset
+ *
+ * @return the preferred end offset
+ */
+ private int getPreferredZoneEnd(int start)
+ {
+ Element el = getElement();
+ int index = el.getElementIndex(start + (maximumZoneSize / 2));
+ Element child = el.getElement(index);
+ int p0 = child.getStartOffset();
+ int p1 = child.getEndOffset();
+ int end = p1;
+ if (p0 - start > maximumZoneSize && p0 > start)
+ end = p0;
+ return end;
+ }
+}
diff --git a/libjava/classpath/javax/swing/text/html/BRView.java b/libjava/classpath/javax/swing/text/html/BRView.java
index 5521fed8edf..7d0d5164d49 100644
--- a/libjava/classpath/javax/swing/text/html/BRView.java
+++ b/libjava/classpath/javax/swing/text/html/BRView.java
@@ -44,8 +44,7 @@ import javax.swing.text.Element;
* Handled the HTML BR tag.
*/
class BRView
- extends NullView
-
+ extends InlineView
{
/**
* Creates the new BR view.
@@ -66,6 +65,6 @@ class BRView
if (axis == X_AXIS)
return ForcedBreakWeight;
else
- return BadBreakWeight;
+ return super.getBreakWeight(axis, pos, len);
}
}
diff --git a/libjava/classpath/javax/swing/text/html/BlockView.java b/libjava/classpath/javax/swing/text/html/BlockView.java
index 6274e7b1756..b05c983e922 100644
--- a/libjava/classpath/javax/swing/text/html/BlockView.java
+++ b/libjava/classpath/javax/swing/text/html/BlockView.java
@@ -38,9 +38,12 @@ exception statement from your version. */
package javax.swing.text.html;
+import gnu.javax.swing.text.html.css.Length;
+
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.Shape;
+import java.util.HashMap;
import javax.swing.SizeRequirements;
import javax.swing.event.DocumentEvent;
@@ -55,7 +58,106 @@ import javax.swing.text.ViewFactory;
*/
public class BlockView extends BoxView
{
-
+
+ /**
+ * Stores information about child positioning according to the
+ * CSS attributes position, left, right, top and bottom.
+ */
+ private static class PositionInfo
+ {
+ // TODO: Use enums when available.
+
+ /**
+ * Static positioning. This is the default and is thus rarely really
+ * used.
+ */
+ static final int STATIC = 0;
+
+ /**
+ * Relative positioning. The box is teaked relative to its static
+ * computed bounds.
+ */
+ static final int RELATIVE = 1;
+
+ /**
+ * Absolute positioning. The box is moved relative to the parent's box.
+ */
+ static final int ABSOLUTE = 2;
+
+ /**
+ * Like ABSOLUTE, with some fixation against the viewport (not yet
+ * implemented).
+ */
+ static final int FIXED = 3;
+
+ /**
+ * The type according to the constants of this class.
+ */
+ int type;
+
+ /**
+ * The left constraint, null if not set.
+ */
+ Length left;
+
+ /**
+ * The right constraint, null if not set.
+ */
+ Length right;
+
+ /**
+ * The top constraint, null if not set.
+ */
+ Length top;
+
+ /**
+ * The bottom constraint, null if not set.
+ */
+ Length bottom;
+
+ /**
+ * Creates a new PositionInfo object.
+ *
+ * @param typ the type to set
+ * @param l the left constraint
+ * @param r the right constraint
+ * @param t the top constraint
+ * @param b the bottom constraint
+ */
+ PositionInfo(int typ, Length l, Length r, Length t, Length b)
+ {
+ type = typ;
+ left = l;
+ right = r;
+ top = t;
+ bottom = b;
+ }
+ }
+
+ /**
+ * The attributes for this view.
+ */
+ private AttributeSet attributes;
+
+ /**
+ * The box painter for this view.
+ *
+ * This is package private because the TableView needs access to it.
+ */
+ StyleSheet.BoxPainter painter;
+
+ /**
+ * The width and height as specified in the stylesheet, null if not
+ * specified. The first value is the X_AXIS, the second the Y_AXIS. You
+ * can index this directly by the X_AXIS and Y_AXIS constants.
+ */
+ private Length[] cssSpans;
+
+ /**
+ * Stores additional CSS layout information.
+ */
+ private HashMap positionInfo;
+
/**
* Creates a new view that represents an html box.
* This can be used for a number of elements.
@@ -66,8 +168,10 @@ public class BlockView extends BoxView
public BlockView(Element elem, int axis)
{
super(elem, axis);
+ cssSpans = new Length[2];
+ positionInfo = new HashMap();
}
-
+
/**
* Creates the parent view for this. It is called before
* any other methods, if the parent view is working properly.
@@ -99,12 +203,27 @@ public class BlockView extends BoxView
protected SizeRequirements calculateMajorAxisRequirements(int axis,
SizeRequirements r)
{
- SizeRequirements sr = super.calculateMajorAxisRequirements(axis, r);
- // FIXME: adjust it if the CSS width or height attribute is specified
- // and applicable
- return sr;
+ if (r == null)
+ r = new SizeRequirements();
+
+ if (setCSSSpan(r, axis))
+ {
+ // If we have set the span from CSS, then we need to adjust
+ // the margins.
+ SizeRequirements parent = super.calculateMajorAxisRequirements(axis,
+ null);
+ int margin = axis == X_AXIS ? getLeftInset() + getRightInset()
+ : getTopInset() + getBottomInset();
+ r.minimum -= margin;
+ r.preferred -= margin;
+ r.maximum -= margin;
+ constrainSize(axis, r, parent);
+ }
+ else
+ r = super.calculateMajorAxisRequirements(axis, r);
+ return r;
}
-
+
/**
* Calculates the requirements along the minor axis.
* This is implemented to call the superclass and then
@@ -118,12 +237,89 @@ public class BlockView extends BoxView
protected SizeRequirements calculateMinorAxisRequirements(int axis,
SizeRequirements r)
{
- SizeRequirements sr = super.calculateMinorAxisRequirements(axis, r);
- // FIXME: adjust it if the CSS width or height attribute is specified
- // and applicable.
- return sr;
+ if (r == null)
+ r = new SizeRequirements();
+
+ if (setCSSSpan(r, axis))
+ {
+ // If we have set the span from CSS, then we need to adjust
+ // the margins.
+ SizeRequirements parent = super.calculateMinorAxisRequirements(axis,
+ null);
+ int margin = axis == X_AXIS ? getLeftInset() + getRightInset()
+ : getTopInset() + getBottomInset();
+ r.minimum -= margin;
+ r.preferred -= margin;
+ r.maximum -= margin;
+ constrainSize(axis, r, parent);
+ }
+ else
+ r = super.calculateMinorAxisRequirements(axis, r);
+
+ // Apply text alignment if appropriate.
+ if (axis == X_AXIS)
+ {
+ Object o = getAttributes().getAttribute(CSS.Attribute.TEXT_ALIGN);
+ if (o != null)
+ {
+ String al = o.toString().trim();
+ if (al.equals("center"))
+ r.alignment = 0.5f;
+ else if (al.equals("right"))
+ r.alignment = 1.0f;
+ else
+ r.alignment = 0.0f;
+ }
+ }
+ return r;
+ }
+
+ /**
+ * Sets the span on the SizeRequirements object according to the
+ * according CSS span value, when it is set.
+ *
+ * @param r the size requirements
+ * @param axis the axis
+ *
+ * @return <code>true</code> when the CSS span has been set,
+ * <code>false</code> otherwise
+ */
+ private boolean setCSSSpan(SizeRequirements r, int axis)
+ {
+ boolean ret = false;
+ Length span = cssSpans[axis];
+ // We can't set relative CSS spans here because we don't know
+ // yet about the allocated span. Instead we use the view's
+ // normal requirements.
+ if (span != null && ! span.isPercentage())
+ {
+ r.minimum = (int) span.getValue();
+ r.preferred = (int) span.getValue();
+ r.maximum = (int) span.getValue();
+ ret = true;
+ }
+ return ret;
}
-
+
+ /**
+ * Constrains the <code>r</code> requirements according to
+ * <code>min</code>.
+ *
+ * @param axis the axis
+ * @param r the requirements to constrain
+ * @param min the constraining requirements
+ */
+ private void constrainSize(int axis, SizeRequirements r,
+ SizeRequirements min)
+ {
+ if (min.minimum > r.minimum)
+ {
+ r.minimum = min.minimum;
+ r.preferred = min.minimum;
+ r.maximum = Math.max(r.maximum, min.maximum);
+ }
+ }
+
/**
* Lays out the box along the minor axis (the axis that is
* perpendicular to the axis that it represents). The results
@@ -142,10 +338,133 @@ public class BlockView extends BoxView
protected void layoutMinorAxis(int targetSpan, int axis,
int[] offsets, int[] spans)
{
- // FIXME: Not implemented.
- super.layoutMinorAxis(targetSpan, axis, offsets, spans);
+ int viewCount = getViewCount();
+ for (int i = 0; i < viewCount; i++)
+ {
+ View view = getView(i);
+ int min = (int) view.getMinimumSpan(axis);
+ int max;
+ // Handle CSS span value of child.
+ Length length = cssSpans[axis];
+ if (length != null)
+ {
+ min = Math.max((int) length.getValue(targetSpan), min);
+ max = min;
+ }
+ else
+ max = (int) view.getMaximumSpan(axis);
+
+ if (max < targetSpan)
+ {
+ // Align child.
+ float align = view.getAlignment(axis);
+ offsets[i] = (int) ((targetSpan - max) * align);
+ spans[i] = max;
+ }
+ else
+ {
+ offsets[i] = 0;
+ spans[i] = Math.max(min, targetSpan);
+ }
+
+ // Adjust according to CSS position info.
+ positionView(targetSpan, axis, i, offsets, spans);
+ }
}
-
+
+ /**
+ * Overridden to perform additional CSS layout (absolute/relative
+ * positioning).
+ */
+ protected void layoutMajorAxis(int targetSpan, int axis,
+ int[] offsets, int[] spans)
+ {
+ super.layoutMajorAxis(targetSpan, axis, offsets, spans);
+
+ // Adjust according to CSS position info.
+ int viewCount = getViewCount();
+ for (int i = 0; i < viewCount; i++)
+ {
+ positionView(targetSpan, axis, i, offsets, spans);
+ }
+ }
+
+ /**
+ * Positions a view according to any additional CSS constraints.
+ *
+ * @param targetSpan the target span
+ * @param axis the axis
+ * @param i the index of the view
+ * @param offsets the offsets get placed here
+ * @param spans the spans get placed here
+ */
+ private void positionView(int targetSpan, int axis, int i, int[] offsets,
+ int[] spans)
+ {
+ View view = getView(i);
+ PositionInfo pos = (PositionInfo) positionInfo.get(view);
+ if (pos != null)
+ {
+ int p0 = -1;
+ int p1 = -1;
+ if (axis == X_AXIS)
+ {
+ Length l = pos.left;
+ if (l != null)
+ p0 = (int) l.getValue(targetSpan);
+ l = pos.right;
+ if (l != null)
+ p1 = (int) l.getValue(targetSpan);
+ }
+ else
+ {
+ Length l = pos.top;
+ if (l != null)
+ p0 = (int) l.getValue(targetSpan);
+ l = pos.bottom;
+ if (l != null)
+ p1 = (int) l.getValue(targetSpan);
+ }
+ if (pos.type == PositionInfo.ABSOLUTE
+ || pos.type == PositionInfo.FIXED)
+ {
+ if (p0 != -1)
+ {
+ offsets[i] = p0;
+ if (p1 != -1)
+ {
+ // Overrides computed width. (Possibly overconstrained
+ // when the width attribute was set too.)
+ spans[i] = targetSpan - p1 - offsets[i];
+ }
+ }
+ else if (p1 != -1)
+ {
+ // Preserve any computed width.
+ offsets[i] = targetSpan - p1 - spans[i];
+ }
+ }
+ else if (pos.type == PositionInfo.RELATIVE)
+ {
+ if (p0 != -1)
+ {
+ offsets[i] += p0;
+ if (p1 != -1)
+ {
+ // Overrides computed width. (Possibly overconstrained
+ // when the width attribute was set too.)
+ spans[i] = spans[i] - p0 - p1 - offsets[i];
+ }
+ }
+ else if (p1 != -1)
+ {
+ // Preserve any computed width.
+ offsets[i] -= p1;
+ }
+ }
+ }
+ }
+
/**
* Paints using the given graphics configuration and shape.
* This delegates to the css box painter to paint the
@@ -156,14 +475,16 @@ public class BlockView extends BoxView
*/
public void paint(Graphics g, Shape a)
{
- Rectangle rect = (Rectangle) a;
- // FIXME: not fully implemented
- getStyleSheet().getBoxPainter(getAttributes()).paint(g, rect.x, rect.y,
- rect.width,
- rect.height, this);
+ Rectangle rect = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
+
+ // Debug output. Shows blocks in green rectangles.
+ // g.setColor(Color.GREEN);
+ // g.drawRect(rect.x, rect.y, rect.width, rect.height);
+
+ painter.paint(g, rect.x, rect.y, rect.width, rect.height, this);
super.paint(g, a);
}
-
+
/**
* Fetches the attributes to use when painting.
*
@@ -171,7 +492,9 @@ public class BlockView extends BoxView
*/
public AttributeSet getAttributes()
{
- return getStyleSheet().getViewAttributes(this);
+ if (attributes == null)
+ attributes = getStyleSheet().getViewAttributes(this);
+ return attributes;
}
/**
@@ -200,14 +523,17 @@ public class BlockView extends BoxView
public float getAlignment(int axis)
{
if (axis == X_AXIS)
- return 0.0F;
+ return super.getAlignment(axis);
if (axis == Y_AXIS)
{
if (getViewCount() == 0)
return 0.0F;
float prefHeight = getPreferredSpan(Y_AXIS);
- float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS);
- return (firstRowHeight / 2.F) / prefHeight;
+ View first = getView(0);
+ float firstRowHeight = first.getPreferredSpan(Y_AXIS);
+ return prefHeight != 0 ? (firstRowHeight * first.getAlignment(Y_AXIS))
+ / prefHeight
+ : 0;
}
throw new IllegalArgumentException("Invalid Axis");
}
@@ -227,7 +553,8 @@ public class BlockView extends BoxView
// If more elements were added, then need to set the properties for them
int currPos = ev.getOffset();
- if (currPos <= getStartOffset() && (currPos + ev.getLength()) >= getEndOffset())
+ if (currPos <= getStartOffset()
+ && (currPos + ev.getLength()) >= getEndOffset())
setPropertiesFromAttributes();
}
@@ -284,9 +611,33 @@ public class BlockView extends BoxView
*/
protected void setPropertiesFromAttributes()
{
- // FIXME: Not implemented (need to use StyleSheet).
+ // Fetch attributes.
+ StyleSheet ss = getStyleSheet();
+ attributes = ss.getViewAttributes(this);
+
+ // Fetch painter.
+ painter = ss.getBoxPainter(attributes);
+
+ // Update insets.
+ if (attributes != null)
+ {
+ setInsets((short) painter.getInset(TOP, this),
+ (short) painter.getInset(LEFT, this),
+ (short) painter.getInset(BOTTOM, this),
+ (short) painter.getInset(RIGHT, this));
+ }
+
+ // Fetch width and height.
+ float emBase = ss.getEMBase(attributes);
+ float exBase = ss.getEXBase(attributes);
+ cssSpans[X_AXIS] = (Length) attributes.getAttribute(CSS.Attribute.WIDTH);
+ if (cssSpans[X_AXIS] != null)
+ cssSpans[X_AXIS].setFontBases(emBase, exBase);
+ cssSpans[Y_AXIS] = (Length) attributes.getAttribute(CSS.Attribute.HEIGHT);
+ if (cssSpans[Y_AXIS] != null)
+ cssSpans[Y_AXIS].setFontBases(emBase, exBase);
}
-
+
/**
* Gets the default style sheet.
*
@@ -294,8 +645,77 @@ public class BlockView extends BoxView
*/
protected StyleSheet getStyleSheet()
{
- StyleSheet styleSheet = new StyleSheet();
- styleSheet.importStyleSheet(getClass().getResource(HTMLEditorKit.DEFAULT_CSS));
- return styleSheet;
+ HTMLDocument doc = (HTMLDocument) getDocument();
+ return doc.getStyleSheet();
+ }
+
+ /**
+ * Overridden to fetch additional CSS layout information.
+ */
+ public void replace(int offset, int length, View[] views)
+ {
+ // First remove unneeded stuff.
+ for (int i = 0; i < length; i++)
+ {
+ View child = getView(i + offset);
+ positionInfo.remove(child);
+ }
+
+ // Call super to actually replace the views.
+ super.replace(offset, length, views);
+
+ // Now fetch the position infos for the new views.
+ for (int i = 0; i < views.length; i++)
+ {
+ fetchLayoutInfo(views[i]);
+ }
+ }
+
+ /**
+ * Fetches and stores the layout info for the specified view.
+ *
+ * @param view the view for which the layout info is stored
+ */
+ private void fetchLayoutInfo(View view)
+ {
+ AttributeSet atts = view.getAttributes();
+ Object o = atts.getAttribute(CSS.Attribute.POSITION);
+ if (o != null && o instanceof String && ! o.equals("static"))
+ {
+ int type;
+ if (o.equals("relative"))
+ type = PositionInfo.RELATIVE;
+ else if (o.equals("absolute"))
+ type = PositionInfo.ABSOLUTE;
+ else if (o.equals("fixed"))
+ type = PositionInfo.FIXED;
+ else
+ type = PositionInfo.STATIC;
+
+ if (type != PositionInfo.STATIC)
+ {
+ StyleSheet ss = getStyleSheet();
+ float emBase = ss.getEMBase(atts);
+ float exBase = ss.getEXBase(atts);
+ Length left = (Length) atts.getAttribute(CSS.Attribute.LEFT);
+ if (left != null)
+ left.setFontBases(emBase, exBase);
+ Length right = (Length) atts.getAttribute(CSS.Attribute.RIGHT);
+ if (right != null)
+ right.setFontBases(emBase, exBase);
+ Length top = (Length) atts.getAttribute(CSS.Attribute.TOP);
+ if (top != null)
+ top.setFontBases(emBase, exBase);
+ Length bottom = (Length) atts.getAttribute(CSS.Attribute.BOTTOM);
+ if (bottom != null)
+ bottom.setFontBases(emBase, exBase);
+ if (left != null || right != null || top != null || bottom != null)
+ {
+ PositionInfo pos = new PositionInfo(type, left, right, top,
+ bottom);
+ positionInfo.put(view, pos);
+ }
+ }
+ }
}
}
diff --git a/libjava/classpath/javax/swing/text/html/CSS.java b/libjava/classpath/javax/swing/text/html/CSS.java
index c248e758ec2..77f94a60878 100644
--- a/libjava/classpath/javax/swing/text/html/CSS.java
+++ b/libjava/classpath/javax/swing/text/html/CSS.java
@@ -37,8 +37,19 @@ exception statement from your version. */
package javax.swing.text.html;
+import gnu.javax.swing.text.html.css.BorderStyle;
+import gnu.javax.swing.text.html.css.BorderWidth;
+import gnu.javax.swing.text.html.css.CSSColor;
+import gnu.javax.swing.text.html.css.FontSize;
+import gnu.javax.swing.text.html.css.FontStyle;
+import gnu.javax.swing.text.html.css.FontWeight;
+import gnu.javax.swing.text.html.css.Length;
+
import java.io.Serializable;
import java.util.HashMap;
+import java.util.StringTokenizer;
+
+import javax.swing.text.MutableAttributeSet;
/**
* Provides CSS attributes to be used by the HTML view classes. The constants
@@ -388,6 +399,36 @@ public class CSS implements Serializable
public static final Attribute WORD_SPACING =
new Attribute("word-spacing", true, "normal");
+ // Some GNU Classpath specific extensions.
+ static final Attribute BORDER_TOP_STYLE =
+ new Attribute("border-top-style", false, null);
+ static final Attribute BORDER_BOTTOM_STYLE =
+ new Attribute("border-bottom-style", false, null);
+ static final Attribute BORDER_LEFT_STYLE =
+ new Attribute("border-left-style", false, null);
+ static final Attribute BORDER_RIGHT_STYLE =
+ new Attribute("border-right-style", false, null);
+ static final Attribute BORDER_TOP_COLOR =
+ new Attribute("border-top-color", false, null);
+ static final Attribute BORDER_BOTTOM_COLOR =
+ new Attribute("border-bottom-color", false, null);
+ static final Attribute BORDER_LEFT_COLOR =
+ new Attribute("border-left-color", false, null);
+ static final Attribute BORDER_RIGHT_COLOR =
+ new Attribute("border-right-color", false, null);
+ static final Attribute BORDER_SPACING =
+ new Attribute("border-spacing", false, null);
+ static final Attribute POSITION =
+ new Attribute("position", false, null);
+ static final Attribute LEFT =
+ new Attribute("left", false, null);
+ static final Attribute RIGHT =
+ new Attribute("right", false, null);
+ static final Attribute TOP =
+ new Attribute("top", false, null);
+ static final Attribute BOTTOM =
+ new Attribute("bottom", false, null);
+
/**
* The attribute string.
*/
@@ -459,4 +500,237 @@ public class CSS implements Serializable
return defaultValue;
}
}
+
+ /**
+ * Maps attribute values (String) to some converter class, based on the
+ * key.
+ *
+ * @param att the key
+ * @param v the value
+ *
+ * @return the wrapped value
+ */
+ static Object getValue(Attribute att, String v)
+ {
+ Object o;
+ if (att == Attribute.FONT_SIZE)
+ o = new FontSize(v);
+ else if (att == Attribute.FONT_WEIGHT)
+ o = new FontWeight(v);
+ else if (att == Attribute.FONT_STYLE)
+ o = new FontStyle(v);
+ else if (att == Attribute.COLOR || att == Attribute.BACKGROUND_COLOR
+ || att == Attribute.BORDER_COLOR
+ || att == Attribute.BORDER_TOP_COLOR
+ || att == Attribute.BORDER_BOTTOM_COLOR
+ || att == Attribute.BORDER_LEFT_COLOR
+ || att == Attribute.BORDER_RIGHT_COLOR)
+ o = new CSSColor(v);
+ else if (att == Attribute.MARGIN || att == Attribute.MARGIN_BOTTOM
+ || att == Attribute.MARGIN_LEFT || att == Attribute.MARGIN_RIGHT
+ || att == Attribute.MARGIN_TOP || att == Attribute.WIDTH
+ || att == Attribute.HEIGHT
+ || att == Attribute.PADDING || att == Attribute.PADDING_BOTTOM
+ || att == Attribute.PADDING_LEFT || att == Attribute.PADDING_RIGHT
+ || att == Attribute.PADDING_TOP
+ || att == Attribute.LEFT || att == Attribute.RIGHT
+ || att == Attribute.TOP || att == Attribute.BOTTOM)
+ o = new Length(v);
+ else if (att == Attribute.BORDER_WIDTH || att == Attribute.BORDER_TOP_WIDTH
+ || att == Attribute.BORDER_LEFT_WIDTH
+ || att == Attribute.BORDER_RIGHT_WIDTH
+ || att == Attribute.BORDER_BOTTOM_WIDTH)
+ o = new BorderWidth(v);
+ else
+ o = v;
+ return o;
+ }
+
+ static void addInternal(MutableAttributeSet atts, Attribute a, String v)
+ {
+ if (a == Attribute.BACKGROUND)
+ parseBackgroundShorthand(atts, v);
+ else if (a == Attribute.PADDING)
+ parsePaddingShorthand(atts, v);
+ else if (a == Attribute.MARGIN)
+ parseMarginShorthand(atts, v);
+ else if (a == Attribute.BORDER || a == Attribute.BORDER_LEFT
+ || a == Attribute.BORDER_RIGHT || a == Attribute.BORDER_TOP
+ || a == Attribute.BORDER_BOTTOM)
+ parseBorderShorthand(atts, v, a);
+ }
+
+ /**
+ * Parses the background shorthand and translates it to more specific
+ * background attributes.
+ *
+ * @param atts the attributes
+ * @param v the value
+ */
+ private static void parseBackgroundShorthand(MutableAttributeSet atts,
+ String v)
+ {
+ StringTokenizer tokens = new StringTokenizer(v, " ");
+ while (tokens.hasMoreElements())
+ {
+ String token = tokens.nextToken();
+ if (CSSColor.isValidColor(token))
+ atts.addAttribute(Attribute.BACKGROUND_COLOR,
+ new CSSColor(token));
+ }
+ }
+
+ /**
+ * Parses the padding shorthand and translates to the specific padding
+ * values.
+ *
+ * @param atts the attributes
+ * @param v the actual value
+ */
+ private static void parsePaddingShorthand(MutableAttributeSet atts, String v)
+ {
+ StringTokenizer tokens = new StringTokenizer(v, " ");
+ int numTokens = tokens.countTokens();
+ if (numTokens == 1)
+ {
+ Length l = new Length(tokens.nextToken());
+ atts.addAttribute(Attribute.PADDING_BOTTOM, l);
+ atts.addAttribute(Attribute.PADDING_LEFT, l);
+ atts.addAttribute(Attribute.PADDING_RIGHT, l);
+ atts.addAttribute(Attribute.PADDING_TOP, l);
+ }
+ else if (numTokens == 2)
+ {
+ Length l1 = new Length(tokens.nextToken());
+ Length l2 = new Length(tokens.nextToken());
+ atts.addAttribute(Attribute.PADDING_BOTTOM, l1);
+ atts.addAttribute(Attribute.PADDING_TOP, l1);
+ atts.addAttribute(Attribute.PADDING_LEFT, l2);
+ atts.addAttribute(Attribute.PADDING_RIGHT, l2);
+ }
+ else if (numTokens == 3)
+ {
+ Length l1 = new Length(tokens.nextToken());
+ Length l2 = new Length(tokens.nextToken());
+ Length l3 = new Length(tokens.nextToken());
+ atts.addAttribute(Attribute.PADDING_TOP, l1);
+ atts.addAttribute(Attribute.PADDING_LEFT, l2);
+ atts.addAttribute(Attribute.PADDING_RIGHT, l2);
+ atts.addAttribute(Attribute.PADDING_BOTTOM, l3);
+ }
+ else
+ {
+ Length l1 = new Length(tokens.nextToken());
+ Length l2 = new Length(tokens.nextToken());
+ Length l3 = new Length(tokens.nextToken());
+ Length l4 = new Length(tokens.nextToken());
+ atts.addAttribute(Attribute.PADDING_TOP, l1);
+ atts.addAttribute(Attribute.PADDING_RIGHT, l2);
+ atts.addAttribute(Attribute.PADDING_BOTTOM, l3);
+ atts.addAttribute(Attribute.PADDING_LEFT, l4);
+ }
+ }
+
+ /**
+ * Parses the margin shorthand and translates to the specific margin
+ * values.
+ *
+ * @param atts the attributes
+ * @param v the actual value
+ */
+ private static void parseMarginShorthand(MutableAttributeSet atts, String v)
+ {
+ StringTokenizer tokens = new StringTokenizer(v, " ");
+ int numTokens = tokens.countTokens();
+ if (numTokens == 1)
+ {
+ Length l = new Length(tokens.nextToken());
+ atts.addAttribute(Attribute.MARGIN_BOTTOM, l);
+ atts.addAttribute(Attribute.MARGIN_LEFT, l);
+ atts.addAttribute(Attribute.MARGIN_RIGHT, l);
+ atts.addAttribute(Attribute.MARGIN_TOP, l);
+ }
+ else if (numTokens == 2)
+ {
+ Length l1 = new Length(tokens.nextToken());
+ Length l2 = new Length(tokens.nextToken());
+ atts.addAttribute(Attribute.MARGIN_BOTTOM, l1);
+ atts.addAttribute(Attribute.MARGIN_TOP, l1);
+ atts.addAttribute(Attribute.MARGIN_LEFT, l2);
+ atts.addAttribute(Attribute.MARGIN_RIGHT, l2);
+ }
+ else if (numTokens == 3)
+ {
+ Length l1 = new Length(tokens.nextToken());
+ Length l2 = new Length(tokens.nextToken());
+ Length l3 = new Length(tokens.nextToken());
+ atts.addAttribute(Attribute.MARGIN_TOP, l1);
+ atts.addAttribute(Attribute.MARGIN_LEFT, l2);
+ atts.addAttribute(Attribute.MARGIN_RIGHT, l2);
+ atts.addAttribute(Attribute.MARGIN_BOTTOM, l3);
+ }
+ else
+ {
+ Length l1 = new Length(tokens.nextToken());
+ Length l2 = new Length(tokens.nextToken());
+ Length l3 = new Length(tokens.nextToken());
+ Length l4 = new Length(tokens.nextToken());
+ atts.addAttribute(Attribute.MARGIN_TOP, l1);
+ atts.addAttribute(Attribute.MARGIN_RIGHT, l2);
+ atts.addAttribute(Attribute.MARGIN_BOTTOM, l3);
+ atts.addAttribute(Attribute.MARGIN_LEFT, l4);
+ }
+ }
+
+ /**
+ * Parses the CSS border shorthand attribute and translates it to the
+ * more specific border attributes.
+ *
+ * @param atts the attribute
+ * @param value the value
+ */
+ private static void parseBorderShorthand(MutableAttributeSet atts,
+ String value, Attribute cssAtt)
+ {
+ StringTokenizer tokens = new StringTokenizer(value, " ");
+ while (tokens.hasMoreTokens())
+ {
+ String token = tokens.nextToken();
+ if (BorderStyle.isValidStyle(token))
+ {
+ if (cssAtt == Attribute.BORDER_LEFT || cssAtt == Attribute.BORDER)
+ atts.addAttribute(Attribute.BORDER_LEFT_STYLE, token);
+ if (cssAtt == Attribute.BORDER_RIGHT || cssAtt == Attribute.BORDER)
+ atts.addAttribute(Attribute.BORDER_RIGHT_STYLE, token);
+ if (cssAtt == Attribute.BORDER_BOTTOM || cssAtt == Attribute.BORDER)
+ atts.addAttribute(Attribute.BORDER_BOTTOM_STYLE, token);
+ if (cssAtt == Attribute.BORDER_TOP || cssAtt == Attribute.BORDER)
+ atts.addAttribute(Attribute.BORDER_TOP_STYLE, token);
+ }
+ else if (BorderWidth.isValid(token))
+ {
+ BorderWidth w = new BorderWidth(token);
+ if (cssAtt == Attribute.BORDER_LEFT || cssAtt == Attribute.BORDER)
+ atts.addAttribute(Attribute.BORDER_LEFT_WIDTH, w);
+ if (cssAtt == Attribute.BORDER_RIGHT || cssAtt == Attribute.BORDER)
+ atts.addAttribute(Attribute.BORDER_RIGHT_WIDTH, w);
+ if (cssAtt == Attribute.BORDER_BOTTOM || cssAtt == Attribute.BORDER)
+ atts.addAttribute(Attribute.BORDER_BOTTOM_WIDTH, w);
+ if (cssAtt == Attribute.BORDER_TOP || cssAtt == Attribute.BORDER)
+ atts.addAttribute(Attribute.BORDER_TOP_WIDTH, w);
+ }
+ else if (CSSColor.isValidColor(token))
+ {
+ CSSColor c = new CSSColor(token);
+ if (cssAtt == Attribute.BORDER_LEFT || cssAtt == Attribute.BORDER)
+ atts.addAttribute(Attribute.BORDER_LEFT_COLOR, c);
+ if (cssAtt == Attribute.BORDER_RIGHT || cssAtt == Attribute.BORDER)
+ atts.addAttribute(Attribute.BORDER_RIGHT_COLOR, c);
+ if (cssAtt == Attribute.BORDER_BOTTOM || cssAtt == Attribute.BORDER)
+ atts.addAttribute(Attribute.BORDER_BOTTOM_COLOR, c);
+ if (cssAtt == Attribute.BORDER_TOP || cssAtt == Attribute.BORDER)
+ atts.addAttribute(Attribute.BORDER_TOP_COLOR, c);
+ }
+ }
+ }
}
diff --git a/libjava/classpath/javax/swing/text/html/CSSBorder.java b/libjava/classpath/javax/swing/text/html/CSSBorder.java
new file mode 100644
index 00000000000..fff6b01a170
--- /dev/null
+++ b/libjava/classpath/javax/swing/text/html/CSSBorder.java
@@ -0,0 +1,421 @@
+/* CSSBorder.java -- A border for rendering CSS border styles
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.text.html;
+
+import gnu.javax.swing.text.html.css.BorderWidth;
+import gnu.javax.swing.text.html.css.CSSColor;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
+
+import javax.swing.border.Border;
+import javax.swing.text.AttributeSet;
+
+/**
+ * A border implementation to render CSS border styles.
+ */
+class CSSBorder
+ implements Border
+{
+
+ /**
+ * The CSS border styles.
+ */
+
+ private static final int STYLE_NOT_SET = -1;
+ private static final int STYLE_NONE = 0;
+ private static final int STYLE_HIDDEN = 1;
+ private static final int STYLE_DOTTED = 2;
+ private static final int STYLE_DASHED = 3;
+ private static final int STYLE_SOLID = 4;
+ private static final int STYLE_DOUBLE = 5;
+ private static final int STYLE_GROOVE = 6;
+ private static final int STYLE_RIDGE = 7;
+ private static final int STYLE_INSET = 8;
+ private static final int STYLE_OUTSET = 9;
+
+ /**
+ * The left insets.
+ */
+ private int left;
+
+ /**
+ * The right insets.
+ */
+ private int right;
+
+ /**
+ * The top insets.
+ */
+ private int top;
+
+ /**
+ * The bottom insets.
+ */
+ private int bottom;
+
+ /**
+ * The border style on the left.
+ */
+ private int leftStyle;
+
+ /**
+ * The border style on the right.
+ */
+ private int rightStyle;
+
+ /**
+ * The border style on the top.
+ */
+ private int topStyle;
+
+ /**
+ * The color for the top border.
+ */
+ private Color topColor;
+
+ /**
+ * The color for the bottom border.
+ */
+ private Color bottomColor;
+
+ /**
+ * The color for the left border.
+ */
+ private Color leftColor;
+
+ /**
+ * The color for the right border.
+ */
+ private Color rightColor;
+
+ /**
+ * The border style on the bottom.
+ */
+ private int bottomStyle;
+
+ /**
+ * Creates a new CSS border and fetches its attributes from the specified
+ * attribute set.
+ *
+ * @param atts the attribute set that contains the border spec
+ */
+ CSSBorder(AttributeSet atts, StyleSheet ss)
+ {
+ // Determine the border styles.
+ int style = getBorderStyle(atts, CSS.Attribute.BORDER_STYLE);
+ if (style == STYLE_NOT_SET)
+ style = STYLE_NONE; // Default to none.
+ topStyle = bottomStyle = leftStyle = rightStyle = style;
+ style = getBorderStyle(atts, CSS.Attribute.BORDER_TOP_STYLE);
+ if (style != STYLE_NOT_SET)
+ topStyle = style;
+ style = getBorderStyle(atts, CSS.Attribute.BORDER_BOTTOM_STYLE);
+ if (style != STYLE_NOT_SET)
+ bottomStyle = style;
+ style = getBorderStyle(atts, CSS.Attribute.BORDER_LEFT_STYLE);
+ if (style != STYLE_NOT_SET)
+ leftStyle = style;
+ style = getBorderStyle(atts, CSS.Attribute.BORDER_RIGHT_STYLE);
+ if (style != STYLE_NOT_SET)
+ rightStyle = style;
+
+ // Determine the border colors.
+ Color color = getBorderColor(atts, CSS.Attribute.BORDER_COLOR);
+ if (color == null)
+ color = Color.BLACK;
+ topColor = bottomColor = leftColor = rightColor = color;
+ color = getBorderColor(atts, CSS.Attribute.BORDER_TOP_COLOR);
+ if (color != null)
+ topColor = color;
+ color = getBorderColor(atts, CSS.Attribute.BORDER_BOTTOM_COLOR);
+ if (color != null)
+ bottomColor = color;
+ color = getBorderColor(atts, CSS.Attribute.BORDER_LEFT_COLOR);
+ if (color != null)
+ leftColor = color;
+ color = getBorderColor(atts, CSS.Attribute.BORDER_RIGHT_COLOR);
+ if (color != null)
+ rightColor = color;
+
+ // Determine the border widths.
+ int width = getBorderWidth(atts, CSS.Attribute.BORDER_WIDTH, ss);
+ if (width == -1)
+ width = 0;
+ top = bottom = left = right = width;
+ width = getBorderWidth(atts, CSS.Attribute.BORDER_TOP_WIDTH, ss);
+ if (width >= 0)
+ top = width;
+ width = getBorderWidth(atts, CSS.Attribute.BORDER_BOTTOM_WIDTH, ss);
+ if (width >= 0)
+ bottom = width;
+ width = getBorderWidth(atts, CSS.Attribute.BORDER_LEFT_WIDTH, ss);
+ if (width >= 0)
+ left = width;
+ width = getBorderWidth(atts, CSS.Attribute.BORDER_RIGHT_WIDTH, ss);
+ if (width >= 0)
+ right = width;
+ }
+
+ /**
+ * Determines the border style for a given CSS attribute.
+ *
+ * @param atts the attribute set
+ * @param key the CSS key
+ *
+ * @return the border style according to the constants defined in this class
+ */
+ private int getBorderStyle(AttributeSet atts, CSS.Attribute key)
+ {
+ int style = STYLE_NOT_SET;
+ Object o = atts.getAttribute(key);
+ if (o != null)
+ {
+ String cssStyle = o.toString();
+ if (cssStyle.equals("none"))
+ style = STYLE_NONE;
+ else if (cssStyle.equals("hidden"))
+ style = STYLE_HIDDEN;
+ else if (cssStyle.equals("dotted"))
+ style = STYLE_DOTTED;
+ else if (cssStyle.equals("dashed"))
+ style = STYLE_DASHED;
+ else if (cssStyle.equals("solid"))
+ style = STYLE_SOLID;
+ else if (cssStyle.equals("double"))
+ style = STYLE_DOUBLE;
+ else if (cssStyle.equals("groove"))
+ style = STYLE_GROOVE;
+ else if (cssStyle.equals("ridge"))
+ style = STYLE_RIDGE;
+ else if (cssStyle.equals("inset"))
+ style = STYLE_INSET;
+ else if (cssStyle.equals("outset"))
+ style = STYLE_OUTSET;
+ }
+ return style;
+ }
+
+ /**
+ * Determines the border color for the specified key.
+ *
+ * @param atts the attribute set from which to fetch the color
+ * @param key the CSS key
+ *
+ * @return the border color
+ */
+ private Color getBorderColor(AttributeSet atts, CSS.Attribute key)
+ {
+ Object o = atts.getAttribute(key);
+ Color color = null;
+ if (o instanceof CSSColor)
+ {
+ CSSColor cssColor = (CSSColor) o;
+ color = cssColor.getValue();
+ }
+ return color;
+ }
+
+ /**
+ * Returns the width for the specified key.
+ *
+ * @param atts the attributes to fetch the width from
+ * @param key the CSS key
+ *
+ * @return the width, or -1 of none has been set
+ */
+ private int getBorderWidth(AttributeSet atts, CSS.Attribute key,
+ StyleSheet ss)
+ {
+ int width = -1;
+ Object o = atts.getAttribute(key);
+ if (o instanceof BorderWidth)
+ {
+ BorderWidth w = (BorderWidth) o;
+ w.setFontBases(ss.getEMBase(atts), ss.getEXBase(atts));
+ width = (int) ((BorderWidth) o).getValue();
+ }
+ return width;
+ }
+
+ /**
+ * Returns the border insets.
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ return new Insets(top, left, bottom, right);
+ }
+
+ /**
+ * CSS borders are generally opaque so return true here.
+ */
+ public boolean isBorderOpaque()
+ {
+ return true;
+ }
+
+ public void paintBorder(Component c, Graphics g, int x, int y, int width,
+ int height)
+ {
+ // Top border.
+ paintBorderLine(g, x, y + top / 2, x + width, y + top / 2, topStyle, top,
+ topColor, false);
+ // Left border.
+ paintBorderLine(g, x + left / 2, y, x + left / 2, y + height, leftStyle,
+ left, leftColor, true);
+ // Bottom border.
+ paintBorderLine(g, x, y + height - bottom / 2, x + width,
+ y + height - bottom / 2, topStyle, bottom, bottomColor,
+ false);
+ // Right border.
+ paintBorderLine(g, x + width - right / 2, y, x + width - right / 2,
+ y + height, topStyle, right, rightColor, true);
+
+ }
+
+ private void paintBorderLine(Graphics g, int x1, int y1, int x2, int y2,
+ int style, int width, Color color,
+ boolean vertical)
+ {
+ switch (style)
+ {
+ case STYLE_DOTTED:
+ paintDottedLine(g, x1, y1, x2, y2, width, color, vertical);
+ break;
+ case STYLE_DASHED:
+ paintDashedLine(g, x1, y1, x2, y2, width, color, vertical);
+ break;
+ case STYLE_SOLID:
+ paintSolidLine(g, x1, y1, x2, y2, width, color, vertical);
+ break;
+ case STYLE_DOUBLE:
+ paintDoubleLine(g, x1, y1, x2, y2, width, color, vertical);
+ break;
+ case STYLE_GROOVE:
+ paintGrooveLine(g, x1, y1, x2, y2, width, color, vertical);
+ break;
+ case STYLE_RIDGE:
+ paintRidgeLine(g, x1, y1, x2, y2, width, color, vertical);
+ break;
+ case STYLE_OUTSET:
+ paintOutsetLine(g, x1, y1, x2, y2, width, color, vertical);
+ break;
+ case STYLE_INSET:
+ paintInsetLine(g, x1, y1, x2, y2, width, color, vertical);
+ break;
+ case STYLE_NONE:
+ case STYLE_HIDDEN:
+ default:
+ // Nothing to do in these cases.
+ }
+ }
+
+ private void paintDottedLine(Graphics g, int x1, int y1, int x2, int y2,
+ int width, Color color, boolean vertical)
+ {
+ // FIXME: Implement this.
+ paintSolidLine(g, x1, y1, x2, y2, width, color, vertical);
+ }
+
+ private void paintDashedLine(Graphics g, int x1, int y1, int x2, int y2,
+ int width, Color color, boolean vertical)
+ {
+ // FIXME: Implement this.
+ paintSolidLine(g, x1, y1, x2, y2, width, color, vertical);
+ }
+
+ private void paintSolidLine(Graphics g, int x1, int y1, int x2, int y2,
+ int width, Color color, boolean vertical)
+ {
+ int x = Math.min(x1, x2);
+ int y = Math.min(y1, y1);
+ int w = Math.abs(x2 - x1);
+ int h = Math.abs(y2 - y1);
+ if (vertical)
+ {
+ w = width;
+ x -= width / 2;
+ }
+ else
+ {
+ h = width;
+ y -= width / 2;
+ }
+ g.setColor(color);
+ g.fillRect(x, y, w, h);
+ }
+
+ private void paintDoubleLine(Graphics g, int x1, int y1, int x2, int y2,
+ int width, Color color, boolean vertical)
+ {
+ // FIXME: Implement this.
+ paintSolidLine(g, x1, y1, x2, y2, width, color, vertical);
+ }
+
+ private void paintGrooveLine(Graphics g, int x1, int y1, int x2, int y2,
+ int width, Color color, boolean vertical)
+ {
+ // FIXME: Implement this.
+ paintSolidLine(g, x1, y1, x2, y2, width, color, vertical);
+ }
+
+ private void paintRidgeLine(Graphics g, int x1, int y1, int x2, int y2,
+ int width, Color color, boolean vertical)
+ {
+ // FIXME: Implement this.
+ paintSolidLine(g, x1, y1, x2, y2, width, color, vertical);
+ }
+
+ private void paintOutsetLine(Graphics g, int x1, int y1, int x2, int y2,
+ int width, Color color, boolean vertical)
+ {
+ // FIXME: Implement this.
+ paintSolidLine(g, x1, y1, x2, y2, width, color, vertical);
+ }
+
+ private void paintInsetLine(Graphics g, int x1, int y1, int x2, int y2,
+ int width, Color color, boolean vertical)
+ {
+ // FIXME: Implement this.
+ paintSolidLine(g, x1, y1, x2, y2, width, color, vertical);
+ }
+
+}
diff --git a/libjava/classpath/javax/swing/text/html/FormSubmitEvent.java b/libjava/classpath/javax/swing/text/html/FormSubmitEvent.java
new file mode 100644
index 00000000000..bc7c36f4b27
--- /dev/null
+++ b/libjava/classpath/javax/swing/text/html/FormSubmitEvent.java
@@ -0,0 +1,123 @@
+/* FormSubmitEvent.java -- Event fired on form submit
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.text.html;
+
+import java.net.URL;
+
+import javax.swing.text.Element;
+
+/**
+ * The event fired on form submit.
+ *
+ * @since 1.5
+ */
+public class FormSubmitEvent
+ extends HTMLFrameHyperlinkEvent
+{
+
+ // FIXME: Use enums when available.
+ /**
+ * The submit method.
+ */
+ public static class MethodType
+ {
+ /**
+ * Indicates a form submit with HTTP method POST.
+ */
+ public static final MethodType POST = new MethodType();
+
+ /**
+ * Indicates a form submit with HTTP method GET.
+ */
+ public static final MethodType GET = new MethodType();
+
+ private MethodType()
+ {
+ }
+ }
+
+ /**
+ * The submit method.
+ */
+ private MethodType method;
+
+ /**
+ * The actual submit data.
+ */
+ private String data;
+
+ /**
+ * Creates a new FormSubmitEvent.
+ *
+ * @param source the source
+ * @param type the type of hyperlink update
+ * @param url the action url
+ * @param el the associated element
+ * @param target the target attribute
+ * @param m the submit method
+ * @param d the submit data
+ */
+ FormSubmitEvent(Object source, EventType type, URL url, Element el,
+ String target, MethodType m, String d)
+ {
+ super(source, type, url, el, target);
+ method = m;
+ data = d;
+ }
+
+ /**
+ * Returns the submit data.
+ *
+ * @return the submit data
+ */
+ public String getData()
+ {
+ return data;
+ }
+
+ /**
+ * Returns the HTTP submit method.
+ *
+ * @return the HTTP submit method
+ */
+ public MethodType getMethod()
+ {
+ return method;
+ }
+}
diff --git a/libjava/classpath/javax/swing/text/html/FormView.java b/libjava/classpath/javax/swing/text/html/FormView.java
index d54021066d0..ef362bd3d9b 100644
--- a/libjava/classpath/javax/swing/text/html/FormView.java
+++ b/libjava/classpath/javax/swing/text/html/FormView.java
@@ -44,16 +44,36 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import javax.swing.ButtonModel;
+import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JEditorPane;
+import javax.swing.JList;
import javax.swing.JPasswordField;
import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
import javax.swing.JTextField;
+import javax.swing.ListSelectionModel;
+import javax.swing.SwingUtilities;
import javax.swing.UIManager;
+import javax.swing.event.HyperlinkEvent;
import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
import javax.swing.text.ComponentView;
+import javax.swing.text.Document;
import javax.swing.text.Element;
+import javax.swing.text.ElementIterator;
import javax.swing.text.StyleConstants;
/**
@@ -105,6 +125,231 @@ public class FormView
}
/**
+ * Actually submits the form data.
+ */
+ private class SubmitThread
+ extends Thread
+ {
+ /**
+ * The submit data.
+ */
+ private String data;
+
+ /**
+ * Creates a new SubmitThread.
+ *
+ * @param d the submit data
+ */
+ SubmitThread(String d)
+ {
+ data = d;
+ }
+
+ /**
+ * Actually performs the submit.
+ */
+ public void run()
+ {
+ if (data.length() > 0)
+ {
+ final String method = getMethod();
+ final URL actionURL = getActionURL();
+ final String target = getTarget();
+ URLConnection conn;
+ final JEditorPane editor = (JEditorPane) getContainer();
+ final HTMLDocument doc = (HTMLDocument) editor.getDocument();
+ HTMLEditorKit kit = (HTMLEditorKit) editor.getEditorKit();
+ if (kit.isAutoFormSubmission())
+ {
+ try
+ {
+ final URL url;
+ if (method != null && method.equals("post"))
+ {
+ // Perform POST.
+ url = actionURL;
+ conn = url.openConnection();
+ postData(conn, data);
+ }
+ else
+ {
+ // Default to GET.
+ url = new URL(actionURL + "?" + data);
+ }
+ Runnable loadDoc = new Runnable()
+ {
+ public void run()
+ {
+ if (doc.isFrameDocument())
+ {
+ editor.fireHyperlinkUpdate(createSubmitEvent(method,
+ actionURL,
+ target));
+ }
+ else
+ {
+ try
+ {
+ editor.setPage(url);
+ }
+ catch (IOException ex)
+ {
+ // Oh well.
+ ex.printStackTrace();
+ }
+ }
+ }
+ };
+ SwingUtilities.invokeLater(loadDoc);
+ }
+ catch (MalformedURLException ex)
+ {
+ ex.printStackTrace();
+ }
+ catch (IOException ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ else
+ {
+ editor.fireHyperlinkUpdate(createSubmitEvent(method,actionURL,
+ target));
+ }
+ }
+ }
+
+ /**
+ * Determines the submit method.
+ *
+ * @return the submit method
+ */
+ private String getMethod()
+ {
+ AttributeSet formAtts = getFormAttributes();
+ String method = null;
+ if (formAtts != null)
+ {
+ method = (String) formAtts.getAttribute(HTML.Attribute.METHOD);
+ }
+ return method;
+ }
+
+ /**
+ * Determines the action URL.
+ *
+ * @return the action URL
+ */
+ private URL getActionURL()
+ {
+ AttributeSet formAtts = getFormAttributes();
+ HTMLDocument doc = (HTMLDocument) getElement().getDocument();
+ URL url = doc.getBase();
+ if (formAtts != null)
+ {
+ String action =
+ (String) formAtts.getAttribute(HTML.Attribute.ACTION);
+ if (action != null)
+ {
+ try
+ {
+ url = new URL(url, action);
+ }
+ catch (MalformedURLException ex)
+ {
+ url = null;
+ }
+ }
+ }
+ return url;
+ }
+
+ /**
+ * Fetches the target attribute.
+ *
+ * @return the target attribute or _self if none is present
+ */
+ private String getTarget()
+ {
+ AttributeSet formAtts = getFormAttributes();
+ String target = null;
+ if (formAtts != null)
+ {
+ target = (String) formAtts.getAttribute(HTML.Attribute.TARGET);
+ if (target != null)
+ target = target.toLowerCase();
+ }
+ if (target == null)
+ target = "_self";
+ return target;
+ }
+
+ /**
+ * Posts the form data over the specified connection.
+ *
+ * @param conn the connection
+ */
+ private void postData(URLConnection conn, String data)
+ {
+ conn.setDoOutput(true);
+ PrintWriter out = null;
+ try
+ {
+ out = new PrintWriter(new OutputStreamWriter(conn.getOutputStream()));
+ out.print(data);
+ out.flush();
+ }
+ catch (IOException ex)
+ {
+ // Deal with this!
+ ex.printStackTrace();
+ }
+ finally
+ {
+ if (out != null)
+ out.close();
+ }
+ }
+
+ /**
+ * Determines the attributes from the relevant form tag.
+ *
+ * @return the attributes from the relevant form tag, <code>null</code>
+ * when there is no form tag
+ */
+ private AttributeSet getFormAttributes()
+ {
+ AttributeSet atts = null;
+ Element form = getFormElement();
+ if (form != null)
+ atts = form.getAttributes();
+ return atts;
+ }
+
+ /**
+ * Creates the submit event that should be fired.
+ *
+ * This is package private to avoid accessor methods.
+ *
+ * @param method the submit method
+ * @param actionURL the action URL
+ * @param target the target
+ *
+ * @return the submit event
+ */
+ FormSubmitEvent createSubmitEvent(String method, URL actionURL,
+ String target)
+ {
+ FormSubmitEvent.MethodType m = "post".equals(method)
+ ? FormSubmitEvent.MethodType.POST
+ : FormSubmitEvent.MethodType.GET;
+ return new FormSubmitEvent(FormView.this,
+ HyperlinkEvent.EventType.ACTIVATED,
+ actionURL, getElement(), target, m, data);
+ }
+ }
+
+ /**
* If the value attribute of an <code>&lt;input type=&quot;submit&quot;&gt>
* tag is not specified, then this string is used.
*
@@ -125,6 +370,11 @@ public class FormView
UIManager.getString("FormView.resetButtonText");
/**
+ * If this is true, the maximum size is set to the preferred size.
+ */
+ private boolean maxIsPreferred;
+
+ /**
* Creates a new <code>FormView</code>.
*
* @param el the element that is displayed by this view.
@@ -141,39 +391,161 @@ public class FormView
{
Component comp = null;
Element el = getElement();
- Object tag = el.getAttributes().getAttribute(StyleConstants.NameAttribute);
+ AttributeSet atts = el.getAttributes();
+ Object tag = atts.getAttribute(StyleConstants.NameAttribute);
+ Object model = atts.getAttribute(StyleConstants.ModelAttribute);
if (tag.equals(HTML.Tag.INPUT))
{
- AttributeSet atts = el.getAttributes();
String type = (String) atts.getAttribute(HTML.Attribute.TYPE);
- String value = (String) atts.getAttribute(HTML.Attribute.VALUE);
if (type.equals("button"))
- comp = new JButton(value);
+ {
+ String value = (String) atts.getAttribute(HTML.Attribute.VALUE);
+ JButton b = new JButton(value);
+ if (model != null)
+ {
+ b.setModel((ButtonModel) model);
+ b.addActionListener(this);
+ }
+ comp = b;
+ maxIsPreferred = true;
+ }
else if (type.equals("checkbox"))
- comp = new JCheckBox(value);
+ {
+ if (model instanceof ResetableToggleButtonModel)
+ {
+ ResetableToggleButtonModel m =
+ (ResetableToggleButtonModel) model;
+ JCheckBox c = new JCheckBox();
+ c.setModel(m);
+ comp = c;
+ maxIsPreferred = true;
+ }
+ }
else if (type.equals("image"))
- comp = new JButton(value); // FIXME: Find out how to fetch the image.
+ {
+ String src = (String) atts.getAttribute(HTML.Attribute.SRC);
+ JButton b;
+ try
+ {
+ URL base = ((HTMLDocument) el.getDocument()).getBase();
+ URL srcURL = new URL(base, src);
+ ImageIcon icon = new ImageIcon(srcURL);
+ b = new JButton(icon);
+ }
+ catch (MalformedURLException ex)
+ {
+ b = new JButton(src);
+ }
+ if (model != null)
+ {
+ b.setModel((ButtonModel) model);
+ b.addActionListener(this);
+ }
+ comp = b;
+ maxIsPreferred = true;
+ }
else if (type.equals("password"))
- comp = new JPasswordField(value);
+ {
+ int size = HTML.getIntegerAttributeValue(atts, HTML.Attribute.SIZE,
+ -1);
+ JTextField tf = new JPasswordField();
+ if (size > 0)
+ tf.setColumns(size);
+ else
+ tf.setColumns(20);
+ if (model != null)
+ tf.setDocument((Document) model);
+ tf.addActionListener(this);
+ comp = tf;
+ maxIsPreferred = true;
+ }
else if (type.equals("radio"))
- comp = new JRadioButton(value);
+ {
+ if (model instanceof ResetableToggleButtonModel)
+ {
+ ResetableToggleButtonModel m =
+ (ResetableToggleButtonModel) model;
+ JRadioButton c = new JRadioButton();
+ c.setModel(m);
+ comp = c;
+ maxIsPreferred = true;
+ }
+ }
else if (type.equals("reset"))
{
- if (value == null || value.equals(""))
- value = RESET;
- comp = new JButton(value);
+ String value = (String) atts.getAttribute(HTML.Attribute.VALUE);
+ if (value == null)
+ value = UIManager.getString("FormView.resetButtonText");
+ JButton b = new JButton(value);
+ if (model != null)
+ {
+ b.setModel((ButtonModel) model);
+ b.addActionListener(this);
+ }
+ comp = b;
+ maxIsPreferred = true;
}
else if (type.equals("submit"))
{
- if (value == null || value.equals(""))
- value = SUBMIT;
- comp = new JButton(value);
+ String value = (String) atts.getAttribute(HTML.Attribute.VALUE);
+ if (value == null)
+ value = UIManager.getString("FormView.submitButtonText");
+ JButton b = new JButton(value);
+ if (model != null)
+ {
+ b.setModel((ButtonModel) model);
+ b.addActionListener(this);
+ }
+ comp = b;
+ maxIsPreferred = true;
}
else if (type.equals("text"))
- comp = new JTextField(value);
-
+ {
+ int size = HTML.getIntegerAttributeValue(atts, HTML.Attribute.SIZE,
+ -1);
+ JTextField tf = new JTextField();
+ if (size > 0)
+ tf.setColumns(size);
+ else
+ tf.setColumns(20);
+ if (model != null)
+ tf.setDocument((Document) model);
+ tf.addActionListener(this);
+ comp = tf;
+ maxIsPreferred = true;
+ }
+ }
+ else if (tag == HTML.Tag.TEXTAREA)
+ {
+ JTextArea textArea = new JTextArea((Document) model);
+ int rows = HTML.getIntegerAttributeValue(atts, HTML.Attribute.ROWS, 1);
+ textArea.setRows(rows);
+ int cols = HTML.getIntegerAttributeValue(atts, HTML.Attribute.COLS, 20);
+ textArea.setColumns(cols);
+ maxIsPreferred = true;
+ comp = new JScrollPane(textArea,
+ JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
+ JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
+ }
+ else if (tag == HTML.Tag.SELECT)
+ {
+ if (model instanceof SelectListModel)
+ {
+ SelectListModel slModel = (SelectListModel) model;
+ JList list = new JList(slModel);
+ int size = HTML.getIntegerAttributeValue(atts, HTML.Attribute.SIZE,
+ 1);
+ list.setVisibleRowCount(size);
+ list.setSelectionModel(slModel.getSelectionModel());
+ comp = new JScrollPane(list);
+ }
+ else if (model instanceof SelectComboBoxModel)
+ {
+ SelectComboBoxModel scbModel = (SelectComboBoxModel) model;
+ comp = new JComboBox(scbModel);
+ }
+ maxIsPreferred = true;
}
- // FIXME: Implement the remaining components.
return comp;
}
@@ -188,16 +560,11 @@ public class FormView
*/
public float getMaximumSpan(int axis)
{
- // FIXME: The specs say that for some components the maximum span == the
- // preferred span of the component. This should be figured out and
- // implemented accordingly.
float span;
- if (axis == X_AXIS)
- span = getComponent().getMaximumSize().width;
- else if (axis == Y_AXIS)
- span = getComponent().getMaximumSize().height;
+ if (maxIsPreferred)
+ span = getPreferredSpan(axis);
else
- throw new IllegalArgumentException("Invalid axis parameter");
+ span = super.getMaximumSpan(axis);
return span;
}
@@ -222,7 +589,9 @@ public class FormView
AttributeSet atts = el.getAttributes();
String type = (String) atts.getAttribute(HTML.Attribute.TYPE);
if (type.equals("submit"))
- submitData(""); // FIXME: How to fetch the actual form data?
+ submitData(getFormData());
+ else if (type.equals("reset"))
+ resetForm();
}
// FIXME: Implement the remaining actions.
}
@@ -235,7 +604,8 @@ public class FormView
*/
protected void submitData(String data)
{
- // FIXME: Implement this.
+ SubmitThread submitThread = new SubmitThread(data);
+ submitThread.start();
}
/**
@@ -272,4 +642,229 @@ public class FormView
}
return data;
}
+
+ /**
+ * Determines and returns the enclosing form element if there is any.
+ *
+ * This is package private to avoid accessor methods.
+ *
+ * @return the enclosing form element, or <code>null</code> if there is no
+ * enclosing form element
+ */
+ Element getFormElement()
+ {
+ Element form = null;
+ Element el = getElement();
+ while (el != null && form == null)
+ {
+ AttributeSet atts = el.getAttributes();
+ if (atts.getAttribute(StyleConstants.NameAttribute) == HTML.Tag.FORM)
+ form = el;
+ else
+ el = el.getParentElement();
+ }
+ return form;
+ }
+
+ /**
+ * Determines the form data that is about to be submitted.
+ *
+ * @return the form data
+ */
+ private String getFormData()
+ {
+ Element form = getFormElement();
+ StringBuilder b = new StringBuilder();
+ if (form != null)
+ {
+ ElementIterator i = new ElementIterator(form);
+ Element next;
+ while ((next = i.next()) != null)
+ {
+ if (next.isLeaf())
+ {
+ AttributeSet atts = next.getAttributes();
+ String type = (String) atts.getAttribute(HTML.Attribute.TYPE);
+ if (type != null && type.equals("submit")
+ && next != getElement())
+ {
+ // Skip this. This is not the actual submit trigger.
+ }
+ else if (type == null || ! type.equals("image"))
+ {
+ getElementFormData(next, b);
+ }
+ }
+ }
+ }
+ return b.toString();
+ }
+
+ /**
+ * Fetches the form data from the specified element and appends it to
+ * the data string.
+ *
+ * @param el the element from which to fetch form data
+ * @param b the data string
+ */
+ private void getElementFormData(Element el, StringBuilder b)
+ {
+ AttributeSet atts = el.getAttributes();
+ String name = (String) atts.getAttribute(HTML.Attribute.NAME);
+ if (name != null)
+ {
+ String value = null;
+ HTML.Tag tag = (HTML.Tag) atts.getAttribute(StyleConstants.NameAttribute);
+ if (tag == HTML.Tag.SELECT)
+ {
+ getSelectData(atts, b);
+ }
+ else
+ {
+ if (tag == HTML.Tag.INPUT)
+ value = getInputFormData(atts);
+ else if (tag == HTML.Tag.TEXTAREA)
+ value = getTextAreaData(atts);
+ if (name != null && value != null)
+ {
+ addData(b, name, value);
+ }
+ }
+ }
+ }
+
+ /**
+ * Fetches form data from select boxes.
+ *
+ * @param atts the attributes of the element
+ *
+ * @param b the form data string to append to
+ */
+ private void getSelectData(AttributeSet atts, StringBuilder b)
+ {
+ String name = (String) atts.getAttribute(HTML.Attribute.NAME);
+ if (name != null)
+ {
+ Object m = atts.getAttribute(StyleConstants.ModelAttribute);
+ if (m instanceof SelectListModel)
+ {
+ SelectListModel sl = (SelectListModel) m;
+ ListSelectionModel lsm = sl.getSelectionModel();
+ for (int i = 0; i < sl.getSize(); i++)
+ {
+ if (lsm.isSelectedIndex(i))
+ {
+ Option o = (Option) sl.getElementAt(i);
+ addData(b, name, o.getValue());
+ }
+ }
+ }
+ else if (m instanceof SelectComboBoxModel)
+ {
+ SelectComboBoxModel scb = (SelectComboBoxModel) m;
+ Option o = (Option) scb.getSelectedItem();
+ if (o != null)
+ addData(b, name, o.getValue());
+ }
+ }
+ }
+
+ /**
+ * Fetches form data from a textarea.
+ *
+ * @param atts the attributes
+ *
+ * @return the form data
+ */
+ private String getTextAreaData(AttributeSet atts)
+ {
+ Document doc = (Document) atts.getAttribute(StyleConstants.ModelAttribute);
+ String data;
+ try
+ {
+ data = doc.getText(0, doc.getLength());
+ }
+ catch (BadLocationException ex)
+ {
+ data = null;
+ }
+ return data;
+ }
+
+ /**
+ * Fetches form data from an input tag.
+ *
+ * @param atts the attributes from which to fetch the data
+ *
+ * @return the field value
+ */
+ private String getInputFormData(AttributeSet atts)
+ {
+ String type = (String) atts.getAttribute(HTML.Attribute.TYPE);
+ Object model = atts.getAttribute(StyleConstants.ModelAttribute);
+ String value = null;
+ if (type.equals("text") || type.equals("password"))
+ {
+ Document doc = (Document) model;
+ try
+ {
+ value = doc.getText(0, doc.getLength());
+ }
+ catch (BadLocationException ex)
+ {
+ // Sigh.
+ assert false;
+ }
+ }
+ else if (type.equals("hidden") || type.equals("submit"))
+ {
+ value = (String) atts.getAttribute(HTML.Attribute.VALUE);
+ if (value == null)
+ value = "";
+ }
+ // TODO: Implement the others. radio, checkbox and file.
+ return value;
+ }
+
+ /**
+ * Actually adds the specified data to the string. It URL encodes
+ * the name and value and handles separation of the fields.
+ *
+ * @param b the string at which the form data to be added
+ * @param name the name of the field
+ * @param value the value
+ */
+ private void addData(StringBuilder b, String name, String value)
+ {
+ if (b.length() > 0)
+ b.append('&');
+ String encName = URLEncoder.encode(name);
+ b.append(encName);
+ b.append('=');
+ String encValue = URLEncoder.encode(value);
+ b.append(encValue);
+ }
+
+ /**
+ * Resets the form data to their initial state.
+ */
+ private void resetForm()
+ {
+ Element form = getFormElement();
+ if (form != null)
+ {
+ ElementIterator iter = new ElementIterator(form);
+ Element next;
+ while ((next = iter.next()) != null)
+ {
+ if (next.isLeaf())
+ {
+ AttributeSet atts = next.getAttributes();
+ Object m = atts.getAttribute(StyleConstants.ModelAttribute);
+ if (m instanceof ResetableModel)
+ ((ResetableModel) m).reset();
+ }
+ }
+ }
+ }
}
diff --git a/libjava/classpath/javax/swing/text/html/FrameSetView.java b/libjava/classpath/javax/swing/text/html/FrameSetView.java
new file mode 100644
index 00000000000..e3252d79caf
--- /dev/null
+++ b/libjava/classpath/javax/swing/text/html/FrameSetView.java
@@ -0,0 +1,274 @@
+/* FrameSetView.java -- Implements HTML frameset
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.text.html;
+
+import java.util.StringTokenizer;
+
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BoxView;
+import javax.swing.text.Element;
+import javax.swing.text.View;
+import javax.swing.text.ViewFactory;
+
+/**
+ * Implements HTML framesets. This is implemented as a vertical box that
+ * holds the rows of the frameset. Each row is again a horizontal box that
+ * holds the actual columns.
+ */
+public class FrameSetView
+ extends BoxView
+{
+
+ /**
+ * A row of a frameset.
+ */
+ private class FrameSetRow
+ extends BoxView
+ {
+ private int row;
+ FrameSetRow(Element el, int r)
+ {
+ super(el, X_AXIS);
+ row = r;
+ }
+
+ protected void loadChildren(ViewFactory f)
+ {
+ // Load the columns here.
+ Element el = getElement();
+ View[] columns = new View[numViews[X_AXIS]];
+ int offset = row * numViews[X_AXIS];
+ for (int c = 0; c < numViews[X_AXIS]; c++)
+ {
+ Element child = el.getElement(offset + c);
+ columns[c] = f.create(child);
+ }
+ replace(0, 0, columns);
+ }
+
+ protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets,
+ int[] spans)
+ {
+ int numRows = numViews[X_AXIS];
+ int[] abs = absolute[X_AXIS];
+ int[] rel = relative[X_AXIS];
+ int[] perc = percent[X_AXIS];
+ layoutViews(targetSpan, axis, offsets, spans, numRows, abs, rel, perc);
+ }
+ }
+
+ /**
+ * Holds the absolute layout information for the views along one axis. The
+ * indices are absolute[axis][index], where axis is either X_AXIS (columns)
+ * or Y_AXIS (rows). Rows or columns that don't have absolute layout have
+ * a -1 in this array.
+ */
+ int[][] absolute;
+
+ /**
+ * Holds the relative (*) layout information for the views along one axis.
+ * The indices are relative[axis][index], where axis is either X_AXIS
+ * (columns) or Y_AXIS (rows). Rows or columns that don't have relative
+ * layout have a Float.NaN in this array.
+ */
+ int[][] relative;
+
+ /**
+ * Holds the relative (%) layout information for the views along one axis.
+ * The indices are relative[axis][index], where axis is either X_AXIS
+ * (columns) or Y_AXIS (rows). Rows or columns that don't have relative
+ * layout have a Float.NaN in this array.
+ *
+ * The percentage is divided by 100 so that we hold the actual fraction here.
+ */
+ int[][] percent;
+
+ /**
+ * The number of children in each direction.
+ */
+ int[] numViews;
+
+ FrameSetView(Element el)
+ {
+ super(el, Y_AXIS);
+ numViews = new int[2];
+ absolute = new int[2][];
+ relative = new int[2][];
+ percent = new int[2][];
+ }
+
+ /**
+ * Loads the children and places them inside the grid.
+ */
+ protected void loadChildren(ViewFactory f)
+ {
+ parseRowsCols();
+ // Set up the rows.
+ View[] rows = new View[numViews[Y_AXIS]];
+ for (int r = 0; r < numViews[Y_AXIS]; r++)
+ {
+ rows[r] = new FrameSetRow(getElement(), r);
+ }
+ replace(0, 0, rows);
+ }
+
+ /**
+ * Parses the rows and cols attributes and sets up the layout info.
+ */
+ private void parseRowsCols()
+ {
+ Element el = getElement();
+ AttributeSet atts = el.getAttributes();
+ String cols = (String) atts.getAttribute(HTML.Attribute.COLS);
+ if (cols == null) // Defaults to '100%' when not specified.
+ cols = "100%";
+ parseLayout(cols, X_AXIS);
+ String rows = (String) atts.getAttribute(HTML.Attribute.ROWS);
+ if (rows == null) // Defaults to '100%' when not specified.
+ rows = "100%";
+ parseLayout(rows, Y_AXIS);
+ }
+
+ /**
+ * Parses the cols or rows attribute and places the layout info in the
+ * appropriate arrays.
+ *
+ * @param att the attributes to parse
+ * @param axis the axis
+ */
+ private void parseLayout(String att, int axis)
+ {
+ StringTokenizer tokens = new StringTokenizer(att, ",");
+ numViews[axis] = tokens.countTokens();
+ absolute[axis] = new int[numViews[axis]];
+ relative[axis] = new int[numViews[axis]];
+ percent[axis] = new int[numViews[axis]];
+ for (int index = 0; tokens.hasMoreTokens(); index++)
+ {
+ String token = tokens.nextToken();
+ int p = token.indexOf('%');
+ int s = token.indexOf('*');
+ if (p != -1)
+ {
+ // Percent value.
+ String number = token.substring(0, p);
+ try
+ {
+ percent[axis][index] = Integer.parseInt(number);
+ }
+ catch (NumberFormatException ex)
+ {
+ // Leave value as 0 then.
+ }
+ }
+ else if (s != -1)
+ {
+ // Star relative value.
+ String number = token.substring(0, s);
+ try
+ {
+ relative[axis][index] = Integer.parseInt(number);
+ }
+ catch (NumberFormatException ex)
+ {
+ // Leave value as 0 then.
+ }
+ }
+ else
+ {
+ // Absolute value.
+ try
+ {
+ absolute[axis][index] = Integer.parseInt(token);
+ }
+ catch (NumberFormatException ex)
+ {
+ // Leave value as 0 then.
+ }
+ }
+ }
+ }
+
+ protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets,
+ int[] spans)
+ {
+ int numRows = numViews[Y_AXIS];
+ int[] abs = absolute[Y_AXIS];
+ int[] rel = relative[Y_AXIS];
+ int[] perc = percent[Y_AXIS];
+ layoutViews(targetSpan, axis, offsets, spans, numRows, abs, rel, perc);
+ }
+
+ void layoutViews(int targetSpan, int axis, int[] offsets, int[] spans,
+ int numViews, int[] abs, int[] rel, int[] perc)
+ {
+ // We need two passes. In the first pass we layout the absolute and
+ // percent values and accumulate the needed space. In the second pass
+ // the relative values are distributed and the offsets are set.
+ int total = 0;
+ int relTotal = 0;
+ for (int i = 0; i < numViews; i++)
+ {
+ if (abs[i] > 0)
+ {
+ spans[i] = abs[i];
+ total += spans[i];
+ }
+ else if (perc[i] > 0)
+ {
+ spans[i] = (targetSpan * perc[i]) / 100;
+ total += spans[i];
+ }
+ else if (rel[i] > 0)
+ {
+ relTotal += rel[i];
+ }
+ }
+ int offs = 0;
+ for (int i = 0; i < numViews; i++)
+ {
+ if (relTotal > 0 && rel[i] > 0)
+ {
+ spans[i] = targetSpan * (rel[i] / relTotal);
+ }
+ offsets[i] = offs;
+ offs += spans[i];
+ }
+ }
+}
diff --git a/libjava/classpath/javax/swing/text/html/FrameView.java b/libjava/classpath/javax/swing/text/html/FrameView.java
new file mode 100644
index 00000000000..cd4e44a98ce
--- /dev/null
+++ b/libjava/classpath/javax/swing/text/html/FrameView.java
@@ -0,0 +1,233 @@
+/* FrameView.java -- Renders HTML frame tags
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.text.html;
+
+import java.awt.Component;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.swing.JEditorPane;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.ComponentView;
+import javax.swing.text.Element;
+import javax.swing.text.View;
+
+/**
+ * A view that is responsible for rendering HTML frame tags.
+ * This is accomplished by a specialized {@link ComponentView}
+ * that embeds a JEditorPane with an own document.
+ */
+class FrameView
+ extends ComponentView
+ implements HyperlinkListener
+{
+
+ /**
+ * Creates a new FrameView for the specified element.
+ *
+ * @param el the element for the view
+ */
+ FrameView(Element el)
+ {
+ super(el);
+ }
+
+ /**
+ * Creates the element that will be embedded in the view.
+ * This will be a JEditorPane with the appropriate content set.
+ *
+ * @return the element that will be embedded in the view
+ */
+ protected Component createComponent()
+ {
+ Element el = getElement();
+ AttributeSet atts = el.getAttributes();
+ JEditorPane html = new JEditorPane();
+ html.addHyperlinkListener(this);
+ URL base = ((HTMLDocument) el.getDocument()).getBase();
+ String srcAtt = (String) atts.getAttribute(HTML.Attribute.SRC);
+ if (srcAtt != null && ! srcAtt.equals(""))
+ {
+ try
+ {
+ URL page = new URL(base, srcAtt);
+ html.setPage(page);
+ ((HTMLDocument) html.getDocument()).setFrameDocument(true);
+ }
+ catch (MalformedURLException ex)
+ {
+ // Leave page empty.
+ }
+ catch (IOException ex)
+ {
+ // Leave page empty.
+ }
+ }
+ return html;
+ }
+
+ /**
+ * Catches hyperlink events on that frame's editor and forwards it to
+ * the outermost editorpane.
+ */
+ public void hyperlinkUpdate(HyperlinkEvent event)
+ {
+ JEditorPane outer = getTopEditorPane();
+ if (outer != null)
+ {
+ if (event instanceof HTMLFrameHyperlinkEvent)
+ {
+ HTMLFrameHyperlinkEvent hfhe = (HTMLFrameHyperlinkEvent) event;
+ if (hfhe.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
+ {
+ String target = hfhe.getTarget();
+ if (event instanceof FormSubmitEvent)
+ {
+ handleFormSubmitEvent(hfhe, outer, target);
+ }
+ else // No FormSubmitEvent.
+ {
+ handleHyperlinkEvent(hfhe, outer, target);
+ }
+ }
+ }
+ else
+ {
+ // Simply forward this event.
+ outer.fireHyperlinkUpdate(event);
+ }
+ }
+ }
+
+ /**
+ * Handles normal hyperlink events.
+ *
+ * @param event the event
+ * @param outer the top editor
+ * @param target the target
+ */
+ private void handleHyperlinkEvent(HyperlinkEvent event,
+ JEditorPane outer, String target)
+ {
+ if (target.equals("_top"))
+ {
+ try
+ {
+ outer.setPage(event.getURL());
+ }
+ catch (IOException ex)
+ {
+ // Well...
+ ex.printStackTrace();
+ }
+ }
+ if (! outer.isEditable())
+ {
+ outer.fireHyperlinkUpdate
+ (new HTMLFrameHyperlinkEvent(outer,
+ event.getEventType(),
+ event.getURL(),
+ event.getDescription(),
+ getElement(),
+ target));
+ }
+ }
+
+ /**
+ * Handles form submit events.
+ *
+ * @param event the event
+ * @param outer the top editor
+ * @param target the target
+ */
+ private void handleFormSubmitEvent(HTMLFrameHyperlinkEvent event,
+ JEditorPane outer,
+ String target)
+ {
+ HTMLEditorKit kit = (HTMLEditorKit) outer.getEditorKit();
+ if (kit != null && kit.isAutoFormSubmission())
+ {
+ if (target.equals("_top"))
+ {
+ try
+ {
+ outer.setPage(event.getURL());
+ }
+ catch (IOException ex)
+ {
+ // Well...
+ ex.printStackTrace();
+ }
+ }
+ else
+ {
+ HTMLDocument doc =
+ (HTMLDocument) outer.getDocument();
+ doc.processHTMLFrameHyperlinkEvent(event);
+ }
+ }
+ else
+ {
+ outer.fireHyperlinkUpdate(event);
+ }
+ }
+
+ /**
+ * Determines the topmost editor in a nested frameset.
+ *
+ * @return the topmost editor in a nested frameset
+ */
+ private JEditorPane getTopEditorPane()
+ {
+ View parent = getParent();
+ View top = null;
+ while (parent != null)
+ {
+ if (parent instanceof FrameSetView)
+ top = parent;
+ }
+ JEditorPane editor = null;
+ if (top != null)
+ editor = (JEditorPane) top.getContainer();
+ return editor;
+ }
+}
diff --git a/libjava/classpath/javax/swing/text/html/HTML.java b/libjava/classpath/javax/swing/text/html/HTML.java
index 2c908f6fc6e..93c05daa2f8 100644
--- a/libjava/classpath/javax/swing/text/html/HTML.java
+++ b/libjava/classpath/javax/swing/text/html/HTML.java
@@ -465,6 +465,16 @@ public class HTML
public static final Attribute WIDTH = new Attribute("width");
/**
+ * This is used to reflect the pseudo class for the a tag.
+ */
+ static final Attribute PSEUDO_CLASS = new Attribute("_pseudo");
+
+ /**
+ * This is used to reflect the dynamic class for the a tag.
+ */
+ static final Attribute DYNAMIC_CLASS = new Attribute("_dynamic");
+
+ /**
* The attribute name.
*/
private final String name;
@@ -1119,8 +1129,8 @@ public class HTML
static final int BLOCK = 2;
static final int PREFORMATTED = 4;
static final int SYNTHETIC = 8;
- private static Map tagMap;
- private static Map attrMap;
+ private static Map<String,Tag> tagMap;
+ private static Map<String,Attribute> attrMap;
/**
* The public constructor (does nothing). It it seldom required to have
@@ -1159,7 +1169,7 @@ public class HTML
if (attrMap == null)
{
// Create the map on demand.
- attrMap = new TreeMap();
+ attrMap = new TreeMap<String,Attribute>();
Attribute[] attrs = getAllAttributeKeys();
@@ -1169,7 +1179,7 @@ public class HTML
}
}
- return (Attribute) attrMap.get(attName.toLowerCase());
+ return attrMap.get(attName.toLowerCase());
}
/**
@@ -1228,7 +1238,7 @@ public class HTML
if (tagMap == null)
{
// Create the mao on demand.
- tagMap = new TreeMap();
+ tagMap = new TreeMap<String,Tag>();
Tag[] tags = getAllTags();
@@ -1238,6 +1248,6 @@ public class HTML
}
}
- return (Tag) tagMap.get(tagName.toLowerCase());
+ return tagMap.get(tagName.toLowerCase());
}
}
diff --git a/libjava/classpath/javax/swing/text/html/HTMLDocument.java b/libjava/classpath/javax/swing/text/html/HTMLDocument.java
index 0bfc338df45..f3d3ce3faaf 100644
--- a/libjava/classpath/javax/swing/text/html/HTMLDocument.java
+++ b/libjava/classpath/javax/swing/text/html/HTMLDocument.java
@@ -39,19 +39,22 @@ exception statement from your version. */
package javax.swing.text.html;
import gnu.classpath.NotImplementedException;
-import gnu.javax.swing.text.html.CharacterAttributeTranslator;
-import gnu.javax.swing.text.html.parser.htmlAttributeSet;
import java.io.IOException;
import java.io.StringReader;
+import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Stack;
import java.util.Vector;
+import javax.swing.ButtonGroup;
+import javax.swing.DefaultButtonModel;
import javax.swing.JEditorPane;
+import javax.swing.ListSelectionModel;
import javax.swing.event.DocumentEvent;
-import javax.swing.event.HyperlinkEvent.EventType;
+import javax.swing.event.UndoableEditEvent;
import javax.swing.text.AbstractDocument;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
@@ -60,6 +63,7 @@ import javax.swing.text.Element;
import javax.swing.text.ElementIterator;
import javax.swing.text.GapContent;
import javax.swing.text.MutableAttributeSet;
+import javax.swing.text.PlainDocument;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;
import javax.swing.text.html.HTML.Tag;
@@ -87,16 +91,24 @@ public class HTMLDocument extends DefaultStyledDocument
boolean preservesUnknownTags = true;
int tokenThreshold = Integer.MAX_VALUE;
HTMLEditorKit.Parser parser;
- StyleSheet styleSheet;
- AbstractDocument.Content content;
-
+
+ /**
+ * Indicates whether this document is inside a frame or not.
+ */
+ private boolean frameDocument;
+
+ /**
+ * Package private to avoid accessor methods.
+ */
+ String baseTarget;
+
/**
* Constructs an HTML document using the default buffer size and a default
* StyleSheet.
*/
public HTMLDocument()
{
- this(null);
+ this(new GapContent(BUFFER_SIZE_DEFAULT), new StyleSheet());
}
/**
@@ -119,14 +131,7 @@ public class HTMLDocument extends DefaultStyledDocument
*/
public HTMLDocument(AbstractDocument.Content c, StyleSheet styles)
{
- this.content = c;
- if (styles == null)
- {
- styles = new StyleSheet();
- styles.importStyleSheet(getClass().getResource(HTMLEditorKit.
- DEFAULT_CSS));
- }
- this.styleSheet = styles;
+ super(c, styles);
}
/**
@@ -137,7 +142,7 @@ public class HTMLDocument extends DefaultStyledDocument
*/
public StyleSheet getStyleSheet()
{
- return styleSheet;
+ return (StyleSheet) getAttributeContext();
}
/**
@@ -191,8 +196,6 @@ public class HTMLDocument extends DefaultStyledDocument
protected Element createLeafElement(Element parent, AttributeSet a, int p0,
int p1)
{
- RunElement el = new RunElement(parent, a, p0, p1);
- el.addAttribute(StyleConstants.NameAttribute, HTML.Tag.CONTENT);
return new RunElement(parent, a, p0, p1);
}
@@ -269,7 +272,7 @@ public class HTMLDocument extends DefaultStyledDocument
public void setBase(URL u)
{
baseURL = u;
- styleSheet.setBase(u);
+ getStyleSheet().setBase(u);
}
/**
@@ -374,11 +377,119 @@ public class HTMLDocument extends DefaultStyledDocument
}
public void processHTMLFrameHyperlinkEvent(HTMLFrameHyperlinkEvent event)
- throws NotImplementedException
{
- // TODO: Implement this properly.
+ String target = event.getTarget();
+ Element el = event.getSourceElement();
+ URL url = event.getURL();
+ if (target.equals("_self"))
+ {
+ updateFrame(el, url);
+ }
+ else if (target.equals("_parent"))
+ {
+ updateFrameSet(el.getParentElement(), url);
+ }
+ else
+ {
+ Element targetFrame = findFrame(target);
+ if (targetFrame != null)
+ updateFrame(targetFrame, url);
+ }
}
-
+
+ /**
+ * Finds the named frame inside this document.
+ *
+ * @param target the name to look for
+ *
+ * @return the frame if there is a matching frame, <code>null</code>
+ * otherwise
+ */
+ private Element findFrame(String target)
+ {
+ ElementIterator i = new ElementIterator(this);
+ Element next = null;
+ while ((next = i.next()) != null)
+ {
+ AttributeSet atts = next.getAttributes();
+ if (atts.getAttribute(StyleConstants.NameAttribute) == HTML.Tag.FRAME)
+ {
+ String name = (String) atts.getAttribute(HTML.Attribute.NAME);
+ if (name != null && name.equals(target))
+ break;
+ }
+ }
+ return next;
+ }
+
+ /**
+ * Updates the frame that is represented by the specified element to
+ * refer to the specified URL.
+ *
+ * @param el the element
+ * @param url the new url
+ */
+ private void updateFrame(Element el, URL url)
+ {
+ try
+ {
+ writeLock();
+ DefaultDocumentEvent ev =
+ new DefaultDocumentEvent(el.getStartOffset(), 1,
+ DocumentEvent.EventType.CHANGE);
+ AttributeSet elAtts = el.getAttributes();
+ AttributeSet copy = elAtts.copyAttributes();
+ MutableAttributeSet matts = (MutableAttributeSet) elAtts;
+ ev.addEdit(new AttributeUndoableEdit(el, copy, false));
+ matts.removeAttribute(HTML.Attribute.SRC);
+ matts.addAttribute(HTML.Attribute.SRC, url.toString());
+ ev.end();
+ fireChangedUpdate(ev);
+ fireUndoableEditUpdate(new UndoableEditEvent(this, ev));
+ }
+ finally
+ {
+ writeUnlock();
+ }
+ }
+
+ /**
+ * Updates the frameset that is represented by the specified element
+ * to create a frame that refers to the specified URL.
+ *
+ * @param el the element
+ * @param url the url
+ */
+ private void updateFrameSet(Element el, URL url)
+ {
+ int start = el.getStartOffset();
+ int end = el.getEndOffset();
+
+ StringBuilder html = new StringBuilder();
+ html.append("<frame");
+ if (url != null)
+ {
+ html.append(" src=\"");
+ html.append(url.toString());
+ html.append("\"");
+ }
+ html.append('>');
+ if (getParser() == null)
+ setParser(new HTMLEditorKit().getParser());
+ try
+ {
+ setOuterHTML(el, html.toString());
+ }
+ catch (BadLocationException ex)
+ {
+ ex.printStackTrace();
+ }
+ catch (IOException ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+
/**
* Gets an iterator for the given HTML.Tag.
* @param t the requested HTML.Tag
@@ -461,6 +572,8 @@ public class HTMLDocument extends DefaultStyledDocument
String name = null;
if (tag != null)
name = tag.toString();
+ if (name == null)
+ name = super.getName();
return name;
}
}
@@ -497,6 +610,8 @@ public class HTMLDocument extends DefaultStyledDocument
String name = null;
if (tag != null)
name = tag.toString();
+ if (name == null)
+ name = super.getName();
return name;
}
@@ -518,24 +633,33 @@ public class HTMLDocument extends DefaultStyledDocument
* @author Anthony Balkissoon abalkiss at redhat dot com
*/
public class HTMLReader extends HTMLEditorKit.ParserCallback
- {
+ {
+ /**
+ * The maximum token threshold. We don't grow it larger than this.
+ */
+ private static final int MAX_THRESHOLD = 10000;
+
+ /**
+ * The threshold growth factor.
+ */
+ private static final int GROW_THRESHOLD = 5;
+
/**
* Holds the current character attribute set *
*/
protected MutableAttributeSet charAttr = new SimpleAttributeSet();
- protected Vector parseBuffer = new Vector();
-
+ protected Vector<ElementSpec> parseBuffer = new Vector<ElementSpec>();
+
+ /**
+ * The parse stack. It holds the current element tree path.
+ */
+ private Stack<HTML.Tag> parseStack = new Stack<HTML.Tag>();
+
/**
* A stack for character attribute sets *
*/
Stack charAttrStack = new Stack();
-
- /**
- * The parse stack. This stack holds HTML.Tag objects that reflect the
- * current position in the parsing process.
- */
- Stack parseStack = new Stack();
/** A mapping between HTML.Tag objects and the actions that handle them **/
HashMap tagToAction;
@@ -571,13 +695,68 @@ public class HTMLDocument extends DefaultStyledDocument
/** A temporary variable that helps with the printing out of debug information **/
boolean debug = false;
-
- void print (String line)
- {
- if (debug)
- System.out.println (line);
- }
-
+
+ /**
+ * This is true when we are inside a pre tag.
+ */
+ boolean inPreTag = false;
+
+ /**
+ * This is true when we are inside a style tag. This will add text
+ * content inside this style tag beeing parsed as CSS.
+ *
+ * This is package private to avoid accessor methods.
+ */
+ boolean inStyleTag = false;
+
+ /**
+ * This is true when we are inside a &lt;textarea&gt; tag. Any text
+ * content will then be added to the text area.
+ *
+ * This is package private to avoid accessor methods.
+ */
+ boolean inTextArea = false;
+
+ /**
+ * This contains all stylesheets that are somehow read, either
+ * via embedded style tags, or via linked stylesheets. The
+ * elements will be String objects containing a stylesheet each.
+ */
+ ArrayList styles;
+
+ /**
+ * The document model for a textarea.
+ *
+ * This is package private to avoid accessor methods.
+ */
+ ResetablePlainDocument textAreaDocument;
+
+ /**
+ * The current model of a select tag. Can be a ComboBoxModel or a
+ * ListModel depending on the type of the select box.
+ */
+ Object selectModel;
+
+ /**
+ * The current option beeing read.
+ */
+ Option option;
+
+ /**
+ * The current number of options in the current select model.
+ */
+ int numOptions;
+
+ /**
+ * The current button groups mappings.
+ */
+ HashMap buttonGroups;
+
+ /**
+ * The token threshold. This gets increased while loading.
+ */
+ private int threshold;
+
public class TagAction
{
/**
@@ -633,13 +812,12 @@ public class HTMLDocument extends DefaultStyledDocument
// Put the old attribute set on the stack.
pushCharacterStyle();
- // Translate tag.. return if succesful.
- if(CharacterAttributeTranslator.translateTag(charAttr, t, a))
- return;
+ // Initialize with link pseudo class.
+ if (t == HTML.Tag.A)
+ a.addAttribute(HTML.Attribute.PSEUDO_CLASS, "link");
// Just add the attributes in <code>a</code>.
- if (a != null)
- charAttr.addAttribute(t, a.copyAttributes());
+ charAttr.addAttribute(t, a.copyAttributes());
}
/**
@@ -651,7 +829,11 @@ public class HTMLDocument extends DefaultStyledDocument
popCharacterStyle();
}
}
-
+
+ /**
+ * Processes elements that make up forms: &lt;input&gt;, &lt;textarea&gt;,
+ * &lt;select&gt; and &lt;option&gt;.
+ */
public class FormAction extends SpecialAction
{
/**
@@ -659,10 +841,73 @@ public class HTMLDocument extends DefaultStyledDocument
* of tags associated with this Action.
*/
public void start(HTML.Tag t, MutableAttributeSet a)
- throws NotImplementedException
{
- // FIXME: Implement.
- print ("FormAction.start not implemented");
+ if (t == HTML.Tag.INPUT)
+ {
+ String type = (String) a.getAttribute(HTML.Attribute.TYPE);
+ if (type == null)
+ {
+ type = "text"; // Default to 'text' when nothing was specified.
+ a.addAttribute(HTML.Attribute.TYPE, type);
+ }
+ setModel(type, a);
+ }
+ else if (t == HTML.Tag.TEXTAREA)
+ {
+ inTextArea = true;
+ textAreaDocument = new ResetablePlainDocument();
+ a.addAttribute(StyleConstants.ModelAttribute, textAreaDocument);
+ }
+ else if (t == HTML.Tag.SELECT)
+ {
+ int size = HTML.getIntegerAttributeValue(a, HTML.Attribute.SIZE,
+ 1);
+ boolean multi = a.getAttribute(HTML.Attribute.MULTIPLE) != null;
+ if (size > 1 || multi)
+ {
+ SelectListModel m = new SelectListModel();
+ if (multi)
+ m.getSelectionModel().setSelectionMode(ListSelectionModel
+ .MULTIPLE_INTERVAL_SELECTION);
+ selectModel = m;
+ }
+ else
+ {
+ selectModel = new SelectComboBoxModel();
+ }
+ a.addAttribute(StyleConstants.ModelAttribute, selectModel);
+ }
+ if (t == HTML.Tag.OPTION)
+ {
+ option = new Option(a);
+ if (selectModel instanceof SelectListModel)
+ {
+ SelectListModel m = (SelectListModel) selectModel;
+ m.addElement(option);
+ if (option.isSelected())
+ {
+ m.getSelectionModel().addSelectionInterval(numOptions,
+ numOptions);
+ m.addInitialSelection(numOptions);
+ }
+ }
+ else if (selectModel instanceof SelectComboBoxModel)
+ {
+ SelectComboBoxModel m = (SelectComboBoxModel) selectModel;
+ m.addElement(option);
+ if (option.isSelected())
+ {
+ m.setSelectedItem(option);
+ m.setInitialSelection(option);
+ }
+ }
+ numOptions++;
+ }
+ else
+ {
+ // Build the element.
+ super.start(t, a);
+ }
}
/**
@@ -670,13 +915,106 @@ public class HTMLDocument extends DefaultStyledDocument
* with this Action.
*/
public void end(HTML.Tag t)
- throws NotImplementedException
{
- // FIXME: Implement.
- print ("FormAction.end not implemented");
+ if (t == HTML.Tag.OPTION)
+ {
+ option = null;
+ }
+ else
+ {
+ if (t == HTML.Tag.TEXTAREA)
+ {
+ inTextArea = false;
+ }
+ else if (t == HTML.Tag.SELECT)
+ {
+ selectModel = null;
+ numOptions = 0;
+ }
+ // Finish the element.
+ super.end(t);
+ }
+ }
+
+ private void setModel(String type, MutableAttributeSet attrs)
+ {
+ if (type.equals("submit") || type.equals("reset")
+ || type.equals("image"))
+ {
+ // Create button.
+ attrs.addAttribute(StyleConstants.ModelAttribute,
+ new DefaultButtonModel());
+ }
+ else if (type.equals("text") || type.equals("password"))
+ {
+ String text = (String) attrs.getAttribute(HTML.Attribute.VALUE);
+ ResetablePlainDocument doc = new ResetablePlainDocument();
+ if (text != null)
+ {
+ doc.setInitialText(text);
+ try
+ {
+ doc.insertString(0, text, null);
+ }
+ catch (BadLocationException ex)
+ {
+ // Shouldn't happen.
+ assert false;
+ }
+ }
+ attrs.addAttribute(StyleConstants.ModelAttribute, doc);
+ }
+ else if (type.equals("file"))
+ {
+ attrs.addAttribute(StyleConstants.ModelAttribute,
+ new PlainDocument());
+ }
+ else if (type.equals("checkbox") || type.equals("radio"))
+ {
+ ResetableToggleButtonModel model =
+ new ResetableToggleButtonModel();
+ if (attrs.getAttribute(HTML.Attribute.SELECTED) != null)
+ {
+ model.setSelected(true);
+ model.setInitial(true);
+ }
+ if (type.equals("radio"))
+ {
+ String name = (String) attrs.getAttribute(HTML.Attribute.NAME);
+ if (name != null)
+ {
+ if (buttonGroups == null)
+ buttonGroups = new HashMap();
+ ButtonGroup group = (ButtonGroup) buttonGroups.get(name);
+ if (group == null)
+ {
+ group = new ButtonGroup();
+ buttonGroups.put(name, group);
+ }
+ model.setGroup(group);
+ }
+ }
+ attrs.addAttribute(StyleConstants.ModelAttribute, model);
+ }
+ }
+ }
+
+ /**
+ * Called for form tags.
+ */
+ class FormTagAction
+ extends BlockAction
+ {
+ /**
+ * Clears the button group mapping.
+ */
+ public void end(HTML.Tag t)
+ {
+ super.end(t);
+ buttonGroups = null;
}
}
-
+
/**
* This action indicates that the content between starting and closing HTML
* elements (like script - /script) should not be visible. The content is
@@ -707,7 +1045,10 @@ public class HTMLDocument extends DefaultStyledDocument
blockClose(t);
}
}
-
+
+ /**
+ * Handles &lt;isindex&gt; tags.
+ */
public class IsindexAction extends TagAction
{
/**
@@ -715,10 +1056,10 @@ public class HTMLDocument extends DefaultStyledDocument
* of tags associated with this Action.
*/
public void start(HTML.Tag t, MutableAttributeSet a)
- throws NotImplementedException
{
- // FIXME: Implement.
- print ("IsindexAction.start not implemented");
+ blockOpen(HTML.Tag.IMPLIED, new SimpleAttributeSet());
+ addSpecialElement(t, a);
+ blockClose(HTML.Tag.IMPLIED);
}
}
@@ -730,7 +1071,7 @@ public class HTMLDocument extends DefaultStyledDocument
*/
public void start(HTML.Tag t, MutableAttributeSet a)
{
- blockOpen(t, a);
+ super.start(t, a);
}
/**
@@ -739,10 +1080,13 @@ public class HTMLDocument extends DefaultStyledDocument
*/
public void end(HTML.Tag t)
{
- blockClose(t);
+ super.end(t);
}
}
-
+
+ /**
+ * This action is performed when a &lt;pre&gt; tag is parsed.
+ */
public class PreAction extends BlockAction
{
/**
@@ -750,11 +1094,11 @@ public class HTMLDocument extends DefaultStyledDocument
* of tags associated with this Action.
*/
public void start(HTML.Tag t, MutableAttributeSet a)
- throws NotImplementedException
{
- // FIXME: Implement.
- print ("PreAction.start not implemented");
- super.start(t, a);
+ inPreTag = true;
+ blockOpen(t, a);
+ a.addAttribute(CSS.Attribute.WHITE_SPACE, "pre");
+ blockOpen(HTML.Tag.IMPLIED, a);
}
/**
@@ -762,11 +1106,10 @@ public class HTMLDocument extends DefaultStyledDocument
* with this Action.
*/
public void end(HTML.Tag t)
- throws NotImplementedException
{
- // FIXME: Implement.
- print ("PreAction.end not implemented");
- super.end(t);
+ blockClose(HTML.Tag.IMPLIED);
+ inPreTag = false;
+ blockClose(t);
}
}
@@ -798,7 +1141,6 @@ public class HTMLDocument extends DefaultStyledDocument
throws NotImplementedException
{
// FIXME: Implement.
- print ("AreaAction.start not implemented");
}
/**
@@ -809,10 +1151,44 @@ public class HTMLDocument extends DefaultStyledDocument
throws NotImplementedException
{
// FIXME: Implement.
- print ("AreaAction.end not implemented");
}
}
-
+
+ /**
+ * Converts HTML tags to CSS attributes.
+ */
+ class ConvertAction
+ extends TagAction
+ {
+
+ public void start(HTML.Tag tag, MutableAttributeSet atts)
+ {
+ pushCharacterStyle();
+ charAttr.addAttribute(tag, atts.copyAttributes());
+ StyleSheet styleSheet = getStyleSheet();
+ // TODO: Add other tags here.
+ if (tag == HTML.Tag.FONT)
+ {
+ String color = (String) atts.getAttribute(HTML.Attribute.COLOR);
+ if (color != null)
+ styleSheet.addCSSAttribute(charAttr, CSS.Attribute.COLOR, color);
+ String face = (String) atts.getAttribute(HTML.Attribute.FACE);
+ if (face != null)
+ styleSheet.addCSSAttribute(charAttr, CSS.Attribute.FONT_FAMILY,
+ face);
+ String size = (String) atts.getAttribute(HTML.Attribute.SIZE);
+ if (size != null)
+ styleSheet.addCSSAttribute(charAttr, CSS.Attribute.FONT_SIZE,
+ size);
+ }
+ }
+
+ public void end(HTML.Tag tag)
+ {
+ popCharacterStyle();
+ }
+ }
+
class BaseAction extends TagAction
{
/**
@@ -820,22 +1196,9 @@ public class HTMLDocument extends DefaultStyledDocument
* of tags associated with this Action.
*/
public void start(HTML.Tag t, MutableAttributeSet a)
- throws NotImplementedException
{
- // FIXME: Implement.
- print ("BaseAction.start not implemented");
+ baseTarget = (String) a.getAttribute(HTML.Attribute.TARGET);
}
-
- /**
- * Called when an end tag is seen for one of the types of tags associated
- * with this Action.
- */
- public void end(HTML.Tag t)
- throws NotImplementedException
- {
- // FIXME: Implement.
- print ("BaseAction.end not implemented");
- }
}
class HeadAction extends BlockAction
@@ -848,7 +1211,6 @@ public class HTMLDocument extends DefaultStyledDocument
throws NotImplementedException
{
// FIXME: Implement.
- print ("HeadAction.start not implemented: "+t);
super.start(t, a);
}
@@ -857,37 +1219,87 @@ public class HTMLDocument extends DefaultStyledDocument
* with this Action.
*/
public void end(HTML.Tag t)
- throws NotImplementedException
{
- // FIXME: Implement.
- print ("HeadAction.end not implemented: "+t);
+ // We read in all the stylesheets that are embedded or referenced
+ // inside the header.
+ if (styles != null)
+ {
+ int numStyles = styles.size();
+ for (int i = 0; i < numStyles; i++)
+ {
+ String style = (String) styles.get(i);
+ getStyleSheet().addRule(style);
+ }
+ }
super.end(t);
- }
+ }
}
- class LinkAction extends TagAction
+ class LinkAction extends HiddenAction
{
/**
* This method is called when a start tag is seen for one of the types
* of tags associated with this Action.
*/
public void start(HTML.Tag t, MutableAttributeSet a)
- throws NotImplementedException
{
- // FIXME: Implement.
- print ("LinkAction.start not implemented");
+ super.start(t, a);
+ String type = (String) a.getAttribute(HTML.Attribute.TYPE);
+ if (type == null)
+ type = "text/css";
+ if (type.equals("text/css"))
+ {
+ String rel = (String) a.getAttribute(HTML.Attribute.REL);
+ String media = (String) a.getAttribute(HTML.Attribute.MEDIA);
+ String title = (String) a.getAttribute(HTML.Attribute.TITLE);
+ if (media == null)
+ media = "all";
+ else
+ media = media.toLowerCase();
+ if (rel != null)
+ {
+ rel = rel.toLowerCase();
+ if ((media.indexOf("all") != -1
+ || media.indexOf("screen") != -1)
+ && (rel.equals("stylesheet")))
+ {
+ String href = (String) a.getAttribute(HTML.Attribute.HREF);
+ URL url = null;
+ try
+ {
+ url = new URL(baseURL, href);
+ }
+ catch (MalformedURLException ex)
+ {
+ try
+ {
+ url = new URL(href);
+ }
+ catch (MalformedURLException ex2)
+ {
+ url = null;
+ }
+ }
+ if (url != null)
+ {
+ try
+ {
+ getStyleSheet().importStyleSheet(url);
+ }
+ catch (Exception ex)
+ {
+ // Don't let exceptions and runtime exceptions
+ // in CSS parsing disprupt the HTML parsing
+ // process. But inform the user/developer
+ // on the console about it.
+ ex.printStackTrace();
+ }
+ }
+ }
+ }
+ }
}
- /**
- * Called when an end tag is seen for one of the types of tags associated
- * with this Action.
- */
- public void end(HTML.Tag t)
- throws NotImplementedException
- {
- // FIXME: Implement.
- print ("LinkAction.end not implemented");
- }
}
class MapAction extends TagAction
@@ -900,7 +1312,6 @@ public class HTMLDocument extends DefaultStyledDocument
throws NotImplementedException
{
// FIXME: Implement.
- print ("MapAction.start not implemented");
}
/**
@@ -911,7 +1322,6 @@ public class HTMLDocument extends DefaultStyledDocument
throws NotImplementedException
{
// FIXME: Implement.
- print ("MapAction.end not implemented");
}
}
@@ -925,7 +1335,6 @@ public class HTMLDocument extends DefaultStyledDocument
throws NotImplementedException
{
// FIXME: Implement.
- print ("MetaAction.start not implemented");
}
/**
@@ -936,10 +1345,9 @@ public class HTMLDocument extends DefaultStyledDocument
throws NotImplementedException
{
// FIXME: Implement.
- print ("MetaAction.end not implemented");
}
}
-
+
class StyleAction extends TagAction
{
/**
@@ -947,10 +1355,8 @@ public class HTMLDocument extends DefaultStyledDocument
* of tags associated with this Action.
*/
public void start(HTML.Tag t, MutableAttributeSet a)
- throws NotImplementedException
{
- // FIXME: Implement.
- print ("StyleAction.start not implemented");
+ inStyleTag = true;
}
/**
@@ -958,10 +1364,8 @@ public class HTMLDocument extends DefaultStyledDocument
* with this Action.
*/
public void end(HTML.Tag t)
- throws NotImplementedException
{
- // FIXME: Implement.
- print ("StyleAction.end not implemented");
+ inStyleTag = false;
}
}
@@ -975,7 +1379,6 @@ public class HTMLDocument extends DefaultStyledDocument
throws NotImplementedException
{
// FIXME: Implement.
- print ("TitleAction.start not implemented");
}
/**
@@ -986,7 +1389,6 @@ public class HTMLDocument extends DefaultStyledDocument
throws NotImplementedException
{
// FIXME: Implement.
- print ("TitleAction.end not implemented");
}
}
@@ -998,13 +1400,11 @@ public class HTMLDocument extends DefaultStyledDocument
public HTMLReader(int offset, int popDepth, int pushDepth,
HTML.Tag insertTag)
{
- print ("HTMLReader created with pop: "+popDepth
- + " push: "+pushDepth + " offset: "+offset
- + " tag: "+insertTag);
this.insertTag = insertTag;
this.offset = offset;
this.popDepth = popDepth;
this.pushDepth = pushDepth;
+ threshold = getTokenThreshold();
initTags();
}
@@ -1028,7 +1428,7 @@ public class HTMLDocument extends DefaultStyledDocument
StyleAction styleAction = new StyleAction();
TitleAction titleAction = new TitleAction();
-
+ ConvertAction convertAction = new ConvertAction();
tagToAction.put(HTML.Tag.A, characterAction);
tagToAction.put(HTML.Tag.ADDRESS, characterAction);
tagToAction.put(HTML.Tag.APPLET, hiddenAction);
@@ -1051,8 +1451,8 @@ public class HTMLDocument extends DefaultStyledDocument
tagToAction.put(HTML.Tag.DL, blockAction);
tagToAction.put(HTML.Tag.DT, paragraphAction);
tagToAction.put(HTML.Tag.EM, characterAction);
- tagToAction.put(HTML.Tag.FONT, characterAction);
- tagToAction.put(HTML.Tag.FORM, blockAction);
+ tagToAction.put(HTML.Tag.FONT, convertAction);
+ tagToAction.put(HTML.Tag.FORM, new FormTagAction());
tagToAction.put(HTML.Tag.FRAME, specialAction);
tagToAction.put(HTML.Tag.FRAMESET, blockAction);
tagToAction.put(HTML.Tag.H1, paragraphAction);
@@ -1142,18 +1542,28 @@ public class HTMLDocument extends DefaultStyledDocument
*/
public void flush() throws BadLocationException
{
- DefaultStyledDocument.ElementSpec[] elements;
- elements = new DefaultStyledDocument.ElementSpec[parseBuffer.size()];
- parseBuffer.copyInto(elements);
- parseBuffer.removeAllElements();
- if (offset == 0)
- create(elements);
- else
- insert(offset, elements);
+ flushImpl();
+ }
- offset += HTMLDocument.this.getLength() - offset;
+ /**
+ * Flushes the buffer and handle partial inserts.
+ *
+ */
+ private void flushImpl()
+ throws BadLocationException
+ {
+ int oldLen = getLength();
+ int size = parseBuffer.size();
+ ElementSpec[] elems = new ElementSpec[size];
+ parseBuffer.copyInto(elems);
+ if (oldLen == 0)
+ create(elems);
+ else
+ insert(offset, elems);
+ parseBuffer.removeAllElements();
+ offset += getLength() - oldLen;
}
-
+
/**
* This method is called by the parser to indicate a block of
* text was encountered. Should insert the text appropriately.
@@ -1163,8 +1573,24 @@ public class HTMLDocument extends DefaultStyledDocument
*/
public void handleText(char[] data, int pos)
{
- if (data != null && data.length > 0)
- addContent(data, 0, data.length);
+ if (shouldInsert() && data != null && data.length > 0)
+ {
+ if (inTextArea)
+ textAreaContent(data);
+ else if (inPreTag)
+ preContent(data);
+ else if (option != null)
+ option.setLabel(new String(data));
+ else if (inStyleTag)
+ {
+ if (styles == null)
+ styles = new ArrayList();
+ styles.add(new String(data));
+ }
+ else
+ addContent(data, 0, data.length);
+
+ }
}
/**
@@ -1214,8 +1640,7 @@ public class HTMLDocument extends DefaultStyledDocument
TagAction action = (TagAction) tagToAction.get(HTML.Tag.COMMENT);
if (action != null)
{
- action.start(HTML.Tag.COMMENT,
- htmlAttributeSet.EMPTY_HTML_ATTRIBUTE_SET);
+ action.start(HTML.Tag.COMMENT, new SimpleAttributeSet());
action.end(HTML.Tag.COMMENT);
}
}
@@ -1277,7 +1702,6 @@ public class HTMLDocument extends DefaultStyledDocument
public void handleEndOfLineString(String eol)
{
// FIXME: Implement.
- print ("HTMLReader.handleEndOfLineString not implemented yet");
}
/**
@@ -1287,22 +1711,48 @@ public class HTMLDocument extends DefaultStyledDocument
* @param data the text to add to the textarea
*/
protected void textAreaContent(char[] data)
- throws NotImplementedException
{
- // FIXME: Implement.
- print ("HTMLReader.textAreaContent not implemented yet");
+ try
+ {
+ int offset = textAreaDocument.getLength();
+ String text = new String(data);
+ textAreaDocument.setInitialText(text);
+ textAreaDocument.insertString(offset, text, null);
+ }
+ catch (BadLocationException ex)
+ {
+ // Must not happen as we insert at a model location that we
+ // got from the document itself.
+ assert false;
+ }
}
/**
* Adds the given text that was encountered in a <PRE> element.
- *
+ * This adds synthesized lines to hold the text runs.
+ *
* @param data the text
*/
protected void preContent(char[] data)
- throws NotImplementedException
{
- // FIXME: Implement
- print ("HTMLReader.preContent not implemented yet");
+ int start = 0;
+ for (int i = 0; i < data.length; i++)
+ {
+ if (data[i] == '\n')
+ {
+ addContent(data, start, i - start + 1);
+ blockClose(HTML.Tag.IMPLIED);
+ MutableAttributeSet atts = new SimpleAttributeSet();
+ atts.addAttribute(CSS.Attribute.WHITE_SPACE, "pre");
+ blockOpen(HTML.Tag.IMPLIED, atts);
+ start = i + 1;
+ }
+ }
+ if (start < data.length)
+ {
+ // Add remaining last line.
+ addContent(data, start, data.length - start);
+ }
}
/**
@@ -1314,17 +1764,48 @@ public class HTMLDocument extends DefaultStyledDocument
*/
protected void blockOpen(HTML.Tag t, MutableAttributeSet attr)
{
- printBuffer();
- DefaultStyledDocument.ElementSpec element;
+ if (inImpliedParagraph())
+ blockClose(HTML.Tag.IMPLIED);
+ // Push the new tag on top of the stack.
parseStack.push(t);
+
+ DefaultStyledDocument.ElementSpec element;
+
AbstractDocument.AttributeContext ctx = getAttributeContext();
AttributeSet copy = attr.copyAttributes();
copy = ctx.addAttribute(copy, StyleConstants.NameAttribute, t);
element = new DefaultStyledDocument.ElementSpec(copy,
DefaultStyledDocument.ElementSpec.StartTagType);
parseBuffer.addElement(element);
- printBuffer();
+ }
+
+ /**
+ * Returns true when we are currently inside a paragraph, either
+ * a real one or an implied, false otherwise.
+ *
+ * @return
+ */
+ private boolean inParagraph()
+ {
+ boolean inParagraph = false;
+ if (! parseStack.isEmpty())
+ {
+ HTML.Tag top = parseStack.peek();
+ inParagraph = top == HTML.Tag.P || top == HTML.Tag.IMPLIED;
+ }
+ return inParagraph;
+ }
+
+ private boolean inImpliedParagraph()
+ {
+ boolean inParagraph = false;
+ if (! parseStack.isEmpty())
+ {
+ HTML.Tag top = parseStack.peek();
+ inParagraph = top == HTML.Tag.IMPLIED;
+ }
+ return inParagraph;
}
/**
@@ -1335,32 +1816,29 @@ public class HTMLDocument extends DefaultStyledDocument
*/
protected void blockClose(HTML.Tag t)
{
- printBuffer();
DefaultStyledDocument.ElementSpec element;
+ if (inImpliedParagraph() && t != HTML.Tag.IMPLIED)
+ blockClose(HTML.Tag.IMPLIED);
+
+ // Pull the token from the stack.
+ if (! parseStack.isEmpty()) // Just to be sure.
+ parseStack.pop();
+
// If the previous tag is a start tag then we insert a synthetic
// content tag.
DefaultStyledDocument.ElementSpec prev;
- prev = (DefaultStyledDocument.ElementSpec)
- parseBuffer.get(parseBuffer.size() - 1);
- if (prev.getType() == DefaultStyledDocument.ElementSpec.StartTagType)
+ prev = parseBuffer.size() > 0 ? (DefaultStyledDocument.ElementSpec)
+ parseBuffer.get(parseBuffer.size() - 1) : null;
+ if (prev != null &&
+ prev.getType() == DefaultStyledDocument.ElementSpec.StartTagType)
{
- AbstractDocument.AttributeContext ctx = getAttributeContext();
- AttributeSet attributes = ctx.getEmptySet();
- attributes = ctx.addAttribute(attributes, StyleConstants.NameAttribute,
- HTML.Tag.CONTENT);
- element = new DefaultStyledDocument.ElementSpec(attributes,
- DefaultStyledDocument.ElementSpec.ContentType,
- new char[0], 0, 0);
- parseBuffer.add(element);
+ addContent(new char[]{' '}, 0, 1);
}
element = new DefaultStyledDocument.ElementSpec(null,
DefaultStyledDocument.ElementSpec.EndTagType);
parseBuffer.addElement(element);
- printBuffer();
- if (parseStack.size() > 0)
- parseStack.pop();
}
/**
@@ -1389,6 +1867,11 @@ public class HTMLDocument extends DefaultStyledDocument
protected void addContent(char[] data, int offs, int length,
boolean generateImpliedPIfNecessary)
{
+ if (generateImpliedPIfNecessary && ! inParagraph())
+ {
+ blockOpen(HTML.Tag.IMPLIED, new SimpleAttributeSet());
+ }
+
AbstractDocument.AttributeContext ctx = getAttributeContext();
DefaultStyledDocument.ElementSpec element;
AttributeSet attributes = null;
@@ -1405,16 +1888,16 @@ public class HTMLDocument extends DefaultStyledDocument
DefaultStyledDocument.ElementSpec.ContentType,
data, offs, length);
- printBuffer();
// Add the element to the buffer
parseBuffer.addElement(element);
- printBuffer();
- if (parseBuffer.size() > HTMLDocument.this.getTokenThreshold())
+ if (parseBuffer.size() > threshold)
{
+ if (threshold <= MAX_THRESHOLD)
+ threshold *= GROW_THRESHOLD;
try
{
- flush();
+ flushImpl();
}
catch (BadLocationException ble)
{
@@ -1431,29 +1914,23 @@ public class HTMLDocument extends DefaultStyledDocument
*/
protected void addSpecialElement(HTML.Tag t, MutableAttributeSet a)
{
+ if (t != HTML.Tag.FRAME && ! inParagraph())
+ {
+ blockOpen(HTML.Tag.IMPLIED, new SimpleAttributeSet());
+ }
+
a.addAttribute(StyleConstants.NameAttribute, t);
- // Migrate from the rather htmlAttributeSet to the faster, lighter and
- // unchangeable alternative implementation.
- AttributeSet copy = a.copyAttributes();
-
// The two spaces are required because some special elements like HR
// must be broken. At least two characters are needed to break into the
// two parts.
DefaultStyledDocument.ElementSpec spec =
- new DefaultStyledDocument.ElementSpec(copy,
+ new DefaultStyledDocument.ElementSpec(a.copyAttributes(),
DefaultStyledDocument.ElementSpec.ContentType,
- new char[] {' ', ' '}, 0, 2 );
+ new char[] {' '}, 0, 1 );
parseBuffer.add(spec);
}
- void printBuffer()
- {
- print ("\n*********BUFFER**********");
- for (int i = 0; i < parseBuffer.size(); i ++)
- print (" "+parseBuffer.get(i));
- print ("***************************");
- }
}
/**
@@ -1533,10 +2010,6 @@ public class HTMLDocument extends DefaultStyledDocument
}
};
- // Set the parent HTML tag.
- reader.parseStack.push(parent.getAttributes().getAttribute(
- StyleConstants.NameAttribute));
-
return reader;
}
@@ -1728,4 +2201,98 @@ public void setOuterHTML(Element elem, String htmlText)
// TODO charset
getParser().parse(new StringReader(htmlText), reader, true);
}
+
+ /**
+ * Overridden to tag content with the synthetic HTML.Tag.CONTENT
+ * tag.
+ */
+ protected void insertUpdate(DefaultDocumentEvent evt, AttributeSet att)
+ {
+ if (att == null)
+ {
+ SimpleAttributeSet sas = new SimpleAttributeSet();
+ sas.addAttribute(StyleConstants.NameAttribute, HTML.Tag.CONTENT);
+ att = sas;
+ }
+ super.insertUpdate(evt, att);
+ }
+
+ /**
+ * Returns <code>true</code> when this document is inside a frame,
+ * <code>false</code> otherwise.
+ *
+ * @return <code>true</code> when this document is inside a frame,
+ * <code>false</code> otherwise
+ */
+ boolean isFrameDocument()
+ {
+ return frameDocument;
+ }
+
+ /**
+ * Set <code>true</code> when this document is inside a frame,
+ * <code>false</code> otherwise.
+ *
+ * @param frameDoc <code>true</code> when this document is inside a frame,
+ * <code>false</code> otherwise
+ */
+ void setFrameDocument(boolean frameDoc)
+ {
+ frameDocument = frameDoc;
+ }
+
+ /**
+ * Returns the target that is specified in the base tag, if this is the case.
+ *
+ * @return the target that is specified in the base tag, if this is the case
+ */
+ String getBaseTarget()
+ {
+ return baseTarget;
+ }
+
+ /**
+ * Updates the A tag's pseudo class value in response to a hyperlink
+ * action.
+ *
+ * @param el the corresponding element
+ * @param value the new value
+ */
+ void updateSpecialClass(Element el, HTML.Attribute cl, String value)
+ {
+ try
+ {
+ writeLock();
+ DefaultDocumentEvent ev =
+ new DefaultDocumentEvent(el.getStartOffset(), 1,
+ DocumentEvent.EventType.CHANGE);
+ AttributeSet elAtts = el.getAttributes();
+ AttributeSet anchorAtts = (AttributeSet) elAtts.getAttribute(HTML.Tag.A);
+ if (anchorAtts != null)
+ {
+ AttributeSet copy = elAtts.copyAttributes();
+ StyleSheet ss = getStyleSheet();
+ if (value != null)
+ {
+ anchorAtts = ss.addAttribute(anchorAtts, cl, value);
+ }
+ else
+ {
+ anchorAtts = ss.removeAttribute(anchorAtts, cl);
+ }
+ MutableAttributeSet matts = (MutableAttributeSet) elAtts;
+ ev.addEdit(new AttributeUndoableEdit(el, copy, false));
+ matts.removeAttribute(HTML.Tag.A);
+ matts.addAttribute(HTML.Tag.A, anchorAtts);
+ ev.end();
+ fireChangedUpdate(ev);
+ fireUndoableEditUpdate(new UndoableEditEvent(this, ev));
+ }
+ }
+ finally
+ {
+ writeUnlock();
+ }
+ }
+
}
diff --git a/libjava/classpath/javax/swing/text/html/HTMLEditorKit.java b/libjava/classpath/javax/swing/text/html/HTMLEditorKit.java
index 5d77be8fdd4..0ede1c74ed9 100644
--- a/libjava/classpath/javax/swing/text/html/HTMLEditorKit.java
+++ b/libjava/classpath/javax/swing/text/html/HTMLEditorKit.java
@@ -39,32 +39,38 @@ exception statement from your version. */
package javax.swing.text.html;
-import gnu.classpath.NotImplementedException;
-
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import java.awt.Cursor;
+import java.awt.Point;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.io.Reader;
import java.io.Serializable;
import java.io.StringReader;
import java.io.Writer;
+import java.net.MalformedURLException;
+import java.net.URL;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext;
import javax.swing.Action;
import javax.swing.JEditorPane;
+import javax.swing.SwingUtilities;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.EditorKit;
import javax.swing.text.Element;
import javax.swing.text.MutableAttributeSet;
import javax.swing.text.StyleConstants;
-import javax.swing.text.StyleContext;
+import javax.swing.text.StyledDocument;
import javax.swing.text.StyledEditorKit;
import javax.swing.text.TextAction;
import javax.swing.text.View;
@@ -74,7 +80,7 @@ import javax.swing.text.html.parser.ParserDelegator;
/* Move these imports here after javax.swing.text.html to make it compile
with jikes. */
import gnu.javax.swing.text.html.parser.GnuParserDelegator;
-import gnu.javax.swing.text.html.parser.HTML_401Swing;
+import gnu.javax.swing.text.html.parser.HTML_401F;
/**
* @author Lillian Angel (langel at redhat dot com)
@@ -92,7 +98,12 @@ public class HTMLEditorKit
extends MouseAdapter
implements MouseMotionListener, Serializable
{
-
+
+ /**
+ * The element of the last anchor tag.
+ */
+ private Element lastAnchorElement;
+
/**
* Constructor
*/
@@ -110,11 +121,14 @@ public class HTMLEditorKit
*/
public void mouseClicked(MouseEvent e)
{
- /*
- These MouseInputAdapter methods generate mouse appropriate events around
- hyperlinks (entering, exiting, and activating).
- */
- // FIXME: Not implemented.
+ JEditorPane editor = (JEditorPane) e.getSource();
+ if (! editor.isEditable() && SwingUtilities.isLeftMouseButton(e))
+ {
+ Point loc = e.getPoint();
+ int pos = editor.viewToModel(loc);
+ if (pos >= 0)
+ activateLink(pos, editor, e.getX(), e.getY());
+ }
}
/**
@@ -124,11 +138,7 @@ public class HTMLEditorKit
*/
public void mouseDragged(MouseEvent e)
{
- /*
- These MouseInputAdapter methods generate mouse appropriate events around
- hyperlinks (entering, exiting, and activating).
- */
- // FIXME: Not implemented.
+ // Nothing to do here.
}
/**
@@ -138,29 +148,159 @@ public class HTMLEditorKit
*/
public void mouseMoved(MouseEvent e)
{
- /*
- These MouseInputAdapter methods generate mouse appropriate events around
- hyperlinks (entering, exiting, and activating).
- */
- // FIXME: Not implemented.
+ JEditorPane editor = (JEditorPane) e.getSource();
+ HTMLEditorKit kit = (HTMLEditorKit) editor.getEditorKit();
+ if (! editor.isEditable())
+ {
+ Document doc = editor.getDocument();
+ if (doc instanceof HTMLDocument)
+ {
+ Cursor newCursor = kit.getDefaultCursor();
+ HTMLDocument htmlDoc = (HTMLDocument) doc;
+ Point loc = e.getPoint();
+ int pos = editor.viewToModel(loc);
+ Element el = htmlDoc.getCharacterElement(pos);
+ if (pos < el.getStartOffset() || pos >= el.getEndOffset())
+ el = null;
+ if (el != null)
+ {
+ AttributeSet aAtts = (AttributeSet)
+ el.getAttributes().getAttribute(HTML.Tag.A);
+ if (aAtts != null)
+ {
+ if (el != lastAnchorElement)
+ {
+ if (lastAnchorElement != null)
+ htmlDoc.updateSpecialClass(lastAnchorElement,
+ HTML.Attribute.DYNAMIC_CLASS,
+ null);
+ lastAnchorElement = el;
+ htmlDoc.updateSpecialClass(el,
+ HTML.Attribute.DYNAMIC_CLASS,
+ "hover");
+ }
+ newCursor = kit.getLinkCursor();
+ }
+ else
+ {
+ if (lastAnchorElement != null)
+ htmlDoc.updateSpecialClass(lastAnchorElement,
+ HTML.Attribute.DYNAMIC_CLASS,
+ null);
+ lastAnchorElement = null;
+ }
+ }
+ else
+ {
+ if (lastAnchorElement != null)
+ htmlDoc.updateSpecialClass(lastAnchorElement,
+ HTML.Attribute.DYNAMIC_CLASS,
+ null);
+ lastAnchorElement = null;
+ }
+ if (editor.getCursor() != newCursor)
+ {
+ editor.setCursor(newCursor);
+ }
+ }
+ }
}
-
+
/**
* If the given position represents a link, then linkActivated is called
- * on the JEditorPane. Implemented to forward to the method with the same
- * name, but pos == editor == -1.
- *
- * @param pos - the position
- * @param editor - the editor pane
+ * on the JEditorPane.
+ *
+ * @param pos the position
+ * @param editor the editor pane
+ */
+ protected void activateLink(int pos, JEditorPane editor)
+ {
+ activateLink(pos, editor);
+ }
+
+ private void activateLink(int pos, JEditorPane editor, int x, int y)
+ {
+ // TODO: This is here for future extension for mapped links support.
+ // For the time beeing we implement simple hyperlinks.
+ Document doc = editor.getDocument();
+ if (doc instanceof HTMLDocument)
+ {
+ HTMLDocument htmlDoc = (HTMLDocument) doc;
+ Element el = htmlDoc.getCharacterElement(pos);
+ AttributeSet atts = el.getAttributes();
+ AttributeSet anchorAtts =
+ (AttributeSet) atts.getAttribute(HTML.Tag.A);
+ String href = null;
+ if (anchorAtts != null)
+ {
+ href = (String) anchorAtts.getAttribute(HTML.Attribute.HREF);
+ htmlDoc.updateSpecialClass(el, HTML.Attribute.PSEUDO_CLASS,
+ "visited");
+ }
+ else
+ {
+ // TODO: Implement link maps here.
+ }
+ HyperlinkEvent event = null;
+ if (href != null)
+ event = createHyperlinkEvent(editor, htmlDoc, href,
+ anchorAtts, el);
+ if (event != null)
+ editor.fireHyperlinkUpdate(event);
+ }
+
+ }
+
+ /**
+ * Creates a HyperlinkEvent for the specified href and anchor if
+ * possible. If for some reason this won't work, return null.
+ *
+ * @param editor the editor
+ * @param doc the document
+ * @param href the href link
+ * @param anchor the anchor
+ * @param el the element
+ *
+ * @return the hyperlink event, or <code>null</code> if we couldn't
+ * create one
*/
- protected void activateLink(int pos,
- JEditorPane editor)
+ private HyperlinkEvent createHyperlinkEvent(JEditorPane editor,
+ HTMLDocument doc,
+ String href,
+ AttributeSet anchor,
+ Element el)
{
- /*
- This method creates and fires a HyperlinkEvent if the document is an
- instance of HTMLDocument and the href tag of the link is not null.
- */
- // FIXME: Not implemented.
+ URL url;
+ try
+ {
+ URL base = doc.getBase();
+ url = new URL(base, href);
+
+ }
+ catch (MalformedURLException ex)
+ {
+ url = null;
+ }
+ HyperlinkEvent ev;
+ if (doc.isFrameDocument())
+ {
+ String target = null;
+ if (anchor != null)
+ target = (String) anchor.getAttribute(HTML.Attribute.TARGET);
+ if (target == null || target.equals(""))
+ target = doc.getBaseTarget();
+ if (target == null || target.equals(""))
+ target = "_self";
+ ev = new HTMLFrameHyperlinkEvent(editor,
+ HyperlinkEvent.EventType.ACTIVATED,
+ url, href, el, target);
+ }
+ else
+ {
+ ev = new HyperlinkEvent(editor, HyperlinkEvent.EventType.ACTIVATED,
+ url, href, el);
+ }
+ return ev;
}
}
@@ -201,7 +341,7 @@ public class HTMLEditorKit
* Tag to check for in the document.
*/
protected HTML.Tag parentTag;
-
+
/**
* Initializes all fields.
*
@@ -305,20 +445,9 @@ public class HTMLEditorKit
Element insertElement,
String html, HTML.Tag parentTag,
HTML.Tag addTag)
- throws NotImplementedException
{
- /*
- As its name implies, this protected method is used when HTML is inserted at a
- boundary. (A boundary in this case is an offset in doc that exactly matches the
- beginning offset of the parentTag.) It performs the extra work required to keep
- the tag stack in shape and then calls insertHTML(). The editor and doc argu-
- ments are the editor pane and document where the HTML should go. The offset
- argument represents the cursor location or selection start in doc. The insert-
- Element and parentTag arguments are used to calculate the proper number of
- tag pops and pushes before inserting the HTML (via html and addTag, which are
- passed directly to insertHTML()).
- */
- // FIXME: not implemented
+ insertAtBoundry(editor, doc, offset, insertElement,
+ html, parentTag, addTag);
}
/**
@@ -344,8 +473,50 @@ public class HTMLEditorKit
String html, HTML.Tag parentTag,
HTML.Tag addTag)
{
- insertAtBoundary(editor, doc, offset, insertElement,
- html, parentTag, addTag);
+ Element parent = insertElement;
+ Element el;
+ // Find common parent element.
+ if (offset > 0 || insertElement == null)
+ {
+ el = doc.getDefaultRootElement();
+ while (el != null && el.getStartOffset() != offset
+ && ! el.isLeaf())
+ el = el.getElement(el.getElementIndex(offset));
+ parent = el != null ? el.getParentElement() : null;
+ }
+ if (parent != null)
+ {
+ int pops = 0;
+ int pushes = 0;
+ if (offset == 0 && insertElement != null)
+ {
+ el = parent;
+ while (el != null && ! el.isLeaf())
+ {
+ el = el.getElement(el.getElementIndex(offset));
+ pops++;
+ }
+ }
+ else
+ {
+ el = parent;
+ offset--;
+ while (el != null && ! el.isLeaf())
+ {
+ el = el.getElement(el.getElementIndex(offset));
+ pops++;
+ }
+ el = parent;
+ offset++;
+ while (el != null && el != insertElement)
+ {
+ el = el.getElement(el.getElementIndex(offset));
+ pushes++;
+ }
+ }
+ pops = Math.max(0, pops - 1);
+ insertHTML(editor, doc, offset, html, pops, pushes, addTag);
+ }
}
/**
@@ -355,16 +526,97 @@ public class HTMLEditorKit
*/
public void actionPerformed(ActionEvent ae)
{
- Object source = ae.getSource();
- if (source instanceof JEditorPane)
+ JEditorPane source = getEditor(ae);
+ if (source != null)
+ {
+ HTMLDocument d = getHTMLDocument(source);
+ int offset = source.getSelectionStart();
+ int length = d.getLength();
+ boolean inserted = true;
+ if (! tryInsert(source, d, offset, parentTag, addTag))
+ {
+ inserted = tryInsert(source, d, offset, alternateParentTag,
+ alternateAddTag);
+ }
+ if (inserted)
+ adjustSelection(source, d, offset, length);
+ }
+ }
+
+ /**
+ * Tries to insert the html chunk to the specified <code>addTag</code>.
+ *
+ * @param pane the editor
+ * @param doc the document
+ * @param offset the offset at which to insert
+ * @param tag the tag at which to insert
+ * @param addTag the add tag
+ *
+ * @return <code>true</code> when the html has been inserted successfully,
+ * <code>false</code> otherwise
+ */
+ private boolean tryInsert(JEditorPane pane, HTMLDocument doc, int offset,
+ HTML.Tag tag, HTML.Tag addTag)
+ {
+ boolean inserted = false;
+ Element el = findElementMatchingTag(doc, offset, tag);
+ if (el != null && el.getStartOffset() == offset)
+ {
+ insertAtBoundary(pane, doc, offset, el, html, tag, addTag);
+ inserted = true;
+ }
+ else if (offset > 0)
+ {
+ int depth = elementCountToTag(doc, offset - 1, tag);
+ if (depth != -1)
+ {
+ insertHTML(pane, doc, offset, html, depth, 0, addTag);
+ inserted = true;
+ }
+ }
+ return inserted;
+ }
+
+ /**
+ * Adjusts the selection after an insertion has been performed.
+ *
+ * @param pane the editor pane
+ * @param doc the document
+ * @param offset the insert offset
+ * @param oldLen the old document length
+ */
+ private void adjustSelection(JEditorPane pane, HTMLDocument doc,
+ int offset, int oldLen)
+ {
+ int newLen = doc.getLength();
+ if (newLen != oldLen && offset < newLen)
{
- JEditorPane pane = ((JEditorPane) source);
- Document d = pane.getDocument();
- if (d instanceof HTMLDocument)
- insertHTML(pane, (HTMLDocument) d, 0, html, 0, 0, addTag);
- // FIXME: is this correct parameters?
+ if (offset > 0)
+ {
+ String text;
+ try
+ {
+ text = doc.getText(offset - 1, 1);
+ }
+ catch (BadLocationException ex)
+ {
+ text = null;
+ }
+ if (text != null && text.length() > 0
+ && text.charAt(0) == '\n')
+ {
+ pane.select(offset, offset);
+ }
+ else
+ {
+ pane.select(offset + 1, offset + 1);
+ }
+ }
+ else
+ {
+ pane.select(1, 1);
+ }
}
- // FIXME: else not implemented
}
}
@@ -540,53 +792,56 @@ public class HTMLEditorKit
{
HTML.Tag tag = (HTML.Tag) attr;
- if (tag.equals(HTML.Tag.IMPLIED) || tag.equals(HTML.Tag.P)
- || tag.equals(HTML.Tag.H1) || tag.equals(HTML.Tag.H2)
- || tag.equals(HTML.Tag.H3) || tag.equals(HTML.Tag.H4)
- || tag.equals(HTML.Tag.H5) || tag.equals(HTML.Tag.H6)
- || tag.equals(HTML.Tag.DT))
+ if (tag == HTML.Tag.IMPLIED || tag == HTML.Tag.P
+ || tag == HTML.Tag.H1 || tag == HTML.Tag.H2
+ || tag == HTML.Tag.H3 || tag == HTML.Tag.H4
+ || tag == HTML.Tag.H5 || tag == HTML.Tag.H6
+ || tag == HTML.Tag.DT)
view = new ParagraphView(element);
- else if (tag.equals(HTML.Tag.LI) || tag.equals(HTML.Tag.DL)
- || tag.equals(HTML.Tag.DD) || tag.equals(HTML.Tag.BODY)
- || tag.equals(HTML.Tag.HTML) || tag.equals(HTML.Tag.CENTER)
- || tag.equals(HTML.Tag.DIV)
- || tag.equals(HTML.Tag.BLOCKQUOTE)
- || tag.equals(HTML.Tag.PRE))
+ else if (tag == HTML.Tag.LI || tag == HTML.Tag.DL
+ || tag == HTML.Tag.DD || tag == HTML.Tag.BODY
+ || tag == HTML.Tag.HTML || tag == HTML.Tag.CENTER
+ || tag == HTML.Tag.DIV
+ || tag == HTML.Tag.BLOCKQUOTE
+ || tag == HTML.Tag.PRE
+ || tag == HTML.Tag.FORM
+ // Misplaced TD and TH tags get mapped as vertical block.
+ // Note that correctly placed tags get mapped in TableView.
+ || tag == HTML.Tag.TD || tag == HTML.Tag.TH)
view = new BlockView(element, View.Y_AXIS);
- else if (tag.equals(HTML.Tag.IMG))
+ else if (tag == HTML.Tag.TR)
+ // Misplaced TR tags get mapped as horizontal blocks.
+ // Note that correctly placed tags get mapped in TableView.
+ view = new BlockView(element, View.X_AXIS);
+ else if (tag == HTML.Tag.IMG)
view = new ImageView(element);
- // FIXME: Uncomment when the views have been implemented
- else if (tag.equals(HTML.Tag.CONTENT))
+ else if (tag == HTML.Tag.CONTENT)
view = new InlineView(element);
else if (tag == HTML.Tag.HEAD)
view = new NullView(element);
- else if (tag.equals(HTML.Tag.TABLE))
+ else if (tag == HTML.Tag.TABLE)
view = new javax.swing.text.html.TableView(element);
- else if (tag.equals(HTML.Tag.TD))
- view = new ParagraphView(element);
- else if (tag.equals(HTML.Tag.HR))
+ else if (tag == HTML.Tag.HR)
view = new HRuleView(element);
- else if (tag.equals(HTML.Tag.BR))
+ else if (tag == HTML.Tag.BR)
view = new BRView(element);
+ else if (tag == HTML.Tag.INPUT || tag == HTML.Tag.SELECT
+ || tag == HTML.Tag.TEXTAREA)
+ view = new FormView(element);
- /*
- else if (tag.equals(HTML.Tag.MENU) || tag.equals(HTML.Tag.DIR)
- || tag.equals(HTML.Tag.UL) || tag.equals(HTML.Tag.OL))
+ else if (tag == HTML.Tag.MENU || tag == HTML.Tag.DIR
+ || tag == HTML.Tag.UL || tag == HTML.Tag.OL)
view = new ListView(element);
- else if (tag.equals(HTML.Tag.INPUT) || tag.equals(HTML.Tag.SELECT)
- || tag.equals(HTML.Tag.TEXTAREA))
- view = new FormView(element);
- else if (tag.equals(HTML.Tag.OBJECT))
- view = new ObjectView(element);
- else if (tag.equals(HTML.Tag.FRAMESET))
+ else if (tag == HTML.Tag.FRAMESET)
view = new FrameSetView(element);
- else if (tag.equals(HTML.Tag.FRAME))
- view = new FrameView(element); */
+ else if (tag == HTML.Tag.FRAME)
+ view = new FrameView(element);
+ else if (tag == HTML.Tag.OBJECT)
+ view = new ObjectView(element);
}
if (view == null)
{
- System.err.println("missing tag->view mapping for: " + element);
view = new NullView(element);
}
return view;
@@ -797,14 +1052,42 @@ public class HTMLEditorKit
/**
* Actions for HTML
*/
- private static final Action[] defaultActions = {
- // FIXME: Add default actions for html
+ private static final Action[] defaultActions =
+ {
+ new InsertHTMLTextAction("InsertTable",
+ "<table border=1><tr><td></td></tr></table>",
+ HTML.Tag.BODY, HTML.Tag.TABLE),
+ new InsertHTMLTextAction("InsertTableRow",
+ "<table border=1><tr><td></td></tr></table>",
+ HTML.Tag.TABLE, HTML.Tag.TR,
+ HTML.Tag.BODY, HTML.Tag.TABLE),
+ new InsertHTMLTextAction("InsertTableCell",
+ "<table border=1><tr><td></td></tr></table>",
+ HTML.Tag.TR, HTML.Tag.TD,
+ HTML.Tag.BODY, HTML.Tag.TABLE),
+ new InsertHTMLTextAction("InsertUnorderedList",
+ "<ul><li></li></ul>",
+ HTML.Tag.BODY, HTML.Tag.UL),
+ new InsertHTMLTextAction("InsertUnorderedListItem",
+ "<ul><li></li></ul>",
+ HTML.Tag.UL, HTML.Tag.LI,
+ HTML.Tag.BODY, HTML.Tag.UL),
+ new InsertHTMLTextAction("InsertOrderedList",
+ "<ol><li></li></ol>",
+ HTML.Tag.BODY, HTML.Tag.OL),
+ new InsertHTMLTextAction("InsertOrderedListItem",
+ "<ol><li></li></ol>",
+ HTML.Tag.OL, HTML.Tag.LI,
+ HTML.Tag.BODY, HTML.Tag.OL),
+ new InsertHTMLTextAction("InsertPre",
+ "<pre></pre>", HTML.Tag.BODY, HTML.Tag.PRE)
+ // TODO: The reference impl has an InsertHRAction too.
};
/**
* The current style sheet.
*/
- StyleSheet styleSheet;
+ private StyleSheet styleSheet;
/**
* The ViewFactory for HTMLFactory.
@@ -829,12 +1112,7 @@ public class HTMLEditorKit
/**
* The mouse listener used for links.
*/
- LinkController mouseListener;
-
- /**
- * Style context for this editor.
- */
- StyleContext styleContext;
+ private LinkController linkController;
/** The content type */
String contentType = "text/html";
@@ -844,17 +1122,22 @@ public class HTMLEditorKit
/** The editor pane used. */
JEditorPane editorPane;
-
+
+ /**
+ * Whether or not the editor kit handles form submissions.
+ *
+ * @see #isAutoFormSubmission()
+ * @see #setAutoFormSubmission(boolean)
+ */
+ private boolean autoFormSubmission;
+
/**
* Constructs an HTMLEditorKit, creates a StyleContext, and loads the style sheet.
*/
public HTMLEditorKit()
{
- super();
- styleContext = new StyleContext();
- styleSheet = new StyleSheet();
- styleSheet.importStyleSheet(getClass().getResource(DEFAULT_CSS));
- // FIXME: Set inputAttributes with default.css
+ linkController = new LinkController();
+ autoFormSubmission = true;
}
/**
@@ -877,8 +1160,15 @@ public class HTMLEditorKit
*/
public Document createDefaultDocument()
{
- HTMLDocument document = new HTMLDocument(getStyleSheet());
+ // Protect the shared stylesheet.
+ StyleSheet styleSheet = getStyleSheet();
+ StyleSheet ss = new StyleSheet();
+ ss.addStyleSheet(styleSheet);
+
+ HTMLDocument document = new HTMLDocument(ss);
document.setParser(getParser());
+ document.setAsynchronousLoadPriority(4);
+ document.setTokenThreshold(100);
return document;
}
@@ -892,7 +1182,7 @@ public class HTMLEditorKit
{
if (parser == null)
{
- parser = new GnuParserDelegator(HTML_401Swing.getInstance());
+ parser = new GnuParserDelegator(HTML_401F.getInstance());
}
return parser;
}
@@ -923,8 +1213,7 @@ public class HTMLEditorKit
if (parser == null)
throw new IOException("Parser is null.");
- ParserCallback pc = ((HTMLDocument) doc).getReader
- (offset, popDepth, pushDepth, insertTag);
+ ParserCallback pc = doc.getReader(offset, popDepth, pushDepth, insertTag);
// FIXME: What should ignoreCharSet be set to?
@@ -991,8 +1280,15 @@ public class HTMLEditorKit
{
if (doc instanceof HTMLDocument)
{
- // FIXME: Not implemented. Use HTMLWriter.
- out.write(doc.getText(pos, len));
+ HTMLWriter writer = new HTMLWriter(out, (HTMLDocument) doc, pos, len);
+ writer.write();
+ }
+ else if (doc instanceof StyledDocument)
+ {
+ MinimalHTMLWriter writer = new MinimalHTMLWriter(out,
+ (StyledDocument) doc,
+ pos, len);
+ writer.write();
}
else
super.write(out, doc, pos, len);
@@ -1017,7 +1313,9 @@ public class HTMLEditorKit
public Object clone()
{
// FIXME: Need to clone all fields
- return (HTMLEditorKit) super.clone();
+ HTMLEditorKit copy = (HTMLEditorKit) super.clone();
+ copy.linkController = new LinkController();
+ return copy;
}
/**
@@ -1044,10 +1342,9 @@ public class HTMLEditorKit
public void install(JEditorPane c)
{
super.install(c);
- mouseListener = new LinkController();
- c.addMouseListener(mouseListener);
+ c.addMouseListener(linkController);
+ c.addMouseMotionListener(linkController);
editorPane = c;
- // FIXME: need to set up hyperlinklistener object
}
/**
@@ -1059,8 +1356,8 @@ public class HTMLEditorKit
public void deinstall(JEditorPane c)
{
super.deinstall(c);
- c.removeMouseListener(mouseListener);
- mouseListener = null;
+ c.removeMouseListener(linkController);
+ c.removeMouseMotionListener(linkController);
editorPane = null;
}
@@ -1154,8 +1451,19 @@ public class HTMLEditorKit
{
if (styleSheet == null)
{
- styleSheet = new StyleSheet();
- styleSheet.importStyleSheet(getClass().getResource(DEFAULT_CSS));
+ try
+ {
+ styleSheet = new StyleSheet();
+ Class c = HTMLEditorKit.class;
+ InputStream in = c.getResourceAsStream(DEFAULT_CSS);
+ InputStreamReader r = new InputStreamReader(in);
+ styleSheet.loadRules(r, null);
+ r.close();
+ }
+ catch (IOException ex)
+ {
+ // No style available.
+ }
}
return styleSheet;
}
@@ -1173,4 +1481,40 @@ public class HTMLEditorKit
{
styleSheet = s;
}
+
+ /**
+ * Returns <code>true</code> when forms should be automatically submitted
+ * by the editor kit. Set this to <code>false</code> when you want to
+ * intercept form submission. In this case you'd want to listen for
+ * hyperlink events on the document and handle FormSubmitEvents specially.
+ *
+ * The default is <code>true</code>.
+ *
+ * @return <code>true</code> when forms should be automatically submitted
+ * by the editor kit, <code>false</code> otherwise
+ *
+ * @since 1.5
+ *
+ * @see #setAutoFormSubmission(boolean)
+ * @see FormSubmitEvent
+ */
+ public boolean isAutoFormSubmission()
+ {
+ return autoFormSubmission;
+ }
+
+ /**
+ * Sets whether or not the editor kit should automatically submit forms.
+ *
+ * @param auto <code>true</code> when the editor kit should handle form
+ * submission, <code>false</code> otherwise
+ *
+ * @since 1.5
+ *
+ * @see #isAutoFormSubmission()
+ */
+ public void setAutoFormSubmission(boolean auto)
+ {
+ autoFormSubmission = auto;
+ }
}
diff --git a/libjava/classpath/javax/swing/text/html/HTMLWriter.java b/libjava/classpath/javax/swing/text/html/HTMLWriter.java
new file mode 100644
index 00000000000..44119c73286
--- /dev/null
+++ b/libjava/classpath/javax/swing/text/html/HTMLWriter.java
@@ -0,0 +1,1084 @@
+/* HTMLWriter.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.text.html;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import java.util.Enumeration;
+import java.util.HashSet;
+
+import javax.swing.ComboBoxModel;
+
+import javax.swing.text.AbstractWriter;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.Element;
+import javax.swing.text.StyleConstants;
+
+import javax.swing.text.html.HTML;
+import javax.swing.text.html.HTMLDocument;
+import javax.swing.text.html.Option;
+
+/**
+ * HTMLWriter,
+ * A Writer for HTMLDocuments.
+ *
+ * @author David Fu (fchoong at netbeans.jp)
+ */
+
+public class HTMLWriter
+ extends AbstractWriter
+{
+ /**
+ * We keep a reference of the writer passed by the construct.
+ */
+ private Writer outWriter = null;
+
+ /**
+ * We keep a reference of the HTMLDocument passed by the construct.
+ */
+ private HTMLDocument htmlDoc = null;
+
+ /**
+ * Used to keep track of which embeded has been written out.
+ */
+ private HashSet openEmbededTagHashSet = null;
+
+ private String new_line_str = "" + NEWLINE;
+
+ private char[] html_entity_char_arr = {'<', '>', '&', '"'};
+
+ private String[] html_entity_escape_str_arr = {"&lt;", "&gt;", "&amp;",
+ "&quot;"};
+
+ // variables used to output Html Fragment
+ private int doc_pos = -1;
+ private int doc_len = -1;
+ private int doc_offset_remaining = -1;
+ private int doc_len_remaining = -1;
+ private HashSet htmlFragmentParentHashSet = null;
+ private Element startElem = null;
+ private Element endElem = null;
+ private boolean fg_pass_start_elem = false;
+ private boolean fg_pass_end_elem = false;
+
+ /**
+ * Constructs a HTMLWriter.
+ *
+ * @param writer writer to write output to
+ * @param doc the HTMLDocument to output
+ */
+ public HTMLWriter(Writer writer, HTMLDocument doc)
+ {
+ super(writer, doc);
+ outWriter = writer;
+ htmlDoc = doc;
+ openEmbededTagHashSet = new HashSet();
+ } // public HTMLWriter(Writer writer, HTMLDocument doc)
+
+ /**
+ * Constructs a HTMLWriter which outputs a Html Fragment.
+ *
+ * @param writer <code>Writer</code> to write output to
+ * @param doc the <code>javax.swing.text.html.HTMLDocument</code>
+ * to output
+ * @param pos position to start outputing the document
+ * @param len amount to output the document
+ */
+ public HTMLWriter(Writer writer, HTMLDocument doc, int pos, int len)
+ {
+ super(writer, doc, pos, len);
+ outWriter = writer;
+ htmlDoc = doc;
+ openEmbededTagHashSet = new HashSet();
+
+ doc_pos = pos;
+ doc_offset_remaining = pos;
+ doc_len = len;
+ doc_len_remaining = len;
+ htmlFragmentParentHashSet = new HashSet();
+ } // public HTMLWriter(Writer writer, HTMLDocument doc, int pos, int len)
+
+ /**
+ * Call this method to start outputing HTML.
+ *
+ * @throws IOException on any I/O exceptions
+ * @throws BadLocationException if a pos is not a valid position in the
+ * html doc element
+ */
+ public void write()
+ throws IOException, BadLocationException
+ {
+ Element rootElem = htmlDoc.getDefaultRootElement();
+
+ if (doc_pos == -1 && doc_len == -1)
+ {
+ // Normal traversal.
+ traverse(rootElem);
+ } // if(doc_pos == -1 && doc_len == -1)
+ else
+ {
+ // Html fragment traversal.
+ if (doc_pos == -1 || doc_len == -1)
+ throw new BadLocationException("Bad Location("
+ + doc_pos + ", " + doc_len + ")", doc_pos);
+
+ startElem = htmlDoc.getCharacterElement(doc_pos);
+
+ int start_offset = startElem.getStartOffset();
+
+ // Positions before start_offset will not be traversed, and thus
+ // will not be counted.
+ if (start_offset > 0)
+ doc_offset_remaining = doc_offset_remaining - start_offset;
+
+ Element tempParentElem = startElem;
+
+ while ((tempParentElem = tempParentElem.getParentElement()) != null)
+ {
+ if (!htmlFragmentParentHashSet.contains(tempParentElem))
+ htmlFragmentParentHashSet.add(tempParentElem);
+ } // while((tempParentElem = tempParentElem.getParentElement())
+ // != null)
+
+ // NOTE: 20061030 - fchoong - the last index should not be included.
+ endElem = htmlDoc.getCharacterElement(doc_pos + doc_len - 1);
+
+ tempParentElem = endElem;
+
+ while ((tempParentElem = tempParentElem.getParentElement()) != null)
+ {
+ if (!htmlFragmentParentHashSet.contains(tempParentElem))
+ htmlFragmentParentHashSet.add(tempParentElem);
+ } // while((tempParentElem = tempParentElem.getParentElement())
+ // != null)
+
+ traverseHtmlFragment(rootElem);
+
+ } // else
+
+ // NOTE: close out remaining open embeded tags.
+ Object[] tag_arr = openEmbededTagHashSet.toArray();
+
+ for (int i = 0; i < tag_arr.length; i++)
+ {
+ writeRaw("</" + tag_arr[i].toString() + ">");
+ } // for(int i = 0; i < tag_arr.length; i++)
+
+ } // public void write() throws IOException, BadLocationException
+
+ /**
+ * Writes all the attributes in the attrSet, except for attrbutes with
+ * keys of <code>javax.swing.text.html.HTML.Tag</code>,
+ * <code>javax.swing.text.StyleConstants</code> or
+ * <code>javax.swing.text.html.HTML.Attribute.ENDTAG</code>.
+ *
+ * @param attrSet attrSet to write out
+ *
+ * @throws IOException on any I/O exceptions
+ */
+ protected void writeAttributes(AttributeSet attrSet)
+ throws IOException
+ {
+ Enumeration attrNameEnum = attrSet.getAttributeNames();
+
+ while (attrNameEnum.hasMoreElements())
+ {
+ Object key = attrNameEnum.nextElement();
+ Object value = attrSet.getAttribute(key);
+
+ // HTML.Attribute.ENDTAG is an instance, not a class.
+ if (!((key instanceof HTML.Tag) || (key instanceof StyleConstants)
+ || (key == HTML.Attribute.ENDTAG)))
+ {
+ if (key == HTML.Attribute.SELECTED)
+ writeRaw(" selected");
+ else if (key == HTML.Attribute.CHECKED)
+ writeRaw(" checked");
+ else
+ writeRaw(" " + key + "=\"" + value + "\"");
+ } // if(!((key instanceof HTML.Tag) || (key instanceof
+ // StyleConstants) || (key == HTML.Attribute.ENDTAG)))
+ } // while(attrNameEnum.hasMoreElements())
+
+ } // protected void writeAttributes(AttributeSet attrSet) throws IOException
+
+ /**
+ * Writes out an empty tag. i.e. a tag without any child elements.
+ *
+ * @param paramElem the element to output as an empty tag
+ *
+ * @throws IOException on any I/O exceptions
+ * @throws BadLocationException if a pos is not a valid position in the
+ * html doc element
+ */
+ protected void emptyTag(Element paramElem)
+ throws IOException, BadLocationException
+ {
+ String elem_name = paramElem.getName();
+ AttributeSet attrSet = paramElem.getAttributes();
+
+ writeRaw("<" + elem_name);
+ writeAttributes(attrSet);
+ writeRaw(">");
+
+ if (isBlockTag(attrSet))
+ {
+ writeRaw("</" + elem_name + ">");
+ } // if(isBlockTag(attrSet))
+
+ } // protected void emptyTag(Element paramElem)
+ // throws IOException, BadLocationException
+
+ /**
+ * Determines if it is a block tag or not.
+ *
+ * @param attrSet the attrSet of the element
+ *
+ * @return <code>true</code> if it is a block tag
+ * <code>false</code> if it is a not block tag
+ */
+ protected boolean isBlockTag(AttributeSet attrSet)
+ {
+ return ((HTML.Tag)
+ attrSet.getAttribute(StyleConstants.NameAttribute)).isBlock();
+ } // protected boolean isBlockTag(AttributeSet attrSet)
+
+ /**
+ * Writes out a start tag. Synthesized elements are skipped.
+ *
+ * @param paramElem the element to output as a start tag
+ * @throws IOException on any I/O exceptions
+ * @throws BadLocationException if a pos is not a valid position in the
+ * html doc element
+ */
+ protected void startTag(Element paramElem)
+ throws IOException, BadLocationException
+ {
+ // NOTE: Sysnthesized elements do no call this method at all.
+ String elem_name = paramElem.getName();
+ AttributeSet attrSet = paramElem.getAttributes();
+
+ indent();
+ writeRaw("<" + elem_name);
+ writeAttributes(attrSet);
+ writeRaw(">");
+ writeLineSeparator(); // Extra formatting to look more like the RI.
+ incrIndent();
+
+ } // protected void startTag(Element paramElem)
+ // throws IOException, BadLocationException
+
+ /**
+ * Writes out the contents of a textarea.
+ *
+ * @param attrSet the attrSet of the element to output as a text area
+ * @throws IOException on any I/O exceptions
+ * @throws BadLocationException if a pos is not a valid position in the
+ * html doc element
+ */
+ protected void textAreaContent(AttributeSet attrSet)
+ throws IOException, BadLocationException
+ {
+ writeLineSeparator(); // Extra formatting to look more like the RI.
+ indent();
+ writeRaw("<textarea");
+ writeAttributes(attrSet);
+ writeRaw(">");
+
+ Document tempDocument =
+ (Document) attrSet.getAttribute(StyleConstants.ModelAttribute);
+
+ writeRaw(tempDocument.getText(0, tempDocument.getLength()));
+ indent();
+ writeRaw("</textarea>");
+
+ } // protected void textAreaContent(AttributeSet attrSet)
+ // throws IOException, BadLocationException
+
+ /**
+ * Writes out text, within the appropriate range if it is specified.
+ *
+ * @param paramElem the element to output as a text
+ * @throws IOException on any I/O exceptions
+ * @throws BadLocationException if a pos is not a valid position in the
+ * html doc element
+ */
+ protected void text(Element paramElem)
+ throws IOException, BadLocationException
+ {
+ int offset = paramElem.getStartOffset();
+ int len = paramElem.getEndOffset() - paramElem.getStartOffset();
+ String txt_value = htmlDoc.getText(offset, len);
+
+ writeContent(txt_value);
+
+ } // protected void text(Element paramElem)
+ // throws IOException, BadLocationException
+
+ /**
+ * Writes out the contents of a select element.
+ *
+ * @param attrSet the attrSet of the element to output as a select box
+ *
+ * @throws IOException on any I/O exceptions
+ */
+ protected void selectContent(AttributeSet attrSet)
+ throws IOException
+ {
+ writeLineSeparator(); // Extra formatting to look more like the RI.
+ indent();
+ writeRaw("<select");
+ writeAttributes(attrSet);
+ writeRaw(">");
+ incrIndent();
+ writeLineSeparator(); // extra formatting to look more like the RI.
+
+ ComboBoxModel comboBoxModel =
+ (ComboBoxModel) attrSet.getAttribute(StyleConstants.ModelAttribute);
+
+ for (int i = 0; i < comboBoxModel.getSize(); i++)
+ {
+ writeOption((Option) comboBoxModel.getElementAt(i));
+ } // for(int i = 0; i < comboBoxModel.getSize(); i++)
+
+ decrIndent();
+ indent();
+ writeRaw("</select>");
+
+ } // protected void selectContent(AttributeSet attrSet) throws IOException
+
+ /**
+ * Writes out the contents of an option element.
+ *
+ * @param option the option object to output as a select option
+ *
+ * @throws IOException on any I/O exceptions
+ */
+ protected void writeOption(Option option)
+ throws IOException
+ {
+ indent();
+ writeRaw("<option");
+ writeAttributes(option.getAttributes());
+ writeRaw(">");
+
+ writeContent(option.getLabel());
+
+ writeRaw("</option>");
+ writeLineSeparator(); // extra formatting to look more like the RI.
+
+ } // protected void writeOption(Option option) throws IOException
+
+ /**
+ * Writes out an end tag.
+ *
+ * @param paramElem the element to output as an end tag
+ *
+ * @throws IOException on any I/O exceptions
+ */
+ protected void endTag(Element paramElem)
+ throws IOException
+ {
+ String elem_name = paramElem.getName();
+
+ //writeLineSeparator(); // Extra formatting to look more like the RI.
+ decrIndent();
+ indent();
+ writeRaw("</" + elem_name + ">");
+ writeLineSeparator(); // Extra formatting to look more like the RI.
+
+ } // protected void endTag(Element paramElem) throws IOException
+
+ /**
+ * Writes out the comment.
+ *
+ * @param paramElem the element to output as a comment
+ */
+ protected void comment(Element paramElem)
+ throws IOException, BadLocationException
+ {
+ AttributeSet attrSet = paramElem.getAttributes();
+
+ String comment_str = (String) attrSet.getAttribute(HTML.Attribute.COMMENT);
+
+ writeRaw("<!--" + comment_str + "-->");
+
+ } // protected void comment(Element paramElem)
+ // throws IOException, BadLocationException
+
+ /**
+ * Determines if element is a synthesized
+ * <code>javax.swing.text.Element</code> or not.
+ *
+ * @param element the element to test
+ *
+ * @return <code>true</code> if it is a synthesized element,
+ * <code>false</code> if it is a not synthesized element
+ */
+ protected boolean synthesizedElement(Element element)
+ {
+ AttributeSet attrSet = element.getAttributes();
+ Object tagType = attrSet.getAttribute(StyleConstants.NameAttribute);
+
+ if (tagType == HTML.Tag.CONTENT || tagType == HTML.Tag.COMMENT
+ || tagType == HTML.Tag.IMPLIED)
+ return true;
+ else
+ return false;
+ } // protected boolean synthesizedElement(Element element)
+
+ /**
+ * Determines if
+ * <code>javax.swing.text.StyleConstants.NameAttribute</code>
+ * matches tag or not.
+ *
+ * @param attrSet the <code>javax.swing.text.AttributeSet</code> of
+ * element to be matched
+ * @param tag the HTML.Tag to match
+ *
+ * @return <code>true</code> if it matches,
+ * <code>false</code> if it does not match
+ */
+ protected boolean matchNameAttribute(AttributeSet attrSet, HTML.Tag tag)
+ {
+ Object tagType = attrSet.getAttribute(StyleConstants.NameAttribute);
+
+ if (tagType == tag)
+ return true;
+ else
+ return false;
+ } // protected boolean matchNameAttribute(AttributeSet attrSet,
+ // HTML.Tag tag)
+
+ /**
+ * Writes out an embedded tag. The tags not already in
+ * openEmbededTagHashSet will written out.
+ *
+ * @param attrSet the <code>javax.swing.text.AttributeSet</code> of
+ * the element to write out
+ *
+ * @throws IOException on any I/O exceptions
+ */
+ protected void writeEmbeddedTags(AttributeSet attrSet)
+ throws IOException
+ {
+ Enumeration attrNameEnum = attrSet.getAttributeNames();
+
+ while (attrNameEnum.hasMoreElements())
+ {
+ Object key = attrNameEnum.nextElement();
+ Object value = attrSet.getAttribute(key);
+
+ if (key instanceof HTML.Tag)
+ {
+ if (!openEmbededTagHashSet.contains(key))
+ {
+ writeRaw("<" + key);
+ writeAttributes((AttributeSet) value);
+ writeRaw(">");
+ openEmbededTagHashSet.add(key);
+ } // if(!openEmbededTagHashSet.contains(key))
+ } // if(key instanceof HTML.Tag)
+ } // while(attrNameEnum.hasMoreElements())
+
+ } // protected void writeEmbeddedTags(AttributeSet attrSet)
+ // throws IOException
+
+ /**
+ * Closes out an unwanted embedded tag. The tags from the
+ * openEmbededTagHashSet not found in attrSet will be written out.
+ *
+ * @param attrSet the AttributeSet of the element to write out
+ *
+ * @throws IOException on any I/O exceptions
+ */
+ protected void closeOutUnwantedEmbeddedTags(AttributeSet attrSet)
+ throws IOException
+ {
+ Object[] tag_arr = openEmbededTagHashSet.toArray();
+
+ for (int i = 0; i < tag_arr.length; i++)
+ {
+ HTML.Tag key = (HTML.Tag) tag_arr[i];
+
+ if (!attrSet.isDefined(key))
+ {
+ writeRaw("</" + key.toString() + ">");
+ openEmbededTagHashSet.remove(key);
+ } // if(!attrSet.isDefined(key))
+ } // for(int i = 0; i < tag_arr.length; i++)
+
+ } // protected void closeOutUnwantedEmbeddedTags(AttributeSet attrSet)
+ // throws IOException
+
+ /**
+ * Writes out a line separator. Overwrites the parent to write out a new
+ * line.
+ *
+ * @throws IOException on any I/O exceptions.
+ */
+ protected void writeLineSeparator()
+ throws IOException
+ {
+ writeRaw(new_line_str);
+ } // protected void writeLineSeparator() throws IOException
+
+ /**
+ * Write to the writer. Character entites such as &lt;, &gt;
+ * are escaped appropriately.
+ *
+ * @param chars char array to write out
+ * @param off offset
+ * @param len length
+ *
+ * @throws IOException on any I/O exceptions
+ */
+ protected void output(char[] chars, int off, int len)
+ throws IOException
+ {
+ StringBuffer strBuffer = new StringBuffer();
+
+ for (int i = 0; i < chars.length; i++)
+ {
+ if (isCharHtmlEntity(chars[i]))
+ strBuffer.append(escapeCharHtmlEntity(chars[i]));
+ else
+ strBuffer.append(chars[i]);
+ } // for(int i = 0; i < chars.length; i++)
+
+ writeRaw(strBuffer.toString());
+
+ } // protected void output(char[] chars, int off, int len)
+ // throws IOException
+
+ //-------------------------------------------------------------------------
+ // private methods
+
+ /**
+ * The main method used to traverse through the elements.
+ *
+ * @param paramElem element to traverse
+ *
+ * @throws IOException on any I/O exceptions
+ */
+ private void traverse(Element paramElem)
+ throws IOException, BadLocationException
+ {
+ Element currElem = paramElem;
+
+ AttributeSet attrSet = currElem.getAttributes();
+
+ closeOutUnwantedEmbeddedTags(attrSet);
+
+ // handle the tag
+ if (synthesizedElement(paramElem))
+ {
+ if (matchNameAttribute(attrSet, HTML.Tag.CONTENT))
+ {
+ writeEmbeddedTags(attrSet);
+ text(currElem);
+ } // if(matchNameAttribute(attrSet, HTML.Tag.CONTENT))
+ else if (matchNameAttribute(attrSet, HTML.Tag.COMMENT))
+ {
+ comment(currElem);
+ } // else if(matchNameAttribute(attrSet, HTML.Tag.COMMENT))
+ else if (matchNameAttribute(attrSet, HTML.Tag.IMPLIED))
+ {
+ int child_elem_count = currElem.getElementCount();
+
+ if (child_elem_count > 0)
+ {
+ for (int i = 0; i < child_elem_count; i++)
+ {
+ Element childElem = paramElem.getElement(i);
+
+ traverse(childElem);
+
+ } // for(int i = 0; i < child_elem_count; i++)
+ } // if(child_elem_count > 0)
+ } // else if(matchNameAttribute(attrSet, HTML.Tag.IMPLIED))
+ } // if(synthesizedElement(paramElem))
+ else
+ {
+ // NOTE: 20061030 - fchoong - title is treated specially here.
+ // based on RI behavior.
+ if (matchNameAttribute(attrSet, HTML.Tag.TITLE))
+ {
+ boolean fg_is_end_tag = false;
+ Enumeration attrNameEnum = attrSet.getAttributeNames();
+
+ while (attrNameEnum.hasMoreElements())
+ {
+ Object key = attrNameEnum.nextElement();
+ Object value = attrSet.getAttribute(key);
+
+ if (key == HTML.Attribute.ENDTAG && value.equals("true"))
+ fg_is_end_tag = true;
+ } // while(attrNameEnum.hasMoreElements())
+
+ if (fg_is_end_tag)
+ writeRaw("</title>");
+ else
+ {
+ indent();
+ writeRaw("<title>");
+
+ String title_str =
+ (String) htmlDoc.getProperty(HTMLDocument.TitleProperty);
+
+ if (title_str != null)
+ writeContent(title_str);
+
+ } // else
+ } // if(matchNameAttribute(attrSet, HTML.Tag.TITLE))
+ else if (matchNameAttribute(attrSet, HTML.Tag.PRE))
+ {
+ // We pursue more stringent formating here.
+ attrSet = paramElem.getAttributes();
+
+ indent();
+ writeRaw("<pre");
+ writeAttributes(attrSet);
+ writeRaw(">");
+
+ int child_elem_count = currElem.getElementCount();
+
+ for (int i = 0; i < child_elem_count; i++)
+ {
+ Element childElem = paramElem.getElement(i);
+
+ traverse(childElem);
+
+ } // for(int i = 0; i < child_elem_count; i++)
+
+ writeRaw("</pre>");
+
+ } // else if(matchNameAttribute(attrSet, HTML.Tag.PRE))
+ else if (matchNameAttribute(attrSet, HTML.Tag.SELECT))
+ {
+ selectContent(attrSet);
+ } // else if(matchNameAttribute(attrSet, HTML.Tag.SELECT))
+ else if (matchNameAttribute(attrSet, HTML.Tag.TEXTAREA))
+ {
+ textAreaContent(attrSet);
+ } // else if(matchNameAttribute(attrSet, HTML.Tag.TEXTAREA))
+ else
+ {
+ int child_elem_count = currElem.getElementCount();
+
+ if (child_elem_count > 0)
+ {
+ startTag(currElem);
+
+ for (int i = 0; i < child_elem_count; i++)
+ {
+ Element childElem = paramElem.getElement(i);
+
+ traverse(childElem);
+
+ } // for(int i = 0; i < child_elem_count; i++)
+
+ endTag(currElem);
+
+ } // if(child_elem_count > 0)
+ else
+ {
+ emptyTag(currElem);
+ } // else
+ } // else
+ } // else
+
+ } // private void traverse(Element paramElem)
+ // throws IOException, BadLocationException
+
+ /**
+ * The method used to traverse through a html fragment.
+ *
+ * @param paramElem element to traverse
+ *
+ * @throws IOException on any I/O exceptions
+ */
+ private void traverseHtmlFragment(Element paramElem)
+ throws IOException, BadLocationException
+ {
+ // NOTE: This method is similar to traverse(Element paramElem)
+ Element currElem = paramElem;
+
+ boolean fg_is_fragment_parent_elem = false;
+ boolean fg_is_start_and_end_elem = false;
+
+ if (htmlFragmentParentHashSet.contains(paramElem))
+ fg_is_fragment_parent_elem = true;
+
+ if (paramElem == startElem)
+ fg_pass_start_elem = true;
+
+ if (paramElem == startElem && paramElem == endElem)
+ fg_is_start_and_end_elem = true;
+
+ AttributeSet attrSet = currElem.getAttributes();
+
+ closeOutUnwantedEmbeddedTags(attrSet);
+
+ if (fg_is_fragment_parent_elem || (fg_pass_start_elem
+ && fg_pass_end_elem == false) || fg_is_start_and_end_elem)
+ {
+ // handle the tag
+ if (synthesizedElement(paramElem))
+ {
+ if (matchNameAttribute(attrSet, HTML.Tag.CONTENT))
+ {
+ writeEmbeddedTags(attrSet);
+
+ int content_offset = paramElem.getStartOffset();
+ int content_length = currElem.getEndOffset() - content_offset;
+
+ if (doc_offset_remaining > 0)
+ {
+ if (content_length > doc_offset_remaining)
+ {
+ int split_len = content_length;
+
+ split_len = split_len - doc_offset_remaining;
+
+ if (split_len > doc_len_remaining)
+ split_len = doc_len_remaining;
+
+ // we need to split it.
+ String txt_value = htmlDoc.getText(content_offset
+ + doc_offset_remaining, split_len);
+
+ writeContent(txt_value);
+
+ doc_offset_remaining = 0; // the offset is used up.
+ doc_len_remaining = doc_len_remaining - split_len;
+ } // if(content_length > doc_offset_remaining)
+ else
+ {
+ // doc_offset_remaining is greater than the entire
+ // length of content
+ doc_offset_remaining = doc_offset_remaining
+ - content_length;
+ } // else
+ } // if(doc_offset_remaining > 0)
+ else if (content_length <= doc_len_remaining)
+ {
+ // we can fit the entire content.
+ text(currElem);
+ doc_len_remaining = doc_len_remaining - content_length;
+ } // else if(content_length <= doc_len_remaining)
+ else
+ {
+ // we need to split it.
+ String txt_value = htmlDoc.getText(content_offset,
+ doc_len_remaining);
+
+ writeContent(txt_value);
+
+ doc_len_remaining = 0;
+ } // else
+
+ } // if(matchNameAttribute(attrSet, HTML.Tag.CONTENT))
+ else if (matchNameAttribute(attrSet, HTML.Tag.COMMENT))
+ {
+ comment(currElem);
+ } // else if(matchNameAttribute(attrSet, HTML.Tag.COMMENT))
+ else if (matchNameAttribute(attrSet, HTML.Tag.IMPLIED))
+ {
+ int child_elem_count = currElem.getElementCount();
+
+ if (child_elem_count > 0)
+ {
+ for (int i = 0; i < child_elem_count; i++)
+ {
+ Element childElem = paramElem.getElement(i);
+
+ traverseHtmlFragment(childElem);
+
+ } // for(int i = 0; i < child_elem_count; i++)
+ } // if(child_elem_count > 0)
+ } // else if(matchNameAttribute(attrSet, HTML.Tag.IMPLIED))
+ } // if(synthesizedElement(paramElem))
+ else
+ {
+ // NOTE: 20061030 - fchoong - the isLeaf() condition seems to
+ // generate the closest behavior to the RI.
+ if (paramElem.isLeaf())
+ {
+ if (doc_offset_remaining > 0)
+ {
+ doc_offset_remaining--;
+ } // if(doc_offset_remaining > 0)
+ else if (doc_len_remaining > 0)
+ {
+ doc_len_remaining--;
+ } // else if(doc_len_remaining > 0)
+ } // if(paramElem.isLeaf())
+
+ // NOTE: 20061030 - fchoong - title is treated specially here.
+ // based on RI behavior.
+ if (matchNameAttribute(attrSet, HTML.Tag.TITLE))
+ {
+ boolean fg_is_end_tag = false;
+ Enumeration attrNameEnum = attrSet.getAttributeNames();
+
+ while (attrNameEnum.hasMoreElements())
+ {
+ Object key = attrNameEnum.nextElement();
+ Object value = attrSet.getAttribute(key);
+
+ if (key == HTML.Attribute.ENDTAG && value.equals("true"))
+ fg_is_end_tag = true;
+ } // while(attrNameEnum.hasMoreElements())
+
+ if (fg_is_end_tag)
+ writeRaw("</title>");
+ else
+ {
+ indent();
+ writeRaw("<title>");
+
+ String title_str =
+ (String) htmlDoc.getProperty(HTMLDocument.TitleProperty);
+
+ if (title_str != null)
+ writeContent(title_str);
+
+ } // else
+ } // if(matchNameAttribute(attrSet, HTML.Tag.TITLE))
+ else if (matchNameAttribute(attrSet, HTML.Tag.PRE))
+ {
+ // We pursue more stringent formating here.
+ attrSet = paramElem.getAttributes();
+
+ indent();
+ writeRaw("<pre");
+ writeAttributes(attrSet);
+ writeRaw(">");
+
+ int child_elem_count = currElem.getElementCount();
+
+ for (int i = 0; i < child_elem_count; i++)
+ {
+ Element childElem = paramElem.getElement(i);
+
+ traverseHtmlFragment(childElem);
+
+ } // for(int i = 0; i < child_elem_count; i++)
+
+ writeRaw("</pre>");
+
+ } // else if(matchNameAttribute(attrSet, HTML.Tag.PRE))
+ else if (matchNameAttribute(attrSet, HTML.Tag.SELECT))
+ {
+ selectContent(attrSet);
+ } // else if(matchNameAttribute(attrSet, HTML.Tag.SELECT))
+ else if (matchNameAttribute(attrSet, HTML.Tag.TEXTAREA))
+ {
+ textAreaContent(attrSet);
+ } // else if(matchNameAttribute(attrSet, HTML.Tag.TEXTAREA))
+ else
+ {
+ int child_elem_count = currElem.getElementCount();
+
+ if (child_elem_count > 0)
+ {
+ startTag(currElem);
+
+ for (int i = 0; i < child_elem_count; i++)
+ {
+ Element childElem = paramElem.getElement(i);
+
+ traverseHtmlFragment(childElem);
+
+ } // for(int i = 0; i < child_elem_count; i++)
+
+ endTag(currElem);
+
+ } // if(child_elem_count > 0)
+ else
+ {
+ emptyTag(currElem);
+ } // else
+ } // else
+ } // else
+
+ } // if(fg_is_fragment_parent_elem || (fg_pass_start_elem
+ // && fg_pass_end_elem == false) || fg_is_start_and_end_elem)
+
+ if (paramElem == endElem)
+ fg_pass_end_elem = true;
+
+ } // private void traverseHtmlFragment(Element paramElem)
+ // throws IOException, BadLocationException
+
+ /**
+ * Write to the writer without any modifications.
+ *
+ * @param param_str the str to write out
+ *
+ * @throws IOException on any I/O exceptions
+ */
+ private void writeRaw(String param_str)
+ throws IOException
+ {
+ super.output(param_str.toCharArray(), 0, param_str.length());
+ } // private void writeRaw(char[] chars, int off, int len)
+ // throws IOException
+
+ /**
+ * Write to the writer, escaping HTML character entitie where neccessary.
+ *
+ * @param param_str the str to write out
+ *
+ * @throws IOException on any I/O exceptions
+ */
+ private void writeContent(String param_str)
+ throws IOException
+ {
+ char[] str_char_arr = param_str.toCharArray();
+
+ if (hasHtmlEntity(param_str))
+ output(str_char_arr, 0, str_char_arr.length);
+ else
+ super.output(str_char_arr, 0, str_char_arr.length);
+
+ } // private void writeContent(String param_str) throws IOException
+
+ /**
+ * Use this for debugging. Writes out all attributes regardless of type.
+ *
+ * @param attrSet the <code>javax.swing.text.AttributeSet</code> to
+ * write out
+ *
+ * @throws IOException on any I/O exceptions
+ */
+ private void writeAllAttributes(AttributeSet attrSet)
+ throws IOException
+ {
+ Enumeration attrNameEnum = attrSet.getAttributeNames();
+
+ while (attrNameEnum.hasMoreElements())
+ {
+ Object key = attrNameEnum.nextElement();
+ Object value = attrSet.getAttribute(key);
+
+ writeRaw(" " + key + "=\"" + value + "\"");
+ writeRaw(" " + key.getClass().toString() + "=\""
+ + value.getClass().toString() + "\"");
+ } // while(attrNameEnum.hasMoreElements())
+
+ } // private void writeAllAttributes(AttributeSet attrSet)
+ // throws IOException
+
+ /**
+ * Tests if the str contains any html entities.
+ *
+ * @param param_str the str to test
+ *
+ * @return <code>true</code> if it has a html entity
+ * <code>false</code> if it does not have a html entity
+ */
+ private boolean hasHtmlEntity(String param_str)
+ {
+ boolean ret_bool = false;
+
+ for (int i = 0; i < html_entity_char_arr.length; i++)
+ {
+ if (param_str.indexOf(html_entity_char_arr[i]) != -1)
+ {
+ ret_bool = true;
+ break;
+ } // if(param_str.indexOf(html_entity_char_arr[i]) != -1)
+ } // for(int i = 0; i < html_entity_char_arr.length; i++)
+
+ return ret_bool;
+ } // private boolean hasHtmlEntity(String param_str)
+
+ /**
+ * Tests if the char is a html entities.
+ *
+ * @param param_char the char to test
+ *
+ * @return <code>true</code> if it is a html entity
+ * <code>false</code> if it is not a html entity.
+ */
+ private boolean isCharHtmlEntity(char param_char)
+ {
+ boolean ret_bool = false;
+
+ for (int i = 0; i < html_entity_char_arr.length; i++)
+ {
+ if (param_char == html_entity_char_arr[i])
+ {
+ ret_bool = true;
+ break;
+ } // if(param_char == html_entity_char_arr[i])
+ } // for(int i = 0; i < html_entity_char_arr.length; i++)
+
+ return ret_bool;
+ } // private boolean hasHtmlEntity(String param_str)
+
+ /**
+ * Escape html entities.
+ *
+ * @param param_char the char to escape
+ *
+ * @return escaped html entity. Original char is returned as a str if is
+ * is not a html entity
+ */
+ private String escapeCharHtmlEntity(char param_char)
+ {
+ String ret_str = "" + param_char;
+
+ for (int i = 0; i < html_entity_char_arr.length; i++)
+ {
+ if (param_char == html_entity_char_arr[i])
+ {
+ ret_str = html_entity_escape_str_arr[i];
+ break;
+ } // if(param_char == html_entity_char_arr[i])
+ } // for(int i = 0; i < html_entity_char_arr.length; i++)
+
+ return ret_str;
+ } // private String escapeCharHtmlEntity(char param_char)
+
+} // public class HTMLWriter extends AbstractWriter \ No newline at end of file
diff --git a/libjava/classpath/javax/swing/text/html/ImageView.java b/libjava/classpath/javax/swing/text/html/ImageView.java
index 84b021070a9..bf906e4500e 100644
--- a/libjava/classpath/javax/swing/text/html/ImageView.java
+++ b/libjava/classpath/javax/swing/text/html/ImageView.java
@@ -1,18 +1,21 @@
package javax.swing.text.html;
-import gnu.javax.swing.text.html.CombinedAttributes;
import gnu.javax.swing.text.html.ImageViewIconFactory;
+import gnu.javax.swing.text.html.css.Length;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.Rectangle;
import java.awt.Shape;
+import java.awt.Toolkit;
+import java.awt.image.ImageObserver;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.Icon;
-import javax.swing.ImageIcon;
+import javax.swing.SwingUtilities;
+import javax.swing.text.AbstractDocument;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
@@ -29,15 +32,38 @@ import javax.swing.text.html.HTML.Attribute;
public class ImageView extends View
{
/**
+ * Tracks image loading state and performs the necessary layout updates.
+ */
+ class Observer
+ implements ImageObserver
+ {
+
+ public boolean imageUpdate(Image image, int flags, int x, int y, int width, int height)
+ {
+ boolean widthChanged = false;
+ if ((flags & ImageObserver.WIDTH) != 0 && spans[X_AXIS] == null)
+ widthChanged = true;
+ boolean heightChanged = false;
+ if ((flags & ImageObserver.HEIGHT) != 0 && spans[Y_AXIS] == null)
+ heightChanged = true;
+ if (widthChanged || heightChanged)
+ safePreferenceChanged(ImageView.this, widthChanged, heightChanged);
+ boolean ret = (flags & ALLBITS) != 0;
+ return ret;
+ }
+
+ }
+
+ /**
* True if the image loads synchronuosly (on demand). By default, the image
* loads asynchronuosly.
*/
boolean loadOnDemand;
-
+
/**
* The image icon, wrapping the image,
*/
- ImageIcon imageIcon;
+ Image image;
/**
* The image state.
@@ -45,6 +71,58 @@ public class ImageView extends View
byte imageState = MediaTracker.LOADING;
/**
+ * True when the image needs re-loading, false otherwise.
+ */
+ private boolean reloadImage;
+
+ /**
+ * True when the image properties need re-loading, false otherwise.
+ */
+ private boolean reloadProperties;
+
+ /**
+ * True when the width is set as CSS/HTML attribute.
+ */
+ private boolean haveWidth;
+
+ /**
+ * True when the height is set as CSS/HTML attribute.
+ */
+ private boolean haveHeight;
+
+ /**
+ * True when the image is currently loading.
+ */
+ private boolean loading;
+
+ /**
+ * The current width of the image.
+ */
+ private int width;
+
+ /**
+ * The current height of the image.
+ */
+ private int height;
+
+ /**
+ * Our ImageObserver for tracking the loading state.
+ */
+ private ImageObserver observer;
+
+ /**
+ * The CSS width and height.
+ *
+ * Package private to avoid synthetic accessor methods.
+ */
+ Length[] spans;
+
+ /**
+ * The cached attributes.
+ */
+ private AttributeSet attributes;
+
+ /**
* Creates the image view that represents the given element.
*
* @param element the element, represented by this image view.
@@ -52,25 +130,36 @@ public class ImageView extends View
public ImageView(Element element)
{
super(element);
+ spans = new Length[2];
+ observer = new Observer();
+ reloadProperties = true;
+ reloadImage = true;
+ loadOnDemand = false;
}
/**
* Load or reload the image. This method initiates the image reloading. After
* the image is ready, the repaint event will be scheduled. The current image,
* if it already exists, will be discarded.
- *
- * @param itsTime
- * also load if the "on demand" property is set
*/
- void reloadImage(boolean itsTime)
+ private void reloadImage()
{
- URL url = getImageURL();
- if (url == null)
- imageState = (byte) MediaTracker.ERRORED;
- else if (!(loadOnDemand && !itsTime))
- imageIcon = new ImageIcon(url);
- else
- imageState = (byte) MediaTracker.LOADING;
+ loading = true;
+ reloadImage = false;
+ haveWidth = false;
+ haveHeight = false;
+ image = null;
+ width = 0;
+ height = 0;
+ try
+ {
+ loadImage();
+ updateSize();
+ }
+ finally
+ {
+ loading = false;
+ }
}
/**
@@ -146,12 +235,9 @@ public class ImageView extends View
*/
public AttributeSet getAttributes()
{
- StyleSheet styles = getStyleSheet();
- if (styles == null)
- return super.getAttributes();
- else
- return CombinedAttributes.combine(super.getAttributes(),
- styles.getViewAttributes(this));
+ if (attributes == null)
+ attributes = getStyleSheet().getViewAttributes(this);
+ return attributes;
}
/**
@@ -159,10 +245,8 @@ public class ImageView extends View
*/
public Image getImage()
{
- if (imageIcon == null)
- return null;
- else
- return imageIcon.getImage();
+ updateState();
+ return image;
}
/**
@@ -175,19 +259,22 @@ public class ImageView extends View
*/
public URL getImageURL()
{
- Object url = getAttributes().getAttribute(Attribute.SRC);
- if (url == null)
- return null;
-
- try
+ Element el = getElement();
+ String src = (String) el.getAttributes().getAttribute(Attribute.SRC);
+ URL url = null;
+ if (src != null)
{
- return new URL(url.toString());
- }
- catch (MalformedURLException e)
- {
- // The URL is malformed - no image.
- return null;
+ URL base = ((HTMLDocument) getDocument()).getBase();
+ try
+ {
+ url = new URL(base, src);
+ }
+ catch (MalformedURLException ex)
+ {
+ // Return null.
+ }
}
+ return url;
}
/**
@@ -242,9 +329,8 @@ public class ImageView extends View
if (axis == View.X_AXIS)
{
- Object w = attrs.getAttribute(Attribute.WIDTH);
- if (w != null)
- return Integer.parseInt(w.toString());
+ if (spans[axis] != null)
+ return spans[axis].getValue();
else if (image != null)
return image.getWidth(getContainer());
else
@@ -252,9 +338,8 @@ public class ImageView extends View
}
else if (axis == View.Y_AXIS)
{
- Object w = attrs.getAttribute(Attribute.HEIGHT);
- if (w != null)
- return Integer.parseInt(w.toString());
+ if (spans[axis] != null)
+ return spans[axis].getValue();
else if (image != null)
return image.getHeight(getContainer());
else
@@ -271,11 +356,8 @@ public class ImageView extends View
*/
protected StyleSheet getStyleSheet()
{
- Document d = getElement().getDocument();
- if (d instanceof HTMLDocument)
- return ((HTMLDocument) d).getStyleSheet();
- else
- return null;
+ HTMLDocument doc = (HTMLDocument) getDocument();
+ return doc.getStyleSheet();
}
/**
@@ -288,7 +370,7 @@ public class ImageView extends View
{
return getAltText();
}
-
+
/**
* Paints the image or one of the two image state icons. The image is resized
* to the shape bounds. If there is no image available, the alternative text
@@ -302,83 +384,22 @@ public class ImageView extends View
*/
public void paint(Graphics g, Shape bounds)
{
- Rectangle r = bounds.getBounds();
-
- if (imageIcon == null)
-
- {
- // Loading image on demand, rendering the loading icon so far.
- reloadImage(true);
-
- // The reloadImage sets the imageIcon, unless the URL is broken
- // or malformed.
- if (imageIcon != null)
- {
- if (imageIcon.getImageLoadStatus() != MediaTracker.COMPLETE)
- {
- // Render "not ready" icon, unless the image is ready
- // immediately.
- renderIcon(g, r, getLoadingImageIcon());
- // Add the listener to repaint when the icon will be ready.
- imageIcon.setImageObserver(getContainer());
- return;
- }
- }
- else
- {
- renderIcon(g, r, getNoImageIcon());
- return;
- }
- }
-
- imageState = (byte) imageIcon.getImageLoadStatus();
-
- switch (imageState)
- {
- case MediaTracker.ABORTED:
- case MediaTracker.ERRORED:
- renderIcon(g, r, getNoImageIcon());
- break;
- case MediaTracker.LOADING:
- // If the image is not loaded completely, we still render it, as the
- // partial image may be available.
- case MediaTracker.COMPLETE:
+ updateState();
+ Rectangle r = bounds instanceof Rectangle ? (Rectangle) bounds
+ : bounds.getBounds();
+ Image image = getImage();
+ if (image != null)
{
- // Paint the scaled image.
- Image scaled = imageIcon.getImage().getScaledInstance(
- r.width,
- r.height,
- Image.SCALE_DEFAULT);
- ImageIcon painter = new ImageIcon(scaled);
- painter.paintIcon(getContainer(), g, r.x, r.y);
- }
- break;
+ g.drawImage(image, r.x, r.y, r.width, r.height, observer);
}
- }
-
- /**
- * Render "no image" icon and the alternative "no image" text. The text is
- * rendered right from the icon and is aligned to the icon bottom.
- */
- private void renderIcon(Graphics g, Rectangle bounds, Icon icon)
- {
- Shape current = g.getClip();
- try
+ else
{
- g.setClip(bounds);
+ Icon icon = getNoImageIcon();
if (icon != null)
- {
- icon.paintIcon(getContainer(), g, bounds.x, bounds.y);
- g.drawString(getAltText(), bounds.x + icon.getIconWidth(),
- bounds.y + icon.getIconHeight());
- }
- }
- finally
- {
- g.setClip(current);
+ icon.paintIcon(getContainer(), g, r.x, r.y);
}
}
-
+
/**
* Set if the image should be loaded only when needed (synchronuosly). By
* default, the image loads asynchronuosly. If the image is not yet ready, the
@@ -395,9 +416,20 @@ public class ImageView extends View
*/
protected void setPropertiesFromAttributes()
{
- // In the current implementation, nothing is cached yet, unless the image
- // itself.
- imageIcon = null;
+ AttributeSet atts = getAttributes();
+ StyleSheet ss = getStyleSheet();
+ float emBase = ss.getEMBase(atts);
+ float exBase = ss.getEXBase(atts);
+ spans[X_AXIS] = (Length) atts.getAttribute(CSS.Attribute.WIDTH);
+ if (spans[X_AXIS] != null)
+ {
+ spans[X_AXIS].setFontBases(emBase, exBase);
+ }
+ spans[Y_AXIS] = (Length) atts.getAttribute(CSS.Attribute.HEIGHT);
+ if (spans[Y_AXIS] != null)
+ {
+ spans[Y_AXIS].setFontBases(emBase, exBase);
+ }
}
/**
@@ -433,9 +465,130 @@ public class ImageView extends View
*/
public void setSize(float width, float height)
{
- if (imageIcon == null)
- reloadImage(false);
+ updateState();
+ // TODO: Implement this when we have an alt view for the alt=... attribute.
}
-
+ /**
+ * This makes sure that the image and properties have been loaded.
+ */
+ private void updateState()
+ {
+ if (reloadImage)
+ reloadImage();
+ if (reloadProperties)
+ setPropertiesFromAttributes();
+ }
+
+ /**
+ * Actually loads the image.
+ */
+ private void loadImage()
+ {
+ URL src = getImageURL();
+ Image newImage = null;
+ if (src != null)
+ {
+ // Call getImage(URL) to allow the toolkit caching of that image URL.
+ Toolkit tk = Toolkit.getDefaultToolkit();
+ newImage = tk.getImage(src);
+ tk.prepareImage(newImage, -1, -1, observer);
+ if (newImage != null && getLoadsSynchronously())
+ {
+ // Load image synchronously.
+ MediaTracker tracker = new MediaTracker(getContainer());
+ tracker.addImage(newImage, 0);
+ try
+ {
+ tracker.waitForID(0);
+ }
+ catch (InterruptedException ex)
+ {
+ Thread.interrupted();
+ }
+
+ }
+ }
+ image = newImage;
+ }
+
+ /**
+ * Updates the size parameters of the image.
+ */
+ private void updateSize()
+ {
+ int newW = 0;
+ int newH = 0;
+ Image newIm = getImage();
+ if (newIm != null)
+ {
+ AttributeSet atts = getAttributes();
+ // Fetch width.
+ Length l = spans[X_AXIS];
+ if (l != null)
+ {
+ newW = (int) l.getValue();
+ haveWidth = true;
+ }
+ else
+ {
+ newW = newIm.getWidth(observer);
+ }
+ // Fetch height.
+ l = spans[Y_AXIS];
+ if (l != null)
+ {
+ newH = (int) l.getValue();
+ haveHeight = true;
+ }
+ else
+ {
+ newW = newIm.getWidth(observer);
+ }
+ // Go and trigger loading.
+ Toolkit tk = Toolkit.getDefaultToolkit();
+ if (haveWidth || haveHeight)
+ tk.prepareImage(newIm, width, height, observer);
+ else
+ tk.prepareImage(newIm, -1, -1, observer);
+ }
+ }
+
+ /**
+ * Calls preferenceChanged from the event dispatch thread and within
+ * a read lock to protect us from threading issues.
+ *
+ * @param v the view
+ * @param width true when the width changed
+ * @param height true when the height changed
+ */
+ void safePreferenceChanged(final View v, final boolean width,
+ final boolean height)
+ {
+ if (SwingUtilities.isEventDispatchThread())
+ {
+ Document doc = getDocument();
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readLock();
+ try
+ {
+ preferenceChanged(v, width, height);
+ }
+ finally
+ {
+ if (doc instanceof AbstractDocument)
+ ((AbstractDocument) doc).readUnlock();
+ }
+ }
+ else
+ {
+ SwingUtilities.invokeLater(new Runnable()
+ {
+ public void run()
+ {
+ safePreferenceChanged(v, width, height);
+ }
+ });
+ }
+ }
}
diff --git a/libjava/classpath/javax/swing/text/html/InlineView.java b/libjava/classpath/javax/swing/text/html/InlineView.java
index 77ec86e8263..58edc738526 100644
--- a/libjava/classpath/javax/swing/text/html/InlineView.java
+++ b/libjava/classpath/javax/swing/text/html/InlineView.java
@@ -38,13 +38,17 @@ exception statement from your version. */
package javax.swing.text.html;
+import java.awt.FontMetrics;
import java.awt.Shape;
+import java.text.BreakIterator;
import javax.swing.event.DocumentEvent;
import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.Element;
import javax.swing.text.LabelView;
+import javax.swing.text.Segment;
import javax.swing.text.View;
import javax.swing.text.ViewFactory;
@@ -60,6 +64,23 @@ public class InlineView
{
/**
+ * The attributes used by this view.
+ */
+ private AttributeSet attributes;
+
+ /**
+ * The span of the longest word in this view.
+ *
+ * @see #getLongestWord()
+ */
+ private float longestWord;
+
+ /**
+ * Indicates if we may wrap or not.
+ */
+ private boolean nowrap;
+
+ /**
* Creates a new <code>InlineView</code> that renders the specified element.
*
* @param element the element for this view
@@ -115,6 +136,9 @@ public class InlineView
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
{
super.changedUpdate(e, a, f);
+ StyleSheet ss = getStyleSheet();
+ attributes = ss.getViewAttributes(this);
+ preferenceChanged(null, true, true);
setPropertiesFromAttributes();
}
@@ -126,15 +150,23 @@ public class InlineView
*/
public AttributeSet getAttributes()
{
- // FIXME: Implement this.
- return super.getAttributes();
+ if (attributes == null)
+ {
+ StyleSheet ss = getStyleSheet();
+ attributes = ss.getViewAttributes(this);
+ }
+ return attributes;
}
public int getBreakWeight(int axis, float pos, float len)
{
- // FIXME: Implement this.
- return super.getBreakWeight(axis, pos, len);
+ int weight;
+ if (nowrap)
+ weight = BadBreakWeight;
+ else
+ weight = super.getBreakWeight(axis, pos, len);
+ return weight;
}
public View breakView(int axis, int offset, float pos, float len)
@@ -143,10 +175,48 @@ public class InlineView
return super.breakView(axis, offset, pos, len);
}
+ /**
+ * Loads the character style properties from the stylesheet.
+ */
protected void setPropertiesFromAttributes()
{
- // FIXME: Implement this.
super.setPropertiesFromAttributes();
+ AttributeSet atts = getAttributes();
+ Object o = atts.getAttribute(CSS.Attribute.TEXT_DECORATION);
+
+ // Check for underline.
+ boolean b = false;
+ if (o != null && o.toString().contains("underline"))
+ b = true;
+ setUnderline(b);
+
+ // Check for line-through.
+ b = false;
+ if (o != null && o.toString().contains("line-through"))
+ b = true;
+ setStrikeThrough(b);
+
+ // Check for vertical alignment (subscript/superscript).
+ o = atts.getAttribute(CSS.Attribute.VERTICAL_ALIGN);
+
+ // Subscript.
+ b = false;
+ if (o != null && o.toString().contains("sub"))
+ b = true;
+ setSubscript(b);
+
+ // Superscript.
+ b = false;
+ if (o != null && o.toString().contains("sup"))
+ b = true;
+ setSuperscript(b);
+
+ // Fetch nowrap setting.
+ o = atts.getAttribute(CSS.Attribute.WHITE_SPACE);
+ if (o != null && o.equals("nowrap"))
+ nowrap = true;
+ else
+ nowrap = false;
}
/**
@@ -163,4 +233,75 @@ public class InlineView
styleSheet = ((HTMLDocument) doc).getStyleSheet();
return styleSheet;
}
+
+ /**
+ * Returns the minimum span for the specified axis. This returns the
+ * width of the longest word for the X axis and the super behaviour for
+ * the Y axis. This is a slight deviation from the reference implementation.
+ * IMO this should improve rendering behaviour so that an InlineView never
+ * gets smaller than the longest word in it.
+ */
+ public float getMinimumSpan(int axis)
+ {
+ float min = super.getMinimumSpan(axis);
+ if (axis == X_AXIS)
+ min = Math.max(getLongestWord(), min);
+ return min;
+ }
+
+ /**
+ * Returns the span of the longest word in this view.
+ *
+ * @return the span of the longest word in this view
+ */
+ private float getLongestWord()
+ {
+ if (longestWord == -1)
+ longestWord = calculateLongestWord();
+ return longestWord;
+ }
+
+ /**
+ * Calculates the span of the longest word in this view.
+ *
+ * @return the span of the longest word in this view
+ */
+ private float calculateLongestWord()
+ {
+ float span = 0;
+ try
+ {
+ Document doc = getDocument();
+ int p0 = getStartOffset();
+ int p1 = getEndOffset();
+ Segment s = new Segment();
+ doc.getText(p0, p1 - p0, s);
+ BreakIterator iter = BreakIterator.getWordInstance();
+ iter.setText(s);
+ int wordStart = p0;
+ int wordEnd = p0;
+ int start = iter.first();
+ for (int end = iter.next(); end != BreakIterator.DONE;
+ start = end, end = iter.next())
+ {
+ if ((end - start) > (wordEnd - wordStart))
+ {
+ wordStart = start;
+ wordEnd = end;
+ }
+ }
+ if (wordEnd - wordStart > 0)
+ {
+ FontMetrics fm = getFontMetrics();
+ int offset = s.offset + wordStart - s.getBeginIndex();
+ span = fm.charsWidth(s.array, offset, wordEnd - wordStart);
+ }
+ }
+ catch (BadLocationException ex)
+ {
+ // Return 0.
+ }
+ return span;
+ }
+
}
diff --git a/libjava/classpath/javax/swing/text/html/ListView.java b/libjava/classpath/javax/swing/text/html/ListView.java
index c07d3598c92..3e809bbd209 100644
--- a/libjava/classpath/javax/swing/text/html/ListView.java
+++ b/libjava/classpath/javax/swing/text/html/ListView.java
@@ -94,9 +94,6 @@ public class ListView
public void paint(Graphics g, Shape allocation)
{
super.paint(g, allocation);
- // FIXME: Why is this overridden? I think that painting would be done
- // by the superclass and the stylesheet... Maybe find out when this
- // stuff is implemented properly.
}
/**
diff --git a/libjava/classpath/javax/swing/text/html/MultiAttributeSet.java b/libjava/classpath/javax/swing/text/html/MultiAttributeSet.java
new file mode 100644
index 00000000000..0f1145084e1
--- /dev/null
+++ b/libjava/classpath/javax/swing/text/html/MultiAttributeSet.java
@@ -0,0 +1,213 @@
+/* MultiAttributeSet.java -- Multiplexes between a set of AttributeSets
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.text.html;
+
+import java.util.Enumeration;
+import java.util.NoSuchElementException;
+
+import javax.swing.text.AttributeSet;
+import javax.swing.text.SimpleAttributeSet;
+
+/**
+ * An AttributeSet impl that multiplexes between a set of other AttributeSets.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+class MultiAttributeSet
+ implements AttributeSet
+{
+
+ /**
+ * The Enumeration for the multiplexed names.
+ */
+ private class MultiNameEnumeration
+ implements Enumeration
+ {
+ /**
+ * The index of the current AttributeSet.
+ */
+ private int index;
+
+ /**
+ * The names Enumeration of the current AttributeSet.
+ */
+ private Enumeration current;
+
+ /**
+ * Creates a new instance.
+ */
+ MultiNameEnumeration()
+ {
+ index = 0;
+ current = multi[0].getAttributeNames();
+ }
+
+ public boolean hasMoreElements()
+ {
+ return current.hasMoreElements() || index < multi.length - 1;
+ }
+
+ public Object nextElement()
+ {
+ if (! current.hasMoreElements())
+ {
+ if (index < multi.length - 1)
+ {
+ index++;
+ current = multi[index].getAttributeNames();
+ }
+ else
+ throw new NoSuchElementException();
+ }
+ return current.nextElement();
+ }
+
+ }
+
+ /**
+ * The AttributeSets to multiplex.
+ */
+ AttributeSet[] multi;
+
+ /**
+ * Provided for subclasses that need to initialize via {@link #init}.
+ */
+ MultiAttributeSet()
+ {
+ // Nothing to do here.
+ }
+
+ /**
+ * Creates a new instance.
+ *
+ * @param m the AttributeSets to multiplex
+ */
+ MultiAttributeSet(AttributeSet[] m)
+ {
+ init(m);
+ }
+
+ /**
+ * Provided for subclasses to initialize the attribute set.
+ *
+ * @param m the attributes to multiplex
+ */
+ void init(AttributeSet[] m)
+ {
+ multi = m;
+ }
+
+ public boolean containsAttribute(Object name, Object value)
+ {
+ boolean ret = false;
+ for (int i = 0; i < multi.length && ret == false; i++)
+ {
+ if (multi[i].containsAttribute(name, value))
+ ret = true;
+ }
+ return ret;
+ }
+
+ public boolean containsAttributes(AttributeSet attributes)
+ {
+ boolean ret = true;
+ Enumeration e = attributes.getAttributeNames();
+ while (ret && e.hasMoreElements())
+ {
+ Object key = e.nextElement();
+ ret = attributes.getAttribute(key).equals(getAttribute(key));
+ }
+ return ret;
+ }
+
+ public AttributeSet copyAttributes()
+ {
+ SimpleAttributeSet copy = new SimpleAttributeSet();
+ for (int i = 0; i < multi.length; i++)
+ {
+ copy.addAttributes(multi[i]);
+ }
+ return copy;
+ }
+
+ public Object getAttribute(Object key)
+ {
+ Object ret = null;
+ for (int i = 0; i < multi.length && ret == null; i++)
+ {
+ ret = multi[i].getAttribute(key);
+ }
+ return ret;
+ }
+
+ public int getAttributeCount()
+ {
+ int n = 0;
+ for (int i = 0; i < multi.length; i++)
+ {
+ n += multi[i].getAttributeCount();
+ }
+ return n;
+ }
+
+ public Enumeration getAttributeNames()
+ {
+ return new MultiNameEnumeration();
+ }
+
+ public AttributeSet getResolveParent()
+ {
+ return null;
+ }
+
+ public boolean isDefined(Object attrName)
+ {
+ boolean ret = false;
+ for (int i = 0; i < multi.length && ! ret; i++)
+ ret = multi[i].isDefined(attrName);
+ return ret;
+ }
+
+ public boolean isEqual(AttributeSet attr)
+ {
+ return getAttributeCount() == attr.getAttributeCount()
+ && containsAttributes(attr);
+ }
+
+}
diff --git a/libjava/classpath/javax/swing/text/html/MultiStyle.java b/libjava/classpath/javax/swing/text/html/MultiStyle.java
new file mode 100644
index 00000000000..3937bff75a9
--- /dev/null
+++ b/libjava/classpath/javax/swing/text/html/MultiStyle.java
@@ -0,0 +1,136 @@
+/* MultiStyle.java -- Multiplexes between several Styles
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.text.html;
+
+import java.util.Enumeration;
+
+import javax.swing.event.ChangeListener;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.SimpleAttributeSet;
+import javax.swing.text.Style;
+
+/**
+ * A Style implementation that is able to multiplex between several other
+ * Styles. This is used for CSS style resolving.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+public class MultiStyle
+ extends MultiAttributeSet
+ implements Style
+{
+
+ // FIXME: Fix the implementation to also return attributes that
+ // are added to this style, etc. However, this is not really needed
+ // now for CSS, but would be nice for correctness.
+
+ /**
+ * The name of the style.
+ */
+ private String name;
+
+ /**
+ * The attributes added to this style.
+ */
+ private SimpleAttributeSet attributes;
+
+ /**
+ * Creates a new instance.
+ *
+ * @param n the name
+ * @param m the styles to multiplex
+ */
+ public MultiStyle(String n, AttributeSet[] m)
+ {
+ super(m);
+ name = n;
+ attributes = new SimpleAttributeSet();
+ }
+
+ /**
+ * Returns the name of the style.
+ *
+ * @return the name of the style
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ public void addChangeListener(ChangeListener listener)
+ {
+ // TODO: Implement.
+ }
+
+ public void removeChangeListener(ChangeListener listener)
+ {
+ // TODO: Implement.
+ }
+
+ public void addAttribute(Object name, Object value)
+ {
+ attributes.addAttribute(name, value);
+ }
+
+ public void addAttributes(AttributeSet atts)
+ {
+ attributes.addAttributes(atts);
+ }
+
+ public void removeAttribute(Object name)
+ {
+ attributes.removeAttribute(name);
+ }
+
+ public void removeAttributes(Enumeration names)
+ {
+ attributes.removeAttribute(names);
+ }
+
+ public void removeAttributes(AttributeSet atts)
+ {
+ attributes.removeAttribute(atts);
+ }
+
+ public void setResolveParent(AttributeSet parent)
+ {
+ // TODO: Implement.
+ }
+
+}
diff --git a/libjava/classpath/javax/swing/text/html/Option.java b/libjava/classpath/javax/swing/text/html/Option.java
index 1def51b2f59..18d5c2bd86f 100644
--- a/libjava/classpath/javax/swing/text/html/Option.java
+++ b/libjava/classpath/javax/swing/text/html/Option.java
@@ -72,10 +72,10 @@ public class Option
*/
public Option(AttributeSet attr)
{
- attributes = attr;
+ // Protect the attribute set.
+ attributes = attr.copyAttributes();
label = null;
- selected = false;
- // FIXME: Probably initialize something using the attributes.
+ selected = attr.getAttribute(HTML.Attribute.SELECTED) != null;
}
/**
@@ -151,7 +151,9 @@ public class Option
*/
public String getValue()
{
- // FIXME: Return some attribute here if specified.
- return label;
+ String value = (String) attributes.getAttribute(HTML.Attribute.VALUE);
+ if (value == null)
+ value = label;
+ return value;
}
}
diff --git a/libjava/classpath/javax/swing/text/html/ParagraphView.java b/libjava/classpath/javax/swing/text/html/ParagraphView.java
index 2339f4e661d..d149627ff1c 100644
--- a/libjava/classpath/javax/swing/text/html/ParagraphView.java
+++ b/libjava/classpath/javax/swing/text/html/ParagraphView.java
@@ -38,13 +38,17 @@ exception statement from your version. */
package javax.swing.text.html;
+import gnu.javax.swing.text.html.css.Length;
+
import java.awt.Graphics;
+import java.awt.Rectangle;
import java.awt.Shape;
import javax.swing.SizeRequirements;
import javax.swing.text.AttributeSet;
import javax.swing.text.Document;
import javax.swing.text.Element;
+import javax.swing.text.StyleConstants;
import javax.swing.text.View;
/**
@@ -55,10 +59,30 @@ import javax.swing.text.View;
* @author Roman Kennke (kennke@aicas.com)
*/
public class ParagraphView
- extends javax.swing.text.ParagraphView
+ extends javax.swing.text.ParagraphView
{
/**
+ * The attributes used by this view.
+ */
+ private AttributeSet attributes;
+
+ /**
+ * The stylesheet's box painter.
+ */
+ private StyleSheet.BoxPainter painter;
+
+ /**
+ * The width as specified in the stylesheet or null if not specified.
+ */
+ private Length cssWidth;
+
+ /**
+ * The height as specified in the stylesheet or null if not specified.
+ */
+ private Length cssHeight;
+
+ /**
* Creates a new ParagraphView for the specified element.
*
* @param element the element
@@ -88,8 +112,11 @@ public class ParagraphView
*/
public AttributeSet getAttributes()
{
- // FIXME: Implement this multiplexing thing.
- return super.getAttributes();
+ if (attributes == null)
+ {
+ attributes = getStyleSheet().getViewAttributes(this);
+ }
+ return attributes;
}
/**
@@ -98,7 +125,44 @@ public class ParagraphView
*/
protected void setPropertiesFromAttributes()
{
- // FIXME: Implement this.
+ super.setPropertiesFromAttributes();
+
+ // Fetch CSS attributes.
+ attributes = getAttributes();
+ if (attributes != null)
+ {
+ super.setPropertiesFromAttributes();
+ Object o = attributes.getAttribute(CSS.Attribute.TEXT_ALIGN);
+ if (o != null)
+ {
+ String align = o.toString();
+ if (align.equals("left"))
+ setJustification(StyleConstants.ALIGN_LEFT);
+ else if (align.equals("right"))
+ setJustification(StyleConstants.ALIGN_RIGHT);
+ else if (align.equals("center"))
+ setJustification(StyleConstants.ALIGN_CENTER);
+ else if (align.equals("justify"))
+ setJustification(StyleConstants.ALIGN_JUSTIFIED);
+ }
+
+ // Fetch StyleSheet's box painter.
+ painter = getStyleSheet().getBoxPainter(attributes);
+ setInsets((short) painter.getInset(TOP, this),
+ (short) painter.getInset(LEFT, this),
+ (short) painter.getInset(BOTTOM, this),
+ (short) painter.getInset(RIGHT, this));
+
+ StyleSheet ss = getStyleSheet();
+ float emBase = ss.getEMBase(attributes);
+ float exBase = ss.getEXBase(attributes);
+ cssWidth = (Length) attributes.getAttribute(CSS.Attribute.WIDTH);
+ if (cssWidth != null)
+ cssWidth.setFontBases(emBase, exBase);
+ cssHeight = (Length) attributes.getAttribute(CSS.Attribute.WIDTH);
+ if (cssHeight != null)
+ cssHeight.setFontBases(emBase, exBase);
+ }
}
/**
@@ -129,8 +193,52 @@ public class ParagraphView
protected SizeRequirements calculateMinorAxisRequirements(int axis,
SizeRequirements r)
{
- // FIXME: Implement the above specified behaviour.
- return super.calculateMinorAxisRequirements(axis, r);
+ r = super.calculateMinorAxisRequirements(axis, r);
+ if (! setCSSSpan(r, axis))
+ {
+ int margin = axis == X_AXIS ? getLeftInset() + getRightInset()
+ : getTopInset() + getBottomInset();
+ r.minimum -= margin;
+ r.preferred -= margin;
+ r.maximum -= margin;
+ }
+ return r;
+ }
+
+ /**
+ * Sets the span on the SizeRequirements object according to the
+ * according CSS span value, when it is set.
+ *
+ * @param r the size requirements
+ * @param axis the axis
+ *
+ * @return <code>true</code> when the CSS span has been set,
+ * <code>false</code> otherwise
+ */
+ private boolean setCSSSpan(SizeRequirements r, int axis)
+ {
+ boolean ret = false;
+ if (axis == X_AXIS)
+ {
+ if (cssWidth != null && ! cssWidth.isPercentage())
+ {
+ r.minimum = (int) cssWidth.getValue();
+ r.preferred = (int) cssWidth.getValue();
+ r.maximum = (int) cssWidth.getValue();
+ ret = true;
+ }
+ }
+ else
+ {
+ if (cssHeight != null && ! cssWidth.isPercentage())
+ {
+ r.minimum = (int) cssHeight.getValue();
+ r.preferred = (int) cssHeight.getValue();
+ r.maximum = (int) cssHeight.getValue();
+ ret = true;
+ }
+ }
+ return ret;
}
/**
@@ -147,15 +255,20 @@ public class ParagraphView
}
/**
- * Paints this view. This delegates to the superclass after the coordinates
- * have been updated for tab calculations.
+ * Paints this view. This paints the box using the stylesheet's
+ * box painter for this view and delegates to the super class paint()
+ * afterwards.
*
* @param g the graphics object
* @param a the current allocation of this view
*/
public void paint(Graphics g, Shape a)
{
- // FIXME: Implement the above specified behaviour.
+ if (a != null)
+ {
+ Rectangle r = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
+ painter.paint(g, r.x, r.y, r.width, r.height, this);
+ }
super.paint(g, a);
}
diff --git a/libjava/classpath/javax/swing/text/html/ResetableModel.java b/libjava/classpath/javax/swing/text/html/ResetableModel.java
new file mode 100644
index 00000000000..17f65b97d13
--- /dev/null
+++ b/libjava/classpath/javax/swing/text/html/ResetableModel.java
@@ -0,0 +1,50 @@
+/* ResetableModel.java -- Form models that can be resetted
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.text.html;
+
+/**
+ * Form models that can be resetted implement this.
+ */
+interface ResetableModel
+{
+ /**
+ * Resets the model.
+ */
+ void reset();
+}
diff --git a/libjava/classpath/javax/swing/text/html/ResetablePlainDocument.java b/libjava/classpath/javax/swing/text/html/ResetablePlainDocument.java
new file mode 100644
index 00000000000..6177f9b86cf
--- /dev/null
+++ b/libjava/classpath/javax/swing/text/html/ResetablePlainDocument.java
@@ -0,0 +1,82 @@
+/* ResetablePlainDocument.java -- A plain document for use in the HTML renderer
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.text.html;
+
+import javax.swing.text.BadLocationException;
+import javax.swing.text.PlainDocument;
+
+/**
+ * A PlainDocument that can be resetted.
+ */
+class ResetablePlainDocument
+ extends PlainDocument
+ implements ResetableModel
+{
+ /**
+ * The initial text.
+ */
+ private String initial;
+
+ /**
+ * Stores the initial text.
+ *
+ * @param text the initial text
+ */
+ void setInitialText(String text)
+ {
+ initial = text;
+ }
+
+ /**
+ * Resets the model.
+ */
+ public void reset()
+ {
+ try
+ {
+ replace(0, getLength(), initial, null);
+ }
+ catch (BadLocationException ex)
+ {
+ // Shouldn't happen.
+ assert false;
+ }
+ }
+
+}
diff --git a/libjava/classpath/javax/swing/text/html/ResetableToggleButtonModel.java b/libjava/classpath/javax/swing/text/html/ResetableToggleButtonModel.java
new file mode 100644
index 00000000000..619c24e477c
--- /dev/null
+++ b/libjava/classpath/javax/swing/text/html/ResetableToggleButtonModel.java
@@ -0,0 +1,71 @@
+/* ResetableToggleButtonModel.java -- A toggle button model with reset support
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.text.html;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JToggleButton.ToggleButtonModel;
+
+class ResetableToggleButtonModel
+ extends ToggleButtonModel
+ implements ResetableModel
+{
+
+ /**
+ * The initial state.
+ */
+ private boolean initial;
+
+ /**
+ * Sets the initial selection value.
+ *
+ * @param state the initial value
+ */
+ public void setInitial(boolean state)
+ {
+ initial = state;
+ }
+
+ /**
+ * Resets the model.
+ */
+ public void reset()
+ {
+ setSelected(initial);
+ }
+}
diff --git a/libjava/classpath/javax/swing/text/html/SelectComboBoxModel.java b/libjava/classpath/javax/swing/text/html/SelectComboBoxModel.java
new file mode 100644
index 00000000000..999746413c8
--- /dev/null
+++ b/libjava/classpath/javax/swing/text/html/SelectComboBoxModel.java
@@ -0,0 +1,84 @@
+/* SelectComboBoxModel.java -- A special ComboBoxModel for use in HTML renderer
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.text.html;
+
+import javax.swing.DefaultComboBoxModel;
+
+/**
+ * A special ComboBoxModel that supports storing the initial value so that
+ * the combobox can be resetted later.
+ */
+class SelectComboBoxModel
+ extends DefaultComboBoxModel
+ implements ResetableModel
+{
+
+ /**
+ * The initial selection.
+ */
+ private Option initial;
+
+ /**
+ * Sets the initial selection.
+ *
+ * @param option the initial selection
+ */
+ void setInitialSelection(Option option)
+ {
+ initial = option;
+ }
+
+ /**
+ * Returns the initial selection.
+ *
+ * @return the initial selection
+ */
+ Option getInitialSelection()
+ {
+ return initial;
+ }
+
+ /**
+ * Resets the model.
+ */
+ public void reset()
+ {
+ setSelectedItem(initial);
+ }
+}
diff --git a/libjava/classpath/javax/swing/text/html/SelectListModel.java b/libjava/classpath/javax/swing/text/html/SelectListModel.java
new file mode 100644
index 00000000000..23bfaa11b86
--- /dev/null
+++ b/libjava/classpath/javax/swing/text/html/SelectListModel.java
@@ -0,0 +1,106 @@
+/* OptionListModel.java -- A special ListModel for use in the HTML renderer
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.text.html;
+
+import java.util.BitSet;
+
+import javax.swing.DefaultListModel;
+import javax.swing.DefaultListSelectionModel;
+import javax.swing.ListSelectionModel;
+
+/**
+ * A special list model that encapsulates its selection model and supports
+ * storing of the initial value so that it can be resetted.
+ */
+class SelectListModel
+ extends DefaultListModel
+ implements ResetableModel
+{
+ /**
+ * The selection model.
+ */
+ private DefaultListSelectionModel selectionModel;
+
+ /**
+ * The initial selection.
+ */
+ private BitSet initialSelection;
+
+ /**
+ * Creates a new SelectListModel.
+ */
+ SelectListModel()
+ {
+ selectionModel = new DefaultListSelectionModel();
+ initialSelection = new BitSet();
+ }
+
+ /**
+ * Sets the initial selection.
+ *
+ * @param init the initial selection
+ */
+ void addInitialSelection(int init)
+ {
+ initialSelection.set(init);
+ }
+
+ /**
+ * Resets the model.
+ */
+ public void reset()
+ {
+ selectionModel.clearSelection();
+ for (int i = initialSelection.size(); i >= 0; i--)
+ {
+ if (initialSelection.get(i))
+ selectionModel.addSelectionInterval(i, i);
+ }
+ }
+
+ /**
+ * Returns the associated selection model.
+ *
+ * @return the associated selection model
+ */
+ ListSelectionModel getSelectionModel()
+ {
+ return selectionModel;
+ }
+}
diff --git a/libjava/classpath/javax/swing/text/html/StyleSheet.java b/libjava/classpath/javax/swing/text/html/StyleSheet.java
index d92abde7825..01f19fd7bdd 100644
--- a/libjava/classpath/javax/swing/text/html/StyleSheet.java
+++ b/libjava/classpath/javax/swing/text/html/StyleSheet.java
@@ -38,28 +38,47 @@ exception statement from your version. */
package javax.swing.text.html;
-import gnu.javax.swing.text.html.CharacterAttributeTranslator;
+import gnu.javax.swing.text.html.css.BorderWidth;
+import gnu.javax.swing.text.html.css.CSSColor;
+import gnu.javax.swing.text.html.css.CSSParser;
+import gnu.javax.swing.text.html.css.CSSParserCallback;
+import gnu.javax.swing.text.html.css.FontSize;
+import gnu.javax.swing.text.html.css.FontStyle;
+import gnu.javax.swing.text.html.css.FontWeight;
+import gnu.javax.swing.text.html.css.Length;
+import gnu.javax.swing.text.html.css.Selector;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
-
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.font.FontRenderContext;
+import java.awt.geom.Rectangle2D;
+import java.io.BufferedReader;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.io.Reader;
import java.io.Serializable;
import java.io.StringReader;
-
-import java.net.MalformedURLException;
import java.net.URL;
-
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.Enumeration;
-import java.util.Vector;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import javax.swing.border.Border;
+import javax.swing.event.ChangeListener;
import javax.swing.text.AttributeSet;
import javax.swing.text.Element;
import javax.swing.text.MutableAttributeSet;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.Style;
+import javax.swing.text.StyleConstants;
import javax.swing.text.StyleContext;
import javax.swing.text.View;
@@ -79,21 +98,168 @@ import javax.swing.text.View;
*
* The rules are stored as named styles, and other information is stored to
* translate the context of an element to a rule.
- *
+ *
* @author Lillian Angel (langel@redhat.com)
*/
public class StyleSheet extends StyleContext
{
+ /**
+ * Parses CSS stylesheets using the parser in gnu/javax/swing/html/css.
+ *
+ * This is package private to avoid accessor methods.
+ */
+ class CSSStyleSheetParserCallback
+ implements CSSParserCallback
+ {
+ /**
+ * The current styles.
+ */
+ private CSSStyle[] styles;
+
+ /**
+ * The precedence of the stylesheet to be parsed.
+ */
+ private int precedence;
+
+ /**
+ * Creates a new CSS parser. This parser parses a CSS stylesheet with
+ * the specified precedence.
+ *
+ * @param prec the precedence, according to the constants defined in
+ * CSSStyle
+ */
+ CSSStyleSheetParserCallback(int prec)
+ {
+ precedence = prec;
+ }
+
+ /**
+ * Called at the beginning of a statement.
+ *
+ * @param sel the selector
+ */
+ public void startStatement(Selector[] sel)
+ {
+ styles = new CSSStyle[sel.length];
+ for (int i = 0; i < sel.length; i++)
+ styles[i] = new CSSStyle(precedence, sel[i]);
+ }
+
+ /**
+ * Called at the end of a statement.
+ */
+ public void endStatement()
+ {
+ for (int i = 0; i < styles.length; i++)
+ css.add(styles[i]);
+ styles = null;
+ }
+
+ /**
+ * Called when a declaration is parsed.
+ *
+ * @param property the property
+ * @param value the value
+ */
+ public void declaration(String property, String value)
+ {
+ CSS.Attribute cssAtt = CSS.getAttribute(property);
+ Object val = CSS.getValue(cssAtt, value);
+ for (int i = 0; i < styles.length; i++)
+ {
+ CSSStyle style = styles[i];
+ CSS.addInternal(style, cssAtt, value);
+ if (cssAtt != null)
+ style.addAttribute(cssAtt, val);
+ }
+ }
+
+ }
+
+ /**
+ * Represents a style that is defined by a CSS rule.
+ */
+ private class CSSStyle
+ extends SimpleAttributeSet
+ implements Style, Comparable
+ {
+
+ static final int PREC_UA = 0;
+ static final int PREC_NORM = 100000;
+ static final int PREC_AUTHOR_NORMAL = 200000;
+ static final int PREC_AUTHOR_IMPORTANT = 300000;
+ static final int PREC_USER_IMPORTANT = 400000;
+
+ /**
+ * The priority of this style when matching CSS selectors.
+ */
+ private int precedence;
+
+ /**
+ * The selector for this rule.
+ *
+ * This is package private to avoid accessor methods.
+ */
+ Selector selector;
+
+ CSSStyle(int prec, Selector sel)
+ {
+ precedence = prec;
+ selector = sel;
+ }
+
+ public String getName()
+ {
+ // TODO: Implement this for correctness.
+ return null;
+ }
+
+ public void addChangeListener(ChangeListener listener)
+ {
+ // TODO: Implement this for correctness.
+ }
+
+ public void removeChangeListener(ChangeListener listener)
+ {
+ // TODO: Implement this for correctness.
+ }
+
+ /**
+ * Sorts the rule according to the style's precedence and the
+ * selectors specificity.
+ */
+ public int compareTo(Object o)
+ {
+ CSSStyle other = (CSSStyle) o;
+ return other.precedence + other.selector.getSpecificity()
+ - precedence - selector.getSpecificity();
+ }
+
+ }
+
/** The base URL */
URL base;
/** Base font size (int) */
int baseFontSize;
- /** The style sheets stored. */
- StyleSheet[] styleSheet;
-
+ /**
+ * The linked style sheets stored.
+ */
+ private ArrayList linked;
+
+ /**
+ * Maps element names (selectors) to AttributSet (the corresponding style
+ * information).
+ */
+ ArrayList css = new ArrayList();
+
+ /**
+ * Maps selectors to their resolved styles.
+ */
+ private HashMap resolvedStyles;
+
/**
* Constructs a StyleSheet.
*/
@@ -101,6 +267,7 @@ public class StyleSheet extends StyleContext
{
super();
baseFontSize = 4; // Default font size from CSS
+ resolvedStyles = new HashMap();
}
/**
@@ -114,10 +281,198 @@ public class StyleSheet extends StyleContext
*/
public Style getRule(HTML.Tag t, Element e)
{
- // FIXME: Not implemented.
- return null;
+ // Create list of the element and all of its parents, starting
+ // with the bottommost element.
+ ArrayList path = new ArrayList();
+ Element el;
+ AttributeSet atts;
+ for (el = e; el != null; el = el.getParentElement())
+ path.add(el);
+
+ // Create fully qualified selector.
+ StringBuilder selector = new StringBuilder();
+ int count = path.size();
+ // We append the actual element after this loop.
+ for (int i = count - 1; i > 0; i--)
+ {
+ el = (Element) path.get(i);
+ atts = el.getAttributes();
+ Object name = atts.getAttribute(StyleConstants.NameAttribute);
+ selector.append(name.toString());
+ if (atts.isDefined(HTML.Attribute.ID))
+ {
+ selector.append('#');
+ selector.append(atts.getAttribute(HTML.Attribute.ID));
+ }
+ if (atts.isDefined(HTML.Attribute.CLASS))
+ {
+ selector.append('.');
+ selector.append(atts.getAttribute(HTML.Attribute.CLASS));
+ }
+ if (atts.isDefined(HTML.Attribute.DYNAMIC_CLASS))
+ {
+ selector.append(':');
+ selector.append(atts.getAttribute(HTML.Attribute.DYNAMIC_CLASS));
+ }
+ if (atts.isDefined(HTML.Attribute.PSEUDO_CLASS))
+ {
+ selector.append(':');
+ selector.append(atts.getAttribute(HTML.Attribute.PSEUDO_CLASS));
+ }
+ selector.append(' ');
+ }
+ selector.append(t.toString());
+ el = (Element) path.get(0);
+ atts = el.getAttributes();
+ // For leaf elements, we have to fetch the tag specific attributes.
+ if (el.isLeaf())
+ {
+ Object o = atts.getAttribute(t);
+ if (o instanceof AttributeSet)
+ atts = (AttributeSet) o;
+ else
+ atts = null;
+ }
+ if (atts != null)
+ {
+ if (atts.isDefined(HTML.Attribute.ID))
+ {
+ selector.append('#');
+ selector.append(atts.getAttribute(HTML.Attribute.ID));
+ }
+ if (atts.isDefined(HTML.Attribute.CLASS))
+ {
+ selector.append('.');
+ selector.append(atts.getAttribute(HTML.Attribute.CLASS));
+ }
+ if (atts.isDefined(HTML.Attribute.DYNAMIC_CLASS))
+ {
+ selector.append(':');
+ selector.append(atts.getAttribute(HTML.Attribute.DYNAMIC_CLASS));
+ }
+ if (atts.isDefined(HTML.Attribute.PSEUDO_CLASS))
+ {
+ selector.append(':');
+ selector.append(atts.getAttribute(HTML.Attribute.PSEUDO_CLASS));
+ }
+ }
+ return getResolvedStyle(selector.toString(), path, t);
}
-
+
+ /**
+ * Fetches a resolved style. If there is no resolved style for the
+ * specified selector, the resolve the style using
+ * {@link #resolveStyle(String, List, HTML.Tag)}.
+ *
+ * @param selector the selector for which to resolve the style
+ * @param path the Element path, used in the resolving algorithm
+ * @param tag the tag for which to resolve
+ *
+ * @return the resolved style
+ */
+ private Style getResolvedStyle(String selector, List path, HTML.Tag tag)
+ {
+ Style style = (Style) resolvedStyles.get(selector);
+ if (style == null)
+ style = resolveStyle(selector, path, tag);
+ return style;
+ }
+
+ /**
+ * Resolves a style. This creates arrays that hold the tag names,
+ * class and id attributes and delegates the work to
+ * {@link #resolveStyle(String, String[], Map[])}.
+ *
+ * @param selector the selector
+ * @param path the Element path
+ * @param tag the tag
+ *
+ * @return the resolved style
+ */
+ private Style resolveStyle(String selector, List path, HTML.Tag tag)
+ {
+ int count = path.size();
+ String[] tags = new String[count];
+ Map[] attributes = new Map[count];
+ for (int i = 0; i < count; i++)
+ {
+ Element el = (Element) path.get(i);
+ AttributeSet atts = el.getAttributes();
+ if (i == 0 && el.isLeaf())
+ {
+ Object o = atts.getAttribute(tag);
+ if (o instanceof AttributeSet)
+ atts = (AttributeSet) o;
+ else
+ atts = null;
+ }
+ if (atts != null)
+ {
+ HTML.Tag t =
+ (HTML.Tag) atts.getAttribute(StyleConstants.NameAttribute);
+ if (t != null)
+ tags[i] = t.toString();
+ else
+ tags[i] = null;
+ attributes[i] = attributeSetToMap(atts);
+ }
+ else
+ {
+ tags[i] = null;
+ attributes[i] = null;
+ }
+ }
+ tags[0] = tag.toString();
+ return resolveStyle(selector, tags, attributes);
+ }
+
+ /**
+ * Performs style resolving.
+ *
+ * @param selector the selector
+ * @param tags the tags
+ * @param attributes the attributes of the tags
+ *
+ * @return the resolved style
+ */
+ private Style resolveStyle(String selector, String[] tags, Map[] attributes)
+ {
+ // FIXME: This style resolver is not correct. But it works good enough for
+ // the default.css.
+ int count = tags.length;
+ ArrayList styles = new ArrayList();
+ for (Iterator i = css.iterator(); i.hasNext();)
+ {
+ CSSStyle style = (CSSStyle) i.next();
+ if (style.selector.matches(tags, attributes))
+ styles.add(style);
+ }
+
+ // Add styles from linked stylesheets.
+ if (linked != null)
+ {
+ for (int i = linked.size() - 1; i >= 0; i--)
+ {
+ StyleSheet ss = (StyleSheet) linked.get(i);
+ for (int j = ss.css.size() - 1; j >= 0; j--)
+ {
+ CSSStyle style = (CSSStyle) ss.css.get(j);
+ if (style.selector.matches(tags, attributes))
+ styles.add(style);
+ }
+ }
+ }
+
+ // Sort selectors.
+ Collections.sort(styles);
+ Style[] styleArray = new Style[styles.size()];
+ styleArray = (Style[]) styles.toArray(styleArray);
+ Style resolved = new MultiStyle(selector,
+ (Style[]) styles.toArray(styleArray));
+ resolvedStyles.put(selector, resolved);
+ return resolved;
+ }
+
/**
* Gets the rule that best matches the selector. selector is a space
* separated String of element names. The attributes of the returned
@@ -128,27 +483,40 @@ public class StyleSheet extends StyleContext
*/
public Style getRule(String selector)
{
- // FIXME: Not implemented.
- return null;
+ CSSStyle best = null;
+ for (Iterator i = css.iterator(); i.hasNext();)
+ {
+ CSSStyle style = (CSSStyle) i.next();
+ if (style.compareTo(best) < 0)
+ best = style;
+ }
+ return best;
}
/**
- * Adds a set if rules to the sheet. The rules are expected to be in valid
+ * Adds a set of rules to the sheet. The rules are expected to be in valid
* CSS format. This is called as a result of parsing a <style> tag
*
* @param rule - the rule to add to the sheet
*/
public void addRule(String rule)
{
- CssParser cp = new CssParser();
+ CSSStyleSheetParserCallback cb =
+ new CSSStyleSheetParserCallback(CSSStyle.PREC_AUTHOR_NORMAL);
+ // FIXME: Handle ref.
+ StringReader in = new StringReader(rule);
+ CSSParser parser = new CSSParser(in, cb);
try
- {
- cp.parse(base, new StringReader(rule), false, false);
- }
- catch (IOException io)
- {
- // Do nothing here.
- }
+ {
+ parser.parse();
+ }
+ catch (IOException ex)
+ {
+ // Shouldn't happen. And if, then don't let it bork the outside code.
+ }
+ // Clean up resolved styles cache so that the new styles are recognized
+ // on next stylesheet request.
+ resolvedStyles.clear();
}
/**
@@ -176,10 +544,14 @@ public class StyleSheet extends StyleContext
* parameter.
* @throws IOException - For any IO error while reading
*/
- public void loadRules(Reader in, URL ref) throws IOException
+ public void loadRules(Reader in, URL ref)
+ throws IOException
{
- CssParser cp = new CssParser();
- cp.parse(ref, in, false, false);
+ CSSStyleSheetParserCallback cb =
+ new CSSStyleSheetParserCallback(CSSStyle.PREC_UA);
+ // FIXME: Handle ref.
+ CSSParser parser = new CSSParser(in, cb);
+ parser.parse();
}
/**
@@ -191,8 +563,7 @@ public class StyleSheet extends StyleContext
*/
public AttributeSet getViewAttributes(View v)
{
- // FIXME: Not implemented.
- return null;
+ return new ViewAttributeSet(v, this);
}
/**
@@ -215,11 +586,9 @@ public class StyleSheet extends StyleContext
*/
public void addStyleSheet(StyleSheet ss)
{
- if (styleSheet == null)
- styleSheet = new StyleSheet[] {ss};
- else
- System.arraycopy(new StyleSheet[] {ss}, 0, styleSheet,
- styleSheet.length, 1);
+ if (linked == null)
+ linked = new ArrayList();
+ linked.add(ss);
}
/**
@@ -229,31 +598,9 @@ public class StyleSheet extends StyleContext
*/
public void removeStyleSheet(StyleSheet ss)
{
- if (styleSheet.length == 1 && styleSheet[0].equals(ss))
- styleSheet = null;
- else
+ if (linked != null)
{
- for (int i = 0; i < styleSheet.length; i++)
- {
- StyleSheet curr = styleSheet[i];
- if (curr.equals(ss))
- {
- StyleSheet[] tmp = new StyleSheet[styleSheet.length - 1];
- if (i != 0 && i != (styleSheet.length - 1))
- {
- System.arraycopy(styleSheet, 0, tmp, 0, i);
- System.arraycopy(styleSheet, i + 1, tmp, i,
- styleSheet.length - i - 1);
- }
- else if (i == 0)
- System.arraycopy(styleSheet, 1, tmp, 0, styleSheet.length - 1);
- else
- System.arraycopy(styleSheet, 0, tmp, 0, styleSheet.length - 1);
-
- styleSheet = tmp;
- break;
- }
- }
+ linked.remove(ss);
}
}
@@ -264,18 +611,41 @@ public class StyleSheet extends StyleContext
*/
public StyleSheet[] getStyleSheets()
{
- return styleSheet;
+ StyleSheet[] linkedSS;
+ if (linked != null)
+ {
+ linkedSS = new StyleSheet[linked.size()];
+ linkedSS = (StyleSheet[]) linked.toArray(linkedSS);
+ }
+ else
+ {
+ linkedSS = null;
+ }
+ return linkedSS;
}
/**
* Imports a style sheet from the url. The rules are directly added to the
- * receiver.
+ * receiver. This is usually called when a <link> tag is resolved in an
+ * HTML document.
*
- * @param url - the URL to import the StyleSheet from.
+ * @param url the URL to import the StyleSheet from
*/
public void importStyleSheet(URL url)
{
- // FIXME: Not implemented
+ try
+ {
+ InputStream in = url.openStream();
+ Reader r = new BufferedReader(new InputStreamReader(in));
+ CSSStyleSheetParserCallback cb =
+ new CSSStyleSheetParserCallback(CSSStyle.PREC_AUTHOR_NORMAL);
+ CSSParser parser = new CSSParser(r, cb);
+ parser.parse();
+ }
+ catch (IOException ex)
+ {
+ // We can't do anything about it I guess.
+ }
}
/**
@@ -310,7 +680,9 @@ public class StyleSheet extends StyleContext
public void addCSSAttribute(MutableAttributeSet attr, CSS.Attribute key,
String value)
{
- attr.addAttribute(key, value);
+ Object val = CSS.getValue(key, value);
+ CSS.addInternal(attr, key, value);
+ attr.addAttribute(key, val);
}
/**
@@ -340,8 +712,90 @@ public class StyleSheet extends StyleContext
*/
public AttributeSet translateHTMLToCSS(AttributeSet htmlAttrSet)
{
- // FIXME: Not implemented.
- return null;
+ AttributeSet cssAttr = htmlAttrSet.copyAttributes();
+
+ // The HTML align attribute maps directly to the CSS text-align attribute.
+ Object o = htmlAttrSet.getAttribute(HTML.Attribute.ALIGN);
+ if (o != null)
+ cssAttr = addAttribute(cssAttr, CSS.Attribute.TEXT_ALIGN, o);
+
+ // The HTML width attribute maps directly to CSS width.
+ o = htmlAttrSet.getAttribute(HTML.Attribute.WIDTH);
+ if (o != null)
+ cssAttr = addAttribute(cssAttr, CSS.Attribute.WIDTH,
+ new Length(o.toString()));
+
+ // The HTML height attribute maps directly to CSS height.
+ o = htmlAttrSet.getAttribute(HTML.Attribute.HEIGHT);
+ if (o != null)
+ cssAttr = addAttribute(cssAttr, CSS.Attribute.HEIGHT,
+ new Length(o.toString()));
+
+ o = htmlAttrSet.getAttribute(HTML.Attribute.NOWRAP);
+ if (o != null)
+ cssAttr = addAttribute(cssAttr, CSS.Attribute.WHITE_SPACE, "nowrap");
+
+ // Map cellspacing attr of tables to CSS border-spacing.
+ o = htmlAttrSet.getAttribute(HTML.Attribute.CELLSPACING);
+ if (o != null)
+ cssAttr = addAttribute(cssAttr, CSS.Attribute.BORDER_SPACING,
+ new Length(o.toString()));
+
+ // For table cells and headers, fetch the cellpadding value from the
+ // parent table and set it as CSS padding attribute.
+ HTML.Tag tag = (HTML.Tag)
+ htmlAttrSet.getAttribute(StyleConstants.NameAttribute);
+ if ((tag == HTML.Tag.TD || tag == HTML.Tag.TH)
+ && htmlAttrSet instanceof Element)
+ {
+ Element el = (Element) htmlAttrSet;
+ AttributeSet tableAttrs = el.getParentElement().getParentElement()
+ .getAttributes();
+ o = tableAttrs.getAttribute(HTML.Attribute.CELLPADDING);
+ if (o != null)
+ {
+ Length l = new Length(o.toString());
+ cssAttr = addAttribute(cssAttr, CSS.Attribute.PADDING_BOTTOM, l);
+ cssAttr = addAttribute(cssAttr, CSS.Attribute.PADDING_LEFT, l);
+ cssAttr = addAttribute(cssAttr, CSS.Attribute.PADDING_RIGHT, l);
+ cssAttr = addAttribute(cssAttr, CSS.Attribute.PADDING_TOP, l);
+ }
+ o = tableAttrs.getAttribute(HTML.Attribute.BORDER);
+ cssAttr = translateBorder(cssAttr, o);
+ }
+
+ // Translate border attribute.
+ o = cssAttr.getAttribute(HTML.Attribute.BORDER);
+ cssAttr = translateBorder(cssAttr, o);
+
+ // TODO: Add more mappings.
+ return cssAttr;
+ }
+
+ /**
+ * Translates a HTML border attribute to a corresponding set of CSS
+ * attributes.
+ *
+ * @param cssAttr the original set of CSS attributes to add to
+ * @param o the value of the border attribute
+ *
+ * @return the new set of CSS attributes
+ */
+ private AttributeSet translateBorder(AttributeSet cssAttr, Object o)
+ {
+ if (o != null)
+ {
+ BorderWidth l = new BorderWidth(o.toString());
+ if (l.getValue() > 0)
+ {
+ cssAttr = addAttribute(cssAttr, CSS.Attribute.BORDER_WIDTH, l);
+ cssAttr = addAttribute(cssAttr, CSS.Attribute.BORDER_STYLE,
+ "solid");
+ cssAttr = addAttribute(cssAttr, CSS.Attribute.BORDER_COLOR,
+ new CSSColor("black"));
+ }
+ }
+ return cssAttr;
}
/**
@@ -416,10 +870,10 @@ public class StyleSheet extends StyleContext
* @param names - the attribute names
* @return the update attribute set
*/
- public AttributeSet removeAttributes(AttributeSet old, Enumeration names)
+ public AttributeSet removeAttributes(AttributeSet old, Enumeration<?> names)
{
// FIXME: Not implemented.
- return super.removeAttributes(old, names);
+ return super.removeAttributes(old, names);
}
/**
@@ -455,9 +909,95 @@ public class StyleSheet extends StyleContext
*/
public Font getFont(AttributeSet a)
{
- return super.getFont(a);
+ int realSize = getFontSize(a);
+
+ // Decrement size for subscript and superscript.
+ Object valign = a.getAttribute(CSS.Attribute.VERTICAL_ALIGN);
+ if (valign != null)
+ {
+ String v = valign.toString();
+ if (v.contains("sup") || v.contains("sub"))
+ realSize -= 2;
+ }
+
+ // TODO: Convert font family.
+ String family = "SansSerif";
+
+ int style = Font.PLAIN;
+ FontWeight weight = (FontWeight) a.getAttribute(CSS.Attribute.FONT_WEIGHT);
+ if (weight != null)
+ style |= weight.getValue();
+ FontStyle fStyle = (FontStyle) a.getAttribute(CSS.Attribute.FONT_STYLE);
+ if (fStyle != null)
+ style |= fStyle.getValue();
+ return new Font(family, style, realSize);
}
-
+
+ /**
+ * Determines the EM base value based on the specified attributes.
+ *
+ * @param atts the attibutes
+ *
+ * @return the EM base value
+ */
+ float getEMBase(AttributeSet atts)
+ {
+ Font font = getFont(atts);
+ FontRenderContext ctx = new FontRenderContext(null, false, false);
+ Rectangle2D bounds = font.getStringBounds("M", ctx);
+ return (float) bounds.getWidth();
+ }
+
+ /**
+ * Determines the EX base value based on the specified attributes.
+ *
+ * @param atts the attibutes
+ *
+ * @return the EX base value
+ */
+ float getEXBase(AttributeSet atts)
+ {
+ Font font = getFont(atts);
+ FontRenderContext ctx = new FontRenderContext(null, false, false);
+ Rectangle2D bounds = font.getStringBounds("x", ctx);
+ return (float) bounds.getHeight();
+ }
+
+ /**
+ * Resolves the fontsize for a given set of attributes.
+ *
+ * @param atts the attributes
+ *
+ * @return the resolved font size
+ */
+ private int getFontSize(AttributeSet atts)
+ {
+ int size = 12;
+ if (atts.isDefined(CSS.Attribute.FONT_SIZE))
+ {
+ FontSize fs = (FontSize) atts.getAttribute(CSS.Attribute.FONT_SIZE);
+ if (fs.isRelative())
+ {
+ int parSize = 12;
+ AttributeSet resolver = atts.getResolveParent();
+ if (resolver != null)
+ parSize = getFontSize(resolver);
+ size = fs.getValue(parSize);
+ }
+ else
+ {
+ size = fs.getValue();
+ }
+ }
+ else
+ {
+ AttributeSet resolver = atts.getResolveParent();
+ if (resolver != null)
+ size = getFontSize(resolver);
+ }
+ return size;
+ }
+
/**
* Takes a set of attributes and turns it into a foreground
* color specification. This is used to specify things like, brigher, more hue
@@ -468,7 +1008,11 @@ public class StyleSheet extends StyleContext
*/
public Color getForeground(AttributeSet a)
{
- return super.getForeground(a);
+ CSSColor c = (CSSColor) a.getAttribute(CSS.Attribute.COLOR);
+ Color color = null;
+ if (c != null)
+ color = c.getValue();
+ return color;
}
/**
@@ -481,7 +1025,11 @@ public class StyleSheet extends StyleContext
*/
public Color getBackground(AttributeSet a)
{
- return super.getBackground(a);
+ CSSColor c = (CSSColor) a.getAttribute(CSS.Attribute.BACKGROUND_COLOR);
+ Color color = null;
+ if (c != null)
+ color = c.getValue();
+ return color;
}
/**
@@ -492,7 +1040,7 @@ public class StyleSheet extends StyleContext
*/
public BoxPainter getBoxPainter(AttributeSet a)
{
- return new BoxPainter(a);
+ return new BoxPainter(a, this);
}
/**
@@ -503,7 +1051,7 @@ public class StyleSheet extends StyleContext
*/
public ListPainter getListPainter(AttributeSet a)
{
- return new ListPainter(a);
+ return new ListPainter(a, this);
}
/**
@@ -595,7 +1143,7 @@ public class StyleSheet extends StyleContext
*/
public Color stringToColor(String colorName)
{
- return CharacterAttributeTranslator.getColor(colorName);
+ return CSSColor.convertValue(colorName);
}
/**
@@ -609,22 +1157,112 @@ public class StyleSheet extends StyleContext
*/
public static class BoxPainter extends Object implements Serializable
{
-
+
/**
- * Attribute set for painter
+ * The left inset.
*/
- AttributeSet as;
-
+ private float leftInset;
+
+ /**
+ * The right inset.
+ */
+ private float rightInset;
+
+ /**
+ * The top inset.
+ */
+ private float topInset;
+
+ /**
+ * The bottom inset.
+ */
+ private float bottomInset;
+
+ /**
+ * The border of the box.
+ */
+ private Border border;
+
+ private float leftPadding;
+ private float rightPadding;
+ private float topPadding;
+ private float bottomPadding;
+
+ /**
+ * The background color.
+ */
+ private Color background;
+
/**
* Package-private constructor.
*
* @param as - AttributeSet for painter
*/
- BoxPainter(AttributeSet as)
+ BoxPainter(AttributeSet as, StyleSheet ss)
{
- this.as = as;
+ float emBase = ss.getEMBase(as);
+ float exBase = ss.getEXBase(as);
+ // Fetch margins.
+ Length l = (Length) as.getAttribute(CSS.Attribute.MARGIN_LEFT);
+ if (l != null)
+ {
+ l.setFontBases(emBase, exBase);
+ leftInset = l.getValue();
+ }
+ l = (Length) as.getAttribute(CSS.Attribute.MARGIN_RIGHT);
+ if (l != null)
+ {
+ l.setFontBases(emBase, exBase);
+ rightInset = l.getValue();
+ }
+ l = (Length) as.getAttribute(CSS.Attribute.MARGIN_TOP);
+ if (l != null)
+ {
+ l.setFontBases(emBase, exBase);
+ topInset = l.getValue();
+ }
+ l = (Length) as.getAttribute(CSS.Attribute.MARGIN_BOTTOM);
+ if (l != null)
+ {
+ l.setFontBases(emBase, exBase);
+ bottomInset = l.getValue();
+ }
+
+ // Fetch padding.
+ l = (Length) as.getAttribute(CSS.Attribute.PADDING_LEFT);
+ if (l != null)
+ {
+ l.setFontBases(emBase, exBase);
+ leftPadding = l.getValue();
+ }
+ l = (Length) as.getAttribute(CSS.Attribute.PADDING_RIGHT);
+ if (l != null)
+ {
+ l.setFontBases(emBase, exBase);
+ rightPadding = l.getValue();
+ }
+ l = (Length) as.getAttribute(CSS.Attribute.PADDING_TOP);
+ if (l != null)
+ {
+ l.setFontBases(emBase, exBase);
+ topPadding = l.getValue();
+ }
+ l = (Length) as.getAttribute(CSS.Attribute.PADDING_BOTTOM);
+ if (l != null)
+ {
+ l.setFontBases(emBase, exBase);
+ bottomPadding = l.getValue();
+ }
+
+ // Determine border.
+ border = new CSSBorder(as, ss);
+
+ // Determine background.
+ background = ss.getBackground(as);
+
}
+
/**
* Gets the inset needed on a given side to account for the margin, border
* and padding.
@@ -638,8 +1276,37 @@ public class StyleSheet extends StyleContext
*/
public float getInset(int size, View v)
{
- // FIXME: Not implemented.
- return 0;
+ float inset;
+ switch (size)
+ {
+ case View.TOP:
+ inset = topInset;
+ if (border != null)
+ inset += border.getBorderInsets(null).top;
+ inset += topPadding;
+ break;
+ case View.BOTTOM:
+ inset = bottomInset;
+ if (border != null)
+ inset += border.getBorderInsets(null).bottom;
+ inset += bottomPadding;
+ break;
+ case View.LEFT:
+ inset = leftInset;
+ if (border != null)
+ inset += border.getBorderInsets(null).left;
+ inset += leftPadding;
+ break;
+ case View.RIGHT:
+ inset = rightInset;
+ if (border != null)
+ inset += border.getBorderInsets(null).right;
+ inset += rightPadding;
+ break;
+ default:
+ inset = 0.0F;
+ }
+ return inset;
}
/**
@@ -655,7 +1322,19 @@ public class StyleSheet extends StyleContext
*/
public void paint(Graphics g, float x, float y, float w, float h, View v)
{
- // FIXME: Not implemented.
+ int inX = (int) (x + leftInset);
+ int inY = (int) (y + topInset);
+ int inW = (int) (w - leftInset - rightInset);
+ int inH = (int) (h - topInset - bottomInset);
+ if (background != null)
+ {
+ g.setColor(background);
+ g.fillRect(inX, inY, inW, inH);
+ }
+ if (border != null)
+ {
+ border.paintBorder(null, g, inX, inY, inW, inH);
+ }
}
}
@@ -666,24 +1345,41 @@ public class StyleSheet extends StyleContext
*
* @author Lillian Angel (langel@redhat.com)
*/
- public static class ListPainter extends Object implements Serializable
+ public static class ListPainter implements Serializable
{
-
+
/**
* Attribute set for painter
*/
- AttributeSet as;
-
+ private AttributeSet attributes;
+
+ /**
+ * The associated style sheet.
+ */
+ private StyleSheet styleSheet;
+
+ /**
+ * The bullet type.
+ */
+ private String type;
+
/**
* Package-private constructor.
*
* @param as - AttributeSet for painter
*/
- ListPainter(AttributeSet as)
+ ListPainter(AttributeSet as, StyleSheet ss)
{
- this.as = as;
+ attributes = as;
+ styleSheet = ss;
+ type = (String) as.getAttribute(CSS.Attribute.LIST_STYLE_TYPE);
}
-
+
+ /**
+ * Cached rectangle re-used in the paint method below.
+ */
+ private final Rectangle tmpRect = new Rectangle();
+
/**
* Paints the CSS list decoration according to the attributes given.
*
@@ -698,210 +1394,66 @@ public class StyleSheet extends StyleContext
public void paint(Graphics g, float x, float y, float w, float h, View v,
int item)
{
- // FIXME: Not implemented.
- }
- }
-
- /**
- * The parser callback for the CSSParser.
- */
- class CssParser implements CSSParser.CSSParserCallback
- {
- /**
- * A vector of all the selectors.
- * Each element is an array of all the selector tokens
- * in a single rule.
- */
- Vector selectors;
-
- /** A vector of all the selector tokens in a rule. */
- Vector selectorTokens;
-
- /** Name of the current property. */
- String propertyName;
-
- /** The set of CSS declarations */
- MutableAttributeSet declaration;
-
- /**
- * True if parsing a declaration, that is the Reader will not
- * contain a selector.
- */
- boolean parsingDeclaration;
-
- /** True if the attributes are coming from a linked/imported style. */
- boolean isLink;
-
- /** The base URL */
- URL base;
-
- /** The parser */
- CSSParser parser;
-
- /**
- * Constructor
- */
- CssParser()
- {
- selectors = new Vector();
- selectorTokens = new Vector();
- parser = new CSSParser();
- base = StyleSheet.this.base;
- declaration = new SimpleAttributeSet();
- }
-
- /**
- * Parses the passed in CSS declaration into an AttributeSet.
- *
- * @param s - the declaration
- * @return the set of attributes containing the property and value.
- */
- public AttributeSet parseDeclaration(String s)
- {
- try
- {
- return parseDeclaration(new StringReader(s));
- }
- catch (IOException e)
- {
- // Do nothing here.
- }
- return null;
- }
-
- /**
- * Parses the passed in CSS declaration into an AttributeSet.
- *
- * @param r - the reader
- * @return the attribute set
- * @throws IOException from the reader
- */
- public AttributeSet parseDeclaration(Reader r) throws IOException
- {
- parse(base, r, true, false);
- return declaration;
- }
-
- /**
- * Parse the given CSS stream
- *
- * @param base - the url
- * @param r - the reader
- * @param parseDec - True if parsing a declaration
- * @param isLink - True if parsing a link
- */
- public void parse(URL base, Reader r, boolean parseDec, boolean isLink) throws IOException
- {
- parsingDeclaration = parseDec;
- this.isLink = isLink;
- this.base = base;
-
- // flush out all storage
- propertyName = null;
- selectors.clear();
- selectorTokens.clear();
- declaration.removeAttributes(declaration);
-
- parser.parse(r, this, parseDec);
- }
-
- /**
- * Invoked when a valid @import is encountered,
- * will call importStyleSheet if a MalformedURLException
- * is not thrown in creating the URL.
- *
- * @param s - the string after @import
- */
- public void handleImport(String s)
- {
- if (s != null)
+ // FIXME: This is a very simplistic list rendering. We still need
+ // to implement different bullet types (see type field) and custom
+ // bullets via images.
+ View itemView = v.getView(item);
+ AttributeSet viewAtts = itemView.getAttributes();
+ Object tag = viewAtts.getAttribute(StyleConstants.NameAttribute);
+ // Only paint something here when the child view is an LI tag
+ // and the calling view is some of the list tags then).
+ if (tag != null && tag == HTML.Tag.LI)
{
- try
+ g.setColor(Color.BLACK);
+ int centerX = (int) (x - 12);
+ int centerY = -1;
+ // For paragraphs (almost all cases) center bullet vertically
+ // in the middle of the first line.
+ tmpRect.setBounds((int) x, (int) y, (int) w, (int) h);
+ if (itemView.getViewCount() > 0)
{
- if (s.startsWith("url(") && s.endsWith(")"))
- s = s.substring(4, s.length() - 1);
- if (s.indexOf("\"") >= 0)
- s = s.replaceAll("\"","");
-
- URL url = new URL(s);
- if (url == null && base != null)
- url = new URL(base, s);
-
- importStyleSheet(url);
+ View v1 = itemView.getView(0);
+ if (v1 instanceof ParagraphView && v1.getViewCount() > 0)
+ {
+ Shape a1 = itemView.getChildAllocation(0, tmpRect);
+ Rectangle r1 = a1 instanceof Rectangle ? (Rectangle) a1
+ : a1.getBounds();
+ ParagraphView par = (ParagraphView) v1;
+ Shape a = par.getChildAllocation(0, r1);
+ if (a != null)
+ {
+ Rectangle r = a instanceof Rectangle ? (Rectangle) a
+ : a.getBounds();
+ centerY = (int) (r.height / 2 + r.y);
+ }
+ }
}
- catch (MalformedURLException e)
+ if (centerY == -1)
{
- // Do nothing here.
+ centerY =(int) (h / 2 + y);
}
+ g.fillOval(centerX - 3, centerY - 3, 6, 6);
}
}
+ }
- /**
- * A selector has been encountered.
- *
- * @param s - a selector (e.g. P or UL or even P,)
- */
- public void handleSelector(String s)
- {
- if (s.endsWith(","))
- s = s.substring(0, s.length() - 1);
-
- selectorTokens.addElement(s);
- addSelector();
- }
-
- /**
- * Invoked when the start of a rule is encountered.
- */
- public void startRule()
- {
- addSelector();
- }
-
- /**
- * Invoked when a property name is encountered.
- *
- * @param s - the property
- */
- public void handleProperty(String s)
- {
- propertyName = s;
- }
-
- /**
- * Invoked when a property value is encountered.
+ /**
+ * Converts an AttributeSet to a Map. This is used for CSS resolving.
*
- * @param s - the value
- */
- public void handleValue(String s)
- {
- // call addCSSAttribute
- // FIXME: Not implemented
- }
-
- /**
- * Invoked when the end of a rule is encountered.
- */
- public void endRule()
- {
- // FIXME: Not implemented
- // add rules
- propertyName = null;
- }
-
- /**
- * Adds the selector to the vector.
- */
- private void addSelector()
- {
- int length = selectorTokens.size();
- if (length > 0)
- {
- Object[] sel = new Object[length];
- System.arraycopy(selectorTokens.toArray(), 0, sel, 0, length);
- selectors.add(sel);
- selectorTokens.clear();
- }
- }
+ * @param atts the attributes to convert
+ *
+ * @return the converted map
+ */
+ private Map attributeSetToMap(AttributeSet atts)
+ {
+ HashMap map = new HashMap();
+ Enumeration keys = atts.getAttributeNames();
+ while (keys.hasMoreElements())
+ {
+ Object key = keys.nextElement();
+ Object value = atts.getAttribute(key);
+ map.put(key.toString(), value.toString());
+ }
+ return map;
}
}
diff --git a/libjava/classpath/javax/swing/text/html/TableView.java b/libjava/classpath/javax/swing/text/html/TableView.java
index c2edc8cdd64..f87d7b35fc5 100644
--- a/libjava/classpath/javax/swing/text/html/TableView.java
+++ b/libjava/classpath/javax/swing/text/html/TableView.java
@@ -38,49 +38,318 @@ exception statement from your version. */
package javax.swing.text.html;
-import javax.swing.text.Document;
+import java.awt.Graphics;
+import java.awt.Rectangle;
+import java.awt.Shape;
+
+import gnu.javax.swing.text.html.css.Length;
+
+import javax.swing.SizeRequirements;
+import javax.swing.event.DocumentEvent;
+import javax.swing.text.AttributeSet;
import javax.swing.text.Element;
+import javax.swing.text.StyleConstants;
import javax.swing.text.View;
import javax.swing.text.ViewFactory;
/**
- * A conrete implementation of TableView that renders HTML tables.
- *
- * @author Roman Kennke (kennke@aicas.com)
+ * A view implementation that renders HTML tables.
+ *
+ * This is basically a vertical BoxView that contains the rows of the table
+ * and the rows are horizontal BoxViews that contain the actual columns.
*/
class TableView
- extends javax.swing.text.TableView
+ extends BlockView
+ implements ViewFactory
{
+
/**
* Represents a single table row.
*/
- public class RowView extends TableRow
+ class RowView
+ extends BlockView
{
/**
- * Creates a new instance of the <code>RowView</code>.
+ * Has true at column positions where an above row's cell overlaps into
+ * this row.
+ */
+ boolean[] overlap;
+
+ /**
+ * Stores the row index of this row.
+ */
+ int rowIndex;
+
+ /**
+ * Creates a new RowView.
*
- * @param el the element for which to create a row view
+ * @param el the element for the row view
+ */
+ RowView(Element el)
+ {
+ super(el, X_AXIS);
+ }
+
+ public void replace(int offset, int len, View[] views)
+ {
+ gridValid = false;
+ super.replace(offset, len, views);
+ }
+
+ /**
+ * Overridden to make rows not resizable along the Y axis.
+ */
+ public float getMaximumSpan(int axis)
+ {
+ float span;
+ if (axis == Y_AXIS)
+ span = super.getPreferredSpan(axis);
+ else
+ span = Integer.MAX_VALUE;
+ return span;
+ }
+
+ public float getMinimumSpan(int axis)
+ {
+ float span;
+ if (axis == X_AXIS)
+ span = totalColumnRequirements.minimum;
+ else
+ span = super.getMinimumSpan(axis);
+ return span;
+ }
+
+ public float getPreferredSpan(int axis)
+ {
+ float span;
+ if (axis == X_AXIS)
+ span = totalColumnRequirements.preferred;
+ else
+ span = super.getPreferredSpan(axis);
+ return span;
+ }
+
+ /**
+ * Calculates the overall size requirements for the row along the
+ * major axis. This will be the sum of the column requirements.
+ */
+ protected SizeRequirements calculateMajorAxisRequirements(int axis,
+ SizeRequirements r)
+ {
+ if (r == null)
+ r = new SizeRequirements();
+ int adjust = (columnRequirements.length + 1) * cellSpacing;
+ r.minimum = totalColumnRequirements.minimum + adjust;
+ r.preferred = totalColumnRequirements.preferred + adjust;
+ r.maximum = totalColumnRequirements.maximum + adjust;
+ r.alignment = 0.0F;
+ return r;
+ }
+
+ /**
+ * Lays out the columns in this row.
*/
- public RowView(Element el)
+ protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets,
+ int spans[])
{
- super(el);
+ super.layoutMinorAxis(targetSpan, axis, offsets, spans);
+
+ // Adjust columns that have rowSpan > 1.
+ int numCols = getViewCount();
+ for (int i = 0; i < numCols; i++)
+ {
+ View v = getView(i);
+ if (v instanceof CellView)
+ {
+ CellView cell = (CellView) v;
+ if (cell.rowSpan > 1)
+ {
+ for (int r = 1; r < cell.rowSpan; r++)
+ {
+ spans[i] += TableView.this.getSpan(axis, rowIndex + r);
+ spans[i] += cellSpacing;
+ }
+ }
+ }
+ }
}
-
+
+ /**
+ * Lays out the columns in this row.
+ */
+ protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets,
+ int spans[])
+ {
+ updateGrid();
+ int numCols = offsets.length;
+ int realColumn = 0;
+ int colCount = getViewCount();
+ for (int i = 0; i < numColumns;)
+ {
+ if (! overlap[i] && realColumn < colCount)
+ {
+ View v = getView(realColumn);
+ if (v instanceof CellView)
+ {
+ CellView cv = (CellView) v;
+ offsets[realColumn] = columnOffsets[i];
+ spans[realColumn] = 0;
+ for (int j = 0; j < cv.colSpan; j++, i++)
+ {
+ spans[realColumn] += columnSpans[i];
+ if (j < cv.colSpan - 1)
+ spans[realColumn] += cellSpacing;
+ }
+ }
+ realColumn++;
+ }
+ else
+ {
+ i++;
+ }
+ }
+ }
+ }
+
/**
- * Get the associated style sheet from the document.
- *
- * @return the associated style sheet.
+ * A view that renders HTML table cells (TD and TH tags).
*/
- protected StyleSheet getStyleSheet()
+ class CellView
+ extends BlockView
+ {
+
+ /**
+ * The number of columns that this view spans.
+ */
+ int colSpan;
+
+ /**
+ * The number of rows that this cell spans.
+ */
+ int rowSpan;
+
+ /**
+ * Creates a new CellView for the specified element.
+ *
+ * @param el the element for which to create the colspan
+ */
+ CellView(Element el)
{
- Document d = getElement().getDocument();
- if (d instanceof HTMLDocument)
- return ((HTMLDocument) d).getStyleSheet();
- else
- return null;
- }
+ super(el, Y_AXIS);
+ }
+
+ protected SizeRequirements calculateMajorAxisRequirements(int axis,
+ SizeRequirements r)
+ {
+ r = super.calculateMajorAxisRequirements(axis, r);
+ r.maximum = Integer.MAX_VALUE;
+ return r;
+ }
+
+ /**
+ * Overridden to fetch the columnSpan attibute.
+ */
+ protected void setPropertiesFromAttributes()
+ {
+ super.setPropertiesFromAttributes();
+ colSpan = 1;
+ AttributeSet atts = getAttributes();
+ Object o = atts.getAttribute(HTML.Attribute.COLSPAN);
+ if (o != null)
+ {
+ try
+ {
+ colSpan = Integer.parseInt(o.toString());
+ }
+ catch (NumberFormatException ex)
+ {
+ // Couldn't parse the colspan, assume 1.
+ colSpan = 1;
+ }
+ }
+ rowSpan = 1;
+ o = atts.getAttribute(HTML.Attribute.ROWSPAN);
+ if (o != null)
+ {
+ try
+ {
+ rowSpan = Integer.parseInt(o.toString());
+ }
+ catch (NumberFormatException ex)
+ {
+ // Couldn't parse the colspan, assume 1.
+ rowSpan = 1;
+ }
+ }
+ }
}
+
+ /**
+ * The attributes of this view.
+ */
+ private AttributeSet attributes;
+
+ /**
+ * The column requirements.
+ *
+ * Package private to avoid accessor methods.
+ */
+ SizeRequirements[] columnRequirements;
+
+ /**
+ * The overall requirements across all columns.
+ *
+ * Package private to avoid accessor methods.
+ */
+ SizeRequirements totalColumnRequirements;
+
+ /**
+ * The column layout, offsets.
+ *
+ * Package private to avoid accessor methods.
+ */
+ int[] columnOffsets;
+
+ /**
+ * The column layout, spans.
+ *
+ * Package private to avoid accessor methods.
+ */
+ int[] columnSpans;
+
+ /**
+ * The widths of the columns that have been explicitly specified.
+ */
+ Length[] columnWidths;
+
+ /**
+ * The total number of columns.
+ */
+ int numColumns;
+
+ /**
+ * The table width.
+ */
+ private Length width;
+
+ /**
+ * Indicates if the grid setup is ok.
+ */
+ boolean gridValid = false;
+
+ /**
+ * Additional space that is added _between_ table cells.
+ *
+ * This is package private to avoid accessor methods.
+ */
+ int cellSpacing;
+
+ /**
+ * A cached Rectangle object for reuse in paint().
+ */
+ private Rectangle tmpRect;
+
/**
* Creates a new HTML table view for the specified element.
*
@@ -88,50 +357,619 @@ class TableView
*/
public TableView(Element el)
{
- super(el);
+ super(el, Y_AXIS);
+ totalColumnRequirements = new SizeRequirements();
+ tmpRect = new Rectangle();
}
-
+
/**
- * Get the associated style sheet from the document.
- *
- * @return the associated style sheet.
+ * Implementation of the ViewFactory interface for creating the
+ * child views correctly.
*/
- protected StyleSheet getStyleSheet()
+ public View create(Element elem)
{
- Document d = getElement().getDocument();
- if (d instanceof HTMLDocument)
- return ((HTMLDocument) d).getStyleSheet();
+ View view = null;
+ AttributeSet atts = elem.getAttributes();
+ Object name = atts.getAttribute(StyleConstants.NameAttribute);
+ AttributeSet pAtts = elem.getParentElement().getAttributes();
+ Object pName = pAtts.getAttribute(StyleConstants.NameAttribute);
+
+ if (name == HTML.Tag.TR && pName == HTML.Tag.TABLE)
+ view = new RowView(elem);
+ else if ((name == HTML.Tag.TD || name == HTML.Tag.TH)
+ && pName == HTML.Tag.TR)
+ view = new CellView(elem);
+ else if (name == HTML.Tag.CAPTION)
+ view = new ParagraphView(elem);
else
- return null;
- }
-
+ {
+ // If we haven't mapped the element, then fall back to the standard
+ // view factory.
+ View parent = getParent();
+ if (parent != null)
+ {
+ ViewFactory vf = parent.getViewFactory();
+ if (vf != null)
+ view = vf.create(elem);
+ }
+ }
+ return view;
+ }
+
+ /**
+ * Returns this object as view factory so that we get our TR, TD, TH
+ * and CAPTION subelements created correctly.
+ */
+ public ViewFactory getViewFactory()
+ {
+ return this;
+ }
+
+ /**
+ * Returns the attributes of this view. This is overridden to provide
+ * the attributes merged with the CSS stuff.
+ */
+ public AttributeSet getAttributes()
+ {
+ if (attributes == null)
+ attributes = getStyleSheet().getViewAttributes(this);
+ return attributes;
+ }
+
+ /**
+ * Returns the stylesheet associated with this view.
+ *
+ * @return the stylesheet associated with this view
+ */
+ protected StyleSheet getStyleSheet()
+ {
+ HTMLDocument doc = (HTMLDocument) getDocument();
+ return doc.getStyleSheet();
+ }
+
+ /**
+ * Overridden to calculate the size requirements according to the
+ * columns distribution.
+ */
+ protected SizeRequirements calculateMinorAxisRequirements(int axis,
+ SizeRequirements r)
+ {
+ updateGrid();
+ calculateColumnRequirements();
+
+ // Calculate the horizontal requirements according to the superclass.
+ // This will return the maximum of the row's widths.
+ r = super.calculateMinorAxisRequirements(axis, r);
+
+ // Try to set the CSS width if it fits.
+ if (width != null)
+ {
+ int w = (int) width.getValue();
+ if (r.minimum < w)
+ r.minimum = w;
+ }
+
+ // Adjust requirements when we have cell spacing.
+ int adjust = (columnRequirements.length + 1) * cellSpacing;
+ r.minimum += adjust;
+ r.preferred += adjust;
+
+ // Apply the alignment.
+ AttributeSet atts = getAttributes();
+ Object o = atts.getAttribute(CSS.Attribute.TEXT_ALIGN);
+ r.alignment = 0.0F;
+ if (o != null)
+ {
+ String al = o.toString();
+ if (al.equals("left"))
+ r.alignment = 0.0F;
+ else if (al.equals("center"))
+ r.alignment = 0.5F;
+ else if (al.equals("right"))
+ r.alignment = 1.0F;
+ }
+
+ // Make it not resize in the horizontal direction.
+ r.maximum = r.preferred;
+ return r;
+ }
+
+ /**
+ * Overridden to perform the table layout before calling the super
+ * implementation.
+ */
+ protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets,
+ int[] spans)
+ {
+ updateGrid();
+
+ // Mark all rows as invalid along their minor axis to force correct
+ // layout of multi-row cells.
+ int n = getViewCount();
+ for (int i = 0; i < n; i++)
+ {
+ View row = getView(i);
+ if (row instanceof RowView)
+ ((RowView) row).layoutChanged(axis);
+ }
+
+ layoutColumns(targetSpan);
+ super.layoutMinorAxis(targetSpan, axis, offsets, spans);
+ }
+
+ /**
+ * Calculates the size requirements for the columns.
+ */
+ private void calculateColumnRequirements()
+ {
+ int numRows = getViewCount();
+ totalColumnRequirements.minimum = 0;
+ totalColumnRequirements.preferred = 0;
+ totalColumnRequirements.maximum = 0;
+
+ // In this first pass we find out a suitable total width to fit in
+ // all columns of all rows.
+ for (int r = 0; r < numRows; r++)
+ {
+ View rowView = getView(r);
+ int numCols;
+ if (rowView instanceof RowView)
+ numCols = ((RowView) rowView).getViewCount();
+ else
+ numCols = 0;
+
+ // We collect the normal (non-relative) column requirements in the
+ // total variable and the relative requirements in the relTotal
+ // variable. In the end we create the maximum of both to get the
+ // real requirements.
+ SizeRequirements total = new SizeRequirements();
+ SizeRequirements relTotal = new SizeRequirements();
+ float totalPercent = 0.F;
+ int realCol = 0;
+ for (int c = 0; c < numCols; c++)
+ {
+ View v = rowView.getView(c);
+ if (v instanceof CellView)
+ {
+ CellView cellView = (CellView) v;
+ int colSpan = cellView.colSpan;
+ if (colSpan > 1)
+ {
+ int cellMin = (int) cellView.getMinimumSpan(X_AXIS);
+ int cellPref = (int) cellView.getPreferredSpan(X_AXIS);
+ int cellMax = (int) cellView.getMaximumSpan(X_AXIS);
+ int currentMin = 0;
+ int currentPref = 0;
+ long currentMax = 0;
+ for (int i = 0; i < colSpan; i++)
+ {
+ SizeRequirements req = columnRequirements[realCol];
+ currentMin += req.minimum;
+ currentPref += req.preferred;
+ currentMax += req.maximum;
+ }
+ int deltaMin = cellMin - currentMin;
+ int deltaPref = cellPref - currentPref;
+ int deltaMax = (int) (cellMax - currentMax);
+ // Distribute delta.
+ for (int i = 0; i < colSpan; i++)
+ {
+ SizeRequirements req = columnRequirements[realCol];
+ if (deltaMin > 0)
+ req.minimum += deltaMin / colSpan;
+ if (deltaPref > 0)
+ req.preferred += deltaPref / colSpan;
+ if (deltaMax > 0)
+ req.maximum += deltaMax / colSpan;
+ if (columnWidths[realCol] == null
+ || ! columnWidths[realCol].isPercentage())
+ {
+ total.minimum += req.minimum;
+ total.preferred += req.preferred;
+ total.maximum += req.maximum;
+ }
+ else
+ {
+ relTotal.minimum =
+ Math.max(relTotal.minimum,
+ (int) (req.minimum
+ * columnWidths[realCol].getValue()));
+ relTotal.preferred =
+ Math.max(relTotal.preferred,
+ (int) (req.preferred
+ * columnWidths[realCol].getValue()));
+ relTotal.maximum =
+ Math.max(relTotal.maximum,
+ (int) (req.maximum
+ * columnWidths[realCol].getValue()));
+ totalPercent += columnWidths[realCol].getValue();
+ }
+ }
+ realCol += colSpan;
+ }
+ else
+ {
+ // Shortcut for colSpan == 1.
+ SizeRequirements req = columnRequirements[realCol];
+ req.minimum = Math.max(req.minimum,
+ (int) cellView.getMinimumSpan(X_AXIS));
+ req.preferred = Math.max(req.preferred,
+ (int) cellView.getPreferredSpan(X_AXIS));
+ req.maximum = Math.max(req.maximum,
+ (int) cellView.getMaximumSpan(X_AXIS));
+ if (columnWidths[realCol] == null
+ || ! columnWidths[realCol].isPercentage())
+ {
+ total.minimum += columnRequirements[realCol].minimum;
+ total.preferred +=
+ columnRequirements[realCol].preferred;
+ total.maximum += columnRequirements[realCol].maximum;
+ }
+ else
+ {
+ relTotal.minimum =
+ Math.max(relTotal.minimum,
+ (int) (req.minimum
+ / columnWidths[c].getValue()));
+ relTotal.preferred =
+ Math.max(relTotal.preferred,
+ (int) (req.preferred
+ / columnWidths[c].getValue()));
+ relTotal.maximum =
+ Math.max(relTotal.maximum,
+ (int) (req.maximum
+ / columnWidths[c].getValue()));
+ totalPercent += columnWidths[c].getValue();
+ }
+ realCol += 1;
+ }
+ }
+ }
+
+ // Update the total requirements as follows:
+ // 1. Multiply the absolute requirements with 1 - totalPercent. This
+ // gives the total requirements based on the wishes of the absolute
+ // cells.
+ // 2. Take the maximum of this value and the total relative
+ // requirements. Now we should have enough space for whatever cell
+ // in this column.
+ // 3. Take the maximum of this value and the previous maximum value.
+ total.minimum *= 1.F / (1.F - totalPercent);
+ total.preferred *= 1.F / (1.F - totalPercent);
+ total.maximum *= 1.F / (1.F - totalPercent);
+
+ int rowTotalMin = Math.max(total.minimum, relTotal.minimum);
+ int rowTotalPref = Math.max(total.preferred, relTotal.preferred);
+ int rowTotalMax = Math.max(total.maximum, relTotal.maximum);
+ totalColumnRequirements.minimum =
+ Math.max(totalColumnRequirements.minimum, rowTotalMin);
+ totalColumnRequirements.preferred =
+ Math.max(totalColumnRequirements.preferred, rowTotalPref);
+ totalColumnRequirements.maximum =
+ Math.max(totalColumnRequirements.maximum, rowTotalMax);
+ }
+
+ // Now we know what we want and can fix up the actual relative
+ // column requirements.
+ int numCols = columnRequirements.length;
+ for (int i = 0; i < numCols; i++)
+ {
+ if (columnWidths[i] != null)
+ {
+ columnRequirements[i].minimum = (int)
+ columnWidths[i].getValue(totalColumnRequirements.minimum);
+ columnRequirements[i].preferred = (int)
+ columnWidths[i].getValue(totalColumnRequirements.preferred);
+ columnRequirements[i].maximum = (int)
+ columnWidths[i].getValue(totalColumnRequirements.maximum);
+ }
+ }
+ }
+
/**
- * Creates a view for a table row.
- *
- * @param el the element that represents the table row
- * @return a view for rendering the table row
- * (and instance of {@link RowView}).
+ * Lays out the columns.
+ *
+ * @param targetSpan the target span into which the table is laid out
*/
- protected TableRow createTableRow(Element el)
+ private void layoutColumns(int targetSpan)
{
- return new RowView(el);
- }
-
+ // Set the spans to the preferred sizes. Determine the space
+ // that we have to adjust the sizes afterwards.
+ long sumPref = 0;
+ int n = columnRequirements.length;
+ for (int i = 0; i < n; i++)
+ {
+ SizeRequirements col = columnRequirements[i];
+ if (columnWidths[i] != null)
+ columnSpans[i] = (int) columnWidths[i].getValue(targetSpan);
+ else
+ columnSpans[i] = col.preferred;
+ sumPref += columnSpans[i];
+ }
+
+ // Try to adjust the spans so that we fill the targetSpan.
+ // For adjustments we have to use the targetSpan minus the cumulated
+ // cell spacings.
+ long diff = targetSpan - (n + 1) * cellSpacing - sumPref;
+ float factor = 0.0F;
+ int[] diffs = null;
+ if (diff != 0)
+ {
+ long total = 0;
+ diffs = new int[n];
+ for (int i = 0; i < n; i++)
+ {
+ // Only adjust the width if we haven't set a column width here.
+ if (columnWidths[i] == null)
+ {
+ SizeRequirements col = columnRequirements[i];
+ int span;
+ if (diff < 0)
+ {
+ span = col.minimum;
+ diffs[i] = columnSpans[i] - span;
+ }
+ else
+ {
+ span = col.maximum;
+ diffs[i] = span - columnSpans[i];
+ }
+ total += span;
+ }
+ else
+ total += columnSpans[i];
+ }
+
+ float maxAdjust = Math.abs(total - sumPref);
+ factor = diff / maxAdjust;
+ factor = Math.min(factor, 1.0F);
+ factor = Math.max(factor, -1.0F);
+ }
+
+ // Actually perform adjustments.
+ int totalOffs = cellSpacing;
+ for (int i = 0; i < n; i++)
+ {
+ columnOffsets[i] = totalOffs;
+ if (diff != 0)
+ {
+ float adjust = factor * diffs[i];
+ columnSpans[i] += Math.round(adjust);
+ }
+ // Avoid overflow here.
+ totalOffs = (int) Math.min((long) totalOffs + (long) columnSpans[i]
+ + (long) cellSpacing, Integer.MAX_VALUE);
+ }
+ }
+
/**
- * Loads the children of the Table. This completely bypasses the ViewFactory
- * and creates instances of TableRow instead.
+ * Updates the arrays that contain the row and column data in response
+ * to a change to the table structure.
*
- * @param vf ignored
+ * Package private to avoid accessor methods.
+ */
+ void updateGrid()
+ {
+ if (! gridValid)
+ {
+ AttributeSet atts = getAttributes();
+ StyleSheet ss = getStyleSheet();
+ float emBase = ss.getEMBase(atts);
+ float exBase = ss.getEXBase(atts);
+ int maxColumns = 0;
+ int numRows = getViewCount();
+ for (int r = 0; r < numRows; r++)
+ {
+ View rowView = getView(r);
+ int numCols = 0;
+ if (rowView instanceof RowView)
+ {
+ int numCells = ((RowView) rowView).getViewCount();
+ for (int i = 0; i < numCells; i++)
+ {
+ View v = rowView.getView(i);
+ if (v instanceof CellView)
+ numCols += ((CellView) v).colSpan;
+ }
+ }
+ maxColumns = Math.max(numCols, maxColumns);
+ }
+ numColumns = maxColumns;
+ columnWidths = new Length[maxColumns];
+ int[] rowSpans = new int[maxColumns];
+ for (int r = 0; r < numRows; r++)
+ {
+ View view = getView(r);
+ if (view instanceof RowView)
+ {
+ RowView rowView = (RowView) view;
+ rowView.rowIndex = r;
+ rowView.overlap = new boolean[maxColumns];
+ int colIndex = 0;
+ int colCount = rowView.getViewCount();
+ for (int c = 0; c < maxColumns;)
+ {
+ if (rowSpans[c] > 0)
+ {
+ rowSpans[c]--;
+ rowView.overlap[c] = true;
+ c++;
+ }
+ else if (colIndex < colCount)
+ {
+ View v = rowView.getView(colIndex);
+ colIndex++;
+ if (v instanceof CellView)
+ {
+ CellView cv = (CellView) v;
+ Object o =
+ cv.getAttributes().getAttribute(CSS.Attribute.WIDTH);
+ if (o != null && columnWidths[c] == null
+ && o instanceof Length)
+ {
+ columnWidths[c]= (Length) o;
+ columnWidths[c].setFontBases(emBase, exBase);
+ }
+ int rs = cv.rowSpan - 1;
+ for (int col = cv.colSpan - 1; col >= 0; col--)
+ {
+ rowSpans[c] = rs;
+ c++;
+ }
+ }
+ }
+ else
+ {
+ c++;
+ }
+ }
+ }
+ }
+ columnRequirements = new SizeRequirements[maxColumns];
+ for (int i = 0; i < maxColumns; i++)
+ columnRequirements[i] = new SizeRequirements();
+ columnOffsets = new int[maxColumns];
+ columnSpans = new int[maxColumns];
+
+ gridValid = true;
+ }
+ }
+
+ /**
+ * Overridden to restrict the table width to the preferred size.
+ */
+ public float getMaximumSpan(int axis)
+ {
+ float span;
+ if (axis == X_AXIS)
+ span = super.getPreferredSpan(axis);
+ else
+ span = super.getMaximumSpan(axis);
+ return span;
+ }
+
+ /**
+ * Overridden to fetch the CSS attributes when view gets connected.
+ */
+ public void setParent(View parent)
+ {
+ super.setParent(parent);
+ if (parent != null)
+ setPropertiesFromAttributes();
+ }
+
+ /**
+ * Fetches CSS and HTML layout attributes.
+ */
+ protected void setPropertiesFromAttributes()
+ {
+ super.setPropertiesFromAttributes();
+
+ // Fetch and parse cell spacing.
+ AttributeSet atts = getAttributes();
+ StyleSheet ss = getStyleSheet();
+ float emBase = ss.getEMBase(atts);
+ float exBase = ss.getEXBase(atts);
+ Object o = atts.getAttribute(CSS.Attribute.BORDER_SPACING);
+ if (o != null && o instanceof Length)
+ {
+ Length l = (Length) o;
+ l.setFontBases(emBase, exBase);
+ cellSpacing = (int) l.getValue();
+ }
+ o = atts.getAttribute(CSS.Attribute.WIDTH);
+ if (o != null && o instanceof Length)
+ {
+ width = (Length) o;
+ width.setFontBases(emBase, exBase);
+ }
+ }
+
+ /**
+ * Overridden to adjust for cellSpacing.
+ */
+ protected SizeRequirements calculateMajorAxisRequirements(int axis,
+ SizeRequirements r)
+ {
+ r = super.calculateMajorAxisRequirements(axis, r);
+ int adjust = (getViewCount() + 1) * cellSpacing;
+ r.minimum += adjust;
+ r.preferred += adjust;
+ r.maximum += adjust;
+ return r;
+ }
+
+ /**
+ * Overridden to adjust for cellSpacing.
+ */
+ protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets,
+ int spans[])
+ {
+ // Mark all rows as invalid along their minor axis to force correct
+ // layout of multi-row cells.
+ int n = getViewCount();
+ for (int i = 0; i < n; i++)
+ {
+ View row = getView(i);
+ if (row instanceof RowView)
+ ((RowView) row).layoutChanged(axis);
+ }
+
+ int adjust = (getViewCount() + 1) * cellSpacing;
+ super.layoutMajorAxis(targetSpan - adjust, axis, offsets, spans);
+ for (int i = 0; i < offsets.length; i++)
+ {
+ offsets[i] += (i + 1) * cellSpacing;
+ }
+ }
+
+ /**
+ * Overridden to replace view factory with this one.
+ */
+ public void insertUpdate(DocumentEvent e, Shape a, ViewFactory f)
+ {
+ super.insertUpdate(e, a, this);
+ }
+
+ /**
+ * Overridden to replace view factory with this one.
+ */
+ public void removeUpdate(DocumentEvent e, Shape a, ViewFactory f)
+ {
+ super.removeUpdate(e, a, this);
+ }
+
+ /**
+ * Overridden to replace view factory with this one.
*/
- protected void loadChildren(ViewFactory vf)
+ public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
{
- Element el = getElement();
- int numChildren = el.getElementCount();
- View[] rows = new View[numChildren];
- for (int i = 0; i < numChildren; ++i)
+ super.changedUpdate(e, a, this);
+ }
+
+ public void replace(int offset, int len, View[] views)
+ {
+ gridValid = false;
+ super.replace(offset, len, views);
+ }
+
+ /**
+ * We can't use the super class's paint() method because it might cut
+ * off multi-row children. Instead we trigger painting for all rows
+ * and let the rows sort out what to paint and what not.
+ */
+ public void paint(Graphics g, Shape a)
+ {
+ Rectangle rect = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
+ painter.paint(g, rect.x, rect.y, rect.width, rect.height, this);
+ int nRows = getViewCount();
+ Rectangle inside = getInsideAllocation(a);
+ for (int r = 0; r < nRows; r++)
{
- rows[i] = createTableRow(el.getElement(i));
+ tmpRect.setBounds(inside);
+ childAllocation(r, tmpRect);
+ paintChild(g, tmpRect, r);
}
- replace(0, getViewCount(), rows);
}
+
}
diff --git a/libjava/classpath/javax/swing/text/html/ViewAttributeSet.java b/libjava/classpath/javax/swing/text/html/ViewAttributeSet.java
new file mode 100644
index 00000000000..25db89fc405
--- /dev/null
+++ b/libjava/classpath/javax/swing/text/html/ViewAttributeSet.java
@@ -0,0 +1,163 @@
+/* ViewAttributeSet.java -- The AttributeSet used by HTML views
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.text.html;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+
+import javax.swing.text.AttributeSet;
+import javax.swing.text.Element;
+import javax.swing.text.StyleConstants;
+import javax.swing.text.View;
+
+/**
+ * An AttributeSet implemenation that is used by the HTML views. This
+ * AttributeSet is created by StyleSheet.getViewAttributes() and combines
+ * the following attributes:
+ * - The original attributes of the View's element.
+ * - Any translated (HTML->CSS) attributes, as returned by
+ * StyleSheet.translateHTMLToCS().
+ * - CSS Styles as resolved by the CSS stylesheet.
+ *
+ * In addition to that, it resolves attributes to the parent views, if
+ * a CSS attribute is requested that is inheritable.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+class ViewAttributeSet
+ extends MultiAttributeSet
+{
+
+ /**
+ * The view for which we are the AttributeSet.
+ */
+ private View view;
+
+ /**
+ * The stylesheet to use.
+ */
+ private StyleSheet styleSheet;
+
+ /**
+ * Creates a new instance.
+ *
+ * @param v the view for which to do the AttributeSet
+ */
+ ViewAttributeSet(View v, StyleSheet ss)
+ {
+ styleSheet = ss;
+ view = v;
+ ArrayList atts = new ArrayList();
+
+ Element el = v.getElement();
+ AttributeSet elAtts = el.getAttributes();
+ AttributeSet htmlAtts = styleSheet.translateHTMLToCSS(elAtts);
+ if (htmlAtts.getAttributeCount() > 0)
+ atts.add(htmlAtts);
+
+ if (el.isLeaf())
+ {
+ Enumeration n = elAtts.getAttributeNames();
+ while (n.hasMoreElements())
+ {
+ Object key = n.nextElement();
+ if (key instanceof HTML.Tag)
+ {
+ AttributeSet rule = styleSheet.getRule((HTML.Tag) key, el);
+ if (rule != null)
+ atts.add(rule);
+ }
+ }
+ }
+ else
+ {
+ HTML.Tag tag =
+ (HTML.Tag) elAtts.getAttribute(StyleConstants.NameAttribute);
+ AttributeSet rule = styleSheet.getRule(tag, el);
+ if (rule != null)
+ atts.add(rule);
+ }
+
+ AttributeSet[] atts1 = new AttributeSet[atts.size()];
+ atts1 = (AttributeSet[]) atts.toArray(atts1);
+ init(atts1);
+ }
+
+ /**
+ * Fetches the attribute for the specific ckey. If the attribute
+ * can't be found and the key is a CSS.Attribute that is inherited,
+ * then the attribute is looked up in the resolve parent.
+ */
+ public Object getAttribute(Object key)
+ {
+ Object val = super.getAttribute(key);
+ if (val == null)
+ {
+ // Didn't find value. If the key is a CSS.Attribute, and is
+ // inherited, then ask the resolve parent.
+ if (key instanceof CSS.Attribute)
+ {
+ CSS.Attribute cssKey = (CSS.Attribute) key;
+ if (cssKey.isInherited())
+ {
+ AttributeSet resolveParent = getResolveParent();
+ if (resolveParent != null)
+ val = resolveParent.getAttribute(cssKey);
+ }
+ }
+ }
+ return val;
+ }
+
+ /**
+ * Returns the resolve parent of this AttributeSet. This is the AttributeSet
+ * returned by the parent view if available.
+ */
+ public AttributeSet getResolveParent()
+ {
+ AttributeSet parent = null;
+ if (view != null)
+ {
+ View parentView = view.getParent();
+ if (parentView != null)
+ parent = parentView.getAttributes();
+ }
+ return parent;
+ }
+}
diff --git a/libjava/classpath/javax/swing/text/html/parser/AttributeList.java b/libjava/classpath/javax/swing/text/html/parser/AttributeList.java
index 5bca0bfa7db..d48266d4730 100644
--- a/libjava/classpath/javax/swing/text/html/parser/AttributeList.java
+++ b/libjava/classpath/javax/swing/text/html/parser/AttributeList.java
@@ -122,7 +122,7 @@ public final class AttributeList
* null, if this parameter was not specified.
* Values, defined in DTD, are case insensitive.
*/
- public Vector values;
+ public Vector<?> values;
/**
* The modifier of this attribute. This field contains one of the
@@ -176,7 +176,7 @@ public final class AttributeList
* Equals to null for the last attribute definition.
*/
public AttributeList(String a_name, int a_type, int a_modifier,
- String a_default, Vector allowed_values,
+ String a_default, Vector<?> allowed_values,
AttributeList a_next
)
{
@@ -251,7 +251,7 @@ public final class AttributeList
/**
* Get the allowed values of this attribute.
*/
- public Enumeration getValues()
+ public Enumeration<?> getValues()
{
return values.elements();
}
diff --git a/libjava/classpath/javax/swing/text/html/parser/ContentModel.java b/libjava/classpath/javax/swing/text/html/parser/ContentModel.java
index 70e9c2acbff..d5c4418de27 100644
--- a/libjava/classpath/javax/swing/text/html/parser/ContentModel.java
+++ b/libjava/classpath/javax/swing/text/html/parser/ContentModel.java
@@ -151,13 +151,15 @@ public final class ContentModel
* discarded.
* @param elements - a vector to add the values to.
*/
- public void getElements(Vector elements)
+ public void getElements(Vector<Element> elements)
{
ContentModel c = this;
while (c != null)
{
- elements.add(c.content);
+ // FIXME: correct?
+ if (c.content instanceof Element)
+ elements.add((Element) c.content);
c = c.next;
}
}
diff --git a/libjava/classpath/javax/swing/text/html/parser/DTD.java b/libjava/classpath/javax/swing/text/html/parser/DTD.java
index 16bc5b0d6af..ae3c184f153 100644
--- a/libjava/classpath/javax/swing/text/html/parser/DTD.java
+++ b/libjava/classpath/javax/swing/text/html/parser/DTD.java
@@ -88,7 +88,7 @@ public class DTD
/**
* The table of existing available DTDs.
*/
- static Hashtable dtdHash = new Hashtable();
+ static Hashtable<String,DTD> dtdHash = new Hashtable<String,DTD>();
/**
* The applet element for this DTD.
@@ -148,12 +148,13 @@ public class DTD
/**
* The element for accessing all DTD elements by name.
*/
- public Hashtable elementHash = new Hashtable();
+ public Hashtable<String,Element> elementHash =
+ new Hashtable<String,Element>();
/**
* The entity table for accessing all DTD entities by name.
*/
- public Hashtable entityHash = new Hashtable();
+ public Hashtable<Object, Entity> entityHash = new Hashtable<Object, Entity>();
/**
* The name of this DTD.
@@ -165,7 +166,7 @@ public class DTD
* javax.swing.text.html.parser.Element#index field of all elements
* in this vector is set to the element position in this vector.
*/
- public Vector elements = new Vector();
+ public Vector<Element> elements = new Vector<Element>();
/** Create a new DTD with the specified name. */
protected DTD(String a_name)
@@ -224,7 +225,7 @@ public class DTD
String name = Entity.mapper.get(id);
if (name != null)
- return (Entity) entityHash.get(name);
+ return entityHash.get(name);
else
return null;
}
@@ -269,7 +270,7 @@ public class DTD
*/
public void defineAttributes(String forElement, AttributeList attributes)
{
- Element e = (Element) elementHash.get(forElement.toLowerCase());
+ Element e = elementHash.get(forElement.toLowerCase());
if (e == null)
e = newElement(forElement);
@@ -420,7 +421,7 @@ public class DTD
if (allowed_values != null)
{
StringTokenizer st = new StringTokenizer(allowed_values, " \t|");
- Vector v = new Vector(st.countTokens());
+ Vector<String> v = new Vector<String>(st.countTokens());
while (st.hasMoreTokens())
v.add(st.nextToken());
@@ -571,7 +572,7 @@ public class DTD
*/
private Element newElement(String name)
{
- Element e = (Element) elementHash.get(name.toLowerCase());
+ Element e = elementHash.get(name.toLowerCase());
if (e == null)
{
diff --git a/libjava/classpath/javax/swing/text/html/parser/DocumentParser.java b/libjava/classpath/javax/swing/text/html/parser/DocumentParser.java
index 062606d17ba..f717d69cbda 100644
--- a/libjava/classpath/javax/swing/text/html/parser/DocumentParser.java
+++ b/libjava/classpath/javax/swing/text/html/parser/DocumentParser.java
@@ -38,13 +38,13 @@ exception statement from your version. */
package javax.swing.text.html.parser;
-import gnu.javax.swing.text.html.parser.htmlAttributeSet;
import javax.swing.text.html.parser.Parser;
import java.io.IOException;
import java.io.Reader;
import javax.swing.text.BadLocationException;
+import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.html.HTMLEditorKit;
/**
@@ -117,7 +117,7 @@ public class DocumentParser
protected final void handleStartTag(TagElement tag)
{
parser.handleStartTag(tag);
- htmlAttributeSet attributes = gnu.getAttributes();
+ SimpleAttributeSet attributes = gnu.getAttributes();
if (tag.fictional())
attributes.addAttribute(HTMLEditorKit.ParserCallback.IMPLIED,
diff --git a/libjava/classpath/javax/swing/text/html/parser/ParserDelegator.java b/libjava/classpath/javax/swing/text/html/parser/ParserDelegator.java
index 70636d92923..cdd339b8f21 100644
--- a/libjava/classpath/javax/swing/text/html/parser/ParserDelegator.java
+++ b/libjava/classpath/javax/swing/text/html/parser/ParserDelegator.java
@@ -38,13 +38,13 @@ exception statement from your version. */
package javax.swing.text.html.parser;
import gnu.javax.swing.text.html.parser.HTML_401F;
-import gnu.javax.swing.text.html.parser.htmlAttributeSet;
import java.io.IOException;
import java.io.Reader;
import java.io.Serializable;
import javax.swing.text.BadLocationException;
+import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.HTMLEditorKit.ParserCallback;
@@ -93,7 +93,7 @@ public class ParserDelegator
protected final void handleStartTag(TagElement tag)
{
- htmlAttributeSet attributes = gnu.getAttributes();
+ SimpleAttributeSet attributes = gnu.getAttributes();
if (tag.fictional())
attributes.addAttribute(ParserCallback.IMPLIED, Boolean.TRUE);
diff --git a/libjava/classpath/javax/swing/tree/AbstractLayoutCache.java b/libjava/classpath/javax/swing/tree/AbstractLayoutCache.java
index 155343f5bcc..4a6899fbeae 100644
--- a/libjava/classpath/javax/swing/tree/AbstractLayoutCache.java
+++ b/libjava/classpath/javax/swing/tree/AbstractLayoutCache.java
@@ -149,9 +149,11 @@ public abstract class AbstractLayoutCache
protected Rectangle getNodeDimensions(Object value, int row, int depth,
boolean expanded, Rectangle bounds)
{
- if (nodeDimensions == null)
- throw new InternalError("The NodeDimensions are not set");
- return nodeDimensions.getNodeDimensions(value, row, depth, expanded, bounds);
+ Rectangle d = null;
+ if (nodeDimensions != null)
+ d = nodeDimensions.getNodeDimensions(value, row, depth, expanded,
+ bounds);
+ return d;
}
/**
@@ -224,7 +226,12 @@ public abstract class AbstractLayoutCache
*/
public void setSelectionModel(TreeSelectionModel model)
{
+ if (treeSelectionModel != null)
+ treeSelectionModel.setRowMapper(null);
treeSelectionModel = model;
+ if (treeSelectionModel != null)
+ treeSelectionModel.setRowMapper(this);
+
}
/**
@@ -337,7 +344,7 @@ public abstract class AbstractLayoutCache
*
* @return Enumeration
*/
- public abstract Enumeration getVisiblePathsFrom(TreePath path);
+ public abstract Enumeration<TreePath> getVisiblePathsFrom(TreePath path);
/**
* getVisibleChildCount
@@ -425,9 +432,13 @@ public abstract class AbstractLayoutCache
*/
public int[] getRowsForPaths(TreePath[] paths)
{
- int[] rows = new int[paths.length];
- for (int i = 0; i < rows.length; i++)
- rows[i] = getRowForPath(paths[i]);
+ int[] rows = null;
+ if (paths != null)
+ {
+ rows = new int[paths.length];
+ for (int i = 0; i < rows.length; i++)
+ rows[i] = getRowForPath(paths[i]);
+ }
return rows;
}
@@ -440,6 +451,6 @@ public abstract class AbstractLayoutCache
*/
protected boolean isFixedRowHeight()
{
- return false;
+ return rowHeight > 0;
}
}
diff --git a/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java b/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java
index 6951b960005..9f587946fc2 100644
--- a/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java
+++ b/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java
@@ -67,7 +67,7 @@ public class DefaultMutableTreeNode
* An empty enumeration, returned by {@link #children()} if a node has no
* children.
*/
- public static final Enumeration EMPTY_ENUMERATION =
+ public static final Enumeration<TreeNode> EMPTY_ENUMERATION =
EmptyEnumeration.getInstance();
/**
@@ -78,7 +78,7 @@ public class DefaultMutableTreeNode
/**
* The child nodes for this node (may be empty).
*/
- protected Vector children = new Vector();
+ protected Vector<MutableTreeNode> children = new Vector<MutableTreeNode>();
/**
* userObject
@@ -480,7 +480,7 @@ public class DefaultMutableTreeNode
public TreeNode getSharedAncestor(DefaultMutableTreeNode node)
{
TreeNode current = this;
- ArrayList list = new ArrayList();
+ ArrayList<TreeNode> list = new ArrayList<TreeNode>();
while (current != null)
{
@@ -527,7 +527,7 @@ public class DefaultMutableTreeNode
|| children.size() == 0)
return 0;
- Stack stack = new Stack();
+ Stack<Integer> stack = new Stack<Integer>();
stack.push(new Integer(0));
TreeNode node = getChildAt(0);
int depth = 0;
@@ -765,7 +765,7 @@ public class DefaultMutableTreeNode
throw new IllegalArgumentException();
TreeNode parent = this;
- Vector nodes = new Vector();
+ Vector<TreeNode> nodes = new Vector<TreeNode>();
nodes.add(this);
while (parent != node && parent != null)
@@ -1148,7 +1148,7 @@ public class DefaultMutableTreeNode
static class PostorderEnumeration implements Enumeration
{
- Stack nodes = new Stack();
+ Stack<TreeNode> nodes = new Stack<TreeNode>();
Stack childrenEnums = new Stack();
PostorderEnumeration(TreeNode node)
diff --git a/libjava/classpath/javax/swing/tree/DefaultTreeCellEditor.java b/libjava/classpath/javax/swing/tree/DefaultTreeCellEditor.java
index b0a4d8db823..4c10bfe1af2 100644
--- a/libjava/classpath/javax/swing/tree/DefaultTreeCellEditor.java
+++ b/libjava/classpath/javax/swing/tree/DefaultTreeCellEditor.java
@@ -43,7 +43,6 @@ import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
-import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
@@ -59,10 +58,10 @@ import javax.swing.Icon;
import javax.swing.JTextField;
import javax.swing.JTree;
import javax.swing.SwingUtilities;
+import javax.swing.Timer;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.event.CellEditorListener;
-import javax.swing.event.ChangeEvent;
import javax.swing.event.EventListenerList;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
@@ -77,12 +76,6 @@ public class DefaultTreeCellEditor
implements ActionListener, TreeCellEditor, TreeSelectionListener
{
/**
- * The number of the fast mouse clicks, required to start the editing
- * session.
- */
- static int CLICK_COUNT_TO_START = 3;
-
- /**
* This container that appears on the tree during editing session.
* It contains the editing component displays various other editor -
* specific parts like editing icon.
@@ -99,7 +92,7 @@ public class DefaultTreeCellEditor
*/
public EditorContainer()
{
- // Do nothing here.
+ setLayout(null);
}
/**
@@ -111,12 +104,6 @@ public class DefaultTreeCellEditor
// Do nothing here.
}
- public void setBounds(Rectangle bounds)
- {
- super.setBounds(bounds);
- doLayout();
- }
-
/**
* Overrides Container.paint to paint the node's icon and use the selection
* color for the background.
@@ -126,11 +113,20 @@ public class DefaultTreeCellEditor
*/
public void paint(Graphics g)
{
+ // Paint editing icon.
if (editingIcon != null)
{
// From the previous version, the left margin is taken as half
// of the icon width.
- editingIcon.paintIcon(this, g, 0, 0);
+ int y = Math.max(0, (getHeight() - editingIcon.getIconHeight()) / 2);
+ editingIcon.paintIcon(this, g, 0, y);
+ }
+ // Paint border.
+ Color c = getBorderSelectionColor();
+ if (c != null)
+ {
+ g.setColor(c);
+ g.drawRect(0, 0, getWidth() - 1, getHeight() - 1);
}
super.paint(g);
}
@@ -141,27 +137,33 @@ public class DefaultTreeCellEditor
*/
public void doLayout()
{
- // The offset of the editing component.
- int eOffset;
+ if (editingComponent != null)
+ {
+ editingComponent.getPreferredSize();
+ editingComponent.setBounds(offset, 0, getWidth() - offset,
+ getHeight());
+ }
+ }
- // Move the component to the left, leaving room for the editing icon:
- if (editingIcon != null)
- eOffset = editingIcon.getIconWidth();
+ public Dimension getPreferredSize()
+ {
+ Dimension dim;
+ if (editingComponent != null)
+ {
+ dim = editingComponent.getPreferredSize();
+ dim.width += offset + 5;
+ if (renderer != null)
+ {
+ Dimension r = renderer.getPreferredSize();
+ dim.height = Math.max(dim.height, r.height);
+ }
+ if (editingIcon != null)
+ dim.height = Math.max(dim.height, editingIcon.getIconHeight());
+ dim.width = Math.max(100, dim.width);
+ }
else
- eOffset = 0;
-
- Rectangle bounds = getBounds();
- Component c = getComponent(0);
- c.setLocation(eOffset, 0);
-
- // Span the editing component near over all window width.
- c.setSize(bounds.width - eOffset, bounds.height);
- /*
- * @specnote the Sun sets some more narrow editing component width (it is
- * not documented how does it is calculated). However as our text field is
- * still not able to auto - scroll horizontally, replicating such strategy
- * would prevent adding extra characters to the text being edited.
- */
+ dim = new Dimension(0, 0);
+ return dim;
}
}
@@ -227,46 +229,15 @@ public class DefaultTreeCellEditor
*/
public Dimension getPreferredSize()
{
- String s = getText();
-
- Font f = getFont();
-
- if (f != null)
+ Dimension size = super.getPreferredSize();
+ if (renderer != null && DefaultTreeCellEditor.this.getFont() == null)
{
- FontMetrics fm = getToolkit().getFontMetrics(f);
-
- return new Dimension(SwingUtilities.computeStringWidth(fm, s),
- fm.getHeight());
+ size.height = renderer.getPreferredSize().height;
}
return renderer.getPreferredSize();
}
}
- /**
- * Listens for the events from the realEditor.
- */
- class RealEditorListener implements CellEditorListener
- {
- /**
- * The method is called when the editing has been cancelled.
- * @param event unused
- */
- public void editingCanceled(ChangeEvent event)
- {
- cancelCellEditing();
- }
-
- /**
- * The method is called after completing the editing session.
- *
- * @param event unused
- */
- public void editingStopped(ChangeEvent event)
- {
- stopCellEditing();
- }
- }
-
private EventListenerList listenerList = new EventListenerList();
/**
@@ -367,21 +338,14 @@ public class DefaultTreeCellEditor
public DefaultTreeCellEditor(JTree tree, DefaultTreeCellRenderer renderer,
TreeCellEditor editor)
{
- setTree(tree);
this.renderer = renderer;
-
- if (editor == null)
- editor = createTreeCellEditor();
- else
- editor.addCellEditorListener(new RealEditorListener());
-
realEditor = editor;
-
- lastPath = tree.getLeadSelectionPath();
- tree.addTreeSelectionListener(this);
+ if (realEditor == null)
+ realEditor = createTreeCellEditor();
editingContainer = createContainer();
- setFont(UIManager.getFont("Tree.font"));
- setBorderSelectionColor(UIManager.getColor("Tree.selectionBorderColor"));
+ setTree(tree);
+ Color c = UIManager.getColor("Tree.editorBorderSelectionColor");
+ setBorderSelectionColor(c);
}
/**
@@ -505,19 +469,36 @@ public class DefaultTreeCellEditor
* @return the component for editing
*/
public Component getTreeCellEditorComponent(JTree tree, Object value,
- boolean isSelected, boolean expanded,
+ boolean isSelected,
+ boolean expanded,
boolean leaf, int row)
{
- if (realEditor == null)
- realEditor = createTreeCellEditor();
-
- return realEditor.getTreeCellEditorComponent(tree, value, isSelected,
- expanded, leaf, row);
+ setTree(tree);
+ lastRow = row;
+ determineOffset(tree, value, isSelected, expanded, leaf, row);
+ if (editingComponent != null)
+ editingContainer.remove(editingComponent);
+
+ editingComponent = realEditor.getTreeCellEditorComponent(tree, value,
+ isSelected,
+ expanded, leaf,
+ row);
+ Font f = getFont();
+ if (f == null)
+ {
+ if (renderer != null)
+ f = renderer.getFont();
+ if (f == null)
+ f = tree.getFont();
+ }
+ editingContainer.setFont(f);
+ prepareForEditing();
+ return editingContainer;
}
/**
* Returns the value currently being edited (requests it from the
- * {@link realEditor}.
+ * {@link #realEditor}.
*
* @return the value currently being edited
*/
@@ -535,16 +516,48 @@ public class DefaultTreeCellEditor
* @return true if editing can be started
*/
public boolean isCellEditable(EventObject event)
- {
- if (editingComponent == null)
- configureEditingComponent(tree, renderer, realEditor);
-
- if (editingComponent != null && realEditor.isCellEditable(event))
+ {
+ boolean ret = false;
+ boolean ed = false;
+ if (event != null)
{
- prepareForEditing();
- return true;
+ if (event.getSource() instanceof JTree)
+ {
+ setTree((JTree) event.getSource());
+ if (event instanceof MouseEvent)
+ {
+ MouseEvent me = (MouseEvent) event;
+ TreePath path = tree.getPathForLocation(me.getX(), me.getY());
+ ed = lastPath != null && path != null && lastPath.equals(path);
+ if (path != null)
+ {
+ lastRow = tree.getRowForPath(path);
+ Object val = path.getLastPathComponent();
+ boolean isSelected = tree.isRowSelected(lastRow);
+ boolean isExpanded = tree.isExpanded(path);
+ TreeModel m = tree.getModel();
+ boolean isLeaf = m.isLeaf(val);
+ determineOffset(tree, val, isSelected, isExpanded, isLeaf,
+ lastRow);
+ }
+ }
+ }
}
- return false;
+ if (! realEditor.isCellEditable(event))
+ ret = false;
+ else
+ {
+ if (canEditImmediately(event))
+ ret = true;
+ else if (ed && shouldStartEditingTimer(event))
+ startEditingTimer();
+ else if (timer != null && timer.isRunning())
+ timer.stop();
+ }
+ if (ret)
+ prepareForEditing();
+ return ret;
+
}
/**
@@ -567,14 +580,13 @@ public class DefaultTreeCellEditor
*/
public boolean stopCellEditing()
{
- if (editingComponent != null)
+ boolean ret = false;
+ if (realEditor.stopCellEditing())
{
- stopEditingTimer();
- tree.stopEditing();
- editingComponent = null;
- return true;
+ finish();
+ ret = true;
}
- return false;
+ return ret;
}
/**
@@ -583,21 +595,15 @@ public class DefaultTreeCellEditor
*/
public void cancelCellEditing()
{
- if (editingComponent != null)
- {
- tree.cancelEditing();
- editingComponent = null;
- }
- stopEditingTimer();
+ realEditor.cancelCellEditing();
+ finish();
}
-
- /**
- * Stop the editing timer, if it is installed and running.
- */
- private void stopEditingTimer()
+
+ private void finish()
{
- if (timer != null && timer.isRunning())
- timer.stop();
+ if (editingComponent != null)
+ editingContainer.remove(editingComponent);
+ editingComponent = null;
}
/**
@@ -640,10 +646,18 @@ public class DefaultTreeCellEditor
*/
public void valueChanged(TreeSelectionEvent e)
{
- tPath = lastPath;
- lastPath = e.getNewLeadSelectionPath();
- lastRow = tree.getRowForPath(lastPath);
- stopCellEditing();
+ if (tree != null)
+ {
+ if (tree.getSelectionCount() == 1)
+ lastPath = tree.getSelectionPath();
+ else
+ lastPath = null;
+ }
+ // TODO: We really should do the following here, but can't due
+ // to buggy DefaultTreeSelectionModel. This selection model
+ // should only fire if the selection actually changes.
+// if (timer != null)
+// timer.stop();
}
/**
@@ -653,6 +667,8 @@ public class DefaultTreeCellEditor
*/
public void actionPerformed(ActionEvent e)
{
+ if (tree != null && lastPath != null)
+ tree.startEditingAtPath(lastPath);
}
/**
@@ -664,7 +680,17 @@ public class DefaultTreeCellEditor
*/
protected void setTree(JTree newTree)
{
- tree = newTree;
+ if (tree != newTree)
+ {
+ if (tree != null)
+ tree.removeTreeSelectionListener(this);
+ tree = newTree;
+ if (tree != null)
+ tree.addTreeSelectionListener(this);
+
+ if (timer != null)
+ timer.stop();
+ }
}
/**
@@ -675,10 +701,14 @@ public class DefaultTreeCellEditor
*/
protected boolean shouldStartEditingTimer(EventObject event)
{
- if ((event instanceof MouseEvent) &&
- ((MouseEvent) event).getClickCount() == 1)
- return true;
- return false;
+ boolean ret = false;
+ if (event instanceof MouseEvent)
+ {
+ MouseEvent me = (MouseEvent) event;
+ ret = SwingUtilities.isLeftMouseButton(me) && me.getClickCount() == 1
+ && inHitRegion(me.getX(), me.getY());
+ }
+ return ret;
}
/**
@@ -686,8 +716,12 @@ public class DefaultTreeCellEditor
*/
protected void startEditingTimer()
{
- if (timer != null)
- timer.start();
+ if (timer == null)
+ {
+ timer = new Timer(1200, this);
+ timer.setRepeats(false);
+ }
+ timer.start();
}
/**
@@ -723,7 +757,6 @@ public class DefaultTreeCellEditor
protected boolean inHitRegion(int x, int y)
{
Rectangle bounds = tree.getPathBounds(lastPath);
-
return bounds.contains(x, y);
}
@@ -739,13 +772,24 @@ public class DefaultTreeCellEditor
protected void determineOffset(JTree tree, Object value, boolean isSelected,
boolean expanded, boolean leaf, int row)
{
- renderer.getTreeCellRendererComponent(tree, value, isSelected, expanded,
- leaf, row, true);
- Icon c = renderer.getIcon();
- if (c != null)
- offset = renderer.getIconTextGap() + c.getIconWidth();
+ if (renderer != null)
+ {
+ if (leaf)
+ editingIcon = renderer.getLeafIcon();
+ else if (expanded)
+ editingIcon = renderer.getOpenIcon();
+ else
+ editingIcon = renderer.getClosedIcon();
+ if (editingIcon != null)
+ offset = renderer.getIconTextGap() + editingIcon.getIconWidth();
+ else
+ offset = renderer.getIconTextGap();
+ }
else
- offset = 0;
+ {
+ editingIcon = null;
+ offset = 0;
+ }
}
/**
@@ -754,8 +798,8 @@ public class DefaultTreeCellEditor
*/
protected void prepareForEditing()
{
- editingContainer.removeAll();
- editingContainer.add(editingComponent);
+ if (editingComponent != null)
+ editingContainer.add(editingComponent);
}
/**
@@ -776,10 +820,10 @@ public class DefaultTreeCellEditor
*/
protected TreeCellEditor createTreeCellEditor()
{
- DefaultCellEditor editor = new DefaultCellEditor(new DefaultTreeCellEditor.DefaultTextField(
- UIManager.getBorder("Tree.selectionBorder")));
- editor.addCellEditorListener(new RealEditorListener());
- editor.setClickCountToStart(CLICK_COUNT_TO_START);
+ Border border = UIManager.getBorder("Tree.editorBorder");
+ JTextField tf = new DefaultTreeCellEditor.DefaultTextField(border);
+ DefaultCellEditor editor = new DefaultCellEditor(tf);
+ editor.setClickCountToStart(1);
realEditor = editor;
return editor;
}
diff --git a/libjava/classpath/javax/swing/tree/DefaultTreeCellRenderer.java b/libjava/classpath/javax/swing/tree/DefaultTreeCellRenderer.java
index e120b71c167..3766485abdb 100644
--- a/libjava/classpath/javax/swing/tree/DefaultTreeCellRenderer.java
+++ b/libjava/classpath/javax/swing/tree/DefaultTreeCellRenderer.java
@@ -77,7 +77,7 @@ public class DefaultTreeCellRenderer
protected boolean hasFocus;
/**
- * drawsFocusBorderAroundIcon // FIXME: is this used?
+ * Indicates if the focus border is also drawn around the icon.
*/
private boolean drawsFocusBorderAroundIcon;
@@ -152,6 +152,8 @@ public class DefaultTreeCellRenderer
setBackgroundNonSelectionColor(UIManager.getColor("Tree.textBackground"));
setBackgroundSelectionColor(UIManager.getColor("Tree.selectionBackground"));
setBorderSelectionColor(UIManager.getColor("Tree.selectionBorderColor"));
+ Object val = UIManager.get("Tree.drawsFocusBorderAroundIcon");
+ drawsFocusBorderAroundIcon = val != null && ((Boolean) val).booleanValue();
}
/**
@@ -499,67 +501,75 @@ public class DefaultTreeCellRenderer
*/
public void paint(Graphics g)
{
- // paint background
- Rectangle vr = new Rectangle();
- Rectangle ir = new Rectangle();
- Rectangle tr = new Rectangle();
-
- Insets insets = new Insets(0, 0, 0, 0);
- Border border = UIManager.getBorder("Tree.selectionBorder");
- if (border != null)
- insets = border.getBorderInsets(this);
-
- FontMetrics fm = getToolkit().getFontMetrics(getFont());
- SwingUtilities.layoutCompoundLabel((JLabel) this, fm, getText(),
- getIcon(), getVerticalAlignment(),
- getHorizontalAlignment(),
- getVerticalTextPosition(),
- getHorizontalTextPosition(), vr, ir, tr,
- getIconTextGap());
-
- // Reusing one rectangle.
- Rectangle bounds = getBounds(ir);
-
- bounds.x = tr.x - insets.left;
- bounds.width = tr.width + insets.left + insets.right;
-
- g.setColor(super.getBackground());
- g.fillRect(bounds.x, bounds.y, bounds.width, bounds.height);
+ // Determine background color.
+ Color bgColor;
+ if (selected)
+ bgColor = getBackgroundSelectionColor();
+ else
+ {
+ bgColor = getBackgroundNonSelectionColor();
+ if (bgColor == null)
+ bgColor = getBackground();
+ }
+ // Paint background.
+ int xOffset = -1;
+ if (bgColor != null)
+ {
+ Icon i = getIcon();
+ xOffset = getXOffset();
+ g.setColor(bgColor);
+ g.fillRect(xOffset, 0, getWidth() - xOffset, getHeight());
+ }
- super.paint(g);
-
- // Paint the border of the focused element only (lead selection)
if (hasFocus)
{
- Color b = getBorderSelectionColor();
- if (b != null)
- {
- g.setColor(b);
- g.drawRect(bounds.x, bounds.y, bounds.width, bounds.height - 1);
- }
+ if (drawsFocusBorderAroundIcon)
+ xOffset = 0;
+ else if (xOffset == -1)
+ xOffset = getXOffset();
+ paintFocus(g, xOffset, 0, getWidth() - xOffset, getHeight());
+ }
+ super.paint(g);
+ }
+
+ /**
+ * Paints the focus indicator.
+ */
+ private void paintFocus(Graphics g, int x, int y, int w, int h)
+ {
+ Color col = getBorderSelectionColor();
+ if (col != null)
+ {
+ g.setColor(col);
+ g.drawRect(x, y, w - 1, h - 1);
}
}
/**
+ * Determines the X offset of the label that is caused by
+ * the icon.
+ *
+ * @return the X offset of the label
+ */
+ private int getXOffset()
+ {
+ Icon i = getIcon();
+ int offs = 0;
+ if (i != null && getText() != null)
+ offs = i.getIconWidth() + Math.max(0, getIconTextGap() - 1);
+ return offs;
+ }
+
+ /**
* Returns the preferred size of the cell.
*
* @return The preferred size of the cell.
*/
public Dimension getPreferredSize()
{
- Rectangle vr = new Rectangle();
- Rectangle ir = new Rectangle();
- Rectangle tr = new Rectangle();
-
- FontMetrics fm = getToolkit().getFontMetrics(getFont());
- SwingUtilities.layoutCompoundLabel((JLabel) this, fm, getText(),
- getIcon(), getVerticalAlignment(),
- getHorizontalAlignment(),
- getVerticalTextPosition(),
- getHorizontalTextPosition(), vr, ir, tr,
- getIconTextGap());
- Rectangle cr = ir.union(tr);
- return new Dimension(cr.width, cr.height);
+ Dimension size = super.getPreferredSize();
+ size.width += 3;
+ return size;
}
/**
diff --git a/libjava/classpath/javax/swing/tree/DefaultTreeModel.java b/libjava/classpath/javax/swing/tree/DefaultTreeModel.java
index 5819d15b627..afee7ea22fa 100644
--- a/libjava/classpath/javax/swing/tree/DefaultTreeModel.java
+++ b/libjava/classpath/javax/swing/tree/DefaultTreeModel.java
@@ -210,17 +210,32 @@ public class DefaultTreeModel
}
/**
- * isLeaf
+ * Returns if the specified node is a leaf or not. When
+ * {@link #asksAllowsChildren} is true, then this checks if the TreeNode
+ * allows children, otherwise it returns the TreeNode's <code>leaf</code>
+ * property.
*
- * @param node TODO
- * @return boolean
+ * @param node the node to check
+ *
+ * @return boolean <code>true</code> if the node is a leaf node,
+ * <code>false</code> otherwise
+ *
+ * @throws ClassCastException if the specified node is not a
+ * <code>TreeNode</code> instance
+ *
+ * @see TreeNode#getAllowsChildren()
+ * @see TreeNode#isLeaf()
*/
public boolean isLeaf(Object node)
{
- if (node instanceof TreeNode)
- return ((TreeNode) node).isLeaf();
+ // The RI throws a ClassCastException when node isn't a TreeNode, so do we.
+ TreeNode treeNode = (TreeNode) node;
+ boolean leaf;
+ if (asksAllowsChildren)
+ leaf = ! treeNode.getAllowsChildren();
else
- return true;
+ leaf = treeNode.isLeaf();
+ return leaf;
}
/**
@@ -600,7 +615,7 @@ public class DefaultTreeModel
*
* @since 1.3
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
return listenerList.getListeners(listenerType);
}
diff --git a/libjava/classpath/javax/swing/tree/DefaultTreeSelectionModel.java b/libjava/classpath/javax/swing/tree/DefaultTreeSelectionModel.java
index 0684ef76659..3d9c67728bd 100644
--- a/libjava/classpath/javax/swing/tree/DefaultTreeSelectionModel.java
+++ b/libjava/classpath/javax/swing/tree/DefaultTreeSelectionModel.java
@@ -44,6 +44,7 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Arrays;
+import java.util.BitSet;
import java.util.EventListener;
import java.util.HashSet;
import java.util.Iterator;
@@ -67,7 +68,39 @@ import javax.swing.event.TreeSelectionListener;
public class DefaultTreeSelectionModel
implements Cloneable, Serializable, TreeSelectionModel
{
-
+
+ /**
+ * According to the API docs, the method
+ * {@link DefaultTreeSelectionModel#notifyPathChange} should
+ * expect instances of a class PathPlaceHolder in the Vector parameter.
+ * This seems to be a non-public class, so I can only make guesses about the
+ * use of it.
+ */
+ private static class PathPlaceHolder
+ {
+ /**
+ * The path that we wrap.
+ */
+ TreePath path;
+
+ /**
+ * Indicates if the path is new or already in the selection.
+ */
+ boolean isNew;
+
+ /**
+ * Creates a new instance.
+ *
+ * @param p the path to wrap
+ * @param n if the path is new or already in the selection
+ */
+ PathPlaceHolder(TreePath p, boolean n)
+ {
+ path = p;
+ isNew = n;
+ }
+ }
+
/**
* Use serialVersionUID for interoperability.
*/
@@ -124,12 +157,36 @@ public class DefaultTreeSelectionModel
protected int leadRow = -1;
/**
+ * A supporting datastructure that is used in addSelectionPaths() and
+ * removeSelectionPaths(). It contains currently selected paths.
+ *
+ * @see #addSelectionPaths(TreePath[])
+ * @see #removeSelectionPaths(TreePath[])
+ * @see #setSelectionPaths(TreePath[])
+ */
+ private transient HashSet selectedPaths;
+
+ /**
+ * A supporting datastructure that is used in addSelectionPaths() and
+ * removeSelectionPaths(). It contains the paths that are added or removed.
+ *
+ * @see #addSelectionPaths(TreePath[])
+ * @see #removeSelectionPaths(TreePath[])
+ * @see #setSelectionPaths(TreePath[])
+ */
+ private transient HashSet tmpPaths;
+
+ /**
* Constructs a new DefaultTreeSelectionModel.
*/
public DefaultTreeSelectionModel()
{
setSelectionMode(DISCONTIGUOUS_TREE_SELECTION);
+ listSelectionModel = new DefaultListSelectionModel();
listenerList = new EventListenerList();
+ leadIndex = -1;
+ tmpPaths = new HashSet();
+ selectedPaths = new HashSet();
}
/**
@@ -144,12 +201,14 @@ public class DefaultTreeSelectionModel
{
DefaultTreeSelectionModel cloned =
(DefaultTreeSelectionModel) super.clone();
-
- // Clone the selection and the list selection model.
+ cloned.changeSupport = null;
cloned.selection = (TreePath[]) selection.clone();
- if (listSelectionModel != null)
- cloned.listSelectionModel
- = (DefaultListSelectionModel) listSelectionModel.clone();
+ cloned.listenerList = new EventListenerList();
+ cloned.listSelectionModel =
+ (DefaultListSelectionModel) listSelectionModel.clone();
+ cloned.selectedPaths = new HashSet();
+ cloned.tmpPaths = new HashSet();
+
return cloned;
}
@@ -209,6 +268,7 @@ public class DefaultTreeSelectionModel
public void setRowMapper(RowMapper mapper)
{
rowMapper = mapper;
+ resetRowSelection();
}
/**
@@ -236,8 +296,18 @@ public class DefaultTreeSelectionModel
*/
public void setSelectionMode(int mode)
{
+ int oldMode = selectionMode;
selectionMode = mode;
- insureRowContinuity();
+ // Make sure we have a valid selection mode.
+ if (selectionMode != SINGLE_TREE_SELECTION
+ && selectionMode != CONTIGUOUS_TREE_SELECTION
+ && selectionMode != DISCONTIGUOUS_TREE_SELECTION)
+ selectionMode = DISCONTIGUOUS_TREE_SELECTION;
+
+ // Fire property change event.
+ if (oldMode != selectionMode && changeSupport != null)
+ changeSupport.firePropertyChange(SELECTION_MODE_PROPERTY, oldMode,
+ selectionMode);
}
/**
@@ -262,32 +332,10 @@ public class DefaultTreeSelectionModel
*/
public void setSelectionPath(TreePath path)
{
- // The most frequently only one cell in the tree is selected.
- TreePath[] ose = selection;
- selection = new TreePath[] { path };
- TreePath oldLead = leadPath;
- leadIndex = 0;
- leadRow = getRow(path);
- leadPath = path;
-
- TreeSelectionEvent event;
-
- if (ose != null && ose.length > 0)
- {
- // The first item in the path list is the selected path.
- // The remaining items are unselected pathes.
- TreePath[] changed = new TreePath[ose.length + 1];
- boolean[] news = new boolean[changed.length];
- news[0] = true;
- changed[0] = path;
- System.arraycopy(ose, 0, changed, 1, ose.length);
- event = new TreeSelectionEvent(this, changed, news, oldLead, path);
- }
- else
- {
- event = new TreeSelectionEvent(this, path, true, oldLead, path);
- }
- fireValueChanged(event);
+ TreePath[] paths = null;
+ if (path != null)
+ paths = new TreePath[]{ path };
+ setSelectionPaths(paths);
}
/**
@@ -307,7 +355,7 @@ public class DefaultTreeSelectionModel
AbstractLayoutCache ama = (AbstractLayoutCache) mapper;
return ama.getRowForPath(path);
}
- else
+ else if (mapper != null)
{
// Generic non optimized implementation.
int[] rows = mapper.getRowsForPaths(new TreePath[] { path });
@@ -316,6 +364,7 @@ public class DefaultTreeSelectionModel
else
return rows[0];
}
+ return -1;
}
/**
@@ -327,10 +376,90 @@ public class DefaultTreeSelectionModel
*/
public void setSelectionPaths(TreePath[] paths)
{
- // Must be called, as defined in JDK API 1.4.
- insureUniqueness();
- clearSelection();
- addSelectionPaths(paths);
+ int oldLength = 0;
+ if (selection != null)
+ oldLength = selection.length;
+ int newLength = 0;
+ if (paths != null)
+ newLength = paths.length;
+ if (newLength > 0 || oldLength > 0)
+ {
+ // For SINGLE_TREE_SELECTION and for CONTIGUOUS_TREE_SELECTION with
+ // a non-contiguous path, we only allow the first path element.
+ if ((selectionMode == SINGLE_TREE_SELECTION && newLength > 1)
+ || (selectionMode == CONTIGUOUS_TREE_SELECTION && newLength > 0
+ && ! arePathsContiguous(paths)))
+ {
+ paths = new TreePath[] { paths[0] };
+ newLength = 1;
+ }
+ // Find new paths.
+ Vector changedPaths = null;
+ tmpPaths.clear();
+ int validPaths = 0;
+ TreePath oldLeadPath = leadPath;
+ for (int i = 0; i < newLength; i++)
+ {
+ if (paths[i] != null && ! tmpPaths.contains(paths[i]))
+ {
+ validPaths++;
+ tmpPaths.add(paths[i]);
+ if (! selectedPaths.contains(paths[i]))
+ {
+ if (changedPaths == null)
+ changedPaths = new Vector();
+ changedPaths.add(new PathPlaceHolder(paths[i], true));
+ }
+ leadPath = paths[i];
+ }
+ }
+ // Put together the new selection.
+ TreePath[] newSelection = null;
+ if (validPaths != 0)
+ {
+ if (validPaths != newLength)
+ {
+ // Some of the paths are already selected, put together
+ // the new selection carefully.
+ newSelection = new TreePath[validPaths];
+ Iterator newPaths = tmpPaths.iterator();
+ validPaths = 0;
+ for (int i = 0; newPaths.hasNext(); i++)
+ newSelection[i] = (TreePath) newPaths.next();
+ }
+ else
+ {
+ newSelection = new TreePath[paths.length];
+ System.arraycopy(paths, 0, newSelection, 0, paths.length);
+ }
+ }
+
+ // Find paths that have been selected, but are no more.
+ for (int i = 0; i < oldLength; i++)
+ {
+ if (selection[i] != null && ! tmpPaths.contains(selection[i]))
+ {
+ if (changedPaths == null)
+ changedPaths = new Vector();
+ changedPaths.add(new PathPlaceHolder(selection[i], false));
+ }
+ }
+
+ // Perform changes and notification.
+ selection = newSelection;
+ HashSet tmp = selectedPaths;
+ selectedPaths = tmpPaths;
+ tmpPaths = tmp;
+ tmpPaths.clear();
+
+ // Not necessary, but required according to the specs and to tests.
+ if (selection != null)
+ insureUniqueness();
+ updateLeadIndex();
+ resetRowSelection();
+ if (changedPaths != null && changedPaths.size() > 0)
+ notifyPathChange(changedPaths, oldLeadPath);
+ }
}
/**
@@ -345,29 +474,10 @@ public class DefaultTreeSelectionModel
*/
public void addSelectionPath(TreePath path)
{
- if (! isPathSelected(path))
+ if (path != null)
{
- if (selectionMode == SINGLE_TREE_SELECTION || isSelectionEmpty()
- || ! canPathBeAdded(path))
- setSelectionPath(path);
- else
- {
- TreePath[] temp = new TreePath[selection.length + 1];
- System.arraycopy(selection, 0, temp, 0, selection.length);
- temp[temp.length - 1] = path;
- selection = new TreePath[temp.length];
- System.arraycopy(temp, 0, selection, 0, temp.length);
- }
- }
-
- if (path != leadPath)
- {
- TreePath oldLead = leadPath;
- leadPath = path;
- leadRow = getRow(path);
- leadIndex = selection.length - 1;
- fireValueChanged(new TreeSelectionEvent(this, path, true, oldLead,
- leadPath));
+ TreePath[] add = new TreePath[]{ path };
+ addSelectionPaths(add);
}
}
@@ -380,37 +490,76 @@ public class DefaultTreeSelectionModel
*/
public void addSelectionPaths(TreePath[] paths)
{
- // Must be called, as defined in JDK API 1.4.
- insureUniqueness();
-
- if (paths != null)
+ int length = paths != null ? paths.length : 0;
+ if (length > 0)
{
- TreePath v0 = null;
- for (int i = 0; i < paths.length; i++)
+ if (selectionMode == SINGLE_TREE_SELECTION)
+ setSelectionPaths(paths);
+ else if (selectionMode == CONTIGUOUS_TREE_SELECTION
+ && ! canPathsBeAdded(paths))
+ {
+ if (arePathsContiguous(paths))
+ setSelectionPaths(paths);
+ else
+ setSelectionPaths(new TreePath[] { paths[0] });
+ }
+ else
{
- v0 = paths[i];
- if (! isPathSelected(v0))
+ Vector changedPaths = null;
+ tmpPaths.clear();
+ int validPaths = 0;
+ TreePath oldLeadPath = leadPath;
+ int oldPaths = 0;
+ if (selection != null)
+ oldPaths = selection.length;
+ int i;
+ for (i = 0; i < length; i++)
{
- if (isSelectionEmpty())
- setSelectionPath(v0);
- else
+ if (paths[i] != null)
{
- TreePath[] temp = new TreePath[selection.length + 1];
- System.arraycopy(selection, 0, temp, 0, selection.length);
- temp[temp.length - 1] = v0;
- selection = new TreePath[temp.length];
- System.arraycopy(temp, 0, selection, 0, temp.length);
+ if (! selectedPaths.contains(paths[i]))
+ {
+ validPaths++;
+ if (changedPaths == null)
+ changedPaths = new Vector();
+ changedPaths.add(new PathPlaceHolder(paths[i], true));
+ selectedPaths.add(paths[i]);
+ tmpPaths.add(paths[i]);
+ }
+ leadPath = paths[i];
}
- TreePath oldLead = leadPath;
- leadPath = paths[paths.length - 1];
- leadRow = getRow(leadPath);
- leadIndex = selection.length - 1;
-
- fireValueChanged(new TreeSelectionEvent(this, v0, true,
- oldLead, leadPath));
}
+ if (validPaths > 0)
+ {
+ TreePath[] newSelection = new TreePath[oldPaths + validPaths];
+ if (oldPaths > 0)
+ System.arraycopy(selection, 0, newSelection, 0, oldPaths);
+ if (validPaths != paths.length)
+ {
+ // Some of the paths are already selected, put together
+ // the new selection carefully.
+ Iterator newPaths = tmpPaths.iterator();
+ i = oldPaths;
+ while (newPaths.hasNext())
+ {
+ newSelection[i] = (TreePath) newPaths.next();
+ i++;
+ }
+ }
+ else
+ System.arraycopy(paths, 0, newSelection, oldPaths,
+ validPaths);
+ selection = newSelection;
+ insureUniqueness();
+ updateLeadIndex();
+ resetRowSelection();
+ if (changedPaths != null && changedPaths.size() > 0)
+ notifyPathChange(changedPaths, oldLeadPath);
+ }
+ else
+ leadPath = oldLeadPath;
+ tmpPaths.clear();
}
- insureRowContinuity();
}
}
@@ -422,36 +571,8 @@ public class DefaultTreeSelectionModel
*/
public void removeSelectionPath(TreePath path)
{
- if (isSelectionEmpty())
- return;
-
- int index = - 1;
- if (isPathSelected(path))
- {
- for (int i = 0; i < selection.length; i++)
- {
- if (selection[i].equals(path))
- {
- index = i;
- break;
- }
- }
- TreePath[] temp = new TreePath[selection.length - 1];
- System.arraycopy(selection, 0, temp, 0, index);
- System.arraycopy(selection, index + 1, temp, index, selection.length
- - index - 1);
- selection = new TreePath[temp.length];
- System.arraycopy(temp, 0, selection, 0, temp.length);
-
- // If the removed path was the lead path, set the lead path to null.
- TreePath oldLead = leadPath;
- if (path != null && leadPath != null && path.equals(leadPath))
- leadPath = null;
-
- fireValueChanged(new TreeSelectionEvent(this, path, false, oldLead,
- leadPath));
- insureRowContinuity();
- }
+ if (path != null)
+ removeSelectionPaths(new TreePath[]{ path });
}
/**
@@ -462,40 +583,54 @@ public class DefaultTreeSelectionModel
*/
public void removeSelectionPaths(TreePath[] paths)
{
- if (isSelectionEmpty())
- return;
- if (paths != null)
+ if (paths != null && selection != null && paths.length > 0)
{
- int index = - 1;
- TreePath v0 = null;
- TreePath oldLead = leadPath;
- for (int i = 0; i < paths.length; i++)
+ if (! canPathsBeRemoved(paths))
+ clearSelection();
+ else
{
- v0 = paths[i];
- if (isPathSelected(v0))
+ Vector pathsToRemove = null;
+ for (int i = paths.length - 1; i >= 0; i--)
{
- for (int x = 0; x < selection.length; x++)
+ if (paths[i] != null && selectedPaths.contains(paths[i]))
{
- if (selection[i].equals(v0))
- {
- index = x;
- break;
- }
- if (leadPath != null && leadPath.equals(v0))
+ if (pathsToRemove == null)
+ pathsToRemove = new Vector();
+ selectedPaths.remove(paths[i]);
+ pathsToRemove.add(new PathPlaceHolder(paths[i],
+ false));
+ }
+ }
+ if (pathsToRemove != null)
+ {
+ int numRemove = pathsToRemove.size();
+ TreePath oldLead = leadPath;
+ if (numRemove == selection.length)
+ selection = null;
+ else
+ {
+ selection = new TreePath[selection.length - numRemove];
+ Iterator keep = selectedPaths.iterator();
+ for (int valid = 0; keep.hasNext(); valid++)
+ selection[valid] = (TreePath) keep.next();
+ }
+ // Update lead path.
+ if (leadPath != null && ! selectedPaths.contains(leadPath))
+ {
+ if (selection != null)
+ leadPath = selection[selection.length - 1];
+ else
leadPath = null;
}
- TreePath[] temp = new TreePath[selection.length - 1];
- System.arraycopy(selection, 0, temp, 0, index);
- System.arraycopy(selection, index + 1, temp, index,
- selection.length - index - 1);
- selection = new TreePath[temp.length];
- System.arraycopy(temp, 0, selection, 0, temp.length);
-
- fireValueChanged(new TreeSelectionEvent(this, v0, false,
- oldLead, leadPath));
+ else if (selection != null)
+ leadPath = selection[selection.length - 1];
+ else
+ leadPath = null;
+ updateLeadIndex();
+ resetRowSelection();
+ notifyPathChange(pathsToRemove, oldLead);
}
}
- insureRowContinuity();
}
}
@@ -572,19 +707,22 @@ public class DefaultTreeSelectionModel
*/
public void clearSelection()
{
- if (! isSelectionEmpty())
+ if (selection != null)
{
- TreeSelectionEvent event = new TreeSelectionEvent(
- this, selection, new boolean[selection.length], leadPath, null);
+ int selectionLength = selection.length;
+ boolean[] news = new boolean[selectionLength];
+ Arrays.fill(news, false);
+ TreeSelectionEvent event = new TreeSelectionEvent(this, selection,
+ news, leadPath,
+ null);
leadPath = null;
+ leadIndex = 0;
+ leadRow = 0;
+ selectedPaths.clear();
selection = null;
+ resetRowSelection();
fireValueChanged(event);
}
- else
- {
- leadPath = null;
- selection = null;
- }
}
/**
@@ -638,7 +776,7 @@ public class DefaultTreeSelectionModel
* @return an array of listeners
* @since 1.3
*/
- public EventListener[] getListeners(Class listenerType)
+ public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
return listenerList.getListeners(listenerType);
}
@@ -650,10 +788,43 @@ public class DefaultTreeSelectionModel
*/
public int[] getSelectionRows()
{
- if (rowMapper == null)
- return null;
- else
- return rowMapper.getRowsForPaths(selection);
+ int[] rows = null;
+ if (rowMapper != null && selection != null)
+ {
+ rows = rowMapper.getRowsForPaths(selection);
+ if (rows != null)
+ {
+ // Find invisible rows.
+ int invisible = 0;
+ for (int i = rows.length - 1; i >= 0; i--)
+ {
+ if (rows[i] == -1)
+ invisible++;
+
+ }
+ // Clean up invisible rows.
+ if (invisible > 0)
+ {
+ if (invisible == rows.length)
+ rows = null;
+ else
+ {
+ int[] newRows = new int[rows.length - invisible];
+ int visCount = 0;
+ for (int i = rows.length - 1; i >= 0; i--)
+ {
+ if (rows[i] != -1)
+ {
+ newRows[visCount] = rows[i];
+ visCount++;
+ }
+ }
+ rows = newRows;
+ }
+ }
+ }
+ }
+ return rows;
}
/**
@@ -663,16 +834,7 @@ public class DefaultTreeSelectionModel
*/
public int getMinSelectionRow()
{
- if ((rowMapper == null) || (selection == null) || (selection.length == 0))
- return - 1;
- else
- {
- int[] rows = rowMapper.getRowsForPaths(selection);
- int minRow = Integer.MAX_VALUE;
- for (int index = 0; index < rows.length; index++)
- minRow = Math.min(minRow, rows[index]);
- return minRow;
- }
+ return listSelectionModel.getMinSelectionIndex();
}
/**
@@ -682,16 +844,7 @@ public class DefaultTreeSelectionModel
*/
public int getMaxSelectionRow()
{
- if ((rowMapper == null) || (selection == null) || (selection.length == 0))
- return - 1;
- else
- {
- int[] rows = rowMapper.getRowsForPaths(selection);
- int maxRow = - 1;
- for (int index = 0; index < rows.length; index++)
- maxRow = Math.max(maxRow, rows[index]);
- return maxRow;
- }
+ return listSelectionModel.getMaxSelectionIndex();
}
/**
@@ -706,29 +859,7 @@ public class DefaultTreeSelectionModel
*/
public boolean isRowSelected(int row)
{
- // Return false if nothing is selected.
- if (isSelectionEmpty())
- return false;
-
- RowMapper mapper = getRowMapper();
-
- if (mapper instanceof AbstractLayoutCache)
- {
- // The absolute majority of cases, unless the TreeUI is very
- // seriously rewritten
- AbstractLayoutCache ama = (AbstractLayoutCache) mapper;
- TreePath path = ama.getPathForRow(row);
- return isPathSelected(path);
- }
- else
- {
- // Generic non optimized implementation.
- int[] rows = mapper.getRowsForPaths(selection);
- for (int i = 0; i < rows.length; i++)
- if (rows[i] == row)
- return true;
- return false;
- }
+ return listSelectionModel.isSelectedIndex(row);
}
/**
@@ -736,7 +867,32 @@ public class DefaultTreeSelectionModel
*/
public void resetRowSelection()
{
- // Nothing to do here.
+ listSelectionModel.clearSelection();
+ if (selection != null && rowMapper != null)
+ {
+ int[] rows = rowMapper.getRowsForPaths(selection);
+ // Update list selection model.
+ for (int i = 0; i < rows.length; i++)
+ {
+ int row = rows[i];
+ if (row != -1)
+ listSelectionModel.addSelectionInterval(row, row);
+ }
+ // Update lead selection.
+ if (leadIndex != -1 && rows != null)
+ leadRow = rows[leadIndex];
+ else if (leadPath != null)
+ {
+ TreePath[] tmp = new TreePath[]{ leadPath };
+ rows = rowMapper.getRowsForPaths(tmp);
+ leadRow = rows != null ? rows[0] : -1;
+ }
+ else
+ leadRow = -1;
+ insureRowContinuity();
+ }
+ else
+ leadRow = -1;
}
/**
@@ -766,6 +922,8 @@ public class DefaultTreeSelectionModel
*/
public void addPropertyChangeListener(PropertyChangeListener listener)
{
+ if (changeSupport == null)
+ changeSupport = new SwingPropertyChangeSupport(this);
changeSupport.addPropertyChangeListener(listener);
}
@@ -776,7 +934,8 @@ public class DefaultTreeSelectionModel
*/
public void removePropertyChangeListener(PropertyChangeListener listener)
{
- changeSupport.removePropertyChangeListener(listener);
+ if (changeSupport != null)
+ changeSupport.removePropertyChangeListener(listener);
}
/**
@@ -787,7 +946,12 @@ public class DefaultTreeSelectionModel
*/
public PropertyChangeListener[] getPropertyChangeListeners()
{
- return changeSupport.getPropertyChangeListeners();
+ PropertyChangeListener[] listeners = null;
+ if (changeSupport != null)
+ listeners = changeSupport.getPropertyChangeListeners();
+ else
+ listeners = new PropertyChangeListener[0];
+ return listeners;
}
/**
@@ -801,67 +965,41 @@ public class DefaultTreeSelectionModel
*/
protected void insureRowContinuity()
{
- if (selection == null || selection.length < 2)
- return;
- else if (selectionMode == CONTIGUOUS_TREE_SELECTION)
+ if (selectionMode == CONTIGUOUS_TREE_SELECTION && selection != null
+ && rowMapper != null)
{
- if (rowMapper == null)
- // This is the best we can do without the row mapper:
- selectOne();
- else
+ int min = listSelectionModel.getMinSelectionIndex();
+ if (min != -1)
{
- int[] rows = rowMapper.getRowsForPaths(selection);
- Arrays.sort(rows);
- int i;
- for (i = 1; i < rows.length; i++)
- {
- if (rows[i - 1] != rows[i] - 1)
- // Break if no longer continuous.
- break;
- }
-
- if (i < rows.length)
+ int max = listSelectionModel.getMaxSelectionIndex();
+ for (int i = min; i <= max; i++)
{
- TreePath[] ns = new TreePath[i];
- for (int j = 0; j < ns.length; j++)
- ns[i] = getPath(j);
- setSelectionPaths(ns);
+ if (! listSelectionModel.isSelectedIndex(i))
+ {
+ if (i == min)
+ clearSelection();
+ else
+ {
+ TreePath[] newSelection = new TreePath[i - min];
+ int[] rows = rowMapper.getRowsForPaths(selection);
+ for (int j = 0; j < rows.length; j++)
+ {
+ if (rows[j] < i)
+ newSelection[rows[j] - min] = selection[j];
+ }
+ setSelectionPaths(newSelection);
+ break;
+ }
+ }
}
}
}
- else if (selectionMode == SINGLE_TREE_SELECTION)
- selectOne();
+ else if (selectionMode == SINGLE_TREE_SELECTION && selection != null
+ && selection.length > 1)
+ setSelectionPath(selection[0]);
}
/**
- * Keep only one (normally last or leading) path in the selection.
- */
- private void selectOne()
- {
- if (leadIndex > 0 && leadIndex < selection.length)
- setSelectionPath(selection[leadIndex]);
- else
- setSelectionPath(selection[selection.length - 1]);
- }
-
- /**
- * Get path for the given row that must be in the current selection.
- */
- private TreePath getPath(int row)
- {
- if (rowMapper instanceof AbstractLayoutCache)
- return ((AbstractLayoutCache) rowMapper).getPathForRow(row);
- else
- {
- int[] rows = rowMapper.getRowsForPaths(selection);
- for (int i = 0; i < rows.length; i++)
- if (rows[i] == row)
- return selection[i];
- }
- throw new InternalError(row + " not in selection");
- }
-
- /**
* Returns <code>true</code> if the paths are contiguous (take subsequent
* rows in the diplayed tree view. The method returns <code>true</code> if
* we have no RowMapper assigned.
@@ -875,16 +1013,36 @@ public class DefaultTreeSelectionModel
if (rowMapper == null || paths.length < 2)
return true;
- int[] rows = rowMapper.getRowsForPaths(paths);
-
- // The patches may not be sorted.
- Arrays.sort(rows);
-
- for (int i = 1; i < rows.length; i++)
+ int length = paths.length;
+ TreePath[] tmp = new TreePath[1];
+ tmp[0] = paths[0];
+ int min = rowMapper.getRowsForPaths(tmp)[0];
+ BitSet selected = new BitSet();
+ int valid = 0;
+ for (int i = 0; i < length; i++)
{
- if (rows[i - 1] != rows[i] - 1)
- return false;
+ if (paths[i] != null)
+ {
+ tmp[0] = paths[i];
+ int[] rows = rowMapper.getRowsForPaths(tmp);
+ if (rows == null)
+ return false; // No row mapping yet, can't be selected.
+ int row = rows[0];
+ if (row == -1 || row < (min - length) || row > (min + length))
+ return false; // Not contiguous.
+ min = Math.min(min, row);
+ if (! selected.get(row))
+ {
+ selected.set(row);
+ valid++;
+ }
+
+ }
}
+ int max = valid + min;
+ for (int i = min; i < max; i++)
+ if (! selected.get(i))
+ return false; // Not contiguous.
return true;
}
@@ -904,34 +1062,51 @@ public class DefaultTreeSelectionModel
*/
protected boolean canPathsBeAdded(TreePath[] paths)
{
- if (rowMapper == null || isSelectionEmpty()
- || selectionMode == DISCONTIGUOUS_TREE_SELECTION)
+ if (paths == null || paths.length == 0 || rowMapper == null
+ || selection == null || selectionMode == DISCONTIGUOUS_TREE_SELECTION)
return true;
-
- TreePath [] all = new TreePath[paths.length + selection.length];
- System.arraycopy(paths, 0, all, 0, paths.length);
- System.arraycopy(selection, 0, all, paths.length, selection.length);
- return arePathsContiguous(all);
+ BitSet selected = new BitSet();
+ int min = listSelectionModel.getMinSelectionIndex();
+ int max = listSelectionModel.getMaxSelectionIndex();
+ TreePath[] tmp = new TreePath[1];
+ if (min != -1)
+ {
+ // Set the bitmask of selected elements.
+ for (int i = min; i <= max; i++)
+ selected.set(i);
+ }
+ else
+ {
+ tmp[0] = paths[0];
+ min = rowMapper.getRowsForPaths(tmp)[0];
+ max = min;
+ }
+ // Mark new paths as selected.
+ for (int i = paths.length - 1; i >= 0; i--)
+ {
+ if (paths[i] != null)
+ {
+ tmp[0] = paths[i];
+ int[] rows = rowMapper.getRowsForPaths(tmp);
+ if (rows == null)
+ return false; // Now row mapping yet, can't be selected.
+ int row = rows[0];
+ if (row == -1)
+ return false; // Now row mapping yet, can't be selected.
+ min = Math.min(min, row);
+ max = Math.max(max, row);
+ selected.set(row);
+ }
+ }
+ // Now look if the new selection would be contiguous.
+ for (int i = min; i <= max; i++)
+ if (! selected.get(i))
+ return false;
+ return true;
}
/**
- * Checks if the single path can be added to selection.
- */
- private boolean canPathBeAdded(TreePath path)
- {
- if (rowMapper == null || isSelectionEmpty()
- || selectionMode == DISCONTIGUOUS_TREE_SELECTION)
- return true;
-
- TreePath[] all = new TreePath[selection.length + 1];
- System.arraycopy(selection, 0, all, 0, selection.length);
- all[all.length - 1] = path;
-
- return arePathsContiguous(all);
- }
-
- /**
* Checks if the paths can be removed without breaking the continuity of the
* selection according to selectionMode.
*
@@ -966,20 +1141,23 @@ public class DefaultTreeSelectionModel
* method will call listeners if invoked, but it is not called from the
* implementation of this class.
*
- * @param vPathes the vector of the changed patches
+ * @param vPaths the vector of the changed patches
* @param oldLeadSelection the old selection index
*/
- protected void notifyPathChange(Vector vPathes, TreePath oldLeadSelection)
+ protected void notifyPathChange(Vector vPaths, TreePath oldLeadSelection)
{
- TreePath[] pathes = new TreePath[vPathes.size()];
- for (int i = 0; i < pathes.length; i++)
- pathes[i] = (TreePath) vPathes.get(i);
- boolean[] news = new boolean[pathes.length];
- for (int i = 0; i < news.length; i++)
- news[i] = isPathSelected(pathes[i]);
+ int numChangedPaths = vPaths.size();
+ boolean[] news = new boolean[numChangedPaths];
+ TreePath[] paths = new TreePath[numChangedPaths];
+ for (int i = 0; i < numChangedPaths; i++)
+ {
+ PathPlaceHolder p = (PathPlaceHolder) vPaths.get(i);
+ news[i] = p.isNew;
+ paths[i] = p.path;
+ }
- TreeSelectionEvent event = new TreeSelectionEvent(this, pathes, news,
+ TreeSelectionEvent event = new TreeSelectionEvent(this, paths, news,
oldLeadSelection,
leadPath);
fireValueChanged(event);
@@ -991,22 +1169,20 @@ public class DefaultTreeSelectionModel
*/
protected void updateLeadIndex()
{
- if (isSelectionEmpty())
+ leadIndex = -1;
+ if (leadPath != null)
{
- leadRow = leadIndex = - 1;
- }
- else
- {
- leadRow = getRow(leadPath);
- for (int i = 0; i < selection.length; i++)
+ leadRow = -1;
+ if (selection == null)
+ leadPath = null;
+ else
{
- if (selection[i].equals(leadPath))
+ for (int i = selection.length - 1; i >= 0 && leadIndex == -1; i--)
{
- leadIndex = i;
- break;
+ if (selection[i] == leadPath)
+ leadIndex = i;
}
}
- leadIndex = leadRow;
}
}
diff --git a/libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java b/libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java
index a699a6c9f21..dff9298e8f5 100644
--- a/libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java
+++ b/libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java
@@ -480,7 +480,7 @@ public class FixedHeightLayoutCache
* @param parentPath the parent path
* @return the enumeration over pathes
*/
- public Enumeration getVisiblePathsFrom(TreePath parentPath)
+ public Enumeration<TreePath> getVisiblePathsFrom(TreePath parentPath)
{
if (dirty)
update();
diff --git a/libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java b/libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java
index 0a787f7ca8c..8c70c13afd2 100644
--- a/libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java
+++ b/libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java
@@ -40,6 +40,7 @@ package javax.swing.tree;
import gnu.javax.swing.tree.GnuPath;
import java.awt.Rectangle;
+import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Hashtable;
@@ -60,8 +61,11 @@ import javax.swing.event.TreeModelEvent;
* @author Audrius Meskauskas
*/
public class VariableHeightLayoutCache
- extends AbstractLayoutCache
+ extends AbstractLayoutCache
{
+
+ private static final Rectangle RECT_CACHE = new Rectangle();
+
/**
* The cached node record.
*/
@@ -73,8 +77,8 @@ public class VariableHeightLayoutCache
depth = aDepth;
parent = aParent;
node = aNode;
-
- isExpanded = expanded.contains(aNode);
+ isExpanded = expanded.contains(aNode);
+ bounds = new Rectangle(0, -1, 0, 0);
}
/**
@@ -102,7 +106,7 @@ public class VariableHeightLayoutCache
* Using this field saves one hashtable access operation.
*/
final boolean isExpanded;
-
+
/**
* The cached bounds of the tree row.
*/
@@ -160,11 +164,6 @@ public class VariableHeightLayoutCache
*/
Rectangle getBounds()
{
- // This method may be called in the context when the tree rectangle is
- // not known. To work around this, it is assumed near infinitely large.
- if (bounds == null)
- bounds = getNodeDimensions(node, row, depth, isExpanded,
- new Rectangle());
return bounds;
}
}
@@ -182,7 +181,7 @@ public class VariableHeightLayoutCache
/**
* Maps row numbers to nodes.
*/
- Hashtable row2node = new Hashtable();
+ ArrayList row2node = new ArrayList();
/**
* If true, the row map must be recomputed before using.
@@ -236,45 +235,54 @@ public class VariableHeightLayoutCache
return;
Object root = treeModel.getRoot();
-
- if (rootVisible)
- {
- countRows(root, null, 0);
- }
- else
- {
- int sc = treeModel.getChildCount(root);
- for (int i = 0; i < sc; i++)
- {
- Object child = treeModel.getChild(root, i);
- countRows(child, root, 0);
- }
- }
+ countRows(root, null, 0, 0);
dirty = false;
}
/**
* Recursively counts all rows in the tree.
*/
- private final void countRows(Object node, Object parent, int depth)
+ private final int countRows(Object node, Object parent, int depth, int y)
{
- Integer n = new Integer(row2node.size());
- row2node.put(n, node);
-
- NodeRecord nr = new NodeRecord(n.intValue(), depth, node, parent);
+ boolean visible = node != treeModel.getRoot() || rootVisible;
+ int row = row2node.size();
+ if (visible)
+ {
+ row2node.add(node);
+ }
+ NodeRecord nr = new NodeRecord(row, depth, node, parent);
+ NodeDimensions d = getNodeDimensions();
+ Rectangle r = RECT_CACHE;
+ if (d != null)
+ r = d.getNodeDimensions(node, row, depth, nr.isExpanded, r);
+ else
+ r.setBounds(0, 0, 0, 0);
+
+ if (! visible)
+ r.y = -1;
+ else
+ r.y = Math.max(0, y);
+
+ if (isFixedRowHeight())
+ r.height = getRowHeight();
+
+ nr.bounds.setBounds(r);
nodes.put(node, nr);
-
- // For expanded nodes
+
+ if (visible)
+ y += r.height;
+
+ int sc = treeModel.getChildCount(node);
+ int deeper = depth + 1;
if (expanded.contains(node))
{
- int sc = treeModel.getChildCount(node);
- int deeper = depth + 1;
for (int i = 0; i < sc; i++)
{
Object child = treeModel.getChild(node, i);
- countRows(child, node, deeper);
+ y = countRows(child, node, deeper, y);
}
}
+ return y;
}
/**
@@ -309,10 +317,14 @@ public class VariableHeightLayoutCache
public void setExpandedState(TreePath path, boolean isExpanded)
{
if (isExpanded)
- expanded.add(path.getLastPathComponent());
+ {
+ int length = path.getPathCount();
+ for (int i = 0; i < length; i++)
+ expanded.add(path.getPathComponent(i));
+ }
else
expanded.remove(path.getLastPathComponent());
-
+
dirty = true;
}
@@ -339,25 +351,21 @@ public class VariableHeightLayoutCache
return null;
if (dirty)
update();
+
Object last = path.getLastPathComponent();
+ Rectangle result = null;
NodeRecord r = (NodeRecord) nodes.get(last);
- if (r == null)
- // This node is not visible.
- {
- rect.x = rect.y = rect.width = rect.height = 0;
- }
- else
+ if (r != null)
{
- if (r.bounds == null)
- {
- Rectangle dim = getNodeDimensions(last, r.row, r.depth,
- r.isExpanded, rect);
- r.bounds = dim;
- }
-
- rect.setRect(r.bounds);
+ // The RI allows null arguments for rect, in which case a new Rectangle
+ // is created.
+ result = rect;
+ if (result == null)
+ result = new Rectangle(r.bounds);
+ else
+ result.setBounds(r.bounds);
}
- return rect;
+ return result;
}
/**
@@ -370,14 +378,17 @@ public class VariableHeightLayoutCache
{
if (dirty)
update();
- Object last = row2node.get(new Integer(row));
- if (last == null)
- return null;
- else
+
+ TreePath path = null;
+ // Search row in the nodes map. TODO: This is inefficient, optimize this.
+ Enumeration nodesEnum = nodes.elements();
+ while (nodesEnum.hasMoreElements() && path == null)
{
- NodeRecord r = (NodeRecord) nodes.get(last);
- return r.getPath();
+ NodeRecord record = (NodeRecord) nodesEnum.nextElement();
+ if (record.row == row)
+ path = record.getPath();
}
+ return path;
}
/**
@@ -390,7 +401,9 @@ public class VariableHeightLayoutCache
{
if (path == null)
return -1;
- if (dirty) update();
+
+ if (dirty)
+ update();
NodeRecord r = (NodeRecord) nodes.get(path.getLastPathComponent());
if (r == null)
@@ -451,8 +464,8 @@ public class VariableHeightLayoutCache
{
if (y < r.y)
return r.y - y;
- else if (y > r.y + r.height)
- return y - (r.y + r.height);
+ else if (y > r.y + r.height - 1)
+ return y - (r.y + r.height - 1);
else
return 0;
}
@@ -468,7 +481,7 @@ public class VariableHeightLayoutCache
*/
public int getVisibleChildCount(TreePath path)
{
- if (isExpanded(path))
+ if (! isExpanded(path) || treeModel == null)
return 0;
else
return treeModel.getChildCount(path.getLastPathComponent());
@@ -481,7 +494,7 @@ public class VariableHeightLayoutCache
* @param parentPath the parent path
* @return the enumeration over pathes
*/
- public Enumeration getVisiblePathsFrom(TreePath parentPath)
+ public Enumeration<TreePath> getVisiblePathsFrom(TreePath parentPath)
{
if (dirty)
update();
@@ -493,7 +506,7 @@ public class VariableHeightLayoutCache
{
node = parentPath.getPathComponent(i);
nr = (NodeRecord) nodes.get(node);
- if (nr.row >= 0)
+ if (nr != null && nr.row >= 0)
p.add(node);
}
return p.elements();
@@ -558,15 +571,11 @@ public class VariableHeightLayoutCache
public void setModel(TreeModel newModel)
{
treeModel = newModel;
- // We need to clear the table and update the layout,
- // so that we don't end up with wrong data in the tables.
- expanded.clear();
- update();
+ dirty = true;
if (treeModel != null)
{
// The root node is expanded by default.
expanded.add(treeModel.getRoot());
- dirty = true;
}
}
@@ -590,15 +599,14 @@ public class VariableHeightLayoutCache
{
if (dirty)
update();
- totalHeight = 0;
- Enumeration en = nodes.elements();
- while (en.hasMoreElements())
+ int height = 0;
+ int rowCount = getRowCount();
+ if (rowCount > 0)
{
- NodeRecord nr = (NodeRecord) en.nextElement();
- Rectangle r = nr.getBounds();
- totalHeight += r.height;
+ NodeRecord last = (NodeRecord) nodes.get(row2node.get(rowCount - 1));
+ height = last.bounds.y + last.bounds.height;
}
- return totalHeight;
+ return height;
}
/**
@@ -614,10 +622,36 @@ public class VariableHeightLayoutCache
while (en.hasMoreElements())
{
NodeRecord nr = (NodeRecord) en.nextElement();
- Rectangle r = nr.getBounds();
- if (r.x + r.width > maximalWidth)
- maximalWidth = r.x + r.width;
+ if (nr != null)
+ {
+ Rectangle r = nr.getBounds();
+ int width = r.x + r.width;
+ if (width > maximalWidth)
+ maximalWidth = width;
+ }
}
return maximalWidth;
}
+
+ /**
+ * Sets the node dimensions and invalidates the cached layout.
+ *
+ * @param dim the dimensions to set
+ */
+ public void setNodeDimensions(NodeDimensions dim)
+ {
+ super.setNodeDimensions(dim);
+ dirty = true;
+ }
+
+ /**
+ * Sets the row height and marks the layout as invalid.
+ *
+ * @param height the row height to set
+ */
+ public void setRowHeight(int height)
+ {
+ super.setRowHeight(height);
+ dirty = true;
+ }
}
diff --git a/libjava/classpath/javax/swing/undo/CompoundEdit.java b/libjava/classpath/javax/swing/undo/CompoundEdit.java
index e1cfbb619b3..fbff2a26418 100644
--- a/libjava/classpath/javax/swing/undo/CompoundEdit.java
+++ b/libjava/classpath/javax/swing/undo/CompoundEdit.java
@@ -1,5 +1,5 @@
/* CompoundEdit.java -- Combines multiple UndoableEdits.
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -75,7 +75,7 @@ public class CompoundEdit
* The <code>UndoableEdit</code>s being combined into a compound
* editing action.
*/
- protected Vector edits;
+ protected Vector<UndoableEdit> edits;
/**
@@ -92,7 +92,7 @@ public class CompoundEdit
*/
public CompoundEdit()
{
- edits = new Vector();
+ edits = new Vector<UndoableEdit>();
inProgress = true;
}
@@ -118,7 +118,7 @@ public class CompoundEdit
super.undo();
for (int i = edits.size() - 1; i >= 0; i--)
- ((UndoableEdit) edits.elementAt(i)).undo();
+ edits.elementAt(i).undo();
}
@@ -143,7 +143,7 @@ public class CompoundEdit
super.redo();
for (int i = 0; i < edits.size(); i++)
- ((UndoableEdit) edits.elementAt(i)).redo();
+ edits.elementAt(i).redo();
}
@@ -156,7 +156,7 @@ public class CompoundEdit
if (edits.size() == 0)
return null;
else
- return (UndoableEdit) edits.elementAt(edits.size() - 1);
+ return edits.elementAt(edits.size() - 1);
}
@@ -172,7 +172,7 @@ public class CompoundEdit
public void die()
{
for (int i = edits.size() - 1; i >= 0; i--)
- ((UndoableEdit) edits.elementAt(i)).die();
+ edits.elementAt(i).die();
super.die();
}
@@ -316,7 +316,7 @@ public class CompoundEdit
public boolean isSignificant()
{
for (int i = edits.size() - 1; i >= 0; i--)
- if (((UndoableEdit) edits.elementAt(i)).isSignificant())
+ if (edits.elementAt(i).isSignificant())
return true;
return false;
diff --git a/libjava/classpath/javax/swing/undo/StateEdit.java b/libjava/classpath/javax/swing/undo/StateEdit.java
index 326abea1f4e..91fc88faa60 100644
--- a/libjava/classpath/javax/swing/undo/StateEdit.java
+++ b/libjava/classpath/javax/swing/undo/StateEdit.java
@@ -121,14 +121,14 @@ public class StateEdit
* The state of <code>object</code> at the time of constructing
* this <code>StateEdit</code>.
*/
- protected Hashtable preState;
+ protected Hashtable<Object, Object> preState;
/**
* The state of <code>object</code> at the time when {@link #end()}
* was called.
*/
- protected Hashtable postState;
+ protected Hashtable<Object, Object> postState;
/**
diff --git a/libjava/classpath/javax/swing/undo/StateEditable.java b/libjava/classpath/javax/swing/undo/StateEditable.java
index 459025be7da..7e6cc97856f 100644
--- a/libjava/classpath/javax/swing/undo/StateEditable.java
+++ b/libjava/classpath/javax/swing/undo/StateEditable.java
@@ -100,7 +100,7 @@ public interface StateEditable
* @param state a hash table containing the relevant state
* information.
*/
- void restoreState(Hashtable state);
+ void restoreState(Hashtable<?, ?> state);
/**
@@ -110,5 +110,5 @@ public interface StateEditable
* @param state a hash table for storing relevant state
* information.
*/
- void storeState(Hashtable state);
+ void storeState(Hashtable<Object, Object> state);
}
diff --git a/libjava/classpath/javax/swing/undo/UndoableEditSupport.java b/libjava/classpath/javax/swing/undo/UndoableEditSupport.java
index 6d7bbea0728..b5a93341954 100644
--- a/libjava/classpath/javax/swing/undo/UndoableEditSupport.java
+++ b/libjava/classpath/javax/swing/undo/UndoableEditSupport.java
@@ -69,7 +69,8 @@ public class UndoableEditSupport
/**
* The currently registered listeners.
*/
- protected Vector listeners = new Vector();
+ protected Vector<UndoableEditListener> listeners =
+ new Vector<UndoableEditListener>();
/**
@@ -148,7 +149,7 @@ public class UndoableEditSupport
public synchronized UndoableEditListener[] getUndoableEditListeners()
{
UndoableEditListener[] result = new UndoableEditListener[listeners.size()];
- return (UndoableEditListener[]) listeners.toArray(result);
+ return listeners.toArray(result);
}
diff --git a/libjava/classpath/javax/xml/parsers/DocumentBuilderFactory.java b/libjava/classpath/javax/xml/parsers/DocumentBuilderFactory.java
index 0dc574e656b..9312e65e06d 100644
--- a/libjava/classpath/javax/xml/parsers/DocumentBuilderFactory.java
+++ b/libjava/classpath/javax/xml/parsers/DocumentBuilderFactory.java
@@ -50,7 +50,7 @@ import javax.xml.validation.Schema;
* Factory for obtaining document builders.
* Instances of this class are <em>not</em> guaranteed to be thread safe.
*
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
+ * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
*/
public abstract class DocumentBuilderFactory
{
diff --git a/libjava/classpath/javax/xml/validation/SchemaFactory.java b/libjava/classpath/javax/xml/validation/SchemaFactory.java
index 0042ea32348..0c24104445b 100644
--- a/libjava/classpath/javax/xml/validation/SchemaFactory.java
+++ b/libjava/classpath/javax/xml/validation/SchemaFactory.java
@@ -37,8 +37,14 @@ exception statement from your version. */
package javax.xml.validation;
+import java.io.BufferedReader;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.IOException;
import java.net.URL;
+import java.util.Properties;
import javax.xml.XMLConstants;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
@@ -68,6 +74,71 @@ public abstract class SchemaFactory
*/
public static final SchemaFactory newInstance(String schemaLanguage)
{
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ if (loader == null)
+ {
+ loader = SchemaFactory.class.getClassLoader();
+ }
+ final String factoryClassName = "javax.xml.validation.SchemaFactory";
+ String className = null;
+ int count = 0;
+ do
+ {
+ className = getFactoryClassName(loader, schemaLanguage, count++);
+ if (className != null)
+ {
+ try
+ {
+ Class t = (loader != null) ? loader.loadClass(className) :
+ Class.forName(className);
+ return (SchemaFactory) t.newInstance();
+ }
+ catch (Exception e)
+ {
+ // Ignore any errors and continue algorithm.
+ // This method doesn't have a means of propagating
+ // class instantiation errors.
+ className = null;
+ }
+ }
+ }
+ while (className == null && count < 2);
+ try
+ {
+ String serviceKey = "/META-INF/services/" + factoryClassName;
+ InputStream in = (loader != null) ?
+ loader.getResourceAsStream(serviceKey) :
+ SchemaFactory.class.getResourceAsStream(serviceKey);
+ if (in != null)
+ {
+ BufferedReader r =
+ new BufferedReader(new InputStreamReader(in));
+ try
+ {
+ for (String line = r.readLine(); line != null;
+ line = r.readLine())
+ {
+ Class t = (loader != null) ? loader.loadClass(className) :
+ Class.forName(className);
+ SchemaFactory ret = (SchemaFactory) t.newInstance();
+ if (ret.isSchemaLanguageSupported(schemaLanguage))
+ return ret;
+ }
+ }
+ catch (Exception e)
+ {
+ // Fall through. See above.
+ }
+ finally
+ {
+ r.close();
+ }
+ }
+ }
+ catch (IOException e)
+ {
+ }
+ // Default schema factories for Classpath
if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(schemaLanguage))
return new gnu.xml.validation.xmlschema.XMLSchemaSchemaFactory();
if (XMLConstants.RELAXNG_NS_URI.equals(schemaLanguage))
@@ -75,6 +146,36 @@ public abstract class SchemaFactory
throw new IllegalArgumentException(schemaLanguage);
}
+ private static String getFactoryClassName(ClassLoader loader,
+ String schemaLanguage, int attempt)
+ {
+ final String factoryClassName = "javax.xml.validation.SchemaFactory";
+ final String propertyName = factoryClassName + ":" + schemaLanguage;
+ switch (attempt)
+ {
+ case 0:
+ return System.getProperty(propertyName);
+ case 1:
+ try
+ {
+ File file = new File(System.getProperty("java.home"));
+ file = new File(file, "lib");
+ file = new File(file, "jaxp.properties");
+ InputStream in = new FileInputStream(file);
+ Properties props = new Properties();
+ props.load(in);
+ in.close();
+ return props.getProperty(propertyName);
+ }
+ catch (IOException e)
+ {
+ return null;
+ }
+ default:
+ return null;
+ }
+ }
+
/**
* Indicates whether the specified schema language is supported.
* @param schemaLanguage the URI of a schema language (see
diff --git a/libjava/classpath/jvmti.h b/libjava/classpath/jvmti.h
new file mode 100644
index 00000000000..b26f7932e54
--- /dev/null
+++ b/libjava/classpath/jvmti.h
@@ -0,0 +1,1819 @@
+/* jvmti.h - Java Virtual Machine Tool Interface
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+/* Note: this file must be compilable by the C compiler (for now,
+ assuming GNU C is ok). This means you must never use `//'
+ comments, and all C++-specific code must be conditional on
+ __cplusplus. */
+
+#ifndef _CLASSPATH_JVMTI_H
+#define _CLASSPATH_JVMTI_H
+#include <jni.h>
+
+#include "jvmti_md.h"
+
+/* The VM might define JVMTI base types */
+#ifndef _CLASSPATH_VM_JVMTI_TYPES_DEFINED
+
+typedef jobject jthread;
+typedef jobject jthreadGroup;
+typedef jlong jlocation;
+typedef struct _Jv_rawMonitorID *jrawMonitorID;
+
+#endif /* !_CLASSPATH_VM_JVMTI_TYPES_DEFINED */
+
+/* JVMTI Version */
+#define JVMTI_VERSION_1_0 0x30010000
+#define JVMTI_VERSION (JVMTI_VERSION_1_0 + 38) /* Spec version is 1.0.38 */
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/* These functions might be defined in libraries which we load; the
+ JVMTI implementation calls them at the appropriate times. */
+extern JNIEXPORT jint JNICALL Agent_OnLoad (JavaVM *vm, char *options,
+ void *reserved);
+extern JNIEXPORT void JNICALL Agent_OnUnload (JavaVM *vm);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Forward declarations */
+typedef struct _jvmtiAddrLocationMap jvmtiAddrLocationMap;
+#ifdef __cplusplus
+typedef struct _Jv_JVMTIEnv jvmtiEnv;
+#else
+typedef const struct _Jv_jvmtiEnv *jvmtiEnv;
+#endif
+
+/*
+ * Error constants
+ */
+
+typedef enum
+{
+ /* Universal Errors */
+ JVMTI_ERROR_NONE = 0,
+ JVMTI_ERROR_NULL_POINTER = 100,
+ JVMTI_ERROR_OUT_OF_MEMORY = 110,
+ JVMTI_ERROR_ACCESS_DENIED = 111,
+ JVMTI_ERROR_WRONG_PHASE = 112,
+ JVMTI_ERROR_INTERNAL = 113,
+ JVMTI_ERROR_UNATTACHED_THREAD = 115,
+ JVMTI_ERROR_INVALID_ENVIRONMENT = 116,
+
+ /* Function-specific Required Errors */
+ JVMTI_ERROR_INVALID_PRIORITY = 12,
+ JVMTI_ERROR_THREAD_NOT_SUSPENDED = 13,
+ JVMTI_ERROR_THREAD_SUSPENDED = 14,
+ JVMTI_ERROR_THREAD_NOT_ALIVE = 15,
+ JVMTI_ERROR_CLASS_NOT_PREPARED = 22,
+ JVMTI_ERROR_NO_MORE_FRAMES = 31,
+ JVMTI_ERROR_OPAQUE_FRAME = 32,
+ JVMTI_ERROR_DUPLICATE = 40,
+ JVMTI_ERROR_NOT_FOUND = 41,
+ JVMTI_ERROR_NOT_MONITOR_OWNER = 51,
+ JVMTI_ERROR_INTERRUPT = 52,
+ JVMTI_ERROR_UNMODIFIABLE_CLASS = 79,
+ JVMTI_ERROR_NOT_AVAILABLE = 98,
+ JVMTI_ERROR_ABSENT_INFORMATION = 101,
+ JVMTI_ERROR_INVALID_EVENT_TYPE = 102,
+ JVMTI_ERROR_NATIVE_METHOD = 104,
+
+ /* Function-specific Agent Errors */
+ JVMTI_ERROR_INVALID_THREAD = 10,
+ JVMTI_ERROR_INVALID_THREAD_GROUP = 11,
+ JVMTI_ERROR_INVALID_OBJECT = 20,
+ JVMTI_ERROR_INVALID_CLASS = 21,
+ JVMTI_ERROR_INVALID_METHODID = 23,
+ JVMTI_ERROR_INVALID_LOCATION = 24,
+ JVMTI_ERROR_INVALID_FIELDID = 25,
+ JVMTI_ERROR_TYPE_MISMATCH = 34,
+ JVMTI_ERROR_INVALID_SLOT = 35,
+ JVMTI_ERROR_INVALID_MONITOR = 50,
+ JVMTI_ERROR_INVALID_CLASS_FORMAT = 60,
+ JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION = 61,
+ JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED = 63,
+ JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED = 64,
+ JVMTI_ERROR_INVALID_TYPESTATE = 65,
+ JVMTI_ERROR_FAILS_VERIFICATION = 62,
+ JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED = 66,
+ JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED = 67,
+ JVMTI_ERROR_UNSUPPORTED_VERSION = 68,
+ JVMTI_ERROR_NAMES_DONT_MATCH = 69,
+ JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED = 70,
+ JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED = 71,
+ JVMTI_ERROR_MUST_POSSESS_CAPABILITY = 99,
+ JVMTI_ERROR_ILLEGAL_ARGUMENT = 103
+} jvmtiError;
+
+/*
+ * Enumeration Definitions
+ */
+
+typedef enum
+{
+ JVMTI_DISABLE = 0,
+ JVMTI_ENABLE = 1
+} jvmtiEventMode;
+
+typedef enum
+{
+ JVMTI_HEAP_OBJECT_TAGGED = 1,
+ JVMTI_HEAP_OBJECT_UNTAGGED = 2,
+ JVMTI_HEAP_OBJECT_EITHER = 3
+} jvmtiHeapObjectFilter;
+
+typedef enum
+{
+ JVMTI_HEAP_ROOT_JNI_GLOBAL = 1,
+ JVMTI_HEAP_ROOT_SYSTEM_CLASS = 2,
+ JVMTI_HEAP_ROOT_MONITOR = 3,
+ JVMTI_HEAP_ROOT_STACK_LOCAL = 4,
+ JVMTI_HEAP_ROOT_JNI_LOCAL = 5,
+ JVMTI_HEAP_ROOT_THREAD = 6,
+ JVMTI_HEAP_ROOT_OTHER = 7
+} jvmtiHeapRootKind;
+
+typedef enum
+{
+ JVMTI_ITERATION_ABORT = 0,
+ JVMTI_ITERATION_CONTINUE = 1,
+ JVMTI_ITERATION_IGNORE = 2
+} jvmtiIterationControl;
+
+typedef enum
+{
+ JVMTI_JLOCATION_OTHER = 0,
+ JVMTI_JLOCATION_JVMBCI = 1,
+ JVMTI_JLOCATION_MACHINEPC = 2
+} jvmtiJlocationFormat;
+
+typedef enum
+{
+ JVMTI_REFERENCE_CLASS = 1,
+ JVMTI_REFERENCE_FIELD = 2,
+ JVMTI_REFERENCE_ARRAY_ELEMENT = 3,
+ JVMTI_REFERENCE_CLASS_LOADER = 4,
+ JVMTI_REFERENCE_SIGNERS = 5,
+ JVMTI_REFERENCE_PROTECTION_DOMAIN = 6,
+ JVMTI_REFERENCE_INTERFACE = 7,
+ JVMTI_REFERENCE_STATIC_FIELD = 8,
+ JVMTI_REFERENCE_CONSTANT_POOL = 9
+} jvmtiObjectReferenceKind;
+
+typedef enum
+{
+ JVMTI_KIND_IN = 91,
+ JVMTI_KIND_IN_PTR = 92,
+ JVMTI_KIND_IN_BUF = 93,
+ JVMTI_KIND_ALLOC_BUF = 94,
+ JVMTI_KIND_ALLOC_ALLOC_BUF = 95,
+ JVMTI_KIND_OUT = 96,
+ JVMTI_KIND_OUT_BUF = 97
+} jvmtiParamKind;
+
+typedef enum
+{
+ JVMTI_TYPE_JBYTE = 101,
+ JVMTI_TYPE_JCHAR = 102,
+ JVMTI_TYPE_JSHORT = 103,
+ JVMTI_TYPE_JINT = 104,
+ JVMTI_TYPE_JLONG = 105,
+ JVMTI_TYPE_JFLOAT = 106,
+ JVMTI_TYPE_JDOUBLE = 107,
+ JVMTI_TYPE_JBOOLEAN = 108,
+ JVMTI_TYPE_JOBJECT = 109,
+ JVMTI_TYPE_JTHREAD = 110,
+ JVMTI_TYPE_JCLASS = 111,
+ JVMTI_TYPE_JVALUE = 112,
+ JVMTI_TYPE_JFIELDID = 113,
+ JVMTI_TYPE_JMETHODID = 114,
+ JVMTI_TYPE_CCHAR = 115,
+ JVMTI_TYPE_CVOID = 116,
+ JVMTI_TYPE_JNIENV = 117
+} jvmtiParamTypes;
+
+typedef enum
+{
+ JVMTI_PHASE_ONLOAD = 1,
+ JVMTI_PHASE_PRIMORDIAL = 2,
+ JVMTI_PHASE_LIVE = 4,
+ JVMTI_PHASE_START = 6,
+ JVMTI_PHASE_DEAD = 8
+} jvmtiPhase;
+
+typedef enum
+{
+ JVMTI_TIMER_USER_CPU = 30,
+ JVMTI_TIMER_TOTAL_CPU = 31,
+ JVMTI_TIMER_ELAPSED = 32
+} jvmtiTimerKind;
+
+typedef enum
+{
+ JVMTI_VERBOSE_OTHER = 0,
+ JVMTI_VERBOSE_GC = 1,
+ JVMTI_VERBOSE_CLASS = 2,
+ JVMTI_VERBOSE_JNI = 4
+} jvmtiVerboseFlag;
+
+/* Version information */
+#define JVMTI_VERSION_INTERFACE_JNI 0x00000000
+#define JVMTI_VERSION_INTERFACE_JVMTI 0x30000000
+#define JVMTI_VERSION_MASK_INTERFACE_TYPE 0x70000000
+#define JVMTI_VERSION_MASK_MAJOR 0x0FFF0000
+#define JVMTI_VERSION_MASK_MINOR 0x0000FF00
+#define JVMTI_VERSION_MASK_MICRO 0x000000FF
+#define JVMTI_VERSION_SHIFT_MAJOR 16
+#define JVMTI_VERSION_SHIFT_MINOR 8
+#define JVMTI_VERSION_SHIFT_MICRO 0
+
+/*
+ * Events and event callbacks
+ */
+
+typedef enum
+{
+ JVMTI_EVENT_VM_INIT = 50,
+ JVMTI_EVENT_VM_DEATH = 51,
+ JVMTI_EVENT_THREAD_START = 52,
+ JVMTI_EVENT_THREAD_END = 53,
+ JVMTI_EVENT_CLASS_FILE_LOAD_HOOK = 54,
+ JVMTI_EVENT_CLASS_LOAD = 55,
+ JVMTI_EVENT_CLASS_PREPARE = 56,
+ JVMTI_EVENT_VM_START = 57,
+ JVMTI_EVENT_EXCEPTION = 58,
+ JVMTI_EVENT_EXCEPTION_CATCH = 59,
+ JVMTI_EVENT_SINGLE_STEP = 60,
+ JVMTI_EVENT_FRAME_POP = 61,
+ JVMTI_EVENT_BREAKPOINT = 62,
+ JVMTI_EVENT_FIELD_ACCESS = 63,
+ JVMTI_EVENT_FIELD_MODIFICATION = 64,
+ JVMTI_EVENT_METHOD_ENTRY = 65,
+ JVMTI_EVENT_METHOD_EXIT = 66,
+ JVMTI_EVENT_NATIVE_METHOD_BIND = 67,
+ JVMTI_EVENT_COMPILED_METHOD_LOAD = 68,
+ JVMTI_EVENT_COMPILED_METHOD_UNLOAD = 69,
+ JVMTI_EVENT_DYNAMIC_CODE_GENERATED = 70,
+ JVMTI_EVENT_DATA_DUMP_REQUEST = 71,
+ JVMTI_EVENT_MONITOR_WAIT = 73,
+ JVMTI_EVENT_MONITOR_WAITED = 74,
+ JVMTI_EVENT_MONITOR_CONTENDED_ENTER = 75,
+ JVMTI_EVENT_MONITOR_CONTENDED_ENTERED = 76,
+ JVMTI_EVENT_GARBAGE_COLLECTION_START = 81,
+ JVMTI_EVENT_GARBAGE_COLLECTION_FINISH = 82,
+ JVMTI_EVENT_OBJECT_FREE = 83,
+ JVMTI_EVENT_VM_OBJECT_ALLOC = 84
+} jvmtiEvent;
+
+typedef void *jvmtiEventReserved;
+
+typedef void (JNICALL *jvmtiEventSingleStep)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
+ jlocation location);
+
+typedef void (JNICALL *jvmtiEventBreakpoint)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
+ jlocation location);
+
+typedef void (JNICALL *jvmtiEventFieldAccess)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
+ jlocation location, jclass field_klass, jobject object, jfieldID field);
+
+typedef void (JNICALL *jvmtiEventFieldModification)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
+ jlocation location, jclass field_klass, jobject object, jfieldID field,
+ char signature_type, jvalue new_value);
+
+typedef void (JNICALL *jvmtiEventFramePop)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
+ jboolean was_popped_by_exception);
+
+typedef void (JNICALL *jvmtiEventMethodEntry)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method);
+
+typedef void (JNICALL *jvmtiEventMethodExit)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
+ jboolean was_popped_by_exception, jvalue return_value);
+
+typedef void (JNICALL *jvmtiEventNativeMethodBind)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
+ void *address, void **new_address_ptr);
+
+typedef void (JNICALL *jvmtiEventException)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
+ jlocation location, jobject exception, jmethodID catch_method,
+ jlocation catch_location);
+
+typedef void (JNICALL *jvmtiEventExceptionCatch)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
+ jlocation location, jobject exception);
+
+typedef void (JNICALL *jvmtiEventThreadStart)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread);
+
+typedef void (JNICALL *jvmtiEventThreadEnd)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread);
+
+typedef void (JNICALL *jvmtiEventClassLoad)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jclass klass);
+
+typedef void (JNICALL *jvmtiEventClassPrepare)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thraed, jclass klass);
+
+typedef void (JNICALL *jvmtiEventClassFileLoadHook)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jclass class_being_redefined,
+ jobject loader, const char *name, jobject protection_domain,
+ jint class_data_len, const unsigned char *class_data,
+ jint *new_class_data_len, unsigned char **new_class_data);
+
+typedef void (JNICALL *jvmtiEventVMStart)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env);
+
+typedef void (JNICALL *jvmtiEventVMInit)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread);
+
+typedef void (JNICALL *jvmtiEventVMDeath)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env);
+
+typedef void (JNICALL *jvmtiEventCompiledMethodLoad)
+ (jvmtiEnv *jvmti_env, jmethodID method, jint code_size,
+ const void *code_addr, jint map_length, const jvmtiAddrLocationMap *map,
+ const void *compile_info);
+
+typedef void (JNICALL *jvmtiEventCompiledMethodUnload)
+ (jvmtiEnv *jvmti_env, jmethodID method, const void *code_addr);
+
+typedef void (JNICALL *jvmtiEventDynamicCodeGenerated)
+ (jvmtiEnv *jvmti_env, const char *name, const void *address, jint length);
+
+typedef void (JNICALL *jvmtiEventDataDumpRequest)
+ (jvmtiEnv *jvmti_env);
+
+typedef void (JNICALL *jvmtiEventMonitorContendedEnter)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jobject object);
+
+typedef void (JNICALL *jvmtiEventMonitorContendedEntered)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jobject object);
+
+typedef void (JNICALL *jvmtiEventMonitorWait)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jobject object,
+ jlong timeout);
+
+typedef void (JNICALL *jvmtiEventMonitorWaited)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jobject object,
+ jboolean timed_out);
+
+typedef void (JNICALL *jvmtiEventVMObjectAlloc)
+ (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jobject object,
+ jclass object_klass, jlong size);
+
+typedef void (JNICALL *jvmtiEventObjectFree)
+ (jvmtiEnv *jvmti_env, jlong tag);
+
+typedef void (JNICALL *jvmtiEventGarbageCollectionStart)
+ (jvmtiEnv *jvmti_env);
+
+typedef void (JNICALL *jvmtiEventGarbageCollectionFinish)
+ (jvmtiEnv *jvmti_env);
+
+typedef struct
+{
+ jvmtiEventVMInit VMInit;
+ jvmtiEventVMDeath VMDeath;
+ jvmtiEventThreadStart ThreadStart;
+ jvmtiEventThreadEnd ThreadEnd;
+ jvmtiEventClassFileLoadHook ClassFileLoadHook;
+ jvmtiEventClassLoad ClassLoad;
+ jvmtiEventClassPrepare ClassPrepare;
+ jvmtiEventVMStart VMStart;
+ jvmtiEventException Exception;
+ jvmtiEventExceptionCatch ExceptionCatch;
+ jvmtiEventSingleStep SingleStep;
+ jvmtiEventFramePop FramePop;
+ jvmtiEventBreakpoint Breakpoint;
+ jvmtiEventFieldAccess FieldAccess;
+ jvmtiEventFieldModification FieldModification;
+ jvmtiEventMethodEntry MethodEntry;
+ jvmtiEventMethodExit MethodExit;
+ jvmtiEventNativeMethodBind NativeMethodBind;
+ jvmtiEventCompiledMethodLoad CompiledMethodLoad;
+ jvmtiEventCompiledMethodUnload CompiledMethodUnload;
+ jvmtiEventDynamicCodeGenerated DynamicCodeGenerated;
+ jvmtiEventDataDumpRequest DataDumpRequest;
+ jvmtiEventReserved reserved72;
+ jvmtiEventMonitorWait MonitorWait;
+ jvmtiEventMonitorWaited MonitorWaited;
+ jvmtiEventMonitorContendedEnter MonitorContendedEnter;
+ jvmtiEventMonitorContendedEntered MonitorContendedEntered;
+ jvmtiEventReserved reserved77;
+ jvmtiEventReserved reserved78;
+ jvmtiEventReserved reserved79;
+ jvmtiEventReserved reserved80;
+ jvmtiEventGarbageCollectionStart GarbageCollectionStart;
+ jvmtiEventGarbageCollectionFinish GarbageCollectionFinish;
+ jvmtiEventObjectFree ObjectFree;
+ jvmtiEventVMObjectAlloc VMObjectAlloc;
+} jvmtiEventCallbacks;
+
+/*
+ * Function and Structure Type Definitions
+ */
+
+struct _jvmtiAddrLocationMap
+{
+ const void *start_address;
+ jlocation location;
+};
+
+typedef struct
+{
+ unsigned int can_tag_objects : 1;
+ unsigned int can_generate_field_modification_events : 1;
+ unsigned int can_generate_field_access_events : 1;
+ unsigned int can_get_bytecodes : 1;
+ unsigned int can_get_synthetic_attribute : 1;
+ unsigned int can_get_owned_monitor_info : 1;
+ unsigned int can_get_current_contended_monitor : 1;
+ unsigned int can_get_monitor_info : 1;
+ unsigned int can_pop_frame : 1;
+ unsigned int can_redefine_classes : 1;
+ unsigned int can_signal_thread : 1;
+ unsigned int can_get_source_file_name : 1;
+ unsigned int can_get_line_numbers : 1;
+ unsigned int can_get_source_debug_extension : 1;
+ unsigned int can_access_local_variables : 1;
+ unsigned int can_maintain_original_method_order : 1;
+ unsigned int can_generate_single_step_events : 1;
+ unsigned int can_generate_exception_events : 1;
+ unsigned int can_generate_frame_pop_events : 1;
+ unsigned int can_generate_breakpoint_events : 1;
+ unsigned int can_suspend : 1;
+ unsigned int can_redefine_any_class : 1;
+ unsigned int can_get_current_thread_cpu_time : 1;
+ unsigned int can_get_thread_cpu_time : 1;
+ unsigned int can_generate_method_entry_events : 1;
+ unsigned int can_generate_method_exit_events : 1;
+ unsigned int can_generate_all_class_hook_events : 1;
+ unsigned int can_generate_compiled_method_load_events : 1;
+ unsigned int can_generate_monitor_events : 1;
+ unsigned int can_generate_vm_object_alloc_events : 1;
+ unsigned int can_generate_native_method_bind_events : 1;
+ unsigned int can_generate_garbage_collection_events : 1;
+ unsigned int can_generate_object_free_events : 1;
+ unsigned int : 15;
+ unsigned int : 16;
+ unsigned int : 16;
+ unsigned int : 16;
+ unsigned int : 16;
+ unsigned int : 16;
+} jvmtiCapabilities;
+
+typedef struct
+{
+ jclass klass;
+ jint class_byte_count;
+ const unsigned char *class_bytes;
+} jvmtiClassDefinition;
+
+typedef struct
+{
+ char *name;
+ jvmtiParamKind kind;
+ jvmtiParamTypes base_type;
+ jboolean null_ok;
+} jvmtiParamInfo;
+
+typedef struct
+{
+ jint extension_event_index;
+ char *id;
+ char *short_description;
+ jint param_count;
+ jvmtiParamInfo* params;
+} jvmtiExtensionEventInfo;
+
+typedef jvmtiError (JNICALL *jvmtiExtensionFunction)
+ (jvmtiEnv *jvmti_enf, ...);
+
+typedef struct
+{
+ jvmtiExtensionFunction func;
+ char *id;
+ char *short_description;
+ jint param_count;
+ jvmtiParamInfo *params;
+ jint error_count;
+ jvmtiError *errors;
+} jvmtiExtensionFunctionInfo;
+
+typedef struct
+{
+ jmethodID method;
+ jlocation location;
+} jvmtiFrameInfo;
+
+typedef struct
+{
+ jlocation start_location;
+ jint line_number;
+} jvmtiLineNumberEntry;
+
+typedef struct
+{
+ jlocation start_location;
+ jint length;
+ char *name;
+ char *signature;
+ char *generic_signature;
+ jint slot;
+} jvmtiLocalVariableEntry;
+
+typedef struct
+{
+ jthread owner;
+ jint entry_count;
+ jint waiter_count;
+ jthread *waiters;
+ jint notify_waiter_count;
+ jthread *notify_waiters;
+} jvmtiMonitorUsage;
+
+typedef struct
+{
+ jthread thread;
+ jint state;
+ jvmtiFrameInfo *frame_buffer;
+ jint frame_count;
+} jvmtiStackInfo;
+
+typedef struct
+{
+ jthreadGroup parent;
+ char *name;
+ jint max_priority;
+ jboolean is_daemon;
+} jvmtiThreadGroupInfo;
+
+typedef struct
+{
+ char *name;
+ jint priority;
+ jboolean is_daemon;
+ jthreadGroup thread_group;
+ jobject context_class_loader;
+} jvmtiThreadInfo;
+
+typedef struct
+{
+ jlong max_value;
+ jboolean may_skip_forward;
+ jboolean may_skip_backward;
+ jvmtiTimerKind kind;
+ jlong reserved1;
+ jlong reserved2;
+} jvmtiTimerInfo;
+
+typedef void (JNICALL *jvmtiExtensionEvent)
+ (jvmtiEnv *jvmti_env, ...);
+
+typedef jvmtiIterationControl (JNICALL *jvmtiHeapObjectCallback)
+ (jlong class_tag, jlong size, jlong *tag_ptr, void *user_data);
+
+typedef jvmtiIterationControl (JNICALL *jvmtiHeapRootCallback)
+ (jvmtiHeapRootKind root_kind, jlong class_tag, jlong size, jlong *tag_ptr,
+ void *user_data);
+
+typedef jvmtiIterationControl (JNICALL *jvmtiObjectReferenceCallback)
+ (jvmtiObjectReferenceKind reference_kind, jlong class_tag, jlong size,
+ jlong *tag_ptr, jlong referrer_tag, jint referrer_index, void *user_data);
+
+typedef jvmtiIterationControl (JNICALL *jvmtiStackReferenceCallback)
+ (jvmtiHeapRootKind root_kind, jlong class_tag, jlong size, jlong *tag_ptr,
+ jlong thread_tag, jint depth, jmethodID method, jint slot, void *user_data);
+
+typedef void (JNICALL *jvmtiStartFunction)
+ (jvmtiEnv *env, JNIEnv *jni_env, void *arg);
+
+/*
+ * JVM Tool Interface Base Types
+ */
+typedef struct JNINativeInterface jniNativeInterface;
+
+struct _Jv_jvmtiEnv
+{
+ void *reserved1;
+
+ jvmtiError (JNICALL *SetEventNotificationMode) (jvmtiEnv *env,
+ jvmtiEventMode mode,
+ jvmtiEvent event_type,
+ jthread event_thread, ...);
+ void *reserved3;
+
+ jvmtiError (JNICALL *GetAllThreads) (jvmtiEnv *env,
+ jint *threads_count_ptr,
+ jthread **threads_ptr);
+
+ jvmtiError (JNICALL *SuspendThread) (jvmtiEnv *env,
+ jthread thread);
+
+ jvmtiError (JNICALL *ResumeThread) (jvmtiEnv *env,
+ jthread thread);
+
+ jvmtiError (JNICALL *StopThread) (jvmtiEnv *env,
+ jthread thread,
+ jobject exception);
+
+ jvmtiError (JNICALL *InterruptThread) (jvmtiEnv *env,
+ jthread thread);
+
+ jvmtiError (JNICALL *GetThreadInfo) (jvmtiEnv *env,
+ jthread thread,
+ jvmtiThreadInfo *info_ptr);
+
+ jvmtiError (JNICALL *GetOwnedMonitorInfo) (jvmtiEnv *env,
+ jthread thread,
+ jint *owned_monitor_count_ptr,
+ jobject **owned_monitors_ptr);
+
+ jvmtiError (JNICALL *GetCurrentContendedMonitor) (jvmtiEnv *env,
+ jthread thread,
+ jobject *monitor_ptr);
+
+ jvmtiError (JNICALL *RunAgentThread) (jvmtiEnv *env,
+ jthread thread,
+ jvmtiStartFunction proc,
+ const void *arg,
+ jint priority);
+
+ jvmtiError (JNICALL *GetTopThreadGroups) (jvmtiEnv *env,
+ jint *group_count_ptr,
+ jthreadGroup **groups_ptr);
+
+ jvmtiError (JNICALL *GetThreadGroupInfo) (jvmtiEnv *env,
+ jthreadGroup group,
+ jvmtiThreadGroupInfo *info_ptr);
+
+ jvmtiError (JNICALL *GetThreadGroupChildren) (jvmtiEnv *env,
+ jthreadGroup group,
+ jint *thread_count_ptr,
+ jthread **threads_ptr,
+ jint *group_count_ptr,
+ jthreadGroup **groups_ptr);
+ jvmtiError (JNICALL *GetFrameCount) (jvmtiEnv *env,
+ jthread thread,
+ jint *count_ptr);
+
+ jvmtiError (JNICALL *GetThreadState) (jvmtiEnv *env,
+ jthread thread,
+ jint *thread_state_ptr);
+
+ void *reserved18;
+
+ jvmtiError (JNICALL *GetFrameLocation) (jvmtiEnv *env,
+ jthread thread,
+ jint depth,
+ jmethodID *method_ptr,
+ jlocation *location_ptr);
+
+ jvmtiError (JNICALL *NotifyPopFrame) (jvmtiEnv *env,
+ jthread thread,
+ jint depth);
+
+ jvmtiError (JNICALL *GetLocalObject) (jvmtiEnv *env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jobject *value_ptr);
+
+ jvmtiError (JNICALL *GetLocalInt) (jvmtiEnv *env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jint *value_ptr);
+
+ jvmtiError (JNICALL *GetLocalLong) (jvmtiEnv *env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jlong *value_ptr);
+
+ jvmtiError (JNICALL *GetLocalFloat) (jvmtiEnv *env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jfloat *value_ptr);
+
+ jvmtiError (JNICALL *GetLocalDouble) (jvmtiEnv *env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jdouble *value_ptr);
+
+ jvmtiError (JNICALL *SetLocalObject) (jvmtiEnv *env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jobject value);
+
+ jvmtiError (JNICALL *SetLocalInt) (jvmtiEnv *env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jint value);
+
+ jvmtiError (JNICALL *SetLocalLong) (jvmtiEnv *env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jlong value);
+
+ jvmtiError (JNICALL *SetLocalFloat) (jvmtiEnv *env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jfloat value);
+
+ jvmtiError (JNICALL *SetLocalDouble) (jvmtiEnv *env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jdouble value);
+
+ jvmtiError (JNICALL *CreateRawMonitor) (jvmtiEnv *env,
+ const char *name,
+ jrawMonitorID *monitor_ptr);
+
+ jvmtiError (JNICALL *DestroyRawMonitor) (jvmtiEnv *env,
+ jrawMonitorID monitor);
+
+ jvmtiError (JNICALL *RawMonitorEnter) (jvmtiEnv *env,
+ jrawMonitorID monitor);
+
+ jvmtiError (JNICALL *RawMonitorExit) (jvmtiEnv *env,
+ jrawMonitorID monitor);
+
+ jvmtiError (JNICALL *RawMonitorWait) (jvmtiEnv *env,
+ jrawMonitorID monitor,
+ jlong millis);
+
+ jvmtiError (JNICALL *RawMonitorNotify) (jvmtiEnv *env,
+ jrawMonitorID monitor);
+
+ jvmtiError (JNICALL *RawMonitorNotifyAll) (jvmtiEnv *env,
+ jrawMonitorID monitor);
+
+ jvmtiError (JNICALL *SetBreakpoint) (jvmtiEnv *env,
+ jmethodID method,
+ jlocation location);
+
+ jvmtiError (JNICALL *ClearBreakpoint) (jvmtiEnv *env,
+ jmethodID method,
+ jlocation location);
+
+ void *reserved40;
+
+ jvmtiError (JNICALL *SetFieldAccessWatch) (jvmtiEnv *env,
+ jclass klass,
+ jfieldID field);
+
+ jvmtiError (JNICALL *ClearFieldAccessWatch) (jvmtiEnv *env,
+ jclass klass,
+ jfieldID field);
+
+ jvmtiError (JNICALL *SetFieldModificationWatch) (jvmtiEnv *env,
+ jclass klass,
+ jfieldID field);
+
+ jvmtiError (JNICALL *ClearFieldModificationWatch) (jvmtiEnv *env,
+ jclass klass,
+ jfieldID field);
+
+ void *reserved45;
+
+ jvmtiError (JNICALL *Allocate) (jvmtiEnv *env,
+ jlong size,
+ unsigned char **mem_ptr);
+
+ jvmtiError (JNICALL *Deallocate) (jvmtiEnv *env,
+ unsigned char *mem);
+
+ jvmtiError (JNICALL *GetClassSignature) (jvmtiEnv *env,
+ jclass klass,
+ char **signature_ptr,
+ char **generic_ptr);
+
+ jvmtiError (JNICALL *GetClassStatus) (jvmtiEnv *env,
+ jclass klass,
+ jint *status_ptr);
+
+ jvmtiError (JNICALL *GetSourceFileName) (jvmtiEnv *env,
+ jclass klass,
+ char **source_name_ptr);
+
+ jvmtiError (JNICALL *GetClassModifiers) (jvmtiEnv *env,
+ jclass klass,
+ jint *modifiers_ptr);
+
+ jvmtiError (JNICALL *GetClassMethods) (jvmtiEnv *env,
+ jclass klass,
+ jint *method_count_ptr,
+ jmethodID **methods_ptr);
+
+ jvmtiError (JNICALL *GetClassFields) (jvmtiEnv *env,
+ jclass klass,
+ jint *field_count_ptr,
+ jfieldID **fields_ptr);
+
+ jvmtiError (JNICALL *GetImplementedInterfaces) (jvmtiEnv *env,
+ jclass klass,
+ jint *interface_count_ptr,
+ jclass **interfaces_ptr);
+
+ jvmtiError (JNICALL *IsInterface) (jvmtiEnv *env,
+ jclass klass,
+ jboolean *is_interface_ptr);
+
+ jvmtiError (JNICALL *IsArrayClass) (jvmtiEnv *env,
+ jclass klass,
+ jboolean *is_array_class_ptr);
+
+ jvmtiError (JNICALL *GetClassLoader) (jvmtiEnv *env,
+ jclass klass,
+ jobject *classloader_ptr);
+
+ jvmtiError (JNICALL *GetObjectHashCode) (jvmtiEnv *env,
+ jobject object,
+ jint *hash_code_ptr);
+
+ jvmtiError (JNICALL *GetObjectMonitorUsage) (jvmtiEnv *env,
+ jobject object,
+ jvmtiMonitorUsage *info_ptr);
+
+ jvmtiError (JNICALL *GetFieldName) (jvmtiEnv *env,
+ jclass klass,
+ jfieldID field,
+ char **name_ptr,
+ char **signature_ptr,
+ char **generic_ptr);
+
+ jvmtiError (JNICALL *GetFieldDeclaringClass) (jvmtiEnv *env,
+ jclass klass,
+ jfieldID field,
+ jclass *declaring_class_ptr);
+
+ jvmtiError (JNICALL *GetFieldModifiers) (jvmtiEnv *env,
+ jclass klass,
+ jfieldID field,
+ jint *modifiers_ptr);
+
+ jvmtiError (JNICALL *IsFieldSynthetic) (jvmtiEnv *env,
+ jclass klass,
+ jfieldID field,
+ jboolean *is_synthetic_ptr);
+
+ jvmtiError (JNICALL *GetMethodName) (jvmtiEnv *env,
+ jmethodID method,
+ char **name_ptr,
+ char **signature_ptr,
+ char **generic_ptr);
+
+ jvmtiError (JNICALL *GetMethodDeclaringClass) (jvmtiEnv *env,
+ jmethodID method,
+ jclass *declaring_class_ptr);
+
+
+ jvmtiError (JNICALL *GetMethodModifiers) (jvmtiEnv *env,
+ jmethodID method,
+ jint *modifiers_ptr);
+
+ void *reserved67;
+
+ jvmtiError (JNICALL *GetMaxLocals) (jvmtiEnv *env,
+ jmethodID method,
+ jint *max_ptr);
+
+ jvmtiError (JNICALL *GetArgumentsSize) (jvmtiEnv *env,
+ jmethodID method,
+ jint *size_ptr);
+
+ jvmtiError (JNICALL *GetLineNumberTable) (jvmtiEnv *env,
+ jmethodID method,
+ jint *entry_count_ptr,
+ jvmtiLineNumberEntry **table_ptr);
+
+ jvmtiError (JNICALL *GetMethodLocation) (jvmtiEnv *env,
+ jmethodID method,
+ jlocation *start_location_ptr,
+ jlocation *end_location_ptr);
+
+ jvmtiError (JNICALL *GetLocalVariableTable) (jvmtiEnv *env,
+ jmethodID method,
+ jint *entry_count_ptr,
+ jvmtiLocalVariableEntry **table_ptr);
+
+ void *reserved73;
+
+ void *reserved74;
+
+ jvmtiError (JNICALL *GetBytecodes) (jvmtiEnv *env,
+ jmethodID method,
+ jint *bytecode_count_ptr,
+ unsigned char **bytecodes_ptr);
+
+ jvmtiError (JNICALL *IsMethodNative) (jvmtiEnv *env,
+ jmethodID method,
+ jboolean *is_native_ptr);
+
+ jvmtiError (JNICALL *IsMethodSynthetic) (jvmtiEnv *env,
+ jmethodID method,
+ jboolean *is_synthetic_ptr);
+
+ jvmtiError (JNICALL *GetLoadedClasses) (jvmtiEnv *env,
+ jint *class_count_ptr,
+ jclass **classes_ptr);
+
+ jvmtiError (JNICALL *GetClassLoaderClasses) (jvmtiEnv *env,
+ jobject initiating_loader,
+ jint *class_count_ptr,
+ jclass **classes_ptr);
+
+ jvmtiError (JNICALL *PopFrame) (jvmtiEnv *env,
+ jthread thread);
+
+ void *reserved81;
+
+ void *reserved82;
+
+ void *reserved83;
+
+ void *reserved84;
+
+ void *reserved85;
+
+ void *reserved86;
+
+ jvmtiError (JNICALL *RedefineClasses) (jvmtiEnv *env,
+ jint class_count,
+ const jvmtiClassDefinition* class_definitions);
+
+ jvmtiError (JNICALL *GetVersionNumber) (jvmtiEnv *env,
+ jint *version_ptr);
+
+ jvmtiError (JNICALL *GetCapabilities) (jvmtiEnv *env,
+ jvmtiCapabilities *capabilities_ptr);
+
+ jvmtiError (JNICALL *GetSourceDebugExtension) (jvmtiEnv *env,
+ jclass klass,
+ char **source_debug_extension_ptr);
+
+ jvmtiError (JNICALL *IsMethodObsolete) (jvmtiEnv *env,
+ jmethodID method,
+ jboolean *is_obsolete_ptr);
+
+ jvmtiError (JNICALL *SuspendThreadList) (jvmtiEnv *env,
+ jint request_count,
+ const jthread *request_list,
+ jvmtiError *results);
+
+ jvmtiError (JNICALL *ResumeThreadList) (jvmtiEnv *env,
+ jint request_count,
+ const jthread *request_list,
+ jvmtiError *results);
+
+ void *reserved94;
+
+ void *reserved95;
+
+ void *reserved96;
+
+ void *reserved97;
+
+ void *reserved98;
+
+ void *reserved99;
+
+ jvmtiError (JNICALL *GetAllStackTraces) (jvmtiEnv *env,
+ jint max_frame_count,
+ jvmtiStackInfo **stack_info_ptr,
+ jint *thread_count_ptr);
+
+ jvmtiError (JNICALL *GetThreadListStackTraces) (jvmtiEnv *env,
+ jint thread_count,
+ const jthread *thread_list,
+ jint max_frame_count,
+ jvmtiStackInfo **stack_info_ptr);
+
+ jvmtiError (JNICALL *GetThreadLocalStorage) (jvmtiEnv *env,
+ jthread thread,
+ void **data_ptr);
+
+ jvmtiError (JNICALL *SetThreadLocalStorage) (jvmtiEnv *env,
+ jthread thread,
+ const void *data);
+
+ jvmtiError (JNICALL *GetStackTrace) (jvmtiEnv *env,
+ jthread thread,
+ jint start_depth,
+ jint max_frame_count,
+ jvmtiFrameInfo *frame_buffer,
+ jint *count_ptr);
+
+ void *reserved105;
+
+ jvmtiError (JNICALL *GetTag) (jvmtiEnv *env,
+ jobject object,
+ jlong *tag_ptr);
+
+ jvmtiError (JNICALL *SetTag) (jvmtiEnv *env,
+ jobject object,
+ jlong tag);
+
+ jvmtiError (JNICALL *ForceGarbageCollection) (jvmtiEnv *env);
+
+ jvmtiError (JNICALL *IterateOverObjectsReachableFromObject) (jvmtiEnv *env,
+ jobject object,
+ jvmtiObjectReferenceCallback object_reference_callback,
+ void *user_data);
+
+ jvmtiError (JNICALL *IterateOverReachableObjects) (jvmtiEnv *env,
+ jvmtiHeapRootCallback heap_root_callback,
+ jvmtiStackReferenceCallback stack_ref_callback,
+ jvmtiObjectReferenceCallback object_ref_callback,
+ void *user_data);
+
+ jvmtiError (JNICALL *IterateOverHeap) (jvmtiEnv *env,
+ jvmtiHeapObjectFilter object_filter,
+ jvmtiHeapObjectCallback heap_object_callback,
+ void *user_data);
+
+ jvmtiError (JNICALL *IterateOverInstanceOfClass) (jvmtiEnv *env,
+ jclass klass,
+ jvmtiHeapObjectFilter object_filter,
+ jvmtiHeapObjectCallback heap_object_callback,
+ void *user_data);
+
+ void *reserved113;
+
+ jvmtiError (JNICALL *GetObjectsWithTags) (jvmtiEnv *env,
+ jint tag_count,
+ const jlong *tags,
+ jint *count_ptr,
+ jobject **object_result_ptr,
+ jlong **tag_result_ptr);
+
+ void *reserved115;
+
+ void *reserved116;
+
+ void *reserved117;
+
+ void *reserved118;
+
+ void *reserved119;
+
+ jvmtiError (JNICALL *SetJNIFunctionTable) (jvmtiEnv *env,
+ const jniNativeInterface *function_table);
+
+ jvmtiError (JNICALL *GetJNIFunctionTable) (jvmtiEnv *env,
+ jniNativeInterface **function_table_ptr);
+
+ jvmtiError (JNICALL *SetEventCallbacks) (jvmtiEnv *env,
+ const jvmtiEventCallbacks *callbacks,
+ jint size_of_callbacks);
+
+ jvmtiError (JNICALL *GenerateEvents) (jvmtiEnv *env,
+ jvmtiEvent event_type);
+
+ jvmtiError (JNICALL *GetExtensionFunctions) (jvmtiEnv *env,
+ jint *extension_count_ptr,
+ jvmtiExtensionFunctionInfo **extensions);
+
+ jvmtiError (JNICALL *GetExtensionEvents) (jvmtiEnv *env,
+ jint *extension_count_ptr,
+ jvmtiExtensionEventInfo **extensions);
+
+ jvmtiError (JNICALL *SetExtensionEventCallback) (jvmtiEnv *env,
+ jint extension_event_index,
+ jvmtiExtensionEvent callback);
+
+ jvmtiError (JNICALL *DisposeEnvironment) (jvmtiEnv *env);
+
+ jvmtiError (JNICALL *GetErrorName) (jvmtiEnv *env,
+ jvmtiError error,
+ char **name_ptr);
+
+ jvmtiError (JNICALL *GetJLocationFormat) (jvmtiEnv *env,
+ jvmtiJlocationFormat *format_ptr);
+
+ jvmtiError (JNICALL *GetSystemProperties) (jvmtiEnv *env,
+ jint *count_ptr,
+ char ***property_ptr);
+
+ jvmtiError (JNICALL *GetSystemProperty) (jvmtiEnv *env,
+ const char *property,
+ char **value_ptr);
+
+ jvmtiError (JNICALL *SetSystemProperty) (jvmtiEnv *env,
+ const char *property,
+ const char *value);
+
+ jvmtiError (JNICALL *GetPhase) (jvmtiEnv *env,
+ jvmtiPhase *phase_ptr);
+
+ jvmtiError (JNICALL *GetCurrentThreadCpuTimerInfo) (jvmtiEnv *env,
+ jvmtiTimerInfo *info_ptr);
+
+ jvmtiError (JNICALL *GetCurrentThreadCpuTime) (jvmtiEnv *env,
+ jlong *nanos_ptr);
+
+ jvmtiError (JNICALL *GetThreadCpuTimerInfo) (jvmtiEnv *env,
+ jvmtiTimerInfo *info_ptr);
+
+ jvmtiError (JNICALL *GetThreadCpuTime) (jvmtiEnv *env,
+ jthread thread,
+ jlong *nanos_ptr);
+
+ jvmtiError (JNICALL *GetTimerInfo) (jvmtiEnv *env,
+ jvmtiTimerInfo *info_ptr);
+
+ jvmtiError (JNICALL *GetTime) (jvmtiEnv *env,
+ jlong *nanos_ptr);
+
+ jvmtiError (JNICALL *GetPotentialCapabilities) (jvmtiEnv *env,
+ jvmtiCapabilities *capabilities_ptr);
+
+ void *reserved141;
+
+ jvmtiError (JNICALL *AddCapabilities) (jvmtiEnv *env,
+ const jvmtiCapabilities *capabilities_ptr);
+
+ jvmtiError (JNICALL *RelinquishCapabilities) (jvmtiEnv *env,
+ const jvmtiCapabilities *capabilities_ptr);
+
+ jvmtiError (JNICALL *GetAvailableProcessors) (jvmtiEnv *env,
+ jint *processor_count_ptr);
+
+ void *reserved145;
+
+ void *reserved146;
+
+ jvmtiError (JNICALL *GetEnvironmentLocalStorage) (jvmtiEnv *env,
+ void **data_ptr);
+
+ jvmtiError (JNICALL *SetEnvironmentLocalStorage) (jvmtiEnv *env,
+ const void *data);
+
+ jvmtiError (JNICALL *AddToBootstrapClassLoaderSearch) (jvmtiEnv *env,
+ const char *segment);
+
+ jvmtiError (JNICALL *SetVerboseFlag) (jvmtiEnv *env,
+ jvmtiVerboseFlag flag,
+ jboolean value);
+
+ void *reserved151;
+
+ void *reserved152;
+
+ void *reserved153;
+
+ jvmtiError (JNICALL *GetObjectSize) (jvmtiEnv *env,
+ jobject object,
+ jlong *size_ptr);
+};
+
+#ifdef __cplusplus
+class _Jv_JVMTIEnv
+{
+ public:
+ /* Method table */
+ struct _Jv_jvmtiEnv *p;
+
+#ifdef _CLASSPATH_JVMTIENV_CONTENTS
+ _CLASSPATH_JVMTIENV_CONTENTS
+#endif
+
+ jvmtiError SetEventNotificationMode (jvmtiEventMode mode,
+ jvmtiEvent event_type,
+ jthread event_thread, ...)
+ {
+ va_list args;
+ va_start (args, event_thread);
+ jvmtiError result = p->SetEventNotificationMode (this, mode, event_type,
+ event_thread, args);
+ va_end (args);
+ return result;
+ }
+
+ jvmtiError GetAllThreads (jint *threads_count_ptr, jthread **threads_ptr)
+ { return p->GetAllThreads (this, threads_count_ptr, threads_ptr); }
+
+ jvmtiError SuspendThread (jthread thread)
+ { return p->SuspendThread (this, thread); }
+
+ jvmtiError ResumeThread (jthread thread)
+ { return p->ResumeThread (this, thread); }
+
+ jvmtiError StopThread (jthread thread, jobject exception)
+ { return p->StopThread (this, thread, exception); }
+
+ jvmtiError InterruptThread (jthread thread)
+ { return p->InterruptThread (this, thread); }
+
+ jvmtiError GetThreadInfo (jthread thread, jvmtiThreadInfo *info_ptr)
+ { return p->GetThreadInfo (this, thread, info_ptr); }
+
+ jvmtiError GetOwnedMonitorInfo (jthread thread,
+ jint *owned_monitor_count_ptr,
+ jobject **owned_monitors_ptr)
+ {
+ return p->GetOwnedMonitorInfo (this, thread, owned_monitor_count_ptr,
+ owned_monitors_ptr);
+ }
+
+ jvmtiError GetCurrentContendedMonitor (jthread thread, jobject *monitor_ptr)
+ { return p->GetCurrentContendedMonitor (this, thread, monitor_ptr); }
+
+ jvmtiError RunAgentThread (jthread thread, jvmtiStartFunction proc,
+ const void *arg, jint priority)
+ { return p->RunAgentThread (this, thread, proc, arg, priority); }
+
+ jvmtiError GetTopThreadGroups (jint *group_count_ptr,
+ jthreadGroup **groups_ptr)
+ { return p->GetTopThreadGroups (this, group_count_ptr, groups_ptr); }
+
+ jvmtiError GetThreadGroupInfo (jthreadGroup group,
+ jvmtiThreadGroupInfo *info_ptr)
+ { return p->GetThreadGroupInfo (this, group, info_ptr); }
+
+ jvmtiError GetThreadGroupChildren (jthreadGroup group,
+ jint *thread_count_ptr,
+ jthread **threads_ptr,
+ jint *group_count_ptr,
+ jthreadGroup **groups_ptr)
+ {
+ return p->GetThreadGroupChildren (this, group, thread_count_ptr,
+ threads_ptr, group_count_ptr,
+ groups_ptr);
+ }
+
+ jvmtiError GetFrameCount (jthread thread, jint *count_ptr)
+ { return p->GetFrameCount (this, thread, count_ptr); }
+
+ jvmtiError GetThreadState (jthread thread, jint *thread_state_ptr)
+ { return p->GetThreadState (this, thread, thread_state_ptr); }
+
+ jvmtiError GetFrameLocation (jthread thread, jint depth,
+ jmethodID *method_ptr, jlocation *location_ptr)
+ {
+ return p->GetFrameLocation (this, thread, depth, method_ptr,
+ location_ptr);
+ }
+
+ jvmtiError NotifyPopFrame (jthread thread, jint depth)
+ { return p->NotifyPopFrame (this, thread, depth); }
+
+ jvmtiError GetLocalObject (jthread thread, jint depth, jint slot,
+ jobject *value_ptr)
+ { return p->GetLocalObject (this, thread, depth, slot, value_ptr); }
+
+ jvmtiError GetLocalInt (jthread thread, jint depth, jint slot,
+ jint *value_ptr)
+ { return p->GetLocalInt (this, thread, depth, slot, value_ptr); }
+
+ jvmtiError GetLocalLong (jthread thread, jint depth, jint slot,
+ jlong *value_ptr)
+ { return p->GetLocalLong (this, thread, depth, slot, value_ptr); }
+
+ jvmtiError GetLocalFloat (jthread thread, jint depth, jint slot,
+ jfloat *value_ptr)
+ { return p->GetLocalFloat (this, thread, depth, slot, value_ptr); }
+
+ jvmtiError GetLocalDouble (jthread thread, jint depth, jint slot,
+ jdouble *value_ptr)
+ { return p->GetLocalDouble (this, thread, depth, slot, value_ptr); }
+
+ jvmtiError SetLocalObject (jthread thread, jint depth, jint slot,
+ jobject value)
+ { return p->SetLocalObject (this, thread, depth, slot, value); }
+
+ jvmtiError SetLocalInt (jthread thread, jint depth, jint slot,
+ jint value)
+ { return p->SetLocalInt (this, thread, depth, slot, value); }
+
+ jvmtiError SetLocalLong (jthread thread, jint depth, jint slot,
+ jlong value)
+ { return p->SetLocalLong (this, thread, depth, slot, value); }
+
+ jvmtiError SetLocalFloat (jthread thread, jint depth, jint slot,
+ jfloat value)
+ { return p->SetLocalFloat (this, thread, depth, slot, value); }
+
+ jvmtiError SetLocalDouble (jthread thread, jint depth, jint slot,
+ jdouble value)
+ { return p->SetLocalDouble (this, thread, depth, slot, value); }
+
+ jvmtiError CreateRawMonitor (const char *name, jrawMonitorID *monitor_ptr)
+ { return p->CreateRawMonitor (this, name, monitor_ptr); }
+
+ jvmtiError DestroyRawMonitor (jrawMonitorID monitor)
+ { return p->DestroyRawMonitor (this, monitor); }
+
+ jvmtiError RawMonitorEnter (jrawMonitorID monitor)
+ { return p->RawMonitorEnter (this, monitor); }
+
+ jvmtiError RawMonitorExit (jrawMonitorID monitor)
+ { return p->RawMonitorExit (this, monitor); }
+
+ jvmtiError RawMonitorWait (jrawMonitorID monitor, jlong millis)
+ { return p->RawMonitorWait (this, monitor, millis); }
+
+ jvmtiError RawMonitorNotify (jrawMonitorID monitor)
+ { return p->RawMonitorNotify (this, monitor); }
+
+ jvmtiError RawMonitorNotifyAll (jrawMonitorID monitor)
+ { return p->RawMonitorNotifyAll (this, monitor); }
+
+ jvmtiError SetBreakpoint (jmethodID method, jlocation location)
+ { return p->SetBreakpoint (this, method, location); }
+
+ jvmtiError ClearBreakpoint (jmethodID method, jlocation location)
+ { return p->ClearBreakpoint (this, method, location); }
+
+ jvmtiError SetFieldAccessWatch (jclass klass, jfieldID field)
+ { return p->SetFieldAccessWatch (this, klass, field); }
+
+ jvmtiError ClearFieldAccessWatch (jclass klass, jfieldID field)
+ { return p->ClearFieldAccessWatch (this, klass, field); }
+
+ jvmtiError SetFieldModificationWatch (jclass klass, jfieldID field)
+ { return p->SetFieldModificationWatch (this, klass, field); }
+
+ jvmtiError ClearFieldModificationWatch (jclass klass, jfieldID field)
+ { return p->ClearFieldModificationWatch (this, klass, field); }
+
+ jvmtiError Allocate (jlong size, unsigned char **mem_ptr)
+ { return p->Allocate (this, size, mem_ptr); }
+
+ jvmtiError Deallocate (unsigned char *mem)
+ { return p->Deallocate (this, mem); }
+
+ jvmtiError GetClassSignature (jclass klass, char **signature_ptr,
+ char **generic_ptr)
+ { return p->GetClassSignature (this, klass, signature_ptr, generic_ptr); }
+
+ jvmtiError GetClassStatus (jclass klass, jint *status_ptr)
+ { return p->GetClassStatus (this, klass, status_ptr); }
+
+ jvmtiError GetSourceFileName (jclass klass, char **source_name_ptr)
+ { return p->GetSourceFileName (this, klass, source_name_ptr); }
+
+ jvmtiError GetClassModifiers (jclass klass, jint *modifiers_ptr)
+ { return p->GetClassModifiers (this, klass, modifiers_ptr); }
+
+ jvmtiError GetClassMethods (jclass klass, jint *method_count_ptr,
+ jmethodID **methods_ptr)
+ { return p->GetClassMethods (this, klass, method_count_ptr, methods_ptr); }
+
+ jvmtiError GetClassFields (jclass klass, jint *field_count_ptr,
+ jfieldID **fields_ptr)
+ { return p->GetClassFields (this, klass, field_count_ptr, fields_ptr); }
+
+ jvmtiError GetImplementedInterfaces (jclass klass,
+ jint *interface_count_ptr,
+ jclass **interfaces_ptr)
+ {
+ return p->GetImplementedInterfaces (this, klass, interface_count_ptr,
+ interfaces_ptr);
+ }
+
+ jvmtiError IsInterface (jclass klass, jboolean *is_interface_ptr)
+ { return p->IsInterface (this, klass, is_interface_ptr); }
+
+ jvmtiError IsArrayClass (jclass klass, jboolean *is_array_class_ptr)
+ { return p->IsArrayClass (this, klass, is_array_class_ptr); }
+
+ jvmtiError GetClassLoader (jclass klass, jobject *classloader_ptr)
+ { return p->GetClassLoader (this, klass, classloader_ptr); }
+
+ jvmtiError GetObjectHashCode (jobject object, jint *hash_code_ptr)
+ { return p->GetObjectHashCode (this, object, hash_code_ptr); }
+
+ jvmtiError GetObjectMonitorUsage (jobject object,
+ jvmtiMonitorUsage *info_ptr)
+ { return p->GetObjectMonitorUsage (this, object, info_ptr); }
+
+ jvmtiError GetFieldName (jclass klass, jfieldID field, char **name_ptr,
+ char **signature_ptr, char **generic_ptr)
+ {
+ return p->GetFieldName (this, klass, field, name_ptr,
+ signature_ptr, generic_ptr);
+ }
+
+ jvmtiError GetFieldDeclaringClass (jclass klass, jfieldID field,
+ jclass *declaring_class_ptr)
+ {
+ return p->GetFieldDeclaringClass (this, klass, field,
+ declaring_class_ptr);
+ }
+
+ jvmtiError GetFieldModifiers (jclass klass, jfieldID field,
+ jint *modifiers_ptr)
+ { return p->GetFieldModifiers (this, klass, field, modifiers_ptr); }
+
+ jvmtiError IsFieldSynthetic (jclass klass, jfieldID field,
+ jboolean *is_synthetic_ptr)
+ { return p->IsFieldSynthetic (this, klass, field, is_synthetic_ptr); }
+
+ jvmtiError GetMethodName (jmethodID method, char **name_ptr,
+ char **signature_ptr, char **generic_ptr)
+ {
+ return p->GetMethodName (this, method, name_ptr, signature_ptr,
+ generic_ptr);
+ }
+
+ jvmtiError GetMethodDeclaringClass (jmethodID method,
+ jclass *declaring_class_ptr)
+ { return p->GetMethodDeclaringClass (this, method, declaring_class_ptr); }
+
+
+ jvmtiError GetMethodModifiers (jmethodID method, jint *modifiers_ptr)
+ { return p->GetMethodModifiers (this, method, modifiers_ptr); }
+
+ jvmtiError GetMaxLocals (jmethodID method, jint *max_ptr)
+ { return p->GetMaxLocals (this, method, max_ptr); }
+
+ jvmtiError GetArgumentsSize (jmethodID method, jint *size_ptr)
+ { return p->GetArgumentsSize (this, method, size_ptr); }
+
+ jvmtiError GetLineNumberTable (jmethodID method, jint *entry_count_ptr,
+ jvmtiLineNumberEntry **table_ptr)
+ { return p->GetLineNumberTable (this, method, entry_count_ptr, table_ptr); }
+
+ jvmtiError GetMethodLocation (jmethodID method,
+ jlocation *start_location_ptr,
+ jlocation *end_location_ptr)
+ {
+ return p->GetMethodLocation (this, method, start_location_ptr,
+ end_location_ptr);
+ }
+
+ jvmtiError GetLocalVariableTable (jmethodID method, jint *entry_count_ptr,
+ jvmtiLocalVariableEntry **table_ptr)
+ {
+ return p->GetLocalVariableTable (this, method, entry_count_ptr,
+ table_ptr);
+ }
+
+ jvmtiError GetBytecodes (jmethodID method, jint *bytecode_count_ptr,
+ unsigned char **bytecodes_ptr)
+ {
+ return p->GetBytecodes (this, method, bytecode_count_ptr,
+ bytecodes_ptr);
+ }
+
+ jvmtiError IsMethodNative (jmethodID method, jboolean *is_native_ptr)
+ { return p->IsMethodNative (this, method, is_native_ptr); }
+
+ jvmtiError IsMethodSynthetic (jmethodID method, jboolean *is_synthetic_ptr)
+ { return p->IsMethodSynthetic (this, method, is_synthetic_ptr); }
+
+ jvmtiError GetLoadedClasses (jint *class_count_ptr, jclass **classes_ptr)
+ { return p->GetLoadedClasses (this, class_count_ptr, classes_ptr); }
+
+ jvmtiError GetClassLoaderClasses (jobject initiating_loader,
+ jint *class_count_ptr,
+ jclass **classes_ptr)
+ {
+ return p->GetClassLoaderClasses (this, initiating_loader,
+ class_count_ptr, classes_ptr);
+ }
+
+ jvmtiError PopFrame (jthread thread)
+ { return p->PopFrame (this, thread); }
+
+ jvmtiError RedefineClasses (jint class_count,
+ const jvmtiClassDefinition* class_definitions)
+ { return p->RedefineClasses (this, class_count, class_definitions); }
+
+ jvmtiError GetVersionNumber (jint *version_ptr)
+ { return p->GetVersionNumber (this, version_ptr); }
+
+ jvmtiError GetCapabilities (jvmtiCapabilities *capabilities_ptr)
+ { return p->GetCapabilities (this, capabilities_ptr); }
+
+ jvmtiError GetSourceDebugExtension (jclass klass,
+ char **source_debug_extension_ptr)
+ {
+ return p->GetSourceDebugExtension (this, klass,
+ source_debug_extension_ptr);
+ }
+
+ jvmtiError IsMethodObsolete (jmethodID method, jboolean *is_obsolete_ptr)
+ { return p->IsMethodObsolete (this, method, is_obsolete_ptr); }
+
+
+ jvmtiError SuspendThreadList (jint request_count,
+ const jthread *request_list,
+ jvmtiError *results)
+ { return p->SuspendThreadList (this, request_count, request_list, results); }
+
+ jvmtiError ResumeThreadList (jint request_count,
+ const jthread *request_list,
+ jvmtiError *results)
+ { return p->ResumeThreadList (this, request_count, request_list, results); }
+
+ jvmtiError GetAllStackTraces (jint max_frame_count,
+ jvmtiStackInfo **stack_info_ptr,
+ jint *thread_count_ptr)
+ {
+ return p->GetAllStackTraces (this, max_frame_count, stack_info_ptr,
+ thread_count_ptr);
+ }
+
+ jvmtiError GetThreadListStackTraces (jint thread_count,
+ const jthread *thread_list,
+ jint max_frame_count,
+ jvmtiStackInfo **stack_info_ptr)
+ {
+ return p->GetThreadListStackTraces (this, thread_count, thread_list,
+ max_frame_count, stack_info_ptr);
+ }
+
+ jvmtiError GetThreadLocalStorage (jthread thread, void **data_ptr)
+ { return p->GetThreadLocalStorage (this, thread, data_ptr); }
+
+ jvmtiError SetThreadLocalStorage (jthread thread, const void *data)
+ { return p->SetThreadLocalStorage (this, thread, data); }
+
+ jvmtiError GetStackTrace (jthread thread, jint start_depth,
+ jint max_frame_count,
+ jvmtiFrameInfo *frame_buffer, jint *count_ptr)
+ {
+ return p->GetStackTrace (this, thread, start_depth, max_frame_count,
+ frame_buffer, count_ptr);
+ }
+
+ jvmtiError GetTag (jobject object, jlong *tag_ptr)
+ { return p->GetTag (this, object, tag_ptr); }
+
+ jvmtiError SetTag (jobject object, jlong tag)
+ { return p->SetTag (this, object, tag); }
+
+ jvmtiError ForceGarbageCollection (void)
+ { return p->ForceGarbageCollection (this); }
+
+ jvmtiError IterateOverObjectsReachableFromObject (jobject object,
+ jvmtiObjectReferenceCallback object_reference_callback,
+ void *user_data)
+ {
+ return p->IterateOverObjectsReachableFromObject (this, object,
+ object_reference_callback,
+ user_data);
+ }
+
+ jvmtiError IterateOverReachableObjects (jvmtiHeapRootCallback heap_root_callback,
+ jvmtiStackReferenceCallback stack_ref_callback,
+ jvmtiObjectReferenceCallback object_ref_callback,
+ void *user_data)
+ {
+ return p->IterateOverReachableObjects (this, heap_root_callback,
+ stack_ref_callback,
+ object_ref_callback,
+ user_data);
+ }
+
+ jvmtiError IterateOverHeap (jvmtiHeapObjectFilter object_filter,
+ jvmtiHeapObjectCallback heap_object_callback,
+ void *user_data)
+ {
+ return p->IterateOverHeap (this, object_filter, heap_object_callback,
+ user_data);
+ }
+
+ jvmtiError IterateOverInstanceOfClass (jclass klass,
+ jvmtiHeapObjectFilter object_filter,
+ jvmtiHeapObjectCallback heap_object_callback,
+ void *user_data)
+ {
+ return p->IterateOverInstanceOfClass (this, klass, object_filter,
+ heap_object_callback, user_data);
+ }
+
+ jvmtiError GetObjectsWithTags (jint tag_count, const jlong *tags,
+ jint *count_ptr, jobject **object_result_ptr,
+ jlong **tag_result_ptr)
+ {
+ return p->GetObjectsWithTags (this, tag_count, tags, count_ptr,
+ object_result_ptr, tag_result_ptr);
+ }
+
+ jvmtiError SetJNIFunctionTable (const jniNativeInterface *function_table)
+ { return p->SetJNIFunctionTable (this, function_table); }
+
+ jvmtiError GetJNIFunctionTable (jniNativeInterface **function_table_ptr)
+ { return p->GetJNIFunctionTable (this, function_table_ptr); }
+
+ jvmtiError SetEventCallbacks (const jvmtiEventCallbacks *callbacks,
+ jint size_of_callbacks)
+ { return p->SetEventCallbacks (this, callbacks, size_of_callbacks); }
+
+ jvmtiError GenerateEvents (jvmtiEvent event_type)
+ { return p->GenerateEvents (this, event_type); }
+
+ jvmtiError GetExtensionFunctions (jint *extension_count_ptr,
+ jvmtiExtensionFunctionInfo **extensions)
+ { return p->GetExtensionFunctions (this, extension_count_ptr, extensions); }
+
+ jvmtiError GetExtensionEvents (jint *extension_count_ptr,
+ jvmtiExtensionEventInfo **extensions)
+ { return p->GetExtensionEvents (this, extension_count_ptr, extensions); }
+
+ jvmtiError SetExtensionEventCallback (jint extension_event_index,
+ jvmtiExtensionEvent callback)
+ {
+ return p->SetExtensionEventCallback (this, extension_event_index,
+ callback);
+ }
+
+ jvmtiError DisposeEnvironment (void)
+ { return p->DisposeEnvironment (this); }
+
+ jvmtiError GetErrorName (jvmtiError error, char **name_ptr)
+ { return p->GetErrorName (this, error, name_ptr); }
+
+ jvmtiError GetJLocationFormat (jvmtiJlocationFormat *format_ptr)
+ { return p->GetJLocationFormat (this, format_ptr); }
+
+ jvmtiError GetSystemProperties (jint *count_ptr, char ***property_ptr)
+ { return p->GetSystemProperties (this, count_ptr, property_ptr); }
+
+ jvmtiError GetSystemProperty (const char *property, char **value_ptr)
+ { return p->GetSystemProperty (this, property, value_ptr); }
+
+ jvmtiError SetSystemProperty (const char *property, const char *value)
+ { return p->SetSystemProperty (this, property, value); }
+
+ jvmtiError GetPhase (jvmtiPhase *phase_ptr)
+ { return p->GetPhase (this, phase_ptr); }
+
+ jvmtiError GetCurrentThreadCpuTimerInfo (jvmtiTimerInfo *info_ptr)
+ { return p->GetCurrentThreadCpuTimerInfo (this, info_ptr); }
+
+ jvmtiError GetCurrentThreadCpuTime (jlong *nanos_ptr)
+ { return p->GetCurrentThreadCpuTime (this, nanos_ptr); }
+
+ jvmtiError GetThreadCpuTimerInfo (jvmtiTimerInfo *info_ptr)
+ { return p->GetThreadCpuTimerInfo (this, info_ptr); }
+
+ jvmtiError GetThreadCpuTime (jthread thread, jlong *nanos_ptr)
+ { return p->GetThreadCpuTime (this, thread, nanos_ptr); }
+
+ jvmtiError GetTimerInfo (jvmtiTimerInfo *info_ptr)
+ { return p->GetTimerInfo (this, info_ptr); }
+
+ jvmtiError GetTime (jlong *nanos_ptr)
+ {return p->GetTime (this, nanos_ptr); }
+
+ jvmtiError GetPotentialCapabilities (jvmtiCapabilities *capabilities_ptr)
+ { return p->GetPotentialCapabilities (this, capabilities_ptr); }
+
+ jvmtiError AddCapabilities (const jvmtiCapabilities *capabilities_ptr)
+ { return p->AddCapabilities (this, capabilities_ptr); }
+
+ jvmtiError RelinquishCapabilities (const jvmtiCapabilities *capabilities_ptr)
+ { return p->RelinquishCapabilities (this, capabilities_ptr); }
+
+ jvmtiError GetAvailableProcessors (jint *processor_count_ptr)
+ { return p->GetAvailableProcessors (this, processor_count_ptr); }
+
+ jvmtiError GetEnvironmentLocalStorage (void **data_ptr)
+ { return p->GetEnvironmentLocalStorage (this, data_ptr); }
+
+ jvmtiError SetEnvironmentLocalStorage (const void *data)
+ { return p->SetEnvironmentLocalStorage (this, data); }
+
+ jvmtiError AddToBootstrapClassLoaderSearch (const char *segment)
+ { return p->AddToBootstrapClassLoaderSearch (this, segment); }
+
+ jvmtiError SetVerboseFlag (jvmtiVerboseFlag flag, jboolean value)
+ { return p->SetVerboseFlag (this, flag, value); }
+
+ jvmtiError GetObjectSize (jobject object, jlong *size_ptr)
+ { return p->GetObjectSize (this, object, size_ptr); }
+};
+#endif /* __cplusplus */
+
+/*
+ * Miscellaneous flags, constants, etc
+ */
+
+/* Class status flags */
+#define JVMTI_CLASS_STATUS_VERIFIED 1
+#define JVMTI_CLASS_STATUS_PREPARED 2
+#define JVMTI_CLASS_STATUS_INITIALIZED 4
+#define JVMTI_CLASS_STATUS_ERROR 8
+#define JVMTI_CLASS_STATUS_ARRAY 16
+#define JVMTI_CLASS_STATUS_PRIMITIVE 32
+
+/* Thread state flags */
+#define JVMTI_THREAD_STATE_ALIVE 0x0001
+#define JVMTI_THREAD_STATE_TERMINATED 0x0002
+#define JVMTI_THREAD_STATE_RUNNABLE 0x0004
+#define JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER 0x0400
+#define JVMTI_THREAD_STATE_WAITING 0x0080
+#define JVMTI_THREAD_STATE_WAITING_INDEFINITELY 0x0010
+#define JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT 0x0020
+#define JVMTI_THREAD_STATE_SLEEPING 0x0040
+#define JVMTI_THREAD_STATE_IN_OBJECT_WAIT 0x0100
+#define JVMTI_THREAD_STATE_PARKED 0x0200
+#define JVMTI_THREAD_STATE_SUSPENDED 0x100000
+#define JVMTI_THREAD_STATE_INTERRUPTED 0x200000
+#define JVMTI_THREAD_STATE_IN_NATIVE 0x400000
+#define JVMTI_THREAD_STATE_VENDOR_1 0x10000000
+#define JVMTI_THREAD_STATE_VENDOR_2 0x20000000
+#define JVMTI_THREAD_STATE_VENDOR_3 0x40000000
+
+/* java.lang.Thread.State conversion masks */
+#define JVMTI_JAVA_LANG_THREAD_STATE_MASK \
+ (JVMTI_THREAD_STATE_TERMINATED \
+ | JVMTI_THREAD_STATE_ALIVE \
+ | JVMTI_THREAD_STATE_RUNNABLE \
+ | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER \
+ | JVMTI_THREAD_STATE_WAITING \
+ | JVMTI_THREAD_STATE_WAITING_INDEFINITELY \
+ | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT)
+#define JVMTI_JAVA_LANG_THREAD_STATE_NEW 0
+#define JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED JVMTI_THREAD_STATE_TERMINATED
+#define JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE \
+ (JVMTI_THREAD_STATE_ALIVE \
+ | JVMTI_THREAD_STATE_RUNNABLE)
+#define JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED \
+ (JVMTI_THREAD_STATE_ALIVE \
+ | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER)
+#define JVMTI_JAVA_LANG_THREAD_STATE_WAITING \
+ (JVMTI_THREAD_STATE_ALIVE \
+ | JVMTI_THREAD_STATE_WAITING \
+ | JVMTI_THREAD_STATE_WAITING_INDEFINITELY)
+#define JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING \
+ (JVMTI_THREAD_STATE_ALIVE \
+ | JVMTI_THREAD_STATE_WAITING \
+ | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT)
+
+/* Thread priorities */
+#define JVMTI_THREAD_MIN_PRIORITY 1
+#define JVMTI_THREAD_NORM_PRIORITY 5
+#define JVMTI_THREAD_MAX_PRIORITY 10
+
+/* Keep c-font-lock-extra-types in order: JNI followed by JVMTI,
+ all in alphabetical order */
+/* Local Variables: */
+/* c-font-lock-extra-types: ("\\sw+_t"
+ "JNIEnv" "JNINativeMethod" "JavaVM" "JavaVMOption" "jarray"
+ "jboolean" "jbooleanArray" "jbyte" "jbyteArray" "jchar" "jcharArray"
+ "jclass" "jdouble" "jdoubleArray" "jfieldID" "jfloat" "jfloatArray"
+ "jint" "jintArray" "jlong" "jlongArray" "jmethodID" "jobject" "jstring" "jthrowable"
+ "jvalue" "jweak"
+ "jvmtiEnv" "jvmtiError"
+ "jthread" "jthreadGroup" "jlocation" "jrawMonitorID") */
+/* End: */
+#endif /* !_CLASSPATH_JVMTI_H */
diff --git a/libjava/classpath/lib/.cvsignore b/libjava/classpath/lib/.cvsignore
new file mode 100644
index 00000000000..93f21e77a36
--- /dev/null
+++ b/libjava/classpath/lib/.cvsignore
@@ -0,0 +1,38 @@
+Makefile
+Makefile.in
+com
+gnu
+java
+javax
+kaffe
+classes
+classes.awt
+classes.locale
+classes.locale1
+classes.locale2
+classes.locale
+classes.standard
+classes.standardx
+classes.xml
+glibj.zip
+deps.sh
+gen-classlist.sh
+mkdep.pl
+errors.txt
+headers.dep
+classes.dep
+makefile.dep
+java.dep
+compile-classes
+mkcollections.pl
+gen_nio.sh
+classes.1
+resources
+org
+sun
+META-INF
+Makefile.deps
+lists
+copy-vmresources.sh
+classes.2
+standard.omit
diff --git a/libjava/classpath/lib/Makefile.am b/libjava/classpath/lib/Makefile.am
index e7e2bd83c79..56b85aecc81 100644
--- a/libjava/classpath/lib/Makefile.am
+++ b/libjava/classpath/lib/Makefile.am
@@ -5,20 +5,21 @@ JAVA_DEPEND = java.dep
## this file and restart the make process again
sinclude $(JAVA_DEPEND)
-## GCJ LOCAL: prune .svn directories
-propertydirs := $(shell cd $(top_srcdir)/resource && $(FIND) gnu java javax org META-INF -type d ! -name CVS -print | fgrep -v .svn)
propertyfiles := $(shell cd $(top_srcdir)/resource && $(FIND) gnu java javax org -name \*\.properties -print)
+cssfiles := $(shell cd $(top_srcdir) && $(FIND) gnu java javax org -name \*\.css -print)
+## GCJ LOCAL: prune .svn directories
metafiles := $(shell cd $(top_srcdir)/resource && $(FIND) META-INF -name CVS -prune -o -name \*\.in -prune -o -type f -print | fgrep -v .svn)
## END GCJ LOCAL
iconfiles := $(shell cd $(top_srcdir) && $(FIND) gnu/javax/swing/plaf/gtk/icons -name *.png -type f -print)
-compile_classpath = $(vm_classes):$(top_srcdir):$(top_srcdir)/external/w3c_dom:$(top_srcdir)/external/sax:$(top_srcdir)/external/relaxngDatatype:.:$(USER_CLASSLIB):$(PATH_TO_ESCHER)
+compile_classpath = $(vm_classes):$(top_srcdir):$(top_srcdir)/external/w3c_dom:$(top_srcdir)/external/sax:$(top_srcdir)/external/relaxngDatatype:$(top_srcdir)/external/jsr166:.:$(USER_CLASSLIB):$(PATH_TO_ESCHER)
# handling source to bytecode compiler programs like gcj, jikes and kjc
if FOUND_GCJ
-## This should never be used when gcj is the compiler.
## See the compile-classes target.
-JAVAC = exit 1
+## There's no point in warning, and we always want debug info.
+## GCJ LOCAL: use srcdir
+JAVAC = $(GCJ) -C -g -w --encoding=UTF-8 -bootclasspath '' --classpath $(compile_classpath) -d $(srcdir) @classes
else
if FOUND_JIKES
JAVAC = $(JIKES) $(JIKESWARNINGS) +F $(JIKESENCODING) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(compile_classpath) -d . @classes
@@ -45,11 +46,7 @@ COLLECTIONS = collections.jar
collections.jar: mkcollections.pl
./mkcollections.pl $(top_srcdir)
-if FOUND_GCJ
- $(GCJ) -C `$(FIND) $(COLLECTIONS_PREFIX) -name '*.java' -type f -print`
-else
$(JAVAC) `$(FIND) $(COLLECTIONS_PREFIX) -name '*.java' -type f -print`
-endif
if test "$(FASTJAR)" != ""; then \
$(FASTJAR) cf $@ $(COLLECTIONS_PREFIX); \
else \
@@ -107,22 +104,26 @@ glibj.zip: classes compile-classes resources
endif # USE_PREBUILT_GLIBJ_ZIP
resources: copy-vmresources.sh
- if ! [ -e gnu ]; then mkdir gnu; fi
- if ! [ -e gnu/java ]; then mkdir gnu/java; fi
- if ! [ -e gnu/java/locale ]; then mkdir gnu/java/locale; fi
- if ! [ -e gnu/javax/swing/plaf/gtk/icons ]; then mkdir -p gnu/javax/swing/plaf/gtk/icons; fi
- list='$(propertydirs)'; for p in $$list; do \
- if ! [ -e $$p ]; then mkdir $$p; fi; \
+ @list='$(propertyfiles)'; for p in $$list; do \
+ dirname=`dirname $$p`; \
+ if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
+ cp $(top_srcdir)/resource/$$p $$p; \
done
- list='$(propertyfiles)'; for p in $$list; do \
- cp -f $(top_srcdir)/resource/$$p $$p; \
+ @list='$(cssfiles)'; for p in $$list; do \
+ dirname=`dirname $$p`; \
+ if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
+ cp $(top_srcdir)/$$p $$p; \
done
- list='$(metafiles)'; for p in $$list; do \
- cp -f $(top_srcdir)/resource/$$p $$p; \
+ @list='$(metafiles)'; for p in $$list; do \
+ dirname=`dirname $$p`; \
+ if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
+ cp $(top_srcdir)/resource/$$p $$p; \
done
- $(SHELL) ./copy-vmresources.sh
- list='$(iconfiles)'; for p in $$list; do \
- cp -f $(top_srcdir)/$$p $$p; \
+ @$(SHELL) ./copy-vmresources.sh
+ @list='$(iconfiles)'; for p in $$list; do \
+ dirname=`dirname $$p`; \
+ if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
+ cp $(top_srcdir)/$$p $$p; \
done
touch resources
@@ -152,22 +153,24 @@ endif # REGEN_PARSER
$(JAVA_DEPEND): genclasses
-if FOUND_GCJ
-## When building with gcj, we do a recursive make. We split this rule
-## out specially, rather than simply defining JAVAC, so that GNU make
-## will see the recursive make invocation and still allow parallel
-## builds.
-compile-classes: classes $(JAVA_SRCS) Makefile
- $(MAKE) -f $(srcdir)/Makefile.gcj \
- GCJ='$(GCJ)' \
- compile_classpath='$(top_builddir):$(compile_classpath)' \
- top_srcdir=$(top_srcdir)
- touch compile-classes
-else
+# if FOUND_GCJ
+# ## When building with gcj, we do a recursive make. We split this rule
+# ## out specially, rather than simply defining JAVAC, so that GNU make
+# ## will see the recursive make invocation and still allow parallel
+# ## builds.
+# compile-classes: classes $(JAVA_SRCS) Makefile
+# $(MAKE) -f $(srcdir)/Makefile.gcj \
+# GCJ='$(GCJ)' \
+# compile_classpath='$(top_builddir):$(compile_classpath)' \
+# top_srcdir=$(top_srcdir)
+# touch compile-classes
+# else
compile-classes: classes $(JAVA_SRCS) Makefile
+if JAVA_MAINTAINER_MODE
$(JAVAC)
- touch compile-classes
endif
+ touch compile-classes
+# endif
EXTRA_DIST = standard.omit.in mkcollections.pl.in Makefile.gcj split-for-gcj.sh
CLEANFILES = compile-classes resources classes \
diff --git a/libjava/classpath/lib/Makefile.gcj b/libjava/classpath/lib/Makefile.gcj
index 7bac691e8eb..a7f3027efa6 100644
--- a/libjava/classpath/lib/Makefile.gcj
+++ b/libjava/classpath/lib/Makefile.gcj
@@ -25,7 +25,7 @@ Makefile.deps: classes
-include Makefile.deps $(all_deps_files)
## Like GCJ but include some common flags.
-GCJF = $(GCJ) -Wno-deprecated --encoding=UTF-8 \
+GCJF = $(GCJ) -fsource=1.5 -ftarget=1.5 -g -Wno-deprecated --encoding=UTF-8 \
--bootclasspath '' --classpath $(compile_classpath) \
-C -d .
diff --git a/libjava/classpath/lib/Makefile.in b/libjava/classpath/lib/Makefile.in
index bcc76110a6a..759cead840b 100644
--- a/libjava/classpath/lib/Makefile.in
+++ b/libjava/classpath/lib/Makefile.in
@@ -44,12 +44,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -162,6 +164,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -283,24 +287,24 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
JAVA_DEPEND = java.dep
-propertydirs := $(shell cd $(top_srcdir)/resource && $(FIND) gnu java javax org META-INF -type d ! -name CVS -print | fgrep -v .svn)
propertyfiles := $(shell cd $(top_srcdir)/resource && $(FIND) gnu java javax org -name \*\.properties -print)
+cssfiles := $(shell cd $(top_srcdir) && $(FIND) gnu java javax org -name \*\.css -print)
metafiles := $(shell cd $(top_srcdir)/resource && $(FIND) META-INF -name CVS -prune -o -name \*\.in -prune -o -type f -print | fgrep -v .svn)
iconfiles := $(shell cd $(top_srcdir) && $(FIND) gnu/javax/swing/plaf/gtk/icons -name *.png -type f -print)
-compile_classpath = $(vm_classes):$(top_srcdir):$(top_srcdir)/external/w3c_dom:$(top_srcdir)/external/sax:$(top_srcdir)/external/relaxngDatatype:.:$(USER_CLASSLIB):$(PATH_TO_ESCHER)
+compile_classpath = $(vm_classes):$(top_srcdir):$(top_srcdir)/external/w3c_dom:$(top_srcdir)/external/sax:$(top_srcdir)/external/relaxngDatatype:$(top_srcdir)/external/jsr166:.:$(USER_CLASSLIB):$(PATH_TO_ESCHER)
@FOUND_ECJ_TRUE@@FOUND_GCJX_FALSE@@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@@FOUND_KJC_FALSE@JAVAC = $(ECJ) -source 1.4 -encoding UTF-8 -warn:-deprecation,serial,unused -proceedOnError -bootclasspath '' -classpath $(compile_classpath) -d . @classes
@FOUND_GCJX_TRUE@@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@@FOUND_KJC_FALSE@JAVAC = $(GCJX) -g -encoding UTF-8 -classpath .:$(USER_CLASSLIB) -d . @classes
@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@@FOUND_KJC_TRUE@JAVAC = $(KJC) -classpath .:$(USER_CLASSLIB) -d . @classes
@FOUND_GCJ_FALSE@@FOUND_JIKES_TRUE@JAVAC = $(JIKES) $(JIKESWARNINGS) +F $(JIKESENCODING) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(compile_classpath) -d . @classes
# handling source to bytecode compiler programs like gcj, jikes and kjc
-@FOUND_GCJ_TRUE@JAVAC = exit 1
+@FOUND_GCJ_TRUE@JAVAC = $(GCJ) -C -g -w --encoding=UTF-8 -bootclasspath '' --classpath $(compile_classpath) -d $(srcdir) @classes
JAVAH = $(USER_JAVAH) -jni -classpath .:$(USER_CLASSLIB)
@CREATE_COLLECTIONS_TRUE@COLLECTIONS = collections.jar
@BUILD_CLASS_FILES_TRUE@noinst_DATA = genclasses compile-classes resources
+# endif
EXTRA_DIST = standard.omit.in mkcollections.pl.in Makefile.gcj split-for-gcj.sh
CLEANFILES = compile-classes resources classes \
glibj.zip classes.1 classes.2 Makefile.deps \
@@ -487,8 +491,7 @@ sinclude $(JAVA_DEPEND)
@CREATE_COLLECTIONS_TRUE@collections.jar: mkcollections.pl
@CREATE_COLLECTIONS_TRUE@ ./mkcollections.pl $(top_srcdir)
-@CREATE_COLLECTIONS_TRUE@@FOUND_GCJ_TRUE@ $(GCJ) -C `$(FIND) $(COLLECTIONS_PREFIX) -name '*.java' -type f -print`
-@CREATE_COLLECTIONS_TRUE@@FOUND_GCJ_FALSE@ $(JAVAC) `$(FIND) $(COLLECTIONS_PREFIX) -name '*.java' -type f -print`
+@CREATE_COLLECTIONS_TRUE@ $(JAVAC) `$(FIND) $(COLLECTIONS_PREFIX) -name '*.java' -type f -print`
@CREATE_COLLECTIONS_TRUE@ if test "$(FASTJAR)" != ""; then \
@CREATE_COLLECTIONS_TRUE@ $(FASTJAR) cf $@ $(COLLECTIONS_PREFIX); \
@CREATE_COLLECTIONS_TRUE@ else \
@@ -523,22 +526,26 @@ sinclude $(JAVA_DEPEND)
@USE_PREBUILT_GLIBJ_ZIP_FALSE@ if test "$(FASTJAR)" != ""; then $(FASTJAR) cf glibj.zip gnu java javax org sun META-INF; fi
resources: copy-vmresources.sh
- if ! [ -e gnu ]; then mkdir gnu; fi
- if ! [ -e gnu/java ]; then mkdir gnu/java; fi
- if ! [ -e gnu/java/locale ]; then mkdir gnu/java/locale; fi
- if ! [ -e gnu/javax/swing/plaf/gtk/icons ]; then mkdir -p gnu/javax/swing/plaf/gtk/icons; fi
- list='$(propertydirs)'; for p in $$list; do \
- if ! [ -e $$p ]; then mkdir $$p; fi; \
+ @list='$(propertyfiles)'; for p in $$list; do \
+ dirname=`dirname $$p`; \
+ if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
+ cp $(top_srcdir)/resource/$$p $$p; \
done
- list='$(propertyfiles)'; for p in $$list; do \
- cp -f $(top_srcdir)/resource/$$p $$p; \
+ @list='$(cssfiles)'; for p in $$list; do \
+ dirname=`dirname $$p`; \
+ if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
+ cp $(top_srcdir)/$$p $$p; \
done
- list='$(metafiles)'; for p in $$list; do \
- cp -f $(top_srcdir)/resource/$$p $$p; \
+ @list='$(metafiles)'; for p in $$list; do \
+ dirname=`dirname $$p`; \
+ if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
+ cp $(top_srcdir)/resource/$$p $$p; \
done
- $(SHELL) ./copy-vmresources.sh
- list='$(iconfiles)'; for p in $$list; do \
- cp -f $(top_srcdir)/$$p $$p; \
+ @$(SHELL) ./copy-vmresources.sh
+ @list='$(iconfiles)'; for p in $$list; do \
+ dirname=`dirname $$p`; \
+ if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
+ cp $(top_srcdir)/$$p $$p; \
done
touch resources
@@ -564,15 +571,21 @@ genclasses: gen-classlist.sh standard.omit $(top_builddir)/gnu/java/locale/Local
$(JAVA_DEPEND): genclasses
-@FOUND_GCJ_TRUE@compile-classes: classes $(JAVA_SRCS) Makefile
-@FOUND_GCJ_TRUE@ $(MAKE) -f $(srcdir)/Makefile.gcj \
-@FOUND_GCJ_TRUE@ GCJ='$(GCJ)' \
-@FOUND_GCJ_TRUE@ compile_classpath='$(top_builddir):$(compile_classpath)' \
-@FOUND_GCJ_TRUE@ top_srcdir=$(top_srcdir)
-@FOUND_GCJ_TRUE@ touch compile-classes
-@FOUND_GCJ_FALSE@compile-classes: classes $(JAVA_SRCS) Makefile
-@FOUND_GCJ_FALSE@ $(JAVAC)
-@FOUND_GCJ_FALSE@ touch compile-classes
+# if FOUND_GCJ
+# ## When building with gcj, we do a recursive make. We split this rule
+# ## out specially, rather than simply defining JAVAC, so that GNU make
+# ## will see the recursive make invocation and still allow parallel
+# ## builds.
+# compile-classes: classes $(JAVA_SRCS) Makefile
+# $(MAKE) -f $(srcdir)/Makefile.gcj \
+# GCJ='$(GCJ)' \
+# compile_classpath='$(top_builddir):$(compile_classpath)' \
+# top_srcdir=$(top_srcdir)
+# touch compile-classes
+# else
+compile-classes: classes $(JAVA_SRCS) Makefile
+@JAVA_MAINTAINER_MODE_TRUE@ $(JAVAC)
+ touch compile-classes
clean-local:
-rm -rf gnu
diff --git a/libjava/classpath/lib/gen-classlist.sh.in b/libjava/classpath/lib/gen-classlist.sh.in
index 1d38956ddcb..1c704116b19 100755
--- a/libjava/classpath/lib/gen-classlist.sh.in
+++ b/libjava/classpath/lib/gen-classlist.sh.in
@@ -25,15 +25,22 @@ echo "Adding java source files from srcdir '@top_srcdir@'."
done) > ${top_builddir}/lib/classes.1
# The same, but for the external code.
-# Right now all external code is in org/.
-for dir in @top_srcdir@/external/w3c_dom \
- @top_srcdir@/external/sax @top_srcdir@/external/relaxngDatatype; do
- (cd $dir
- @FIND@ org -follow -name '*.java' -print |
- sort -r | sed -e 's,/\([^/]*\)$, \1,' |
- while read pkg file; do
- echo $pkg $dir $pkg/$file
- done)
+for dir in \
+ @top_srcdir@/external/w3c_dom \
+ @top_srcdir@/external/sax \
+ @top_srcdir@/external/relaxngDatatype \
+ @top_srcdir@/external/jsr166 \
+ ; do
+ (cd $dir
+ for subdir in java javax gnu org sun; do
+ if test -d $subdir; then
+ @FIND@ $subdir -follow -name '*.java' -print |
+ sort -r | sed -e 's,/\([^/]*\)$, \1,' |
+ while read pkg file; do
+ echo $pkg $dir $pkg/$file
+ done
+ fi
+ done)
done >> ${top_builddir}/lib/classes.1
# Generate files for the VM classes.
@@ -55,7 +62,9 @@ for dir in $vm_dirlist; do
done
# Only include generated files once.
-if test ! "${top_builddir}" -ef "@top_srcdir@"; then
+abs_top_builddir=`cd "${top_builddir}"; pwd`
+abs_top_srcdir=`cd "@top_srcdir@"; pwd`
+if test "$abs_top_builddir" != "$abs_top_srcdir"; then
echo "Adding generated files in builddir '${top_builddir}'."
# Currently the only generated files are in gnu.*.
(cd ${top_builddir}; @FIND@ gnu -follow -name '*.java' -print) |
@@ -95,7 +104,7 @@ rm vm.add
rm tmp.omit
new=
-if test -e ${top_builddir}/lib/classes.2; then
+if test -f ${top_builddir}/lib/classes.2; then
p=`diff ${top_builddir}/lib/classes.2 ${top_builddir}/lib/classes.1`
if test "$p" != ""; then
new="true"
diff --git a/libjava/classpath/lib/gnu/CORBA/Asynchron.class b/libjava/classpath/lib/gnu/CORBA/Asynchron.class
new file mode 100644
index 00000000000..785a3af53d2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Asynchron.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/BigDecimalHelper.class b/libjava/classpath/lib/gnu/CORBA/BigDecimalHelper.class
new file mode 100644
index 00000000000..89e1b94e81e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/BigDecimalHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/ByteArrayComparator.class b/libjava/classpath/lib/gnu/CORBA/ByteArrayComparator.class
new file mode 100644
index 00000000000..85adfcd3b6e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/ByteArrayComparator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/AbstractCdrInput.class b/libjava/classpath/lib/gnu/CORBA/CDR/AbstractCdrInput.class
new file mode 100644
index 00000000000..74cf0f95395
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/AbstractCdrInput.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/AbstractCdrOutput.class b/libjava/classpath/lib/gnu/CORBA/CDR/AbstractCdrOutput.class
new file mode 100644
index 00000000000..3da6e965b73
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/AbstractCdrOutput.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/AbstractDataInput.class b/libjava/classpath/lib/gnu/CORBA/CDR/AbstractDataInput.class
new file mode 100644
index 00000000000..b14322c5b44
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/AbstractDataInput.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/AbstractDataOutput.class b/libjava/classpath/lib/gnu/CORBA/CDR/AbstractDataOutput.class
new file mode 100644
index 00000000000..0a266486edc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/AbstractDataOutput.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/AligningInput.class b/libjava/classpath/lib/gnu/CORBA/CDR/AligningInput.class
new file mode 100644
index 00000000000..90eeba64f5e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/AligningInput.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/AligningOutput.class b/libjava/classpath/lib/gnu/CORBA/CDR/AligningOutput.class
new file mode 100644
index 00000000000..1c08c43371c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/AligningOutput.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/ArrayValueHelper.class b/libjava/classpath/lib/gnu/CORBA/CDR/ArrayValueHelper.class
new file mode 100644
index 00000000000..d23c17b4b31
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/ArrayValueHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/BigEndianInputStream.class b/libjava/classpath/lib/gnu/CORBA/CDR/BigEndianInputStream.class
new file mode 100644
index 00000000000..7d6f7925c55
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/BigEndianInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/BigEndianOutputStream.class b/libjava/classpath/lib/gnu/CORBA/CDR/BigEndianOutputStream.class
new file mode 100644
index 00000000000..2481c133870
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/BigEndianOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/BufferedCdrOutput.class b/libjava/classpath/lib/gnu/CORBA/CDR/BufferedCdrOutput.class
new file mode 100644
index 00000000000..e0a737cd530
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/BufferedCdrOutput.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/BufferredCdrInput.class b/libjava/classpath/lib/gnu/CORBA/CDR/BufferredCdrInput.class
new file mode 100644
index 00000000000..d44536091c2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/BufferredCdrInput.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/EncapsulationStream.class b/libjava/classpath/lib/gnu/CORBA/CDR/EncapsulationStream.class
new file mode 100644
index 00000000000..15c7a8ecf85
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/EncapsulationStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/HeadlessInput.class b/libjava/classpath/lib/gnu/CORBA/CDR/HeadlessInput.class
new file mode 100644
index 00000000000..ad9579001d7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/HeadlessInput.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/IDLTypeHelper.class b/libjava/classpath/lib/gnu/CORBA/CDR/IDLTypeHelper.class
new file mode 100644
index 00000000000..c1a861d58e5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/IDLTypeHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/LittleEndianInputStream.class b/libjava/classpath/lib/gnu/CORBA/CDR/LittleEndianInputStream.class
new file mode 100644
index 00000000000..c6cfcd242a2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/LittleEndianInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/LittleEndianOutputStream.class b/libjava/classpath/lib/gnu/CORBA/CDR/LittleEndianOutputStream.class
new file mode 100644
index 00000000000..68855f67040
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/LittleEndianOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/UnknownExceptionCtxHandler.class b/libjava/classpath/lib/gnu/CORBA/CDR/UnknownExceptionCtxHandler.class
new file mode 100644
index 00000000000..d778d0d3781
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/UnknownExceptionCtxHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/VMVio.class b/libjava/classpath/lib/gnu/CORBA/CDR/VMVio.class
new file mode 100644
index 00000000000..45ca509ccc8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/VMVio.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/Vio.class b/libjava/classpath/lib/gnu/CORBA/CDR/Vio.class
new file mode 100644
index 00000000000..1d738de5f76
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/Vio.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime$1.class b/libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime$1.class
new file mode 100644
index 00000000000..5df83dc7498
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime$Entry.class b/libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime$Entry.class
new file mode 100644
index 00000000000..2ed828f2daf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime$Entry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime$Redirection.class b/libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime$Redirection.class
new file mode 100644
index 00000000000..c449d002b2b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime$Redirection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime.class b/libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime.class
new file mode 100644
index 00000000000..3744aa0fc1c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/gnuRuntime.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CDR/gnuValueStream.class b/libjava/classpath/lib/gnu/CORBA/CDR/gnuValueStream.class
new file mode 100644
index 00000000000..7d2de8d74ce
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CDR/gnuValueStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CdrEncapsCodecImpl.class b/libjava/classpath/lib/gnu/CORBA/CdrEncapsCodecImpl.class
new file mode 100644
index 00000000000..57fcd54ea81
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CdrEncapsCodecImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CollocatedOrbs.class b/libjava/classpath/lib/gnu/CORBA/CollocatedOrbs.class
new file mode 100644
index 00000000000..87c0b3f3b17
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CollocatedOrbs.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Connected_objects$cObject.class b/libjava/classpath/lib/gnu/CORBA/Connected_objects$cObject.class
new file mode 100644
index 00000000000..c99cb850ce1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Connected_objects$cObject.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Connected_objects.class b/libjava/classpath/lib/gnu/CORBA/Connected_objects.class
new file mode 100644
index 00000000000..4cbca85bad8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Connected_objects.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/CorbaList.class b/libjava/classpath/lib/gnu/CORBA/CorbaList.class
new file mode 100644
index 00000000000..3a72c1398ab
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/CorbaList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DefaultSocketFactory.class b/libjava/classpath/lib/gnu/CORBA/DefaultSocketFactory.class
new file mode 100644
index 00000000000..bab1e26a908
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DefaultSocketFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DefinitionKindHolder.class b/libjava/classpath/lib/gnu/CORBA/DefinitionKindHolder.class
new file mode 100644
index 00000000000..1213b2a4042
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DefinitionKindHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DuplicateNameHolder.class b/libjava/classpath/lib/gnu/CORBA/DuplicateNameHolder.class
new file mode 100644
index 00000000000..c4141074d02
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DuplicateNameHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/AbstractAny.class b/libjava/classpath/lib/gnu/CORBA/DynAn/AbstractAny.class
new file mode 100644
index 00000000000..100fea31919
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/AbstractAny.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/DivideableAny.class b/libjava/classpath/lib/gnu/CORBA/DynAn/DivideableAny.class
new file mode 100644
index 00000000000..a2b42881116
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/DivideableAny.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/NameValuePairHolder.class b/libjava/classpath/lib/gnu/CORBA/DynAn/NameValuePairHolder.class
new file mode 100644
index 00000000000..abe1f1023de
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/NameValuePairHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/RecordAny.class b/libjava/classpath/lib/gnu/CORBA/DynAn/RecordAny.class
new file mode 100644
index 00000000000..6afb7ebcc17
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/RecordAny.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/UndivideableAny.class b/libjava/classpath/lib/gnu/CORBA/DynAn/UndivideableAny.class
new file mode 100644
index 00000000000..70cf1771b8b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/UndivideableAny.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/ValueChangeListener.class b/libjava/classpath/lib/gnu/CORBA/DynAn/ValueChangeListener.class
new file mode 100644
index 00000000000..a6802178d73
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/ValueChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynAny.class b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynAny.class
new file mode 100644
index 00000000000..1c780c76985
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynAny.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynAnyFactory.class b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynAnyFactory.class
new file mode 100644
index 00000000000..0be01daf51c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynAnyFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynArray.class b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynArray.class
new file mode 100644
index 00000000000..56c73a613ac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynArray.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynEnum.class b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynEnum.class
new file mode 100644
index 00000000000..930e78e1551
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynEnum.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynFixed.class b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynFixed.class
new file mode 100644
index 00000000000..1f4a2e63468
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynFixed.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynSequence.class b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynSequence.class
new file mode 100644
index 00000000000..3ec77c4f276
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynSequence.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynStruct.class b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynStruct.class
new file mode 100644
index 00000000000..d2fd7db4197
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynStruct.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynUnion.class b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynUnion.class
new file mode 100644
index 00000000000..5e7f599bef1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynUnion.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynValue.class b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynValue.class
new file mode 100644
index 00000000000..7389fb9ea8a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynValue.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynValueBox.class b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynValueBox.class
new file mode 100644
index 00000000000..259cfea1302
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAn/gnuDynValueBox.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/DynAnySeqHolder.class b/libjava/classpath/lib/gnu/CORBA/DynAnySeqHolder.class
new file mode 100644
index 00000000000..7d7590257e7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/DynAnySeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/EmptyExceptionHolder.class b/libjava/classpath/lib/gnu/CORBA/EmptyExceptionHolder.class
new file mode 100644
index 00000000000..af7cb100bc7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/EmptyExceptionHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/ForwardRequestHelper.class b/libjava/classpath/lib/gnu/CORBA/ForwardRequestHelper.class
new file mode 100644
index 00000000000..24582ca8e88
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/ForwardRequestHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/CancelHeader.class b/libjava/classpath/lib/gnu/CORBA/GIOP/CancelHeader.class
new file mode 100644
index 00000000000..748d3a8cdb1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/CancelHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/CharSets_OSF.class b/libjava/classpath/lib/gnu/CORBA/GIOP/CharSets_OSF.class
new file mode 100644
index 00000000000..ed33648bc78
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/CharSets_OSF.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/CloseMessage.class b/libjava/classpath/lib/gnu/CORBA/GIOP/CloseMessage.class
new file mode 100644
index 00000000000..d3cee3137c7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/CloseMessage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/CodeSetServiceContext.class b/libjava/classpath/lib/gnu/CORBA/GIOP/CodeSetServiceContext.class
new file mode 100644
index 00000000000..b78c989ce41
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/CodeSetServiceContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/ContextHandler.class b/libjava/classpath/lib/gnu/CORBA/GIOP/ContextHandler.class
new file mode 100644
index 00000000000..63d4ba20655
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/ContextHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/ErrorMessage.class b/libjava/classpath/lib/gnu/CORBA/GIOP/ErrorMessage.class
new file mode 100644
index 00000000000..a30c1d8ed62
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/ErrorMessage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/MessageHeader.class b/libjava/classpath/lib/gnu/CORBA/GIOP/MessageHeader.class
new file mode 100644
index 00000000000..35147ecbaab
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/MessageHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/ReplyHeader.class b/libjava/classpath/lib/gnu/CORBA/GIOP/ReplyHeader.class
new file mode 100644
index 00000000000..941eb2e4b97
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/ReplyHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/RequestHeader.class b/libjava/classpath/lib/gnu/CORBA/GIOP/RequestHeader.class
new file mode 100644
index 00000000000..21fdb446625
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/RequestHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/ServiceContext.class b/libjava/classpath/lib/gnu/CORBA/GIOP/ServiceContext.class
new file mode 100644
index 00000000000..e7dbebf424d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/ServiceContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/v1_0/CancelHeader.class b/libjava/classpath/lib/gnu/CORBA/GIOP/v1_0/CancelHeader.class
new file mode 100644
index 00000000000..41b8e764778
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/v1_0/CancelHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/v1_0/ReplyHeader.class b/libjava/classpath/lib/gnu/CORBA/GIOP/v1_0/ReplyHeader.class
new file mode 100644
index 00000000000..37f52f82a02
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/v1_0/ReplyHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/v1_0/RequestHeader.class b/libjava/classpath/lib/gnu/CORBA/GIOP/v1_0/RequestHeader.class
new file mode 100644
index 00000000000..9bcc7b4bfa6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/v1_0/RequestHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/v1_2/ReplyHeader.class b/libjava/classpath/lib/gnu/CORBA/GIOP/v1_2/ReplyHeader.class
new file mode 100644
index 00000000000..3d7f81d01b6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/v1_2/ReplyHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GIOP/v1_2/RequestHeader.class b/libjava/classpath/lib/gnu/CORBA/GIOP/v1_2/RequestHeader.class
new file mode 100644
index 00000000000..76603214d10
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GIOP/v1_2/RequestHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/GeneralHolder.class b/libjava/classpath/lib/gnu/CORBA/GeneralHolder.class
new file mode 100644
index 00000000000..290badb06fc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/GeneralHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/HolderLocator.class b/libjava/classpath/lib/gnu/CORBA/HolderLocator.class
new file mode 100644
index 00000000000..b9a3bc177b4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/HolderLocator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/IOR$CodeSets_profile$CodeSet_component.class b/libjava/classpath/lib/gnu/CORBA/IOR$CodeSets_profile$CodeSet_component.class
new file mode 100644
index 00000000000..3be7042133e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/IOR$CodeSets_profile$CodeSet_component.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/IOR$CodeSets_profile.class b/libjava/classpath/lib/gnu/CORBA/IOR$CodeSets_profile.class
new file mode 100644
index 00000000000..ffdb1728b26
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/IOR$CodeSets_profile.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/IOR$Internet_profile.class b/libjava/classpath/lib/gnu/CORBA/IOR$Internet_profile.class
new file mode 100644
index 00000000000..d3fdd4a89fc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/IOR$Internet_profile.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/IOR.class b/libjava/classpath/lib/gnu/CORBA/IOR.class
new file mode 100644
index 00000000000..b67542dc393
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/IOR.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Interceptor/ClientRequestInterceptors.class b/libjava/classpath/lib/gnu/CORBA/Interceptor/ClientRequestInterceptors.class
new file mode 100644
index 00000000000..b7a849ec286
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Interceptor/ClientRequestInterceptors.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Interceptor/ForwardRequestHolder.class b/libjava/classpath/lib/gnu/CORBA/Interceptor/ForwardRequestHolder.class
new file mode 100644
index 00000000000..f9f78ebfc5e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Interceptor/ForwardRequestHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Interceptor/IORInterceptors.class b/libjava/classpath/lib/gnu/CORBA/Interceptor/IORInterceptors.class
new file mode 100644
index 00000000000..b6eda9e7fe0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Interceptor/IORInterceptors.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Interceptor/Registrator.class b/libjava/classpath/lib/gnu/CORBA/Interceptor/Registrator.class
new file mode 100644
index 00000000000..1b2bea62185
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Interceptor/Registrator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Interceptor/ServerRequestInterceptors.class b/libjava/classpath/lib/gnu/CORBA/Interceptor/ServerRequestInterceptors.class
new file mode 100644
index 00000000000..1bc41867ded
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Interceptor/ServerRequestInterceptors.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Interceptor/gnuClientRequestInfo.class b/libjava/classpath/lib/gnu/CORBA/Interceptor/gnuClientRequestInfo.class
new file mode 100644
index 00000000000..5dcc95643c3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Interceptor/gnuClientRequestInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Interceptor/gnuIcCurrent.class b/libjava/classpath/lib/gnu/CORBA/Interceptor/gnuIcCurrent.class
new file mode 100644
index 00000000000..e7664a351a1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Interceptor/gnuIcCurrent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Interceptor/gnuIorInfo.class b/libjava/classpath/lib/gnu/CORBA/Interceptor/gnuIorInfo.class
new file mode 100644
index 00000000000..9cf539697c6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Interceptor/gnuIorInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Interceptor/gnuServerRequestInfo.class b/libjava/classpath/lib/gnu/CORBA/Interceptor/gnuServerRequestInfo.class
new file mode 100644
index 00000000000..2331a17ff6c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Interceptor/gnuServerRequestInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/IorDelegate.class b/libjava/classpath/lib/gnu/CORBA/IorDelegate.class
new file mode 100644
index 00000000000..f7c29adc237
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/IorDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/IorObject.class b/libjava/classpath/lib/gnu/CORBA/IorObject.class
new file mode 100644
index 00000000000..b0415f7e67d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/IorObject.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/IorProvider.class b/libjava/classpath/lib/gnu/CORBA/IorProvider.class
new file mode 100644
index 00000000000..2d47a20a749
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/IorProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Minor.class b/libjava/classpath/lib/gnu/CORBA/Minor.class
new file mode 100644
index 00000000000..0ffafd84214
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Minor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/NameDynAnyPairHolder.class b/libjava/classpath/lib/gnu/CORBA/NameDynAnyPairHolder.class
new file mode 100644
index 00000000000..711d8ddf4f5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/NameDynAnyPairHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/NameDynAnyPairSeqHolder.class b/libjava/classpath/lib/gnu/CORBA/NameDynAnyPairSeqHolder.class
new file mode 100644
index 00000000000..c68ffa75e33
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/NameDynAnyPairSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/NameValuePairHolder.class b/libjava/classpath/lib/gnu/CORBA/NameValuePairHolder.class
new file mode 100644
index 00000000000..c62639ddcd7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/NameValuePairHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/NameValuePairSeqHolder.class b/libjava/classpath/lib/gnu/CORBA/NameValuePairSeqHolder.class
new file mode 100644
index 00000000000..ccd69b05741
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/NameValuePairSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/NamingService/Binding_iterator_impl.class b/libjava/classpath/lib/gnu/CORBA/NamingService/Binding_iterator_impl.class
new file mode 100644
index 00000000000..699ecaa221b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/NamingService/Binding_iterator_impl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/NamingService/Ext.class b/libjava/classpath/lib/gnu/CORBA/NamingService/Ext.class
new file mode 100644
index 00000000000..b94a7ff4de7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/NamingService/Ext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/NamingService/NameComponentComparator.class b/libjava/classpath/lib/gnu/CORBA/NamingService/NameComponentComparator.class
new file mode 100644
index 00000000000..5b06b4528c9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/NamingService/NameComponentComparator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/NamingService/NameParser.class b/libjava/classpath/lib/gnu/CORBA/NamingService/NameParser.class
new file mode 100644
index 00000000000..0cf077e89f4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/NamingService/NameParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/NamingService/NameTransformer.class b/libjava/classpath/lib/gnu/CORBA/NamingService/NameTransformer.class
new file mode 100644
index 00000000000..a65900972fe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/NamingService/NameTransformer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/NamingService/NameValidator.class b/libjava/classpath/lib/gnu/CORBA/NamingService/NameValidator.class
new file mode 100644
index 00000000000..ffef004b468
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/NamingService/NameValidator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/NamingService/NamingMap.class b/libjava/classpath/lib/gnu/CORBA/NamingService/NamingMap.class
new file mode 100644
index 00000000000..d82940a577b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/NamingService/NamingMap.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/NamingService/NamingServiceTransient$1.class b/libjava/classpath/lib/gnu/CORBA/NamingService/NamingServiceTransient$1.class
new file mode 100644
index 00000000000..4694671cb6f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/NamingService/NamingServiceTransient$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/NamingService/NamingServiceTransient.class b/libjava/classpath/lib/gnu/CORBA/NamingService/NamingServiceTransient.class
new file mode 100644
index 00000000000..4037d10712b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/NamingService/NamingServiceTransient.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/NamingService/TransientContext.class b/libjava/classpath/lib/gnu/CORBA/NamingService/TransientContext.class
new file mode 100644
index 00000000000..1495c4a9522
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/NamingService/TransientContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/ObjectCreator.class b/libjava/classpath/lib/gnu/CORBA/ObjectCreator.class
new file mode 100644
index 00000000000..4e97ba909b2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/ObjectCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/OctetHolder.class b/libjava/classpath/lib/gnu/CORBA/OctetHolder.class
new file mode 100644
index 00000000000..c3dd57adeac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/OctetHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/OrbFocused.class b/libjava/classpath/lib/gnu/CORBA/OrbFocused.class
new file mode 100644
index 00000000000..153005bc56f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/OrbFocused.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/OrbFunctional$1.class b/libjava/classpath/lib/gnu/CORBA/OrbFunctional$1.class
new file mode 100644
index 00000000000..2b33d364c38
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/OrbFunctional$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/OrbFunctional$2.class b/libjava/classpath/lib/gnu/CORBA/OrbFunctional$2.class
new file mode 100644
index 00000000000..bfe897d2bf4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/OrbFunctional$2.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/OrbFunctional$portServer.class b/libjava/classpath/lib/gnu/CORBA/OrbFunctional$portServer.class
new file mode 100644
index 00000000000..459e5c35656
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/OrbFunctional$portServer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/OrbFunctional$sharedPortServer.class b/libjava/classpath/lib/gnu/CORBA/OrbFunctional$sharedPortServer.class
new file mode 100644
index 00000000000..73f76bdec5e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/OrbFunctional$sharedPortServer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/OrbFunctional.class b/libjava/classpath/lib/gnu/CORBA/OrbFunctional.class
new file mode 100644
index 00000000000..ce4038d40fa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/OrbFunctional.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/OrbRestricted.class b/libjava/classpath/lib/gnu/CORBA/OrbRestricted.class
new file mode 100644
index 00000000000..0b91fe4d4a0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/OrbRestricted.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/AOM$Obj.class b/libjava/classpath/lib/gnu/CORBA/Poa/AOM$Obj.class
new file mode 100644
index 00000000000..aca1817574e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/AOM$Obj.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/AOM.class b/libjava/classpath/lib/gnu/CORBA/Poa/AOM.class
new file mode 100644
index 00000000000..c361b7d1129
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/AOM.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/AccessiblePolicy.class b/libjava/classpath/lib/gnu/CORBA/Poa/AccessiblePolicy.class
new file mode 100644
index 00000000000..f16a829eca8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/AccessiblePolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/DynamicImpHandler.class b/libjava/classpath/lib/gnu/CORBA/Poa/DynamicImpHandler.class
new file mode 100644
index 00000000000..cacffe68c24
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/DynamicImpHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/ForwardRequestHolder.class b/libjava/classpath/lib/gnu/CORBA/Poa/ForwardRequestHolder.class
new file mode 100644
index 00000000000..3fd93be8051
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/ForwardRequestHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/ForwardedServant.class b/libjava/classpath/lib/gnu/CORBA/Poa/ForwardedServant.class
new file mode 100644
index 00000000000..c1a615436e2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/ForwardedServant.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/InvalidPolicyHolder.class b/libjava/classpath/lib/gnu/CORBA/Poa/InvalidPolicyHolder.class
new file mode 100644
index 00000000000..24af65c0af4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/InvalidPolicyHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/LocalDelegate.class b/libjava/classpath/lib/gnu/CORBA/Poa/LocalDelegate.class
new file mode 100644
index 00000000000..23b18895966
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/LocalDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/LocalRequest.class b/libjava/classpath/lib/gnu/CORBA/Poa/LocalRequest.class
new file mode 100644
index 00000000000..5c46cd7fcd7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/LocalRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/LocalServerRequest.class b/libjava/classpath/lib/gnu/CORBA/Poa/LocalServerRequest.class
new file mode 100644
index 00000000000..ff4005a7940
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/LocalServerRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/ORB_1_4.class b/libjava/classpath/lib/gnu/CORBA/Poa/ORB_1_4.class
new file mode 100644
index 00000000000..380a3915055
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/ORB_1_4.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/ServantDelegateImpl.class b/libjava/classpath/lib/gnu/CORBA/Poa/ServantDelegateImpl.class
new file mode 100644
index 00000000000..0f99e142800
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/ServantDelegateImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/StandardPolicies.class b/libjava/classpath/lib/gnu/CORBA/Poa/StandardPolicies.class
new file mode 100644
index 00000000000..8401d6130eb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/StandardPolicies.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/gnuAdapterActivator.class b/libjava/classpath/lib/gnu/CORBA/Poa/gnuAdapterActivator.class
new file mode 100644
index 00000000000..5443062282b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/gnuAdapterActivator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/gnuForwardRequest.class b/libjava/classpath/lib/gnu/CORBA/Poa/gnuForwardRequest.class
new file mode 100644
index 00000000000..d916d35d716
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/gnuForwardRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/gnuIdAssignmentPolicy.class b/libjava/classpath/lib/gnu/CORBA/Poa/gnuIdAssignmentPolicy.class
new file mode 100644
index 00000000000..990e51d4286
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/gnuIdAssignmentPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/gnuIdUniquenessPolicy.class b/libjava/classpath/lib/gnu/CORBA/Poa/gnuIdUniquenessPolicy.class
new file mode 100644
index 00000000000..7d6696a160f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/gnuIdUniquenessPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/gnuImplicitActivationPolicy.class b/libjava/classpath/lib/gnu/CORBA/Poa/gnuImplicitActivationPolicy.class
new file mode 100644
index 00000000000..80c09ade818
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/gnuImplicitActivationPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/gnuLifespanPolicy.class b/libjava/classpath/lib/gnu/CORBA/Poa/gnuLifespanPolicy.class
new file mode 100644
index 00000000000..5864cdf75c4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/gnuLifespanPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA$RefTemplate.class b/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA$RefTemplate.class
new file mode 100644
index 00000000000..fa7a1412bd2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA$RefTemplate.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA.class b/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA.class
new file mode 100644
index 00000000000..9a94dd328ff
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOAManager.class b/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOAManager.class
new file mode 100644
index 00000000000..8881d5db133
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/gnuPOAManager.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/gnuPoaCurrent.class b/libjava/classpath/lib/gnu/CORBA/Poa/gnuPoaCurrent.class
new file mode 100644
index 00000000000..8de62d0b68e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/gnuPoaCurrent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/gnuRequestProcessingPolicy.class b/libjava/classpath/lib/gnu/CORBA/Poa/gnuRequestProcessingPolicy.class
new file mode 100644
index 00000000000..0fc5ba4a1cc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/gnuRequestProcessingPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/gnuServantObject.class b/libjava/classpath/lib/gnu/CORBA/Poa/gnuServantObject.class
new file mode 100644
index 00000000000..56b89a3a0a7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/gnuServantObject.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/gnuServantRetentionPolicy.class b/libjava/classpath/lib/gnu/CORBA/Poa/gnuServantRetentionPolicy.class
new file mode 100644
index 00000000000..40865eb8d26
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/gnuServantRetentionPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Poa/gnuThreadPolicy.class b/libjava/classpath/lib/gnu/CORBA/Poa/gnuThreadPolicy.class
new file mode 100644
index 00000000000..bae7864c16c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Poa/gnuThreadPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/RawReply.class b/libjava/classpath/lib/gnu/CORBA/RawReply.class
new file mode 100644
index 00000000000..097a106907d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/RawReply.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/ResponseHandlerImpl.class b/libjava/classpath/lib/gnu/CORBA/ResponseHandlerImpl.class
new file mode 100644
index 00000000000..96a4b576bcd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/ResponseHandlerImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/SafeForDirectCalls.class b/libjava/classpath/lib/gnu/CORBA/SafeForDirectCalls.class
new file mode 100644
index 00000000000..d3fbd82b5cb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/SafeForDirectCalls.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/ServiceDetailHolder.class b/libjava/classpath/lib/gnu/CORBA/ServiceDetailHolder.class
new file mode 100644
index 00000000000..226c3963aa5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/ServiceDetailHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/ServiceRequestAdapter.class b/libjava/classpath/lib/gnu/CORBA/ServiceRequestAdapter.class
new file mode 100644
index 00000000000..bc813062b99
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/ServiceRequestAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/SetOverrideTypeHolder.class b/libjava/classpath/lib/gnu/CORBA/SetOverrideTypeHolder.class
new file mode 100644
index 00000000000..df821bfd837
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/SetOverrideTypeHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/SimpleDelegate.class b/libjava/classpath/lib/gnu/CORBA/SimpleDelegate.class
new file mode 100644
index 00000000000..8cff1143472
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/SimpleDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/SocketRepository.class b/libjava/classpath/lib/gnu/CORBA/SocketRepository.class
new file mode 100644
index 00000000000..81448b3b117
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/SocketRepository.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/StreamBasedRequest.class b/libjava/classpath/lib/gnu/CORBA/StreamBasedRequest.class
new file mode 100644
index 00000000000..8cd3433d182
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/StreamBasedRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/StreamHolder.class b/libjava/classpath/lib/gnu/CORBA/StreamHolder.class
new file mode 100644
index 00000000000..5d06c9156af
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/StreamHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/StubLocator.class b/libjava/classpath/lib/gnu/CORBA/StubLocator.class
new file mode 100644
index 00000000000..bdd2ca7c258
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/StubLocator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/TypeCodeHelper.class b/libjava/classpath/lib/gnu/CORBA/TypeCodeHelper.class
new file mode 100644
index 00000000000..091f5413ec3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/TypeCodeHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/TypeKindNamer.class b/libjava/classpath/lib/gnu/CORBA/TypeKindNamer.class
new file mode 100644
index 00000000000..d17efde8352
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/TypeKindNamer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Unexpected.class b/libjava/classpath/lib/gnu/CORBA/Unexpected.class
new file mode 100644
index 00000000000..14e326e42be
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Unexpected.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/Version.class b/libjava/classpath/lib/gnu/CORBA/Version.class
new file mode 100644
index 00000000000..1e420498640
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/Version.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/WCharHolder.class b/libjava/classpath/lib/gnu/CORBA/WCharHolder.class
new file mode 100644
index 00000000000..eb7a44e52e1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/WCharHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/WStringHolder.class b/libjava/classpath/lib/gnu/CORBA/WStringHolder.class
new file mode 100644
index 00000000000..71343782852
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/WStringHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/_PolicyImplBase.class b/libjava/classpath/lib/gnu/CORBA/_PolicyImplBase.class
new file mode 100644
index 00000000000..f5520a7359e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/_PolicyImplBase.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/gnuAny.class b/libjava/classpath/lib/gnu/CORBA/gnuAny.class
new file mode 100644
index 00000000000..266d5ba8259
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/gnuAny.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/gnuCodecFactory.class b/libjava/classpath/lib/gnu/CORBA/gnuCodecFactory.class
new file mode 100644
index 00000000000..d739ab5d3db
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/gnuCodecFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/gnuContext.class b/libjava/classpath/lib/gnu/CORBA/gnuContext.class
new file mode 100644
index 00000000000..d5c34c6649f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/gnuContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/gnuContextList.class b/libjava/classpath/lib/gnu/CORBA/gnuContextList.class
new file mode 100644
index 00000000000..11d150dbf51
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/gnuContextList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/gnuEnvironment.class b/libjava/classpath/lib/gnu/CORBA/gnuEnvironment.class
new file mode 100644
index 00000000000..7bf0a1634d2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/gnuEnvironment.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/gnuExceptionList.class b/libjava/classpath/lib/gnu/CORBA/gnuExceptionList.class
new file mode 100644
index 00000000000..4afd4167444
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/gnuExceptionList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/gnuNVList.class b/libjava/classpath/lib/gnu/CORBA/gnuNVList.class
new file mode 100644
index 00000000000..d85ebd24911
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/gnuNVList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/gnuNamedValue.class b/libjava/classpath/lib/gnu/CORBA/gnuNamedValue.class
new file mode 100644
index 00000000000..7453402da12
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/gnuNamedValue.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/gnuRequest$1.class b/libjava/classpath/lib/gnu/CORBA/gnuRequest$1.class
new file mode 100644
index 00000000000..59c92986fb2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/gnuRequest$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/gnuRequest$2.class b/libjava/classpath/lib/gnu/CORBA/gnuRequest$2.class
new file mode 100644
index 00000000000..81feb54a99d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/gnuRequest$2.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/gnuRequest.class b/libjava/classpath/lib/gnu/CORBA/gnuRequest.class
new file mode 100644
index 00000000000..c192425288a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/gnuRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/gnuValueHolder.class b/libjava/classpath/lib/gnu/CORBA/gnuValueHolder.class
new file mode 100644
index 00000000000..0e6db7efef8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/gnuValueHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/interfaces/SocketFactory.class b/libjava/classpath/lib/gnu/CORBA/interfaces/SocketFactory.class
new file mode 100644
index 00000000000..b3bcb327532
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/interfaces/SocketFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/typecodes/AliasTypeCode.class b/libjava/classpath/lib/gnu/CORBA/typecodes/AliasTypeCode.class
new file mode 100644
index 00000000000..6da15c1abe7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/typecodes/AliasTypeCode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/typecodes/ArrayTypeCode.class b/libjava/classpath/lib/gnu/CORBA/typecodes/ArrayTypeCode.class
new file mode 100644
index 00000000000..0ad4bb8329d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/typecodes/ArrayTypeCode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/typecodes/FixedTypeCode.class b/libjava/classpath/lib/gnu/CORBA/typecodes/FixedTypeCode.class
new file mode 100644
index 00000000000..9dda03ad0df
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/typecodes/FixedTypeCode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/typecodes/GeneralTypeCode.class b/libjava/classpath/lib/gnu/CORBA/typecodes/GeneralTypeCode.class
new file mode 100644
index 00000000000..809ec3264e0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/typecodes/GeneralTypeCode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/typecodes/PrimitiveTypeCode.class b/libjava/classpath/lib/gnu/CORBA/typecodes/PrimitiveTypeCode.class
new file mode 100644
index 00000000000..cce5b770b19
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/typecodes/PrimitiveTypeCode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/typecodes/RecordTypeCode$Field.class b/libjava/classpath/lib/gnu/CORBA/typecodes/RecordTypeCode$Field.class
new file mode 100644
index 00000000000..5914e5f824c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/typecodes/RecordTypeCode$Field.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/typecodes/RecordTypeCode.class b/libjava/classpath/lib/gnu/CORBA/typecodes/RecordTypeCode.class
new file mode 100644
index 00000000000..eafcacfee48
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/typecodes/RecordTypeCode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/typecodes/RecursiveTypeCode.class b/libjava/classpath/lib/gnu/CORBA/typecodes/RecursiveTypeCode.class
new file mode 100644
index 00000000000..0059b2f9ab4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/typecodes/RecursiveTypeCode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/CORBA/typecodes/StringTypeCode.class b/libjava/classpath/lib/gnu/CORBA/typecodes/StringTypeCode.class
new file mode 100644
index 00000000000..0f81c868b67
--- /dev/null
+++ b/libjava/classpath/lib/gnu/CORBA/typecodes/StringTypeCode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/awt/LightweightRedirector.class b/libjava/classpath/lib/gnu/awt/LightweightRedirector.class
new file mode 100644
index 00000000000..ff065f5dbbb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/awt/LightweightRedirector.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/awt/j2d/AbstractGraphicsState.class b/libjava/classpath/lib/gnu/awt/j2d/AbstractGraphicsState.class
new file mode 100644
index 00000000000..b927ed5e29d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/awt/j2d/AbstractGraphicsState.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/awt/j2d/DirectRasterGraphics.class b/libjava/classpath/lib/gnu/awt/j2d/DirectRasterGraphics.class
new file mode 100644
index 00000000000..fc2165cade2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/awt/j2d/DirectRasterGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/awt/j2d/Graphics2DImpl.class b/libjava/classpath/lib/gnu/awt/j2d/Graphics2DImpl.class
new file mode 100644
index 00000000000..1e5afad2b97
--- /dev/null
+++ b/libjava/classpath/lib/gnu/awt/j2d/Graphics2DImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/awt/j2d/IntegerGraphicsState$ScreenCoupledImage.class b/libjava/classpath/lib/gnu/awt/j2d/IntegerGraphicsState$ScreenCoupledImage.class
new file mode 100644
index 00000000000..c2cc6bca111
--- /dev/null
+++ b/libjava/classpath/lib/gnu/awt/j2d/IntegerGraphicsState$ScreenCoupledImage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/awt/j2d/IntegerGraphicsState.class b/libjava/classpath/lib/gnu/awt/j2d/IntegerGraphicsState.class
new file mode 100644
index 00000000000..04551d055c6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/awt/j2d/IntegerGraphicsState.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/awt/j2d/MappedRaster.class b/libjava/classpath/lib/gnu/awt/j2d/MappedRaster.class
new file mode 100644
index 00000000000..8a63c469887
--- /dev/null
+++ b/libjava/classpath/lib/gnu/awt/j2d/MappedRaster.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/Configuration.class b/libjava/classpath/lib/gnu/classpath/Configuration.class
new file mode 100644
index 00000000000..16a411a5ef2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/Configuration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/ListenerData.class b/libjava/classpath/lib/gnu/classpath/ListenerData.class
new file mode 100644
index 00000000000..2ab92adf60d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/ListenerData.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/NotImplementedException.class b/libjava/classpath/lib/gnu/classpath/NotImplementedException.class
new file mode 100644
index 00000000000..56130dfab87
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/NotImplementedException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/Pointer.class b/libjava/classpath/lib/gnu/classpath/Pointer.class
new file mode 100644
index 00000000000..a8fc21f3f6a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/Pointer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/Pointer32.class b/libjava/classpath/lib/gnu/classpath/Pointer32.class
new file mode 100644
index 00000000000..e57e4da7542
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/Pointer32.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/Pointer64.class b/libjava/classpath/lib/gnu/classpath/Pointer64.class
new file mode 100644
index 00000000000..66c53d93b58
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/Pointer64.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/ServiceFactory$ServiceIterator.class b/libjava/classpath/lib/gnu/classpath/ServiceFactory$ServiceIterator.class
new file mode 100644
index 00000000000..cd38e30f254
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/ServiceFactory$ServiceIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/ServiceFactory.class b/libjava/classpath/lib/gnu/classpath/ServiceFactory.class
new file mode 100644
index 00000000000..ea98d904484
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/ServiceFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/ServiceProviderLoadingAction.class b/libjava/classpath/lib/gnu/classpath/ServiceProviderLoadingAction.class
new file mode 100644
index 00000000000..3d1680839e1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/ServiceProviderLoadingAction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/SystemProperties.class b/libjava/classpath/lib/gnu/classpath/SystemProperties.class
new file mode 100644
index 00000000000..4ed22f83761
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/SystemProperties.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/VMStackWalker.class b/libjava/classpath/lib/gnu/classpath/VMStackWalker.class
new file mode 100644
index 00000000000..449d365ed5e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/VMStackWalker.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/debug/Component.class b/libjava/classpath/lib/gnu/classpath/debug/Component.class
new file mode 100644
index 00000000000..70a3533fbbc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/debug/Component.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/debug/PreciseFilter.class b/libjava/classpath/lib/gnu/classpath/debug/PreciseFilter.class
new file mode 100644
index 00000000000..86cc273c0de
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/debug/PreciseFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/debug/Simple1LineFormatter.class b/libjava/classpath/lib/gnu/classpath/debug/Simple1LineFormatter.class
new file mode 100644
index 00000000000..0a1b92a0d7e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/debug/Simple1LineFormatter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/debug/SystemLogger.class b/libjava/classpath/lib/gnu/classpath/debug/SystemLogger.class
new file mode 100644
index 00000000000..e40478eb4b0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/debug/SystemLogger.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/debug/TeeInputStream.class b/libjava/classpath/lib/gnu/classpath/debug/TeeInputStream.class
new file mode 100644
index 00000000000..7d22a760e8f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/debug/TeeInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/debug/TeeOutputStream.class b/libjava/classpath/lib/gnu/classpath/debug/TeeOutputStream.class
new file mode 100644
index 00000000000..3ec42ac2846
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/debug/TeeOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/debug/TeeReader.class b/libjava/classpath/lib/gnu/classpath/debug/TeeReader.class
new file mode 100644
index 00000000000..588fcca6a39
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/debug/TeeReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/debug/TeeWriter.class b/libjava/classpath/lib/gnu/classpath/debug/TeeWriter.class
new file mode 100644
index 00000000000..46809bb747e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/debug/TeeWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/Jdwp$1.class b/libjava/classpath/lib/gnu/classpath/jdwp/Jdwp$1.class
new file mode 100644
index 00000000000..ce9e9a32bf2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/Jdwp$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/Jdwp.class b/libjava/classpath/lib/gnu/classpath/jdwp/Jdwp.class
new file mode 100644
index 00000000000..e16ddb6b313
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/Jdwp.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$ClassStatus.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$ClassStatus.class
new file mode 100644
index 00000000000..939e212bd5c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$ClassStatus.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ArrayReference.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ArrayReference.class
new file mode 100644
index 00000000000..bf53f5d8bbd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ArrayReference.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ArrayType.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ArrayType.class
new file mode 100644
index 00000000000..2a8546819ce
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ArrayType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ClassLoaderReference.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ClassLoaderReference.class
new file mode 100644
index 00000000000..0ca114da20a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ClassLoaderReference.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ClassObjectReference.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ClassObjectReference.class
new file mode 100644
index 00000000000..2a7f1ce3623
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ClassObjectReference.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ClassType.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ClassType.class
new file mode 100644
index 00000000000..a5487a1fe40
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ClassType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$Event.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$Event.class
new file mode 100644
index 00000000000..423d818497e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$Event.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$EventRequest.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$EventRequest.class
new file mode 100644
index 00000000000..f33416322d5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$EventRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$Field.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$Field.class
new file mode 100644
index 00000000000..07312b68429
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$Field.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$InterfaceType.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$InterfaceType.class
new file mode 100644
index 00000000000..90c72fef553
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$InterfaceType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$Method.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$Method.class
new file mode 100644
index 00000000000..886bf971e6a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$Method.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ObjectReference.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ObjectReference.class
new file mode 100644
index 00000000000..e720d5aaff9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ObjectReference.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ReferenceType.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ReferenceType.class
new file mode 100644
index 00000000000..6eb00671b80
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ReferenceType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$StackFrame.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$StackFrame.class
new file mode 100644
index 00000000000..01ab67df654
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$StackFrame.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$StringReference.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$StringReference.class
new file mode 100644
index 00000000000..00e831d9d76
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$StringReference.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ThreadGroupReference.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ThreadGroupReference.class
new file mode 100644
index 00000000000..21bd487e028
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ThreadGroupReference.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ThreadReference.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ThreadReference.class
new file mode 100644
index 00000000000..d86fb49a989
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$ThreadReference.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$VirtualMachine.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$VirtualMachine.class
new file mode 100644
index 00000000000..0218b6ac69a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet$VirtualMachine.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet.class
new file mode 100644
index 00000000000..a6228afe141
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$CommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$Error.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$Error.class
new file mode 100644
index 00000000000..4fb74b7d5d8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$Error.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$EventKind.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$EventKind.class
new file mode 100644
index 00000000000..cf86889f2b3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$EventKind.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$InvokeOptions.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$InvokeOptions.class
new file mode 100644
index 00000000000..6ded49a4319
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$InvokeOptions.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$ModKind.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$ModKind.class
new file mode 100644
index 00000000000..8f9f5bd9e6a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$ModKind.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$StepDepth.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$StepDepth.class
new file mode 100644
index 00000000000..1acc46cf4cb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$StepDepth.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$StepSize.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$StepSize.class
new file mode 100644
index 00000000000..7331760f652
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$StepSize.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$SuspendPolicy.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$SuspendPolicy.class
new file mode 100644
index 00000000000..0d3d661fcbb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$SuspendPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$SuspendStatus.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$SuspendStatus.class
new file mode 100644
index 00000000000..278ad885da2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$SuspendStatus.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$Tag.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$Tag.class
new file mode 100644
index 00000000000..f0c90313c4c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$Tag.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$ThreadStatus.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$ThreadStatus.class
new file mode 100644
index 00000000000..2d3b9aa0234
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$ThreadStatus.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$TypeTag.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$TypeTag.class
new file mode 100644
index 00000000000..0cf5f139350
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$TypeTag.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$Version.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$Version.class
new file mode 100644
index 00000000000..f3601fe1967
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants$Version.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants.class b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants.class
new file mode 100644
index 00000000000..6659ab9ff9a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/JdwpConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/VMFrame.class b/libjava/classpath/lib/gnu/classpath/jdwp/VMFrame.class
new file mode 100644
index 00000000000..40c8c2da7c2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/VMFrame.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/VMIdManager$IdFactory.class b/libjava/classpath/lib/gnu/classpath/jdwp/VMIdManager$IdFactory.class
new file mode 100644
index 00000000000..836eecd1980
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/VMIdManager$IdFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/VMIdManager$ReferenceKey.class b/libjava/classpath/lib/gnu/classpath/jdwp/VMIdManager$ReferenceKey.class
new file mode 100644
index 00000000000..d23f881a2f3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/VMIdManager$ReferenceKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/VMIdManager.class b/libjava/classpath/lib/gnu/classpath/jdwp/VMIdManager.class
new file mode 100644
index 00000000000..55b765688d0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/VMIdManager.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/VMMethod.class b/libjava/classpath/lib/gnu/classpath/jdwp/VMMethod.class
new file mode 100644
index 00000000000..25cc9e0c40f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/VMMethod.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/VMVirtualMachine.class b/libjava/classpath/lib/gnu/classpath/jdwp/VMVirtualMachine.class
new file mode 100644
index 00000000000..7b7be23febc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/VMVirtualMachine.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/BreakpointEvent.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/BreakpointEvent.class
new file mode 100644
index 00000000000..b7e1de9eabb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/BreakpointEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/ClassPrepareEvent.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/ClassPrepareEvent.class
new file mode 100644
index 00000000000..e260ac89f56
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/ClassPrepareEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/ClassUnloadEvent.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/ClassUnloadEvent.class
new file mode 100644
index 00000000000..c910a78e804
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/ClassUnloadEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/Event.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/Event.class
new file mode 100644
index 00000000000..d7230bd5ab3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/Event.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/EventManager.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/EventManager.class
new file mode 100644
index 00000000000..49fd7f90d9f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/EventManager.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/EventRequest.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/EventRequest.class
new file mode 100644
index 00000000000..2b423e956d2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/EventRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/ExceptionEvent.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/ExceptionEvent.class
new file mode 100644
index 00000000000..3ce2f59cd27
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/ExceptionEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/MethodEntryEvent.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/MethodEntryEvent.class
new file mode 100644
index 00000000000..da1c51d5cfd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/MethodEntryEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/MethodExitEvent.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/MethodExitEvent.class
new file mode 100644
index 00000000000..59f0f093041
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/MethodExitEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/SingleStepEvent.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/SingleStepEvent.class
new file mode 100644
index 00000000000..8fc0e450b26
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/SingleStepEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/ThreadEndEvent.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/ThreadEndEvent.class
new file mode 100644
index 00000000000..090a690a1bf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/ThreadEndEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/ThreadStartEvent.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/ThreadStartEvent.class
new file mode 100644
index 00000000000..05fd3dcb570
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/ThreadStartEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/VmDeathEvent.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/VmDeathEvent.class
new file mode 100644
index 00000000000..1bdcec4d586
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/VmDeathEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/VmInitEvent.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/VmInitEvent.class
new file mode 100644
index 00000000000..a9795032fbb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/VmInitEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ClassExcludeFilter.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ClassExcludeFilter.class
new file mode 100644
index 00000000000..a08cd3265ee
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ClassExcludeFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ClassMatchFilter.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ClassMatchFilter.class
new file mode 100644
index 00000000000..0025509c612
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ClassMatchFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ClassOnlyFilter.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ClassOnlyFilter.class
new file mode 100644
index 00000000000..6f60ab9c941
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ClassOnlyFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ConditionalFilter.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ConditionalFilter.class
new file mode 100644
index 00000000000..d0471ff1ffe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ConditionalFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/CountFilter.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/CountFilter.class
new file mode 100644
index 00000000000..0a01eab4902
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/CountFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.class
new file mode 100644
index 00000000000..8c8877a309b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/FieldOnlyFilter.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/FieldOnlyFilter.class
new file mode 100644
index 00000000000..5b6efd26597
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/FieldOnlyFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/IEventFilter.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/IEventFilter.class
new file mode 100644
index 00000000000..4c99806ecee
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/IEventFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/InstanceOnlyFilter.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/InstanceOnlyFilter.class
new file mode 100644
index 00000000000..9d4534a2b03
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/InstanceOnlyFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/LocationOnlyFilter.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/LocationOnlyFilter.class
new file mode 100644
index 00000000000..1e8d19b24e6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/LocationOnlyFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/StepFilter.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/StepFilter.class
new file mode 100644
index 00000000000..ce6d2fbaca9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/StepFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ThreadOnlyFilter.class b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ThreadOnlyFilter.class
new file mode 100644
index 00000000000..b9d6d01a9d7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/event/filters/ThreadOnlyFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidClassException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidClassException.class
new file mode 100644
index 00000000000..5ece4d57a57
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidClassException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidClassLoaderException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidClassLoaderException.class
new file mode 100644
index 00000000000..1c99c4b11ea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidClassLoaderException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidCountException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidCountException.class
new file mode 100644
index 00000000000..7112f8bda36
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidCountException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidEventTypeException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidEventTypeException.class
new file mode 100644
index 00000000000..9101c09ab26
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidEventTypeException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidFieldException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidFieldException.class
new file mode 100644
index 00000000000..e87690b42d5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidFieldException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidLocationException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidLocationException.class
new file mode 100644
index 00000000000..337a73b0630
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidLocationException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidMethodException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidMethodException.class
new file mode 100644
index 00000000000..03a7ea9fdde
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidMethodException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidObjectException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidObjectException.class
new file mode 100644
index 00000000000..e1eeecf02f4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidObjectException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidStringException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidStringException.class
new file mode 100644
index 00000000000..7973ac6e965
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidStringException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidThreadException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidThreadException.class
new file mode 100644
index 00000000000..e12c51e51fa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidThreadException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidThreadGroupException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidThreadGroupException.class
new file mode 100644
index 00000000000..331d9a27cd3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/InvalidThreadGroupException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/JdwpException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/JdwpException.class
new file mode 100644
index 00000000000..3076b0bc4b3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/JdwpException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/JdwpIllegalArgumentException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/JdwpIllegalArgumentException.class
new file mode 100644
index 00000000000..7bdff533ece
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/JdwpIllegalArgumentException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/JdwpInternalErrorException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/JdwpInternalErrorException.class
new file mode 100644
index 00000000000..28a94b94c88
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/JdwpInternalErrorException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/NativeMethodException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/NativeMethodException.class
new file mode 100644
index 00000000000..585ae37c817
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/NativeMethodException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/NotImplementedException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/NotImplementedException.class
new file mode 100644
index 00000000000..8f7bf9c3f58
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/NotImplementedException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/exception/VmDeadException.class b/libjava/classpath/lib/gnu/classpath/jdwp/exception/VmDeadException.class
new file mode 100644
index 00000000000..ef8d5b27989
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/exception/VmDeadException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/id/ArrayId.class b/libjava/classpath/lib/gnu/classpath/jdwp/id/ArrayId.class
new file mode 100644
index 00000000000..3511ffc9424
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/id/ArrayId.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/id/ArrayReferenceTypeId.class b/libjava/classpath/lib/gnu/classpath/jdwp/id/ArrayReferenceTypeId.class
new file mode 100644
index 00000000000..079eac5e591
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/id/ArrayReferenceTypeId.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/id/ClassLoaderId.class b/libjava/classpath/lib/gnu/classpath/jdwp/id/ClassLoaderId.class
new file mode 100644
index 00000000000..09a781f0109
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/id/ClassLoaderId.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/id/ClassObjectId.class b/libjava/classpath/lib/gnu/classpath/jdwp/id/ClassObjectId.class
new file mode 100644
index 00000000000..91706216d2b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/id/ClassObjectId.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/id/ClassReferenceTypeId.class b/libjava/classpath/lib/gnu/classpath/jdwp/id/ClassReferenceTypeId.class
new file mode 100644
index 00000000000..3d65d0da2f0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/id/ClassReferenceTypeId.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/id/InterfaceReferenceTypeId.class b/libjava/classpath/lib/gnu/classpath/jdwp/id/InterfaceReferenceTypeId.class
new file mode 100644
index 00000000000..d8bd1b9be61
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/id/InterfaceReferenceTypeId.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/id/JdwpId.class b/libjava/classpath/lib/gnu/classpath/jdwp/id/JdwpId.class
new file mode 100644
index 00000000000..322ea4ad73f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/id/JdwpId.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/id/ObjectId.class b/libjava/classpath/lib/gnu/classpath/jdwp/id/ObjectId.class
new file mode 100644
index 00000000000..412d2d5d814
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/id/ObjectId.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/id/ReferenceTypeId.class b/libjava/classpath/lib/gnu/classpath/jdwp/id/ReferenceTypeId.class
new file mode 100644
index 00000000000..65ee9ea2f92
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/id/ReferenceTypeId.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/id/StringId.class b/libjava/classpath/lib/gnu/classpath/jdwp/id/StringId.class
new file mode 100644
index 00000000000..7cc0ed60e16
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/id/StringId.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/id/ThreadGroupId.class b/libjava/classpath/lib/gnu/classpath/jdwp/id/ThreadGroupId.class
new file mode 100644
index 00000000000..2e28ff83cea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/id/ThreadGroupId.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/id/ThreadId.class b/libjava/classpath/lib/gnu/classpath/jdwp/id/ThreadId.class
new file mode 100644
index 00000000000..37782c54184
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/id/ThreadId.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/ArrayReferenceCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ArrayReferenceCommandSet.class
new file mode 100644
index 00000000000..7f0f3a4dade
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ArrayReferenceCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/ArrayTypeCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ArrayTypeCommandSet.class
new file mode 100644
index 00000000000..686bb6e19cc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ArrayTypeCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.class
new file mode 100644
index 00000000000..9902c528b95
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/ClassObjectReferenceCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ClassObjectReferenceCommandSet.class
new file mode 100644
index 00000000000..ce043ddb4db
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ClassObjectReferenceCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/ClassTypeCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ClassTypeCommandSet.class
new file mode 100644
index 00000000000..18757d3f273
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ClassTypeCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/CommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/CommandSet.class
new file mode 100644
index 00000000000..226489de3a8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/CommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/EventRequestCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/EventRequestCommandSet.class
new file mode 100644
index 00000000000..e1f284cd54d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/EventRequestCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/FieldCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/FieldCommandSet.class
new file mode 100644
index 00000000000..74685c062e1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/FieldCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/InterfaceTypeCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/InterfaceTypeCommandSet.class
new file mode 100644
index 00000000000..4cf81a22ab1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/InterfaceTypeCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/MethodCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/MethodCommandSet.class
new file mode 100644
index 00000000000..bc2b3e71917
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/MethodCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.class
new file mode 100644
index 00000000000..3efdacfe6b1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/PacketProcessor.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/PacketProcessor.class
new file mode 100644
index 00000000000..18234c60f7d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/PacketProcessor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.class
new file mode 100644
index 00000000000..1eedfc1dbe1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/StackFrameCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/StackFrameCommandSet.class
new file mode 100644
index 00000000000..9e8d2a02bc4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/StackFrameCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/StringReferenceCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/StringReferenceCommandSet.class
new file mode 100644
index 00000000000..106710539b2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/StringReferenceCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/ThreadGroupReferenceCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ThreadGroupReferenceCommandSet.class
new file mode 100644
index 00000000000..d71fd305474
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ThreadGroupReferenceCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.class
new file mode 100644
index 00000000000..7aea1a69560
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.class b/libjava/classpath/lib/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.class
new file mode 100644
index 00000000000..d92898641f8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/processor/VirtualMachineCommandSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/transport/ITransport.class b/libjava/classpath/lib/gnu/classpath/jdwp/transport/ITransport.class
new file mode 100644
index 00000000000..021cbcbc065
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/transport/ITransport.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpCommandPacket.class b/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpCommandPacket.class
new file mode 100644
index 00000000000..505622a7da1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpCommandPacket.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpConnection.class b/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpConnection.class
new file mode 100644
index 00000000000..2f1c37d2fd5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpPacket.class b/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpPacket.class
new file mode 100644
index 00000000000..17eee560910
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpPacket.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpReplyPacket.class b/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpReplyPacket.class
new file mode 100644
index 00000000000..ccf01789e06
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/transport/JdwpReplyPacket.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/transport/SocketTransport.class b/libjava/classpath/lib/gnu/classpath/jdwp/transport/SocketTransport.class
new file mode 100644
index 00000000000..8d7f0932b02
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/transport/SocketTransport.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/transport/TransportException.class b/libjava/classpath/lib/gnu/classpath/jdwp/transport/TransportException.class
new file mode 100644
index 00000000000..3064962dbb7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/transport/TransportException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/transport/TransportFactory$TransportMethod.class b/libjava/classpath/lib/gnu/classpath/jdwp/transport/TransportFactory$TransportMethod.class
new file mode 100644
index 00000000000..fae00826705
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/transport/TransportFactory$TransportMethod.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/transport/TransportFactory.class b/libjava/classpath/lib/gnu/classpath/jdwp/transport/TransportFactory.class
new file mode 100644
index 00000000000..79dc3513ade
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/transport/TransportFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/util/JdwpString.class b/libjava/classpath/lib/gnu/classpath/jdwp/util/JdwpString.class
new file mode 100644
index 00000000000..d37bc871685
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/util/JdwpString.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/util/LineTable.class b/libjava/classpath/lib/gnu/classpath/jdwp/util/LineTable.class
new file mode 100644
index 00000000000..2d5f61ee0b8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/util/LineTable.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/util/Location.class b/libjava/classpath/lib/gnu/classpath/jdwp/util/Location.class
new file mode 100644
index 00000000000..593418c29b7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/util/Location.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/util/MethodResult.class b/libjava/classpath/lib/gnu/classpath/jdwp/util/MethodResult.class
new file mode 100644
index 00000000000..71f7f1f3781
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/util/MethodResult.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/util/Signature.class b/libjava/classpath/lib/gnu/classpath/jdwp/util/Signature.class
new file mode 100644
index 00000000000..e9525687d3c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/util/Signature.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/util/Value.class b/libjava/classpath/lib/gnu/classpath/jdwp/util/Value.class
new file mode 100644
index 00000000000..20293c12746
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/util/Value.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/classpath/jdwp/util/VariableTable.class b/libjava/classpath/lib/gnu/classpath/jdwp/util/VariableTable.class
new file mode 100644
index 00000000000..7c653c3d6d3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/classpath/jdwp/util/VariableTable.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/Core.class b/libjava/classpath/lib/gnu/gcj/Core.class
new file mode 100644
index 00000000000..8a26255f175
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/Core.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/RawData.class b/libjava/classpath/lib/gnu/gcj/RawData.class
new file mode 100644
index 00000000000..a00b1c488d4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/RawData.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/RawDataManaged.class b/libjava/classpath/lib/gnu/gcj/RawDataManaged.class
new file mode 100644
index 00000000000..7e5b982ce6c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/RawDataManaged.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/BytesToCharsetAdaptor.class b/libjava/classpath/lib/gnu/gcj/convert/BytesToCharsetAdaptor.class
new file mode 100644
index 00000000000..7efd0fe778b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/BytesToCharsetAdaptor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/BytesToUnicode.class b/libjava/classpath/lib/gnu/gcj/convert/BytesToUnicode.class
new file mode 100644
index 00000000000..dc97d8454fa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/BytesToUnicode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/CharsetToBytesAdaptor.class b/libjava/classpath/lib/gnu/gcj/convert/CharsetToBytesAdaptor.class
new file mode 100644
index 00000000000..cf73dc114e6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/CharsetToBytesAdaptor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Convert.class b/libjava/classpath/lib/gnu/gcj/convert/Convert.class
new file mode 100644
index 00000000000..baff2de415f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Convert.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/IOConverter.class b/libjava/classpath/lib/gnu/gcj/convert/IOConverter.class
new file mode 100644
index 00000000000..d283842bba1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/IOConverter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Input_8859_1.class b/libjava/classpath/lib/gnu/gcj/convert/Input_8859_1.class
new file mode 100644
index 00000000000..8da067f53d1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Input_8859_1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Input_ASCII.class b/libjava/classpath/lib/gnu/gcj/convert/Input_ASCII.class
new file mode 100644
index 00000000000..584e27b984f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Input_ASCII.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Input_EUCJIS.class b/libjava/classpath/lib/gnu/gcj/convert/Input_EUCJIS.class
new file mode 100644
index 00000000000..4ff9c7d934c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Input_EUCJIS.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Input_JavaSrc.class b/libjava/classpath/lib/gnu/gcj/convert/Input_JavaSrc.class
new file mode 100644
index 00000000000..795dd8e29bb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Input_JavaSrc.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Input_SJIS.class b/libjava/classpath/lib/gnu/gcj/convert/Input_SJIS.class
new file mode 100644
index 00000000000..b8d120cb0ee
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Input_SJIS.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Input_UTF8.class b/libjava/classpath/lib/gnu/gcj/convert/Input_UTF8.class
new file mode 100644
index 00000000000..c368e605a25
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Input_UTF8.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Input_UnicodeBig.class b/libjava/classpath/lib/gnu/gcj/convert/Input_UnicodeBig.class
new file mode 100644
index 00000000000..e3076866997
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Input_UnicodeBig.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Input_UnicodeLittle.class b/libjava/classpath/lib/gnu/gcj/convert/Input_UnicodeLittle.class
new file mode 100644
index 00000000000..6d02c3174b5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Input_UnicodeLittle.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Input_iconv.class b/libjava/classpath/lib/gnu/gcj/convert/Input_iconv.class
new file mode 100644
index 00000000000..6700903f2ac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Input_iconv.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Output_8859_1.class b/libjava/classpath/lib/gnu/gcj/convert/Output_8859_1.class
new file mode 100644
index 00000000000..8433e736146
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Output_8859_1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Output_ASCII.class b/libjava/classpath/lib/gnu/gcj/convert/Output_ASCII.class
new file mode 100644
index 00000000000..659b00064f4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Output_ASCII.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Output_EUCJIS.class b/libjava/classpath/lib/gnu/gcj/convert/Output_EUCJIS.class
new file mode 100644
index 00000000000..379ba3decb6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Output_EUCJIS.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Output_JavaSrc.class b/libjava/classpath/lib/gnu/gcj/convert/Output_JavaSrc.class
new file mode 100644
index 00000000000..842d5fac9eb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Output_JavaSrc.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Output_SJIS.class b/libjava/classpath/lib/gnu/gcj/convert/Output_SJIS.class
new file mode 100644
index 00000000000..2ed3f80373c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Output_SJIS.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Output_UTF8.class b/libjava/classpath/lib/gnu/gcj/convert/Output_UTF8.class
new file mode 100644
index 00000000000..f89683a61eb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Output_UTF8.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Output_UnicodeLittleUnmarked.class b/libjava/classpath/lib/gnu/gcj/convert/Output_UnicodeLittleUnmarked.class
new file mode 100644
index 00000000000..69320f86133
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Output_UnicodeLittleUnmarked.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Output_iconv.class b/libjava/classpath/lib/gnu/gcj/convert/Output_iconv.class
new file mode 100644
index 00000000000..4f743793c9f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/Output_iconv.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/convert/UnicodeToBytes.class b/libjava/classpath/lib/gnu/gcj/convert/UnicodeToBytes.class
new file mode 100644
index 00000000000..354fb7f58f9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/convert/UnicodeToBytes.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/io/DefaultMimeTypes.class b/libjava/classpath/lib/gnu/gcj/io/DefaultMimeTypes.class
new file mode 100644
index 00000000000..2d97570ad38
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/io/DefaultMimeTypes.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/io/MimeTypes.class b/libjava/classpath/lib/gnu/gcj/io/MimeTypes.class
new file mode 100644
index 00000000000..4d2cc671ae7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/io/MimeTypes.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/io/SimpleSHSStream.class b/libjava/classpath/lib/gnu/gcj/io/SimpleSHSStream.class
new file mode 100644
index 00000000000..bdd227ec1c9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/io/SimpleSHSStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/jvmti/Breakpoint.class b/libjava/classpath/lib/gnu/gcj/jvmti/Breakpoint.class
new file mode 100644
index 00000000000..be2f539139b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/jvmti/Breakpoint.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/jvmti/BreakpointManager.class b/libjava/classpath/lib/gnu/gcj/jvmti/BreakpointManager.class
new file mode 100644
index 00000000000..c0bf97744a7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/jvmti/BreakpointManager.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/jvmti/Location.class b/libjava/classpath/lib/gnu/gcj/jvmti/Location.class
new file mode 100644
index 00000000000..37bcdd962af
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/jvmti/Location.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/BootClassLoader.class b/libjava/classpath/lib/gnu/gcj/runtime/BootClassLoader.class
new file mode 100644
index 00000000000..1635a304040
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/BootClassLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/ExtensionClassLoader.class b/libjava/classpath/lib/gnu/gcj/runtime/ExtensionClassLoader.class
new file mode 100644
index 00000000000..d0fee5eabd8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/ExtensionClassLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/FinalizerThread.class b/libjava/classpath/lib/gnu/gcj/runtime/FinalizerThread.class
new file mode 100644
index 00000000000..40e118d78bb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/FinalizerThread.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/HelperClassLoader$1.class b/libjava/classpath/lib/gnu/gcj/runtime/HelperClassLoader$1.class
new file mode 100644
index 00000000000..0503a71b279
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/HelperClassLoader$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/HelperClassLoader.class b/libjava/classpath/lib/gnu/gcj/runtime/HelperClassLoader.class
new file mode 100644
index 00000000000..4aac103708c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/HelperClassLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/JNIWeakRef.class b/libjava/classpath/lib/gnu/gcj/runtime/JNIWeakRef.class
new file mode 100644
index 00000000000..02793559bc2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/JNIWeakRef.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/NameFinder$Addr2Line.class b/libjava/classpath/lib/gnu/gcj/runtime/NameFinder$Addr2Line.class
new file mode 100644
index 00000000000..9299252b2ad
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/NameFinder$Addr2Line.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/NameFinder.class b/libjava/classpath/lib/gnu/gcj/runtime/NameFinder.class
new file mode 100644
index 00000000000..15d34ef9ab5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/NameFinder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$AccessMode.class b/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$AccessMode.class
new file mode 100644
index 00000000000..e5f77e9cee6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$AccessMode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$ByteWrapper.class b/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$ByteWrapper.class
new file mode 100644
index 00000000000..ac8b998ccdd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$ByteWrapper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$HashIterator.class b/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$HashIterator.class
new file mode 100644
index 00000000000..d6a39d0acfa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$HashIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$MapEntry.class b/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$MapEntry.class
new file mode 100644
index 00000000000..c07e1c7b9ff
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap$MapEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap.class b/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap.class
new file mode 100644
index 00000000000..ff84e010eea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/PersistentByteMap.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/SharedLibHelper.class b/libjava/classpath/lib/gnu/gcj/runtime/SharedLibHelper.class
new file mode 100644
index 00000000000..6ed177b738e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/SharedLibHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/SharedLibLoader.class b/libjava/classpath/lib/gnu/gcj/runtime/SharedLibLoader.class
new file mode 100644
index 00000000000..44636a57257
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/SharedLibLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/StringBuffer.class b/libjava/classpath/lib/gnu/gcj/runtime/StringBuffer.class
new file mode 100644
index 00000000000..69c43c39f80
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/StringBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/runtime/SystemClassLoader.class b/libjava/classpath/lib/gnu/gcj/runtime/SystemClassLoader.class
new file mode 100644
index 00000000000..fc6e6a4030a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/runtime/SystemClassLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Fileset.class b/libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Fileset.class
new file mode 100644
index 00000000000..906431cb7a6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Fileset.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Main.class b/libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Main.class
new file mode 100644
index 00000000000..c785ed41bf7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Main.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Tokenizer.class b/libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Tokenizer.class
new file mode 100644
index 00000000000..2ddd589f87e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Tokenizer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/util/Debug.class b/libjava/classpath/lib/gnu/gcj/util/Debug.class
new file mode 100644
index 00000000000..ac8d1ecde36
--- /dev/null
+++ b/libjava/classpath/lib/gnu/gcj/util/Debug.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/AWTUtilities$VisibleComponentList$VisibleComponentIterator.class b/libjava/classpath/lib/gnu/java/awt/AWTUtilities$VisibleComponentList$VisibleComponentIterator.class
new file mode 100644
index 00000000000..cbc0f6fdbd0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/AWTUtilities$VisibleComponentList$VisibleComponentIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/AWTUtilities$VisibleComponentList.class b/libjava/classpath/lib/gnu/java/awt/AWTUtilities$VisibleComponentList.class
new file mode 100644
index 00000000000..fb992fec655
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/AWTUtilities$VisibleComponentList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/AWTUtilities.class b/libjava/classpath/lib/gnu/java/awt/AWTUtilities.class
new file mode 100644
index 00000000000..acf2f1ec1f6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/AWTUtilities.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/BitMaskExtent.class b/libjava/classpath/lib/gnu/java/awt/BitMaskExtent.class
new file mode 100644
index 00000000000..29e68738555
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/BitMaskExtent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/BitwiseXORComposite$GeneralContext.class b/libjava/classpath/lib/gnu/java/awt/BitwiseXORComposite$GeneralContext.class
new file mode 100644
index 00000000000..0d25849129c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/BitwiseXORComposite$GeneralContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/BitwiseXORComposite$IntContext.class b/libjava/classpath/lib/gnu/java/awt/BitwiseXORComposite$IntContext.class
new file mode 100644
index 00000000000..aa889bd088e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/BitwiseXORComposite$IntContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/BitwiseXORComposite.class b/libjava/classpath/lib/gnu/java/awt/BitwiseXORComposite.class
new file mode 100644
index 00000000000..b379f7a71c1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/BitwiseXORComposite.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/Buffers.class b/libjava/classpath/lib/gnu/java/awt/Buffers.class
new file mode 100644
index 00000000000..65e57b89f47
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/Buffers.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/ClasspathToolkit.class b/libjava/classpath/lib/gnu/java/awt/ClasspathToolkit.class
new file mode 100644
index 00000000000..b0a5b1497b2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/ClasspathToolkit.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/ComponentDataBlitOp.class b/libjava/classpath/lib/gnu/java/awt/ComponentDataBlitOp.class
new file mode 100644
index 00000000000..e65cee5e097
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/ComponentDataBlitOp.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/ComponentReshapeEvent.class b/libjava/classpath/lib/gnu/java/awt/ComponentReshapeEvent.class
new file mode 100644
index 00000000000..533e2afd687
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/ComponentReshapeEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/EmbeddedWindow.class b/libjava/classpath/lib/gnu/java/awt/EmbeddedWindow.class
new file mode 100644
index 00000000000..39357c5236a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/EmbeddedWindow.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/EventModifier.class b/libjava/classpath/lib/gnu/java/awt/EventModifier.class
new file mode 100644
index 00000000000..d43d64e9386
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/EventModifier.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/GradientPaintContext.class b/libjava/classpath/lib/gnu/java/awt/GradientPaintContext.class
new file mode 100644
index 00000000000..5d143ffc32e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/GradientPaintContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/LowPriorityEvent.class b/libjava/classpath/lib/gnu/java/awt/LowPriorityEvent.class
new file mode 100644
index 00000000000..a35f4de610d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/LowPriorityEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/color/CieXyzConverter.class b/libjava/classpath/lib/gnu/java/awt/color/CieXyzConverter.class
new file mode 100644
index 00000000000..edf6d328842
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/color/CieXyzConverter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/color/ClutProfileConverter.class b/libjava/classpath/lib/gnu/java/awt/color/ClutProfileConverter.class
new file mode 100644
index 00000000000..d5d38bb1bbc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/color/ClutProfileConverter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/color/ColorLookUpTable.class b/libjava/classpath/lib/gnu/java/awt/color/ColorLookUpTable.class
new file mode 100644
index 00000000000..899c1588120
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/color/ColorLookUpTable.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/color/ColorSpaceConverter.class b/libjava/classpath/lib/gnu/java/awt/color/ColorSpaceConverter.class
new file mode 100644
index 00000000000..2ca97e2078b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/color/ColorSpaceConverter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/color/GrayProfileConverter.class b/libjava/classpath/lib/gnu/java/awt/color/GrayProfileConverter.class
new file mode 100644
index 00000000000..bac7ddc7cea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/color/GrayProfileConverter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/color/GrayScaleConverter.class b/libjava/classpath/lib/gnu/java/awt/color/GrayScaleConverter.class
new file mode 100644
index 00000000000..5c1d6fc423b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/color/GrayScaleConverter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/color/LinearRGBConverter.class b/libjava/classpath/lib/gnu/java/awt/color/LinearRGBConverter.class
new file mode 100644
index 00000000000..9dd3ecb53c6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/color/LinearRGBConverter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/color/ProfileHeader.class b/libjava/classpath/lib/gnu/java/awt/color/ProfileHeader.class
new file mode 100644
index 00000000000..742a3e36214
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/color/ProfileHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/color/PyccConverter.class b/libjava/classpath/lib/gnu/java/awt/color/PyccConverter.class
new file mode 100644
index 00000000000..31e5c148e04
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/color/PyccConverter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/color/RgbProfileConverter.class b/libjava/classpath/lib/gnu/java/awt/color/RgbProfileConverter.class
new file mode 100644
index 00000000000..796c205631b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/color/RgbProfileConverter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/color/SrgbConverter.class b/libjava/classpath/lib/gnu/java/awt/color/SrgbConverter.class
new file mode 100644
index 00000000000..9b1bd7846a5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/color/SrgbConverter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/color/TagEntry.class b/libjava/classpath/lib/gnu/java/awt/color/TagEntry.class
new file mode 100644
index 00000000000..8671cd128d0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/color/TagEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/color/ToneReproductionCurve.class b/libjava/classpath/lib/gnu/java/awt/color/ToneReproductionCurve.class
new file mode 100644
index 00000000000..1058f507380
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/color/ToneReproductionCurve.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/dnd/GtkMouseDragGestureRecognizer.class b/libjava/classpath/lib/gnu/java/awt/dnd/GtkMouseDragGestureRecognizer.class
new file mode 100644
index 00000000000..a98f2234b92
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/dnd/GtkMouseDragGestureRecognizer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.class b/libjava/classpath/lib/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.class
new file mode 100644
index 00000000000..73098309d66
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.class b/libjava/classpath/lib/gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.class
new file mode 100644
index 00000000000..802f67c73a3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/dnd/peer/gtk/GtkDropTargetPeer.class b/libjava/classpath/lib/gnu/java/awt/dnd/peer/gtk/GtkDropTargetPeer.class
new file mode 100644
index 00000000000..e7460d52345
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/dnd/peer/gtk/GtkDropTargetPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/FontDelegate.class b/libjava/classpath/lib/gnu/java/awt/font/FontDelegate.class
new file mode 100644
index 00000000000..d1a4f5cc05d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/FontDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/FontFactory.class b/libjava/classpath/lib/gnu/java/awt/font/FontFactory.class
new file mode 100644
index 00000000000..9cbf8ad1ec8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/FontFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/GNUGlyphVector.class b/libjava/classpath/lib/gnu/java/awt/font/GNUGlyphVector.class
new file mode 100644
index 00000000000..15a63b46234
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/GNUGlyphVector.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/autofit/AxisHints.class b/libjava/classpath/lib/gnu/java/awt/font/autofit/AxisHints.class
new file mode 100644
index 00000000000..a9273d1fa70
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/autofit/AxisHints.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/autofit/Constants.class b/libjava/classpath/lib/gnu/java/awt/font/autofit/Constants.class
new file mode 100644
index 00000000000..d3db2fd0c47
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/autofit/Constants.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/autofit/GlyphHints.class b/libjava/classpath/lib/gnu/java/awt/font/autofit/GlyphHints.class
new file mode 100644
index 00000000000..5324cebe34b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/autofit/GlyphHints.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/autofit/Latin.class b/libjava/classpath/lib/gnu/java/awt/font/autofit/Latin.class
new file mode 100644
index 00000000000..01014faf23a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/autofit/Latin.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/autofit/LatinAxis.class b/libjava/classpath/lib/gnu/java/awt/font/autofit/LatinAxis.class
new file mode 100644
index 00000000000..ba60a11055f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/autofit/LatinAxis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/autofit/LatinMetrics.class b/libjava/classpath/lib/gnu/java/awt/font/autofit/LatinMetrics.class
new file mode 100644
index 00000000000..81c17e85d02
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/autofit/LatinMetrics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/autofit/Scaler.class b/libjava/classpath/lib/gnu/java/awt/font/autofit/Scaler.class
new file mode 100644
index 00000000000..96ffa84e913
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/autofit/Scaler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/autofit/Script.class b/libjava/classpath/lib/gnu/java/awt/font/autofit/Script.class
new file mode 100644
index 00000000000..d909a152757
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/autofit/Script.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/autofit/ScriptMetrics.class b/libjava/classpath/lib/gnu/java/awt/font/autofit/ScriptMetrics.class
new file mode 100644
index 00000000000..1e22288fe17
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/autofit/ScriptMetrics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/autofit/Segment.class b/libjava/classpath/lib/gnu/java/awt/font/autofit/Segment.class
new file mode 100644
index 00000000000..a44b85c5781
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/autofit/Segment.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/autofit/Width.class b/libjava/classpath/lib/gnu/java/awt/font/autofit/Width.class
new file mode 100644
index 00000000000..04a11d86aae
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/autofit/Width.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Dummy.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Dummy.class
new file mode 100644
index 00000000000..d070a3e8dde
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Dummy.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Type0.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Type0.class
new file mode 100644
index 00000000000..4f9d2e1089d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Type0.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Type12.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Type12.class
new file mode 100644
index 00000000000..e7169e72749
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Type12.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Type4.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Type4.class
new file mode 100644
index 00000000000..7b70521ef2e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap$Type4.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap.class
new file mode 100644
index 00000000000..a96ede9f3d2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/CharGlyphMap.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/GlyphNamer.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/GlyphNamer.class
new file mode 100644
index 00000000000..31a1d649f9b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/GlyphNamer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/MacResourceFork$Resource.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/MacResourceFork$Resource.class
new file mode 100644
index 00000000000..2f54ec7154e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/MacResourceFork$Resource.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/MacResourceFork.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/MacResourceFork.class
new file mode 100644
index 00000000000..fbb42510d34
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/MacResourceFork.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/NameDecoder.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/NameDecoder.class
new file mode 100644
index 00000000000..c2e7a0b817e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/NameDecoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/OpenTypeFont.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/OpenTypeFont.class
new file mode 100644
index 00000000000..de0cffd6a27
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/OpenTypeFont.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/OpenTypeFontFactory.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/OpenTypeFontFactory.class
new file mode 100644
index 00000000000..6fe831dcce7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/OpenTypeFontFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/Scaler.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/Scaler.class
new file mode 100644
index 00000000000..b5ce93d5972
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/Scaler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/Fixed.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/Fixed.class
new file mode 100644
index 00000000000..55422175480
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/Fixed.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLoader.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLoader.class
new file mode 100644
index 00000000000..5528bd08e72
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLocator$FourByte.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLocator$FourByte.class
new file mode 100644
index 00000000000..d6ffe04c616
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLocator$FourByte.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLocator$TwoByte.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLocator$TwoByte.class
new file mode 100644
index 00000000000..1f218efd928
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLocator$TwoByte.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLocator.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLocator.class
new file mode 100644
index 00000000000..9315d0c6d51
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphLocator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphMeasurer.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphMeasurer.class
new file mode 100644
index 00000000000..b29fa6ff2d3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/GlyphMeasurer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/TrueTypeScaler.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/TrueTypeScaler.class
new file mode 100644
index 00000000000..933bf56b537
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/TrueTypeScaler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/VirtualMachine.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/VirtualMachine.class
new file mode 100644
index 00000000000..2c2fef0ff2b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/VirtualMachine.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/Zone.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/Zone.class
new file mode 100644
index 00000000000..d362cb1f426
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/Zone.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/ZonePathIterator.class b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/ZonePathIterator.class
new file mode 100644
index 00000000000..d3f857f76cc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/font/opentype/truetype/ZonePathIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/image/ImageDecoder$DataInputStreamWrapper.class b/libjava/classpath/lib/gnu/java/awt/image/ImageDecoder$DataInputStreamWrapper.class
new file mode 100644
index 00000000000..0d7d61bdc63
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/image/ImageDecoder$DataInputStreamWrapper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/image/ImageDecoder.class b/libjava/classpath/lib/gnu/java/awt/image/ImageDecoder.class
new file mode 100644
index 00000000000..319ecbcffea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/image/ImageDecoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/image/XBMDecoder.class b/libjava/classpath/lib/gnu/java/awt/image/XBMDecoder.class
new file mode 100644
index 00000000000..b803a7abb7b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/image/XBMDecoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/java2d/AbstractGraphics2D.class b/libjava/classpath/lib/gnu/java/awt/java2d/AbstractGraphics2D.class
new file mode 100644
index 00000000000..25b1e1e3d70
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/java2d/AbstractGraphics2D.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/java2d/AlphaCompositeContext.class b/libjava/classpath/lib/gnu/java/awt/java2d/AlphaCompositeContext.class
new file mode 100644
index 00000000000..0cc558f9521
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/java2d/AlphaCompositeContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/java2d/CubicSegment.class b/libjava/classpath/lib/gnu/java/awt/java2d/CubicSegment.class
new file mode 100644
index 00000000000..94b625a0c49
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/java2d/CubicSegment.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/java2d/ImagePaint$ImagePaintContext.class b/libjava/classpath/lib/gnu/java/awt/java2d/ImagePaint$ImagePaintContext.class
new file mode 100644
index 00000000000..79e523895dc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/java2d/ImagePaint$ImagePaintContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/java2d/ImagePaint.class b/libjava/classpath/lib/gnu/java/awt/java2d/ImagePaint.class
new file mode 100644
index 00000000000..48e06a2d478
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/java2d/ImagePaint.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/java2d/LineSegment.class b/libjava/classpath/lib/gnu/java/awt/java2d/LineSegment.class
new file mode 100644
index 00000000000..378a9df0752
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/java2d/LineSegment.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/java2d/PolyEdge.class b/libjava/classpath/lib/gnu/java/awt/java2d/PolyEdge.class
new file mode 100644
index 00000000000..a41557a60d3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/java2d/PolyEdge.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/java2d/PolyEdgeComparator.class b/libjava/classpath/lib/gnu/java/awt/java2d/PolyEdgeComparator.class
new file mode 100644
index 00000000000..772f42c1cff
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/java2d/PolyEdgeComparator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/java2d/QuadSegment.class b/libjava/classpath/lib/gnu/java/awt/java2d/QuadSegment.class
new file mode 100644
index 00000000000..1cdd0b4b96a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/java2d/QuadSegment.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/java2d/RasterGraphics.class b/libjava/classpath/lib/gnu/java/awt/java2d/RasterGraphics.class
new file mode 100644
index 00000000000..c52e502d6ed
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/java2d/RasterGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/java2d/Segment.class b/libjava/classpath/lib/gnu/java/awt/java2d/Segment.class
new file mode 100644
index 00000000000..18d241d4a83
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/java2d/Segment.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/java2d/ShapeCache.class b/libjava/classpath/lib/gnu/java/awt/java2d/ShapeCache.class
new file mode 100644
index 00000000000..d82213949e5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/java2d/ShapeCache.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/java2d/TexturePaintContext.class b/libjava/classpath/lib/gnu/java/awt/java2d/TexturePaintContext.class
new file mode 100644
index 00000000000..e808da67d5c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/java2d/TexturePaintContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/ClasspathFontPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/ClasspathFontPeer.class
new file mode 100644
index 00000000000..a0ed006b9fb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/ClasspathFontPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/EmbeddedWindowPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/EmbeddedWindowPeer.class
new file mode 100644
index 00000000000..5dc239fd3f7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/EmbeddedWindowPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/GLightweightPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/GLightweightPeer.class
new file mode 100644
index 00000000000..ebb93ecb277
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/GLightweightPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/NativeEventLoopRunningEvent.class b/libjava/classpath/lib/gnu/java/awt/peer/NativeEventLoopRunningEvent.class
new file mode 100644
index 00000000000..f49301a7d23
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/NativeEventLoopRunningEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/AsyncImage$Loader.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/AsyncImage$Loader.class
new file mode 100644
index 00000000000..62f7c076f1b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/AsyncImage$Loader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/AsyncImage$NullImageSource.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/AsyncImage$NullImageSource.class
new file mode 100644
index 00000000000..33331c774c9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/AsyncImage$NullImageSource.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/AsyncImage.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/AsyncImage.class
new file mode 100644
index 00000000000..884957553cd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/AsyncImage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/BufferedImageGraphics.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/BufferedImageGraphics.class
new file mode 100644
index 00000000000..26ac9f85f48
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/BufferedImageGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoGraphics2D.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoGraphics2D.class
new file mode 100644
index 00000000000..2c472c48685
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoGraphics2D.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoSurface$CairoDataBuffer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoSurface$CairoDataBuffer.class
new file mode 100644
index 00000000000..c80d33b0a4e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoSurface$CairoDataBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoSurface.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoSurface.class
new file mode 100644
index 00000000000..eb4bf173b5c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoSurface.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoSurfaceGraphics.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoSurfaceGraphics.class
new file mode 100644
index 00000000000..326d4355db4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoSurfaceGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphics.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphics.class
new file mode 100644
index 00000000000..655eba16fc1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphicsCopy.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphicsCopy.class
new file mode 100644
index 00000000000..d9a29a2cdb2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphicsCopy.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/FreetypeGlyphVector.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/FreetypeGlyphVector.class
new file mode 100644
index 00000000000..a3923958161
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/FreetypeGlyphVector.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GThreadMutex.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GThreadMutex.class
new file mode 100644
index 00000000000..6362e5c07d8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GThreadMutex.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.class
new file mode 100644
index 00000000000..f24f934b431
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer$GdkFontLineMetrics.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer$GdkFontLineMetrics.class
new file mode 100644
index 00000000000..64d47db6b38
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer$GdkFontLineMetrics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer$GdkFontMetrics.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer$GdkFontMetrics.class
new file mode 100644
index 00000000000..0807a240c95
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer$GdkFontMetrics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer.class
new file mode 100644
index 00000000000..90698647c89
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.class
new file mode 100644
index 00000000000..fd4492219aa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.class
new file mode 100644
index 00000000000..e62ee53d652
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufReader.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufReader.class
new file mode 100644
index 00000000000..eb61d5056b9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufReaderSpi.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufReaderSpi.class
new file mode 100644
index 00000000000..7566b0bc4ba
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufReaderSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufWriter.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufWriter.class
new file mode 100644
index 00000000000..6328b156a3d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufWriterSpi.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufWriterSpi.class
new file mode 100644
index 00000000000..54adeb7576e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$GdkPixbufWriterSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$ImageFormatSpec.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$ImageFormatSpec.class
new file mode 100644
index 00000000000..86b97376812
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder$ImageFormatSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.class
new file mode 100644
index 00000000000..9b332f9184d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkRobotPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkRobotPeer.class
new file mode 100644
index 00000000000..a3330885a21
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkRobotPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice$X11DisplayMode.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice$X11DisplayMode.class
new file mode 100644
index 00000000000..0494728ecb6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice$X11DisplayMode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.class
new file mode 100644
index 00000000000..87481e787dd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkButtonPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkButtonPeer.class
new file mode 100644
index 00000000000..a0e6f0a3cec
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkButtonPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCanvasPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCanvasPeer.class
new file mode 100644
index 00000000000..f9d343cca0d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCanvasPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.class
new file mode 100644
index 00000000000..50d6dbeef8a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCheckboxPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCheckboxPeer.class
new file mode 100644
index 00000000000..511f60b4b74
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCheckboxPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkChoicePeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkChoicePeer.class
new file mode 100644
index 00000000000..7efc35afa27
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkChoicePeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkClipboard.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkClipboard.class
new file mode 100644
index 00000000000..863a1746ffc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkClipboard.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkClipboardNotifier.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkClipboardNotifier.class
new file mode 100644
index 00000000000..0e92e5d438b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkClipboardNotifier.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkComponentPeer$RepaintTimerTask.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkComponentPeer$RepaintTimerTask.class
new file mode 100644
index 00000000000..097713c014a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkComponentPeer$RepaintTimerTask.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkComponentPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkComponentPeer.class
new file mode 100644
index 00000000000..9768413597a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkComponentPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkContainerPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkContainerPeer.class
new file mode 100644
index 00000000000..242bee5d57b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkContainerPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCursor.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCursor.class
new file mode 100644
index 00000000000..233d653bbe1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkCursor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkDialogPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkDialogPeer.class
new file mode 100644
index 00000000000..95a5653758c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkDialogPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.class
new file mode 100644
index 00000000000..4243902b29d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkFileDialogPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkFileDialogPeer.class
new file mode 100644
index 00000000000..c869a820d2f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkFileDialogPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkFramePeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkFramePeer.class
new file mode 100644
index 00000000000..f22c732c2a8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkFramePeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkGenericPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkGenericPeer.class
new file mode 100644
index 00000000000..956a5e1c989
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkGenericPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkImage.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkImage.class
new file mode 100644
index 00000000000..07cfdeba7a1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkImage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkImageConsumer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkImageConsumer.class
new file mode 100644
index 00000000000..1879e9feb83
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkImageConsumer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkLabelPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkLabelPeer.class
new file mode 100644
index 00000000000..9188160aaad
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkLabelPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkListPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkListPeer.class
new file mode 100644
index 00000000000..30f3a9866a2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkListPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMainThread.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMainThread.class
new file mode 100644
index 00000000000..88ae463ff9a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMainThread.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuBarPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuBarPeer.class
new file mode 100644
index 00000000000..8663b43a186
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuBarPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.class
new file mode 100644
index 00000000000..7da4f7ac48e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuItemPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuItemPeer.class
new file mode 100644
index 00000000000..0259bb5f42f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuItemPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuPeer.class
new file mode 100644
index 00000000000..28d7ed6bbf0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMenuPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMouseInfoPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMouseInfoPeer.class
new file mode 100644
index 00000000000..35c5677f5b8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMouseInfoPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkPanelPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkPanelPeer.class
new file mode 100644
index 00000000000..4e2760f40c5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkPanelPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.class
new file mode 100644
index 00000000000..fc9d1db17f0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkScrollPanePeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkScrollPanePeer.class
new file mode 100644
index 00000000000..afcc4a75d59
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkScrollPanePeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkScrollbarPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkScrollbarPeer.class
new file mode 100644
index 00000000000..a3251facead
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkScrollbarPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkSelection.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkSelection.class
new file mode 100644
index 00000000000..a01a65b8a51
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkSelection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkTextAreaPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkTextAreaPeer.class
new file mode 100644
index 00000000000..122e3808c43
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkTextAreaPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkTextFieldPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkTextFieldPeer.class
new file mode 100644
index 00000000000..aa0a9ce610a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkTextFieldPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkToolkit$LRUCache.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkToolkit$LRUCache.class
new file mode 100644
index 00000000000..685bdaa5986
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkToolkit$LRUCache.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkToolkit.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkToolkit.class
new file mode 100644
index 00000000000..1ccba58c9b5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkToolkit.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkVolatileImage.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkVolatileImage.class
new file mode 100644
index 00000000000..c219eaf07f3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkVolatileImage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkWindowPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkWindowPeer.class
new file mode 100644
index 00000000000..49926397575
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkWindowPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/VolatileImageGraphics.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/VolatileImageGraphics.class
new file mode 100644
index 00000000000..76c143e2333
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/VolatileImageGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/headless/HeadlessGraphicsEnvironment.class b/libjava/classpath/lib/gnu/java/awt/peer/headless/HeadlessGraphicsEnvironment.class
new file mode 100644
index 00000000000..83f88f9fb8a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/headless/HeadlessGraphicsEnvironment.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/headless/HeadlessToolkit.class b/libjava/classpath/lib/gnu/java/awt/peer/headless/HeadlessToolkit.class
new file mode 100644
index 00000000000..609c79cf092
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/headless/HeadlessToolkit.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/MainQtThread.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/MainQtThread.class
new file mode 100644
index 00000000000..405283f49fb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/MainQtThread.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/NativeWrapper.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/NativeWrapper.class
new file mode 100644
index 00000000000..a11283bde1b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/NativeWrapper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QMatrix.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QMatrix.class
new file mode 100644
index 00000000000..3a514fe5b94
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QMatrix.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QPainterPath.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QPainterPath.class
new file mode 100644
index 00000000000..86e55c0cada
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QPainterPath.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QPen.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QPen.class
new file mode 100644
index 00000000000..2bb3ebb3ebc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QPen.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtAudioClip.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtAudioClip.class
new file mode 100644
index 00000000000..134f45c3498
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtAudioClip.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtButtonPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtButtonPeer.class
new file mode 100644
index 00000000000..5f1ae747e75
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtButtonPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtCanvasPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtCanvasPeer.class
new file mode 100644
index 00000000000..21f82b53c18
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtCanvasPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtCheckboxPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtCheckboxPeer.class
new file mode 100644
index 00000000000..c3bf72b2b08
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtCheckboxPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtChoicePeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtChoicePeer.class
new file mode 100644
index 00000000000..3b95253e1a0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtChoicePeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtComponentGraphics.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtComponentGraphics.class
new file mode 100644
index 00000000000..62adf5f30cd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtComponentGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtComponentPeer$RepaintTimerTask.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtComponentPeer$RepaintTimerTask.class
new file mode 100644
index 00000000000..753994d8f9c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtComponentPeer$RepaintTimerTask.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtComponentPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtComponentPeer.class
new file mode 100644
index 00000000000..f41b6b1a33e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtComponentPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtContainerPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtContainerPeer.class
new file mode 100644
index 00000000000..47bd94ed763
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtContainerPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtDialogPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtDialogPeer.class
new file mode 100644
index 00000000000..5123eea84c2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtDialogPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtEmbeddedWindowPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtEmbeddedWindowPeer.class
new file mode 100644
index 00000000000..db22dbc97d6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtEmbeddedWindowPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtFileDialogPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtFileDialogPeer.class
new file mode 100644
index 00000000000..0ea094826fc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtFileDialogPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtFontMetrics.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtFontMetrics.class
new file mode 100644
index 00000000000..f70900ce602
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtFontMetrics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtFontPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtFontPeer.class
new file mode 100644
index 00000000000..dfdfde005b1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtFontPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtFramePeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtFramePeer.class
new file mode 100644
index 00000000000..d658fe22eda
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtFramePeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtGraphics.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtGraphics.class
new file mode 100644
index 00000000000..922e7102897
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtGraphicsEnvironment.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtGraphicsEnvironment.class
new file mode 100644
index 00000000000..a13721aa2ae
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtGraphicsEnvironment.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtImage.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtImage.class
new file mode 100644
index 00000000000..737657f91f3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtImage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtImageConsumer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtImageConsumer.class
new file mode 100644
index 00000000000..dcbf9f85a61
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtImageConsumer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtImageDirectGraphics.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtImageDirectGraphics.class
new file mode 100644
index 00000000000..fd14c75902a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtImageDirectGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtImageGraphics.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtImageGraphics.class
new file mode 100644
index 00000000000..2729dea88a0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtImageGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtLabelPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtLabelPeer.class
new file mode 100644
index 00000000000..afe1edccaab
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtLabelPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtListPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtListPeer.class
new file mode 100644
index 00000000000..68aa5d1c301
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtListPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuBarPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuBarPeer.class
new file mode 100644
index 00000000000..7486b331a07
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuBarPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuComponentPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuComponentPeer.class
new file mode 100644
index 00000000000..aa832f3a2ec
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuComponentPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuItemPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuItemPeer.class
new file mode 100644
index 00000000000..daf3915702c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuItemPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuPeer.class
new file mode 100644
index 00000000000..cb09534d395
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtMenuPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtPanelPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtPanelPeer.class
new file mode 100644
index 00000000000..c2f879ad9ad
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtPanelPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtPopupMenuPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtPopupMenuPeer.class
new file mode 100644
index 00000000000..ac7e26a97e2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtPopupMenuPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtRepaintThread$RepaintComponent.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtRepaintThread$RepaintComponent.class
new file mode 100644
index 00000000000..fbe705535c5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtRepaintThread$RepaintComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtRepaintThread.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtRepaintThread.class
new file mode 100644
index 00000000000..2a608811105
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtRepaintThread.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtScreenDevice.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtScreenDevice.class
new file mode 100644
index 00000000000..d3b13af2084
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtScreenDevice.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtScreenDeviceConfiguration.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtScreenDeviceConfiguration.class
new file mode 100644
index 00000000000..ea2937a54b9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtScreenDeviceConfiguration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtScrollPanePeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtScrollPanePeer.class
new file mode 100644
index 00000000000..175f69d486e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtScrollPanePeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtScrollbarPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtScrollbarPeer.class
new file mode 100644
index 00000000000..500b12a6752
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtScrollbarPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtTextAreaPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtTextAreaPeer.class
new file mode 100644
index 00000000000..56d5a334ca7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtTextAreaPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtTextFieldPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtTextFieldPeer.class
new file mode 100644
index 00000000000..63e4fb0b006
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtTextFieldPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtToolkit.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtToolkit.class
new file mode 100644
index 00000000000..40669292c92
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtToolkit.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtVolatileImage$1.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtVolatileImage$1.class
new file mode 100644
index 00000000000..d290cfd2d64
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtVolatileImage$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtVolatileImage.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtVolatileImage.class
new file mode 100644
index 00000000000..d3c5a27e32f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtVolatileImage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/qt/QtWindowPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtWindowPeer.class
new file mode 100644
index 00000000000..ae9fa720e73
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/qt/QtWindowPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingButtonPeer$SwingButton.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingButtonPeer$SwingButton.class
new file mode 100644
index 00000000000..602b48fb91b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingButtonPeer$SwingButton.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingButtonPeer$SwingButtonListener.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingButtonPeer$SwingButtonListener.class
new file mode 100644
index 00000000000..24adbb8af3c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingButtonPeer$SwingButtonListener.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingButtonPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingButtonPeer.class
new file mode 100644
index 00000000000..8c8a09afeeb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingButtonPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingCanvasPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingCanvasPeer.class
new file mode 100644
index 00000000000..d5c8cec0157
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingCanvasPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingComponent.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingComponent.class
new file mode 100644
index 00000000000..75a9113d86e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingComponentPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingComponentPeer.class
new file mode 100644
index 00000000000..41c7972205c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingComponentPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingContainerPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingContainerPeer.class
new file mode 100644
index 00000000000..edf0a7d0b7b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingContainerPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingFramePeer.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingFramePeer.class
new file mode 100644
index 00000000000..f70594d7b35
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingFramePeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingLabelPeer$SwingLabel.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingLabelPeer$SwingLabel.class
new file mode 100644
index 00000000000..2334fe73c75
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingLabelPeer$SwingLabel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingLabelPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingLabelPeer.class
new file mode 100644
index 00000000000..7d34f8504f2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingLabelPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingListPeer$SwingList.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingListPeer$SwingList.class
new file mode 100644
index 00000000000..6351297a9d0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingListPeer$SwingList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingListPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingListPeer.class
new file mode 100644
index 00000000000..094a417f432
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingListPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuBarPeer$SwingMenuBar.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuBarPeer$SwingMenuBar.class
new file mode 100644
index 00000000000..0e5d050c32d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuBarPeer$SwingMenuBar.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuBarPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuBarPeer.class
new file mode 100644
index 00000000000..6fa417b0fed
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuBarPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuItemPeer$SwingMenuItemListener.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuItemPeer$SwingMenuItemListener.class
new file mode 100644
index 00000000000..a9eb8411f24
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuItemPeer$SwingMenuItemListener.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuItemPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuItemPeer.class
new file mode 100644
index 00000000000..c571ead688b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuItemPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuPeer$SwingMenu.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuPeer$SwingMenu.class
new file mode 100644
index 00000000000..409c1f7ac5a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuPeer$SwingMenu.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuPeer.class
new file mode 100644
index 00000000000..b7f8b64235d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingMenuPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingPanelPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingPanelPeer.class
new file mode 100644
index 00000000000..18e9842d89c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingPanelPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextAreaPeer$SwingTextArea.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextAreaPeer$SwingTextArea.class
new file mode 100644
index 00000000000..59edb75bbe0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextAreaPeer$SwingTextArea.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextAreaPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextAreaPeer.class
new file mode 100644
index 00000000000..e8836be2637
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextAreaPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextFieldPeer$SwingTextField.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextFieldPeer$SwingTextField.class
new file mode 100644
index 00000000000..fe242f791dc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextFieldPeer$SwingTextField.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextFieldPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextFieldPeer.class
new file mode 100644
index 00000000000..0250fba193b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingTextFieldPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingToolkit.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingToolkit.class
new file mode 100644
index 00000000000..f44acac3806
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingToolkit.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingWindowPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingWindowPeer.class
new file mode 100644
index 00000000000..f3f2f6fb9a0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/peer/swing/SwingWindowPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/print/JavaPrinterGraphics.class b/libjava/classpath/lib/gnu/java/awt/print/JavaPrinterGraphics.class
new file mode 100644
index 00000000000..fc1d805fe4b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/print/JavaPrinterGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/print/JavaPrinterJob.class b/libjava/classpath/lib/gnu/java/awt/print/JavaPrinterJob.class
new file mode 100644
index 00000000000..823adb2464b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/print/JavaPrinterJob.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/print/PostScriptGraphics2D.class b/libjava/classpath/lib/gnu/java/awt/print/PostScriptGraphics2D.class
new file mode 100644
index 00000000000..a19303c4239
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/print/PostScriptGraphics2D.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/print/SpooledDocument.class b/libjava/classpath/lib/gnu/java/awt/print/SpooledDocument.class
new file mode 100644
index 00000000000..3fcf170debf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/awt/print/SpooledDocument.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/BeanInfoEmbryo.class b/libjava/classpath/lib/gnu/java/beans/BeanInfoEmbryo.class
new file mode 100644
index 00000000000..c1d5b277caf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/BeanInfoEmbryo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/DefaultExceptionListener.class b/libjava/classpath/lib/gnu/java/beans/DefaultExceptionListener.class
new file mode 100644
index 00000000000..447615f2ee7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/DefaultExceptionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/DoubleKey.class b/libjava/classpath/lib/gnu/java/beans/DoubleKey.class
new file mode 100644
index 00000000000..23f32207594
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/DoubleKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/DummyAppletContext.class b/libjava/classpath/lib/gnu/java/beans/DummyAppletContext.class
new file mode 100644
index 00000000000..107f28451ed
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/DummyAppletContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/DummyAppletStub.class b/libjava/classpath/lib/gnu/java/beans/DummyAppletStub.class
new file mode 100644
index 00000000000..f15b6dd21bf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/DummyAppletStub.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/ExplicitBeanInfo.class b/libjava/classpath/lib/gnu/java/beans/ExplicitBeanInfo.class
new file mode 100644
index 00000000000..6ecc8847a49
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/ExplicitBeanInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/IntrospectionIncubator.class b/libjava/classpath/lib/gnu/java/beans/IntrospectionIncubator.class
new file mode 100644
index 00000000000..8d714b5c02c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/IntrospectionIncubator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/AbstractContext.class b/libjava/classpath/lib/gnu/java/beans/decoder/AbstractContext.class
new file mode 100644
index 00000000000..aacfd92f2e0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/AbstractContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/AbstractCreatableObjectContext.class b/libjava/classpath/lib/gnu/java/beans/decoder/AbstractCreatableObjectContext.class
new file mode 100644
index 00000000000..16cd898b203
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/AbstractCreatableObjectContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/AbstractElementHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/AbstractElementHandler.class
new file mode 100644
index 00000000000..f46cc064370
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/AbstractElementHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/AbstractObjectContext.class b/libjava/classpath/lib/gnu/java/beans/decoder/AbstractObjectContext.class
new file mode 100644
index 00000000000..acb6cac35ed
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/AbstractObjectContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/ArrayContext.class b/libjava/classpath/lib/gnu/java/beans/decoder/ArrayContext.class
new file mode 100644
index 00000000000..0d859204211
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/ArrayContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/ArrayHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/ArrayHandler.class
new file mode 100644
index 00000000000..c463af07fce
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/ArrayHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/AssemblyException.class b/libjava/classpath/lib/gnu/java/beans/decoder/AssemblyException.class
new file mode 100644
index 00000000000..7ebd9a2c23b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/AssemblyException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/BooleanHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/BooleanHandler.class
new file mode 100644
index 00000000000..ca089192694
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/BooleanHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/ByteHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/ByteHandler.class
new file mode 100644
index 00000000000..593c134a404
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/ByteHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/CharHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/CharHandler.class
new file mode 100644
index 00000000000..66f9e156358
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/CharHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/ClassHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/ClassHandler.class
new file mode 100644
index 00000000000..3f46b96e284
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/ClassHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/ConstructorContext.class b/libjava/classpath/lib/gnu/java/beans/decoder/ConstructorContext.class
new file mode 100644
index 00000000000..5eb460eedf3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/ConstructorContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/Context.class b/libjava/classpath/lib/gnu/java/beans/decoder/Context.class
new file mode 100644
index 00000000000..8754b12fd37
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/Context.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/DecoderContext.class b/libjava/classpath/lib/gnu/java/beans/decoder/DecoderContext.class
new file mode 100644
index 00000000000..e4de1f5def2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/DecoderContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/DoubleHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/DoubleHandler.class
new file mode 100644
index 00000000000..a9c063218ab
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/DoubleHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/DummyContext.class b/libjava/classpath/lib/gnu/java/beans/decoder/DummyContext.class
new file mode 100644
index 00000000000..9877814d6e8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/DummyContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/DummyHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/DummyHandler.class
new file mode 100644
index 00000000000..fdd55743363
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/DummyHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/ElementHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/ElementHandler.class
new file mode 100644
index 00000000000..c80530b6ef0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/ElementHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/FloatHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/FloatHandler.class
new file mode 100644
index 00000000000..64158311e40
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/FloatHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/GrowableArrayContext.class b/libjava/classpath/lib/gnu/java/beans/decoder/GrowableArrayContext.class
new file mode 100644
index 00000000000..18954269711
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/GrowableArrayContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/IndexContext.class b/libjava/classpath/lib/gnu/java/beans/decoder/IndexContext.class
new file mode 100644
index 00000000000..6290b2973af
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/IndexContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/IntHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/IntHandler.class
new file mode 100644
index 00000000000..f7bf4d59493
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/IntHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/JavaHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/JavaHandler.class
new file mode 100644
index 00000000000..5a5f3b65d8c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/JavaHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/LongHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/LongHandler.class
new file mode 100644
index 00000000000..0ec0762a263
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/LongHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/MethodContext.class b/libjava/classpath/lib/gnu/java/beans/decoder/MethodContext.class
new file mode 100644
index 00000000000..c2dc1151cf2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/MethodContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/MethodFinder.class b/libjava/classpath/lib/gnu/java/beans/decoder/MethodFinder.class
new file mode 100644
index 00000000000..8d04024bb81
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/MethodFinder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/NullHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/NullHandler.class
new file mode 100644
index 00000000000..2861be28771
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/NullHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/ObjectContext.class b/libjava/classpath/lib/gnu/java/beans/decoder/ObjectContext.class
new file mode 100644
index 00000000000..2efa16a940f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/ObjectContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/ObjectHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/ObjectHandler.class
new file mode 100644
index 00000000000..4dc2d191fed
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/ObjectHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ArrayHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ArrayHandlerCreator.class
new file mode 100644
index 00000000000..60d8209c67e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ArrayHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$BooleanHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$BooleanHandlerCreator.class
new file mode 100644
index 00000000000..172160ffd54
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$BooleanHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ByteHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ByteHandlerCreator.class
new file mode 100644
index 00000000000..745f552df2a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ByteHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$CharHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$CharHandlerCreator.class
new file mode 100644
index 00000000000..40b14a41a22
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$CharHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ClassHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ClassHandlerCreator.class
new file mode 100644
index 00000000000..711db205b9f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ClassHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$Creator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$Creator.class
new file mode 100644
index 00000000000..d1321619fda
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$Creator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$DoubleHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$DoubleHandlerCreator.class
new file mode 100644
index 00000000000..e07c444da61
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$DoubleHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$FloatHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$FloatHandlerCreator.class
new file mode 100644
index 00000000000..7498fb0316a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$FloatHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$IntHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$IntHandlerCreator.class
new file mode 100644
index 00000000000..4bf147bd89c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$IntHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$JavaHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$JavaHandlerCreator.class
new file mode 100644
index 00000000000..3bd67f5c40b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$JavaHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$LongHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$LongHandlerCreator.class
new file mode 100644
index 00000000000..0129d63545b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$LongHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$NullHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$NullHandlerCreator.class
new file mode 100644
index 00000000000..b1ed7ad4fbb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$NullHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ObjectHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ObjectHandlerCreator.class
new file mode 100644
index 00000000000..4574efc157f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ObjectHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ShortHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ShortHandlerCreator.class
new file mode 100644
index 00000000000..ed04aa5ba4e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$ShortHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$StringHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$StringHandlerCreator.class
new file mode 100644
index 00000000000..9f5b8049292
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$StringHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$VoidHandlerCreator.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$VoidHandlerCreator.class
new file mode 100644
index 00000000000..2368742b3df
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser$VoidHandlerCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser.class b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser.class
new file mode 100644
index 00000000000..a6b6cc0df92
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PersistenceParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/PropertyContext.class b/libjava/classpath/lib/gnu/java/beans/decoder/PropertyContext.class
new file mode 100644
index 00000000000..28a58910a0d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/PropertyContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/ShortHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/ShortHandler.class
new file mode 100644
index 00000000000..012ce512026
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/ShortHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/SimpleHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/SimpleHandler.class
new file mode 100644
index 00000000000..c549f8af827
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/SimpleHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/StaticMethodContext.class b/libjava/classpath/lib/gnu/java/beans/decoder/StaticMethodContext.class
new file mode 100644
index 00000000000..a1ee4aed140
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/StaticMethodContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/StringHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/StringHandler.class
new file mode 100644
index 00000000000..643ed3f395d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/StringHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/decoder/VoidHandler.class b/libjava/classpath/lib/gnu/java/beans/decoder/VoidHandler.class
new file mode 100644
index 00000000000..82b5e9885b2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/decoder/VoidHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/editors/ColorEditor.class b/libjava/classpath/lib/gnu/java/beans/editors/ColorEditor.class
new file mode 100644
index 00000000000..5d010e752bb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/editors/ColorEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/editors/FontEditor.class b/libjava/classpath/lib/gnu/java/beans/editors/FontEditor.class
new file mode 100644
index 00000000000..976d05d7e7d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/editors/FontEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/editors/NativeBooleanEditor.class b/libjava/classpath/lib/gnu/java/beans/editors/NativeBooleanEditor.class
new file mode 100644
index 00000000000..e59fdceca41
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/editors/NativeBooleanEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/editors/NativeByteEditor.class b/libjava/classpath/lib/gnu/java/beans/editors/NativeByteEditor.class
new file mode 100644
index 00000000000..acf80903d48
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/editors/NativeByteEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/editors/NativeDoubleEditor.class b/libjava/classpath/lib/gnu/java/beans/editors/NativeDoubleEditor.class
new file mode 100644
index 00000000000..74f6a332217
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/editors/NativeDoubleEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/editors/NativeFloatEditor.class b/libjava/classpath/lib/gnu/java/beans/editors/NativeFloatEditor.class
new file mode 100644
index 00000000000..928dc783ff3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/editors/NativeFloatEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/editors/NativeIntEditor.class b/libjava/classpath/lib/gnu/java/beans/editors/NativeIntEditor.class
new file mode 100644
index 00000000000..8c95656ed57
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/editors/NativeIntEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/editors/NativeLongEditor.class b/libjava/classpath/lib/gnu/java/beans/editors/NativeLongEditor.class
new file mode 100644
index 00000000000..8c89201a7a2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/editors/NativeLongEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/editors/NativeShortEditor.class b/libjava/classpath/lib/gnu/java/beans/editors/NativeShortEditor.class
new file mode 100644
index 00000000000..f24af87e905
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/editors/NativeShortEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/editors/StringEditor.class b/libjava/classpath/lib/gnu/java/beans/editors/StringEditor.class
new file mode 100644
index 00000000000..da5999a779c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/editors/StringEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/ArrayPersistenceDelegate.class b/libjava/classpath/lib/gnu/java/beans/encoder/ArrayPersistenceDelegate.class
new file mode 100644
index 00000000000..79f80a38423
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/ArrayPersistenceDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/ClassPersistenceDelegate.class b/libjava/classpath/lib/gnu/java/beans/encoder/ClassPersistenceDelegate.class
new file mode 100644
index 00000000000..70dfedff6e4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/ClassPersistenceDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/CollectionPersistenceDelegate.class b/libjava/classpath/lib/gnu/java/beans/encoder/CollectionPersistenceDelegate.class
new file mode 100644
index 00000000000..7d3450cf4da
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/CollectionPersistenceDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/Context.class b/libjava/classpath/lib/gnu/java/beans/encoder/Context.class
new file mode 100644
index 00000000000..24ca4c464f7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/Context.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/GenericScannerState.class b/libjava/classpath/lib/gnu/java/beans/encoder/GenericScannerState.class
new file mode 100644
index 00000000000..2a7a74adfcb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/GenericScannerState.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/IgnoringScannerState.class b/libjava/classpath/lib/gnu/java/beans/encoder/IgnoringScannerState.class
new file mode 100644
index 00000000000..bfa63af3606
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/IgnoringScannerState.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/MapPersistenceDelegate.class b/libjava/classpath/lib/gnu/java/beans/encoder/MapPersistenceDelegate.class
new file mode 100644
index 00000000000..e69ab0aba72
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/MapPersistenceDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/ObjectId.class b/libjava/classpath/lib/gnu/java/beans/encoder/ObjectId.class
new file mode 100644
index 00000000000..595699c362e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/ObjectId.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/PrimitivePersistenceDelegate.class b/libjava/classpath/lib/gnu/java/beans/encoder/PrimitivePersistenceDelegate.class
new file mode 100644
index 00000000000..cef87423be6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/PrimitivePersistenceDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/ReportingScannerState.class b/libjava/classpath/lib/gnu/java/beans/encoder/ReportingScannerState.class
new file mode 100644
index 00000000000..7d04254cd53
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/ReportingScannerState.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/Root$RootElement.class b/libjava/classpath/lib/gnu/java/beans/encoder/Root$RootElement.class
new file mode 100644
index 00000000000..654bdbb8dd9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/Root$RootElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/Root.class b/libjava/classpath/lib/gnu/java/beans/encoder/Root.class
new file mode 100644
index 00000000000..134b03eafaf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/Root.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/ScanEngine.class b/libjava/classpath/lib/gnu/java/beans/encoder/ScanEngine.class
new file mode 100644
index 00000000000..8a7bf56d26a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/ScanEngine.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/ScannerState.class b/libjava/classpath/lib/gnu/java/beans/encoder/ScannerState.class
new file mode 100644
index 00000000000..5a582aca229
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/ScannerState.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/StAXWriter.class b/libjava/classpath/lib/gnu/java/beans/encoder/StAXWriter.class
new file mode 100644
index 00000000000..c1799e02b73
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/StAXWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/Writer.class b/libjava/classpath/lib/gnu/java/beans/encoder/Writer.class
new file mode 100644
index 00000000000..52d08008154
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/Writer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/ArrayInstantiation.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/ArrayInstantiation.class
new file mode 100644
index 00000000000..793ebbf999b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/ArrayInstantiation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/Array_Get.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/Array_Get.class
new file mode 100644
index 00000000000..a66241235f4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/Array_Get.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/Array_Set.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/Array_Set.class
new file mode 100644
index 00000000000..54ef6bccfdf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/Array_Set.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/ClassResolution.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/ClassResolution.class
new file mode 100644
index 00000000000..07dba7173e7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/ClassResolution.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/Element.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/Element.class
new file mode 100644
index 00000000000..df059b790a4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/Element.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/List_Get.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/List_Get.class
new file mode 100644
index 00000000000..3e5d0d89452
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/List_Get.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/List_Set.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/List_Set.class
new file mode 100644
index 00000000000..ca92bdef0d5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/List_Set.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/MethodInvocation.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/MethodInvocation.class
new file mode 100644
index 00000000000..bad42bcd117
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/MethodInvocation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/NullObject.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/NullObject.class
new file mode 100644
index 00000000000..8ae465fb697
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/NullObject.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/ObjectInstantiation.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/ObjectInstantiation.class
new file mode 100644
index 00000000000..8c13ec149d9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/ObjectInstantiation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/ObjectReference.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/ObjectReference.class
new file mode 100644
index 00000000000..ad8d84eae5d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/ObjectReference.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/PrimitiveInstantiation.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/PrimitiveInstantiation.class
new file mode 100644
index 00000000000..dadb0b0cb39
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/PrimitiveInstantiation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/StaticFieldAccess.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/StaticFieldAccess.class
new file mode 100644
index 00000000000..1ed966c5464
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/StaticFieldAccess.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/StaticMethodInvocation.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/StaticMethodInvocation.class
new file mode 100644
index 00000000000..895d02399c8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/StaticMethodInvocation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/beans/encoder/elements/StringReference.class b/libjava/classpath/lib/gnu/java/beans/encoder/elements/StringReference.class
new file mode 100644
index 00000000000..5b0b7d794c9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/beans/encoder/elements/StringReference.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/io/ASN1ParsingException.class b/libjava/classpath/lib/gnu/java/io/ASN1ParsingException.class
new file mode 100644
index 00000000000..a17e9703b87
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/io/ASN1ParsingException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/io/Base64InputStream.class b/libjava/classpath/lib/gnu/java/io/Base64InputStream.class
new file mode 100644
index 00000000000..a6c30791de6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/io/Base64InputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/io/ClassLoaderObjectInputStream.class b/libjava/classpath/lib/gnu/java/io/ClassLoaderObjectInputStream.class
new file mode 100644
index 00000000000..f5db7cc9604
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/io/ClassLoaderObjectInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/io/NullOutputStream.class b/libjava/classpath/lib/gnu/java/io/NullOutputStream.class
new file mode 100644
index 00000000000..f42efa75e7c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/io/NullOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/io/ObjectIdentityMap2Int.class b/libjava/classpath/lib/gnu/java/io/ObjectIdentityMap2Int.class
new file mode 100644
index 00000000000..80de46198f3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/io/ObjectIdentityMap2Int.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/io/ObjectIdentityWrapper.class b/libjava/classpath/lib/gnu/java/io/ObjectIdentityWrapper.class
new file mode 100644
index 00000000000..6bd97540589
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/io/ObjectIdentityWrapper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/io/PlatformHelper.class b/libjava/classpath/lib/gnu/java/io/PlatformHelper.class
new file mode 100644
index 00000000000..76e89f2ce92
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/io/PlatformHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/ArrayHelper.class b/libjava/classpath/lib/gnu/java/lang/ArrayHelper.class
new file mode 100644
index 00000000000..48181d048b1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/ArrayHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/CharData.class b/libjava/classpath/lib/gnu/java/lang/CharData.class
new file mode 100644
index 00000000000..44ea768e152
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/CharData.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/ClassHelper.class b/libjava/classpath/lib/gnu/java/lang/ClassHelper.class
new file mode 100644
index 00000000000..484c4a8ef80
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/ClassHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/InstrumentationImpl.class b/libjava/classpath/lib/gnu/java/lang/InstrumentationImpl.class
new file mode 100644
index 00000000000..e8caf56aec9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/InstrumentationImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/MainThread.class b/libjava/classpath/lib/gnu/java/lang/MainThread.class
new file mode 100644
index 00000000000..128ba4e0815
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/MainThread.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/VMInstrumentationImpl.class b/libjava/classpath/lib/gnu/java/lang/VMInstrumentationImpl.class
new file mode 100644
index 00000000000..d5e8c809454
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/VMInstrumentationImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/BeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/BeanImpl.class
new file mode 100644
index 00000000000..2d188b25901
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/BeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/ClassLoadingMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/ClassLoadingMXBeanImpl.class
new file mode 100644
index 00000000000..b6d7413272e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/ClassLoadingMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/CompilationMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/CompilationMXBeanImpl.class
new file mode 100644
index 00000000000..748d54ffada
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/CompilationMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/GarbageCollectorMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/GarbageCollectorMXBeanImpl.class
new file mode 100644
index 00000000000..9291b170c93
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/GarbageCollectorMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/MemoryMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/MemoryMXBeanImpl.class
new file mode 100644
index 00000000000..714075ef180
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/MemoryMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/MemoryManagerMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/MemoryManagerMXBeanImpl.class
new file mode 100644
index 00000000000..0f457326ea5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/MemoryManagerMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/MemoryPoolMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/MemoryPoolMXBeanImpl.class
new file mode 100644
index 00000000000..b9b285b53b4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/MemoryPoolMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/OperatingSystemMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/OperatingSystemMXBeanImpl.class
new file mode 100644
index 00000000000..9442a8a9dc8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/OperatingSystemMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/RuntimeMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/RuntimeMXBeanImpl.class
new file mode 100644
index 00000000000..0a610d9d644
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/RuntimeMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/ThreadMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/ThreadMXBeanImpl.class
new file mode 100644
index 00000000000..8d2f1b09365
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/ThreadMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/VMClassLoadingMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/VMClassLoadingMXBeanImpl.class
new file mode 100644
index 00000000000..988d4fb9f17
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/VMClassLoadingMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/VMCompilationMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/VMCompilationMXBeanImpl.class
new file mode 100644
index 00000000000..cd743a65fc2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/VMCompilationMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.class
new file mode 100644
index 00000000000..7ab86e616d7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/VMMemoryMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/VMMemoryMXBeanImpl.class
new file mode 100644
index 00000000000..80df17599fe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/VMMemoryMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/VMMemoryManagerMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/VMMemoryManagerMXBeanImpl.class
new file mode 100644
index 00000000000..f5d09aeecef
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/VMMemoryManagerMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/VMMemoryPoolMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/VMMemoryPoolMXBeanImpl.class
new file mode 100644
index 00000000000..422c850ba65
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/VMMemoryPoolMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/VMRuntimeMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/VMRuntimeMXBeanImpl.class
new file mode 100644
index 00000000000..7eee11d9601
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/VMRuntimeMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/management/VMThreadMXBeanImpl.class b/libjava/classpath/lib/gnu/java/lang/management/VMThreadMXBeanImpl.class
new file mode 100644
index 00000000000..a0589e04554
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/management/VMThreadMXBeanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/reflect/ClassSignatureParser.class b/libjava/classpath/lib/gnu/java/lang/reflect/ClassSignatureParser.class
new file mode 100644
index 00000000000..cca4f03b466
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/reflect/ClassSignatureParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/reflect/FieldSignatureParser.class b/libjava/classpath/lib/gnu/java/lang/reflect/FieldSignatureParser.class
new file mode 100644
index 00000000000..0f86cfaab75
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/reflect/FieldSignatureParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/reflect/GenericArrayTypeImpl.class b/libjava/classpath/lib/gnu/java/lang/reflect/GenericArrayTypeImpl.class
new file mode 100644
index 00000000000..84f2433cbaa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/reflect/GenericArrayTypeImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/reflect/GenericSignatureParser.class b/libjava/classpath/lib/gnu/java/lang/reflect/GenericSignatureParser.class
new file mode 100644
index 00000000000..11a8fa0af7b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/reflect/GenericSignatureParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/reflect/MethodSignatureParser.class b/libjava/classpath/lib/gnu/java/lang/reflect/MethodSignatureParser.class
new file mode 100644
index 00000000000..29f54424411
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/reflect/MethodSignatureParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/reflect/ParameterizedTypeImpl.class b/libjava/classpath/lib/gnu/java/lang/reflect/ParameterizedTypeImpl.class
new file mode 100644
index 00000000000..a244f0f4313
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/reflect/ParameterizedTypeImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/reflect/TypeImpl.class b/libjava/classpath/lib/gnu/java/lang/reflect/TypeImpl.class
new file mode 100644
index 00000000000..b580459f8ac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/reflect/TypeImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/reflect/TypeSignature.class b/libjava/classpath/lib/gnu/java/lang/reflect/TypeSignature.class
new file mode 100644
index 00000000000..80aa4cf7789
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/reflect/TypeSignature.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/reflect/TypeVariableImpl.class b/libjava/classpath/lib/gnu/java/lang/reflect/TypeVariableImpl.class
new file mode 100644
index 00000000000..78946cd10be
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/reflect/TypeVariableImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/reflect/UnresolvedTypeVariable.class b/libjava/classpath/lib/gnu/java/lang/reflect/UnresolvedTypeVariable.class
new file mode 100644
index 00000000000..07d9a8da059
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/reflect/UnresolvedTypeVariable.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/lang/reflect/WildcardTypeImpl.class b/libjava/classpath/lib/gnu/java/lang/reflect/WildcardTypeImpl.class
new file mode 100644
index 00000000000..98b51a98f91
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/lang/reflect/WildcardTypeImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/Calendar.class b/libjava/classpath/lib/gnu/java/locale/Calendar.class
new file mode 100644
index 00000000000..b7b8240e7de
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/Calendar.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/Calendar_de.class b/libjava/classpath/lib/gnu/java/locale/Calendar_de.class
new file mode 100644
index 00000000000..4d8c8cd22fe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/Calendar_de.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/Calendar_en.class b/libjava/classpath/lib/gnu/java/locale/Calendar_en.class
new file mode 100644
index 00000000000..a4bd37bd58c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/Calendar_en.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/Calendar_nl.class b/libjava/classpath/lib/gnu/java/locale/Calendar_nl.class
new file mode 100644
index 00000000000..12a29098390
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/Calendar_nl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleData.class b/libjava/classpath/lib/gnu/java/locale/LocaleData.class
new file mode 100644
index 00000000000..338cc8fc352
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleData.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleHelper.class b/libjava/classpath/lib/gnu/java/locale/LocaleHelper.class
new file mode 100644
index 00000000000..101cf04c4c8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation.class
new file mode 100644
index 00000000000..c9f1dec7e33
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_af_ZA.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_af_ZA.class
new file mode 100644
index 00000000000..729064cecc5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_af_ZA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_AE.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_AE.class
new file mode 100644
index 00000000000..e3c7fc7ce71
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_AE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_BH.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_BH.class
new file mode 100644
index 00000000000..b141f210444
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_BH.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_DZ.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_DZ.class
new file mode 100644
index 00000000000..fd6305f21b0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_DZ.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_EG.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_EG.class
new file mode 100644
index 00000000000..f0cbb10854d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_EG.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_IN.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_IN.class
new file mode 100644
index 00000000000..b2330f00c80
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_IN.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_IQ.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_IQ.class
new file mode 100644
index 00000000000..e95055012ad
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_IQ.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_JO.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_JO.class
new file mode 100644
index 00000000000..716e7c3d1ed
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_JO.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_KW.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_KW.class
new file mode 100644
index 00000000000..b24ade7af17
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_KW.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_LB.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_LB.class
new file mode 100644
index 00000000000..a64387beb94
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_LB.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_LY.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_LY.class
new file mode 100644
index 00000000000..8707922160b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_LY.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_MA.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_MA.class
new file mode 100644
index 00000000000..204f9ad7759
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_MA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_OM.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_OM.class
new file mode 100644
index 00000000000..8f0e338b878
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_OM.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_QA.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_QA.class
new file mode 100644
index 00000000000..d9419f3e396
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_QA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_SD.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_SD.class
new file mode 100644
index 00000000000..fe2446b0012
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_SD.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_SY.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_SY.class
new file mode 100644
index 00000000000..f48749e819e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_SY.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_TN.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_TN.class
new file mode 100644
index 00000000000..94d142985d9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_TN.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_YE.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_YE.class
new file mode 100644
index 00000000000..277a3317448
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ar_YE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_be_BY.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_be_BY.class
new file mode 100644
index 00000000000..21f5f50c372
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_be_BY.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_bn_IN.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_bn_IN.class
new file mode 100644
index 00000000000..f3ad3dff5f2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_bn_IN.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_br_FR.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_br_FR.class
new file mode 100644
index 00000000000..08a98b7d84d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_br_FR.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_bs_BA.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_bs_BA.class
new file mode 100644
index 00000000000..358c91182ec
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_bs_BA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ca_ES.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ca_ES.class
new file mode 100644
index 00000000000..a06e022c94d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ca_ES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_cs_CZ.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_cs_CZ.class
new file mode 100644
index 00000000000..269b02094eb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_cs_CZ.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_cy_GB.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_cy_GB.class
new file mode 100644
index 00000000000..43f59539d40
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_cy_GB.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_da_DK.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_da_DK.class
new file mode 100644
index 00000000000..f8ab484deae
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_da_DK.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de.class
new file mode 100644
index 00000000000..35e50631876
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_AT.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_AT.class
new file mode 100644
index 00000000000..b4183d5e4cf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_AT.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_BE.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_BE.class
new file mode 100644
index 00000000000..cdb4ed1df84
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_BE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_CH.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_CH.class
new file mode 100644
index 00000000000..03e0f52d6aa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_CH.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_DE.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_DE.class
new file mode 100644
index 00000000000..a17a8d0d9ee
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_DE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_LU.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_LU.class
new file mode 100644
index 00000000000..01d8cefca45
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_de_LU.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_el_GR.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_el_GR.class
new file mode 100644
index 00000000000..6801e4fa1ff
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_el_GR.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en.class
new file mode 100644
index 00000000000..9b0737af2f1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_AU.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_AU.class
new file mode 100644
index 00000000000..b4b4589a967
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_AU.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_BW.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_BW.class
new file mode 100644
index 00000000000..b335913c5b2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_BW.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_CA.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_CA.class
new file mode 100644
index 00000000000..fd3662fac6a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_CA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_DK.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_DK.class
new file mode 100644
index 00000000000..b21a64e2ed0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_DK.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_GB.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_GB.class
new file mode 100644
index 00000000000..726bc09d55e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_GB.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_HK.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_HK.class
new file mode 100644
index 00000000000..d93fa78ddf6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_HK.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_IE.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_IE.class
new file mode 100644
index 00000000000..29f94926666
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_IE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_IN.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_IN.class
new file mode 100644
index 00000000000..8b481d3a790
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_IN.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_NZ.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_NZ.class
new file mode 100644
index 00000000000..79da6e7893f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_NZ.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_PH.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_PH.class
new file mode 100644
index 00000000000..34b0b6de6b3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_PH.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_SG.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_SG.class
new file mode 100644
index 00000000000..bcac524b291
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_SG.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_US.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_US.class
new file mode 100644
index 00000000000..86ac887c5ba
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_US.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_ZA.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_ZA.class
new file mode 100644
index 00000000000..ad39c7410b6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_ZA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_ZW.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_ZW.class
new file mode 100644
index 00000000000..c091717dde6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_en_ZW.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_AR.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_AR.class
new file mode 100644
index 00000000000..89d7016db36
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_AR.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_BO.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_BO.class
new file mode 100644
index 00000000000..9fc3b4f1ea4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_BO.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_CL.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_CL.class
new file mode 100644
index 00000000000..2b26bbb4751
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_CL.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_CO.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_CO.class
new file mode 100644
index 00000000000..a8bdc90aeb7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_CO.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_CR.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_CR.class
new file mode 100644
index 00000000000..d04fdc6af1e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_CR.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_DO.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_DO.class
new file mode 100644
index 00000000000..ab3b866e5b3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_DO.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_EC.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_EC.class
new file mode 100644
index 00000000000..e9bfefb3cd5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_EC.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_ES.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_ES.class
new file mode 100644
index 00000000000..d6949ff6b02
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_ES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_GT.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_GT.class
new file mode 100644
index 00000000000..d973bd51292
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_GT.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_HN.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_HN.class
new file mode 100644
index 00000000000..22a9587b1fc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_HN.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_MX.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_MX.class
new file mode 100644
index 00000000000..14b1c58ae7f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_MX.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_NI.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_NI.class
new file mode 100644
index 00000000000..18e8b732dcf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_NI.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PA.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PA.class
new file mode 100644
index 00000000000..07e1832f4c6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PE.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PE.class
new file mode 100644
index 00000000000..5c979a5bb19
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PR.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PR.class
new file mode 100644
index 00000000000..9fd5d7e2b69
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PR.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PY.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PY.class
new file mode 100644
index 00000000000..a5c2920fd98
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_PY.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_SV.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_SV.class
new file mode 100644
index 00000000000..799972be2f9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_SV.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_US.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_US.class
new file mode 100644
index 00000000000..98642cd3ba1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_US.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_UY.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_UY.class
new file mode 100644
index 00000000000..1d588f93a7b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_UY.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_VE.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_VE.class
new file mode 100644
index 00000000000..807553e5a72
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_es_VE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_et_EE.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_et_EE.class
new file mode 100644
index 00000000000..24124993499
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_et_EE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_eu_ES.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_eu_ES.class
new file mode 100644
index 00000000000..19617158941
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_eu_ES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fa_IR.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fa_IR.class
new file mode 100644
index 00000000000..e66957fc387
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fa_IR.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fi_FI.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fi_FI.class
new file mode 100644
index 00000000000..55c2ee410cf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fi_FI.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fo_FO.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fo_FO.class
new file mode 100644
index 00000000000..a8dba36d778
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fo_FO.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_BE.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_BE.class
new file mode 100644
index 00000000000..ffaa796c44b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_BE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_CA.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_CA.class
new file mode 100644
index 00000000000..45f47a39afd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_CA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_CH.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_CH.class
new file mode 100644
index 00000000000..5d38b8e3add
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_CH.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_FR.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_FR.class
new file mode 100644
index 00000000000..e9f94c3259d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_FR.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_LU.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_LU.class
new file mode 100644
index 00000000000..d85f9c12833
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_fr_LU.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ga_IE.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ga_IE.class
new file mode 100644
index 00000000000..49406bdd3c7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ga_IE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_gd_GB.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_gd_GB.class
new file mode 100644
index 00000000000..783ca689b98
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_gd_GB.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_gl_ES.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_gl_ES.class
new file mode 100644
index 00000000000..02d23282fa2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_gl_ES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_gv_GB.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_gv_GB.class
new file mode 100644
index 00000000000..7d8d888c205
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_gv_GB.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_he_IL.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_he_IL.class
new file mode 100644
index 00000000000..cdf9faa6813
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_he_IL.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_hi_IN.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_hi_IN.class
new file mode 100644
index 00000000000..1455cf41094
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_hi_IN.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_hr_HR.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_hr_HR.class
new file mode 100644
index 00000000000..a0b17507e09
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_hr_HR.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_hu_HU.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_hu_HU.class
new file mode 100644
index 00000000000..669990ff552
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_hu_HU.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_id_ID.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_id_ID.class
new file mode 100644
index 00000000000..f92f3f5b4ec
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_id_ID.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_it_CH.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_it_CH.class
new file mode 100644
index 00000000000..84a8630b1ac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_it_CH.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_it_IT.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_it_IT.class
new file mode 100644
index 00000000000..9ba8a69446d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_it_IT.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_iw_IL.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_iw_IL.class
new file mode 100644
index 00000000000..72274174fe8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_iw_IL.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ja_JP.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ja_JP.class
new file mode 100644
index 00000000000..80cd3d37019
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ja_JP.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ka_GE.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ka_GE.class
new file mode 100644
index 00000000000..5fa3ef3ae47
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ka_GE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_kl_GL.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_kl_GL.class
new file mode 100644
index 00000000000..b135dd6be12
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_kl_GL.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ko_KR.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ko_KR.class
new file mode 100644
index 00000000000..f15729b3774
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ko_KR.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_kw_GB.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_kw_GB.class
new file mode 100644
index 00000000000..6455ce9cabd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_kw_GB.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_lt_LT.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_lt_LT.class
new file mode 100644
index 00000000000..a2d480d87f4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_lt_LT.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_lv_LV.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_lv_LV.class
new file mode 100644
index 00000000000..7b1fb49fe94
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_lv_LV.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_mi_NZ.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_mi_NZ.class
new file mode 100644
index 00000000000..b51852fecbd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_mi_NZ.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_mk_MK.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_mk_MK.class
new file mode 100644
index 00000000000..fe192ab51fb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_mk_MK.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_mr_IN.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_mr_IN.class
new file mode 100644
index 00000000000..1d3a552d3e9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_mr_IN.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_mt_MT.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_mt_MT.class
new file mode 100644
index 00000000000..f2f84f2dffc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_mt_MT.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_nl.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_nl.class
new file mode 100644
index 00000000000..9c0d94886a9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_nl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_nl_BE.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_nl_BE.class
new file mode 100644
index 00000000000..dca6e00fcfe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_nl_BE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_nl_NL.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_nl_NL.class
new file mode 100644
index 00000000000..2b56f82dbed
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_nl_NL.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_nn_NO.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_nn_NO.class
new file mode 100644
index 00000000000..1bbdb0e6278
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_nn_NO.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_no_NO.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_no_NO.class
new file mode 100644
index 00000000000..7790732dc65
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_no_NO.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_oc_FR.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_oc_FR.class
new file mode 100644
index 00000000000..7dcb834cf48
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_oc_FR.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_pl_PL.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_pl_PL.class
new file mode 100644
index 00000000000..f74b3d0cd99
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_pl_PL.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_pt_BR.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_pt_BR.class
new file mode 100644
index 00000000000..2723253fd7e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_pt_BR.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_pt_PT.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_pt_PT.class
new file mode 100644
index 00000000000..bf2692ee02a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_pt_PT.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ro_RO.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ro_RO.class
new file mode 100644
index 00000000000..7e8a32cbd1b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ro_RO.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ru_RU.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ru_RU.class
new file mode 100644
index 00000000000..ae37812879a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ru_RU.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ru_UA.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ru_UA.class
new file mode 100644
index 00000000000..65f67e8d30d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ru_UA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_se_NO.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_se_NO.class
new file mode 100644
index 00000000000..df03a3f52c8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_se_NO.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sk_SK.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sk_SK.class
new file mode 100644
index 00000000000..a847f706658
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sk_SK.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sl_SI.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sl_SI.class
new file mode 100644
index 00000000000..ceed0395b90
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sl_SI.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sq_AL.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sq_AL.class
new file mode 100644
index 00000000000..f2bf4fae11c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sq_AL.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sr_YU.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sr_YU.class
new file mode 100644
index 00000000000..95386a25b35
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sr_YU.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sv_FI.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sv_FI.class
new file mode 100644
index 00000000000..352e9bf557d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sv_FI.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sv_SE.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sv_SE.class
new file mode 100644
index 00000000000..a9f6592fffc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_sv_SE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ta_IN.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ta_IN.class
new file mode 100644
index 00000000000..0df44135d9c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ta_IN.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_te_IN.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_te_IN.class
new file mode 100644
index 00000000000..7fda0919519
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_te_IN.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_tg_TJ.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_tg_TJ.class
new file mode 100644
index 00000000000..6f137d6aa90
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_tg_TJ.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_tl_PH.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_tl_PH.class
new file mode 100644
index 00000000000..8638b0b4b16
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_tl_PH.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_tr_TR.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_tr_TR.class
new file mode 100644
index 00000000000..37eb8a3ac51
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_tr_TR.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_uk_UA.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_uk_UA.class
new file mode 100644
index 00000000000..435c40fcfbc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_uk_UA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ur_PK.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ur_PK.class
new file mode 100644
index 00000000000..f9f79c8c27d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_ur_PK.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_uz_UZ.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_uz_UZ.class
new file mode 100644
index 00000000000..99520b036fb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_uz_UZ.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_vi_VN.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_vi_VN.class
new file mode 100644
index 00000000000..537181b9971
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_vi_VN.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_yi_US.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_yi_US.class
new file mode 100644
index 00000000000..59b99e01411
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_yi_US.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_CN.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_CN.class
new file mode 100644
index 00000000000..248fa2e5e1b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_CN.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_HK.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_HK.class
new file mode 100644
index 00000000000..43826134f7b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_HK.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_SG.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_SG.class
new file mode 100644
index 00000000000..8129928f8d1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_SG.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_TW.class b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_TW.class
new file mode 100644
index 00000000000..075188639f7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleInformation_zh_TW.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/math/MPN.class b/libjava/classpath/lib/gnu/java/math/MPN.class
new file mode 100644
index 00000000000..1893134596e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/math/MPN.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/BASE64.class b/libjava/classpath/lib/gnu/java/net/BASE64.class
new file mode 100644
index 00000000000..45e8b6793e2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/BASE64.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/CRLFInputStream.class b/libjava/classpath/lib/gnu/java/net/CRLFInputStream.class
new file mode 100644
index 00000000000..90ac71c5866
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/CRLFInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/CRLFOutputStream.class b/libjava/classpath/lib/gnu/java/net/CRLFOutputStream.class
new file mode 100644
index 00000000000..8133d6f5c9d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/CRLFOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/DefaultContentHandlerFactory.class b/libjava/classpath/lib/gnu/java/net/DefaultContentHandlerFactory.class
new file mode 100644
index 00000000000..c8df6145f83
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/DefaultContentHandlerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/DefaultProxySelector.class b/libjava/classpath/lib/gnu/java/net/DefaultProxySelector.class
new file mode 100644
index 00000000000..7f1ac73b1b8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/DefaultProxySelector.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/EmptyX509TrustManager.class b/libjava/classpath/lib/gnu/java/net/EmptyX509TrustManager.class
new file mode 100644
index 00000000000..ce58175f9f8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/EmptyX509TrustManager.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/GetLocalHostAction.class b/libjava/classpath/lib/gnu/java/net/GetLocalHostAction.class
new file mode 100644
index 00000000000..ff5b5a4f491
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/GetLocalHostAction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/HeaderFieldHelper.class b/libjava/classpath/lib/gnu/java/net/HeaderFieldHelper.class
new file mode 100644
index 00000000000..6f6b28abb9c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/HeaderFieldHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/ImageHandler.class b/libjava/classpath/lib/gnu/java/net/ImageHandler.class
new file mode 100644
index 00000000000..02848b621dc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/ImageHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/IndexListParser.class b/libjava/classpath/lib/gnu/java/net/IndexListParser.class
new file mode 100644
index 00000000000..8aa7b07c034
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/IndexListParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/LineInputStream.class b/libjava/classpath/lib/gnu/java/net/LineInputStream.class
new file mode 100644
index 00000000000..3f8e906acac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/LineInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/PlainDatagramSocketImpl.class b/libjava/classpath/lib/gnu/java/net/PlainDatagramSocketImpl.class
new file mode 100644
index 00000000000..376931bdd68
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/PlainDatagramSocketImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketInputStream.class b/libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketInputStream.class
new file mode 100644
index 00000000000..c03ad3228a8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketOutputStream.class b/libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketOutputStream.class
new file mode 100644
index 00000000000..4b93b302f00
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/PlainSocketImpl$SocketOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/PlainSocketImpl.class b/libjava/classpath/lib/gnu/java/net/PlainSocketImpl.class
new file mode 100644
index 00000000000..7b9e3e8b878
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/PlainSocketImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/URLParseError.class b/libjava/classpath/lib/gnu/java/net/URLParseError.class
new file mode 100644
index 00000000000..d0b903cd36e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/URLParseError.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/loader/FileResource.class b/libjava/classpath/lib/gnu/java/net/loader/FileResource.class
new file mode 100644
index 00000000000..a5bf750a841
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/loader/FileResource.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/loader/FileURLLoader.class b/libjava/classpath/lib/gnu/java/net/loader/FileURLLoader.class
new file mode 100644
index 00000000000..96d33fa16fd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/loader/FileURLLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/loader/JarURLLoader.class b/libjava/classpath/lib/gnu/java/net/loader/JarURLLoader.class
new file mode 100644
index 00000000000..403e4e967e9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/loader/JarURLLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/loader/JarURLResource.class b/libjava/classpath/lib/gnu/java/net/loader/JarURLResource.class
new file mode 100644
index 00000000000..1ceca69272c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/loader/JarURLResource.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/loader/RemoteResource.class b/libjava/classpath/lib/gnu/java/net/loader/RemoteResource.class
new file mode 100644
index 00000000000..b11c6fca789
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/loader/RemoteResource.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/loader/RemoteURLLoader.class b/libjava/classpath/lib/gnu/java/net/loader/RemoteURLLoader.class
new file mode 100644
index 00000000000..7b498aa4d4f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/loader/RemoteURLLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/loader/Resource.class b/libjava/classpath/lib/gnu/java/net/loader/Resource.class
new file mode 100644
index 00000000000..23565e1fb31
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/loader/Resource.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/loader/URLLoader.class b/libjava/classpath/lib/gnu/java/net/loader/URLLoader.class
new file mode 100644
index 00000000000..f64dacb3ae7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/loader/URLLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/loader/URLStreamHandlerCache.class b/libjava/classpath/lib/gnu/java/net/loader/URLStreamHandlerCache.class
new file mode 100644
index 00000000000..a218ce9c490
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/loader/URLStreamHandlerCache.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/local/LocalServerSocket.class b/libjava/classpath/lib/gnu/java/net/local/LocalServerSocket.class
new file mode 100644
index 00000000000..546291d3b56
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/local/LocalServerSocket.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/local/LocalSocket.class b/libjava/classpath/lib/gnu/java/net/local/LocalSocket.class
new file mode 100644
index 00000000000..8a2707e1315
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/local/LocalSocket.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/local/LocalSocketAddress.class b/libjava/classpath/lib/gnu/java/net/local/LocalSocketAddress.class
new file mode 100644
index 00000000000..fa23b4d4bc7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/local/LocalSocketAddress.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/local/LocalSocketImpl$LocalInputStream.class b/libjava/classpath/lib/gnu/java/net/local/LocalSocketImpl$LocalInputStream.class
new file mode 100644
index 00000000000..63ed23d8d38
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/local/LocalSocketImpl$LocalInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/local/LocalSocketImpl$LocalOutputStream.class b/libjava/classpath/lib/gnu/java/net/local/LocalSocketImpl$LocalOutputStream.class
new file mode 100644
index 00000000000..7c239d4ee28
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/local/LocalSocketImpl$LocalOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/local/LocalSocketImpl.class b/libjava/classpath/lib/gnu/java/net/local/LocalSocketImpl.class
new file mode 100644
index 00000000000..34b587ad0de
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/local/LocalSocketImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/core/Connection.class b/libjava/classpath/lib/gnu/java/net/protocol/core/Connection.class
new file mode 100644
index 00000000000..339a3e87fa4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/core/Connection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/core/CoreInputStream.class b/libjava/classpath/lib/gnu/java/net/protocol/core/CoreInputStream.class
new file mode 100644
index 00000000000..ca3b397efd1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/core/CoreInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/core/Handler.class b/libjava/classpath/lib/gnu/java/net/protocol/core/Handler.class
new file mode 100644
index 00000000000..f4869133e31
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/core/Handler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/file/Connection$StaticData.class b/libjava/classpath/lib/gnu/java/net/protocol/file/Connection$StaticData.class
new file mode 100644
index 00000000000..fd22f746a60
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/file/Connection$StaticData.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/file/Connection.class b/libjava/classpath/lib/gnu/java/net/protocol/file/Connection.class
new file mode 100644
index 00000000000..522343b2efb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/file/Connection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/file/Handler.class b/libjava/classpath/lib/gnu/java/net/protocol/file/Handler.class
new file mode 100644
index 00000000000..d122e0c6e63
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/file/Handler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/ActiveModeDTP.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/ActiveModeDTP.class
new file mode 100644
index 00000000000..ebd0caa719c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/ActiveModeDTP.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/BlockInputStream.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/BlockInputStream.class
new file mode 100644
index 00000000000..ce1c6bafa54
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/BlockInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/BlockOutputStream.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/BlockOutputStream.class
new file mode 100644
index 00000000000..086a3293cf2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/BlockOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/CompressedInputStream.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/CompressedInputStream.class
new file mode 100644
index 00000000000..90704cdce65
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/CompressedInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/CompressedOutputStream.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/CompressedOutputStream.class
new file mode 100644
index 00000000000..894d77070cb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/CompressedOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/DTP.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/DTP.class
new file mode 100644
index 00000000000..007d01e24c7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/DTP.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/DTPInputStream.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/DTPInputStream.class
new file mode 100644
index 00000000000..9f3a4bcc973
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/DTPInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/DTPOutputStream.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/DTPOutputStream.class
new file mode 100644
index 00000000000..4d48d3c2647
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/DTPOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPConnection.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPConnection.class
new file mode 100644
index 00000000000..bca990e550e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPException.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPException.class
new file mode 100644
index 00000000000..f52293ed605
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPResponse.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPResponse.class
new file mode 100644
index 00000000000..13e8a9fedaa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPResponse.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPURLConnection$ClosingInputStream.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPURLConnection$ClosingInputStream.class
new file mode 100644
index 00000000000..94df65728c6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPURLConnection$ClosingInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPURLConnection$ClosingOutputStream.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPURLConnection$ClosingOutputStream.class
new file mode 100644
index 00000000000..bb6e74b3600
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPURLConnection$ClosingOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPURLConnection.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPURLConnection.class
new file mode 100644
index 00000000000..29c476162c2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/FTPURLConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/Handler.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/Handler.class
new file mode 100644
index 00000000000..685c9070ca7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/Handler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/PassiveModeDTP.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/PassiveModeDTP.class
new file mode 100644
index 00000000000..611b0e3b6d4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/PassiveModeDTP.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/StreamInputStream.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/StreamInputStream.class
new file mode 100644
index 00000000000..e97e4cbe4c1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/StreamInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/ftp/StreamOutputStream.class b/libjava/classpath/lib/gnu/java/net/protocol/ftp/StreamOutputStream.class
new file mode 100644
index 00000000000..bc74bf96d13
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/ftp/StreamOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/gcjlib/Connection.class b/libjava/classpath/lib/gnu/java/net/protocol/gcjlib/Connection.class
new file mode 100644
index 00000000000..f035395d0e1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/gcjlib/Connection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/gcjlib/Handler.class b/libjava/classpath/lib/gnu/java/net/protocol/gcjlib/Handler.class
new file mode 100644
index 00000000000..f3104480ae4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/gcjlib/Handler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/Authenticator.class b/libjava/classpath/lib/gnu/java/net/protocol/http/Authenticator.class
new file mode 100644
index 00000000000..318aa3a6a72
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/Authenticator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.class b/libjava/classpath/lib/gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.class
new file mode 100644
index 00000000000..0d7cf7af762
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/ChunkedInputStream.class b/libjava/classpath/lib/gnu/java/net/protocol/http/ChunkedInputStream.class
new file mode 100644
index 00000000000..cfdd83395e2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/ChunkedInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/Cookie.class b/libjava/classpath/lib/gnu/java/net/protocol/http/Cookie.class
new file mode 100644
index 00000000000..ecba5b060fe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/Cookie.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/CookieManager.class b/libjava/classpath/lib/gnu/java/net/protocol/http/CookieManager.class
new file mode 100644
index 00000000000..95d3b66bf3d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/CookieManager.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/Credentials.class b/libjava/classpath/lib/gnu/java/net/protocol/http/Credentials.class
new file mode 100644
index 00000000000..289b5015f60
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/Credentials.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPConnection$Pool$Reaper.class b/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPConnection$Pool$Reaper.class
new file mode 100644
index 00000000000..b30005ce21a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPConnection$Pool$Reaper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPConnection$Pool.class b/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPConnection$Pool.class
new file mode 100644
index 00000000000..6ca44acf866
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPConnection$Pool.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPConnection.class b/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPConnection.class
new file mode 100644
index 00000000000..6fd6262a332
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPDateFormat.class b/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPDateFormat.class
new file mode 100644
index 00000000000..20079d60fb9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPDateFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPURLConnection$1.class b/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPURLConnection$1.class
new file mode 100644
index 00000000000..0e0631d513d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPURLConnection$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPURLConnection.class b/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPURLConnection.class
new file mode 100644
index 00000000000..76f4e90ccff
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/HTTPURLConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/Handler.class b/libjava/classpath/lib/gnu/java/net/protocol/http/Handler.class
new file mode 100644
index 00000000000..22e8d09793c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/Handler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/Headers$HeaderElement.class b/libjava/classpath/lib/gnu/java/net/protocol/http/Headers$HeaderElement.class
new file mode 100644
index 00000000000..f6c26f3ebe4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/Headers$HeaderElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/Headers.class b/libjava/classpath/lib/gnu/java/net/protocol/http/Headers.class
new file mode 100644
index 00000000000..97bf2ad61a7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/Headers.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/LimitedLengthInputStream.class b/libjava/classpath/lib/gnu/java/net/protocol/http/LimitedLengthInputStream.class
new file mode 100644
index 00000000000..630f16a4c9c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/LimitedLengthInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/Request.class b/libjava/classpath/lib/gnu/java/net/protocol/http/Request.class
new file mode 100644
index 00000000000..67e49234e99
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/Request.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/RequestBodyWriter.class b/libjava/classpath/lib/gnu/java/net/protocol/http/RequestBodyWriter.class
new file mode 100644
index 00000000000..96d9510d62f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/RequestBodyWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/Response.class b/libjava/classpath/lib/gnu/java/net/protocol/http/Response.class
new file mode 100644
index 00000000000..844d50c5ce9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/Response.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/ResponseHeaderHandler.class b/libjava/classpath/lib/gnu/java/net/protocol/http/ResponseHeaderHandler.class
new file mode 100644
index 00000000000..1a8bb81d858
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/ResponseHeaderHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/http/SimpleCookieManager.class b/libjava/classpath/lib/gnu/java/net/protocol/http/SimpleCookieManager.class
new file mode 100644
index 00000000000..00cafb1bcd9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/http/SimpleCookieManager.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/https/Handler.class b/libjava/classpath/lib/gnu/java/net/protocol/https/Handler.class
new file mode 100644
index 00000000000..fba1da8d284
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/https/Handler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/jar/Connection$JarFileCache.class b/libjava/classpath/lib/gnu/java/net/protocol/jar/Connection$JarFileCache.class
new file mode 100644
index 00000000000..0efc688b18c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/jar/Connection$JarFileCache.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/jar/Connection.class b/libjava/classpath/lib/gnu/java/net/protocol/jar/Connection.class
new file mode 100644
index 00000000000..d67ec4c0310
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/jar/Connection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/net/protocol/jar/Handler.class b/libjava/classpath/lib/gnu/java/net/protocol/jar/Handler.class
new file mode 100644
index 00000000000..51ca4c3c468
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/net/protocol/jar/Handler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/ChannelInputStream.class b/libjava/classpath/lib/gnu/java/nio/ChannelInputStream.class
new file mode 100644
index 00000000000..eb59e72598f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/ChannelInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/ChannelOutputStream.class b/libjava/classpath/lib/gnu/java/nio/ChannelOutputStream.class
new file mode 100644
index 00000000000..7da924174ee
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/ChannelOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/ChannelReader.class b/libjava/classpath/lib/gnu/java/nio/ChannelReader.class
new file mode 100644
index 00000000000..45afa8cec12
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/ChannelReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/ChannelWriter.class b/libjava/classpath/lib/gnu/java/nio/ChannelWriter.class
new file mode 100644
index 00000000000..eca45f64455
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/ChannelWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/DatagramChannelImpl.class b/libjava/classpath/lib/gnu/java/nio/DatagramChannelImpl.class
new file mode 100644
index 00000000000..8ec3162f45c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/DatagramChannelImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/DatagramChannelSelectionKey.class b/libjava/classpath/lib/gnu/java/nio/DatagramChannelSelectionKey.class
new file mode 100644
index 00000000000..3159eeb85b6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/DatagramChannelSelectionKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/FileLockImpl.class b/libjava/classpath/lib/gnu/java/nio/FileLockImpl.class
new file mode 100644
index 00000000000..ffb2da7509b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/FileLockImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/InputStreamChannel.class b/libjava/classpath/lib/gnu/java/nio/InputStreamChannel.class
new file mode 100644
index 00000000000..7550dd6e78a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/InputStreamChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/NIOConstants.class b/libjava/classpath/lib/gnu/java/nio/NIOConstants.class
new file mode 100644
index 00000000000..b1bb782e53a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/NIOConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/NIODatagramSocket.class b/libjava/classpath/lib/gnu/java/nio/NIODatagramSocket.class
new file mode 100644
index 00000000000..a5175b5ac27
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/NIODatagramSocket.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/NIOServerSocket.class b/libjava/classpath/lib/gnu/java/nio/NIOServerSocket.class
new file mode 100644
index 00000000000..48081b19f3b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/NIOServerSocket.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/NIOSocket.class b/libjava/classpath/lib/gnu/java/nio/NIOSocket.class
new file mode 100644
index 00000000000..5d18dd42c25
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/NIOSocket.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/OutputStreamChannel.class b/libjava/classpath/lib/gnu/java/nio/OutputStreamChannel.class
new file mode 100644
index 00000000000..4a32c59c1c0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/OutputStreamChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/PipeImpl$SinkChannelImpl.class b/libjava/classpath/lib/gnu/java/nio/PipeImpl$SinkChannelImpl.class
new file mode 100644
index 00000000000..21dd064ad9e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/PipeImpl$SinkChannelImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/PipeImpl$SourceChannelImpl.class b/libjava/classpath/lib/gnu/java/nio/PipeImpl$SourceChannelImpl.class
new file mode 100644
index 00000000000..e5dea7f33c4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/PipeImpl$SourceChannelImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/PipeImpl.class b/libjava/classpath/lib/gnu/java/nio/PipeImpl.class
new file mode 100644
index 00000000000..a0459a1235c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/PipeImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/SelectionKeyImpl.class b/libjava/classpath/lib/gnu/java/nio/SelectionKeyImpl.class
new file mode 100644
index 00000000000..f9070f668d0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/SelectionKeyImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/SelectorImpl.class b/libjava/classpath/lib/gnu/java/nio/SelectorImpl.class
new file mode 100644
index 00000000000..7e0b5dafdc0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/SelectorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/SelectorProviderImpl.class b/libjava/classpath/lib/gnu/java/nio/SelectorProviderImpl.class
new file mode 100644
index 00000000000..aa0ff844141
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/SelectorProviderImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/ServerSocketChannelImpl.class b/libjava/classpath/lib/gnu/java/nio/ServerSocketChannelImpl.class
new file mode 100644
index 00000000000..6188d794caf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/ServerSocketChannelImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/ServerSocketChannelSelectionKey.class b/libjava/classpath/lib/gnu/java/nio/ServerSocketChannelSelectionKey.class
new file mode 100644
index 00000000000..aabae1ea38f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/ServerSocketChannelSelectionKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/SocketChannelImpl.class b/libjava/classpath/lib/gnu/java/nio/SocketChannelImpl.class
new file mode 100644
index 00000000000..26c94fce092
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/SocketChannelImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/SocketChannelSelectionKey.class b/libjava/classpath/lib/gnu/java/nio/SocketChannelSelectionKey.class
new file mode 100644
index 00000000000..455861650c8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/SocketChannelSelectionKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/SocketChannelSelectionKeyImpl.class b/libjava/classpath/lib/gnu/java/nio/SocketChannelSelectionKeyImpl.class
new file mode 100644
index 00000000000..648378a0d19
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/SocketChannelSelectionKeyImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/VMChannel.class b/libjava/classpath/lib/gnu/java/nio/VMChannel.class
new file mode 100644
index 00000000000..8ee7d1cf8f0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/VMChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/VMChannelOwner.class b/libjava/classpath/lib/gnu/java/nio/VMChannelOwner.class
new file mode 100644
index 00000000000..e4dbde81e2d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/VMChannelOwner.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/VMPipe.class b/libjava/classpath/lib/gnu/java/nio/VMPipe.class
new file mode 100644
index 00000000000..19ccc258662
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/VMPipe.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/VMSelector.class b/libjava/classpath/lib/gnu/java/nio/VMSelector.class
new file mode 100644
index 00000000000..c022f8f92be
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/VMSelector.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/channels/FileChannelImpl.class b/libjava/classpath/lib/gnu/java/nio/channels/FileChannelImpl.class
new file mode 100644
index 00000000000..817ba710b1e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/channels/FileChannelImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ByteCharset$Decoder.class b/libjava/classpath/lib/gnu/java/nio/charset/ByteCharset$Decoder.class
new file mode 100644
index 00000000000..bb1dcbc58c8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ByteCharset$Decoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ByteCharset$Encoder.class b/libjava/classpath/lib/gnu/java/nio/charset/ByteCharset$Encoder.class
new file mode 100644
index 00000000000..d434b325092
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ByteCharset$Encoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ByteCharset.class b/libjava/classpath/lib/gnu/java/nio/charset/ByteCharset.class
new file mode 100644
index 00000000000..abbfcc29ec5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ByteCharset.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp424.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp424.class
new file mode 100644
index 00000000000..85f73b42322
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp424.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp437.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp437.class
new file mode 100644
index 00000000000..6799af3e1ea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp437.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp737.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp737.class
new file mode 100644
index 00000000000..3dc1a6402f1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp737.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp775.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp775.class
new file mode 100644
index 00000000000..d571c10661a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp775.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp850.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp850.class
new file mode 100644
index 00000000000..7196ca2de2d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp850.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp852.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp852.class
new file mode 100644
index 00000000000..8373403213e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp852.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp855.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp855.class
new file mode 100644
index 00000000000..17c1793bd75
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp855.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp857.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp857.class
new file mode 100644
index 00000000000..a214f8effa3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp857.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp860.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp860.class
new file mode 100644
index 00000000000..8553e8d875c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp860.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp861.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp861.class
new file mode 100644
index 00000000000..634255c87ef
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp861.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp862.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp862.class
new file mode 100644
index 00000000000..ef5df442108
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp862.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp863.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp863.class
new file mode 100644
index 00000000000..0e03ff4d4b2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp863.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp864.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp864.class
new file mode 100644
index 00000000000..c982051bfb7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp864.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp865.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp865.class
new file mode 100644
index 00000000000..cb82993678a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp865.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp866.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp866.class
new file mode 100644
index 00000000000..16ca0f4cd82
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp866.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp869.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp869.class
new file mode 100644
index 00000000000..4b692542f23
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp869.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Cp874.class b/libjava/classpath/lib/gnu/java/nio/charset/Cp874.class
new file mode 100644
index 00000000000..24ab44ca942
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Cp874.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/EncodingHelper.class b/libjava/classpath/lib/gnu/java/nio/charset/EncodingHelper.class
new file mode 100644
index 00000000000..e64d2d57f78
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/EncodingHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_1$Decoder.class b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_1$Decoder.class
new file mode 100644
index 00000000000..d4bb421d738
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_1$Decoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_1$Encoder.class b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_1$Encoder.class
new file mode 100644
index 00000000000..0262718eb66
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_1$Encoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_1.class b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_1.class
new file mode 100644
index 00000000000..8447ee37479
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_13.class b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_13.class
new file mode 100644
index 00000000000..cc21df464c6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_13.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_15.class b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_15.class
new file mode 100644
index 00000000000..89bf8bfd60e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_15.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_2.class b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_2.class
new file mode 100644
index 00000000000..71744a0ffdd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_2.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_3.class b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_3.class
new file mode 100644
index 00000000000..807b45e816b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_3.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_4.class b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_4.class
new file mode 100644
index 00000000000..e4fe0185583
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_4.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_5.class b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_5.class
new file mode 100644
index 00000000000..70601828b0e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_6.class b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_6.class
new file mode 100644
index 00000000000..4e7ed95828f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_6.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_7.class b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_7.class
new file mode 100644
index 00000000000..11c9523c7d9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_7.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_8.class b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_8.class
new file mode 100644
index 00000000000..58f8954a97b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_8.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_9.class b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_9.class
new file mode 100644
index 00000000000..8c9a6fa38a2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/ISO_8859_9.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/KOI_8.class b/libjava/classpath/lib/gnu/java/nio/charset/KOI_8.class
new file mode 100644
index 00000000000..32beb9e7867
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/KOI_8.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/MS874.class b/libjava/classpath/lib/gnu/java/nio/charset/MS874.class
new file mode 100644
index 00000000000..20728d0b68f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/MS874.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/MacCentralEurope.class b/libjava/classpath/lib/gnu/java/nio/charset/MacCentralEurope.class
new file mode 100644
index 00000000000..53a16c28317
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/MacCentralEurope.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/MacCroatian.class b/libjava/classpath/lib/gnu/java/nio/charset/MacCroatian.class
new file mode 100644
index 00000000000..531b25f6391
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/MacCroatian.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/MacCyrillic.class b/libjava/classpath/lib/gnu/java/nio/charset/MacCyrillic.class
new file mode 100644
index 00000000000..15818087052
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/MacCyrillic.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/MacDingbat.class b/libjava/classpath/lib/gnu/java/nio/charset/MacDingbat.class
new file mode 100644
index 00000000000..fe35fe8e123
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/MacDingbat.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/MacGreek.class b/libjava/classpath/lib/gnu/java/nio/charset/MacGreek.class
new file mode 100644
index 00000000000..3e88fad3a52
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/MacGreek.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/MacIceland.class b/libjava/classpath/lib/gnu/java/nio/charset/MacIceland.class
new file mode 100644
index 00000000000..5d72231184a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/MacIceland.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/MacRoman.class b/libjava/classpath/lib/gnu/java/nio/charset/MacRoman.class
new file mode 100644
index 00000000000..9185ccc6d81
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/MacRoman.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/MacRomania.class b/libjava/classpath/lib/gnu/java/nio/charset/MacRomania.class
new file mode 100644
index 00000000000..ff7cd8a13c7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/MacRomania.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/MacSymbol.class b/libjava/classpath/lib/gnu/java/nio/charset/MacSymbol.class
new file mode 100644
index 00000000000..16996e6ff40
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/MacSymbol.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/MacThai.class b/libjava/classpath/lib/gnu/java/nio/charset/MacThai.class
new file mode 100644
index 00000000000..92a895a7887
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/MacThai.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/MacTurkish.class b/libjava/classpath/lib/gnu/java/nio/charset/MacTurkish.class
new file mode 100644
index 00000000000..177250741dc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/MacTurkish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Provider$1.class b/libjava/classpath/lib/gnu/java/nio/charset/Provider$1.class
new file mode 100644
index 00000000000..30aebbad4f2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Provider$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Provider.class b/libjava/classpath/lib/gnu/java/nio/charset/Provider.class
new file mode 100644
index 00000000000..33fb54b6aaa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Provider.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/US_ASCII$Decoder.class b/libjava/classpath/lib/gnu/java/nio/charset/US_ASCII$Decoder.class
new file mode 100644
index 00000000000..afa2964f97e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/US_ASCII$Decoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/US_ASCII$Encoder.class b/libjava/classpath/lib/gnu/java/nio/charset/US_ASCII$Encoder.class
new file mode 100644
index 00000000000..6b770a24f00
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/US_ASCII$Encoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/US_ASCII.class b/libjava/classpath/lib/gnu/java/nio/charset/US_ASCII.class
new file mode 100644
index 00000000000..7e33ad70eeb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/US_ASCII.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/UTF_16.class b/libjava/classpath/lib/gnu/java/nio/charset/UTF_16.class
new file mode 100644
index 00000000000..8a2afa49ede
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/UTF_16.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/UTF_16BE.class b/libjava/classpath/lib/gnu/java/nio/charset/UTF_16BE.class
new file mode 100644
index 00000000000..7c61d7e0ff1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/UTF_16BE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/UTF_16Decoder.class b/libjava/classpath/lib/gnu/java/nio/charset/UTF_16Decoder.class
new file mode 100644
index 00000000000..ef6a6745589
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/UTF_16Decoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/UTF_16Encoder.class b/libjava/classpath/lib/gnu/java/nio/charset/UTF_16Encoder.class
new file mode 100644
index 00000000000..f411c933c7b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/UTF_16Encoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/UTF_16LE.class b/libjava/classpath/lib/gnu/java/nio/charset/UTF_16LE.class
new file mode 100644
index 00000000000..d692b5aeae4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/UTF_16LE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/UTF_8$Decoder.class b/libjava/classpath/lib/gnu/java/nio/charset/UTF_8$Decoder.class
new file mode 100644
index 00000000000..4bd770bda8c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/UTF_8$Decoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/UTF_8$Encoder.class b/libjava/classpath/lib/gnu/java/nio/charset/UTF_8$Encoder.class
new file mode 100644
index 00000000000..a4bcdf24353
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/UTF_8$Encoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/UTF_8.class b/libjava/classpath/lib/gnu/java/nio/charset/UTF_8.class
new file mode 100644
index 00000000000..4185988fc57
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/UTF_8.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/UnicodeLittle.class b/libjava/classpath/lib/gnu/java/nio/charset/UnicodeLittle.class
new file mode 100644
index 00000000000..ba587056b74
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/UnicodeLittle.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Windows1250.class b/libjava/classpath/lib/gnu/java/nio/charset/Windows1250.class
new file mode 100644
index 00000000000..3cf9112ac60
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Windows1250.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Windows1251.class b/libjava/classpath/lib/gnu/java/nio/charset/Windows1251.class
new file mode 100644
index 00000000000..55fdf449389
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Windows1251.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Windows1252.class b/libjava/classpath/lib/gnu/java/nio/charset/Windows1252.class
new file mode 100644
index 00000000000..8885cd85c7b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Windows1252.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Windows1253.class b/libjava/classpath/lib/gnu/java/nio/charset/Windows1253.class
new file mode 100644
index 00000000000..522f9c3987e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Windows1253.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Windows1254.class b/libjava/classpath/lib/gnu/java/nio/charset/Windows1254.class
new file mode 100644
index 00000000000..a254778da8b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Windows1254.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Windows1255.class b/libjava/classpath/lib/gnu/java/nio/charset/Windows1255.class
new file mode 100644
index 00000000000..2326a628c88
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Windows1255.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Windows1256.class b/libjava/classpath/lib/gnu/java/nio/charset/Windows1256.class
new file mode 100644
index 00000000000..132aee77931
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Windows1256.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Windows1257.class b/libjava/classpath/lib/gnu/java/nio/charset/Windows1257.class
new file mode 100644
index 00000000000..9b2c6935ec3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Windows1257.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/nio/charset/Windows1258.class b/libjava/classpath/lib/gnu/java/nio/charset/Windows1258.class
new file mode 100644
index 00000000000..dff7817b2ac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/nio/charset/Windows1258.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/RMIMarshalledObjectInputStream.class b/libjava/classpath/lib/gnu/java/rmi/RMIMarshalledObjectInputStream.class
new file mode 100644
index 00000000000..4223c7d9968
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/RMIMarshalledObjectInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/RMIMarshalledObjectOutputStream.class b/libjava/classpath/lib/gnu/java/rmi/RMIMarshalledObjectOutputStream.class
new file mode 100644
index 00000000000..4956b2610a8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/RMIMarshalledObjectOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/activation/ActivationSystemTransient.class b/libjava/classpath/lib/gnu/java/rmi/activation/ActivationSystemTransient.class
new file mode 100644
index 00000000000..3441be9c8d8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/activation/ActivationSystemTransient.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/activation/BidiTable.class b/libjava/classpath/lib/gnu/java/rmi/activation/BidiTable.class
new file mode 100644
index 00000000000..2399011b826
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/activation/BidiTable.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/activation/DefaultActivationGroup.class b/libjava/classpath/lib/gnu/java/rmi/activation/DefaultActivationGroup.class
new file mode 100644
index 00000000000..539b79a3d2c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/activation/DefaultActivationGroup.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/activation/DefaultActivationSystem.class b/libjava/classpath/lib/gnu/java/rmi/activation/DefaultActivationSystem.class
new file mode 100644
index 00000000000..db9506a6693
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/activation/DefaultActivationSystem.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl$RefProtector.class b/libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl$RefProtector.class
new file mode 100644
index 00000000000..0c23886f98b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl$RefProtector.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl.class b/libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl.class
new file mode 100644
index 00000000000..8595984fc7b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl_Skel.class b/libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl_Skel.class
new file mode 100644
index 00000000000..f745a86fccd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl_Skel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl_Stub.class b/libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl_Stub.class
new file mode 100644
index 00000000000..af0f76e26f5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/dgc/DGCImpl_Stub.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/dgc/LeaseRenewingTask$LeaseTimerTask.class b/libjava/classpath/lib/gnu/java/rmi/dgc/LeaseRenewingTask$LeaseTimerTask.class
new file mode 100644
index 00000000000..b4877483282
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/dgc/LeaseRenewingTask$LeaseTimerTask.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/dgc/LeaseRenewingTask.class b/libjava/classpath/lib/gnu/java/rmi/dgc/LeaseRenewingTask.class
new file mode 100644
index 00000000000..cab36a1241e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/dgc/LeaseRenewingTask.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl.class b/libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl.class
new file mode 100644
index 00000000000..b3627694897
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl_Skel.class b/libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl_Skel.class
new file mode 100644
index 00000000000..2ac5aeebb60
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl_Skel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl_Stub.class b/libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl_Stub.class
new file mode 100644
index 00000000000..3c75c888930
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl_Stub.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/ActivatableRef.class b/libjava/classpath/lib/gnu/java/rmi/server/ActivatableRef.class
new file mode 100644
index 00000000000..3b3f048a052
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/ActivatableRef.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/ActivatableServerRef.class b/libjava/classpath/lib/gnu/java/rmi/server/ActivatableServerRef.class
new file mode 100644
index 00000000000..1e17e2acc4b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/ActivatableServerRef.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/CombinedClassLoader.class b/libjava/classpath/lib/gnu/java/rmi/server/CombinedClassLoader.class
new file mode 100644
index 00000000000..6d28f179e68
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/CombinedClassLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/ConnectionRunnerPool$ConnectionRunner.class b/libjava/classpath/lib/gnu/java/rmi/server/ConnectionRunnerPool$ConnectionRunner.class
new file mode 100644
index 00000000000..3b7e35205b4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/ConnectionRunnerPool$ConnectionRunner.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/ConnectionRunnerPool.class b/libjava/classpath/lib/gnu/java/rmi/server/ConnectionRunnerPool.class
new file mode 100644
index 00000000000..1f187b76794
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/ConnectionRunnerPool.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/ProtocolConstants.class b/libjava/classpath/lib/gnu/java/rmi/server/ProtocolConstants.class
new file mode 100644
index 00000000000..4859ff5ef5c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/ProtocolConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/RMIClassLoaderImpl$CacheKey.class b/libjava/classpath/lib/gnu/java/rmi/server/RMIClassLoaderImpl$CacheKey.class
new file mode 100644
index 00000000000..39323eb2a9d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/RMIClassLoaderImpl$CacheKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/RMIClassLoaderImpl$MyClassLoader.class b/libjava/classpath/lib/gnu/java/rmi/server/RMIClassLoaderImpl$MyClassLoader.class
new file mode 100644
index 00000000000..fef7f673bd1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/RMIClassLoaderImpl$MyClassLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/RMIClassLoaderImpl.class b/libjava/classpath/lib/gnu/java/rmi/server/RMIClassLoaderImpl.class
new file mode 100644
index 00000000000..b703c43827d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/RMIClassLoaderImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/RMIDefaultSocketFactory.class b/libjava/classpath/lib/gnu/java/rmi/server/RMIDefaultSocketFactory.class
new file mode 100644
index 00000000000..d00d777fbc4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/RMIDefaultSocketFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/RMIHashes.class b/libjava/classpath/lib/gnu/java/rmi/server/RMIHashes.class
new file mode 100644
index 00000000000..1a661494888
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/RMIHashes.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/RMIIncomingThread.class b/libjava/classpath/lib/gnu/java/rmi/server/RMIIncomingThread.class
new file mode 100644
index 00000000000..fecf25d8d1a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/RMIIncomingThread.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/RMIObjectInputStream.class b/libjava/classpath/lib/gnu/java/rmi/server/RMIObjectInputStream.class
new file mode 100644
index 00000000000..88a6fdec356
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/RMIObjectInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/RMIObjectOutputStream.class b/libjava/classpath/lib/gnu/java/rmi/server/RMIObjectOutputStream.class
new file mode 100644
index 00000000000..56721ea9898
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/RMIObjectOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/RMIVoidValue.class b/libjava/classpath/lib/gnu/java/rmi/server/RMIVoidValue.class
new file mode 100644
index 00000000000..d6280beb4b6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/RMIVoidValue.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/TripleKey.class b/libjava/classpath/lib/gnu/java/rmi/server/TripleKey.class
new file mode 100644
index 00000000000..faa602b8bb2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/TripleKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/UnicastConnection.class b/libjava/classpath/lib/gnu/java/rmi/server/UnicastConnection.class
new file mode 100644
index 00000000000..39f35efdc9b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/UnicastConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/UnicastConnectionManager$1.class b/libjava/classpath/lib/gnu/java/rmi/server/UnicastConnectionManager$1.class
new file mode 100644
index 00000000000..7d928f54f87
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/UnicastConnectionManager$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/UnicastConnectionManager.class b/libjava/classpath/lib/gnu/java/rmi/server/UnicastConnectionManager.class
new file mode 100644
index 00000000000..e5d55790973
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/UnicastConnectionManager.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/UnicastRef.class b/libjava/classpath/lib/gnu/java/rmi/server/UnicastRef.class
new file mode 100644
index 00000000000..47faa31897b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/UnicastRef.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteCall$DummyObjectInputStream.class b/libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteCall$DummyObjectInputStream.class
new file mode 100644
index 00000000000..3079c045943
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteCall$DummyObjectInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteCall$DummyObjectOutputStream.class b/libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteCall$DummyObjectOutputStream.class
new file mode 100644
index 00000000000..3ea34588121
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteCall$DummyObjectOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteCall.class b/libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteCall.class
new file mode 100644
index 00000000000..2f25fef2f43
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteCall.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteStub.class b/libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteStub.class
new file mode 100644
index 00000000000..546a9798e8d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/UnicastRemoteStub.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/UnicastServer.class b/libjava/classpath/lib/gnu/java/rmi/server/UnicastServer.class
new file mode 100644
index 00000000000..16057467e8b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/UnicastServer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/server/UnicastServerRef.class b/libjava/classpath/lib/gnu/java/rmi/server/UnicastServerRef.class
new file mode 100644
index 00000000000..9f20856e240
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/rmi/server/UnicastServerRef.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/Configuration.class b/libjava/classpath/lib/gnu/java/security/Configuration.class
new file mode 100644
index 00000000000..cad8db3bfb9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/Configuration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/Engine.class b/libjava/classpath/lib/gnu/java/security/Engine.class
new file mode 100644
index 00000000000..b9b5a3f916d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/Engine.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/OID.class b/libjava/classpath/lib/gnu/java/security/OID.class
new file mode 100644
index 00000000000..db37e6964a9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/OID.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/PolicyFile$1.class b/libjava/classpath/lib/gnu/java/security/PolicyFile$1.class
new file mode 100644
index 00000000000..c5168d406ed
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/PolicyFile$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/PolicyFile.class b/libjava/classpath/lib/gnu/java/security/PolicyFile.class
new file mode 100644
index 00000000000..9efb3e65393
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/PolicyFile.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/Properties$1.class b/libjava/classpath/lib/gnu/java/security/Properties$1.class
new file mode 100644
index 00000000000..2664158bd3f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/Properties$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/Properties.class b/libjava/classpath/lib/gnu/java/security/Properties.class
new file mode 100644
index 00000000000..aa0b0bbd2ea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/Properties.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/Registry.class b/libjava/classpath/lib/gnu/java/security/Registry.class
new file mode 100644
index 00000000000..f2be0f46c1e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/Registry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/Requires.class b/libjava/classpath/lib/gnu/java/security/Requires.class
new file mode 100644
index 00000000000..6df34241aa2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/Requires.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/action/GetPropertyAction.class b/libjava/classpath/lib/gnu/java/security/action/GetPropertyAction.class
new file mode 100644
index 00000000000..a2d0e38c47e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/action/GetPropertyAction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/action/GetSecurityPropertyAction.class b/libjava/classpath/lib/gnu/java/security/action/GetSecurityPropertyAction.class
new file mode 100644
index 00000000000..d49ba7c80b7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/action/GetSecurityPropertyAction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/action/SetAccessibleAction.class b/libjava/classpath/lib/gnu/java/security/action/SetAccessibleAction.class
new file mode 100644
index 00000000000..d1714441c44
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/action/SetAccessibleAction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/ber/BER.class b/libjava/classpath/lib/gnu/java/security/ber/BER.class
new file mode 100644
index 00000000000..f0486a3b244
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/ber/BER.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/ber/BEREncodingException.class b/libjava/classpath/lib/gnu/java/security/ber/BEREncodingException.class
new file mode 100644
index 00000000000..8f83eb28a96
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/ber/BEREncodingException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/ber/BERReader.class b/libjava/classpath/lib/gnu/java/security/ber/BERReader.class
new file mode 100644
index 00000000000..6e962fe13b7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/ber/BERReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/ber/BERValue.class b/libjava/classpath/lib/gnu/java/security/ber/BERValue.class
new file mode 100644
index 00000000000..2405fd71d29
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/ber/BERValue.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/der/BitString.class b/libjava/classpath/lib/gnu/java/security/der/BitString.class
new file mode 100644
index 00000000000..c70e401c456
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/der/BitString.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/der/DER.class b/libjava/classpath/lib/gnu/java/security/der/DER.class
new file mode 100644
index 00000000000..98e7a9ce72a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/der/DER.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/der/DEREncodingException.class b/libjava/classpath/lib/gnu/java/security/der/DEREncodingException.class
new file mode 100644
index 00000000000..ddcdeb26f9b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/der/DEREncodingException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/der/DERReader.class b/libjava/classpath/lib/gnu/java/security/der/DERReader.class
new file mode 100644
index 00000000000..20ebbdb87b4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/der/DERReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/der/DERValue.class b/libjava/classpath/lib/gnu/java/security/der/DERValue.class
new file mode 100644
index 00000000000..446fbd7b0f8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/der/DERValue.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/der/DERWriter.class b/libjava/classpath/lib/gnu/java/security/der/DERWriter.class
new file mode 100644
index 00000000000..4a09d076b90
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/der/DERWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/BaseHash.class b/libjava/classpath/lib/gnu/java/security/hash/BaseHash.class
new file mode 100644
index 00000000000..520cbd0c789
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/BaseHash.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/HashFactory.class b/libjava/classpath/lib/gnu/java/security/hash/HashFactory.class
new file mode 100644
index 00000000000..a023e1e53ac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/HashFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/Haval.class b/libjava/classpath/lib/gnu/java/security/hash/Haval.class
new file mode 100644
index 00000000000..ca0a624ef62
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/Haval.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/IMessageDigest.class b/libjava/classpath/lib/gnu/java/security/hash/IMessageDigest.class
new file mode 100644
index 00000000000..eb1faf6b2ee
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/IMessageDigest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/MD2.class b/libjava/classpath/lib/gnu/java/security/hash/MD2.class
new file mode 100644
index 00000000000..0062efab859
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/MD2.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/MD4.class b/libjava/classpath/lib/gnu/java/security/hash/MD4.class
new file mode 100644
index 00000000000..a426e3d6343
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/MD4.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/MD5.class b/libjava/classpath/lib/gnu/java/security/hash/MD5.class
new file mode 100644
index 00000000000..38c6515787e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/MD5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/RipeMD128.class b/libjava/classpath/lib/gnu/java/security/hash/RipeMD128.class
new file mode 100644
index 00000000000..88e95d2dbaa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/RipeMD128.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/RipeMD160.class b/libjava/classpath/lib/gnu/java/security/hash/RipeMD160.class
new file mode 100644
index 00000000000..de071dec641
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/RipeMD160.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/Sha160.class b/libjava/classpath/lib/gnu/java/security/hash/Sha160.class
new file mode 100644
index 00000000000..7bf70b05fbd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/Sha160.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/Sha256.class b/libjava/classpath/lib/gnu/java/security/hash/Sha256.class
new file mode 100644
index 00000000000..ffb909b7595
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/Sha256.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/Sha384.class b/libjava/classpath/lib/gnu/java/security/hash/Sha384.class
new file mode 100644
index 00000000000..dd338a97fc9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/Sha384.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/Sha512.class b/libjava/classpath/lib/gnu/java/security/hash/Sha512.class
new file mode 100644
index 00000000000..9e3e53e697e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/Sha512.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/Tiger.class b/libjava/classpath/lib/gnu/java/security/hash/Tiger.class
new file mode 100644
index 00000000000..36bd7277376
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/Tiger.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/hash/Whirlpool.class b/libjava/classpath/lib/gnu/java/security/hash/Whirlpool.class
new file mode 100644
index 00000000000..d734a4d5beb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/hash/Whirlpool.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/hash/HavalSpi.class b/libjava/classpath/lib/gnu/java/security/jce/hash/HavalSpi.class
new file mode 100644
index 00000000000..51a42cdf075
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/hash/HavalSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/hash/MD2Spi.class b/libjava/classpath/lib/gnu/java/security/jce/hash/MD2Spi.class
new file mode 100644
index 00000000000..1ea42682b62
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/hash/MD2Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/hash/MD4Spi.class b/libjava/classpath/lib/gnu/java/security/jce/hash/MD4Spi.class
new file mode 100644
index 00000000000..919f6ad924b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/hash/MD4Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/hash/MD5Spi.class b/libjava/classpath/lib/gnu/java/security/jce/hash/MD5Spi.class
new file mode 100644
index 00000000000..d7eac77350e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/hash/MD5Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/hash/MessageDigestAdapter.class b/libjava/classpath/lib/gnu/java/security/jce/hash/MessageDigestAdapter.class
new file mode 100644
index 00000000000..a5f8f7b5ba0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/hash/MessageDigestAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/hash/RipeMD128Spi.class b/libjava/classpath/lib/gnu/java/security/jce/hash/RipeMD128Spi.class
new file mode 100644
index 00000000000..9e64e886cc6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/hash/RipeMD128Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/hash/RipeMD160Spi.class b/libjava/classpath/lib/gnu/java/security/jce/hash/RipeMD160Spi.class
new file mode 100644
index 00000000000..15dab49868b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/hash/RipeMD160Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/hash/Sha160Spi.class b/libjava/classpath/lib/gnu/java/security/jce/hash/Sha160Spi.class
new file mode 100644
index 00000000000..e608311d0d1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/hash/Sha160Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/hash/Sha256Spi.class b/libjava/classpath/lib/gnu/java/security/jce/hash/Sha256Spi.class
new file mode 100644
index 00000000000..d8bbdad949c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/hash/Sha256Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/hash/Sha384Spi.class b/libjava/classpath/lib/gnu/java/security/jce/hash/Sha384Spi.class
new file mode 100644
index 00000000000..3087553bc46
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/hash/Sha384Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/hash/Sha512Spi.class b/libjava/classpath/lib/gnu/java/security/jce/hash/Sha512Spi.class
new file mode 100644
index 00000000000..19c6274b12e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/hash/Sha512Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/hash/TigerSpi.class b/libjava/classpath/lib/gnu/java/security/jce/hash/TigerSpi.class
new file mode 100644
index 00000000000..314580c2232
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/hash/TigerSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/hash/WhirlpoolSpi.class b/libjava/classpath/lib/gnu/java/security/jce/hash/WhirlpoolSpi.class
new file mode 100644
index 00000000000..76fb5647ab0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/hash/WhirlpoolSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/prng/HavalRandomSpi.class b/libjava/classpath/lib/gnu/java/security/jce/prng/HavalRandomSpi.class
new file mode 100644
index 00000000000..db9029bb143
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/prng/HavalRandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/prng/MD2RandomSpi.class b/libjava/classpath/lib/gnu/java/security/jce/prng/MD2RandomSpi.class
new file mode 100644
index 00000000000..b043f1baada
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/prng/MD2RandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/prng/MD4RandomSpi.class b/libjava/classpath/lib/gnu/java/security/jce/prng/MD4RandomSpi.class
new file mode 100644
index 00000000000..2b314952ae3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/prng/MD4RandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/prng/MD5RandomSpi.class b/libjava/classpath/lib/gnu/java/security/jce/prng/MD5RandomSpi.class
new file mode 100644
index 00000000000..6256b186976
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/prng/MD5RandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/prng/RipeMD128RandomSpi.class b/libjava/classpath/lib/gnu/java/security/jce/prng/RipeMD128RandomSpi.class
new file mode 100644
index 00000000000..0ab8ce92632
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/prng/RipeMD128RandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/prng/RipeMD160RandomSpi.class b/libjava/classpath/lib/gnu/java/security/jce/prng/RipeMD160RandomSpi.class
new file mode 100644
index 00000000000..a05207414b9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/prng/RipeMD160RandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/prng/SecureRandomAdapter.class b/libjava/classpath/lib/gnu/java/security/jce/prng/SecureRandomAdapter.class
new file mode 100644
index 00000000000..7bacedb0d5e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/prng/SecureRandomAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/prng/Sha160RandomSpi.class b/libjava/classpath/lib/gnu/java/security/jce/prng/Sha160RandomSpi.class
new file mode 100644
index 00000000000..b26d8ecc29b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/prng/Sha160RandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/prng/Sha256RandomSpi.class b/libjava/classpath/lib/gnu/java/security/jce/prng/Sha256RandomSpi.class
new file mode 100644
index 00000000000..4f95aec7165
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/prng/Sha256RandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/prng/Sha384RandomSpi.class b/libjava/classpath/lib/gnu/java/security/jce/prng/Sha384RandomSpi.class
new file mode 100644
index 00000000000..010507d9234
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/prng/Sha384RandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/prng/Sha512RandomSpi.class b/libjava/classpath/lib/gnu/java/security/jce/prng/Sha512RandomSpi.class
new file mode 100644
index 00000000000..f31e348c2ae
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/prng/Sha512RandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/prng/TigerRandomSpi.class b/libjava/classpath/lib/gnu/java/security/jce/prng/TigerRandomSpi.class
new file mode 100644
index 00000000000..787b68bff17
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/prng/TigerRandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/prng/WhirlpoolRandomSpi.class b/libjava/classpath/lib/gnu/java/security/jce/prng/WhirlpoolRandomSpi.class
new file mode 100644
index 00000000000..abe86b01c15
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/prng/WhirlpoolRandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/DSSKeyFactory.class b/libjava/classpath/lib/gnu/java/security/jce/sig/DSSKeyFactory.class
new file mode 100644
index 00000000000..fa74bd74bc4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/DSSKeyFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/DSSKeyPairGeneratorSpi.class b/libjava/classpath/lib/gnu/java/security/jce/sig/DSSKeyPairGeneratorSpi.class
new file mode 100644
index 00000000000..2ec3779a8ea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/DSSKeyPairGeneratorSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/DSSParameters.class b/libjava/classpath/lib/gnu/java/security/jce/sig/DSSParameters.class
new file mode 100644
index 00000000000..895c8f22183
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/DSSParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/DSSParametersGenerator.class b/libjava/classpath/lib/gnu/java/security/jce/sig/DSSParametersGenerator.class
new file mode 100644
index 00000000000..393aaf0e420
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/DSSParametersGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/DSSRawSignatureSpi.class b/libjava/classpath/lib/gnu/java/security/jce/sig/DSSRawSignatureSpi.class
new file mode 100644
index 00000000000..c26cfe6f6fa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/DSSRawSignatureSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/EncodedKeyFactory.class b/libjava/classpath/lib/gnu/java/security/jce/sig/EncodedKeyFactory.class
new file mode 100644
index 00000000000..9bf4ba4bccd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/EncodedKeyFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/KeyPairGeneratorAdapter.class b/libjava/classpath/lib/gnu/java/security/jce/sig/KeyPairGeneratorAdapter.class
new file mode 100644
index 00000000000..b82fa0b1a02
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/KeyPairGeneratorAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/MD2withRSA.class b/libjava/classpath/lib/gnu/java/security/jce/sig/MD2withRSA.class
new file mode 100644
index 00000000000..ee79076645c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/MD2withRSA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/MD5withRSA.class b/libjava/classpath/lib/gnu/java/security/jce/sig/MD5withRSA.class
new file mode 100644
index 00000000000..c88c51d9916
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/MD5withRSA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/RSAKeyFactory.class b/libjava/classpath/lib/gnu/java/security/jce/sig/RSAKeyFactory.class
new file mode 100644
index 00000000000..6f06edc69bf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/RSAKeyFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/RSAKeyPairGeneratorSpi.class b/libjava/classpath/lib/gnu/java/security/jce/sig/RSAKeyPairGeneratorSpi.class
new file mode 100644
index 00000000000..70c34ed7e8b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/RSAKeyPairGeneratorSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/RSAPSSRawSignatureSpi.class b/libjava/classpath/lib/gnu/java/security/jce/sig/RSAPSSRawSignatureSpi.class
new file mode 100644
index 00000000000..f735eab972c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/RSAPSSRawSignatureSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/SHA160withDSS.class b/libjava/classpath/lib/gnu/java/security/jce/sig/SHA160withDSS.class
new file mode 100644
index 00000000000..f4a23b615c6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/SHA160withDSS.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/SHA160withRSA.class b/libjava/classpath/lib/gnu/java/security/jce/sig/SHA160withRSA.class
new file mode 100644
index 00000000000..02df94ee7f3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/SHA160withRSA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/SHA256withRSA.class b/libjava/classpath/lib/gnu/java/security/jce/sig/SHA256withRSA.class
new file mode 100644
index 00000000000..d14df91c5c4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/SHA256withRSA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/SHA384withRSA.class b/libjava/classpath/lib/gnu/java/security/jce/sig/SHA384withRSA.class
new file mode 100644
index 00000000000..05acfdf4610
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/SHA384withRSA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/SHA512withRSA.class b/libjava/classpath/lib/gnu/java/security/jce/sig/SHA512withRSA.class
new file mode 100644
index 00000000000..c220000c6d8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/SHA512withRSA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/jce/sig/SignatureAdapter.class b/libjava/classpath/lib/gnu/java/security/jce/sig/SignatureAdapter.class
new file mode 100644
index 00000000000..299c7bfd0e9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/jce/sig/SignatureAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/IKeyPairCodec.class b/libjava/classpath/lib/gnu/java/security/key/IKeyPairCodec.class
new file mode 100644
index 00000000000..b9c7a76d75a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/IKeyPairCodec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/IKeyPairGenerator.class b/libjava/classpath/lib/gnu/java/security/key/IKeyPairGenerator.class
new file mode 100644
index 00000000000..54396a643bc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/IKeyPairGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/KeyPairCodecFactory.class b/libjava/classpath/lib/gnu/java/security/key/KeyPairCodecFactory.class
new file mode 100644
index 00000000000..b67f2337860
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/KeyPairCodecFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/KeyPairGeneratorFactory.class b/libjava/classpath/lib/gnu/java/security/key/KeyPairGeneratorFactory.class
new file mode 100644
index 00000000000..abafeeac050
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/KeyPairGeneratorFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/dss/DSSKey.class b/libjava/classpath/lib/gnu/java/security/key/dss/DSSKey.class
new file mode 100644
index 00000000000..c5462e16559
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/dss/DSSKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairGenerator.class b/libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairGenerator.class
new file mode 100644
index 00000000000..97938b62587
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.class b/libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.class
new file mode 100644
index 00000000000..6532a20ee74
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairRawCodec.class b/libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairRawCodec.class
new file mode 100644
index 00000000000..848cbfe39df
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairRawCodec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairX509Codec.class b/libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairX509Codec.class
new file mode 100644
index 00000000000..7ca18493b55
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/dss/DSSKeyPairX509Codec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/dss/DSSPrivateKey.class b/libjava/classpath/lib/gnu/java/security/key/dss/DSSPrivateKey.class
new file mode 100644
index 00000000000..958c05228e4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/dss/DSSPrivateKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/dss/DSSPublicKey.class b/libjava/classpath/lib/gnu/java/security/key/dss/DSSPublicKey.class
new file mode 100644
index 00000000000..909a027c038
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/dss/DSSPublicKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/dss/FIPS186.class b/libjava/classpath/lib/gnu/java/security/key/dss/FIPS186.class
new file mode 100644
index 00000000000..9be1d405fc3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/dss/FIPS186.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/rsa/GnuRSAKey.class b/libjava/classpath/lib/gnu/java/security/key/rsa/GnuRSAKey.class
new file mode 100644
index 00000000000..c95e6c418fc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/rsa/GnuRSAKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/rsa/GnuRSAPrivateKey.class b/libjava/classpath/lib/gnu/java/security/key/rsa/GnuRSAPrivateKey.class
new file mode 100644
index 00000000000..1c7f6fd4129
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/rsa/GnuRSAPrivateKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/rsa/GnuRSAPublicKey.class b/libjava/classpath/lib/gnu/java/security/key/rsa/GnuRSAPublicKey.class
new file mode 100644
index 00000000000..5d93064f5d7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/rsa/GnuRSAPublicKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairGenerator.class b/libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairGenerator.class
new file mode 100644
index 00000000000..e09c4234183
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.class b/libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.class
new file mode 100644
index 00000000000..b8a5f4cf431
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairRawCodec.class b/libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairRawCodec.class
new file mode 100644
index 00000000000..15ccade3152
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairRawCodec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairX509Codec.class b/libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairX509Codec.class
new file mode 100644
index 00000000000..f6b6573af65
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/key/rsa/RSAKeyPairX509Codec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/pkcs/PKCS7Data.class b/libjava/classpath/lib/gnu/java/security/pkcs/PKCS7Data.class
new file mode 100644
index 00000000000..efd7a578933
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/pkcs/PKCS7Data.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/pkcs/PKCS7SignedData.class b/libjava/classpath/lib/gnu/java/security/pkcs/PKCS7SignedData.class
new file mode 100644
index 00000000000..5ec095a4325
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/pkcs/PKCS7SignedData.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/pkcs/SignerInfo.class b/libjava/classpath/lib/gnu/java/security/pkcs/SignerInfo.class
new file mode 100644
index 00000000000..604a7355239
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/pkcs/SignerInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/prng/BasePRNG.class b/libjava/classpath/lib/gnu/java/security/prng/BasePRNG.class
new file mode 100644
index 00000000000..cd9b6aa3bd1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/prng/BasePRNG.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/prng/EntropySource.class b/libjava/classpath/lib/gnu/java/security/prng/EntropySource.class
new file mode 100644
index 00000000000..3810c893bcd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/prng/EntropySource.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/prng/IRandom.class b/libjava/classpath/lib/gnu/java/security/prng/IRandom.class
new file mode 100644
index 00000000000..f89eacbb9f4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/prng/IRandom.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/prng/LimitReachedException.class b/libjava/classpath/lib/gnu/java/security/prng/LimitReachedException.class
new file mode 100644
index 00000000000..5a0e5048e01
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/prng/LimitReachedException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/prng/MDGenerator.class b/libjava/classpath/lib/gnu/java/security/prng/MDGenerator.class
new file mode 100644
index 00000000000..dc88d8dd935
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/prng/MDGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/prng/PRNGFactory.class b/libjava/classpath/lib/gnu/java/security/prng/PRNGFactory.class
new file mode 100644
index 00000000000..a2754327797
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/prng/PRNGFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/prng/RandomEvent.class b/libjava/classpath/lib/gnu/java/security/prng/RandomEvent.class
new file mode 100644
index 00000000000..fa3ee8ecd48
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/prng/RandomEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/prng/RandomEventListener.class b/libjava/classpath/lib/gnu/java/security/prng/RandomEventListener.class
new file mode 100644
index 00000000000..ca9c8fa214f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/prng/RandomEventListener.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/provider/CollectionCertStoreImpl.class b/libjava/classpath/lib/gnu/java/security/provider/CollectionCertStoreImpl.class
new file mode 100644
index 00000000000..c3dd00069f5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/provider/CollectionCertStoreImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/provider/DefaultPolicy.class b/libjava/classpath/lib/gnu/java/security/provider/DefaultPolicy.class
new file mode 100644
index 00000000000..48a748c81ab
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/provider/DefaultPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/provider/Gnu$1.class b/libjava/classpath/lib/gnu/java/security/provider/Gnu$1.class
new file mode 100644
index 00000000000..2e949b0debe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/provider/Gnu$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/provider/Gnu.class b/libjava/classpath/lib/gnu/java/security/provider/Gnu.class
new file mode 100644
index 00000000000..642a24abac0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/provider/Gnu.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/provider/PKIXCertPathValidatorImpl.class b/libjava/classpath/lib/gnu/java/security/provider/PKIXCertPathValidatorImpl.class
new file mode 100644
index 00000000000..4feb3469085
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/provider/PKIXCertPathValidatorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/provider/X509CertificateFactory.class b/libjava/classpath/lib/gnu/java/security/provider/X509CertificateFactory.class
new file mode 100644
index 00000000000..3fedb12ef53
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/provider/X509CertificateFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/BaseSignature.class b/libjava/classpath/lib/gnu/java/security/sig/BaseSignature.class
new file mode 100644
index 00000000000..7267a24e8fd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/BaseSignature.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/ISignature.class b/libjava/classpath/lib/gnu/java/security/sig/ISignature.class
new file mode 100644
index 00000000000..24174a1aa8b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/ISignature.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/ISignatureCodec.class b/libjava/classpath/lib/gnu/java/security/sig/ISignatureCodec.class
new file mode 100644
index 00000000000..f998fd081c7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/ISignatureCodec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/SignatureCodecFactory.class b/libjava/classpath/lib/gnu/java/security/sig/SignatureCodecFactory.class
new file mode 100644
index 00000000000..da49c576104
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/SignatureCodecFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/SignatureFactory.class b/libjava/classpath/lib/gnu/java/security/sig/SignatureFactory.class
new file mode 100644
index 00000000000..0e7bd568525
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/SignatureFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/dss/DSSSignature.class b/libjava/classpath/lib/gnu/java/security/sig/dss/DSSSignature.class
new file mode 100644
index 00000000000..4fc0e689424
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/dss/DSSSignature.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/dss/DSSSignatureRawCodec.class b/libjava/classpath/lib/gnu/java/security/sig/dss/DSSSignatureRawCodec.class
new file mode 100644
index 00000000000..a8e8cad5aa9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/dss/DSSSignatureRawCodec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/dss/DSSSignatureX509Codec.class b/libjava/classpath/lib/gnu/java/security/sig/dss/DSSSignatureX509Codec.class
new file mode 100644
index 00000000000..99494c6c8dc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/dss/DSSSignatureX509Codec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/rsa/EME_PKCS1_V1_5.class b/libjava/classpath/lib/gnu/java/security/sig/rsa/EME_PKCS1_V1_5.class
new file mode 100644
index 00000000000..bbd18de8e5c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/rsa/EME_PKCS1_V1_5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/rsa/EMSA_PKCS1_V1_5.class b/libjava/classpath/lib/gnu/java/security/sig/rsa/EMSA_PKCS1_V1_5.class
new file mode 100644
index 00000000000..e03cdaf8031
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/rsa/EMSA_PKCS1_V1_5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/rsa/EMSA_PSS.class b/libjava/classpath/lib/gnu/java/security/sig/rsa/EMSA_PSS.class
new file mode 100644
index 00000000000..5484fd578c5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/rsa/EMSA_PSS.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/rsa/RSA.class b/libjava/classpath/lib/gnu/java/security/sig/rsa/RSA.class
new file mode 100644
index 00000000000..68c37239c80
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/rsa/RSA.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPKCS1V1_5Signature.class b/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPKCS1V1_5Signature.class
new file mode 100644
index 00000000000..f788cedc6d9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPKCS1V1_5Signature.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPKCS1V1_5SignatureRawCodec.class b/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPKCS1V1_5SignatureRawCodec.class
new file mode 100644
index 00000000000..7f8762a6e87
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPKCS1V1_5SignatureRawCodec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPKCS1V1_5SignatureX509Codec.class b/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPKCS1V1_5SignatureX509Codec.class
new file mode 100644
index 00000000000..faa4a94b65d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPKCS1V1_5SignatureX509Codec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPSSSignature.class b/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPSSSignature.class
new file mode 100644
index 00000000000..961bd7d3b67
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPSSSignature.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPSSSignatureRawCodec.class b/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPSSSignatureRawCodec.class
new file mode 100644
index 00000000000..e9942689636
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/rsa/RSAPSSSignatureRawCodec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/sig/rsa/RSASignatureFactory.class b/libjava/classpath/lib/gnu/java/security/sig/rsa/RSASignatureFactory.class
new file mode 100644
index 00000000000..4d51e4c2c48
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/sig/rsa/RSASignatureFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/util/Base64.class b/libjava/classpath/lib/gnu/java/security/util/Base64.class
new file mode 100644
index 00000000000..75ad3c941ab
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/util/Base64.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/util/ByteArray.class b/libjava/classpath/lib/gnu/java/security/util/ByteArray.class
new file mode 100644
index 00000000000..beb2df45619
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/util/ByteArray.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/util/ByteBufferOutputStream.class b/libjava/classpath/lib/gnu/java/security/util/ByteBufferOutputStream.class
new file mode 100644
index 00000000000..2d7439a3c24
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/util/ByteBufferOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/util/DerUtil.class b/libjava/classpath/lib/gnu/java/security/util/DerUtil.class
new file mode 100644
index 00000000000..ef4b9150c84
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/util/DerUtil.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/util/ExpirableObject$Destroyer.class b/libjava/classpath/lib/gnu/java/security/util/ExpirableObject$Destroyer.class
new file mode 100644
index 00000000000..a3cf941eb21
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/util/ExpirableObject$Destroyer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/util/ExpirableObject.class b/libjava/classpath/lib/gnu/java/security/util/ExpirableObject.class
new file mode 100644
index 00000000000..44f30dd9090
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/util/ExpirableObject.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/util/FormatUtil.class b/libjava/classpath/lib/gnu/java/security/util/FormatUtil.class
new file mode 100644
index 00000000000..c3485f317ca
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/util/FormatUtil.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/util/IntegerUtil$1.class b/libjava/classpath/lib/gnu/java/security/util/IntegerUtil$1.class
new file mode 100644
index 00000000000..518fc646877
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/util/IntegerUtil$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/util/IntegerUtil.class b/libjava/classpath/lib/gnu/java/security/util/IntegerUtil.class
new file mode 100644
index 00000000000..e18daef73d0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/util/IntegerUtil.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/util/PRNG.class b/libjava/classpath/lib/gnu/java/security/util/PRNG.class
new file mode 100644
index 00000000000..6e2d054ce1a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/util/PRNG.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/util/Prime.class b/libjava/classpath/lib/gnu/java/security/util/Prime.class
new file mode 100644
index 00000000000..0246963e34a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/util/Prime.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/util/Sequence.class b/libjava/classpath/lib/gnu/java/security/util/Sequence.class
new file mode 100644
index 00000000000..9ff5eaaefc2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/util/Sequence.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/util/SimpleList.class b/libjava/classpath/lib/gnu/java/security/util/SimpleList.class
new file mode 100644
index 00000000000..c30ecdea117
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/util/SimpleList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/util/Util.class b/libjava/classpath/lib/gnu/java/security/util/Util.class
new file mode 100644
index 00000000000..896b4bfa72a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/util/Util.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/GnuPKIExtension.class b/libjava/classpath/lib/gnu/java/security/x509/GnuPKIExtension.class
new file mode 100644
index 00000000000..fbada1312e1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/GnuPKIExtension.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/PolicyNodeImpl.class b/libjava/classpath/lib/gnu/java/security/x509/PolicyNodeImpl.class
new file mode 100644
index 00000000000..bfca58d7b44
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/PolicyNodeImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/Util.class b/libjava/classpath/lib/gnu/java/security/x509/Util.class
new file mode 100644
index 00000000000..b21e8d818cf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/Util.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/X500DistinguishedName.class b/libjava/classpath/lib/gnu/java/security/x509/X500DistinguishedName.class
new file mode 100644
index 00000000000..8aba2259813
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/X500DistinguishedName.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/X509CRL.class b/libjava/classpath/lib/gnu/java/security/x509/X509CRL.class
new file mode 100644
index 00000000000..5e2ce964ec4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/X509CRL.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/X509CRLEntry.class b/libjava/classpath/lib/gnu/java/security/x509/X509CRLEntry.class
new file mode 100644
index 00000000000..04aa144a2cb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/X509CRLEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/X509CRLSelectorImpl.class b/libjava/classpath/lib/gnu/java/security/x509/X509CRLSelectorImpl.class
new file mode 100644
index 00000000000..c23f76eb00e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/X509CRLSelectorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/X509CertPath.class b/libjava/classpath/lib/gnu/java/security/x509/X509CertPath.class
new file mode 100644
index 00000000000..98e112e9d6e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/X509CertPath.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/X509CertSelectorImpl.class b/libjava/classpath/lib/gnu/java/security/x509/X509CertSelectorImpl.class
new file mode 100644
index 00000000000..823a6578b0a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/X509CertSelectorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/X509Certificate.class b/libjava/classpath/lib/gnu/java/security/x509/X509Certificate.class
new file mode 100644
index 00000000000..377554e1ffd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/X509Certificate.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/AuthorityKeyIdentifier.class b/libjava/classpath/lib/gnu/java/security/x509/ext/AuthorityKeyIdentifier.class
new file mode 100644
index 00000000000..73bc76cac3c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/AuthorityKeyIdentifier.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/BasicConstraints.class b/libjava/classpath/lib/gnu/java/security/x509/ext/BasicConstraints.class
new file mode 100644
index 00000000000..5880c34fec0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/BasicConstraints.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/CRLNumber.class b/libjava/classpath/lib/gnu/java/security/x509/ext/CRLNumber.class
new file mode 100644
index 00000000000..98b5b2fed23
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/CRLNumber.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/CertificatePolicies.class b/libjava/classpath/lib/gnu/java/security/x509/ext/CertificatePolicies.class
new file mode 100644
index 00000000000..f562f35fb3d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/CertificatePolicies.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/ExtendedKeyUsage.class b/libjava/classpath/lib/gnu/java/security/x509/ext/ExtendedKeyUsage.class
new file mode 100644
index 00000000000..c4dcb1c8d91
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/ExtendedKeyUsage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/Extension$Value.class b/libjava/classpath/lib/gnu/java/security/x509/ext/Extension$Value.class
new file mode 100644
index 00000000000..5d8e83288f1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/Extension$Value.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/Extension.class b/libjava/classpath/lib/gnu/java/security/x509/ext/Extension.class
new file mode 100644
index 00000000000..db1472dc5a8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/Extension.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/GeneralNames.class b/libjava/classpath/lib/gnu/java/security/x509/ext/GeneralNames.class
new file mode 100644
index 00000000000..9fb83d0e68e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/GeneralNames.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/IssuerAlternativeNames.class b/libjava/classpath/lib/gnu/java/security/x509/ext/IssuerAlternativeNames.class
new file mode 100644
index 00000000000..15df55404d8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/IssuerAlternativeNames.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/KeyUsage.class b/libjava/classpath/lib/gnu/java/security/x509/ext/KeyUsage.class
new file mode 100644
index 00000000000..ca69c62a4f7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/KeyUsage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/PolicyConstraint.class b/libjava/classpath/lib/gnu/java/security/x509/ext/PolicyConstraint.class
new file mode 100644
index 00000000000..79fe36cc65d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/PolicyConstraint.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/PolicyMappings.class b/libjava/classpath/lib/gnu/java/security/x509/ext/PolicyMappings.class
new file mode 100644
index 00000000000..5d1da689c97
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/PolicyMappings.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.class b/libjava/classpath/lib/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.class
new file mode 100644
index 00000000000..483ce3ea57d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/ReasonCode.class b/libjava/classpath/lib/gnu/java/security/x509/ext/ReasonCode.class
new file mode 100644
index 00000000000..2b5d1606ce0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/ReasonCode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/SubjectAlternativeNames.class b/libjava/classpath/lib/gnu/java/security/x509/ext/SubjectAlternativeNames.class
new file mode 100644
index 00000000000..75f97382f94
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/SubjectAlternativeNames.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/security/x509/ext/SubjectKeyIdentifier.class b/libjava/classpath/lib/gnu/java/security/x509/ext/SubjectKeyIdentifier.class
new file mode 100644
index 00000000000..2bb8d26c4ba
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/security/x509/ext/SubjectKeyIdentifier.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/text/AttributedFormatBuffer.class b/libjava/classpath/lib/gnu/java/text/AttributedFormatBuffer.class
new file mode 100644
index 00000000000..6d0fb150c5a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/text/AttributedFormatBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/text/BaseBreakIterator.class b/libjava/classpath/lib/gnu/java/text/BaseBreakIterator.class
new file mode 100644
index 00000000000..3fe59cdb3f3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/text/BaseBreakIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/text/CharacterBreakIterator.class b/libjava/classpath/lib/gnu/java/text/CharacterBreakIterator.class
new file mode 100644
index 00000000000..3f55a8f2cc6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/text/CharacterBreakIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/text/FormatBuffer.class b/libjava/classpath/lib/gnu/java/text/FormatBuffer.class
new file mode 100644
index 00000000000..fa4394e044a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/text/FormatBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/text/FormatCharacterIterator.class b/libjava/classpath/lib/gnu/java/text/FormatCharacterIterator.class
new file mode 100644
index 00000000000..0597d6e0183
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/text/FormatCharacterIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/text/LineBreakIterator.class b/libjava/classpath/lib/gnu/java/text/LineBreakIterator.class
new file mode 100644
index 00000000000..6c97fd54e21
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/text/LineBreakIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/text/SentenceBreakIterator.class b/libjava/classpath/lib/gnu/java/text/SentenceBreakIterator.class
new file mode 100644
index 00000000000..5b3975c3ea2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/text/SentenceBreakIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/text/StringFormatBuffer.class b/libjava/classpath/lib/gnu/java/text/StringFormatBuffer.class
new file mode 100644
index 00000000000..de6b9d9dd17
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/text/StringFormatBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/text/WordBreakIterator.class b/libjava/classpath/lib/gnu/java/text/WordBreakIterator.class
new file mode 100644
index 00000000000..e1526fc3d62
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/text/WordBreakIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/DoubleEnumeration.class b/libjava/classpath/lib/gnu/java/util/DoubleEnumeration.class
new file mode 100644
index 00000000000..d26b3fe1013
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/DoubleEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/EmptyEnumeration.class b/libjava/classpath/lib/gnu/java/util/EmptyEnumeration.class
new file mode 100644
index 00000000000..808980d83cf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/EmptyEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$1.class b/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$1.class
new file mode 100644
index 00000000000..eb7c64a1df1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$WeakBucket$WeakEntry.class b/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$WeakBucket$WeakEntry.class
new file mode 100644
index 00000000000..b7bf52c692e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$WeakBucket$WeakEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$WeakBucket.class b/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$WeakBucket.class
new file mode 100644
index 00000000000..08875e5b171
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$WeakBucket.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$WeakEntrySet.class b/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$WeakEntrySet.class
new file mode 100644
index 00000000000..a889aae9727
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap$WeakEntrySet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap.class b/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap.class
new file mode 100644
index 00000000000..0b205de2497
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/WeakIdentityHashMap.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/jar/JarUtils.class b/libjava/classpath/lib/gnu/java/util/jar/JarUtils.class
new file mode 100644
index 00000000000..a1acf2525ee
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/jar/JarUtils.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/prefs/EventDispatcher.class b/libjava/classpath/lib/gnu/java/util/prefs/EventDispatcher.class
new file mode 100644
index 00000000000..6f7ec172e27
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/prefs/EventDispatcher.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/prefs/FileBasedFactory.class b/libjava/classpath/lib/gnu/java/util/prefs/FileBasedFactory.class
new file mode 100644
index 00000000000..04da65abd4e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/prefs/FileBasedFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/prefs/FileBasedPreferences$1.class b/libjava/classpath/lib/gnu/java/util/prefs/FileBasedPreferences$1.class
new file mode 100644
index 00000000000..d7082f4a270
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/prefs/FileBasedPreferences$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/prefs/FileBasedPreferences.class b/libjava/classpath/lib/gnu/java/util/prefs/FileBasedPreferences.class
new file mode 100644
index 00000000000..7cb1c96f19f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/prefs/FileBasedPreferences.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/prefs/GConfBasedFactory.class b/libjava/classpath/lib/gnu/java/util/prefs/GConfBasedFactory.class
new file mode 100644
index 00000000000..0c97da9c3c1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/prefs/GConfBasedFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/prefs/GConfBasedPreferences.class b/libjava/classpath/lib/gnu/java/util/prefs/GConfBasedPreferences.class
new file mode 100644
index 00000000000..db5bd124f19
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/prefs/GConfBasedPreferences.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/prefs/MemoryBasedFactory.class b/libjava/classpath/lib/gnu/java/util/prefs/MemoryBasedFactory.class
new file mode 100644
index 00000000000..0520bb58e85
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/prefs/MemoryBasedFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/prefs/MemoryBasedPreferences.class b/libjava/classpath/lib/gnu/java/util/prefs/MemoryBasedPreferences.class
new file mode 100644
index 00000000000..9f25fa47e7b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/prefs/MemoryBasedPreferences.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/prefs/NodeReader.class b/libjava/classpath/lib/gnu/java/util/prefs/NodeReader.class
new file mode 100644
index 00000000000..9557a132dd2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/prefs/NodeReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/prefs/NodeWriter.class b/libjava/classpath/lib/gnu/java/util/prefs/NodeWriter.class
new file mode 100644
index 00000000000..929229e540a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/prefs/NodeWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/prefs/gconf/GConfNativePeer.class b/libjava/classpath/lib/gnu/java/util/prefs/gconf/GConfNativePeer.class
new file mode 100644
index 00000000000..7a24d86aa6b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/prefs/gconf/GConfNativePeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/BacktrackStack$Backtrack.class b/libjava/classpath/lib/gnu/java/util/regex/BacktrackStack$Backtrack.class
new file mode 100644
index 00000000000..34b9e51a650
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/BacktrackStack$Backtrack.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/BacktrackStack.class b/libjava/classpath/lib/gnu/java/util/regex/BacktrackStack.class
new file mode 100644
index 00000000000..b615849609e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/BacktrackStack.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/CharIndexed.class b/libjava/classpath/lib/gnu/java/util/regex/CharIndexed.class
new file mode 100644
index 00000000000..09beb399a25
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/CharIndexed.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/CharIndexedCharArray.class b/libjava/classpath/lib/gnu/java/util/regex/CharIndexedCharArray.class
new file mode 100644
index 00000000000..2ede3d64525
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/CharIndexedCharArray.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/CharIndexedCharSequence.class b/libjava/classpath/lib/gnu/java/util/regex/CharIndexedCharSequence.class
new file mode 100644
index 00000000000..351c0af1abe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/CharIndexedCharSequence.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/CharIndexedInputStream.class b/libjava/classpath/lib/gnu/java/util/regex/CharIndexedInputStream.class
new file mode 100644
index 00000000000..cf5fd881cfe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/CharIndexedInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/CharIndexedString.class b/libjava/classpath/lib/gnu/java/util/regex/CharIndexedString.class
new file mode 100644
index 00000000000..0710442c602
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/CharIndexedString.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/CharIndexedStringBuffer.class b/libjava/classpath/lib/gnu/java/util/regex/CharIndexedStringBuffer.class
new file mode 100644
index 00000000000..8dfff383393
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/CharIndexedStringBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RE$CharExpression.class b/libjava/classpath/lib/gnu/java/util/regex/RE$CharExpression.class
new file mode 100644
index 00000000000..da1645dc711
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RE$CharExpression.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RE$CharUnit.class b/libjava/classpath/lib/gnu/java/util/regex/RE$CharUnit.class
new file mode 100644
index 00000000000..4dd3fd602f9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RE$CharUnit.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RE$IntPair.class b/libjava/classpath/lib/gnu/java/util/regex/RE$IntPair.class
new file mode 100644
index 00000000000..8d2299f63e5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RE$IntPair.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RE$NamedProperty.class b/libjava/classpath/lib/gnu/java/util/regex/RE$NamedProperty.class
new file mode 100644
index 00000000000..b9be6348bd0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RE$NamedProperty.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RE$ParseCharClassResult.class b/libjava/classpath/lib/gnu/java/util/regex/RE$ParseCharClassResult.class
new file mode 100644
index 00000000000..e7e5fac75f3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RE$ParseCharClassResult.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RE.class b/libjava/classpath/lib/gnu/java/util/regex/RE.class
new file mode 100644
index 00000000000..d2b08dade12
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/REException.class b/libjava/classpath/lib/gnu/java/util/regex/REException.class
new file mode 100644
index 00000000000..03dd2facb4a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/REException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/REFilterInputStream.class b/libjava/classpath/lib/gnu/java/util/regex/REFilterInputStream.class
new file mode 100644
index 00000000000..46830048af8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/REFilterInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/REMatch.class b/libjava/classpath/lib/gnu/java/util/regex/REMatch.class
new file mode 100644
index 00000000000..aa08c348abc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/REMatch.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/REMatchEnumeration.class b/libjava/classpath/lib/gnu/java/util/regex/REMatchEnumeration.class
new file mode 100644
index 00000000000..d3f9af9c84e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/REMatchEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RESyntax.class b/libjava/classpath/lib/gnu/java/util/regex/RESyntax.class
new file mode 100644
index 00000000000..6c630cb677b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RESyntax.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/REToken.class b/libjava/classpath/lib/gnu/java/util/regex/REToken.class
new file mode 100644
index 00000000000..4d639446e7d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/REToken.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenAny.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenAny.class
new file mode 100644
index 00000000000..f41668e1ba9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenAny.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenBackRef.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenBackRef.class
new file mode 100644
index 00000000000..72d37f4d897
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenBackRef.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenChar.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenChar.class
new file mode 100644
index 00000000000..0d9a72acdf6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenChar.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenEnd.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenEnd.class
new file mode 100644
index 00000000000..47cd3b90e59
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenEnd.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenEndOfPreviousMatch.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenEndOfPreviousMatch.class
new file mode 100644
index 00000000000..a5a3db55d13
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenEndOfPreviousMatch.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenEndSub.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenEndSub.class
new file mode 100644
index 00000000000..15fd74c5ad2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenEndSub.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenIndependent.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenIndependent.class
new file mode 100644
index 00000000000..ae764c80b6c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenIndependent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenLookAhead.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenLookAhead.class
new file mode 100644
index 00000000000..a77b64b1951
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenLookAhead.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenLookBehind$RETokenMatchHereOnly.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenLookBehind$RETokenMatchHereOnly.class
new file mode 100644
index 00000000000..9c8b3a3deb7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenLookBehind$RETokenMatchHereOnly.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenLookBehind.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenLookBehind.class
new file mode 100644
index 00000000000..3e09060fd27
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenLookBehind.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$1.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$1.class
new file mode 100644
index 00000000000..109851311fc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$Handler.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$Handler.class
new file mode 100644
index 00000000000..64eefa696ce
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$Handler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$POSIXHandler.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$POSIXHandler.class
new file mode 100644
index 00000000000..8ac5ab21aa0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$POSIXHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$UnicodeBlockHandler.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$UnicodeBlockHandler.class
new file mode 100644
index 00000000000..5807ea3d6b3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$UnicodeBlockHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$UnicodeCategoriesHandler.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$UnicodeCategoriesHandler.class
new file mode 100644
index 00000000000..9a0cdb5359e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$UnicodeCategoriesHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$UnicodeCategoryHandler.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$UnicodeCategoryHandler.class
new file mode 100644
index 00000000000..fb099b6b9b8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty$UnicodeCategoryHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty.class
new file mode 100644
index 00000000000..c4e36ae6629
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenNamedProperty.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenOneOf.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenOneOf.class
new file mode 100644
index 00000000000..2606bd63e0f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenOneOf.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenPOSIX.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenPOSIX.class
new file mode 100644
index 00000000000..6db3c463cf1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenPOSIX.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenRange.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenRange.class
new file mode 100644
index 00000000000..e5ec4b23bb8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenRange.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$DoablesFinder.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$DoablesFinder.class
new file mode 100644
index 00000000000..5fa7c5e5aac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$DoablesFinder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$FindMatchControl.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$FindMatchControl.class
new file mode 100644
index 00000000000..f73abcb1861
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$FindMatchControl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$FindMatchControlStack.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$FindMatchControlStack.class
new file mode 100644
index 00000000000..b13752e34a3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$FindMatchControlStack.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$StackedInfo.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$StackedInfo.class
new file mode 100644
index 00000000000..cea639307b2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$StackedInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$TryAnotherResult.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$TryAnotherResult.class
new file mode 100644
index 00000000000..cc1574552ae
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated$TryAnotherResult.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated.class
new file mode 100644
index 00000000000..b3570c14063
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenRepeated.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenStart.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenStart.class
new file mode 100644
index 00000000000..c1bfc44dbf2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenStart.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/RETokenWordBoundary.class b/libjava/classpath/lib/gnu/java/util/regex/RETokenWordBoundary.class
new file mode 100644
index 00000000000..e83e5fd23fe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/RETokenWordBoundary.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/util/regex/UncheckedRE.class b/libjava/classpath/lib/gnu/java/util/regex/UncheckedRE.class
new file mode 100644
index 00000000000..e9684862f53
--- /dev/null
+++ b/libjava/classpath/lib/gnu/java/util/regex/UncheckedRE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/RSACipherImpl.class b/libjava/classpath/lib/gnu/javax/crypto/RSACipherImpl.class
new file mode 100644
index 00000000000..154be44ca2b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/RSACipherImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/assembly/Assembly.class b/libjava/classpath/lib/gnu/javax/crypto/assembly/Assembly.class
new file mode 100644
index 00000000000..2d5c0e1d2d3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/assembly/Assembly.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/assembly/Cascade.class b/libjava/classpath/lib/gnu/javax/crypto/assembly/Cascade.class
new file mode 100644
index 00000000000..171e508bf8c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/assembly/Cascade.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/assembly/CascadeStage.class b/libjava/classpath/lib/gnu/javax/crypto/assembly/CascadeStage.class
new file mode 100644
index 00000000000..ca41b8b06a5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/assembly/CascadeStage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/assembly/CascadeTransformer.class b/libjava/classpath/lib/gnu/javax/crypto/assembly/CascadeTransformer.class
new file mode 100644
index 00000000000..64e5a14190b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/assembly/CascadeTransformer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/assembly/DeflateTransformer.class b/libjava/classpath/lib/gnu/javax/crypto/assembly/DeflateTransformer.class
new file mode 100644
index 00000000000..9b47c8c5650
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/assembly/DeflateTransformer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/assembly/Direction.class b/libjava/classpath/lib/gnu/javax/crypto/assembly/Direction.class
new file mode 100644
index 00000000000..fb994978e4b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/assembly/Direction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/assembly/LoopbackTransformer.class b/libjava/classpath/lib/gnu/javax/crypto/assembly/LoopbackTransformer.class
new file mode 100644
index 00000000000..34ff3fc6e97
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/assembly/LoopbackTransformer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/assembly/ModeStage.class b/libjava/classpath/lib/gnu/javax/crypto/assembly/ModeStage.class
new file mode 100644
index 00000000000..bb7f8859c78
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/assembly/ModeStage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/assembly/Operation.class b/libjava/classpath/lib/gnu/javax/crypto/assembly/Operation.class
new file mode 100644
index 00000000000..69dbdacc54e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/assembly/Operation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/assembly/PaddingTransformer.class b/libjava/classpath/lib/gnu/javax/crypto/assembly/PaddingTransformer.class
new file mode 100644
index 00000000000..24c6e27e98c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/assembly/PaddingTransformer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/assembly/Stage.class b/libjava/classpath/lib/gnu/javax/crypto/assembly/Stage.class
new file mode 100644
index 00000000000..03019f30ac8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/assembly/Stage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/assembly/Transformer.class b/libjava/classpath/lib/gnu/javax/crypto/assembly/Transformer.class
new file mode 100644
index 00000000000..e5850c4f081
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/assembly/Transformer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/assembly/TransformerException.class b/libjava/classpath/lib/gnu/javax/crypto/assembly/TransformerException.class
new file mode 100644
index 00000000000..6b37720404e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/assembly/TransformerException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/Anubis.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/Anubis.class
new file mode 100644
index 00000000000..81dca322c34
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/Anubis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/BaseCipher.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/BaseCipher.class
new file mode 100644
index 00000000000..dc48fc22ee4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/BaseCipher.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/Blowfish$Block.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/Blowfish$Block.class
new file mode 100644
index 00000000000..c46c20d4872
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/Blowfish$Block.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/Blowfish$Context.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/Blowfish$Context.class
new file mode 100644
index 00000000000..30d5f8eee93
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/Blowfish$Context.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/Blowfish.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/Blowfish.class
new file mode 100644
index 00000000000..ac561249f78
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/Blowfish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/Cast5$Cast5Key.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/Cast5$Cast5Key.class
new file mode 100644
index 00000000000..bb7757f8070
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/Cast5$Cast5Key.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/Cast5.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/Cast5.class
new file mode 100644
index 00000000000..bb4f9697352
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/Cast5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/CipherFactory.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/CipherFactory.class
new file mode 100644
index 00000000000..4548e23b01a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/CipherFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/DES$Context.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/DES$Context.class
new file mode 100644
index 00000000000..5edf6fbd833
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/DES$Context.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/DES.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/DES.class
new file mode 100644
index 00000000000..de8e57ef5e3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/DES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/IBlockCipher.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/IBlockCipher.class
new file mode 100644
index 00000000000..be921c15829
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/IBlockCipher.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/IBlockCipherSpi.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/IBlockCipherSpi.class
new file mode 100644
index 00000000000..4f686b20872
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/IBlockCipherSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/Khazad.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/Khazad.class
new file mode 100644
index 00000000000..40dd935901a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/Khazad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/NullCipher.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/NullCipher.class
new file mode 100644
index 00000000000..332e2914a6b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/NullCipher.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/Rijndael.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/Rijndael.class
new file mode 100644
index 00000000000..2e074e51f04
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/Rijndael.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/Serpent$Key.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/Serpent$Key.class
new file mode 100644
index 00000000000..effa3851b2c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/Serpent$Key.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/Serpent.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/Serpent.class
new file mode 100644
index 00000000000..6736a55b5fb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/Serpent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/Square.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/Square.class
new file mode 100644
index 00000000000..0900898d90b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/Square.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/TripleDES$Context.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/TripleDES$Context.class
new file mode 100644
index 00000000000..e1c47abef00
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/TripleDES$Context.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/TripleDES.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/TripleDES.class
new file mode 100644
index 00000000000..a92b9620cc2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/TripleDES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/Twofish.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/Twofish.class
new file mode 100644
index 00000000000..74f36a673f2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/Twofish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/cipher/WeakKeyException.class b/libjava/classpath/lib/gnu/javax/crypto/cipher/WeakKeyException.class
new file mode 100644
index 00000000000..2b13b7f453a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/cipher/WeakKeyException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/DiffieHellmanImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/DiffieHellmanImpl.class
new file mode 100644
index 00000000000..777d436d796
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/DiffieHellmanImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/GnuCrypto$1.class b/libjava/classpath/lib/gnu/javax/crypto/jce/GnuCrypto$1.class
new file mode 100644
index 00000000000..13b01ac78da
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/GnuCrypto$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/GnuCrypto.class b/libjava/classpath/lib/gnu/javax/crypto/jce/GnuCrypto.class
new file mode 100644
index 00000000000..746da7bb610
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/GnuCrypto.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/GnuSasl$1.class b/libjava/classpath/lib/gnu/javax/crypto/jce/GnuSasl$1.class
new file mode 100644
index 00000000000..039f92cb0b0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/GnuSasl$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/GnuSasl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/GnuSasl.class
new file mode 100644
index 00000000000..cad5a40b7fe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/GnuSasl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacHaval.class b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacHaval.class
new file mode 100644
index 00000000000..593f4c3bce0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacHaval.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacMD2.class b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacMD2.class
new file mode 100644
index 00000000000..bb69c04be6e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacMD2.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacMD4.class b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacMD4.class
new file mode 100644
index 00000000000..8f0da33e1b4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacMD4.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacMD5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacMD5.class
new file mode 100644
index 00000000000..0bbb39ca25b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacMD5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacRipeMD128.class b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacRipeMD128.class
new file mode 100644
index 00000000000..a3238132001
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacRipeMD128.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacRipeMD160.class b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacRipeMD160.class
new file mode 100644
index 00000000000..e1cd7d86c2a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacRipeMD160.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA1.class b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA1.class
new file mode 100644
index 00000000000..9fd94f73360
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA256.class b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA256.class
new file mode 100644
index 00000000000..23d2192b26c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA256.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA384.class b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA384.class
new file mode 100644
index 00000000000..f0b86274a1a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA384.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA512.class b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA512.class
new file mode 100644
index 00000000000..bfee628bffe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacSHA512.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacTiger.class b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacTiger.class
new file mode 100644
index 00000000000..77213f4b154
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacTiger.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacWhirlpool.class b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacWhirlpool.class
new file mode 100644
index 00000000000..cc418647da5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory$HMacWhirlpool.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory.class b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory.class
new file mode 100644
index 00000000000..4497929739d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/PBKDF2SecretKeyFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AES128KeyWrapSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AES128KeyWrapSpi.class
new file mode 100644
index 00000000000..34a075a3ba7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AES128KeyWrapSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AES192KeyWrapSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AES192KeyWrapSpi.class
new file mode 100644
index 00000000000..cdf9ac289d0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AES192KeyWrapSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AES256KeyWrapSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AES256KeyWrapSpi.class
new file mode 100644
index 00000000000..7755f91c203
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AES256KeyWrapSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AESKeyWrapSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AESKeyWrapSpi.class
new file mode 100644
index 00000000000..e40e028002e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AESKeyWrapSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AESSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AESSpi.class
new file mode 100644
index 00000000000..268adb81c16
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AESSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/ARCFourSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/ARCFourSpi.class
new file mode 100644
index 00000000000..f1bf06f8f49
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/ARCFourSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AnubisSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AnubisSpi.class
new file mode 100644
index 00000000000..b1b9f438158
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/AnubisSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/BlowfishSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/BlowfishSpi.class
new file mode 100644
index 00000000000..4b5a1308e7b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/BlowfishSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/Cast5Spi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/Cast5Spi.class
new file mode 100644
index 00000000000..767b8902d2d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/Cast5Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/CipherAdapter.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/CipherAdapter.class
new file mode 100644
index 00000000000..91f2649b852
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/CipherAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/DESSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/DESSpi.class
new file mode 100644
index 00000000000..91e1931b6c9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/DESSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/KeyWrappingAlgorithmAdapter.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/KeyWrappingAlgorithmAdapter.class
new file mode 100644
index 00000000000..172c5bb2934
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/KeyWrappingAlgorithmAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/KhazadSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/KhazadSpi.class
new file mode 100644
index 00000000000..0c133eab682
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/KhazadSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/NullCipherSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/NullCipherSpi.class
new file mode 100644
index 00000000000..f6796be3adf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/NullCipherSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$AES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$AES.class
new file mode 100644
index 00000000000..9aeda4489e1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$AES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Anubis.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Anubis.class
new file mode 100644
index 00000000000..a3bb8bbbdf4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Anubis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Blowfish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Blowfish.class
new file mode 100644
index 00000000000..bad376a9460
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Blowfish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Cast5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Cast5.class
new file mode 100644
index 00000000000..fd458d97c07
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Cast5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$DES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$DES.class
new file mode 100644
index 00000000000..ef111d4f87b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$DES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Khazad.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Khazad.class
new file mode 100644
index 00000000000..185d966ca3e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Khazad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Serpent.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Serpent.class
new file mode 100644
index 00000000000..098c4a88693
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Serpent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Square.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Square.class
new file mode 100644
index 00000000000..58d1c9eda3c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Square.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$TripleDES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$TripleDES.class
new file mode 100644
index 00000000000..9fc6cac7f28
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$TripleDES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Twofish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Twofish.class
new file mode 100644
index 00000000000..c869e58b08b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval$Twofish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval.class
new file mode 100644
index 00000000000..5a2d9d07840
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacHaval.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$AES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$AES.class
new file mode 100644
index 00000000000..5055d05711b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$AES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Anubis.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Anubis.class
new file mode 100644
index 00000000000..6d12fd65a02
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Anubis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Blowfish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Blowfish.class
new file mode 100644
index 00000000000..5af49f2fe50
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Blowfish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Cast5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Cast5.class
new file mode 100644
index 00000000000..4deb7839cd8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Cast5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$DES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$DES.class
new file mode 100644
index 00000000000..cef6bf86d41
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$DES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Khazad.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Khazad.class
new file mode 100644
index 00000000000..dfcd56b27dc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Khazad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Serpent.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Serpent.class
new file mode 100644
index 00000000000..f1c4c31d3b4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Serpent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Square.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Square.class
new file mode 100644
index 00000000000..2b96c5e2153
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Square.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$TripleDES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$TripleDES.class
new file mode 100644
index 00000000000..4cc7e61f2d6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$TripleDES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Twofish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Twofish.class
new file mode 100644
index 00000000000..01a5cc85c0b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2$Twofish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2.class
new file mode 100644
index 00000000000..951d2d461a8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD2.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$AES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$AES.class
new file mode 100644
index 00000000000..764c572d193
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$AES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Anubis.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Anubis.class
new file mode 100644
index 00000000000..76eab32ca78
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Anubis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Blowfish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Blowfish.class
new file mode 100644
index 00000000000..07eeee4c215
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Blowfish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Cast5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Cast5.class
new file mode 100644
index 00000000000..36b90c57748
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Cast5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$DES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$DES.class
new file mode 100644
index 00000000000..ed4e239ce98
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$DES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Khazad.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Khazad.class
new file mode 100644
index 00000000000..1b5f8115fcd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Khazad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Serpent.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Serpent.class
new file mode 100644
index 00000000000..5888670ae88
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Serpent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Square.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Square.class
new file mode 100644
index 00000000000..83dc11485a3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Square.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$TripleDES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$TripleDES.class
new file mode 100644
index 00000000000..d033ef089a7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$TripleDES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Twofish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Twofish.class
new file mode 100644
index 00000000000..1f14a5c171b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4$Twofish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4.class
new file mode 100644
index 00000000000..46d45f3d30d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD4.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$AES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$AES.class
new file mode 100644
index 00000000000..4e8b00de248
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$AES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Anubis.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Anubis.class
new file mode 100644
index 00000000000..2834bda6446
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Anubis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Blowfish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Blowfish.class
new file mode 100644
index 00000000000..93e1aebee9e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Blowfish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Cast5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Cast5.class
new file mode 100644
index 00000000000..e9acdf5c7ea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Cast5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$DES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$DES.class
new file mode 100644
index 00000000000..6dbd18e6b4c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$DES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Khazad.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Khazad.class
new file mode 100644
index 00000000000..422cf816dc3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Khazad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Serpent.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Serpent.class
new file mode 100644
index 00000000000..a994a84b414
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Serpent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Square.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Square.class
new file mode 100644
index 00000000000..7f40d2ea87c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Square.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$TripleDES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$TripleDES.class
new file mode 100644
index 00000000000..fcd265c0095
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$TripleDES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Twofish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Twofish.class
new file mode 100644
index 00000000000..d7aa6abb85d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5$Twofish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5.class
new file mode 100644
index 00000000000..02f11062461
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacMD5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$AES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$AES.class
new file mode 100644
index 00000000000..ea3973338c1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$AES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Anubis.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Anubis.class
new file mode 100644
index 00000000000..60ffacb16e7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Anubis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Blowfish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Blowfish.class
new file mode 100644
index 00000000000..6b23e1ed04c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Blowfish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Cast5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Cast5.class
new file mode 100644
index 00000000000..675a03203c1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Cast5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$DES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$DES.class
new file mode 100644
index 00000000000..eb13f91b568
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$DES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Khazad.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Khazad.class
new file mode 100644
index 00000000000..aec2baf7e6b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Khazad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Serpent.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Serpent.class
new file mode 100644
index 00000000000..12a41e920b0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Serpent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Square.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Square.class
new file mode 100644
index 00000000000..a5a201e45be
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Square.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$TripleDES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$TripleDES.class
new file mode 100644
index 00000000000..0ccba04988b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$TripleDES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Twofish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Twofish.class
new file mode 100644
index 00000000000..f2b60be6884
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128$Twofish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128.class
new file mode 100644
index 00000000000..53e3a02b28f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD128.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$AES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$AES.class
new file mode 100644
index 00000000000..a633fe26ec0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$AES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Anubis.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Anubis.class
new file mode 100644
index 00000000000..0d15238d8ce
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Anubis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Blowfish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Blowfish.class
new file mode 100644
index 00000000000..1e635f22990
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Blowfish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Cast5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Cast5.class
new file mode 100644
index 00000000000..b478acce27e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Cast5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$DES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$DES.class
new file mode 100644
index 00000000000..1b1288aa535
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$DES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Khazad.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Khazad.class
new file mode 100644
index 00000000000..b8499e1c8b7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Khazad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Serpent.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Serpent.class
new file mode 100644
index 00000000000..f922f8199bc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Serpent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Square.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Square.class
new file mode 100644
index 00000000000..17118c6d583
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Square.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$TripleDES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$TripleDES.class
new file mode 100644
index 00000000000..789ab4d6d06
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$TripleDES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Twofish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Twofish.class
new file mode 100644
index 00000000000..8c0ad6765d1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160$Twofish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160.class
new file mode 100644
index 00000000000..a7a532635e7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacRipeMD160.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$AES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$AES.class
new file mode 100644
index 00000000000..3a04a90d341
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$AES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Anubis.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Anubis.class
new file mode 100644
index 00000000000..961cb32f90e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Anubis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Blowfish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Blowfish.class
new file mode 100644
index 00000000000..3eb8deaed0d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Blowfish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Cast5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Cast5.class
new file mode 100644
index 00000000000..8ac55be5d27
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Cast5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$DES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$DES.class
new file mode 100644
index 00000000000..91488005a71
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$DES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Khazad.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Khazad.class
new file mode 100644
index 00000000000..89754165e1c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Khazad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Serpent.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Serpent.class
new file mode 100644
index 00000000000..2276d36f7ea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Serpent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Square.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Square.class
new file mode 100644
index 00000000000..17957937de1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Square.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$TripleDES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$TripleDES.class
new file mode 100644
index 00000000000..d31fe635fad
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$TripleDES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Twofish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Twofish.class
new file mode 100644
index 00000000000..9d12d74ba2a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1$Twofish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1.class
new file mode 100644
index 00000000000..ea88cade8e4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$AES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$AES.class
new file mode 100644
index 00000000000..254537a4b2d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$AES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Anubis.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Anubis.class
new file mode 100644
index 00000000000..23f036eebc1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Anubis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Blowfish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Blowfish.class
new file mode 100644
index 00000000000..ce38efe190b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Blowfish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Cast5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Cast5.class
new file mode 100644
index 00000000000..a6750d9b9d2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Cast5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$DES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$DES.class
new file mode 100644
index 00000000000..3c4bed0e852
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$DES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Khazad.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Khazad.class
new file mode 100644
index 00000000000..89a356e67b1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Khazad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Serpent.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Serpent.class
new file mode 100644
index 00000000000..25c9f924e10
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Serpent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Square.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Square.class
new file mode 100644
index 00000000000..c1b509b42f5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Square.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$TripleDES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$TripleDES.class
new file mode 100644
index 00000000000..9632900ebed
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$TripleDES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Twofish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Twofish.class
new file mode 100644
index 00000000000..aef1323e4ea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256$Twofish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256.class
new file mode 100644
index 00000000000..09987b56230
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA256.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$AES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$AES.class
new file mode 100644
index 00000000000..e3b64f532f9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$AES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Anubis.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Anubis.class
new file mode 100644
index 00000000000..91b351de587
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Anubis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Blowfish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Blowfish.class
new file mode 100644
index 00000000000..811609ae3db
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Blowfish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Cast5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Cast5.class
new file mode 100644
index 00000000000..7ad49d92832
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Cast5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$DES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$DES.class
new file mode 100644
index 00000000000..0aa1d6376ef
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$DES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Khazad.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Khazad.class
new file mode 100644
index 00000000000..e01232584e4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Khazad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Serpent.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Serpent.class
new file mode 100644
index 00000000000..3b002970369
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Serpent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Square.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Square.class
new file mode 100644
index 00000000000..6a5f44146f5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Square.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$TripleDES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$TripleDES.class
new file mode 100644
index 00000000000..5a40a1f5988
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$TripleDES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Twofish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Twofish.class
new file mode 100644
index 00000000000..c743a62cbc2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384$Twofish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384.class
new file mode 100644
index 00000000000..2a8b1776eff
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA384.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$AES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$AES.class
new file mode 100644
index 00000000000..1470121544d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$AES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Anubis.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Anubis.class
new file mode 100644
index 00000000000..2c776e85cfe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Anubis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Blowfish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Blowfish.class
new file mode 100644
index 00000000000..cbc2e47bb7f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Blowfish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Cast5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Cast5.class
new file mode 100644
index 00000000000..cd0feeda22b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Cast5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$DES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$DES.class
new file mode 100644
index 00000000000..ad9d2541493
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$DES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Khazad.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Khazad.class
new file mode 100644
index 00000000000..e37e63f9f5d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Khazad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Serpent.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Serpent.class
new file mode 100644
index 00000000000..5459f9a0edc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Serpent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Square.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Square.class
new file mode 100644
index 00000000000..5f7786b9ada
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Square.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$TripleDES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$TripleDES.class
new file mode 100644
index 00000000000..ba1edd4ede9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$TripleDES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Twofish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Twofish.class
new file mode 100644
index 00000000000..d4d3d7d5581
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512$Twofish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512.class
new file mode 100644
index 00000000000..1d608201cc1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacSHA512.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$AES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$AES.class
new file mode 100644
index 00000000000..c84ed67fc34
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$AES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Anubis.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Anubis.class
new file mode 100644
index 00000000000..2645583248d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Anubis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Blowfish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Blowfish.class
new file mode 100644
index 00000000000..e5e01317a49
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Blowfish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Cast5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Cast5.class
new file mode 100644
index 00000000000..c02333fa0d6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Cast5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$DES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$DES.class
new file mode 100644
index 00000000000..25e9e19bf83
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$DES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Khazad.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Khazad.class
new file mode 100644
index 00000000000..1a74a38d9f7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Khazad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Serpent.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Serpent.class
new file mode 100644
index 00000000000..1f3e1ec07da
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Serpent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Square.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Square.class
new file mode 100644
index 00000000000..9429d491e34
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Square.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$TripleDES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$TripleDES.class
new file mode 100644
index 00000000000..3f7ca86b8b0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$TripleDES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Twofish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Twofish.class
new file mode 100644
index 00000000000..354b5b25fb1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger$Twofish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger.class
new file mode 100644
index 00000000000..7fac486914f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacTiger.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$AES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$AES.class
new file mode 100644
index 00000000000..14d17e983d4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$AES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Anubis.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Anubis.class
new file mode 100644
index 00000000000..5482386eb60
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Anubis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Blowfish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Blowfish.class
new file mode 100644
index 00000000000..6d5c34e543c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Blowfish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Cast5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Cast5.class
new file mode 100644
index 00000000000..f1096cce1dc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Cast5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$DES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$DES.class
new file mode 100644
index 00000000000..2c761635f72
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$DES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Khazad.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Khazad.class
new file mode 100644
index 00000000000..f485a804102
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Khazad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Serpent.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Serpent.class
new file mode 100644
index 00000000000..887c846443e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Serpent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Square.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Square.class
new file mode 100644
index 00000000000..29b8389d627
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Square.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$TripleDES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$TripleDES.class
new file mode 100644
index 00000000000..887dc9d13e2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$TripleDES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Twofish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Twofish.class
new file mode 100644
index 00000000000..fda3802ebb5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool$Twofish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool.class
new file mode 100644
index 00000000000..794f2c113b1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2$HMacWhirlpool.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2.class
new file mode 100644
index 00000000000..f82f244bb56
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/PBES2.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/RijndaelSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/RijndaelSpi.class
new file mode 100644
index 00000000000..225be83f675
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/RijndaelSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/SerpentSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/SerpentSpi.class
new file mode 100644
index 00000000000..c1791f9f0a9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/SerpentSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/SquareSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/SquareSpi.class
new file mode 100644
index 00000000000..8d5c25c8431
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/SquareSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/TripleDESKeyWrapSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/TripleDESKeyWrapSpi.class
new file mode 100644
index 00000000000..cd1e9b0cb6a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/TripleDESKeyWrapSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/TripleDESSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/TripleDESSpi.class
new file mode 100644
index 00000000000..0feb2cb07dc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/TripleDESSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/TwofishSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/TwofishSpi.class
new file mode 100644
index 00000000000..e2d48984299
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/cipher/TwofishSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/AnubisKeyGeneratorImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/AnubisKeyGeneratorImpl.class
new file mode 100644
index 00000000000..14b129724f9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/AnubisKeyGeneratorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/AnubisSecretKeyFactoryImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/AnubisSecretKeyFactoryImpl.class
new file mode 100644
index 00000000000..174f53e421f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/AnubisSecretKeyFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/BlowfishKeyGeneratorImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/BlowfishKeyGeneratorImpl.class
new file mode 100644
index 00000000000..5550f50e1f8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/BlowfishKeyGeneratorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/BlowfishSecretKeyFactoryImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/BlowfishSecretKeyFactoryImpl.class
new file mode 100644
index 00000000000..d176027eb50
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/BlowfishSecretKeyFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/Cast5KeyGeneratorImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/Cast5KeyGeneratorImpl.class
new file mode 100644
index 00000000000..b2e45be7c9d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/Cast5KeyGeneratorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/Cast5SecretKeyFactoryImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/Cast5SecretKeyFactoryImpl.class
new file mode 100644
index 00000000000..08f86a58ee7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/Cast5SecretKeyFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/DESKeyGeneratorImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/DESKeyGeneratorImpl.class
new file mode 100644
index 00000000000..bc3ec363d4f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/DESKeyGeneratorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/DESSecretKeyFactoryImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/DESSecretKeyFactoryImpl.class
new file mode 100644
index 00000000000..e64eb900b28
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/DESSecretKeyFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/DESedeSecretKeyFactoryImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/DESedeSecretKeyFactoryImpl.class
new file mode 100644
index 00000000000..a8e7c2577fe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/DESedeSecretKeyFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/KhazadKeyGeneratorImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/KhazadKeyGeneratorImpl.class
new file mode 100644
index 00000000000..815b3ff6a5f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/KhazadKeyGeneratorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/KhazadSecretKeyFactoryImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/KhazadSecretKeyFactoryImpl.class
new file mode 100644
index 00000000000..7b5b0cc27c8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/KhazadSecretKeyFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/RijndaelKeyGeneratorImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/RijndaelKeyGeneratorImpl.class
new file mode 100644
index 00000000000..2a7b461693d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/RijndaelKeyGeneratorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/RijndaelSecretKeyFactoryImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/RijndaelSecretKeyFactoryImpl.class
new file mode 100644
index 00000000000..cae0da3208d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/RijndaelSecretKeyFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/SecretKeyFactoryImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/SecretKeyFactoryImpl.class
new file mode 100644
index 00000000000..4ecb9f067e3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/SecretKeyFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/SecretKeyGeneratorImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/SecretKeyGeneratorImpl.class
new file mode 100644
index 00000000000..d66c81e6fd3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/SecretKeyGeneratorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/SerpentKeyGeneratorImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/SerpentKeyGeneratorImpl.class
new file mode 100644
index 00000000000..3d46a1c60cc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/SerpentKeyGeneratorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/SerpentSecretKeyFactoryImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/SerpentSecretKeyFactoryImpl.class
new file mode 100644
index 00000000000..327a65519e0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/SerpentSecretKeyFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/SquareKeyGeneratorImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/SquareKeyGeneratorImpl.class
new file mode 100644
index 00000000000..408fe816246
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/SquareKeyGeneratorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/SquareSecretKeyFactoryImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/SquareSecretKeyFactoryImpl.class
new file mode 100644
index 00000000000..9fa94579f18
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/SquareSecretKeyFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/TripleDESKeyGeneratorImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/TripleDESKeyGeneratorImpl.class
new file mode 100644
index 00000000000..4621cde694c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/TripleDESKeyGeneratorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/TwofishKeyGeneratorImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/TwofishKeyGeneratorImpl.class
new file mode 100644
index 00000000000..6f0d4497cb6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/TwofishKeyGeneratorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/key/TwofishSecretKeyFactoryImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/key/TwofishSecretKeyFactoryImpl.class
new file mode 100644
index 00000000000..c4ad7fc780b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/key/TwofishSecretKeyFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/keyring/GnuKeyring.class b/libjava/classpath/lib/gnu/javax/crypto/jce/keyring/GnuKeyring.class
new file mode 100644
index 00000000000..4aa0694df0f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/keyring/GnuKeyring.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacHavalSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacHavalSpi.class
new file mode 100644
index 00000000000..5647594400a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacHavalSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacMD2Spi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacMD2Spi.class
new file mode 100644
index 00000000000..f87845df244
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacMD2Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacMD4Spi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacMD4Spi.class
new file mode 100644
index 00000000000..d7442b2e3e1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacMD4Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacMD5Spi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacMD5Spi.class
new file mode 100644
index 00000000000..c2b04f19881
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacMD5Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacRipeMD128Spi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacRipeMD128Spi.class
new file mode 100644
index 00000000000..1aeb2c6cebd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacRipeMD128Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacRipeMD160Spi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacRipeMD160Spi.class
new file mode 100644
index 00000000000..472f488f3bf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacRipeMD160Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA160Spi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA160Spi.class
new file mode 100644
index 00000000000..e2114629bb8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA160Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA256Spi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA256Spi.class
new file mode 100644
index 00000000000..d5355c1999f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA256Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA384Spi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA384Spi.class
new file mode 100644
index 00000000000..eb31def4ecc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA384Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA512Spi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA512Spi.class
new file mode 100644
index 00000000000..b64fc623d90
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacSHA512Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacTigerSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacTigerSpi.class
new file mode 100644
index 00000000000..d995497a82f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacTigerSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacWhirlpoolSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacWhirlpoolSpi.class
new file mode 100644
index 00000000000..6c56d2e8ee3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/HMacWhirlpoolSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/MacAdapter.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/MacAdapter.class
new file mode 100644
index 00000000000..08d9ad164d8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/MacAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacAnubisImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacAnubisImpl.class
new file mode 100644
index 00000000000..cd8c33c1adc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacAnubisImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacBlowfishImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacBlowfishImpl.class
new file mode 100644
index 00000000000..aa2fb8251b2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacBlowfishImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacCast5Impl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacCast5Impl.class
new file mode 100644
index 00000000000..10db59be166
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacCast5Impl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacDESImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacDESImpl.class
new file mode 100644
index 00000000000..4010a1097a8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacDESImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Anubis.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Anubis.class
new file mode 100644
index 00000000000..f08262006e8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Anubis.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Blowfish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Blowfish.class
new file mode 100644
index 00000000000..7988e67a1d5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Blowfish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Cast5.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Cast5.class
new file mode 100644
index 00000000000..255c05e1d14
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Cast5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$DES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$DES.class
new file mode 100644
index 00000000000..471a25e1260
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$DES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Khazad.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Khazad.class
new file mode 100644
index 00000000000..6600160d4c3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Khazad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Rijndael.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Rijndael.class
new file mode 100644
index 00000000000..7837efc974c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Rijndael.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Serpent.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Serpent.class
new file mode 100644
index 00000000000..328f5dffb3a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Serpent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Square.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Square.class
new file mode 100644
index 00000000000..cec0a630305
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Square.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$TripleDES.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$TripleDES.class
new file mode 100644
index 00000000000..d1f77800722
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$TripleDES.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Twofish.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Twofish.class
new file mode 100644
index 00000000000..c497e637eda
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl$Twofish.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl.class
new file mode 100644
index 00000000000..a0149939a98
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacKhazadImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacKhazadImpl.class
new file mode 100644
index 00000000000..b64d4926e00
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacKhazadImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacRijndaelImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacRijndaelImpl.class
new file mode 100644
index 00000000000..5d88093668b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacRijndaelImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacSerpentImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacSerpentImpl.class
new file mode 100644
index 00000000000..c47eb5404dc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacSerpentImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacSquareImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacSquareImpl.class
new file mode 100644
index 00000000000..4040fa8aee3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacSquareImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacTripleDESImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacTripleDESImpl.class
new file mode 100644
index 00000000000..e6c390c610d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacTripleDESImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacTwofishImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacTwofishImpl.class
new file mode 100644
index 00000000000..ce7041da24a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/OMacTwofishImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/TMMH16Spi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/TMMH16Spi.class
new file mode 100644
index 00000000000..17a67ecc72a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/TMMH16Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/UHash32Spi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/UHash32Spi.class
new file mode 100644
index 00000000000..eaf7c1b1807
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/UHash32Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/mac/UMac32Spi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/UMac32Spi.class
new file mode 100644
index 00000000000..506ad50e2a7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/mac/UMac32Spi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/params/BlockCipherParameters.class b/libjava/classpath/lib/gnu/javax/crypto/jce/params/BlockCipherParameters.class
new file mode 100644
index 00000000000..733b746319f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/params/BlockCipherParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/params/DEREncodingException.class b/libjava/classpath/lib/gnu/javax/crypto/jce/params/DEREncodingException.class
new file mode 100644
index 00000000000..ab9166b5be5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/params/DEREncodingException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/params/DERReader.class b/libjava/classpath/lib/gnu/javax/crypto/jce/params/DERReader.class
new file mode 100644
index 00000000000..e9489a5b224
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/params/DERReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/params/DERWriter.class b/libjava/classpath/lib/gnu/javax/crypto/jce/params/DERWriter.class
new file mode 100644
index 00000000000..d974a1510fe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/params/DERWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/prng/ARCFourRandomSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/prng/ARCFourRandomSpi.class
new file mode 100644
index 00000000000..1adddb1be0c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/prng/ARCFourRandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/prng/CSPRNGSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/prng/CSPRNGSpi.class
new file mode 100644
index 00000000000..c10db7a1e0d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/prng/CSPRNGSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/prng/FortunaImpl.class b/libjava/classpath/lib/gnu/javax/crypto/jce/prng/FortunaImpl.class
new file mode 100644
index 00000000000..817c972c95d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/prng/FortunaImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/prng/ICMRandomSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/prng/ICMRandomSpi.class
new file mode 100644
index 00000000000..747f0032817
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/prng/ICMRandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/prng/UMacRandomSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/prng/UMacRandomSpi.class
new file mode 100644
index 00000000000..214773133bf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/prng/UMacRandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHKeyFactory.class b/libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHKeyFactory.class
new file mode 100644
index 00000000000..2111a7b9e06
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHKeyFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHKeyPairGeneratorSpi.class b/libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHKeyPairGeneratorSpi.class
new file mode 100644
index 00000000000..0a6560ca21b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHKeyPairGeneratorSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHParameters.class b/libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHParameters.class
new file mode 100644
index 00000000000..39c15bce981
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHParametersGenerator.class b/libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHParametersGenerator.class
new file mode 100644
index 00000000000..b11159bed13
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/sig/DHParametersGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/spec/BlockCipherParameterSpec.class b/libjava/classpath/lib/gnu/javax/crypto/jce/spec/BlockCipherParameterSpec.class
new file mode 100644
index 00000000000..5156be2e8ec
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/spec/BlockCipherParameterSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/spec/TMMHParameterSpec.class b/libjava/classpath/lib/gnu/javax/crypto/jce/spec/TMMHParameterSpec.class
new file mode 100644
index 00000000000..890ba8ae194
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/spec/TMMHParameterSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/jce/spec/UMac32ParameterSpec.class b/libjava/classpath/lib/gnu/javax/crypto/jce/spec/UMac32ParameterSpec.class
new file mode 100644
index 00000000000..64639b0a11c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/jce/spec/UMac32ParameterSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/BaseKeyAgreementParty.class b/libjava/classpath/lib/gnu/javax/crypto/key/BaseKeyAgreementParty.class
new file mode 100644
index 00000000000..634d0bb7972
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/BaseKeyAgreementParty.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/GnuPBEKey.class b/libjava/classpath/lib/gnu/javax/crypto/key/GnuPBEKey.class
new file mode 100644
index 00000000000..1b4c4293f80
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/GnuPBEKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/GnuSecretKey.class b/libjava/classpath/lib/gnu/javax/crypto/key/GnuSecretKey.class
new file mode 100644
index 00000000000..f19c4bc4ee9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/GnuSecretKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/IKeyAgreementParty.class b/libjava/classpath/lib/gnu/javax/crypto/key/IKeyAgreementParty.class
new file mode 100644
index 00000000000..96da8838ee2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/IKeyAgreementParty.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/IncomingMessage.class b/libjava/classpath/lib/gnu/javax/crypto/key/IncomingMessage.class
new file mode 100644
index 00000000000..2275acfffb9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/IncomingMessage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/KeyAgreementException.class b/libjava/classpath/lib/gnu/javax/crypto/key/KeyAgreementException.class
new file mode 100644
index 00000000000..d56655ed3a6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/KeyAgreementException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/KeyAgreementFactory.class b/libjava/classpath/lib/gnu/javax/crypto/key/KeyAgreementFactory.class
new file mode 100644
index 00000000000..9d26b5d0943
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/KeyAgreementFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/OutgoingMessage.class b/libjava/classpath/lib/gnu/javax/crypto/key/OutgoingMessage.class
new file mode 100644
index 00000000000..5bf101b6f8a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/OutgoingMessage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/dh/DHKeyPairPKCS8Codec.class b/libjava/classpath/lib/gnu/javax/crypto/key/dh/DHKeyPairPKCS8Codec.class
new file mode 100644
index 00000000000..251a2997cdd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/dh/DHKeyPairPKCS8Codec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/dh/DHKeyPairRawCodec.class b/libjava/classpath/lib/gnu/javax/crypto/key/dh/DHKeyPairRawCodec.class
new file mode 100644
index 00000000000..60a83476580
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/dh/DHKeyPairRawCodec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/dh/DHKeyPairX509Codec.class b/libjava/classpath/lib/gnu/javax/crypto/key/dh/DHKeyPairX509Codec.class
new file mode 100644
index 00000000000..f05804fd185
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/dh/DHKeyPairX509Codec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/dh/DiffieHellmanKeyAgreement.class b/libjava/classpath/lib/gnu/javax/crypto/key/dh/DiffieHellmanKeyAgreement.class
new file mode 100644
index 00000000000..eb5ce608d13
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/dh/DiffieHellmanKeyAgreement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/dh/DiffieHellmanReceiver.class b/libjava/classpath/lib/gnu/javax/crypto/key/dh/DiffieHellmanReceiver.class
new file mode 100644
index 00000000000..cdc4b3e0d32
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/dh/DiffieHellmanReceiver.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/dh/DiffieHellmanSender.class b/libjava/classpath/lib/gnu/javax/crypto/key/dh/DiffieHellmanSender.class
new file mode 100644
index 00000000000..71253615473
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/dh/DiffieHellmanSender.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/dh/ElGamalKeyAgreement.class b/libjava/classpath/lib/gnu/javax/crypto/key/dh/ElGamalKeyAgreement.class
new file mode 100644
index 00000000000..e321d6c1eea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/dh/ElGamalKeyAgreement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/dh/ElGamalReceiver.class b/libjava/classpath/lib/gnu/javax/crypto/key/dh/ElGamalReceiver.class
new file mode 100644
index 00000000000..24c52c99dcd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/dh/ElGamalReceiver.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/dh/ElGamalSender.class b/libjava/classpath/lib/gnu/javax/crypto/key/dh/ElGamalSender.class
new file mode 100644
index 00000000000..6a1edcab3f2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/dh/ElGamalSender.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHKey.class b/libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHKey.class
new file mode 100644
index 00000000000..ae3a53fd4d8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHKeyPairGenerator.class b/libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHKeyPairGenerator.class
new file mode 100644
index 00000000000..21708e4f450
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHKeyPairGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHPrivateKey.class b/libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHPrivateKey.class
new file mode 100644
index 00000000000..ea6c6c3dbb9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHPrivateKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHPublicKey.class b/libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHPublicKey.class
new file mode 100644
index 00000000000..4ce1e3aa7a7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/dh/GnuDHPublicKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/dh/RFC2631.class b/libjava/classpath/lib/gnu/javax/crypto/key/dh/RFC2631.class
new file mode 100644
index 00000000000..6fde5f69b8b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/dh/RFC2631.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6Host.class b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6Host.class
new file mode 100644
index 00000000000..26a7ff42701
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6Host.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6KeyAgreement.class b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6KeyAgreement.class
new file mode 100644
index 00000000000..9122ca787b9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6KeyAgreement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6SaslClient.class b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6SaslClient.class
new file mode 100644
index 00000000000..0255854fa80
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6SaslClient.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6SaslServer.class b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6SaslServer.class
new file mode 100644
index 00000000000..401fed7a5ff
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6SaslServer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6TLSClient.class b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6TLSClient.class
new file mode 100644
index 00000000000..158119e4f8a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6TLSClient.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6TLSServer.class b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6TLSServer.class
new file mode 100644
index 00000000000..6278669cd2c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6TLSServer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6User.class b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6User.class
new file mode 100644
index 00000000000..c37bd3b210b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRP6User.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPAlgorithm.class b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPAlgorithm.class
new file mode 100644
index 00000000000..32cc96a1bdf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPAlgorithm.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPKey.class b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPKey.class
new file mode 100644
index 00000000000..d98f9332e00
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.class b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.class
new file mode 100644
index 00000000000..74565271313
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPKeyPairRawCodec.class b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPKeyPairRawCodec.class
new file mode 100644
index 00000000000..e34b81e38ea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPKeyPairRawCodec.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPPrivateKey.class b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPPrivateKey.class
new file mode 100644
index 00000000000..10b2065104d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPPrivateKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPPublicKey.class b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPPublicKey.class
new file mode 100644
index 00000000000..8083719df0b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/key/srp6/SRPPublicKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/AuthenticatedEntry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/AuthenticatedEntry.class
new file mode 100644
index 00000000000..bdca3a13825
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/AuthenticatedEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/BaseKeyring.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/BaseKeyring.class
new file mode 100644
index 00000000000..d57b08a95e9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/BaseKeyring.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/BinaryDataEntry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/BinaryDataEntry.class
new file mode 100644
index 00000000000..f2a5db7fac2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/BinaryDataEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/CertPathEntry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/CertPathEntry.class
new file mode 100644
index 00000000000..fe5083ff83e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/CertPathEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/CertificateEntry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/CertificateEntry.class
new file mode 100644
index 00000000000..d732dc661a5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/CertificateEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/CompressedEntry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/CompressedEntry.class
new file mode 100644
index 00000000000..f1955ca0afb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/CompressedEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/EncryptedEntry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/EncryptedEntry.class
new file mode 100644
index 00000000000..c9125f334be
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/EncryptedEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/Entry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/Entry.class
new file mode 100644
index 00000000000..15feb5cdb2e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/Entry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/EnvelopeEntry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/EnvelopeEntry.class
new file mode 100644
index 00000000000..d2ba95df2aa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/EnvelopeEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/GnuPrivateKeyring.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/GnuPrivateKeyring.class
new file mode 100644
index 00000000000..e270487ff75
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/GnuPrivateKeyring.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/GnuPublicKeyring.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/GnuPublicKeyring.class
new file mode 100644
index 00000000000..af49c02363b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/GnuPublicKeyring.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/IKeyring.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/IKeyring.class
new file mode 100644
index 00000000000..cbfd18fc5b4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/IKeyring.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/IPrivateKeyring.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/IPrivateKeyring.class
new file mode 100644
index 00000000000..9c575e139d6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/IPrivateKeyring.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/IPublicKeyring.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/IPublicKeyring.class
new file mode 100644
index 00000000000..d494a27c4ea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/IPublicKeyring.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/MalformedKeyringException.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/MalformedKeyringException.class
new file mode 100644
index 00000000000..62afc92739a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/MalformedKeyringException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/MaskableEnvelopeEntry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/MaskableEnvelopeEntry.class
new file mode 100644
index 00000000000..a847d81a2e1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/MaskableEnvelopeEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/MeteredInputStream.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/MeteredInputStream.class
new file mode 100644
index 00000000000..e179a91954f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/MeteredInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/PasswordAuthenticatedEntry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/PasswordAuthenticatedEntry.class
new file mode 100644
index 00000000000..ccc911035a1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/PasswordAuthenticatedEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/PasswordEncryptedEntry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/PasswordEncryptedEntry.class
new file mode 100644
index 00000000000..15f4eb45dda
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/PasswordEncryptedEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/PasswordProtectedEntry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/PasswordProtectedEntry.class
new file mode 100644
index 00000000000..1b2578e9b16
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/PasswordProtectedEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/PrimitiveEntry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/PrimitiveEntry.class
new file mode 100644
index 00000000000..ed589f5bdd5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/PrimitiveEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/PrivateKeyEntry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/PrivateKeyEntry.class
new file mode 100644
index 00000000000..024cdb30811
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/PrivateKeyEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/Properties.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/Properties.class
new file mode 100644
index 00000000000..1a02d62dc28
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/Properties.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/keyring/PublicKeyEntry.class b/libjava/classpath/lib/gnu/javax/crypto/keyring/PublicKeyEntry.class
new file mode 100644
index 00000000000..21447b519f3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/keyring/PublicKeyEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/kwa/AESKeyWrap.class b/libjava/classpath/lib/gnu/javax/crypto/kwa/AESKeyWrap.class
new file mode 100644
index 00000000000..cc53cc89b33
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/kwa/AESKeyWrap.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/kwa/BaseKeyWrappingAlgorithm.class b/libjava/classpath/lib/gnu/javax/crypto/kwa/BaseKeyWrappingAlgorithm.class
new file mode 100644
index 00000000000..2d15a56c879
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/kwa/BaseKeyWrappingAlgorithm.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/kwa/IKeyWrappingAlgorithm.class b/libjava/classpath/lib/gnu/javax/crypto/kwa/IKeyWrappingAlgorithm.class
new file mode 100644
index 00000000000..06256a9966a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/kwa/IKeyWrappingAlgorithm.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/kwa/KeyUnwrappingException.class b/libjava/classpath/lib/gnu/javax/crypto/kwa/KeyUnwrappingException.class
new file mode 100644
index 00000000000..5fb8b4684d9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/kwa/KeyUnwrappingException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/kwa/KeyWrappingAlgorithmFactory.class b/libjava/classpath/lib/gnu/javax/crypto/kwa/KeyWrappingAlgorithmFactory.class
new file mode 100644
index 00000000000..1c3b89b8b60
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/kwa/KeyWrappingAlgorithmFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/kwa/TripleDESKeyWrap.class b/libjava/classpath/lib/gnu/javax/crypto/kwa/TripleDESKeyWrap.class
new file mode 100644
index 00000000000..544e205e436
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/kwa/TripleDESKeyWrap.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mac/BaseMac.class b/libjava/classpath/lib/gnu/javax/crypto/mac/BaseMac.class
new file mode 100644
index 00000000000..d617c4426c1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mac/BaseMac.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mac/HMac.class b/libjava/classpath/lib/gnu/javax/crypto/mac/HMac.class
new file mode 100644
index 00000000000..5cb2ef2c2e8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mac/HMac.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mac/HMacFactory.class b/libjava/classpath/lib/gnu/javax/crypto/mac/HMacFactory.class
new file mode 100644
index 00000000000..3d2608d1843
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mac/HMacFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mac/IMac.class b/libjava/classpath/lib/gnu/javax/crypto/mac/IMac.class
new file mode 100644
index 00000000000..21fcbdbd869
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mac/IMac.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mac/MacFactory.class b/libjava/classpath/lib/gnu/javax/crypto/mac/MacFactory.class
new file mode 100644
index 00000000000..c3ed66a258e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mac/MacFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mac/MacInputStream.class b/libjava/classpath/lib/gnu/javax/crypto/mac/MacInputStream.class
new file mode 100644
index 00000000000..b862aedb6c0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mac/MacInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mac/MacOutputStream.class b/libjava/classpath/lib/gnu/javax/crypto/mac/MacOutputStream.class
new file mode 100644
index 00000000000..87a03e55e0e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mac/MacOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mac/OMAC.class b/libjava/classpath/lib/gnu/javax/crypto/mac/OMAC.class
new file mode 100644
index 00000000000..449ad35b322
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mac/OMAC.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mac/TMMH16.class b/libjava/classpath/lib/gnu/javax/crypto/mac/TMMH16.class
new file mode 100644
index 00000000000..e245bda88d9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mac/TMMH16.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mac/UHash32$L1Hash32.class b/libjava/classpath/lib/gnu/javax/crypto/mac/UHash32$L1Hash32.class
new file mode 100644
index 00000000000..f6276a81a15
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mac/UHash32$L1Hash32.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mac/UHash32$L2Hash32.class b/libjava/classpath/lib/gnu/javax/crypto/mac/UHash32$L2Hash32.class
new file mode 100644
index 00000000000..7f57ef27334
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mac/UHash32$L2Hash32.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mac/UHash32$L3Hash32.class b/libjava/classpath/lib/gnu/javax/crypto/mac/UHash32$L3Hash32.class
new file mode 100644
index 00000000000..8f721424fca
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mac/UHash32$L3Hash32.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mac/UHash32.class b/libjava/classpath/lib/gnu/javax/crypto/mac/UHash32.class
new file mode 100644
index 00000000000..afa01f824be
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mac/UHash32.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mac/UMac32.class b/libjava/classpath/lib/gnu/javax/crypto/mac/UMac32.class
new file mode 100644
index 00000000000..c0df13dc3a5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mac/UMac32.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mode/BaseMode.class b/libjava/classpath/lib/gnu/javax/crypto/mode/BaseMode.class
new file mode 100644
index 00000000000..f608e3f6363
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mode/BaseMode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mode/CBC.class b/libjava/classpath/lib/gnu/javax/crypto/mode/CBC.class
new file mode 100644
index 00000000000..631dd8f3a83
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mode/CBC.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mode/CFB.class b/libjava/classpath/lib/gnu/javax/crypto/mode/CFB.class
new file mode 100644
index 00000000000..df8c22fbd37
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mode/CFB.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mode/CTR.class b/libjava/classpath/lib/gnu/javax/crypto/mode/CTR.class
new file mode 100644
index 00000000000..471a2bdc029
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mode/CTR.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mode/EAX.class b/libjava/classpath/lib/gnu/javax/crypto/mode/EAX.class
new file mode 100644
index 00000000000..3bc66f205ea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mode/EAX.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mode/ECB.class b/libjava/classpath/lib/gnu/javax/crypto/mode/ECB.class
new file mode 100644
index 00000000000..cdd23851060
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mode/ECB.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mode/IAuthenticatedMode.class b/libjava/classpath/lib/gnu/javax/crypto/mode/IAuthenticatedMode.class
new file mode 100644
index 00000000000..c2778aca6b3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mode/IAuthenticatedMode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mode/ICM.class b/libjava/classpath/lib/gnu/javax/crypto/mode/ICM.class
new file mode 100644
index 00000000000..cbfff4b4f45
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mode/ICM.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mode/IMode.class b/libjava/classpath/lib/gnu/javax/crypto/mode/IMode.class
new file mode 100644
index 00000000000..fa3408e851d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mode/IMode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mode/ModeFactory.class b/libjava/classpath/lib/gnu/javax/crypto/mode/ModeFactory.class
new file mode 100644
index 00000000000..81f85823a7e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mode/ModeFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/mode/OFB.class b/libjava/classpath/lib/gnu/javax/crypto/mode/OFB.class
new file mode 100644
index 00000000000..faf5fa22f6c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/mode/OFB.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/pad/BasePad.class b/libjava/classpath/lib/gnu/javax/crypto/pad/BasePad.class
new file mode 100644
index 00000000000..8c8468361ff
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/pad/BasePad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/pad/IPad.class b/libjava/classpath/lib/gnu/javax/crypto/pad/IPad.class
new file mode 100644
index 00000000000..772670851cb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/pad/IPad.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/pad/ISO10126.class b/libjava/classpath/lib/gnu/javax/crypto/pad/ISO10126.class
new file mode 100644
index 00000000000..02c8a312efa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/pad/ISO10126.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/pad/PKCS1_V1_5.class b/libjava/classpath/lib/gnu/javax/crypto/pad/PKCS1_V1_5.class
new file mode 100644
index 00000000000..b7c141094f7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/pad/PKCS1_V1_5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/pad/PKCS7.class b/libjava/classpath/lib/gnu/javax/crypto/pad/PKCS7.class
new file mode 100644
index 00000000000..c47e354005e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/pad/PKCS7.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/pad/PadFactory.class b/libjava/classpath/lib/gnu/javax/crypto/pad/PadFactory.class
new file mode 100644
index 00000000000..d63a84395db
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/pad/PadFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/pad/SSL3.class b/libjava/classpath/lib/gnu/javax/crypto/pad/SSL3.class
new file mode 100644
index 00000000000..407a35c249a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/pad/SSL3.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/pad/TBC.class b/libjava/classpath/lib/gnu/javax/crypto/pad/TBC.class
new file mode 100644
index 00000000000..87fb7f43d67
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/pad/TBC.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/pad/TLS1.class b/libjava/classpath/lib/gnu/javax/crypto/pad/TLS1.class
new file mode 100644
index 00000000000..877195e7bb3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/pad/TLS1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/pad/WrongPaddingException.class b/libjava/classpath/lib/gnu/javax/crypto/pad/WrongPaddingException.class
new file mode 100644
index 00000000000..b733e14c5eb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/pad/WrongPaddingException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/prng/ARCFour.class b/libjava/classpath/lib/gnu/javax/crypto/prng/ARCFour.class
new file mode 100644
index 00000000000..35a40c04b53
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/prng/ARCFour.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG$1.class b/libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG$1.class
new file mode 100644
index 00000000000..c7592d24057
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG$Poller.class b/libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG$Poller.class
new file mode 100644
index 00000000000..ebb8e4a2d3a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG$Poller.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG$Spinner.class b/libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG$Spinner.class
new file mode 100644
index 00000000000..937382eab7c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG$Spinner.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG.class b/libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG.class
new file mode 100644
index 00000000000..537fe2f5fc7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/prng/CSPRNG.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/prng/Fortuna$Generator.class b/libjava/classpath/lib/gnu/javax/crypto/prng/Fortuna$Generator.class
new file mode 100644
index 00000000000..1b7c9283160
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/prng/Fortuna$Generator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/prng/Fortuna.class b/libjava/classpath/lib/gnu/javax/crypto/prng/Fortuna.class
new file mode 100644
index 00000000000..b74d5da8738
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/prng/Fortuna.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/prng/ICMGenerator.class b/libjava/classpath/lib/gnu/javax/crypto/prng/ICMGenerator.class
new file mode 100644
index 00000000000..9c38cdf1799
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/prng/ICMGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/prng/IPBE.class b/libjava/classpath/lib/gnu/javax/crypto/prng/IPBE.class
new file mode 100644
index 00000000000..6ddd98ad499
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/prng/IPBE.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/prng/PBKDF2.class b/libjava/classpath/lib/gnu/javax/crypto/prng/PBKDF2.class
new file mode 100644
index 00000000000..494e88a1ff4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/prng/PBKDF2.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/prng/PRNGFactory.class b/libjava/classpath/lib/gnu/javax/crypto/prng/PRNGFactory.class
new file mode 100644
index 00000000000..fda72a8a709
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/prng/PRNGFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/prng/UMacGenerator.class b/libjava/classpath/lib/gnu/javax/crypto/prng/UMacGenerator.class
new file mode 100644
index 00000000000..b82bbfbbfff
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/prng/UMacGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/AuthInfo.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/AuthInfo.class
new file mode 100644
index 00000000000..001a63e4e4d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/AuthInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/AuthInfoProviderFactory.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/AuthInfoProviderFactory.class
new file mode 100644
index 00000000000..91d180d1de8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/AuthInfoProviderFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/ClientFactory.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/ClientFactory.class
new file mode 100644
index 00000000000..02f22f692f5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/ClientFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/ClientMechanism.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/ClientMechanism.class
new file mode 100644
index 00000000000..ce05c73f4a1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/ClientMechanism.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/ConfidentialityException.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/ConfidentialityException.class
new file mode 100644
index 00000000000..a16f1efeb37
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/ConfidentialityException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/IAuthInfoProvider.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/IAuthInfoProvider.class
new file mode 100644
index 00000000000..26f9af2e8db
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/IAuthInfoProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/IAuthInfoProviderFactory.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/IAuthInfoProviderFactory.class
new file mode 100644
index 00000000000..0ece0848024
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/IAuthInfoProviderFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/IllegalMechanismStateException.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/IllegalMechanismStateException.class
new file mode 100644
index 00000000000..e4804d86707
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/IllegalMechanismStateException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/InputBuffer.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/InputBuffer.class
new file mode 100644
index 00000000000..25b4f11c5fa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/InputBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/IntegrityException.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/IntegrityException.class
new file mode 100644
index 00000000000..b8cbebd541e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/IntegrityException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/NoSuchMechanismException.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/NoSuchMechanismException.class
new file mode 100644
index 00000000000..5296788baaf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/NoSuchMechanismException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/NoSuchUserException.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/NoSuchUserException.class
new file mode 100644
index 00000000000..c6f042dc363
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/NoSuchUserException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/OutputBuffer.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/OutputBuffer.class
new file mode 100644
index 00000000000..f163d3c1265
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/OutputBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/SaslEncodingException.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/SaslEncodingException.class
new file mode 100644
index 00000000000..befd9ccb2f3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/SaslEncodingException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/SaslInputStream.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/SaslInputStream.class
new file mode 100644
index 00000000000..8672abc861a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/SaslInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/SaslOutputStream.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/SaslOutputStream.class
new file mode 100644
index 00000000000..06036018541
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/SaslOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/SaslUtil.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/SaslUtil.class
new file mode 100644
index 00000000000..8a4b0211405
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/SaslUtil.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/ServerFactory.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/ServerFactory.class
new file mode 100644
index 00000000000..a7eb9b4a2d9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/ServerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/ServerMechanism.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/ServerMechanism.class
new file mode 100644
index 00000000000..165e46a3f30
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/ServerMechanism.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/UserAlreadyExistsException.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/UserAlreadyExistsException.class
new file mode 100644
index 00000000000..48614ee35e9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/UserAlreadyExistsException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/anonymous/AnonymousClient.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/anonymous/AnonymousClient.class
new file mode 100644
index 00000000000..d455f55e268
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/anonymous/AnonymousClient.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/anonymous/AnonymousServer.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/anonymous/AnonymousServer.class
new file mode 100644
index 00000000000..6f7e3141bd3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/anonymous/AnonymousServer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/anonymous/AnonymousUtil.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/anonymous/AnonymousUtil.class
new file mode 100644
index 00000000000..266dd041e8f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/anonymous/AnonymousUtil.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5AuthInfoProvider.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5AuthInfoProvider.class
new file mode 100644
index 00000000000..ff24bb4a445
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5AuthInfoProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Client.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Client.class
new file mode 100644
index 00000000000..aa53a44ca72
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Client.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Registry.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Registry.class
new file mode 100644
index 00000000000..745e176636d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Registry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Server.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Server.class
new file mode 100644
index 00000000000..6c51063967b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Server.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Util.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Util.class
new file mode 100644
index 00000000000..ac4fc0bc8c4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/CramMD5Util.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/PasswordFile.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/PasswordFile.class
new file mode 100644
index 00000000000..51523b5a7a0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/crammd5/PasswordFile.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PasswordFile.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PasswordFile.class
new file mode 100644
index 00000000000..b7e4cc00b58
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PasswordFile.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainAuthInfoProvider.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainAuthInfoProvider.class
new file mode 100644
index 00000000000..f62e9f89c4e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainAuthInfoProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainClient.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainClient.class
new file mode 100644
index 00000000000..928a8694f14
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainClient.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainRegistry.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainRegistry.class
new file mode 100644
index 00000000000..aa70f14be44
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainRegistry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainServer.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainServer.class
new file mode 100644
index 00000000000..8a5f810b0f6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/plain/PlainServer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/CALG.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/CALG.class
new file mode 100644
index 00000000000..fdc5ffa02a0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/CALG.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/ClientStore.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/ClientStore.class
new file mode 100644
index 00000000000..9c800a17428
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/ClientStore.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/IALG.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/IALG.class
new file mode 100644
index 00000000000..0ed3d23f017
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/IALG.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/KDF.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/KDF.class
new file mode 100644
index 00000000000..178af34da69
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/KDF.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/PasswordFile.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/PasswordFile.class
new file mode 100644
index 00000000000..b92fe4f6dac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/PasswordFile.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRP.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRP.class
new file mode 100644
index 00000000000..76c863be696
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRP.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPAuthInfoProvider.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPAuthInfoProvider.class
new file mode 100644
index 00000000000..e5ec9572b53
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPAuthInfoProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPClient.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPClient.class
new file mode 100644
index 00000000000..e20ffb6333f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPClient.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPRegistry.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPRegistry.class
new file mode 100644
index 00000000000..4bf66fe9ffc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPRegistry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPServer.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPServer.class
new file mode 100644
index 00000000000..c81ddc2ec85
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SRPServer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SecurityContext.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SecurityContext.class
new file mode 100644
index 00000000000..3830ff959e3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/SecurityContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/ServerStore.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/ServerStore.class
new file mode 100644
index 00000000000..9757964c614
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/ServerStore.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/StoreEntry.class b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/StoreEntry.class
new file mode 100644
index 00000000000..97ed0be25ee
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/crypto/sasl/srp/StoreEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/IIOInputStream.class b/libjava/classpath/lib/gnu/javax/imageio/IIOInputStream.class
new file mode 100644
index 00000000000..6ae0df103d7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/IIOInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPDecoder.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPDecoder.class
new file mode 100644
index 00000000000..50b29cb530f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPDecoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPEncoder.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPEncoder.class
new file mode 100644
index 00000000000..efc1a6d6692
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPEncoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPException.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPException.class
new file mode 100644
index 00000000000..ad67b890440
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPFileHeader.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPFileHeader.class
new file mode 100644
index 00000000000..a7f09556c9c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPFileHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageReader.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageReader.class
new file mode 100644
index 00000000000..3a53ab1dd3b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageReaderSpi.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageReaderSpi.class
new file mode 100644
index 00000000000..edcfcda2bf4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageReaderSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageWriter.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageWriter.class
new file mode 100644
index 00000000000..23934b7a076
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageWriterSpi.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageWriterSpi.class
new file mode 100644
index 00000000000..d29770d6e16
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPImageWriterSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPInfoHeader.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPInfoHeader.class
new file mode 100644
index 00000000000..3088838a42c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/BMPInfoHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeBF16.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeBF16.class
new file mode 100644
index 00000000000..2f65103b73c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeBF16.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeBF32.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeBF32.class
new file mode 100644
index 00000000000..a49e61efe66
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeBF32.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB1.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB1.class
new file mode 100644
index 00000000000..6bd47877e5a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB24.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB24.class
new file mode 100644
index 00000000000..30db342f7f6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB24.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB4.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB4.class
new file mode 100644
index 00000000000..2723c69ddc8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB4.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB8.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB8.class
new file mode 100644
index 00000000000..280e069e117
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRGB8.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRLE4.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRLE4.class
new file mode 100644
index 00000000000..1fd12dde785
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRLE4.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRLE8.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRLE8.class
new file mode 100644
index 00000000000..3395c9dc940
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/DecodeRLE8.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB1.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB1.class
new file mode 100644
index 00000000000..645a36027a3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB16.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB16.class
new file mode 100644
index 00000000000..21fa35b8382
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB16.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB24.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB24.class
new file mode 100644
index 00000000000..aa42a130394
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB24.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB32.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB32.class
new file mode 100644
index 00000000000..fe373030d4f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB32.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB4.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB4.class
new file mode 100644
index 00000000000..eb279534f20
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB4.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB8.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB8.class
new file mode 100644
index 00000000000..8c0ca496473
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRGB8.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRLE4.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRLE4.class
new file mode 100644
index 00000000000..bfe8f87be2f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRLE4.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRLE8.class b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRLE8.class
new file mode 100644
index 00000000000..78d8bea4b8e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/bmp/EncodeRLE8.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/gif/GIFFile$GIFException.class b/libjava/classpath/lib/gnu/javax/imageio/gif/GIFFile$GIFException.class
new file mode 100644
index 00000000000..ea01c212780
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/gif/GIFFile$GIFException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/gif/GIFFile.class b/libjava/classpath/lib/gnu/javax/imageio/gif/GIFFile.class
new file mode 100644
index 00000000000..535f2062232
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/gif/GIFFile.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/gif/GIFImageReader.class b/libjava/classpath/lib/gnu/javax/imageio/gif/GIFImageReader.class
new file mode 100644
index 00000000000..28bc2583ca9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/gif/GIFImageReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/gif/GIFImageReaderSpi.class b/libjava/classpath/lib/gnu/javax/imageio/gif/GIFImageReaderSpi.class
new file mode 100644
index 00000000000..5db948a7d98
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/gif/GIFImageReaderSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/jpeg/DCT.class b/libjava/classpath/lib/gnu/javax/imageio/jpeg/DCT.class
new file mode 100644
index 00000000000..2108bde0dcb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/jpeg/DCT.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/jpeg/HuffmanTable.class b/libjava/classpath/lib/gnu/javax/imageio/jpeg/HuffmanTable.class
new file mode 100644
index 00000000000..fa94d71675d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/jpeg/HuffmanTable.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGComponent.class b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGComponent.class
new file mode 100644
index 00000000000..ca2e690e050
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGDecoder.class b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGDecoder.class
new file mode 100644
index 00000000000..f834155317a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGDecoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGException.class b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGException.class
new file mode 100644
index 00000000000..0ae6fd9a3fe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGFrame.class b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGFrame.class
new file mode 100644
index 00000000000..55349a9d929
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGFrame.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGImageInputStream.class b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGImageInputStream.class
new file mode 100644
index 00000000000..4dc722d41a9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGImageInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGImageReader.class b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGImageReader.class
new file mode 100644
index 00000000000..748767500ec
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGImageReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGImageReaderSpi.class b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGImageReaderSpi.class
new file mode 100644
index 00000000000..aaa0460dd50
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGImageReaderSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGMarker.class b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGMarker.class
new file mode 100644
index 00000000000..3d677aaf920
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGMarker.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGMarkerFoundException.class b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGMarkerFoundException.class
new file mode 100644
index 00000000000..aafc5c4d564
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGMarkerFoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGScan.class b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGScan.class
new file mode 100644
index 00000000000..19532a9c02f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/jpeg/JPEGScan.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/jpeg/YCbCr_ColorSpace.class b/libjava/classpath/lib/gnu/javax/imageio/jpeg/YCbCr_ColorSpace.class
new file mode 100644
index 00000000000..c773e197059
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/jpeg/YCbCr_ColorSpace.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/jpeg/ZigZag.class b/libjava/classpath/lib/gnu/javax/imageio/jpeg/ZigZag.class
new file mode 100644
index 00000000000..12c6a8952c3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/jpeg/ZigZag.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGChunk.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGChunk.class
new file mode 100644
index 00000000000..e5bd013ae00
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGChunk.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGData.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGData.class
new file mode 100644
index 00000000000..5186febbb4f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGData.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGDecoder.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGDecoder.class
new file mode 100644
index 00000000000..ab6c3034e93
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGDecoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGEncoder.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGEncoder.class
new file mode 100644
index 00000000000..6712c7ecacf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGEncoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGException.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGException.class
new file mode 100644
index 00000000000..8db2224ce69
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGFile.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGFile.class
new file mode 100644
index 00000000000..85f16e07f3c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGFile.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGFilter.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGFilter.class
new file mode 100644
index 00000000000..b419b9ba2cd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGGamma.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGGamma.class
new file mode 100644
index 00000000000..a806c42419c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGGamma.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGHeader.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGHeader.class
new file mode 100644
index 00000000000..7cfb2b44886
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGICCProfile.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGICCProfile.class
new file mode 100644
index 00000000000..ea403864db7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGICCProfile.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGImageReader.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGImageReader.class
new file mode 100644
index 00000000000..250520747c8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGImageReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGImageReaderSpi.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGImageReaderSpi.class
new file mode 100644
index 00000000000..ac1c7e79645
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGImageReaderSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGPalette.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGPalette.class
new file mode 100644
index 00000000000..b553c2ff0fa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGPalette.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGPhys.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGPhys.class
new file mode 100644
index 00000000000..483336b8e60
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGPhys.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/imageio/png/PNGTime.class b/libjava/classpath/lib/gnu/javax/imageio/png/PNGTime.class
new file mode 100644
index 00000000000..d8c2799cb70
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/imageio/png/PNGTime.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/management/Server$ServerInfo.class b/libjava/classpath/lib/gnu/javax/management/Server$ServerInfo.class
new file mode 100644
index 00000000000..644d5a40574
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/management/Server$ServerInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/management/Server$ServerInputStream.class b/libjava/classpath/lib/gnu/javax/management/Server$ServerInputStream.class
new file mode 100644
index 00000000000..536ac420c81
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/management/Server$ServerInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/management/Server$ServerNotificationListener.class b/libjava/classpath/lib/gnu/javax/management/Server$ServerNotificationListener.class
new file mode 100644
index 00000000000..769500cada3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/management/Server$ServerNotificationListener.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/management/Server.class b/libjava/classpath/lib/gnu/javax/management/Server.class
new file mode 100644
index 00000000000..54552f00585
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/management/Server.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/giop/ContextContinuation.class b/libjava/classpath/lib/gnu/javax/naming/giop/ContextContinuation.class
new file mode 100644
index 00000000000..4a60d0b0e71
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/giop/ContextContinuation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/giop/CorbalocParser.class b/libjava/classpath/lib/gnu/javax/naming/giop/CorbalocParser.class
new file mode 100644
index 00000000000..e31b24f799f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/giop/CorbalocParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingEnumeration.class b/libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingEnumeration.class
new file mode 100644
index 00000000000..1936b365ecc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingServiceFactory$1.class b/libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingServiceFactory$1.class
new file mode 100644
index 00000000000..71206978915
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingServiceFactory$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingServiceFactory.class b/libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingServiceFactory.class
new file mode 100644
index 00000000000..249ecb29f3a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingServiceFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingServiceURLContext.class b/libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingServiceURLContext.class
new file mode 100644
index 00000000000..c06abb85ec6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/giop/GiopNamingServiceURLContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/giop/ListBindingsEnumeration.class b/libjava/classpath/lib/gnu/javax/naming/giop/ListBindingsEnumeration.class
new file mode 100644
index 00000000000..e668e217069
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/giop/ListBindingsEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/giop/ListEnumeration.class b/libjava/classpath/lib/gnu/javax/naming/giop/ListEnumeration.class
new file mode 100644
index 00000000000..0232cc693f8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/giop/ListEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/ictxImpl/trans/GnuName$GnuNameEnum.class b/libjava/classpath/lib/gnu/javax/naming/ictxImpl/trans/GnuName$GnuNameEnum.class
new file mode 100644
index 00000000000..778e0419661
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/ictxImpl/trans/GnuName$GnuNameEnum.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/ictxImpl/trans/GnuName.class b/libjava/classpath/lib/gnu/javax/naming/ictxImpl/trans/GnuName.class
new file mode 100644
index 00000000000..23f9833499e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/ictxImpl/trans/GnuName.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/jndi/url/corbaname/corbanameURLContextFactory.class b/libjava/classpath/lib/gnu/javax/naming/jndi/url/corbaname/corbanameURLContextFactory.class
new file mode 100644
index 00000000000..8f94219ca9e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/jndi/url/corbaname/corbanameURLContextFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/ContextContinuation.class b/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/ContextContinuation.class
new file mode 100644
index 00000000000..c12490e32cb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/ContextContinuation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/ListBindingsEnumeration.class b/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/ListBindingsEnumeration.class
new file mode 100644
index 00000000000..cf7b508fc97
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/ListBindingsEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/ListEnumeration.class b/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/ListEnumeration.class
new file mode 100644
index 00000000000..ebe526a4f1a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/ListEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/RmiContinuation.class b/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/RmiContinuation.class
new file mode 100644
index 00000000000..f8b6df6dd28
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/RmiContinuation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/RmiNamingEnumeration.class b/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/RmiNamingEnumeration.class
new file mode 100644
index 00000000000..a16cb51ea63
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/RmiNamingEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/rmiURLContext.class b/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/rmiURLContext.class
new file mode 100644
index 00000000000..b9a5f28385a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/rmiURLContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/rmiURLContextFactory.class b/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/rmiURLContextFactory.class
new file mode 100644
index 00000000000..86da48cb36b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/naming/jndi/url/rmi/rmiURLContextFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/AbstractSessionContext.class b/libjava/classpath/lib/gnu/javax/net/ssl/AbstractSessionContext.class
new file mode 100644
index 00000000000..e6beaf07062
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/AbstractSessionContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/Base64.class b/libjava/classpath/lib/gnu/javax/net/ssl/Base64.class
new file mode 100644
index 00000000000..dbbea5b430b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/Base64.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/EntropySource.class b/libjava/classpath/lib/gnu/javax/net/ssl/EntropySource.class
new file mode 100644
index 00000000000..cb6337a8192
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/EntropySource.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/NullManagerParameters.class b/libjava/classpath/lib/gnu/javax/net/ssl/NullManagerParameters.class
new file mode 100644
index 00000000000..5c66d4bde0e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/NullManagerParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/PreSharedKeyManager.class b/libjava/classpath/lib/gnu/javax/net/ssl/PreSharedKeyManager.class
new file mode 100644
index 00000000000..9dabfbe3f67
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/PreSharedKeyManager.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/PreSharedKeyManagerParameters.class b/libjava/classpath/lib/gnu/javax/net/ssl/PreSharedKeyManagerParameters.class
new file mode 100644
index 00000000000..8b6418e6601
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/PreSharedKeyManagerParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/PrivateCredentials.class b/libjava/classpath/lib/gnu/javax/net/ssl/PrivateCredentials.class
new file mode 100644
index 00000000000..78dc1ff30be
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/PrivateCredentials.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/SRPManagerParameters.class b/libjava/classpath/lib/gnu/javax/net/ssl/SRPManagerParameters.class
new file mode 100644
index 00000000000..f51aab7a1c7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/SRPManagerParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/SRPTrustManager.class b/libjava/classpath/lib/gnu/javax/net/ssl/SRPTrustManager.class
new file mode 100644
index 00000000000..74bbe0727a2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/SRPTrustManager.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/SSLCipherSuite.class b/libjava/classpath/lib/gnu/javax/net/ssl/SSLCipherSuite.class
new file mode 100644
index 00000000000..557e437300a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/SSLCipherSuite.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/SSLProtocolVersion.class b/libjava/classpath/lib/gnu/javax/net/ssl/SSLProtocolVersion.class
new file mode 100644
index 00000000000..e36144967ae
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/SSLProtocolVersion.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/SSLRecordHandler.class b/libjava/classpath/lib/gnu/javax/net/ssl/SSLRecordHandler.class
new file mode 100644
index 00000000000..5c399712b0e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/SSLRecordHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/Session$ID.class b/libjava/classpath/lib/gnu/javax/net/ssl/Session$ID.class
new file mode 100644
index 00000000000..e9803984522
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/Session$ID.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/Session.class b/libjava/classpath/lib/gnu/javax/net/ssl/Session.class
new file mode 100644
index 00000000000..fce5c3c40d8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/Session.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/SessionStoreException.class b/libjava/classpath/lib/gnu/javax/net/ssl/SessionStoreException.class
new file mode 100644
index 00000000000..71de739a91f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/SessionStoreException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/StaticTrustAnchors.class b/libjava/classpath/lib/gnu/javax/net/ssl/StaticTrustAnchors.class
new file mode 100644
index 00000000000..50b76a7c281
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/StaticTrustAnchors.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$1.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$1.class
new file mode 100644
index 00000000000..9e6a7d2ed6a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$CertVerifier.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$CertVerifier.class
new file mode 100644
index 00000000000..1b68307eaaf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$CertVerifier.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$DHE_PSKGen.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$DHE_PSKGen.class
new file mode 100644
index 00000000000..d7c38ec5de5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$DHE_PSKGen.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$DHPhase.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$DHPhase.class
new file mode 100644
index 00000000000..2225d7d0afc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake$DHPhase.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake.class
new file mode 100644
index 00000000000..063f2b20c95
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/AbstractHandshake.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Alert$Description.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Alert$Description.class
new file mode 100644
index 00000000000..c8403e8ad84
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Alert$Description.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Alert$Level.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Alert$Level.class
new file mode 100644
index 00000000000..6cdbb324e23
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Alert$Level.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Alert.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Alert.class
new file mode 100644
index 00000000000..56c061916c7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Alert.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/AlertException.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/AlertException.class
new file mode 100644
index 00000000000..153a8a2ad3f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/AlertException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Builder.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Builder.class
new file mode 100644
index 00000000000..71007f5b809
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Builder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Certificate.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Certificate.class
new file mode 100644
index 00000000000..46876c90421
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Certificate.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateBuilder.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateBuilder.class
new file mode 100644
index 00000000000..486ab65f8a0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateRequest$ClientCertificateType.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateRequest$ClientCertificateType.class
new file mode 100644
index 00000000000..29a529cd786
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateRequest$ClientCertificateType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateRequest.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateRequest.class
new file mode 100644
index 00000000000..9423b74f6bf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateRequestBuilder.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateRequestBuilder.class
new file mode 100644
index 00000000000..55e36481f6d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateRequestBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateStatusRequest$ResponderIdIterator.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateStatusRequest$ResponderIdIterator.class
new file mode 100644
index 00000000000..a5b971d5bea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateStatusRequest$ResponderIdIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateStatusRequest.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateStatusRequest.class
new file mode 100644
index 00000000000..51fd52164db
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateStatusRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateStatusType.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateStatusType.class
new file mode 100644
index 00000000000..ab5d495b94d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateStatusType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateType.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateType.class
new file mode 100644
index 00000000000..3f39d010ab4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL$CertChainType.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL$CertChainType.class
new file mode 100644
index 00000000000..a91b0f736d4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL$CertChainType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL$Iterator.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL$Iterator.class
new file mode 100644
index 00000000000..5d6bd64d77b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL$Iterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL$URLAndOptionalHash.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL$URLAndOptionalHash.class
new file mode 100644
index 00000000000..977b86b34ea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL$URLAndOptionalHash.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL.class
new file mode 100644
index 00000000000..93c03fc4d6b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateURL.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateVerify.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateVerify.class
new file mode 100644
index 00000000000..256517cc4f6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CertificateVerify.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherAlgorithm.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherAlgorithm.class
new file mode 100644
index 00000000000..8d24f3a7cf8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherAlgorithm.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherSuite.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherSuite.class
new file mode 100644
index 00000000000..4f6e02f755f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherSuite.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherSuiteList$Iterator.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherSuiteList$Iterator.class
new file mode 100644
index 00000000000..860010af4e9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherSuiteList$Iterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherSuiteList.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherSuiteList.class
new file mode 100644
index 00000000000..d3e12e18dd7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CipherSuiteList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientCertificateTypeList$Iterator.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientCertificateTypeList$Iterator.class
new file mode 100644
index 00000000000..5aa251ed7f3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientCertificateTypeList$Iterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientCertificateTypeList.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientCertificateTypeList.class
new file mode 100644
index 00000000000..5c4c4e4cfba
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientCertificateTypeList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientDHE_PSKParameters.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientDHE_PSKParameters.class
new file mode 100644
index 00000000000..5279e3b19b1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientDHE_PSKParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientDiffieHellmanPublic.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientDiffieHellmanPublic.class
new file mode 100644
index 00000000000..eb619058318
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientDiffieHellmanPublic.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$CertLoader.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$CertLoader.class
new file mode 100644
index 00000000000..615693f3a14
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$CertLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$ClientDHGen.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$ClientDHGen.class
new file mode 100644
index 00000000000..1e1a5c222b7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$ClientDHGen.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$GenCertVerify.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$GenCertVerify.class
new file mode 100644
index 00000000000..51a1a2b9508
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$GenCertVerify.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$ParamsVerifier.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$ParamsVerifier.class
new file mode 100644
index 00000000000..ae8f45ed816
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$ParamsVerifier.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$RSAGen.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$RSAGen.class
new file mode 100644
index 00000000000..c7a8f8760db
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$RSAGen.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$State.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$State.class
new file mode 100644
index 00000000000..abdc3cc54d3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake$State.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake.class
new file mode 100644
index 00000000000..a8a202eb6d7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHandshake.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHello.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHello.class
new file mode 100644
index 00000000000..7e903493d27
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHello.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHelloBuilder.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHelloBuilder.class
new file mode 100644
index 00000000000..63b37365316
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHelloBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHelloV2.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHelloV2.class
new file mode 100644
index 00000000000..82fb99371c5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientHelloV2.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientKeyExchange.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientKeyExchange.class
new file mode 100644
index 00000000000..13b5f4fbf91
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientKeyExchange.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientKeyExchangeBuilder.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientKeyExchangeBuilder.class
new file mode 100644
index 00000000000..a18851baca4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientKeyExchangeBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientPSKParameters.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientPSKParameters.class
new file mode 100644
index 00000000000..43c99e03767
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientPSKParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientRSA_PSKParameters.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientRSA_PSKParameters.class
new file mode 100644
index 00000000000..776eb4a1898
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ClientRSA_PSKParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CompressionMethod.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CompressionMethod.class
new file mode 100644
index 00000000000..83819e2cf18
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CompressionMethod.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CompressionMethodList$Iterator.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CompressionMethodList$Iterator.class
new file mode 100644
index 00000000000..2b144ae754e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CompressionMethodList$Iterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/CompressionMethodList.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CompressionMethodList.class
new file mode 100644
index 00000000000..a686a9d929e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/CompressionMethodList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Constructed.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Constructed.class
new file mode 100644
index 00000000000..ab4fbda2eac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Constructed.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ContentType.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ContentType.class
new file mode 100644
index 00000000000..b4d148a45d5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ContentType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Debug.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Debug.class
new file mode 100644
index 00000000000..cd47c506ed9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Debug.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/DelegatedTask.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/DelegatedTask.class
new file mode 100644
index 00000000000..8523bdd1065
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/DelegatedTask.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/DiffieHellman.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/DiffieHellman.class
new file mode 100644
index 00000000000..587b65abcdd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/DiffieHellman.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/EmptyExchangeKeys.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/EmptyExchangeKeys.class
new file mode 100644
index 00000000000..5796f8b3ed4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/EmptyExchangeKeys.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/EncryptedPreMasterSecret.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/EncryptedPreMasterSecret.class
new file mode 100644
index 00000000000..381d8668168
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/EncryptedPreMasterSecret.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ExchangeKeys.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ExchangeKeys.class
new file mode 100644
index 00000000000..6fe3431abe3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ExchangeKeys.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Extension$Type.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Extension$Type.class
new file mode 100644
index 00000000000..6bd8fd9be7b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Extension$Type.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Extension$Value.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Extension$Value.class
new file mode 100644
index 00000000000..b3a089e811d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Extension$Value.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Extension.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Extension.class
new file mode 100644
index 00000000000..aa43c5df3f9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Extension.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ExtensionList$ExtensionsIterator.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ExtensionList$ExtensionsIterator.class
new file mode 100644
index 00000000000..1192103f452
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ExtensionList$ExtensionsIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ExtensionList.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ExtensionList.class
new file mode 100644
index 00000000000..b63f29142c0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ExtensionList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Finished.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Finished.class
new file mode 100644
index 00000000000..50e67a23569
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Finished.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Handshake$Body.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Handshake$Body.class
new file mode 100644
index 00000000000..5cbbf3d53f2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Handshake$Body.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Handshake$Type.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Handshake$Type.class
new file mode 100644
index 00000000000..fb1af75e5a2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Handshake$Type.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Handshake.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Handshake.class
new file mode 100644
index 00000000000..85412abbdfa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Handshake.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/HelloRequest.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/HelloRequest.class
new file mode 100644
index 00000000000..4fd04289230
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/HelloRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/InputSecurityParameters.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/InputSecurityParameters.class
new file mode 100644
index 00000000000..ff278f3e56f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/InputSecurityParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Jessie$1.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Jessie$1.class
new file mode 100644
index 00000000000..fdd87231b07
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Jessie$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Jessie.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Jessie.class
new file mode 100644
index 00000000000..fb217bec666
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Jessie.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/KeyExchangeAlgorithm.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/KeyExchangeAlgorithm.class
new file mode 100644
index 00000000000..2e494b6c44b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/KeyExchangeAlgorithm.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/MacAlgorithm.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/MacAlgorithm.class
new file mode 100644
index 00000000000..8dda1d5af3a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/MacAlgorithm.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/MacException.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/MacException.class
new file mode 100644
index 00000000000..aa3f3e4595a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/MacException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/MaxFragmentLength.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/MaxFragmentLength.class
new file mode 100644
index 00000000000..b9341fadb7b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/MaxFragmentLength.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/OutputSecurityParameters.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/OutputSecurityParameters.class
new file mode 100644
index 00000000000..c36422821d7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/OutputSecurityParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/PreSharedKeyManagerFactoryImpl$Manager.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/PreSharedKeyManagerFactoryImpl$Manager.class
new file mode 100644
index 00000000000..6068aed38f0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/PreSharedKeyManagerFactoryImpl$Manager.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/PreSharedKeyManagerFactoryImpl.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/PreSharedKeyManagerFactoryImpl.class
new file mode 100644
index 00000000000..876fc6da638
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/PreSharedKeyManagerFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ProtocolVersion.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ProtocolVersion.class
new file mode 100644
index 00000000000..e1943659012
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ProtocolVersion.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Random.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Random.class
new file mode 100644
index 00000000000..dca9cec7425
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Random.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Record.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Record.class
new file mode 100644
index 00000000000..82c3db5b089
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Record.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SRPTrustManagerFactory$Manager.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SRPTrustManagerFactory$Manager.class
new file mode 100644
index 00000000000..94c704bde66
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SRPTrustManagerFactory$Manager.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SRPTrustManagerFactory.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SRPTrustManagerFactory.class
new file mode 100644
index 00000000000..5a6957bfaf1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SRPTrustManagerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLContextImpl.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLContextImpl.class
new file mode 100644
index 00000000000..7f3a8f7d9cb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLContextImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLEngineImpl$Mode.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLEngineImpl$Mode.class
new file mode 100644
index 00000000000..5a21dae612b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLEngineImpl$Mode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLEngineImpl.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLEngineImpl.class
new file mode 100644
index 00000000000..1080d19c129
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLEngineImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLHMac.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLHMac.class
new file mode 100644
index 00000000000..e59baf6a675
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLHMac.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLRSASignatureImpl.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLRSASignatureImpl.class
new file mode 100644
index 00000000000..c080983e716
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLRSASignatureImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLRandom.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLRandom.class
new file mode 100644
index 00000000000..05a9336d9e2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLRandom.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLServerSocketFactoryImpl.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLServerSocketFactoryImpl.class
new file mode 100644
index 00000000000..b6353ffeb89
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLServerSocketFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLServerSocketImpl.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLServerSocketImpl.class
new file mode 100644
index 00000000000..b9373981308
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLServerSocketImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.class
new file mode 100644
index 00000000000..de053ac51df
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl$1.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl$1.class
new file mode 100644
index 00000000000..ffeeabd64c7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl$SocketInputStream.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl$SocketInputStream.class
new file mode 100644
index 00000000000..807805ca940
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl$SocketInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl$SocketOutputStream.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl$SocketOutputStream.class
new file mode 100644
index 00000000000..0df84a5fc22
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl$SocketOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl.class
new file mode 100644
index 00000000000..8c53151598d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLv3HMacMD5Impl.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLv3HMacMD5Impl.class
new file mode 100644
index 00000000000..31c271c9dd2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLv3HMacMD5Impl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLv3HMacSHAImpl.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLv3HMacSHAImpl.class
new file mode 100644
index 00000000000..adbeaacb05d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLv3HMacSHAImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerDHE_PSKParameters.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerDHE_PSKParameters.class
new file mode 100644
index 00000000000..d8f64b27a95
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerDHE_PSKParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerDHParams.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerDHParams.class
new file mode 100644
index 00000000000..4633e65b471
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerDHParams.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$CertLoader.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$CertLoader.class
new file mode 100644
index 00000000000..c1c3bd9a649
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$CertLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$GenDH.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$GenDH.class
new file mode 100644
index 00000000000..1c50e6e1a7d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$GenDH.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$RSAKeyExchange.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$RSAKeyExchange.class
new file mode 100644
index 00000000000..8f3bc829b19
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$RSAKeyExchange.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$RSA_PSKExchange.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$RSA_PSKExchange.class
new file mode 100644
index 00000000000..e5a8be7b4f7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$RSA_PSKExchange.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$State.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$State.class
new file mode 100644
index 00000000000..120d8119b5a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake$State.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake.class
new file mode 100644
index 00000000000..092029d2bb5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHandshake.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHello.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHello.class
new file mode 100644
index 00000000000..5f4bafbbe2a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHello.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHelloBuilder.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHelloBuilder.class
new file mode 100644
index 00000000000..d46e850802e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHelloBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHelloDone.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHelloDone.class
new file mode 100644
index 00000000000..8dfb2607528
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerHelloDone.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerKeyExchange.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerKeyExchange.class
new file mode 100644
index 00000000000..ec0a6ae4550
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerKeyExchange.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerKeyExchangeBuilder.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerKeyExchangeBuilder.class
new file mode 100644
index 00000000000..691f08ac949
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerKeyExchangeBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerKeyExchangeParams.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerKeyExchangeParams.class
new file mode 100644
index 00000000000..dfd4e75c4ae
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerKeyExchangeParams.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList$Iterator.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList$Iterator.class
new file mode 100644
index 00000000000..67f8df47ff1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList$Iterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList$NameType.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList$NameType.class
new file mode 100644
index 00000000000..2fbaf341fd8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList$NameType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList$ServerName.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList$ServerName.class
new file mode 100644
index 00000000000..14aa39f6a51
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList$ServerName.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList.class
new file mode 100644
index 00000000000..feed520b9f4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerNameList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerPSKParameters.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerPSKParameters.class
new file mode 100644
index 00000000000..fe9d7142e43
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerPSKParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerRSAParams.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerRSAParams.class
new file mode 100644
index 00000000000..e3e1b90569f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerRSAParams.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerRSA_PSKParameters.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerRSA_PSKParameters.class
new file mode 100644
index 00000000000..d68e2476d21
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/ServerRSA_PSKParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SessionImpl$PrivateData.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SessionImpl$PrivateData.class
new file mode 100644
index 00000000000..d938211ac99
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SessionImpl$PrivateData.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SessionImpl.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SessionImpl.class
new file mode 100644
index 00000000000..106f9ce1276
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SessionImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Signature.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Signature.class
new file mode 100644
index 00000000000..31d3f3d650e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Signature.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SignatureAlgorithm.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SignatureAlgorithm.class
new file mode 100644
index 00000000000..4cc244b3209
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SignatureAlgorithm.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SimpleSessionContext$1.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SimpleSessionContext$1.class
new file mode 100644
index 00000000000..5e48767d17c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SimpleSessionContext$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/SimpleSessionContext.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SimpleSessionContext.class
new file mode 100644
index 00000000000..6dfd010008c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/SimpleSessionContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/TLSHMac.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/TLSHMac.class
new file mode 100644
index 00000000000..22ce76a9f51
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/TLSHMac.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/TLSRandom.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/TLSRandom.class
new file mode 100644
index 00000000000..3e14e8a55e0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/TLSRandom.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/TruncatedHMAC.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/TruncatedHMAC.class
new file mode 100644
index 00000000000..c270beb33e7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/TruncatedHMAC.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities$AuthoritiesIterator.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities$AuthoritiesIterator.class
new file mode 100644
index 00000000000..aee80a9fbb5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities$AuthoritiesIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities$IdentifierType.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities$IdentifierType.class
new file mode 100644
index 00000000000..92955986e98
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities$IdentifierType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities$TrustedAuthority.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities$TrustedAuthority.class
new file mode 100644
index 00000000000..da386d6d1e6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities$TrustedAuthority.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities.class
new file mode 100644
index 00000000000..6fb51677d16
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/TrustedAuthorities.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/UnresolvedExtensionValue.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/UnresolvedExtensionValue.class
new file mode 100644
index 00000000000..e1fe208606f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/UnresolvedExtensionValue.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Util$1.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Util$1.class
new file mode 100644
index 00000000000..7c58dce94c3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Util$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Util$2.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Util$2.class
new file mode 100644
index 00000000000..e85173e938c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Util$2.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Util$WrappedBuffer.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Util$WrappedBuffer.class
new file mode 100644
index 00000000000..663d50bcb4d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Util$WrappedBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/Util.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Util.class
new file mode 100644
index 00000000000..f6142e3c45b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/Util.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/X500PrincipalList$Iterator.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/X500PrincipalList$Iterator.class
new file mode 100644
index 00000000000..e5fa0f04f5d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/X500PrincipalList$Iterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/X500PrincipalList.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/X500PrincipalList.class
new file mode 100644
index 00000000000..5e7b6e997de
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/X500PrincipalList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/X509KeyManagerFactory$Manager.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/X509KeyManagerFactory$Manager.class
new file mode 100644
index 00000000000..a8676d628b6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/X509KeyManagerFactory$Manager.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/X509KeyManagerFactory.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/X509KeyManagerFactory.class
new file mode 100644
index 00000000000..5a45271700a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/X509KeyManagerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/X509TrustManagerFactory$Manager.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/X509TrustManagerFactory$Manager.class
new file mode 100644
index 00000000000..fcbf57006a7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/X509TrustManagerFactory$Manager.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/net/ssl/provider/X509TrustManagerFactory.class b/libjava/classpath/lib/gnu/javax/net/ssl/provider/X509TrustManagerFactory.class
new file mode 100644
index 00000000000..dda2c145703
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/net/ssl/provider/X509TrustManagerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/CupsIppOperation.class b/libjava/classpath/lib/gnu/javax/print/CupsIppOperation.class
new file mode 100644
index 00000000000..35b2608e33b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/CupsIppOperation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/CupsMediaMapping.class b/libjava/classpath/lib/gnu/javax/print/CupsMediaMapping.class
new file mode 100644
index 00000000000..27cbc7cbc00
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/CupsMediaMapping.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/CupsPrintService.class b/libjava/classpath/lib/gnu/javax/print/CupsPrintService.class
new file mode 100644
index 00000000000..2598d34eac3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/CupsPrintService.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/CupsPrintServiceLookup.class b/libjava/classpath/lib/gnu/javax/print/CupsPrintServiceLookup.class
new file mode 100644
index 00000000000..5d5abd5448e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/CupsPrintServiceLookup.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/CupsServer.class b/libjava/classpath/lib/gnu/javax/print/CupsServer.class
new file mode 100644
index 00000000000..06f6c23bbc0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/CupsServer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrintAttributeException.class b/libjava/classpath/lib/gnu/javax/print/PrintAttributeException.class
new file mode 100644
index 00000000000..fb2f527a642
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrintAttributeException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrintFlavorException.class b/libjava/classpath/lib/gnu/javax/print/PrintFlavorException.class
new file mode 100644
index 00000000000..ace70f38fe1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrintFlavorException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrintUriException.class b/libjava/classpath/lib/gnu/javax/print/PrintUriException.class
new file mode 100644
index 00000000000..efc7ebebaf8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrintUriException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$Color.class b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$Color.class
new file mode 100644
index 00000000000..7c22d8e52f0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$Color.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$JobAttributes.class b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$JobAttributes.class
new file mode 100644
index 00000000000..f94ab1c46aa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$JobAttributes.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$Quality.class b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$Quality.class
new file mode 100644
index 00000000000..f1d54d08a09
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$Quality.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$SidesPanel.class b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$SidesPanel.class
new file mode 100644
index 00000000000..364154fcbb8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel$SidesPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel.class b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel.class
new file mode 100644
index 00000000000..d1624662a83
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$AppearancePanel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel$CopiesAndSorted.class b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel$CopiesAndSorted.class
new file mode 100644
index 00000000000..6dce1bf64c8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel$CopiesAndSorted.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel$PrintRange.class b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel$PrintRange.class
new file mode 100644
index 00000000000..b2bfa93a1eb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel$PrintRange.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel$PrintServices.class b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel$PrintServices.class
new file mode 100644
index 00000000000..c187f142352
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel$PrintServices.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel.class b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel.class
new file mode 100644
index 00000000000..6ae6977ffeb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$GeneralPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel$Margins.class b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel$Margins.class
new file mode 100644
index 00000000000..e39037012ac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel$Margins.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel$MediaTypes.class b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel$MediaTypes.class
new file mode 100644
index 00000000000..8b96fcd6ecf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel$MediaTypes.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel$Orientation.class b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel$Orientation.class
new file mode 100644
index 00000000000..36419521ae5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel$Orientation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel.class b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel.class
new file mode 100644
index 00000000000..73df9933a5f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrinterDialog$PageSetupPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/PrinterDialog.class b/libjava/classpath/lib/gnu/javax/print/PrinterDialog.class
new file mode 100644
index 00000000000..9fc4db1730d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/PrinterDialog.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/DocPrintJobImpl.class b/libjava/classpath/lib/gnu/javax/print/ipp/DocPrintJobImpl.class
new file mode 100644
index 00000000000..07ffdabc27d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/DocPrintJobImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/IppDelimiterTag.class b/libjava/classpath/lib/gnu/javax/print/ipp/IppDelimiterTag.class
new file mode 100644
index 00000000000..13792445694
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/IppDelimiterTag.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/IppException.class b/libjava/classpath/lib/gnu/javax/print/ipp/IppException.class
new file mode 100644
index 00000000000..a7f5c0345b5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/IppException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/IppMultiDocPrintService.class b/libjava/classpath/lib/gnu/javax/print/ipp/IppMultiDocPrintService.class
new file mode 100644
index 00000000000..cf6f34e6bf4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/IppMultiDocPrintService.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/IppPrintService.class b/libjava/classpath/lib/gnu/javax/print/ipp/IppPrintService.class
new file mode 100644
index 00000000000..ebaf409b67d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/IppPrintService.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/IppRequest$RequestWriter.class b/libjava/classpath/lib/gnu/javax/print/ipp/IppRequest$RequestWriter.class
new file mode 100644
index 00000000000..ef631bbc2e2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/IppRequest$RequestWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/IppRequest.class b/libjava/classpath/lib/gnu/javax/print/ipp/IppRequest.class
new file mode 100644
index 00000000000..aadef6cb135
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/IppRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/IppResponse$ResponseReader.class b/libjava/classpath/lib/gnu/javax/print/ipp/IppResponse$ResponseReader.class
new file mode 100644
index 00000000000..a6d3829f4c4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/IppResponse$ResponseReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/IppResponse.class b/libjava/classpath/lib/gnu/javax/print/ipp/IppResponse.class
new file mode 100644
index 00000000000..0653dc80c97
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/IppResponse.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/IppStatusCode.class b/libjava/classpath/lib/gnu/javax/print/ipp/IppStatusCode.class
new file mode 100644
index 00000000000..16ecc7b8b2a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/IppStatusCode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/IppUtilities.class b/libjava/classpath/lib/gnu/javax/print/ipp/IppUtilities.class
new file mode 100644
index 00000000000..a98c3c3f2ef
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/IppUtilities.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/IppValueTag.class b/libjava/classpath/lib/gnu/javax/print/ipp/IppValueTag.class
new file mode 100644
index 00000000000..75b174fb8d0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/IppValueTag.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/MultiDocPrintJobImpl.class b/libjava/classpath/lib/gnu/javax/print/ipp/MultiDocPrintJobImpl.class
new file mode 100644
index 00000000000..4414b6260b6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/MultiDocPrintJobImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/CharsetSyntax.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/CharsetSyntax.class
new file mode 100644
index 00000000000..bda6259ed1a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/CharsetSyntax.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/DefaultValueAttribute.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/DefaultValueAttribute.class
new file mode 100644
index 00000000000..57279beda55
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/DefaultValueAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/DetailedStatusMessage.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/DetailedStatusMessage.class
new file mode 100644
index 00000000000..a673700138b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/DetailedStatusMessage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/DocumentAccessError.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/DocumentAccessError.class
new file mode 100644
index 00000000000..810d80dfde7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/DocumentAccessError.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/NaturalLanguageSyntax.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/NaturalLanguageSyntax.class
new file mode 100644
index 00000000000..48b83e74607
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/NaturalLanguageSyntax.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/RequestedAttributes.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/RequestedAttributes.class
new file mode 100644
index 00000000000..ce51861aabd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/RequestedAttributes.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/StatusMessage.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/StatusMessage.class
new file mode 100644
index 00000000000..529bf4eebd0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/StatusMessage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/UnknownAttribute.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/UnknownAttribute.class
new file mode 100644
index 00000000000..61158195de3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/UnknownAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/CopiesDefault.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/CopiesDefault.class
new file mode 100644
index 00000000000..70d93f6022e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/CopiesDefault.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/DocumentFormatDefault.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/DocumentFormatDefault.class
new file mode 100644
index 00000000000..fd452d080ea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/DocumentFormatDefault.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/FinishingsDefault.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/FinishingsDefault.class
new file mode 100644
index 00000000000..31904750b1d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/FinishingsDefault.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/JobHoldUntilDefault.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/JobHoldUntilDefault.class
new file mode 100644
index 00000000000..4c24ab0bae4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/JobHoldUntilDefault.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/JobPriorityDefault.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/JobPriorityDefault.class
new file mode 100644
index 00000000000..5a5542fb612
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/JobPriorityDefault.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/JobSheetsDefault.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/JobSheetsDefault.class
new file mode 100644
index 00000000000..175d9df5ed9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/JobSheetsDefault.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/MediaDefault.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/MediaDefault.class
new file mode 100644
index 00000000000..1b569744f37
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/MediaDefault.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/MultipleDocumentHandlingDefault.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/MultipleDocumentHandlingDefault.class
new file mode 100644
index 00000000000..b0aaf09781a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/MultipleDocumentHandlingDefault.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/NumberUpDefault.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/NumberUpDefault.class
new file mode 100644
index 00000000000..85ab6b4a025
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/NumberUpDefault.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/OrientationRequestedDefault.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/OrientationRequestedDefault.class
new file mode 100644
index 00000000000..06ea2a66c82
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/OrientationRequestedDefault.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/PrintQualityDefault.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/PrintQualityDefault.class
new file mode 100644
index 00000000000..aa0d7a04528
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/PrintQualityDefault.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/PrinterResolutionDefault.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/PrinterResolutionDefault.class
new file mode 100644
index 00000000000..52518aae293
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/PrinterResolutionDefault.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/SidesDefault.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/SidesDefault.class
new file mode 100644
index 00000000000..ebb5f42d30a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/defaults/SidesDefault.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/AttributesCharset.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/AttributesCharset.class
new file mode 100644
index 00000000000..2bb5b6f6e15
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/AttributesCharset.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/AttributesNaturalLanguage.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/AttributesNaturalLanguage.class
new file mode 100644
index 00000000000..bfe2a71b35d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/AttributesNaturalLanguage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobDetailedStatusMessages.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobDetailedStatusMessages.class
new file mode 100644
index 00000000000..cb8fb466771
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobDetailedStatusMessages.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobDocumentAccessErrors.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobDocumentAccessErrors.class
new file mode 100644
index 00000000000..1d80bce239b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobDocumentAccessErrors.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobId.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobId.class
new file mode 100644
index 00000000000..66dc5e1025c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobId.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobMoreInfo.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobMoreInfo.class
new file mode 100644
index 00000000000..dd4d0972aa3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobMoreInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobPrinterUri.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobPrinterUri.class
new file mode 100644
index 00000000000..f05531cccb9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobPrinterUri.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobStateMessage.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobStateMessage.class
new file mode 100644
index 00000000000..26c28a9f320
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobStateMessage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobUri.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobUri.class
new file mode 100644
index 00000000000..bcb38baf778
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/job/JobUri.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/CharsetConfigured.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/CharsetConfigured.class
new file mode 100644
index 00000000000..473e134dd01
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/CharsetConfigured.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/DocumentFormat.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/DocumentFormat.class
new file mode 100644
index 00000000000..164c6fef2a2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/DocumentFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/MultipleOperationTimeOut.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/MultipleOperationTimeOut.class
new file mode 100644
index 00000000000..d3fec69ffcb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/MultipleOperationTimeOut.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/NaturalLanguageConfigured.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/NaturalLanguageConfigured.class
new file mode 100644
index 00000000000..421196e8ce8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/NaturalLanguageConfigured.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterCurrentTime.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterCurrentTime.class
new file mode 100644
index 00000000000..95d28bd4603
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterCurrentTime.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterDriverInstaller.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterDriverInstaller.class
new file mode 100644
index 00000000000..db550ba8905
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterDriverInstaller.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterStateMessage.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterStateMessage.class
new file mode 100644
index 00000000000..3c01302eaf7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterStateMessage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterUpTime.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterUpTime.class
new file mode 100644
index 00000000000..55c5a0bb008
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/printer/PrinterUpTime.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/CharsetSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/CharsetSupported.class
new file mode 100644
index 00000000000..1c79ec97fe3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/CharsetSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/CompressionSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/CompressionSupported.class
new file mode 100644
index 00000000000..eb72871d84b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/CompressionSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/DocumentFormatSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/DocumentFormatSupported.class
new file mode 100644
index 00000000000..f61ae2a2c9b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/DocumentFormatSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/FinishingsSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/FinishingsSupported.class
new file mode 100644
index 00000000000..ae13c0ebad4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/FinishingsSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/GeneratedNaturalLanguageSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/GeneratedNaturalLanguageSupported.class
new file mode 100644
index 00000000000..e699d06b143
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/GeneratedNaturalLanguageSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/IppVersionsSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/IppVersionsSupported.class
new file mode 100644
index 00000000000..1d5c711ec48
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/IppVersionsSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/JobHoldUntilSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/JobHoldUntilSupported.class
new file mode 100644
index 00000000000..beff50151c9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/JobHoldUntilSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.class
new file mode 100644
index 00000000000..f3fa0734ab5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/MediaSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/MediaSupported.class
new file mode 100644
index 00000000000..3732dcb9ee0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/MediaSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/MultipleDocumentHandlingSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/MultipleDocumentHandlingSupported.class
new file mode 100644
index 00000000000..583af160e22
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/MultipleDocumentHandlingSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/MultipleDocumentJobsSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/MultipleDocumentJobsSupported.class
new file mode 100644
index 00000000000..178d41ac7e7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/MultipleDocumentJobsSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/OperationsSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/OperationsSupported.class
new file mode 100644
index 00000000000..90fdd259480
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/OperationsSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/OrientationRequestedSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/OrientationRequestedSupported.class
new file mode 100644
index 00000000000..b5e02a44882
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/OrientationRequestedSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PageRangesSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PageRangesSupported.class
new file mode 100644
index 00000000000..a29d08c318e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PageRangesSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PrintQualitySupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PrintQualitySupported.class
new file mode 100644
index 00000000000..52db096290e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PrintQualitySupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PrinterResolutionSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PrinterResolutionSupported.class
new file mode 100644
index 00000000000..93ea94f318a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PrinterResolutionSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PrinterUriSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PrinterUriSupported.class
new file mode 100644
index 00000000000..561eaffb240
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/PrinterUriSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/SidesSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/SidesSupported.class
new file mode 100644
index 00000000000..ac100801793
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/SidesSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/UriAuthenticationSupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/UriAuthenticationSupported.class
new file mode 100644
index 00000000000..c90e6345f5f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/UriAuthenticationSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/UriSecuritySupported.class b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/UriSecuritySupported.class
new file mode 100644
index 00000000000..fcaa2fffddd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/print/ipp/attribute/supported/UriSecuritySupported.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/rmi/CORBA/CorbaInput.class b/libjava/classpath/lib/gnu/javax/rmi/CORBA/CorbaInput.class
new file mode 100644
index 00000000000..906d9aeeec4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/rmi/CORBA/CorbaInput.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/rmi/CORBA/CorbaOutput.class b/libjava/classpath/lib/gnu/javax/rmi/CORBA/CorbaOutput.class
new file mode 100644
index 00000000000..9dda2f230f2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/rmi/CORBA/CorbaOutput.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/rmi/CORBA/DefaultWriteObjectTester.class b/libjava/classpath/lib/gnu/javax/rmi/CORBA/DefaultWriteObjectTester.class
new file mode 100644
index 00000000000..37a9c8379ed
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/rmi/CORBA/DefaultWriteObjectTester.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/rmi/CORBA/DelegateFactory.class b/libjava/classpath/lib/gnu/javax/rmi/CORBA/DelegateFactory.class
new file mode 100644
index 00000000000..4652d0654ee
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/rmi/CORBA/DelegateFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/rmi/CORBA/GetDelegateInstanceException.class b/libjava/classpath/lib/gnu/javax/rmi/CORBA/GetDelegateInstanceException.class
new file mode 100644
index 00000000000..d03037c7163
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/rmi/CORBA/GetDelegateInstanceException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/rmi/CORBA/PortableRemoteObjectDelegateImpl.class b/libjava/classpath/lib/gnu/javax/rmi/CORBA/PortableRemoteObjectDelegateImpl.class
new file mode 100644
index 00000000000..01b7bb8b867
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/rmi/CORBA/PortableRemoteObjectDelegateImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/rmi/CORBA/RmiUtilities$1.class b/libjava/classpath/lib/gnu/javax/rmi/CORBA/RmiUtilities$1.class
new file mode 100644
index 00000000000..b4312276227
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/rmi/CORBA/RmiUtilities$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/rmi/CORBA/RmiUtilities$2.class b/libjava/classpath/lib/gnu/javax/rmi/CORBA/RmiUtilities$2.class
new file mode 100644
index 00000000000..dcedc9ce289
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/rmi/CORBA/RmiUtilities$2.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/rmi/CORBA/RmiUtilities.class b/libjava/classpath/lib/gnu/javax/rmi/CORBA/RmiUtilities.class
new file mode 100644
index 00000000000..403b5e6fa52
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/rmi/CORBA/RmiUtilities.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/rmi/CORBA/StubDelegateImpl.class b/libjava/classpath/lib/gnu/javax/rmi/CORBA/StubDelegateImpl.class
new file mode 100644
index 00000000000..a5c64c1b866
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/rmi/CORBA/StubDelegateImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/rmi/CORBA/TieTargetRecord.class b/libjava/classpath/lib/gnu/javax/rmi/CORBA/TieTargetRecord.class
new file mode 100644
index 00000000000..3869364453e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/rmi/CORBA/TieTargetRecord.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/rmi/CORBA/UtilDelegateImpl.class b/libjava/classpath/lib/gnu/javax/rmi/CORBA/UtilDelegateImpl.class
new file mode 100644
index 00000000000..d2e50ba1c3c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/rmi/CORBA/UtilDelegateImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.class b/libjava/classpath/lib/gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.class
new file mode 100644
index 00000000000..f4f068bd581
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/Password.class b/libjava/classpath/lib/gnu/javax/security/auth/Password.class
new file mode 100644
index 00000000000..df75b3a5470
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/Password.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/AWTCallbackHandler.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/AWTCallbackHandler.class
new file mode 100644
index 00000000000..e387600a32d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/AWTCallbackHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/AbstractCallbackHandler.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/AbstractCallbackHandler.class
new file mode 100644
index 00000000000..806be85bb3c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/AbstractCallbackHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/CertificateCallback.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/CertificateCallback.class
new file mode 100644
index 00000000000..c67139d1f27
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/CertificateCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/ConsoleCallbackHandler.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/ConsoleCallbackHandler.class
new file mode 100644
index 00000000000..ffaa77f35ed
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/ConsoleCallbackHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/DefaultCallbackHandler.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/DefaultCallbackHandler.class
new file mode 100644
index 00000000000..6626fed6adb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/DefaultCallbackHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/GnuCallbacks$1.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/GnuCallbacks$1.class
new file mode 100644
index 00000000000..82895346434
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/GnuCallbacks$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/GnuCallbacks.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/GnuCallbacks.class
new file mode 100644
index 00000000000..3485c08d2ea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/GnuCallbacks.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$1.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$1.class
new file mode 100644
index 00000000000..54f86511b9d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$2.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$2.class
new file mode 100644
index 00000000000..764f6246b9c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$2.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$3.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$3.class
new file mode 100644
index 00000000000..039dc83b575
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$3.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$4.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$4.class
new file mode 100644
index 00000000000..48b477334b5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$4.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$5.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$5.class
new file mode 100644
index 00000000000..9c232e86c65
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$5.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$6.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$6.class
new file mode 100644
index 00000000000..95590fe47a5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$6.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$7.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$7.class
new file mode 100644
index 00000000000..59ea0f712c9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler$7.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler.class b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler.class
new file mode 100644
index 00000000000..a8781c2c65b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/callback/SwingCallbackHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/login/ConfigFileParser.class b/libjava/classpath/lib/gnu/javax/security/auth/login/ConfigFileParser.class
new file mode 100644
index 00000000000..a6318907f3d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/login/ConfigFileParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/login/ConfigFileTokenizer.class b/libjava/classpath/lib/gnu/javax/security/auth/login/ConfigFileTokenizer.class
new file mode 100644
index 00000000000..751608e5faf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/login/ConfigFileTokenizer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/security/auth/login/GnuConfiguration.class b/libjava/classpath/lib/gnu/javax/security/auth/login/GnuConfiguration.class
new file mode 100644
index 00000000000..ca593c31c38
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/security/auth/login/GnuConfiguration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaInputPortDevice.class b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaInputPortDevice.class
new file mode 100644
index 00000000000..b6849564508
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaInputPortDevice.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaInfo.class b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaInfo.class
new file mode 100644
index 00000000000..1aca771aac3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaInputPortInfo.class b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaInputPortInfo.class
new file mode 100644
index 00000000000..f618affed49
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaInputPortInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaOutputPortInfo.class b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaOutputPortInfo.class
new file mode 100644
index 00000000000..967fbbdfca2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaOutputPortInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaPortInfo.class b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaPortInfo.class
new file mode 100644
index 00000000000..f84357fb8fd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaPortInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaSequencerInfo.class b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaSequencerInfo.class
new file mode 100644
index 00000000000..021a78358ba
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider$AlsaSequencerInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider.class b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider.class
new file mode 100644
index 00000000000..e73ad93dae9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiDeviceProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiSequencerDevice.class b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiSequencerDevice.class
new file mode 100644
index 00000000000..e321d8daeb0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaMidiSequencerDevice.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaOutputPortDevice.class b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaOutputPortDevice.class
new file mode 100644
index 00000000000..09552ad627b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaOutputPortDevice.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaPortDevice$AlsaReceiver.class b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaPortDevice$AlsaReceiver.class
new file mode 100644
index 00000000000..df52c733f8f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaPortDevice$AlsaReceiver.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaPortDevice$AlsaTransmitter.class b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaPortDevice$AlsaTransmitter.class
new file mode 100644
index 00000000000..1759a93f3f5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaPortDevice$AlsaTransmitter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaPortDevice.class b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaPortDevice.class
new file mode 100644
index 00000000000..895d98f4577
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/alsa/AlsaPortDevice.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSIMidiDeviceProvider$1.class b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSIMidiDeviceProvider$1.class
new file mode 100644
index 00000000000..c928dad5665
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSIMidiDeviceProvider$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSIMidiDeviceProvider$DSSIInfo.class b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSIMidiDeviceProvider$DSSIInfo.class
new file mode 100644
index 00000000000..94e1a759910
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSIMidiDeviceProvider$DSSIInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSIMidiDeviceProvider.class b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSIMidiDeviceProvider.class
new file mode 100644
index 00000000000..5c21bd45677
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSIMidiDeviceProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSIInstrument.class b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSIInstrument.class
new file mode 100644
index 00000000000..fba99b598bb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSIInstrument.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSIMidiChannel.class b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSIMidiChannel.class
new file mode 100644
index 00000000000..6eafee5759e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSIMidiChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSIReceiver.class b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSIReceiver.class
new file mode 100644
index 00000000000..89d7fd6c4e1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSIReceiver.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSISoundbank.class b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSISoundbank.class
new file mode 100644
index 00000000000..2669da8e3e4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer$DSSISoundbank.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer.class b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer.class
new file mode 100644
index 00000000000..fc8191c97d0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/dssi/DSSISynthesizer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/file/ExtendedMidiFileFormat.class b/libjava/classpath/lib/gnu/javax/sound/midi/file/ExtendedMidiFileFormat.class
new file mode 100644
index 00000000000..0efae67cfe5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/file/ExtendedMidiFileFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/file/MidiDataInputStream.class b/libjava/classpath/lib/gnu/javax/sound/midi/file/MidiDataInputStream.class
new file mode 100644
index 00000000000..1dce70845d8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/file/MidiDataInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/file/MidiDataOutputStream.class b/libjava/classpath/lib/gnu/javax/sound/midi/file/MidiDataOutputStream.class
new file mode 100644
index 00000000000..5de7c501b06
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/file/MidiDataOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/file/MidiFileReader.class b/libjava/classpath/lib/gnu/javax/sound/midi/file/MidiFileReader.class
new file mode 100644
index 00000000000..00b1da899c5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/file/MidiFileReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/midi/file/MidiFileWriter.class b/libjava/classpath/lib/gnu/javax/sound/midi/file/MidiFileWriter.class
new file mode 100644
index 00000000000..1982f16ae34
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/midi/file/MidiFileWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/sampled/AU/AUReader$AUFormatType.class b/libjava/classpath/lib/gnu/javax/sound/sampled/AU/AUReader$AUFormatType.class
new file mode 100644
index 00000000000..5191a9dc7f5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/sampled/AU/AUReader$AUFormatType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/sampled/AU/AUReader$AUHeader.class b/libjava/classpath/lib/gnu/javax/sound/sampled/AU/AUReader$AUHeader.class
new file mode 100644
index 00000000000..cc0736d8716
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/sampled/AU/AUReader$AUHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/sampled/AU/AUReader.class b/libjava/classpath/lib/gnu/javax/sound/sampled/AU/AUReader.class
new file mode 100644
index 00000000000..b47ae8aa608
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/sampled/AU/AUReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/sound/sampled/WAV/WAVReader.class b/libjava/classpath/lib/gnu/javax/sound/sampled/WAV/WAVReader.class
new file mode 100644
index 00000000000..9bf00f74361
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/sound/sampled/WAV/WAVReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/plaf/gnu/GNULookAndFeel$CheckBoxIcon.class b/libjava/classpath/lib/gnu/javax/swing/plaf/gnu/GNULookAndFeel$CheckBoxIcon.class
new file mode 100644
index 00000000000..1f1dc137d06
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/plaf/gnu/GNULookAndFeel$CheckBoxIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/plaf/gnu/GNULookAndFeel$RadioButtonIcon.class b/libjava/classpath/lib/gnu/javax/swing/plaf/gnu/GNULookAndFeel$RadioButtonIcon.class
new file mode 100644
index 00000000000..4b660932429
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/plaf/gnu/GNULookAndFeel$RadioButtonIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/plaf/gnu/GNULookAndFeel.class b/libjava/classpath/lib/gnu/javax/swing/plaf/gnu/GNULookAndFeel.class
new file mode 100644
index 00000000000..53b330b32ea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/plaf/gnu/GNULookAndFeel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/plaf/metal/CustomizableTheme.class b/libjava/classpath/lib/gnu/javax/swing/plaf/metal/CustomizableTheme.class
new file mode 100644
index 00000000000..c27ff08925e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/plaf/metal/CustomizableTheme.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/CharacterAttributeTranslator.class b/libjava/classpath/lib/gnu/javax/swing/text/html/CharacterAttributeTranslator.class
new file mode 100644
index 00000000000..88aaece43ac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/CharacterAttributeTranslator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/CombinedAttributes$CombinedEnumeration.class b/libjava/classpath/lib/gnu/javax/swing/text/html/CombinedAttributes$CombinedEnumeration.class
new file mode 100644
index 00000000000..94bf071d5bb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/CombinedAttributes$CombinedEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/CombinedAttributes.class b/libjava/classpath/lib/gnu/javax/swing/text/html/CombinedAttributes.class
new file mode 100644
index 00000000000..34d9de70e97
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/CombinedAttributes.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/ImageViewIconFactory$LoadingImageIcon.class b/libjava/classpath/lib/gnu/javax/swing/text/html/ImageViewIconFactory$LoadingImageIcon.class
new file mode 100644
index 00000000000..bf5601cfea6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/ImageViewIconFactory$LoadingImageIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/ImageViewIconFactory$NoImageIcon.class b/libjava/classpath/lib/gnu/javax/swing/text/html/ImageViewIconFactory$NoImageIcon.class
new file mode 100644
index 00000000000..b6a75d7c384
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/ImageViewIconFactory$NoImageIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/ImageViewIconFactory.class b/libjava/classpath/lib/gnu/javax/swing/text/html/ImageViewIconFactory.class
new file mode 100644
index 00000000000..f97df57e087
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/ImageViewIconFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/css/BorderStyle.class b/libjava/classpath/lib/gnu/javax/swing/text/html/css/BorderStyle.class
new file mode 100644
index 00000000000..f51a09709d3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/css/BorderStyle.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/css/BorderWidth.class b/libjava/classpath/lib/gnu/javax/swing/text/html/css/BorderWidth.class
new file mode 100644
index 00000000000..caea7dec0d2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/css/BorderWidth.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSColor.class b/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSColor.class
new file mode 100644
index 00000000000..07ac9f9bbed
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSColor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSLexicalException.class b/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSLexicalException.class
new file mode 100644
index 00000000000..e17935fe345
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSLexicalException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParser$1.class b/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParser$1.class
new file mode 100644
index 00000000000..40025b684dd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParser$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParser.class b/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParser.class
new file mode 100644
index 00000000000..fb05d08a33e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParserCallback.class b/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParserCallback.class
new file mode 100644
index 00000000000..abfda1483cf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParserCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParserException.class b/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParserException.class
new file mode 100644
index 00000000000..860cf3cdd9c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSParserException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSScanner.class b/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSScanner.class
new file mode 100644
index 00000000000..044cc5edf49
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/css/CSSScanner.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/css/FontSize.class b/libjava/classpath/lib/gnu/javax/swing/text/html/css/FontSize.class
new file mode 100644
index 00000000000..a847e5c8f31
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/css/FontSize.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/css/FontStyle.class b/libjava/classpath/lib/gnu/javax/swing/text/html/css/FontStyle.class
new file mode 100644
index 00000000000..e66ae34b122
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/css/FontStyle.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/css/FontWeight.class b/libjava/classpath/lib/gnu/javax/swing/text/html/css/FontWeight.class
new file mode 100644
index 00000000000..a0c7f447c4e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/css/FontWeight.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/css/Length.class b/libjava/classpath/lib/gnu/javax/swing/text/html/css/Length.class
new file mode 100644
index 00000000000..b5b30964397
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/css/Length.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/css/Selector.class b/libjava/classpath/lib/gnu/javax/swing/text/html/css/Selector.class
new file mode 100644
index 00000000000..fb5de5c5040
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/css/Selector.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/GnuParserDelegator$gnuParser.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/GnuParserDelegator$gnuParser.class
new file mode 100644
index 00000000000..96638d692c3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/GnuParserDelegator$gnuParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/GnuParserDelegator.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/GnuParserDelegator.class
new file mode 100644
index 00000000000..fa8aa3b6146
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/GnuParserDelegator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/HTML_401F.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/HTML_401F.class
new file mode 100644
index 00000000000..5d9889c62e0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/HTML_401F.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/SmallHtmlAttributeSet$1.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/SmallHtmlAttributeSet$1.class
new file mode 100644
index 00000000000..95b5278b73c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/SmallHtmlAttributeSet$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/SmallHtmlAttributeSet.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/SmallHtmlAttributeSet.class
new file mode 100644
index 00000000000..d2342a5d5df
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/SmallHtmlAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/gnuDTD.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/gnuDTD.class
new file mode 100644
index 00000000000..e0c19152da6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/gnuDTD.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlAttributeSet$1.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlAttributeSet$1.class
new file mode 100644
index 00000000000..8517b19d479
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlAttributeSet$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlAttributeSet.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlAttributeSet.class
new file mode 100644
index 00000000000..d4f6a65ff6f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlValidator$hTag.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlValidator$hTag.class
new file mode 100644
index 00000000000..2ed578a3f5f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlValidator$hTag.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlValidator.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlValidator.class
new file mode 100644
index 00000000000..32a21a5a288
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/htmlValidator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/PCDATAonly_model.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/PCDATAonly_model.class
new file mode 100644
index 00000000000..192b3ad9e5a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/PCDATAonly_model.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/TableRowContentModel.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/TableRowContentModel.class
new file mode 100644
index 00000000000..8599669972a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/TableRowContentModel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/list.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/list.class
new file mode 100644
index 00000000000..d90cc458729
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/list.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/noTagModel.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/noTagModel.class
new file mode 100644
index 00000000000..d95f8c6f7ce
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/noTagModel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/node.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/node.class
new file mode 100644
index 00000000000..f551dbf5977
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/node.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/transformer.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/transformer.class
new file mode 100644
index 00000000000..9b5e29a9466
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/models/transformer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/Parser$1.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/Parser$1.class
new file mode 100644
index 00000000000..0db9a27ba30
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/Parser$1.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/Parser$2.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/Parser$2.class
new file mode 100644
index 00000000000..546fddc6b50
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/Parser$2.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/Parser.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/Parser.class
new file mode 100644
index 00000000000..6c330e24eae
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/Parser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/gnuStringIntMapper.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/gnuStringIntMapper.class
new file mode 100644
index 00000000000..c6ee266838a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/gnuStringIntMapper.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Buffer.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Buffer.class
new file mode 100644
index 00000000000..12e6aa89966
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Buffer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Constants.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Constants.class
new file mode 100644
index 00000000000..c4ffa342648
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Constants.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Location.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Location.class
new file mode 100644
index 00000000000..c43fb01a38e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Location.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/ParseException.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/ParseException.class
new file mode 100644
index 00000000000..dfa6e9b56de
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/ParseException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Queue.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Queue.class
new file mode 100644
index 00000000000..dfe3cb347eb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Queue.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/ReaderTokenizer.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/ReaderTokenizer.class
new file mode 100644
index 00000000000..d7f253263a2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/ReaderTokenizer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Token.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Token.class
new file mode 100644
index 00000000000..e5b7a939742
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/Token.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/node.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/node.class
new file mode 100644
index 00000000000..9a3b6dcbee7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/node.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/pattern.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/pattern.class
new file mode 100644
index 00000000000..cea9d459946
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/low/pattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/parameterDefaulter.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/parameterDefaulter.class
new file mode 100644
index 00000000000..084edd742a9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/parameterDefaulter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/textPreProcessor.class b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/textPreProcessor.class
new file mode 100644
index 00000000000..d9daa90ed49
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/text/html/parser/support/textPreProcessor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/swing/tree/GnuPath.class b/libjava/classpath/lib/gnu/javax/swing/tree/GnuPath.class
new file mode 100644
index 00000000000..841cc89adef
--- /dev/null
+++ b/libjava/classpath/lib/gnu/javax/swing/tree/GnuPath.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/aelfred2/JAXPFactory$JaxpParser.class b/libjava/classpath/lib/gnu/xml/aelfred2/JAXPFactory$JaxpParser.class
new file mode 100644
index 00000000000..904351c6b5c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/aelfred2/JAXPFactory$JaxpParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/aelfred2/JAXPFactory.class b/libjava/classpath/lib/gnu/xml/aelfred2/JAXPFactory.class
new file mode 100644
index 00000000000..49fa7f3e702
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/aelfred2/JAXPFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/aelfred2/SAXDriver$Adapter.class b/libjava/classpath/lib/gnu/xml/aelfred2/SAXDriver$Adapter.class
new file mode 100644
index 00000000000..d34cb43c537
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/aelfred2/SAXDriver$Adapter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/aelfred2/SAXDriver$Attribute.class b/libjava/classpath/lib/gnu/xml/aelfred2/SAXDriver$Attribute.class
new file mode 100644
index 00000000000..68cfbc16965
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/aelfred2/SAXDriver$Attribute.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/aelfred2/SAXDriver.class b/libjava/classpath/lib/gnu/xml/aelfred2/SAXDriver.class
new file mode 100644
index 00000000000..d690c175254
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/aelfred2/SAXDriver.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$AttributeDecl.class b/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$AttributeDecl.class
new file mode 100644
index 00000000000..8bb85a3f0ec
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$AttributeDecl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$ElementDecl.class b/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$ElementDecl.class
new file mode 100644
index 00000000000..9fbede093bb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$ElementDecl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$EntityInfo.class b/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$EntityInfo.class
new file mode 100644
index 00000000000..2a0779ea5dc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$EntityInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$ExternalIdentifiers.class b/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$ExternalIdentifiers.class
new file mode 100644
index 00000000000..65a9cb98b3f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$ExternalIdentifiers.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$Input.class b/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$Input.class
new file mode 100644
index 00000000000..7347af6010d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser$Input.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser.class b/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser.class
new file mode 100644
index 00000000000..fddb3e796b3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/aelfred2/XmlParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/aelfred2/XmlReader$FatalErrorHandler.class b/libjava/classpath/lib/gnu/xml/aelfred2/XmlReader$FatalErrorHandler.class
new file mode 100644
index 00000000000..5aadec5355b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/aelfred2/XmlReader$FatalErrorHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/aelfred2/XmlReader.class b/libjava/classpath/lib/gnu/xml/aelfred2/XmlReader.class
new file mode 100644
index 00000000000..6330918d62c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/aelfred2/XmlReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/Consumer$Backdoor.class b/libjava/classpath/lib/gnu/xml/dom/Consumer$Backdoor.class
new file mode 100644
index 00000000000..6b3c5ce78be
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/Consumer$Backdoor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/Consumer.class b/libjava/classpath/lib/gnu/xml/dom/Consumer.class
new file mode 100644
index 00000000000..b7dae3f68bc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/Consumer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DTDAttributeTypeInfo.class b/libjava/classpath/lib/gnu/xml/dom/DTDAttributeTypeInfo.class
new file mode 100644
index 00000000000..d7438845b4c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DTDAttributeTypeInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DTDElementTypeInfo.class b/libjava/classpath/lib/gnu/xml/dom/DTDElementTypeInfo.class
new file mode 100644
index 00000000000..cd47fc332f6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DTDElementTypeInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomAttr.class b/libjava/classpath/lib/gnu/xml/dom/DomAttr.class
new file mode 100644
index 00000000000..034639a9ea1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomAttr.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomCDATASection.class b/libjava/classpath/lib/gnu/xml/dom/DomCDATASection.class
new file mode 100644
index 00000000000..c7b346bb93c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomCDATASection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomCharacterData$EmptyNodeList.class b/libjava/classpath/lib/gnu/xml/dom/DomCharacterData$EmptyNodeList.class
new file mode 100644
index 00000000000..b3bdeb5e5e5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomCharacterData$EmptyNodeList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomCharacterData.class b/libjava/classpath/lib/gnu/xml/dom/DomCharacterData.class
new file mode 100644
index 00000000000..47cd710c753
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomCharacterData.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomComment.class b/libjava/classpath/lib/gnu/xml/dom/DomComment.class
new file mode 100644
index 00000000000..deb808dd57f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomComment.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomDOMException.class b/libjava/classpath/lib/gnu/xml/dom/DomDOMException.class
new file mode 100644
index 00000000000..729a9446d60
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomDOMException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomDoctype.class b/libjava/classpath/lib/gnu/xml/dom/DomDoctype.class
new file mode 100644
index 00000000000..7698d8f797a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomDoctype.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomDocument.class b/libjava/classpath/lib/gnu/xml/dom/DomDocument.class
new file mode 100644
index 00000000000..9ff8f0d1ff9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomDocument.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomDocumentBuilder.class b/libjava/classpath/lib/gnu/xml/dom/DomDocumentBuilder.class
new file mode 100644
index 00000000000..41f2981c4b9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomDocumentBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomDocumentBuilderFactory.class b/libjava/classpath/lib/gnu/xml/dom/DomDocumentBuilderFactory.class
new file mode 100644
index 00000000000..4e082d19a9d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomDocumentBuilderFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomDocumentConfiguration.class b/libjava/classpath/lib/gnu/xml/dom/DomDocumentConfiguration.class
new file mode 100644
index 00000000000..1d0038f9d0a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomDocumentConfiguration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomDocumentFragment.class b/libjava/classpath/lib/gnu/xml/dom/DomDocumentFragment.class
new file mode 100644
index 00000000000..9bdd263ea24
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomDocumentFragment.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomElement.class b/libjava/classpath/lib/gnu/xml/dom/DomElement.class
new file mode 100644
index 00000000000..0800405b631
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomEntity.class b/libjava/classpath/lib/gnu/xml/dom/DomEntity.class
new file mode 100644
index 00000000000..554b701c682
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomEntity.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomEntityReference.class b/libjava/classpath/lib/gnu/xml/dom/DomEntityReference.class
new file mode 100644
index 00000000000..ebeb3f8a231
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomEntityReference.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomEvent$DomMutationEvent.class b/libjava/classpath/lib/gnu/xml/dom/DomEvent$DomMutationEvent.class
new file mode 100644
index 00000000000..d8932f652b7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomEvent$DomMutationEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomEvent$DomUIEvent.class b/libjava/classpath/lib/gnu/xml/dom/DomEvent$DomUIEvent.class
new file mode 100644
index 00000000000..860ab7772a7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomEvent$DomUIEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomEvent.class b/libjava/classpath/lib/gnu/xml/dom/DomEvent.class
new file mode 100644
index 00000000000..a2f853f54ac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomExtern.class b/libjava/classpath/lib/gnu/xml/dom/DomExtern.class
new file mode 100644
index 00000000000..11ed4294340
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomExtern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomImpl.class b/libjava/classpath/lib/gnu/xml/dom/DomImpl.class
new file mode 100644
index 00000000000..62eabbb4f71
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomIterator.class b/libjava/classpath/lib/gnu/xml/dom/DomIterator.class
new file mode 100644
index 00000000000..1ca7fa2a979
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomNSResolverContext.class b/libjava/classpath/lib/gnu/xml/dom/DomNSResolverContext.class
new file mode 100644
index 00000000000..3f76bc655d4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomNSResolverContext.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomNamedNodeMap.class b/libjava/classpath/lib/gnu/xml/dom/DomNamedNodeMap.class
new file mode 100644
index 00000000000..5ff3c7a8dbe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomNamedNodeMap.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomNode$DomEventException.class b/libjava/classpath/lib/gnu/xml/dom/DomNode$DomEventException.class
new file mode 100644
index 00000000000..e2c1a29b51f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomNode$DomEventException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomNode$ListenerRecord.class b/libjava/classpath/lib/gnu/xml/dom/DomNode$ListenerRecord.class
new file mode 100644
index 00000000000..71bf96f4167
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomNode$ListenerRecord.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomNode$LiveNodeList.class b/libjava/classpath/lib/gnu/xml/dom/DomNode$LiveNodeList.class
new file mode 100644
index 00000000000..6be5e27c404
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomNode$LiveNodeList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomNode$ShadowList.class b/libjava/classpath/lib/gnu/xml/dom/DomNode$ShadowList.class
new file mode 100644
index 00000000000..b1006cefff4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomNode$ShadowList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomNode.class b/libjava/classpath/lib/gnu/xml/dom/DomNode.class
new file mode 100644
index 00000000000..61378095b2b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomNodeIterator.class b/libjava/classpath/lib/gnu/xml/dom/DomNodeIterator.class
new file mode 100644
index 00000000000..3875450ae4b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomNodeIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomNotation.class b/libjava/classpath/lib/gnu/xml/dom/DomNotation.class
new file mode 100644
index 00000000000..0eebc788ca5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomNotation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomNsNode.class b/libjava/classpath/lib/gnu/xml/dom/DomNsNode.class
new file mode 100644
index 00000000000..63a6addf9d2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomNsNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomProcessingInstruction.class b/libjava/classpath/lib/gnu/xml/dom/DomProcessingInstruction.class
new file mode 100644
index 00000000000..1ae20a37502
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomProcessingInstruction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomText.class b/libjava/classpath/lib/gnu/xml/dom/DomText.class
new file mode 100644
index 00000000000..fd371db59cb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomText.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomXPathExpression.class b/libjava/classpath/lib/gnu/xml/dom/DomXPathExpression.class
new file mode 100644
index 00000000000..0dc76e0e39a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomXPathExpression.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomXPathNSResolver.class b/libjava/classpath/lib/gnu/xml/dom/DomXPathNSResolver.class
new file mode 100644
index 00000000000..5f9db6e3fa3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomXPathNSResolver.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/DomXPathResult.class b/libjava/classpath/lib/gnu/xml/dom/DomXPathResult.class
new file mode 100644
index 00000000000..09ab411c5f0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/DomXPathResult.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/ImplementationList.class b/libjava/classpath/lib/gnu/xml/dom/ImplementationList.class
new file mode 100644
index 00000000000..256e59d7959
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/ImplementationList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/ImplementationSource.class b/libjava/classpath/lib/gnu/xml/dom/ImplementationSource.class
new file mode 100644
index 00000000000..6ba53300369
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/ImplementationSource.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/JAXPFactory$JAXPBuilder.class b/libjava/classpath/lib/gnu/xml/dom/JAXPFactory$JAXPBuilder.class
new file mode 100644
index 00000000000..5252a06311f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/JAXPFactory$JAXPBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/JAXPFactory.class b/libjava/classpath/lib/gnu/xml/dom/JAXPFactory.class
new file mode 100644
index 00000000000..aff36d2a486
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/JAXPFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLAnchorElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLAnchorElement.class
new file mode 100644
index 00000000000..5fd7d7de21b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLAnchorElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLAppletElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLAppletElement.class
new file mode 100644
index 00000000000..7744e7c15f7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLAppletElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLAreaElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLAreaElement.class
new file mode 100644
index 00000000000..674f85bbe7b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLAreaElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBRElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBRElement.class
new file mode 100644
index 00000000000..f7db7e404db
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBRElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBaseElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBaseElement.class
new file mode 100644
index 00000000000..4e58d2f09e5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBaseElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBaseFontElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBaseFontElement.class
new file mode 100644
index 00000000000..ac899f1feb4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBaseFontElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBodyElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBodyElement.class
new file mode 100644
index 00000000000..ef2f3d1965d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLBodyElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLButtonElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLButtonElement.class
new file mode 100644
index 00000000000..93e0e4c798a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLButtonElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLCollection.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLCollection.class
new file mode 100644
index 00000000000..c1438b30b60
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLCollection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDListElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDListElement.class
new file mode 100644
index 00000000000..ee60476f0df
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDListElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDirectoryElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDirectoryElement.class
new file mode 100644
index 00000000000..b80e6231623
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDirectoryElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDivElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDivElement.class
new file mode 100644
index 00000000000..6433f235d66
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDivElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDocument.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDocument.class
new file mode 100644
index 00000000000..528c28d4a34
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLDocument.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLElement.class
new file mode 100644
index 00000000000..d47e495ec21
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLEmbedElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLEmbedElement.class
new file mode 100644
index 00000000000..abbe2879731
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLEmbedElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFieldSetElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFieldSetElement.class
new file mode 100644
index 00000000000..3a26b4d036a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFieldSetElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFontElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFontElement.class
new file mode 100644
index 00000000000..a8b89f0ae13
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFontElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFormElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFormElement.class
new file mode 100644
index 00000000000..57e56179ea4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFormElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFrameElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFrameElement.class
new file mode 100644
index 00000000000..396a7ce3e21
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFrameElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFrameSetElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFrameSetElement.class
new file mode 100644
index 00000000000..291b20f97b1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLFrameSetElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHRElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHRElement.class
new file mode 100644
index 00000000000..de198963440
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHRElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHeadElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHeadElement.class
new file mode 100644
index 00000000000..9b0e5c2fce7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHeadElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHeadingElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHeadingElement.class
new file mode 100644
index 00000000000..851145ef67a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHeadingElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHtmlElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHtmlElement.class
new file mode 100644
index 00000000000..0ce08630506
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLHtmlElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLIFrameElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLIFrameElement.class
new file mode 100644
index 00000000000..2cdbaa635fc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLIFrameElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLImageElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLImageElement.class
new file mode 100644
index 00000000000..2ee11c579e4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLImageElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLImpl.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLImpl.class
new file mode 100644
index 00000000000..51b462af2ba
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLInputElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLInputElement.class
new file mode 100644
index 00000000000..22c5cb07f53
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLInputElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLIsIndexElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLIsIndexElement.class
new file mode 100644
index 00000000000..b8281f93a2c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLIsIndexElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLIElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLIElement.class
new file mode 100644
index 00000000000..b16aac2a3e9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLIElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLabelElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLabelElement.class
new file mode 100644
index 00000000000..9cd0807d956
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLabelElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLegendElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLegendElement.class
new file mode 100644
index 00000000000..763de42e4c9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLegendElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLinkElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLinkElement.class
new file mode 100644
index 00000000000..bd92dc1c093
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLLinkElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLMapElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLMapElement.class
new file mode 100644
index 00000000000..6f3a25d011f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLMapElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLMenuElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLMenuElement.class
new file mode 100644
index 00000000000..275ef2ccf2f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLMenuElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLMetaElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLMetaElement.class
new file mode 100644
index 00000000000..d1202761511
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLMetaElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLModElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLModElement.class
new file mode 100644
index 00000000000..b9d1bbaae47
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLModElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLOListElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLOListElement.class
new file mode 100644
index 00000000000..b198cba8f45
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLOListElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLObjectElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLObjectElement.class
new file mode 100644
index 00000000000..25f196249b4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLObjectElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLOptGroupElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLOptGroupElement.class
new file mode 100644
index 00000000000..f34bf4d1059
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLOptGroupElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLOptionElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLOptionElement.class
new file mode 100644
index 00000000000..fa059bbb702
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLOptionElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLParagraphElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLParagraphElement.class
new file mode 100644
index 00000000000..389ecd8e9e2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLParagraphElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLParamElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLParamElement.class
new file mode 100644
index 00000000000..8477d00e02f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLParamElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLParser.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLParser.class
new file mode 100644
index 00000000000..5a8f379c5df
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLPreElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLPreElement.class
new file mode 100644
index 00000000000..9164532e88f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLPreElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLQuoteElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLQuoteElement.class
new file mode 100644
index 00000000000..6d5b2408a62
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLQuoteElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLScriptElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLScriptElement.class
new file mode 100644
index 00000000000..918b4e12ac3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLScriptElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLSelectElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLSelectElement.class
new file mode 100644
index 00000000000..64b41b728a6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLSelectElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLStyleElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLStyleElement.class
new file mode 100644
index 00000000000..4d7b9efe5c7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLStyleElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableCaptionElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableCaptionElement.class
new file mode 100644
index 00000000000..e1a373ebc4c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableCaptionElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableCellElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableCellElement.class
new file mode 100644
index 00000000000..f145daebe73
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableCellElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableColElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableColElement.class
new file mode 100644
index 00000000000..00405fee201
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableColElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableElement.class
new file mode 100644
index 00000000000..2e32ae9fda8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableRowElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableRowElement.class
new file mode 100644
index 00000000000..1962a990f03
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableRowElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableSectionElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableSectionElement.class
new file mode 100644
index 00000000000..518fda89102
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTableSectionElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTextAreaElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTextAreaElement.class
new file mode 100644
index 00000000000..9ac42790fa6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTextAreaElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTitleElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTitleElement.class
new file mode 100644
index 00000000000..a6eb748069c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLTitleElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLUListElement.class b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLUListElement.class
new file mode 100644
index 00000000000..3f4840a3123
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/html2/DomHTMLUListElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/ls/DomLSException.class b/libjava/classpath/lib/gnu/xml/dom/ls/DomLSException.class
new file mode 100644
index 00000000000..1e5aadd0958
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/ls/DomLSException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/ls/DomLSInput.class b/libjava/classpath/lib/gnu/xml/dom/ls/DomLSInput.class
new file mode 100644
index 00000000000..ebff3b21f07
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/ls/DomLSInput.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/ls/DomLSOutput.class b/libjava/classpath/lib/gnu/xml/dom/ls/DomLSOutput.class
new file mode 100644
index 00000000000..ef0f74d865c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/ls/DomLSOutput.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/ls/DomLSParser.class b/libjava/classpath/lib/gnu/xml/dom/ls/DomLSParser.class
new file mode 100644
index 00000000000..616257deb34
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/ls/DomLSParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/ls/DomLSSerializer.class b/libjava/classpath/lib/gnu/xml/dom/ls/DomLSSerializer.class
new file mode 100644
index 00000000000..d8b4b59043f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/ls/DomLSSerializer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/ls/FilteredSAXEventSink.class b/libjava/classpath/lib/gnu/xml/dom/ls/FilteredSAXEventSink.class
new file mode 100644
index 00000000000..dee62bfc95f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/ls/FilteredSAXEventSink.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/ls/ReaderInputStream.class b/libjava/classpath/lib/gnu/xml/dom/ls/ReaderInputStream.class
new file mode 100644
index 00000000000..2be7972948f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/ls/ReaderInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/ls/SAXEventSink.class b/libjava/classpath/lib/gnu/xml/dom/ls/SAXEventSink.class
new file mode 100644
index 00000000000..f5f281ea196
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/ls/SAXEventSink.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/dom/ls/WriterOutputStream.class b/libjava/classpath/lib/gnu/xml/dom/ls/WriterOutputStream.class
new file mode 100644
index 00000000000..946908441d3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/dom/ls/WriterOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeAttr.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeAttr.class
new file mode 100644
index 00000000000..b9bde45fbdc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeAttr.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeCDATASection.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeCDATASection.class
new file mode 100644
index 00000000000..7944d0309cc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeCDATASection.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeCharacterData.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeCharacterData.class
new file mode 100644
index 00000000000..1c746262886
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeCharacterData.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeComment.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeComment.class
new file mode 100644
index 00000000000..11801ef1a23
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeComment.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDOMException.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDOMException.class
new file mode 100644
index 00000000000..63644b4110b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDOMException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDOMStringList.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDOMStringList.class
new file mode 100644
index 00000000000..489ddafc656
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDOMStringList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocument.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocument.class
new file mode 100644
index 00000000000..fec965957a8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocument.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentBuilder.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentBuilder.class
new file mode 100644
index 00000000000..f34c5fa075d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentBuilderFactory.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentBuilderFactory.class
new file mode 100644
index 00000000000..a6b1bb27854
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentBuilderFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentFragment.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentFragment.class
new file mode 100644
index 00000000000..bacf0e76eff
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentFragment.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentType.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentType.class
new file mode 100644
index 00000000000..0ca7bd4c5ef
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeDocumentType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeElement.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeElement.class
new file mode 100644
index 00000000000..8e398a215d8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeElement.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeEntity.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeEntity.class
new file mode 100644
index 00000000000..24197b0b881
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeEntity.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeEntityReference.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeEntityReference.class
new file mode 100644
index 00000000000..4a8f196072b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeEntityReference.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNamedNodeMap.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNamedNodeMap.class
new file mode 100644
index 00000000000..0ca72878a5a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNamedNodeMap.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNode.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNode.class
new file mode 100644
index 00000000000..9a6a5c69e97
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNodeList.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNodeList.class
new file mode 100644
index 00000000000..552641a98df
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNodeList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNotation.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNotation.class
new file mode 100644
index 00000000000..f6b5d11d411
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeNotation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeProcessingInstruction.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeProcessingInstruction.class
new file mode 100644
index 00000000000..7e0c32059f4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeProcessingInstruction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeText.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeText.class
new file mode 100644
index 00000000000..79299bd1dc4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeText.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeTypeInfo.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeTypeInfo.class
new file mode 100644
index 00000000000..91918d9c64e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeTypeInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathExpression.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathExpression.class
new file mode 100644
index 00000000000..6a9eeacbdb8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathExpression.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathNSResolver.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathNSResolver.class
new file mode 100644
index 00000000000..1ac3fe11903
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathNSResolver.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathNodeList.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathNodeList.class
new file mode 100644
index 00000000000..a8568c73105
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathNodeList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathResult.class b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathResult.class
new file mode 100644
index 00000000000..d8006e3e3f8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/dom/GnomeXPathResult.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeLocator.class b/libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeLocator.class
new file mode 100644
index 00000000000..3cd1ee602c6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeLocator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeSAXParser.class b/libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeSAXParser.class
new file mode 100644
index 00000000000..458c7f04f9f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeSAXParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeSAXParserFactory.class b/libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeSAXParserFactory.class
new file mode 100644
index 00000000000..0b2f698567c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeSAXParserFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeXMLReader.class b/libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeXMLReader.class
new file mode 100644
index 00000000000..a12f58e3098
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/sax/GnomeXMLReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/sax/Namespaces.class b/libjava/classpath/lib/gnu/xml/libxmlj/sax/Namespaces.class
new file mode 100644
index 00000000000..9cdd479f9b0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/sax/Namespaces.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/sax/StringArrayAttributes.class b/libjava/classpath/lib/gnu/xml/libxmlj/sax/StringArrayAttributes.class
new file mode 100644
index 00000000000..f3d4fba1ef8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/sax/StringArrayAttributes.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/sax/XMLName.class b/libjava/classpath/lib/gnu/xml/libxmlj/sax/XMLName.class
new file mode 100644
index 00000000000..d66655ed28a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/sax/XMLName.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/transform/ErrorListenerErrorHandler.class b/libjava/classpath/lib/gnu/xml/libxmlj/transform/ErrorListenerErrorHandler.class
new file mode 100644
index 00000000000..9c377bb5df3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/transform/ErrorListenerErrorHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/transform/GnomeTransformer.class b/libjava/classpath/lib/gnu/xml/libxmlj/transform/GnomeTransformer.class
new file mode 100644
index 00000000000..5595c3c834d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/transform/GnomeTransformer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/transform/GnomeTransformerFactory$AssociatedStylesheetHandler.class b/libjava/classpath/lib/gnu/xml/libxmlj/transform/GnomeTransformerFactory$AssociatedStylesheetHandler.class
new file mode 100644
index 00000000000..f64bb975b9c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/transform/GnomeTransformerFactory$AssociatedStylesheetHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/transform/GnomeTransformerFactory.class b/libjava/classpath/lib/gnu/xml/libxmlj/transform/GnomeTransformerFactory.class
new file mode 100644
index 00000000000..33872e17d2a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/transform/GnomeTransformerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/transform/URIResolverEntityResolver.class b/libjava/classpath/lib/gnu/xml/libxmlj/transform/URIResolverEntityResolver.class
new file mode 100644
index 00000000000..799f455143a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/transform/URIResolverEntityResolver.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/util/EmptyNodeList.class b/libjava/classpath/lib/gnu/xml/libxmlj/util/EmptyNodeList.class
new file mode 100644
index 00000000000..cbff97daa65
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/util/EmptyNodeList.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/util/NamedInputStream.class b/libjava/classpath/lib/gnu/xml/libxmlj/util/NamedInputStream.class
new file mode 100644
index 00000000000..b0fa30cd37d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/util/NamedInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/util/StandaloneDocumentType.class b/libjava/classpath/lib/gnu/xml/libxmlj/util/StandaloneDocumentType.class
new file mode 100644
index 00000000000..63c1435b662
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/util/StandaloneDocumentType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/util/StandaloneLocator.class b/libjava/classpath/lib/gnu/xml/libxmlj/util/StandaloneLocator.class
new file mode 100644
index 00000000000..c02bd6d6a53
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/util/StandaloneLocator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/util/XMLJ$XMLJShutdownHook.class b/libjava/classpath/lib/gnu/xml/libxmlj/util/XMLJ$XMLJShutdownHook.class
new file mode 100644
index 00000000000..69baedb3e32
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/util/XMLJ$XMLJShutdownHook.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/libxmlj/util/XMLJ.class b/libjava/classpath/lib/gnu/xml/libxmlj/util/XMLJ.class
new file mode 100644
index 00000000000..00aceaed4aa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/libxmlj/util/XMLJ.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/CallFilter$Requestor.class b/libjava/classpath/lib/gnu/xml/pipeline/CallFilter$Requestor.class
new file mode 100644
index 00000000000..6734da4eb58
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/CallFilter$Requestor.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/CallFilter.class b/libjava/classpath/lib/gnu/xml/pipeline/CallFilter.class
new file mode 100644
index 00000000000..2a0abca2527
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/CallFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/DomConsumer$Handler.class b/libjava/classpath/lib/gnu/xml/pipeline/DomConsumer$Handler.class
new file mode 100644
index 00000000000..e9877fc80b6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/DomConsumer$Handler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/DomConsumer.class b/libjava/classpath/lib/gnu/xml/pipeline/DomConsumer.class
new file mode 100644
index 00000000000..024b879bc47
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/DomConsumer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/EventConsumer.class b/libjava/classpath/lib/gnu/xml/pipeline/EventConsumer.class
new file mode 100644
index 00000000000..d6b45fca09c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/EventConsumer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/EventFilter.class b/libjava/classpath/lib/gnu/xml/pipeline/EventFilter.class
new file mode 100644
index 00000000000..ada998d556e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/EventFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/LinkFilter.class b/libjava/classpath/lib/gnu/xml/pipeline/LinkFilter.class
new file mode 100644
index 00000000000..fff322f472e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/LinkFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/NSFilter.class b/libjava/classpath/lib/gnu/xml/pipeline/NSFilter.class
new file mode 100644
index 00000000000..792319d9c13
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/NSFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/PipelineFactory$Pipeline.class b/libjava/classpath/lib/gnu/xml/pipeline/PipelineFactory$Pipeline.class
new file mode 100644
index 00000000000..27c6977ba8a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/PipelineFactory$Pipeline.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/PipelineFactory$Stage.class b/libjava/classpath/lib/gnu/xml/pipeline/PipelineFactory$Stage.class
new file mode 100644
index 00000000000..4f2b6b85c54
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/PipelineFactory$Stage.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/PipelineFactory.class b/libjava/classpath/lib/gnu/xml/pipeline/PipelineFactory.class
new file mode 100644
index 00000000000..0f8ee98bee1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/PipelineFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/TeeConsumer.class b/libjava/classpath/lib/gnu/xml/pipeline/TeeConsumer.class
new file mode 100644
index 00000000000..2e620356d3a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/TeeConsumer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/TextConsumer.class b/libjava/classpath/lib/gnu/xml/pipeline/TextConsumer.class
new file mode 100644
index 00000000000..09a0ec47fa9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/TextConsumer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$AttributeInfo.class b/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$AttributeInfo.class
new file mode 100644
index 00000000000..60246a5676d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$AttributeInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$ChildrenRecognizer.class b/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$ChildrenRecognizer.class
new file mode 100644
index 00000000000..8e0d5e56b96
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$ChildrenRecognizer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$ElementInfo.class b/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$ElementInfo.class
new file mode 100644
index 00000000000..e00c7ac40e8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$ElementInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$EmptyRecognizer.class b/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$EmptyRecognizer.class
new file mode 100644
index 00000000000..81e1374e8a5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$EmptyRecognizer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$MixedRecognizer.class b/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$MixedRecognizer.class
new file mode 100644
index 00000000000..0f2250722a4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$MixedRecognizer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$Recognizer.class b/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$Recognizer.class
new file mode 100644
index 00000000000..f2581c1f0da
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer$Recognizer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer.class b/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer.class
new file mode 100644
index 00000000000..cfaa0fd5bd3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/ValidationConsumer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/WellFormednessFilter.class b/libjava/classpath/lib/gnu/xml/pipeline/WellFormednessFilter.class
new file mode 100644
index 00000000000..9fe9cae42ab
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/WellFormednessFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/XIncludeFilter$Scrubber.class b/libjava/classpath/lib/gnu/xml/pipeline/XIncludeFilter$Scrubber.class
new file mode 100644
index 00000000000..0905ebdba07
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/XIncludeFilter$Scrubber.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/XIncludeFilter.class b/libjava/classpath/lib/gnu/xml/pipeline/XIncludeFilter.class
new file mode 100644
index 00000000000..8e76a74d40e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/XIncludeFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/pipeline/XsltFilter.class b/libjava/classpath/lib/gnu/xml/pipeline/XsltFilter.class
new file mode 100644
index 00000000000..6209a5b8f26
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/pipeline/XsltFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/AttributeImpl.class b/libjava/classpath/lib/gnu/xml/stream/AttributeImpl.class
new file mode 100644
index 00000000000..b3ebe4577dc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/AttributeImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/BufferedReader.class b/libjava/classpath/lib/gnu/xml/stream/BufferedReader.class
new file mode 100644
index 00000000000..aba98124f50
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/BufferedReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/CRLFReader.class b/libjava/classpath/lib/gnu/xml/stream/CRLFReader.class
new file mode 100644
index 00000000000..d0d1f16f274
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/CRLFReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/CharactersImpl.class b/libjava/classpath/lib/gnu/xml/stream/CharactersImpl.class
new file mode 100644
index 00000000000..915b3be491c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/CharactersImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/CommentImpl.class b/libjava/classpath/lib/gnu/xml/stream/CommentImpl.class
new file mode 100644
index 00000000000..0122df27a2b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/CommentImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/DTDImpl.class b/libjava/classpath/lib/gnu/xml/stream/DTDImpl.class
new file mode 100644
index 00000000000..e2487a5d006
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/DTDImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/EndDocumentImpl.class b/libjava/classpath/lib/gnu/xml/stream/EndDocumentImpl.class
new file mode 100644
index 00000000000..d017cf68b59
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/EndDocumentImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/EndElementImpl.class b/libjava/classpath/lib/gnu/xml/stream/EndElementImpl.class
new file mode 100644
index 00000000000..b7278bba827
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/EndElementImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/EntityDeclarationImpl.class b/libjava/classpath/lib/gnu/xml/stream/EntityDeclarationImpl.class
new file mode 100644
index 00000000000..a04e1348a2e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/EntityDeclarationImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/EntityReferenceImpl.class b/libjava/classpath/lib/gnu/xml/stream/EntityReferenceImpl.class
new file mode 100644
index 00000000000..d2c136a4038
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/EntityReferenceImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/FilteredEventReader.class b/libjava/classpath/lib/gnu/xml/stream/FilteredEventReader.class
new file mode 100644
index 00000000000..1fbee1aa2f9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/FilteredEventReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/FilteredStreamReader.class b/libjava/classpath/lib/gnu/xml/stream/FilteredStreamReader.class
new file mode 100644
index 00000000000..52af9eb1d38
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/FilteredStreamReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/NamespaceImpl.class b/libjava/classpath/lib/gnu/xml/stream/NamespaceImpl.class
new file mode 100644
index 00000000000..dc1e8a43861
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/NamespaceImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/NotationDeclarationImpl.class b/libjava/classpath/lib/gnu/xml/stream/NotationDeclarationImpl.class
new file mode 100644
index 00000000000..5dfe9b63aee
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/NotationDeclarationImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/ProcessingInstructionImpl.class b/libjava/classpath/lib/gnu/xml/stream/ProcessingInstructionImpl.class
new file mode 100644
index 00000000000..c22ae475079
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/ProcessingInstructionImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/SAXParser.class b/libjava/classpath/lib/gnu/xml/stream/SAXParser.class
new file mode 100644
index 00000000000..10d7f073197
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/SAXParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/SAXParserFactory.class b/libjava/classpath/lib/gnu/xml/stream/SAXParserFactory.class
new file mode 100644
index 00000000000..5013c5be9f0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/SAXParserFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/StartDocumentImpl.class b/libjava/classpath/lib/gnu/xml/stream/StartDocumentImpl.class
new file mode 100644
index 00000000000..46074a86be8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/StartDocumentImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/StartElementImpl.class b/libjava/classpath/lib/gnu/xml/stream/StartElementImpl.class
new file mode 100644
index 00000000000..05783549f56
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/StartElementImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/UnicodeReader.class b/libjava/classpath/lib/gnu/xml/stream/UnicodeReader.class
new file mode 100644
index 00000000000..75aa1182070
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/UnicodeReader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XIncludeFilter.class b/libjava/classpath/lib/gnu/xml/stream/XIncludeFilter.class
new file mode 100644
index 00000000000..f659aa6cad5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XIncludeFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLEventAllocatorImpl.class b/libjava/classpath/lib/gnu/xml/stream/XMLEventAllocatorImpl.class
new file mode 100644
index 00000000000..1a19a8f4a2a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLEventAllocatorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLEventFactoryImpl.class b/libjava/classpath/lib/gnu/xml/stream/XMLEventFactoryImpl.class
new file mode 100644
index 00000000000..b6336683457
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLEventFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLEventImpl.class b/libjava/classpath/lib/gnu/xml/stream/XMLEventImpl.class
new file mode 100644
index 00000000000..187ee4f6e27
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLEventImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLEventReaderImpl.class b/libjava/classpath/lib/gnu/xml/stream/XMLEventReaderImpl.class
new file mode 100644
index 00000000000..bcc1376e172
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLEventReaderImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLEventWriterImpl.class b/libjava/classpath/lib/gnu/xml/stream/XMLEventWriterImpl.class
new file mode 100644
index 00000000000..9efa1e25116
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLEventWriterImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLInputFactoryImpl.class b/libjava/classpath/lib/gnu/xml/stream/XMLInputFactoryImpl.class
new file mode 100644
index 00000000000..5e8c60a8014
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLInputFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLOutputFactoryImpl.class b/libjava/classpath/lib/gnu/xml/stream/XMLOutputFactoryImpl.class
new file mode 100644
index 00000000000..62f20e369e3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLOutputFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLParser$AnyContentModel.class b/libjava/classpath/lib/gnu/xml/stream/XMLParser$AnyContentModel.class
new file mode 100644
index 00000000000..df7b43baf03
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLParser$AnyContentModel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLParser$Attribute.class b/libjava/classpath/lib/gnu/xml/stream/XMLParser$Attribute.class
new file mode 100644
index 00000000000..b3457c54270
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLParser$Attribute.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLParser$AttributeDecl.class b/libjava/classpath/lib/gnu/xml/stream/XMLParser$AttributeDecl.class
new file mode 100644
index 00000000000..8ca9de327de
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLParser$AttributeDecl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLParser$ContentModel.class b/libjava/classpath/lib/gnu/xml/stream/XMLParser$ContentModel.class
new file mode 100644
index 00000000000..95921cf64b5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLParser$ContentModel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLParser$ContentParticle.class b/libjava/classpath/lib/gnu/xml/stream/XMLParser$ContentParticle.class
new file mode 100644
index 00000000000..d6189eb3a47
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLParser$ContentParticle.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLParser$Doctype.class b/libjava/classpath/lib/gnu/xml/stream/XMLParser$Doctype.class
new file mode 100644
index 00000000000..405545d9604
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLParser$Doctype.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLParser$ElementContentModel.class b/libjava/classpath/lib/gnu/xml/stream/XMLParser$ElementContentModel.class
new file mode 100644
index 00000000000..30d2626e86f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLParser$ElementContentModel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLParser$EmptyContentModel.class b/libjava/classpath/lib/gnu/xml/stream/XMLParser$EmptyContentModel.class
new file mode 100644
index 00000000000..fcfaca7a49e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLParser$EmptyContentModel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLParser$ExternalIds.class b/libjava/classpath/lib/gnu/xml/stream/XMLParser$ExternalIds.class
new file mode 100644
index 00000000000..e1a134fdba4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLParser$ExternalIds.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLParser$Input.class b/libjava/classpath/lib/gnu/xml/stream/XMLParser$Input.class
new file mode 100644
index 00000000000..ddd6c4c2abf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLParser$Input.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLParser$MixedContentModel.class b/libjava/classpath/lib/gnu/xml/stream/XMLParser$MixedContentModel.class
new file mode 100644
index 00000000000..63bc30f3a03
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLParser$MixedContentModel.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLParser.class b/libjava/classpath/lib/gnu/xml/stream/XMLParser.class
new file mode 100644
index 00000000000..54792a1be55
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/stream/XMLStreamWriterImpl.class b/libjava/classpath/lib/gnu/xml/stream/XMLStreamWriterImpl.class
new file mode 100644
index 00000000000..de4a722c113
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/stream/XMLStreamWriterImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/AbstractNumberNode.class b/libjava/classpath/lib/gnu/xml/transform/AbstractNumberNode.class
new file mode 100644
index 00000000000..6a14d1be698
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/AbstractNumberNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/ApplyImportsNode.class b/libjava/classpath/lib/gnu/xml/transform/ApplyImportsNode.class
new file mode 100644
index 00000000000..551bfc93d3a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/ApplyImportsNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/ApplyTemplatesNode.class b/libjava/classpath/lib/gnu/xml/transform/ApplyTemplatesNode.class
new file mode 100644
index 00000000000..bb84b9ed7bb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/ApplyTemplatesNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/AttributeNode.class b/libjava/classpath/lib/gnu/xml/transform/AttributeNode.class
new file mode 100644
index 00000000000..a73cf7ee874
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/AttributeNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/AttributeSet.class b/libjava/classpath/lib/gnu/xml/transform/AttributeSet.class
new file mode 100644
index 00000000000..fbdd9abb1b8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/AttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/Bindings.class b/libjava/classpath/lib/gnu/xml/transform/Bindings.class
new file mode 100644
index 00000000000..bc75bd80e69
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/Bindings.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/CallTemplateNode.class b/libjava/classpath/lib/gnu/xml/transform/CallTemplateNode.class
new file mode 100644
index 00000000000..af045b2c671
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/CallTemplateNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/ChooseNode.class b/libjava/classpath/lib/gnu/xml/transform/ChooseNode.class
new file mode 100644
index 00000000000..fa8495e5fd6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/ChooseNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/CommentNode.class b/libjava/classpath/lib/gnu/xml/transform/CommentNode.class
new file mode 100644
index 00000000000..601e8fdbcb4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/CommentNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/CopyNode.class b/libjava/classpath/lib/gnu/xml/transform/CopyNode.class
new file mode 100644
index 00000000000..c74f384beeb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/CopyNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/CopyOfNode.class b/libjava/classpath/lib/gnu/xml/transform/CopyOfNode.class
new file mode 100644
index 00000000000..e15bc898a51
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/CopyOfNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/CurrentFunction.class b/libjava/classpath/lib/gnu/xml/transform/CurrentFunction.class
new file mode 100644
index 00000000000..8fb1b608d20
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/CurrentFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/DOMSourceLocator.class b/libjava/classpath/lib/gnu/xml/transform/DOMSourceLocator.class
new file mode 100644
index 00000000000..a52c3608669
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/DOMSourceLocator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/DocumentFunction.class b/libjava/classpath/lib/gnu/xml/transform/DocumentFunction.class
new file mode 100644
index 00000000000..a4797a838c1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/DocumentFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/ElementAvailableFunction.class b/libjava/classpath/lib/gnu/xml/transform/ElementAvailableFunction.class
new file mode 100644
index 00000000000..98e0bb87bd3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/ElementAvailableFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/ElementNode.class b/libjava/classpath/lib/gnu/xml/transform/ElementNode.class
new file mode 100644
index 00000000000..b6f5f4ae90e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/ElementNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/ErrorListenerErrorHandler.class b/libjava/classpath/lib/gnu/xml/transform/ErrorListenerErrorHandler.class
new file mode 100644
index 00000000000..2cf13cb72ed
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/ErrorListenerErrorHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/ForEachNode.class b/libjava/classpath/lib/gnu/xml/transform/ForEachNode.class
new file mode 100644
index 00000000000..1ba63386b77
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/ForEachNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/FormatNumberFunction.class b/libjava/classpath/lib/gnu/xml/transform/FormatNumberFunction.class
new file mode 100644
index 00000000000..02e8c1cd282
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/FormatNumberFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/FunctionAvailableFunction.class b/libjava/classpath/lib/gnu/xml/transform/FunctionAvailableFunction.class
new file mode 100644
index 00000000000..f73e2a5fbf6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/FunctionAvailableFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/GenerateIdFunction.class b/libjava/classpath/lib/gnu/xml/transform/GenerateIdFunction.class
new file mode 100644
index 00000000000..d843772f094
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/GenerateIdFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/IfNode.class b/libjava/classpath/lib/gnu/xml/transform/IfNode.class
new file mode 100644
index 00000000000..4abd1d272a0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/IfNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/Key.class b/libjava/classpath/lib/gnu/xml/transform/Key.class
new file mode 100644
index 00000000000..a4c12046394
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/Key.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/KeyFunction.class b/libjava/classpath/lib/gnu/xml/transform/KeyFunction.class
new file mode 100644
index 00000000000..f8057652c93
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/KeyFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/LiteralNode.class b/libjava/classpath/lib/gnu/xml/transform/LiteralNode.class
new file mode 100644
index 00000000000..5c7c1e8e712
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/LiteralNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/MessageNode.class b/libjava/classpath/lib/gnu/xml/transform/MessageNode.class
new file mode 100644
index 00000000000..b07186678db
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/MessageNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/NamespaceProxy.class b/libjava/classpath/lib/gnu/xml/transform/NamespaceProxy.class
new file mode 100644
index 00000000000..bfde993d73d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/NamespaceProxy.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/NodeNumberNode.class b/libjava/classpath/lib/gnu/xml/transform/NodeNumberNode.class
new file mode 100644
index 00000000000..eaf5e4a9cd3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/NodeNumberNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/NumberNode.class b/libjava/classpath/lib/gnu/xml/transform/NumberNode.class
new file mode 100644
index 00000000000..1f2a9c79df5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/NumberNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/OtherwiseNode.class b/libjava/classpath/lib/gnu/xml/transform/OtherwiseNode.class
new file mode 100644
index 00000000000..f6daf9e52ae
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/OtherwiseNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/ParameterNode.class b/libjava/classpath/lib/gnu/xml/transform/ParameterNode.class
new file mode 100644
index 00000000000..7352637c78f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/ParameterNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/ProcessingInstructionNode.class b/libjava/classpath/lib/gnu/xml/transform/ProcessingInstructionNode.class
new file mode 100644
index 00000000000..9ce2b35e6bd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/ProcessingInstructionNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/SAXSerializer.class b/libjava/classpath/lib/gnu/xml/transform/SAXSerializer.class
new file mode 100644
index 00000000000..46a63395c04
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/SAXSerializer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/SAXTemplatesHandler.class b/libjava/classpath/lib/gnu/xml/transform/SAXTemplatesHandler.class
new file mode 100644
index 00000000000..9264e76cf53
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/SAXTemplatesHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/SAXTransformerHandler.class b/libjava/classpath/lib/gnu/xml/transform/SAXTransformerHandler.class
new file mode 100644
index 00000000000..2a70ca1b6db
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/SAXTransformerHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/SortKey.class b/libjava/classpath/lib/gnu/xml/transform/SortKey.class
new file mode 100644
index 00000000000..dbcaf406225
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/SortKey.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/StreamSerializer.class b/libjava/classpath/lib/gnu/xml/transform/StreamSerializer.class
new file mode 100644
index 00000000000..cc3e5b80d20
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/StreamSerializer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/StrippingInstruction.class b/libjava/classpath/lib/gnu/xml/transform/StrippingInstruction.class
new file mode 100644
index 00000000000..6bf335d8200
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/StrippingInstruction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/Stylesheet.class b/libjava/classpath/lib/gnu/xml/transform/Stylesheet.class
new file mode 100644
index 00000000000..595eccd76af
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/Stylesheet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/SystemPropertyFunction.class b/libjava/classpath/lib/gnu/xml/transform/SystemPropertyFunction.class
new file mode 100644
index 00000000000..ba2ba8cad79
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/SystemPropertyFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/Template.class b/libjava/classpath/lib/gnu/xml/transform/Template.class
new file mode 100644
index 00000000000..693eab11c74
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/Template.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/TemplateNode.class b/libjava/classpath/lib/gnu/xml/transform/TemplateNode.class
new file mode 100644
index 00000000000..507c38f0d28
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/TemplateNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/TemplatesImpl.class b/libjava/classpath/lib/gnu/xml/transform/TemplatesImpl.class
new file mode 100644
index 00000000000..34e0f74af36
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/TemplatesImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/TextNode.class b/libjava/classpath/lib/gnu/xml/transform/TextNode.class
new file mode 100644
index 00000000000..dcea7b96ef5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/TextNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/TransformerFactoryImpl.class b/libjava/classpath/lib/gnu/xml/transform/TransformerFactoryImpl.class
new file mode 100644
index 00000000000..b7470cf85a8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/TransformerFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/TransformerImpl.class b/libjava/classpath/lib/gnu/xml/transform/TransformerImpl.class
new file mode 100644
index 00000000000..55db4fe5ba1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/TransformerImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/TransformerOutputProperties.class b/libjava/classpath/lib/gnu/xml/transform/TransformerOutputProperties.class
new file mode 100644
index 00000000000..f8a20b8adf4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/TransformerOutputProperties.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/URIResolverEntityResolver.class b/libjava/classpath/lib/gnu/xml/transform/URIResolverEntityResolver.class
new file mode 100644
index 00000000000..c69728c49a8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/URIResolverEntityResolver.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/UnparsedEntityUriFunction.class b/libjava/classpath/lib/gnu/xml/transform/UnparsedEntityUriFunction.class
new file mode 100644
index 00000000000..470c75c99fc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/UnparsedEntityUriFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/ValueOfNode.class b/libjava/classpath/lib/gnu/xml/transform/ValueOfNode.class
new file mode 100644
index 00000000000..d583dcfd35e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/ValueOfNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/WhenNode.class b/libjava/classpath/lib/gnu/xml/transform/WhenNode.class
new file mode 100644
index 00000000000..fccfca9b54e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/WhenNode.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/WithParam.class b/libjava/classpath/lib/gnu/xml/transform/WithParam.class
new file mode 100644
index 00000000000..788a08467bb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/WithParam.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/XSLComparator.class b/libjava/classpath/lib/gnu/xml/transform/XSLComparator.class
new file mode 100644
index 00000000000..554411177be
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/XSLComparator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/transform/XSLURIResolver.class b/libjava/classpath/lib/gnu/xml/transform/XSLURIResolver.class
new file mode 100644
index 00000000000..5fc53be4fd5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/transform/XSLURIResolver.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/DoParse$MyErrorHandler.class b/libjava/classpath/lib/gnu/xml/util/DoParse$MyErrorHandler.class
new file mode 100644
index 00000000000..eb178d755fb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/DoParse$MyErrorHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/DoParse.class b/libjava/classpath/lib/gnu/xml/util/DoParse.class
new file mode 100644
index 00000000000..7f87a146613
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/DoParse.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/DomParser.class b/libjava/classpath/lib/gnu/xml/util/DomParser.class
new file mode 100644
index 00000000000..6a42fea2371
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/DomParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/Resolver.class b/libjava/classpath/lib/gnu/xml/util/Resolver.class
new file mode 100644
index 00000000000..67f58619204
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/Resolver.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$DomHandler.class b/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$DomHandler.class
new file mode 100644
index 00000000000..2d27b394094
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$DomHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$DomTerminus.class b/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$DomTerminus.class
new file mode 100644
index 00000000000..a1c13cc6aa9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$DomTerminus.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$ListenerAdapter.class b/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$ListenerAdapter.class
new file mode 100644
index 00000000000..84517f3e8db
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$ListenerAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$LocatorAdapter.class b/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$LocatorAdapter.class
new file mode 100644
index 00000000000..7ae3a25f3e5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$LocatorAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$NullHandler.class b/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$NullHandler.class
new file mode 100644
index 00000000000..9f46375356d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$NullHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$NullTransformer.class b/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$NullTransformer.class
new file mode 100644
index 00000000000..3f7845cd836
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory$NullTransformer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory.class b/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory.class
new file mode 100644
index 00000000000..8e43b6c5e37
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/SAXNullTransformerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/XCat$Catalog.class b/libjava/classpath/lib/gnu/xml/util/XCat$Catalog.class
new file mode 100644
index 00000000000..6ffce36b358
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/XCat$Catalog.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/XCat$DoneDelegation.class b/libjava/classpath/lib/gnu/xml/util/XCat$DoneDelegation.class
new file mode 100644
index 00000000000..3d8b904cbc5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/XCat$DoneDelegation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/XCat$Loader.class b/libjava/classpath/lib/gnu/xml/util/XCat$Loader.class
new file mode 100644
index 00000000000..5c55575b1a4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/XCat$Loader.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/XCat.class b/libjava/classpath/lib/gnu/xml/util/XCat.class
new file mode 100644
index 00000000000..9e1af09ac3d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/XCat.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/XHTMLWriter.class b/libjava/classpath/lib/gnu/xml/util/XHTMLWriter.class
new file mode 100644
index 00000000000..717eb4f39d0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/XHTMLWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/util/XMLWriter.class b/libjava/classpath/lib/gnu/xml/util/XMLWriter.class
new file mode 100644
index 00000000000..65ac2d0eb62
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/util/XMLWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/Annotation.class b/libjava/classpath/lib/gnu/xml/validation/datatype/Annotation.class
new file mode 100644
index 00000000000..155ce7dd990
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/Annotation.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/AnySimpleType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/AnySimpleType.class
new file mode 100644
index 00000000000..2a2088e8601
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/AnySimpleType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/AnyType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/AnyType.class
new file mode 100644
index 00000000000..4d8dea99939
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/AnyType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/AnyURIType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/AnyURIType.class
new file mode 100644
index 00000000000..46e6aef3c41
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/AnyURIType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/AtomicSimpleType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/AtomicSimpleType.class
new file mode 100644
index 00000000000..acc196e01f4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/AtomicSimpleType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/Base64BinaryType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/Base64BinaryType.class
new file mode 100644
index 00000000000..65a8ec99432
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/Base64BinaryType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/BooleanType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/BooleanType.class
new file mode 100644
index 00000000000..321f8973df0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/BooleanType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/ByteType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/ByteType.class
new file mode 100644
index 00000000000..d9d58a25a5b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/ByteType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/DateTimeType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/DateTimeType.class
new file mode 100644
index 00000000000..8537c0394a9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/DateTimeType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/DateType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/DateType.class
new file mode 100644
index 00000000000..8e2aba55a59
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/DateType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/DecimalType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/DecimalType.class
new file mode 100644
index 00000000000..ea1d9f4d280
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/DecimalType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/DoubleType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/DoubleType.class
new file mode 100644
index 00000000000..371fe616877
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/DoubleType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/DurationType$Duration.class b/libjava/classpath/lib/gnu/xml/validation/datatype/DurationType$Duration.class
new file mode 100644
index 00000000000..6fceee19587
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/DurationType$Duration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/DurationType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/DurationType.class
new file mode 100644
index 00000000000..8103c76bee2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/DurationType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/EntitiesType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/EntitiesType.class
new file mode 100644
index 00000000000..26034eef8e1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/EntitiesType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/EntityType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/EntityType.class
new file mode 100644
index 00000000000..3f3dbf93422
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/EntityType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/EnumerationFacet.class b/libjava/classpath/lib/gnu/xml/validation/datatype/EnumerationFacet.class
new file mode 100644
index 00000000000..64f07fd2f61
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/EnumerationFacet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/Facet.class b/libjava/classpath/lib/gnu/xml/validation/datatype/Facet.class
new file mode 100644
index 00000000000..3032a8003e3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/Facet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/FloatType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/FloatType.class
new file mode 100644
index 00000000000..39741ba75cc
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/FloatType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/FractionDigitsFacet.class b/libjava/classpath/lib/gnu/xml/validation/datatype/FractionDigitsFacet.class
new file mode 100644
index 00000000000..683ffd4ebd0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/FractionDigitsFacet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/GDayType$GDay.class b/libjava/classpath/lib/gnu/xml/validation/datatype/GDayType$GDay.class
new file mode 100644
index 00000000000..e64eded39c4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/GDayType$GDay.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/GDayType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/GDayType.class
new file mode 100644
index 00000000000..fb39e466e70
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/GDayType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/GMonthDayType$GMonthDay.class b/libjava/classpath/lib/gnu/xml/validation/datatype/GMonthDayType$GMonthDay.class
new file mode 100644
index 00000000000..3b9cf6ee68b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/GMonthDayType$GMonthDay.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/GMonthDayType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/GMonthDayType.class
new file mode 100644
index 00000000000..80001ae83b2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/GMonthDayType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/GMonthType$GMonth.class b/libjava/classpath/lib/gnu/xml/validation/datatype/GMonthType$GMonth.class
new file mode 100644
index 00000000000..12e7280be0e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/GMonthType$GMonth.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/GMonthType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/GMonthType.class
new file mode 100644
index 00000000000..b9d0b89a94b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/GMonthType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/GYearMonthType$GYearMonth.class b/libjava/classpath/lib/gnu/xml/validation/datatype/GYearMonthType$GYearMonth.class
new file mode 100644
index 00000000000..ea64e7c4664
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/GYearMonthType$GYearMonth.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/GYearMonthType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/GYearMonthType.class
new file mode 100644
index 00000000000..bc4606d9fe1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/GYearMonthType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/GYearType$GYear.class b/libjava/classpath/lib/gnu/xml/validation/datatype/GYearType$GYear.class
new file mode 100644
index 00000000000..586112b08a2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/GYearType$GYear.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/GYearType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/GYearType.class
new file mode 100644
index 00000000000..17c15342912
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/GYearType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/HexBinaryType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/HexBinaryType.class
new file mode 100644
index 00000000000..9ff9248e6ef
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/HexBinaryType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/IDRefType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/IDRefType.class
new file mode 100644
index 00000000000..d18c802d280
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/IDRefType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/IDRefsType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/IDRefsType.class
new file mode 100644
index 00000000000..84caeeda571
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/IDRefsType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/IDType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/IDType.class
new file mode 100644
index 00000000000..cc0b69b7479
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/IDType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/IntType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/IntType.class
new file mode 100644
index 00000000000..e3a0fa55a91
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/IntType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/IntegerType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/IntegerType.class
new file mode 100644
index 00000000000..2efe2068ed1
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/IntegerType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/LanguageType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/LanguageType.class
new file mode 100644
index 00000000000..0ba7112e55d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/LanguageType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/LengthFacet.class b/libjava/classpath/lib/gnu/xml/validation/datatype/LengthFacet.class
new file mode 100644
index 00000000000..ad35403df56
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/LengthFacet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/ListSimpleType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/ListSimpleType.class
new file mode 100644
index 00000000000..17366313e06
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/ListSimpleType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/LongType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/LongType.class
new file mode 100644
index 00000000000..ef1b1bbe949
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/LongType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/MaxExclusiveFacet.class b/libjava/classpath/lib/gnu/xml/validation/datatype/MaxExclusiveFacet.class
new file mode 100644
index 00000000000..d0df8875f23
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/MaxExclusiveFacet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/MaxInclusiveFacet.class b/libjava/classpath/lib/gnu/xml/validation/datatype/MaxInclusiveFacet.class
new file mode 100644
index 00000000000..ec68c3a66f5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/MaxInclusiveFacet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/MaxLengthFacet.class b/libjava/classpath/lib/gnu/xml/validation/datatype/MaxLengthFacet.class
new file mode 100644
index 00000000000..bb9969d6d39
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/MaxLengthFacet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/MinExclusiveFacet.class b/libjava/classpath/lib/gnu/xml/validation/datatype/MinExclusiveFacet.class
new file mode 100644
index 00000000000..3d5671496c2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/MinExclusiveFacet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/MinInclusiveFacet.class b/libjava/classpath/lib/gnu/xml/validation/datatype/MinInclusiveFacet.class
new file mode 100644
index 00000000000..bb77abf6542
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/MinInclusiveFacet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/MinLengthFacet.class b/libjava/classpath/lib/gnu/xml/validation/datatype/MinLengthFacet.class
new file mode 100644
index 00000000000..49fdb410b23
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/MinLengthFacet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/NCNameType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/NCNameType.class
new file mode 100644
index 00000000000..de7aa264096
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/NCNameType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/NMTokenType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/NMTokenType.class
new file mode 100644
index 00000000000..e741b06c3a7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/NMTokenType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/NMTokensType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/NMTokensType.class
new file mode 100644
index 00000000000..f0a0dffd706
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/NMTokensType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/NameType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/NameType.class
new file mode 100644
index 00000000000..c06c6f14972
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/NameType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/NegativeIntegerType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/NegativeIntegerType.class
new file mode 100644
index 00000000000..c6f5fba4a3d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/NegativeIntegerType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/NonNegativeIntegerType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/NonNegativeIntegerType.class
new file mode 100644
index 00000000000..d262b84ae1b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/NonNegativeIntegerType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/NonPositiveIntegerType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/NonPositiveIntegerType.class
new file mode 100644
index 00000000000..a3b9b762722
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/NonPositiveIntegerType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/NormalizedStringType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/NormalizedStringType.class
new file mode 100644
index 00000000000..4cf49a60240
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/NormalizedStringType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/NotationType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/NotationType.class
new file mode 100644
index 00000000000..bea3e1e0218
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/NotationType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/PatternFacet.class b/libjava/classpath/lib/gnu/xml/validation/datatype/PatternFacet.class
new file mode 100644
index 00000000000..2ac44071b2d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/PatternFacet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/PositiveIntegerType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/PositiveIntegerType.class
new file mode 100644
index 00000000000..9d4f2a83e28
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/PositiveIntegerType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/QNameType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/QNameType.class
new file mode 100644
index 00000000000..0d6e5832a0d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/QNameType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/ShortType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/ShortType.class
new file mode 100644
index 00000000000..000e6e84613
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/ShortType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/SimpleType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/SimpleType.class
new file mode 100644
index 00000000000..7151477bf5e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/SimpleType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/StringType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/StringType.class
new file mode 100644
index 00000000000..35cf9412357
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/StringType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/TimeType$Time.class b/libjava/classpath/lib/gnu/xml/validation/datatype/TimeType$Time.class
new file mode 100644
index 00000000000..008e0729a63
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/TimeType$Time.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/TimeType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/TimeType.class
new file mode 100644
index 00000000000..522aa1acefe
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/TimeType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/TokenType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/TokenType.class
new file mode 100644
index 00000000000..03c3846295d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/TokenType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/TotalDigitsFacet.class b/libjava/classpath/lib/gnu/xml/validation/datatype/TotalDigitsFacet.class
new file mode 100644
index 00000000000..569d3583938
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/TotalDigitsFacet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/Type.class b/libjava/classpath/lib/gnu/xml/validation/datatype/Type.class
new file mode 100644
index 00000000000..637eb4f2500
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/Type.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/TypeBuilder.class b/libjava/classpath/lib/gnu/xml/validation/datatype/TypeBuilder.class
new file mode 100644
index 00000000000..6c9ee2a353e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/TypeBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/TypeLibrary.class b/libjava/classpath/lib/gnu/xml/validation/datatype/TypeLibrary.class
new file mode 100644
index 00000000000..37f6f8383c2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/TypeLibrary.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/TypeLibraryFactory.class b/libjava/classpath/lib/gnu/xml/validation/datatype/TypeLibraryFactory.class
new file mode 100644
index 00000000000..90fc6357d77
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/TypeLibraryFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/UnionSimpleType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/UnionSimpleType.class
new file mode 100644
index 00000000000..958b266ea3e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/UnionSimpleType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedByteType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedByteType.class
new file mode 100644
index 00000000000..d839b1e684c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedByteType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedIntType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedIntType.class
new file mode 100644
index 00000000000..12b0317169c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedIntType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedLongType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedLongType.class
new file mode 100644
index 00000000000..4264205e699
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedLongType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedShortType.class b/libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedShortType.class
new file mode 100644
index 00000000000..a6bf3ddade0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/UnsignedShortType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/datatype/WhiteSpaceFacet.class b/libjava/classpath/lib/gnu/xml/validation/datatype/WhiteSpaceFacet.class
new file mode 100644
index 00000000000..a8e452ff8e3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/datatype/WhiteSpaceFacet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/AnyNameNameClass.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/AnyNameNameClass.class
new file mode 100644
index 00000000000..64cd6ac1b9c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/AnyNameNameClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/AttributePattern.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/AttributePattern.class
new file mode 100644
index 00000000000..7e83bd124a7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/AttributePattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/ChoiceNameClass.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/ChoiceNameClass.class
new file mode 100644
index 00000000000..81ec7af80db
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/ChoiceNameClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/ChoicePattern.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/ChoicePattern.class
new file mode 100644
index 00000000000..91b170ff262
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/ChoicePattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/DataPattern.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/DataPattern.class
new file mode 100644
index 00000000000..1fda20dc748
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/DataPattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/Define.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/Define.class
new file mode 100644
index 00000000000..41fee5eff5a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/Define.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/ElementPattern.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/ElementPattern.class
new file mode 100644
index 00000000000..d351d4c0d60
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/ElementPattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/EmptyPattern.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/EmptyPattern.class
new file mode 100644
index 00000000000..53ced659dcf
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/EmptyPattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/FullSyntaxBuilder.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/FullSyntaxBuilder.class
new file mode 100644
index 00000000000..879ead3a456
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/FullSyntaxBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/Grammar.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/Grammar.class
new file mode 100644
index 00000000000..26630a9710f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/Grammar.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/GrammarException.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/GrammarException.class
new file mode 100644
index 00000000000..7ee2e47e2d5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/GrammarException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/GrammarValidator.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/GrammarValidator.class
new file mode 100644
index 00000000000..a7ba34f578d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/GrammarValidator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/GroupPattern.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/GroupPattern.class
new file mode 100644
index 00000000000..4593becd067
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/GroupPattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/InterleavePattern.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/InterleavePattern.class
new file mode 100644
index 00000000000..ee085010dc9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/InterleavePattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/ListPattern.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/ListPattern.class
new file mode 100644
index 00000000000..563ea50583e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/ListPattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/NSNameNameClass.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/NSNameNameClass.class
new file mode 100644
index 00000000000..44526e8f873
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/NSNameNameClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/NameClass.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/NameClass.class
new file mode 100644
index 00000000000..9f68a9f83be
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/NameClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/NameNameClass.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/NameNameClass.class
new file mode 100644
index 00000000000..8508269730e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/NameNameClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/NotAllowedPattern.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/NotAllowedPattern.class
new file mode 100644
index 00000000000..de7c1fdde94
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/NotAllowedPattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/OneOrMorePattern.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/OneOrMorePattern.class
new file mode 100644
index 00000000000..a551b439860
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/OneOrMorePattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/Param.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/Param.class
new file mode 100644
index 00000000000..339ab0963ad
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/Param.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/Pattern.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/Pattern.class
new file mode 100644
index 00000000000..8c4fa5331b8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/Pattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/RELAXNGSchemaFactory.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/RELAXNGSchemaFactory.class
new file mode 100644
index 00000000000..9baf00beac7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/RELAXNGSchemaFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/RefPattern.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/RefPattern.class
new file mode 100644
index 00000000000..bc1088a01fa
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/RefPattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/TextPattern.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/TextPattern.class
new file mode 100644
index 00000000000..4cf2b89a3b8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/TextPattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/relaxng/ValuePattern.class b/libjava/classpath/lib/gnu/xml/validation/relaxng/ValuePattern.class
new file mode 100644
index 00000000000..f27bc0dddce
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/relaxng/ValuePattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/AnyAttribute.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/AnyAttribute.class
new file mode 100644
index 00000000000..3b05d7e2c2b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/AnyAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/AttributeDeclaration.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/AttributeDeclaration.class
new file mode 100644
index 00000000000..55d207a0892
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/AttributeDeclaration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/AttributeUse.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/AttributeUse.class
new file mode 100644
index 00000000000..5df4ffda546
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/AttributeUse.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/ComplexType.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/ComplexType.class
new file mode 100644
index 00000000000..1249a43af09
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/ComplexType.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/ElementDeclaration.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/ElementDeclaration.class
new file mode 100644
index 00000000000..d56b4b83a93
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/ElementDeclaration.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/Particle.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/Particle.class
new file mode 100644
index 00000000000..cd48e71059e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/Particle.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/ValidationException.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/ValidationException.class
new file mode 100644
index 00000000000..f09a79ca306
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/ValidationException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchema.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchema.class
new file mode 100644
index 00000000000..393f3f2c3df
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchema.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaAttributeTypeInfo.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaAttributeTypeInfo.class
new file mode 100644
index 00000000000..e3294ea9b69
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaAttributeTypeInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaBuilder.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaBuilder.class
new file mode 100644
index 00000000000..04a824ba9c0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaElementTypeInfo.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaElementTypeInfo.class
new file mode 100644
index 00000000000..a5c892cbf50
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaElementTypeInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaSchemaFactory.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaSchemaFactory.class
new file mode 100644
index 00000000000..60ac110b7c2
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaSchemaFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaTypeInfo.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaTypeInfo.class
new file mode 100644
index 00000000000..edcc6149575
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaTypeInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaTypeInfoProvider.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaTypeInfoProvider.class
new file mode 100644
index 00000000000..7a457b6669c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaTypeInfoProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaValidator.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaValidator.class
new file mode 100644
index 00000000000..823a554e09c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaValidator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaValidatorHandler.class b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaValidatorHandler.class
new file mode 100644
index 00000000000..da9085fab52
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/validation/xmlschema/XMLSchemaValidatorHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/AndExpr.class b/libjava/classpath/lib/gnu/xml/xpath/AndExpr.class
new file mode 100644
index 00000000000..42a921f32ce
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/AndExpr.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/ArithmeticExpr.class b/libjava/classpath/lib/gnu/xml/xpath/ArithmeticExpr.class
new file mode 100644
index 00000000000..de7f2fcb684
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/ArithmeticExpr.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/BooleanFunction.class b/libjava/classpath/lib/gnu/xml/xpath/BooleanFunction.class
new file mode 100644
index 00000000000..960604c8314
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/BooleanFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/CeilingFunction.class b/libjava/classpath/lib/gnu/xml/xpath/CeilingFunction.class
new file mode 100644
index 00000000000..361d12464db
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/CeilingFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/ConcatFunction.class b/libjava/classpath/lib/gnu/xml/xpath/ConcatFunction.class
new file mode 100644
index 00000000000..4c706a233c0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/ConcatFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/Constant.class b/libjava/classpath/lib/gnu/xml/xpath/Constant.class
new file mode 100644
index 00000000000..f3e58753adb
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/Constant.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/ContainsFunction.class b/libjava/classpath/lib/gnu/xml/xpath/ContainsFunction.class
new file mode 100644
index 00000000000..5fb6023a045
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/ContainsFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/CountFunction.class b/libjava/classpath/lib/gnu/xml/xpath/CountFunction.class
new file mode 100644
index 00000000000..fad78cae443
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/CountFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/DocumentOrderComparator.class b/libjava/classpath/lib/gnu/xml/xpath/DocumentOrderComparator.class
new file mode 100644
index 00000000000..8b375856f4d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/DocumentOrderComparator.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/EqualityExpr.class b/libjava/classpath/lib/gnu/xml/xpath/EqualityExpr.class
new file mode 100644
index 00000000000..fb3075b1939
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/EqualityExpr.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/Expr$ExprNodeSet.class b/libjava/classpath/lib/gnu/xml/xpath/Expr$ExprNodeSet.class
new file mode 100644
index 00000000000..ebf27e41d19
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/Expr$ExprNodeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/Expr.class b/libjava/classpath/lib/gnu/xml/xpath/Expr.class
new file mode 100644
index 00000000000..cc1e8c7c22a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/Expr.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/FalseFunction.class b/libjava/classpath/lib/gnu/xml/xpath/FalseFunction.class
new file mode 100644
index 00000000000..5c950ab1cc6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/FalseFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/FloorFunction.class b/libjava/classpath/lib/gnu/xml/xpath/FloorFunction.class
new file mode 100644
index 00000000000..e630680de5c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/FloorFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/Function.class b/libjava/classpath/lib/gnu/xml/xpath/Function.class
new file mode 100644
index 00000000000..eb4c96e1c39
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/Function.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/FunctionCall.class b/libjava/classpath/lib/gnu/xml/xpath/FunctionCall.class
new file mode 100644
index 00000000000..e78249cf237
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/FunctionCall.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/IdFunction.class b/libjava/classpath/lib/gnu/xml/xpath/IdFunction.class
new file mode 100644
index 00000000000..701fe7e5d19
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/IdFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/LangFunction.class b/libjava/classpath/lib/gnu/xml/xpath/LangFunction.class
new file mode 100644
index 00000000000..454957c4487
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/LangFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/LastFunction.class b/libjava/classpath/lib/gnu/xml/xpath/LastFunction.class
new file mode 100644
index 00000000000..37765a7324a
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/LastFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/LocalNameFunction.class b/libjava/classpath/lib/gnu/xml/xpath/LocalNameFunction.class
new file mode 100644
index 00000000000..3e5d22afd6c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/LocalNameFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/NameFunction.class b/libjava/classpath/lib/gnu/xml/xpath/NameFunction.class
new file mode 100644
index 00000000000..ae556d205b7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/NameFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/NameTest.class b/libjava/classpath/lib/gnu/xml/xpath/NameTest.class
new file mode 100644
index 00000000000..7786e0bd9b7
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/NameTest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/NamespaceTest.class b/libjava/classpath/lib/gnu/xml/xpath/NamespaceTest.class
new file mode 100644
index 00000000000..dc83c9834d3
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/NamespaceTest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/NamespaceUriFunction.class b/libjava/classpath/lib/gnu/xml/xpath/NamespaceUriFunction.class
new file mode 100644
index 00000000000..d143bfd8dd0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/NamespaceUriFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/NegativeExpr.class b/libjava/classpath/lib/gnu/xml/xpath/NegativeExpr.class
new file mode 100644
index 00000000000..486a7ecbb1e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/NegativeExpr.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/NodeTypeTest.class b/libjava/classpath/lib/gnu/xml/xpath/NodeTypeTest.class
new file mode 100644
index 00000000000..19dd1e7824f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/NodeTypeTest.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/NormalizeSpaceFunction.class b/libjava/classpath/lib/gnu/xml/xpath/NormalizeSpaceFunction.class
new file mode 100644
index 00000000000..8077365c42e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/NormalizeSpaceFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/NotFunction.class b/libjava/classpath/lib/gnu/xml/xpath/NotFunction.class
new file mode 100644
index 00000000000..a62c05e9646
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/NotFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/NumberFunction.class b/libjava/classpath/lib/gnu/xml/xpath/NumberFunction.class
new file mode 100644
index 00000000000..49843d274dd
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/NumberFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/OrExpr.class b/libjava/classpath/lib/gnu/xml/xpath/OrExpr.class
new file mode 100644
index 00000000000..f693efc63d4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/OrExpr.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/ParenthesizedExpr.class b/libjava/classpath/lib/gnu/xml/xpath/ParenthesizedExpr.class
new file mode 100644
index 00000000000..3204f7ab7ac
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/ParenthesizedExpr.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/Path.class b/libjava/classpath/lib/gnu/xml/xpath/Path.class
new file mode 100644
index 00000000000..9dfbb9f3557
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/Path.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/Pattern.class b/libjava/classpath/lib/gnu/xml/xpath/Pattern.class
new file mode 100644
index 00000000000..a4e620f6ac0
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/Pattern.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/PositionFunction.class b/libjava/classpath/lib/gnu/xml/xpath/PositionFunction.class
new file mode 100644
index 00000000000..a3332267dea
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/PositionFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/Predicate.class b/libjava/classpath/lib/gnu/xml/xpath/Predicate.class
new file mode 100644
index 00000000000..3dd2338f206
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/Predicate.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/RelationalExpr.class b/libjava/classpath/lib/gnu/xml/xpath/RelationalExpr.class
new file mode 100644
index 00000000000..e1534ca8840
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/RelationalExpr.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/Root.class b/libjava/classpath/lib/gnu/xml/xpath/Root.class
new file mode 100644
index 00000000000..f72433e704e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/Root.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/RoundFunction.class b/libjava/classpath/lib/gnu/xml/xpath/RoundFunction.class
new file mode 100644
index 00000000000..69af4c9bc7e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/RoundFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/Selector.class b/libjava/classpath/lib/gnu/xml/xpath/Selector.class
new file mode 100644
index 00000000000..d31e58ca0ee
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/Selector.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/StartsWithFunction.class b/libjava/classpath/lib/gnu/xml/xpath/StartsWithFunction.class
new file mode 100644
index 00000000000..e44af9f17ba
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/StartsWithFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/Steps.class b/libjava/classpath/lib/gnu/xml/xpath/Steps.class
new file mode 100644
index 00000000000..e2feed64d04
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/Steps.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/StringFunction.class b/libjava/classpath/lib/gnu/xml/xpath/StringFunction.class
new file mode 100644
index 00000000000..de96161567b
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/StringFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/StringLengthFunction.class b/libjava/classpath/lib/gnu/xml/xpath/StringLengthFunction.class
new file mode 100644
index 00000000000..ef7032bd1d9
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/StringLengthFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/SubstringAfterFunction.class b/libjava/classpath/lib/gnu/xml/xpath/SubstringAfterFunction.class
new file mode 100644
index 00000000000..df689d64aad
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/SubstringAfterFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/SubstringBeforeFunction.class b/libjava/classpath/lib/gnu/xml/xpath/SubstringBeforeFunction.class
new file mode 100644
index 00000000000..ccbe7c5fd93
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/SubstringBeforeFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/SubstringFunction.class b/libjava/classpath/lib/gnu/xml/xpath/SubstringFunction.class
new file mode 100644
index 00000000000..53746375c65
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/SubstringFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/SumFunction.class b/libjava/classpath/lib/gnu/xml/xpath/SumFunction.class
new file mode 100644
index 00000000000..e4fbcbea6c6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/SumFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/Test.class b/libjava/classpath/lib/gnu/xml/xpath/Test.class
new file mode 100644
index 00000000000..40eaeafb152
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/Test.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/TranslateFunction.class b/libjava/classpath/lib/gnu/xml/xpath/TranslateFunction.class
new file mode 100644
index 00000000000..afbe0b2d2a5
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/TranslateFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/TrueFunction.class b/libjava/classpath/lib/gnu/xml/xpath/TrueFunction.class
new file mode 100644
index 00000000000..00b08371877
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/TrueFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/UnionExpr.class b/libjava/classpath/lib/gnu/xml/xpath/UnionExpr.class
new file mode 100644
index 00000000000..1d0f4c3be0f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/UnionExpr.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/VariableReference.class b/libjava/classpath/lib/gnu/xml/xpath/VariableReference.class
new file mode 100644
index 00000000000..43e13e0153d
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/VariableReference.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathFactoryImpl.class b/libjava/classpath/lib/gnu/xml/xpath/XPathFactoryImpl.class
new file mode 100644
index 00000000000..09d426b7341
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathFactoryImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathImpl.class b/libjava/classpath/lib/gnu/xml/xpath/XPathImpl.class
new file mode 100644
index 00000000000..7da93cc9a7e
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyCheckClass.class b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyCheckClass.class
new file mode 100644
index 00000000000..8be1bbc8d92
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyCheckClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyDefRedClass.class b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyDefRedClass.class
new file mode 100644
index 00000000000..1fe427dbd35
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyDefRedClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyDgotoClass.class b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyDgotoClass.class
new file mode 100644
index 00000000000..eb13d8206b4
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyDgotoClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyGindexClass.class b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyGindexClass.class
new file mode 100644
index 00000000000..ae12af85ade
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyGindexClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyLenClass.class b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyLenClass.class
new file mode 100644
index 00000000000..563f40d74a6
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyLenClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyLhsClass.class b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyLhsClass.class
new file mode 100644
index 00000000000..61bb72ccb69
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyLhsClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyNameClass.class b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyNameClass.class
new file mode 100644
index 00000000000..345c33c482f
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyNameClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyRindexClass.class b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyRindexClass.class
new file mode 100644
index 00000000000..c1d94e25537
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyRindexClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YySindexClass.class b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YySindexClass.class
new file mode 100644
index 00000000000..1ac22ce4858
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YySindexClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyTableClass.class b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyTableClass.class
new file mode 100644
index 00000000000..66abc5a9871
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$YyTableClass.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathParser$yyException.class b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$yyException.class
new file mode 100644
index 00000000000..11453366a5c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$yyException.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathParser$yyInput.class b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$yyInput.class
new file mode 100644
index 00000000000..7b672736d12
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathParser$yyInput.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathParser.class b/libjava/classpath/lib/gnu/xml/xpath/XPathParser.class
new file mode 100644
index 00000000000..b93bf0af60c
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathParser.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathTokenizer$XPathToken.class b/libjava/classpath/lib/gnu/xml/xpath/XPathTokenizer$XPathToken.class
new file mode 100644
index 00000000000..00854233319
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathTokenizer$XPathToken.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/xml/xpath/XPathTokenizer.class b/libjava/classpath/lib/gnu/xml/xpath/XPathTokenizer.class
new file mode 100644
index 00000000000..1f6743cbbe8
--- /dev/null
+++ b/libjava/classpath/lib/gnu/xml/xpath/XPathTokenizer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/applet/Applet$AccessibleApplet.class b/libjava/classpath/lib/java/applet/Applet$AccessibleApplet.class
new file mode 100644
index 00000000000..941060f307d
--- /dev/null
+++ b/libjava/classpath/lib/java/applet/Applet$AccessibleApplet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/applet/Applet$URLAudioClip.class b/libjava/classpath/lib/java/applet/Applet$URLAudioClip.class
new file mode 100644
index 00000000000..e402a4a14bd
--- /dev/null
+++ b/libjava/classpath/lib/java/applet/Applet$URLAudioClip.class
Binary files differ
diff --git a/libjava/classpath/lib/java/applet/Applet.class b/libjava/classpath/lib/java/applet/Applet.class
new file mode 100644
index 00000000000..f698f174783
--- /dev/null
+++ b/libjava/classpath/lib/java/applet/Applet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/applet/AppletContext.class b/libjava/classpath/lib/java/applet/AppletContext.class
new file mode 100644
index 00000000000..4e3e677c1c8
--- /dev/null
+++ b/libjava/classpath/lib/java/applet/AppletContext.class
Binary files differ
diff --git a/libjava/classpath/lib/java/applet/AppletStub.class b/libjava/classpath/lib/java/applet/AppletStub.class
new file mode 100644
index 00000000000..95622ca5ebf
--- /dev/null
+++ b/libjava/classpath/lib/java/applet/AppletStub.class
Binary files differ
diff --git a/libjava/classpath/lib/java/applet/AudioClip.class b/libjava/classpath/lib/java/applet/AudioClip.class
new file mode 100644
index 00000000000..5a337f100be
--- /dev/null
+++ b/libjava/classpath/lib/java/applet/AudioClip.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/AWTError.class b/libjava/classpath/lib/java/awt/AWTError.class
new file mode 100644
index 00000000000..1c2c2d68360
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/AWTError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/AWTEvent.class b/libjava/classpath/lib/java/awt/AWTEvent.class
new file mode 100644
index 00000000000..c48dbf1ad43
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/AWTEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/AWTEventMulticaster.class b/libjava/classpath/lib/java/awt/AWTEventMulticaster.class
new file mode 100644
index 00000000000..1e543de2941
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/AWTEventMulticaster.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/AWTException.class b/libjava/classpath/lib/java/awt/AWTException.class
new file mode 100644
index 00000000000..65a5c73c244
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/AWTException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/AWTKeyStroke$1.class b/libjava/classpath/lib/java/awt/AWTKeyStroke$1.class
new file mode 100644
index 00000000000..b82323aeaf1
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/AWTKeyStroke$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/AWTKeyStroke$2.class b/libjava/classpath/lib/java/awt/AWTKeyStroke$2.class
new file mode 100644
index 00000000000..a23cf24f820
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/AWTKeyStroke$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/AWTKeyStroke$3.class b/libjava/classpath/lib/java/awt/AWTKeyStroke$3.class
new file mode 100644
index 00000000000..c6e66864b19
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/AWTKeyStroke$3.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/AWTKeyStroke.class b/libjava/classpath/lib/java/awt/AWTKeyStroke.class
new file mode 100644
index 00000000000..5695cda2d17
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/AWTKeyStroke.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/AWTPermission.class b/libjava/classpath/lib/java/awt/AWTPermission.class
new file mode 100644
index 00000000000..40d3e029d8f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/AWTPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/ActiveEvent.class b/libjava/classpath/lib/java/awt/ActiveEvent.class
new file mode 100644
index 00000000000..759557aa292
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/ActiveEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Adjustable.class b/libjava/classpath/lib/java/awt/Adjustable.class
new file mode 100644
index 00000000000..64d46c13b49
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Adjustable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/AlphaComposite$1.class b/libjava/classpath/lib/java/awt/AlphaComposite$1.class
new file mode 100644
index 00000000000..4587a1736f7
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/AlphaComposite$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/AlphaComposite.class b/libjava/classpath/lib/java/awt/AlphaComposite.class
new file mode 100644
index 00000000000..78eba385519
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/AlphaComposite.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/AttributeValue.class b/libjava/classpath/lib/java/awt/AttributeValue.class
new file mode 100644
index 00000000000..43d074d0558
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/AttributeValue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/BasicStroke.class b/libjava/classpath/lib/java/awt/BasicStroke.class
new file mode 100644
index 00000000000..560647171aa
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/BasicStroke.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/BorderLayout.class b/libjava/classpath/lib/java/awt/BorderLayout.class
new file mode 100644
index 00000000000..0a076d342ee
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/BorderLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/BufferCapabilities$FlipContents.class b/libjava/classpath/lib/java/awt/BufferCapabilities$FlipContents.class
new file mode 100644
index 00000000000..80d0199048d
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/BufferCapabilities$FlipContents.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/BufferCapabilities.class b/libjava/classpath/lib/java/awt/BufferCapabilities.class
new file mode 100644
index 00000000000..e0a4b670c68
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/BufferCapabilities.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Button$AccessibleAWTButton.class b/libjava/classpath/lib/java/awt/Button$AccessibleAWTButton.class
new file mode 100644
index 00000000000..bba52b1be95
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Button$AccessibleAWTButton.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Button.class b/libjava/classpath/lib/java/awt/Button.class
new file mode 100644
index 00000000000..1acfc276f01
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Button.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Canvas$AccessibleAWTCanvas.class b/libjava/classpath/lib/java/awt/Canvas$AccessibleAWTCanvas.class
new file mode 100644
index 00000000000..0a1b1b59c2d
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Canvas$AccessibleAWTCanvas.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Canvas$CanvasBltBufferStrategy.class b/libjava/classpath/lib/java/awt/Canvas$CanvasBltBufferStrategy.class
new file mode 100644
index 00000000000..b2536002266
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Canvas$CanvasBltBufferStrategy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Canvas$CanvasFlipBufferStrategy.class b/libjava/classpath/lib/java/awt/Canvas$CanvasFlipBufferStrategy.class
new file mode 100644
index 00000000000..122ed3ab179
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Canvas$CanvasFlipBufferStrategy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Canvas.class b/libjava/classpath/lib/java/awt/Canvas.class
new file mode 100644
index 00000000000..e10c2e82e41
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Canvas.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/CardLayout.class b/libjava/classpath/lib/java/awt/CardLayout.class
new file mode 100644
index 00000000000..15b2e95e5e7
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/CardLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Checkbox$AccessibleAWTCheckbox.class b/libjava/classpath/lib/java/awt/Checkbox$AccessibleAWTCheckbox.class
new file mode 100644
index 00000000000..eaff0a1d38d
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Checkbox$AccessibleAWTCheckbox.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Checkbox.class b/libjava/classpath/lib/java/awt/Checkbox.class
new file mode 100644
index 00000000000..a1dad185e3c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Checkbox.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/CheckboxGroup.class b/libjava/classpath/lib/java/awt/CheckboxGroup.class
new file mode 100644
index 00000000000..d3318dc4946
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/CheckboxGroup.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/CheckboxMenuItem$AccessibleAWTCheckboxMenuItem.class b/libjava/classpath/lib/java/awt/CheckboxMenuItem$AccessibleAWTCheckboxMenuItem.class
new file mode 100644
index 00000000000..b9249c1f48a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/CheckboxMenuItem$AccessibleAWTCheckboxMenuItem.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/CheckboxMenuItem.class b/libjava/classpath/lib/java/awt/CheckboxMenuItem.class
new file mode 100644
index 00000000000..e4428250812
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/CheckboxMenuItem.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Choice$AccessibleAWTChoice.class b/libjava/classpath/lib/java/awt/Choice$AccessibleAWTChoice.class
new file mode 100644
index 00000000000..fa4121af6c8
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Choice$AccessibleAWTChoice.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Choice.class b/libjava/classpath/lib/java/awt/Choice.class
new file mode 100644
index 00000000000..a790c17c7f7
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Choice.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Color.class b/libjava/classpath/lib/java/awt/Color.class
new file mode 100644
index 00000000000..68857ce01aa
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Color.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/ColorPaintContext$ColorRaster.class b/libjava/classpath/lib/java/awt/ColorPaintContext$ColorRaster.class
new file mode 100644
index 00000000000..677693124da
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/ColorPaintContext$ColorRaster.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/ColorPaintContext.class b/libjava/classpath/lib/java/awt/ColorPaintContext.class
new file mode 100644
index 00000000000..f0637671bf3
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/ColorPaintContext.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Component$AccessibleAWTComponent$AccessibleAWTComponentHandler.class b/libjava/classpath/lib/java/awt/Component$AccessibleAWTComponent$AccessibleAWTComponentHandler.class
new file mode 100644
index 00000000000..938f39d68a4
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Component$AccessibleAWTComponent$AccessibleAWTComponentHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Component$AccessibleAWTComponent$AccessibleAWTFocusHandler.class b/libjava/classpath/lib/java/awt/Component$AccessibleAWTComponent$AccessibleAWTFocusHandler.class
new file mode 100644
index 00000000000..530ca77bf01
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Component$AccessibleAWTComponent$AccessibleAWTFocusHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Component$AccessibleAWTComponent.class b/libjava/classpath/lib/java/awt/Component$AccessibleAWTComponent.class
new file mode 100644
index 00000000000..96ce9797bf4
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Component$AccessibleAWTComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Component$BltBufferStrategy.class b/libjava/classpath/lib/java/awt/Component$BltBufferStrategy.class
new file mode 100644
index 00000000000..2701fffcf9f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Component$BltBufferStrategy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Component$FlipBufferStrategy.class b/libjava/classpath/lib/java/awt/Component$FlipBufferStrategy.class
new file mode 100644
index 00000000000..0fefc2186dc
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Component$FlipBufferStrategy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Component$HeavyweightInLightweightListener.class b/libjava/classpath/lib/java/awt/Component$HeavyweightInLightweightListener.class
new file mode 100644
index 00000000000..633d9af77bf
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Component$HeavyweightInLightweightListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Component.class b/libjava/classpath/lib/java/awt/Component.class
new file mode 100644
index 00000000000..0533b9c697d
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Component.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/ComponentOrientation.class b/libjava/classpath/lib/java/awt/ComponentOrientation.class
new file mode 100644
index 00000000000..37defe8d013
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/ComponentOrientation.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Composite.class b/libjava/classpath/lib/java/awt/Composite.class
new file mode 100644
index 00000000000..76e23ac1370
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Composite.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/CompositeContext.class b/libjava/classpath/lib/java/awt/CompositeContext.class
new file mode 100644
index 00000000000..e6c4c26e2b4
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/CompositeContext.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Container$AccessibleAWTContainer$AccessibleContainerHandler.class b/libjava/classpath/lib/java/awt/Container$AccessibleAWTContainer$AccessibleContainerHandler.class
new file mode 100644
index 00000000000..a07e427861d
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Container$AccessibleAWTContainer$AccessibleContainerHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Container$AccessibleAWTContainer.class b/libjava/classpath/lib/java/awt/Container$AccessibleAWTContainer.class
new file mode 100644
index 00000000000..1e8cf52b670
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Container$AccessibleAWTContainer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Container$GfxPaintAllVisitor.class b/libjava/classpath/lib/java/awt/Container$GfxPaintAllVisitor.class
new file mode 100644
index 00000000000..0d36436ecd8
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Container$GfxPaintAllVisitor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Container$GfxPaintVisitor.class b/libjava/classpath/lib/java/awt/Container$GfxPaintVisitor.class
new file mode 100644
index 00000000000..1098464e2d3
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Container$GfxPaintVisitor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Container$GfxPrintAllVisitor.class b/libjava/classpath/lib/java/awt/Container$GfxPrintAllVisitor.class
new file mode 100644
index 00000000000..504e985c722
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Container$GfxPrintAllVisitor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Container$GfxPrintVisitor.class b/libjava/classpath/lib/java/awt/Container$GfxPrintVisitor.class
new file mode 100644
index 00000000000..d054e5e9a94
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Container$GfxPrintVisitor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Container$GfxVisitor.class b/libjava/classpath/lib/java/awt/Container$GfxVisitor.class
new file mode 100644
index 00000000000..f9f85ae5215
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Container$GfxVisitor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Container.class b/libjava/classpath/lib/java/awt/Container.class
new file mode 100644
index 00000000000..12cc33e95c6
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Container.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/ContainerOrderFocusTraversalPolicy.class b/libjava/classpath/lib/java/awt/ContainerOrderFocusTraversalPolicy.class
new file mode 100644
index 00000000000..b5b42caa5e9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/ContainerOrderFocusTraversalPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Cursor.class b/libjava/classpath/lib/java/awt/Cursor.class
new file mode 100644
index 00000000000..72aff9a81ca
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Cursor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/DefaultFocusTraversalPolicy.class b/libjava/classpath/lib/java/awt/DefaultFocusTraversalPolicy.class
new file mode 100644
index 00000000000..f366cbe3510
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/DefaultFocusTraversalPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/DefaultKeyboardFocusManager$EventDelayRequest.class b/libjava/classpath/lib/java/awt/DefaultKeyboardFocusManager$EventDelayRequest.class
new file mode 100644
index 00000000000..45f07b9d465
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/DefaultKeyboardFocusManager$EventDelayRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/DefaultKeyboardFocusManager.class b/libjava/classpath/lib/java/awt/DefaultKeyboardFocusManager.class
new file mode 100644
index 00000000000..a4ca603f344
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/DefaultKeyboardFocusManager.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Dialog$AccessibleAWTDialog.class b/libjava/classpath/lib/java/awt/Dialog$AccessibleAWTDialog.class
new file mode 100644
index 00000000000..fd490883058
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Dialog$AccessibleAWTDialog.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Dialog.class b/libjava/classpath/lib/java/awt/Dialog.class
new file mode 100644
index 00000000000..dd13eb4bab9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Dialog.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Dimension.class b/libjava/classpath/lib/java/awt/Dimension.class
new file mode 100644
index 00000000000..ea55474ec13
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Dimension.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/DisplayMode.class b/libjava/classpath/lib/java/awt/DisplayMode.class
new file mode 100644
index 00000000000..17358a5917f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/DisplayMode.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Event.class b/libjava/classpath/lib/java/awt/Event.class
new file mode 100644
index 00000000000..c6dd1c9985f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Event.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/EventDispatchThread.class b/libjava/classpath/lib/java/awt/EventDispatchThread.class
new file mode 100644
index 00000000000..3b891f26935
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/EventDispatchThread.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/EventQueue$Queue.class b/libjava/classpath/lib/java/awt/EventQueue$Queue.class
new file mode 100644
index 00000000000..580abceaf96
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/EventQueue$Queue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/EventQueue.class b/libjava/classpath/lib/java/awt/EventQueue.class
new file mode 100644
index 00000000000..51a92c34e5a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/EventQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/FileDialog.class b/libjava/classpath/lib/java/awt/FileDialog.class
new file mode 100644
index 00000000000..1587d0c5804
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/FileDialog.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/FlowLayout.class b/libjava/classpath/lib/java/awt/FlowLayout.class
new file mode 100644
index 00000000000..4ce2004612d
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/FlowLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/FocusTraversalPolicy.class b/libjava/classpath/lib/java/awt/FocusTraversalPolicy.class
new file mode 100644
index 00000000000..57fdf4b72f6
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/FocusTraversalPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Font.class b/libjava/classpath/lib/java/awt/Font.class
new file mode 100644
index 00000000000..c1f8b52e2f9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Font.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/FontFormatException.class b/libjava/classpath/lib/java/awt/FontFormatException.class
new file mode 100644
index 00000000000..19946fd6871
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/FontFormatException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/FontMetrics.class b/libjava/classpath/lib/java/awt/FontMetrics.class
new file mode 100644
index 00000000000..0b1e6dba9b7
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/FontMetrics.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Frame$AccessibleAWTFrame.class b/libjava/classpath/lib/java/awt/Frame$AccessibleAWTFrame.class
new file mode 100644
index 00000000000..9401dc3c189
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Frame$AccessibleAWTFrame.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Frame.class b/libjava/classpath/lib/java/awt/Frame.class
new file mode 100644
index 00000000000..c01f91ee7f4
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Frame.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/GradientPaint.class b/libjava/classpath/lib/java/awt/GradientPaint.class
new file mode 100644
index 00000000000..eba1d116fca
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/GradientPaint.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Graphics.class b/libjava/classpath/lib/java/awt/Graphics.class
new file mode 100644
index 00000000000..31b6c9071b7
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Graphics.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Graphics2D.class b/libjava/classpath/lib/java/awt/Graphics2D.class
new file mode 100644
index 00000000000..9dc56205be6
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Graphics2D.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/GraphicsConfigTemplate.class b/libjava/classpath/lib/java/awt/GraphicsConfigTemplate.class
new file mode 100644
index 00000000000..372b3b5decb
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/GraphicsConfigTemplate.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/GraphicsConfiguration.class b/libjava/classpath/lib/java/awt/GraphicsConfiguration.class
new file mode 100644
index 00000000000..2887c1bb551
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/GraphicsConfiguration.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/GraphicsDevice.class b/libjava/classpath/lib/java/awt/GraphicsDevice.class
new file mode 100644
index 00000000000..43b711e27ba
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/GraphicsDevice.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/GraphicsEnvironment.class b/libjava/classpath/lib/java/awt/GraphicsEnvironment.class
new file mode 100644
index 00000000000..27aa4c06fad
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/GraphicsEnvironment.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/GridBagConstraints.class b/libjava/classpath/lib/java/awt/GridBagConstraints.class
new file mode 100644
index 00000000000..4e042d74ce8
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/GridBagConstraints.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/GridBagLayout.class b/libjava/classpath/lib/java/awt/GridBagLayout.class
new file mode 100644
index 00000000000..2c406eb9978
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/GridBagLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/GridBagLayoutInfo.class b/libjava/classpath/lib/java/awt/GridBagLayoutInfo.class
new file mode 100644
index 00000000000..1d24218988d
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/GridBagLayoutInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/GridLayout.class b/libjava/classpath/lib/java/awt/GridLayout.class
new file mode 100644
index 00000000000..66b4ff692ed
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/GridLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/HeadlessException.class b/libjava/classpath/lib/java/awt/HeadlessException.class
new file mode 100644
index 00000000000..e51c1cccaa7
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/HeadlessException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/IllegalComponentStateException.class b/libjava/classpath/lib/java/awt/IllegalComponentStateException.class
new file mode 100644
index 00000000000..e54323b445c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/IllegalComponentStateException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Image.class b/libjava/classpath/lib/java/awt/Image.class
new file mode 100644
index 00000000000..1e5376f34f8
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Image.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/ImageCapabilities.class b/libjava/classpath/lib/java/awt/ImageCapabilities.class
new file mode 100644
index 00000000000..a44063289ee
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/ImageCapabilities.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Insets.class b/libjava/classpath/lib/java/awt/Insets.class
new file mode 100644
index 00000000000..82d22f105c1
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Insets.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/ItemSelectable.class b/libjava/classpath/lib/java/awt/ItemSelectable.class
new file mode 100644
index 00000000000..8c353f73383
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/ItemSelectable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/JobAttributes$DefaultSelectionType.class b/libjava/classpath/lib/java/awt/JobAttributes$DefaultSelectionType.class
new file mode 100644
index 00000000000..6f8e4779fa2
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/JobAttributes$DefaultSelectionType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/JobAttributes$DestinationType.class b/libjava/classpath/lib/java/awt/JobAttributes$DestinationType.class
new file mode 100644
index 00000000000..944d5ec8af5
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/JobAttributes$DestinationType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/JobAttributes$DialogType.class b/libjava/classpath/lib/java/awt/JobAttributes$DialogType.class
new file mode 100644
index 00000000000..0657d71262b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/JobAttributes$DialogType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/JobAttributes$MultipleDocumentHandlingType.class b/libjava/classpath/lib/java/awt/JobAttributes$MultipleDocumentHandlingType.class
new file mode 100644
index 00000000000..ede25d6102d
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/JobAttributes$MultipleDocumentHandlingType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/JobAttributes$SidesType.class b/libjava/classpath/lib/java/awt/JobAttributes$SidesType.class
new file mode 100644
index 00000000000..23984c1520c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/JobAttributes$SidesType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/JobAttributes.class b/libjava/classpath/lib/java/awt/JobAttributes.class
new file mode 100644
index 00000000000..7aec9160989
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/JobAttributes.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/KeyEventDispatcher.class b/libjava/classpath/lib/java/awt/KeyEventDispatcher.class
new file mode 100644
index 00000000000..ad98fb896bf
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/KeyEventDispatcher.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/KeyEventPostProcessor.class b/libjava/classpath/lib/java/awt/KeyEventPostProcessor.class
new file mode 100644
index 00000000000..acf6c6ded8d
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/KeyEventPostProcessor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/KeyboardFocusManager.class b/libjava/classpath/lib/java/awt/KeyboardFocusManager.class
new file mode 100644
index 00000000000..721cf56f637
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/KeyboardFocusManager.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Label$AccessibleAWTLabel.class b/libjava/classpath/lib/java/awt/Label$AccessibleAWTLabel.class
new file mode 100644
index 00000000000..9a85795de2a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Label$AccessibleAWTLabel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Label.class b/libjava/classpath/lib/java/awt/Label.class
new file mode 100644
index 00000000000..1c6f5a5a051
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Label.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/LayoutManager.class b/libjava/classpath/lib/java/awt/LayoutManager.class
new file mode 100644
index 00000000000..34b079f1542
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/LayoutManager.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/LayoutManager2.class b/libjava/classpath/lib/java/awt/LayoutManager2.class
new file mode 100644
index 00000000000..fc4ad498ce6
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/LayoutManager2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/LightweightDispatcher.class b/libjava/classpath/lib/java/awt/LightweightDispatcher.class
new file mode 100644
index 00000000000..f8377f8d877
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/LightweightDispatcher.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/List$AccessibleAWTList$AccessibleAWTListChild.class b/libjava/classpath/lib/java/awt/List$AccessibleAWTList$AccessibleAWTListChild.class
new file mode 100644
index 00000000000..e8079ba4474
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/List$AccessibleAWTList$AccessibleAWTListChild.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/List$AccessibleAWTList.class b/libjava/classpath/lib/java/awt/List$AccessibleAWTList.class
new file mode 100644
index 00000000000..35fda74954b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/List$AccessibleAWTList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/List.class b/libjava/classpath/lib/java/awt/List.class
new file mode 100644
index 00000000000..38022bf56d9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/List.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/MediaTracker$MediaEntry.class b/libjava/classpath/lib/java/awt/MediaTracker$MediaEntry.class
new file mode 100644
index 00000000000..2195d3b7fc8
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/MediaTracker$MediaEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/MediaTracker.class b/libjava/classpath/lib/java/awt/MediaTracker.class
new file mode 100644
index 00000000000..b85cda41340
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/MediaTracker.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Menu$AccessibleAWTMenu.class b/libjava/classpath/lib/java/awt/Menu$AccessibleAWTMenu.class
new file mode 100644
index 00000000000..a337003eccf
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Menu$AccessibleAWTMenu.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Menu.class b/libjava/classpath/lib/java/awt/Menu.class
new file mode 100644
index 00000000000..d228702a916
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Menu.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/MenuBar$AccessibleAWTMenuBar.class b/libjava/classpath/lib/java/awt/MenuBar$AccessibleAWTMenuBar.class
new file mode 100644
index 00000000000..8b9fbbcc453
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/MenuBar$AccessibleAWTMenuBar.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/MenuBar.class b/libjava/classpath/lib/java/awt/MenuBar.class
new file mode 100644
index 00000000000..46df50581c8
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/MenuBar.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/MenuComponent$AccessibleAWTMenuComponent.class b/libjava/classpath/lib/java/awt/MenuComponent$AccessibleAWTMenuComponent.class
new file mode 100644
index 00000000000..3c94d68691b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/MenuComponent$AccessibleAWTMenuComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/MenuComponent.class b/libjava/classpath/lib/java/awt/MenuComponent.class
new file mode 100644
index 00000000000..f0d98fca07d
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/MenuComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/MenuContainer.class b/libjava/classpath/lib/java/awt/MenuContainer.class
new file mode 100644
index 00000000000..fce0285dd70
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/MenuContainer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/MenuItem$AccessibleAWTMenuItem.class b/libjava/classpath/lib/java/awt/MenuItem$AccessibleAWTMenuItem.class
new file mode 100644
index 00000000000..d9014fe6448
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/MenuItem$AccessibleAWTMenuItem.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/MenuItem.class b/libjava/classpath/lib/java/awt/MenuItem.class
new file mode 100644
index 00000000000..fe5895291c1
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/MenuItem.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/MenuShortcut.class b/libjava/classpath/lib/java/awt/MenuShortcut.class
new file mode 100644
index 00000000000..44cbb58936c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/MenuShortcut.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/MouseInfo.class b/libjava/classpath/lib/java/awt/MouseInfo.class
new file mode 100644
index 00000000000..dd9eb3a962e
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/MouseInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/PageAttributes$ColorType.class b/libjava/classpath/lib/java/awt/PageAttributes$ColorType.class
new file mode 100644
index 00000000000..c7dfcd5fd97
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/PageAttributes$ColorType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/PageAttributes$MediaType.class b/libjava/classpath/lib/java/awt/PageAttributes$MediaType.class
new file mode 100644
index 00000000000..30f35d971d9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/PageAttributes$MediaType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/PageAttributes$OrientationRequestedType.class b/libjava/classpath/lib/java/awt/PageAttributes$OrientationRequestedType.class
new file mode 100644
index 00000000000..a79bceccccf
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/PageAttributes$OrientationRequestedType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/PageAttributes$OriginType.class b/libjava/classpath/lib/java/awt/PageAttributes$OriginType.class
new file mode 100644
index 00000000000..f98e92249d5
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/PageAttributes$OriginType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/PageAttributes$PrintQualityType.class b/libjava/classpath/lib/java/awt/PageAttributes$PrintQualityType.class
new file mode 100644
index 00000000000..338ca80a825
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/PageAttributes$PrintQualityType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/PageAttributes.class b/libjava/classpath/lib/java/awt/PageAttributes.class
new file mode 100644
index 00000000000..71691df5c67
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/PageAttributes.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Paint.class b/libjava/classpath/lib/java/awt/Paint.class
new file mode 100644
index 00000000000..500bf4c6de1
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Paint.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/PaintContext.class b/libjava/classpath/lib/java/awt/PaintContext.class
new file mode 100644
index 00000000000..e282250a341
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/PaintContext.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Panel$AccessibleAWTPanel.class b/libjava/classpath/lib/java/awt/Panel$AccessibleAWTPanel.class
new file mode 100644
index 00000000000..d5003c7c91e
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Panel$AccessibleAWTPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Panel.class b/libjava/classpath/lib/java/awt/Panel.class
new file mode 100644
index 00000000000..1351688437a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Panel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Point.class b/libjava/classpath/lib/java/awt/Point.class
new file mode 100644
index 00000000000..68f6f964fe2
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Point.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/PointerInfo.class b/libjava/classpath/lib/java/awt/PointerInfo.class
new file mode 100644
index 00000000000..b044a3985d5
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/PointerInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Polygon$1.class b/libjava/classpath/lib/java/awt/Polygon$1.class
new file mode 100644
index 00000000000..06849f1c367
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Polygon$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Polygon.class b/libjava/classpath/lib/java/awt/Polygon.class
new file mode 100644
index 00000000000..6425ac79e35
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Polygon.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/PopupMenu$AccessibleAWTPopupMenu.class b/libjava/classpath/lib/java/awt/PopupMenu$AccessibleAWTPopupMenu.class
new file mode 100644
index 00000000000..64f469e6f4f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/PopupMenu$AccessibleAWTPopupMenu.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/PopupMenu.class b/libjava/classpath/lib/java/awt/PopupMenu.class
new file mode 100644
index 00000000000..25d87dda163
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/PopupMenu.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/PrintGraphics.class b/libjava/classpath/lib/java/awt/PrintGraphics.class
new file mode 100644
index 00000000000..92853709ded
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/PrintGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/PrintJob.class b/libjava/classpath/lib/java/awt/PrintJob.class
new file mode 100644
index 00000000000..7f8b88f2908
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/PrintJob.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Rectangle.class b/libjava/classpath/lib/java/awt/Rectangle.class
new file mode 100644
index 00000000000..d9811065108
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Rectangle.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/RenderingHints$Key.class b/libjava/classpath/lib/java/awt/RenderingHints$Key.class
new file mode 100644
index 00000000000..f813f3c81aa
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/RenderingHints$Key.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/RenderingHints$KeyImpl.class b/libjava/classpath/lib/java/awt/RenderingHints$KeyImpl.class
new file mode 100644
index 00000000000..84e5bdb90ab
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/RenderingHints$KeyImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/RenderingHints.class b/libjava/classpath/lib/java/awt/RenderingHints.class
new file mode 100644
index 00000000000..7afce724d42
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/RenderingHints.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Robot$1.class b/libjava/classpath/lib/java/awt/Robot$1.class
new file mode 100644
index 00000000000..90fe05b0d66
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Robot$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Robot.class b/libjava/classpath/lib/java/awt/Robot.class
new file mode 100644
index 00000000000..d237b3a28a5
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Robot.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/ScrollPane$AccessibleAWTScrollPane.class b/libjava/classpath/lib/java/awt/ScrollPane$AccessibleAWTScrollPane.class
new file mode 100644
index 00000000000..8028ed5667a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/ScrollPane$AccessibleAWTScrollPane.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/ScrollPane.class b/libjava/classpath/lib/java/awt/ScrollPane.class
new file mode 100644
index 00000000000..ec4e3637b92
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/ScrollPane.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/ScrollPaneAdjustable.class b/libjava/classpath/lib/java/awt/ScrollPaneAdjustable.class
new file mode 100644
index 00000000000..61ee1732547
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/ScrollPaneAdjustable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Scrollbar$AccessibleAWTScrollBar.class b/libjava/classpath/lib/java/awt/Scrollbar$AccessibleAWTScrollBar.class
new file mode 100644
index 00000000000..9816ac27a5f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Scrollbar$AccessibleAWTScrollBar.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Scrollbar.class b/libjava/classpath/lib/java/awt/Scrollbar.class
new file mode 100644
index 00000000000..d6ad5bd8d08
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Scrollbar.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Shape.class b/libjava/classpath/lib/java/awt/Shape.class
new file mode 100644
index 00000000000..347e1609b73
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Shape.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Stroke.class b/libjava/classpath/lib/java/awt/Stroke.class
new file mode 100644
index 00000000000..27e2461f929
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Stroke.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/SystemColor.class b/libjava/classpath/lib/java/awt/SystemColor.class
new file mode 100644
index 00000000000..dedf23c1ba9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/SystemColor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/TextArea$AccessibleAWTTextArea.class b/libjava/classpath/lib/java/awt/TextArea$AccessibleAWTTextArea.class
new file mode 100644
index 00000000000..73aee8f1685
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/TextArea$AccessibleAWTTextArea.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/TextArea.class b/libjava/classpath/lib/java/awt/TextArea.class
new file mode 100644
index 00000000000..0729f1517df
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/TextArea.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/TextComponent$AccessibleAWTTextComponent.class b/libjava/classpath/lib/java/awt/TextComponent$AccessibleAWTTextComponent.class
new file mode 100644
index 00000000000..717c63720bc
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/TextComponent$AccessibleAWTTextComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/TextComponent.class b/libjava/classpath/lib/java/awt/TextComponent.class
new file mode 100644
index 00000000000..66928c35ede
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/TextComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/TextField$AccessibleAWTTextField.class b/libjava/classpath/lib/java/awt/TextField$AccessibleAWTTextField.class
new file mode 100644
index 00000000000..b73147dd7f3
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/TextField$AccessibleAWTTextField.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/TextField.class b/libjava/classpath/lib/java/awt/TextField.class
new file mode 100644
index 00000000000..f99e266949f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/TextField.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/TexturePaint.class b/libjava/classpath/lib/java/awt/TexturePaint.class
new file mode 100644
index 00000000000..83ff9e1b6d9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/TexturePaint.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Toolkit$1.class b/libjava/classpath/lib/java/awt/Toolkit$1.class
new file mode 100644
index 00000000000..74fdda086e5
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Toolkit$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Toolkit$2.class b/libjava/classpath/lib/java/awt/Toolkit$2.class
new file mode 100644
index 00000000000..a6fd5018360
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Toolkit$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Toolkit.class b/libjava/classpath/lib/java/awt/Toolkit.class
new file mode 100644
index 00000000000..1156a7835b6
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Toolkit.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Transparency.class b/libjava/classpath/lib/java/awt/Transparency.class
new file mode 100644
index 00000000000..aa13410ccff
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Transparency.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Window$AccessibleAWTWindow.class b/libjava/classpath/lib/java/awt/Window$AccessibleAWTWindow.class
new file mode 100644
index 00000000000..0bc97fd1d21
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Window$AccessibleAWTWindow.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Window$WindowBltBufferStrategy.class b/libjava/classpath/lib/java/awt/Window$WindowBltBufferStrategy.class
new file mode 100644
index 00000000000..03433e90fdf
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Window$WindowBltBufferStrategy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Window$WindowFlipBufferStrategy.class b/libjava/classpath/lib/java/awt/Window$WindowFlipBufferStrategy.class
new file mode 100644
index 00000000000..2f24d47d120
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Window$WindowFlipBufferStrategy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/Window.class b/libjava/classpath/lib/java/awt/Window.class
new file mode 100644
index 00000000000..dc4ba0d7698
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/Window.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/color/CMMException.class b/libjava/classpath/lib/java/awt/color/CMMException.class
new file mode 100644
index 00000000000..03ce7757263
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/color/CMMException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/color/ColorSpace.class b/libjava/classpath/lib/java/awt/color/ColorSpace.class
new file mode 100644
index 00000000000..7e6542bbbd8
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/color/ColorSpace.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/color/ICC_ColorSpace.class b/libjava/classpath/lib/java/awt/color/ICC_ColorSpace.class
new file mode 100644
index 00000000000..4dd5cf3ad7a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/color/ICC_ColorSpace.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/color/ICC_Profile.class b/libjava/classpath/lib/java/awt/color/ICC_Profile.class
new file mode 100644
index 00000000000..6e698a6a889
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/color/ICC_Profile.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/color/ICC_ProfileGray.class b/libjava/classpath/lib/java/awt/color/ICC_ProfileGray.class
new file mode 100644
index 00000000000..9cb948845b9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/color/ICC_ProfileGray.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/color/ICC_ProfileRGB.class b/libjava/classpath/lib/java/awt/color/ICC_ProfileRGB.class
new file mode 100644
index 00000000000..fb93875d713
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/color/ICC_ProfileRGB.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/color/ProfileDataException.class b/libjava/classpath/lib/java/awt/color/ProfileDataException.class
new file mode 100644
index 00000000000..81a5896d9e6
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/color/ProfileDataException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/datatransfer/Clipboard.class b/libjava/classpath/lib/java/awt/datatransfer/Clipboard.class
new file mode 100644
index 00000000000..f72038f74d6
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/datatransfer/Clipboard.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/datatransfer/ClipboardOwner.class b/libjava/classpath/lib/java/awt/datatransfer/ClipboardOwner.class
new file mode 100644
index 00000000000..fdbac55887e
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/datatransfer/ClipboardOwner.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/datatransfer/DataFlavor.class b/libjava/classpath/lib/java/awt/datatransfer/DataFlavor.class
new file mode 100644
index 00000000000..d324b362ff7
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/datatransfer/DataFlavor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/datatransfer/FlavorEvent.class b/libjava/classpath/lib/java/awt/datatransfer/FlavorEvent.class
new file mode 100644
index 00000000000..6104199288b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/datatransfer/FlavorEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/datatransfer/FlavorListener.class b/libjava/classpath/lib/java/awt/datatransfer/FlavorListener.class
new file mode 100644
index 00000000000..8a6d4f70a8b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/datatransfer/FlavorListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/datatransfer/FlavorMap.class b/libjava/classpath/lib/java/awt/datatransfer/FlavorMap.class
new file mode 100644
index 00000000000..283e1cd0660
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/datatransfer/FlavorMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/datatransfer/FlavorTable.class b/libjava/classpath/lib/java/awt/datatransfer/FlavorTable.class
new file mode 100644
index 00000000000..ec8e95df54b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/datatransfer/FlavorTable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/datatransfer/MimeType.class b/libjava/classpath/lib/java/awt/datatransfer/MimeType.class
new file mode 100644
index 00000000000..28d191278a3
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/datatransfer/MimeType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/datatransfer/MimeTypeParseException.class b/libjava/classpath/lib/java/awt/datatransfer/MimeTypeParseException.class
new file mode 100644
index 00000000000..69f24fa8b24
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/datatransfer/MimeTypeParseException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/datatransfer/StringSelection.class b/libjava/classpath/lib/java/awt/datatransfer/StringSelection.class
new file mode 100644
index 00000000000..278553e654e
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/datatransfer/StringSelection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/datatransfer/SystemFlavorMap.class b/libjava/classpath/lib/java/awt/datatransfer/SystemFlavorMap.class
new file mode 100644
index 00000000000..cfd7e14397c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/datatransfer/SystemFlavorMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/datatransfer/Transferable.class b/libjava/classpath/lib/java/awt/datatransfer/Transferable.class
new file mode 100644
index 00000000000..c0197554a10
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/datatransfer/Transferable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/datatransfer/UnsupportedFlavorException.class b/libjava/classpath/lib/java/awt/datatransfer/UnsupportedFlavorException.class
new file mode 100644
index 00000000000..5eddd5f15f2
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/datatransfer/UnsupportedFlavorException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/Autoscroll.class b/libjava/classpath/lib/java/awt/dnd/Autoscroll.class
new file mode 100644
index 00000000000..c4a7f7bb209
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/Autoscroll.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DnDConstants.class b/libjava/classpath/lib/java/awt/dnd/DnDConstants.class
new file mode 100644
index 00000000000..d62c7e410ae
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DnDConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DnDEventMulticaster.class b/libjava/classpath/lib/java/awt/dnd/DnDEventMulticaster.class
new file mode 100644
index 00000000000..b5189734567
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DnDEventMulticaster.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DragGestureEvent.class b/libjava/classpath/lib/java/awt/dnd/DragGestureEvent.class
new file mode 100644
index 00000000000..76158679c1b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DragGestureEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DragGestureListener.class b/libjava/classpath/lib/java/awt/dnd/DragGestureListener.class
new file mode 100644
index 00000000000..f1bf00b6d45
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DragGestureListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DragGestureRecognizer.class b/libjava/classpath/lib/java/awt/dnd/DragGestureRecognizer.class
new file mode 100644
index 00000000000..54c013e5b4f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DragGestureRecognizer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DragSource.class b/libjava/classpath/lib/java/awt/dnd/DragSource.class
new file mode 100644
index 00000000000..7feb64583bf
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DragSource.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DragSourceAdapter.class b/libjava/classpath/lib/java/awt/dnd/DragSourceAdapter.class
new file mode 100644
index 00000000000..b7fbf90b4bc
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DragSourceAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DragSourceContext.class b/libjava/classpath/lib/java/awt/dnd/DragSourceContext.class
new file mode 100644
index 00000000000..54642267290
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DragSourceContext.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DragSourceDragEvent.class b/libjava/classpath/lib/java/awt/dnd/DragSourceDragEvent.class
new file mode 100644
index 00000000000..3015a774e56
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DragSourceDragEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DragSourceDropEvent.class b/libjava/classpath/lib/java/awt/dnd/DragSourceDropEvent.class
new file mode 100644
index 00000000000..a7bc78a9086
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DragSourceDropEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DragSourceEvent.class b/libjava/classpath/lib/java/awt/dnd/DragSourceEvent.class
new file mode 100644
index 00000000000..ac3c1f68d60
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DragSourceEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DragSourceListener.class b/libjava/classpath/lib/java/awt/dnd/DragSourceListener.class
new file mode 100644
index 00000000000..209520b8121
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DragSourceListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DragSourceMotionListener.class b/libjava/classpath/lib/java/awt/dnd/DragSourceMotionListener.class
new file mode 100644
index 00000000000..9d606b48c6c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DragSourceMotionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DropTarget$DropTargetAutoScroller.class b/libjava/classpath/lib/java/awt/dnd/DropTarget$DropTargetAutoScroller.class
new file mode 100644
index 00000000000..ae9b26129bc
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DropTarget$DropTargetAutoScroller.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DropTarget.class b/libjava/classpath/lib/java/awt/dnd/DropTarget.class
new file mode 100644
index 00000000000..7b25c5b56c9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DropTarget.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DropTargetAdapter.class b/libjava/classpath/lib/java/awt/dnd/DropTargetAdapter.class
new file mode 100644
index 00000000000..4436ebcb67e
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DropTargetAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DropTargetContext$TransferableProxy.class b/libjava/classpath/lib/java/awt/dnd/DropTargetContext$TransferableProxy.class
new file mode 100644
index 00000000000..921235ed401
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DropTargetContext$TransferableProxy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DropTargetContext.class b/libjava/classpath/lib/java/awt/dnd/DropTargetContext.class
new file mode 100644
index 00000000000..048bf4eab1f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DropTargetContext.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DropTargetDragEvent.class b/libjava/classpath/lib/java/awt/dnd/DropTargetDragEvent.class
new file mode 100644
index 00000000000..220357182b7
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DropTargetDragEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DropTargetDropEvent.class b/libjava/classpath/lib/java/awt/dnd/DropTargetDropEvent.class
new file mode 100644
index 00000000000..210fba75833
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DropTargetDropEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DropTargetEvent.class b/libjava/classpath/lib/java/awt/dnd/DropTargetEvent.class
new file mode 100644
index 00000000000..7d7027c7b47
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DropTargetEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/DropTargetListener.class b/libjava/classpath/lib/java/awt/dnd/DropTargetListener.class
new file mode 100644
index 00000000000..97c74ba50c1
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/DropTargetListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/InvalidDnDOperationException.class b/libjava/classpath/lib/java/awt/dnd/InvalidDnDOperationException.class
new file mode 100644
index 00000000000..3cbfa7c6291
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/InvalidDnDOperationException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/MouseDragGestureRecognizer.class b/libjava/classpath/lib/java/awt/dnd/MouseDragGestureRecognizer.class
new file mode 100644
index 00000000000..0cde8b7ed71
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/MouseDragGestureRecognizer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/peer/DragSourceContextPeer.class b/libjava/classpath/lib/java/awt/dnd/peer/DragSourceContextPeer.class
new file mode 100644
index 00000000000..441d7d064f0
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/peer/DragSourceContextPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/peer/DropTargetContextPeer.class b/libjava/classpath/lib/java/awt/dnd/peer/DropTargetContextPeer.class
new file mode 100644
index 00000000000..ef6b334e32e
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/peer/DropTargetContextPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/dnd/peer/DropTargetPeer.class b/libjava/classpath/lib/java/awt/dnd/peer/DropTargetPeer.class
new file mode 100644
index 00000000000..895750c9833
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/dnd/peer/DropTargetPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/AWTEventListener.class b/libjava/classpath/lib/java/awt/event/AWTEventListener.class
new file mode 100644
index 00000000000..221d7748763
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/AWTEventListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/AWTEventListenerProxy.class b/libjava/classpath/lib/java/awt/event/AWTEventListenerProxy.class
new file mode 100644
index 00000000000..a6bfb77b084
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/AWTEventListenerProxy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/ActionEvent.class b/libjava/classpath/lib/java/awt/event/ActionEvent.class
new file mode 100644
index 00000000000..2fa8ea42b65
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/ActionEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/ActionListener.class b/libjava/classpath/lib/java/awt/event/ActionListener.class
new file mode 100644
index 00000000000..0471d3f3bb0
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/ActionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/AdjustmentEvent.class b/libjava/classpath/lib/java/awt/event/AdjustmentEvent.class
new file mode 100644
index 00000000000..70ce2f7fa37
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/AdjustmentEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/AdjustmentListener.class b/libjava/classpath/lib/java/awt/event/AdjustmentListener.class
new file mode 100644
index 00000000000..b4235947012
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/AdjustmentListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/ComponentAdapter.class b/libjava/classpath/lib/java/awt/event/ComponentAdapter.class
new file mode 100644
index 00000000000..72763f746f9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/ComponentAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/ComponentEvent.class b/libjava/classpath/lib/java/awt/event/ComponentEvent.class
new file mode 100644
index 00000000000..08c2ede9db8
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/ComponentEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/ComponentListener.class b/libjava/classpath/lib/java/awt/event/ComponentListener.class
new file mode 100644
index 00000000000..10c71883082
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/ComponentListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/ContainerAdapter.class b/libjava/classpath/lib/java/awt/event/ContainerAdapter.class
new file mode 100644
index 00000000000..5e17c40299b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/ContainerAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/ContainerEvent.class b/libjava/classpath/lib/java/awt/event/ContainerEvent.class
new file mode 100644
index 00000000000..ff071921053
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/ContainerEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/ContainerListener.class b/libjava/classpath/lib/java/awt/event/ContainerListener.class
new file mode 100644
index 00000000000..f8ccf49cf69
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/ContainerListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/FocusAdapter.class b/libjava/classpath/lib/java/awt/event/FocusAdapter.class
new file mode 100644
index 00000000000..3db720ef74a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/FocusAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/FocusEvent.class b/libjava/classpath/lib/java/awt/event/FocusEvent.class
new file mode 100644
index 00000000000..031122b758d
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/FocusEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/FocusListener.class b/libjava/classpath/lib/java/awt/event/FocusListener.class
new file mode 100644
index 00000000000..db8ff09d835
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/FocusListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/HierarchyBoundsAdapter.class b/libjava/classpath/lib/java/awt/event/HierarchyBoundsAdapter.class
new file mode 100644
index 00000000000..79aa2f93836
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/HierarchyBoundsAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/HierarchyBoundsListener.class b/libjava/classpath/lib/java/awt/event/HierarchyBoundsListener.class
new file mode 100644
index 00000000000..2642d35d4bd
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/HierarchyBoundsListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/HierarchyEvent.class b/libjava/classpath/lib/java/awt/event/HierarchyEvent.class
new file mode 100644
index 00000000000..b1efe7988ea
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/HierarchyEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/HierarchyListener.class b/libjava/classpath/lib/java/awt/event/HierarchyListener.class
new file mode 100644
index 00000000000..d6789af71e5
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/HierarchyListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/InputEvent.class b/libjava/classpath/lib/java/awt/event/InputEvent.class
new file mode 100644
index 00000000000..f4fa20c5b39
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/InputEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/InputMethodEvent.class b/libjava/classpath/lib/java/awt/event/InputMethodEvent.class
new file mode 100644
index 00000000000..c1889bbb925
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/InputMethodEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/InputMethodListener.class b/libjava/classpath/lib/java/awt/event/InputMethodListener.class
new file mode 100644
index 00000000000..4d94869152c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/InputMethodListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/InvocationEvent.class b/libjava/classpath/lib/java/awt/event/InvocationEvent.class
new file mode 100644
index 00000000000..11a75ffcbb6
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/InvocationEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/ItemEvent.class b/libjava/classpath/lib/java/awt/event/ItemEvent.class
new file mode 100644
index 00000000000..5a913e69c77
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/ItemEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/ItemListener.class b/libjava/classpath/lib/java/awt/event/ItemListener.class
new file mode 100644
index 00000000000..6bd6bb6da91
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/ItemListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/KeyAdapter.class b/libjava/classpath/lib/java/awt/event/KeyAdapter.class
new file mode 100644
index 00000000000..5c5a32fbb87
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/KeyAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/KeyEvent.class b/libjava/classpath/lib/java/awt/event/KeyEvent.class
new file mode 100644
index 00000000000..7b219839340
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/KeyEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/KeyListener.class b/libjava/classpath/lib/java/awt/event/KeyListener.class
new file mode 100644
index 00000000000..ef02711401e
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/KeyListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/MouseAdapter.class b/libjava/classpath/lib/java/awt/event/MouseAdapter.class
new file mode 100644
index 00000000000..321a7bc916b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/MouseAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/MouseEvent.class b/libjava/classpath/lib/java/awt/event/MouseEvent.class
new file mode 100644
index 00000000000..9bd3051178e
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/MouseEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/MouseListener.class b/libjava/classpath/lib/java/awt/event/MouseListener.class
new file mode 100644
index 00000000000..381fa93f2ae
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/MouseListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/MouseMotionAdapter.class b/libjava/classpath/lib/java/awt/event/MouseMotionAdapter.class
new file mode 100644
index 00000000000..a8317b653ff
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/MouseMotionAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/MouseMotionListener.class b/libjava/classpath/lib/java/awt/event/MouseMotionListener.class
new file mode 100644
index 00000000000..c862ac4ccba
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/MouseMotionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/MouseWheelEvent.class b/libjava/classpath/lib/java/awt/event/MouseWheelEvent.class
new file mode 100644
index 00000000000..cdb4470a107
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/MouseWheelEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/MouseWheelListener.class b/libjava/classpath/lib/java/awt/event/MouseWheelListener.class
new file mode 100644
index 00000000000..27d4cb3709b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/MouseWheelListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/PaintEvent.class b/libjava/classpath/lib/java/awt/event/PaintEvent.class
new file mode 100644
index 00000000000..138f249b430
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/PaintEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/TextEvent.class b/libjava/classpath/lib/java/awt/event/TextEvent.class
new file mode 100644
index 00000000000..5e7677909be
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/TextEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/TextListener.class b/libjava/classpath/lib/java/awt/event/TextListener.class
new file mode 100644
index 00000000000..023e38d7844
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/TextListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/WindowAdapter.class b/libjava/classpath/lib/java/awt/event/WindowAdapter.class
new file mode 100644
index 00000000000..17f1d762d05
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/WindowAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/WindowEvent.class b/libjava/classpath/lib/java/awt/event/WindowEvent.class
new file mode 100644
index 00000000000..38aa1d64017
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/WindowEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/WindowFocusListener.class b/libjava/classpath/lib/java/awt/event/WindowFocusListener.class
new file mode 100644
index 00000000000..a6b51f9a4f2
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/WindowFocusListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/WindowListener.class b/libjava/classpath/lib/java/awt/event/WindowListener.class
new file mode 100644
index 00000000000..81a4d4f9770
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/WindowListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/event/WindowStateListener.class b/libjava/classpath/lib/java/awt/event/WindowStateListener.class
new file mode 100644
index 00000000000..fbb7cd2140c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/event/WindowStateListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/FontRenderContext.class b/libjava/classpath/lib/java/awt/font/FontRenderContext.class
new file mode 100644
index 00000000000..2a70ec44ce5
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/FontRenderContext.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/GlyphJustificationInfo.class b/libjava/classpath/lib/java/awt/font/GlyphJustificationInfo.class
new file mode 100644
index 00000000000..ce4951e58ae
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/GlyphJustificationInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/GlyphMetrics.class b/libjava/classpath/lib/java/awt/font/GlyphMetrics.class
new file mode 100644
index 00000000000..689b1c0860d
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/GlyphMetrics.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/GlyphVector.class b/libjava/classpath/lib/java/awt/font/GlyphVector.class
new file mode 100644
index 00000000000..37dffe624d9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/GlyphVector.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/GraphicAttribute.class b/libjava/classpath/lib/java/awt/font/GraphicAttribute.class
new file mode 100644
index 00000000000..579a766da43
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/GraphicAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/ImageGraphicAttribute.class b/libjava/classpath/lib/java/awt/font/ImageGraphicAttribute.class
new file mode 100644
index 00000000000..97af1d64bed
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/ImageGraphicAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/LineBreakMeasurer.class b/libjava/classpath/lib/java/awt/font/LineBreakMeasurer.class
new file mode 100644
index 00000000000..5219b788e38
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/LineBreakMeasurer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/LineMetrics.class b/libjava/classpath/lib/java/awt/font/LineMetrics.class
new file mode 100644
index 00000000000..750960e9e17
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/LineMetrics.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/MultipleMaster.class b/libjava/classpath/lib/java/awt/font/MultipleMaster.class
new file mode 100644
index 00000000000..e64ad0c2398
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/MultipleMaster.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/NumericShaper.class b/libjava/classpath/lib/java/awt/font/NumericShaper.class
new file mode 100644
index 00000000000..01bbc22fac6
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/NumericShaper.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/OpenType.class b/libjava/classpath/lib/java/awt/font/OpenType.class
new file mode 100644
index 00000000000..a751f1d9780
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/OpenType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/ShapeGraphicAttribute.class b/libjava/classpath/lib/java/awt/font/ShapeGraphicAttribute.class
new file mode 100644
index 00000000000..9442a7479e0
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/ShapeGraphicAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/TextAttribute.class b/libjava/classpath/lib/java/awt/font/TextAttribute.class
new file mode 100644
index 00000000000..ec4a9d2873e
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/TextAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/TextHitInfo.class b/libjava/classpath/lib/java/awt/font/TextHitInfo.class
new file mode 100644
index 00000000000..cb1f3139ce3
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/TextHitInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/TextLayout$CaretPolicy.class b/libjava/classpath/lib/java/awt/font/TextLayout$CaretPolicy.class
new file mode 100644
index 00000000000..5b4117e5c89
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/TextLayout$CaretPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/TextLayout$Run.class b/libjava/classpath/lib/java/awt/font/TextLayout$Run.class
new file mode 100644
index 00000000000..09bb71dc8b9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/TextLayout$Run.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/TextLayout.class b/libjava/classpath/lib/java/awt/font/TextLayout.class
new file mode 100644
index 00000000000..bea832a12be
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/TextLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/TextMeasurer.class b/libjava/classpath/lib/java/awt/font/TextMeasurer.class
new file mode 100644
index 00000000000..dbbb2a3ad7f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/TextMeasurer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/font/TransformAttribute.class b/libjava/classpath/lib/java/awt/font/TransformAttribute.class
new file mode 100644
index 00000000000..d52f7a2503f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/font/TransformAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/AffineTransform.class b/libjava/classpath/lib/java/awt/geom/AffineTransform.class
new file mode 100644
index 00000000000..2da59944d37
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/AffineTransform.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Arc2D$ArcIterator.class b/libjava/classpath/lib/java/awt/geom/Arc2D$ArcIterator.class
new file mode 100644
index 00000000000..e1e4a4f5cd3
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Arc2D$ArcIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Arc2D$Double.class b/libjava/classpath/lib/java/awt/geom/Arc2D$Double.class
new file mode 100644
index 00000000000..3777bf17659
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Arc2D$Double.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Arc2D$Float.class b/libjava/classpath/lib/java/awt/geom/Arc2D$Float.class
new file mode 100644
index 00000000000..74359a783b0
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Arc2D$Float.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Arc2D.class b/libjava/classpath/lib/java/awt/geom/Arc2D.class
new file mode 100644
index 00000000000..ff01a0961fc
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Arc2D.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Area$AreaIterator$IteratorSegment.class b/libjava/classpath/lib/java/awt/geom/Area$AreaIterator$IteratorSegment.class
new file mode 100644
index 00000000000..fc1e1f6c58b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Area$AreaIterator$IteratorSegment.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Area$AreaIterator.class b/libjava/classpath/lib/java/awt/geom/Area$AreaIterator.class
new file mode 100644
index 00000000000..c0510c73e35
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Area$AreaIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Area$CubicSegment.class b/libjava/classpath/lib/java/awt/geom/Area$CubicSegment.class
new file mode 100644
index 00000000000..8425f445b11
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Area$CubicSegment.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Area$Intersection.class b/libjava/classpath/lib/java/awt/geom/Area$Intersection.class
new file mode 100644
index 00000000000..c9408392097
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Area$Intersection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Area$LineSegment.class b/libjava/classpath/lib/java/awt/geom/Area$LineSegment.class
new file mode 100644
index 00000000000..c770e64f49d
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Area$LineSegment.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Area$QuadSegment.class b/libjava/classpath/lib/java/awt/geom/Area$QuadSegment.class
new file mode 100644
index 00000000000..f2f61d1eab7
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Area$QuadSegment.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Area$Segment.class b/libjava/classpath/lib/java/awt/geom/Area$Segment.class
new file mode 100644
index 00000000000..b3a1e8b3226
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Area$Segment.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Area.class b/libjava/classpath/lib/java/awt/geom/Area.class
new file mode 100644
index 00000000000..c8c40b48a16
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Area.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/CubicCurve2D$1.class b/libjava/classpath/lib/java/awt/geom/CubicCurve2D$1.class
new file mode 100644
index 00000000000..3aedc6bc736
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/CubicCurve2D$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/CubicCurve2D$Double.class b/libjava/classpath/lib/java/awt/geom/CubicCurve2D$Double.class
new file mode 100644
index 00000000000..503543bc8f8
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/CubicCurve2D$Double.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/CubicCurve2D$Float.class b/libjava/classpath/lib/java/awt/geom/CubicCurve2D$Float.class
new file mode 100644
index 00000000000..b185581c604
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/CubicCurve2D$Float.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/CubicCurve2D.class b/libjava/classpath/lib/java/awt/geom/CubicCurve2D.class
new file mode 100644
index 00000000000..1557091b997
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/CubicCurve2D.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Dimension2D.class b/libjava/classpath/lib/java/awt/geom/Dimension2D.class
new file mode 100644
index 00000000000..35af578c46b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Dimension2D.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Ellipse2D$Double.class b/libjava/classpath/lib/java/awt/geom/Ellipse2D$Double.class
new file mode 100644
index 00000000000..b2e12a5700e
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Ellipse2D$Double.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Ellipse2D$Float.class b/libjava/classpath/lib/java/awt/geom/Ellipse2D$Float.class
new file mode 100644
index 00000000000..b6ce49b4730
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Ellipse2D$Float.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Ellipse2D.class b/libjava/classpath/lib/java/awt/geom/Ellipse2D.class
new file mode 100644
index 00000000000..2a782332a32
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Ellipse2D.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/FlatteningPathIterator.class b/libjava/classpath/lib/java/awt/geom/FlatteningPathIterator.class
new file mode 100644
index 00000000000..41ea2bcf972
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/FlatteningPathIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/GeneralPath$GeneralPathIterator.class b/libjava/classpath/lib/java/awt/geom/GeneralPath$GeneralPathIterator.class
new file mode 100644
index 00000000000..f71ffe500c4
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/GeneralPath$GeneralPathIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/GeneralPath.class b/libjava/classpath/lib/java/awt/geom/GeneralPath.class
new file mode 100644
index 00000000000..995e5535784
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/GeneralPath.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/IllegalPathStateException.class b/libjava/classpath/lib/java/awt/geom/IllegalPathStateException.class
new file mode 100644
index 00000000000..ffac54a35da
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/IllegalPathStateException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Line2D$1.class b/libjava/classpath/lib/java/awt/geom/Line2D$1.class
new file mode 100644
index 00000000000..876a78dc9f0
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Line2D$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Line2D$Double.class b/libjava/classpath/lib/java/awt/geom/Line2D$Double.class
new file mode 100644
index 00000000000..f1fdb8f2e3c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Line2D$Double.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Line2D$Float.class b/libjava/classpath/lib/java/awt/geom/Line2D$Float.class
new file mode 100644
index 00000000000..a022ae480e4
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Line2D$Float.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Line2D.class b/libjava/classpath/lib/java/awt/geom/Line2D.class
new file mode 100644
index 00000000000..5845bb5123b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Line2D.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/NoninvertibleTransformException.class b/libjava/classpath/lib/java/awt/geom/NoninvertibleTransformException.class
new file mode 100644
index 00000000000..c4a8580c38b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/NoninvertibleTransformException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/PathIterator.class b/libjava/classpath/lib/java/awt/geom/PathIterator.class
new file mode 100644
index 00000000000..1abdb31e697
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/PathIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Point2D$Double.class b/libjava/classpath/lib/java/awt/geom/Point2D$Double.class
new file mode 100644
index 00000000000..0e6019cdef9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Point2D$Double.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Point2D$Float.class b/libjava/classpath/lib/java/awt/geom/Point2D$Float.class
new file mode 100644
index 00000000000..fbf7abc206a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Point2D$Float.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Point2D.class b/libjava/classpath/lib/java/awt/geom/Point2D.class
new file mode 100644
index 00000000000..7cc6b35b655
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Point2D.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/QuadCurve2D$1.class b/libjava/classpath/lib/java/awt/geom/QuadCurve2D$1.class
new file mode 100644
index 00000000000..93ba86abba4
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/QuadCurve2D$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/QuadCurve2D$Double.class b/libjava/classpath/lib/java/awt/geom/QuadCurve2D$Double.class
new file mode 100644
index 00000000000..f0c92f7b436
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/QuadCurve2D$Double.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/QuadCurve2D$Float.class b/libjava/classpath/lib/java/awt/geom/QuadCurve2D$Float.class
new file mode 100644
index 00000000000..f6b42b06da5
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/QuadCurve2D$Float.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/QuadCurve2D.class b/libjava/classpath/lib/java/awt/geom/QuadCurve2D.class
new file mode 100644
index 00000000000..8324a377fc6
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/QuadCurve2D.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Rectangle2D$1.class b/libjava/classpath/lib/java/awt/geom/Rectangle2D$1.class
new file mode 100644
index 00000000000..4b38908f6a8
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Rectangle2D$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Rectangle2D$Double.class b/libjava/classpath/lib/java/awt/geom/Rectangle2D$Double.class
new file mode 100644
index 00000000000..ab68a5c690f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Rectangle2D$Double.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Rectangle2D$Float.class b/libjava/classpath/lib/java/awt/geom/Rectangle2D$Float.class
new file mode 100644
index 00000000000..3dc000fcd30
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Rectangle2D$Float.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/Rectangle2D.class b/libjava/classpath/lib/java/awt/geom/Rectangle2D.class
new file mode 100644
index 00000000000..628b608ec10
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/Rectangle2D.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/RectangularShape.class b/libjava/classpath/lib/java/awt/geom/RectangularShape.class
new file mode 100644
index 00000000000..69458e3d750
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/RectangularShape.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/RoundRectangle2D$1.class b/libjava/classpath/lib/java/awt/geom/RoundRectangle2D$1.class
new file mode 100644
index 00000000000..de604f003e8
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/RoundRectangle2D$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/RoundRectangle2D$Double.class b/libjava/classpath/lib/java/awt/geom/RoundRectangle2D$Double.class
new file mode 100644
index 00000000000..4b3a3f46c2b
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/RoundRectangle2D$Double.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/RoundRectangle2D$Float.class b/libjava/classpath/lib/java/awt/geom/RoundRectangle2D$Float.class
new file mode 100644
index 00000000000..c8ab25a649e
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/RoundRectangle2D$Float.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/geom/RoundRectangle2D.class b/libjava/classpath/lib/java/awt/geom/RoundRectangle2D.class
new file mode 100644
index 00000000000..ff0e1fa28ee
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/geom/RoundRectangle2D.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/im/InputContext.class b/libjava/classpath/lib/java/awt/im/InputContext.class
new file mode 100644
index 00000000000..84acbd2666f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/im/InputContext.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/im/InputMethodHighlight.class b/libjava/classpath/lib/java/awt/im/InputMethodHighlight.class
new file mode 100644
index 00000000000..603a3a0e87a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/im/InputMethodHighlight.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/im/InputMethodRequests.class b/libjava/classpath/lib/java/awt/im/InputMethodRequests.class
new file mode 100644
index 00000000000..1e602d630ea
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/im/InputMethodRequests.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/im/InputSubset.class b/libjava/classpath/lib/java/awt/im/InputSubset.class
new file mode 100644
index 00000000000..ad26f37192a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/im/InputSubset.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/im/spi/InputMethod.class b/libjava/classpath/lib/java/awt/im/spi/InputMethod.class
new file mode 100644
index 00000000000..9f74de82a61
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/im/spi/InputMethod.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/im/spi/InputMethodContext.class b/libjava/classpath/lib/java/awt/im/spi/InputMethodContext.class
new file mode 100644
index 00000000000..c9c622c58ca
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/im/spi/InputMethodContext.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/im/spi/InputMethodDescriptor.class b/libjava/classpath/lib/java/awt/im/spi/InputMethodDescriptor.class
new file mode 100644
index 00000000000..4d3ef9ca9fe
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/im/spi/InputMethodDescriptor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/AffineTransformOp.class b/libjava/classpath/lib/java/awt/image/AffineTransformOp.class
new file mode 100644
index 00000000000..bc2eefe9293
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/AffineTransformOp.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/AreaAveragingScaleFilter.class b/libjava/classpath/lib/java/awt/image/AreaAveragingScaleFilter.class
new file mode 100644
index 00000000000..6fa585e6c09
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/AreaAveragingScaleFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/BandCombineOp.class b/libjava/classpath/lib/java/awt/image/BandCombineOp.class
new file mode 100644
index 00000000000..e56e395ca40
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/BandCombineOp.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/BandedSampleModel.class b/libjava/classpath/lib/java/awt/image/BandedSampleModel.class
new file mode 100644
index 00000000000..534e15f266f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/BandedSampleModel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/BufferStrategy.class b/libjava/classpath/lib/java/awt/image/BufferStrategy.class
new file mode 100644
index 00000000000..117080e7058
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/BufferStrategy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/BufferedImage$1.class b/libjava/classpath/lib/java/awt/image/BufferedImage$1.class
new file mode 100644
index 00000000000..75e331ef818
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/BufferedImage$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/BufferedImage.class b/libjava/classpath/lib/java/awt/image/BufferedImage.class
new file mode 100644
index 00000000000..c1156b6a6f3
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/BufferedImage.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/BufferedImageFilter.class b/libjava/classpath/lib/java/awt/image/BufferedImageFilter.class
new file mode 100644
index 00000000000..cb8d712f4c1
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/BufferedImageFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/BufferedImageOp.class b/libjava/classpath/lib/java/awt/image/BufferedImageOp.class
new file mode 100644
index 00000000000..e33b1a0a5fb
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/BufferedImageOp.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/ByteLookupTable.class b/libjava/classpath/lib/java/awt/image/ByteLookupTable.class
new file mode 100644
index 00000000000..8fa3faabc00
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/ByteLookupTable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/ColorConvertOp.class b/libjava/classpath/lib/java/awt/image/ColorConvertOp.class
new file mode 100644
index 00000000000..bc3fa08e914
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/ColorConvertOp.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/ColorModel$SRGBColorModel.class b/libjava/classpath/lib/java/awt/image/ColorModel$SRGBColorModel.class
new file mode 100644
index 00000000000..b9a971b2d5f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/ColorModel$SRGBColorModel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/ColorModel.class b/libjava/classpath/lib/java/awt/image/ColorModel.class
new file mode 100644
index 00000000000..5806aabe368
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/ColorModel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/ComponentColorModel.class b/libjava/classpath/lib/java/awt/image/ComponentColorModel.class
new file mode 100644
index 00000000000..e9be93f657e
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/ComponentColorModel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/ComponentSampleModel.class b/libjava/classpath/lib/java/awt/image/ComponentSampleModel.class
new file mode 100644
index 00000000000..74ba60a0881
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/ComponentSampleModel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/ConvolveOp.class b/libjava/classpath/lib/java/awt/image/ConvolveOp.class
new file mode 100644
index 00000000000..f9b2ca14d7a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/ConvolveOp.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/CropImageFilter.class b/libjava/classpath/lib/java/awt/image/CropImageFilter.class
new file mode 100644
index 00000000000..0be58d674f7
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/CropImageFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/DataBuffer.class b/libjava/classpath/lib/java/awt/image/DataBuffer.class
new file mode 100644
index 00000000000..39af177d929
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/DataBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/DataBufferByte.class b/libjava/classpath/lib/java/awt/image/DataBufferByte.class
new file mode 100644
index 00000000000..6b411008cd2
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/DataBufferByte.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/DataBufferDouble.class b/libjava/classpath/lib/java/awt/image/DataBufferDouble.class
new file mode 100644
index 00000000000..eb2bd40914f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/DataBufferDouble.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/DataBufferFloat.class b/libjava/classpath/lib/java/awt/image/DataBufferFloat.class
new file mode 100644
index 00000000000..842678d17b2
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/DataBufferFloat.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/DataBufferInt.class b/libjava/classpath/lib/java/awt/image/DataBufferInt.class
new file mode 100644
index 00000000000..7aacea6dc56
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/DataBufferInt.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/DataBufferShort.class b/libjava/classpath/lib/java/awt/image/DataBufferShort.class
new file mode 100644
index 00000000000..0b126b07722
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/DataBufferShort.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/DataBufferUShort.class b/libjava/classpath/lib/java/awt/image/DataBufferUShort.class
new file mode 100644
index 00000000000..addb229f8cc
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/DataBufferUShort.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/DirectColorModel.class b/libjava/classpath/lib/java/awt/image/DirectColorModel.class
new file mode 100644
index 00000000000..a149ac63135
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/DirectColorModel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/FilteredImageSource.class b/libjava/classpath/lib/java/awt/image/FilteredImageSource.class
new file mode 100644
index 00000000000..8c9705655d5
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/FilteredImageSource.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/ImageConsumer.class b/libjava/classpath/lib/java/awt/image/ImageConsumer.class
new file mode 100644
index 00000000000..4ee56a733d6
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/ImageConsumer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/ImageFilter.class b/libjava/classpath/lib/java/awt/image/ImageFilter.class
new file mode 100644
index 00000000000..b9f4a2d15ef
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/ImageFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/ImageObserver.class b/libjava/classpath/lib/java/awt/image/ImageObserver.class
new file mode 100644
index 00000000000..22427c22106
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/ImageObserver.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/ImageProducer.class b/libjava/classpath/lib/java/awt/image/ImageProducer.class
new file mode 100644
index 00000000000..b7582dfa237
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/ImageProducer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/ImagingOpException.class b/libjava/classpath/lib/java/awt/image/ImagingOpException.class
new file mode 100644
index 00000000000..a45bd1cbdfa
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/ImagingOpException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/IndexColorModel.class b/libjava/classpath/lib/java/awt/image/IndexColorModel.class
new file mode 100644
index 00000000000..c8f917f7d59
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/IndexColorModel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/Kernel.class b/libjava/classpath/lib/java/awt/image/Kernel.class
new file mode 100644
index 00000000000..b5d70f5df00
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/Kernel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/LookupOp.class b/libjava/classpath/lib/java/awt/image/LookupOp.class
new file mode 100644
index 00000000000..657be12c04a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/LookupOp.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/LookupTable.class b/libjava/classpath/lib/java/awt/image/LookupTable.class
new file mode 100644
index 00000000000..af0e68f0a75
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/LookupTable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/MemoryImageSource.class b/libjava/classpath/lib/java/awt/image/MemoryImageSource.class
new file mode 100644
index 00000000000..25ab31a45ef
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/MemoryImageSource.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/MultiPixelPackedSampleModel.class b/libjava/classpath/lib/java/awt/image/MultiPixelPackedSampleModel.class
new file mode 100644
index 00000000000..9fae4aba855
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/MultiPixelPackedSampleModel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/PackedColorModel.class b/libjava/classpath/lib/java/awt/image/PackedColorModel.class
new file mode 100644
index 00000000000..0d90ac3c427
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/PackedColorModel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/PixelGrabber$1.class b/libjava/classpath/lib/java/awt/image/PixelGrabber$1.class
new file mode 100644
index 00000000000..f12bf8d2c5c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/PixelGrabber$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/PixelGrabber.class b/libjava/classpath/lib/java/awt/image/PixelGrabber.class
new file mode 100644
index 00000000000..b4797bd79fa
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/PixelGrabber.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/PixelInterleavedSampleModel.class b/libjava/classpath/lib/java/awt/image/PixelInterleavedSampleModel.class
new file mode 100644
index 00000000000..9f456ec8235
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/PixelInterleavedSampleModel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/RGBImageFilter.class b/libjava/classpath/lib/java/awt/image/RGBImageFilter.class
new file mode 100644
index 00000000000..c0573de77c7
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/RGBImageFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/Raster.class b/libjava/classpath/lib/java/awt/image/Raster.class
new file mode 100644
index 00000000000..054d9b364a6
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/Raster.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/RasterFormatException.class b/libjava/classpath/lib/java/awt/image/RasterFormatException.class
new file mode 100644
index 00000000000..2f76b3e50f2
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/RasterFormatException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/RasterOp.class b/libjava/classpath/lib/java/awt/image/RasterOp.class
new file mode 100644
index 00000000000..201a7803b05
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/RasterOp.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/RenderedImage.class b/libjava/classpath/lib/java/awt/image/RenderedImage.class
new file mode 100644
index 00000000000..de5e3efd00c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/RenderedImage.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/ReplicateScaleFilter.class b/libjava/classpath/lib/java/awt/image/ReplicateScaleFilter.class
new file mode 100644
index 00000000000..a6aa9917a25
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/ReplicateScaleFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/RescaleOp.class b/libjava/classpath/lib/java/awt/image/RescaleOp.class
new file mode 100644
index 00000000000..5e96dfbbbbd
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/RescaleOp.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/SampleModel.class b/libjava/classpath/lib/java/awt/image/SampleModel.class
new file mode 100644
index 00000000000..fdb7ab3dcfc
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/SampleModel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/ShortLookupTable.class b/libjava/classpath/lib/java/awt/image/ShortLookupTable.class
new file mode 100644
index 00000000000..6011a335556
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/ShortLookupTable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/SinglePixelPackedSampleModel.class b/libjava/classpath/lib/java/awt/image/SinglePixelPackedSampleModel.class
new file mode 100644
index 00000000000..52564fc4bf3
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/SinglePixelPackedSampleModel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/TileObserver.class b/libjava/classpath/lib/java/awt/image/TileObserver.class
new file mode 100644
index 00000000000..9aa292ab8af
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/TileObserver.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/VolatileImage.class b/libjava/classpath/lib/java/awt/image/VolatileImage.class
new file mode 100644
index 00000000000..5cf77025e95
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/VolatileImage.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/WritableRaster.class b/libjava/classpath/lib/java/awt/image/WritableRaster.class
new file mode 100644
index 00000000000..d80cfee662c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/WritableRaster.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/WritableRenderedImage.class b/libjava/classpath/lib/java/awt/image/WritableRenderedImage.class
new file mode 100644
index 00000000000..a28e08dbdb8
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/WritableRenderedImage.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/renderable/ContextualRenderedImageFactory.class b/libjava/classpath/lib/java/awt/image/renderable/ContextualRenderedImageFactory.class
new file mode 100644
index 00000000000..acdf0cfec06
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/renderable/ContextualRenderedImageFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/renderable/ParameterBlock.class b/libjava/classpath/lib/java/awt/image/renderable/ParameterBlock.class
new file mode 100644
index 00000000000..1b3573b9d50
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/renderable/ParameterBlock.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/renderable/RenderContext.class b/libjava/classpath/lib/java/awt/image/renderable/RenderContext.class
new file mode 100644
index 00000000000..4a42f233081
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/renderable/RenderContext.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/renderable/RenderableImage.class b/libjava/classpath/lib/java/awt/image/renderable/RenderableImage.class
new file mode 100644
index 00000000000..13e554c7a4a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/renderable/RenderableImage.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/renderable/RenderableImageOp.class b/libjava/classpath/lib/java/awt/image/renderable/RenderableImageOp.class
new file mode 100644
index 00000000000..2a7aedb5af2
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/renderable/RenderableImageOp.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/renderable/RenderableImageProducer.class b/libjava/classpath/lib/java/awt/image/renderable/RenderableImageProducer.class
new file mode 100644
index 00000000000..339f8a429ea
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/renderable/RenderableImageProducer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/image/renderable/RenderedImageFactory.class b/libjava/classpath/lib/java/awt/image/renderable/RenderedImageFactory.class
new file mode 100644
index 00000000000..5b6801ab411
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/image/renderable/RenderedImageFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/ButtonPeer.class b/libjava/classpath/lib/java/awt/peer/ButtonPeer.class
new file mode 100644
index 00000000000..f0581ea3602
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/ButtonPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/CanvasPeer.class b/libjava/classpath/lib/java/awt/peer/CanvasPeer.class
new file mode 100644
index 00000000000..0785476928c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/CanvasPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/CheckboxMenuItemPeer.class b/libjava/classpath/lib/java/awt/peer/CheckboxMenuItemPeer.class
new file mode 100644
index 00000000000..880dfbd17c2
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/CheckboxMenuItemPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/CheckboxPeer.class b/libjava/classpath/lib/java/awt/peer/CheckboxPeer.class
new file mode 100644
index 00000000000..843fe79980f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/CheckboxPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/ChoicePeer.class b/libjava/classpath/lib/java/awt/peer/ChoicePeer.class
new file mode 100644
index 00000000000..d496c1f2c69
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/ChoicePeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/ComponentPeer.class b/libjava/classpath/lib/java/awt/peer/ComponentPeer.class
new file mode 100644
index 00000000000..37cd47ca2c1
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/ComponentPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/ContainerPeer.class b/libjava/classpath/lib/java/awt/peer/ContainerPeer.class
new file mode 100644
index 00000000000..97e8f987584
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/ContainerPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/DialogPeer.class b/libjava/classpath/lib/java/awt/peer/DialogPeer.class
new file mode 100644
index 00000000000..39d9887e8f4
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/DialogPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/FileDialogPeer.class b/libjava/classpath/lib/java/awt/peer/FileDialogPeer.class
new file mode 100644
index 00000000000..502ef7da034
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/FileDialogPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/FontPeer.class b/libjava/classpath/lib/java/awt/peer/FontPeer.class
new file mode 100644
index 00000000000..74f5d9ae7b7
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/FontPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/FramePeer.class b/libjava/classpath/lib/java/awt/peer/FramePeer.class
new file mode 100644
index 00000000000..b8bc7585d5f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/FramePeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/LabelPeer.class b/libjava/classpath/lib/java/awt/peer/LabelPeer.class
new file mode 100644
index 00000000000..dab684df922
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/LabelPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/LightweightPeer.class b/libjava/classpath/lib/java/awt/peer/LightweightPeer.class
new file mode 100644
index 00000000000..37a38244d9c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/LightweightPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/ListPeer.class b/libjava/classpath/lib/java/awt/peer/ListPeer.class
new file mode 100644
index 00000000000..817a2c2e8a8
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/ListPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/MenuBarPeer.class b/libjava/classpath/lib/java/awt/peer/MenuBarPeer.class
new file mode 100644
index 00000000000..d1563ab3ee3
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/MenuBarPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/MenuComponentPeer.class b/libjava/classpath/lib/java/awt/peer/MenuComponentPeer.class
new file mode 100644
index 00000000000..07de124cadf
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/MenuComponentPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/MenuItemPeer.class b/libjava/classpath/lib/java/awt/peer/MenuItemPeer.class
new file mode 100644
index 00000000000..682201777ad
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/MenuItemPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/MenuPeer.class b/libjava/classpath/lib/java/awt/peer/MenuPeer.class
new file mode 100644
index 00000000000..6ac26847645
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/MenuPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/MouseInfoPeer.class b/libjava/classpath/lib/java/awt/peer/MouseInfoPeer.class
new file mode 100644
index 00000000000..a02bdce47e3
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/MouseInfoPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/PanelPeer.class b/libjava/classpath/lib/java/awt/peer/PanelPeer.class
new file mode 100644
index 00000000000..f24f5edf90f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/PanelPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/PopupMenuPeer.class b/libjava/classpath/lib/java/awt/peer/PopupMenuPeer.class
new file mode 100644
index 00000000000..d71742ec1e0
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/PopupMenuPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/RobotPeer.class b/libjava/classpath/lib/java/awt/peer/RobotPeer.class
new file mode 100644
index 00000000000..983c6d5114f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/RobotPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/ScrollPanePeer.class b/libjava/classpath/lib/java/awt/peer/ScrollPanePeer.class
new file mode 100644
index 00000000000..2870529851d
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/ScrollPanePeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/ScrollbarPeer.class b/libjava/classpath/lib/java/awt/peer/ScrollbarPeer.class
new file mode 100644
index 00000000000..19c5d229258
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/ScrollbarPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/TextAreaPeer.class b/libjava/classpath/lib/java/awt/peer/TextAreaPeer.class
new file mode 100644
index 00000000000..485b54ac88c
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/TextAreaPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/TextComponentPeer.class b/libjava/classpath/lib/java/awt/peer/TextComponentPeer.class
new file mode 100644
index 00000000000..d854876cc17
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/TextComponentPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/TextFieldPeer.class b/libjava/classpath/lib/java/awt/peer/TextFieldPeer.class
new file mode 100644
index 00000000000..ec17b2acddf
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/TextFieldPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/peer/WindowPeer.class b/libjava/classpath/lib/java/awt/peer/WindowPeer.class
new file mode 100644
index 00000000000..09f9d3415e5
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/peer/WindowPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/print/Book.class b/libjava/classpath/lib/java/awt/print/Book.class
new file mode 100644
index 00000000000..10d8748d051
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/print/Book.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/print/NoPrinterJob.class b/libjava/classpath/lib/java/awt/print/NoPrinterJob.class
new file mode 100644
index 00000000000..fc2123bc36f
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/print/NoPrinterJob.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/print/PageFormat.class b/libjava/classpath/lib/java/awt/print/PageFormat.class
new file mode 100644
index 00000000000..ce914954afc
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/print/PageFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/print/Pageable.class b/libjava/classpath/lib/java/awt/print/Pageable.class
new file mode 100644
index 00000000000..40beda57f41
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/print/Pageable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/print/Paper.class b/libjava/classpath/lib/java/awt/print/Paper.class
new file mode 100644
index 00000000000..e52514093c9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/print/Paper.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/print/Printable.class b/libjava/classpath/lib/java/awt/print/Printable.class
new file mode 100644
index 00000000000..a9b56af9d97
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/print/Printable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/print/PrinterAbortException.class b/libjava/classpath/lib/java/awt/print/PrinterAbortException.class
new file mode 100644
index 00000000000..06d7d59cf1a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/print/PrinterAbortException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/print/PrinterException.class b/libjava/classpath/lib/java/awt/print/PrinterException.class
new file mode 100644
index 00000000000..909c44b1486
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/print/PrinterException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/print/PrinterGraphics.class b/libjava/classpath/lib/java/awt/print/PrinterGraphics.class
new file mode 100644
index 00000000000..86b6950f535
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/print/PrinterGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/print/PrinterIOException.class b/libjava/classpath/lib/java/awt/print/PrinterIOException.class
new file mode 100644
index 00000000000..27b6f35ab3a
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/print/PrinterIOException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/awt/print/PrinterJob.class b/libjava/classpath/lib/java/awt/print/PrinterJob.class
new file mode 100644
index 00000000000..2f31fd57da9
--- /dev/null
+++ b/libjava/classpath/lib/java/awt/print/PrinterJob.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/AppletInitializer.class b/libjava/classpath/lib/java/beans/AppletInitializer.class
new file mode 100644
index 00000000000..e0b3ba42299
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/AppletInitializer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/BeanDescriptor.class b/libjava/classpath/lib/java/beans/BeanDescriptor.class
new file mode 100644
index 00000000000..b95fda619ff
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/BeanDescriptor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/BeanInfo.class b/libjava/classpath/lib/java/beans/BeanInfo.class
new file mode 100644
index 00000000000..53408ca1fc8
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/BeanInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/Beans.class b/libjava/classpath/lib/java/beans/Beans.class
new file mode 100644
index 00000000000..76fe24c89f8
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/Beans.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/Customizer.class b/libjava/classpath/lib/java/beans/Customizer.class
new file mode 100644
index 00000000000..4c550c7a349
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/Customizer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/DefaultPersistenceDelegate.class b/libjava/classpath/lib/java/beans/DefaultPersistenceDelegate.class
new file mode 100644
index 00000000000..6c13217644f
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/DefaultPersistenceDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/DesignMode.class b/libjava/classpath/lib/java/beans/DesignMode.class
new file mode 100644
index 00000000000..70c1d8367c3
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/DesignMode.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/Encoder$1.class b/libjava/classpath/lib/java/beans/Encoder$1.class
new file mode 100644
index 00000000000..6bb7946d625
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/Encoder$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/Encoder.class b/libjava/classpath/lib/java/beans/Encoder.class
new file mode 100644
index 00000000000..69a258f6dca
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/Encoder.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/EventHandler.class b/libjava/classpath/lib/java/beans/EventHandler.class
new file mode 100644
index 00000000000..9e0c30b914a
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/EventHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/EventSetDescriptor.class b/libjava/classpath/lib/java/beans/EventSetDescriptor.class
new file mode 100644
index 00000000000..0241e553141
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/EventSetDescriptor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/ExceptionListener.class b/libjava/classpath/lib/java/beans/ExceptionListener.class
new file mode 100644
index 00000000000..897171e5a5f
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/ExceptionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/ExplicitInfo.class b/libjava/classpath/lib/java/beans/ExplicitInfo.class
new file mode 100644
index 00000000000..857e0c33ebc
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/ExplicitInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/Expression.class b/libjava/classpath/lib/java/beans/Expression.class
new file mode 100644
index 00000000000..d7082903c9a
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/Expression.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/FeatureDescriptor.class b/libjava/classpath/lib/java/beans/FeatureDescriptor.class
new file mode 100644
index 00000000000..4b3480160e5
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/FeatureDescriptor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/IndexedPropertyChangeEvent.class b/libjava/classpath/lib/java/beans/IndexedPropertyChangeEvent.class
new file mode 100644
index 00000000000..25748f37c9b
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/IndexedPropertyChangeEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/IndexedPropertyDescriptor.class b/libjava/classpath/lib/java/beans/IndexedPropertyDescriptor.class
new file mode 100644
index 00000000000..b15f18c0703
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/IndexedPropertyDescriptor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/IntrospectionException.class b/libjava/classpath/lib/java/beans/IntrospectionException.class
new file mode 100644
index 00000000000..1ce546d321e
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/IntrospectionException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/Introspector.class b/libjava/classpath/lib/java/beans/Introspector.class
new file mode 100644
index 00000000000..f6f290801ef
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/Introspector.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/MethodDescriptor.class b/libjava/classpath/lib/java/beans/MethodDescriptor.class
new file mode 100644
index 00000000000..e19b45f677e
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/MethodDescriptor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/ParameterDescriptor.class b/libjava/classpath/lib/java/beans/ParameterDescriptor.class
new file mode 100644
index 00000000000..061e648e615
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/ParameterDescriptor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/PersistenceDelegate.class b/libjava/classpath/lib/java/beans/PersistenceDelegate.class
new file mode 100644
index 00000000000..7612ea187f5
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/PersistenceDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/PropertyChangeEvent.class b/libjava/classpath/lib/java/beans/PropertyChangeEvent.class
new file mode 100644
index 00000000000..405ba52f7a1
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/PropertyChangeEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/PropertyChangeListener.class b/libjava/classpath/lib/java/beans/PropertyChangeListener.class
new file mode 100644
index 00000000000..336de4a3a73
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/PropertyChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/PropertyChangeListenerProxy.class b/libjava/classpath/lib/java/beans/PropertyChangeListenerProxy.class
new file mode 100644
index 00000000000..6e9a0527abe
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/PropertyChangeListenerProxy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/PropertyChangeSupport.class b/libjava/classpath/lib/java/beans/PropertyChangeSupport.class
new file mode 100644
index 00000000000..030b81a208b
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/PropertyChangeSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/PropertyDescriptor.class b/libjava/classpath/lib/java/beans/PropertyDescriptor.class
new file mode 100644
index 00000000000..c4197ca89fc
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/PropertyDescriptor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/PropertyEditor.class b/libjava/classpath/lib/java/beans/PropertyEditor.class
new file mode 100644
index 00000000000..d37a5823d91
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/PropertyEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/PropertyEditorManager.class b/libjava/classpath/lib/java/beans/PropertyEditorManager.class
new file mode 100644
index 00000000000..3f0aef15be7
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/PropertyEditorManager.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/PropertyEditorSupport.class b/libjava/classpath/lib/java/beans/PropertyEditorSupport.class
new file mode 100644
index 00000000000..d0c495dd022
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/PropertyEditorSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/PropertyVetoException.class b/libjava/classpath/lib/java/beans/PropertyVetoException.class
new file mode 100644
index 00000000000..30a4aaaba16
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/PropertyVetoException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/SimpleBeanInfo.class b/libjava/classpath/lib/java/beans/SimpleBeanInfo.class
new file mode 100644
index 00000000000..496ecd600e3
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/SimpleBeanInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/Statement.class b/libjava/classpath/lib/java/beans/Statement.class
new file mode 100644
index 00000000000..c9eddc2cb44
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/Statement.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/VetoableChangeListener.class b/libjava/classpath/lib/java/beans/VetoableChangeListener.class
new file mode 100644
index 00000000000..dbca45eea90
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/VetoableChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/VetoableChangeListenerProxy.class b/libjava/classpath/lib/java/beans/VetoableChangeListenerProxy.class
new file mode 100644
index 00000000000..63ed47f3b5a
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/VetoableChangeListenerProxy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/VetoableChangeSupport.class b/libjava/classpath/lib/java/beans/VetoableChangeSupport.class
new file mode 100644
index 00000000000..bb27ac11e45
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/VetoableChangeSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/Visibility.class b/libjava/classpath/lib/java/beans/Visibility.class
new file mode 100644
index 00000000000..291bfc4b337
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/Visibility.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/XMLDecoder.class b/libjava/classpath/lib/java/beans/XMLDecoder.class
new file mode 100644
index 00000000000..813af311c12
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/XMLDecoder.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/XMLEncoder.class b/libjava/classpath/lib/java/beans/XMLEncoder.class
new file mode 100644
index 00000000000..3abe27c826a
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/XMLEncoder.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContext.class b/libjava/classpath/lib/java/beans/beancontext/BeanContext.class
new file mode 100644
index 00000000000..d3d5710a14d
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContext.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextChild.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextChild.class
new file mode 100644
index 00000000000..f0b3ed8f92a
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextChild.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextChildComponentProxy.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextChildComponentProxy.class
new file mode 100644
index 00000000000..4089781fef6
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextChildComponentProxy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextChildSupport.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextChildSupport.class
new file mode 100644
index 00000000000..c6698f86083
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextChildSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextContainerProxy.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextContainerProxy.class
new file mode 100644
index 00000000000..5e3750bc4bc
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextContainerProxy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextEvent.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextEvent.class
new file mode 100644
index 00000000000..390216ddf6d
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextMembershipEvent.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextMembershipEvent.class
new file mode 100644
index 00000000000..631c0dac898
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextMembershipEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextMembershipListener.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextMembershipListener.class
new file mode 100644
index 00000000000..c6fa4fcec9f
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextMembershipListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextProxy.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextProxy.class
new file mode 100644
index 00000000000..82deaafa8e3
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextProxy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceAvailableEvent.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceAvailableEvent.class
new file mode 100644
index 00000000000..9df6d17730a
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceAvailableEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceProvider.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceProvider.class
new file mode 100644
index 00000000000..4b71ff33148
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceProviderBeanInfo.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceProviderBeanInfo.class
new file mode 100644
index 00000000000..df17989c2bf
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceProviderBeanInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceRevokedEvent.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceRevokedEvent.class
new file mode 100644
index 00000000000..261e673437e
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceRevokedEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceRevokedListener.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceRevokedListener.class
new file mode 100644
index 00000000000..417c562f778
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextServiceRevokedListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextServices.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextServices.class
new file mode 100644
index 00000000000..98a05f3e94c
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextServices.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesListener.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesListener.class
new file mode 100644
index 00000000000..ca4a9a41a92
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$BCSSChild.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$BCSSChild.class
new file mode 100644
index 00000000000..e5f12c848fb
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$BCSSChild.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$BCSSProxyServiceProvider.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$BCSSProxyServiceProvider.class
new file mode 100644
index 00000000000..53724e026a2
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$BCSSProxyServiceProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$BCSSServiceProvider.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$BCSSServiceProvider.class
new file mode 100644
index 00000000000..4881c940616
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$BCSSServiceProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$Request.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$Request.class
new file mode 100644
index 00000000000..6fef7beb1a7
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$Request.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$ServiceLease.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$ServiceLease.class
new file mode 100644
index 00000000000..9daefd69259
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$ServiceLease.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$ServiceRequest.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$ServiceRequest.class
new file mode 100644
index 00000000000..3a186951f74
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport$ServiceRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport.class
new file mode 100644
index 00000000000..5d0f1b87602
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextServicesSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextSupport$BCSChild.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextSupport$BCSChild.class
new file mode 100644
index 00000000000..85298ff70a4
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextSupport$BCSChild.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextSupport$BCSIterator.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextSupport$BCSIterator.class
new file mode 100644
index 00000000000..e976f883174
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextSupport$BCSIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/beans/beancontext/BeanContextSupport.class b/libjava/classpath/lib/java/beans/beancontext/BeanContextSupport.class
new file mode 100644
index 00000000000..3b745035bd6
--- /dev/null
+++ b/libjava/classpath/lib/java/beans/beancontext/BeanContextSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/BufferedInputStream.class b/libjava/classpath/lib/java/io/BufferedInputStream.class
new file mode 100644
index 00000000000..ee9850be49e
--- /dev/null
+++ b/libjava/classpath/lib/java/io/BufferedInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/BufferedOutputStream.class b/libjava/classpath/lib/java/io/BufferedOutputStream.class
new file mode 100644
index 00000000000..d39a9d93d57
--- /dev/null
+++ b/libjava/classpath/lib/java/io/BufferedOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/BufferedReader.class b/libjava/classpath/lib/java/io/BufferedReader.class
new file mode 100644
index 00000000000..efe3c2caf90
--- /dev/null
+++ b/libjava/classpath/lib/java/io/BufferedReader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/BufferedWriter.class b/libjava/classpath/lib/java/io/BufferedWriter.class
new file mode 100644
index 00000000000..167054da892
--- /dev/null
+++ b/libjava/classpath/lib/java/io/BufferedWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ByteArrayInputStream.class b/libjava/classpath/lib/java/io/ByteArrayInputStream.class
new file mode 100644
index 00000000000..637f2e2adf8
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ByteArrayInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ByteArrayOutputStream.class b/libjava/classpath/lib/java/io/ByteArrayOutputStream.class
new file mode 100644
index 00000000000..7f23a4b1262
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ByteArrayOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/CharArrayReader.class b/libjava/classpath/lib/java/io/CharArrayReader.class
new file mode 100644
index 00000000000..e4fe697a35f
--- /dev/null
+++ b/libjava/classpath/lib/java/io/CharArrayReader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/CharArrayWriter.class b/libjava/classpath/lib/java/io/CharArrayWriter.class
new file mode 100644
index 00000000000..b5d557c6d89
--- /dev/null
+++ b/libjava/classpath/lib/java/io/CharArrayWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/CharConversionException.class b/libjava/classpath/lib/java/io/CharConversionException.class
new file mode 100644
index 00000000000..2c9b2e39397
--- /dev/null
+++ b/libjava/classpath/lib/java/io/CharConversionException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/Closeable.class b/libjava/classpath/lib/java/io/Closeable.class
new file mode 100644
index 00000000000..e47f5e4dbbb
--- /dev/null
+++ b/libjava/classpath/lib/java/io/Closeable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/DataInput.class b/libjava/classpath/lib/java/io/DataInput.class
new file mode 100644
index 00000000000..384a9febd30
--- /dev/null
+++ b/libjava/classpath/lib/java/io/DataInput.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/DataInputStream.class b/libjava/classpath/lib/java/io/DataInputStream.class
new file mode 100644
index 00000000000..6730b4a9241
--- /dev/null
+++ b/libjava/classpath/lib/java/io/DataInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/DataOutput.class b/libjava/classpath/lib/java/io/DataOutput.class
new file mode 100644
index 00000000000..0e4c74c1eb4
--- /dev/null
+++ b/libjava/classpath/lib/java/io/DataOutput.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/DataOutputStream.class b/libjava/classpath/lib/java/io/DataOutputStream.class
new file mode 100644
index 00000000000..228fbeb7401
--- /dev/null
+++ b/libjava/classpath/lib/java/io/DataOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/DeleteFileHelper$1.class b/libjava/classpath/lib/java/io/DeleteFileHelper$1.class
new file mode 100644
index 00000000000..c9ecae4ca58
--- /dev/null
+++ b/libjava/classpath/lib/java/io/DeleteFileHelper$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/DeleteFileHelper.class b/libjava/classpath/lib/java/io/DeleteFileHelper.class
new file mode 100644
index 00000000000..14570bd29eb
--- /dev/null
+++ b/libjava/classpath/lib/java/io/DeleteFileHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/EOFException.class b/libjava/classpath/lib/java/io/EOFException.class
new file mode 100644
index 00000000000..48252ca0fbd
--- /dev/null
+++ b/libjava/classpath/lib/java/io/EOFException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/Externalizable.class b/libjava/classpath/lib/java/io/Externalizable.class
new file mode 100644
index 00000000000..5de5c5ed66c
--- /dev/null
+++ b/libjava/classpath/lib/java/io/Externalizable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/File.class b/libjava/classpath/lib/java/io/File.class
new file mode 100644
index 00000000000..06a7442a3a9
--- /dev/null
+++ b/libjava/classpath/lib/java/io/File.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/FileDescriptor.class b/libjava/classpath/lib/java/io/FileDescriptor.class
new file mode 100644
index 00000000000..a04a8a1998f
--- /dev/null
+++ b/libjava/classpath/lib/java/io/FileDescriptor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/FileFilter.class b/libjava/classpath/lib/java/io/FileFilter.class
new file mode 100644
index 00000000000..6f80d89c9c4
--- /dev/null
+++ b/libjava/classpath/lib/java/io/FileFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/FileInputStream.class b/libjava/classpath/lib/java/io/FileInputStream.class
new file mode 100644
index 00000000000..13b283e916d
--- /dev/null
+++ b/libjava/classpath/lib/java/io/FileInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/FileNotFoundException.class b/libjava/classpath/lib/java/io/FileNotFoundException.class
new file mode 100644
index 00000000000..ceefd617fba
--- /dev/null
+++ b/libjava/classpath/lib/java/io/FileNotFoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/FileOutputStream.class b/libjava/classpath/lib/java/io/FileOutputStream.class
new file mode 100644
index 00000000000..d01dbbec17c
--- /dev/null
+++ b/libjava/classpath/lib/java/io/FileOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/FilePermission.class b/libjava/classpath/lib/java/io/FilePermission.class
new file mode 100644
index 00000000000..c5356442f25
--- /dev/null
+++ b/libjava/classpath/lib/java/io/FilePermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/FileReader.class b/libjava/classpath/lib/java/io/FileReader.class
new file mode 100644
index 00000000000..ed97856c4ea
--- /dev/null
+++ b/libjava/classpath/lib/java/io/FileReader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/FileWriter.class b/libjava/classpath/lib/java/io/FileWriter.class
new file mode 100644
index 00000000000..f8cbdfc2dfe
--- /dev/null
+++ b/libjava/classpath/lib/java/io/FileWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/FilenameFilter.class b/libjava/classpath/lib/java/io/FilenameFilter.class
new file mode 100644
index 00000000000..4eaf5af0887
--- /dev/null
+++ b/libjava/classpath/lib/java/io/FilenameFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/FilterInputStream.class b/libjava/classpath/lib/java/io/FilterInputStream.class
new file mode 100644
index 00000000000..20e17edca82
--- /dev/null
+++ b/libjava/classpath/lib/java/io/FilterInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/FilterOutputStream.class b/libjava/classpath/lib/java/io/FilterOutputStream.class
new file mode 100644
index 00000000000..958701f045a
--- /dev/null
+++ b/libjava/classpath/lib/java/io/FilterOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/FilterReader.class b/libjava/classpath/lib/java/io/FilterReader.class
new file mode 100644
index 00000000000..3a2511e1d8e
--- /dev/null
+++ b/libjava/classpath/lib/java/io/FilterReader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/FilterWriter.class b/libjava/classpath/lib/java/io/FilterWriter.class
new file mode 100644
index 00000000000..393312c942e
--- /dev/null
+++ b/libjava/classpath/lib/java/io/FilterWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/Flushable.class b/libjava/classpath/lib/java/io/Flushable.class
new file mode 100644
index 00000000000..66335634686
--- /dev/null
+++ b/libjava/classpath/lib/java/io/Flushable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/IOException.class b/libjava/classpath/lib/java/io/IOException.class
new file mode 100644
index 00000000000..8ace2958ee6
--- /dev/null
+++ b/libjava/classpath/lib/java/io/IOException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/InputStream.class b/libjava/classpath/lib/java/io/InputStream.class
new file mode 100644
index 00000000000..6839fb8fc09
--- /dev/null
+++ b/libjava/classpath/lib/java/io/InputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/InputStreamReader.class b/libjava/classpath/lib/java/io/InputStreamReader.class
new file mode 100644
index 00000000000..8e752b9e606
--- /dev/null
+++ b/libjava/classpath/lib/java/io/InputStreamReader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/InterruptedIOException.class b/libjava/classpath/lib/java/io/InterruptedIOException.class
new file mode 100644
index 00000000000..0025ea890ec
--- /dev/null
+++ b/libjava/classpath/lib/java/io/InterruptedIOException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/InvalidClassException.class b/libjava/classpath/lib/java/io/InvalidClassException.class
new file mode 100644
index 00000000000..df3aa4d98b9
--- /dev/null
+++ b/libjava/classpath/lib/java/io/InvalidClassException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/InvalidObjectException.class b/libjava/classpath/lib/java/io/InvalidObjectException.class
new file mode 100644
index 00000000000..dca02dfb540
--- /dev/null
+++ b/libjava/classpath/lib/java/io/InvalidObjectException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/LineNumberInputStream.class b/libjava/classpath/lib/java/io/LineNumberInputStream.class
new file mode 100644
index 00000000000..f422337ca4b
--- /dev/null
+++ b/libjava/classpath/lib/java/io/LineNumberInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/LineNumberReader.class b/libjava/classpath/lib/java/io/LineNumberReader.class
new file mode 100644
index 00000000000..2b1f52dc642
--- /dev/null
+++ b/libjava/classpath/lib/java/io/LineNumberReader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/NotActiveException.class b/libjava/classpath/lib/java/io/NotActiveException.class
new file mode 100644
index 00000000000..55fd435de77
--- /dev/null
+++ b/libjava/classpath/lib/java/io/NotActiveException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/NotSerializableException.class b/libjava/classpath/lib/java/io/NotSerializableException.class
new file mode 100644
index 00000000000..f7bec05f427
--- /dev/null
+++ b/libjava/classpath/lib/java/io/NotSerializableException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectInput.class b/libjava/classpath/lib/java/io/ObjectInput.class
new file mode 100644
index 00000000000..f0d1a9ea8e4
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectInput.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectInputStream$1.class b/libjava/classpath/lib/java/io/ObjectInputStream$1.class
new file mode 100644
index 00000000000..43e3a0c23fc
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectInputStream$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectInputStream$2.class b/libjava/classpath/lib/java/io/ObjectInputStream$2.class
new file mode 100644
index 00000000000..053a354bde5
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectInputStream$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectInputStream$GetField.class b/libjava/classpath/lib/java/io/ObjectInputStream$GetField.class
new file mode 100644
index 00000000000..da4ee377470
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectInputStream$GetField.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectInputStream$ValidatorAndPriority.class b/libjava/classpath/lib/java/io/ObjectInputStream$ValidatorAndPriority.class
new file mode 100644
index 00000000000..ee951cfdb05
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectInputStream$ValidatorAndPriority.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectInputStream.class b/libjava/classpath/lib/java/io/ObjectInputStream.class
new file mode 100644
index 00000000000..d6ae861ea0c
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectInputValidation.class b/libjava/classpath/lib/java/io/ObjectInputValidation.class
new file mode 100644
index 00000000000..cfc25151e85
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectInputValidation.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectOutput.class b/libjava/classpath/lib/java/io/ObjectOutput.class
new file mode 100644
index 00000000000..ccc1902d67c
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectOutput.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectOutputStream$1.class b/libjava/classpath/lib/java/io/ObjectOutputStream$1.class
new file mode 100644
index 00000000000..56e2f75d352
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectOutputStream$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectOutputStream$PutField.class b/libjava/classpath/lib/java/io/ObjectOutputStream$PutField.class
new file mode 100644
index 00000000000..87df0f1cbec
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectOutputStream$PutField.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectOutputStream.class b/libjava/classpath/lib/java/io/ObjectOutputStream.class
new file mode 100644
index 00000000000..fb3f40a9d74
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectStreamClass$1.class b/libjava/classpath/lib/java/io/ObjectStreamClass$1.class
new file mode 100644
index 00000000000..6279a244cd8
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectStreamClass$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectStreamClass$2.class b/libjava/classpath/lib/java/io/ObjectStreamClass$2.class
new file mode 100644
index 00000000000..4c91ea650b2
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectStreamClass$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectStreamClass$InterfaceComparator.class b/libjava/classpath/lib/java/io/ObjectStreamClass$InterfaceComparator.class
new file mode 100644
index 00000000000..7c0ac37ee2f
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectStreamClass$InterfaceComparator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectStreamClass$MemberComparator.class b/libjava/classpath/lib/java/io/ObjectStreamClass$MemberComparator.class
new file mode 100644
index 00000000000..233aa690ae4
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectStreamClass$MemberComparator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectStreamClass.class b/libjava/classpath/lib/java/io/ObjectStreamClass.class
new file mode 100644
index 00000000000..e0d9e7f21b2
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectStreamClass.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectStreamConstants.class b/libjava/classpath/lib/java/io/ObjectStreamConstants.class
new file mode 100644
index 00000000000..6fa614618ed
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectStreamConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectStreamException.class b/libjava/classpath/lib/java/io/ObjectStreamException.class
new file mode 100644
index 00000000000..376b1710397
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectStreamException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectStreamField$1.class b/libjava/classpath/lib/java/io/ObjectStreamField$1.class
new file mode 100644
index 00000000000..bdc0407212a
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectStreamField$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/ObjectStreamField.class b/libjava/classpath/lib/java/io/ObjectStreamField.class
new file mode 100644
index 00000000000..7877ba80525
--- /dev/null
+++ b/libjava/classpath/lib/java/io/ObjectStreamField.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/OptionalDataException.class b/libjava/classpath/lib/java/io/OptionalDataException.class
new file mode 100644
index 00000000000..a1d6b6cf045
--- /dev/null
+++ b/libjava/classpath/lib/java/io/OptionalDataException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/OutputStream.class b/libjava/classpath/lib/java/io/OutputStream.class
new file mode 100644
index 00000000000..48cb02fa457
--- /dev/null
+++ b/libjava/classpath/lib/java/io/OutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/OutputStreamWriter.class b/libjava/classpath/lib/java/io/OutputStreamWriter.class
new file mode 100644
index 00000000000..16013787972
--- /dev/null
+++ b/libjava/classpath/lib/java/io/OutputStreamWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/PipedInputStream.class b/libjava/classpath/lib/java/io/PipedInputStream.class
new file mode 100644
index 00000000000..b2c32046a97
--- /dev/null
+++ b/libjava/classpath/lib/java/io/PipedInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/PipedOutputStream.class b/libjava/classpath/lib/java/io/PipedOutputStream.class
new file mode 100644
index 00000000000..480b7aa4a55
--- /dev/null
+++ b/libjava/classpath/lib/java/io/PipedOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/PipedReader.class b/libjava/classpath/lib/java/io/PipedReader.class
new file mode 100644
index 00000000000..d63d4dee52d
--- /dev/null
+++ b/libjava/classpath/lib/java/io/PipedReader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/PipedWriter.class b/libjava/classpath/lib/java/io/PipedWriter.class
new file mode 100644
index 00000000000..d032a5e2364
--- /dev/null
+++ b/libjava/classpath/lib/java/io/PipedWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/PrintStream.class b/libjava/classpath/lib/java/io/PrintStream.class
new file mode 100644
index 00000000000..c5db701b9df
--- /dev/null
+++ b/libjava/classpath/lib/java/io/PrintStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/PrintWriter.class b/libjava/classpath/lib/java/io/PrintWriter.class
new file mode 100644
index 00000000000..1b4258ffb61
--- /dev/null
+++ b/libjava/classpath/lib/java/io/PrintWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/PushbackInputStream.class b/libjava/classpath/lib/java/io/PushbackInputStream.class
new file mode 100644
index 00000000000..1d9c17e77e8
--- /dev/null
+++ b/libjava/classpath/lib/java/io/PushbackInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/PushbackReader.class b/libjava/classpath/lib/java/io/PushbackReader.class
new file mode 100644
index 00000000000..c890c21685a
--- /dev/null
+++ b/libjava/classpath/lib/java/io/PushbackReader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/RandomAccessFile.class b/libjava/classpath/lib/java/io/RandomAccessFile.class
new file mode 100644
index 00000000000..61322e8a56c
--- /dev/null
+++ b/libjava/classpath/lib/java/io/RandomAccessFile.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/Reader.class b/libjava/classpath/lib/java/io/Reader.class
new file mode 100644
index 00000000000..e18637f8728
--- /dev/null
+++ b/libjava/classpath/lib/java/io/Reader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/SequenceInputStream.class b/libjava/classpath/lib/java/io/SequenceInputStream.class
new file mode 100644
index 00000000000..69f28ff7251
--- /dev/null
+++ b/libjava/classpath/lib/java/io/SequenceInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/Serializable.class b/libjava/classpath/lib/java/io/Serializable.class
new file mode 100644
index 00000000000..dbf1442165e
--- /dev/null
+++ b/libjava/classpath/lib/java/io/Serializable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/SerializablePermission.class b/libjava/classpath/lib/java/io/SerializablePermission.class
new file mode 100644
index 00000000000..8b687ead5f6
--- /dev/null
+++ b/libjava/classpath/lib/java/io/SerializablePermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/StreamCorruptedException.class b/libjava/classpath/lib/java/io/StreamCorruptedException.class
new file mode 100644
index 00000000000..0c064216cba
--- /dev/null
+++ b/libjava/classpath/lib/java/io/StreamCorruptedException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/StreamTokenizer.class b/libjava/classpath/lib/java/io/StreamTokenizer.class
new file mode 100644
index 00000000000..b9ee6f70965
--- /dev/null
+++ b/libjava/classpath/lib/java/io/StreamTokenizer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/StringBufferInputStream.class b/libjava/classpath/lib/java/io/StringBufferInputStream.class
new file mode 100644
index 00000000000..5e56f154b2f
--- /dev/null
+++ b/libjava/classpath/lib/java/io/StringBufferInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/StringReader.class b/libjava/classpath/lib/java/io/StringReader.class
new file mode 100644
index 00000000000..a81a99b5f63
--- /dev/null
+++ b/libjava/classpath/lib/java/io/StringReader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/StringWriter.class b/libjava/classpath/lib/java/io/StringWriter.class
new file mode 100644
index 00000000000..0206af0969a
--- /dev/null
+++ b/libjava/classpath/lib/java/io/StringWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/SyncFailedException.class b/libjava/classpath/lib/java/io/SyncFailedException.class
new file mode 100644
index 00000000000..e8f7c7da63f
--- /dev/null
+++ b/libjava/classpath/lib/java/io/SyncFailedException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/UTFDataFormatException.class b/libjava/classpath/lib/java/io/UTFDataFormatException.class
new file mode 100644
index 00000000000..1b4df0dd804
--- /dev/null
+++ b/libjava/classpath/lib/java/io/UTFDataFormatException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/UnsupportedEncodingException.class b/libjava/classpath/lib/java/io/UnsupportedEncodingException.class
new file mode 100644
index 00000000000..aaac133dca8
--- /dev/null
+++ b/libjava/classpath/lib/java/io/UnsupportedEncodingException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/VMObjectInputStream.class b/libjava/classpath/lib/java/io/VMObjectInputStream.class
new file mode 100644
index 00000000000..71147789f0b
--- /dev/null
+++ b/libjava/classpath/lib/java/io/VMObjectInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/VMObjectStreamClass.class b/libjava/classpath/lib/java/io/VMObjectStreamClass.class
new file mode 100644
index 00000000000..f73400c4c96
--- /dev/null
+++ b/libjava/classpath/lib/java/io/VMObjectStreamClass.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/WriteAbortedException.class b/libjava/classpath/lib/java/io/WriteAbortedException.class
new file mode 100644
index 00000000000..8ca44710d72
--- /dev/null
+++ b/libjava/classpath/lib/java/io/WriteAbortedException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/io/Writer.class b/libjava/classpath/lib/java/io/Writer.class
new file mode 100644
index 00000000000..dcccbe06e22
--- /dev/null
+++ b/libjava/classpath/lib/java/io/Writer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/AbstractMethodError.class b/libjava/classpath/lib/java/lang/AbstractMethodError.class
new file mode 100644
index 00000000000..625357d5b7e
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/AbstractMethodError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Appendable.class b/libjava/classpath/lib/java/lang/Appendable.class
new file mode 100644
index 00000000000..5e4f77eb9eb
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Appendable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ArithmeticException.class b/libjava/classpath/lib/java/lang/ArithmeticException.class
new file mode 100644
index 00000000000..1be9eecd328
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ArithmeticException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ArrayIndexOutOfBoundsException.class b/libjava/classpath/lib/java/lang/ArrayIndexOutOfBoundsException.class
new file mode 100644
index 00000000000..82bf0f0ee4d
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ArrayIndexOutOfBoundsException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ArrayStoreException.class b/libjava/classpath/lib/java/lang/ArrayStoreException.class
new file mode 100644
index 00000000000..4e20e87e3cf
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ArrayStoreException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/AssertionError.class b/libjava/classpath/lib/java/lang/AssertionError.class
new file mode 100644
index 00000000000..e81c3c60d33
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/AssertionError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Boolean.class b/libjava/classpath/lib/java/lang/Boolean.class
new file mode 100644
index 00000000000..820c590167e
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Boolean.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Byte.class b/libjava/classpath/lib/java/lang/Byte.class
new file mode 100644
index 00000000000..1ace4ada996
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Byte.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/CharSequence.class b/libjava/classpath/lib/java/lang/CharSequence.class
new file mode 100644
index 00000000000..8abd02a9331
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/CharSequence.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Character$Subset.class b/libjava/classpath/lib/java/lang/Character$Subset.class
new file mode 100644
index 00000000000..5a928021d65
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Character$Subset.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Character$UnicodeBlock.class b/libjava/classpath/lib/java/lang/Character$UnicodeBlock.class
new file mode 100644
index 00000000000..fddba6abbb1
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Character$UnicodeBlock.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Character.class b/libjava/classpath/lib/java/lang/Character.class
new file mode 100644
index 00000000000..3d41ebef22d
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Character.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Class.class b/libjava/classpath/lib/java/lang/Class.class
new file mode 100644
index 00000000000..13b56116d94
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Class.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ClassCastException.class b/libjava/classpath/lib/java/lang/ClassCastException.class
new file mode 100644
index 00000000000..d7700242f35
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ClassCastException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ClassCircularityError.class b/libjava/classpath/lib/java/lang/ClassCircularityError.class
new file mode 100644
index 00000000000..4651dab1e76
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ClassCircularityError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ClassFormatError.class b/libjava/classpath/lib/java/lang/ClassFormatError.class
new file mode 100644
index 00000000000..a0a3352c440
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ClassFormatError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ClassLoader$AnnotationsKey.class b/libjava/classpath/lib/java/lang/ClassLoader$AnnotationsKey.class
new file mode 100644
index 00000000000..5f0b96d7acf
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ClassLoader$AnnotationsKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ClassLoader.class b/libjava/classpath/lib/java/lang/ClassLoader.class
new file mode 100644
index 00000000000..5cbd090872a
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ClassLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ClassNotFoundException.class b/libjava/classpath/lib/java/lang/ClassNotFoundException.class
new file mode 100644
index 00000000000..27239e48359
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ClassNotFoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/CloneNotSupportedException.class b/libjava/classpath/lib/java/lang/CloneNotSupportedException.class
new file mode 100644
index 00000000000..3b942f46479
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/CloneNotSupportedException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Cloneable.class b/libjava/classpath/lib/java/lang/Cloneable.class
new file mode 100644
index 00000000000..313c5247485
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Cloneable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Comparable.class b/libjava/classpath/lib/java/lang/Comparable.class
new file mode 100644
index 00000000000..3051c4fd10f
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Comparable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Compiler.class b/libjava/classpath/lib/java/lang/Compiler.class
new file mode 100644
index 00000000000..02bbf9ce22c
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Compiler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Deprecated.class b/libjava/classpath/lib/java/lang/Deprecated.class
new file mode 100644
index 00000000000..676228576f0
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Deprecated.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Double.class b/libjava/classpath/lib/java/lang/Double.class
new file mode 100644
index 00000000000..d6757549165
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Double.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/EcosProcess.class b/libjava/classpath/lib/java/lang/EcosProcess.class
new file mode 100644
index 00000000000..f306e4c87af
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/EcosProcess.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Enum.class b/libjava/classpath/lib/java/lang/Enum.class
new file mode 100644
index 00000000000..e7961262241
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Enum.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/EnumConstantNotPresentException.class b/libjava/classpath/lib/java/lang/EnumConstantNotPresentException.class
new file mode 100644
index 00000000000..dd66f1cead0
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/EnumConstantNotPresentException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Error.class b/libjava/classpath/lib/java/lang/Error.class
new file mode 100644
index 00000000000..20eb8cb977c
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Error.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Exception.class b/libjava/classpath/lib/java/lang/Exception.class
new file mode 100644
index 00000000000..cc0a6ce77eb
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Exception.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ExceptionInInitializerError.class b/libjava/classpath/lib/java/lang/ExceptionInInitializerError.class
new file mode 100644
index 00000000000..26ca8577673
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ExceptionInInitializerError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Float.class b/libjava/classpath/lib/java/lang/Float.class
new file mode 100644
index 00000000000..42732a6f381
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Float.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/IllegalAccessError.class b/libjava/classpath/lib/java/lang/IllegalAccessError.class
new file mode 100644
index 00000000000..ef0dedacf7d
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/IllegalAccessError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/IllegalAccessException.class b/libjava/classpath/lib/java/lang/IllegalAccessException.class
new file mode 100644
index 00000000000..e5dd5b449a7
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/IllegalAccessException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/IllegalArgumentException.class b/libjava/classpath/lib/java/lang/IllegalArgumentException.class
new file mode 100644
index 00000000000..11a02e9e814
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/IllegalArgumentException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/IllegalMonitorStateException.class b/libjava/classpath/lib/java/lang/IllegalMonitorStateException.class
new file mode 100644
index 00000000000..8e7de1e0774
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/IllegalMonitorStateException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/IllegalStateException.class b/libjava/classpath/lib/java/lang/IllegalStateException.class
new file mode 100644
index 00000000000..08bcb4d3ab1
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/IllegalStateException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/IllegalThreadStateException.class b/libjava/classpath/lib/java/lang/IllegalThreadStateException.class
new file mode 100644
index 00000000000..e75e16b1e47
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/IllegalThreadStateException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/IncompatibleClassChangeError.class b/libjava/classpath/lib/java/lang/IncompatibleClassChangeError.class
new file mode 100644
index 00000000000..b5f1c8216d2
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/IncompatibleClassChangeError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/IndexOutOfBoundsException.class b/libjava/classpath/lib/java/lang/IndexOutOfBoundsException.class
new file mode 100644
index 00000000000..b33f109955f
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/IndexOutOfBoundsException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/InheritableThreadLocal.class b/libjava/classpath/lib/java/lang/InheritableThreadLocal.class
new file mode 100644
index 00000000000..3eea8f7bb47
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/InheritableThreadLocal.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/InstantiationError.class b/libjava/classpath/lib/java/lang/InstantiationError.class
new file mode 100644
index 00000000000..9dd5fc20042
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/InstantiationError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/InstantiationException.class b/libjava/classpath/lib/java/lang/InstantiationException.class
new file mode 100644
index 00000000000..60311a8eb8f
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/InstantiationException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Integer.class b/libjava/classpath/lib/java/lang/Integer.class
new file mode 100644
index 00000000000..3fc97252e29
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Integer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/InternalError.class b/libjava/classpath/lib/java/lang/InternalError.class
new file mode 100644
index 00000000000..6e61654b539
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/InternalError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/InterruptedException.class b/libjava/classpath/lib/java/lang/InterruptedException.class
new file mode 100644
index 00000000000..6504769956f
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/InterruptedException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Iterable.class b/libjava/classpath/lib/java/lang/Iterable.class
new file mode 100644
index 00000000000..973203260c2
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Iterable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/LinkageError.class b/libjava/classpath/lib/java/lang/LinkageError.class
new file mode 100644
index 00000000000..b297fe1b51b
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/LinkageError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Long.class b/libjava/classpath/lib/java/lang/Long.class
new file mode 100644
index 00000000000..df9dc0ce90f
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Long.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Math.class b/libjava/classpath/lib/java/lang/Math.class
new file mode 100644
index 00000000000..612c3655535
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Math.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/NegativeArraySizeException.class b/libjava/classpath/lib/java/lang/NegativeArraySizeException.class
new file mode 100644
index 00000000000..9749e1bf370
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/NegativeArraySizeException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/NoClassDefFoundError.class b/libjava/classpath/lib/java/lang/NoClassDefFoundError.class
new file mode 100644
index 00000000000..58e72ba3058
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/NoClassDefFoundError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/NoSuchFieldError.class b/libjava/classpath/lib/java/lang/NoSuchFieldError.class
new file mode 100644
index 00000000000..28df34afcbd
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/NoSuchFieldError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/NoSuchFieldException.class b/libjava/classpath/lib/java/lang/NoSuchFieldException.class
new file mode 100644
index 00000000000..4ead8e6eec1
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/NoSuchFieldException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/NoSuchMethodError.class b/libjava/classpath/lib/java/lang/NoSuchMethodError.class
new file mode 100644
index 00000000000..73d94719415
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/NoSuchMethodError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/NoSuchMethodException.class b/libjava/classpath/lib/java/lang/NoSuchMethodException.class
new file mode 100644
index 00000000000..47cacd0af19
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/NoSuchMethodException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/NullPointerException.class b/libjava/classpath/lib/java/lang/NullPointerException.class
new file mode 100644
index 00000000000..78457726131
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/NullPointerException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Number.class b/libjava/classpath/lib/java/lang/Number.class
new file mode 100644
index 00000000000..cb609da71e9
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Number.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/NumberFormatException.class b/libjava/classpath/lib/java/lang/NumberFormatException.class
new file mode 100644
index 00000000000..447205f3e44
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/NumberFormatException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Object.class b/libjava/classpath/lib/java/lang/Object.class
new file mode 100644
index 00000000000..40563bf1549
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Object.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/OutOfMemoryError.class b/libjava/classpath/lib/java/lang/OutOfMemoryError.class
new file mode 100644
index 00000000000..c7bcaa02cb1
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/OutOfMemoryError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Override.class b/libjava/classpath/lib/java/lang/Override.class
new file mode 100644
index 00000000000..15a0dd46663
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Override.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Package.class b/libjava/classpath/lib/java/lang/Package.class
new file mode 100644
index 00000000000..e0b732347d5
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Package.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/PosixProcess$EOFInputStream.class b/libjava/classpath/lib/java/lang/PosixProcess$EOFInputStream.class
new file mode 100644
index 00000000000..b9e9c72bafb
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/PosixProcess$EOFInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/PosixProcess$ProcessManager.class b/libjava/classpath/lib/java/lang/PosixProcess$ProcessManager.class
new file mode 100644
index 00000000000..4c4024141a7
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/PosixProcess$ProcessManager.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/PosixProcess.class b/libjava/classpath/lib/java/lang/PosixProcess.class
new file mode 100644
index 00000000000..f7c52649fb9
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/PosixProcess.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Process.class b/libjava/classpath/lib/java/lang/Process.class
new file mode 100644
index 00000000000..b6c01653af3
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Process.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ProcessBuilder.class b/libjava/classpath/lib/java/lang/ProcessBuilder.class
new file mode 100644
index 00000000000..10bbc8183bd
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ProcessBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Readable.class b/libjava/classpath/lib/java/lang/Readable.class
new file mode 100644
index 00000000000..1c0e440b839
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Readable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Runnable.class b/libjava/classpath/lib/java/lang/Runnable.class
new file mode 100644
index 00000000000..417dd2ed2f7
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Runnable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Runtime.class b/libjava/classpath/lib/java/lang/Runtime.class
new file mode 100644
index 00000000000..620f1c8af9f
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Runtime.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/RuntimeException.class b/libjava/classpath/lib/java/lang/RuntimeException.class
new file mode 100644
index 00000000000..3e7f3434dd0
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/RuntimeException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/RuntimePermission.class b/libjava/classpath/lib/java/lang/RuntimePermission.class
new file mode 100644
index 00000000000..2d30ce604e5
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/RuntimePermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/SecurityException.class b/libjava/classpath/lib/java/lang/SecurityException.class
new file mode 100644
index 00000000000..f49f047647d
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/SecurityException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/SecurityManager$1.class b/libjava/classpath/lib/java/lang/SecurityManager$1.class
new file mode 100644
index 00000000000..176f5ed9ec6
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/SecurityManager$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/SecurityManager.class b/libjava/classpath/lib/java/lang/SecurityManager.class
new file mode 100644
index 00000000000..c8c93029712
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/SecurityManager.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Short.class b/libjava/classpath/lib/java/lang/Short.class
new file mode 100644
index 00000000000..0c6abf13070
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Short.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/StackOverflowError.class b/libjava/classpath/lib/java/lang/StackOverflowError.class
new file mode 100644
index 00000000000..a661920e791
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/StackOverflowError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/StackTraceElement.class b/libjava/classpath/lib/java/lang/StackTraceElement.class
new file mode 100644
index 00000000000..623d8d9e2a9
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/StackTraceElement.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/StrictMath.class b/libjava/classpath/lib/java/lang/StrictMath.class
new file mode 100644
index 00000000000..e56d06760df
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/StrictMath.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/String$CaseInsensitiveComparator.class b/libjava/classpath/lib/java/lang/String$CaseInsensitiveComparator.class
new file mode 100644
index 00000000000..ffb4541d293
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/String$CaseInsensitiveComparator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/String.class b/libjava/classpath/lib/java/lang/String.class
new file mode 100644
index 00000000000..873c22c546d
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/String.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/StringBuffer.class b/libjava/classpath/lib/java/lang/StringBuffer.class
new file mode 100644
index 00000000000..6fca27a3fad
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/StringBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/StringBuilder.class b/libjava/classpath/lib/java/lang/StringBuilder.class
new file mode 100644
index 00000000000..8636b53aa5d
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/StringBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/StringIndexOutOfBoundsException.class b/libjava/classpath/lib/java/lang/StringIndexOutOfBoundsException.class
new file mode 100644
index 00000000000..0debd302b6f
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/StringIndexOutOfBoundsException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/SuppressWarnings.class b/libjava/classpath/lib/java/lang/SuppressWarnings.class
new file mode 100644
index 00000000000..9c41ba051e0
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/SuppressWarnings.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/System$EnvironmentCollection.class b/libjava/classpath/lib/java/lang/System$EnvironmentCollection.class
new file mode 100644
index 00000000000..dd6d4c0d492
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/System$EnvironmentCollection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/System$EnvironmentMap.class b/libjava/classpath/lib/java/lang/System$EnvironmentMap.class
new file mode 100644
index 00000000000..b06eeb938cb
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/System$EnvironmentMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/System$EnvironmentSet.class b/libjava/classpath/lib/java/lang/System$EnvironmentSet.class
new file mode 100644
index 00000000000..6510f9563e4
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/System$EnvironmentSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/System.class b/libjava/classpath/lib/java/lang/System.class
new file mode 100644
index 00000000000..dfc895a9f95
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/System.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Thread$State.class b/libjava/classpath/lib/java/lang/Thread$State.class
new file mode 100644
index 00000000000..a7d5a333f22
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Thread$State.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Thread$UncaughtExceptionHandler.class b/libjava/classpath/lib/java/lang/Thread$UncaughtExceptionHandler.class
new file mode 100644
index 00000000000..d4fa204a05a
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Thread$UncaughtExceptionHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Thread.class b/libjava/classpath/lib/java/lang/Thread.class
new file mode 100644
index 00000000000..7c33d004474
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Thread.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ThreadDeath.class b/libjava/classpath/lib/java/lang/ThreadDeath.class
new file mode 100644
index 00000000000..4205d7d640c
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ThreadDeath.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ThreadGroup.class b/libjava/classpath/lib/java/lang/ThreadGroup.class
new file mode 100644
index 00000000000..a9e5a1e7b23
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ThreadGroup.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ThreadLocal.class b/libjava/classpath/lib/java/lang/ThreadLocal.class
new file mode 100644
index 00000000000..35c7fb8e56c
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ThreadLocal.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Throwable$StaticData.class b/libjava/classpath/lib/java/lang/Throwable$StaticData.class
new file mode 100644
index 00000000000..540bf1d49ad
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Throwable$StaticData.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Throwable.class b/libjava/classpath/lib/java/lang/Throwable.class
new file mode 100644
index 00000000000..3f3b5ffddfd
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Throwable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/TypeNotPresentException.class b/libjava/classpath/lib/java/lang/TypeNotPresentException.class
new file mode 100644
index 00000000000..de8756ef651
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/TypeNotPresentException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/UnknownError.class b/libjava/classpath/lib/java/lang/UnknownError.class
new file mode 100644
index 00000000000..434c66b3dd0
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/UnknownError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/UnsatisfiedLinkError.class b/libjava/classpath/lib/java/lang/UnsatisfiedLinkError.class
new file mode 100644
index 00000000000..7381e8fb46e
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/UnsatisfiedLinkError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/UnsupportedClassVersionError.class b/libjava/classpath/lib/java/lang/UnsupportedClassVersionError.class
new file mode 100644
index 00000000000..fb59a023026
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/UnsupportedClassVersionError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/UnsupportedOperationException.class b/libjava/classpath/lib/java/lang/UnsupportedOperationException.class
new file mode 100644
index 00000000000..27f93ab84e9
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/UnsupportedOperationException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/VMClassLoader.class b/libjava/classpath/lib/java/lang/VMClassLoader.class
new file mode 100644
index 00000000000..1033291ffc3
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/VMClassLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/VMCompiler.class b/libjava/classpath/lib/java/lang/VMCompiler.class
new file mode 100644
index 00000000000..4b968fb48df
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/VMCompiler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/VMDouble.class b/libjava/classpath/lib/java/lang/VMDouble.class
new file mode 100644
index 00000000000..690c19e80f3
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/VMDouble.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/VMFloat.class b/libjava/classpath/lib/java/lang/VMFloat.class
new file mode 100644
index 00000000000..f2c252ea865
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/VMFloat.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/VMThrowable.class b/libjava/classpath/lib/java/lang/VMThrowable.class
new file mode 100644
index 00000000000..b561d559135
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/VMThrowable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/VerifyError.class b/libjava/classpath/lib/java/lang/VerifyError.class
new file mode 100644
index 00000000000..9e7f7d0a346
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/VerifyError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/VirtualMachineError.class b/libjava/classpath/lib/java/lang/VirtualMachineError.class
new file mode 100644
index 00000000000..d28aedfd4ed
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/VirtualMachineError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Void.class b/libjava/classpath/lib/java/lang/Void.class
new file mode 100644
index 00000000000..28864579db1
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Void.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Win32Process.class b/libjava/classpath/lib/java/lang/Win32Process.class
new file mode 100644
index 00000000000..4ee8415b917
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/Win32Process.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/annotation/Annotation.class b/libjava/classpath/lib/java/lang/annotation/Annotation.class
new file mode 100644
index 00000000000..ffa644d1149
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/annotation/Annotation.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/annotation/AnnotationFormatError.class b/libjava/classpath/lib/java/lang/annotation/AnnotationFormatError.class
new file mode 100644
index 00000000000..9e033050ab0
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/annotation/AnnotationFormatError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/annotation/AnnotationTypeMismatchException.class b/libjava/classpath/lib/java/lang/annotation/AnnotationTypeMismatchException.class
new file mode 100644
index 00000000000..0a5969470c5
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/annotation/AnnotationTypeMismatchException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/annotation/Documented.class b/libjava/classpath/lib/java/lang/annotation/Documented.class
new file mode 100644
index 00000000000..b0c3baf46df
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/annotation/Documented.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/annotation/ElementType.class b/libjava/classpath/lib/java/lang/annotation/ElementType.class
new file mode 100644
index 00000000000..09f77d0415c
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/annotation/ElementType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/annotation/IncompleteAnnotationException.class b/libjava/classpath/lib/java/lang/annotation/IncompleteAnnotationException.class
new file mode 100644
index 00000000000..3b13d92081b
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/annotation/IncompleteAnnotationException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/annotation/Inherited.class b/libjava/classpath/lib/java/lang/annotation/Inherited.class
new file mode 100644
index 00000000000..5916ecf2b32
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/annotation/Inherited.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/annotation/Retention.class b/libjava/classpath/lib/java/lang/annotation/Retention.class
new file mode 100644
index 00000000000..3badb946e25
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/annotation/Retention.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/annotation/RetentionPolicy.class b/libjava/classpath/lib/java/lang/annotation/RetentionPolicy.class
new file mode 100644
index 00000000000..e0bed52dacd
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/annotation/RetentionPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/annotation/Target.class b/libjava/classpath/lib/java/lang/annotation/Target.class
new file mode 100644
index 00000000000..1e7bf4c9820
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/annotation/Target.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/instrument/ClassDefinition.class b/libjava/classpath/lib/java/lang/instrument/ClassDefinition.class
new file mode 100644
index 00000000000..e1d143fb6cf
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/instrument/ClassDefinition.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/instrument/ClassFileTransformer.class b/libjava/classpath/lib/java/lang/instrument/ClassFileTransformer.class
new file mode 100644
index 00000000000..d52c8a89d5d
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/instrument/ClassFileTransformer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/instrument/IllegalClassFormatException.class b/libjava/classpath/lib/java/lang/instrument/IllegalClassFormatException.class
new file mode 100644
index 00000000000..a11446d756f
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/instrument/IllegalClassFormatException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/instrument/Instrumentation.class b/libjava/classpath/lib/java/lang/instrument/Instrumentation.class
new file mode 100644
index 00000000000..62d3e0bdc43
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/instrument/Instrumentation.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/instrument/UnmodifiableClassException.class b/libjava/classpath/lib/java/lang/instrument/UnmodifiableClassException.class
new file mode 100644
index 00000000000..c5c8e618ef5
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/instrument/UnmodifiableClassException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/ClassLoadingMXBean.class b/libjava/classpath/lib/java/lang/management/ClassLoadingMXBean.class
new file mode 100644
index 00000000000..0682224ecdc
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/ClassLoadingMXBean.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/CompilationMXBean.class b/libjava/classpath/lib/java/lang/management/CompilationMXBean.class
new file mode 100644
index 00000000000..452295df969
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/CompilationMXBean.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/GarbageCollectorMXBean.class b/libjava/classpath/lib/java/lang/management/GarbageCollectorMXBean.class
new file mode 100644
index 00000000000..64c5b0a7f02
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/GarbageCollectorMXBean.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/ManagementFactory.class b/libjava/classpath/lib/java/lang/management/ManagementFactory.class
new file mode 100644
index 00000000000..0d022ca4273
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/ManagementFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/ManagementPermission.class b/libjava/classpath/lib/java/lang/management/ManagementPermission.class
new file mode 100644
index 00000000000..194e9914c84
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/ManagementPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/MemoryMXBean.class b/libjava/classpath/lib/java/lang/management/MemoryMXBean.class
new file mode 100644
index 00000000000..019e5899ec9
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/MemoryMXBean.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/MemoryManagerMXBean.class b/libjava/classpath/lib/java/lang/management/MemoryManagerMXBean.class
new file mode 100644
index 00000000000..1ada025d038
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/MemoryManagerMXBean.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/MemoryNotificationInfo.class b/libjava/classpath/lib/java/lang/management/MemoryNotificationInfo.class
new file mode 100644
index 00000000000..1b64e3c9d9b
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/MemoryNotificationInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/MemoryPoolMXBean.class b/libjava/classpath/lib/java/lang/management/MemoryPoolMXBean.class
new file mode 100644
index 00000000000..748378a200d
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/MemoryPoolMXBean.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/MemoryType.class b/libjava/classpath/lib/java/lang/management/MemoryType.class
new file mode 100644
index 00000000000..74f016552f3
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/MemoryType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/MemoryUsage.class b/libjava/classpath/lib/java/lang/management/MemoryUsage.class
new file mode 100644
index 00000000000..401f08c6543
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/MemoryUsage.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/OperatingSystemMXBean.class b/libjava/classpath/lib/java/lang/management/OperatingSystemMXBean.class
new file mode 100644
index 00000000000..b63966b93f9
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/OperatingSystemMXBean.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/RuntimeMXBean.class b/libjava/classpath/lib/java/lang/management/RuntimeMXBean.class
new file mode 100644
index 00000000000..292d8b8b077
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/RuntimeMXBean.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/ThreadInfo.class b/libjava/classpath/lib/java/lang/management/ThreadInfo.class
new file mode 100644
index 00000000000..4f878343ad6
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/ThreadInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/ThreadMXBean.class b/libjava/classpath/lib/java/lang/management/ThreadMXBean.class
new file mode 100644
index 00000000000..af295c329df
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/ThreadMXBean.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/management/VMManagementFactory.class b/libjava/classpath/lib/java/lang/management/VMManagementFactory.class
new file mode 100644
index 00000000000..98185d22de3
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/management/VMManagementFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ref/PhantomReference.class b/libjava/classpath/lib/java/lang/ref/PhantomReference.class
new file mode 100644
index 00000000000..30e6eb00fa0
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ref/PhantomReference.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ref/Reference.class b/libjava/classpath/lib/java/lang/ref/Reference.class
new file mode 100644
index 00000000000..4ae53b32d34
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ref/Reference.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ref/ReferenceQueue.class b/libjava/classpath/lib/java/lang/ref/ReferenceQueue.class
new file mode 100644
index 00000000000..21557e3280c
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ref/ReferenceQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ref/SoftReference.class b/libjava/classpath/lib/java/lang/ref/SoftReference.class
new file mode 100644
index 00000000000..50bbf52fcff
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ref/SoftReference.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/ref/WeakReference.class b/libjava/classpath/lib/java/lang/ref/WeakReference.class
new file mode 100644
index 00000000000..634bd192a2e
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/ref/WeakReference.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/AccessibleObject.class b/libjava/classpath/lib/java/lang/reflect/AccessibleObject.class
new file mode 100644
index 00000000000..6f4023f2910
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/AccessibleObject.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/AnnotatedElement.class b/libjava/classpath/lib/java/lang/reflect/AnnotatedElement.class
new file mode 100644
index 00000000000..23294b2ca80
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/AnnotatedElement.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/Array.class b/libjava/classpath/lib/java/lang/reflect/Array.class
new file mode 100644
index 00000000000..62952c3d14c
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/Array.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/Constructor.class b/libjava/classpath/lib/java/lang/reflect/Constructor.class
new file mode 100644
index 00000000000..a54f69aeec0
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/Constructor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/Field.class b/libjava/classpath/lib/java/lang/reflect/Field.class
new file mode 100644
index 00000000000..24bfabdf732
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/Field.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/GenericArrayType.class b/libjava/classpath/lib/java/lang/reflect/GenericArrayType.class
new file mode 100644
index 00000000000..d7a60be409d
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/GenericArrayType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/GenericDeclaration.class b/libjava/classpath/lib/java/lang/reflect/GenericDeclaration.class
new file mode 100644
index 00000000000..89b7c79e2ec
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/GenericDeclaration.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/GenericSignatureFormatError.class b/libjava/classpath/lib/java/lang/reflect/GenericSignatureFormatError.class
new file mode 100644
index 00000000000..f2ffdbf0804
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/GenericSignatureFormatError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/InvocationHandler.class b/libjava/classpath/lib/java/lang/reflect/InvocationHandler.class
new file mode 100644
index 00000000000..df9fec65128
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/InvocationHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/InvocationTargetException.class b/libjava/classpath/lib/java/lang/reflect/InvocationTargetException.class
new file mode 100644
index 00000000000..fa53a89a74a
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/InvocationTargetException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/MalformedParameterizedTypeException.class b/libjava/classpath/lib/java/lang/reflect/MalformedParameterizedTypeException.class
new file mode 100644
index 00000000000..e94c2466aaf
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/MalformedParameterizedTypeException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/Member.class b/libjava/classpath/lib/java/lang/reflect/Member.class
new file mode 100644
index 00000000000..aca4f3daaac
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/Member.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/Method.class b/libjava/classpath/lib/java/lang/reflect/Method.class
new file mode 100644
index 00000000000..0a0b45cd514
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/Method.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/Modifier.class b/libjava/classpath/lib/java/lang/reflect/Modifier.class
new file mode 100644
index 00000000000..b4f5a31b032
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/Modifier.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/ParameterizedType.class b/libjava/classpath/lib/java/lang/reflect/ParameterizedType.class
new file mode 100644
index 00000000000..2edce1f8a03
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/ParameterizedType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/Proxy$ClassFactory.class b/libjava/classpath/lib/java/lang/reflect/Proxy$ClassFactory.class
new file mode 100644
index 00000000000..99141353b96
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/Proxy$ClassFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/Proxy$ProxyData.class b/libjava/classpath/lib/java/lang/reflect/Proxy$ProxyData.class
new file mode 100644
index 00000000000..e595c2a1b1e
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/Proxy$ProxyData.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/Proxy$ProxySignature.class b/libjava/classpath/lib/java/lang/reflect/Proxy$ProxySignature.class
new file mode 100644
index 00000000000..3df0e487390
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/Proxy$ProxySignature.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/Proxy$ProxyType.class b/libjava/classpath/lib/java/lang/reflect/Proxy$ProxyType.class
new file mode 100644
index 00000000000..d43a4836ef4
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/Proxy$ProxyType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/Proxy.class b/libjava/classpath/lib/java/lang/reflect/Proxy.class
new file mode 100644
index 00000000000..ee410035fe5
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/Proxy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/ReflectPermission.class b/libjava/classpath/lib/java/lang/reflect/ReflectPermission.class
new file mode 100644
index 00000000000..28fac663c26
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/ReflectPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/Type.class b/libjava/classpath/lib/java/lang/reflect/Type.class
new file mode 100644
index 00000000000..fce84d93b80
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/Type.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/TypeVariable.class b/libjava/classpath/lib/java/lang/reflect/TypeVariable.class
new file mode 100644
index 00000000000..49cb372e307
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/TypeVariable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/UndeclaredThrowableException.class b/libjava/classpath/lib/java/lang/reflect/UndeclaredThrowableException.class
new file mode 100644
index 00000000000..13c08d47221
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/UndeclaredThrowableException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/VMProxy.class b/libjava/classpath/lib/java/lang/reflect/VMProxy.class
new file mode 100644
index 00000000000..69a3314d064
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/VMProxy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/reflect/WildcardType.class b/libjava/classpath/lib/java/lang/reflect/WildcardType.class
new file mode 100644
index 00000000000..f05e27764df
--- /dev/null
+++ b/libjava/classpath/lib/java/lang/reflect/WildcardType.class
Binary files differ
diff --git a/libjava/classpath/lib/java/math/BigDecimal.class b/libjava/classpath/lib/java/math/BigDecimal.class
new file mode 100644
index 00000000000..6ba16bad4c4
--- /dev/null
+++ b/libjava/classpath/lib/java/math/BigDecimal.class
Binary files differ
diff --git a/libjava/classpath/lib/java/math/BigInteger.class b/libjava/classpath/lib/java/math/BigInteger.class
new file mode 100644
index 00000000000..97bede685bc
--- /dev/null
+++ b/libjava/classpath/lib/java/math/BigInteger.class
Binary files differ
diff --git a/libjava/classpath/lib/java/math/MathContext.class b/libjava/classpath/lib/java/math/MathContext.class
new file mode 100644
index 00000000000..c9099e9eb11
--- /dev/null
+++ b/libjava/classpath/lib/java/math/MathContext.class
Binary files differ
diff --git a/libjava/classpath/lib/java/math/RoundingMode.class b/libjava/classpath/lib/java/math/RoundingMode.class
new file mode 100644
index 00000000000..84dff2c38bf
--- /dev/null
+++ b/libjava/classpath/lib/java/math/RoundingMode.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/Authenticator.class b/libjava/classpath/lib/java/net/Authenticator.class
new file mode 100644
index 00000000000..fcd17233d15
--- /dev/null
+++ b/libjava/classpath/lib/java/net/Authenticator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/BindException.class b/libjava/classpath/lib/java/net/BindException.class
new file mode 100644
index 00000000000..6b8391227b9
--- /dev/null
+++ b/libjava/classpath/lib/java/net/BindException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/ConnectException.class b/libjava/classpath/lib/java/net/ConnectException.class
new file mode 100644
index 00000000000..8dea4cef308
--- /dev/null
+++ b/libjava/classpath/lib/java/net/ConnectException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/ContentHandler.class b/libjava/classpath/lib/java/net/ContentHandler.class
new file mode 100644
index 00000000000..3eea635f56d
--- /dev/null
+++ b/libjava/classpath/lib/java/net/ContentHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/ContentHandlerFactory.class b/libjava/classpath/lib/java/net/ContentHandlerFactory.class
new file mode 100644
index 00000000000..7a4e8545044
--- /dev/null
+++ b/libjava/classpath/lib/java/net/ContentHandlerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/DatagramPacket.class b/libjava/classpath/lib/java/net/DatagramPacket.class
new file mode 100644
index 00000000000..ffa036299e1
--- /dev/null
+++ b/libjava/classpath/lib/java/net/DatagramPacket.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/DatagramSocket.class b/libjava/classpath/lib/java/net/DatagramSocket.class
new file mode 100644
index 00000000000..033684ec72f
--- /dev/null
+++ b/libjava/classpath/lib/java/net/DatagramSocket.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/DatagramSocketImpl.class b/libjava/classpath/lib/java/net/DatagramSocketImpl.class
new file mode 100644
index 00000000000..bd8a144e49f
--- /dev/null
+++ b/libjava/classpath/lib/java/net/DatagramSocketImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/DatagramSocketImplFactory.class b/libjava/classpath/lib/java/net/DatagramSocketImplFactory.class
new file mode 100644
index 00000000000..bbdd18598c3
--- /dev/null
+++ b/libjava/classpath/lib/java/net/DatagramSocketImplFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/FileNameMap.class b/libjava/classpath/lib/java/net/FileNameMap.class
new file mode 100644
index 00000000000..ae390177a24
--- /dev/null
+++ b/libjava/classpath/lib/java/net/FileNameMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/HttpURLConnection.class b/libjava/classpath/lib/java/net/HttpURLConnection.class
new file mode 100644
index 00000000000..6450b95a852
--- /dev/null
+++ b/libjava/classpath/lib/java/net/HttpURLConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/Inet4Address.class b/libjava/classpath/lib/java/net/Inet4Address.class
new file mode 100644
index 00000000000..b3a652bc637
--- /dev/null
+++ b/libjava/classpath/lib/java/net/Inet4Address.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/Inet6Address.class b/libjava/classpath/lib/java/net/Inet6Address.class
new file mode 100644
index 00000000000..d43e8a77e42
--- /dev/null
+++ b/libjava/classpath/lib/java/net/Inet6Address.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/InetAddress.class b/libjava/classpath/lib/java/net/InetAddress.class
new file mode 100644
index 00000000000..5a419625e76
--- /dev/null
+++ b/libjava/classpath/lib/java/net/InetAddress.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/InetSocketAddress.class b/libjava/classpath/lib/java/net/InetSocketAddress.class
new file mode 100644
index 00000000000..68caa5d5258
--- /dev/null
+++ b/libjava/classpath/lib/java/net/InetSocketAddress.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/JarURLConnection.class b/libjava/classpath/lib/java/net/JarURLConnection.class
new file mode 100644
index 00000000000..98b16c3d034
--- /dev/null
+++ b/libjava/classpath/lib/java/net/JarURLConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/MalformedURLException.class b/libjava/classpath/lib/java/net/MalformedURLException.class
new file mode 100644
index 00000000000..6cee07b4584
--- /dev/null
+++ b/libjava/classpath/lib/java/net/MalformedURLException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/MimeTypeMapper.class b/libjava/classpath/lib/java/net/MimeTypeMapper.class
new file mode 100644
index 00000000000..eb7f5b5a7a5
--- /dev/null
+++ b/libjava/classpath/lib/java/net/MimeTypeMapper.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/MulticastSocket.class b/libjava/classpath/lib/java/net/MulticastSocket.class
new file mode 100644
index 00000000000..f218e52e567
--- /dev/null
+++ b/libjava/classpath/lib/java/net/MulticastSocket.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/NetPermission.class b/libjava/classpath/lib/java/net/NetPermission.class
new file mode 100644
index 00000000000..6c77f388cd8
--- /dev/null
+++ b/libjava/classpath/lib/java/net/NetPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/NetworkInterface.class b/libjava/classpath/lib/java/net/NetworkInterface.class
new file mode 100644
index 00000000000..f5db00bd612
--- /dev/null
+++ b/libjava/classpath/lib/java/net/NetworkInterface.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/NoRouteToHostException.class b/libjava/classpath/lib/java/net/NoRouteToHostException.class
new file mode 100644
index 00000000000..fc373e7800b
--- /dev/null
+++ b/libjava/classpath/lib/java/net/NoRouteToHostException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/PasswordAuthentication.class b/libjava/classpath/lib/java/net/PasswordAuthentication.class
new file mode 100644
index 00000000000..c1a91a112e0
--- /dev/null
+++ b/libjava/classpath/lib/java/net/PasswordAuthentication.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/PortUnreachableException.class b/libjava/classpath/lib/java/net/PortUnreachableException.class
new file mode 100644
index 00000000000..900285ad240
--- /dev/null
+++ b/libjava/classpath/lib/java/net/PortUnreachableException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/ProtocolException.class b/libjava/classpath/lib/java/net/ProtocolException.class
new file mode 100644
index 00000000000..aad8b24aef2
--- /dev/null
+++ b/libjava/classpath/lib/java/net/ProtocolException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/Proxy$Type.class b/libjava/classpath/lib/java/net/Proxy$Type.class
new file mode 100644
index 00000000000..7e0674a2d64
--- /dev/null
+++ b/libjava/classpath/lib/java/net/Proxy$Type.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/Proxy.class b/libjava/classpath/lib/java/net/Proxy.class
new file mode 100644
index 00000000000..9c7f6d87abd
--- /dev/null
+++ b/libjava/classpath/lib/java/net/Proxy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/ProxySelector.class b/libjava/classpath/lib/java/net/ProxySelector.class
new file mode 100644
index 00000000000..bb713702c75
--- /dev/null
+++ b/libjava/classpath/lib/java/net/ProxySelector.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/ResolverCache$Entry.class b/libjava/classpath/lib/java/net/ResolverCache$Entry.class
new file mode 100644
index 00000000000..4ef651145d3
--- /dev/null
+++ b/libjava/classpath/lib/java/net/ResolverCache$Entry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/ResolverCache.class b/libjava/classpath/lib/java/net/ResolverCache.class
new file mode 100644
index 00000000000..3e8eec89ffb
--- /dev/null
+++ b/libjava/classpath/lib/java/net/ResolverCache.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/ServerSocket.class b/libjava/classpath/lib/java/net/ServerSocket.class
new file mode 100644
index 00000000000..51e194828dd
--- /dev/null
+++ b/libjava/classpath/lib/java/net/ServerSocket.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/Socket.class b/libjava/classpath/lib/java/net/Socket.class
new file mode 100644
index 00000000000..d833b437ef6
--- /dev/null
+++ b/libjava/classpath/lib/java/net/Socket.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/SocketAddress.class b/libjava/classpath/lib/java/net/SocketAddress.class
new file mode 100644
index 00000000000..7372d9dc39e
--- /dev/null
+++ b/libjava/classpath/lib/java/net/SocketAddress.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/SocketException.class b/libjava/classpath/lib/java/net/SocketException.class
new file mode 100644
index 00000000000..574c0e6250b
--- /dev/null
+++ b/libjava/classpath/lib/java/net/SocketException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/SocketImpl.class b/libjava/classpath/lib/java/net/SocketImpl.class
new file mode 100644
index 00000000000..dc05b76b502
--- /dev/null
+++ b/libjava/classpath/lib/java/net/SocketImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/SocketImplFactory.class b/libjava/classpath/lib/java/net/SocketImplFactory.class
new file mode 100644
index 00000000000..c7ea6135b26
--- /dev/null
+++ b/libjava/classpath/lib/java/net/SocketImplFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/SocketOptions.class b/libjava/classpath/lib/java/net/SocketOptions.class
new file mode 100644
index 00000000000..69e4f1f0a92
--- /dev/null
+++ b/libjava/classpath/lib/java/net/SocketOptions.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/SocketPermission.class b/libjava/classpath/lib/java/net/SocketPermission.class
new file mode 100644
index 00000000000..addeebec615
--- /dev/null
+++ b/libjava/classpath/lib/java/net/SocketPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/SocketTimeoutException.class b/libjava/classpath/lib/java/net/SocketTimeoutException.class
new file mode 100644
index 00000000000..8b83a276590
--- /dev/null
+++ b/libjava/classpath/lib/java/net/SocketTimeoutException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URI.class b/libjava/classpath/lib/java/net/URI.class
new file mode 100644
index 00000000000..4d328f3126a
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URI.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URISyntaxException.class b/libjava/classpath/lib/java/net/URISyntaxException.class
new file mode 100644
index 00000000000..fc96d6f138f
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URISyntaxException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URL$1.class b/libjava/classpath/lib/java/net/URL$1.class
new file mode 100644
index 00000000000..7520f56903d
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URL$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URL.class b/libjava/classpath/lib/java/net/URL.class
new file mode 100644
index 00000000000..0603d68c390
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URL.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader$1.class b/libjava/classpath/lib/java/net/URLClassLoader$1.class
new file mode 100644
index 00000000000..4481e7b35d5
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader$2.class b/libjava/classpath/lib/java/net/URLClassLoader$2.class
new file mode 100644
index 00000000000..64c9e24573b
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader$CoreResource.class b/libjava/classpath/lib/java/net/URLClassLoader$CoreResource.class
new file mode 100644
index 00000000000..f3729420381
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader$CoreResource.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader$CoreURLLoader.class b/libjava/classpath/lib/java/net/URLClassLoader$CoreURLLoader.class
new file mode 100644
index 00000000000..050f529734c
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader$CoreURLLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader$FileResource.class b/libjava/classpath/lib/java/net/URLClassLoader$FileResource.class
new file mode 100644
index 00000000000..e7a12687ef3
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader$FileResource.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader$FileURLLoader.class b/libjava/classpath/lib/java/net/URLClassLoader$FileURLLoader.class
new file mode 100644
index 00000000000..d750821a99e
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader$FileURLLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader$JarURLLoader.class b/libjava/classpath/lib/java/net/URLClassLoader$JarURLLoader.class
new file mode 100644
index 00000000000..11c1e9dc61a
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader$JarURLLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader$JarURLResource.class b/libjava/classpath/lib/java/net/URLClassLoader$JarURLResource.class
new file mode 100644
index 00000000000..74ebc398101
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader$JarURLResource.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader$RemoteResource.class b/libjava/classpath/lib/java/net/URLClassLoader$RemoteResource.class
new file mode 100644
index 00000000000..19b703190ee
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader$RemoteResource.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader$RemoteURLLoader.class b/libjava/classpath/lib/java/net/URLClassLoader$RemoteURLLoader.class
new file mode 100644
index 00000000000..d32ac11656c
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader$RemoteURLLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader$Resource.class b/libjava/classpath/lib/java/net/URLClassLoader$Resource.class
new file mode 100644
index 00000000000..bb4d13a6ba0
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader$Resource.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader$SoResource.class b/libjava/classpath/lib/java/net/URLClassLoader$SoResource.class
new file mode 100644
index 00000000000..4e7417a7d63
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader$SoResource.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader$SoURLLoader.class b/libjava/classpath/lib/java/net/URLClassLoader$SoURLLoader.class
new file mode 100644
index 00000000000..403dfafd09c
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader$SoURLLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader$URLLoader.class b/libjava/classpath/lib/java/net/URLClassLoader$URLLoader.class
new file mode 100644
index 00000000000..8b272bdb36d
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader$URLLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLClassLoader.class b/libjava/classpath/lib/java/net/URLClassLoader.class
new file mode 100644
index 00000000000..118acceca43
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLClassLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLConnection.class b/libjava/classpath/lib/java/net/URLConnection.class
new file mode 100644
index 00000000000..ed9a6f9389d
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLDecoder.class b/libjava/classpath/lib/java/net/URLDecoder.class
new file mode 100644
index 00000000000..8c27d421871
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLDecoder.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLEncoder.class b/libjava/classpath/lib/java/net/URLEncoder.class
new file mode 100644
index 00000000000..4beca0018fb
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLEncoder.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLStreamHandler.class b/libjava/classpath/lib/java/net/URLStreamHandler.class
new file mode 100644
index 00000000000..2d21739bb28
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLStreamHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/URLStreamHandlerFactory.class b/libjava/classpath/lib/java/net/URLStreamHandlerFactory.class
new file mode 100644
index 00000000000..5fd239f5cb7
--- /dev/null
+++ b/libjava/classpath/lib/java/net/URLStreamHandlerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/UnknownHostException.class b/libjava/classpath/lib/java/net/UnknownHostException.class
new file mode 100644
index 00000000000..129af71ea43
--- /dev/null
+++ b/libjava/classpath/lib/java/net/UnknownHostException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/UnknownServiceException.class b/libjava/classpath/lib/java/net/UnknownServiceException.class
new file mode 100644
index 00000000000..70101d849f0
--- /dev/null
+++ b/libjava/classpath/lib/java/net/UnknownServiceException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/VMInetAddress.class b/libjava/classpath/lib/java/net/VMInetAddress.class
new file mode 100644
index 00000000000..419535677b0
--- /dev/null
+++ b/libjava/classpath/lib/java/net/VMInetAddress.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/VMNetworkInterface.class b/libjava/classpath/lib/java/net/VMNetworkInterface.class
new file mode 100644
index 00000000000..5aa6ec55b0b
--- /dev/null
+++ b/libjava/classpath/lib/java/net/VMNetworkInterface.class
Binary files differ
diff --git a/libjava/classpath/lib/java/net/VMURLConnection.class b/libjava/classpath/lib/java/net/VMURLConnection.class
new file mode 100644
index 00000000000..b925d88c62e
--- /dev/null
+++ b/libjava/classpath/lib/java/net/VMURLConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/Buffer.class b/libjava/classpath/lib/java/nio/Buffer.class
new file mode 100644
index 00000000000..4d9ef52ee85
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/Buffer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/BufferOverflowException.class b/libjava/classpath/lib/java/nio/BufferOverflowException.class
new file mode 100644
index 00000000000..33d782572d9
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/BufferOverflowException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/BufferUnderflowException.class b/libjava/classpath/lib/java/nio/BufferUnderflowException.class
new file mode 100644
index 00000000000..5e60e5cba60
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/BufferUnderflowException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/ByteBuffer.class b/libjava/classpath/lib/java/nio/ByteBuffer.class
new file mode 100644
index 00000000000..183f21fa877
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/ByteBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/ByteBufferHelper.class b/libjava/classpath/lib/java/nio/ByteBufferHelper.class
new file mode 100644
index 00000000000..419c0e0b322
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/ByteBufferHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/ByteBufferImpl.class b/libjava/classpath/lib/java/nio/ByteBufferImpl.class
new file mode 100644
index 00000000000..91c35308136
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/ByteBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/ByteOrder.class b/libjava/classpath/lib/java/nio/ByteOrder.class
new file mode 100644
index 00000000000..23f94c49431
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/ByteOrder.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/CharBuffer.class b/libjava/classpath/lib/java/nio/CharBuffer.class
new file mode 100644
index 00000000000..2da715f4a4b
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/CharBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/CharBufferImpl.class b/libjava/classpath/lib/java/nio/CharBufferImpl.class
new file mode 100644
index 00000000000..e1beb2eaf02
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/CharBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/CharViewBufferImpl.class b/libjava/classpath/lib/java/nio/CharViewBufferImpl.class
new file mode 100644
index 00000000000..25e84f01cd4
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/CharViewBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/DirectByteBufferImpl$ReadOnly.class b/libjava/classpath/lib/java/nio/DirectByteBufferImpl$ReadOnly.class
new file mode 100644
index 00000000000..c5e3561b682
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/DirectByteBufferImpl$ReadOnly.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/DirectByteBufferImpl$ReadWrite.class b/libjava/classpath/lib/java/nio/DirectByteBufferImpl$ReadWrite.class
new file mode 100644
index 00000000000..0d415d019e4
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/DirectByteBufferImpl$ReadWrite.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/DirectByteBufferImpl.class b/libjava/classpath/lib/java/nio/DirectByteBufferImpl.class
new file mode 100644
index 00000000000..c6b685d8798
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/DirectByteBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/DoubleBuffer.class b/libjava/classpath/lib/java/nio/DoubleBuffer.class
new file mode 100644
index 00000000000..ed274620c77
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/DoubleBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/DoubleBufferImpl.class b/libjava/classpath/lib/java/nio/DoubleBufferImpl.class
new file mode 100644
index 00000000000..91f3dc2c7e1
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/DoubleBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/DoubleViewBufferImpl.class b/libjava/classpath/lib/java/nio/DoubleViewBufferImpl.class
new file mode 100644
index 00000000000..1e50947b6d3
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/DoubleViewBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/FloatBuffer.class b/libjava/classpath/lib/java/nio/FloatBuffer.class
new file mode 100644
index 00000000000..5dde0edc370
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/FloatBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/FloatBufferImpl.class b/libjava/classpath/lib/java/nio/FloatBufferImpl.class
new file mode 100644
index 00000000000..4cacfea09ef
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/FloatBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/FloatViewBufferImpl.class b/libjava/classpath/lib/java/nio/FloatViewBufferImpl.class
new file mode 100644
index 00000000000..09fa18e1caa
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/FloatViewBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/IntBuffer.class b/libjava/classpath/lib/java/nio/IntBuffer.class
new file mode 100644
index 00000000000..f604662e64a
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/IntBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/IntBufferImpl.class b/libjava/classpath/lib/java/nio/IntBufferImpl.class
new file mode 100644
index 00000000000..95b0c4d267c
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/IntBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/IntViewBufferImpl.class b/libjava/classpath/lib/java/nio/IntViewBufferImpl.class
new file mode 100644
index 00000000000..116807e8b22
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/IntViewBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/InvalidMarkException.class b/libjava/classpath/lib/java/nio/InvalidMarkException.class
new file mode 100644
index 00000000000..78b04874d7c
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/InvalidMarkException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/LongBuffer.class b/libjava/classpath/lib/java/nio/LongBuffer.class
new file mode 100644
index 00000000000..510b91eb0ef
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/LongBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/LongBufferImpl.class b/libjava/classpath/lib/java/nio/LongBufferImpl.class
new file mode 100644
index 00000000000..6c85f50580d
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/LongBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/LongViewBufferImpl.class b/libjava/classpath/lib/java/nio/LongViewBufferImpl.class
new file mode 100644
index 00000000000..381a3419b36
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/LongViewBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/MappedByteBuffer.class b/libjava/classpath/lib/java/nio/MappedByteBuffer.class
new file mode 100644
index 00000000000..ff12d90a2b9
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/MappedByteBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/MappedByteBufferImpl.class b/libjava/classpath/lib/java/nio/MappedByteBufferImpl.class
new file mode 100644
index 00000000000..ad5846f9294
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/MappedByteBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/ReadOnlyBufferException.class b/libjava/classpath/lib/java/nio/ReadOnlyBufferException.class
new file mode 100644
index 00000000000..358289b1fcb
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/ReadOnlyBufferException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/ShortBuffer.class b/libjava/classpath/lib/java/nio/ShortBuffer.class
new file mode 100644
index 00000000000..40d4faf3839
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/ShortBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/ShortBufferImpl.class b/libjava/classpath/lib/java/nio/ShortBufferImpl.class
new file mode 100644
index 00000000000..cb5b4f3f721
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/ShortBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/ShortViewBufferImpl.class b/libjava/classpath/lib/java/nio/ShortViewBufferImpl.class
new file mode 100644
index 00000000000..5570a67d3e9
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/ShortViewBufferImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/VMDirectByteBuffer.class b/libjava/classpath/lib/java/nio/VMDirectByteBuffer.class
new file mode 100644
index 00000000000..27021f4b646
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/VMDirectByteBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/AlreadyConnectedException.class b/libjava/classpath/lib/java/nio/channels/AlreadyConnectedException.class
new file mode 100644
index 00000000000..0231c028cd2
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/AlreadyConnectedException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/AsynchronousCloseException.class b/libjava/classpath/lib/java/nio/channels/AsynchronousCloseException.class
new file mode 100644
index 00000000000..b8e55cf4621
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/AsynchronousCloseException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/ByteChannel.class b/libjava/classpath/lib/java/nio/channels/ByteChannel.class
new file mode 100644
index 00000000000..b68871ff3a9
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/ByteChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/CancelledKeyException.class b/libjava/classpath/lib/java/nio/channels/CancelledKeyException.class
new file mode 100644
index 00000000000..6c5ca90e8df
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/CancelledKeyException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/Channel.class b/libjava/classpath/lib/java/nio/channels/Channel.class
new file mode 100644
index 00000000000..10201b69aee
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/Channel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/Channels.class b/libjava/classpath/lib/java/nio/channels/Channels.class
new file mode 100644
index 00000000000..4e5a6f2631c
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/Channels.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/ClosedByInterruptException.class b/libjava/classpath/lib/java/nio/channels/ClosedByInterruptException.class
new file mode 100644
index 00000000000..bd381b3f6c8
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/ClosedByInterruptException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/ClosedChannelException.class b/libjava/classpath/lib/java/nio/channels/ClosedChannelException.class
new file mode 100644
index 00000000000..7934e83faf1
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/ClosedChannelException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/ClosedSelectorException.class b/libjava/classpath/lib/java/nio/channels/ClosedSelectorException.class
new file mode 100644
index 00000000000..086e705d832
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/ClosedSelectorException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/ConnectionPendingException.class b/libjava/classpath/lib/java/nio/channels/ConnectionPendingException.class
new file mode 100644
index 00000000000..332739cb8e3
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/ConnectionPendingException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/DatagramChannel.class b/libjava/classpath/lib/java/nio/channels/DatagramChannel.class
new file mode 100644
index 00000000000..ca3ecb35ec4
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/DatagramChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/FileChannel$MapMode.class b/libjava/classpath/lib/java/nio/channels/FileChannel$MapMode.class
new file mode 100644
index 00000000000..4d7fc068624
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/FileChannel$MapMode.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/FileChannel.class b/libjava/classpath/lib/java/nio/channels/FileChannel.class
new file mode 100644
index 00000000000..a96eda95934
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/FileChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/FileLock.class b/libjava/classpath/lib/java/nio/channels/FileLock.class
new file mode 100644
index 00000000000..605380da8ae
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/FileLock.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/FileLockInterruptionException.class b/libjava/classpath/lib/java/nio/channels/FileLockInterruptionException.class
new file mode 100644
index 00000000000..5d7073eca25
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/FileLockInterruptionException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/GatheringByteChannel.class b/libjava/classpath/lib/java/nio/channels/GatheringByteChannel.class
new file mode 100644
index 00000000000..a74b873ea69
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/GatheringByteChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/IllegalBlockingModeException.class b/libjava/classpath/lib/java/nio/channels/IllegalBlockingModeException.class
new file mode 100644
index 00000000000..f65eb9869ef
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/IllegalBlockingModeException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/IllegalSelectorException.class b/libjava/classpath/lib/java/nio/channels/IllegalSelectorException.class
new file mode 100644
index 00000000000..33234829f0b
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/IllegalSelectorException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/InterruptibleChannel.class b/libjava/classpath/lib/java/nio/channels/InterruptibleChannel.class
new file mode 100644
index 00000000000..309067b764d
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/InterruptibleChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/NoConnectionPendingException.class b/libjava/classpath/lib/java/nio/channels/NoConnectionPendingException.class
new file mode 100644
index 00000000000..727c3bdc113
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/NoConnectionPendingException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/NonReadableChannelException.class b/libjava/classpath/lib/java/nio/channels/NonReadableChannelException.class
new file mode 100644
index 00000000000..68f3e2d09cb
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/NonReadableChannelException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/NonWritableChannelException.class b/libjava/classpath/lib/java/nio/channels/NonWritableChannelException.class
new file mode 100644
index 00000000000..479e770f2f1
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/NonWritableChannelException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/NotYetBoundException.class b/libjava/classpath/lib/java/nio/channels/NotYetBoundException.class
new file mode 100644
index 00000000000..bd3d9dc64d7
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/NotYetBoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/NotYetConnectedException.class b/libjava/classpath/lib/java/nio/channels/NotYetConnectedException.class
new file mode 100644
index 00000000000..2da53ee8f27
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/NotYetConnectedException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/OverlappingFileLockException.class b/libjava/classpath/lib/java/nio/channels/OverlappingFileLockException.class
new file mode 100644
index 00000000000..a9ef46c9ecd
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/OverlappingFileLockException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/Pipe$SinkChannel.class b/libjava/classpath/lib/java/nio/channels/Pipe$SinkChannel.class
new file mode 100644
index 00000000000..a960160ee72
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/Pipe$SinkChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/Pipe$SourceChannel.class b/libjava/classpath/lib/java/nio/channels/Pipe$SourceChannel.class
new file mode 100644
index 00000000000..edeaf53b593
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/Pipe$SourceChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/Pipe.class b/libjava/classpath/lib/java/nio/channels/Pipe.class
new file mode 100644
index 00000000000..5a056fe7feb
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/Pipe.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/ReadableByteChannel.class b/libjava/classpath/lib/java/nio/channels/ReadableByteChannel.class
new file mode 100644
index 00000000000..48e306ecf83
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/ReadableByteChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/ScatteringByteChannel.class b/libjava/classpath/lib/java/nio/channels/ScatteringByteChannel.class
new file mode 100644
index 00000000000..8c5b95e5783
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/ScatteringByteChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/SelectableChannel.class b/libjava/classpath/lib/java/nio/channels/SelectableChannel.class
new file mode 100644
index 00000000000..17aff976a2e
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/SelectableChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/SelectionKey.class b/libjava/classpath/lib/java/nio/channels/SelectionKey.class
new file mode 100644
index 00000000000..f9bddf6e3b2
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/SelectionKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/Selector.class b/libjava/classpath/lib/java/nio/channels/Selector.class
new file mode 100644
index 00000000000..0469ab55c2d
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/Selector.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/ServerSocketChannel.class b/libjava/classpath/lib/java/nio/channels/ServerSocketChannel.class
new file mode 100644
index 00000000000..2ffe64fd27c
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/ServerSocketChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/SocketChannel.class b/libjava/classpath/lib/java/nio/channels/SocketChannel.class
new file mode 100644
index 00000000000..e53b0c337dc
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/SocketChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/UnresolvedAddressException.class b/libjava/classpath/lib/java/nio/channels/UnresolvedAddressException.class
new file mode 100644
index 00000000000..a53bb06cac8
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/UnresolvedAddressException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/UnsupportedAddressTypeException.class b/libjava/classpath/lib/java/nio/channels/UnsupportedAddressTypeException.class
new file mode 100644
index 00000000000..5ca872ec7a2
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/UnsupportedAddressTypeException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/VMChannels.class b/libjava/classpath/lib/java/nio/channels/VMChannels.class
new file mode 100644
index 00000000000..2a265123265
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/VMChannels.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/WritableByteChannel.class b/libjava/classpath/lib/java/nio/channels/WritableByteChannel.class
new file mode 100644
index 00000000000..94c77798954
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/WritableByteChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/spi/AbstractInterruptibleChannel.class b/libjava/classpath/lib/java/nio/channels/spi/AbstractInterruptibleChannel.class
new file mode 100644
index 00000000000..37005d8c83f
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/spi/AbstractInterruptibleChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/spi/AbstractSelectableChannel.class b/libjava/classpath/lib/java/nio/channels/spi/AbstractSelectableChannel.class
new file mode 100644
index 00000000000..50292a1becb
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/spi/AbstractSelectableChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/spi/AbstractSelectionKey.class b/libjava/classpath/lib/java/nio/channels/spi/AbstractSelectionKey.class
new file mode 100644
index 00000000000..a30204155e0
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/spi/AbstractSelectionKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/spi/AbstractSelector.class b/libjava/classpath/lib/java/nio/channels/spi/AbstractSelector.class
new file mode 100644
index 00000000000..6a8140211b6
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/spi/AbstractSelector.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/channels/spi/SelectorProvider.class b/libjava/classpath/lib/java/nio/channels/spi/SelectorProvider.class
new file mode 100644
index 00000000000..cb10488e150
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/channels/spi/SelectorProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/CharacterCodingException.class b/libjava/classpath/lib/java/nio/charset/CharacterCodingException.class
new file mode 100644
index 00000000000..28858ad1841
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/CharacterCodingException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/Charset.class b/libjava/classpath/lib/java/nio/charset/Charset.class
new file mode 100644
index 00000000000..ae2b1191065
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/Charset.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/CharsetDecoder.class b/libjava/classpath/lib/java/nio/charset/CharsetDecoder.class
new file mode 100644
index 00000000000..62f768df009
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/CharsetDecoder.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/CharsetEncoder.class b/libjava/classpath/lib/java/nio/charset/CharsetEncoder.class
new file mode 100644
index 00000000000..dec97fb1788
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/CharsetEncoder.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/CoderMalfunctionError.class b/libjava/classpath/lib/java/nio/charset/CoderMalfunctionError.class
new file mode 100644
index 00000000000..5c980951590
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/CoderMalfunctionError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/CoderResult$1.class b/libjava/classpath/lib/java/nio/charset/CoderResult$1.class
new file mode 100644
index 00000000000..687298887bf
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/CoderResult$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/CoderResult$2.class b/libjava/classpath/lib/java/nio/charset/CoderResult$2.class
new file mode 100644
index 00000000000..84d8dae7af3
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/CoderResult$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/CoderResult$Cache.class b/libjava/classpath/lib/java/nio/charset/CoderResult$Cache.class
new file mode 100644
index 00000000000..4d885f09d59
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/CoderResult$Cache.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/CoderResult.class b/libjava/classpath/lib/java/nio/charset/CoderResult.class
new file mode 100644
index 00000000000..f68fd67eedf
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/CoderResult.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/CodingErrorAction.class b/libjava/classpath/lib/java/nio/charset/CodingErrorAction.class
new file mode 100644
index 00000000000..8de598968d4
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/CodingErrorAction.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/IllegalCharsetNameException.class b/libjava/classpath/lib/java/nio/charset/IllegalCharsetNameException.class
new file mode 100644
index 00000000000..d31479f7208
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/IllegalCharsetNameException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/MalformedInputException.class b/libjava/classpath/lib/java/nio/charset/MalformedInputException.class
new file mode 100644
index 00000000000..4d10b6da599
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/MalformedInputException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/UnmappableCharacterException.class b/libjava/classpath/lib/java/nio/charset/UnmappableCharacterException.class
new file mode 100644
index 00000000000..e5a7bc2d033
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/UnmappableCharacterException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/UnsupportedCharsetException.class b/libjava/classpath/lib/java/nio/charset/UnsupportedCharsetException.class
new file mode 100644
index 00000000000..3c8924b014e
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/UnsupportedCharsetException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/nio/charset/spi/CharsetProvider.class b/libjava/classpath/lib/java/nio/charset/spi/CharsetProvider.class
new file mode 100644
index 00000000000..cdf4cbb912a
--- /dev/null
+++ b/libjava/classpath/lib/java/nio/charset/spi/CharsetProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/AccessException.class b/libjava/classpath/lib/java/rmi/AccessException.class
new file mode 100644
index 00000000000..d0e3ccadf22
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/AccessException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/AlreadyBoundException.class b/libjava/classpath/lib/java/rmi/AlreadyBoundException.class
new file mode 100644
index 00000000000..66d4313c4a8
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/AlreadyBoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/ConnectException.class b/libjava/classpath/lib/java/rmi/ConnectException.class
new file mode 100644
index 00000000000..6e0019e62f3
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/ConnectException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/ConnectIOException.class b/libjava/classpath/lib/java/rmi/ConnectIOException.class
new file mode 100644
index 00000000000..d5ad7dc4775
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/ConnectIOException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/MarshalException.class b/libjava/classpath/lib/java/rmi/MarshalException.class
new file mode 100644
index 00000000000..0ba852d8d53
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/MarshalException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/MarshalledObject.class b/libjava/classpath/lib/java/rmi/MarshalledObject.class
new file mode 100644
index 00000000000..f09c1a6156a
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/MarshalledObject.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/Naming.class b/libjava/classpath/lib/java/rmi/Naming.class
new file mode 100644
index 00000000000..5d866075b78
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/Naming.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/NoSuchObjectException.class b/libjava/classpath/lib/java/rmi/NoSuchObjectException.class
new file mode 100644
index 00000000000..bf68ca4dfff
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/NoSuchObjectException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/NotBoundException.class b/libjava/classpath/lib/java/rmi/NotBoundException.class
new file mode 100644
index 00000000000..ef1cb98096e
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/NotBoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/RMISecurityException.class b/libjava/classpath/lib/java/rmi/RMISecurityException.class
new file mode 100644
index 00000000000..ff293e85385
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/RMISecurityException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/RMISecurityManager.class b/libjava/classpath/lib/java/rmi/RMISecurityManager.class
new file mode 100644
index 00000000000..41c59e9caed
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/RMISecurityManager.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/Remote.class b/libjava/classpath/lib/java/rmi/Remote.class
new file mode 100644
index 00000000000..a187a4943f2
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/Remote.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/RemoteException.class b/libjava/classpath/lib/java/rmi/RemoteException.class
new file mode 100644
index 00000000000..a5fcf1d4032
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/RemoteException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/ServerError.class b/libjava/classpath/lib/java/rmi/ServerError.class
new file mode 100644
index 00000000000..c93ff61d7b8
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/ServerError.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/ServerException.class b/libjava/classpath/lib/java/rmi/ServerException.class
new file mode 100644
index 00000000000..71628173564
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/ServerException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/ServerRuntimeException.class b/libjava/classpath/lib/java/rmi/ServerRuntimeException.class
new file mode 100644
index 00000000000..4ea3675a6b7
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/ServerRuntimeException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/StubNotFoundException.class b/libjava/classpath/lib/java/rmi/StubNotFoundException.class
new file mode 100644
index 00000000000..da6dd6441db
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/StubNotFoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/UnexpectedException.class b/libjava/classpath/lib/java/rmi/UnexpectedException.class
new file mode 100644
index 00000000000..ab4e7ca6df8
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/UnexpectedException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/UnknownHostException.class b/libjava/classpath/lib/java/rmi/UnknownHostException.class
new file mode 100644
index 00000000000..699bf69344a
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/UnknownHostException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/UnmarshalException.class b/libjava/classpath/lib/java/rmi/UnmarshalException.class
new file mode 100644
index 00000000000..7f95ac81653
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/UnmarshalException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/Activatable.class b/libjava/classpath/lib/java/rmi/activation/Activatable.class
new file mode 100644
index 00000000000..09eee6b76e9
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/Activatable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/ActivateFailedException.class b/libjava/classpath/lib/java/rmi/activation/ActivateFailedException.class
new file mode 100644
index 00000000000..ebac6ba5028
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/ActivateFailedException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/ActivationDesc.class b/libjava/classpath/lib/java/rmi/activation/ActivationDesc.class
new file mode 100644
index 00000000000..c1c90dcc2dd
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/ActivationDesc.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/ActivationException.class b/libjava/classpath/lib/java/rmi/activation/ActivationException.class
new file mode 100644
index 00000000000..95f6167ba1a
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/ActivationException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/ActivationGroup.class b/libjava/classpath/lib/java/rmi/activation/ActivationGroup.class
new file mode 100644
index 00000000000..26a0276563e
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/ActivationGroup.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/ActivationGroupDesc$CommandEnvironment.class b/libjava/classpath/lib/java/rmi/activation/ActivationGroupDesc$CommandEnvironment.class
new file mode 100644
index 00000000000..d74b3c343cd
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/ActivationGroupDesc$CommandEnvironment.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/ActivationGroupDesc.class b/libjava/classpath/lib/java/rmi/activation/ActivationGroupDesc.class
new file mode 100644
index 00000000000..7800656e70a
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/ActivationGroupDesc.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/ActivationGroupID.class b/libjava/classpath/lib/java/rmi/activation/ActivationGroupID.class
new file mode 100644
index 00000000000..d1d0cc9c5bc
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/ActivationGroupID.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/ActivationGroup_Stub.class b/libjava/classpath/lib/java/rmi/activation/ActivationGroup_Stub.class
new file mode 100644
index 00000000000..e56edd93b2b
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/ActivationGroup_Stub.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/ActivationID.class b/libjava/classpath/lib/java/rmi/activation/ActivationID.class
new file mode 100644
index 00000000000..84e0e5cb494
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/ActivationID.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/ActivationInstantiator.class b/libjava/classpath/lib/java/rmi/activation/ActivationInstantiator.class
new file mode 100644
index 00000000000..d3e9f4dc9cd
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/ActivationInstantiator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/ActivationMonitor.class b/libjava/classpath/lib/java/rmi/activation/ActivationMonitor.class
new file mode 100644
index 00000000000..28e35559397
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/ActivationMonitor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/ActivationSystem.class b/libjava/classpath/lib/java/rmi/activation/ActivationSystem.class
new file mode 100644
index 00000000000..17eeee7cd33
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/ActivationSystem.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/Activator.class b/libjava/classpath/lib/java/rmi/activation/Activator.class
new file mode 100644
index 00000000000..1610b115818
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/Activator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/UnknownGroupException.class b/libjava/classpath/lib/java/rmi/activation/UnknownGroupException.class
new file mode 100644
index 00000000000..4d6cbbc81ad
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/UnknownGroupException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/activation/UnknownObjectException.class b/libjava/classpath/lib/java/rmi/activation/UnknownObjectException.class
new file mode 100644
index 00000000000..25bbb15a163
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/activation/UnknownObjectException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/dgc/DGC.class b/libjava/classpath/lib/java/rmi/dgc/DGC.class
new file mode 100644
index 00000000000..f3096baf027
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/dgc/DGC.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/dgc/Lease.class b/libjava/classpath/lib/java/rmi/dgc/Lease.class
new file mode 100644
index 00000000000..56b39780385
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/dgc/Lease.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/dgc/VMID.class b/libjava/classpath/lib/java/rmi/dgc/VMID.class
new file mode 100644
index 00000000000..35a992d8d27
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/dgc/VMID.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/registry/LocateRegistry.class b/libjava/classpath/lib/java/rmi/registry/LocateRegistry.class
new file mode 100644
index 00000000000..66d13c4585c
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/registry/LocateRegistry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/registry/Registry.class b/libjava/classpath/lib/java/rmi/registry/Registry.class
new file mode 100644
index 00000000000..95dd4f7068c
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/registry/Registry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/registry/RegistryHandler.class b/libjava/classpath/lib/java/rmi/registry/RegistryHandler.class
new file mode 100644
index 00000000000..91076eb3a48
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/registry/RegistryHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/ExportException.class b/libjava/classpath/lib/java/rmi/server/ExportException.class
new file mode 100644
index 00000000000..fd025685325
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/ExportException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/LoaderHandler.class b/libjava/classpath/lib/java/rmi/server/LoaderHandler.class
new file mode 100644
index 00000000000..0ebf6708ad4
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/LoaderHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/LogStream.class b/libjava/classpath/lib/java/rmi/server/LogStream.class
new file mode 100644
index 00000000000..ca93a877978
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/LogStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/ObjID.class b/libjava/classpath/lib/java/rmi/server/ObjID.class
new file mode 100644
index 00000000000..9fcf58ed959
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/ObjID.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/Operation.class b/libjava/classpath/lib/java/rmi/server/Operation.class
new file mode 100644
index 00000000000..d3b96a52d96
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/Operation.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/RMIClassLoader.class b/libjava/classpath/lib/java/rmi/server/RMIClassLoader.class
new file mode 100644
index 00000000000..91061b9c452
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/RMIClassLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/RMIClassLoaderSpi.class b/libjava/classpath/lib/java/rmi/server/RMIClassLoaderSpi.class
new file mode 100644
index 00000000000..2a767f3430c
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/RMIClassLoaderSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/RMIClientSocketFactory.class b/libjava/classpath/lib/java/rmi/server/RMIClientSocketFactory.class
new file mode 100644
index 00000000000..f8cf43dbb86
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/RMIClientSocketFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/RMIFailureHandler.class b/libjava/classpath/lib/java/rmi/server/RMIFailureHandler.class
new file mode 100644
index 00000000000..6e067199edf
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/RMIFailureHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/RMIServerSocketFactory.class b/libjava/classpath/lib/java/rmi/server/RMIServerSocketFactory.class
new file mode 100644
index 00000000000..a27ab7a4f7e
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/RMIServerSocketFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/RMISocketFactory.class b/libjava/classpath/lib/java/rmi/server/RMISocketFactory.class
new file mode 100644
index 00000000000..e854a29b8d7
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/RMISocketFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/RemoteCall.class b/libjava/classpath/lib/java/rmi/server/RemoteCall.class
new file mode 100644
index 00000000000..d80635ef0e3
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/RemoteCall.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/RemoteObject.class b/libjava/classpath/lib/java/rmi/server/RemoteObject.class
new file mode 100644
index 00000000000..87dba3d9050
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/RemoteObject.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/RemoteObjectInvocationHandler.class b/libjava/classpath/lib/java/rmi/server/RemoteObjectInvocationHandler.class
new file mode 100644
index 00000000000..107de960a5f
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/RemoteObjectInvocationHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/RemoteRef.class b/libjava/classpath/lib/java/rmi/server/RemoteRef.class
new file mode 100644
index 00000000000..37fc8b9fa03
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/RemoteRef.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/RemoteServer.class b/libjava/classpath/lib/java/rmi/server/RemoteServer.class
new file mode 100644
index 00000000000..e656db2bbcb
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/RemoteServer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/RemoteStub.class b/libjava/classpath/lib/java/rmi/server/RemoteStub.class
new file mode 100644
index 00000000000..3c560b3e73e
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/RemoteStub.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/ServerCloneException.class b/libjava/classpath/lib/java/rmi/server/ServerCloneException.class
new file mode 100644
index 00000000000..393449a4016
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/ServerCloneException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/ServerNotActiveException.class b/libjava/classpath/lib/java/rmi/server/ServerNotActiveException.class
new file mode 100644
index 00000000000..a8c77d5c3c0
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/ServerNotActiveException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/ServerRef.class b/libjava/classpath/lib/java/rmi/server/ServerRef.class
new file mode 100644
index 00000000000..455cf310afc
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/ServerRef.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/Skeleton.class b/libjava/classpath/lib/java/rmi/server/Skeleton.class
new file mode 100644
index 00000000000..4c90847b396
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/Skeleton.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/SkeletonMismatchException.class b/libjava/classpath/lib/java/rmi/server/SkeletonMismatchException.class
new file mode 100644
index 00000000000..04cf9194b82
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/SkeletonMismatchException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/SkeletonNotFoundException.class b/libjava/classpath/lib/java/rmi/server/SkeletonNotFoundException.class
new file mode 100644
index 00000000000..3b433cd1e12
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/SkeletonNotFoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/SocketSecurityException.class b/libjava/classpath/lib/java/rmi/server/SocketSecurityException.class
new file mode 100644
index 00000000000..df031c60aad
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/SocketSecurityException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/UID.class b/libjava/classpath/lib/java/rmi/server/UID.class
new file mode 100644
index 00000000000..dcddb18e86e
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/UID.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/UnicastRemoteObject.class b/libjava/classpath/lib/java/rmi/server/UnicastRemoteObject.class
new file mode 100644
index 00000000000..0798f7264f8
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/UnicastRemoteObject.class
Binary files differ
diff --git a/libjava/classpath/lib/java/rmi/server/Unreferenced.class b/libjava/classpath/lib/java/rmi/server/Unreferenced.class
new file mode 100644
index 00000000000..20ae1569249
--- /dev/null
+++ b/libjava/classpath/lib/java/rmi/server/Unreferenced.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/AccessControlContext.class b/libjava/classpath/lib/java/security/AccessControlContext.class
new file mode 100644
index 00000000000..8088ee91d04
--- /dev/null
+++ b/libjava/classpath/lib/java/security/AccessControlContext.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/AccessControlException.class b/libjava/classpath/lib/java/security/AccessControlException.class
new file mode 100644
index 00000000000..ea2ade7e89a
--- /dev/null
+++ b/libjava/classpath/lib/java/security/AccessControlException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/AccessController.class b/libjava/classpath/lib/java/security/AccessController.class
new file mode 100644
index 00000000000..7d2ff3379cb
--- /dev/null
+++ b/libjava/classpath/lib/java/security/AccessController.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/AlgorithmParameterGenerator.class b/libjava/classpath/lib/java/security/AlgorithmParameterGenerator.class
new file mode 100644
index 00000000000..7810eafc93a
--- /dev/null
+++ b/libjava/classpath/lib/java/security/AlgorithmParameterGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/AlgorithmParameterGeneratorSpi.class b/libjava/classpath/lib/java/security/AlgorithmParameterGeneratorSpi.class
new file mode 100644
index 00000000000..c92e585cf42
--- /dev/null
+++ b/libjava/classpath/lib/java/security/AlgorithmParameterGeneratorSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/AlgorithmParameters.class b/libjava/classpath/lib/java/security/AlgorithmParameters.class
new file mode 100644
index 00000000000..a9d77c910bf
--- /dev/null
+++ b/libjava/classpath/lib/java/security/AlgorithmParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/AlgorithmParametersSpi.class b/libjava/classpath/lib/java/security/AlgorithmParametersSpi.class
new file mode 100644
index 00000000000..a094e3523c0
--- /dev/null
+++ b/libjava/classpath/lib/java/security/AlgorithmParametersSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/AllPermission$AllPermissionCollection.class b/libjava/classpath/lib/java/security/AllPermission$AllPermissionCollection.class
new file mode 100644
index 00000000000..49e969e5ca0
--- /dev/null
+++ b/libjava/classpath/lib/java/security/AllPermission$AllPermissionCollection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/AllPermission.class b/libjava/classpath/lib/java/security/AllPermission.class
new file mode 100644
index 00000000000..616e7a5e7bd
--- /dev/null
+++ b/libjava/classpath/lib/java/security/AllPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/BasicPermission$BasicPermissionCollection.class b/libjava/classpath/lib/java/security/BasicPermission$BasicPermissionCollection.class
new file mode 100644
index 00000000000..23065c3eb65
--- /dev/null
+++ b/libjava/classpath/lib/java/security/BasicPermission$BasicPermissionCollection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/BasicPermission.class b/libjava/classpath/lib/java/security/BasicPermission.class
new file mode 100644
index 00000000000..00b2d169aa3
--- /dev/null
+++ b/libjava/classpath/lib/java/security/BasicPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/Certificate.class b/libjava/classpath/lib/java/security/Certificate.class
new file mode 100644
index 00000000000..5e9236053d1
--- /dev/null
+++ b/libjava/classpath/lib/java/security/Certificate.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/CodeSource.class b/libjava/classpath/lib/java/security/CodeSource.class
new file mode 100644
index 00000000000..733d14d841c
--- /dev/null
+++ b/libjava/classpath/lib/java/security/CodeSource.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/DigestException.class b/libjava/classpath/lib/java/security/DigestException.class
new file mode 100644
index 00000000000..26356144103
--- /dev/null
+++ b/libjava/classpath/lib/java/security/DigestException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/DigestInputStream.class b/libjava/classpath/lib/java/security/DigestInputStream.class
new file mode 100644
index 00000000000..bcfefac2176
--- /dev/null
+++ b/libjava/classpath/lib/java/security/DigestInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/DigestOutputStream.class b/libjava/classpath/lib/java/security/DigestOutputStream.class
new file mode 100644
index 00000000000..44a74b6420c
--- /dev/null
+++ b/libjava/classpath/lib/java/security/DigestOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/DomainCombiner.class b/libjava/classpath/lib/java/security/DomainCombiner.class
new file mode 100644
index 00000000000..6cf02d079cb
--- /dev/null
+++ b/libjava/classpath/lib/java/security/DomainCombiner.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/DummyKeyPairGenerator.class b/libjava/classpath/lib/java/security/DummyKeyPairGenerator.class
new file mode 100644
index 00000000000..4933178fa18
--- /dev/null
+++ b/libjava/classpath/lib/java/security/DummyKeyPairGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/DummyMessageDigest.class b/libjava/classpath/lib/java/security/DummyMessageDigest.class
new file mode 100644
index 00000000000..f83915d9949
--- /dev/null
+++ b/libjava/classpath/lib/java/security/DummyMessageDigest.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/DummySignature.class b/libjava/classpath/lib/java/security/DummySignature.class
new file mode 100644
index 00000000000..712cc0340da
--- /dev/null
+++ b/libjava/classpath/lib/java/security/DummySignature.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/GeneralSecurityException.class b/libjava/classpath/lib/java/security/GeneralSecurityException.class
new file mode 100644
index 00000000000..77dca62f2d5
--- /dev/null
+++ b/libjava/classpath/lib/java/security/GeneralSecurityException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/Guard.class b/libjava/classpath/lib/java/security/Guard.class
new file mode 100644
index 00000000000..a52f428e2b6
--- /dev/null
+++ b/libjava/classpath/lib/java/security/Guard.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/GuardedObject.class b/libjava/classpath/lib/java/security/GuardedObject.class
new file mode 100644
index 00000000000..2b3b188850f
--- /dev/null
+++ b/libjava/classpath/lib/java/security/GuardedObject.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/Identity.class b/libjava/classpath/lib/java/security/Identity.class
new file mode 100644
index 00000000000..a2de474e5b4
--- /dev/null
+++ b/libjava/classpath/lib/java/security/Identity.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/IdentityScope.class b/libjava/classpath/lib/java/security/IdentityScope.class
new file mode 100644
index 00000000000..8b1480e4f7e
--- /dev/null
+++ b/libjava/classpath/lib/java/security/IdentityScope.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/IntersectingDomainCombiner.class b/libjava/classpath/lib/java/security/IntersectingDomainCombiner.class
new file mode 100644
index 00000000000..6fe8af79b82
--- /dev/null
+++ b/libjava/classpath/lib/java/security/IntersectingDomainCombiner.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/InvalidAlgorithmParameterException.class b/libjava/classpath/lib/java/security/InvalidAlgorithmParameterException.class
new file mode 100644
index 00000000000..cec2e2c1e0c
--- /dev/null
+++ b/libjava/classpath/lib/java/security/InvalidAlgorithmParameterException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/InvalidKeyException.class b/libjava/classpath/lib/java/security/InvalidKeyException.class
new file mode 100644
index 00000000000..520793c9974
--- /dev/null
+++ b/libjava/classpath/lib/java/security/InvalidKeyException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/InvalidParameterException.class b/libjava/classpath/lib/java/security/InvalidParameterException.class
new file mode 100644
index 00000000000..ff473f72e4d
--- /dev/null
+++ b/libjava/classpath/lib/java/security/InvalidParameterException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/Key.class b/libjava/classpath/lib/java/security/Key.class
new file mode 100644
index 00000000000..e8ce277d1a2
--- /dev/null
+++ b/libjava/classpath/lib/java/security/Key.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/KeyException.class b/libjava/classpath/lib/java/security/KeyException.class
new file mode 100644
index 00000000000..03912d819e6
--- /dev/null
+++ b/libjava/classpath/lib/java/security/KeyException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/KeyFactory.class b/libjava/classpath/lib/java/security/KeyFactory.class
new file mode 100644
index 00000000000..42a4c971625
--- /dev/null
+++ b/libjava/classpath/lib/java/security/KeyFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/KeyFactorySpi.class b/libjava/classpath/lib/java/security/KeyFactorySpi.class
new file mode 100644
index 00000000000..a8183aa11a1
--- /dev/null
+++ b/libjava/classpath/lib/java/security/KeyFactorySpi.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/KeyManagementException.class b/libjava/classpath/lib/java/security/KeyManagementException.class
new file mode 100644
index 00000000000..173f42ca4e6
--- /dev/null
+++ b/libjava/classpath/lib/java/security/KeyManagementException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/KeyPair.class b/libjava/classpath/lib/java/security/KeyPair.class
new file mode 100644
index 00000000000..9b47427c0af
--- /dev/null
+++ b/libjava/classpath/lib/java/security/KeyPair.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/KeyPairGenerator.class b/libjava/classpath/lib/java/security/KeyPairGenerator.class
new file mode 100644
index 00000000000..ad30b19d38b
--- /dev/null
+++ b/libjava/classpath/lib/java/security/KeyPairGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/KeyPairGeneratorSpi.class b/libjava/classpath/lib/java/security/KeyPairGeneratorSpi.class
new file mode 100644
index 00000000000..c136552de6a
--- /dev/null
+++ b/libjava/classpath/lib/java/security/KeyPairGeneratorSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/KeyStore.class b/libjava/classpath/lib/java/security/KeyStore.class
new file mode 100644
index 00000000000..73563ee6d7a
--- /dev/null
+++ b/libjava/classpath/lib/java/security/KeyStore.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/KeyStoreException.class b/libjava/classpath/lib/java/security/KeyStoreException.class
new file mode 100644
index 00000000000..8a7c1bcd1ca
--- /dev/null
+++ b/libjava/classpath/lib/java/security/KeyStoreException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/KeyStoreSpi.class b/libjava/classpath/lib/java/security/KeyStoreSpi.class
new file mode 100644
index 00000000000..12a36ebc2ec
--- /dev/null
+++ b/libjava/classpath/lib/java/security/KeyStoreSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/MessageDigest.class b/libjava/classpath/lib/java/security/MessageDigest.class
new file mode 100644
index 00000000000..b2c9e734ea7
--- /dev/null
+++ b/libjava/classpath/lib/java/security/MessageDigest.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/MessageDigestSpi.class b/libjava/classpath/lib/java/security/MessageDigestSpi.class
new file mode 100644
index 00000000000..f04ecf852b7
--- /dev/null
+++ b/libjava/classpath/lib/java/security/MessageDigestSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/NoSuchAlgorithmException.class b/libjava/classpath/lib/java/security/NoSuchAlgorithmException.class
new file mode 100644
index 00000000000..931fffd411f
--- /dev/null
+++ b/libjava/classpath/lib/java/security/NoSuchAlgorithmException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/NoSuchProviderException.class b/libjava/classpath/lib/java/security/NoSuchProviderException.class
new file mode 100644
index 00000000000..9f46364d393
--- /dev/null
+++ b/libjava/classpath/lib/java/security/NoSuchProviderException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/Permission.class b/libjava/classpath/lib/java/security/Permission.class
new file mode 100644
index 00000000000..d9db3fae009
--- /dev/null
+++ b/libjava/classpath/lib/java/security/Permission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/PermissionCollection.class b/libjava/classpath/lib/java/security/PermissionCollection.class
new file mode 100644
index 00000000000..bb61795ca6c
--- /dev/null
+++ b/libjava/classpath/lib/java/security/PermissionCollection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/Permissions$1.class b/libjava/classpath/lib/java/security/Permissions$1.class
new file mode 100644
index 00000000000..c118bb9a1ce
--- /dev/null
+++ b/libjava/classpath/lib/java/security/Permissions$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/Permissions$PermissionsHash.class b/libjava/classpath/lib/java/security/Permissions$PermissionsHash.class
new file mode 100644
index 00000000000..b011dc1af4b
--- /dev/null
+++ b/libjava/classpath/lib/java/security/Permissions$PermissionsHash.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/Permissions.class b/libjava/classpath/lib/java/security/Permissions.class
new file mode 100644
index 00000000000..17b6636d6d6
--- /dev/null
+++ b/libjava/classpath/lib/java/security/Permissions.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/Policy.class b/libjava/classpath/lib/java/security/Policy.class
new file mode 100644
index 00000000000..4bc47cf4306
--- /dev/null
+++ b/libjava/classpath/lib/java/security/Policy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/Principal.class b/libjava/classpath/lib/java/security/Principal.class
new file mode 100644
index 00000000000..b151339a4a2
--- /dev/null
+++ b/libjava/classpath/lib/java/security/Principal.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/PrivateKey.class b/libjava/classpath/lib/java/security/PrivateKey.class
new file mode 100644
index 00000000000..1e24970535d
--- /dev/null
+++ b/libjava/classpath/lib/java/security/PrivateKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/PrivilegedAction.class b/libjava/classpath/lib/java/security/PrivilegedAction.class
new file mode 100644
index 00000000000..027abc8b819
--- /dev/null
+++ b/libjava/classpath/lib/java/security/PrivilegedAction.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/PrivilegedActionException.class b/libjava/classpath/lib/java/security/PrivilegedActionException.class
new file mode 100644
index 00000000000..55ce31ebbf0
--- /dev/null
+++ b/libjava/classpath/lib/java/security/PrivilegedActionException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/PrivilegedExceptionAction.class b/libjava/classpath/lib/java/security/PrivilegedExceptionAction.class
new file mode 100644
index 00000000000..473f9c6bd2c
--- /dev/null
+++ b/libjava/classpath/lib/java/security/PrivilegedExceptionAction.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/ProtectionDomain.class b/libjava/classpath/lib/java/security/ProtectionDomain.class
new file mode 100644
index 00000000000..cfac87e6aea
--- /dev/null
+++ b/libjava/classpath/lib/java/security/ProtectionDomain.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/Provider.class b/libjava/classpath/lib/java/security/Provider.class
new file mode 100644
index 00000000000..05a05bd6b21
--- /dev/null
+++ b/libjava/classpath/lib/java/security/Provider.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/ProviderException.class b/libjava/classpath/lib/java/security/ProviderException.class
new file mode 100644
index 00000000000..040f714e733
--- /dev/null
+++ b/libjava/classpath/lib/java/security/ProviderException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/PublicKey.class b/libjava/classpath/lib/java/security/PublicKey.class
new file mode 100644
index 00000000000..8220d30a3dd
--- /dev/null
+++ b/libjava/classpath/lib/java/security/PublicKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/SecureClassLoader.class b/libjava/classpath/lib/java/security/SecureClassLoader.class
new file mode 100644
index 00000000000..62736c8b066
--- /dev/null
+++ b/libjava/classpath/lib/java/security/SecureClassLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/SecureRandom.class b/libjava/classpath/lib/java/security/SecureRandom.class
new file mode 100644
index 00000000000..78bdc63f9fe
--- /dev/null
+++ b/libjava/classpath/lib/java/security/SecureRandom.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/SecureRandomSpi.class b/libjava/classpath/lib/java/security/SecureRandomSpi.class
new file mode 100644
index 00000000000..b0c6d5edf76
--- /dev/null
+++ b/libjava/classpath/lib/java/security/SecureRandomSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/Security.class b/libjava/classpath/lib/java/security/Security.class
new file mode 100644
index 00000000000..33419eb80c5
--- /dev/null
+++ b/libjava/classpath/lib/java/security/Security.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/SecurityPermission.class b/libjava/classpath/lib/java/security/SecurityPermission.class
new file mode 100644
index 00000000000..b7bdffc4426
--- /dev/null
+++ b/libjava/classpath/lib/java/security/SecurityPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/Signature.class b/libjava/classpath/lib/java/security/Signature.class
new file mode 100644
index 00000000000..eed75c19d44
--- /dev/null
+++ b/libjava/classpath/lib/java/security/Signature.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/SignatureException.class b/libjava/classpath/lib/java/security/SignatureException.class
new file mode 100644
index 00000000000..c6d97ff886b
--- /dev/null
+++ b/libjava/classpath/lib/java/security/SignatureException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/SignatureSpi.class b/libjava/classpath/lib/java/security/SignatureSpi.class
new file mode 100644
index 00000000000..426f987a9f3
--- /dev/null
+++ b/libjava/classpath/lib/java/security/SignatureSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/SignedObject.class b/libjava/classpath/lib/java/security/SignedObject.class
new file mode 100644
index 00000000000..3f3cd5318ec
--- /dev/null
+++ b/libjava/classpath/lib/java/security/SignedObject.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/Signer.class b/libjava/classpath/lib/java/security/Signer.class
new file mode 100644
index 00000000000..61d61658962
--- /dev/null
+++ b/libjava/classpath/lib/java/security/Signer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/UnrecoverableKeyException.class b/libjava/classpath/lib/java/security/UnrecoverableKeyException.class
new file mode 100644
index 00000000000..3976d41690d
--- /dev/null
+++ b/libjava/classpath/lib/java/security/UnrecoverableKeyException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/UnresolvedPermission.class b/libjava/classpath/lib/java/security/UnresolvedPermission.class
new file mode 100644
index 00000000000..8304a0c2ff6
--- /dev/null
+++ b/libjava/classpath/lib/java/security/UnresolvedPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/UnresolvedPermissionCollection$1.class b/libjava/classpath/lib/java/security/UnresolvedPermissionCollection$1.class
new file mode 100644
index 00000000000..cded8e7fb56
--- /dev/null
+++ b/libjava/classpath/lib/java/security/UnresolvedPermissionCollection$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/UnresolvedPermissionCollection.class b/libjava/classpath/lib/java/security/UnresolvedPermissionCollection.class
new file mode 100644
index 00000000000..ab046caca79
--- /dev/null
+++ b/libjava/classpath/lib/java/security/UnresolvedPermissionCollection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/VMAccessControlState.class b/libjava/classpath/lib/java/security/VMAccessControlState.class
new file mode 100644
index 00000000000..a960fa9461d
--- /dev/null
+++ b/libjava/classpath/lib/java/security/VMAccessControlState.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/VMAccessController.class b/libjava/classpath/lib/java/security/VMAccessController.class
new file mode 100644
index 00000000000..d05cd9c8456
--- /dev/null
+++ b/libjava/classpath/lib/java/security/VMAccessController.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/VMSecureRandom$Spinner.class b/libjava/classpath/lib/java/security/VMSecureRandom$Spinner.class
new file mode 100644
index 00000000000..955a1f3db72
--- /dev/null
+++ b/libjava/classpath/lib/java/security/VMSecureRandom$Spinner.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/VMSecureRandom.class b/libjava/classpath/lib/java/security/VMSecureRandom.class
new file mode 100644
index 00000000000..08a44d63f80
--- /dev/null
+++ b/libjava/classpath/lib/java/security/VMSecureRandom.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/acl/Acl.class b/libjava/classpath/lib/java/security/acl/Acl.class
new file mode 100644
index 00000000000..250e3f47f33
--- /dev/null
+++ b/libjava/classpath/lib/java/security/acl/Acl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/acl/AclEntry.class b/libjava/classpath/lib/java/security/acl/AclEntry.class
new file mode 100644
index 00000000000..586a36e8165
--- /dev/null
+++ b/libjava/classpath/lib/java/security/acl/AclEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/acl/AclNotFoundException.class b/libjava/classpath/lib/java/security/acl/AclNotFoundException.class
new file mode 100644
index 00000000000..55cd695dc8f
--- /dev/null
+++ b/libjava/classpath/lib/java/security/acl/AclNotFoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/acl/Group.class b/libjava/classpath/lib/java/security/acl/Group.class
new file mode 100644
index 00000000000..b0d5a2c55c8
--- /dev/null
+++ b/libjava/classpath/lib/java/security/acl/Group.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/acl/LastOwnerException.class b/libjava/classpath/lib/java/security/acl/LastOwnerException.class
new file mode 100644
index 00000000000..e3bbdeea7f0
--- /dev/null
+++ b/libjava/classpath/lib/java/security/acl/LastOwnerException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/acl/NotOwnerException.class b/libjava/classpath/lib/java/security/acl/NotOwnerException.class
new file mode 100644
index 00000000000..f11740fa345
--- /dev/null
+++ b/libjava/classpath/lib/java/security/acl/NotOwnerException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/acl/Owner.class b/libjava/classpath/lib/java/security/acl/Owner.class
new file mode 100644
index 00000000000..0144a74e964
--- /dev/null
+++ b/libjava/classpath/lib/java/security/acl/Owner.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/acl/Permission.class b/libjava/classpath/lib/java/security/acl/Permission.class
new file mode 100644
index 00000000000..f304848cb2f
--- /dev/null
+++ b/libjava/classpath/lib/java/security/acl/Permission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CRL.class b/libjava/classpath/lib/java/security/cert/CRL.class
new file mode 100644
index 00000000000..bda9c3e7dc9
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CRL.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CRLException.class b/libjava/classpath/lib/java/security/cert/CRLException.class
new file mode 100644
index 00000000000..ab089611fd2
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CRLException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CRLSelector.class b/libjava/classpath/lib/java/security/cert/CRLSelector.class
new file mode 100644
index 00000000000..2fc15051ccf
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CRLSelector.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertPath$CertPathRep.class b/libjava/classpath/lib/java/security/cert/CertPath$CertPathRep.class
new file mode 100644
index 00000000000..58cd7b03bcc
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertPath$CertPathRep.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertPath.class b/libjava/classpath/lib/java/security/cert/CertPath.class
new file mode 100644
index 00000000000..b16f484e059
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertPath.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertPathBuilder.class b/libjava/classpath/lib/java/security/cert/CertPathBuilder.class
new file mode 100644
index 00000000000..fba37d76618
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertPathBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertPathBuilderException.class b/libjava/classpath/lib/java/security/cert/CertPathBuilderException.class
new file mode 100644
index 00000000000..a6b3c8c185b
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertPathBuilderException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertPathBuilderResult.class b/libjava/classpath/lib/java/security/cert/CertPathBuilderResult.class
new file mode 100644
index 00000000000..3abb577210a
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertPathBuilderResult.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertPathBuilderSpi.class b/libjava/classpath/lib/java/security/cert/CertPathBuilderSpi.class
new file mode 100644
index 00000000000..eea07821c45
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertPathBuilderSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertPathParameters.class b/libjava/classpath/lib/java/security/cert/CertPathParameters.class
new file mode 100644
index 00000000000..bfb72c44caa
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertPathParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertPathValidator$1.class b/libjava/classpath/lib/java/security/cert/CertPathValidator$1.class
new file mode 100644
index 00000000000..5d058c21969
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertPathValidator$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertPathValidator.class b/libjava/classpath/lib/java/security/cert/CertPathValidator.class
new file mode 100644
index 00000000000..eb2b70d85fc
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertPathValidator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertPathValidatorException.class b/libjava/classpath/lib/java/security/cert/CertPathValidatorException.class
new file mode 100644
index 00000000000..367c1cf0a80
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertPathValidatorException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertPathValidatorResult.class b/libjava/classpath/lib/java/security/cert/CertPathValidatorResult.class
new file mode 100644
index 00000000000..4aaf63c12c4
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertPathValidatorResult.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertPathValidatorSpi.class b/libjava/classpath/lib/java/security/cert/CertPathValidatorSpi.class
new file mode 100644
index 00000000000..adba53b0100
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertPathValidatorSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertSelector.class b/libjava/classpath/lib/java/security/cert/CertSelector.class
new file mode 100644
index 00000000000..84105e7efa5
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertSelector.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertStore$1.class b/libjava/classpath/lib/java/security/cert/CertStore$1.class
new file mode 100644
index 00000000000..19e537aa332
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertStore$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertStore.class b/libjava/classpath/lib/java/security/cert/CertStore.class
new file mode 100644
index 00000000000..7901487477c
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertStore.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertStoreException.class b/libjava/classpath/lib/java/security/cert/CertStoreException.class
new file mode 100644
index 00000000000..c779edd8747
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertStoreException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertStoreParameters.class b/libjava/classpath/lib/java/security/cert/CertStoreParameters.class
new file mode 100644
index 00000000000..2ce983a70a0
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertStoreParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertStoreSpi.class b/libjava/classpath/lib/java/security/cert/CertStoreSpi.class
new file mode 100644
index 00000000000..ddc8407e1a2
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertStoreSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/Certificate$CertificateRep.class b/libjava/classpath/lib/java/security/cert/Certificate$CertificateRep.class
new file mode 100644
index 00000000000..bd1da5fae2c
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/Certificate$CertificateRep.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/Certificate.class b/libjava/classpath/lib/java/security/cert/Certificate.class
new file mode 100644
index 00000000000..c97a9678c66
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/Certificate.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertificateEncodingException.class b/libjava/classpath/lib/java/security/cert/CertificateEncodingException.class
new file mode 100644
index 00000000000..1bb15a73e7c
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertificateEncodingException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertificateException.class b/libjava/classpath/lib/java/security/cert/CertificateException.class
new file mode 100644
index 00000000000..a453eda0913
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertificateException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertificateExpiredException.class b/libjava/classpath/lib/java/security/cert/CertificateExpiredException.class
new file mode 100644
index 00000000000..4d0007db4b1
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertificateExpiredException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertificateFactory.class b/libjava/classpath/lib/java/security/cert/CertificateFactory.class
new file mode 100644
index 00000000000..8b0973e2b73
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertificateFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertificateFactorySpi.class b/libjava/classpath/lib/java/security/cert/CertificateFactorySpi.class
new file mode 100644
index 00000000000..76ee2efbe64
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertificateFactorySpi.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertificateNotYetValidException.class b/libjava/classpath/lib/java/security/cert/CertificateNotYetValidException.class
new file mode 100644
index 00000000000..ffc55718528
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertificateNotYetValidException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CertificateParsingException.class b/libjava/classpath/lib/java/security/cert/CertificateParsingException.class
new file mode 100644
index 00000000000..f0e078a1f22
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CertificateParsingException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/CollectionCertStoreParameters.class b/libjava/classpath/lib/java/security/cert/CollectionCertStoreParameters.class
new file mode 100644
index 00000000000..d9c59abda40
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/CollectionCertStoreParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/LDAPCertStoreParameters.class b/libjava/classpath/lib/java/security/cert/LDAPCertStoreParameters.class
new file mode 100644
index 00000000000..a9c8d581684
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/LDAPCertStoreParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/PKIXBuilderParameters.class b/libjava/classpath/lib/java/security/cert/PKIXBuilderParameters.class
new file mode 100644
index 00000000000..b6b14258956
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/PKIXBuilderParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/PKIXCertPathBuilderResult.class b/libjava/classpath/lib/java/security/cert/PKIXCertPathBuilderResult.class
new file mode 100644
index 00000000000..383ea72a9bd
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/PKIXCertPathBuilderResult.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/PKIXCertPathChecker.class b/libjava/classpath/lib/java/security/cert/PKIXCertPathChecker.class
new file mode 100644
index 00000000000..eec2ae93c02
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/PKIXCertPathChecker.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/PKIXCertPathValidatorResult.class b/libjava/classpath/lib/java/security/cert/PKIXCertPathValidatorResult.class
new file mode 100644
index 00000000000..55b8c60d051
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/PKIXCertPathValidatorResult.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/PKIXParameters.class b/libjava/classpath/lib/java/security/cert/PKIXParameters.class
new file mode 100644
index 00000000000..07605e54d92
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/PKIXParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/PolicyNode.class b/libjava/classpath/lib/java/security/cert/PolicyNode.class
new file mode 100644
index 00000000000..82179432d0d
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/PolicyNode.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/PolicyQualifierInfo.class b/libjava/classpath/lib/java/security/cert/PolicyQualifierInfo.class
new file mode 100644
index 00000000000..5cbd3cabd84
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/PolicyQualifierInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/TrustAnchor.class b/libjava/classpath/lib/java/security/cert/TrustAnchor.class
new file mode 100644
index 00000000000..f0139dcf516
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/TrustAnchor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/X509CRL.class b/libjava/classpath/lib/java/security/cert/X509CRL.class
new file mode 100644
index 00000000000..51c1cb66617
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/X509CRL.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/X509CRLEntry.class b/libjava/classpath/lib/java/security/cert/X509CRLEntry.class
new file mode 100644
index 00000000000..06890e56c09
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/X509CRLEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/X509CRLSelector.class b/libjava/classpath/lib/java/security/cert/X509CRLSelector.class
new file mode 100644
index 00000000000..7e1f08ca9a2
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/X509CRLSelector.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/X509CertSelector.class b/libjava/classpath/lib/java/security/cert/X509CertSelector.class
new file mode 100644
index 00000000000..0cad7da01ab
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/X509CertSelector.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/X509Certificate.class b/libjava/classpath/lib/java/security/cert/X509Certificate.class
new file mode 100644
index 00000000000..b8ccb1279b0
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/X509Certificate.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/cert/X509Extension.class b/libjava/classpath/lib/java/security/cert/X509Extension.class
new file mode 100644
index 00000000000..bb174624a0e
--- /dev/null
+++ b/libjava/classpath/lib/java/security/cert/X509Extension.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/interfaces/DSAKey.class b/libjava/classpath/lib/java/security/interfaces/DSAKey.class
new file mode 100644
index 00000000000..e81b49ba714
--- /dev/null
+++ b/libjava/classpath/lib/java/security/interfaces/DSAKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/interfaces/DSAKeyPairGenerator.class b/libjava/classpath/lib/java/security/interfaces/DSAKeyPairGenerator.class
new file mode 100644
index 00000000000..bf5dfb4a840
--- /dev/null
+++ b/libjava/classpath/lib/java/security/interfaces/DSAKeyPairGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/interfaces/DSAParams.class b/libjava/classpath/lib/java/security/interfaces/DSAParams.class
new file mode 100644
index 00000000000..31c5d5c893a
--- /dev/null
+++ b/libjava/classpath/lib/java/security/interfaces/DSAParams.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/interfaces/DSAPrivateKey.class b/libjava/classpath/lib/java/security/interfaces/DSAPrivateKey.class
new file mode 100644
index 00000000000..eb1ce05a860
--- /dev/null
+++ b/libjava/classpath/lib/java/security/interfaces/DSAPrivateKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/interfaces/DSAPublicKey.class b/libjava/classpath/lib/java/security/interfaces/DSAPublicKey.class
new file mode 100644
index 00000000000..be3e820de3e
--- /dev/null
+++ b/libjava/classpath/lib/java/security/interfaces/DSAPublicKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/interfaces/RSAKey.class b/libjava/classpath/lib/java/security/interfaces/RSAKey.class
new file mode 100644
index 00000000000..2951abe650b
--- /dev/null
+++ b/libjava/classpath/lib/java/security/interfaces/RSAKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/interfaces/RSAMultiPrimePrivateCrtKey.class b/libjava/classpath/lib/java/security/interfaces/RSAMultiPrimePrivateCrtKey.class
new file mode 100644
index 00000000000..203f43c8818
--- /dev/null
+++ b/libjava/classpath/lib/java/security/interfaces/RSAMultiPrimePrivateCrtKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/interfaces/RSAPrivateCrtKey.class b/libjava/classpath/lib/java/security/interfaces/RSAPrivateCrtKey.class
new file mode 100644
index 00000000000..457c4cc6a26
--- /dev/null
+++ b/libjava/classpath/lib/java/security/interfaces/RSAPrivateCrtKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/interfaces/RSAPrivateKey.class b/libjava/classpath/lib/java/security/interfaces/RSAPrivateKey.class
new file mode 100644
index 00000000000..a1784672486
--- /dev/null
+++ b/libjava/classpath/lib/java/security/interfaces/RSAPrivateKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/interfaces/RSAPublicKey.class b/libjava/classpath/lib/java/security/interfaces/RSAPublicKey.class
new file mode 100644
index 00000000000..2339eaf8b4c
--- /dev/null
+++ b/libjava/classpath/lib/java/security/interfaces/RSAPublicKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/AlgorithmParameterSpec.class b/libjava/classpath/lib/java/security/spec/AlgorithmParameterSpec.class
new file mode 100644
index 00000000000..db65a888ef9
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/AlgorithmParameterSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/DSAParameterSpec.class b/libjava/classpath/lib/java/security/spec/DSAParameterSpec.class
new file mode 100644
index 00000000000..f6283440487
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/DSAParameterSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/DSAPrivateKeySpec.class b/libjava/classpath/lib/java/security/spec/DSAPrivateKeySpec.class
new file mode 100644
index 00000000000..80a9d7bc15b
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/DSAPrivateKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/DSAPublicKeySpec.class b/libjava/classpath/lib/java/security/spec/DSAPublicKeySpec.class
new file mode 100644
index 00000000000..1dd26716dd7
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/DSAPublicKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/EncodedKeySpec.class b/libjava/classpath/lib/java/security/spec/EncodedKeySpec.class
new file mode 100644
index 00000000000..ec198d11d06
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/EncodedKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/InvalidKeySpecException.class b/libjava/classpath/lib/java/security/spec/InvalidKeySpecException.class
new file mode 100644
index 00000000000..b751f37fa22
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/InvalidKeySpecException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/InvalidParameterSpecException.class b/libjava/classpath/lib/java/security/spec/InvalidParameterSpecException.class
new file mode 100644
index 00000000000..155b3e971f1
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/InvalidParameterSpecException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/KeySpec.class b/libjava/classpath/lib/java/security/spec/KeySpec.class
new file mode 100644
index 00000000000..ef85d4b0819
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/KeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/PKCS8EncodedKeySpec.class b/libjava/classpath/lib/java/security/spec/PKCS8EncodedKeySpec.class
new file mode 100644
index 00000000000..238c8b9dcf9
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/PKCS8EncodedKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/PSSParameterSpec.class b/libjava/classpath/lib/java/security/spec/PSSParameterSpec.class
new file mode 100644
index 00000000000..04755ddfdd1
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/PSSParameterSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/RSAKeyGenParameterSpec.class b/libjava/classpath/lib/java/security/spec/RSAKeyGenParameterSpec.class
new file mode 100644
index 00000000000..302add6f2c6
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/RSAKeyGenParameterSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.class b/libjava/classpath/lib/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.class
new file mode 100644
index 00000000000..c5fb8c65243
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/RSAOtherPrimeInfo.class b/libjava/classpath/lib/java/security/spec/RSAOtherPrimeInfo.class
new file mode 100644
index 00000000000..537da042c00
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/RSAOtherPrimeInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/RSAPrivateCrtKeySpec.class b/libjava/classpath/lib/java/security/spec/RSAPrivateCrtKeySpec.class
new file mode 100644
index 00000000000..7553f6f5493
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/RSAPrivateCrtKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/RSAPrivateKeySpec.class b/libjava/classpath/lib/java/security/spec/RSAPrivateKeySpec.class
new file mode 100644
index 00000000000..f1084e17139
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/RSAPrivateKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/RSAPublicKeySpec.class b/libjava/classpath/lib/java/security/spec/RSAPublicKeySpec.class
new file mode 100644
index 00000000000..d170ebecf62
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/RSAPublicKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/java/security/spec/X509EncodedKeySpec.class b/libjava/classpath/lib/java/security/spec/X509EncodedKeySpec.class
new file mode 100644
index 00000000000..8b4a83261d9
--- /dev/null
+++ b/libjava/classpath/lib/java/security/spec/X509EncodedKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/Array.class b/libjava/classpath/lib/java/sql/Array.class
new file mode 100644
index 00000000000..8ebf014ee40
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/Array.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/BatchUpdateException.class b/libjava/classpath/lib/java/sql/BatchUpdateException.class
new file mode 100644
index 00000000000..6a011822402
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/BatchUpdateException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/Blob.class b/libjava/classpath/lib/java/sql/Blob.class
new file mode 100644
index 00000000000..c5d78cf1140
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/Blob.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/CallableStatement.class b/libjava/classpath/lib/java/sql/CallableStatement.class
new file mode 100644
index 00000000000..107a156c480
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/CallableStatement.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/Clob.class b/libjava/classpath/lib/java/sql/Clob.class
new file mode 100644
index 00000000000..937207f9cc6
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/Clob.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/Connection.class b/libjava/classpath/lib/java/sql/Connection.class
new file mode 100644
index 00000000000..d9adc68489a
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/Connection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/DataTruncation.class b/libjava/classpath/lib/java/sql/DataTruncation.class
new file mode 100644
index 00000000000..79ba9faf317
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/DataTruncation.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/DatabaseMetaData.class b/libjava/classpath/lib/java/sql/DatabaseMetaData.class
new file mode 100644
index 00000000000..5fc91e8506d
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/DatabaseMetaData.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/Date.class b/libjava/classpath/lib/java/sql/Date.class
new file mode 100644
index 00000000000..5d82204f637
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/Date.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/Driver.class b/libjava/classpath/lib/java/sql/Driver.class
new file mode 100644
index 00000000000..8b7b6f2aa64
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/Driver.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/DriverManager.class b/libjava/classpath/lib/java/sql/DriverManager.class
new file mode 100644
index 00000000000..09bc56907b7
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/DriverManager.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/DriverPropertyInfo.class b/libjava/classpath/lib/java/sql/DriverPropertyInfo.class
new file mode 100644
index 00000000000..86e7830417d
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/DriverPropertyInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/ParameterMetaData.class b/libjava/classpath/lib/java/sql/ParameterMetaData.class
new file mode 100644
index 00000000000..1d990a0e159
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/ParameterMetaData.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/PreparedStatement.class b/libjava/classpath/lib/java/sql/PreparedStatement.class
new file mode 100644
index 00000000000..dda2c70e68c
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/PreparedStatement.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/Ref.class b/libjava/classpath/lib/java/sql/Ref.class
new file mode 100644
index 00000000000..870e337e5ea
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/Ref.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/ResultSet.class b/libjava/classpath/lib/java/sql/ResultSet.class
new file mode 100644
index 00000000000..7f08c392dbb
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/ResultSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/ResultSetMetaData.class b/libjava/classpath/lib/java/sql/ResultSetMetaData.class
new file mode 100644
index 00000000000..9f7e08050aa
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/ResultSetMetaData.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/SQLData.class b/libjava/classpath/lib/java/sql/SQLData.class
new file mode 100644
index 00000000000..85a205f71d1
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/SQLData.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/SQLException.class b/libjava/classpath/lib/java/sql/SQLException.class
new file mode 100644
index 00000000000..94cb2761b6b
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/SQLException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/SQLInput.class b/libjava/classpath/lib/java/sql/SQLInput.class
new file mode 100644
index 00000000000..0f7d735b585
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/SQLInput.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/SQLOutput.class b/libjava/classpath/lib/java/sql/SQLOutput.class
new file mode 100644
index 00000000000..021bdf44989
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/SQLOutput.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/SQLPermission.class b/libjava/classpath/lib/java/sql/SQLPermission.class
new file mode 100644
index 00000000000..d59957bddd7
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/SQLPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/SQLWarning.class b/libjava/classpath/lib/java/sql/SQLWarning.class
new file mode 100644
index 00000000000..ee6d7dc29e2
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/SQLWarning.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/Savepoint.class b/libjava/classpath/lib/java/sql/Savepoint.class
new file mode 100644
index 00000000000..3628fe120fd
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/Savepoint.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/Statement.class b/libjava/classpath/lib/java/sql/Statement.class
new file mode 100644
index 00000000000..c383f68f691
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/Statement.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/Struct.class b/libjava/classpath/lib/java/sql/Struct.class
new file mode 100644
index 00000000000..89b43104c62
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/Struct.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/Time.class b/libjava/classpath/lib/java/sql/Time.class
new file mode 100644
index 00000000000..888edfc806e
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/Time.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/Timestamp.class b/libjava/classpath/lib/java/sql/Timestamp.class
new file mode 100644
index 00000000000..bfbac9d0617
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/Timestamp.class
Binary files differ
diff --git a/libjava/classpath/lib/java/sql/Types.class b/libjava/classpath/lib/java/sql/Types.class
new file mode 100644
index 00000000000..5974e9cbbce
--- /dev/null
+++ b/libjava/classpath/lib/java/sql/Types.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/Annotation.class b/libjava/classpath/lib/java/text/Annotation.class
new file mode 100644
index 00000000000..7af7955e747
--- /dev/null
+++ b/libjava/classpath/lib/java/text/Annotation.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/AttributedCharacterIterator$Attribute.class b/libjava/classpath/lib/java/text/AttributedCharacterIterator$Attribute.class
new file mode 100644
index 00000000000..ddbbd52df23
--- /dev/null
+++ b/libjava/classpath/lib/java/text/AttributedCharacterIterator$Attribute.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/AttributedCharacterIterator.class b/libjava/classpath/lib/java/text/AttributedCharacterIterator.class
new file mode 100644
index 00000000000..2fb36a2bbdd
--- /dev/null
+++ b/libjava/classpath/lib/java/text/AttributedCharacterIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/AttributedString$AttributeRange.class b/libjava/classpath/lib/java/text/AttributedString$AttributeRange.class
new file mode 100644
index 00000000000..f9419962f09
--- /dev/null
+++ b/libjava/classpath/lib/java/text/AttributedString$AttributeRange.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/AttributedString.class b/libjava/classpath/lib/java/text/AttributedString.class
new file mode 100644
index 00000000000..10bf0d721ac
--- /dev/null
+++ b/libjava/classpath/lib/java/text/AttributedString.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/AttributedStringIterator.class b/libjava/classpath/lib/java/text/AttributedStringIterator.class
new file mode 100644
index 00000000000..0d2a79733dd
--- /dev/null
+++ b/libjava/classpath/lib/java/text/AttributedStringIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/Bidi.class b/libjava/classpath/lib/java/text/Bidi.class
new file mode 100644
index 00000000000..4e61cb80f8f
--- /dev/null
+++ b/libjava/classpath/lib/java/text/Bidi.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/BreakIterator.class b/libjava/classpath/lib/java/text/BreakIterator.class
new file mode 100644
index 00000000000..c49e8f40fc7
--- /dev/null
+++ b/libjava/classpath/lib/java/text/BreakIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/CharacterIterator.class b/libjava/classpath/lib/java/text/CharacterIterator.class
new file mode 100644
index 00000000000..862cfd47702
--- /dev/null
+++ b/libjava/classpath/lib/java/text/CharacterIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/ChoiceFormat.class b/libjava/classpath/lib/java/text/ChoiceFormat.class
new file mode 100644
index 00000000000..68a81e5eb4b
--- /dev/null
+++ b/libjava/classpath/lib/java/text/ChoiceFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/CollationElementIterator.class b/libjava/classpath/lib/java/text/CollationElementIterator.class
new file mode 100644
index 00000000000..3c3176d8b22
--- /dev/null
+++ b/libjava/classpath/lib/java/text/CollationElementIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/CollationKey.class b/libjava/classpath/lib/java/text/CollationKey.class
new file mode 100644
index 00000000000..da44773045f
--- /dev/null
+++ b/libjava/classpath/lib/java/text/CollationKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/Collator.class b/libjava/classpath/lib/java/text/Collator.class
new file mode 100644
index 00000000000..a997460fbe9
--- /dev/null
+++ b/libjava/classpath/lib/java/text/Collator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/DateFormat$Field.class b/libjava/classpath/lib/java/text/DateFormat$Field.class
new file mode 100644
index 00000000000..0c681874a3c
--- /dev/null
+++ b/libjava/classpath/lib/java/text/DateFormat$Field.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/DateFormat.class b/libjava/classpath/lib/java/text/DateFormat.class
new file mode 100644
index 00000000000..ac98f50c4d1
--- /dev/null
+++ b/libjava/classpath/lib/java/text/DateFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/DateFormatSymbols.class b/libjava/classpath/lib/java/text/DateFormatSymbols.class
new file mode 100644
index 00000000000..72c3fdfa4da
--- /dev/null
+++ b/libjava/classpath/lib/java/text/DateFormatSymbols.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/DecimalFormat.class b/libjava/classpath/lib/java/text/DecimalFormat.class
new file mode 100644
index 00000000000..41efb165bfa
--- /dev/null
+++ b/libjava/classpath/lib/java/text/DecimalFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/DecimalFormatSymbols.class b/libjava/classpath/lib/java/text/DecimalFormatSymbols.class
new file mode 100644
index 00000000000..a88226feba5
--- /dev/null
+++ b/libjava/classpath/lib/java/text/DecimalFormatSymbols.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/FieldPosition.class b/libjava/classpath/lib/java/text/FieldPosition.class
new file mode 100644
index 00000000000..5c8e962dae1
--- /dev/null
+++ b/libjava/classpath/lib/java/text/FieldPosition.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/Format$Field.class b/libjava/classpath/lib/java/text/Format$Field.class
new file mode 100644
index 00000000000..72c598b2fb9
--- /dev/null
+++ b/libjava/classpath/lib/java/text/Format$Field.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/Format.class b/libjava/classpath/lib/java/text/Format.class
new file mode 100644
index 00000000000..8dae54e1b90
--- /dev/null
+++ b/libjava/classpath/lib/java/text/Format.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/MessageFormat$Field.class b/libjava/classpath/lib/java/text/MessageFormat$Field.class
new file mode 100644
index 00000000000..a020190401d
--- /dev/null
+++ b/libjava/classpath/lib/java/text/MessageFormat$Field.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/MessageFormat$MessageFormatElement.class b/libjava/classpath/lib/java/text/MessageFormat$MessageFormatElement.class
new file mode 100644
index 00000000000..30579ea40bc
--- /dev/null
+++ b/libjava/classpath/lib/java/text/MessageFormat$MessageFormatElement.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/MessageFormat.class b/libjava/classpath/lib/java/text/MessageFormat.class
new file mode 100644
index 00000000000..96041451fe5
--- /dev/null
+++ b/libjava/classpath/lib/java/text/MessageFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/NumberFormat$Field.class b/libjava/classpath/lib/java/text/NumberFormat$Field.class
new file mode 100644
index 00000000000..bc2baf09a70
--- /dev/null
+++ b/libjava/classpath/lib/java/text/NumberFormat$Field.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/NumberFormat.class b/libjava/classpath/lib/java/text/NumberFormat.class
new file mode 100644
index 00000000000..937e291e867
--- /dev/null
+++ b/libjava/classpath/lib/java/text/NumberFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/ParseException.class b/libjava/classpath/lib/java/text/ParseException.class
new file mode 100644
index 00000000000..01bfb0af89d
--- /dev/null
+++ b/libjava/classpath/lib/java/text/ParseException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/ParsePosition.class b/libjava/classpath/lib/java/text/ParsePosition.class
new file mode 100644
index 00000000000..6ab897dee9c
--- /dev/null
+++ b/libjava/classpath/lib/java/text/ParsePosition.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/RuleBasedCollator$CollationElement.class b/libjava/classpath/lib/java/text/RuleBasedCollator$CollationElement.class
new file mode 100644
index 00000000000..6a46c8d25de
--- /dev/null
+++ b/libjava/classpath/lib/java/text/RuleBasedCollator$CollationElement.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/RuleBasedCollator$CollationSorter.class b/libjava/classpath/lib/java/text/RuleBasedCollator$CollationSorter.class
new file mode 100644
index 00000000000..f70f2a9b234
--- /dev/null
+++ b/libjava/classpath/lib/java/text/RuleBasedCollator$CollationSorter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/RuleBasedCollator.class b/libjava/classpath/lib/java/text/RuleBasedCollator.class
new file mode 100644
index 00000000000..e15199eefb3
--- /dev/null
+++ b/libjava/classpath/lib/java/text/RuleBasedCollator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/SimpleDateFormat$CompiledField.class b/libjava/classpath/lib/java/text/SimpleDateFormat$CompiledField.class
new file mode 100644
index 00000000000..559c5ce9dfe
--- /dev/null
+++ b/libjava/classpath/lib/java/text/SimpleDateFormat$CompiledField.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/SimpleDateFormat.class b/libjava/classpath/lib/java/text/SimpleDateFormat.class
new file mode 100644
index 00000000000..7ddd8faaafb
--- /dev/null
+++ b/libjava/classpath/lib/java/text/SimpleDateFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/java/text/StringCharacterIterator.class b/libjava/classpath/lib/java/text/StringCharacterIterator.class
new file mode 100644
index 00000000000..698696b285d
--- /dev/null
+++ b/libjava/classpath/lib/java/text/StringCharacterIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractCollection.class b/libjava/classpath/lib/java/util/AbstractCollection.class
new file mode 100644
index 00000000000..439e2f88c2d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractCollection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractList$1.class b/libjava/classpath/lib/java/util/AbstractList$1.class
new file mode 100644
index 00000000000..a3cc154b39f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractList$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractList$2.class b/libjava/classpath/lib/java/util/AbstractList$2.class
new file mode 100644
index 00000000000..3f7f650e714
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractList$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractList$3.class b/libjava/classpath/lib/java/util/AbstractList$3.class
new file mode 100644
index 00000000000..063c1462f3e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractList$3.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractList$RandomAccessSubList.class b/libjava/classpath/lib/java/util/AbstractList$RandomAccessSubList.class
new file mode 100644
index 00000000000..138fade89eb
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractList$RandomAccessSubList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractList$SubList.class b/libjava/classpath/lib/java/util/AbstractList$SubList.class
new file mode 100644
index 00000000000..532527f9954
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractList$SubList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractList.class b/libjava/classpath/lib/java/util/AbstractList.class
new file mode 100644
index 00000000000..5632eeb83f9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractMap$1.class b/libjava/classpath/lib/java/util/AbstractMap$1.class
new file mode 100644
index 00000000000..d851f1eae65
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractMap$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractMap$2.class b/libjava/classpath/lib/java/util/AbstractMap$2.class
new file mode 100644
index 00000000000..5f73e7ab586
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractMap$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractMap$3.class b/libjava/classpath/lib/java/util/AbstractMap$3.class
new file mode 100644
index 00000000000..2511aba3f2e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractMap$3.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractMap$4.class b/libjava/classpath/lib/java/util/AbstractMap$4.class
new file mode 100644
index 00000000000..973ec3ec0ac
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractMap$4.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractMap$SimpleEntry.class b/libjava/classpath/lib/java/util/AbstractMap$SimpleEntry.class
new file mode 100644
index 00000000000..edabfd84331
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractMap$SimpleEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractMap$SimpleImmutableEntry.class b/libjava/classpath/lib/java/util/AbstractMap$SimpleImmutableEntry.class
new file mode 100644
index 00000000000..92d54d7cbdb
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractMap$SimpleImmutableEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractMap.class b/libjava/classpath/lib/java/util/AbstractMap.class
new file mode 100644
index 00000000000..b81d99e3cea
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractQueue.class b/libjava/classpath/lib/java/util/AbstractQueue.class
new file mode 100644
index 00000000000..65a84617690
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractSequentialList.class b/libjava/classpath/lib/java/util/AbstractSequentialList.class
new file mode 100644
index 00000000000..ff16cbbbe58
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractSequentialList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/AbstractSet.class b/libjava/classpath/lib/java/util/AbstractSet.class
new file mode 100644
index 00000000000..7730cf62bf9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/AbstractSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/ArrayDeque$DeqIterator.class b/libjava/classpath/lib/java/util/ArrayDeque$DeqIterator.class
new file mode 100644
index 00000000000..7c3a8a8a36c
--- /dev/null
+++ b/libjava/classpath/lib/java/util/ArrayDeque$DeqIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/ArrayDeque$DescendingIterator.class b/libjava/classpath/lib/java/util/ArrayDeque$DescendingIterator.class
new file mode 100644
index 00000000000..a21477b4355
--- /dev/null
+++ b/libjava/classpath/lib/java/util/ArrayDeque$DescendingIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/ArrayDeque.class b/libjava/classpath/lib/java/util/ArrayDeque.class
new file mode 100644
index 00000000000..bd164b570a7
--- /dev/null
+++ b/libjava/classpath/lib/java/util/ArrayDeque.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/ArrayList.class b/libjava/classpath/lib/java/util/ArrayList.class
new file mode 100644
index 00000000000..e61f4d4094e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/ArrayList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Arrays$ArrayList.class b/libjava/classpath/lib/java/util/Arrays$ArrayList.class
new file mode 100644
index 00000000000..98cdfd0e070
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Arrays$ArrayList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Arrays.class b/libjava/classpath/lib/java/util/Arrays.class
new file mode 100644
index 00000000000..5dcf6af3f41
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Arrays.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/BitSet.class b/libjava/classpath/lib/java/util/BitSet.class
new file mode 100644
index 00000000000..fb3ddb45d24
--- /dev/null
+++ b/libjava/classpath/lib/java/util/BitSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Calendar.class b/libjava/classpath/lib/java/util/Calendar.class
new file mode 100644
index 00000000000..f6d96a901ed
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Calendar.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collection.class b/libjava/classpath/lib/java/util/Collection.class
new file mode 100644
index 00000000000..9ecadba5644
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$1$SynchronizedMapEntry.class b/libjava/classpath/lib/java/util/Collections$1$SynchronizedMapEntry.class
new file mode 100644
index 00000000000..a89df2e9dbd
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$1$SynchronizedMapEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$1.class b/libjava/classpath/lib/java/util/Collections$1.class
new file mode 100644
index 00000000000..05f7a9d776a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$2.class b/libjava/classpath/lib/java/util/Collections$2.class
new file mode 100644
index 00000000000..250ef65e9e9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$3.class b/libjava/classpath/lib/java/util/Collections$3.class
new file mode 100644
index 00000000000..b4b47469a4b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$3.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$4.class b/libjava/classpath/lib/java/util/Collections$4.class
new file mode 100644
index 00000000000..da444283677
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$4.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$5.class b/libjava/classpath/lib/java/util/Collections$5.class
new file mode 100644
index 00000000000..8555537723d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$5.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$6.class b/libjava/classpath/lib/java/util/Collections$6.class
new file mode 100644
index 00000000000..054c9112751
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$6.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$7.class b/libjava/classpath/lib/java/util/Collections$7.class
new file mode 100644
index 00000000000..9085dd5fd4d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$7.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$8.class b/libjava/classpath/lib/java/util/Collections$8.class
new file mode 100644
index 00000000000..fb009cb9f7f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$8.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$9.class b/libjava/classpath/lib/java/util/Collections$9.class
new file mode 100644
index 00000000000..c1d9438dfb4
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$9.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$CheckedCollection.class b/libjava/classpath/lib/java/util/Collections$CheckedCollection.class
new file mode 100644
index 00000000000..466d1fd3548
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$CheckedCollection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$CheckedIterator.class b/libjava/classpath/lib/java/util/Collections$CheckedIterator.class
new file mode 100644
index 00000000000..e7b49bccd06
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$CheckedIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$CheckedList.class b/libjava/classpath/lib/java/util/Collections$CheckedList.class
new file mode 100644
index 00000000000..c2ffb7c7e71
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$CheckedList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$CheckedListIterator.class b/libjava/classpath/lib/java/util/Collections$CheckedListIterator.class
new file mode 100644
index 00000000000..ef7b4901627
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$CheckedListIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$CheckedMap$CheckedEntrySet.class b/libjava/classpath/lib/java/util/Collections$CheckedMap$CheckedEntrySet.class
new file mode 100644
index 00000000000..d402ad1063b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$CheckedMap$CheckedEntrySet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$CheckedMap.class b/libjava/classpath/lib/java/util/Collections$CheckedMap.class
new file mode 100644
index 00000000000..0a0dfd454dc
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$CheckedMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$CheckedRandomAccessList.class b/libjava/classpath/lib/java/util/Collections$CheckedRandomAccessList.class
new file mode 100644
index 00000000000..205831a072f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$CheckedRandomAccessList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$CheckedSet.class b/libjava/classpath/lib/java/util/Collections$CheckedSet.class
new file mode 100644
index 00000000000..b30b3e602eb
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$CheckedSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$CheckedSortedMap.class b/libjava/classpath/lib/java/util/Collections$CheckedSortedMap.class
new file mode 100644
index 00000000000..abe198c261f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$CheckedSortedMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$CheckedSortedSet.class b/libjava/classpath/lib/java/util/Collections$CheckedSortedSet.class
new file mode 100644
index 00000000000..dc233e2ac83
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$CheckedSortedSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$CopiesList.class b/libjava/classpath/lib/java/util/Collections$CopiesList.class
new file mode 100644
index 00000000000..237af598d9c
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$CopiesList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$EmptyList.class b/libjava/classpath/lib/java/util/Collections$EmptyList.class
new file mode 100644
index 00000000000..5a72df5e753
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$EmptyList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$EmptyMap.class b/libjava/classpath/lib/java/util/Collections$EmptyMap.class
new file mode 100644
index 00000000000..2d727b7b764
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$EmptyMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$EmptySet.class b/libjava/classpath/lib/java/util/Collections$EmptySet.class
new file mode 100644
index 00000000000..c993f151567
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$EmptySet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$ReverseComparator.class b/libjava/classpath/lib/java/util/Collections$ReverseComparator.class
new file mode 100644
index 00000000000..a043cf0d721
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$ReverseComparator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$SingletonList.class b/libjava/classpath/lib/java/util/Collections$SingletonList.class
new file mode 100644
index 00000000000..a0ea2078b4a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$SingletonList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$SingletonMap.class b/libjava/classpath/lib/java/util/Collections$SingletonMap.class
new file mode 100644
index 00000000000..9cb211fd62f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$SingletonMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$SingletonSet.class b/libjava/classpath/lib/java/util/Collections$SingletonSet.class
new file mode 100644
index 00000000000..a4892de90c0
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$SingletonSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$SynchronizedCollection.class b/libjava/classpath/lib/java/util/Collections$SynchronizedCollection.class
new file mode 100644
index 00000000000..af78e3b1b29
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$SynchronizedCollection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$SynchronizedIterator.class b/libjava/classpath/lib/java/util/Collections$SynchronizedIterator.class
new file mode 100644
index 00000000000..d5ae321e571
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$SynchronizedIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$SynchronizedList.class b/libjava/classpath/lib/java/util/Collections$SynchronizedList.class
new file mode 100644
index 00000000000..3ce19d4cedf
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$SynchronizedList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$SynchronizedListIterator.class b/libjava/classpath/lib/java/util/Collections$SynchronizedListIterator.class
new file mode 100644
index 00000000000..c0e64a69837
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$SynchronizedListIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$SynchronizedMap.class b/libjava/classpath/lib/java/util/Collections$SynchronizedMap.class
new file mode 100644
index 00000000000..a50be837f6f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$SynchronizedMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$SynchronizedRandomAccessList.class b/libjava/classpath/lib/java/util/Collections$SynchronizedRandomAccessList.class
new file mode 100644
index 00000000000..e3e4e1e408f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$SynchronizedRandomAccessList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$SynchronizedSet.class b/libjava/classpath/lib/java/util/Collections$SynchronizedSet.class
new file mode 100644
index 00000000000..fd1dd495afa
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$SynchronizedSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$SynchronizedSortedMap.class b/libjava/classpath/lib/java/util/Collections$SynchronizedSortedMap.class
new file mode 100644
index 00000000000..9e35d212bde
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$SynchronizedSortedMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$SynchronizedSortedSet.class b/libjava/classpath/lib/java/util/Collections$SynchronizedSortedSet.class
new file mode 100644
index 00000000000..e8b69fcf7aa
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$SynchronizedSortedSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$UnmodifiableCollection.class b/libjava/classpath/lib/java/util/Collections$UnmodifiableCollection.class
new file mode 100644
index 00000000000..b6a9ec47fea
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$UnmodifiableCollection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$UnmodifiableIterator.class b/libjava/classpath/lib/java/util/Collections$UnmodifiableIterator.class
new file mode 100644
index 00000000000..43eadbaf8eb
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$UnmodifiableIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$UnmodifiableList.class b/libjava/classpath/lib/java/util/Collections$UnmodifiableList.class
new file mode 100644
index 00000000000..5d76cd2ee03
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$UnmodifiableList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$UnmodifiableListIterator.class b/libjava/classpath/lib/java/util/Collections$UnmodifiableListIterator.class
new file mode 100644
index 00000000000..1795dcca995
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$UnmodifiableListIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableMapEntry.class b/libjava/classpath/lib/java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableMapEntry.class
new file mode 100644
index 00000000000..58db3dbd71d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableMapEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet.class b/libjava/classpath/lib/java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet.class
new file mode 100644
index 00000000000..4b9f103aecf
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$UnmodifiableMap.class b/libjava/classpath/lib/java/util/Collections$UnmodifiableMap.class
new file mode 100644
index 00000000000..e6b60056ed0
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$UnmodifiableMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$UnmodifiableRandomAccessList.class b/libjava/classpath/lib/java/util/Collections$UnmodifiableRandomAccessList.class
new file mode 100644
index 00000000000..0563ff3cdaa
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$UnmodifiableRandomAccessList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$UnmodifiableSet.class b/libjava/classpath/lib/java/util/Collections$UnmodifiableSet.class
new file mode 100644
index 00000000000..caf7d34c937
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$UnmodifiableSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$UnmodifiableSortedMap.class b/libjava/classpath/lib/java/util/Collections$UnmodifiableSortedMap.class
new file mode 100644
index 00000000000..75d4635b80a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$UnmodifiableSortedMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections$UnmodifiableSortedSet.class b/libjava/classpath/lib/java/util/Collections$UnmodifiableSortedSet.class
new file mode 100644
index 00000000000..d4c72daa5a7
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections$UnmodifiableSortedSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Collections.class b/libjava/classpath/lib/java/util/Collections.class
new file mode 100644
index 00000000000..9572ce591b0
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Collections.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Comparator.class b/libjava/classpath/lib/java/util/Comparator.class
new file mode 100644
index 00000000000..383c9ce2499
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Comparator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/ConcurrentModificationException.class b/libjava/classpath/lib/java/util/ConcurrentModificationException.class
new file mode 100644
index 00000000000..af324dcdc8f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/ConcurrentModificationException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Currency.class b/libjava/classpath/lib/java/util/Currency.class
new file mode 100644
index 00000000000..147415ca1e9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Currency.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Date.class b/libjava/classpath/lib/java/util/Date.class
new file mode 100644
index 00000000000..2ff812bb8b1
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Date.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Deque.class b/libjava/classpath/lib/java/util/Deque.class
new file mode 100644
index 00000000000..f45e3eff305
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Deque.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Dictionary.class b/libjava/classpath/lib/java/util/Dictionary.class
new file mode 100644
index 00000000000..1f57252efd2
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Dictionary.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/DuplicateFormatFlagsException.class b/libjava/classpath/lib/java/util/DuplicateFormatFlagsException.class
new file mode 100644
index 00000000000..9387ef70d49
--- /dev/null
+++ b/libjava/classpath/lib/java/util/DuplicateFormatFlagsException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/EmptyStackException.class b/libjava/classpath/lib/java/util/EmptyStackException.class
new file mode 100644
index 00000000000..4169a8be330
--- /dev/null
+++ b/libjava/classpath/lib/java/util/EmptyStackException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/EnumMap$1.class b/libjava/classpath/lib/java/util/EnumMap$1.class
new file mode 100644
index 00000000000..c544880ffd7
--- /dev/null
+++ b/libjava/classpath/lib/java/util/EnumMap$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/EnumMap$2.class b/libjava/classpath/lib/java/util/EnumMap$2.class
new file mode 100644
index 00000000000..048e6c3bc00
--- /dev/null
+++ b/libjava/classpath/lib/java/util/EnumMap$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/EnumMap$3.class b/libjava/classpath/lib/java/util/EnumMap$3.class
new file mode 100644
index 00000000000..d4b4b6f8cc0
--- /dev/null
+++ b/libjava/classpath/lib/java/util/EnumMap$3.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/EnumMap$4.class b/libjava/classpath/lib/java/util/EnumMap$4.class
new file mode 100644
index 00000000000..01952a957f5
--- /dev/null
+++ b/libjava/classpath/lib/java/util/EnumMap$4.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/EnumMap$5.class b/libjava/classpath/lib/java/util/EnumMap$5.class
new file mode 100644
index 00000000000..216c7a62c6a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/EnumMap$5.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/EnumMap$6.class b/libjava/classpath/lib/java/util/EnumMap$6.class
new file mode 100644
index 00000000000..a57a5d4a457
--- /dev/null
+++ b/libjava/classpath/lib/java/util/EnumMap$6.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/EnumMap$7.class b/libjava/classpath/lib/java/util/EnumMap$7.class
new file mode 100644
index 00000000000..eaf8913e466
--- /dev/null
+++ b/libjava/classpath/lib/java/util/EnumMap$7.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/EnumMap.class b/libjava/classpath/lib/java/util/EnumMap.class
new file mode 100644
index 00000000000..d345b6baaf3
--- /dev/null
+++ b/libjava/classpath/lib/java/util/EnumMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/EnumSet$1.class b/libjava/classpath/lib/java/util/EnumSet$1.class
new file mode 100644
index 00000000000..750d7200ced
--- /dev/null
+++ b/libjava/classpath/lib/java/util/EnumSet$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/EnumSet.class b/libjava/classpath/lib/java/util/EnumSet.class
new file mode 100644
index 00000000000..b3a728b8191
--- /dev/null
+++ b/libjava/classpath/lib/java/util/EnumSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Enumeration.class b/libjava/classpath/lib/java/util/Enumeration.class
new file mode 100644
index 00000000000..5791585d193
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Enumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/EventListener.class b/libjava/classpath/lib/java/util/EventListener.class
new file mode 100644
index 00000000000..23dbfb8c861
--- /dev/null
+++ b/libjava/classpath/lib/java/util/EventListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/EventListenerProxy.class b/libjava/classpath/lib/java/util/EventListenerProxy.class
new file mode 100644
index 00000000000..fb3eaead1c1
--- /dev/null
+++ b/libjava/classpath/lib/java/util/EventListenerProxy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/EventObject.class b/libjava/classpath/lib/java/util/EventObject.class
new file mode 100644
index 00000000000..0e97ead8287
--- /dev/null
+++ b/libjava/classpath/lib/java/util/EventObject.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/FormatFlagsConversionMismatchException.class b/libjava/classpath/lib/java/util/FormatFlagsConversionMismatchException.class
new file mode 100644
index 00000000000..fac05d4ead8
--- /dev/null
+++ b/libjava/classpath/lib/java/util/FormatFlagsConversionMismatchException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Formattable.class b/libjava/classpath/lib/java/util/Formattable.class
new file mode 100644
index 00000000000..ad80eaf3b65
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Formattable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/FormattableFlags.class b/libjava/classpath/lib/java/util/FormattableFlags.class
new file mode 100644
index 00000000000..a19cd5d6106
--- /dev/null
+++ b/libjava/classpath/lib/java/util/FormattableFlags.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Formatter$BigDecimalLayoutForm.class b/libjava/classpath/lib/java/util/Formatter$BigDecimalLayoutForm.class
new file mode 100644
index 00000000000..d8cb5810412
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Formatter$BigDecimalLayoutForm.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Formatter.class b/libjava/classpath/lib/java/util/Formatter.class
new file mode 100644
index 00000000000..44bda981046
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Formatter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/FormatterClosedException.class b/libjava/classpath/lib/java/util/FormatterClosedException.class
new file mode 100644
index 00000000000..1de6d1bbb22
--- /dev/null
+++ b/libjava/classpath/lib/java/util/FormatterClosedException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/GregorianCalendar.class b/libjava/classpath/lib/java/util/GregorianCalendar.class
new file mode 100644
index 00000000000..00022634a16
--- /dev/null
+++ b/libjava/classpath/lib/java/util/GregorianCalendar.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/HashMap$1.class b/libjava/classpath/lib/java/util/HashMap$1.class
new file mode 100644
index 00000000000..cb5fe463ad8
--- /dev/null
+++ b/libjava/classpath/lib/java/util/HashMap$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/HashMap$2.class b/libjava/classpath/lib/java/util/HashMap$2.class
new file mode 100644
index 00000000000..663a1352804
--- /dev/null
+++ b/libjava/classpath/lib/java/util/HashMap$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/HashMap$3.class b/libjava/classpath/lib/java/util/HashMap$3.class
new file mode 100644
index 00000000000..9129a0cd9d3
--- /dev/null
+++ b/libjava/classpath/lib/java/util/HashMap$3.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/HashMap$HashEntry.class b/libjava/classpath/lib/java/util/HashMap$HashEntry.class
new file mode 100644
index 00000000000..4890b63dd5b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/HashMap$HashEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/HashMap$HashIterator.class b/libjava/classpath/lib/java/util/HashMap$HashIterator.class
new file mode 100644
index 00000000000..26b8b695958
--- /dev/null
+++ b/libjava/classpath/lib/java/util/HashMap$HashIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/HashMap.class b/libjava/classpath/lib/java/util/HashMap.class
new file mode 100644
index 00000000000..9b0dd1c02dc
--- /dev/null
+++ b/libjava/classpath/lib/java/util/HashMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/HashSet.class b/libjava/classpath/lib/java/util/HashSet.class
new file mode 100644
index 00000000000..dc57e6058c3
--- /dev/null
+++ b/libjava/classpath/lib/java/util/HashSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Hashtable$1.class b/libjava/classpath/lib/java/util/Hashtable$1.class
new file mode 100644
index 00000000000..ba860884126
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Hashtable$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Hashtable$2.class b/libjava/classpath/lib/java/util/Hashtable$2.class
new file mode 100644
index 00000000000..bc131702c8c
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Hashtable$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Hashtable$3.class b/libjava/classpath/lib/java/util/Hashtable$3.class
new file mode 100644
index 00000000000..d8eaac5cecb
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Hashtable$3.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Hashtable$EntryEnumerator.class b/libjava/classpath/lib/java/util/Hashtable$EntryEnumerator.class
new file mode 100644
index 00000000000..2a725d7b00b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Hashtable$EntryEnumerator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Hashtable$EntryIterator.class b/libjava/classpath/lib/java/util/Hashtable$EntryIterator.class
new file mode 100644
index 00000000000..dc026b72ecb
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Hashtable$EntryIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Hashtable$HashEntry.class b/libjava/classpath/lib/java/util/Hashtable$HashEntry.class
new file mode 100644
index 00000000000..a189fc772ef
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Hashtable$HashEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Hashtable$KeyEnumerator.class b/libjava/classpath/lib/java/util/Hashtable$KeyEnumerator.class
new file mode 100644
index 00000000000..06640f181cb
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Hashtable$KeyEnumerator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Hashtable$KeyIterator.class b/libjava/classpath/lib/java/util/Hashtable$KeyIterator.class
new file mode 100644
index 00000000000..eb6773b7ee9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Hashtable$KeyIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Hashtable$ValueEnumerator.class b/libjava/classpath/lib/java/util/Hashtable$ValueEnumerator.class
new file mode 100644
index 00000000000..053860b29c9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Hashtable$ValueEnumerator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Hashtable$ValueIterator.class b/libjava/classpath/lib/java/util/Hashtable$ValueIterator.class
new file mode 100644
index 00000000000..234afd5b349
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Hashtable$ValueIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Hashtable.class b/libjava/classpath/lib/java/util/Hashtable.class
new file mode 100644
index 00000000000..2bc8ff66345
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Hashtable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/IdentityHashMap$1.class b/libjava/classpath/lib/java/util/IdentityHashMap$1.class
new file mode 100644
index 00000000000..ce61a897032
--- /dev/null
+++ b/libjava/classpath/lib/java/util/IdentityHashMap$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/IdentityHashMap$2.class b/libjava/classpath/lib/java/util/IdentityHashMap$2.class
new file mode 100644
index 00000000000..602c07c705c
--- /dev/null
+++ b/libjava/classpath/lib/java/util/IdentityHashMap$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/IdentityHashMap$3.class b/libjava/classpath/lib/java/util/IdentityHashMap$3.class
new file mode 100644
index 00000000000..bf9677531e1
--- /dev/null
+++ b/libjava/classpath/lib/java/util/IdentityHashMap$3.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/IdentityHashMap$IdentityEntry.class b/libjava/classpath/lib/java/util/IdentityHashMap$IdentityEntry.class
new file mode 100644
index 00000000000..55da9bb65bc
--- /dev/null
+++ b/libjava/classpath/lib/java/util/IdentityHashMap$IdentityEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/IdentityHashMap$IdentityIterator.class b/libjava/classpath/lib/java/util/IdentityHashMap$IdentityIterator.class
new file mode 100644
index 00000000000..94ce525e316
--- /dev/null
+++ b/libjava/classpath/lib/java/util/IdentityHashMap$IdentityIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/IdentityHashMap.class b/libjava/classpath/lib/java/util/IdentityHashMap.class
new file mode 100644
index 00000000000..cbcbfd8395c
--- /dev/null
+++ b/libjava/classpath/lib/java/util/IdentityHashMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/IllegalFormatCodePointException.class b/libjava/classpath/lib/java/util/IllegalFormatCodePointException.class
new file mode 100644
index 00000000000..da60018aff4
--- /dev/null
+++ b/libjava/classpath/lib/java/util/IllegalFormatCodePointException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/IllegalFormatConversionException.class b/libjava/classpath/lib/java/util/IllegalFormatConversionException.class
new file mode 100644
index 00000000000..360e8833a62
--- /dev/null
+++ b/libjava/classpath/lib/java/util/IllegalFormatConversionException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/IllegalFormatException.class b/libjava/classpath/lib/java/util/IllegalFormatException.class
new file mode 100644
index 00000000000..31d0c040f41
--- /dev/null
+++ b/libjava/classpath/lib/java/util/IllegalFormatException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/IllegalFormatFlagsException.class b/libjava/classpath/lib/java/util/IllegalFormatFlagsException.class
new file mode 100644
index 00000000000..e00e72df7ac
--- /dev/null
+++ b/libjava/classpath/lib/java/util/IllegalFormatFlagsException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/IllegalFormatPrecisionException.class b/libjava/classpath/lib/java/util/IllegalFormatPrecisionException.class
new file mode 100644
index 00000000000..262d90434d8
--- /dev/null
+++ b/libjava/classpath/lib/java/util/IllegalFormatPrecisionException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/IllegalFormatWidthException.class b/libjava/classpath/lib/java/util/IllegalFormatWidthException.class
new file mode 100644
index 00000000000..9c5edc893ed
--- /dev/null
+++ b/libjava/classpath/lib/java/util/IllegalFormatWidthException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/InputMismatchException.class b/libjava/classpath/lib/java/util/InputMismatchException.class
new file mode 100644
index 00000000000..907991adeee
--- /dev/null
+++ b/libjava/classpath/lib/java/util/InputMismatchException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/InvalidPropertiesFormatException.class b/libjava/classpath/lib/java/util/InvalidPropertiesFormatException.class
new file mode 100644
index 00000000000..54d6c7ee9d7
--- /dev/null
+++ b/libjava/classpath/lib/java/util/InvalidPropertiesFormatException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Iterator.class b/libjava/classpath/lib/java/util/Iterator.class
new file mode 100644
index 00000000000..968d125f413
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Iterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/LinkedHashMap$1.class b/libjava/classpath/lib/java/util/LinkedHashMap$1.class
new file mode 100644
index 00000000000..4236600ebf1
--- /dev/null
+++ b/libjava/classpath/lib/java/util/LinkedHashMap$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/LinkedHashMap$LinkedHashEntry.class b/libjava/classpath/lib/java/util/LinkedHashMap$LinkedHashEntry.class
new file mode 100644
index 00000000000..2cc9b02751f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/LinkedHashMap$LinkedHashEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/LinkedHashMap.class b/libjava/classpath/lib/java/util/LinkedHashMap.class
new file mode 100644
index 00000000000..a0fa4813702
--- /dev/null
+++ b/libjava/classpath/lib/java/util/LinkedHashMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/LinkedHashSet.class b/libjava/classpath/lib/java/util/LinkedHashSet.class
new file mode 100644
index 00000000000..4e1e3335d6e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/LinkedHashSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/LinkedList$Entry.class b/libjava/classpath/lib/java/util/LinkedList$Entry.class
new file mode 100644
index 00000000000..8ba88eac5e1
--- /dev/null
+++ b/libjava/classpath/lib/java/util/LinkedList$Entry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/LinkedList$LinkedListItr.class b/libjava/classpath/lib/java/util/LinkedList$LinkedListItr.class
new file mode 100644
index 00000000000..2ae4fd4146d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/LinkedList$LinkedListItr.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/LinkedList.class b/libjava/classpath/lib/java/util/LinkedList.class
new file mode 100644
index 00000000000..cf4b687bcbc
--- /dev/null
+++ b/libjava/classpath/lib/java/util/LinkedList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/List.class b/libjava/classpath/lib/java/util/List.class
new file mode 100644
index 00000000000..e7628961dac
--- /dev/null
+++ b/libjava/classpath/lib/java/util/List.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/ListIterator.class b/libjava/classpath/lib/java/util/ListIterator.class
new file mode 100644
index 00000000000..8b0be20e25f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/ListIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/ListResourceBundle.class b/libjava/classpath/lib/java/util/ListResourceBundle.class
new file mode 100644
index 00000000000..dbb833eb69d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/ListResourceBundle.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Locale.class b/libjava/classpath/lib/java/util/Locale.class
new file mode 100644
index 00000000000..a095ba8e211
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Locale.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Map$Entry.class b/libjava/classpath/lib/java/util/Map$Entry.class
new file mode 100644
index 00000000000..c2abbac57e4
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Map$Entry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Map.class b/libjava/classpath/lib/java/util/Map.class
new file mode 100644
index 00000000000..27285a3f2b8
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Map.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/MissingFormatArgumentException.class b/libjava/classpath/lib/java/util/MissingFormatArgumentException.class
new file mode 100644
index 00000000000..94bf0670981
--- /dev/null
+++ b/libjava/classpath/lib/java/util/MissingFormatArgumentException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/MissingFormatWidthException.class b/libjava/classpath/lib/java/util/MissingFormatWidthException.class
new file mode 100644
index 00000000000..6d292cfea81
--- /dev/null
+++ b/libjava/classpath/lib/java/util/MissingFormatWidthException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/MissingResourceException.class b/libjava/classpath/lib/java/util/MissingResourceException.class
new file mode 100644
index 00000000000..a8e0e27a915
--- /dev/null
+++ b/libjava/classpath/lib/java/util/MissingResourceException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/NavigableMap.class b/libjava/classpath/lib/java/util/NavigableMap.class
new file mode 100644
index 00000000000..68c6a269e4f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/NavigableMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/NavigableSet.class b/libjava/classpath/lib/java/util/NavigableSet.class
new file mode 100644
index 00000000000..72a65c50a60
--- /dev/null
+++ b/libjava/classpath/lib/java/util/NavigableSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/NoSuchElementException.class b/libjava/classpath/lib/java/util/NoSuchElementException.class
new file mode 100644
index 00000000000..79dae1aadd8
--- /dev/null
+++ b/libjava/classpath/lib/java/util/NoSuchElementException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Observable.class b/libjava/classpath/lib/java/util/Observable.class
new file mode 100644
index 00000000000..7987b00421e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Observable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Observer.class b/libjava/classpath/lib/java/util/Observer.class
new file mode 100644
index 00000000000..0ed0f59caaa
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Observer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/PriorityQueue$1.class b/libjava/classpath/lib/java/util/PriorityQueue$1.class
new file mode 100644
index 00000000000..3fe7f98518a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/PriorityQueue$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/PriorityQueue.class b/libjava/classpath/lib/java/util/PriorityQueue.class
new file mode 100644
index 00000000000..7ec78c17297
--- /dev/null
+++ b/libjava/classpath/lib/java/util/PriorityQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Properties.class b/libjava/classpath/lib/java/util/Properties.class
new file mode 100644
index 00000000000..708973306ae
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Properties.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/PropertyPermission.class b/libjava/classpath/lib/java/util/PropertyPermission.class
new file mode 100644
index 00000000000..ca564617da9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/PropertyPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/PropertyPermissionCollection.class b/libjava/classpath/lib/java/util/PropertyPermissionCollection.class
new file mode 100644
index 00000000000..10123c26b52
--- /dev/null
+++ b/libjava/classpath/lib/java/util/PropertyPermissionCollection.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/PropertyResourceBundle.class b/libjava/classpath/lib/java/util/PropertyResourceBundle.class
new file mode 100644
index 00000000000..f47155d1ceb
--- /dev/null
+++ b/libjava/classpath/lib/java/util/PropertyResourceBundle.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Queue.class b/libjava/classpath/lib/java/util/Queue.class
new file mode 100644
index 00000000000..37f4e93fc61
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Queue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Random.class b/libjava/classpath/lib/java/util/Random.class
new file mode 100644
index 00000000000..9af54208312
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Random.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/RandomAccess.class b/libjava/classpath/lib/java/util/RandomAccess.class
new file mode 100644
index 00000000000..bba9b034d59
--- /dev/null
+++ b/libjava/classpath/lib/java/util/RandomAccess.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/ResourceBundle$1.class b/libjava/classpath/lib/java/util/ResourceBundle$1.class
new file mode 100644
index 00000000000..3dda2d717f9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/ResourceBundle$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/ResourceBundle$BundleKey.class b/libjava/classpath/lib/java/util/ResourceBundle$BundleKey.class
new file mode 100644
index 00000000000..db9c41cc3fd
--- /dev/null
+++ b/libjava/classpath/lib/java/util/ResourceBundle$BundleKey.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/ResourceBundle.class b/libjava/classpath/lib/java/util/ResourceBundle.class
new file mode 100644
index 00000000000..e78dd748d3a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/ResourceBundle.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Set.class b/libjava/classpath/lib/java/util/Set.class
new file mode 100644
index 00000000000..3a26c1fd40c
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Set.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/SimpleTimeZone.class b/libjava/classpath/lib/java/util/SimpleTimeZone.class
new file mode 100644
index 00000000000..7009b48ce9b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/SimpleTimeZone.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/SortedMap.class b/libjava/classpath/lib/java/util/SortedMap.class
new file mode 100644
index 00000000000..2421a067517
--- /dev/null
+++ b/libjava/classpath/lib/java/util/SortedMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/SortedSet.class b/libjava/classpath/lib/java/util/SortedSet.class
new file mode 100644
index 00000000000..6cb2646e0d1
--- /dev/null
+++ b/libjava/classpath/lib/java/util/SortedSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Stack.class b/libjava/classpath/lib/java/util/Stack.class
new file mode 100644
index 00000000000..9f511234476
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Stack.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/StringTokenizer.class b/libjava/classpath/lib/java/util/StringTokenizer.class
new file mode 100644
index 00000000000..d68abe7072e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/StringTokenizer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TimeZone$1.class b/libjava/classpath/lib/java/util/TimeZone$1.class
new file mode 100644
index 00000000000..fdc1c6149b5
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TimeZone$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TimeZone.class b/libjava/classpath/lib/java/util/TimeZone.class
new file mode 100644
index 00000000000..b319aa78861
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TimeZone.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Timer$Scheduler.class b/libjava/classpath/lib/java/util/Timer$Scheduler.class
new file mode 100644
index 00000000000..2a108b55ba4
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Timer$Scheduler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Timer$TaskQueue.class b/libjava/classpath/lib/java/util/Timer$TaskQueue.class
new file mode 100644
index 00000000000..9d1786b483a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Timer$TaskQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Timer.class b/libjava/classpath/lib/java/util/Timer.class
new file mode 100644
index 00000000000..00be67abe8e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Timer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TimerTask.class b/libjava/classpath/lib/java/util/TimerTask.class
new file mode 100644
index 00000000000..879170e4ab9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TimerTask.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TooManyListenersException.class b/libjava/classpath/lib/java/util/TooManyListenersException.class
new file mode 100644
index 00000000000..c09c5948d55
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TooManyListenersException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TreeMap$1.class b/libjava/classpath/lib/java/util/TreeMap$1.class
new file mode 100644
index 00000000000..7b987c3f13a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TreeMap$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TreeMap$2.class b/libjava/classpath/lib/java/util/TreeMap$2.class
new file mode 100644
index 00000000000..33e2fe776ab
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TreeMap$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TreeMap$3.class b/libjava/classpath/lib/java/util/TreeMap$3.class
new file mode 100644
index 00000000000..bb58f20661b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TreeMap$3.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TreeMap$4.class b/libjava/classpath/lib/java/util/TreeMap$4.class
new file mode 100644
index 00000000000..eb51c9a5e24
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TreeMap$4.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TreeMap$5.class b/libjava/classpath/lib/java/util/TreeMap$5.class
new file mode 100644
index 00000000000..6fb5ff26535
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TreeMap$5.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TreeMap$6.class b/libjava/classpath/lib/java/util/TreeMap$6.class
new file mode 100644
index 00000000000..40db18b2c16
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TreeMap$6.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TreeMap$Node.class b/libjava/classpath/lib/java/util/TreeMap$Node.class
new file mode 100644
index 00000000000..ac2641db35b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TreeMap$Node.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TreeMap$SubMap.class b/libjava/classpath/lib/java/util/TreeMap$SubMap.class
new file mode 100644
index 00000000000..a50e686d5e4
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TreeMap$SubMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TreeMap$TreeIterator.class b/libjava/classpath/lib/java/util/TreeMap$TreeIterator.class
new file mode 100644
index 00000000000..34a4d3998dd
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TreeMap$TreeIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TreeMap.class b/libjava/classpath/lib/java/util/TreeMap.class
new file mode 100644
index 00000000000..b7200153556
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TreeMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/TreeSet.class b/libjava/classpath/lib/java/util/TreeSet.class
new file mode 100644
index 00000000000..4ee139a625b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/TreeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/UUID.class b/libjava/classpath/lib/java/util/UUID.class
new file mode 100644
index 00000000000..3dd44c7a07b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/UUID.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/UnknownFormatConversionException.class b/libjava/classpath/lib/java/util/UnknownFormatConversionException.class
new file mode 100644
index 00000000000..5ed847ab2fb
--- /dev/null
+++ b/libjava/classpath/lib/java/util/UnknownFormatConversionException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/UnknownFormatFlagsException.class b/libjava/classpath/lib/java/util/UnknownFormatFlagsException.class
new file mode 100644
index 00000000000..03a94ece9e7
--- /dev/null
+++ b/libjava/classpath/lib/java/util/UnknownFormatFlagsException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/VMTimeZone.class b/libjava/classpath/lib/java/util/VMTimeZone.class
new file mode 100644
index 00000000000..351461d5ab7
--- /dev/null
+++ b/libjava/classpath/lib/java/util/VMTimeZone.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Vector$1.class b/libjava/classpath/lib/java/util/Vector$1.class
new file mode 100644
index 00000000000..28cbc58120f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Vector$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/Vector.class b/libjava/classpath/lib/java/util/Vector.class
new file mode 100644
index 00000000000..7fd06aeb7ba
--- /dev/null
+++ b/libjava/classpath/lib/java/util/Vector.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/WeakHashMap$1.class b/libjava/classpath/lib/java/util/WeakHashMap$1.class
new file mode 100644
index 00000000000..cc3e25f4183
--- /dev/null
+++ b/libjava/classpath/lib/java/util/WeakHashMap$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/WeakHashMap$2.class b/libjava/classpath/lib/java/util/WeakHashMap$2.class
new file mode 100644
index 00000000000..8690612995f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/WeakHashMap$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/WeakHashMap$WeakBucket$WeakEntry.class b/libjava/classpath/lib/java/util/WeakHashMap$WeakBucket$WeakEntry.class
new file mode 100644
index 00000000000..4d676465744
--- /dev/null
+++ b/libjava/classpath/lib/java/util/WeakHashMap$WeakBucket$WeakEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/WeakHashMap$WeakBucket.class b/libjava/classpath/lib/java/util/WeakHashMap$WeakBucket.class
new file mode 100644
index 00000000000..fb4a59c3a89
--- /dev/null
+++ b/libjava/classpath/lib/java/util/WeakHashMap$WeakBucket.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/WeakHashMap$WeakEntrySet.class b/libjava/classpath/lib/java/util/WeakHashMap$WeakEntrySet.class
new file mode 100644
index 00000000000..8cc0ada10db
--- /dev/null
+++ b/libjava/classpath/lib/java/util/WeakHashMap$WeakEntrySet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/WeakHashMap.class b/libjava/classpath/lib/java/util/WeakHashMap.class
new file mode 100644
index 00000000000..5f7f75bda70
--- /dev/null
+++ b/libjava/classpath/lib/java/util/WeakHashMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/AbstractExecutorService.class b/libjava/classpath/lib/java/util/concurrent/AbstractExecutorService.class
new file mode 100644
index 00000000000..a69ed7f1802
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/AbstractExecutorService.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ArrayBlockingQueue$Itr.class b/libjava/classpath/lib/java/util/concurrent/ArrayBlockingQueue$Itr.class
new file mode 100644
index 00000000000..34448ad781f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ArrayBlockingQueue$Itr.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ArrayBlockingQueue.class b/libjava/classpath/lib/java/util/concurrent/ArrayBlockingQueue.class
new file mode 100644
index 00000000000..4e9a1fccaa5
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ArrayBlockingQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/BlockingDeque.class b/libjava/classpath/lib/java/util/concurrent/BlockingDeque.class
new file mode 100644
index 00000000000..35619689722
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/BlockingDeque.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/BlockingQueue.class b/libjava/classpath/lib/java/util/concurrent/BlockingQueue.class
new file mode 100644
index 00000000000..338b6ea0692
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/BlockingQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/BrokenBarrierException.class b/libjava/classpath/lib/java/util/concurrent/BrokenBarrierException.class
new file mode 100644
index 00000000000..136818101df
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/BrokenBarrierException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Callable.class b/libjava/classpath/lib/java/util/concurrent/Callable.class
new file mode 100644
index 00000000000..26e4dc2b1d5
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Callable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/CancellationException.class b/libjava/classpath/lib/java/util/concurrent/CancellationException.class
new file mode 100644
index 00000000000..93b8b04e070
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/CancellationException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/CompletionService.class b/libjava/classpath/lib/java/util/concurrent/CompletionService.class
new file mode 100644
index 00000000000..bcce3cc7230
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/CompletionService.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$EntryIterator.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$EntryIterator.class
new file mode 100644
index 00000000000..94d83ba4fda
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$EntryIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$EntrySet.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$EntrySet.class
new file mode 100644
index 00000000000..f664cb31a98
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$EntrySet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$HashEntry.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$HashEntry.class
new file mode 100644
index 00000000000..008edb97cc0
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$HashEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$HashIterator.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$HashIterator.class
new file mode 100644
index 00000000000..f839fe1e943
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$HashIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$KeyIterator.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$KeyIterator.class
new file mode 100644
index 00000000000..930b0c4803e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$KeyIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$KeySet.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$KeySet.class
new file mode 100644
index 00000000000..48d0d953fa8
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$KeySet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$Segment.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$Segment.class
new file mode 100644
index 00000000000..72ce7d378ff
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$Segment.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$ValueIterator.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$ValueIterator.class
new file mode 100644
index 00000000000..9a1193be9c2
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$ValueIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$Values.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$Values.class
new file mode 100644
index 00000000000..8342fe8ac70
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$Values.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$WriteThroughEntry.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$WriteThroughEntry.class
new file mode 100644
index 00000000000..f173a6a1104
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap$WriteThroughEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap.class
new file mode 100644
index 00000000000..4bae5273d71
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentHashMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentLinkedQueue$Itr.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentLinkedQueue$Itr.class
new file mode 100644
index 00000000000..7bac7bf4c33
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentLinkedQueue$Itr.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentLinkedQueue$Node.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentLinkedQueue$Node.class
new file mode 100644
index 00000000000..44fca278cae
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentLinkedQueue$Node.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentLinkedQueue.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentLinkedQueue.class
new file mode 100644
index 00000000000..1333e0fa891
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentLinkedQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentMap.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentMap.class
new file mode 100644
index 00000000000..5159f3ebc5e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentNavigableMap.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentNavigableMap.class
new file mode 100644
index 00000000000..3df542cdf20
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentNavigableMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$ComparableUsingComparator.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$ComparableUsingComparator.class
new file mode 100644
index 00000000000..bd1678b24c6
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$ComparableUsingComparator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$EntryIterator.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$EntryIterator.class
new file mode 100644
index 00000000000..127267ceda4
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$EntryIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$EntrySet.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$EntrySet.class
new file mode 100644
index 00000000000..ddd5e390895
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$EntrySet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$HeadIndex.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$HeadIndex.class
new file mode 100644
index 00000000000..6a7317f4f43
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$HeadIndex.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Index.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Index.class
new file mode 100644
index 00000000000..131f1521ce1
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Index.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Iter.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Iter.class
new file mode 100644
index 00000000000..ff829b70c02
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Iter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$KeyIterator.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$KeyIterator.class
new file mode 100644
index 00000000000..3a681f758c4
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$KeyIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$KeySet.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$KeySet.class
new file mode 100644
index 00000000000..45ec44cd570
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$KeySet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Node.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Node.class
new file mode 100644
index 00000000000..7932e012edd
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Node.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapEntryIterator.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapEntryIterator.class
new file mode 100644
index 00000000000..d822acfb7e5
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapEntryIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapIter.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapIter.class
new file mode 100644
index 00000000000..f8029d104b0
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapIter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapKeyIterator.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapKeyIterator.class
new file mode 100644
index 00000000000..167f856d393
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapKeyIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapValueIterator.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapValueIterator.class
new file mode 100644
index 00000000000..6f4fe850850
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap$SubMapValueIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap.class
new file mode 100644
index 00000000000..0df084c891e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$SubMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$ValueIterator.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$ValueIterator.class
new file mode 100644
index 00000000000..090424a6d7f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$ValueIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Values.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Values.class
new file mode 100644
index 00000000000..c41c1364338
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap$Values.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap.class
new file mode 100644
index 00000000000..0f97e2d1949
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListMap.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListSet.class b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListSet.class
new file mode 100644
index 00000000000..0d0436c2e3a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ConcurrentSkipListSet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList.class b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList.class
new file mode 100644
index 00000000000..872141fd91e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArrayList.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArraySet.class b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArraySet.class
new file mode 100644
index 00000000000..39a19098a5e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/CopyOnWriteArraySet.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/CountDownLatch$Sync.class b/libjava/classpath/lib/java/util/concurrent/CountDownLatch$Sync.class
new file mode 100644
index 00000000000..3361dcf06e5
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/CountDownLatch$Sync.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/CountDownLatch.class b/libjava/classpath/lib/java/util/concurrent/CountDownLatch.class
new file mode 100644
index 00000000000..c53b629526d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/CountDownLatch.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/CyclicBarrier$Generation.class b/libjava/classpath/lib/java/util/concurrent/CyclicBarrier$Generation.class
new file mode 100644
index 00000000000..79eba5bda57
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/CyclicBarrier$Generation.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/CyclicBarrier.class b/libjava/classpath/lib/java/util/concurrent/CyclicBarrier.class
new file mode 100644
index 00000000000..1d696dac898
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/CyclicBarrier.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/DelayQueue$Itr.class b/libjava/classpath/lib/java/util/concurrent/DelayQueue$Itr.class
new file mode 100644
index 00000000000..69cc1be2720
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/DelayQueue$Itr.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/DelayQueue.class b/libjava/classpath/lib/java/util/concurrent/DelayQueue.class
new file mode 100644
index 00000000000..1cde5a1ebd9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/DelayQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Delayed.class b/libjava/classpath/lib/java/util/concurrent/Delayed.class
new file mode 100644
index 00000000000..b0d8f02946b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Delayed.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Exchanger$Node.class b/libjava/classpath/lib/java/util/concurrent/Exchanger$Node.class
new file mode 100644
index 00000000000..9a09064198d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Exchanger$Node.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Exchanger$Slot.class b/libjava/classpath/lib/java/util/concurrent/Exchanger$Slot.class
new file mode 100644
index 00000000000..3cad8cba03a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Exchanger$Slot.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Exchanger.class b/libjava/classpath/lib/java/util/concurrent/Exchanger.class
new file mode 100644
index 00000000000..b09da8fe292
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Exchanger.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ExecutionException.class b/libjava/classpath/lib/java/util/concurrent/ExecutionException.class
new file mode 100644
index 00000000000..2e96d9e1f3e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ExecutionException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executor.class b/libjava/classpath/lib/java/util/concurrent/Executor.class
new file mode 100644
index 00000000000..1825342ee4b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ExecutorCompletionService$QueueingFuture.class b/libjava/classpath/lib/java/util/concurrent/ExecutorCompletionService$QueueingFuture.class
new file mode 100644
index 00000000000..ff161bcf09d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ExecutorCompletionService$QueueingFuture.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ExecutorCompletionService.class b/libjava/classpath/lib/java/util/concurrent/ExecutorCompletionService.class
new file mode 100644
index 00000000000..29a85f23714
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ExecutorCompletionService.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ExecutorService.class b/libjava/classpath/lib/java/util/concurrent/ExecutorService.class
new file mode 100644
index 00000000000..715688e7c2c
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ExecutorService.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors$1.class b/libjava/classpath/lib/java/util/concurrent/Executors$1.class
new file mode 100644
index 00000000000..160a59976c5
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors$2.class b/libjava/classpath/lib/java/util/concurrent/Executors$2.class
new file mode 100644
index 00000000000..1ba9e058c66
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors$3.class b/libjava/classpath/lib/java/util/concurrent/Executors$3.class
new file mode 100644
index 00000000000..ac883943174
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors$3.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors$4.class b/libjava/classpath/lib/java/util/concurrent/Executors$4.class
new file mode 100644
index 00000000000..3710ff4a51d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors$4.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors$5.class b/libjava/classpath/lib/java/util/concurrent/Executors$5.class
new file mode 100644
index 00000000000..0e68c05ebeb
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors$5.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors$6.class b/libjava/classpath/lib/java/util/concurrent/Executors$6.class
new file mode 100644
index 00000000000..513629eaf2d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors$6.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors$DefaultThreadFactory.class b/libjava/classpath/lib/java/util/concurrent/Executors$DefaultThreadFactory.class
new file mode 100644
index 00000000000..bdd1e9d6207
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors$DefaultThreadFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors$DelegatedExecutorService.class b/libjava/classpath/lib/java/util/concurrent/Executors$DelegatedExecutorService.class
new file mode 100644
index 00000000000..9e1743058a9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors$DelegatedExecutorService.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors$DelegatedScheduledExecutorService.class b/libjava/classpath/lib/java/util/concurrent/Executors$DelegatedScheduledExecutorService.class
new file mode 100644
index 00000000000..df0646e8f91
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors$DelegatedScheduledExecutorService.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors$FinalizableDelegatedExecutorService.class b/libjava/classpath/lib/java/util/concurrent/Executors$FinalizableDelegatedExecutorService.class
new file mode 100644
index 00000000000..25c94828b63
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors$FinalizableDelegatedExecutorService.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors$PrivilegedCallable.class b/libjava/classpath/lib/java/util/concurrent/Executors$PrivilegedCallable.class
new file mode 100644
index 00000000000..4493b4361b2
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors$PrivilegedCallable.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors$PrivilegedCallableUsingCurrentClassLoader.class b/libjava/classpath/lib/java/util/concurrent/Executors$PrivilegedCallableUsingCurrentClassLoader.class
new file mode 100644
index 00000000000..9fb1beeae7d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors$PrivilegedCallableUsingCurrentClassLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors$PrivilegedThreadFactory.class b/libjava/classpath/lib/java/util/concurrent/Executors$PrivilegedThreadFactory.class
new file mode 100644
index 00000000000..4b9d5843db2
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors$PrivilegedThreadFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors$RunnableAdapter.class b/libjava/classpath/lib/java/util/concurrent/Executors$RunnableAdapter.class
new file mode 100644
index 00000000000..107b0dede3a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors$RunnableAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Executors.class b/libjava/classpath/lib/java/util/concurrent/Executors.class
new file mode 100644
index 00000000000..d9fda7804ce
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Executors.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Future.class b/libjava/classpath/lib/java/util/concurrent/Future.class
new file mode 100644
index 00000000000..c274956b924
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Future.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/FutureTask$Sync.class b/libjava/classpath/lib/java/util/concurrent/FutureTask$Sync.class
new file mode 100644
index 00000000000..923c93cfc37
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/FutureTask$Sync.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/FutureTask.class b/libjava/classpath/lib/java/util/concurrent/FutureTask.class
new file mode 100644
index 00000000000..17fe0cc7df2
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/FutureTask.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$AbstractItr.class b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$AbstractItr.class
new file mode 100644
index 00000000000..58a725789e6
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$AbstractItr.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$DescendingItr.class b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$DescendingItr.class
new file mode 100644
index 00000000000..d6b87259a43
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$DescendingItr.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$Itr.class b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$Itr.class
new file mode 100644
index 00000000000..3436e467785
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$Itr.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$Node.class b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$Node.class
new file mode 100644
index 00000000000..a8cf1938902
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque$Node.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque.class b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque.class
new file mode 100644
index 00000000000..cd8bb1c18d2
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingDeque.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/LinkedBlockingQueue$Itr.class b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingQueue$Itr.class
new file mode 100644
index 00000000000..4870d6a3306
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingQueue$Itr.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/LinkedBlockingQueue$Node.class b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingQueue$Node.class
new file mode 100644
index 00000000000..2d591b479ae
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingQueue$Node.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/LinkedBlockingQueue.class b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingQueue.class
new file mode 100644
index 00000000000..bf0851c3e80
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/LinkedBlockingQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/PriorityBlockingQueue$Itr.class b/libjava/classpath/lib/java/util/concurrent/PriorityBlockingQueue$Itr.class
new file mode 100644
index 00000000000..48da2c113c7
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/PriorityBlockingQueue$Itr.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/PriorityBlockingQueue.class b/libjava/classpath/lib/java/util/concurrent/PriorityBlockingQueue.class
new file mode 100644
index 00000000000..5184f2c139f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/PriorityBlockingQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/RejectedExecutionException.class b/libjava/classpath/lib/java/util/concurrent/RejectedExecutionException.class
new file mode 100644
index 00000000000..57f1c1a401e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/RejectedExecutionException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/RejectedExecutionHandler.class b/libjava/classpath/lib/java/util/concurrent/RejectedExecutionHandler.class
new file mode 100644
index 00000000000..05e10edd111
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/RejectedExecutionHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/RunnableFuture.class b/libjava/classpath/lib/java/util/concurrent/RunnableFuture.class
new file mode 100644
index 00000000000..bde8429163f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/RunnableFuture.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/RunnableScheduledFuture.class b/libjava/classpath/lib/java/util/concurrent/RunnableScheduledFuture.class
new file mode 100644
index 00000000000..79895789f04
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/RunnableScheduledFuture.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ScheduledExecutorService.class b/libjava/classpath/lib/java/util/concurrent/ScheduledExecutorService.class
new file mode 100644
index 00000000000..0266970951a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ScheduledExecutorService.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ScheduledFuture.class b/libjava/classpath/lib/java/util/concurrent/ScheduledFuture.class
new file mode 100644
index 00000000000..31ef0bcb3da
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ScheduledFuture.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor$1.class b/libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor$1.class
new file mode 100644
index 00000000000..6aef91f7047
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue.class b/libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue.class
new file mode 100644
index 00000000000..424908fa899
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask.class b/libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask.class
new file mode 100644
index 00000000000..1870955841c
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor.class b/libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor.class
new file mode 100644
index 00000000000..af4be7284dc
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ScheduledThreadPoolExecutor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Semaphore$FairSync.class b/libjava/classpath/lib/java/util/concurrent/Semaphore$FairSync.class
new file mode 100644
index 00000000000..8a216087fe3
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Semaphore$FairSync.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Semaphore$NonfairSync.class b/libjava/classpath/lib/java/util/concurrent/Semaphore$NonfairSync.class
new file mode 100644
index 00000000000..60b43e7318e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Semaphore$NonfairSync.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Semaphore$Sync.class b/libjava/classpath/lib/java/util/concurrent/Semaphore$Sync.class
new file mode 100644
index 00000000000..d5d17a761e8
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Semaphore$Sync.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/Semaphore.class b/libjava/classpath/lib/java/util/concurrent/Semaphore.class
new file mode 100644
index 00000000000..f8ede27ed36
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/Semaphore.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$EmptyIterator.class b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$EmptyIterator.class
new file mode 100644
index 00000000000..30927f1d8a4
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$EmptyIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$FifoWaitQueue.class b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$FifoWaitQueue.class
new file mode 100644
index 00000000000..017a009958e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$FifoWaitQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$LifoWaitQueue.class b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$LifoWaitQueue.class
new file mode 100644
index 00000000000..65229c5c414
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$LifoWaitQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferQueue$QNode.class b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferQueue$QNode.class
new file mode 100644
index 00000000000..8ad18e5da0c
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferQueue$QNode.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferQueue.class b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferQueue.class
new file mode 100644
index 00000000000..ad5ce500523
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferStack$SNode.class b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferStack$SNode.class
new file mode 100644
index 00000000000..ff35ef69fe7
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferStack$SNode.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferStack.class b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferStack.class
new file mode 100644
index 00000000000..596ee4ed48b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$TransferStack.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$Transferer.class b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$Transferer.class
new file mode 100644
index 00000000000..683dbd0e2fd
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$Transferer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$WaitQueue.class b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$WaitQueue.class
new file mode 100644
index 00000000000..4376857a648
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue$WaitQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/SynchronousQueue.class b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue.class
new file mode 100644
index 00000000000..e588a6a6c34
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/SynchronousQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ThreadFactory.class b/libjava/classpath/lib/java/util/concurrent/ThreadFactory.class
new file mode 100644
index 00000000000..4c7b03d82e9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ThreadFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$AbortPolicy.class b/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$AbortPolicy.class
new file mode 100644
index 00000000000..1ac78c63b24
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$AbortPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$CallerRunsPolicy.class b/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$CallerRunsPolicy.class
new file mode 100644
index 00000000000..36fca630afd
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$CallerRunsPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$DiscardOldestPolicy.class b/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$DiscardOldestPolicy.class
new file mode 100644
index 00000000000..a824a2cde1b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$DiscardOldestPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$DiscardPolicy.class b/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$DiscardPolicy.class
new file mode 100644
index 00000000000..2158069a62a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$DiscardPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$Worker.class b/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$Worker.class
new file mode 100644
index 00000000000..b903f8aaf82
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor$Worker.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor.class b/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor.class
new file mode 100644
index 00000000000..f76017d3116
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/ThreadPoolExecutor.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/TimeUnit$1.class b/libjava/classpath/lib/java/util/concurrent/TimeUnit$1.class
new file mode 100644
index 00000000000..8218f2613d3
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/TimeUnit$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/TimeUnit$2.class b/libjava/classpath/lib/java/util/concurrent/TimeUnit$2.class
new file mode 100644
index 00000000000..405fe63c28b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/TimeUnit$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/TimeUnit$3.class b/libjava/classpath/lib/java/util/concurrent/TimeUnit$3.class
new file mode 100644
index 00000000000..6e94184b3c3
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/TimeUnit$3.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/TimeUnit$4.class b/libjava/classpath/lib/java/util/concurrent/TimeUnit$4.class
new file mode 100644
index 00000000000..079bfb010c2
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/TimeUnit$4.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/TimeUnit$5.class b/libjava/classpath/lib/java/util/concurrent/TimeUnit$5.class
new file mode 100644
index 00000000000..50d5a6059fe
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/TimeUnit$5.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/TimeUnit$6.class b/libjava/classpath/lib/java/util/concurrent/TimeUnit$6.class
new file mode 100644
index 00000000000..a2232a58b68
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/TimeUnit$6.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/TimeUnit$7.class b/libjava/classpath/lib/java/util/concurrent/TimeUnit$7.class
new file mode 100644
index 00000000000..81d600f26c5
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/TimeUnit$7.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/TimeUnit.class b/libjava/classpath/lib/java/util/concurrent/TimeUnit.class
new file mode 100644
index 00000000000..cd4b852a2d9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/TimeUnit.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/TimeoutException.class b/libjava/classpath/lib/java/util/concurrent/TimeoutException.class
new file mode 100644
index 00000000000..7438a73743f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/TimeoutException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicBoolean.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicBoolean.class
new file mode 100644
index 00000000000..15962486e10
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicBoolean.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicInteger.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicInteger.class
new file mode 100644
index 00000000000..4130c91f22b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicInteger.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicIntegerArray.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicIntegerArray.class
new file mode 100644
index 00000000000..dd17939ab6c
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicIntegerArray.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.class
new file mode 100644
index 00000000000..53e2016bd69
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.class
new file mode 100644
index 00000000000..8d308e62cb8
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLong.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLong.class
new file mode 100644
index 00000000000..09ff7f24edc
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLong.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongArray.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongArray.class
new file mode 100644
index 00000000000..c9bd82218ea
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongArray.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater.class
new file mode 100644
index 00000000000..d7a74744bd0
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongFieldUpdater$LockedUpdater.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongFieldUpdater$LockedUpdater.class
new file mode 100644
index 00000000000..fcb0248ba87
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongFieldUpdater$LockedUpdater.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongFieldUpdater.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongFieldUpdater.class
new file mode 100644
index 00000000000..210ad225bc3
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicLongFieldUpdater.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicMarkableReference$ReferenceBooleanPair.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicMarkableReference$ReferenceBooleanPair.class
new file mode 100644
index 00000000000..edbf9a91a9b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicMarkableReference$ReferenceBooleanPair.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicMarkableReference.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicMarkableReference.class
new file mode 100644
index 00000000000..ec9b2541af9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicMarkableReference.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicReference.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicReference.class
new file mode 100644
index 00000000000..88235268362
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicReference.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicReferenceArray.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicReferenceArray.class
new file mode 100644
index 00000000000..01351e4713e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicReferenceArray.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl.class
new file mode 100644
index 00000000000..8b08736f736
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.class
new file mode 100644
index 00000000000..52637d075c4
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicStampedReference$ReferenceIntegerPair.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicStampedReference$ReferenceIntegerPair.class
new file mode 100644
index 00000000000..748d36df8c7
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicStampedReference$ReferenceIntegerPair.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/atomic/AtomicStampedReference.class b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicStampedReference.class
new file mode 100644
index 00000000000..0976ccb8dc4
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/atomic/AtomicStampedReference.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/AbstractOwnableSynchronizer.class b/libjava/classpath/lib/java/util/concurrent/locks/AbstractOwnableSynchronizer.class
new file mode 100644
index 00000000000..571f6d143da
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/AbstractOwnableSynchronizer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedLongSynchronizer$ConditionObject.class b/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedLongSynchronizer$ConditionObject.class
new file mode 100644
index 00000000000..4154702abd5
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedLongSynchronizer$ConditionObject.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedLongSynchronizer$Node.class b/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedLongSynchronizer$Node.class
new file mode 100644
index 00000000000..9990a3177c0
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedLongSynchronizer$Node.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.class b/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.class
new file mode 100644
index 00000000000..0bad6f58f33
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.class b/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.class
new file mode 100644
index 00000000000..3d9ff37cd98
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedSynchronizer$Node.class b/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedSynchronizer$Node.class
new file mode 100644
index 00000000000..caf62dd3855
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedSynchronizer$Node.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedSynchronizer.class b/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedSynchronizer.class
new file mode 100644
index 00000000000..f350fdaa9b5
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/AbstractQueuedSynchronizer.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/Condition.class b/libjava/classpath/lib/java/util/concurrent/locks/Condition.class
new file mode 100644
index 00000000000..94057fe7727
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/Condition.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/Lock.class b/libjava/classpath/lib/java/util/concurrent/locks/Lock.class
new file mode 100644
index 00000000000..52097e97ecf
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/Lock.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/LockSupport.class b/libjava/classpath/lib/java/util/concurrent/locks/LockSupport.class
new file mode 100644
index 00000000000..86b2ae0e38d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/LockSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/ReadWriteLock.class b/libjava/classpath/lib/java/util/concurrent/locks/ReadWriteLock.class
new file mode 100644
index 00000000000..e216ab413c9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/ReadWriteLock.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock$FairSync.class b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock$FairSync.class
new file mode 100644
index 00000000000..981d4c0593a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock$FairSync.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock$NonfairSync.class b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock$NonfairSync.class
new file mode 100644
index 00000000000..de58e12e64b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock$NonfairSync.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock$Sync.class b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock$Sync.class
new file mode 100644
index 00000000000..e2e8a063bd6
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock$Sync.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock.class b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock.class
new file mode 100644
index 00000000000..99eb8178bab
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantLock.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$FairSync.class b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$FairSync.class
new file mode 100644
index 00000000000..42bf02b2477
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$FairSync.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync.class b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync.class
new file mode 100644
index 00000000000..7ade70dcdd3
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock.class b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock.class
new file mode 100644
index 00000000000..902ae0f419d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$Sync$HoldCounter.class b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$Sync$HoldCounter.class
new file mode 100644
index 00000000000..11ae1ecd371
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$Sync$HoldCounter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$Sync$ThreadLocalHoldCounter.class b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$Sync$ThreadLocalHoldCounter.class
new file mode 100644
index 00000000000..992969a4787
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$Sync$ThreadLocalHoldCounter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$Sync.class b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$Sync.class
new file mode 100644
index 00000000000..dfec8fcec0a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$Sync.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock.class b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock.class
new file mode 100644
index 00000000000..09b514b71aa
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock.class b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock.class
new file mode 100644
index 00000000000..221e7097e2b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/concurrent/locks/ReentrantReadWriteLock.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/jar/Attributes$Name.class b/libjava/classpath/lib/java/util/jar/Attributes$Name.class
new file mode 100644
index 00000000000..c91f94f3f54
--- /dev/null
+++ b/libjava/classpath/lib/java/util/jar/Attributes$Name.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/jar/Attributes.class b/libjava/classpath/lib/java/util/jar/Attributes.class
new file mode 100644
index 00000000000..a7e7569f52f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/jar/Attributes.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/jar/JarEntry.class b/libjava/classpath/lib/java/util/jar/JarEntry.class
new file mode 100644
index 00000000000..0ae4b9728b7
--- /dev/null
+++ b/libjava/classpath/lib/java/util/jar/JarEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/jar/JarException.class b/libjava/classpath/lib/java/util/jar/JarException.class
new file mode 100644
index 00000000000..7c42b7b1a16
--- /dev/null
+++ b/libjava/classpath/lib/java/util/jar/JarException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/jar/JarFile$EntryInputStream.class b/libjava/classpath/lib/java/util/jar/JarFile$EntryInputStream.class
new file mode 100644
index 00000000000..77805bda356
--- /dev/null
+++ b/libjava/classpath/lib/java/util/jar/JarFile$EntryInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/jar/JarFile$JarEnumeration.class b/libjava/classpath/lib/java/util/jar/JarFile$JarEnumeration.class
new file mode 100644
index 00000000000..871be671067
--- /dev/null
+++ b/libjava/classpath/lib/java/util/jar/JarFile$JarEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/jar/JarFile.class b/libjava/classpath/lib/java/util/jar/JarFile.class
new file mode 100644
index 00000000000..0ab0c3293be
--- /dev/null
+++ b/libjava/classpath/lib/java/util/jar/JarFile.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/jar/JarInputStream.class b/libjava/classpath/lib/java/util/jar/JarInputStream.class
new file mode 100644
index 00000000000..5646f3d67cc
--- /dev/null
+++ b/libjava/classpath/lib/java/util/jar/JarInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/jar/JarOutputStream.class b/libjava/classpath/lib/java/util/jar/JarOutputStream.class
new file mode 100644
index 00000000000..fc5cd4efbe8
--- /dev/null
+++ b/libjava/classpath/lib/java/util/jar/JarOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/jar/Manifest.class b/libjava/classpath/lib/java/util/jar/Manifest.class
new file mode 100644
index 00000000000..0f95a3a02ce
--- /dev/null
+++ b/libjava/classpath/lib/java/util/jar/Manifest.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/ConsoleHandler.class b/libjava/classpath/lib/java/util/logging/ConsoleHandler.class
new file mode 100644
index 00000000000..c1016c61ddc
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/ConsoleHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/ErrorManager.class b/libjava/classpath/lib/java/util/logging/ErrorManager.class
new file mode 100644
index 00000000000..a61eb2e4e60
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/ErrorManager.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/FileHandler$ostr.class b/libjava/classpath/lib/java/util/logging/FileHandler$ostr.class
new file mode 100644
index 00000000000..b89bb0edc3d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/FileHandler$ostr.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/FileHandler.class b/libjava/classpath/lib/java/util/logging/FileHandler.class
new file mode 100644
index 00000000000..7cb9151e1d5
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/FileHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/Filter.class b/libjava/classpath/lib/java/util/logging/Filter.class
new file mode 100644
index 00000000000..4f1182c5e5a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/Filter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/Formatter.class b/libjava/classpath/lib/java/util/logging/Formatter.class
new file mode 100644
index 00000000000..f2179df367d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/Formatter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/Handler.class b/libjava/classpath/lib/java/util/logging/Handler.class
new file mode 100644
index 00000000000..791448fd41f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/Handler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/Level.class b/libjava/classpath/lib/java/util/logging/Level.class
new file mode 100644
index 00000000000..63159fcfe51
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/Level.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/LogManager$1.class b/libjava/classpath/lib/java/util/logging/LogManager$1.class
new file mode 100644
index 00000000000..39d0992a0ab
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/LogManager$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/LogManager.class b/libjava/classpath/lib/java/util/logging/LogManager.class
new file mode 100644
index 00000000000..7f93b8af931
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/LogManager.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/LogRecord.class b/libjava/classpath/lib/java/util/logging/LogRecord.class
new file mode 100644
index 00000000000..35fba9e9c25
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/LogRecord.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/Logger$1.class b/libjava/classpath/lib/java/util/logging/Logger$1.class
new file mode 100644
index 00000000000..75e2200420c
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/Logger$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/Logger.class b/libjava/classpath/lib/java/util/logging/Logger.class
new file mode 100644
index 00000000000..ab5acbc9ea3
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/Logger.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/LoggingMXBean.class b/libjava/classpath/lib/java/util/logging/LoggingMXBean.class
new file mode 100644
index 00000000000..07e36eea48b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/LoggingMXBean.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/LoggingPermission.class b/libjava/classpath/lib/java/util/logging/LoggingPermission.class
new file mode 100644
index 00000000000..e6d4caf8eb5
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/LoggingPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/MemoryHandler.class b/libjava/classpath/lib/java/util/logging/MemoryHandler.class
new file mode 100644
index 00000000000..80e0099c73c
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/MemoryHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/SimpleFormatter.class b/libjava/classpath/lib/java/util/logging/SimpleFormatter.class
new file mode 100644
index 00000000000..b484f73937d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/SimpleFormatter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/SocketHandler.class b/libjava/classpath/lib/java/util/logging/SocketHandler.class
new file mode 100644
index 00000000000..fa90dee6f7e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/SocketHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/StreamHandler.class b/libjava/classpath/lib/java/util/logging/StreamHandler.class
new file mode 100644
index 00000000000..daeda91edb3
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/StreamHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/logging/XMLFormatter.class b/libjava/classpath/lib/java/util/logging/XMLFormatter.class
new file mode 100644
index 00000000000..fd47a7d08c3
--- /dev/null
+++ b/libjava/classpath/lib/java/util/logging/XMLFormatter.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/prefs/AbstractPreferences$1.class b/libjava/classpath/lib/java/util/prefs/AbstractPreferences$1.class
new file mode 100644
index 00000000000..0f2ec9517e2
--- /dev/null
+++ b/libjava/classpath/lib/java/util/prefs/AbstractPreferences$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/prefs/AbstractPreferences$2.class b/libjava/classpath/lib/java/util/prefs/AbstractPreferences$2.class
new file mode 100644
index 00000000000..596a22a8895
--- /dev/null
+++ b/libjava/classpath/lib/java/util/prefs/AbstractPreferences$2.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/prefs/AbstractPreferences.class b/libjava/classpath/lib/java/util/prefs/AbstractPreferences.class
new file mode 100644
index 00000000000..b8537d1745a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/prefs/AbstractPreferences.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/prefs/BackingStoreException.class b/libjava/classpath/lib/java/util/prefs/BackingStoreException.class
new file mode 100644
index 00000000000..70fc6df4e47
--- /dev/null
+++ b/libjava/classpath/lib/java/util/prefs/BackingStoreException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/prefs/InvalidPreferencesFormatException.class b/libjava/classpath/lib/java/util/prefs/InvalidPreferencesFormatException.class
new file mode 100644
index 00000000000..5ac6f879942
--- /dev/null
+++ b/libjava/classpath/lib/java/util/prefs/InvalidPreferencesFormatException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/prefs/NodeChangeEvent.class b/libjava/classpath/lib/java/util/prefs/NodeChangeEvent.class
new file mode 100644
index 00000000000..dff7ba5c7ad
--- /dev/null
+++ b/libjava/classpath/lib/java/util/prefs/NodeChangeEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/prefs/NodeChangeListener.class b/libjava/classpath/lib/java/util/prefs/NodeChangeListener.class
new file mode 100644
index 00000000000..698f176aaea
--- /dev/null
+++ b/libjava/classpath/lib/java/util/prefs/NodeChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/prefs/PreferenceChangeEvent.class b/libjava/classpath/lib/java/util/prefs/PreferenceChangeEvent.class
new file mode 100644
index 00000000000..6f4bc424e47
--- /dev/null
+++ b/libjava/classpath/lib/java/util/prefs/PreferenceChangeEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/prefs/PreferenceChangeListener.class b/libjava/classpath/lib/java/util/prefs/PreferenceChangeListener.class
new file mode 100644
index 00000000000..ffcbb0207bc
--- /dev/null
+++ b/libjava/classpath/lib/java/util/prefs/PreferenceChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/prefs/Preferences$1.class b/libjava/classpath/lib/java/util/prefs/Preferences$1.class
new file mode 100644
index 00000000000..00f0be17c23
--- /dev/null
+++ b/libjava/classpath/lib/java/util/prefs/Preferences$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/prefs/Preferences.class b/libjava/classpath/lib/java/util/prefs/Preferences.class
new file mode 100644
index 00000000000..bf687b05cc0
--- /dev/null
+++ b/libjava/classpath/lib/java/util/prefs/Preferences.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/prefs/PreferencesFactory.class b/libjava/classpath/lib/java/util/prefs/PreferencesFactory.class
new file mode 100644
index 00000000000..2243ca51597
--- /dev/null
+++ b/libjava/classpath/lib/java/util/prefs/PreferencesFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/regex/MatchResult.class b/libjava/classpath/lib/java/util/regex/MatchResult.class
new file mode 100644
index 00000000000..064c64a293a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/regex/MatchResult.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/regex/Matcher.class b/libjava/classpath/lib/java/util/regex/Matcher.class
new file mode 100644
index 00000000000..6cb429c6fb8
--- /dev/null
+++ b/libjava/classpath/lib/java/util/regex/Matcher.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/regex/Pattern.class b/libjava/classpath/lib/java/util/regex/Pattern.class
new file mode 100644
index 00000000000..47e212b2226
--- /dev/null
+++ b/libjava/classpath/lib/java/util/regex/Pattern.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/regex/PatternSyntaxException.class b/libjava/classpath/lib/java/util/regex/PatternSyntaxException.class
new file mode 100644
index 00000000000..39d83b676e3
--- /dev/null
+++ b/libjava/classpath/lib/java/util/regex/PatternSyntaxException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/Adler32.class b/libjava/classpath/lib/java/util/zip/Adler32.class
new file mode 100644
index 00000000000..442ff469b1e
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/Adler32.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/CRC32.class b/libjava/classpath/lib/java/util/zip/CRC32.class
new file mode 100644
index 00000000000..648d071d88b
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/CRC32.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/CheckedInputStream.class b/libjava/classpath/lib/java/util/zip/CheckedInputStream.class
new file mode 100644
index 00000000000..ebc47507816
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/CheckedInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/CheckedOutputStream.class b/libjava/classpath/lib/java/util/zip/CheckedOutputStream.class
new file mode 100644
index 00000000000..c1cb1101af1
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/CheckedOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/Checksum.class b/libjava/classpath/lib/java/util/zip/Checksum.class
new file mode 100644
index 00000000000..f30eab3a199
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/Checksum.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/DataFormatException.class b/libjava/classpath/lib/java/util/zip/DataFormatException.class
new file mode 100644
index 00000000000..2cc399771e3
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/DataFormatException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/Deflater.class b/libjava/classpath/lib/java/util/zip/Deflater.class
new file mode 100644
index 00000000000..7082243dd88
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/Deflater.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/DeflaterOutputStream.class b/libjava/classpath/lib/java/util/zip/DeflaterOutputStream.class
new file mode 100644
index 00000000000..7dc0cab62c4
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/DeflaterOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/GZIPInputStream.class b/libjava/classpath/lib/java/util/zip/GZIPInputStream.class
new file mode 100644
index 00000000000..a6509e756f8
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/GZIPInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/GZIPOutputStream.class b/libjava/classpath/lib/java/util/zip/GZIPOutputStream.class
new file mode 100644
index 00000000000..debc1c134e9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/GZIPOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/Inflater.class b/libjava/classpath/lib/java/util/zip/Inflater.class
new file mode 100644
index 00000000000..ec1bc7f84bc
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/Inflater.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/InflaterInputStream.class b/libjava/classpath/lib/java/util/zip/InflaterInputStream.class
new file mode 100644
index 00000000000..d0f6de8fcf7
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/InflaterInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/ZipConstants.class b/libjava/classpath/lib/java/util/zip/ZipConstants.class
new file mode 100644
index 00000000000..485b7dac58f
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/ZipConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/ZipEntry.class b/libjava/classpath/lib/java/util/zip/ZipEntry.class
new file mode 100644
index 00000000000..dc9b197e812
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/ZipEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/ZipException.class b/libjava/classpath/lib/java/util/zip/ZipException.class
new file mode 100644
index 00000000000..dcc54826f05
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/ZipException.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/ZipFile$1.class b/libjava/classpath/lib/java/util/zip/ZipFile$1.class
new file mode 100644
index 00000000000..f37b498a13d
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/ZipFile$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/ZipFile$PartialInputStream.class b/libjava/classpath/lib/java/util/zip/ZipFile$PartialInputStream.class
new file mode 100644
index 00000000000..cc7dcd68600
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/ZipFile$PartialInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/ZipFile$ZipEntryEnumeration.class b/libjava/classpath/lib/java/util/zip/ZipFile$ZipEntryEnumeration.class
new file mode 100644
index 00000000000..85c08376104
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/ZipFile$ZipEntryEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/ZipFile.class b/libjava/classpath/lib/java/util/zip/ZipFile.class
new file mode 100644
index 00000000000..c73ebec6e4a
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/ZipFile.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/ZipInputStream.class b/libjava/classpath/lib/java/util/zip/ZipInputStream.class
new file mode 100644
index 00000000000..3865420d226
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/ZipInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/java/util/zip/ZipOutputStream.class b/libjava/classpath/lib/java/util/zip/ZipOutputStream.class
new file mode 100644
index 00000000000..616b27120a9
--- /dev/null
+++ b/libjava/classpath/lib/java/util/zip/ZipOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/Accessible.class b/libjava/classpath/lib/javax/accessibility/Accessible.class
new file mode 100644
index 00000000000..fe2199fd14a
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/Accessible.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleAction.class b/libjava/classpath/lib/javax/accessibility/AccessibleAction.class
new file mode 100644
index 00000000000..149eef17101
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleAttributeSequence.class b/libjava/classpath/lib/javax/accessibility/AccessibleAttributeSequence.class
new file mode 100644
index 00000000000..2bd35220370
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleAttributeSequence.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleBundle.class b/libjava/classpath/lib/javax/accessibility/AccessibleBundle.class
new file mode 100644
index 00000000000..a99befe6fe3
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleBundle.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleComponent.class b/libjava/classpath/lib/javax/accessibility/AccessibleComponent.class
new file mode 100644
index 00000000000..73707b7a63c
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleContext.class b/libjava/classpath/lib/javax/accessibility/AccessibleContext.class
new file mode 100644
index 00000000000..5452cfac4d6
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleEditableText.class b/libjava/classpath/lib/javax/accessibility/AccessibleEditableText.class
new file mode 100644
index 00000000000..8b3df93fcc4
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleEditableText.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleExtendedComponent.class b/libjava/classpath/lib/javax/accessibility/AccessibleExtendedComponent.class
new file mode 100644
index 00000000000..65f698c6fe7
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleExtendedComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleExtendedTable.class b/libjava/classpath/lib/javax/accessibility/AccessibleExtendedTable.class
new file mode 100644
index 00000000000..8f5c69c1f4c
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleExtendedTable.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleExtendedText.class b/libjava/classpath/lib/javax/accessibility/AccessibleExtendedText.class
new file mode 100644
index 00000000000..a88e57ff2f9
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleExtendedText.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleHyperlink.class b/libjava/classpath/lib/javax/accessibility/AccessibleHyperlink.class
new file mode 100644
index 00000000000..2704bc4708b
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleHyperlink.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleHypertext.class b/libjava/classpath/lib/javax/accessibility/AccessibleHypertext.class
new file mode 100644
index 00000000000..c51f9b7de51
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleHypertext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleIcon.class b/libjava/classpath/lib/javax/accessibility/AccessibleIcon.class
new file mode 100644
index 00000000000..6057d36ec03
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleKeyBinding.class b/libjava/classpath/lib/javax/accessibility/AccessibleKeyBinding.class
new file mode 100644
index 00000000000..fe9b740151b
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleKeyBinding.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleRelation.class b/libjava/classpath/lib/javax/accessibility/AccessibleRelation.class
new file mode 100644
index 00000000000..944cfb427da
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleRelation.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleRelationSet.class b/libjava/classpath/lib/javax/accessibility/AccessibleRelationSet.class
new file mode 100644
index 00000000000..43fb3c7b5de
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleRelationSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleResourceBundle.class b/libjava/classpath/lib/javax/accessibility/AccessibleResourceBundle.class
new file mode 100644
index 00000000000..63deb244e15
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleResourceBundle.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleRole.class b/libjava/classpath/lib/javax/accessibility/AccessibleRole.class
new file mode 100644
index 00000000000..d05eefb9166
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleRole.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleSelection.class b/libjava/classpath/lib/javax/accessibility/AccessibleSelection.class
new file mode 100644
index 00000000000..254cd3fb28c
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleSelection.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleState.class b/libjava/classpath/lib/javax/accessibility/AccessibleState.class
new file mode 100644
index 00000000000..513cebedf08
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleState.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleStateSet.class b/libjava/classpath/lib/javax/accessibility/AccessibleStateSet.class
new file mode 100644
index 00000000000..68fbea36061
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleStateSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleStreamable.class b/libjava/classpath/lib/javax/accessibility/AccessibleStreamable.class
new file mode 100644
index 00000000000..c133956ab7c
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleStreamable.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleTable.class b/libjava/classpath/lib/javax/accessibility/AccessibleTable.class
new file mode 100644
index 00000000000..68263adba35
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleTable.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleTableModelChange.class b/libjava/classpath/lib/javax/accessibility/AccessibleTableModelChange.class
new file mode 100644
index 00000000000..a45d84a143b
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleTableModelChange.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleText.class b/libjava/classpath/lib/javax/accessibility/AccessibleText.class
new file mode 100644
index 00000000000..d67789427ba
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleText.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleTextSequence.class b/libjava/classpath/lib/javax/accessibility/AccessibleTextSequence.class
new file mode 100644
index 00000000000..b0fd35da23e
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleTextSequence.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/accessibility/AccessibleValue.class b/libjava/classpath/lib/javax/accessibility/AccessibleValue.class
new file mode 100644
index 00000000000..a44fc858760
--- /dev/null
+++ b/libjava/classpath/lib/javax/accessibility/AccessibleValue.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/BadPaddingException.class b/libjava/classpath/lib/javax/crypto/BadPaddingException.class
new file mode 100644
index 00000000000..57c28489f14
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/BadPaddingException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/Cipher.class b/libjava/classpath/lib/javax/crypto/Cipher.class
new file mode 100644
index 00000000000..4d7b5a63913
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/Cipher.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/CipherInputStream.class b/libjava/classpath/lib/javax/crypto/CipherInputStream.class
new file mode 100644
index 00000000000..112cdecf4d9
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/CipherInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/CipherOutputStream.class b/libjava/classpath/lib/javax/crypto/CipherOutputStream.class
new file mode 100644
index 00000000000..d2d61e23bf1
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/CipherOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/CipherSpi.class b/libjava/classpath/lib/javax/crypto/CipherSpi.class
new file mode 100644
index 00000000000..c1d63cf7d10
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/CipherSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/EncryptedPrivateKeyInfo.class b/libjava/classpath/lib/javax/crypto/EncryptedPrivateKeyInfo.class
new file mode 100644
index 00000000000..60255e20619
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/EncryptedPrivateKeyInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/ExemptionMechanism.class b/libjava/classpath/lib/javax/crypto/ExemptionMechanism.class
new file mode 100644
index 00000000000..55bf46537bf
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/ExemptionMechanism.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/ExemptionMechanismException.class b/libjava/classpath/lib/javax/crypto/ExemptionMechanismException.class
new file mode 100644
index 00000000000..8a46deba0e6
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/ExemptionMechanismException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/ExemptionMechanismSpi.class b/libjava/classpath/lib/javax/crypto/ExemptionMechanismSpi.class
new file mode 100644
index 00000000000..dd1c33fe585
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/ExemptionMechanismSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/IllegalBlockSizeException.class b/libjava/classpath/lib/javax/crypto/IllegalBlockSizeException.class
new file mode 100644
index 00000000000..9878806420b
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/IllegalBlockSizeException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/KeyAgreement.class b/libjava/classpath/lib/javax/crypto/KeyAgreement.class
new file mode 100644
index 00000000000..52d8fc45a00
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/KeyAgreement.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/KeyAgreementSpi.class b/libjava/classpath/lib/javax/crypto/KeyAgreementSpi.class
new file mode 100644
index 00000000000..95abcb69217
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/KeyAgreementSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/KeyGenerator.class b/libjava/classpath/lib/javax/crypto/KeyGenerator.class
new file mode 100644
index 00000000000..e508065d134
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/KeyGenerator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/KeyGeneratorSpi.class b/libjava/classpath/lib/javax/crypto/KeyGeneratorSpi.class
new file mode 100644
index 00000000000..4cc1464740a
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/KeyGeneratorSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/Mac.class b/libjava/classpath/lib/javax/crypto/Mac.class
new file mode 100644
index 00000000000..2a1ffec0790
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/Mac.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/MacSpi.class b/libjava/classpath/lib/javax/crypto/MacSpi.class
new file mode 100644
index 00000000000..358a03fec1f
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/MacSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/NoSuchPaddingException.class b/libjava/classpath/lib/javax/crypto/NoSuchPaddingException.class
new file mode 100644
index 00000000000..633fc1ebffc
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/NoSuchPaddingException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/NullCipher.class b/libjava/classpath/lib/javax/crypto/NullCipher.class
new file mode 100644
index 00000000000..2cb9e01273b
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/NullCipher.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/NullCipherImpl.class b/libjava/classpath/lib/javax/crypto/NullCipherImpl.class
new file mode 100644
index 00000000000..fe9d2eff44b
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/NullCipherImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/SealedObject.class b/libjava/classpath/lib/javax/crypto/SealedObject.class
new file mode 100644
index 00000000000..fcf03fbb799
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/SealedObject.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/SecretKey.class b/libjava/classpath/lib/javax/crypto/SecretKey.class
new file mode 100644
index 00000000000..64e8d59657a
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/SecretKey.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/SecretKeyFactory.class b/libjava/classpath/lib/javax/crypto/SecretKeyFactory.class
new file mode 100644
index 00000000000..e457f1c3c58
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/SecretKeyFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/SecretKeyFactorySpi.class b/libjava/classpath/lib/javax/crypto/SecretKeyFactorySpi.class
new file mode 100644
index 00000000000..b92dad3dc8d
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/SecretKeyFactorySpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/ShortBufferException.class b/libjava/classpath/lib/javax/crypto/ShortBufferException.class
new file mode 100644
index 00000000000..1e8ba487328
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/ShortBufferException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/interfaces/DHKey.class b/libjava/classpath/lib/javax/crypto/interfaces/DHKey.class
new file mode 100644
index 00000000000..d370d21de21
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/interfaces/DHKey.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/interfaces/DHPrivateKey.class b/libjava/classpath/lib/javax/crypto/interfaces/DHPrivateKey.class
new file mode 100644
index 00000000000..57e0a02160c
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/interfaces/DHPrivateKey.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/interfaces/DHPublicKey.class b/libjava/classpath/lib/javax/crypto/interfaces/DHPublicKey.class
new file mode 100644
index 00000000000..498a26c35ea
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/interfaces/DHPublicKey.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/interfaces/PBEKey.class b/libjava/classpath/lib/javax/crypto/interfaces/PBEKey.class
new file mode 100644
index 00000000000..6871ebd2914
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/interfaces/PBEKey.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/spec/DESKeySpec.class b/libjava/classpath/lib/javax/crypto/spec/DESKeySpec.class
new file mode 100644
index 00000000000..c95a112ef16
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/spec/DESKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/spec/DESedeKeySpec.class b/libjava/classpath/lib/javax/crypto/spec/DESedeKeySpec.class
new file mode 100644
index 00000000000..d70c28fc310
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/spec/DESedeKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/spec/DHGenParameterSpec.class b/libjava/classpath/lib/javax/crypto/spec/DHGenParameterSpec.class
new file mode 100644
index 00000000000..f47669432db
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/spec/DHGenParameterSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/spec/DHParameterSpec.class b/libjava/classpath/lib/javax/crypto/spec/DHParameterSpec.class
new file mode 100644
index 00000000000..25b8df6db1e
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/spec/DHParameterSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/spec/DHPrivateKeySpec.class b/libjava/classpath/lib/javax/crypto/spec/DHPrivateKeySpec.class
new file mode 100644
index 00000000000..2c717e1f20b
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/spec/DHPrivateKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/spec/DHPublicKeySpec.class b/libjava/classpath/lib/javax/crypto/spec/DHPublicKeySpec.class
new file mode 100644
index 00000000000..fa0d95e3f11
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/spec/DHPublicKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/spec/IvParameterSpec.class b/libjava/classpath/lib/javax/crypto/spec/IvParameterSpec.class
new file mode 100644
index 00000000000..9ad1e895b9c
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/spec/IvParameterSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/spec/PBEKeySpec.class b/libjava/classpath/lib/javax/crypto/spec/PBEKeySpec.class
new file mode 100644
index 00000000000..c9e2ee820f3
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/spec/PBEKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/spec/PBEParameterSpec.class b/libjava/classpath/lib/javax/crypto/spec/PBEParameterSpec.class
new file mode 100644
index 00000000000..5b586d236ce
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/spec/PBEParameterSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/spec/RC2ParameterSpec.class b/libjava/classpath/lib/javax/crypto/spec/RC2ParameterSpec.class
new file mode 100644
index 00000000000..4c58c84102d
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/spec/RC2ParameterSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/spec/RC5ParameterSpec.class b/libjava/classpath/lib/javax/crypto/spec/RC5ParameterSpec.class
new file mode 100644
index 00000000000..6acc9437818
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/spec/RC5ParameterSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/crypto/spec/SecretKeySpec.class b/libjava/classpath/lib/javax/crypto/spec/SecretKeySpec.class
new file mode 100644
index 00000000000..a68b9352d93
--- /dev/null
+++ b/libjava/classpath/lib/javax/crypto/spec/SecretKeySpec.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/IIOException.class b/libjava/classpath/lib/javax/imageio/IIOException.class
new file mode 100644
index 00000000000..d71f8c283a0
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/IIOException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/IIOImage.class b/libjava/classpath/lib/javax/imageio/IIOImage.class
new file mode 100644
index 00000000000..5dea6c5fb0d
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/IIOImage.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/IIOParam.class b/libjava/classpath/lib/javax/imageio/IIOParam.class
new file mode 100644
index 00000000000..3964639b694
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/IIOParam.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/IIOParamController.class b/libjava/classpath/lib/javax/imageio/IIOParamController.class
new file mode 100644
index 00000000000..bc138b67507
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/IIOParamController.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageIO$1.class b/libjava/classpath/lib/javax/imageio/ImageIO$1.class
new file mode 100644
index 00000000000..aecb7d8db73
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageIO$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageIO$ImageReaderIterator.class b/libjava/classpath/lib/javax/imageio/ImageIO$ImageReaderIterator.class
new file mode 100644
index 00000000000..0f0891053f9
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageIO$ImageReaderIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageIO$ImageWriterIterator.class b/libjava/classpath/lib/javax/imageio/ImageIO$ImageWriterIterator.class
new file mode 100644
index 00000000000..1637f289d4a
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageIO$ImageWriterIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageIO$ReaderFormatFilter.class b/libjava/classpath/lib/javax/imageio/ImageIO$ReaderFormatFilter.class
new file mode 100644
index 00000000000..5155bca7667
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageIO$ReaderFormatFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageIO$ReaderMIMETypeFilter.class b/libjava/classpath/lib/javax/imageio/ImageIO$ReaderMIMETypeFilter.class
new file mode 100644
index 00000000000..aa88c00f26f
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageIO$ReaderMIMETypeFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageIO$ReaderObjectFilter.class b/libjava/classpath/lib/javax/imageio/ImageIO$ReaderObjectFilter.class
new file mode 100644
index 00000000000..51b2f1e52cf
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageIO$ReaderObjectFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageIO$ReaderSuffixFilter.class b/libjava/classpath/lib/javax/imageio/ImageIO$ReaderSuffixFilter.class
new file mode 100644
index 00000000000..a4250bf5257
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageIO$ReaderSuffixFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageIO$TranscoderFilter.class b/libjava/classpath/lib/javax/imageio/ImageIO$TranscoderFilter.class
new file mode 100644
index 00000000000..8e4fe3cdcbc
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageIO$TranscoderFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageIO$WriterFormatFilter.class b/libjava/classpath/lib/javax/imageio/ImageIO$WriterFormatFilter.class
new file mode 100644
index 00000000000..a1fcd80fc56
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageIO$WriterFormatFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageIO$WriterMIMETypeFilter.class b/libjava/classpath/lib/javax/imageio/ImageIO$WriterMIMETypeFilter.class
new file mode 100644
index 00000000000..64f5bd49fc6
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageIO$WriterMIMETypeFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageIO$WriterObjectFilter.class b/libjava/classpath/lib/javax/imageio/ImageIO$WriterObjectFilter.class
new file mode 100644
index 00000000000..1304c7f9388
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageIO$WriterObjectFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageIO$WriterSuffixFilter.class b/libjava/classpath/lib/javax/imageio/ImageIO$WriterSuffixFilter.class
new file mode 100644
index 00000000000..9ff7d63bb1b
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageIO$WriterSuffixFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageIO.class b/libjava/classpath/lib/javax/imageio/ImageIO.class
new file mode 100644
index 00000000000..14c24cb382d
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageIO.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageReadParam.class b/libjava/classpath/lib/javax/imageio/ImageReadParam.class
new file mode 100644
index 00000000000..67cff3a68a9
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageReadParam.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageReader.class b/libjava/classpath/lib/javax/imageio/ImageReader.class
new file mode 100644
index 00000000000..85979dac171
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageReader.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageTranscoder.class b/libjava/classpath/lib/javax/imageio/ImageTranscoder.class
new file mode 100644
index 00000000000..2e5cb4a40a5
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageTranscoder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageTypeSpecifier.class b/libjava/classpath/lib/javax/imageio/ImageTypeSpecifier.class
new file mode 100644
index 00000000000..17e94e7630f
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageTypeSpecifier.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageWriteParam.class b/libjava/classpath/lib/javax/imageio/ImageWriteParam.class
new file mode 100644
index 00000000000..942348b55b8
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageWriteParam.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/ImageWriter.class b/libjava/classpath/lib/javax/imageio/ImageWriter.class
new file mode 100644
index 00000000000..57e29cf5b6f
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/ImageWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/event/IIOReadProgressListener.class b/libjava/classpath/lib/javax/imageio/event/IIOReadProgressListener.class
new file mode 100644
index 00000000000..2728ff5eea0
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/event/IIOReadProgressListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/event/IIOReadUpdateListener.class b/libjava/classpath/lib/javax/imageio/event/IIOReadUpdateListener.class
new file mode 100644
index 00000000000..26b3560fee3
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/event/IIOReadUpdateListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/event/IIOReadWarningListener.class b/libjava/classpath/lib/javax/imageio/event/IIOReadWarningListener.class
new file mode 100644
index 00000000000..ecd17180544
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/event/IIOReadWarningListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/event/IIOWriteProgressListener.class b/libjava/classpath/lib/javax/imageio/event/IIOWriteProgressListener.class
new file mode 100644
index 00000000000..af4114f6b89
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/event/IIOWriteProgressListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/event/IIOWriteWarningListener.class b/libjava/classpath/lib/javax/imageio/event/IIOWriteWarningListener.class
new file mode 100644
index 00000000000..afede8bf4c4
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/event/IIOWriteWarningListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOInvalidTreeException.class b/libjava/classpath/lib/javax/imageio/metadata/IIOInvalidTreeException.class
new file mode 100644
index 00000000000..e2150693617
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOInvalidTreeException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadata.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadata.class
new file mode 100644
index 00000000000..46f34c55403
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadata.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataController.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataController.class
new file mode 100644
index 00000000000..f90f96d1287
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataController.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormat.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormat.class
new file mode 100644
index 00000000000..299f194e3eb
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$1.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$1.class
new file mode 100644
index 00000000000..e6b32672048
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttr.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttr.class
new file mode 100644
index 00000000000..8da0e36d9cf
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttr.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttrBounded.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttrBounded.class
new file mode 100644
index 00000000000..f70d44e42ad
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttrBounded.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttrEnumerated.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttrEnumerated.class
new file mode 100644
index 00000000000..6e9c99c5837
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttrEnumerated.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttrList.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttrList.class
new file mode 100644
index 00000000000..3139d38fe53
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$IIOMetadataNodeAttrList.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObject.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObject.class
new file mode 100644
index 00000000000..c6ddf8ed845
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObject.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObjectArray.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObjectArray.class
new file mode 100644
index 00000000000..507733cb086
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObjectArray.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObjectBounded.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObjectBounded.class
new file mode 100644
index 00000000000..b36a4835394
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObjectBounded.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObjectEnumerated.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObjectEnumerated.class
new file mode 100644
index 00000000000..3b7e3b4c44f
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl$NodeObjectEnumerated.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl.class
new file mode 100644
index 00000000000..eebc68bb4a6
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataFormatImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataNode$IIONamedNodeMap.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataNode$IIONamedNodeMap.class
new file mode 100644
index 00000000000..a8e43ee3f3f
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataNode$IIONamedNodeMap.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataNode$IIONodeList.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataNode$IIONodeList.class
new file mode 100644
index 00000000000..cf8c8f501a5
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataNode$IIONodeList.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataNode.class b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataNode.class
new file mode 100644
index 00000000000..001f1ff7db2
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/metadata/IIOMetadataNode.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/plugins/bmp/BMPImageWriteParam.class b/libjava/classpath/lib/javax/imageio/plugins/bmp/BMPImageWriteParam.class
new file mode 100644
index 00000000000..7701cf88b71
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/plugins/bmp/BMPImageWriteParam.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGHuffmanTable.class b/libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGHuffmanTable.class
new file mode 100644
index 00000000000..deac559a02a
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGHuffmanTable.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGImageReadParam.class b/libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGImageReadParam.class
new file mode 100644
index 00000000000..ba2a146aa6e
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGImageReadParam.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGImageWriteParam.class b/libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGImageWriteParam.class
new file mode 100644
index 00000000000..c734fcb59c4
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGImageWriteParam.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGQTable.class b/libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGQTable.class
new file mode 100644
index 00000000000..6f6d57646a1
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/plugins/jpeg/JPEGQTable.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/spi/IIORegistry.class b/libjava/classpath/lib/javax/imageio/spi/IIORegistry.class
new file mode 100644
index 00000000000..45073b1d67e
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/spi/IIORegistry.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/spi/IIOServiceProvider.class b/libjava/classpath/lib/javax/imageio/spi/IIOServiceProvider.class
new file mode 100644
index 00000000000..0d39087a442
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/spi/IIOServiceProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/spi/ImageInputStreamSpi.class b/libjava/classpath/lib/javax/imageio/spi/ImageInputStreamSpi.class
new file mode 100644
index 00000000000..32ba8ebfc73
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/spi/ImageInputStreamSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/spi/ImageOutputStreamSpi.class b/libjava/classpath/lib/javax/imageio/spi/ImageOutputStreamSpi.class
new file mode 100644
index 00000000000..fedcfb430cc
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/spi/ImageOutputStreamSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/spi/ImageReaderSpi.class b/libjava/classpath/lib/javax/imageio/spi/ImageReaderSpi.class
new file mode 100644
index 00000000000..4dc323ad9be
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/spi/ImageReaderSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/spi/ImageReaderWriterSpi.class b/libjava/classpath/lib/javax/imageio/spi/ImageReaderWriterSpi.class
new file mode 100644
index 00000000000..60acc54c65b
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/spi/ImageReaderWriterSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/spi/ImageTranscoderSpi.class b/libjava/classpath/lib/javax/imageio/spi/ImageTranscoderSpi.class
new file mode 100644
index 00000000000..7eee7996bf8
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/spi/ImageTranscoderSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/spi/ImageWriterSpi.class b/libjava/classpath/lib/javax/imageio/spi/ImageWriterSpi.class
new file mode 100644
index 00000000000..2c17ba4d7c4
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/spi/ImageWriterSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/spi/RegisterableService.class b/libjava/classpath/lib/javax/imageio/spi/RegisterableService.class
new file mode 100644
index 00000000000..15fec31a076
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/spi/RegisterableService.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/spi/ServiceRegistry$1.class b/libjava/classpath/lib/javax/imageio/spi/ServiceRegistry$1.class
new file mode 100644
index 00000000000..3cf058c554e
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/spi/ServiceRegistry$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/spi/ServiceRegistry$2.class b/libjava/classpath/lib/javax/imageio/spi/ServiceRegistry$2.class
new file mode 100644
index 00000000000..bec3d35381a
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/spi/ServiceRegistry$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/spi/ServiceRegistry$Filter.class b/libjava/classpath/lib/javax/imageio/spi/ServiceRegistry$Filter.class
new file mode 100644
index 00000000000..e4a7a55a6e5
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/spi/ServiceRegistry$Filter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/spi/ServiceRegistry.class b/libjava/classpath/lib/javax/imageio/spi/ServiceRegistry.class
new file mode 100644
index 00000000000..dddf6f4f268
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/spi/ServiceRegistry.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/stream/FileCacheImageInputStream.class b/libjava/classpath/lib/javax/imageio/stream/FileCacheImageInputStream.class
new file mode 100644
index 00000000000..b82fdb238a1
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/stream/FileCacheImageInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/stream/FileCacheImageOutputStream.class b/libjava/classpath/lib/javax/imageio/stream/FileCacheImageOutputStream.class
new file mode 100644
index 00000000000..2bb32b78c71
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/stream/FileCacheImageOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/stream/FileImageInputStream.class b/libjava/classpath/lib/javax/imageio/stream/FileImageInputStream.class
new file mode 100644
index 00000000000..2c152b1bff8
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/stream/FileImageInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/stream/FileImageOutputStream.class b/libjava/classpath/lib/javax/imageio/stream/FileImageOutputStream.class
new file mode 100644
index 00000000000..a2d425acf49
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/stream/FileImageOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/stream/IIOByteBuffer.class b/libjava/classpath/lib/javax/imageio/stream/IIOByteBuffer.class
new file mode 100644
index 00000000000..204cbc83ef4
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/stream/IIOByteBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/stream/ImageInputStream.class b/libjava/classpath/lib/javax/imageio/stream/ImageInputStream.class
new file mode 100644
index 00000000000..40ddeaade68
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/stream/ImageInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/stream/ImageInputStreamImpl.class b/libjava/classpath/lib/javax/imageio/stream/ImageInputStreamImpl.class
new file mode 100644
index 00000000000..ae7a2ba72cb
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/stream/ImageInputStreamImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/stream/ImageOutputStream.class b/libjava/classpath/lib/javax/imageio/stream/ImageOutputStream.class
new file mode 100644
index 00000000000..391b332fae0
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/stream/ImageOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/stream/ImageOutputStreamImpl.class b/libjava/classpath/lib/javax/imageio/stream/ImageOutputStreamImpl.class
new file mode 100644
index 00000000000..dccf1f36f54
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/stream/ImageOutputStreamImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/stream/MemoryCacheImageInputStream.class b/libjava/classpath/lib/javax/imageio/stream/MemoryCacheImageInputStream.class
new file mode 100644
index 00000000000..57dc68de425
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/stream/MemoryCacheImageInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/imageio/stream/MemoryCacheImageOutputStream.class b/libjava/classpath/lib/javax/imageio/stream/MemoryCacheImageOutputStream.class
new file mode 100644
index 00000000000..803f2fbed63
--- /dev/null
+++ b/libjava/classpath/lib/javax/imageio/stream/MemoryCacheImageOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/Attribute.class b/libjava/classpath/lib/javax/management/Attribute.class
new file mode 100644
index 00000000000..a0f23785227
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/Attribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/AttributeList.class b/libjava/classpath/lib/javax/management/AttributeList.class
new file mode 100644
index 00000000000..528918c72bf
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/AttributeList.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/AttributeNotFoundException.class b/libjava/classpath/lib/javax/management/AttributeNotFoundException.class
new file mode 100644
index 00000000000..d9b80fd651d
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/AttributeNotFoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/BadAttributeValueExpException.class b/libjava/classpath/lib/javax/management/BadAttributeValueExpException.class
new file mode 100644
index 00000000000..976da8c0b64
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/BadAttributeValueExpException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/BadBinaryOpValueExpException.class b/libjava/classpath/lib/javax/management/BadBinaryOpValueExpException.class
new file mode 100644
index 00000000000..3955b88fc4f
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/BadBinaryOpValueExpException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/BadStringOperationException.class b/libjava/classpath/lib/javax/management/BadStringOperationException.class
new file mode 100644
index 00000000000..859d5a05384
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/BadStringOperationException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/DynamicMBean.class b/libjava/classpath/lib/javax/management/DynamicMBean.class
new file mode 100644
index 00000000000..e4925e8ac22
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/DynamicMBean.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/InstanceAlreadyExistsException.class b/libjava/classpath/lib/javax/management/InstanceAlreadyExistsException.class
new file mode 100644
index 00000000000..98027dce75a
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/InstanceAlreadyExistsException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/InstanceNotFoundException.class b/libjava/classpath/lib/javax/management/InstanceNotFoundException.class
new file mode 100644
index 00000000000..1eb9c9bf5ee
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/InstanceNotFoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/IntrospectionException.class b/libjava/classpath/lib/javax/management/IntrospectionException.class
new file mode 100644
index 00000000000..8c17c2519a2
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/IntrospectionException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/InvalidApplicationException.class b/libjava/classpath/lib/javax/management/InvalidApplicationException.class
new file mode 100644
index 00000000000..f860adebc4e
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/InvalidApplicationException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/InvalidAttributeValueException.class b/libjava/classpath/lib/javax/management/InvalidAttributeValueException.class
new file mode 100644
index 00000000000..fad97385897
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/InvalidAttributeValueException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/JMException.class b/libjava/classpath/lib/javax/management/JMException.class
new file mode 100644
index 00000000000..3a39a421acf
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/JMException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/JMRuntimeException.class b/libjava/classpath/lib/javax/management/JMRuntimeException.class
new file mode 100644
index 00000000000..a9eacfda8c1
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/JMRuntimeException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/ListenerNotFoundException.class b/libjava/classpath/lib/javax/management/ListenerNotFoundException.class
new file mode 100644
index 00000000000..e66803ae19c
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/ListenerNotFoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanAttributeInfo.class b/libjava/classpath/lib/javax/management/MBeanAttributeInfo.class
new file mode 100644
index 00000000000..a5626b8a963
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanAttributeInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanConstructorInfo.class b/libjava/classpath/lib/javax/management/MBeanConstructorInfo.class
new file mode 100644
index 00000000000..4933f493244
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanConstructorInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanException.class b/libjava/classpath/lib/javax/management/MBeanException.class
new file mode 100644
index 00000000000..02d6dd6acdd
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanFeatureInfo.class b/libjava/classpath/lib/javax/management/MBeanFeatureInfo.class
new file mode 100644
index 00000000000..2c240dc4050
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanFeatureInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanInfo.class b/libjava/classpath/lib/javax/management/MBeanInfo.class
new file mode 100644
index 00000000000..9af29328708
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanNotificationInfo.class b/libjava/classpath/lib/javax/management/MBeanNotificationInfo.class
new file mode 100644
index 00000000000..af9c8cb3311
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanNotificationInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanOperationInfo.class b/libjava/classpath/lib/javax/management/MBeanOperationInfo.class
new file mode 100644
index 00000000000..522a1c0c1f5
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanOperationInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanParameterInfo.class b/libjava/classpath/lib/javax/management/MBeanParameterInfo.class
new file mode 100644
index 00000000000..59c7b922145
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanParameterInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanPermission$NameHolder.class b/libjava/classpath/lib/javax/management/MBeanPermission$NameHolder.class
new file mode 100644
index 00000000000..4610dca6635
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanPermission$NameHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanPermission.class b/libjava/classpath/lib/javax/management/MBeanPermission.class
new file mode 100644
index 00000000000..15151ce5108
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanRegistration.class b/libjava/classpath/lib/javax/management/MBeanRegistration.class
new file mode 100644
index 00000000000..8c07efc3c59
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanRegistration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanRegistrationException.class b/libjava/classpath/lib/javax/management/MBeanRegistrationException.class
new file mode 100644
index 00000000000..bb7a8a763d9
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanRegistrationException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanServer.class b/libjava/classpath/lib/javax/management/MBeanServer.class
new file mode 100644
index 00000000000..11945828739
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanServer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanServerBuilder.class b/libjava/classpath/lib/javax/management/MBeanServerBuilder.class
new file mode 100644
index 00000000000..efb5e6c958b
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanServerBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanServerConnection.class b/libjava/classpath/lib/javax/management/MBeanServerConnection.class
new file mode 100644
index 00000000000..2ca079e125e
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanServerConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanServerDelegate.class b/libjava/classpath/lib/javax/management/MBeanServerDelegate.class
new file mode 100644
index 00000000000..325af96c49c
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanServerDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanServerDelegateMBean.class b/libjava/classpath/lib/javax/management/MBeanServerDelegateMBean.class
new file mode 100644
index 00000000000..c607f165048
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanServerDelegateMBean.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanServerFactory.class b/libjava/classpath/lib/javax/management/MBeanServerFactory.class
new file mode 100644
index 00000000000..a0c655b84d0
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanServerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanServerNotification.class b/libjava/classpath/lib/javax/management/MBeanServerNotification.class
new file mode 100644
index 00000000000..ca952560dbc
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanServerNotification.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanServerPermission$MBeanServerPermissionCollection$MBeanServerPermissionEnumeration.class b/libjava/classpath/lib/javax/management/MBeanServerPermission$MBeanServerPermissionCollection$MBeanServerPermissionEnumeration.class
new file mode 100644
index 00000000000..9d6fed42a07
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanServerPermission$MBeanServerPermissionCollection$MBeanServerPermissionEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanServerPermission$MBeanServerPermissionCollection.class b/libjava/classpath/lib/javax/management/MBeanServerPermission$MBeanServerPermissionCollection.class
new file mode 100644
index 00000000000..272e8d375ad
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanServerPermission$MBeanServerPermissionCollection.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanServerPermission.class b/libjava/classpath/lib/javax/management/MBeanServerPermission.class
new file mode 100644
index 00000000000..e69173d14d8
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanServerPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MBeanTrustPermission.class b/libjava/classpath/lib/javax/management/MBeanTrustPermission.class
new file mode 100644
index 00000000000..e5d22c9677b
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MBeanTrustPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/MalformedObjectNameException.class b/libjava/classpath/lib/javax/management/MalformedObjectNameException.class
new file mode 100644
index 00000000000..d8e56b667ee
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/MalformedObjectNameException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/NotCompliantMBeanException.class b/libjava/classpath/lib/javax/management/NotCompliantMBeanException.class
new file mode 100644
index 00000000000..385f6b147da
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/NotCompliantMBeanException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/Notification.class b/libjava/classpath/lib/javax/management/Notification.class
new file mode 100644
index 00000000000..1518fdcbed9
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/Notification.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/NotificationBroadcaster.class b/libjava/classpath/lib/javax/management/NotificationBroadcaster.class
new file mode 100644
index 00000000000..8127d65562e
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/NotificationBroadcaster.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/NotificationEmitter.class b/libjava/classpath/lib/javax/management/NotificationEmitter.class
new file mode 100644
index 00000000000..b062f01fd59
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/NotificationEmitter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/NotificationFilter.class b/libjava/classpath/lib/javax/management/NotificationFilter.class
new file mode 100644
index 00000000000..9474e578153
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/NotificationFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/NotificationListener.class b/libjava/classpath/lib/javax/management/NotificationListener.class
new file mode 100644
index 00000000000..cbe2f1f58b3
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/NotificationListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/ObjectInstance.class b/libjava/classpath/lib/javax/management/ObjectInstance.class
new file mode 100644
index 00000000000..5ab7cb91930
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/ObjectInstance.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/ObjectName.class b/libjava/classpath/lib/javax/management/ObjectName.class
new file mode 100644
index 00000000000..9a94089fc8d
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/ObjectName.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/OperationsException.class b/libjava/classpath/lib/javax/management/OperationsException.class
new file mode 100644
index 00000000000..09e6c442154
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/OperationsException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/QueryExp.class b/libjava/classpath/lib/javax/management/QueryExp.class
new file mode 100644
index 00000000000..b999c482151
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/QueryExp.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/ReflectionException.class b/libjava/classpath/lib/javax/management/ReflectionException.class
new file mode 100644
index 00000000000..141b664e1e5
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/ReflectionException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/RuntimeErrorException.class b/libjava/classpath/lib/javax/management/RuntimeErrorException.class
new file mode 100644
index 00000000000..35c82a6c747
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/RuntimeErrorException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/RuntimeMBeanException.class b/libjava/classpath/lib/javax/management/RuntimeMBeanException.class
new file mode 100644
index 00000000000..a141ad87a00
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/RuntimeMBeanException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/RuntimeOperationsException.class b/libjava/classpath/lib/javax/management/RuntimeOperationsException.class
new file mode 100644
index 00000000000..ffa48a77523
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/RuntimeOperationsException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/ServiceNotFoundException.class b/libjava/classpath/lib/javax/management/ServiceNotFoundException.class
new file mode 100644
index 00000000000..25c4b5cb304
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/ServiceNotFoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/StandardMBean.class b/libjava/classpath/lib/javax/management/StandardMBean.class
new file mode 100644
index 00000000000..7657a32b757
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/StandardMBean.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/ValueExp.class b/libjava/classpath/lib/javax/management/ValueExp.class
new file mode 100644
index 00000000000..d90e781cc44
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/ValueExp.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/loading/ClassLoaderRepository.class b/libjava/classpath/lib/javax/management/loading/ClassLoaderRepository.class
new file mode 100644
index 00000000000..493e9d2f9ff
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/loading/ClassLoaderRepository.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/ArrayType.class b/libjava/classpath/lib/javax/management/openmbean/ArrayType.class
new file mode 100644
index 00000000000..888874a904d
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/ArrayType.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/CompositeData.class b/libjava/classpath/lib/javax/management/openmbean/CompositeData.class
new file mode 100644
index 00000000000..8cd4c3c633d
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/CompositeData.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/CompositeDataSupport.class b/libjava/classpath/lib/javax/management/openmbean/CompositeDataSupport.class
new file mode 100644
index 00000000000..c5e4d5f922f
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/CompositeDataSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/CompositeType.class b/libjava/classpath/lib/javax/management/openmbean/CompositeType.class
new file mode 100644
index 00000000000..3ed4d991f08
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/CompositeType.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/InvalidKeyException.class b/libjava/classpath/lib/javax/management/openmbean/InvalidKeyException.class
new file mode 100644
index 00000000000..6b0b1fec5e8
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/InvalidKeyException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/InvalidOpenTypeException.class b/libjava/classpath/lib/javax/management/openmbean/InvalidOpenTypeException.class
new file mode 100644
index 00000000000..4fba7ac4312
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/InvalidOpenTypeException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/KeyAlreadyExistsException.class b/libjava/classpath/lib/javax/management/openmbean/KeyAlreadyExistsException.class
new file mode 100644
index 00000000000..7ec6ca7868f
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/KeyAlreadyExistsException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/OpenDataException.class b/libjava/classpath/lib/javax/management/openmbean/OpenDataException.class
new file mode 100644
index 00000000000..076ed20e9f2
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/OpenDataException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/OpenMBeanAttributeInfo.class b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanAttributeInfo.class
new file mode 100644
index 00000000000..0ac220955a7
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanAttributeInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/OpenMBeanAttributeInfoSupport.class b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanAttributeInfoSupport.class
new file mode 100644
index 00000000000..8aec0490a78
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanAttributeInfoSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/OpenMBeanConstructorInfo.class b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanConstructorInfo.class
new file mode 100644
index 00000000000..2a6a6265073
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanConstructorInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/OpenMBeanConstructorInfoSupport.class b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanConstructorInfoSupport.class
new file mode 100644
index 00000000000..75bdacc524e
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanConstructorInfoSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/OpenMBeanInfo.class b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanInfo.class
new file mode 100644
index 00000000000..8d04a395e0f
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/OpenMBeanInfoSupport.class b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanInfoSupport.class
new file mode 100644
index 00000000000..7e4265d3d42
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanInfoSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/OpenMBeanOperationInfo.class b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanOperationInfo.class
new file mode 100644
index 00000000000..5e6fd06fb23
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanOperationInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/OpenMBeanOperationInfoSupport.class b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanOperationInfoSupport.class
new file mode 100644
index 00000000000..93ed4002ab6
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanOperationInfoSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/OpenMBeanParameterInfo.class b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanParameterInfo.class
new file mode 100644
index 00000000000..b360ed8fe52
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanParameterInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/OpenMBeanParameterInfoSupport.class b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanParameterInfoSupport.class
new file mode 100644
index 00000000000..59ef03786b2
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/OpenMBeanParameterInfoSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/OpenType.class b/libjava/classpath/lib/javax/management/openmbean/OpenType.class
new file mode 100644
index 00000000000..689f1ccf631
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/OpenType.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/SimpleType.class b/libjava/classpath/lib/javax/management/openmbean/SimpleType.class
new file mode 100644
index 00000000000..c33e9089c81
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/SimpleType.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/TabularData.class b/libjava/classpath/lib/javax/management/openmbean/TabularData.class
new file mode 100644
index 00000000000..c6a70eaf474
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/TabularData.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/TabularDataSupport.class b/libjava/classpath/lib/javax/management/openmbean/TabularDataSupport.class
new file mode 100644
index 00000000000..c940083ba28
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/TabularDataSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/management/openmbean/TabularType.class b/libjava/classpath/lib/javax/management/openmbean/TabularType.class
new file mode 100644
index 00000000000..c287c124107
--- /dev/null
+++ b/libjava/classpath/lib/javax/management/openmbean/TabularType.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/AuthenticationException.class b/libjava/classpath/lib/javax/naming/AuthenticationException.class
new file mode 100644
index 00000000000..84033a0442a
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/AuthenticationException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/AuthenticationNotSupportedException.class b/libjava/classpath/lib/javax/naming/AuthenticationNotSupportedException.class
new file mode 100644
index 00000000000..99f2374a131
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/AuthenticationNotSupportedException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/BinaryRefAddr.class b/libjava/classpath/lib/javax/naming/BinaryRefAddr.class
new file mode 100644
index 00000000000..8856b981f0b
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/BinaryRefAddr.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/Binding.class b/libjava/classpath/lib/javax/naming/Binding.class
new file mode 100644
index 00000000000..9ae8c3128fe
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/Binding.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/CannotProceedException.class b/libjava/classpath/lib/javax/naming/CannotProceedException.class
new file mode 100644
index 00000000000..8c66162cf75
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/CannotProceedException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/CommunicationException.class b/libjava/classpath/lib/javax/naming/CommunicationException.class
new file mode 100644
index 00000000000..6f1a73dbe33
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/CommunicationException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/CompositeName.class b/libjava/classpath/lib/javax/naming/CompositeName.class
new file mode 100644
index 00000000000..2a19869ac0d
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/CompositeName.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/CompoundName.class b/libjava/classpath/lib/javax/naming/CompoundName.class
new file mode 100644
index 00000000000..39592b0d194
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/CompoundName.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ConfigurationException.class b/libjava/classpath/lib/javax/naming/ConfigurationException.class
new file mode 100644
index 00000000000..56516219b70
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ConfigurationException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/Context.class b/libjava/classpath/lib/javax/naming/Context.class
new file mode 100644
index 00000000000..be82e6fecac
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/Context.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ContextNotEmptyException.class b/libjava/classpath/lib/javax/naming/ContextNotEmptyException.class
new file mode 100644
index 00000000000..3cd3d5e501e
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ContextNotEmptyException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/InitialContext.class b/libjava/classpath/lib/javax/naming/InitialContext.class
new file mode 100644
index 00000000000..a21349cc727
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/InitialContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/InsufficientResourcesException.class b/libjava/classpath/lib/javax/naming/InsufficientResourcesException.class
new file mode 100644
index 00000000000..7f89a0e9908
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/InsufficientResourcesException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/InterruptedNamingException.class b/libjava/classpath/lib/javax/naming/InterruptedNamingException.class
new file mode 100644
index 00000000000..b793d470767
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/InterruptedNamingException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/InvalidNameException.class b/libjava/classpath/lib/javax/naming/InvalidNameException.class
new file mode 100644
index 00000000000..f7e94ba0c91
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/InvalidNameException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/LimitExceededException.class b/libjava/classpath/lib/javax/naming/LimitExceededException.class
new file mode 100644
index 00000000000..6134203cde4
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/LimitExceededException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/LinkException.class b/libjava/classpath/lib/javax/naming/LinkException.class
new file mode 100644
index 00000000000..f95ae0fed58
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/LinkException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/LinkLoopException.class b/libjava/classpath/lib/javax/naming/LinkLoopException.class
new file mode 100644
index 00000000000..b7ff39f8a47
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/LinkLoopException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/LinkRef.class b/libjava/classpath/lib/javax/naming/LinkRef.class
new file mode 100644
index 00000000000..05641654973
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/LinkRef.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/MalformedLinkException.class b/libjava/classpath/lib/javax/naming/MalformedLinkException.class
new file mode 100644
index 00000000000..3456233271d
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/MalformedLinkException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/Name.class b/libjava/classpath/lib/javax/naming/Name.class
new file mode 100644
index 00000000000..ef74c5e0b48
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/Name.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/NameAlreadyBoundException.class b/libjava/classpath/lib/javax/naming/NameAlreadyBoundException.class
new file mode 100644
index 00000000000..e3a8722e016
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/NameAlreadyBoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/NameClassPair.class b/libjava/classpath/lib/javax/naming/NameClassPair.class
new file mode 100644
index 00000000000..faae87c5e78
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/NameClassPair.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/NameNotFoundException.class b/libjava/classpath/lib/javax/naming/NameNotFoundException.class
new file mode 100644
index 00000000000..b8df4897ffa
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/NameNotFoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/NameParser.class b/libjava/classpath/lib/javax/naming/NameParser.class
new file mode 100644
index 00000000000..f01ed0b438a
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/NameParser.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/NamingEnumeration.class b/libjava/classpath/lib/javax/naming/NamingEnumeration.class
new file mode 100644
index 00000000000..98b80ceac0b
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/NamingEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/NamingException.class b/libjava/classpath/lib/javax/naming/NamingException.class
new file mode 100644
index 00000000000..52bdc3ef577
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/NamingException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/NamingSecurityException.class b/libjava/classpath/lib/javax/naming/NamingSecurityException.class
new file mode 100644
index 00000000000..f5f6930d8eb
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/NamingSecurityException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/NoInitialContextException.class b/libjava/classpath/lib/javax/naming/NoInitialContextException.class
new file mode 100644
index 00000000000..db9a945b47f
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/NoInitialContextException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/NoPermissionException.class b/libjava/classpath/lib/javax/naming/NoPermissionException.class
new file mode 100644
index 00000000000..25283ea4c50
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/NoPermissionException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/NotContextException.class b/libjava/classpath/lib/javax/naming/NotContextException.class
new file mode 100644
index 00000000000..80de75b5ee0
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/NotContextException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/OperationNotSupportedException.class b/libjava/classpath/lib/javax/naming/OperationNotSupportedException.class
new file mode 100644
index 00000000000..96d5ccde381
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/OperationNotSupportedException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/PartialResultException.class b/libjava/classpath/lib/javax/naming/PartialResultException.class
new file mode 100644
index 00000000000..291861fed24
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/PartialResultException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/RefAddr.class b/libjava/classpath/lib/javax/naming/RefAddr.class
new file mode 100644
index 00000000000..b85b848d497
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/RefAddr.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/Reference.class b/libjava/classpath/lib/javax/naming/Reference.class
new file mode 100644
index 00000000000..9f0c298dd86
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/Reference.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/Referenceable.class b/libjava/classpath/lib/javax/naming/Referenceable.class
new file mode 100644
index 00000000000..abee698e4d8
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/Referenceable.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ReferralException.class b/libjava/classpath/lib/javax/naming/ReferralException.class
new file mode 100644
index 00000000000..83c91264e3e
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ReferralException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ServiceUnavailableException.class b/libjava/classpath/lib/javax/naming/ServiceUnavailableException.class
new file mode 100644
index 00000000000..10fca7100f3
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ServiceUnavailableException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/SizeLimitExceededException.class b/libjava/classpath/lib/javax/naming/SizeLimitExceededException.class
new file mode 100644
index 00000000000..e5e027437a4
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/SizeLimitExceededException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/StringRefAddr.class b/libjava/classpath/lib/javax/naming/StringRefAddr.class
new file mode 100644
index 00000000000..86f8f80dd61
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/StringRefAddr.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/TimeLimitExceededException.class b/libjava/classpath/lib/javax/naming/TimeLimitExceededException.class
new file mode 100644
index 00000000000..9d9db128301
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/TimeLimitExceededException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/Attribute.class b/libjava/classpath/lib/javax/naming/directory/Attribute.class
new file mode 100644
index 00000000000..4ea25b876b6
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/Attribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/AttributeInUseException.class b/libjava/classpath/lib/javax/naming/directory/AttributeInUseException.class
new file mode 100644
index 00000000000..c7cae1e8a13
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/AttributeInUseException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/AttributeModificationException.class b/libjava/classpath/lib/javax/naming/directory/AttributeModificationException.class
new file mode 100644
index 00000000000..eb8b7052da5
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/AttributeModificationException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/Attributes.class b/libjava/classpath/lib/javax/naming/directory/Attributes.class
new file mode 100644
index 00000000000..737594d3351
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/Attributes.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/BasicAttribute$BasicAttributeEnumeration.class b/libjava/classpath/lib/javax/naming/directory/BasicAttribute$BasicAttributeEnumeration.class
new file mode 100644
index 00000000000..7238d60114d
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/BasicAttribute$BasicAttributeEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/BasicAttribute.class b/libjava/classpath/lib/javax/naming/directory/BasicAttribute.class
new file mode 100644
index 00000000000..15edbd82cf0
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/BasicAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/BasicAttributes$BasicAttributesEnumeration.class b/libjava/classpath/lib/javax/naming/directory/BasicAttributes$BasicAttributesEnumeration.class
new file mode 100644
index 00000000000..58864679714
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/BasicAttributes$BasicAttributesEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/BasicAttributes.class b/libjava/classpath/lib/javax/naming/directory/BasicAttributes.class
new file mode 100644
index 00000000000..20e9428e614
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/BasicAttributes.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/DirContext.class b/libjava/classpath/lib/javax/naming/directory/DirContext.class
new file mode 100644
index 00000000000..fdfc3bdc023
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/DirContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/InitialDirContext.class b/libjava/classpath/lib/javax/naming/directory/InitialDirContext.class
new file mode 100644
index 00000000000..cbf5f511a11
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/InitialDirContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/InvalidAttributeIdentifierException.class b/libjava/classpath/lib/javax/naming/directory/InvalidAttributeIdentifierException.class
new file mode 100644
index 00000000000..611da11bace
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/InvalidAttributeIdentifierException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/InvalidAttributeValueException.class b/libjava/classpath/lib/javax/naming/directory/InvalidAttributeValueException.class
new file mode 100644
index 00000000000..8b1f9e5314b
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/InvalidAttributeValueException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/InvalidAttributesException.class b/libjava/classpath/lib/javax/naming/directory/InvalidAttributesException.class
new file mode 100644
index 00000000000..21c061caa99
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/InvalidAttributesException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/InvalidSearchControlsException.class b/libjava/classpath/lib/javax/naming/directory/InvalidSearchControlsException.class
new file mode 100644
index 00000000000..8047bb0cbc0
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/InvalidSearchControlsException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/InvalidSearchFilterException.class b/libjava/classpath/lib/javax/naming/directory/InvalidSearchFilterException.class
new file mode 100644
index 00000000000..7bc6065d111
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/InvalidSearchFilterException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/ModificationItem.class b/libjava/classpath/lib/javax/naming/directory/ModificationItem.class
new file mode 100644
index 00000000000..0ac083b06df
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/ModificationItem.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/NoSuchAttributeException.class b/libjava/classpath/lib/javax/naming/directory/NoSuchAttributeException.class
new file mode 100644
index 00000000000..108c9ca19d9
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/NoSuchAttributeException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/SchemaViolationException.class b/libjava/classpath/lib/javax/naming/directory/SchemaViolationException.class
new file mode 100644
index 00000000000..9c766a1ee5c
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/SchemaViolationException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/SearchControls.class b/libjava/classpath/lib/javax/naming/directory/SearchControls.class
new file mode 100644
index 00000000000..7df5cffd843
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/SearchControls.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/directory/SearchResult.class b/libjava/classpath/lib/javax/naming/directory/SearchResult.class
new file mode 100644
index 00000000000..54e75caeaf7
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/directory/SearchResult.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/event/EventContext.class b/libjava/classpath/lib/javax/naming/event/EventContext.class
new file mode 100644
index 00000000000..8585af593f0
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/event/EventContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/event/EventDirContext.class b/libjava/classpath/lib/javax/naming/event/EventDirContext.class
new file mode 100644
index 00000000000..751d5089715
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/event/EventDirContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/event/NamespaceChangeListener.class b/libjava/classpath/lib/javax/naming/event/NamespaceChangeListener.class
new file mode 100644
index 00000000000..607ab9c49d9
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/event/NamespaceChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/event/NamingEvent.class b/libjava/classpath/lib/javax/naming/event/NamingEvent.class
new file mode 100644
index 00000000000..e1204e83d8d
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/event/NamingEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/event/NamingExceptionEvent.class b/libjava/classpath/lib/javax/naming/event/NamingExceptionEvent.class
new file mode 100644
index 00000000000..0f61df4e1d8
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/event/NamingExceptionEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/event/NamingListener.class b/libjava/classpath/lib/javax/naming/event/NamingListener.class
new file mode 100644
index 00000000000..894376def0c
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/event/NamingListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/event/ObjectChangeListener.class b/libjava/classpath/lib/javax/naming/event/ObjectChangeListener.class
new file mode 100644
index 00000000000..533600d2627
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/event/ObjectChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ldap/Control.class b/libjava/classpath/lib/javax/naming/ldap/Control.class
new file mode 100644
index 00000000000..7f96c9d5eed
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ldap/Control.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ldap/ControlFactory.class b/libjava/classpath/lib/javax/naming/ldap/ControlFactory.class
new file mode 100644
index 00000000000..7248b9932ae
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ldap/ControlFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ldap/ExtendedRequest.class b/libjava/classpath/lib/javax/naming/ldap/ExtendedRequest.class
new file mode 100644
index 00000000000..e7d13c72e32
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ldap/ExtendedRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ldap/ExtendedResponse.class b/libjava/classpath/lib/javax/naming/ldap/ExtendedResponse.class
new file mode 100644
index 00000000000..4abf7ff7864
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ldap/ExtendedResponse.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ldap/HasControls.class b/libjava/classpath/lib/javax/naming/ldap/HasControls.class
new file mode 100644
index 00000000000..2037b418b84
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ldap/HasControls.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ldap/InitialLdapContext.class b/libjava/classpath/lib/javax/naming/ldap/InitialLdapContext.class
new file mode 100644
index 00000000000..413245204b3
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ldap/InitialLdapContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ldap/LdapContext.class b/libjava/classpath/lib/javax/naming/ldap/LdapContext.class
new file mode 100644
index 00000000000..0507a8ec0b9
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ldap/LdapContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ldap/LdapReferralException.class b/libjava/classpath/lib/javax/naming/ldap/LdapReferralException.class
new file mode 100644
index 00000000000..2d53ba7e92d
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ldap/LdapReferralException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ldap/StartTlsRequest.class b/libjava/classpath/lib/javax/naming/ldap/StartTlsRequest.class
new file mode 100644
index 00000000000..028f72bb899
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ldap/StartTlsRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ldap/StartTlsResponse.class b/libjava/classpath/lib/javax/naming/ldap/StartTlsResponse.class
new file mode 100644
index 00000000000..1c62677bdb2
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ldap/StartTlsResponse.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ldap/UnsolicitedNotification.class b/libjava/classpath/lib/javax/naming/ldap/UnsolicitedNotification.class
new file mode 100644
index 00000000000..b329c2bf9a5
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ldap/UnsolicitedNotification.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ldap/UnsolicitedNotificationEvent.class b/libjava/classpath/lib/javax/naming/ldap/UnsolicitedNotificationEvent.class
new file mode 100644
index 00000000000..893585b45e2
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ldap/UnsolicitedNotificationEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/ldap/UnsolicitedNotificationListener.class b/libjava/classpath/lib/javax/naming/ldap/UnsolicitedNotificationListener.class
new file mode 100644
index 00000000000..19234b50e91
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/ldap/UnsolicitedNotificationListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/spi/DirObjectFactory.class b/libjava/classpath/lib/javax/naming/spi/DirObjectFactory.class
new file mode 100644
index 00000000000..f81cb27190e
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/spi/DirObjectFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/spi/DirStateFactory$Result.class b/libjava/classpath/lib/javax/naming/spi/DirStateFactory$Result.class
new file mode 100644
index 00000000000..94051c10e69
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/spi/DirStateFactory$Result.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/spi/DirStateFactory.class b/libjava/classpath/lib/javax/naming/spi/DirStateFactory.class
new file mode 100644
index 00000000000..98be8730539
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/spi/DirStateFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/spi/DirectoryManager.class b/libjava/classpath/lib/javax/naming/spi/DirectoryManager.class
new file mode 100644
index 00000000000..22690420c96
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/spi/DirectoryManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/spi/InitialContextFactory.class b/libjava/classpath/lib/javax/naming/spi/InitialContextFactory.class
new file mode 100644
index 00000000000..643c2803e80
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/spi/InitialContextFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/spi/InitialContextFactoryBuilder.class b/libjava/classpath/lib/javax/naming/spi/InitialContextFactoryBuilder.class
new file mode 100644
index 00000000000..fd2b6a77296
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/spi/InitialContextFactoryBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/spi/NamingManager.class b/libjava/classpath/lib/javax/naming/spi/NamingManager.class
new file mode 100644
index 00000000000..d0da69412ac
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/spi/NamingManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/spi/ObjectFactory.class b/libjava/classpath/lib/javax/naming/spi/ObjectFactory.class
new file mode 100644
index 00000000000..c51bf4fa211
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/spi/ObjectFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/spi/ObjectFactoryBuilder.class b/libjava/classpath/lib/javax/naming/spi/ObjectFactoryBuilder.class
new file mode 100644
index 00000000000..0204736c061
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/spi/ObjectFactoryBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/spi/ResolveResult.class b/libjava/classpath/lib/javax/naming/spi/ResolveResult.class
new file mode 100644
index 00000000000..c0782d68221
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/spi/ResolveResult.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/spi/Resolver.class b/libjava/classpath/lib/javax/naming/spi/Resolver.class
new file mode 100644
index 00000000000..ffe96db71ff
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/spi/Resolver.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/naming/spi/StateFactory.class b/libjava/classpath/lib/javax/naming/spi/StateFactory.class
new file mode 100644
index 00000000000..0ce19e91b59
--- /dev/null
+++ b/libjava/classpath/lib/javax/naming/spi/StateFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ServerSocketFactory.class b/libjava/classpath/lib/javax/net/ServerSocketFactory.class
new file mode 100644
index 00000000000..e568d1ada6c
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ServerSocketFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/SocketFactory.class b/libjava/classpath/lib/javax/net/SocketFactory.class
new file mode 100644
index 00000000000..968ce789554
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/SocketFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/VanillaServerSocketFactory.class b/libjava/classpath/lib/javax/net/VanillaServerSocketFactory.class
new file mode 100644
index 00000000000..13e4e43ba89
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/VanillaServerSocketFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/VanillaSocketFactory.class b/libjava/classpath/lib/javax/net/VanillaSocketFactory.class
new file mode 100644
index 00000000000..5f82c3c3b8f
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/VanillaSocketFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/CertPathTrustManagerParameters.class b/libjava/classpath/lib/javax/net/ssl/CertPathTrustManagerParameters.class
new file mode 100644
index 00000000000..08009ef6259
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/CertPathTrustManagerParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/HandshakeCompletedEvent.class b/libjava/classpath/lib/javax/net/ssl/HandshakeCompletedEvent.class
new file mode 100644
index 00000000000..c368229263d
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/HandshakeCompletedEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/HandshakeCompletedListener.class b/libjava/classpath/lib/javax/net/ssl/HandshakeCompletedListener.class
new file mode 100644
index 00000000000..629e4e835a9
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/HandshakeCompletedListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/HostnameVerifier.class b/libjava/classpath/lib/javax/net/ssl/HostnameVerifier.class
new file mode 100644
index 00000000000..409d9047b4f
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/HostnameVerifier.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/HttpsURLConnection.class b/libjava/classpath/lib/javax/net/ssl/HttpsURLConnection.class
new file mode 100644
index 00000000000..d531508bb79
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/HttpsURLConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/KeyManager.class b/libjava/classpath/lib/javax/net/ssl/KeyManager.class
new file mode 100644
index 00000000000..1a31080d6ee
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/KeyManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/KeyManagerFactory$1.class b/libjava/classpath/lib/javax/net/ssl/KeyManagerFactory$1.class
new file mode 100644
index 00000000000..e67cc75e87a
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/KeyManagerFactory$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/KeyManagerFactory.class b/libjava/classpath/lib/javax/net/ssl/KeyManagerFactory.class
new file mode 100644
index 00000000000..7eb16a275da
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/KeyManagerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/KeyManagerFactorySpi.class b/libjava/classpath/lib/javax/net/ssl/KeyManagerFactorySpi.class
new file mode 100644
index 00000000000..bbb4bb73245
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/KeyManagerFactorySpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/KeyStoreBuilderParameters.class b/libjava/classpath/lib/javax/net/ssl/KeyStoreBuilderParameters.class
new file mode 100644
index 00000000000..79faa07759c
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/KeyStoreBuilderParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/ManagerFactoryParameters.class b/libjava/classpath/lib/javax/net/ssl/ManagerFactoryParameters.class
new file mode 100644
index 00000000000..8cc323af71d
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/ManagerFactoryParameters.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLContext.class b/libjava/classpath/lib/javax/net/ssl/SSLContext.class
new file mode 100644
index 00000000000..e6d4030e129
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLContextSpi.class b/libjava/classpath/lib/javax/net/ssl/SSLContextSpi.class
new file mode 100644
index 00000000000..26f362ee778
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLContextSpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLEngine.class b/libjava/classpath/lib/javax/net/ssl/SSLEngine.class
new file mode 100644
index 00000000000..6ffe9e8153d
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLEngine.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLEngineResult$HandshakeStatus.class b/libjava/classpath/lib/javax/net/ssl/SSLEngineResult$HandshakeStatus.class
new file mode 100644
index 00000000000..7b64db75c37
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLEngineResult$HandshakeStatus.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLEngineResult$Status.class b/libjava/classpath/lib/javax/net/ssl/SSLEngineResult$Status.class
new file mode 100644
index 00000000000..312b09813a5
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLEngineResult$Status.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLEngineResult.class b/libjava/classpath/lib/javax/net/ssl/SSLEngineResult.class
new file mode 100644
index 00000000000..d905e82797d
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLEngineResult.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLException.class b/libjava/classpath/lib/javax/net/ssl/SSLException.class
new file mode 100644
index 00000000000..f8dacf19db0
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLHandshakeException.class b/libjava/classpath/lib/javax/net/ssl/SSLHandshakeException.class
new file mode 100644
index 00000000000..2006a223fce
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLHandshakeException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLKeyException.class b/libjava/classpath/lib/javax/net/ssl/SSLKeyException.class
new file mode 100644
index 00000000000..213166ab461
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLKeyException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLPeerUnverifiedException.class b/libjava/classpath/lib/javax/net/ssl/SSLPeerUnverifiedException.class
new file mode 100644
index 00000000000..75e0c883626
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLPeerUnverifiedException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLPermission.class b/libjava/classpath/lib/javax/net/ssl/SSLPermission.class
new file mode 100644
index 00000000000..73354cfb2c1
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLProtocolException.class b/libjava/classpath/lib/javax/net/ssl/SSLProtocolException.class
new file mode 100644
index 00000000000..0b5d7c4142f
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLProtocolException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLServerSocket.class b/libjava/classpath/lib/javax/net/ssl/SSLServerSocket.class
new file mode 100644
index 00000000000..a802a511459
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLServerSocket.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLServerSocketFactory.class b/libjava/classpath/lib/javax/net/ssl/SSLServerSocketFactory.class
new file mode 100644
index 00000000000..4db450aec78
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLServerSocketFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLSession.class b/libjava/classpath/lib/javax/net/ssl/SSLSession.class
new file mode 100644
index 00000000000..3276a462848
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLSession.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLSessionBindingEvent.class b/libjava/classpath/lib/javax/net/ssl/SSLSessionBindingEvent.class
new file mode 100644
index 00000000000..7b03ca83714
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLSessionBindingEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLSessionBindingListener.class b/libjava/classpath/lib/javax/net/ssl/SSLSessionBindingListener.class
new file mode 100644
index 00000000000..d3683dd7def
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLSessionBindingListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLSessionContext.class b/libjava/classpath/lib/javax/net/ssl/SSLSessionContext.class
new file mode 100644
index 00000000000..7121b99cdab
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLSessionContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLSocket.class b/libjava/classpath/lib/javax/net/ssl/SSLSocket.class
new file mode 100644
index 00000000000..f00becbcde5
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLSocket.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/SSLSocketFactory.class b/libjava/classpath/lib/javax/net/ssl/SSLSocketFactory.class
new file mode 100644
index 00000000000..ef49a9996d8
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/SSLSocketFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/TrivialHostnameVerifier.class b/libjava/classpath/lib/javax/net/ssl/TrivialHostnameVerifier.class
new file mode 100644
index 00000000000..d03d64e9e73
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/TrivialHostnameVerifier.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/TrustManager.class b/libjava/classpath/lib/javax/net/ssl/TrustManager.class
new file mode 100644
index 00000000000..237f8ae654d
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/TrustManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/TrustManagerFactory$1.class b/libjava/classpath/lib/javax/net/ssl/TrustManagerFactory$1.class
new file mode 100644
index 00000000000..023245c4955
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/TrustManagerFactory$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/TrustManagerFactory.class b/libjava/classpath/lib/javax/net/ssl/TrustManagerFactory.class
new file mode 100644
index 00000000000..f7cf2695ee0
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/TrustManagerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/TrustManagerFactorySpi.class b/libjava/classpath/lib/javax/net/ssl/TrustManagerFactorySpi.class
new file mode 100644
index 00000000000..1d8612cba9b
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/TrustManagerFactorySpi.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/X509ExtendedKeyManager.class b/libjava/classpath/lib/javax/net/ssl/X509ExtendedKeyManager.class
new file mode 100644
index 00000000000..9d89fd6167b
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/X509ExtendedKeyManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/X509KeyManager.class b/libjava/classpath/lib/javax/net/ssl/X509KeyManager.class
new file mode 100644
index 00000000000..c13f1ea1f33
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/X509KeyManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/net/ssl/X509TrustManager.class b/libjava/classpath/lib/javax/net/ssl/X509TrustManager.class
new file mode 100644
index 00000000000..a01e85003b9
--- /dev/null
+++ b/libjava/classpath/lib/javax/net/ssl/X509TrustManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/AttributeException.class b/libjava/classpath/lib/javax/print/AttributeException.class
new file mode 100644
index 00000000000..d5278db3139
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/AttributeException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/CancelablePrintJob.class b/libjava/classpath/lib/javax/print/CancelablePrintJob.class
new file mode 100644
index 00000000000..08ae422bf03
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/CancelablePrintJob.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/Doc.class b/libjava/classpath/lib/javax/print/Doc.class
new file mode 100644
index 00000000000..a8cbecdbe79
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/Doc.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/DocFlavor$BYTE_ARRAY.class b/libjava/classpath/lib/javax/print/DocFlavor$BYTE_ARRAY.class
new file mode 100644
index 00000000000..4e168694528
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/DocFlavor$BYTE_ARRAY.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/DocFlavor$CHAR_ARRAY.class b/libjava/classpath/lib/javax/print/DocFlavor$CHAR_ARRAY.class
new file mode 100644
index 00000000000..ffa7a661384
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/DocFlavor$CHAR_ARRAY.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/DocFlavor$INPUT_STREAM.class b/libjava/classpath/lib/javax/print/DocFlavor$INPUT_STREAM.class
new file mode 100644
index 00000000000..64bebbd33de
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/DocFlavor$INPUT_STREAM.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/DocFlavor$READER.class b/libjava/classpath/lib/javax/print/DocFlavor$READER.class
new file mode 100644
index 00000000000..c16b57949ec
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/DocFlavor$READER.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/DocFlavor$SERVICE_FORMATTED.class b/libjava/classpath/lib/javax/print/DocFlavor$SERVICE_FORMATTED.class
new file mode 100644
index 00000000000..4af2c7aba66
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/DocFlavor$SERVICE_FORMATTED.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/DocFlavor$STRING.class b/libjava/classpath/lib/javax/print/DocFlavor$STRING.class
new file mode 100644
index 00000000000..58c114b0761
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/DocFlavor$STRING.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/DocFlavor$URL.class b/libjava/classpath/lib/javax/print/DocFlavor$URL.class
new file mode 100644
index 00000000000..230dce90726
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/DocFlavor$URL.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/DocFlavor.class b/libjava/classpath/lib/javax/print/DocFlavor.class
new file mode 100644
index 00000000000..4edf51019ee
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/DocFlavor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/DocPrintJob.class b/libjava/classpath/lib/javax/print/DocPrintJob.class
new file mode 100644
index 00000000000..a409bde0b35
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/DocPrintJob.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/FlavorException.class b/libjava/classpath/lib/javax/print/FlavorException.class
new file mode 100644
index 00000000000..1963fefb6bc
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/FlavorException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/MultiDoc.class b/libjava/classpath/lib/javax/print/MultiDoc.class
new file mode 100644
index 00000000000..56b380b36f7
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/MultiDoc.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/MultiDocPrintJob.class b/libjava/classpath/lib/javax/print/MultiDocPrintJob.class
new file mode 100644
index 00000000000..4e3fae46108
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/MultiDocPrintJob.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/MultiDocPrintService.class b/libjava/classpath/lib/javax/print/MultiDocPrintService.class
new file mode 100644
index 00000000000..43d52b63a1f
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/MultiDocPrintService.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/PrintException.class b/libjava/classpath/lib/javax/print/PrintException.class
new file mode 100644
index 00000000000..73a3056d765
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/PrintException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/PrintService.class b/libjava/classpath/lib/javax/print/PrintService.class
new file mode 100644
index 00000000000..3eb58635966
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/PrintService.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/PrintServiceLookup.class b/libjava/classpath/lib/javax/print/PrintServiceLookup.class
new file mode 100644
index 00000000000..a8c931f310f
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/PrintServiceLookup.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/ServiceUI.class b/libjava/classpath/lib/javax/print/ServiceUI.class
new file mode 100644
index 00000000000..0c047da7b81
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/ServiceUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/ServiceUIFactory.class b/libjava/classpath/lib/javax/print/ServiceUIFactory.class
new file mode 100644
index 00000000000..b0e7b876233
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/ServiceUIFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/SimpleDoc.class b/libjava/classpath/lib/javax/print/SimpleDoc.class
new file mode 100644
index 00000000000..2f0976e909d
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/SimpleDoc.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/StreamPrintService.class b/libjava/classpath/lib/javax/print/StreamPrintService.class
new file mode 100644
index 00000000000..ea5c7826d5b
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/StreamPrintService.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/StreamPrintServiceFactory.class b/libjava/classpath/lib/javax/print/StreamPrintServiceFactory.class
new file mode 100644
index 00000000000..9d7ebe38ed3
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/StreamPrintServiceFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/URIException.class b/libjava/classpath/lib/javax/print/URIException.class
new file mode 100644
index 00000000000..e6ea533072e
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/URIException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/Attribute.class b/libjava/classpath/lib/javax/print/attribute/Attribute.class
new file mode 100644
index 00000000000..3dca6f70248
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/Attribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/AttributeSet.class b/libjava/classpath/lib/javax/print/attribute/AttributeSet.class
new file mode 100644
index 00000000000..a54b72b3dbe
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/AttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedAttributeSet.class
new file mode 100644
index 00000000000..4cd7fa90e3d
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedDocAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedDocAttributeSet.class
new file mode 100644
index 00000000000..95e45307a4a
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedDocAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedPrintJobAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedPrintJobAttributeSet.class
new file mode 100644
index 00000000000..fab5c6fc274
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedPrintJobAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedPrintRequestAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedPrintRequestAttributeSet.class
new file mode 100644
index 00000000000..37ebb16acd6
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedPrintRequestAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedPrintServiceAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedPrintServiceAttributeSet.class
new file mode 100644
index 00000000000..4cc539d39a6
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$SynchronizedPrintServiceAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiableAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiableAttributeSet.class
new file mode 100644
index 00000000000..2024d152698
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiableAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiableDocAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiableDocAttributeSet.class
new file mode 100644
index 00000000000..6e83f7e560e
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiableDocAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiablePrintJobAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiablePrintJobAttributeSet.class
new file mode 100644
index 00000000000..0f973e1c157
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiablePrintJobAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiablePrintRequestAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiablePrintRequestAttributeSet.class
new file mode 100644
index 00000000000..5bfa550f965
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiablePrintRequestAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiablePrintServiceAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiablePrintServiceAttributeSet.class
new file mode 100644
index 00000000000..43c2682da88
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities$UnmodifiablePrintServiceAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities.class b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities.class
new file mode 100644
index 00000000000..6ee0b8f8c42
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/AttributeSetUtilities.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/DateTimeSyntax.class b/libjava/classpath/lib/javax/print/attribute/DateTimeSyntax.class
new file mode 100644
index 00000000000..6702a30d56d
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/DateTimeSyntax.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/DocAttribute.class b/libjava/classpath/lib/javax/print/attribute/DocAttribute.class
new file mode 100644
index 00000000000..a9367005110
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/DocAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/DocAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/DocAttributeSet.class
new file mode 100644
index 00000000000..43967044299
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/DocAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/EnumSyntax.class b/libjava/classpath/lib/javax/print/attribute/EnumSyntax.class
new file mode 100644
index 00000000000..b5bf3aa663b
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/EnumSyntax.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/HashAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/HashAttributeSet.class
new file mode 100644
index 00000000000..c077322f818
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/HashAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/HashDocAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/HashDocAttributeSet.class
new file mode 100644
index 00000000000..9f30b0ffbde
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/HashDocAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/HashPrintJobAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/HashPrintJobAttributeSet.class
new file mode 100644
index 00000000000..d0da1564d57
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/HashPrintJobAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/HashPrintRequestAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/HashPrintRequestAttributeSet.class
new file mode 100644
index 00000000000..83bb36a64f4
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/HashPrintRequestAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/HashPrintServiceAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/HashPrintServiceAttributeSet.class
new file mode 100644
index 00000000000..18701413dae
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/HashPrintServiceAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/IntegerSyntax.class b/libjava/classpath/lib/javax/print/attribute/IntegerSyntax.class
new file mode 100644
index 00000000000..d0adb1acbfb
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/IntegerSyntax.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/PrintJobAttribute.class b/libjava/classpath/lib/javax/print/attribute/PrintJobAttribute.class
new file mode 100644
index 00000000000..f415ad880a4
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/PrintJobAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/PrintJobAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/PrintJobAttributeSet.class
new file mode 100644
index 00000000000..3e35094df08
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/PrintJobAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/PrintRequestAttribute.class b/libjava/classpath/lib/javax/print/attribute/PrintRequestAttribute.class
new file mode 100644
index 00000000000..37098131e88
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/PrintRequestAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/PrintRequestAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/PrintRequestAttributeSet.class
new file mode 100644
index 00000000000..869a4d59b46
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/PrintRequestAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/PrintServiceAttribute.class b/libjava/classpath/lib/javax/print/attribute/PrintServiceAttribute.class
new file mode 100644
index 00000000000..326ee06c926
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/PrintServiceAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/PrintServiceAttributeSet.class b/libjava/classpath/lib/javax/print/attribute/PrintServiceAttributeSet.class
new file mode 100644
index 00000000000..97a51ec72d9
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/PrintServiceAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/ResolutionSyntax.class b/libjava/classpath/lib/javax/print/attribute/ResolutionSyntax.class
new file mode 100644
index 00000000000..74e84545627
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/ResolutionSyntax.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/SetOfIntegerSyntax$1.class b/libjava/classpath/lib/javax/print/attribute/SetOfIntegerSyntax$1.class
new file mode 100644
index 00000000000..9dde40793b7
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/SetOfIntegerSyntax$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/SetOfIntegerSyntax.class b/libjava/classpath/lib/javax/print/attribute/SetOfIntegerSyntax.class
new file mode 100644
index 00000000000..f25096bb24f
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/SetOfIntegerSyntax.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/Size2DSyntax.class b/libjava/classpath/lib/javax/print/attribute/Size2DSyntax.class
new file mode 100644
index 00000000000..d26205fd844
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/Size2DSyntax.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/SupportedValuesAttribute.class b/libjava/classpath/lib/javax/print/attribute/SupportedValuesAttribute.class
new file mode 100644
index 00000000000..957bc1f1bde
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/SupportedValuesAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/TextSyntax.class b/libjava/classpath/lib/javax/print/attribute/TextSyntax.class
new file mode 100644
index 00000000000..1ebb5f99e85
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/TextSyntax.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/URISyntax.class b/libjava/classpath/lib/javax/print/attribute/URISyntax.class
new file mode 100644
index 00000000000..eb36d72e996
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/URISyntax.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/UnmodifiableSetException.class b/libjava/classpath/lib/javax/print/attribute/UnmodifiableSetException.class
new file mode 100644
index 00000000000..ba0bdb50ef0
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/UnmodifiableSetException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/Chromaticity.class b/libjava/classpath/lib/javax/print/attribute/standard/Chromaticity.class
new file mode 100644
index 00000000000..603f64508e9
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/Chromaticity.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/ColorSupported.class b/libjava/classpath/lib/javax/print/attribute/standard/ColorSupported.class
new file mode 100644
index 00000000000..07ddc1e58e9
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/ColorSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/Compression.class b/libjava/classpath/lib/javax/print/attribute/standard/Compression.class
new file mode 100644
index 00000000000..939a2f3076b
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/Compression.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/Copies.class b/libjava/classpath/lib/javax/print/attribute/standard/Copies.class
new file mode 100644
index 00000000000..a4396ac206e
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/Copies.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/CopiesSupported.class b/libjava/classpath/lib/javax/print/attribute/standard/CopiesSupported.class
new file mode 100644
index 00000000000..ab31fac3aa4
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/CopiesSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/DateTimeAtCompleted.class b/libjava/classpath/lib/javax/print/attribute/standard/DateTimeAtCompleted.class
new file mode 100644
index 00000000000..fc0358e0e8c
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/DateTimeAtCompleted.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/DateTimeAtCreation.class b/libjava/classpath/lib/javax/print/attribute/standard/DateTimeAtCreation.class
new file mode 100644
index 00000000000..c271f6b2b83
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/DateTimeAtCreation.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/DateTimeAtProcessing.class b/libjava/classpath/lib/javax/print/attribute/standard/DateTimeAtProcessing.class
new file mode 100644
index 00000000000..05e1adf2685
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/DateTimeAtProcessing.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/Destination.class b/libjava/classpath/lib/javax/print/attribute/standard/Destination.class
new file mode 100644
index 00000000000..42854c064ff
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/Destination.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/DocumentName.class b/libjava/classpath/lib/javax/print/attribute/standard/DocumentName.class
new file mode 100644
index 00000000000..f55b821572d
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/DocumentName.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/Fidelity.class b/libjava/classpath/lib/javax/print/attribute/standard/Fidelity.class
new file mode 100644
index 00000000000..735ca849113
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/Fidelity.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/Finishings.class b/libjava/classpath/lib/javax/print/attribute/standard/Finishings.class
new file mode 100644
index 00000000000..b53435d2eac
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/Finishings.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobHoldUntil.class b/libjava/classpath/lib/javax/print/attribute/standard/JobHoldUntil.class
new file mode 100644
index 00000000000..a2079e70685
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobHoldUntil.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobImpressions.class b/libjava/classpath/lib/javax/print/attribute/standard/JobImpressions.class
new file mode 100644
index 00000000000..6bac9fa619c
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobImpressions.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobImpressionsCompleted.class b/libjava/classpath/lib/javax/print/attribute/standard/JobImpressionsCompleted.class
new file mode 100644
index 00000000000..83d489cf1b9
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobImpressionsCompleted.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobImpressionsSupported.class b/libjava/classpath/lib/javax/print/attribute/standard/JobImpressionsSupported.class
new file mode 100644
index 00000000000..7eef5dcaac5
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobImpressionsSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobKOctets.class b/libjava/classpath/lib/javax/print/attribute/standard/JobKOctets.class
new file mode 100644
index 00000000000..ff7742995ea
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobKOctets.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobKOctetsProcessed.class b/libjava/classpath/lib/javax/print/attribute/standard/JobKOctetsProcessed.class
new file mode 100644
index 00000000000..560307e27ae
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobKOctetsProcessed.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobKOctetsSupported.class b/libjava/classpath/lib/javax/print/attribute/standard/JobKOctetsSupported.class
new file mode 100644
index 00000000000..8b10d859d5a
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobKOctetsSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobMediaSheets.class b/libjava/classpath/lib/javax/print/attribute/standard/JobMediaSheets.class
new file mode 100644
index 00000000000..adc2d36b1ef
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobMediaSheets.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobMediaSheetsCompleted.class b/libjava/classpath/lib/javax/print/attribute/standard/JobMediaSheetsCompleted.class
new file mode 100644
index 00000000000..84373399de7
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobMediaSheetsCompleted.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobMediaSheetsSupported.class b/libjava/classpath/lib/javax/print/attribute/standard/JobMediaSheetsSupported.class
new file mode 100644
index 00000000000..d631ebbea56
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobMediaSheetsSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobMessageFromOperator.class b/libjava/classpath/lib/javax/print/attribute/standard/JobMessageFromOperator.class
new file mode 100644
index 00000000000..b8d92b9ffeb
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobMessageFromOperator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobName.class b/libjava/classpath/lib/javax/print/attribute/standard/JobName.class
new file mode 100644
index 00000000000..51ad2c12594
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobName.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobOriginatingUserName.class b/libjava/classpath/lib/javax/print/attribute/standard/JobOriginatingUserName.class
new file mode 100644
index 00000000000..6ce758cb64d
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobOriginatingUserName.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobPriority.class b/libjava/classpath/lib/javax/print/attribute/standard/JobPriority.class
new file mode 100644
index 00000000000..f40b9e1af9a
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobPriority.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobPrioritySupported.class b/libjava/classpath/lib/javax/print/attribute/standard/JobPrioritySupported.class
new file mode 100644
index 00000000000..7263fc7d99d
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobPrioritySupported.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobSheets.class b/libjava/classpath/lib/javax/print/attribute/standard/JobSheets.class
new file mode 100644
index 00000000000..61a52d8b767
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobSheets.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobState.class b/libjava/classpath/lib/javax/print/attribute/standard/JobState.class
new file mode 100644
index 00000000000..31a09d87a0d
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobState.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobStateReason.class b/libjava/classpath/lib/javax/print/attribute/standard/JobStateReason.class
new file mode 100644
index 00000000000..12a340af795
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobStateReason.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/JobStateReasons.class b/libjava/classpath/lib/javax/print/attribute/standard/JobStateReasons.class
new file mode 100644
index 00000000000..9098cf72a79
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/JobStateReasons.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/Media.class b/libjava/classpath/lib/javax/print/attribute/standard/Media.class
new file mode 100644
index 00000000000..1d085f90a01
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/Media.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/MediaName.class b/libjava/classpath/lib/javax/print/attribute/standard/MediaName.class
new file mode 100644
index 00000000000..6a5c6e6956b
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/MediaName.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/MediaPrintableArea.class b/libjava/classpath/lib/javax/print/attribute/standard/MediaPrintableArea.class
new file mode 100644
index 00000000000..99c1c1d685d
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/MediaPrintableArea.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$Engineering.class b/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$Engineering.class
new file mode 100644
index 00000000000..abebeb6c64f
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$Engineering.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$ISO.class b/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$ISO.class
new file mode 100644
index 00000000000..7598b9dc31f
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$ISO.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$JIS.class b/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$JIS.class
new file mode 100644
index 00000000000..98cd1417e06
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$JIS.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$NA.class b/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$NA.class
new file mode 100644
index 00000000000..755264937f7
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$NA.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$Other.class b/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$Other.class
new file mode 100644
index 00000000000..3f1464a1681
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/MediaSize$Other.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/MediaSize.class b/libjava/classpath/lib/javax/print/attribute/standard/MediaSize.class
new file mode 100644
index 00000000000..7e1f36fee9d
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/MediaSize.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/MediaSizeName.class b/libjava/classpath/lib/javax/print/attribute/standard/MediaSizeName.class
new file mode 100644
index 00000000000..91d14427556
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/MediaSizeName.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/MediaTray.class b/libjava/classpath/lib/javax/print/attribute/standard/MediaTray.class
new file mode 100644
index 00000000000..fcd0a827f66
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/MediaTray.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/MultipleDocumentHandling.class b/libjava/classpath/lib/javax/print/attribute/standard/MultipleDocumentHandling.class
new file mode 100644
index 00000000000..b951129f100
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/MultipleDocumentHandling.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/NumberOfDocuments.class b/libjava/classpath/lib/javax/print/attribute/standard/NumberOfDocuments.class
new file mode 100644
index 00000000000..a4adaf1153f
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/NumberOfDocuments.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/NumberOfInterveningJobs.class b/libjava/classpath/lib/javax/print/attribute/standard/NumberOfInterveningJobs.class
new file mode 100644
index 00000000000..759f0caee5f
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/NumberOfInterveningJobs.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/NumberUp.class b/libjava/classpath/lib/javax/print/attribute/standard/NumberUp.class
new file mode 100644
index 00000000000..5456684b938
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/NumberUp.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/NumberUpSupported.class b/libjava/classpath/lib/javax/print/attribute/standard/NumberUpSupported.class
new file mode 100644
index 00000000000..fb9e4c8c453
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/NumberUpSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/OrientationRequested.class b/libjava/classpath/lib/javax/print/attribute/standard/OrientationRequested.class
new file mode 100644
index 00000000000..eac890a0288
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/OrientationRequested.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/OutputDeviceAssigned.class b/libjava/classpath/lib/javax/print/attribute/standard/OutputDeviceAssigned.class
new file mode 100644
index 00000000000..900479306d3
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/OutputDeviceAssigned.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PDLOverrideSupported.class b/libjava/classpath/lib/javax/print/attribute/standard/PDLOverrideSupported.class
new file mode 100644
index 00000000000..8b0b9495c94
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PDLOverrideSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PageRanges.class b/libjava/classpath/lib/javax/print/attribute/standard/PageRanges.class
new file mode 100644
index 00000000000..917e9ba1b6a
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PageRanges.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PagesPerMinute.class b/libjava/classpath/lib/javax/print/attribute/standard/PagesPerMinute.class
new file mode 100644
index 00000000000..ab7150429b7
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PagesPerMinute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PagesPerMinuteColor.class b/libjava/classpath/lib/javax/print/attribute/standard/PagesPerMinuteColor.class
new file mode 100644
index 00000000000..8402bbd857f
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PagesPerMinuteColor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PresentationDirection.class b/libjava/classpath/lib/javax/print/attribute/standard/PresentationDirection.class
new file mode 100644
index 00000000000..108401b1351
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PresentationDirection.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PrintQuality.class b/libjava/classpath/lib/javax/print/attribute/standard/PrintQuality.class
new file mode 100644
index 00000000000..38511ca1ecc
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PrintQuality.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PrinterInfo.class b/libjava/classpath/lib/javax/print/attribute/standard/PrinterInfo.class
new file mode 100644
index 00000000000..9d4dfec8858
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PrinterInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PrinterIsAcceptingJobs.class b/libjava/classpath/lib/javax/print/attribute/standard/PrinterIsAcceptingJobs.class
new file mode 100644
index 00000000000..b5645608771
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PrinterIsAcceptingJobs.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PrinterLocation.class b/libjava/classpath/lib/javax/print/attribute/standard/PrinterLocation.class
new file mode 100644
index 00000000000..3dc10226179
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PrinterLocation.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PrinterMakeAndModel.class b/libjava/classpath/lib/javax/print/attribute/standard/PrinterMakeAndModel.class
new file mode 100644
index 00000000000..5035742c4d9
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PrinterMakeAndModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PrinterMessageFromOperator.class b/libjava/classpath/lib/javax/print/attribute/standard/PrinterMessageFromOperator.class
new file mode 100644
index 00000000000..0b9065b7fe2
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PrinterMessageFromOperator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PrinterMoreInfo.class b/libjava/classpath/lib/javax/print/attribute/standard/PrinterMoreInfo.class
new file mode 100644
index 00000000000..e8a4635d39f
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PrinterMoreInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PrinterMoreInfoManufacturer.class b/libjava/classpath/lib/javax/print/attribute/standard/PrinterMoreInfoManufacturer.class
new file mode 100644
index 00000000000..df7de3b6506
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PrinterMoreInfoManufacturer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PrinterName.class b/libjava/classpath/lib/javax/print/attribute/standard/PrinterName.class
new file mode 100644
index 00000000000..d94bfc0c34f
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PrinterName.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PrinterResolution.class b/libjava/classpath/lib/javax/print/attribute/standard/PrinterResolution.class
new file mode 100644
index 00000000000..5e24460c8a2
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PrinterResolution.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PrinterState.class b/libjava/classpath/lib/javax/print/attribute/standard/PrinterState.class
new file mode 100644
index 00000000000..11d67db360a
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PrinterState.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PrinterStateReason.class b/libjava/classpath/lib/javax/print/attribute/standard/PrinterStateReason.class
new file mode 100644
index 00000000000..0ace3664a35
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PrinterStateReason.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PrinterStateReasons.class b/libjava/classpath/lib/javax/print/attribute/standard/PrinterStateReasons.class
new file mode 100644
index 00000000000..2b2bbdde29e
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PrinterStateReasons.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/PrinterURI.class b/libjava/classpath/lib/javax/print/attribute/standard/PrinterURI.class
new file mode 100644
index 00000000000..28124f05e7c
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/PrinterURI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/QueuedJobCount.class b/libjava/classpath/lib/javax/print/attribute/standard/QueuedJobCount.class
new file mode 100644
index 00000000000..21e93f63a3e
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/QueuedJobCount.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/ReferenceUriSchemesSupported.class b/libjava/classpath/lib/javax/print/attribute/standard/ReferenceUriSchemesSupported.class
new file mode 100644
index 00000000000..6ec639def58
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/ReferenceUriSchemesSupported.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/RequestingUserName.class b/libjava/classpath/lib/javax/print/attribute/standard/RequestingUserName.class
new file mode 100644
index 00000000000..eaf96608a93
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/RequestingUserName.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/Severity.class b/libjava/classpath/lib/javax/print/attribute/standard/Severity.class
new file mode 100644
index 00000000000..d7959b0e4f1
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/Severity.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/SheetCollate.class b/libjava/classpath/lib/javax/print/attribute/standard/SheetCollate.class
new file mode 100644
index 00000000000..6e202fc7a97
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/SheetCollate.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/attribute/standard/Sides.class b/libjava/classpath/lib/javax/print/attribute/standard/Sides.class
new file mode 100644
index 00000000000..ccc9789518d
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/attribute/standard/Sides.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/event/PrintEvent.class b/libjava/classpath/lib/javax/print/event/PrintEvent.class
new file mode 100644
index 00000000000..589436ae042
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/event/PrintEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/event/PrintJobAdapter.class b/libjava/classpath/lib/javax/print/event/PrintJobAdapter.class
new file mode 100644
index 00000000000..28559645c6e
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/event/PrintJobAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/event/PrintJobAttributeEvent.class b/libjava/classpath/lib/javax/print/event/PrintJobAttributeEvent.class
new file mode 100644
index 00000000000..dc6834fb7a9
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/event/PrintJobAttributeEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/event/PrintJobAttributeListener.class b/libjava/classpath/lib/javax/print/event/PrintJobAttributeListener.class
new file mode 100644
index 00000000000..3404e303d3b
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/event/PrintJobAttributeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/event/PrintJobEvent.class b/libjava/classpath/lib/javax/print/event/PrintJobEvent.class
new file mode 100644
index 00000000000..77ff6656b6a
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/event/PrintJobEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/event/PrintJobListener.class b/libjava/classpath/lib/javax/print/event/PrintJobListener.class
new file mode 100644
index 00000000000..86549e6dc3b
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/event/PrintJobListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/event/PrintServiceAttributeEvent.class b/libjava/classpath/lib/javax/print/event/PrintServiceAttributeEvent.class
new file mode 100644
index 00000000000..4a5c9c898af
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/event/PrintServiceAttributeEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/print/event/PrintServiceAttributeListener.class b/libjava/classpath/lib/javax/print/event/PrintServiceAttributeListener.class
new file mode 100644
index 00000000000..029a5b932f9
--- /dev/null
+++ b/libjava/classpath/lib/javax/print/event/PrintServiceAttributeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/rmi/CORBA/ClassDesc.class b/libjava/classpath/lib/javax/rmi/CORBA/ClassDesc.class
new file mode 100644
index 00000000000..96fa9d591b1
--- /dev/null
+++ b/libjava/classpath/lib/javax/rmi/CORBA/ClassDesc.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/rmi/CORBA/PortableRemoteObjectDelegate.class b/libjava/classpath/lib/javax/rmi/CORBA/PortableRemoteObjectDelegate.class
new file mode 100644
index 00000000000..432269bffd0
--- /dev/null
+++ b/libjava/classpath/lib/javax/rmi/CORBA/PortableRemoteObjectDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/rmi/CORBA/Stub.class b/libjava/classpath/lib/javax/rmi/CORBA/Stub.class
new file mode 100644
index 00000000000..1c0d21cbfe0
--- /dev/null
+++ b/libjava/classpath/lib/javax/rmi/CORBA/Stub.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/rmi/CORBA/StubDelegate.class b/libjava/classpath/lib/javax/rmi/CORBA/StubDelegate.class
new file mode 100644
index 00000000000..77f1aac0a77
--- /dev/null
+++ b/libjava/classpath/lib/javax/rmi/CORBA/StubDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/rmi/CORBA/Tie.class b/libjava/classpath/lib/javax/rmi/CORBA/Tie.class
new file mode 100644
index 00000000000..c4c3b82e359
--- /dev/null
+++ b/libjava/classpath/lib/javax/rmi/CORBA/Tie.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/rmi/CORBA/Util.class b/libjava/classpath/lib/javax/rmi/CORBA/Util.class
new file mode 100644
index 00000000000..1175824b71c
--- /dev/null
+++ b/libjava/classpath/lib/javax/rmi/CORBA/Util.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/rmi/CORBA/UtilDelegate.class b/libjava/classpath/lib/javax/rmi/CORBA/UtilDelegate.class
new file mode 100644
index 00000000000..65077c71ac3
--- /dev/null
+++ b/libjava/classpath/lib/javax/rmi/CORBA/UtilDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/rmi/CORBA/ValueHandler.class b/libjava/classpath/lib/javax/rmi/CORBA/ValueHandler.class
new file mode 100644
index 00000000000..29ee23f36c5
--- /dev/null
+++ b/libjava/classpath/lib/javax/rmi/CORBA/ValueHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/rmi/CORBA/ValueHandlerMultiFormat.class b/libjava/classpath/lib/javax/rmi/CORBA/ValueHandlerMultiFormat.class
new file mode 100644
index 00000000000..6b2d632a8e7
--- /dev/null
+++ b/libjava/classpath/lib/javax/rmi/CORBA/ValueHandlerMultiFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/rmi/PortableRemoteObject.class b/libjava/classpath/lib/javax/rmi/PortableRemoteObject.class
new file mode 100644
index 00000000000..b74d1450c8e
--- /dev/null
+++ b/libjava/classpath/lib/javax/rmi/PortableRemoteObject.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/rmi/ssl/SslRMIClientSocketFactory.class b/libjava/classpath/lib/javax/rmi/ssl/SslRMIClientSocketFactory.class
new file mode 100644
index 00000000000..4ba2d6fa060
--- /dev/null
+++ b/libjava/classpath/lib/javax/rmi/ssl/SslRMIClientSocketFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/rmi/ssl/SslRMIServerSocketFactory.class b/libjava/classpath/lib/javax/rmi/ssl/SslRMIServerSocketFactory.class
new file mode 100644
index 00000000000..9df26d505ed
--- /dev/null
+++ b/libjava/classpath/lib/javax/rmi/ssl/SslRMIServerSocketFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/AuthPermission.class b/libjava/classpath/lib/javax/security/auth/AuthPermission.class
new file mode 100644
index 00000000000..54e75dcede2
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/AuthPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/DestroyFailedException.class b/libjava/classpath/lib/javax/security/auth/DestroyFailedException.class
new file mode 100644
index 00000000000..7944f18966c
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/DestroyFailedException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/Destroyable.class b/libjava/classpath/lib/javax/security/auth/Destroyable.class
new file mode 100644
index 00000000000..fbb944150eb
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/Destroyable.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/Policy.class b/libjava/classpath/lib/javax/security/auth/Policy.class
new file mode 100644
index 00000000000..50a7e6fd9b2
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/Policy.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/PrivateCredentialPermission$CredOwner.class b/libjava/classpath/lib/javax/security/auth/PrivateCredentialPermission$CredOwner.class
new file mode 100644
index 00000000000..46678c4444b
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/PrivateCredentialPermission$CredOwner.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/PrivateCredentialPermission.class b/libjava/classpath/lib/javax/security/auth/PrivateCredentialPermission.class
new file mode 100644
index 00000000000..0143ee8e8b0
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/PrivateCredentialPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/RefreshFailedException.class b/libjava/classpath/lib/javax/security/auth/RefreshFailedException.class
new file mode 100644
index 00000000000..4968d0d82aa
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/RefreshFailedException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/Refreshable.class b/libjava/classpath/lib/javax/security/auth/Refreshable.class
new file mode 100644
index 00000000000..3005e5c2f47
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/Refreshable.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/Subject$SecureSet.class b/libjava/classpath/lib/javax/security/auth/Subject$SecureSet.class
new file mode 100644
index 00000000000..682125eeef6
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/Subject$SecureSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/Subject.class b/libjava/classpath/lib/javax/security/auth/Subject.class
new file mode 100644
index 00000000000..9c64e0c9714
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/Subject.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/SubjectDomainCombiner.class b/libjava/classpath/lib/javax/security/auth/SubjectDomainCombiner.class
new file mode 100644
index 00000000000..737a678b6ae
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/SubjectDomainCombiner.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/callback/Callback.class b/libjava/classpath/lib/javax/security/auth/callback/Callback.class
new file mode 100644
index 00000000000..6e3a344b7bd
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/callback/Callback.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/callback/CallbackHandler.class b/libjava/classpath/lib/javax/security/auth/callback/CallbackHandler.class
new file mode 100644
index 00000000000..b3b4d1f8193
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/callback/CallbackHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/callback/ChoiceCallback.class b/libjava/classpath/lib/javax/security/auth/callback/ChoiceCallback.class
new file mode 100644
index 00000000000..17f5201ec03
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/callback/ChoiceCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/callback/ConfirmationCallback.class b/libjava/classpath/lib/javax/security/auth/callback/ConfirmationCallback.class
new file mode 100644
index 00000000000..2110442cb11
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/callback/ConfirmationCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/callback/LanguageCallback.class b/libjava/classpath/lib/javax/security/auth/callback/LanguageCallback.class
new file mode 100644
index 00000000000..683e182573a
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/callback/LanguageCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/callback/NameCallback.class b/libjava/classpath/lib/javax/security/auth/callback/NameCallback.class
new file mode 100644
index 00000000000..b71dd8ad83a
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/callback/NameCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/callback/PasswordCallback.class b/libjava/classpath/lib/javax/security/auth/callback/PasswordCallback.class
new file mode 100644
index 00000000000..5096aa3d912
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/callback/PasswordCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/callback/TextInputCallback.class b/libjava/classpath/lib/javax/security/auth/callback/TextInputCallback.class
new file mode 100644
index 00000000000..9ec60ddfac0
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/callback/TextInputCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/callback/TextOutputCallback.class b/libjava/classpath/lib/javax/security/auth/callback/TextOutputCallback.class
new file mode 100644
index 00000000000..84800e6656c
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/callback/TextOutputCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/callback/UnsupportedCallbackException.class b/libjava/classpath/lib/javax/security/auth/callback/UnsupportedCallbackException.class
new file mode 100644
index 00000000000..5863eb6ea66
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/callback/UnsupportedCallbackException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/kerberos/DelegationPermission$1.class b/libjava/classpath/lib/javax/security/auth/kerberos/DelegationPermission$1.class
new file mode 100644
index 00000000000..17b73dd3a06
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/kerberos/DelegationPermission$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/kerberos/DelegationPermission.class b/libjava/classpath/lib/javax/security/auth/kerberos/DelegationPermission.class
new file mode 100644
index 00000000000..a5a555a3bbd
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/kerberos/DelegationPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/kerberos/KerberosKey.class b/libjava/classpath/lib/javax/security/auth/kerberos/KerberosKey.class
new file mode 100644
index 00000000000..89081783c30
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/kerberos/KerberosKey.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/kerberos/KerberosPrincipal.class b/libjava/classpath/lib/javax/security/auth/kerberos/KerberosPrincipal.class
new file mode 100644
index 00000000000..1804ee09100
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/kerberos/KerberosPrincipal.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/kerberos/KerberosTicket.class b/libjava/classpath/lib/javax/security/auth/kerberos/KerberosTicket.class
new file mode 100644
index 00000000000..2b61c570d8e
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/kerberos/KerberosTicket.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/kerberos/KeyImpl.class b/libjava/classpath/lib/javax/security/auth/kerberos/KeyImpl.class
new file mode 100644
index 00000000000..4e6b58739b4
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/kerberos/KeyImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/kerberos/ServicePermission$1.class b/libjava/classpath/lib/javax/security/auth/kerberos/ServicePermission$1.class
new file mode 100644
index 00000000000..f8d7e1e2a8e
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/kerberos/ServicePermission$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/kerberos/ServicePermission.class b/libjava/classpath/lib/javax/security/auth/kerberos/ServicePermission.class
new file mode 100644
index 00000000000..567a1dd3abf
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/kerberos/ServicePermission.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/AccountException.class b/libjava/classpath/lib/javax/security/auth/login/AccountException.class
new file mode 100644
index 00000000000..5e7b900b8db
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/AccountException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/AccountExpiredException.class b/libjava/classpath/lib/javax/security/auth/login/AccountExpiredException.class
new file mode 100644
index 00000000000..aa1bf7df2c7
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/AccountExpiredException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/AccountLockedException.class b/libjava/classpath/lib/javax/security/auth/login/AccountLockedException.class
new file mode 100644
index 00000000000..ba3576e1778
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/AccountLockedException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/AccountNotFoundException.class b/libjava/classpath/lib/javax/security/auth/login/AccountNotFoundException.class
new file mode 100644
index 00000000000..f06c1599824
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/AccountNotFoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/AppConfigurationEntry$LoginModuleControlFlag.class b/libjava/classpath/lib/javax/security/auth/login/AppConfigurationEntry$LoginModuleControlFlag.class
new file mode 100644
index 00000000000..db80cbfb648
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/AppConfigurationEntry$LoginModuleControlFlag.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/AppConfigurationEntry.class b/libjava/classpath/lib/javax/security/auth/login/AppConfigurationEntry.class
new file mode 100644
index 00000000000..5307843c287
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/AppConfigurationEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/Configuration$1.class b/libjava/classpath/lib/javax/security/auth/login/Configuration$1.class
new file mode 100644
index 00000000000..cfbe1eed07a
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/Configuration$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/Configuration.class b/libjava/classpath/lib/javax/security/auth/login/Configuration.class
new file mode 100644
index 00000000000..bd233be10df
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/Configuration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/CredentialException.class b/libjava/classpath/lib/javax/security/auth/login/CredentialException.class
new file mode 100644
index 00000000000..82ad8b84e0f
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/CredentialException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/CredentialExpiredException.class b/libjava/classpath/lib/javax/security/auth/login/CredentialExpiredException.class
new file mode 100644
index 00000000000..e313d9d8f75
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/CredentialExpiredException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/CredentialNotFoundException.class b/libjava/classpath/lib/javax/security/auth/login/CredentialNotFoundException.class
new file mode 100644
index 00000000000..c4bdb4eb8be
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/CredentialNotFoundException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/FailedLoginException.class b/libjava/classpath/lib/javax/security/auth/login/FailedLoginException.class
new file mode 100644
index 00000000000..475f605ade3
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/FailedLoginException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/LoginContext.class b/libjava/classpath/lib/javax/security/auth/login/LoginContext.class
new file mode 100644
index 00000000000..72a220ca94e
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/LoginContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/LoginException.class b/libjava/classpath/lib/javax/security/auth/login/LoginException.class
new file mode 100644
index 00000000000..92a141422fc
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/LoginException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/login/NullConfiguration.class b/libjava/classpath/lib/javax/security/auth/login/NullConfiguration.class
new file mode 100644
index 00000000000..2fb42c31936
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/login/NullConfiguration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/spi/LoginModule.class b/libjava/classpath/lib/javax/security/auth/spi/LoginModule.class
new file mode 100644
index 00000000000..395adacbc08
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/spi/LoginModule.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/x500/X500Principal.class b/libjava/classpath/lib/javax/security/auth/x500/X500Principal.class
new file mode 100644
index 00000000000..8b8b10bfe22
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/x500/X500Principal.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/auth/x500/X500PrivateCredential.class b/libjava/classpath/lib/javax/security/auth/x500/X500PrivateCredential.class
new file mode 100644
index 00000000000..9ceb6eebf0e
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/auth/x500/X500PrivateCredential.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/cert/Certificate.class b/libjava/classpath/lib/javax/security/cert/Certificate.class
new file mode 100644
index 00000000000..19e849833e6
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/cert/Certificate.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/cert/CertificateEncodingException.class b/libjava/classpath/lib/javax/security/cert/CertificateEncodingException.class
new file mode 100644
index 00000000000..7355f636d3a
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/cert/CertificateEncodingException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/cert/CertificateException.class b/libjava/classpath/lib/javax/security/cert/CertificateException.class
new file mode 100644
index 00000000000..2682adc4315
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/cert/CertificateException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/cert/CertificateExpiredException.class b/libjava/classpath/lib/javax/security/cert/CertificateExpiredException.class
new file mode 100644
index 00000000000..405b021ef70
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/cert/CertificateExpiredException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/cert/CertificateNotYetValidException.class b/libjava/classpath/lib/javax/security/cert/CertificateNotYetValidException.class
new file mode 100644
index 00000000000..0abee4f8022
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/cert/CertificateNotYetValidException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/cert/CertificateParsingException.class b/libjava/classpath/lib/javax/security/cert/CertificateParsingException.class
new file mode 100644
index 00000000000..232946f9dce
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/cert/CertificateParsingException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/cert/X509CertBridge.class b/libjava/classpath/lib/javax/security/cert/X509CertBridge.class
new file mode 100644
index 00000000000..30f73b590e8
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/cert/X509CertBridge.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/cert/X509Certificate.class b/libjava/classpath/lib/javax/security/cert/X509Certificate.class
new file mode 100644
index 00000000000..07f0f3902c1
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/cert/X509Certificate.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/sasl/AuthenticationException.class b/libjava/classpath/lib/javax/security/sasl/AuthenticationException.class
new file mode 100644
index 00000000000..0469cc5186e
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/sasl/AuthenticationException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/sasl/AuthorizeCallback.class b/libjava/classpath/lib/javax/security/sasl/AuthorizeCallback.class
new file mode 100644
index 00000000000..bb976ec1c37
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/sasl/AuthorizeCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/sasl/RealmCallback.class b/libjava/classpath/lib/javax/security/sasl/RealmCallback.class
new file mode 100644
index 00000000000..683a99b11ba
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/sasl/RealmCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/sasl/RealmChoiceCallback.class b/libjava/classpath/lib/javax/security/sasl/RealmChoiceCallback.class
new file mode 100644
index 00000000000..3f36f2b7303
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/sasl/RealmChoiceCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/sasl/Sasl.class b/libjava/classpath/lib/javax/security/sasl/Sasl.class
new file mode 100644
index 00000000000..f730d3191f4
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/sasl/Sasl.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/sasl/SaslClient.class b/libjava/classpath/lib/javax/security/sasl/SaslClient.class
new file mode 100644
index 00000000000..670745bb65b
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/sasl/SaslClient.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/sasl/SaslClientFactory.class b/libjava/classpath/lib/javax/security/sasl/SaslClientFactory.class
new file mode 100644
index 00000000000..4e0aacdfc69
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/sasl/SaslClientFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/sasl/SaslException.class b/libjava/classpath/lib/javax/security/sasl/SaslException.class
new file mode 100644
index 00000000000..2121acee357
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/sasl/SaslException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/sasl/SaslServer.class b/libjava/classpath/lib/javax/security/sasl/SaslServer.class
new file mode 100644
index 00000000000..5170e56c69e
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/sasl/SaslServer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/security/sasl/SaslServerFactory.class b/libjava/classpath/lib/javax/security/sasl/SaslServerFactory.class
new file mode 100644
index 00000000000..8769c08450d
--- /dev/null
+++ b/libjava/classpath/lib/javax/security/sasl/SaslServerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/ControllerEventListener.class b/libjava/classpath/lib/javax/sound/midi/ControllerEventListener.class
new file mode 100644
index 00000000000..da0c409846d
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/ControllerEventListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/Instrument.class b/libjava/classpath/lib/javax/sound/midi/Instrument.class
new file mode 100644
index 00000000000..98fff9ed2aa
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/Instrument.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/InvalidMidiDataException.class b/libjava/classpath/lib/javax/sound/midi/InvalidMidiDataException.class
new file mode 100644
index 00000000000..0a4b24cfc3e
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/InvalidMidiDataException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/MetaEventListener.class b/libjava/classpath/lib/javax/sound/midi/MetaEventListener.class
new file mode 100644
index 00000000000..aad406108f7
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/MetaEventListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/MetaMessage.class b/libjava/classpath/lib/javax/sound/midi/MetaMessage.class
new file mode 100644
index 00000000000..8ac24605748
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/MetaMessage.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/MidiChannel.class b/libjava/classpath/lib/javax/sound/midi/MidiChannel.class
new file mode 100644
index 00000000000..341a9bb2eb8
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/MidiChannel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/MidiDevice$Info.class b/libjava/classpath/lib/javax/sound/midi/MidiDevice$Info.class
new file mode 100644
index 00000000000..773d8316752
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/MidiDevice$Info.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/MidiDevice.class b/libjava/classpath/lib/javax/sound/midi/MidiDevice.class
new file mode 100644
index 00000000000..a299aa94f4e
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/MidiDevice.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/MidiEvent.class b/libjava/classpath/lib/javax/sound/midi/MidiEvent.class
new file mode 100644
index 00000000000..0bc17e6595b
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/MidiEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/MidiFileFormat.class b/libjava/classpath/lib/javax/sound/midi/MidiFileFormat.class
new file mode 100644
index 00000000000..b6e2ce4482c
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/MidiFileFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/MidiMessage.class b/libjava/classpath/lib/javax/sound/midi/MidiMessage.class
new file mode 100644
index 00000000000..8ddb8aab286
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/MidiMessage.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/MidiSystem.class b/libjava/classpath/lib/javax/sound/midi/MidiSystem.class
new file mode 100644
index 00000000000..b25a832b35f
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/MidiSystem.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/MidiUnavailableException.class b/libjava/classpath/lib/javax/sound/midi/MidiUnavailableException.class
new file mode 100644
index 00000000000..13a292367dd
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/MidiUnavailableException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/Patch.class b/libjava/classpath/lib/javax/sound/midi/Patch.class
new file mode 100644
index 00000000000..d633eedff32
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/Patch.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/Receiver.class b/libjava/classpath/lib/javax/sound/midi/Receiver.class
new file mode 100644
index 00000000000..965bd62c370
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/Receiver.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/Sequence.class b/libjava/classpath/lib/javax/sound/midi/Sequence.class
new file mode 100644
index 00000000000..5538228dea7
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/Sequence.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/Sequencer$SyncMode.class b/libjava/classpath/lib/javax/sound/midi/Sequencer$SyncMode.class
new file mode 100644
index 00000000000..5a38235843b
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/Sequencer$SyncMode.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/Sequencer.class b/libjava/classpath/lib/javax/sound/midi/Sequencer.class
new file mode 100644
index 00000000000..ae2a2d5e020
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/Sequencer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/ShortMessage.class b/libjava/classpath/lib/javax/sound/midi/ShortMessage.class
new file mode 100644
index 00000000000..58a4653bab7
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/ShortMessage.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/Soundbank.class b/libjava/classpath/lib/javax/sound/midi/Soundbank.class
new file mode 100644
index 00000000000..d6cb8af2c24
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/Soundbank.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/SoundbankResource.class b/libjava/classpath/lib/javax/sound/midi/SoundbankResource.class
new file mode 100644
index 00000000000..9d6077963fd
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/SoundbankResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/Synthesizer.class b/libjava/classpath/lib/javax/sound/midi/Synthesizer.class
new file mode 100644
index 00000000000..bb4465a0cc3
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/Synthesizer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/SysexMessage.class b/libjava/classpath/lib/javax/sound/midi/SysexMessage.class
new file mode 100644
index 00000000000..98b6f6a3f90
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/SysexMessage.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/Track.class b/libjava/classpath/lib/javax/sound/midi/Track.class
new file mode 100644
index 00000000000..48f61a4f035
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/Track.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/Transmitter.class b/libjava/classpath/lib/javax/sound/midi/Transmitter.class
new file mode 100644
index 00000000000..41b968b49ff
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/Transmitter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/VoiceStatus.class b/libjava/classpath/lib/javax/sound/midi/VoiceStatus.class
new file mode 100644
index 00000000000..23d64373016
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/VoiceStatus.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/spi/MidiDeviceProvider.class b/libjava/classpath/lib/javax/sound/midi/spi/MidiDeviceProvider.class
new file mode 100644
index 00000000000..9bd4b0c2f73
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/spi/MidiDeviceProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/spi/MidiFileReader.class b/libjava/classpath/lib/javax/sound/midi/spi/MidiFileReader.class
new file mode 100644
index 00000000000..c85f4969508
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/spi/MidiFileReader.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/spi/MidiFileWriter.class b/libjava/classpath/lib/javax/sound/midi/spi/MidiFileWriter.class
new file mode 100644
index 00000000000..a1edb6663c0
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/spi/MidiFileWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/midi/spi/SoundbankReader.class b/libjava/classpath/lib/javax/sound/midi/spi/SoundbankReader.class
new file mode 100644
index 00000000000..d2c63aba084
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/midi/spi/SoundbankReader.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/AudioFileFormat$Type.class b/libjava/classpath/lib/javax/sound/sampled/AudioFileFormat$Type.class
new file mode 100644
index 00000000000..f3087e7ee45
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/AudioFileFormat$Type.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/AudioFileFormat.class b/libjava/classpath/lib/javax/sound/sampled/AudioFileFormat.class
new file mode 100644
index 00000000000..9080a541521
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/AudioFileFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/AudioFormat$Encoding.class b/libjava/classpath/lib/javax/sound/sampled/AudioFormat$Encoding.class
new file mode 100644
index 00000000000..e76624cd29e
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/AudioFormat$Encoding.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/AudioFormat.class b/libjava/classpath/lib/javax/sound/sampled/AudioFormat.class
new file mode 100644
index 00000000000..2d7d4ec3c49
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/AudioFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/AudioInputStream$TargetInputStream.class b/libjava/classpath/lib/javax/sound/sampled/AudioInputStream$TargetInputStream.class
new file mode 100644
index 00000000000..24ad3615721
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/AudioInputStream$TargetInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/AudioInputStream.class b/libjava/classpath/lib/javax/sound/sampled/AudioInputStream.class
new file mode 100644
index 00000000000..7653aede88e
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/AudioInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/AudioPermission.class b/libjava/classpath/lib/javax/sound/sampled/AudioPermission.class
new file mode 100644
index 00000000000..b6838116775
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/AudioPermission.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/AudioSystem.class b/libjava/classpath/lib/javax/sound/sampled/AudioSystem.class
new file mode 100644
index 00000000000..d2f9df90375
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/AudioSystem.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/BooleanControl$Type.class b/libjava/classpath/lib/javax/sound/sampled/BooleanControl$Type.class
new file mode 100644
index 00000000000..2b34f328453
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/BooleanControl$Type.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/BooleanControl.class b/libjava/classpath/lib/javax/sound/sampled/BooleanControl.class
new file mode 100644
index 00000000000..66638a9a34c
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/BooleanControl.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/Clip.class b/libjava/classpath/lib/javax/sound/sampled/Clip.class
new file mode 100644
index 00000000000..fbf12f30eb0
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/Clip.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/CompoundControl$Type.class b/libjava/classpath/lib/javax/sound/sampled/CompoundControl$Type.class
new file mode 100644
index 00000000000..e3cd87ceec0
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/CompoundControl$Type.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/CompoundControl.class b/libjava/classpath/lib/javax/sound/sampled/CompoundControl.class
new file mode 100644
index 00000000000..b7257a2c97f
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/CompoundControl.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/Control$Type.class b/libjava/classpath/lib/javax/sound/sampled/Control$Type.class
new file mode 100644
index 00000000000..fde49fabef5
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/Control$Type.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/Control.class b/libjava/classpath/lib/javax/sound/sampled/Control.class
new file mode 100644
index 00000000000..5dfef019310
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/Control.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/DataLine$Info.class b/libjava/classpath/lib/javax/sound/sampled/DataLine$Info.class
new file mode 100644
index 00000000000..fd9cc41a248
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/DataLine$Info.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/DataLine.class b/libjava/classpath/lib/javax/sound/sampled/DataLine.class
new file mode 100644
index 00000000000..06e2775e63e
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/DataLine.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/EnumControl$Type.class b/libjava/classpath/lib/javax/sound/sampled/EnumControl$Type.class
new file mode 100644
index 00000000000..a3c7e7cd779
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/EnumControl$Type.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/EnumControl.class b/libjava/classpath/lib/javax/sound/sampled/EnumControl.class
new file mode 100644
index 00000000000..9a14b3b41f0
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/EnumControl.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/FloatControl$Type.class b/libjava/classpath/lib/javax/sound/sampled/FloatControl$Type.class
new file mode 100644
index 00000000000..31ab6794646
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/FloatControl$Type.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/FloatControl.class b/libjava/classpath/lib/javax/sound/sampled/FloatControl.class
new file mode 100644
index 00000000000..342f907f3c8
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/FloatControl.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/Line$Info.class b/libjava/classpath/lib/javax/sound/sampled/Line$Info.class
new file mode 100644
index 00000000000..209f4f95589
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/Line$Info.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/Line.class b/libjava/classpath/lib/javax/sound/sampled/Line.class
new file mode 100644
index 00000000000..61cf116efcb
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/Line.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/LineEvent$Type.class b/libjava/classpath/lib/javax/sound/sampled/LineEvent$Type.class
new file mode 100644
index 00000000000..a4125ba4a65
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/LineEvent$Type.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/LineEvent.class b/libjava/classpath/lib/javax/sound/sampled/LineEvent.class
new file mode 100644
index 00000000000..cb25c30d8ca
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/LineEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/LineListener.class b/libjava/classpath/lib/javax/sound/sampled/LineListener.class
new file mode 100644
index 00000000000..1f88506b0cb
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/LineListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/LineUnavailableException.class b/libjava/classpath/lib/javax/sound/sampled/LineUnavailableException.class
new file mode 100644
index 00000000000..b234d582c83
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/LineUnavailableException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/Mixer$Info.class b/libjava/classpath/lib/javax/sound/sampled/Mixer$Info.class
new file mode 100644
index 00000000000..930c42d7543
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/Mixer$Info.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/Mixer.class b/libjava/classpath/lib/javax/sound/sampled/Mixer.class
new file mode 100644
index 00000000000..a079741b7db
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/Mixer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/Port$Info.class b/libjava/classpath/lib/javax/sound/sampled/Port$Info.class
new file mode 100644
index 00000000000..e8a1cdd4f2c
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/Port$Info.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/Port.class b/libjava/classpath/lib/javax/sound/sampled/Port.class
new file mode 100644
index 00000000000..24788902b60
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/Port.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/ReverbType.class b/libjava/classpath/lib/javax/sound/sampled/ReverbType.class
new file mode 100644
index 00000000000..63525a1845a
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/ReverbType.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/SourceDataLine.class b/libjava/classpath/lib/javax/sound/sampled/SourceDataLine.class
new file mode 100644
index 00000000000..1c8c0c87fbe
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/SourceDataLine.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/TargetDataLine.class b/libjava/classpath/lib/javax/sound/sampled/TargetDataLine.class
new file mode 100644
index 00000000000..7ce66777227
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/TargetDataLine.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/UnsupportedAudioFileException.class b/libjava/classpath/lib/javax/sound/sampled/UnsupportedAudioFileException.class
new file mode 100644
index 00000000000..c6ae28916fa
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/UnsupportedAudioFileException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/spi/AudioFileReader.class b/libjava/classpath/lib/javax/sound/sampled/spi/AudioFileReader.class
new file mode 100644
index 00000000000..4e2e4e5edd6
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/spi/AudioFileReader.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/spi/AudioFileWriter.class b/libjava/classpath/lib/javax/sound/sampled/spi/AudioFileWriter.class
new file mode 100644
index 00000000000..cf5d8e438dd
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/spi/AudioFileWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/spi/FormatConversionProvider.class b/libjava/classpath/lib/javax/sound/sampled/spi/FormatConversionProvider.class
new file mode 100644
index 00000000000..6ecb4404113
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/spi/FormatConversionProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sound/sampled/spi/MixerProvider.class b/libjava/classpath/lib/javax/sound/sampled/spi/MixerProvider.class
new file mode 100644
index 00000000000..aee30946f1b
--- /dev/null
+++ b/libjava/classpath/lib/javax/sound/sampled/spi/MixerProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sql/ConnectionEvent.class b/libjava/classpath/lib/javax/sql/ConnectionEvent.class
new file mode 100644
index 00000000000..8345645c27c
--- /dev/null
+++ b/libjava/classpath/lib/javax/sql/ConnectionEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sql/ConnectionEventListener.class b/libjava/classpath/lib/javax/sql/ConnectionEventListener.class
new file mode 100644
index 00000000000..48e29c20124
--- /dev/null
+++ b/libjava/classpath/lib/javax/sql/ConnectionEventListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sql/ConnectionPoolDataSource.class b/libjava/classpath/lib/javax/sql/ConnectionPoolDataSource.class
new file mode 100644
index 00000000000..6955eba58d5
--- /dev/null
+++ b/libjava/classpath/lib/javax/sql/ConnectionPoolDataSource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sql/DataSource.class b/libjava/classpath/lib/javax/sql/DataSource.class
new file mode 100644
index 00000000000..1c9f7ced2d9
--- /dev/null
+++ b/libjava/classpath/lib/javax/sql/DataSource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sql/PooledConnection.class b/libjava/classpath/lib/javax/sql/PooledConnection.class
new file mode 100644
index 00000000000..fcf55c69f18
--- /dev/null
+++ b/libjava/classpath/lib/javax/sql/PooledConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sql/RowSet.class b/libjava/classpath/lib/javax/sql/RowSet.class
new file mode 100644
index 00000000000..9300a983b94
--- /dev/null
+++ b/libjava/classpath/lib/javax/sql/RowSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sql/RowSetEvent.class b/libjava/classpath/lib/javax/sql/RowSetEvent.class
new file mode 100644
index 00000000000..695fe118019
--- /dev/null
+++ b/libjava/classpath/lib/javax/sql/RowSetEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sql/RowSetInternal.class b/libjava/classpath/lib/javax/sql/RowSetInternal.class
new file mode 100644
index 00000000000..1cde9fc7d31
--- /dev/null
+++ b/libjava/classpath/lib/javax/sql/RowSetInternal.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sql/RowSetListener.class b/libjava/classpath/lib/javax/sql/RowSetListener.class
new file mode 100644
index 00000000000..6a5dc97043e
--- /dev/null
+++ b/libjava/classpath/lib/javax/sql/RowSetListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sql/RowSetMetaData.class b/libjava/classpath/lib/javax/sql/RowSetMetaData.class
new file mode 100644
index 00000000000..0ba95bb1518
--- /dev/null
+++ b/libjava/classpath/lib/javax/sql/RowSetMetaData.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sql/RowSetReader.class b/libjava/classpath/lib/javax/sql/RowSetReader.class
new file mode 100644
index 00000000000..f2a4b51cb70
--- /dev/null
+++ b/libjava/classpath/lib/javax/sql/RowSetReader.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sql/RowSetWriter.class b/libjava/classpath/lib/javax/sql/RowSetWriter.class
new file mode 100644
index 00000000000..206000904ff
--- /dev/null
+++ b/libjava/classpath/lib/javax/sql/RowSetWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sql/XAConnection.class b/libjava/classpath/lib/javax/sql/XAConnection.class
new file mode 100644
index 00000000000..86ab2c5f81c
--- /dev/null
+++ b/libjava/classpath/lib/javax/sql/XAConnection.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/sql/XADataSource.class b/libjava/classpath/lib/javax/sql/XADataSource.class
new file mode 100644
index 00000000000..611cabecc73
--- /dev/null
+++ b/libjava/classpath/lib/javax/sql/XADataSource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/AbstractAction.class b/libjava/classpath/lib/javax/swing/AbstractAction.class
new file mode 100644
index 00000000000..8d2cdaf6759
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/AbstractAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/AbstractButton$1.class b/libjava/classpath/lib/javax/swing/AbstractButton$1.class
new file mode 100644
index 00000000000..1d5de118bef
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/AbstractButton$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/AbstractButton$AccessibleAbstractButton.class b/libjava/classpath/lib/javax/swing/AbstractButton$AccessibleAbstractButton.class
new file mode 100644
index 00000000000..8e07d370ed2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/AbstractButton$AccessibleAbstractButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/AbstractButton$ButtonChangeListener.class b/libjava/classpath/lib/javax/swing/AbstractButton$ButtonChangeListener.class
new file mode 100644
index 00000000000..540f0116e60
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/AbstractButton$ButtonChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/AbstractButton$EventHandler.class b/libjava/classpath/lib/javax/swing/AbstractButton$EventHandler.class
new file mode 100644
index 00000000000..370e7d3cebe
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/AbstractButton$EventHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/AbstractButton.class b/libjava/classpath/lib/javax/swing/AbstractButton.class
new file mode 100644
index 00000000000..cfbd15b15a9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/AbstractButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/AbstractCellEditor.class b/libjava/classpath/lib/javax/swing/AbstractCellEditor.class
new file mode 100644
index 00000000000..d33c2300bff
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/AbstractCellEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/AbstractListModel.class b/libjava/classpath/lib/javax/swing/AbstractListModel.class
new file mode 100644
index 00000000000..e569d3970a5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/AbstractListModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/AbstractSpinnerModel.class b/libjava/classpath/lib/javax/swing/AbstractSpinnerModel.class
new file mode 100644
index 00000000000..9af9510cbd6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/AbstractSpinnerModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Action.class b/libjava/classpath/lib/javax/swing/Action.class
new file mode 100644
index 00000000000..19dd930f971
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Action.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ActionMap.class b/libjava/classpath/lib/javax/swing/ActionMap.class
new file mode 100644
index 00000000000..e77f7d59c6a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ActionMap.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/BorderFactory.class b/libjava/classpath/lib/javax/swing/BorderFactory.class
new file mode 100644
index 00000000000..899b235ceed
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/BorderFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/BoundedRangeModel.class b/libjava/classpath/lib/javax/swing/BoundedRangeModel.class
new file mode 100644
index 00000000000..25718220140
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/BoundedRangeModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Box$AccessibleBox.class b/libjava/classpath/lib/javax/swing/Box$AccessibleBox.class
new file mode 100644
index 00000000000..ad22919f878
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Box$AccessibleBox.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Box$Filler$AccessibleBoxFiller.class b/libjava/classpath/lib/javax/swing/Box$Filler$AccessibleBoxFiller.class
new file mode 100644
index 00000000000..a45d6ff0c2e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Box$Filler$AccessibleBoxFiller.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Box$Filler.class b/libjava/classpath/lib/javax/swing/Box$Filler.class
new file mode 100644
index 00000000000..b1337ef11e8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Box$Filler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Box.class b/libjava/classpath/lib/javax/swing/Box.class
new file mode 100644
index 00000000000..83d2ebda7af
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Box.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/BoxLayout.class b/libjava/classpath/lib/javax/swing/BoxLayout.class
new file mode 100644
index 00000000000..ae04a89ca00
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/BoxLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ButtonGroup.class b/libjava/classpath/lib/javax/swing/ButtonGroup.class
new file mode 100644
index 00000000000..075241032ef
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ButtonGroup.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ButtonModel.class b/libjava/classpath/lib/javax/swing/ButtonModel.class
new file mode 100644
index 00000000000..475947322ce
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ButtonModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/CellEditor.class b/libjava/classpath/lib/javax/swing/CellEditor.class
new file mode 100644
index 00000000000..96007a35b3d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/CellEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/CellRendererPane$AccessibleCellRendererPane.class b/libjava/classpath/lib/javax/swing/CellRendererPane$AccessibleCellRendererPane.class
new file mode 100644
index 00000000000..2896e8d18e1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/CellRendererPane$AccessibleCellRendererPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/CellRendererPane.class b/libjava/classpath/lib/javax/swing/CellRendererPane.class
new file mode 100644
index 00000000000..08492c9bdd7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/CellRendererPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ComboBoxEditor.class b/libjava/classpath/lib/javax/swing/ComboBoxEditor.class
new file mode 100644
index 00000000000..85bd49e825d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ComboBoxEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ComboBoxModel.class b/libjava/classpath/lib/javax/swing/ComboBoxModel.class
new file mode 100644
index 00000000000..b71063fad98
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ComboBoxModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/CompatibilityFocusTraversalPolicy.class b/libjava/classpath/lib/javax/swing/CompatibilityFocusTraversalPolicy.class
new file mode 100644
index 00000000000..ddfc8d650dd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/CompatibilityFocusTraversalPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ComponentInputMap.class b/libjava/classpath/lib/javax/swing/ComponentInputMap.class
new file mode 100644
index 00000000000..d096b1281bd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ComponentInputMap.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DebugGraphics.class b/libjava/classpath/lib/javax/swing/DebugGraphics.class
new file mode 100644
index 00000000000..9534faf8694
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DebugGraphics.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultBoundedRangeModel.class b/libjava/classpath/lib/javax/swing/DefaultBoundedRangeModel.class
new file mode 100644
index 00000000000..a24281d3802
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultBoundedRangeModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultButtonModel.class b/libjava/classpath/lib/javax/swing/DefaultButtonModel.class
new file mode 100644
index 00000000000..dca5b10f024
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultButtonModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultCellEditor$EditorDelegate.class b/libjava/classpath/lib/javax/swing/DefaultCellEditor$EditorDelegate.class
new file mode 100644
index 00000000000..626f1fdf787
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultCellEditor$EditorDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultCellEditor$JCheckBoxDelegate.class b/libjava/classpath/lib/javax/swing/DefaultCellEditor$JCheckBoxDelegate.class
new file mode 100644
index 00000000000..db05a1f026a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultCellEditor$JCheckBoxDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultCellEditor$JComboBoxDelegate.class b/libjava/classpath/lib/javax/swing/DefaultCellEditor$JComboBoxDelegate.class
new file mode 100644
index 00000000000..db5727c3aec
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultCellEditor$JComboBoxDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultCellEditor$JTextFieldDelegate.class b/libjava/classpath/lib/javax/swing/DefaultCellEditor$JTextFieldDelegate.class
new file mode 100644
index 00000000000..55ba84034ed
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultCellEditor$JTextFieldDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultCellEditor.class b/libjava/classpath/lib/javax/swing/DefaultCellEditor.class
new file mode 100644
index 00000000000..3c842bc6af1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultCellEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultComboBoxModel.class b/libjava/classpath/lib/javax/swing/DefaultComboBoxModel.class
new file mode 100644
index 00000000000..5c9277d2c79
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultComboBoxModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultDesktopManager.class b/libjava/classpath/lib/javax/swing/DefaultDesktopManager.class
new file mode 100644
index 00000000000..c5202be5dca
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultDesktopManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultFocusManager.class b/libjava/classpath/lib/javax/swing/DefaultFocusManager.class
new file mode 100644
index 00000000000..95670804cd5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultFocusManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultListCellRenderer$UIResource.class b/libjava/classpath/lib/javax/swing/DefaultListCellRenderer$UIResource.class
new file mode 100644
index 00000000000..9ef635ccad8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultListCellRenderer$UIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultListCellRenderer.class b/libjava/classpath/lib/javax/swing/DefaultListCellRenderer.class
new file mode 100644
index 00000000000..83f1ad19534
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultListCellRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultListModel.class b/libjava/classpath/lib/javax/swing/DefaultListModel.class
new file mode 100644
index 00000000000..54dc30cc4ec
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultListModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultListSelectionModel.class b/libjava/classpath/lib/javax/swing/DefaultListSelectionModel.class
new file mode 100644
index 00000000000..00e889a2343
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultListSelectionModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DefaultSingleSelectionModel.class b/libjava/classpath/lib/javax/swing/DefaultSingleSelectionModel.class
new file mode 100644
index 00000000000..bb97ffc6050
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DefaultSingleSelectionModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/DesktopManager.class b/libjava/classpath/lib/javax/swing/DesktopManager.class
new file mode 100644
index 00000000000..683d8ef5f0e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/DesktopManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/FocusManager$WrappingFocusManager.class b/libjava/classpath/lib/javax/swing/FocusManager$WrappingFocusManager.class
new file mode 100644
index 00000000000..ec7de01f39e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/FocusManager$WrappingFocusManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/FocusManager.class b/libjava/classpath/lib/javax/swing/FocusManager.class
new file mode 100644
index 00000000000..b7488db7fa6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/FocusManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/GrayFilter.class b/libjava/classpath/lib/javax/swing/GrayFilter.class
new file mode 100644
index 00000000000..0aaa03ba9b3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/GrayFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Icon.class b/libjava/classpath/lib/javax/swing/Icon.class
new file mode 100644
index 00000000000..8386bf820d8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Icon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ImageIcon$1.class b/libjava/classpath/lib/javax/swing/ImageIcon$1.class
new file mode 100644
index 00000000000..96518d938e6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ImageIcon$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ImageIcon$AccessibleImageIcon.class b/libjava/classpath/lib/javax/swing/ImageIcon$AccessibleImageIcon.class
new file mode 100644
index 00000000000..e4cb57cf0af
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ImageIcon$AccessibleImageIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ImageIcon.class b/libjava/classpath/lib/javax/swing/ImageIcon.class
new file mode 100644
index 00000000000..337e4046424
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ImageIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/InputMap.class b/libjava/classpath/lib/javax/swing/InputMap.class
new file mode 100644
index 00000000000..96dbcbf3559
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/InputMap.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/InputVerifier.class b/libjava/classpath/lib/javax/swing/InputVerifier.class
new file mode 100644
index 00000000000..c870f7361c4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/InputVerifier.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/InternalFrameFocusTraversalPolicy.class b/libjava/classpath/lib/javax/swing/InternalFrameFocusTraversalPolicy.class
new file mode 100644
index 00000000000..7bef033ee96
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/InternalFrameFocusTraversalPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JApplet$AccessibleJApplet.class b/libjava/classpath/lib/javax/swing/JApplet$AccessibleJApplet.class
new file mode 100644
index 00000000000..cce1a78a3a7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JApplet$AccessibleJApplet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JApplet.class b/libjava/classpath/lib/javax/swing/JApplet.class
new file mode 100644
index 00000000000..dedd9a3f43a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JApplet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JButton$AccessibleJButton.class b/libjava/classpath/lib/javax/swing/JButton$AccessibleJButton.class
new file mode 100644
index 00000000000..1a4d39ed305
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JButton$AccessibleJButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JButton.class b/libjava/classpath/lib/javax/swing/JButton.class
new file mode 100644
index 00000000000..e58fa255390
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JCheckBox$AccessibleJCheckBox.class b/libjava/classpath/lib/javax/swing/JCheckBox$AccessibleJCheckBox.class
new file mode 100644
index 00000000000..12a30d9b03c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JCheckBox$AccessibleJCheckBox.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JCheckBox.class b/libjava/classpath/lib/javax/swing/JCheckBox.class
new file mode 100644
index 00000000000..f1e5047c61f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JCheckBox.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem.class b/libjava/classpath/lib/javax/swing/JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem.class
new file mode 100644
index 00000000000..cff8ca29dc0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JCheckBoxMenuItem.class b/libjava/classpath/lib/javax/swing/JCheckBoxMenuItem.class
new file mode 100644
index 00000000000..61aa5dac733
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JCheckBoxMenuItem.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JColorChooser$AccessibleJColorChooser.class b/libjava/classpath/lib/javax/swing/JColorChooser$AccessibleJColorChooser.class
new file mode 100644
index 00000000000..f99ba9800c5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JColorChooser$AccessibleJColorChooser.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JColorChooser$DefaultOKCancelListener.class b/libjava/classpath/lib/javax/swing/JColorChooser$DefaultOKCancelListener.class
new file mode 100644
index 00000000000..dfb2da1521d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JColorChooser$DefaultOKCancelListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JColorChooser$DefaultResetListener.class b/libjava/classpath/lib/javax/swing/JColorChooser$DefaultResetListener.class
new file mode 100644
index 00000000000..046775252a8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JColorChooser$DefaultResetListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JColorChooser.class b/libjava/classpath/lib/javax/swing/JColorChooser.class
new file mode 100644
index 00000000000..671cfca567e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JColorChooser.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JComboBox$1.class b/libjava/classpath/lib/javax/swing/JComboBox$1.class
new file mode 100644
index 00000000000..bf89068bc0c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JComboBox$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JComboBox$AccessibleJComboBox.class b/libjava/classpath/lib/javax/swing/JComboBox$AccessibleJComboBox.class
new file mode 100644
index 00000000000..a5dadd997d4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JComboBox$AccessibleJComboBox.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JComboBox$DefaultKeySelectionManager.class b/libjava/classpath/lib/javax/swing/JComboBox$DefaultKeySelectionManager.class
new file mode 100644
index 00000000000..6e3691d137b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JComboBox$DefaultKeySelectionManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JComboBox$KeySelectionManager.class b/libjava/classpath/lib/javax/swing/JComboBox$KeySelectionManager.class
new file mode 100644
index 00000000000..d0cc93a6898
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JComboBox$KeySelectionManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JComboBox.class b/libjava/classpath/lib/javax/swing/JComboBox.class
new file mode 100644
index 00000000000..503032ee53d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JComboBox.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JComponent$1.class b/libjava/classpath/lib/javax/swing/JComponent$1.class
new file mode 100644
index 00000000000..93aa102eee7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JComponent$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JComponent$AccessibleJComponent$AccessibleContainerHandler.class b/libjava/classpath/lib/javax/swing/JComponent$AccessibleJComponent$AccessibleContainerHandler.class
new file mode 100644
index 00000000000..e3ff2403e64
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JComponent$AccessibleJComponent$AccessibleContainerHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JComponent$AccessibleJComponent$AccessibleFocusHandler.class b/libjava/classpath/lib/javax/swing/JComponent$AccessibleJComponent$AccessibleFocusHandler.class
new file mode 100644
index 00000000000..04ef17a8bd7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JComponent$AccessibleJComponent$AccessibleFocusHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JComponent$AccessibleJComponent.class b/libjava/classpath/lib/javax/swing/JComponent$AccessibleJComponent.class
new file mode 100644
index 00000000000..3369abda0da
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JComponent$AccessibleJComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JComponent$ActionListenerProxy.class b/libjava/classpath/lib/javax/swing/JComponent$ActionListenerProxy.class
new file mode 100644
index 00000000000..de03869e5a5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JComponent$ActionListenerProxy.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JComponent.class b/libjava/classpath/lib/javax/swing/JComponent.class
new file mode 100644
index 00000000000..38faa58d43d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JDesktopPane$AccessibleJDesktopPane.class b/libjava/classpath/lib/javax/swing/JDesktopPane$AccessibleJDesktopPane.class
new file mode 100644
index 00000000000..1e391c98412
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JDesktopPane$AccessibleJDesktopPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JDesktopPane.class b/libjava/classpath/lib/javax/swing/JDesktopPane.class
new file mode 100644
index 00000000000..1796754c8aa
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JDesktopPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JDialog$AccessibleJDialog.class b/libjava/classpath/lib/javax/swing/JDialog$AccessibleJDialog.class
new file mode 100644
index 00000000000..ff7f96fd0b6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JDialog$AccessibleJDialog.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JDialog.class b/libjava/classpath/lib/javax/swing/JDialog.class
new file mode 100644
index 00000000000..6490589814b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JDialog.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JEditorPane$1.class b/libjava/classpath/lib/javax/swing/JEditorPane$1.class
new file mode 100644
index 00000000000..f4e5adaa8d8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JEditorPane$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JEditorPane$2.class b/libjava/classpath/lib/javax/swing/JEditorPane$2.class
new file mode 100644
index 00000000000..6e31c329939
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JEditorPane$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JEditorPane$AccessibleJEditorPane.class b/libjava/classpath/lib/javax/swing/JEditorPane$AccessibleJEditorPane.class
new file mode 100644
index 00000000000..9136bf06ded
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JEditorPane$AccessibleJEditorPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JEditorPane$AccessibleJEditorPaneHTML.class b/libjava/classpath/lib/javax/swing/JEditorPane$AccessibleJEditorPaneHTML.class
new file mode 100644
index 00000000000..bad4a42ed97
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JEditorPane$AccessibleJEditorPaneHTML.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JEditorPane$EditorKitMapping.class b/libjava/classpath/lib/javax/swing/JEditorPane$EditorKitMapping.class
new file mode 100644
index 00000000000..16a82e06934
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JEditorPane$EditorKitMapping.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport$HTMLLink.class b/libjava/classpath/lib/javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport$HTMLLink.class
new file mode 100644
index 00000000000..92dbe6c6db0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport$HTMLLink.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport.class b/libjava/classpath/lib/javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport.class
new file mode 100644
index 00000000000..d1fdba2ad82
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JEditorPane$JEditorPaneAccessibleHypertextSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JEditorPane$PageLoader.class b/libjava/classpath/lib/javax/swing/JEditorPane$PageLoader.class
new file mode 100644
index 00000000000..46e86e003e5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JEditorPane$PageLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JEditorPane$PageStream.class b/libjava/classpath/lib/javax/swing/JEditorPane$PageStream.class
new file mode 100644
index 00000000000..cc7abeff0a3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JEditorPane$PageStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JEditorPane$PlainEditorKit.class b/libjava/classpath/lib/javax/swing/JEditorPane$PlainEditorKit.class
new file mode 100644
index 00000000000..52a08bda450
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JEditorPane$PlainEditorKit.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JEditorPane.class b/libjava/classpath/lib/javax/swing/JEditorPane.class
new file mode 100644
index 00000000000..3bb05c84787
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JEditorPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JFileChooser$1.class b/libjava/classpath/lib/javax/swing/JFileChooser$1.class
new file mode 100644
index 00000000000..c6035233224
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JFileChooser$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JFileChooser$AccessibleJFileChooser.class b/libjava/classpath/lib/javax/swing/JFileChooser$AccessibleJFileChooser.class
new file mode 100644
index 00000000000..8c821aa49be
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JFileChooser$AccessibleJFileChooser.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JFileChooser.class b/libjava/classpath/lib/javax/swing/JFileChooser.class
new file mode 100644
index 00000000000..4725b19dbb1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JFileChooser.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JFormattedTextField$AbstractFormatter.class b/libjava/classpath/lib/javax/swing/JFormattedTextField$AbstractFormatter.class
new file mode 100644
index 00000000000..6745dda7b57
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JFormattedTextField$AbstractFormatter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JFormattedTextField$AbstractFormatterFactory.class b/libjava/classpath/lib/javax/swing/JFormattedTextField$AbstractFormatterFactory.class
new file mode 100644
index 00000000000..8dc1d25b7f9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JFormattedTextField$AbstractFormatterFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JFormattedTextField.class b/libjava/classpath/lib/javax/swing/JFormattedTextField.class
new file mode 100644
index 00000000000..fb73ee2f557
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JFormattedTextField.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JFrame$AccessibleJFrame.class b/libjava/classpath/lib/javax/swing/JFrame$AccessibleJFrame.class
new file mode 100644
index 00000000000..cc23e67728c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JFrame$AccessibleJFrame.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JFrame.class b/libjava/classpath/lib/javax/swing/JFrame.class
new file mode 100644
index 00000000000..828e84b040a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JFrame.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JInternalFrame$AccessibleJInternalFrame.class b/libjava/classpath/lib/javax/swing/JInternalFrame$AccessibleJInternalFrame.class
new file mode 100644
index 00000000000..ca22355cc5e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JInternalFrame$AccessibleJInternalFrame.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JInternalFrame$JDesktopIcon$AccessibleJDesktopIcon.class b/libjava/classpath/lib/javax/swing/JInternalFrame$JDesktopIcon$AccessibleJDesktopIcon.class
new file mode 100644
index 00000000000..b449e93a5fc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JInternalFrame$JDesktopIcon$AccessibleJDesktopIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JInternalFrame$JDesktopIcon.class b/libjava/classpath/lib/javax/swing/JInternalFrame$JDesktopIcon.class
new file mode 100644
index 00000000000..8fac3b0791b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JInternalFrame$JDesktopIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JInternalFrame.class b/libjava/classpath/lib/javax/swing/JInternalFrame.class
new file mode 100644
index 00000000000..34e6d3e18dc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JInternalFrame.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JLabel$AccessibleJLabel.class b/libjava/classpath/lib/javax/swing/JLabel$AccessibleJLabel.class
new file mode 100644
index 00000000000..8946b03f8ec
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JLabel$AccessibleJLabel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JLabel.class b/libjava/classpath/lib/javax/swing/JLabel.class
new file mode 100644
index 00000000000..20256d03cd8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JLabel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JLayeredPane$AccessibleJLayeredPane.class b/libjava/classpath/lib/javax/swing/JLayeredPane$AccessibleJLayeredPane.class
new file mode 100644
index 00000000000..1e46eb03c81
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JLayeredPane$AccessibleJLayeredPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JLayeredPane.class b/libjava/classpath/lib/javax/swing/JLayeredPane.class
new file mode 100644
index 00000000000..6580cd0ded9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JLayeredPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JList$1.class b/libjava/classpath/lib/javax/swing/JList$1.class
new file mode 100644
index 00000000000..42fb0c50324
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JList$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JList$2.class b/libjava/classpath/lib/javax/swing/JList$2.class
new file mode 100644
index 00000000000..ab9936f9b34
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JList$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JList$3.class b/libjava/classpath/lib/javax/swing/JList$3.class
new file mode 100644
index 00000000000..26127d16446
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JList$3.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JList$AccessibleJList$AccessibleJListChild.class b/libjava/classpath/lib/javax/swing/JList$AccessibleJList$AccessibleJListChild.class
new file mode 100644
index 00000000000..31d2c948003
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JList$AccessibleJList$AccessibleJListChild.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JList$AccessibleJList.class b/libjava/classpath/lib/javax/swing/JList$AccessibleJList.class
new file mode 100644
index 00000000000..c59bd511a0b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JList$AccessibleJList.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JList$ListListener.class b/libjava/classpath/lib/javax/swing/JList$ListListener.class
new file mode 100644
index 00000000000..3a77f552318
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JList$ListListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JList.class b/libjava/classpath/lib/javax/swing/JList.class
new file mode 100644
index 00000000000..c2bfb22c23d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JList.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JMenu$AccessibleJMenu.class b/libjava/classpath/lib/javax/swing/JMenu$AccessibleJMenu.class
new file mode 100644
index 00000000000..ed7ce854701
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JMenu$AccessibleJMenu.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JMenu$ActionChangedListener.class b/libjava/classpath/lib/javax/swing/JMenu$ActionChangedListener.class
new file mode 100644
index 00000000000..c26366f2e5c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JMenu$ActionChangedListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JMenu$MenuChangeListener.class b/libjava/classpath/lib/javax/swing/JMenu$MenuChangeListener.class
new file mode 100644
index 00000000000..87bc69e1f72
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JMenu$MenuChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JMenu$WinListener.class b/libjava/classpath/lib/javax/swing/JMenu$WinListener.class
new file mode 100644
index 00000000000..9165f7253c7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JMenu$WinListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JMenu.class b/libjava/classpath/lib/javax/swing/JMenu.class
new file mode 100644
index 00000000000..a9048b4d7a9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JMenu.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JMenuBar$AccessibleJMenuBar.class b/libjava/classpath/lib/javax/swing/JMenuBar$AccessibleJMenuBar.class
new file mode 100644
index 00000000000..e18ea98b571
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JMenuBar$AccessibleJMenuBar.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JMenuBar.class b/libjava/classpath/lib/javax/swing/JMenuBar.class
new file mode 100644
index 00000000000..92fb6702672
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JMenuBar.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JMenuItem$1.class b/libjava/classpath/lib/javax/swing/JMenuItem$1.class
new file mode 100644
index 00000000000..bdbf0198d2d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JMenuItem$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JMenuItem$AccessibleJMenuItem.class b/libjava/classpath/lib/javax/swing/JMenuItem$AccessibleJMenuItem.class
new file mode 100644
index 00000000000..53d942cc2d5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JMenuItem$AccessibleJMenuItem.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JMenuItem.class b/libjava/classpath/lib/javax/swing/JMenuItem.class
new file mode 100644
index 00000000000..40ea604e64d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JMenuItem.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JOptionPane$1.class b/libjava/classpath/lib/javax/swing/JOptionPane$1.class
new file mode 100644
index 00000000000..ab081131f05
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JOptionPane$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JOptionPane$2.class b/libjava/classpath/lib/javax/swing/JOptionPane$2.class
new file mode 100644
index 00000000000..0e91f40a8c3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JOptionPane$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JOptionPane$AccessibleJOptionPane.class b/libjava/classpath/lib/javax/swing/JOptionPane$AccessibleJOptionPane.class
new file mode 100644
index 00000000000..862460639ce
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JOptionPane$AccessibleJOptionPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JOptionPane$ValuePropertyHandler.class b/libjava/classpath/lib/javax/swing/JOptionPane$ValuePropertyHandler.class
new file mode 100644
index 00000000000..1204e5cc638
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JOptionPane$ValuePropertyHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JOptionPane.class b/libjava/classpath/lib/javax/swing/JOptionPane.class
new file mode 100644
index 00000000000..1361ece20f8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JOptionPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JPanel$AccessibleJPanel.class b/libjava/classpath/lib/javax/swing/JPanel$AccessibleJPanel.class
new file mode 100644
index 00000000000..bf150651cb7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JPanel$AccessibleJPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JPanel.class b/libjava/classpath/lib/javax/swing/JPanel.class
new file mode 100644
index 00000000000..3327f966c07
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JPasswordField$AccessibleJPasswordField.class b/libjava/classpath/lib/javax/swing/JPasswordField$AccessibleJPasswordField.class
new file mode 100644
index 00000000000..ed73312d512
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JPasswordField$AccessibleJPasswordField.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JPasswordField.class b/libjava/classpath/lib/javax/swing/JPasswordField.class
new file mode 100644
index 00000000000..98f7e241bd3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JPasswordField.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JPopupMenu$1.class b/libjava/classpath/lib/javax/swing/JPopupMenu$1.class
new file mode 100644
index 00000000000..f1856f1b860
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JPopupMenu$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JPopupMenu$2.class b/libjava/classpath/lib/javax/swing/JPopupMenu$2.class
new file mode 100644
index 00000000000..4aae7a1c3ae
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JPopupMenu$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JPopupMenu$AccessibleJPopupMenu.class b/libjava/classpath/lib/javax/swing/JPopupMenu$AccessibleJPopupMenu.class
new file mode 100644
index 00000000000..c54d3c7531a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JPopupMenu$AccessibleJPopupMenu.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JPopupMenu$ActionChangeListener.class b/libjava/classpath/lib/javax/swing/JPopupMenu$ActionChangeListener.class
new file mode 100644
index 00000000000..0699c204b9c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JPopupMenu$ActionChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JPopupMenu$Separator.class b/libjava/classpath/lib/javax/swing/JPopupMenu$Separator.class
new file mode 100644
index 00000000000..30e53542570
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JPopupMenu$Separator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JPopupMenu.class b/libjava/classpath/lib/javax/swing/JPopupMenu.class
new file mode 100644
index 00000000000..37103a576a8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JPopupMenu.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JProgressBar$1.class b/libjava/classpath/lib/javax/swing/JProgressBar$1.class
new file mode 100644
index 00000000000..cb2dd14d1a9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JProgressBar$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JProgressBar$AccessibleJProgressBar.class b/libjava/classpath/lib/javax/swing/JProgressBar$AccessibleJProgressBar.class
new file mode 100644
index 00000000000..f6b14bd6e7e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JProgressBar$AccessibleJProgressBar.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JProgressBar.class b/libjava/classpath/lib/javax/swing/JProgressBar.class
new file mode 100644
index 00000000000..2ccf5e6bb7f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JProgressBar.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JRadioButton$AccessibleJRadioButton.class b/libjava/classpath/lib/javax/swing/JRadioButton$AccessibleJRadioButton.class
new file mode 100644
index 00000000000..00524ec2e5c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JRadioButton$AccessibleJRadioButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JRadioButton.class b/libjava/classpath/lib/javax/swing/JRadioButton.class
new file mode 100644
index 00000000000..027ac9eeedb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JRadioButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JRadioButtonMenuItem$AccessibleJRadioButtonMenuItem.class b/libjava/classpath/lib/javax/swing/JRadioButtonMenuItem$AccessibleJRadioButtonMenuItem.class
new file mode 100644
index 00000000000..ff2f31ef7c5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JRadioButtonMenuItem$AccessibleJRadioButtonMenuItem.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JRadioButtonMenuItem.class b/libjava/classpath/lib/javax/swing/JRadioButtonMenuItem.class
new file mode 100644
index 00000000000..db31f6240d0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JRadioButtonMenuItem.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JRootPane$AccessibleJRootPane.class b/libjava/classpath/lib/javax/swing/JRootPane$AccessibleJRootPane.class
new file mode 100644
index 00000000000..d6aec0e9edf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JRootPane$AccessibleJRootPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JRootPane$RootLayout.class b/libjava/classpath/lib/javax/swing/JRootPane$RootLayout.class
new file mode 100644
index 00000000000..380fda2cf75
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JRootPane$RootLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JRootPane.class b/libjava/classpath/lib/javax/swing/JRootPane.class
new file mode 100644
index 00000000000..c1d0917111d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JRootPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JScrollBar$AccessibleJScrollBar.class b/libjava/classpath/lib/javax/swing/JScrollBar$AccessibleJScrollBar.class
new file mode 100644
index 00000000000..c5d0e5522fc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JScrollBar$AccessibleJScrollBar.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JScrollBar$ScrollBarChangeListener.class b/libjava/classpath/lib/javax/swing/JScrollBar$ScrollBarChangeListener.class
new file mode 100644
index 00000000000..e102fcbbd7b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JScrollBar$ScrollBarChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JScrollBar.class b/libjava/classpath/lib/javax/swing/JScrollBar.class
new file mode 100644
index 00000000000..050a5d2619f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JScrollBar.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JScrollPane$AccessibleJScrollPane.class b/libjava/classpath/lib/javax/swing/JScrollPane$AccessibleJScrollPane.class
new file mode 100644
index 00000000000..98f6a303b70
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JScrollPane$AccessibleJScrollPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JScrollPane$ScrollBar.class b/libjava/classpath/lib/javax/swing/JScrollPane$ScrollBar.class
new file mode 100644
index 00000000000..572bdb0a178
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JScrollPane$ScrollBar.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JScrollPane.class b/libjava/classpath/lib/javax/swing/JScrollPane.class
new file mode 100644
index 00000000000..6bd9efaa866
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JScrollPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSeparator$AccessibleJSeparator.class b/libjava/classpath/lib/javax/swing/JSeparator$AccessibleJSeparator.class
new file mode 100644
index 00000000000..a1cf17fecfb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSeparator$AccessibleJSeparator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSeparator.class b/libjava/classpath/lib/javax/swing/JSeparator.class
new file mode 100644
index 00000000000..31e7ffbfc8c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSeparator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSlider$1.class b/libjava/classpath/lib/javax/swing/JSlider$1.class
new file mode 100644
index 00000000000..18fdf59abbf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSlider$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSlider$AccessibleJSlider.class b/libjava/classpath/lib/javax/swing/JSlider$AccessibleJSlider.class
new file mode 100644
index 00000000000..fe64eba7ba0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSlider$AccessibleJSlider.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSlider$LabelUIResource.class b/libjava/classpath/lib/javax/swing/JSlider$LabelUIResource.class
new file mode 100644
index 00000000000..7019accc2c7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSlider$LabelUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSlider.class b/libjava/classpath/lib/javax/swing/JSlider.class
new file mode 100644
index 00000000000..81904b2f71c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSlider.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSpinner$DateEditor.class b/libjava/classpath/lib/javax/swing/JSpinner$DateEditor.class
new file mode 100644
index 00000000000..f0f5617206a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSpinner$DateEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSpinner$DateEditorFormatter.class b/libjava/classpath/lib/javax/swing/JSpinner$DateEditorFormatter.class
new file mode 100644
index 00000000000..52508b0d909
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSpinner$DateEditorFormatter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSpinner$DefaultEditor.class b/libjava/classpath/lib/javax/swing/JSpinner$DefaultEditor.class
new file mode 100644
index 00000000000..e3b9c503c71
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSpinner$DefaultEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSpinner$ListEditor.class b/libjava/classpath/lib/javax/swing/JSpinner$ListEditor.class
new file mode 100644
index 00000000000..677b39c25dc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSpinner$ListEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSpinner$ModelListener.class b/libjava/classpath/lib/javax/swing/JSpinner$ModelListener.class
new file mode 100644
index 00000000000..4689a7f67a8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSpinner$ModelListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSpinner$NumberEditor.class b/libjava/classpath/lib/javax/swing/JSpinner$NumberEditor.class
new file mode 100644
index 00000000000..4d9733fcda7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSpinner$NumberEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSpinner$NumberEditorFormatter.class b/libjava/classpath/lib/javax/swing/JSpinner$NumberEditorFormatter.class
new file mode 100644
index 00000000000..279d6ca751f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSpinner$NumberEditorFormatter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSpinner.class b/libjava/classpath/lib/javax/swing/JSpinner.class
new file mode 100644
index 00000000000..ac2ecb6c5f3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSpinner.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSplitPane$AccessibleJSplitPane.class b/libjava/classpath/lib/javax/swing/JSplitPane$AccessibleJSplitPane.class
new file mode 100644
index 00000000000..3e37bf659e3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSplitPane$AccessibleJSplitPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JSplitPane.class b/libjava/classpath/lib/javax/swing/JSplitPane.class
new file mode 100644
index 00000000000..2e9fff044f6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JSplitPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTabbedPane$AccessibleJTabbedPane.class b/libjava/classpath/lib/javax/swing/JTabbedPane$AccessibleJTabbedPane.class
new file mode 100644
index 00000000000..4ea0de1df13
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTabbedPane$AccessibleJTabbedPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTabbedPane$ModelListener.class b/libjava/classpath/lib/javax/swing/JTabbedPane$ModelListener.class
new file mode 100644
index 00000000000..5b8d73e5151
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTabbedPane$ModelListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTabbedPane$Page.class b/libjava/classpath/lib/javax/swing/JTabbedPane$Page.class
new file mode 100644
index 00000000000..e28c57d62a9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTabbedPane$Page.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTabbedPane.class b/libjava/classpath/lib/javax/swing/JTabbedPane.class
new file mode 100644
index 00000000000..efd54431204
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTabbedPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleJTableCell.class b/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleJTableCell.class
new file mode 100644
index 00000000000..25959aadd64
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleJTableCell.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleJTableHeaderCell.class b/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleJTableHeaderCell.class
new file mode 100644
index 00000000000..97ff047d2a4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleJTableHeaderCell.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleJTableModelChange.class b/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleJTableModelChange.class
new file mode 100644
index 00000000000..b6c6dc1803c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleJTableModelChange.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleTableHeader.class b/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleTableHeader.class
new file mode 100644
index 00000000000..7448b71d771
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable$AccessibleTableHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable.class b/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable.class
new file mode 100644
index 00000000000..399752fdb0f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTable$AccessibleJTable.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTable$BooleanCellRenderer.class b/libjava/classpath/lib/javax/swing/JTable$BooleanCellRenderer.class
new file mode 100644
index 00000000000..5ec5ad8710e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTable$BooleanCellRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTable$DateCellRenderer.class b/libjava/classpath/lib/javax/swing/JTable$DateCellRenderer.class
new file mode 100644
index 00000000000..d9c191ee6b3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTable$DateCellRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTable$DoubleCellRenderer.class b/libjava/classpath/lib/javax/swing/JTable$DoubleCellRenderer.class
new file mode 100644
index 00000000000..396d1d6ee23
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTable$DoubleCellRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTable$FloatCellRenderer.class b/libjava/classpath/lib/javax/swing/JTable$FloatCellRenderer.class
new file mode 100644
index 00000000000..fe32e21431c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTable$FloatCellRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTable$IconCellRenderer.class b/libjava/classpath/lib/javax/swing/JTable$IconCellRenderer.class
new file mode 100644
index 00000000000..40cf73d5976
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTable$IconCellRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTable$NumberCellRenderer.class b/libjava/classpath/lib/javax/swing/JTable$NumberCellRenderer.class
new file mode 100644
index 00000000000..d1897beeb1d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTable$NumberCellRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTable$TableColumnPropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/JTable$TableColumnPropertyChangeHandler.class
new file mode 100644
index 00000000000..644cb82cf98
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTable$TableColumnPropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTable$TableTextField.class b/libjava/classpath/lib/javax/swing/JTable$TableTextField.class
new file mode 100644
index 00000000000..cf5a5f50eb8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTable$TableTextField.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTable.class b/libjava/classpath/lib/javax/swing/JTable.class
new file mode 100644
index 00000000000..315e368ff14
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTable.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTextArea$AccessibleJTextArea.class b/libjava/classpath/lib/javax/swing/JTextArea$AccessibleJTextArea.class
new file mode 100644
index 00000000000..eb2cea250c6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTextArea$AccessibleJTextArea.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTextArea.class b/libjava/classpath/lib/javax/swing/JTextArea.class
new file mode 100644
index 00000000000..6ae5aff328f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTextArea.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTextField$1.class b/libjava/classpath/lib/javax/swing/JTextField$1.class
new file mode 100644
index 00000000000..e1779a187cc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTextField$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTextField$2.class b/libjava/classpath/lib/javax/swing/JTextField$2.class
new file mode 100644
index 00000000000..cc4895b1696
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTextField$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTextField$AccessibleJTextField.class b/libjava/classpath/lib/javax/swing/JTextField$AccessibleJTextField.class
new file mode 100644
index 00000000000..82f6f680d3f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTextField$AccessibleJTextField.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTextField.class b/libjava/classpath/lib/javax/swing/JTextField.class
new file mode 100644
index 00000000000..70f42e6ff56
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTextField.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTextPane.class b/libjava/classpath/lib/javax/swing/JTextPane.class
new file mode 100644
index 00000000000..d033c8d99ac
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTextPane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JToggleButton$AccessibleJToggleButton.class b/libjava/classpath/lib/javax/swing/JToggleButton$AccessibleJToggleButton.class
new file mode 100644
index 00000000000..481d5bd7975
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JToggleButton$AccessibleJToggleButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JToggleButton$ToggleButtonModel.class b/libjava/classpath/lib/javax/swing/JToggleButton$ToggleButtonModel.class
new file mode 100644
index 00000000000..a6c50d9d931
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JToggleButton$ToggleButtonModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JToggleButton.class b/libjava/classpath/lib/javax/swing/JToggleButton.class
new file mode 100644
index 00000000000..93fc984edf0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JToggleButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JToolBar$AccessibleJToolBar.class b/libjava/classpath/lib/javax/swing/JToolBar$AccessibleJToolBar.class
new file mode 100644
index 00000000000..774d4642a9c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JToolBar$AccessibleJToolBar.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JToolBar$DefaultToolBarLayout.class b/libjava/classpath/lib/javax/swing/JToolBar$DefaultToolBarLayout.class
new file mode 100644
index 00000000000..59f1e071601
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JToolBar$DefaultToolBarLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JToolBar$Separator.class b/libjava/classpath/lib/javax/swing/JToolBar$Separator.class
new file mode 100644
index 00000000000..f046b5f0f18
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JToolBar$Separator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JToolBar.class b/libjava/classpath/lib/javax/swing/JToolBar.class
new file mode 100644
index 00000000000..6a6953bf300
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JToolBar.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JToolTip$AccessibleJToolTip.class b/libjava/classpath/lib/javax/swing/JToolTip$AccessibleJToolTip.class
new file mode 100644
index 00000000000..95de6b2b6ec
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JToolTip$AccessibleJToolTip.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JToolTip.class b/libjava/classpath/lib/javax/swing/JToolTip.class
new file mode 100644
index 00000000000..116ed28ce08
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JToolTip.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTree$AccessibleJTree$AccessibleJTreeNode.class b/libjava/classpath/lib/javax/swing/JTree$AccessibleJTree$AccessibleJTreeNode.class
new file mode 100644
index 00000000000..c8135e7a931
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTree$AccessibleJTree$AccessibleJTreeNode.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTree$AccessibleJTree.class b/libjava/classpath/lib/javax/swing/JTree$AccessibleJTree.class
new file mode 100644
index 00000000000..3422e491fc7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTree$AccessibleJTree.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTree$DynamicUtilTreeNode.class b/libjava/classpath/lib/javax/swing/JTree$DynamicUtilTreeNode.class
new file mode 100644
index 00000000000..07a5163062f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTree$DynamicUtilTreeNode.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTree$EmptySelectionModel.class b/libjava/classpath/lib/javax/swing/JTree$EmptySelectionModel.class
new file mode 100644
index 00000000000..d6f42a94ea2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTree$EmptySelectionModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTree$TreeModelHandler.class b/libjava/classpath/lib/javax/swing/JTree$TreeModelHandler.class
new file mode 100644
index 00000000000..b9f253a06ab
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTree$TreeModelHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTree$TreeSelectionRedirector.class b/libjava/classpath/lib/javax/swing/JTree$TreeSelectionRedirector.class
new file mode 100644
index 00000000000..282a983d60d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTree$TreeSelectionRedirector.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JTree.class b/libjava/classpath/lib/javax/swing/JTree.class
new file mode 100644
index 00000000000..2570745c895
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JTree.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JViewport$AccessibleJViewport.class b/libjava/classpath/lib/javax/swing/JViewport$AccessibleJViewport.class
new file mode 100644
index 00000000000..0a8b5376ff6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JViewport$AccessibleJViewport.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JViewport$ViewListener.class b/libjava/classpath/lib/javax/swing/JViewport$ViewListener.class
new file mode 100644
index 00000000000..f00e1d9dbcf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JViewport$ViewListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JViewport.class b/libjava/classpath/lib/javax/swing/JViewport.class
new file mode 100644
index 00000000000..9d7a62b6d46
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JViewport.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JWindow$AccessibleJWindow.class b/libjava/classpath/lib/javax/swing/JWindow$AccessibleJWindow.class
new file mode 100644
index 00000000000..02c1613da11
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JWindow$AccessibleJWindow.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/JWindow.class b/libjava/classpath/lib/javax/swing/JWindow.class
new file mode 100644
index 00000000000..c1f07bc37d0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/JWindow.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/KeyStroke.class b/libjava/classpath/lib/javax/swing/KeyStroke.class
new file mode 100644
index 00000000000..36bea814788
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/KeyStroke.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/KeyboardManager.class b/libjava/classpath/lib/javax/swing/KeyboardManager.class
new file mode 100644
index 00000000000..c7605026eb7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/KeyboardManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/LayoutFocusTraversalPolicy$LayoutComparator.class b/libjava/classpath/lib/javax/swing/LayoutFocusTraversalPolicy$LayoutComparator.class
new file mode 100644
index 00000000000..06f7b389c85
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/LayoutFocusTraversalPolicy$LayoutComparator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/LayoutFocusTraversalPolicy.class b/libjava/classpath/lib/javax/swing/LayoutFocusTraversalPolicy.class
new file mode 100644
index 00000000000..3260ce6e40f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/LayoutFocusTraversalPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ListCellRenderer.class b/libjava/classpath/lib/javax/swing/ListCellRenderer.class
new file mode 100644
index 00000000000..360e23d39e2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ListCellRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ListModel.class b/libjava/classpath/lib/javax/swing/ListModel.class
new file mode 100644
index 00000000000..63e4dd88fb7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ListModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ListSelectionModel.class b/libjava/classpath/lib/javax/swing/ListSelectionModel.class
new file mode 100644
index 00000000000..646ce27b5d1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ListSelectionModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/LookAndFeel$1.class b/libjava/classpath/lib/javax/swing/LookAndFeel$1.class
new file mode 100644
index 00000000000..ea75ce9c974
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/LookAndFeel$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/LookAndFeel.class b/libjava/classpath/lib/javax/swing/LookAndFeel.class
new file mode 100644
index 00000000000..a6324bdc5a5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/LookAndFeel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/MenuElement.class b/libjava/classpath/lib/javax/swing/MenuElement.class
new file mode 100644
index 00000000000..a1f74ae881e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/MenuElement.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/MenuSelectionManager.class b/libjava/classpath/lib/javax/swing/MenuSelectionManager.class
new file mode 100644
index 00000000000..dd19ae966df
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/MenuSelectionManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/MutableComboBoxModel.class b/libjava/classpath/lib/javax/swing/MutableComboBoxModel.class
new file mode 100644
index 00000000000..9bd0834ce47
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/MutableComboBoxModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/OverlayLayout.class b/libjava/classpath/lib/javax/swing/OverlayLayout.class
new file mode 100644
index 00000000000..36a5ef7bed5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/OverlayLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Popup$JWindowPopup.class b/libjava/classpath/lib/javax/swing/Popup$JWindowPopup.class
new file mode 100644
index 00000000000..3da22354b67
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Popup$JWindowPopup.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Popup$LightweightPopup.class b/libjava/classpath/lib/javax/swing/Popup$LightweightPopup.class
new file mode 100644
index 00000000000..2b63a0a4280
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Popup$LightweightPopup.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Popup.class b/libjava/classpath/lib/javax/swing/Popup.class
new file mode 100644
index 00000000000..f81002f448c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Popup.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/PopupFactory.class b/libjava/classpath/lib/javax/swing/PopupFactory.class
new file mode 100644
index 00000000000..9058adaec1a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/PopupFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ProgressMonitor$1.class b/libjava/classpath/lib/javax/swing/ProgressMonitor$1.class
new file mode 100644
index 00000000000..555ce792bef
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ProgressMonitor$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ProgressMonitor$TimerListener.class b/libjava/classpath/lib/javax/swing/ProgressMonitor$TimerListener.class
new file mode 100644
index 00000000000..7452e05d3f1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ProgressMonitor$TimerListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ProgressMonitor.class b/libjava/classpath/lib/javax/swing/ProgressMonitor.class
new file mode 100644
index 00000000000..391ae29249f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ProgressMonitor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ProgressMonitorInputStream.class b/libjava/classpath/lib/javax/swing/ProgressMonitorInputStream.class
new file mode 100644
index 00000000000..4eea734ba66
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ProgressMonitorInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Renderer.class b/libjava/classpath/lib/javax/swing/Renderer.class
new file mode 100644
index 00000000000..ab10de9420a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Renderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/RepaintManager$RepaintWorker.class b/libjava/classpath/lib/javax/swing/RepaintManager$RepaintWorker.class
new file mode 100644
index 00000000000..25387601917
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/RepaintManager$RepaintWorker.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/RepaintManager$RepaintWorkerEvent.class b/libjava/classpath/lib/javax/swing/RepaintManager$RepaintWorkerEvent.class
new file mode 100644
index 00000000000..17ccff4f009
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/RepaintManager$RepaintWorkerEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/RepaintManager.class b/libjava/classpath/lib/javax/swing/RepaintManager.class
new file mode 100644
index 00000000000..d9925f314f9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/RepaintManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/RootPaneContainer.class b/libjava/classpath/lib/javax/swing/RootPaneContainer.class
new file mode 100644
index 00000000000..86c957ee002
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/RootPaneContainer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ScrollPaneConstants.class b/libjava/classpath/lib/javax/swing/ScrollPaneConstants.class
new file mode 100644
index 00000000000..5d291ad0acd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ScrollPaneConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ScrollPaneLayout$UIResource.class b/libjava/classpath/lib/javax/swing/ScrollPaneLayout$UIResource.class
new file mode 100644
index 00000000000..de7b6a92838
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ScrollPaneLayout$UIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ScrollPaneLayout.class b/libjava/classpath/lib/javax/swing/ScrollPaneLayout.class
new file mode 100644
index 00000000000..de8d24f263a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ScrollPaneLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Scrollable.class b/libjava/classpath/lib/javax/swing/Scrollable.class
new file mode 100644
index 00000000000..abfd535f14d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Scrollable.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SingleSelectionModel.class b/libjava/classpath/lib/javax/swing/SingleSelectionModel.class
new file mode 100644
index 00000000000..4d13386a675
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SingleSelectionModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SizeRequirements.class b/libjava/classpath/lib/javax/swing/SizeRequirements.class
new file mode 100644
index 00000000000..8c0e5c834f4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SizeRequirements.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SizeSequence.class b/libjava/classpath/lib/javax/swing/SizeSequence.class
new file mode 100644
index 00000000000..934e9faaa80
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SizeSequence.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SortingFocusTraversalPolicy.class b/libjava/classpath/lib/javax/swing/SortingFocusTraversalPolicy.class
new file mode 100644
index 00000000000..1c620d97c20
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SortingFocusTraversalPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SpinnerDateModel.class b/libjava/classpath/lib/javax/swing/SpinnerDateModel.class
new file mode 100644
index 00000000000..c4c8a655ad1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SpinnerDateModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SpinnerListModel.class b/libjava/classpath/lib/javax/swing/SpinnerListModel.class
new file mode 100644
index 00000000000..3f686f5be03
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SpinnerListModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SpinnerModel.class b/libjava/classpath/lib/javax/swing/SpinnerModel.class
new file mode 100644
index 00000000000..57431dc00c8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SpinnerModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SpinnerNumberModel.class b/libjava/classpath/lib/javax/swing/SpinnerNumberModel.class
new file mode 100644
index 00000000000..aa5e0fc15a3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SpinnerNumberModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Spring$1.class b/libjava/classpath/lib/javax/swing/Spring$1.class
new file mode 100644
index 00000000000..ad8aedc1619
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Spring$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Spring$2.class b/libjava/classpath/lib/javax/swing/Spring$2.class
new file mode 100644
index 00000000000..f15a83d2911
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Spring$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Spring$3.class b/libjava/classpath/lib/javax/swing/Spring$3.class
new file mode 100644
index 00000000000..4dd892a5779
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Spring$3.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Spring$AddSpring.class b/libjava/classpath/lib/javax/swing/Spring$AddSpring.class
new file mode 100644
index 00000000000..f1502eab240
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Spring$AddSpring.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Spring$MaxSpring.class b/libjava/classpath/lib/javax/swing/Spring$MaxSpring.class
new file mode 100644
index 00000000000..9984c511c81
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Spring$MaxSpring.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Spring$MinusSpring.class b/libjava/classpath/lib/javax/swing/Spring$MinusSpring.class
new file mode 100644
index 00000000000..4e0a694841a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Spring$MinusSpring.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Spring$SimpleSpring.class b/libjava/classpath/lib/javax/swing/Spring$SimpleSpring.class
new file mode 100644
index 00000000000..15cf67f7dfa
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Spring$SimpleSpring.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Spring.class b/libjava/classpath/lib/javax/swing/Spring.class
new file mode 100644
index 00000000000..14b09ee65b9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Spring.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SpringLayout$Constraints.class b/libjava/classpath/lib/javax/swing/SpringLayout$Constraints.class
new file mode 100644
index 00000000000..39fd462f3bb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SpringLayout$Constraints.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SpringLayout$DeferredDimension.class b/libjava/classpath/lib/javax/swing/SpringLayout$DeferredDimension.class
new file mode 100644
index 00000000000..61075d7fc14
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SpringLayout$DeferredDimension.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SpringLayout$DeferredHeight.class b/libjava/classpath/lib/javax/swing/SpringLayout$DeferredHeight.class
new file mode 100644
index 00000000000..1a1ce923f6b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SpringLayout$DeferredHeight.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SpringLayout$DeferredSpring.class b/libjava/classpath/lib/javax/swing/SpringLayout$DeferredSpring.class
new file mode 100644
index 00000000000..882868515cb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SpringLayout$DeferredSpring.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SpringLayout$DeferredWidth.class b/libjava/classpath/lib/javax/swing/SpringLayout$DeferredWidth.class
new file mode 100644
index 00000000000..7aa03dbc142
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SpringLayout$DeferredWidth.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SpringLayout.class b/libjava/classpath/lib/javax/swing/SpringLayout.class
new file mode 100644
index 00000000000..0a6b9880e22
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SpringLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SwingConstants.class b/libjava/classpath/lib/javax/swing/SwingConstants.class
new file mode 100644
index 00000000000..f4dc6706207
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SwingConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SwingUtilities$OwnerFrame.class b/libjava/classpath/lib/javax/swing/SwingUtilities$OwnerFrame.class
new file mode 100644
index 00000000000..71c8e039550
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SwingUtilities$OwnerFrame.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/SwingUtilities.class b/libjava/classpath/lib/javax/swing/SwingUtilities.class
new file mode 100644
index 00000000000..756f001dad2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/SwingUtilities.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Timer$1.class b/libjava/classpath/lib/javax/swing/Timer$1.class
new file mode 100644
index 00000000000..e72b779b008
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Timer$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Timer$Task.class b/libjava/classpath/lib/javax/swing/Timer$Task.class
new file mode 100644
index 00000000000..7924b004b48
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Timer$Task.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/Timer.class b/libjava/classpath/lib/javax/swing/Timer.class
new file mode 100644
index 00000000000..60201c69dc1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/Timer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ToolTipManager$insideTimerAction.class b/libjava/classpath/lib/javax/swing/ToolTipManager$insideTimerAction.class
new file mode 100644
index 00000000000..4a034e94610
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ToolTipManager$insideTimerAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ToolTipManager$outsideTimerAction.class b/libjava/classpath/lib/javax/swing/ToolTipManager$outsideTimerAction.class
new file mode 100644
index 00000000000..afff9965983
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ToolTipManager$outsideTimerAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ToolTipManager$stillInsideTimerAction.class b/libjava/classpath/lib/javax/swing/ToolTipManager$stillInsideTimerAction.class
new file mode 100644
index 00000000000..4ea6dd045c3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ToolTipManager$stillInsideTimerAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ToolTipManager.class b/libjava/classpath/lib/javax/swing/ToolTipManager.class
new file mode 100644
index 00000000000..1f1ee99cfe7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ToolTipManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/TransferHandler$PropertyTransferable.class b/libjava/classpath/lib/javax/swing/TransferHandler$PropertyTransferable.class
new file mode 100644
index 00000000000..358f741a0cf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/TransferHandler$PropertyTransferable.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/TransferHandler$TransferAction.class b/libjava/classpath/lib/javax/swing/TransferHandler$TransferAction.class
new file mode 100644
index 00000000000..74cf8d1805d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/TransferHandler$TransferAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/TransferHandler.class b/libjava/classpath/lib/javax/swing/TransferHandler.class
new file mode 100644
index 00000000000..edfe4ded48d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/TransferHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/UIDefaults$1.class b/libjava/classpath/lib/javax/swing/UIDefaults$1.class
new file mode 100644
index 00000000000..32dea19aa83
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/UIDefaults$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/UIDefaults$2.class b/libjava/classpath/lib/javax/swing/UIDefaults$2.class
new file mode 100644
index 00000000000..9b29d3d0199
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/UIDefaults$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/UIDefaults$3.class b/libjava/classpath/lib/javax/swing/UIDefaults$3.class
new file mode 100644
index 00000000000..1179015a6da
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/UIDefaults$3.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/UIDefaults$4.class b/libjava/classpath/lib/javax/swing/UIDefaults$4.class
new file mode 100644
index 00000000000..6d6462f7959
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/UIDefaults$4.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/UIDefaults$ActiveValue.class b/libjava/classpath/lib/javax/swing/UIDefaults$ActiveValue.class
new file mode 100644
index 00000000000..2decb357fbc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/UIDefaults$ActiveValue.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/UIDefaults$LazyInputMap.class b/libjava/classpath/lib/javax/swing/UIDefaults$LazyInputMap.class
new file mode 100644
index 00000000000..53000f252ad
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/UIDefaults$LazyInputMap.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/UIDefaults$LazyValue.class b/libjava/classpath/lib/javax/swing/UIDefaults$LazyValue.class
new file mode 100644
index 00000000000..c32e7cdad12
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/UIDefaults$LazyValue.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/UIDefaults$ProxyLazyValue.class b/libjava/classpath/lib/javax/swing/UIDefaults$ProxyLazyValue.class
new file mode 100644
index 00000000000..2a054b69942
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/UIDefaults$ProxyLazyValue.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/UIDefaults.class b/libjava/classpath/lib/javax/swing/UIDefaults.class
new file mode 100644
index 00000000000..e98ebb0aee7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/UIDefaults.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/UIManager$LookAndFeelInfo.class b/libjava/classpath/lib/javax/swing/UIManager$LookAndFeelInfo.class
new file mode 100644
index 00000000000..e5c53185d6a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/UIManager$LookAndFeelInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/UIManager$MultiplexUIDefaults$MultiplexEnumeration.class b/libjava/classpath/lib/javax/swing/UIManager$MultiplexUIDefaults$MultiplexEnumeration.class
new file mode 100644
index 00000000000..b5d3a363b2e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/UIManager$MultiplexUIDefaults$MultiplexEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/UIManager$MultiplexUIDefaults.class b/libjava/classpath/lib/javax/swing/UIManager$MultiplexUIDefaults.class
new file mode 100644
index 00000000000..287c124b8e9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/UIManager$MultiplexUIDefaults.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/UIManager.class b/libjava/classpath/lib/javax/swing/UIManager.class
new file mode 100644
index 00000000000..2cfeef71fcd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/UIManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/UnsupportedLookAndFeelException.class b/libjava/classpath/lib/javax/swing/UnsupportedLookAndFeelException.class
new file mode 100644
index 00000000000..e449f1fdbae
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/UnsupportedLookAndFeelException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/ViewportLayout.class b/libjava/classpath/lib/javax/swing/ViewportLayout.class
new file mode 100644
index 00000000000..62302458a17
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/ViewportLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/WindowConstants.class b/libjava/classpath/lib/javax/swing/WindowConstants.class
new file mode 100644
index 00000000000..618deb3e545
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/WindowConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/border/AbstractBorder.class b/libjava/classpath/lib/javax/swing/border/AbstractBorder.class
new file mode 100644
index 00000000000..9efcb3d3d33
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/border/AbstractBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/border/BevelBorder.class b/libjava/classpath/lib/javax/swing/border/BevelBorder.class
new file mode 100644
index 00000000000..d2aed282c18
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/border/BevelBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/border/Border.class b/libjava/classpath/lib/javax/swing/border/Border.class
new file mode 100644
index 00000000000..8b4d2481f05
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/border/Border.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/border/CompoundBorder.class b/libjava/classpath/lib/javax/swing/border/CompoundBorder.class
new file mode 100644
index 00000000000..82217a91221
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/border/CompoundBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/border/EmptyBorder.class b/libjava/classpath/lib/javax/swing/border/EmptyBorder.class
new file mode 100644
index 00000000000..a52e69bcca7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/border/EmptyBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/border/EtchedBorder.class b/libjava/classpath/lib/javax/swing/border/EtchedBorder.class
new file mode 100644
index 00000000000..8d8546a6028
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/border/EtchedBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/border/LineBorder.class b/libjava/classpath/lib/javax/swing/border/LineBorder.class
new file mode 100644
index 00000000000..795532e5fcd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/border/LineBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/border/MatteBorder.class b/libjava/classpath/lib/javax/swing/border/MatteBorder.class
new file mode 100644
index 00000000000..5164f1d4bfa
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/border/MatteBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/border/SoftBevelBorder.class b/libjava/classpath/lib/javax/swing/border/SoftBevelBorder.class
new file mode 100644
index 00000000000..7fddbd92369
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/border/SoftBevelBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/border/TitledBorder.class b/libjava/classpath/lib/javax/swing/border/TitledBorder.class
new file mode 100644
index 00000000000..6dc69c08eae
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/border/TitledBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/AbstractColorChooserPanel.class b/libjava/classpath/lib/javax/swing/colorchooser/AbstractColorChooserPanel.class
new file mode 100644
index 00000000000..3fa69f6d7aa
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/AbstractColorChooserPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/ColorChooserComponentFactory.class b/libjava/classpath/lib/javax/swing/colorchooser/ColorChooserComponentFactory.class
new file mode 100644
index 00000000000..5bb8a500df2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/ColorChooserComponentFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/ColorSelectionModel.class b/libjava/classpath/lib/javax/swing/colorchooser/ColorSelectionModel.class
new file mode 100644
index 00000000000..c94ff4992ae
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/ColorSelectionModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultColorSelectionModel.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultColorSelectionModel.class
new file mode 100644
index 00000000000..f17a4561ecf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultColorSelectionModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$1.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$1.class
new file mode 100644
index 00000000000..573204b82d0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$2.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$2.class
new file mode 100644
index 00000000000..9c3a41fec20
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$ImageScrollListener.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$ImageScrollListener.class
new file mode 100644
index 00000000000..0d4856f6b82
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$ImageScrollListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$MainGradientMouseListener.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$MainGradientMouseListener.class
new file mode 100644
index 00000000000..ce9f6d8f3e8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$MainGradientMouseListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$RadioStateListener.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$RadioStateListener.class
new file mode 100644
index 00000000000..d492677e53a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$RadioStateListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$SliderChangeListener.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$SliderChangeListener.class
new file mode 100644
index 00000000000..67df592db64
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel$SliderChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel.class
new file mode 100644
index 00000000000..98f5b2af8d8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultHSBChooserPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultPreviewPanel$PreviewBorder.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultPreviewPanel$PreviewBorder.class
new file mode 100644
index 00000000000..eda8457f94a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultPreviewPanel$PreviewBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultPreviewPanel.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultPreviewPanel.class
new file mode 100644
index 00000000000..34aef0e5a6f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultPreviewPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultRGBChooserPanel$SliderHandler.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultRGBChooserPanel$SliderHandler.class
new file mode 100644
index 00000000000..872e5bc8a49
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultRGBChooserPanel$SliderHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultRGBChooserPanel$SpinnerHandler.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultRGBChooserPanel$SpinnerHandler.class
new file mode 100644
index 00000000000..fcc40908952
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultRGBChooserPanel$SpinnerHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultRGBChooserPanel.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultRGBChooserPanel.class
new file mode 100644
index 00000000000..9d217335d72
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultRGBChooserPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$MainPanelLayout.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$MainPanelLayout.class
new file mode 100644
index 00000000000..156c2e8ca60
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$MainPanelLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$MainSwatchPanel.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$MainSwatchPanel.class
new file mode 100644
index 00000000000..717173ea7a9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$MainSwatchPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$MouseHandler.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$MouseHandler.class
new file mode 100644
index 00000000000..45720185a81
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$MouseHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$RecentPanelLayout.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$RecentPanelLayout.class
new file mode 100644
index 00000000000..11a2bad17ae
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$RecentPanelLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$RecentSwatchPanel.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$RecentSwatchPanel.class
new file mode 100644
index 00000000000..313df8e8da9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$RecentSwatchPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$SwatchPanel.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$SwatchPanel.class
new file mode 100644
index 00000000000..897baa18b40
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel$SwatchPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel.class b/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel.class
new file mode 100644
index 00000000000..3b0537db801
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/colorchooser/DefaultSwatchChooserPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/AncestorEvent.class b/libjava/classpath/lib/javax/swing/event/AncestorEvent.class
new file mode 100644
index 00000000000..3f46cc76c02
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/AncestorEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/AncestorListener.class b/libjava/classpath/lib/javax/swing/event/AncestorListener.class
new file mode 100644
index 00000000000..b9ca69323a3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/AncestorListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/CaretEvent.class b/libjava/classpath/lib/javax/swing/event/CaretEvent.class
new file mode 100644
index 00000000000..5396a896b99
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/CaretEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/CaretListener.class b/libjava/classpath/lib/javax/swing/event/CaretListener.class
new file mode 100644
index 00000000000..73e6ddc5e9e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/CaretListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/CellEditorListener.class b/libjava/classpath/lib/javax/swing/event/CellEditorListener.class
new file mode 100644
index 00000000000..3a7e3fa7542
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/CellEditorListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/ChangeEvent.class b/libjava/classpath/lib/javax/swing/event/ChangeEvent.class
new file mode 100644
index 00000000000..e1abba568fa
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/ChangeEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/ChangeListener.class b/libjava/classpath/lib/javax/swing/event/ChangeListener.class
new file mode 100644
index 00000000000..2f69ff18e38
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/ChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/DocumentEvent$ElementChange.class b/libjava/classpath/lib/javax/swing/event/DocumentEvent$ElementChange.class
new file mode 100644
index 00000000000..40efd183841
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/DocumentEvent$ElementChange.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/DocumentEvent$EventType.class b/libjava/classpath/lib/javax/swing/event/DocumentEvent$EventType.class
new file mode 100644
index 00000000000..456d077abf8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/DocumentEvent$EventType.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/DocumentEvent.class b/libjava/classpath/lib/javax/swing/event/DocumentEvent.class
new file mode 100644
index 00000000000..53ef89f83a6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/DocumentEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/DocumentListener.class b/libjava/classpath/lib/javax/swing/event/DocumentListener.class
new file mode 100644
index 00000000000..88438b9613c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/DocumentListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/EventListenerList.class b/libjava/classpath/lib/javax/swing/event/EventListenerList.class
new file mode 100644
index 00000000000..d51511eefcc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/EventListenerList.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/HyperlinkEvent$EventType.class b/libjava/classpath/lib/javax/swing/event/HyperlinkEvent$EventType.class
new file mode 100644
index 00000000000..acfdd0cdc2d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/HyperlinkEvent$EventType.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/HyperlinkEvent.class b/libjava/classpath/lib/javax/swing/event/HyperlinkEvent.class
new file mode 100644
index 00000000000..c6d30c902f1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/HyperlinkEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/HyperlinkListener.class b/libjava/classpath/lib/javax/swing/event/HyperlinkListener.class
new file mode 100644
index 00000000000..5c988af764e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/HyperlinkListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/InternalFrameAdapter.class b/libjava/classpath/lib/javax/swing/event/InternalFrameAdapter.class
new file mode 100644
index 00000000000..cc302960c30
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/InternalFrameAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/InternalFrameEvent.class b/libjava/classpath/lib/javax/swing/event/InternalFrameEvent.class
new file mode 100644
index 00000000000..3517e0859b0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/InternalFrameEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/InternalFrameListener.class b/libjava/classpath/lib/javax/swing/event/InternalFrameListener.class
new file mode 100644
index 00000000000..c77ebab5671
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/InternalFrameListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/ListDataEvent.class b/libjava/classpath/lib/javax/swing/event/ListDataEvent.class
new file mode 100644
index 00000000000..f1d5f9bfc6d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/ListDataEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/ListDataListener.class b/libjava/classpath/lib/javax/swing/event/ListDataListener.class
new file mode 100644
index 00000000000..0058a239952
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/ListDataListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/ListSelectionEvent.class b/libjava/classpath/lib/javax/swing/event/ListSelectionEvent.class
new file mode 100644
index 00000000000..1804b5bae5a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/ListSelectionEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/ListSelectionListener.class b/libjava/classpath/lib/javax/swing/event/ListSelectionListener.class
new file mode 100644
index 00000000000..95e4f6c6cd5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/ListSelectionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/MenuDragMouseEvent.class b/libjava/classpath/lib/javax/swing/event/MenuDragMouseEvent.class
new file mode 100644
index 00000000000..bec6295bbbb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/MenuDragMouseEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/MenuDragMouseListener.class b/libjava/classpath/lib/javax/swing/event/MenuDragMouseListener.class
new file mode 100644
index 00000000000..430e55d7945
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/MenuDragMouseListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/MenuEvent.class b/libjava/classpath/lib/javax/swing/event/MenuEvent.class
new file mode 100644
index 00000000000..821bb5a3e56
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/MenuEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/MenuKeyEvent.class b/libjava/classpath/lib/javax/swing/event/MenuKeyEvent.class
new file mode 100644
index 00000000000..3967f676fd1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/MenuKeyEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/MenuKeyListener.class b/libjava/classpath/lib/javax/swing/event/MenuKeyListener.class
new file mode 100644
index 00000000000..a81b3b79cb4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/MenuKeyListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/MenuListener.class b/libjava/classpath/lib/javax/swing/event/MenuListener.class
new file mode 100644
index 00000000000..c38bc23497d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/MenuListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/MouseInputAdapter.class b/libjava/classpath/lib/javax/swing/event/MouseInputAdapter.class
new file mode 100644
index 00000000000..81730354313
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/MouseInputAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/MouseInputListener.class b/libjava/classpath/lib/javax/swing/event/MouseInputListener.class
new file mode 100644
index 00000000000..44194745f83
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/MouseInputListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/PopupMenuEvent.class b/libjava/classpath/lib/javax/swing/event/PopupMenuEvent.class
new file mode 100644
index 00000000000..b9984f96fb0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/PopupMenuEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/PopupMenuListener.class b/libjava/classpath/lib/javax/swing/event/PopupMenuListener.class
new file mode 100644
index 00000000000..54b71aeb285
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/PopupMenuListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/SwingPropertyChangeSupport.class b/libjava/classpath/lib/javax/swing/event/SwingPropertyChangeSupport.class
new file mode 100644
index 00000000000..cd403b88466
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/SwingPropertyChangeSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/TableColumnModelEvent.class b/libjava/classpath/lib/javax/swing/event/TableColumnModelEvent.class
new file mode 100644
index 00000000000..4fb4495e568
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/TableColumnModelEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/TableColumnModelListener.class b/libjava/classpath/lib/javax/swing/event/TableColumnModelListener.class
new file mode 100644
index 00000000000..74c798dfdbf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/TableColumnModelListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/TableModelEvent.class b/libjava/classpath/lib/javax/swing/event/TableModelEvent.class
new file mode 100644
index 00000000000..c5fa2eefb30
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/TableModelEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/TableModelListener.class b/libjava/classpath/lib/javax/swing/event/TableModelListener.class
new file mode 100644
index 00000000000..544a0159da8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/TableModelListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/TreeExpansionEvent.class b/libjava/classpath/lib/javax/swing/event/TreeExpansionEvent.class
new file mode 100644
index 00000000000..8d73138e867
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/TreeExpansionEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/TreeExpansionListener.class b/libjava/classpath/lib/javax/swing/event/TreeExpansionListener.class
new file mode 100644
index 00000000000..094ccf36e0e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/TreeExpansionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/TreeModelEvent.class b/libjava/classpath/lib/javax/swing/event/TreeModelEvent.class
new file mode 100644
index 00000000000..be213ad4529
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/TreeModelEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/TreeModelListener.class b/libjava/classpath/lib/javax/swing/event/TreeModelListener.class
new file mode 100644
index 00000000000..d3578cffe6b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/TreeModelListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/TreeSelectionEvent.class b/libjava/classpath/lib/javax/swing/event/TreeSelectionEvent.class
new file mode 100644
index 00000000000..ff70bc2582e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/TreeSelectionEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/TreeSelectionListener.class b/libjava/classpath/lib/javax/swing/event/TreeSelectionListener.class
new file mode 100644
index 00000000000..38d1382c088
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/TreeSelectionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/TreeWillExpandListener.class b/libjava/classpath/lib/javax/swing/event/TreeWillExpandListener.class
new file mode 100644
index 00000000000..30496d93e3a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/TreeWillExpandListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/UndoableEditEvent.class b/libjava/classpath/lib/javax/swing/event/UndoableEditEvent.class
new file mode 100644
index 00000000000..64ca87a9f6f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/UndoableEditEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/event/UndoableEditListener.class b/libjava/classpath/lib/javax/swing/event/UndoableEditListener.class
new file mode 100644
index 00000000000..a7cd8486367
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/event/UndoableEditListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/filechooser/FileFilter.class b/libjava/classpath/lib/javax/swing/filechooser/FileFilter.class
new file mode 100644
index 00000000000..ae1e44fd288
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/filechooser/FileFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/filechooser/FileSystemView.class b/libjava/classpath/lib/javax/swing/filechooser/FileSystemView.class
new file mode 100644
index 00000000000..93ffd025c04
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/filechooser/FileSystemView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/filechooser/FileView.class b/libjava/classpath/lib/javax/swing/filechooser/FileView.class
new file mode 100644
index 00000000000..be08e4701f4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/filechooser/FileView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/filechooser/UnixFileSystemView.class b/libjava/classpath/lib/javax/swing/filechooser/UnixFileSystemView.class
new file mode 100644
index 00000000000..95e4ca18742
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/filechooser/UnixFileSystemView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/ActionMapUIResource.class b/libjava/classpath/lib/javax/swing/plaf/ActionMapUIResource.class
new file mode 100644
index 00000000000..db7b6648f14
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/ActionMapUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$BevelBorderUIResource.class b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$BevelBorderUIResource.class
new file mode 100644
index 00000000000..44a0d4ccff2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$BevelBorderUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$CompoundBorderUIResource.class b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$CompoundBorderUIResource.class
new file mode 100644
index 00000000000..0a6576f37ad
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$CompoundBorderUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$EmptyBorderUIResource.class b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$EmptyBorderUIResource.class
new file mode 100644
index 00000000000..f458c000345
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$EmptyBorderUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$EtchedBorderUIResource.class b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$EtchedBorderUIResource.class
new file mode 100644
index 00000000000..de5aa20b4ec
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$EtchedBorderUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$LineBorderUIResource.class b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$LineBorderUIResource.class
new file mode 100644
index 00000000000..8167c2992a0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$LineBorderUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$MatteBorderUIResource.class b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$MatteBorderUIResource.class
new file mode 100644
index 00000000000..bdfcf949f30
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$MatteBorderUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$TitledBorderUIResource.class b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$TitledBorderUIResource.class
new file mode 100644
index 00000000000..08f4ec9e084
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource$TitledBorderUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/BorderUIResource.class b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource.class
new file mode 100644
index 00000000000..1d6fa8dedb2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/BorderUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/ButtonUI.class b/libjava/classpath/lib/javax/swing/plaf/ButtonUI.class
new file mode 100644
index 00000000000..6cf64bd5fc4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/ButtonUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/ColorChooserUI.class b/libjava/classpath/lib/javax/swing/plaf/ColorChooserUI.class
new file mode 100644
index 00000000000..38759f44153
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/ColorChooserUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/ColorUIResource.class b/libjava/classpath/lib/javax/swing/plaf/ColorUIResource.class
new file mode 100644
index 00000000000..3a2e13134b1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/ColorUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/ComboBoxUI.class b/libjava/classpath/lib/javax/swing/plaf/ComboBoxUI.class
new file mode 100644
index 00000000000..e77c6a3ec0c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/ComboBoxUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/ComponentInputMapUIResource.class b/libjava/classpath/lib/javax/swing/plaf/ComponentInputMapUIResource.class
new file mode 100644
index 00000000000..e505fb1cde0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/ComponentInputMapUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/ComponentUI.class b/libjava/classpath/lib/javax/swing/plaf/ComponentUI.class
new file mode 100644
index 00000000000..0b708025a65
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/ComponentUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/DesktopIconUI.class b/libjava/classpath/lib/javax/swing/plaf/DesktopIconUI.class
new file mode 100644
index 00000000000..9165b28c514
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/DesktopIconUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/DesktopPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/DesktopPaneUI.class
new file mode 100644
index 00000000000..a044d2b2510
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/DesktopPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/DimensionUIResource.class b/libjava/classpath/lib/javax/swing/plaf/DimensionUIResource.class
new file mode 100644
index 00000000000..b79a912db39
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/DimensionUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/FileChooserUI.class b/libjava/classpath/lib/javax/swing/plaf/FileChooserUI.class
new file mode 100644
index 00000000000..64c74274734
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/FileChooserUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/FontUIResource.class b/libjava/classpath/lib/javax/swing/plaf/FontUIResource.class
new file mode 100644
index 00000000000..8ac86b06a94
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/FontUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/IconUIResource.class b/libjava/classpath/lib/javax/swing/plaf/IconUIResource.class
new file mode 100644
index 00000000000..2961df89e34
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/IconUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/InputMapUIResource.class b/libjava/classpath/lib/javax/swing/plaf/InputMapUIResource.class
new file mode 100644
index 00000000000..d90c81e4782
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/InputMapUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/InsetsUIResource.class b/libjava/classpath/lib/javax/swing/plaf/InsetsUIResource.class
new file mode 100644
index 00000000000..ecc8b8bce80
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/InsetsUIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/InternalFrameUI.class b/libjava/classpath/lib/javax/swing/plaf/InternalFrameUI.class
new file mode 100644
index 00000000000..ba683834782
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/InternalFrameUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/LabelUI.class b/libjava/classpath/lib/javax/swing/plaf/LabelUI.class
new file mode 100644
index 00000000000..fe823cbfae9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/LabelUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/ListUI.class b/libjava/classpath/lib/javax/swing/plaf/ListUI.class
new file mode 100644
index 00000000000..e0ae0e6f1a6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/ListUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/MenuBarUI.class b/libjava/classpath/lib/javax/swing/plaf/MenuBarUI.class
new file mode 100644
index 00000000000..b4215420151
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/MenuBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/MenuItemUI.class b/libjava/classpath/lib/javax/swing/plaf/MenuItemUI.class
new file mode 100644
index 00000000000..f5d1fc6ce97
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/MenuItemUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/OptionPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/OptionPaneUI.class
new file mode 100644
index 00000000000..c19b39974fd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/OptionPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/PanelUI.class b/libjava/classpath/lib/javax/swing/plaf/PanelUI.class
new file mode 100644
index 00000000000..a188ac34b48
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/PanelUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/PopupMenuUI.class b/libjava/classpath/lib/javax/swing/plaf/PopupMenuUI.class
new file mode 100644
index 00000000000..9aae8db64df
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/PopupMenuUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/ProgressBarUI.class b/libjava/classpath/lib/javax/swing/plaf/ProgressBarUI.class
new file mode 100644
index 00000000000..c4b108225b0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/ProgressBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/RootPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/RootPaneUI.class
new file mode 100644
index 00000000000..426484ea4f9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/RootPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/ScrollBarUI.class b/libjava/classpath/lib/javax/swing/plaf/ScrollBarUI.class
new file mode 100644
index 00000000000..ed1b3f8d953
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/ScrollBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/ScrollPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/ScrollPaneUI.class
new file mode 100644
index 00000000000..4496630e7e8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/ScrollPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/SeparatorUI.class b/libjava/classpath/lib/javax/swing/plaf/SeparatorUI.class
new file mode 100644
index 00000000000..56cb1063da7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/SeparatorUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/SliderUI.class b/libjava/classpath/lib/javax/swing/plaf/SliderUI.class
new file mode 100644
index 00000000000..40e7c5eb639
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/SliderUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/SpinnerUI.class b/libjava/classpath/lib/javax/swing/plaf/SpinnerUI.class
new file mode 100644
index 00000000000..30db423d676
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/SpinnerUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/SplitPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/SplitPaneUI.class
new file mode 100644
index 00000000000..a62a5f48d56
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/SplitPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/TabbedPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/TabbedPaneUI.class
new file mode 100644
index 00000000000..75425e9b068
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/TabbedPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/TableHeaderUI.class b/libjava/classpath/lib/javax/swing/plaf/TableHeaderUI.class
new file mode 100644
index 00000000000..77712f6f564
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/TableHeaderUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/TableUI.class b/libjava/classpath/lib/javax/swing/plaf/TableUI.class
new file mode 100644
index 00000000000..de0a647c395
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/TableUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/TextUI.class b/libjava/classpath/lib/javax/swing/plaf/TextUI.class
new file mode 100644
index 00000000000..637fa12c0e2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/TextUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/ToolBarUI.class b/libjava/classpath/lib/javax/swing/plaf/ToolBarUI.class
new file mode 100644
index 00000000000..cb097cda3b3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/ToolBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/ToolTipUI.class b/libjava/classpath/lib/javax/swing/plaf/ToolTipUI.class
new file mode 100644
index 00000000000..92d495a82a4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/ToolTipUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/TreeUI.class b/libjava/classpath/lib/javax/swing/plaf/TreeUI.class
new file mode 100644
index 00000000000..99f36338d40
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/TreeUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/UIResource.class b/libjava/classpath/lib/javax/swing/plaf/UIResource.class
new file mode 100644
index 00000000000..d37b8c59c96
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/UIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/ViewportUI.class b/libjava/classpath/lib/javax/swing/plaf/ViewportUI.class
new file mode 100644
index 00000000000..e9d51c32f10
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/ViewportUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicArrowButton.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicArrowButton.class
new file mode 100644
index 00000000000..24f3c0a2144
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicArrowButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$ButtonBorder.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$ButtonBorder.class
new file mode 100644
index 00000000000..7a7443d87f0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$ButtonBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$FieldBorder.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$FieldBorder.class
new file mode 100644
index 00000000000..fe3838d9497
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$FieldBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$MarginBorder.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$MarginBorder.class
new file mode 100644
index 00000000000..10039500dbb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$MarginBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$MenuBarBorder.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$MenuBarBorder.class
new file mode 100644
index 00000000000..dd96406486a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$MenuBarBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$RadioButtonBorder.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$RadioButtonBorder.class
new file mode 100644
index 00000000000..dc76747778c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$RadioButtonBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$RolloverButtonBorder.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$RolloverButtonBorder.class
new file mode 100644
index 00000000000..27b85ba5dcd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$RolloverButtonBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$SplitPaneBorder.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$SplitPaneBorder.class
new file mode 100644
index 00000000000..2988ff6c102
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$SplitPaneBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$SplitPaneDividerBorder.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$SplitPaneDividerBorder.class
new file mode 100644
index 00000000000..94ac0efd9cb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$SplitPaneDividerBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$ToggleButtonBorder.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$ToggleButtonBorder.class
new file mode 100644
index 00000000000..8ae464a7ef8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders$ToggleButtonBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders.class
new file mode 100644
index 00000000000..1e76161a5b7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicBorders.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener$1.class
new file mode 100644
index 00000000000..012492bf577
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener$2.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener$2.class
new file mode 100644
index 00000000000..348f244e45f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener$ButtonAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener$ButtonAction.class
new file mode 100644
index 00000000000..b97493de590
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener$ButtonAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener.class
new file mode 100644
index 00000000000..a736218c084
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonUI.class
new file mode 100644
index 00000000000..621c20fb6e0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicButtonUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.class
new file mode 100644
index 00000000000..a4b2f0741dc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicCheckBoxUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicCheckBoxUI.class
new file mode 100644
index 00000000000..6b8fe29fc52
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicCheckBoxUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$1.class
new file mode 100644
index 00000000000..a7c88e5ecf6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$PreviewListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$PreviewListener.class
new file mode 100644
index 00000000000..051f2ba14a8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$PreviewListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$PropertyHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$PropertyHandler.class
new file mode 100644
index 00000000000..c60cb86d95d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$PropertyHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$TabPaneListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$TabPaneListener.class
new file mode 100644
index 00000000000..877a1ca960b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI$TabPaneListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI.class
new file mode 100644
index 00000000000..d1e89b6ac6c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicColorChooserUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxEditor$UIResource.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxEditor$UIResource.class
new file mode 100644
index 00000000000..65068f5d0f9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxEditor$UIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxEditor.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxEditor.class
new file mode 100644
index 00000000000..584f3f57f0d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxRenderer$UIResource.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxRenderer$UIResource.class
new file mode 100644
index 00000000000..87a2825e4db
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxRenderer$UIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxRenderer.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxRenderer.class
new file mode 100644
index 00000000000..3c568c4cb46
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$ComboBoxLayoutManager.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$ComboBoxLayoutManager.class
new file mode 100644
index 00000000000..5af949dc7e4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$ComboBoxLayoutManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$FocusHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$FocusHandler.class
new file mode 100644
index 00000000000..9d34b1658ec
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$FocusHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$ItemHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$ItemHandler.class
new file mode 100644
index 00000000000..5a2febd575d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$ItemHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$KeyHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$KeyHandler.class
new file mode 100644
index 00000000000..a72e5670331
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$KeyHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$ListDataHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$ListDataHandler.class
new file mode 100644
index 00000000000..09385669bb8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$ListDataHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$PropertyChangeHandler.class
new file mode 100644
index 00000000000..645929dd485
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI.class
new file mode 100644
index 00000000000..eac5c881cbf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboBoxUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$InvocationKeyHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$InvocationKeyHandler.class
new file mode 100644
index 00000000000..d1f23b8696c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$InvocationKeyHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$InvocationMouseHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$InvocationMouseHandler.class
new file mode 100644
index 00000000000..4d063ab39ae
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$InvocationMouseHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$InvocationMouseMotionHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$InvocationMouseMotionHandler.class
new file mode 100644
index 00000000000..25c3f53991d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$InvocationMouseMotionHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ItemHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ItemHandler.class
new file mode 100644
index 00000000000..e19deb97eb2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ItemHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListDataHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListDataHandler.class
new file mode 100644
index 00000000000..0ac8de04144
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListDataHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListMouseHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListMouseHandler.class
new file mode 100644
index 00000000000..2580330d0df
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListMouseHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListMouseMotionHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListMouseMotionHandler.class
new file mode 100644
index 00000000000..f84670fd7f1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListMouseMotionHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListSelectionHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListSelectionHandler.class
new file mode 100644
index 00000000000..ef5371338e3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$ListSelectionHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$PropertyChangeHandler.class
new file mode 100644
index 00000000000..77991f8c688
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup.class
new file mode 100644
index 00000000000..eb13f2e5a9c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicComboPopup.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$1.class
new file mode 100644
index 00000000000..1009fe75a58
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$2.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$2.class
new file mode 100644
index 00000000000..8c76fe274ba
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$BoundButton.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$BoundButton.class
new file mode 100644
index 00000000000..49922ae5395
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$BoundButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$DesktopIconBorder.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$DesktopIconBorder.class
new file mode 100644
index 00000000000..60bf7d28619
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$DesktopIconBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$InternalFrameDefaultMenuIcon.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$InternalFrameDefaultMenuIcon.class
new file mode 100644
index 00000000000..bbf96a2e1a6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$InternalFrameDefaultMenuIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$MouseInputHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$MouseInputHandler.class
new file mode 100644
index 00000000000..fec723e71cf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI$MouseInputHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI.class
new file mode 100644
index 00000000000..368c162fc75
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopIconUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$CloseAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$CloseAction.class
new file mode 100644
index 00000000000..96da80278d5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$CloseAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$MaximizeAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$MaximizeAction.class
new file mode 100644
index 00000000000..98ad067b4e7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$MaximizeAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$MinimizeAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$MinimizeAction.class
new file mode 100644
index 00000000000..b44728a6c4e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$MinimizeAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$NavigateAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$NavigateAction.class
new file mode 100644
index 00000000000..da6c8026210
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$NavigateAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$OpenAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$OpenAction.class
new file mode 100644
index 00000000000..b05290de919
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI$OpenAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI.class
new file mode 100644
index 00000000000..5a380927810
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDesktopPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel$1.class
new file mode 100644
index 00000000000..55cc400c8c1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel$DirectoryLoadThread$UpdateSwingRequest.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel$DirectoryLoadThread$UpdateSwingRequest.class
new file mode 100644
index 00000000000..4a5483b66d1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel$DirectoryLoadThread$UpdateSwingRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel$DirectoryLoadThread.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel$DirectoryLoadThread.class
new file mode 100644
index 00000000000..b36b60abfb6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel$DirectoryLoadThread.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel.class
new file mode 100644
index 00000000000..39ad875dda9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicDirectoryModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicEditorPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicEditorPaneUI.class
new file mode 100644
index 00000000000..6eb2235ca14
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicEditorPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$AcceptAllFileFilter.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$AcceptAllFileFilter.class
new file mode 100644
index 00000000000..8ca7e20f85f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$AcceptAllFileFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$ApproveSelectionAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$ApproveSelectionAction.class
new file mode 100644
index 00000000000..73241f21572
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$ApproveSelectionAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$BasicFileView.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$BasicFileView.class
new file mode 100644
index 00000000000..094561bacda
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$BasicFileView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$CancelSelectionAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$CancelSelectionAction.class
new file mode 100644
index 00000000000..f62de1736c9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$CancelSelectionAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$ChangeToParentDirectoryAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$ChangeToParentDirectoryAction.class
new file mode 100644
index 00000000000..1634c3b5eb3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$ChangeToParentDirectoryAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$DoubleClickListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$DoubleClickListener.class
new file mode 100644
index 00000000000..058f9488e75
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$DoubleClickListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$GoHomeAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$GoHomeAction.class
new file mode 100644
index 00000000000..ea8ebb0c309
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$GoHomeAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$NewFolderAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$NewFolderAction.class
new file mode 100644
index 00000000000..1e87303914e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$NewFolderAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$SelectionListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$SelectionListener.class
new file mode 100644
index 00000000000..ddfb4358996
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$SelectionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$UpdateAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$UpdateAction.class
new file mode 100644
index 00000000000..ac37a3c03d5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI$UpdateAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI.class
new file mode 100644
index 00000000000..3b622d5c679
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFileChooserUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicFormattedTextFieldUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFormattedTextFieldUI.class
new file mode 100644
index 00000000000..cdfdbbaf517
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicFormattedTextFieldUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicGraphicsUtils.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicGraphicsUtils.class
new file mode 100644
index 00000000000..5c66a8c79db
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicGraphicsUtils.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicHTML$HTMLRootView.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicHTML$HTMLRootView.class
new file mode 100644
index 00000000000..2db9cf40556
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicHTML$HTMLRootView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicHTML.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicHTML.class
new file mode 100644
index 00000000000..5acae515c24
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicHTML.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$1.class
new file mode 100644
index 00000000000..289de2fd2e6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$2.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$2.class
new file mode 100644
index 00000000000..2e6833a9ad4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$CheckBoxIcon.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$CheckBoxIcon.class
new file mode 100644
index 00000000000..4586a830462
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$CheckBoxIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$CheckBoxMenuItemIcon.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$CheckBoxMenuItemIcon.class
new file mode 100644
index 00000000000..bd03ae40dd1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$CheckBoxMenuItemIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$DummyIcon.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$DummyIcon.class
new file mode 100644
index 00000000000..a35dd8af544
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$DummyIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$RadioButtonIcon.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$RadioButtonIcon.class
new file mode 100644
index 00000000000..67c3d0b5f2c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory$RadioButtonIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory.class
new file mode 100644
index 00000000000..2c53736ef7d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicIconFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$CloseAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$CloseAction.class
new file mode 100644
index 00000000000..fa6b2d54b7c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$CloseAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$IconifyAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$IconifyAction.class
new file mode 100644
index 00000000000..0b296f1d51e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$IconifyAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$MaximizeAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$MaximizeAction.class
new file mode 100644
index 00000000000..996f4f7bcc2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$MaximizeAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$MoveAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$MoveAction.class
new file mode 100644
index 00000000000..d8895501827
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$MoveAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$PaneButton.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$PaneButton.class
new file mode 100644
index 00000000000..5b275c073b8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$PaneButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$PropertyChangeHandler.class
new file mode 100644
index 00000000000..ccbf313610d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$RestoreAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$RestoreAction.class
new file mode 100644
index 00000000000..183d434f0db
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$RestoreAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$SizeAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$SizeAction.class
new file mode 100644
index 00000000000..fce1d0f49c2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$SizeAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$SystemMenuBar.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$SystemMenuBar.class
new file mode 100644
index 00000000000..70d2c57de6a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$SystemMenuBar.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$TitlePaneLayout.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$TitlePaneLayout.class
new file mode 100644
index 00000000000..fc559188ffd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane$TitlePaneLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane.class
new file mode 100644
index 00000000000..24863c2573e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameTitlePane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$BasicInternalFrameListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$BasicInternalFrameListener.class
new file mode 100644
index 00000000000..9d397cc1a46
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$BasicInternalFrameListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$BorderListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$BorderListener.class
new file mode 100644
index 00000000000..75ef5baea6d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$BorderListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$ComponentHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$ComponentHandler.class
new file mode 100644
index 00000000000..0e3371a2ff7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$ComponentHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$GlassPaneDispatcher.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$GlassPaneDispatcher.class
new file mode 100644
index 00000000000..bb0d894420a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$GlassPaneDispatcher.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$InternalFrameBorder.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$InternalFrameBorder.class
new file mode 100644
index 00000000000..dd3545d37e6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$InternalFrameBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$InternalFrameLayout.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$InternalFrameLayout.class
new file mode 100644
index 00000000000..8a27d60ed90
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$InternalFrameLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$InternalFramePropertyChangeListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$InternalFramePropertyChangeListener.class
new file mode 100644
index 00000000000..d67c05aaa42
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$InternalFramePropertyChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$ShowSystemMenuAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$ShowSystemMenuAction.class
new file mode 100644
index 00000000000..fffccb6f930
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI$ShowSystemMenuAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI.class
new file mode 100644
index 00000000000..50427df1be8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicInternalFrameUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicLabelUI$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLabelUI$1.class
new file mode 100644
index 00000000000..7d7f0934010
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLabelUI$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicLabelUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLabelUI.class
new file mode 100644
index 00000000000..442a8dc0bfd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLabelUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ActionListenerProxy.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ActionListenerProxy.class
new file mode 100644
index 00000000000..93d816ab3fa
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ActionListenerProxy.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$FocusHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$FocusHandler.class
new file mode 100644
index 00000000000..319ebbb5448
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$FocusHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ListAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ListAction.class
new file mode 100644
index 00000000000..a621d9e9ebf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ListAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ListDataHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ListDataHandler.class
new file mode 100644
index 00000000000..076e91ecebf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ListDataHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ListSelectionHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ListSelectionHandler.class
new file mode 100644
index 00000000000..53948408fdd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$ListSelectionHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$MouseInputHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$MouseInputHandler.class
new file mode 100644
index 00000000000..27d3a557c87
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$MouseInputHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$PropertyChangeHandler.class
new file mode 100644
index 00000000000..84fe813e4e0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI.class
new file mode 100644
index 00000000000..3b01beb12bf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicListUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$1.class
new file mode 100644
index 00000000000..5d65f475d7a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$2.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$2.class
new file mode 100644
index 00000000000..f1e83643af3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$3.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$3.class
new file mode 100644
index 00000000000..c33c131193c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$3.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$4.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$4.class
new file mode 100644
index 00000000000..4b0ee923fbb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$4.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$5.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$5.class
new file mode 100644
index 00000000000..8fee22cb714
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$5.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$6.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$6.class
new file mode 100644
index 00000000000..bc464c04884
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$6.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$7.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$7.class
new file mode 100644
index 00000000000..118d59b91d8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$7.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$AudioAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$AudioAction.class
new file mode 100644
index 00000000000..7e42900f2c8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$AudioAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$PopupHelper.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$PopupHelper.class
new file mode 100644
index 00000000000..33b363ef1cc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel$PopupHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel.class
new file mode 100644
index 00000000000..9a866a547b2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicLookAndFeel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$ChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$ChangeHandler.class
new file mode 100644
index 00000000000..719b2f72d04
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$ChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$ContainerHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$ContainerHandler.class
new file mode 100644
index 00000000000..26290e1ef19
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$ContainerHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$FocusAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$FocusAction.class
new file mode 100644
index 00000000000..530bb04bf07
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$FocusAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$MouseInputHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$MouseInputHandler.class
new file mode 100644
index 00000000000..c9fa547948d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$MouseInputHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$PropertyChangeHandler.class
new file mode 100644
index 00000000000..006dd5642c1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI.class
new file mode 100644
index 00000000000..631dbab64d8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$ClickAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$ClickAction.class
new file mode 100644
index 00000000000..2b12cc01a2a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$ClickAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$ItemHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$ItemHandler.class
new file mode 100644
index 00000000000..97810c0e411
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$ItemHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$MenuDragMouseHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$MenuDragMouseHandler.class
new file mode 100644
index 00000000000..1874c677fb8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$MenuDragMouseHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$MenuKeyHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$MenuKeyHandler.class
new file mode 100644
index 00000000000..ea17e2dd281
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$MenuKeyHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$MouseInputHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$MouseInputHandler.class
new file mode 100644
index 00000000000..3f7a708be4b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$MouseInputHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$PropertyChangeHandler.class
new file mode 100644
index 00000000000..4399c92f1c0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI.class
new file mode 100644
index 00000000000..80809fd55ea
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuItemUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$ChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$ChangeHandler.class
new file mode 100644
index 00000000000..df186efe287
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$ChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MenuDragMouseHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MenuDragMouseHandler.class
new file mode 100644
index 00000000000..96204b5d9e4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MenuDragMouseHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MenuHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MenuHandler.class
new file mode 100644
index 00000000000..f43058ef142
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MenuHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MenuKeyHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MenuKeyHandler.class
new file mode 100644
index 00000000000..fa570080996
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MenuKeyHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MouseInputHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MouseInputHandler.class
new file mode 100644
index 00000000000..d5d9207097e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$MouseInputHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$SelectMenuAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$SelectMenuAction.class
new file mode 100644
index 00000000000..523ab53d102
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI$SelectMenuAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI.class
new file mode 100644
index 00000000000..4ebf02b3557
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicMenuUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$1.class
new file mode 100644
index 00000000000..e2fdfbf5ec2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$2.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$2.class
new file mode 100644
index 00000000000..b829634fa12
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$3.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$3.class
new file mode 100644
index 00000000000..739bf32ff02
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$3.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$4.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$4.class
new file mode 100644
index 00000000000..004c25063cf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$4.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$ButtonActionListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$ButtonActionListener.class
new file mode 100644
index 00000000000..8f7fce47507
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$ButtonActionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$ButtonAreaLayout.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$ButtonAreaLayout.class
new file mode 100644
index 00000000000..e3c1beb7131
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$ButtonAreaLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$MessageIcon.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$MessageIcon.class
new file mode 100644
index 00000000000..42727bdb711
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$MessageIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$OptionPaneCloseAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$OptionPaneCloseAction.class
new file mode 100644
index 00000000000..0db21e4a23c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$OptionPaneCloseAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$PropertyChangeHandler.class
new file mode 100644
index 00000000000..625d036f4b9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI.class
new file mode 100644
index 00000000000..3cccaa7ed00
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicOptionPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicPanelUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPanelUI.class
new file mode 100644
index 00000000000..899fbeaeb45
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPanelUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicPasswordFieldUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPasswordFieldUI.class
new file mode 100644
index 00000000000..ee3247166ec
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPasswordFieldUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.class
new file mode 100644
index 00000000000..db1675d3690
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$KeyboardHelper.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$KeyboardHelper.class
new file mode 100644
index 00000000000..46a97d0027f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$KeyboardHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$NavigateAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$NavigateAction.class
new file mode 100644
index 00000000000..f5cbd4e705f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$NavigateAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$PopupMenuHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$PopupMenuHandler.class
new file mode 100644
index 00000000000..a1f6381d864
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$PopupMenuHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$TopWindowListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$TopWindowListener.class
new file mode 100644
index 00000000000..e6ac311fbc6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI$TopWindowListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI.class
new file mode 100644
index 00000000000..9487aefacaa
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicPopupMenuUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$AncestorHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$AncestorHandler.class
new file mode 100644
index 00000000000..4afc274a609
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$AncestorHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$Animator.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$Animator.class
new file mode 100644
index 00000000000..865f6e60f60
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$Animator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$ChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$ChangeHandler.class
new file mode 100644
index 00000000000..dd22e230608
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$ChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$ComponentHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$ComponentHandler.class
new file mode 100644
index 00000000000..d417d225101
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$ComponentHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$PropertyChangeHandler.class
new file mode 100644
index 00000000000..2f4640fcb28
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI.class
new file mode 100644
index 00000000000..f428c5e34ef
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicProgressBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.class
new file mode 100644
index 00000000000..8bc1dcd2f1d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicRadioButtonUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicRadioButtonUI.class
new file mode 100644
index 00000000000..eb5d3d1c589
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicRadioButtonUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicRootPaneUI$DefaultPressAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicRootPaneUI$DefaultPressAction.class
new file mode 100644
index 00000000000..d3c9ab033b5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicRootPaneUI$DefaultPressAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicRootPaneUI$DefaultReleaseAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicRootPaneUI$DefaultReleaseAction.class
new file mode 100644
index 00000000000..77a3c72cebc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicRootPaneUI$DefaultReleaseAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicRootPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicRootPaneUI.class
new file mode 100644
index 00000000000..c52b0c7d70d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicRootPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$1.class
new file mode 100644
index 00000000000..9a5b36b5519
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$2.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$2.class
new file mode 100644
index 00000000000..c2dbcbf5333
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$3.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$3.class
new file mode 100644
index 00000000000..90e07e71ae1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$3.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$4.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$4.class
new file mode 100644
index 00000000000..8ce627da62a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$4.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$5.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$5.class
new file mode 100644
index 00000000000..a0646f3b816
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$5.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$6.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$6.class
new file mode 100644
index 00000000000..af7dd323e0f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$6.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$ArrowButtonListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$ArrowButtonListener.class
new file mode 100644
index 00000000000..7081759b67e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$ArrowButtonListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$ModelListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$ModelListener.class
new file mode 100644
index 00000000000..e4d2945cd85
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$ModelListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$PropertyChangeHandler.class
new file mode 100644
index 00000000000..f1466a6b2d3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$ScrollListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$ScrollListener.class
new file mode 100644
index 00000000000..6416310df57
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$ScrollListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$TrackListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$TrackListener.class
new file mode 100644
index 00000000000..3b4d8ae247a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI$TrackListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI.class
new file mode 100644
index 00000000000..f0ec5c4744d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$1.class
new file mode 100644
index 00000000000..9d2c615c512
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$10.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$10.class
new file mode 100644
index 00000000000..58ad2057d0b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$10.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$2.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$2.class
new file mode 100644
index 00000000000..e7eb3681302
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$3.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$3.class
new file mode 100644
index 00000000000..82159aed60c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$3.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$4.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$4.class
new file mode 100644
index 00000000000..74544cd51a3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$4.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$5.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$5.class
new file mode 100644
index 00000000000..539992025b8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$5.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$6.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$6.class
new file mode 100644
index 00000000000..6bfadf29333
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$6.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$7.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$7.class
new file mode 100644
index 00000000000..750471ed79f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$7.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$8.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$8.class
new file mode 100644
index 00000000000..5bf0bed7f95
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$8.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$9.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$9.class
new file mode 100644
index 00000000000..f5156aeb042
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$9.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$HSBChangeListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$HSBChangeListener.class
new file mode 100644
index 00000000000..3b40bfda649
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$HSBChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$MouseWheelHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$MouseWheelHandler.class
new file mode 100644
index 00000000000..1485b952e40
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$MouseWheelHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$PropertyChangeHandler.class
new file mode 100644
index 00000000000..073955092a4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$VSBChangeListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$VSBChangeListener.class
new file mode 100644
index 00000000000..af23e05fba4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$VSBChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$ViewportChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$ViewportChangeHandler.class
new file mode 100644
index 00000000000..1b6a7291aa3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$ViewportChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$ViewportContainerListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$ViewportContainerListener.class
new file mode 100644
index 00000000000..0134ead63fa
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI$ViewportContainerListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI.class
new file mode 100644
index 00000000000..35c71e2ffef
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicScrollPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSeparatorUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSeparatorUI.class
new file mode 100644
index 00000000000..5c8c9138766
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSeparatorUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$1.class
new file mode 100644
index 00000000000..27bb9f6b590
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$2.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$2.class
new file mode 100644
index 00000000000..b0941f4c826
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$3.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$3.class
new file mode 100644
index 00000000000..0a9d63bcbf4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$3.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$4.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$4.class
new file mode 100644
index 00000000000..1bcdb96da85
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$4.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$5.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$5.class
new file mode 100644
index 00000000000..4de2aee76e4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$5.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$6.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$6.class
new file mode 100644
index 00000000000..4724dfc1c70
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$6.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ActionScroller.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ActionScroller.class
new file mode 100644
index 00000000000..50966e9a5b5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ActionScroller.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ChangeHandler.class
new file mode 100644
index 00000000000..707b9646c30
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ComponentHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ComponentHandler.class
new file mode 100644
index 00000000000..f12ca7c11b0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ComponentHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$FocusHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$FocusHandler.class
new file mode 100644
index 00000000000..49f71ee9ebc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$FocusHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$PropertyChangeHandler.class
new file mode 100644
index 00000000000..7689cb38f05
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ScrollListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ScrollListener.class
new file mode 100644
index 00000000000..4d868f9d099
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$ScrollListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$TrackListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$TrackListener.class
new file mode 100644
index 00000000000..5624a4a5306
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI$TrackListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI.class
new file mode 100644
index 00000000000..93fef654deb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSliderUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$1.class
new file mode 100644
index 00000000000..a81f3909171
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$2.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$2.class
new file mode 100644
index 00000000000..8dae834040c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$3.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$3.class
new file mode 100644
index 00000000000..2a822f94549
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$3.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$4.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$4.class
new file mode 100644
index 00000000000..8a681f1eb9f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$4.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$5.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$5.class
new file mode 100644
index 00000000000..b79ee535134
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$5.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$DefaultLayoutManager.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$DefaultLayoutManager.class
new file mode 100644
index 00000000000..163e6d8a49b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI$DefaultLayoutManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI.class
new file mode 100644
index 00000000000..fa01bcec69b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSpinnerUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$BasicOneTouchButton.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$BasicOneTouchButton.class
new file mode 100644
index 00000000000..e0a721549b7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$BasicOneTouchButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$DividerLayout.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$DividerLayout.class
new file mode 100644
index 00000000000..8334c392eeb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$DividerLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$DragController.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$DragController.class
new file mode 100644
index 00000000000..eff8b334010
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$DragController.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$MouseHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$MouseHandler.class
new file mode 100644
index 00000000000..f3574e07c34
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$MouseHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$OneTouchAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$OneTouchAction.class
new file mode 100644
index 00000000000..45873b58848
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$OneTouchAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$VerticalDragController.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$VerticalDragController.class
new file mode 100644
index 00000000000..e60a5d995a7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider$VerticalDragController.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider.class
new file mode 100644
index 00000000000..f4ae0683908
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneDivider.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$1.class
new file mode 100644
index 00000000000..7cda0e04837
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$2.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$2.class
new file mode 100644
index 00000000000..42a1f7053a8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$3.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$3.class
new file mode 100644
index 00000000000..ab26c8307be
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$3.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$4.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$4.class
new file mode 100644
index 00000000000..aa0fd723367
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$4.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$5.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$5.class
new file mode 100644
index 00000000000..616981193a0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$5.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$6.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$6.class
new file mode 100644
index 00000000000..3c771c1614a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$6.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$7.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$7.class
new file mode 100644
index 00000000000..df61f281927
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$7.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$8.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$8.class
new file mode 100644
index 00000000000..8cb8c2a8bf6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$8.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$BasicHorizontalLayoutManager.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$BasicHorizontalLayoutManager.class
new file mode 100644
index 00000000000..82248171e09
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$BasicHorizontalLayoutManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$BasicVerticalLayoutManager.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$BasicVerticalLayoutManager.class
new file mode 100644
index 00000000000..7bfafb47034
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$BasicVerticalLayoutManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$FocusHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$FocusHandler.class
new file mode 100644
index 00000000000..d5ecc0d1fa6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$FocusHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardDownRightHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardDownRightHandler.class
new file mode 100644
index 00000000000..7da3e02ae2c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardDownRightHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardEndHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardEndHandler.class
new file mode 100644
index 00000000000..ff8cab1273a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardEndHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardHomeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardHomeHandler.class
new file mode 100644
index 00000000000..efc2f798486
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardHomeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardResizeToggleHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardResizeToggleHandler.class
new file mode 100644
index 00000000000..eb859af714f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardResizeToggleHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardUpLeftHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardUpLeftHandler.class
new file mode 100644
index 00000000000..8b712d69949
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$KeyboardUpLeftHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$PropertyHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$PropertyHandler.class
new file mode 100644
index 00000000000..7b2c4296bba
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI$PropertyHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI.class
new file mode 100644
index 00000000000..1b365ff2a6b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicSplitPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$FocusHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$FocusHandler.class
new file mode 100644
index 00000000000..fb13c4f0b16
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$FocusHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$MouseHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$MouseHandler.class
new file mode 100644
index 00000000000..71d6174c163
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$MouseHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$NavigateAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$NavigateAction.class
new file mode 100644
index 00000000000..fe868cd97df
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$NavigateAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$NavigatePageDownAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$NavigatePageDownAction.class
new file mode 100644
index 00000000000..7505ade3880
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$NavigatePageDownAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$NavigatePageUpAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$NavigatePageUpAction.class
new file mode 100644
index 00000000000..53ef74f1912
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$NavigatePageUpAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$PropertyChangeHandler.class
new file mode 100644
index 00000000000..67a9404726d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$RequestFocusAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$RequestFocusAction.class
new file mode 100644
index 00000000000..ff7576be6bf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$RequestFocusAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$RequestFocusForVisibleComponentAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$RequestFocusForVisibleComponentAction.class
new file mode 100644
index 00000000000..71d43596106
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$RequestFocusForVisibleComponentAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingButton.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingButton.class
new file mode 100644
index 00000000000..a0e33cdfda8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingPanel$ScrollingPanelUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingPanel$ScrollingPanelUI.class
new file mode 100644
index 00000000000..0fc7b07b6af
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingPanel$ScrollingPanelUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingPanel.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingPanel.class
new file mode 100644
index 00000000000..b244abe2d3d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingPanel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingViewport.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingViewport.class
new file mode 100644
index 00000000000..11182ffd0f6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$ScrollingViewport.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$TabSelectionHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$TabSelectionHandler.class
new file mode 100644
index 00000000000..af70ea982d6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$TabSelectionHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayout.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayout.class
new file mode 100644
index 00000000000..b6746e74db9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneScrollLayout.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneScrollLayout.class
new file mode 100644
index 00000000000..85a4b91aced
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneScrollLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI.class
new file mode 100644
index 00000000000..f4a5e76c3d1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTabbedPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableHeaderUI$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableHeaderUI$1.class
new file mode 100644
index 00000000000..db96992ccd8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableHeaderUI$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableHeaderUI$MouseInputHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableHeaderUI$MouseInputHandler.class
new file mode 100644
index 00000000000..3ec79a6ac00
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableHeaderUI$MouseInputHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableHeaderUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableHeaderUI.class
new file mode 100644
index 00000000000..5ad0945bc15
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableHeaderUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$FocusHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$FocusHandler.class
new file mode 100644
index 00000000000..18c4100eb39
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$FocusHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$KeyHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$KeyHandler.class
new file mode 100644
index 00000000000..65475db210f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$KeyHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$MouseInputHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$MouseInputHandler.class
new file mode 100644
index 00000000000..9ef5b9951d6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$MouseInputHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$PropertyChangeHandler.class
new file mode 100644
index 00000000000..def45a1866b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$TableAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$TableAction.class
new file mode 100644
index 00000000000..94be7170dc6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI$TableAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI.class
new file mode 100644
index 00000000000..b0822d66e8b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTableUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextAreaUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextAreaUI.class
new file mode 100644
index 00000000000..0ec9c66f8e6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextAreaUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextFieldUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextFieldUI.class
new file mode 100644
index 00000000000..90b8bf77a03
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextFieldUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextPaneUI.class
new file mode 100644
index 00000000000..539115faf93
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$BasicCaret.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$BasicCaret.class
new file mode 100644
index 00000000000..7284598e04d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$BasicCaret.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$BasicHighlighter.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$BasicHighlighter.class
new file mode 100644
index 00000000000..c0473e17fa0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$BasicHighlighter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$FocusHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$FocusHandler.class
new file mode 100644
index 00000000000..12f7f465162
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$FocusHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$Handler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$Handler.class
new file mode 100644
index 00000000000..d574a9624ca
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$Handler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$RootView.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$RootView.class
new file mode 100644
index 00000000000..3b2834c17fc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI$RootView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI.class
new file mode 100644
index 00000000000..d2a6452b4c0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTextUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicToggleButtonUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToggleButtonUI.class
new file mode 100644
index 00000000000..828356f3fe8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToggleButtonUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarSeparatorUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarSeparatorUI.class
new file mode 100644
index 00000000000..1b59fd39898
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarSeparatorUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$DockingListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$DockingListener.class
new file mode 100644
index 00000000000..c0c73a659bc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$DockingListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$DragWindow.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$DragWindow.class
new file mode 100644
index 00000000000..4eef745d21a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$DragWindow.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$FrameListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$FrameListener.class
new file mode 100644
index 00000000000..4f00f40143b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$FrameListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$PropertyListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$PropertyListener.class
new file mode 100644
index 00000000000..6c256c9da74
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$PropertyListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarAction.class
new file mode 100644
index 00000000000..b66785c3b5b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarBorder.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarBorder.class
new file mode 100644
index 00000000000..9a85d145a57
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarContListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarContListener.class
new file mode 100644
index 00000000000..041113523d3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarContListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarDialog.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarDialog.class
new file mode 100644
index 00000000000..6d709ddbfa7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarDialog.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarFocusListener.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarFocusListener.class
new file mode 100644
index 00000000000..ce3221c6514
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI$ToolBarFocusListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI.class
new file mode 100644
index 00000000000..4eefae595bd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolTipUI$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolTipUI$PropertyChangeHandler.class
new file mode 100644
index 00000000000..5c57e7d3241
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolTipUI$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolTipUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolTipUI.class
new file mode 100644
index 00000000000..54812b35a28
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicToolTipUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$1.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$1.class
new file mode 100644
index 00000000000..0c9f340b943
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$CellEditorHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$CellEditorHandler.class
new file mode 100644
index 00000000000..a396b4ad2e5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$CellEditorHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$ComponentHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$ComponentHandler.class
new file mode 100644
index 00000000000..ea7b7f4181b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$ComponentHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$FocusHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$FocusHandler.class
new file mode 100644
index 00000000000..78ea5ad8ec4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$FocusHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$KeyHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$KeyHandler.class
new file mode 100644
index 00000000000..8ff4e3b040d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$KeyHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$MouseHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$MouseHandler.class
new file mode 100644
index 00000000000..c3a396a76df
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$MouseHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$MouseInputHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$MouseInputHandler.class
new file mode 100644
index 00000000000..ee78f86aa92
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$MouseInputHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$NodeDimensionsHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$NodeDimensionsHandler.class
new file mode 100644
index 00000000000..782d88746d5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$NodeDimensionsHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$PropertyChangeHandler.class
new file mode 100644
index 00000000000..16cb402eb8d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$SelectionModelPropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$SelectionModelPropertyChangeHandler.class
new file mode 100644
index 00000000000..18e4350dbcb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$SelectionModelPropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeCancelEditingAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeCancelEditingAction.class
new file mode 100644
index 00000000000..92170ea3411
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeCancelEditingAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeExpansionHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeExpansionHandler.class
new file mode 100644
index 00000000000..7f06636f520
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeExpansionHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeHomeAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeHomeAction.class
new file mode 100644
index 00000000000..dd367b56bc4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeHomeAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeIncrementAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeIncrementAction.class
new file mode 100644
index 00000000000..a5af1b98b54
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeIncrementAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeModelHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeModelHandler.class
new file mode 100644
index 00000000000..91c428336db
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeModelHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreePageAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreePageAction.class
new file mode 100644
index 00000000000..5c71ab6cb10
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreePageAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeSelectionHandler.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeSelectionHandler.class
new file mode 100644
index 00000000000..f714a625cee
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeSelectionHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeStartEditingAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeStartEditingAction.class
new file mode 100644
index 00000000000..19b3d14b96e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeStartEditingAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeToggleAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeToggleAction.class
new file mode 100644
index 00000000000..19530ef625e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeToggleAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeTraverseAction.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeTraverseAction.class
new file mode 100644
index 00000000000..f9de62e54fa
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI$TreeTraverseAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI.class
new file mode 100644
index 00000000000..6ca853bf960
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicTreeUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/BasicViewportUI.class b/libjava/classpath/lib/javax/swing/plaf/basic/BasicViewportUI.class
new file mode 100644
index 00000000000..6053ba65ac4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/BasicViewportUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/ComboPopup.class b/libjava/classpath/lib/javax/swing/plaf/basic/ComboPopup.class
new file mode 100644
index 00000000000..e9af3d4ad49
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/ComboPopup.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/DefaultMenuLayout.class b/libjava/classpath/lib/javax/swing/plaf/basic/DefaultMenuLayout.class
new file mode 100644
index 00000000000..04306b42120
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/DefaultMenuLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/basic/SharedUIDefaults.class b/libjava/classpath/lib/javax/swing/plaf/basic/SharedUIDefaults.class
new file mode 100644
index 00000000000..551e604207b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/basic/SharedUIDefaults.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/DefaultMetalTheme.class b/libjava/classpath/lib/javax/swing/plaf/metal/DefaultMetalTheme.class
new file mode 100644
index 00000000000..8c91d728a8d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/DefaultMetalTheme.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ButtonBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ButtonBorder.class
new file mode 100644
index 00000000000..caacd83b81c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ButtonBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$DesktopIconBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$DesktopIconBorder.class
new file mode 100644
index 00000000000..02ce3e1ae05
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$DesktopIconBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$Flush3DBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$Flush3DBorder.class
new file mode 100644
index 00000000000..e184e997abe
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$Flush3DBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$InternalFrameBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$InternalFrameBorder.class
new file mode 100644
index 00000000000..9472c02b542
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$InternalFrameBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$MenuBarBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$MenuBarBorder.class
new file mode 100644
index 00000000000..d58e9bd495e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$MenuBarBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$MenuItemBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$MenuItemBorder.class
new file mode 100644
index 00000000000..be1273ee1bf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$MenuItemBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$OptionDialogBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$OptionDialogBorder.class
new file mode 100644
index 00000000000..60809b63213
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$OptionDialogBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$PaletteBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$PaletteBorder.class
new file mode 100644
index 00000000000..8c16cafbc87
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$PaletteBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$PopupMenuBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$PopupMenuBorder.class
new file mode 100644
index 00000000000..0fa010c86ed
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$PopupMenuBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder.class
new file mode 100644
index 00000000000..b9836bb4b4d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$RolloverMarginBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$RolloverMarginBorder.class
new file mode 100644
index 00000000000..bd2d3689ff4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$RolloverMarginBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ScrollPaneBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ScrollPaneBorder.class
new file mode 100644
index 00000000000..b3f20be757f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ScrollPaneBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$TableHeaderBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$TableHeaderBorder.class
new file mode 100644
index 00000000000..d65caaaafae
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$TableHeaderBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$TextFieldBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$TextFieldBorder.class
new file mode 100644
index 00000000000..e5758fcd734
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$TextFieldBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder.class
new file mode 100644
index 00000000000..9a73598fd4f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ToolBarBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ToolBarBorder.class
new file mode 100644
index 00000000000..6cc65db10b0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders$ToolBarBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders.class
new file mode 100644
index 00000000000..355eb063b22
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalBorders.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalButtonListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalButtonListener.class
new file mode 100644
index 00000000000..ecea49d9ab4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalButtonListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalButtonUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalButtonUI.class
new file mode 100644
index 00000000000..aa93c284e40
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalButtonUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalCheckBoxIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalCheckBoxIcon.class
new file mode 100644
index 00000000000..86d28441a0a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalCheckBoxIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalCheckBoxUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalCheckBoxUI.class
new file mode 100644
index 00000000000..5e5617b966d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalCheckBoxUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxButton.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxButton.class
new file mode 100644
index 00000000000..b7e43a5495f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor$EditorTextField.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor$EditorTextField.class
new file mode 100644
index 00000000000..ec2fa0e09fa
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor$EditorTextField.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor$MetalComboBoxEditorBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor$MetalComboBoxEditorBorder.class
new file mode 100644
index 00000000000..b6b37439e3e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor$MetalComboBoxEditorBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor$UIResource.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor$UIResource.class
new file mode 100644
index 00000000000..635ecb7eec5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor$UIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor.class
new file mode 100644
index 00000000000..1ddca3bd4db
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxIcon.class
new file mode 100644
index 00000000000..65cfdb08cc1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI$MetalComboBoxLayoutManager.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI$MetalComboBoxLayoutManager.class
new file mode 100644
index 00000000000..61720f764b5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI$MetalComboBoxLayoutManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI$MetalComboPopup.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI$MetalComboPopup.class
new file mode 100644
index 00000000000..db870fa5667
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI$MetalComboPopup.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI$MetalPropertyChangeListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI$MetalPropertyChangeListener.class
new file mode 100644
index 00000000000..a6ff5bdd827
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI$MetalPropertyChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI.class
new file mode 100644
index 00000000000..d14dcb63688
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalComboBoxUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalDesktopIconUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalDesktopIconUI.class
new file mode 100644
index 00000000000..f523996d951
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalDesktopIconUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$ButtonLayout.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$ButtonLayout.class
new file mode 100644
index 00000000000..5812e80e6bf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$ButtonLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DetailViewActionListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DetailViewActionListener.class
new file mode 100644
index 00000000000..347cf8f277c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DetailViewActionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxAction.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxAction.class
new file mode 100644
index 00000000000..9762645920c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxModel.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxModel.class
new file mode 100644
index 00000000000..ab37b07eeee
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxRenderer.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxRenderer.class
new file mode 100644
index 00000000000..cfc4c7d0b89
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$DirectoryComboBoxRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$FileRenderer.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$FileRenderer.class
new file mode 100644
index 00000000000..96734ea31a1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$FileRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$FilterComboBoxModel.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$FilterComboBoxModel.class
new file mode 100644
index 00000000000..48b33da80f5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$FilterComboBoxModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$FilterComboBoxRenderer.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$FilterComboBoxRenderer.class
new file mode 100644
index 00000000000..7e67ceef572
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$FilterComboBoxRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$IndentIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$IndentIcon.class
new file mode 100644
index 00000000000..ef6f124c7e8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$IndentIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$ListViewActionListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$ListViewActionListener.class
new file mode 100644
index 00000000000..22ca84fa642
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$ListViewActionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$MetalFileChooserPropertyChangeListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$MetalFileChooserPropertyChangeListener.class
new file mode 100644
index 00000000000..fd71ac5075e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$MetalFileChooserPropertyChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$MetalFileChooserSelectionListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$MetalFileChooserSelectionListener.class
new file mode 100644
index 00000000000..29fc30eef5a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$MetalFileChooserSelectionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$SingleClickListener$EditingActionListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$SingleClickListener$EditingActionListener.class
new file mode 100644
index 00000000000..a3e1ef8a0fb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$SingleClickListener$EditingActionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$SingleClickListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$SingleClickListener.class
new file mode 100644
index 00000000000..efc50fccbda
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$SingleClickListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$TableClickListener$EditingActionListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$TableClickListener$EditingActionListener.class
new file mode 100644
index 00000000000..777f247c861
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$TableClickListener$EditingActionListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$TableClickListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$TableClickListener.class
new file mode 100644
index 00000000000..73c804100fb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$TableClickListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$TableFileRenderer.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$TableFileRenderer.class
new file mode 100644
index 00000000000..a67ead94011
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$TableFileRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$VerticalMidLayout.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$VerticalMidLayout.class
new file mode 100644
index 00000000000..e1f36a57dad
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI$VerticalMidLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI.class
new file mode 100644
index 00000000000..22634c7b06d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalFileChooserUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$1.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$1.class
new file mode 100644
index 00000000000..c90fcece004
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$2.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$2.class
new file mode 100644
index 00000000000..764ee53161c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$2.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$3.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$3.class
new file mode 100644
index 00000000000..28a0385ff13
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$3.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$CheckBoxMenuItemIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$CheckBoxMenuItemIcon.class
new file mode 100644
index 00000000000..e88cd5f77c5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$CheckBoxMenuItemIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserDetailViewIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserDetailViewIcon.class
new file mode 100644
index 00000000000..d72e34a2c64
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserDetailViewIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserHomeFolderIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserHomeFolderIcon.class
new file mode 100644
index 00000000000..1fa4f1c79f6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserHomeFolderIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserListViewIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserListViewIcon.class
new file mode 100644
index 00000000000..b80fc2dea17
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserListViewIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserNewFolderIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserNewFolderIcon.class
new file mode 100644
index 00000000000..79a93802757
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserNewFolderIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserUpFolderIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserUpFolderIcon.class
new file mode 100644
index 00000000000..4c2dfb539ea
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileChooserUpFolderIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileIcon16.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileIcon16.class
new file mode 100644
index 00000000000..0a5a5c8ce40
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FileIcon16.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FolderIcon16.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FolderIcon16.class
new file mode 100644
index 00000000000..65a827a91de
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$FolderIcon16.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$HorizontalSliderThumbIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$HorizontalSliderThumbIcon.class
new file mode 100644
index 00000000000..9cfa561d223
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$HorizontalSliderThumbIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameAltMaximizeIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameAltMaximizeIcon.class
new file mode 100644
index 00000000000..168b94061f6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameAltMaximizeIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameCloseIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameCloseIcon.class
new file mode 100644
index 00000000000..ac45a6c21bc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameCloseIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameDefaultMenuIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameDefaultMenuIcon.class
new file mode 100644
index 00000000000..47972a750c0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameDefaultMenuIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameMaximizeIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameMaximizeIcon.class
new file mode 100644
index 00000000000..ee01345496a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameMaximizeIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameMinimizeIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameMinimizeIcon.class
new file mode 100644
index 00000000000..f86ff74fd32
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$InternalFrameMinimizeIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$PaletteCloseIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$PaletteCloseIcon.class
new file mode 100644
index 00000000000..bafc958b41e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$PaletteCloseIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$RadioButtonIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$RadioButtonIcon.class
new file mode 100644
index 00000000000..59e7310caa7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$RadioButtonIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$RadioButtonMenuItemIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$RadioButtonMenuItemIcon.class
new file mode 100644
index 00000000000..0e3f35d8f39
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$RadioButtonMenuItemIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeComputerIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeComputerIcon.class
new file mode 100644
index 00000000000..cd1d4a774ea
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeComputerIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeControlIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeControlIcon.class
new file mode 100644
index 00000000000..5101c61176b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeControlIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeFloppyDriveIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeFloppyDriveIcon.class
new file mode 100644
index 00000000000..6b90be38765
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeFloppyDriveIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon.class
new file mode 100644
index 00000000000..520a43892a2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeHardDriveIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeHardDriveIcon.class
new file mode 100644
index 00000000000..2fe6af8056c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeHardDriveIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeLeafIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeLeafIcon.class
new file mode 100644
index 00000000000..27aabe6239c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$TreeLeafIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$VerticalSliderThumbIcon.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$VerticalSliderThumbIcon.class
new file mode 100644
index 00000000000..cb378d422b8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory$VerticalSliderThumbIcon.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory.class
new file mode 100644
index 00000000000..fdbcad09013
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalIconFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameTitlePane$MetalInternalFrameTitlePanePropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameTitlePane$MetalInternalFrameTitlePanePropertyChangeHandler.class
new file mode 100644
index 00000000000..f966b6607a7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameTitlePane$MetalInternalFrameTitlePanePropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameTitlePane$MetalTitlePaneLayout.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameTitlePane$MetalTitlePaneLayout.class
new file mode 100644
index 00000000000..0642de5fcf0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameTitlePane$MetalTitlePaneLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameTitlePane.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameTitlePane.class
new file mode 100644
index 00000000000..4ee98141c8f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameTitlePane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameUI$1.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameUI$1.class
new file mode 100644
index 00000000000..7c916d365f7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameUI$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameUI.class
new file mode 100644
index 00000000000..c518ed553ca
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalInternalFrameUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalLabelUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalLabelUI.class
new file mode 100644
index 00000000000..976afe64be7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalLabelUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalLookAndFeel$1.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalLookAndFeel$1.class
new file mode 100644
index 00000000000..89b00a27c70
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalLookAndFeel$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalLookAndFeel.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalLookAndFeel.class
new file mode 100644
index 00000000000..86e1c063749
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalLookAndFeel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalMenuBarUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalMenuBarUI.class
new file mode 100644
index 00000000000..6e39160c608
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalMenuBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.class
new file mode 100644
index 00000000000..7c8b938ecb8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalProgressBarUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalProgressBarUI.class
new file mode 100644
index 00000000000..92f69efbceb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalProgressBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalRadioButtonUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRadioButtonUI.class
new file mode 100644
index 00000000000..b88c964eea6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRadioButtonUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalFrameBorder.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalFrameBorder.class
new file mode 100644
index 00000000000..5aa6ae54f29
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalFrameBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalRootLayout.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalRootLayout.class
new file mode 100644
index 00000000000..355f39d8adc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalRootLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$CloseAction.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$CloseAction.class
new file mode 100644
index 00000000000..08e5c9423e5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$CloseAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$IconifyAction.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$IconifyAction.class
new file mode 100644
index 00000000000..8759cde05dd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$IconifyAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$MaximizeAction.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$MaximizeAction.class
new file mode 100644
index 00000000000..9ae62915587
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$MaximizeAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$MetalTitlePaneLayout.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$MetalTitlePaneLayout.class
new file mode 100644
index 00000000000..edeaa27ad7b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$MetalTitlePaneLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$MouseHandler.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$MouseHandler.class
new file mode 100644
index 00000000000..4599854f8f3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$MouseHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$PaneButton.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$PaneButton.class
new file mode 100644
index 00000000000..c0c0f4ccd87
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane$PaneButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane.class
new file mode 100644
index 00000000000..20022fa7821
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI$MetalTitlePane.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI.class
new file mode 100644
index 00000000000..cfe2e72fc53
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalRootPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollBarUI$MetalScrollBarPropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollBarUI$MetalScrollBarPropertyChangeHandler.class
new file mode 100644
index 00000000000..6efbdc4d683
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollBarUI$MetalScrollBarPropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollBarUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollBarUI.class
new file mode 100644
index 00000000000..55524da4b61
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollButton.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollButton.class
new file mode 100644
index 00000000000..84f5c6487d9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollPaneUI.class
new file mode 100644
index 00000000000..36adede517d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalScrollPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalSeparatorUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalSeparatorUI.class
new file mode 100644
index 00000000000..50fe535ed26
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalSeparatorUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalSliderUI$MetalPropertyListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalSliderUI$MetalPropertyListener.class
new file mode 100644
index 00000000000..eec02ebd62e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalSliderUI$MetalPropertyListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalSliderUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalSliderUI.class
new file mode 100644
index 00000000000..8dd86d9d079
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalSliderUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalSplitPaneDivider$MetalOneTouchButton.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalSplitPaneDivider$MetalOneTouchButton.class
new file mode 100644
index 00000000000..f98cab8036e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalSplitPaneDivider$MetalOneTouchButton.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalSplitPaneDivider.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalSplitPaneDivider.class
new file mode 100644
index 00000000000..b85c734c7df
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalSplitPaneDivider.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalSplitPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalSplitPaneUI.class
new file mode 100644
index 00000000000..8e7a5eeca25
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalSplitPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalTabbedPaneUI$TabbedPaneLayout.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalTabbedPaneUI$TabbedPaneLayout.class
new file mode 100644
index 00000000000..5fb3e4aa01c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalTabbedPaneUI$TabbedPaneLayout.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalTabbedPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalTabbedPaneUI.class
new file mode 100644
index 00000000000..7ac7cac40f5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalTabbedPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalTextFieldUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalTextFieldUI.class
new file mode 100644
index 00000000000..19ffc27b416
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalTextFieldUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalTheme.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalTheme.class
new file mode 100644
index 00000000000..13a569799aa
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalTheme.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalToggleButtonUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalToggleButtonUI.class
new file mode 100644
index 00000000000..25ed8e10779
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalToggleButtonUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI$MetalContainerListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI$MetalContainerListener.class
new file mode 100644
index 00000000000..bb84912aea2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI$MetalContainerListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI$MetalDockingListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI$MetalDockingListener.class
new file mode 100644
index 00000000000..20c56d2207e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI$MetalDockingListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI$MetalRolloverListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI$MetalRolloverListener.class
new file mode 100644
index 00000000000..bea84a8e6d9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI$MetalRolloverListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI.class
new file mode 100644
index 00000000000..9ca5216e701
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolTipUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolTipUI.class
new file mode 100644
index 00000000000..5e98965c5f7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalToolTipUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalTreeUI$LineStyleListener.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalTreeUI$LineStyleListener.class
new file mode 100644
index 00000000000..d17db4e543c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalTreeUI$LineStyleListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalTreeUI.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalTreeUI.class
new file mode 100644
index 00000000000..84363d15dc9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalTreeUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/MetalUtils.class b/libjava/classpath/lib/javax/swing/plaf/metal/MetalUtils.class
new file mode 100644
index 00000000000..0d1dcf94eca
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/MetalUtils.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/metal/OceanTheme.class b/libjava/classpath/lib/javax/swing/plaf/metal/OceanTheme.class
new file mode 100644
index 00000000000..c596b1f8ae2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/metal/OceanTheme.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiButtonUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiButtonUI.class
new file mode 100644
index 00000000000..d417f3d90d2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiButtonUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiColorChooserUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiColorChooserUI.class
new file mode 100644
index 00000000000..40e9a80430f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiColorChooserUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiComboBoxUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiComboBoxUI.class
new file mode 100644
index 00000000000..5e696ac3f7d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiComboBoxUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiDesktopIconUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiDesktopIconUI.class
new file mode 100644
index 00000000000..813ab7cd37e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiDesktopIconUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiDesktopPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiDesktopPaneUI.class
new file mode 100644
index 00000000000..c4587c3c653
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiDesktopPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiFileChooserUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiFileChooserUI.class
new file mode 100644
index 00000000000..4f5783bd5d5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiFileChooserUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiInternalFrameUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiInternalFrameUI.class
new file mode 100644
index 00000000000..81c467b8825
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiInternalFrameUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiLabelUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiLabelUI.class
new file mode 100644
index 00000000000..4b080c529c7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiLabelUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiListUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiListUI.class
new file mode 100644
index 00000000000..becf3bcd515
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiListUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiLookAndFeel.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiLookAndFeel.class
new file mode 100644
index 00000000000..4c57c94bf75
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiLookAndFeel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiMenuBarUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiMenuBarUI.class
new file mode 100644
index 00000000000..30646d3758c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiMenuBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiMenuItemUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiMenuItemUI.class
new file mode 100644
index 00000000000..b98068a2e86
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiMenuItemUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiOptionPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiOptionPaneUI.class
new file mode 100644
index 00000000000..82950b16e5f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiOptionPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiPanelUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiPanelUI.class
new file mode 100644
index 00000000000..537e9c5f8ca
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiPanelUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiPopupMenuUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiPopupMenuUI.class
new file mode 100644
index 00000000000..50e98eb75db
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiPopupMenuUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiProgressBarUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiProgressBarUI.class
new file mode 100644
index 00000000000..ca7322a88c2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiProgressBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiRootPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiRootPaneUI.class
new file mode 100644
index 00000000000..17bca451a69
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiRootPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiScrollBarUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiScrollBarUI.class
new file mode 100644
index 00000000000..d65dbc33fe4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiScrollBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiScrollPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiScrollPaneUI.class
new file mode 100644
index 00000000000..2d824c5e31f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiScrollPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiSeparatorUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiSeparatorUI.class
new file mode 100644
index 00000000000..c7d27284438
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiSeparatorUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiSliderUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiSliderUI.class
new file mode 100644
index 00000000000..b7759489c40
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiSliderUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiSpinnerUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiSpinnerUI.class
new file mode 100644
index 00000000000..2e646028e4e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiSpinnerUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiSplitPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiSplitPaneUI.class
new file mode 100644
index 00000000000..57be2358e64
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiSplitPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiTabbedPaneUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiTabbedPaneUI.class
new file mode 100644
index 00000000000..2e48a74f600
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiTabbedPaneUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiTableHeaderUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiTableHeaderUI.class
new file mode 100644
index 00000000000..edda59cbead
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiTableHeaderUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiTableUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiTableUI.class
new file mode 100644
index 00000000000..4e6210f1226
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiTableUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiTextUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiTextUI.class
new file mode 100644
index 00000000000..5ffcf8b5b54
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiTextUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiToolBarUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiToolBarUI.class
new file mode 100644
index 00000000000..c17150719aa
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiToolBarUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiToolTipUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiToolTipUI.class
new file mode 100644
index 00000000000..9a4def17df4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiToolTipUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiTreeUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiTreeUI.class
new file mode 100644
index 00000000000..efb43fe079d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiTreeUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/multi/MultiViewportUI.class b/libjava/classpath/lib/javax/swing/plaf/multi/MultiViewportUI.class
new file mode 100644
index 00000000000..643fb34b546
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/multi/MultiViewportUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/synth/ColorType.class b/libjava/classpath/lib/javax/swing/plaf/synth/ColorType.class
new file mode 100644
index 00000000000..1c2511a3677
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/synth/ColorType.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/synth/Region.class b/libjava/classpath/lib/javax/swing/plaf/synth/Region.class
new file mode 100644
index 00000000000..c29c7dcc9e8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/synth/Region.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/synth/SynthConstants.class b/libjava/classpath/lib/javax/swing/plaf/synth/SynthConstants.class
new file mode 100644
index 00000000000..9dedcea0bc7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/synth/SynthConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/synth/SynthContext.class b/libjava/classpath/lib/javax/swing/plaf/synth/SynthContext.class
new file mode 100644
index 00000000000..8ef9eb61414
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/synth/SynthContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/synth/SynthGraphicsUtils.class b/libjava/classpath/lib/javax/swing/plaf/synth/SynthGraphicsUtils.class
new file mode 100644
index 00000000000..a7a6733c417
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/synth/SynthGraphicsUtils.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/synth/SynthLookAndFeel.class b/libjava/classpath/lib/javax/swing/plaf/synth/SynthLookAndFeel.class
new file mode 100644
index 00000000000..c4d0994976f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/synth/SynthLookAndFeel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/synth/SynthPainter.class b/libjava/classpath/lib/javax/swing/plaf/synth/SynthPainter.class
new file mode 100644
index 00000000000..ad8ae277791
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/synth/SynthPainter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/synth/SynthStyle.class b/libjava/classpath/lib/javax/swing/plaf/synth/SynthStyle.class
new file mode 100644
index 00000000000..710c129bb83
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/synth/SynthStyle.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/plaf/synth/SynthStyleFactory.class b/libjava/classpath/lib/javax/swing/plaf/synth/SynthStyleFactory.class
new file mode 100644
index 00000000000..b010e039348
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/plaf/synth/SynthStyleFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/table/AbstractTableModel.class b/libjava/classpath/lib/javax/swing/table/AbstractTableModel.class
new file mode 100644
index 00000000000..acb354bb252
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/table/AbstractTableModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/table/DefaultTableCellRenderer$UIResource.class b/libjava/classpath/lib/javax/swing/table/DefaultTableCellRenderer$UIResource.class
new file mode 100644
index 00000000000..59a68ae75c1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/table/DefaultTableCellRenderer$UIResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/table/DefaultTableCellRenderer.class b/libjava/classpath/lib/javax/swing/table/DefaultTableCellRenderer.class
new file mode 100644
index 00000000000..500f418190d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/table/DefaultTableCellRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/table/DefaultTableColumnModel.class b/libjava/classpath/lib/javax/swing/table/DefaultTableColumnModel.class
new file mode 100644
index 00000000000..a141c6d648e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/table/DefaultTableColumnModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/table/DefaultTableModel.class b/libjava/classpath/lib/javax/swing/table/DefaultTableModel.class
new file mode 100644
index 00000000000..bc27c59ca1f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/table/DefaultTableModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/table/JTableHeader$AccessibleJTableHeader$AccessibleJTableHeaderEntry.class b/libjava/classpath/lib/javax/swing/table/JTableHeader$AccessibleJTableHeader$AccessibleJTableHeaderEntry.class
new file mode 100644
index 00000000000..f261bf99a8c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/table/JTableHeader$AccessibleJTableHeader$AccessibleJTableHeaderEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/table/JTableHeader$AccessibleJTableHeader.class b/libjava/classpath/lib/javax/swing/table/JTableHeader$AccessibleJTableHeader.class
new file mode 100644
index 00000000000..caa7f10d8a6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/table/JTableHeader$AccessibleJTableHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/table/JTableHeader.class b/libjava/classpath/lib/javax/swing/table/JTableHeader.class
new file mode 100644
index 00000000000..7bbac17de8b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/table/JTableHeader.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/table/TableCellEditor.class b/libjava/classpath/lib/javax/swing/table/TableCellEditor.class
new file mode 100644
index 00000000000..efe03b2a787
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/table/TableCellEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/table/TableCellRenderer.class b/libjava/classpath/lib/javax/swing/table/TableCellRenderer.class
new file mode 100644
index 00000000000..9e9dbe2966f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/table/TableCellRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/table/TableColumn.class b/libjava/classpath/lib/javax/swing/table/TableColumn.class
new file mode 100644
index 00000000000..daf7d5dc6b6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/table/TableColumn.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/table/TableColumnModel.class b/libjava/classpath/lib/javax/swing/table/TableColumnModel.class
new file mode 100644
index 00000000000..fb3c12184ba
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/table/TableColumnModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/table/TableModel.class b/libjava/classpath/lib/javax/swing/table/TableModel.class
new file mode 100644
index 00000000000..1b5c1434250
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/table/TableModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AbstractDocument$AbstractElement.class b/libjava/classpath/lib/javax/swing/text/AbstractDocument$AbstractElement.class
new file mode 100644
index 00000000000..8085237f265
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AbstractDocument$AbstractElement.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AbstractDocument$AttributeContext.class b/libjava/classpath/lib/javax/swing/text/AbstractDocument$AttributeContext.class
new file mode 100644
index 00000000000..cdf353a2eb0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AbstractDocument$AttributeContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AbstractDocument$BidiElement.class b/libjava/classpath/lib/javax/swing/text/AbstractDocument$BidiElement.class
new file mode 100644
index 00000000000..ce3b3c7f73c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AbstractDocument$BidiElement.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AbstractDocument$BidiRootElement.class b/libjava/classpath/lib/javax/swing/text/AbstractDocument$BidiRootElement.class
new file mode 100644
index 00000000000..02beb2f4f5b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AbstractDocument$BidiRootElement.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AbstractDocument$BranchElement.class b/libjava/classpath/lib/javax/swing/text/AbstractDocument$BranchElement.class
new file mode 100644
index 00000000000..0f3938e918c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AbstractDocument$BranchElement.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AbstractDocument$Bypass.class b/libjava/classpath/lib/javax/swing/text/AbstractDocument$Bypass.class
new file mode 100644
index 00000000000..7ab8a203315
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AbstractDocument$Bypass.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AbstractDocument$Content.class b/libjava/classpath/lib/javax/swing/text/AbstractDocument$Content.class
new file mode 100644
index 00000000000..c9bdc3f62fa
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AbstractDocument$Content.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AbstractDocument$DefaultDocumentEvent.class b/libjava/classpath/lib/javax/swing/text/AbstractDocument$DefaultDocumentEvent.class
new file mode 100644
index 00000000000..ba8f7246bde
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AbstractDocument$DefaultDocumentEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AbstractDocument$ElementEdit.class b/libjava/classpath/lib/javax/swing/text/AbstractDocument$ElementEdit.class
new file mode 100644
index 00000000000..e11f6c64d5f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AbstractDocument$ElementEdit.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AbstractDocument$LeafElement.class b/libjava/classpath/lib/javax/swing/text/AbstractDocument$LeafElement.class
new file mode 100644
index 00000000000..0f13f86fa32
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AbstractDocument$LeafElement.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AbstractDocument.class b/libjava/classpath/lib/javax/swing/text/AbstractDocument.class
new file mode 100644
index 00000000000..a3ae0b5208e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AbstractDocument.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AbstractWriter.class b/libjava/classpath/lib/javax/swing/text/AbstractWriter.class
new file mode 100644
index 00000000000..05b7e79ba1a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AbstractWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AsyncBoxView$ChildLocator.class b/libjava/classpath/lib/javax/swing/text/AsyncBoxView$ChildLocator.class
new file mode 100644
index 00000000000..19b477fcde0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AsyncBoxView$ChildLocator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AsyncBoxView$ChildState.class b/libjava/classpath/lib/javax/swing/text/AsyncBoxView$ChildState.class
new file mode 100644
index 00000000000..34bbdd5fc9f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AsyncBoxView$ChildState.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AsyncBoxView$FlushTask.class b/libjava/classpath/lib/javax/swing/text/AsyncBoxView$FlushTask.class
new file mode 100644
index 00000000000..21bbf808714
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AsyncBoxView$FlushTask.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AsyncBoxView.class b/libjava/classpath/lib/javax/swing/text/AsyncBoxView.class
new file mode 100644
index 00000000000..66149c460f3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AsyncBoxView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AttributeSet$CharacterAttribute.class b/libjava/classpath/lib/javax/swing/text/AttributeSet$CharacterAttribute.class
new file mode 100644
index 00000000000..359fbdc8548
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AttributeSet$CharacterAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AttributeSet$ColorAttribute.class b/libjava/classpath/lib/javax/swing/text/AttributeSet$ColorAttribute.class
new file mode 100644
index 00000000000..7a7966af5b9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AttributeSet$ColorAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AttributeSet$FontAttribute.class b/libjava/classpath/lib/javax/swing/text/AttributeSet$FontAttribute.class
new file mode 100644
index 00000000000..ce4337de20f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AttributeSet$FontAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AttributeSet$ParagraphAttribute.class b/libjava/classpath/lib/javax/swing/text/AttributeSet$ParagraphAttribute.class
new file mode 100644
index 00000000000..7c982606cfa
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AttributeSet$ParagraphAttribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/AttributeSet.class b/libjava/classpath/lib/javax/swing/text/AttributeSet.class
new file mode 100644
index 00000000000..7fd29c4396c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/AttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/BadLocationException.class b/libjava/classpath/lib/javax/swing/text/BadLocationException.class
new file mode 100644
index 00000000000..98da09d6c38
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/BadLocationException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/BoxView.class b/libjava/classpath/lib/javax/swing/text/BoxView.class
new file mode 100644
index 00000000000..7a80c961517
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/BoxView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/Caret.class b/libjava/classpath/lib/javax/swing/text/Caret.class
new file mode 100644
index 00000000000..ff6076d15c8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/Caret.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/ChangedCharSetException.class b/libjava/classpath/lib/javax/swing/text/ChangedCharSetException.class
new file mode 100644
index 00000000000..057a6872814
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/ChangedCharSetException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/ComponentView$1.class b/libjava/classpath/lib/javax/swing/text/ComponentView$1.class
new file mode 100644
index 00000000000..33102d9ab4d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/ComponentView$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/ComponentView$Interceptor.class b/libjava/classpath/lib/javax/swing/text/ComponentView$Interceptor.class
new file mode 100644
index 00000000000..809e777101b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/ComponentView$Interceptor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/ComponentView.class b/libjava/classpath/lib/javax/swing/text/ComponentView.class
new file mode 100644
index 00000000000..734e7cb7eb9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/ComponentView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/CompositeView.class b/libjava/classpath/lib/javax/swing/text/CompositeView.class
new file mode 100644
index 00000000000..9f503c75dbf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/CompositeView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DateFormatter.class b/libjava/classpath/lib/javax/swing/text/DateFormatter.class
new file mode 100644
index 00000000000..c457e2c9ed8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DateFormatter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultCaret$BlinkTimerListener.class b/libjava/classpath/lib/javax/swing/text/DefaultCaret$BlinkTimerListener.class
new file mode 100644
index 00000000000..8ef5ff13f9c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultCaret$BlinkTimerListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultCaret$Bypass.class b/libjava/classpath/lib/javax/swing/text/DefaultCaret$Bypass.class
new file mode 100644
index 00000000000..bea4c5c1007
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultCaret$Bypass.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultCaret$DocumentHandler.class b/libjava/classpath/lib/javax/swing/text/DefaultCaret$DocumentHandler.class
new file mode 100644
index 00000000000..32bfbc44c47
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultCaret$DocumentHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultCaret$PropertyChangeHandler.class b/libjava/classpath/lib/javax/swing/text/DefaultCaret$PropertyChangeHandler.class
new file mode 100644
index 00000000000..11497e74b4e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultCaret$PropertyChangeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultCaret.class b/libjava/classpath/lib/javax/swing/text/DefaultCaret.class
new file mode 100644
index 00000000000..89e12fde404
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultCaret.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BackwardAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BackwardAction.class
new file mode 100644
index 00000000000..03db2322a64
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BackwardAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeepAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeepAction.class
new file mode 100644
index 00000000000..efb137b75f8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeepAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeginAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeginAction.class
new file mode 100644
index 00000000000..b428801dafb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeginAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeginLineAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeginLineAction.class
new file mode 100644
index 00000000000..a0d6cf1e1e7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeginLineAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeginWordAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeginWordAction.class
new file mode 100644
index 00000000000..64bd8d6ad4a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$BeginWordAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$CopyAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$CopyAction.class
new file mode 100644
index 00000000000..93e9be5be3c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$CopyAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$CutAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$CutAction.class
new file mode 100644
index 00000000000..80b43cb521e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$CutAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction.class
new file mode 100644
index 00000000000..1b14036eb4e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DeleteNextCharAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DeleteNextCharAction.class
new file mode 100644
index 00000000000..2a74bf7f45f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DeleteNextCharAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DeletePrevCharAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DeletePrevCharAction.class
new file mode 100644
index 00000000000..88c01ad519c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DeletePrevCharAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DownAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DownAction.class
new file mode 100644
index 00000000000..5594f37bd42
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$DownAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$EndAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$EndAction.class
new file mode 100644
index 00000000000..a8319fac359
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$EndAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$EndLineAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$EndLineAction.class
new file mode 100644
index 00000000000..3708263b999
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$EndLineAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$EndWordAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$EndWordAction.class
new file mode 100644
index 00000000000..66f079ffca2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$EndWordAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$ForwardAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$ForwardAction.class
new file mode 100644
index 00000000000..7ab3f6fdb74
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$ForwardAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$InsertBreakAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$InsertBreakAction.class
new file mode 100644
index 00000000000..1f7c364be4a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$InsertBreakAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$InsertContentAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$InsertContentAction.class
new file mode 100644
index 00000000000..5701aaed52d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$InsertContentAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$InsertTabAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$InsertTabAction.class
new file mode 100644
index 00000000000..f5a64f81b6b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$InsertTabAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$NextWordAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$NextWordAction.class
new file mode 100644
index 00000000000..bbf055fbf85
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$NextWordAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$PasteAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$PasteAction.class
new file mode 100644
index 00000000000..8ebb7f4ecf7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$PasteAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$PreviousWordAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$PreviousWordAction.class
new file mode 100644
index 00000000000..7d2d4b0e4fd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$PreviousWordAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectAllAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectAllAction.class
new file mode 100644
index 00000000000..cf44390395f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectAllAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectLineAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectLineAction.class
new file mode 100644
index 00000000000..ccc5a6458bf
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectLineAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectWordAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectWordAction.class
new file mode 100644
index 00000000000..54ed14cc54d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectWordAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBackwardAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBackwardAction.class
new file mode 100644
index 00000000000..f80454d6c82
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBackwardAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBeginAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBeginAction.class
new file mode 100644
index 00000000000..4fbaf30209e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBeginAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBeginLineAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBeginLineAction.class
new file mode 100644
index 00000000000..a127a5537e7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBeginLineAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBeginWordAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBeginWordAction.class
new file mode 100644
index 00000000000..c9cb13f7d71
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionBeginWordAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionDownAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionDownAction.class
new file mode 100644
index 00000000000..354f776118c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionDownAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionEndAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionEndAction.class
new file mode 100644
index 00000000000..29fac6c4b03
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionEndAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionEndLineAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionEndLineAction.class
new file mode 100644
index 00000000000..0f6d39be3a1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionEndLineAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionEndWordAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionEndWordAction.class
new file mode 100644
index 00000000000..de30976ffee
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionEndWordAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionForwardAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionForwardAction.class
new file mode 100644
index 00000000000..8970a9a770a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionForwardAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionNextWordAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionNextWordAction.class
new file mode 100644
index 00000000000..3422529b42a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionNextWordAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionPreviousWordAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionPreviousWordAction.class
new file mode 100644
index 00000000000..ad3ace407da
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionPreviousWordAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionUpAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionUpAction.class
new file mode 100644
index 00000000000..f17bba89852
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$SelectionUpAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$UpAction.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$UpAction.class
new file mode 100644
index 00000000000..41abccfc771
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit$UpAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultEditorKit.class b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit.class
new file mode 100644
index 00000000000..36d462bf592
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultEditorKit.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultFormatter$FormatterDocumentFilter.class b/libjava/classpath/lib/javax/swing/text/DefaultFormatter$FormatterDocumentFilter.class
new file mode 100644
index 00000000000..f2eb6ccf61d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultFormatter$FormatterDocumentFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultFormatter.class b/libjava/classpath/lib/javax/swing/text/DefaultFormatter.class
new file mode 100644
index 00000000000..34f31b2c3fe
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultFormatter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultFormatterFactory.class b/libjava/classpath/lib/javax/swing/text/DefaultFormatterFactory.class
new file mode 100644
index 00000000000..cd6c220298b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultFormatterFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultHighlighter$DefaultHighlightPainter.class b/libjava/classpath/lib/javax/swing/text/DefaultHighlighter$DefaultHighlightPainter.class
new file mode 100644
index 00000000000..12a44c2fd28
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultHighlighter$DefaultHighlightPainter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultHighlighter$HighlightEntry.class b/libjava/classpath/lib/javax/swing/text/DefaultHighlighter$HighlightEntry.class
new file mode 100644
index 00000000000..b5a07ad27d3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultHighlighter$HighlightEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultHighlighter$LayerHighlightEntry.class b/libjava/classpath/lib/javax/swing/text/DefaultHighlighter$LayerHighlightEntry.class
new file mode 100644
index 00000000000..6be9b03b26b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultHighlighter$LayerHighlightEntry.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultHighlighter.class b/libjava/classpath/lib/javax/swing/text/DefaultHighlighter.class
new file mode 100644
index 00000000000..cc105ee62df
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultHighlighter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$AttributeUndoableEdit.class b/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$AttributeUndoableEdit.class
new file mode 100644
index 00000000000..1d2bcd8ce23
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$AttributeUndoableEdit.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$ElementBuffer$Edit.class b/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$ElementBuffer$Edit.class
new file mode 100644
index 00000000000..f64b587d337
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$ElementBuffer$Edit.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$ElementBuffer.class b/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$ElementBuffer.class
new file mode 100644
index 00000000000..d9bd130e70f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$ElementBuffer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$ElementSpec.class b/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$ElementSpec.class
new file mode 100644
index 00000000000..b82e7253033
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$ElementSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$SectionElement.class b/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$SectionElement.class
new file mode 100644
index 00000000000..277c1a82e27
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$SectionElement.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$StyleChangeListener.class b/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$StyleChangeListener.class
new file mode 100644
index 00000000000..bfbd3b8330c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument$StyleChangeListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument.class b/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument.class
new file mode 100644
index 00000000000..7b337be5fd8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultStyledDocument.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DefaultTextUI.class b/libjava/classpath/lib/javax/swing/text/DefaultTextUI.class
new file mode 100644
index 00000000000..49557e64000
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DefaultTextUI.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/Document.class b/libjava/classpath/lib/javax/swing/text/Document.class
new file mode 100644
index 00000000000..5ab171003b1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/Document.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DocumentFilter$FilterBypass.class b/libjava/classpath/lib/javax/swing/text/DocumentFilter$FilterBypass.class
new file mode 100644
index 00000000000..bbf919d73f9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DocumentFilter$FilterBypass.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/DocumentFilter.class b/libjava/classpath/lib/javax/swing/text/DocumentFilter.class
new file mode 100644
index 00000000000..a218a8d1773
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/DocumentFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/EditorKit.class b/libjava/classpath/lib/javax/swing/text/EditorKit.class
new file mode 100644
index 00000000000..69dcec6862a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/EditorKit.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/Element.class b/libjava/classpath/lib/javax/swing/text/Element.class
new file mode 100644
index 00000000000..570363d41b2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/Element.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/ElementIterator$ElementRef.class b/libjava/classpath/lib/javax/swing/text/ElementIterator$ElementRef.class
new file mode 100644
index 00000000000..577995ffe67
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/ElementIterator$ElementRef.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/ElementIterator.class b/libjava/classpath/lib/javax/swing/text/ElementIterator.class
new file mode 100644
index 00000000000..637badf0c0c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/ElementIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/EmptyAttributeSet$1.class b/libjava/classpath/lib/javax/swing/text/EmptyAttributeSet$1.class
new file mode 100644
index 00000000000..3d7afc62a65
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/EmptyAttributeSet$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/EmptyAttributeSet.class b/libjava/classpath/lib/javax/swing/text/EmptyAttributeSet.class
new file mode 100644
index 00000000000..d55c939b23f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/EmptyAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/FieldView$1.class b/libjava/classpath/lib/javax/swing/text/FieldView$1.class
new file mode 100644
index 00000000000..efb6ff46a0b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/FieldView$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/FieldView.class b/libjava/classpath/lib/javax/swing/text/FieldView.class
new file mode 100644
index 00000000000..9d418263272
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/FieldView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/FlowView$FlowStrategy.class b/libjava/classpath/lib/javax/swing/text/FlowView$FlowStrategy.class
new file mode 100644
index 00000000000..a0935b8c622
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/FlowView$FlowStrategy.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/FlowView$LogicalView.class b/libjava/classpath/lib/javax/swing/text/FlowView$LogicalView.class
new file mode 100644
index 00000000000..986ef604d1f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/FlowView$LogicalView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/FlowView.class b/libjava/classpath/lib/javax/swing/text/FlowView.class
new file mode 100644
index 00000000000..96290080af6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/FlowView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/GapContent$GapContentPosition.class b/libjava/classpath/lib/javax/swing/text/GapContent$GapContentPosition.class
new file mode 100644
index 00000000000..30f5260fb17
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/GapContent$GapContentPosition.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/GapContent$InsertUndo.class b/libjava/classpath/lib/javax/swing/text/GapContent$InsertUndo.class
new file mode 100644
index 00000000000..f93ebd0b84a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/GapContent$InsertUndo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/GapContent$Mark.class b/libjava/classpath/lib/javax/swing/text/GapContent$Mark.class
new file mode 100644
index 00000000000..be06f267c50
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/GapContent$Mark.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/GapContent$UndoPosRef.class b/libjava/classpath/lib/javax/swing/text/GapContent$UndoPosRef.class
new file mode 100644
index 00000000000..8e149e7648f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/GapContent$UndoPosRef.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/GapContent$UndoRemove.class b/libjava/classpath/lib/javax/swing/text/GapContent$UndoRemove.class
new file mode 100644
index 00000000000..3ecf5adaa22
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/GapContent$UndoRemove.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/GapContent.class b/libjava/classpath/lib/javax/swing/text/GapContent.class
new file mode 100644
index 00000000000..e7049f20145
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/GapContent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/GlyphView$DefaultGlyphPainter.class b/libjava/classpath/lib/javax/swing/text/GlyphView$DefaultGlyphPainter.class
new file mode 100644
index 00000000000..0d82c97bf94
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/GlyphView$DefaultGlyphPainter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/GlyphView$GlyphPainter.class b/libjava/classpath/lib/javax/swing/text/GlyphView$GlyphPainter.class
new file mode 100644
index 00000000000..99cc4f7c7d9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/GlyphView$GlyphPainter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/GlyphView$J2DGlyphPainter.class b/libjava/classpath/lib/javax/swing/text/GlyphView$J2DGlyphPainter.class
new file mode 100644
index 00000000000..494252752db
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/GlyphView$J2DGlyphPainter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/GlyphView.class b/libjava/classpath/lib/javax/swing/text/GlyphView.class
new file mode 100644
index 00000000000..7beb2ba0679
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/GlyphView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/Highlighter$Highlight.class b/libjava/classpath/lib/javax/swing/text/Highlighter$Highlight.class
new file mode 100644
index 00000000000..e3a6714b0e2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/Highlighter$Highlight.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/Highlighter$HighlightPainter.class b/libjava/classpath/lib/javax/swing/text/Highlighter$HighlightPainter.class
new file mode 100644
index 00000000000..e41f610f199
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/Highlighter$HighlightPainter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/Highlighter.class b/libjava/classpath/lib/javax/swing/text/Highlighter.class
new file mode 100644
index 00000000000..0fbd97938f0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/Highlighter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/IconView.class b/libjava/classpath/lib/javax/swing/text/IconView.class
new file mode 100644
index 00000000000..b26039157b2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/IconView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/InternationalFormatter.class b/libjava/classpath/lib/javax/swing/text/InternationalFormatter.class
new file mode 100644
index 00000000000..dbf03823c08
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/InternationalFormatter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/JTextComponent$AccessibleJTextComponent.class b/libjava/classpath/lib/javax/swing/text/JTextComponent$AccessibleJTextComponent.class
new file mode 100644
index 00000000000..e1d0af2c71c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/JTextComponent$AccessibleJTextComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/JTextComponent$DefaultKeymap.class b/libjava/classpath/lib/javax/swing/text/JTextComponent$DefaultKeymap.class
new file mode 100644
index 00000000000..997fa67a757
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/JTextComponent$DefaultKeymap.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/JTextComponent$DefaultTransferHandler.class b/libjava/classpath/lib/javax/swing/text/JTextComponent$DefaultTransferHandler.class
new file mode 100644
index 00000000000..8533861a6e0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/JTextComponent$DefaultTransferHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/JTextComponent$KeyBinding.class b/libjava/classpath/lib/javax/swing/text/JTextComponent$KeyBinding.class
new file mode 100644
index 00000000000..bf2683d47d4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/JTextComponent$KeyBinding.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/JTextComponent$KeymapActionMap.class b/libjava/classpath/lib/javax/swing/text/JTextComponent$KeymapActionMap.class
new file mode 100644
index 00000000000..8a4084e18db
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/JTextComponent$KeymapActionMap.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/JTextComponent$KeymapWrapper.class b/libjava/classpath/lib/javax/swing/text/JTextComponent$KeymapWrapper.class
new file mode 100644
index 00000000000..13d41ade175
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/JTextComponent$KeymapWrapper.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/JTextComponent.class b/libjava/classpath/lib/javax/swing/text/JTextComponent.class
new file mode 100644
index 00000000000..f09c72a5884
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/JTextComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/Keymap.class b/libjava/classpath/lib/javax/swing/text/Keymap.class
new file mode 100644
index 00000000000..25ae0f367fe
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/Keymap.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/LabelView.class b/libjava/classpath/lib/javax/swing/text/LabelView.class
new file mode 100644
index 00000000000..d3c1a6dde3a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/LabelView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/LayeredHighlighter$LayerPainter.class b/libjava/classpath/lib/javax/swing/text/LayeredHighlighter$LayerPainter.class
new file mode 100644
index 00000000000..6a0619ff47f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/LayeredHighlighter$LayerPainter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/LayeredHighlighter.class b/libjava/classpath/lib/javax/swing/text/LayeredHighlighter.class
new file mode 100644
index 00000000000..cca3bf2328a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/LayeredHighlighter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/LayoutQueue.class b/libjava/classpath/lib/javax/swing/text/LayoutQueue.class
new file mode 100644
index 00000000000..83e7a1767d9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/LayoutQueue.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/MaskFormatter.class b/libjava/classpath/lib/javax/swing/text/MaskFormatter.class
new file mode 100644
index 00000000000..559193a6692
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/MaskFormatter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/MutableAttributeSet.class b/libjava/classpath/lib/javax/swing/text/MutableAttributeSet.class
new file mode 100644
index 00000000000..bd96badde5e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/MutableAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/NavigationFilter$FilterBypass.class b/libjava/classpath/lib/javax/swing/text/NavigationFilter$FilterBypass.class
new file mode 100644
index 00000000000..1ce6a3cce50
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/NavigationFilter$FilterBypass.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/NavigationFilter.class b/libjava/classpath/lib/javax/swing/text/NavigationFilter.class
new file mode 100644
index 00000000000..6fec1f4d90f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/NavigationFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/NumberFormatter.class b/libjava/classpath/lib/javax/swing/text/NumberFormatter.class
new file mode 100644
index 00000000000..1074629e649
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/NumberFormatter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/ParagraphView$Row.class b/libjava/classpath/lib/javax/swing/text/ParagraphView$Row.class
new file mode 100644
index 00000000000..ab9c2654c5d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/ParagraphView$Row.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/ParagraphView.class b/libjava/classpath/lib/javax/swing/text/ParagraphView.class
new file mode 100644
index 00000000000..5787f0dd392
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/ParagraphView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/PasswordView.class b/libjava/classpath/lib/javax/swing/text/PasswordView.class
new file mode 100644
index 00000000000..565d0122173
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/PasswordView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/PlainDocument.class b/libjava/classpath/lib/javax/swing/text/PlainDocument.class
new file mode 100644
index 00000000000..d368e00790f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/PlainDocument.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/PlainView.class b/libjava/classpath/lib/javax/swing/text/PlainView.class
new file mode 100644
index 00000000000..abfdc19898d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/PlainView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/Position$Bias.class b/libjava/classpath/lib/javax/swing/text/Position$Bias.class
new file mode 100644
index 00000000000..2a0537c4407
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/Position$Bias.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/Position.class b/libjava/classpath/lib/javax/swing/text/Position.class
new file mode 100644
index 00000000000..f012482fff9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/Position.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/Segment.class b/libjava/classpath/lib/javax/swing/text/Segment.class
new file mode 100644
index 00000000000..05c0e8334d8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/Segment.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/SimpleAttributeSet.class b/libjava/classpath/lib/javax/swing/text/SimpleAttributeSet.class
new file mode 100644
index 00000000000..3c824ac1914
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/SimpleAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StringContent$InsertUndo.class b/libjava/classpath/lib/javax/swing/text/StringContent$InsertUndo.class
new file mode 100644
index 00000000000..9d51c6520dd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StringContent$InsertUndo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StringContent$Mark.class b/libjava/classpath/lib/javax/swing/text/StringContent$Mark.class
new file mode 100644
index 00000000000..67d60a2a84f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StringContent$Mark.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StringContent$RemoveUndo.class b/libjava/classpath/lib/javax/swing/text/StringContent$RemoveUndo.class
new file mode 100644
index 00000000000..4fc5da651d2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StringContent$RemoveUndo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StringContent$StickyPosition.class b/libjava/classpath/lib/javax/swing/text/StringContent$StickyPosition.class
new file mode 100644
index 00000000000..6059d22c681
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StringContent$StickyPosition.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StringContent$UndoPosRef.class b/libjava/classpath/lib/javax/swing/text/StringContent$UndoPosRef.class
new file mode 100644
index 00000000000..7e2c2d44814
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StringContent$UndoPosRef.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StringContent.class b/libjava/classpath/lib/javax/swing/text/StringContent.class
new file mode 100644
index 00000000000..702d514aefd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StringContent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/Style.class b/libjava/classpath/lib/javax/swing/text/Style.class
new file mode 100644
index 00000000000..f1a81cfb7f2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/Style.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyleConstants$CharacterConstants.class b/libjava/classpath/lib/javax/swing/text/StyleConstants$CharacterConstants.class
new file mode 100644
index 00000000000..fc27c45be26
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyleConstants$CharacterConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyleConstants$ColorConstants.class b/libjava/classpath/lib/javax/swing/text/StyleConstants$ColorConstants.class
new file mode 100644
index 00000000000..7708186ad10
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyleConstants$ColorConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyleConstants$FontConstants.class b/libjava/classpath/lib/javax/swing/text/StyleConstants$FontConstants.class
new file mode 100644
index 00000000000..7fd6ac1cf97
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyleConstants$FontConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyleConstants$ParagraphConstants.class b/libjava/classpath/lib/javax/swing/text/StyleConstants$ParagraphConstants.class
new file mode 100644
index 00000000000..86b02b7853d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyleConstants$ParagraphConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyleConstants.class b/libjava/classpath/lib/javax/swing/text/StyleConstants.class
new file mode 100644
index 00000000000..608bff99481
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyleConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyleContext$1.class b/libjava/classpath/lib/javax/swing/text/StyleContext$1.class
new file mode 100644
index 00000000000..4cd8a5c34ee
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyleContext$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyleContext$NamedStyle.class b/libjava/classpath/lib/javax/swing/text/StyleContext$NamedStyle.class
new file mode 100644
index 00000000000..4acf9cdb139
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyleContext$NamedStyle.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyleContext$SimpleFontSpec.class b/libjava/classpath/lib/javax/swing/text/StyleContext$SimpleFontSpec.class
new file mode 100644
index 00000000000..6f05bbdfbc2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyleContext$SimpleFontSpec.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyleContext$SmallAttributeSet.class b/libjava/classpath/lib/javax/swing/text/StyleContext$SmallAttributeSet.class
new file mode 100644
index 00000000000..a4926f9f810
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyleContext$SmallAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyleContext.class b/libjava/classpath/lib/javax/swing/text/StyleContext.class
new file mode 100644
index 00000000000..0940dedc938
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyleContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyledDocument.class b/libjava/classpath/lib/javax/swing/text/StyledDocument.class
new file mode 100644
index 00000000000..3dc29db899b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyledDocument.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyledEditorKit$AlignmentAction.class b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$AlignmentAction.class
new file mode 100644
index 00000000000..b07b5f9d7e6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$AlignmentAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyledEditorKit$BoldAction.class b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$BoldAction.class
new file mode 100644
index 00000000000..26c3dd8d3b9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$BoldAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyledEditorKit$CaretTracker.class b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$CaretTracker.class
new file mode 100644
index 00000000000..4e47402fb70
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$CaretTracker.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyledEditorKit$FontFamilyAction.class b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$FontFamilyAction.class
new file mode 100644
index 00000000000..3af0af3b9ed
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$FontFamilyAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyledEditorKit$FontSizeAction.class b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$FontSizeAction.class
new file mode 100644
index 00000000000..f0040b9a786
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$FontSizeAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyledEditorKit$ForegroundAction.class b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$ForegroundAction.class
new file mode 100644
index 00000000000..c558c738823
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$ForegroundAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyledEditorKit$ItalicAction.class b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$ItalicAction.class
new file mode 100644
index 00000000000..1ba3c954860
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$ItalicAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyledEditorKit$StyledTextAction.class b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$StyledTextAction.class
new file mode 100644
index 00000000000..93f945cea0c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$StyledTextAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyledEditorKit$StyledViewFactory.class b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$StyledViewFactory.class
new file mode 100644
index 00000000000..732142fa665
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$StyledViewFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyledEditorKit$UnderlineAction.class b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$UnderlineAction.class
new file mode 100644
index 00000000000..094bd861d17
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyledEditorKit$UnderlineAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/StyledEditorKit.class b/libjava/classpath/lib/javax/swing/text/StyledEditorKit.class
new file mode 100644
index 00000000000..de57fff624d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/StyledEditorKit.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/TabExpander.class b/libjava/classpath/lib/javax/swing/text/TabExpander.class
new file mode 100644
index 00000000000..8ccec42d3e4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/TabExpander.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/TabSet.class b/libjava/classpath/lib/javax/swing/text/TabSet.class
new file mode 100644
index 00000000000..5f0b6405411
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/TabSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/TabStop.class b/libjava/classpath/lib/javax/swing/text/TabStop.class
new file mode 100644
index 00000000000..8c1ae34f448
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/TabStop.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/TabableView.class b/libjava/classpath/lib/javax/swing/text/TabableView.class
new file mode 100644
index 00000000000..ff97f36977a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/TabableView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/TableView$TableCell.class b/libjava/classpath/lib/javax/swing/text/TableView$TableCell.class
new file mode 100644
index 00000000000..c34ef73e7ea
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/TableView$TableCell.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/TableView$TableRow.class b/libjava/classpath/lib/javax/swing/text/TableView$TableRow.class
new file mode 100644
index 00000000000..debc2f3af5f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/TableView$TableRow.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/TableView.class b/libjava/classpath/lib/javax/swing/text/TableView.class
new file mode 100644
index 00000000000..b847e01fb48
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/TableView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/TextAction$HorizontalMovementAction.class b/libjava/classpath/lib/javax/swing/text/TextAction$HorizontalMovementAction.class
new file mode 100644
index 00000000000..69fb6f9eab9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/TextAction$HorizontalMovementAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/TextAction$VerticalMovementAction.class b/libjava/classpath/lib/javax/swing/text/TextAction$VerticalMovementAction.class
new file mode 100644
index 00000000000..46d5d0e7d91
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/TextAction$VerticalMovementAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/TextAction.class b/libjava/classpath/lib/javax/swing/text/TextAction.class
new file mode 100644
index 00000000000..6086f9b7bad
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/TextAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/Utilities.class b/libjava/classpath/lib/javax/swing/text/Utilities.class
new file mode 100644
index 00000000000..21634649389
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/Utilities.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/View.class b/libjava/classpath/lib/javax/swing/text/View.class
new file mode 100644
index 00000000000..5eaa2fcc254
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/View.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/ViewFactory.class b/libjava/classpath/lib/javax/swing/text/ViewFactory.class
new file mode 100644
index 00000000000..c7095d06114
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/ViewFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/WrappedPlainView$WrappedLine.class b/libjava/classpath/lib/javax/swing/text/WrappedPlainView$WrappedLine.class
new file mode 100644
index 00000000000..71d3cf04e1b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/WrappedPlainView$WrappedLine.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/WrappedPlainView$WrappedLineCreator.class b/libjava/classpath/lib/javax/swing/text/WrappedPlainView$WrappedLineCreator.class
new file mode 100644
index 00000000000..4584e771cc4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/WrappedPlainView$WrappedLineCreator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/WrappedPlainView.class b/libjava/classpath/lib/javax/swing/text/WrappedPlainView.class
new file mode 100644
index 00000000000..ee618df9480
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/WrappedPlainView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/ZoneView$Zone.class b/libjava/classpath/lib/javax/swing/text/ZoneView$Zone.class
new file mode 100644
index 00000000000..028b41630fd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/ZoneView$Zone.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/ZoneView.class b/libjava/classpath/lib/javax/swing/text/ZoneView.class
new file mode 100644
index 00000000000..875dce6d15a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/ZoneView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/BRView.class b/libjava/classpath/lib/javax/swing/text/html/BRView.class
new file mode 100644
index 00000000000..19fbd09ee88
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/BRView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/BlockView$PositionInfo.class b/libjava/classpath/lib/javax/swing/text/html/BlockView$PositionInfo.class
new file mode 100644
index 00000000000..0eabccb9d11
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/BlockView$PositionInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/BlockView.class b/libjava/classpath/lib/javax/swing/text/html/BlockView.class
new file mode 100644
index 00000000000..3fd6a862524
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/BlockView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/CSS$Attribute.class b/libjava/classpath/lib/javax/swing/text/html/CSS$Attribute.class
new file mode 100644
index 00000000000..0779b12ac5d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/CSS$Attribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/CSS.class b/libjava/classpath/lib/javax/swing/text/html/CSS.class
new file mode 100644
index 00000000000..f280debf7f5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/CSS.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/CSSBorder.class b/libjava/classpath/lib/javax/swing/text/html/CSSBorder.class
new file mode 100644
index 00000000000..35a0c37fe55
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/CSSBorder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/CSSParser$CSSParserCallback.class b/libjava/classpath/lib/javax/swing/text/html/CSSParser$CSSParserCallback.class
new file mode 100644
index 00000000000..54ae9959a79
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/CSSParser$CSSParserCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/CSSParser.class b/libjava/classpath/lib/javax/swing/text/html/CSSParser.class
new file mode 100644
index 00000000000..6d5c4bf18a2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/CSSParser.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/FormSubmitEvent$MethodType.class b/libjava/classpath/lib/javax/swing/text/html/FormSubmitEvent$MethodType.class
new file mode 100644
index 00000000000..bb06e1a26e9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/FormSubmitEvent$MethodType.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/FormSubmitEvent.class b/libjava/classpath/lib/javax/swing/text/html/FormSubmitEvent.class
new file mode 100644
index 00000000000..8d88b68492a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/FormSubmitEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/FormView$1.class b/libjava/classpath/lib/javax/swing/text/html/FormView$1.class
new file mode 100644
index 00000000000..e7150e51d57
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/FormView$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/FormView$MouseEventListener.class b/libjava/classpath/lib/javax/swing/text/html/FormView$MouseEventListener.class
new file mode 100644
index 00000000000..36bcaf90f8e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/FormView$MouseEventListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/FormView$SubmitThread.class b/libjava/classpath/lib/javax/swing/text/html/FormView$SubmitThread.class
new file mode 100644
index 00000000000..0d165d5cc90
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/FormView$SubmitThread.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/FormView.class b/libjava/classpath/lib/javax/swing/text/html/FormView.class
new file mode 100644
index 00000000000..7106e678b19
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/FormView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/FrameSetView$FrameSetRow.class b/libjava/classpath/lib/javax/swing/text/html/FrameSetView$FrameSetRow.class
new file mode 100644
index 00000000000..3f42594ba1c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/FrameSetView$FrameSetRow.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/FrameSetView.class b/libjava/classpath/lib/javax/swing/text/html/FrameSetView.class
new file mode 100644
index 00000000000..94563153c10
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/FrameSetView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/FrameView.class b/libjava/classpath/lib/javax/swing/text/html/FrameView.class
new file mode 100644
index 00000000000..3647ada8616
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/FrameView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HRuleView$Beginning.class b/libjava/classpath/lib/javax/swing/text/html/HRuleView$Beginning.class
new file mode 100644
index 00000000000..0bb2b9dd4fc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HRuleView$Beginning.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HRuleView.class b/libjava/classpath/lib/javax/swing/text/html/HRuleView.class
new file mode 100644
index 00000000000..f46068aa2e2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HRuleView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTML$Attribute.class b/libjava/classpath/lib/javax/swing/text/html/HTML$Attribute.class
new file mode 100644
index 00000000000..25f00b39294
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTML$Attribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTML$Tag.class b/libjava/classpath/lib/javax/swing/text/html/HTML$Tag.class
new file mode 100644
index 00000000000..2682132d0b5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTML$Tag.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTML$UnknownTag.class b/libjava/classpath/lib/javax/swing/text/html/HTML$UnknownTag.class
new file mode 100644
index 00000000000..ed609566277
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTML$UnknownTag.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTML.class b/libjava/classpath/lib/javax/swing/text/html/HTML.class
new file mode 100644
index 00000000000..26fdd6560ac
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTML.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$1.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$1.class
new file mode 100644
index 00000000000..3d384fcacce
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$BlockElement.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$BlockElement.class
new file mode 100644
index 00000000000..f6983d22edc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$BlockElement.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$AreaAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$AreaAction.class
new file mode 100644
index 00000000000..17a861a4720
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$AreaAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$BaseAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$BaseAction.class
new file mode 100644
index 00000000000..cfcdfed6a10
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$BaseAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$BlockAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$BlockAction.class
new file mode 100644
index 00000000000..3a80c00a3b0
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$BlockAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$CharacterAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$CharacterAction.class
new file mode 100644
index 00000000000..eac8191165e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$CharacterAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$ConvertAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$ConvertAction.class
new file mode 100644
index 00000000000..3bd220bace5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$ConvertAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$FormAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$FormAction.class
new file mode 100644
index 00000000000..9038189c271
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$FormAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$FormTagAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$FormTagAction.class
new file mode 100644
index 00000000000..6d96515e8cd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$FormTagAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$HeadAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$HeadAction.class
new file mode 100644
index 00000000000..3041c702579
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$HeadAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$HiddenAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$HiddenAction.class
new file mode 100644
index 00000000000..17488d86e2c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$HiddenAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$IsindexAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$IsindexAction.class
new file mode 100644
index 00000000000..e203cc5efae
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$IsindexAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$LinkAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$LinkAction.class
new file mode 100644
index 00000000000..13c0d252201
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$LinkAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$MapAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$MapAction.class
new file mode 100644
index 00000000000..81ac765d8b3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$MapAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$MetaAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$MetaAction.class
new file mode 100644
index 00000000000..dddcb3aa39e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$MetaAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$ParagraphAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$ParagraphAction.class
new file mode 100644
index 00000000000..1d59925575a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$ParagraphAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$PreAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$PreAction.class
new file mode 100644
index 00000000000..d7e98e8c4a4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$PreAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$SpecialAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$SpecialAction.class
new file mode 100644
index 00000000000..a89dee3160d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$SpecialAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$StyleAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$StyleAction.class
new file mode 100644
index 00000000000..f8b2c596cb1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$StyleAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$TagAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$TagAction.class
new file mode 100644
index 00000000000..aa62c081213
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$TagAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$TitleAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$TitleAction.class
new file mode 100644
index 00000000000..67d7bd79125
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader$TitleAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader.class
new file mode 100644
index 00000000000..c44c2b487a7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$HTMLReader.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$Iterator.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$Iterator.class
new file mode 100644
index 00000000000..69a2c5f896d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$Iterator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$LeafIterator.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$LeafIterator.class
new file mode 100644
index 00000000000..352cfc6af26
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$LeafIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$RunElement.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$RunElement.class
new file mode 100644
index 00000000000..0ce0da0d4e4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument$RunElement.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLDocument.class b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument.class
new file mode 100644
index 00000000000..ff4b4494a17
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLDocument.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$HTMLFactory.class b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$HTMLFactory.class
new file mode 100644
index 00000000000..b4fb846a70f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$HTMLFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$HTMLTextAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$HTMLTextAction.class
new file mode 100644
index 00000000000..fb0a05c54d6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$HTMLTextAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$InsertHTMLTextAction.class b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$InsertHTMLTextAction.class
new file mode 100644
index 00000000000..86637748adb
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$InsertHTMLTextAction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$LinkController.class b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$LinkController.class
new file mode 100644
index 00000000000..8d94d0ee483
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$LinkController.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$Parser.class b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$Parser.class
new file mode 100644
index 00000000000..0024d89ae21
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$Parser.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$ParserCallback.class b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$ParserCallback.class
new file mode 100644
index 00000000000..881a9977f2b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit$ParserCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit.class b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit.class
new file mode 100644
index 00000000000..6d826cf4248
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLEditorKit.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLFrameHyperlinkEvent.class b/libjava/classpath/lib/javax/swing/text/html/HTMLFrameHyperlinkEvent.class
new file mode 100644
index 00000000000..f5bf05f036c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLFrameHyperlinkEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/HTMLWriter.class b/libjava/classpath/lib/javax/swing/text/html/HTMLWriter.class
new file mode 100644
index 00000000000..25f8193c05a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/HTMLWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/ImageView$1.class b/libjava/classpath/lib/javax/swing/text/html/ImageView$1.class
new file mode 100644
index 00000000000..1785831cca1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/ImageView$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/ImageView$Observer.class b/libjava/classpath/lib/javax/swing/text/html/ImageView$Observer.class
new file mode 100644
index 00000000000..b919707dcfe
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/ImageView$Observer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/ImageView.class b/libjava/classpath/lib/javax/swing/text/html/ImageView.class
new file mode 100644
index 00000000000..dfd71640a9e
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/ImageView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/InlineView.class b/libjava/classpath/lib/javax/swing/text/html/InlineView.class
new file mode 100644
index 00000000000..b29d69cbb1f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/InlineView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/ListView.class b/libjava/classpath/lib/javax/swing/text/html/ListView.class
new file mode 100644
index 00000000000..cb6c12004e3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/ListView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/MinimalHTMLWriter.class b/libjava/classpath/lib/javax/swing/text/html/MinimalHTMLWriter.class
new file mode 100644
index 00000000000..864c6d2597c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/MinimalHTMLWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/MultiAttributeSet$MultiNameEnumeration.class b/libjava/classpath/lib/javax/swing/text/html/MultiAttributeSet$MultiNameEnumeration.class
new file mode 100644
index 00000000000..8ed0c9e12dc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/MultiAttributeSet$MultiNameEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/MultiAttributeSet.class b/libjava/classpath/lib/javax/swing/text/html/MultiAttributeSet.class
new file mode 100644
index 00000000000..535ec932b08
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/MultiAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/MultiStyle.class b/libjava/classpath/lib/javax/swing/text/html/MultiStyle.class
new file mode 100644
index 00000000000..3904a2c29c3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/MultiStyle.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/NullView.class b/libjava/classpath/lib/javax/swing/text/html/NullView.class
new file mode 100644
index 00000000000..9974854e5e8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/NullView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/ObjectView.class b/libjava/classpath/lib/javax/swing/text/html/ObjectView.class
new file mode 100644
index 00000000000..b2004547c1b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/ObjectView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/Option.class b/libjava/classpath/lib/javax/swing/text/html/Option.class
new file mode 100644
index 00000000000..ea2adad2814
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/Option.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/ParagraphView.class b/libjava/classpath/lib/javax/swing/text/html/ParagraphView.class
new file mode 100644
index 00000000000..6666ae95454
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/ParagraphView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/ResetableModel.class b/libjava/classpath/lib/javax/swing/text/html/ResetableModel.class
new file mode 100644
index 00000000000..b575bf74e01
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/ResetableModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/ResetablePlainDocument.class b/libjava/classpath/lib/javax/swing/text/html/ResetablePlainDocument.class
new file mode 100644
index 00000000000..9094df441a8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/ResetablePlainDocument.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/ResetableToggleButtonModel.class b/libjava/classpath/lib/javax/swing/text/html/ResetableToggleButtonModel.class
new file mode 100644
index 00000000000..1d21f8bcf8c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/ResetableToggleButtonModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/SelectComboBoxModel.class b/libjava/classpath/lib/javax/swing/text/html/SelectComboBoxModel.class
new file mode 100644
index 00000000000..9811870ceae
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/SelectComboBoxModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/SelectListModel.class b/libjava/classpath/lib/javax/swing/text/html/SelectListModel.class
new file mode 100644
index 00000000000..1145a769734
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/SelectListModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/StyleSheet$BoxPainter.class b/libjava/classpath/lib/javax/swing/text/html/StyleSheet$BoxPainter.class
new file mode 100644
index 00000000000..6541ceb6e2c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/StyleSheet$BoxPainter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/StyleSheet$CSSStyle.class b/libjava/classpath/lib/javax/swing/text/html/StyleSheet$CSSStyle.class
new file mode 100644
index 00000000000..790a40929cd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/StyleSheet$CSSStyle.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/StyleSheet$CSSStyleSheetParserCallback.class b/libjava/classpath/lib/javax/swing/text/html/StyleSheet$CSSStyleSheetParserCallback.class
new file mode 100644
index 00000000000..fdac1951550
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/StyleSheet$CSSStyleSheetParserCallback.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/StyleSheet$ListPainter.class b/libjava/classpath/lib/javax/swing/text/html/StyleSheet$ListPainter.class
new file mode 100644
index 00000000000..fa48de61f66
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/StyleSheet$ListPainter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/StyleSheet.class b/libjava/classpath/lib/javax/swing/text/html/StyleSheet.class
new file mode 100644
index 00000000000..10297ecac08
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/StyleSheet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/TableView$CellView.class b/libjava/classpath/lib/javax/swing/text/html/TableView$CellView.class
new file mode 100644
index 00000000000..13eb086dd27
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/TableView$CellView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/TableView$RowView.class b/libjava/classpath/lib/javax/swing/text/html/TableView$RowView.class
new file mode 100644
index 00000000000..b16dedc8ecc
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/TableView$RowView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/TableView.class b/libjava/classpath/lib/javax/swing/text/html/TableView.class
new file mode 100644
index 00000000000..0dfa3ef4b3f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/TableView.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/ViewAttributeSet.class b/libjava/classpath/lib/javax/swing/text/html/ViewAttributeSet.class
new file mode 100644
index 00000000000..9f6957ee6b3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/ViewAttributeSet.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/AttributeList$1.class b/libjava/classpath/lib/javax/swing/text/html/parser/AttributeList$1.class
new file mode 100644
index 00000000000..ad5c0718fc5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/AttributeList$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/AttributeList.class b/libjava/classpath/lib/javax/swing/text/html/parser/AttributeList.class
new file mode 100644
index 00000000000..20291190cf5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/AttributeList.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/ContentModel.class b/libjava/classpath/lib/javax/swing/text/html/parser/ContentModel.class
new file mode 100644
index 00000000000..599a5cf4070
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/ContentModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/DTD.class b/libjava/classpath/lib/javax/swing/text/html/parser/DTD.class
new file mode 100644
index 00000000000..a73805875b5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/DTD.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/DTDConstants.class b/libjava/classpath/lib/javax/swing/text/html/parser/DTDConstants.class
new file mode 100644
index 00000000000..8cf09fd9cad
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/DTDConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/DocumentParser$gnuParser.class b/libjava/classpath/lib/javax/swing/text/html/parser/DocumentParser$gnuParser.class
new file mode 100644
index 00000000000..92d8752193b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/DocumentParser$gnuParser.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/DocumentParser.class b/libjava/classpath/lib/javax/swing/text/html/parser/DocumentParser.class
new file mode 100644
index 00000000000..6a70fbd5315
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/DocumentParser.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/Element$1.class b/libjava/classpath/lib/javax/swing/text/html/parser/Element$1.class
new file mode 100644
index 00000000000..d3f745db417
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/Element$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/Element.class b/libjava/classpath/lib/javax/swing/text/html/parser/Element.class
new file mode 100644
index 00000000000..a068f251f6c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/Element.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/Entity$1.class b/libjava/classpath/lib/javax/swing/text/html/parser/Entity$1.class
new file mode 100644
index 00000000000..6eeb20c28ea
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/Entity$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/Entity.class b/libjava/classpath/lib/javax/swing/text/html/parser/Entity.class
new file mode 100644
index 00000000000..9c880cf76f6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/Entity.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/Parser$1.class b/libjava/classpath/lib/javax/swing/text/html/parser/Parser$1.class
new file mode 100644
index 00000000000..85e12baf8f9
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/Parser$1.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/Parser.class b/libjava/classpath/lib/javax/swing/text/html/parser/Parser.class
new file mode 100644
index 00000000000..724947dffe7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/Parser.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/ParserDelegator$gnuParser.class b/libjava/classpath/lib/javax/swing/text/html/parser/ParserDelegator$gnuParser.class
new file mode 100644
index 00000000000..004c1b2eefe
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/ParserDelegator$gnuParser.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/ParserDelegator.class b/libjava/classpath/lib/javax/swing/text/html/parser/ParserDelegator.class
new file mode 100644
index 00000000000..ab5aa696b32
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/ParserDelegator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/html/parser/TagElement.class b/libjava/classpath/lib/javax/swing/text/html/parser/TagElement.class
new file mode 100644
index 00000000000..68799b24b0f
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/html/parser/TagElement.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/rtf/ControlWordToken.class b/libjava/classpath/lib/javax/swing/text/rtf/ControlWordToken.class
new file mode 100644
index 00000000000..f6a4d24e091
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/rtf/ControlWordToken.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/rtf/RTFEditorKit.class b/libjava/classpath/lib/javax/swing/text/rtf/RTFEditorKit.class
new file mode 100644
index 00000000000..38637c8c306
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/rtf/RTFEditorKit.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/rtf/RTFParseException.class b/libjava/classpath/lib/javax/swing/text/rtf/RTFParseException.class
new file mode 100644
index 00000000000..94fb912eb68
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/rtf/RTFParseException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/rtf/RTFParser.class b/libjava/classpath/lib/javax/swing/text/rtf/RTFParser.class
new file mode 100644
index 00000000000..279e1e009af
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/rtf/RTFParser.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/rtf/RTFScanner.class b/libjava/classpath/lib/javax/swing/text/rtf/RTFScanner.class
new file mode 100644
index 00000000000..f109f547ec7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/rtf/RTFScanner.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/rtf/TextToken.class b/libjava/classpath/lib/javax/swing/text/rtf/TextToken.class
new file mode 100644
index 00000000000..a9de6ed97f5
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/rtf/TextToken.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/text/rtf/Token.class b/libjava/classpath/lib/javax/swing/text/rtf/Token.class
new file mode 100644
index 00000000000..4d06562fcc8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/text/rtf/Token.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/AbstractLayoutCache$NodeDimensions.class b/libjava/classpath/lib/javax/swing/tree/AbstractLayoutCache$NodeDimensions.class
new file mode 100644
index 00000000000..a0b4a990abd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/AbstractLayoutCache$NodeDimensions.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/AbstractLayoutCache.class b/libjava/classpath/lib/javax/swing/tree/AbstractLayoutCache.class
new file mode 100644
index 00000000000..f9028637232
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/AbstractLayoutCache.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode$BreadthFirstEnumeration.class b/libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode$BreadthFirstEnumeration.class
new file mode 100644
index 00000000000..d07fce4d2da
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode$BreadthFirstEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode$PostorderEnumeration.class b/libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode$PostorderEnumeration.class
new file mode 100644
index 00000000000..1d27efaf07c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode$PostorderEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode$PreorderEnumeration.class b/libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode$PreorderEnumeration.class
new file mode 100644
index 00000000000..08e011a3845
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode$PreorderEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode.class b/libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode.class
new file mode 100644
index 00000000000..77d649278f4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/DefaultMutableTreeNode.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/DefaultTreeCellEditor$DefaultTextField.class b/libjava/classpath/lib/javax/swing/tree/DefaultTreeCellEditor$DefaultTextField.class
new file mode 100644
index 00000000000..1acaf40d587
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/DefaultTreeCellEditor$DefaultTextField.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/DefaultTreeCellEditor$EditorContainer.class b/libjava/classpath/lib/javax/swing/tree/DefaultTreeCellEditor$EditorContainer.class
new file mode 100644
index 00000000000..d6d1d4d496d
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/DefaultTreeCellEditor$EditorContainer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/DefaultTreeCellEditor.class b/libjava/classpath/lib/javax/swing/tree/DefaultTreeCellEditor.class
new file mode 100644
index 00000000000..39c241a3e06
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/DefaultTreeCellEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/DefaultTreeCellRenderer.class b/libjava/classpath/lib/javax/swing/tree/DefaultTreeCellRenderer.class
new file mode 100644
index 00000000000..2bb65379580
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/DefaultTreeCellRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/DefaultTreeModel.class b/libjava/classpath/lib/javax/swing/tree/DefaultTreeModel.class
new file mode 100644
index 00000000000..5df4f0621d3
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/DefaultTreeModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/DefaultTreeSelectionModel$PathPlaceHolder.class b/libjava/classpath/lib/javax/swing/tree/DefaultTreeSelectionModel$PathPlaceHolder.class
new file mode 100644
index 00000000000..03813c3bda6
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/DefaultTreeSelectionModel$PathPlaceHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/DefaultTreeSelectionModel.class b/libjava/classpath/lib/javax/swing/tree/DefaultTreeSelectionModel.class
new file mode 100644
index 00000000000..e62123a128b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/DefaultTreeSelectionModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/ExpandVetoException.class b/libjava/classpath/lib/javax/swing/tree/ExpandVetoException.class
new file mode 100644
index 00000000000..7a6a886c846
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/ExpandVetoException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/FixedHeightLayoutCache$NodeRecord.class b/libjava/classpath/lib/javax/swing/tree/FixedHeightLayoutCache$NodeRecord.class
new file mode 100644
index 00000000000..cb3ea86b321
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/FixedHeightLayoutCache$NodeRecord.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/FixedHeightLayoutCache.class b/libjava/classpath/lib/javax/swing/tree/FixedHeightLayoutCache.class
new file mode 100644
index 00000000000..56ffb9a9990
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/FixedHeightLayoutCache.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/MutableTreeNode.class b/libjava/classpath/lib/javax/swing/tree/MutableTreeNode.class
new file mode 100644
index 00000000000..8bef869bba2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/MutableTreeNode.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/RowMapper.class b/libjava/classpath/lib/javax/swing/tree/RowMapper.class
new file mode 100644
index 00000000000..c5980b074d8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/RowMapper.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/TreeCellEditor.class b/libjava/classpath/lib/javax/swing/tree/TreeCellEditor.class
new file mode 100644
index 00000000000..2b597797085
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/TreeCellEditor.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/TreeCellRenderer.class b/libjava/classpath/lib/javax/swing/tree/TreeCellRenderer.class
new file mode 100644
index 00000000000..c321ddbc1e8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/TreeCellRenderer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/TreeModel.class b/libjava/classpath/lib/javax/swing/tree/TreeModel.class
new file mode 100644
index 00000000000..3c277b50ced
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/TreeModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/TreeNode.class b/libjava/classpath/lib/javax/swing/tree/TreeNode.class
new file mode 100644
index 00000000000..b7cc5f7407c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/TreeNode.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/TreePath.class b/libjava/classpath/lib/javax/swing/tree/TreePath.class
new file mode 100644
index 00000000000..ba99e3f7bd2
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/TreePath.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/TreeSelectionModel.class b/libjava/classpath/lib/javax/swing/tree/TreeSelectionModel.class
new file mode 100644
index 00000000000..7c0b606c8b4
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/TreeSelectionModel.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/VariableHeightLayoutCache$NodeRecord.class b/libjava/classpath/lib/javax/swing/tree/VariableHeightLayoutCache$NodeRecord.class
new file mode 100644
index 00000000000..1d95a1927dd
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/VariableHeightLayoutCache$NodeRecord.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/tree/VariableHeightLayoutCache.class b/libjava/classpath/lib/javax/swing/tree/VariableHeightLayoutCache.class
new file mode 100644
index 00000000000..dae7a864f1c
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/tree/VariableHeightLayoutCache.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/undo/AbstractUndoableEdit.class b/libjava/classpath/lib/javax/swing/undo/AbstractUndoableEdit.class
new file mode 100644
index 00000000000..ea96c60ff9a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/undo/AbstractUndoableEdit.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/undo/CannotRedoException.class b/libjava/classpath/lib/javax/swing/undo/CannotRedoException.class
new file mode 100644
index 00000000000..7ba3fd369b8
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/undo/CannotRedoException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/undo/CannotUndoException.class b/libjava/classpath/lib/javax/swing/undo/CannotUndoException.class
new file mode 100644
index 00000000000..dbcb3b52811
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/undo/CannotUndoException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/undo/CompoundEdit.class b/libjava/classpath/lib/javax/swing/undo/CompoundEdit.class
new file mode 100644
index 00000000000..c4f37b5a63a
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/undo/CompoundEdit.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/undo/StateEdit.class b/libjava/classpath/lib/javax/swing/undo/StateEdit.class
new file mode 100644
index 00000000000..9a5067181d7
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/undo/StateEdit.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/undo/StateEditable.class b/libjava/classpath/lib/javax/swing/undo/StateEditable.class
new file mode 100644
index 00000000000..fd5180f7de1
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/undo/StateEditable.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/undo/UndoManager.class b/libjava/classpath/lib/javax/swing/undo/UndoManager.class
new file mode 100644
index 00000000000..de96e03119b
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/undo/UndoManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/undo/UndoableEdit.class b/libjava/classpath/lib/javax/swing/undo/UndoableEdit.class
new file mode 100644
index 00000000000..0a469b738df
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/undo/UndoableEdit.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/swing/undo/UndoableEditSupport.class b/libjava/classpath/lib/javax/swing/undo/UndoableEditSupport.class
new file mode 100644
index 00000000000..494247e4249
--- /dev/null
+++ b/libjava/classpath/lib/javax/swing/undo/UndoableEditSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/HeuristicCommitException.class b/libjava/classpath/lib/javax/transaction/HeuristicCommitException.class
new file mode 100644
index 00000000000..e72dad5e052
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/HeuristicCommitException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/HeuristicMixedException.class b/libjava/classpath/lib/javax/transaction/HeuristicMixedException.class
new file mode 100644
index 00000000000..e8e0236cafa
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/HeuristicMixedException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/HeuristicRollbackException.class b/libjava/classpath/lib/javax/transaction/HeuristicRollbackException.class
new file mode 100644
index 00000000000..b0f5ecdb384
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/HeuristicRollbackException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/InvalidTransactionException.class b/libjava/classpath/lib/javax/transaction/InvalidTransactionException.class
new file mode 100644
index 00000000000..9143a2ebfd9
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/InvalidTransactionException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/NotSupportedException.class b/libjava/classpath/lib/javax/transaction/NotSupportedException.class
new file mode 100644
index 00000000000..f00d45b5da8
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/NotSupportedException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/RollbackException.class b/libjava/classpath/lib/javax/transaction/RollbackException.class
new file mode 100644
index 00000000000..71e854c1553
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/RollbackException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/Status.class b/libjava/classpath/lib/javax/transaction/Status.class
new file mode 100644
index 00000000000..320458e4d59
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/Status.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/Synchronization.class b/libjava/classpath/lib/javax/transaction/Synchronization.class
new file mode 100644
index 00000000000..bf49f29ba29
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/Synchronization.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/SystemException.class b/libjava/classpath/lib/javax/transaction/SystemException.class
new file mode 100644
index 00000000000..5a5241dcf09
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/SystemException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/Transaction.class b/libjava/classpath/lib/javax/transaction/Transaction.class
new file mode 100644
index 00000000000..3950b6f2bb8
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/Transaction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/TransactionManager.class b/libjava/classpath/lib/javax/transaction/TransactionManager.class
new file mode 100644
index 00000000000..851953b935d
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/TransactionManager.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/TransactionRequiredException.class b/libjava/classpath/lib/javax/transaction/TransactionRequiredException.class
new file mode 100644
index 00000000000..803fbf2c4ef
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/TransactionRequiredException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/TransactionRolledbackException.class b/libjava/classpath/lib/javax/transaction/TransactionRolledbackException.class
new file mode 100644
index 00000000000..96f5fbd04d2
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/TransactionRolledbackException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/UserTransaction.class b/libjava/classpath/lib/javax/transaction/UserTransaction.class
new file mode 100644
index 00000000000..c86e0b79cad
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/UserTransaction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/xa/XAException.class b/libjava/classpath/lib/javax/transaction/xa/XAException.class
new file mode 100644
index 00000000000..b029e4a49fe
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/xa/XAException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/xa/XAResource.class b/libjava/classpath/lib/javax/transaction/xa/XAResource.class
new file mode 100644
index 00000000000..89e80143ccd
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/xa/XAResource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/transaction/xa/Xid.class b/libjava/classpath/lib/javax/transaction/xa/Xid.class
new file mode 100644
index 00000000000..fbc1bb6efb7
--- /dev/null
+++ b/libjava/classpath/lib/javax/transaction/xa/Xid.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/XMLConstants.class b/libjava/classpath/lib/javax/xml/XMLConstants.class
new file mode 100644
index 00000000000..37a98b90d9c
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/XMLConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/datatype/DatatypeConfigurationException.class b/libjava/classpath/lib/javax/xml/datatype/DatatypeConfigurationException.class
new file mode 100644
index 00000000000..0d04b2e32fa
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/datatype/DatatypeConfigurationException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/datatype/DatatypeConstants$Field.class b/libjava/classpath/lib/javax/xml/datatype/DatatypeConstants$Field.class
new file mode 100644
index 00000000000..16608fbf6a5
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/datatype/DatatypeConstants$Field.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/datatype/DatatypeConstants.class b/libjava/classpath/lib/javax/xml/datatype/DatatypeConstants.class
new file mode 100644
index 00000000000..41c07b9a1ad
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/datatype/DatatypeConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/datatype/DatatypeFactory.class b/libjava/classpath/lib/javax/xml/datatype/DatatypeFactory.class
new file mode 100644
index 00000000000..00b5df1affb
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/datatype/DatatypeFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/datatype/Duration.class b/libjava/classpath/lib/javax/xml/datatype/Duration.class
new file mode 100644
index 00000000000..2e89ae6a979
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/datatype/Duration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/datatype/XMLGregorianCalendar.class b/libjava/classpath/lib/javax/xml/datatype/XMLGregorianCalendar.class
new file mode 100644
index 00000000000..acf9b9f05b7
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/datatype/XMLGregorianCalendar.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/namespace/NamespaceContext.class b/libjava/classpath/lib/javax/xml/namespace/NamespaceContext.class
new file mode 100644
index 00000000000..38ffeeec900
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/namespace/NamespaceContext.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/namespace/QName.class b/libjava/classpath/lib/javax/xml/namespace/QName.class
new file mode 100644
index 00000000000..c5f6eebc3cc
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/namespace/QName.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/parsers/DocumentBuilder.class b/libjava/classpath/lib/javax/xml/parsers/DocumentBuilder.class
new file mode 100644
index 00000000000..d2c08a7c395
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/parsers/DocumentBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/parsers/DocumentBuilderFactory.class b/libjava/classpath/lib/javax/xml/parsers/DocumentBuilderFactory.class
new file mode 100644
index 00000000000..79e8ac54944
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/parsers/DocumentBuilderFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/parsers/FactoryConfigurationError.class b/libjava/classpath/lib/javax/xml/parsers/FactoryConfigurationError.class
new file mode 100644
index 00000000000..3d5d62f3c3a
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/parsers/FactoryConfigurationError.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/parsers/ParserConfigurationException.class b/libjava/classpath/lib/javax/xml/parsers/ParserConfigurationException.class
new file mode 100644
index 00000000000..0c3635a4e05
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/parsers/ParserConfigurationException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/parsers/SAXParser.class b/libjava/classpath/lib/javax/xml/parsers/SAXParser.class
new file mode 100644
index 00000000000..4f6bd6993ff
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/parsers/SAXParser.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/parsers/SAXParserFactory.class b/libjava/classpath/lib/javax/xml/parsers/SAXParserFactory.class
new file mode 100644
index 00000000000..ae7d1d26eb2
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/parsers/SAXParserFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/EventFilter.class b/libjava/classpath/lib/javax/xml/stream/EventFilter.class
new file mode 100644
index 00000000000..4fb63d7eb4f
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/EventFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/FactoryConfigurationError.class b/libjava/classpath/lib/javax/xml/stream/FactoryConfigurationError.class
new file mode 100644
index 00000000000..3f466f1a946
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/FactoryConfigurationError.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/Location.class b/libjava/classpath/lib/javax/xml/stream/Location.class
new file mode 100644
index 00000000000..b58d446e6d3
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/Location.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/StreamFilter.class b/libjava/classpath/lib/javax/xml/stream/StreamFilter.class
new file mode 100644
index 00000000000..6f06644c2f6
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/StreamFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/XMLEventFactory.class b/libjava/classpath/lib/javax/xml/stream/XMLEventFactory.class
new file mode 100644
index 00000000000..3c4fbd41581
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/XMLEventFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/XMLEventReader.class b/libjava/classpath/lib/javax/xml/stream/XMLEventReader.class
new file mode 100644
index 00000000000..a9c00e15a10
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/XMLEventReader.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/XMLEventWriter.class b/libjava/classpath/lib/javax/xml/stream/XMLEventWriter.class
new file mode 100644
index 00000000000..52df63a094f
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/XMLEventWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/XMLInputFactory.class b/libjava/classpath/lib/javax/xml/stream/XMLInputFactory.class
new file mode 100644
index 00000000000..66894397c53
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/XMLInputFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/XMLOutputFactory.class b/libjava/classpath/lib/javax/xml/stream/XMLOutputFactory.class
new file mode 100644
index 00000000000..6917a3b48ab
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/XMLOutputFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/XMLReporter.class b/libjava/classpath/lib/javax/xml/stream/XMLReporter.class
new file mode 100644
index 00000000000..3aedebbd163
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/XMLReporter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/XMLResolver.class b/libjava/classpath/lib/javax/xml/stream/XMLResolver.class
new file mode 100644
index 00000000000..9c4430404e6
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/XMLResolver.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/XMLStreamConstants.class b/libjava/classpath/lib/javax/xml/stream/XMLStreamConstants.class
new file mode 100644
index 00000000000..d22089d1fd8
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/XMLStreamConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/XMLStreamException.class b/libjava/classpath/lib/javax/xml/stream/XMLStreamException.class
new file mode 100644
index 00000000000..2830950292d
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/XMLStreamException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/XMLStreamReader.class b/libjava/classpath/lib/javax/xml/stream/XMLStreamReader.class
new file mode 100644
index 00000000000..d859604faca
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/XMLStreamReader.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/XMLStreamWriter.class b/libjava/classpath/lib/javax/xml/stream/XMLStreamWriter.class
new file mode 100644
index 00000000000..ad0e75fb55b
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/XMLStreamWriter.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/events/Attribute.class b/libjava/classpath/lib/javax/xml/stream/events/Attribute.class
new file mode 100644
index 00000000000..58f2af2966a
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/events/Attribute.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/events/Characters.class b/libjava/classpath/lib/javax/xml/stream/events/Characters.class
new file mode 100644
index 00000000000..462083f1c21
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/events/Characters.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/events/Comment.class b/libjava/classpath/lib/javax/xml/stream/events/Comment.class
new file mode 100644
index 00000000000..923f1b15254
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/events/Comment.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/events/DTD.class b/libjava/classpath/lib/javax/xml/stream/events/DTD.class
new file mode 100644
index 00000000000..07b6954a904
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/events/DTD.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/events/EndDocument.class b/libjava/classpath/lib/javax/xml/stream/events/EndDocument.class
new file mode 100644
index 00000000000..d7a4aa3df7e
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/events/EndDocument.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/events/EndElement.class b/libjava/classpath/lib/javax/xml/stream/events/EndElement.class
new file mode 100644
index 00000000000..77dcd712dcb
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/events/EndElement.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/events/EntityDeclaration.class b/libjava/classpath/lib/javax/xml/stream/events/EntityDeclaration.class
new file mode 100644
index 00000000000..3df5bb2ee27
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/events/EntityDeclaration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/events/EntityReference.class b/libjava/classpath/lib/javax/xml/stream/events/EntityReference.class
new file mode 100644
index 00000000000..40776384bac
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/events/EntityReference.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/events/Namespace.class b/libjava/classpath/lib/javax/xml/stream/events/Namespace.class
new file mode 100644
index 00000000000..9871cf6c8a0
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/events/Namespace.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/events/NotationDeclaration.class b/libjava/classpath/lib/javax/xml/stream/events/NotationDeclaration.class
new file mode 100644
index 00000000000..a55800588aa
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/events/NotationDeclaration.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/events/ProcessingInstruction.class b/libjava/classpath/lib/javax/xml/stream/events/ProcessingInstruction.class
new file mode 100644
index 00000000000..4e89067fbfe
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/events/ProcessingInstruction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/events/StartDocument.class b/libjava/classpath/lib/javax/xml/stream/events/StartDocument.class
new file mode 100644
index 00000000000..a5001129113
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/events/StartDocument.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/events/StartElement.class b/libjava/classpath/lib/javax/xml/stream/events/StartElement.class
new file mode 100644
index 00000000000..4a97abaec67
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/events/StartElement.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/events/XMLEvent.class b/libjava/classpath/lib/javax/xml/stream/events/XMLEvent.class
new file mode 100644
index 00000000000..567cced337e
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/events/XMLEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/util/EventReaderDelegate.class b/libjava/classpath/lib/javax/xml/stream/util/EventReaderDelegate.class
new file mode 100644
index 00000000000..d308209e350
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/util/EventReaderDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/util/ReaderDelegate.class b/libjava/classpath/lib/javax/xml/stream/util/ReaderDelegate.class
new file mode 100644
index 00000000000..d8b79febcc4
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/util/ReaderDelegate.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/util/XMLEventAllocator.class b/libjava/classpath/lib/javax/xml/stream/util/XMLEventAllocator.class
new file mode 100644
index 00000000000..0e0b8988dcb
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/util/XMLEventAllocator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/stream/util/XMLEventConsumer.class b/libjava/classpath/lib/javax/xml/stream/util/XMLEventConsumer.class
new file mode 100644
index 00000000000..6457a0ac2f7
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/stream/util/XMLEventConsumer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/ErrorListener.class b/libjava/classpath/lib/javax/xml/transform/ErrorListener.class
new file mode 100644
index 00000000000..714ae34591e
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/ErrorListener.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/OutputKeys.class b/libjava/classpath/lib/javax/xml/transform/OutputKeys.class
new file mode 100644
index 00000000000..f6362257941
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/OutputKeys.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/Result.class b/libjava/classpath/lib/javax/xml/transform/Result.class
new file mode 100644
index 00000000000..a23f79eb6f0
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/Result.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/Source.class b/libjava/classpath/lib/javax/xml/transform/Source.class
new file mode 100644
index 00000000000..7bf553eb57a
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/Source.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/SourceLocator.class b/libjava/classpath/lib/javax/xml/transform/SourceLocator.class
new file mode 100644
index 00000000000..3e5f647817f
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/SourceLocator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/Templates.class b/libjava/classpath/lib/javax/xml/transform/Templates.class
new file mode 100644
index 00000000000..01737411b8e
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/Templates.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/Transformer.class b/libjava/classpath/lib/javax/xml/transform/Transformer.class
new file mode 100644
index 00000000000..1c1fd8cca84
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/Transformer.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/TransformerConfigurationException.class b/libjava/classpath/lib/javax/xml/transform/TransformerConfigurationException.class
new file mode 100644
index 00000000000..ee92b68b1d4
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/TransformerConfigurationException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/TransformerException.class b/libjava/classpath/lib/javax/xml/transform/TransformerException.class
new file mode 100644
index 00000000000..5429f7122db
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/TransformerException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/TransformerFactory.class b/libjava/classpath/lib/javax/xml/transform/TransformerFactory.class
new file mode 100644
index 00000000000..382869061c8
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/TransformerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/TransformerFactoryConfigurationError.class b/libjava/classpath/lib/javax/xml/transform/TransformerFactoryConfigurationError.class
new file mode 100644
index 00000000000..e59b7858fd4
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/TransformerFactoryConfigurationError.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/URIResolver.class b/libjava/classpath/lib/javax/xml/transform/URIResolver.class
new file mode 100644
index 00000000000..e3edfb13261
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/URIResolver.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/dom/DOMLocator.class b/libjava/classpath/lib/javax/xml/transform/dom/DOMLocator.class
new file mode 100644
index 00000000000..2ce1f41d511
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/dom/DOMLocator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/dom/DOMResult.class b/libjava/classpath/lib/javax/xml/transform/dom/DOMResult.class
new file mode 100644
index 00000000000..00a6e954c6a
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/dom/DOMResult.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/dom/DOMSource.class b/libjava/classpath/lib/javax/xml/transform/dom/DOMSource.class
new file mode 100644
index 00000000000..ac4ddc18f0f
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/dom/DOMSource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/sax/SAXResult.class b/libjava/classpath/lib/javax/xml/transform/sax/SAXResult.class
new file mode 100644
index 00000000000..c1df2826b6a
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/sax/SAXResult.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/sax/SAXSource.class b/libjava/classpath/lib/javax/xml/transform/sax/SAXSource.class
new file mode 100644
index 00000000000..2889f2e4b61
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/sax/SAXSource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/sax/SAXTransformerFactory.class b/libjava/classpath/lib/javax/xml/transform/sax/SAXTransformerFactory.class
new file mode 100644
index 00000000000..9a4b08f7d73
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/sax/SAXTransformerFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/sax/TemplatesHandler.class b/libjava/classpath/lib/javax/xml/transform/sax/TemplatesHandler.class
new file mode 100644
index 00000000000..50de551c522
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/sax/TemplatesHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/sax/TransformerHandler.class b/libjava/classpath/lib/javax/xml/transform/sax/TransformerHandler.class
new file mode 100644
index 00000000000..20c1fd5e1b0
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/sax/TransformerHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/stream/StreamResult.class b/libjava/classpath/lib/javax/xml/transform/stream/StreamResult.class
new file mode 100644
index 00000000000..ce4646c4882
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/stream/StreamResult.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/transform/stream/StreamSource.class b/libjava/classpath/lib/javax/xml/transform/stream/StreamSource.class
new file mode 100644
index 00000000000..9eda514eee8
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/transform/stream/StreamSource.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/validation/Schema.class b/libjava/classpath/lib/javax/xml/validation/Schema.class
new file mode 100644
index 00000000000..c9b0278089e
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/validation/Schema.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/validation/SchemaFactory.class b/libjava/classpath/lib/javax/xml/validation/SchemaFactory.class
new file mode 100644
index 00000000000..3e8f620773a
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/validation/SchemaFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/validation/SchemaFactoryLoader.class b/libjava/classpath/lib/javax/xml/validation/SchemaFactoryLoader.class
new file mode 100644
index 00000000000..6e360e4a922
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/validation/SchemaFactoryLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/validation/TypeInfoProvider.class b/libjava/classpath/lib/javax/xml/validation/TypeInfoProvider.class
new file mode 100644
index 00000000000..35932f4b09e
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/validation/TypeInfoProvider.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/validation/Validator.class b/libjava/classpath/lib/javax/xml/validation/Validator.class
new file mode 100644
index 00000000000..270ad037256
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/validation/Validator.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/validation/ValidatorHandler.class b/libjava/classpath/lib/javax/xml/validation/ValidatorHandler.class
new file mode 100644
index 00000000000..7784273b132
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/validation/ValidatorHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/xpath/XPath.class b/libjava/classpath/lib/javax/xml/xpath/XPath.class
new file mode 100644
index 00000000000..195cc03108b
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/xpath/XPath.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/xpath/XPathConstants.class b/libjava/classpath/lib/javax/xml/xpath/XPathConstants.class
new file mode 100644
index 00000000000..8421df32bce
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/xpath/XPathConstants.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/xpath/XPathException.class b/libjava/classpath/lib/javax/xml/xpath/XPathException.class
new file mode 100644
index 00000000000..69b86dd4a1a
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/xpath/XPathException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/xpath/XPathExpression.class b/libjava/classpath/lib/javax/xml/xpath/XPathExpression.class
new file mode 100644
index 00000000000..7693d7c6844
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/xpath/XPathExpression.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/xpath/XPathExpressionException.class b/libjava/classpath/lib/javax/xml/xpath/XPathExpressionException.class
new file mode 100644
index 00000000000..9417526f01a
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/xpath/XPathExpressionException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/xpath/XPathFactory.class b/libjava/classpath/lib/javax/xml/xpath/XPathFactory.class
new file mode 100644
index 00000000000..bcd8cf0dc20
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/xpath/XPathFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/xpath/XPathFactoryConfigurationException.class b/libjava/classpath/lib/javax/xml/xpath/XPathFactoryConfigurationException.class
new file mode 100644
index 00000000000..b8ea7044ccf
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/xpath/XPathFactoryConfigurationException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/xpath/XPathFunction.class b/libjava/classpath/lib/javax/xml/xpath/XPathFunction.class
new file mode 100644
index 00000000000..bb3c1bfcf25
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/xpath/XPathFunction.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/xpath/XPathFunctionException.class b/libjava/classpath/lib/javax/xml/xpath/XPathFunctionException.class
new file mode 100644
index 00000000000..1d910734fe4
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/xpath/XPathFunctionException.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/xpath/XPathFunctionResolver.class b/libjava/classpath/lib/javax/xml/xpath/XPathFunctionResolver.class
new file mode 100644
index 00000000000..9a2ca1782f7
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/xpath/XPathFunctionResolver.class
Binary files differ
diff --git a/libjava/classpath/lib/javax/xml/xpath/XPathVariableResolver.class b/libjava/classpath/lib/javax/xml/xpath/XPathVariableResolver.class
new file mode 100644
index 00000000000..783419cafda
--- /dev/null
+++ b/libjava/classpath/lib/javax/xml/xpath/XPathVariableResolver.class
Binary files differ
diff --git a/libjava/classpath/lib/jazzlib/index.html b/libjava/classpath/lib/jazzlib/index.html
new file mode 100644
index 00000000000..72ac81613b2
--- /dev/null
+++ b/libjava/classpath/lib/jazzlib/index.html
@@ -0,0 +1,47 @@
+<html>
+<head>
+<title>A pure java implementation of java.util.zip library</title>
+</head>
+<body>
+<h1>A pure java implementation of the java.util.zip library</h1>
+
+This project provides an implementation of the java.util.zip classes.
+<br><br>
+The code is pure java (no native code is used), and we aim to be compatible with existing java.util.zip implementations. Some code was borrowed from libgcj, almost all the rest was written by Jochen Hoenicke.
+<br><br>
+There is very similar project at <a href="http://www.jcraft.com/jzlib/index.html">http://www.jcraft.com/jzlib/index.html</a>.<br>
+Another project to implement bzip2 is at <a href="http://www.aftexsw.com/aftex/products/java/bzip/">http://www.aftexsw.com/aftex/products/java/bzip/</a>.
+<p>
+For the latest source, see the classpath CVS repository. On this page you'll find source and binary releases of the code in both the <strong>net.sf.jazzlib</strong> and <strong>java.util.zip</strong> namespaces.
+<p>
+The <strong>net.sf.jazzlib</strong> namespace is useful for situations where native code isn't allowed (such as in applets) and you need to use zip files. Builds in the <strong>java.util.zip</strong> namespace have a -juz suffix.
+<br>
+<h3>License</h3>
+This code is released under the GPL license with a special exception:
+<pre>
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License.
+</pre>
+<h3>Latest release is 0.07</h3>
+Download source or binary packages for all releases <a href="http://sourceforge.net/project/showfiles.php?group_id=16807">here</a>.
+<p>
+There is a md5sums file in each release that you can use to check the integrity of the files. The md5sums is also signed with my public key (finger jewel at debian.org), the signature is in md5sums.asc.
+<p>
+<h3>Contact information and bug notification</h3>
+You should post a message to the jazzlib-developers list (<a href="http://lists.sourceforge.net/mailman/listinfo/jazzlib-developers">subscribe</a>, <a href="http://sourceforge.net/mailarchive/forum.php?forum=jazzlib-developers">archives</a>) to report a bug or contact the developers.
+
+<br>
+The <a href="http://savannah.gnu.org/cvs/?group_id=85">CVS repository</a> for this project is part of the <a href="http://www.gnu.org/software/classpath/">classpath</a> project.
+<p>
+The files in the SourceForge CVS repository should be considered to be of historical interest only.
+<p>
+John Leuner (jewel at pixie.co.za) <br>
+13 May 2004
+
+<hr>
+<A href="http://sourceforge.net"> <IMG src="http://sourceforge.net/sflogo.php?group_id=16807" width="88" height="31" border="0" alt="SourceForge Logo"></A>
+</body>
+</html> \ No newline at end of file
diff --git a/libjava/classpath/lib/jazzlib/makeJazzlibDist.sh b/libjava/classpath/lib/jazzlib/makeJazzlibDist.sh
new file mode 100755
index 00000000000..5c75960a2ab
--- /dev/null
+++ b/libjava/classpath/lib/jazzlib/makeJazzlibDist.sh
@@ -0,0 +1,121 @@
+#!/bin/zsh
+
+echo "----- Run this from the classpath/java/util/zip directory -----"
+echo "----- -----"
+echo "----- Options: -----"
+echo "----- -----"
+echo "----- juz -- build .tar.gz and .zip archives in java.util.zip namespace"
+echo "----- jar -- build .jar file in java.util.zip and java.util.jar namespaces"
+echo "----- -- build .tar.gz. and .zip archive for net.sf.jazzlib namespace"
+echo "----- -----"
+echo "----- Edit this script to change the release number -----"
+echo "----- Do rm -rf dist when you're finished -----"
+echo "----- 30 May 2002 John Leuner <jewel@debian.org> -----"
+
+RELEASE_NUMBER=07
+
+# $1 is the archive command, eg "tar czvf" or "zip" or "jar cf"
+# $2 is the archive suffix, eg ".zip" or ".tar.gz"
+# $3 is the "-binary" flag, which may be empty
+# $4 is the "-juz" suffix, which may be empty
+# $5 is the set of files that need to be md5-summed
+# $6 is the set of files in addition to $5 that are to be archived
+
+function create_archive {
+ md5sum ${=5} > md5sums
+ gpg --clearsign md5sums
+ ${=1} jazzlib${3}-0.$RELEASE_NUMBER${4}${2} ${=5} ${=6}
+ rm -f md5sums
+ rm -f md5sums.asc
+}
+
+# $1 is the package name, ie java.util.zip or net.sf.jazzlib
+
+function make_javadoc {
+ rm -rf javadoc
+ mkdir javadoc
+ javadoc -sourcepath . -d javadoc/ $1
+}
+
+case "$1" in
+ juz)
+ mkdir -p dist/java/util/zip
+
+ #make source archive
+ cp *.java dist/java/util/zip
+ pushd dist
+
+ make_javadoc java.util.zip
+
+ cp ../../../../COPYING .
+
+ foo=(java/util/zip/*.java)
+ create_archive "tar czvf" ".tar.gz" "" "-juz" "$foo" "javadoc md5sums md5sums.asc COPYING"
+ create_archive "zip" ".zip" "" "-juz" "$foo" "javadoc md5sums md5sums.asc COPYING"
+
+ popd
+
+ #make binary distro second
+ cp ../../../lib/java/util/zip/*.class dist/java/util/zip
+ pushd dist
+
+ foo=(java/util/zip/*.class)
+ create_archive "tar czvf" ".tar.gz" "-binary" "-juz" "$foo" "javadoc md5sums md5sums.asc COPYING"
+ create_archive "zip" ".zip" "-binary" "-juz" "$foo" "javadoc md5sums md5sums.asc COPYING"
+
+ popd
+ ;;
+ jar)
+ mkdir -p dist/java/util/zip
+ mkdir -p dist/java/util/jar
+
+ #make binary distro second
+ cp ../../../lib/java/util/zip/*.class dist/java/util/zip
+ cp ../../../lib/java/util/zip/../jar/*.class dist/java/util/jar
+ pushd dist
+
+ cp ../../../../COPYING .
+ foo=(java/util/zip/*.class)
+ foo=($foo java/util/jar/*.class)
+
+ create_archive "fastjar cf" ".jar" "-binary" "-juz" "$foo" "md5sums md5sums.asc COPYING"
+
+ popd
+ ;;
+ *)
+ #copy files to dist directory and make net.sf.jazzlib the package name
+
+ mkdir -p dist/net/sf/jazzlib
+ cp *.java dist/net/sf/jazzlib
+ for i in dist/net/sf/jazzlib/*.java ; do
+ sed -e "s/java\.util\.zip/net.sf.jazzlib/" < $i > $i.tmp ;
+ mv $i.tmp $i;
+ done
+
+ pushd dist
+
+ make_javadoc "net.sf.jazzlib"
+
+ cp ../../../../COPYING .
+
+ foo=(net/sf/jazzlib/*.java)
+ create_archive "tar czvf" ".tar.gz" "" "" "$foo" "javadoc md5sums md5sums.asc COPYING"
+ create_archive "zip" ".zip" "" "" "$foo" "javadoc md5sums md5sums.asc COPYING"
+
+ #compile the source
+ javac net/sf/jazzlib/*.java
+
+ foo=(net/sf/jazzlib/*.class)
+ create_archive "tar czvf" ".tar.gz" "-binary" "" "$foo" "javadoc md5sums md5sums.asc COPYING"
+ create_archive "zip" ".zip" "-binary" "" "$foo" "javadoc md5sums md5sums.asc COPYING"
+
+ #back to dir
+ popd
+
+ ;;
+esac
+ls -la dist/{*.tar.gz,*.jar,*.zip}
+
+
+
+
diff --git a/libjava/classpath/lib/mkdep.pl.in b/libjava/classpath/lib/mkdep.pl.in
new file mode 100755
index 00000000000..b30fd7ae974
--- /dev/null
+++ b/libjava/classpath/lib/mkdep.pl.in
@@ -0,0 +1,336 @@
+#!@PERL@
+#
+# Create a dependency file for use with make that will
+# a) not have duplicate entries
+# b) not include the source of a file as a dependency to separate file,
+# just the class of the file
+# c) use jikes .u files
+# d) includes classes which need native compilation via simple parsing
+# to find native methods requiring use of javah
+
+use strict;
+
+my ( $dir, $dep ) = "";
+my @dirs = ( 'java', 'javax', 'gnu' );
+my ( $depout ) = "makefile.dep";
+my ( $classout ) = "classes.dep";
+my ( $headerout ) = "headers.dep";
+my ( $javaout ) = "java.dep";
+my @deps = ();
+my @natives = ();
+use vars qw ( $classout $headerout @dirs @deps @natives $dir $dep $depout );
+
+# main
+{
+ if ($#ARGV == 0)
+ {
+ if ($ARGV[0] =~ /^-h/)
+ {
+ findNativeFiles();
+ writeNativeFile();
+ }
+ elsif ($ARGV[0] =~ /^-d/)
+ {
+ foreach $dir (@dirs)
+ {
+ # find all .u files recursively and parse'm
+ findDepFiles($dir);
+ }
+ writeDepFile();
+ }
+ elsif ($ARGV[0] =~ /^-c/)
+ {
+ findClassFiles();
+ writeClassFile();
+ }
+ elsif ($ARGV[0] =~ /^-j/)
+ {
+ findJavaFiles();
+ writeJavaFile();
+ }
+ }
+ else
+ {
+ print "Usage:\n";
+ print "mkdep.pl -h \tfor header files\n";
+ print "mkdep.pl -c \tfor a list of classes\n";
+ print "mkdep.pl -j \tfor a list of java files\n";
+ print "mkdep.pl -d \tfor dependency generation from jikes .u files\n";
+ }
+}
+
+sub writeNativeFile
+{
+ my ($i, $j, $k, $l) = "";
+ my $top_srcdir = "../";
+ if (defined $ENV{'top_srcdir'}) {
+ $top_srcdir = $ENV{'top_srcdir'};
+ }
+ my $top_srcdir_regex = $top_srcdir;
+ if ($top_srcdir_regex !~ /.*\/$/) {
+ $top_srcdir_regex .= '/';
+ }
+ $top_srcdir_regex =~ s/\./\\\./g; # replace . with \.
+ $top_srcdir_regex =~ s/\//\\\//g; # replace / with \/
+# print "regex is $top_srcdir_regex\n";
+ open(MAKEDEP, ">$headerout") || die "Could not open file ", $headerout;
+
+ # the HEADERS = ... stuff
+ if ($#natives > -1)
+ {
+ print MAKEDEP "CP_HEADERS = \\", "\n";
+ foreach $i (0 .. $#natives-1)
+ {
+ $j = $natives[$i];
+ $j =~ s/^$top_srcdir_regex//; # remove ../ or similar
+ $j =~ s/^(\.\.\/)+//g; # remove all preceding ../
+ $j =~ s/^vm\/reference\///; # remove vm/reference/
+ $j =~ s/\//_/g; # replace / with _
+ $j =~ s/\.java$/\.h/; # replace .java with .h
+ print MAKEDEP " \$(top_builddir)/include/", $j, " \\", "\n";
+ }
+ $j = $natives[$#natives];
+ $j =~ s/^$top_srcdir_regex//; # remove ../
+ $j =~ s/^(\.\.\/)+//g; # remove all preceding ../
+ $j =~ s/^vm\/reference\///; # remove vm/reference/
+ $j =~ s/\//_/g; # replace / with _
+ $j =~ s/\.java/\.h/; # replace .java with .h
+ print MAKEDEP " \$(top_builddir)/include/", $j, "\n\n";
+
+ # print rules to make .h files
+ # y/x.h : z/x.class
+ # y/x.h : ../z/x.java
+ # javah -jni z.x
+ # mv y_x.h $(top_srcdir)/include
+
+ # j = y/x.h
+ # k = z/x.class
+ # k = ../z/x.java
+ # l = z.x
+ foreach $i (0 .. $#natives-1)
+ {
+ $j = $natives[$i];
+ $j =~ s/^$top_srcdir_regex//; # remove ../
+ $j =~ s/^(\.\.\/)+//g; # remove all preceding ../
+ $j =~ s/^vm\/reference\///; # remove vm/reference/
+# $k = $l = $j;
+ $l = $j;
+ $j =~ s/\//_/g; # replace / with _
+ $j =~ s/\.java$/\.h/; # replace .java with .h
+
+ $k = $natives[$i]; # the original .java file
+# $k =~ s/\.java$/\.class/; # replace .java with .class
+
+ $l =~ s/\.java$//; # remove .class
+ $l =~ s/\//\./g; # replace / with .
+
+ print MAKEDEP "\$(top_builddir)/include/", $j, " : ", $k, "\n";
+ print MAKEDEP "\t\$(JAVAH) ", $l, "\n";
+ print MAKEDEP "\tmv ", $j, " \$(top_builddir)/include\n\n";
+ }
+ $j = $natives[$#natives];
+ $j =~ s/^$top_srcdir_regex//; # remove ../
+ $j =~ s/^(\.\.\/)+//g; # remove all preceding ../
+ $j =~ s/^vm\/reference\///; # remove vm/reference/
+# $k = $l = $j;
+ $l = $j;
+ $j =~ s/\//_/g; # replace / with _
+ $j =~ s/\.java/\.h/; # replace .java with .h
+
+ $k = $natives[$#natives]; # the original .java file
+# $k =~ s/\.java$/\.class/; # replace .java with .class
+
+ $l =~ s/\.java$//; # remove .class
+ $l =~ s/\//\./g; # replace / with .
+
+ print MAKEDEP "\$(top_builddir)/include/", $j, " : ", $k, "\n";
+ print MAKEDEP "\t\$(JAVAH) ", $l, "\n";
+ print MAKEDEP "\tmv ", $j, " \$(top_builddir)/include\n\n";
+ }
+ close(MAKEDEP);
+}
+
+sub writeJavaFile
+{
+ my ($i, $j, $class, $depend, $source, $depend_source) = "";
+
+ open(MAKEDEP, ">$javaout") || die "Could not open file ", $classout;
+
+ # the JAVA_SRCS = ... stuff
+ if ($#natives > -1)
+ {
+ print MAKEDEP "JAVA_SRCS = \\", "\n";
+ foreach $i (0 .. $#natives-1)
+ {
+ $j = $natives[$i];
+ print MAKEDEP " ", $j, " \\", "\n";
+ }
+ $j = $natives[$#natives];
+ print MAKEDEP " ", $j, "\n\n";
+ }
+ close(MAKEDEP);
+}
+
+sub writeClassFile
+{
+ my ($i, $j, $class, $depend, $source, $depend_source) = "";
+
+ open(MAKEDEP, ">$classout") || die "Could not open file ", $classout;
+
+ # the CLASSES = ... stuff
+ if ($#natives > -1)
+ {
+ print MAKEDEP "CLASSES = \\", "\n";
+ foreach $i (0 .. $#natives-1)
+ {
+ $j = $natives[$i];
+ $j =~ s/\.java$/\.class/;
+ print MAKEDEP " ", $j, " \\", "\n";
+ }
+ $j = $natives[$#natives];
+ $j =~ s/\.java$/\.class/;
+ print MAKEDEP " ", $j, "\n\n";
+ }
+ close(MAKEDEP);
+}
+
+sub writeDepFile
+{
+ my ($i, $j, $class, $depend, $source, $depend_source) = "";
+
+ open(MAKEDEP, ">$depout") || die "Could not open file ", $depout;
+
+ # the class dependencies
+ foreach $i (@deps)
+ {
+ open(FILE, "<$i") || die "Could not open file ", $i, "\n";
+ while(<FILE>)
+ {
+ chop;
+ ($class, $depend) = /(.+) : (.+)$/;
+ $source = $class;
+ $source =~ s/\.class$/\.java/;
+ if (($source eq $depend) || ($depend !~ /\.java$/))
+ {
+ if ($depend =~ /^\.\.\/.+\.class$/)
+ {
+ $depend =~ s/^\.\.\///;
+ }
+ if (($depend =~ /\.java$/) && ($depend !~ /^\.\.\//))
+ {
+ $depend = "../" . $depend;
+ }
+ print MAKEDEP $class, " : ", $depend, "\n";
+ }
+ }
+ print MAKEDEP "\n";
+ close(FILE);
+ }
+ close(MAKEDEP);
+}
+
+sub findJavaFiles
+{
+ my ($file) = "";
+ open(CLASSES, "<classes") || die "Could not open file classes\n";
+ while(<CLASSES>)
+ {
+ chop;
+ $file = $_;
+ push @natives, $file;
+ }
+ close(CLASSES);
+}
+
+sub findClassFiles
+{
+ my ($file) = "";
+ open(CLASSES, "<classes") || die "Could not open file classes\n";
+ while(<CLASSES>)
+ {
+ chop;
+ $file = $_;
+ $file =~ s/^\.\.\///;
+ push @natives, $file;
+ }
+ close(CLASSES);
+}
+
+sub findNativeFiles
+{
+ my ($file) = "";
+ open(CLASSES, "<classes") || die "Could not open file classes\n";
+ while(<CLASSES>)
+ {
+ chop;
+ $file = $_;
+ if (hasNativeMethod($file))
+ {
+ push @natives, $file;
+ }
+
+ }
+ close(CLASSES);
+}
+
+sub hasNativeMethod
+{
+ my ($file) = @_;
+ my ($line, $one, $two) = "";
+ open(FILE, "<$file") || die "Could not open file ", $file, "\n";
+ while(<FILE>)
+ {
+ chop;
+ $one = $two;
+ $two = $_;
+
+ $line = $one . " " . $two;
+ if ( ($line =~ /^\s*public\s.*native\s+\S+\s+\S+\s*\(/) ||
+ ($line =~ /^\s*public\s.*native\s+\S+\s+\S+\s+\S+\s*\(/) ||
+ ($line =~ /^\s*protected\s.*native\s+\S+\s+\S+\s*\(/) ||
+ ($line =~ /^\s*protected\s.*native\s+\S+\s+\S+\s+\S+\s*\(/) ||
+ ($line =~ /^\s*private\s.*native\s+\S+\s+\S+\s*\(/) ||
+ ($line =~ /^\s*private\s.*native\s+\S+\s+\S+\s+\S+\s*\(/) ||
+ ($line =~ /^\s*abstract\s.*native\s+\S+\s+\S+\s*\(/) ||
+ ($line =~ /^\s*final\s.*native\s+\S+\s+\S+\s*\(/) ||
+ ($line =~ /^\s*synchronized\s.*native\s+\S+\s+\S+\s*\(/) ||
+ ($line =~ /^\s*native\s.*/) )
+ {
+ close(FILE);
+ return 1;
+ }
+ }
+ close(FILE);
+ return 0;
+}
+
+sub findDepFiles
+{
+
+ my ($dir) = @_;
+ my (@dirs) = ();
+ my (@local_deps) = ();
+ my (@entries) = ();
+ my ($i, $local_dep) = "";
+ if (opendir(DIR, $dir))
+ {
+ @entries = grep(-d "$dir/$_" && !/^\.\.?$/, readdir(DIR));
+ foreach $i (@entries)
+ {
+ push @dirs, "$dir/$i";
+ }
+ rewinddir(DIR);
+ @entries= grep(/\.u$/, readdir(DIR));
+ closedir(DIR);
+ foreach $i (@entries)
+ {
+ push @local_deps, "$dir/$i";
+ }
+ push @deps, @local_deps;
+ foreach $i (@dirs)
+ {
+ findDepFiles($i);
+ }
+ }
+}
+
diff --git a/libjava/classpath/lib/org/ietf/jgss/ChannelBinding.class b/libjava/classpath/lib/org/ietf/jgss/ChannelBinding.class
new file mode 100644
index 00000000000..75f6b026918
--- /dev/null
+++ b/libjava/classpath/lib/org/ietf/jgss/ChannelBinding.class
Binary files differ
diff --git a/libjava/classpath/lib/org/ietf/jgss/GSSContext.class b/libjava/classpath/lib/org/ietf/jgss/GSSContext.class
new file mode 100644
index 00000000000..9781403010f
--- /dev/null
+++ b/libjava/classpath/lib/org/ietf/jgss/GSSContext.class
Binary files differ
diff --git a/libjava/classpath/lib/org/ietf/jgss/GSSCredential.class b/libjava/classpath/lib/org/ietf/jgss/GSSCredential.class
new file mode 100644
index 00000000000..f25e090786e
--- /dev/null
+++ b/libjava/classpath/lib/org/ietf/jgss/GSSCredential.class
Binary files differ
diff --git a/libjava/classpath/lib/org/ietf/jgss/GSSException.class b/libjava/classpath/lib/org/ietf/jgss/GSSException.class
new file mode 100644
index 00000000000..15b83a9c11e
--- /dev/null
+++ b/libjava/classpath/lib/org/ietf/jgss/GSSException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/ietf/jgss/GSSManager.class b/libjava/classpath/lib/org/ietf/jgss/GSSManager.class
new file mode 100644
index 00000000000..a30da157dbe
--- /dev/null
+++ b/libjava/classpath/lib/org/ietf/jgss/GSSManager.class
Binary files differ
diff --git a/libjava/classpath/lib/org/ietf/jgss/GSSName.class b/libjava/classpath/lib/org/ietf/jgss/GSSName.class
new file mode 100644
index 00000000000..7cfbc570fb4
--- /dev/null
+++ b/libjava/classpath/lib/org/ietf/jgss/GSSName.class
Binary files differ
diff --git a/libjava/classpath/lib/org/ietf/jgss/MessageProp.class b/libjava/classpath/lib/org/ietf/jgss/MessageProp.class
new file mode 100644
index 00000000000..b6db46cc1ae
--- /dev/null
+++ b/libjava/classpath/lib/org/ietf/jgss/MessageProp.class
Binary files differ
diff --git a/libjava/classpath/lib/org/ietf/jgss/Oid.class b/libjava/classpath/lib/org/ietf/jgss/Oid.class
new file mode 100644
index 00000000000..a9202919bc9
--- /dev/null
+++ b/libjava/classpath/lib/org/ietf/jgss/Oid.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ACTIVITY_COMPLETED.class b/libjava/classpath/lib/org/omg/CORBA/ACTIVITY_COMPLETED.class
new file mode 100644
index 00000000000..6273c48d946
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ACTIVITY_COMPLETED.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ACTIVITY_REQUIRED.class b/libjava/classpath/lib/org/omg/CORBA/ACTIVITY_REQUIRED.class
new file mode 100644
index 00000000000..56d40116c7c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ACTIVITY_REQUIRED.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ARG_IN.class b/libjava/classpath/lib/org/omg/CORBA/ARG_IN.class
new file mode 100644
index 00000000000..81eb85f17fe
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ARG_IN.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ARG_INOUT.class b/libjava/classpath/lib/org/omg/CORBA/ARG_INOUT.class
new file mode 100644
index 00000000000..e7824369210
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ARG_INOUT.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ARG_OUT.class b/libjava/classpath/lib/org/omg/CORBA/ARG_OUT.class
new file mode 100644
index 00000000000..32feb6b4e95
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ARG_OUT.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/Any.class b/libjava/classpath/lib/org/omg/CORBA/Any.class
new file mode 100644
index 00000000000..241d9037cde
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/Any.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/AnyHolder.class b/libjava/classpath/lib/org/omg/CORBA/AnyHolder.class
new file mode 100644
index 00000000000..6280babb6cc
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/AnyHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/AnySeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/AnySeqHelper.class
new file mode 100644
index 00000000000..6e86ff43e8b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/AnySeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/AnySeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/AnySeqHolder.class
new file mode 100644
index 00000000000..ad1716813d7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/AnySeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/BAD_CONTEXT.class b/libjava/classpath/lib/org/omg/CORBA/BAD_CONTEXT.class
new file mode 100644
index 00000000000..36940158e93
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/BAD_CONTEXT.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/BAD_INV_ORDER.class b/libjava/classpath/lib/org/omg/CORBA/BAD_INV_ORDER.class
new file mode 100644
index 00000000000..29af5229e28
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/BAD_INV_ORDER.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/BAD_OPERATION.class b/libjava/classpath/lib/org/omg/CORBA/BAD_OPERATION.class
new file mode 100644
index 00000000000..59d5e89b700
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/BAD_OPERATION.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/BAD_PARAM.class b/libjava/classpath/lib/org/omg/CORBA/BAD_PARAM.class
new file mode 100644
index 00000000000..fe6319d7220
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/BAD_PARAM.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/BAD_POLICY.class b/libjava/classpath/lib/org/omg/CORBA/BAD_POLICY.class
new file mode 100644
index 00000000000..683492ca5e5
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/BAD_POLICY.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/BAD_POLICY_TYPE.class b/libjava/classpath/lib/org/omg/CORBA/BAD_POLICY_TYPE.class
new file mode 100644
index 00000000000..aef3c3c78dd
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/BAD_POLICY_TYPE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/BAD_POLICY_VALUE.class b/libjava/classpath/lib/org/omg/CORBA/BAD_POLICY_VALUE.class
new file mode 100644
index 00000000000..b796febb361
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/BAD_POLICY_VALUE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/BAD_QOS.class b/libjava/classpath/lib/org/omg/CORBA/BAD_QOS.class
new file mode 100644
index 00000000000..733126a4e22
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/BAD_QOS.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/BAD_TYPECODE.class b/libjava/classpath/lib/org/omg/CORBA/BAD_TYPECODE.class
new file mode 100644
index 00000000000..ea7dc21e8e5
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/BAD_TYPECODE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/BooleanHolder.class b/libjava/classpath/lib/org/omg/CORBA/BooleanHolder.class
new file mode 100644
index 00000000000..c02b7bd9753
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/BooleanHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/BooleanSeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/BooleanSeqHelper.class
new file mode 100644
index 00000000000..9bbafe13a44
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/BooleanSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/BooleanSeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/BooleanSeqHolder.class
new file mode 100644
index 00000000000..894048b4782
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/BooleanSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/Bounds.class b/libjava/classpath/lib/org/omg/CORBA/Bounds.class
new file mode 100644
index 00000000000..d3fddac0caf
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/Bounds.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ByteHolder.class b/libjava/classpath/lib/org/omg/CORBA/ByteHolder.class
new file mode 100644
index 00000000000..ec454370631
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ByteHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/CODESET_INCOMPATIBLE.class b/libjava/classpath/lib/org/omg/CORBA/CODESET_INCOMPATIBLE.class
new file mode 100644
index 00000000000..4c8429fc9f3
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/CODESET_INCOMPATIBLE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/COMM_FAILURE.class b/libjava/classpath/lib/org/omg/CORBA/COMM_FAILURE.class
new file mode 100644
index 00000000000..b290135f469
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/COMM_FAILURE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/CTX_RESTRICT_SCOPE.class b/libjava/classpath/lib/org/omg/CORBA/CTX_RESTRICT_SCOPE.class
new file mode 100644
index 00000000000..279f1c31ed6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/CTX_RESTRICT_SCOPE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/CharHolder.class b/libjava/classpath/lib/org/omg/CORBA/CharHolder.class
new file mode 100644
index 00000000000..c24adb8cac8
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/CharHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/CharSeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/CharSeqHelper.class
new file mode 100644
index 00000000000..bdeee597f2a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/CharSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/CharSeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/CharSeqHolder.class
new file mode 100644
index 00000000000..308a92667f9
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/CharSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/CompletionStatus.class b/libjava/classpath/lib/org/omg/CORBA/CompletionStatus.class
new file mode 100644
index 00000000000..1ff0902f75d
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/CompletionStatus.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/CompletionStatusHelper.class b/libjava/classpath/lib/org/omg/CORBA/CompletionStatusHelper.class
new file mode 100644
index 00000000000..dc612821244
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/CompletionStatusHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/Context.class b/libjava/classpath/lib/org/omg/CORBA/Context.class
new file mode 100644
index 00000000000..6ceb2a9dd26
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/Context.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ContextList.class b/libjava/classpath/lib/org/omg/CORBA/ContextList.class
new file mode 100644
index 00000000000..7aa694f06af
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ContextList.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/Current.class b/libjava/classpath/lib/org/omg/CORBA/Current.class
new file mode 100644
index 00000000000..59062f75d15
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/Current.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/CurrentHelper$_CurrentStub.class b/libjava/classpath/lib/org/omg/CORBA/CurrentHelper$_CurrentStub.class
new file mode 100644
index 00000000000..6a24ac2351e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/CurrentHelper$_CurrentStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/CurrentHelper.class b/libjava/classpath/lib/org/omg/CORBA/CurrentHelper.class
new file mode 100644
index 00000000000..b08abfc7a7e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/CurrentHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/CurrentHolder.class b/libjava/classpath/lib/org/omg/CORBA/CurrentHolder.class
new file mode 100644
index 00000000000..04b399deb89
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/CurrentHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/CurrentOperations.class b/libjava/classpath/lib/org/omg/CORBA/CurrentOperations.class
new file mode 100644
index 00000000000..d9c71534320
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/CurrentOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/CustomMarshal.class b/libjava/classpath/lib/org/omg/CORBA/CustomMarshal.class
new file mode 100644
index 00000000000..c8ccce25d49
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/CustomMarshal.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/CustomValue.class b/libjava/classpath/lib/org/omg/CORBA/CustomValue.class
new file mode 100644
index 00000000000..7e775ec43ff
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/CustomValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DATA_CONVERSION.class b/libjava/classpath/lib/org/omg/CORBA/DATA_CONVERSION.class
new file mode 100644
index 00000000000..9f3cbe2eb16
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DATA_CONVERSION.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DataInputStream.class b/libjava/classpath/lib/org/omg/CORBA/DataInputStream.class
new file mode 100644
index 00000000000..7d5e2716678
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DataInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DataOutputStream.class b/libjava/classpath/lib/org/omg/CORBA/DataOutputStream.class
new file mode 100644
index 00000000000..f685386b9df
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DataOutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DefinitionKind.class b/libjava/classpath/lib/org/omg/CORBA/DefinitionKind.class
new file mode 100644
index 00000000000..59cc3b23006
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DefinitionKind.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DefinitionKindHelper.class b/libjava/classpath/lib/org/omg/CORBA/DefinitionKindHelper.class
new file mode 100644
index 00000000000..4f7cc619f31
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DefinitionKindHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DomainManager.class b/libjava/classpath/lib/org/omg/CORBA/DomainManager.class
new file mode 100644
index 00000000000..3fd23b98a0e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DomainManager.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DomainManagerOperations.class b/libjava/classpath/lib/org/omg/CORBA/DomainManagerOperations.class
new file mode 100644
index 00000000000..a605b00d883
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DomainManagerOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DoubleHolder.class b/libjava/classpath/lib/org/omg/CORBA/DoubleHolder.class
new file mode 100644
index 00000000000..38bfcf152b7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DoubleHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DoubleSeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/DoubleSeqHelper.class
new file mode 100644
index 00000000000..3d6509ae921
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DoubleSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DoubleSeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/DoubleSeqHolder.class
new file mode 100644
index 00000000000..adfa0dd621a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DoubleSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DynAny.class b/libjava/classpath/lib/org/omg/CORBA/DynAny.class
new file mode 100644
index 00000000000..aec6c140456
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DynAny.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/Invalid.class b/libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/Invalid.class
new file mode 100644
index 00000000000..21c81153234
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/Invalid.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/InvalidSeq.class b/libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/InvalidSeq.class
new file mode 100644
index 00000000000..60ca4c45088
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/InvalidSeq.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/InvalidValue.class b/libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/InvalidValue.class
new file mode 100644
index 00000000000..877b4e14db2
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/InvalidValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/TypeMismatch.class b/libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/TypeMismatch.class
new file mode 100644
index 00000000000..e704f658422
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DynAnyPackage/TypeMismatch.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DynArray.class b/libjava/classpath/lib/org/omg/CORBA/DynArray.class
new file mode 100644
index 00000000000..6ed14fbb095
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DynArray.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DynEnum.class b/libjava/classpath/lib/org/omg/CORBA/DynEnum.class
new file mode 100644
index 00000000000..fc31a3ece1d
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DynEnum.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DynFixed.class b/libjava/classpath/lib/org/omg/CORBA/DynFixed.class
new file mode 100644
index 00000000000..4e07360689c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DynFixed.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DynSequence.class b/libjava/classpath/lib/org/omg/CORBA/DynSequence.class
new file mode 100644
index 00000000000..9f78322ef00
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DynSequence.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DynStruct.class b/libjava/classpath/lib/org/omg/CORBA/DynStruct.class
new file mode 100644
index 00000000000..db555c38b6b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DynStruct.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DynUnion.class b/libjava/classpath/lib/org/omg/CORBA/DynUnion.class
new file mode 100644
index 00000000000..0d7705f6658
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DynUnion.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DynValue.class b/libjava/classpath/lib/org/omg/CORBA/DynValue.class
new file mode 100644
index 00000000000..b88d8c9b4e2
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DynValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/DynamicImplementation.class b/libjava/classpath/lib/org/omg/CORBA/DynamicImplementation.class
new file mode 100644
index 00000000000..fa2902535ac
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/DynamicImplementation.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/Environment.class b/libjava/classpath/lib/org/omg/CORBA/Environment.class
new file mode 100644
index 00000000000..e9a2c4fe597
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/Environment.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ExceptionList.class b/libjava/classpath/lib/org/omg/CORBA/ExceptionList.class
new file mode 100644
index 00000000000..11175909a62
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ExceptionList.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/FREE_MEM.class b/libjava/classpath/lib/org/omg/CORBA/FREE_MEM.class
new file mode 100644
index 00000000000..f8238569b1f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/FREE_MEM.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/FieldNameHelper.class b/libjava/classpath/lib/org/omg/CORBA/FieldNameHelper.class
new file mode 100644
index 00000000000..3d6c77446a0
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/FieldNameHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/FixedHolder.class b/libjava/classpath/lib/org/omg/CORBA/FixedHolder.class
new file mode 100644
index 00000000000..b06aad6c32c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/FixedHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/FloatHolder.class b/libjava/classpath/lib/org/omg/CORBA/FloatHolder.class
new file mode 100644
index 00000000000..6eb06bc47d5
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/FloatHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/FloatSeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/FloatSeqHelper.class
new file mode 100644
index 00000000000..396ed94414e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/FloatSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/FloatSeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/FloatSeqHolder.class
new file mode 100644
index 00000000000..35f1612f120
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/FloatSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/IDLType.class b/libjava/classpath/lib/org/omg/CORBA/IDLType.class
new file mode 100644
index 00000000000..8c5ed030e18
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/IDLType.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/IDLTypeHelper.class b/libjava/classpath/lib/org/omg/CORBA/IDLTypeHelper.class
new file mode 100644
index 00000000000..0fc9e7d1305
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/IDLTypeHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/IDLTypeOperations.class b/libjava/classpath/lib/org/omg/CORBA/IDLTypeOperations.class
new file mode 100644
index 00000000000..64d8b18900a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/IDLTypeOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/IMP_LIMIT.class b/libjava/classpath/lib/org/omg/CORBA/IMP_LIMIT.class
new file mode 100644
index 00000000000..0194e473882
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/IMP_LIMIT.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/INITIALIZE.class b/libjava/classpath/lib/org/omg/CORBA/INITIALIZE.class
new file mode 100644
index 00000000000..156ba25006d
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/INITIALIZE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/INTERNAL.class b/libjava/classpath/lib/org/omg/CORBA/INTERNAL.class
new file mode 100644
index 00000000000..bb0867fc0d1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/INTERNAL.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/INTF_REPOS.class b/libjava/classpath/lib/org/omg/CORBA/INTF_REPOS.class
new file mode 100644
index 00000000000..404572b2f36
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/INTF_REPOS.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/INVALID_ACTIVITY.class b/libjava/classpath/lib/org/omg/CORBA/INVALID_ACTIVITY.class
new file mode 100644
index 00000000000..7b6b898433a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/INVALID_ACTIVITY.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/INVALID_TRANSACTION.class b/libjava/classpath/lib/org/omg/CORBA/INVALID_TRANSACTION.class
new file mode 100644
index 00000000000..5f61141d4b1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/INVALID_TRANSACTION.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/INV_FLAG.class b/libjava/classpath/lib/org/omg/CORBA/INV_FLAG.class
new file mode 100644
index 00000000000..04a21b792d7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/INV_FLAG.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/INV_IDENT.class b/libjava/classpath/lib/org/omg/CORBA/INV_IDENT.class
new file mode 100644
index 00000000000..97b0dbbe0e9
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/INV_IDENT.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/INV_OBJREF.class b/libjava/classpath/lib/org/omg/CORBA/INV_OBJREF.class
new file mode 100644
index 00000000000..4132a243d37
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/INV_OBJREF.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/INV_POLICY.class b/libjava/classpath/lib/org/omg/CORBA/INV_POLICY.class
new file mode 100644
index 00000000000..82ea67b358d
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/INV_POLICY.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/IRObject.class b/libjava/classpath/lib/org/omg/CORBA/IRObject.class
new file mode 100644
index 00000000000..7f43483982d
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/IRObject.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/IRObjectOperations.class b/libjava/classpath/lib/org/omg/CORBA/IRObjectOperations.class
new file mode 100644
index 00000000000..5b2554c5bc9
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/IRObjectOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/IdentifierHelper.class b/libjava/classpath/lib/org/omg/CORBA/IdentifierHelper.class
new file mode 100644
index 00000000000..17ba7e2fecf
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/IdentifierHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/IntHolder.class b/libjava/classpath/lib/org/omg/CORBA/IntHolder.class
new file mode 100644
index 00000000000..775f9947967
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/IntHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/LocalObject.class b/libjava/classpath/lib/org/omg/CORBA/LocalObject.class
new file mode 100644
index 00000000000..f666fb8fc32
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/LocalObject.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/LongHolder.class b/libjava/classpath/lib/org/omg/CORBA/LongHolder.class
new file mode 100644
index 00000000000..1620deacb60
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/LongHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/LongLongSeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/LongLongSeqHelper.class
new file mode 100644
index 00000000000..3cef2568d0c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/LongLongSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/LongLongSeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/LongLongSeqHolder.class
new file mode 100644
index 00000000000..b086be5c6a3
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/LongLongSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/LongSeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/LongSeqHelper.class
new file mode 100644
index 00000000000..adbc98874b0
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/LongSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/LongSeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/LongSeqHolder.class
new file mode 100644
index 00000000000..c599b9bbfac
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/LongSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/MARSHAL.class b/libjava/classpath/lib/org/omg/CORBA/MARSHAL.class
new file mode 100644
index 00000000000..90b1b6119ca
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/MARSHAL.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/NO_IMPLEMENT.class b/libjava/classpath/lib/org/omg/CORBA/NO_IMPLEMENT.class
new file mode 100644
index 00000000000..75de0f307e6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/NO_IMPLEMENT.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/NO_MEMORY.class b/libjava/classpath/lib/org/omg/CORBA/NO_MEMORY.class
new file mode 100644
index 00000000000..5ab11c43740
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/NO_MEMORY.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/NO_PERMISSION.class b/libjava/classpath/lib/org/omg/CORBA/NO_PERMISSION.class
new file mode 100644
index 00000000000..c094264d35e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/NO_PERMISSION.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/NO_RESOURCES.class b/libjava/classpath/lib/org/omg/CORBA/NO_RESOURCES.class
new file mode 100644
index 00000000000..b3160694b8a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/NO_RESOURCES.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/NO_RESPONSE.class b/libjava/classpath/lib/org/omg/CORBA/NO_RESPONSE.class
new file mode 100644
index 00000000000..db37168d746
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/NO_RESPONSE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/NVList.class b/libjava/classpath/lib/org/omg/CORBA/NVList.class
new file mode 100644
index 00000000000..98268674730
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/NVList.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/NameValuePair.class b/libjava/classpath/lib/org/omg/CORBA/NameValuePair.class
new file mode 100644
index 00000000000..1b9aeb7a4fa
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/NameValuePair.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/NameValuePairHelper.class b/libjava/classpath/lib/org/omg/CORBA/NameValuePairHelper.class
new file mode 100644
index 00000000000..e286a1f360c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/NameValuePairHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/NamedValue.class b/libjava/classpath/lib/org/omg/CORBA/NamedValue.class
new file mode 100644
index 00000000000..eb23677914a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/NamedValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/OBJECT_NOT_EXIST.class b/libjava/classpath/lib/org/omg/CORBA/OBJECT_NOT_EXIST.class
new file mode 100644
index 00000000000..607b364f7ff
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/OBJECT_NOT_EXIST.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/OBJ_ADAPTER.class b/libjava/classpath/lib/org/omg/CORBA/OBJ_ADAPTER.class
new file mode 100644
index 00000000000..5f8c0a5947b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/OBJ_ADAPTER.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/OMGVMCID.class b/libjava/classpath/lib/org/omg/CORBA/OMGVMCID.class
new file mode 100644
index 00000000000..fe0fc4196b7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/OMGVMCID.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ORB.class b/libjava/classpath/lib/org/omg/CORBA/ORB.class
new file mode 100644
index 00000000000..4dfd8539189
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ORB.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ORBPackage/InconsistentTypeCode.class b/libjava/classpath/lib/org/omg/CORBA/ORBPackage/InconsistentTypeCode.class
new file mode 100644
index 00000000000..737416bc7f6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ORBPackage/InconsistentTypeCode.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ORBPackage/InvalidName.class b/libjava/classpath/lib/org/omg/CORBA/ORBPackage/InvalidName.class
new file mode 100644
index 00000000000..5f37a2c7e74
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ORBPackage/InvalidName.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/Object.class b/libjava/classpath/lib/org/omg/CORBA/Object.class
new file mode 100644
index 00000000000..dd1a6cf6d93
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/Object.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ObjectHelper.class b/libjava/classpath/lib/org/omg/CORBA/ObjectHelper.class
new file mode 100644
index 00000000000..b288d39071a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ObjectHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ObjectHolder.class b/libjava/classpath/lib/org/omg/CORBA/ObjectHolder.class
new file mode 100644
index 00000000000..7ae35d266b8
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ObjectHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/OctetSeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/OctetSeqHelper.class
new file mode 100644
index 00000000000..92c230905c2
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/OctetSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/OctetSeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/OctetSeqHolder.class
new file mode 100644
index 00000000000..40e881b0555
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/OctetSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/PERSIST_STORE.class b/libjava/classpath/lib/org/omg/CORBA/PERSIST_STORE.class
new file mode 100644
index 00000000000..e1c3bcdbc5b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/PERSIST_STORE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/PRIVATE_MEMBER.class b/libjava/classpath/lib/org/omg/CORBA/PRIVATE_MEMBER.class
new file mode 100644
index 00000000000..85b6c53030a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/PRIVATE_MEMBER.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/PUBLIC_MEMBER.class b/libjava/classpath/lib/org/omg/CORBA/PUBLIC_MEMBER.class
new file mode 100644
index 00000000000..fa240e5a8f1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/PUBLIC_MEMBER.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ParameterMode.class b/libjava/classpath/lib/org/omg/CORBA/ParameterMode.class
new file mode 100644
index 00000000000..e287d827552
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ParameterMode.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ParameterModeHelper.class b/libjava/classpath/lib/org/omg/CORBA/ParameterModeHelper.class
new file mode 100644
index 00000000000..cc64f658952
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ParameterModeHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ParameterModeHolder.class b/libjava/classpath/lib/org/omg/CORBA/ParameterModeHolder.class
new file mode 100644
index 00000000000..07b0e3b3050
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ParameterModeHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/Policy.class b/libjava/classpath/lib/org/omg/CORBA/Policy.class
new file mode 100644
index 00000000000..1f9eaa7fdfb
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/Policy.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/PolicyError.class b/libjava/classpath/lib/org/omg/CORBA/PolicyError.class
new file mode 100644
index 00000000000..23dd44b513f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/PolicyError.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/PolicyErrorCodeHelper.class b/libjava/classpath/lib/org/omg/CORBA/PolicyErrorCodeHelper.class
new file mode 100644
index 00000000000..08c11441329
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/PolicyErrorCodeHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/PolicyErrorHelper.class b/libjava/classpath/lib/org/omg/CORBA/PolicyErrorHelper.class
new file mode 100644
index 00000000000..f92d197722a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/PolicyErrorHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/PolicyErrorHolder.class b/libjava/classpath/lib/org/omg/CORBA/PolicyErrorHolder.class
new file mode 100644
index 00000000000..d4b90f3f2af
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/PolicyErrorHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/PolicyHelper.class b/libjava/classpath/lib/org/omg/CORBA/PolicyHelper.class
new file mode 100644
index 00000000000..25393cdb4db
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/PolicyHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/PolicyHolder.class b/libjava/classpath/lib/org/omg/CORBA/PolicyHolder.class
new file mode 100644
index 00000000000..9bcec0e27bb
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/PolicyHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/PolicyListHelper.class b/libjava/classpath/lib/org/omg/CORBA/PolicyListHelper.class
new file mode 100644
index 00000000000..d86ee5c83e7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/PolicyListHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/PolicyListHolder.class b/libjava/classpath/lib/org/omg/CORBA/PolicyListHolder.class
new file mode 100644
index 00000000000..684d1b430a3
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/PolicyListHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/PolicyOperations.class b/libjava/classpath/lib/org/omg/CORBA/PolicyOperations.class
new file mode 100644
index 00000000000..a843bfdf950
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/PolicyOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/PolicyTypeHelper.class b/libjava/classpath/lib/org/omg/CORBA/PolicyTypeHelper.class
new file mode 100644
index 00000000000..005457b1560
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/PolicyTypeHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/Principal.class b/libjava/classpath/lib/org/omg/CORBA/Principal.class
new file mode 100644
index 00000000000..af77c83aefe
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/Principal.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/PrincipalHolder.class b/libjava/classpath/lib/org/omg/CORBA/PrincipalHolder.class
new file mode 100644
index 00000000000..253b7e1f706
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/PrincipalHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/REBIND.class b/libjava/classpath/lib/org/omg/CORBA/REBIND.class
new file mode 100644
index 00000000000..96b5717614f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/REBIND.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/RepositoryIdHelper.class b/libjava/classpath/lib/org/omg/CORBA/RepositoryIdHelper.class
new file mode 100644
index 00000000000..62dc935d93e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/RepositoryIdHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/Request.class b/libjava/classpath/lib/org/omg/CORBA/Request.class
new file mode 100644
index 00000000000..fe550783922
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/Request.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ServerRequest.class b/libjava/classpath/lib/org/omg/CORBA/ServerRequest.class
new file mode 100644
index 00000000000..62a4b47b485
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ServerRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ServiceDetail.class b/libjava/classpath/lib/org/omg/CORBA/ServiceDetail.class
new file mode 100644
index 00000000000..fc239d3ce12
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ServiceDetail.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ServiceDetailHelper.class b/libjava/classpath/lib/org/omg/CORBA/ServiceDetailHelper.class
new file mode 100644
index 00000000000..75358eb949e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ServiceDetailHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ServiceInformation.class b/libjava/classpath/lib/org/omg/CORBA/ServiceInformation.class
new file mode 100644
index 00000000000..ce2d5376a1f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ServiceInformation.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ServiceInformationHelper.class b/libjava/classpath/lib/org/omg/CORBA/ServiceInformationHelper.class
new file mode 100644
index 00000000000..bfaf1196889
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ServiceInformationHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ServiceInformationHolder.class b/libjava/classpath/lib/org/omg/CORBA/ServiceInformationHolder.class
new file mode 100644
index 00000000000..1c7d2d241a2
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ServiceInformationHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/SetOverrideType.class b/libjava/classpath/lib/org/omg/CORBA/SetOverrideType.class
new file mode 100644
index 00000000000..bc56a6f95a8
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/SetOverrideType.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/SetOverrideTypeHelper.class b/libjava/classpath/lib/org/omg/CORBA/SetOverrideTypeHelper.class
new file mode 100644
index 00000000000..b043621ebb6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/SetOverrideTypeHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ShortHolder.class b/libjava/classpath/lib/org/omg/CORBA/ShortHolder.class
new file mode 100644
index 00000000000..c8fd60130d9
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ShortHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ShortSeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/ShortSeqHelper.class
new file mode 100644
index 00000000000..02fce8f1028
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ShortSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ShortSeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/ShortSeqHolder.class
new file mode 100644
index 00000000000..47d73c5b3e8
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ShortSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/StringHolder.class b/libjava/classpath/lib/org/omg/CORBA/StringHolder.class
new file mode 100644
index 00000000000..18ba01a6154
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/StringHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/StringSeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/StringSeqHelper.class
new file mode 100644
index 00000000000..416407b552c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/StringSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/StringSeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/StringSeqHolder.class
new file mode 100644
index 00000000000..5c89f8ec2c0
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/StringSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/StringValueHelper.class b/libjava/classpath/lib/org/omg/CORBA/StringValueHelper.class
new file mode 100644
index 00000000000..9912113e8cf
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/StringValueHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/StructMember.class b/libjava/classpath/lib/org/omg/CORBA/StructMember.class
new file mode 100644
index 00000000000..3d77b2a2c4d
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/StructMember.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/StructMemberHelper.class b/libjava/classpath/lib/org/omg/CORBA/StructMemberHelper.class
new file mode 100644
index 00000000000..5c5a0e2c7bd
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/StructMemberHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/SystemException.class b/libjava/classpath/lib/org/omg/CORBA/SystemException.class
new file mode 100644
index 00000000000..940f7991325
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/SystemException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/TCKind.class b/libjava/classpath/lib/org/omg/CORBA/TCKind.class
new file mode 100644
index 00000000000..0cdaf690431
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/TCKind.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/TIMEOUT.class b/libjava/classpath/lib/org/omg/CORBA/TIMEOUT.class
new file mode 100644
index 00000000000..bd13b9fa526
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/TIMEOUT.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/TRANSACTION_MODE.class b/libjava/classpath/lib/org/omg/CORBA/TRANSACTION_MODE.class
new file mode 100644
index 00000000000..3e80be97c88
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/TRANSACTION_MODE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/TRANSACTION_REQUIRED.class b/libjava/classpath/lib/org/omg/CORBA/TRANSACTION_REQUIRED.class
new file mode 100644
index 00000000000..41c83de81a7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/TRANSACTION_REQUIRED.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/TRANSACTION_ROLLEDBACK.class b/libjava/classpath/lib/org/omg/CORBA/TRANSACTION_ROLLEDBACK.class
new file mode 100644
index 00000000000..005c4c262bf
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/TRANSACTION_ROLLEDBACK.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/TRANSACTION_UNAVAILABLE.class b/libjava/classpath/lib/org/omg/CORBA/TRANSACTION_UNAVAILABLE.class
new file mode 100644
index 00000000000..35c4ac1c6ea
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/TRANSACTION_UNAVAILABLE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/TRANSIENT.class b/libjava/classpath/lib/org/omg/CORBA/TRANSIENT.class
new file mode 100644
index 00000000000..e6e2c933c27
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/TRANSIENT.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/TypeCode.class b/libjava/classpath/lib/org/omg/CORBA/TypeCode.class
new file mode 100644
index 00000000000..a226a13c580
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/TypeCode.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/TypeCodeHolder.class b/libjava/classpath/lib/org/omg/CORBA/TypeCodeHolder.class
new file mode 100644
index 00000000000..eec7eb74029
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/TypeCodeHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/TypeCodePackage/BadKind.class b/libjava/classpath/lib/org/omg/CORBA/TypeCodePackage/BadKind.class
new file mode 100644
index 00000000000..1cb6527aa16
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/TypeCodePackage/BadKind.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/TypeCodePackage/Bounds.class b/libjava/classpath/lib/org/omg/CORBA/TypeCodePackage/Bounds.class
new file mode 100644
index 00000000000..c24c5125210
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/TypeCodePackage/Bounds.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ULongLongSeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/ULongLongSeqHelper.class
new file mode 100644
index 00000000000..e48ca17d626
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ULongLongSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ULongLongSeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/ULongLongSeqHolder.class
new file mode 100644
index 00000000000..3e9759fb91e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ULongLongSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ULongSeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/ULongSeqHelper.class
new file mode 100644
index 00000000000..055547ad555
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ULongSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ULongSeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/ULongSeqHolder.class
new file mode 100644
index 00000000000..de8c0a3b6b5
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ULongSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/UNKNOWN.class b/libjava/classpath/lib/org/omg/CORBA/UNKNOWN.class
new file mode 100644
index 00000000000..1a67fcbe4e7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/UNKNOWN.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/UNSUPPORTED_POLICY.class b/libjava/classpath/lib/org/omg/CORBA/UNSUPPORTED_POLICY.class
new file mode 100644
index 00000000000..165aec3b785
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/UNSUPPORTED_POLICY.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.class b/libjava/classpath/lib/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.class
new file mode 100644
index 00000000000..77991d4cf18
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/UShortSeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/UShortSeqHelper.class
new file mode 100644
index 00000000000..462900f9b60
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/UShortSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/UShortSeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/UShortSeqHolder.class
new file mode 100644
index 00000000000..a134da240e6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/UShortSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/UnionMember.class b/libjava/classpath/lib/org/omg/CORBA/UnionMember.class
new file mode 100644
index 00000000000..7d83156b793
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/UnionMember.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/UnionMemberHelper.class b/libjava/classpath/lib/org/omg/CORBA/UnionMemberHelper.class
new file mode 100644
index 00000000000..d696e43bcba
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/UnionMemberHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/UnknownUserException.class b/libjava/classpath/lib/org/omg/CORBA/UnknownUserException.class
new file mode 100644
index 00000000000..f4b6615d6f8
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/UnknownUserException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/UnknownUserExceptionHelper.class b/libjava/classpath/lib/org/omg/CORBA/UnknownUserExceptionHelper.class
new file mode 100644
index 00000000000..04fd69a47fc
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/UnknownUserExceptionHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/UnknownUserExceptionHolder.class b/libjava/classpath/lib/org/omg/CORBA/UnknownUserExceptionHolder.class
new file mode 100644
index 00000000000..0c7bcb87506
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/UnknownUserExceptionHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/UserException.class b/libjava/classpath/lib/org/omg/CORBA/UserException.class
new file mode 100644
index 00000000000..ed8baba4407
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/UserException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/VM_ABSTRACT.class b/libjava/classpath/lib/org/omg/CORBA/VM_ABSTRACT.class
new file mode 100644
index 00000000000..28cc567c331
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/VM_ABSTRACT.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/VM_CUSTOM.class b/libjava/classpath/lib/org/omg/CORBA/VM_CUSTOM.class
new file mode 100644
index 00000000000..fe8503c4ad1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/VM_CUSTOM.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/VM_NONE.class b/libjava/classpath/lib/org/omg/CORBA/VM_NONE.class
new file mode 100644
index 00000000000..3793c8251f8
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/VM_NONE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/VM_TRUNCATABLE.class b/libjava/classpath/lib/org/omg/CORBA/VM_TRUNCATABLE.class
new file mode 100644
index 00000000000..c17ba788056
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/VM_TRUNCATABLE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ValueBaseHelper.class b/libjava/classpath/lib/org/omg/CORBA/ValueBaseHelper.class
new file mode 100644
index 00000000000..5e72f38c939
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ValueBaseHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ValueBaseHolder.class b/libjava/classpath/lib/org/omg/CORBA/ValueBaseHolder.class
new file mode 100644
index 00000000000..7976f5e3e88
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ValueBaseHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ValueMember.class b/libjava/classpath/lib/org/omg/CORBA/ValueMember.class
new file mode 100644
index 00000000000..c317aaafbd8
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ValueMember.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/ValueMemberHelper.class b/libjava/classpath/lib/org/omg/CORBA/ValueMemberHelper.class
new file mode 100644
index 00000000000..6dd4e17aa03
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/ValueMemberHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/VersionSpecHelper.class b/libjava/classpath/lib/org/omg/CORBA/VersionSpecHelper.class
new file mode 100644
index 00000000000..9718810626b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/VersionSpecHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/VisibilityHelper.class b/libjava/classpath/lib/org/omg/CORBA/VisibilityHelper.class
new file mode 100644
index 00000000000..5f9b920ab04
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/VisibilityHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/WCharSeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/WCharSeqHelper.class
new file mode 100644
index 00000000000..42dd65a9b97
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/WCharSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/WCharSeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/WCharSeqHolder.class
new file mode 100644
index 00000000000..4b2fa2f452b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/WCharSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/WStringSeqHelper.class b/libjava/classpath/lib/org/omg/CORBA/WStringSeqHelper.class
new file mode 100644
index 00000000000..434cf45029f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/WStringSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/WStringSeqHolder.class b/libjava/classpath/lib/org/omg/CORBA/WStringSeqHolder.class
new file mode 100644
index 00000000000..db4be911e9d
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/WStringSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/WStringValueHelper.class b/libjava/classpath/lib/org/omg/CORBA/WStringValueHelper.class
new file mode 100644
index 00000000000..6141425c7f6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/WStringValueHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/WrongTransaction.class b/libjava/classpath/lib/org/omg/CORBA/WrongTransaction.class
new file mode 100644
index 00000000000..8bf2b631be4
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/WrongTransaction.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/WrongTransactionHelper.class b/libjava/classpath/lib/org/omg/CORBA/WrongTransactionHelper.class
new file mode 100644
index 00000000000..9c8fd658086
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/WrongTransactionHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/WrongTransactionHolder.class b/libjava/classpath/lib/org/omg/CORBA/WrongTransactionHolder.class
new file mode 100644
index 00000000000..fa842cf547e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/WrongTransactionHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/_IDLTypeStub.class b/libjava/classpath/lib/org/omg/CORBA/_IDLTypeStub.class
new file mode 100644
index 00000000000..1089845a36e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/_IDLTypeStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/_PolicyStub.class b/libjava/classpath/lib/org/omg/CORBA/_PolicyStub.class
new file mode 100644
index 00000000000..5e9267a9fd6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/_PolicyStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/ApplicationException.class b/libjava/classpath/lib/org/omg/CORBA/portable/ApplicationException.class
new file mode 100644
index 00000000000..528ebbb2a15
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/ApplicationException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/BoxedValueHelper.class b/libjava/classpath/lib/org/omg/CORBA/portable/BoxedValueHelper.class
new file mode 100644
index 00000000000..43ea1b1d0c1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/BoxedValueHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/CustomValue.class b/libjava/classpath/lib/org/omg/CORBA/portable/CustomValue.class
new file mode 100644
index 00000000000..a06f1dfb473
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/CustomValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/Delegate.class b/libjava/classpath/lib/org/omg/CORBA/portable/Delegate.class
new file mode 100644
index 00000000000..d4900bef027
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/Delegate.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/IDLEntity.class b/libjava/classpath/lib/org/omg/CORBA/portable/IDLEntity.class
new file mode 100644
index 00000000000..c4f232e3a26
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/IDLEntity.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/IndirectionException.class b/libjava/classpath/lib/org/omg/CORBA/portable/IndirectionException.class
new file mode 100644
index 00000000000..3e94ecc0796
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/IndirectionException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/InputStream.class b/libjava/classpath/lib/org/omg/CORBA/portable/InputStream.class
new file mode 100644
index 00000000000..a60458485e8
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/InputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/InvokeHandler.class b/libjava/classpath/lib/org/omg/CORBA/portable/InvokeHandler.class
new file mode 100644
index 00000000000..4ba4c20fe4f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/InvokeHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/ObjectImpl.class b/libjava/classpath/lib/org/omg/CORBA/portable/ObjectImpl.class
new file mode 100644
index 00000000000..3c4203072c4
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/ObjectImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/OutputStream.class b/libjava/classpath/lib/org/omg/CORBA/portable/OutputStream.class
new file mode 100644
index 00000000000..6c8a629b4ee
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/OutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/RemarshalException.class b/libjava/classpath/lib/org/omg/CORBA/portable/RemarshalException.class
new file mode 100644
index 00000000000..36d24fa1d73
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/RemarshalException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/ResponseHandler.class b/libjava/classpath/lib/org/omg/CORBA/portable/ResponseHandler.class
new file mode 100644
index 00000000000..9d4456bde52
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/ResponseHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/ServantObject.class b/libjava/classpath/lib/org/omg/CORBA/portable/ServantObject.class
new file mode 100644
index 00000000000..79efe34094d
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/ServantObject.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/Streamable.class b/libjava/classpath/lib/org/omg/CORBA/portable/Streamable.class
new file mode 100644
index 00000000000..4a965ae21ec
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/Streamable.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/StreamableValue.class b/libjava/classpath/lib/org/omg/CORBA/portable/StreamableValue.class
new file mode 100644
index 00000000000..aac801248d2
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/StreamableValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/UnknownException.class b/libjava/classpath/lib/org/omg/CORBA/portable/UnknownException.class
new file mode 100644
index 00000000000..7d1451f060c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/UnknownException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/ValueBase.class b/libjava/classpath/lib/org/omg/CORBA/portable/ValueBase.class
new file mode 100644
index 00000000000..18a59c5ade0
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/ValueBase.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA/portable/ValueFactory.class b/libjava/classpath/lib/org/omg/CORBA/portable/ValueFactory.class
new file mode 100644
index 00000000000..ca077674d49
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA/portable/ValueFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA_2_3/ORB.class b/libjava/classpath/lib/org/omg/CORBA_2_3/ORB.class
new file mode 100644
index 00000000000..fea1383b731
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA_2_3/ORB.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA_2_3/portable/Delegate.class b/libjava/classpath/lib/org/omg/CORBA_2_3/portable/Delegate.class
new file mode 100644
index 00000000000..b3f57ec556c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA_2_3/portable/Delegate.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA_2_3/portable/InputStream.class b/libjava/classpath/lib/org/omg/CORBA_2_3/portable/InputStream.class
new file mode 100644
index 00000000000..707fdbe5f3b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA_2_3/portable/InputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA_2_3/portable/ObjectImpl.class b/libjava/classpath/lib/org/omg/CORBA_2_3/portable/ObjectImpl.class
new file mode 100644
index 00000000000..ef1fb4b4ec5
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA_2_3/portable/ObjectImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CORBA_2_3/portable/OutputStream.class b/libjava/classpath/lib/org/omg/CORBA_2_3/portable/OutputStream.class
new file mode 100644
index 00000000000..7dd148569c1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CORBA_2_3/portable/OutputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/Binding.class b/libjava/classpath/lib/org/omg/CosNaming/Binding.class
new file mode 100644
index 00000000000..d70850fe8bf
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/Binding.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/BindingHelper.class b/libjava/classpath/lib/org/omg/CosNaming/BindingHelper.class
new file mode 100644
index 00000000000..4638acc1cea
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/BindingHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/BindingHolder.class b/libjava/classpath/lib/org/omg/CosNaming/BindingHolder.class
new file mode 100644
index 00000000000..02a9ebd176e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/BindingHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/BindingIterator.class b/libjava/classpath/lib/org/omg/CosNaming/BindingIterator.class
new file mode 100644
index 00000000000..9bceec81737
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/BindingIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/BindingIteratorHelper.class b/libjava/classpath/lib/org/omg/CosNaming/BindingIteratorHelper.class
new file mode 100644
index 00000000000..6f4bbf5dfc7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/BindingIteratorHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/BindingIteratorHolder.class b/libjava/classpath/lib/org/omg/CosNaming/BindingIteratorHolder.class
new file mode 100644
index 00000000000..6b3a4c97fa6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/BindingIteratorHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/BindingIteratorOperations.class b/libjava/classpath/lib/org/omg/CosNaming/BindingIteratorOperations.class
new file mode 100644
index 00000000000..87e7ca41eb0
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/BindingIteratorOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/BindingIteratorPOA.class b/libjava/classpath/lib/org/omg/CosNaming/BindingIteratorPOA.class
new file mode 100644
index 00000000000..e48edfa0133
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/BindingIteratorPOA.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/BindingListHelper.class b/libjava/classpath/lib/org/omg/CosNaming/BindingListHelper.class
new file mode 100644
index 00000000000..ea612c8ad38
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/BindingListHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/BindingListHolder.class b/libjava/classpath/lib/org/omg/CosNaming/BindingListHolder.class
new file mode 100644
index 00000000000..20367814575
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/BindingListHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/BindingType.class b/libjava/classpath/lib/org/omg/CosNaming/BindingType.class
new file mode 100644
index 00000000000..8e4b93f1bc2
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/BindingType.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/BindingTypeHelper.class b/libjava/classpath/lib/org/omg/CosNaming/BindingTypeHelper.class
new file mode 100644
index 00000000000..49be7fbfa5b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/BindingTypeHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/BindingTypeHolder.class b/libjava/classpath/lib/org/omg/CosNaming/BindingTypeHolder.class
new file mode 100644
index 00000000000..4457b08cf67
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/BindingTypeHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/IstringHelper.class b/libjava/classpath/lib/org/omg/CosNaming/IstringHelper.class
new file mode 100644
index 00000000000..995487831fe
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/IstringHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NameComponent.class b/libjava/classpath/lib/org/omg/CosNaming/NameComponent.class
new file mode 100644
index 00000000000..0911b99bae5
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NameComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NameComponentHelper.class b/libjava/classpath/lib/org/omg/CosNaming/NameComponentHelper.class
new file mode 100644
index 00000000000..465313d11c0
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NameComponentHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NameComponentHolder.class b/libjava/classpath/lib/org/omg/CosNaming/NameComponentHolder.class
new file mode 100644
index 00000000000..8d25d8407de
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NameComponentHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NameHelper.class b/libjava/classpath/lib/org/omg/CosNaming/NameHelper.class
new file mode 100644
index 00000000000..236803e4c25
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NameHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NameHolder.class b/libjava/classpath/lib/org/omg/CosNaming/NameHolder.class
new file mode 100644
index 00000000000..8ebabc09ec3
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NameHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContext.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContext.class
new file mode 100644
index 00000000000..81dac3a898a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContext.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextExt.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExt.class
new file mode 100644
index 00000000000..e15c49c8c58
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExt.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtHelper.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtHelper.class
new file mode 100644
index 00000000000..ba2e73e7869
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtHolder.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtHolder.class
new file mode 100644
index 00000000000..557d34868b0
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtOperations.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtOperations.class
new file mode 100644
index 00000000000..15d24fda36a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPOA.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPOA.class
new file mode 100644
index 00000000000..4232306c61b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPOA.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/AddressHelper.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/AddressHelper.class
new file mode 100644
index 00000000000..27c1454b638
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/AddressHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/InvalidAddress.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/InvalidAddress.class
new file mode 100644
index 00000000000..d139ec4edaf
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/InvalidAddress.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHelper.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHelper.class
new file mode 100644
index 00000000000..b9a73dfd5ec
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHolder.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHolder.class
new file mode 100644
index 00000000000..cc79954250c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/StringNameHelper.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/StringNameHelper.class
new file mode 100644
index 00000000000..fc6cbae5d1c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/StringNameHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/URLStringHelper.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/URLStringHelper.class
new file mode 100644
index 00000000000..d01dea9f807
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextExtPackage/URLStringHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextHelper.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextHelper.class
new file mode 100644
index 00000000000..1dd0d29f7c1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextHolder.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextHolder.class
new file mode 100644
index 00000000000..62e5e554afc
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextOperations.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextOperations.class
new file mode 100644
index 00000000000..25c86bfaa46
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPOA.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPOA.class
new file mode 100644
index 00000000000..27760f42c4b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPOA.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/AlreadyBound.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/AlreadyBound.class
new file mode 100644
index 00000000000..dc87560a094
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/AlreadyBound.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.class
new file mode 100644
index 00000000000..8c1dced9797
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHolder.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHolder.class
new file mode 100644
index 00000000000..0a818278425
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/CannotProceed.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/CannotProceed.class
new file mode 100644
index 00000000000..55d09f18ca5
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/CannotProceed.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/CannotProceedHelper.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/CannotProceedHelper.class
new file mode 100644
index 00000000000..5a84c0138f1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/CannotProceedHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/CannotProceedHolder.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/CannotProceedHolder.class
new file mode 100644
index 00000000000..f9c6a20e5f7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/CannotProceedHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/InvalidName.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/InvalidName.class
new file mode 100644
index 00000000000..e61c917ad0a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/InvalidName.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.class
new file mode 100644
index 00000000000..75296619cae
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/InvalidNameHolder.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/InvalidNameHolder.class
new file mode 100644
index 00000000000..1f46ccfd5a9
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/InvalidNameHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotEmpty.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotEmpty.class
new file mode 100644
index 00000000000..800fd5348cd
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotEmpty.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.class
new file mode 100644
index 00000000000..813858b497e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotEmptyHolder.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotEmptyHolder.class
new file mode 100644
index 00000000000..d791bd5bf69
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotEmptyHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFound.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFound.class
new file mode 100644
index 00000000000..29c48e20bf6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFound.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundHelper.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundHelper.class
new file mode 100644
index 00000000000..1190bd77509
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundHolder.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundHolder.class
new file mode 100644
index 00000000000..502132e6385
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundReason.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundReason.class
new file mode 100644
index 00000000000..80e7d0e3c92
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundReason.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.class
new file mode 100644
index 00000000000..729fb72d709
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHolder.class b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHolder.class
new file mode 100644
index 00000000000..772b53b3add
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/_BindingIteratorImplBase.class b/libjava/classpath/lib/org/omg/CosNaming/_BindingIteratorImplBase.class
new file mode 100644
index 00000000000..2bc4a1a33f0
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/_BindingIteratorImplBase.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/_BindingIteratorStub.class b/libjava/classpath/lib/org/omg/CosNaming/_BindingIteratorStub.class
new file mode 100644
index 00000000000..d631bf3f467
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/_BindingIteratorStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/_NamingContextExtImplBase.class b/libjava/classpath/lib/org/omg/CosNaming/_NamingContextExtImplBase.class
new file mode 100644
index 00000000000..964365935e7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/_NamingContextExtImplBase.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/_NamingContextExtStub.class b/libjava/classpath/lib/org/omg/CosNaming/_NamingContextExtStub.class
new file mode 100644
index 00000000000..00551d8035b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/_NamingContextExtStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/_NamingContextImplBase.class b/libjava/classpath/lib/org/omg/CosNaming/_NamingContextImplBase.class
new file mode 100644
index 00000000000..696990a037b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/_NamingContextImplBase.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/CosNaming/_NamingContextStub.class b/libjava/classpath/lib/org/omg/CosNaming/_NamingContextStub.class
new file mode 100644
index 00000000000..043b6f7605b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/CosNaming/_NamingContextStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/Dynamic/Parameter.class b/libjava/classpath/lib/org/omg/Dynamic/Parameter.class
new file mode 100644
index 00000000000..fed50ce0515
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/Dynamic/Parameter.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/AnySeqHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/AnySeqHelper.class
new file mode 100644
index 00000000000..2abdf2bb613
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/AnySeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynAny.class b/libjava/classpath/lib/org/omg/DynamicAny/DynAny.class
new file mode 100644
index 00000000000..458677f46af
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynAny.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactory.class b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactory.class
new file mode 100644
index 00000000000..3bbc3ce7ebf
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryHelper.class
new file mode 100644
index 00000000000..6e78d70466d
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryOperations.class b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryOperations.class
new file mode 100644
index 00000000000..86b8be5dabd
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCode.class b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCode.class
new file mode 100644
index 00000000000..503b319155e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCode.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.class
new file mode 100644
index 00000000000..509fdb24154
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynAnyHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyHelper.class
new file mode 100644
index 00000000000..91d5a91e7bf
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynAnyOperations.class b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyOperations.class
new file mode 100644
index 00000000000..5581d354753
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/InvalidValue.class b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/InvalidValue.class
new file mode 100644
index 00000000000..1ba3db81e72
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/InvalidValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.class
new file mode 100644
index 00000000000..9a2fa22671b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/TypeMismatch.class b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/TypeMismatch.class
new file mode 100644
index 00000000000..a0a376fe0c7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/TypeMismatch.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.class
new file mode 100644
index 00000000000..4eb8cf692c4
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynAnySeqHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/DynAnySeqHelper.class
new file mode 100644
index 00000000000..0d20bc3b567
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynAnySeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynArray.class b/libjava/classpath/lib/org/omg/DynamicAny/DynArray.class
new file mode 100644
index 00000000000..5020891f99e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynArray.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynArrayHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/DynArrayHelper.class
new file mode 100644
index 00000000000..c207376dab4
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynArrayHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynArrayOperations.class b/libjava/classpath/lib/org/omg/DynamicAny/DynArrayOperations.class
new file mode 100644
index 00000000000..5a8f1bae917
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynArrayOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynEnum.class b/libjava/classpath/lib/org/omg/DynamicAny/DynEnum.class
new file mode 100644
index 00000000000..89403af1002
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynEnum.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynEnumHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/DynEnumHelper.class
new file mode 100644
index 00000000000..df78cb05975
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynEnumHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynEnumOperations.class b/libjava/classpath/lib/org/omg/DynamicAny/DynEnumOperations.class
new file mode 100644
index 00000000000..485707f004b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynEnumOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynFixed.class b/libjava/classpath/lib/org/omg/DynamicAny/DynFixed.class
new file mode 100644
index 00000000000..4b7959709a8
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynFixed.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynFixedHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/DynFixedHelper.class
new file mode 100644
index 00000000000..d13af0faf22
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynFixedHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynFixedOperations.class b/libjava/classpath/lib/org/omg/DynamicAny/DynFixedOperations.class
new file mode 100644
index 00000000000..028007c3bde
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynFixedOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynSequence.class b/libjava/classpath/lib/org/omg/DynamicAny/DynSequence.class
new file mode 100644
index 00000000000..96b8ef7c37f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynSequence.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynSequenceHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/DynSequenceHelper.class
new file mode 100644
index 00000000000..c64da94523b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynSequenceHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynSequenceOperations.class b/libjava/classpath/lib/org/omg/DynamicAny/DynSequenceOperations.class
new file mode 100644
index 00000000000..66bdd7aa134
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynSequenceOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynStruct.class b/libjava/classpath/lib/org/omg/DynamicAny/DynStruct.class
new file mode 100644
index 00000000000..a0875fd2d00
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynStruct.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynStructHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/DynStructHelper.class
new file mode 100644
index 00000000000..2a3e6520ff1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynStructHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynStructOperations.class b/libjava/classpath/lib/org/omg/DynamicAny/DynStructOperations.class
new file mode 100644
index 00000000000..8a03e810bf0
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynStructOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynUnion.class b/libjava/classpath/lib/org/omg/DynamicAny/DynUnion.class
new file mode 100644
index 00000000000..f97d7beeb57
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynUnion.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynUnionHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/DynUnionHelper.class
new file mode 100644
index 00000000000..f624ea49059
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynUnionHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynUnionOperations.class b/libjava/classpath/lib/org/omg/DynamicAny/DynUnionOperations.class
new file mode 100644
index 00000000000..04ac9ea406c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynUnionOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynValue.class b/libjava/classpath/lib/org/omg/DynamicAny/DynValue.class
new file mode 100644
index 00000000000..2a3ac74ee54
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynValueBox.class b/libjava/classpath/lib/org/omg/DynamicAny/DynValueBox.class
new file mode 100644
index 00000000000..e86fe0ca649
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynValueBox.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynValueBoxOperations.class b/libjava/classpath/lib/org/omg/DynamicAny/DynValueBoxOperations.class
new file mode 100644
index 00000000000..05ce9023410
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynValueBoxOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynValueCommon.class b/libjava/classpath/lib/org/omg/DynamicAny/DynValueCommon.class
new file mode 100644
index 00000000000..7bd8a4e4ea4
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynValueCommon.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynValueCommonOperations.class b/libjava/classpath/lib/org/omg/DynamicAny/DynValueCommonOperations.class
new file mode 100644
index 00000000000..55e9c058b97
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynValueCommonOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynValueHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/DynValueHelper.class
new file mode 100644
index 00000000000..feeab365be7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynValueHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/DynValueOperations.class b/libjava/classpath/lib/org/omg/DynamicAny/DynValueOperations.class
new file mode 100644
index 00000000000..26a6dad8604
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/DynValueOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/FieldNameHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/FieldNameHelper.class
new file mode 100644
index 00000000000..75c617c2ce9
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/FieldNameHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/NameDynAnyPair.class b/libjava/classpath/lib/org/omg/DynamicAny/NameDynAnyPair.class
new file mode 100644
index 00000000000..cf7e0025b90
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/NameDynAnyPair.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/NameDynAnyPairHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/NameDynAnyPairHelper.class
new file mode 100644
index 00000000000..b83246e4c2d
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/NameDynAnyPairHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/NameDynAnyPairSeqHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/NameDynAnyPairSeqHelper.class
new file mode 100644
index 00000000000..dcf5a77ecd0
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/NameDynAnyPairSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/NameValuePair.class b/libjava/classpath/lib/org/omg/DynamicAny/NameValuePair.class
new file mode 100644
index 00000000000..92a43f4296f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/NameValuePair.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/NameValuePairHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/NameValuePairHelper.class
new file mode 100644
index 00000000000..3425c4f4150
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/NameValuePairHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/NameValuePairSeqHelper.class b/libjava/classpath/lib/org/omg/DynamicAny/NameValuePairSeqHelper.class
new file mode 100644
index 00000000000..6f5a36b2cfb
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/NameValuePairSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/_DynAnyFactoryStub.class b/libjava/classpath/lib/org/omg/DynamicAny/_DynAnyFactoryStub.class
new file mode 100644
index 00000000000..f86463f4847
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/_DynAnyFactoryStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/_DynAnyStub.class b/libjava/classpath/lib/org/omg/DynamicAny/_DynAnyStub.class
new file mode 100644
index 00000000000..5e1fafded16
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/_DynAnyStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/_DynArrayStub.class b/libjava/classpath/lib/org/omg/DynamicAny/_DynArrayStub.class
new file mode 100644
index 00000000000..4d3a705dd74
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/_DynArrayStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/_DynEnumStub.class b/libjava/classpath/lib/org/omg/DynamicAny/_DynEnumStub.class
new file mode 100644
index 00000000000..c005cef95e1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/_DynEnumStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/_DynFixedStub.class b/libjava/classpath/lib/org/omg/DynamicAny/_DynFixedStub.class
new file mode 100644
index 00000000000..9a6d99cd331
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/_DynFixedStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/_DynSequenceStub.class b/libjava/classpath/lib/org/omg/DynamicAny/_DynSequenceStub.class
new file mode 100644
index 00000000000..6fe1051030b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/_DynSequenceStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/_DynStructStub.class b/libjava/classpath/lib/org/omg/DynamicAny/_DynStructStub.class
new file mode 100644
index 00000000000..2cf9fa60d60
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/_DynStructStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/_DynUnionStub.class b/libjava/classpath/lib/org/omg/DynamicAny/_DynUnionStub.class
new file mode 100644
index 00000000000..c1428a3d7e4
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/_DynUnionStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/DynamicAny/_DynValueStub.class b/libjava/classpath/lib/org/omg/DynamicAny/_DynValueStub.class
new file mode 100644
index 00000000000..a6f9e5d0718
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/DynamicAny/_DynValueStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/CodeSets.class b/libjava/classpath/lib/org/omg/IOP/CodeSets.class
new file mode 100644
index 00000000000..6109b883143
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/CodeSets.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/Codec.class b/libjava/classpath/lib/org/omg/IOP/Codec.class
new file mode 100644
index 00000000000..e42906370dd
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/Codec.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/CodecFactory.class b/libjava/classpath/lib/org/omg/IOP/CodecFactory.class
new file mode 100644
index 00000000000..2e41db477f6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/CodecFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/CodecFactoryHelper.class b/libjava/classpath/lib/org/omg/IOP/CodecFactoryHelper.class
new file mode 100644
index 00000000000..6d6d88623cc
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/CodecFactoryHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/CodecFactoryOperations.class b/libjava/classpath/lib/org/omg/IOP/CodecFactoryOperations.class
new file mode 100644
index 00000000000..c33c151e99c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/CodecFactoryOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/CodecFactoryPackage/UnknownEncoding.class b/libjava/classpath/lib/org/omg/IOP/CodecFactoryPackage/UnknownEncoding.class
new file mode 100644
index 00000000000..0e25aa501b6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/CodecFactoryPackage/UnknownEncoding.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.class b/libjava/classpath/lib/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.class
new file mode 100644
index 00000000000..c058507929d
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/CodecOperations.class b/libjava/classpath/lib/org/omg/IOP/CodecOperations.class
new file mode 100644
index 00000000000..de771ce7a3f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/CodecOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/CodecPackage/FormatMismatch.class b/libjava/classpath/lib/org/omg/IOP/CodecPackage/FormatMismatch.class
new file mode 100644
index 00000000000..95b341617b8
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/CodecPackage/FormatMismatch.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/CodecPackage/FormatMismatchHelper.class b/libjava/classpath/lib/org/omg/IOP/CodecPackage/FormatMismatchHelper.class
new file mode 100644
index 00000000000..68d86602f73
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/CodecPackage/FormatMismatchHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/CodecPackage/InvalidTypeForEncoding.class b/libjava/classpath/lib/org/omg/IOP/CodecPackage/InvalidTypeForEncoding.class
new file mode 100644
index 00000000000..108645b425a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/CodecPackage/InvalidTypeForEncoding.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.class b/libjava/classpath/lib/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.class
new file mode 100644
index 00000000000..c66c4f4641b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/CodecPackage/TypeMismatch.class b/libjava/classpath/lib/org/omg/IOP/CodecPackage/TypeMismatch.class
new file mode 100644
index 00000000000..b77ba837875
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/CodecPackage/TypeMismatch.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/CodecPackage/TypeMismatchHelper.class b/libjava/classpath/lib/org/omg/IOP/CodecPackage/TypeMismatchHelper.class
new file mode 100644
index 00000000000..a22d353b1fc
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/CodecPackage/TypeMismatchHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/ComponentIdHelper.class b/libjava/classpath/lib/org/omg/IOP/ComponentIdHelper.class
new file mode 100644
index 00000000000..e728dd272a6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/ComponentIdHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/ENCODING_CDR_ENCAPS.class b/libjava/classpath/lib/org/omg/IOP/ENCODING_CDR_ENCAPS.class
new file mode 100644
index 00000000000..978fce2d311
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/ENCODING_CDR_ENCAPS.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/Encoding.class b/libjava/classpath/lib/org/omg/IOP/Encoding.class
new file mode 100644
index 00000000000..7556fb37337
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/Encoding.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/ExceptionDetailMessage.class b/libjava/classpath/lib/org/omg/IOP/ExceptionDetailMessage.class
new file mode 100644
index 00000000000..68b7635be9e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/ExceptionDetailMessage.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/IOR.class b/libjava/classpath/lib/org/omg/IOP/IOR.class
new file mode 100644
index 00000000000..bcd7eeeb11f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/IOR.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/IORHelper.class b/libjava/classpath/lib/org/omg/IOP/IORHelper.class
new file mode 100644
index 00000000000..fd40ff58064
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/IORHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/IORHolder.class b/libjava/classpath/lib/org/omg/IOP/IORHolder.class
new file mode 100644
index 00000000000..5f6f159d7b6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/IORHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/MultipleComponentProfileHelper.class b/libjava/classpath/lib/org/omg/IOP/MultipleComponentProfileHelper.class
new file mode 100644
index 00000000000..90a55f4873b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/MultipleComponentProfileHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/MultipleComponentProfileHolder.class b/libjava/classpath/lib/org/omg/IOP/MultipleComponentProfileHolder.class
new file mode 100644
index 00000000000..3e155593708
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/MultipleComponentProfileHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/ProfileIdHelper.class b/libjava/classpath/lib/org/omg/IOP/ProfileIdHelper.class
new file mode 100644
index 00000000000..53d42b3969a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/ProfileIdHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/RMICustomMaxStreamFormat.class b/libjava/classpath/lib/org/omg/IOP/RMICustomMaxStreamFormat.class
new file mode 100644
index 00000000000..c148217e591
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/RMICustomMaxStreamFormat.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/ServiceContext.class b/libjava/classpath/lib/org/omg/IOP/ServiceContext.class
new file mode 100644
index 00000000000..ce87e0d96ce
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/ServiceContext.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/ServiceContextHelper.class b/libjava/classpath/lib/org/omg/IOP/ServiceContextHelper.class
new file mode 100644
index 00000000000..e89d8b70826
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/ServiceContextHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/ServiceContextHolder.class b/libjava/classpath/lib/org/omg/IOP/ServiceContextHolder.class
new file mode 100644
index 00000000000..6a4f900a9e2
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/ServiceContextHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/ServiceContextListHelper.class b/libjava/classpath/lib/org/omg/IOP/ServiceContextListHelper.class
new file mode 100644
index 00000000000..bbb4931dda4
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/ServiceContextListHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/ServiceContextListHolder.class b/libjava/classpath/lib/org/omg/IOP/ServiceContextListHolder.class
new file mode 100644
index 00000000000..9d8c1c99160
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/ServiceContextListHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/ServiceIdHelper.class b/libjava/classpath/lib/org/omg/IOP/ServiceIdHelper.class
new file mode 100644
index 00000000000..6184d2d1994
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/ServiceIdHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TAG_ALTERNATE_IIOP_ADDRESS.class b/libjava/classpath/lib/org/omg/IOP/TAG_ALTERNATE_IIOP_ADDRESS.class
new file mode 100644
index 00000000000..0e25b921311
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TAG_ALTERNATE_IIOP_ADDRESS.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TAG_CODE_SETS.class b/libjava/classpath/lib/org/omg/IOP/TAG_CODE_SETS.class
new file mode 100644
index 00000000000..ec11356314b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TAG_CODE_SETS.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TAG_INTERNET_IOP.class b/libjava/classpath/lib/org/omg/IOP/TAG_INTERNET_IOP.class
new file mode 100644
index 00000000000..d91405894b1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TAG_INTERNET_IOP.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TAG_JAVA_CODEBASE.class b/libjava/classpath/lib/org/omg/IOP/TAG_JAVA_CODEBASE.class
new file mode 100644
index 00000000000..4ad70a03c55
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TAG_JAVA_CODEBASE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TAG_MULTIPLE_COMPONENTS.class b/libjava/classpath/lib/org/omg/IOP/TAG_MULTIPLE_COMPONENTS.class
new file mode 100644
index 00000000000..9e382231c52
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TAG_MULTIPLE_COMPONENTS.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TAG_ORB_TYPE.class b/libjava/classpath/lib/org/omg/IOP/TAG_ORB_TYPE.class
new file mode 100644
index 00000000000..d22683e21cd
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TAG_ORB_TYPE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TAG_POLICIES.class b/libjava/classpath/lib/org/omg/IOP/TAG_POLICIES.class
new file mode 100644
index 00000000000..011cf550e58
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TAG_POLICIES.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.class b/libjava/classpath/lib/org/omg/IOP/TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.class
new file mode 100644
index 00000000000..509b595a269
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TaggedComponent.class b/libjava/classpath/lib/org/omg/IOP/TaggedComponent.class
new file mode 100644
index 00000000000..ac20714f739
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TaggedComponent.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TaggedComponentHelper.class b/libjava/classpath/lib/org/omg/IOP/TaggedComponentHelper.class
new file mode 100644
index 00000000000..cc440c77942
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TaggedComponentHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TaggedComponentHolder.class b/libjava/classpath/lib/org/omg/IOP/TaggedComponentHolder.class
new file mode 100644
index 00000000000..f204f615b77
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TaggedComponentHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TaggedProfile.class b/libjava/classpath/lib/org/omg/IOP/TaggedProfile.class
new file mode 100644
index 00000000000..d5b79013613
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TaggedProfile.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TaggedProfileHelper.class b/libjava/classpath/lib/org/omg/IOP/TaggedProfileHelper.class
new file mode 100644
index 00000000000..17061d4a1d6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TaggedProfileHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TaggedProfileHolder.class b/libjava/classpath/lib/org/omg/IOP/TaggedProfileHolder.class
new file mode 100644
index 00000000000..db3eb5f8683
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TaggedProfileHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/IOP/TransactionService.class b/libjava/classpath/lib/org/omg/IOP/TransactionService.class
new file mode 100644
index 00000000000..2ae3b468276
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/IOP/TransactionService.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/Messaging/SYNC_WITH_TRANSPORT.class b/libjava/classpath/lib/org/omg/Messaging/SYNC_WITH_TRANSPORT.class
new file mode 100644
index 00000000000..e9d0ea24f3c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/Messaging/SYNC_WITH_TRANSPORT.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/Messaging/SyncScopeHelper.class b/libjava/classpath/lib/org/omg/Messaging/SyncScopeHelper.class
new file mode 100644
index 00000000000..c1da57963e6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/Messaging/SyncScopeHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ACTIVE.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ACTIVE.class
new file mode 100644
index 00000000000..f62c2bb64c5
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ACTIVE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/AdapterManagerIdHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/AdapterManagerIdHelper.class
new file mode 100644
index 00000000000..05fef01eb52
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/AdapterManagerIdHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/AdapterNameHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/AdapterNameHelper.class
new file mode 100644
index 00000000000..e78eff0b72e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/AdapterNameHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/AdapterStateHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/AdapterStateHelper.class
new file mode 100644
index 00000000000..31b3082dfb7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/AdapterStateHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInfo.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInfo.class
new file mode 100644
index 00000000000..fa6d2cb5423
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInfoOperations.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInfoOperations.class
new file mode 100644
index 00000000000..21f579a9fac
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInfoOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInterceptor.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInterceptor.class
new file mode 100644
index 00000000000..a0da5d6c11a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInterceptor.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.class
new file mode 100644
index 00000000000..3f488761446
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/Current.class b/libjava/classpath/lib/org/omg/PortableInterceptor/Current.class
new file mode 100644
index 00000000000..5bb5ae13fa5
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/Current.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/CurrentHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/CurrentHelper.class
new file mode 100644
index 00000000000..d705e2bc298
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/CurrentHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/CurrentOperations.class b/libjava/classpath/lib/org/omg/PortableInterceptor/CurrentOperations.class
new file mode 100644
index 00000000000..f277404f840
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/CurrentOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/DISCARDING.class b/libjava/classpath/lib/org/omg/PortableInterceptor/DISCARDING.class
new file mode 100644
index 00000000000..a17951ffdca
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/DISCARDING.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ForwardRequest.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ForwardRequest.class
new file mode 100644
index 00000000000..75dc5b3e8ea
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ForwardRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ForwardRequestHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ForwardRequestHelper.class
new file mode 100644
index 00000000000..1586cf72764
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ForwardRequestHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/HOLDING.class b/libjava/classpath/lib/org/omg/PortableInterceptor/HOLDING.class
new file mode 100644
index 00000000000..d8523871132
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/HOLDING.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/INACTIVE.class b/libjava/classpath/lib/org/omg/PortableInterceptor/INACTIVE.class
new file mode 100644
index 00000000000..d9c8c70396c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/INACTIVE.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/IORInfo.class b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInfo.class
new file mode 100644
index 00000000000..3993e938c90
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/IORInfoOperations.class b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInfoOperations.class
new file mode 100644
index 00000000000..72e5ab20d76
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInfoOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor.class b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor.class
new file mode 100644
index 00000000000..d00eb2eded8
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptorOperations.class b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptorOperations.class
new file mode 100644
index 00000000000..da1fc220df4
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptorOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0.class b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0.class
new file mode 100644
index 00000000000..8c05d479de6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.class
new file mode 100644
index 00000000000..9ea358d095a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0Holder.class b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0Holder.class
new file mode 100644
index 00000000000..c5f0a77c16b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0Holder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0Operations.class b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0Operations.class
new file mode 100644
index 00000000000..63fa9892a4f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/IORInterceptor_3_0Operations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/Interceptor.class b/libjava/classpath/lib/org/omg/PortableInterceptor/Interceptor.class
new file mode 100644
index 00000000000..4984c4d3972
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/Interceptor.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/InterceptorOperations.class b/libjava/classpath/lib/org/omg/PortableInterceptor/InterceptorOperations.class
new file mode 100644
index 00000000000..8a4984a9c77
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/InterceptorOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/InvalidSlot.class b/libjava/classpath/lib/org/omg/PortableInterceptor/InvalidSlot.class
new file mode 100644
index 00000000000..dead3abd784
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/InvalidSlot.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/InvalidSlotHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/InvalidSlotHelper.class
new file mode 100644
index 00000000000..f697ce5166a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/InvalidSlotHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/LOCATION_FORWARD.class b/libjava/classpath/lib/org/omg/PortableInterceptor/LOCATION_FORWARD.class
new file mode 100644
index 00000000000..ed8d473c31e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/LOCATION_FORWARD.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/NON_EXISTENT.class b/libjava/classpath/lib/org/omg/PortableInterceptor/NON_EXISTENT.class
new file mode 100644
index 00000000000..aa3216ccdd7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/NON_EXISTENT.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ORBIdHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBIdHelper.class
new file mode 100644
index 00000000000..e2c94b8412b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBIdHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfo.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfo.class
new file mode 100644
index 00000000000..92e62b1e80e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoOperations.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoOperations.class
new file mode 100644
index 00000000000..f12f9228ea6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateName.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateName.class
new file mode 100644
index 00000000000..f872a4b568a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateName.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHelper.class
new file mode 100644
index 00000000000..bb483a9ab5f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidName.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidName.class
new file mode 100644
index 00000000000..7e90bc1737a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidName.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.class
new file mode 100644
index 00000000000..06a006b5f2f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.class
new file mode 100644
index 00000000000..34ecdd04823
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitializer.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitializer.class
new file mode 100644
index 00000000000..271a7d4f6b0
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitializer.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitializerOperations.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitializerOperations.class
new file mode 100644
index 00000000000..6c5788eeae9
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ORBInitializerOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectIdHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectIdHelper.class
new file mode 100644
index 00000000000..4cfc9cfad5b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectIdHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceFactory.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceFactory.class
new file mode 100644
index 00000000000..f5c1114155f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.class
new file mode 100644
index 00000000000..77b24e7a2d7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceFactoryHolder.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceFactoryHolder.class
new file mode 100644
index 00000000000..c1c714ee147
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceFactoryHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplate.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplate.class
new file mode 100644
index 00000000000..02bf2fbfb45
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplate.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.class
new file mode 100644
index 00000000000..964b46c59c9
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateHolder.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateHolder.class
new file mode 100644
index 00000000000..92c3659c5cd
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHelper.class
new file mode 100644
index 00000000000..fb600584341
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHolder.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHolder.class
new file mode 100644
index 00000000000..adaad2dcb39
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/PolicyFactory.class b/libjava/classpath/lib/org/omg/PortableInterceptor/PolicyFactory.class
new file mode 100644
index 00000000000..3cfdecdc716
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/PolicyFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/PolicyFactoryOperations.class b/libjava/classpath/lib/org/omg/PortableInterceptor/PolicyFactoryOperations.class
new file mode 100644
index 00000000000..980d6d27270
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/PolicyFactoryOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/RequestInfo.class b/libjava/classpath/lib/org/omg/PortableInterceptor/RequestInfo.class
new file mode 100644
index 00000000000..279254ebb54
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/RequestInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/RequestInfoOperations.class b/libjava/classpath/lib/org/omg/PortableInterceptor/RequestInfoOperations.class
new file mode 100644
index 00000000000..ce12749a858
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/RequestInfoOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/SUCCESSFUL.class b/libjava/classpath/lib/org/omg/PortableInterceptor/SUCCESSFUL.class
new file mode 100644
index 00000000000..1e9ce342eed
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/SUCCESSFUL.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/SYSTEM_EXCEPTION.class b/libjava/classpath/lib/org/omg/PortableInterceptor/SYSTEM_EXCEPTION.class
new file mode 100644
index 00000000000..50894b2059c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/SYSTEM_EXCEPTION.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ServerIdHelper.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ServerIdHelper.class
new file mode 100644
index 00000000000..5c85fbc7d9f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ServerIdHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInfo.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInfo.class
new file mode 100644
index 00000000000..a04f5930074
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInfoOperations.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInfoOperations.class
new file mode 100644
index 00000000000..52366e313e3
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInfoOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInterceptor.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInterceptor.class
new file mode 100644
index 00000000000..6cbd3de0cc2
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInterceptor.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.class b/libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.class
new file mode 100644
index 00000000000..54b98bd5318
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/TRANSPORT_RETRY.class b/libjava/classpath/lib/org/omg/PortableInterceptor/TRANSPORT_RETRY.class
new file mode 100644
index 00000000000..41eb816e0be
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/TRANSPORT_RETRY.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/USER_EXCEPTION.class b/libjava/classpath/lib/org/omg/PortableInterceptor/USER_EXCEPTION.class
new file mode 100644
index 00000000000..ccde42904f9
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/USER_EXCEPTION.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableInterceptor/_IORInterceptor_3_0Stub.class b/libjava/classpath/lib/org/omg/PortableInterceptor/_IORInterceptor_3_0Stub.class
new file mode 100644
index 00000000000..c7d97cb2258
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableInterceptor/_IORInterceptor_3_0Stub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/AdapterActivator.class b/libjava/classpath/lib/org/omg/PortableServer/AdapterActivator.class
new file mode 100644
index 00000000000..3386cb87895
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/AdapterActivator.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/AdapterActivatorOperations.class b/libjava/classpath/lib/org/omg/PortableServer/AdapterActivatorOperations.class
new file mode 100644
index 00000000000..522d77f99d1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/AdapterActivatorOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/Current.class b/libjava/classpath/lib/org/omg/PortableServer/Current.class
new file mode 100644
index 00000000000..314ba8fc81e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/Current.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/CurrentHelper.class b/libjava/classpath/lib/org/omg/PortableServer/CurrentHelper.class
new file mode 100644
index 00000000000..3a79035c1c0
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/CurrentHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/CurrentOperations.class b/libjava/classpath/lib/org/omg/PortableServer/CurrentOperations.class
new file mode 100644
index 00000000000..992a9a1a6a9
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/CurrentOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/CurrentPackage/NoContext.class b/libjava/classpath/lib/org/omg/PortableServer/CurrentPackage/NoContext.class
new file mode 100644
index 00000000000..65cc6667c7e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/CurrentPackage/NoContext.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/CurrentPackage/NoContextHelper.class b/libjava/classpath/lib/org/omg/PortableServer/CurrentPackage/NoContextHelper.class
new file mode 100644
index 00000000000..2a84b31a0b9
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/CurrentPackage/NoContextHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/DynamicImplementation.class b/libjava/classpath/lib/org/omg/PortableServer/DynamicImplementation.class
new file mode 100644
index 00000000000..181dafec033
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/DynamicImplementation.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ForwardRequest.class b/libjava/classpath/lib/org/omg/PortableServer/ForwardRequest.class
new file mode 100644
index 00000000000..9d2fc9ce146
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ForwardRequest.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ForwardRequestHelper.class b/libjava/classpath/lib/org/omg/PortableServer/ForwardRequestHelper.class
new file mode 100644
index 00000000000..f2759d58568
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ForwardRequestHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ID_ASSIGNMENT_POLICY_ID.class b/libjava/classpath/lib/org/omg/PortableServer/ID_ASSIGNMENT_POLICY_ID.class
new file mode 100644
index 00000000000..412e80bef69
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ID_ASSIGNMENT_POLICY_ID.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ID_UNIQUENESS_POLICY_ID.class b/libjava/classpath/lib/org/omg/PortableServer/ID_UNIQUENESS_POLICY_ID.class
new file mode 100644
index 00000000000..9152545a5bf
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ID_UNIQUENESS_POLICY_ID.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/IMPLICIT_ACTIVATION_POLICY_ID.class b/libjava/classpath/lib/org/omg/PortableServer/IMPLICIT_ACTIVATION_POLICY_ID.class
new file mode 100644
index 00000000000..f293f42156b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/IMPLICIT_ACTIVATION_POLICY_ID.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/IdAssignmentPolicy.class b/libjava/classpath/lib/org/omg/PortableServer/IdAssignmentPolicy.class
new file mode 100644
index 00000000000..1ea60bb3ac1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/IdAssignmentPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/IdAssignmentPolicyOperations.class b/libjava/classpath/lib/org/omg/PortableServer/IdAssignmentPolicyOperations.class
new file mode 100644
index 00000000000..8ca64c3eb7f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/IdAssignmentPolicyOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/IdAssignmentPolicyValue.class b/libjava/classpath/lib/org/omg/PortableServer/IdAssignmentPolicyValue.class
new file mode 100644
index 00000000000..5f28c46dd47
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/IdAssignmentPolicyValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/IdUniquenessPolicy.class b/libjava/classpath/lib/org/omg/PortableServer/IdUniquenessPolicy.class
new file mode 100644
index 00000000000..05e41ed83f0
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/IdUniquenessPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/IdUniquenessPolicyOperations.class b/libjava/classpath/lib/org/omg/PortableServer/IdUniquenessPolicyOperations.class
new file mode 100644
index 00000000000..f1d2686e811
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/IdUniquenessPolicyOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/IdUniquenessPolicyValue.class b/libjava/classpath/lib/org/omg/PortableServer/IdUniquenessPolicyValue.class
new file mode 100644
index 00000000000..be1654aa132
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/IdUniquenessPolicyValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ImplicitActivationPolicy.class b/libjava/classpath/lib/org/omg/PortableServer/ImplicitActivationPolicy.class
new file mode 100644
index 00000000000..6ca99987849
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ImplicitActivationPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ImplicitActivationPolicyOperations.class b/libjava/classpath/lib/org/omg/PortableServer/ImplicitActivationPolicyOperations.class
new file mode 100644
index 00000000000..0b56ff4f1ad
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ImplicitActivationPolicyOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ImplicitActivationPolicyValue.class b/libjava/classpath/lib/org/omg/PortableServer/ImplicitActivationPolicyValue.class
new file mode 100644
index 00000000000..6a947d402da
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ImplicitActivationPolicyValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/LIFESPAN_POLICY_ID.class b/libjava/classpath/lib/org/omg/PortableServer/LIFESPAN_POLICY_ID.class
new file mode 100644
index 00000000000..37d54b993a4
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/LIFESPAN_POLICY_ID.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/LifespanPolicy.class b/libjava/classpath/lib/org/omg/PortableServer/LifespanPolicy.class
new file mode 100644
index 00000000000..3e91a61edb8
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/LifespanPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/LifespanPolicyOperations.class b/libjava/classpath/lib/org/omg/PortableServer/LifespanPolicyOperations.class
new file mode 100644
index 00000000000..846b5d5c70e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/LifespanPolicyOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/LifespanPolicyValue.class b/libjava/classpath/lib/org/omg/PortableServer/LifespanPolicyValue.class
new file mode 100644
index 00000000000..368b9e4b786
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/LifespanPolicyValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POA.class b/libjava/classpath/lib/org/omg/PortableServer/POA.class
new file mode 100644
index 00000000000..a6efbc9d0e2
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POA.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAHelper.class b/libjava/classpath/lib/org/omg/PortableServer/POAHelper.class
new file mode 100644
index 00000000000..e66809f7f9d
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAManager.class b/libjava/classpath/lib/org/omg/PortableServer/POAManager.class
new file mode 100644
index 00000000000..7b87924561c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAManager.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAManagerOperations.class b/libjava/classpath/lib/org/omg/PortableServer/POAManagerOperations.class
new file mode 100644
index 00000000000..91ed0cd09d1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAManagerOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAManagerPackage/AdapterInactive.class b/libjava/classpath/lib/org/omg/PortableServer/POAManagerPackage/AdapterInactive.class
new file mode 100644
index 00000000000..c0ea5bd5c4b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAManagerPackage/AdapterInactive.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.class b/libjava/classpath/lib/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.class
new file mode 100644
index 00000000000..6e79f378b85
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAManagerPackage/State.class b/libjava/classpath/lib/org/omg/PortableServer/POAManagerPackage/State.class
new file mode 100644
index 00000000000..76a3b3b6908
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAManagerPackage/State.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAOperations.class b/libjava/classpath/lib/org/omg/PortableServer/POAOperations.class
new file mode 100644
index 00000000000..478941c0dc1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterAlreadyExists.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterAlreadyExists.class
new file mode 100644
index 00000000000..5e9ffe5b944
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterAlreadyExists.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.class
new file mode 100644
index 00000000000..2dfc3a1e33e
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterNonExistent.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterNonExistent.class
new file mode 100644
index 00000000000..b09e0f48834
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterNonExistent.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.class
new file mode 100644
index 00000000000..5de0e15b986
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/InvalidPolicy.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/InvalidPolicy.class
new file mode 100644
index 00000000000..62e0779fc74
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/InvalidPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/InvalidPolicyHelper.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/InvalidPolicyHelper.class
new file mode 100644
index 00000000000..f37dd6c52e6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/InvalidPolicyHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/NoServant.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/NoServant.class
new file mode 100644
index 00000000000..b34ae168a1a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/NoServant.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/NoServantHelper.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/NoServantHelper.class
new file mode 100644
index 00000000000..aceb6f39005
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/NoServantHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectAlreadyActive.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectAlreadyActive.class
new file mode 100644
index 00000000000..735333ac4f8
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectAlreadyActive.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.class
new file mode 100644
index 00000000000..e3c87092904
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectNotActive.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectNotActive.class
new file mode 100644
index 00000000000..12158c15c5b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectNotActive.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.class
new file mode 100644
index 00000000000..35c98fa61c8
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantAlreadyActive.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantAlreadyActive.class
new file mode 100644
index 00000000000..05311dab760
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantAlreadyActive.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.class
new file mode 100644
index 00000000000..e21d26b912c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantNotActive.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantNotActive.class
new file mode 100644
index 00000000000..9bb2d41298a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantNotActive.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.class
new file mode 100644
index 00000000000..21a32d107ca
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongAdapter.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongAdapter.class
new file mode 100644
index 00000000000..435f57c7b1b
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongAdapterHelper.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongAdapterHelper.class
new file mode 100644
index 00000000000..098b707e3ae
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongAdapterHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongPolicy.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongPolicy.class
new file mode 100644
index 00000000000..378e7cdb464
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongPolicyHelper.class b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongPolicyHelper.class
new file mode 100644
index 00000000000..9419d796495
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/POAPackage/WrongPolicyHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/REQUEST_PROCESSING_POLICY_ID.class b/libjava/classpath/lib/org/omg/PortableServer/REQUEST_PROCESSING_POLICY_ID.class
new file mode 100644
index 00000000000..5d33c123cf5
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/REQUEST_PROCESSING_POLICY_ID.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/RequestProcessingPolicy.class b/libjava/classpath/lib/org/omg/PortableServer/RequestProcessingPolicy.class
new file mode 100644
index 00000000000..69f179430e7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/RequestProcessingPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/RequestProcessingPolicyOperations.class b/libjava/classpath/lib/org/omg/PortableServer/RequestProcessingPolicyOperations.class
new file mode 100644
index 00000000000..f9c6bdf1a2f
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/RequestProcessingPolicyOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/RequestProcessingPolicyValue.class b/libjava/classpath/lib/org/omg/PortableServer/RequestProcessingPolicyValue.class
new file mode 100644
index 00000000000..cf9025528a4
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/RequestProcessingPolicyValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/SERVANT_RETENTION_POLICY_ID.class b/libjava/classpath/lib/org/omg/PortableServer/SERVANT_RETENTION_POLICY_ID.class
new file mode 100644
index 00000000000..99eac73fb47
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/SERVANT_RETENTION_POLICY_ID.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/Servant.class b/libjava/classpath/lib/org/omg/PortableServer/Servant.class
new file mode 100644
index 00000000000..7baf1f12726
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/Servant.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantActivator.class b/libjava/classpath/lib/org/omg/PortableServer/ServantActivator.class
new file mode 100644
index 00000000000..2e31cdcd3bb
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantActivator.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantActivatorHelper.class b/libjava/classpath/lib/org/omg/PortableServer/ServantActivatorHelper.class
new file mode 100644
index 00000000000..8fe337b3834
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantActivatorHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantActivatorOperations.class b/libjava/classpath/lib/org/omg/PortableServer/ServantActivatorOperations.class
new file mode 100644
index 00000000000..6e5433d72d7
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantActivatorOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantActivatorPOA$delegator.class b/libjava/classpath/lib/org/omg/PortableServer/ServantActivatorPOA$delegator.class
new file mode 100644
index 00000000000..b6f0ca67762
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantActivatorPOA$delegator.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantActivatorPOA.class b/libjava/classpath/lib/org/omg/PortableServer/ServantActivatorPOA.class
new file mode 100644
index 00000000000..1d584195e83
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantActivatorPOA.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantLocator.class b/libjava/classpath/lib/org/omg/PortableServer/ServantLocator.class
new file mode 100644
index 00000000000..10ae566e4ce
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantLocator.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorHelper.class b/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorHelper.class
new file mode 100644
index 00000000000..e85bcd71bcc
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorHelper.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorOperations.class b/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorOperations.class
new file mode 100644
index 00000000000..1a9b35a3112
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorPOA$delegator.class b/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorPOA$delegator.class
new file mode 100644
index 00000000000..77b49fe8abe
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorPOA$delegator.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorPOA.class b/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorPOA.class
new file mode 100644
index 00000000000..7963edeab3a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorPOA.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.class b/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.class
new file mode 100644
index 00000000000..808ffdff07d
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantManager.class b/libjava/classpath/lib/org/omg/PortableServer/ServantManager.class
new file mode 100644
index 00000000000..6fc2ead96d1
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantManager.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantManagerOperations.class b/libjava/classpath/lib/org/omg/PortableServer/ServantManagerOperations.class
new file mode 100644
index 00000000000..e24e934d968
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantManagerOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantRetentionPolicy.class b/libjava/classpath/lib/org/omg/PortableServer/ServantRetentionPolicy.class
new file mode 100644
index 00000000000..33265730d15
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantRetentionPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantRetentionPolicyOperations.class b/libjava/classpath/lib/org/omg/PortableServer/ServantRetentionPolicyOperations.class
new file mode 100644
index 00000000000..7cac545db30
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantRetentionPolicyOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ServantRetentionPolicyValue.class b/libjava/classpath/lib/org/omg/PortableServer/ServantRetentionPolicyValue.class
new file mode 100644
index 00000000000..1b04d669955
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ServantRetentionPolicyValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/THREAD_POLICY_ID.class b/libjava/classpath/lib/org/omg/PortableServer/THREAD_POLICY_ID.class
new file mode 100644
index 00000000000..616b5c884c4
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/THREAD_POLICY_ID.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ThreadPolicy.class b/libjava/classpath/lib/org/omg/PortableServer/ThreadPolicy.class
new file mode 100644
index 00000000000..0d67177a924
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ThreadPolicy.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ThreadPolicyOperations.class b/libjava/classpath/lib/org/omg/PortableServer/ThreadPolicyOperations.class
new file mode 100644
index 00000000000..a290f224f85
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ThreadPolicyOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/ThreadPolicyValue.class b/libjava/classpath/lib/org/omg/PortableServer/ThreadPolicyValue.class
new file mode 100644
index 00000000000..f810fd1d47a
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/ThreadPolicyValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/_ServantActivatorStub.class b/libjava/classpath/lib/org/omg/PortableServer/_ServantActivatorStub.class
new file mode 100644
index 00000000000..51fbbae24d6
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/_ServantActivatorStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/_ServantLocatorStub.class b/libjava/classpath/lib/org/omg/PortableServer/_ServantLocatorStub.class
new file mode 100644
index 00000000000..24aa49d5e78
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/_ServantLocatorStub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/PortableServer/portable/Delegate.class b/libjava/classpath/lib/org/omg/PortableServer/portable/Delegate.class
new file mode 100644
index 00000000000..6ceb6e0daa3
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/PortableServer/portable/Delegate.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/SendingContext/RunTime.class b/libjava/classpath/lib/org/omg/SendingContext/RunTime.class
new file mode 100644
index 00000000000..55fbc575e50
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/SendingContext/RunTime.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/SendingContext/RunTimeOperations.class b/libjava/classpath/lib/org/omg/SendingContext/RunTimeOperations.class
new file mode 100644
index 00000000000..c1ef821014c
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/SendingContext/RunTimeOperations.class
Binary files differ
diff --git a/libjava/classpath/lib/org/omg/stub/java/rmi/_Remote_Stub.class b/libjava/classpath/lib/org/omg/stub/java/rmi/_Remote_Stub.class
new file mode 100644
index 00000000000..021fbde7d53
--- /dev/null
+++ b/libjava/classpath/lib/org/omg/stub/java/rmi/_Remote_Stub.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/Datatype.class b/libjava/classpath/lib/org/relaxng/datatype/Datatype.class
new file mode 100644
index 00000000000..727dadd61b5
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/Datatype.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/DatatypeBuilder.class b/libjava/classpath/lib/org/relaxng/datatype/DatatypeBuilder.class
new file mode 100644
index 00000000000..0842ac94c34
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/DatatypeBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/DatatypeException.class b/libjava/classpath/lib/org/relaxng/datatype/DatatypeException.class
new file mode 100644
index 00000000000..05bf9ed8141
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/DatatypeException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/DatatypeLibrary.class b/libjava/classpath/lib/org/relaxng/datatype/DatatypeLibrary.class
new file mode 100644
index 00000000000..ac751295384
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/DatatypeLibrary.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/DatatypeLibraryFactory.class b/libjava/classpath/lib/org/relaxng/datatype/DatatypeLibraryFactory.class
new file mode 100644
index 00000000000..1ea738d6556
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/DatatypeLibraryFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/DatatypeStreamingValidator.class b/libjava/classpath/lib/org/relaxng/datatype/DatatypeStreamingValidator.class
new file mode 100644
index 00000000000..bf48191b22e
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/DatatypeStreamingValidator.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/ValidationContext.class b/libjava/classpath/lib/org/relaxng/datatype/ValidationContext.class
new file mode 100644
index 00000000000..f60648d5a96
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/ValidationContext.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$Loader.class b/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$Loader.class
new file mode 100644
index 00000000000..20f833b7e16
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$Loader.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$Loader2.class b/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$Loader2.class
new file mode 100644
index 00000000000..08e660a92ce
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$Loader2.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$ProviderEnumeration.class b/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$ProviderEnumeration.class
new file mode 100644
index 00000000000..6b39f8064c5
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$ProviderEnumeration.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$Singleton.class b/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$Singleton.class
new file mode 100644
index 00000000000..64b8cc09988
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service$Singleton.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service.class b/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service.class
new file mode 100644
index 00000000000..72fbfc32fa0
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader$Service.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader.class b/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader.class
new file mode 100644
index 00000000000..9662f62cdec
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/helpers/DatatypeLibraryLoader.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.class b/libjava/classpath/lib/org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.class
new file mode 100644
index 00000000000..18ebd721f5e
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.class
Binary files differ
diff --git a/libjava/classpath/lib/org/relaxng/datatype/helpers/StreamingValidatorImpl.class b/libjava/classpath/lib/org/relaxng/datatype/helpers/StreamingValidatorImpl.class
new file mode 100644
index 00000000000..39a497d2d74
--- /dev/null
+++ b/libjava/classpath/lib/org/relaxng/datatype/helpers/StreamingValidatorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/Attr.class b/libjava/classpath/lib/org/w3c/dom/Attr.class
new file mode 100644
index 00000000000..1ff7f985b79
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/Attr.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/CDATASection.class b/libjava/classpath/lib/org/w3c/dom/CDATASection.class
new file mode 100644
index 00000000000..349b07a9f48
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/CDATASection.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/CharacterData.class b/libjava/classpath/lib/org/w3c/dom/CharacterData.class
new file mode 100644
index 00000000000..94a4a68ef65
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/CharacterData.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/Comment.class b/libjava/classpath/lib/org/w3c/dom/Comment.class
new file mode 100644
index 00000000000..88657114f26
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/Comment.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/DOMConfiguration.class b/libjava/classpath/lib/org/w3c/dom/DOMConfiguration.class
new file mode 100644
index 00000000000..d74b669757a
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/DOMConfiguration.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/DOMError.class b/libjava/classpath/lib/org/w3c/dom/DOMError.class
new file mode 100644
index 00000000000..703971cf49e
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/DOMError.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/DOMErrorHandler.class b/libjava/classpath/lib/org/w3c/dom/DOMErrorHandler.class
new file mode 100644
index 00000000000..07d3c23a13c
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/DOMErrorHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/DOMException.class b/libjava/classpath/lib/org/w3c/dom/DOMException.class
new file mode 100644
index 00000000000..b6ad41d6c56
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/DOMException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/DOMImplementation.class b/libjava/classpath/lib/org/w3c/dom/DOMImplementation.class
new file mode 100644
index 00000000000..140b96dae03
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/DOMImplementation.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/DOMImplementationList.class b/libjava/classpath/lib/org/w3c/dom/DOMImplementationList.class
new file mode 100644
index 00000000000..2673fc36fbd
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/DOMImplementationList.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/DOMImplementationSource.class b/libjava/classpath/lib/org/w3c/dom/DOMImplementationSource.class
new file mode 100644
index 00000000000..02389cb27e2
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/DOMImplementationSource.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/DOMLocator.class b/libjava/classpath/lib/org/w3c/dom/DOMLocator.class
new file mode 100644
index 00000000000..a73d8ce1aec
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/DOMLocator.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/DOMStringList.class b/libjava/classpath/lib/org/w3c/dom/DOMStringList.class
new file mode 100644
index 00000000000..d30c4eb087f
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/DOMStringList.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/Document.class b/libjava/classpath/lib/org/w3c/dom/Document.class
new file mode 100644
index 00000000000..8537d9d1a62
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/Document.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/DocumentFragment.class b/libjava/classpath/lib/org/w3c/dom/DocumentFragment.class
new file mode 100644
index 00000000000..8c5f4ac3574
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/DocumentFragment.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/DocumentType.class b/libjava/classpath/lib/org/w3c/dom/DocumentType.class
new file mode 100644
index 00000000000..f825c1523dd
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/DocumentType.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/Element.class b/libjava/classpath/lib/org/w3c/dom/Element.class
new file mode 100644
index 00000000000..a7a3997fd4e
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/Element.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/Entity.class b/libjava/classpath/lib/org/w3c/dom/Entity.class
new file mode 100644
index 00000000000..08e290b0ff3
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/Entity.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/EntityReference.class b/libjava/classpath/lib/org/w3c/dom/EntityReference.class
new file mode 100644
index 00000000000..05337119a5d
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/EntityReference.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/NameList.class b/libjava/classpath/lib/org/w3c/dom/NameList.class
new file mode 100644
index 00000000000..79f3c255de2
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/NameList.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/NamedNodeMap.class b/libjava/classpath/lib/org/w3c/dom/NamedNodeMap.class
new file mode 100644
index 00000000000..e90bfc641be
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/NamedNodeMap.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/Node.class b/libjava/classpath/lib/org/w3c/dom/Node.class
new file mode 100644
index 00000000000..5684f2520ea
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/Node.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/NodeList.class b/libjava/classpath/lib/org/w3c/dom/NodeList.class
new file mode 100644
index 00000000000..65e13f68f62
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/NodeList.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/Notation.class b/libjava/classpath/lib/org/w3c/dom/Notation.class
new file mode 100644
index 00000000000..003e5740c68
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/Notation.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ProcessingInstruction.class b/libjava/classpath/lib/org/w3c/dom/ProcessingInstruction.class
new file mode 100644
index 00000000000..48a7bf07232
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ProcessingInstruction.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/Text.class b/libjava/classpath/lib/org/w3c/dom/Text.class
new file mode 100644
index 00000000000..fd5bf5bfee7
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/Text.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/TypeInfo.class b/libjava/classpath/lib/org/w3c/dom/TypeInfo.class
new file mode 100644
index 00000000000..b8f34b721a6
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/TypeInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/UserDataHandler.class b/libjava/classpath/lib/org/w3c/dom/UserDataHandler.class
new file mode 100644
index 00000000000..09ebf03cccf
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/UserDataHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$1.class b/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$1.class
new file mode 100644
index 00000000000..c6cc33659b7
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$1.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$2.class b/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$2.class
new file mode 100644
index 00000000000..6b7def77001
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$2.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$3.class b/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$3.class
new file mode 100644
index 00000000000..d36762500e9
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$3.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$4.class b/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$4.class
new file mode 100644
index 00000000000..4e6b46fb869
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry$4.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry.class b/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry.class
new file mode 100644
index 00000000000..8c24a81a58d
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/bootstrap/DOMImplementationRegistry.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSS2Properties.class b/libjava/classpath/lib/org/w3c/dom/css/CSS2Properties.class
new file mode 100644
index 00000000000..0bff07ee668
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSS2Properties.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSSCharsetRule.class b/libjava/classpath/lib/org/w3c/dom/css/CSSCharsetRule.class
new file mode 100644
index 00000000000..e00dd474043
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSSCharsetRule.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSSFontFaceRule.class b/libjava/classpath/lib/org/w3c/dom/css/CSSFontFaceRule.class
new file mode 100644
index 00000000000..baca5f88371
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSSFontFaceRule.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSSImportRule.class b/libjava/classpath/lib/org/w3c/dom/css/CSSImportRule.class
new file mode 100644
index 00000000000..885b973b061
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSSImportRule.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSSMediaRule.class b/libjava/classpath/lib/org/w3c/dom/css/CSSMediaRule.class
new file mode 100644
index 00000000000..2670322ed4f
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSSMediaRule.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSSPageRule.class b/libjava/classpath/lib/org/w3c/dom/css/CSSPageRule.class
new file mode 100644
index 00000000000..b65d865a6c1
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSSPageRule.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSSPrimitiveValue.class b/libjava/classpath/lib/org/w3c/dom/css/CSSPrimitiveValue.class
new file mode 100644
index 00000000000..0caa85ef512
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSSPrimitiveValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSSRule.class b/libjava/classpath/lib/org/w3c/dom/css/CSSRule.class
new file mode 100644
index 00000000000..239b88c0ee5
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSSRule.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSSRuleList.class b/libjava/classpath/lib/org/w3c/dom/css/CSSRuleList.class
new file mode 100644
index 00000000000..4a79b00e584
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSSRuleList.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSSStyleDeclaration.class b/libjava/classpath/lib/org/w3c/dom/css/CSSStyleDeclaration.class
new file mode 100644
index 00000000000..2756453e944
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSSStyleDeclaration.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSSStyleRule.class b/libjava/classpath/lib/org/w3c/dom/css/CSSStyleRule.class
new file mode 100644
index 00000000000..7527c9fe278
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSSStyleRule.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSSStyleSheet.class b/libjava/classpath/lib/org/w3c/dom/css/CSSStyleSheet.class
new file mode 100644
index 00000000000..297c66f0fb1
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSSStyleSheet.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSSUnknownRule.class b/libjava/classpath/lib/org/w3c/dom/css/CSSUnknownRule.class
new file mode 100644
index 00000000000..329979cc22d
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSSUnknownRule.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSSValue.class b/libjava/classpath/lib/org/w3c/dom/css/CSSValue.class
new file mode 100644
index 00000000000..e5e1789809f
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSSValue.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/CSSValueList.class b/libjava/classpath/lib/org/w3c/dom/css/CSSValueList.class
new file mode 100644
index 00000000000..7b98111dbfd
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/CSSValueList.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/Counter.class b/libjava/classpath/lib/org/w3c/dom/css/Counter.class
new file mode 100644
index 00000000000..be680c49c4b
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/Counter.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/DOMImplementationCSS.class b/libjava/classpath/lib/org/w3c/dom/css/DOMImplementationCSS.class
new file mode 100644
index 00000000000..73c918f1c3c
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/DOMImplementationCSS.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/DocumentCSS.class b/libjava/classpath/lib/org/w3c/dom/css/DocumentCSS.class
new file mode 100644
index 00000000000..c8a76c602c3
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/DocumentCSS.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/ElementCSSInlineStyle.class b/libjava/classpath/lib/org/w3c/dom/css/ElementCSSInlineStyle.class
new file mode 100644
index 00000000000..b077d0d223b
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/ElementCSSInlineStyle.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/RGBColor.class b/libjava/classpath/lib/org/w3c/dom/css/RGBColor.class
new file mode 100644
index 00000000000..e2b399d11c6
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/RGBColor.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/Rect.class b/libjava/classpath/lib/org/w3c/dom/css/Rect.class
new file mode 100644
index 00000000000..9bb8cbd7b51
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/Rect.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/css/ViewCSS.class b/libjava/classpath/lib/org/w3c/dom/css/ViewCSS.class
new file mode 100644
index 00000000000..74b7a997d6f
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/css/ViewCSS.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/events/DocumentEvent.class b/libjava/classpath/lib/org/w3c/dom/events/DocumentEvent.class
new file mode 100644
index 00000000000..8466c9b74db
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/events/DocumentEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/events/Event.class b/libjava/classpath/lib/org/w3c/dom/events/Event.class
new file mode 100644
index 00000000000..7d906cacc71
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/events/Event.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/events/EventException.class b/libjava/classpath/lib/org/w3c/dom/events/EventException.class
new file mode 100644
index 00000000000..c1edb4ba3cd
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/events/EventException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/events/EventListener.class b/libjava/classpath/lib/org/w3c/dom/events/EventListener.class
new file mode 100644
index 00000000000..6630f8e6f1d
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/events/EventListener.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/events/EventTarget.class b/libjava/classpath/lib/org/w3c/dom/events/EventTarget.class
new file mode 100644
index 00000000000..8eab3078bea
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/events/EventTarget.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/events/MouseEvent.class b/libjava/classpath/lib/org/w3c/dom/events/MouseEvent.class
new file mode 100644
index 00000000000..53e18a10bce
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/events/MouseEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/events/MutationEvent.class b/libjava/classpath/lib/org/w3c/dom/events/MutationEvent.class
new file mode 100644
index 00000000000..1c7d925c426
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/events/MutationEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/events/UIEvent.class b/libjava/classpath/lib/org/w3c/dom/events/UIEvent.class
new file mode 100644
index 00000000000..edbc0b9d287
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/events/UIEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLAnchorElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLAnchorElement.class
new file mode 100644
index 00000000000..d97d1a34d2d
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLAnchorElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLAppletElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLAppletElement.class
new file mode 100644
index 00000000000..902fc0375b0
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLAppletElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLAreaElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLAreaElement.class
new file mode 100644
index 00000000000..e98ef6caf7a
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLAreaElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLBRElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLBRElement.class
new file mode 100644
index 00000000000..4f79f902c23
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLBRElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLBaseElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLBaseElement.class
new file mode 100644
index 00000000000..4d88a303efc
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLBaseElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLBaseFontElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLBaseFontElement.class
new file mode 100644
index 00000000000..9425db7d5c0
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLBaseFontElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLBodyElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLBodyElement.class
new file mode 100644
index 00000000000..c24b897867a
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLBodyElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLButtonElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLButtonElement.class
new file mode 100644
index 00000000000..82cd95c7236
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLButtonElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLCollection.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLCollection.class
new file mode 100644
index 00000000000..198818a5ff0
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLCollection.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLDListElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLDListElement.class
new file mode 100644
index 00000000000..d119b0bbde1
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLDListElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLDirectoryElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLDirectoryElement.class
new file mode 100644
index 00000000000..8ac3813dd35
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLDirectoryElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLDivElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLDivElement.class
new file mode 100644
index 00000000000..b793b122f4d
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLDivElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLDocument.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLDocument.class
new file mode 100644
index 00000000000..6ab518cf259
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLDocument.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLElement.class
new file mode 100644
index 00000000000..5c685949e20
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLFieldSetElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLFieldSetElement.class
new file mode 100644
index 00000000000..60c8e114261
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLFieldSetElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLFontElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLFontElement.class
new file mode 100644
index 00000000000..041d133f901
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLFontElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLFormElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLFormElement.class
new file mode 100644
index 00000000000..6f0fc70f010
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLFormElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLFrameElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLFrameElement.class
new file mode 100644
index 00000000000..98027df47a8
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLFrameElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLFrameSetElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLFrameSetElement.class
new file mode 100644
index 00000000000..acb6eea3050
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLFrameSetElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLHRElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLHRElement.class
new file mode 100644
index 00000000000..cb369464934
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLHRElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLHeadElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLHeadElement.class
new file mode 100644
index 00000000000..4d1d9d27ef2
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLHeadElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLHeadingElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLHeadingElement.class
new file mode 100644
index 00000000000..7dec3e97ba1
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLHeadingElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLHtmlElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLHtmlElement.class
new file mode 100644
index 00000000000..b0d9f0b2b97
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLHtmlElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLIFrameElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLIFrameElement.class
new file mode 100644
index 00000000000..ad1f0ba2094
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLIFrameElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLImageElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLImageElement.class
new file mode 100644
index 00000000000..db3786aee06
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLImageElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLInputElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLInputElement.class
new file mode 100644
index 00000000000..45b2f2ab942
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLInputElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLIsIndexElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLIsIndexElement.class
new file mode 100644
index 00000000000..306ee6392e7
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLIsIndexElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLLIElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLLIElement.class
new file mode 100644
index 00000000000..e309abc009b
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLLIElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLLabelElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLLabelElement.class
new file mode 100644
index 00000000000..478882a400d
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLLabelElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLLegendElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLLegendElement.class
new file mode 100644
index 00000000000..ead0f416bd3
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLLegendElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLLinkElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLLinkElement.class
new file mode 100644
index 00000000000..58bc1f2181b
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLLinkElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLMapElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLMapElement.class
new file mode 100644
index 00000000000..dc90e7d09ca
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLMapElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLMenuElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLMenuElement.class
new file mode 100644
index 00000000000..72fff70987d
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLMenuElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLMetaElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLMetaElement.class
new file mode 100644
index 00000000000..303de700863
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLMetaElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLModElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLModElement.class
new file mode 100644
index 00000000000..ed36efb33ad
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLModElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLOListElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLOListElement.class
new file mode 100644
index 00000000000..a3d4e02ef6a
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLOListElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLObjectElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLObjectElement.class
new file mode 100644
index 00000000000..5e598bb3ed0
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLObjectElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLOptGroupElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLOptGroupElement.class
new file mode 100644
index 00000000000..f761f41e011
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLOptGroupElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLOptionElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLOptionElement.class
new file mode 100644
index 00000000000..c63938392e5
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLOptionElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLOptionsCollection.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLOptionsCollection.class
new file mode 100644
index 00000000000..ab3364ceb22
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLOptionsCollection.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLParagraphElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLParagraphElement.class
new file mode 100644
index 00000000000..4332a69860b
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLParagraphElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLParamElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLParamElement.class
new file mode 100644
index 00000000000..de95836211a
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLParamElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLPreElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLPreElement.class
new file mode 100644
index 00000000000..df42293b04a
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLPreElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLQuoteElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLQuoteElement.class
new file mode 100644
index 00000000000..5eb553fdb65
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLQuoteElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLScriptElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLScriptElement.class
new file mode 100644
index 00000000000..f7b8cab2bcc
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLScriptElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLSelectElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLSelectElement.class
new file mode 100644
index 00000000000..1e5820d0782
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLSelectElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLStyleElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLStyleElement.class
new file mode 100644
index 00000000000..4d63090ba30
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLStyleElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableCaptionElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableCaptionElement.class
new file mode 100644
index 00000000000..675127efb96
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableCaptionElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableCellElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableCellElement.class
new file mode 100644
index 00000000000..2dc70df30c5
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableCellElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableColElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableColElement.class
new file mode 100644
index 00000000000..56a2f824438
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableColElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableElement.class
new file mode 100644
index 00000000000..ffdb2320cf7
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableRowElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableRowElement.class
new file mode 100644
index 00000000000..37e60fcf2ce
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableRowElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableSectionElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableSectionElement.class
new file mode 100644
index 00000000000..0777a90b216
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTableSectionElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLTextAreaElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTextAreaElement.class
new file mode 100644
index 00000000000..0b11d084e1e
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTextAreaElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLTitleElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTitleElement.class
new file mode 100644
index 00000000000..19898ab8645
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLTitleElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/html2/HTMLUListElement.class b/libjava/classpath/lib/org/w3c/dom/html2/HTMLUListElement.class
new file mode 100644
index 00000000000..4b02b5f4738
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/html2/HTMLUListElement.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ls/DOMImplementationLS.class b/libjava/classpath/lib/org/w3c/dom/ls/DOMImplementationLS.class
new file mode 100644
index 00000000000..2b5479c87e3
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ls/DOMImplementationLS.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ls/LSException.class b/libjava/classpath/lib/org/w3c/dom/ls/LSException.class
new file mode 100644
index 00000000000..7f64d601cb8
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ls/LSException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ls/LSInput.class b/libjava/classpath/lib/org/w3c/dom/ls/LSInput.class
new file mode 100644
index 00000000000..b778c121062
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ls/LSInput.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ls/LSLoadEvent.class b/libjava/classpath/lib/org/w3c/dom/ls/LSLoadEvent.class
new file mode 100644
index 00000000000..ae45f85c154
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ls/LSLoadEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ls/LSOutput.class b/libjava/classpath/lib/org/w3c/dom/ls/LSOutput.class
new file mode 100644
index 00000000000..2fb4be066c1
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ls/LSOutput.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ls/LSParser.class b/libjava/classpath/lib/org/w3c/dom/ls/LSParser.class
new file mode 100644
index 00000000000..c12315558c4
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ls/LSParser.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ls/LSParserFilter.class b/libjava/classpath/lib/org/w3c/dom/ls/LSParserFilter.class
new file mode 100644
index 00000000000..28edfdcdd3f
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ls/LSParserFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ls/LSProgressEvent.class b/libjava/classpath/lib/org/w3c/dom/ls/LSProgressEvent.class
new file mode 100644
index 00000000000..5986f976f59
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ls/LSProgressEvent.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ls/LSResourceResolver.class b/libjava/classpath/lib/org/w3c/dom/ls/LSResourceResolver.class
new file mode 100644
index 00000000000..7b9f77b971a
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ls/LSResourceResolver.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ls/LSSerializer.class b/libjava/classpath/lib/org/w3c/dom/ls/LSSerializer.class
new file mode 100644
index 00000000000..05753be6055
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ls/LSSerializer.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ls/LSSerializerFilter.class b/libjava/classpath/lib/org/w3c/dom/ls/LSSerializerFilter.class
new file mode 100644
index 00000000000..b3aeaecdbec
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ls/LSSerializerFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ranges/DocumentRange.class b/libjava/classpath/lib/org/w3c/dom/ranges/DocumentRange.class
new file mode 100644
index 00000000000..fcf542e9b17
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ranges/DocumentRange.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ranges/Range.class b/libjava/classpath/lib/org/w3c/dom/ranges/Range.class
new file mode 100644
index 00000000000..a8604967a09
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ranges/Range.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/ranges/RangeException.class b/libjava/classpath/lib/org/w3c/dom/ranges/RangeException.class
new file mode 100644
index 00000000000..fa743a0d031
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/ranges/RangeException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/stylesheets/DocumentStyle.class b/libjava/classpath/lib/org/w3c/dom/stylesheets/DocumentStyle.class
new file mode 100644
index 00000000000..6d13a349230
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/stylesheets/DocumentStyle.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/stylesheets/LinkStyle.class b/libjava/classpath/lib/org/w3c/dom/stylesheets/LinkStyle.class
new file mode 100644
index 00000000000..00082f811b5
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/stylesheets/LinkStyle.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/stylesheets/MediaList.class b/libjava/classpath/lib/org/w3c/dom/stylesheets/MediaList.class
new file mode 100644
index 00000000000..eb06e5d25f8
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/stylesheets/MediaList.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/stylesheets/StyleSheet.class b/libjava/classpath/lib/org/w3c/dom/stylesheets/StyleSheet.class
new file mode 100644
index 00000000000..f3a6907d6b5
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/stylesheets/StyleSheet.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/stylesheets/StyleSheetList.class b/libjava/classpath/lib/org/w3c/dom/stylesheets/StyleSheetList.class
new file mode 100644
index 00000000000..f1ce31002a5
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/stylesheets/StyleSheetList.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/traversal/DocumentTraversal.class b/libjava/classpath/lib/org/w3c/dom/traversal/DocumentTraversal.class
new file mode 100644
index 00000000000..fb9b6381070
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/traversal/DocumentTraversal.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/traversal/NodeFilter.class b/libjava/classpath/lib/org/w3c/dom/traversal/NodeFilter.class
new file mode 100644
index 00000000000..ae2acdab7ac
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/traversal/NodeFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/traversal/NodeIterator.class b/libjava/classpath/lib/org/w3c/dom/traversal/NodeIterator.class
new file mode 100644
index 00000000000..fa0265be9f7
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/traversal/NodeIterator.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/traversal/TreeWalker.class b/libjava/classpath/lib/org/w3c/dom/traversal/TreeWalker.class
new file mode 100644
index 00000000000..08bdbea5135
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/traversal/TreeWalker.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/views/AbstractView.class b/libjava/classpath/lib/org/w3c/dom/views/AbstractView.class
new file mode 100644
index 00000000000..fc2f1fe053c
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/views/AbstractView.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/views/DocumentView.class b/libjava/classpath/lib/org/w3c/dom/views/DocumentView.class
new file mode 100644
index 00000000000..013d1716187
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/views/DocumentView.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/xpath/XPathEvaluator.class b/libjava/classpath/lib/org/w3c/dom/xpath/XPathEvaluator.class
new file mode 100644
index 00000000000..4999764b45b
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/xpath/XPathEvaluator.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/xpath/XPathException.class b/libjava/classpath/lib/org/w3c/dom/xpath/XPathException.class
new file mode 100644
index 00000000000..36379cb6ddf
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/xpath/XPathException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/xpath/XPathExpression.class b/libjava/classpath/lib/org/w3c/dom/xpath/XPathExpression.class
new file mode 100644
index 00000000000..097ab47a189
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/xpath/XPathExpression.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/xpath/XPathNSResolver.class b/libjava/classpath/lib/org/w3c/dom/xpath/XPathNSResolver.class
new file mode 100644
index 00000000000..cd69c3824f5
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/xpath/XPathNSResolver.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/xpath/XPathNamespace.class b/libjava/classpath/lib/org/w3c/dom/xpath/XPathNamespace.class
new file mode 100644
index 00000000000..b8d710461ef
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/xpath/XPathNamespace.class
Binary files differ
diff --git a/libjava/classpath/lib/org/w3c/dom/xpath/XPathResult.class b/libjava/classpath/lib/org/w3c/dom/xpath/XPathResult.class
new file mode 100644
index 00000000000..4693afcf192
--- /dev/null
+++ b/libjava/classpath/lib/org/w3c/dom/xpath/XPathResult.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/AttributeList.class b/libjava/classpath/lib/org/xml/sax/AttributeList.class
new file mode 100644
index 00000000000..d91b8884d60
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/AttributeList.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/Attributes.class b/libjava/classpath/lib/org/xml/sax/Attributes.class
new file mode 100644
index 00000000000..4459cfece7e
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/Attributes.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/ContentHandler.class b/libjava/classpath/lib/org/xml/sax/ContentHandler.class
new file mode 100644
index 00000000000..79234c195c5
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/ContentHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/DTDHandler.class b/libjava/classpath/lib/org/xml/sax/DTDHandler.class
new file mode 100644
index 00000000000..fca2bbabd4a
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/DTDHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/DocumentHandler.class b/libjava/classpath/lib/org/xml/sax/DocumentHandler.class
new file mode 100644
index 00000000000..9db19d0ede5
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/DocumentHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/EntityResolver.class b/libjava/classpath/lib/org/xml/sax/EntityResolver.class
new file mode 100644
index 00000000000..1a9f63264aa
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/EntityResolver.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/ErrorHandler.class b/libjava/classpath/lib/org/xml/sax/ErrorHandler.class
new file mode 100644
index 00000000000..5a1c6555353
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/ErrorHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/HandlerBase.class b/libjava/classpath/lib/org/xml/sax/HandlerBase.class
new file mode 100644
index 00000000000..555e6c51348
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/HandlerBase.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/InputSource.class b/libjava/classpath/lib/org/xml/sax/InputSource.class
new file mode 100644
index 00000000000..799b3116673
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/InputSource.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/Locator.class b/libjava/classpath/lib/org/xml/sax/Locator.class
new file mode 100644
index 00000000000..2f415ee4804
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/Locator.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/Parser.class b/libjava/classpath/lib/org/xml/sax/Parser.class
new file mode 100644
index 00000000000..e644bf5416c
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/Parser.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/SAXException.class b/libjava/classpath/lib/org/xml/sax/SAXException.class
new file mode 100644
index 00000000000..282aa37a784
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/SAXException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/SAXNotRecognizedException.class b/libjava/classpath/lib/org/xml/sax/SAXNotRecognizedException.class
new file mode 100644
index 00000000000..26692ef3bd7
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/SAXNotRecognizedException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/SAXNotSupportedException.class b/libjava/classpath/lib/org/xml/sax/SAXNotSupportedException.class
new file mode 100644
index 00000000000..c6fbe767135
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/SAXNotSupportedException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/SAXParseException.class b/libjava/classpath/lib/org/xml/sax/SAXParseException.class
new file mode 100644
index 00000000000..2e9400ca5bf
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/SAXParseException.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/XMLFilter.class b/libjava/classpath/lib/org/xml/sax/XMLFilter.class
new file mode 100644
index 00000000000..91ce7d99acb
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/XMLFilter.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/XMLReader.class b/libjava/classpath/lib/org/xml/sax/XMLReader.class
new file mode 100644
index 00000000000..b4c86d60780
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/XMLReader.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/ext/Attributes2.class b/libjava/classpath/lib/org/xml/sax/ext/Attributes2.class
new file mode 100644
index 00000000000..d531eda55f8
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/ext/Attributes2.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/ext/Attributes2Impl.class b/libjava/classpath/lib/org/xml/sax/ext/Attributes2Impl.class
new file mode 100644
index 00000000000..5ce82fc1584
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/ext/Attributes2Impl.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/ext/DeclHandler.class b/libjava/classpath/lib/org/xml/sax/ext/DeclHandler.class
new file mode 100644
index 00000000000..a5d9286e847
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/ext/DeclHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/ext/DefaultHandler2.class b/libjava/classpath/lib/org/xml/sax/ext/DefaultHandler2.class
new file mode 100644
index 00000000000..72cbdde85b3
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/ext/DefaultHandler2.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/ext/EntityResolver2.class b/libjava/classpath/lib/org/xml/sax/ext/EntityResolver2.class
new file mode 100644
index 00000000000..5b5501339ec
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/ext/EntityResolver2.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/ext/LexicalHandler.class b/libjava/classpath/lib/org/xml/sax/ext/LexicalHandler.class
new file mode 100644
index 00000000000..a51f26074ac
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/ext/LexicalHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/ext/Locator2.class b/libjava/classpath/lib/org/xml/sax/ext/Locator2.class
new file mode 100644
index 00000000000..4e64eb1482b
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/ext/Locator2.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/ext/Locator2Impl.class b/libjava/classpath/lib/org/xml/sax/ext/Locator2Impl.class
new file mode 100644
index 00000000000..f6cc7ae9529
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/ext/Locator2Impl.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/helpers/AttributeListImpl.class b/libjava/classpath/lib/org/xml/sax/helpers/AttributeListImpl.class
new file mode 100644
index 00000000000..01caf28e19d
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/helpers/AttributeListImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/helpers/AttributesImpl.class b/libjava/classpath/lib/org/xml/sax/helpers/AttributesImpl.class
new file mode 100644
index 00000000000..c67bff4b2c4
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/helpers/AttributesImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/helpers/DefaultHandler.class b/libjava/classpath/lib/org/xml/sax/helpers/DefaultHandler.class
new file mode 100644
index 00000000000..6a4967942f9
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/helpers/DefaultHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/helpers/LocatorImpl.class b/libjava/classpath/lib/org/xml/sax/helpers/LocatorImpl.class
new file mode 100644
index 00000000000..0f54ec0b325
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/helpers/LocatorImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/helpers/NamespaceSupport$Context.class b/libjava/classpath/lib/org/xml/sax/helpers/NamespaceSupport$Context.class
new file mode 100644
index 00000000000..f109d720624
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/helpers/NamespaceSupport$Context.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/helpers/NamespaceSupport.class b/libjava/classpath/lib/org/xml/sax/helpers/NamespaceSupport.class
new file mode 100644
index 00000000000..3bd96a4e7f6
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/helpers/NamespaceSupport.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/helpers/NewInstance.class b/libjava/classpath/lib/org/xml/sax/helpers/NewInstance.class
new file mode 100644
index 00000000000..9fa91f989ec
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/helpers/NewInstance.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/helpers/ParserAdapter$AttributeListAdapter.class b/libjava/classpath/lib/org/xml/sax/helpers/ParserAdapter$AttributeListAdapter.class
new file mode 100644
index 00000000000..5bc24d02679
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/helpers/ParserAdapter$AttributeListAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/helpers/ParserAdapter.class b/libjava/classpath/lib/org/xml/sax/helpers/ParserAdapter.class
new file mode 100644
index 00000000000..cceb560dcec
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/helpers/ParserAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/helpers/ParserFactory.class b/libjava/classpath/lib/org/xml/sax/helpers/ParserFactory.class
new file mode 100644
index 00000000000..ace29cbf024
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/helpers/ParserFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/helpers/XMLFilterImpl.class b/libjava/classpath/lib/org/xml/sax/helpers/XMLFilterImpl.class
new file mode 100644
index 00000000000..992aa341049
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/helpers/XMLFilterImpl.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/helpers/XMLReaderAdapter$AttributesAdapter.class b/libjava/classpath/lib/org/xml/sax/helpers/XMLReaderAdapter$AttributesAdapter.class
new file mode 100644
index 00000000000..5bcb439192d
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/helpers/XMLReaderAdapter$AttributesAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/helpers/XMLReaderAdapter.class b/libjava/classpath/lib/org/xml/sax/helpers/XMLReaderAdapter.class
new file mode 100644
index 00000000000..bd879f36543
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/helpers/XMLReaderAdapter.class
Binary files differ
diff --git a/libjava/classpath/lib/org/xml/sax/helpers/XMLReaderFactory.class b/libjava/classpath/lib/org/xml/sax/helpers/XMLReaderFactory.class
new file mode 100644
index 00000000000..25c986c9b91
--- /dev/null
+++ b/libjava/classpath/lib/org/xml/sax/helpers/XMLReaderFactory.class
Binary files differ
diff --git a/libjava/classpath/lib/standard.omit b/libjava/classpath/lib/standard.omit
deleted file mode 100644
index 11d05c78161..00000000000
--- a/libjava/classpath/lib/standard.omit
+++ /dev/null
@@ -1,2 +0,0 @@
-gnu/test/.*java$
-gnu/java/awt/peer/x/.*java$
diff --git a/libjava/classpath/lib/sun/misc/Service.class b/libjava/classpath/lib/sun/misc/Service.class
new file mode 100644
index 00000000000..09dc5f56fc4
--- /dev/null
+++ b/libjava/classpath/lib/sun/misc/Service.class
Binary files differ
diff --git a/libjava/classpath/lib/sun/misc/ServiceConfigurationError.class b/libjava/classpath/lib/sun/misc/ServiceConfigurationError.class
new file mode 100644
index 00000000000..30d7fed7c49
--- /dev/null
+++ b/libjava/classpath/lib/sun/misc/ServiceConfigurationError.class
Binary files differ
diff --git a/libjava/classpath/lib/sun/misc/Unsafe.class b/libjava/classpath/lib/sun/misc/Unsafe.class
new file mode 100644
index 00000000000..809f9b23a7c
--- /dev/null
+++ b/libjava/classpath/lib/sun/misc/Unsafe.class
Binary files differ
diff --git a/libjava/classpath/lib/sun/reflect/Reflection.class b/libjava/classpath/lib/sun/reflect/Reflection.class
new file mode 100644
index 00000000000..fb6c0c7206a
--- /dev/null
+++ b/libjava/classpath/lib/sun/reflect/Reflection.class
Binary files differ
diff --git a/libjava/classpath/lib/sun/reflect/annotation/AnnotationInvocationHandler.class b/libjava/classpath/lib/sun/reflect/annotation/AnnotationInvocationHandler.class
new file mode 100644
index 00000000000..e70c2bbcd7b
--- /dev/null
+++ b/libjava/classpath/lib/sun/reflect/annotation/AnnotationInvocationHandler.class
Binary files differ
diff --git a/libjava/classpath/lib/sun/reflect/annotation/AnnotationParser.class b/libjava/classpath/lib/sun/reflect/annotation/AnnotationParser.class
new file mode 100644
index 00000000000..b86052c9d11
--- /dev/null
+++ b/libjava/classpath/lib/sun/reflect/annotation/AnnotationParser.class
Binary files differ
diff --git a/libjava/classpath/lib/sun/reflect/annotation/AnnotationType.class b/libjava/classpath/lib/sun/reflect/annotation/AnnotationType.class
new file mode 100644
index 00000000000..3f7ee0bbdce
--- /dev/null
+++ b/libjava/classpath/lib/sun/reflect/annotation/AnnotationType.class
Binary files differ
diff --git a/libjava/classpath/lib/sun/reflect/annotation/EnumConstantNotPresentExceptionProxy.class b/libjava/classpath/lib/sun/reflect/annotation/EnumConstantNotPresentExceptionProxy.class
new file mode 100644
index 00000000000..31adaf53825
--- /dev/null
+++ b/libjava/classpath/lib/sun/reflect/annotation/EnumConstantNotPresentExceptionProxy.class
Binary files differ
diff --git a/libjava/classpath/lib/sun/reflect/annotation/ExceptionProxy.class b/libjava/classpath/lib/sun/reflect/annotation/ExceptionProxy.class
new file mode 100644
index 00000000000..7773618aacd
--- /dev/null
+++ b/libjava/classpath/lib/sun/reflect/annotation/ExceptionProxy.class
Binary files differ
diff --git a/libjava/classpath/lib/sun/reflect/misc/ReflectUtil$MustBeNull.class b/libjava/classpath/lib/sun/reflect/misc/ReflectUtil$MustBeNull.class
new file mode 100644
index 00000000000..a588d8ca5ec
--- /dev/null
+++ b/libjava/classpath/lib/sun/reflect/misc/ReflectUtil$MustBeNull.class
Binary files differ
diff --git a/libjava/classpath/lib/sun/reflect/misc/ReflectUtil.class b/libjava/classpath/lib/sun/reflect/misc/ReflectUtil.class
new file mode 100644
index 00000000000..428a0c110cb
--- /dev/null
+++ b/libjava/classpath/lib/sun/reflect/misc/ReflectUtil.class
Binary files differ
diff --git a/libjava/classpath/ltconfig b/libjava/classpath/ltconfig
index 839b980fdb2..b00e0efc232 100755
--- a/libjava/classpath/ltconfig
+++ b/libjava/classpath/ltconfig
@@ -626,7 +626,7 @@ old_postuninstall_cmds=
if test -n "$RANLIB"; then
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
- old_postinstall_cmds="~$old_postinstall_cmds~\$RANLIB \$oldlib"
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
fi
# Source the script associated with the $tagname tag configuration.
diff --git a/libjava/classpath/ltmain.sh b/libjava/classpath/ltmain.sh
index a3c55f9a751..219823fc45d 100644
--- a/libjava/classpath/ltmain.sh
+++ b/libjava/classpath/ltmain.sh
@@ -3839,13 +3839,7 @@ extern \"C\" {
fi
# Try sorting and uniquifying the output.
- if grep -v "^: " < "$nlist" |
- if sort -k 3 </dev/null >/dev/null 2>&1; then
- sort -k 3
- else
- sort +2
- fi |
- uniq > "$nlist"S; then
+ if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
:
else
grep -v "^: " < "$nlist" > "$nlist"S
diff --git a/libjava/classpath/m4/acinclude.m4 b/libjava/classpath/m4/acinclude.m4
index ca1af929b1d..ead0090b4ba 100644
--- a/libjava/classpath/m4/acinclude.m4
+++ b/libjava/classpath/m4/acinclude.m4
@@ -458,16 +458,3 @@ AC_DEFUN([CLASSPATH_CHECK_ECJ],
AC_PATH_PROG(ECJ, "ecj")
fi
])
-
-dnl -----------------------------------------------------------
-dnl GCJ LOCAL: Calculate toolexeclibdir
-dnl -----------------------------------------------------------
-AC_DEFUN([CLASSPATH_TOOLEXECLIBDIR],
-[
- multi_os_directory=`$CC -print-multi-os-directory`
- case $multi_os_directory in
- .) toolexeclibdir=${libdir} ;; # Avoid trailing /.
- *) toolexeclibdir=${libdir}/${multi_os_directory} ;;
- esac
- AC_SUBST(toolexeclibdir)
-])
diff --git a/libjava/classpath/m4/gcc_attribute.m4 b/libjava/classpath/m4/gcc_attribute.m4
new file mode 100644
index 00000000000..f0c25722b8e
--- /dev/null
+++ b/libjava/classpath/m4/gcc_attribute.m4
@@ -0,0 +1,133 @@
+dnl CACHED_TRY_COMPILE(<description>,<cachevar>,<include>,<program>,<ifyes>,<ifno>)
+AC_DEFUN([CACHED_TRY_COMPILE],[
+ AC_MSG_CHECKING($1)
+ AC_CACHE_VAL($2,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$3]], [[$4]])],[$2=yes],[$2=no])
+ ])
+ if test "x$$2" = xyes; then
+ true
+ $5
+ else
+ true
+ $6
+ fi
+])
+
+dnl GCC_ATTRIBUTE(<short-label>,<cachevar>,<func-params>,<attribute>,<HAVE>,<desc>,[<true-cmds>],[<false-cmds>])
+AC_DEFUN([GCC_ATTRIBUTE],[
+ CACHED_TRY_COMPILE(__attribute__(($1)),cv_c_gcc_attribute_$2,,
+ [extern int testfunction($3) __attribute__(($4))],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GNUC25_$5,,$6)
+ $7,
+ AC_MSG_RESULT(no)
+ $8)
+])
+
+
+AC_DEFUN([GCC_ATTRIBUTE_SUPPORTED],[
+ GCC_ATTRIBUTE([,,],supported,[int x],[,,],ATTRIB,[Define if function attributes a la GCC 2.5 and higher are available.])
+ AH_BOTTOM([/* GNU C attributes. */
+#ifndef FUNCATTR
+#ifdef HAVE_GNUC25_ATTRIB
+#define FUNCATTR(x) __attribute__(x)
+#else
+#define FUNCATTR(x)
+#endif
+#endif])
+
+])
+AC_DEFUN([GCC_ATTRIBUTE_CONST],[
+ AC_REQUIRE([GCC_ATTRIBUTE_SUPPORTED])
+ GCC_ATTRIBUTE(const,const,[int x],const,CONST,[Define if constant functions a la GCC 2.5 and higher are available.])
+ AH_BOTTOM([/* GNU C constant functions, or null. */
+#ifndef ATTRCONST
+#ifdef HAVE_GNUC25_CONST
+#define ATTRCONST const
+#else
+#define ATTRCONST
+#endif
+#endif
+#ifndef CONSTANT
+#define CONSTANT FUNCATTR((ATTRCONST))
+#endif])
+])
+AC_DEFUN([GCC_ATTRIBUTE_NORETURN],[
+ AC_REQUIRE([GCC_ATTRIBUTE_SUPPORTED])
+ GCC_ATTRIBUTE(noreturn,noreturn,[int x],noreturn,NORETURN,[Define if nonreturning functions a la GCC 2.5 and higher are available.])
+ AH_BOTTOM([/* GNU C nonreturning functions, or null. */
+#ifndef ATTRNORETURN
+#ifdef HAVE_GNUC25_NORETURN
+#define ATTRNORETURN noreturn
+#else /* ! HAVE_GNUC25_NORETURN */
+#define ATTRNORETURN
+#endif /* HAVE_GNUC25_NORETURN */
+#endif /* ATTRNORETURN */
+#ifndef NONRETURNING
+#define NONRETURNING FUNCATTR((ATTRNORETURN))
+#endif /* NONRETURNING */])
+])
+AC_DEFUN([GCC_ATTRIBUTE_UNUSED],[
+ AC_REQUIRE([GCC_ATTRIBUTE_SUPPORTED])
+ GCC_ATTRIBUTE(unused,unused,[int x],unused,UNUSED,[Define if unused variables la GCC 2.5 and higher are available.])
+ AH_BOTTOM([/* GNU C unused functions, or null. */
+#ifndef ATTRUNUSED
+#ifdef HAVE_GNUC25_UNUSED
+#define ATTRUNUSED unused
+#else
+#define ATTRUNUSED
+#endif
+#endif
+#ifndef UNUSED
+#define UNUSED FUNCATTR((ATTRUNUSED))
+#endif])
+])
+AC_DEFUN([GCC_ATTRIBUTE_FORMAT],[
+ AC_REQUIRE([GCC_ATTRIBUTE_SUPPORTED])
+ GCC_ATTRIBUTE(format...,format,[char *y, ...],[format(printf,1,2)],PRINTFFORMAT,[Define if printf-format argument lists a la GCC are available.])
+ AH_BOTTOM([/* GNU C printf formats, or null. */
+#ifndef ATTRPRINTF
+#ifdef HAVE_GNUC25_PRINTFFORMAT
+#define ATTRPRINTF(si,tc) format(printf,si,tc)
+#else
+#define ATTRPRINTF(si,tc)
+#endif
+#endif
+#ifndef PRINTFFORMAT
+#define PRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc)))
+#endif
+
+#ifndef NONRETURNPRINTFFORMAT
+#define NONRETURNPRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc),ATTRNORETURN))
+#endif])
+])
+AC_DEFUN([GCC_ATTRIBUTE_ALWAYS_INLINE],[
+ AC_REQUIRE([GCC_ATTRIBUTE_SUPPORTED])
+ GCC_ATTRIBUTE(always_inline,always_inline,[int x],always_inline,ALWAYS_INLINE,[Define if unconditional inlining of functions a la GCC 3.1 and higher are available.])
+ AH_BOTTOM([/* GNU C constant functions, or null. */
+#ifndef ATTRALWAYS_INLINE
+#ifdef HAVE_GNUC25_ALWAYS_INLINE
+#define ATTRALWAYS_INLINE always_inline
+#else
+#define ATTRALWAYS_INLINE
+#endif
+#endif
+#ifndef ALWAYS_INLINE
+#define ALWAYS_INLINE FUNCATTR((ATTRALWAYS_INLINE))
+#endif])
+])
+AC_DEFUN([GCC_ATTRIBUTE_PACKED],[
+ AC_REQUIRE([GCC_ATTRIBUTE_SUPPORTED])
+ GCC_ATTRIBUTE(packed,packed,[int x],packed,PACKED,[Define if packing of struct members a la GCC 2.5 and higher is available.])
+ AH_BOTTOM([/* GNU C constant functions, or null. */
+#ifndef ATTRPACKED
+#ifdef HAVE_GNUC25_PACKED
+#define ATTRPACKED packed
+#else
+#define ATTRPACKED
+#endif
+#endif
+#ifndef PACKED
+#define PACKED FUNCATTR((ATTRPACKED))
+#endif])
+])
diff --git a/libjava/classpath/native/.cvsignore b/libjava/classpath/native/.cvsignore
new file mode 100644
index 00000000000..e9f2658a694
--- /dev/null
+++ b/libjava/classpath/native/.cvsignore
@@ -0,0 +1,8 @@
+*.o
+*.a
+*.lo
+*.la
+.libs
+.deps
+Makefile
+Makefile.in
diff --git a/libjava/classpath/native/Makefile.am b/libjava/classpath/native/Makefile.am
index 25aa364d111..89b859eb7e9 100644
--- a/libjava/classpath/native/Makefile.am
+++ b/libjava/classpath/native/Makefile.am
@@ -12,6 +12,6 @@ if CREATE_PLUGIN
PLUGINDIR = plugin
endif
-SUBDIRS = fdlibm $(JNIDIR) $(JAWTDIR) $(PLUGINDIR) target
-DIST_SUBDIRS = fdlibm jni jawt plugin target
+SUBDIRS = fdlibm $(JNIDIR) $(JAWTDIR) $(PLUGINDIR)
+DIST_SUBDIRS = fdlibm jni jawt plugin
diff --git a/libjava/classpath/native/Makefile.in b/libjava/classpath/native/Makefile.in
index 73dd32becf5..907b847e82b 100644
--- a/libjava/classpath/native/Makefile.in
+++ b/libjava/classpath/native/Makefile.in
@@ -41,12 +41,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -165,6 +167,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -286,13 +290,12 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
@CREATE_JNI_LIBRARIES_TRUE@JNIDIR = jni
@CREATE_GTK_PEER_LIBRARIES_TRUE@JAWTDIR = jawt
@CREATE_PLUGIN_TRUE@PLUGINDIR = plugin
-SUBDIRS = fdlibm $(JNIDIR) $(JAWTDIR) $(PLUGINDIR) target
-DIST_SUBDIRS = fdlibm jni jawt plugin target
+SUBDIRS = fdlibm $(JNIDIR) $(JAWTDIR) $(PLUGINDIR)
+DIST_SUBDIRS = fdlibm jni jawt plugin
all: all-recursive
.SUFFIXES:
diff --git a/libjava/classpath/native/fdlibm/.cvsignore b/libjava/classpath/native/fdlibm/.cvsignore
new file mode 100644
index 00000000000..e9f2658a694
--- /dev/null
+++ b/libjava/classpath/native/fdlibm/.cvsignore
@@ -0,0 +1,8 @@
+*.o
+*.a
+*.lo
+*.la
+.libs
+.deps
+Makefile
+Makefile.in
diff --git a/libjava/classpath/native/fdlibm/Makefile.in b/libjava/classpath/native/fdlibm/Makefile.in
index cbd990ebb6b..48238aef59a 100644
--- a/libjava/classpath/native/fdlibm/Makefile.in
+++ b/libjava/classpath/native/fdlibm/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -184,6 +186,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -305,7 +309,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
noinst_LTLIBRARIES = libfdlibm.la
libfdlibm_la_SOURCES = \
diff --git a/libjava/classpath/native/fdlibm/mprec.h b/libjava/classpath/native/fdlibm/mprec.h
index 7c7471bc8a9..0efa2d98904 100644
--- a/libjava/classpath/native/fdlibm/mprec.h
+++ b/libjava/classpath/native/fdlibm/mprec.h
@@ -100,7 +100,7 @@ union double_union
* An alternative that might be better on some machines is
* #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff)
*/
-#if defined(IEEE_8087) + defined(VAX)
+#if defined(__IEEE_BYTES_LITTLE_ENDIAN) + defined(IEEE_8087) + defined(VAX)
#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \
((unsigned short *)a)[0] = (unsigned short)c, a++)
#else
diff --git a/libjava/classpath/native/jawt/Makefile.am b/libjava/classpath/native/jawt/Makefile.am
index c81e754297f..8d90352ed7d 100644
--- a/libjava/classpath/native/jawt/Makefile.am
+++ b/libjava/classpath/native/jawt/Makefile.am
@@ -1,8 +1,17 @@
-nativeexeclib_LTLIBRARIES = libjawt.la
+## GCJ LOCAL: install this library in GCJ's versioned library
+## directory
+gcc_version := $(shell cat $(top_srcdir)/../../gcc/BASE-VER)
+gcjversionedlibdir = $(libdir)/gcj-$(gcc_version)
+gcjversionedlib_LTLIBRARIES = libjawt.la
libjawt_la_SOURCES = jawt.c
libjawt_la_LIBADD = $(top_builddir)/native/jni/gtk-peer/libgtkpeer.la
-libjawt_la_LDFLAGS = -avoid-version
+## FIXME?
+## libjawt_la_LDFLAGS = -avoid-version
+
+## GCJ LOCAL: encode the library path and use GCJ's library version
+libjawt_la_LDFLAGS = -rpath $(gcjversionedlibdir) \
+ -version-info `grep -v '^\#' $(top_srcdir)/../libtool-version`
AM_LDFLAGS = @CLASSPATH_MODULE@ @GTK_LIBS@ @PANGOFT2_LIBS@ @X_LIBS@ @XTEST_LIBS@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
diff --git a/libjava/classpath/native/jawt/Makefile.in b/libjava/classpath/native/jawt/Makefile.in
index 77b45d73155..8cf2873696d 100644
--- a/libjava/classpath/native/jawt/Makefile.in
+++ b/libjava/classpath/native/jawt/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -59,9 +61,9 @@ am__vpath_adj = case $$p in \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(nativeexeclibdir)"
-nativeexeclibLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(nativeexeclib_LTLIBRARIES)
+am__installdirs = "$(DESTDIR)$(gcjversionedlibdir)"
+gcjversionedlibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(gcjversionedlib_LTLIBRARIES)
libjawt_la_DEPENDENCIES = \
$(top_builddir)/native/jni/gtk-peer/libgtkpeer.la
am_libjawt_la_OBJECTS = jawt.lo
@@ -184,6 +186,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -305,12 +309,15 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
-nativeexeclib_LTLIBRARIES = libjawt.la
+gcc_version := $(shell cat $(top_srcdir)/../../gcc/BASE-VER)
+gcjversionedlibdir = $(libdir)/gcj-$(gcc_version)
+gcjversionedlib_LTLIBRARIES = libjawt.la
libjawt_la_SOURCES = jawt.c
libjawt_la_LIBADD = $(top_builddir)/native/jni/gtk-peer/libgtkpeer.la
-libjawt_la_LDFLAGS = -avoid-version
+libjawt_la_LDFLAGS = -rpath $(gcjversionedlibdir) \
+ -version-info `grep -v '^\#' $(top_srcdir)/../libtool-version`
+
AM_LDFLAGS = @CLASSPATH_MODULE@ @GTK_LIBS@ @PANGOFT2_LIBS@ @X_LIBS@ @XTEST_LIBS@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
@@ -352,35 +359,35 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-install-nativeexeclibLTLIBRARIES: $(nativeexeclib_LTLIBRARIES)
+install-gcjversionedlibLTLIBRARIES: $(gcjversionedlib_LTLIBRARIES)
@$(NORMAL_INSTALL)
- test -z "$(nativeexeclibdir)" || $(mkdir_p) "$(DESTDIR)$(nativeexeclibdir)"
- @list='$(nativeexeclib_LTLIBRARIES)'; for p in $$list; do \
+ test -z "$(gcjversionedlibdir)" || $(mkdir_p) "$(DESTDIR)$(gcjversionedlibdir)"
+ @list='$(gcjversionedlib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=install $(nativeexeclibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(nativeexeclibdir)/$$f'"; \
- $(LIBTOOL) --mode=install $(nativeexeclibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(nativeexeclibdir)/$$f"; \
+ echo " $(LIBTOOL) --mode=install $(gcjversionedlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(gcjversionedlibdir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(gcjversionedlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(gcjversionedlibdir)/$$f"; \
else :; fi; \
done
-uninstall-nativeexeclibLTLIBRARIES:
+uninstall-gcjversionedlibLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- @set -x; list='$(nativeexeclib_LTLIBRARIES)'; for p in $$list; do \
+ @set -x; list='$(gcjversionedlib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(nativeexeclibdir)/$$p'"; \
- $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(nativeexeclibdir)/$$p"; \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(gcjversionedlibdir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(gcjversionedlibdir)/$$p"; \
done
-clean-nativeexeclibLTLIBRARIES:
- -test -z "$(nativeexeclib_LTLIBRARIES)" || rm -f $(nativeexeclib_LTLIBRARIES)
- @list='$(nativeexeclib_LTLIBRARIES)'; for p in $$list; do \
+clean-gcjversionedlibLTLIBRARIES:
+ -test -z "$(gcjversionedlib_LTLIBRARIES)" || rm -f $(gcjversionedlib_LTLIBRARIES)
+ @list='$(gcjversionedlib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libjawt.la: $(libjawt_la_OBJECTS) $(libjawt_la_DEPENDENCIES)
- $(LINK) -rpath $(nativeexeclibdir) $(libjawt_la_LDFLAGS) $(libjawt_la_OBJECTS) $(libjawt_la_LIBADD) $(LIBS)
+ $(LINK) -rpath $(gcjversionedlibdir) $(libjawt_la_LDFLAGS) $(libjawt_la_OBJECTS) $(libjawt_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -500,7 +507,7 @@ check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
- for dir in "$(DESTDIR)$(nativeexeclibdir)"; do \
+ for dir in "$(DESTDIR)$(gcjversionedlibdir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
@@ -529,7 +536,7 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
-clean-am: clean-generic clean-libtool clean-nativeexeclibLTLIBRARIES \
+clean-am: clean-gcjversionedlibLTLIBRARIES clean-generic clean-libtool \
mostlyclean-am
distclean: distclean-am
@@ -548,9 +555,9 @@ info: info-am
info-am:
-install-data-am:
+install-data-am: install-gcjversionedlibLTLIBRARIES
-install-exec-am: install-nativeexeclibLTLIBRARIES
+install-exec-am:
install-info: install-info-am
@@ -576,20 +583,21 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am uninstall-nativeexeclibLTLIBRARIES
+uninstall-am: uninstall-gcjversionedlibLTLIBRARIES uninstall-info-am
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-nativeexeclibLTLIBRARIES ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am install-man \
- install-nativeexeclibLTLIBRARIES install-strip installcheck \
+.PHONY: CTAGS GTAGS all all-am check check-am clean \
+ clean-gcjversionedlibLTLIBRARIES clean-generic clean-libtool \
+ ctags distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am \
+ install-gcjversionedlibLTLIBRARIES install-info \
+ install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-info-am \
- uninstall-nativeexeclibLTLIBRARIES
+ tags uninstall uninstall-am \
+ uninstall-gcjversionedlibLTLIBRARIES uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/libjava/classpath/native/jawt/jawt.c b/libjava/classpath/native/jawt/jawt.c
index a4178685054..4ebb105d763 100644
--- a/libjava/classpath/native/jawt/jawt.c
+++ b/libjava/classpath/native/jawt/jawt.c
@@ -116,6 +116,8 @@ static JAWT_DrawingSurfaceInfo*
surface->target);
surface_info_x11->visualID = classpath_jawt_get_visualID (surface->env,
surface->target);
+ surface_info_x11->depth = classpath_jawt_get_depth (surface->env,
+ surface->target);
/* FIXME: also include bounding rectangle of drawing surface */
/* FIXME: also include current clipping region */
diff --git a/libjava/classpath/native/jni/.cvsignore b/libjava/classpath/native/jni/.cvsignore
new file mode 100644
index 00000000000..e9f2658a694
--- /dev/null
+++ b/libjava/classpath/native/jni/.cvsignore
@@ -0,0 +1,8 @@
+*.o
+*.a
+*.lo
+*.la
+.libs
+.deps
+Makefile
+Makefile.in
diff --git a/libjava/classpath/native/jni/Makefile.am b/libjava/classpath/native/jni/Makefile.am
index 2b205826c1b..1105407993f 100644
--- a/libjava/classpath/native/jni/Makefile.am
+++ b/libjava/classpath/native/jni/Makefile.am
@@ -1,7 +1,7 @@
## Input file for automake to generate the Makefile.in used by configure
if CREATE_CORE_JNI_LIBRARIES
- JNIDIRS = java-io java-lang java-net java-nio java-util
+ JNIDIRS = native-lib java-io java-lang java-net java-nio java-util
endif
if CREATE_ALSA_LIBRARIES
@@ -32,7 +32,8 @@ SUBDIRS = classpath $(JNIDIRS) \
$(ALSADIR) $(DSSIDIR) $(GTKDIR) $(CLASSPATH_QT_PEER_DIR) $(XMLJDIR) \
$(CLASSPATH_GCONF_PEER_DIR)
DIST_SUBDIRS = classpath java-io java-lang java-net java-nio java-util \
- gtk-peer gconf-peer qt-peer xmlj midi-alsa midi-dssi
+ gtk-peer gconf-peer qt-peer xmlj midi-alsa midi-dssi \
+ native-lib
all-local:
cd $(top_srcdir) && $(SHELL) ./scripts/check_jni_methods.sh
diff --git a/libjava/classpath/native/jni/Makefile.in b/libjava/classpath/native/jni/Makefile.in
index 61ae690f4da..705bb8107ed 100644
--- a/libjava/classpath/native/jni/Makefile.in
+++ b/libjava/classpath/native/jni/Makefile.in
@@ -41,12 +41,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -165,6 +167,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -286,9 +290,8 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
-@CREATE_CORE_JNI_LIBRARIES_TRUE@JNIDIRS = java-io java-lang java-net java-nio java-util
+@CREATE_CORE_JNI_LIBRARIES_TRUE@JNIDIRS = native-lib java-io java-lang java-net java-nio java-util
@CREATE_ALSA_LIBRARIES_TRUE@ALSADIR = midi-alsa
@CREATE_DSSI_LIBRARIES_TRUE@DSSIDIR = midi-dssi
@CREATE_GTK_PEER_LIBRARIES_TRUE@GTKDIR = gtk-peer
@@ -300,7 +303,8 @@ SUBDIRS = classpath $(JNIDIRS) \
$(CLASSPATH_GCONF_PEER_DIR)
DIST_SUBDIRS = classpath java-io java-lang java-net java-nio java-util \
- gtk-peer gconf-peer qt-peer xmlj midi-alsa midi-dssi
+ gtk-peer gconf-peer qt-peer xmlj midi-alsa midi-dssi \
+ native-lib
all: all-recursive
diff --git a/libjava/classpath/native/jni/classpath/.cvsignore b/libjava/classpath/native/jni/classpath/.cvsignore
new file mode 100644
index 00000000000..e9f2658a694
--- /dev/null
+++ b/libjava/classpath/native/jni/classpath/.cvsignore
@@ -0,0 +1,8 @@
+*.o
+*.a
+*.lo
+*.la
+.libs
+.deps
+Makefile
+Makefile.in
diff --git a/libjava/classpath/native/jni/classpath/Makefile.in b/libjava/classpath/native/jni/classpath/Makefile.in
index 435bb6d1647..681f5c1950e 100644
--- a/libjava/classpath/native/jni/classpath/Makefile.in
+++ b/libjava/classpath/native/jni/classpath/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -175,6 +177,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -296,7 +300,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
# Header needed for jawt implementations such as the one found in ../gtk-peer.
diff --git a/libjava/classpath/native/jni/classpath/classpath_jawt.h b/libjava/classpath/native/jni/classpath/classpath_jawt.h
index 32a04dc5cd7..35c734a57a3 100644
--- a/libjava/classpath/native/jni/classpath/classpath_jawt.h
+++ b/libjava/classpath/native/jni/classpath/classpath_jawt.h
@@ -54,6 +54,7 @@ jint classpath_jawt_get_awt_version (void);
Display* classpath_jawt_get_default_display (JNIEnv* env, jobject canvas);
Drawable classpath_jawt_get_drawable (JNIEnv* env, jobject canvas);
VisualID classpath_jawt_get_visualID (JNIEnv* env, jobject canvas);
+int classpath_jawt_get_depth (JNIEnv* env, jobject canvas);
jint classpath_jawt_lock (void);
void classpath_jawt_unlock (void);
diff --git a/libjava/classpath/native/jni/classpath/jcl.c b/libjava/classpath/native/jni/classpath/jcl.c
index e28c6631bad..cd3f5161d06 100644
--- a/libjava/classpath/native/jni/classpath/jcl.c
+++ b/libjava/classpath/native/jni/classpath/jcl.c
@@ -1,5 +1,5 @@
/* jcl.c
- Copyright (C) 1998, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,6 +48,57 @@ exception statement from your version. */
#endif
#endif
+/*
+ * Cached Pointer class info.
+ */
+static jclass rawDataClass = NULL;
+static jfieldID rawData_fid = NULL;
+static jmethodID rawData_mid = NULL;
+
+/*
+ * JNI OnLoad constructor.
+ */
+JNIEXPORT jint JNICALL
+JNI_OnLoad (JavaVM *vm, void *reserved __attribute__((unused)))
+{
+ JNIEnv *env;
+ void *envp;
+
+ if ((*vm)->GetEnv (vm, &envp, JNI_VERSION_1_4) != JNI_OK)
+ {
+ return JNI_VERSION_1_4;
+ }
+ env = (JNIEnv *) envp;
+#if SIZEOF_VOID_P == 8
+ rawDataClass = (*env)->FindClass (env, "gnu/classpath/Pointer64");
+ if (rawDataClass != NULL)
+ rawDataClass = (*env)->NewGlobalRef (env, rawDataClass);
+
+ if (rawDataClass != NULL)
+ {
+ rawData_fid = (*env)->GetFieldID (env, rawDataClass, "data", "J");
+ rawData_mid = (*env)->GetMethodID (env, rawDataClass, "<init>", "(J)V");
+ }
+#else
+#if SIZEOF_VOID_P == 4
+ rawDataClass = (*env)->FindClass (env, "gnu/classpath/Pointer32");
+ if (rawDataClass != NULL)
+ rawDataClass = (*env)->NewGlobalRef (env, rawDataClass);
+
+ if (rawDataClass != NULL)
+ {
+ rawData_fid = (*env)->GetFieldID (env, rawDataClass, "data", "I");
+ rawData_mid = (*env)->GetMethodID (env, rawDataClass, "<init>", "(I)V");
+ }
+#else
+#error "Pointer size is not supported."
+#endif /* SIZEOF_VOID_P == 4 */
+#endif /* SIZEOF_VOID_P == 8 */
+
+ return JNI_VERSION_1_4;
+}
+
+
JNIEXPORT void JNICALL
JCL_ThrowException (JNIEnv * env, const char *className, const char *errMsg)
{
@@ -183,78 +234,17 @@ JCL_FindClass (JNIEnv * env, const char *className)
/*
- * Build a Pointer object. The function caches the class type
+ * Build a Pointer object.
*/
-static jclass rawDataClass;
-static jfieldID rawData_fid;
-static jmethodID rawData_mid;
-
JNIEXPORT jobject JNICALL
JCL_NewRawDataObject (JNIEnv * env, void *data)
{
- if (rawDataClass == NULL)
+ if (rawDataClass == NULL || rawData_mid == NULL)
{
- jclass tmp;
-#if SIZEOF_VOID_P == 8
- rawDataClass = (*env)->FindClass (env, "gnu/classpath/Pointer64");
- if (rawDataClass == NULL)
- {
- JCL_ThrowException (env, "java/lang/InternalError",
- "unable to find internal class");
- return NULL;
- }
-
- rawData_mid = (*env)->GetMethodID (env, rawDataClass, "<init>", "(J)V");
- if (rawData_mid == NULL)
- {
- JCL_ThrowException (env, "java/lang/InternalError",
- "unable to find internal constructor");
- return NULL;
- }
-
- rawData_fid = (*env)->GetFieldID (env, rawDataClass, "data", "J");
- if (rawData_fid == NULL)
- {
- JCL_ThrowException (env, "java/lang/InternalError",
- "unable to find internal field");
- return NULL;
- }
-#else
- rawDataClass = (*env)->FindClass (env, "gnu/classpath/Pointer32");
- if (rawDataClass == NULL)
- {
- JCL_ThrowException (env, "java/lang/InternalError",
- "unable to find internal class");
- return NULL;
- }
-
- rawData_mid = (*env)->GetMethodID (env, rawDataClass, "<init>", "(I)V");
- if (rawData_mid == NULL)
- {
- JCL_ThrowException (env, "java/lang/InternalError",
- "unable to find internal constructor");
- return NULL;
- }
-
- rawData_fid = (*env)->GetFieldID (env, rawDataClass, "data", "I");
- if (rawData_fid == NULL)
- {
- JCL_ThrowException (env, "java/lang/InternalError",
- "unable to find internal field");
- return NULL;
- }
-
-#endif
- tmp = (*env)->NewGlobalRef (env, rawDataClass);
- if (tmp == NULL)
- {
- JCL_ThrowException (env, "java/lang/InternalError",
- "unable to create an internal global ref");
- return NULL;
- }
- (*env)->DeleteLocalRef(env, rawDataClass);
- rawDataClass = tmp;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "Pointer class was not properly initialized");
+ return NULL;
}
#if SIZEOF_VOID_P == 8
@@ -267,6 +257,13 @@ JCL_NewRawDataObject (JNIEnv * env, void *data)
JNIEXPORT void * JNICALL
JCL_GetRawData (JNIEnv * env, jobject rawdata)
{
+ if (rawData_fid == NULL)
+ {
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "Pointer class was not properly initialized");
+ return NULL;
+ }
+
#if SIZEOF_VOID_P == 8
return (void *) (*env)->GetLongField (env, rawdata, rawData_fid);
#else
diff --git a/libjava/classpath/native/jni/gconf-peer/.cvsignore b/libjava/classpath/native/jni/gconf-peer/.cvsignore
new file mode 100644
index 00000000000..799fc97856d
--- /dev/null
+++ b/libjava/classpath/native/jni/gconf-peer/.cvsignore
@@ -0,0 +1,6 @@
+.deps
+.libs
+*.lo
+*.la
+Makefile
+Makefile.in
diff --git a/libjava/classpath/native/jni/gconf-peer/GConfNativePeer.c b/libjava/classpath/native/jni/gconf-peer/GConfNativePeer.c
index a442226cae6..42986c33a89 100644
--- a/libjava/classpath/native/jni/gconf-peer/GConfNativePeer.c
+++ b/libjava/classpath/native/jni/gconf-peer/GConfNativePeer.c
@@ -108,8 +108,8 @@ static jclass get_jlist_reference (JNIEnv * env, jclass jlist_class);
* Method: init_class
* Signature: ()V
*/
-JNIEXPORT void
-JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_init_1class
+JNIEXPORT void JNICALL
+Java_gnu_java_util_prefs_gconf_GConfNativePeer_init_1class
(JNIEnv *env, jclass clazz)
{
if (reference_count == 0)
@@ -127,8 +127,8 @@ JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_init_1class
* Method: init_id_chache
* Signature: ()V
*/
-JNIEXPORT void
-JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_init_1id_1cache
+JNIEXPORT void JNICALL
+Java_gnu_java_util_prefs_gconf_GConfNativePeer_init_1id_1cache
(JNIEnv *env, jclass clazz __attribute__ ((unused)))
{
reference_count++;
@@ -157,16 +157,19 @@ JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_init_1id_1cache
/*
* Class: gnu_java_util_prefs_gconf_GConfNativePeer
- * Method: gconf_client_gconf_client_all_keys
+ * Method: gconf_client_all_keys
* Signature: (Ljava/lang/String;)Ljava/util/List;
*/
JNIEXPORT jobject JNICALL
-Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1gconf_1client_1all_1keys
+Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1all_1keys
(JNIEnv *env, jclass clazz __attribute__ ((unused)), jstring node)
{
/* TODO: check all the calls to gdk_threads_enter/leave */
const char *dir = NULL;
+ const char *_val = NULL;
+ const char *_val_unescaped = NULL;
+
GError *err = NULL;
GSList *entries = NULL;
GSList *tmp;
@@ -208,12 +211,18 @@ Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1gconf_1client_1all
tmp = entries;
while (tmp != NULL)
{
- const char *_val = gconf_entry_get_key (tmp->data);
+ _val = gconf_entry_get_key (tmp->data);
_val = strrchr (_val, '/');
++_val;
+
+ _val_unescaped = gconf_unescape_key (_val, strlen (_val));
+
(*env)->CallBooleanMethod (env, jlist, jlist_add_id,
- (*env)->NewStringUTF (env, _val));
+ (*env)->NewStringUTF (env, _val_unescaped));
+
tmp = g_slist_next (tmp);
+
+ g_free ((gpointer) _val_unescaped);
}
/* clean up things */
@@ -226,14 +235,17 @@ Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1gconf_1client_1all
/*
* Class: gnu_java_util_prefs_gconf_GConfNativePeer
- * Method: gconf_client_gconf_client_all_nodes
+ * Method: gconf_client_all_nodes
* Signature: (Ljava/lang/String;)Ljava/util/List;
*/
JNIEXPORT jobject JNICALL
-Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1gconf_1client_1all_1nodes
+Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1all_1nodes
(JNIEnv *env, jclass clazz __attribute__ ((unused)), jstring node)
{
const char *dir = NULL;
+ const char *_val = NULL;
+ const char *_val_unescaped = NULL;
+
GError *err = NULL;
GSList *entries = NULL;
GSList *tmp;
@@ -274,12 +286,19 @@ Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1gconf_1client_1all
tmp = entries;
while (tmp != NULL)
{
- const char *_val = tmp->data;
+ _val = tmp->data;
+
_val = strrchr (_val, '/');
++_val;
+
+ _val_unescaped = gconf_unescape_key (_val, strlen (_val));
+
(*env)->CallBooleanMethod (env, jlist, jlist_add_id,
- (*env)->NewStringUTF (env, _val));
+ (*env)->NewStringUTF (env, _val_unescaped));
+
tmp = g_slist_next (tmp);
+
+ g_free ((gpointer) _val_unescaped);
}
/* clean up things */
@@ -421,7 +440,7 @@ Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1set_1string
gdk_threads_leave ();
if (err != NULL)
{
- g_error_free (err);
+ g_error_free (err);
err = NULL;
result = JNI_FALSE;
}
@@ -511,8 +530,8 @@ Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1client_1dir_1exists
* Method: finalize_class
* Signature: ()V
*/
-JNIEXPORT void
-JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_finalize_1class
+JNIEXPORT void JNICALL
+Java_gnu_java_util_prefs_gconf_GConfNativePeer_finalize_1class
(JNIEnv *env, jclass clazz __attribute__ ((unused)))
{
if (reference_count == 0)
@@ -534,6 +553,74 @@ JNICALL Java_gnu_java_util_prefs_gconf_GConfNativePeer_finalize_1class
reference_count--;
}
+/*
+ * Class: gnu_java_util_prefs_gconf_GConfNativePeer
+ * Method: Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1escape_1key
+ * Signature: (Ljava/lang/String;)Z
+ */
+JNIEXPORT jstring JNICALL
+Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1escape_1key
+ (JNIEnv *env, jclass clazz __attribute__ ((unused)), jstring plain)
+{
+ const char *escaped = NULL;
+ const char *_plain = NULL;
+ jstring result = NULL;
+
+ _plain = JCL_jstring_to_cstring (env, plain);
+ if (_plain == NULL)
+ {
+ return NULL;
+ }
+
+ gdk_threads_enter ();
+ escaped = gconf_escape_key (_plain, strlen (_plain));
+ gdk_threads_leave ();
+
+ JCL_free_cstring (env, plain, _plain);
+ /* check for NULL, if so prevent string creation */
+ if (escaped != NULL)
+ {
+ result = (*env)->NewStringUTF (env, escaped);
+ g_free ((gpointer) escaped);
+ }
+
+ return result;
+}
+
+/*
+ * Class: gnu_java_util_prefs_gconf_GConfNativePeer
+ * Method: Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1unescape_1key
+ * Signature: (Ljava/lang/String;)Z
+ */
+JNIEXPORT jstring JNICALL
+Java_gnu_java_util_prefs_gconf_GConfNativePeer_gconf_1unescape_1key
+ (JNIEnv *env, jclass clazz __attribute__ ((unused)), jstring escaped)
+{
+ const char *plain = NULL;
+ const char *_escaped = NULL;
+ jstring result = NULL;
+
+ _escaped = JCL_jstring_to_cstring (env, escaped);
+ if (_escaped == NULL)
+ {
+ return NULL;
+ }
+
+ gdk_threads_enter ();
+ plain = gconf_unescape_key (_escaped, strlen (_escaped));
+ gdk_threads_leave ();
+
+ JCL_free_cstring (env, escaped, _escaped);
+ /* check for NULL, if so prevent string creation */
+ if (plain != NULL)
+ {
+ result = (*env)->NewStringUTF (env, plain);
+ g_free ((gpointer) plain);
+ }
+
+ return result;
+}
+
/* ***** END: NATIVE FUNCTIONS ***** */
/* ***** PRIVATE FUNCTIONS IMPLEMENTATION ***** */
diff --git a/libjava/classpath/native/jni/gconf-peer/Makefile.in b/libjava/classpath/native/jni/gconf-peer/Makefile.in
index 2e95e299d60..2e4074c778f 100644
--- a/libjava/classpath/native/jni/gconf-peer/Makefile.in
+++ b/libjava/classpath/native/jni/gconf-peer/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -185,6 +187,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -306,7 +310,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
nativeexeclib_LTLIBRARIES = libgconfpeer.la
libgconfpeer_la_SOURCES = GConfNativePeer.c
diff --git a/libjava/classpath/native/jni/gtk-peer/GtkDragSourceContextPeer.c b/libjava/classpath/native/jni/gtk-peer/GtkDragSourceContextPeer.c
index 6dfbfcce4a9..62ffa1395ea 100644
--- a/libjava/classpath/native/jni/gtk-peer/GtkDragSourceContextPeer.c
+++ b/libjava/classpath/native/jni/gtk-peer/GtkDragSourceContextPeer.c
@@ -42,7 +42,8 @@ exception statement from your version. */
#include <gtk/gtk.h>
static GtkWidget * get_widget (GtkWidget *widget);
-
+static void connect_signals_for_widget (GtkWidget *widget);
+
#define ACTION_COPY 1
#define ACTION_MOVE 2
#define ACTION_COPY_OR_MOVE 3
@@ -63,21 +64,35 @@ static GtkWidget * get_widget (GtkWidget *widget);
#define AWT_HAND_CURSOR 12
#define AWT_MOVE_CURSOR 13
+static jmethodID dragEnterID;
+static jmethodID dragExitID;
+static jmethodID dragDropEndID;
+static jmethodID dragMouseMovedID;
+static jmethodID dragOverID;
+static jmethodID dragActionChangedID;
+static jmethodID acceptDragID;
+static jmethodID rejectDragID;
+static jmethodID acceptDropID;
+static jmethodID rejectDropID;
+static jmethodID dropCompleteID;
+
GtkWidget *widget;
+GtkWidget *tgt;
+jobject *gref;
+jobject javaObj;
JNIEXPORT void JNICALL
Java_gnu_java_awt_dnd_peer_gtk_GtkDragSourceContextPeer_create
(JNIEnv *env, jobject obj, jobject comp)
-{
- void *ptr;
-
+{
gdk_threads_enter ();
-
+
+ javaObj = obj;
NSA_SET_GLOBAL_REF (env, obj);
NSA_SET_GLOBAL_REF (env, comp);
- ptr = NSA_GET_PTR (env, comp);
- widget = get_widget (GTK_WIDGET (ptr));
+ gref = NSA_GET_PTR (env, comp);
+ widget = get_widget (GTK_WIDGET (gref));
gdk_threads_leave ();
}
@@ -93,6 +108,7 @@ Java_gnu_java_awt_dnd_peer_gtk_GtkDragSourceContextPeer_nativeSetCursor
gdk_threads_enter ();
+ javaObj = obj;
ptr = NSA_GET_GLOBAL_REF (env, obj);
switch (type)
@@ -158,31 +174,81 @@ JNIEXPORT void JNICALL
Java_gnu_java_awt_dnd_peer_gtk_GtkDragSourceContextPeer_connectSignals
(JNIEnv *env, jobject obj, jobject comp)
{
- jobject *gref;
- void *ptr;
+ jclass gtkdragsourcecontextpeer;
+ jclass gtkdroptargetcontextpeer;
gdk_threads_enter ();
- ptr = NSA_GET_GLOBAL_REF (env, obj);
+ javaObj = obj;
gref = NSA_GET_GLOBAL_REF (env, comp);
+
+ connect_signals_for_widget (widget);
+
+ gtkdragsourcecontextpeer = (*cp_gtk_gdk_env())->FindClass (cp_gtk_gdk_env(),
+ "gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer");
+
+ dragEnterID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(),
+ gtkdragsourcecontextpeer,
+ "dragEnter", "(II)V");
+ dragExitID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(),
+ gtkdragsourcecontextpeer,
+ "dragExit", "(III)V");
+ dragDropEndID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(),
+ gtkdragsourcecontextpeer,
+ "dragDropEnd", "(IZII)V");
+ dragMouseMovedID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(),
+ gtkdragsourcecontextpeer,
+ "dragMouseMoved", "(II)V");
+ dragOverID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(),
+ gtkdragsourcecontextpeer,
+ "dragOver", "(II)V");
+ dragActionChangedID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(),
+ gtkdragsourcecontextpeer,
+ "dragActionChanged", "(II)V");
+
+
+ gtkdroptargetcontextpeer = (*cp_gtk_gdk_env())->FindClass (cp_gtk_gdk_env(),
+ "gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer");
+
+ acceptDragID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(),
+ gtkdroptargetcontextpeer,
+ "acceptDrag", "(I)V");
+ rejectDragID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(),
+ gtkdroptargetcontextpeer,
+ "rejectDrag", "()V");
+ acceptDropID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(),
+ gtkdroptargetcontextpeer,
+ "acceptDrop", "(I)V");
+ rejectDropID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(),
+ gtkdroptargetcontextpeer,
+ "rejectDrop", "()V");
+ dropCompleteID = (*cp_gtk_gdk_env())->GetMethodID (cp_gtk_gdk_env(),
+ gtkdroptargetcontextpeer,
+ "dropComplete", "(Z)V");
+
+ gdk_threads_leave ();
+}
+
+static void
+connect_signals_for_widget (GtkWidget *w)
+{
+ /* FIXME: Not implemented. */
+ w = NULL;
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_dnd_peer_gtk_GtkDragSourceContextPeer_setTarget
+ (JNIEnv *env, jobject obj, jobject target)
+{
+ void *ptr;
+
+ gdk_threads_enter ();
+
+ javaObj = obj;
+ ptr = NSA_GET_PTR (env, target);
+ tgt = get_widget (GTK_WIDGET (ptr));
+ connect_signals_for_widget (tgt);
- /* Uncomment when needed:
- g_signal_connect (G_OBJECT (widget), "drag_motion",
- G_CALLBACK (drag_motion_cb), *gref);
- g_signal_connect (G_OBJECT (widget), "drag_begin",
- G_CALLBACK (drag_begin_cb), *gref);
- g_signal_connect (G_OBJECT (widget), "drag_end",
- G_CALLBACK (drag_end_cb), *gref);
- g_signal_connect (G_OBJECT (widget), "drag_data_get",
- G_CALLBACK (drag_data_get_cb), *gref);
- g_signal_connect (G_OBJECT (widget), "drag_drop",
- G_CALLBACK (drag_drop_cb), *gref);
- g_signal_connect (G_OBJECT (widget), "drag_data_delete",
- G_CALLBACK (drag_data_delete_cb), *gref);
- g_signal_connect (G_OBJECT (widget), "drag_data_received",
- G_CALLBACK (drag_data_received_cb), *gref);
- */
-
gdk_threads_leave ();
}
@@ -200,7 +266,8 @@ Java_gnu_java_awt_dnd_peer_gtk_GtkDragSourceContextPeer_nativeStartDrag
GdkDragAction action = GDK_ACTION_DEFAULT;
gdk_threads_enter ();
-
+
+ javaObj = obj;
ptr = NSA_GET_GLOBAL_REF (env, obj);
data = (*env)->GetStringUTFChars (env, target, NULL);
@@ -225,7 +292,9 @@ Java_gnu_java_awt_dnd_peer_gtk_GtkDragSourceContextPeer_nativeStartDrag
action = GDK_ACTION_DEFAULT;
}
- gtk_drag_highlight (widget);
+ gtk_drag_dest_set (widget, GTK_DEST_DEFAULT_ALL, tar,
+ sizeof (tar) / sizeof (GtkTargetEntry),
+ action);
context = gtk_drag_begin (widget,
gtk_target_list_new (tar, sizeof (tar) / sizeof (GtkTargetEntry)),
action, GDK_BUTTON1_MASK | GDK_BUTTON2_MASK, event);
@@ -235,6 +304,11 @@ Java_gnu_java_awt_dnd_peer_gtk_GtkDragSourceContextPeer_nativeStartDrag
image = cp_gtk_image_get_pixbuf (env, img);
gtk_drag_set_icon_pixbuf (context, image, x, y);
}
+
+ if (tgt != NULL)
+ gtk_drag_dest_set (tgt, GTK_DEST_DEFAULT_ALL, tar,
+ sizeof (tar) / sizeof (GtkTargetEntry),
+ action);
gdk_event_free (event);
(*env)->ReleaseStringUTFChars (env, target, data);
diff --git a/libjava/classpath/native/jni/gtk-peer/Makefile.am b/libjava/classpath/native/jni/gtk-peer/Makefile.am
index b7e84144e7d..f925c18afce 100644
--- a/libjava/classpath/native/jni/gtk-peer/Makefile.am
+++ b/libjava/classpath/native/jni/gtk-peer/Makefile.am
@@ -1,4 +1,8 @@
-nativeexeclib_LTLIBRARIES = libgtkpeer.la
+## GCJ LOCAL: install this library in GCJ's versioned library
+## directory
+gcc_version := $(shell cat $(top_srcdir)/../../gcc/BASE-VER)
+gcjversionedlibdir = $(libdir)/gcj-$(gcc_version)
+gcjversionedlib_LTLIBRARIES = libgtkpeer.la
# GTK JNI sources.
libgtkpeer_la_SOURCES = gnu_java_awt_peer_gtk_CairoSurface.c \
@@ -49,9 +53,13 @@ libgtkpeer_la_SOURCES = gnu_java_awt_peer_gtk_CairoSurface.c \
gtk_jawt.c \
gtkpeer.h
+## GCJ LOCAL: encode the library path and use GCJ's library version
+libgtkpeer_la_LDFLAGS = -rpath $(gcjversionedlibdir) \
+ -version-info `grep -v '^\#' $(top_srcdir)/../libtool-version`
+
libgtkpeer_la_LIBADD = $(top_builddir)/native/jni/classpath/native_state.lo \
$(top_builddir)/native/jni/classpath/jcl.lo
-libgtkpeer_la_LDFLAGS = -avoid-version
+## libgtkpeer_la_LDFLAGS = -avoid-version
AM_LDFLAGS = @CLASSPATH_MODULE@ @GTK_LIBS@ @FREETYPE2_LIBS@ \
@PANGOFT2_LIBS@ @X_PRE_LIBS@ @X_LIBS@ @X_EXTRA_LIBS@ @XTEST_LIBS@
diff --git a/libjava/classpath/native/jni/gtk-peer/Makefile.in b/libjava/classpath/native/jni/gtk-peer/Makefile.in
index fbc85e99295..a7f523f2d8a 100644
--- a/libjava/classpath/native/jni/gtk-peer/Makefile.in
+++ b/libjava/classpath/native/jni/gtk-peer/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -59,9 +61,9 @@ am__vpath_adj = case $$p in \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(nativeexeclibdir)"
-nativeexeclibLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(nativeexeclib_LTLIBRARIES)
+am__installdirs = "$(DESTDIR)$(gcjversionedlibdir)"
+gcjversionedlibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(gcjversionedlib_LTLIBRARIES)
libgtkpeer_la_DEPENDENCIES = \
$(top_builddir)/native/jni/classpath/native_state.lo \
$(top_builddir)/native/jni/classpath/jcl.lo
@@ -224,6 +226,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -345,9 +349,10 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
-nativeexeclib_LTLIBRARIES = libgtkpeer.la
+gcc_version := $(shell cat $(top_srcdir)/../../gcc/BASE-VER)
+gcjversionedlibdir = $(libdir)/gcj-$(gcc_version)
+gcjversionedlib_LTLIBRARIES = libgtkpeer.la
# GTK JNI sources.
libgtkpeer_la_SOURCES = gnu_java_awt_peer_gtk_CairoSurface.c \
@@ -398,10 +403,12 @@ libgtkpeer_la_SOURCES = gnu_java_awt_peer_gtk_CairoSurface.c \
gtk_jawt.c \
gtkpeer.h
+libgtkpeer_la_LDFLAGS = -rpath $(gcjversionedlibdir) \
+ -version-info `grep -v '^\#' $(top_srcdir)/../libtool-version`
+
libgtkpeer_la_LIBADD = $(top_builddir)/native/jni/classpath/native_state.lo \
$(top_builddir)/native/jni/classpath/jcl.lo
-libgtkpeer_la_LDFLAGS = -avoid-version
AM_LDFLAGS = @CLASSPATH_MODULE@ @GTK_LIBS@ @FREETYPE2_LIBS@ \
@PANGOFT2_LIBS@ @X_PRE_LIBS@ @X_LIBS@ @X_EXTRA_LIBS@ @XTEST_LIBS@
@@ -446,35 +453,35 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-install-nativeexeclibLTLIBRARIES: $(nativeexeclib_LTLIBRARIES)
+install-gcjversionedlibLTLIBRARIES: $(gcjversionedlib_LTLIBRARIES)
@$(NORMAL_INSTALL)
- test -z "$(nativeexeclibdir)" || $(mkdir_p) "$(DESTDIR)$(nativeexeclibdir)"
- @list='$(nativeexeclib_LTLIBRARIES)'; for p in $$list; do \
+ test -z "$(gcjversionedlibdir)" || $(mkdir_p) "$(DESTDIR)$(gcjversionedlibdir)"
+ @list='$(gcjversionedlib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=install $(nativeexeclibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(nativeexeclibdir)/$$f'"; \
- $(LIBTOOL) --mode=install $(nativeexeclibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(nativeexeclibdir)/$$f"; \
+ echo " $(LIBTOOL) --mode=install $(gcjversionedlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(gcjversionedlibdir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(gcjversionedlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(gcjversionedlibdir)/$$f"; \
else :; fi; \
done
-uninstall-nativeexeclibLTLIBRARIES:
+uninstall-gcjversionedlibLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- @set -x; list='$(nativeexeclib_LTLIBRARIES)'; for p in $$list; do \
+ @set -x; list='$(gcjversionedlib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(nativeexeclibdir)/$$p'"; \
- $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(nativeexeclibdir)/$$p"; \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(gcjversionedlibdir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(gcjversionedlibdir)/$$p"; \
done
-clean-nativeexeclibLTLIBRARIES:
- -test -z "$(nativeexeclib_LTLIBRARIES)" || rm -f $(nativeexeclib_LTLIBRARIES)
- @list='$(nativeexeclib_LTLIBRARIES)'; for p in $$list; do \
+clean-gcjversionedlibLTLIBRARIES:
+ -test -z "$(gcjversionedlib_LTLIBRARIES)" || rm -f $(gcjversionedlib_LTLIBRARIES)
+ @list='$(gcjversionedlib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libgtkpeer.la: $(libgtkpeer_la_OBJECTS) $(libgtkpeer_la_DEPENDENCIES)
- $(LINK) -rpath $(nativeexeclibdir) $(libgtkpeer_la_LDFLAGS) $(libgtkpeer_la_OBJECTS) $(libgtkpeer_la_LIBADD) $(LIBS)
+ $(LINK) -rpath $(gcjversionedlibdir) $(libgtkpeer_la_LDFLAGS) $(libgtkpeer_la_OBJECTS) $(libgtkpeer_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -635,7 +642,7 @@ check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
- for dir in "$(DESTDIR)$(nativeexeclibdir)"; do \
+ for dir in "$(DESTDIR)$(gcjversionedlibdir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
@@ -664,7 +671,7 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
-clean-am: clean-generic clean-libtool clean-nativeexeclibLTLIBRARIES \
+clean-am: clean-gcjversionedlibLTLIBRARIES clean-generic clean-libtool \
mostlyclean-am
distclean: distclean-am
@@ -683,9 +690,9 @@ info: info-am
info-am:
-install-data-am:
+install-data-am: install-gcjversionedlibLTLIBRARIES
-install-exec-am: install-nativeexeclibLTLIBRARIES
+install-exec-am:
install-info: install-info-am
@@ -711,20 +718,21 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am uninstall-nativeexeclibLTLIBRARIES
+uninstall-am: uninstall-gcjversionedlibLTLIBRARIES uninstall-info-am
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-nativeexeclibLTLIBRARIES ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am install-man \
- install-nativeexeclibLTLIBRARIES install-strip installcheck \
+.PHONY: CTAGS GTAGS all all-am check check-am clean \
+ clean-gcjversionedlibLTLIBRARIES clean-generic clean-libtool \
+ ctags distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am \
+ install-gcjversionedlibLTLIBRARIES install-info \
+ install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-info-am \
- uninstall-nativeexeclibLTLIBRARIES
+ tags uninstall uninstall-am \
+ uninstall-gcjversionedlibLTLIBRARIES uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/libjava/classpath/native/jni/gtk-peer/cairographics2d.h b/libjava/classpath/native/jni/gtk-peer/cairographics2d.h
index 675bc0b1744..fc564a86a99 100644
--- a/libjava/classpath/native/jni/gtk-peer/cairographics2d.h
+++ b/libjava/classpath/native/jni/gtk-peer/cairographics2d.h
@@ -97,7 +97,8 @@ enum java_awt_rendering_hints_filter
java_awt_rendering_hints_VALUE_INTERPOLATION_BILINEAR = 1,
java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_SPEED = 2,
java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_QUALITY = 3,
- java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_DEFAULT = 4
+ java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_DEFAULT = 4,
+ java_awt_rendering_hints_VALUE_INTERPOLATION_BICUBIC = 5
};
diff --git a/libjava/classpath/native/jni/gtk-peer/gdkfont.h b/libjava/classpath/native/jni/gtk-peer/gdkfont.h
index cf233301547..5545bccaaf4 100644
--- a/libjava/classpath/native/jni/gtk-peer/gdkfont.h
+++ b/libjava/classpath/native/jni/gtk-peer/gdkfont.h
@@ -92,7 +92,10 @@ extern struct state_table *cp_gtk_native_text_layout_state_table;
#define FONT_METRICS_DESCENT 2
#define FONT_METRICS_MAX_DESCENT 3
#define FONT_METRICS_MAX_ADVANCE 4
-#define NUM_FONT_METRICS 5
+#define FONT_METRICS_HEIGHT 5
+#define FONT_METRICS_UNDERLINE_OFFSET 6
+#define FONT_METRICS_UNDERLINE_THICKNESS 7
+#define NUM_FONT_METRICS 8
#define TEXT_METRICS_X_BEARING 0
#define TEXT_METRICS_Y_BEARING 1
diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
index 45cf4fbdaca..bd63ac36667 100644
--- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
+++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
@@ -49,7 +49,6 @@ exception statement from your version. */
#include <stdio.h>
#include <stdlib.h>
-static void install_font_peer(cairo_t *cr, struct peerfont *pfont);
static void update_pattern_transform (struct cairographics2d *gr);
/**
@@ -134,7 +133,11 @@ Java_gnu_java_awt_peer_gtk_CairoGraphics2D_setGradient
cairo_pattern_add_color_stop_rgba(pattern, 1.0, r2 / 255.0, g2 / 255.0,
b2 / 255.0, a2 / 255.0);
- extend = (cyclic == JNI_TRUE) ? CAIRO_EXTEND_REFLECT : CAIRO_EXTEND_NONE;
+ #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0)
+ extend = (cyclic == JNI_TRUE) ? CAIRO_EXTEND_REFLECT : CAIRO_EXTEND_PAD;
+ #else
+ extend = (cyclic == JNI_TRUE) ? CAIRO_EXTEND_REFLECT : CAIRO_EXTEND_NONE;
+ #endif
cairo_pattern_set_extend( pattern, extend );
@@ -143,9 +146,10 @@ Java_gnu_java_awt_peer_gtk_CairoGraphics2D_setGradient
}
JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_CairoGraphics2D_setTexturePixels
+Java_gnu_java_awt_peer_gtk_CairoGraphics2D_setPaintPixels
(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
- jlong pointer, jintArray jarr, jint w, jint h, jint stride)
+ jlong pointer, jintArray jarr, jint w, jint h, jint stride, jboolean repeat,
+ jint x, jint y)
{
struct cairographics2d *gr = NULL;
jint *jpixels = NULL;
@@ -180,15 +184,21 @@ Java_gnu_java_awt_peer_gtk_CairoGraphics2D_setTexturePixels
g_assert (gr->pattern_surface != NULL);
gr->pattern = cairo_pattern_create_for_surface (gr->pattern_surface);
g_assert (gr->pattern != NULL);
- cairo_pattern_set_extend (gr->pattern, CAIRO_EXTEND_REPEAT);
- cairo_set_source (gr->cr, gr->pattern);
+
+ cairo_set_source_surface(gr->cr, gr->pattern_surface, x, y);
+
+ if (repeat)
+ cairo_pattern_set_extend(cairo_get_source(gr->cr), CAIRO_EXTEND_REPEAT);
+ else
+ cairo_pattern_set_extend(cairo_get_source(gr->cr), CAIRO_EXTEND_NONE);
}
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_CairoGraphics2D_drawPixels
(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
jlong pointer, jintArray java_pixels,
- jint w, jint h, jint stride, jdoubleArray java_matrix, jdouble alpha)
+ jint w, jint h, jint stride, jdoubleArray java_matrix, jdouble alpha,
+ jint interpolation)
{
jint *native_pixels = NULL;
jdouble *native_matrix = NULL;
@@ -215,8 +225,28 @@ Java_gnu_java_awt_peer_gtk_CairoGraphics2D_drawPixels
p = cairo_pattern_create_for_surface (surf);
cairo_pattern_set_matrix (p, &mat);
- if (gr->pattern)
- cairo_pattern_set_filter (p, cairo_pattern_get_filter (gr->pattern));
+ switch ((enum java_awt_rendering_hints_filter) interpolation)
+ {
+ case java_awt_rendering_hints_VALUE_INTERPOLATION_NEAREST_NEIGHBOR:
+ cairo_pattern_set_filter (p, CAIRO_FILTER_NEAREST);
+ break;
+ case java_awt_rendering_hints_VALUE_INTERPOLATION_BILINEAR:
+ cairo_pattern_set_filter (p, CAIRO_FILTER_BILINEAR);
+ break;
+ case java_awt_rendering_hints_VALUE_INTERPOLATION_BICUBIC:
+ cairo_pattern_set_filter (p, CAIRO_FILTER_GAUSSIAN);
+ break;
+ case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_SPEED:
+ cairo_pattern_set_filter (p, CAIRO_FILTER_FAST);
+ break;
+ case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_DEFAULT:
+ cairo_pattern_set_filter (p, CAIRO_FILTER_NEAREST);
+ break;
+ case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_QUALITY:
+ cairo_pattern_set_filter (p, CAIRO_FILTER_BEST);
+ break;
+ }
+
cairo_set_source (gr->cr, p);
if (alpha == 1.)
cairo_paint (gr->cr);
@@ -297,8 +327,6 @@ Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawGlyphVector
pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, font);
g_assert (pfont != NULL);
- install_font_peer(gr->cr, pfont);
-
glyphs = g_malloc( sizeof(cairo_glyph_t) * n);
g_assert (glyphs != NULL);
@@ -324,6 +352,37 @@ Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawGlyphVector
JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetFont
+(JNIEnv *env __attribute__ ((unused)), jobject obj __attribute__ ((unused)),
+ jlong pointer, jobject font)
+{
+ struct cairographics2d *gr = NULL;
+ struct peerfont *pfont = NULL;
+ FT_Face face = NULL;
+ cairo_font_face_t *ft = NULL;
+
+ gr = JLONG_TO_PTR(struct cairographics2d, pointer);
+ g_assert (gr != NULL);
+
+ pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, font);
+ g_assert (pfont != NULL);
+
+ face = pango_fc_font_lock_face( (PangoFcFont *)pfont->font );
+ g_assert (face != NULL);
+
+ ft = cairo_ft_font_face_create_for_ft_face (face, 0);
+ g_assert (ft != NULL);
+
+ cairo_set_font_face (gr->cr, ft);
+ cairo_set_font_size (gr->cr,
+ (pango_font_description_get_size (pfont->desc) /
+ (double)PANGO_SCALE));
+
+ cairo_font_face_destroy (ft);
+ pango_fc_font_unlock_face((PangoFcFont *)pfont->font);
+}
+
+JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetOperator
(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
jlong pointer, jint op)
@@ -679,37 +738,6 @@ Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoPreserveClip
}
JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSurfaceSetFilter
-(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
- jlong pointer, jint filter)
-{
- struct cairographics2d *gr = JLONG_TO_PTR(struct cairographics2d, pointer);
- g_assert (gr != NULL);
-
- if (gr->pattern == NULL)
- return;
-
- switch ((enum java_awt_rendering_hints_filter) filter)
- {
- case java_awt_rendering_hints_VALUE_INTERPOLATION_NEAREST_NEIGHBOR:
- cairo_pattern_set_filter (gr->pattern, CAIRO_FILTER_NEAREST);
- break;
- case java_awt_rendering_hints_VALUE_INTERPOLATION_BILINEAR:
- cairo_pattern_set_filter (gr->pattern, CAIRO_FILTER_BILINEAR);
- break;
- case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_SPEED:
- cairo_pattern_set_filter (gr->pattern, CAIRO_FILTER_FAST);
- break;
- case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_DEFAULT:
- cairo_pattern_set_filter (gr->pattern, CAIRO_FILTER_NEAREST);
- break;
- case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_QUALITY:
- cairo_pattern_set_filter (gr->pattern, CAIRO_FILTER_BEST);
- break;
- }
-}
-
-JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawLine
(JNIEnv *env __attribute__ ((unused)), jobject obj __attribute__ ((unused)),
jlong pointer, jdouble x1, jdouble y1, jdouble x2, jdouble y2)
@@ -749,45 +777,6 @@ Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoFillRect
cairo_fill(gr->cr);
}
-
-/************************** FONT STUFF ****************************/
-static void
-install_font_peer(cairo_t *cr,
- struct peerfont *pfont)
-{
- cairo_font_face_t *ft;
- FT_Face face = NULL;
-
- g_assert(cr != NULL);
- g_assert(pfont != NULL);
-
- if (pfont->graphics_resource == NULL)
- {
- face = pango_fc_font_lock_face( (PangoFcFont *)pfont->font );
- g_assert (face != NULL);
-
- ft = cairo_ft_font_face_create_for_ft_face (face, 0);
- g_assert (ft != NULL);
-
- cairo_set_font_face (cr, ft);
- /* cairo_font_face_destroy (ft);*/
- cairo_set_font_size (cr,
- (pango_font_description_get_size (pfont->desc) /
- (double)PANGO_SCALE));
- ft = cairo_get_font_face (cr);
- pango_fc_font_unlock_face( (PangoFcFont *)pfont->font );
- pfont->graphics_resource = ft;
- }
- else
- {
- ft = (cairo_font_face_t *) pfont->graphics_resource;
- cairo_set_font_face (cr, ft);
- cairo_set_font_size (cr,
- (pango_font_description_get_size (pfont->desc) /
- (double)PANGO_SCALE));
- }
-}
-
static void
update_pattern_transform (struct cairographics2d *gr)
{
diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c
index a25f764b4dd..350cd345a1d 100644
--- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c
+++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c
@@ -181,7 +181,8 @@ Java_gnu_java_awt_peer_gtk_CairoSurface_nativeSetPixels
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_CairoSurface_nativeDrawSurface
(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
- jlong surfacePointer, jlong context, jdoubleArray java_matrix, double alpha)
+ jlong surfacePointer, jlong context, jdoubleArray java_matrix, double alpha,
+ jint interpolation)
{
struct cairographics2d *gr = JLONG_TO_PTR(struct cairographics2d, context);
cairo_t *cr = gr->cr;
@@ -205,6 +206,27 @@ Java_gnu_java_awt_peer_gtk_CairoSurface_nativeDrawSurface
p = cairo_pattern_create_for_surface (surface);
cairo_pattern_set_matrix (p, &mat);
+ switch ((enum java_awt_rendering_hints_filter) interpolation)
+ {
+ case java_awt_rendering_hints_VALUE_INTERPOLATION_NEAREST_NEIGHBOR:
+ cairo_pattern_set_filter (p, CAIRO_FILTER_NEAREST);
+ break;
+ case java_awt_rendering_hints_VALUE_INTERPOLATION_BILINEAR:
+ cairo_pattern_set_filter (p, CAIRO_FILTER_BILINEAR);
+ break;
+ case java_awt_rendering_hints_VALUE_INTERPOLATION_BICUBIC:
+ cairo_pattern_set_filter (p, CAIRO_FILTER_GAUSSIAN);
+ break;
+ case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_SPEED:
+ cairo_pattern_set_filter (p, CAIRO_FILTER_FAST);
+ break;
+ case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_DEFAULT:
+ cairo_pattern_set_filter (p, CAIRO_FILTER_NEAREST);
+ break;
+ case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_QUALITY:
+ cairo_pattern_set_filter (p, CAIRO_FILTER_BEST);
+ break;
+ }
cairo_set_source(cr, p);
if (alpha == 1.0)
diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
index ddaece1b278..0837ee13cdd 100644
--- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
+++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
@@ -129,94 +129,48 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_releasePeerGraphicsResource
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GdkFontPeer_getFontMetrics
- (JNIEnv *env, jobject java_font, jdoubleArray java_metrics)
+(JNIEnv *env, jobject java_font, jdoubleArray java_metrics)
{
+ FT_Face face;
struct peerfont *pfont = NULL;
jdouble *native_metrics = NULL;
- PangoFontMetrics *pango_metrics = NULL;
- PangoLayout* layout = NULL;
- PangoRectangle ink_rect;
- PangoRectangle logical_rect;
- PangoLayoutIter* iter = NULL;
- int pango_ascent = 0;
- int pango_descent = 0;
- int pango_ink_ascent = 0;
- int pango_ink_descent = 0;
- int baseline = 0;
- int java_ascent = 0;
- int java_descent = 0;
+ short x_ppem;
+ short y_ppem;
+ short units_per_em;
+ double factorx;
+ double factory;
gdk_threads_enter();
pfont = (struct peerfont *) NSA_GET_FONT_PTR (env, java_font);
g_assert (pfont != NULL);
-
- pango_metrics
- = pango_context_get_metrics (pfont->ctx, pfont->desc,
- gtk_get_default_language ());
+ face = pango_fc_font_lock_face ((PangoFcFont *)pfont->font);
native_metrics
= (*env)->GetDoubleArrayElements (env, java_metrics, NULL);
g_assert (native_metrics != NULL);
- pango_ascent = PANGO_PIXELS (pango_font_metrics_get_ascent (pango_metrics));
- pango_descent = PANGO_PIXELS (pango_font_metrics_get_descent (pango_metrics));
-
- layout = pango_layout_new (pfont->ctx);
-
- /* Pango seems to produce ascent and descent values larger than
- those that Sun produces for the same-sized font. It turns out
- that an average of the "ink ascent" and "logical ascent" closely
- approximates Sun's ascent values. Likewise for descent values.
- This is expensive but we cache GdkFontMetrics so this should only
- run once per Font instance. */
- pango_layout_set_text (layout, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL"
- "MNOPQRSTUVWXYZ0123456789", -1);
- pango_layout_set_font_description (layout, pfont->desc);
-
- pango_layout_get_pixel_extents (layout, &ink_rect, &logical_rect);
-
- iter = pango_layout_get_iter (layout);
-
- baseline = PANGO_PIXELS (pango_layout_iter_get_baseline (iter));
-
- pango_ink_ascent = baseline - ink_rect.y;
- pango_ink_descent = ink_rect.y + ink_rect.height - baseline;
+ x_ppem = face->size->metrics.x_ppem;
+ y_ppem = face->size->metrics.y_ppem;
+ units_per_em = face->units_per_EM;
+ factorx = units_per_em / x_ppem;
+ factory = units_per_em / y_ppem;
+ native_metrics[FONT_METRICS_ASCENT] = face->ascender / factory;
+ native_metrics[FONT_METRICS_MAX_ASCENT] = face->bbox.yMax / factory;
+ native_metrics[FONT_METRICS_DESCENT] = - face->descender / factory;
+ native_metrics[FONT_METRICS_MAX_DESCENT] = - face->bbox.yMin / factory;
+ native_metrics[FONT_METRICS_MAX_ADVANCE] = face->max_advance_width / factorx;
+ native_metrics[FONT_METRICS_HEIGHT] = face->height / factory;
+ native_metrics[FONT_METRICS_UNDERLINE_OFFSET] =
+ face->underline_position / factory;
+ native_metrics[FONT_METRICS_UNDERLINE_THICKNESS] =
+ face->underline_thickness / factory;
- java_ascent = (pango_ascent + pango_ink_ascent) >> 1;
- java_descent = (pango_descent + pango_ink_descent) >> 1;
-
- java_ascent = MAX(0, java_ascent);
- java_descent = MAX(0, java_descent);
-
- pango_ascent = MAX(0, pango_ascent);
- pango_descent = MAX(0, pango_descent);
-
- /* Pango monospaced fonts have smaller ascent metrics than Sun's so
- we return the logical ascent for monospaced fonts. */
- if (!strcmp (pango_font_description_get_family (pfont->desc),
- "Courier"))
- native_metrics[FONT_METRICS_ASCENT] = pango_ascent;
- else
- native_metrics[FONT_METRICS_ASCENT] = java_ascent;
-
- native_metrics[FONT_METRICS_MAX_ASCENT] = pango_ascent;
-
- native_metrics[FONT_METRICS_DESCENT] = java_descent;
-
- native_metrics[FONT_METRICS_MAX_DESCENT] = pango_descent;
-
- native_metrics[FONT_METRICS_MAX_ADVANCE]
- = PANGO_PIXELS (pango_font_metrics_get_approximate_char_width
- (pango_metrics));
-
(*env)->ReleaseDoubleArrayElements (env,
java_metrics,
native_metrics, 0);
- pango_font_metrics_unref (pango_metrics);
-
gdk_threads_leave();
}
diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
index c8d9fb5512c..b92d017a5d4 100644
--- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
+++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
@@ -210,7 +210,8 @@ query_formats (JNIEnv *env, jclass clazz)
jobject jformat;
GSList *formats, *f;
GdkPixbufFormat *format;
- char **ch, *name;
+ gchar **ch, *name;
+ gint count;
jclass formatClass;
jmethodID addExtensionID;
@@ -240,14 +241,16 @@ query_formats (JNIEnv *env, jclass clazz)
string = (*env)->NewStringUTF(env, name);
g_assert(string != NULL);
- jformat = (*env)->CallStaticObjectMethod
+ jformat = (*env)->CallStaticObjectMethod
(env, clazz, registerFormatID, string,
(jboolean) gdk_pixbuf_format_is_writable(format));
(*env)->DeleteLocalRef(env, string);
+ g_free(name);
g_assert(jformat != NULL);
-
+
ch = gdk_pixbuf_format_get_extensions(format);
+ count = 0;
while (*ch)
{
string = (*env)->NewStringUTF(env, *ch);
@@ -255,9 +258,12 @@ query_formats (JNIEnv *env, jclass clazz)
(*env)->CallVoidMethod (env, jformat, addExtensionID, string);
(*env)->DeleteLocalRef(env, string);
++ch;
+ ++count;
}
-
+ g_strfreev(ch - count);
+
ch = gdk_pixbuf_format_get_mime_types(format);
+ count = 0;
while (*ch)
{
string = (*env)->NewStringUTF(env, *ch);
@@ -265,12 +271,13 @@ query_formats (JNIEnv *env, jclass clazz)
(*env)->CallVoidMethod (env, jformat, addMimeTypeID, string);
(*env)->DeleteLocalRef(env, string);
++ch;
+ ++count;
}
-
+ g_strfreev(ch - count);
(*env)->DeleteLocalRef(env, jformat);
}
-
- g_slist_free(formats);
+
+ g_slist_free(formats);
}
diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
index 6a9066cbe53..1099287e2ff 100644
--- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
@@ -353,7 +353,7 @@ Java_gnu_java_awt_peer_gtk_GtkButtonPeer_setNativeBounds
/* ...and the label's size request. */
gtk_widget_set_size_request (gtk_bin_get_child (GTK_BIN (child)), width,
height);
- if (widget->parent != NULL)
+ if (widget->parent != NULL && GTK_IS_FIXED (widget->parent))
gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y);
}
diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
index 39524eea02c..d2025bb701f 100644
--- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
@@ -659,16 +659,16 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_setNativeBounds
width = width < 0 ? 0 : width;
height = height < 0 ? 0 : height;
- if (GTK_IS_VIEWPORT (widget->parent))
- gtk_widget_set_size_request (widget, width, height);
- else
+ if (!(width == 0 && height == 0))
{
- if (!(width == 0 && height == 0))
- {
- gtk_widget_set_size_request (widget, width, height);
- if (widget->parent != NULL)
- gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y);
- }
+ gtk_widget_set_size_request (widget, width, height);
+ /* The GTK_IS_FIXED check here prevents gtk_fixed_move being
+ called when our parent is a GtkScrolledWindow. In that
+ case though, moving the child widget is invalid since a
+ ScrollPane only has one child and that child is always
+ located at (0, 0) in viewport coordinates. */
+ if (widget->parent != NULL && GTK_IS_FIXED (widget->parent))
+ gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y);
}
gdk_threads_leave ();
diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
index 76696431424..144ca0e8a95 100644
--- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
+++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
@@ -188,3 +188,47 @@ Java_gnu_java_awt_peer_gtk_GtkFramePeer_nativeSetIconImage
gdk_threads_leave ();
}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkFramePeer_maximize
+(JNIEnv *env, jobject obj)
+{
+ void *ptr;
+ gdk_threads_enter ();
+ ptr = NSA_GET_PTR (env, obj);
+ gtk_window_maximize (GTK_WINDOW (ptr));
+ gdk_threads_leave ();
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkFramePeer_unmaximize
+(JNIEnv *env, jobject obj)
+{
+ void *ptr;
+ gdk_threads_enter ();
+ ptr = NSA_GET_PTR (env, obj);
+ gtk_window_unmaximize (GTK_WINDOW (ptr));
+ gdk_threads_leave ();
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkFramePeer_iconify
+(JNIEnv *env, jobject obj)
+{
+ void *ptr;
+ gdk_threads_enter ();
+ ptr = NSA_GET_PTR (env, obj);
+ gtk_window_iconify (GTK_WINDOW (ptr));
+ gdk_threads_leave ();
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkFramePeer_deiconify
+(JNIEnv *env, jobject obj)
+{
+ void *ptr;
+ gdk_threads_enter ();
+ ptr = NSA_GET_PTR (env, obj);
+ gtk_window_deiconify (GTK_WINDOW (ptr));
+ gdk_threads_leave ();
+}
diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
index 77021ceec0a..13473a9a8db 100644
--- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
+++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
@@ -213,7 +213,7 @@ Java_gnu_java_awt_peer_gtk_GtkLabelPeer_setNativeBounds
gtk_widget_set_size_request (gtk_bin_get_child (GTK_BIN (widget)),
width, height);
- if (widget->parent != NULL)
+ if (widget->parent != NULL && GTK_IS_FIXED (widget->parent))
gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y);
}
diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
index 8949fa92762..0f868eaed6a 100644
--- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
+++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
@@ -77,8 +77,10 @@ struct state_table *cp_gtk_native_state_table;
struct state_table *cp_gtk_native_global_ref_table;
static jclass gtkgenericpeer;
+static jclass gtktoolkit;
static JavaVM *java_vm;
static jmethodID printCurrentThreadID;
+static jmethodID setRunningID;
union env_union
{
@@ -99,7 +101,9 @@ GtkWindowGroup *cp_gtk_global_window_group;
double cp_gtk_dpi_conversion_factor;
static void init_glib_threads(JNIEnv *, jint);
-
+static gboolean post_set_running_flag (gpointer);
+static gboolean set_running_flag (gpointer);
+static gboolean clear_running_flag (gpointer);
static void init_dpi_conversion_factor (void);
static void dpi_changed_cb (GtkSettings *settings,
GParamSpec *pspec);
@@ -199,6 +203,10 @@ Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkInit (JNIEnv *env,
cp_gtk_global_window_group = gtk_window_group_new ();
init_dpi_conversion_factor ();
+
+ gtktoolkit = (*env)->FindClass(env, "gnu/java/awt/peer/gtk/GtkMainThread");
+ setRunningID = (*env)->GetStaticMethodID (env, gtktoolkit,
+ "setRunning", "(Z)V");
}
@@ -324,11 +332,25 @@ Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkMain
{
gdk_threads_enter ();
+ gtk_init_add (post_set_running_flag, NULL);
+ gtk_quit_add (gtk_main_level (), clear_running_flag, NULL);
+
gtk_main ();
gdk_threads_leave ();
}
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkQuit
+(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)))
+{
+ gdk_threads_enter ();
+
+ gtk_main_quit ();
+
+ gdk_threads_leave ();
+}
+
static jint gdk_color_to_java_color (GdkColor color);
@@ -491,3 +513,28 @@ gdk_color_to_java_color (GdkColor gdk_color)
return (jint) (0xff000000 | (red << 16) | (green << 8) | blue);
}
+
+static gboolean
+post_set_running_flag (gpointer data __attribute__((unused)))
+{
+ g_idle_add (set_running_flag, NULL);
+ return FALSE;
+}
+
+static gboolean
+set_running_flag (gpointer data __attribute__((unused)))
+{
+ (*cp_gtk_gdk_env ())->CallStaticVoidMethod (cp_gtk_gdk_env (),
+ gtktoolkit,
+ setRunningID, TRUE);
+ return FALSE;
+}
+
+static gboolean
+clear_running_flag (gpointer data __attribute__((unused)))
+{
+ (*cp_gtk_gdk_env ())->CallStaticVoidMethod (cp_gtk_gdk_env (),
+ gtktoolkit,
+ setRunningID, FALSE);
+ return FALSE;
+}
diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c
index e391d64ecdd..3fb5331a23e 100644
--- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c
+++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c
@@ -88,7 +88,7 @@ Java_gnu_java_awt_peer_gtk_GtkVolatileImage_init (JNIEnv *env,
*/
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkVolatileImage_destroy
-(JNIEnv *env __attribute__((unused)), jobject obj __attribute((unused)),
+(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
jlong pointer)
{
GdkPixmap* pixmap = JLONG_TO_PTR(GdkPixmap, pointer);
@@ -110,10 +110,12 @@ Java_gnu_java_awt_peer_gtk_GtkVolatileImage_nativeGetPixels
/* jint *pixeldata, *jpixdata; */
jint *jpixdata;
GdkPixmap *pixmap;
+ GdkPixbuf *pixbuf;
jintArray jpixels;
int width, height, depth, size;
jclass cls;
jfieldID field;
+ guchar *pixels;
cls = (*env)->GetObjectClass (env, obj);
field = (*env)->GetFieldID (env, cls, "width", "I");
@@ -131,11 +133,19 @@ Java_gnu_java_awt_peer_gtk_GtkVolatileImage_nativeGetPixels
/* get depth in bytes */
depth = gdk_drawable_get_depth( pixmap ) >> 3;
- size = width * height * 4;
+ size = width * height;
jpixels = (*env)->NewIntArray ( env, size );
jpixdata = (*env)->GetIntArrayElements (env, jpixels, NULL);
- /* memcpy (jpixdata, pixeldata, size * sizeof( jint )); */
-
+
+ pixbuf = gdk_pixbuf_new( GDK_COLORSPACE_RGB, TRUE, 8, width, height );
+ gdk_pixbuf_get_from_drawable( pixbuf, pixmap, NULL, 0, 0, 0, 0, width, height );
+
+ if (pixbuf != NULL)
+ {
+ pixels = gdk_pixbuf_get_pixels(pixbuf);
+ memcpy (jpixdata, pixels, size * sizeof(jint));
+ }
+
(*env)->ReleaseIntArrayElements (env, jpixels, jpixdata, 0);
gdk_threads_leave();
@@ -148,7 +158,7 @@ Java_gnu_java_awt_peer_gtk_GtkVolatileImage_nativeGetPixels
*/
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkVolatileImage_nativeCopyArea
-(JNIEnv *env __attribute__((unused)), jobject obj __attribute((unused)),
+(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
jlong pointer, jint x, jint y, jint w, jint h, jint dx, jint dy)
{
GdkPixbuf *pixbuf;
@@ -169,7 +179,7 @@ Java_gnu_java_awt_peer_gtk_GtkVolatileImage_nativeCopyArea
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkVolatileImage_nativeDrawVolatile
-(JNIEnv *env __attribute__((unused)), jobject obj __attribute((unused)),
+(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
jlong pointer, jlong srcptr, jint x, jint y, jint w, jint h)
{
GdkPixmap *dst, *src;
diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
index 3f288af5ce1..aa70b9d2dca 100644
--- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
+++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
@@ -44,7 +44,6 @@ exception statement from your version. */
#include <X11/Xatom.h>
#include <gdk/gdkkeysyms.h>
-#define AWT_WINDOW_OPENED 200
#define AWT_WINDOW_CLOSING 201
#define AWT_WINDOW_CLOSED 202
#define AWT_WINDOW_ICONIFIED 203
@@ -55,6 +54,10 @@ exception statement from your version. */
#define AWT_WINDOW_LOST_FOCUS 208
#define AWT_WINDOW_STATE_CHANGED 209
+#define AWT_FRAME_NORMAL 0
+#define AWT_FRAME_ICONIFIED 1
+#define AWT_FRAME_MAXIMIZED_BOTH 6
+
/* Virtual Keys */
/* This list should be kept in the same order as the VK_ field
declarations in KeyEvent.java. */
@@ -1046,7 +1049,6 @@ static gboolean window_delete_cb (GtkWidget *widget, GdkEvent *event,
jobject peer);
static void window_destroy_cb (GtkWidget *widget, GdkEvent *event,
jobject peer);
-static void window_show_cb (GtkWidget *widget, jobject peer);
static void window_focus_state_change_cb (GtkWidget *widget,
GParamSpec *pspec,
jobject peer);
@@ -1322,9 +1324,6 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals
g_signal_connect (G_OBJECT (ptr), "destroy-event",
G_CALLBACK (window_destroy_cb), *gref);
- g_signal_connect (G_OBJECT (ptr), "show",
- G_CALLBACK (window_show_cb), *gref);
-
g_signal_connect (G_OBJECT (ptr), "notify::has-toplevel-focus",
G_CALLBACK (window_focus_state_change_cb), *gref);
@@ -1661,16 +1660,6 @@ window_destroy_cb (GtkWidget *widget __attribute__((unused)),
}
static void
-window_show_cb (GtkWidget *widget __attribute__((unused)),
- jobject peer)
-{
- (*cp_gtk_gdk_env())->CallVoidMethod (cp_gtk_gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_OPENED,
- (jobject) NULL, (jint) 0);
-}
-
-static void
window_focus_state_change_cb (GtkWidget *widget,
GParamSpec *pspec __attribute__((unused)),
jobject peer)
@@ -1718,41 +1707,24 @@ window_window_state_cb (GtkWidget *widget __attribute__((unused)),
GdkEvent *event,
jobject peer)
{
- jint new_state;
-
- /* Handle WINDOW_ICONIFIED and WINDOW_DEICONIFIED events. */
- if (event->window_state.changed_mask & GDK_WINDOW_STATE_ICONIFIED)
- {
- /* We've either been iconified or deiconified. */
- if (event->window_state.new_window_state & GDK_WINDOW_STATE_ICONIFIED)
- {
- /* We've been iconified. */
- (*cp_gtk_gdk_env())->CallVoidMethod (cp_gtk_gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_ICONIFIED,
- (jobject) NULL, (jint) 0);
- }
- else
- {
- /* We've been deiconified. */
- (*cp_gtk_gdk_env())->CallVoidMethod (cp_gtk_gdk_env(), peer,
- postWindowEventID,
- (jint) AWT_WINDOW_DEICONIFIED,
- (jobject) NULL, (jint) 0);
- }
- }
-
- /* Post a WINDOW_STATE_CHANGED event, passing the new frame state to
- GtkWindowPeer. */
- new_state = AWT_FRAME_STATE_NORMAL;
-
- if (event->window_state.new_window_state & GDK_WINDOW_STATE_ICONIFIED)
- new_state |= AWT_FRAME_STATE_ICONIFIED;
+ jint new_java_state = 0;
+ /* Put together the new state and let the java side figure out what
+ * to post */
+ GdkWindowState new_state = event->window_state.new_window_state;
+ /* The window can be either iconfified, maximized, iconified + maximized
+ * or normal. */
+ if ((new_state & GDK_WINDOW_STATE_ICONIFIED) != 0)
+ new_java_state |= AWT_FRAME_ICONIFIED;
+ if ((new_state & GDK_WINDOW_STATE_MAXIMIZED) != 0)
+ new_java_state |= AWT_FRAME_MAXIMIZED_BOTH;
+ if ((new_state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_ICONIFIED))
+ == 0)
+ new_java_state = AWT_FRAME_NORMAL;
(*cp_gtk_gdk_env())->CallVoidMethod (cp_gtk_gdk_env(), peer,
postWindowEventID,
(jint) AWT_WINDOW_STATE_CHANGED,
- (jobject) NULL, new_state);
+ (jobject) NULL, new_java_state);
return TRUE;
}
diff --git a/libjava/classpath/native/jni/gtk-peer/gtk_jawt.c b/libjava/classpath/native/jni/gtk-peer/gtk_jawt.c
index 763db8d1e8b..2348a63fb04 100644
--- a/libjava/classpath/native/jni/gtk-peer/gtk_jawt.c
+++ b/libjava/classpath/native/jni/gtk-peer/gtk_jawt.c
@@ -122,6 +122,41 @@ classpath_jawt_get_visualID (JNIEnv* env, jobject canvas)
/* Does not require locking: meant to be called after the drawing
surface is locked. */
+int
+classpath_jawt_get_depth (JNIEnv* env, jobject canvas)
+{
+ GtkWidget *widget;
+ GdkVisual *visual;
+ void *ptr;
+ jobject peer;
+ jclass class_id;
+ jmethodID method_id;
+
+ class_id = (*env)->GetObjectClass (env, canvas);
+
+ method_id = (*env)->GetMethodID (env, class_id,
+ "getPeer",
+ "()Ljava/awt/peer/ComponentPeer;");
+
+ peer = (*env)->CallObjectMethod (env, canvas, method_id);
+
+ ptr = NSA_GET_PTR (env, peer);
+
+ widget = GTK_WIDGET (ptr);
+
+ if (GTK_WIDGET_REALIZED (widget))
+ {
+ visual = gtk_widget_get_visual (widget);
+ g_assert (visual != NULL);
+
+ return visual->depth;
+ }
+ else
+ return (VisualID) NULL;
+}
+
+/* Does not require locking: meant to be called after the drawing
+ surface is locked. */
Drawable
classpath_jawt_get_drawable (JNIEnv* env, jobject canvas)
{
diff --git a/libjava/classpath/native/jni/java-io/.cvsignore b/libjava/classpath/native/jni/java-io/.cvsignore
new file mode 100644
index 00000000000..e9f2658a694
--- /dev/null
+++ b/libjava/classpath/native/jni/java-io/.cvsignore
@@ -0,0 +1,8 @@
+*.o
+*.a
+*.lo
+*.la
+.libs
+.deps
+Makefile
+Makefile.in
diff --git a/libjava/classpath/native/jni/java-io/Makefile.am b/libjava/classpath/native/jni/java-io/Makefile.am
index ac7cf287247..637c74c61f3 100644
--- a/libjava/classpath/native/jni/java-io/Makefile.am
+++ b/libjava/classpath/native/jni/java-io/Makefile.am
@@ -4,7 +4,8 @@ libjavaio_la_SOURCES = java_io_VMFile.c \
java_io_VMObjectInputStream.c \
java_io_VMObjectStreamClass.c
-libjavaio_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo
+libjavaio_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo \
+ $(top_builddir)/native/jni/native-lib/libclasspathnative.la
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
diff --git a/libjava/classpath/native/jni/java-io/Makefile.in b/libjava/classpath/native/jni/java-io/Makefile.in
index bf8d17a71a7..88f39846aa9 100644
--- a/libjava/classpath/native/jni/java-io/Makefile.in
+++ b/libjava/classpath/native/jni/java-io/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -63,7 +65,8 @@ am__installdirs = "$(DESTDIR)$(nativeexeclibdir)"
nativeexeclibLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(nativeexeclib_LTLIBRARIES)
libjavaio_la_DEPENDENCIES = \
- $(top_builddir)/native/jni/classpath/jcl.lo
+ $(top_builddir)/native/jni/classpath/jcl.lo \
+ $(top_builddir)/native/jni/native-lib/libclasspathnative.la
am_libjavaio_la_OBJECTS = java_io_VMFile.lo \
java_io_VMObjectInputStream.lo java_io_VMObjectStreamClass.lo
libjavaio_la_OBJECTS = $(am_libjavaio_la_OBJECTS)
@@ -185,6 +188,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -306,14 +311,15 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
nativeexeclib_LTLIBRARIES = libjavaio.la
libjavaio_la_SOURCES = java_io_VMFile.c \
java_io_VMObjectInputStream.c \
java_io_VMObjectStreamClass.c
-libjavaio_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo
+libjavaio_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo \
+ $(top_builddir)/native/jni/native-lib/libclasspathnative.la
+
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
diff --git a/libjava/classpath/native/jni/java-io/java_io_VMFile.c b/libjava/classpath/native/jni/java-io/java_io_VMFile.c
index 7a3fdaf43a8..de1320b0cab 100644
--- a/libjava/classpath/native/jni/java-io/java_io_VMFile.c
+++ b/libjava/classpath/native/jni/java-io/java_io_VMFile.c
@@ -38,17 +38,20 @@ exception statement from your version. */
/* do not move; needed here because of some macro definitions */
#include <config.h>
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#if defined (HAVE_LSTAT) && defined (HAVE_READLINK)
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#endif
+
#include <jni.h>
#include <jcl.h>
-
-#include "target_native.h"
-#ifndef WITHOUT_FILESYSTEM
-#include "target_native_file.h"
-#endif
-#include "target_native_math_int.h"
+#include "cpio.h"
+#include "cpnative.h"
#include "java_io_VMFile.h"
@@ -75,26 +78,25 @@ Java_java_io_VMFile_create (JNIEnv * env,
filename = JCL_jstring_to_cstring (env, name);
if (filename == NULL)
{
- return (0);
+ return 0;
}
- TARGET_NATIVE_FILE_OPEN_CREATE (filename, fd, result);
- if (result != TARGET_NATIVE_OK)
+ result = cpio_openFile (filename, &fd, CPFILE_FLAG_CREATE|CPFILE_FLAG_WRITE, CPFILE_PERMISSION_NORMAL);
+ if (result != CPNATIVE_OK)
{
- /* XXX ??? NYI */
- if (errno != EEXIST)
+ if (result != EEXIST)
JCL_ThrowException (env,
"java/io/IOException",
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
JCL_free_cstring (env, name, filename);
- return (0);
+ return 0;
}
- TARGET_NATIVE_FILE_CLOSE (fd, result);
+ cpio_closeFile (fd);
JCL_free_cstring (env, name, filename);
- return (1);
+ return 1;
#else /* not WITHOUT_FILESYSTEM */
- return (0);
+ return 0;
#endif /* not WITHOUT_FILESYSTEM */
}
@@ -123,22 +125,20 @@ Java_java_io_VMFile_canRead (JNIEnv * env,
filename = (*env)->GetStringUTFChars (env, name, 0);
if (filename == NULL)
{
- return (0);
+ return 0;
}
/* The lazy man's way out. We actually do open the file for reading
briefly to verify it can be done */
- TARGET_NATIVE_FILE_OPEN_READ (filename, fd, result);
+ result = cpio_openFile (filename, &fd, CPFILE_FLAG_READ, 0);
(*env)->ReleaseStringUTFChars (env, name, filename);
- if (result != TARGET_NATIVE_OK)
- {
- return (0);
- }
- TARGET_NATIVE_FILE_CLOSE (fd, result);
+ if (result != CPNATIVE_OK)
+ return 0;
+ cpio_closeFile (fd);
- return (1);
+ return 1;
#else /* not WITHOUT_FILESYSTEM */
- return (0);
+ return 0;
#endif /* not WITHOUT_FILESYSTEM */
}
@@ -167,22 +167,22 @@ Java_java_io_VMFile_canWrite (JNIEnv * env,
filename = (*env)->GetStringUTFChars (env, name, 0);
if (filename == NULL)
{
- return (0);
+ return 0;
}
/* The lazy man's way out. We actually do open the file for writing
briefly to verify it can be done */
- TARGET_NATIVE_FILE_OPEN_READWRITE (filename, fd, result);
+ result = cpio_openFile (filename, &fd, CPFILE_FLAG_READWRITE, 0);
(*env)->ReleaseStringUTFChars (env, name, filename);
- if (result != TARGET_NATIVE_OK)
+ if (result != CPNATIVE_OK)
{
- return (0);
+ return 0;
}
- TARGET_NATIVE_FILE_CLOSE (fd, result);
+ cpio_closeFile (fd);
- return (1);
+ return 1;
#else /* not WITHOUT_FILESYSTEM */
- return (0);
+ return 0;
#endif /* not WITHOUT_FILESYSTEM */
}
@@ -210,15 +210,15 @@ Java_java_io_VMFile_setReadOnly (JNIEnv * env,
filename = (*env)->GetStringUTFChars (env, name, 0);
if (filename == NULL)
{
- return (0);
+ return 0;
}
- TARGET_NATIVE_FILE_SET_MODE_READONLY (filename, result);
+ result = cpio_setFileReadonly (filename);
(*env)->ReleaseStringUTFChars (env, name, filename);
- return ((result == TARGET_NATIVE_OK) ? 1 : 0);
+ return result == CPNATIVE_OK ? 1 : 0;
#else /* not WITHOUT_FILESYSTEM */
- return (0);
+ return 0;
#endif /* not WITHOUT_FILESYSTEM */
}
@@ -246,15 +246,15 @@ Java_java_io_VMFile_exists (JNIEnv * env,
filename = (*env)->GetStringUTFChars (env, name, 0);
if (filename == NULL)
{
- return (0);
+ return 0;
}
- TARGET_NATIVE_FILE_EXISTS (filename, result);
+ result = cpio_isFileExists (filename);
(*env)->ReleaseStringUTFChars (env, name, filename);
- return ((result == TARGET_NATIVE_OK) ? 1 : 0);
+ return result == CPNATIVE_OK ? 1 : 0;
#else /* not WITHOUT_FILESYSTEM */
- return (0);
+ return 0;
#endif /* not WITHOUT_FILESYSTEM */
}
@@ -277,21 +277,22 @@ Java_java_io_VMFile_isFile (JNIEnv * env,
#ifndef WITHOUT_FILESYSTEM
const char *filename;
int result;
+ jint entryType;
/* Don't use the JCL convert function because it throws an exception
on failure */
filename = (*env)->GetStringUTFChars (env, name, 0);
if (filename == NULL)
{
- return (0);
+ return 0;
}
- TARGET_NATIVE_FILE_IS_FILE (filename, result);
+ result = cpio_checkType (filename, &entryType);
(*env)->ReleaseStringUTFChars (env, name, filename);
- return ((result == TARGET_NATIVE_OK) ? 1 : 0);
+ return result == CPNATIVE_OK && entryType == CPFILE_FILE ? 1 : 0;
#else /* not WITHOUT_FILESYSTEM */
- return (0);
+ return 0;
#endif /* not WITHOUT_FILESYSTEM */
}
@@ -313,21 +314,22 @@ Java_java_io_VMFile_isDirectory (JNIEnv * env,
#ifndef WITHOUT_FILESYSTEM
const char *filename;
int result;
+ jint entryType;
/* Don't use the JCL convert function because it throws an exception
on failure */
filename = (*env)->GetStringUTFChars (env, name, 0);
if (filename == NULL)
{
- return (0);
+ return 0;
}
-
- TARGET_NATIVE_FILE_IS_DIRECTORY (filename, result);
+
+ result = cpio_checkType (filename, &entryType);
(*env)->ReleaseStringUTFChars (env, name, filename);
- return ((result == TARGET_NATIVE_OK) ? 1 : 0);
+ return result == CPNATIVE_OK && entryType == CPFILE_DIRECTORY ? 1 : 0;
#else /* not WITHOUT_FILESYSTEM */
- return (0);
+ return 0;
#endif /* not WITHOUT_FILESYSTEM */
}
@@ -356,29 +358,26 @@ Java_java_io_VMFile_length (JNIEnv * env,
on failure */
filename = (*env)->GetStringUTFChars (env, name, 0);
if (filename == NULL)
- {
- return (TARGET_NATIVE_MATH_INT_INT64_CONST_0);
- }
+ return 0;
/* open file for reading, get size and close file */
- TARGET_NATIVE_FILE_OPEN_READ (filename, tmpfd, result);
- if (result != TARGET_NATIVE_OK)
- {
- return (TARGET_NATIVE_MATH_INT_INT64_CONST_0);
- }
- TARGET_NATIVE_FILE_SIZE (tmpfd, length, result);
- if (result != TARGET_NATIVE_OK)
+ result = cpio_openFile (filename, &tmpfd, CPFILE_FLAG_READ, 0);
+ if (result != CPNATIVE_OK)
+ return 0;
+
+ result = cpio_getFileSize (tmpfd, &length);
+ if (result != CPNATIVE_OK)
{
- TARGET_NATIVE_FILE_CLOSE (tmpfd, result);
- return (TARGET_NATIVE_MATH_INT_INT64_CONST_0);
+ cpio_closeFile (tmpfd);
+ return 0;
}
- TARGET_NATIVE_FILE_CLOSE (tmpfd, result);
+
+ result = cpio_closeFile (tmpfd);
(*env)->ReleaseStringUTFChars (env, name, filename);
- return ((result ==
- TARGET_NATIVE_OK) ? length : TARGET_NATIVE_MATH_INT_INT64_CONST_0);
+ return result == CPNATIVE_OK ? length : 0;
#else /* not WITHOUT_FILESYSTEM */
- return (TARGET_NATIVE_MATH_INT_INT64_CONST_0);
+ return 0;
#endif /* not WITHOUT_FILESYSTEM */
}
@@ -407,16 +406,15 @@ Java_java_io_VMFile_lastModified (JNIEnv * env,
filename = (*env)->GetStringUTFChars (env, name, 0);
if (filename == NULL)
{
- return (TARGET_NATIVE_MATH_INT_INT64_CONST_0);
+ return 0;
}
- TARGET_NATIVE_FILE_GET_LAST_MODIFIED (filename, mtime, result);
+ result = cpio_getModificationTime (filename, &mtime);
(*env)->ReleaseStringUTFChars (env, name, filename);
- return ((result ==
- TARGET_NATIVE_OK) ? mtime : TARGET_NATIVE_MATH_INT_INT64_CONST_0);
+ return result == CPNATIVE_OK ? mtime : 0;
#else /* not WITHOUT_FILESYSTEM */
- return (TARGET_NATIVE_MATH_INT_INT64_CONST_0);
+ return 0;
#endif /* not WITHOUT_FILESYSTEM */
}
@@ -444,15 +442,15 @@ Java_java_io_VMFile_setLastModified (JNIEnv * env,
filename = (*env)->GetStringUTFChars (env, name, 0);
if (filename == NULL)
{
- return (0);
+ return 0;
}
- TARGET_NATIVE_FILE_SET_LAST_MODIFIED (filename, newtime, result);
+ result = cpio_setModificationTime (filename, newtime);
(*env)->ReleaseStringUTFChars (env, name, filename);
- return ((result == TARGET_NATIVE_OK) ? 1 : 0);
+ return result == CPNATIVE_OK ? 1 : 0;
#else /* not WITHOUT_FILESYSTEM */
- return (0);
+ return 0;
#endif /* not WITHOUT_FILESYSTEM */
}
@@ -481,15 +479,15 @@ Java_java_io_VMFile_delete (JNIEnv * env,
filename = (*env)->GetStringUTFChars (env, name, 0);
if (filename == NULL)
{
- return (0);
+ return 0;
}
- TARGET_NATIVE_FILE_DELETE (filename, result);
+ result = cpio_removeFile (filename);
(*env)->ReleaseStringUTFChars (env, name, filename);
- return ((result == TARGET_NATIVE_OK) ? 1 : 0);
+ return result == CPNATIVE_OK ? 1 : 0;
#else /* not WITHOUT_FILESYSTEM */
- return (0);
+ return 0;
#endif /* not WITHOUT_FILESYSTEM */
}
@@ -517,15 +515,15 @@ Java_java_io_VMFile_mkdir (JNIEnv * env,
pathname = (*env)->GetStringUTFChars (env, name, 0);
if (pathname == NULL)
{
- return (0);
+ return 0;
}
- TARGET_NATIVE_FILE_MAKE_DIR (pathname, result);
+ result = cpio_mkdir (pathname);
(*env)->ReleaseStringUTFChars (env, name, pathname);
- return ((result == TARGET_NATIVE_OK) ? 1 : 0);
+ return (result == CPNATIVE_OK) ? 1 : 0;
#else /* not WITHOUT_FILESYSTEM */
- return (0);
+ return 0;
#endif /* not WITHOUT_FILESYSTEM */
}
@@ -553,23 +551,23 @@ Java_java_io_VMFile_renameTo (JNIEnv * env,
old_filename = (*env)->GetStringUTFChars (env, t, 0);
if (old_filename == NULL)
{
- return (0);
+ return 0;
}
new_filename = (*env)->GetStringUTFChars (env, d, 0);
if (new_filename == NULL)
{
(*env)->ReleaseStringUTFChars (env, t, old_filename);
- return (0);
+ return 0;
}
- TARGET_NATIVE_FILE_RENAME (old_filename, new_filename, result);
+ result = cpio_rename (old_filename, new_filename);
(*env)->ReleaseStringUTFChars (env, d, new_filename);
(*env)->ReleaseStringUTFChars (env, t, old_filename);
- return ((result == TARGET_NATIVE_OK) ? 1 : 0);
+ return (result == CPNATIVE_OK) ? 1 : 0;
#else /* not WITHOUT_FILESYSTEM */
- return (0);
+ return 0;
#endif /* not WITHOUT_FILESYSTEM */
}
@@ -595,7 +593,7 @@ Java_java_io_VMFile_list (JNIEnv * env, jobject obj
int result;
char **filelist;
void *handle;
- const char *filename;
+ char *filename = (char *) JCL_malloc (env, FILENAME_MAX);
unsigned long int filelist_count, max_filelist_count;
char **tmp_filelist;
jclass str_clazz;
@@ -608,32 +606,32 @@ Java_java_io_VMFile_list (JNIEnv * env, jobject obj
dirname = (*env)->GetStringUTFChars (env, name, 0);
if (dirname == NULL)
{
- return (0);
+ return 0;
}
/* open directory for reading */
- TARGET_NATIVE_FILE_OPEN_DIR (dirname, handle, result);
+ result = cpio_openDir (dirname, &handle);
(*env)->ReleaseStringUTFChars (env, name, dirname);
- if (result != TARGET_NATIVE_OK)
+ if (result != CPNATIVE_OK)
{
- return (0);
+ return 0;
}
/* allocate filelist */
filelist = (char **) JCL_malloc (env, sizeof (char *) * REALLOC_SIZE);
if (filelist == NULL)
{
- TARGET_NATIVE_FILE_CLOSE_DIR (handle, result);
- return (0);
+ result = cpio_closeDir (handle);
+ return 0;
}
filelist_count = 0;
max_filelist_count = REALLOC_SIZE;
/* read the files from the directory */
- TARGET_NATIVE_FILE_READ_DIR (handle, filename, result);
- while (result == TARGET_NATIVE_OK)
+ result = cpio_readDir (handle, filename);
+ while (result == CPNATIVE_OK)
{
if ((strcmp (filename, ".") != 0) && (strcmp (filename, "..") != 0))
{
@@ -652,8 +650,8 @@ Java_java_io_VMFile_list (JNIEnv * env, jobject obj
JCL_free (env, filelist[i]);
}
JCL_free (env, filelist);
- TARGET_NATIVE_FILE_CLOSE_DIR (handle, result);
- return (0);
+ result = cpio_closeDir (handle);
+ return 0;
}
filelist = tmp_filelist;
max_filelist_count += REALLOC_SIZE;
@@ -668,11 +666,13 @@ Java_java_io_VMFile_list (JNIEnv * env, jobject obj
}
/* read next directory entry */
- TARGET_NATIVE_FILE_READ_DIR (handle, filename, result);
+ result = cpio_readDir (handle, filename);
}
+ JCL_free (env, filename);
+
/* close directory */
- TARGET_NATIVE_FILE_CLOSE_DIR (handle, result);
+ result = cpio_closeDir (handle);
/* put the list of files into a Java String array and return it */
str_clazz = (*env)->FindClass (env, "java/lang/String");
@@ -683,7 +683,7 @@ Java_java_io_VMFile_list (JNIEnv * env, jobject obj
JCL_free (env, filelist[i]);
}
JCL_free (env, filelist);
- return (0);
+ return 0;
}
filearray = (*env)->NewObjectArray (env, filelist_count, str_clazz, 0);
if (filearray == NULL)
@@ -693,8 +693,11 @@ Java_java_io_VMFile_list (JNIEnv * env, jobject obj
JCL_free (env, filelist[i]);
}
JCL_free (env, filelist);
- return (0);
+ return 0;
}
+
+ (*env)->DeleteLocalRef (env, str_clazz);
+
for (i = 0; i < filelist_count; i++)
{
/* create new string */
@@ -708,7 +711,7 @@ Java_java_io_VMFile_list (JNIEnv * env, jobject obj
JCL_free (env, filelist[i]);
}
JCL_free (env, filelist);
- return (0);
+ return 0;
}
/* save into array */
@@ -725,9 +728,9 @@ Java_java_io_VMFile_list (JNIEnv * env, jobject obj
}
JCL_free (env, filelist);
- return (filearray);
+ return filearray;
#else /* not WITHOUT_FILESYSTEM */
- return (0);
+ return 0;
#endif /* not WITHOUT_FILESYSTEM */
}
diff --git a/libjava/classpath/native/jni/java-lang/.cvsignore b/libjava/classpath/native/jni/java-lang/.cvsignore
new file mode 100644
index 00000000000..e9f2658a694
--- /dev/null
+++ b/libjava/classpath/native/jni/java-lang/.cvsignore
@@ -0,0 +1,8 @@
+*.o
+*.a
+*.lo
+*.la
+.libs
+.deps
+Makefile
+Makefile.in
diff --git a/libjava/classpath/native/jni/java-lang/Makefile.am b/libjava/classpath/native/jni/java-lang/Makefile.am
index 06deb62b810..366d72e4c12 100644
--- a/libjava/classpath/native/jni/java-lang/Makefile.am
+++ b/libjava/classpath/native/jni/java-lang/Makefile.am
@@ -7,7 +7,8 @@ libjavalang_la_SOURCES = java_lang_VMSystem.c \
java_lang_VMProcess.c
libjavalang_la_LIBADD = $(wildcard $(top_builddir)/native/fdlibm/*.lo) \
- $(top_builddir)/native/jni/classpath/jcl.lo
+ $(top_builddir)/native/jni/classpath/jcl.lo \
+ $(top_builddir)/native/jni/native-lib/libclasspathnative.la
libjavalangreflect_la_SOURCES = java_lang_reflect_VMArray.c
diff --git a/libjava/classpath/native/jni/java-lang/Makefile.in b/libjava/classpath/native/jni/java-lang/Makefile.in
index c8f3dabb291..4a99863f30b 100644
--- a/libjava/classpath/native/jni/java-lang/Makefile.in
+++ b/libjava/classpath/native/jni/java-lang/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -64,7 +66,8 @@ nativeexeclibLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(nativeexeclib_LTLIBRARIES)
libjavalang_la_DEPENDENCIES = $(wildcard \
$(top_builddir)/native/fdlibm/*.lo) \
- $(top_builddir)/native/jni/classpath/jcl.lo
+ $(top_builddir)/native/jni/classpath/jcl.lo \
+ $(top_builddir)/native/jni/native-lib/libclasspathnative.la
am_libjavalang_la_OBJECTS = java_lang_VMSystem.lo java_lang_VMFloat.lo \
java_lang_VMDouble.lo java_lang_VMMath.lo \
java_lang_VMProcess.lo
@@ -191,6 +194,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -312,7 +317,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
nativeexeclib_LTLIBRARIES = libjavalang.la libjavalangreflect.la
libjavalang_la_SOURCES = java_lang_VMSystem.c \
@@ -322,7 +326,8 @@ libjavalang_la_SOURCES = java_lang_VMSystem.c \
java_lang_VMProcess.c
libjavalang_la_LIBADD = $(wildcard $(top_builddir)/native/fdlibm/*.lo) \
- $(top_builddir)/native/jni/classpath/jcl.lo
+ $(top_builddir)/native/jni/classpath/jcl.lo \
+ $(top_builddir)/native/jni/native-lib/libclasspathnative.la
libjavalangreflect_la_SOURCES = java_lang_reflect_VMArray.c
AM_LDFLAGS = @CLASSPATH_MODULE@
diff --git a/libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c b/libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c
index 8435c3fdba7..2ee1f31466b 100644
--- a/libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c
+++ b/libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c
@@ -37,6 +37,7 @@ obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+#include <assert.h>
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
@@ -121,17 +122,8 @@ Java_java_lang_VMDouble_doubleToLongBits
{
jvalue val;
jlong e, f;
- val.d = doubleValue;
-
-#if defined(__IEEE_BYTES_LITTLE_ENDIAN)
- /* On little endian ARM processors when using FPA, word order of
- doubles is still big endian. So take that into account here. When
- using VFP, word order of doubles follows byte order. */
-
-#define SWAP_DOUBLE(a) (((a) << 32) | (((a) >> 32) & 0x00000000ffffffff))
- val.j = SWAP_DOUBLE(val.j);
-#endif
+ val.d = doubleValue;
e = val.j & 0x7ff0000000000000LL;
f = val.j & 0x000fffffffffffffLL;
@@ -153,11 +145,8 @@ Java_java_lang_VMDouble_doubleToRawLongBits
jclass cls __attribute__ ((__unused__)), jdouble doubleValue)
{
jvalue val;
- val.d = doubleValue;
-#if defined(__IEEE_BYTES_LITTLE_ENDIAN)
- val.j = SWAP_DOUBLE(val.j);
-#endif
+ val.d = doubleValue;
return val.j;
}
@@ -173,52 +162,139 @@ Java_java_lang_VMDouble_longBitsToDouble
jclass cls __attribute__ ((__unused__)), jlong longValue)
{
jvalue val;
- val.j = longValue;
-#if defined(__IEEE_BYTES_LITTLE_ENDIAN)
- val.j = SWAP_DOUBLE(val.j);
-#endif
+ val.j = longValue;
return val.d;
}
-/*
- * Class: java_lang_VMDouble
- * Method: toString
- * Signature: (DZ)Ljava/lang/String;
+/**
+ * Parse a double from a char array.
*/
-JNIEXPORT jstring JNICALL
-Java_java_lang_VMDouble_toString
- (JNIEnv * env, jclass cls __attribute__ ((__unused__)), jdouble value, jboolean isFloat)
+static jdouble
+parseDoubleFromChars(JNIEnv * env, const char * buf)
{
- char buffer[50], result[50];
- int decpt, sign;
- char *s, *d;
- int i;
+ char *endptr;
+ jdouble val = 0.0;
+ const char *p = buf, *end, *last_non_ws, *temp;
+ int ok = 1;
#ifdef DEBUG
- fprintf (stderr, "java.lang.VMDouble.toString (%g)\n", value);
+ fprintf (stderr, "java.lang.VMDouble.parseDouble (%s)\n", buf);
#endif
- if ((*env)->CallStaticBooleanMethod (env, clsDouble, isNaNID, value))
- return (*env)->NewStringUTF (env, "NaN");
+ /* Trim the buffer, similar to String.trim(). First the leading
+ characters. */
+ while (*p && *p <= ' ')
+ ++p;
- if (value == POSITIVE_INFINITY)
- return (*env)->NewStringUTF (env, "Infinity");
+ /* Find the last non-whitespace character. This method is safe
+ even with multi-byte UTF-8 characters. */
+ end = p;
+ last_non_ws = NULL;
+ while (*end)
+ {
+ if (*end > ' ')
+ last_non_ws = end;
+ ++end;
+ }
- if (value == NEGATIVE_INFINITY)
- return (*env)->NewStringUTF (env, "-Infinity");
+ if (last_non_ws == NULL)
+ last_non_ws = p + strlen (p);
+ else
+ {
+ /* Skip past the last non-whitespace character. */
+ ++last_non_ws;
+ }
- _dtoa (value, 0, 20, &decpt, &sign, NULL, buffer, (int) isFloat);
+ /* Check for infinity and NaN */
+ temp = p;
+ if (temp[0] == '+' || temp[0] == '-')
+ temp++;
+ if (strncmp ("Infinity", temp, (size_t) 8) == 0)
+ {
+ if (p[0] == '-')
+ return NEGATIVE_INFINITY;
+ return POSITIVE_INFINITY;
+ }
+ if (strncmp ("NaN", temp, (size_t) 3) == 0)
+ return NaN;
+
+ /* Skip a trailing `f' or `d'. */
+ if (last_non_ws > p
+ && (last_non_ws[-1] == 'f'
+ || last_non_ws[-1] == 'F'
+ || last_non_ws[-1] == 'd' || last_non_ws[-1] == 'D'))
+ --last_non_ws;
+
+ if (last_non_ws > p)
+ {
+ struct _Jv_reent reent;
+ memset (&reent, 0, sizeof reent);
+
+ val = _strtod_r (&reent, p, &endptr);
+
+#ifdef DEBUG
+ fprintf (stderr, "java.lang.VMDouble.parseDouble val = %g\n", val);
+ fprintf (stderr, "java.lang.VMDouble.parseDouble %i != %i ???\n",
+ endptr, last_non_ws);
+#endif
+ if (endptr != last_non_ws)
+ ok = 0;
+ }
+ else
+ ok = 0;
+
+ if (!ok)
+ {
+ val = 0.0;
+ JCL_ThrowException (env,
+ "java/lang/NumberFormatException",
+ "unable to parse double");
+ }
+
+ return val;
+}
+
+#define MAXIMAL_DECIMAL_STRING_LENGTH 64
+
+/**
+ * Use _dtoa to print a double or a float as a string with the given precision.
+ */
+static void
+dtoa_toString
+(char * buffer, jdouble value, jint precision, jboolean isFloat)
+{
+ const int DTOA_MODE = 2;
+ char result[MAXIMAL_DECIMAL_STRING_LENGTH];
+ int decpt, sign;
+ char *s, *d;
+ int i;
+
+ /* use mode 2 to get at the digit stream, all other modes are useless
+ *
+ * since mode 2 only gives us as many digits as we need in precision, we need to
+ * add the digits in front of the floating point to it, if there is more than one
+ * to be printed. That's the case if the value is going to be printed using the
+ * normal notation, i.e. if it is 0 or >= 1.0e-3 and < 1.0e7.
+ */
+ int digits_in_front_of_floating_point = ceil(log10(value));
+
+ if (digits_in_front_of_floating_point > 1 && digits_in_front_of_floating_point < 7)
+ precision += digits_in_front_of_floating_point;
+
+ _dtoa (value, DTOA_MODE, precision, &decpt, &sign, NULL, buffer, (int) isFloat);
value = fabs (value);
s = buffer;
d = result;
+ /* Handle negative sign */
if (sign)
*d++ = '-';
+ /* Handle normal represenation */
if ((value >= 1e-3 && value < 1e7) || (value == 0))
{
if (decpt <= 0)
@@ -248,46 +324,111 @@ Java_java_lang_VMDouble_toString
*d = 0;
- return (*env)->NewStringUTF (env, result);
}
+ /* Handle scientific representaiton */
+ else
+ {
+ *d++ = *s++;
+ decpt--;
+ *d++ = '.';
+
+ if (*s == 0)
+ *d++ = '0';
- *d++ = *s++;
- decpt--;
- *d++ = '.';
+ while (*s)
+ *d++ = *s++;
- if (*s == 0)
- *d++ = '0';
+ *d++ = 'E';
- while (*s)
- *d++ = *s++;
+ if (decpt < 0)
+ {
+ *d++ = '-';
+ decpt = -decpt;
+ }
- *d++ = 'E';
+ {
+ char exp[4];
+ char *e = exp + sizeof exp;
+
+ *--e = 0;
+ do
+ {
+ *--e = '0' + decpt % 10;
+ decpt /= 10;
+ }
+ while (decpt > 0);
+
+ while (*e)
+ *d++ = *e++;
+ }
- if (decpt < 0)
- {
- *d++ = '-';
- decpt = -decpt;
+ *d = 0;
}
- {
- char exp[4];
- char *e = exp + sizeof exp;
+ /* copy the result into the buffer */
+ memcpy(buffer, result, MAXIMAL_DECIMAL_STRING_LENGTH);
+}
- *--e = 0;
- do
- {
- *--e = '0' + decpt % 10;
- decpt /= 10;
- }
- while (decpt > 0);
+/*
+ * Class: java_lang_VMDouble
+ * Method: toString
+ * Signature: (DZ)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_java_lang_VMDouble_toString
+ (JNIEnv * env, jclass cls __attribute__ ((__unused__)), jdouble value, jboolean isFloat)
+{
+ char buf[MAXIMAL_DECIMAL_STRING_LENGTH];
+ const jint MAXIMAL_FLOAT_PRECISION = 10;
+ const jint MAXIMAL_DOUBLE_PRECISION = 19;
- while (*e)
- *d++ = *e++;
- }
+ jint maximal_precision;
+ jint least_necessary_precision = 2;
+ jboolean parsed_value_unequal;
+
+ if ((*env)->CallStaticBooleanMethod (env, clsDouble, isNaNID, value))
+ return (*env)->NewStringUTF (env, "NaN");
+
+ if (value == POSITIVE_INFINITY)
+ return (*env)->NewStringUTF (env, "Infinity");
+
+ if (value == NEGATIVE_INFINITY)
+ return (*env)->NewStringUTF (env, "-Infinity");
+
+ if (isFloat)
+ maximal_precision = MAXIMAL_FLOAT_PRECISION;
+ else
+ maximal_precision = MAXIMAL_DOUBLE_PRECISION;
+
+ /* Try to find the 'good enough' precision,
+ * that results in enough digits being printed to be able to
+ * convert the number back into the original double, but no
+ * further digits.
+ */
+
+ do {
+ jdouble parsed_value;
- *d = 0;
+ assert(least_necessary_precision <= maximal_precision);
- return (*env)->NewStringUTF (env, result);
+ /* Convert the value to a string and back. */
+ dtoa_toString(buf, value, least_necessary_precision, isFloat);
+
+ parsed_value = parseDoubleFromChars(env, buf);
+
+ /* Check whether the original value, and the value after conversion match. */
+ /* We need to cast floats to float to make sure that our ineqality check works
+ * well for floats as well as for doubles.
+ */
+ parsed_value_unequal = ( isFloat ?
+ (float) parsed_value != (float) value :
+ parsed_value != value);
+
+ least_necessary_precision++;
+ }
+ while (parsed_value_unequal);
+
+ return (*env)->NewStringUTF (env, buf);
}
/*
@@ -301,7 +442,6 @@ Java_java_lang_VMDouble_parseDouble
{
jboolean isCopy;
const char *buf;
- char *endptr;
jdouble val = 0.0;
if (str == NULL)
@@ -317,83 +457,7 @@ Java_java_lang_VMDouble_parseDouble
}
else
{
- const char *p = buf, *end, *last_non_ws, *temp;
- int ok = 1;
-
-#ifdef DEBUG
- fprintf (stderr, "java.lang.VMDouble.parseDouble (%s)\n", buf);
-#endif
-
- /* Trim the buffer, similar to String.trim(). First the leading
- characters. */
- while (*p && *p <= ' ')
- ++p;
-
- /* Find the last non-whitespace character. This method is safe
- even with multi-byte UTF-8 characters. */
- end = p;
- last_non_ws = NULL;
- while (*end)
- {
- if (*end > ' ')
- last_non_ws = end;
- ++end;
- }
-
- if (last_non_ws == NULL)
- last_non_ws = p + strlen (p);
- else
- {
- /* Skip past the last non-whitespace character. */
- ++last_non_ws;
- }
-
- /* Check for infinity and NaN */
- temp = p;
- if (temp[0] == '+' || temp[0] == '-')
- temp++;
- if (strncmp ("Infinity", temp, (size_t) 8) == 0)
- {
- if (p[0] == '-')
- return NEGATIVE_INFINITY;
- return POSITIVE_INFINITY;
- }
- if (strncmp ("NaN", temp, (size_t) 3) == 0)
- return NaN;
-
- /* Skip a trailing `f' or `d'. */
- if (last_non_ws > p
- && (last_non_ws[-1] == 'f'
- || last_non_ws[-1] == 'F'
- || last_non_ws[-1] == 'd' || last_non_ws[-1] == 'D'))
- --last_non_ws;
-
- if (last_non_ws > p)
- {
- struct _Jv_reent reent;
- memset (&reent, 0, sizeof reent);
-
- val = _strtod_r (&reent, p, &endptr);
-
-#ifdef DEBUG
- fprintf (stderr, "java.lang.VMDouble.parseDouble val = %g\n", val);
- fprintf (stderr, "java.lang.VMDouble.parseDouble %i != %i ???\n",
- endptr, last_non_ws);
-#endif
- if (endptr != last_non_ws)
- ok = 0;
- }
- else
- ok = 0;
-
- if (!ok)
- {
- val = 0.0;
- JCL_ThrowException (env,
- "java/lang/NumberFormatException",
- "unable to parse double");
- }
-
+ val = parseDoubleFromChars(env, buf);
(*env)->ReleaseStringUTFChars (env, str, buf);
}
diff --git a/libjava/classpath/native/jni/java-lang/java_lang_VMProcess.c b/libjava/classpath/native/jni/java-lang/java_lang_VMProcess.c
index f13a94f1889..a6076f2aea9 100644
--- a/libjava/classpath/native/jni/java-lang/java_lang_VMProcess.c
+++ b/libjava/classpath/native/jni/java-lang/java_lang_VMProcess.c
@@ -38,7 +38,7 @@ exception statement from your version. */
#include <config.h>
#include "java_lang_VMProcess.h"
-#include "gnu_java_nio_channels_FileChannelImpl.h"
+#include "gnu_java_nio_FileChannelImpl.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -50,10 +50,8 @@ exception statement from your version. */
#include <fcntl.h>
#include <stdio.h>
-#include <jcl.h>
-
-#include "target_native.h"
-#include "target_native_misc.h"
+#include "cpnative.h"
+#include "cpproc.h"
/* Internal functions */
static char *copy_string (JNIEnv * env, jobject string);
@@ -65,7 +63,6 @@ static char *copy_elem (JNIEnv * env, jobject stringArray, jint i);
static char *
copy_string (JNIEnv * env, jobject string)
{
- char errbuf[64];
const char *utf;
jclass clazz;
char *copy;
@@ -89,12 +86,10 @@ copy_string (JNIEnv * env, jobject string)
/* Copy it */
if ((copy = strdup (utf)) == NULL)
{
- TARGET_NATIVE_MISC_FORMAT_STRING1 (errbuf, sizeof (errbuf),
- "strdup: %s", strerror (errno));
clazz = (*env)->FindClass (env, "java/lang/InternalError");
if ((*env)->ExceptionOccurred (env))
return NULL;
- (*env)->ThrowNew (env, clazz, errbuf);
+ (*env)->ThrowNew (env, clazz, "strdup returned NULL");
(*env)->DeleteLocalRef (env, clazz);
}
@@ -131,8 +126,8 @@ Java_java_lang_VMProcess_nativeSpawn (JNIEnv * env, jobject this,
jobjectArray envArray, jobject dirFile,
jboolean redirect)
{
- int fds[3][2] = { {-1, -1}, {-1, -1}, {-1, -1} };
- jobject streams[3] = { NULL, NULL, NULL };
+ int fds[CPIO_EXEC_NUM_PIPES];
+ jobject streams[CPIO_EXEC_NUM_PIPES] = { NULL, NULL, NULL };
jobject dirString = NULL;
char **newEnviron = NULL;
jsize cmdArrayLen = 0;
@@ -142,10 +137,11 @@ Java_java_lang_VMProcess_nativeSpawn (JNIEnv * env, jobject this,
char *dir = NULL;
pid_t pid = -1;
char errbuf[64];
- jmethodID method;
- jclass clazz;
+ jmethodID method, vmmethod;
+ jclass clazz, vmclazz;
int i;
int pipe_count = redirect ? 2 : 3;
+ int err;
/* Check for null */
if (cmdArray == NULL)
@@ -182,9 +178,7 @@ Java_java_lang_VMProcess_nativeSpawn (JNIEnv * env, jobject this,
+ (dirString !=
NULL ? 1 : 0)) * sizeof (*strings))) == NULL)
{
- TARGET_NATIVE_MISC_FORMAT_STRING1 (errbuf,
- sizeof (errbuf), "malloc: %s",
- strerror (errno));
+ strncpy (errbuf, "malloc failed", sizeof(errbuf));
goto out_of_memory;
}
@@ -209,125 +203,43 @@ Java_java_lang_VMProcess_nativeSpawn (JNIEnv * env, jobject this,
{
if ((dir = copy_string (env, dirString)) == NULL)
goto done;
- strings[num_strings++] = dir;
}
/* Create inter-process pipes */
- for (i = 0; i < pipe_count; i++)
- {
- if (pipe (fds[i]) == -1)
- {
- TARGET_NATIVE_MISC_FORMAT_STRING1 (errbuf,
- sizeof (errbuf), "pipe: %s",
- strerror (errno));
- goto system_error;
- }
- }
-
- /* Set close-on-exec flag for parent's ends of pipes */
- (void) fcntl (fds[0][1], F_SETFD, 1);
- (void) fcntl (fds[1][0], F_SETFD, 1);
- if (pipe_count == 3)
- (void) fcntl (fds[2][0], F_SETFD, 1);
-
- /* Fork into parent and child processes */
- if ((pid = fork ()) == (pid_t) - 1)
+ err = cpproc_forkAndExec(strings, newEnviron, fds, pipe_count, &pid, dir);
+ if (err != 0)
{
- TARGET_NATIVE_MISC_FORMAT_STRING1 (errbuf,
- sizeof (errbuf), "fork: %s",
- strerror (errno));
+ strncpy(errbuf, cpnative_getErrorString (err), sizeof(errbuf));
goto system_error;
}
- /* Child becomes the new process */
- if (pid == 0)
- {
- char *const path = strings[0];
-
- /* Move file descriptors to standard locations */
- if (fds[0][0] != 0)
- {
- if (dup2 (fds[0][0], 0) == -1)
- {
- fprintf (stderr, "dup2: %s", strerror (errno));
- exit (127);
- }
- close (fds[0][0]);
- }
- if (fds[1][1] != 1)
- {
- if (dup2 (fds[1][1], 1) == -1)
- {
- fprintf (stderr, "dup2: %s", strerror (errno));
- exit (127);
- }
- close (fds[1][1]);
- }
- if (pipe_count == 2)
- {
- /* Duplicate stdout to stderr. */
- if (dup2 (1, 2) == -1)
- {
- fprintf (stderr, "dup2: %s", strerror (errno));
- exit (127);
- }
- }
- else if (fds[2][1] != 2)
- {
- if (dup2 (fds[2][1], 2) == -1)
- {
- fprintf (stderr, "dup2: %s", strerror (errno));
- exit (127);
- }
- close (fds[2][1]);
- }
-
- /* Change into destination directory */
- if (dir != NULL && chdir (dir) == -1)
- {
- fprintf (stderr, "%s: %s", dir, strerror (errno));
- exit (127);
- }
-
- /* Make argv[0] last component of executable pathname */
- /* XXX should use "file.separator" property here XXX */
- for (i = strlen (path); i > 0 && path[i - 1] != '/'; i--);
- strings[0] = path + i;
-
- /* Set new environment */
- if (newEnviron != NULL)
- environ = newEnviron;
-
- /* Execute new program (this will close the parent end of the pipes) */
- execvp (path, strings);
-
- /* Failed */
- fprintf (stderr, "%s: %s", path, strerror (errno));
- exit (127);
- }
-
/* Create Input/OutputStream objects around parent file descriptors */
- clazz = (*env)->FindClass (env, "gnu/java/nio/channels/FileChannelImpl");
+ vmclazz = (*env)->FindClass (env, "gnu/java/nio/VMChannel");
+ clazz = (*env)->FindClass (env, "gnu/java/nio/FileChannelImpl");
if ((*env)->ExceptionOccurred (env))
goto done;
- method = (*env)->GetMethodID (env, clazz, "<init>", "(II)V");
+ vmmethod = (*env)->GetMethodID (env, vmclazz, "<init>", "(I)V");
+ method = (*env)->GetMethodID (env, clazz, "<init>", "(Lgnu/java/nio/VMChannel;I)V");
if ((*env)->ExceptionOccurred (env))
goto done;
for (i = 0; i < pipe_count; i++)
{
/* Mode is WRITE (2) for in and READ (1) for out and err. */
- const int fd = fds[i][i == 0];
- const int mode = ((i == 0)
- ? gnu_java_nio_channels_FileChannelImpl_WRITE
- : gnu_java_nio_channels_FileChannelImpl_READ);
+ const int fd = fds[i];
+ const int mode = ((i == CPIO_EXEC_STDIN) ? 2 : 1);
jclass sclazz;
jmethodID smethod;
- jobject channel = (*env)->NewObject (env, clazz, method, fd, mode);
+ jobject vmchannel;
+ jobject channel;
+ vmchannel = (*env)->NewObject (env, vmclazz, vmmethod, fd);
+ if ((*env)->ExceptionOccurred (env))
+ goto done;
+ channel = (*env)->NewObject (env, clazz, method, vmchannel, mode);
if ((*env)->ExceptionOccurred (env))
goto done;
- if (mode == gnu_java_nio_channels_FileChannelImpl_WRITE)
+ if (mode == gnu_java_nio_FileChannelImpl_WRITE)
sclazz = (*env)->FindClass (env, "java/io/FileOutputStream");
else
sclazz = (*env)->FindClass (env, "java/io/FileInputStream");
@@ -335,7 +247,7 @@ Java_java_lang_VMProcess_nativeSpawn (JNIEnv * env, jobject this,
goto done;
smethod = (*env)->GetMethodID (env, sclazz, "<init>",
- "(Lgnu/java/nio/channels/FileChannelImpl;)V");
+ "(Lgnu/java/nio/FileChannelImpl;)V");
if ((*env)->ExceptionOccurred (env))
goto done;
@@ -355,7 +267,10 @@ Java_java_lang_VMProcess_nativeSpawn (JNIEnv * env, jobject this,
if ((*env)->ExceptionOccurred (env))
goto done;
(*env)->CallVoidMethod (env, this, method,
- streams[0], streams[1], streams[2], (jlong) pid);
+ streams[CPIO_EXEC_STDIN],
+ streams[CPIO_EXEC_STDOUT],
+ streams[CPIO_EXEC_STDERR],
+ (jlong) pid);
if ((*env)->ExceptionOccurred (env))
goto done;
@@ -365,15 +280,6 @@ done:
* parent process. Our goal is to clean up the mess we created.
*/
- /* Close child's ends of pipes */
- for (i = 0; i < pipe_count; i++)
- {
- const int fd = fds[i][i != 0];
-
- if (fd != -1)
- close (fd);
- }
-
/*
* Close parent's ends of pipes if Input/OutputStreams never got created.
* This can only happen in a failure case. If a Stream object
@@ -382,7 +288,7 @@ done:
*/
for (i = 0; i < pipe_count; i++)
{
- const int fd = fds[i][i == 0];
+ const int fd = fds[i];
if (fd != -1 && streams[i] == NULL)
close (fd);
@@ -392,7 +298,8 @@ done:
while (num_strings > 0)
free (strings[--num_strings]);
free (strings);
-
+ if (dir != NULL)
+ free(dir);
/* Done */
return;
@@ -431,19 +338,20 @@ Java_java_lang_VMProcess_nativeReap (JNIEnv * env, jclass clazz)
jfieldID field;
jint status;
pid_t pid;
+ int err;
/* Try to reap a child process, but don't block */
- if ((pid = waitpid ((pid_t) - 1, &status, WNOHANG)) == 0)
+ err = cpproc_waitpid((pid_t)-1, &status, &pid, WNOHANG);
+ if (err == 0 && pid == 0)
return JNI_FALSE;
/* Check result from waitpid() */
- if (pid == (pid_t) - 1)
+ if (err != 0)
{
- if (errno == ECHILD || errno == EINTR)
+ if (err == ECHILD || err == EINTR)
return JNI_FALSE;
- TARGET_NATIVE_MISC_FORMAT_STRING2 (ebuf,
- sizeof (ebuf), "waitpid(%ld): %s",
- (long) pid, strerror (errno));
+ snprintf(ebuf, sizeof (ebuf), "waitpid(%ld): %s",
+ (long) pid, cpnative_getErrorString(errno));
clazz = (*env)->FindClass (env, "java/lang/InternalError");
if ((*env)->ExceptionOccurred (env))
return JNI_FALSE;
@@ -485,12 +393,13 @@ JNIEXPORT void JNICALL
Java_java_lang_VMProcess_nativeKill (JNIEnv * env, jclass clazz, jlong pid)
{
char ebuf[64];
-
- if (kill ((pid_t) pid, SIGKILL) == -1)
+ int err;
+
+ err = cpproc_kill((pid_t) pid, SIGKILL);
+ if (err != 0)
{
- TARGET_NATIVE_MISC_FORMAT_STRING2 (ebuf,
- sizeof (ebuf), "kill(%ld): %s",
- (long) pid, strerror (errno));
+ snprintf (ebuf, sizeof (ebuf), "kill(%ld): %s",
+ (long) pid, cpnative_getErrorString (err));
clazz = (*env)->FindClass (env, "java/lang/InternalError");
if ((*env)->ExceptionOccurred (env))
return;
diff --git a/libjava/classpath/native/jni/java-net/.cvsignore b/libjava/classpath/native/jni/java-net/.cvsignore
new file mode 100644
index 00000000000..e9f2658a694
--- /dev/null
+++ b/libjava/classpath/native/jni/java-net/.cvsignore
@@ -0,0 +1,8 @@
+*.o
+*.a
+*.lo
+*.la
+.libs
+.deps
+Makefile
+Makefile.in
diff --git a/libjava/classpath/native/jni/java-net/Makefile.am b/libjava/classpath/native/jni/java-net/Makefile.am
index 26bb64f73bf..1278b946c63 100644
--- a/libjava/classpath/native/jni/java-net/Makefile.am
+++ b/libjava/classpath/native/jni/java-net/Makefile.am
@@ -13,11 +13,12 @@ libjavanet_la_SOURCES = javanet.c \
java_net_VMInetAddress.c \
java_net_VMNetworkInterface.c \
java_net_VMURLConnection.c \
- gnu_java_net_VMPlainDatagramSocketImpl.c \
gnu_java_net_VMPlainSocketImpl.c \
$(local_sources)
-libjavanet_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo $(LIBMAGIC)
+libjavanet_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo \
+ $(top_builddir)/native/jni/native-lib/libclasspathnative.la \
+ $(LIBMAGIC)
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
diff --git a/libjava/classpath/native/jni/java-net/Makefile.in b/libjava/classpath/native/jni/java-net/Makefile.in
index c427f8cd5bb..ec8f6a858d7 100644
--- a/libjava/classpath/native/jni/java-net/Makefile.in
+++ b/libjava/classpath/native/jni/java-net/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -65,19 +67,17 @@ LTLIBRARIES = $(nativeexeclib_LTLIBRARIES)
am__DEPENDENCIES_1 =
libjavanet_la_DEPENDENCIES = \
$(top_builddir)/native/jni/classpath/jcl.lo \
+ $(top_builddir)/native/jni/native-lib/libclasspathnative.la \
$(am__DEPENDENCIES_1)
am__libjavanet_la_SOURCES_DIST = javanet.c javanet.h \
java_net_VMInetAddress.c java_net_VMNetworkInterface.c \
- java_net_VMURLConnection.c \
- gnu_java_net_VMPlainDatagramSocketImpl.c \
- gnu_java_net_VMPlainSocketImpl.c \
+ java_net_VMURLConnection.c gnu_java_net_VMPlainSocketImpl.c \
gnu_java_net_local_LocalSocketImpl.c local.c local.h
@ENABLE_LOCAL_SOCKETS_FALSE@am__objects_1 = gnu_java_net_local_LocalSocketImpl.lo
@ENABLE_LOCAL_SOCKETS_TRUE@am__objects_1 = gnu_java_net_local_LocalSocketImpl.lo \
@ENABLE_LOCAL_SOCKETS_TRUE@ local.lo
am_libjavanet_la_OBJECTS = javanet.lo java_net_VMInetAddress.lo \
java_net_VMNetworkInterface.lo java_net_VMURLConnection.lo \
- gnu_java_net_VMPlainDatagramSocketImpl.lo \
gnu_java_net_VMPlainSocketImpl.lo $(am__objects_1)
libjavanet_la_OBJECTS = $(am_libjavanet_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
@@ -198,6 +198,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -319,7 +321,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
nativeexeclib_LTLIBRARIES = libjavanet.la
@ENABLE_LOCAL_SOCKETS_FALSE@local_sources = gnu_java_net_local_LocalSocketImpl.c
@@ -332,11 +333,13 @@ libjavanet_la_SOURCES = javanet.c \
java_net_VMInetAddress.c \
java_net_VMNetworkInterface.c \
java_net_VMURLConnection.c \
- gnu_java_net_VMPlainDatagramSocketImpl.c \
gnu_java_net_VMPlainSocketImpl.c \
$(local_sources)
-libjavanet_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo $(LIBMAGIC)
+libjavanet_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo \
+ $(top_builddir)/native/jni/native-lib/libclasspathnative.la \
+ $(LIBMAGIC)
+
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
@@ -409,7 +412,6 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_net_VMPlainDatagramSocketImpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_net_VMPlainSocketImpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_net_local_LocalSocketImpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_net_VMInetAddress.Plo@am__quote@
diff --git a/libjava/classpath/native/jni/java-net/gnu_java_net_VMPlainDatagramSocketImpl.c b/libjava/classpath/native/jni/java-net/gnu_java_net_VMPlainDatagramSocketImpl.c
deleted file mode 100644
index 1b3cb97e0d0..00000000000
--- a/libjava/classpath/native/jni/java-net/gnu_java_net_VMPlainDatagramSocketImpl.c
+++ /dev/null
@@ -1,399 +0,0 @@
-/* VMPlainDatagramSocketImpl.c - Native methods for PlainDatagramSocketImpl
- Copyright (C) 2005, 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/* do not move; needed here because of some macro definitions */
-#include <config.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <jni.h>
-#include <jcl.h>
-
-#include "javanet.h"
-
-#include "target_native.h"
-#ifndef WITHOUT_NETWORK
- #include "target_native_network.h"
-#endif /* WITHOUT_NETWORK */
-
-
-#include "gnu_java_net_VMPlainDatagramSocketImpl.h"
-
-/*
- * Note that most of the functions in this module simply redirect to another
- * internal function. Why? Because many of these functions are shared
- * with PlainSocketImpl.
- */
-
-/*************************************************************************/
-
-/*
- * Creates a new datagram socket
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainDatagramSocketImpl_create(JNIEnv *env,
- jclass klass __attribute__ ((__unused__))
- , jobject obj)
-{
-
-#ifndef WITHOUT_NETWORK
- _javanet_create(env, obj, 0);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
-}
-
-/*************************************************************************/
-
-/*
- * Close the socket.
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainDatagramSocketImpl_close(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj)
-{
-
-#ifndef WITHOUT_NETWORK
- _javanet_close(env, obj, 0);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
-}
-
-/*************************************************************************/
-
-/*
- * Connects to the specified destination.
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainDatagramSocketImpl_connect(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj,
- jobject addr, jint port)
-{
-#ifndef WITHOUT_NETWORK
-
- _javanet_connect(env, obj, addr, port, 0);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
-}
-
-/*************************************************************************/
-
-/*
- * This method binds the specified address to the specified local port.
- * Note that we have to set the local address and local port public instance
- * variables.
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainDatagramSocketImpl_bind(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj,
- jint port, jobject addr)
-{
-
-#ifndef WITHOUT_NETWORK
- _javanet_bind(env, obj, addr, port, 0);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
-}
-
-/*************************************************************************/
-
-/*
- * This method sets the specified option for a socket
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainDatagramSocketImpl_setOption(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj,
- jint option_id,
- jobject val)
-{
-
-#ifndef WITHOUT_NETWORK
- _javanet_set_option(env, obj, option_id, val);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
-}
-
-/*************************************************************************/
-
-/*
- * This method sets the specified option for a socket
- */
-JNIEXPORT jobject JNICALL
-Java_gnu_java_net_VMPlainDatagramSocketImpl_getOption(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj,
- jint option_id)
-{
-
-#ifndef WITHOUT_NETWORK
- return(_javanet_get_option(env, obj, option_id));
-#else /* not WITHOUT_NETWORK */
- return NULL;
-#endif /* not WITHOUT_NETWORK */
-}
-
-/*************************************************************************/
-
-/*
- * Reads a buffer from a remote host
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainDatagramSocketImpl_nativeReceive(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj,
- jbyteArray arr,
- jint offset,
- jint length,
- jbyteArray receivedFromAddress,
- jintArray receivedFromPort,
- jintArray receivedLength)
-{
-#ifndef WITHOUT_NETWORK
- int addr, *port, *bytes_read;
- char *addressBytes;
-
- addr = 0;
-
- port = (int*)(*env)->GetIntArrayElements(env, receivedFromPort, NULL);
- if (port == NULL)
- {
- JCL_ThrowException(env, IO_EXCEPTION, "Internal error: could not access receivedFromPort array");
- return;
- }
-
- bytes_read = (int*)(*env)->GetIntArrayElements(env, receivedLength, NULL);
- if (bytes_read == NULL)
- {
- (*env)->ReleaseIntArrayElements(env, receivedFromPort, (jint*)port, 0);
- JCL_ThrowException(env, IO_EXCEPTION, "Internal error: could not access receivedLength array");
- return;
- }
-
- /* Receive the packet */
- /* should we try some sort of validation on the length? */
- (*bytes_read) = _javanet_recvfrom(env, obj, arr, offset, length, &addr, port);
-
- /* Special case the strange situation where the receiver didn't want any
- bytes. */
- if (length == 0 && (*bytes_read) == -1)
- *bytes_read = 0;
-
- if ((*bytes_read) == -1)
- {
- (*env)->ReleaseIntArrayElements(env, receivedFromPort, (jint*)port, 0);
- (*env)->ReleaseIntArrayElements(env, receivedLength, (jint*)bytes_read, 0);
- JCL_ThrowException(env, IO_EXCEPTION, "Internal error: receive");
- return;
- }
-
- (*env)->ReleaseIntArrayElements(env, receivedFromPort, (jint*)port, 0);
- (*env)->ReleaseIntArrayElements(env, receivedLength, (jint*)bytes_read, 0);
-
- if ((*env)->ExceptionOccurred(env))
- {
- return;
- }
-
- DBG("PlainDatagramSocketImpl.receive(): Received packet\n");
-
-
- /* Store the address */
- addressBytes = (char*)(*env)->GetPrimitiveArrayCritical(env, receivedFromAddress, NULL);
- TARGET_NATIVE_NETWORK_INT_TO_IPADDRESS_BYTES(addr,
- addressBytes[0],
- addressBytes[1],
- addressBytes[2],
- addressBytes[3]
- );
- (*env)->ReleasePrimitiveArrayCritical(env, receivedFromAddress, addressBytes, 0);
-
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
-}
-
-/*************************************************************************/
-
-/*
- * Writes a buffer to the remote host
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainDatagramSocketImpl_nativeSendTo(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj,
- jobject addr,
- jint port,
- jarray buf,
- jint offset,
- jint len)
-{
-#ifndef WITHOUT_NETWORK
- jint netAddress;
-
- /* check if address given, tr 7.3.2005 */
- if (addr != NULL)
- {
- netAddress = _javanet_get_netaddr(env, addr);
- if ((*env)->ExceptionOccurred(env))
- {
- return;
- }
- }
- else
- {
- netAddress = 0;
- }
-
- DBG("PlainDatagramSocketImpl.sendto(): have addr\n");
-
- _javanet_sendto(env, obj, buf, offset, len, netAddress, port);
- if ((*env)->ExceptionOccurred(env))
- {
- return;
- }
-
- DBG("PlainDatagramSocketImpl.sendto(): finished\n");
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
-}
-
-/*************************************************************************/
-
-/*
- * Joins a multicast group
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainDatagramSocketImpl_join(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj,
- jobject addr)
-{
-#ifndef WITHOUT_NETWORK
- jint netAddress;
- int fd;
- int result;
-
- /* check if address given, tr 7.3.2005 */
- if (addr != NULL)
- {
- netAddress = _javanet_get_netaddr(env, addr);
- if ((*env)->ExceptionOccurred(env))
- {
- JCL_ThrowException(env, IO_EXCEPTION, "Internal error");
- return;
- }
- }
- else
- {
- netAddress = 0;
- }
-
- fd = _javanet_get_int_field(env, obj, "native_fd");
- if ((*env)->ExceptionOccurred(env))
- {
- JCL_ThrowException(env, IO_EXCEPTION, "Internal error");
- return;
- }
-
- DBG("PlainDatagramSocketImpl.join(): have native fd\n");
-
- TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_ADD_MEMBERSHIP(fd,netAddress,result);
-
- if (result != TARGET_NATIVE_OK)
- {
- JCL_ThrowException(env, IO_EXCEPTION, TARGET_NATIVE_LAST_ERROR_STRING());
- return;
- }
-
- DBG("PlainDatagramSocketImpl.join(): finished\n");
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
-}
-
-/*************************************************************************/
-
-/*
- * Leaves a multicast group
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainDatagramSocketImpl_leave(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj,
- jobject addr)
-{
-#ifndef WITHOUT_NETWORK
- jint netAddress;
- int fd;
- int result;
-
- /* check if address given, tr 7.3.2005 */
- if (addr != NULL)
- {
- netAddress = _javanet_get_netaddr(env, addr);
- if ((*env)->ExceptionOccurred(env))
- {
- JCL_ThrowException(env, IO_EXCEPTION, "Internal error");
- return;
- }
- }
- else
- {
- netAddress = 0;
- }
-
- fd = _javanet_get_int_field(env, obj, "native_fd");
- if ((*env)->ExceptionOccurred(env))
- { JCL_ThrowException(env, IO_EXCEPTION, "Internal error"); return; }
-
- DBG("PlainDatagramSocketImpl.leave(): have native fd\n");
-
- TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_DROP_MEMBERSHIP(fd,netAddress,result);
- if (result!=TARGET_NATIVE_OK)
- {
- JCL_ThrowException(env, IO_EXCEPTION, TARGET_NATIVE_LAST_ERROR_STRING());
- return;
- }
-
- DBG("PlainDatagramSocketImpl.leave(): finished\n");
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
-}
-
diff --git a/libjava/classpath/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c b/libjava/classpath/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c
index 3d48b9195c4..cdfbe739789 100644
--- a/libjava/classpath/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c
+++ b/libjava/classpath/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c
@@ -35,269 +35,930 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-/* do not move; needed here because of some macro definitions */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#include <config-int.h>
+
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#ifdef HAVE_IFADDRS_H
+#include <ifaddrs.h>
+#endif
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <net/if.h>
+#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
#include <jni.h>
#include <jcl.h>
+#include "cpnative.h"
+#include "cpnet.h"
+#include "cpio.h"
#include "javanet.h"
-#include "target_native.h"
-#ifndef WITHOUT_NETWORK
- #include "target_native_file.h" /* Get FIONREAD on Solaris. */
- #include "target_native_network.h"
-#endif /* WITHOUT_NETWORK */
-
#include "gnu_java_net_VMPlainSocketImpl.h"
-/*
- * Note that the functions in this module simply redirect to another
- * internal function. Why? Because many of these functions are shared
- * with PlainDatagramSocketImpl. The unshared ones were done the same
- * way for consistency.
- */
-
-/*************************************************************************/
+#define THROW_NO_NETWORK(env) JCL_ThrowException (env, "java/lang/InternalError", "this platform not configured for network support")
/*
- * Creates a new stream or datagram socket
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: bind
+ * Signature: (I[BI)V
*/
JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainSocketImpl_create(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj)
+Java_gnu_java_net_VMPlainSocketImpl_bind (JNIEnv *env,
+ jclass clazz __attribute__((unused)),
+ jint fd, jbyteArray addr, jint port)
{
-#ifndef WITHOUT_NETWORK
- _javanet_create(env, obj, JNI_TRUE);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
+ struct sockaddr_in sockaddr;
+ jbyte *elems = NULL;
+ int ret;
+
+ if (addr != NULL)
+ elems = (*env)->GetByteArrayElements (env, addr, NULL);
+
+ memset(&sockaddr, 0, sizeof (struct sockaddr_in));
+ sockaddr.sin_family = AF_INET;
+ sockaddr.sin_port = htons (port);
+ /* addr is already in network byte order. */
+ if (elems != NULL)
+ sockaddr.sin_addr.s_addr = *((uint32_t *) elems);
+ else
+ sockaddr.sin_addr.s_addr = INADDR_ANY;
+
+ /* bind(2) from BSD says bind will never return EINTR */
+ /* bind is not a blocking system call */
+ ret = bind (fd, (struct sockaddr *) &sockaddr, sizeof (struct sockaddr_in));
+
+ if (elems != NULL)
+ (*env)->ReleaseByteArrayElements (env, addr, elems, JNI_ABORT);
+
+ if (-1 == ret)
+ JCL_ThrowException (env, BIND_EXCEPTION, strerror (errno));
+
+ cpio_closeOnExec(ret);
}
-/*************************************************************************/
/*
- * Close the socket. Any underlying streams will be closed by this
- * action as well.
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: bind6
+ * Signature: (I[BI)V
*/
JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainSocketImpl_close(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj)
+Java_gnu_java_net_VMPlainSocketImpl_bind6 (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jbyteArray addr, jint port)
{
-#ifndef WITHOUT_NETWORK
- _javanet_close(env, obj, 1);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
+ /* FIXME! Add check if we have IPv6! */
+ struct sockaddr_in6 sockaddr;
+ jbyte *elems;
+ int ret;
+
+ elems = (*env)->GetByteArrayElements (env, addr, NULL);
+
+ memset (&sockaddr, 0, sizeof (struct sockaddr_in6));
+ sockaddr.sin6_family = AF_INET6;
+ sockaddr.sin6_port = htons (port);
+ memcpy (&sockaddr.sin6_addr.s6_addr, elems, 16);
+
+ /* bind(2) from BSD says bind will never return EINTR */
+ /* bind is not a blocking system call */
+ ret = bind (fd, (struct sockaddr *) &sockaddr,
+ sizeof (struct sockaddr_in6));
+
+ (*env)->ReleaseByteArrayElements (env, addr, elems, JNI_ABORT);
+
+ if (-1 == ret)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
}
-/*************************************************************************/
/*
- * Connects to the specified destination.
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: listen
+ * Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainSocketImpl_connect(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj,
- jobject addr, jint port)
+Java_gnu_java_net_VMPlainSocketImpl_listen (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jint backlog)
{
-#ifndef WITHOUT_NETWORK
- _javanet_connect(env, obj, addr, port, 1);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
+ int ret;
+
+ /* listen(2) says that this call will never return EINTR */
+ /* listen is not a blocking system call */
+ if ((ret = listen (fd, backlog)) == -1)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
}
-/*************************************************************************/
-/*
- * This method binds the specified address to the specified local port.
- * Note that we have to set the local address and local port public instance
- * variables.
+/* These constants are also defined in java/net/SocketOptions.java.
+ * Except for CPNET_IP_TTL which is defined in
+ * vm/reference/gnu/java/net/VMPlainSocketImpl.java .
*/
-JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainSocketImpl_bind(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj, jobject addr,
- jint port)
-{
-#ifndef WITHOUT_NETWORK
- _javanet_bind(env, obj, addr, port, 1);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
-}
+enum java_sockopt {
+ CPNET_SO_KEEPALIVE = 0x8,
+ CPNET_SO_LINGER = 0x80,
+ CPNET_SO_TIMEOUT = 0x1006,
+ CPNET_SO_BINDADDR = 0x0F,
+ CPNET_SO_SNDBUF = 0x1001,
+ CPNET_SO_RCVBUF = 0x1002,
+ CPNET_SO_REUSEADDR = 0x04,
+ CPNET_SO_BROADCAST = 0x20,
+ CPNET_SO_OOBINLINE = 0x1003,
+ CPNET_TCP_NODELAY = 0x01,
+ CPNET_IP_MULTICAST_IF = 0x10,
+ CPNET_IP_MULTICAST_IF2 = 0x1F,
+ CPNET_IP_MULTICAST_LOOP = 0x12,
+ CPNET_IP_TOS = 0x03,
+ CPNET_IP_TTL = 0x1E61
+};
-/*************************************************************************/
/*
- * Starts listening on a socket with the specified number of pending
- * connections allowed.
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: setOption
+ * Signature: (III)V
*/
JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainSocketImpl_listen(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj, jint queuelen)
+Java_gnu_java_net_VMPlainSocketImpl_setOption (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jint option, jint value)
{
-#ifndef WITHOUT_NETWORK
- _javanet_listen(env, obj, queuelen);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
-}
+ enum java_sockopt joption = (enum java_sockopt) option;
+ int optname = -1;
+ int level = SOL_SOCKET;
+ const int _value = value;
+ struct linger _linger;
+ struct timeval _timeo;
+ void *optval = (void *) &_value;
+ socklen_t optlen = sizeof (int);
+
+ switch (joption)
+ {
+ case CPNET_IP_MULTICAST_LOOP:
+ level = IPPROTO_IP;
+ optname = IP_MULTICAST_LOOP;
+ break;
+
+ case CPNET_SO_KEEPALIVE:
+ optname = SO_KEEPALIVE;
+ break;
+
+ case CPNET_SO_LINGER:
+ optname = SO_LINGER;
+ if (_value == -1)
+ _linger.l_onoff = 0;
+ else
+ _linger.l_onoff = 1;
+ _linger.l_linger = _value;
+ optval = &_linger;
+ optlen = sizeof (struct linger);
+ break;
+
+ case CPNET_SO_TIMEOUT:
+ optname = SO_RCVTIMEO;
+ _timeo.tv_sec = value / 1000;
+ _timeo.tv_usec = (value % 1000) * 1000;
+ optval = &_timeo;
+ optlen = sizeof (struct timeval);
+ break;
+
+ case CPNET_SO_SNDBUF:
+ optname = SO_SNDBUF;
+ break;
+
+ case CPNET_SO_RCVBUF:
+ optname = SO_RCVBUF;
+ break;
+
+ case CPNET_SO_REUSEADDR:
+ optname = SO_REUSEADDR;
+ break;
+
+ case CPNET_SO_BROADCAST:
+ optname = SO_BROADCAST;
+ break;
+
+ case CPNET_SO_OOBINLINE:
+ optname = SO_OOBINLINE;
+ break;
+
+ case CPNET_TCP_NODELAY:
+ level = IPPROTO_TCP;
+ optname = TCP_NODELAY;
+ break;
+
+ case CPNET_IP_TOS:
+ level = IPPROTO_IP;
+ optname = IP_TOS;
+ break;
+
+ case CPNET_IP_TTL:
+ level = IPPROTO_IP;
+ optname = IP_TTL;
+ break;
+
+ case CPNET_SO_BINDADDR:
+ case CPNET_IP_MULTICAST_IF:
+ case CPNET_IP_MULTICAST_IF2:
+ JCL_ThrowException (env, IO_EXCEPTION, "argument not a boolean or integer option");
+ return;
+ }
-/*************************************************************************/
+ if (setsockopt (fd, level, optname, (const void *) optval, optlen) == -1)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+}
/*
- * Accepts a new connection and assigns it to the passed in SocketImpl
- * object. Note that we assume this is a PlainSocketImpl just like us.
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: getOption
+ * Signature: (II)I
*/
-JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainSocketImpl_accept(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj, jobject impl)
+JNIEXPORT jint JNICALL
+Java_gnu_java_net_VMPlainSocketImpl_getOption (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jint option)
{
-#ifndef WITHOUT_NETWORK
- _javanet_accept(env, obj, impl);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
-}
+ enum java_sockopt joption = (enum java_sockopt) option;
+ int optname = -1;
+ int level = SOL_SOCKET;
+ int value;
+ struct linger linger;
+ struct timeval timeo;
+ void *optval = &value;
+ socklen_t optlen = sizeof (int);
+
+ switch (joption)
+ {
+ case CPNET_IP_MULTICAST_LOOP:
+ level = IPPROTO_IP;
+ optname = IP_MULTICAST_LOOP;
+ break;
+
+ case CPNET_SO_KEEPALIVE:
+ optname = SO_KEEPALIVE;
+ break;
+
+ case CPNET_SO_LINGER:
+ optname = SO_LINGER;
+ optval = &linger;
+ optlen = sizeof (struct linger);
+ break;
+
+ case CPNET_SO_TIMEOUT:
+ optname = SO_RCVTIMEO;
+ optval = &timeo;
+ optlen = sizeof (struct timeval);
+ break;
+
+ case CPNET_SO_SNDBUF:
+ optname = SO_SNDBUF;
+ break;
+
+ case CPNET_SO_RCVBUF:
+ optname = SO_RCVBUF;
+ break;
+
+ case CPNET_SO_REUSEADDR:
+ optname = SO_REUSEADDR;
+ break;
+
+ case CPNET_SO_BROADCAST:
+ optname = SO_BROADCAST;
+ break;
+
+ case CPNET_SO_OOBINLINE:
+ optname = SO_OOBINLINE;
+ break;
+
+ case CPNET_TCP_NODELAY:
+ level = IPPROTO_TCP;
+ optname = TCP_NODELAY;
+ break;
+
+ case CPNET_IP_TOS:
+ level = IPPROTO_IP;
+ optname = IP_TOS;
+ break;
+
+ case CPNET_IP_TTL:
+ level = IPPROTO_IP;
+ optname = IP_TTL;
+ break;
+
+ case CPNET_SO_BINDADDR:
+ case CPNET_IP_MULTICAST_IF:
+ case CPNET_IP_MULTICAST_IF2:
+ JCL_ThrowException (env, IO_EXCEPTION, "argument not a boolean or integer option");
+ return -1;
+ }
-/*************************************************************************/
+ if (getsockopt (fd, level, optname, optval, &optlen) == -1)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
-JNIEXPORT jint JNICALL
-Java_gnu_java_net_VMPlainSocketImpl_available(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj)
+ /* Returns the linger value if it is enabled or -1 in case
+ * it is disabled. This is how the Java API expects it.
+ */
+ if (joption == CPNET_SO_LINGER)
+ return (linger.l_onoff) ? linger.l_linger : -1;
+ if (joption == CPNET_SO_TIMEOUT)
+ return (timeo.tv_sec * 1000) + (timeo.tv_usec / 1000);
+
+ return value;
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_net_VMPlainSocketImpl_setMulticastInterface (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd,
+ jint optionId __attribute__((unused)),
+ jobject addr)
{
-#ifndef WITHOUT_NETWORK
- jclass cls;
- jfieldID fid;
- int fd;
- int bytesAvailable;
- int result;
+ int result;
+ cpnet_address *cpaddr = _javanet_get_ip_netaddr (env, addr);
+
+ if ((*env)->ExceptionOccurred (env))
+ return;
+
+ result = setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF,
+ (struct sockaddr *) cpaddr->data, cpaddr->len);
+
+ cpnet_freeAddress (env, cpaddr);
- cls = (*env)->GetObjectClass(env, obj);
- if (cls == 0)
+ if (result == -1)
+ JCL_ThrowException (env, SOCKET_EXCEPTION, cpnative_getErrorString (errno));
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_net_VMPlainSocketImpl_setMulticastInterface6 (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd,
+ jint optionId __attribute__((unused)),
+ jstring ifname)
+{
+#ifdef HAVE_SETSOCKOPT
+#ifdef HAVE_INET6
+ int result;
+ const char *str_ifname = JCL_jstring_to_cstring (env, ifname);
+ u_int if_index;
+
+ if ((*env)->ExceptionOccurred (env))
{
- JCL_ThrowException(env, IO_EXCEPTION, "internal error");
- return 0;
+ JCL_free_cstring(env, ifname, str_ifname);
+ return;
}
-
- fid = (*env)->GetFieldID(env, cls, "native_fd", "I");
- if (fid == 0)
+
+ if_index = if_nametoindex(str_ifname);
+ if (!if_index)
{
- JCL_ThrowException(env, IO_EXCEPTION, "internal error");
- return 0;
+ JCL_free_cstring(env, ifname, str_ifname);
+ JCL_ThrowException (env, SOCKET_EXCEPTION, "interface does not exist");
+ return;
}
- fd = (*env)->GetIntField(env, obj, fid);
+ result = setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_IF,
+ (u_int *) &if_index, sizeof(if_index));
+
+ JCL_free_cstring(env, ifname, str_ifname);
- TARGET_NATIVE_NETWORK_SOCKET_RECEIVE_AVAILABLE(fd,bytesAvailable,result);
- if (result != TARGET_NATIVE_OK)
+ if (result == -1)
+ JCL_ThrowException (env, SOCKET_EXCEPTION, cpnative_getErrorString (errno));
+#else
+ (void) fd;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "IPv6 support not available");
+#endif /* HAVE_INET6 */
+#else
+ (void) fd;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "socket options not supported");
+#endif /* HAVE_SETSOCKOPT */
+}
+
+JNIEXPORT jobject JNICALL
+Java_gnu_java_net_VMPlainSocketImpl_getMulticastInterface (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd,
+ jint optionId __attribute__((unused)))
+{
+ jobject obj;
+ cpnet_address *cpaddr;
+ int result = cpnet_getMulticastIF (env, fd, &cpaddr);
+
+ if (result != CPNATIVE_OK)
{
- JCL_ThrowException(env, IO_EXCEPTION, TARGET_NATIVE_LAST_ERROR_STRING());
- return 0;
+ JCL_ThrowException (env, SOCKET_EXCEPTION,
+ cpnative_getErrorString (result));
+ return (0);
}
- return bytesAvailable;
-#else /* not WITHOUT_NETWORK */
- return 0;
-#endif /* not WITHOUT_NETWORK */
+ obj = _javanet_create_inetaddress (env, cpaddr);
+ cpnet_freeAddress (env, cpaddr);
+
+ return obj;
}
-/*************************************************************************/
/*
- * This method sets the specified option for a socket
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: shutdownInput
+ * Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainSocketImpl_setOption(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj,
- jint option_id, jobject val)
+Java_gnu_java_net_VMPlainSocketImpl_shutdownInput (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd)
{
-#ifndef WITHOUT_NETWORK
- _javanet_set_option(env, obj, option_id, val);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
+ if (shutdown (fd, SHUT_RD) == -1)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+}
+
+/*
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: shutdownOutput
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_net_VMPlainSocketImpl_shutdownOutput (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd)
+{
+ if (shutdown (fd, SHUT_WR) == -1)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
}
-/*************************************************************************/
/*
- * This method gets the specified option for a socket
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: sendUrgentData
+ * Signature: (II)V
*/
-JNIEXPORT jobject JNICALL
-Java_gnu_java_net_VMPlainSocketImpl_getOption(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj,
- jint option_id)
+JNIEXPORT void JNICALL
+Java_gnu_java_net_VMPlainSocketImpl_sendUrgentData (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jint data)
{
-#ifndef WITHOUT_NETWORK
- return(_javanet_get_option(env, obj, option_id));
-#else /* not WITHOUT_NETWORK */
- return NULL;
-#endif /* not WITHOUT_NETWORK */
+ const char x = (char) data;
+
+ if (send (fd, &x, 1, MSG_OOB) == -1)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
}
-/*************************************************************************/
/*
- * Reads a buffer from a remote host
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: join
+ * Signature: (I[B)V
*/
-JNIEXPORT jint JNICALL
-Java_gnu_java_net_VMPlainSocketImpl_read(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj, jarray buf,
- jint offset, jint len)
+JNIEXPORT void JNICALL
+Java_gnu_java_net_VMPlainSocketImpl_join (JNIEnv *env,
+ jclass clazz __attribute__((unused)),
+ jint fd, jbyteArray addr)
{
-#ifndef WITHOUT_NETWORK
- return(_javanet_recvfrom(env, obj, buf, offset, len, 0, 0));
-#else /* not WITHOUT_NETWORK */
- return 0;
-#endif /* not WITHOUT_NETWORK */
+#ifdef HAVE_SETSOCKOPT
+ struct ip_mreq maddr;
+ jbyte *addr_elems;
+
+ addr_elems = (*env)->GetByteArrayElements (env, addr, NULL);
+ if (addr_elems == NULL)
+ return;
+
+ maddr.imr_multiaddr.s_addr = * ((uint32_t *) addr_elems);
+ maddr.imr_interface.s_addr = INADDR_ANY;
+
+ (*env)->ReleaseByteArrayElements (env, addr, addr_elems, JNI_ABORT);
+
+ if (-1 == setsockopt (fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
+ &maddr, sizeof (struct ip_mreq)))
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+#else
+ (void) fd;
+ (void) addr;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "socket options not supported");
+#endif /* HAVE_SETSOCKOPT */
}
-/*************************************************************************/
/*
- * Writes a buffer to the remote host
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: join6
+ * Signature: (I[B)V
*/
JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainSocketImpl_write(JNIEnv *env,
- jclass klass __attribute__ ((__unused__)),
- jobject obj, jarray buf,
- jint offset, jint len)
+Java_gnu_java_net_VMPlainSocketImpl_join6 (JNIEnv *env,
+ jclass clazz __attribute__((unused)),
+ jint fd, jbyteArray addr)
{
-#ifndef WITHOUT_NETWORK
- _javanet_sendto(env, obj, buf, offset, len, 0, 0);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
+#ifdef HAVE_SETSOCKOPT
+#ifdef HAVE_INET6
+ struct ipv6_mreq maddr;
+ jbyte *addr_elems;
+
+ addr_elems = (*env)->GetByteArrayElements (env, addr, NULL);
+ if (addr_elems == NULL)
+ return;
+
+ memcpy (&(maddr.ipv6mr_multiaddr.s6_addr), addr_elems, 16);
+ maddr.ipv6mr_interface = 0;
+
+ (*env)->ReleaseByteArrayElements (env, addr, addr_elems, JNI_ABORT);
+
+ if (-1 == setsockopt (fd, IPPROTO_IPV6, IPV6_JOIN_GROUP,
+ &maddr, sizeof (struct ipv6_mreq)))
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+#else
+ (void) fd;
+ (void) addr;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "IPv6 support not available");
+#endif /* HAVE_INET6 */
+#else
+ (void) fd;
+ (void) addr;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "socket options not supported");
+#endif /* HAVE_SETSOCKOPT */
}
+/*
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: leave
+ * Signature: (I[B)V
+ */
JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainSocketImpl_shutdownInput (JNIEnv * env,
- jclass klass __attribute__ ((__unused__)),
- jobject this)
+Java_gnu_java_net_VMPlainSocketImpl_leave (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jbyteArray addr)
{
-#ifndef WITHOUT_NETWORK
- _javanet_shutdownInput (env, this);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
+#ifdef HAVE_SETSOCKOPT
+ struct ip_mreq maddr;
+ jbyte *addr_elems;
+
+ addr_elems = (*env)->GetByteArrayElements (env, addr, NULL);
+ if (addr_elems == NULL)
+ return;
+
+ maddr.imr_multiaddr.s_addr = * ((uint32_t *) addr_elems);
+ maddr.imr_interface.s_addr = INADDR_ANY;
+
+ (*env)->ReleaseByteArrayElements (env, addr, addr_elems, JNI_ABORT);
+
+ if (-1 == setsockopt (fd, IPPROTO_IP, IP_DROP_MEMBERSHIP,
+ &maddr, sizeof (struct ip_mreq)))
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+#else
+ (void) fd;
+ (void) addr;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "socket options not supported");
+#endif /* HAVE_SETSOCKOPT */
}
+/*
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: leave6
+ * Signature: (I[B)V
+ */
JNIEXPORT void JNICALL
-Java_gnu_java_net_VMPlainSocketImpl_shutdownOutput (JNIEnv * env,
- jclass klass __attribute__ ((__unused__)),
- jobject this)
+Java_gnu_java_net_VMPlainSocketImpl_leave6 (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jbyteArray addr)
{
-#ifndef WITHOUT_NETWORK
- _javanet_shutdownOutput (env, this);
-#else /* not WITHOUT_NETWORK */
-#endif /* not WITHOUT_NETWORK */
+#ifdef HAVE_SETSOCKOPT
+#ifdef HAVE_INET6
+ struct ipv6_mreq maddr;
+ jbyte *addr_elems;
+
+ addr_elems = (*env)->GetByteArrayElements (env, addr, NULL);
+ if (addr_elems == NULL)
+ return;
+
+ memcpy (&(maddr.ipv6mr_multiaddr.s6_addr), addr_elems, 16);
+ maddr.ipv6mr_interface = 0;
+
+ (*env)->ReleaseByteArrayElements (env, addr, addr_elems, JNI_ABORT);
+
+ if (-1 == setsockopt (fd, IPPROTO_IPV6, IPV6_LEAVE_GROUP,
+ &maddr, sizeof (struct ipv6_mreq)))
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+#else
+ (void) fd;
+ (void) addr;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "IPv6 support not available");
+#endif /* HAVE_INET6 */
+#else
+ (void) fd;
+ (void) addr;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "socket options not supported");
+#endif /* HAVE_SETSOCKOPT */
}
-/* end of file */
+static uint32_t getif_address (JNIEnv *env, const char *ifname);
+static int getif_index (JNIEnv *env, const char *ifname);
+
+/*
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: joinGroup
+ * Signature: (I[BILjava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_net_VMPlainSocketImpl_joinGroup (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jbyteArray addr,
+ jstring ifname)
+{
+#ifdef HAVE_SETSOCKOPT
+ struct ip_mreq maddr;
+ jbyte *addr_elems;
+ const char *str_ifname;
+
+ if (ifname != NULL)
+ {
+ str_ifname = JCL_jstring_to_cstring(env, ifname);
+ maddr.imr_interface.s_addr = getif_address (env, str_ifname);
+ JCL_free_cstring(env, ifname, str_ifname);
+
+ if ((*env)->ExceptionCheck (env))
+ return;
+ }
+ else
+ maddr.imr_interface.s_addr = INADDR_ANY;
+
+ addr_elems = (*env)->GetByteArrayElements (env, addr, NULL);
+ if (addr_elems == NULL)
+ return;
+
+ maddr.imr_multiaddr.s_addr = * ((uint32_t *) addr_elems);
+
+ (*env)->ReleaseByteArrayElements (env, addr, addr_elems, JNI_ABORT);
+
+ if (-1 == setsockopt (fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
+ &maddr, sizeof (struct ip_mreq)))
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+
+#else
+ (void) fd;
+ (void) addr;
+ (void) ifname;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "socket options not supported");
+#endif /* HAVE_SETSOCKOPT */
+}
+
+/*
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: joinGroup6
+ * Signature: (I[BILjava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_net_VMPlainSocketImpl_joinGroup6 (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jbyteArray addr,
+ jstring ifname)
+{
+#ifdef HAVE_SETSOCKOPT
+#ifdef HAVE_INET6
+ struct ipv6_mreq maddr;
+ jbyte *addr_elems;
+ const char *str_ifname;
+
+ if (ifname == NULL)
+ {
+ str_ifname = JCL_jstring_to_cstring(env, ifname);
+ maddr.ipv6mr_interface = getif_index (env, str_ifname);
+ JCL_free_cstring(env, ifname, str_ifname);
+
+ if ((*env)->ExceptionCheck (env))
+ return;
+ }
+ else
+ maddr.ipv6mr_interface = 0;
+
+ addr_elems = (*env)->GetByteArrayElements (env, addr, NULL);
+ if (addr_elems == NULL)
+ return;
+
+ memcpy (&(maddr.ipv6mr_multiaddr.s6_addr), addr_elems, 16);
+
+ (*env)->ReleaseByteArrayElements (env, addr, addr_elems, JNI_ABORT);
+
+ if (-1 == setsockopt (fd, IPPROTO_IPV6, IPV6_JOIN_GROUP,
+ &maddr, sizeof (struct ipv6_mreq)))
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+#else
+ (void) fd;
+ (void) addr;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "IPv6 support not available");
+#endif /* HAVE_INET6 */
+#else
+ (void) fd;
+ (void) addr;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "socket options not supported");
+#endif /* HAVE_SETSOCKOPT */
+}
+
+/*
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: leaveGroup
+ * Signature: (I[BILjava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_net_VMPlainSocketImpl_leaveGroup (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jbyteArray addr,
+ jstring ifname)
+{
+#ifdef HAVE_SETSOCKOPT
+ struct ip_mreq maddr;
+ jbyte *addr_elems;
+ const char *str_ifname;
+
+ if (ifname != NULL)
+ {
+ str_ifname = JCL_jstring_to_cstring(env, ifname);
+ maddr.imr_interface.s_addr = getif_address (env, str_ifname);
+ JCL_free_cstring(env, ifname, str_ifname);
+
+ if ((*env)->ExceptionCheck (env))
+ return;
+ }
+ else
+ maddr.imr_interface.s_addr = INADDR_ANY;
+
+ addr_elems = (*env)->GetByteArrayElements (env, addr, NULL);
+ if (addr_elems == NULL)
+ return;
+
+ maddr.imr_multiaddr.s_addr = * ((uint32_t *) addr_elems);
+
+ (*env)->ReleaseByteArrayElements (env, addr, addr_elems, JNI_ABORT);
+
+ if (-1 == setsockopt (fd, IPPROTO_IP, IP_DROP_MEMBERSHIP,
+ &maddr, sizeof (struct ip_mreq)))
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+#else
+ (void) fd;
+ (void) addr;
+ (void) ifname;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "socket options not supported");
+#endif /* HAVE_SETSOCKOPT */
+}
+
+/*
+ * Class: gnu_java_net_VMPlainSocketImpl
+ * Method: leaveGroup6
+ * Signature: (I[BILjava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_net_VMPlainSocketImpl_leaveGroup6 (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jbyteArray addr,
+ jstring ifname)
+{
+#ifdef HAVE_SETSOCKOPT
+#ifdef HAVE_INET6
+ struct ipv6_mreq maddr;
+ jbyte *addr_elems;
+ const char *str_ifname;
+
+ if (ifname == NULL)
+ {
+ str_ifname = JCL_jstring_to_cstring(env, ifname);
+ maddr.ipv6mr_interface = getif_index (env, str_ifname);
+ JCL_free_cstring(env, ifname, str_ifname);
+
+ if ((*env)->ExceptionCheck (env))
+ return;
+ }
+ else
+ maddr.ipv6mr_interface = 0;
+
+ addr_elems = (*env)->GetByteArrayElements (env, addr, NULL);
+ if (addr_elems == NULL)
+ return;
+
+ memcpy (&(maddr.ipv6mr_multiaddr.s6_addr), addr_elems, 16);
+
+ (*env)->ReleaseByteArrayElements (env, addr, addr_elems, JNI_ABORT);
+
+ if (-1 == setsockopt (fd, IPPROTO_IPV6, IPV6_LEAVE_GROUP,
+ &maddr, sizeof (struct ipv6_mreq)))
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+#else
+ (void) fd;
+ (void) addr;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "IPv6 support not available");
+#endif /* HAVE_INET6 */
+#else
+ (void) fd;
+ (void) addr;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "socket options not supported");
+#endif /* HAVE_SETSOCKOPT */
+}
+
+static uint32_t
+getif_address (JNIEnv *env, const char *ifname)
+{
+#if defined (HAVE_IFADDRS_H) && defined (HAVE_GETIFADDRS)
+ struct ifaddrs *ifaddrs, *i;
+ uint32_t addr = 0;
+ int foundaddr = 0;
+
+ if (getifaddrs (&ifaddrs) == -1)
+ {
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+ return 0;
+ }
+
+ for (i = ifaddrs; i != NULL; i = i->ifa_next)
+ {
+ if (strcmp (ifname, i->ifa_name) == 0)
+ {
+ /* Matched the name; see if there is an IPv4 address. */
+ if (i->ifa_addr->sa_family == AF_INET)
+ {
+ foundaddr = 1;
+ addr = ((struct sockaddr_in *) i->ifa_addr)->sin_addr.s_addr;
+ break;
+ }
+ }
+ }
+
+ if (!foundaddr)
+ JCL_ThrowException (env, SOCKET_EXCEPTION, "interface has no IPv4 address");
+
+ freeifaddrs (ifaddrs);
+
+ return addr;
+#else
+ (void) ifname;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "getifaddrs not available");
+ return 0;
+#endif /* HAVE_IFADDRS_H && HAVE_GETIFADDRS */
+}
+
+static int
+getif_index (JNIEnv *env, const char *ifname)
+{
+#if defined (HAVE_IFADDRS_H) && defined (HAVE_GETIFADDRS)
+ struct ifaddrs *ifaddrs, *i;
+ char *lastname = NULL;
+ int index = 1;
+ int foundname = 0;
+
+ if (getifaddrs (&ifaddrs) == -1)
+ {
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+ return -1;
+ }
+
+ lastname = ifaddrs->ifa_name;
+ for (i = ifaddrs; i != NULL; i = i->ifa_next)
+ {
+ if (strcmp (lastname, ifaddrs->ifa_name) != 0)
+ {
+ lastname = ifaddrs->ifa_name;
+ index++;
+ }
+ if (strcmp (ifname, ifaddrs->ifa_name) == 0)
+ {
+ foundname = 1;
+ break;
+ }
+ }
+
+ if (!foundname)
+ JCL_ThrowException (env, SOCKET_EXCEPTION,
+ "no interface with that name");
+
+ freeifaddrs (ifaddrs);
+
+ return index;
+#else
+ (void) ifname;
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "getifaddrs not available");
+ return -1;
+#endif /* HAVE_GETIFADDRS */
+}
diff --git a/libjava/classpath/native/jni/java-net/gnu_java_net_local_LocalSocketImpl.c b/libjava/classpath/native/jni/java-net/gnu_java_net_local_LocalSocketImpl.c
index 35fb6bcdcc7..f2b2f8e63b8 100644
--- a/libjava/classpath/native/jni/java-net/gnu_java_net_local_LocalSocketImpl.c
+++ b/libjava/classpath/native/jni/java-net/gnu_java_net_local_LocalSocketImpl.c
@@ -38,9 +38,7 @@ exception statement from your version. */
#define _GNU_SOURCE
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif /* HAVE_CONFIG_H */
#include <gnu_java_net_local_LocalSocketImpl.h>
diff --git a/libjava/classpath/native/jni/java-net/java_net_VMInetAddress.c b/libjava/classpath/native/jni/java-net/java_net_VMInetAddress.c
index 86ac06e6f79..fc921ecef1f 100644
--- a/libjava/classpath/native/jni/java-net/java_net_VMInetAddress.c
+++ b/libjava/classpath/native/jni/java-net/java_net_VMInetAddress.c
@@ -45,13 +45,10 @@ exception statement from your version. */
#include <jni.h>
#include <jcl.h>
+#include "cpnative.h"
+#include "cpnet.h"
#include "javanet.h"
-#include "target_native.h"
-#ifndef WITHOUT_NETWORK
-#include "target_native_network.h"
-#endif /* WITHOUT_NETWORK */
-
#include "java_net_VMInetAddress.h"
/*************************************************************************/
@@ -69,8 +66,8 @@ Java_java_net_VMInetAddress_getLocalHostname (JNIEnv * env,
jstring retval;
#ifndef WITHOUT_NETWORK
- TARGET_NATIVE_NETWORK_GET_HOSTNAME (hostname, sizeof (hostname), result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getHostname (env, hostname, sizeof (hostname));
+ if (result != CPNATIVE_OK)
{
strcpy (hostname, "localhost");
}
@@ -94,6 +91,7 @@ Java_java_net_VMInetAddress_lookupInaddrAny (JNIEnv * env,
__attribute__ ((__unused__)))
{
jarray IParray;
+ cpnet_address *addr;
jbyte *octets;
/* Allocate an array for the IP address */
@@ -108,11 +106,10 @@ Java_java_net_VMInetAddress_lookupInaddrAny (JNIEnv * env,
octets = (*env)->GetByteArrayElements (env, IParray, 0);
#ifndef WITHOUT_NETWORK
- TARGET_NATIVE_NETWORK_INT_TO_IPADDRESS_BYTES (INADDR_ANY,
- octets[0],
- octets[1],
- octets[2], octets[3]);
- (*env)->ReleaseByteArrayElements (env, IParray, octets, 0);
+ addr = cpnet_newIPV4Address (env);
+ cpnet_setIPV4Any (addr);
+ cpnet_IPV4AddressToBytes (addr, octets);
+ cpnet_freeAddress (env, addr);
#else /* not WITHOUT_NETWORK */
octets[0] = 0;
octets[1] = 0;
@@ -120,6 +117,8 @@ Java_java_net_VMInetAddress_lookupInaddrAny (JNIEnv * env,
octets[3] = 0;
#endif /* not WITHOUT_NETWORK */
+ (*env)->ReleaseByteArrayElements (env, IParray, octets, 0);
+
return (IParray);
}
@@ -138,14 +137,14 @@ Java_java_net_VMInetAddress_getHostByAddr (JNIEnv * env,
#ifndef WITHOUT_NETWORK
jbyte *octets;
jsize len;
- int addr;
+ cpnet_address *addr;
char hostname[255];
int result;
jstring retval;
/* Grab the byte[] array with the IP out of the input data */
len = (*env)->GetArrayLength (env, arr);
- if (len != 4)
+ if (len != 4 && len != 16)
{
JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION, "Bad IP Address");
return (jstring) NULL;
@@ -158,21 +157,31 @@ Java_java_net_VMInetAddress_getHostByAddr (JNIEnv * env,
return (jstring) NULL;
}
- /* Convert it to a 32 bit address */
- TARGET_NATIVE_NETWORK_IPADDRESS_BYTES_TO_INT (octets[0],
- octets[1],
- octets[2], octets[3], addr);
+ switch (len)
+ {
+ case 4:
+ addr = cpnet_newIPV4Address(env);
+ cpnet_bytesToIPV4Address (addr, octets);
+ break;
+ case 16:
+ addr = cpnet_newIPV6Address(env);
+ cpnet_bytesToIPV6Address (addr, octets);
+ break;
+ default:
+ JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION, "Bad IP Address");
+ return (jstring) NULL;
+
+ }
/* Release some memory */
(*env)->ReleaseByteArrayElements (env, arr, octets, 0);
/* Resolve the address and return the name */
- TARGET_NATIVE_NETWORK_GET_HOSTNAME_BY_ADDRESS (addr, hostname,
- sizeof (hostname), result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getHostByAddr (env, addr, hostname, sizeof (hostname));
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return (jstring) NULL;
}
@@ -194,16 +203,14 @@ Java_java_net_VMInetAddress_getHostByName (JNIEnv * env,
{
#ifndef WITHOUT_NETWORK
const char *hostname;
-/* FIXME: limitation of max. 64 addresses - how to make it more flexibale? */
- int addresses[64];
+ cpnet_address **addresses;
jsize addresses_count;
int result;
jclass arr_class;
jobjectArray addrs;
- int i;
+ jint i;
jbyte *octets;
jarray ret_octets;
- int max_addresses;
/* Grab the hostname string */
hostname = (*env)->GetStringUTFChars (env, host, 0);
@@ -213,12 +220,8 @@ Java_java_net_VMInetAddress_getHostByName (JNIEnv * env,
return (jobjectArray) NULL;
}
- max_addresses = sizeof (addresses) / sizeof (addresses[0]);
- TARGET_NATIVE_NETWORK_GET_HOSTNAME_BY_NAME (hostname,
- addresses,
- max_addresses,
- addresses_count, result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getHostByName (env, hostname, &addresses, &addresses_count);
+ if (result != CPNATIVE_OK || addresses_count == 0)
{
JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION, (char *) hostname);
return (jobjectArray) NULL;
@@ -242,28 +245,144 @@ Java_java_net_VMInetAddress_getHostByName (JNIEnv * env,
/* Now loop and copy in each address */
for (i = 0; i < addresses_count; i++)
{
- ret_octets = (*env)->NewByteArray (env, 4);
- if (!ret_octets)
+ if (cpnet_isIPV6Address (addresses[i]))
+ {
+ ret_octets = (*env)->NewByteArray (env, 16);
+
+ if (!ret_octets)
+ {
+ JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION, "Internal Error");
+ cpnet_freeAddresses (env, addresses, addresses_count);
+ return (jobjectArray) NULL;
+ }
+
+ octets = (*env)->GetByteArrayElements (env, ret_octets, 0);
+
+ cpnet_IPV6AddressToBytes (addresses[i], octets);
+
+ (*env)->ReleaseByteArrayElements (env, ret_octets, octets, 0);
+
+ (*env)->SetObjectArrayElement (env, addrs, i, ret_octets);
+ }
+ else if (cpnet_isIPV4Address (addresses[i]))
+ {
+ ret_octets = (*env)->NewByteArray (env, 4);
+
+ if (!ret_octets)
+ {
+ JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION, "Internal Error");
+ cpnet_freeAddresses (env, addresses, addresses_count);
+ return (jobjectArray) NULL;
+ }
+
+ octets = (*env)->GetByteArrayElements (env, ret_octets, 0);
+
+ cpnet_IPV4AddressToBytes (addresses[i], octets);
+
+ (*env)->ReleaseByteArrayElements (env, ret_octets, octets, 0);
+
+ (*env)->SetObjectArrayElement (env, addrs, i, ret_octets);
+ }
+ else
{
JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION, "Internal Error");
+ cpnet_freeAddresses (env, addresses, addresses_count);
return (jobjectArray) NULL;
}
+ }
+
+ cpnet_freeAddresses (env, addresses, addresses_count);
+
+ return (addrs);
+#else /* not WITHOUT_NETWORK */
+ return (jobjectArray) NULL;
+#endif /* not WITHOUT_NETWORK */
+}
+
+/*************************************************************************/
+
+/*
+ * Return the IP address represented by a literal address.
+ * Will return null if the literal address is not valid.
+ */
+JNIEXPORT jbyteArray JNICALL
+Java_java_net_VMInetAddress_aton (JNIEnv *env,
+ jclass class
+ __attribute__ ((__unused__)),
+ jstring host)
+{
+#ifndef WITHOUT_NETWORK
+ const char *hostname;
+ cpnet_address *address;
+ int result;
+ jbyte *octets;
+ jbyteArray ret_octets;
+
+ hostname = (*env)->GetStringUTFChars (env, host, 0);
+ if (!hostname)
+ {
+ JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION, "Null hostname");
+ return (jbyteArray) NULL;
+ }
+
+ result = cpnet_aton (env, hostname, &address);
+ if (result != CPNATIVE_OK)
+ {
+ JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION, "Internal Error");
+ if (address)
+ cpnet_freeAddress (env, address);
+ return (jbyteArray) NULL;
+ }
+ if (!address)
+ return (jbyteArray) NULL;
+ if (cpnet_isIPV6Address (address))
+ {
+ ret_octets = (jbyteArray) (*env)->NewByteArray (env, 16);
+
+ if (!ret_octets)
+ {
+ JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION, "Internal Error");
+ cpnet_freeAddress (env, address);
+ return (jbyteArray) NULL;
+ }
+
octets = (*env)->GetByteArrayElements (env, ret_octets, 0);
- TARGET_NATIVE_NETWORK_INT_TO_IPADDRESS_BYTES (addresses[i],
- octets[0],
- octets[1],
- octets[2], octets[3]);
+ cpnet_IPV6AddressToBytes (address, octets);
(*env)->ReleaseByteArrayElements (env, ret_octets, octets, 0);
+ }
+ else if (cpnet_isIPV4Address (address))
+ {
+ ret_octets = (jbyteArray) (*env)->NewByteArray (env, 4);
+
+ if (!ret_octets)
+ {
+ JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION, "Internal Error");
+ cpnet_freeAddress (env, address);
+ return (jbyteArray) NULL;
+ }
+
+ octets = (*env)->GetByteArrayElements (env, ret_octets, 0);
+
+ cpnet_IPV4AddressToBytes (address, octets);
- (*env)->SetObjectArrayElement (env, addrs, i, ret_octets);
+ (*env)->ReleaseByteArrayElements (env, ret_octets, octets, 0);
+ }
+ else
+ {
+ JCL_ThrowException (env, UNKNOWN_HOST_EXCEPTION, "Internal Error");
+ cpnet_freeAddress (env, address);
+ return (jbyteArray) NULL;
}
- return (addrs);
+ cpnet_freeAddress (env, address);
+
+ return (ret_octets);
+
#else /* not WITHOUT_NETWORK */
- return (jobjectArray) NULL;
+ return (jbyteArray) NULL;
#endif /* not WITHOUT_NETWORK */
}
diff --git a/libjava/classpath/native/jni/java-net/java_net_VMNetworkInterface.c b/libjava/classpath/native/jni/java-net/java_net_VMNetworkInterface.c
index f05e9fcc5a2..b51bf68ecee 100644
--- a/libjava/classpath/native/jni/java-net/java_net_VMNetworkInterface.c
+++ b/libjava/classpath/native/jni/java-net/java_net_VMNetworkInterface.c
@@ -35,9 +35,17 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-/* do not move; needed here because of some macro definitions */
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif /* HAVE_CONFIG_H */
+#include <sys/types.h>
+#include <sys/socket.h>
+#ifdef HAVE_IFADDRS_H
+#include <ifaddrs.h>
+#endif
+#include <netinet/in.h>
+#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -47,19 +55,197 @@ exception statement from your version. */
#include "java_net_VMNetworkInterface.h"
-#include "javanet.h"
+
+static jmethodID java_net_VMNetworkInterface_init;
+static jmethodID java_net_VMNetworkInterface_addAddress;
/*
- * Returns all local network interfaces as vector
+ * Initialize our static method ID's.
+ *
+ * Class: java_net_VMNetworkInterface
+ * Method: initIds
+ * Signature: ()V
*/
-JNIEXPORT jobject JNICALL
-Java_java_net_VMNetworkInterface_getInterfaces (JNIEnv * env,
- jclass class
- __attribute__ ((__unused__)))
+JNIEXPORT void JNICALL
+Java_java_net_VMNetworkInterface_initIds (JNIEnv *env, jclass clazz)
+{
+ java_net_VMNetworkInterface_init =
+ (*env)->GetMethodID (env, clazz, "<init>", "(Ljava/lang/String;)V");
+ if (java_net_VMNetworkInterface_init == NULL)
+ {
+ if (!(*env)->ExceptionCheck (env))
+ JCL_ThrowException (env, "java/lang/NoSuchMethodError",
+ "VMNetworkinterface.addAddress");
+ return;
+ }
+ java_net_VMNetworkInterface_addAddress =
+ (*env)->GetMethodID (env, clazz, "addAddress", "(Ljava/nio/ByteBuffer;)V");
+ if (java_net_VMNetworkInterface_addAddress == NULL)
+ {
+ if (!(*env)->ExceptionCheck (env))
+ JCL_ThrowException (env, "java/lang/NoSuchMethodError",
+ "VMNetworkinterface.addAddress");
+ }
+}
+
+struct netif_entry
+{
+ char *name;
+ jobject netif;
+ int numaddrs;
+ struct netif_entry *next;
+};
+
+static void
+free_netif_list (JNIEnv *env, struct netif_entry *list)
{
- JCL_ThrowException (env, IO_EXCEPTION,
- "java.net.VMNetworkInterface.getInterfaces(): not implemented");
- return 0;
+ while (list != NULL)
+ {
+ struct netif_entry *e = list->next;
+ JCL_free (env, list);
+ list = e;
+ }
+}
+
+/*
+ * Returns all local network interfaces as an array.
+ */
+JNIEXPORT jobjectArray JNICALL
+Java_java_net_VMNetworkInterface_getVMInterfaces (JNIEnv * env, jclass clazz)
+{
+#if defined (HAVE_IFADDRS_H) && defined (HAVE_GETIFADDRS)
+ struct ifaddrs *ifaddrs, *i;
+ struct netif_entry *iflist = NULL, *e;
+ jobjectArray netifs;
+ int numifs = 0;
+ int k;
+
+ if (getifaddrs (&ifaddrs) == -1)
+ {
+ JCL_ThrowException (env, "java/net/SocketException", strerror (errno));
+ return NULL;
+ }
+
+ for (i = ifaddrs; i != NULL; i = i->ifa_next)
+ {
+ if (iflist == NULL)
+ {
+ iflist = JCL_malloc (env, sizeof (struct netif_entry));
+ if (iflist == NULL)
+ {
+ freeifaddrs (ifaddrs);
+ return NULL;
+ }
+ iflist->name = i->ifa_name;
+ iflist->numaddrs = 0;
+ iflist->next = NULL;
+ iflist->netif = (*env)->NewObject (env, clazz, java_net_VMNetworkInterface_init,
+ (*env)->NewStringUTF (env, i->ifa_name));
+ if (iflist->netif == NULL)
+ {
+ freeifaddrs (ifaddrs);
+ JCL_free (env, iflist);
+ return NULL;
+ }
+ e = iflist;
+ }
+ else
+ {
+ struct netif_entry *p = NULL;
+ for (e = iflist; e != NULL; e = e->next)
+ {
+ if (strcmp (e->name, i->ifa_name) == 0)
+ break;
+ p = e;
+ }
+
+ if (e == NULL)
+ {
+ p->next = (struct netif_entry *) JCL_malloc (env, sizeof (struct netif_entry));
+ if (p->next == NULL)
+ {
+ free_netif_list (env, iflist);
+ freeifaddrs (ifaddrs);
+ return NULL;
+ }
+ e = p->next;
+ e->name = i->ifa_name;
+ e->numaddrs = 0;
+ e->next = NULL;
+ e->netif = (*env)->NewObject (env, clazz, java_net_VMNetworkInterface_init,
+ (*env)->NewStringUTF (env, i->ifa_name));
+ if (e->netif == NULL)
+ {
+ free_netif_list (env, iflist);
+ freeifaddrs (ifaddrs);
+ return NULL;
+ }
+ }
+ }
+
+ if (i->ifa_addr == NULL)
+ continue;
+
+ if (i->ifa_addr->sa_family == AF_INET)
+ {
+ struct sockaddr_in *sin = (struct sockaddr_in *) i->ifa_addr;
+ jobject buffer = (*env)->NewDirectByteBuffer (env, &(sin->sin_addr.s_addr), 4);
+ (*env)->CallVoidMethod (env, e->netif, java_net_VMNetworkInterface_addAddress,
+ buffer);
+ if ((*env)->ExceptionCheck (env))
+ {
+ free_netif_list (env, iflist);
+ freeifaddrs (ifaddrs);
+ return NULL;
+ }
+ (*env)->DeleteLocalRef (env, buffer);
+ e->numaddrs++;
+ }
+#ifdef HAVE_INET6
+ else if (i->ifa_addr->sa_family == AF_INET6)
+ {
+ struct sockaddr_in6 *sin = (struct sockaddr_in6 *) i->ifa_addr;
+ jobject buffer = (*env)->NewDirectByteBuffer (env, &(sin->sin6_addr.s6_addr), 16);
+ (*env)->CallVoidMethod (env, e->netif, java_net_VMNetworkInterface_addAddress,
+ buffer);
+ if ((*env)->ExceptionCheck (env))
+ {
+ free_netif_list (env, iflist);
+ freeifaddrs (ifaddrs);
+ return NULL;
+ }
+ (*env)->DeleteLocalRef (env, buffer);
+ e->numaddrs++;
+ }
+#endif /* HAVE_INET6 */
+ }
+
+ /* Count how many interfaces we have that have addresses. */
+ for (e = iflist; e != NULL; e = e->next)
+ {
+ if (e->numaddrs != 0)
+ numifs++;
+ }
+
+ netifs = (*env)->NewObjectArray (env, numifs, clazz, NULL);
+ k = 0;
+ for (e = iflist; e != NULL && k < numifs; e = e->next)
+ {
+ if (e->numaddrs != 0)
+ {
+ (*env)->SetObjectArrayElement (env, netifs, k, e->netif);
+ (*env)->DeleteLocalRef (env, e->netif);
+ k++;
+ }
+ }
+
+ free_netif_list (env, iflist);
+ freeifaddrs (ifaddrs);
+ return netifs;
+#else
+ JCL_ThrowException (env, "java/net/SocketException", "getifaddrs not supported");
+ return NULL;
+#endif /* HAVE_GETIFADDRS */
}
/* end of file */
diff --git a/libjava/classpath/native/jni/java-net/javanet.c b/libjava/classpath/native/jni/java-net/javanet.c
index e500c608431..1d2f7202a17 100644
--- a/libjava/classpath/native/jni/java-net/javanet.c
+++ b/libjava/classpath/native/jni/java-net/javanet.c
@@ -45,12 +45,10 @@ exception statement from your version. */
#include <jni.h>
#include <jcl.h>
-#include "javanet.h"
+#include "cpnative.h"
+#include "cpnet.h"
-#include "target_native.h"
-#ifndef WITHOUT_NETWORK
-#include "target_native_network.h"
-#endif /* WITHOUT_NETWORK */
+#include "javanet.h"
#ifndef WITHOUT_NETWORK
/* Need to have some value for SO_TIMEOUT */
@@ -234,23 +232,20 @@ _javanet_create_integer (JNIEnv * env, jint val)
/*
* Builds an InetAddress object from a 32 bit address in host byte order
*/
-static jobject
-_javanet_create_inetaddress (JNIEnv * env, int netaddr)
+jobject
+_javanet_create_inetaddress (JNIEnv * env, cpnet_address *netaddr)
{
#ifndef WITHOUT_NETWORK
- unsigned char octets[4];
- char buf[16];
+ jbyte octets[4];
+ char buf[64];
jclass ia_cls;
jmethodID mid;
jstring ip_str;
jobject ia;
/* Build a string IP address */
- TARGET_NATIVE_NETWORK_INT_TO_IPADDRESS_BYTES (netaddr,
- octets[0],
- octets[1],
- octets[2], octets[3]);
- sprintf (buf, "%d.%d.%d.%d", octets[0], octets[1], octets[2], octets[3]);
+ cpnet_IPV4AddressToBytes(netaddr, octets);
+ sprintf (buf, "%d.%d.%d.%d", (int) (unsigned char)octets[0], (int)(unsigned char)octets[1], (int)(unsigned char)octets[2], (int)(unsigned char)octets[3]);
DBG ("_javanet_create_inetaddress(): Created ip addr string\n");
/* Get an InetAddress object for this IP */
@@ -320,7 +315,7 @@ _javanet_set_remhost_addr (JNIEnv * env, jobject this, jobject ia)
* InetAddress for the specified addr
*/
static void
-_javanet_set_remhost (JNIEnv * env, jobject this, int netaddr)
+_javanet_set_remhost (JNIEnv * env, jobject this, cpnet_address *netaddr)
{
jobject ia;
@@ -338,19 +333,20 @@ _javanet_set_remhost (JNIEnv * env, jobject this, int netaddr)
/*************************************************************************/
/*
- * Returns a 32 bit Internet address for the passed in InetAddress object
+ * Returns an Internet address for the passed in InetAddress object
*/
-int
-_javanet_get_netaddr (JNIEnv * env, jobject addr)
+cpnet_address *
+_javanet_get_ip_netaddr (JNIEnv * env, jobject addr)
{
#ifndef WITHOUT_NETWORK
jclass cls = 0;
jmethodID mid;
jarray arr = 0;
jbyte *octets;
- int netaddr, len;
+ cpnet_address *netaddr;
+ jint len;
- DBG ("_javanet_get_netaddr(): Entered _javanet_get_netaddr\n");
+ DBG ("_javanet_get_ip_netaddr(): Entered _javanet_get_ip_netaddr\n");
if (addr == NULL)
{
@@ -368,36 +364,51 @@ _javanet_get_netaddr (JNIEnv * env, jobject addr)
if (mid == NULL)
return 0;
- DBG ("_javanet_get_netaddr(): Got getAddress method\n");
+ DBG ("_javanet_get_ip_netaddr(): Got getAddress method\n");
arr = (*env)->CallObjectMethod (env, addr, mid);
if (arr == NULL)
return 0;
- DBG ("_javanet_get_netaddr(): Got the address\n");
+ DBG ("_javanet_get_ip_netaddr(): Got the address\n");
- /* Turn the IP address into a 32 bit Internet address in network byte order */
+ /* Turn the IP address into a system cpnet address.
+ * If the length is 4 then it is an IPV4 address, if it
+ * is 16 then it is an IPV6 address else it is an InternError. */
len = (*env)->GetArrayLength (env, arr);
- if (len != 4)
+ if (len != 4 && len != 16)
{
JCL_ThrowException (env, IO_EXCEPTION, "Internal Error");
return 0;
}
- DBG ("_javanet_get_netaddr(): Length ok\n");
+ DBG ("_javanet_get_ip_netaddr(): Length ok\n");
octets = (*env)->GetByteArrayElements (env, arr, 0);
if (octets == NULL)
return 0;
- DBG ("_javanet_get_netaddr(): Grabbed bytes\n");
+ DBG ("_javanet_get_ip_netaddr(): Grabbed bytes\n");
- TARGET_NATIVE_NETWORK_IPADDRESS_BYTES_TO_INT (octets[0],
- octets[1],
- octets[2],
- octets[3], netaddr);
+ switch (len)
+ {
+ case 4:
+ netaddr = cpnet_newIPV4Address(env);
+ cpnet_bytesToIPV4Address(netaddr, octets);
+ break;
+ case 16:
+ netaddr = cpnet_newIPV6Address(env);
+ cpnet_bytesToIPV6Address(netaddr, octets);
+ break;
+ default:
+ /* This should not happen as we have checked before.
+ * But that way we shut the compiler warnings */
+ JCL_ThrowException (env, IO_EXCEPTION, "Internal Error");
+ return 0;
+
+ }
(*env)->ReleaseByteArrayElements (env, arr, octets, 0);
- DBG ("_javanet_get_netaddr(): Done getting addr\n");
+ DBG ("_javanet_get_ip_netaddr(): Done getting addr\n");
return netaddr;
#else /* not WITHOUT_NETWORK */
@@ -419,29 +430,29 @@ _javanet_create (JNIEnv * env, jobject this, jboolean stream)
if (stream)
{
/* create a stream socket */
- TARGET_NATIVE_NETWORK_SOCKET_OPEN_STREAM (fd, result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_openSocketStream(env, &fd, AF_INET);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return;
}
}
else
{
/* create a datagram socket, set broadcast option */
- TARGET_NATIVE_NETWORK_SOCKET_OPEN_DATAGRAM (fd, result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_openSocketDatagram (env, &fd, AF_INET);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return;
}
- TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_BROADCAST (fd, 1, result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_setBroadcast(env, fd, 1);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return;
}
}
@@ -458,13 +469,11 @@ _javanet_create (JNIEnv * env, jobject this, jboolean stream)
/* Try to make sure we close the socket since close() won't work. */
do
{
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (fd, result);
- if (result != TARGET_NATIVE_OK
- && (TARGET_NATIVE_LAST_ERROR ()
- != TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL))
+ result = cpnet_close(env, fd);
+ if (result != CPNATIVE_OK && result != CPNATIVE_EINTR)
return;
}
- while (result != TARGET_NATIVE_OK);
+ while (result != CPNATIVE_OK);
return;
}
@@ -498,18 +507,16 @@ _javanet_close (JNIEnv * env, jobject this, int stream)
"native_fd", -1);
do
{
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (fd, result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_close (env, fd);
+ if (result != CPNATIVE_OK)
{
/* Only throw an error when a "real" error occurs. */
- error = TARGET_NATIVE_LAST_ERROR ();
- if (error != TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL
- && error != ENOTCONN && error != ECONNRESET && error != EBADF)
+ if (result != CPNATIVE_EINTR && result != ENOTCONN && result != ECONNRESET && result != EBADF)
JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
}
}
- while (error == TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL);
+ while (error == CPNATIVE_EINTR);
#else /* not WITHOUT_NETWORK */
#endif /* not WITHOUT_NETWORK */
@@ -525,20 +532,24 @@ _javanet_connect (JNIEnv * env, jobject this, jobject addr, jint port,
jboolean stream)
{
#ifndef WITHOUT_NETWORK
- int netaddr, fd;
+ cpnet_address *netaddr;
+ int fd;
int result;
- int local_address, local_port;
- int remote_address, remote_port;
+ cpnet_address *local_addr;
+ cpnet_address *remote_addr;
DBG ("_javanet_connect(): Entered _javanet_connect\n");
/* Pre-process input variables */
- netaddr = _javanet_get_netaddr (env, addr);
+ netaddr = _javanet_get_ip_netaddr (env, addr);
if ((*env)->ExceptionOccurred (env))
return;
if (port == -1)
port = 0;
+
+ cpnet_addressSetPort(netaddr, port);
+
DBG ("_javanet_connect(): Got network address\n");
/* Grab the real socket file descriptor */
@@ -554,29 +565,27 @@ _javanet_connect (JNIEnv * env, jobject this, jobject addr, jint port,
/* Connect up */
do
{
- TARGET_NATIVE_NETWORK_SOCKET_CONNECT (fd, netaddr, port, result);
- if (result != TARGET_NATIVE_OK
- && (TARGET_NATIVE_LAST_ERROR ()
- != TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL))
+ result = cpnet_connect (env, fd, netaddr);
+ if (result != CPNATIVE_OK && result != CPNATIVE_EINTR)
{
JCL_ThrowException (env, CONNECT_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return;
}
}
- while (result != TARGET_NATIVE_OK);
-
+ while (result != CPNATIVE_OK);
+
DBG ("_javanet_connect(): Connected successfully\n");
/* Populate instance variables */
- TARGET_NATIVE_NETWORK_SOCKET_GET_LOCAL_INFO (fd, local_address, local_port,
- result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getLocalAddr (env, fd, &local_addr);
+ if (result != CPNATIVE_OK)
{
+ cpnet_freeAddress(env, netaddr);
JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
/* We don't care whether this succeeds. close() will cleanup later. */
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (fd, result);
+ cpnet_close (env, fd);
return;
}
@@ -584,63 +593,72 @@ _javanet_connect (JNIEnv * env, jobject this, jobject addr, jint port,
if ((*env)->ExceptionOccurred (env))
{
/* We don't care whether this succeeds. close() will cleanup later. */
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (fd, result);
+ cpnet_freeAddress(env, netaddr);
+ cpnet_freeAddress(env, local_addr);
+ cpnet_close (env, fd);
return;
}
DBG ("_javanet_connect(): Created fd\n");
if (stream)
_javanet_set_int_field (env, this, "java/net/SocketImpl", "localport",
- local_port);
+ cpnet_addressGetPort(local_addr));
else
_javanet_set_int_field (env, this, "java/net/DatagramSocketImpl",
- "localPort", local_port);
+ "localPort", cpnet_addressGetPort(local_addr));
+ cpnet_freeAddress (env, local_addr);
if ((*env)->ExceptionOccurred (env))
{
/* We don't care whether this succeeds. close() will cleanup later. */
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (fd, result);
+ cpnet_freeAddress(env, netaddr);
+ cpnet_close (env, fd);
return;
}
DBG ("_javanet_connect(): Set the local port\n");
- TARGET_NATIVE_NETWORK_SOCKET_GET_REMOTE_INFO (fd, remote_address,
- remote_port, result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getRemoteAddr (env, fd, &remote_addr);
+ if (result != CPNATIVE_OK)
{
+ cpnet_freeAddress(env, netaddr);
JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
/* We don't care whether this succeeds. close() will cleanup later. */
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (fd, result);
+ cpnet_close (env, fd);
return;
}
if (stream)
{
- if (remote_address == netaddr)
+ if (cpnet_isAddressEqual(remote_addr, netaddr))
{
_javanet_set_remhost_addr (env, this, addr);
}
else
{
- _javanet_set_remhost (env, this, remote_address);
+ _javanet_set_remhost (env, this, remote_addr);
}
+ cpnet_freeAddress(env, netaddr);
+
if ((*env)->ExceptionOccurred (env))
{
/* We don't care whether this succeeds. close() will cleanup later.
*/
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (fd, result);
+ cpnet_freeAddress (env, remote_addr);
+ cpnet_close (env, fd);
return;
}
DBG ("_javanet_connect(): Set the remote host\n");
_javanet_set_int_field (env, this, "java/net/SocketImpl", "port",
- remote_port);
+ cpnet_addressGetPort(remote_addr));
+ cpnet_freeAddress (env, remote_addr);
+
if ((*env)->ExceptionOccurred (env))
{
/* We don't care whether this succeeds. close() will cleanup later.
*/
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (fd, result);
+ cpnet_close (env, fd);
return;
}
DBG ("_javanet_connect(): Set the remote port\n");
@@ -661,98 +679,59 @@ _javanet_bind (JNIEnv * env, jobject this, jobject addr, jint port,
int stream)
{
#ifndef WITHOUT_NETWORK
- jclass cls;
- jmethodID mid;
- jbyteArray arr = 0;
- jbyte *octets;
jint fd;
- int tmpaddr;
+ cpnet_address *tmpaddr;
+ cpnet_address *local_addr;
int result;
- int local_address, local_port;
DBG ("_javanet_bind(): Entering native bind()\n");
-
- /* Get the address to connect to */
- cls = (*env)->GetObjectClass (env, addr);
- if (cls == NULL)
- return;
-
- mid = (*env)->GetMethodID (env, cls, "getAddress", "()[B");
- if (mid == NULL)
- return;
-
- DBG ("_javanet_bind(): Past getAddress method id\n");
-
- arr = (*env)->CallObjectMethod (env, addr, mid);
- if ((arr == NULL) || (*env)->ExceptionOccurred (env))
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- "Internal error: _javanet_bind()");
- return;
- }
-
- DBG ("_javanet_bind(): Past call object method\n");
-
- octets = (*env)->GetByteArrayElements (env, arr, 0);
- if (octets == NULL)
- return;
-
- DBG ("_javanet_bind(): Past grab array\n");
-
- /* Get the native socket file descriptor */
+
+ /* Grab the real socket file descriptor */
fd = _javanet_get_int_field (env, this, "native_fd");
if (fd == -1)
{
- (*env)->ReleaseByteArrayElements (env, arr, octets, 0);
JCL_ThrowException (env, IO_EXCEPTION,
- "Internal error: _javanet_bind(): no native file descriptor");
+ "Internal error: _javanet_connect(): no native file descriptor");
return;
}
- DBG ("_javanet_bind(): Past native_fd lookup\n");
- /* XXX NYI ??? */
- _javanet_set_option (env, this, SOCKOPT_SO_REUSEADDR,
- _javanet_create_boolean (env, JNI_TRUE));
+ cpnet_setReuseAddress (env, fd, 1);
+ /* Get the address to connect to */
+ tmpaddr = _javanet_get_ip_netaddr (env, addr);
+ if ((*env)->ExceptionOccurred (env))
+ return;
- /* Bind the socket */
- TARGET_NATIVE_NETWORK_IPADDRESS_BYTES_TO_INT (octets[0],
- octets[1],
- octets[2],
- octets[3], tmpaddr);
- TARGET_NATIVE_NETWORK_SOCKET_BIND (fd, tmpaddr, port, result);
-
- if (result != TARGET_NATIVE_OK)
+ cpnet_addressSetPort (tmpaddr, port);
+ result = cpnet_bind(env, fd, tmpaddr);
+ cpnet_freeAddress (env, tmpaddr);
+ if (result != CPNATIVE_OK)
{
- char *errorstr = TARGET_NATIVE_LAST_ERROR_STRING ();
- (*env)->ReleaseByteArrayElements (env, arr, octets, 0);
-
JCL_ThrowException (env, BIND_EXCEPTION,
- errorstr);
+ cpnative_getErrorString (result));
return;
}
DBG ("_javanet_bind(): Past bind\n");
- (*env)->ReleaseByteArrayElements (env, arr, octets, 0);
-
/* Update instance variables, specifically the local port number */
- TARGET_NATIVE_NETWORK_SOCKET_GET_LOCAL_INFO (fd, local_address, local_port,
- result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getLocalAddr (env, fd, &local_addr);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return;
}
if (stream)
_javanet_set_int_field (env, this, "java/net/SocketImpl",
- "localport", local_port);
+ "localport", cpnet_addressGetPort (local_addr));
else
_javanet_set_int_field (env, this, "java/net/DatagramSocketImpl",
- "localPort", local_port);
+ "localPort", cpnet_addressGetPort (local_addr));
DBG ("_javanet_bind(): Past update port number\n");
+ cpnet_freeAddress (env, local_addr);
+
return;
#else /* not WITHOUT_NETWORK */
#endif /* not WITHOUT_NETWORK */
@@ -781,11 +760,11 @@ _javanet_listen (JNIEnv * env, jobject this, jint queuelen)
}
/* Start listening */
- TARGET_NATIVE_NETWORK_SOCKET_LISTEN (fd, queuelen, result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_listen (env, fd, queuelen);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return;
}
#else /* not WITHOUT_NETWORK */
@@ -804,8 +783,7 @@ _javanet_accept (JNIEnv * env, jobject this, jobject impl)
#ifndef WITHOUT_NETWORK
int fd, newfd;
int result;
- int local_address, local_port;
- int remote_address, remote_port;
+ cpnet_address *remote_addr, *local_addr;
/* Get the real file descriptor */
fd = _javanet_get_int_field (env, this, "native_fd");
@@ -819,24 +797,22 @@ _javanet_accept (JNIEnv * env, jobject this, jobject impl)
/* Accept the connection */
do
{
- TARGET_NATIVE_NETWORK_SOCKET_ACCEPT (fd, newfd, result);
- if (result != TARGET_NATIVE_OK
- && (TARGET_NATIVE_LAST_ERROR ()
- != TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL))
+ result = cpnet_accept (env, fd, &newfd);
+ if (result != CPNATIVE_OK && result != CPNATIVE_EINTR)
{
- if (TARGET_NATIVE_LAST_ERROR () == EAGAIN)
+ if (result == ETIMEDOUT || result == EAGAIN)
JCL_ThrowException (env, "java/net/SocketTimeoutException",
- "Timeout");
+ "Accept operation timed out");
else
JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return;
}
}
- while (result != TARGET_NATIVE_OK);
+ while (result != CPNATIVE_OK);
/* Reset the inherited timeout. */
- TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_TIMEOUT (newfd, 0, result);
+ cpnet_setSocketTimeout (env, newfd, 0);
/* Populate instance variables */
_javanet_set_int_field (env, impl, "gnu/java/net/PlainSocketImpl",
@@ -847,24 +823,21 @@ _javanet_accept (JNIEnv * env, jobject this, jobject impl)
/* Try to make sure we close the socket since close() won't work. */
do
{
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (newfd, result);
- if (result != TARGET_NATIVE_OK
- && (TARGET_NATIVE_LAST_ERROR ()
- != TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL))
+ result = cpnet_close (env, newfd);
+ if (result != CPNATIVE_OK && result != CPNATIVE_EINTR)
return;
}
- while (result != TARGET_NATIVE_OK);
+ while (result != CPNATIVE_OK);
return;
}
- TARGET_NATIVE_NETWORK_SOCKET_GET_LOCAL_INFO (newfd, local_address,
- local_port, result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getLocalAddr (env, newfd, &local_addr);
+ if (result != CPNATIVE_OK)
{
/* We don't care whether this succeeds. close() will cleanup later. */
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (newfd, result);
+ cpnet_close (env, newfd);
JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return;
}
@@ -872,44 +845,47 @@ _javanet_accept (JNIEnv * env, jobject this, jobject impl)
if ((*env)->ExceptionOccurred (env))
{
/* We don't care whether this succeeds. close() will cleanup later. */
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (newfd, result);
+ cpnet_freeAddress (env, local_addr);
+ cpnet_close (env, newfd);
return;
}
_javanet_set_int_field (env, impl, "java/net/SocketImpl", "localport",
- local_port);
+ cpnet_addressGetPort (local_addr));
+ cpnet_freeAddress (env, local_addr);
if ((*env)->ExceptionOccurred (env))
{
/* We don't care whether this succeeds. close() will cleanup later. */
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (newfd, result);
+ cpnet_close (env, newfd);
return;
}
- TARGET_NATIVE_NETWORK_SOCKET_GET_REMOTE_INFO (newfd, remote_address,
- remote_port, result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getRemoteAddr (env, newfd, &remote_addr);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
/* We don't care whether this succeeds. close() will cleanup later. */
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (newfd, result);
+ cpnet_close (env, newfd);
return;
}
- _javanet_set_remhost (env, impl, remote_address);
+ _javanet_set_remhost (env, impl, remote_addr);
if ((*env)->ExceptionOccurred (env))
{
/* We don't care whether this succeeds. close() will cleanup later. */
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (newfd, result);
+ cpnet_close (env, newfd);
+ cpnet_freeAddress (env, remote_addr);
return;
}
_javanet_set_int_field (env, impl, "java/net/SocketImpl", "port",
- remote_port);
+ cpnet_addressGetPort (remote_addr));
+ cpnet_freeAddress (env, remote_addr);
if ((*env)->ExceptionOccurred (env))
{
/* We don't care whether this succeeds. close() will cleanup later. */
- TARGET_NATIVE_NETWORK_SOCKET_CLOSE (newfd, result);
+ cpnet_close (env, newfd);
return;
}
#else /* not WITHOUT_NETWORK */
@@ -934,13 +910,14 @@ _javanet_accept (JNIEnv * env, jobject this, jobject impl)
*/
int
_javanet_recvfrom (JNIEnv * env, jobject this, jarray buf, int offset,
- int len, int *addr, int *port)
+ int len, cpnet_address **addr)
{
#ifndef WITHOUT_NETWORK
int fd;
jbyte *p;
- int from_address, from_port;
- int received_bytes;
+ cpnet_address *from_addr;
+ jint received_bytes;
+ int result;
DBG ("_javanet_recvfrom(): Entered _javanet_recvfrom\n");
@@ -962,36 +939,26 @@ _javanet_recvfrom (JNIEnv * env, jobject this, jarray buf, int offset,
DBG ("_javanet_recvfrom(): Got buffer\n");
/* Read the data */
- from_address = 0;
- from_port = 0;
+ from_addr = NULL;
do
{
if (addr != NULL)
{
- TARGET_NATIVE_NETWORK_SOCKET_RECEIVE_WITH_ADDRESS_PORT (fd,
- p + offset,
- len,
- from_address,
- from_port,
- received_bytes);
+ result = cpnet_recvFrom (env, fd, p + offset, len, &from_addr, &received_bytes);
}
else
{
- TARGET_NATIVE_NETWORK_SOCKET_RECEIVE (fd, p + offset, len,
- received_bytes);
+ result = cpnet_recv (env, fd, p + offset, len, &received_bytes);
}
}
- while ((received_bytes == -1) &&
- (TARGET_NATIVE_LAST_ERROR () ==
- TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL));
-
- if (received_bytes == -1)
+ while (result == CPNATIVE_EINTR);
+ if (result != 0)
{
- if (TARGET_NATIVE_LAST_ERROR () == EAGAIN)
- JCL_ThrowException (env, "java/net/SocketTimeoutException", "Timeout");
+ if (result == EAGAIN || result == ETIMEDOUT)
+ JCL_ThrowException (env, "java/net/SocketTimeoutException", "Receive operation timed out");
else
JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
/* Cleanup and return. */
(*env)->ReleaseByteArrayElements (env, buf, p, 0);
@@ -1003,9 +970,7 @@ _javanet_recvfrom (JNIEnv * env, jobject this, jarray buf, int offset,
/* Handle return addr case */
if (addr != NULL)
{
- (*addr) = from_address;
- if (port != NULL)
- (*port) = from_port;
+ (*addr) = from_addr;
}
/* zero bytes received means recv() noticed the other side orderly
@@ -1013,7 +978,7 @@ _javanet_recvfrom (JNIEnv * env, jobject this, jarray buf, int offset,
if (received_bytes == 0)
received_bytes = -1;
- return (received_bytes);
+ return received_bytes;
#else /* not WITHOUT_NETWORK */
#endif /* not WITHOUT_NETWORK */
}
@@ -1031,12 +996,13 @@ _javanet_recvfrom (JNIEnv * env, jobject this, jarray buf, int offset,
*/
void
_javanet_sendto (JNIEnv * env, jobject this, jarray buf, int offset, int len,
- int addr, int port)
+ cpnet_address *addr)
{
#ifndef WITHOUT_NETWORK
int fd;
jbyte *p;
- int bytes_sent;
+ jint bytes_sent;
+ int result;
/* Get the real file descriptor */
fd = _javanet_get_int_field (env, this, "native_fd");
@@ -1056,26 +1022,30 @@ _javanet_sendto (JNIEnv * env, jobject this, jarray buf, int offset, int len,
while (len > 0)
{
/* Send the data */
- if (addr == 0)
+ if (addr == NULL)
{
DBG ("_javanet_sendto(): Sending....\n");
- TARGET_NATIVE_NETWORK_SOCKET_SEND (fd, p + offset, len, bytes_sent);
+ result = cpnet_send (env, fd, p + offset, len, &bytes_sent);
}
else
{
DBG ("_javanet_sendto(): Sending....\n");
- TARGET_NATIVE_NETWORK_SOCKET_SEND_WITH_ADDRESS_PORT (fd, p + offset,
- len, addr, port,
- bytes_sent);
+ result = cpnet_sendTo (env, fd, p + offset, len, addr, &bytes_sent);
}
+ if (result == EDESTADDRREQ)
+ {
+ JCL_ThrowException (env, NULL_EXCEPTION,
+ "Socket is not connected and no address is given");
+ break;
+ }
+
if (bytes_sent < 0)
{
- if (TARGET_NATIVE_LAST_ERROR ()
- != TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL)
+ if (result != CPNATIVE_EINTR)
{
JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
break;
}
}
@@ -1105,8 +1075,8 @@ _javanet_set_option (JNIEnv * env, jobject this, jint option_id, jobject val)
int optval;
jclass cls;
jmethodID mid;
- int address;
- int result;
+ cpnet_address * address;
+ int result = CPNATIVE_OK;
/* Get the real file descriptor */
fd = _javanet_get_int_field (env, this, "native_fd");
@@ -1123,7 +1093,6 @@ _javanet_set_option (JNIEnv * env, jobject this, jint option_id, jobject val)
return;
/* Process the option request */
- result = TARGET_NATIVE_ERROR;
switch (option_id)
{
/* TCP_NODELAY case. val is a Boolean that tells us what to do */
@@ -1141,8 +1110,7 @@ _javanet_set_option (JNIEnv * env, jobject this, jint option_id, jobject val)
if ((*env)->ExceptionOccurred (env))
return;
- TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_TCP_NODELAY (fd, optval,
- result);
+ result = cpnet_setSocketTCPNoDelay (env, fd, optval);
break;
/* SO_LINGER case. If val is a boolean, then it will always be set
@@ -1153,8 +1121,7 @@ _javanet_set_option (JNIEnv * env, jobject this, jint option_id, jobject val)
if (mid)
{
/* We are disabling linger */
- TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_LINGER (fd, 1, 0,
- result);
+ result = cpnet_setLinger (env, fd, JNI_FALSE, 0);
}
else
{
@@ -1175,15 +1142,13 @@ _javanet_set_option (JNIEnv * env, jobject this, jint option_id, jobject val)
if ((*env)->ExceptionOccurred (env))
return;
- TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_LINGER (fd, 0, optval,
- result);
+ result = cpnet_setLinger(env, fd, JNI_TRUE, optval);
}
break;
/* SO_TIMEOUT case. Val will be an integer with the new value */
/* Not writable on Linux */
case SOCKOPT_SO_TIMEOUT:
-#ifdef SO_TIMEOUT
mid = (*env)->GetMethodID (env, cls, "intValue", "()I");
if (mid == NULL)
{
@@ -1196,10 +1161,7 @@ _javanet_set_option (JNIEnv * env, jobject this, jint option_id, jobject val)
if ((*env)->ExceptionOccurred (env))
return;
- TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_TIMEOUT (fd, optval, result);
-#else
- result = TARGET_NATIVE_OK;
-#endif
+ result = cpnet_setSocketTimeout (env, fd, optval);
break;
case SOCKOPT_SO_SNDBUF:
@@ -1218,11 +1180,9 @@ _javanet_set_option (JNIEnv * env, jobject this, jint option_id, jobject val)
return;
if (option_id == SOCKOPT_SO_SNDBUF)
- TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_SNDBUF (fd, optval,
- result);
+ result = cpnet_setSendBuf (env, fd, optval);
else
- TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_RCDBUF (fd, optval,
- result);
+ result = cpnet_setRecvBuf (env, fd, optval);
break;
/* TTL case. Val with be an Integer with the new time to live value */
@@ -1239,18 +1199,18 @@ _javanet_set_option (JNIEnv * env, jobject this, jint option_id, jobject val)
if ((*env)->ExceptionOccurred (env))
return;
- TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_IP_TTL (fd, optval, result);
+ result = cpnet_setTTL (env, fd, optval);
break;
/* Multicast Interface case - val is InetAddress object */
case SOCKOPT_IP_MULTICAST_IF:
- address = _javanet_get_netaddr (env, val);
+ address = _javanet_get_ip_netaddr (env, val);
if ((*env)->ExceptionOccurred (env))
return;
-
- TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_IP_MULTICAST_IF (fd, address,
- result);
+
+ result = cpnet_setMulticastIF (env, fd, address);
+ cpnet_freeAddress (env, address);
break;
case SOCKOPT_SO_REUSEADDR:
@@ -1267,8 +1227,7 @@ _javanet_set_option (JNIEnv * env, jobject this, jint option_id, jobject val)
if ((*env)->ExceptionOccurred (env))
return;
- TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_REUSE_ADDRESS (fd, optval,
- result);
+ result = cpnet_setReuseAddress (env, fd, optval);
break;
case SOCKOPT_SO_KEEPALIVE:
@@ -1285,7 +1244,7 @@ _javanet_set_option (JNIEnv * env, jobject this, jint option_id, jobject val)
if ((*env)->ExceptionOccurred (env))
return;
- TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_KEEP_ALIVE (fd, optval, result);
+ result = cpnet_setKeepAlive (env, fd, optval);
break;
case SOCKOPT_SO_BINDADDR:
@@ -1298,10 +1257,10 @@ _javanet_set_option (JNIEnv * env, jobject this, jint option_id, jobject val)
}
/* Check to see if above operations succeeded */
- if (result != TARGET_NATIVE_OK)
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, SOCKET_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return;
}
#else /* not WITHOUT_NETWORK */
@@ -1319,8 +1278,9 @@ _javanet_get_option (JNIEnv * env, jobject this, jint option_id)
#ifndef WITHOUT_NETWORK
int fd;
int flag, optval;
- int address;
+ cpnet_address *address;
int result;
+ jobject obj;
/* Get the real file descriptor */
fd = _javanet_get_int_field (env, this, "native_fd");
@@ -1336,12 +1296,11 @@ _javanet_get_option (JNIEnv * env, jobject this, jint option_id)
{
/* TCP_NODELAY case. Return a Boolean indicating on or off */
case SOCKOPT_TCP_NODELAY:
- TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_TCP_NODELAY (fd, optval,
- result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getSocketTCPNoDelay (env, fd, &optval);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, SOCKET_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return (0);
}
@@ -1355,17 +1314,17 @@ _javanet_get_option (JNIEnv * env, jobject this, jint option_id)
/* SO_LINGER case. If disabled, return a Boolean object that represents
false, else return an Integer that is the value of SO_LINGER */
case SOCKOPT_SO_LINGER:
- TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_LINGER (fd, flag, optval,
- result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getLinger (env, fd, &flag, &optval);
+
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, SOCKET_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return (0);
}
- if (optval)
- return (_javanet_create_integer (env, JNI_TRUE));
+ if (flag)
+ return (_javanet_create_integer (env, optval));
else
return (_javanet_create_boolean (env, JNI_FALSE));
@@ -1373,34 +1332,27 @@ _javanet_get_option (JNIEnv * env, jobject this, jint option_id)
/* SO_TIMEOUT case. Return an Integer object with the timeout value */
case SOCKOPT_SO_TIMEOUT:
-#ifdef SO_TIMEOUT
- TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_TIMEOUT (fd, optval, result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getSocketTimeout (env, fd, &optval);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, SOCKET_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return (0);
}
return (_javanet_create_integer (env, optval));
-#else
- JCL_ThrowException (env, SOCKET_EXCEPTION,
- "SO_TIMEOUT not supported on this platform");
- return (0);
-#endif /* not SO_TIMEOUT */
break;
case SOCKOPT_SO_SNDBUF:
case SOCKOPT_SO_RCVBUF:
if (option_id == SOCKOPT_SO_SNDBUF)
- TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_SNDBUF (fd, optval,
- result);
+ result = cpnet_getSendBuf (env, fd, &optval);
else
- TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_RCDBUF (fd, optval,
- result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getRecvBuf (env, fd, &optval);
+
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, SOCKET_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return (0);
}
@@ -1409,11 +1361,11 @@ _javanet_get_option (JNIEnv * env, jobject this, jint option_id)
/* The TTL case. Return an Integer with the Time to Live value */
case SOCKOPT_IP_TTL:
- TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_IP_TTL (fd, optval, result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getTTL (env, fd, &optval);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, SOCKET_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return (0);
}
@@ -1422,61 +1374,64 @@ _javanet_get_option (JNIEnv * env, jobject this, jint option_id)
/* Multicast interface case */
case SOCKOPT_IP_MULTICAST_IF:
- TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_IP_MULTICAST_IF (fd, address,
- result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getMulticastIF (env, fd, &address);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, SOCKET_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return (0);
}
- return (_javanet_create_inetaddress (env, address));
+ obj = _javanet_create_inetaddress (env, address);
+ cpnet_freeAddress (env, address);
+
+ return obj;
break;
case SOCKOPT_SO_BINDADDR:
- TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_BIND_ADDRESS (fd, address,
- result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getLocalAddr (env, fd, &address);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, SOCKET_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return (0);
}
- return (_javanet_create_inetaddress (env, address));
+ obj = _javanet_create_inetaddress (env, address);
+ cpnet_freeAddress (env, address);
+
+ return obj;
break;
case SOCKOPT_SO_REUSEADDR:
- TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_REUSE_ADDRESS (fd, optval,
- result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getReuseAddress (env, fd, &optval);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, SOCKET_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return (0);
}
if (optval)
- return (_javanet_create_boolean (env, JNI_TRUE));
+ return _javanet_create_boolean (env, JNI_TRUE);
else
- return (_javanet_create_boolean (env, JNI_FALSE));
+ return _javanet_create_boolean (env, JNI_FALSE);
break;
case SOCKOPT_SO_KEEPALIVE:
- TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_KEEP_ALIVE (fd, optval, result);
- if (result != TARGET_NATIVE_OK)
+ result = cpnet_getKeepAlive (env, fd, &optval);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, SOCKET_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
+ cpnative_getErrorString (result));
return (0);
}
if (optval)
- return (_javanet_create_boolean (env, JNI_TRUE));
+ return _javanet_create_boolean (env, JNI_TRUE);
else
- return (_javanet_create_boolean (env, JNI_FALSE));
+ return _javanet_create_boolean (env, JNI_FALSE);
break;
@@ -1493,6 +1448,7 @@ _javanet_get_option (JNIEnv * env, jobject this, jint option_id)
void
_javanet_shutdownInput (JNIEnv * env, jobject this)
{
+ int result;
int fd;
/* Get the real file descriptor. */
@@ -1505,10 +1461,11 @@ _javanet_shutdownInput (JNIEnv * env, jobject this)
}
/* Shutdown input stream of socket. */
- if (shutdown (fd, SHUT_RD) == -1)
+ result = cpnet_shutdown (env, fd, CPNET_SHUTDOWN_READ);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, SOCKET_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING());
+ cpnative_getErrorString (result));
return;
}
}
@@ -1517,6 +1474,7 @@ void
_javanet_shutdownOutput (JNIEnv * env, jobject this)
{
int fd;
+ int result;
/* Get the real file descriptor. */
fd = _javanet_get_int_field (env, this, "native_fd");
@@ -1528,10 +1486,11 @@ _javanet_shutdownOutput (JNIEnv * env, jobject this)
}
/* Shutdown output stream of socket. */
- if (shutdown (fd, SHUT_WR) == -1)
+ result = cpnet_shutdown (env, fd, CPNET_SHUTDOWN_WRITE);
+ if (result != CPNATIVE_OK)
{
JCL_ThrowException (env, SOCKET_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING());
+ cpnative_getErrorString (result));
return;
}
}
diff --git a/libjava/classpath/native/jni/java-net/javanet.h b/libjava/classpath/native/jni/java-net/javanet.h
index 030d41282ba..96dba881b54 100644
--- a/libjava/classpath/native/jni/java-net/javanet.h
+++ b/libjava/classpath/native/jni/java-net/javanet.h
@@ -41,6 +41,7 @@ exception statement from your version. */
#include <jni.h>
#include "jcl.h"
+#include "cpnet.h"
/*************************************************************************/
@@ -54,6 +55,7 @@ exception statement from your version. */
#define CONNECT_EXCEPTION "java/net/ConnectException"
#define SOCKET_EXCEPTION "java/net/SocketException"
#define UNKNOWN_HOST_EXCEPTION "java/net/UnknownHostException"
+#define NULL_EXCEPTION "java/lang/NullPointerException"
/* Socket Option Identifiers - Don't change or binary compatibility with
the JDK will be broken! These also need to
@@ -78,15 +80,16 @@ exception statement from your version. */
*/
extern int _javanet_get_int_field(JNIEnv *, jobject, const char *);
-extern int _javanet_get_netaddr(JNIEnv *, jobject);
+extern cpnet_address *_javanet_get_ip_netaddr(JNIEnv *, jobject);
+extern jobject _javanet_create_inetaddress (JNIEnv *, cpnet_address *);
extern void _javanet_create(JNIEnv *, jobject, jboolean);
extern void _javanet_close(JNIEnv *, jobject, int);
extern void _javanet_connect(JNIEnv *, jobject, jobject, jint, jboolean);
extern void _javanet_bind(JNIEnv *, jobject, jobject, jint, int);
extern void _javanet_listen(JNIEnv *, jobject, jint);
extern void _javanet_accept(JNIEnv *, jobject, jobject);
-extern int _javanet_recvfrom(JNIEnv *, jobject, jarray, int, int, int *, int *);
-extern void _javanet_sendto(JNIEnv *, jobject, jarray, int, int, int, int);
+extern int _javanet_recvfrom(JNIEnv *, jobject, jarray, int, int, cpnet_address **);
+extern void _javanet_sendto(JNIEnv *, jobject, jarray, int, int, cpnet_address *);
extern jobject _javanet_get_option(JNIEnv *, jobject, jint);
extern void _javanet_set_option(JNIEnv *, jobject, jint, jobject);
extern void _javanet_shutdownInput (JNIEnv *, jobject);
diff --git a/libjava/classpath/native/jni/java-net/local.c b/libjava/classpath/native/jni/java-net/local.c
index cdddd89efc3..c8ca91c2ab5 100644
--- a/libjava/classpath/native/jni/java-net/local.c
+++ b/libjava/classpath/native/jni/java-net/local.c
@@ -36,9 +36,7 @@ obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif /* HAVE_CONFIG_H */
#ifdef ENABLE_LOCAL_SOCKETS
diff --git a/libjava/classpath/native/jni/java-nio/.cvsignore b/libjava/classpath/native/jni/java-nio/.cvsignore
new file mode 100644
index 00000000000..e9f2658a694
--- /dev/null
+++ b/libjava/classpath/native/jni/java-nio/.cvsignore
@@ -0,0 +1,8 @@
+*.o
+*.a
+*.lo
+*.la
+.libs
+.deps
+Makefile
+Makefile.in
diff --git a/libjava/classpath/native/jni/java-nio/Makefile.am b/libjava/classpath/native/jni/java-nio/Makefile.am
index c3f6caf6209..9f2db83f20f 100644
--- a/libjava/classpath/native/jni/java-nio/Makefile.am
+++ b/libjava/classpath/native/jni/java-nio/Makefile.am
@@ -3,15 +3,21 @@ nativeexeclib_LTLIBRARIES = libjavanio.la
libjavanio_la_SOURCES = gnu_java_nio_VMPipe.c \
gnu_java_nio_VMChannel.c \
gnu_java_nio_VMSelector.c \
- gnu_java_nio_channels_FileChannelImpl.c \
gnu_java_nio_charset_iconv_IconvDecoder.c \
gnu_java_nio_charset_iconv_IconvEncoder.c \
java_nio_MappedByteBufferImpl.c \
- java_nio_VMDirectByteBuffer.c
+ java_nio_VMDirectByteBuffer.c \
+ gnu_java_nio_EpollSelectorImpl.c \
+ gnu_java_nio_KqueueSelectorImpl.c \
+ javanio.h
libjavanio_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo \
+ $(top_builddir)/native/jni/native-lib/libclasspathnative.la \
$(LTLIBICONV)
+# Directly included through javanio.h
+EXTRA_DIST = javanio.c
+
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
diff --git a/libjava/classpath/native/jni/java-nio/Makefile.in b/libjava/classpath/native/jni/java-nio/Makefile.in
index bb3a5833946..147455caf85 100644
--- a/libjava/classpath/native/jni/java-nio/Makefile.in
+++ b/libjava/classpath/native/jni/java-nio/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -65,14 +67,16 @@ LTLIBRARIES = $(nativeexeclib_LTLIBRARIES)
am__DEPENDENCIES_1 =
libjavanio_la_DEPENDENCIES = \
$(top_builddir)/native/jni/classpath/jcl.lo \
+ $(top_builddir)/native/jni/native-lib/libclasspathnative.la \
$(am__DEPENDENCIES_1)
am_libjavanio_la_OBJECTS = gnu_java_nio_VMPipe.lo \
gnu_java_nio_VMChannel.lo gnu_java_nio_VMSelector.lo \
- gnu_java_nio_channels_FileChannelImpl.lo \
gnu_java_nio_charset_iconv_IconvDecoder.lo \
gnu_java_nio_charset_iconv_IconvEncoder.lo \
java_nio_MappedByteBufferImpl.lo \
- java_nio_VMDirectByteBuffer.lo
+ java_nio_VMDirectByteBuffer.lo \
+ gnu_java_nio_EpollSelectorImpl.lo \
+ gnu_java_nio_KqueueSelectorImpl.lo
libjavanio_la_OBJECTS = $(am_libjavanio_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -192,6 +196,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -313,21 +319,26 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
nativeexeclib_LTLIBRARIES = libjavanio.la
libjavanio_la_SOURCES = gnu_java_nio_VMPipe.c \
gnu_java_nio_VMChannel.c \
gnu_java_nio_VMSelector.c \
- gnu_java_nio_channels_FileChannelImpl.c \
gnu_java_nio_charset_iconv_IconvDecoder.c \
gnu_java_nio_charset_iconv_IconvEncoder.c \
java_nio_MappedByteBufferImpl.c \
- java_nio_VMDirectByteBuffer.c
+ java_nio_VMDirectByteBuffer.c \
+ gnu_java_nio_EpollSelectorImpl.c \
+ gnu_java_nio_KqueueSelectorImpl.c \
+ javanio.h
libjavanio_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo \
+ $(top_builddir)/native/jni/native-lib/libclasspathnative.la \
$(LTLIBICONV)
+
+# Directly included through javanio.h
+EXTRA_DIST = javanio.c
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
@@ -400,10 +411,11 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_nio_EpollSelectorImpl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_nio_KqueueSelectorImpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_nio_VMChannel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_nio_VMPipe.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_nio_VMSelector.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_nio_channels_FileChannelImpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_nio_charset_iconv_IconvDecoder.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_nio_charset_iconv_IconvEncoder.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_nio_MappedByteBufferImpl.Plo@am__quote@
diff --git a/libjava/classpath/native/jni/java-nio/gnu_java_nio_EpollSelectorImpl.c b/libjava/classpath/native/jni/java-nio/gnu_java_nio_EpollSelectorImpl.c
new file mode 100644
index 00000000000..d794e6d9fea
--- /dev/null
+++ b/libjava/classpath/native/jni/java-nio/gnu_java_nio_EpollSelectorImpl.c
@@ -0,0 +1,414 @@
+/* gnu_java_nio_EpollSelectorImpl.c --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#ifdef HAVE_SYS_EPOLL_H
+#include <sys/epoll.h>
+#endif /* HAVE_SYS_EPOLL_H */
+
+#include <gnu_java_nio_EpollSelectorImpl.h>
+#include <jcl.h>
+#include <errno.h>
+#include <string.h>
+
+#define IO_EXCEPTION "java/io/IOException"
+
+/* #define TRACE_EPOLL 1 */
+
+
+/*
+ * Class: gnu_java_nio_EpollSelectorImpl
+ * Method: epoll_supported
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_gnu_java_nio_EpollSelectorImpl_epoll_1supported (JNIEnv *e __attribute__((unused)),
+ jclass c __attribute__((unused)))
+{
+#ifdef HAVE_EPOLL_CREATE
+ return JNI_TRUE;
+#else
+ return JNI_FALSE;
+#endif /* HAVE_EPOLL_CREATE */
+}
+
+/*
+ * Class: gnu_java_nio_EpollSelectorImpl
+ * Method: sizeof_struct
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_EpollSelectorImpl_sizeof_1struct (JNIEnv *env,
+ jclass c __attribute__((unused)))
+{
+#ifdef HAVE_EPOLL_CREATE
+ (void) env;
+#ifdef TRACE_EPOLL
+ fprintf (stderr, "%s: sizeof is %d\n", __FUNCTION__, sizeof (struct epoll_event));
+#endif /* TRACE_EPOLL */
+ return sizeof (struct epoll_event);
+#else
+ JCL_ThrowException (env, "java/lang/InternalError", "epoll support not available");
+ return -1;
+#endif /* HAVE_EPOLL_CREATE */
+}
+
+/*
+ * Class: gnu_java_nio_EpollSelectorImpl
+ * Method: epoll_create
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_EpollSelectorImpl_epoll_1create (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint size)
+{
+#ifdef HAVE_EPOLL_CREATE
+ int fd = epoll_create (size);
+
+#ifdef TRACE_EPOLL
+ fprintf (stderr, "%s: epoll_create returns %d\n", __FUNCTION__, fd);
+#endif /* TRACE_EPOLL */
+
+ if (fd == -1)
+ {
+ if (ENOSYS == errno)
+ JCL_ThrowException (env, "java/lang/InternalError",
+ strerror (errno));
+ else
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ }
+ return fd;
+#else
+ (void) size;
+ JCL_ThrowException (env, "java/lang/InternalError", "epoll support not available");
+ return -1;
+#endif /* HAVE_EPOLL_CREATE */
+}
+
+/*
+ * Class: gnu_java_nio_EpollSelectorImpl
+ * Method: epoll_add
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_nio_EpollSelectorImpl_epoll_1add (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint efd, jint fd, jint ops)
+{
+#ifdef HAVE_EPOLL_CREATE
+ struct epoll_event event;
+
+ memset (&event, 0, sizeof (struct epoll_event));
+
+ if ((ops & gnu_java_nio_EpollSelectorImpl_OP_ACCEPT) != 0
+ || (ops & gnu_java_nio_EpollSelectorImpl_OP_READ) != 0)
+ event.events = EPOLLIN;
+
+ if ((ops & gnu_java_nio_EpollSelectorImpl_OP_CONNECT) != 0
+ || (ops & gnu_java_nio_EpollSelectorImpl_OP_WRITE) != 0)
+ event.events |= EPOLLOUT;
+
+ event.data.fd = fd;
+
+#ifdef TRACE_EPOLL
+ fprintf (stderr, "%s: adding struct epoll_event { events: %o; data.fd: %d } to %d\n",
+ __FUNCTION__, event.events, event.data.fd, efd);
+#endif /* TRACE_EPOLL */
+
+ if (epoll_ctl (efd, EPOLL_CTL_ADD, fd, &event) == -1)
+ {
+ if (ENOSYS == errno)
+ JCL_ThrowException (env, "java/lang/InternalError",
+ strerror (errno));
+ else
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ }
+#else
+ (void) efd;
+ (void) fd;
+ (void) ops;
+ JCL_ThrowException (env, "java/lang/InternalError", "epoll support not available");
+#endif /* HAVE_EPOLL_CREATE */
+}
+
+
+/*
+ * Class: gnu_java_nio_EpollSelectorImpl
+ * Method: epoll_modify
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_nio_EpollSelectorImpl_epoll_1modify (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint efd, jint fd, jint ops)
+{
+#ifdef HAVE_EPOLL_CREATE
+ struct epoll_event event;
+
+ memset (&event, 0, sizeof (struct epoll_event));
+
+ if ((ops & gnu_java_nio_EpollSelectorImpl_OP_ACCEPT) != 0
+ || (ops & gnu_java_nio_EpollSelectorImpl_OP_READ) != 0)
+ event.events = EPOLLIN;
+
+ if ((ops & gnu_java_nio_EpollSelectorImpl_OP_CONNECT) != 0
+ || (ops & gnu_java_nio_EpollSelectorImpl_OP_WRITE) != 0)
+ event.events |= EPOLLOUT;
+
+ event.data.fd = fd;
+
+#ifdef TRACE_EPOLL
+ fprintf (stderr, "%s: modding struct epoll_event { events: %o; data.fd: %d } on %d\n",
+ __FUNCTION__, event.events, event.data.fd, efd);
+#endif /* TRACE_EPOLL */
+
+ if (epoll_ctl (efd, EPOLL_CTL_MOD, fd, &event) == -1)
+ {
+ if (ENOSYS == errno)
+ JCL_ThrowException (env, "java/lang/InternalError",
+ strerror (errno));
+ else
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ }
+#else
+ (void) efd;
+ (void) fd;
+ (void) ops;
+ JCL_ThrowException (env, "java/lang/InternalError", "epoll support not available");
+#endif /* HAVE_EPOLL_CREATE */
+}
+
+
+/*
+ * Class: gnu_java_nio_EpollSelectorImpl
+ * Method: epoll_delete
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_nio_EpollSelectorImpl_epoll_1delete (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint efd, jint fd)
+{
+#ifdef HAVE_EPOLL_CREATE
+ struct epoll_event event;
+
+ memset (&event, 0, sizeof (struct epoll_event));
+ event.data.fd = fd;
+
+#ifdef TRACE_EPOLL
+ fprintf (stderr, "%s: delete events on fd %d for %d\n", __FUNCTION__, fd, efd);
+#endif /* TRACE_EPOLL */
+
+ /* Older kernel versions require a non-null `event' parameter,
+ * even though it is ignored by this call.
+ */
+ if (epoll_ctl (efd, EPOLL_CTL_DEL, fd, &event) == -1)
+ {
+ if (ENOSYS == errno)
+ JCL_ThrowException (env, "java/lang/InternalError",
+ strerror (errno));
+ /* XXX the docs here seem a little strange. If `fd' is closed,
+ epoll_ctl returns EBADF; but the docs say that this happens
+ only when efd is invalid. Go figure.
+ */
+ else if (ENOENT == errno || EBADF == errno)
+ return; /* fd is closed; it's already removed. */
+ else
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ }
+#else
+ (void) efd;
+ (void) fd;
+ JCL_ThrowException (env, "java/lang/InternalError", "epoll support not available");
+#endif /* HAVE_EPOLL_CREATE */
+}
+
+/*
+ * Class: gnu_java_nio_EpollSelectorImpl
+ * Method: epoll_wait
+ * Signature: (ILjava/nio/ByteBuffer;II)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_EpollSelectorImpl_epoll_1wait (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint efd, jobject nstate,
+ jint num_events, jint timeout)
+{
+#ifdef HAVE_EPOLL_CREATE
+ void *p = (*env)->GetDirectBufferAddress (env, nstate);
+ struct epoll_event *events = (struct epoll_event *) p;
+ int ret;
+
+ if (p == NULL)
+ {
+ if (!(*env)->ExceptionCheck (env))
+ JCL_ThrowException (env, IO_EXCEPTION, "getting native state failed");
+ return -1;
+ }
+
+#ifdef TRACE_EPOLL
+ fprintf (stderr, "%s: events: %p; num_events: %d; timeout: %d; efd: %d\n",
+ __FUNCTION__, p, num_events, timeout, efd);
+#endif /* TRACE_EPOLL */
+
+ ret = epoll_wait (efd, events, num_events, timeout);
+
+ if (ret == -1)
+ {
+ if (ENOSYS == errno)
+ JCL_ThrowException (env, "java/lang/InternalError",
+ strerror (errno));
+ else if (EINTR == errno)
+ ret = 0;
+ else
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ }
+
+#ifdef TRACE_EPOLL
+ fprintf (stderr, " epoll_wait returns %d\n", ret);
+ {
+ int i;
+ for (i = 0; i < ret; i++)
+ {
+ fprintf (stderr, " [%4i]: events: %o; data.fd: %d\n", i, events[i].events,
+ events[i].data.fd);
+ }
+ }
+ fflush (stderr);
+#endif /* TRACE_EPOLL */
+
+ return ret;
+#else
+ (void) efd;
+ (void) nstate;
+ (void) num_events;
+ (void) timeout;
+ JCL_ThrowException (env, "java/lang/InternalError", "epoll support not available");
+ return -1;
+#endif /* HAVE_EPOLL_CREATE */
+}
+
+
+/*
+ * Class: gnu_java_nio_EpollSelectorImpl
+ * Method: selected_fd
+ * Signature: (Ljava/nio/ByteBuffer;)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_EpollSelectorImpl_selected_1fd (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jobject value)
+{
+#ifdef HAVE_EPOLL_CREATE
+ void *p = (*env)->GetDirectBufferAddress (env, value);
+ struct epoll_event *event = (struct epoll_event *) p;
+
+#ifdef TRACE_EPOLL
+ fprintf (stderr, "%s: event: %p\n", __FUNCTION__, p);
+#endif /* TRACE_EPOLL */
+
+ if (p == NULL)
+ {
+ if (!(*env)->ExceptionCheck (env))
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "getting native state failed");
+ return -1;
+ }
+
+#ifdef TRACE_EPOLL
+ fprintf (stderr, " data.fd: %d\n", event->data.fd);
+ fflush (stderr);
+#endif /* TRACE_EPOLL */
+
+ return event->data.fd;
+#else
+ (void) value;
+ JCL_ThrowException (env, "java/lang/InternalError", "epoll support not available");
+ return -1;
+#endif /* HAVE_EPOLL_CREATE */
+}
+
+
+/*
+ * Class: gnu_java_nio_EpollSelectorImpl
+ * Method: selected_ops
+ * Signature: (Ljava/nio/ByteBuffer;)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_EpollSelectorImpl_selected_1ops (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jobject value)
+{
+#ifdef HAVE_EPOLL_CREATE
+ void *p = (*env)->GetDirectBufferAddress (env, value);
+ struct epoll_event *event = (struct epoll_event *) p;
+ int ret = 0;
+
+#ifdef TRACE_EPOLL
+ fprintf (stderr, "%s: event: %p\n", __FUNCTION__, p);
+#endif /* TRACE_EPOLL */
+
+ if (p == NULL)
+ {
+ if (!(*env)->ExceptionCheck (env))
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "getting native state failed");
+ return -1;
+ }
+
+ if ((event->events & EPOLLIN) != 0)
+ ret |= gnu_java_nio_EpollSelectorImpl_OP_ACCEPT | gnu_java_nio_EpollSelectorImpl_OP_READ;
+ if ((event->events & EPOLLOUT) != 0)
+ ret |= gnu_java_nio_EpollSelectorImpl_OP_CONNECT | gnu_java_nio_EpollSelectorImpl_OP_WRITE;
+
+#ifdef TRACE_EPOLL
+ fprintf (stderr, " events: %o\n", event->events);
+ fflush (stderr);
+#endif /* TRACE_EPOLL */
+
+ return ret;
+#else
+ (void) value;
+ JCL_ThrowException (env, "java/lang/InternalError", "epoll support not available");
+ return -1;
+#endif /* HAVE_EPOLL_CREATE */
+}
diff --git a/libjava/classpath/native/jni/java-nio/gnu_java_nio_KqueueSelectorImpl.c b/libjava/classpath/native/jni/java-nio/gnu_java_nio_KqueueSelectorImpl.c
new file mode 100644
index 00000000000..94e6db7f88e
--- /dev/null
+++ b/libjava/classpath/native/jni/java-nio/gnu_java_nio_KqueueSelectorImpl.c
@@ -0,0 +1,387 @@
+/* gnu_java_nio_channel_KqueueSelectorImpl.c --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#include <sys/types.h>
+#if HAVE_SYS_EVENT_H
+#include <sys/event.h>
+#endif /* HAVE_SYS_EVENT_H */
+#include <sys/time.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <jni.h>
+#include <gnu_java_nio_KqueueSelectorImpl.h>
+
+#include <jcl.h>
+
+#define KEY_OP_ACCEPT 16
+#define KEY_OP_CONNECT 8
+#define KEY_OP_READ 1
+#define KEY_OP_WRITE 4
+
+/* XXX this requires -std=gnu99 or c99 */
+/* #ifdef TRACE_KQUEUE */
+/* #define TRACE(fmt, ...) fprintf (stderr, "%s: " fmt "\n", __FUNCTION__, __VA_ARGS__); */
+/* #else */
+/* #define TRACE(fmt, ...) */
+/* #endif */
+
+/* #define TRACE_KQUEUE 1 */
+
+
+#define throw_not_supported(env) JCL_ThrowException (env, "java/lang/UnsupportedOperationException", "kqueue/kevent support not available")
+
+
+/*
+ * Class: gnu_java_nio_KqueueSelectorImpl
+ * Method: kqueue_supported
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_gnu_java_nio_KqueueSelectorImpl_kqueue_1supported (JNIEnv *env __attribute__((unused)),
+ jclass clazz __attribute__((unused)))
+{
+#if defined(HAVE_KQUEUE) && defined(HAVE_KEVENT)
+ return JNI_TRUE;
+#else
+ return JNI_FALSE;
+#endif /* HAVE_KQUEUE && HAVE_KEVENT */
+}
+
+
+/*
+ * Class: gnu_java_nio_KqueueSelectorImpl
+ * Method: sizeof_struct_kevent
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_KqueueSelectorImpl_sizeof_1struct_1kevent
+(JNIEnv *env __attribute__((unused)), jclass clazz __attribute__((unused)))
+{
+#if defined(HAVE_KQUEUE) && defined(HAVE_KEVENT)
+/* TRACE("return sizeof %lu", sizeof (struct kevent)); */
+ return sizeof (struct kevent);
+#else
+ throw_not_supported (env);
+ return -1;
+#endif /* HAVE_KQUEUE && HAVE_KEVENT */
+}
+
+
+/*
+ * Class: gnu_java_nio_KqueueSelectorImpl
+ * Method: implOpen
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_KqueueSelectorImpl_implOpen
+(JNIEnv *env, jclass clazz __attribute__((unused)))
+{
+#if defined(HAVE_KQUEUE) && defined(HAVE_KEVENT)
+ int kq = kqueue ();
+/* TRACE("kqueue returns %d", kq); */
+ if (kq == -1)
+ JCL_ThrowException (env, "java/io/IOException", strerror (errno));
+ return kq;
+#else
+ throw_not_supported (env);
+ return -1;
+#endif
+}
+
+
+/*
+ * Class: gnu_java_nio_KqueueSelectorImpl
+ * Method: implClose
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_nio_KqueueSelectorImpl_implClose (JNIEnv *env,
+ jclass clazz __attribute__((unused)),
+ jint kq)
+{
+#if defined(HAVE_KQUEUE) && defined(HAVE_KEVENT)
+/* TRACE("closing %d", kq); */
+ if (close (kq) != 0)
+ JCL_ThrowException (env, "java/io/IOException", strerror (errno));
+#else
+ (void) kq;
+ throw_not_supported (env);
+#endif /* HAVE_KQUEUE && HAVE_KEVENT */
+}
+
+
+/*
+ * Class: gnu_java_nio_KqueueSelectorImpl
+ * Method: kevent_set
+ * Signature: (Ljava/nio/ByteBuffer;IIIZ)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_nio_KqueueSelectorImpl_kevent_1set (JNIEnv *env,
+ jclass clazz __attribute__((unused)),
+ jobject nstate, jint i, jint fd,
+ jint ops, jint active, jint key)
+{
+#if defined(HAVE_KQUEUE) && defined(HAVE_KEVENT)
+ struct kevent *kev;
+ short ident;
+
+ kev = (struct kevent *) (*env)->GetDirectBufferAddress (env, nstate);
+
+#ifdef TRACE_KQUEUE
+ printf ("kevent_set fd:%d p:%p i:%d ops:%x active:%x key:%x\n",
+ fd, (void *) kev, i, ops, active, key);
+#endif /* TRACE_KQUEUE */
+
+ if (kev == NULL)
+ {
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "GetDirectBufferAddress returned NULL!");
+ return;
+ }
+
+ ident = fd;
+ memset (&kev[i], 0, sizeof (struct kevent));
+
+ if ((ops & KEY_OP_READ) || (ops & KEY_OP_ACCEPT))
+ {
+ /* Add event if it wasn't previously added. */
+ if (!(active & KEY_OP_READ) && !(active & KEY_OP_ACCEPT))
+ EV_SET(&kev[i], ident, EVFILT_READ, EV_ADD, 0, 0, (void *) key);
+ }
+ else
+ {
+ /* Delete event if it was previously added */
+ if ((active & KEY_OP_READ) || (active & KEY_OP_ACCEPT))
+ EV_SET(&kev[i], ident, EVFILT_READ, EV_DELETE, 0, 0, (void *) key);
+ }
+
+ /* Do the same thing for the write filter. */
+ if ((ops & KEY_OP_WRITE) || (ops & KEY_OP_CONNECT))
+ {
+ if (!(active & KEY_OP_WRITE) && !(active & KEY_OP_CONNECT))
+ EV_SET(&kev[i], ident, EVFILT_WRITE, EV_ADD, 0, 0, (void *) key);
+ }
+ else
+ {
+ if ((active & KEY_OP_WRITE) || (active & KEY_OP_CONNECT))
+ EV_SET(&kev[i], ident, EVFILT_WRITE, EV_DELETE, 0, 0, (void *) key);
+ }
+
+#ifdef TRACE_KQUEUE
+ printf (" set kevent %2d: ident:%u filter:%x flags:%o fflags:%o data:%p udata:%p\n",
+ i, (unsigned) kev[i].ident, kev[i].filter, kev[i].flags, kev[i].fflags,
+ (void *) kev[i].data, kev[i].udata);
+#endif /* TRACE_KQUEUE */
+#else
+ (void) nstate;
+ (void) i;
+ (void) fd;
+ (void) ops;
+ (void) key;
+ (void) active;
+ throw_not_supported (env);
+#endif /* HAVE_KQUEUE && HAVE_KEVENT */
+}
+
+
+/*
+ * Class: gnu_java_nio_KqueueSelectorImpl
+ * Method: kevent
+ * Signature: (ILjava/nio/ByteBuffer;IJ)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_KqueueSelectorImpl_kevent (JNIEnv *env,
+ jobject this __attribute__((unused)),
+ jint kq, jobject nstate, jint nevents,
+ jint maxevents, jlong timeout)
+{
+#if defined(HAVE_KQUEUE) && defined(HAVE_KEVENT)
+ struct timespec tv;
+ struct timespec *t = NULL;
+ struct kevent *kev = (struct kevent *) (*env)->GetDirectBufferAddress (env, nstate);
+ int ret;
+
+#ifdef TRACE_KQUEUE
+ int i;
+
+ printf ("[%d] kevent nevents:%d maxevents:%d timeout:%lld\n", kq, nevents, maxevents, timeout);
+ printf ("[%d] addding/deleting %d events\n", kq, nevents);
+ for (i = 0; i < nevents; i++)
+ {
+ printf ("[%d] kevent input [%d]: ident:%u filter:%x flags:%o fflags:%o data:%p udata:%p\n",
+ kq, i, (unsigned) kev[i].ident, kev[i].filter, kev[i].flags, kev[i].fflags,
+ (void *) kev[i].data, kev[i].udata);
+ }
+#endif
+
+/* TRACE("events: %p; nevents: %d; timeout: %lld", (void *) kev, nevents, timeout); */
+
+ if (timeout != -1)
+ {
+ tv.tv_sec = timeout / 1000;
+ tv.tv_nsec = (timeout % 1000) * 1000;
+ t = &tv;
+ }
+
+ ret = kevent (kq, (const struct kevent *) kev, nevents, kev, maxevents, t);
+
+ if (ret == -1)
+ {
+ if (errno == EINTR)
+ ret = 0;
+ else
+ JCL_ThrowException (env, "java/io/IOException", strerror (errno));
+ }
+
+#ifdef TRACE_KQUEUE
+ for (i = 0; i < ret; i++)
+ {
+ printf ("[%d] kevent output [%d]: ident:%u filter:%x flags:%o fflags:%o data:%p udata:%p\n",
+ kq, i, (unsigned) kev[i].ident, kev[i].filter, kev[i].flags, kev[i].fflags,
+ (void *) kev[i].data, kev[i].udata);
+ }
+#endif
+
+ return ret;
+#else
+ (void) kq;
+ (void) nstate;
+ (void) nevents;
+ (void) maxevents;
+ (void) timeout;
+ throw_not_supported (env);
+ return -1;
+#endif /* HAVE_KQUEUE && HAVE_KEVENT */
+}
+
+
+/*
+ * Class: gnu_java_nio_KqueueSelectorImpl
+ * Method: fetch_key
+ * Signature: (Ljava/nio/ByteBuffer;)I;
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_KqueueSelectorImpl_fetch_1key (JNIEnv *env,
+ jclass clazz __attribute__((unused)),
+ jobject nstate)
+{
+#if defined(HAVE_KQUEUE) && defined(HAVE_KEVENT)
+ struct kevent *kev = (struct kevent *) (*env)->GetDirectBufferAddress (env, nstate);
+/* TRACE("return key %p\n", kev->udata); */
+ return (jint) kev->udata;
+#else
+ (void) nstate;
+ throw_not_supported (env);
+ return -1;
+#endif /* HAVE_KQUEUE && HAVE_KEVENT */
+}
+
+
+/*
+ * Class: gnu_java_nio_KqueueSelectorImpl
+ * Method: ready_ops
+ * Signature: (Ljava/nio/ByteBuffer;I)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_KqueueSelectorImpl_ready_1ops (JNIEnv *env,
+ jclass clazz __attribute__((unused)),
+ jobject nstate, jint interest)
+{
+#if defined(HAVE_KQUEUE) && defined(HAVE_KEVENT)
+ struct kevent *kev = (struct kevent *) (*env)->GetDirectBufferAddress (env, nstate);
+ jint ready = 0;
+
+ if ((kev->flags & EV_ERROR) == EV_ERROR)
+ {
+ printf ("!!! error selecting fd %d: %s", (int) (kev->ident), strerror ((int) (kev->data)));
+ return 0;
+ }
+
+ /* We poll for READ for OP_READ and OP_ACCEPT. */
+ if (kev->filter == EVFILT_READ)
+ {
+ ready = (interest & KEY_OP_READ) | (interest & KEY_OP_ACCEPT);
+/* TRACE("filter EVFILT_READ. Ready ops set to %x", ready); */
+ }
+
+ /* Poll for WRITE for OP_WRITE and OP_CONNECT; I guess we *should*
+ get a WRITE event if we are connected, but I don't know if we do
+ for real. FIXME */
+ if (kev->filter == EVFILT_WRITE)
+ {
+ ready = (interest & KEY_OP_WRITE) | (interest & KEY_OP_CONNECT);
+/* TRACE("filter EVFILT_WRITE. Ready ops set to %x", ready); */
+ }
+
+ return ready;
+#else
+ (void) nstate;
+ (void) interest;
+ throw_not_supported (env);
+ return -1;
+#endif /* HAVE_KQUEUE && HAVE_KEVENT */
+}
+
+
+/*
+ * Class: gnu_java_nio_KqueueSelectorImpl
+ * Method: check_eof
+ * Signature: (Ljava/nio/ByteBuffer;)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_gnu_java_nio_KqueueSelectorImpl_check_1eof (JNIEnv *env,
+ jclass clazz __attribute__((unused)),
+ jobject nstate)
+{
+#if defined(HAVE_KQUEUE) && defined(HAVE_KEVENT)
+ struct kevent *kev = (struct kevent *) (*env)->GetDirectBufferAddress (env, nstate);
+ if ((kev->flags & EV_EOF) == EV_EOF)
+ return JNI_TRUE;
+ return JNI_FALSE;
+#else
+ (void) nstate;
+ throw_not_supported (env);
+ return JNI_FALSE;
+#endif
+}
diff --git a/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMChannel.c b/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMChannel.c
index 5571bed27a5..97eb38618c3 100644
--- a/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMChannel.c
+++ b/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMChannel.c
@@ -36,25 +36,48 @@ obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
+#include <config-int.h>
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/uio.h>
+
+#include <netinet/in.h>
+
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
-#include <sys/uio.h>
#include <string.h>
#include <jni.h>
#include <jcl.h>
+#include "cpio.h"
#include "gnu_java_nio_VMChannel.h"
+#include "javanio.h"
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif /* HAVE_FCNTL_H */
+#define CONNECT_EXCEPTION "java/net/ConnectException"
#define IO_EXCEPTION "java/io/IOException"
+#define SOCKET_EXCEPTION "java/net/SocketException"
+#define INTERRUPTED_IO_EXCEPTION "java/io/InterruptedIOException"
#define NON_READABLE_CHANNEL_EXCEPTION "java/nio/channels/NonReadableChannelException"
#define NON_WRITABLE_CHANNEL_EXCEPTION "java/nio/channels/NonWritableChannelException"
+#define SOCKET_TIMEOUT_EXCEPTION "java/net/SocketTimeoutException"
+
+/* Align a value up or down to a multiple of the pagesize. */
+#define ALIGN_DOWN(p,s) ((p) - ((p) % (s)))
+#define ALIGN_UP(p,s) ((p) + ((s) - ((p) % (s))))
/*
* Limit to maximum of 16 buffers
@@ -66,7 +89,7 @@ extern "C"
{
#endif
-enum JCL_buffer_type { DIRECT, ARRAY, UNKNOWN };
+enum JCL_buffer_type { DIRECT, HEAP, ARRAY, UNKNOWN };
struct JCL_buffer
{
@@ -83,6 +106,7 @@ void JCL_print_buffer(JNIEnv *, struct JCL_buffer *);
int JCL_init_buffer(JNIEnv *, struct JCL_buffer *, jobject);
void JCL_release_buffer(JNIEnv *, struct JCL_buffer *, jobject, jint);
void JCL_cleanup_buffers(JNIEnv *, struct JCL_buffer *, jint, jobjectArray, jint, jlong);
+int JCL_thread_interrupted(JNIEnv *);
static jfieldID address_fid;
static jmethodID get_position_mid;
@@ -92,33 +116,37 @@ static jmethodID set_limit_mid;
static jmethodID has_array_mid;
static jmethodID array_mid;
static jmethodID array_offset_mid;
+static jmethodID thread_interrupted_mid;
+static jclass vm_channel_class;
jmethodID
get_method_id(JNIEnv *env, jclass clazz, const char *name,
const char *sig)
{
jmethodID mid = (*env)->GetMethodID(env, clazz, name, sig);
+/* NIODBG("name: %s; sig: %s", name, sig); */
if (mid == NULL)
{
- JCL_ThrowException(env, "java/lang/InternalError", name);
+ JCL_ThrowException(env, "java/lang/InternalError", name);
return NULL;
}
return mid;
}
-void
+inline void
JCL_print_buffer(JNIEnv *env __attribute__((__unused__)), struct JCL_buffer *buf)
{
- fprintf(stdout, "Buffer - type: %d, ptr: %p\n", buf->type, buf->ptr);
- fflush(stdout);
+ fprintf (stderr, "Buffer - type: %d, ptr: %p\n", buf->type, buf->ptr);
}
int
JCL_init_buffer(JNIEnv *env, struct JCL_buffer *buf, jobject bbuf)
{
- jobject address = (*env)->GetObjectField(env, bbuf, address_fid);
+ void *addr = (*env)->GetDirectBufferAddress (env, bbuf);
+
+/* NIODBG("buf: %p; bbuf: %p; addr: %p", (void *) buf, bbuf, addr); */
buf->position = (*env)->CallIntMethod(env, bbuf, get_position_mid);
buf->limit = (*env)->CallIntMethod(env, bbuf, get_limit_mid);
@@ -126,11 +154,10 @@ JCL_init_buffer(JNIEnv *env, struct JCL_buffer *buf, jobject bbuf)
buf->count = 0;
buf->type = UNKNOWN;
- if (address != NULL)
+ if (addr != NULL)
{
- buf->ptr = (jbyte *) JCL_GetRawData(env, address);
+ buf->ptr = (jbyte *) addr;
buf->type = DIRECT;
- (*env)->DeleteLocalRef(env, address);
}
else
{
@@ -148,7 +175,12 @@ JCL_init_buffer(JNIEnv *env, struct JCL_buffer *buf, jobject bbuf)
}
else
{
- return -1;
+ jobject address = (*env)->GetObjectField (env, bbuf, address_fid);
+ if (address == NULL)
+ return -1; /* XXX handle non-array, non-native buffers? */
+ buf->ptr = (jbyte *) JCL_GetRawData(env, address);
+ buf->type = HEAP;
+ (*env)->DeleteLocalRef(env, address);
}
}
@@ -160,6 +192,8 @@ JCL_release_buffer(JNIEnv *env, struct JCL_buffer *buf, jobject bbuf,
jint action)
{
jbyteArray arr;
+
+/* NIODBG("buf: %p; bbuf: %p; action: %x", (void *) buf, bbuf, action); */
/* Set the position to the appropriate value */
if (buf->count > 0)
@@ -173,6 +207,7 @@ JCL_release_buffer(JNIEnv *env, struct JCL_buffer *buf, jobject bbuf,
switch (buf->type)
{
case DIRECT:
+ case HEAP:
break;
case ARRAY:
arr = (*env)->CallObjectMethod(env, bbuf, array_mid);
@@ -194,6 +229,9 @@ JCL_cleanup_buffers(JNIEnv *env,
jlong num_bytes)
{
jint i;
+
+/* NIODBG("bi_list: %p; vec_len: %d; bbufs: %p; offset: %d; num_bytes: %lld", */
+/* (void *) bi_list, vec_len, bbufs, offset, num_bytes); */
/* Update all of the bbufs with the approriate information */
for (i = 0; i < vec_len; i++)
@@ -217,13 +255,65 @@ JCL_cleanup_buffers(JNIEnv *env,
}
+int
+JCL_thread_interrupted(JNIEnv *env)
+{
+ return (int) (*env)->CallStaticBooleanMethod(env, vm_channel_class,
+ thread_interrupted_mid);
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: stdin_fd
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_VMChannel_stdin_1fd (JNIEnv *env __attribute__((unused)),
+ jclass c __attribute__((unused)))
+{
+/* NIODBG("%d", fileno (stdin)); */
+ return fileno (stdin);
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: stdout_fd
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_VMChannel_stdout_1fd (JNIEnv *env __attribute__((unused)),
+ jclass c __attribute__((unused)))
+{
+/* NIODBG("%d", fileno (stdout)); */
+ return fileno (stdout);
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: stderr_fd
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_VMChannel_stderr_1fd (JNIEnv *env __attribute__((unused)),
+ jclass c __attribute__((unused)))
+{
+/* NIODBG("%d", fileno (stderr)); */
+ return fileno (stderr);
+}
+
+
JNIEXPORT void JNICALL
Java_gnu_java_nio_VMChannel_initIDs (JNIEnv *env,
- jclass clazz __attribute__ ((__unused__)))
+ jclass clazz)
{
jclass bufferClass = JCL_FindClass(env, "java/nio/Buffer");
jclass byteBufferClass = JCL_FindClass(env, "java/nio/ByteBuffer");
-
+
+/* NIODBG("%s", "..."); */
+
address_fid = (*env)->GetFieldID(env, bufferClass, "address",
"Lgnu/classpath/Pointer;");
if (address_fid == NULL)
@@ -242,6 +332,11 @@ Java_gnu_java_nio_VMChannel_initIDs (JNIEnv *env,
has_array_mid = get_method_id(env, byteBufferClass, "hasArray", "()Z");
array_mid = get_method_id(env, byteBufferClass, "array", "()[B");
array_offset_mid = get_method_id(env, byteBufferClass, "arrayOffset", "()I");
+
+ vm_channel_class = clazz;
+ thread_interrupted_mid = (*env)->GetStaticMethodID(env, clazz,
+ "isThreadInterrupted",
+ "()Z");
}
JNIEXPORT void JNICALL
@@ -252,6 +347,8 @@ Java_gnu_java_nio_VMChannel_setBlocking (JNIEnv *env,
{
int opts;
+/* NIODBG("fd: %d; blocking: %d", fd, blocking); */
+
opts = fcntl(fd, F_GETFL);
if (opts < 0)
{
@@ -260,10 +357,10 @@ Java_gnu_java_nio_VMChannel_setBlocking (JNIEnv *env,
return;
}
- if (blocking)
- opts |= O_NONBLOCK;
- else
+ if (blocking == JNI_TRUE)
opts &= ~(O_NONBLOCK);
+ else
+ opts |= O_NONBLOCK;
opts = fcntl(fd, F_SETFL, opts);
@@ -275,16 +372,33 @@ Java_gnu_java_nio_VMChannel_setBlocking (JNIEnv *env,
}
}
+/* Return true if fd is in non-blocking mode. */
+static jboolean
+is_non_blocking_fd(jint fd)
+{
+ int opts;
+ opts = fcntl(fd, F_GETFL);
+ if (opts == -1)
+ {
+ /* Assume blocking on error. */
+ return 0;
+ }
+ return (opts & O_NONBLOCK) != 0;
+}
JNIEXPORT jint JNICALL
-Java_gnu_java_nio_VMChannel_read (JNIEnv *env,
- jobject o __attribute__ ((__unused__)),
- jint fd,
- jobject bbuf)
+Java_gnu_java_nio_VMChannel_read__ILjava_nio_ByteBuffer_2 (JNIEnv *env,
+ jobject o __attribute__ ((__unused__)),
+ jint fd,
+ jobject bbuf)
{
+#ifdef HAVE_READ
jint len;
ssize_t result;
struct JCL_buffer buf;
+ int tmp_errno;
+
+/* NIODBG("fd: %d; bbuf: %p", fd, bbuf); */
if (JCL_init_buffer(env, &buf, bbuf) < 0)
{
@@ -292,26 +406,59 @@ Java_gnu_java_nio_VMChannel_read (JNIEnv *env,
JCL_ThrowException (env, IO_EXCEPTION, "Buffer initialisation failed");
return -1;
}
-
+
len = buf.limit - buf.position;
+
+ if (len == 0)
+ {
+ JCL_release_buffer (env, &buf, bbuf, JNI_ABORT);
+ return 0;
+ }
- result = read(fd, &(buf.ptr[buf.position + buf.offset]), len);
- buf.count = result;
+ do
+ {
+ result = cpnio_read (fd, &(buf.ptr[buf.position + buf.offset]), len);
+ tmp_errno = errno;
+ }
+ while (result == -1 && errno == EINTR && ! JCL_thread_interrupted(env));
+ errno = tmp_errno;
if (result == 0)
- result = -1; /* End Of File */
+ {
+ result = -1;
+ buf.count = 0;
+ }
else if (result == -1)
{
buf.count = 0;
- if (errno == EAGAIN) /* Non-blocking */
- result = 0;
+ if (errno == EAGAIN)
+ {
+ if (is_non_blocking_fd(fd))
+ {
+ /* Non-blocking */
+ result = 0;
+ }
+ else
+ {
+ /* Read timeout on a socket with SO_RCVTIMEO != 0. */
+ JCL_release_buffer(env, &buf, bbuf, JNI_ABORT);
+ JCL_ThrowException(env, SOCKET_TIMEOUT_EXCEPTION, "read timed out");
+ return -1;
+ }
+ }
else if (errno == EBADF) /* Bad fd */
{
JCL_release_buffer(env, &buf, bbuf, JNI_ABORT);
JCL_ThrowException (env, NON_READABLE_CHANNEL_EXCEPTION,
strerror(errno));
return -1;
- }
+ }
+ else if (EINTR == errno) /* read interrupted */
+ {
+ JCL_release_buffer(env, &buf, bbuf, JNI_ABORT);
+ JCL_ThrowException(env, INTERRUPTED_IO_EXCEPTION, strerror (errno));
+ return -1;
+ }
else
{
JCL_release_buffer(env, &buf, bbuf, JNI_ABORT);
@@ -320,21 +467,32 @@ Java_gnu_java_nio_VMChannel_read (JNIEnv *env,
}
}
else
-
- JCL_release_buffer(env, &buf, bbuf, JNI_COMMIT);
+ buf.count = result;
+
+ JCL_release_buffer(env, &buf, bbuf, 0);
return result;
+#else
+ (void) fd;
+ (void) bbuf;
+ JCL_ThrowException (env, IO_EXCEPTION, "read not supported");
+ return -1;
+#endif /* HAVE_READ */
}
JNIEXPORT jint JNICALL
-Java_gnu_java_nio_VMChannel_write (JNIEnv *env,
- jobject o __attribute__ ((__unused__)),
- jint fd,
- jobject bbuf)
+Java_gnu_java_nio_VMChannel_write__ILjava_nio_ByteBuffer_2 (JNIEnv *env,
+ jobject o __attribute__ ((__unused__)),
+ jint fd,
+ jobject bbuf)
{
+#ifdef HAVE_WRITE
jint len;
ssize_t result;
struct JCL_buffer buf;
+ int tmp_errno;
+
+/* NIODBG("fd: %d; bbuf: %p", fd, bbuf); */
if (JCL_init_buffer(env, &buf, bbuf) < 0)
{
@@ -342,16 +500,31 @@ Java_gnu_java_nio_VMChannel_write (JNIEnv *env,
JCL_ThrowException (env, IO_EXCEPTION, "Buffer initialisation failed");
return -1;
}
-
+
len = buf.limit - buf.position;
+
+ if (len == 0)
+ {
+ JCL_release_buffer (env, &buf, bbuf, JNI_ABORT);
+ return 0;
+ }
- result = write(fd, &(buf.ptr[buf.position + buf.offset]), len);
+ do
+ {
+ result = cpnio_write (fd, &(buf.ptr[buf.position + buf.offset]), len);
+ tmp_errno = errno;
+ }
+ while (result == -1 && errno == EINTR && ! JCL_thread_interrupted(env));
+ errno = tmp_errno;
+
buf.count = result;
-
+
if (result == -1)
{
if (errno == EAGAIN) /* Non-blocking */
+ {
result = 0;
+ }
else
{
JCL_release_buffer(env, &buf, bbuf, JNI_ABORT);
@@ -362,7 +535,13 @@ Java_gnu_java_nio_VMChannel_write (JNIEnv *env,
JCL_release_buffer(env, &buf, bbuf, JNI_ABORT);
- return result;
+ return result;
+#else
+ (void) fd;
+ (void) bbuf;
+ JCL_ThrowException (env, IO_EXCEPTION, "write not supported");
+ return -1;
+#endif /* HAVE_WRITE */
}
@@ -390,7 +569,11 @@ Java_gnu_java_nio_VMChannel_readScattering (JNIEnv *env,
struct JCL_buffer bi_list[JCL_IOV_MAX];
ssize_t result;
jint vec_len = length < JCL_IOV_MAX ? length : JCL_IOV_MAX;
- jlong bytes_read = 0;
+ jlong bytes_read = 0;
+ int tmp_errno;
+
+/* NIODBG("fd: %d; bbufs: %p; offset: %d; length: %d", */
+/* fd, bbufs, offset, length); */
/* Build the vector of buffers to read into */
for (i = 0; i < vec_len; i++)
@@ -401,7 +584,9 @@ Java_gnu_java_nio_VMChannel_readScattering (JNIEnv *env,
buf = &bi_list[i];
bbuf = (*env)->GetObjectArrayElement(env, bbufs, offset + i);
- JCL_init_buffer(env, buf, bbuf);
+ JCL_init_buffer(env, buf, bbuf);
+
+/* JCL_print_buffer (env, buf); */
buffers[i].iov_base = &(buf->ptr[buf->position + buf->offset]);
buffers[i].iov_len = buf->limit - buf->position;
@@ -409,14 +594,33 @@ Java_gnu_java_nio_VMChannel_readScattering (JNIEnv *env,
}
/* Work the scattering magic */
- result = readv(fd, buffers, vec_len);
+ do
+ {
+ result = cpnio_readv (fd, buffers, vec_len);
+ tmp_errno = errno;
+ }
+ while (result == -1 && errno == EINTR && ! JCL_thread_interrupted(env));
+ errno = tmp_errno;
bytes_read = (jlong) result;
/* Handle the response */
if (result < 0)
{
- if (errno == EAGAIN) /* Non blocking */
- result = 0;
+ if (errno == EAGAIN)
+ {
+ if (is_non_blocking_fd(fd))
+ {
+ /* Non-blocking */
+ result = 0;
+ }
+ else
+ {
+ /* Read timeout on a socket with SO_RCVTIMEO != 0. */
+ JCL_cleanup_buffers(env, bi_list, vec_len, bbufs, offset, bytes_read);
+ JCL_ThrowException(env, SOCKET_TIMEOUT_EXCEPTION, "read timed out");
+ return -1;
+ }
+ }
else if (errno == EBADF) /* Bad fd */
{
JCL_cleanup_buffers(env, bi_list, vec_len, bbufs, offset, bytes_read);
@@ -442,6 +646,7 @@ Java_gnu_java_nio_VMChannel_readScattering (JNIEnv *env,
return (jlong) result;
}
+
/*
* Implementation of a gathering write. Will use the appropriate
* vector based read call (currently readv on Linux).
@@ -467,7 +672,10 @@ Java_gnu_java_nio_VMChannel_writeGathering (JNIEnv *env,
ssize_t result;
jint vec_len = length < JCL_IOV_MAX ? length : JCL_IOV_MAX;
jlong bytes_written;
+ int tmp_errno;
+/* NIODBG("fd: %d; bbufs: %p; offset: %d; length: %d", */
+/* fd, bbufs, offset, length); */
/* Build the vector of buffers to read into */
for (i = 0; i < vec_len; i++)
@@ -480,13 +688,22 @@ Java_gnu_java_nio_VMChannel_writeGathering (JNIEnv *env,
JCL_init_buffer(env, buf, bbuf);
+/* JCL_print_buffer(env, buf); */
+
buffers[i].iov_base = &(buf->ptr[buf->position + buf->offset]);
buffers[i].iov_len = buf->limit - buf->position;
(*env)->DeleteLocalRef(env, bbuf);
}
/* Work the gathering magic */
- result = writev(fd, buffers, vec_len);
+ do
+ {
+ result = cpnio_writev (fd, buffers, vec_len);
+ tmp_errno = errno;
+ }
+ while (result == -1 && tmp_errno == EINTR && ! JCL_thread_interrupted(env));
+ errno = tmp_errno;
+
bytes_written = (jlong) result;
if (result < 0)
@@ -518,6 +735,1214 @@ Java_gnu_java_nio_VMChannel_writeGathering (JNIEnv *env,
}
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: receive
+ * Signature: (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_VMChannel_receive (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jobject dst, jobject addrPort)
+{
+#ifdef HAVE_RECVFROM
+ char *addrPortPtr = (*env)->GetDirectBufferAddress (env, addrPort);
+ struct JCL_buffer buf;
+#ifdef HAVE_INET6
+ struct sockaddr_in6 sock_storage;
+ struct sockaddr_in6 *sock6;
+ socklen_t slen = sizeof (struct sockaddr_in6);
+#else
+ struct sockaddr_in sock_storage;
+ socklen_t slen = sizeof (struct sockaddr_in);
+#endif /* HAVE_INET6 */
+ struct sockaddr *sockaddr = (struct sockaddr *) &sock_storage;
+ struct sockaddr_in *sock4;
+ int ret;
+ jint result = -1;
+
+ if (JCL_init_buffer (env, &buf, dst) == -1)
+ JCL_ThrowException (env, IO_EXCEPTION, "loading buffer failed");
+
+ ret = cpnio_recvfrom (fd, &(buf.ptr[buf.position + buf.offset]),
+ buf.limit - buf.position, MSG_WAITALL,
+ sockaddr, &slen);
+
+ if (-1 == ret)
+ {
+ JCL_release_buffer (env, &buf, dst, JNI_ABORT);
+ if (EINTR == errno)
+ JCL_ThrowException (env, "java/io/InterruptedIOException", strerror (errno));
+ else if (EAGAIN == errno)
+ {
+ /* If the socket is in blocking mode, our timeout expired. */
+ int val = fcntl (fd, F_GETFL, 0);
+ if (val == -1)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ else if ((val & O_NONBLOCK) == 0)
+ JCL_ThrowException (env, "java/net/SocketTimeoutException",
+ "read timed out");
+ }
+ else
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ return 0;
+ }
+
+ if (sockaddr->sa_family == AF_INET)
+ {
+ sock4 = (struct sockaddr_in *) sockaddr;
+ memcpy (addrPortPtr, &(sock4->sin_addr.s_addr), 4);
+ ;memcpy (addrPortPtr + 4, &(sock4->sin_port), 2);
+ result = 4;
+ }
+#ifdef HAVE_INET6
+ else if (sockaddr->sa_family == AF_INET6)
+ {
+ sock6 = (struct sockaddr_in6 *) sockaddr;
+ memcpy (addrPortPtr, &(sock6->sin6_addr.s6_addr), 16);
+ memcpy (addrPortPtr + 16, &(sock6->sin6_port), 2);
+ result = 16;
+ }
+#endif /* HAVE_INET6 */
+ else if (ret == 0)
+ {
+ result = 0;
+ }
+ else
+ {
+ JCL_ThrowException (env, "java/net/SocketException",
+ "unsupported address type returned");
+ }
+
+ buf.count += ret;
+ JCL_release_buffer (env, &buf, dst, 0);
+ return result;
+#else
+ (void) fd;
+ (void) dst;
+ (void) addrPort;
+ JCL_ThrowException (env, IO_EXCEPTION, "recvfrom not supported");
+#endif /* HAVE_RECVFROM */
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: send
+ * Signature: (Ljava/nio/ByteBuffer;[BI)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_VMChannel_send (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ int fd, jobject src, jbyteArray addr, jint port)
+{
+#ifdef HAVE_SENDTO
+ struct sockaddr_in sockaddr;
+ jbyte *elems;
+ struct JCL_buffer buf;
+ int ret;
+
+/* NIODBG("fd: %d; src: %p; addr: %p; port: %d", */
+/* fd, src, addr, port); */
+
+ if (JCL_init_buffer (env, &buf, src) == -1)
+ {
+ JCL_ThrowException (env, IO_EXCEPTION, "loading buffer failed");
+ return -1;
+ }
+
+/* JCL_print_buffer (env, &buf); */
+
+ elems = (*env)->GetByteArrayElements (env, addr, NULL);
+
+ sockaddr.sin_family = AF_INET;
+ sockaddr.sin_addr.s_addr = *((uint32_t *) elems);
+ sockaddr.sin_port = htons (port);
+
+ do
+ {
+ ret = cpnio_sendto (fd, &(buf.ptr[buf.position + buf.offset]),
+ buf.limit - buf.position,
+ 0, (const struct sockaddr *) &sockaddr,
+ sizeof (struct sockaddr_in));
+ }
+ while (-1 == ret && EINTR == errno);
+
+ (*env)->ReleaseByteArrayElements (env, addr, elems, JNI_ABORT);
+
+ if (-1 == ret)
+ {
+ if (errno != EAGAIN)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ JCL_release_buffer (env, &buf, src, JNI_ABORT);
+ return 0;
+ }
+
+ buf.count += ret;
+ JCL_release_buffer (env, &buf, src, JNI_ABORT);
+ return ret;
+#else
+ (void) fd;
+ (void) src;
+ (void) addr;
+ (void) port;
+#endif /* HAVE_SENDTO */
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: send6
+ * Signature: (Ljava/nio/ByteBuffer;[BI)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_VMChannel_send6 (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ int fd, jobject src, jbyteArray addr, jint port)
+{
+#if defined(HAVE_SENDTO) && defined(HAVE_INET6)
+ struct sockaddr_in6 sockaddr;
+ jbyte *elems;
+ struct JCL_buffer buf;
+ int ret;
+
+/* NIODBG("fd: %d; src: %p; addr: %p; port: %d", */
+/* fd, src, addr, port); */
+
+ if (JCL_init_buffer (env, &buf, src) == -1)
+ {
+ JCL_ThrowException (env, IO_EXCEPTION, "loading buffer failed");
+ return -1;
+ }
+
+/* JCL_print_buffer (env, &buf); */
+
+ elems = (*env)->GetByteArrayElements (env, addr, NULL);
+
+ sockaddr.sin6_family = AF_INET6;
+ memcpy (&sockaddr.sin6_addr.s6_addr, elems, 16);
+ sockaddr.sin6_port = htons (port);
+
+ do
+ {
+ ret = cpnio_sendto (fd, (const void *) (buf.ptr + buf.offset),
+ buf.limit - buf.position,
+ 0, (const struct sockaddr *) &sockaddr,
+ sizeof (struct sockaddr_in6));
+ }
+ while (-1 == ret && EINTR == errno);
+
+ (*env)->ReleaseByteArrayElements (env, addr, elems, JNI_ABORT);
+
+ if (-1 == ret)
+ {
+ if (errno != EAGAIN)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ JCL_release_buffer (env, &buf, src, JNI_ABORT);
+ return 0;
+ }
+
+ buf.count += ret;
+ JCL_release_buffer (env, &buf, src, JNI_ABORT);
+ return ret;
+#else
+ (void) fd;
+ (void) src;
+ (void) addr;
+ (void) port;
+ JCL_ThrowException (env, IO_EXCEPTION, "IPv6 sendto not supported");
+ return -1;
+#endif /* HAVE_SENDTO && HAVE_INET6 */
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: read
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_VMChannel_read__I (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd)
+{
+#ifdef HAVE_READ
+ char in;
+ int ret;
+ int tmp_errno;
+
+/* NIODBG("fd: %d", fd); */
+
+ do
+ {
+ ret = cpnio_read (fd, &in, 1);
+ tmp_errno = errno;
+ }
+ while (ret == -1 && errno == EINTR && ! JCL_thread_interrupted(env));
+ errno = tmp_errno;
+
+ if (-1 == ret)
+ {
+ if (errno == EAGAIN && !is_non_blocking_fd(fd))
+ {
+ /* Read timeout on a socket with SO_RCVTIMEO != 0. */
+ JCL_ThrowException(env, SOCKET_TIMEOUT_EXCEPTION, "read timed out");
+ }
+ else
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ return -1;
+ }
+
+ if (0 == ret)
+ return -1;
+
+ return (in & 0xFF);
+#else
+ (void) fd;
+ JCL_ThrowException (env, IO_EXCEPTION, "read not supported");
+#endif /* HAVE_READ */
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: write
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_nio_VMChannel_write__II (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jint data)
+{
+#ifdef HAVE_WRITE
+ char out = (char) data;
+ int ret;
+ int tmp_errno;
+
+/* NIODBG("fd: %d; data: %d", fd, data); */
+
+ do
+ {
+ ret = cpnio_write (fd, &out, 1);
+ tmp_errno = errno;
+ }
+ while (ret == -1 && errno == EINTR && ! JCL_thread_interrupted(env));
+ errno = tmp_errno;
+
+ if (-1 == ret)
+ JCL_ThrowException(env, IO_EXCEPTION, strerror (errno));
+#else
+ (void) fd;
+ (void) data;
+ JCL_ThrowException (env, IO_EXCEPTION, "write not supported");
+#endif /* HAVE_WRITE */
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: socket
+ * Signature: (Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_VMChannel_socket (JNIEnv *env, jclass clazz __attribute__((unused)),
+ jboolean stream)
+{
+#ifdef HAVE_SOCKET
+ int ret;
+
+ do
+ {
+ ret = cpnio_socket (AF_INET, stream ? SOCK_STREAM : SOCK_DGRAM, 0);
+ }
+ while (-1 == ret && EINTR == errno);
+
+ if (ret == -1)
+ JCL_ThrowException (env, "java/net/SocketException", strerror (errno));
+/* NIODBG("created socket %d", ret); */
+
+ return ret;
+#else
+ (void) stream;
+ JCL_ThrowException (env, IO_EXCEPTION, "socket not supported");
+ return -1;
+#endif /* HAVE_SOCKET */
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: connect
+ * Signature: (I[BI)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_gnu_java_nio_VMChannel_connect (JNIEnv *env, jclass clazz __attribute__((unused)),
+ jint fd, jbyteArray addr, jint port, jint timeout)
+{
+#ifdef HAVE_CONNECT
+ struct sockaddr_in sockaddr;
+ struct timeval timeo;
+ int origflags = 0, flags;
+ jbyte *addr_elems;
+ int ret;
+ int tmpErrno;
+
+ if ((*env)->GetArrayLength (env, addr) != 4)
+ {
+ JCL_ThrowException (env, SOCKET_EXCEPTION,
+ "expecting 4-byte address");
+ return JNI_FALSE;
+ }
+
+ if (timeout > 0)
+ {
+ timeo.tv_sec = timeout / 1000;
+ timeo.tv_usec = (timeout % 1000) * 1000;
+ origflags = fcntl (fd, F_GETFL, 0);
+ if (origflags == -1)
+ {
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+ return JNI_FALSE;
+ }
+ /* Set nonblocking mode, if not already set. */
+ if (!(origflags & O_NONBLOCK))
+ {
+ flags = origflags | O_NONBLOCK;
+ if (fcntl (fd, F_SETFL, flags) == -1)
+ {
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+ return JNI_FALSE;
+ }
+ }
+ }
+
+ addr_elems = (*env)->GetByteArrayElements (env, addr, NULL);
+
+ memset (&sockaddr, 0, sizeof (struct sockaddr_in));
+ sockaddr.sin_family = AF_INET;
+ sockaddr.sin_port = htons (port);
+ sockaddr.sin_addr.s_addr = *((uint32_t *) addr_elems);
+
+
+ do
+ {
+ ret = cpnio_connect (fd, (struct sockaddr *) &sockaddr,
+ sizeof (struct sockaddr_in));
+ tmpErrno = errno;
+ }
+ while (ret == -1 && errno == EINTR && ! JCL_thread_interrupted(env));
+ errno = tmpErrno;
+
+ (*env)->ReleaseByteArrayElements (env, addr, addr_elems, JNI_ABORT);
+
+ /* If a timeout was specified, select on the file descriptor with
+ the timeout. */
+ if (timeout > 0 && ret == -1)
+ {
+ /* Reset the non-blocking flag, if needed. */
+ if (!(origflags & O_NONBLOCK))
+ {
+ if (fcntl (fd, F_SETFL, origflags) == -1)
+ {
+ /* oops */
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+ return JNI_FALSE;
+ }
+ }
+ if (EINPROGRESS == errno)
+ {
+ fd_set wrfds;
+ FD_ZERO(&wrfds);
+ FD_SET(fd, &wrfds);
+ ret = cpnio_select (fd + 1, NULL, &wrfds, NULL, &timeo);
+ if (ret == -1)
+ {
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+ return JNI_FALSE;
+ }
+ if (ret == 0) /* connect timed out */
+ {
+ JCL_ThrowException (env, SOCKET_TIMEOUT_EXCEPTION,
+ "connect timed out");
+ return JNI_FALSE;
+ }
+ return JNI_TRUE; /* Connected! */
+ }
+ else if (ECONNREFUSED == errno)
+ {
+ JCL_ThrowException (env, CONNECT_EXCEPTION,
+ strerror (errno));
+ return JNI_FALSE;
+ }
+ else
+ {
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+ return JNI_FALSE;
+ }
+ }
+
+ if (ret == -1)
+ {
+ if (EINPROGRESS == errno)
+ return JNI_FALSE;
+ else if (ECONNREFUSED == errno)
+ {
+ JCL_ThrowException (env, CONNECT_EXCEPTION,
+ strerror (errno));
+ return JNI_FALSE;
+ }
+ else
+ {
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+ return JNI_FALSE;
+ }
+ }
+
+ return JNI_TRUE;
+#else
+ (void) fd;
+ (void) addr;
+ (void) port;
+ (void) timeout;
+ JCL_ThrowException (env, SOCKET_EXCEPTION, "connect not supported");
+ return JNI_FALSE;
+#endif /* HAVE_CONNECT */
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: connect6
+ * Signature: (I[BI)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_gnu_java_nio_VMChannel_connect6 (JNIEnv *env, jclass clazz __attribute__((unused)),
+ jint fd, jbyteArray addr, jint port, int timeout)
+{
+#if defined(HAVE_CONNECT) && defined(HAVE_INET6)
+ struct sockaddr_in6 sockaddr;
+ struct timeval timeo;
+ int flags, origflags = 0;
+ jbyte *addr_elems;
+ int ret;
+
+ if (timeout > 0)
+ {
+ timeo.tv_sec = timeout / 1000;
+ timeo.tv_usec = (timeout % 1000) * 1000;
+ origflags = fcntl (fd, F_GETFL, 0);
+ if (origflags == -1)
+ {
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+ return JNI_FALSE;
+ }
+ /* Set nonblocking mode, if not already set. */
+ if (!(origflags & O_NONBLOCK))
+ {
+ flags = origflags | O_NONBLOCK;
+ if (fcntl (fd, F_SETFL, flags) == -1)
+ {
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+ return JNI_FALSE;
+ }
+ }
+ }
+
+ addr_elems = (*env)->GetByteArrayElements (env, addr, NULL);
+
+ memset (&sockaddr, 0, sizeof (struct sockaddr_in6));
+ sockaddr.sin6_family = AF_INET6;
+ sockaddr.sin6_port = htons (port);
+ memcpy (&sockaddr.sin6_addr.s6_addr, addr_elems, 16);
+
+ ret = cpnio_connect (fd, (struct sockaddr *) &sockaddr,
+ sizeof (struct sockaddr_in6));
+
+ (*env)->ReleaseByteArrayElements (env, addr, addr_elems, JNI_ABORT);
+
+ /* If a timeout was specified, select on the file descriptor with
+ the timeout. */
+ if (timeout > 0 && ret == -1)
+ {
+ /* Reset the non-blocking flag, if needed. */
+ if (!(origflags & O_NONBLOCK))
+ {
+ if (fcntl (fd, F_SETFL, origflags) == -1)
+ {
+ /* oops */
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+ return JNI_FALSE;
+ }
+ }
+ if (EINPROGRESS == errno)
+ {
+ fd_set wrfds;
+ FD_ZERO(&wrfds);
+ FD_SET(fd, &wrfds);
+ ret = cpnio_select (fd + 1, NULL, &wrfds, NULL, &timeo);
+ if (ret == -1)
+ {
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+ return JNI_FALSE;
+ }
+ if (ret == 0) /* connect timed out */
+ {
+ JCL_ThrowException (env, SOCKET_TIMEOUT_EXCEPTION,
+ "connect timed out");
+ return JNI_FALSE;
+ }
+ return JNI_TRUE; /* Connected! */
+ }
+ else if (ECONNREFUSED == errno)
+ {
+ JCL_ThrowException (env, CONNECT_EXCEPTION,
+ strerror (errno));
+ return JNI_FALSE;
+ }
+ else
+ {
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+ return JNI_FALSE;
+ }
+ }
+
+ if (ret == -1)
+ {
+ if (EAGAIN == errno)
+ return JNI_FALSE;
+ else if (ECONNREFUSED == errno)
+ {
+ JCL_ThrowException (env, CONNECT_EXCEPTION,
+ strerror (errno));
+ return JNI_FALSE;
+ }
+ else
+ {
+ JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno));
+ return JNI_FALSE;
+ }
+ }
+
+ return JNI_TRUE;
+#else
+ (void) fd;
+ (void) addr;
+ (void) port;
+ (void) timeout;
+ JCL_ThrowException (env, SOCKET_EXCEPTION, "IPv6 connect not supported");
+ return JNI_FALSE;
+#endif /* HAVE_CONNECT && HAVE_INET6 */
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: getsockname
+ * Signature: (ILjava/nio/ByteBuffer;)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_VMChannel_getsockname (JNIEnv *env, jclass clazz __attribute__((unused)),
+ jint fd, jobject name)
+{
+#ifdef HAVE_GETSOCKNAME
+#ifdef HAVE_INET6
+ struct sockaddr_in6 *addr6;
+ struct sockaddr_in6 sock_storage;
+ socklen_t socklen = sizeof (struct sockaddr_in6);
+#else
+ struct sockaddr_in sock_storage;
+ socklen_t socklen = sizeof (struct sockaddr_in);
+#endif /* HAVE_INET6 */
+
+ struct sockaddr *sockaddr = (struct sockaddr *) &sock_storage;
+ struct sockaddr_in *addr4;
+ int ret;
+ char *nameptr = (*env)->GetDirectBufferAddress (env, name);
+
+ ret = getsockname (fd, sockaddr, &socklen);
+ if (ret == -1)
+ {
+ JCL_ThrowException (env, "java/net/SocketException", strerror (errno));
+ return 0;
+ }
+
+ if (sockaddr->sa_family == AF_INET)
+ {
+ addr4 = (struct sockaddr_in *) sockaddr;
+ memcpy (nameptr, &(addr4->sin_addr.s_addr), 4);
+ memcpy (nameptr + 4, &(addr4->sin_port), 2);
+ return 4;
+ }
+
+#ifdef HAVE_INET6
+ /* IPv6 */
+ if (sockaddr->sa_family == AF_INET6)
+ {
+ addr6 = (struct sockaddr_in6 *) sockaddr;
+ memcpy (nameptr, &(addr6->sin6_addr.s6_addr), 16);
+ memcpy (nameptr + 16, &(addr6->sin6_port), 2);
+ return 16;
+ }
+#endif /* HAVE_INET6 */
+ JCL_ThrowException (env, IO_EXCEPTION, "unsupported address format");
+ return -1;
+#else
+ (void) fd;
+ (void) name;
+ JCL_ThrowException (env, IO_EXCEPTION, "getsockname not supported");
+ return -1;
+#endif /* HAVE_GETSOCKNAME */
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: getpeername
+ * Signature: (ILjava/nio/ByteBuffer;)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_VMChannel_getpeername (JNIEnv *env, jclass clazz __attribute__((unused)),
+ jint fd, jobject name)
+{
+#ifdef HAVE_GETPEERNAME
+#ifdef HAVE_INET6
+ struct sockaddr_in6 *addr6;
+ struct sockaddr_in6 sock_storage;
+ socklen_t socklen = sizeof (struct sockaddr_in6);
+#else
+ struct sockaddr_in sock_storage;
+ socklen_t socklen = sizeof (struct sockaddr_in);
+#endif /* HAVE_INET6 */
+
+ struct sockaddr *sockaddr = (struct sockaddr *) &sock_storage;
+ struct sockaddr_in *addr4;
+ int ret;
+ char *nameptr = (*env)->GetDirectBufferAddress (env, name);
+
+ ret = getpeername (fd, sockaddr, &socklen);
+ if (ret == -1)
+ {
+ if (ENOTCONN != errno)
+ JCL_ThrowException (env, "java/net/SocketException", strerror (errno));
+ return 0;
+ }
+
+ if (sockaddr->sa_family == AF_INET)
+ {
+ addr4 = (struct sockaddr_in *) sockaddr;
+ memcpy (nameptr, &(addr4->sin_addr.s_addr), 4);
+ memcpy (nameptr + 4, &(addr4->sin_port), 2);
+ return 4;
+ }
+#ifdef HAVE_INET6
+ else if (sockaddr->sa_family == AF_INET6)
+ {
+ addr6 = (struct sockaddr_in6 *) sockaddr;
+ memcpy (nameptr, &(addr6->sin6_addr.s6_addr), 16);
+ memcpy (nameptr + 16, &(addr6->sin6_port), 2);
+ return 16;
+ }
+#endif /* HAVE_INET6 */
+
+ JCL_ThrowException (env, "java/net/SocketException",
+ "unsupported address type");
+ return -1;
+#else
+ (void) fd;
+ (void) name;
+ JCL_ThrowException (env, IO_EXCEPTION, "getpeername not supported");
+ return -1;
+#endif /* HAVE_GETPEERNAME */
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: accept
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_VMChannel_accept (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd)
+{
+#ifdef HAVE_ACCEPT
+ int ret;
+ int tmp_errno = 0;
+
+#ifdef HAVE_INET6
+ struct sockaddr_in6 addr;
+ socklen_t alen = sizeof (struct sockaddr_in6);
+#else
+ struct sockaddr_in addr;
+ socklen_t alen = sizeof (struct sockaddr_in);
+#endif /* HAVE_INET6 */
+
+ do
+ {
+ ret = cpnio_accept (fd, (struct sockaddr *) &addr, &alen);
+ tmp_errno = errno;
+
+ if (ret == -1)
+ switch (tmp_errno)
+ {
+ case EINTR:
+ /* Check if interrupted by Thread.interrupt(). If not then some
+ * other unrelated signal interrupted the system function and
+ * we should start over again.
+ */
+ if (JCL_thread_interrupted(env))
+ {
+ JCL_ThrowException (env, "java/net/SocketException", strerror (tmp_errno));
+ return -1;
+ }
+ break;
+#if defined(EWOULDBLOCK) && defined(EAGAIN) && EWOULDBLOCK != EAGAIN
+ case EWOULDBLOCK:
+#endif
+ case EAGAIN:
+ /* Socket in non-blocking mode and no pending connection. */
+ return -1;
+ default:
+ JCL_ThrowException (env, "java/net/SocketException", strerror (tmp_errno));
+ return -1;
+ }
+ else
+ break;
+ }
+ while (1);
+
+ cpio_closeOnExec(ret);
+
+ return ret;
+#else
+ (void) fd;
+ JCL_ThrowException (env, IO_EXCEPTION, "accept not supported");
+ return -1;
+#endif /* HAVE_ACCEPT */
+}
+
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: disconnect
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_nio_VMChannel_disconnect (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd)
+{
+ struct sockaddr sockaddr;
+
+ sockaddr.sa_family = AF_UNSPEC;
+ if (connect (fd, &sockaddr, sizeof (struct sockaddr)) == -1)
+ {
+ /* The expected error for a successful disconnect is EAFNOSUPPORT. */
+ if (errno != EAFNOSUPPORT)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ }
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: close
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_nio_VMChannel_close (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd)
+{
+ if (close (fd) == -1)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: available
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_VMChannel_available (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd)
+{
+ jint avail = 0;
+
+/* NIODBG("fd: %d", fd); */
+ if (ioctl (fd, FIONREAD, &avail) == -1)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+/* NIODBG("avail: %d", avail); */
+
+ return avail;
+}
+
+
+enum FileChannel_mode {
+ CPNIO_READ = 1,
+ CPNIO_WRITE = 2,
+ CPNIO_APPEND = 4,
+ CPNIO_EXCL = 8,
+ CPNIO_SYNC = 16,
+ CPNIO_DSYNC = 32
+};
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: open
+ * Signature: (Ljava/lang/String;I)I
+ */
+JNIEXPORT jint JNICALL
+Java_gnu_java_nio_VMChannel_open (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jstring path, jint mode)
+{
+ int nmode = 0;
+ int ret;
+ const char *npath;
+ mode_t mask = umask (0);
+ umask (mask);
+
+ if ((mode & CPNIO_READ) && (mode & CPNIO_WRITE))
+ nmode = O_RDWR;
+ else if (mode & CPNIO_WRITE)
+ nmode = O_WRONLY;
+ else
+ nmode = O_RDONLY;
+
+ nmode = (nmode
+ | ((nmode == O_RDWR || nmode == O_WRONLY) ? O_CREAT : 0)
+ | ((mode & CPNIO_APPEND) ? O_APPEND :
+ ((nmode == O_RDWR || nmode == O_WRONLY) ? O_TRUNC : 0))
+ | ((mode & CPNIO_EXCL) ? O_EXCL : 0)
+ | ((mode & CPNIO_SYNC) ? O_SYNC : 0));
+
+ npath = JCL_jstring_to_cstring (env, path);
+
+/* NIODBG("path: %s; mode: %x", npath, nmode); */
+
+ ret = open (npath, nmode, 0777 & ~mask);
+
+/* NIODBG("ret: %d\n", ret); */
+
+ JCL_free_cstring (env, path, npath);
+
+ if (-1 == ret)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+
+ return ret;
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: position
+ * Signature: (I)J
+ */
+JNIEXPORT jlong JNICALL
+Java_gnu_java_nio_VMChannel_position (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd)
+{
+#ifdef HAVE_LSEEK
+ off_t ret;
+
+ ret = lseek (fd, 0, SEEK_CUR);
+
+ if (-1 == ret)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+
+ return (jlong) ret;
+#else
+ JCL_ThrowException (env, IO_EXCEPTION, "position not supported");
+ return -1;
+#endif /* HAVE_LSEEK */
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: seek
+ * Signature: (IJ)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_nio_VMChannel_seek (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jlong pos)
+{
+#ifdef HAVE_LSEEK
+ if (lseek (fd, (off_t) pos, SEEK_SET) == -1)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+#else
+ JCL_ThrowException (env, IO_EXCEPTION, "seek not supported");
+#endif /* HAVE_LSEEK */
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: truncate
+ * Signature: (IJ)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_nio_VMChannel_truncate (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jlong len)
+{
+#if defined(HAVE_FTRUNCATE) && defined(HAVE_LSEEK)
+ off_t pos = lseek (fd, 0, SEEK_CUR);
+ if (pos == -1)
+ {
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ return;
+ }
+ if (ftruncate (fd, (off_t) len) == -1)
+ {
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ return;
+ }
+ if (pos > len)
+ {
+ if (lseek (fd, len, SEEK_SET) == -1)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ }
+#else
+ JCL_ThrowException (env, IO_EXCEPTION, "truncate not supported");
+#endif /* HAVE_FTRUNCATE && HAVE_LSEEK */
+}
+
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: lock
+ * Signature: (IJJZZ)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_gnu_java_nio_VMChannel_lock (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jlong pos, jlong len,
+ jboolean shared, jboolean wait)
+{
+#if HAVE_FCNTL
+ struct flock fl;
+
+ fl.l_start = (off_t) pos;
+ /* Long.MAX_VALUE means lock everything possible starting at pos. */
+ if (len == 9223372036854775807LL)
+ fl.l_len = 0;
+ else
+ fl.l_len = (off_t) len;
+ fl.l_pid = getpid ();
+ fl.l_type = (shared ? F_RDLCK : F_WRLCK);
+ fl.l_whence = SEEK_SET;
+
+ if (cpnio_fcntl (fd, (wait ? F_SETLKW : F_SETLK), (long) &fl) == -1)
+ {
+ if (errno != EAGAIN)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ return JNI_FALSE;
+ }
+
+ return JNI_TRUE;
+#else
+ JCL_ThrowException (env, IO_EXCEPTION, "lock not supported");
+ return JNI_FALSE;
+#endif /* HAVE_FCNTL */
+}
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: unlock
+ * Signature: (IJJ)V
+ */
+JNIEXPORT void JNICALL
+Java_gnu_java_nio_VMChannel_unlock (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jlong pos, jlong len)
+{
+#if HAVE_FCNTL
+ struct flock fl;
+
+ fl.l_start = (off_t) pos;
+ fl.l_len = (off_t) len;
+ fl.l_pid = getpid ();
+ fl.l_type = F_UNLCK;
+ fl.l_whence = SEEK_SET;
+
+ if (cpnio_fcntl (fd, F_SETLK, (long) &fl) == -1)
+ {
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ }
+#else
+ JCL_ThrowException (env, IO_EXCEPTION, "unlock not supported");
+#endif /* HAVE_FCNTL */
+}
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: size
+ * Signature: (I)J
+ */
+JNIEXPORT jlong JNICALL
+Java_gnu_java_nio_VMChannel_size (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd)
+{
+#ifdef HAVE_FSTAT
+ struct stat st;
+
+ if (fstat (fd, &st) == -1)
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+
+ return (jlong) st.st_size;
+#else
+ JCL_ThrowException (env, IO_EXCEPTION, "size not supported");
+ return 0;
+#endif
+}
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: map
+ * Signature: (ICJI)Lgnu/classpath/Pointer;
+ */
+JNIEXPORT jobject JNICALL
+Java_gnu_java_nio_VMChannel_map (JNIEnv *env,
+ jclass clazz __attribute__((unused)),
+ jint fd, jchar mode, jlong position, jint size)
+{
+#ifdef HAVE_MMAP
+ jclass MappedByteBufferImpl_class;
+ jmethodID MappedByteBufferImpl_init = NULL;
+ jobject Pointer_instance;
+ volatile jobject buffer;
+ long pagesize;
+ int prot, flags;
+ void *p;
+ void *address;
+
+/* NIODBG("fd: %d; mode: %x; position: %lld; size: %d", */
+/* fd, mode, position, size); */
+
+ /* FIXME: should we just assume we're on an OS modern enough to
+ have 'sysconf'? And not check for 'getpagesize'? */
+#if defined(HAVE_GETPAGESIZE)
+ pagesize = getpagesize ();
+#elif defined(HAVE_SYSCONF)
+ pagesize = sysconf (_SC_PAGESIZE);
+#else
+ JCL_ThrowException (env, IO_EXCEPTION,
+ "can't determine memory page size");
+ return NULL;
+#endif /* HAVE_GETPAGESIZE/HAVE_SYSCONF */
+
+ if ((*env)->ExceptionOccurred (env))
+ {
+ return NULL;
+ }
+
+ prot = PROT_READ;
+ if (mode == '+' || mode == 'c')
+ {
+ /* When writing we need to make sure the file is big enough,
+ otherwise the result of mmap is undefined. */
+ struct stat st;
+ if (fstat (fd, &st) == -1)
+ {
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ return NULL;
+ }
+ if (position + size > st.st_size)
+ {
+ if (ftruncate(fd, position + size) == -1)
+ {
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ return NULL;
+ }
+ }
+ prot |= PROT_WRITE;
+ }
+
+ flags = (mode == 'c' ? MAP_PRIVATE : MAP_SHARED);
+ p = mmap (NULL, (size_t) ALIGN_UP (size, pagesize), prot, flags,
+ fd, ALIGN_DOWN (position, pagesize));
+ if (p == MAP_FAILED)
+ {
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ return NULL;
+ }
+
+ /* Unalign the mapped value back up, since we aligned offset
+ down to a multiple of the page size. */
+ address = (void *) ((char *) p + (position % pagesize));
+
+ Pointer_instance = JCL_NewRawDataObject(env, address);
+
+ MappedByteBufferImpl_class = (*env)->FindClass (env,
+ "java/nio/MappedByteBufferImpl");
+ if (MappedByteBufferImpl_class != NULL)
+ {
+ MappedByteBufferImpl_init =
+ (*env)->GetMethodID (env, MappedByteBufferImpl_class,
+ "<init>", "(Lgnu/classpath/Pointer;IZ)V");
+ }
+
+ if ((*env)->ExceptionOccurred (env))
+ {
+ munmap (p, ALIGN_UP (size, pagesize));
+ return NULL;
+ }
+ if (MappedByteBufferImpl_init == NULL)
+ {
+ JCL_ThrowException (env, "java/lang/InternalError",
+ "could not get MappedByteBufferImpl constructor");
+ munmap (p, ALIGN_UP (size, pagesize));
+ return NULL;
+ }
+
+ buffer = (*env)->NewObject (env, MappedByteBufferImpl_class,
+ MappedByteBufferImpl_init, Pointer_instance,
+ (jint) size, mode == 'r');
+ return buffer;
+#else
+ (void) fd;
+ (void) mode;
+ (void) position;
+ (void) size;
+ JCL_ThrowException (env, IO_EXCEPTION,
+ "memory-mapped files not implemented");
+ return 0;
+#endif /* HAVE_MMAP */
+}
+
+/*
+ * Class: gnu_java_nio_VMChannel
+ * Method: flush
+ * Signature: (IZ)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_gnu_java_nio_VMChannel_flush (JNIEnv *env,
+ jclass c __attribute__((unused)),
+ jint fd, jboolean metadata __attribute__((unused)))
+{
+#ifdef HAVE_FSYNC
+ /* XXX blocking? */
+ if (fsync (fd) == -1)
+ {
+ JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
+ return JNI_FALSE;
+ }
+ return JNI_TRUE;
+#else
+ JCL_ThrowException (env, IO_EXCEPTION, "flush not implemented");
+ return JNI_TRUE;
+#endif /* HAVE_FSYNC */
+}
#ifdef __cplusplus
diff --git a/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMPipe.c b/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMPipe.c
index 369c5a3d650..cbaaa08348b 100644
--- a/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMPipe.c
+++ b/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMPipe.c
@@ -35,8 +35,14 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif /* HAVE_CONFIG_H */
+
#include <errno.h>
+#include <string.h>
+#include <unistd.h>
#include <jni.h>
#include <jcl.h>
@@ -45,12 +51,33 @@ exception statement from your version. */
#define IO_EXCEPTION "java/io/IOException"
-JNIEXPORT void JNICALL
-Java_gnu_java_nio_VMPipe_init (JNIEnv * env,
- jclass cls __attribute__ ((__unused__)),
- jobject self __attribute__ ((__unused__)),
- jobject provider __attribute__ ((__unused__)))
+/*
+ * Class: gnu_java_nio_VMPipe
+ * Method: pipe0
+ * Signature: ()[I
+ */
+JNIEXPORT jintArray JNICALL
+Java_gnu_java_nio_VMPipe_pipe0 (JNIEnv *env,
+ jclass c __attribute__((unused)))
{
- JCL_ThrowException (env, IO_EXCEPTION,
- "gnu.java.nio.VMPipe.init(): not implemented");
+ int fd[2];
+ jintArray array;
+ jint* elem;
+ int ret;
+
+ /* FIXME: autoconf this? */
+ ret = pipe (fd);
+
+ if (ret == -1)
+ {
+ JCL_ThrowException (env, "java/io/IOException", strerror (errno));
+ return NULL;
+ }
+
+ array = (*env)->NewIntArray (env, 2);
+ elem = (*env)->GetIntArrayElements (env, array, NULL);
+ elem[0] = fd[0];
+ elem[1] = fd[1];
+ (*env)->ReleaseIntArrayElements (env, array, elem, 0);
+ return array;
}
diff --git a/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMSelector.c b/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMSelector.c
index f8a40aa7a15..74a408c7572 100644
--- a/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMSelector.c
+++ b/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMSelector.c
@@ -219,7 +219,7 @@ Java_gnu_java_nio_VMSelector_select (JNIEnv * env,
fd_set except_fds;
struct timeval real_time_data;
struct timeval *time_data = NULL;
- char message_buf[BUF_SIZE + 1];
+ char *message;
/* If a legal timeout value isn't given, use NULL.
* This means an infinite timeout. The specification
@@ -270,7 +270,8 @@ Java_gnu_java_nio_VMSelector_select (JNIEnv * env,
if (result < 0)
{
-
+#if defined(HAVE_STRERROR_R)
+ char message_buf[BUF_SIZE+1];
int errorcode = -result;
if (strerror_r (errorcode, message_buf, BUF_SIZE))
@@ -283,7 +284,12 @@ Java_gnu_java_nio_VMSelector_select (JNIEnv * env,
return 0;
}
- JCL_ThrowException (env, "java/io/IOException", message_buf);
+ message = message_buf;
+#else
+ message = strerror(errno);
+#endif
+
+ JCL_ThrowException (env, "java/io/IOException", message);
return 0;
}
diff --git a/libjava/classpath/native/jni/java-nio/gnu_java_nio_channels_FileChannelImpl.c b/libjava/classpath/native/jni/java-nio/gnu_java_nio_channels_FileChannelImpl.c
deleted file mode 100644
index 5aed63f355d..00000000000
--- a/libjava/classpath/native/jni/java-nio/gnu_java_nio_channels_FileChannelImpl.c
+++ /dev/null
@@ -1,902 +0,0 @@
-/* gnu_java_nio_channels_FileChannelImpl.c -
- Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/* do not move; needed here because of some macro definitions */
-#include <config.h>
-
-#include <stdlib.h>
-#include <errno.h>
-
-#include <jni.h>
-#include <jcl.h>
-
-#include "target_native.h"
-#ifndef WITHOUT_FILESYSTEM
-#include "target_native_file.h"
-#endif
-#include "target_native_math_int.h"
-
-#include "gnu_java_nio_channels_FileChannelImpl.h"
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif /* HAVE_FCNTL_H */
-
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif /* HAVE_SYS_MMAN_H */
-
-/* These values must be kept in sync with FileChannelImpl.java. */
-#define FILECHANNELIMPL_READ 1
-#define FILECHANNELIMPL_WRITE 2
-#define FILECHANNELIMPL_APPEND 4
-
-/* These values must be kept in sync with FileChannelImpl.java. */
-/* #define FILECHANNELIMPL_FILESEEK_SET 0 */
-/* #define FILECHANNELIMPL_FILESEEK_CUR 1 */
-/* #define FILECHANNELIMPL_FILESEEK_END 2 */
-
-#define FILECHANNELIMPL_FILEOPEN_FLAG_READ 1
-#define FILECHANNELIMPL_FILEOPEN_FLAG_WRITE 2
-#define FILECHANNELIMPL_FILEOPEN_FLAG_APPEND 4
-#define FILECHANNELIMPL_FILEOPEN_FLAG_EXCL 8
-#define FILECHANNELIMPL_FILEOPEN_FLAG_SYNC 16
-#define FILECHANNELIMPL_FILEOPEN_FLAG_DSYNC 32
-
-#define IO_EXCEPTION "java/io/IOException"
-
-/* FIXME: This can't be right. Need converter macros. */
-#define CONVERT_JLONG_TO_INT(x) TARGET_NATIVE_MATH_INT_INT64_TO_INT32(x)
-#define CONVERT_INT_TO_JLONG(x) TARGET_NATIVE_MATH_INT_INT32_TO_INT64(x)
-
-/* FIXME: This can't be right. Need converter macros. */
-#define CONVERT_JLONG_TO_OFF_T(x) TARGET_NATIVE_MATH_INT_INT64_TO_INT32(x)
-#define CONVERT_OFF_T_TO_JLONG(x) TARGET_NATIVE_MATH_INT_INT32_TO_INT64(x)
-
-/* FIXME: This can't be right. Need converter macros */
-#define CONVERT_JINT_TO_INT(x) ((int)(x & 0xFFFFFFFF))
-#define CONVERT_INT_TO_JINT(x) ((int)(x & 0xFFFFFFFF))
-
-/* FIXME: This can't be right. Need converter macros. */
-#define CONVERT_SSIZE_T_TO_JINT(x) ((jint)(x & 0xFFFFFFFF))
-#define CONVERT_JINT_TO_SSIZE_T(x) (x)
-
-/* Align a value up or down to a multiple of the pagesize. */
-#define ALIGN_DOWN(p,s) ((p) - ((p) % (s)))
-#define ALIGN_UP(p,s) ((p) + ((s) - ((p) % (s))))
-
-/* cached fieldID of gnu.java.nio.channels.FileChannelImpl.fd */
-static jfieldID native_fd_fieldID;
-
-static jint
-get_native_fd (JNIEnv * env, jobject obj)
-{
- return (*env)->GetIntField (env, obj, native_fd_fieldID);
-}
-
-/*
- * Library initialization routine. Called as part of java.io.FileDescriptor
- * static initialization.
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_init (JNIEnv * env,
- jclass clazz
- __attribute__ ((__unused__)))
-{
- jclass clazz_fc;
- jfieldID field;
-
- /* Initialize native_fd_fieldID so we only compute it once! */
- clazz_fc = (*env)->FindClass (env, "gnu/java/nio/channels/FileChannelImpl");
- if (!clazz_fc)
- {
- JCL_ThrowException (env, IO_EXCEPTION, "Internal error");
- return;
- }
-
- field = (*env)->GetFieldID (env, clazz_fc, "fd", "I");
- if (!field)
- {
- JCL_ThrowException (env, IO_EXCEPTION, "Internal error");
- return;
- }
-
- native_fd_fieldID = field;
-}
-
-/*
- * Open the specified file and return a native file descriptor
- */
-JNIEXPORT jint JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_open (JNIEnv * env,
- jobject obj
- __attribute__ ((__unused__)),
- jstring name, jint mode)
-{
- const char *filename;
- int flags;
- int permissions;
- int native_fd;
- int result;
-
- filename = JCL_jstring_to_cstring (env, name);
- if (filename == NULL)
- return (-1); /* Exception will already have been thrown */
-
- /* get file/permission flags for open() */
- if ((mode & FILECHANNELIMPL_FILEOPEN_FLAG_READ)
- && (mode & FILECHANNELIMPL_FILEOPEN_FLAG_WRITE))
- {
- /* read/write */
- flags =
- TARGET_NATIVE_FILE_FILEFLAG_CREATE |
- TARGET_NATIVE_FILE_FILEFLAG_READWRITE;
- permissions = TARGET_NATIVE_FILE_FILEPERMISSION_NORMAL;
- }
- else if ((mode & FILECHANNELIMPL_FILEOPEN_FLAG_READ))
- {
- /* read */
- flags = TARGET_NATIVE_FILE_FILEFLAG_READ;
- permissions = TARGET_NATIVE_FILE_FILEPERMISSION_NORMAL;
- }
- else
- {
- /* write */
- flags =
- TARGET_NATIVE_FILE_FILEFLAG_CREATE |
- TARGET_NATIVE_FILE_FILEFLAG_WRITE;
- if ((mode & FILECHANNELIMPL_FILEOPEN_FLAG_APPEND))
- {
- flags |= TARGET_NATIVE_FILE_FILEFLAG_APPEND;
- }
- else
- {
- flags |= TARGET_NATIVE_FILE_FILEFLAG_TRUNCATE;
- }
- permissions = TARGET_NATIVE_FILE_FILEPERMISSION_NORMAL;
- }
-
- if ((mode & FILECHANNELIMPL_FILEOPEN_FLAG_SYNC))
- {
- flags |= TARGET_NATIVE_FILE_FILEFLAG_SYNC;
- }
-
- if ((mode & FILECHANNELIMPL_FILEOPEN_FLAG_DSYNC))
- {
- flags |= TARGET_NATIVE_FILE_FILEFLAG_DSYNC;
- }
-#ifdef O_BINARY
- flags |= TARGET_NATIVE_FILE_FILEFLAG_BINARY;
-#endif
-
- TARGET_NATIVE_FILE_OPEN (filename, native_fd, flags, permissions, result);
-
- if (result != TARGET_NATIVE_OK)
- {
- char message[256]; /* Fixed size we don't need to malloc. */
- char *error_string = TARGET_NATIVE_LAST_ERROR_STRING ();
-
- snprintf(message, 256, "%s: %s", error_string, filename);
- /* We are only allowed to throw FileNotFoundException. */
- JCL_ThrowException (env,
- "java/io/FileNotFoundException",
- message);
- JCL_free_cstring (env, name, filename);
- return TARGET_NATIVE_MATH_INT_INT64_CONST_MINUS_1;
- }
-
- JCL_free_cstring (env, name, filename);
- return native_fd;
-}
-
-/*
- * Closes the specified file descriptor and return status code.
- * Exception on error
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_implCloseChannel (JNIEnv * env,
- jobject obj)
-{
- int native_fd;
- int result;
-
- native_fd = get_native_fd (env, obj);
-
- do
- {
- TARGET_NATIVE_FILE_CLOSE (native_fd, result);
- if (result != TARGET_NATIVE_OK
- && (TARGET_NATIVE_LAST_ERROR ()
- != TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL))
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- return;
- }
- }
- while (result != TARGET_NATIVE_OK);
-}
-
-/*
- * Return number of bytes that can be read from the file w/o blocking.
- * Exception on error
- */
-JNIEXPORT jint JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_available (JNIEnv * env,
- jobject obj)
-{
- int native_fd;
- jlong bytes_available;
- int result;
-
- native_fd = get_native_fd (env, obj);
-
- do
- {
- TARGET_NATIVE_FILE_AVAILABLE (native_fd, bytes_available, result);
- if (result != TARGET_NATIVE_OK
- && (TARGET_NATIVE_LAST_ERROR ()
- != TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL))
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- return 0;
- }
- }
- while (result != TARGET_NATIVE_OK);
-
- /* FIXME NYI ??? why only jint and not jlong? */
- return TARGET_NATIVE_MATH_INT_INT64_TO_INT32 (bytes_available);
-}
-
-JNIEXPORT jlong JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_size (JNIEnv * env, jobject obj)
-{
- int native_fd;
- jlong file_size;
- int result;
-
- native_fd = get_native_fd (env, obj);
-
- TARGET_NATIVE_FILE_SIZE (native_fd, file_size, result);
- if (result != TARGET_NATIVE_OK)
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- return TARGET_NATIVE_MATH_INT_INT64_CONST_MINUS_1;
- }
-
- return file_size;
-}
-
-/*
- * Return the current position of the file pointer
- * Exception on error
- */
-JNIEXPORT jlong JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_implPosition (JNIEnv * env,
- jobject obj)
-{
- int native_fd;
- jlong current_offset;
- int result;
-
- native_fd = get_native_fd (env, obj);
-
- TARGET_NATIVE_FILE_TELL (native_fd, current_offset, result);
- if (result != TARGET_NATIVE_OK)
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- return TARGET_NATIVE_MATH_INT_INT64_CONST_MINUS_1;
- }
-
- return current_offset;
-}
-
-/*
- * Wrapper around lseek call. Return new file position
- * Exception on error
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_seek (JNIEnv * env, jobject obj,
- jlong offset)
-{
- int native_fd;
- jlong new_offset;
- int result;
-
- native_fd = get_native_fd (env, obj);
-
-#if 0
- /* Should there be such an exception? All native layer macros should
- be accepting 64bit-values if needed. It some target is not able
- to handle such values it should simply operate with 32bit-values
- and convert 64bit-values appriopated. In this case I assume
- problems should not occurre: if some specific target is not able
- to handle 64bit-values the system is limited to 32bit at all, thus
- the application can not do a seek() or something else beyond the
- 32bit limit. It this true?
- */
-
- /* FIXME: What do we do if offset > the max value of off_t on this 32bit
- * system? How do we detect that and what do we do? */
- if (CONVERT_OFF_T_TO_JLONG (native_offset) != offset)
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- "Cannot represent position correctly on this system");
- }
-#endif /* 0 */
-
- result = TARGET_NATIVE_ERROR;
- new_offset = TARGET_NATIVE_MATH_INT_INT64_CONST_MINUS_1;
- TARGET_NATIVE_FILE_SEEK_BEGIN (native_fd, offset, new_offset, result);
-
- if (result != TARGET_NATIVE_OK)
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- }
-}
-
-/*
- * Set the length of the file
- * Exception on error
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_implTruncate (JNIEnv * env,
- jobject obj,
- jlong len)
-{
- int native_fd;
- jlong file_size;
- int bytes_written;
- jlong save_offset, new_offset;
- char data;
- int result;
-
- native_fd = get_native_fd (env, obj);
-
-#if 0
- /* Should there be such an exception? All native layer macros should
- be accepting 64bit-values if needed. It some target is not able
- to handle such values it should simply operate with 32bit-values
- and convert 64bit-values appriopated. In this case I assume
- problems should not occurre: if some specific target is not able
- to handle 64bit-values the system is limited to 32bit at all, thus
- the application can not do a seek() or something else beyond the
- 32bit limit. It this true?
- */
-
- /* FIXME: What do we do if len > the max value of off_t on this 32bit
- * system? How do we detect that and what do we do? */
- if (CONVERT_OFF_T_TO_JLONG (native_len) != len)
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- "Cannot represent position correctly on this system");
- return;
- }
-#endif /* 0 */
-
- /* get file size */
- TARGET_NATIVE_FILE_SIZE (native_fd, file_size, result);
- if (result != TARGET_NATIVE_OK)
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- return;
- }
-
- /* Save off current position */
- TARGET_NATIVE_FILE_TELL (native_fd, save_offset, result);
- if (result != TARGET_NATIVE_OK)
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- return;
- }
-
- if (TARGET_NATIVE_MATH_INT_INT64_LT (file_size, len))
- {
- /* File is too short -- seek to one byte short of where we want,
- * then write a byte */
-
- /* move to position n-1 */
- TARGET_NATIVE_FILE_SEEK_BEGIN (native_fd,
- TARGET_NATIVE_MATH_INT_INT64_SUB (len,
- 1),
- new_offset, result);
- if (result != TARGET_NATIVE_OK)
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- return;
- }
-
- /* write a byte
- Note: This will fail if we somehow get here in read only mode
- * That shouldn't happen */
- data = '\0';
- TARGET_NATIVE_FILE_WRITE (native_fd, &data, 1, bytes_written, result);
- if (result != TARGET_NATIVE_OK)
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- return;
- }
-
- /* Reposition file pointer to where we started if not beyond new len. */
- if (TARGET_NATIVE_MATH_INT_INT64_LT (save_offset, len))
- {
- TARGET_NATIVE_FILE_SEEK_BEGIN (native_fd, save_offset,
- new_offset, result);
- if (result != TARGET_NATIVE_OK)
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- return;
- }
- }
- }
- else if (TARGET_NATIVE_MATH_INT_INT64_GT (file_size, len))
- {
- /* File is too long - use ftruncate if available */
-#ifdef HAVE_FTRUNCATE
- TARGET_NATIVE_FILE_TRUNCATE (native_fd, len, result);
- if (result != TARGET_NATIVE_OK)
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- return;
- }
-#else /* HAVE_FTRUNCATE */
- /* FIXME: Probably operation isn't supported, but this exception
- * is too harsh as it will probably crash the program without need
- JCL_ThrowException(env, "java/lang/UnsupportedOperationException",
- "not implemented - can't shorten files on this platform");
- */
- JCL_ThrowException (env, IO_EXCEPTION, "Unable to shorten file length");
-#endif /* HAVE_FTRUNCATE */
-
- /* Reposition file pointer when it now is beyond the end of file. */
- if (TARGET_NATIVE_MATH_INT_INT64_GT (save_offset, len))
- {
- TARGET_NATIVE_FILE_SEEK_BEGIN (native_fd, len, new_offset, result);
- if (result != TARGET_NATIVE_OK)
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- return;
- }
- }
- }
-}
-
-JNIEXPORT jobject JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_mapImpl (JNIEnv *env, jobject obj,
- jchar mode, jlong position, jint size)
-{
-#ifdef HAVE_MMAP
- jclass MappedByteBufferImpl_class;
- jmethodID MappedByteBufferImpl_init = NULL;
- jobject Pointer_instance;
- volatile jobject buffer;
- long pagesize;
- int prot, flags;
- int fd;
- void *p;
- void *address;
-
- /* FIXME: should we just assume we're on an OS modern enough to
- have 'sysconf'? And not check for 'getpagesize'? */
-#if defined(HAVE_GETPAGESIZE)
- pagesize = getpagesize ();
-#elif defined(HAVE_SYSCONF)
- pagesize = sysconf (_SC_PAGESIZE);
-#else
- JCL_ThrowException (env, IO_EXCEPTION,
- "can't determine memory page size");
- return NULL;
-#endif /* HAVE_GETPAGESIZE/HAVE_SYSCONF */
-
- if ((*env)->ExceptionOccurred (env))
- {
- return NULL;
- }
-
- fd = get_native_fd (env, obj);
-
- prot = PROT_READ;
- if (mode == '+' || mode == 'c')
- {
- /* When writing we need to make sure the file is big enough,
- otherwise the result of mmap is undefined. */
- jlong filesize;
- filesize = Java_gnu_java_nio_channels_FileChannelImpl_size(env, obj);
- if (filesize == -1)
- return NULL;
- if (position + size > filesize)
- if (ftruncate(fd, position + size) == -1)
- {
- JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
- return NULL;
- }
- prot |= PROT_WRITE;
- }
-
- flags = (mode == 'c' ? MAP_PRIVATE : MAP_SHARED);
- p = mmap (NULL, (size_t) ALIGN_UP (size, pagesize), prot, flags,
- fd, ALIGN_DOWN (position, pagesize));
- if (p == MAP_FAILED)
- {
- JCL_ThrowException (env, IO_EXCEPTION, strerror (errno));
- return NULL;
- }
-
- /* Unalign the mapped value back up, since we aligned offset
- down to a multiple of the page size. */
- address = (void *) ((char *) p + (position % pagesize));
-
- Pointer_instance = JCL_NewRawDataObject(env, address);
-
- MappedByteBufferImpl_class = (*env)->FindClass (env,
- "java/nio/MappedByteBufferImpl");
- if (MappedByteBufferImpl_class != NULL)
- {
- MappedByteBufferImpl_init =
- (*env)->GetMethodID (env, MappedByteBufferImpl_class,
- "<init>", "(Lgnu/classpath/Pointer;IZ)V");
- }
-
- if ((*env)->ExceptionOccurred (env))
- {
- munmap (p, ALIGN_UP (size, pagesize));
- return NULL;
- }
- if (MappedByteBufferImpl_init == NULL)
- {
- JCL_ThrowException (env, "java/lang/InternalError",
- "could not get MappedByteBufferImpl constructor");
- munmap (p, ALIGN_UP (size, pagesize));
- return NULL;
- }
-
- buffer = (*env)->NewObject (env, MappedByteBufferImpl_class,
- MappedByteBufferImpl_init, Pointer_instance,
- (jint) size, mode == 'r');
- return buffer;
-#else
- (void) obj;
- (void) mode;
- (void) position;
- (void) size;
- JCL_ThrowException (env, IO_EXCEPTION,
- "memory-mapped files not implemented");
- return 0;
-#endif /* HAVE_MMAP */
-}
-
-/*
- * Read a single byte from the file descriptor
- * Return byte read or -1 on eof, exception on error
- */
-JNIEXPORT jint JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_read__ (JNIEnv * env, jobject obj)
-{
- int native_fd;
- char data;
- ssize_t bytes_read;
- int result;
-
- native_fd = get_native_fd (env, obj);
-
- bytes_read = 0;
- do
- {
- TARGET_NATIVE_FILE_READ (native_fd, &data, 1, bytes_read, result);
- if ((result == TARGET_NATIVE_OK) && (bytes_read == 0))
- {
- return (-1);
- }
- if ((result != TARGET_NATIVE_OK)
- && (TARGET_NATIVE_LAST_ERROR () !=
- TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL))
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- return (-1);
- }
- }
- while (result != TARGET_NATIVE_OK);
-
- return ((jint) (data & 0xFF));
-}
-
-/*
- * Reads to a byte buffer from the specified file descriptor
- * Return number of bytes read or -1 on eof, exception on error
- */
-JNIEXPORT jint JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_read___3BII (JNIEnv * env,
- jobject obj,
- jbyteArray buffer,
- jint offset,
- jint length)
-{
- int native_fd;
- jbyte *bufptr;
- ssize_t bytes_read;
- ssize_t n;
- int result;
-
- native_fd = get_native_fd (env, obj);
-
- /* Must return 0 if an attempt is made to read 0 bytes. */
- if (length == 0)
- return 0;
-
- if (offset < 0)
- {
- JCL_ThrowException (env, IO_EXCEPTION, "negative offset");
- return -1;
- }
-
- bufptr = (*env)->GetByteArrayElements (env, buffer, 0);
- if (!bufptr)
- {
- JCL_ThrowException (env, IO_EXCEPTION, "Unexpected JNI error");
- return (-1);
- }
-
- if (length + offset > (*env)->GetArrayLength (env, buffer))
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- "length + offset > buffer.length");
- return -1;
- }
-
- bytes_read = 0;
- do
- {
- TARGET_NATIVE_FILE_READ (native_fd, (bufptr + offset + bytes_read),
- (length - bytes_read), n, result);
- if ((result == TARGET_NATIVE_OK) && (n == 0))
- {
- (*env)->ReleaseByteArrayElements (env, buffer, bufptr, 0);
- if (bytes_read == 0)
- return -1; /* Signal end of file to Java */
- else
- return CONVERT_SSIZE_T_TO_JINT (bytes_read);
- }
- if ((result != TARGET_NATIVE_OK)
- && (TARGET_NATIVE_LAST_ERROR () !=
- TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL))
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- (*env)->ReleaseByteArrayElements (env, buffer, bufptr, 0);
- return -1;
- }
- if (result == TARGET_NATIVE_OK)
- bytes_read += n;
- }
- while (bytes_read < 1);
-
- (*env)->ReleaseByteArrayElements (env, buffer, bufptr, 0);
- return CONVERT_SSIZE_T_TO_JINT (bytes_read);
-}
-
-/*
- * Writes a single byte to the specified file descriptor
- * Return status code, exception on error
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_write__I (JNIEnv * env,
- jobject obj, jint b)
-{
- int native_fd;
- char native_data;
- ssize_t bytes_written;
- int result;
-
- native_fd = get_native_fd (env, obj);
- native_data = (char) (CONVERT_JINT_TO_INT (b) & 0xFF);
-
- do
- {
- TARGET_NATIVE_FILE_WRITE (native_fd, &native_data, 1, bytes_written,
- result);
- if ((result != TARGET_NATIVE_OK)
- && (TARGET_NATIVE_LAST_ERROR () !=
- TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL))
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- return;
- }
- }
- while (result != TARGET_NATIVE_OK);
-}
-
-/*
- * Copies all parts of a file to disk.
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_force (JNIEnv * env,
- jobject obj)
-{
- int native_fd;
- int result;
- native_fd = get_native_fd (env, obj);
- TARGET_NATIVE_FILE_FSYNC (native_fd, result);
- if (result != TARGET_NATIVE_OK)
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
-}
-
-/*
- * Writes a byte buffer to the specified file descriptor
- * Return status code, exception on error
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_write___3BII (JNIEnv * env,
- jobject obj,
- jbyteArray buffer,
- jint offset,
- jint length)
-{
- int native_fd;
- jbyte *bufptr;
- ssize_t bytes_written;
- ssize_t n;
- int result;
-
- native_fd = get_native_fd (env, obj);
-
- /* Just return if an attempt is made to write 0 bytes. */
- if (length == 0)
- return;
-
- bufptr = (*env)->GetByteArrayElements (env, buffer, 0);
- if (!bufptr)
- {
- JCL_ThrowException (env, IO_EXCEPTION, "Unexpected JNI error");
- return;
- }
-
- bytes_written = 0;
- while (bytes_written < CONVERT_JINT_TO_SSIZE_T (length))
- {
- TARGET_NATIVE_FILE_WRITE (native_fd, (bufptr + offset + bytes_written),
- (length - bytes_written), n, result);
- if ((result != TARGET_NATIVE_OK)
- && (TARGET_NATIVE_LAST_ERROR () !=
- TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL))
- {
- JCL_ThrowException (env, IO_EXCEPTION,
- TARGET_NATIVE_LAST_ERROR_STRING ());
- (*env)->ReleaseByteArrayElements (env, buffer, bufptr, 0);
- return;
- }
- if (result == TARGET_NATIVE_OK)
- bytes_written += n;
- }
-
- (*env)->ReleaseByteArrayElements (env, buffer, bufptr, 0);
-}
-
-JNIEXPORT jboolean JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_lock (JNIEnv *env, jobject obj,
- jlong position, jlong size,
- jboolean shared, jboolean wait)
-{
-#ifdef HAVE_FCNTL
- int fd = get_native_fd (env, obj);
- int cmd = wait ? F_SETLKW : F_SETLK;
- struct flock flock;
- int ret;
-
- flock.l_type = shared ? F_RDLCK : F_WRLCK;
- flock.l_whence = SEEK_SET;
- flock.l_start = (off_t) position;
- /* Long.MAX_VALUE means lock everything possible starting at pos. */
- if (size == 9223372036854775807LL)
- flock.l_len = 0;
- else
- flock.l_len = (off_t) size;
-
- ret = fcntl (fd, cmd, &flock);
- /* fprintf(stderr, "fd %d, wait %d, shared %d, ret %d, position %lld, size %lld, l_start %ld, l_len %ld\n", fd, wait, shared,ret, position, size, (long) flock.l_start, (long) flock.l_len); */
- if (ret)
- {
- /* Linux man pages for fcntl state that errno might be either
- EACCES or EAGAIN if we try F_SETLK, and another process has
- an overlapping lock. We should not get an unexpected errno. */
- if (errno != EACCES && errno != EAGAIN)
- {
- JCL_ThrowException (env, "java/lang/InternalError",
- strerror (errno));
- }
- return JNI_FALSE;
- }
- return JNI_TRUE;
-#else
- (void) obj;
- (void) position;
- (void) size;
- (void) shared;
- (void) wait;
- JCL_ThrowException (env, "java/lang/UnsupportedOperationException",
- "file locks not implemented on this platform");
- return JNI_FALSE;
-#endif /* HAVE_FCNTL */
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_nio_channels_FileChannelImpl_unlock (JNIEnv *env,
- jobject obj,
- jlong position,
- jlong length)
-{
-#ifdef HAVE_FCNTL
- int fd = get_native_fd (env, obj);
- struct flock flock;
- int ret;
-
- flock.l_type = F_UNLCK;
- flock.l_whence = SEEK_SET;
- flock.l_start = (off_t) position;
- /* Long.MAX_VALUE means unlock everything possible starting at pos. */
- if (length == 9223372036854775807LL)
- flock.l_len = 0;
- else
- flock.l_len = (off_t) length;
-
- ret = fcntl (fd, F_SETLK, &flock);
- if (ret)
- {
- JCL_ThrowException (env, "java/lang/InternalError",
- strerror (errno));
- }
-#else
- (void) obj;
- (void) position;
- (void) length;
- JCL_ThrowException (env, "java/lang/UnsupportedOperationException",
- "file locks not implemented on this platform");
-#endif /* HAVE_FCNTL */
-}
diff --git a/libjava/classpath/native/jni/java-nio/java_nio_MappedByteBufferImpl.c b/libjava/classpath/native/jni/java-nio/java_nio_MappedByteBufferImpl.c
index b4909198267..2a87d29507e 100644
--- a/libjava/classpath/native/jni/java-nio/java_nio_MappedByteBufferImpl.c
+++ b/libjava/classpath/native/jni/java-nio/java_nio_MappedByteBufferImpl.c
@@ -1,5 +1,5 @@
/* java_nio_MappedByteBufferImpl.c - Native methods for MappedByteBufferImpl
- Copyright (C) 2004,2005 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-
+
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -43,7 +43,6 @@ exception statement from your version. */
#include "java_nio_MappedByteBufferImpl.h"
-#include <errno.h>
#include <string.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
diff --git a/libjava/classpath/native/jni/java-nio/javanio.c b/libjava/classpath/native/jni/java-nio/javanio.c
new file mode 100644
index 00000000000..d9e4d4f1d95
--- /dev/null
+++ b/libjava/classpath/native/jni/java-nio/javanio.c
@@ -0,0 +1,122 @@
+/* javanio.c -- implementations of functions in javanio.h.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+/*
+ * Note, because these functions are trivial, and should be inlined,
+ * we include this file in the header, and do not compile it.
+ */
+
+#include <sys/types.h>
+#include <sys/fcntl.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+#include <unistd.h>
+
+CPNIO_EXPORT ssize_t
+cpnio_read (int fd, void *buf, size_t nbytes)
+{
+ return read (fd, buf, nbytes);
+}
+
+CPNIO_EXPORT ssize_t
+cpnio_readv (int fd, const struct iovec *iov, int iovcnt)
+{
+ return readv (fd, iov, iovcnt);
+}
+
+CPNIO_EXPORT ssize_t
+cpnio_write (int fd, const void *buf, size_t nbytes)
+{
+ return write (fd, buf, nbytes);
+}
+
+CPNIO_EXPORT ssize_t
+cpnio_writev (int fd, const struct iovec *iov, size_t iovcnt)
+{
+ return writev (fd, iov, iovcnt);
+}
+
+CPNIO_EXPORT int
+cpnio_socket (int domain, int type, int protocol)
+{
+ return socket (domain, type, protocol);
+}
+
+CPNIO_EXPORT int
+cpnio_connect (int fd, const struct sockaddr *addr, socklen_t addrlen)
+{
+ return connect (fd, addr, addrlen);
+}
+
+CPNIO_EXPORT int
+cpnio_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
+{
+ return accept (fd, addr, addrlen);
+}
+
+CPNIO_EXPORT ssize_t
+cpnio_sendto (int fd, const void *msg, size_t len, int flags,
+ const struct sockaddr *to, socklen_t tolen)
+{
+ return sendto (fd, msg, len, flags, to, tolen);
+}
+
+CPNIO_EXPORT ssize_t
+cpnio_recvfrom (int fd, void *buf, size_t len, int flags,
+ struct sockaddr *from, socklen_t *fromlen)
+{
+ return recvfrom (fd, buf, len, flags, from, fromlen);
+}
+
+CPNIO_EXPORT int
+cpnio_fcntl (int fd, int cmd, long arg)
+{
+#ifdef HAVE_FCNTL
+ return fcntl (fd, cmd, arg);
+#else
+ errno = ENOSUP;
+ return -1;
+#endif /* HAVE_FCNTL */
+}
+
+CPNIO_EXPORT int
+cpnio_select (int nfds, fd_set *readfds, fd_set *writefds,
+ fd_set *excepfds, struct timeval *timeo)
+{
+ return select (nfds, readfds, writefds, excepfds, timeo);
+}
diff --git a/libjava/classpath/native/jni/java-nio/javanio.h b/libjava/classpath/native/jni/java-nio/javanio.h
new file mode 100644
index 00000000000..bdd11055ea8
--- /dev/null
+++ b/libjava/classpath/native/jni/java-nio/javanio.h
@@ -0,0 +1,332 @@
+/* javanio.h -- reference implementation of native functions.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is a part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+#ifndef __JAVANIO_H__
+#define __JAVANIO_H__
+
+/**
+ * This header defines functions that are called by our JNI reference
+ * implementation of java.nio.*. In our reference implementation, these
+ * functions map exactly to their counterparts in POSIX; in implementations
+ * that can't use these functions directly (such as systems that use user-land
+ * threads, and thus can't call blocking system calls directly) can provide
+ * their own implementations suitable for their system.
+ */
+
+/**
+ * This macro is used in all function prototypes below; if any additional
+ * keywords need to be added to a prototype, declare them in this macro.
+ */
+#define CPNIO_EXPORT static inline
+
+/**
+ * Read bytes from the given file descriptor into the given memory address, which
+ * has sufficient space for NBYTES bytes.
+ *
+ * \param fd The file descriptor to read from.
+ * \param buf The memory address to read bytes into.
+ * \param nbytes The number of bytes available to store in BUF.
+ * \return The number of bytes read, possibly zero, on success; return -1 on failure,
+ * and set ERRNO to an appropriate value.
+ * \see read(2)
+ *
+ * Allowed errno values:
+ * [EBADF] If FD is not a valid file descriptor, or is not open for reading.
+ * [EFAULT] If BUF points outside the process's address space.
+ * [EIO] An I/O error occurrs.
+ * [EINTR] If the read is interrupted by a signal.
+ * [EINVAL] If FD is negative.
+ * [EAGAIN] If FD was marked for non-blocking I/O, and no data were ready to
+ * be read.
+ */
+CPNIO_EXPORT ssize_t cpnio_read (int fd, void *buf, size_t nbytes);
+
+/*
+ * Read bytes from a file descriptor into a sequence of IO buffers.
+ *
+ * The iovec structure is defined as:
+ *
+ * struct iovec {
+ * char *iov_base;
+ * size_t iov_len;
+ * };
+ *
+ * The call to _cp_readv should do a scattering read, where for each struct iovec
+ * in the supplied list, up to IOV_LEN bytes are read into IOV_BASE. The function
+ * returns the total number of bytes read into all supplied buffers.
+ *
+ * \param fd The file descriptor.
+ * \param iov A pointer to the head of a list of iovec structures.
+ * \param iovcnt The number of iovec structures pointed to by IOV.
+ * \return The total number of bytes read accross all buffers, possibly zero. On
+ * error, -1 is returned and ERRNO is set.
+ * \see readv(2)
+ *
+ * Allowed ERRNO values include all of those listed for _cp_read, as well as the
+ * following:
+ * [EINVAL] If IOVCNT overflows the maximum number of iovec structures
+ * this platform supports (usually 16), if any IOV_LEN value
+ * is negative, or if the sum of all IOV_LEN values is too
+ * large to be stored in a ssize_t (usually a 32-bit integer).
+ * [EFAULT] If part of IOV points outside the process's address space.
+ */
+CPNIO_EXPORT ssize_t cpnio_readv (int fd, const struct iovec *iov, int iovcnt);
+
+/*
+ * Write NBYTES bytes from BUF to the file descriptor FD, returning the number
+ * of bytes successfully written.
+ *
+ * \param fd The file descriptor.
+ * \param buf A pointer to the bytes to write.
+ * \param nbytes The maximum number of bytes to write.
+ * \return The number of bytes written to the file descriptor, possibly zero. -1
+ * is returned if an error is encountered, and ERRNO will be set.
+ * \see write(2)
+ *
+ * Allowed ERRNO values:
+ * [EBADF] If FD is not a valid file descriptor or is not open for writing.
+ * [EPIPE] If FD is a pipe, when the other side is disconnected; if FD is a
+ * socket, when the peer is not connected.
+ * [EFBIG] When FD is a file, and writing to it overflows the process's
+ * or the system's maximim file size.
+ * [EFAULT] If the buffer to write points outside the process's address
+ * space.
+ * [EINVAL] If the descriptor FD is negative.
+ * [ENOSPC] If FD is a file, and there is insufficient space on the
+ * filesystem.
+ * [EDQUOT] If FD is a file, and the user's disk quota has been exceeded.
+ * [EIO] If an I/O error occurs.
+ * [EINTR] If the call is interrupted by a signal.
+ * [EAGAIN] If FD is in non-blocking mode, and no bytes could be immediately
+ * written.
+ */
+CPNIO_EXPORT ssize_t cpnio_write (int fd, const void *buf, size_t nbytes);
+
+/*
+ * Write data from a sequence of IOVCNT buffers IOV to a file descriptor FD.
+ *
+ * \param fd The file descriptor.
+ * \param iov The list of buffers to write.
+ * \param iovcnt The number of iovec structures pointed to by IOV.
+ * \return The total number of bytes written from the given buffers, possibly
+ * zero. -1 if an error occurs, and ERRNO will be set.
+ * \see writev(2)
+ *
+ * Allowed ERRNO values include those mentioned in _cp_write, as well as:
+ * [EDESTADDRREQ] If the descriptor is a datagram socket, and the peer is
+ * no longer available.
+ * [EINVAL] If IOVCNT is out of range, if any IOV_LEN value is
+ * negative, or if the sum of all IOVCNT IOV_LEN values
+ * will overflow a ssize_t.
+ * [ENOBUFS] If the mbuf pool is exhausted (???).
+ */
+CPNIO_EXPORT ssize_t cpnio_writev (int fd, const struct iovec *iov, size_t iovcnt);
+
+/**
+ * Open a new, unbound and unconnected socket.
+ *
+ * \param domain The socket domain. Implementations need only handle AF_INET.
+ * \param type The socket type; implementations need only handle types
+ * SOCK_STREAM (for streaming sockets) and SOCK_DGRAM (for datagram sockets).
+ * \param protocol This should always be 0. It can be ignored.
+ * \return A new file descriptor pointing to a newly created socket, or -1 on
+ * error, and ERRNO set.
+ *
+ * Allowed ERRNO values:
+ * [EPROTONOSUPPORT] If TYPE is unrecognized.
+ * [EMFILE] If a new file descriptor cannot be allocated, because
+ * the process's descriptor table is full.
+ * [ENFILE] Likewise, but when the system table is full.
+ * [EACCES] If this operation is not allowed.
+ * [ENOBUFS] If there is not enough buffer space available for the
+ * new socket.
+ */
+CPNIO_EXPORT int cpnio_socket (int domain, int type, int protocol);
+
+/**
+ * Connect a socket to a remote address.
+ *
+ * \param fd The file descriptor of the socket to connect.
+ * \param addr The address to connect to. In practice, this should be
+ * either a `struct sockaddr_in' or a `struct sockaddr_in6'.
+ * \param addrlen The size of the address structure passed by ADDR.
+ * \return Zero if the connect succeeds. -1 on error, and ERRNO should be set.
+ *
+ * Allowed ERRNO values:
+ * [EBADF] If FD is not a valid file descriptor.
+ * [ENOTSOCK] If FD is not a socket descriptor.
+ * [EADDRNOTAVAIL] If ADDR is not available for use to this process.
+ * [EAFNOSUPPORT] If the address family of ADDR is not supported.
+ * [EISCONN] If the socket is already connected.
+ * [ETIMEDOUT] If the connection could not be made in a reasonable
+ * amount of time.
+ * [ECONNREFUSED] If the connection attempt was rejected.
+ * [ENETUNREACH] If the network ADDR is on is unreachable.
+ * [EADDRINUSE] If the address is already in use.
+ * [EFAULT] If ADDR points outside the addressable space.
+ * [EINPROGRESS] If FD is in non-blocking mode, and the connection could
+ * not be completed immediately.
+ * [EALREADY] If FD is in non-blocking mode, and a connection attempt
+ * is still pending.
+ * [EACCESS] If ADDR is the broadcast address, and the socket option
+ * SO_BROADCAST is not set.
+ */
+CPNIO_EXPORT int cpnio_connect (int fd, const struct sockaddr *addr, socklen_t addrlen);
+
+/**
+ * Accept an incoming connection on a socket, returning a new socket for
+ * the connection, and storing the peer address in ADDR.
+ *
+ * \param fd The socket file descriptor.
+ * \param addr The structure to store the peer address in.
+ * \param addrlen The size of the data available in ADDR; upon return, the
+ * number of bytes stored in ADDR will be placed here.
+ * \return The new socket file descriptor, or -1 on error, and ERRNO set.
+ *
+ * Allowed ERRNO values:
+ * [EBADF] If FD is not a valid file descriptor.
+ * [ENOTSOCK] If FD in not a socket descriptor.
+ * [EOPNOTSUPP] If the socket is not a SOCK_STREAM socket.
+ * [EFAULT] If ADDR points outside the process's addressable space.
+ * [EWOULDBLOCK] If the socket is in non-blocking mode, and no connection
+ * attempt is currently ready.
+ * [EMFILE] If the process's descriptor table is full.
+ * [ENFILE] If the system's descriptor table is full.
+ */
+CPNIO_EXPORT int cpnio_accept (int fd, struct sockaddr *addr, socklen_t *addrlen);
+
+/**
+ * Send a datagram to the given address.
+ *
+ * \param fd The socket file descriptor.
+ * \param msg A pointer to the message to send.
+ * \param len The size of the message to send.
+ * \param flags Flags for sending.
+ * \param to The remote address to send the message to.
+ * \param tolen The size of the TO address structure.
+ * \return The number of bytes written, possibly zero, on success. Returns
+ * -1 on failure, and sets ERRNO.
+ * \see sendto(2)
+ *
+ * Allowed ERRNO values:
+ * [EBADF]
+ * [ENOTSOCK]
+ * [EFAULT]
+ * [EMSGSIZE]
+ * [EAGAIN]
+ * [ENOBUFS]
+ * [EACCES]
+ * [EHOSTUNREACH]
+ */
+CPNIO_EXPORT ssize_t cpnio_sendto (int fd, const void *msg, size_t len, int flags,
+ const struct sockaddr *to, socklen_t tolen);
+
+/**
+ * Receive a message on a socket, storing the remote host's address in
+ * FROM.
+ *
+ * \param fd The socket file descriptor.
+ * \param buf The buffer to store received bytes in.
+ * \param flags Flags to control the receive.
+ * \param from Where to store the remote address.
+ * \param fromlen Pointer to the size of FROM; on return, it will contain the
+ * size of the structure placed in FROM.
+ * \return The number of bytes received on success. -1 on error, and ERRNO will
+ * be set.
+ * \see recvfrom(2)
+ *
+ * Allewed ERRNO values:
+ * [EBADF] FD is not a valid file descriptor.
+ * [ENOTCONN] If the socket is stream-oriented, and no prior call to
+ * connect(2) was made.
+ * [ENOTSOCK] FD is not a socket.
+ * [EAGAIN] FD is in non-blocking mode, and no message was
+ * immediately available.
+ * [EINTR] The system call was interrupted by a signal.
+ * [EFAULT] BUF, FROM, or FROMLEN lie outside the process's address
+ * space.
+ */
+CPNIO_EXPORT ssize_t cpnio_recvfrom (int fd, void *buf, size_t len, int flags,
+ struct sockaddr *from, socklen_t *fromlen);
+
+
+/**
+ * Control file descriptor properties.
+ *
+ * \param fd The file descriptor to control.
+ * \param cmd The command to execute.
+ * \param arg The command argument.
+ * \return A value other than -1, specific to CMD. On error, -1 is
+ * returned, and ERRNO is set.
+ *
+ * Allowed ERRNO values:
+ * FIXME
+ */
+CPNIO_EXPORT int cpnio_fcntl (int fd, int cmd, long arg);
+
+
+/**
+ * Select from one of the given file descriptor sets a descriptor that
+ * is ready for the given operation (read, write, etc.).
+ *
+ * \param nfds A value one larger than the largest file
+ * descriptor.
+ * \param readfds A set of file descriptors to select for
+ * readability.
+ * \param writefds A set of file descriptors to select for
+ * writability.
+ * \param exceptfds A set of file descriptors to select for
+ * exceptional conditions.
+ * \param tm The selection timeout.
+ * \return The number of file descriptors selected, possibly zero, or
+ * -1 on error (and with ERRNO set).
+ */
+CPNIO_EXPORT int cpnio_select (int nfds, fd_set *readfds, fd_set *writefds,
+ fd_set *exceptfds, struct timeval *tm);
+
+/*
+ * We include the implementation file here, because our reference
+ * implementation is trivial, and the functions are declared extern
+ * inline.
+ *
+ * Implementations that need different implementations of these functions
+ * SHOULD remove this line, and compile javanio.c as a separate unit.
+ */
+#include "javanio.c"
+
+#endif /* __JAVANIO_H__ */
diff --git a/libjava/classpath/native/jni/java-util/.cvsignore b/libjava/classpath/native/jni/java-util/.cvsignore
new file mode 100644
index 00000000000..e9f2658a694
--- /dev/null
+++ b/libjava/classpath/native/jni/java-util/.cvsignore
@@ -0,0 +1,8 @@
+*.o
+*.a
+*.lo
+*.la
+.libs
+.deps
+Makefile
+Makefile.in
diff --git a/libjava/classpath/native/jni/java-util/Makefile.in b/libjava/classpath/native/jni/java-util/Makefile.in
index a592c5c018e..c929468bd97 100644
--- a/libjava/classpath/native/jni/java-util/Makefile.in
+++ b/libjava/classpath/native/jni/java-util/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -183,6 +185,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -304,7 +308,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
nativeexeclib_LTLIBRARIES = libjavautil.la
libjavautil_la_SOURCES = java_util_VMTimeZone.c
diff --git a/libjava/classpath/native/jni/midi-alsa/.cvsignore b/libjava/classpath/native/jni/midi-alsa/.cvsignore
new file mode 100644
index 00000000000..483b2774465
--- /dev/null
+++ b/libjava/classpath/native/jni/midi-alsa/.cvsignore
@@ -0,0 +1,9 @@
+*.o
+*.a
+*.lo
+*.la
+.libs
+.depsMakefile
+Makefile.in
+Makefile
+.deps
diff --git a/libjava/classpath/native/jni/midi-alsa/Makefile.in b/libjava/classpath/native/jni/midi-alsa/Makefile.in
index 12346cee981..b93d060db20 100644
--- a/libjava/classpath/native/jni/midi-alsa/Makefile.in
+++ b/libjava/classpath/native/jni/midi-alsa/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -186,6 +188,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -307,7 +311,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
nativeexeclib_LTLIBRARIES = libgjsmalsa.la
libgjsmalsa_la_SOURCES = gnu_javax_sound_midi_alsa_AlsaMidiSequencerDevice.c \
diff --git a/libjava/classpath/native/jni/midi-dssi/.cvsignore b/libjava/classpath/native/jni/midi-dssi/.cvsignore
new file mode 100644
index 00000000000..ac18ca27297
--- /dev/null
+++ b/libjava/classpath/native/jni/midi-dssi/.cvsignore
@@ -0,0 +1,9 @@
+*.o
+*.a
+*.lo
+*.la
+.libs
+.depsMakefile
+Makefile.in
+.deps
+Makefile
diff --git a/libjava/classpath/native/jni/midi-dssi/Makefile.am b/libjava/classpath/native/jni/midi-dssi/Makefile.am
index 48c8051ccc3..692579d46b3 100644
--- a/libjava/classpath/native/jni/midi-dssi/Makefile.am
+++ b/libjava/classpath/native/jni/midi-dssi/Makefile.am
@@ -9,4 +9,7 @@ libgjsmdssi_la_LDFLAGS = -avoid-version
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
-AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
+# No STRICT_WARNING_CFLAGS here as we use dlsym to load the address of
+# a function,and ISO C prohibits casting void pointers, like those returned
+# by dlsym, to function pointers.
+AM_CFLAGS = @WARNING_CFLAGS@ @ERROR_CFLAGS@
diff --git a/libjava/classpath/native/jni/midi-dssi/Makefile.in b/libjava/classpath/native/jni/midi-dssi/Makefile.in
index 053451be6e5..e6c42fa7782 100644
--- a/libjava/classpath/native/jni/midi-dssi/Makefile.in
+++ b/libjava/classpath/native/jni/midi-dssi/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -186,6 +188,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -307,7 +311,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
nativeexeclib_LTLIBRARIES = libgjsmdssi.la
libgjsmdssi_la_SOURCES = gnu_javax_sound_midi_dssi_DSSIMidiDeviceProvider.c \
@@ -318,7 +321,10 @@ libgjsmdssi_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo -ljack
libgjsmdssi_la_LDFLAGS = -avoid-version
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
-AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
+# No STRICT_WARNING_CFLAGS here as we use dlsym to load the address of
+# a function,and ISO C prohibits casting void pointers, like those returned
+# by dlsym, to function pointers.
+AM_CFLAGS = @WARNING_CFLAGS@ @ERROR_CFLAGS@
all: all-am
.SUFFIXES:
diff --git a/libjava/classpath/native/jni/midi-dssi/dssi_data.h b/libjava/classpath/native/jni/midi-dssi/dssi_data.h
index 27a4e283119..f8243f29bd4 100644
--- a/libjava/classpath/native/jni/midi-dssi/dssi_data.h
+++ b/libjava/classpath/native/jni/midi-dssi/dssi_data.h
@@ -46,8 +46,6 @@ exception statement from your version. */
#include <stdio.h>
-#include "target_native.h"
-#include "target_native_misc.h"
#include "../classpath/jcl.h"
/* Specify the size of the circular buffer. It only needs to be big
diff --git a/libjava/classpath/native/jni/native-lib/.cvsignore b/libjava/classpath/native/jni/native-lib/.cvsignore
new file mode 100644
index 00000000000..e9f2658a694
--- /dev/null
+++ b/libjava/classpath/native/jni/native-lib/.cvsignore
@@ -0,0 +1,8 @@
+*.o
+*.a
+*.lo
+*.la
+.libs
+.deps
+Makefile
+Makefile.in
diff --git a/libjava/classpath/native/jni/native-lib/Makefile.am b/libjava/classpath/native/jni/native-lib/Makefile.am
new file mode 100644
index 00000000000..beab77e5732
--- /dev/null
+++ b/libjava/classpath/native/jni/native-lib/Makefile.am
@@ -0,0 +1,12 @@
+noinst_LTLIBRARIES = libclasspathnative.la
+libclasspathnative_la_SOURCES = cpnet.c \
+ cpnet.h \
+ cpio.c \
+ cpio.h \
+ cpnative.h \
+ cpproc.h \
+ cpproc.c
+
+AM_LDFLAGS = @CLASSPATH_MODULE@
+AM_CPPFLAGS = @CLASSPATH_INCLUDES@
+AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
diff --git a/libjava/classpath/native/jni/native-lib/Makefile.in b/libjava/classpath/native/jni/native-lib/Makefile.in
new file mode 100644
index 00000000000..5dda1263e12
--- /dev/null
+++ b/libjava/classpath/native/jni/native-lib/Makefile.in
@@ -0,0 +1,570 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = native/jni/native-lib
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
+ $(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
+ $(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
+ $(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
+ $(top_srcdir)/m4/ax_create_stdint_h.m4 \
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libclasspathnative_la_LIBADD =
+am_libclasspathnative_la_OBJECTS = cpnet.lo cpio.lo cpproc.lo
+libclasspathnative_la_OBJECTS = $(am_libclasspathnative_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libclasspathnative_la_SOURCES)
+DIST_SOURCES = $(libclasspathnative_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
+BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CLASSPATH_CONVENIENCE = @CLASSPATH_CONVENIENCE@
+CLASSPATH_INCLUDES = @CLASSPATH_INCLUDES@
+CLASSPATH_MODULE = @CLASSPATH_MODULE@
+COLLECTIONS_PREFIX = @COLLECTIONS_PREFIX@
+CP = @CP@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CREATE_ALSA_LIBRARIES_FALSE = @CREATE_ALSA_LIBRARIES_FALSE@
+CREATE_ALSA_LIBRARIES_TRUE = @CREATE_ALSA_LIBRARIES_TRUE@
+CREATE_API_DOCS_FALSE = @CREATE_API_DOCS_FALSE@
+CREATE_API_DOCS_TRUE = @CREATE_API_DOCS_TRUE@
+CREATE_COLLECTIONS_FALSE = @CREATE_COLLECTIONS_FALSE@
+CREATE_COLLECTIONS_TRUE = @CREATE_COLLECTIONS_TRUE@
+CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@
+CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@
+CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@
+CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@
+CREATE_GCONF_PEER_LIBRARIES_FALSE = @CREATE_GCONF_PEER_LIBRARIES_FALSE@
+CREATE_GCONF_PEER_LIBRARIES_TRUE = @CREATE_GCONF_PEER_LIBRARIES_TRUE@
+CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@
+CREATE_GTK_PEER_LIBRARIES_TRUE = @CREATE_GTK_PEER_LIBRARIES_TRUE@
+CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
+CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
+CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
+CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
+CREATE_PLUGIN_FALSE = @CREATE_PLUGIN_FALSE@
+CREATE_PLUGIN_TRUE = @CREATE_PLUGIN_TRUE@
+CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
+CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
+CREATE_WRAPPERS_FALSE = @CREATE_WRAPPERS_FALSE@
+CREATE_WRAPPERS_TRUE = @CREATE_WRAPPERS_TRUE@
+CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
+CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+ECJ = @ECJ@
+EGREP = @EGREP@
+ENABLE_LOCAL_SOCKETS_FALSE = @ENABLE_LOCAL_SOCKETS_FALSE@
+ENABLE_LOCAL_SOCKETS_TRUE = @ENABLE_LOCAL_SOCKETS_TRUE@
+ERROR_CFLAGS = @ERROR_CFLAGS@
+EXAMPLESDIR = @EXAMPLESDIR@
+EXEEXT = @EXEEXT@
+FASTJAR = @FASTJAR@
+FIND = @FIND@
+FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
+FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
+FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
+FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
+FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
+FOUND_GCJX_TRUE = @FOUND_GCJX_TRUE@
+FOUND_GCJ_FALSE = @FOUND_GCJ_FALSE@
+FOUND_GCJ_TRUE = @FOUND_GCJ_TRUE@
+FOUND_JIKES_FALSE = @FOUND_JIKES_FALSE@
+FOUND_JIKES_TRUE = @FOUND_JIKES_TRUE@
+FOUND_KJC_FALSE = @FOUND_KJC_FALSE@
+FOUND_KJC_TRUE = @FOUND_KJC_TRUE@
+FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
+FREETYPE2_LIBS = @FREETYPE2_LIBS@
+GCJ = @GCJ@
+GCJX = @GCJX@
+GCONF_CFLAGS = @GCONF_CFLAGS@
+GCONF_LIBS = @GCONF_LIBS@
+GDK_CFLAGS = @GDK_CFLAGS@
+GDK_LIBS = @GDK_LIBS@
+GJDOC = @GJDOC@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
+INSTALL_CLASS_FILES_FALSE = @INSTALL_CLASS_FILES_FALSE@
+INSTALL_CLASS_FILES_TRUE = @INSTALL_CLASS_FILES_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_GLIBJ_ZIP_FALSE = @INSTALL_GLIBJ_ZIP_FALSE@
+INSTALL_GLIBJ_ZIP_TRUE = @INSTALL_GLIBJ_ZIP_TRUE@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
+JAY = @JAY@
+JAY_SKELETON = @JAY_SKELETON@
+JIKES = @JIKES@
+JIKESENCODING = @JIKESENCODING@
+JIKESWARNINGS = @JIKESWARNINGS@
+KJC = @KJC@
+LDFLAGS = @LDFLAGS@
+LIBDEBUG = @LIBDEBUG@
+LIBICONV = @LIBICONV@
+LIBMAGIC = @LIBMAGIC@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBVERSION = @LIBVERSION@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MKDIR = @MKDIR@
+MOC = @MOC@
+MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
+MOZILLA_LIBS = @MOZILLA_LIBS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
+PANGOFT2_LIBS = @PANGOFT2_LIBS@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TO_ESCHER = @PATH_TO_ESCHER@
+PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
+PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
+PLUGIN_DIR = @PLUGIN_DIR@
+QT_CFLAGS = @QT_CFLAGS@
+QT_LIBS = @QT_LIBS@
+RANLIB = @RANLIB@
+REGEN_PARSERS_FALSE = @REGEN_PARSERS_FALSE@
+REGEN_PARSERS_TRUE = @REGEN_PARSERS_TRUE@
+REMOVE = @REMOVE@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRICT_WARNING_CFLAGS = @STRICT_WARNING_CFLAGS@
+STRIP = @STRIP@
+USER_CLASSLIB = @USER_CLASSLIB@
+USER_JAVAH = @USER_JAVAH@
+USER_SPECIFIED_CLASSLIB_FALSE = @USER_SPECIFIED_CLASSLIB_FALSE@
+USER_SPECIFIED_CLASSLIB_TRUE = @USER_SPECIFIED_CLASSLIB_TRUE@
+USER_SPECIFIED_JAVAH_FALSE = @USER_SPECIFIED_JAVAH_FALSE@
+USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
+USE_ESCHER_FALSE = @USE_ESCHER_FALSE@
+USE_ESCHER_TRUE = @USE_ESCHER_TRUE@
+USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
+USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
+VERSION = @VERSION@
+VM_BINARY = @VM_BINARY@
+WARNING_CFLAGS = @WARNING_CFLAGS@
+XML_CFLAGS = @XML_CFLAGS@
+XML_LIBS = @XML_LIBS@
+XSLT_CFLAGS = @XSLT_CFLAGS@
+XSLT_LIBS = @XSLT_LIBS@
+XTEST_LIBS = @XTEST_LIBS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ZIP = @ZIP@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+default_toolkit = @default_toolkit@
+exec_prefix = @exec_prefix@
+glibjdir = @glibjdir@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+nativeexeclibdir = @nativeexeclibdir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+vm_classes = @vm_classes@
+noinst_LTLIBRARIES = libclasspathnative.la
+libclasspathnative_la_SOURCES = cpnet.c \
+ cpnet.h \
+ cpio.c \
+ cpio.h \
+ cpnative.h \
+ cpproc.h \
+ cpproc.c
+
+AM_LDFLAGS = @CLASSPATH_MODULE@
+AM_CPPFLAGS = @CLASSPATH_INCLUDES@
+AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu native/jni/native-lib/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu native/jni/native-lib/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libclasspathnative.la: $(libclasspathnative_la_OBJECTS) $(libclasspathnative_la_DEPENDENCIES)
+ $(LINK) $(libclasspathnative_la_LDFLAGS) $(libclasspathnative_la_OBJECTS) $(libclasspathnative_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpio.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpnet.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpproc.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libjava/classpath/native/jni/native-lib/cpio.c b/libjava/classpath/native/jni/native-lib/cpio.c
new file mode 100644
index 00000000000..2777a31b221
--- /dev/null
+++ b/libjava/classpath/native/jni/native-lib/cpio.c
@@ -0,0 +1,485 @@
+/* cpio.c - Common java file IO native functions
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+/* do not move; needed here because of some macro definitions */
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/types.h>
+#include <dirent.h>
+
+#include <jni.h>
+
+#if defined(HAVE_SYS_IOCTL_H)
+#define BSD_COMP /* Get FIONREAD on Solaris2 */
+#include <sys/ioctl.h>
+#endif
+#if defined(HAVE_SYS_FILIO_H) /* Get FIONREAD on Solaris 2.5 */
+#include <sys/filio.h>
+#endif
+
+#if defined(HAVE_SYS_STAT_H)
+#include <sys/stat.h>
+#endif
+
+#if defined(HAVE_FCNTL_H)
+#include <fcntl.h>
+#endif
+
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+
+#if defined(HAVE_SYS_SELECT_H)
+#include <sys/select.h>
+#endif
+
+#include <utime.h>
+
+#include "cpnative.h"
+#include "cpio.h"
+
+/* Some POSIX systems don't have O_SYNC and O_DYSNC so we define them here. */
+#if !defined (O_SYNC) && defined (O_FSYNC)
+#define O_SYNC O_FSYNC
+#endif
+#if !defined (O_DSYNC) && defined (O_FSYNC)
+#define O_DSYNC O_FSYNC
+#endif
+/* If O_DSYNC is still not defined, use O_SYNC (needed for newlib). */
+#if !defined (O_DSYNC)
+#define O_DSYNC O_SYNC
+#endif
+
+JNIEXPORT int cpio_openFile (const char *filename, int *fd, int flags, int permissions)
+{
+ int sflags = 0;
+ int rwflags = flags & CPFILE_FLAG_READWRITE;
+ int perms;
+
+ if (flags & CPFILE_FLAG_CREATE)
+ sflags |= O_CREAT;
+ if (flags & CPFILE_FLAG_APPEND)
+ sflags |= O_APPEND;
+ if (flags & CPFILE_FLAG_TRUNCATE)
+ sflags |= O_TRUNC;
+ if (flags & CPFILE_FLAG_SYNC)
+ sflags |= O_SYNC;
+ if (flags & CPFILE_FLAG_DSYNC)
+ sflags |= O_DSYNC;
+#if defined(O_BINARY)
+ if (flags & CPFILE_FLAG_BINARY)
+ sflags |= O_BINARY;
+#endif
+
+ switch (rwflags)
+ {
+ case CPFILE_FLAG_READ:
+ sflags |= O_RDONLY;
+ break;
+ case CPFILE_FLAG_WRITE:
+ sflags |= O_WRONLY;
+ break;
+ case CPFILE_FLAG_READWRITE:
+ sflags |= O_RDWR;
+ break;
+ }
+
+ if (permissions == CPFILE_PERMISSION_NORMAL)
+ perms = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
+ else
+ perms = 0;
+
+ *fd = open (filename, sflags, perms);
+
+ if (*fd < 0)
+ return errno;
+
+ return CPNATIVE_OK;
+}
+
+JNIEXPORT int cpio_closeFile (int fd)
+{
+ if (close (fd) < 0)
+ return errno;
+
+ return CPNATIVE_OK;
+}
+
+JNIEXPORT int cpio_availableBytes (int fd, jlong *bytes_available)
+{
+#if defined (FIONREAD)
+ ssize_t n;
+
+ if (ioctl (fd, FIONREAD, (char *)&n) != 0)
+ return errno;
+
+ *bytes_available = n;
+ return CPNATIVE_OK;
+#elif defined(HAVE_FSTAT)
+ struct stat statBuffer;
+ off_t n;
+ int result;
+
+ *bytes_available = 0
+ if ((fstat (fd, &statBuffer) == 0) && S_ISREG (statBuffer.st_mode))
+ {
+ n = lseek (fd, 0, SEEK_CUR);
+ if (n != -1)
+ {
+ *bytes_available = statBuffer.st_size - n;
+ result = 0;
+ }
+ else
+ {
+ result = errno;
+ }
+ }
+ else
+ {
+ result = errno;
+ }
+
+ return result;
+#elif defined(HAVE_SELECT)
+ fd_set filedescriptset;
+ struct timeval tv;
+ int result;
+
+ *bytes_available = 0;
+
+ FD_ZERO (&filedescriptset);
+ FD_SET (fd,&filedescriptset);
+ memset (&tv, 0, sizeof(tv));
+
+ switch (select (fd+1, &filedescriptset, NULL, NULL, &timeval)) \
+ {
+ case -1:
+ result=errno;
+ break;
+ case 0:
+ *bytes_available = 0;
+ result = CPNATIVE_OK;
+ break;
+ default:
+ *bytes_available = 1;
+ result = CPNATIVE_OK;
+ break;
+ }
+ return result;
+
+#else
+ *bytes_available = 0;
+ return ENOTSUP;
+#endif
+}
+
+JNIEXPORT int cpio_getFileSize (int fd, jlong *filesize)
+{
+ struct stat statBuffer;
+
+ if (fstat(fd, &statBuffer) < 0)
+ return errno;
+
+ *filesize = statBuffer.st_size;
+ return CPNATIVE_OK;
+}
+
+JNIEXPORT int cpio_getFilePosition (int fd, jlong *offset)
+{
+ *offset = lseek (fd, 0, SEEK_CUR);
+ if (*offset < 0)
+ return errno;
+
+ return CPNATIVE_OK;
+}
+
+JNIEXPORT int cpio_setFilePosition (int fd, jlong position)
+{
+ if (lseek (fd, position, SEEK_SET) < 0)
+ return errno;
+
+ return CPNATIVE_OK;
+}
+
+JNIEXPORT int cpio_read (int fd, void *buffer, jint length, jint *bytes_read)
+{
+ *bytes_read = read (fd, buffer, length);
+
+ if (*bytes_read < 0)
+ {
+ return errno;
+ }
+
+ return CPNATIVE_OK;
+}
+
+JNIEXPORT int cpio_write (int fd, const void *buffer, jint length, jint *bytes_written)
+{
+ *bytes_written = write (fd, buffer, length);
+
+ if (*bytes_written < 0)
+ return errno;
+
+ return CPNATIVE_OK;
+}
+
+JNIEXPORT int cpio_fsync (int fd)
+{
+ if (fsync (fd) < 0)
+ return errno;
+
+ return CPNATIVE_OK;
+}
+
+JNIEXPORT int cpio_truncate (int fd, jlong size)
+{
+ if (ftruncate (fd, size) < 0)
+ return errno;
+
+ return CPNATIVE_OK;
+}
+
+JNIEXPORT int cpio_setFileSize (int native_fd, jlong new_size)
+{
+ jlong file_size;
+ jlong save_offset;
+ int result;
+ char data;
+ jint bytes_written;
+
+ result = cpio_getFileSize (native_fd, &file_size);
+ if (result != CPNATIVE_OK)
+ return result;
+
+ /* Save off current position */
+ result = cpio_getFilePosition (native_fd, &save_offset);
+ if (result != CPNATIVE_OK)
+ return result;
+
+ if (file_size < new_size)
+ {
+ /* File is too short -- seek to one byte short of where we want,
+ * then write a byte */
+
+ /* move to position n-1 */
+ result = cpio_setFilePosition (native_fd, new_size-1);
+ if (result != CPNATIVE_OK)
+ return result;
+
+ /* write a byte
+ Note: This will fail if we somehow get here in read only mode
+ * That shouldn't happen */
+ data = '\0';
+ result = cpio_write (native_fd, &data, 1, &bytes_written);
+ if (result != CPNATIVE_OK)
+ return result;
+
+ /* Reposition file pointer to where we started if not beyond new len. */
+ if (save_offset < new_size)
+ {
+ result = cpio_setFilePosition (native_fd, save_offset);
+ if (result != CPNATIVE_OK)
+ return result;
+ }
+ }
+ else if (new_size < file_size)
+ {
+ /* File is too long - use ftruncate if available */
+ result = cpio_truncate (native_fd, new_size);
+ if (result != CPNATIVE_OK)
+ return result;
+
+ /* Reposition file pointer when it now is beyond the end of file. */
+ if (new_size < save_offset)
+ {
+ result = cpio_setFilePosition (native_fd, new_size);
+ if (result != CPNATIVE_OK)
+ return result;
+ }
+ }
+
+ return CPNATIVE_OK;
+}
+
+int cpio_setFileReadonly (const char *filename)
+{
+ struct stat statbuf;
+
+ if (stat(filename, &statbuf) < 0)
+ return errno;
+
+ if (chmod(filename, statbuf.st_mode & ~(S_IWRITE | S_IWGRP | S_IWOTH)) < 0)
+ return errno;
+
+ return 0;
+}
+
+int cpio_isFileExists (const char *filename)
+{
+ struct stat statbuf;
+
+ if (stat(filename, &statbuf) < 0)
+ {
+ return errno;
+ }
+
+ return 0;
+}
+
+int cpio_checkType (const char *filename, jint *entryType)
+{
+ struct stat statbuf;
+
+ if (stat(filename, &statbuf) < 0)
+ return errno;
+
+ if (S_ISDIR(statbuf.st_mode))
+ *entryType = CPFILE_DIRECTORY;
+ else
+ *entryType = CPFILE_FILE;
+
+ return 0;
+}
+
+int cpio_getModificationTime (const char *filename, jlong *mtime)
+{
+ struct stat statbuf;
+
+ if (stat(filename, &statbuf) < 0)
+ return errno;
+
+ *mtime = (jlong)statbuf.st_mtime * (jlong)1000;
+
+ return 0;
+}
+
+int cpio_setModificationTime (const char *filename, jlong mtime)
+{
+ struct stat statbuf;
+ struct utimbuf buf;
+
+ if (stat(filename, &statbuf) < 0)
+ return errno;
+
+ buf.actime = statbuf.st_atime;
+ buf.modtime = mtime / 1000;
+
+ if (utime(filename, &buf) < 0)
+ return errno;
+
+ return 0;
+}
+
+int cpio_removeFile (const char *filename)
+{
+ if (unlink(filename) < 0 && rmdir(filename) < 0)
+ return errno;
+
+ return 0;
+}
+
+int cpio_mkdir (const char *path)
+{
+ if (mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO) < 0)
+ return errno;
+
+ return 0;
+}
+
+int cpio_rename (const char *old_name, const char *new_name)
+{
+ if (rename(old_name, new_name) < 0)
+ return errno;
+
+ return 0;
+}
+
+int cpio_openDir (const char *dirname, void **handle)
+{
+ *handle = (void *)opendir(dirname);
+ if (*handle == NULL)
+ return errno;
+
+ return 0;
+}
+
+int cpio_closeDir (void *handle)
+{
+ closedir((DIR *)handle);
+ return 0;
+}
+
+
+int cpio_readDir (void *handle, char *filename)
+{
+#ifdef HAVE_READDIR_R
+ struct dirent dent;
+#endif /* HAVE_READDIR_R */
+ struct dirent *dBuf;
+
+#ifdef HAVE_READDIR_R
+ readdir_r ((DIR *) handle, &dent, &dBuf);
+#else
+ dBuf = readdir((DIR *)handle);
+#endif /* HAVE_READDIR_R */
+
+ if (dBuf == NULL)
+ {
+ /* Some OS's (OS X) return NULL on end-of-dir, but
+ don't set errno to anything. */
+ if (errno == 0)
+ return ENOENT; /* Whatever. */
+ return errno;
+ }
+
+ strncpy (filename, dBuf->d_name, FILENAME_MAX);
+ return 0;
+}
+
+
+int
+cpio_closeOnExec(int fd)
+{
+ if (fcntl (fd, F_SETFD, FD_CLOEXEC) == -1)
+ return errno;
+
+ return 0;
+}
diff --git a/libjava/classpath/native/jni/native-lib/cpio.h b/libjava/classpath/native/jni/native-lib/cpio.h
new file mode 100644
index 00000000000..b388b5b501d
--- /dev/null
+++ b/libjava/classpath/native/jni/native-lib/cpio.h
@@ -0,0 +1,85 @@
+/* cpio.h -
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+#ifndef _CLASSPATH_IO_H_INCLUDED
+#define _CLASSPATH_IO_H_INCLUDED
+
+#include <jni.h>
+
+#define CPFILE_FLAG_CREATE 0x0001
+#define CPFILE_FLAG_APPEND 0x0002
+#define CPFILE_FLAG_TRUNCATE 0x0004
+#define CPFILE_FLAG_SYNC 0x0008
+#define CPFILE_FLAG_DSYNC 0x0010
+#define CPFILE_FLAG_BINARY 0x0020
+#define CPFILE_FLAG_READ 0x0040
+#define CPFILE_FLAG_WRITE 0x0080
+
+#define CPFILE_PERMISSION_NORMAL 1
+
+#define CPFILE_FLAG_READWRITE (CPFILE_FLAG_READ|CPFILE_FLAG_WRITE)
+
+JNIEXPORT int cpio_openFile (const char *filename, int *fd, int flags, int permissions);
+JNIEXPORT int cpio_closeFile (int fd);
+JNIEXPORT int cpio_availableBytes (int fd, jlong *avail);
+JNIEXPORT int cpio_getFileSize (int fd, jlong *filesize);
+JNIEXPORT int cpio_setFileSize (int fd, jlong filesize);
+JNIEXPORT int cpio_getFilePosition (int fd, jlong *position);
+JNIEXPORT int cpio_setFilePosition (int fd, jlong position);
+JNIEXPORT int cpio_read (int fd, void *data, jint len, jint *bytes_read);
+JNIEXPORT int cpio_write (int fd, const void *data, jint len, jint *bytes_written);
+JNIEXPORT int cpio_fsync (int fd);
+JNIEXPORT int cpio_truncate (int fd, jlong size);
+JNIEXPORT int cpio_closeOnExec(int fd);
+
+#define CPFILE_FILE 0
+#define CPFILE_DIRECTORY 1
+
+JNIEXPORT int cpio_setFileReadonly (const char *filename);
+JNIEXPORT int cpio_isFileExists (const char *filename);
+JNIEXPORT int cpio_checkType (const char *filename, jint *entryType);
+JNIEXPORT int cpio_getModificationTime (const char *filename, jlong *mtime);
+JNIEXPORT int cpio_setModificationTime (const char *filename, jlong mtime);
+JNIEXPORT int cpio_removeFile (const char *filename);
+JNIEXPORT int cpio_mkdir (const char *filename);
+JNIEXPORT int cpio_rename (const char *old_name, const char *new_name);
+
+JNIEXPORT int cpio_openDir (const char *dirname, void **handle);
+JNIEXPORT int cpio_closeDir (void *handle);
+JNIEXPORT int cpio_readDir (void *handle, char *filename);
+
+#endif
diff --git a/libjava/classpath/native/jni/native-lib/cpnative.h b/libjava/classpath/native/jni/native-lib/cpnative.h
new file mode 100644
index 00000000000..4ba7726036a
--- /dev/null
+++ b/libjava/classpath/native/jni/native-lib/cpnative.h
@@ -0,0 +1,49 @@
+/* cpnative.h -
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+#ifndef _CLASSPATH_NATIVE_H_INCLUDED
+#define _CLASSPATH_NATIVE_H_INCLUDED
+
+#include <errno.h>
+#include <string.h>
+
+#define CPNATIVE_OK 0
+#define CPNATIVE_EINTR EINTR
+
+#define cpnative_getErrorString strerror
+
+#endif
diff --git a/libjava/classpath/native/jni/native-lib/cpnet.c b/libjava/classpath/native/jni/native-lib/cpnet.c
new file mode 100644
index 00000000000..85c4640e16f
--- /dev/null
+++ b/libjava/classpath/native/jni/native-lib/cpnet.c
@@ -0,0 +1,768 @@
+/* cpnet.c -
+ Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+#include "config.h"
+#include <jni.h>
+#include <assert.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <netdb.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <arpa/inet.h>
+
+#include "cpnet.h"
+
+#define SOCKET_DEFAULT_TIMEOUT -1 /* milliseconds */
+
+#if defined (HAVE_MSG_NOSIGNAL)
+#define SOCKET_NOSIGNAL MSG_NOSIGNAL
+#elif defined (HAVE_SO_NOSIGPIPE)
+#define SOCKET_NOSIGNAL SO_NOSIGPIPE
+#else
+#error "No suitable flag found to ommit a SIGPIPE on signal errors with send()."
+#endif
+
+static int socketTimeouts[FD_SETSIZE];
+
+static jint waitForWritable(jint fd)
+{
+ struct timeval tv;
+ fd_set writeset;
+ int ret;
+
+
+ FD_ZERO(&writeset);
+ FD_SET(fd, &writeset);
+ if (socketTimeouts[fd] > 0)
+ {
+ tv.tv_sec = socketTimeouts[fd] / 1000;
+ tv.tv_usec = (socketTimeouts[fd] % 1000) * 1000;
+ ret = select(fd+1, NULL, &writeset, NULL, &tv);
+ }
+ else
+ ret = select(fd+1, NULL, &writeset, NULL, NULL);
+
+ return (ret <= 0) ? -1 : 0;
+}
+
+static jint waitForReadable(jint fd)
+{
+ struct timeval tv;
+ fd_set readset;
+ int ret;
+
+
+ FD_ZERO(&readset);
+ FD_SET(fd, &readset);
+ if (socketTimeouts[fd] > 0)
+ {
+ tv.tv_sec = socketTimeouts[fd] / 1000;
+ tv.tv_usec = (socketTimeouts[fd] % 1000) * 1000;
+ ret = select(fd+1, &readset, NULL, NULL, &tv);
+ }
+ else
+ ret = select(fd+1, &readset, NULL, NULL, NULL);
+
+ return (ret <= 0) ? -1 : 0;
+}
+
+jint cpnet_openSocketStream(JNIEnv *env UNUSED, jint *fd, jint family)
+{
+ *fd = socket(family, SOCK_STREAM, 0);
+ if (*fd == -1)
+ return errno;
+
+ fcntl(*fd, F_SETFD, FD_CLOEXEC);
+ assert(*fd < FD_SETSIZE);
+ socketTimeouts[*fd] = SOCKET_DEFAULT_TIMEOUT;
+ return 0;
+}
+
+jint cpnet_openSocketDatagram(JNIEnv *env UNUSED, jint *fd, jint family)
+{
+ *fd = socket(family, SOCK_DGRAM, 0);
+ if (*fd == -1)
+ return errno;
+
+ fcntl(*fd, F_SETFD, FD_CLOEXEC);
+ assert(*fd < FD_SETSIZE);
+ socketTimeouts[*fd] = SOCKET_DEFAULT_TIMEOUT;
+ return 0;
+}
+
+jint cpnet_shutdown (JNIEnv *env UNUSED, jint fd, jbyte flag)
+{
+ int ret;
+ int shut_flag = 0;
+
+ if (flag == CPNET_SHUTDOWN_READ)
+ shut_flag = SHUT_RD;
+ else if (flag == CPNET_SHUTDOWN_WRITE)
+ shut_flag = SHUT_WR;
+
+ ret = shutdown (fd, shut_flag);
+ if (ret != 0)
+ return errno;
+ return 0;
+}
+
+jint cpnet_close(JNIEnv *env UNUSED, jint fd)
+{
+ if (close (fd) != 0)
+ return errno;
+ return 0;
+}
+
+jint cpnet_listen(JNIEnv *env UNUSED, jint fd, jint queuelen)
+{
+ if (listen (fd, queuelen) != 0)
+ return errno;
+ return 0;
+}
+
+jint cpnet_accept(JNIEnv *env UNUSED, jint fd, jint *newfd)
+{
+ if (waitForReadable (fd) < 0)
+ return ETIMEDOUT;
+
+ *newfd = accept(fd, NULL, 0);
+ if (*newfd != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_bind(JNIEnv *env UNUSED, jint fd, cpnet_address *addr)
+{
+ int ret;
+
+ ret = bind(fd, (struct sockaddr *)addr->data, addr->len);
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_connect(JNIEnv *env UNUSED, jint fd, cpnet_address *addr)
+{
+ int ret;
+
+ /* TODO: implement socket time out */
+ ret = connect(fd, (struct sockaddr *)addr->data, addr->len);
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_getLocalAddr(JNIEnv *env, jint fd, cpnet_address **addr)
+{
+ socklen_t slen = 1024;
+ int ret;
+
+ *addr = JCL_malloc(env, slen);
+
+ slen -= sizeof(jint);
+ ret = getsockname(fd, (struct sockaddr *)(*addr)->data, &slen );
+ if (ret != 0)
+ {
+ int err = errno;
+ JCL_free(env, *addr);
+ return err;
+ }
+
+ (*addr)->len = slen;
+
+ return 0;
+}
+
+jint cpnet_getRemoteAddr(JNIEnv *env, jint fd, cpnet_address **addr)
+{
+ socklen_t slen = 1024;
+ int ret;
+
+ *addr = JCL_malloc(env, slen);
+
+ slen -= sizeof(jint);
+ ret = getpeername(fd, (struct sockaddr *)(*addr)->data, &slen );
+ if (ret != 0)
+ {
+ int err = errno;
+ JCL_free(env, *addr);
+ return err;
+ }
+
+ (*addr)->len = slen;
+
+ return 0;
+}
+
+jint cpnet_setBroadcast(JNIEnv *env UNUSED, jint fd, jint flag)
+{
+ int ret;
+
+ ret = setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &flag, sizeof(flag));
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_send (JNIEnv *env UNUSED, jint fd, jbyte *data, jint len, jint *bytes_sent)
+{
+ ssize_t ret;
+
+ if (waitForWritable(fd) < 0)
+ return ETIMEDOUT;
+
+ ret = send(fd, data, len, SOCKET_NOSIGNAL);
+ if (ret < 0)
+ return errno;
+
+ *bytes_sent = ret;
+
+ return 0;
+}
+
+jint cpnet_sendTo (JNIEnv *env UNUSED, jint fd, jbyte *data, jint len, cpnet_address *addr, jint *bytes_sent)
+{
+ ssize_t ret;
+
+ if (waitForWritable(fd) < 0)
+ return ETIMEDOUT;
+
+ ret = sendto(fd, data, len, SOCKET_NOSIGNAL, (struct sockaddr *)addr->data,
+ addr->len);
+ if (ret < 0)
+ return errno;
+
+ *bytes_sent = ret;
+ return 0;
+}
+
+jint cpnet_recv (JNIEnv *env UNUSED, jint fd, jbyte *data, jint len, jint *bytes_recv)
+{
+ ssize_t ret;
+
+ if (waitForReadable(fd) < 0)
+ return ETIMEDOUT;
+
+ ret = recv(fd, data, len, 0);
+ if (ret < 0)
+ return errno;
+
+ *bytes_recv = ret;
+
+ return 0;
+}
+
+jint cpnet_recvFrom (JNIEnv *env, jint fd, jbyte *data, jint len, cpnet_address **addr, jint *bytes_recv)
+{
+ socklen_t slen = 1024;
+ ssize_t ret;
+
+ if (waitForReadable(fd) < 0)
+ return ETIMEDOUT;
+
+ *addr = JCL_malloc(env, slen);
+
+ slen -= sizeof(jint);
+ ret = recvfrom(fd, data, len, 0, (struct sockaddr *) (*addr)->data, &slen);
+ if (ret < 0)
+ {
+ int err = errno;
+ JCL_free(env, *addr);
+ return err;
+ }
+
+ (*addr)->len = slen;
+ *bytes_recv = ret;
+
+ return 0;
+}
+
+jint cpnet_setSocketTCPNoDelay (JNIEnv *env UNUSED, jint fd, jint nodelay)
+{
+ socklen_t len = sizeof(jint);
+ int ret;
+
+ ret = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &nodelay, len);
+ if (ret < 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_getSocketTCPNoDelay (JNIEnv *env UNUSED, jint fd, jint *nodelay)
+{
+ socklen_t len = sizeof(jint);
+ int ret;
+
+ ret = getsockopt(fd, IPPROTO_TCP, TCP_NODELAY, nodelay, &len);
+ if (ret < 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_setLinger (JNIEnv *env UNUSED, jint fd, jint flag, jint value)
+{
+ socklen_t len = sizeof(struct linger);
+ int ret;
+ struct linger __linger;
+
+ if (flag)
+ {
+ __linger.l_onoff = 0;
+ }
+ else
+ {
+ __linger.l_linger = value;
+ __linger.l_onoff = 1;
+ }
+
+ ret = setsockopt(fd, SOL_SOCKET, SO_LINGER, &__linger, len);
+ if (ret < 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_getLinger (JNIEnv *env UNUSED, jint fd, jint *flag, jint *value)
+{
+ socklen_t slen = sizeof(struct linger);
+ struct linger __linger;
+ int ret;
+
+ ret = getsockopt(fd, SOL_SOCKET, SO_LINGER, &__linger, &slen);
+ if (ret != 0)
+ return errno;
+
+ *flag = __linger.l_onoff;
+ *value = __linger.l_linger;
+
+ return ret;
+}
+
+jint cpnet_setSocketTimeout (JNIEnv *env UNUSED, jint fd, jint value)
+{
+ socketTimeouts[fd] = value;
+ return 0;
+}
+
+jint cpnet_getSocketTimeout (JNIEnv *env UNUSED, jint fd, jint *value)
+{
+ *value = socketTimeouts[fd];
+ return 0;
+}
+
+jint cpnet_setSendBuf (JNIEnv *env UNUSED, jint fd, jint value)
+{
+ int ret;
+
+ ret = setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &value, sizeof(value));
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_getSendBuf (JNIEnv *env UNUSED, jint fd, jint *value)
+{
+ int ret;
+ socklen_t slen = sizeof(*value);
+
+ ret = getsockopt(fd, SOL_SOCKET, SO_SNDBUF, value, &slen);
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_setRecvBuf (JNIEnv *env UNUSED, jint fd, jint value)
+{
+ int ret;
+
+ ret = setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &value, sizeof(value));
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_getRecvBuf (JNIEnv *env UNUSED, jint fd, jint *value)
+{
+ int ret;
+ socklen_t slen = sizeof(*value);
+
+ ret = getsockopt(fd, SOL_SOCKET, SO_RCVBUF, value, &slen);
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_setTTL (JNIEnv *env UNUSED, jint fd, jint value)
+{
+ int ret;
+
+ ret = setsockopt(fd, IPPROTO_IP, IP_TTL, &value, sizeof(value));
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_getTTL (JNIEnv *env UNUSED, jint fd, jint *value)
+{
+ int ret;
+ socklen_t slen = sizeof(*value);
+
+ ret = getsockopt(fd, IPPROTO_IP, IP_TTL, value, &slen);
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_setMulticastIF (JNIEnv *env UNUSED, jint fd, cpnet_address *addr)
+{
+ int ret;
+
+ ret = setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, (struct sockaddr *)addr->data, addr->len);
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_getMulticastIF (JNIEnv *env, jint fd, cpnet_address **addr)
+{
+ socklen_t slen = 1024;
+ int ret;
+
+ *addr = JCL_malloc(env, slen);
+
+ slen -= sizeof(jint);
+ ret = getsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, (struct sockaddr *)(*addr)->data, &slen);
+ (*addr)->len = slen;
+
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_setReuseAddress (JNIEnv *env UNUSED, jint fd, jint reuse)
+{
+ int ret;
+
+ ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse));
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_getReuseAddress (JNIEnv *env UNUSED, jint fd, jint *reuse)
+{
+ int ret;
+ socklen_t slen = sizeof(*reuse);
+
+ ret = getsockopt(fd, SOL_SOCKET, SO_REUSEADDR, reuse, &slen);
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_setKeepAlive (JNIEnv *env UNUSED, jint fd, jint keep)
+{
+ int ret;
+
+ ret = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &keep, sizeof(keep));
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_getKeepAlive (JNIEnv *env UNUSED, jint fd, jint *keep)
+{
+ int ret;
+ socklen_t slen = sizeof(*keep);
+
+ ret = getsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, keep, &slen);
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_addMembership (JNIEnv *env UNUSED, jint fd, cpnet_address *addr)
+{
+ struct ip_mreq req;
+ int ret;
+
+ memset(&req, 0, sizeof(req));
+ req.imr_multiaddr = ((struct sockaddr_in *)addr->data)->sin_addr;
+ req.imr_interface.s_addr = INADDR_ANY;
+ ret = setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &req, sizeof(req));
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_dropMembership (JNIEnv *env UNUSED, jint fd, cpnet_address *addr)
+{
+ struct ip_mreq req;
+ int ret;
+
+ memset(&req, 0, sizeof(req));
+ req.imr_multiaddr = ((struct sockaddr_in *)addr->data)->sin_addr;
+ req.imr_interface.s_addr = INADDR_ANY;
+ ret = setsockopt(fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &req, sizeof(req));
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_getAvailableBytes (JNIEnv *env UNUSED, jint fd, jint *availableBytes)
+{
+ int ret;
+
+ ret = ioctl(fd, FIONREAD, availableBytes);
+ if (ret != 0)
+ return errno;
+
+ return 0;
+}
+
+jint cpnet_getHostname (JNIEnv *env UNUSED, char *hostname, jint hostname_len)
+{
+ int ret;
+
+ ret = gethostname(hostname, hostname_len);
+ if (ret != 0)
+ return errno;
+
+ hostname[hostname_len-1] = 0;
+ return 0;
+}
+
+jint cpnet_getHostByName (JNIEnv *env, const char *hostname, cpnet_address ***addresses, jint *addresses_count)
+{
+ struct hostent hret;
+ struct hostent *result;
+ jint buflen = 1024;
+ int herr = 0;
+ int ret = 0;
+ int counter = 0;
+ cpnet_address **addr_arr;
+ int i;
+ char *buf;
+
+ do
+ {
+ buf = (char *)JCL_malloc(env, buflen);
+#ifdef HAVE_GETHOSTBYNAME_R
+ ret = gethostbyname_r (hostname, &hret, buf, buflen, &result, &herr);
+#else
+ hret.h_addr_list = NULL;
+ hret.h_addrtype = 0;
+
+ result = gethostbyname (hostname);
+ if (result == NULL)
+ return -errno;
+ memcpy (&hret, result, sizeof (struct hostent));
+#endif
+ if (ret != 0 || result == NULL)
+ {
+ if (herr == ERANGE)
+ {
+ buflen *= 2;
+ JCL_free(env, buf);
+ continue;
+ }
+ JCL_free(env, buf);
+
+ return -herr;
+ }
+
+ break;
+ }
+ while (1);
+
+ while (hret.h_addr_list[counter] != NULL)
+ counter++;
+
+ *addresses_count = counter;
+ addr_arr = *addresses = JCL_malloc(env, sizeof(cpnet_address *) * counter);
+ switch (hret.h_addrtype)
+ {
+ case AF_INET:
+ for (i = 0; i < counter; i++)
+ {
+ addr_arr[i] = cpnet_newIPV4Address(env);
+ cpnet_bytesToIPV4Address(addr_arr[i], (jbyte *)hret.h_addr_list[i]);
+ }
+ break;
+ case AF_INET6:
+ for (i = 0; i < counter; i++)
+ {
+ addr_arr[i] = cpnet_newIPV6Address(env);
+ cpnet_bytesToIPV6Address(addr_arr[i], (jbyte *)hret.h_addr_list[i]);
+ }
+ break;
+ default:
+ *addresses_count = 0;
+ JCL_free(env, addr_arr);
+ break;
+ }
+
+ JCL_free(env, buf);
+
+ return 0;
+}
+
+jint cpnet_getHostByAddr (JNIEnv *env UNUSED, cpnet_address *addr, char *hostname, jint hostname_len)
+{
+ union
+ {
+ struct sockaddr_in *addr_v4;
+ struct sockaddr_in6 *addr_v6;
+ char *data;
+ } haddr;
+ void *raw_addr;
+ int addr_type;
+ struct hostent *ret;
+ int addr_len;
+
+ haddr.data = addr->data;
+
+ if (haddr.addr_v4->sin_family == AF_INET)
+ {
+ raw_addr = &haddr.addr_v4->sin_addr;
+ addr_len = sizeof(haddr.addr_v4->sin_addr);
+ addr_type = AF_INET;
+ }
+ else if (haddr.addr_v6->sin6_family == AF_INET6)
+ {
+ raw_addr = &haddr.addr_v6->sin6_addr;
+ addr_type = AF_INET6;
+ addr_len = sizeof(haddr.addr_v6->sin6_addr);
+ }
+ else
+ return EINVAL;
+
+ /* Here we do not have any thread safe call. VM implementors will have to
+ * do a big lock. Or it should be put on the Classpath VM interface.
+ */
+ ret = gethostbyaddr(raw_addr, addr_len, addr_type);
+ if (ret == NULL)
+ {
+ /* The trouble here is how to distinguish the two cases ? */
+ if (h_errno != 0)
+ return h_errno;
+ else
+ return errno;
+
+ }
+ strncpy(hostname, ret->h_name, hostname_len);
+
+ return 0;
+}
+
+jint cpnet_aton (JNIEnv *env, const char *hostname, cpnet_address **addr)
+{
+ jbyte *bytes = NULL;
+#ifdef HAVE_INET_PTON
+ jbyte inet6_addr[16];
+#endif
+
+#ifdef HAVE_INET_ATON
+ struct in_addr laddr;
+ if (inet_aton (hostname, &laddr))
+ {
+ bytes = (jbyte *) &laddr;
+ }
+#elif defined(HAVE_INET_ADDR)
+#if ! HAVE_IN_ADDR_T
+ typedef jint in_addr_t;
+#endif
+ in_addr_t laddr = inet_addr (hostname);
+ if (laddr != (in_addr_t)(-1))
+ {
+ bytes = (jbyte *) &laddr;
+ }
+#endif
+ if (bytes)
+ {
+ *addr = cpnet_newIPV4Address(env);
+ cpnet_bytesToIPV4Address(*addr, bytes);
+ return 0;
+ }
+
+#ifdef HAVE_INET_PTON
+ if (inet_pton (AF_INET6, hostname, inet6_addr) > 0)
+ {
+ *addr = cpnet_newIPV6Address(env);
+ cpnet_bytesToIPV6Address(*addr, inet6_addr);
+ return 0;
+ }
+#endif
+
+ *addr = NULL;
+ return 0;
+}
+
+void cpnet_freeAddresses(JNIEnv * env, cpnet_address **addr, jint addresses_count)
+{
+ jint i;
+
+ for (i = 0; i < addresses_count; i++)
+ cpnet_freeAddress(env, addr[i]);
+}
diff --git a/libjava/classpath/native/jni/native-lib/cpnet.h b/libjava/classpath/native/jni/native-lib/cpnet.h
new file mode 100644
index 00000000000..3705c76ecd5
--- /dev/null
+++ b/libjava/classpath/native/jni/native-lib/cpnet.h
@@ -0,0 +1,209 @@
+/* cpnet.h -
+ Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+#ifndef _CLASSPATH_NET_H_INCLUDED
+#define _CLASSPATH_NET_H_INCLUDED
+
+#include <jni.h>
+#include <jcl.h>
+#include <string.h>
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+
+typedef struct {
+ jint len;
+ char data[1];
+} cpnet_address;
+
+#define CPNET_SHUTDOWN_READ 1
+#define CPNET_SHUTDOWN_WRITE 2
+
+JNIEXPORT jint cpnet_openSocketStream(JNIEnv *env, jint *fd, jint family);
+JNIEXPORT jint cpnet_openSocketDatagram(JNIEnv *env, jint *fd, jint family);
+JNIEXPORT jint cpnet_shutdown (JNIEnv *env, jint fd, jbyte flag);
+JNIEXPORT jint cpnet_close(JNIEnv *env, jint fd);
+JNIEXPORT jint cpnet_listen(JNIEnv *env, jint fd, jint queuelen);
+JNIEXPORT jint cpnet_accept(JNIEnv *env, jint fd, jint *newfd);
+JNIEXPORT jint cpnet_bind(JNIEnv *env, jint fd, cpnet_address *addr);
+JNIEXPORT jint cpnet_connect(JNIEnv *env, jint fd, cpnet_address *addr);
+JNIEXPORT jint cpnet_getLocalAddr(JNIEnv *env, jint fd, cpnet_address **addr);
+JNIEXPORT jint cpnet_getRemoteAddr(JNIEnv *env, jint fd, cpnet_address **addr);
+JNIEXPORT jint cpnet_setBroadcast(JNIEnv *env, jint fd, jint flag);
+JNIEXPORT jint cpnet_send (JNIEnv *env, jint fd, jbyte *data, jint len, jint *bytes_sent);
+JNIEXPORT jint cpnet_sendTo (JNIEnv *env, jint fd, jbyte *data, jint len, cpnet_address *addr, jint *bytes_sent);
+JNIEXPORT jint cpnet_recv (JNIEnv *env, jint fd, jbyte *data, jint len, jint *bytes_recv);
+JNIEXPORT jint cpnet_recvFrom (JNIEnv *env, jint fd, jbyte *data, jint len, cpnet_address **addr, jint *bytes_recv);
+JNIEXPORT jint cpnet_setSocketTCPNoDelay (JNIEnv *env, jint fd, jint nodelay);
+JNIEXPORT jint cpnet_getSocketTCPNoDelay (JNIEnv *env, jint fd, jint *nodelay);
+JNIEXPORT jint cpnet_setLinger (JNIEnv *env, jint fd, jint flag, jint value);
+JNIEXPORT jint cpnet_getLinger (JNIEnv *env, jint fd, jint *flag, jint *value);
+JNIEXPORT jint cpnet_setSocketTimeout (JNIEnv *env, jint fd, jint value);
+JNIEXPORT jint cpnet_getSocketTimeout (JNIEnv *env, jint fd, jint *value);
+JNIEXPORT jint cpnet_setSendBuf (JNIEnv *env, jint fd, jint value);
+JNIEXPORT jint cpnet_getSendBuf (JNIEnv *env, jint fd, jint *value);
+JNIEXPORT jint cpnet_setRecvBuf (JNIEnv *env, jint fd, jint value);
+JNIEXPORT jint cpnet_getRecvBuf (JNIEnv *env, jint fd, jint *value);
+JNIEXPORT jint cpnet_setTTL (JNIEnv *env, jint fd, jint value);
+JNIEXPORT jint cpnet_getTTL (JNIEnv *env, jint fd, jint *value);
+JNIEXPORT jint cpnet_setMulticastIF (JNIEnv *env, jint fd, cpnet_address *addr);
+JNIEXPORT jint cpnet_getMulticastIF (JNIEnv *env, jint fd, cpnet_address **addr);
+JNIEXPORT jint cpnet_setReuseAddress (JNIEnv *env, jint fd, jint reuse);
+JNIEXPORT jint cpnet_getReuseAddress (JNIEnv *env, jint fd, jint *reuse);
+JNIEXPORT jint cpnet_setKeepAlive (JNIEnv *env, jint fd, jint keep);
+JNIEXPORT jint cpnet_getKeepAlive (JNIEnv *env, jint fd, jint *keep);
+JNIEXPORT jint cpnet_getBindAddress (JNIEnv *env, jint fd, cpnet_address **addr);
+JNIEXPORT jint cpnet_addMembership (JNIEnv *env, jint fd, cpnet_address *addr);
+JNIEXPORT jint cpnet_dropMembership (JNIEnv *env, jint fd, cpnet_address *addr);
+JNIEXPORT jint cpnet_getAvailableBytes (JNIEnv *env, jint fd, jint *availableBytes);
+JNIEXPORT jint cpnet_getHostname (JNIEnv *env, char *hostname, jint hostname_len);
+JNIEXPORT jint cpnet_getHostByName (JNIEnv *env, const char *hostname, cpnet_address ***adresses, jint *addresses_count);
+JNIEXPORT jint cpnet_getHostByAddr (JNIEnv *env, cpnet_address *addr, char *hostname, jint hostname_len);
+JNIEXPORT jint cpnet_aton (JNIEnv *env, const char *hostname, cpnet_address **addr);
+JNIEXPORT void cpnet_freeAddresses(JNIEnv * env, cpnet_address **addr, jint addresses_count);
+
+static inline cpnet_address *cpnet_newIPV4Address(JNIEnv * env)
+{
+ cpnet_address *addr = (cpnet_address *)JCL_malloc(env, sizeof(cpnet_address) + sizeof(struct sockaddr_in));
+ struct sockaddr_in *netaddr = (struct sockaddr_in *)&(addr->data[0]);
+
+ addr->len = sizeof(struct sockaddr_in);
+ memset(netaddr, 0, addr->len);
+ netaddr->sin_family = AF_INET;
+ return addr;
+}
+
+static inline void cpnet_setIPV4Any(cpnet_address *addr)
+{
+ struct sockaddr_in *netaddr = (struct sockaddr_in *)&(addr->data[0]);
+
+ netaddr->sin_addr.s_addr = INADDR_ANY;
+}
+
+static inline cpnet_address *cpnet_newIPV6Address(JNIEnv * env)
+{
+ cpnet_address * addr = (cpnet_address *)JCL_malloc(env, sizeof(cpnet_address) + sizeof(struct sockaddr_in6));
+ struct sockaddr_in6 *netaddr = (struct sockaddr_in6 *)&(addr->data[0]);
+
+ addr->len = sizeof(struct sockaddr_in6);
+ memset(netaddr, 0, addr->len);
+ netaddr->sin6_family = AF_INET6;
+
+ return addr;
+}
+
+static inline void cpnet_freeAddress(JNIEnv * env, cpnet_address *addr)
+{
+ JCL_free(env, addr);
+}
+
+static inline void cpnet_addressSetPort(cpnet_address *addr, jint port)
+{
+ struct sockaddr_in *ipaddr = (struct sockaddr_in *)&(addr->data[0]);
+
+ ipaddr->sin_port = htons(port);
+}
+
+static inline jint cpnet_addressGetPort(cpnet_address *addr)
+{
+ struct sockaddr_in *ipaddr = (struct sockaddr_in *)&(addr->data[0]);
+
+ return ntohs(ipaddr->sin_port);
+}
+
+static inline jboolean cpnet_isAddressEqual(cpnet_address *addr1, cpnet_address *addr2)
+{
+ if (addr1->len != addr2->len)
+ return JNI_FALSE;
+
+ return memcmp(addr1->data, addr2->data, addr1->len) == 0;
+}
+
+static inline jboolean cpnet_isIPV6Address(cpnet_address *addr)
+{
+ struct sockaddr_in *ipaddr = (struct sockaddr_in *)&(addr->data[0]);
+
+ return ipaddr->sin_family == AF_INET6;
+}
+
+static inline jboolean cpnet_isIPV4Address(cpnet_address *addr)
+{
+ struct sockaddr_in *ipaddr = (struct sockaddr_in *)&(addr->data[0]);
+
+ return ipaddr->sin_family == AF_INET;
+}
+
+static inline void cpnet_IPV4AddressToBytes(cpnet_address *netaddr, jbyte *octets)
+{
+ struct sockaddr_in *ipaddr = (struct sockaddr_in *)&(netaddr->data[0]);
+ unsigned long sysaddr = ntohl(ipaddr->sin_addr.s_addr);
+
+ octets[0] = ((sysaddr >> 24) & 0xff);
+ octets[1] = ((sysaddr >> 16) & 0xff);
+ octets[2] = ((sysaddr >> 8) & 0xff);
+ octets[3] = (sysaddr & 0xff);
+}
+
+static inline void cpnet_bytesToIPV4Address(cpnet_address *netaddr, jbyte *octets)
+{
+ jint sysaddr;
+ struct sockaddr_in *ipaddr = (struct sockaddr_in *)&(netaddr->data[0]);
+
+ sysaddr = ((jint)(unsigned char)octets[0]) << 24;
+ sysaddr |= ((jint)(unsigned char)octets[1]) << 16;
+ sysaddr |= ((jint)(unsigned char)octets[2]) << 8;
+ sysaddr |= ((jint)(unsigned char)octets[3]);
+
+ ipaddr->sin_addr.s_addr = htonl(sysaddr);
+}
+
+static inline void cpnet_IPV6AddressToBytes(cpnet_address *netaddr, jbyte *octets)
+{
+ struct sockaddr_in6 *ipaddr = (struct sockaddr_in6 *)&(netaddr->data[0]);
+
+ memcpy(octets, &ipaddr->sin6_addr, 16);
+}
+
+static inline void cpnet_bytesToIPV6Address(cpnet_address *netaddr, jbyte *octets)
+{
+ struct sockaddr_in6 *ipaddr = (struct sockaddr_in6 *)&(netaddr->data[0]);
+
+ memcpy(&ipaddr->sin6_addr, octets, 16);
+}
+
+#endif
diff --git a/libjava/classpath/native/jni/native-lib/cpproc.c b/libjava/classpath/native/jni/native-lib/cpproc.c
new file mode 100644
index 00000000000..b6e9030b562
--- /dev/null
+++ b/libjava/classpath/native/jni/native-lib/cpproc.c
@@ -0,0 +1,136 @@
+/* cpproc.c -
+ Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+#include "config.h"
+#include <jni.h>
+#include "cpproc.h"
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <errno.h>
+#include <stdlib.h>
+
+static void close_all_fds(int *fds, int numFds)
+{
+ int i;
+
+ for (i = 0; i < numFds; i++)
+ close(fds[i]);
+}
+
+int cpproc_forkAndExec (char * const *commandLine, char * const * newEnviron,
+ int *fds, int pipe_count, pid_t *out_pid, const char *wd)
+{
+ int local_fds[6];
+ int i;
+ pid_t pid;
+
+ for (i = 0; i < (pipe_count * 2); i += 2)
+ {
+ if (pipe(&local_fds[i]) < 0)
+ {
+ int err = errno;
+
+ close_all_fds(local_fds, i);
+
+ return err;
+ }
+ }
+
+ pid = fork();
+
+ switch (pid)
+ {
+ case 0:
+ dup2(local_fds[0], 0);
+ dup2(local_fds[3], 1);
+ if (pipe_count == 3)
+ dup2(local_fds[5], 2);
+ else
+ dup2(1, 2);
+
+ close_all_fds(local_fds, pipe_count * 2);
+
+ chdir(wd);
+ if (newEnviron == NULL)
+ execvp(commandLine[0], commandLine);
+ else
+ execve(commandLine[0], commandLine, newEnviron);
+
+ abort();
+
+ break;
+ case -1:
+ {
+ int err = errno;
+
+ close_all_fds(local_fds, pipe_count * 2);
+ return err;
+ }
+ default:
+ close(local_fds[0]);
+ close(local_fds[3]);
+ if (pipe_count == 3)
+ close(local_fds[5]);
+
+ fds[0] = local_fds[1];
+ fds[1] = local_fds[2];
+ fds[2] = local_fds[4];
+ *out_pid = pid;
+ return 0;
+ }
+}
+
+int cpproc_waitpid (pid_t pid, int *status, pid_t *outpid, int options)
+{
+ pid_t wp = waitpid(pid, status, options);
+
+ if (wp < 0)
+ return errno;
+
+ *outpid = wp;
+ return 0;
+}
+
+int cpproc_kill (pid_t pid, int signal)
+{
+ if (kill(pid, signal) < 0)
+ return errno;
+
+ return 0;
+}
diff --git a/libjava/classpath/native/jni/native-lib/cpproc.h b/libjava/classpath/native/jni/native-lib/cpproc.h
new file mode 100644
index 00000000000..5e8db5800a2
--- /dev/null
+++ b/libjava/classpath/native/jni/native-lib/cpproc.h
@@ -0,0 +1,52 @@
+/* cpproc.h -
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+#ifndef _CLASSPATH_PROC_H_INCLUDED
+#define _CLASSPATH_PROC_H_INCLUDED
+
+#include <sys/types.h>
+
+#define CPIO_EXEC_STDIN 0
+#define CPIO_EXEC_STDOUT 1
+#define CPIO_EXEC_STDERR 2
+#define CPIO_EXEC_NUM_PIPES 3
+
+JNIEXPORT int cpproc_forkAndExec (char * const *commandLine, char * const * newEnviron,
+ int *fds, int pipe_count, pid_t *pid, const char *wd);
+JNIEXPORT int cpproc_waitpid (pid_t pid, int *status, pid_t *outpid, int options);
+JNIEXPORT int cpproc_kill (pid_t pid, int signal);
+
+#endif
diff --git a/libjava/classpath/native/jni/qt-peer/Makefile.am b/libjava/classpath/native/jni/qt-peer/Makefile.am
index b123ed36e6c..1728b6b530e 100644
--- a/libjava/classpath/native/jni/qt-peer/Makefile.am
+++ b/libjava/classpath/native/jni/qt-peer/Makefile.am
@@ -1,7 +1,8 @@
# Qt AWT backend for Classpath
#
-nativeexeclib_LTLIBRARIES = libqtpeer.la
+## GCJ LOCAL: don't install this library
+noinst_LTLIBRARIES = libqtpeer.la
AM_LDFLAGS = @CLASSPATH_MODULE@ @QT_LIBS@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
diff --git a/libjava/classpath/native/jni/qt-peer/Makefile.in b/libjava/classpath/native/jni/qt-peer/Makefile.in
index 6171542c7b7..c60ea1938a2 100644
--- a/libjava/classpath/native/jni/qt-peer/Makefile.in
+++ b/libjava/classpath/native/jni/qt-peer/Makefile.in
@@ -45,26 +45,20 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(nativeexeclibdir)"
-nativeexeclibLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(nativeexeclib_LTLIBRARIES)
+LTLIBRARIES = $(noinst_LTLIBRARIES)
libqtpeer_la_LIBADD =
am_libqtpeer_la_OBJECTS = componentevent.lo keybindings.lo \
mainqtthread.lo mainthreadinterface.lo nativewrapper.lo \
@@ -209,6 +203,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -330,9 +326,8 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
-nativeexeclib_LTLIBRARIES = libqtpeer.la
+noinst_LTLIBRARIES = libqtpeer.la
AM_LDFLAGS = @CLASSPATH_MODULE@ @QT_LIBS@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@
AM_CXXFLAGS = @QT_CFLAGS@
@@ -435,35 +430,17 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-install-nativeexeclibLTLIBRARIES: $(nativeexeclib_LTLIBRARIES)
- @$(NORMAL_INSTALL)
- test -z "$(nativeexeclibdir)" || $(mkdir_p) "$(DESTDIR)$(nativeexeclibdir)"
- @list='$(nativeexeclib_LTLIBRARIES)'; for p in $$list; do \
- if test -f $$p; then \
- f=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=install $(nativeexeclibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(nativeexeclibdir)/$$f'"; \
- $(LIBTOOL) --mode=install $(nativeexeclibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(nativeexeclibdir)/$$f"; \
- else :; fi; \
- done
-
-uninstall-nativeexeclibLTLIBRARIES:
- @$(NORMAL_UNINSTALL)
- @set -x; list='$(nativeexeclib_LTLIBRARIES)'; for p in $$list; do \
- p=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(nativeexeclibdir)/$$p'"; \
- $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(nativeexeclibdir)/$$p"; \
- done
-clean-nativeexeclibLTLIBRARIES:
- -test -z "$(nativeexeclib_LTLIBRARIES)" || rm -f $(nativeexeclib_LTLIBRARIES)
- @list='$(nativeexeclib_LTLIBRARIES)'; for p in $$list; do \
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libqtpeer.la: $(libqtpeer_la_OBJECTS) $(libqtpeer_la_DEPENDENCIES)
- $(CXXLINK) -rpath $(nativeexeclibdir) $(libqtpeer_la_LDFLAGS) $(libqtpeer_la_OBJECTS) $(libqtpeer_la_LIBADD) $(LIBS)
+ $(CXXLINK) $(libqtpeer_la_LDFLAGS) $(libqtpeer_la_OBJECTS) $(libqtpeer_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -624,9 +601,6 @@ check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
- for dir in "$(DESTDIR)$(nativeexeclibdir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
- done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
@@ -656,7 +630,7 @@ maintainer-clean-generic:
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
-clean-am: clean-generic clean-libtool clean-nativeexeclibLTLIBRARIES \
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
@@ -677,7 +651,7 @@ info-am:
install-data-am:
-install-exec-am: install-nativeexeclibLTLIBRARIES
+install-exec-am:
install-info: install-info-am
@@ -703,20 +677,19 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am uninstall-nativeexeclibLTLIBRARIES
+uninstall-am: uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-nativeexeclibLTLIBRARIES ctags distclean \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
- install-nativeexeclibLTLIBRARIES install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-info-am \
- uninstall-nativeexeclibLTLIBRARIES
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-info-am
slotcallbacks.moc.h: slotcallbacks.cpp
diff --git a/libjava/classpath/native/jni/xmlj/.cvsignore b/libjava/classpath/native/jni/xmlj/.cvsignore
new file mode 100644
index 00000000000..e9f2658a694
--- /dev/null
+++ b/libjava/classpath/native/jni/xmlj/.cvsignore
@@ -0,0 +1,8 @@
+*.o
+*.a
+*.lo
+*.la
+.libs
+.deps
+Makefile
+Makefile.in
diff --git a/libjava/classpath/native/jni/xmlj/Makefile.in b/libjava/classpath/native/jni/xmlj/Makefile.in
index a43311b3a82..3f3a1613cc0 100644
--- a/libjava/classpath/native/jni/xmlj/Makefile.in
+++ b/libjava/classpath/native/jni/xmlj/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -185,6 +187,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -306,7 +310,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
nativeexeclib_LTLIBRARIES = libxmlj.la
libxmlj_la_SOURCES = \
diff --git a/libjava/classpath/native/plugin/Makefile.am b/libjava/classpath/native/plugin/Makefile.am
index 59c4cb3f388..db94bb411bc 100644
--- a/libjava/classpath/native/plugin/Makefile.am
+++ b/libjava/classpath/native/plugin/Makefile.am
@@ -3,7 +3,7 @@ nativeexeclib_LTLIBRARIES = libgcjwebplugin.la
libgcjwebplugin_la_SOURCES = gcjwebplugin.cc
libgcjwebplugin_la_CXXFLAGS = \
- -Wall -DAPPLETVIEWER_EXECUTABLE="\"$(bindir)/gappletviewer\"" \
+ -Wall -DAPPLETVIEWER_EXECUTABLE="\"$(bindir)/`echo gappletviewer | sed '$(program_transform_name)'`\"" \
$(MOZILLA_CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS)
libgcjwebplugin_la_LDFLAGS = -avoid-version \
diff --git a/libjava/classpath/native/plugin/Makefile.in b/libjava/classpath/native/plugin/Makefile.in
index 4a17afd5b29..be48ed28aae 100644
--- a/libjava/classpath/native/plugin/Makefile.in
+++ b/libjava/classpath/native/plugin/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -183,6 +185,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -304,12 +308,11 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
nativeexeclib_LTLIBRARIES = libgcjwebplugin.la
libgcjwebplugin_la_SOURCES = gcjwebplugin.cc
libgcjwebplugin_la_CXXFLAGS = \
- -Wall -DAPPLETVIEWER_EXECUTABLE="\"$(bindir)/gappletviewer\"" \
+ -Wall -DAPPLETVIEWER_EXECUTABLE="\"$(bindir)/`echo gappletviewer | sed '$(program_transform_name)'`\"" \
$(MOZILLA_CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS)
libgcjwebplugin_la_LDFLAGS = -avoid-version \
diff --git a/libjava/classpath/native/plugin/gcjwebplugin.cc b/libjava/classpath/native/plugin/gcjwebplugin.cc
index 1202c4719aa..bb2bfa22343 100644
--- a/libjava/classpath/native/plugin/gcjwebplugin.cc
+++ b/libjava/classpath/native/plugin/gcjwebplugin.cc
@@ -283,10 +283,6 @@ GCJ_New (NPMIMEType pluginType, NPP instance, uint16 mode,
goto cleanup_done;
}
- // Initialize threads (needed for mutexes).
- if (!g_thread_supported ())
- g_thread_init (NULL);
-
// data
plugin_data_new (&data);
if (data == NULL)
@@ -1686,6 +1682,11 @@ NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable)
pluginTable->getvalue = NewNPP_GetValueProc (GCJ_GetValue);
initialized = true;
+
+ // Initialize threads (needed for mutexes).
+ if (!g_thread_supported ())
+ g_thread_init (NULL);
+
plugin_instance_mutex = g_mutex_new ();
PLUGIN_DEBUG ("NP_Initialize: using " APPLETVIEWER_EXECUTABLE ".");
diff --git a/libjava/classpath/native/target/Linux/Makefile.am b/libjava/classpath/native/target/Linux/Makefile.am
deleted file mode 100644
index bd267dc7f91..00000000000
--- a/libjava/classpath/native/target/Linux/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-## Input file for automake to generate the Makefile.in used by configure
-
-EXTRA_DIST = \
-target_native_io.h \
-target_native_misc.h \
-target_native.h \
-target_native_math_float.h \
-target_native_network.h \
-target_native_file.h \
-target_native_math_int.h
diff --git a/libjava/classpath/native/target/Linux/Makefile.in b/libjava/classpath/native/target/Linux/Makefile.in
deleted file mode 100644
index fad05c8e9d3..00000000000
--- a/libjava/classpath/native/target/Linux/Makefile.in
+++ /dev/null
@@ -1,454 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../../..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = native/target/Linux
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
- $(top_srcdir)/../../config/lead-dot.m4 \
- $(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
- $(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
- $(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/include/config.h
-CONFIG_CLEAN_FILES =
-SOURCES =
-DIST_SOURCES =
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
-BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CLASSPATH_CONVENIENCE = @CLASSPATH_CONVENIENCE@
-CLASSPATH_INCLUDES = @CLASSPATH_INCLUDES@
-CLASSPATH_MODULE = @CLASSPATH_MODULE@
-COLLECTIONS_PREFIX = @COLLECTIONS_PREFIX@
-CP = @CP@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CREATE_ALSA_LIBRARIES_FALSE = @CREATE_ALSA_LIBRARIES_FALSE@
-CREATE_ALSA_LIBRARIES_TRUE = @CREATE_ALSA_LIBRARIES_TRUE@
-CREATE_API_DOCS_FALSE = @CREATE_API_DOCS_FALSE@
-CREATE_API_DOCS_TRUE = @CREATE_API_DOCS_TRUE@
-CREATE_COLLECTIONS_FALSE = @CREATE_COLLECTIONS_FALSE@
-CREATE_COLLECTIONS_TRUE = @CREATE_COLLECTIONS_TRUE@
-CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@
-CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@
-CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@
-CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@
-CREATE_GCONF_PEER_LIBRARIES_FALSE = @CREATE_GCONF_PEER_LIBRARIES_FALSE@
-CREATE_GCONF_PEER_LIBRARIES_TRUE = @CREATE_GCONF_PEER_LIBRARIES_TRUE@
-CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@
-CREATE_GTK_PEER_LIBRARIES_TRUE = @CREATE_GTK_PEER_LIBRARIES_TRUE@
-CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
-CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
-CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
-CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
-CREATE_PLUGIN_FALSE = @CREATE_PLUGIN_FALSE@
-CREATE_PLUGIN_TRUE = @CREATE_PLUGIN_TRUE@
-CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
-CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
-CREATE_WRAPPERS_FALSE = @CREATE_WRAPPERS_FALSE@
-CREATE_WRAPPERS_TRUE = @CREATE_WRAPPERS_TRUE@
-CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
-CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATE = @DATE@
-DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-ECJ = @ECJ@
-EGREP = @EGREP@
-ENABLE_LOCAL_SOCKETS_FALSE = @ENABLE_LOCAL_SOCKETS_FALSE@
-ENABLE_LOCAL_SOCKETS_TRUE = @ENABLE_LOCAL_SOCKETS_TRUE@
-ERROR_CFLAGS = @ERROR_CFLAGS@
-EXAMPLESDIR = @EXAMPLESDIR@
-EXEEXT = @EXEEXT@
-FASTJAR = @FASTJAR@
-FIND = @FIND@
-FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
-FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
-FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
-FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
-FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
-FOUND_GCJX_TRUE = @FOUND_GCJX_TRUE@
-FOUND_GCJ_FALSE = @FOUND_GCJ_FALSE@
-FOUND_GCJ_TRUE = @FOUND_GCJ_TRUE@
-FOUND_JIKES_FALSE = @FOUND_JIKES_FALSE@
-FOUND_JIKES_TRUE = @FOUND_JIKES_TRUE@
-FOUND_KJC_FALSE = @FOUND_KJC_FALSE@
-FOUND_KJC_TRUE = @FOUND_KJC_TRUE@
-FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
-FREETYPE2_LIBS = @FREETYPE2_LIBS@
-GCJ = @GCJ@
-GCJX = @GCJX@
-GCONF_CFLAGS = @GCONF_CFLAGS@
-GCONF_LIBS = @GCONF_LIBS@
-GDK_CFLAGS = @GDK_CFLAGS@
-GDK_LIBS = @GDK_LIBS@
-GJDOC = @GJDOC@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_LIBS = @GLIB_LIBS@
-GTK_CFLAGS = @GTK_CFLAGS@
-GTK_LIBS = @GTK_LIBS@
-INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
-INSTALL_CLASS_FILES_FALSE = @INSTALL_CLASS_FILES_FALSE@
-INSTALL_CLASS_FILES_TRUE = @INSTALL_CLASS_FILES_TRUE@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_GLIBJ_ZIP_FALSE = @INSTALL_GLIBJ_ZIP_FALSE@
-INSTALL_GLIBJ_ZIP_TRUE = @INSTALL_GLIBJ_ZIP_TRUE@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
-JAY = @JAY@
-JAY_SKELETON = @JAY_SKELETON@
-JIKES = @JIKES@
-JIKESENCODING = @JIKESENCODING@
-JIKESWARNINGS = @JIKESWARNINGS@
-KJC = @KJC@
-LDFLAGS = @LDFLAGS@
-LIBDEBUG = @LIBDEBUG@
-LIBICONV = @LIBICONV@
-LIBMAGIC = @LIBMAGIC@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBVERSION = @LIBVERSION@
-LN_S = @LN_S@
-LTLIBICONV = @LTLIBICONV@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-MKDIR = @MKDIR@
-MOC = @MOC@
-MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
-MOZILLA_LIBS = @MOZILLA_LIBS@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
-PANGOFT2_LIBS = @PANGOFT2_LIBS@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PATH_TO_ESCHER = @PATH_TO_ESCHER@
-PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
-PERL = @PERL@
-PKG_CONFIG = @PKG_CONFIG@
-PLUGIN_DIR = @PLUGIN_DIR@
-QT_CFLAGS = @QT_CFLAGS@
-QT_LIBS = @QT_LIBS@
-RANLIB = @RANLIB@
-REGEN_PARSERS_FALSE = @REGEN_PARSERS_FALSE@
-REGEN_PARSERS_TRUE = @REGEN_PARSERS_TRUE@
-REMOVE = @REMOVE@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRICT_WARNING_CFLAGS = @STRICT_WARNING_CFLAGS@
-STRIP = @STRIP@
-USER_CLASSLIB = @USER_CLASSLIB@
-USER_JAVAH = @USER_JAVAH@
-USER_SPECIFIED_CLASSLIB_FALSE = @USER_SPECIFIED_CLASSLIB_FALSE@
-USER_SPECIFIED_CLASSLIB_TRUE = @USER_SPECIFIED_CLASSLIB_TRUE@
-USER_SPECIFIED_JAVAH_FALSE = @USER_SPECIFIED_JAVAH_FALSE@
-USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
-USE_ESCHER_FALSE = @USE_ESCHER_FALSE@
-USE_ESCHER_TRUE = @USE_ESCHER_TRUE@
-USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
-USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
-VERSION = @VERSION@
-VM_BINARY = @VM_BINARY@
-WARNING_CFLAGS = @WARNING_CFLAGS@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-XSLT_CFLAGS = @XSLT_CFLAGS@
-XSLT_LIBS = @XSLT_LIBS@
-XTEST_LIBS = @XTEST_LIBS@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-ZIP = @ZIP@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-default_toolkit = @default_toolkit@
-exec_prefix = @exec_prefix@
-glibjdir = @glibjdir@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-nativeexeclibdir = @nativeexeclibdir@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
-vm_classes = @vm_classes@
-EXTRA_DIST = \
-target_native_io.h \
-target_native_misc.h \
-target_native.h \
-target_native_math_float.h \
-target_native_network.h \
-target_native_file.h \
-target_native_math_int.h
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu native/target/Linux/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu native/target/Linux/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-tags: TAGS
-TAGS:
-
-ctags: CTAGS
-CTAGS:
-
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- distclean distclean-generic distclean-libtool distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-exec install-exec-am \
- install-info install-info-am install-man install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
- uninstall-info-am
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/libjava/classpath/native/target/Linux/target_native.h b/libjava/classpath/native/target/Linux/target_native.h
deleted file mode 100644
index 4e1d5136d55..00000000000
--- a/libjava/classpath/native/target/Linux/target_native.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* ???.h - ???
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-Description: Linux target global defintions
-Systems : all
-*/
-
-#ifndef __TARGET_NATIVE__
-#define __TARGET_NATIVE__
-
-/****************************** Includes *******************************/
-/* do not move; needed here because of some macro definitions */
-#include <config.h>
-
-#include <stdlib.h>
-
-/****************** Conditional compilation switches *******************/
-
-/***************************** Constants *******************************/
-
-/***************************** Datatypes *******************************/
-
-/***************************** Variables *******************************/
-
-/****************************** Macros *********************************/
-
-/***************************** Functions *******************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/* include rest of definitions from generic file (do not move it to
- another position!) */
-#include "target_generic.h"
-
-#endif /* __TARGET_NATIVE__ */
-
-/* end of file */
-
diff --git a/libjava/classpath/native/target/Linux/target_native_file.h b/libjava/classpath/native/target/Linux/target_native_file.h
deleted file mode 100644
index 0c40b4471b6..00000000000
--- a/libjava/classpath/native/target/Linux/target_native_file.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* ???.h - ???
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-Description: Linux target defintions of file functions
-Systems : all
-*/
-
-#ifndef __TARGET_NATIVE_FILE__
-#define __TARGET_NATIVE_FILE__
-
-/****************************** Includes *******************************/
-/* do not move; needed here because of some macro definitions */
-#include <config.h>
-
-#include <stdlib.h>
-
-/****************** Conditional compilation switches *******************/
-
-/***************************** Constants *******************************/
-
-/***************************** Datatypes *******************************/
-
-/***************************** Variables *******************************/
-
-/****************************** Macros *********************************/
-
-/***************************** Functions *******************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/* include rest of definitions from generic file (do not move it to
- another position!) */
-#include "target_generic_file.h"
-
-#endif /* __TARGET_NATIVE_FILE__ */
-
-/* end of file */
-
diff --git a/libjava/classpath/native/target/Linux/target_native_io.h b/libjava/classpath/native/target/Linux/target_native_io.h
deleted file mode 100644
index 03f43adf579..00000000000
--- a/libjava/classpath/native/target/Linux/target_native_io.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ???.h - ???
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-Description: Linux target defintions of miscellaneous functions
-Systems : all
-*/
-
-#ifndef __TARGET_NATIVE_IO__
-#define __TARGET_NATIVE_IO__
-
-/****************************** Includes *******************************/
-/* do not move; needed here because of some macro definitions */
-#include <config.h>
-
-#include <stdlib.h>
-
-/****************** Conditional compilation switches *******************/
-
-/***************************** Constants *******************************/
-
-/***************************** Datatypes *******************************/
-
-/***************************** Variables *******************************/
-
-/****************************** Macros *********************************/
-
-/***************************** Functions *******************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/* include rest of definitions from generic file (do not move it to
- another position!) */
-#include "target_generic_io.h"
-
-#endif /* __TARGET_NATIVE_MISC__ */
-
-/* end of file */
diff --git a/libjava/classpath/native/target/Linux/target_native_math_float.h b/libjava/classpath/native/target/Linux/target_native_math_float.h
deleted file mode 100644
index 0f3455d2ae9..00000000000
--- a/libjava/classpath/native/target/Linux/target_native_math_float.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* ???.h - ???
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-Description: Linux target defintions of float/double constants/
- macros/functions
-Systems : all
-*/
-
-#ifndef __TARGET_NATIVE_MATH_FLOAT__
-#define __TARGET_NATIVE_MATH_FLOAT__
-
-/****************************** Includes *******************************/
-/* do not move; needed here because of some macro definitions */
-#include <config.h>
-
-#include <stdlib.h>
-
-/****************** Conditional compilation switches *******************/
-
-/***************************** Constants *******************************/
-
-/***************************** Datatypes *******************************/
-
-/***************************** Variables *******************************/
-
-/****************************** Macros *********************************/
-
-/***************************** Functions *******************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/* include rest of definitions from generic file (do not move it to
- another position!) */
-#include "target_generic_math_float.h"
-
-#endif /* __TARGET_NATIVE_MATH_FLOAT__ */
-
-/* end of file */
-
diff --git a/libjava/classpath/native/target/Linux/target_native_math_int.h b/libjava/classpath/native/target/Linux/target_native_math_int.h
deleted file mode 100644
index 4c5fc671d05..00000000000
--- a/libjava/classpath/native/target/Linux/target_native_math_int.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* ???.h - ???
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-Description: Linux target defintions of int/int64 constants/
- macros/functions
-Systems : all
-*/
-
-#ifndef __TARGET_NATIVE_MATH_INT__
-#define __TARGET_NATIVE_MATH_INT__
-
-/****************************** Includes *******************************/
-/* do not move; needed here because of some macro definitions */
-#include <config.h>
-
-#include <stdlib.h>
-
-/****************** Conditional compilation switches *******************/
-
-/***************************** Constants *******************************/
-
-/***************************** Datatypes *******************************/
-
-/***************************** Variables *******************************/
-
-/****************************** Macros *********************************/
-
-/***************************** Functions *******************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/* include rest of definitions from generic file (do not move it to
- another position!) */
-#include "target_generic_math_int.h"
-
-#endif /* __TARGET_NATIVE_MATH_INT__ */
-
-/* end of file */
-
diff --git a/libjava/classpath/native/target/Linux/target_native_misc.h b/libjava/classpath/native/target/Linux/target_native_misc.h
deleted file mode 100644
index 00bc7ac8da8..00000000000
--- a/libjava/classpath/native/target/Linux/target_native_misc.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* ???.h - ???
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-Description: Linux target defintions of miscellaneous functions
-Systems : all
-*/
-
-#ifndef __TARGET_NATIVE_MISC__
-#define __TARGET_NATIVE_MISC__
-
-/****************************** Includes *******************************/
-/* do not move; needed here because of some macro definitions */
-#include <config.h>
-
-#include <stdlib.h>
-
-/****************** Conditional compilation switches *******************/
-
-/***************************** Constants *******************************/
-
-/***************************** Datatypes *******************************/
-
-/***************************** Variables *******************************/
-
-/****************************** Macros *********************************/
-
-/***************************** Functions *******************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/* include rest of definitions from generic file (do not move it to
- another position!) */
-#include "target_generic_misc.h"
-
-#endif /* __TARGET_NATIVE_MISC__ */
-
-/* end of file */
-
diff --git a/libjava/classpath/native/target/Linux/target_native_network.h b/libjava/classpath/native/target/Linux/target_native_network.h
deleted file mode 100644
index 23f9d0a6286..00000000000
--- a/libjava/classpath/native/target/Linux/target_native_network.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* ???.h - ???
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-Description: Linux target defintions of network functions
-Systems : all
-*/
-
-#ifndef __TARGET_NATIVE_NETWORK__
-#define __TARGET_NATIVE_NETWORK__
-
-/****************************** Includes *******************************/
-/* do not move; needed here because of some macro definitions */
-#include <config.h>
-
-#include <stdlib.h>
-
-/****************** Conditional compilation switches *******************/
-
-/***************************** Constants *******************************/
-
-/***************************** Datatypes *******************************/
-
-/***************************** Variables *******************************/
-
-/****************************** Macros *********************************/
-
-/***************************** Functions *******************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/* include rest of definitions from generic file (do not move it to
- another position!) */
-#include "target_generic_network.h"
-
-#endif /* __TARGET_NATIVE_NETWORK__ */
-
-/* end of file */
-
diff --git a/libjava/classpath/native/target/Makefile.am b/libjava/classpath/native/target/Makefile.am
deleted file mode 100644
index ba0ad791919..00000000000
--- a/libjava/classpath/native/target/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-## Input file for automake to generate the Makefile.in used by configure
-
-SUBDIRS = Linux generic
-
-EXTRA_DIST = readme.txt
diff --git a/libjava/classpath/native/target/Makefile.in b/libjava/classpath/native/target/Makefile.in
deleted file mode 100644
index a69acdc1cda..00000000000
--- a/libjava/classpath/native/target/Makefile.in
+++ /dev/null
@@ -1,604 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = native/target
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
- $(top_srcdir)/../../config/lead-dot.m4 \
- $(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
- $(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
- $(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/include/config.h
-CONFIG_CLEAN_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-exec-recursive install-info-recursive \
- install-recursive installcheck-recursive installdirs-recursive \
- pdf-recursive ps-recursive uninstall-info-recursive \
- uninstall-recursive
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
-BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CLASSPATH_CONVENIENCE = @CLASSPATH_CONVENIENCE@
-CLASSPATH_INCLUDES = @CLASSPATH_INCLUDES@
-CLASSPATH_MODULE = @CLASSPATH_MODULE@
-COLLECTIONS_PREFIX = @COLLECTIONS_PREFIX@
-CP = @CP@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CREATE_ALSA_LIBRARIES_FALSE = @CREATE_ALSA_LIBRARIES_FALSE@
-CREATE_ALSA_LIBRARIES_TRUE = @CREATE_ALSA_LIBRARIES_TRUE@
-CREATE_API_DOCS_FALSE = @CREATE_API_DOCS_FALSE@
-CREATE_API_DOCS_TRUE = @CREATE_API_DOCS_TRUE@
-CREATE_COLLECTIONS_FALSE = @CREATE_COLLECTIONS_FALSE@
-CREATE_COLLECTIONS_TRUE = @CREATE_COLLECTIONS_TRUE@
-CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@
-CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@
-CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@
-CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@
-CREATE_GCONF_PEER_LIBRARIES_FALSE = @CREATE_GCONF_PEER_LIBRARIES_FALSE@
-CREATE_GCONF_PEER_LIBRARIES_TRUE = @CREATE_GCONF_PEER_LIBRARIES_TRUE@
-CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@
-CREATE_GTK_PEER_LIBRARIES_TRUE = @CREATE_GTK_PEER_LIBRARIES_TRUE@
-CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
-CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
-CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
-CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
-CREATE_PLUGIN_FALSE = @CREATE_PLUGIN_FALSE@
-CREATE_PLUGIN_TRUE = @CREATE_PLUGIN_TRUE@
-CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
-CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
-CREATE_WRAPPERS_FALSE = @CREATE_WRAPPERS_FALSE@
-CREATE_WRAPPERS_TRUE = @CREATE_WRAPPERS_TRUE@
-CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
-CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATE = @DATE@
-DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-ECJ = @ECJ@
-EGREP = @EGREP@
-ENABLE_LOCAL_SOCKETS_FALSE = @ENABLE_LOCAL_SOCKETS_FALSE@
-ENABLE_LOCAL_SOCKETS_TRUE = @ENABLE_LOCAL_SOCKETS_TRUE@
-ERROR_CFLAGS = @ERROR_CFLAGS@
-EXAMPLESDIR = @EXAMPLESDIR@
-EXEEXT = @EXEEXT@
-FASTJAR = @FASTJAR@
-FIND = @FIND@
-FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
-FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
-FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
-FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
-FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
-FOUND_GCJX_TRUE = @FOUND_GCJX_TRUE@
-FOUND_GCJ_FALSE = @FOUND_GCJ_FALSE@
-FOUND_GCJ_TRUE = @FOUND_GCJ_TRUE@
-FOUND_JIKES_FALSE = @FOUND_JIKES_FALSE@
-FOUND_JIKES_TRUE = @FOUND_JIKES_TRUE@
-FOUND_KJC_FALSE = @FOUND_KJC_FALSE@
-FOUND_KJC_TRUE = @FOUND_KJC_TRUE@
-FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
-FREETYPE2_LIBS = @FREETYPE2_LIBS@
-GCJ = @GCJ@
-GCJX = @GCJX@
-GCONF_CFLAGS = @GCONF_CFLAGS@
-GCONF_LIBS = @GCONF_LIBS@
-GDK_CFLAGS = @GDK_CFLAGS@
-GDK_LIBS = @GDK_LIBS@
-GJDOC = @GJDOC@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_LIBS = @GLIB_LIBS@
-GTK_CFLAGS = @GTK_CFLAGS@
-GTK_LIBS = @GTK_LIBS@
-INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
-INSTALL_CLASS_FILES_FALSE = @INSTALL_CLASS_FILES_FALSE@
-INSTALL_CLASS_FILES_TRUE = @INSTALL_CLASS_FILES_TRUE@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_GLIBJ_ZIP_FALSE = @INSTALL_GLIBJ_ZIP_FALSE@
-INSTALL_GLIBJ_ZIP_TRUE = @INSTALL_GLIBJ_ZIP_TRUE@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
-JAY = @JAY@
-JAY_SKELETON = @JAY_SKELETON@
-JIKES = @JIKES@
-JIKESENCODING = @JIKESENCODING@
-JIKESWARNINGS = @JIKESWARNINGS@
-KJC = @KJC@
-LDFLAGS = @LDFLAGS@
-LIBDEBUG = @LIBDEBUG@
-LIBICONV = @LIBICONV@
-LIBMAGIC = @LIBMAGIC@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBVERSION = @LIBVERSION@
-LN_S = @LN_S@
-LTLIBICONV = @LTLIBICONV@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-MKDIR = @MKDIR@
-MOC = @MOC@
-MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
-MOZILLA_LIBS = @MOZILLA_LIBS@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
-PANGOFT2_LIBS = @PANGOFT2_LIBS@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PATH_TO_ESCHER = @PATH_TO_ESCHER@
-PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
-PERL = @PERL@
-PKG_CONFIG = @PKG_CONFIG@
-PLUGIN_DIR = @PLUGIN_DIR@
-QT_CFLAGS = @QT_CFLAGS@
-QT_LIBS = @QT_LIBS@
-RANLIB = @RANLIB@
-REGEN_PARSERS_FALSE = @REGEN_PARSERS_FALSE@
-REGEN_PARSERS_TRUE = @REGEN_PARSERS_TRUE@
-REMOVE = @REMOVE@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRICT_WARNING_CFLAGS = @STRICT_WARNING_CFLAGS@
-STRIP = @STRIP@
-USER_CLASSLIB = @USER_CLASSLIB@
-USER_JAVAH = @USER_JAVAH@
-USER_SPECIFIED_CLASSLIB_FALSE = @USER_SPECIFIED_CLASSLIB_FALSE@
-USER_SPECIFIED_CLASSLIB_TRUE = @USER_SPECIFIED_CLASSLIB_TRUE@
-USER_SPECIFIED_JAVAH_FALSE = @USER_SPECIFIED_JAVAH_FALSE@
-USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
-USE_ESCHER_FALSE = @USE_ESCHER_FALSE@
-USE_ESCHER_TRUE = @USE_ESCHER_TRUE@
-USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
-USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
-VERSION = @VERSION@
-VM_BINARY = @VM_BINARY@
-WARNING_CFLAGS = @WARNING_CFLAGS@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-XSLT_CFLAGS = @XSLT_CFLAGS@
-XSLT_LIBS = @XSLT_LIBS@
-XTEST_LIBS = @XTEST_LIBS@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-ZIP = @ZIP@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-default_toolkit = @default_toolkit@
-exec_prefix = @exec_prefix@
-glibjdir = @glibjdir@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-nativeexeclibdir = @nativeexeclibdir@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
-vm_classes = @vm_classes@
-SUBDIRS = Linux generic
-EXTRA_DIST = readme.txt
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu native/target/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu native/target/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
- list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test -d "$(distdir)/$$subdir" \
- || $(mkdir_p) "$(distdir)/$$subdir" \
- || exit 1; \
- distdir=`$(am__cd) $(distdir) && pwd`; \
- top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
- (cd $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$top_distdir" \
- distdir="$$distdir/$$subdir" \
- distdir) \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool \
- distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-recursive
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-info-am
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
- clean clean-generic clean-libtool clean-recursive ctags \
- ctags-recursive distclean distclean-generic distclean-libtool \
- distclean-recursive distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-exec install-exec-am install-info \
- install-info-am install-man install-strip installcheck \
- installcheck-am installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic maintainer-clean-recursive \
- mostlyclean mostlyclean-generic mostlyclean-libtool \
- mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
- uninstall uninstall-am uninstall-info-am
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/libjava/classpath/native/target/generic/Makefile.am b/libjava/classpath/native/target/generic/Makefile.am
deleted file mode 100644
index bc8413c3a75..00000000000
--- a/libjava/classpath/native/target/generic/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-## Input file for automake to generate the Makefile.in used by configure
-
-EXTRA_DIST = \
-target_generic_io.h \
-target_generic_misc.h \
-target_generic.h \
-target_generic_math_float.h \
-target_generic_network.h \
-target_generic_file.h \
-target_generic_math_int.h
diff --git a/libjava/classpath/native/target/generic/Makefile.in b/libjava/classpath/native/target/generic/Makefile.in
deleted file mode 100644
index 1acabd209a3..00000000000
--- a/libjava/classpath/native/target/generic/Makefile.in
+++ /dev/null
@@ -1,454 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../../..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = native/target/generic
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
- $(top_srcdir)/../../config/lead-dot.m4 \
- $(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
- $(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
- $(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/include/config.h
-CONFIG_CLEAN_FILES =
-SOURCES =
-DIST_SOURCES =
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
-BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CLASSPATH_CONVENIENCE = @CLASSPATH_CONVENIENCE@
-CLASSPATH_INCLUDES = @CLASSPATH_INCLUDES@
-CLASSPATH_MODULE = @CLASSPATH_MODULE@
-COLLECTIONS_PREFIX = @COLLECTIONS_PREFIX@
-CP = @CP@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CREATE_ALSA_LIBRARIES_FALSE = @CREATE_ALSA_LIBRARIES_FALSE@
-CREATE_ALSA_LIBRARIES_TRUE = @CREATE_ALSA_LIBRARIES_TRUE@
-CREATE_API_DOCS_FALSE = @CREATE_API_DOCS_FALSE@
-CREATE_API_DOCS_TRUE = @CREATE_API_DOCS_TRUE@
-CREATE_COLLECTIONS_FALSE = @CREATE_COLLECTIONS_FALSE@
-CREATE_COLLECTIONS_TRUE = @CREATE_COLLECTIONS_TRUE@
-CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@
-CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@
-CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@
-CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@
-CREATE_GCONF_PEER_LIBRARIES_FALSE = @CREATE_GCONF_PEER_LIBRARIES_FALSE@
-CREATE_GCONF_PEER_LIBRARIES_TRUE = @CREATE_GCONF_PEER_LIBRARIES_TRUE@
-CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@
-CREATE_GTK_PEER_LIBRARIES_TRUE = @CREATE_GTK_PEER_LIBRARIES_TRUE@
-CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
-CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
-CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
-CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
-CREATE_PLUGIN_FALSE = @CREATE_PLUGIN_FALSE@
-CREATE_PLUGIN_TRUE = @CREATE_PLUGIN_TRUE@
-CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
-CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
-CREATE_WRAPPERS_FALSE = @CREATE_WRAPPERS_FALSE@
-CREATE_WRAPPERS_TRUE = @CREATE_WRAPPERS_TRUE@
-CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
-CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATE = @DATE@
-DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-ECJ = @ECJ@
-EGREP = @EGREP@
-ENABLE_LOCAL_SOCKETS_FALSE = @ENABLE_LOCAL_SOCKETS_FALSE@
-ENABLE_LOCAL_SOCKETS_TRUE = @ENABLE_LOCAL_SOCKETS_TRUE@
-ERROR_CFLAGS = @ERROR_CFLAGS@
-EXAMPLESDIR = @EXAMPLESDIR@
-EXEEXT = @EXEEXT@
-FASTJAR = @FASTJAR@
-FIND = @FIND@
-FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
-FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
-FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
-FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
-FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
-FOUND_GCJX_TRUE = @FOUND_GCJX_TRUE@
-FOUND_GCJ_FALSE = @FOUND_GCJ_FALSE@
-FOUND_GCJ_TRUE = @FOUND_GCJ_TRUE@
-FOUND_JIKES_FALSE = @FOUND_JIKES_FALSE@
-FOUND_JIKES_TRUE = @FOUND_JIKES_TRUE@
-FOUND_KJC_FALSE = @FOUND_KJC_FALSE@
-FOUND_KJC_TRUE = @FOUND_KJC_TRUE@
-FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
-FREETYPE2_LIBS = @FREETYPE2_LIBS@
-GCJ = @GCJ@
-GCJX = @GCJX@
-GCONF_CFLAGS = @GCONF_CFLAGS@
-GCONF_LIBS = @GCONF_LIBS@
-GDK_CFLAGS = @GDK_CFLAGS@
-GDK_LIBS = @GDK_LIBS@
-GJDOC = @GJDOC@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_LIBS = @GLIB_LIBS@
-GTK_CFLAGS = @GTK_CFLAGS@
-GTK_LIBS = @GTK_LIBS@
-INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
-INSTALL_CLASS_FILES_FALSE = @INSTALL_CLASS_FILES_FALSE@
-INSTALL_CLASS_FILES_TRUE = @INSTALL_CLASS_FILES_TRUE@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_GLIBJ_ZIP_FALSE = @INSTALL_GLIBJ_ZIP_FALSE@
-INSTALL_GLIBJ_ZIP_TRUE = @INSTALL_GLIBJ_ZIP_TRUE@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
-JAY = @JAY@
-JAY_SKELETON = @JAY_SKELETON@
-JIKES = @JIKES@
-JIKESENCODING = @JIKESENCODING@
-JIKESWARNINGS = @JIKESWARNINGS@
-KJC = @KJC@
-LDFLAGS = @LDFLAGS@
-LIBDEBUG = @LIBDEBUG@
-LIBICONV = @LIBICONV@
-LIBMAGIC = @LIBMAGIC@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIBVERSION = @LIBVERSION@
-LN_S = @LN_S@
-LTLIBICONV = @LTLIBICONV@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-MKDIR = @MKDIR@
-MOC = @MOC@
-MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
-MOZILLA_LIBS = @MOZILLA_LIBS@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
-PANGOFT2_LIBS = @PANGOFT2_LIBS@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PATH_TO_ESCHER = @PATH_TO_ESCHER@
-PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
-PERL = @PERL@
-PKG_CONFIG = @PKG_CONFIG@
-PLUGIN_DIR = @PLUGIN_DIR@
-QT_CFLAGS = @QT_CFLAGS@
-QT_LIBS = @QT_LIBS@
-RANLIB = @RANLIB@
-REGEN_PARSERS_FALSE = @REGEN_PARSERS_FALSE@
-REGEN_PARSERS_TRUE = @REGEN_PARSERS_TRUE@
-REMOVE = @REMOVE@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRICT_WARNING_CFLAGS = @STRICT_WARNING_CFLAGS@
-STRIP = @STRIP@
-USER_CLASSLIB = @USER_CLASSLIB@
-USER_JAVAH = @USER_JAVAH@
-USER_SPECIFIED_CLASSLIB_FALSE = @USER_SPECIFIED_CLASSLIB_FALSE@
-USER_SPECIFIED_CLASSLIB_TRUE = @USER_SPECIFIED_CLASSLIB_TRUE@
-USER_SPECIFIED_JAVAH_FALSE = @USER_SPECIFIED_JAVAH_FALSE@
-USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
-USE_ESCHER_FALSE = @USE_ESCHER_FALSE@
-USE_ESCHER_TRUE = @USE_ESCHER_TRUE@
-USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
-USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
-VERSION = @VERSION@
-VM_BINARY = @VM_BINARY@
-WARNING_CFLAGS = @WARNING_CFLAGS@
-XML_CFLAGS = @XML_CFLAGS@
-XML_LIBS = @XML_LIBS@
-XSLT_CFLAGS = @XSLT_CFLAGS@
-XSLT_LIBS = @XSLT_LIBS@
-XTEST_LIBS = @XTEST_LIBS@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-ZIP = @ZIP@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-default_toolkit = @default_toolkit@
-exec_prefix = @exec_prefix@
-glibjdir = @glibjdir@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-nativeexeclibdir = @nativeexeclibdir@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
-vm_classes = @vm_classes@
-EXTRA_DIST = \
-target_generic_io.h \
-target_generic_misc.h \
-target_generic.h \
-target_generic_math_float.h \
-target_generic_network.h \
-target_generic_file.h \
-target_generic_math_int.h
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu native/target/generic/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu native/target/generic/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-tags: TAGS
-TAGS:
-
-ctags: CTAGS
-CTAGS:
-
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- distclean distclean-generic distclean-libtool distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-exec install-exec-am \
- install-info install-info-am install-man install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
- uninstall-info-am
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/libjava/classpath/native/target/generic/target_generic.h b/libjava/classpath/native/target/generic/target_generic.h
deleted file mode 100644
index c2264330d28..00000000000
--- a/libjava/classpath/native/target/generic/target_generic.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/* generic_math_int64.h - Native methods for 64bit math operations
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-Description: generic target global defintions
-Systems : all
-*/
-
-#ifndef __TARGET_GENERIC__
-#define __TARGET_GENERIC__
-
-/* check if target_native_network.h included */
-#ifndef __TARGET_NATIVE__
- #error Do NOT INCLUDE generic target files! Include the corresponding native target files instead!
-#endif
-
-/****************************** Includes *******************************/
-/* do not move; needed here because of some macro definitions */
-#include "config.h"
-
-#include <stdlib.h>
-#include <errno.h>
-
-/****************** Conditional compilation switches *******************/
-
-/***************************** Constants *******************************/
-#define TARGET_NATIVE_OK 1
-#define TARGET_NATIVE_ERROR 0
-
-#ifndef TARGET_NATIVE_ERROR_PERMISION_DENIED
- #define TARGET_NATIVE_ERROR_PERMISION_DENIED EACCES
-#endif
-#ifndef TARGET_NATIVE_ERROR_BAD_FILE_DESCRIPTOR
- #define TARGET_NATIVE_ERROR_BAD_FILE_DESCRIPTOR EBADF
-#endif
-#ifndef TARGET_NATIVE_ERROR_FILE_EXISTS
- #define TARGET_NATIVE_ERROR_FILE_EXISTS EEXIST
-#endif
-#ifndef TARGET_NATIVE_ERROR_INPUT_OUTPUT
- #define TARGET_NATIVE_ERROR_INPUT_OUTPUT EIO
-#endif
-#ifndef TARGET_NATIVE_ERROR_TOO_MANY_OPEN_FILES
- #define TARGET_NATIVE_ERROR_TOO_MANY_OPEN_FILES EMFILE
-#endif
-#ifndef TARGET_NATIVE_ERROR_FILENAME_TO_LONG
- #define TARGET_NATIVE_ERROR_FILENAME_TO_LONG ENAMETOOLONG
-#endif
-#ifndef TARGET_NATIVE_ERROR_NO_SUCH_DEVICE
- #define TARGET_NATIVE_ERROR_NO_SUCH_DEVICE ENODEV
-#endif
-#ifndef TARGET_NATIVE_ERROR_NO_SUCH_FILE
- #define TARGET_NATIVE_ERROR_NO_SUCH_FILE ENOENT
-#endif
-#ifndef TARGET_NATIVE_ERROR_NO_SPACE_LEFT
- #define TARGET_NATIVE_ERROR_NO_SPACE_LEFT ENOSPC
-#endif
-#ifndef TARGET_NATIVE_ERROR_DIRECTORY_NOT_EMPTY
- #define TARGET_NATIVE_ERROR_DIRECTORY_NOT_EMPTY ENOTEMPTY
-#endif
-#ifndef TARGET_NATIVE_ERROR_OPERATION_NOT_PERMITTED
- #define TARGET_NATIVE_ERROR_OPERATION_NOT_PERMITTED EPERM
-#endif
-#ifndef TARGET_NATIVE_ERROR_READ_ONLY_FILE_SYSTEM
- #define TARGET_NATIVE_ERROR_READ_ONLY_FILE_SYSTEM EROFS
-#endif
-#ifndef TARGET_NATIVE_ERROR_INVALID_SEEK
- #define TARGET_NATIVE_ERROR_INVALID_SEEK ESPIPE
-#endif
-#ifndef TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL
- #define TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL EINTR
-#endif
-
-/***************************** Datatypes *******************************/
-
-/***************************** Variables *******************************/
-
-/****************************** Macros *********************************/
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_LAST_ERROR
-* Purpose : return last error code
-* Input : -
-* Output : -
-* Return : error code
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_LAST_ERROR
- #include <errno.h>
- #define TARGET_NATIVE_LAST_ERROR() \
- errno
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_LAST_ERROR_STRING
-* Purpose : return last error string
-* Input : -
-* Output : -
-* Return : error string (read only!)
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_LAST_ERROR_STRING
- #include <string.h>
- #include <errno.h>
- #define TARGET_NATIVE_LAST_ERROR_STRING() \
- strerror(errno)
-#endif
-
-#ifndef TARGET_NATIVE_LAST_ERROR_STRING_FORMAT
- #include <string.h>
- #include <errno.h>
- #define TARGET_NATIVE_LAST_ERROR_STRING_FORMAT(buffer,bufferSize,format) \
- do { \
- sprintf(buffer, "%s", format); \
- strcat(" (error: "); \
- strcat(strerror(errno)); \
- strcat(")"); \
- } while (0)
-#endif
-
-/***************************** Functions *******************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TARGET_GENERIC__ */
-
-/* end of file */
-
diff --git a/libjava/classpath/native/target/generic/target_generic_file.h b/libjava/classpath/native/target/generic/target_generic_file.h
deleted file mode 100644
index cd90e733ced..00000000000
--- a/libjava/classpath/native/target/generic/target_generic_file.h
+++ /dev/null
@@ -1,844 +0,0 @@
-/* target_generic_file - Native methods for file operations
- Copyright (C) 1998, 2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-Description: generic target defintions of file functions
-Systems : all
-*/
-
-#ifndef __TARGET_GENERIC_FILE__
-#define __TARGET_GENERIC_FILE__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* check if target_native_file.h included */
-#ifndef __TARGET_NATIVE_FILE__
- #error Do NOT INCLUDE generic target files! Include the corresponding native target files instead!
-#endif
-
-/****************************** Includes *******************************/
-/* do not move; needed here because of some macro definitions */
-#include "config.h"
-
-#include <stdlib.h>
-#include <assert.h>
-#include <fcntl.h>
-
-#include "target_native.h"
-#include "target_native_math_int.h"
-
-/****************** Conditional compilation switches *******************/
-
-/***************************** Constants *******************************/
-#ifndef TARGET_NATIVE_FILE_FILEFLAG_NONE
- #define TARGET_NATIVE_FILE_FILEFLAG_NONE 0
-#endif
-#ifndef TARGET_NATIVE_FILE_FILEFLAG_CREATE
- #define TARGET_NATIVE_FILE_FILEFLAG_CREATE O_CREAT
-#endif
-#ifndef TARGET_NATIVE_FILE_FILEFLAG_CREATE_FORCE
- #define TARGET_NATIVE_FILE_FILEFLAG_CREATE_FORCE (O_CREAT|O_EXCL)
-#endif
-#ifndef TARGET_NATIVE_FILE_FILEFLAG_READ
- #define TARGET_NATIVE_FILE_FILEFLAG_READ O_RDONLY
-#endif
-#ifndef TARGET_NATIVE_FILE_FILEFLAG_WRITE
- #define TARGET_NATIVE_FILE_FILEFLAG_WRITE O_WRONLY
-#endif
-#ifndef TARGET_NATIVE_FILE_FILEFLAG_READWRITE
- #define TARGET_NATIVE_FILE_FILEFLAG_READWRITE O_RDWR
-#endif
-#ifndef TARGET_NATIVE_FILE_FILEFLAG_TRUNCATE
- #define TARGET_NATIVE_FILE_FILEFLAG_TRUNCATE O_TRUNC
-#endif
-#ifndef TARGET_NATIVE_FILE_FILEFLAG_APPEND
- #define TARGET_NATIVE_FILE_FILEFLAG_APPEND O_APPEND
-#endif
-#ifndef TARGET_NATIVE_FILE_FILEFLAG_SYNC
- #if !defined (O_SYNC) && defined (O_FSYNC)
- #define TARGET_NATIVE_FILE_FILEFLAG_SYNC O_FSYNC
- #else
- #define TARGET_NATIVE_FILE_FILEFLAG_SYNC O_SYNC
- #endif
-#endif
-#ifndef TARGET_NATIVE_FILE_FILEFLAG_DSYNC
- #ifdef O_DSYNC
- #define TARGET_NATIVE_FILE_FILEFLAG_DSYNC 0
- #else
- #define TARGET_NATIVE_FILE_FILEFLAG_DSYNC TARGET_NATIVE_FILE_FILEFLAG_SYNC
- #endif
-#endif
-#ifndef TARGET_NATIVE_FILE_FILEFLAG_BINARY
- #define TARGET_NATIVE_FILE_FILEFLAG_BINARY O_BINARY
-#endif
-
-#ifndef TARGET_NATIVE_FILE_FILEPERMISSION_NORMAL
- #define TARGET_NATIVE_FILE_FILEPERMISSION_NORMAL (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
-#endif
-
-#ifndef TARGET_NATIVE_FILE_FILEPERMISSION_PRIVATE
- #define TARGET_NATIVE_FILE_FILEPERMISSION_PRIVATE (S_IRUSR | S_IWUSR)
-#endif
-
-#ifndef TARGET_NATIVE_FILE_FILEPERMISSION_READONLY
- #define TARGET_NATIVE_FILE_FILEPERMISSION_READONLY (~(S_IWRITE|S_IWGRP|S_IWOTH))
-#endif
-
-/***************************** Datatypes *******************************/
-
-/***************************** Variables *******************************/
-
-/****************************** Macros *********************************/
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_OPEN
-* Purpose : open a file
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : file is created if it does not exist
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_OPEN
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- #define TARGET_NATIVE_FILE_OPEN(filename,filedescriptor,flags,permissions,result) \
- do { \
- filedescriptor=open(filename, \
- flags, \
- permissions \
- ); \
- if (filedescriptor >= 0) \
- fcntl (filedescriptor,F_SETFD,FD_CLOEXEC); \
- result=(filedescriptor>=0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_OPEN_CREATE
-* Purpose : create a file
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : file is created if it does not exist
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_OPEN_CREATE
- #define TARGET_NATIVE_FILE_OPEN_CREATE(filename,filedescriptor,result) \
- TARGET_NATIVE_FILE_OPEN(filename,\
- filedescriptor,\
- TARGET_NATIVE_FILE_FILEFLAG_CREATE_FORCE, \
- TARGET_NATIVE_FILE_FILEPERMISSION_NORMAL, \
- result \
- )
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_OPEN_READ
-* Purpose : open an existing file for reading
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_OPEN_READ
- #define TARGET_NATIVE_FILE_OPEN_READ(filename,filedescriptor,result) \
- TARGET_NATIVE_FILE_OPEN(filename, \
- filedescriptor,\
- TARGET_NATIVE_FILE_FILEFLAG_READ, \
- TARGET_NATIVE_FILE_FILEPERMISSION_NORMAL, \
- result \
- )
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_OPEN_WRITE
-* Purpose : open an existing file for writing
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_OPEN_WRITE
- #define TARGET_NATIVE_FILE_OPEN_WRITE(filename,filedescriptor,result) \
- TARGET_NATIVE_FILE_OPEN(filename, \
- filedescriptor, \
- TARGET_NATIVE_FILE_FILEFLAG_WRITE, \
- TARGET_NATIVE_FILE_FILEPERMISSION_NORMAL, \
- result \
- )
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_OPEN_READWRITE
-* Purpose : create/open a file for reading/writing
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : file is created if it does not exist
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_OPEN_READWRITE
- #define TARGET_NATIVE_FILE_OPEN_READWRITE(filename,filedescriptor,result) \
- TARGET_NATIVE_FILE_OPEN(filename, \
- filedescriptor, \
- TARGET_NATIVE_FILE_FILEFLAG_READWRITE, \
- TARGET_NATIVE_FILE_FILEPERMISSION_NORMAL, \
- result \
- )
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_OPEN_READWRITE
-* Purpose : create/open a file for append
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : file is created if it does not exist
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_OPEN_APPEND
- #define TARGET_NATIVE_FILE_OPEN_APPEND(filename,filedescriptor,result) \
- TARGET_NATIVE_FILE_OPEN_APPEND(filename, \
- filedescriptor, \
- TARGET_NATIVE_FILE_FILEFLAG_CREATE_FORCE|TARGET_NATIVE_FILE_FILEFLAG_APPEND, \
- TARGET_NATIVE_FILE_FILEPERMISSION_NORMAL, \
- result \
- )
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_CLOSE
-* Purpose : close a file
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_CLOSE
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_CLOSE(filedescriptor,result) \
- do { \
- result=(close(filedescriptor)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_VALID_FILE_DESCRIPTOR
-* Purpose : check if file-descriptor is valid
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_VALID_FILE_DESCRIPTOR
- #if defined(HAVE_FCNTL)
- #include <unistd.h>
- #include <fcntl.h>
- #define TARGET_NATIVE_FILE_VALID_FILE_DESCRIPTOR(filedescriptor,result) \
- do { \
- result=(fcntl(filedescriptor,F_GETFL,0)!=-1)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while(0)
- #elif defined(HAVE_FSTAT)
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_VALID_FILE_DESCRIPTOR(filedescriptor,result) \
- do { \
- struct stat __stat; \
- \
- result=(fstat(filedescriptor,&__stat)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while(0)
- #else
- #error fcntl() nor fstat() available for checking if file descriptor is valid
- #endif
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_TELL
-* Purpose : get current file position
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_TELL
- #include <sys/types.h>
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_TELL(filedescriptor,offset,result) \
- do { \
- offset=lseek(filedescriptor,TARGET_NATIVE_MATH_INT_INT64_CONST_0,SEEK_CUR); \
- result=((offset)!=(off_t)-1)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_SEEK_BEGIN|CURRENT|END
-* Purpose : set file position relativ to begin/current/end
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_SEEK_BEGIN
- #include <sys/types.h>
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_SEEK_BEGIN(filedescriptor,offset,newoffset,result) \
- do { \
- newoffset=lseek(filedescriptor,offset,SEEK_SET); \
- result=((newoffset)!=(off_t)-1)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_FILE_SEEK_CURRENT
- #include <sys/types.h>
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_SEEK_CURRENT(filedescriptor,offset,newoffset,result) \
- do { \
- newoffset=lseek(filedescriptor,offset,SEEK_CUR); \
- result=((newoffset)!=(off_t)-1)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_FILE_SEEK_END
- #include <sys/types.h>
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_SEEK_END(filedescriptor,offset,newoffset,result) \
- do { \
- newoffset=lseek(filedescriptor,offset,SEEK_END); \
- result=((newoffset)!=(off_t)-1)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_TRUNCATE
-* Purpose : truncate a file
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_TRUNCATE
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_TRUNCATE(filedescriptor,offset,result) \
- do { \
- result=(ftruncate(filedescriptor,offset)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_SIZE
-* Purpose : get size of file (in bytes)
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_SIZE
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_SIZE(filedescriptor,length,result) \
- do { \
- struct stat __statBuffer; \
- \
- result=(fstat(filedescriptor,&__statBuffer)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- length=TARGET_NATIVE_MATH_INT_INT32_TO_INT64(__statBuffer.st_size); \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_AVAILABLE
-* Purpose : get available bytes for read
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_AVAILABLE
- #ifdef HAVE_SYS_IOCTL_H
- #define BSD_COMP /* Get FIONREAD on Solaris2 */
- #include <sys/ioctl.h>
- #endif
- #ifdef HAVE_SYS_FILIO_H /* Get FIONREAD on Solaris 2.5 */
- #include <sys/filio.h>
- #endif
- #if defined (FIONREAD)
- #define TARGET_NATIVE_FILE_AVAILABLE(filedescriptor,length,result) \
- do { \
- ssize_t __n; \
- \
- result=(ioctl(filedescriptor,FIONREAD,(char*)&__n)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- length=TARGET_NATIVE_MATH_INT_INT32_TO_INT64(__n); \
- } while (0)
- #elif defined(HAVE_FSTAT)
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_AVAILABLE(filedescriptor,length,result) \
- do { \
- struct stat __statBuffer; \
- off_t __n; \
- \
- length=0; \
- \
- if ((fstat(filedescriptor,&__statBuffer)==0) && S_ISREG(__statBuffer.st_mode)) \
- { \
- __n=(lseek(filedescriptor,0,SEEK_CUR)); \
- if (__n!=-1) \
- { \
- length=TARGET_NATIVE_MATH_INT_INT32_TO_INT64(__statBuffer.st_size-__n); \
- result=TARGET_NATIVE_OK; \
- } \
- else \
- { \
- result=TARGET_NATIVE_ERROR; \
- } \
- } \
- else \
- { \
- result=TARGET_NATIVE_ERROR; \
- } \
- } while (0)
- #elif defined(HAVE_SELECT)
- #include <string.h>
- #include <sys/select.h>
- #define TARGET_NATIVE_FILE_AVAILABLE(filedescriptor,length,result) \
- do { \
- fd_set __filedescriptset; \
- struct timeval __timeval; \
- \
- length=0; \
- \
- FD_ZERO(&__filedescriptset); \
- FD_SET(filedescriptor,&__filedescriptset); \
- memset(&__timeval,0,sizeof(__timeval)); \
- switch (select(filedescriptor+1,&__filedescriptset,NULL,NULL,&__timeval)==0) \
- { \
- case -1: result=TARGET_NATIVE_ERROR; break; \
- case 0: length=JNI_JLONG_CONST_0; result=TARGET_NATIVE_OK; break; \
- default: length=JNI_JLONG_CONST_1; result=TARGET_NATIVE_OK; break; \
- } \
- } while (0)
- #else
- #define TARGET_NATIVE_FILE_AVAILABLE(filedescriptor,length,result) \
- do { \
- errno=TARGET_NATIVE_ERROR_OPERATION_NOT_PERMITTED; \
- length=0; \
- result=TARGET_NATIVE_ERROR; \
- } while (0)
- #endif
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_READ|WRITE
-* Purpose : read/write from/to frile
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_READ
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_READ(filedescriptor,buffer,length,bytesRead,result) \
- do { \
- bytesRead=read(filedescriptor,buffer,length); \
- result=(bytesRead!=-1)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_FILE_WRITE
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_WRITE(filedescriptor,buffer,length,bytesWritten,result) \
- do { \
- bytesWritten=write(filedescriptor,buffer,length); \
- result=(bytesWritten!=-1)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_SET_MODE_READONLY
-* Purpose : set file mode to read-only
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_SET_MODE_READONLY
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_SET_MODE_READONLY(filename,result) \
- do { \
- struct stat __statBuffer; \
- \
- if (stat(filename,&__statBuffer)==0) { \
- result=(chmod(filename,__statBuffer.st_mode & TARGET_NATIVE_FILE_FILEPERMISSION_READONLY)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } else { \
- result=TARGET_NATIVE_ERROR; \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_EXISTS
-* Purpose : check if file exists
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_EXISTS
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_EXISTS(filename,result) \
- do { \
- struct stat __statBuffer; \
- \
- result=(stat(filename,&__statBuffer)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_IS_FILE
-* Purpose : check if directory entry is a file
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_IS_FILE
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_IS_FILE(filename,result) \
- do { \
- struct stat __statBuffer; \
- \
- result=((stat(filename,&__statBuffer)==0) && (S_ISREG(__statBuffer.st_mode)))?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_IS_DIRECTORY
-* Purpose : check if directory entry is a directory
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_IS_DIRECTORY
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_IS_DIRECTORY(filename,result) \
- do { \
- struct stat __statBuffer; \
- \
- result=((stat(filename,&__statBuffer)==0) && (S_ISDIR(__statBuffer.st_mode)))?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_GET_LAST_MODIFIED
-* Purpose : get last modification time of file (milliseconds)
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_GET_LAST_MODIFIED
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_GET_LAST_MODIFIED(filename,time,result) \
- do { \
- struct stat __statBuffer; \
- \
- time=TARGET_NATIVE_MATH_INT_INT64_CONST_0; \
- if (stat(filename,&__statBuffer)==0) { \
- time=TARGET_NATIVE_MATH_INT_INT64_MUL(TARGET_NATIVE_MATH_INT_INT32_TO_INT64(__statBuffer.st_mtime), \
- TARGET_NATIVE_MATH_INT_INT32_TO_INT64(1000) \
- ); \
- result=TARGET_NATIVE_OK; \
- } else { \
- result=TARGET_NATIVE_ERROR; \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_SET_LAST_MODIFIED
-* Purpose : set last modification time of file (milliseconds)
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_SET_LAST_MODIFIED
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #ifdef HAVE_UTIME_H
- #include <utime.h>
- #elif HAVE_SYS_UTIME_H
- #include <sys/utime.h>
- #else
- #error utime.h not found. Please check configuration.
- #endif
- #define TARGET_NATIVE_FILE_SET_LAST_MODIFIED(filename,time,result) \
- do { \
- struct stat __statBuffer; \
- struct utimbuf __utimeBuffer; \
- \
- if (stat(filename,&__statBuffer)==0) { \
- __utimeBuffer.actime =__statBuffer.st_atime; \
- __utimeBuffer.modtime=TARGET_NATIVE_MATH_INT_INT64_TO_INT32(TARGET_NATIVE_MATH_INT_INT64_DIV(time, \
- TARGET_NATIVE_MATH_INT_INT32_TO_INT64(1000) \
- ) \
- ); \
- result=(utime(filename,&__utimeBuffer)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } else { \
- result=TARGET_NATIVE_ERROR; \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_DELETE
-* Purpose : delete a file,link or directory
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_DELETE
- #define TARGET_NATIVE_FILE_DELETE(filename,result) \
- do { \
- result=((unlink(filename)==0) || (rmdir(filename)==0))?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_RENAME
-* Purpose : delete a file, link or directory
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_RENAME
- #define TARGET_NATIVE_FILE_RENAME(oldfilename,newfilename,result) \
- do { \
- result=(rename(oldfilename,newfilename)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_MAKE_DIR
-* Purpose : create new directory
-* Input : name - directory name
-* Output : result - 1 if successful, 0 otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_MAKE_DIR
- #include <sys/stat.h>
- #define TARGET_NATIVE_FILE_MAKE_DIR(name,result) \
- do { \
- result=((mkdir(name,(S_IRWXO|S_IRWXG|S_IRWXU))==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR); \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_GET_CWD
-* Purpose : get current working directory
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_GET_CWD
- #include <unistd.h>
- #define TARGET_NATIVE_FILE_GET_CWD(path,maxPathLength,result) \
- do {\
- result=(getcwd(path,maxPathLength)!=NULL)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_OPEN_DIR
-* Purpose : open directory for reading entries.
-* Input : -
-* Output : handle - handle if not error, NULL otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_OPEN_DIR
- #include <sys/types.h>
- #include <dirent.h>
- #define TARGET_NATIVE_FILE_OPEN_DIR(filename,handle,result) \
- do { \
- handle=(void*)opendir(filename); \
- result=(handle!=NULL)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while(0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_CLOSE_DIR
-* Purpose : close directory
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_CLOSE_DIR
- #include <sys/types.h>
- #include <dirent.h>
- #define TARGET_NATIVE_FILE_CLOSE_DIR(handle,result) \
- do { \
- closedir((DIR*)handle); \
- result=TARGET_NATIVE_OK; \
- } while(0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_READ_DIR
-* Purpose : read directory entry
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-/* XXX ??? name als buffer? */
-#ifndef TARGET_NATIVE_FILE_READ_DIR
- #include <sys/types.h>
- #include <dirent.h>
- #define TARGET_NATIVE_FILE_READ_DIR(handle,name,result) \
- do { \
- struct dirent *__direntBuffer; \
- \
- name=NULL; \
- \
- __direntBuffer=readdir((DIR*)handle); \
- if (__direntBuffer!=NULL) { \
- name=__direntBuffer->d_name; \
- result=TARGET_NATIVE_OK; \
- } else { \
- result=TARGET_NATIVE_ERROR; \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FILE_FSYNC
-* Purpose : do filesystem sync
-* Input : -
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_FILE_FSYNC
- #define TARGET_NATIVE_FILE_FSYNC(filedescriptor,result) \
- do { \
- result=(fsync(filedescriptor)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while(0)
-#endif
-
-/***************************** Functions *******************************/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TARGET_GENERIC_FILE__ */
-
-/* end of file */
-
diff --git a/libjava/classpath/native/target/generic/target_generic_io.h b/libjava/classpath/native/target/generic/target_generic_io.h
deleted file mode 100644
index cc24915ab19..00000000000
--- a/libjava/classpath/native/target/generic/target_generic_io.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* generic_math_int64.h - Native methods for 64bit math operations
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-Description: generic target defintions of miscellaneous functions
-Systems : all
-*/
-
-#ifndef __TARGET_GENERIC_IO__
-#define __TARGET_GENERIC_IO__
-
-/* check if target_native_io.h included */
-#ifndef __TARGET_NATIVE_IO__
- #error Do NOT INCLUDE generic target files! Include the corresponding native target files instead!
-#endif
-
-/****************************** Includes *******************************/
-/* do not move; needed here because of some macro definitions */
-#include "config.h"
-
-#include <stdlib.h>
-#include <assert.h>
-
-#include "target_native.h"
-
-/****************** Conditional compilation switches *******************/
-
-/***************************** Constants *******************************/
-
-/***************************** Datatypes *******************************/
-
-/***************************** Variables *******************************/
-
-/****************************** Macros *********************************/
-
-/***************************** Functions *******************************/
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TARGET_GENERIC_IO__ */
-
-/* end of file */
diff --git a/libjava/classpath/native/target/generic/target_generic_math_float.h b/libjava/classpath/native/target/generic/target_generic_math_float.h
deleted file mode 100644
index e2085e08028..00000000000
--- a/libjava/classpath/native/target/generic/target_generic_math_float.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* generic_math_int64.h - Native methods for 64bit math operations
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-Description: generic target defintions of float/double constants/
- macros/functions
-Systems : all
-*/
-
-#ifndef __TARGET_GENERIC_MATH_FLOAT__
-#define __TARGET_GENERIC_MATH_FLOAT__
-
-/* check if target_native_math_float.h included */
-#ifndef __TARGET_NATIVE_MATH_FLOAT__
- #error Do NOT INCLUDE generic target files! Include the corresponding native target files instead!
-#endif
-
-/****************************** Includes *******************************/
-/* do not move; needed here because of some macro definitions */
-#include "config.h"
-
-#include <stdlib.h>
-#include <assert.h>
-
-#include <jni.h>
-
-/****************** Conditional compilation switches *******************/
-
-/***************************** Constants *******************************/
-
-/***************************** Datatypes *******************************/
-
-/***************************** Variables *******************************/
-
-/****************************** Macros *********************************/
-
-/* test float/double values for NaN,Inf */
-#ifndef TARGET_NATIVE_MATH_FLOAT_FLOAT_ISNAN
- #include <math.h>
- #define TARGET_NATIVE_MATH_FLOAT_FLOAT_ISNAN(f) isnan(f)
-#endif
-#ifndef TARGET_NATIVE_MATH_FLOAT_FLOAT_ISINF
- #include <math.h>
- #define TARGET_NATIVE_MATH_FLOAT_FLOAT_ISINF(f) isinf(f)
-#endif
-#ifndef TARGET_NATIVE_MATH_FLOAT_FLOAT_FINITE
- #include <math.h>
- #define TARGET_NATIVE_MATH_FLOAT_FLOAT_FINITE(f) finite(f)
-#endif
-
-#ifndef TARGET_NATIVE_MATH_FLOAT_DOUBLE_ISNAN
- #include <math.h>
- #define TARGET_NATIVE_MATH_FLOAT_DOUBLE_ISNAN(d) isnan(d)
-#endif
-#ifndef TARGET_NATIVE_MATH_FLOAT_DOUBLE_ISINF
- #include <math.h>
- #define TARGET_NATIVE_MATH_FLOAT_DOUBLE_ISINF(d) isinf(d)
-#endif
-#ifndef TARGET_NATIVE_MATH_FLOAT_DOUBLE_FINITE
- #include <math.h>
- #define TARGET_NATIVE_MATH_FLOAT_DOUBLE_FINITE(d) finite(d)
-#endif
-
-/* division, modulo operations (used to avoid unexcepted exceptions on some
- targets; generic codes are direct operations without checks)
-*/
-#ifndef TARGET_NATIVE_MATH_FLOAT_FLOAT_DIV
- #define TARGET_NATIVE_MATH_FLOAT_FLOAT_DIV(f0,f1) ((f0)/(f1))
-#endif
-#ifndef TARGET_NATIVE_MATH_FLOAT_FLOAT_MOD
- #include <math.h>
- #define TARGET_NATIVE_MATH_FLOAT_FLOAT_MOD(f0,f1) ((jfloat)fmod((jdouble)(f0),(jdouble)(f1)))
-#endif
-
-#ifndef TARGET_NATIVE_MATH_FLOAT_DOUBLE_DIV
- #define TARGET_NATIVE_MATH_FLOAT_DOUBLE_DIV(d0,d1) ((d0)/(d1))
-#endif
-#ifndef TARGET_NATIVE_MATH_FLOAT_DOUBLE_MOD
- #include <math.h>
- #define TARGET_NATIVE_MATH_FLOAT_DOUBLE_MOD(d0,d1) fmod(d0,d1)
-#endif
-
-/***************************** Functions *******************************/
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TARGET_GENERIC_MATH_FLOAT__ */
-
-/* end of file */
-
diff --git a/libjava/classpath/native/target/generic/target_generic_math_int.h b/libjava/classpath/native/target/generic/target_generic_math_int.h
deleted file mode 100644
index c6861487efd..00000000000
--- a/libjava/classpath/native/target/generic/target_generic_math_int.h
+++ /dev/null
@@ -1,260 +0,0 @@
-/* generic_math_int64.h - Native methods for 64bit math operations
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-Description: generic target defintions of int/int64 constants/
- macros/functions
-Systems : all
-*/
-
-#ifndef __TARGET_GENERIC_MATH_INT__
-#define __TARGET_GENERIC_MATH_INT__
-
-/* check if target_native_math_int.h included */
-#ifndef __TARGET_NATIVE_MATH_INT__
- #error Do NOT INCLUDE generic target files! Include the corresponding native target files instead!
-#endif
-
-/****************************** Includes *******************************/
-/* do not move; needed here because of some macro definitions */
-#include "config.h"
-
-#include <stdlib.h>
-#include <assert.h>
-
-/****************** Conditional compilation switches *******************/
-
-/***************************** Constants *******************************/
-#ifndef TARGET_NATIVE_MATH_INT_INT64_CONST_0
- #define TARGET_NATIVE_MATH_INT_INT64_CONST_0 0LL
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_CONST_1
- #define TARGET_NATIVE_MATH_INT_INT64_CONST_1 1LL
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_CONST_MINUS_1
- #define TARGET_NATIVE_MATH_INT_INT64_CONST_MINUS_1 -1LL
-#endif
-
-/***************************** Datatypes *******************************/
-
-/***************************** Variables *******************************/
-
-/****************************** Macros *********************************/
-
-/* math operations */
-#ifndef TARGET_NATIVE_MATH_INT_INT64_ADD
- #define TARGET_NATIVE_MATH_INT_INT64_ADD(v1,v2) ((v1)+(v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_SUB
- #define TARGET_NATIVE_MATH_INT_INT64_SUB(v1,v2) ((v1)-(v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_MUL
- #define TARGET_NATIVE_MATH_INT_INT64_MUL(v1,v2) ((v1)*(v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_DIV
- #define TARGET_NATIVE_MATH_INT_INT64_DIV(v1,v2) ((v1)/(v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_MOD
- #define TARGET_NATIVE_MATH_INT_INT64_MOD(v1,v2) ((v1)%(v2))
-#endif
-
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_ADD
- #define TARGET_NATIVE_MATH_INT_UINT64_ADD(v1,v2) ((v1)+(v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_SUB
- #define TARGET_NATIVE_MATH_INT_UINT64_SUB(v1,v2) ((v1)-(v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_MUL
- #define TARGET_NATIVE_MATH_INT_UINT64_MUL(v1,v2) ((v1)*(v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_DIV
- #define TARGET_NATIVE_MATH_INT_UINT64_DIV(v1,v2) ((v1)/(v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_MOD
- #define TARGET_NATIVE_MATH_INT_UINT64_MOD(v1,v2) ((v1)%(v2))
-#endif
-
-/* bit operations */
-#ifndef TARGET_NATIVE_MATH_INT_INT64_AND
- #define TARGET_NATIVE_MATH_INT_INT64_AND(v1,v2) ((v1)&(v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_OR
- #define TARGET_NATIVE_MATH_INT_INT64_OR(v1,v2) ((v1)|(v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_XOR
- #define TARGET_NATIVE_MATH_INT_INT64_XOR(v1,v2) ((v1)^(v2))
-#endif
-
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_AND
- #define TARGET_NATIVE_MATH_INT_UINT64_AND(v1,v2) ((v1)&(v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_OR
- #define TARGET_NATIVE_MATH_INT_UINT64_OR(v1,v2) ((v1)|(v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_XOR
- #define TARGET_NATIVE_MATH_INT_UINT64_XOR(v1,v2) ((v1)^(v2))
-#endif
-
-/* shift operations */
-#ifndef TARGET_NATIVE_MATH_INT_INT64_SHIFTL
- #define TARGET_NATIVE_MATH_INT_INT64_SHIFTL(v,l) ((v)<<(l))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_SHIFTR
- #define TARGET_NATIVE_MATH_INT_INT64_SHIFTR(v,l) (((v)>>(l)) | (((v)>=0) ? 0 : (0xffffFFFFffffFFFFLL << (64-(l)))))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_SHIFTR
- #define TARGET_NATIVE_MATH_INT_UINT64_SHIFTR(v,l) (((v)>>(l)) & ~(((v)>=0) ? 0 : (0xffffFFFFffffFFFFLL << (64-(l)))))
-#endif
-
-/* negation */
-#ifndef TARGET_NATIVE_MATH_INT_INT64_NEG
- #define TARGET_NATIVE_MATH_INT_INT64_NEG(v) (-(v))
-#endif
-
-/* increment/decrement routines */
-#ifndef TARGET_NATIVE_MATH_INT_INT64_INC
- #define TARGET_NATIVE_MATH_INT_INT64_INC(v) { v++; }
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_DEC
- #define TARGET_NATIVE_MATH_INT_INT64_DEC(v) { v--; }
-#endif
-
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_INC
- #define TARGET_NATIVE_MATH_INT_UINT64_INC(v) { v++; }
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_DEC
- #define TARGET_NATIVE_MATH_INT_UINT64_DEC(v) { v--; }
-#endif
-
-/* comparison routines */
-#ifndef TARGET_NATIVE_MATH_INT_INT64_EQ
- #define TARGET_NATIVE_MATH_INT_INT64_EQ(v1,v2) ((v1) == (v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_NE
- #define TARGET_NATIVE_MATH_INT_INT64_NE(v1,v2) ((v1) != (v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_LT
- #define TARGET_NATIVE_MATH_INT_INT64_LT(v1,v2) ((v1) < (v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_LE
- #define TARGET_NATIVE_MATH_INT_INT64_LE(v1,v2) ((v1) <= (v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_GT
- #define TARGET_NATIVE_MATH_INT_INT64_GT(v1,v2) ((v1) > (v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_GE
- #define TARGET_NATIVE_MATH_INT_INT64_GE(v1,v2) ((v1) >= (v2))
-#endif
-
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_EQ
- #define TARGET_NATIVE_MATH_INT_UINT64_EQ(v1,v2) ((v1) == (v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_NE
- #define TARGET_NATIVE_MATH_INT_UINT64_NE(v1,v2) ((v1) != (v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_LT
- #define TARGET_NATIVE_MATH_INT_UINT64_LT(v1,v2) ((v1) < (v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_LE
- #define TARGET_NATIVE_MATH_INT_UINT64_LE(v1,v2) ((v1) <= (v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_GT
- #define TARGET_NATIVE_MATH_INT_UINT64_GT(v1,v2) ((v1) > (v2))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_GE
- #define TARGET_NATIVE_MATH_INT_UINT64_GE(v1,v2) ((v1) >= (v2))
-#endif
-
-/* type conversion routines */
-#ifndef TARGET_NATIVE_MATH_INT_INT32_TO_INT64
- #define TARGET_NATIVE_MATH_INT_INT32_TO_INT64(v) ((jlong)(v))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT32_TO_UINT64
- #define TARGET_NATIVE_MATH_INT_UINT32_TO_UINT64(v) ((jlong)(v))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_TO_INT32
- #define TARGET_NATIVE_MATH_INT_INT64_TO_INT32(v) ((jint )(v))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_TO_UINT32
- #define TARGET_NATIVE_MATH_INT_UINT64_TO_UINT32(v) ((jint)(v))
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_TO_DOUBLE
- #define TARGET_NATIVE_MATH_INT_INT64_TO_DOUBLE(v) ((jdouble)(v))
-#endif
-
-/* combine/split int32 low/high values <-> int64 values */
-#ifndef TARGET_NATIVE_MATH_INT_INT32_LOW_HIGH_TO_INT64
- #define TARGET_NATIVE_MATH_INT_INT32_LOW_HIGH_TO_INT64(low,high,v) \
- do { \
- (v)=((((jlong)(high)) << 32) | ((((jlong)(low)) << 0) & 0x00000000ffffFFFFLL)); \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT32_LOW_HIGH_TO_UINT64
- #define TARGET_NATIVE_MATH_INT_UINT32_LOW_HIGH_TO_UINT64(low,high,v) \
- do { \
- (v)=((((jlong)(high)) << 32) | ((((jlong)(low)) << 0) & 0x00000000ffffFFFFLL)); \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_INT64_TO_INT32_LOW_HIGH
- #define TARGET_NATIVE_MATH_INT_INT64_TO_INT32_LOW_HIGH(v,low,high) \
- do { \
- (high)=((v) & 0xFFFFffff00000000L) >> 32; \
- (low) =((v) & 0x00000000FFFFffffL) >> 0; \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_MATH_INT_UINT64_TO_UINT32_LOW_HIGH
- #define TARGET_NATIVE_MATH_INT_UINT64_TO_UINT32_LOW_HIGH(v,low,high) \
- do { \
- (high)=((v) & 0xFFFFffff00000000L) >> 32; \
- (low) =((v) & 0x00000000FFFFffffL) >> 0; \
- } while (0)
-#endif
-
-/***************************** Functions *******************************/
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TARGET_GENERIC_MATH_INT__ */
-
-/* end of file */
-
diff --git a/libjava/classpath/native/target/generic/target_generic_misc.h b/libjava/classpath/native/target/generic/target_generic_misc.h
deleted file mode 100644
index d51be15a849..00000000000
--- a/libjava/classpath/native/target/generic/target_generic_misc.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/* generic_math_int64.h - Native methods for 64bit math operations
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-Description: generic target defintions of miscellaneous functions
-Systems : all
-*/
-
-#ifndef __TARGET_GENERIC_MISC__
-#define __TARGET_GENERIC_MISC__
-
-/* check if target_native_misc.h included */
-#ifndef __TARGET_NATIVE_MISC__
- #error Do NOT INCLUDE generic target files! Include the corresponding native target files instead!
-#endif
-
-/****************************** Includes *******************************/
-/* do not move; needed here because of some macro definitions */
-#include "config.h"
-
-#include <stdlib.h>
-#include <assert.h>
-
-#include "target_native.h"
-
-/****************** Conditional compilation switches *******************/
-
-/***************************** Constants *******************************/
-
-/***************************** Datatypes *******************************/
-
-/***************************** Variables *******************************/
-
-/****************************** Macros *********************************/
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_MISC_FORMAT_STRING<n>
-* Purpose : format a string (with a fixed number of) arguments
-* Input : buffer - buffer for string
-* bufferSize - size of buffer
-* format - format string (like printf)
-* args - optional arguments (GNU CPP only!)
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : - this is a "safe" macro to format string; buffer-
-* overflows will be avoided. Direct usage of e. g.
-* snprintf() is not permitted because it is not ANSI C
-* (not portable!)
-* - do not use this routine in a function without
-* variable number of arguments (ellipses), because
-* va_list/va_start/va_end is used!
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_MISC_FORMAT_STRING0
- #include <stdarg.h>
- #define TARGET_NATIVE_MISC_FORMAT_STRING0(buffer,bufferSize,format) \
- do { \
- snprintf(buffer,bufferSize, "%s", format); \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_MISC_FORMAT_STRING1
- #include <stdarg.h>
- #define TARGET_NATIVE_MISC_FORMAT_STRING1(buffer,bufferSize,format,arg1) \
- do { \
- snprintf(buffer,bufferSize,format,arg1); \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_MISC_FORMAT_STRING2
- #include <stdarg.h>
- #define TARGET_NATIVE_MISC_FORMAT_STRING2(buffer,bufferSize,format,arg1,arg2) \
- do { \
- snprintf(buffer,bufferSize,format,arg1,arg2); \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_MISC_FORMAT_STRING3
- #include <stdarg.h>
- #define TARGET_NATIVE_MISC_FORMAT_STRING3(buffer,bufferSize,format,arg1,arg2,arg3) \
- do { \
- snprintf(buffer,bufferSize,format,arg1,arg2,arg3); \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_MISC_FORMAT_STRING4
- #include <stdarg.h>
- #define TARGET_NATIVE_MISC_FORMAT_STRING4(buffer,bufferSize,format,arg1,arg2,arg3,arg4) \
- do { \
- snprintf(buffer,bufferSize,format,arg1,arg2,arg3,arg4); \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_MISC_FORMAT_STRING5
- #include <stdarg.h>
- #define TARGET_NATIVE_MISC_FORMAT_STRING5(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5) \
- do { \
- snprintf(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5); \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_MISC_FORMAT_STRING6
- #include <stdarg.h>
- #define TARGET_NATIVE_MISC_FORMAT_STRING6(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5,arg6) \
- do { \
- snprintf(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5,arg6); \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_MISC_FORMAT_STRING7
- #include <stdarg.h>
- #define TARGET_NATIVE_MISC_FORMAT_STRING7(buffer,bufferSize,format,arg1,arg2,arg3,arg14,arg5,arg6,arg7) \
- do { \
- snprintf(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5,arg6,arg7); \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_MISC_FORMAT_STRING8
- #include <stdarg.h>
- #define TARGET_NATIVE_MISC_FORMAT_STRING8(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) \
- do { \
- snprintf(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); \
- } while (0)
-#endif
-#ifndef TARGET_NATIVE_MISC_FORMAT_STRING9
- #include <stdarg.h>
- #define TARGET_NATIVE_MISC_FORMAT_STRING9(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) \
- do { \
- snprintf(buffer,bufferSize,format,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_FORMAT_STRING_ELLIPSE
-* Purpose : format a string with arguments
-* Input : buffer - buffer for string
-* bufferSize - size of buffer
-* format - format string (like printf)
-* Output : -
-* Return : -
-* Side-effect: unknown
-* Notes : - this is a "safe" macro to format string; buffer-
-* overflows will be avoided. Direct usage of e. g.
-* snprintf() is not permitted because it is not ANSI C
-* (not portable!)
-* - do not use this routine in a function without
-* variable number of arguments (ellipses), because
-* va_list/va_start/va_end is used!
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_MISC_FORMAT_STRING_ELLIPSE
- #include <stdarg.h>
- #define TARGET_NATIVE_FORMAT_STRING_ELLIPSE(buffer,bufferSize,format) \
- do { \
- va_list __arguments; \
- \
- va_start(__arguments,format); \
- vsnprintf(buffer,bufferSize,format,__arguments); \
- va_end(__arguments); \
- } while (0)
-#endif
-
-/***************************** Functions *******************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TARGET_GENERIC_MISC__ */
-
-/* end of file */
-
diff --git a/libjava/classpath/native/target/generic/target_generic_network.h b/libjava/classpath/native/target/generic/target_generic_network.h
deleted file mode 100644
index 99bb5d76525..00000000000
--- a/libjava/classpath/native/target/generic/target_generic_network.h
+++ /dev/null
@@ -1,1289 +0,0 @@
-/* target_generic_network.h - Native methods for network operations.
- Copyright (C) 1998, 2004, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-Description: generic target defintions of network functions
-Systems : all
-*/
-
-#ifndef __TARGET_GENERIC_NETWORK__
-#define __TARGET_GENERIC_NETWORK__
-
-/* check if target_native_network.h included */
-#ifndef __TARGET_NATIVE_NETWORK__
- #error Do NOT INCLUDE generic target files! Include the corresponding native target files instead!
-#endif
-
-/****************************** Includes *******************************/
-/* do not move; needed here because of some macro definitions */
-#include "config.h"
-
-#include <stdlib.h>
-
-#include "target_native.h"
-
-/****************** Conditional compilation switches *******************/
-
-/***************************** Constants *******************************/
-
-/***************************** Datatypes *******************************/
-
-/***************************** Variables *******************************/
-
-/****************************** Macros *********************************/
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_IPADDRESS_BYTES_TO_INT
-* Purpose : convert IP adddress (4 parts) into integer (host-format
-* 32bit)
-* Input : n0,n1,n2,n3 - IP address parts
-* Output : i - integer with IP address in host-format
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_IPADDRESS_BYTES_TO_INT
- #define TARGET_NATIVE_NETWORK_IPADDRESS_BYTES_TO_INT(n0,n1,n2,n3,i) \
- do { \
- i=(((unsigned char)n0) << 24) | \
- (((unsigned char)n1) << 16) | \
- (((unsigned char)n2) << 8) | \
- (((unsigned char)n3) << 0); \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_INT_TO_IPADDRESS_BYTES
-* Purpose : convert IP adddress (4 parts) into integer (host-format
-* 32bit)
-* Input : n0,n1,n2,n3 - IP address parts
-* Output : i - integer with IP address in host-format
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_INT_TO_IPADDRESS_BYTES
- #define TARGET_NATIVE_NETWORK_INT_TO_IPADDRESS_BYTES(i,n0,n1,n2,n3) \
- do { \
- n0=(i & 0xFF000000) >> 24; \
- n1=(i & 0x00FF0000) >> 16; \
- n2=(i & 0x0000FF00) >> 8; \
- n3=(i & 0x000000FF) >> 0; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_GET_HOSTNAME
-* Purpose : get hostname
-* Input : maxNameLen - max. length of name
-* Output : name - name (NUL terminated)
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_GET_HOSTNAME
- #include <unistd.h>
- #define TARGET_NATIVE_NETWORK_GET_HOSTNAME(name,maxNameLen,result) \
- do { \
- result=(gethostname(name,maxNameLen-1)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- name[maxNameLen-1]='\0'; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_GET_HOSTNAME_BY_ADDRESS
-* Purpose : get hostname by address
-* Input : address - IP address (32bit, NOT network byte order!)
-* maxNameLen - max. length of name
-* Output : name - name (NUL terminated)
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-/* XXX NYI??? reentrant? */
-#ifndef TARGET_NATIVE_NETWORK_GET_HOSTNAME_BY_ADDRESS
- #include <netdb.h>
- #define TARGET_NATIVE_NETWORK_GET_HOSTNAME_BY_ADDRESS(address,name,maxNameLen,result) \
- do { \
- int __networkAddress; \
- struct hostent *__hostEntry; \
- \
- __networkAddress=htonl(address); \
- __hostEntry = gethostbyaddr((char*)&__networkAddress,sizeof(__networkAddress),AF_INET); \
- if (__hostEntry!=NULL) \
- { \
- strncpy(name,__hostEntry->h_name,maxNameLen-1); \
- name[maxNameLen]='\0'; \
- result=TARGET_NATIVE_OK; \
- } \
- else \
- { \
- result=TARGET_NATIVE_ERROR; \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_GET_HOSTNAME_BY_NAME
-* Purpose : get hostname by name
-* Input : name - hostname
-* maxAddressSize - max. size of address array
-* Output : addresses - host adddresses (array, NOT in network
-* byte order!)
-* addressCount - number of entries in address array
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-/* XXX NYI??? reentrant? */
-#ifndef TARGET_NATIVE_NETWORK_GET_HOSTNAME_BY_NAME
- #include <netdb.h>
- #define TARGET_NATIVE_NETWORK_GET_HOSTNAME_BY_NAME(name,addresses,maxAddressSize,addressCount,result) \
- do { \
- struct hostent *__hostEntry; \
- \
- addressCount=0; \
- \
- __hostEntry = gethostbyname(name); \
- if (__hostEntry!=NULL) \
- { \
- while ((addressCount<maxAddressSize) && (__hostEntry->h_addr_list[addressCount]!=NULL)) \
- { \
- addresses[addressCount]=ntohl(*(int*)(__hostEntry->h_addr_list[addressCount])); \
- addressCount++; \
- } \
- result=TARGET_NATIVE_OK; \
- } \
- else \
- { \
- result=TARGET_NATIVE_ERROR; \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_OPEN_STREAM
-* Purpose : open stream socket
-* Input : -
-* Output : socketDescriptor - socket descriptor
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_OPEN_STREAM
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <fcntl.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_OPEN_STREAM(socketDescriptor,result) \
- do { \
- socketDescriptor=socket(AF_INET,SOCK_STREAM,0); \
- fcntl(socketDescriptor,F_SETFD,FD_CLOEXEC); \
- result=(socketDescriptor!=-1)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_OPEN_DATAGRAM
-* Purpose : open datagram socket
-* Input : -
-* Output : socketDescriptor - socket descriptor
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_OPEN_DATAGRAM
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <fcntl.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_OPEN_DATAGRAM(socketDescriptor,result) \
- do { \
- socketDescriptor=socket(AF_INET,SOCK_DGRAM,0); \
- fcntl(socketDescriptor,F_SETFD,FD_CLOEXEC); \
- result=(socketDescriptor!=-1)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_CLOSE
-* Purpose : close socket
-* Input : socketDescriptor - socket descriptor
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_CLOSE
- #include <unistd.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_CLOSE(socketDescriptor,result) \
- do { \
- result=(close(socketDescriptor)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_CONNECT
-* Purpose : connect socket
-* Input : socketDescriptor - socket descriptor
-* address - address (network format???)
-* port - port number (NOT in network byte order!)
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_CONNECT
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_CONNECT(socketDescriptor,address,port,result) \
- do { \
- struct sockaddr_in __socketAddress; \
- \
- memset(&__socketAddress,0,sizeof(__socketAddress)); \
- __socketAddress.sin_family = AF_INET; \
- __socketAddress.sin_addr.s_addr = htonl(address); \
- __socketAddress.sin_port = htons(((short)port)); \
- \
- result=(connect(socketDescriptor,(struct sockaddr*)&__socketAddress,sizeof(__socketAddress))==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_BIND
-* Purpose : bind socket
-* Input : socketDescriptor - socket descriptor
-* address - address (NOT ??? in network byte order!)
-* port - port (NOT in network byte order!)
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-/* XXX ??? address in network byte order? */
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_BIND
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_BIND(socketDescriptor,address,port,result) \
- do { \
- struct sockaddr_in __socketAddress; \
- \
- memset(&__socketAddress,0,sizeof(__socketAddress)); \
- __socketAddress.sin_family = AF_INET; \
- __socketAddress.sin_addr.s_addr = htonl(address); \
- __socketAddress.sin_port = htons(((short)port)); \
- \
- result=(bind(socketDescriptor,(struct sockaddr*)&__socketAddress,sizeof(__socketAddress))==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_LISTEN
-* Purpose : listen socket
-* Input : socketDescriptor - socket descriptor
-* maxQueueLength - max. number of pending connections
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-/* XXX ??? address in network byte order? */
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_LISTEN
- #include <sys/socket.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_LISTEN(socketDescriptor,maxQueueLength,result) \
- do { \
- result=(listen(socketDescriptor,maxQueueLength)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_ACCEPT
-* Purpose : accept socket
-* Input : socketDescriptor - socket descriptor
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-/* XXX ??? address in network byte order? */
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_ACCEPT
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_ACCEPT(socketDescriptor,newSocketDescriptor,result) \
- do { \
- struct sockaddr_in __socketAddress; \
- socklen_t __socketAddressLength; \
- \
- memset(&__socketAddress,0,sizeof(__socketAddress)); \
- __socketAddressLength=sizeof(__socketAddress); \
- newSocketDescriptor=accept(socketDescriptor,(struct sockaddr*)&__socketAddress,&__socketAddressLength); \
- result=(newSocketDescriptor!=-1)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_GET_LOCAL_INFO
-* Purpose : get local socket data info
-* Input : socketDescriptor - socket descriptor
-* Output : localAddress - local address (NOT in network byte order!)
-* localPort - local port number (NOT in network byte order!)
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_GET_LOCAL_INFO
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_GET_LOCAL_INFO(socketDescriptor,localAddress,localPort,result) \
- do { \
- struct sockaddr_in __socketAddress; \
- socklen_t __socketAddressLength; \
- \
- localAddress=0; \
- localPort =0; \
- \
- __socketAddressLength=sizeof(__socketAddress); \
- result=(getsockname(socketDescriptor,(struct sockaddr*)&__socketAddress,&__socketAddressLength)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- if (result==TARGET_NATIVE_OK) \
- { \
- localAddress=ntohl(__socketAddress.sin_addr.s_addr); \
- localPort =ntohs(__socketAddress.sin_port); \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_GET_REMOTE_INFO
-* Purpose : get remote socket data info
-* Input : socketDescriptor - socket descriptor
-* Output : remoteAddress - remote address (NOT in network byte order!)
-* remotePort - remote port number (NOT in network byte order!)
-* : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_GET_REMOTE_INFO
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_GET_REMOTE_INFO(socketDescriptor,remoteAddress,remotePort,result) \
- do { \
- struct sockaddr_in __socketAddress; \
- socklen_t __socketAddressLength; \
- \
- remoteAddress=0; \
- remotePort =0; \
- \
- __socketAddressLength=sizeof(__socketAddress); \
- result=(getpeername(socketDescriptor,(struct sockaddr*)&__socketAddress,&__socketAddressLength)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- if (result==TARGET_NATIVE_OK) \
- { \
- remoteAddress=ntohl(__socketAddress.sin_addr.s_addr); \
- remotePort =ntohs(__socketAddress.sin_port); \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_RECEIVE_AVAILABLE
-* Purpose : get number of available bytes for receive
-* Input : socketDescriptor - socket descriptor
-* Output : bytesAvailable - available bytes for receive
-* : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_RECEIVE_AVAILABLE
- #include <sys/ioctl.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_RECEIVE_AVAILABLE(socketDescriptor,bytesAvailable,result) \
- do { \
- int __value; \
- \
- bytesAvailable=0; \
- \
- result=(ioctl(socketDescriptor,FIONREAD,&__value)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- if (result==TARGET_NATIVE_OK) \
- { \
- bytesAvailable=__value; \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_RECEIVE
-* Purpose : receive data from socket
-* Input : socketDescriptor - socket descriptor
-* maxLength - max. size of bfufer
-* Output : buffer - received data
-* bytesReceive - length of received data
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_RECEIVE
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_RECEIVE(socketDescriptor,buffer,maxLength,bytesReceived) \
- do { \
- struct sockaddr_in __socketAddress; \
- socklen_t __socketAddressLength; \
- \
- memset(&__socketAddress,0,sizeof(__socketAddress)); \
- __socketAddressLength=sizeof(__socketAddress); \
- bytesReceived=recv(socketDescriptor,buffer,maxLength,0); \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_RECEIVE_WITH_ADDRESS_PORT
-* Purpose : receive data from socket
-* Input : socketDescriptor - socket descriptor
-* maxLength - max. size of bfufer
-* Output : buffer - received data
-* address - from address (NOT in network byte order!)
-* port - from port (NOT in network byte order!)
-* bytesReceive - length of received data
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_RECEIVE_WITH_ADDRESS_PORT
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_RECEIVE_WITH_ADDRESS_PORT(socketDescriptor,buffer,maxLength,address,port,bytesReceived) \
- do { \
- struct sockaddr_in __socketAddress; \
- socklen_t __socketAddressLength; \
- \
- port=0; \
- \
- memset(&__socketAddress,0,sizeof(__socketAddress)); \
- __socketAddressLength=sizeof(__socketAddress); \
- bytesReceived=recvfrom(socketDescriptor,buffer,maxLength,0,(struct sockaddr*)&__socketAddress,&__socketAddressLength); \
- if (__socketAddressLength==sizeof(__socketAddress)) \
- { \
- address=ntohl(__socketAddress.sin_addr.s_addr); \
- port =ntohs(__socketAddress.sin_port); \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_SEND
-* Purpose : send data to socket
-* Input : socketDescriptor - socket descriptor
-* : buffer - data to send
-* length - length of data to send
-* Output : bytesSent - number of bytes sent, -1 otherwise
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_SEND
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_SEND(socketDescriptor,buffer,length,bytesSent) \
- do { \
- bytesSent=send(socketDescriptor,buffer,length,0); \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_SEND_WITH_ADDRESS_PORT
-* Purpose : send data to socket
-* Input : socketDescriptor - socket descriptor
-* : buffer - data to send
-* length - length of data to send
-* Address - to address (NOT in network byte order!)
-* Port - to port (NOT in network byte order!)
-* Output : bytesSent - number of bytes sent, -1 otherwise
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_SEND_WITH_ADDRESS_PORT
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_SEND_WITH_ADDRESS_PORT(socketDescriptor,buffer,length,address,port,bytesSent) \
- do { \
- struct sockaddr_in __socketAddress; \
- \
- memset(&__socketAddress,0,sizeof(__socketAddress)); \
- __socketAddress.sin_family = AF_INET; \
- __socketAddress.sin_addr.s_addr = htonl(address); \
- __socketAddress.sin_port = htons((short)port); \
- bytesSent=sendto(socketDescriptor,buffer,length,0,(struct sockaddr*)&__socketAddress,sizeof(__socketAddress)); \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_TCP_NODELAY
-* Purpose : set socket option TCP_NODELAY
-* Input : socketDescriptor - socket descriptor
-* flag - 1 or 0
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_TCP_NODELAY
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/tcp.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_TCP_NODELAY(socketDescriptor,flag,result) \
- do { \
- int __value; \
- \
- __value=flag; \
- result=(setsockopt(socketDescriptor,IPPROTO_TCP,TCP_NODELAY,&__value,sizeof(__value))==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_LINGER
-* Purpose : set socket option SO_LINGER
-* Input : socketDescriptor - socket descriptor
-* flag - 1 or 0
-* value - linger value
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_LINGER
- #include <sys/types.h>
- #include <sys/socket.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_LINGER(socketDescriptor,flag,value,result) \
- do { \
- struct linger __linger; \
- \
- memset(&__linger,0,sizeof(__linger)); \
- if (flag) \
- { \
- __linger.l_onoff=0; \
- } \
- else \
- { \
- __linger.l_linger=value; \
- __linger.l_onoff =1; \
- } \
- result=(setsockopt(socketDescriptor,SOL_SOCKET,SO_LINGER,&__linger,sizeof(__linger))==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_TIMEOUT
-* Purpose : set socket option SO_TIMEOUT
-* Input : socketDescriptor - socket descriptor
-* flag - 1 or 0
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_TIMEOUT
- #include <sys/types.h>
- #include <sys/socket.h>
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
- #define TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_TIMEOUT(socketDescriptor,flag,result) \
- do { \
- struct timeval __value; \
- \
- __value.tv_sec = flag / 1000; \
- __value.tv_usec = (flag % 1000) * 1000; \
- result = ( (setsockopt(socketDescriptor, SOL_SOCKET, SO_SNDTIMEO, &__value, sizeof(__value)) | \
- setsockopt(socketDescriptor, SOL_SOCKET, SO_RCVTIMEO, &__value, sizeof(__value))) == 0) ? TARGET_NATIVE_OK : TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_SNDBUF
-* Purpose : set socket option SO_SNDBUF
-* Input : socketDescriptor - socket descriptor
-* size - size of send buffer
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_SNDBUF
- #include <sys/types.h>
- #include <sys/socket.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_SNDBUF(socketDescriptor,size,result) \
- do { \
- int __value; \
- \
- __value=size; \
- result=(setsockopt(socketDescriptor,SOL_SOCKET,SO_SNDBUF,&__value,sizeof(__value))==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_RCDBUF
-* Purpose : set socket option SO_RCDBUF
-* Input : socketDescriptor - socket descriptor
-* size - size of receive buffer
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_RCDBUF
- #include <sys/types.h>
- #include <sys/socket.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_RCDBUF(socketDescriptor,size,result) \
- do { \
- int __value; \
- \
- __value=size; \
- result=(setsockopt(socketDescriptor,SOL_SOCKET,SO_RCVBUF,&__value,sizeof(__value))==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_IP_TTL
-* Purpose : set socket option IP_TTL
-* Input : socketDescriptor - socket descriptor
-* value - value
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_IP_TTL
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_IP_TTL(socketDescriptor,value,result) \
- do { \
- int __value; \
- \
- __value=value; \
- result=(setsockopt(socketDescriptor,IPPROTO_IP,IP_TTL,&__value,sizeof(__value))==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_IP_MULTICAST_IF
-* Purpose : set socket option IP_MULTICAST_IF
-* Input : socketDescriptor - socket descriptor
-* address - integer with IP address in host-format
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_IP_MULTICAST_IF
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_IP_MULTICAST_IF(socketDescriptor,address,result) \
- do { \
- struct sockaddr_in __socketAddress; \
- \
- memset(&__socketAddress,0,sizeof(__socketAddress)); \
- __socketAddress.sin_family = AF_INET; \
- __socketAddress.sin_addr.s_addr = htonl(address); \
- result=(setsockopt(socketDescriptor,IPPROTO_IP,IP_MULTICAST_IF,&__socketAddress,sizeof(__socketAddress))==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_REUSE_ADDRESS
-* Purpose : set socket option REUSE_ADDRESS
-* Input : socketDescriptor - socket descriptor
-* flag - 1 or 0
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_REUSE_ADDRESS
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_REUSE_ADDRESS(socketDescriptor,flag,result) \
- do { \
- int __value; \
- \
- __value=flag; \
- result=(setsockopt(socketDescriptor,SOL_SOCKET,SO_REUSEADDR,&__value,sizeof(__value))==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_ADD_MEMBERSHIP
-* Purpose : set socket option IP_ADD_MEMBERSHIP
-* Input : socketDescriptor - socket descriptor
-* address - network address (host-format)
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_ADD_MEMBERSHIP
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_ADD_MEMBERSHIP(socketDescriptor,address,result) \
- do { \
- struct ip_mreq __request; \
- \
- memset(&__request,0,sizeof(__request)); \
- __request.imr_multiaddr.s_addr=htonl(address); \
- __request.imr_interface.s_addr=INADDR_ANY; \
- result=(setsockopt(socketDescriptor,IPPROTO_IP,IP_ADD_MEMBERSHIP,&__request,sizeof(__request))==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_DROP_MEMBERSHIP
-* Purpose : set socket option IP_DROP_MEMBERSHIP
-* Input : socketDescriptor - socket descriptor
-* address - network address (host-format)
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_DROP_MEMBERSHIP
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_DROP_MEMBERSHIP(socketDescriptor,address,result) \
- do { \
- struct ip_mreq __request; \
- \
- memset(&__request,0,sizeof(__request)); \
- __request.imr_multiaddr.s_addr=htonl(address); \
- __request.imr_interface.s_addr=INADDR_ANY; \
- result=(setsockopt(socketDescriptor,IPPROTO_IP,IP_DROP_MEMBERSHIP,&__request,sizeof(__request))==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_KEEP_ALIVE
-* Purpose : set socket option KEEP_ALIVE
-* Input : socketDescriptor - socket descriptor
-* flag - 1 or 0
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_KEEP_ALIVE
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_KEEP_ALIVE(socketDescriptor,flag,result) \
- do { \
- int __value; \
- \
- __value=flag; \
- result=(setsockopt(socketDescriptor,SOL_SOCKET,SO_KEEPALIVE,&__value,sizeof(__value))==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_BROADCAST
-* Purpose : set socket option SO_BROADCAST
-* Input : socketDescriptor - socket descriptor
-* flag - 1 or 0
-* Output : result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_BROADCAST
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/tcp.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_BROADCAST(socketDescriptor,flag,result) \
- do { \
- int __value; \
- \
- __value=flag; \
- result=(setsockopt(socketDescriptor,SOL_SOCKET,SO_BROADCAST,&__value,sizeof(__value))==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- } while (0)
-#endif
-
-/*---------------------------------------------------------------------*/
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_TCP_NODELAY
-* Purpose : get socket option TCP_NODELAY
-* Input : socketDescriptor - socket descriptor
-* Output : flag - 1 or 0
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_TCP_NODELAY
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/tcp.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_TCP_NODELAY(socketDescriptor,flag,result) \
- do { \
- int __value; \
- socklen_t __len; \
- \
- flag=0; \
- \
- __len=sizeof(__value); \
- result=(getsockopt(socketDescriptor,IPPROTO_TCP,TCP_NODELAY,&__value,&__len)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- if (result==TARGET_NATIVE_OK) \
- { \
- flag=__value; \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_LINGER
-* Purpose : get socket option SO_LINGER
-* Input : socketDescriptor - socket descriptor
-* Output : flag - 1 or 0
-* value - linger value
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_LINGER
- #include <sys/types.h>
- #include <sys/socket.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_LINGER(socketDescriptor,flag,value,result) \
- do { \
- struct linger __linger; \
- socklen_t __len; \
- \
- flag =0; \
- value=0; \
- \
- __len=sizeof(__linger); \
- result=(getsockopt(socketDescriptor,SOL_SOCKET,SO_LINGER,&__linger,&__len)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- if (result==TARGET_NATIVE_OK) \
- { \
- flag =__linger.l_onoff; \
- value=__linger.l_linger; \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_TIMEOUT
-* Purpose : get socket option SO_TIMEOUT
-* Input : socketDescriptor - socket descriptor
-* Output : flag - 1 or 0
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_TIMEOUT
- #include <sys/types.h>
- #include <sys/socket.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_TIMEOUT(socketDescriptor,flag,result) \
- do { \
- struct timeval __value; \
- socklen_t __len; \
- \
- flag=0; \
- \
- __len=sizeof(__value); \
- result=(getsockopt(socketDescriptor,SOL_SOCKET,SO_TIMEOUT,&__value,&__len)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- if (result==TARGET_NATIVE_OK) \
- { \
- flag = (__value.tv_sec * 1000LL) + (__value.tv_usec / 1000LL); \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_SNDBUF
-* Purpose : get socket option SO_SNDBUF
-* Input : socketDescriptor - socket descriptor
-* Output : size - size of send buffer
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_SNDBUF
- #include <sys/types.h>
- #include <sys/socket.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_SNDBUF(socketDescriptor,size,result) \
- do { \
- int __value; \
- socklen_t __len; \
- \
- size=0; \
- \
- __len=sizeof(__value); \
- result=(getsockopt(socketDescriptor,SOL_SOCKET,SO_SNDBUF,&__value,&__len)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- if (result==TARGET_NATIVE_OK) \
- { \
- size=__value; \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_RCDBUF
-* Purpose : get socket option SO_RCDBUF
-* Input : socketDescriptor - socket descriptor
-* Output : size - size of receive buffer
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_RCDBUF
- #include <sys/types.h>
- #include <sys/socket.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_SO_RCDBUF(socketDescriptor,size,result) \
- do { \
- int __value; \
- socklen_t __len; \
- \
- size=0; \
- \
- __len=sizeof(__value); \
- result=(getsockopt(socketDescriptor,SOL_SOCKET,SO_RCVBUF,&__value,&__len)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- if (result==TARGET_NATIVE_OK) \
- { \
- size=__value; \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_IP_TTL
-* Purpose : get socket option IP_TTL
-* Input : socketDescriptor - socket descriptor
-* Output : flag - 1 or 0
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_IP_TTL
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_IP_TTL(socketDescriptor,flag,result) \
- do { \
- int __value; \
- socklen_t __len; \
- \
- flag=0; \
- \
- __len=sizeof(__value); \
- result=(getsockopt(socketDescriptor,IPPROTO_IP,IP_TTL,&__value,&__len)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- if (result==TARGET_NATIVE_OK) \
- { \
- flag=__value; \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_IP_MULTICAST_IF
-* Purpose : get socket option IP_MULTICAST_IF
-* Input : socketDescriptor - socket descriptor
-* Output : address - integer with IP address in host-format
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_IP_MULTICAST_IF
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_IP_MULTICAST_IF(socketDescriptor,address,result) \
- do { \
- struct sockaddr_in __socketAddress; \
- socklen_t __socketAddressLength; \
- \
- address=0;\
- \
- memset(&__socketAddress,0,sizeof(__socketAddress)); \
- __socketAddress.sin_family = AF_INET; \
- __socketAddress.sin_addr.s_addr = htonl(address); \
- __socketAddressLength=sizeof(__socketAddress); \
- result=(getsockopt(socketDescriptor,IPPROTO_IP,IP_MULTICAST_IF,&__socketAddress,&__socketAddressLength)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- if (result==TARGET_NATIVE_OK) \
- { \
- address=ntohl(__socketAddress.sin_addr.s_addr); \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_BIND_ADDRESS
-* Purpose : get socket option SOCKOPT_SO_BINDADDR
-* Input : socketDescriptor - socket descriptor
-* Output : address - integer with IP address in host-format
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_BIND_ADDRESS
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_BIND_ADDRESS(socketDescriptor,address,result) \
- do { \
- struct sockaddr_in __socketAddress; \
- socklen_t __socketAddressLength; \
- \
- address=0;\
- \
- memset(&__socketAddress,0,sizeof(__socketAddress)); \
- __socketAddressLength=sizeof(__socketAddress); \
- result=(getsockname(socketDescriptor,(struct sockaddr*)&__socketAddress,&__socketAddressLength)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- if (result==TARGET_NATIVE_OK) \
- { \
- address=ntohl(__socketAddress.sin_addr.s_addr); \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_REUSE_ADDRESS
-* Purpose : get socket option REUSE_ADDRESS
-* Input : socketDescriptor - socket descriptor
-* Output : flag - 1 or 0
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_REUSE_ADDRESS
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_REUSE_ADDRESS(socketDescriptor,flag,result) \
- do { \
- int __value; \
- socklen_t __len; \
- \
- flag=0; \
- \
- __len=sizeof(__value); \
- result=(getsockopt(socketDescriptor,SOL_SOCKET,SO_REUSEADDR,&__value,&__len)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- if (result==TARGET_NATIVE_OK) \
- { \
- flag=__value; \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_KEEP_ALIVE
-* Purpose : get socket option KEEP_ALIVE
-* Input : socketDescriptor - socket descriptor
-* Output : flag - 1 or 0
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_KEEP_ALIVE
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_KEEP_ALIVE(socketDescriptor,flag,result) \
- do { \
- int __value; \
- socklen_t __len; \
- \
- flag=0; \
- \
- __len=sizeof(__value); \
- result=(getsockopt(socketDescriptor,SOL_SOCKET,SO_KEEPALIVE,&__value,&__len)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- if (result==TARGET_NATIVE_OK) \
- { \
- flag=__value; \
- } \
- } while (0)
-#endif
-
-/***********************************************************************\
-* Name : TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_BROADCAST
-* Purpose : get socket option SO_BROADCAST
-* Input : socketDescriptor - socket descriptor
-* Output : flag - 1 or 0
-* result - TARGET_NATIVE_OK if no error occurred,
-* TARGET_NATIVE_ERROR otherwise
-* Return : -
-* Side-effect: unknown
-* Notes : -
-\***********************************************************************/
-
-#ifndef TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_BROADCAST
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/tcp.h>
- #define TARGET_NATIVE_NETWORK_SOCKET_GET_OPTION_BROADCAST(socketDescriptor,flag,result) \
- do { \
- int __value; \
- socklen_t __len; \
- \
- flag=0; \
- \
- __len=sizeof(__value); \
- result=(getsockopt(socketDescriptor,SOL_SOCKET,SO_BROADCAST,&__value,&__len)==0)?TARGET_NATIVE_OK:TARGET_NATIVE_ERROR; \
- if (result==TARGET_NATIVE_OK) \
- { \
- flag=__value; \
- } \
- } while (0)
-#endif
-
-/***************************** Functions *******************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TARGET_GENERIC_NETWORK__ */
-
-/* end of file */
-
diff --git a/libjava/classpath/native/target/readme.txt b/libjava/classpath/native/target/readme.txt
deleted file mode 100644
index 6fee79eba63..00000000000
--- a/libjava/classpath/native/target/readme.txt
+++ /dev/null
@@ -1,149 +0,0 @@
-The GNU classpath native layer
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-To enable GNU classpath to run on a diverse array of different hardware
-platforms, a new native software layer has been added. This layer hide all
-machine and hardware dependent issues except common available definitions,
-which are ANSI C functions. For each targets system where the GNU classpath
-library is to be used, a specific set of native layer functions have to be
-provided. A generic set of functions is provided for Unix like systems
-(currently tested only with Linux). For a new target system, some or
-all native layer functions have to be rewritten. The following scheme
-illustrate the native layer.
-
- Java API
- ----------------------
- | Java classes |
- | -------------------- |
- | C native functions |
- | -------------------- |
- >> | C native layer | <<
- | -------------------- |
- | operating system |
- | -------------------- |
- | hardware |
- ----------------------
-
-The C native layer is implemented as a set of C pre-processor native macros.
-These macros expand to the appropriated native code. Macros are used
-instead function calls to give optimal performance and small code size.
-Of course in special cases, a macro can also expand to a function call
-if this is needed. This approach provide a flexible and efficient
-implementation of the native layer.
-
-The naming pattern for native macros is like follows:
-
- TARGET_NATIVE_<module name>_<macro name>
-
-where <module name> is a name of a module, e. g. FILE; <macro name> is
-the name of the specific native macro, e. g. OPEN_READ.
-
-The parameters for the macro use in general (with a few exceptions) the
-scheme
-
- <parameter>,<parameter>,...,<result>
-
-where <parameter> is input/output parameter and <result> is the result
-code TARGET_NATIVE_OK or TARGET_NATIVE_ERROR. Specific error codes
-and error strings can be gotten with
-
- TARGET_NATIVE_LAST_ERROR and
- TARGET_NATIVE_LAST_ERROR_STRING
-
-(see also file target_generic.h).
-
-For a single target system there exists two sets of native macros in
-the files
-
- a) <target name>/target_native_<module name>.h
- b) generic/target_generic_<module name>.h
-
-The macros in "a" are target specific implementations of native
-functions, the macros in "b" are generic implementations (for Unix) of
-the same native functions. If a native macro is not defined in the file
-"a", then the definition in file "b" is used (there is a check to see if
-a native macros is already defined elsewhere). This technique enables
-"a" to 'overwrite' single generic native macros with specific native
-macros for a specific target. In the default case, where only the
-generic implementation of the native macros is used, the files in the
-directory '<target name>' are empty except for the mandatory include of the
-generic header file in the directory 'generic' at the end. Please
-look at the existing Linux target specific files.
-
-The directory and file structure is as follows.
-
- native
- ...
- |
- |--- target
- | |
- | |--- Linux
- | | |--- target_native_<module name>.h
- | | |--- ...
- | | ...
- | |--- ...
- | |--- generic
- | | |--- target_generic_<module name>.h
- | | |--- ...
- ... ... ...
-
-
-Include hierarchy is as follows.
-
- native file <name>
- --> include 'target_native_<module name>.h'
- ...
- <target specific definitions>
- ...
- --> include 'target_generic_<module name>.h'
- ...
- <generic definitions>
- ...
-
-When writing native code, please take care with the following.
-
- - Use _only_ ANSI C specific functions directly which are available
- on all target systems with the same parameters, e. g. strdup() is
- not an ANSI C function, thus is is not available on all systems; mkdir()
- expect on some systems different parameters.
-
- !!!Do NOT use this functions in your native code!!!
-
- Instead
-
- * if a function is not available, create a native macro in the file
-
- <target name>/target_native_<module name>.h
-
- * if it is a generic function, include a generic implementation in
-
- generic/target_generic_<module name>.h
-
- * Then use this macro in your native code.
-
- - Avoid _all_ OS specific data types and constants, e. g. structures or error
- numbers. Instead, wrap them in a native macro and convert the values to
- basic scalar types like char, int, double or long.
-
- - Take care with 64 bit values; the are machine dependent. Not all
- target system support 64 bit operations. The macros in
- target_generic_math_int.h give a set of macros implementing 64 bit
- operations and constants.
-
- - Avoid - if possible - non-reentrant functions. Non-reentrant functions
- cause strange problems on some multitasking systems.
-
- - Avoid - if possible - dynamic data types created by malloc() and similar
- functions. Instead use (local) static variables to avoid stack usage.
- On some target systems, dynamic memory management is either slow or even
- dangerous. Moreover malloc()-calls can cause fragmentation of the system
- memory, which could result in a system crash or an application failure.
-
-For some examples, please look in the current implementation for
-Linux in the directory 'target/Linux' and the generic implementation in
-the directory 'target/generic'.
-
-
- aicas GmbH, February 2003
-
-
diff --git a/libjava/classpath/org/omg/CORBA/AnyHolder.java b/libjava/classpath/org/omg/CORBA/AnyHolder.java
index 10f828aabe5..c24855480c7 100644
--- a/libjava/classpath/org/omg/CORBA/AnyHolder.java
+++ b/libjava/classpath/org/omg/CORBA/AnyHolder.java
@@ -1,5 +1,5 @@
/* AnyHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -83,7 +83,7 @@ public final class AnyHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. For {@link Any}, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.InputStream#read_any}.
@@ -105,7 +105,7 @@ public final class AnyHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* For {@link Any} the functionality
* is delegated to
* {@link org.omg.CORBA.portable.OutputStream#write_any(Any) }.
diff --git a/libjava/classpath/org/omg/CORBA/AnySeqHelper.java b/libjava/classpath/org/omg/CORBA/AnySeqHelper.java
index 8ebae7a193f..d06e5b8545e 100644
--- a/libjava/classpath/org/omg/CORBA/AnySeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/AnySeqHelper.java
@@ -1,5 +1,5 @@
/* AnySeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/AnySeqHolder.java b/libjava/classpath/org/omg/CORBA/AnySeqHolder.java
index b18a1457b15..0d21ed3bba9 100644
--- a/libjava/classpath/org/omg/CORBA/AnySeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/AnySeqHolder.java
@@ -1,5 +1,5 @@
/* AnySeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -83,7 +83,7 @@ public final class AnySeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>and then all Any's.
*
@@ -109,7 +109,7 @@ public final class AnySeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code> and then all Any's.
*
diff --git a/libjava/classpath/org/omg/CORBA/BooleanHolder.java b/libjava/classpath/org/omg/CORBA/BooleanHolder.java
index 73cfeb29613..a5b7bd8bc9e 100644
--- a/libjava/classpath/org/omg/CORBA/BooleanHolder.java
+++ b/libjava/classpath/org/omg/CORBA/BooleanHolder.java
@@ -1,5 +1,5 @@
/* BooleanHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -91,7 +91,7 @@ public final class BooleanHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. For <code>boolean</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.InputStream#read_boolean}.
@@ -113,7 +113,7 @@ public final class BooleanHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* For <code>boolean</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.OutputStream#write_boolean(boolean) }.
diff --git a/libjava/classpath/org/omg/CORBA/BooleanSeqHelper.java b/libjava/classpath/org/omg/CORBA/BooleanSeqHelper.java
index 41f93d10d73..3cb2538c3fe 100644
--- a/libjava/classpath/org/omg/CORBA/BooleanSeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/BooleanSeqHelper.java
@@ -1,5 +1,5 @@
/* BooleanSeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/BooleanSeqHolder.java b/libjava/classpath/org/omg/CORBA/BooleanSeqHolder.java
index bdec3b79273..6144a17d6d8 100644
--- a/libjava/classpath/org/omg/CORBA/BooleanSeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/BooleanSeqHolder.java
@@ -1,5 +1,5 @@
/* BooleanSeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -87,7 +87,7 @@ public final class BooleanSeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.InputStream#read_boolean_array }.
@@ -111,7 +111,7 @@ public final class BooleanSeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.OutputStream#write_boolean_array }.
diff --git a/libjava/classpath/org/omg/CORBA/ByteHolder.java b/libjava/classpath/org/omg/CORBA/ByteHolder.java
index c440822e58c..c590a433e19 100644
--- a/libjava/classpath/org/omg/CORBA/ByteHolder.java
+++ b/libjava/classpath/org/omg/CORBA/ByteHolder.java
@@ -1,5 +1,5 @@
/* ByteHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -91,7 +91,7 @@ public final class ByteHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. For <code>octet</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.InputStream#read_octet}.
@@ -113,7 +113,7 @@ public final class ByteHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* For <code>octet</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.OutputStream#write_octet(byte) }.
diff --git a/libjava/classpath/org/omg/CORBA/CharHolder.java b/libjava/classpath/org/omg/CORBA/CharHolder.java
index b8d0a3d6a31..6ef5210a33d 100644
--- a/libjava/classpath/org/omg/CORBA/CharHolder.java
+++ b/libjava/classpath/org/omg/CORBA/CharHolder.java
@@ -1,5 +1,5 @@
/* CharHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -90,7 +90,7 @@ public final class CharHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. For <code>char</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.InputStream#read_char}.
@@ -112,7 +112,7 @@ public final class CharHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* For <code>char</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.OutputStream#write_char(char) }.
diff --git a/libjava/classpath/org/omg/CORBA/CharSeqHelper.java b/libjava/classpath/org/omg/CORBA/CharSeqHelper.java
index 08406058ca8..4853f3d1609 100644
--- a/libjava/classpath/org/omg/CORBA/CharSeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/CharSeqHelper.java
@@ -1,5 +1,5 @@
/* CharSeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/CharSeqHolder.java b/libjava/classpath/org/omg/CORBA/CharSeqHolder.java
index a60483b5f0f..3fa5475a0f1 100644
--- a/libjava/classpath/org/omg/CORBA/CharSeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/CharSeqHolder.java
@@ -1,5 +1,5 @@
/* CharSeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -87,7 +87,7 @@ public final class CharSeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.InputStream#read_char_array }.
@@ -111,7 +111,7 @@ public final class CharSeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.OutputStream#write_char_array }.
diff --git a/libjava/classpath/org/omg/CORBA/Context.java b/libjava/classpath/org/omg/CORBA/Context.java
index e3f7363f4cf..01a7e9944b7 100644
--- a/libjava/classpath/org/omg/CORBA/Context.java
+++ b/libjava/classpath/org/omg/CORBA/Context.java
@@ -1,5 +1,5 @@
/* Context.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ package org.omg.CORBA;
* used to represent information about various circumstances of the
* invocation. A Context if first created by
* {@link org.omg.CORBA.ORB#get_default_context() } and then invoking
- * {@link create_child(String)} of the default context.
+ * {@link #create_child(String)} of the default context.
*
* The contexts are named.
*
@@ -66,7 +66,7 @@ public abstract class Context
/**
* Create a child of this Context, giving it a name.
- * @param name a name of the child context.
+ * @param child a name of the child context.
*
* @return the newly created context.
*/
diff --git a/libjava/classpath/org/omg/CORBA/CurrentHelper.java b/libjava/classpath/org/omg/CORBA/CurrentHelper.java
index f292449ecd1..36c5f186329 100644
--- a/libjava/classpath/org/omg/CORBA/CurrentHelper.java
+++ b/libjava/classpath/org/omg/CORBA/CurrentHelper.java
@@ -1,5 +1,5 @@
/* CurrentHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,9 +42,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.Delegate;
import org.omg.CORBA.portable.InputStream;
diff --git a/libjava/classpath/org/omg/CORBA/CustomValue.java b/libjava/classpath/org/omg/CORBA/CustomValue.java
index 0e5809fd6ea..6814ab3c59d 100644
--- a/libjava/classpath/org/omg/CORBA/CustomValue.java
+++ b/libjava/classpath/org/omg/CORBA/CustomValue.java
@@ -1,5 +1,5 @@
/* CustomValue.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,7 @@ exception statement from your version. */
package org.omg.CORBA;
+import org.omg.CORBA.portable.StreamableValue;
import org.omg.CORBA.portable.ValueBase;
/**
@@ -50,7 +51,7 @@ import org.omg.CORBA.portable.ValueBase;
* in the receiving context.
*
* If the value base does not implement this interface, it normally implements
- * {@link org.omg.CORBA.portable.StremableValue} instead.
+ * {@link StreamableValue} instead.
*
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
*/
diff --git a/libjava/classpath/org/omg/CORBA/DataOutputStream.java b/libjava/classpath/org/omg/CORBA/DataOutputStream.java
index 5e0f021fe80..20f1afbe21f 100644
--- a/libjava/classpath/org/omg/CORBA/DataOutputStream.java
+++ b/libjava/classpath/org/omg/CORBA/DataOutputStream.java
@@ -1,5 +1,5 @@
/* DataOutputStream.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -190,63 +190,63 @@ public interface DataOutputStream
/**
* Write array of Any's to the output stream.
*
- * @param value a value to write.
+ * @param seq a value to write.
*/
void write_any_array(Any[] seq, int offset, int length);
/**
* Write array of boolean's to the output stream.
*
- * @param value a value to write.
+ * @param seq a value to write.
*/
void write_boolean_array(boolean[] seq, int offset, int length);
/**
* Write array of narrow chars to the output stream.
*
- * @param value a value to write.
+ * @param seq a value to write.
*/
void write_char_array(char[] seq, int offset, int length);
/**
* Write array of wide chars to the output stream.
*
- * @param value a value to write.
+ * @param seq a value to write.
*/
void write_wchar_array(char[] seq, int offset, int length);
/**
* Write array of octets (bytes) to the output stream.
*
- * @param value a value to write.
+ * @param seq a value to write.
*/
void write_octet_array(byte[] seq, int offset, int length);
/**
* Write array of shorts (16 bit integers) to the output stream.
*
- * @param value a value to write.
+ * @param seq a value to write.
*/
void write_short_array(short[] seq, int offset, int length);
/**
* Write array of unsigned shorts (16 bit integers) to the output stream.
*
- * @param value a value to write.
+ * @param seq a value to write.
*/
void write_ushort_array(short[] seq, int offset, int length);
/**
* Write array of CORBA longs (java ints) to the output stream.
*
- * @param value a value to write.
+ * @param seq a value to write.
*/
void write_long_array(int[] seq, int offset, int length);
/**
* Write array of unsigned CORBA longs (java ints) to the output stream.
*
- * @param value a value to write.
+ * @param seq a value to write.
*/
void write_ulong_array(int[] seq, int offset, int length);
@@ -254,28 +254,28 @@ public interface DataOutputStream
* Write array of unsigned CORBA long longs (java longs)
* to the output stream.
*
- * @param value a value to write.
+ * @param seq a value to write.
*/
void write_ulonglong_array(long[] seq, int offset, int length);
/**
* Write arrayo fo CORBA long longs (java ints) to the output stream.
*
- * @param value a value to write.
+ * @param seq a value to write.
*/
void write_longlong_array(long[] seq, int offset, int length);
/**
* Write array of floats to the output stream.
*
- * @param value a value to write.
+ * @param seq a value to write.
*/
void write_float_array(float[] seq, int offset, int length);
/**
* Write array of doubles to the output stream.
*
- * @param value a value to write.
+ * @param seq a value to write.
*/
void write_double_array(double[] seq, int offset, int length);
} \ No newline at end of file
diff --git a/libjava/classpath/org/omg/CORBA/DefinitionKindHelper.java b/libjava/classpath/org/omg/CORBA/DefinitionKindHelper.java
index ef7e26725b3..05fe992872f 100644
--- a/libjava/classpath/org/omg/CORBA/DefinitionKindHelper.java
+++ b/libjava/classpath/org/omg/CORBA/DefinitionKindHelper.java
@@ -1,5 +1,5 @@
/* DefinitionKindHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,10 +40,7 @@ package org.omg.CORBA;
import gnu.CORBA.DefinitionKindHolder;
import gnu.CORBA.OrbRestricted;
-import gnu.CORBA.gnuAny;
-import gnu.CORBA.typecodes.PrimitiveTypeCode;
-import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/CORBA/DomainManagerOperations.java b/libjava/classpath/org/omg/CORBA/DomainManagerOperations.java
index 7dc0526a4db..6bda64d76a9 100644
--- a/libjava/classpath/org/omg/CORBA/DomainManagerOperations.java
+++ b/libjava/classpath/org/omg/CORBA/DomainManagerOperations.java
@@ -1,5 +1,5 @@
/* DomainManagerOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package org.omg.CORBA;
/**
* Provides the means to access the policies of the domain, with that
- * the implementing {@link DomainManage} is associated.
+ * the implementing {@link DomainManager} is associated.
*
* @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
*/
diff --git a/libjava/classpath/org/omg/CORBA/DoubleHolder.java b/libjava/classpath/org/omg/CORBA/DoubleHolder.java
index 65c8ebaf5e0..23ec513f975 100644
--- a/libjava/classpath/org/omg/CORBA/DoubleHolder.java
+++ b/libjava/classpath/org/omg/CORBA/DoubleHolder.java
@@ -1,5 +1,5 @@
/* DoubleHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -91,7 +91,7 @@ public final class DoubleHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. For <code>double</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.InputStream#read_double}.
@@ -113,7 +113,7 @@ public final class DoubleHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* For <code>double</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.OutputStream#write_double(double) }.
diff --git a/libjava/classpath/org/omg/CORBA/DoubleSeqHelper.java b/libjava/classpath/org/omg/CORBA/DoubleSeqHelper.java
index 2d9423fd095..6c971b7bea2 100644
--- a/libjava/classpath/org/omg/CORBA/DoubleSeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/DoubleSeqHelper.java
@@ -1,5 +1,5 @@
/* DoubleSeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/DoubleSeqHolder.java b/libjava/classpath/org/omg/CORBA/DoubleSeqHolder.java
index 619e9215bb9..5d7fb1aedaa 100644
--- a/libjava/classpath/org/omg/CORBA/DoubleSeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/DoubleSeqHolder.java
@@ -1,5 +1,5 @@
/* DoubleSeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -87,7 +87,7 @@ public final class DoubleSeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.InputStream#read_double_array }.
@@ -111,7 +111,7 @@ public final class DoubleSeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.OutputStream#write_double_array }.
diff --git a/libjava/classpath/org/omg/CORBA/DynAny.java b/libjava/classpath/org/omg/CORBA/DynAny.java
index 42b93341971..edafe435a7f 100644
--- a/libjava/classpath/org/omg/CORBA/DynAny.java
+++ b/libjava/classpath/org/omg/CORBA/DynAny.java
@@ -1,5 +1,5 @@
/* DynAny.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -280,7 +280,7 @@ public interface DynAny
* Insert the {@link Any} value into the enclosed
* {@link Any} inside this DynAny.
*
- * @param a_x the value being inserted.
+ * @param an_any the value being inserted.
* @throws InvalidValue if the value type does not match the
* typecode of the enclosed {@link Any}.
*/
@@ -458,7 +458,7 @@ public interface DynAny
throws InvalidValue;
/**
- * Advances the internal pointer, described in the {@link current_component},
+ * Advances the internal pointer, described in the {@link #current_component},
* one position forward.
*
* @return true if the pointer now points to the new component,
@@ -468,13 +468,13 @@ public interface DynAny
boolean next();
/**
- * Moves the internal pointer, described in the {@link current_component},
+ * Moves the internal pointer, described in the {@link #current_component},
* to the first component.
*/
void rewind();
/**
- * Moves the internal pointer, described in the {@link current_component},
+ * Moves the internal pointer, described in the {@link #current_component},
* to the given position.
*
* @param p the number of the internal component on that the internal
diff --git a/libjava/classpath/org/omg/CORBA/DynSequence.java b/libjava/classpath/org/omg/CORBA/DynSequence.java
index be7556705bb..6a5c77c0ba9 100644
--- a/libjava/classpath/org/omg/CORBA/DynSequence.java
+++ b/libjava/classpath/org/omg/CORBA/DynSequence.java
@@ -1,5 +1,5 @@
/* DynSequence.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -56,7 +56,7 @@ public interface DynSequence
/**
* Returns the number of elements, stored in the sequence.
- * @return
+ * @return the length of the sequence
*/
int length();
diff --git a/libjava/classpath/org/omg/CORBA/DynValue.java b/libjava/classpath/org/omg/CORBA/DynValue.java
index 24d28124651..5c67ffbbe41 100644
--- a/libjava/classpath/org/omg/CORBA/DynValue.java
+++ b/libjava/classpath/org/omg/CORBA/DynValue.java
@@ -1,5 +1,5 @@
/* DynValue.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -72,7 +72,7 @@ public interface DynValue
/**
* Get all members of the enclosed value type object.
- * @return
+ * @return members, as an array of the name - value pairs.
*/
NameValuePair[] get_members();
diff --git a/libjava/classpath/org/omg/CORBA/DynamicImplementation.java b/libjava/classpath/org/omg/CORBA/DynamicImplementation.java
index 3b1b4431905..24e6319fec5 100644
--- a/libjava/classpath/org/omg/CORBA/DynamicImplementation.java
+++ b/libjava/classpath/org/omg/CORBA/DynamicImplementation.java
@@ -1,5 +1,5 @@
/* DynamicImplementation.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -61,7 +61,7 @@ public class DynamicImplementation
{
/**
* Invoke the method of the CORBA object. After converting the parameters,
- * this method delegates call to the {@link ObjectImpl#invoke}.
+ * this method delegates call to the {@link ObjectImpl#_invoke}.
*
* @deprecated since 1.4.
*
diff --git a/libjava/classpath/org/omg/CORBA/FieldNameHelper.java b/libjava/classpath/org/omg/CORBA/FieldNameHelper.java
index 6d6de43da67..1f884d72821 100644
--- a/libjava/classpath/org/omg/CORBA/FieldNameHelper.java
+++ b/libjava/classpath/org/omg/CORBA/FieldNameHelper.java
@@ -1,5 +1,5 @@
/* FieldNameHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,7 +55,7 @@ import org.omg.CORBA.portable.OutputStream;
public abstract class FieldNameHelper
{
/**
- * Insert the FieldName into Any (uses {@link Any.insert_string}).
+ * Insert the FieldName into Any (uses {@link Any#insert_string}).
*
* @param a the Any to insert into.
* @param that the string to insert.
@@ -66,7 +66,7 @@ public abstract class FieldNameHelper
}
/**
- * Extract the FieldName from Any ((uses {@link Any.extract_string}).
+ * Extract the FieldName from Any ((uses {@link Any#extract_string}).
*
* @param a the Any to extract from.
*/
@@ -104,7 +104,7 @@ public abstract class FieldNameHelper
}
/**
- * Calls {@link OutputStream#write_string()}.
+ * Calls {@link OutputStream#write_string(String)}.
*
* @param ostream the stream to write into.
* @param value the string (FieldName) value to write.
diff --git a/libjava/classpath/org/omg/CORBA/FixedHolder.java b/libjava/classpath/org/omg/CORBA/FixedHolder.java
index 8913acc1755..a44cde52dbf 100644
--- a/libjava/classpath/org/omg/CORBA/FixedHolder.java
+++ b/libjava/classpath/org/omg/CORBA/FixedHolder.java
@@ -1,5 +1,5 @@
/* FixedHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,6 @@ exception statement from your version. */
package org.omg.CORBA;
import gnu.CORBA.typecodes.FixedTypeCode;
-import gnu.CORBA.typecodes.PrimitiveTypeCode;
import java.math.BigDecimal;
@@ -88,7 +87,7 @@ public final class FixedHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. For <code>fixed</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.InputStream#read_fixed}.
@@ -112,7 +111,7 @@ public final class FixedHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* For <code>fixed</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.OutputStream#write_fixed(BigDecimal) }.
diff --git a/libjava/classpath/org/omg/CORBA/FloatHolder.java b/libjava/classpath/org/omg/CORBA/FloatHolder.java
index 1d6de16a192..8d765ced374 100644
--- a/libjava/classpath/org/omg/CORBA/FloatHolder.java
+++ b/libjava/classpath/org/omg/CORBA/FloatHolder.java
@@ -1,5 +1,5 @@
/* FloatHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -91,7 +91,7 @@ public final class FloatHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. For <code>float</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.InputStream#read_float}.
@@ -113,7 +113,7 @@ public final class FloatHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* For <code>float</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.OutputStream#write_float(float) }.
diff --git a/libjava/classpath/org/omg/CORBA/FloatSeqHelper.java b/libjava/classpath/org/omg/CORBA/FloatSeqHelper.java
index 1656dae440a..10850e022b4 100644
--- a/libjava/classpath/org/omg/CORBA/FloatSeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/FloatSeqHelper.java
@@ -1,5 +1,5 @@
/* FloatSeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/FloatSeqHolder.java b/libjava/classpath/org/omg/CORBA/FloatSeqHolder.java
index dbab1ec08ba..b7e8efcc0d2 100644
--- a/libjava/classpath/org/omg/CORBA/FloatSeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/FloatSeqHolder.java
@@ -1,5 +1,5 @@
/* FloatSeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -87,7 +87,7 @@ public final class FloatSeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.InputStream#read_float_array }.
@@ -111,7 +111,7 @@ public final class FloatSeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.OutputStream#write_float_array }.
diff --git a/libjava/classpath/org/omg/CORBA/IdentifierHelper.java b/libjava/classpath/org/omg/CORBA/IdentifierHelper.java
index 5c055f81290..deff909690e 100644
--- a/libjava/classpath/org/omg/CORBA/IdentifierHelper.java
+++ b/libjava/classpath/org/omg/CORBA/IdentifierHelper.java
@@ -1,5 +1,5 @@
/* IdentifierHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,7 +55,7 @@ import org.omg.CORBA.portable.OutputStream;
public abstract class IdentifierHelper
{
/**
- * Insert the Identifier into Any (uses {@link Any.insert_string}).
+ * Insert the Identifier into Any (uses {@link Any#insert_string}).
*
* @param a the Any to insert into.
* @param that the string to insert.
@@ -66,7 +66,7 @@ public abstract class IdentifierHelper
}
/**
- * Extract the Identifier from Any ((uses {@link Any.extract_string}).
+ * Extract the Identifier from Any ((uses {@link Any#extract_string}).
*
* @param a the Any to extract from.
*/
@@ -104,7 +104,7 @@ public abstract class IdentifierHelper
}
/**
- * Calls {@link OutputStream#write_string()}.
+ * Calls {@link OutputStream#write_string(String)}.
*
* @param ostream the stream to write into.
* @param value the string (Identifier) value to write.
diff --git a/libjava/classpath/org/omg/CORBA/IntHolder.java b/libjava/classpath/org/omg/CORBA/IntHolder.java
index 4729535a7ec..a27cf435ce3 100644
--- a/libjava/classpath/org/omg/CORBA/IntHolder.java
+++ b/libjava/classpath/org/omg/CORBA/IntHolder.java
@@ -1,5 +1,5 @@
/* IntHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -90,7 +90,7 @@ public final class IntHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. For <code>long</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.InputStream#read_long}.
@@ -112,7 +112,7 @@ public final class IntHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* For <code>long</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.OutputStream#write_long(int) }.
diff --git a/libjava/classpath/org/omg/CORBA/LocalObject.java b/libjava/classpath/org/omg/CORBA/LocalObject.java
index 7c06e18249d..a3fd131caf6 100644
--- a/libjava/classpath/org/omg/CORBA/LocalObject.java
+++ b/libjava/classpath/org/omg/CORBA/LocalObject.java
@@ -1,5 +1,5 @@
/* LocalObject.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -253,12 +253,12 @@ public class LocalObject
/**
* This method is called from <code>rmic</code> generated stubs if the
- * {@link Util#isLocal()}, called passing <code>this</code> as parameter,
+ * {@link Util#isLocal}, called passing <code>this</code> as parameter,
* returns true. If the method returns null, the requested method is then
* invoked on <code>this</code>. Else it is invoked on the returned object,
* casting it into the interface that the local object implements. In this
* case, the generated stub also later calls
- * {@link _servant_postinvoke(ServantObject)}, passing that returned target
+ * {@link #_servant_postinvoke(ServantObject)}, passing that returned target
* as parameter.
*
* @param operation the name of the method being invoked.
@@ -275,7 +275,7 @@ public class LocalObject
/**
* This method is called from <code>rmic</code> generated stubs if the
- * {@link Util#isLocal()}, called passing <code>this</code> as parameter,
+ * {@link Util#isLocal}, called passing <code>this</code> as parameter,
* returns true, and the {@link #_servant_preinvoke} return non-null object.
* The stub then invokes the requrested method on that returned object and
* later calls _servant_postinvoke, passing that returned target as parameter.
@@ -289,7 +289,7 @@ public class LocalObject
/**
* Invokes the operation. This method takes the OutputStream that was previously
- * returned by a {@link _request()} and returns an InputStream which
+ * returned by a {@link #_request(String)} and returns an InputStream which
* contains the reply. Up till jdk 1.5 inclusive this method is marked as
* unimplemented.
*
@@ -304,7 +304,7 @@ public class LocalObject
/**
* While it may look that this should return true, the jdk 1.5 API states
* that it must throw NO_IMPLEMENT instead. The rmi stubs do not call this
- * method to check if the object is local; they call {@link Util#isLocal()}
+ * method to check if the object is local; they call {@link Util#isLocal}
* instead (passing <code>this</code> as parameter).
*
* @return never.
diff --git a/libjava/classpath/org/omg/CORBA/LongHolder.java b/libjava/classpath/org/omg/CORBA/LongHolder.java
index ac249fed3c6..db412d96966 100644
--- a/libjava/classpath/org/omg/CORBA/LongHolder.java
+++ b/libjava/classpath/org/omg/CORBA/LongHolder.java
@@ -1,5 +1,5 @@
/* LongHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -91,7 +91,7 @@ public final class LongHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. For <code>long long</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.InputStream#read_longlong}.
@@ -113,7 +113,7 @@ public final class LongHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* For <code>long long</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.OutputStream#write_longlong(long) }.
diff --git a/libjava/classpath/org/omg/CORBA/LongLongSeqHelper.java b/libjava/classpath/org/omg/CORBA/LongLongSeqHelper.java
index 0e31c713647..1ba58d5d362 100644
--- a/libjava/classpath/org/omg/CORBA/LongLongSeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/LongLongSeqHelper.java
@@ -1,5 +1,5 @@
/* LongLongSeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/LongLongSeqHolder.java b/libjava/classpath/org/omg/CORBA/LongLongSeqHolder.java
index e56acd4ad78..ebb83cfd012 100644
--- a/libjava/classpath/org/omg/CORBA/LongLongSeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/LongLongSeqHolder.java
@@ -1,5 +1,5 @@
/* LongLongSeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -87,7 +87,7 @@ public final class LongLongSeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.InputStream#read_longlong_array }.
@@ -111,7 +111,7 @@ public final class LongLongSeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.OutputStream#write_longlong_array }.
diff --git a/libjava/classpath/org/omg/CORBA/LongSeqHelper.java b/libjava/classpath/org/omg/CORBA/LongSeqHelper.java
index 26b4e91c2a5..c33611da8e3 100644
--- a/libjava/classpath/org/omg/CORBA/LongSeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/LongSeqHelper.java
@@ -1,5 +1,5 @@
/* LongSeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/LongSeqHolder.java b/libjava/classpath/org/omg/CORBA/LongSeqHolder.java
index 2359eb0b2f6..79e94382d3d 100644
--- a/libjava/classpath/org/omg/CORBA/LongSeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/LongSeqHolder.java
@@ -1,5 +1,5 @@
/* LongSeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -87,10 +87,10 @@ public final class LongSeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>and then calls the
- * {@link org.omg.CORBA.portable.InputStream#input.read_long_array }.
+ * {@link org.omg.CORBA.portable.InputStream#read_long_array }.
*
* @param input the input stream to read from.
*/
@@ -102,10 +102,10 @@ public final class LongSeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code>and then calls the
- * {@link org.omg.CORBA.portable.OutputStream#input.write_long_array }.
+ * {@link org.omg.CORBA.portable.OutputStream#write_long_array }.
*
* @param output the output stream to write into.
*/
diff --git a/libjava/classpath/org/omg/CORBA/ORB.java b/libjava/classpath/org/omg/CORBA/ORB.java
index af05488280f..89bc5376402 100644
--- a/libjava/classpath/org/omg/CORBA/ORB.java
+++ b/libjava/classpath/org/omg/CORBA/ORB.java
@@ -1,5 +1,5 @@
/* ORB.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,10 +41,8 @@ package org.omg.CORBA;
import gnu.CORBA.OrbFocused;
import gnu.CORBA.ObjectCreator;
import gnu.CORBA.OrbRestricted;
-import gnu.CORBA.gnuContext;
import gnu.CORBA.typecodes.FixedTypeCode;
import gnu.CORBA.typecodes.GeneralTypeCode;
-import gnu.CORBA.typecodes.PrimitiveTypeCode;
import gnu.CORBA.typecodes.RecordTypeCode;
import gnu.CORBA.typecodes.RecursiveTypeCode;
@@ -144,7 +142,7 @@ public abstract class ORB
{
/**
* By default, {@link #init(String[], Properties)} and
- * {@link #iinit(Applet, Properties)} return
+ * {@link #init(Applet, Properties)} return
* the built-in fully functional ORB is returned. If the
* <code>props</code> contains the property org.omg.CORBA.ORBClass,
* the value of this property is used as a class name to instantiate
@@ -210,6 +208,34 @@ public abstract class ORB
}
/**
+ * Create a typecode, representing a tree-like structure.
+ * This structure contains a member that is a sequence of the same type,
+ * as the structure itself. You can imagine as if the folder definition
+ * contains a variable-length array of the enclosed (nested) folder
+ * definitions. In this way, it is possible to have a tree like
+ * structure that can be transferred via CORBA CDR stream.
+ *
+ * @deprecated It is easier and clearler to use a combination of
+ * create_recursive_tc and create_sequence_tc instead.
+ *
+ * @param bound the maximal expected number of the nested components
+ * on each node; 0 if not limited.
+ *
+ * @param offset the position of the field in the returned structure
+ * that contains the sequence of the structures of the same field.
+ * The members before this field are intialised using parameterless
+ * StructMember constructor.
+ *
+ * @return a typecode, defining a stucture, where a member at the
+ * <code>offset</code> position defines an array of the identical
+ * structures.
+ *
+ * @see #create_recursive_tc(String)
+ * @see #create_sequence_tc(int, TypeCode)
+ */
+ public abstract TypeCode create_recursive_sequence_tc(int bound, int offset);
+
+ /**
* Create alias typecode for the given typecode.
*/
public abstract TypeCode create_alias_tc(String id, String name,
@@ -496,7 +522,7 @@ public abstract class ORB
*/
public abstract Request get_next_response()
throws WrongTransaction;
-
+
/**
* Create a new CDR output stream, where the parameter values can be written
* during the method invocation.
@@ -647,33 +673,6 @@ public abstract class ORB
return t;
}
- /**
- * Create a typecode, representing a tree-like structure.
- * This structure contains a member that is a sequence of the same type,
- * as the structure itself. You can imagine as if the folder definition
- * contains a variable-length array of the enclosed (nested) folder
- * definitions. In this way, it is possible to have a tree like
- * structure that can be transferred via CORBA CDR stream.
- *
- * @deprecated It is easier and clearler to use a combination of
- * create_recursive_tc and create_sequence_tc instead.
- *
- * @param bound the maximal expected number of the nested components
- * on each node; 0 if not limited.
- *
- * @param offset the position of the field in the returned structure
- * that contains the sequence of the structures of the same field.
- * The members before this field are intialised using parameterless
- * StructMember constructor.
- *
- * @return a typecode, defining a stucture, where a member at the
- * <code>offset</code> position defines an array of the identical
- * structures.
- *
- * @see #create_recursive_tc(String)
- * @see #create_sequence_tc(int, TypeCode)
- */
- public abstract TypeCode create_recursive_sequence_tc(int bound, int offset);
/**
* Create a typecode which serves as a placeholder for typcode, containing
@@ -1238,4 +1237,4 @@ public abstract class ORB
why
);
}
-} \ No newline at end of file
+}
diff --git a/libjava/classpath/org/omg/CORBA/ObjectHelper.java b/libjava/classpath/org/omg/CORBA/ObjectHelper.java
index f662a78880c..dbf43308029 100644
--- a/libjava/classpath/org/omg/CORBA/ObjectHelper.java
+++ b/libjava/classpath/org/omg/CORBA/ObjectHelper.java
@@ -1,5 +1,5 @@
/* ObjectHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,6 @@ package org.omg.CORBA;
import gnu.CORBA.Minor;
import gnu.CORBA.OrbRestricted;
-import gnu.CORBA.typecodes.PrimitiveTypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/CORBA/ObjectHolder.java b/libjava/classpath/org/omg/CORBA/ObjectHolder.java
index f79a89bef0d..235f1e66fcd 100644
--- a/libjava/classpath/org/omg/CORBA/ObjectHolder.java
+++ b/libjava/classpath/org/omg/CORBA/ObjectHolder.java
@@ -1,5 +1,5 @@
/* ObjectHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,7 +38,6 @@ exception statement from your version. */
package org.omg.CORBA;
-import gnu.CORBA.typecodes.PrimitiveTypeCode;
import gnu.CORBA.typecodes.RecordTypeCode;
import org.omg.CORBA.portable.InputStream;
@@ -98,10 +97,10 @@ public final class ObjectHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. For <code>org.omg.CORBA.Object</code>, the
* functionality is delegated to
- * {@link org.omg.CORBA.portable.InputStream#read_Object}.
+ * {@link org.omg.CORBA.portable.InputStream#read_Object()}.
*
* @param input the input stream to read from.
*/
@@ -120,7 +119,7 @@ public final class ObjectHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* For <code>Object</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.OutputStream#write_Object(Object) }.
diff --git a/libjava/classpath/org/omg/CORBA/OctetSeqHelper.java b/libjava/classpath/org/omg/CORBA/OctetSeqHelper.java
index df7b22ff52f..e03dba07346 100644
--- a/libjava/classpath/org/omg/CORBA/OctetSeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/OctetSeqHelper.java
@@ -1,5 +1,5 @@
/* OctetSeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/OctetSeqHolder.java b/libjava/classpath/org/omg/CORBA/OctetSeqHolder.java
index 62ea7381920..8c3e9cb6ddb 100644
--- a/libjava/classpath/org/omg/CORBA/OctetSeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/OctetSeqHolder.java
@@ -1,5 +1,5 @@
/* OctetSeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -87,7 +87,7 @@ public final class OctetSeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.InputStream#read_octet_array }.
@@ -111,7 +111,7 @@ public final class OctetSeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.OutputStream#write_octet_array }.
diff --git a/libjava/classpath/org/omg/CORBA/PolicyErrorCodeHelper.java b/libjava/classpath/org/omg/CORBA/PolicyErrorCodeHelper.java
index 6feabdcfdb9..ecb9821dc35 100644
--- a/libjava/classpath/org/omg/CORBA/PolicyErrorCodeHelper.java
+++ b/libjava/classpath/org/omg/CORBA/PolicyErrorCodeHelper.java
@@ -1,5 +1,5 @@
/* PolicyErrorCodeHelper.java --
-Copyright (C) 2005 Free Software Foundation, Inc.
+Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,7 +57,7 @@ public abstract class PolicyErrorCodeHelper
{
/**
- * Delegates call to {@link Any.extract_short()}.
+ * Delegates call to {@link Any#extract_short()}.
*/
public static short extract(Any a)
{
@@ -75,7 +75,7 @@ public abstract class PolicyErrorCodeHelper
}
/**
- * Delegates call to {@link Any.insert_short(short)}.
+ * Delegates call to {@link Any#insert_short(short)}.
*/
public static void insert(Any a, short that)
{
@@ -83,7 +83,7 @@ public abstract class PolicyErrorCodeHelper
}
/**
- * Delegates call to {@link InputStream.read_short()}.
+ * Delegates call to {@link InputStream#read_short()}.
*/
public static short read(InputStream istream)
{
@@ -106,7 +106,7 @@ public abstract class PolicyErrorCodeHelper
}
/**
- * Delegates call to {@link OutputStream#write_short()}.
+ * Delegates call to {@link OutputStream#write_short(short)}.
*/
public static void write(OutputStream ostream, short value)
{
diff --git a/libjava/classpath/org/omg/CORBA/PolicyErrorHelper.java b/libjava/classpath/org/omg/CORBA/PolicyErrorHelper.java
index 27b5b465e53..213acafc7e5 100644
--- a/libjava/classpath/org/omg/CORBA/PolicyErrorHelper.java
+++ b/libjava/classpath/org/omg/CORBA/PolicyErrorHelper.java
@@ -1,5 +1,5 @@
/* PolicyErrorHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -59,8 +59,8 @@ public abstract class PolicyErrorHelper
{
/**
* Create the PolicyError typecode. The typecode defines a structure, named
- * "PolicyError", containing the {@link PolicyErrorCode} (alias int) field,
- * named "reason".
+ * "PolicyError", containing the PolicyErrorCode (alias int, see
+ * {@link PolicyErrorCodeHelper}) field, named "reason".
*/
public static TypeCode type()
{
diff --git a/libjava/classpath/org/omg/CORBA/PolicyHelper.java b/libjava/classpath/org/omg/CORBA/PolicyHelper.java
index 53b56244eb2..4f88cd78396 100644
--- a/libjava/classpath/org/omg/CORBA/PolicyHelper.java
+++ b/libjava/classpath/org/omg/CORBA/PolicyHelper.java
@@ -1,5 +1,5 @@
/* PolicyHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,9 +43,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.Delegate;
import org.omg.CORBA.portable.InputStream;
diff --git a/libjava/classpath/org/omg/CORBA/PolicyListHelper.java b/libjava/classpath/org/omg/CORBA/PolicyListHelper.java
index da0135c0222..54f2036759a 100644
--- a/libjava/classpath/org/omg/CORBA/PolicyListHelper.java
+++ b/libjava/classpath/org/omg/CORBA/PolicyListHelper.java
@@ -1,5 +1,5 @@
/* PolicyListHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,27 +41,19 @@ package org.omg.CORBA;
import gnu.CORBA.Minor;
import gnu.CORBA.OrbRestricted;
-import org.omg.CORBA.Any;
-import org.omg.CORBA.BAD_OPERATION;
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
-import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.portable.Delegate;
import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.ObjectImpl;
import org.omg.CORBA.portable.OutputStream;
/**
* The helper operations for the
-* CORBA object {@link Policy[]}.
+* CORBA object {@link Policy}[].
*
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
*/
public abstract class PolicyListHelper
{
/**
- * Get the type code of the {@link Policy[]}.
+ * Get the type code of the {@link Policy}[].
*/
public static TypeCode type()
{
diff --git a/libjava/classpath/org/omg/CORBA/PolicyTypeHelper.java b/libjava/classpath/org/omg/CORBA/PolicyTypeHelper.java
index 7d5f9bf7656..575fe4aa309 100644
--- a/libjava/classpath/org/omg/CORBA/PolicyTypeHelper.java
+++ b/libjava/classpath/org/omg/CORBA/PolicyTypeHelper.java
@@ -1,5 +1,5 @@
/* PolicyTypeHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
-import org.omg.CORBA.StructMember;
import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
diff --git a/libjava/classpath/org/omg/CORBA/PrincipalHolder.java b/libjava/classpath/org/omg/CORBA/PrincipalHolder.java
index 270427f3fdd..56cd565aa76 100644
--- a/libjava/classpath/org/omg/CORBA/PrincipalHolder.java
+++ b/libjava/classpath/org/omg/CORBA/PrincipalHolder.java
@@ -1,5 +1,5 @@
/* PrincipalHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -86,7 +86,7 @@ public final class PrincipalHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. For {@link Principal}, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.InputStream#read_Principal}.
@@ -108,7 +108,7 @@ public final class PrincipalHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* For {@link Principal} the functionality
* is delegated to
* {@link org.omg.CORBA.portable.OutputStream#write_Principal(Principal)}
diff --git a/libjava/classpath/org/omg/CORBA/RepositoryIdHelper.java b/libjava/classpath/org/omg/CORBA/RepositoryIdHelper.java
index a392002fd23..033a96819d3 100644
--- a/libjava/classpath/org/omg/CORBA/RepositoryIdHelper.java
+++ b/libjava/classpath/org/omg/CORBA/RepositoryIdHelper.java
@@ -1,5 +1,5 @@
/* RepositoryIdHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,7 +55,7 @@ import org.omg.CORBA.portable.OutputStream;
public abstract class RepositoryIdHelper
{
/**
- * Insert the Repository Id into Any (uses {@link Any.insert_string}).
+ * Insert the Repository Id into Any (uses {@link Any#insert_string}).
*
* @param a the Any to insert into.
* @param that the string to insert.
@@ -66,7 +66,7 @@ public abstract class RepositoryIdHelper
}
/**
- * Extract the Repository Id from Any ((uses {@link Any.extract_string}).
+ * Extract the Repository Id from Any ((uses {@link Any#extract_string}).
*
* @param a the Any to extract from.
*/
@@ -104,7 +104,7 @@ public abstract class RepositoryIdHelper
}
/**
- * Calls {@link OutputStream#write_string()}.
+ * Calls {@link OutputStream#write_string(String)}.
*
* @param ostream the stream to write into.
* @param value the string (Repository Id) value to write.
diff --git a/libjava/classpath/org/omg/CORBA/Request.java b/libjava/classpath/org/omg/CORBA/Request.java
index f299d426b8a..beec7869185 100644
--- a/libjava/classpath/org/omg/CORBA/Request.java
+++ b/libjava/classpath/org/omg/CORBA/Request.java
@@ -1,5 +1,5 @@
/* Request.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -137,7 +137,7 @@ public abstract class Request
public abstract ContextList contexts();
/**
- * Get the context, previously set using {@link #cts(Context)}.
+ * Get the context, previously set using {@link #ctx(Context)}.
* The context contains the details about this request.
*/
public abstract Context ctx();
@@ -168,7 +168,7 @@ public abstract class Request
/**
* Allow to access the response that has been previously sent using
- * {@link send_deferred()}.
+ * {@link #send_deferred()}.
*
* @throws WrongTransaction if the transaction scope mismatches.
*/
@@ -190,7 +190,7 @@ public abstract class Request
/**
* Check if the response is received to the request that was
- * previously send using {@link send_deferred()}.
+ * previously send using {@link #send_deferred()}.
*
* @return true if the response has been already received, false otherwise.
*/
diff --git a/libjava/classpath/org/omg/CORBA/ShortHolder.java b/libjava/classpath/org/omg/CORBA/ShortHolder.java
index dfc4721f3f9..59bd4cf333d 100644
--- a/libjava/classpath/org/omg/CORBA/ShortHolder.java
+++ b/libjava/classpath/org/omg/CORBA/ShortHolder.java
@@ -1,5 +1,5 @@
/* ShortHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -91,7 +91,7 @@ public final class ShortHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. For <code>short</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.InputStream#read_short}.
@@ -113,7 +113,7 @@ public final class ShortHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* For <code>short</code>, the functionality
* is delegated to
* {@link org.omg.CORBA.portable.OutputStream#write_short(short) }.
diff --git a/libjava/classpath/org/omg/CORBA/ShortSeqHelper.java b/libjava/classpath/org/omg/CORBA/ShortSeqHelper.java
index 40124f216e9..5140bb96661 100644
--- a/libjava/classpath/org/omg/CORBA/ShortSeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/ShortSeqHelper.java
@@ -1,5 +1,5 @@
/* ShortSeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/ShortSeqHolder.java b/libjava/classpath/org/omg/CORBA/ShortSeqHolder.java
index 246d1ecf47e..b25024e9891 100644
--- a/libjava/classpath/org/omg/CORBA/ShortSeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/ShortSeqHolder.java
@@ -1,5 +1,5 @@
/* ShortSeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -87,7 +87,7 @@ public final class ShortSeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.InputStream#read_short_array }.
@@ -111,7 +111,7 @@ public final class ShortSeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.OutputStream#write_short_array }.
diff --git a/libjava/classpath/org/omg/CORBA/StringSeqHelper.java b/libjava/classpath/org/omg/CORBA/StringSeqHelper.java
index 4225c0bd12b..19f27292c0c 100644
--- a/libjava/classpath/org/omg/CORBA/StringSeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/StringSeqHelper.java
@@ -1,5 +1,5 @@
/* StringSeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/StringSeqHolder.java b/libjava/classpath/org/omg/CORBA/StringSeqHolder.java
index 71ac887e27b..1bc3281d353 100755
--- a/libjava/classpath/org/omg/CORBA/StringSeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/StringSeqHolder.java
@@ -1,5 +1,5 @@
/* StringSeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -87,7 +87,7 @@ public final class StringSeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>and then all strings.
*
@@ -113,7 +113,7 @@ public final class StringSeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code> and then all strings.
*
diff --git a/libjava/classpath/org/omg/CORBA/ULongLongSeqHelper.java b/libjava/classpath/org/omg/CORBA/ULongLongSeqHelper.java
index 1148cb40865..b13f33cdf25 100644
--- a/libjava/classpath/org/omg/CORBA/ULongLongSeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/ULongLongSeqHelper.java
@@ -1,5 +1,5 @@
/* ULongLongSeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/ULongLongSeqHolder.java b/libjava/classpath/org/omg/CORBA/ULongLongSeqHolder.java
index 70b43bf7f45..cd9c023104b 100644
--- a/libjava/classpath/org/omg/CORBA/ULongLongSeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/ULongLongSeqHolder.java
@@ -1,5 +1,5 @@
/* ULongLongSeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -87,7 +87,7 @@ public final class ULongLongSeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.InputStream#read_ulonglong_array }.
@@ -111,7 +111,7 @@ public final class ULongLongSeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.OutputStream#write_ulonglong_array }.
diff --git a/libjava/classpath/org/omg/CORBA/ULongSeqHelper.java b/libjava/classpath/org/omg/CORBA/ULongSeqHelper.java
index dddc1323d7e..186350b2ce2 100644
--- a/libjava/classpath/org/omg/CORBA/ULongSeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/ULongSeqHelper.java
@@ -1,5 +1,5 @@
/* ULongSeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/ULongSeqHolder.java b/libjava/classpath/org/omg/CORBA/ULongSeqHolder.java
index 64d9db6ceee..35d9a4384ac 100644
--- a/libjava/classpath/org/omg/CORBA/ULongSeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/ULongSeqHolder.java
@@ -1,5 +1,5 @@
/* ULongSeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -87,7 +87,7 @@ public final class ULongSeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.InputStream#read_ulong_array }.
@@ -111,7 +111,7 @@ public final class ULongSeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.OutputStream#write_ulong_array }.
diff --git a/libjava/classpath/org/omg/CORBA/UShortSeqHelper.java b/libjava/classpath/org/omg/CORBA/UShortSeqHelper.java
index d1fc440a90d..0fcd4739fb7 100644
--- a/libjava/classpath/org/omg/CORBA/UShortSeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/UShortSeqHelper.java
@@ -1,5 +1,5 @@
/* UShortSeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/UShortSeqHolder.java b/libjava/classpath/org/omg/CORBA/UShortSeqHolder.java
index 47e33b9be02..3eb83c5242a 100644
--- a/libjava/classpath/org/omg/CORBA/UShortSeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/UShortSeqHolder.java
@@ -1,5 +1,5 @@
/* UShortSeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -87,7 +87,7 @@ public final class UShortSeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.InputStream#read_ushort_array }.
@@ -111,7 +111,7 @@ public final class UShortSeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code>) and then calls the
* {@link org.omg.CORBA.portable.OutputStream#write_ushort_array }.
diff --git a/libjava/classpath/org/omg/CORBA/ValueBaseHelper.java b/libjava/classpath/org/omg/CORBA/ValueBaseHelper.java
index 1699d912d61..644666971ac 100644
--- a/libjava/classpath/org/omg/CORBA/ValueBaseHelper.java
+++ b/libjava/classpath/org/omg/CORBA/ValueBaseHelper.java
@@ -1,5 +1,5 @@
/* ValueBaseHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,9 @@ import gnu.CORBA.typecodes.RecordTypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.ValueBase;
+import java.io.ObjectOutputStream;
import java.io.Serializable;
/**
@@ -105,7 +107,7 @@ public abstract class ValueBaseHelper
/**
* Get the typecode of the value type.
- * @return
+ * @return the typecode of the value type
*/
public static TypeCode type()
{
diff --git a/libjava/classpath/org/omg/CORBA/ValueBaseHolder.java b/libjava/classpath/org/omg/CORBA/ValueBaseHolder.java
index 6f57d17c3f1..58f48536ff2 100644
--- a/libjava/classpath/org/omg/CORBA/ValueBaseHolder.java
+++ b/libjava/classpath/org/omg/CORBA/ValueBaseHolder.java
@@ -1,5 +1,5 @@
/* ValueBaseHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,6 +41,7 @@ package org.omg.CORBA;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.Streamable;
+import org.omg.CORBA.portable.ValueBase;
import java.io.Serializable;
diff --git a/libjava/classpath/org/omg/CORBA/VersionSpecHelper.java b/libjava/classpath/org/omg/CORBA/VersionSpecHelper.java
index 9845702985a..74bdb7b7a16 100644
--- a/libjava/classpath/org/omg/CORBA/VersionSpecHelper.java
+++ b/libjava/classpath/org/omg/CORBA/VersionSpecHelper.java
@@ -1,5 +1,5 @@
/* VersionSpecHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,7 +55,7 @@ import org.omg.CORBA.portable.OutputStream;
public abstract class VersionSpecHelper
{
/**
- * Insert the VersionSpec into Any (uses {@link Any.insert_string}).
+ * Insert the VersionSpec into Any (uses {@link Any#insert_string}).
*
* @param a the Any to insert into.
* @param that the string to insert.
@@ -66,7 +66,7 @@ public abstract class VersionSpecHelper
}
/**
- * Extract the VersionSpec from Any ((uses {@link Any.extract_string}).
+ * Extract the VersionSpec from Any ((uses {@link Any#extract_string}).
*
* @param a the Any to extract from.
*/
@@ -104,7 +104,7 @@ public abstract class VersionSpecHelper
}
/**
- * Calls {@link OutputStream#write_string()}.
+ * Calls {@link OutputStream#write_string(String)}.
*
* @param ostream the stream to write into.
* @param value the string (VersionSpec) value to write.
diff --git a/libjava/classpath/org/omg/CORBA/WCharSeqHelper.java b/libjava/classpath/org/omg/CORBA/WCharSeqHelper.java
index 4bb92989d05..fe4d41650a7 100644
--- a/libjava/classpath/org/omg/CORBA/WCharSeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/WCharSeqHelper.java
@@ -1,5 +1,5 @@
/* WCharSeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/WCharSeqHolder.java b/libjava/classpath/org/omg/CORBA/WCharSeqHolder.java
index 72a9cc8c1e3..a1b04d1efe4 100644
--- a/libjava/classpath/org/omg/CORBA/WCharSeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/WCharSeqHolder.java
@@ -1,5 +1,5 @@
/* WCharSeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -87,10 +87,10 @@ public final class WCharSeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>) and then calls the
- * {@link org.omg.CORBA.portable.InputStream#input.read_wchar_array }.
+ * {@link org.omg.CORBA.portable.InputStream#read_wchar_array }.
*
* @param input the input stream to read from.
*/
@@ -111,10 +111,10 @@ public final class WCharSeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code>) and then calls the
- * {@link org.omg.CORBA.portable.OutputStream#input.write_wchar_array }.
+ * {@link org.omg.CORBA.portable.OutputStream#write_wchar_array }.
*
* @param output the output stream to write into.
*/
diff --git a/libjava/classpath/org/omg/CORBA/WStringSeqHelper.java b/libjava/classpath/org/omg/CORBA/WStringSeqHelper.java
index 356cf0dd21c..ea8eac62742 100644
--- a/libjava/classpath/org/omg/CORBA/WStringSeqHelper.java
+++ b/libjava/classpath/org/omg/CORBA/WStringSeqHelper.java
@@ -1,5 +1,5 @@
/* WStringSeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import gnu.CORBA.typecodes.ArrayTypeCode;
import org.omg.CORBA.TypeCodePackage.BadKind;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
/**
* Provides static helper methods for working with
diff --git a/libjava/classpath/org/omg/CORBA/WStringSeqHolder.java b/libjava/classpath/org/omg/CORBA/WStringSeqHolder.java
index 68b77ff6a3a..b909210f3e8 100755
--- a/libjava/classpath/org/omg/CORBA/WStringSeqHolder.java
+++ b/libjava/classpath/org/omg/CORBA/WStringSeqHolder.java
@@ -1,5 +1,5 @@
/* WStringSeqHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -87,7 +87,7 @@ public final class WStringSeqHolder
}
/**
- * Fill in the {@link value } field by reading the required data
+ * Fill in the {@link #value } field by reading the required data
* from the given stream. This method first reads the array size
* (as CORBA <code>long</code>and then all strings.
*
@@ -113,7 +113,7 @@ public final class WStringSeqHolder
}
/**
- * Write the {@link value } field to the given stream.
+ * Write the {@link #value } field to the given stream.
* This method first writes the array size
* (as CORBA <code>long</code> and then all strings.
*
diff --git a/libjava/classpath/org/omg/CORBA/WrongTransactionHelper.java b/libjava/classpath/org/omg/CORBA/WrongTransactionHelper.java
index 27368a4c03a..96673fd5792 100644
--- a/libjava/classpath/org/omg/CORBA/WrongTransactionHelper.java
+++ b/libjava/classpath/org/omg/CORBA/WrongTransactionHelper.java
@@ -1,5 +1,5 @@
/* WrongTransactionHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/CORBA/_IDLTypeStub.java b/libjava/classpath/org/omg/CORBA/_IDLTypeStub.java
index 6661b0c4702..de09b89a7b0 100644
--- a/libjava/classpath/org/omg/CORBA/_IDLTypeStub.java
+++ b/libjava/classpath/org/omg/CORBA/_IDLTypeStub.java
@@ -1,5 +1,5 @@
/* _IDLTypeStub.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
diff --git a/libjava/classpath/org/omg/CORBA/_PolicyStub.java b/libjava/classpath/org/omg/CORBA/_PolicyStub.java
index 50481fe17a0..f633ccbaf65 100644
--- a/libjava/classpath/org/omg/CORBA/_PolicyStub.java
+++ b/libjava/classpath/org/omg/CORBA/_PolicyStub.java
@@ -1,5 +1,5 @@
/* _PolicyStub.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,8 +39,6 @@ exception statement from your version. */
package org.omg.CORBA;
import org.omg.CORBA.MARSHAL;
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.ObjectHelper;
import org.omg.CORBA.portable.ApplicationException;
import org.omg.CORBA.portable.Delegate;
import org.omg.CORBA.portable.InputStream;
diff --git a/libjava/classpath/org/omg/CORBA/portable/BoxedValueHelper.java b/libjava/classpath/org/omg/CORBA/portable/BoxedValueHelper.java
index d869bdc1851..47c2b910680 100644
--- a/libjava/classpath/org/omg/CORBA/portable/BoxedValueHelper.java
+++ b/libjava/classpath/org/omg/CORBA/portable/BoxedValueHelper.java
@@ -1,5 +1,5 @@
/* BoxedValueHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -63,7 +63,7 @@ public interface BoxedValueHelper
/**
* Read this value type from the CDR stream.
*
- * @param is a stream to read from.
+ * @param istream is a stream to read from.
*
* @return a loaded value type.
*/
@@ -72,8 +72,8 @@ public interface BoxedValueHelper
/**
* Write this value type to the CDR stream.
*
- * @param os a stream to write to.
+ * @param ostream a stream to write to.
* @param value a value to write.
*/
void write_value(OutputStream ostream, Serializable value);
-} \ No newline at end of file
+}
diff --git a/libjava/classpath/org/omg/CORBA/portable/Delegate.java b/libjava/classpath/org/omg/CORBA/portable/Delegate.java
index fce04887e91..2f056ac3177 100644
--- a/libjava/classpath/org/omg/CORBA/portable/Delegate.java
+++ b/libjava/classpath/org/omg/CORBA/portable/Delegate.java
@@ -1,5 +1,5 @@
/* Delegate.java --
-Copyright (C) 2005 Free Software Foundation, Inc.
+Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -242,7 +242,7 @@ public abstract class Delegate
/**
* Return the hashcode for this CORBA object. The default implementation
- * delegates call to {@link #hash(int)}, passing Integer.MAX_VALUE as an
+ * delegates call to {@link #hash(org.omg.CORBA.Object, int)}, passing Integer.MAX_VALUE as an
* argument.
*
* @param target the object, for that the hash code must be computed.
@@ -408,7 +408,7 @@ public abstract class Delegate
*
* @param self the CORBA object, to that the string representation must be
* returned. By default, the call is delegated to
- * {@link java.lang.Object.toString()}.
+ * {@link java.lang.Object#toString()}.
*
* @return the string representation.
*/
diff --git a/libjava/classpath/org/omg/CORBA/portable/ObjectImpl.java b/libjava/classpath/org/omg/CORBA/portable/ObjectImpl.java
index f2f21a79e17..f1e348e5304 100644
--- a/libjava/classpath/org/omg/CORBA/portable/ObjectImpl.java
+++ b/libjava/classpath/org/omg/CORBA/portable/ObjectImpl.java
@@ -1,5 +1,5 @@
/* ObjectImpl.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,7 @@ exception statement from your version. */
package org.omg.CORBA.portable;
+import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.Context;
import org.omg.CORBA.ContextList;
import org.omg.CORBA.DomainManager;
@@ -156,9 +157,9 @@ public abstract class ObjectImpl
* @throws BAD_PARAM if the policy of the given type is not
* associated with this object, or if it is not supported by this ORB.
*/
- public Policy _get_policy(int type)
+ public Policy _get_policy(int a_policy_type)
{
- return delegate.get_policy(this, type);
+ return delegate.get_policy(this, a_policy_type);
}
/**
@@ -173,7 +174,7 @@ public abstract class ObjectImpl
* object. The returned value must not change during the object
* lifetime.
*
- * @param maximum the maximal value to return.
+ * @param max the maximal value to return.
*
* @return the hashcode.
*/
@@ -204,7 +205,7 @@ public abstract class ObjectImpl
/**
* Check if this object can be referenced by the given repository id.
*
- * @param repositoryIdentifer the repository id.
+ * @param idl_id the repository id.
*
* @return true if the passed parameter is a repository id of this
* CORBA object.
@@ -233,8 +234,6 @@ public abstract class ObjectImpl
/**
* Returns true if the object is local.
*
- * @param self the object to check.
- *
* @return false, always (following 1.4 specs). Override to get
* functionality.
*/
@@ -278,10 +277,8 @@ public abstract class ObjectImpl
* Release the reply stream back to ORB after finishing reading the data
* from it.
*
- * @param input the stream, normally returned by {@link #invoke} or
+ * @param stream the stream, normally returned by {@link #_invoke} or
* {@link ApplicationException#getInputStream()}, can be null.
- *
- * @throws NO_IMPLEMENT, always (following the 1.4 specification).
*/
public void _releaseReply(InputStream stream)
{
@@ -292,7 +289,7 @@ public abstract class ObjectImpl
/**
* Create a request to invoke the method of this CORBA object.
*
- * @param operation the name of the method to invoke.
+ * @param method the name of the method to invoke.
*
* @return the request.
*/
@@ -304,7 +301,7 @@ public abstract class ObjectImpl
/**
* Create a request to invoke the method of this CORBA object.
*
- * @param operation the name of the method to invoke.
+ * @param method the name of the method to invoke.
* @param response_expected specifies if this is one way message or the
* response to the message is expected.
*
@@ -323,7 +320,6 @@ public abstract class ObjectImpl
*
* The default method returns without action.
*
- * @param self the object.
* @param servant the servant.
*/
public void _servant_postinvoke(ServantObject servant)
@@ -336,9 +332,8 @@ public abstract class ObjectImpl
* The servant can also be casted to the expected type, calling the
* required method directly.
*
- * @param self the object
- * @param operation the operation
- * @param expectedType the expected type of the servant.
+ * @param method the operation
+ * @param expected_type the expected type of the servant.
*
* This implementation always returns null; override for different
* behavior.
@@ -372,10 +367,10 @@ public abstract class ObjectImpl
* them.
*/
public org.omg.CORBA.Object _set_policy_override(Policy[] policies,
- SetOverrideType set_add
+ SetOverrideType how
)
{
- return delegate.set_policy_override(this, policies, set_add);
+ return delegate.set_policy_override(this, policies, how);
}
/**
diff --git a/libjava/classpath/org/omg/CORBA/portable/ServantObject.java b/libjava/classpath/org/omg/CORBA/portable/ServantObject.java
index b35dedc3529..253defc0a92 100644
--- a/libjava/classpath/org/omg/CORBA/portable/ServantObject.java
+++ b/libjava/classpath/org/omg/CORBA/portable/ServantObject.java
@@ -1,5 +1,5 @@
/* ServantObject.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package org.omg.CORBA.portable;
*
* @see ObjectImpl#_servant_preinvoke(String, Class)
* @see ObjectImpl#_servant_postinvoke(ServantObject)
- * @see Delegate#servant_preinvoke(org.omg.CORBA.Object, String operation, Class)
+ * @see Delegate#servant_preinvoke(org.omg.CORBA.Object, String, Class)
* @see Delegate#servant_postinvoke(org.omg.CORBA.Object, ServantObject)
*
* @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
diff --git a/libjava/classpath/org/omg/CORBA/portable/StreamableValue.java b/libjava/classpath/org/omg/CORBA/portable/StreamableValue.java
index ce9b2ca2840..7ab61a6d470 100644
--- a/libjava/classpath/org/omg/CORBA/portable/StreamableValue.java
+++ b/libjava/classpath/org/omg/CORBA/portable/StreamableValue.java
@@ -1,5 +1,5 @@
/* StreamableValue.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.io.Serializable;
* If the value type does not provide the user defined methods for reading
* and writing its content, it must implement this interface for reading
* and writing the content in a default way. This is done by implementing
- * the {@link Streamable#read} and {@link Streamable#write}. IDL compiler
+ * the {@link Streamable#_read} and {@link Streamable#_write}. IDL compiler
* should generate the implementation of this interface automatically.
*
* @see CustomValue for specifying the user-defined io methods.
diff --git a/libjava/classpath/org/omg/CORBA/portable/ValueFactory.java b/libjava/classpath/org/omg/CORBA/portable/ValueFactory.java
index 339bcddb3f5..aaffe8684d9 100644
--- a/libjava/classpath/org/omg/CORBA/portable/ValueFactory.java
+++ b/libjava/classpath/org/omg/CORBA/portable/ValueFactory.java
@@ -59,4 +59,4 @@ public interface ValueFactory
* the stream.
*/
Serializable read_value(org.omg.CORBA_2_3.portable.InputStream from_stream);
-} \ No newline at end of file
+}
diff --git a/libjava/classpath/org/omg/CORBA_2_3/ORB.java b/libjava/classpath/org/omg/CORBA_2_3/ORB.java
index 82660fea705..0895b803788 100644
--- a/libjava/classpath/org/omg/CORBA_2_3/ORB.java
+++ b/libjava/classpath/org/omg/CORBA_2_3/ORB.java
@@ -1,5 +1,5 @@
/* ORB.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,12 +38,14 @@ exception statement from your version. */
package org.omg.CORBA_2_3;
+import javax.rmi.CORBA.Tie;
+
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.NO_IMPLEMENT;
import org.omg.CORBA.portable.ValueFactory;
/**
- * This class should provide the {@link org.omg.CORBA.ORB) ORB extensions,
+ * This class should provide the {@link org.omg.CORBA.ORB}) ORB extensions,
* defined in the OMG CORBA version 2.3 specification. However in the
* Sun's API specification is written that this functionality is not
* implemented at least at least till 1.4 inclusive.
@@ -93,10 +95,9 @@ public abstract class ORB
*
* @param repository_id a repository id
*
- * @return never
* @throws NO_IMPLEMENT, always.
*/
- public void unregister_value_factory(String id)
+ public void unregister_value_factory(String repository_id)
{
throw new NO_IMPLEMENT();
}
@@ -117,7 +118,7 @@ public abstract class ORB
}
/**
- * This method is called by RMI-IIOP {@link javax.rmi.Tie#orb(ORB)},
+ * This method is called by RMI-IIOP {@link Tie#orb(ORB)},
* passing <code>this</code> as parameter. The ORB will try to connect
* that tie as one of its objects.
*/
diff --git a/libjava/classpath/org/omg/CORBA_2_3/portable/InputStream.java b/libjava/classpath/org/omg/CORBA_2_3/portable/InputStream.java
index 23055ef2d4d..349590eed2e 100644
--- a/libjava/classpath/org/omg/CORBA_2_3/portable/InputStream.java
+++ b/libjava/classpath/org/omg/CORBA_2_3/portable/InputStream.java
@@ -1,5 +1,5 @@
/* InputStream.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -72,7 +72,7 @@ public abstract class InputStream
*
* As specified in OMG specification, this reads a single
* boolean and then delegates either to {@link #read_Object()} (for false)
- * or to {@link #read_Value()} (for true).
+ * or to {@link #read_value()} (for true).
*
* @return an abstract interface, unmarshaled from the stream.
*/
@@ -93,7 +93,7 @@ public abstract class InputStream
*
* As specified in OMG specification, this reads a single
* boolean and then delegates either to {@link #read_Object(Class)} (for false)
- * or to {@link #read_Value(Class)} (for true).
+ * or to {@link #read_value(Class)} (for true).
*
* @param clz a base class for the abstract interface.
*
@@ -125,8 +125,6 @@ public abstract class InputStream
* {@link #read_value(Class)} or {@link #read_value(Serializable)}
* instead.
*
- * @param repository_id a repository id of the value type.
- *
* @return an value type structure, unmarshaled from the stream
*/
public Serializable read_value()
diff --git a/libjava/classpath/org/omg/CORBA_2_3/portable/OutputStream.java b/libjava/classpath/org/omg/CORBA_2_3/portable/OutputStream.java
index 70f9a4913ba..f1369f78246 100644
--- a/libjava/classpath/org/omg/CORBA_2_3/portable/OutputStream.java
+++ b/libjava/classpath/org/omg/CORBA_2_3/portable/OutputStream.java
@@ -1,5 +1,5 @@
/* OutputStream.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,6 +41,8 @@ package org.omg.CORBA_2_3.portable;
import gnu.CORBA.CDR.Vio;
import org.omg.CORBA.portable.BoxedValueHelper;
+import org.omg.CORBA.portable.CustomValue;
+import org.omg.CORBA.portable.StreamableValue;
import org.omg.CORBA.portable.ValueBase;
import java.io.Serializable;
@@ -92,7 +94,7 @@ public abstract class OutputStream
* Writes a value type into the output stream.
*
* The value type must implement either {@link CustomValue} (for user-defined
- * writing method) or {@link StramableValue} (for standard writing using code,
+ * writing method) or {@link StreamableValue} (for standard writing using code,
* generated by IDL compiler).
*
* The written record will have a repository id, matching the class of the
@@ -109,7 +111,7 @@ public abstract class OutputStream
* Write value to the stream using the boxed value helper.
*
* The value type must implement either {@link CustomValue}
- * (for user-defined writing method) or {@link StramableValue}
+ * (for user-defined writing method) or {@link StreamableValue}
* (for standard writing using code, generated by IDL compiler).
*
* @param value a value to write.
@@ -129,7 +131,7 @@ public abstract class OutputStream
* writing two Id inheritance hierarchy.
*
* The value type must implement either {@link CustomValue}
- * (for user-defined writing method) or {@link StramableValue}
+ * (for user-defined writing method) or {@link StreamableValue}
* (for standard writing using code, generated by IDL compiler).
*
* @param value a value type object to write.
@@ -144,7 +146,7 @@ public abstract class OutputStream
* repository id.
*
* The value type must implement either {@link CustomValue} (for user-defined
- * writing method) or {@link StramableValue} (for standard writing using code,
+ * writing method) or {@link StreamableValue} (for standard writing using code,
* generated by IDL compiler).
*
* @param repository_id a repository id of the value type.
diff --git a/libjava/classpath/org/omg/CosNaming/BindingIteratorHelper.java b/libjava/classpath/org/omg/CosNaming/BindingIteratorHelper.java
index cb17d5748b3..5430905e5a0 100644
--- a/libjava/classpath/org/omg/CosNaming/BindingIteratorHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/BindingIteratorHelper.java
@@ -1,5 +1,5 @@
/* BindingIteratorHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.Delegate;
import org.omg.CORBA.portable.InputStream;
@@ -126,15 +125,13 @@ public abstract class BindingIteratorHelper
* performed to verify that the object actually supports the requested type.
* The {@link BAD_OPERATION} will be thrown if unsupported operations are
* invoked on the new returned reference, but no failure is expected at the
- * time of the unchecked_narrow.
+ * time of the unchecked_narrow. See OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted binding iterator.
*
* @since 1.5
- *
- * @see OMG issue 4158.
*/
public static BindingIterator unchecked_narrow(org.omg.CORBA.Object obj)
{
diff --git a/libjava/classpath/org/omg/CosNaming/BindingType.java b/libjava/classpath/org/omg/CosNaming/BindingType.java
index d78990349c0..480e7bb33ed 100644
--- a/libjava/classpath/org/omg/CosNaming/BindingType.java
+++ b/libjava/classpath/org/omg/CosNaming/BindingType.java
@@ -1,5 +1,5 @@
/* BindingType.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -62,7 +62,7 @@ public class BindingType
/**
* This constant means that the binding has been created by the
- * means, different from the listed in {@link _ncontext} description.
+ * means, different from the listed in {@link #_ncontext} description.
*/
public static final int _nobject = 0;
@@ -75,7 +75,7 @@ public class BindingType
/**
* This constant means that the binding has been created by the
- * means, different from the listed in {@link _ncontext} description.
+ * means, different from the listed in {@link #_ncontext} description.
*/
public static final BindingType nobject = new BindingType(_nobject);
@@ -101,7 +101,7 @@ public class BindingType
* @param value the binding type code.
* @return the matching binding type instance.
*
- * @throws BAD_KIND if there is no matching binding type for
+ * @throws BAD_PARAM if there is no matching binding type for
* the passed value.
*/
public static BindingType from_int(int value)
diff --git a/libjava/classpath/org/omg/CosNaming/BindingTypeHelper.java b/libjava/classpath/org/omg/CosNaming/BindingTypeHelper.java
index 8f456ee70da..542f3e0e97b 100644
--- a/libjava/classpath/org/omg/CosNaming/BindingTypeHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/BindingTypeHelper.java
@@ -1,5 +1,5 @@
/* BindingTypeHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/CosNaming/IstringHelper.java b/libjava/classpath/org/omg/CosNaming/IstringHelper.java
index b90b452e69f..df680f43627 100644
--- a/libjava/classpath/org/omg/CosNaming/IstringHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/IstringHelper.java
@@ -1,5 +1,5 @@
/* IstringHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -59,7 +59,7 @@ import org.omg.CORBA.portable.OutputStream;
public abstract class IstringHelper
{
/**
- * Insert the IString into Any (uses {@link Any.insert_string}).
+ * Insert the IString into Any (uses {@link Any#insert_string}).
*
* @param a the Any to insert into.
* @param that the string to insert.
@@ -70,7 +70,7 @@ public abstract class IstringHelper
}
/**
- * Extract the IString from Any ((uses {@link Any.extract_string}).
+ * Extract the IString from Any ((uses {@link Any#extract_string}).
*
* @param a the Any to extract from.
*/
@@ -100,7 +100,7 @@ public abstract class IstringHelper
/**
* Calls {@link InputStream#read_string()}.
*
- * @param instream the stream to read from.
+ * @param istream the stream to read from.
*/
public static String read(InputStream istream)
{
@@ -108,7 +108,7 @@ public abstract class IstringHelper
}
/**
- * Calls {@link OutputStream#write_string()}.
+ * Calls {@link OutputStream#write_string(String)}.
*
* @param ostream the stream to write into.
* @param value the string (IString) value to write.
diff --git a/libjava/classpath/org/omg/CosNaming/NameComponentHelper.java b/libjava/classpath/org/omg/CosNaming/NameComponentHelper.java
index 8127aa01d9c..0f7e73b45bd 100644
--- a/libjava/classpath/org/omg/CosNaming/NameComponentHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/NameComponentHelper.java
@@ -1,5 +1,5 @@
/* NameComponentHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -81,7 +81,7 @@ public abstract class NameComponentHelper
/**
* Get the repository Id of the {@link NameComponent}.
- * @return
+ * @return "IDL:omg.org/CosNaming/NameComponent:1.0"
*/
public static String id()
{
diff --git a/libjava/classpath/org/omg/CosNaming/NameHelper.java b/libjava/classpath/org/omg/CosNaming/NameHelper.java
index f66fa4f099d..d1dafb96064 100644
--- a/libjava/classpath/org/omg/CosNaming/NameHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/NameHelper.java
@@ -1,5 +1,5 @@
/* NameHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextExtHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextExtHelper.java
index aca0e9dfd23..98d0b4a8c42 100644
--- a/libjava/classpath/org/omg/CosNaming/NamingContextExtHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/NamingContextExtHelper.java
@@ -1,5 +1,5 @@
/* NamingContextExtHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.Delegate;
import org.omg.CORBA.portable.InputStream;
@@ -127,15 +126,13 @@ public abstract class NamingContextExtHelper
* performed to verify that the object actually supports the requested type.
* The {@link BAD_OPERATION} will be thrown if unsupported operations are
* invoked on the new returned reference, but no failure is expected at the
- * time of the unchecked_narrow.
+ * time of the unchecked_narrow. See OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted NamingContextExt
*
* @since 1.5
- *
- * @see OMG issue 4158.
*/
public static NamingContextExt unchecked_narrow(org.omg.CORBA.Object obj)
{
diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/AddressHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/AddressHelper.java
index 81046074416..8333ff82633 100644
--- a/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/AddressHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/AddressHelper.java
@@ -1,5 +1,5 @@
/* AddressHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,6 @@ import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
-import org.omg.CORBA.portable.Streamable;
/**
* Helper operations for address. Address is directly mapped into
diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHelper.java
index c7f3849a0c1..ea17473e30c 100644
--- a/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHelper.java
@@ -1,5 +1,5 @@
/* InvalidAddressHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,6 @@ package org.omg.CosNaming.NamingContextExtPackage;
import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHolder.java b/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHolder.java
index 1149194624c..5ded186a65a 100644
--- a/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHolder.java
+++ b/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHolder.java
@@ -1,5 +1,5 @@
/* InvalidAddressHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,6 +42,7 @@ import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.Streamable;
+import org.omg.CosNaming.NamingContextPackage.NotEmpty;
/**
* The holder for the exception {@link InvalidAddress}.
diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/StringNameHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/StringNameHelper.java
index 06faa2ff940..f020cef8244 100644
--- a/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/StringNameHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/StringNameHelper.java
@@ -1,5 +1,5 @@
/* StringNameHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,11 +41,9 @@ package org.omg.CosNaming.NamingContextExtPackage;
import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
-import org.omg.CORBA.portable.Streamable;
/**
* Helper operations for the string name.
diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/URLStringHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/URLStringHelper.java
index 173bb989eb7..b565530e553 100644
--- a/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/URLStringHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/NamingContextExtPackage/URLStringHelper.java
@@ -1,5 +1,5 @@
/* URLStringHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,6 @@ package org.omg.CosNaming.NamingContextExtPackage;
import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextHelper.java
index 48b90c25ab0..6bbd0729f7e 100644
--- a/libjava/classpath/org/omg/CosNaming/NamingContextHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/NamingContextHelper.java
@@ -1,5 +1,5 @@
/* NamingContextHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.Delegate;
import org.omg.CORBA.portable.InputStream;
@@ -135,15 +134,11 @@ public abstract class NamingContextHelper
* to verify that the object actually supports the requested type. The
* {@link BAD_OPERATION} will be thrown if unsupported operations are invoked
* on the new returned reference, but no failure is expected at the time of
- * the unchecked_narrow.
+ * the unchecked_narrow. See OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted NamingContext.
- *
- * @since 1.5
- *
- * @see OMG issue 4158.
*/
public static NamingContext unchecked_narrow(org.omg.CORBA.Object obj)
{
diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.java
index f43111cb20b..1eaf50d1269 100644
--- a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.java
@@ -1,5 +1,5 @@
/* AlreadyBoundHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/InvalidName.java b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/InvalidName.java
index 90ca3a5c5b3..59784ea1b86 100644
--- a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/InvalidName.java
+++ b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/InvalidName.java
@@ -1,5 +1,5 @@
/* InvalidName.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,6 @@ package org.omg.CosNaming.NamingContextPackage;
import org.omg.CORBA.UserException;
import org.omg.CORBA.portable.IDLEntity;
-import org.omg.CosNaming.NameComponent;
/**
* The exception is thrown if the name has the zero length or is otherwise
diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.java
index 5893332b804..b5a428cac2e 100644
--- a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.java
@@ -1,5 +1,5 @@
/* InvalidNameHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotEmpty.java b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotEmpty.java
index 3fe98d56400..c80cfcc7acc 100644
--- a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotEmpty.java
+++ b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotEmpty.java
@@ -71,4 +71,4 @@ public final class NotEmpty
{
super(why);
}
-} \ No newline at end of file
+}
diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.java
index a9b802f9549..c4e06c39c16 100644
--- a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.java
@@ -1,5 +1,5 @@
/* NotEmptyHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.java
index 9d44dcbf383..ddc7701a58b 100644
--- a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.java
+++ b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.java
@@ -1,5 +1,5 @@
/* NotFoundReasonHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHolder.java b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHolder.java
index fc41b183392..a18801c66cb 100644
--- a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHolder.java
+++ b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHolder.java
@@ -1,5 +1,5 @@
/* NotFoundReasonHolder.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -81,7 +81,9 @@ public final class NotFoundReasonHolder
/**
* Get the type code of {@link NotFoundReason}.
- * @return
+ *
+ * @return the typecode of enumeration, allowed value names being
+ * "missing_node", "not_context" and "not_object"
*/
public TypeCode _type()
{
diff --git a/libjava/classpath/org/omg/CosNaming/_NamingContextExtImplBase.java b/libjava/classpath/org/omg/CosNaming/_NamingContextExtImplBase.java
index 03630f8d674..617f7aec4ab 100644
--- a/libjava/classpath/org/omg/CosNaming/_NamingContextExtImplBase.java
+++ b/libjava/classpath/org/omg/CosNaming/_NamingContextExtImplBase.java
@@ -66,7 +66,7 @@ public abstract class _NamingContextExtImplBase
extends _NamingContextImplBase
implements NamingContextExt, InvokeHandler
{
- static Hashtable _methods = new Hashtable();
+ static Hashtable<String,Integer> _methods = new Hashtable<String,Integer>();
static
{
@@ -234,4 +234,4 @@ public abstract class _NamingContextExtImplBase
}
gnu.CORBA.ServiceRequestAdapter.invoke(request, this, result);
}
-} \ No newline at end of file
+}
diff --git a/libjava/classpath/org/omg/CosNaming/_NamingContextImplBase.java b/libjava/classpath/org/omg/CosNaming/_NamingContextImplBase.java
index 33bddef5d74..1c2a56be60a 100644
--- a/libjava/classpath/org/omg/CosNaming/_NamingContextImplBase.java
+++ b/libjava/classpath/org/omg/CosNaming/_NamingContextImplBase.java
@@ -82,7 +82,7 @@ public abstract class _NamingContextImplBase
* As there are quite many methods, it may be sensible to use the hashtable.
* This field is also reused in NamingContextPOA.
*/
- static Hashtable methods = new Hashtable();
+ static Hashtable<String,Integer> methods = new Hashtable<String,Integer>();
/**
* Put all methods into the table.
@@ -412,4 +412,4 @@ public abstract class _NamingContextImplBase
gnu.CORBA.ServiceRequestAdapter.invoke(request, this, result);
}
-} \ No newline at end of file
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/AnySeqHelper.java b/libjava/classpath/org/omg/DynamicAny/AnySeqHelper.java
index ddf1422ff17..31ed2ba0253 100644
--- a/libjava/classpath/org/omg/DynamicAny/AnySeqHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/AnySeqHelper.java
@@ -1,5 +1,5 @@
/* AnySeqHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,6 +41,7 @@ package org.omg.DynamicAny;
import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
+import org.omg.CORBA.AnySeqHolder;
import org.omg.CORBA.ORB;
import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryHelper.java
index 97b54873fbd..612ba71c3f8 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryHelper.java
@@ -1,5 +1,5 @@
/* DynAnyFactoryHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,9 +42,9 @@ package org.omg.DynamicAny;
import gnu.CORBA.Minor;
import gnu.CORBA.OrbRestricted;
+import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.MARSHAL;
@@ -88,15 +88,13 @@ public abstract class DynAnyFactoryHelper
* Narrow the given object to the DynAnyFactory. For the objects that are
* always local, this operation does not differ from the ordinary
* {@link #narrow} (ClassCastException will be thrown if narrowing something
- * different).
+ * different). See also OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted DynAnyFactory.
*
* @since 1.5
- *
- * @see OMG issue 4158.
*/
public static DynAnyFactory unchecked_narrow(org.omg.CORBA.Object obj)
{
@@ -163,7 +161,7 @@ public abstract class DynAnyFactoryHelper
* This should read DynAnyFactory from the CDR input stream, but (following
* the JDK 1.5 API) it does not.
*
- * @param input a org.omg.CORBA.portable stream to read from.
+ * @param output a org.omg.CORBA.portable stream to write into.
*
* @specenote Sun throws the same exception.
*
diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryOperations.java b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryOperations.java
index 058e369580d..c3cd919ade1 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryOperations.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryOperations.java
@@ -1,5 +1,5 @@
/* DynAnyFactoryOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,6 +39,7 @@ exception statement from your version. */
package org.omg.DynamicAny;
import org.omg.CORBA.Any;
+import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode;
@@ -83,7 +84,7 @@ public interface DynAnyFactoryOperations
* </tr>
* <tr>
* <td>{@link Any}</td>
- * <td>{@link Any} with no value and typecode of kind {@link TCKind.tk_null}</td>
+ * <td>{@link Any} with no value and typecode of kind {@link TCKind#tk_null}</td>
* <td>{@link DynAny}</td>
* </tr>
* <tr>
diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.java
index 96dbb5fb63d..0184172265d 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.java
@@ -1,5 +1,5 @@
/* InconsistentTypeCodeHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java
index a238bf48baa..315cddbd2dc 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java
@@ -1,5 +1,5 @@
/* DynAnyHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,9 +41,9 @@ package org.omg.DynamicAny;
import gnu.CORBA.OrbRestricted;
+import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.MARSHAL;
@@ -86,15 +86,13 @@ public abstract class DynAnyHelper
* Narrow the given object to the DynAny. For the objects that are
* always local, this operation does not differ from the ordinary
* {@link #narrow} (ClassCastException will be thrown if narrowing something
- * different).
+ * different). See also OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted DynAny.
*
* @since 1.5
- *
- * @see OMG issue 4158.
*/
public static DynAny unchecked_narrow(org.omg.CORBA.Object obj)
{
@@ -160,7 +158,7 @@ public abstract class DynAnyHelper
* This should read DynAny from the CDR input stream, but (following the JDK
* 1.5 API) it does not.
*
- * @param input a org.omg.CORBA.portable stream to read from.
+ * @param output a org.omg.CORBA.portable stream to write into.
*
* @specenote Sun throws the same exception.
*
diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyOperations.java b/libjava/classpath/org/omg/DynamicAny/DynAnyOperations.java
index 0e743136d38..a009f4c8805 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynAnyOperations.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynAnyOperations.java
@@ -1,5 +1,5 @@
/* DynAnyOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
@@ -263,7 +263,7 @@ public interface DynAnyOperations
* Insert the {@link Any} value into the enclosed {@link Any} inside this
* DynAny.
*
- * @param a_x the value being inserted.
+ * @param an_any the value being inserted.
* @throws InvalidValue if the value type does not match the typecode of the
* enclosed {@link Any}.
*/
@@ -452,7 +452,7 @@ public interface DynAnyOperations
throws InvalidValue, TypeMismatch;
/**
- * Advances the internal pointer, described in the {@link current_component},
+ * Advances the internal pointer, described in the {@link #current_component},
* one position forward.
*
* @return true if the pointer now points to the new component, false if there
@@ -462,13 +462,13 @@ public interface DynAnyOperations
boolean next();
/**
- * Moves the internal pointer, described in the {@link current_component}, to
+ * Moves the internal pointer, described in the {@link #current_component}, to
* the first component.
*/
void rewind();
/**
- * Moves the internal pointer, described in the {@link current_component}, to
+ * Moves the internal pointer, described in the {@link #current_component}, to
* the given position.
*
* @param p the number of the internal component on that the internal pointer
@@ -537,4 +537,4 @@ public interface DynAnyOperations
*/
DynAny get_dyn_any()
throws TypeMismatch, InvalidValue;
-} \ No newline at end of file
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.java
index 0258d358919..d27ad6a6b8b 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.java
@@ -1,5 +1,5 @@
/* InvalidValueHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.java
index 244a98aa0b8..7d4fc878938 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.java
@@ -1,5 +1,5 @@
/* TypeMismatchHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java
index 66208ea19ee..f7550fd7969 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java
@@ -1,5 +1,5 @@
/* DynAnySeq.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,7 @@ import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
/**
- * A helper operations for the array of {@link DynAny} ({@link DynAnySeq}).
+ * A helper operations for the array of {@link DynAny} (DynAny[]).
* Following the 1.5 JDK specifications, DynAny (and hence an sequence of
* DynAny's) is always a local object, so the two methods of this helper
* ({@link #read} and {@link #write} are not in use, always throwing
@@ -133,7 +133,7 @@ public abstract class DynAnySeqHelper
* The method should write this object to the CDR input stream, but
* (following the JDK 1.5 API) it does not.
*
- * @param input a org.omg.CORBA.portable stream to read from.
+ * @param output a org.omg.CORBA.portable stream to write into.
*
* @specenote Sun throws the same exception.
*
diff --git a/libjava/classpath/org/omg/DynamicAny/DynArrayHelper.java b/libjava/classpath/org/omg/DynamicAny/DynArrayHelper.java
index 26824d747ae..4cd3e3a52cf 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynArrayHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynArrayHelper.java
@@ -1,5 +1,5 @@
/* DynArrayHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,9 +40,9 @@ package org.omg.DynamicAny;
import gnu.CORBA.OrbRestricted;
+import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.MARSHAL;
@@ -85,16 +85,14 @@ public abstract class DynArrayHelper
* Narrow the given object to the DynArray. For the objects that are
* always local, this operation does not differ from the ordinary
* {@link #narrow} (ClassCastException will be thrown if narrowing something
- * different).
+ * different). See OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted DynArray.
*
* @since 1.5
- *
- * @see OMG issue 4158.
- */
+ */
public static DynArray unchecked_narrow(org.omg.CORBA.Object obj)
{
return narrow(obj);
@@ -159,7 +157,7 @@ public abstract class DynArrayHelper
* This should read DynArray from the CDR input stream, but (following the JDK
* 1.5 API) it does not.
*
- * @param input a org.omg.CORBA.portable stream to read from.
+ * @param output a org.omg.CORBA.portable stream to write into.
*
* @specenote Sun throws the same exception.
*
diff --git a/libjava/classpath/org/omg/DynamicAny/DynEnumHelper.java b/libjava/classpath/org/omg/DynamicAny/DynEnumHelper.java
index 9af2e11948e..da63e844f91 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynEnumHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynEnumHelper.java
@@ -1,5 +1,5 @@
/* DynEnumHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,9 +41,9 @@ package org.omg.DynamicAny;
import gnu.CORBA.OrbRestricted;
+import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.MARSHAL;
@@ -86,15 +86,13 @@ public abstract class DynEnumHelper
* Narrow the given object to the DynEnum. For the objects that are
* always local, this operation does not differ from the ordinary
* {@link #narrow} (ClassCastException will be thrown if narrowing something
- * different).
+ * different). See OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted DynEnum.
*
* @since 1.5
- *
- * @see OMG issue 4158.
*/
public static DynEnum unchecked_narrow(org.omg.CORBA.Object obj)
{
@@ -160,7 +158,7 @@ public abstract class DynEnumHelper
* This should read DynEnum from the CDR input stream, but (following the JDK
* 1.5 API) it does not.
*
- * @param input a org.omg.CORBA.portable stream to read from.
+ * @param output a org.omg.CORBA.portable stream to write into.
*
* @specenote Sun throws the same exception.
*
diff --git a/libjava/classpath/org/omg/DynamicAny/DynFixedHelper.java b/libjava/classpath/org/omg/DynamicAny/DynFixedHelper.java
index 4471bb26b03..e730d43bb85 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynFixedHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynFixedHelper.java
@@ -1,5 +1,5 @@
/* DynFixedHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,9 +41,9 @@ package org.omg.DynamicAny;
import gnu.CORBA.OrbRestricted;
+import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.MARSHAL;
@@ -86,15 +86,13 @@ public abstract class DynFixedHelper
* Narrow the given object to the DynFixed. For the objects that are
* always local, this operation does not differ from the ordinary
* {@link #narrow} (ClassCastException will be thrown if narrowing something
- * different).
+ * different). See OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted DynFixed.
*
* @since 1.5
- *
- * @see OMG issue 4158.
*/
public static DynFixed unchecked_narrow(org.omg.CORBA.Object obj)
{
@@ -160,7 +158,7 @@ public abstract class DynFixedHelper
* This should read DynFixed from the CDR input stream, but (following the JDK
* 1.5 API) it does not.
*
- * @param input a org.omg.CORBA.portable stream to read from.
+ * @param output a org.omg.CORBA.portable stream to write into.
*
* @specenote Sun throws the same exception.
*
diff --git a/libjava/classpath/org/omg/DynamicAny/DynSequenceHelper.java b/libjava/classpath/org/omg/DynamicAny/DynSequenceHelper.java
index 0aa7cdd2ab9..f330108b0eb 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynSequenceHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynSequenceHelper.java
@@ -1,5 +1,5 @@
/* DynSequenceHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,9 +40,9 @@ package org.omg.DynamicAny;
import gnu.CORBA.OrbRestricted;
+import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.MARSHAL;
@@ -85,15 +85,13 @@ public abstract class DynSequenceHelper
* Narrow the given object to the DynSequence. For the objects that are
* always local, this operation does not differ from the ordinary
* {@link #narrow} (ClassCastException will be thrown if narrowing something
- * different).
+ * different). See OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted DynSequence.
*
* @since 1.5
- *
- * @see OMG issue 4158.
*/
public static DynSequence unchecked_narrow(org.omg.CORBA.Object obj)
{
@@ -159,7 +157,7 @@ public abstract class DynSequenceHelper
* This should read DynSequence from the CDR input stream, but (following the
* JDK 1.5 API) it does not.
*
- * @param input a org.omg.CORBA.portable stream to read from.
+ * @param output a org.omg.CORBA.portable stream to write into.
*
* @specenote Sun throws the same exception.
*
diff --git a/libjava/classpath/org/omg/DynamicAny/DynStructHelper.java b/libjava/classpath/org/omg/DynamicAny/DynStructHelper.java
index c683260f67d..077b7d09824 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynStructHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynStructHelper.java
@@ -1,5 +1,5 @@
/* DynStructHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,9 +40,9 @@ package org.omg.DynamicAny;
import gnu.CORBA.OrbRestricted;
+import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.MARSHAL;
@@ -85,15 +85,13 @@ public abstract class DynStructHelper
* Narrow the given object to the DynStruct. For the objects that are
* always local, this operation does not differ from the ordinary
* {@link #narrow} (ClassCastException will be thrown if narrowing something
- * different).
+ * different). See OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted DynStruct.
*
* @since 1.5
- *
- * @see OMG issue 4158.
*/
public static DynStruct unchecked_narrow(org.omg.CORBA.Object obj)
{
@@ -159,7 +157,7 @@ public abstract class DynStructHelper
* This should read DynStruct from the CDR input stream, but (following the
* JDK 1.5 API) it does not.
*
- * @param input a org.omg.CORBA.portable stream to read from.
+ * @param output a org.omg.CORBA.portable stream to write into.
*
* @specenote Sun throws the same exception.
*
diff --git a/libjava/classpath/org/omg/DynamicAny/DynStructOperations.java b/libjava/classpath/org/omg/DynamicAny/DynStructOperations.java
index 3b5af171044..03524b2f9ab 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynStructOperations.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynStructOperations.java
@@ -1,5 +1,5 @@
/* DynStructOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
@@ -101,7 +101,7 @@ public interface DynStructOperations
* @specnote The name-based value assignment is not supported by Sun's jdk
* 1.4.
*
- * @param an array of NameDynValuePair's, each defining a single field in the
+ * @param value an array of NameDynValuePair's, each defining a single field in the
* structure.
*
* @throws TypeMismatch if the member of the passed array has a different type
@@ -125,7 +125,7 @@ public interface DynStructOperations
* @specnote The name-based value assignment is not supported by Sun's jdk
* 1.4.
*
- * @param an array of NameValuePair's, each defining a single field in the
+ * @param value an array of NameValuePair's, each defining a single field in the
* structure.
*
* @throws TypeMismatch if the member of the passed array has a different type
diff --git a/libjava/classpath/org/omg/DynamicAny/DynUnionHelper.java b/libjava/classpath/org/omg/DynamicAny/DynUnionHelper.java
index e868ea41260..f1016d078af 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynUnionHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynUnionHelper.java
@@ -1,5 +1,5 @@
/* DynUnionHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,9 +40,9 @@ package org.omg.DynamicAny;
import gnu.CORBA.OrbRestricted;
+import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.MARSHAL;
@@ -85,15 +85,13 @@ public abstract class DynUnionHelper
* Narrow the given object to the DynUnion. For the objects that are
* always local, this operation does not differ from the ordinary
* {@link #narrow} (ClassCastException will be thrown if narrowing something
- * different).
+ * different). See OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted DynUnion.
*
* @since 1.5
- *
- * @see OMG issue 4158.
*/
public static DynUnion unchecked_narrow(org.omg.CORBA.Object obj)
{
@@ -159,7 +157,7 @@ public abstract class DynUnionHelper
* This should read DynUnion from the CDR input stream, but (following the JDK
* 1.5 API) it does not.
*
- * @param input a org.omg.CORBA.portable stream to read from.
+ * @param output a org.omg.CORBA.portable stream to write into.
*
* @specenote Sun throws the same exception.
*
diff --git a/libjava/classpath/org/omg/DynamicAny/DynUnionOperations.java b/libjava/classpath/org/omg/DynamicAny/DynUnionOperations.java
index c046e69e70e..30b891a2de9 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynUnionOperations.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynUnionOperations.java
@@ -146,4 +146,4 @@ public interface DynUnionOperations
*/
void set_to_no_active_member()
throws TypeMismatch;
-} \ No newline at end of file
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynValueHelper.java b/libjava/classpath/org/omg/DynamicAny/DynValueHelper.java
index ad75bc31fe3..17d9bbc5a8b 100644
--- a/libjava/classpath/org/omg/DynamicAny/DynValueHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/DynValueHelper.java
@@ -1,5 +1,5 @@
/* DynValueHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,9 +40,9 @@ package org.omg.DynamicAny;
import gnu.CORBA.OrbRestricted;
+import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.MARSHAL;
@@ -85,15 +85,13 @@ public abstract class DynValueHelper
* Narrow the given object to the DynValue. For the objects that are
* always local, this operation does not differ from the ordinary
* {@link #narrow} (ClassCastException will be thrown if narrowing something
- * different).
+ * different). See OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted DynValue.
*
* @since 1.5
- *
- * @see OMG issue 4158.
*/
public static DynValue unchecked_narrow(org.omg.CORBA.Object obj)
{
@@ -159,7 +157,7 @@ public abstract class DynValueHelper
* This should read DynValue from the CDR input stream, but (following the JDK
* 1.5 API) it does not.
*
- * @param input a org.omg.CORBA.portable stream to read from.
+ * @param output a org.omg.CORBA.portable stream to write into.
*
* @specenote Sun throws the same exception.
*
diff --git a/libjava/classpath/org/omg/DynamicAny/FieldNameHelper.java b/libjava/classpath/org/omg/DynamicAny/FieldNameHelper.java
index f15b8adfa4f..fb5ea1c7fc7 100644
--- a/libjava/classpath/org/omg/DynamicAny/FieldNameHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/FieldNameHelper.java
@@ -59,7 +59,7 @@ import org.omg.CORBA.portable.OutputStream;
public abstract class FieldNameHelper
{
/**
- * Insert the FieldName into Any (uses {@link Any.insert_string}).
+ * Insert the FieldName into Any (uses {@link Any#insert_string}).
*
* @param a the Any to insert into.
* @param that the string to insert.
@@ -70,7 +70,7 @@ public abstract class FieldNameHelper
}
/**
- * Extract the FieldName from Any ((uses {@link Any.extract_string}).
+ * Extract the FieldName from Any ((uses {@link Any#extract_string}).
*
* @param a the Any to extract from.
*/
@@ -100,7 +100,7 @@ public abstract class FieldNameHelper
/**
* Calls {@link InputStream#read_string()}.
*
- * @param instream the stream to read from.
+ * @param istream the stream to read from.
*/
public static String read(InputStream istream)
{
@@ -108,7 +108,7 @@ public abstract class FieldNameHelper
}
/**
- * Calls {@link OutputStream#write_string()}.
+ * Calls {@link OutputStream#write_string(String)}.
*
* @param ostream the stream to write into.
* @param value the string (FieldName) value to write.
diff --git a/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairHelper.java b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairHelper.java
index a9d9edba71a..4e133a51344 100644
--- a/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairHelper.java
@@ -1,5 +1,5 @@
/* NameDynAnyPairHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -151,7 +151,7 @@ public abstract class NameDynAnyPairHelper
* The method should write this object to the CDR input stream, but
* (following the JDK 1.5 API) it does not.
*
- * @param input a org.omg.CORBA.portable stream to read from.
+ * @param output a org.omg.CORBA.portable stream to write into.
*
* @specenote Sun throws the same exception.
*
diff --git a/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java
index 56e6104eca3..817ed8a70cc 100644
--- a/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java
+++ b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java
@@ -1,5 +1,5 @@
/* NameDynAnyPairSeq.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,7 +52,7 @@ import org.omg.CORBA.portable.OutputStream;
/**
* A helper operations for the array of {@link NameDynAnyPair}
- * ({@link NameDynAnyPairSeq}).
+ * (NameDynAnyPair[]).
*
* Following the 1.5 JDK specifications, DynAny (and hence the sequence
* of structures, containing DynAny) is always a local object.
@@ -132,7 +132,7 @@ public abstract class NameDynAnyPairSeqHelper
* The method should write this object to the CDR input stream, but
* (following the JDK 1.5 API) it does not.
*
- * @param input a org.omg.CORBA.portable stream to read from.
+ * @param output a org.omg.CORBA.portable stream to write into.
*
* @specenote Sun throws the same exception.
*
diff --git a/libjava/classpath/org/omg/IOP/CodecFactoryHelper.java b/libjava/classpath/org/omg/IOP/CodecFactoryHelper.java
index 89404f7d584..d3dc40935ae 100644
--- a/libjava/classpath/org/omg/IOP/CodecFactoryHelper.java
+++ b/libjava/classpath/org/omg/IOP/CodecFactoryHelper.java
@@ -1,5 +1,5 @@
/* CodecFactoryHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,10 +41,10 @@ package org.omg.IOP;
import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.CompletionStatus;
import org.omg.CORBA.MARSHAL;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
@@ -120,15 +120,13 @@ public abstract class CodecFactoryHelper
* Narrow the given object to the CodecFactory. For the objects that are
* always local, this operation does not differ from the ordinary
* {@link #narrow} (ClassCastException will be thrown if narrowing something
- * different).
+ * different). See OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted CodecFactory.
*
* @since 1.5
- *
- * @see OMG issue 4158.
*/
public static CodecFactory unchecked_narrow(org.omg.CORBA.Object obj)
{
@@ -141,7 +139,7 @@ public abstract class CodecFactoryHelper
*
* @specnote Suns implementation (1.4) throws this exception either.
*
- * @throws {@link MARSHAL}, minor code 0 and incomplete, always.
+ * @throws MARSHAL, minor code 0 and incomplete, always.
*/
public static CodecFactory read(InputStream input)
{
@@ -154,7 +152,7 @@ public abstract class CodecFactoryHelper
*
* @specnote Suns implementation (1.4) throws this exception either.
*
- * @throws {@link MARSHAL}, minor code 0 and incomplete, always.
+ * @throws MARSHAL, minor code 0 and incomplete, always.
*/
public static void write(OutputStream output, CodecFactory value)
{
diff --git a/libjava/classpath/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.java b/libjava/classpath/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.java
index 8861e43da5f..2110f0d5b86 100644
--- a/libjava/classpath/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.java
+++ b/libjava/classpath/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.java
@@ -1,5 +1,5 @@
/* UnknownEncodingHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.StructMember;
import org.omg.CORBA.portable.InputStream;
diff --git a/libjava/classpath/org/omg/IOP/CodecOperations.java b/libjava/classpath/org/omg/IOP/CodecOperations.java
index 3dfae1207a7..873f546072a 100644
--- a/libjava/classpath/org/omg/IOP/CodecOperations.java
+++ b/libjava/classpath/org/omg/IOP/CodecOperations.java
@@ -1,5 +1,5 @@
/* CodecOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -66,7 +66,7 @@ public interface CodecOperations
* by this {@link Codec} (wide char and wide string are not supported
* by ENCODING_CDR_ENCAPS v 1.0).
*
- * @see decode(byte[])
+ * @see #decode(byte[])
*/
byte[] encode(Any that)
throws InvalidTypeForEncoding;
@@ -83,7 +83,7 @@ public interface CodecOperations
*
* @throws FormatMismatch on the invalid structure of the byte array.
*
- * @see encode(Any)
+ * @see #encode(Any)
*/
Any decode(byte[] them)
throws FormatMismatch;
@@ -96,7 +96,7 @@ public interface CodecOperations
* @return the array, containing the encoded value alone (no preceeding
* typecode).
*
- * @see decode_value(byte[], TypeCode)
+ * @see #decode_value(byte[], TypeCode)
*/
byte[] encode_value(Any that_value)
throws InvalidTypeForEncoding;
@@ -119,7 +119,7 @@ public interface CodecOperations
* @throws TypeMismatch if discovered that the the byte array defines a
* different structure.
*
- * @see encode_value(Any)
+ * @see #encode_value(Any)
*/
Any decode_value(byte[] them, TypeCode type)
throws FormatMismatch, TypeMismatch;
diff --git a/libjava/classpath/org/omg/IOP/CodecPackage/FormatMismatchHelper.java b/libjava/classpath/org/omg/IOP/CodecPackage/FormatMismatchHelper.java
index 2a9295ae877..02097561747 100644
--- a/libjava/classpath/org/omg/IOP/CodecPackage/FormatMismatchHelper.java
+++ b/libjava/classpath/org/omg/IOP/CodecPackage/FormatMismatchHelper.java
@@ -1,5 +1,5 @@
/* FormatMismatchHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.java b/libjava/classpath/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.java
index e2a8c905793..246a1b93ff0 100644
--- a/libjava/classpath/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.java
+++ b/libjava/classpath/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.java
@@ -1,5 +1,5 @@
/* InvalidTypeForEncodingHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/IOP/CodecPackage/TypeMismatchHelper.java b/libjava/classpath/org/omg/IOP/CodecPackage/TypeMismatchHelper.java
index 432e84d24cb..88e00a243cb 100644
--- a/libjava/classpath/org/omg/IOP/CodecPackage/TypeMismatchHelper.java
+++ b/libjava/classpath/org/omg/IOP/CodecPackage/TypeMismatchHelper.java
@@ -1,5 +1,5 @@
/* TypeMismatchHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/IOP/ComponentIdHelper.java b/libjava/classpath/org/omg/IOP/ComponentIdHelper.java
index 35ffd9a69e4..f94187698a4 100644
--- a/libjava/classpath/org/omg/IOP/ComponentIdHelper.java
+++ b/libjava/classpath/org/omg/IOP/ComponentIdHelper.java
@@ -1,5 +1,5 @@
/* ComponentIdHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
-import org.omg.CORBA.StructMember;
import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
diff --git a/libjava/classpath/org/omg/IOP/ExceptionDetailMessage.java b/libjava/classpath/org/omg/IOP/ExceptionDetailMessage.java
index 167ab1ac7e9..92a068cbaf5 100644
--- a/libjava/classpath/org/omg/IOP/ExceptionDetailMessage.java
+++ b/libjava/classpath/org/omg/IOP/ExceptionDetailMessage.java
@@ -1,5 +1,5 @@
/* ExceptionDetailMessage.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package org.omg.IOP;
* USER_EXCEPTION reply status, as the alternative to the stack trace
* that might contain sensitive or unwanted information. The service
* context contains the CDR-encapsulated wide string, usually
- * returned by {@link Exception#getMessage}.
+ * returned by {@link Exception#getMessage()}.
* </p><p>
* The applications may also send the more comprehensive UnknownExceptionInfo
* ( = 9 ) service context that contains the thrown exception, written
diff --git a/libjava/classpath/org/omg/IOP/MultipleComponentProfileHelper.java b/libjava/classpath/org/omg/IOP/MultipleComponentProfileHelper.java
index 1c04ec54f9c..6a941dee6ad 100644
--- a/libjava/classpath/org/omg/IOP/MultipleComponentProfileHelper.java
+++ b/libjava/classpath/org/omg/IOP/MultipleComponentProfileHelper.java
@@ -1,5 +1,5 @@
/* MultipleComponentProfileHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.portable.OutputStream;
@@ -52,7 +51,7 @@ import org.omg.CORBA.portable.InputStream;
/**
* A helper operations for the array of {@link TaggedComponent}
- * ({@link MultipleComponentProfile}).
+ * (MultipleComponentProfile).
*
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
*/
diff --git a/libjava/classpath/org/omg/IOP/ProfileIdHelper.java b/libjava/classpath/org/omg/IOP/ProfileIdHelper.java
index 340fa27d550..362b2dff35b 100644
--- a/libjava/classpath/org/omg/IOP/ProfileIdHelper.java
+++ b/libjava/classpath/org/omg/IOP/ProfileIdHelper.java
@@ -1,5 +1,5 @@
/* ProfileIdHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
-import org.omg.CORBA.StructMember;
import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
diff --git a/libjava/classpath/org/omg/IOP/ServiceContextListHelper.java b/libjava/classpath/org/omg/IOP/ServiceContextListHelper.java
index 7875db29e1d..9de0b6ffd0d 100644
--- a/libjava/classpath/org/omg/IOP/ServiceContextListHelper.java
+++ b/libjava/classpath/org/omg/IOP/ServiceContextListHelper.java
@@ -1,5 +1,5 @@
/* ServiceContextListHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,21 +43,20 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
/**
* The helper operations for the
-* CORBA object {@link ServiceContext[]}.
+* CORBA object {@link ServiceContext}[].
*
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
*/
public abstract class ServiceContextListHelper
{
/**
- * Get the type code of the {@link ServiceContext[]}.
+ * Get the type code of the {@link ServiceContext}[].
*/
public static TypeCode type()
{
diff --git a/libjava/classpath/org/omg/IOP/ServiceIdHelper.java b/libjava/classpath/org/omg/IOP/ServiceIdHelper.java
index 084dbd06d97..9c4cbbe4a3d 100644
--- a/libjava/classpath/org/omg/IOP/ServiceIdHelper.java
+++ b/libjava/classpath/org/omg/IOP/ServiceIdHelper.java
@@ -1,5 +1,5 @@
/* ServiceIdHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
-import org.omg.CORBA.StructMember;
import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
diff --git a/libjava/classpath/org/omg/IOP/TAG_CODE_SETS.java b/libjava/classpath/org/omg/IOP/TAG_CODE_SETS.java
index cc775248379..07c5c9c3200 100644
--- a/libjava/classpath/org/omg/IOP/TAG_CODE_SETS.java
+++ b/libjava/classpath/org/omg/IOP/TAG_CODE_SETS.java
@@ -1,5 +1,5 @@
/* TAG_CODE_SETS.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package org.omg.IOP;
* profile provides information about the native and supported encodings
* for the "narrow" (usually 8 bit) and "wide" (usually 16 bit) characters.
* In Gnu Classpath implementation the class, responsible for providing
- * this information is {@link gnu.CORBA.CharSets_OSF}.
+ * this information is {@link gnu.CORBA.GIOP.CharSets_OSF}.
* </p>
* <p>
* If this profile is missing, it is assumed, that the "narrow" characters
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java
index 73efa122f2e..e4d70211a13 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java
@@ -1,5 +1,5 @@
/* ClientRequestInfoOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,6 +39,7 @@ exception statement from your version. */
package org.omg.PortableInterceptor;
import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_INV_ORDER;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.INV_POLICY;
import org.omg.CORBA.Policy;
@@ -285,8 +286,6 @@ public interface ClientRequestInfoOperations extends RequestInfoOperations
* @param type the type of the policy being requested.
*
* @return should return the policy that applies to this operation.
- *
- * @throws NO_IMPLEMENT always.
*/
Policy get_request_policy(int type) throws INV_POLICY;
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java
index 4a60b77f5d1..efd98707bd6 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java
@@ -1,5 +1,5 @@
/* ClientRequestInterceptorOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,8 @@ exception statement from your version. */
package org.omg.PortableInterceptor;
+import org.omg.CORBA.SystemException;
+
/**
* Defines operations, applicable to the client side request interceptor. The
diff --git a/libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java b/libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java
index e453f601021..88ab0e2708d 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java
@@ -1,5 +1,5 @@
/* CurrentHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,13 +42,12 @@ import gnu.CORBA.Minor;
import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.MARSHAL;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
-import org.omg.PortableServer.ServantActivator;
/**
* The helper operations for the CORBA object {@link Current}.
@@ -123,15 +122,13 @@ public abstract class CurrentHelper
* Narrow the given object to the Current. For the objects that are
* always local, this operation does not differ from the ordinary
* {@link #narrow} (ClassCastException will be thrown if narrowing something
- * different).
+ * different). See also OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted Current.
*
* @since 1.5
- *
- * @see OMG issue 4158.
*/
public static Current unchecked_narrow(org.omg.CORBA.Object obj)
{
diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInfo.java b/libjava/classpath/org/omg/PortableInterceptor/IORInfo.java
index 9495d79ecec..ec7235102c8 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/IORInfo.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/IORInfo.java
@@ -1,5 +1,5 @@
/* IORInfo.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.io.Serializable;
* Provides the server-side ORB service possibility to add components to the new
* IOR being created. Also, provides access to policies, applicable to the
* object, referenced by that IOR. The ORB passes an instance of IORInfo as a
- * parameter to {@link IORInterceptor#establish_components}.
+ * parameter to {@link IORInterceptorOperations#establish_components}.
*
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
*/
diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.java b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.java
index 926974f1ab8..71fb928f791 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.java
@@ -1,5 +1,5 @@
/* IORInterceptor_3_0Helper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.Delegate;
import org.omg.CORBA.portable.InputStream;
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBIdHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ORBIdHelper.java
index 8332845a662..6b73b115133 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/ORBIdHelper.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/ORBIdHelper.java
@@ -1,5 +1,5 @@
/* ORBIdHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -58,7 +58,7 @@ import org.omg.CORBA.portable.OutputStream;
public abstract class ORBIdHelper
{
/**
- * Insert the ORB Id into Any (uses {@link Any.insert_string}).
+ * Insert the ORB Id into Any (uses {@link Any#insert_string}).
*
* @param a the Any to insert into.
* @param that the string to insert.
@@ -69,7 +69,7 @@ public abstract class ORBIdHelper
}
/**
- * Extract the ORB Id from Any ((uses {@link Any.extract_string}).
+ * Extract the ORB Id from Any ((uses {@link Any#extract_string}).
*
* @param a the Any to extract from.
*/
@@ -107,7 +107,7 @@ public abstract class ORBIdHelper
}
/**
- * Calls {@link OutputStream#write_string()}.
+ * Calls {@link OutputStream#write_string(String)}.
*
* @param output the stream to write into.
* @param value the string (ORB Id) value to write.
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java
index 7b545ff8168..16710a08ab0 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java
@@ -1,5 +1,5 @@
/* ORBInitInfoOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,8 @@ exception statement from your version. */
package org.omg.PortableInterceptor;
+import org.omg.CORBA.BAD_INV_ORDER;
+import org.omg.CORBA.ORB;
import org.omg.IOP.CodecFactory;
import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName;
@@ -90,7 +92,7 @@ public interface ORBInitInfoOperations
throws DuplicateName;
/**
- * Allocate a slot on a {@link PortableInterceptor.Current}. While slots can
+ * Allocate a slot on a {@link Current} of this interceptor. While slots can
* be allocated by this method, they cannot be initialized.
* {@link CurrentOperations#get_slot} and {@link CurrentOperations#set_slot}
* throw {@link org.omg.CORBA.BAD_INV_ORDER} while called from the interceptor
@@ -103,8 +105,8 @@ public interface ORBInitInfoOperations
/**
* Returns the arguments passed to the ORB.init.
*
- * @return the first parameter, passed to the method
- * {@link org.omg.CORBA.ORB#init}.
+ * @return the first parameter, passed to the methods from the group
+ * org.omg.CORBA.ORB#init(String[], ...).
*/
String[] arguments();
@@ -127,7 +129,7 @@ public interface ORBInitInfoOperations
/**
* Register the initial reference. The registered object will be accessible by
- * the {@link ORB.resolve_initial_references} under the object_name.
+ * the {@link ORB#resolve_initial_references} under the object_name.
*
* @param object_name the name of the object to register.
* @param object the object to register.
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.java
index a87a3b747fd..329fcf56462 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.java
@@ -1,5 +1,5 @@
/* InvalidNameHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitializerOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitializerOperations.java
index 90c2325f22b..d5dd771fd98 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/ORBInitializerOperations.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitializerOperations.java
@@ -1,5 +1,5 @@
/* ORBInitializerOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -67,7 +67,7 @@ public interface ORBInitializerOperations
* @param info the object describing ORB being created and containing methods
* to register the interceptor.
*
- * @see ORBInitInfoOperations#register_initial_references
+ * @see ORBInitInfoOperations#register_initial_reference
*/
void post_init(ORBInitInfo info);
} \ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java
index 72c864811f7..b9a237dce77 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java
@@ -1,5 +1,5 @@
/* ObjectReferenceFactoryHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.ValueMember;
import org.omg.CORBA.portable.InputStream;
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.java
index 014c11308c2..0ea54ea5f30 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.java
@@ -1,5 +1,5 @@
/* ObjectReferenceTemplateHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,6 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.VM_ABSTRACT;
import org.omg.CORBA.ValueMember;
diff --git a/libjava/classpath/org/omg/PortableInterceptor/RequestInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/RequestInfoOperations.java
index f865a14d258..10b9662a634 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/RequestInfoOperations.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/RequestInfoOperations.java
@@ -1,5 +1,5 @@
/* RequestInfoOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,6 +40,7 @@ package org.omg.PortableInterceptor;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.NO_RESOURCES;
import org.omg.CORBA.TypeCode;
import org.omg.Dynamic.Parameter;
import org.omg.IOP.ServiceContext;
@@ -182,7 +183,7 @@ public interface RequestInfoOperations
* the client. However up till JDK 1.5 inclusive this method always returns
* SYNC_WITH_TRANSPORT.
*
- * @return {@link org.omg.Messaging.SYNC_WITH_TRANSPORT.value (1), always.
+ * @return {@link org.omg.Messaging.SYNC_WITH_TRANSPORT#value} (1), always.
*
* @specnote as defined in the Suns 1.5 JDK API.
*/
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerIdHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ServerIdHelper.java
index e4f8fe9c28f..84ffdfa8e66 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/ServerIdHelper.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/ServerIdHelper.java
@@ -1,5 +1,5 @@
/* ServerIdHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -58,7 +58,7 @@ import org.omg.CORBA.portable.OutputStream;
public abstract class ServerIdHelper
{
/**
- * Insert the Server Id into Any (uses {@link Any.insert_string}).
+ * Insert the Server Id into Any (uses {@link Any#insert_string}).
*
* @param a the Any to insert into.
* @param that the string to insert.
@@ -69,7 +69,7 @@ public abstract class ServerIdHelper
}
/**
- * Extract the Server Id from Any ((uses {@link Any.extract_string}).
+ * Extract the Server Id from Any ((uses {@link Any#extract_string}).
*
* @param a the Any to extract from.
*/
@@ -107,7 +107,7 @@ public abstract class ServerIdHelper
}
/**
- * Calls {@link OutputStream#write_string()}.
+ * Calls {@link OutputStream#write_string(String)}.
*
* @param output the stream to write into.
* @param value the string (Server Id) value to write.
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java
index a9ee7d92032..52de9d824c0 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java
@@ -1,5 +1,5 @@
/* ServerRequestInfoOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,6 +39,7 @@ exception statement from your version. */
package org.omg.PortableInterceptor;
import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_INV_ORDER;
import org.omg.CORBA.INV_POLICY;
import org.omg.CORBA.Policy;
import org.omg.IOP.ServiceContext;
@@ -287,7 +288,7 @@ public interface ServerRequestInfoOperations
/**
* Checks if the servant is the given repository id.
*
- * @param the repository id to compare.
+ * @param id the repository id to compare.
*
* @return true if the servant repository id matches the parameter, false
* otherwise.
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.java
index b57ca28f7ac..ccba1a76efa 100644
--- a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.java
+++ b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package org.omg.PortableInterceptor;
+import org.omg.CORBA.SystemException;
+
/**
* Defines operations, applicable to the server side request interceptor. The
@@ -50,16 +52,16 @@ public interface ServerRequestInterceptorOperations
{
/**
* ORB calls this method before invoking the servant manager. Operation
- * parameters are not available at this point. The interceptor has possibility
+ * parameters are not available at this point. The interceptor has possibility
* to forward the request by throwing {@link ForwardRequest}.
- *
- * @throws SystemException if it does, the receive_request_service_contexts is
- * not called for the subsequent interceptors, calling send_exception instead.
- * The completion status of such exception must be COMPLETED_NO.
- *
+ *
+ * @throws SystemException if it does, the receive_request_service_contexts is
+ * not called for the subsequent interceptors, calling
+ * send_exception instead. The completion status of such exception
+ * must be COMPLETED_NO.
* @throws ForwardRequest to forward the invocation to another target. The
- * receive_request_service_contexts is not called for the subsequent
- * interceptors, calling send_other instead.
+ * receive_request_service_contexts is not called for the subsequent
+ * interceptors, calling send_other instead.
*/
void receive_request_service_contexts(ServerRequestInfo info)
throws ForwardRequest;
diff --git a/libjava/classpath/org/omg/PortableServer/AdapterActivatorOperations.java b/libjava/classpath/org/omg/PortableServer/AdapterActivatorOperations.java
index dcf7edd0463..d1091852e7a 100644
--- a/libjava/classpath/org/omg/PortableServer/AdapterActivatorOperations.java
+++ b/libjava/classpath/org/omg/PortableServer/AdapterActivatorOperations.java
@@ -1,5 +1,5 @@
/* AdapterActivatorOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,8 @@ exception statement from your version. */
package org.omg.PortableServer;
+import org.omg.CORBA.OBJECT_NOT_EXIST;
+
/**
* Defines the operations, applicable to the AdapterActivator.
diff --git a/libjava/classpath/org/omg/PortableServer/CurrentHelper.java b/libjava/classpath/org/omg/PortableServer/CurrentHelper.java
index 3afbf669b4b..f201e38bc1b 100644
--- a/libjava/classpath/org/omg/PortableServer/CurrentHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/CurrentHelper.java
@@ -1,5 +1,5 @@
/* CurrentHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,9 +41,9 @@ package org.omg.PortableServer;
import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.NO_IMPLEMENT;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContextHelper.java b/libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContextHelper.java
index 02c74c535c5..4a2a9a6a096 100644
--- a/libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContextHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContextHelper.java
@@ -1,5 +1,5 @@
/* NoContextHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java b/libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java
index b30a2abebbb..d5d5751b9e7 100644
--- a/libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java
@@ -1,5 +1,5 @@
/* ForwardRequestHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,6 +39,7 @@ exception statement from your version. */
package org.omg.PortableServer;
import gnu.CORBA.Minor;
+import gnu.CORBA.ObjectCreator;
import gnu.CORBA.OrbRestricted;
import gnu.CORBA.Poa.ForwardRequestHolder;
diff --git a/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyValue.java b/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyValue.java
index ac81d389cdd..cc6f3962a08 100644
--- a/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyValue.java
+++ b/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyValue.java
@@ -1,5 +1,5 @@
/* IdAssignmentPolicyValue.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,6 +41,7 @@ package org.omg.PortableServer;
import gnu.CORBA.Minor;
import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.portable.IDLEntity;
import java.io.Serializable;
diff --git a/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyValue.java b/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyValue.java
index c0f281249b0..0294ee20997 100644
--- a/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyValue.java
+++ b/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyValue.java
@@ -1,5 +1,5 @@
/* IdUniquenessPolicyValue.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,6 +41,7 @@ package org.omg.PortableServer;
import gnu.CORBA.Minor;
import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.portable.IDLEntity;
import java.io.Serializable;
diff --git a/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyValue.java b/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyValue.java
index 9d81d5fab81..6631424c47d 100644
--- a/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyValue.java
+++ b/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyValue.java
@@ -1,5 +1,5 @@
/* ImplicitActivationPolicyValue.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,6 +41,7 @@ package org.omg.PortableServer;
import gnu.CORBA.Minor;
import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.portable.IDLEntity;
import java.io.Serializable;
diff --git a/libjava/classpath/org/omg/PortableServer/LifespanPolicyValue.java b/libjava/classpath/org/omg/PortableServer/LifespanPolicyValue.java
index 117eb5a3c9e..e1ab856b031 100644
--- a/libjava/classpath/org/omg/PortableServer/LifespanPolicyValue.java
+++ b/libjava/classpath/org/omg/PortableServer/LifespanPolicyValue.java
@@ -1,5 +1,5 @@
/* LifespanPolicyValue.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,6 +41,7 @@ package org.omg.PortableServer;
import gnu.CORBA.Minor;
import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.portable.IDLEntity;
import java.io.Serializable;
diff --git a/libjava/classpath/org/omg/PortableServer/POA.java b/libjava/classpath/org/omg/PortableServer/POA.java
index 863a12bf821..624d658da74 100644
--- a/libjava/classpath/org/omg/PortableServer/POA.java
+++ b/libjava/classpath/org/omg/PortableServer/POA.java
@@ -1,5 +1,5 @@
/* POA.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,8 +55,8 @@ import org.omg.CORBA.portable.IDLEntity;
* strategies are possible.
* </p>
*
- * @see org.omg.CORBA.ORB.resolve_initial_references
- * @see POAOperations.servant_to_reference
+ * @see org.omg.CORBA.ORB#resolve_initial_references
+ * @see POAOperations#servant_to_reference
*
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
*/
diff --git a/libjava/classpath/org/omg/PortableServer/POAHelper.java b/libjava/classpath/org/omg/PortableServer/POAHelper.java
index d6a951be52b..122cfb304c0 100644
--- a/libjava/classpath/org/omg/PortableServer/POAHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/POAHelper.java
@@ -1,5 +1,5 @@
/* POAHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,9 +41,9 @@ package org.omg.PortableServer;
import gnu.CORBA.Minor;
import gnu.CORBA.OrbRestricted;
+import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.MARSHAL;
@@ -139,7 +139,7 @@ public abstract class POAHelper
* it doesnot. The jdk 1.5 API specification defines that POA cannot be
* exported.
*
- * @param input a org.omg.CORBA.portable stream to read from.
+ * @param output a org.omg.CORBA.portable stream to write into.
*
* @specenote Sun throws the same exception.
*
diff --git a/libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.java
index e23d11997b4..e6a3068af0a 100644
--- a/libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.java
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/PortableServer/POAManagerPackage/State.java b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/State.java
index 9e856098b0b..b32d420a85c 100644
--- a/libjava/classpath/org/omg/PortableServer/POAManagerPackage/State.java
+++ b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/State.java
@@ -1,5 +1,5 @@
/* State.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,6 +41,8 @@ package org.omg.PortableServer.POAManagerPackage;
import gnu.CORBA.Minor;
import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.TRANSIENT;
import org.omg.CORBA.portable.IDLEntity;
import java.io.Serializable;
@@ -54,7 +56,7 @@ import java.io.Serializable;
* receive and process requests.</li>
* <li>DISCARDING When the manager is in the discarding state,
* the associated POAs discard all incoming requests. The sending clients
- * receive the {@link org.omg.TRANSIENT} system exception, with standard
+ * receive the {@link TRANSIENT} system exception, with standard
* minor code 1. This mode is needed for flow control, when the system is
* flooded with requests.
* </li>
diff --git a/libjava/classpath/org/omg/PortableServer/POAOperations.java b/libjava/classpath/org/omg/PortableServer/POAOperations.java
index 1c22ceed2e4..58d062d2bc6 100644
--- a/libjava/classpath/org/omg/PortableServer/POAOperations.java
+++ b/libjava/classpath/org/omg/PortableServer/POAOperations.java
@@ -1,5 +1,5 @@
/* POAOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,7 +38,11 @@ exception statement from your version. */
package org.omg.PortableServer;
+import org.omg.CORBA.BAD_INV_ORDER;
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.OBJ_ADAPTER;
import org.omg.CORBA.Policy;
+import org.omg.CORBA.TRANSIENT;
import org.omg.PortableServer.POAPackage.AdapterAlreadyExists;
import org.omg.PortableServer.POAPackage.AdapterNonExistent;
import org.omg.PortableServer.POAPackage.InvalidPolicy;
@@ -107,7 +111,7 @@ public interface POAOperations
* the Active Object Map using this Id a a key. If the servant
* activator is set, its incarnate method will be called. In this case,
* the passed servant in this method can be null; in this case, the servant,
- * returned by {@link ServantLocatorOperations#incarnate} will
+ * returned by {@link ServantActivatorOperations#incarnate} will
* be used.
*
* @param a_servant a servant that would serve the object with the
@@ -129,7 +133,7 @@ public interface POAOperations
* object with the provided Object Id. If the servant activator is
* set, its incarnate method will be called. In this case,
* the passed servant in this method can be null; in this case, the servant,
- * returned by {@link ServantLocatorOperations#incarnate} will
+ * returned by {@link ServantActivatorOperations#incarnate} will
* be used.
*
* @param an_Object_Id an object id for the given object.
@@ -241,7 +245,7 @@ public interface POAOperations
/**
* Set a servant manager for this POA.
*
- * @param a servant manager being set. If the RETAIN policy applies, the
+ * @param a_manager servant manager being set. If the RETAIN policy applies, the
* manager must implement a {@link ServantActivator}. If the NON_RETAIN
* policy applies, the manager must implement a {@link ServantLocator}.
*
@@ -298,7 +302,7 @@ public interface POAOperations
* @param the_Object_Id the object id.
*
* @throws ObjectNotActive if there is no active object with such Id.
- * @throws WrongPolicy. This method requires either RETAIN or
+ * @throws WrongPolicy This method requires either RETAIN or
* USE_DEFAULT_SERVANT policies and reaises the WrongPolicy if none of them
* apply to this POA.
*/
@@ -328,7 +332,7 @@ public interface POAOperations
*
* @throws ObjectNotActive if none of the conditions above are satisfied.
* @throws WrongAdapter if the object reference was not created with this POA.
- * @throws WrongPolicy. This method requires either RETAIN or
+ * @throws WrongPolicy This method requires either RETAIN or
* USE_DEFAULT_SERVANT policies and reaises the WrongPolicy if none of them
* apply to this POA.
*/
@@ -408,7 +412,7 @@ public interface POAOperations
/**
* Set the adapter activator for this POA.
*
- * @param the activator being set.
+ * @param activator the activator being set.
*/
void the_activator(AdapterActivator activator);
@@ -437,7 +441,7 @@ public interface POAOperations
* <p> Destroy this POA and all descendant POAs. The destroyed POAs can be
* later re-created via {@link AdapterActivator} or by invoking
* {@link #create_POA}.
- * This differs from {@link PoaManagerOperations#deactivate} that does
+ * This differs from {@link POAManagerOperations#deactivate} that does
* not allow recreation of the deactivated POAs. After deactivation,
* recreation is only possible if the POAs were later destroyed.
* </p><p>
@@ -462,7 +466,7 @@ public interface POAOperations
/**
* Create the IdUniquenessPolicy policy.
*
- * @param value states which one Id uniqueness policy will apply.
+ * @param a_value states which one Id uniqueness policy will apply.
*
* @return the created policy.
*/
@@ -471,7 +475,7 @@ public interface POAOperations
/**
* Create the ImplicitActivationPolicy policy.
*
- * @param value states which one activation policy will apply.
+ * @param a_value states which one activation policy will apply.
*
* @return the created policy.
*/
@@ -480,7 +484,7 @@ public interface POAOperations
/**
* Create the LifespanPolicy policy.
*
- * @param value states which one object lifespan policy will apply.
+ * @param a_value states which one object lifespan policy will apply.
*
* @return the created policy.
*/
@@ -489,7 +493,7 @@ public interface POAOperations
/**
* Create the RequestProcessingPolicy policy.
*
- * @param value states which one request processing policy will apply.
+ * @param a_value states which one request processing policy will apply.
*
* @return the created policy.
*/
@@ -498,7 +502,7 @@ public interface POAOperations
/**
* Create the ServantRetentionPolicy policy.
*
- * @param value states which one servant retention policy will apply.
+ * @param a_value states which one servant retention policy will apply.
*
* @return the created policy.
*/
@@ -507,7 +511,7 @@ public interface POAOperations
/**
* Create the ThreadPolicy policy.
*
- * @param value states which one thread policy will apply.
+ * @param a_value states which one thread policy will apply.
*
* @return the created policy.
*/
diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.java
index f616637ae26..6476eeaa5ac 100644
--- a/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.java
@@ -1,5 +1,5 @@
/* AdapterAlreadyExistsHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.java
index bad920a5a4e..1c007fb43b9 100644
--- a/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.java
@@ -1,5 +1,5 @@
/* AdapterNonExistentHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicy.java b/libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicy.java
index 51ef615fbc2..470d9af4a0c 100644
--- a/libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicy.java
+++ b/libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicy.java
@@ -69,7 +69,7 @@ public final class InvalidPolicy
/**
* Create InvalidPolicy with no explaining
- * message and leaving {@link index} with default 0 value.
+ * message and leaving {@link #index} with default 0 value.
*/
public InvalidPolicy()
{
@@ -77,7 +77,7 @@ public final class InvalidPolicy
/**
* Create the InvalidPolicy with explaining
- * message and initialisintg {@link index} to the passed value.
+ * message and initialisintg {@link #index} to the passed value.
*
* @param why a string, explaining, why this exception has been thrown.
* @param a_index a value for index.
@@ -90,7 +90,7 @@ public final class InvalidPolicy
/**
* Create the InvalidPolicy without explaining
- * message and initialisintg {@link index} to the passed value.
+ * message and initialisintg {@link #index} to the passed value.
*
* @param a_index a value for index.
*/
diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/NoServantHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/NoServantHelper.java
index b9afb8ed79e..56e8c4d16d9 100644
--- a/libjava/classpath/org/omg/PortableServer/POAPackage/NoServantHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/POAPackage/NoServantHelper.java
@@ -1,5 +1,5 @@
/* NoServantHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.java
index bf5e9cd9ef2..7f2e1484c08 100644
--- a/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.java
@@ -1,5 +1,5 @@
/* ObjectAlreadyActiveHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.java
index 2f5867cbdb5..4cdf80891cd 100644
--- a/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.java
@@ -1,5 +1,5 @@
/* ObjectNotActiveHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java
index 33ca0667482..30b0b52d021 100644
--- a/libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java
@@ -1,5 +1,5 @@
/* ServantAlreadyActiveHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.java
index e86f4e948f7..f77ecfc50a6 100644
--- a/libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.java
@@ -1,5 +1,5 @@
/* ServantNotActiveHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapterHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapterHelper.java
index 7650014c1f5..f1181fe61e5 100644
--- a/libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapterHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapterHelper.java
@@ -1,5 +1,5 @@
/* WrongAdapterHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicyHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicyHelper.java
index a9e7fc594d5..bd09c2e9643 100644
--- a/libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicyHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicyHelper.java
@@ -1,5 +1,5 @@
/* WrongPolicyHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
-import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
diff --git a/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyValue.java b/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyValue.java
index 0b1ce4d0bfa..2f22e309082 100644
--- a/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyValue.java
+++ b/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyValue.java
@@ -1,5 +1,5 @@
/* RequestProcessingPolicyValue.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,6 +41,7 @@ package org.omg.PortableServer;
import gnu.CORBA.Minor;
import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.portable.IDLEntity;
import java.io.Serializable;
diff --git a/libjava/classpath/org/omg/PortableServer/Servant.java b/libjava/classpath/org/omg/PortableServer/Servant.java
index 5c99ee1a0e3..24eb715a98d 100644
--- a/libjava/classpath/org/omg/PortableServer/Servant.java
+++ b/libjava/classpath/org/omg/PortableServer/Servant.java
@@ -80,7 +80,7 @@ import gnu.CORBA.Poa.gnuPOA;
* The Servant type is a CORBA <code>native</code> type.
* </p>
*
- * @see POA.servant_to_reference(Servant)
+ * @see POA#servant_to_reference(Servant)
*
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
*/
@@ -128,8 +128,7 @@ public abstract class Servant
* Checks if the passed servant is an instance of the given CORBA IDL type.
* By default, forwards the requet to the delegate.
*
- * @param a_servant a servant to check.
- * @param an_id a repository ID, representing an IDL type for that the
+ * @param repository_id a repository ID, representing an IDL type for that the
* servant must be checked.
*
* @return true if the servant is an instance of the given type, false
@@ -166,7 +165,7 @@ public abstract class Servant
* reference "RootPOA" for that orb. By default, forwards request to the
* delegate.
*
- * @see ORB.resolve_initial_references
+ * @see ORB#resolve_initial_references
*/
public POA _default_POA()
{
@@ -214,7 +213,7 @@ public abstract class Servant
* the given servant. This is important when the same servant serves
* multiple objects. If the servant is not yet connected to the passed
* orb, the method will try to connect it to that orb on POA, returned
- * by the method {@link _default_POA}. That method can be overridden to
+ * by the method {@link #_default_POA}. That method can be overridden to
* get poa where the object must be automatically connected when
* calling this method.
*
diff --git a/libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java b/libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java
index e1c4f09c869..48598aa20e0 100644
--- a/libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java
@@ -1,5 +1,5 @@
/* ServantActivatorHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,6 @@ import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.MARSHAL;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
@@ -121,15 +120,13 @@ public abstract class ServantActivatorHelper
* Narrow the given object to the ServantActivator. For the objects that are
* always local, this operation does not differ from the ordinary
* {@link #narrow} (ClassCastException will be thrown if narrowing something
- * different).
+ * different). See OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted ServantActivator.
*
* @since 1.5
- *
- * @see OMG issue 4158.
*/
public static ServantActivator unchecked_narrow(org.omg.CORBA.Object obj)
{
diff --git a/libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java b/libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java
index 7bb933f7b9f..467464791da 100644
--- a/libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java
+++ b/libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java
@@ -1,5 +1,5 @@
/* ServantLocatorHelper.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,8 +43,8 @@ import gnu.CORBA.OrbRestricted;
import org.omg.CORBA.Any;
import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.MARSHAL;
-import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
@@ -121,15 +121,13 @@ public abstract class ServantLocatorHelper
* Narrow the given object to the ServantLocator. For the objects that are
* always local, this operation does not differ from the ordinary
* {@link #narrow} (ClassCastException will be thrown if narrowing something
- * different).
+ * different). See OMG issue 4158.
*
* @param obj the object to cast.
*
* @return the casted ServantLocator.
*
* @since 1.5
- *
- * @see OMG issue 4158.
*/
public static ServantLocator unchecked_narrow(org.omg.CORBA.Object obj)
{
diff --git a/libjava/classpath/org/omg/PortableServer/ServantLocatorOperations.java b/libjava/classpath/org/omg/PortableServer/ServantLocatorOperations.java
index 6ed214e2f27..58448c1af03 100644
--- a/libjava/classpath/org/omg/PortableServer/ServantLocatorOperations.java
+++ b/libjava/classpath/org/omg/PortableServer/ServantLocatorOperations.java
@@ -1,5 +1,5 @@
/* ServantLocatorOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -60,7 +60,7 @@ public interface ServantLocatorOperations
* @param operation the name of the method or operation being invoked.
* @param cookie_holder the holder where the servant manager can store
* an arbitrary java.lang.Object. This object will be later passed as a
- * <code>cookie</code> parameter for {@link postinvoke}, to create tie
+ * <code>cookie</code> parameter for {@link #postinvoke}, to create tie
* between preinvoke and postinvoke. The application should <i>not</i>
* suppose that each call of preinvoke is followed by the subsequent
* postinvoke for the same invocation; under multi threaded policy these
diff --git a/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyValue.java b/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyValue.java
index 0b6ecf62fe1..607df1293a1 100644
--- a/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyValue.java
+++ b/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyValue.java
@@ -1,5 +1,5 @@
/* ServantRetentionPolicyValue.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,6 +41,7 @@ package org.omg.PortableServer;
import gnu.CORBA.Minor;
import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.portable.IDLEntity;
import java.io.Serializable;
diff --git a/libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java b/libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java
index 5c771a7d624..2ba1b8e821d 100644
--- a/libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java
+++ b/libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java
@@ -1,5 +1,5 @@
/* ThreadPolicyValue.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,6 +41,7 @@ package org.omg.PortableServer;
import gnu.CORBA.Minor;
import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.BAD_PARAM;
import org.omg.CORBA.portable.IDLEntity;
import java.io.Serializable;
diff --git a/libjava/classpath/org/omg/PortableServer/_ServantActivatorStub.java b/libjava/classpath/org/omg/PortableServer/_ServantActivatorStub.java
index 6f907159380..f323f6d381c 100644
--- a/libjava/classpath/org/omg/PortableServer/_ServantActivatorStub.java
+++ b/libjava/classpath/org/omg/PortableServer/_ServantActivatorStub.java
@@ -1,5 +1,5 @@
/* _ServantActivatorStub.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,18 +38,10 @@ exception statement from your version. */
package org.omg.PortableServer;
-import org.omg.CORBA.MARSHAL;
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.ObjectHelper;
-import org.omg.CORBA.portable.ApplicationException;
-import org.omg.CORBA.portable.Delegate;
-import org.omg.CORBA.portable.InputStream;
-import org.omg.CORBA.portable.ObjectImpl;
-import org.omg.CORBA.portable.OutputStream;
-import org.omg.CORBA.portable.RemarshalException;
-
import java.io.Serializable;
+import org.omg.CORBA.portable.ObjectImpl;
+
/**
* <p>This ServantActivator stub is an optional base for the
* servant activators. This stub cannot accept remote invocations, as
diff --git a/libjava/classpath/org/omg/PortableServer/_ServantLocatorStub.java b/libjava/classpath/org/omg/PortableServer/_ServantLocatorStub.java
index 8234ba2c79e..9f142e1e839 100644
--- a/libjava/classpath/org/omg/PortableServer/_ServantLocatorStub.java
+++ b/libjava/classpath/org/omg/PortableServer/_ServantLocatorStub.java
@@ -1,5 +1,5 @@
/* _ServantLocatorStub.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
diff --git a/libjava/classpath/org/omg/PortableServer/portable/Delegate.java b/libjava/classpath/org/omg/PortableServer/portable/Delegate.java
index 70e05e7bf05..3c61122b70c 100644
--- a/libjava/classpath/org/omg/PortableServer/portable/Delegate.java
+++ b/libjava/classpath/org/omg/PortableServer/portable/Delegate.java
@@ -1,5 +1,5 @@
/* DelegateOperations.java --
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,11 +55,11 @@ public interface Delegate
/**
* Returns the root POA of the ORB instance, associated with this servant.
* It is the same POA that would be returned by resolving the initial
- * reference "RootPOA" for that orb. The default {@link Servant#default_POA}
+ * reference "RootPOA" for that orb. The default {@link Servant#_default_POA()}
* method forwards call to the delegate can be overridden to
* obtain the alternative default POA.
*
- * @see ORB.resolve_initial_references
+ * @see ORB#resolve_initial_references
*/
POA default_POA(Servant a_servant);
diff --git a/libjava/classpath/org/omg/stub/java/rmi/_Remote_Stub.java b/libjava/classpath/org/omg/stub/java/rmi/_Remote_Stub.java
index da597e9173f..0d0bac661dd 100644
--- a/libjava/classpath/org/omg/stub/java/rmi/_Remote_Stub.java
+++ b/libjava/classpath/org/omg/stub/java/rmi/_Remote_Stub.java
@@ -75,4 +75,4 @@ public final class _Remote_Stub
return new String[] { "" };
}
-} \ No newline at end of file
+}
diff --git a/libjava/classpath/resource/.cvsignore b/libjava/classpath/resource/.cvsignore
new file mode 100644
index 00000000000..282522db034
--- /dev/null
+++ b/libjava/classpath/resource/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/libjava/classpath/resource/META-INF/services/.cvsignore b/libjava/classpath/resource/META-INF/services/.cvsignore
new file mode 100644
index 00000000000..00abb1c136f
--- /dev/null
+++ b/libjava/classpath/resource/META-INF/services/.cvsignore
@@ -0,0 +1 @@
+java.util.prefs.PreferencesFactory
diff --git a/libjava/classpath/resource/META-INF/services/java.util.prefs.PreferencesFactory b/libjava/classpath/resource/META-INF/services/java.util.prefs.PreferencesFactory
deleted file mode 100644
index 8d05bb13ae6..00000000000
--- a/libjava/classpath/resource/META-INF/services/java.util.prefs.PreferencesFactory
+++ /dev/null
@@ -1 +0,0 @@
-gnu.java.util.prefs.GConfBasedFactory
diff --git a/libjava/classpath/resource/Makefile.am b/libjava/classpath/resource/Makefile.am
index 09419642eac..4369810226f 100644
--- a/libjava/classpath/resource/Makefile.am
+++ b/libjava/classpath/resource/Makefile.am
@@ -1,7 +1,7 @@
## used by automake to generate Makefile.in
logging_DATA = java/util/logging/logging.properties
-loggingdir = $(toolexeclibdir)
+loggingdir = $(prefix)/lib
security_DATA = java/security/classpath.security
-securitydir = $(toolexeclibdir)/security
+securitydir = $(prefix)/lib/security
diff --git a/libjava/classpath/resource/Makefile.in b/libjava/classpath/resource/Makefile.in
index b9be08aa0b2..118fe25dc71 100644
--- a/libjava/classpath/resource/Makefile.in
+++ b/libjava/classpath/resource/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -168,6 +170,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -289,12 +293,11 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
logging_DATA = java/util/logging/logging.properties
-loggingdir = $(toolexeclibdir)
+loggingdir = $(prefix)/lib
security_DATA = java/security/classpath.security
-securitydir = $(toolexeclibdir)/security
+securitydir = $(prefix)/lib/security
all: all-am
.SUFFIXES:
diff --git a/libjava/classpath/resource/gnu/classpath/tools/appletviewer/MessagesBundle.properties b/libjava/classpath/resource/gnu/classpath/tools/appletviewer/MessagesBundle.properties
deleted file mode 100644
index bbd7618a6b5..00000000000
--- a/libjava/classpath/resource/gnu/classpath/tools/appletviewer/MessagesBundle.properties
+++ /dev/null
@@ -1,70 +0,0 @@
-# MessagesBundle.properties -- English language messages
-# Copyright (C) 2004, 2006 Free Software Foundation, Inc.
-#
-# This file is part of GNU Classpath.
-#
-# GNU Classpath is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# GNU Classpath is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Classpath; see the file COPYING. If not, write to the
-# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-#
-# Linking this library statically or dynamically with other modules is
-# making a combined work based on this library. Thus, the terms and
-# conditions of the GNU General Public License cover the whole
-# combination.
-#
-# As a special exception, the copyright holders of this library give you
-# permission to link this library with independent modules to produce an
-# executable, regardless of the license terms of these independent
-# modules, and to copy and distribute the resulting executable under
-# terms of your choice, provided that you also meet, for each linked
-# independent module, the terms and conditions of the license of that
-# module. An independent module is a module which is not derived from
-# or based on this library. If you modify this library, you may extend
-# this exception to your version of the library, but you are not
-# obligated to do so. If you do not wish to do so, delete this
-# exception statement from your version.
-
-gcjwebplugin.code_description=specify the code attribute
-gcjwebplugin.codebase_description=specify the codebase attribute
-gcjwebplugin.archive_description=specify the archive attribute
-gcjwebplugin.width_description=specify the width attribute
-gcjwebplugin.height_description=specify the height attribute
-gcjwebplugin.param_description=specify the parameter arguments
-gcjwebplugin.plugin_description=enable plugin mode
-gcjwebplugin.verbose_description=enable verbose mode
-gcjwebplugin.debug_description=enable debugging mode (not implemented)
-gcjwebplugin.encoding_description=specify the HTML character encoding
-
-gcjwebplugin.no_input_files=appletviewer: no input files
-
-gcjwebplugin.menu_title=Applet
-gcjwebplugin.menu_reload=Reload
-gcjwebplugin.menu_restart=Restart
-gcjwebplugin.menu_start=Start
-gcjwebplugin.menu_stop=Stop
-gcjwebplugin.menu_clone=Clone ...
-gcjwebplugin.menu_quit=Quit
-gcjwebplugin.menu_close=Close
-gcjwebplugin.menu_tag=Tag ...
-gcjwebplugin.menu_info=Info ...
-gcjwebplugin.menu_edit=Edit
-gcjwebplugin.menu_encoding=Character Encoding
-gcjwebplugin.menu_print=Print ...
-gcjwebplugin.menu_properties=Properties ...
-gcjwebplugin.menu_cancel=Cancel
-gcjwebplugin.menu_save=Save ...
-
-gcjwebplugin.console_title=GCJ web plugin console
-gcjwebplugin.console_clear=Clear
-gcjwebplugin.console_hide=Hide
diff --git a/libjava/classpath/resource/gnu/classpath/tools/appletviewer/MessagesBundle_de.properties b/libjava/classpath/resource/gnu/classpath/tools/appletviewer/MessagesBundle_de.properties
deleted file mode 100644
index 036b86f30cd..00000000000
--- a/libjava/classpath/resource/gnu/classpath/tools/appletviewer/MessagesBundle_de.properties
+++ /dev/null
@@ -1,75 +0,0 @@
-# MessagesBundle_de.properties -- German language messages
-# Copyright (C) 2004, 2006 Free Software Foundation, Inc.
-#
-# This file is part of GNU Classpath.
-#
-# GNU Classpath is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# GNU Classpath is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Classpath; see the file COPYING. If not, write to the
-# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 USA.
-#
-# Linking this library statically or dynamically with other modules is
-# making a combined work based on this library. Thus, the terms and
-# conditions of the GNU General Public License cover the whole
-# combination.
-#
-# As a special exception, the copyright holders of this library give you
-# permission to link this library with independent modules to produce an
-# executable, regardless of the license terms of these independent
-# modules, and to copy and distribute the resulting executable under
-# terms of your choice, provided that you also meet, for each linked
-# independent module, the terms and conditions of the license of that
-# module. An independent module is a module which is not derived from
-# or based on this library. If you modify this library, you may extend
-# this exception to your version of the library, but you are not
-# obligated to do so. If you do not wish to do so, delete this
-# exception statement from your version.
-
-# FIXME: rewrite this:
-gcjwebplugin.help.0=Syntax: appletviewer [Optionen] <Dateiname>.class | <Dateiname>.html... | URL...
-gcjwebplugin.help.1=Optionen:
-gcjwebplugin.help.2= --help Diese Hilfe anzeigen and beenden
-gcjwebplugin.help.3= --version Version anzeigen und beenden
-gcjwebplugin.help.4= --code=<Klassenname>[.class] Applet mit Klassen- oder Dateiname ausführen
-gcjwebplugin.help.5= --codebase=<Verzeichnis> Applet-Codebasis setzen
-gcjwebplugin.help.6= --archive=<Dateiname>.jar[,...] Archive zum Klassenlader hinzufügen
-gcjwebplugin.help.7= --param=<Name>,<Wert> Parameter an Applet übergeben
-gcjwebplugin.help.8= --width=<Breite> Setze Breite des Appletfensters
-gcjwebplugin.help.9= --height=<Höhe> Setze Höhe des Appletfensters
-gcjwebplugin.help.10= --plugin=<Eingabepipe>,<Ausgabepipe> Pluginmodus einschalten
-gcjwebplugin.help.11= -debug Starten des Applet-Viewers im Java-Debugger (nicht implementiert)
-gcjwebplugin.help.12= -encoding <Codierung> Angabe der von HTML-Dateien verwendeten Zeichencodierung
-gcjwebplugin.help.13= -J<Laufzeit-Flag> Übergeben des Arguments an den Java-Interpreter
-
-gcjwebplugin.no_input_files=appletviewer: keine Dateien angegeben
-
-gcjwebplugin.menu_title=Applet
-gcjwebplugin.menu_reload=Neu laden
-gcjwebplugin.menu_restart=Neu starten
-gcjwebplugin.menu_start=Start
-gcjwebplugin.menu_stop=Stop
-gcjwebplugin.menu_clone=Klonen ...
-gcjwebplugin.menu_quit=Beenden
-gcjwebplugin.menu_tag=Tag ...
-gcjwebplugin.menu_info=Informationen ...
-gcjwebplugin.menu_edit=Bearbeiten
-gcjwebplugin.menu_encoding=Zeichenkodierung
-gcjwebplugin.menu_print=Drucken ...
-gcjwebplugin.menu_properties=Eigenschaften ...
-gcjwebplugin.menu_close=Schließen
-gcjwebplugin.menu_cancel=Abbrechen
-gcjwebplugin.menu_save=Speichern unter ...
-
-gcjwebplugin.console_title=GCJ web plugin Konsole
-gcjwebplugin.console_clear=Löschen
-gcjwebplugin.console_hide=Schließen
diff --git a/libjava/classpath/resource/gnu/classpath/tools/appletviewer/messages.properties b/libjava/classpath/resource/gnu/classpath/tools/appletviewer/messages.properties
new file mode 100644
index 00000000000..c826afa2197
--- /dev/null
+++ b/libjava/classpath/resource/gnu/classpath/tools/appletviewer/messages.properties
@@ -0,0 +1,102 @@
+# messages.properties -- English language messages
+# Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+#
+# This file is part of GNU Classpath.
+#
+# GNU Classpath is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Classpath is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Classpath; see the file COPYING. If not, write to the
+# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+#
+# Linking this library statically or dynamically with other modules is
+# making a combined work based on this library. Thus, the terms and
+# conditions of the GNU General Public License cover the whole
+# combination.
+#
+# As a special exception, the copyright holders of this library give you
+# permission to link this library with independent modules to produce an
+# executable, regardless of the license terms of these independent
+# modules, and to copy and distribute the resulting executable under
+# terms of your choice, provided that you also meet, for each linked
+# independent module, the terms and conditions of the license of that
+# module. An independent module is a module which is not derived from
+# or based on this library. If you modify this library, you may extend
+# this exception to your version of the library, but you are not
+# obligated to do so. If you do not wish to do so, delete this
+# exception statement from your version.
+
+Main.ErrorApplet=An error occurred while loading this applet.
+Main.Usage=Usage: appletviewer [OPTION] -code CODE | URL...
+Main.AppletTagOptions=Applet tag options
+Main.CodeDescription=specify the code attribute
+Main.CodeArgument=CODE
+Main.CodebaseDescription=specify the codebase attribute
+Main.CodebaseArgument=CODEBASE
+Main.ArchiveDescription=specify the archive attribute
+Main.ArchiveArgument=ARCHIVE
+Main.WidthDescription=specify the width attribute
+Main.WidthArgument=WIDTH
+Main.HeightDescription=specify the height attribute
+Main.HeightArgument=HEIGHT
+Main.ParamDescription=specify the parameter arguments
+Main.ParamArgument=NAME,VALUE
+Main.PluginOption=Plugin option
+Main.PluginDescription=enable plugin mode
+Main.PluginArgument=INPUT,OUTPUT
+Main.DebuggingOption=Debugging option
+Main.VerboseDescription=enable verbose mode
+Main.CompatibilityOptions=Compatibility options
+Main.DebugDescription=enable debugging mode (not implemented)
+Main.EncodingDescription=specify the HTML character encoding
+Main.EncodingArgument=CHARSET
+Main.SecurityWarning=WARNING: CURRENTLY GAPPLETVIEWER RUNS WITH NO\
+ SECURITY MANAGER.\n\
+THIS MEANS THAT APPLETS YOU LOAD CAN DO ANYTHING A JAVA APPLICATION\n\
+THAT YOU DOWNLOAD AND RUN CAN DO. BE *VERY* CAREFUL WHICH APPLETS YOU RUN.\n\
+DO NOT USE GAPPLETVIEWER ON YOUR SYSTEM IF YOUR SYSTEM STORES IMPORTANT\
+ DATA.\n\
+THIS DATA CAN BE DESTROYED OR STOLEN IF YOU LOAD A MALICIOUS APPLET.
+Main.ContinuationPrompt=[press 'c' or 'C' to continue or anything else to quit]
+Main.NoInputFiles=appletviewer: no input files
+Main.RawArguments=Raw arguments:
+
+PluginAppletViewer.AppletViewerWrote=PIPE: applet viewer wrote:
+PluginAppletViewer.AppletViewerRead=PIPE: applet viewer read:
+PluginAppletViewer.AppletViewerExiting=appletviewer: exiting plugin applet\
+ viewer
+
+StandaloneAppletContext.ShowDocumentError=showDocument is not implemented in\
+ standalone mode
+
+StandaloneAppletViewer.ParsedAppletTags=Parsed applet tags:
+StandaloneAppletViewer.Tag=tag
+StandaloneAppletViewer.CodeOptionError=appletviewer: option '--code' requires\
+ a class filename
+
+StandaloneAppletWindow.MenuTitle=Applet
+StandaloneAppletWindow.MenuReload=Reload
+StandaloneAppletWindow.MenuRestart=Restart
+StandaloneAppletWindow.MenuStart=Start
+StandaloneAppletWindow.MenuStop=Stop
+StandaloneAppletWindow.MenuClone=Clone ...
+StandaloneAppletWindow.MenuQuit=Quit
+StandaloneAppletWindow.MenuClose=Close
+StandaloneAppletWindow.MenuTag=Tag ...
+StandaloneAppletWindow.MenuInfo=Info ...
+StandaloneAppletWindow.MenuEdit=Edit
+StandaloneAppletWindow.MenuEncoding=Character Encoding
+StandaloneAppletWindow.MenuPrint=Print ...
+StandaloneAppletWindow.MenuProperties=Properties ...
+StandaloneAppletWindow.MenuCancel=Cancel
+StandaloneAppletWindow.MenuSave=Save ...
+StandaloneAppletWindow.WindowTitle=GNU Classpath Applet Viewer:
diff --git a/libjava/classpath/resource/gnu/classpath/tools/common/Messages.properties b/libjava/classpath/resource/gnu/classpath/tools/common/Messages.properties
new file mode 100644
index 00000000000..989fde74eee
--- /dev/null
+++ b/libjava/classpath/resource/gnu/classpath/tools/common/Messages.properties
@@ -0,0 +1,40 @@
+# MessagesBundle.properties -- English language messages
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is part of GNU Classpath.
+#
+# GNU Classpath is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Classpath is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Classpath; see the file COPYING. If not, write to the
+# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+#
+# Linking this library statically or dynamically with other modules is
+# making a combined work based on this library. Thus, the terms and
+# conditions of the GNU General Public License cover the whole
+# combination.
+#
+# As a special exception, the copyright holders of this library give you
+# permission to link this library with independent modules to produce an
+# executable, regardless of the license terms of these independent
+# modules, and to copy and distribute the resulting executable under
+# terms of your choice, provided that you also meet, for each linked
+# independent module, the terms and conditions of the license of that
+# module. An independent module is a module which is not derived from
+# or based on this library. If you modify this library, you may extend
+# this exception to your version of the library, but you are not
+# obligated to do so. If you do not wish to do so, delete this
+# exception statement from your version.
+
+ClasspathToolParser.JArgument=pass argument to the Java runtime
+ClasspathToolParser.JName=OPTION
+ClasspathToolParser.VersionFormat={0} (GNU Classpath) {1}\n\nCopyright 2006 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/libjava/classpath/resource/gnu/classpath/tools/getopt/Messages.properties b/libjava/classpath/resource/gnu/classpath/tools/getopt/Messages.properties
index 42827e6e33b..a747ab4b473 100644
--- a/libjava/classpath/resource/gnu/classpath/tools/getopt/Messages.properties
+++ b/libjava/classpath/resource/gnu/classpath/tools/getopt/Messages.properties
@@ -38,12 +38,9 @@
Parser.StdOptions=Standard options
Parser.PrintHelp=print this help, then exit
Parser.PrintVersion=print version number, then exit
-Parser.JArgument=pass argument to the Java runtime
-Parser.JName=OPTION
Parser.ArgReqd=option ''{0}'' requires an argument
Parser.Unrecognized=unrecognized option ''{0}''
Parser.NoArg=option ''{0}'' doesn''t allow an argument
Parser.UnrecDash=unrecognized option ''-{0}''
Parser.TryHelpShort=Try ''{0} -help'' for more information
Parser.TryHelpLong=Try ''{0} --help'' for more information
-ClasspathToolParser.VersionFormat={0} (GNU Classpath) {1}\n\nCopyright 2006 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/libjava/classpath/resource/gnu/classpath/tools/jarsigner/MessageBundle.properties b/libjava/classpath/resource/gnu/classpath/tools/jarsigner/MessageBundle.properties
new file mode 100644
index 00000000000..902166d5fdb
--- /dev/null
+++ b/libjava/classpath/resource/gnu/classpath/tools/jarsigner/MessageBundle.properties
@@ -0,0 +1,33 @@
+# default locale messages for gnu.classpath.tools.jarsigner package
+
+Main.7=jarsigner:
+Main.9=jarsigner error:
+Main.70=JAR file [{0}] is NOT a file object
+Main.72=JAR file [{0}] is NOT readable
+#Main.85=Option '-keystore' is not defined or is an empty string, and 'user.home' is unknown
+Main.85=Unable to locate a valid key store
+Main.92=Enter key store password:
+Main.6=Designated alias [{0}] MUST be known to the key store in use
+Main.95=Designated alias [{0}] MUST be an Alias of a Key Entry
+Main.97=Enter key password for <{0}>:
+Main.99=Key associated with [{0}] MUST be a private key
+
+JarSigner.1=\ \ signing:
+JarSigner.2=\ updating:
+JarSigner.8=\ \ \ adding:
+JarSigner.11=\ \ \ adding:
+JarSigner.14=jar signed.
+
+JarVerifier.2=jar is not signed.--no signature files found.
+JarVerifier.3=jar verification failed.
+JarVerifier.4=jar partially verified --{0,numer} of {1,number} signers.
+JarVerifier.7=jar verified --{0,number} signer(s).
+JarVerifier.13=Signature Block missing for {0}
+JarVerifier.14=At least one SignerInfo element MUST be present in a Signature Block (.DSA file)
+JarVerifier.16=Missing EncryptedDigest in Signature Block (.DSA file) first SignerInfo element
+
+SFHelper.1=Helper is NOT finished
+SFHelper.4=.SF file has NOT been generated
+SFHelper.6=Unknown or unsupported private key algorithm
+SFHelper.9=Helper is NOT ready
+SFHelper.10=Helper is NOT started
diff --git a/libjava/classpath/resource/gnu/classpath/tools/keytool/MessageBundle.properties b/libjava/classpath/resource/gnu/classpath/tools/keytool/MessageBundle.properties
new file mode 100644
index 00000000000..2dd3ce2fc67
--- /dev/null
+++ b/libjava/classpath/resource/gnu/classpath/tools/keytool/MessageBundle.properties
@@ -0,0 +1,95 @@
+# default locale messages for gnu.classpath.tools.keytool package
+
+Main.6=keytool:
+Main.8=keytool error:
+
+Command.19=Failed creating new file at {0}
+Command.20=Unable to find a suitable signature algorithm named {0}, although we found a key-pair generation algorithm named {1}
+Command.21=Enter key password for <{0}>:
+Command.23=A correct key password MUST be provided
+Command.24=Enter key store password:
+#Command.36=Option '-keystore' is undefined, or is an empty string, and 'user.home' is unknown
+Command.36=Unable to locate a valid key store
+Command.40=Provider fully qualified class name:
+Command.42=File object [{0}] exists but is NOT a file
+Command.44=File [{0}] exists but is NOT writable
+Command.46=File object [{0}] MUST be an existing readable file
+Command.48=Signature algorithm is missing and private key is of unknown or unsupported type
+Command.51=Validity period MUST be greater than zero
+Command.52=Unable to get signature algorithm name
+Command.60=Unknown or unsupported signature algorithm: {0}
+Command.63=Saving key store at {0}
+Command.66=Owner: {0}
+Command.67=Issuer: {0}
+Command.68=Serial number: {0,number}
+Command.69=Valid from: {0,date,full} - {0,time,full}
+Command.70=\ \ \ \ \ until: {0,date,full} - {0,time,full}
+Command.71=Certificate fingerprints
+Command.72=\ \ \ \ \ \ MD5: {0}
+Command.73=\ \ SHA-160: {0}
+Command.75=Alias [{0}] MUST be knwon to the key store
+Command.77=Alias [{0}] MUST be associated with a Key Entry
+
+CertReqCmd.27=Certification request stored in {0}
+CertReqCmd.28=Submit this to your CA
+
+DeleteCmd.19=Enter the Alias to delete:
+DeleteCmd.20=Alias MUST NOT be null or an empty string
+
+GenKeyCmd.0=\nYou are about to enter information that will be incorporated into\n\
+your certificate request. This information is what is called a\n\
+Distinguished Name or DN. There are quite a few fields but you\n\
+can use supplied default values, displayed between brackets, by just\n\
+hitting <Enter>, or blank the field by entering the <.> character\n\
+before hitting <Enter>.\n\n
+GenKeyCmd.6=The Sample Company
+GenKeyCmd.7=Sydney
+GenKeyCmd.8=NSW
+GenKeyCmd.9=AU
+GenKeyCmd.10=Common Name (hostname, IP, or your name):
+GenKeyCmd.11=Organization Name (company) [{0}]:
+GenKeyCmd.13=Organizational Unit Name (department, division):
+GenKeyCmd.14=Locality Name (city, district) [{0}]:
+GenKeyCmd.16=State or Province Name (full name) [{0}]:
+GenKeyCmd.18=Country Name (2 letter code) [{0}]:
+GenKeyCmd.54=Key size MUST be greater than zero
+
+StorePasswdCmd.19=Too many failed attempts
+StorePasswdCmd.20=Enter new key store password:
+StorePasswdCmd.21=Password MUST be at least 6 characters.
+StorePasswdCmd.22=New password MUST be different than the old one.
+StorePasswdCmd.23=Re-enter new key store password:
+StorePasswdCmd.24=Passwords MUST be the same in both attempts.
+
+KeyPasswdCmd.24=Enter new key password for <{0}>:
+KeyPasswdCmd.28=Re-enter new key password for <{0}>:
+
+KeyCloneCmd.23=Destination Alias MUST NOT exist in key store
+KeyCloneCmd.26=Enter destination alias:
+KeyCloneCmd.27=Destination alias MUST NOT be null nor empty
+KeyCloneCmd.28=Enter new key password for <{0}> [{1}]:
+
+ListCmd.21=Key store type: {0}
+ListCmd.22=Key store provider: {0}
+ListCmd.24=Key store contains {0,number} entry(ies)
+ListCmd.30=Alias name: {0}
+ListCmd.31=Creation timestamp: {0,date,full} - {0,time,full}
+ListCmd.32=Entry type: trusted-certificate
+ListCmd.33=Entry type: key-entry
+ListCmd.34=Alias [{0}] is unknown to the key store
+ListCmd.38=Certificate chain length: {0,number}
+ListCmd.39=Certificate[1]:
+ListCmd.40=Certificate[{0,number}]:
+ListCmd.42=*******************************************
+ListCmd.43=-----BEGIN CERTIFICATE-----
+ListCmd.44=-----END CERTIFICATE-----
+ListCmd.45=Certificate fingerprint (MD5): {0}
+
+ImportCmd.34=Failed to establish chain-of-trust from reply
+ImportCmd.37=Unable to find anchor certificate for {0}
+ImportCmd.38=Public keys, in key store and certificate, MUST be of the same type
+ImportCmd.32=Can this certificate be trusted?
+ImportCmd.40=Key entry associated with {0} has an unknown or unsupported public key type {1}
+ImportCmd.41=Public keys, in key store and certificate, MUST be the same
+ImportCmd.29=Certificate was added to the key store
+ImportCmd.28=Certificate was not added to the key store
diff --git a/libjava/classpath/resource/gnu/classpath/tools/orbd/messages.properties b/libjava/classpath/resource/gnu/classpath/tools/orbd/messages.properties
new file mode 100644
index 00000000000..b427d102bf1
--- /dev/null
+++ b/libjava/classpath/resource/gnu/classpath/tools/orbd/messages.properties
@@ -0,0 +1,46 @@
+# messages.properties -- English language messages
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is part of GNU Classpath.
+#
+# GNU Classpath is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Classpath is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Classpath; see the file COPYING. If not, write to the
+# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+#
+# Linking this library statically or dynamically with other modules is
+# making a combined work based on this library. Thus, the terms and
+# conditions of the GNU General Public License cover the whole
+# combination.
+#
+# As a special exception, the copyright holders of this library give you
+# permission to link this library with independent modules to produce an
+# executable, regardless of the license terms of these independent
+# modules, and to copy and distribute the resulting executable under
+# terms of your choice, provided that you also meet, for each linked
+# independent module, the terms and conditions of the license of that
+# module. An independent module is a module which is not derived from
+# or based on this library. If you modify this library, you may extend
+# this exception to your version of the library, but you are not
+# obligated to do so. If you do not wish to do so, delete this
+# exception statement from your version.
+
+Main.Usage=Usage: orbd [OPTIONS]
+Main.ORBInitialPort=port on which persistent naming service is to be started
+Main.Port=PORT
+Main.IOR=file in which to store persistent naming service's IOR reference
+Main.IORFile=FILE
+Main.Restart=restart persistent naming service, clearing persistent naming database
+Main.Directory=directory in which to store persistent data
+Main.DirectoryArgument=DIRECTORY
+Main.InternalError=orbd: internal error:
diff --git a/libjava/classpath/resource/gnu/classpath/tools/rmic/messages.properties b/libjava/classpath/resource/gnu/classpath/tools/rmic/messages.properties
new file mode 100644
index 00000000000..7be7cb0c732
--- /dev/null
+++ b/libjava/classpath/resource/gnu/classpath/tools/rmic/messages.properties
@@ -0,0 +1,61 @@
+# messages.properties -- English language messages
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is part of GNU Classpath.
+#
+# GNU Classpath is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Classpath is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Classpath; see the file COPYING. If not, write to the
+# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+#
+# Linking this library statically or dynamically with other modules is
+# making a combined work based on this library. Thus, the terms and
+# conditions of the GNU General Public License cover the whole
+# combination.
+#
+# As a special exception, the copyright holders of this library give you
+# permission to link this library with independent modules to produce an
+# executable, regardless of the license terms of these independent
+# modules, and to copy and distribute the resulting executable under
+# terms of your choice, provided that you also meet, for each linked
+# independent module, the terms and conditions of the license of that
+# module. An independent module is a module which is not derived from
+# or based on this library. If you modify this library, you may extend
+# this exception to your version of the library, but you are not
+# obligated to do so. If you do not wish to do so, delete this
+# exception statement from your version.
+
+Main.Usage:rmic [OPTIONS] CLASSNAME...
+Main.NoWarn:show no warnings
+Main.NoWrite:check for errors and do not write any files
+Main.Verbose:show verbose output
+Main.DirOpt:write generated files to given directory
+Main.DirArg:DIRECTORY
+Main.ClasspathOpt:where to find input classes
+Main.ClasspathArg:PATH
+Main.BootclasspathOpt:where to find classes used to run rmic (ignored)
+Main.BootclasspathArg:PATH
+Main.ExtdirsOpt:where to find extension classes used to run rmic (ignored)
+Main.ExtdirsArg:PATH
+Main.IIOP:generate stubs and ties for IIOP
+Main.Always:always overwrite generated files (ignored)
+Main.AlwaysGenerate:same as -always
+Main.NoLocalStubs:do not create same-process stubs (ignored)
+Main.POA:generate servant-based ties
+Main.Keep:keep generated stub, skeleton and tie sources
+Main.KeepGenerated:same as -keep
+Main.v11:generate JDK 1.1 protocol stubs and skeletons
+Main.v12:generate JDK 1.2 JRMP stubs (default)
+Main.vcompat:generate JDK 1.1 protocol and JDK 1.2 JRMP stubs
+Main.DebugInfo:include debugging information in generated classes
+Main.InternalError:rmic: internal error:
diff --git a/libjava/classpath/resource/gnu/classpath/tools/rmid/messages.properties b/libjava/classpath/resource/gnu/classpath/tools/rmid/messages.properties
new file mode 100644
index 00000000000..234cea12a1e
--- /dev/null
+++ b/libjava/classpath/resource/gnu/classpath/tools/rmid/messages.properties
@@ -0,0 +1,50 @@
+# messages.properties -- English language messages
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is part of GNU Classpath.
+#
+# GNU Classpath is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Classpath is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Classpath; see the file COPYING. If not, write to the
+# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+#
+# Linking this library statically or dynamically with other modules is
+# making a combined work based on this library. Thus, the terms and
+# conditions of the GNU General Public License cover the whole
+# combination.
+#
+# As a special exception, the copyright holders of this library give you
+# permission to link this library with independent modules to produce an
+# executable, regardless of the license terms of these independent
+# modules, and to copy and distribute the resulting executable under
+# terms of your choice, provided that you also meet, for each linked
+# independent module, the terms and conditions of the license of that
+# module. An independent module is a module which is not derived from
+# or based on this library. If you modify this library, you may extend
+# this exception to your version of the library, but you are not
+# obligated to do so. If you do not wish to do so, delete this
+# exception statement from your version.
+
+Main.Usage=Usage: rmid [OPTIONS]
+Main.ControlGroup=Activation process control
+Main.PortOption=port on which activation system is to be started
+Main.Port=PORT
+Main.Restart=restart activation system, clearing persistent naming database, if any
+Main.Stop=stop activation system
+Main.PersistenceGroup=Persistence
+Main.Persistent=make activation system persistent
+Main.Directory=directory in which to store persistent data
+Main.DirectoryArgument=DIRECTORY
+Main.DebugGroup=Debugging
+Main.Verbose=log binding events to standard out
+Main.InternalError=rmid: internal error:
diff --git a/libjava/classpath/resource/gnu/classpath/tools/rmiregistry/messages.properties b/libjava/classpath/resource/gnu/classpath/tools/rmiregistry/messages.properties
new file mode 100644
index 00000000000..46f7cfdb73f
--- /dev/null
+++ b/libjava/classpath/resource/gnu/classpath/tools/rmiregistry/messages.properties
@@ -0,0 +1,48 @@
+# messages.properties -- English language messages
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is part of GNU Classpath.
+#
+# GNU Classpath is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Classpath is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Classpath; see the file COPYING. If not, write to the
+# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+#
+# Linking this library statically or dynamically with other modules is
+# making a combined work based on this library. Thus, the terms and
+# conditions of the GNU General Public License cover the whole
+# combination.
+#
+# As a special exception, the copyright holders of this library give you
+# permission to link this library with independent modules to produce an
+# executable, regardless of the license terms of these independent
+# modules, and to copy and distribute the resulting executable under
+# terms of your choice, provided that you also meet, for each linked
+# independent module, the terms and conditions of the license of that
+# module. An independent module is a module which is not derived from
+# or based on this library. If you modify this library, you may extend
+# this exception to your version of the library, but you are not
+# obligated to do so. If you do not wish to do so, delete this
+# exception statement from your version.
+
+Main.Usage=Usage: rmiregistry [OPTIONS] [PORT]
+Main.ControlGroup=Registry process control
+Main.Restart=restart RMI naming service, clearing persistent naming database, if any
+Main.Stop=stop RMI naming service
+Main.PersistenceGroup=Persistence
+Main.Persistent=make RMI naming service persistent
+Main.Directory=directory in which to store persistent data
+Main.DirectoryArgument=DIRECTORY
+Main.DebugGroup=Debugging
+Main.Verbose=log binding events to standard out
+Main.InternalError=rmiregistry: internal error:
diff --git a/libjava/classpath/resource/gnu/classpath/tools/tnameserv/messages.properties b/libjava/classpath/resource/gnu/classpath/tools/tnameserv/messages.properties
new file mode 100644
index 00000000000..3861e24ba08
--- /dev/null
+++ b/libjava/classpath/resource/gnu/classpath/tools/tnameserv/messages.properties
@@ -0,0 +1,43 @@
+# messages.properties -- English language messages
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is part of GNU Classpath.
+#
+# GNU Classpath is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Classpath is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Classpath; see the file COPYING. If not, write to the
+# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+#
+# Linking this library statically or dynamically with other modules is
+# making a combined work based on this library. Thus, the terms and
+# conditions of the GNU General Public License cover the whole
+# combination.
+#
+# As a special exception, the copyright holders of this library give you
+# permission to link this library with independent modules to produce an
+# executable, regardless of the license terms of these independent
+# modules, and to copy and distribute the resulting executable under
+# terms of your choice, provided that you also meet, for each linked
+# independent module, the terms and conditions of the license of that
+# module. An independent module is a module which is not derived from
+# or based on this library. If you modify this library, you may extend
+# this exception to your version of the library, but you are not
+# obligated to do so. If you do not wish to do so, delete this
+# exception statement from your version.
+
+Main.Usage=Usage: tnameserv [OPTIONS]
+Main.ORBInitialPort=port on which naming service is to be started
+Main.Port=PORT
+Main.IOR=file in which to store naming service's IOR reference
+Main.IORFile=FILE
+Main.InternalError=tnameserv: internal error:
diff --git a/libjava/classpath/resource/gnu/java/util/regex/MessagesBundle_it.properties b/libjava/classpath/resource/gnu/java/util/regex/MessagesBundle_it.properties
index ae8e141321b..f43bb6f8378 100644
--- a/libjava/classpath/resource/gnu/java/util/regex/MessagesBundle_it.properties
+++ b/libjava/classpath/resource/gnu/java/util/regex/MessagesBundle_it.properties
@@ -1,5 +1,5 @@
# Localized error messages for gnu.regexp, in Italian.
-# $Id: MessagesBundle_it.properties,v 1.1 2006/07/19 19:47:07 rabbit78 Exp $
+# $Id: MessagesBundle_it.properties,v 1.2 2006/12/10 20:25:50 gnu_andrew Exp $
# Messaggi italiani per gnu.regexp.
#
# Attenzione: Questa traduzione fu scritto da un italo-americano.
diff --git a/libjava/classpath/scripts/.cvsignore b/libjava/classpath/scripts/.cvsignore
new file mode 100644
index 00000000000..190036bb1ae
--- /dev/null
+++ b/libjava/classpath/scripts/.cvsignore
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+classpath.spec
diff --git a/libjava/classpath/scripts/Makefile.in b/libjava/classpath/scripts/Makefile.in
index 2c4ff902149..d8ad93bb7f9 100644
--- a/libjava/classpath/scripts/Makefile.in
+++ b/libjava/classpath/scripts/Makefile.in
@@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -158,6 +160,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -279,7 +283,6 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
EXTRA_DIST = check_jni_methods.sh generate-locale-list.sh import-cacerts.sh
all: all-am
diff --git a/libjava/classpath/scripts/build_mathnamespace b/libjava/classpath/scripts/build_mathnamespace
new file mode 100644
index 00000000000..a2e53a3284d
--- /dev/null
+++ b/libjava/classpath/scripts/build_mathnamespace
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+echo "/* Warning ! This is a generated file. Use build_mathnamespace to regenerate it */"
+while read fun;do
+ echo "#define ${fun} ClasspathMath_${fun}"
+done
diff --git a/libjava/classpath/scripts/check_jni_methods.sh b/libjava/classpath/scripts/check_jni_methods.sh
index 4cc00cc17f3..b46e378214e 100755
--- a/libjava/classpath/scripts/check_jni_methods.sh
+++ b/libjava/classpath/scripts/check_jni_methods.sh
@@ -35,9 +35,6 @@ cat > $TMPFILE3 << EOF
-Java_gnu_java_awt_peer_gtk_GtkMenuComponentPeer_dispose
-Java_java_lang_VMSystem_arraycopy
-Java_java_lang_VMSystem_identityHashCode
--Java_gnu_java_util_prefs_gconf_GConfNativePeer_finalize_1class
--Java_gnu_java_util_prefs_gconf_GConfNativePeer_init_1id_1cache
--Java_gnu_java_util_prefs_gconf_GConfNativePeer_init_1class
EOF
# Compare again silently.
diff --git a/libjava/classpath/scripts/checkstyle-config.xml b/libjava/classpath/scripts/checkstyle-config.xml
new file mode 100644
index 00000000000..498e7faddd3
--- /dev/null
+++ b/libjava/classpath/scripts/checkstyle-config.xml
@@ -0,0 +1,132 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+ "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+<!--
+
+Changes to this file need to be discussed on classpath@gnu.org
+mailing list first and probably documented in the hacking guide.
+
+-->
+<module name="Checker">
+ <module name="PackageHtml"/>
+
+ <module name="TreeWalker">
+ <property name="tabWidth" value="8"/>
+
+ <!-- Javadoc related checks -->
+ <!--
+ <module name="JavadocType">
+ <property name="scope" value="protected"/>
+ </module>
+ <module name="JavadocMethod">
+ <property name="scope" value="protected"/>
+ <property name="allowUndeclaredRTE" value="true"/>
+ </module>
+ <module name="JavadocVariable">
+ <property name="scope" value="protected"/>
+ </module>
+ -->
+ <module name="JavadocStyle">
+ <property name="checkFirstSentence" value="false"/>
+ <property name="checkHtml" value="true"/>
+ </module>
+
+ <!-- File header checks -->
+ <module name="RegexpHeader">
+ <property name="headerFile" value="scripts/checkstyle-header.regex"/>
+ <property name="multiLines" value="2, 3, 38"/>
+ </module>
+
+ <!-- import checks -->
+ <module name="AvoidStarImport"/>
+ <module name="RedundantImport"/>
+ <module name="UnusedImports"/>
+ <module name="ImportOrder">
+ <property name="groups" value="gnu,java,javax,org"/>
+ <property name="ordered" value="true"/>
+ <property name="separated" value="true"/>
+ </module>
+
+ <!-- size checks -->
+ <!--
+ <module name="LineLength">
+ <property name="max" value="80"/>
+ </module>
+ -->
+
+ <!-- modifier checks -->
+ <module name="ModifierOrder"/>
+ <module name="RedundantModifier"/>
+
+ <!-- block checks -->
+ <!--
+ <module name="EmptyBlock">
+ <property name="option" value="text"/>
+ </module>
+ <module name="LeftCurly">
+ <property name="option" value="nl"/>
+ </module>
+ <module name="RightCurly">
+ <property name="option" value="alone"/>
+ </module>
+ <module name="AvoidNestedBlocks"/>
+ -->
+
+ <!-- coding problem checks -->
+ <!--
+ <module name="ArrayTrailingComma"/>
+ <module name="CovariantEquals"/>
+ <module name="DoubleCheckedLocking"/>
+ <module name="EmptyStatement"/>
+ <module name="EqualsHashCode"/>
+ <module name="HiddenField"/>
+ -->
+ <module name="IllegalInstantiation">
+ <property name="classes" value="java.lang.Boolean"/>
+ </module>
+ <!--
+ <module name="InnerAssignment"/>
+ <module name="MagicNumber"/>
+ <module name="RedundantThrows"/>
+ <module name="SimplifyBooleanExpression"/>
+ <module name="SimplifyBooleanReturn"/>
+ <module name="NestedIfDepth"/>
+ <module name="NestedTryDepth"/>
+ <module name="SuperClone"/>
+ <module name="SuperFinalize"/>
+ <module name="IllegalCatch"/>
+ -->
+ <module name="PackageDeclaration"/>
+ <!--
+ <module name="DeclarationOrder"/>
+ <module name="DefaultComesLast"/>
+ <module name="UnnecessaryParentheses"/>
+ -->
+
+ <!-- design problem checks -->
+ <!--
+ <module name="FinalClass"/>
+ <module name="HideUtilityClassConstructor"/>
+ -->
+
+ <!-- miscellaneous checks -->
+ <!--
+ <module name="TodoComment"/>
+ <module name="UpperEll"/>
+ <module name="ArrayTypeStyle"/>
+ <module name="Indentation">
+ <property name="basicOffset" value="2"/>
+ <property name="braceAdjustment" value="2"/>
+ <property name="caseIndent" value="0"/>
+ </module>
+ -->
+ </module>
+ <!--
+ <module name="StrictDuplicateCode"/>
+ -->
+
+ <module name="SuppressionFilter">
+ <property name="file" value="scripts/checkstyle-suppressions.xml"/>
+ </module>
+</module>
diff --git a/libjava/classpath/scripts/checkstyle-header.regex b/libjava/classpath/scripts/checkstyle-header.regex
new file mode 100644
index 00000000000..15eb29a5092
--- /dev/null
+++ b/libjava/classpath/scripts/checkstyle-header.regex
@@ -0,0 +1,38 @@
+^/\* .*$
+^ .*$
+^ (Copyright \(C\) .*|Free Software Foundation, Inc.)$
+^$
+^This file is part of GNU Classpath.$
+^$
+^GNU Classpath is free software; you can redistribute it and/or modify$
+^it under the terms of the GNU General Public License as published by$
+^the Free Software Foundation; either version 2, or \(at your option\)$
+^any later version.$
+^ *$
+^GNU Classpath is distributed in the hope that it will be useful, but$
+^WITHOUT ANY WARRANTY; without even the implied warranty of$
+^MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU$
+^General Public License for more details.$
+^$
+^You should have received a copy of the GNU General Public License$
+^along with GNU Classpath; see the file COPYING. If not, write to the$
+^Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA$
+^02110-1301 USA.$
+^$
+^Linking this library statically or dynamically with other modules is$
+^making a combined work based on this library. Thus, the terms and$
+^conditions of the GNU General Public License cover the whole$
+^combination.$
+^$
+^As a special exception, the copyright holders of this library give you$
+^permission to link this library with independent modules to produce an$
+^executable, regardless of the license terms of these independent$
+^modules, and to copy and distribute the resulting executable under$
+^terms of your choice, provided that you also meet, for each linked$
+^independent module, the terms and conditions of the license of that$
+^module. An independent module is a module which is not derived from$
+^or based on this library. If you modify this library, you may extend$
+^this exception to your version of the library, but you are not$
+^obligated to do so. If you do not wish to do so, delete this$
+^exception statement from your version. \*/$
+^ *$
diff --git a/libjava/classpath/scripts/checkstyle-suppressions.xml b/libjava/classpath/scripts/checkstyle-suppressions.xml
new file mode 100644
index 00000000000..68c620ce958
--- /dev/null
+++ b/libjava/classpath/scripts/checkstyle-suppressions.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!DOCTYPE suppressions PUBLIC
+ "-//Puppy Crawl//DTD Suppressions 1.0//EN"
+ "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
+<!--
+
+Changes to this file need to be discussed on classpath@gnu.org
+mailing list first and probably documented in the hacking guide.
+
+-->
+<suppressions>
+ <suppress checks="AvoidStarImport"
+ files="gnu/java/awt/peer/gtk/GtkToolkit.java"
+ lines="48,59"/>
+ <suppress checks="IllegalInstantiation"
+ files="java/lang/Boolean.java"
+ lines="65,73"/>
+ <suppress checks="IllegalInstantiation"
+ files="java/util/logging/LogManager.java"
+ lines="674"/>
+ <suppress checks="RegexpHeader"
+ files="javax/rmi/CORBA/SystemException.java"
+ lines="1"/>
+ <suppress checks="RegexpHeader"
+ files="javax/rmi/CORBA/ObjectImpl.java"
+ lines="1"/>
+ <suppress checks="RegexpHeader"
+ files="javax/rmi/ORB.java"
+ lines="1"/>
+ <suppress checks="RegexpHeader"
+ files="javax/rmi/BAD_OPERATION.java"
+ lines="1"/>
+</suppressions>
+
diff --git a/libjava/classpath/scripts/checkstyle.css b/libjava/classpath/scripts/checkstyle.css
new file mode 100644
index 00000000000..9d1fd8b7460
--- /dev/null
+++ b/libjava/classpath/scripts/checkstyle.css
@@ -0,0 +1,42 @@
+body {
+ color: black;
+ font-family: sans-serif;
+}
+h1 {
+ color: #990000;
+ border-width: 1px;
+ border-style: solid;
+ border-color: black;
+ padding: 0.2em;
+ background-color: #cccccc;
+ width: 100%;
+}
+h2 {
+ color: #990000;
+ border-width: 1px;
+ border-style: solid;
+ border-color: black;
+ padding: 0.2em;
+ background-color: #cccccc;
+ width: 100%;
+}
+h3 {
+ color: #990000;
+ border-width: 1px;
+ border-style: solid;
+ border-color: black;
+ padding: 0.2em;
+ background-color: #cccccc;
+ width: 100%;
+}
+table {
+ width: 100%;
+}
+th {
+ color: white;
+ background-color: #999999;
+ text-align: left;
+}
+td {
+ background-color: #cccccc;
+}
diff --git a/libjava/classpath/scripts/checkstyle2html.xsl b/libjava/classpath/scripts/checkstyle2html.xsl
new file mode 100644
index 00000000000..89639876ad6
--- /dev/null
+++ b/libjava/classpath/scripts/checkstyle2html.xsl
@@ -0,0 +1,102 @@
+<?xml version='1.0'?>
+<!-- XSL stylesheet to convert checkstyle XML to HTML -->
+<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
+
+ <!-- This tells the XSLT processor to emit HTML -->
+ <xsl:output method='html'
+ doctype-public='-//W3C//DTD HTML 4.01//EN'
+ doctype-system='http://www.w3.org/TR/html4/strict.dtd'
+ omit-xml-declaration='yes'/>
+
+ <!-- Match the checkstyle root element -->
+ <xsl:template match='checkstyle'>
+ <html>
+ <head>
+ <title>Checkstyle results</title>
+ <link rel='stylesheet' type='text/css' href='checkstyle.css' />
+ </head>
+ <body>
+ <h1>Checkstyle results</h1>
+ <div>The following document contains the results of
+ <a href='http://checkstyle.sourceforge.net/'>Checkstyle</a>.</div>
+
+ <h2>Summary</h2>
+ <table summary='Summary'>
+ <tr>
+ <th>Files</th><th>Infos</th><th>Warnings</th><th>Errors</th>
+ </tr>
+ <tr>
+ <td><xsl:value-of select='count(file)' /></td>
+ <td><xsl:value-of select='count(file/error[@severity="info"])' /></td>
+ <td><xsl:value-of select='count(file/error[@severity="warning"])' /></td>
+ <td><xsl:value-of select='count(file/error[@severity="error"])' /></td>
+ </tr>
+ </table>
+
+ <h2>Files</h2>
+ <table summary='Files'>
+ <tr>
+ <th>File</th><th>I</th><th>W</th><th>E</th>
+ </tr>
+ <!-- Process file elements in file mode -->
+ <xsl:apply-templates select='file' mode='file'>
+ <xsl:sort select="@name"/>
+ </xsl:apply-templates>
+ </table>
+
+ <!-- Process file elements in detail mode -->
+ <xsl:apply-templates select='file' mode='detail'>
+ <xsl:sort select="@name"/>
+ </xsl:apply-templates>
+ </body>
+ </html>
+ </xsl:template>
+
+ <!-- Match a file element in file mode -->
+ <xsl:template match='file' mode='file'>
+ <xsl:if test='count(error) &gt; 0'>
+ <tr>
+ <td>
+ <xsl:element name='a'>
+ <xsl:attribute name='href'>
+ #<xsl:value-of select='translate(string(@name),"/","__")' />
+ </xsl:attribute>
+ <xsl:value-of select='@name' />
+ </xsl:element>
+ </td>
+ <td><xsl:value-of select='count(error[@severity="info"])' /></td>
+ <td><xsl:value-of select='count(error[@severity="warning"])' /></td>
+ <td><xsl:value-of select='count(error[@severity="error"])' /></td>
+ </tr>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Match a file element in detail mode-->
+ <xsl:template match='file' mode='detail'>
+ <xsl:if test='count(error) &gt; 0'>
+ <h3>
+ <xsl:element name='a'>
+ <xsl:attribute name='name'>
+ <xsl:value-of select='translate(string(@name),"/","__")' />
+ </xsl:attribute>
+ <xsl:value-of select='@name' />
+ </xsl:element>
+ </h3>
+ <table summary='Errors'>
+ <tr>
+ <th>Error</th><th width="100px">Line</th>
+ </tr>
+ <xsl:apply-templates select='error' />
+ </table>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Match an error element -->
+ <xsl:template match='error'>
+ <tr>
+ <td><xsl:value-of select='@message'/></td>
+ <td><xsl:value-of select='@line' /></td>
+ </tr>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/libjava/classpath/scripts/classpath-build b/libjava/classpath/scripts/classpath-build
new file mode 100755
index 00000000000..cd0e7d63e24
--- /dev/null
+++ b/libjava/classpath/scripts/classpath-build
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+# cvs may timeout ...
+set -e
+
+export CVS_RSH=ssh
+
+CLASSPATH_CVSSRCDIR=$HOME/src/cvs/classpath
+CLASSPATH_SRCDIR=$HOME/src/classpath
+CLASSPATH_BUILDDIR=$HOME/src/classpath/build
+
+DATE=`date +"%Y%m%d"`
+OUTPUTDIR=$HOME/public_html/classpath/daily
+LOGFILE=$OUTPUTDIR/classpath-$DATE.log
+
+echo -n > $LOGFILE
+
+if [ -d $CLASSPATH_CVSSRCDIR ] ; then
+ echo "update cvs source tree" >> $LOGFILE
+ cd $CLASSPATH_CVSSRCDIR
+ cvs -z 3 update >> $LOGFILE 2>&1
+fi
+
+if [ -d $CLASSPATH_SRCDIR ] ; then
+
+ # delete old sources
+ echo "delete old source tree" >> $LOGFILE
+
+ # workaround for automake safety behaviour with umask
+ chmod u+w -R $CLASSPATH_SRCDIR
+
+ rm -rf $CLASSPATH_SRCDIR
+
+fi
+
+echo "copy cvs tree to source tree" >> $LOGFILE
+cp -a $CLASSPATH_CVSSRCDIR $CLASSPATH_SRCDIR
+cd $CLASSPATH_SRCDIR
+
+# patch version in configure.ac
+if [ -f configure.ac ] ; then
+ mv configure.ac configure.ac.orig
+ sed "s/, \[.*cvs\]/, [$DATE]/" < configure.ac.orig > configure.ac
+fi
+
+# generate autofriends stuff
+./autogen.sh >> $LOGFILE 2>&1
+
+# create build directory
+mkdir build
+cd build
+
+# configure and build classpath
+export LD_LIBRARY_PATH=/usr/local/lib
+../configure --prefix=$HOME/local/classpath --with-jikes=/usr/bin/jikes --enable-glibj=both --enable-jni --enable-gtk-peer --enable-regen-headers >> $LOGFILE 2>&1
+make >> $LOGFILE 2>&1
+make install >> $LOGFILE 2>&1
+
+make dist >> $LOGFILE 2>&1
+#make distcheck >> $LOGFILE 2>&1
+cp classpath-$DATE.tar.gz $OUTPUTDIR
+
+cd $OUTPUTDIR
+ln -sf classpath-$DATE.tar.gz LATEST-SNAPSHOT
+ln -sf classpath-$DATE.log LATEST-BUILDLOG
+
+exit 0
+
diff --git a/libjava/classpath/scripts/classpath-daily b/libjava/classpath/scripts/classpath-daily
new file mode 100755
index 00000000000..c7405277346
--- /dev/null
+++ b/libjava/classpath/scripts/classpath-daily
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+DATE=`date +"%Y%m%d"`
+OUTPUTDIR=$HOME/public_html/classpath/daily
+LOGFILE=$OUTPUTDIR/classpath-$DATE.log
+FAILEDLOG=$OUTPUTDIR/classpath-failed-$DATE.log
+MAIL="konqueror@gmx.de"
+
+/home/mkoch/bin/classpath-build
+
+if test "$?" = "1" ; then
+ tail --lines=100 $LOGFILE > $FAILEDLOG
+
+ mail $MAIL -s "classpath daily snapshot $DATE FAILED" < $FAILEDLOG
+else
+ mail $MAIL -s "classpath daily snapshot $DATE SUCCESSFUL" < /dev/null > /dev/null
+fi
diff --git a/libjava/classpath/scripts/classpath.spec.in b/libjava/classpath/scripts/classpath.spec.in
index 80522748d6e..4120d25507c 100644
--- a/libjava/classpath/scripts/classpath.spec.in
+++ b/libjava/classpath/scripts/classpath.spec.in
@@ -1,4 +1,4 @@
-# $Id: classpath.spec.in,v 1.2 2005/07/04 14:31:01 ziga Exp $
+# $Id: classpath.spec.in,v 1.3 2006/12/10 20:25:50 gnu_andrew Exp $
%define version_num @PACKAGE_VERSION@
%define release_num 1
diff --git a/libjava/classpath/scripts/eclipse-gnu.xml b/libjava/classpath/scripts/eclipse-gnu.xml
new file mode 100644
index 00000000000..60a1082ca1e
--- /dev/null
+++ b/libjava/classpath/scripts/eclipse-gnu.xml
@@ -0,0 +1,246 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<profiles version="8">
+<profile name="GNU" version="8">
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="18"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="18"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="18"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="18"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="18"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="82"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="18"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="18"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="18"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="17"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="17"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line_shifted"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line_shifted"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
+</profile>
+</profiles>
diff --git a/libjava/classpath/scripts/jalopy-gnu.xml b/libjava/classpath/scripts/jalopy-gnu.xml
new file mode 100644
index 00000000000..ad5c5abdffe
--- /dev/null
+++ b/libjava/classpath/scripts/jalopy-gnu.xml
@@ -0,0 +1,378 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jalopy>
+ <general>
+ <compliance>
+ <version>14</version>
+ </compliance>
+ <style>
+ <description>GNU Java Coding Convention</description>
+ <name>GNU</name>
+ </style>
+ </general>
+ <inspector>
+ <enable>false</enable>
+ <naming>
+ <classes>
+ <abstract>[A-Z][a-zA-Z0-9]+</abstract>
+ <general>[A-Z][a-zA-Z0-9]+</general>
+ </classes>
+ <fields>
+ <default>[a-z][\w]+</default>
+ <defaultStatic>[a-z][\w]+</defaultStatic>
+ <defaultStaticFinal>[a-zA-Z][\w]+</defaultStaticFinal>
+ <private>[a-z][\w]+</private>
+ <privateStatic>[a-z][\w]+</privateStatic>
+ <privateStaticFinal>[a-zA-Z][\w]+</privateStaticFinal>
+ <protected>[a-z][\w]+</protected>
+ <protectedStatic>[a-z][\w]+</protectedStatic>
+ <protectedStaticFinal>[a-zA-Z][\w]+</protectedStaticFinal>
+ <public>[a-z][\w]+</public>
+ <publicStatic>[a-z][\w]+</publicStatic>
+ <publicStaticFinal>[a-zA-Z][\w]+</publicStaticFinal>
+ </fields>
+ <interfaces>[A-Z][a-zA-Z0-9]+</interfaces>
+ <labels>\w+</labels>
+ <methods>
+ <default>[a-z][\w]+</default>
+ <defaultStatic>[a-z][\w]+</defaultStatic>
+ <defaultStaticFinal>[a-z][\w]+</defaultStaticFinal>
+ <private>[a-z][\w]+</private>
+ <privateStatic>[a-z][\w]+</privateStatic>
+ <privateStaticFinal>[a-z][\w]+</privateStaticFinal>
+ <protected>[a-z][\w]+</protected>
+ <protectedStatic>[a-z][\w]+</protectedStatic>
+ <protectedStaticFinal>[a-z][\w]+</protectedStaticFinal>
+ <public>[a-z][\w]+</public>
+ <publicStatic>[a-z][\w]+</publicStatic>
+ <publicStaticFinal>[a-z][\w]+</publicStaticFinal>
+ </methods>
+ <packages>[a-z]+(?:\.[a-z]+)*</packages>
+ <parameters>
+ <default>[a-z][\w]+</default>
+ <final>[a-z][\w]+</final>
+ </parameters>
+ <variables>[a-z][\w]*</variables>
+ </naming>
+ <tips>
+ <adhereToNamingConvention>false</adhereToNamingConvention>
+ <alwaysOverrideEquals>false</alwaysOverrideEquals>
+ <alwaysOverrideHashCode>false</alwaysOverrideHashCode>
+ <avoidThreadGroups>false</avoidThreadGroups>
+ <declareCollectionComment>false</declareCollectionComment>
+ <dontIgnoreExceptions>false</dontIgnoreExceptions>
+ <dontSubstituteObjectEquals>false</dontSubstituteObjectEquals>
+ <neverDeclareException>false</neverDeclareException>
+ <neverDeclareThrowable>false</neverDeclareThrowable>
+ <neverInvokeWaitOutsideLoop>false</neverInvokeWaitOutsideLoop>
+ <neverReturnZeroArrays>false</neverReturnZeroArrays>
+ <neverUseEmptyFinally>false</neverUseEmptyFinally>
+ <obeyContractEquals>false</obeyContractEquals>
+ <overrideToString>false</overrideToString>
+ <referToObjectsByInterface>false</referToObjectsByInterface>
+ <replaceStructureWithClass>false</replaceStructureWithClass>
+ <stringLiterallI18n>false</stringLiterallI18n>
+ <useInterfaceOnlyForTypes>false</useInterfaceOnlyForTypes>
+ <wrongCollectionComment>false</wrongCollectionComment>
+ </tips>
+ </inspector>
+ <internal>
+ <version>6</version>
+ </internal>
+ <messages>
+ <priority>
+ <general>30000</general>
+ <parser>30000</parser>
+ <parserJavadoc>30000</parserJavadoc>
+ <printer>30000</printer>
+ <printerJavadoc>30000</printerJavadoc>
+ <transform>30000</transform>
+ </priority>
+ <showErrorStackTrace>true</showErrorStackTrace>
+ </messages>
+ <misc>
+ <threadCount>1</threadCount>
+ </misc>
+ <printer>
+ <alignment>
+ <methodCallChain>true</methodCallChain>
+ <parameterMethodDeclaration>false</parameterMethodDeclaration>
+ <ternaryOperator>true</ternaryOperator>
+ <variableAssignment>false</variableAssignment>
+ <variableIdentifier>false</variableIdentifier>
+ </alignment>
+ <backup>
+ <directory>bak</directory>
+ <level>0</level>
+ </backup>
+ <blanklines>
+ <after>
+ <block>0</block>
+ <braceLeft>0</braceLeft>
+ <class>1</class>
+ <declaration>0</declaration>
+ <footer>1</footer>
+ <header>1</header>
+ <interface>1</interface>
+ <lastImport>1</lastImport>
+ <method>1</method>
+ <package>1</package>
+ </after>
+ <before>
+ <block>0</block>
+ <braceRight>0</braceRight>
+ <caseBlock>0</caseBlock>
+ <comment>
+ <javadoc>1</javadoc>
+ <multiline>0</multiline>
+ <singleline>0</singleline>
+ </comment>
+ <controlStatement>0</controlStatement>
+ <declaration>0</declaration>
+ <footer>0</footer>
+ <header>0</header>
+ <package>2</package>
+ </before>
+ <keepUpTo>1</keepUpTo>
+ </blanklines>
+ <braces>
+ <empty>
+ <cuddle>false</cuddle>
+ <insertStatement>false</insertStatement>
+ </empty>
+ <insert>
+ <dowhile>false</dowhile>
+ <for>false</for>
+ <ifelse>false</ifelse>
+ <while>false</while>
+ </insert>
+ <remove>
+ <block>true</block>
+ <dowhile>true</dowhile>
+ <for>true</for>
+ <ifelse>true</ifelse>
+ <while>true</while>
+ </remove>
+ <treatDifferent>
+ <methodClass>true</methodClass>
+ <methodClassIfWrapped>false</methodClassIfWrapped>
+ </treatDifferent>
+ </braces>
+ <chunks>
+ <blanklines>true</blanklines>
+ <comments>true</comments>
+ </chunks>
+ <comments>
+ <format>
+ <multiline>false</multiline>
+ </format>
+ <javadoc>
+ <check>
+ <innerclass>false</innerclass>
+ <tags>false</tags>
+ <throwsTags>false</throwsTags>
+ </check>
+ <fieldsShort>false</fieldsShort>
+ <generate>
+ <class>0</class>
+ <constructor>0</constructor>
+ <field>0</field>
+ <method>0</method>
+ </generate>
+ <parseComments>false</parseComments>
+ <tags>
+ <in-line />
+ <standard />
+ </tags>
+ <templates>
+ <method>
+ <bottom> */</bottom>
+ <exception> * @throws $exceptionType$ DOCUMENT ME!</exception>
+ <param> * @param $paramType$ DOCUMENT ME!</param>
+ <return> * @return DOCUMENT ME!</return>
+ <top>/**| * DOCUMENT ME!</top>
+ </method>
+ </templates>
+ </javadoc>
+ <remove>
+ <javadoc>false</javadoc>
+ <multiline>false</multiline>
+ <singleline>false</singleline>
+ </remove>
+ <separator>
+ <fillCharacter>-</fillCharacter>
+ <insert>false</insert>
+ <insertRecursive>false</insertRecursive>
+ <text>
+ <class>Inner Classes</class>
+ <constructor>Constructors</constructor>
+ <field>Instance fields</field>
+ <initializer>Instance initializers</initializer>
+ <interface>Inner Interfaces</interface>
+ <method>Methods</method>
+ <static>Static fields/initializers</static>
+ </text>
+ </separator>
+ </comments>
+ <environment />
+ <footer>
+ <keys />
+ <smartMode>0</smartMode>
+ <use>false</use>
+ </footer>
+ <header>
+ <keys />
+ <smartMode>0</smartMode>
+ <use>false</use>
+ </header>
+ <history>
+ <policy>disabled</policy>
+ </history>
+ <imports>
+ <grouping>
+ <defaultDepth>1</defaultDepth>
+ <packages>*:0|gnu:1|java:1|javax:1|org:1</packages>
+ </grouping>
+ <policy>disabled</policy>
+ <sort>true</sort>
+ </imports>
+ <indentation>
+ <caseFromSwitch>true</caseFromSwitch>
+ <continuation>
+ <block>true</block>
+ <operator>true</operator>
+ </continuation>
+ <firstColumnComments>false</firstColumnComments>
+ <label>true</label>
+ <policy>
+ <deep>true</deep>
+ </policy>
+ <sizes>
+ <braceCuddled>1</braceCuddled>
+ <braceLeft>2</braceLeft>
+ <braceRight>2</braceRight>
+ <braceRightAfter>0</braceRightAfter>
+ <continuation>0</continuation>
+ <deep>55</deep>
+ <extends>-1</extends>
+ <general>2</general>
+ <implements>-1</implements>
+ <leading>0</leading>
+ <tabs>8</tabs>
+ <throws>2</throws>
+ <trailingComment>1</trailingComment>
+ </sizes>
+ <tabs>
+ <enable>true</enable>
+ <onlyLeading>true</onlyLeading>
+ </tabs>
+ </indentation>
+ <misc>
+ <arrayBracketsAfterIdent>false</arrayBracketsAfterIdent>
+ <forceFormatting>false</forceFormatting>
+ <insertExpressionParentheses>false</insertExpressionParentheses>
+ <insertLoggingConditional>false</insertLoggingConditional>
+ <insertTrailingNewline>true</insertTrailingNewline>
+ <insertUID>false</insertUID>
+ </misc>
+ <sorting>
+ <declaration>
+ <class>false</class>
+ <constructor>false</constructor>
+ <enable>false</enable>
+ <interface>false</interface>
+ <method>false</method>
+ <order>static|field|initializer|constructor|method|interface|class</order>
+ <variable>false</variable>
+ </declaration>
+ <modifier>
+ <enable>true</enable>
+ <order>public|protected|private|abstract|static|final|synchronized|transient|volatile|native|strictfp</order>
+ </modifier>
+ </sorting>
+ <whitespace>
+ <after>
+ <comma>true</comma>
+ <semicolon>true</semicolon>
+ <typeCast>true</typeCast>
+ </after>
+ <before>
+ <braces>true</braces>
+ <brackets>false</brackets>
+ <bracketsTypes>false</bracketsTypes>
+ <caseColon>false</caseColon>
+ <operator>
+ <not>true</not>
+ </operator>
+ <parentheses>
+ <methodCall>false</methodCall>
+ <methodDeclaration>false</methodDeclaration>
+ <statement>true</statement>
+ </parentheses>
+ </before>
+ <padding>
+ <braces>true</braces>
+ <brackets>false</brackets>
+ <operator>
+ <assignment>true</assignment>
+ <bitwise>true</bitwise>
+ <logical>true</logical>
+ <mathematical>true</mathematical>
+ <relational>true</relational>
+ <shift>true</shift>
+ </operator>
+ <parenthesis>false</parenthesis>
+ <typeCast>false</typeCast>
+ </padding>
+ </whitespace>
+ <wrapping>
+ <always>
+ <after>
+ <arrayElement>0</arrayElement>
+ <braceRight>true</braceRight>
+ <extendsTypes>false</extendsTypes>
+ <implementsTypes>false</implementsTypes>
+ <label>true</label>
+ <methodCallChained>false</methodCallChained>
+ <ternaryOperator>
+ <first>false</first>
+ <second>false</second>
+ </ternaryOperator>
+ <throwsTypes>false</throwsTypes>
+ </after>
+ <before>
+ <braceLeft>true</braceLeft>
+ <extends>false</extends>
+ <implements>false</implements>
+ <throws>false</throws>
+ </before>
+ <parameter>
+ <methodCall>false</methodCall>
+ <methodCallNested>false</methodCallNested>
+ <methodDeclaration>false</methodDeclaration>
+ </parameter>
+ </always>
+ <general>
+ <beforeOperator>true</beforeOperator>
+ <enable>true</enable>
+ <lineLength>79</lineLength>
+ </general>
+ <ondemand>
+ <after>
+ <assignment>false</assignment>
+ <leftParenthesis>false</leftParenthesis>
+ <parameter>false</parameter>
+ <types>
+ <extends>false</extends>
+ <implements>false</implements>
+ <throws>false</throws>
+ </types>
+ </after>
+ <before>
+ <rightParenthesis>false</rightParenthesis>
+ </before>
+ <groupingParentheses>false</groupingParentheses>
+ </ondemand>
+ </wrapping>
+ </printer>
+</jalopy>
+
diff --git a/libjava/classpath/scripts/japi b/libjava/classpath/scripts/japi
new file mode 100755
index 00000000000..52bcbc472a5
--- /dev/null
+++ b/libjava/classpath/scripts/japi
@@ -0,0 +1,135 @@
+#!/bin/sh
+
+CLASSPATH_CVS=~/japi/classpath
+JAPIZE_DIR=~/japitools-0.9
+FTPROOT=~alpha/pub/gnu/classpath/nightly/tests
+LOG=/tmp/japi.log
+export PATH=${PATH}:/usr/java/j2sdk1.4.1/bin
+
+rm -f /tmp/japi.log > /dev/null 2>&1
+
+classpath_checkout ()
+{
+ if [ ! -d "${CLASSPATH_CVS}" ]; then
+ mkdir --parents ${CLASSPATH_CVS}
+ local dir=`dirname "${CLASSPATH_CVS}"`
+ cd "${dir}"
+ cvs -z3 -d :pserver:anoncvs@subversions.gnu.org:/cvsroot/classpath co classpath >> ${LOG} 2>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Error checking out classpath"
+ exit 1
+ fi
+ fi
+}
+
+classpath_update ()
+{
+ cd "${CLASSPATH_CVS}" && cvs update -d -P . >> ${LOG} 2>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Error checking out classpath"
+ exit 1
+ fi
+}
+
+classpath_clean ()
+{
+ if [ -d "${CLASSPATH_CVS}/build" ]; then
+ rm -rf "${CLASSPATH_CVS}/build"
+ fi
+# if [ -d "${CLASSPATH_PREFIX}" ]; then
+# rm -rf "${CLASSPATH_PREFIX}"
+# fi
+ mkdir --parents "${CLASSPATH_CVS}/build"
+# mkdir --parents "${CLASSPATH_PREFIX}"
+}
+
+classpath_configure ()
+{
+ cd "${CLASSPATH_CVS}"
+ aclocal >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error running aclocal"
+ exit 1
+ fi
+ autoheader >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error running autoheader"
+ exit 1
+ fi
+ automake >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error running automake"
+ exit 1
+ fi
+ autoconf >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error running autoconf"
+ exit 1
+ fi
+ cd "${CLASSPATH_CVS}/build" && ../configure --with-gcj >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error configuring"
+ exit 1
+ fi
+}
+
+classpath_build ()
+{
+ cd "${CLASSPATH_CVS}/build" && make >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error during make"
+ exit 1
+ fi
+}
+
+
+japize_classpath ()
+{
+ cd "${JAPIZE_DIR}/bin" && ./japize as classpath packages "${CLASSPATH_CVS}/build/lib/glibj.zip" +java +javax +org -java.awt.dnd.peer -java.awt.peer -org.apache -org.w3c.dom.css -org.w3c.dom.events -org.w3c.dom.html -org.w3c.dom.stylesheets -org.w3c.dom.traversal -org.w3c.dom.views -java.text.resources >> /tmp/japi.log 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error running japize"
+ exit 1
+ fi
+ cp -f "${JAPIZE_DIR}/bin/classpath.japi.gz" /tmp
+}
+
+japicompat_classpath ()
+{
+ today=`date`
+ echo "${today}" > /tmp/classpath-jdk11-compare.txt
+ cd "${JAPIZE_DIR}/bin" && ./japicompat -q jdk11.japi.gz classpath.japi.gz >> /tmp/classpath-jdk11-compare.txt
+ if [ $? -ne 0 ]; then
+ echo "Error running japicompat"
+ exit 1
+ fi
+ echo "${today}" > /tmp/classpath-jdk13-compare.txt
+ cd "${JAPIZE_DIR}/bin" && ./japicompat -q jdk13.japi.gz classpath.japi.gz >> /tmp/classpath-jdk13-compare.txt
+ if [ $? -ne 0 ]; then
+ echo "Error running japicompat"
+ exit 1
+ fi
+}
+
+#--------------------------------------------------------------------
+# Update Classpath CVS
+#--------------------------------------------------------------------
+classpath_checkout
+classpath_update
+
+#--------------------------------------------------------------------
+# Build Classpath with GCJ 3.2
+#--------------------------------------------------------------------
+classpath_clean
+classpath_configure
+classpath_build
+
+#--------------------------------------------------------------------
+# Run japize on glibj.zip
+#--------------------------------------------------------------------
+japize_classpath
+
+#--------------------------------------------------------------------
+# Run japicompat against jdk13
+#--------------------------------------------------------------------
+japicompat_classpath
+
diff --git a/libjava/classpath/scripts/kissme-mauve b/libjava/classpath/scripts/kissme-mauve
new file mode 100755
index 00000000000..8a6ee22db66
--- /dev/null
+++ b/libjava/classpath/scripts/kissme-mauve
@@ -0,0 +1,346 @@
+#!/bin/sh
+
+CLASSPATH_CVS=~/mauve/classpath
+CLASSPATH_PREFIX=~/mauve/root/classpath
+MAUVE_CVS=~/mauve/mauve
+KISSME_CVS=~/mauve/kissme
+KISSME_PREFIX=~/mauve/root/kissme
+KISSME_BIN=~/mauve/kissme/useful_scripts/kissme
+LOG=/tmp/mauve.log
+RESULTS=/tmp/kissme-mauve.txt
+REPORT=/tmp/kissme-mauve-report.txt
+TIMEOUT=30
+
+rm -f ${LOG} > /dev/null 2>&1
+rm -f ${RESULTS} > /dev/null 2>&1
+today=`date`
+echo "${today}" > ${LOG}
+touch ${RESULTS}
+
+
+_aclocal ()
+{
+ aclocal "$@" >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error running aclocal"
+ exit 1
+ fi
+}
+
+_autoheader ()
+{
+ autoheader "$@" >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error running autoheader"
+ exit 1
+ fi
+}
+
+_automake ()
+{
+ automake "$@" >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error running automake"
+ exit 1
+ fi
+}
+
+_autoconf ()
+{
+ autoconf "$@" >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error running autoconf"
+ exit 1
+ fi
+}
+
+classpath_checkout ()
+{
+ if [ ! -d "${CLASSPATH_CVS}" ]; then
+ mkdir --parents ${CLASSPATH_CVS}
+ local dir=`dirname "${CLASSPATH_CVS}"`
+ cd "${dir}"
+ cvs -z3 -d :pserver:anoncvs@subversions.gnu.org:/cvsroot/classpath co classpath >> ${LOG} 2>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Error checking out classpath"
+ exit 1
+ fi
+ fi
+}
+
+classpath_update ()
+{
+ cd "${CLASSPATH_CVS}" && cvs update -d -P . >> ${LOG} 2>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Error checking out classpath"
+ exit 1
+ fi
+}
+
+classpath_clean ()
+{
+ if [ -d "${CLASSPATH_CVS}/build" ]; then
+ rm -rf "${CLASSPATH_CVS}/build"
+ fi
+ if [ -d "${CLASSPATH_PREFIX}" ]; then
+ rm -rf "${CLASSPATH_PREFIX}"
+ fi
+ mkdir --parents "${CLASSPATH_CVS}/build"
+ mkdir --parents "${CLASSPATH_PREFIX}"
+}
+
+classpath_configure ()
+{
+ cd "${CLASSPATH_CVS}"
+
+ _aclocal
+ _autoheader
+ _automake
+ _autoconf
+
+ cd "${CLASSPATH_CVS}/build" && ../configure --prefix=${CLASSPATH_PREFIX} --with-gcj --enable-jni >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error configuring"
+ exit 1
+ fi
+}
+
+classpath_build ()
+{
+ cd "${CLASSPATH_CVS}/build" && make >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error during make"
+ exit 1
+ fi
+}
+
+classpath_install ()
+{
+ cd "${CLASSPATH_CVS}/build" && make install >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error during make"
+ exit 1
+ fi
+}
+
+kissme_checkout ()
+{
+ if [ ! -d "${KISSME_CVS}" ]; then
+ mkdir --parents ${KISSME_CVS}
+ local dir=`dirname "${KISSME_CVS}"`
+ cd "${KISSME_CVS}"
+ cvs -z3 -d :pserver:anonymous@cvs.kissme.sourceforge.net:/cvsroot/kissme co . >> ${LOG} 2>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Error checking out kissme"
+ exit 1
+ fi
+ fi
+}
+
+kissme_update ()
+{
+ cd "${KISSME_CVS}" && cvs update -d -P . >> ${LOG} 2>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Error checking out kissme"
+ exit 1
+ fi
+}
+
+kissme_clean ()
+{
+ if [ -d "${KISSME_CVS}/build" ]; then
+ rm -rf "${KISSME_CVS}/build"
+ fi
+ if [ -d "${KISSME_PREFIX}" ]; then
+ rm -rf "${KISSME_PREFIX}"
+ fi
+ mkdir --parents "${KISSME_CVS}/build"
+ mkdir --parents "${KISSME_PREFIX}"
+}
+
+kissme_configure ()
+{
+ cd "${KISSME_CVS}"
+
+ _aclocal
+ _autoheader
+ _automake -a
+ _autoconf
+
+ cd "${KISSME_CVS}" && ./configure --prefix=${KISSME_PREFIX} \
+ --enable-use-zips --with-gnu-classpath=${CLASSPATH_CVS} \
+ --with-gnu-classpath-build=${CLASSPATH_CVS}/build \
+ --with-classpath-install-dir=${CLASSPATH_PREFIX} >> ${LOG} 2>&1
+
+ if [ $? -ne 0 ]; then
+ echo "Error configuring"
+ exit 1
+ fi
+}
+
+kissme_build ()
+{
+ cd "${KISSME_CVS}" && make >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error during make"
+ exit 1
+ fi
+}
+
+kissme_install ()
+{
+ cd "${KISSME_CVS}" && make install >> ${LOG} 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error during make"
+ exit 1
+ fi
+}
+
+mauve_checkout ()
+{
+ if [ ! -d "${MAUVE_CVS}" ]; then
+ mkdir --parents ${MAUVE_CVS}
+ local dir=`dirname "${MAUVE_CVS}"`
+ cd "${dir}"
+ cvs -z3 -d :pserver:anoncvs@sources.redhat.com:/cvs/mauve co mauve >> ${LOG} 2>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Error checking out mauve"
+ exit 1
+ fi
+ fi
+}
+
+mauve_update ()
+{
+ cd "${MAUVE_CVS}" && cvs update -d -P . >> ${LOG} 2>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Error checking out mauve"
+ exit 1
+ fi
+}
+
+kissme_mauve ()
+{
+ export JAVAC="jikes -bootclasspath ${CLASSPATH_PREFIX}/share/classpath/glibj.zip"
+ export JAVA="${KISSME_BIN}"
+
+# if [ -f "${KISSME_CVS}/useful_scripts/mauve-kissme" ]; then
+# cp -f "${KISSME_CVS}/useful_scripts/mauve-kissme" "${MAUVE_CVS}"
+# fi
+
+ if [ -f "${CLASSPATH_CVS}/mauve-classpath" ]; then
+ cp -f "${CLASSPATH_CVS}/mauve-classpath" "${MAUVE_CVS}"
+ fi
+
+ cd "${MAUVE_CVS}"
+ if [ $? -ne 0 ]; then
+ echo "Error configuring mauve"
+ exit 1
+ fi
+
+ _aclocal
+ _automake
+ _autoconf
+
+ ./configure >> "${LOG}" 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error configuring mauve"
+ exit 1
+ fi
+
+ # create class choices from key file
+ if [ -f classes ]; then
+ rm -f classes 2>/dev/null
+ fi
+ if [ -f choices ]; then
+ rm -f choices 2>/dev/null
+ fi
+ /bin/sh choose "${MAUVE_CVS}" classpath
+ if [ $? -ne 0 ]; then
+ echo "Error during choose for mauve"
+ exit 1
+ fi
+
+ # compile classes
+ compile=`cat "${MAUVE_CVS}/classes" | tr '.' '/' | awk '{print $1".java"}' | xargs`
+ ${JAVAC} -classpath "${MAUVE_CVS}" -d "${MAUVE_CVS}" ${compile} >> "${LOG}" 2>&1
+ if [ $? -ne 0 ]; then
+ echo "Error during compile for mauve"
+ exit 1
+ fi
+
+ set -m
+ for i in `cat "${MAUVE_CVS}/classes"`; do
+ echo "$i" | ${JAVA} gnu.testlet.SimpleTestHarness -verbose >> "${RESULTS}" 2>&1 &
+
+ vm_pid=$!
+ sleep ${TIMEOUT} && kill -9 $vm_pid > /dev/null 2>&1 && echo "FAIL: $i execution aborted" >> "${RESULTS}" &
+ kill_pid=$!
+ fg %- 2>/dev/null
+ kill -9 $kill_pid >/dev/null 2>&1 # && echo Test did not time out
+ done
+}
+
+mauve_summary ()
+{
+ if [ ! -f "${RESULTS}" ]; then
+ echo "Error creating summary"
+ exit 1
+ fi
+
+ pass_cnt=`grep PASS "${RESULTS}" | wc -l`
+ fail_cnt=`grep FAIL "${RESULTS}" | wc -l`
+ total_cnt=`expr $pass_cnt + $fail_cnt`
+
+ today=`date`
+ echo "Mauve test results for Kissme" > "${REPORT}"
+ echo "Report generated on ${today}" >> "${REPORT}"
+ echo "" >> "${REPORT}"
+ echo "${fail_cnt} of ${total_cnt} tests failed." >> "${REPORT}"
+ echo "" >> "${REPORT}"
+ cat "${RESULTS}" >> "${REPORT}"
+}
+
+#--------------------------------------------------------------------
+# Update Classpath CVS
+#--------------------------------------------------------------------
+classpath_checkout
+classpath_update
+
+#--------------------------------------------------------------------
+# Build Classpath with GCJ 3.2
+#--------------------------------------------------------------------
+classpath_clean
+classpath_configure
+classpath_build
+classpath_install
+
+#--------------------------------------------------------------------
+# Update Kissme CVS
+#--------------------------------------------------------------------
+kissme_checkout
+kissme_update
+
+#--------------------------------------------------------------------
+# Build Kissme
+#--------------------------------------------------------------------
+kissme_clean
+kissme_configure
+kissme_build
+#kissme_install
+
+#--------------------------------------------------------------------
+# Update Mauve CVS
+#--------------------------------------------------------------------
+mauve_checkout
+mauve_update
+
+#--------------------------------------------------------------------
+# Execute Mauve
+#--------------------------------------------------------------------
+kissme_mauve
+
+#--------------------------------------------------------------------
+# Create report
+#--------------------------------------------------------------------
+mauve_summary
diff --git a/libjava/classpath/scripts/loc b/libjava/classpath/scripts/loc
new file mode 100755
index 00000000000..dc2f327035f
--- /dev/null
+++ b/libjava/classpath/scripts/loc
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# loc Find a class or package
+#
+# Usage: loc [-l] class-pattern [dirname]
+
+# -l Use system locate command instead of find. In that case, loc
+# will ignore any directory to be searched.
+
+# Example:
+#
+# $ loc -l org.objectweb.jonas.common.JProp
+# /var/lib/jonas/demoserver/ejbjars/autoload/mejb.jar
+# /var/lib/jonas/lib/common/ow_jonas_bootstrap.jar
+# /var/lib/jonas/eclipseserver/ejbjars/autoload/mejb.jar
+# /var/lib/jonas/ejbjars/autoload/mejb.jar
+# /var/cache/jonas/work/ejbjars/jonas/mejb_2005.09.15-17.01.52.jar
+# /usr/src/redhat/BUILD/jonas-4.3.3/jonas/classes/common/org/objectweb/jonas/common/JProp.class
+
+
+MODE=$1
+if test "$MODE" == "-l"; then
+ COMMAND='(locate \*.jar ; locate \*.war)'
+ shift
+else
+ COMMAND='(find "$FOO" -name \*.jar -follow ; find "$FOO" -name \*.war -follow)'
+fi
+
+FOO=$2
+if test "x$FOO" == "x"; then
+ FOO=/usr/share/java
+fi
+
+eval "$COMMAND" 2>/dev/null | while read i; do
+ if (fastjar tf $i 2>/dev/null | grep $1) > /dev/null 2>&1 ; then
+ echo $i
+ fi
+done
+
+if test "$MODE" != "-l"; then
+ find "$FOO" -name '*.class' 2>/dev/null | grep $1
+else
+ locate \*.class | grep $1
+fi
diff --git a/libjava/classpath/scripts/math_symbols b/libjava/classpath/scripts/math_symbols
new file mode 100644
index 00000000000..e676a5197dc
--- /dev/null
+++ b/libjava/classpath/scripts/math_symbols
@@ -0,0 +1,69 @@
+acos
+asin
+atan
+atan2
+cos
+sin
+tan
+cosh
+sinh
+tanh
+exp
+frexp
+ldexp
+expm1
+log
+log10
+log1p
+modf
+pow
+sqrt
+ceil
+fabs
+floor
+fmod
+erf
+erfc
+gamma
+hypot
+finite
+j0
+j1
+jn
+lgamma
+y0
+y1
+yn
+acosh
+asinh
+cbrt
+logb
+nextafter
+remainder
+logb
+scalb
+significand
+logbf
+scalbf
+significandf
+copysign
+ilogb
+rint
+rintf
+scalbn
+__ieee754_sqrt
+__ieee754_asin
+__ieee754_asin
+__ieee754_atan2
+__ieee754_exp
+__ieee754_fmod
+__ieee754_log
+__ieee754_pow
+__ieee754_rem_pio2
+__ieee754_remainder
+__ieee754_scalb
+__ieee754_acos
+__kernel_cos
+__kernel_sin
+__kernel_tan
+__kernel_rem_pio2
diff --git a/libjava/classpath/scripts/patches.pl b/libjava/classpath/scripts/patches.pl
new file mode 100755
index 00000000000..57f134d9201
--- /dev/null
+++ b/libjava/classpath/scripts/patches.pl
@@ -0,0 +1,164 @@
+#!/usr/bin/perl -w
+# Purpose is to move patches from upload directory to
+# public patches directory. Any file not matching the correct
+# pattern is deleted. Any patch file without a README and the
+# file was last modified more than 120 minutes ago is deleted.
+# Any README file without a patch file which was last modified
+# more than 120 minutes ago is deleted.
+#
+# notes to self: as long as this runs as root do not worry
+# about quota problems or disk space
+
+use strict;
+
+my ($upload_dir) = "/home/ftp/classpath/incoming";
+my ($public_dir) = "/home/ftp/classpath/pub/patches";
+my ($user) = "classpath";
+my ($group) = "classpath";
+my ($mode_dir) = "775";
+my ($mode_file) = "664";
+my (@patches) = ();
+
+use vars qw($upload_dir $public_dir @patches $user $group
+ $mode_dir $mode_file);
+
+# main
+{
+ @patches = &getPatches();
+ &movePatches(@patches);
+}
+
+#---------------------------------------------------------------
+# Purpose: To remove files not matching the correct pattern.
+# To remove README files without patches (last modified greater
+# than 2 hours). To remove patches without README files (last
+# modified greater than 2 hours).
+#---------------------------------------------------------------
+sub getPatches
+{
+ my (@patches) = ();
+ my (@entries) = ();
+ my (%maybe) = ();
+ my ($entry, $debug, $prefix, $junk, $file, $patch, $readme) = "";
+ my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime,
+ $mtime, $ctime, $blksize, $blocks) = "";
+
+ $debug = 1;
+
+ opendir(INCOMING, "$upload_dir") || die "could not open $upload_dir\n";
+ @entries = grep( !/^\.\S+/, readdir(INCOMING)); # no .*
+ closedir(INCOMING);
+ foreach $entry (sort @entries)
+ {
+ if (($entry eq ".") || ($entry eq "..")) { next; }
+ if (-d "$upload_dir/$entry")
+ {
+ print "Directory: $upload_dir/$entry/\n";
+ }
+ elsif (-e "$upload_dir/$entry")
+ {
+ if ($entry eq ".message") { next; }
+ if ($entry eq "README") { next; }
+ if ($entry !~ /^\w+-\d\d\d\d\d\d-\d+\.patch\.(gz|README)$/)
+ {
+ print "REGEX FAILED: $entry\n";
+ unlink("$upload_dir/$entry");
+ }
+ else
+ {
+ ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,
+ $ctime,$blksize,$blocks) = stat("$upload_dir/$entry");
+ if ($size > 512000)
+ {
+ print "LARGE PATCH: $entry\n";
+ unlink("$upload_dir/$entry");
+ }
+ else
+ {
+ ($prefix,$junk) = split(/(\.gz|\.README)/, $entry, 2);
+ $maybe{$prefix} += 1;
+ }
+ }
+ }
+ }
+
+ foreach $entry (keys(%maybe))
+ {
+ if ($maybe{$entry} == 2)
+ {
+ $patch = "$entry.gz";
+ $readme = "$entry.README";
+
+ ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,
+ $ctime,$blksize,$blocks) = stat($patch);
+ if (time-$mtime > 900)
+ {
+ ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,
+ $ctime,$blksize,$blocks) = stat($readme);
+ if (time-$mtime > 900)
+ {
+ $patches[$#patches+1] = $entry;
+ }
+ }
+ }
+ else
+ {
+ if (-e "$upload_dir/$entry.gz")
+ {
+ unlink("$upload_dir/$entry.gz");
+ print "STALE PATCH: $entry.gz\n";
+ }
+ elsif (-e "$upload_dir/$entry.README")
+ {
+ unlink("$upload_dir/$entry.README");
+ print "STALE README: $entry.README\n";
+ }
+ }
+ }
+ return (@patches);
+}
+
+#---------------------------------------------------------------
+# Purpose: To move the patches to the proper directory and set
+# the permissions correctly.
+#---------------------------------------------------------------
+sub movePatches
+{
+ my (@patches) = @_;
+ my ($patch) = "";
+ my ($fail) = 0;
+
+ if (!(-d "$public_dir"))
+ {
+ system("mkdir -p $public_dir");
+ system("chown $user.$group $public_dir");
+ system("chmod $mode_dir $public_dir");
+ }
+ foreach $patch (@patches)
+ {
+ if (-e "$public_dir/$patch.gz")
+ {
+ print "Patch exists: $public_dir/$patch.gz\n";
+ $fail = 1;
+ }
+ if (-e "$public_dir/$patch.README")
+ {
+ print "README exists: $public_dir/$patch.README\n";
+ $fail = 1;
+ }
+ if ($fail == 0)
+ {
+ system("mv $upload_dir/$patch.gz $public_dir/$patch.gz");
+ system("mv $upload_dir/$patch.README $public_dir/$patch.README");
+ system("chown $user.$group $public_dir/*");
+ system("chmod $mode_file $public_dir/*");
+ open(MAIL, "|mail -s \"Classpath: $patch uploaded\" core\@classpath.org") || die "could not open mail\n";
+ print MAIL "GNU Classpath FTP Maintenance\n";
+ print MAIL "\n";
+ print MAIL "Added Files:\n";
+ print MAIL "ftp://ftp.classpath.org/pub/patches/$patch.gz\n";
+ print MAIL "ftp://ftp.classpath.org/pub/patches/$patch.README\n\n";
+ close(MAIL);
+ }
+ }
+}
diff --git a/libjava/classpath/scripts/sanitize-jsr166 b/libjava/classpath/scripts/sanitize-jsr166
new file mode 100755
index 00000000000..d4ca8585b8b
--- /dev/null
+++ b/libjava/classpath/scripts/sanitize-jsr166
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+# Sanitize a jsr166 download.
+
+# Remove code copyright Sun.
+find . -name '*.java' -print | xargs grep -l 'Copyright.*Sun' | xargs rm
diff --git a/libjava/classpath/scripts/timezones.pl b/libjava/classpath/scripts/timezones.pl
new file mode 100755
index 00000000000..142ea4b7582
--- /dev/null
+++ b/libjava/classpath/scripts/timezones.pl
@@ -0,0 +1,366 @@
+#!/usr/bin/perl -w
+# Create the timezone tables for java/util/TimeZone from the
+# standard timezone sources by Arthur David Olson (as used by glibc)
+#
+# This needs the files from the package tzdata2000h which may be found
+# at ftp://ftp.cs.mu.oz.au/pub/.
+
+$TIMEZONEDIR = "tzdata";
+@TIMEZONEFILES = ("africa", "antarctica", "asia", "australasia",
+ "europe", "northamerica", "pacificnew", "southamerica",
+ "../tzabbrevs");
+
+# rules hash table:
+# key is a rule name
+# value is either "-" (no daylight savings) or a list of three elements:
+# $value[0] = end savings rule (list containing MONTH, DAY and TIME)
+# $value[1] = start savings rule (ditto)
+# $value[2] = daylight offset in milliseconds
+my %rules = ("-" => "-");
+
+# timezones list, list of pairs:
+# $timezones[$i][0] is a timezone name
+# $timezones[$i][1] = raw offset in milliseconds
+# $timezones[$i][2] = rule in the same format as the value of
+# the rules table, but TIME in milliseconds
+# $timezones[$i][3] = list of timezone names with this rule (aliases)
+my @timezones = ( [ "GMT", 0, "-", [ "GMT", "UTC" ] ]);
+
+
+# parse the offset of form +/-hh:mm:ss (:ss is optional) and return it
+# in milliseconds against UTC
+sub parseOffset($) {
+ my $offset = $_[0];
+ $offset =~ /^([+-]?)(\d+)(:(\d+)(:(\d+))?)?$/
+ or die "Can't parse offset $offset";
+ my $seconds = $2 * 3600;
+ $seconds += $4 * 60 if ($3);
+ $seconds += $6 if ($3 && $5);
+ if ($1 eq "-") {
+ $seconds = - $seconds;
+ }
+ return $seconds * 1000;
+}
+
+# parse the time of form +/-hh:mm:ss[swguz] (:ss is optional) and return it
+# in milliseconds since midnight in local wall time
+ my $timezonename;
+sub parseTime($$$) {
+ my ($rawoffset, $stdoffset, $time) = @_;
+ $time =~ /^([+-]?)(\d+):(\d+)(:(\d+))?([swguz]?)$/
+ or die "Can't parse time $time";
+ my ($hour, $min) = ($2, $3);
+ my $sec = ($4) ? $5 : 0;
+ my $millis = ((($hour * 60) + $min) * 60 + $sec) * 1000;
+ if ($1 eq "-") {
+ $millis = -$millis;
+ }
+ # Normally millis is in wall time, adjust for utc and standard time.
+ if ($6 =~ /[guz]/) {
+ $millis += $rawoffset + $stdoffset;
+ } elsif ($6 =~ /s/) {
+ $millis += $stdoffset;
+ }
+ return $millis;
+}
+
+my %monthnames =
+ ( "Jan" => "1",
+ "Feb" => "2",
+ "Mar" => "3",
+ "Apr" => "4",
+ "May" => "5",
+ "Jun" => "6",
+ "Jul" => "7",
+ "Aug" => "8",
+ "Sep" => "9",
+ "Oct" => "10",
+ "Nov" => "11",
+ "Dec" => "12" );
+sub parseMonth($) {
+ my $month = $monthnames{"$_[0]"} or die "Unknown month $_[0]";
+ return $month;
+}
+
+my %weekdaynames =
+ ( "Sun" => "7",
+ "Mon" => "1",
+ "Tue" => "2",
+ "Wed" => "3",
+ "Thu" => "4",
+ "Fri" => "5",
+ "Sat" => "6" );
+sub parseWeekday($) {
+ my $weekday = $weekdaynames{"$_[0]"} or die "Unknown weekday $_[0]";
+ return $weekday;
+}
+
+my @weekdayjavanames =
+ ( "Calendar.SUNDAY",
+ "Calendar.MONDAY",
+ "Calendar.TUESDAY",
+ "Calendar.WEDNESDAY",
+ "Calendar.THURSDAY",
+ "Calendar.FRIDAY",
+ "Calendar.SATURDAY" );
+my @daysInMonths = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
+sub parseDay($$$) {
+ my ($dayoffset, $month, $day) = @_;
+ if ($day =~ /^\d+$/) {
+ return "$day, 0";
+ } elsif ($day =~ /^last([A-Z][a-z][a-z])$/) {
+ my $weekday = ( parseWeekday($1) + $dayoffset + 7 ) % 7;
+ if ($dayoffset) {
+ my $day = $daysInMonths[$month - 1] + $dayoffset;
+ warn "Can only approximate $day with dayoffset in $file"
+ if ($month == 2);
+ return "$day, -$weekdayjavanames[$weekday]";
+ } else {
+ return "-1, $weekdayjavanames[$weekday]";
+ }
+ } elsif ($day =~ /^([A-Z][a-z][a-z])>=(\d+)$/) {
+ my $start = $2 + $dayoffset;
+ my $weekday = ( parseWeekday($1) + $dayoffset + 7 ) % 7;
+ if (($start % 7) == 1) {
+ $start = ($start + 6) / 7;
+ return "$start, $weekdayjavanames[$weekday]";
+ } else {
+ return "$start, -$weekdayjavanames[$weekday]";
+ }
+ } else {
+ die "Unknown day $day";
+ }
+}
+
+my @monthjavanames =
+ ( "Calendar.JANUARY",
+ "Calendar.FEBRUARY",
+ "Calendar.MARCH",
+ "Calendar.APRIL",
+ "Calendar.MAY",
+ "Calendar.JUNE",
+ "Calendar.JULY",
+ "Calendar.AUGUST",
+ "Calendar.SEPTEMBER",
+ "Calendar.OCTOBER",
+ "Calendar.NOVEMBER",
+ "Calendar.DECEMBER" );
+
+sub parseRule($$$) {
+ my ($rawoffset, $stdoffset, $rule) = @_;
+ my $monthnr = parseMonth($rule->[0]);
+ my $time = parseTime($rawoffset, $stdoffset, $rule->[2]);
+ my $dayoffset = 0;
+ while ($time < 0) {
+ $time += 24*3600*1000;
+ $dayoffset--;
+ }
+ while ($time > 24*3600*1000) {
+ $time -= 24*3600*1000;
+ $dayoffset++;
+ }
+ $day = parseDay($dayoffset, $monthnr, $rule->[1]);
+ return [ $monthjavanames[$monthnr-1], $day, $time ];
+}
+
+
+sub ruleEquals($$) {
+ my ($rule1, $rule2) = @_;
+ # check month names
+ return (($rule1->[0] eq $rule2->[0])
+ && ($rule1->[1] eq $rule2->[1])
+ && ($rule1->[2] == $rule2->[2]));
+}
+
+sub findAlias($$) {
+ my ($rawoffset, $rule) = @_;
+ foreach $tz (@timezones) {
+ my ($key, $tzoffset, $tzrule, $aliaslist) = @{$tz};
+ next if ($tzoffset != $rawoffset);
+ if ($rule eq "-") {
+ return $tz if ($tzrule eq "-");
+ } elsif ($tzrule ne "-") {
+ next if $rule->[2] != $tzrule->[2];
+ if (ruleEquals($rule->[0], $tzrule->[0])
+ && ruleEquals($rule->[1], $tzrule->[1])) {
+ return $tz;
+ }
+ }
+ }
+ return "";
+}
+
+sub makePretty($) {
+ my ($offset) = @_;
+ if (($offset % 3600) == 0) {
+ $offset /= 3600;
+ return "$offset * 3600";
+ } else {
+ return "$offset";
+ }
+}
+
+sub tzcompare($$) {
+ my ($a, $b) = @_;
+ if (($a =~ /\//) != ($b =~ /\//)) {
+ return ($a =~ /\//) ? 1 : -1;
+ } else {
+ return $a cmp $b;
+ }
+}
+
+foreach $file (@TIMEZONEFILES) {
+# print STDERR "$file\n";
+ open INPUT, "$TIMEZONEDIR/$file" or die "Can't open $TIMEZONEDIR/$file";
+ my $in_time_zone = 0;
+ while (<INPUT>) {
+ $_ = $1 if /^([^\#]*)\#/;
+ next if /^\s*$/;
+ my @entries = split;
+# $, = ","; print "'$_' -> [",@entries,"]\n";
+ if (!$in_time_zone) {
+ if ($entries[0] eq "Rule") {
+ # check if rule still applies
+ # column 3 is TO entry.
+ if ($entries[3] eq "max") {
+ my $rulename = $entries[1];
+ my $month = $entries[5];
+ my $day = $entries[6];
+ my $time = $entries[7];
+ if ($entries[8] eq "0") {
+ # This is the end time rule
+ $rules{"$rulename"}[0] = [ $month, $day, $time ];
+ } else {
+ # This is the start time rule
+ $rules{"$rulename"}[1] = [ $month, $day, $time ];
+ $rules{"$rulename"}[2] = parseOffset($entries[8]);
+ }
+ }
+ } elsif ($entries[0] eq "Zone") {
+ $in_time_zone = 1;
+ shift @entries;
+ $timezonename = shift @entries;
+ } elsif ($entries[0] eq "Remove") {
+ my $found = 0;
+ foreach $tz (@timezones) {
+ my @newaliases;
+ foreach $tzname (@{$tz->[3]}) {
+ if ($tzname eq $entries[1]) {
+ $found = 1;
+ } else {
+ push @newaliases, $tzname;
+ }
+ }
+ if ($found) {
+ if ($tz->[0] eq $entries[1]) {
+ $tz->[0] = $newaliases[0];
+ }
+ $tz->[3] = \@newaliases;
+ last;
+ }
+ }
+
+ die "Unknown link $_" if ! $found;
+ } elsif ($entries[0] eq "Link") {
+ my $alias = 0;
+ foreach $tz (@timezones) {
+ foreach $tzname (@{$tz->[3]}) {
+ if ($tzname eq $entries[1]) {
+ $alias = $tz;
+ last;
+ }
+ }
+ }
+
+ die "Unknown link $_" if ! $alias;
+ die "@entries" if $entries[1] =~ /^\d+$/;
+ push @{$alias->[3]}, $entries[2];
+ } else {
+ die "Unknown command: $_";
+ }
+ }
+ if ($in_time_zone) {
+ die "early end of Zone: $_" if ($entries[0] =~ /^[A-Za-z]+/);
+ if (@entries <= 3) {
+# print "found ZONE $timezonename $entries[0] $entries[1] $entries[2]\n";
+ # This is the last line and the only we look at.
+ # other lines are for historic time zones.
+ my $rawoffset = parseOffset($entries[0]);
+ my $rule = $rules{"$entries[1]"} || "-";
+ if ($rule ne "-") {
+ if (!defined($rule->[2])) {
+ $rule = "-";
+ } else {
+ # now we can parse the time since we know raw offset.
+ my $savings = $rule->[2];
+ my $endrule = parseRule($rawoffset, $savings,
+ $rule->[0]);
+ my $startrule = parseRule($rawoffset, $savings,
+ $rule->[1]);
+ $rule = [ $endrule, $startrule, $savings ];
+# print "start",@{$rule->[1]}, "end", @{$rule->[0]},
+# "offset", $rule->[2],"\n";
+ }
+ }
+ my $alias = findAlias($rawoffset, $rule);
+ if ($alias) {
+ if (($alias->[0] =~ /\//)
+ && ($timezonename !~ /\//)) {
+ # alias is of Country/City form, timezonename not
+ # make timezonename the real zone name
+ $alias->[0] = $timezonename;
+ }
+ push @{$alias->[3]}, $timezonename;
+ } else {
+ push @timezones, [ $timezonename, $rawoffset, $rule,
+ [ $timezonename ] ];
+ }
+ $in_time_zone = 0;
+ }
+ }
+ }
+ close INPUT;
+}
+
+@timezones = sort { if ($a->[1] != $b->[1]) { $a->[1] <=> $b->[1] }
+ else { $a->[0] cmp $b->[0] } } @timezones;
+for (@timezones) {
+ my ($name, $rawoffset, $rule, $aliaslist) = @{$_};
+ my @aliases = sort { tzcompare($a, $b); } @{$aliaslist};
+ $name = $aliases[0];
+ $rawoffset = makePretty($rawoffset);
+ if ($rule eq "-") {
+ print <<EOF
+ tz = new SimpleTimeZone($rawoffset, \"$name\");
+EOF
+ } else {
+ my ($endmonth, $endday, $endtime) = @{$rule->[0]};
+ my ($startmonth, $startday, $starttime) = @{$rule->[1]};
+ $endtime = makePretty($endtime);
+ $starttime = makePretty($starttime);
+ my $savings = $rule->[2];
+ if ($savings == 3600 * 1000) {
+ print <<EOF
+ tz = new SimpleTimeZone
+ ($rawoffset, \"$name\",
+ $startmonth, $startday, $starttime,
+ $endmonth, $endday, $endtime);
+EOF
+ } else {
+ $savings = makePretty($savings);
+ print <<EOF
+ tz = new SimpleTimeZone
+ ($rawoffset, \"$name\",
+ $startmonth, $startday, $starttime,
+ $endmonth, $endday, $endtime, $savings);
+EOF
+ }
+ }
+ for (@aliases) {
+ print <<EOF
+ timezones0.put(\"$_\", tz);
+EOF
+ }
+}
+
+
diff --git a/libjava/classpath/scripts/tzabbrevs b/libjava/classpath/scripts/tzabbrevs
new file mode 100644
index 00000000000..f033f08ab0d
--- /dev/null
+++ b/libjava/classpath/scripts/tzabbrevs
@@ -0,0 +1,40 @@
+Link Pacific/Niue MIT
+Link America/Juneau AST
+Link PST8PDT PST
+# XXX: Remove PST8PDT after java.lang.System is merged with libgcj?
+# Remove PST8PDT
+Link MST PNT
+# XXX: Remove MST7 after java.lang.System is merged with libgcj?
+Link MST MST7
+Remove MST
+Link MST7MDT MST
+# XXX: Remove MST7MDT after java.lang.System is merged with libgcj?
+# Remove MST7MDT
+Link CST6CDT CST
+# XXX: Remove CST6CDT after java.lang.System is merged with libgcj?
+# Remove CST6CDT
+Link EST IET
+# XXX: Remove EST5 after java.lang.System is merged with libgcj?
+Link EST EST5
+Remove EST
+Link EST5EDT EST
+# XXX: Remove EST5EDT after java.lang.System is merged with libgcj?
+# Remove EST5EDT
+Link America/Anguilla PRT
+Link America/Argentina/Buenos_Aires AGT
+Link America/St_Johns CNT
+Link CET ECT
+Link Africa/Cairo ART
+Link Africa/Gaborone CAT
+Link Indian/Comoro EAT
+Link Indian/Mauritius NET
+Link Indian/Kerguelen PLT
+Link Asia/Calcutta IST
+Link Asia/Colombo BST
+Link Asia/Bangkok VST
+Link Asia/Brunei CTT
+Link Asia/Seoul JST
+Link Australia/Darwin ACT
+Link Australia/Sydney AET
+Link Pacific/Ponape SST
+Link Pacific/Auckland NST
diff --git a/libjava/classpath/scripts/unicode-blocks.pl b/libjava/classpath/scripts/unicode-blocks.pl
new file mode 100755
index 00000000000..301cd1dd893
--- /dev/null
+++ b/libjava/classpath/scripts/unicode-blocks.pl
@@ -0,0 +1,364 @@
+#!/usr/bin/perl -w
+# unicode-blocks.pl -- Script to generate java.lang.Character.UnicodeBlock
+# Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+#
+# This file is part of GNU Classpath.
+#
+# GNU Classpath is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Classpath is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Classpath; see the file COPYING. If not, write to the
+# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+#
+# Linking this library statically or dynamically with other modules is
+# making a combined work based on this library. Thus, the terms and
+# conditions of the GNU General Public License cover the whole
+# combination.
+#
+# As a special exception, the copyright holders of this library give you
+# permission to link this library with independent modules to produce an
+# executable, regardless of the license terms of these independent
+# modules, and to copy and distribute the resulting executable under
+# terms of your choice, provided that you also meet, for each linked
+# independent module, the terms and conditions of the license of that
+# module. An independent module is a module which is not derived from
+# or based on this library. If you modify this library, you may extend
+# this exception to your version of the library, but you are not
+# obligated to do so. If you do not wish to do so, delete this
+# exception statement from your version.
+
+
+# Code for reading Blocks.txt and generating (to standard out) the code for
+# java.lang.Character.UnicodeBlock, for pasting into java/lang/Character.java.
+# You should probably check that the results are accurate to the
+# specification, but I made sure it works OOB for Unicode 3.0.0 and JDK 1.4.
+# As the grammar for the Blocks.txt file is changing in Unicode 3.2.0, you
+# will have to tweak this some for future use. For now, the relevant
+# Unicode definition files are found in doc/unicode/.
+#
+# author Eric Blake <ebb9@email.byu.edu>
+#
+# usage: unicode-blocks.pl <blocks.txt>
+# where <blocks.txt> is obtained from www.unicode.org (named Blocks-3.txt
+# for Unicode version 3.0.0).
+
+
+die "Usage: $0 <blocks.txt>" unless @ARGV == 1;
+open (BLOCKS, $ARGV[0]) || die "Can't open Unicode block file: $!\n";
+
+# A hash of added fields and the JDK they were added in, to automatically
+# print @since tags. Maintaining this is optional (and tedious), but nice.
+my %additions = ("SYRIAC" => "1.4",
+ "THAANA" => "1.4",
+ "SINHALA" => "1.4",
+ "MYANMAR" => "1.4",
+ "ETHIOPIC" => "1.4",
+ "CHEROKEE" => "1.4",
+ "UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS" => "1.4",
+ "OGHAM" => "1.4",
+ "RUNIC" => "1.4",
+ "KHMER" => "1.4",
+ "MONGOLIAN" => "1.4",
+ "BRAILLE_PATTERNS" => "1.4",
+ "CJK_RADICALS_SUPPLEMENT" => "1.4",
+ "KANGXI_RADICALS" => "1.4",
+ "IDEOGRAPHIC_DESCRIPTION_CHARACTERS" => "1.4",
+ "BOPOMOFO_EXTENDED" => "1.4",
+ "CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A" => "1.4",
+ "YI_SYLLABLES" => "1.4",
+ "YI_RADICALS" => "1.4",
+ "CYRILLIC_SUPPLEMENTARY" => "1.5",
+ "TAGALOG" => "1.5",
+ "HANUNOO" => "1.5",
+ "BUHID" => "1.5",
+ "TAGBANWA" => "1.5",
+ "LIMBU" => "1.5",
+ "TAI_LE" => "1.5",
+ "KHMER_SYMBOLS" => "1.5",
+ "PHONETIC_EXTENSIONS" => "1.5",
+ "MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A" => "1.5",
+ "SUPPLEMENTAL_ARROWS_A" => "1.5",
+ "SUPPLEMENTAL_ARROWS_B" => "1.5",
+ "MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B" => "1.5",
+ "SUPPLEMENTAL_MATHEMATICAL_OPERATORS" => "1.5",
+ "MISCELLANEOUS_SYMBOLS_AND_ARROWS" => "1.5",
+ "KATAKANA_PHONETIC_EXTENSIONS" => "1.5",
+ "YIJING_HEXAGRAM_SYMBOLS" => "1.5",
+ "VARIATION_SELECTORS" => "1.5",
+ "LINEAR_B_SYLLABARY" => "1.5",
+ "LINEAR_B_IDEOGRAMS" => "1.5",
+ "AEGEAN_NUMBERS" => "1.5",
+ "OLD_ITALIC" => "1.5",
+ "GOTHIC" => "1.5",
+ "UGARITIC" => "1.5",
+ "DESERET" => "1.5",
+ "SHAVIAN" => "1.5",
+ "OSMANYA" => "1.5",
+ "CYPRIOT_SYLLABARY" => "1.5",
+ "BYZANTINE_MUSICAL_SYMBOLS" => "1.5",
+ "MUSICAL_SYMBOLS" => "1.5",
+ "TAI_XUAN_JING_SYMBOLS" => "1.5",
+ "MATHEMATICAL_ALPHANUMERIC_SYMBOLS" => "1.5",
+ "CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B" => "1.5",
+ "CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT" => "1.5",
+ "TAGS" => "1.5",
+ "VARIATION_SELECTORS_SUPPLEMENT" => "1.5",
+ "SUPPLEMENTARY_PRIVATE_USE_AREA_A" => "1.5",
+ "SUPPLEMENTARY_PRIVATE_USE_AREA_B" => "1.5",
+ "HIGH_SURROGATES" => "1.5",
+ "HIGH_PRIVATE_USE_SURROGATES" => "1.5",
+ "LOW_SURROGATES" => "1.5"
+ );
+
+print <<'EOF';
+ /**
+ * A family of character subsets in the Unicode specification. A character
+ * is in at most one of these blocks.
+ *
+ * This inner class was generated automatically from
+ * <code>$ARGV[0]</code>, by some perl scripts.
+ * This Unicode definition file can be found on the
+ * <a href="http://www.unicode.org">http://www.unicode.org</a> website.
+ * JDK 1.5 uses Unicode version 4.0.0.
+ *
+ * @author scripts/unicode-blocks.pl (written by Eric Blake)
+ * @since 1.2
+ */
+ public static final class UnicodeBlock extends Subset
+ {
+ /** The start of the subset. */
+ private final int start;
+
+ /** The end of the subset. */
+ private final int end;
+
+ /** The canonical name of the block according to the Unicode standard. */
+ private final String canonicalName;
+
+ /** Enumeration for the <code>forName()</code> method */
+ private enum NameType { CANONICAL, NO_SPACES, CONSTANT; };
+
+ /**
+ * Constructor for strictly defined blocks.
+ *
+ * @param start the start character of the range
+ * @param end the end character of the range
+ * @param name the block name
+ * @param canonicalName the name of the block as defined in the Unicode
+ * standard.
+ */
+ private UnicodeBlock(int start, int end, String name,
+ String canonicalName)
+ {
+ super(name);
+ this.start = start;
+ this.end = end;
+ this.canonicalName = canonicalName;
+ }
+
+ /**
+ * Returns the Unicode character block which a character belongs to.
+ * <strong>Note</strong>: This method does not support the use of
+ * supplementary characters. For such support, <code>of(int)</code>
+ * should be used instead.
+ *
+ * @param ch the character to look up
+ * @return the set it belongs to, or null if it is not in one
+ */
+ public static UnicodeBlock of(char ch)
+ {
+ return of((int) ch);
+ }
+
+ /**
+ * Returns the Unicode character block which a code point belongs to.
+ *
+ * @param codePoint the character to look up
+ * @return the set it belongs to, or null if it is not in one.
+ * @throws IllegalArgumentException if the specified code point is
+ * invalid.
+ * @since 1.5
+ */
+ public static UnicodeBlock of(int codePoint)
+ {
+ if (codePoint > MAX_CODE_POINT)
+ throw new IllegalArgumentException("The supplied integer value is " +
+ "too large to be a codepoint.");
+ // Simple binary search for the correct block.
+ int low = 0;
+ int hi = sets.length - 1;
+ while (low <= hi)
+ {
+ int mid = (low + hi) >> 1;
+ UnicodeBlock b = sets[mid];
+ if (codePoint < b.start)
+ hi = mid - 1;
+ else if (codePoint > b.end)
+ low = mid + 1;
+ else
+ return b;
+ }
+ return null;
+ }
+
+ /**
+ * <p>
+ * Returns the <code>UnicodeBlock</code> with the given name, as defined
+ * by the Unicode standard. The version of Unicode in use is defined by
+ * the <code>Character</code> class, and the names are given in the
+ * <code>Blocks-<version>.txt</code> file corresponding to that version.
+ * The name may be specified in one of three ways:
+ * </p>
+ * <ol>
+ * <li>The canonical, human-readable name used by the Unicode standard.
+ * This is the name with all spaces and hyphens retained. For example,
+ * `Basic Latin' retrieves the block, UnicodeBlock.BASIC_LATIN.</li>
+ * <li>The canonical name with all spaces removed e.g. `BasicLatin'.</li>
+ * <li>The name used for the constants specified by this class, which
+ * is the canonical name with all spaces and hyphens replaced with
+ * underscores e.g. `BASIC_LATIN'</li>
+ * </ol>
+ * <p>
+ * The names are compared case-insensitively using the case comparison
+ * associated with the U.S. English locale. The method recognises the
+ * previous names used for blocks as well as the current ones. At
+ * present, this simply means that the deprecated `SURROGATES_AREA'
+ * will be recognised by this method (the <code>of()</code> methods
+ * only return one of the three new surrogate blocks).
+ * </p>
+ *
+ * @param blockName the name of the block to look up.
+ * @return the specified block.
+ * @throws NullPointerException if the <code>blockName</code> is
+ * <code>null</code>.
+ * @throws IllegalArgumentException if the name does not match any Unicode
+ * block.
+ * @since 1.5
+ */
+ public static final UnicodeBlock forName(String blockName)
+ {
+ NameType type;
+ if (blockName.indexOf(' ') != -1)
+ type = NameType.CANONICAL;
+ else if (blockName.indexOf('_') != -1)
+ type = NameType.CONSTANT;
+ else
+ type = NameType.NO_SPACES;
+ Collator usCollator = Collator.getInstance(Locale.US);
+ usCollator.setStrength(Collator.PRIMARY);
+ /* Special case for deprecated blocks not in sets */
+ switch (type)
+ {
+ case CANONICAL:
+ if (usCollator.compare(blockName, "Surrogates Area") == 0)
+ return SURROGATES_AREA;
+ break;
+ case NO_SPACES:
+ if (usCollator.compare(blockName, "SurrogatesArea") == 0)
+ return SURROGATES_AREA;
+ break;
+ case CONSTANT:
+ if (usCollator.compare(blockName, "SURROGATES_AREA") == 0)
+ return SURROGATES_AREA;
+ break;
+ }
+ /* Other cases */
+ switch (type)
+ {
+ case CANONICAL:
+ for (UnicodeBlock block : sets)
+ if (usCollator.compare(blockName, block.canonicalName) == 0)
+ return block;
+ break;
+ case NO_SPACES:
+ for (UnicodeBlock block : sets)
+ {
+ String nsName = block.canonicalName.replaceAll(" ","");
+ if (usCollator.compare(blockName, nsName) == 0)
+ return block;
+ }
+ break;
+ case CONSTANT:
+ for (UnicodeBlock block : sets)
+ if (usCollator.compare(blockName, block.toString()) == 0)
+ return block;
+ break;
+ }
+ throw new IllegalArgumentException("No Unicode block found for " +
+ blockName + ".");
+ }
+EOF
+
+my @names = ();
+while (<BLOCKS>) {
+ next if /^\#/;
+ my ($range, $block) = split(/; /);
+ my ($start, $end) = split /\.\./, $range;
+ next unless defined $block;
+ chomp $block;
+ $block =~ s/ *$//;
+
+ # Translate new Unicode names which have the old name in Java
+ $block = "Greek" if $block =~ /Greek and Coptic/;
+ $block = "Combining Marks for Symbols"
+ if $block =~ /Combining Diacritical Marks for Symbols/;
+
+ (my $name = $block) =~ tr/a-z -/A-Z__/;
+ push @names, $name;
+ my $since = (defined $additions{$name}
+ ? "\n * \@since $additions{$name}" : "");
+ print <<EOF;
+
+ /**
+ * $block.
+ * 0x$start - 0x$end.$since
+ */
+ public static final UnicodeBlock $name
+ = new UnicodeBlock(0x$start, 0x$end,
+ "$name",
+ "$block");
+EOF
+}
+
+print <<EOF;
+
+ /**
+ * Surrogates Area.
+ * '\uD800' - '\uDFFF'.
+ * \@deprecated As of 1.5, the three areas,
+ * <a href="#HIGH_SURROGATES">HIGH_SURROGATES</a>,
+ * <a href="#HIGH_PRIVATE_USE_SURROGATES">HIGH_PRIVATE_USE_SURROGATES</a>
+ * and <a href="#LOW_SURROGATES">LOW_SURROGATES</a>, as defined
+ * by the Unicode standard, should be used in preference to
+ * this. These are also returned from calls to <code>of(int)</code>
+ * and <code>of(char)</code>.
+ */
+ \@Deprecated
+ public static final UnicodeBlock SURROGATES_AREA
+ = new UnicodeBlock(0xD800, 0xDFFF,
+ "SURROGATES_AREA",
+ "Surrogates Area");
+
+ /**
+ * The defined subsets.
+ */
+ private static final UnicodeBlock sets[] = {
+EOF
+
+foreach (@names) {
+ print " $_,\n";
+}
+
+print <<EOF;
+ };
+ } // class UnicodeBlock
+EOF
diff --git a/libjava/classpath/scripts/unicode-muncher.pl b/libjava/classpath/scripts/unicode-muncher.pl
new file mode 100755
index 00000000000..db2b89a728c
--- /dev/null
+++ b/libjava/classpath/scripts/unicode-muncher.pl
@@ -0,0 +1,868 @@
+#!/usr/bin/perl -w
+# unicode-muncher.pl -- generate Unicode database for java.lang.Character
+# Copyright (C) 1998, 2002, 2004 Free Software Foundation, Inc.
+#
+# This file is part of GNU Classpath.
+#
+# GNU Classpath is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Classpath is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Classpath; see the file COPYING. If not, write to the
+# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+#
+# Linking this library statically or dynamically with other modules is
+# making a combined work based on this library. Thus, the terms and
+# conditions of the GNU General Public License cover the whole
+# combination.
+#
+# As a special exception, the copyright holders of this library give you
+# permission to link this library with independent modules to produce an
+# executable, regardless of the license terms of these independent
+# modules, and to copy and distribute the resulting executable under
+# terms of your choice, provided that you also meet, for each linked
+# independent module, the terms and conditions of the license of that
+# module. An independent module is a module which is not derived from
+# or based on this library. If you modify this library, you may extend
+# this exception to your version of the library, but you are not
+# obligated to do so. If you do not wish to do so, delete this
+# exception statement from your version.
+
+# Code for reading UnicodeData.txt and generating the code for
+# gnu.java.lang.CharData. For now, the relevant Unicode definition files
+# are found in doc/unicode/.
+#
+# Inspired by code from Jochen Hoenicke.
+# author Eric Blake <ebb9@email.byu.edu>
+# updated to Unicode 4.0.0 by Anthony Balkissoon <abalkiss@redhat.com>
+#
+# Usage: ./unicode-muncher <UnicodeData> <SpecialCasing> <CharData.java>
+# where <UnicodeData> and <SpecialCasing> are .txt files obtained from
+# www.unicode.org (named UnicodeData-4.0.0.txt and SpecialCasing-4.0.0.txt for
+# Unicode version 4.0.0), and <CharData.java> is the final location for the
+# Java interface gnu.java.lang.CharData.
+# As of JDK 1.5, use Unicode version 4.0.0 for best results.
+
+##
+## Convert a 16-bit integer to a Java source code String literal character
+##
+sub javaChar($) {
+ my ($char) = @_;
+ die "Out of range: $char\n" if $char < -0x8000 or $char > 0x10ffff;
+ $char += 0x10000 if $char < 0;
+ # Special case characters that must be escaped, or are shorter as ASCII
+ return sprintf("\\%03o", $char) if $char < 0x20;
+ return "\\\"" if $char == 0x22;
+ return "\\\\" if $char == 0x5c;
+ return pack("C", $char) if $char < 0x7f;
+ return sprintf("\\u%04x", $char);
+}
+
+##
+## Convert the text UnicodeData file from www.unicode.org into a Java
+## interface with string constants holding the compressed information.
+##
+my @TYPECODES = qw(Cn Lu Ll Lt Lm Lo Mn Me Mc Nd Nl No Zs Zl Zp Cc Cf
+ SKIPPED Co Cs Pd Ps Pe Pc Po Sm Sc Sk So Pi Pf);
+my @DIRCODES = qw(L R AL EN ES ET AN CS NSM BN B S WS ON LRE LRO RLE RLO PDF);
+
+my $NOBREAK_FLAG = 32;
+my $MIRRORED_FLAG = 64;
+
+my %special = ();
+
+# infoArray is an array where each element is a list of character information
+# for characters in a plane. The index of each list is equal to the plane
+# that it corresponds to even though most of these lists will currently be
+# empty. This is done so that that this script can be easily modified to
+# accomodate future versions of Unicode.
+my @infoArray = \((), (), (), (), (), (), (), (),
+ (), (), (), (), (), (), (), (), ());
+
+# info is a reference to one of the lists in infoArray, depending on which
+# plane we're currently parsing.
+my $info;
+
+# titlecase is a string of ordered pairs of characters to store the titlecase
+# conversions of characters that have them
+my $titlecase = "";
+
+# count is simply used to print "." to the screen every so often
+my $count = 0;
+
+# range is used when the UnicodeData file blocks out ranges of code points
+my $range = 0;
+
+# largeNums is an array of numerical values that are too large to fit
+# into the 16 bit char where most numerical values are stored.
+# What is stored in the char then is a number N such that (-N - 3) is
+# the index into largeNums where the numerical value can be found.
+my @largeNums = ();
+
+die "Usage: $0 <UnicodeData.txt> <SpecialCasing.txt> <CharData.java>"
+ unless @ARGV == 3;
+$| = 1;
+print "GNU Classpath Unicode Attribute Database Generator 2.1\n";
+print "Copyright (C) 1998, 2002 Free Software Foundation, Inc.\n";
+
+################################################################################
+################################################################################
+## Stage 0: Parse the special casing file
+print "Parsing special casing file\n";
+open (SPECIAL, "< $ARGV[1]") || die "Can't open special casing file: $!\n";
+while (<SPECIAL>) {
+ next if /^\#/;
+ my ($ch, undef, undef, $upper) = split / *; */;
+
+ # This grabs only the special casing for multi-char uppercase. Note that
+ # there are no multi-char lowercase, and that Sun ignores multi-char
+ # titlecase rules. This script omits 3 special cases in Unicode 3.0.0,
+ # which must be hardcoded in java.lang.String:
+ # \u03a3 (Sun ignores this special case)
+ # \u0049 - lowercases to \u0131, but only in Turkish locale
+ # \u0069 - uppercases to \u0130, but only in Turkish locale
+ next unless defined $upper and $upper =~ / /;
+ $special{hex $ch} = [map {hex} split ' ', $upper];
+}
+close SPECIAL;
+
+################################################################################
+################################################################################
+## Stage 1: Parse the attribute file
+print "Parsing attributes file";
+open (UNICODE, "< $ARGV[0]") || die "Can't open Unicode attribute file: $!\n";
+while (<UNICODE>) {
+ print "." unless $count++ % 1000;
+ chomp;
+ s/\r//g;
+ my ($ch, $name, $category, undef, $bidir, $decomp, undef, undef, $numeric,
+ $mirrored, undef, undef, $upcase, $lowcase, $title) = split ';';
+ $ch = hex($ch);
+
+ # plane tells us which Unicode code plane we're currently in and is an
+ # index into infoArray.
+ my $plane = int($ch / 0x10000);
+ my $planeBase = $plane * 0x10000;
+ $info = \@{$infoArray[$plane]};
+
+ my ($type, $numValue, $upperchar, $lowerchar, $direction);
+
+ # Set the value of the $type variable, checking to make sure that it's valid
+ # and setting the mirrored and nobreak bits if necessary.
+ $type = 0;
+ while ($category !~ /^$TYPECODES[$type]$/) {
+ if (++$type == @TYPECODES) {
+ die "$ch: Unknown type: $category";
+ }
+ }
+ $type |= $NOBREAK_FLAG if ($decomp =~ /noBreak/);
+ $type |= $MIRRORED_FLAG if ($mirrored =~ /Y/);
+
+ # Set the value of the $numeric variable checking the special cases of
+ # large numbers or 'a' - 'z' values.
+ if ($numeric =~ /^[0-9]+$/) {
+ $numValue = $numeric;
+ # If numeric takes more than 16 bits to store we want to store that
+ # number in a separate array and store a number N in numValue such
+ # that (-N - 3) is the offset into the separate array containing the
+ # large numerical value.
+ if ($numValue >= 0x7fff) {
+ $numValue = -3 - @largeNums;
+ push @largeNums, $numeric;
+ }
+ } elsif ($numeric eq "") {
+ # Special case sequences of 'a'-'z'
+ if ($ch >= 0x0041 && $ch <= 0x005a) {
+ $numValue = $ch - 0x0037;
+ } elsif ($ch >= 0x0061 && $ch <= 0x007a) {
+ $numValue = $ch - 0x0057;
+ } elsif ($ch >= 0xff21 && $ch <= 0xff3a) {
+ $numValue = $ch - 0xff17;
+ } elsif ($ch >= 0xff41 && $ch <= 0xff5a) {
+ $numValue = $ch - 0xff37;
+ } else {
+ $numValue = -1;
+ }
+ } else {
+ $numValue = -2;
+ }
+
+ # Set the uppercase and lowercase expansions for the character.
+ $upperchar = $upcase ? hex($upcase) - $ch : 0;
+ $lowerchar = $lowcase ? hex($lowcase) - $ch : 0;
+
+ # If this character has a special titlecase expansion then append it to
+ # the titlecase String.
+ if ($title ne $upcase) {
+ my $titlechar = $title ? hex($title) : $ch;
+ $titlecase .= pack("n2", $ch, $titlechar);
+ }
+
+ # Set the direction variable, use the lower 2 bits as a count of how many
+ # characters will be added to the String if this character undergoes an
+ # uppercase expansion.
+ $direction = 0;
+ while ($bidir !~ /^$DIRCODES[$direction]$/) {
+ if (++$direction == @DIRCODES) {
+ $direction = -1;
+ last;
+ }
+ }
+ $direction <<= 2;
+ $direction += $#{$special{$ch}} if defined $special{$ch};
+
+ # If the UnicodeData file blocks off ranges of code points give them all
+ # the same character information.
+ if ($range) {
+ die "Expecting end of range at $ch\n" unless $name =~ /Last>$/;
+ for ($range + 1 .. $ch - 1) {
+ $info->[$_ - $planeBase] = pack("n5", $type, $numValue, $upperchar,
+ $lowerchar, $direction);
+ }
+ $range = 0;
+ } elsif ($name =~ /First>$/) {
+ $range = $ch;
+ }
+
+ # Store all this parsed information into the element in infoArray that info
+ # points to.
+ $info->[$ch - $planeBase] = pack("n5", $type, $numValue, $upperchar, $lowerchar,
+ $direction);
+}
+close UNICODE;
+
+################################################################################
+################################################################################
+## Stage 2: Compress the data structures
+printf "\nCompressing data structures";
+$count = 0;
+
+# data is a String that will be used to create the DATA String containing
+# character information and offsets into the attribute tables.
+my @data = ();
+
+# charhashArray is an array of hashtables used so that we can reuse character
+# attributes when characters share the same attributes ... this makes our
+# attribute tables smaller. charhash is a pointer into this array.
+my @charhashArray = ({}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {});
+my $charhash = ();
+
+# charinfoArray is an array of arrays, one per plane, for storing character
+# information. charinfo is a pointer into this array.
+my @charinfoArray = \((), (), (), (), (), (), (), (),
+ (), (), (), (), (), (), (), (), ());
+my $charinfo;
+
+# charlen is an array, one element per plane, that tells us how many unique
+# character attributes there are for that plane.
+my @charlen = ();
+
+for my $plane (0 .. 0x10) {
+ $info = \@{$infoArray[$plane]};
+ my $planeBase = $plane * 0x10000;
+ $charhash = \%{$charhashArray[$plane]};
+ $charinfo = \@{$charinfoArray[$plane]};
+
+ for my $ch ($planeBase .. $planeBase + 0xffff) {
+ my $index = $ch - $planeBase;
+ print "." unless $count++ % 0x1000;
+ $info->[$index] = pack("n5", 0, -1, 0, 0, -4) unless defined $info->[$index];
+
+ my ($type, $numVal, $upper, $lower, $direction) = unpack("n5", $info->[$index]);
+ if (! exists $charhash->{$info->[$index]}) {
+ # If we entered this loop that means the character we're looking at
+ # now has attributes that are unique from those that we've looked
+ # at so far for this plane. So we push its attributes into charinfo
+ # and store in charhash the offset into charinfo where these
+ # attributes can later be found.
+ push @{$charinfo}, [ $numVal, $upper, $lower, $direction ];
+ $charhash->{$info->[$index]} = @{$charinfo} - 1;
+ # When the file is generaged, the number we just stored in charhas
+ # will be the upper 9 bits in the DATA String that are an offset
+ # into the attribute tables.
+ }
+ $data[$plane] .= pack("n", ($charhash->{$info->[$index]} << 7) | $type);
+ }
+ $charlen[$plane] = scalar(@{$charinfoArray[$plane]});
+}
+
+# the shift that results in the best compression of the table. This is an array
+# because different shifts are better for the different tables for each plane.
+my @bestshift;
+
+# an initial guess.
+my $bestest = 1000000;
+my @bestblkstr;
+my @blksize = ();
+
+for my $plane (0 .. 0x10) {
+ print "\n\nplane: $plane\n";
+ print "Unique character entries: $charlen[$plane]\n";
+ $bestest = 1000000;
+ for my $i (3 .. 8) {
+ my $blksize = 1 << $i;
+ my %blocks = ();
+ my @blkarray = ();
+ my ($j, $k);
+ print "shift: $i";
+
+ for ($j = 0; $j < 0x10000; $j += $blksize) {
+ my $blkkey = substr $data[$plane], 2 * $j, 2 * $blksize;
+ if (! exists $blocks{$blkkey}) {
+ push @blkarray, $blkkey;
+ $blocks{$blkkey} = $#blkarray;
+ }
+ }
+
+ my $blknum = @blkarray;
+ my $blocklen = $blknum * $blksize;
+ printf " before %5d", $blocklen;
+
+ # Now we try to pack the blkarray as tight as possible by finding matching
+ # heads and tails.
+ for ($j = $blksize - 1; $j > 0; $j--) {
+ my %tails = ();
+ for $k (0 .. $#blkarray) {
+ next unless defined $blkarray[$k];
+ my $len = length $blkarray[$k];
+ my $tail = substr $blkarray[$k], $len - $j * 2;
+ if (exists $tails{$tail}) {
+ push @{$tails{$tail}}, $k;
+ } else {
+ $tails{$tail} = [ $k ];
+ }
+ }
+
+ # tails are calculated, now calculate the heads and merge.
+ BLOCK:
+ for $k (0 .. $#blkarray) {
+ next unless defined $blkarray[$k];
+ my $tomerge = $k;
+ while (1) {
+ my $head = substr($blkarray[$tomerge], 0, $j * 2);
+ my $entry = $tails{$head};
+ next BLOCK unless defined $entry;
+
+ my $other = shift @{$entry};
+ if ($other == $tomerge) {
+ if (@{$entry}) {
+ push @{$entry}, $other;
+ $other = shift @{$entry};
+ } else {
+ push @{$entry}, $other;
+ next BLOCK;
+ }
+ }
+ if (@{$entry} == 0) {
+ delete $tails{$head};
+ }
+
+ # a match was found
+ my $merge = $blkarray[$other]
+ . substr($blkarray[$tomerge], $j * 2);
+ $blocklen -= $j;
+ $blknum--;
+
+ if ($other < $tomerge) {
+ $blkarray[$tomerge] = undef;
+ $blkarray[$other] = $merge;
+ my $len = length $merge;
+ my $tail = substr $merge, $len - $j * 2;
+ $tails{$tail} = [ map { $_ == $tomerge ? $other : $_ }
+ @{$tails{$tail}} ];
+ next BLOCK;
+ }
+ $blkarray[$tomerge] = $merge;
+ $blkarray[$other] = undef;
+ }
+ }
+ }
+ my $blockstr;
+ for $k (0 .. $#blkarray) {
+ $blockstr .= $blkarray[$k] if defined $blkarray[$k];
+ }
+
+ die "Unexpected $blocklen" if length($blockstr) != 2 * $blocklen;
+ my $estimate = 2 * $blocklen + (0x20000 >> $i);
+
+ printf " after merge %5d: %6d bytes\n", $blocklen, $estimate;
+ if ($estimate < $bestest) {
+ $bestest = $estimate;
+ $bestshift[$plane] = $i;
+ $bestblkstr[$plane] = $blockstr;
+ }
+ }
+ $blksize[$plane] = 1 << $bestshift[$plane];
+ print "best shift: ", $bestshift[$plane];
+ print " blksize: ", $blksize[$plane];
+}
+my @blocksArray = \((), (), (), (), (), (), (), (),
+ (), (), (), (), (), (), (), (), ());
+
+for my $plane (0 .. 0x10) {
+ for (my $j = 0; $j < 0x10000; $j += $blksize[$plane]) {
+ my $blkkey = substr $data[$plane], 2 * $j, 2 * $blksize[$plane];
+ my $index = index $bestblkstr[$plane], $blkkey;
+ while ($index & 1) {
+ die "not found: $j" if $index == -1;
+ $index = index $bestblkstr[$plane], $blkkey, $index + 1;
+ }
+ push @{$blocksArray[$plane]}, ($index / 2 - $j) & 0xffff;
+ }
+}
+
+################################################################################
+################################################################################
+## Stage 3: Generate the file
+for my $plane (0 .. 0x10) {
+ die "UTF-8 limit of blocks may be exceeded for plane $plane: " . scalar(@{$blocksArray[$plane]}) . "\n"
+ if @{$blocksArray[$plane]} > 0xffff / 3;
+ die "UTF-8 limit of data may be exceeded for plane $plane: " . length($bestblkstr[$plane]) . "\n"
+ if length($bestblkstr[$plane]) > 0xffff / 3;
+}
+
+{
+ print "\nGenerating $ARGV[2].";
+ my ($i, $j);
+
+ open OUTPUT, "> $ARGV[2]" or die "Failed creating output file: $!\n";
+ print OUTPUT <<EOF;
+/* gnu/java/lang/CharData -- Database for java.lang.Character Unicode info
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ *** This file is generated by scripts/unicode-muncher.pl ***
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.java.lang;
+
+/**
+ * This contains the info about the unicode characters, that
+ * java.lang.Character needs. It is generated automatically from
+ * <code>$ARGV[0]</code> and
+ * <code>$ARGV[1]</code>, by some
+ * perl scripts. These Unicode definition files can be found on the
+ * <a href="http://www.unicode.org">http://www.unicode.org</a> website.
+ * JDK 1.5 uses Unicode version 4.0.0.
+ *
+ * The data is stored as string constants, but Character will convert these
+ * Strings to their respective <code>char[]</code> components. The fields
+ * are stored in arrays of 17 elements each, one element per Unicode plane.
+ * <code>BLOCKS</code> stores the offset of a block of 2<sup>SHIFT</sup>
+ * characters within <code>DATA</code>. The DATA field, in turn, stores
+ * information about each character in the low order bits, and an offset
+ * into the attribute tables <code>UPPER</code>, <code>LOWER</code>,
+ * <code>NUM_VALUE</code>, and <code>DIRECTION</code>. Notice that the
+ * attribute tables are much smaller than 0xffff entries; as many characters
+ * in Unicode share common attributes. Numbers that are too large to fit
+ * into NUM_VALUE as 16 bit chars are stored in LARGENUMS and a number N is
+ * stored in NUM_VALUE such that (-N - 3) is the offset into LARGENUMS for
+ * the particular character. The DIRECTION table also contains a field for
+ * detecting characters with multi-character uppercase expansions.
+ * Next, there is a listing for <code>TITLE</code> exceptions (most characters
+ * just have the same title case as upper case). Finally, there are two
+ * tables for multi-character capitalization, <code>UPPER_SPECIAL</code>
+ * which lists the characters which are special cased, and
+ * <code>UPPER_EXPAND</code>, which lists their expansion.
+ *
+ * \@author scripts/unicode-muncher.pl (written by Jochen Hoenicke,
+ * Eric Blake)
+ * \@see Character
+ * \@see String
+ */
+public interface CharData
+{
+ /**
+ * The Unicode definition file that was parsed to build this database.
+ */
+ String SOURCE = \"$ARGV[0]\";
+
+ /**
+ * The character shift amount to look up the block offset. In other words,
+ * <code>(char) (BLOCKS.value[ch >> SHIFT[p]] + ch)</code> is the index
+ * where <code>ch</code> is described in <code>DATA</code> if <code>ch</code>
+ * is in Unicode plane <code>p</code>. Note that <code>p</code> is simply
+ * the integer division of ch and 0x10000.
+ */
+ int[] SHIFT
+EOF
+ for ($i = 0; $i < @bestshift - 1; $i++) {
+ if ($i == 0){
+ print OUTPUT " = new int[] {";
+ }
+ print OUTPUT $bestshift[$i], ", ";
+ }
+ if (scalar(@bestshift) > 0){
+ print OUTPUT $bestshift[-1], "}";
+ }
+ else {
+ print OUTPUT " = null";
+ }
+ print OUTPUT <<EOF;
+;
+
+ /**
+ * The mapping of character blocks to their location in <code>DATA</code>.
+ * Each entry has been adjusted so that the 16-bit sum with the desired
+ * character gives the actual index into <code>DATA</code>.
+ */
+ String[] BLOCKS = new String[]{
+EOF
+ for ($plane = 0; $plane <= 0x10; $plane++) {
+ # The following if statement handles the cases of unassigned planes
+ # specially so we don't waste space with unused Strings. As of
+ # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If
+ # you are updating this script to work with a later version of
+ # Unicode you may have to alter this if statement.
+ if ($plane > 2 && $plane != 14) {
+ print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n";
+ }
+ else {
+ for ($i = 0; $i < @{$blocksArray[$plane]} / 11; $i++) {
+ print OUTPUT $i ? "\n + " : " ";
+ print OUTPUT "\"";
+ for $j (0 .. 10) {
+ last if @{$blocksArray[$plane]} <= $i * 11 + $j;
+ my $val = $blocksArray[$plane]->[$i * 11 + $j];
+ print OUTPUT javaChar($val);
+ }
+ print OUTPUT "\"";
+ }
+ print OUTPUT ",\n\n";
+ }
+ }
+ print OUTPUT <<EOF;
+;
+
+ /**
+ * The array containing the numeric values that are too large to be stored as
+ * chars in NUM_VALUE. NUM_VALUE in this case will contain a negative integer
+ * N such that LARGENUMS[-N - 3] contains the correct numeric value.
+ */
+ int[] LARGENUMS
+EOF
+ for ($i = 0; $i < @largeNums - 1; $i++) {
+ if ($i == 0){
+ print OUTPUT " = new int[] {";
+ }
+ print OUTPUT $largeNums[$i], ", ";
+ }
+ if (scalar(@largeNums) > 0){
+ print OUTPUT $largeNums[-1], "}";
+ }
+ else {
+ print OUTPUT " = null";
+ }
+ print OUTPUT <<EOF;
+;
+
+ /**
+ * Information about each character. The low order 5 bits form the
+ * character type, the next bit is a flag for non-breaking spaces, and the
+ * next bit is a flag for mirrored directionality. The high order 9 bits
+ * form the offset into the attribute tables. Note that this limits the
+ * number of unique character attributes to 512, which is not a problem
+ * as of Unicode version 4.0.0, but may soon become one.
+ */
+ String[] DATA = new String[]{
+EOF
+ for ($plane = 0; $plane <= 0x10; $plane++) {
+ # The following if statement handles the cases of unassigned planes
+ # specially so we don't waste space with unused Strings. As of
+ # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If
+ # you are updating this script to work with a later version of
+ # Unicode you may have to alter this if statement.
+ if ($plane > 2 && $plane != 14) {
+ print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n";
+ }
+ else {
+ my $len = length($bestblkstr[$plane]) / 2;
+ for ($i = 0; $i < $len / 11; $i++) {
+ print OUTPUT $i ? "\n + " : " ";
+ print OUTPUT "\"";
+ for $j (0 .. 10) {
+ last if $len <= $i * 11 + $j;
+ my $val = unpack "n", substr($bestblkstr[$plane], 2 * ($i * 11 + $j), 2);
+ print OUTPUT javaChar($val);
+ }
+ print OUTPUT "\"";
+ }
+ print OUTPUT ",\n\n";
+ }
+ }
+ print OUTPUT <<EOF;
+;
+
+ /**
+ * This is the attribute table for computing the numeric value of a
+ * character. The value is -1 if Unicode does not define a value, -2
+ * if the value is not a positive integer, otherwise it is the value.
+ * Note that this is a signed value, but stored as an unsigned char
+ * since this is a String literal.
+ */
+ String[] NUM_VALUE = new String[]{
+EOF
+
+ for ($plane = 0; $plane <= 0x10; $plane++) {
+ # The following if statement handles the cases of unassigned planes
+ # specially so we don't waste space with unused Strings. As of
+ # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If
+ # you are updating this script to work with a later version of
+ # Unicode you may have to alter this if statement.
+ if ($plane > 2 && $plane != 14) {
+ print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n";
+ }
+ else {
+ $len = @{$charinfoArray[$plane]};
+ for ($i = 0; $i < $len / 11; $i++) {
+ print OUTPUT $i ? "\n + " : " ";
+ print OUTPUT "\"";
+ for $j (0 .. 10) {
+ last if $len <= $i * 11 + $j;
+ my $val = $charinfoArray[$plane]->[$i * 11 + $j][0];
+ print OUTPUT javaChar($val);
+ }
+ print OUTPUT "\"";
+ }
+ print OUTPUT ",\n\n";
+ }
+ }
+ print OUTPUT <<EOF;
+;
+
+ /**
+ * This is the attribute table for computing the single-character uppercase
+ * representation of a character. The value is the signed difference
+ * between the character and its uppercase version. Note that this is
+ * stored as an unsigned char since this is a String literal. When
+ * capitalizing a String, you must first check if a multi-character uppercase
+ * sequence exists before using this character.
+ */
+ String[] UPPER = new String[]{
+EOF
+
+ for ($plane = 0; $plane <= 0x10; $plane++) {
+ # The following if statement handles the cases of unassigned planes
+ # specially so we don't waste space with unused Strings. As of
+ # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If
+ # you are updating this script to work with a later version of
+ # Unicode you may have to alter this if statement.
+ if ($plane > 2 && $plane != 14) {
+ print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n";
+ }
+ else {
+ $len = @{$charinfoArray[$plane]};
+ for ($i = 0; $i < $len / 11; $i++) {
+ print OUTPUT $i ? "\n + " : " ";
+ print OUTPUT "\"";
+ for $j (0 .. 10) {
+ last if $len <= $i * 11 + $j;
+ my $val = $charinfoArray[$plane]->[$i * 11 + $j][1];
+ print OUTPUT javaChar($val);
+ }
+ print OUTPUT "\"";
+ }
+ print OUTPUT ",\n\n";
+ }
+ }
+ print OUTPUT <<EOF;
+;
+
+ /**
+ * This is the attribute table for computing the lowercase representation
+ * of a character. The value is the signed difference between the
+ * character and its lowercase version. Note that this is stored as an
+ * unsigned char since this is a String literal.
+ */
+ String[] LOWER = new String[]{
+EOF
+
+ for ($plane = 0; $plane <= 0x10; $plane++) {
+ # The following if statement handles the cases of unassigned planes
+ # specially so we don't waste space with unused Strings. As of
+ # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If
+ # you are updating this script to work with a later version of
+ # Unicode you may have to alter this if statement.
+ if ($plane > 2 && $plane != 14) {
+ print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n";
+ }
+ else {
+ $len = @{$charinfoArray[$plane]};
+ for ($i = 0; $i < $len / 11; $i++) {
+ print OUTPUT $i ? "\n + " : " ";
+ print OUTPUT "\"";
+ for $j (0 .. 10) {
+ last if $len <= $i * 11 + $j;
+ my $val = $charinfoArray[$plane]->[$i * 11 + $j][2];
+ print OUTPUT javaChar($val);
+ }
+ print OUTPUT "\"";
+ }
+ print OUTPUT ",\n\n";
+ }
+ }
+ print OUTPUT <<EOF;
+;
+
+ /**
+ * This is the attribute table for computing the directionality class
+ * of a character, as well as a marker of characters with a multi-character
+ * capitalization. The direction is taken by performing a signed shift
+ * right by 2 (where a result of -1 means an unknown direction, such as
+ * for undefined characters). The lower 2 bits form a count of the
+ * additional characters that will be added to a String when performing
+ * multi-character uppercase expansion. This count is also used, along with
+ * the offset in UPPER_SPECIAL, to determine how much of UPPER_EXPAND to use
+ * when performing the case conversion. Note that this information is stored
+ * as an unsigned char since this is a String literal.
+ */
+ String[] DIRECTION = new String[]{
+EOF
+
+ for ($plane = 0; $plane <= 0x10; $plane++) {
+ # The following if statement handles the cases of unassigned planes
+ # specially so we don't waste space with unused Strings. As of
+ # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If
+ # you are updating this script to work with a later version of
+ # Unicode you may have to alter this if statement.
+ if ($plane > 2 && $plane != 14) {
+ print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n";
+ }
+ else {
+ $len = @{$charinfoArray[$plane]};
+ for ($i = 0; $i < $len / 11; $i++) {
+ print OUTPUT $i ? "\n + " : " ";
+ print OUTPUT "\"";
+ for $j (0 .. 10) {
+ last if $len <= $i * 11 + $j;
+ my $val = $charinfoArray[$plane]->[$i * 11 + $j][3];
+ print OUTPUT javaChar($val);
+ }
+ print OUTPUT "\"";
+ }
+ print OUTPUT ",\n\n";
+ }
+ }
+ print OUTPUT <<EOF;
+;
+
+ /**
+ * This is the listing of titlecase special cases (all other characters
+ * can use <code>UPPER</code> to determine their titlecase). The listing
+ * is a sorted sequence of character pairs; converting the first character
+ * of the pair to titlecase produces the second character.
+ */
+ String TITLE
+EOF
+
+ $len = length($titlecase) / 2;
+ for ($i = 0; $i < $len / 11; $i++) {
+ print OUTPUT $i ? "\n + \"" : " = \"";
+ for $j (0 .. 10) {
+ last if $len <= $i * 11 + $j;
+ my $val = unpack "n", substr($titlecase, 2 * ($i * 11 + $j), 2);
+ print OUTPUT javaChar($val);
+ }
+ print OUTPUT "\"";
+ }
+
+ print OUTPUT <<EOF;
+;
+
+ /**
+ * This is a listing of characters with multi-character uppercase sequences.
+ * A character appears in this list exactly when it has a non-zero entry
+ * in the low-order 2-bit field of DIRECTION. The listing is a sorted
+ * sequence of pairs (hence a binary search on the even elements is an
+ * efficient way to lookup a character). The first element of a pair is the
+ * character with the expansion, and the second is the index into
+ * UPPER_EXPAND where the expansion begins. Use the 2-bit field of
+ * DIRECTION to determine where the expansion ends.
+ */
+ String UPPER_SPECIAL
+EOF
+
+ my @list = sort {$a <=> $b} keys %special;
+ my $expansion = "";
+ my $offset = 0;
+ $len = @list;
+ for ($i = 0; $i < $len / 5; $i++) {
+ print OUTPUT $i ? "\n + \"" : " = \"";
+ for $j (0 .. 4) {
+ last if $len <= $i * 5 + $j;
+ my $ch = $list[$i * 5 + $j];
+ print OUTPUT javaChar($ch);
+ print OUTPUT javaChar($offset);
+ $offset += @{$special{$ch}};
+ $expansion .= pack "n*", @{$special{$ch}};
+ }
+ print OUTPUT "\"";
+ }
+
+ print OUTPUT <<EOF;
+;
+
+ /**
+ * This is the listing of special case multi-character uppercase sequences.
+ * Characters listed in UPPER_SPECIAL index into this table to find their
+ * uppercase expansion. Remember that you must also perform special-casing
+ * on two single-character sequences in the Turkish locale, which are not
+ * covered here in CharData.
+ */
+ String UPPER_EXPAND
+EOF
+
+ $len = length($expansion) / 2;
+ for ($i = 0; $i < $len / 11; $i++) {
+ print OUTPUT $i ? "\n + \"" : " = \"";
+ for $j (0 .. 10) {
+ last if $len <= $i * 11 + $j;
+ my $val = unpack "n", substr($expansion, 2 * ($i * 11 + $j), 2);
+ print OUTPUT javaChar($val);
+ }
+ print OUTPUT "\"";
+ }
+
+ print OUTPUT ";\n}\n";
+ close OUTPUT;
+}
+print "\nDone.\n";
diff --git a/libjava/classpath/sun/misc/Service.java b/libjava/classpath/sun/misc/Service.java
new file mode 100644
index 00000000000..bdcbbfe2ff2
--- /dev/null
+++ b/libjava/classpath/sun/misc/Service.java
@@ -0,0 +1,66 @@
+/* Service.java -- A wrapper around GNU service provision.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package sun.misc;
+
+import gnu.classpath.ServiceFactory;
+
+import java.util.Iterator;
+
+public class Service
+{
+
+ /**
+ * Returns an {@link Iterator} over the service providers which
+ * provide a service of the given class, and are available from
+ * the specified classloader.
+ *
+ * @param c the service provider interface which must be
+ * implemented by any loaded service providers.
+ * @param cl the class loader that will be used to load the
+ * service providers, or <code>null</code> for the system class
+ * loader.
+ * @return an iterator over the service providers.
+ */
+ public static <P> Iterator<P> providers(Class<P> c, ClassLoader cl)
+ {
+ return (Iterator<P>) ServiceFactory.lookupProviders(c, cl);
+ }
+
+}
+
diff --git a/libjava/classpath/sun/misc/ServiceConfigurationError.java b/libjava/classpath/sun/misc/ServiceConfigurationError.java
new file mode 100644
index 00000000000..9c29d6e8c1e
--- /dev/null
+++ b/libjava/classpath/sun/misc/ServiceConfigurationError.java
@@ -0,0 +1,64 @@
+/* ServiceConfigurationError.java -- An error from service configuration.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package sun.misc;
+
+public class ServiceConfigurationError
+ extends Error
+{
+
+ /**
+ * Constructs a new {@link ServiceConfigurationError}
+ */
+ public ServiceConfigurationError()
+ {
+ super();
+ }
+
+ /**
+ * Constructs a new {@link ServiceConfigurationError}
+ * with the specified message.
+ */
+ public ServiceConfigurationError(String message)
+ {
+ super(message);
+ }
+
+
+}
+
diff --git a/libjava/classpath/sun/reflect/annotation/AnnotationInvocationHandler.java b/libjava/classpath/sun/reflect/annotation/AnnotationInvocationHandler.java
index ab9ad13d853..f132d81bad8 100644
--- a/libjava/classpath/sun/reflect/annotation/AnnotationInvocationHandler.java
+++ b/libjava/classpath/sun/reflect/annotation/AnnotationInvocationHandler.java
@@ -39,11 +39,13 @@ exception statement from your version. */
package sun.reflect.annotation;
import java.io.Serializable;
+import java.lang.annotation.Annotation;
import java.lang.annotation.AnnotationTypeMismatchException;
import java.lang.annotation.IncompleteAnnotationException;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Map;
@@ -74,6 +76,24 @@ public final class AnnotationInvocationHandler
this.memberValues = memberValues;
}
+ public static Annotation create(Class type, Map memberValues)
+ {
+ for (Method m : type.getDeclaredMethods())
+ {
+ String name = m.getName();
+ if (! memberValues.containsKey(name))
+ {
+ // FIXME: what to do about exceptions here?
+ memberValues.put(name, m.getDefaultValue());
+ }
+ }
+ AnnotationInvocationHandler handler
+ = new AnnotationInvocationHandler(type, memberValues);
+ return (Annotation) Proxy.newProxyInstance(type.getClassLoader(),
+ new Class[] { type },
+ handler);
+ }
+
/**
* Compare an instance of AnnotationInvocationHandler with another object.
* Note that the other object does not have to be an
@@ -295,6 +315,38 @@ public final class AnnotationInvocationHandler
return returnType;
}
+ private Object arrayClone(Object obj)
+ {
+ if (obj instanceof boolean[])
+ return ((boolean[]) obj).clone();
+
+ if (obj instanceof byte[])
+ return ((byte[]) obj).clone();
+
+ if (obj instanceof char[])
+ return ((char[]) obj).clone();
+
+ if (obj instanceof short[])
+ return ((short[]) obj).clone();
+
+ if (obj instanceof int[])
+ return ((int[]) obj).clone();
+
+ if (obj instanceof float[])
+ return ((float[]) obj).clone();
+
+ if (obj instanceof long[])
+ return ((long[]) obj).clone();
+
+ if (obj instanceof double[])
+ return ((double[]) obj).clone();
+
+ if (obj instanceof Object[])
+ return ((Object[]) obj).clone();
+
+ return obj;
+ }
+
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable
{
@@ -325,6 +377,10 @@ public final class AnnotationInvocationHandler
throw new AnnotationTypeMismatchException(method,
val.getClass().getName());
}
+ if (val.getClass().isArray())
+ {
+ val = arrayClone(val);
+ }
return val;
}
}
diff --git a/libjava/classpath/sun/reflect/annotation/AnnotationParser.java b/libjava/classpath/sun/reflect/annotation/AnnotationParser.java
new file mode 100644
index 00000000000..a5452d09014
--- /dev/null
+++ b/libjava/classpath/sun/reflect/annotation/AnnotationParser.java
@@ -0,0 +1,57 @@
+/* sun.reflect.annotation.AnnotationParser
+ Copyright (C) 2006
+ Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package sun.reflect.annotation;
+
+import gnu.classpath.NotImplementedException;
+
+import java.lang.annotation.Annotation;
+
+import java.util.Map;
+
+public class AnnotationParser
+{
+
+ public static Annotation annotationForMap(Class<? extends Annotation> annoType,
+ Map<String, Object> map)
+ throws NotImplementedException
+ {
+ return null;
+ }
+
+}
diff --git a/libjava/classpath/sun/reflect/annotation/AnnotationType.java b/libjava/classpath/sun/reflect/annotation/AnnotationType.java
new file mode 100644
index 00000000000..38d8aa8603c
--- /dev/null
+++ b/libjava/classpath/sun/reflect/annotation/AnnotationType.java
@@ -0,0 +1,52 @@
+/* sun.reflect.annotation.AnnotationType
+ Copyright (C) 2006
+ Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package sun.reflect.annotation;
+
+import gnu.classpath.NotImplementedException;
+
+public class AnnotationType
+{
+
+ public static Class<?> invocationHandlerReturnType(Class<?> returnClass)
+ throws NotImplementedException
+ {
+ return null;
+ }
+
+}
diff --git a/libjava/classpath/sun/reflect/annotation/EnumConstantNotPresentExceptionProxy.java b/libjava/classpath/sun/reflect/annotation/EnumConstantNotPresentExceptionProxy.java
new file mode 100644
index 00000000000..33b0daefa35
--- /dev/null
+++ b/libjava/classpath/sun/reflect/annotation/EnumConstantNotPresentExceptionProxy.java
@@ -0,0 +1,52 @@
+/* sun.reflect.annotation.EnumConstantNotPresentExceptionProxy
+ Copyright (C) 2006
+ Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package sun.reflect.annotation;
+
+import gnu.classpath.NotImplementedException;
+
+public class EnumConstantNotPresentExceptionProxy
+ extends ExceptionProxy
+{
+
+ public EnumConstantNotPresentExceptionProxy(Class c, String s)
+ throws NotImplementedException
+ {
+ }
+
+}
diff --git a/libjava/classpath/sun/reflect/annotation/ExceptionProxy.java b/libjava/classpath/sun/reflect/annotation/ExceptionProxy.java
new file mode 100644
index 00000000000..8edb361533c
--- /dev/null
+++ b/libjava/classpath/sun/reflect/annotation/ExceptionProxy.java
@@ -0,0 +1,46 @@
+/* sun.reflect.annotation.ExceptionProxy
+ Copyright (C) 2006
+ Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package sun.reflect.annotation;
+
+import gnu.classpath.NotImplementedException;
+
+public class ExceptionProxy
+{
+
+}
diff --git a/libjava/classpath/tools/.cvsignore b/libjava/classpath/tools/.cvsignore
index cf3688511ad..a013e8d1644 100644
--- a/libjava/classpath/tools/.cvsignore
+++ b/libjava/classpath/tools/.cvsignore
@@ -4,3 +4,16 @@ Makefile.in
Makefile
tools.zip
appletviewer
+.deps
+gappletviewer
+gjarsigner
+gkeytool
+gjar
+gnative2ascii
+gserialver
+gjavah
+gorbd
+grmic
+grmid
+grmiregistry
+gtnameserv
diff --git a/libjava/classpath/tools/Makefile.am b/libjava/classpath/tools/Makefile.am
index 01364f2411d..1d4cb6683ed 100755
--- a/libjava/classpath/tools/Makefile.am
+++ b/libjava/classpath/tools/Makefile.am
@@ -1,132 +1,133 @@
## Input file for automake to generate the Makefile.in used by configure
-GLIBJ_CLASSPATH='$(top_builddir)/lib':'$(top_builddir)/lib/glibj.zip'
+## GCJ LOCAL: use srcdir to find core classes.
+GLIBJ_BOOTCLASSPATH='$(top_srcdir)/lib'
+GLIBJ_CLASSPATH=$(srcdir)/asm
+## END GCJ LOCAL
# Setup the compiler to use the GNU Classpath library we just build
if FOUND_GCJ
-JCOMPILER = $(GCJ) -encoding UTF-8 --bootclasspath $(GLIBJ_CLASSPATH) --classpath . -C
-else
-if FOUND_JIKES
-JCOMPILER = $(JIKES) $(JIKESENCODING) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(GLIBJ_CLASSPATH):.
-else
-if FOUND_GCJX
-JCOMPILER = $(GCJX) -encoding UTF-8 -bootclasspath '' -sourcepath '' -classpath $(GLIBJ_CLASSPATH):.
+JCOMPILER = $(GCJ) -C -encoding UTF-8 -bootclasspath $(GLIBJ_BOOTCLASSPATH) -classpath $(GLIBJ_CLASSPATH):.
else
if FOUND_ECJ
-JCOMPILER = $(ECJ) -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath .
+JCOMPILER = $(ECJ) -1.5 -encoding UTF-8 -bootclasspath $(GLIBJ_BOOTCLASSPATH) -classpath .:$(GLIBJ_CLASSPATH)
else
error dunno how to setup the JCOMPILER and compile
endif
endif
-endif
-endif
-## GCJ LOCAL: do not build and install wrapper binaries here, since
-## the build ordering will not work. Instead build them in
-## gcc/libjava/Makefile.am.
-# if CREATE_WRAPPERS
-# bin_SCRIPTS =
-# bin_PROGRAMS = gappletviewer gjarsigner gkeytool \
-# gjar gnative2ascii gserialver
-#
-# if FOUND_GCJ
-# LIBJVM = -lgcj
-# else
-# if FOUND_CACAO
-# LIBJVM = -ljvm
-# else
-# LIBJVM =
-# endif
-# endif
-#
-# AM_CPPFLAGS = -Wall \
-# -I$(top_srcdir)/include \
-# -DTOOLS_ZIP="\"$(TOOLSdir)/$(TOOLS_ZIP)\""
-#
-# gappletviewer_SOURCES = toolwrapper.c
-# gappletviewer_CFLAGS = \
-# -DTOOLPACKAGE="\"appletviewer\"" \
-# -DTOOLNAME="\"gappletviewer\""
-# gappletviewer_LDFLAGS = -L$(libdir) $(LIBJVM)
-#
-# gjarsigner_SOURCES = toolwrapper.c
-# gjarsigner_CFLAGS = \
-# -DTOOLPACKAGE="\"jarsigner\"" \
-# -DTOOLNAME="\"gjarsigner\""
-# gjarsigner_LDFLAGS = -L$(libdir) $(LIBJVM)
-#
-# gkeytool_SOURCES = toolwrapper.c
-# gkeytool_CFLAGS = \
-# -DTOOLPACKAGE="\"keytool\"" \
-# -DTOOLNAME="\"gkeytool\""
-# gkeytool_LDFLAGS = -L$(libdir) $(LIBJVM)
-#
-# gjar_SOURCES = toolwrapper.c
-# gjar_CFLAGS = \
-# -DTOOLPACKAGE="\"jar\"" \
-# -DTOOLNAME="\"gjar\""
-# gjar_LDFLAGS = -L$(libdir) $(LIBJVM)
-#
-# gnative2ascii_SOURCES = toolwrapper.c
-# gnative2ascii_CFLAGS = \
-# -DTOOLPACKAGE="\"native2ascii\"" \
-# -DTOOLNAME="\"gnative2ascii\""
-# gnative2ascii_LDFLAGS = -L$(libdir) $(LIBJVM)
-#
-# gserialver_SOURCES = toolwrapper.c
-# gserialver_CFLAGS = \
-# -DTOOLPACKAGE="\"serialver\"" \
-# -DTOOLNAME="\"gserialver\""
-# gserialver_LDFLAGS = -L$(libdir) $(LIBJVM)
-#
-# else
-# bin_SCRIPTS = gappletviewer gjarsigner gkeytool \
-# gjar gnative2ascii gserialver
-# bin_PROGRAMS =
-# endif
-## END GCJ LOCAL
+if CREATE_WRAPPERS
+bin_SCRIPTS =
+bin_PROGRAMS = gappletviewer gjarsigner gkeytool \
+ gjar gnative2ascii gserialver gjavah grmiregistry \
+ gtnameserv gorbd grmid grmic
+
+
+AM_CPPFLAGS = -Wall \
+ -I$(top_srcdir)/include \
+ -DLIBJVM="\"$(libdir)/libjvm\"" \
+ -DTOOLS_ZIP="\"$(TOOLSdir)/$(TOOLS_ZIP)\""
+
+gappletviewer_SOURCES = toolwrapper.c
+gappletviewer_CFLAGS = \
+ -DTOOLPACKAGE="\"appletviewer\"" \
+ -DTOOLNAME="\"gappletviewer\""
+
+gjarsigner_SOURCES = toolwrapper.c
+gjarsigner_CFLAGS = \
+ -DTOOLPACKAGE="\"jarsigner\"" \
+ -DTOOLNAME="\"gjarsigner\""
+
+gkeytool_SOURCES = toolwrapper.c
+gkeytool_CFLAGS = \
+ -DTOOLPACKAGE="\"keytool\"" \
+ -DTOOLNAME="\"gkeytool\""
+
+gjar_SOURCES = toolwrapper.c
+gjar_CFLAGS = \
+ -DTOOLPACKAGE="\"jar\"" \
+ -DTOOLNAME="\"gjar\""
+
+gnative2ascii_SOURCES = toolwrapper.c
+gnative2ascii_CFLAGS = \
+ -DTOOLPACKAGE="\"native2ascii\"" \
+ -DTOOLNAME="\"gnative2ascii\""
+
+gserialver_SOURCES = toolwrapper.c
+gserialver_CFLAGS = \
+ -DTOOLPACKAGE="\"serialver\"" \
+ -DTOOLNAME="\"gserialver\""
+
+grmiregistry_SOURCES = toolwrapper.c
+grmiregistry_CFLAGS = \
+ -DTOOLPACKAGE="\"rmiregistry\"" \
+ -DTOOLNAME="\"grmiregistry\""
+
+gtnameserv_SOURCES = toolwrapper.c
+gtnameserv_CFLAGS = \
+ -DTOOLPACKAGE="\"tnameserv\"" \
+ -DTOOLNAME="\"gtnameserv\""
+
+gorbd_SOURCES = toolwrapper.c
+gorbd_CFLAGS = \
+ -DTOOLPACKAGE="\"orbd\"" \
+ -DTOOLNAME="\"gorbd\""
+
+grmid_SOURCES = toolwrapper.c
+grmid_CFLAGS = \
+ -DTOOLPACKAGE="\"rmid\"" \
+ -DTOOLNAME="\"grmid\""
+
+gjavah_SOURCES = toolwrapper.c
+gjavah_CFLAGS = \
+ -DTOOLPACKAGE="\"javah\"" \
+ -DTOOLNAME="\"gjavah\""
+
+grmic_SOURCES = toolwrapper.c
+grmic_CFLAGS = \
+ -DTOOLPACKAGE="\"rmic\"" \
+ -DTOOLNAME="\"grmic\""
+
+else
+bin_SCRIPTS = gappletviewer gjarsigner gkeytool \
+ gjar gnative2ascii gserialver gjavah grmiregistry \
+ gtnameserv gorbd grmid grmic
+bin_PROGRAMS =
+endif
EXTRA_DIST = toolwrapper.c gappletviewer.in gjarsigner.in gkeytool.in \
- gjar.in gnative2ascii.in gserialver.in
+ gjar.in gnative2ascii.in gserialver.in gjavah.in grmiregistry.in \
+ gtnameserv.in gorbd.in grmid.in grmic.in
# All our example java source files
-TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*.java $(srcdir)/gnu/classpath/tools/*/*.java $(srcdir)/gnu/classpath/tools/*/*/*.java
+TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/attrs/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/commons/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/optimizer/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/signature/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/tree/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/tree/analysis/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/util/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/util/attrs/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/xml/*.java
# The zip files with classes we want to produce.
-
-## GCJ LOCAL: rename this tools.jar for libgcj_tools_la_SOURCES in
-## gcc/libjava/Makefile.am.
-TOOLS_ZIP = tools.jar
+TOOLS_ZIP = tools.zip
# Extra objects that will not exist until configure-time
BUILT_SOURCES = $(TOOLS_ZIP)
-# The templates that must be included into the generated zip file.
-GRMIC_TEMPLATES = $(srcdir)/gnu/classpath/tools/giop/grmic/templates/*.jav
-RMIC_TEMPLATES = $(srcdir)/gnu/classpath/tools/rmi/rmic/templates/*.jav
-
-TOOLS_TEMPLATES = $(GRMIC_TEMPLATES) $(RMIC_TEMPLATES)
-
-# This covers the built-in help texts, both for giop and rmic subpackages.
-GIOP_HELPS = $(srcdir)/gnu/classpath/tools/giop/*.txt
-RMI_HELPS = $(srcdir)/gnu/classpath/tools/rmi/*.txt
-
-TOOLS_HELPS = $(GIOP_HELPS) $(RMI_HELPS)
-
-# The tool specific README files.
-READMES = $(srcdir)/gnu/classpath/tools/giop/README
+# RMIC templates that must be included in the generated zip file.
+RMIC_TEMPLATES = $(srcdir)/gnu/classpath/tools/rmic/templates/*.jav
# All the files we find "interesting"
-ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(TOOLS_TEMPLATES) $(TOOLS_HELPS)
+ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(RMIC_TEMPLATES)
-## GCJ LOCAL: build tools.zip but do not install it. It is installed
-## in gcc/libjava/Makefile.am.
-# # Some architecture independent data to be installed.
-# TOOLS_DATA = $(TOOLS_ZIP)
-noinst_DATA = $(TOOLS_ZIP)
+# Some architecture independent data to be installed.
+TOOLS_DATA = $(TOOLS_ZIP)
# Where we want these data files installed.
-## GCJ LOCAL: install libgcj-tools.jar alongside libgcj.jar.
-# TOOLSdir = $(datadir)/java
+TOOLSdir = $(pkgdatadir)
# Make sure everything is included in the distribution.
dist-hook:
@@ -146,26 +147,45 @@ dist-hook:
# the class files. Always regenerate all .class files and remove them
# immediately. And copy the template files we use to the classes dir
# so they get also included.
-## GCJ LOCAL: assume FASTJAR since we pass --with-fastjar to configure
$(TOOLS_ZIP): $(TOOLS_JAVA_FILES)
- mkdir -p classes/gnu/classpath/tools/giop/grmic/templates
- mkdir -p classes/gnu/classpath/tools/rmi/rmic/templates
- mkdir -p classes/gnu/classpath/tools/appletviewer
- mkdir -p classes/gnu/classpath/tools/jarsigner
- mkdir -p classes/gnu/classpath/tools/keytool
- cp $(RMIC_TEMPLATES) classes/gnu/classpath/tools/rmi/rmic/templates
- cp $(GRMIC_TEMPLATES) classes/gnu/classpath/tools/giop/grmic/templates
- cp $(RMI_HELPS) classes/gnu/classpath/tools/rmi/
- cp $(GIOP_HELPS) classes/gnu/classpath/tools/giop/
- $(JCOMPILER) -d classes $(TOOLS_JAVA_FILES)
+## GCJ LOCAL: put classes in srcdir
+## @rm -rf classes asm
+## mkdir classes asm
+ find $(srcdir)/external/asm -name '*.java' -print > asm.lst
+ find $(srcdir)/gnu/classpath/tools -name '*.java' -print > classes.lst
+ cat classes.lst asm.lst > all-classes.lst
+if JAVA_MAINTAINER_MODE
+## Compile ASM separately as it is latin-1 encoded.
+ AC=`echo $(JCOMPILER) | sed -e 's/UTF-8/ISO-8859-1/g'`; \
+ $$AC -g -w -d $(srcdir)/asm @asm.lst
+ $(JCOMPILER) -g -w -d $(srcdir)/classes @classes.lst
+## Copy over tools resource files.
+ @list=`cd $(top_srcdir)/resource && find gnu/classpath/tools -name \*.properties -print`; \
+ for p in $$list; do \
+ dirname=classes/`dirname $$p`; \
+ if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
+ echo " cp $(top_srcdir)/resource/$$p classes/$$p"; \
+ cp $(top_srcdir)/resource/$$p classes/$$p; \
+ done
+endif
+ cp -pR $(srcdir)/asm .
+ cp -pR $(srcdir)/classes .
+## END GCJ LOCAL
+## First add classpath tools stuff.
(cd classes; \
- $(FASTJAR) cf ../$(TOOLS_ZIP) .; \
+ if test "$(ZIP)" != ""; then $(ZIP) -r ../$(TOOLS_ZIP) .; fi; \
+ if test "$(FASTJAR)" != ""; then $(FASTJAR) cf ../$(TOOLS_ZIP) .; fi; \
+ cd ..)
+## Now add ASM classes.
+ (cd asm; \
+ if test "$(ZIP)" != ""; then $(ZIP) -u -r ../$(TOOLS_ZIP) .; fi; \
+ if test "$(FASTJAR)" != ""; then $(FASTJAR) uf ../$(TOOLS_ZIP) .; fi; \
cd ..)
- rm -rf classes
+ rm -rf asm classes classes.lst asm.lst
# Zip file be gone! (and make sure the classes are gone too)
clean-local:
- rm -rf $(TOOLS_ZIP) classes
+ rm -rf $(TOOLS_ZIP) classes asm asm.lst
# FIXME: remove this when GNU Classpath includes a bootstrap VM.
installcheck-binSCRIPTS:
diff --git a/libjava/classpath/tools/Makefile.in b/libjava/classpath/tools/Makefile.in
index 9723e4235ba..a8ddc832444 100644
--- a/libjava/classpath/tools/Makefile.in
+++ b/libjava/classpath/tools/Makefile.in
@@ -14,6 +14,8 @@
@SET_MAKE@
+
+
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
@@ -37,31 +39,134 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
+@CREATE_WRAPPERS_TRUE@bin_PROGRAMS = gappletviewer$(EXEEXT) \
+@CREATE_WRAPPERS_TRUE@ gjarsigner$(EXEEXT) gkeytool$(EXEEXT) \
+@CREATE_WRAPPERS_TRUE@ gjar$(EXEEXT) gnative2ascii$(EXEEXT) \
+@CREATE_WRAPPERS_TRUE@ gserialver$(EXEEXT) gjavah$(EXEEXT) \
+@CREATE_WRAPPERS_TRUE@ grmiregistry$(EXEEXT) \
+@CREATE_WRAPPERS_TRUE@ gtnameserv$(EXEEXT) gorbd$(EXEEXT) \
+@CREATE_WRAPPERS_TRUE@ grmid$(EXEEXT) grmic$(EXEEXT)
subdir = tools
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/appletviewer.in $(srcdir)/gappletviewer.in \
- $(srcdir)/gjar.in $(srcdir)/gjarsigner.in \
+ $(srcdir)/gappletviewer.in $(srcdir)/gjar.in \
+ $(srcdir)/gjarsigner.in $(srcdir)/gjavah.in \
$(srcdir)/gkeytool.in $(srcdir)/gnative2ascii.in \
- $(srcdir)/gserialver.in $(srcdir)/jarsigner.in \
- $(srcdir)/keytool.in
+ $(srcdir)/gorbd.in $(srcdir)/grmic.in $(srcdir)/grmid.in \
+ $(srcdir)/grmiregistry.in $(srcdir)/gserialver.in \
+ $(srcdir)/gtnameserv.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
+ $(top_srcdir)/../../config/no-executables.m4 \
$(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
$(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
- $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES = gappletviewer gjarsigner gkeytool gjar \
- gnative2ascii gserialver appletviewer jarsigner keytool
-SOURCES =
-DIST_SOURCES =
-DATA = $(noinst_DATA)
+ gnative2ascii gserialver grmiregistry gtnameserv gorbd grmid \
+ grmic gjavah
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \
+ "$(DESTDIR)$(TOOLSdir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am__gappletviewer_SOURCES_DIST = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@am_gappletviewer_OBJECTS = \
+@CREATE_WRAPPERS_TRUE@ gappletviewer-toolwrapper.$(OBJEXT)
+gappletviewer_OBJECTS = $(am_gappletviewer_OBJECTS)
+gappletviewer_LDADD = $(LDADD)
+am__gjar_SOURCES_DIST = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@am_gjar_OBJECTS = gjar-toolwrapper.$(OBJEXT)
+gjar_OBJECTS = $(am_gjar_OBJECTS)
+gjar_LDADD = $(LDADD)
+am__gjarsigner_SOURCES_DIST = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@am_gjarsigner_OBJECTS = \
+@CREATE_WRAPPERS_TRUE@ gjarsigner-toolwrapper.$(OBJEXT)
+gjarsigner_OBJECTS = $(am_gjarsigner_OBJECTS)
+gjarsigner_LDADD = $(LDADD)
+am__gjavah_SOURCES_DIST = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@am_gjavah_OBJECTS = \
+@CREATE_WRAPPERS_TRUE@ gjavah-toolwrapper.$(OBJEXT)
+gjavah_OBJECTS = $(am_gjavah_OBJECTS)
+gjavah_LDADD = $(LDADD)
+am__gkeytool_SOURCES_DIST = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@am_gkeytool_OBJECTS = \
+@CREATE_WRAPPERS_TRUE@ gkeytool-toolwrapper.$(OBJEXT)
+gkeytool_OBJECTS = $(am_gkeytool_OBJECTS)
+gkeytool_LDADD = $(LDADD)
+am__gnative2ascii_SOURCES_DIST = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@am_gnative2ascii_OBJECTS = \
+@CREATE_WRAPPERS_TRUE@ gnative2ascii-toolwrapper.$(OBJEXT)
+gnative2ascii_OBJECTS = $(am_gnative2ascii_OBJECTS)
+gnative2ascii_LDADD = $(LDADD)
+am__gorbd_SOURCES_DIST = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@am_gorbd_OBJECTS = gorbd-toolwrapper.$(OBJEXT)
+gorbd_OBJECTS = $(am_gorbd_OBJECTS)
+gorbd_LDADD = $(LDADD)
+am__grmic_SOURCES_DIST = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@am_grmic_OBJECTS = grmic-toolwrapper.$(OBJEXT)
+grmic_OBJECTS = $(am_grmic_OBJECTS)
+grmic_LDADD = $(LDADD)
+am__grmid_SOURCES_DIST = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@am_grmid_OBJECTS = grmid-toolwrapper.$(OBJEXT)
+grmid_OBJECTS = $(am_grmid_OBJECTS)
+grmid_LDADD = $(LDADD)
+am__grmiregistry_SOURCES_DIST = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@am_grmiregistry_OBJECTS = \
+@CREATE_WRAPPERS_TRUE@ grmiregistry-toolwrapper.$(OBJEXT)
+grmiregistry_OBJECTS = $(am_grmiregistry_OBJECTS)
+grmiregistry_LDADD = $(LDADD)
+am__gserialver_SOURCES_DIST = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@am_gserialver_OBJECTS = \
+@CREATE_WRAPPERS_TRUE@ gserialver-toolwrapper.$(OBJEXT)
+gserialver_OBJECTS = $(am_gserialver_OBJECTS)
+gserialver_LDADD = $(LDADD)
+am__gtnameserv_SOURCES_DIST = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@am_gtnameserv_OBJECTS = \
+@CREATE_WRAPPERS_TRUE@ gtnameserv-toolwrapper.$(OBJEXT)
+gtnameserv_OBJECTS = $(am_gtnameserv_OBJECTS)
+gtnameserv_LDADD = $(LDADD)
+binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(bin_SCRIPTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(gappletviewer_SOURCES) $(gjar_SOURCES) \
+ $(gjarsigner_SOURCES) $(gjavah_SOURCES) $(gkeytool_SOURCES) \
+ $(gnative2ascii_SOURCES) $(gorbd_SOURCES) $(grmic_SOURCES) \
+ $(grmid_SOURCES) $(grmiregistry_SOURCES) $(gserialver_SOURCES) \
+ $(gtnameserv_SOURCES)
+DIST_SOURCES = $(am__gappletviewer_SOURCES_DIST) \
+ $(am__gjar_SOURCES_DIST) $(am__gjarsigner_SOURCES_DIST) \
+ $(am__gjavah_SOURCES_DIST) $(am__gkeytool_SOURCES_DIST) \
+ $(am__gnative2ascii_SOURCES_DIST) $(am__gorbd_SOURCES_DIST) \
+ $(am__grmic_SOURCES_DIST) $(am__grmid_SOURCES_DIST) \
+ $(am__grmiregistry_SOURCES_DIST) \
+ $(am__gserialver_SOURCES_DIST) $(am__gtnameserv_SOURCES_DIST)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+TOOLSDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(TOOLS_DATA)
+ETAGS = etags
+CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
@@ -165,6 +270,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
+JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
JAY = @JAY@
JAY_SKELETON = @JAY_SKELETON@
JIKES = @JIKES@
@@ -286,112 +393,124 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
-GLIBJ_CLASSPATH = '$(top_builddir)/lib':'$(top_builddir)/lib/glibj.zip'
-@FOUND_ECJ_TRUE@@FOUND_GCJX_FALSE@@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@JCOMPILER = $(ECJ) -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath .
-@FOUND_GCJX_TRUE@@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@JCOMPILER = $(GCJX) -encoding UTF-8 -bootclasspath '' -sourcepath '' -classpath $(GLIBJ_CLASSPATH):.
-@FOUND_GCJ_FALSE@@FOUND_JIKES_TRUE@JCOMPILER = $(JIKES) $(JIKESENCODING) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(GLIBJ_CLASSPATH):.
+GLIBJ_BOOTCLASSPATH = '$(top_srcdir)/lib'
+GLIBJ_CLASSPATH = $(srcdir)/asm
+@FOUND_ECJ_TRUE@@FOUND_GCJ_FALSE@JCOMPILER = $(ECJ) -1.5 -encoding UTF-8 -bootclasspath $(GLIBJ_BOOTCLASSPATH) -classpath .:$(GLIBJ_CLASSPATH)
# Setup the compiler to use the GNU Classpath library we just build
-@FOUND_GCJ_TRUE@JCOMPILER = $(GCJ) -encoding UTF-8 --bootclasspath $(GLIBJ_CLASSPATH) --classpath . -C
-
-# if CREATE_WRAPPERS
-# bin_SCRIPTS =
-# bin_PROGRAMS = gappletviewer gjarsigner gkeytool \
-# gjar gnative2ascii gserialver
-#
-# if FOUND_GCJ
-# LIBJVM = -lgcj
-# else
-# if FOUND_CACAO
-# LIBJVM = -ljvm
-# else
-# LIBJVM =
-# endif
-# endif
-#
-# AM_CPPFLAGS = -Wall \
-# -I$(top_srcdir)/include \
-# -DTOOLS_ZIP="\"$(TOOLSdir)/$(TOOLS_ZIP)\""
-#
-# gappletviewer_SOURCES = toolwrapper.c
-# gappletviewer_CFLAGS = \
-# -DTOOLPACKAGE="\"appletviewer\"" \
-# -DTOOLNAME="\"gappletviewer\""
-# gappletviewer_LDFLAGS = -L$(libdir) $(LIBJVM)
-#
-# gjarsigner_SOURCES = toolwrapper.c
-# gjarsigner_CFLAGS = \
-# -DTOOLPACKAGE="\"jarsigner\"" \
-# -DTOOLNAME="\"gjarsigner\""
-# gjarsigner_LDFLAGS = -L$(libdir) $(LIBJVM)
-#
-# gkeytool_SOURCES = toolwrapper.c
-# gkeytool_CFLAGS = \
-# -DTOOLPACKAGE="\"keytool\"" \
-# -DTOOLNAME="\"gkeytool\""
-# gkeytool_LDFLAGS = -L$(libdir) $(LIBJVM)
-#
-# gjar_SOURCES = toolwrapper.c
-# gjar_CFLAGS = \
-# -DTOOLPACKAGE="\"jar\"" \
-# -DTOOLNAME="\"gjar\""
-# gjar_LDFLAGS = -L$(libdir) $(LIBJVM)
-#
-# gnative2ascii_SOURCES = toolwrapper.c
-# gnative2ascii_CFLAGS = \
-# -DTOOLPACKAGE="\"native2ascii\"" \
-# -DTOOLNAME="\"gnative2ascii\""
-# gnative2ascii_LDFLAGS = -L$(libdir) $(LIBJVM)
-#
-# gserialver_SOURCES = toolwrapper.c
-# gserialver_CFLAGS = \
-# -DTOOLPACKAGE="\"serialver\"" \
-# -DTOOLNAME="\"gserialver\""
-# gserialver_LDFLAGS = -L$(libdir) $(LIBJVM)
-#
-# else
-# bin_SCRIPTS = gappletviewer gjarsigner gkeytool \
-# gjar gnative2ascii gserialver
-# bin_PROGRAMS =
-# endif
+@FOUND_GCJ_TRUE@JCOMPILER = $(GCJ) -C -encoding UTF-8 -bootclasspath $(GLIBJ_BOOTCLASSPATH) -classpath $(GLIBJ_CLASSPATH):.
+@CREATE_WRAPPERS_FALSE@bin_SCRIPTS = gappletviewer gjarsigner gkeytool \
+@CREATE_WRAPPERS_FALSE@ gjar gnative2ascii gserialver gjavah grmiregistry \
+@CREATE_WRAPPERS_FALSE@ gtnameserv gorbd grmid grmic
+
+@CREATE_WRAPPERS_TRUE@bin_SCRIPTS =
+@CREATE_WRAPPERS_TRUE@AM_CPPFLAGS = -Wall \
+@CREATE_WRAPPERS_TRUE@ -I$(top_srcdir)/include \
+@CREATE_WRAPPERS_TRUE@ -DLIBJVM="\"$(libdir)/libjvm\"" \
+@CREATE_WRAPPERS_TRUE@ -DTOOLS_ZIP="\"$(TOOLSdir)/$(TOOLS_ZIP)\""
+
+@CREATE_WRAPPERS_TRUE@gappletviewer_SOURCES = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@gappletviewer_CFLAGS = \
+@CREATE_WRAPPERS_TRUE@ -DTOOLPACKAGE="\"appletviewer\"" \
+@CREATE_WRAPPERS_TRUE@ -DTOOLNAME="\"gappletviewer\""
+
+@CREATE_WRAPPERS_TRUE@gjarsigner_SOURCES = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@gjarsigner_CFLAGS = \
+@CREATE_WRAPPERS_TRUE@ -DTOOLPACKAGE="\"jarsigner\"" \
+@CREATE_WRAPPERS_TRUE@ -DTOOLNAME="\"gjarsigner\""
+
+@CREATE_WRAPPERS_TRUE@gkeytool_SOURCES = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@gkeytool_CFLAGS = \
+@CREATE_WRAPPERS_TRUE@ -DTOOLPACKAGE="\"keytool\"" \
+@CREATE_WRAPPERS_TRUE@ -DTOOLNAME="\"gkeytool\""
+
+@CREATE_WRAPPERS_TRUE@gjar_SOURCES = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@gjar_CFLAGS = \
+@CREATE_WRAPPERS_TRUE@ -DTOOLPACKAGE="\"jar\"" \
+@CREATE_WRAPPERS_TRUE@ -DTOOLNAME="\"gjar\""
+
+@CREATE_WRAPPERS_TRUE@gnative2ascii_SOURCES = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@gnative2ascii_CFLAGS = \
+@CREATE_WRAPPERS_TRUE@ -DTOOLPACKAGE="\"native2ascii\"" \
+@CREATE_WRAPPERS_TRUE@ -DTOOLNAME="\"gnative2ascii\""
+
+@CREATE_WRAPPERS_TRUE@gserialver_SOURCES = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@gserialver_CFLAGS = \
+@CREATE_WRAPPERS_TRUE@ -DTOOLPACKAGE="\"serialver\"" \
+@CREATE_WRAPPERS_TRUE@ -DTOOLNAME="\"gserialver\""
+
+@CREATE_WRAPPERS_TRUE@grmiregistry_SOURCES = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@grmiregistry_CFLAGS = \
+@CREATE_WRAPPERS_TRUE@ -DTOOLPACKAGE="\"rmiregistry\"" \
+@CREATE_WRAPPERS_TRUE@ -DTOOLNAME="\"grmiregistry\""
+
+@CREATE_WRAPPERS_TRUE@gtnameserv_SOURCES = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@gtnameserv_CFLAGS = \
+@CREATE_WRAPPERS_TRUE@ -DTOOLPACKAGE="\"tnameserv\"" \
+@CREATE_WRAPPERS_TRUE@ -DTOOLNAME="\"gtnameserv\""
+
+@CREATE_WRAPPERS_TRUE@gorbd_SOURCES = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@gorbd_CFLAGS = \
+@CREATE_WRAPPERS_TRUE@ -DTOOLPACKAGE="\"orbd\"" \
+@CREATE_WRAPPERS_TRUE@ -DTOOLNAME="\"gorbd\""
+
+@CREATE_WRAPPERS_TRUE@grmid_SOURCES = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@grmid_CFLAGS = \
+@CREATE_WRAPPERS_TRUE@ -DTOOLPACKAGE="\"rmid\"" \
+@CREATE_WRAPPERS_TRUE@ -DTOOLNAME="\"grmid\""
+
+@CREATE_WRAPPERS_TRUE@gjavah_SOURCES = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@gjavah_CFLAGS = \
+@CREATE_WRAPPERS_TRUE@ -DTOOLPACKAGE="\"javah\"" \
+@CREATE_WRAPPERS_TRUE@ -DTOOLNAME="\"gjavah\""
+
+@CREATE_WRAPPERS_TRUE@grmic_SOURCES = toolwrapper.c
+@CREATE_WRAPPERS_TRUE@grmic_CFLAGS = \
+@CREATE_WRAPPERS_TRUE@ -DTOOLPACKAGE="\"rmic\"" \
+@CREATE_WRAPPERS_TRUE@ -DTOOLNAME="\"grmic\""
+
EXTRA_DIST = toolwrapper.c gappletviewer.in gjarsigner.in gkeytool.in \
- gjar.in gnative2ascii.in gserialver.in
+ gjar.in gnative2ascii.in gserialver.in gjavah.in grmiregistry.in \
+ gtnameserv.in gorbd.in grmid.in grmic.in
# All our example java source files
-TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*.java $(srcdir)/gnu/classpath/tools/*/*.java $(srcdir)/gnu/classpath/tools/*/*/*.java
+TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/attrs/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/commons/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/optimizer/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/signature/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/tree/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/tree/analysis/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/util/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/util/attrs/*.java \
+ $(srcdir)/external/asm/org/objectweb/asm/xml/*.java
+
# The zip files with classes we want to produce.
-TOOLS_ZIP = tools.jar
+TOOLS_ZIP = tools.zip
# Extra objects that will not exist until configure-time
BUILT_SOURCES = $(TOOLS_ZIP)
-# The templates that must be included into the generated zip file.
-GRMIC_TEMPLATES = $(srcdir)/gnu/classpath/tools/giop/grmic/templates/*.jav
-RMIC_TEMPLATES = $(srcdir)/gnu/classpath/tools/rmi/rmic/templates/*.jav
-TOOLS_TEMPLATES = $(GRMIC_TEMPLATES) $(RMIC_TEMPLATES)
-
-# This covers the built-in help texts, both for giop and rmic subpackages.
-GIOP_HELPS = $(srcdir)/gnu/classpath/tools/giop/*.txt
-RMI_HELPS = $(srcdir)/gnu/classpath/tools/rmi/*.txt
-TOOLS_HELPS = $(GIOP_HELPS) $(RMI_HELPS)
-
-# The tool specific README files.
-READMES = $(srcdir)/gnu/classpath/tools/giop/README
+# RMIC templates that must be included in the generated zip file.
+RMIC_TEMPLATES = $(srcdir)/gnu/classpath/tools/rmic/templates/*.jav
# All the files we find "interesting"
-ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(TOOLS_TEMPLATES) $(TOOLS_HELPS)
+ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(RMIC_TEMPLATES)
-# # Some architecture independent data to be installed.
-# TOOLS_DATA = $(TOOLS_ZIP)
-noinst_DATA = $(TOOLS_ZIP)
+# Some architecture independent data to be installed.
+TOOLS_DATA = $(TOOLS_ZIP)
+
+# Where we want these data files installed.
+TOOLSdir = $(pkgdatadir)
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@@ -433,12 +552,325 @@ gnative2ascii: $(top_builddir)/config.status $(srcdir)/gnative2ascii.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
gserialver: $(top_builddir)/config.status $(srcdir)/gserialver.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-appletviewer: $(top_builddir)/config.status $(srcdir)/appletviewer.in
+grmiregistry: $(top_builddir)/config.status $(srcdir)/grmiregistry.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+gtnameserv: $(top_builddir)/config.status $(srcdir)/gtnameserv.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+gorbd: $(top_builddir)/config.status $(srcdir)/gorbd.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+grmid: $(top_builddir)/config.status $(srcdir)/grmid.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-jarsigner: $(top_builddir)/config.status $(srcdir)/jarsigner.in
+grmic: $(top_builddir)/config.status $(srcdir)/grmic.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-keytool: $(top_builddir)/config.status $(srcdir)/keytool.in
+gjavah: $(top_builddir)/config.status $(srcdir)/gjavah.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+
+installcheck-binPROGRAMS: $(bin_PROGRAMS)
+ bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
+ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
+ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \
+ esac; \
+ f=`echo "$$p" | \
+ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ for opt in --help --version; do \
+ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \
+ 2>c$${pid}_.err </dev/null \
+ && test -n "`cat c$${pid}_.out`" \
+ && test -z "`cat c$${pid}_.err`"; then :; \
+ else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
+ done; \
+ done; rm -f c$${pid}_.???; exit $$bad
+gappletviewer$(EXEEXT): $(gappletviewer_OBJECTS) $(gappletviewer_DEPENDENCIES)
+ @rm -f gappletviewer$(EXEEXT)
+ $(LINK) $(gappletviewer_LDFLAGS) $(gappletviewer_OBJECTS) $(gappletviewer_LDADD) $(LIBS)
+gjar$(EXEEXT): $(gjar_OBJECTS) $(gjar_DEPENDENCIES)
+ @rm -f gjar$(EXEEXT)
+ $(LINK) $(gjar_LDFLAGS) $(gjar_OBJECTS) $(gjar_LDADD) $(LIBS)
+gjarsigner$(EXEEXT): $(gjarsigner_OBJECTS) $(gjarsigner_DEPENDENCIES)
+ @rm -f gjarsigner$(EXEEXT)
+ $(LINK) $(gjarsigner_LDFLAGS) $(gjarsigner_OBJECTS) $(gjarsigner_LDADD) $(LIBS)
+gjavah$(EXEEXT): $(gjavah_OBJECTS) $(gjavah_DEPENDENCIES)
+ @rm -f gjavah$(EXEEXT)
+ $(LINK) $(gjavah_LDFLAGS) $(gjavah_OBJECTS) $(gjavah_LDADD) $(LIBS)
+gkeytool$(EXEEXT): $(gkeytool_OBJECTS) $(gkeytool_DEPENDENCIES)
+ @rm -f gkeytool$(EXEEXT)
+ $(LINK) $(gkeytool_LDFLAGS) $(gkeytool_OBJECTS) $(gkeytool_LDADD) $(LIBS)
+gnative2ascii$(EXEEXT): $(gnative2ascii_OBJECTS) $(gnative2ascii_DEPENDENCIES)
+ @rm -f gnative2ascii$(EXEEXT)
+ $(LINK) $(gnative2ascii_LDFLAGS) $(gnative2ascii_OBJECTS) $(gnative2ascii_LDADD) $(LIBS)
+gorbd$(EXEEXT): $(gorbd_OBJECTS) $(gorbd_DEPENDENCIES)
+ @rm -f gorbd$(EXEEXT)
+ $(LINK) $(gorbd_LDFLAGS) $(gorbd_OBJECTS) $(gorbd_LDADD) $(LIBS)
+grmic$(EXEEXT): $(grmic_OBJECTS) $(grmic_DEPENDENCIES)
+ @rm -f grmic$(EXEEXT)
+ $(LINK) $(grmic_LDFLAGS) $(grmic_OBJECTS) $(grmic_LDADD) $(LIBS)
+grmid$(EXEEXT): $(grmid_OBJECTS) $(grmid_DEPENDENCIES)
+ @rm -f grmid$(EXEEXT)
+ $(LINK) $(grmid_LDFLAGS) $(grmid_OBJECTS) $(grmid_LDADD) $(LIBS)
+grmiregistry$(EXEEXT): $(grmiregistry_OBJECTS) $(grmiregistry_DEPENDENCIES)
+ @rm -f grmiregistry$(EXEEXT)
+ $(LINK) $(grmiregistry_LDFLAGS) $(grmiregistry_OBJECTS) $(grmiregistry_LDADD) $(LIBS)
+gserialver$(EXEEXT): $(gserialver_OBJECTS) $(gserialver_DEPENDENCIES)
+ @rm -f gserialver$(EXEEXT)
+ $(LINK) $(gserialver_LDFLAGS) $(gserialver_OBJECTS) $(gserialver_LDADD) $(LIBS)
+gtnameserv$(EXEEXT): $(gtnameserv_OBJECTS) $(gtnameserv_DEPENDENCIES)
+ @rm -f gtnameserv$(EXEEXT)
+ $(LINK) $(gtnameserv_LDFLAGS) $(gtnameserv_OBJECTS) $(gtnameserv_LDADD) $(LIBS)
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p; then \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gappletviewer-toolwrapper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gjar-toolwrapper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gjarsigner-toolwrapper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gjavah-toolwrapper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gkeytool-toolwrapper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnative2ascii-toolwrapper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gorbd-toolwrapper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grmic-toolwrapper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grmid-toolwrapper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grmiregistry-toolwrapper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gserialver-toolwrapper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtnameserv-toolwrapper.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+gappletviewer-toolwrapper.o: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gappletviewer_CFLAGS) $(CFLAGS) -MT gappletviewer-toolwrapper.o -MD -MP -MF "$(DEPDIR)/gappletviewer-toolwrapper.Tpo" -c -o gappletviewer-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gappletviewer-toolwrapper.Tpo" "$(DEPDIR)/gappletviewer-toolwrapper.Po"; else rm -f "$(DEPDIR)/gappletviewer-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gappletviewer-toolwrapper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gappletviewer_CFLAGS) $(CFLAGS) -c -o gappletviewer-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c
+
+gappletviewer-toolwrapper.obj: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gappletviewer_CFLAGS) $(CFLAGS) -MT gappletviewer-toolwrapper.obj -MD -MP -MF "$(DEPDIR)/gappletviewer-toolwrapper.Tpo" -c -o gappletviewer-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gappletviewer-toolwrapper.Tpo" "$(DEPDIR)/gappletviewer-toolwrapper.Po"; else rm -f "$(DEPDIR)/gappletviewer-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gappletviewer-toolwrapper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gappletviewer_CFLAGS) $(CFLAGS) -c -o gappletviewer-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`
+
+gjar-toolwrapper.o: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjar_CFLAGS) $(CFLAGS) -MT gjar-toolwrapper.o -MD -MP -MF "$(DEPDIR)/gjar-toolwrapper.Tpo" -c -o gjar-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gjar-toolwrapper.Tpo" "$(DEPDIR)/gjar-toolwrapper.Po"; else rm -f "$(DEPDIR)/gjar-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gjar-toolwrapper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjar_CFLAGS) $(CFLAGS) -c -o gjar-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c
+
+gjar-toolwrapper.obj: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjar_CFLAGS) $(CFLAGS) -MT gjar-toolwrapper.obj -MD -MP -MF "$(DEPDIR)/gjar-toolwrapper.Tpo" -c -o gjar-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gjar-toolwrapper.Tpo" "$(DEPDIR)/gjar-toolwrapper.Po"; else rm -f "$(DEPDIR)/gjar-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gjar-toolwrapper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjar_CFLAGS) $(CFLAGS) -c -o gjar-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`
+
+gjarsigner-toolwrapper.o: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjarsigner_CFLAGS) $(CFLAGS) -MT gjarsigner-toolwrapper.o -MD -MP -MF "$(DEPDIR)/gjarsigner-toolwrapper.Tpo" -c -o gjarsigner-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gjarsigner-toolwrapper.Tpo" "$(DEPDIR)/gjarsigner-toolwrapper.Po"; else rm -f "$(DEPDIR)/gjarsigner-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gjarsigner-toolwrapper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjarsigner_CFLAGS) $(CFLAGS) -c -o gjarsigner-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c
+
+gjarsigner-toolwrapper.obj: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjarsigner_CFLAGS) $(CFLAGS) -MT gjarsigner-toolwrapper.obj -MD -MP -MF "$(DEPDIR)/gjarsigner-toolwrapper.Tpo" -c -o gjarsigner-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gjarsigner-toolwrapper.Tpo" "$(DEPDIR)/gjarsigner-toolwrapper.Po"; else rm -f "$(DEPDIR)/gjarsigner-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gjarsigner-toolwrapper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjarsigner_CFLAGS) $(CFLAGS) -c -o gjarsigner-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`
+
+gjavah-toolwrapper.o: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjavah_CFLAGS) $(CFLAGS) -MT gjavah-toolwrapper.o -MD -MP -MF "$(DEPDIR)/gjavah-toolwrapper.Tpo" -c -o gjavah-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gjavah-toolwrapper.Tpo" "$(DEPDIR)/gjavah-toolwrapper.Po"; else rm -f "$(DEPDIR)/gjavah-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gjavah-toolwrapper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjavah_CFLAGS) $(CFLAGS) -c -o gjavah-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c
+
+gjavah-toolwrapper.obj: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjavah_CFLAGS) $(CFLAGS) -MT gjavah-toolwrapper.obj -MD -MP -MF "$(DEPDIR)/gjavah-toolwrapper.Tpo" -c -o gjavah-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gjavah-toolwrapper.Tpo" "$(DEPDIR)/gjavah-toolwrapper.Po"; else rm -f "$(DEPDIR)/gjavah-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gjavah-toolwrapper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjavah_CFLAGS) $(CFLAGS) -c -o gjavah-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`
+
+gkeytool-toolwrapper.o: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gkeytool_CFLAGS) $(CFLAGS) -MT gkeytool-toolwrapper.o -MD -MP -MF "$(DEPDIR)/gkeytool-toolwrapper.Tpo" -c -o gkeytool-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gkeytool-toolwrapper.Tpo" "$(DEPDIR)/gkeytool-toolwrapper.Po"; else rm -f "$(DEPDIR)/gkeytool-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gkeytool-toolwrapper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gkeytool_CFLAGS) $(CFLAGS) -c -o gkeytool-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c
+
+gkeytool-toolwrapper.obj: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gkeytool_CFLAGS) $(CFLAGS) -MT gkeytool-toolwrapper.obj -MD -MP -MF "$(DEPDIR)/gkeytool-toolwrapper.Tpo" -c -o gkeytool-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gkeytool-toolwrapper.Tpo" "$(DEPDIR)/gkeytool-toolwrapper.Po"; else rm -f "$(DEPDIR)/gkeytool-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gkeytool-toolwrapper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gkeytool_CFLAGS) $(CFLAGS) -c -o gkeytool-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`
+
+gnative2ascii-toolwrapper.o: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gnative2ascii_CFLAGS) $(CFLAGS) -MT gnative2ascii-toolwrapper.o -MD -MP -MF "$(DEPDIR)/gnative2ascii-toolwrapper.Tpo" -c -o gnative2ascii-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gnative2ascii-toolwrapper.Tpo" "$(DEPDIR)/gnative2ascii-toolwrapper.Po"; else rm -f "$(DEPDIR)/gnative2ascii-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gnative2ascii-toolwrapper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gnative2ascii_CFLAGS) $(CFLAGS) -c -o gnative2ascii-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c
+
+gnative2ascii-toolwrapper.obj: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gnative2ascii_CFLAGS) $(CFLAGS) -MT gnative2ascii-toolwrapper.obj -MD -MP -MF "$(DEPDIR)/gnative2ascii-toolwrapper.Tpo" -c -o gnative2ascii-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gnative2ascii-toolwrapper.Tpo" "$(DEPDIR)/gnative2ascii-toolwrapper.Po"; else rm -f "$(DEPDIR)/gnative2ascii-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gnative2ascii-toolwrapper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gnative2ascii_CFLAGS) $(CFLAGS) -c -o gnative2ascii-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`
+
+gorbd-toolwrapper.o: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gorbd_CFLAGS) $(CFLAGS) -MT gorbd-toolwrapper.o -MD -MP -MF "$(DEPDIR)/gorbd-toolwrapper.Tpo" -c -o gorbd-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gorbd-toolwrapper.Tpo" "$(DEPDIR)/gorbd-toolwrapper.Po"; else rm -f "$(DEPDIR)/gorbd-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gorbd-toolwrapper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gorbd_CFLAGS) $(CFLAGS) -c -o gorbd-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c
+
+gorbd-toolwrapper.obj: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gorbd_CFLAGS) $(CFLAGS) -MT gorbd-toolwrapper.obj -MD -MP -MF "$(DEPDIR)/gorbd-toolwrapper.Tpo" -c -o gorbd-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gorbd-toolwrapper.Tpo" "$(DEPDIR)/gorbd-toolwrapper.Po"; else rm -f "$(DEPDIR)/gorbd-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gorbd-toolwrapper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gorbd_CFLAGS) $(CFLAGS) -c -o gorbd-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`
+
+grmic-toolwrapper.o: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grmic_CFLAGS) $(CFLAGS) -MT grmic-toolwrapper.o -MD -MP -MF "$(DEPDIR)/grmic-toolwrapper.Tpo" -c -o grmic-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/grmic-toolwrapper.Tpo" "$(DEPDIR)/grmic-toolwrapper.Po"; else rm -f "$(DEPDIR)/grmic-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='grmic-toolwrapper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grmic_CFLAGS) $(CFLAGS) -c -o grmic-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c
+
+grmic-toolwrapper.obj: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grmic_CFLAGS) $(CFLAGS) -MT grmic-toolwrapper.obj -MD -MP -MF "$(DEPDIR)/grmic-toolwrapper.Tpo" -c -o grmic-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/grmic-toolwrapper.Tpo" "$(DEPDIR)/grmic-toolwrapper.Po"; else rm -f "$(DEPDIR)/grmic-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='grmic-toolwrapper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grmic_CFLAGS) $(CFLAGS) -c -o grmic-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`
+
+grmid-toolwrapper.o: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grmid_CFLAGS) $(CFLAGS) -MT grmid-toolwrapper.o -MD -MP -MF "$(DEPDIR)/grmid-toolwrapper.Tpo" -c -o grmid-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/grmid-toolwrapper.Tpo" "$(DEPDIR)/grmid-toolwrapper.Po"; else rm -f "$(DEPDIR)/grmid-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='grmid-toolwrapper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grmid_CFLAGS) $(CFLAGS) -c -o grmid-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c
+
+grmid-toolwrapper.obj: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grmid_CFLAGS) $(CFLAGS) -MT grmid-toolwrapper.obj -MD -MP -MF "$(DEPDIR)/grmid-toolwrapper.Tpo" -c -o grmid-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/grmid-toolwrapper.Tpo" "$(DEPDIR)/grmid-toolwrapper.Po"; else rm -f "$(DEPDIR)/grmid-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='grmid-toolwrapper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grmid_CFLAGS) $(CFLAGS) -c -o grmid-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`
+
+grmiregistry-toolwrapper.o: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grmiregistry_CFLAGS) $(CFLAGS) -MT grmiregistry-toolwrapper.o -MD -MP -MF "$(DEPDIR)/grmiregistry-toolwrapper.Tpo" -c -o grmiregistry-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/grmiregistry-toolwrapper.Tpo" "$(DEPDIR)/grmiregistry-toolwrapper.Po"; else rm -f "$(DEPDIR)/grmiregistry-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='grmiregistry-toolwrapper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grmiregistry_CFLAGS) $(CFLAGS) -c -o grmiregistry-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c
+
+grmiregistry-toolwrapper.obj: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grmiregistry_CFLAGS) $(CFLAGS) -MT grmiregistry-toolwrapper.obj -MD -MP -MF "$(DEPDIR)/grmiregistry-toolwrapper.Tpo" -c -o grmiregistry-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/grmiregistry-toolwrapper.Tpo" "$(DEPDIR)/grmiregistry-toolwrapper.Po"; else rm -f "$(DEPDIR)/grmiregistry-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='grmiregistry-toolwrapper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grmiregistry_CFLAGS) $(CFLAGS) -c -o grmiregistry-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`
+
+gserialver-toolwrapper.o: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gserialver_CFLAGS) $(CFLAGS) -MT gserialver-toolwrapper.o -MD -MP -MF "$(DEPDIR)/gserialver-toolwrapper.Tpo" -c -o gserialver-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gserialver-toolwrapper.Tpo" "$(DEPDIR)/gserialver-toolwrapper.Po"; else rm -f "$(DEPDIR)/gserialver-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gserialver-toolwrapper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gserialver_CFLAGS) $(CFLAGS) -c -o gserialver-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c
+
+gserialver-toolwrapper.obj: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gserialver_CFLAGS) $(CFLAGS) -MT gserialver-toolwrapper.obj -MD -MP -MF "$(DEPDIR)/gserialver-toolwrapper.Tpo" -c -o gserialver-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gserialver-toolwrapper.Tpo" "$(DEPDIR)/gserialver-toolwrapper.Po"; else rm -f "$(DEPDIR)/gserialver-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gserialver-toolwrapper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gserialver_CFLAGS) $(CFLAGS) -c -o gserialver-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`
+
+gtnameserv-toolwrapper.o: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gtnameserv_CFLAGS) $(CFLAGS) -MT gtnameserv-toolwrapper.o -MD -MP -MF "$(DEPDIR)/gtnameserv-toolwrapper.Tpo" -c -o gtnameserv-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gtnameserv-toolwrapper.Tpo" "$(DEPDIR)/gtnameserv-toolwrapper.Po"; else rm -f "$(DEPDIR)/gtnameserv-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gtnameserv-toolwrapper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gtnameserv_CFLAGS) $(CFLAGS) -c -o gtnameserv-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c
+
+gtnameserv-toolwrapper.obj: toolwrapper.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gtnameserv_CFLAGS) $(CFLAGS) -MT gtnameserv-toolwrapper.obj -MD -MP -MF "$(DEPDIR)/gtnameserv-toolwrapper.Tpo" -c -o gtnameserv-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gtnameserv-toolwrapper.Tpo" "$(DEPDIR)/gtnameserv-toolwrapper.Po"; else rm -f "$(DEPDIR)/gtnameserv-toolwrapper.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gtnameserv-toolwrapper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gtnameserv_CFLAGS) $(CFLAGS) -c -o gtnameserv-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
@@ -449,12 +881,71 @@ clean-libtool:
distclean-libtool:
-rm -f libtool
uninstall-info-am:
+install-TOOLSDATA: $(TOOLS_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(TOOLSdir)" || $(mkdir_p) "$(DESTDIR)$(TOOLSdir)"
+ @list='$(TOOLS_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(TOOLSDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(TOOLSdir)/$$f'"; \
+ $(TOOLSDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(TOOLSdir)/$$f"; \
+ done
+
+uninstall-TOOLSDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(TOOLS_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(TOOLSdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(TOOLSdir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
tags: TAGS
-TAGS:
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
ctags: CTAGS
-CTAGS:
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
@@ -489,8 +980,11 @@ distdir: $(DISTFILES)
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(DATA)
+all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA)
installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(TOOLSdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
@@ -519,11 +1013,14 @@ maintainer-clean-generic:
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
-clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \
+ mostlyclean-am
distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
dvi: dvi-am
@@ -535,23 +1032,25 @@ info: info-am
info-am:
-install-data-am:
+install-data-am: install-TOOLSDATA
-install-exec-am:
+install-exec-am: install-binPROGRAMS install-binSCRIPTS
install-info: install-info-am
install-man:
-installcheck-am:
+installcheck-am: installcheck-binPROGRAMS installcheck-binSCRIPTS
maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
pdf: pdf-am
@@ -561,22 +1060,25 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am
+uninstall-am: uninstall-TOOLSDATA uninstall-binPROGRAMS \
+ uninstall-binSCRIPTS uninstall-info-am
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- clean-local dist-hook distclean distclean-generic \
- distclean-libtool distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am install-man \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libtool clean-local ctags dist-hook \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-TOOLSDATA install-am \
+ install-binPROGRAMS install-binSCRIPTS install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installcheck-binPROGRAMS \
+ installcheck-binSCRIPTS installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- uninstall uninstall-am uninstall-info-am
-
-@FOUND_ECJ_FALSE@@FOUND_GCJX_FALSE@@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@error dunno how to setup the JCOMPILER and compile
+ tags uninstall uninstall-TOOLSDATA uninstall-am \
+ uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-info-am
-# Where we want these data files installed.
-# TOOLSdir = $(datadir)/java
+@FOUND_ECJ_FALSE@@FOUND_GCJ_FALSE@error dunno how to setup the JCOMPILER and compile
# Make sure everything is included in the distribution.
dist-hook:
@@ -597,24 +1099,34 @@ dist-hook:
# immediately. And copy the template files we use to the classes dir
# so they get also included.
$(TOOLS_ZIP): $(TOOLS_JAVA_FILES)
- mkdir -p classes/gnu/classpath/tools/giop/grmic/templates
- mkdir -p classes/gnu/classpath/tools/rmi/rmic/templates
- mkdir -p classes/gnu/classpath/tools/appletviewer
- mkdir -p classes/gnu/classpath/tools/jarsigner
- mkdir -p classes/gnu/classpath/tools/keytool
- cp $(RMIC_TEMPLATES) classes/gnu/classpath/tools/rmi/rmic/templates
- cp $(GRMIC_TEMPLATES) classes/gnu/classpath/tools/giop/grmic/templates
- cp $(RMI_HELPS) classes/gnu/classpath/tools/rmi/
- cp $(GIOP_HELPS) classes/gnu/classpath/tools/giop/
- $(JCOMPILER) -d classes $(TOOLS_JAVA_FILES)
+ find $(srcdir)/external/asm -name '*.java' -print > asm.lst
+ find $(srcdir)/gnu/classpath/tools -name '*.java' -print > classes.lst
+ cat classes.lst asm.lst > all-classes.lst
+@JAVA_MAINTAINER_MODE_TRUE@ AC=`echo $(JCOMPILER) | sed -e 's/UTF-8/ISO-8859-1/g'`; \
+@JAVA_MAINTAINER_MODE_TRUE@ $$AC -g -w -d $(srcdir)/asm @asm.lst
+@JAVA_MAINTAINER_MODE_TRUE@ $(JCOMPILER) -g -w -d $(srcdir)/classes @classes.lst
+@JAVA_MAINTAINER_MODE_TRUE@ @list=`cd $(top_srcdir)/resource && find gnu/classpath/tools -name \*.properties -print`; \
+@JAVA_MAINTAINER_MODE_TRUE@ for p in $$list; do \
+@JAVA_MAINTAINER_MODE_TRUE@ dirname=classes/`dirname $$p`; \
+@JAVA_MAINTAINER_MODE_TRUE@ if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
+@JAVA_MAINTAINER_MODE_TRUE@ echo " cp $(top_srcdir)/resource/$$p classes/$$p"; \
+@JAVA_MAINTAINER_MODE_TRUE@ cp $(top_srcdir)/resource/$$p classes/$$p; \
+@JAVA_MAINTAINER_MODE_TRUE@ done
+ cp -pR $(srcdir)/asm .
+ cp -pR $(srcdir)/classes .
(cd classes; \
- $(FASTJAR) cf ../$(TOOLS_ZIP) .; \
+ if test "$(ZIP)" != ""; then $(ZIP) -r ../$(TOOLS_ZIP) .; fi; \
+ if test "$(FASTJAR)" != ""; then $(FASTJAR) cf ../$(TOOLS_ZIP) .; fi; \
+ cd ..)
+ (cd asm; \
+ if test "$(ZIP)" != ""; then $(ZIP) -u -r ../$(TOOLS_ZIP) .; fi; \
+ if test "$(FASTJAR)" != ""; then $(FASTJAR) uf ../$(TOOLS_ZIP) .; fi; \
cd ..)
- rm -rf classes
+ rm -rf asm classes classes.lst asm.lst
# Zip file be gone! (and make sure the classes are gone too)
clean-local:
- rm -rf $(TOOLS_ZIP) classes
+ rm -rf $(TOOLS_ZIP) classes asm asm.lst
# FIXME: remove this when GNU Classpath includes a bootstrap VM.
installcheck-binSCRIPTS:
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/AnnotationVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/AnnotationVisitor.class
new file mode 100644
index 00000000000..acb0481dd17
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/AnnotationVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/AnnotationWriter.class b/libjava/classpath/tools/asm/org/objectweb/asm/AnnotationWriter.class
new file mode 100644
index 00000000000..69dd3cf357f
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/AnnotationWriter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/Attribute.class b/libjava/classpath/tools/asm/org/objectweb/asm/Attribute.class
new file mode 100644
index 00000000000..d9bb13a7509
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/Attribute.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/ByteVector.class b/libjava/classpath/tools/asm/org/objectweb/asm/ByteVector.class
new file mode 100644
index 00000000000..a7b9ad75e6c
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/ByteVector.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/ClassAdapter.class b/libjava/classpath/tools/asm/org/objectweb/asm/ClassAdapter.class
new file mode 100644
index 00000000000..81a4025992e
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/ClassAdapter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/ClassReader.class b/libjava/classpath/tools/asm/org/objectweb/asm/ClassReader.class
new file mode 100644
index 00000000000..5fc42a0b7c0
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/ClassReader.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/ClassVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/ClassVisitor.class
new file mode 100644
index 00000000000..f4345b3e50b
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/ClassVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/ClassWriter.class b/libjava/classpath/tools/asm/org/objectweb/asm/ClassWriter.class
new file mode 100644
index 00000000000..07de7fcc69f
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/ClassWriter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/Edge.class b/libjava/classpath/tools/asm/org/objectweb/asm/Edge.class
new file mode 100644
index 00000000000..2cf713b4b9c
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/Edge.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/FieldVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/FieldVisitor.class
new file mode 100644
index 00000000000..5f29c7b7b73
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/FieldVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/FieldWriter.class b/libjava/classpath/tools/asm/org/objectweb/asm/FieldWriter.class
new file mode 100644
index 00000000000..b316b7be210
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/FieldWriter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/Handler.class b/libjava/classpath/tools/asm/org/objectweb/asm/Handler.class
new file mode 100644
index 00000000000..1cbcd3ff5ee
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/Handler.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/Item.class b/libjava/classpath/tools/asm/org/objectweb/asm/Item.class
new file mode 100644
index 00000000000..5c0a0d0d09c
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/Item.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/Label.class b/libjava/classpath/tools/asm/org/objectweb/asm/Label.class
new file mode 100644
index 00000000000..0bd982b3cdd
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/Label.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/MethodAdapter.class b/libjava/classpath/tools/asm/org/objectweb/asm/MethodAdapter.class
new file mode 100644
index 00000000000..3521003c509
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/MethodAdapter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/MethodVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/MethodVisitor.class
new file mode 100644
index 00000000000..d4bdd8f383a
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/MethodVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/MethodWriter.class b/libjava/classpath/tools/asm/org/objectweb/asm/MethodWriter.class
new file mode 100644
index 00000000000..9ec1d07de5e
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/MethodWriter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/Opcodes.class b/libjava/classpath/tools/asm/org/objectweb/asm/Opcodes.class
new file mode 100644
index 00000000000..599491168d3
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/Opcodes.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/Type.class b/libjava/classpath/tools/asm/org/objectweb/asm/Type.class
new file mode 100644
index 00000000000..e96ca26ef21
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/Type.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapAttribute.class b/libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapAttribute.class
new file mode 100644
index 00000000000..20bda686302
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapAttribute.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapFrame.class b/libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapFrame.class
new file mode 100644
index 00000000000..0305d04dc6c
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapFrame.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapTableAttribute.class b/libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapTableAttribute.class
new file mode 100644
index 00000000000..c1eb324568e
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapTableAttribute.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapType.class b/libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapType.class
new file mode 100644
index 00000000000..ea6999b997f
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/attrs/StackMapType.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/commons/AdviceAdapter.class b/libjava/classpath/tools/asm/org/objectweb/asm/commons/AdviceAdapter.class
new file mode 100644
index 00000000000..54a93089a8c
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/commons/AdviceAdapter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/commons/EmptyVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/commons/EmptyVisitor.class
new file mode 100644
index 00000000000..47aa4b89449
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/commons/EmptyVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/commons/GeneratorAdapter.class b/libjava/classpath/tools/asm/org/objectweb/asm/commons/GeneratorAdapter.class
new file mode 100644
index 00000000000..5c2cd66bf06
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/commons/GeneratorAdapter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/commons/LocalVariablesSorter.class b/libjava/classpath/tools/asm/org/objectweb/asm/commons/LocalVariablesSorter.class
new file mode 100644
index 00000000000..de1a9db937a
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/commons/LocalVariablesSorter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/commons/Method.class b/libjava/classpath/tools/asm/org/objectweb/asm/commons/Method.class
new file mode 100644
index 00000000000..508cfb5fb4f
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/commons/Method.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/commons/SerialVersionUIDAdder$Item.class b/libjava/classpath/tools/asm/org/objectweb/asm/commons/SerialVersionUIDAdder$Item.class
new file mode 100644
index 00000000000..9048fab59ce
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/commons/SerialVersionUIDAdder$Item.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/commons/SerialVersionUIDAdder.class b/libjava/classpath/tools/asm/org/objectweb/asm/commons/SerialVersionUIDAdder.class
new file mode 100644
index 00000000000..ae5f315b0ca
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/commons/SerialVersionUIDAdder.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/commons/StaticInitMerger.class b/libjava/classpath/tools/asm/org/objectweb/asm/commons/StaticInitMerger.class
new file mode 100644
index 00000000000..53614d1f44f
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/commons/StaticInitMerger.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/commons/TableSwitchGenerator.class b/libjava/classpath/tools/asm/org/objectweb/asm/commons/TableSwitchGenerator.class
new file mode 100644
index 00000000000..3da3b099f0c
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/commons/TableSwitchGenerator.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/AnnotationConstantsCollector.class b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/AnnotationConstantsCollector.class
new file mode 100644
index 00000000000..ce439d21ede
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/AnnotationConstantsCollector.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/ClassConstantsCollector.class b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/ClassConstantsCollector.class
new file mode 100644
index 00000000000..d04c8cd3711
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/ClassConstantsCollector.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/ClassOptimizer.class b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/ClassOptimizer.class
new file mode 100644
index 00000000000..86a760c78b4
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/ClassOptimizer.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/Constant.class b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/Constant.class
new file mode 100644
index 00000000000..c9eb21e2eee
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/Constant.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/ConstantPool.class b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/ConstantPool.class
new file mode 100644
index 00000000000..a23ba657075
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/ConstantPool.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/FieldConstantsCollector.class b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/FieldConstantsCollector.class
new file mode 100644
index 00000000000..fd910c9a68f
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/FieldConstantsCollector.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/JarOptimizer.class b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/JarOptimizer.class
new file mode 100644
index 00000000000..0d6c4bdb52a
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/JarOptimizer.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/MethodConstantsCollector.class b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/MethodConstantsCollector.class
new file mode 100644
index 00000000000..8928af0258b
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/MethodConstantsCollector.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/MethodOptimizer.class b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/MethodOptimizer.class
new file mode 100644
index 00000000000..0aa907283c0
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/MethodOptimizer.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/NameMapping.class b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/NameMapping.class
new file mode 100644
index 00000000000..249a832f7ad
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/NameMapping.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/Shrinker$ConstantComparator.class b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/Shrinker$ConstantComparator.class
new file mode 100644
index 00000000000..d03748d47b5
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/Shrinker$ConstantComparator.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/Shrinker.class b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/Shrinker.class
new file mode 100644
index 00000000000..bb87a280b7b
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/optimizer/Shrinker.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/signature/SignatureReader.class b/libjava/classpath/tools/asm/org/objectweb/asm/signature/SignatureReader.class
new file mode 100644
index 00000000000..b3c4b9d3efa
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/signature/SignatureReader.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/signature/SignatureVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/signature/SignatureVisitor.class
new file mode 100644
index 00000000000..98826f133db
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/signature/SignatureVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/signature/SignatureWriter.class b/libjava/classpath/tools/asm/org/objectweb/asm/signature/SignatureWriter.class
new file mode 100644
index 00000000000..ec5f5271046
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/signature/SignatureWriter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/AbstractInsnNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/AbstractInsnNode.class
new file mode 100644
index 00000000000..1fee9f6c353
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/AbstractInsnNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/AnnotationNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/AnnotationNode.class
new file mode 100644
index 00000000000..4eee59d47ef
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/AnnotationNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/ClassNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/ClassNode.class
new file mode 100644
index 00000000000..463e22bc595
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/ClassNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/FieldInsnNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/FieldInsnNode.class
new file mode 100644
index 00000000000..ef9f743bef4
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/FieldInsnNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/FieldNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/FieldNode.class
new file mode 100644
index 00000000000..92797f61970
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/FieldNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/IincInsnNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/IincInsnNode.class
new file mode 100644
index 00000000000..10428be2e84
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/IincInsnNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/InnerClassNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/InnerClassNode.class
new file mode 100644
index 00000000000..35008f41a02
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/InnerClassNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/InsnNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/InsnNode.class
new file mode 100644
index 00000000000..0eb12d987fa
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/InsnNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/IntInsnNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/IntInsnNode.class
new file mode 100644
index 00000000000..f89b8fda4ae
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/IntInsnNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/JumpInsnNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/JumpInsnNode.class
new file mode 100644
index 00000000000..fc6e78364a5
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/JumpInsnNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/LabelNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/LabelNode.class
new file mode 100644
index 00000000000..2b375e49ea1
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/LabelNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/LdcInsnNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/LdcInsnNode.class
new file mode 100644
index 00000000000..97a2e6d698b
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/LdcInsnNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/LineNumberNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/LineNumberNode.class
new file mode 100644
index 00000000000..5b0abc6e224
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/LineNumberNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/LocalVariableNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/LocalVariableNode.class
new file mode 100644
index 00000000000..7da757ccf66
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/LocalVariableNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/LookupSwitchInsnNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/LookupSwitchInsnNode.class
new file mode 100644
index 00000000000..7d80188c8d0
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/LookupSwitchInsnNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/MemberNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/MemberNode.class
new file mode 100644
index 00000000000..541ac8976c9
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/MemberNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/MethodInsnNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/MethodInsnNode.class
new file mode 100644
index 00000000000..900d812b12c
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/MethodInsnNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/MethodNode$1.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/MethodNode$1.class
new file mode 100644
index 00000000000..17c75855293
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/MethodNode$1.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/MethodNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/MethodNode.class
new file mode 100644
index 00000000000..d0f996e0680
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/MethodNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/MultiANewArrayInsnNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/MultiANewArrayInsnNode.class
new file mode 100644
index 00000000000..eff4e980c1d
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/MultiANewArrayInsnNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/TableSwitchInsnNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/TableSwitchInsnNode.class
new file mode 100644
index 00000000000..3d7edc3261e
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/TableSwitchInsnNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/TryCatchBlockNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/TryCatchBlockNode.class
new file mode 100644
index 00000000000..ba882b3667c
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/TryCatchBlockNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/TypeInsnNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/TypeInsnNode.class
new file mode 100644
index 00000000000..577ff0aaa8d
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/TypeInsnNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/VarInsnNode.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/VarInsnNode.class
new file mode 100644
index 00000000000..a86ac05705b
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/VarInsnNode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Analyzer.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Analyzer.class
new file mode 100644
index 00000000000..aa54fd6f4db
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Analyzer.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/AnalyzerException.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/AnalyzerException.class
new file mode 100644
index 00000000000..1c0e6b13668
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/AnalyzerException.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/BasicInterpreter.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/BasicInterpreter.class
new file mode 100644
index 00000000000..cf4a4d256df
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/BasicInterpreter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/BasicValue.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/BasicValue.class
new file mode 100644
index 00000000000..303e15543d6
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/BasicValue.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/BasicVerifier.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/BasicVerifier.class
new file mode 100644
index 00000000000..6adddec004a
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/BasicVerifier.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/DataflowInterpreter.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/DataflowInterpreter.class
new file mode 100644
index 00000000000..c87cf330827
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/DataflowInterpreter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/DataflowValue.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/DataflowValue.class
new file mode 100644
index 00000000000..41bb76b983e
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/DataflowValue.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Frame.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Frame.class
new file mode 100644
index 00000000000..297cfd50445
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Frame.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/IntMap.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/IntMap.class
new file mode 100644
index 00000000000..467749a1f6a
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/IntMap.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Interpreter.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Interpreter.class
new file mode 100644
index 00000000000..a1afe42a012
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Interpreter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/SimpleVerifier.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/SimpleVerifier.class
new file mode 100644
index 00000000000..e7e8f053346
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/SimpleVerifier.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/SmallSet.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/SmallSet.class
new file mode 100644
index 00000000000..be09934203c
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/SmallSet.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Subroutine.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Subroutine.class
new file mode 100644
index 00000000000..3767ead89dd
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Subroutine.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Value.class b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Value.class
new file mode 100644
index 00000000000..21de3a90e02
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/tree/analysis/Value.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierAbstractVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierAbstractVisitor.class
new file mode 100644
index 00000000000..a819e6aaa0b
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierAbstractVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierAnnotationVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierAnnotationVisitor.class
new file mode 100644
index 00000000000..7fe6b7e908f
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierAnnotationVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierClassVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierClassVisitor.class
new file mode 100644
index 00000000000..60cba834549
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierClassVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierFieldVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierFieldVisitor.class
new file mode 100644
index 00000000000..d9885149129
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierFieldVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierMethodVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierMethodVisitor.class
new file mode 100644
index 00000000000..43b18b737b0
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/ASMifierMethodVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/AbstractVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/AbstractVisitor.class
new file mode 100644
index 00000000000..a9aff218f13
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/AbstractVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/CheckAnnotationAdapter.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/CheckAnnotationAdapter.class
new file mode 100644
index 00000000000..b96505315e2
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/CheckAnnotationAdapter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/CheckClassAdapter.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/CheckClassAdapter.class
new file mode 100644
index 00000000000..ef09ba998f3
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/CheckClassAdapter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/CheckFieldAdapter.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/CheckFieldAdapter.class
new file mode 100644
index 00000000000..db4b4b03bf4
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/CheckFieldAdapter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/CheckMethodAdapter.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/CheckMethodAdapter.class
new file mode 100644
index 00000000000..d07f5f2b4c1
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/CheckMethodAdapter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceAbstractVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceAbstractVisitor.class
new file mode 100644
index 00000000000..0f103e2aab6
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceAbstractVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceAnnotationVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceAnnotationVisitor.class
new file mode 100644
index 00000000000..50fc265f413
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceAnnotationVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceClassVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceClassVisitor.class
new file mode 100644
index 00000000000..65d8159b34a
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceClassVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceFieldVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceFieldVisitor.class
new file mode 100644
index 00000000000..0035c01c0bf
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceFieldVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceMethodVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceMethodVisitor.class
new file mode 100644
index 00000000000..ffd4f263539
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceMethodVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceSignatureVisitor.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceSignatureVisitor.class
new file mode 100644
index 00000000000..b045ab556cf
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/TraceSignatureVisitor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/ASMStackMapAttribute.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/ASMStackMapAttribute.class
new file mode 100644
index 00000000000..ae2a692b57d
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/ASMStackMapAttribute.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/ASMStackMapTableAttribute.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/ASMStackMapTableAttribute.class
new file mode 100644
index 00000000000..f69d0d46116
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/ASMStackMapTableAttribute.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/ASMifiable.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/ASMifiable.class
new file mode 100644
index 00000000000..f1556bd52c3
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/ASMifiable.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/Traceable.class b/libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/Traceable.class
new file mode 100644
index 00000000000..bfd9350a6ee
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/util/attrs/Traceable.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationDefaultRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationDefaultRule.class
new file mode 100644
index 00000000000..af595a35fe9
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationDefaultRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationParameterRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationParameterRule.class
new file mode 100644
index 00000000000..688a8281059
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationParameterRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationRule.class
new file mode 100644
index 00000000000..44cd0fd4d79
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueAnnotationRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueAnnotationRule.class
new file mode 100644
index 00000000000..474ac94c17d
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueAnnotationRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueArrayRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueArrayRule.class
new file mode 100644
index 00000000000..862a266da6b
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueArrayRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueEnumRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueEnumRule.class
new file mode 100644
index 00000000000..dbbce81bbc3
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueEnumRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueRule.class
new file mode 100644
index 00000000000..bd4a2c2b516
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$AnnotationValueRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$ClassRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$ClassRule.class
new file mode 100644
index 00000000000..c0dbd395b7b
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$ClassRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$ExceptionRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$ExceptionRule.class
new file mode 100644
index 00000000000..a4645efac7f
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$ExceptionRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$ExceptionsRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$ExceptionsRule.class
new file mode 100644
index 00000000000..27e11293a99
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$ExceptionsRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$FieldRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$FieldRule.class
new file mode 100644
index 00000000000..ccfe42a55ed
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$FieldRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$InnerClassRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$InnerClassRule.class
new file mode 100644
index 00000000000..474e744d2be
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$InnerClassRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$InterfaceRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$InterfaceRule.class
new file mode 100644
index 00000000000..6be0d9c0fcb
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$InterfaceRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$InterfacesRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$InterfacesRule.class
new file mode 100644
index 00000000000..b6c288bb875
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$InterfacesRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LabelRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LabelRule.class
new file mode 100644
index 00000000000..8c510cf4f0c
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LabelRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LineNumberRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LineNumberRule.class
new file mode 100644
index 00000000000..2bb1138a524
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LineNumberRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LocalVarRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LocalVarRule.class
new file mode 100644
index 00000000000..b26b677c802
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LocalVarRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LookupSwitchLabelRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LookupSwitchLabelRule.class
new file mode 100644
index 00000000000..74636c3711c
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LookupSwitchLabelRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LookupSwitchRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LookupSwitchRule.class
new file mode 100644
index 00000000000..88dbc85d80b
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$LookupSwitchRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$MaxRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$MaxRule.class
new file mode 100644
index 00000000000..e54e90e752e
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$MaxRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$MethodRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$MethodRule.class
new file mode 100644
index 00000000000..85ee199f790
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$MethodRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$Opcode.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$Opcode.class
new file mode 100644
index 00000000000..79606a85f92
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$Opcode.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$OpcodeGroup.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$OpcodeGroup.class
new file mode 100644
index 00000000000..215db6cf48b
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$OpcodeGroup.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$OpcodesRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$OpcodesRule.class
new file mode 100644
index 00000000000..1417533a75a
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$OpcodesRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$OuterClassRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$OuterClassRule.class
new file mode 100644
index 00000000000..52a6cc65b6a
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$OuterClassRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$Rule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$Rule.class
new file mode 100644
index 00000000000..080c1758266
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$Rule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$RuleSet.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$RuleSet.class
new file mode 100644
index 00000000000..0b99b723f58
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$RuleSet.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$SourceRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$SourceRule.class
new file mode 100644
index 00000000000..c27ffe1b320
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$SourceRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$TableSwitchLabelRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$TableSwitchLabelRule.class
new file mode 100644
index 00000000000..8f2d4e4ae02
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$TableSwitchLabelRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$TableSwitchRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$TableSwitchRule.class
new file mode 100644
index 00000000000..c9844738e0d
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$TableSwitchRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$TryCatchRule.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$TryCatchRule.class
new file mode 100644
index 00000000000..45049a4d149
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler$TryCatchRule.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler.class
new file mode 100644
index 00000000000..db263e35799
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/ASMContentHandler.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ASMContentHandlerFactory.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ASMContentHandlerFactory.class
new file mode 100644
index 00000000000..091b66879ff
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ASMContentHandlerFactory.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ContentHandlerFactory.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ContentHandlerFactory.class
new file mode 100644
index 00000000000..db46833eb06
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ContentHandlerFactory.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$EntryElement.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$EntryElement.class
new file mode 100644
index 00000000000..8f5d5c63cf5
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$EntryElement.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$InputSlicingHandler.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$InputSlicingHandler.class
new file mode 100644
index 00000000000..537603fb286
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$InputSlicingHandler.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$OutputSlicingHandler.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$OutputSlicingHandler.class
new file mode 100644
index 00000000000..99f66cc4326
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$OutputSlicingHandler.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ProtectedInputStream.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ProtectedInputStream.class
new file mode 100644
index 00000000000..6abc9359ee7
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ProtectedInputStream.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SAXWriter.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SAXWriter.class
new file mode 100644
index 00000000000..ecf42b6621b
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SAXWriter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SAXWriterFactory.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SAXWriterFactory.class
new file mode 100644
index 00000000000..8fe15a1968e
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SAXWriterFactory.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SingleDocElement.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SingleDocElement.class
new file mode 100644
index 00000000000..f553911ab3a
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SingleDocElement.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SubdocumentHandlerFactory.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SubdocumentHandlerFactory.class
new file mode 100644
index 00000000000..1f469d18fd4
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$SubdocumentHandlerFactory.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$TransformerHandlerFactory.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$TransformerHandlerFactory.class
new file mode 100644
index 00000000000..e1b60e17940
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$TransformerHandlerFactory.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ZipEntryElement.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ZipEntryElement.class
new file mode 100644
index 00000000000..0ee908bf585
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor$ZipEntryElement.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor.class
new file mode 100644
index 00000000000..cf09fc1b949
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/Processor.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXAdapter.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXAdapter.class
new file mode 100644
index 00000000000..f5347601c35
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXAdapter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXAnnotationAdapter.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXAnnotationAdapter.class
new file mode 100644
index 00000000000..ea703042661
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXAnnotationAdapter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXClassAdapter.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXClassAdapter.class
new file mode 100644
index 00000000000..492ee2c54ea
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXClassAdapter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXCodeAdapter.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXCodeAdapter.class
new file mode 100644
index 00000000000..a0656a5ef67
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXCodeAdapter.class
Binary files differ
diff --git a/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXFieldAdapter.class b/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXFieldAdapter.class
new file mode 100644
index 00000000000..7cdae94bb66
--- /dev/null
+++ b/libjava/classpath/tools/asm/org/objectweb/asm/xml/SAXFieldAdapter.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/AppletClassLoader.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/AppletClassLoader.class
new file mode 100644
index 00000000000..50e61a6a9fe
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/AppletClassLoader.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/AppletSecurityManager.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/AppletSecurityManager.class
new file mode 100644
index 00000000000..cab207c3fb4
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/AppletSecurityManager.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/AppletTag.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/AppletTag.class
new file mode 100644
index 00000000000..141d5108f1d
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/AppletTag.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/CommonAppletContext.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/CommonAppletContext.class
new file mode 100644
index 00000000000..dbc0fb5480b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/CommonAppletContext.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/CommonAppletStub.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/CommonAppletStub.class
new file mode 100644
index 00000000000..13f91ee97e8
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/CommonAppletStub.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/ErrorApplet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/ErrorApplet.class
new file mode 100644
index 00000000000..ed7bdf61ae0
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/ErrorApplet.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$1.class
new file mode 100644
index 00000000000..c02a09fb7d1
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$10.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$10.class
new file mode 100644
index 00000000000..eab6a10f09a
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$10.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$2.class
new file mode 100644
index 00000000000..7a912ded0e3
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$3.class
new file mode 100644
index 00000000000..ce530d6f994
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$4.class
new file mode 100644
index 00000000000..bf524e75f56
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$5.class
new file mode 100644
index 00000000000..013b28f1473
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$6.class
new file mode 100644
index 00000000000..5b0fef7ce10
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$7.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$7.class
new file mode 100644
index 00000000000..affe0058d15
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$7.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$8.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$8.class
new file mode 100644
index 00000000000..0b71b1d87b3
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$8.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$9.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$9.class
new file mode 100644
index 00000000000..e318aa38ec4
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main$9.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main.class
new file mode 100644
index 00000000000..b9af4c6fa5e
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Main.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Messages.class
new file mode 100644
index 00000000000..efc34dfc951
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/Messages.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/PluginAppletContext.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/PluginAppletContext.class
new file mode 100644
index 00000000000..1511a5e9b23
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/PluginAppletContext.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/PluginAppletViewer.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/PluginAppletViewer.class
new file mode 100644
index 00000000000..e8dc01ec5cf
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/PluginAppletViewer.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/PluginAppletWindow.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/PluginAppletWindow.class
new file mode 100644
index 00000000000..3bf54aa891b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/PluginAppletWindow.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletContext.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletContext.class
new file mode 100644
index 00000000000..a307a7af4ce
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletContext.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.class
new file mode 100644
index 00000000000..82bdc431b1a
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletWindow$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletWindow$1.class
new file mode 100644
index 00000000000..c8c976ffe6e
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletWindow$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.class
new file mode 100644
index 00000000000..24810be38a3
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/TagParser.class b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/TagParser.class
new file mode 100644
index 00000000000..a3fdc693ecb
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/appletviewer/TagParser.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/common/CallbackUtil.class b/libjava/classpath/tools/classes/gnu/classpath/tools/common/CallbackUtil.class
new file mode 100644
index 00000000000..970232c7ea7
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/common/CallbackUtil.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser$1.class
new file mode 100644
index 00000000000..9c37fcc4337
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser.class b/libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser.class
new file mode 100644
index 00000000000..cedab4a0bc0
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/common/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/common/Messages.class
new file mode 100644
index 00000000000..9b3d765a117
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/common/Messages.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/common/Persistent$ExitTask.class b/libjava/classpath/tools/classes/gnu/classpath/tools/common/Persistent$ExitTask.class
new file mode 100644
index 00000000000..36daccbc48b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/common/Persistent$ExitTask.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/common/Persistent.class b/libjava/classpath/tools/classes/gnu/classpath/tools/common/Persistent.class
new file mode 100644
index 00000000000..6a1e7519db7
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/common/Persistent.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/common/ProviderUtil$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/common/ProviderUtil$1.class
new file mode 100644
index 00000000000..042f455123c
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/common/ProviderUtil$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/common/ProviderUtil$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/common/ProviderUtil$2.class
new file mode 100644
index 00000000000..501720fe305
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/common/ProviderUtil$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/common/ProviderUtil.class b/libjava/classpath/tools/classes/gnu/classpath/tools/common/ProviderUtil.class
new file mode 100644
index 00000000000..a8e0e6c3152
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/common/ProviderUtil.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/common/SecurityProviderInfo.class b/libjava/classpath/tools/classes/gnu/classpath/tools/common/SecurityProviderInfo.class
new file mode 100644
index 00000000000..8715ab8d475
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/common/SecurityProviderInfo.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/FileArgumentCallback.class b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/FileArgumentCallback.class
new file mode 100644
index 00000000000..de9d9a63a5a
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/FileArgumentCallback.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Messages.class
new file mode 100644
index 00000000000..f86b8f70c3b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Messages.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Option.class b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Option.class
new file mode 100644
index 00000000000..c97800034b2
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Option.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/OptionException.class b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/OptionException.class
new file mode 100644
index 00000000000..9cc6b62186e
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/OptionException.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/OptionGroup.class b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/OptionGroup.class
new file mode 100644
index 00000000000..2467f78167d
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/OptionGroup.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$1.class
new file mode 100644
index 00000000000..a9ac25fd997
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$2.class
new file mode 100644
index 00000000000..ccf3542324e
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$3.class
new file mode 100644
index 00000000000..373cf215c78
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser.class b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser.class
new file mode 100644
index 00000000000..d5fece3859b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Action.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Action.class
new file mode 100644
index 00000000000..513df1ca3cf
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Action.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.class
new file mode 100644
index 00000000000..c8c24d231d1
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Entry.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Entry.class
new file mode 100644
index 00000000000..d030d92ddd8
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Entry.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Extractor.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Extractor.class
new file mode 100644
index 00000000000..c0d819e4c73
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Extractor.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Indexer.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Indexer.class
new file mode 100644
index 00000000000..ddbaf6bc586
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Indexer.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Lister.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Lister.class
new file mode 100644
index 00000000000..81cdaec2a65
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Lister.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$1.class
new file mode 100644
index 00000000000..1912cbdbdfd
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$2.class
new file mode 100644
index 00000000000..9bd0cbee854
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$3.class
new file mode 100644
index 00000000000..ddbd7f53730
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$4.class
new file mode 100644
index 00000000000..9dfd4c5c90f
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$5.class
new file mode 100644
index 00000000000..8050a014e64
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$6.class
new file mode 100644
index 00000000000..126639456ef
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$HandleFile.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$HandleFile.class
new file mode 100644
index 00000000000..16d4ed73859
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$HandleFile.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$JarParser.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$JarParser.class
new file mode 100644
index 00000000000..5a62fdc204d
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$JarParser.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$ModeOption.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$ModeOption.class
new file mode 100644
index 00000000000..3630f9b3c21
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main$ModeOption.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main.class
new file mode 100644
index 00000000000..1c32274ee10
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Main.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Messages.class
new file mode 100644
index 00000000000..6d26c66934a
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Messages.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Updater.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Updater.class
new file mode 100644
index 00000000000..8fbd26661ad
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Updater.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/WorkSet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/WorkSet.class
new file mode 100644
index 00000000000..4a71d615eac
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/WorkSet.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/HashUtils.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/HashUtils.class
new file mode 100644
index 00000000000..4ece8879b1d
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/HashUtils.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/JarSigner.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/JarSigner.class
new file mode 100644
index 00000000000..3f0e38365e1
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/JarSigner.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/JarVerifier.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/JarVerifier.class
new file mode 100644
index 00000000000..5987cbc9756
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/JarVerifier.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$1.class
new file mode 100644
index 00000000000..c74201ccaec
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$10.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$10.class
new file mode 100644
index 00000000000..0be4ac8b9cf
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$10.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$11.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$11.class
new file mode 100644
index 00000000000..2666f2b4b03
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$11.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$12.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$12.class
new file mode 100644
index 00000000000..c0299c25447
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$12.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$2.class
new file mode 100644
index 00000000000..b56ebdce985
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$3.class
new file mode 100644
index 00000000000..ea4fda71ddc
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$4.class
new file mode 100644
index 00000000000..68b4cb2357c
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$5.class
new file mode 100644
index 00000000000..5a11e01c91c
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$6.class
new file mode 100644
index 00000000000..1415524558b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$7.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$7.class
new file mode 100644
index 00000000000..a3c1d5b6dad
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$7.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$8.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$8.class
new file mode 100644
index 00000000000..a07cb626761
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$8.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$9.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$9.class
new file mode 100644
index 00000000000..00e37fd700b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$9.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$ToolParser.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$ToolParser.class
new file mode 100644
index 00000000000..0c0d46acc72
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$ToolParser.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$ToolParserCallback.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$ToolParserCallback.class
new file mode 100644
index 00000000000..44284f87eaf
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main$ToolParserCallback.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main.class
new file mode 100644
index 00000000000..554f50bebcb
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Main.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Messages.class
new file mode 100644
index 00000000000..154ff066f88
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/Messages.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/SFHelper.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/SFHelper.class
new file mode 100644
index 00000000000..edfb1e1a91f
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner/SFHelper.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/ClassWrapper.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/ClassWrapper.class
new file mode 100644
index 00000000000..e759d12638c
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/ClassWrapper.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/CniIncludePrinter.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/CniIncludePrinter.class
new file mode 100644
index 00000000000..13a0a99fef3
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/CniIncludePrinter.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/CniPrintStream.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/CniPrintStream.class
new file mode 100644
index 00000000000..1f0d890b789
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/CniPrintStream.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/CniStubPrinter.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/CniStubPrinter.class
new file mode 100644
index 00000000000..c3cf12dda49
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/CniStubPrinter.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/FieldHelper.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/FieldHelper.class
new file mode 100644
index 00000000000..430344c87c7
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/FieldHelper.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniHelper.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniHelper.class
new file mode 100644
index 00000000000..938789b9556
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniHelper.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniIncludePrinter.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniIncludePrinter.class
new file mode 100644
index 00000000000..5124ee9cbab
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniIncludePrinter.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniPrintStream.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniPrintStream.class
new file mode 100644
index 00000000000..db0d6668438
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniPrintStream.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniStubPrinter.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniStubPrinter.class
new file mode 100644
index 00000000000..9f82c33ee84
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniStubPrinter.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Keywords.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Keywords.class
new file mode 100644
index 00000000000..7b6b063d7db
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Keywords.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$1.class
new file mode 100644
index 00000000000..ef2f2cff33e
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$10.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$10.class
new file mode 100644
index 00000000000..6ec567c1487
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$10.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$2.class
new file mode 100644
index 00000000000..a4a19b45b9d
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$3.class
new file mode 100644
index 00000000000..68e8f836405
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$4.class
new file mode 100644
index 00000000000..ef7248bf94b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$5.class
new file mode 100644
index 00000000000..0bcc04437b1
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$6.class
new file mode 100644
index 00000000000..9b90b1e6838
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$7.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$7.class
new file mode 100644
index 00000000000..8d0e8b0bf47
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$7.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$8.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$8.class
new file mode 100644
index 00000000000..ba3351cf081
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$8.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$9.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$9.class
new file mode 100644
index 00000000000..4f71d9ef104
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$9.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main.class
new file mode 100644
index 00000000000..c20b0af67c8
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/MethodHelper.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/MethodHelper.class
new file mode 100644
index 00000000000..45651970054
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/MethodHelper.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PackageWrapper.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PackageWrapper.class
new file mode 100644
index 00000000000..68f16fb418b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PackageWrapper.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$1.class
new file mode 100644
index 00000000000..49e070213f7
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$2.class
new file mode 100644
index 00000000000..0613196320c
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$3.class
new file mode 100644
index 00000000000..8e7c07f5904
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$4.class
new file mode 100644
index 00000000000..1e0725da07b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$5.class
new file mode 100644
index 00000000000..5791d4f8269
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup.class
new file mode 100644
index 00000000000..4833679fb4b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/PathOptionGroup.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Printer.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Printer.class
new file mode 100644
index 00000000000..76b2cbeedab
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Printer.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Text.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Text.class
new file mode 100644
index 00000000000..e084d89a781
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Text.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$1.class
new file mode 100644
index 00000000000..480a1c9d8b7
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$2.class
new file mode 100644
index 00000000000..ad59a9af0be
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$3.class
new file mode 100644
index 00000000000..4884326b5ab
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$4.class
new file mode 100644
index 00000000000..a58428d8c74
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$5.class
new file mode 100644
index 00000000000..f239807a0cb
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$6.class
new file mode 100644
index 00000000000..61a03e7b976
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd.class
new file mode 100644
index 00000000000..35a37577d5a
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CACertCmd.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$1.class
new file mode 100644
index 00000000000..ef1bbbd1283
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$10.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$10.class
new file mode 100644
index 00000000000..67c78b1bb86
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$10.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$2.class
new file mode 100644
index 00000000000..1cdf2a85788
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$3.class
new file mode 100644
index 00000000000..f9e702d5090
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$4.class
new file mode 100644
index 00000000000..ed8250a9cac
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$5.class
new file mode 100644
index 00000000000..65c4affd736
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$6.class
new file mode 100644
index 00000000000..ad81c286e38
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$7.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$7.class
new file mode 100644
index 00000000000..1400cf48ef6
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$7.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$8.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$8.class
new file mode 100644
index 00000000000..88eea663a23
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$8.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$9.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$9.class
new file mode 100644
index 00000000000..dd012fa6956
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd$9.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd.class
new file mode 100644
index 00000000000..d5a3ec029c3
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/CertReqCmd.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Command$ShutdownHook.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Command$ShutdownHook.class
new file mode 100644
index 00000000000..d1b0f5c3c1a
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Command$ShutdownHook.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Command.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Command.class
new file mode 100644
index 00000000000..f2db6a73d15
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Command.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$1.class
new file mode 100644
index 00000000000..6564bea183e
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$2.class
new file mode 100644
index 00000000000..2d78cdb56fe
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$3.class
new file mode 100644
index 00000000000..c81db25c076
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$4.class
new file mode 100644
index 00000000000..f37a26d9d70
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$5.class
new file mode 100644
index 00000000000..fb5a2c2af7c
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$6.class
new file mode 100644
index 00000000000..d1b39a09b1e
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd.class
new file mode 100644
index 00000000000..2abbe2a651b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/DeleteCmd.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$1.class
new file mode 100644
index 00000000000..b51727b9e0b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$2.class
new file mode 100644
index 00000000000..d5642532f13
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$3.class
new file mode 100644
index 00000000000..21552f81385
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$4.class
new file mode 100644
index 00000000000..7e71fa1afea
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$5.class
new file mode 100644
index 00000000000..f4c8c50bd3f
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$6.class
new file mode 100644
index 00000000000..28c32f2af51
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$7.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$7.class
new file mode 100644
index 00000000000..2134fb2ae22
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$7.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$8.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$8.class
new file mode 100644
index 00000000000..5ac0dd1471f
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd$8.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd.class
new file mode 100644
index 00000000000..2d18e798168
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ExportCmd.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$1.class
new file mode 100644
index 00000000000..ada9beb884b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$10.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$10.class
new file mode 100644
index 00000000000..029f2172941
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$10.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$11.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$11.class
new file mode 100644
index 00000000000..562a7304da5
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$11.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$12.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$12.class
new file mode 100644
index 00000000000..05d69bf8129
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$12.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$2.class
new file mode 100644
index 00000000000..eeae7420b15
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$3.class
new file mode 100644
index 00000000000..420e5dfc333
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$4.class
new file mode 100644
index 00000000000..6fa45ba749a
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$5.class
new file mode 100644
index 00000000000..32399766819
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$6.class
new file mode 100644
index 00000000000..6c83543c981
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$7.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$7.class
new file mode 100644
index 00000000000..46c3a8695de
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$7.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$8.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$8.class
new file mode 100644
index 00000000000..f9049f20a69
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$8.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$9.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$9.class
new file mode 100644
index 00000000000..67b6f737b1c
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd$9.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd.class
new file mode 100644
index 00000000000..097bd1f94cc
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/GenKeyCmd.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$1.class
new file mode 100644
index 00000000000..f8d2b79f016
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$2.class
new file mode 100644
index 00000000000..e94a186cb93
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$3.class
new file mode 100644
index 00000000000..5d8cfdbe996
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$4.class
new file mode 100644
index 00000000000..5ff96e7e330
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$5.class
new file mode 100644
index 00000000000..6d6bafcf38b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$6.class
new file mode 100644
index 00000000000..d3f2e5f2815
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd.class
new file mode 100644
index 00000000000..bfc431eb604
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/IdentityDBCmd.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$1.class
new file mode 100644
index 00000000000..0ed3a710875
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$10.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$10.class
new file mode 100644
index 00000000000..23893d93747
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$10.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$2.class
new file mode 100644
index 00000000000..a3533a2505d
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$3.class
new file mode 100644
index 00000000000..3aefff632e1
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$4.class
new file mode 100644
index 00000000000..c7725c60bc3
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$5.class
new file mode 100644
index 00000000000..651d8030dcf
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$6.class
new file mode 100644
index 00000000000..8a1be6601db
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$7.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$7.class
new file mode 100644
index 00000000000..960686d0124
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$7.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$8.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$8.class
new file mode 100644
index 00000000000..767c99100fe
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$8.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$9.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$9.class
new file mode 100644
index 00000000000..64b14bc9a98
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd$9.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd.class
new file mode 100644
index 00000000000..1700c217067
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ImportCmd.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$1.class
new file mode 100644
index 00000000000..b9b83293b2a
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$2.class
new file mode 100644
index 00000000000..d052102e850
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$3.class
new file mode 100644
index 00000000000..c513808caa9
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$4.class
new file mode 100644
index 00000000000..7ec8d0cc451
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$5.class
new file mode 100644
index 00000000000..156a5d74743
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$6.class
new file mode 100644
index 00000000000..d9d9b9d5d42
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$7.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$7.class
new file mode 100644
index 00000000000..492ab509103
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$7.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$8.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$8.class
new file mode 100644
index 00000000000..ba86c6c7db1
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$8.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$9.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$9.class
new file mode 100644
index 00000000000..2a7f85e20e5
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd$9.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd.class
new file mode 100644
index 00000000000..579d75e9c45
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyCloneCmd.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$1.class
new file mode 100644
index 00000000000..bee57e8fa48
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$2.class
new file mode 100644
index 00000000000..3e58af399ea
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$3.class
new file mode 100644
index 00000000000..77ea49d164c
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$4.class
new file mode 100644
index 00000000000..6a233ce3aeb
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$5.class
new file mode 100644
index 00000000000..461a0e693b6
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$6.class
new file mode 100644
index 00000000000..b7aabe18791
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$7.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$7.class
new file mode 100644
index 00000000000..fbe08b8617d
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$7.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$8.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$8.class
new file mode 100644
index 00000000000..9a72fcc4109
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd$8.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd.class
new file mode 100644
index 00000000000..13329d4c31b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/KeyPasswdCmd.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$1.class
new file mode 100644
index 00000000000..ec625738595
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$2.class
new file mode 100644
index 00000000000..c0b2cada66d
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$3.class
new file mode 100644
index 00000000000..a9c4006f857
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$4.class
new file mode 100644
index 00000000000..c3bdb3eee0f
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$5.class
new file mode 100644
index 00000000000..9048e24081f
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$6.class
new file mode 100644
index 00000000000..02364f5a3ad
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$7.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$7.class
new file mode 100644
index 00000000000..da2d5c9f35e
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd$7.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd.class
new file mode 100644
index 00000000000..5cb87baf2d1
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/ListCmd.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Main$NoParseOption.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Main$NoParseOption.class
new file mode 100644
index 00000000000..c545200c664
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Main$NoParseOption.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Main$ShutdownHook.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Main$ShutdownHook.class
new file mode 100644
index 00000000000..c80502410db
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Main$ShutdownHook.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Main.class
new file mode 100644
index 00000000000..725ed9bede7
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Main.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Messages.class
new file mode 100644
index 00000000000..60939a6c41e
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/Messages.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/PrintCertCmd$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/PrintCertCmd$1.class
new file mode 100644
index 00000000000..026e85743e8
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/PrintCertCmd$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/PrintCertCmd$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/PrintCertCmd$2.class
new file mode 100644
index 00000000000..120329523e8
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/PrintCertCmd$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/PrintCertCmd.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/PrintCertCmd.class
new file mode 100644
index 00000000000..4bdc2e6eb96
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/PrintCertCmd.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$1.class
new file mode 100644
index 00000000000..32dd134b2d6
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$10.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$10.class
new file mode 100644
index 00000000000..1a600bfc43f
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$10.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$2.class
new file mode 100644
index 00000000000..bab1439cf4b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$3.class
new file mode 100644
index 00000000000..3b60c0e8650
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$4.class
new file mode 100644
index 00000000000..77c008e29e5
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$5.class
new file mode 100644
index 00000000000..f19ac62642e
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$6.class
new file mode 100644
index 00000000000..066666937c3
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$7.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$7.class
new file mode 100644
index 00000000000..59ce68b19d5
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$7.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$8.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$8.class
new file mode 100644
index 00000000000..ae973fbc564
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$8.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$9.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$9.class
new file mode 100644
index 00000000000..cb3c780c2f7
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd$9.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd.class
new file mode 100644
index 00000000000..a9f5efb0f1c
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/SelfCertCmd.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$1.class
new file mode 100644
index 00000000000..0ec7554fdb8
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$2.class
new file mode 100644
index 00000000000..d3af827e06a
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$3.class
new file mode 100644
index 00000000000..4ba08d16d7c
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$4.class
new file mode 100644
index 00000000000..56e81e0bb0c
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$5.class
new file mode 100644
index 00000000000..3ce091dd279
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$6.class
new file mode 100644
index 00000000000..cd57d388608
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd.class b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd.class
new file mode 100644
index 00000000000..fcd88bf5d45
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/keytool/StorePasswdCmd.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Messages.class
new file mode 100644
index 00000000000..8162e115bc4
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Messages.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII$1.class
new file mode 100644
index 00000000000..9dfdb84bbc5
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII$2.class
new file mode 100644
index 00000000000..c289b9ded84
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII$HandleFile.class b/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII$HandleFile.class
new file mode 100644
index 00000000000..e7f6eab487c
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII$HandleFile.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII.class b/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII.class
new file mode 100644
index 00000000000..231dce25a14
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$1.class
new file mode 100644
index 00000000000..a10547aa200
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$2.class
new file mode 100644
index 00000000000..f010e80e866
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$3.class
new file mode 100644
index 00000000000..948c2695b42
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$4.class
new file mode 100644
index 00000000000..5ae24172043
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$5.class
new file mode 100644
index 00000000000..1edb963da34
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main.class
new file mode 100644
index 00000000000..3f402a94dd5
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Messages.class
new file mode 100644
index 00000000000..f80eceb5513
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Messages.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentContext.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentContext.class
new file mode 100644
index 00000000000..fef9e8bf013
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentContext.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentContextMap.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentContextMap.class
new file mode 100644
index 00000000000..09d84c05e2c
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentContextMap.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentMap$Entry.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentMap$Entry.class
new file mode 100644
index 00000000000..c37eee13d18
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentMap$Entry.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentMap.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentMap.class
new file mode 100644
index 00000000000..93ccfd8e1fd
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentMap.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/AbstractMethodGenerator.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/AbstractMethodGenerator.class
new file mode 100644
index 00000000000..a930096be79
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/AbstractMethodGenerator.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/ClassRmicCompiler$MethodRef.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/ClassRmicCompiler$MethodRef.class
new file mode 100644
index 00000000000..42fa516a821
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/ClassRmicCompiler$MethodRef.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/ClassRmicCompiler.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/ClassRmicCompiler.class
new file mode 100644
index 00000000000..302b5d94075
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/ClassRmicCompiler.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/CompilationError.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/CompilationError.class
new file mode 100644
index 00000000000..d18117c043d
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/CompilationError.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Generator.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Generator.class
new file mode 100644
index 00000000000..5a5fec49ca5
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Generator.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/GiopIo.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/GiopIo.class
new file mode 100644
index 00000000000..82784b8aad1
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/GiopIo.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/HashFinder.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/HashFinder.class
new file mode 100644
index 00000000000..a1f7eeeaa75
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/HashFinder.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$1.class
new file mode 100644
index 00000000000..eaf143e7be1
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$10.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$10.class
new file mode 100644
index 00000000000..1b88292d1cd
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$10.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$11.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$11.class
new file mode 100644
index 00000000000..445fbce6639
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$11.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$12.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$12.class
new file mode 100644
index 00000000000..ad7825eb9ff
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$12.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$13.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$13.class
new file mode 100644
index 00000000000..c7d50e665b1
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$13.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$14.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$14.class
new file mode 100644
index 00000000000..fb17a8ae4d5
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$14.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$15.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$15.class
new file mode 100644
index 00000000000..e6d5530f8e2
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$15.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$16.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$16.class
new file mode 100644
index 00000000000..4c97c226d3f
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$16.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$17.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$17.class
new file mode 100644
index 00000000000..b7a91fb5a1a
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$17.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$18.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$18.class
new file mode 100644
index 00000000000..923c3a9d4f9
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$18.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$2.class
new file mode 100644
index 00000000000..aa66ee3fef9
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$3.class
new file mode 100644
index 00000000000..4e07a58019a
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$4.class
new file mode 100644
index 00000000000..bf5788f2cf4
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$5.class
new file mode 100644
index 00000000000..963faad048e
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$6.class
new file mode 100644
index 00000000000..60254da5668
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$7.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$7.class
new file mode 100644
index 00000000000..0ea52dd2513
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$7.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$8.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$8.class
new file mode 100644
index 00000000000..c0f4c2f4ee0
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$8.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$9.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$9.class
new file mode 100644
index 00000000000..a19b9b66f22
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main$9.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main.class
new file mode 100644
index 00000000000..a2571607744
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Main.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Messages.class
new file mode 100644
index 00000000000..1a73827b360
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Messages.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/MethodGenerator.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/MethodGenerator.class
new file mode 100644
index 00000000000..272018323c8
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/MethodGenerator.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RMICException.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RMICException.class
new file mode 100644
index 00000000000..e3ebf5d1623
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RMICException.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RmiMethodGenerator.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RmiMethodGenerator.class
new file mode 100644
index 00000000000..731f27a5da7
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RmiMethodGenerator.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RmicBackend.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RmicBackend.class
new file mode 100644
index 00000000000..7c08d1aa492
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RmicBackend.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.class
new file mode 100644
index 00000000000..b66e612058c
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceRmicCompiler.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceRmicCompiler.class
new file mode 100644
index 00000000000..1c267c9ae5e
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceRmicCompiler.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Variables.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Variables.class
new file mode 100644
index 00000000000..c5a258b8202
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Variables.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/WrapUnWrapper.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/WrapUnWrapper.class
new file mode 100644
index 00000000000..fe7aa9c8cae
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/WrapUnWrapper.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/ActivationSystemImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/ActivationSystemImpl.class
new file mode 100644
index 00000000000..3633faaa8b3
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/ActivationSystemImpl.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/ActivationSystemImpl_Stub.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/ActivationSystemImpl_Stub.class
new file mode 100644
index 00000000000..8b798b3ad38
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/ActivationSystemImpl_Stub.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$1.class
new file mode 100644
index 00000000000..420e1a69aea
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$2.class
new file mode 100644
index 00000000000..9433c6c20c9
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$3.class
new file mode 100644
index 00000000000..0185eced0ed
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$4.class
new file mode 100644
index 00000000000..b3a9d245181
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$5.class
new file mode 100644
index 00000000000..3f27513f29d
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$6.class
new file mode 100644
index 00000000000..7f962c511c6
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main.class
new file mode 100644
index 00000000000..6675d24516b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Main.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Messages.class
new file mode 100644
index 00000000000..0c639221cf7
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/Messages.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/PersistentBidiHashTable$AdaptedReader.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/PersistentBidiHashTable$AdaptedReader.class
new file mode 100644
index 00000000000..e45236487d7
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/PersistentBidiHashTable$AdaptedReader.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/PersistentBidiHashTable$WriteToDiskTask.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/PersistentBidiHashTable$WriteToDiskTask.class
new file mode 100644
index 00000000000..d2bf71d7b83
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/PersistentBidiHashTable$WriteToDiskTask.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/PersistentBidiHashTable.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/PersistentBidiHashTable.class
new file mode 100644
index 00000000000..ea377e91407
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmid/PersistentBidiHashTable.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$1.class
new file mode 100644
index 00000000000..52143bbcfd6
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$2.class
new file mode 100644
index 00000000000..9c7052a21ab
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$3.class
new file mode 100644
index 00000000000..56426d64bd9
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$4.class
new file mode 100644
index 00000000000..7548abf4f51
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$5.class
new file mode 100644
index 00000000000..a697c94475f
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$6.class
new file mode 100644
index 00000000000..92758c6ab85
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main$6.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main.class
new file mode 100644
index 00000000000..ecd6540a28b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Main.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Messages.class
new file mode 100644
index 00000000000..b100ea71619
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/Messages.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/PersistentHashTable$WriteToDiskTask.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/PersistentHashTable$WriteToDiskTask.class
new file mode 100644
index 00000000000..f08619a5ee8
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/PersistentHashTable$WriteToDiskTask.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/PersistentHashTable.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/PersistentHashTable.class
new file mode 100644
index 00000000000..92304dccb85
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/PersistentHashTable.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/RegistryImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/RegistryImpl.class
new file mode 100644
index 00000000000..bf6d1ced504
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/RegistryImpl.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/RegistryImpl_Skel.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/RegistryImpl_Skel.class
new file mode 100644
index 00000000000..50d6faf3dea
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/RegistryImpl_Skel.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/RegistryImpl_Stub.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/RegistryImpl_Stub.class
new file mode 100644
index 00000000000..19b12483e14
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/rmiregistry/RegistryImpl_Stub.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/Messages.class
new file mode 100644
index 00000000000..d670a68cfc3
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/Messages.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer$1.class
new file mode 100644
index 00000000000..c8ce2a57b2b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer$2.class
new file mode 100644
index 00000000000..18583dc1e06
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer$3.class
new file mode 100644
index 00000000000..9a5b3a72f40
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer.class b/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer.class
new file mode 100644
index 00000000000..f564268d81b
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/serialver/SerialVer.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Main$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Main$1.class
new file mode 100644
index 00000000000..bfe1d362f7e
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Main$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Main$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Main$2.class
new file mode 100644
index 00000000000..8fd28acb14f
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Main$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Main.class
new file mode 100644
index 00000000000..0b3d3c93e59
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Main.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Messages.class
new file mode 100644
index 00000000000..c9b9175cca0
--- /dev/null
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/tnameserv/Messages.class
Binary files differ
diff --git a/libjava/classpath/tools/external/README b/libjava/classpath/tools/external/README
new file mode 100644
index 00000000000..5f0cd1ab2b4
--- /dev/null
+++ b/libjava/classpath/tools/external/README
@@ -0,0 +1,9 @@
+ASM is a bytecode processing library used by GNU Classpath's rmic and
+javah tools. It is not maintained as part of GNU Classpath, but is
+imported into the repository for simpler builds.
+
+The ASM project pages are at http://asm.objectweb.org/
+
+The currently imported version is ASM 2.2.3. The sources were checked
+out of CVS using the ASM_2_2_3 tag. I've only imported a subset of
+the whole checkout: namely, LICENSE.txt and the sources themselves.
diff --git a/libjava/classpath/tools/external/asm/LICENSE.txt b/libjava/classpath/tools/external/asm/LICENSE.txt
new file mode 100644
index 00000000000..d0cd82defe0
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/LICENSE.txt
@@ -0,0 +1,28 @@
+
+ ASM: a very small and fast Java bytecode manipulation framework
+ Copyright (c) 2000-2005 INRIA, France Telecom
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holders nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/AnnotationVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/AnnotationVisitor.java
new file mode 100644
index 00000000000..8226ae8cd7f
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/AnnotationVisitor.java
@@ -0,0 +1,88 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * A visitor to visit a Java annotation. The methods of this interface must be
+ * called in the following order: (<tt>visit<tt> | <tt>visitEnum<tt> |
+ * <tt>visitAnnotation<tt> | <tt>visitArray<tt>)* <tt>visitEnd<tt>.
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+public interface AnnotationVisitor {
+
+ /**
+ * Visits a primitive value of the annotation.
+ *
+ * @param name the value name.
+ * @param value the actual value, whose type must be {@link Byte},
+ * {@link Boolean}, {@link Character}, {@link Short},
+ * {@link Integer}, {@link Long}, {@link Float}, {@link Double},
+ * {@link String} or {@link Type}.
+ */
+ void visit(String name, Object value);
+
+ /**
+ * Visits an enumeration value of the annotation.
+ *
+ * @param name the value name.
+ * @param desc the class descriptor of the enumeration class.
+ * @param value the actual enumeration value.
+ */
+ void visitEnum(String name, String desc, String value);
+
+ /**
+ * Visits a nested annotation value of the annotation.
+ *
+ * @param name the value name.
+ * @param desc the class descriptor of the nested annotation class.
+ * @return a non null visitor to visit the actual nested annotation value.
+ * <i>The nested annotation value must be fully visited before
+ * calling other methods on this annotation visitor</i>.
+ */
+ AnnotationVisitor visitAnnotation(String name, String desc);
+
+ /**
+ * Visits an array value of the annotation.
+ *
+ * @param name the value name.
+ * @return a non null visitor to visit the actual array value elements. The
+ * 'name' parameters passed to the methods of this visitor are
+ * ignored. <i>All the array values must be visited before calling
+ * other methods on this annotation visitor</i>.
+ */
+ AnnotationVisitor visitArray(String name);
+
+ /**
+ * Visits the end of the annotation.
+ */
+ void visitEnd();
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/AnnotationWriter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/AnnotationWriter.java
new file mode 100644
index 00000000000..918e23419bf
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/AnnotationWriter.java
@@ -0,0 +1,311 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * An {@link AnnotationVisitor} that generates annotations in bytecode form.
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+final class AnnotationWriter implements AnnotationVisitor {
+
+ /**
+ * The class writer to which this annotation must be added.
+ */
+ private final ClassWriter cw;
+
+ /**
+ * The number of values in this annotation.
+ */
+ private int size;
+
+ /**
+ * <tt>true<tt> if values are named, <tt>false</tt> otherwise. Annotation
+ * writers used for annotation default and annotation arrays use unnamed
+ * values.
+ */
+ private final boolean named;
+
+ /**
+ * The annotation values in bytecode form. This byte vector only contains
+ * the values themselves, i.e. the number of values must be stored as a
+ * unsigned short just before these bytes.
+ */
+ private final ByteVector bv;
+
+ /**
+ * The byte vector to be used to store the number of values of this
+ * annotation. See {@link #bv}.
+ */
+ private final ByteVector parent;
+
+ /**
+ * Where the number of values of this annotation must be stored in
+ * {@link #parent}.
+ */
+ private final int offset;
+
+ /**
+ * Next annotation writer. This field is used to store annotation lists.
+ */
+ AnnotationWriter next;
+
+ /**
+ * Previous annotation writer. This field is used to store annotation lists.
+ */
+ AnnotationWriter prev;
+
+ // ------------------------------------------------------------------------
+ // Constructor
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructs a new {@link AnnotationWriter}.
+ *
+ * @param cw the class writer to which this annotation must be added.
+ * @param named <tt>true<tt> if values are named, <tt>false</tt> otherwise.
+ * @param bv where the annotation values must be stored.
+ * @param parent where the number of annotation values must be stored.
+ * @param offset where in <tt>parent</tt> the number of annotation values must
+ * be stored.
+ */
+ AnnotationWriter(
+ final ClassWriter cw,
+ final boolean named,
+ final ByteVector bv,
+ final ByteVector parent,
+ final int offset)
+ {
+ this.cw = cw;
+ this.named = named;
+ this.bv = bv;
+ this.parent = parent;
+ this.offset = offset;
+ }
+
+ // ------------------------------------------------------------------------
+ // Implementation of the AnnotationVisitor interface
+ // ------------------------------------------------------------------------
+
+ public void visit(final String name, final Object value) {
+ ++size;
+ if (named) {
+ bv.putShort(cw.newUTF8(name));
+ }
+ if (value instanceof String) {
+ bv.put12('s', cw.newUTF8((String) value));
+ } else if (value instanceof Byte) {
+ bv.put12('B', cw.newInteger(((Byte) value).byteValue()).index);
+ } else if (value instanceof Boolean) {
+ int v = ((Boolean) value).booleanValue() ? 1 : 0;
+ bv.put12('Z', cw.newInteger(v).index);
+ } else if (value instanceof Character) {
+ bv.put12('C', cw.newInteger(((Character) value).charValue()).index);
+ } else if (value instanceof Short) {
+ bv.put12('S', cw.newInteger(((Short) value).shortValue()).index);
+ } else if (value instanceof Type) {
+ bv.put12('c', cw.newUTF8(((Type) value).getDescriptor()));
+ } else if (value instanceof byte[]) {
+ byte[] v = (byte[]) value;
+ bv.put12('[', v.length);
+ for (int i = 0; i < v.length; i++) {
+ bv.put12('B', cw.newInteger(v[i]).index);
+ }
+ } else if (value instanceof boolean[]) {
+ boolean[] v = (boolean[]) value;
+ bv.put12('[', v.length);
+ for (int i = 0; i < v.length; i++) {
+ bv.put12('Z', cw.newInteger(v[i] ? 1 : 0).index);
+ }
+ } else if (value instanceof short[]) {
+ short[] v = (short[]) value;
+ bv.put12('[', v.length);
+ for (int i = 0; i < v.length; i++) {
+ bv.put12('S', cw.newInteger(v[i]).index);
+ }
+ } else if (value instanceof char[]) {
+ char[] v = (char[]) value;
+ bv.put12('[', v.length);
+ for (int i = 0; i < v.length; i++) {
+ bv.put12('C', cw.newInteger(v[i]).index);
+ }
+ } else if (value instanceof int[]) {
+ int[] v = (int[]) value;
+ bv.put12('[', v.length);
+ for (int i = 0; i < v.length; i++) {
+ bv.put12('I', cw.newInteger(v[i]).index);
+ }
+ } else if (value instanceof long[]) {
+ long[] v = (long[]) value;
+ bv.put12('[', v.length);
+ for (int i = 0; i < v.length; i++) {
+ bv.put12('J', cw.newLong(v[i]).index);
+ }
+ } else if (value instanceof float[]) {
+ float[] v = (float[]) value;
+ bv.put12('[', v.length);
+ for (int i = 0; i < v.length; i++) {
+ bv.put12('F', cw.newFloat(v[i]).index);
+ }
+ } else if (value instanceof double[]) {
+ double[] v = (double[]) value;
+ bv.put12('[', v.length);
+ for (int i = 0; i < v.length; i++) {
+ bv.put12('D', cw.newDouble(v[i]).index);
+ }
+ } else {
+ Item i = cw.newConstItem(value);
+ bv.put12(".s.IFJDCS".charAt(i.type), i.index);
+ }
+ }
+
+ public void visitEnum(
+ final String name,
+ final String desc,
+ final String value)
+ {
+ ++size;
+ if (named) {
+ bv.putShort(cw.newUTF8(name));
+ }
+ bv.put12('e', cw.newUTF8(desc)).putShort(cw.newUTF8(value));
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String name,
+ final String desc)
+ {
+ ++size;
+ if (named) {
+ bv.putShort(cw.newUTF8(name));
+ }
+ // write tag and type, and reserve space for values count
+ bv.put12('@', cw.newUTF8(desc)).putShort(0);
+ return new AnnotationWriter(cw, true, bv, bv, bv.length - 2);
+ }
+
+ public AnnotationVisitor visitArray(final String name) {
+ ++size;
+ if (named) {
+ bv.putShort(cw.newUTF8(name));
+ }
+ // write tag, and reserve space for array size
+ bv.put12('[', 0);
+ return new AnnotationWriter(cw, false, bv, bv, bv.length - 2);
+ }
+
+ public void visitEnd() {
+ if (parent != null) {
+ byte[] data = parent.data;
+ data[offset] = (byte) (size >>> 8);
+ data[offset + 1] = (byte) size;
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the size of this annotation writer list.
+ *
+ * @return the size of this annotation writer list.
+ */
+ int getSize() {
+ int size = 0;
+ AnnotationWriter aw = this;
+ while (aw != null) {
+ size += aw.bv.length;
+ aw = aw.next;
+ }
+ return size;
+ }
+
+ /**
+ * Puts the annotations of this annotation writer list into the given byte
+ * vector.
+ *
+ * @param out where the annotations must be put.
+ */
+ void put(final ByteVector out) {
+ int n = 0;
+ int size = 2;
+ AnnotationWriter aw = this;
+ AnnotationWriter last = null;
+ while (aw != null) {
+ ++n;
+ size += aw.bv.length;
+ aw.visitEnd(); // in case user forgot to call visitEnd
+ aw.prev = last;
+ last = aw;
+ aw = aw.next;
+ }
+ out.putInt(size);
+ out.putShort(n);
+ aw = last;
+ while (aw != null) {
+ out.putByteArray(aw.bv.data, 0, aw.bv.length);
+ aw = aw.prev;
+ }
+ }
+
+ /**
+ * Puts the given annotation lists into the given byte vector.
+ *
+ * @param panns an array of annotation writer lists.
+ * @param out where the annotations must be put.
+ */
+ static void put(final AnnotationWriter[] panns, final ByteVector out) {
+ int size = 1 + 2 * panns.length;
+ for (int i = 0; i < panns.length; ++i) {
+ size += panns[i] == null ? 0 : panns[i].getSize();
+ }
+ out.putInt(size).putByte(panns.length);
+ for (int i = 0; i < panns.length; ++i) {
+ AnnotationWriter aw = panns[i];
+ AnnotationWriter last = null;
+ int n = 0;
+ while (aw != null) {
+ ++n;
+ aw.visitEnd(); // in case user forgot to call visitEnd
+ aw.prev = last;
+ last = aw;
+ aw = aw.next;
+ }
+ out.putShort(n);
+ aw = last;
+ while (aw != null) {
+ out.putByteArray(aw.bv.data, 0, aw.bv.length);
+ aw = aw.prev;
+ }
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/Attribute.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/Attribute.java
new file mode 100644
index 00000000000..c55eb9324d0
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/Attribute.java
@@ -0,0 +1,254 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * A non standard class, field, method or code attribute.
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+public class Attribute {
+
+ /**
+ * The type of this attribute.
+ */
+ public final String type;
+
+ /**
+ * The raw value of this attribute, used only for unknown attributes.
+ */
+ byte[] value;
+
+ /**
+ * The next attribute in this attribute list. May be <tt>null</tt>.
+ */
+ Attribute next;
+
+ /**
+ * Constructs a new empty attribute.
+ *
+ * @param type the type of the attribute.
+ */
+ protected Attribute(final String type) {
+ this.type = type;
+ }
+
+ /**
+ * Returns <tt>true</tt> if this type of attribute is unknown. The default
+ * implementation of this method always returns <tt>true</tt>.
+ *
+ * @return <tt>true</tt> if this type of attribute is unknown.
+ */
+ public boolean isUnknown() {
+ return true;
+ }
+
+ /**
+ * Returns <tt>true</tt> if this type of attribute is a code attribute.
+ *
+ * @return <tt>true</tt> if this type of attribute is a code attribute.
+ */
+ public boolean isCodeAttribute() {
+ return false;
+ }
+
+ /**
+ * Returns the labels corresponding to this attribute.
+ *
+ * @return the labels corresponding to this attribute, or <tt>null</tt> if
+ * this attribute is not a code attribute that contains labels.
+ */
+ protected Label[] getLabels() {
+ return null;
+ }
+
+ /**
+ * Reads a {@link #type type} attribute. This method must return a <i>new</i>
+ * {@link Attribute} object, of type {@link #type type}, corresponding to
+ * the <tt>len</tt> bytes starting at the given offset, in the given class
+ * reader.
+ *
+ * @param cr the class that contains the attribute to be read.
+ * @param off index of the first byte of the attribute's content in {@link
+ * ClassReader#b cr.b}. The 6 attribute header bytes, containing the
+ * type and the length of the attribute, are not taken into account
+ * here.
+ * @param len the length of the attribute's content.
+ * @param buf buffer to be used to call
+ * {@link ClassReader#readUTF8 readUTF8},
+ * {@link ClassReader#readClass(int,char[]) readClass} or
+ * {@link ClassReader#readConst readConst}.
+ * @param codeOff index of the first byte of code's attribute content in
+ * {@link ClassReader#b cr.b}, or -1 if the attribute to be read is
+ * not a code attribute. The 6 attribute header bytes, containing the
+ * type and the length of the attribute, are not taken into account
+ * here.
+ * @param labels the labels of the method's code, or <tt>null</tt> if the
+ * attribute to be read is not a code attribute.
+ * @return a <i>new</i> {@link Attribute} object corresponding to the given
+ * bytes.
+ */
+ protected Attribute read(
+ ClassReader cr,
+ int off,
+ int len,
+ char[] buf,
+ int codeOff,
+ Label[] labels)
+ {
+ Attribute attr = new Attribute(type);
+ attr.value = new byte[len];
+ System.arraycopy(cr.b, off, attr.value, 0, len);
+ return attr;
+ }
+
+ /**
+ * Returns the byte array form of this attribute.
+ *
+ * @param cw the class to which this attribute must be added. This parameter
+ * can be used to add to the constant pool of this class the items
+ * that corresponds to this attribute.
+ * @param code the bytecode of the method corresponding to this code
+ * attribute, or <tt>null</tt> if this attribute is not a code
+ * attributes.
+ * @param len the length of the bytecode of the method corresponding to this
+ * code attribute, or <tt>null</tt> if this attribute is not a code
+ * attribute.
+ * @param maxStack the maximum stack size of the method corresponding to
+ * this code attribute, or -1 if this attribute is not a code
+ * attribute.
+ * @param maxLocals the maximum number of local variables of the method
+ * corresponding to this code attribute, or -1 if this attribute is
+ * not a code attribute.
+ * @return the byte array form of this attribute.
+ */
+ protected ByteVector write(
+ ClassWriter cw,
+ byte[] code,
+ int len,
+ int maxStack,
+ int maxLocals)
+ {
+ ByteVector v = new ByteVector();
+ v.data = value;
+ v.length = value.length;
+ return v;
+ }
+
+ /**
+ * Returns the length of the attribute list that begins with this attribute.
+ *
+ * @return the length of the attribute list that begins with this attribute.
+ */
+ final int getCount() {
+ int count = 0;
+ Attribute attr = this;
+ while (attr != null) {
+ count += 1;
+ attr = attr.next;
+ }
+ return count;
+ }
+
+ /**
+ * Returns the size of all the attributes in this attribute list.
+ *
+ * @param cw the class writer to be used to convert the attributes into byte
+ * arrays, with the {@link #write write} method.
+ * @param code the bytecode of the method corresponding to these code
+ * attributes, or <tt>null</tt> if these attributes are not code
+ * attributes.
+ * @param len the length of the bytecode of the method corresponding to
+ * these code attributes, or <tt>null</tt> if these attributes are
+ * not code attributes.
+ * @param maxStack the maximum stack size of the method corresponding to
+ * these code attributes, or -1 if these attributes are not code
+ * attributes.
+ * @param maxLocals the maximum number of local variables of the method
+ * corresponding to these code attributes, or -1 if these attributes
+ * are not code attributes.
+ * @return the size of all the attributes in this attribute list. This size
+ * includes the size of the attribute headers.
+ */
+ final int getSize(
+ final ClassWriter cw,
+ final byte[] code,
+ final int len,
+ final int maxStack,
+ final int maxLocals)
+ {
+ Attribute attr = this;
+ int size = 0;
+ while (attr != null) {
+ cw.newUTF8(attr.type);
+ size += attr.write(cw, code, len, maxStack, maxLocals).length + 6;
+ attr = attr.next;
+ }
+ return size;
+ }
+
+ /**
+ * Writes all the attributes of this attribute list in the given byte
+ * vector.
+ *
+ * @param cw the class writer to be used to convert the attributes into byte
+ * arrays, with the {@link #write write} method.
+ * @param code the bytecode of the method corresponding to these code
+ * attributes, or <tt>null</tt> if these attributes are not code
+ * attributes.
+ * @param len the length of the bytecode of the method corresponding to
+ * these code attributes, or <tt>null</tt> if these attributes are
+ * not code attributes.
+ * @param maxStack the maximum stack size of the method corresponding to
+ * these code attributes, or -1 if these attributes are not code
+ * attributes.
+ * @param maxLocals the maximum number of local variables of the method
+ * corresponding to these code attributes, or -1 if these attributes
+ * are not code attributes.
+ * @param out where the attributes must be written.
+ */
+ final void put(
+ final ClassWriter cw,
+ final byte[] code,
+ final int len,
+ final int maxStack,
+ final int maxLocals,
+ final ByteVector out)
+ {
+ Attribute attr = this;
+ while (attr != null) {
+ ByteVector b = attr.write(cw, code, len, maxStack, maxLocals);
+ out.putShort(cw.newUTF8(attr.type)).putInt(b.length);
+ out.putByteArray(b.data, 0, b.length);
+ attr = attr.next;
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/ByteVector.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/ByteVector.java
new file mode 100644
index 00000000000..270778b860e
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/ByteVector.java
@@ -0,0 +1,293 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * A dynamically extensible vector of bytes. This class is roughly equivalent to
+ * a DataOutputStream on top of a ByteArrayOutputStream, but is more efficient.
+ *
+ * @author Eric Bruneton
+ */
+public class ByteVector {
+
+ /**
+ * The content of this vector.
+ */
+ byte[] data;
+
+ /**
+ * Actual number of bytes in this vector.
+ */
+ int length;
+
+ /**
+ * Constructs a new {@link ByteVector ByteVector} with a default initial
+ * size.
+ */
+ public ByteVector() {
+ data = new byte[64];
+ }
+
+ /**
+ * Constructs a new {@link ByteVector ByteVector} with the given initial
+ * size.
+ *
+ * @param initialSize the initial size of the byte vector to be constructed.
+ */
+ public ByteVector(final int initialSize) {
+ data = new byte[initialSize];
+ }
+
+ /**
+ * Puts a byte into this byte vector. The byte vector is automatically
+ * enlarged if necessary.
+ *
+ * @param b a byte.
+ * @return this byte vector.
+ */
+ public ByteVector putByte(final int b) {
+ int length = this.length;
+ if (length + 1 > data.length) {
+ enlarge(1);
+ }
+ data[length++] = (byte) b;
+ this.length = length;
+ return this;
+ }
+
+ /**
+ * Puts two bytes into this byte vector. The byte vector is automatically
+ * enlarged if necessary.
+ *
+ * @param b1 a byte.
+ * @param b2 another byte.
+ * @return this byte vector.
+ */
+ ByteVector put11(final int b1, final int b2) {
+ int length = this.length;
+ if (length + 2 > data.length) {
+ enlarge(2);
+ }
+ byte[] data = this.data;
+ data[length++] = (byte) b1;
+ data[length++] = (byte) b2;
+ this.length = length;
+ return this;
+ }
+
+ /**
+ * Puts a short into this byte vector. The byte vector is automatically
+ * enlarged if necessary.
+ *
+ * @param s a short.
+ * @return this byte vector.
+ */
+ public ByteVector putShort(final int s) {
+ int length = this.length;
+ if (length + 2 > data.length) {
+ enlarge(2);
+ }
+ byte[] data = this.data;
+ data[length++] = (byte) (s >>> 8);
+ data[length++] = (byte) s;
+ this.length = length;
+ return this;
+ }
+
+ /**
+ * Puts a byte and a short into this byte vector. The byte vector is
+ * automatically enlarged if necessary.
+ *
+ * @param b a byte.
+ * @param s a short.
+ * @return this byte vector.
+ */
+ ByteVector put12(final int b, final int s) {
+ int length = this.length;
+ if (length + 3 > data.length) {
+ enlarge(3);
+ }
+ byte[] data = this.data;
+ data[length++] = (byte) b;
+ data[length++] = (byte) (s >>> 8);
+ data[length++] = (byte) s;
+ this.length = length;
+ return this;
+ }
+
+ /**
+ * Puts an int into this byte vector. The byte vector is automatically
+ * enlarged if necessary.
+ *
+ * @param i an int.
+ * @return this byte vector.
+ */
+ public ByteVector putInt(final int i) {
+ int length = this.length;
+ if (length + 4 > data.length) {
+ enlarge(4);
+ }
+ byte[] data = this.data;
+ data[length++] = (byte) (i >>> 24);
+ data[length++] = (byte) (i >>> 16);
+ data[length++] = (byte) (i >>> 8);
+ data[length++] = (byte) i;
+ this.length = length;
+ return this;
+ }
+
+ /**
+ * Puts a long into this byte vector. The byte vector is automatically
+ * enlarged if necessary.
+ *
+ * @param l a long.
+ * @return this byte vector.
+ */
+ public ByteVector putLong(final long l) {
+ int length = this.length;
+ if (length + 8 > data.length) {
+ enlarge(8);
+ }
+ byte[] data = this.data;
+ int i = (int) (l >>> 32);
+ data[length++] = (byte) (i >>> 24);
+ data[length++] = (byte) (i >>> 16);
+ data[length++] = (byte) (i >>> 8);
+ data[length++] = (byte) i;
+ i = (int) l;
+ data[length++] = (byte) (i >>> 24);
+ data[length++] = (byte) (i >>> 16);
+ data[length++] = (byte) (i >>> 8);
+ data[length++] = (byte) i;
+ this.length = length;
+ return this;
+ }
+
+ /**
+ * Puts an UTF8 string into this byte vector. The byte vector is
+ * automatically enlarged if necessary.
+ *
+ * @param s a String.
+ * @return this byte vector.
+ */
+ public ByteVector putUTF8(final String s) {
+ int charLength = s.length();
+ if (length + 2 + charLength > data.length) {
+ enlarge(2 + charLength);
+ }
+ int len = length;
+ byte[] data = this.data;
+ // optimistic algorithm: instead of computing the byte length and then
+ // serializing the string (which requires two loops), we assume the byte
+ // length is equal to char length (which is the most frequent case), and
+ // we start serializing the string right away. During the serialization,
+ // if we find that this assumption is wrong, we continue with the
+ // general method.
+ data[len++] = (byte) (charLength >>> 8);
+ data[len++] = (byte) (charLength);
+ for (int i = 0; i < charLength; ++i) {
+ char c = s.charAt(i);
+ if (c >= '\001' && c <= '\177') {
+ data[len++] = (byte) c;
+ } else {
+ int byteLength = i;
+ for (int j = i; j < charLength; ++j) {
+ c = s.charAt(j);
+ if (c >= '\001' && c <= '\177') {
+ byteLength++;
+ } else if (c > '\u07FF') {
+ byteLength += 3;
+ } else {
+ byteLength += 2;
+ }
+ }
+ data[length] = (byte) (byteLength >>> 8);
+ data[length + 1] = (byte) (byteLength);
+ if (length + 2 + byteLength > data.length) {
+ length = len;
+ enlarge(2 + byteLength);
+ data = this.data;
+ }
+ for (int j = i; j < charLength; ++j) {
+ c = s.charAt(j);
+ if (c >= '\001' && c <= '\177') {
+ data[len++] = (byte) c;
+ } else if (c > '\u07FF') {
+ data[len++] = (byte) (0xE0 | c >> 12 & 0xF);
+ data[len++] = (byte) (0x80 | c >> 6 & 0x3F);
+ data[len++] = (byte) (0x80 | c & 0x3F);
+ } else {
+ data[len++] = (byte) (0xC0 | c >> 6 & 0x1F);
+ data[len++] = (byte) (0x80 | c & 0x3F);
+ }
+ }
+ break;
+ }
+ }
+ length = len;
+ return this;
+ }
+
+ /**
+ * Puts an array of bytes into this byte vector. The byte vector is
+ * automatically enlarged if necessary.
+ *
+ * @param b an array of bytes. May be <tt>null</tt> to put <tt>len</tt>
+ * null bytes into this byte vector.
+ * @param off index of the fist byte of b that must be copied.
+ * @param len number of bytes of b that must be copied.
+ * @return this byte vector.
+ */
+ public ByteVector putByteArray(final byte[] b, final int off, final int len)
+ {
+ if (length + len > data.length) {
+ enlarge(len);
+ }
+ if (b != null) {
+ System.arraycopy(b, off, data, length, len);
+ }
+ length += len;
+ return this;
+ }
+
+ /**
+ * Enlarge this byte vector so that it can receive n more bytes.
+ *
+ * @param size number of additional bytes that this byte vector should be
+ * able to receive.
+ */
+ private void enlarge(final int size) {
+ int length1 = 2 * data.length;
+ int length2 = length + size;
+ byte[] newData = new byte[length1 > length2 ? length1 : length2];
+ System.arraycopy(data, 0, newData, 0, length);
+ data = newData;
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/ClassAdapter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/ClassAdapter.java
new file mode 100644
index 00000000000..5f12b08d542
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/ClassAdapter.java
@@ -0,0 +1,121 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * An empty {@link ClassVisitor} that delegates to another {@link ClassVisitor}.
+ * This class can be used as a super class to quickly implement usefull class
+ * adapter classes, just by overriding the necessary methods.
+ *
+ * @author Eric Bruneton
+ */
+public class ClassAdapter implements ClassVisitor {
+
+ /**
+ * The {@link ClassVisitor} to which this adapter delegates calls.
+ */
+ protected ClassVisitor cv;
+
+ /**
+ * Constructs a new {@link ClassAdapter} object.
+ *
+ * @param cv the class visitor to which this adapter must delegate calls.
+ */
+ public ClassAdapter(final ClassVisitor cv) {
+ this.cv = cv;
+ }
+
+ public void visit(
+ final int version,
+ final int access,
+ final String name,
+ final String signature,
+ final String superName,
+ final String[] interfaces)
+ {
+ cv.visit(version, access, name, signature, superName, interfaces);
+ }
+
+ public void visitSource(final String source, final String debug) {
+ cv.visitSource(source, debug);
+ }
+
+ public void visitOuterClass(
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ cv.visitOuterClass(owner, name, desc);
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ return cv.visitAnnotation(desc, visible);
+ }
+
+ public void visitAttribute(final Attribute attr) {
+ cv.visitAttribute(attr);
+ }
+
+ public void visitInnerClass(
+ final String name,
+ final String outerName,
+ final String innerName,
+ final int access)
+ {
+ cv.visitInnerClass(name, outerName, innerName, access);
+ }
+
+ public FieldVisitor visitField(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final Object value)
+ {
+ return cv.visitField(access, name, desc, signature, value);
+ }
+
+ public MethodVisitor visitMethod(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final String[] exceptions)
+ {
+ return cv.visitMethod(access, name, desc, signature, exceptions);
+ }
+
+ public void visitEnd() {
+ cv.visitEnd();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/ClassReader.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/ClassReader.java
new file mode 100644
index 00000000000..6924b57dc6d
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/ClassReader.java
@@ -0,0 +1,1606 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+import java.io.InputStream;
+import java.io.IOException;
+
+/**
+ * A Java class parser to make a {@link ClassVisitor} visit an existing class.
+ * This class parses a byte array conforming to the Java class file format and
+ * calls the appropriate visit methods of a given class visitor for each field,
+ * method and bytecode instruction encountered.
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+public class ClassReader {
+
+ /**
+ * The class to be parsed. <i>The content of this array must not be
+ * modified. This field is intended for {@link Attribute} sub classes, and
+ * is normally not needed by class generators or adapters.</i>
+ */
+ public final byte[] b;
+
+ /**
+ * The start index of each constant pool item in {@link #b b}, plus one.
+ * The one byte offset skips the constant pool item tag that indicates its
+ * type.
+ */
+ private int[] items;
+
+ /**
+ * The String objects corresponding to the CONSTANT_Utf8 items. This cache
+ * avoids multiple parsing of a given CONSTANT_Utf8 constant pool item,
+ * which GREATLY improves performances (by a factor 2 to 3). This caching
+ * strategy could be extended to all constant pool items, but its benefit
+ * would not be so great for these items (because they are much less
+ * expensive to parse than CONSTANT_Utf8 items).
+ */
+ private String[] strings;
+
+ /**
+ * Maximum length of the strings contained in the constant pool of the
+ * class.
+ */
+ private int maxStringLength;
+
+ /**
+ * Start index of the class header information (access, name...) in
+ * {@link #b b}.
+ */
+ public final int header;
+
+ // ------------------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructs a new {@link ClassReader} object.
+ *
+ * @param b the bytecode of the class to be read.
+ */
+ public ClassReader(final byte[] b) {
+ this(b, 0, b.length);
+ }
+
+ /**
+ * Constructs a new {@link ClassReader} object.
+ *
+ * @param b the bytecode of the class to be read.
+ * @param off the start offset of the class data.
+ * @param len the length of the class data.
+ */
+ public ClassReader(final byte[] b, final int off, final int len) {
+ this.b = b;
+ // parses the constant pool
+ items = new int[readUnsignedShort(off + 8)];
+ int ll = items.length;
+ strings = new String[ll];
+ int max = 0;
+ int index = off + 10;
+ for (int i = 1; i < ll; ++i) {
+ items[i] = index + 1;
+ int tag = b[index];
+ int size;
+ switch (tag) {
+ case ClassWriter.FIELD:
+ case ClassWriter.METH:
+ case ClassWriter.IMETH:
+ case ClassWriter.INT:
+ case ClassWriter.FLOAT:
+ case ClassWriter.NAME_TYPE:
+ size = 5;
+ break;
+ case ClassWriter.LONG:
+ case ClassWriter.DOUBLE:
+ size = 9;
+ ++i;
+ break;
+ case ClassWriter.UTF8:
+ size = 3 + readUnsignedShort(index + 1);
+ if (size > max) {
+ max = size;
+ }
+ break;
+ // case ClassWriter.CLASS:
+ // case ClassWriter.STR:
+ default:
+ size = 3;
+ break;
+ }
+ index += size;
+ }
+ maxStringLength = max;
+ // the class header information starts just after the constant pool
+ header = index;
+ }
+
+ /**
+ * Copies the constant pool data into the given {@link ClassWriter}. Should
+ * be called before the {@link #accept(ClassVisitor,boolean)} method.
+ *
+ * @param classWriter the {@link ClassWriter} to copy constant pool into.
+ */
+ void copyPool(final ClassWriter classWriter) {
+ char[] buf = new char[maxStringLength];
+ int ll = items.length;
+ Item[] items2 = new Item[ll];
+ for (int i = 1; i < ll; i++) {
+ int index = items[i];
+ int tag = b[index - 1];
+ Item item = new Item(i);
+ int nameType;
+ switch (tag) {
+ case ClassWriter.FIELD:
+ case ClassWriter.METH:
+ case ClassWriter.IMETH:
+ nameType = items[readUnsignedShort(index + 2)];
+ item.set(tag,
+ readClass(index, buf),
+ readUTF8(nameType, buf),
+ readUTF8(nameType + 2, buf));
+ break;
+
+ case ClassWriter.INT:
+ item.set(readInt(index));
+ break;
+
+ case ClassWriter.FLOAT:
+ item.set(Float.intBitsToFloat(readInt(index)));
+ break;
+
+ case ClassWriter.NAME_TYPE:
+ item.set(tag,
+ readUTF8(index, buf),
+ readUTF8(index + 2, buf),
+ null);
+ break;
+
+ case ClassWriter.LONG:
+ item.set(readLong(index));
+ ++i;
+ break;
+
+ case ClassWriter.DOUBLE:
+ item.set(Double.longBitsToDouble(readLong(index)));
+ ++i;
+ break;
+
+ case ClassWriter.UTF8: {
+ String s = strings[i];
+ if (s == null) {
+ index = items[i];
+ s = strings[i] = readUTF(index + 2,
+ readUnsignedShort(index),
+ buf);
+ }
+ item.set(tag, s, null, null);
+ }
+ break;
+
+ // case ClassWriter.STR:
+ // case ClassWriter.CLASS:
+ default:
+ item.set(tag, readUTF8(index, buf), null, null);
+ break;
+ }
+
+ int index2 = item.hashCode % items2.length;
+ item.next = items2[index2];
+ items2[index2] = item;
+ }
+
+ int off = items[1] - 1;
+ classWriter.pool.putByteArray(b, off, header - off);
+ classWriter.items = items2;
+ classWriter.threshold = (int) (0.75d * ll);
+ classWriter.index = ll;
+ }
+
+ /**
+ * Constructs a new {@link ClassReader} object.
+ *
+ * @param is an input stream from which to read the class.
+ * @throws IOException if a problem occurs during reading.
+ */
+ public ClassReader(final InputStream is) throws IOException {
+ this(readClass(is));
+ }
+
+ /**
+ * Constructs a new {@link ClassReader} object.
+ *
+ * @param name the fully qualified name of the class to be read.
+ * @throws IOException if an exception occurs during reading.
+ */
+ public ClassReader(final String name) throws IOException {
+ this(ClassLoader.getSystemResourceAsStream(name.replace('.', '/')
+ + ".class"));
+ }
+
+ /**
+ * Reads the bytecode of a class.
+ *
+ * @param is an input stream from which to read the class.
+ * @return the bytecode read from the given input stream.
+ * @throws IOException if a problem occurs during reading.
+ */
+ private static byte[] readClass(final InputStream is) throws IOException {
+ if (is == null) {
+ throw new IOException("Class not found");
+ }
+ byte[] b = new byte[is.available()];
+ int len = 0;
+ while (true) {
+ int n = is.read(b, len, b.length - len);
+ if (n == -1) {
+ if (len < b.length) {
+ byte[] c = new byte[len];
+ System.arraycopy(b, 0, c, 0, len);
+ b = c;
+ }
+ return b;
+ }
+ len += n;
+ if (len == b.length) {
+ byte[] c = new byte[b.length + 1000];
+ System.arraycopy(b, 0, c, 0, len);
+ b = c;
+ }
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Public methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Makes the given visitor visit the Java class of this {@link ClassReader}.
+ * This class is the one specified in the constructor (see
+ * {@link #ClassReader(byte[]) ClassReader}).
+ *
+ * @param classVisitor the visitor that must visit this class.
+ * @param skipDebug <tt>true</tt> if the debug information of the class
+ * must not be visited. In this case the
+ * {@link MethodVisitor#visitLocalVariable visitLocalVariable} and
+ * {@link MethodVisitor#visitLineNumber visitLineNumber} methods will
+ * not be called.
+ */
+ public void accept(final ClassVisitor classVisitor, final boolean skipDebug)
+ {
+ accept(classVisitor, new Attribute[0], skipDebug);
+ }
+
+ /**
+ * Makes the given visitor visit the Java class of this {@link ClassReader}.
+ * This class is the one specified in the constructor (see
+ * {@link #ClassReader(byte[]) ClassReader}).
+ *
+ * @param classVisitor the visitor that must visit this class.
+ * @param attrs prototypes of the attributes that must be parsed during the
+ * visit of the class. Any attribute whose type is not equal to the
+ * type of one the prototypes will be ignored.
+ * @param skipDebug <tt>true</tt> if the debug information of the class
+ * must not be visited. In this case the
+ * {@link MethodVisitor#visitLocalVariable visitLocalVariable} and
+ * {@link MethodVisitor#visitLineNumber visitLineNumber} methods will
+ * not be called.
+ */
+ public void accept(
+ final ClassVisitor classVisitor,
+ final Attribute[] attrs,
+ final boolean skipDebug)
+ {
+ byte[] b = this.b; // the bytecode array
+ char[] c = new char[maxStringLength]; // buffer used to read strings
+ int i, j, k; // loop variables
+ int u, v, w; // indexes in b
+ Attribute attr;
+
+ int access;
+ String name;
+ String desc;
+ String attrName;
+ String signature;
+ int anns = 0;
+ int ianns = 0;
+ Attribute cattrs = null;
+
+ // visits the header
+ u = header;
+ access = readUnsignedShort(u);
+ name = readClass(u + 2, c);
+ v = items[readUnsignedShort(u + 4)];
+ String superClassName = v == 0 ? null : readUTF8(v, c);
+ String[] implementedItfs = new String[readUnsignedShort(u + 6)];
+ w = 0;
+ u += 8;
+ for (i = 0; i < implementedItfs.length; ++i) {
+ implementedItfs[i] = readClass(u, c);
+ u += 2;
+ }
+
+ // skips fields and methods
+ v = u;
+ i = readUnsignedShort(v);
+ v += 2;
+ for (; i > 0; --i) {
+ j = readUnsignedShort(v + 6);
+ v += 8;
+ for (; j > 0; --j) {
+ v += 6 + readInt(v + 2);
+ }
+ }
+ i = readUnsignedShort(v);
+ v += 2;
+ for (; i > 0; --i) {
+ j = readUnsignedShort(v + 6);
+ v += 8;
+ for (; j > 0; --j) {
+ v += 6 + readInt(v + 2);
+ }
+ }
+ // reads the class's attributes
+ signature = null;
+ String sourceFile = null;
+ String sourceDebug = null;
+ String enclosingOwner = null;
+ String enclosingName = null;
+ String enclosingDesc = null;
+
+ i = readUnsignedShort(v);
+ v += 2;
+ for (; i > 0; --i) {
+ attrName = readUTF8(v, c);
+ if (attrName.equals("SourceFile")) {
+ sourceFile = readUTF8(v + 6, c);
+ } else if (attrName.equals("Deprecated")) {
+ access |= Opcodes.ACC_DEPRECATED;
+ } else if (attrName.equals("Synthetic")) {
+ access |= Opcodes.ACC_SYNTHETIC;
+ } else if (attrName.equals("Annotation")) {
+ access |= Opcodes.ACC_ANNOTATION;
+ } else if (attrName.equals("Enum")) {
+ access |= Opcodes.ACC_ENUM;
+ } else if (attrName.equals("InnerClasses")) {
+ w = v + 6;
+ } else if (attrName.equals("Signature")) {
+ signature = readUTF8(v + 6, c);
+ } else if (attrName.equals("SourceDebugExtension")) {
+ int len = readInt(v + 2);
+ sourceDebug = readUTF(v + 6, len, new char[len]);
+ } else if (attrName.equals("EnclosingMethod")) {
+ enclosingOwner = readClass(v + 6, c);
+ int item = readUnsignedShort(v + 8);
+ if (item != 0) {
+ enclosingName = readUTF8(items[item], c);
+ enclosingDesc = readUTF8(items[item] + 2, c);
+ }
+ } else if (attrName.equals("RuntimeVisibleAnnotations")) {
+ anns = v + 6;
+ } else if (attrName.equals("RuntimeInvisibleAnnotations")) {
+ ianns = v + 6;
+ } else {
+ attr = readAttribute(attrs,
+ attrName,
+ v + 6,
+ readInt(v + 2),
+ c,
+ -1,
+ null);
+ if (attr != null) {
+ attr.next = cattrs;
+ cattrs = attr;
+ }
+ }
+ v += 6 + readInt(v + 2);
+ }
+ // calls the visit method
+ classVisitor.visit(readInt(4),
+ access,
+ name,
+ signature,
+ superClassName,
+ implementedItfs);
+
+ // calls the visitSource method
+ if (sourceFile != null || sourceDebug != null) {
+ classVisitor.visitSource(sourceFile, sourceDebug);
+ }
+
+ // calls the visitOuterClass method
+ if (enclosingOwner != null) {
+ classVisitor.visitOuterClass(enclosingOwner,
+ enclosingName,
+ enclosingDesc);
+ }
+
+ // visits the class annotations
+ for (i = 1; i >= 0; --i) {
+ v = i == 0 ? ianns : anns;
+ if (v != 0) {
+ j = readUnsignedShort(v);
+ v += 2;
+ for (; j > 0; --j) {
+ desc = readUTF8(v, c);
+ v += 2;
+ v = readAnnotationValues(v,
+ c,
+ classVisitor.visitAnnotation(desc, i != 0));
+ }
+ }
+ }
+
+ // visits the class attributes
+ while (cattrs != null) {
+ attr = cattrs.next;
+ cattrs.next = null;
+ classVisitor.visitAttribute(cattrs);
+ cattrs = attr;
+ }
+
+ // class the visitInnerClass method
+ if (w != 0) {
+ i = readUnsignedShort(w);
+ w += 2;
+ for (; i > 0; --i) {
+ classVisitor.visitInnerClass(readUnsignedShort(w) == 0
+ ? null
+ : readClass(w, c), readUnsignedShort(w + 2) == 0
+ ? null
+ : readClass(w + 2, c), readUnsignedShort(w + 4) == 0
+ ? null
+ : readUTF8(w + 4, c), readUnsignedShort(w + 6));
+ w += 8;
+ }
+ }
+
+ // visits the fields
+ i = readUnsignedShort(u);
+ u += 2;
+ for (; i > 0; --i) {
+ access = readUnsignedShort(u);
+ name = readUTF8(u + 2, c);
+ desc = readUTF8(u + 4, c);
+ // visits the field's attributes and looks for a ConstantValue
+ // attribute
+ int fieldValueItem = 0;
+ signature = null;
+ anns = 0;
+ ianns = 0;
+ cattrs = null;
+
+ j = readUnsignedShort(u + 6);
+ u += 8;
+ for (; j > 0; --j) {
+ attrName = readUTF8(u, c);
+ if (attrName.equals("ConstantValue")) {
+ fieldValueItem = readUnsignedShort(u + 6);
+ } else if (attrName.equals("Synthetic")) {
+ access |= Opcodes.ACC_SYNTHETIC;
+ } else if (attrName.equals("Deprecated")) {
+ access |= Opcodes.ACC_DEPRECATED;
+ } else if (attrName.equals("Enum")) {
+ access |= Opcodes.ACC_ENUM;
+ } else if (attrName.equals("Signature")) {
+ signature = readUTF8(u + 6, c);
+ } else if (attrName.equals("RuntimeVisibleAnnotations")) {
+ anns = u + 6;
+ } else if (attrName.equals("RuntimeInvisibleAnnotations")) {
+ ianns = u + 6;
+ } else {
+ attr = readAttribute(attrs,
+ attrName,
+ u + 6,
+ readInt(u + 2),
+ c,
+ -1,
+ null);
+ if (attr != null) {
+ attr.next = cattrs;
+ cattrs = attr;
+ }
+ }
+ u += 6 + readInt(u + 2);
+ }
+ // reads the field's value, if any
+ Object value = (fieldValueItem == 0
+ ? null
+ : readConst(fieldValueItem, c));
+ // visits the field
+ FieldVisitor fv = classVisitor.visitField(access,
+ name,
+ desc,
+ signature,
+ value);
+ // visits the field annotations and attributes
+ if (fv != null) {
+ for (j = 1; j >= 0; --j) {
+ v = j == 0 ? ianns : anns;
+ if (v != 0) {
+ k = readUnsignedShort(v);
+ v += 2;
+ for (; k > 0; --k) {
+ desc = readUTF8(v, c);
+ v += 2;
+ v = readAnnotationValues(v,
+ c,
+ fv.visitAnnotation(desc, j != 0));
+ }
+ }
+ }
+ while (cattrs != null) {
+ attr = cattrs.next;
+ cattrs.next = null;
+ fv.visitAttribute(cattrs);
+ cattrs = attr;
+ }
+ fv.visitEnd();
+ }
+ }
+
+ // visits the methods
+ i = readUnsignedShort(u);
+ u += 2;
+ for (; i > 0; --i) {
+ int u0 = u + 6;
+ access = readUnsignedShort(u);
+ name = readUTF8(u + 2, c);
+ desc = readUTF8(u + 4, c);
+ signature = null;
+ anns = 0;
+ ianns = 0;
+ int dann = 0;
+ int mpanns = 0;
+ int impanns = 0;
+ cattrs = null;
+ v = 0;
+ w = 0;
+
+ // looks for Code and Exceptions attributes
+ j = readUnsignedShort(u + 6);
+ u += 8;
+ for (; j > 0; --j) {
+ attrName = readUTF8(u, c);
+ u += 2;
+ int attrSize = readInt(u);
+ u += 4;
+ if (attrName.equals("Code")) {
+ v = u;
+ } else if (attrName.equals("Exceptions")) {
+ w = u;
+ } else if (attrName.equals("Synthetic")) {
+ access |= Opcodes.ACC_SYNTHETIC;
+ } else if (attrName.equals("Varargs")) {
+ access |= Opcodes.ACC_VARARGS;
+ } else if (attrName.equals("Bridge")) {
+ access |= Opcodes.ACC_BRIDGE;
+ } else if (attrName.equals("Deprecated")) {
+ access |= Opcodes.ACC_DEPRECATED;
+ } else if (attrName.equals("Signature")) {
+ signature = readUTF8(u, c);
+ } else if (attrName.equals("AnnotationDefault")) {
+ dann = u;
+ } else if (attrName.equals("RuntimeVisibleAnnotations")) {
+ anns = u;
+ } else if (attrName.equals("RuntimeInvisibleAnnotations")) {
+ ianns = u;
+ } else if (attrName.equals("RuntimeVisibleParameterAnnotations"))
+ {
+ mpanns = u;
+ } else if (attrName.equals("RuntimeInvisibleParameterAnnotations"))
+ {
+ impanns = u;
+ } else {
+ attr = readAttribute(attrs,
+ attrName,
+ u,
+ attrSize,
+ c,
+ -1,
+ null);
+ if (attr != null) {
+ attr.next = cattrs;
+ cattrs = attr;
+ }
+ }
+ u += attrSize;
+ }
+ // reads declared exceptions
+ String[] exceptions;
+ if (w == 0) {
+ exceptions = null;
+ } else {
+ exceptions = new String[readUnsignedShort(w)];
+ w += 2;
+ for (j = 0; j < exceptions.length; ++j) {
+ exceptions[j] = readClass(w, c);
+ w += 2;
+ }
+ }
+
+ // visits the method's code, if any
+ MethodVisitor mv = classVisitor.visitMethod(access,
+ name,
+ desc,
+ signature,
+ exceptions);
+
+ if (mv != null) {
+ /*
+ * if the returned MethodVisitor is in fact a MethodWriter, it
+ * means there is no method adapter between the reader and the
+ * writer. If, in addition, the writer's constant pool was
+ * copied from this reader (mw.cw.cr == this), and the signature
+ * and exceptions of the method have not been changed, then it
+ * is possible to skip all visit events and just copy the
+ * original code of the method to the writer (the access, name
+ * and descriptor can have been changed, this is not important
+ * since they are not copied as is from the reader).
+ */
+ if (mv instanceof MethodWriter) {
+ MethodWriter mw = (MethodWriter) mv;
+ if (mw.cw.cr == this) {
+ if (signature == mw.signature) {
+ boolean sameExceptions = false;
+ if (exceptions == null) {
+ sameExceptions = mw.exceptionCount == 0;
+ } else {
+ if (exceptions.length == mw.exceptionCount) {
+ sameExceptions = true;
+ for (j = exceptions.length - 1; j >= 0; --j)
+ {
+ w -= 2;
+ if (mw.exceptions[j] != readUnsignedShort(w))
+ {
+ sameExceptions = false;
+ break;
+ }
+ }
+ }
+ }
+ if (sameExceptions) {
+ /*
+ * we do not copy directly the code into
+ * MethodWriter to save a byte array copy
+ * operation. The real copy will be done in
+ * ClassWriter.toByteArray().
+ */
+ mw.classReaderOffset = u0;
+ mw.classReaderLength = u - u0;
+ continue;
+ }
+ }
+ }
+ }
+ if (dann != 0) {
+ AnnotationVisitor dv = mv.visitAnnotationDefault();
+ readAnnotationValue(dann, c, null, dv);
+ dv.visitEnd();
+ }
+ for (j = 1; j >= 0; --j) {
+ w = j == 0 ? ianns : anns;
+ if (w != 0) {
+ k = readUnsignedShort(w);
+ w += 2;
+ for (; k > 0; --k) {
+ desc = readUTF8(w, c);
+ w += 2;
+ w = readAnnotationValues(w,
+ c,
+ mv.visitAnnotation(desc, j != 0));
+ }
+ }
+ }
+ if (mpanns != 0) {
+ readParameterAnnotations(mpanns, c, true, mv);
+ }
+ if (impanns != 0) {
+ readParameterAnnotations(impanns, c, false, mv);
+ }
+ while (cattrs != null) {
+ attr = cattrs.next;
+ cattrs.next = null;
+ mv.visitAttribute(cattrs);
+ cattrs = attr;
+ }
+ }
+
+ if (mv != null && v != 0) {
+ int maxStack = readUnsignedShort(v);
+ int maxLocals = readUnsignedShort(v + 2);
+ int codeLength = readInt(v + 4);
+ v += 8;
+
+ int codeStart = v;
+ int codeEnd = v + codeLength;
+
+ mv.visitCode();
+
+ // 1st phase: finds the labels
+ int label;
+ Label[] labels = new Label[codeLength + 1];
+ while (v < codeEnd) {
+ int opcode = b[v] & 0xFF;
+ switch (ClassWriter.TYPE[opcode]) {
+ case ClassWriter.NOARG_INSN:
+ case ClassWriter.IMPLVAR_INSN:
+ v += 1;
+ break;
+ case ClassWriter.LABEL_INSN:
+ label = v - codeStart + readShort(v + 1);
+ if (labels[label] == null) {
+ labels[label] = new Label();
+ }
+ v += 3;
+ break;
+ case ClassWriter.LABELW_INSN:
+ label = v - codeStart + readInt(v + 1);
+ if (labels[label] == null) {
+ labels[label] = new Label();
+ }
+ v += 5;
+ break;
+ case ClassWriter.WIDE_INSN:
+ opcode = b[v + 1] & 0xFF;
+ if (opcode == Opcodes.IINC) {
+ v += 6;
+ } else {
+ v += 4;
+ }
+ break;
+ case ClassWriter.TABL_INSN:
+ // skips 0 to 3 padding bytes
+ w = v - codeStart;
+ v = v + 4 - (w & 3);
+ // reads instruction
+ label = w + readInt(v);
+ v += 4;
+ if (labels[label] == null) {
+ labels[label] = new Label();
+ }
+ j = readInt(v);
+ v += 4;
+ j = readInt(v) - j + 1;
+ v += 4;
+ for (; j > 0; --j) {
+ label = w + readInt(v);
+ v += 4;
+ if (labels[label] == null) {
+ labels[label] = new Label();
+ }
+ }
+ break;
+ case ClassWriter.LOOK_INSN:
+ // skips 0 to 3 padding bytes
+ w = v - codeStart;
+ v = v + 4 - (w & 3);
+ // reads instruction
+ label = w + readInt(v);
+ v += 4;
+ if (labels[label] == null) {
+ labels[label] = new Label();
+ }
+ j = readInt(v);
+ v += 4;
+ for (; j > 0; --j) {
+ v += 4; // skips key
+ label = w + readInt(v);
+ v += 4;
+ if (labels[label] == null) {
+ labels[label] = new Label();
+ }
+ }
+ break;
+ case ClassWriter.VAR_INSN:
+ case ClassWriter.SBYTE_INSN:
+ case ClassWriter.LDC_INSN:
+ v += 2;
+ break;
+ case ClassWriter.SHORT_INSN:
+ case ClassWriter.LDCW_INSN:
+ case ClassWriter.FIELDORMETH_INSN:
+ case ClassWriter.TYPE_INSN:
+ case ClassWriter.IINC_INSN:
+ v += 3;
+ break;
+ case ClassWriter.ITFMETH_INSN:
+ v += 5;
+ break;
+ // case MANA_INSN:
+ default:
+ v += 4;
+ break;
+ }
+ }
+ // parses the try catch entries
+ j = readUnsignedShort(v);
+ v += 2;
+ for (; j > 0; --j) {
+ label = readUnsignedShort(v);
+ Label start = labels[label];
+ if (start == null) {
+ labels[label] = start = new Label();
+ }
+ label = readUnsignedShort(v + 2);
+ Label end = labels[label];
+ if (end == null) {
+ labels[label] = end = new Label();
+ }
+ label = readUnsignedShort(v + 4);
+ Label handler = labels[label];
+ if (handler == null) {
+ labels[label] = handler = new Label();
+ }
+
+ int type = readUnsignedShort(v + 6);
+ if (type == 0) {
+ mv.visitTryCatchBlock(start, end, handler, null);
+ } else {
+ mv.visitTryCatchBlock(start,
+ end,
+ handler,
+ readUTF8(items[type], c));
+ }
+ v += 8;
+ }
+ // parses the local variable, line number tables, and code
+ // attributes
+ int varTable = 0;
+ int varTypeTable = 0;
+ cattrs = null;
+ j = readUnsignedShort(v);
+ v += 2;
+ for (; j > 0; --j) {
+ attrName = readUTF8(v, c);
+ if (attrName.equals("LocalVariableTable")) {
+ if (!skipDebug) {
+ varTable = v + 6;
+ k = readUnsignedShort(v + 6);
+ w = v + 8;
+ for (; k > 0; --k) {
+ label = readUnsignedShort(w);
+ if (labels[label] == null) {
+ labels[label] = new Label();
+ }
+ label += readUnsignedShort(w + 2);
+ if (labels[label] == null) {
+ labels[label] = new Label();
+ }
+ w += 10;
+ }
+ }
+ } else if (attrName.equals("LocalVariableTypeTable")) {
+ varTypeTable = v + 6;
+ } else if (attrName.equals("LineNumberTable")) {
+ if (!skipDebug) {
+ k = readUnsignedShort(v + 6);
+ w = v + 8;
+ for (; k > 0; --k) {
+ label = readUnsignedShort(w);
+ if (labels[label] == null) {
+ labels[label] = new Label();
+ }
+ labels[label].line = readUnsignedShort(w + 2);
+ w += 4;
+ }
+ }
+ } else {
+ for (k = 0; k < attrs.length; ++k) {
+ if (attrs[k].type.equals(attrName)) {
+ attr = attrs[k].read(this,
+ v + 6,
+ readInt(v + 2),
+ c,
+ codeStart - 8,
+ labels);
+ if (attr != null) {
+ attr.next = cattrs;
+ cattrs = attr;
+ }
+ }
+ }
+ }
+ v += 6 + readInt(v + 2);
+ }
+
+ // 2nd phase: visits each instruction
+ v = codeStart;
+ Label l;
+ while (v < codeEnd) {
+ w = v - codeStart;
+ l = labels[w];
+ if (l != null) {
+ mv.visitLabel(l);
+ if (!skipDebug && l.line > 0) {
+ mv.visitLineNumber(l.line, l);
+ }
+ }
+ int opcode = b[v] & 0xFF;
+ switch (ClassWriter.TYPE[opcode]) {
+ case ClassWriter.NOARG_INSN:
+ mv.visitInsn(opcode);
+ v += 1;
+ break;
+ case ClassWriter.IMPLVAR_INSN:
+ if (opcode > Opcodes.ISTORE) {
+ opcode -= 59; // ISTORE_0
+ mv.visitVarInsn(Opcodes.ISTORE + (opcode >> 2),
+ opcode & 0x3);
+ } else {
+ opcode -= 26; // ILOAD_0
+ mv.visitVarInsn(Opcodes.ILOAD + (opcode >> 2),
+ opcode & 0x3);
+ }
+ v += 1;
+ break;
+ case ClassWriter.LABEL_INSN:
+ mv.visitJumpInsn(opcode, labels[w
+ + readShort(v + 1)]);
+ v += 3;
+ break;
+ case ClassWriter.LABELW_INSN:
+ mv.visitJumpInsn(opcode - 33, labels[w
+ + readInt(v + 1)]);
+ v += 5;
+ break;
+ case ClassWriter.WIDE_INSN:
+ opcode = b[v + 1] & 0xFF;
+ if (opcode == Opcodes.IINC) {
+ mv.visitIincInsn(readUnsignedShort(v + 2),
+ readShort(v + 4));
+ v += 6;
+ } else {
+ mv.visitVarInsn(opcode,
+ readUnsignedShort(v + 2));
+ v += 4;
+ }
+ break;
+ case ClassWriter.TABL_INSN:
+ // skips 0 to 3 padding bytes
+ v = v + 4 - (w & 3);
+ // reads instruction
+ label = w + readInt(v);
+ v += 4;
+ int min = readInt(v);
+ v += 4;
+ int max = readInt(v);
+ v += 4;
+ Label[] table = new Label[max - min + 1];
+ for (j = 0; j < table.length; ++j) {
+ table[j] = labels[w + readInt(v)];
+ v += 4;
+ }
+ mv.visitTableSwitchInsn(min,
+ max,
+ labels[label],
+ table);
+ break;
+ case ClassWriter.LOOK_INSN:
+ // skips 0 to 3 padding bytes
+ v = v + 4 - (w & 3);
+ // reads instruction
+ label = w + readInt(v);
+ v += 4;
+ j = readInt(v);
+ v += 4;
+ int[] keys = new int[j];
+ Label[] values = new Label[j];
+ for (j = 0; j < keys.length; ++j) {
+ keys[j] = readInt(v);
+ v += 4;
+ values[j] = labels[w + readInt(v)];
+ v += 4;
+ }
+ mv.visitLookupSwitchInsn(labels[label],
+ keys,
+ values);
+ break;
+ case ClassWriter.VAR_INSN:
+ mv.visitVarInsn(opcode, b[v + 1] & 0xFF);
+ v += 2;
+ break;
+ case ClassWriter.SBYTE_INSN:
+ mv.visitIntInsn(opcode, b[v + 1]);
+ v += 2;
+ break;
+ case ClassWriter.SHORT_INSN:
+ mv.visitIntInsn(opcode, readShort(v + 1));
+ v += 3;
+ break;
+ case ClassWriter.LDC_INSN:
+ mv.visitLdcInsn(readConst(b[v + 1] & 0xFF, c));
+ v += 2;
+ break;
+ case ClassWriter.LDCW_INSN:
+ mv.visitLdcInsn(readConst(readUnsignedShort(v + 1),
+ c));
+ v += 3;
+ break;
+ case ClassWriter.FIELDORMETH_INSN:
+ case ClassWriter.ITFMETH_INSN:
+ int cpIndex = items[readUnsignedShort(v + 1)];
+ String iowner = readClass(cpIndex, c);
+ cpIndex = items[readUnsignedShort(cpIndex + 2)];
+ String iname = readUTF8(cpIndex, c);
+ String idesc = readUTF8(cpIndex + 2, c);
+ if (opcode < Opcodes.INVOKEVIRTUAL) {
+ mv.visitFieldInsn(opcode, iowner, iname, idesc);
+ } else {
+ mv.visitMethodInsn(opcode, iowner, iname, idesc);
+ }
+ if (opcode == Opcodes.INVOKEINTERFACE) {
+ v += 5;
+ } else {
+ v += 3;
+ }
+ break;
+ case ClassWriter.TYPE_INSN:
+ mv.visitTypeInsn(opcode, readClass(v + 1, c));
+ v += 3;
+ break;
+ case ClassWriter.IINC_INSN:
+ mv.visitIincInsn(b[v + 1] & 0xFF, b[v + 2]);
+ v += 3;
+ break;
+ // case MANA_INSN:
+ default:
+ mv.visitMultiANewArrayInsn(readClass(v + 1, c),
+ b[v + 3] & 0xFF);
+ v += 4;
+ break;
+ }
+ }
+ l = labels[codeEnd - codeStart];
+ if (l != null) {
+ mv.visitLabel(l);
+ }
+
+ // visits the local variable tables
+ if (!skipDebug && varTable != 0) {
+ int[] typeTable = null;
+ if (varTypeTable != 0) {
+ w = varTypeTable;
+ k = readUnsignedShort(w) * 3;
+ w += 2;
+ typeTable = new int[k];
+ while (k > 0) {
+ typeTable[--k] = w + 6; // signature
+ typeTable[--k] = readUnsignedShort(w + 8); // index
+ typeTable[--k] = readUnsignedShort(w); // start
+ w += 10;
+ }
+ }
+ w = varTable;
+ k = readUnsignedShort(w);
+ w += 2;
+ for (; k > 0; --k) {
+ int start = readUnsignedShort(w);
+ int length = readUnsignedShort(w + 2);
+ int index = readUnsignedShort(w + 8);
+ String vsignature = null;
+ if (typeTable != null) {
+ for (int a = 0; a < typeTable.length; a += 3) {
+ if (typeTable[a] == start
+ && typeTable[a + 1] == index)
+ {
+ vsignature = readUTF8(typeTable[a + 2], c);
+ break;
+ }
+ }
+ }
+ mv.visitLocalVariable(readUTF8(w + 4, c),
+ readUTF8(w + 6, c),
+ vsignature,
+ labels[start],
+ labels[start + length],
+ index);
+ w += 10;
+ }
+ }
+ // visits the other attributes
+ while (cattrs != null) {
+ attr = cattrs.next;
+ cattrs.next = null;
+ mv.visitAttribute(cattrs);
+ cattrs = attr;
+ }
+ // visits the max stack and max locals values
+ mv.visitMaxs(maxStack, maxLocals);
+ }
+
+ if (mv != null) {
+ mv.visitEnd();
+ }
+ }
+
+ // visits the end of the class
+ classVisitor.visitEnd();
+ }
+
+ /**
+ * Reads parameter annotations and makes the given visitor visit them.
+ *
+ * @param v start offset in {@link #b b} of the annotations to be read.
+ * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
+ * {@link #readClass(int,char[]) readClass} or
+ * {@link #readConst readConst}.
+ * @param visible <tt>true</tt> if the annotations to be read are visible
+ * at runtime.
+ * @param mv the visitor that must visit the annotations.
+ */
+ private void readParameterAnnotations(
+ int v,
+ final char[] buf,
+ final boolean visible,
+ final MethodVisitor mv)
+ {
+ int n = b[v++] & 0xFF;
+ for (int i = 0; i < n; ++i) {
+ int j = readUnsignedShort(v);
+ v += 2;
+ for (; j > 0; --j) {
+ String desc = readUTF8(v, buf);
+ v += 2;
+ AnnotationVisitor av = mv.visitParameterAnnotation(i,
+ desc,
+ visible);
+ v = readAnnotationValues(v, buf, av);
+ }
+ }
+ }
+
+ /**
+ * Reads the values of an annotation and makes the given visitor visit them.
+ *
+ * @param v the start offset in {@link #b b} of the values to be read
+ * (including the unsigned short that gives the number of values).
+ * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
+ * {@link #readClass(int,char[]) readClass} or
+ * {@link #readConst readConst}.
+ * @param av the visitor that must visit the values.
+ * @return the end offset of the annotations values.
+ */
+ private int readAnnotationValues(
+ int v,
+ final char[] buf,
+ final AnnotationVisitor av)
+ {
+ int i = readUnsignedShort(v);
+ v += 2;
+ for (; i > 0; --i) {
+ String name = readUTF8(v, buf);
+ v += 2;
+ v = readAnnotationValue(v, buf, name, av);
+ }
+ av.visitEnd();
+ return v;
+ }
+
+ /**
+ * Reads a value of an annotation and makes the given visitor visit it.
+ *
+ * @param v the start offset in {@link #b b} of the value to be read (<i>not
+ * including the value name constant pool index</i>).
+ * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
+ * {@link #readClass(int,char[]) readClass} or
+ * {@link #readConst readConst}.
+ * @param name the name of the value to be read.
+ * @param av the visitor that must visit the value.
+ * @return the end offset of the annotation value.
+ */
+ private int readAnnotationValue(
+ int v,
+ final char[] buf,
+ final String name,
+ final AnnotationVisitor av)
+ {
+ int i;
+ switch (readByte(v++)) {
+ case 'I': // pointer to CONSTANT_Integer
+ case 'J': // pointer to CONSTANT_Long
+ case 'F': // pointer to CONSTANT_Float
+ case 'D': // pointer to CONSTANT_Double
+ av.visit(name, readConst(readUnsignedShort(v), buf));
+ v += 2;
+ break;
+ case 'B': // pointer to CONSTANT_Byte
+ av.visit(name,
+ new Byte((byte) readInt(items[readUnsignedShort(v)])));
+ v += 2;
+ break;
+ case 'Z': // pointer to CONSTANT_Boolean
+ boolean b = readInt(items[readUnsignedShort(v)]) == 0;
+ av.visit(name, b ? Boolean.FALSE : Boolean.TRUE);
+ v += 2;
+ break;
+ case 'S': // pointer to CONSTANT_Short
+ av.visit(name,
+ new Short((short) readInt(items[readUnsignedShort(v)])));
+ v += 2;
+ break;
+ case 'C': // pointer to CONSTANT_Char
+ av.visit(name,
+ new Character((char) readInt(items[readUnsignedShort(v)])));
+ v += 2;
+ break;
+ case 's': // pointer to CONSTANT_Utf8
+ av.visit(name, readUTF8(v, buf));
+ v += 2;
+ break;
+ case 'e': // enum_const_value
+ av.visitEnum(name, readUTF8(v, buf), readUTF8(v + 2, buf));
+ v += 4;
+ break;
+ case 'c': // class_info
+ av.visit(name, Type.getType(readUTF8(v, buf)));
+ v += 2;
+ break;
+ case '@': // annotation_value
+ String desc = readUTF8(v, buf);
+ v += 2;
+ v = readAnnotationValues(v, buf, av.visitAnnotation(name, desc));
+ break;
+ case '[': // array_value
+ int size = readUnsignedShort(v);
+ v += 2;
+ if (size == 0) {
+ av.visitArray(name).visitEnd();
+ return v;
+ }
+ switch (readByte(v++)) {
+ case 'B':
+ byte[] bv = new byte[size];
+ for (i = 0; i < size; i++) {
+ bv[i] = (byte) readInt(items[readUnsignedShort(v)]);
+ v += 3;
+ }
+ av.visit(name, bv);
+ --v;
+ break;
+ case 'Z':
+ boolean[] zv = new boolean[size];
+ for (i = 0; i < size; i++) {
+ zv[i] = readInt(items[readUnsignedShort(v)]) != 0;
+ v += 3;
+ }
+ av.visit(name, zv);
+ --v;
+ break;
+ case 'S':
+ short[] sv = new short[size];
+ for (i = 0; i < size; i++) {
+ sv[i] = (short) readInt(items[readUnsignedShort(v)]);
+ v += 3;
+ }
+ av.visit(name, sv);
+ --v;
+ break;
+ case 'C':
+ char[] cv = new char[size];
+ for (i = 0; i < size; i++) {
+ cv[i] = (char) readInt(items[readUnsignedShort(v)]);
+ v += 3;
+ }
+ av.visit(name, cv);
+ --v;
+ break;
+ case 'I':
+ int[] iv = new int[size];
+ for (i = 0; i < size; i++) {
+ iv[i] = readInt(items[readUnsignedShort(v)]);
+ v += 3;
+ }
+ av.visit(name, iv);
+ --v;
+ break;
+ case 'J':
+ long[] lv = new long[size];
+ for (i = 0; i < size; i++) {
+ lv[i] = readLong(items[readUnsignedShort(v)]);
+ v += 3;
+ }
+ av.visit(name, lv);
+ --v;
+ break;
+ case 'F':
+ float[] fv = new float[size];
+ for (i = 0; i < size; i++) {
+ fv[i] = Float.intBitsToFloat(readInt(items[readUnsignedShort(v)]));
+ v += 3;
+ }
+ av.visit(name, fv);
+ --v;
+ break;
+ case 'D':
+ double[] dv = new double[size];
+ for (i = 0; i < size; i++) {
+ dv[i] = Double.longBitsToDouble(readLong(items[readUnsignedShort(v)]));
+ v += 3;
+ }
+ av.visit(name, dv);
+ --v;
+ break;
+ default:
+ v--;
+ AnnotationVisitor aav = av.visitArray(name);
+ for (i = size; i > 0; --i) {
+ v = readAnnotationValue(v, buf, null, aav);
+ }
+ aav.visitEnd();
+ }
+ }
+ return v;
+ }
+
+ /**
+ * Reads an attribute in {@link #b b}.
+ *
+ * @param attrs prototypes of the attributes that must be parsed during the
+ * visit of the class. Any attribute whose type is not equal to the
+ * type of one the prototypes is ignored (i.e. an empty
+ * {@link Attribute} instance is returned).
+ * @param type the type of the attribute.
+ * @param off index of the first byte of the attribute's content in
+ * {@link #b b}. The 6 attribute header bytes, containing the type
+ * and the length of the attribute, are not taken into account here
+ * (they have already been read).
+ * @param len the length of the attribute's content.
+ * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
+ * {@link #readClass(int,char[]) readClass} or
+ * {@link #readConst readConst}.
+ * @param codeOff index of the first byte of code's attribute content in
+ * {@link #b b}, or -1 if the attribute to be read is not a code
+ * attribute. The 6 attribute header bytes, containing the type and
+ * the length of the attribute, are not taken into account here.
+ * @param labels the labels of the method's code, or <tt>null</tt> if the
+ * attribute to be read is not a code attribute.
+ * @return the attribute that has been read, or <tt>null</tt> to skip this
+ * attribute.
+ */
+ private Attribute readAttribute(
+ final Attribute[] attrs,
+ final String type,
+ final int off,
+ final int len,
+ final char[] buf,
+ final int codeOff,
+ final Label[] labels)
+ {
+ for (int i = 0; i < attrs.length; ++i) {
+ if (attrs[i].type.equals(type)) {
+ return attrs[i].read(this, off, len, buf, codeOff, labels);
+ }
+ }
+ return new Attribute(type).read(this, off, len, null, -1, null);
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods: low level parsing
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the start index of the constant pool item in {@link #b b}, plus
+ * one. <i>This method is intended for {@link Attribute} sub classes, and is
+ * normally not needed by class generators or adapters.</i>
+ *
+ * @param item the index a constant pool item.
+ * @return the start index of the constant pool item in {@link #b b}, plus
+ * one.
+ */
+ public int getItem(final int item) {
+ return items[item];
+ }
+
+ /**
+ * Reads a byte value in {@link #b b}. <i>This method is intended for
+ * {@link Attribute} sub classes, and is normally not needed by class
+ * generators or adapters.</i>
+ *
+ * @param index the start index of the value to be read in {@link #b b}.
+ * @return the read value.
+ */
+ public int readByte(final int index) {
+ return b[index] & 0xFF;
+ }
+
+ /**
+ * Reads an unsigned short value in {@link #b b}. <i>This method is
+ * intended for {@link Attribute} sub classes, and is normally not needed by
+ * class generators or adapters.</i>
+ *
+ * @param index the start index of the value to be read in {@link #b b}.
+ * @return the read value.
+ */
+ public int readUnsignedShort(final int index) {
+ byte[] b = this.b;
+ return ((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF);
+ }
+
+ /**
+ * Reads a signed short value in {@link #b b}. <i>This method is intended
+ * for {@link Attribute} sub classes, and is normally not needed by class
+ * generators or adapters.</i>
+ *
+ * @param index the start index of the value to be read in {@link #b b}.
+ * @return the read value.
+ */
+ public short readShort(final int index) {
+ byte[] b = this.b;
+ return (short) (((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF));
+ }
+
+ /**
+ * Reads a signed int value in {@link #b b}. <i>This method is intended for
+ * {@link Attribute} sub classes, and is normally not needed by class
+ * generators or adapters.</i>
+ *
+ * @param index the start index of the value to be read in {@link #b b}.
+ * @return the read value.
+ */
+ public int readInt(final int index) {
+ byte[] b = this.b;
+ return ((b[index] & 0xFF) << 24) | ((b[index + 1] & 0xFF) << 16)
+ | ((b[index + 2] & 0xFF) << 8) | (b[index + 3] & 0xFF);
+ }
+
+ /**
+ * Reads a signed long value in {@link #b b}. <i>This method is intended
+ * for {@link Attribute} sub classes, and is normally not needed by class
+ * generators or adapters.</i>
+ *
+ * @param index the start index of the value to be read in {@link #b b}.
+ * @return the read value.
+ */
+ public long readLong(final int index) {
+ long l1 = readInt(index);
+ long l0 = readInt(index + 4) & 0xFFFFFFFFL;
+ return (l1 << 32) | l0;
+ }
+
+ /**
+ * Reads an UTF8 string constant pool item in {@link #b b}. <i>This method
+ * is intended for {@link Attribute} sub classes, and is normally not needed
+ * by class generators or adapters.</i>
+ *
+ * @param index the start index of an unsigned short value in {@link #b b},
+ * whose value is the index of an UTF8 constant pool item.
+ * @param buf buffer to be used to read the item. This buffer must be
+ * sufficiently large. It is not automatically resized.
+ * @return the String corresponding to the specified UTF8 item.
+ */
+ public String readUTF8(int index, final char[] buf) {
+ int item = readUnsignedShort(index);
+ String s = strings[item];
+ if (s != null) {
+ return s;
+ }
+ index = items[item];
+ return strings[item] = readUTF(index + 2, readUnsignedShort(index), buf);
+ }
+
+ /**
+ * Reads UTF8 string in {@link #b b}.
+ *
+ * @param index start offset of the UTF8 string to be read.
+ * @param utfLen length of the UTF8 string to be read.
+ * @param buf buffer to be used to read the string. This buffer must be
+ * sufficiently large. It is not automatically resized.
+ * @return the String corresponding to the specified UTF8 string.
+ */
+ private String readUTF(int index, int utfLen, char[] buf) {
+ int endIndex = index + utfLen;
+ byte[] b = this.b;
+ int strLen = 0;
+ int c, d, e;
+ while (index < endIndex) {
+ c = b[index++] & 0xFF;
+ switch (c >> 4) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ // 0xxxxxxx
+ buf[strLen++] = (char) c;
+ break;
+ case 12:
+ case 13:
+ // 110x xxxx 10xx xxxx
+ d = b[index++];
+ buf[strLen++] = (char) (((c & 0x1F) << 6) | (d & 0x3F));
+ break;
+ default:
+ // 1110 xxxx 10xx xxxx 10xx xxxx
+ d = b[index++];
+ e = b[index++];
+ buf[strLen++] = (char) (((c & 0x0F) << 12)
+ | ((d & 0x3F) << 6) | (e & 0x3F));
+ break;
+ }
+ }
+ return new String(buf, 0, strLen);
+ }
+
+ /**
+ * Reads a class constant pool item in {@link #b b}. <i>This method is
+ * intended for {@link Attribute} sub classes, and is normally not needed by
+ * class generators or adapters.</i>
+ *
+ * @param index the start index of an unsigned short value in {@link #b b},
+ * whose value is the index of a class constant pool item.
+ * @param buf buffer to be used to read the item. This buffer must be
+ * sufficiently large. It is not automatically resized.
+ * @return the String corresponding to the specified class item.
+ */
+ public String readClass(final int index, final char[] buf) {
+ // computes the start index of the CONSTANT_Class item in b
+ // and reads the CONSTANT_Utf8 item designated by
+ // the first two bytes of this CONSTANT_Class item
+ return readUTF8(items[readUnsignedShort(index)], buf);
+ }
+
+ /**
+ * Reads a numeric or string constant pool item in {@link #b b}. <i>This
+ * method is intended for {@link Attribute} sub classes, and is normally not
+ * needed by class generators or adapters.</i>
+ *
+ * @param item the index of a constant pool item.
+ * @param buf buffer to be used to read the item. This buffer must be
+ * sufficiently large. It is not automatically resized.
+ * @return the {@link Integer}, {@link Float}, {@link Long},
+ * {@link Double}, {@link String} or {@link Type} corresponding to
+ * the given constant pool item.
+ */
+ public Object readConst(final int item, final char[] buf) {
+ int index = items[item];
+ switch (b[index - 1]) {
+ case ClassWriter.INT:
+ return new Integer(readInt(index));
+ case ClassWriter.FLOAT:
+ return new Float(Float.intBitsToFloat(readInt(index)));
+ case ClassWriter.LONG:
+ return new Long(readLong(index));
+ case ClassWriter.DOUBLE:
+ return new Double(Double.longBitsToDouble(readLong(index)));
+ case ClassWriter.CLASS:
+ String s = readUTF8(index, buf);
+ return Type.getType(s.charAt(0) == '[' ? s : "L" + s + ";");
+ // case ClassWriter.STR:
+ default:
+ return readUTF8(index, buf);
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/ClassVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/ClassVisitor.java
new file mode 100644
index 00000000000..749c4256b7a
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/ClassVisitor.java
@@ -0,0 +1,195 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * A visitor to visit a Java class. The methods of this interface must be called
+ * in the following order: <tt>visit</tt> [ <tt>visitSource</tt> ] [
+ * <tt>visitOuterClass</tt> ] ( <tt>visitAnnotation</tt> |
+ * <tt>visitAttribute</tt> )* (<tt>visitInnerClass</tt> |
+ * <tt>visitField</tt> | <tt>visitMethod</tt> )* <tt>visitEnd</tt>.
+ *
+ * @author Eric Bruneton
+ */
+public interface ClassVisitor {
+
+ /**
+ * Visits the header of the class.
+ *
+ * @param version the class version.
+ * @param access the class's access flags (see {@link Opcodes}). This
+ * parameter also indicates if the class is deprecated.
+ * @param name the internal name of the class (see
+ * {@link Type#getInternalName() getInternalName}).
+ * @param signature the signature of this class. May be <tt>null</tt> if
+ * the class is not a generic one, and does not extend or implement
+ * generic classes or interfaces.
+ * @param superName the internal of name of the super class (see
+ * {@link Type#getInternalName() getInternalName}). For interfaces,
+ * the super class is {@link Object}. May be <tt>null</tt>, but
+ * only for the {@link Object} class.
+ * @param interfaces the internal names of the class's interfaces (see
+ * {@link Type#getInternalName() getInternalName}). May be
+ * <tt>null</tt>.
+ */
+ void visit(
+ int version,
+ int access,
+ String name,
+ String signature,
+ String superName,
+ String[] interfaces);
+
+ /**
+ * Visits the source of the class.
+ *
+ * @param source the name of the source file from which the class was
+ * compiled. May be <tt>null</tt>.
+ * @param debug additional debug information to compute the correspondance
+ * between source and compiled elements of the class. May be
+ * <tt>null</tt>.
+ */
+ void visitSource(String source, String debug);
+
+ /**
+ * Visits the enclosing class of the class. This method must be called only
+ * if the class has an enclosing class.
+ *
+ * @param owner internal name of the enclosing class of the class.
+ * @param name the name of the method that contains the class, or
+ * <tt>null</tt> if the class is not enclosed in a method of its
+ * enclosing class.
+ * @param desc the descriptor of the method that contains the class, or
+ * <tt>null</tt> if the class is not enclosed in a method of its
+ * enclosing class.
+ */
+ void visitOuterClass(String owner, String name, String desc);
+
+ /**
+ * Visits an annotation of the class.
+ *
+ * @param desc the class descriptor of the annotation class.
+ * @param visible <tt>true</tt> if the annotation is visible at runtime.
+ * @return a non null visitor to visit the annotation values.
+ */
+ AnnotationVisitor visitAnnotation(String desc, boolean visible);
+
+ /**
+ * Visits a non standard attribute of the class.
+ *
+ * @param attr an attribute.
+ */
+ void visitAttribute(Attribute attr);
+
+ /**
+ * Visits information about an inner class. This inner class is not
+ * necessarily a member of the class being visited.
+ *
+ * @param name the internal name of an inner class (see
+ * {@link Type#getInternalName() getInternalName}).
+ * @param outerName the internal name of the class to which the inner class
+ * belongs (see {@link Type#getInternalName() getInternalName}). May
+ * be <tt>null</tt>.
+ * @param innerName the (simple) name of the inner class inside its
+ * enclosing class. May be <tt>null</tt> for anonymous inner
+ * classes.
+ * @param access the access flags of the inner class as originally declared
+ * in the enclosing class.
+ */
+ void visitInnerClass(
+ String name,
+ String outerName,
+ String innerName,
+ int access);
+
+ /**
+ * Visits a field of the class.
+ *
+ * @param access the field's access flags (see {@link Opcodes}). This
+ * parameter also indicates if the field is synthetic and/or
+ * deprecated.
+ * @param name the field's name.
+ * @param desc the field's descriptor (see {@link Type Type}).
+ * @param signature the field's signature. May be <tt>null</tt> if the
+ * field's type does not use generic types.
+ * @param value the field's initial value. This parameter, which may be
+ * <tt>null</tt> if the field does not have an initial value, must
+ * be an {@link Integer}, a {@link Float}, a {@link Long}, a
+ * {@link Double} or a {@link String} (for <tt>int</tt>,
+ * <tt>float</tt>, <tt>long</tt> or <tt>String</tt> fields
+ * respectively). <i>This parameter is only used for static fields</i>.
+ * Its value is ignored for non static fields, which must be
+ * initialized through bytecode instructions in constructors or
+ * methods.
+ * @return a visitor to visit field annotations and attributes, or
+ * <tt>null</tt> if this class visitor is not interested in
+ * visiting these annotations and attributes.
+ */
+ FieldVisitor visitField(
+ int access,
+ String name,
+ String desc,
+ String signature,
+ Object value);
+
+ /**
+ * Visits a method of the class. This method <i>must</i> return a new
+ * {@link MethodVisitor} instance (or <tt>null</tt>) each time it is
+ * called, i.e., it should not return a previously returned visitor.
+ *
+ * @param access the method's access flags (see {@link Opcodes}). This
+ * parameter also indicates if the method is synthetic and/or
+ * deprecated.
+ * @param name the method's name.
+ * @param desc the method's descriptor (see {@link Type Type}).
+ * @param signature the method's signature. May be <tt>null</tt> if the
+ * method parameters, return type and exceptions do not use generic
+ * types.
+ * @param exceptions the internal names of the method's exception classes
+ * (see {@link Type#getInternalName() getInternalName}). May be
+ * <tt>null</tt>.
+ * @return an object to visit the byte code of the method, or <tt>null</tt>
+ * if this class visitor is not interested in visiting the code of
+ * this method.
+ */
+ MethodVisitor visitMethod(
+ int access,
+ String name,
+ String desc,
+ String signature,
+ String[] exceptions);
+
+ /**
+ * Visits the end of the class. This method, which is the last one to be
+ * called, is used to inform the visitor that all the fields and methods of
+ * the class have been visited.
+ */
+ void visitEnd();
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/ClassWriter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/ClassWriter.java
new file mode 100644
index 00000000000..22f4e5245dd
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/ClassWriter.java
@@ -0,0 +1,1162 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * A {@link ClassVisitor} that generates classes in bytecode form. More
+ * precisely this visitor generates a byte array conforming to the Java class
+ * file format. It can be used alone, to generate a Java class "from scratch",
+ * or with one or more {@link ClassReader ClassReader} and adapter class visitor
+ * to generate a modified class from one or more existing Java classes.
+ *
+ * @author Eric Bruneton
+ */
+public class ClassWriter implements ClassVisitor {
+
+ /**
+ * The type of instructions without any argument.
+ */
+ final static int NOARG_INSN = 0;
+
+ /**
+ * The type of instructions with an signed byte argument.
+ */
+ final static int SBYTE_INSN = 1;
+
+ /**
+ * The type of instructions with an signed short argument.
+ */
+ final static int SHORT_INSN = 2;
+
+ /**
+ * The type of instructions with a local variable index argument.
+ */
+ final static int VAR_INSN = 3;
+
+ /**
+ * The type of instructions with an implicit local variable index argument.
+ */
+ final static int IMPLVAR_INSN = 4;
+
+ /**
+ * The type of instructions with a type descriptor argument.
+ */
+ final static int TYPE_INSN = 5;
+
+ /**
+ * The type of field and method invocations instructions.
+ */
+ final static int FIELDORMETH_INSN = 6;
+
+ /**
+ * The type of the INVOKEINTERFACE instruction.
+ */
+ final static int ITFMETH_INSN = 7;
+
+ /**
+ * The type of instructions with a 2 bytes bytecode offset label.
+ */
+ final static int LABEL_INSN = 8;
+
+ /**
+ * The type of instructions with a 4 bytes bytecode offset label.
+ */
+ final static int LABELW_INSN = 9;
+
+ /**
+ * The type of the LDC instruction.
+ */
+ final static int LDC_INSN = 10;
+
+ /**
+ * The type of the LDC_W and LDC2_W instructions.
+ */
+ final static int LDCW_INSN = 11;
+
+ /**
+ * The type of the IINC instruction.
+ */
+ final static int IINC_INSN = 12;
+
+ /**
+ * The type of the TABLESWITCH instruction.
+ */
+ final static int TABL_INSN = 13;
+
+ /**
+ * The type of the LOOKUPSWITCH instruction.
+ */
+ final static int LOOK_INSN = 14;
+
+ /**
+ * The type of the MULTIANEWARRAY instruction.
+ */
+ final static int MANA_INSN = 15;
+
+ /**
+ * The type of the WIDE instruction.
+ */
+ final static int WIDE_INSN = 16;
+
+ /**
+ * The instruction types of all JVM opcodes.
+ */
+ static byte[] TYPE;
+
+ /**
+ * The type of CONSTANT_Class constant pool items.
+ */
+ final static int CLASS = 7;
+
+ /**
+ * The type of CONSTANT_Fieldref constant pool items.
+ */
+ final static int FIELD = 9;
+
+ /**
+ * The type of CONSTANT_Methodref constant pool items.
+ */
+ final static int METH = 10;
+
+ /**
+ * The type of CONSTANT_InterfaceMethodref constant pool items.
+ */
+ final static int IMETH = 11;
+
+ /**
+ * The type of CONSTANT_String constant pool items.
+ */
+ final static int STR = 8;
+
+ /**
+ * The type of CONSTANT_Integer constant pool items.
+ */
+ final static int INT = 3;
+
+ /**
+ * The type of CONSTANT_Float constant pool items.
+ */
+ final static int FLOAT = 4;
+
+ /**
+ * The type of CONSTANT_Long constant pool items.
+ */
+ final static int LONG = 5;
+
+ /**
+ * The type of CONSTANT_Double constant pool items.
+ */
+ final static int DOUBLE = 6;
+
+ /**
+ * The type of CONSTANT_NameAndType constant pool items.
+ */
+ final static int NAME_TYPE = 12;
+
+ /**
+ * The type of CONSTANT_Utf8 constant pool items.
+ */
+ final static int UTF8 = 1;
+
+ /**
+ * The class reader from which this class writer was constructed, if any.
+ */
+ ClassReader cr;
+
+ /**
+ * Minor and major version numbers of the class to be generated.
+ */
+ int version;
+
+ /**
+ * Index of the next item to be added in the constant pool.
+ */
+ int index;
+
+ /**
+ * The constant pool of this class.
+ */
+ ByteVector pool;
+
+ /**
+ * The constant pool's hash table data.
+ */
+ Item[] items;
+
+ /**
+ * The threshold of the constant pool's hash table.
+ */
+ int threshold;
+
+ /**
+ * A reusable key used to look for items in the hash {@link #items items}.
+ */
+ Item key;
+
+ /**
+ * A reusable key used to look for items in the hash {@link #items items}.
+ */
+ Item key2;
+
+ /**
+ * A reusable key used to look for items in the hash {@link #items items}.
+ */
+ Item key3;
+
+ /**
+ * The access flags of this class.
+ */
+ private int access;
+
+ /**
+ * The constant pool item that contains the internal name of this class.
+ */
+ private int name;
+
+ /**
+ * The constant pool item that contains the signature of this class.
+ */
+ private int signature;
+
+ /**
+ * The constant pool item that contains the internal name of the super class
+ * of this class.
+ */
+ private int superName;
+
+ /**
+ * Number of interfaces implemented or extended by this class or interface.
+ */
+ private int interfaceCount;
+
+ /**
+ * The interfaces implemented or extended by this class or interface. More
+ * precisely, this array contains the indexes of the constant pool items
+ * that contain the internal names of these interfaces.
+ */
+ private int[] interfaces;
+
+ /**
+ * The index of the constant pool item that contains the name of the source
+ * file from which this class was compiled.
+ */
+ private int sourceFile;
+
+ /**
+ * The SourceDebug attribute of this class.
+ */
+ private ByteVector sourceDebug;
+
+ /**
+ * The constant pool item that contains the name of the enclosing class of
+ * this class.
+ */
+ private int enclosingMethodOwner;
+
+ /**
+ * The constant pool item that contains the name and descriptor of the
+ * enclosing method of this class.
+ */
+ private int enclosingMethod;
+
+ /**
+ * The runtime visible annotations of this class.
+ */
+ private AnnotationWriter anns;
+
+ /**
+ * The runtime invisible annotations of this class.
+ */
+ private AnnotationWriter ianns;
+
+ /**
+ * The non standard attributes of this class.
+ */
+ private Attribute attrs;
+
+ /**
+ * The number of entries in the InnerClasses attribute.
+ */
+ private int innerClassesCount;
+
+ /**
+ * The InnerClasses attribute.
+ */
+ private ByteVector innerClasses;
+
+ /**
+ * The fields of this class. These fields are stored in a linked list of
+ * {@link FieldWriter} objects, linked to each other by their
+ * {@link FieldWriter#next} field. This field stores the first element of
+ * this list.
+ */
+ FieldWriter firstField;
+
+ /**
+ * The fields of this class. These fields are stored in a linked list of
+ * {@link FieldWriter} objects, linked to each other by their
+ * {@link FieldWriter#next} field. This field stores the last element of
+ * this list.
+ */
+ FieldWriter lastField;
+
+ /**
+ * The methods of this class. These methods are stored in a linked list of
+ * {@link MethodWriter} objects, linked to each other by their
+ * {@link MethodWriter#next} field. This field stores the first element of
+ * this list.
+ */
+ MethodWriter firstMethod;
+
+ /**
+ * The methods of this class. These methods are stored in a linked list of
+ * {@link MethodWriter} objects, linked to each other by their
+ * {@link MethodWriter#next} field. This field stores the last element of
+ * this list.
+ */
+ MethodWriter lastMethod;
+
+ /**
+ * <tt>true</tt> if the maximum stack size and number of local variables
+ * must be automatically computed.
+ */
+ private boolean computeMaxs;
+
+ // ------------------------------------------------------------------------
+ // Static initializer
+ // ------------------------------------------------------------------------
+
+ /**
+ * Computes the instruction types of JVM opcodes.
+ */
+ static {
+ int i;
+ byte[] b = new byte[220];
+ String s = "AAAAAAAAAAAAAAAABCKLLDDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAADD"
+ + "DDDEEEEEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ + "AAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAIIIIIIIIIIIIIIIIDNOAA"
+ + "AAAAGGGGGGGHAFBFAAFFAAQPIIJJIIIIIIIIIIIIIIIIII";
+ for (i = 0; i < b.length; ++i) {
+ b[i] = (byte) (s.charAt(i) - 'A');
+ }
+ TYPE = b;
+
+ // code to generate the above string
+ //
+ // // SBYTE_INSN instructions
+ // b[Constants.NEWARRAY] = SBYTE_INSN;
+ // b[Constants.BIPUSH] = SBYTE_INSN;
+ //
+ // // SHORT_INSN instructions
+ // b[Constants.SIPUSH] = SHORT_INSN;
+ //
+ // // (IMPL)VAR_INSN instructions
+ // b[Constants.RET] = VAR_INSN;
+ // for (i = Constants.ILOAD; i <= Constants.ALOAD; ++i) {
+ // b[i] = VAR_INSN;
+ // }
+ // for (i = Constants.ISTORE; i <= Constants.ASTORE; ++i) {
+ // b[i] = VAR_INSN;
+ // }
+ // for (i = 26; i <= 45; ++i) { // ILOAD_0 to ALOAD_3
+ // b[i] = IMPLVAR_INSN;
+ // }
+ // for (i = 59; i <= 78; ++i) { // ISTORE_0 to ASTORE_3
+ // b[i] = IMPLVAR_INSN;
+ // }
+ //
+ // // TYPE_INSN instructions
+ // b[Constants.NEW] = TYPE_INSN;
+ // b[Constants.ANEWARRAY] = TYPE_INSN;
+ // b[Constants.CHECKCAST] = TYPE_INSN;
+ // b[Constants.INSTANCEOF] = TYPE_INSN;
+ //
+ // // (Set)FIELDORMETH_INSN instructions
+ // for (i = Constants.GETSTATIC; i <= Constants.INVOKESTATIC; ++i) {
+ // b[i] = FIELDORMETH_INSN;
+ // }
+ // b[Constants.INVOKEINTERFACE] = ITFMETH_INSN;
+ //
+ // // LABEL(W)_INSN instructions
+ // for (i = Constants.IFEQ; i <= Constants.JSR; ++i) {
+ // b[i] = LABEL_INSN;
+ // }
+ // b[Constants.IFNULL] = LABEL_INSN;
+ // b[Constants.IFNONNULL] = LABEL_INSN;
+ // b[200] = LABELW_INSN; // GOTO_W
+ // b[201] = LABELW_INSN; // JSR_W
+ // // temporary opcodes used internally by ASM - see Label and
+ // MethodWriter
+ // for (i = 202; i < 220; ++i) {
+ // b[i] = LABEL_INSN;
+ // }
+ //
+ // // LDC(_W) instructions
+ // b[Constants.LDC] = LDC_INSN;
+ // b[19] = LDCW_INSN; // LDC_W
+ // b[20] = LDCW_INSN; // LDC2_W
+ //
+ // // special instructions
+ // b[Constants.IINC] = IINC_INSN;
+ // b[Constants.TABLESWITCH] = TABL_INSN;
+ // b[Constants.LOOKUPSWITCH] = LOOK_INSN;
+ // b[Constants.MULTIANEWARRAY] = MANA_INSN;
+ // b[196] = WIDE_INSN; // WIDE
+ //
+ // for (i = 0; i < b.length; ++i) {
+ // System.err.print((char)('A' + b[i]));
+ // }
+ // System.err.println();
+ }
+
+ // ------------------------------------------------------------------------
+ // Constructor
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructs a new {@link ClassWriter ClassWriter} object.
+ *
+ * @param computeMaxs <tt>true</tt> if the maximum stack size and the
+ * maximum number of local variables must be automatically computed.
+ * If this flag is <tt>true</tt>, then the arguments of the
+ * {@link MethodVisitor#visitMaxs visitMaxs} method of the
+ * {@link MethodVisitor} returned by the
+ * {@link #visitMethod visitMethod} method will be ignored, and
+ * computed automatically from the signature and the bytecode of each
+ * method.
+ */
+ public ClassWriter(final boolean computeMaxs) {
+ this(computeMaxs, false);
+ }
+
+ /**
+ * Constructs a new {@link ClassWriter} object.
+ *
+ * @param computeMaxs <tt>true</tt> if the maximum stack size and the
+ * maximum number of local variables must be automatically computed.
+ * If this flag is <tt>true</tt>, then the arguments of the
+ * {@link MethodVisitor#visitMaxs visitMaxs} method of the
+ * {@link MethodVisitor} returned by the
+ * {@link #visitMethod visitMethod} method will be ignored, and
+ * computed automatically from the signature and the bytecode of each
+ * method.
+ * @param skipUnknownAttributes <b>Deprecated</b>. The value of this
+ * parameter is ignored.
+ */
+ public ClassWriter(
+ final boolean computeMaxs,
+ final boolean skipUnknownAttributes)
+ {
+ index = 1;
+ pool = new ByteVector();
+ items = new Item[256];
+ threshold = (int) (0.75d * items.length);
+ key = new Item();
+ key2 = new Item();
+ key3 = new Item();
+ this.computeMaxs = computeMaxs;
+ }
+
+ /**
+ * Constructs a new {@link ClassWriter} object and enables optimizations for
+ * "mostly add" bytecode transformations. These optimizations are the
+ * following:
+ *
+ * <ul> <li>The constant pool from the original class is copied as is in
+ * the new class, which saves time. New constant pool entries will be added
+ * at the end if necessary, but unused constant pool entries <i>won't be
+ * removed</i>.</li> <li>Methods that are not transformed are copied as
+ * is in the new class, directly from the original class bytecode (i.e.
+ * without emitting visit events for all the method instructions), which
+ * saves a <i>lot</i> of time. Untransformed methods are detected by the
+ * fact that the {@link ClassReader} receives {@link MethodVisitor} objects
+ * that come from a {@link ClassWriter} (and not from a custom
+ * {@link ClassAdapter} or any other {@link ClassVisitor} instance).</li>
+ * </ul>
+ *
+ * @param classReader the {@link ClassReader} used to read the original
+ * class. It will be used to copy the entire constant pool from the
+ * original class and also to copy other fragments of original
+ * bytecode where applicable.
+ * @param computeMaxs <tt>true</tt> if the maximum stack size and the
+ * maximum number of local variables must be automatically computed.
+ * If this flag is <tt>true</tt>, then the arguments of the
+ * {@link MethodVisitor#visitMaxs visitMaxs} method of the
+ * {@link MethodVisitor} returned by the
+ * {@link #visitMethod visitMethod} method will be ignored, and
+ * computed automatically from the signature and the bytecode of each
+ * method.
+ */
+ public ClassWriter(
+ final ClassReader classReader,
+ final boolean computeMaxs)
+ {
+ this(computeMaxs, false);
+ classReader.copyPool(this);
+ this.cr = classReader;
+ }
+
+ // ------------------------------------------------------------------------
+ // Implementation of the ClassVisitor interface
+ // ------------------------------------------------------------------------
+
+ public void visit(
+ final int version,
+ final int access,
+ final String name,
+ final String signature,
+ final String superName,
+ final String[] interfaces)
+ {
+ this.version = version;
+ this.access = access;
+ this.name = newClass(name);
+ if (signature != null) {
+ this.signature = newUTF8(signature);
+ }
+ this.superName = superName == null ? 0 : newClass(superName);
+ if (interfaces != null && interfaces.length > 0) {
+ interfaceCount = interfaces.length;
+ this.interfaces = new int[interfaceCount];
+ for (int i = 0; i < interfaceCount; ++i) {
+ this.interfaces[i] = newClass(interfaces[i]);
+ }
+ }
+ }
+
+ public void visitSource(final String file, final String debug) {
+ if (file != null) {
+ sourceFile = newUTF8(file);
+ }
+ if (debug != null) {
+ sourceDebug = new ByteVector().putUTF8(debug);
+ }
+ }
+
+ public void visitOuterClass(
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ enclosingMethodOwner = newClass(owner);
+ if (name != null && desc != null) {
+ enclosingMethod = newNameType(name, desc);
+ }
+ }
+
+ public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+ ByteVector bv = new ByteVector();
+ // write type, and reserve space for values count
+ bv.putShort(newUTF8(desc)).putShort(0);
+ AnnotationWriter aw = new AnnotationWriter(this, true, bv, bv, 2);
+ if (visible) {
+ aw.next = anns;
+ anns = aw;
+ } else {
+ aw.next = ianns;
+ ianns = aw;
+ }
+ return aw;
+ }
+
+ public void visitAttribute(final Attribute attr) {
+ attr.next = attrs;
+ attrs = attr;
+ }
+
+ public void visitInnerClass(
+ final String name,
+ final String outerName,
+ final String innerName,
+ final int access)
+ {
+ if (innerClasses == null) {
+ innerClasses = new ByteVector();
+ }
+ ++innerClassesCount;
+ innerClasses.putShort(name == null ? 0 : newClass(name));
+ innerClasses.putShort(outerName == null ? 0 : newClass(outerName));
+ innerClasses.putShort(innerName == null ? 0 : newUTF8(innerName));
+ innerClasses.putShort(access);
+ }
+
+ public FieldVisitor visitField(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final Object value)
+ {
+ return new FieldWriter(this, access, name, desc, signature, value);
+ }
+
+ public MethodVisitor visitMethod(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final String[] exceptions)
+ {
+ return new MethodWriter(this,
+ access,
+ name,
+ desc,
+ signature,
+ exceptions,
+ computeMaxs);
+ }
+
+ public void visitEnd() {
+ }
+
+ // ------------------------------------------------------------------------
+ // Other public methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the bytecode of the class that was build with this class writer.
+ *
+ * @return the bytecode of the class that was build with this class writer.
+ */
+ public byte[] toByteArray() {
+ // computes the real size of the bytecode of this class
+ int size = 24 + 2 * interfaceCount;
+ int nbFields = 0;
+ FieldWriter fb = firstField;
+ while (fb != null) {
+ ++nbFields;
+ size += fb.getSize();
+ fb = fb.next;
+ }
+ int nbMethods = 0;
+ MethodWriter mb = firstMethod;
+ while (mb != null) {
+ ++nbMethods;
+ size += mb.getSize();
+ mb = mb.next;
+ }
+ int attributeCount = 0;
+ if (signature != 0) {
+ ++attributeCount;
+ size += 8;
+ newUTF8("Signature");
+ }
+ if (sourceFile != 0) {
+ ++attributeCount;
+ size += 8;
+ newUTF8("SourceFile");
+ }
+ if (sourceDebug != null) {
+ ++attributeCount;
+ size += sourceDebug.length + 4;
+ newUTF8("SourceDebugExtension");
+ }
+ if (enclosingMethodOwner != 0) {
+ ++attributeCount;
+ size += 10;
+ newUTF8("EnclosingMethod");
+ }
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ ++attributeCount;
+ size += 6;
+ newUTF8("Deprecated");
+ }
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0
+ && (version & 0xffff) < Opcodes.V1_5)
+ {
+ ++attributeCount;
+ size += 6;
+ newUTF8("Synthetic");
+ }
+ if (version == Opcodes.V1_4) {
+ if ((access & Opcodes.ACC_ANNOTATION) != 0) {
+ ++attributeCount;
+ size += 6;
+ newUTF8("Annotation");
+ }
+ if ((access & Opcodes.ACC_ENUM) != 0) {
+ ++attributeCount;
+ size += 6;
+ newUTF8("Enum");
+ }
+ }
+ if (innerClasses != null) {
+ ++attributeCount;
+ size += 8 + innerClasses.length;
+ newUTF8("InnerClasses");
+ }
+ if (anns != null) {
+ ++attributeCount;
+ size += 8 + anns.getSize();
+ newUTF8("RuntimeVisibleAnnotations");
+ }
+ if (ianns != null) {
+ ++attributeCount;
+ size += 8 + ianns.getSize();
+ newUTF8("RuntimeInvisibleAnnotations");
+ }
+ if (attrs != null) {
+ attributeCount += attrs.getCount();
+ size += attrs.getSize(this, null, 0, -1, -1);
+ }
+ size += pool.length;
+ // allocates a byte vector of this size, in order to avoid unnecessary
+ // arraycopy operations in the ByteVector.enlarge() method
+ ByteVector out = new ByteVector(size);
+ out.putInt(0xCAFEBABE).putInt(version);
+ out.putShort(index).putByteArray(pool.data, 0, pool.length);
+ out.putShort(access).putShort(name).putShort(superName);
+ out.putShort(interfaceCount);
+ for (int i = 0; i < interfaceCount; ++i) {
+ out.putShort(interfaces[i]);
+ }
+ out.putShort(nbFields);
+ fb = firstField;
+ while (fb != null) {
+ fb.put(out);
+ fb = fb.next;
+ }
+ out.putShort(nbMethods);
+ mb = firstMethod;
+ while (mb != null) {
+ mb.put(out);
+ mb = mb.next;
+ }
+ out.putShort(attributeCount);
+ if (signature != 0) {
+ out.putShort(newUTF8("Signature")).putInt(2).putShort(signature);
+ }
+ if (sourceFile != 0) {
+ out.putShort(newUTF8("SourceFile")).putInt(2).putShort(sourceFile);
+ }
+ if (sourceDebug != null) {
+ int len = sourceDebug.length - 2;
+ out.putShort(newUTF8("SourceDebugExtension")).putInt(len);
+ out.putByteArray(sourceDebug.data, 2, len);
+ }
+ if (enclosingMethodOwner != 0) {
+ out.putShort(newUTF8("EnclosingMethod")).putInt(4);
+ out.putShort(enclosingMethodOwner).putShort(enclosingMethod);
+ }
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ out.putShort(newUTF8("Deprecated")).putInt(0);
+ }
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0
+ && (version & 0xffff) < Opcodes.V1_5)
+ {
+ out.putShort(newUTF8("Synthetic")).putInt(0);
+ }
+ if (version == Opcodes.V1_4) {
+ if ((access & Opcodes.ACC_ANNOTATION) != 0) {
+ out.putShort(newUTF8("Annotation")).putInt(0);
+ }
+ if ((access & Opcodes.ACC_ENUM) != 0) {
+ out.putShort(newUTF8("Enum")).putInt(0);
+ }
+ }
+ if (innerClasses != null) {
+ out.putShort(newUTF8("InnerClasses"));
+ out.putInt(innerClasses.length + 2).putShort(innerClassesCount);
+ out.putByteArray(innerClasses.data, 0, innerClasses.length);
+ }
+ if (anns != null) {
+ out.putShort(newUTF8("RuntimeVisibleAnnotations"));
+ anns.put(out);
+ }
+ if (ianns != null) {
+ out.putShort(newUTF8("RuntimeInvisibleAnnotations"));
+ ianns.put(out);
+ }
+ if (attrs != null) {
+ attrs.put(this, null, 0, -1, -1, out);
+ }
+ return out.data;
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods: constant pool management
+ // ------------------------------------------------------------------------
+
+ /**
+ * Adds a number or string constant to the constant pool of the class being
+ * build. Does nothing if the constant pool already contains a similar item.
+ *
+ * @param cst the value of the constant to be added to the constant pool.
+ * This parameter must be an {@link Integer}, a {@link Float}, a
+ * {@link Long}, a {@link Double}, a {@link String} or a
+ * {@link Type}.
+ * @return a new or already existing constant item with the given value.
+ */
+ Item newConstItem(final Object cst) {
+ if (cst instanceof Integer) {
+ int val = ((Integer) cst).intValue();
+ return newInteger(val);
+ } else if (cst instanceof Byte) {
+ int val = ((Byte) cst).intValue();
+ return newInteger(val);
+ } else if (cst instanceof Character) {
+ int val = ((Character) cst).charValue();
+ return newInteger(val);
+ } else if (cst instanceof Short) {
+ int val = ((Short) cst).intValue();
+ return newInteger(val);
+ } else if (cst instanceof Boolean) {
+ int val = ((Boolean) cst).booleanValue() ? 1 : 0;
+ return newInteger(val);
+ } else if (cst instanceof Float) {
+ float val = ((Float) cst).floatValue();
+ return newFloat(val);
+ } else if (cst instanceof Long) {
+ long val = ((Long) cst).longValue();
+ return newLong(val);
+ } else if (cst instanceof Double) {
+ double val = ((Double) cst).doubleValue();
+ return newDouble(val);
+ } else if (cst instanceof String) {
+ return newString((String) cst);
+ } else if (cst instanceof Type) {
+ Type t = (Type) cst;
+ return newClassItem(t.getSort() == Type.OBJECT
+ ? t.getInternalName()
+ : t.getDescriptor());
+ } else {
+ throw new IllegalArgumentException("value " + cst);
+ }
+ }
+
+ /**
+ * Adds a number or string constant to the constant pool of the class being
+ * build. Does nothing if the constant pool already contains a similar item.
+ * <i>This method is intended for {@link Attribute} sub classes, and is
+ * normally not needed by class generators or adapters.</i>
+ *
+ * @param cst the value of the constant to be added to the constant pool.
+ * This parameter must be an {@link Integer}, a {@link Float}, a
+ * {@link Long}, a {@link Double} or a {@link String}.
+ * @return the index of a new or already existing constant item with the
+ * given value.
+ */
+ public int newConst(final Object cst) {
+ return newConstItem(cst).index;
+ }
+
+ /**
+ * Adds an UTF8 string to the constant pool of the class being build. Does
+ * nothing if the constant pool already contains a similar item. <i>This
+ * method is intended for {@link Attribute} sub classes, and is normally not
+ * needed by class generators or adapters.</i>
+ *
+ * @param value the String value.
+ * @return the index of a new or already existing UTF8 item.
+ */
+ public int newUTF8(final String value) {
+ key.set(UTF8, value, null, null);
+ Item result = get(key);
+ if (result == null) {
+ pool.putByte(UTF8).putUTF8(value);
+ result = new Item(index++, key);
+ put(result);
+ }
+ return result.index;
+ }
+
+ /**
+ * Adds a class reference to the constant pool of the class being build.
+ * Does nothing if the constant pool already contains a similar item.
+ * <i>This method is intended for {@link Attribute} sub classes, and is
+ * normally not needed by class generators or adapters.</i>
+ *
+ * @param value the internal name of the class.
+ * @return the index of a new or already existing class reference item.
+ */
+ public int newClass(final String value) {
+ return newClassItem(value).index;
+ }
+
+ /**
+ * Adds a class reference to the constant pool of the class being build.
+ * Does nothing if the constant pool already contains a similar item.
+ * <i>This method is intended for {@link Attribute} sub classes, and is
+ * normally not needed by class generators or adapters.</i>
+ *
+ * @param value the internal name of the class.
+ * @return a new or already existing class reference item.
+ */
+ private Item newClassItem(final String value) {
+ key2.set(CLASS, value, null, null);
+ Item result = get(key2);
+ if (result == null) {
+ pool.put12(CLASS, newUTF8(value));
+ result = new Item(index++, key2);
+ put(result);
+ }
+ return result;
+ }
+
+ /**
+ * Adds a field reference to the constant pool of the class being build.
+ * Does nothing if the constant pool already contains a similar item.
+ * <i>This method is intended for {@link Attribute} sub classes, and is
+ * normally not needed by class generators or adapters.</i>
+ *
+ * @param owner the internal name of the field's owner class.
+ * @param name the field's name.
+ * @param desc the field's descriptor.
+ * @return the index of a new or already existing field reference item.
+ */
+ public int newField(final String owner, final String name, final String desc)
+ {
+ key3.set(FIELD, owner, name, desc);
+ Item result = get(key3);
+ if (result == null) {
+ put122(FIELD, newClass(owner), newNameType(name, desc));
+ result = new Item(index++, key3);
+ put(result);
+ }
+ return result.index;
+ }
+
+ /**
+ * Adds a method reference to the constant pool of the class being build.
+ * Does nothing if the constant pool already contains a similar item.
+ *
+ * @param owner the internal name of the method's owner class.
+ * @param name the method's name.
+ * @param desc the method's descriptor.
+ * @param itf <tt>true</tt> if <tt>owner</tt> is an interface.
+ * @return a new or already existing method reference item.
+ */
+ Item newMethodItem(
+ final String owner,
+ final String name,
+ final String desc,
+ final boolean itf)
+ {
+ int type = itf ? IMETH : METH;
+ key3.set(type, owner, name, desc);
+ Item result = get(key3);
+ if (result == null) {
+ put122(type, newClass(owner), newNameType(name, desc));
+ result = new Item(index++, key3);
+ put(result);
+ }
+ return result;
+ }
+
+ /**
+ * Adds a method reference to the constant pool of the class being build.
+ * Does nothing if the constant pool already contains a similar item.
+ * <i>This method is intended for {@link Attribute} sub classes, and is
+ * normally not needed by class generators or adapters.</i>
+ *
+ * @param owner the internal name of the method's owner class.
+ * @param name the method's name.
+ * @param desc the method's descriptor.
+ * @param itf <tt>true</tt> if <tt>owner</tt> is an interface.
+ * @return the index of a new or already existing method reference item.
+ */
+ public int newMethod(
+ final String owner,
+ final String name,
+ final String desc,
+ final boolean itf)
+ {
+ return newMethodItem(owner, name, desc, itf).index;
+ }
+
+ /**
+ * Adds an integer to the constant pool of the class being build. Does
+ * nothing if the constant pool already contains a similar item.
+ *
+ * @param value the int value.
+ * @return a new or already existing int item.
+ */
+ Item newInteger(final int value) {
+ key.set(value);
+ Item result = get(key);
+ if (result == null) {
+ pool.putByte(INT).putInt(value);
+ result = new Item(index++, key);
+ put(result);
+ }
+ return result;
+ }
+
+ /**
+ * Adds a float to the constant pool of the class being build. Does nothing
+ * if the constant pool already contains a similar item.
+ *
+ * @param value the float value.
+ * @return a new or already existing float item.
+ */
+ Item newFloat(final float value) {
+ key.set(value);
+ Item result = get(key);
+ if (result == null) {
+ pool.putByte(FLOAT).putInt(Float.floatToIntBits(value));
+ result = new Item(index++, key);
+ put(result);
+ }
+ return result;
+ }
+
+ /**
+ * Adds a long to the constant pool of the class being build. Does nothing
+ * if the constant pool already contains a similar item.
+ *
+ * @param value the long value.
+ * @return a new or already existing long item.
+ */
+ Item newLong(final long value) {
+ key.set(value);
+ Item result = get(key);
+ if (result == null) {
+ pool.putByte(LONG).putLong(value);
+ result = new Item(index, key);
+ put(result);
+ index += 2;
+ }
+ return result;
+ }
+
+ /**
+ * Adds a double to the constant pool of the class being build. Does nothing
+ * if the constant pool already contains a similar item.
+ *
+ * @param value the double value.
+ * @return a new or already existing double item.
+ */
+ Item newDouble(final double value) {
+ key.set(value);
+ Item result = get(key);
+ if (result == null) {
+ pool.putByte(DOUBLE).putLong(Double.doubleToLongBits(value));
+ result = new Item(index, key);
+ put(result);
+ index += 2;
+ }
+ return result;
+ }
+
+ /**
+ * Adds a string to the constant pool of the class being build. Does nothing
+ * if the constant pool already contains a similar item.
+ *
+ * @param value the String value.
+ * @return a new or already existing string item.
+ */
+ private Item newString(final String value) {
+ key2.set(STR, value, null, null);
+ Item result = get(key2);
+ if (result == null) {
+ pool.put12(STR, newUTF8(value));
+ result = new Item(index++, key2);
+ put(result);
+ }
+ return result;
+ }
+
+ /**
+ * Adds a name and type to the constant pool of the class being build. Does
+ * nothing if the constant pool already contains a similar item. <i>This
+ * method is intended for {@link Attribute} sub classes, and is normally not
+ * needed by class generators or adapters.</i>
+ *
+ * @param name a name.
+ * @param desc a type descriptor.
+ * @return the index of a new or already existing name and type item.
+ */
+ public int newNameType(final String name, final String desc) {
+ key2.set(NAME_TYPE, name, desc, null);
+ Item result = get(key2);
+ if (result == null) {
+ put122(NAME_TYPE, newUTF8(name), newUTF8(desc));
+ result = new Item(index++, key2);
+ put(result);
+ }
+ return result.index;
+ }
+
+ /**
+ * Returns the constant pool's hash table item which is equal to the given
+ * item.
+ *
+ * @param key a constant pool item.
+ * @return the constant pool's hash table item which is equal to the given
+ * item, or <tt>null</tt> if there is no such item.
+ */
+ private Item get(final Item key) {
+ Item i = items[key.hashCode % items.length];
+ while (i != null && !key.isEqualTo(i)) {
+ i = i.next;
+ }
+ return i;
+ }
+
+ /**
+ * Puts the given item in the constant pool's hash table. The hash table
+ * <i>must</i> not already contains this item.
+ *
+ * @param i the item to be added to the constant pool's hash table.
+ */
+ private void put(final Item i) {
+ if (index > threshold) {
+ int ll = items.length;
+ int nl = ll * 2 + 1;
+ Item[] newItems = new Item[nl];
+ for (int l = ll - 1; l >= 0; --l) {
+ Item j = items[l];
+ while (j != null) {
+ int index = j.hashCode % newItems.length;
+ Item k = j.next;
+ j.next = newItems[index];
+ newItems[index] = j;
+ j = k;
+ }
+ }
+ items = newItems;
+ threshold = (int) (nl * 0.75);
+ }
+ int index = i.hashCode % items.length;
+ i.next = items[index];
+ items[index] = i;
+ }
+
+ /**
+ * Puts one byte and two shorts into the constant pool.
+ *
+ * @param b a byte.
+ * @param s1 a short.
+ * @param s2 another short.
+ */
+ private void put122(final int b, final int s1, final int s2) {
+ pool.put12(b, s1).putShort(s2);
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/Edge.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/Edge.java
new file mode 100644
index 00000000000..c0bf108cee2
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/Edge.java
@@ -0,0 +1,57 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * An edge in the control flow graph of a method body. See {@link Label Label}.
+ *
+ * @author Eric Bruneton
+ */
+class Edge {
+
+ /**
+ * The (relative) stack size in the basic block from which this edge
+ * originates. This size is equal to the stack size at the "jump"
+ * instruction to which this edge corresponds, relatively to the stack size
+ * at the beginning of the originating basic block.
+ */
+ int stackSize;
+
+ /**
+ * The successor block of the basic block from which this edge originates.
+ */
+ Label successor;
+
+ /**
+ * The next edge in the list of successors of the originating basic block.
+ * See {@link Label#successors successors}.
+ */
+ Edge next;
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/FieldVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/FieldVisitor.java
new file mode 100644
index 00000000000..0005034ca69
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/FieldVisitor.java
@@ -0,0 +1,63 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * A visitor to visit a Java field. The methods of this interface must be called
+ * in the following order: ( <tt>visitAnnotation</tt> |
+ * <tt>visitAttribute</tt> )* <tt>visitEnd</tt>.
+ *
+ * @author Eric Bruneton
+ */
+public interface FieldVisitor {
+
+ /**
+ * Visits an annotation of the field.
+ *
+ * @param desc the class descriptor of the annotation class.
+ * @param visible <tt>true</tt> if the annotation is visible at runtime.
+ * @return a non null visitor to visit the annotation values.
+ */
+ AnnotationVisitor visitAnnotation(String desc, boolean visible);
+
+ /**
+ * Visits a non standard attribute of the field.
+ *
+ * @param attr an attribute.
+ */
+ void visitAttribute(Attribute attr);
+
+ /**
+ * Visits the end of the field. This method, which is the last one to be
+ * called, is used to inform the visitor that all the annotations and
+ * attributes of the field have been visited.
+ */
+ void visitEnd();
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/FieldWriter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/FieldWriter.java
new file mode 100644
index 00000000000..7eb3ed4fc60
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/FieldWriter.java
@@ -0,0 +1,276 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * An {@link FieldVisitor} that generates Java fields in bytecode form.
+ *
+ * @author Eric Bruneton
+ */
+final class FieldWriter implements FieldVisitor {
+
+ /**
+ * Next field writer (see {@link ClassWriter#firstField firstField}).
+ */
+ FieldWriter next;
+
+ /**
+ * The class writer to which this field must be added.
+ */
+ private ClassWriter cw;
+
+ /**
+ * Access flags of this field.
+ */
+ private int access;
+
+ /**
+ * The index of the constant pool item that contains the name of this
+ * method.
+ */
+ private int name;
+
+ /**
+ * The index of the constant pool item that contains the descriptor of this
+ * field.
+ */
+ private int desc;
+
+ /**
+ * The index of the constant pool item that contains the signature of this
+ * field.
+ */
+ private int signature;
+
+ /**
+ * The index of the constant pool item that contains the constant value of
+ * this field.
+ */
+ private int value;
+
+ /**
+ * The runtime visible annotations of this field. May be <tt>null</tt>.
+ */
+ private AnnotationWriter anns;
+
+ /**
+ * The runtime invisible annotations of this field. May be <tt>null</tt>.
+ */
+ private AnnotationWriter ianns;
+
+ /**
+ * The non standard attributes of this field. May be <tt>null</tt>.
+ */
+ private Attribute attrs;
+
+ // ------------------------------------------------------------------------
+ // Constructor
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructs a new {@link FieldWriter}.
+ *
+ * @param cw the class writer to which this field must be added.
+ * @param access the field's access flags (see {@link Opcodes}).
+ * @param name the field's name.
+ * @param desc the field's descriptor (see {@link Type}).
+ * @param signature the field's signature. May be <tt>null</tt>.
+ * @param value the field's constant value. May be <tt>null</tt>.
+ */
+ protected FieldWriter(
+ final ClassWriter cw,
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final Object value)
+ {
+ if (cw.firstField == null) {
+ cw.firstField = this;
+ } else {
+ cw.lastField.next = this;
+ }
+ cw.lastField = this;
+ this.cw = cw;
+ this.access = access;
+ this.name = cw.newUTF8(name);
+ this.desc = cw.newUTF8(desc);
+ if (signature != null) {
+ this.signature = cw.newUTF8(signature);
+ }
+ if (value != null) {
+ this.value = cw.newConstItem(value).index;
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Implementation of the FieldVisitor interface
+ // ------------------------------------------------------------------------
+
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ ByteVector bv = new ByteVector();
+ // write type, and reserve space for values count
+ bv.putShort(cw.newUTF8(desc)).putShort(0);
+ AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv, 2);
+ if (visible) {
+ aw.next = anns;
+ anns = aw;
+ } else {
+ aw.next = ianns;
+ ianns = aw;
+ }
+ return aw;
+ }
+
+ public void visitAttribute(final Attribute attr) {
+ attr.next = attrs;
+ attrs = attr;
+ }
+
+ public void visitEnd() {
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the size of this field.
+ *
+ * @return the size of this field.
+ */
+ int getSize() {
+ int size = 8;
+ if (value != 0) {
+ cw.newUTF8("ConstantValue");
+ size += 8;
+ }
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0
+ && (cw.version & 0xffff) < Opcodes.V1_5)
+ {
+ cw.newUTF8("Synthetic");
+ size += 6;
+ }
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ cw.newUTF8("Deprecated");
+ size += 6;
+ }
+ if (cw.version == Opcodes.V1_4 && (access & Opcodes.ACC_ENUM) != 0) {
+ cw.newUTF8("Enum");
+ size += 6;
+ }
+ if (signature != 0) {
+ cw.newUTF8("Signature");
+ size += 8;
+ }
+ if (anns != null) {
+ cw.newUTF8("RuntimeVisibleAnnotations");
+ size += 8 + anns.getSize();
+ }
+ if (ianns != null) {
+ cw.newUTF8("RuntimeInvisibleAnnotations");
+ size += 8 + ianns.getSize();
+ }
+ if (attrs != null) {
+ size += attrs.getSize(cw, null, 0, -1, -1);
+ }
+ return size;
+ }
+
+ /**
+ * Puts the content of this field into the given byte vector.
+ *
+ * @param out where the content of this field must be put.
+ */
+ void put(final ByteVector out) {
+ out.putShort(access).putShort(name).putShort(desc);
+ int attributeCount = 0;
+ if (value != 0) {
+ ++attributeCount;
+ }
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0
+ && (cw.version & 0xffff) < Opcodes.V1_5)
+ {
+ ++attributeCount;
+ }
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ ++attributeCount;
+ }
+ if (cw.version == Opcodes.V1_4 && (access & Opcodes.ACC_ENUM) != 0) {
+ ++attributeCount;
+ }
+ if (signature != 0) {
+ ++attributeCount;
+ }
+ if (anns != null) {
+ ++attributeCount;
+ }
+ if (ianns != null) {
+ ++attributeCount;
+ }
+ if (attrs != null) {
+ attributeCount += attrs.getCount();
+ }
+ out.putShort(attributeCount);
+ if (value != 0) {
+ out.putShort(cw.newUTF8("ConstantValue"));
+ out.putInt(2).putShort(value);
+ }
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0
+ && (cw.version & 0xffff) < Opcodes.V1_5)
+ {
+ out.putShort(cw.newUTF8("Synthetic")).putInt(0);
+ }
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ out.putShort(cw.newUTF8("Deprecated")).putInt(0);
+ }
+ if (cw.version == Opcodes.V1_4 && (access & Opcodes.ACC_ENUM) != 0) {
+ out.putShort(cw.newUTF8("Enum")).putInt(0);
+ }
+ if (signature != 0) {
+ out.putShort(cw.newUTF8("Signature"));
+ out.putInt(2).putShort(signature);
+ }
+ if (anns != null) {
+ out.putShort(cw.newUTF8("RuntimeVisibleAnnotations"));
+ anns.put(out);
+ }
+ if (ianns != null) {
+ out.putShort(cw.newUTF8("RuntimeInvisibleAnnotations"));
+ ianns.put(out);
+ }
+ if (attrs != null) {
+ attrs.put(cw, null, 0, -1, -1, out);
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/Handler.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/Handler.java
new file mode 100644
index 00000000000..8bef8453114
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/Handler.java
@@ -0,0 +1,70 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * Information about an exception handler block.
+ *
+ * @author Eric Bruneton
+ */
+class Handler {
+
+ /**
+ * Beginning of the exception handler's scope (inclusive).
+ */
+ Label start;
+
+ /**
+ * End of the exception handler's scope (exclusive).
+ */
+ Label end;
+
+ /**
+ * Beginning of the exception handler's code.
+ */
+ Label handler;
+
+ /**
+ * Internal name of the type of exceptions handled by this handler, or
+ * <tt>null</tt> to catch any exceptions.
+ */
+ String desc;
+
+ /**
+ * Constant pool index of the internal name of the type of exceptions
+ * handled by this handler, or 0 to catch any exceptions.
+ */
+ int type;
+
+ /**
+ * Next exception handler block info.
+ */
+ Handler next;
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/Item.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/Item.java
new file mode 100644
index 00000000000..4c5285f2f2c
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/Item.java
@@ -0,0 +1,252 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * A constant pool item. Constant pool items can be created with the 'newXXX'
+ * methods in the {@link ClassWriter} class.
+ *
+ * @author Eric Bruneton
+ */
+final class Item {
+
+ /**
+ * Index of this item in the constant pool.
+ */
+ int index;
+
+ /**
+ * Type of this constant pool item. A single class is used to represent all
+ * constant pool item types, in order to minimize the bytecode size of this
+ * package. The value of this field is one of {@link ClassWriter#INT},
+ * {@link ClassWriter#LONG}, {@link ClassWriter#FLOAT},
+ * {@link ClassWriter#DOUBLE}, {@link ClassWriter#UTF8},
+ * {@link ClassWriter#STR}, {@link ClassWriter#CLASS},
+ * {@link ClassWriter#NAME_TYPE}, {@link ClassWriter#FIELD},
+ * {@link ClassWriter#METH}, {@link ClassWriter#IMETH}.
+ */
+ int type;
+
+ /**
+ * Value of this item, for an integer item.
+ */
+ int intVal;
+
+ /**
+ * Value of this item, for a long item.
+ */
+ long longVal;
+
+ /**
+ * Value of this item, for a float item.
+ */
+ float floatVal;
+
+ /**
+ * Value of this item, for a double item.
+ */
+ double doubleVal;
+
+ /**
+ * First part of the value of this item, for items that do not hold a
+ * primitive value.
+ */
+ String strVal1;
+
+ /**
+ * Second part of the value of this item, for items that do not hold a
+ * primitive value.
+ */
+ String strVal2;
+
+ /**
+ * Third part of the value of this item, for items that do not hold a
+ * primitive value.
+ */
+ String strVal3;
+
+ /**
+ * The hash code value of this constant pool item.
+ */
+ int hashCode;
+
+ /**
+ * Link to another constant pool item, used for collision lists in the
+ * constant pool's hash table.
+ */
+ Item next;
+
+ /**
+ * Constructs an uninitialized {@link Item}.
+ */
+ Item() {
+ }
+
+ Item(int index) {
+ this.index = index;
+ }
+
+ /**
+ * Constructs a copy of the given item.
+ *
+ * @param index index of the item to be constructed.
+ * @param i the item that must be copied into the item to be constructed.
+ */
+ Item(final int index, final Item i) {
+ this.index = index;
+ type = i.type;
+ intVal = i.intVal;
+ longVal = i.longVal;
+ floatVal = i.floatVal;
+ doubleVal = i.doubleVal;
+ strVal1 = i.strVal1;
+ strVal2 = i.strVal2;
+ strVal3 = i.strVal3;
+ hashCode = i.hashCode;
+ }
+
+ /**
+ * Sets this item to an integer item.
+ *
+ * @param intVal the value of this item.
+ */
+ void set(final int intVal) {
+ this.type = ClassWriter.INT;
+ this.intVal = intVal;
+ this.hashCode = 0x7FFFFFFF & (type + intVal);
+ }
+
+ /**
+ * Sets this item to a long item.
+ *
+ * @param longVal the value of this item.
+ */
+ void set(final long longVal) {
+ this.type = ClassWriter.LONG;
+ this.longVal = longVal;
+ this.hashCode = 0x7FFFFFFF & (type + (int) longVal);
+ }
+
+ /**
+ * Sets this item to a float item.
+ *
+ * @param floatVal the value of this item.
+ */
+ void set(final float floatVal) {
+ this.type = ClassWriter.FLOAT;
+ this.floatVal = floatVal;
+ this.hashCode = 0x7FFFFFFF & (type + (int) floatVal);
+ }
+
+ /**
+ * Sets this item to a double item.
+ *
+ * @param doubleVal the value of this item.
+ */
+ void set(final double doubleVal) {
+ this.type = ClassWriter.DOUBLE;
+ this.doubleVal = doubleVal;
+ this.hashCode = 0x7FFFFFFF & (type + (int) doubleVal);
+ }
+
+ /**
+ * Sets this item to an item that do not hold a primitive value.
+ *
+ * @param type the type of this item.
+ * @param strVal1 first part of the value of this item.
+ * @param strVal2 second part of the value of this item.
+ * @param strVal3 third part of the value of this item.
+ */
+ void set(
+ final int type,
+ final String strVal1,
+ final String strVal2,
+ final String strVal3)
+ {
+ this.type = type;
+ this.strVal1 = strVal1;
+ this.strVal2 = strVal2;
+ this.strVal3 = strVal3;
+ switch (type) {
+ case ClassWriter.UTF8:
+ case ClassWriter.STR:
+ case ClassWriter.CLASS:
+ hashCode = 0x7FFFFFFF & (type + strVal1.hashCode());
+ return;
+ case ClassWriter.NAME_TYPE:
+ hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
+ * strVal2.hashCode());
+ return;
+ // ClassWriter.FIELD:
+ // ClassWriter.METH:
+ // ClassWriter.IMETH:
+ default:
+ hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
+ * strVal2.hashCode() * strVal3.hashCode());
+ }
+ }
+
+ /**
+ * Indicates if the given item is equal to this one.
+ *
+ * @param i the item to be compared to this one.
+ * @return <tt>true</tt> if the given item if equal to this one,
+ * <tt>false</tt> otherwise.
+ */
+ boolean isEqualTo(final Item i) {
+ if (i.type == type) {
+ switch (type) {
+ case ClassWriter.INT:
+ return i.intVal == intVal;
+ case ClassWriter.LONG:
+ return i.longVal == longVal;
+ case ClassWriter.FLOAT:
+ return i.floatVal == floatVal;
+ case ClassWriter.DOUBLE:
+ return i.doubleVal == doubleVal;
+ case ClassWriter.UTF8:
+ case ClassWriter.STR:
+ case ClassWriter.CLASS:
+ return i.strVal1.equals(strVal1);
+ case ClassWriter.NAME_TYPE:
+ return i.strVal1.equals(strVal1)
+ && i.strVal2.equals(strVal2);
+ // ClassWriter.FIELD:
+ // ClassWriter.METH:
+ // ClassWriter.IMETH:
+ default:
+ return i.strVal1.equals(strVal1)
+ && i.strVal2.equals(strVal2)
+ && i.strVal3.equals(strVal3);
+ }
+ }
+ return false;
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/Label.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/Label.java
new file mode 100644
index 00000000000..79291f27cd1
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/Label.java
@@ -0,0 +1,299 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * A label represents a position in the bytecode of a method. Labels are used
+ * for jump, goto, and switch instructions, and for try catch blocks.
+ *
+ * @author Eric Bruneton
+ */
+public class Label {
+
+ /**
+ * The line number corresponding to this label, if known.
+ */
+ int line;
+
+ /**
+ * Indicates if the position of this label is known.
+ */
+ boolean resolved;
+
+ /**
+ * The position of this label in the code, if known.
+ */
+ int position;
+
+ /**
+ * If the label position has been updated, after instruction resizing.
+ */
+ boolean resized;
+
+ /**
+ * Number of forward references to this label, times two.
+ */
+ private int referenceCount;
+
+ /**
+ * Informations about forward references. Each forward reference is
+ * described by two consecutive integers in this array: the first one is the
+ * position of the first byte of the bytecode instruction that contains the
+ * forward reference, while the second is the position of the first byte of
+ * the forward reference itself. In fact the sign of the first integer
+ * indicates if this reference uses 2 or 4 bytes, and its absolute value
+ * gives the position of the bytecode instruction.
+ */
+ private int[] srcAndRefPositions;
+
+ /*
+ * Fields for the control flow graph analysis algorithm (used to compute the
+ * maximum stack size). A control flow graph contains one node per "basic
+ * block", and one edge per "jump" from one basic block to another. Each
+ * node (i.e., each basic block) is represented by the Label object that
+ * corresponds to the first instruction of this basic block. Each node also
+ * stores the list of it successors in the graph, as a linked list of Edge
+ * objects.
+ */
+
+ /**
+ * The stack size at the beginning of this basic block. This size is
+ * initially unknown. It is computed by the control flow analysis algorithm
+ * (see {@link MethodWriter#visitMaxs visitMaxs}).
+ */
+ int beginStackSize;
+
+ /**
+ * The (relative) maximum stack size corresponding to this basic block. This
+ * size is relative to the stack size at the beginning of the basic block,
+ * i.e., the true maximum stack size is equal to {@link #beginStackSize
+ * beginStackSize} + {@link #maxStackSize maxStackSize}.
+ */
+ int maxStackSize;
+
+ /**
+ * The successors of this node in the control flow graph. These successors
+ * are stored in a linked list of {@link Edge Edge} objects, linked to each
+ * other by their {@link Edge#next} field.
+ */
+ Edge successors;
+
+ /**
+ * The next basic block in the basic block stack. See
+ * {@link MethodWriter#visitMaxs visitMaxs}.
+ */
+ Label next;
+
+ /**
+ * <tt>true</tt> if this basic block has been pushed in the basic block
+ * stack. See {@link MethodWriter#visitMaxs visitMaxs}.
+ */
+ boolean pushed;
+
+ // ------------------------------------------------------------------------
+ // Constructor
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructs a new label.
+ */
+ public Label() {
+ }
+
+ // ------------------------------------------------------------------------
+ // Methods to compute offsets and to manage forward references
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the offset corresponding to this label. This offset is computed
+ * from the start of the method's bytecode. <i>This method is intended for
+ * {@link Attribute} sub classes, and is normally not needed by class
+ * generators or adapters.</i>
+ *
+ * @return the offset corresponding to this label.
+ * @throws IllegalStateException if this label is not resolved yet.
+ */
+ public int getOffset() {
+ if (!resolved) {
+ throw new IllegalStateException("Label offset position has not been resolved yet");
+ }
+ return position;
+ }
+
+ /**
+ * Puts a reference to this label in the bytecode of a method. If the
+ * position of the label is known, the offset is computed and written
+ * directly. Otherwise, a null offset is written and a new forward reference
+ * is declared for this label.
+ *
+ * @param owner the code writer that calls this method.
+ * @param out the bytecode of the method.
+ * @param source the position of first byte of the bytecode instruction that
+ * contains this label.
+ * @param wideOffset <tt>true</tt> if the reference must be stored in 4
+ * bytes, or <tt>false</tt> if it must be stored with 2 bytes.
+ * @throws IllegalArgumentException if this label has not been created by
+ * the given code writer.
+ */
+ void put(
+ final MethodWriter owner,
+ final ByteVector out,
+ final int source,
+ final boolean wideOffset)
+ {
+ if (resolved) {
+ if (wideOffset) {
+ out.putInt(position - source);
+ } else {
+ out.putShort(position - source);
+ }
+ } else {
+ if (wideOffset) {
+ addReference(-1 - source, out.length);
+ out.putInt(-1);
+ } else {
+ addReference(source, out.length);
+ out.putShort(-1);
+ }
+ }
+ }
+
+ /**
+ * Adds a forward reference to this label. This method must be called only
+ * for a true forward reference, i.e. only if this label is not resolved
+ * yet. For backward references, the offset of the reference can be, and
+ * must be, computed and stored directly.
+ *
+ * @param sourcePosition the position of the referencing instruction. This
+ * position will be used to compute the offset of this forward
+ * reference.
+ * @param referencePosition the position where the offset for this forward
+ * reference must be stored.
+ */
+ private void addReference(
+ final int sourcePosition,
+ final int referencePosition)
+ {
+ if (srcAndRefPositions == null) {
+ srcAndRefPositions = new int[6];
+ }
+ if (referenceCount >= srcAndRefPositions.length) {
+ int[] a = new int[srcAndRefPositions.length + 6];
+ System.arraycopy(srcAndRefPositions,
+ 0,
+ a,
+ 0,
+ srcAndRefPositions.length);
+ srcAndRefPositions = a;
+ }
+ srcAndRefPositions[referenceCount++] = sourcePosition;
+ srcAndRefPositions[referenceCount++] = referencePosition;
+ }
+
+ /**
+ * Resolves all forward references to this label. This method must be called
+ * when this label is added to the bytecode of the method, i.e. when its
+ * position becomes known. This method fills in the blanks that where left
+ * in the bytecode by each forward reference previously added to this label.
+ *
+ * @param owner the code writer that calls this method.
+ * @param position the position of this label in the bytecode.
+ * @param data the bytecode of the method.
+ * @return <tt>true</tt> if a blank that was left for this label was to
+ * small to store the offset. In such a case the corresponding jump
+ * instruction is replaced with a pseudo instruction (using unused
+ * opcodes) using an unsigned two bytes offset. These pseudo
+ * instructions will need to be replaced with true instructions with
+ * wider offsets (4 bytes instead of 2). This is done in
+ * {@link MethodWriter#resizeInstructions}.
+ * @throws IllegalArgumentException if this label has already been resolved,
+ * or if it has not been created by the given code writer.
+ */
+ boolean resolve(
+ final MethodWriter owner,
+ final int position,
+ final byte[] data)
+ {
+ boolean needUpdate = false;
+ this.resolved = true;
+ this.position = position;
+ int i = 0;
+ while (i < referenceCount) {
+ int source = srcAndRefPositions[i++];
+ int reference = srcAndRefPositions[i++];
+ int offset;
+ if (source >= 0) {
+ offset = position - source;
+ if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) {
+ /*
+ * changes the opcode of the jump instruction, in order to
+ * be able to find it later (see resizeInstructions in
+ * MethodWriter). These temporary opcodes are similar to
+ * jump instruction opcodes, except that the 2 bytes offset
+ * is unsigned (and can therefore represent values from 0 to
+ * 65535, which is sufficient since the size of a method is
+ * limited to 65535 bytes).
+ */
+ int opcode = data[reference - 1] & 0xFF;
+ if (opcode <= Opcodes.JSR) {
+ // changes IFEQ ... JSR to opcodes 202 to 217
+ data[reference - 1] = (byte) (opcode + 49);
+ } else {
+ // changes IFNULL and IFNONNULL to opcodes 218 and 219
+ data[reference - 1] = (byte) (opcode + 20);
+ }
+ needUpdate = true;
+ }
+ data[reference++] = (byte) (offset >>> 8);
+ data[reference] = (byte) offset;
+ } else {
+ offset = position + source + 1;
+ data[reference++] = (byte) (offset >>> 24);
+ data[reference++] = (byte) (offset >>> 16);
+ data[reference++] = (byte) (offset >>> 8);
+ data[reference] = (byte) offset;
+ }
+ }
+ return needUpdate;
+ }
+
+ // ------------------------------------------------------------------------
+ // Overriden Object methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns a string representation of this label.
+ *
+ * @return a string representation of this label.
+ */
+ public String toString() {
+ return "L" + System.identityHashCode(this);
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/MethodAdapter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/MethodAdapter.java
new file mode 100644
index 00000000000..c7e127de793
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/MethodAdapter.java
@@ -0,0 +1,185 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * An empty {@link MethodVisitor} that delegates to another
+ * {@link MethodVisitor}. This class can be used as a super class to quickly
+ * implement usefull method adapter classes, just by overriding the necessary
+ * methods.
+ *
+ * @author Eric Bruneton
+ */
+public class MethodAdapter implements MethodVisitor {
+
+ /**
+ * The {@link MethodVisitor} to which this adapter delegates calls.
+ */
+ protected MethodVisitor mv;
+
+ /**
+ * Constructs a new {@link MethodAdapter} object.
+ *
+ * @param mv the code visitor to which this adapter must delegate calls.
+ */
+ public MethodAdapter(final MethodVisitor mv) {
+ this.mv = mv;
+ }
+
+ public AnnotationVisitor visitAnnotationDefault() {
+ return mv.visitAnnotationDefault();
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ return mv.visitAnnotation(desc, visible);
+ }
+
+ public AnnotationVisitor visitParameterAnnotation(
+ final int parameter,
+ final String desc,
+ final boolean visible)
+ {
+ return mv.visitParameterAnnotation(parameter, desc, visible);
+ }
+
+ public void visitAttribute(final Attribute attr) {
+ mv.visitAttribute(attr);
+ }
+
+ public void visitCode() {
+ mv.visitCode();
+ }
+
+ public void visitInsn(final int opcode) {
+ mv.visitInsn(opcode);
+ }
+
+ public void visitIntInsn(final int opcode, final int operand) {
+ mv.visitIntInsn(opcode, operand);
+ }
+
+ public void visitVarInsn(final int opcode, final int var) {
+ mv.visitVarInsn(opcode, var);
+ }
+
+ public void visitTypeInsn(final int opcode, final String desc) {
+ mv.visitTypeInsn(opcode, desc);
+ }
+
+ public void visitFieldInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ mv.visitFieldInsn(opcode, owner, name, desc);
+ }
+
+ public void visitMethodInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ mv.visitMethodInsn(opcode, owner, name, desc);
+ }
+
+ public void visitJumpInsn(final int opcode, final Label label) {
+ mv.visitJumpInsn(opcode, label);
+ }
+
+ public void visitLabel(final Label label) {
+ mv.visitLabel(label);
+ }
+
+ public void visitLdcInsn(final Object cst) {
+ mv.visitLdcInsn(cst);
+ }
+
+ public void visitIincInsn(final int var, final int increment) {
+ mv.visitIincInsn(var, increment);
+ }
+
+ public void visitTableSwitchInsn(
+ final int min,
+ final int max,
+ final Label dflt,
+ final Label labels[])
+ {
+ mv.visitTableSwitchInsn(min, max, dflt, labels);
+ }
+
+ public void visitLookupSwitchInsn(
+ final Label dflt,
+ final int keys[],
+ final Label labels[])
+ {
+ mv.visitLookupSwitchInsn(dflt, keys, labels);
+ }
+
+ public void visitMultiANewArrayInsn(final String desc, final int dims) {
+ mv.visitMultiANewArrayInsn(desc, dims);
+ }
+
+ public void visitTryCatchBlock(
+ final Label start,
+ final Label end,
+ final Label handler,
+ final String type)
+ {
+ mv.visitTryCatchBlock(start, end, handler, type);
+ }
+
+ public void visitLocalVariable(
+ final String name,
+ final String desc,
+ final String signature,
+ final Label start,
+ final Label end,
+ final int index)
+ {
+ mv.visitLocalVariable(name, desc, signature, start, end, index);
+ }
+
+ public void visitLineNumber(final int line, final Label start) {
+ mv.visitLineNumber(line, start);
+ }
+
+ public void visitMaxs(final int maxStack, final int maxLocals) {
+ mv.visitMaxs(maxStack, maxLocals);
+ }
+
+ public void visitEnd() {
+ mv.visitEnd();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/MethodVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/MethodVisitor.java
new file mode 100644
index 00000000000..3fccbdf1456
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/MethodVisitor.java
@@ -0,0 +1,334 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * A visitor to visit a Java method. The methods of this interface must be
+ * called in the following order: [ <tt>visitAnnotationDefault</tt> ] (
+ * <tt>visitAnnotation</tt> | <tt>visitParameterAnnotation</tt> |
+ * <tt>visitAttribute</tt> )* [ <tt>visitCode</tt> ( <tt>visit</tt><i>X</i>Insn</tt> |
+ * <tt>visitLabel</tt> | <tt>visitTryCatchBlock</tt> | <tt>visitLocalVariable</tt> |
+ * <tt>visitLineNumber</tt>)* <tt>visitMaxs</tt> ] <tt>visitEnd</tt>. In
+ * addition, the <tt>visit</tt><i>X</i>Insn</tt> and <tt>visitLabel</tt>
+ * methods must be called in the sequential order of the bytecode instructions
+ * of the visited code, and the <tt>visitLocalVariable</tt> and <tt>visitLineNumber</tt>
+ * methods must be called <i>after</i> the labels passed as arguments have been
+ * visited.
+ *
+ * @author Eric Bruneton
+ */
+public interface MethodVisitor {
+
+ // -------------------------------------------------------------------------
+ // Annotations and non standard attributes
+ // -------------------------------------------------------------------------
+
+ /**
+ * Visits the default value of this annotation interface method.
+ *
+ * @return a non null visitor to the visit the actual default value of this
+ * annotation interface method. The 'name' parameters passed to the
+ * methods of this annotation visitor are ignored. Moreover, exacly
+ * one visit method must be called on this annotation visitor,
+ * followed by visitEnd.
+ */
+ AnnotationVisitor visitAnnotationDefault();
+
+ /**
+ * Visits an annotation of this method.
+ *
+ * @param desc the class descriptor of the annotation class.
+ * @param visible <tt>true</tt> if the annotation is visible at runtime.
+ * @return a non null visitor to visit the annotation values.
+ */
+ AnnotationVisitor visitAnnotation(String desc, boolean visible);
+
+ /**
+ * Visits an annotation of a parameter this method.
+ *
+ * @param parameter the parameter index.
+ * @param desc the class descriptor of the annotation class.
+ * @param visible <tt>true</tt> if the annotation is visible at runtime.
+ * @return a non null visitor to visit the annotation values.
+ */
+ AnnotationVisitor visitParameterAnnotation(
+ int parameter,
+ String desc,
+ boolean visible);
+
+ /**
+ * Visits a non standard attribute of this method.
+ *
+ * @param attr an attribute.
+ */
+ void visitAttribute(Attribute attr);
+
+ /**
+ * Starts the visit of the method's code, if any (i.e. non abstract method).
+ */
+ void visitCode();
+
+ // -------------------------------------------------------------------------
+ // Normal instructions
+ // -------------------------------------------------------------------------
+
+ /**
+ * Visits a zero operand instruction.
+ *
+ * @param opcode the opcode of the instruction to be visited. This opcode is
+ * either NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, ICONST_2,
+ * ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1, FCONST_0,
+ * FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD, LALOAD, FALOAD,
+ * DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IASTORE, LASTORE, FASTORE,
+ * DASTORE, AASTORE, BASTORE, CASTORE, SASTORE, POP, POP2, DUP,
+ * DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP, IADD, LADD, FADD,
+ * DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV, LDIV,
+ * FDIV, DDIV, IREM, LREM, FREM, DREM, INEG, LNEG, FNEG, DNEG, ISHL,
+ * LSHL, ISHR, LSHR, IUSHR, LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR,
+ * I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F, I2B,
+ * I2C, I2S, LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN,
+ * FRETURN, DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW,
+ * MONITORENTER, or MONITOREXIT.
+ */
+ void visitInsn(int opcode);
+
+ /**
+ * Visits an instruction with a single int operand.
+ *
+ * @param opcode the opcode of the instruction to be visited. This opcode is
+ * either BIPUSH, SIPUSH or NEWARRAY.
+ * @param operand the operand of the instruction to be visited.<br>
+ * When opcode is BIPUSH, operand value should be between
+ * Byte.MIN_VALUE and Byte.MAX_VALUE.<br>
+ * When opcode is SIPUSH, operand value should be between
+ * Short.MIN_VALUE and Short.MAX_VALUE.<br>
+ * When opcode is NEWARRAY, operand value should be one of
+ * {@link Opcodes#T_BOOLEAN}, {@link Opcodes#T_CHAR},
+ * {@link Opcodes#T_FLOAT}, {@link Opcodes#T_DOUBLE},
+ * {@link Opcodes#T_BYTE}, {@link Opcodes#T_SHORT},
+ * {@link Opcodes#T_INT} or {@link Opcodes#T_LONG}.
+ */
+ void visitIntInsn(int opcode, int operand);
+
+ /**
+ * Visits a local variable instruction. A local variable instruction is an
+ * instruction that loads or stores the value of a local variable.
+ *
+ * @param opcode the opcode of the local variable instruction to be visited.
+ * This opcode is either ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE,
+ * LSTORE, FSTORE, DSTORE, ASTORE or RET.
+ * @param var the operand of the instruction to be visited. This operand is
+ * the index of a local variable.
+ */
+ void visitVarInsn(int opcode, int var);
+
+ /**
+ * Visits a type instruction. A type instruction is an instruction that
+ * takes a type descriptor as parameter.
+ *
+ * @param opcode the opcode of the type instruction to be visited. This
+ * opcode is either NEW, ANEWARRAY, CHECKCAST or INSTANCEOF.
+ * @param desc the operand of the instruction to be visited. This operand is
+ * must be a fully qualified class name in internal form, or the type
+ * descriptor of an array type (see {@link Type Type}).
+ */
+ void visitTypeInsn(int opcode, String desc);
+
+ /**
+ * Visits a field instruction. A field instruction is an instruction that
+ * loads or stores the value of a field of an object.
+ *
+ * @param opcode the opcode of the type instruction to be visited. This
+ * opcode is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
+ * @param owner the internal name of the field's owner class (see {@link
+ * Type#getInternalName() getInternalName}).
+ * @param name the field's name.
+ * @param desc the field's descriptor (see {@link Type Type}).
+ */
+ void visitFieldInsn(int opcode, String owner, String name, String desc);
+
+ /**
+ * Visits a method instruction. A method instruction is an instruction that
+ * invokes a method.
+ *
+ * @param opcode the opcode of the type instruction to be visited. This
+ * opcode is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or
+ * INVOKEINTERFACE.
+ * @param owner the internal name of the method's owner class (see {@link
+ * Type#getInternalName() getInternalName}).
+ * @param name the method's name.
+ * @param desc the method's descriptor (see {@link Type Type}).
+ */
+ void visitMethodInsn(int opcode, String owner, String name, String desc);
+
+ /**
+ * Visits a jump instruction. A jump instruction is an instruction that may
+ * jump to another instruction.
+ *
+ * @param opcode the opcode of the type instruction to be visited. This
+ * opcode is either IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ,
+ * IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ,
+ * IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL.
+ * @param label the operand of the instruction to be visited. This operand
+ * is a label that designates the instruction to which the jump
+ * instruction may jump.
+ */
+ void visitJumpInsn(int opcode, Label label);
+
+ /**
+ * Visits a label. A label designates the instruction that will be visited
+ * just after it.
+ *
+ * @param label a {@link Label Label} object.
+ */
+ void visitLabel(Label label);
+
+ // -------------------------------------------------------------------------
+ // Special instructions
+ // -------------------------------------------------------------------------
+
+ /**
+ * Visits a LDC instruction.
+ *
+ * @param cst the constant to be loaded on the stack. This parameter must be
+ * a non null {@link Integer}, a {@link Float}, a {@link Long}, a
+ * {@link Double} a {@link String} (or a {@link Type} for
+ * <tt>.class</tt> constants, for classes whose version is 49.0 or
+ * more).
+ */
+ void visitLdcInsn(Object cst);
+
+ /**
+ * Visits an IINC instruction.
+ *
+ * @param var index of the local variable to be incremented.
+ * @param increment amount to increment the local variable by.
+ */
+ void visitIincInsn(int var, int increment);
+
+ /**
+ * Visits a TABLESWITCH instruction.
+ *
+ * @param min the minimum key value.
+ * @param max the maximum key value.
+ * @param dflt beginning of the default handler block.
+ * @param labels beginnings of the handler blocks. <tt>labels[i]</tt> is
+ * the beginning of the handler block for the <tt>min + i</tt> key.
+ */
+ void visitTableSwitchInsn(int min, int max, Label dflt, Label labels[]);
+
+ /**
+ * Visits a LOOKUPSWITCH instruction.
+ *
+ * @param dflt beginning of the default handler block.
+ * @param keys the values of the keys.
+ * @param labels beginnings of the handler blocks. <tt>labels[i]</tt> is
+ * the beginning of the handler block for the <tt>keys[i]</tt> key.
+ */
+ void visitLookupSwitchInsn(Label dflt, int keys[], Label labels[]);
+
+ /**
+ * Visits a MULTIANEWARRAY instruction.
+ *
+ * @param desc an array type descriptor (see {@link Type Type}).
+ * @param dims number of dimensions of the array to allocate.
+ */
+ void visitMultiANewArrayInsn(String desc, int dims);
+
+ // -------------------------------------------------------------------------
+ // Exceptions table entries, debug information,
+ // max stack size and max locals
+ // -------------------------------------------------------------------------
+
+ /**
+ * Visits a try catch block.
+ *
+ * @param start beginning of the exception handler's scope (inclusive).
+ * @param end end of the exception handler's scope (exclusive).
+ * @param handler beginning of the exception handler's code.
+ * @param type internal name of the type of exceptions handled by the
+ * handler, or <tt>null</tt> to catch any exceptions (for "finally"
+ * blocks).
+ */
+ void visitTryCatchBlock(Label start, Label end, Label handler, String type);
+
+ /**
+ * Visits a local variable declaration.
+ *
+ * @param name the name of a local variable.
+ * @param desc the type descriptor of this local variable.
+ * @param signature the type signature of this local variable. May be
+ * <tt>null</tt> if the local variable type does not use generic
+ * types.
+ * @param start the first instruction corresponding to the scope of this
+ * local variable (inclusive).
+ * @param end the last instruction corresponding to the scope of this local
+ * variable (exclusive).
+ * @param index the local variable's index.
+ * @throws IllegalArgumentException if one of the labels has not already
+ * been visited by this visitor (by the
+ * {@link #visitLabel visitLabel} method).
+ */
+ void visitLocalVariable(
+ String name,
+ String desc,
+ String signature,
+ Label start,
+ Label end,
+ int index);
+
+ /**
+ * Visits a line number declaration.
+ *
+ * @param line a line number. This number refers to the source file from
+ * which the class was compiled.
+ * @param start the first instruction corresponding to this line number.
+ * @throws IllegalArgumentException if <tt>start</tt> has not already been
+ * visited by this visitor (by the {@link #visitLabel visitLabel}
+ * method).
+ */
+ void visitLineNumber(int line, Label start);
+
+ /**
+ * Visits the maximum stack size and the maximum number of local variables
+ * of the method.
+ *
+ * @param maxStack maximum stack size of the method.
+ * @param maxLocals maximum number of local variables for the method.
+ */
+ void visitMaxs(int maxStack, int maxLocals);
+
+ /**
+ * Visits the end of the method. This method, which is the last one to be
+ * called, is used to inform the visitor that all the annotations and
+ * attributes of the method have been visited.
+ */
+ void visitEnd();
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/MethodWriter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/MethodWriter.java
new file mode 100644
index 00000000000..e131c69abb9
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/MethodWriter.java
@@ -0,0 +1,2022 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * A {@link MethodVisitor} that generates methods in bytecode form. Each visit
+ * method of this class appends the bytecode corresponding to the visited
+ * instruction to a byte vector, in the order these methods are called.
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+class MethodWriter implements MethodVisitor {
+
+ /**
+ * Next method writer (see {@link ClassWriter#firstMethod firstMethod}).
+ */
+ MethodWriter next;
+
+ /**
+ * The class writer to which this method must be added.
+ */
+ ClassWriter cw;
+
+ /**
+ * Access flags of this method.
+ */
+ private int access;
+
+ /**
+ * The index of the constant pool item that contains the name of this
+ * method.
+ */
+ private int name;
+
+ /**
+ * The index of the constant pool item that contains the descriptor of this
+ * method.
+ */
+ private int desc;
+
+ /**
+ * The descriptor of this method.
+ */
+ private String descriptor;
+
+ /**
+ * If not zero, indicates that the code of this method must be copied from
+ * the ClassReader associated to this writer in <code>cw.cr</code>. More
+ * precisely, this field gives the index of the first byte to copied from
+ * <code>cw.cr.b</code>.
+ */
+ int classReaderOffset;
+
+ /**
+ * If not zero, indicates that the code of this method must be copied from
+ * the ClassReader associated to this writer in <code>cw.cr</code>. More
+ * precisely, this field gives the number of bytes to copied from
+ * <code>cw.cr.b</code>.
+ */
+ int classReaderLength;
+
+ /**
+ * The signature of this method.
+ */
+ String signature;
+
+ /**
+ * Number of exceptions that can be thrown by this method.
+ */
+ int exceptionCount;
+
+ /**
+ * The exceptions that can be thrown by this method. More precisely, this
+ * array contains the indexes of the constant pool items that contain the
+ * internal names of these exception classes.
+ */
+ int[] exceptions;
+
+ /**
+ * The annotation default attribute of this method. May be <tt>null</tt>.
+ */
+ private ByteVector annd;
+
+ /**
+ * The runtime visible annotations of this method. May be <tt>null</tt>.
+ */
+ private AnnotationWriter anns;
+
+ /**
+ * The runtime invisible annotations of this method. May be <tt>null</tt>.
+ */
+ private AnnotationWriter ianns;
+
+ /**
+ * The runtime visible parameter annotations of this method. May be
+ * <tt>null</tt>.
+ */
+ private AnnotationWriter[] panns;
+
+ /**
+ * The runtime invisible parameter annotations of this method. May be
+ * <tt>null</tt>.
+ */
+ private AnnotationWriter[] ipanns;
+
+ /**
+ * The non standard attributes of the method.
+ */
+ private Attribute attrs;
+
+ /**
+ * The bytecode of this method.
+ */
+ private ByteVector code = new ByteVector();
+
+ /**
+ * Maximum stack size of this method.
+ */
+ private int maxStack;
+
+ /**
+ * Maximum number of local variables for this method.
+ */
+ private int maxLocals;
+
+ /**
+ * Number of entries in the catch table of this method.
+ */
+ private int catchCount;
+
+ /**
+ * The catch table of this method.
+ */
+ private Handler catchTable;
+
+ /**
+ * The last element in the catchTable handler list.
+ */
+ private Handler lastHandler;
+
+ /**
+ * Number of entries in the LocalVariableTable attribute.
+ */
+ private int localVarCount;
+
+ /**
+ * The LocalVariableTable attribute.
+ */
+ private ByteVector localVar;
+
+ /**
+ * Number of entries in the LocalVariableTypeTable attribute.
+ */
+ private int localVarTypeCount;
+
+ /**
+ * The LocalVariableTypeTable attribute.
+ */
+ private ByteVector localVarType;
+
+ /**
+ * Number of entries in the LineNumberTable attribute.
+ */
+ private int lineNumberCount;
+
+ /**
+ * The LineNumberTable attribute.
+ */
+ private ByteVector lineNumber;
+
+ /**
+ * The non standard attributes of the method's code.
+ */
+ private Attribute cattrs;
+
+ /**
+ * Indicates if some jump instructions are too small and need to be resized.
+ */
+ private boolean resize;
+
+ /*
+ * Fields for the control flow graph analysis algorithm (used to compute the
+ * maximum stack size). A control flow graph contains one node per "basic
+ * block", and one edge per "jump" from one basic block to another. Each
+ * node (i.e., each basic block) is represented by the Label object that
+ * corresponds to the first instruction of this basic block. Each node also
+ * stores the list of its successors in the graph, as a linked list of Edge
+ * objects.
+ */
+
+ /**
+ * <tt>true</tt> if the maximum stack size and number of local variables
+ * must be automatically computed.
+ */
+ private final boolean computeMaxs;
+
+ /**
+ * The (relative) stack size after the last visited instruction. This size
+ * is relative to the beginning of the current basic block, i.e., the true
+ * stack size after the last visited instruction is equal to the {@link
+ * Label#beginStackSize beginStackSize} of the current basic block plus
+ * <tt>stackSize</tt>.
+ */
+ private int stackSize;
+
+ /**
+ * The (relative) maximum stack size after the last visited instruction.
+ * This size is relative to the beginning of the current basic block, i.e.,
+ * the true maximum stack size after the last visited instruction is equal
+ * to the {@link Label#beginStackSize beginStackSize} of the current basic
+ * block plus <tt>stackSize</tt>.
+ */
+ private int maxStackSize;
+
+ /**
+ * The current basic block. This block is the basic block to which the next
+ * instruction to be visited must be added.
+ */
+ private Label currentBlock;
+
+ /**
+ * The basic block stack used by the control flow analysis algorithm. This
+ * stack is represented by a linked list of {@link Label Label} objects,
+ * linked to each other by their {@link Label#next} field. This stack must
+ * not be confused with the JVM stack used to execute the JVM instructions!
+ */
+ private Label blockStack;
+
+ /**
+ * The stack size variation corresponding to each JVM instruction. This
+ * stack variation is equal to the size of the values produced by an
+ * instruction, minus the size of the values consumed by this instruction.
+ */
+ private final static int[] SIZE;
+
+ // ------------------------------------------------------------------------
+ // Static initializer
+ // ------------------------------------------------------------------------
+
+ /**
+ * Computes the stack size variation corresponding to each JVM instruction.
+ */
+ static {
+ int i;
+ int[] b = new int[202];
+ String s = "EFFFFFFFFGGFFFGGFFFEEFGFGFEEEEEEEEEEEEEEEEEEEEDEDEDDDDD"
+ + "CDCDEEEEEEEEEEEEEEEEEEEEBABABBBBDCFFFGGGEDCDCDCDCDCDCDCDCD"
+ + "CDCEEEEDDDDDDDCDCDCEFEFDDEEFFDEDEEEBDDBBDDDDDDCCCCCCCCEFED"
+ + "DDCDCDEEEEEEEEEEFEEEEEEDDEEDDEE";
+ for (i = 0; i < b.length; ++i) {
+ b[i] = s.charAt(i) - 'E';
+ }
+ SIZE = b;
+
+ // code to generate the above string
+ //
+ // int NA = 0; // not applicable (unused opcode or variable size opcode)
+ //
+ // b = new int[] {
+ // 0, //NOP, // visitInsn
+ // 1, //ACONST_NULL, // -
+ // 1, //ICONST_M1, // -
+ // 1, //ICONST_0, // -
+ // 1, //ICONST_1, // -
+ // 1, //ICONST_2, // -
+ // 1, //ICONST_3, // -
+ // 1, //ICONST_4, // -
+ // 1, //ICONST_5, // -
+ // 2, //LCONST_0, // -
+ // 2, //LCONST_1, // -
+ // 1, //FCONST_0, // -
+ // 1, //FCONST_1, // -
+ // 1, //FCONST_2, // -
+ // 2, //DCONST_0, // -
+ // 2, //DCONST_1, // -
+ // 1, //BIPUSH, // visitIntInsn
+ // 1, //SIPUSH, // -
+ // 1, //LDC, // visitLdcInsn
+ // NA, //LDC_W, // -
+ // NA, //LDC2_W, // -
+ // 1, //ILOAD, // visitVarInsn
+ // 2, //LLOAD, // -
+ // 1, //FLOAD, // -
+ // 2, //DLOAD, // -
+ // 1, //ALOAD, // -
+ // NA, //ILOAD_0, // -
+ // NA, //ILOAD_1, // -
+ // NA, //ILOAD_2, // -
+ // NA, //ILOAD_3, // -
+ // NA, //LLOAD_0, // -
+ // NA, //LLOAD_1, // -
+ // NA, //LLOAD_2, // -
+ // NA, //LLOAD_3, // -
+ // NA, //FLOAD_0, // -
+ // NA, //FLOAD_1, // -
+ // NA, //FLOAD_2, // -
+ // NA, //FLOAD_3, // -
+ // NA, //DLOAD_0, // -
+ // NA, //DLOAD_1, // -
+ // NA, //DLOAD_2, // -
+ // NA, //DLOAD_3, // -
+ // NA, //ALOAD_0, // -
+ // NA, //ALOAD_1, // -
+ // NA, //ALOAD_2, // -
+ // NA, //ALOAD_3, // -
+ // -1, //IALOAD, // visitInsn
+ // 0, //LALOAD, // -
+ // -1, //FALOAD, // -
+ // 0, //DALOAD, // -
+ // -1, //AALOAD, // -
+ // -1, //BALOAD, // -
+ // -1, //CALOAD, // -
+ // -1, //SALOAD, // -
+ // -1, //ISTORE, // visitVarInsn
+ // -2, //LSTORE, // -
+ // -1, //FSTORE, // -
+ // -2, //DSTORE, // -
+ // -1, //ASTORE, // -
+ // NA, //ISTORE_0, // -
+ // NA, //ISTORE_1, // -
+ // NA, //ISTORE_2, // -
+ // NA, //ISTORE_3, // -
+ // NA, //LSTORE_0, // -
+ // NA, //LSTORE_1, // -
+ // NA, //LSTORE_2, // -
+ // NA, //LSTORE_3, // -
+ // NA, //FSTORE_0, // -
+ // NA, //FSTORE_1, // -
+ // NA, //FSTORE_2, // -
+ // NA, //FSTORE_3, // -
+ // NA, //DSTORE_0, // -
+ // NA, //DSTORE_1, // -
+ // NA, //DSTORE_2, // -
+ // NA, //DSTORE_3, // -
+ // NA, //ASTORE_0, // -
+ // NA, //ASTORE_1, // -
+ // NA, //ASTORE_2, // -
+ // NA, //ASTORE_3, // -
+ // -3, //IASTORE, // visitInsn
+ // -4, //LASTORE, // -
+ // -3, //FASTORE, // -
+ // -4, //DASTORE, // -
+ // -3, //AASTORE, // -
+ // -3, //BASTORE, // -
+ // -3, //CASTORE, // -
+ // -3, //SASTORE, // -
+ // -1, //POP, // -
+ // -2, //POP2, // -
+ // 1, //DUP, // -
+ // 1, //DUP_X1, // -
+ // 1, //DUP_X2, // -
+ // 2, //DUP2, // -
+ // 2, //DUP2_X1, // -
+ // 2, //DUP2_X2, // -
+ // 0, //SWAP, // -
+ // -1, //IADD, // -
+ // -2, //LADD, // -
+ // -1, //FADD, // -
+ // -2, //DADD, // -
+ // -1, //ISUB, // -
+ // -2, //LSUB, // -
+ // -1, //FSUB, // -
+ // -2, //DSUB, // -
+ // -1, //IMUL, // -
+ // -2, //LMUL, // -
+ // -1, //FMUL, // -
+ // -2, //DMUL, // -
+ // -1, //IDIV, // -
+ // -2, //LDIV, // -
+ // -1, //FDIV, // -
+ // -2, //DDIV, // -
+ // -1, //IREM, // -
+ // -2, //LREM, // -
+ // -1, //FREM, // -
+ // -2, //DREM, // -
+ // 0, //INEG, // -
+ // 0, //LNEG, // -
+ // 0, //FNEG, // -
+ // 0, //DNEG, // -
+ // -1, //ISHL, // -
+ // -1, //LSHL, // -
+ // -1, //ISHR, // -
+ // -1, //LSHR, // -
+ // -1, //IUSHR, // -
+ // -1, //LUSHR, // -
+ // -1, //IAND, // -
+ // -2, //LAND, // -
+ // -1, //IOR, // -
+ // -2, //LOR, // -
+ // -1, //IXOR, // -
+ // -2, //LXOR, // -
+ // 0, //IINC, // visitIincInsn
+ // 1, //I2L, // visitInsn
+ // 0, //I2F, // -
+ // 1, //I2D, // -
+ // -1, //L2I, // -
+ // -1, //L2F, // -
+ // 0, //L2D, // -
+ // 0, //F2I, // -
+ // 1, //F2L, // -
+ // 1, //F2D, // -
+ // -1, //D2I, // -
+ // 0, //D2L, // -
+ // -1, //D2F, // -
+ // 0, //I2B, // -
+ // 0, //I2C, // -
+ // 0, //I2S, // -
+ // -3, //LCMP, // -
+ // -1, //FCMPL, // -
+ // -1, //FCMPG, // -
+ // -3, //DCMPL, // -
+ // -3, //DCMPG, // -
+ // -1, //IFEQ, // visitJumpInsn
+ // -1, //IFNE, // -
+ // -1, //IFLT, // -
+ // -1, //IFGE, // -
+ // -1, //IFGT, // -
+ // -1, //IFLE, // -
+ // -2, //IF_ICMPEQ, // -
+ // -2, //IF_ICMPNE, // -
+ // -2, //IF_ICMPLT, // -
+ // -2, //IF_ICMPGE, // -
+ // -2, //IF_ICMPGT, // -
+ // -2, //IF_ICMPLE, // -
+ // -2, //IF_ACMPEQ, // -
+ // -2, //IF_ACMPNE, // -
+ // 0, //GOTO, // -
+ // 1, //JSR, // -
+ // 0, //RET, // visitVarInsn
+ // -1, //TABLESWITCH, // visiTableSwitchInsn
+ // -1, //LOOKUPSWITCH, // visitLookupSwitch
+ // -1, //IRETURN, // visitInsn
+ // -2, //LRETURN, // -
+ // -1, //FRETURN, // -
+ // -2, //DRETURN, // -
+ // -1, //ARETURN, // -
+ // 0, //RETURN, // -
+ // NA, //GETSTATIC, // visitFieldInsn
+ // NA, //PUTSTATIC, // -
+ // NA, //GETFIELD, // -
+ // NA, //PUTFIELD, // -
+ // NA, //INVOKEVIRTUAL, // visitMethodInsn
+ // NA, //INVOKESPECIAL, // -
+ // NA, //INVOKESTATIC, // -
+ // NA, //INVOKEINTERFACE, // -
+ // NA, //UNUSED, // NOT VISITED
+ // 1, //NEW, // visitTypeInsn
+ // 0, //NEWARRAY, // visitIntInsn
+ // 0, //ANEWARRAY, // visitTypeInsn
+ // 0, //ARRAYLENGTH, // visitInsn
+ // NA, //ATHROW, // -
+ // 0, //CHECKCAST, // visitTypeInsn
+ // 0, //INSTANCEOF, // -
+ // -1, //MONITORENTER, // visitInsn
+ // -1, //MONITOREXIT, // -
+ // NA, //WIDE, // NOT VISITED
+ // NA, //MULTIANEWARRAY, // visitMultiANewArrayInsn
+ // -1, //IFNULL, // visitJumpInsn
+ // -1, //IFNONNULL, // -
+ // NA, //GOTO_W, // -
+ // NA, //JSR_W, // -
+ // };
+ // for (i = 0; i < b.length; ++i) {
+ // System.err.print((char)('E' + b[i]));
+ // }
+ // System.err.println();
+ }
+
+ // ------------------------------------------------------------------------
+ // Constructor
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructs a new {@link MethodWriter}.
+ *
+ * @param cw the class writer in which the method must be added.
+ * @param access the method's access flags (see {@link Opcodes}).
+ * @param name the method's name.
+ * @param desc the method's descriptor (see {@link Type}).
+ * @param signature the method's signature. May be <tt>null</tt>.
+ * @param exceptions the internal names of the method's exceptions. May be
+ * <tt>null</tt>.
+ * @param computeMaxs <tt>true</tt> if the maximum stack size and number
+ * of local variables must be automatically computed.
+ */
+ MethodWriter(
+ final ClassWriter cw,
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final String[] exceptions,
+ final boolean computeMaxs)
+ {
+ if (cw.firstMethod == null) {
+ cw.firstMethod = this;
+ } else {
+ cw.lastMethod.next = this;
+ }
+ cw.lastMethod = this;
+ this.cw = cw;
+ this.access = access;
+ this.name = cw.newUTF8(name);
+ this.desc = cw.newUTF8(desc);
+ this.descriptor = desc;
+ this.signature = signature;
+ if (exceptions != null && exceptions.length > 0) {
+ exceptionCount = exceptions.length;
+ this.exceptions = new int[exceptionCount];
+ for (int i = 0; i < exceptionCount; ++i) {
+ this.exceptions[i] = cw.newClass(exceptions[i]);
+ }
+ }
+ this.computeMaxs = computeMaxs;
+ if (computeMaxs) {
+ // updates maxLocals
+ int size = getArgumentsAndReturnSizes(desc) >> 2;
+ if ((access & Opcodes.ACC_STATIC) != 0) {
+ --size;
+ }
+ maxLocals = size;
+ // pushes the first block onto the stack of blocks to be visited
+ currentBlock = new Label();
+ currentBlock.pushed = true;
+ blockStack = currentBlock;
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Implementation of the MethodVisitor interface
+ // ------------------------------------------------------------------------
+
+ public AnnotationVisitor visitAnnotationDefault() {
+ annd = new ByteVector();
+ return new AnnotationWriter(cw, false, annd, null, 0);
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ ByteVector bv = new ByteVector();
+ // write type, and reserve space for values count
+ bv.putShort(cw.newUTF8(desc)).putShort(0);
+ AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv, 2);
+ if (visible) {
+ aw.next = anns;
+ anns = aw;
+ } else {
+ aw.next = ianns;
+ ianns = aw;
+ }
+ return aw;
+ }
+
+ public AnnotationVisitor visitParameterAnnotation(
+ final int parameter,
+ final String desc,
+ final boolean visible)
+ {
+ ByteVector bv = new ByteVector();
+ // write type, and reserve space for values count
+ bv.putShort(cw.newUTF8(desc)).putShort(0);
+ AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv, 2);
+ if (visible) {
+ if (panns == null) {
+ panns = new AnnotationWriter[Type.getArgumentTypes(descriptor).length];
+ }
+ aw.next = panns[parameter];
+ panns[parameter] = aw;
+ } else {
+ if (ipanns == null) {
+ ipanns = new AnnotationWriter[Type.getArgumentTypes(descriptor).length];
+ }
+ aw.next = ipanns[parameter];
+ ipanns[parameter] = aw;
+ }
+ return aw;
+ }
+
+ public void visitAttribute(final Attribute attr) {
+ if (attr.isCodeAttribute()) {
+ attr.next = cattrs;
+ cattrs = attr;
+ } else {
+ attr.next = attrs;
+ attrs = attr;
+ }
+ }
+
+ public void visitCode() {
+ }
+
+ public void visitInsn(final int opcode) {
+ if (computeMaxs) {
+ // updates current and max stack sizes
+ int size = stackSize + SIZE[opcode];
+ if (size > maxStackSize) {
+ maxStackSize = size;
+ }
+ stackSize = size;
+ // if opcode == ATHROW or xRETURN, ends current block (no successor)
+ if ((opcode >= Opcodes.IRETURN && opcode <= Opcodes.RETURN)
+ || opcode == Opcodes.ATHROW)
+ {
+ if (currentBlock != null) {
+ currentBlock.maxStackSize = maxStackSize;
+ currentBlock = null;
+ }
+ }
+ }
+ // adds the instruction to the bytecode of the method
+ code.putByte(opcode);
+ }
+
+ public void visitIntInsn(final int opcode, final int operand) {
+ if (computeMaxs && opcode != Opcodes.NEWARRAY) {
+ // updates current and max stack sizes only if opcode == NEWARRAY
+ // (stack size variation = 0 for BIPUSH or SIPUSH)
+ int size = stackSize + 1;
+ if (size > maxStackSize) {
+ maxStackSize = size;
+ }
+ stackSize = size;
+ }
+ // adds the instruction to the bytecode of the method
+ if (opcode == Opcodes.SIPUSH) {
+ code.put12(opcode, operand);
+ } else { // BIPUSH or NEWARRAY
+ code.put11(opcode, operand);
+ }
+ }
+
+ public void visitVarInsn(final int opcode, final int var) {
+ if (computeMaxs) {
+ // updates current and max stack sizes
+ if (opcode == Opcodes.RET) {
+ // no stack change, but end of current block (no successor)
+ if (currentBlock != null) {
+ currentBlock.maxStackSize = maxStackSize;
+ currentBlock = null;
+ }
+ } else { // xLOAD or xSTORE
+ int size = stackSize + SIZE[opcode];
+ if (size > maxStackSize) {
+ maxStackSize = size;
+ }
+ stackSize = size;
+ }
+ // updates max locals
+ int n;
+ if (opcode == Opcodes.LLOAD || opcode == Opcodes.DLOAD
+ || opcode == Opcodes.LSTORE || opcode == Opcodes.DSTORE)
+ {
+ n = var + 2;
+ } else {
+ n = var + 1;
+ }
+ if (n > maxLocals) {
+ maxLocals = n;
+ }
+ }
+ // adds the instruction to the bytecode of the method
+ if (var < 4 && opcode != Opcodes.RET) {
+ int opt;
+ if (opcode < Opcodes.ISTORE) {
+ /* ILOAD_0 */
+ opt = 26 + ((opcode - Opcodes.ILOAD) << 2) + var;
+ } else {
+ /* ISTORE_0 */
+ opt = 59 + ((opcode - Opcodes.ISTORE) << 2) + var;
+ }
+ code.putByte(opt);
+ } else if (var >= 256) {
+ code.putByte(196 /* WIDE */).put12(opcode, var);
+ } else {
+ code.put11(opcode, var);
+ }
+ }
+
+ public void visitTypeInsn(final int opcode, final String desc) {
+ if (computeMaxs && opcode == Opcodes.NEW) {
+ // updates current and max stack sizes only if opcode == NEW
+ // (stack size variation = 0 for ANEWARRAY, CHECKCAST, INSTANCEOF)
+ int size = stackSize + 1;
+ if (size > maxStackSize) {
+ maxStackSize = size;
+ }
+ stackSize = size;
+ }
+ // adds the instruction to the bytecode of the method
+ code.put12(opcode, cw.newClass(desc));
+ }
+
+ public void visitFieldInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ if (computeMaxs) {
+ int size;
+ // computes the stack size variation
+ char c = desc.charAt(0);
+ switch (opcode) {
+ case Opcodes.GETSTATIC:
+ size = stackSize + (c == 'D' || c == 'J' ? 2 : 1);
+ break;
+ case Opcodes.PUTSTATIC:
+ size = stackSize + (c == 'D' || c == 'J' ? -2 : -1);
+ break;
+ case Opcodes.GETFIELD:
+ size = stackSize + (c == 'D' || c == 'J' ? 1 : 0);
+ break;
+ // case Constants.PUTFIELD:
+ default:
+ size = stackSize + (c == 'D' || c == 'J' ? -3 : -2);
+ break;
+ }
+ // updates current and max stack sizes
+ if (size > maxStackSize) {
+ maxStackSize = size;
+ }
+ stackSize = size;
+ }
+ // adds the instruction to the bytecode of the method
+ code.put12(opcode, cw.newField(owner, name, desc));
+ }
+
+ public void visitMethodInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ boolean itf = opcode == Opcodes.INVOKEINTERFACE;
+ Item i = cw.newMethodItem(owner, name, desc, itf);
+ int argSize = i.intVal;
+ if (computeMaxs) {
+ /*
+ * computes the stack size variation. In order not to recompute
+ * several times this variation for the same Item, we use the intVal
+ * field of this item to store this variation, once it has been
+ * computed. More precisely this intVal field stores the sizes of
+ * the arguments and of the return value corresponding to desc.
+ */
+ if (argSize == 0) {
+ // the above sizes have not been computed yet, so we compute
+ // them...
+ argSize = getArgumentsAndReturnSizes(desc);
+ // ... and we save them in order not to recompute them in the
+ // future
+ i.intVal = argSize;
+ }
+ int size;
+ if (opcode == Opcodes.INVOKESTATIC) {
+ size = stackSize - (argSize >> 2) + (argSize & 0x03) + 1;
+ } else {
+ size = stackSize - (argSize >> 2) + (argSize & 0x03);
+ }
+ // updates current and max stack sizes
+ if (size > maxStackSize) {
+ maxStackSize = size;
+ }
+ stackSize = size;
+ }
+ // adds the instruction to the bytecode of the method
+ if (itf) {
+ if (!computeMaxs) {
+ if (argSize == 0) {
+ argSize = getArgumentsAndReturnSizes(desc);
+ i.intVal = argSize;
+ }
+ }
+ code.put12(Opcodes.INVOKEINTERFACE, i.index).put11(argSize >> 2, 0);
+ } else {
+ code.put12(opcode, i.index);
+ }
+ }
+
+ public void visitJumpInsn(final int opcode, final Label label) {
+ if (computeMaxs) {
+ if (opcode == Opcodes.GOTO) {
+ // no stack change, but end of current block (with one new
+ // successor)
+ if (currentBlock != null) {
+ currentBlock.maxStackSize = maxStackSize;
+ addSuccessor(stackSize, label);
+ currentBlock = null;
+ }
+ } else if (opcode == Opcodes.JSR) {
+ if (currentBlock != null) {
+ addSuccessor(stackSize + 1, label);
+ }
+ } else {
+ // updates current stack size (max stack size unchanged because
+ // stack size variation always negative in this case)
+ stackSize += SIZE[opcode];
+ if (currentBlock != null) {
+ addSuccessor(stackSize, label);
+ }
+ }
+ }
+ // adds the instruction to the bytecode of the method
+ if (label.resolved && label.position - code.length < Short.MIN_VALUE) {
+ /*
+ * case of a backward jump with an offset < -32768. In this case we
+ * automatically replace GOTO with GOTO_W, JSR with JSR_W and IFxxx
+ * <l> with IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx is the
+ * "opposite" opcode of IFxxx (i.e., IFNE for IFEQ) and where <l'>
+ * designates the instruction just after the GOTO_W.
+ */
+ if (opcode == Opcodes.GOTO) {
+ code.putByte(200); // GOTO_W
+ } else if (opcode == Opcodes.JSR) {
+ code.putByte(201); // JSR_W
+ } else {
+ code.putByte(opcode <= 166
+ ? ((opcode + 1) ^ 1) - 1
+ : opcode ^ 1);
+ code.putShort(8); // jump offset
+ code.putByte(200); // GOTO_W
+ }
+ label.put(this, code, code.length - 1, true);
+ } else {
+ /*
+ * case of a backward jump with an offset >= -32768, or of a forward
+ * jump with, of course, an unknown offset. In these cases we store
+ * the offset in 2 bytes (which will be increased in
+ * resizeInstructions, if needed).
+ */
+ code.putByte(opcode);
+ label.put(this, code, code.length - 1, false);
+ }
+ }
+
+ public void visitLabel(final Label label) {
+ if (computeMaxs) {
+ if (currentBlock != null) {
+ // ends current block (with one new successor)
+ currentBlock.maxStackSize = maxStackSize;
+ addSuccessor(stackSize, label);
+ }
+ // begins a new current block,
+ // resets the relative current and max stack sizes
+ currentBlock = label;
+ stackSize = 0;
+ maxStackSize = 0;
+ }
+ // resolves previous forward references to label, if any
+ resize |= label.resolve(this, code.length, code.data);
+ }
+
+ public void visitLdcInsn(final Object cst) {
+ Item i = cw.newConstItem(cst);
+ if (computeMaxs) {
+ int size;
+ // computes the stack size variation
+ if (i.type == ClassWriter.LONG || i.type == ClassWriter.DOUBLE) {
+ size = stackSize + 2;
+ } else {
+ size = stackSize + 1;
+ }
+ // updates current and max stack sizes
+ if (size > maxStackSize) {
+ maxStackSize = size;
+ }
+ stackSize = size;
+ }
+ // adds the instruction to the bytecode of the method
+ int index = i.index;
+ if (i.type == ClassWriter.LONG || i.type == ClassWriter.DOUBLE) {
+ code.put12(20 /* LDC2_W */, index);
+ } else if (index >= 256) {
+ code.put12(19 /* LDC_W */, index);
+ } else {
+ code.put11(Opcodes.LDC, index);
+ }
+ }
+
+ public void visitIincInsn(final int var, final int increment) {
+ if (computeMaxs) {
+ // updates max locals only (no stack change)
+ int n = var + 1;
+ if (n > maxLocals) {
+ maxLocals = n;
+ }
+ }
+ // adds the instruction to the bytecode of the method
+ if ((var > 255) || (increment > 127) || (increment < -128)) {
+ code.putByte(196 /* WIDE */)
+ .put12(Opcodes.IINC, var)
+ .putShort(increment);
+ } else {
+ code.putByte(Opcodes.IINC).put11(var, increment);
+ }
+ }
+
+ public void visitTableSwitchInsn(
+ final int min,
+ final int max,
+ final Label dflt,
+ final Label labels[])
+ {
+ if (computeMaxs) {
+ // updates current stack size (max stack size unchanged)
+ --stackSize;
+ // ends current block (with many new successors)
+ if (currentBlock != null) {
+ currentBlock.maxStackSize = maxStackSize;
+ addSuccessor(stackSize, dflt);
+ for (int i = 0; i < labels.length; ++i) {
+ addSuccessor(stackSize, labels[i]);
+ }
+ currentBlock = null;
+ }
+ }
+ // adds the instruction to the bytecode of the method
+ int source = code.length;
+ code.putByte(Opcodes.TABLESWITCH);
+ while (code.length % 4 != 0) {
+ code.putByte(0);
+ }
+ dflt.put(this, code, source, true);
+ code.putInt(min).putInt(max);
+ for (int i = 0; i < labels.length; ++i) {
+ labels[i].put(this, code, source, true);
+ }
+ }
+
+ public void visitLookupSwitchInsn(
+ final Label dflt,
+ final int keys[],
+ final Label labels[])
+ {
+ if (computeMaxs) {
+ // updates current stack size (max stack size unchanged)
+ --stackSize;
+ // ends current block (with many new successors)
+ if (currentBlock != null) {
+ currentBlock.maxStackSize = maxStackSize;
+ addSuccessor(stackSize, dflt);
+ for (int i = 0; i < labels.length; ++i) {
+ addSuccessor(stackSize, labels[i]);
+ }
+ currentBlock = null;
+ }
+ }
+ // adds the instruction to the bytecode of the method
+ int source = code.length;
+ code.putByte(Opcodes.LOOKUPSWITCH);
+ while (code.length % 4 != 0) {
+ code.putByte(0);
+ }
+ dflt.put(this, code, source, true);
+ code.putInt(labels.length);
+ for (int i = 0; i < labels.length; ++i) {
+ code.putInt(keys[i]);
+ labels[i].put(this, code, source, true);
+ }
+ }
+
+ public void visitMultiANewArrayInsn(final String desc, final int dims) {
+ if (computeMaxs) {
+ // updates current stack size (max stack size unchanged because
+ // stack size variation always negative or null)
+ stackSize += 1 - dims;
+ }
+ // adds the instruction to the bytecode of the method
+ code.put12(Opcodes.MULTIANEWARRAY, cw.newClass(desc)).putByte(dims);
+ }
+
+ public void visitTryCatchBlock(
+ final Label start,
+ final Label end,
+ final Label handler,
+ final String type)
+ {
+ if (computeMaxs) {
+ // pushes handler block onto the stack of blocks to be visited
+ if (!handler.pushed) {
+ handler.beginStackSize = 1;
+ handler.pushed = true;
+ handler.next = blockStack;
+ blockStack = handler;
+ }
+ }
+ ++catchCount;
+ Handler h = new Handler();
+ h.start = start;
+ h.end = end;
+ h.handler = handler;
+ h.desc = type;
+ h.type = type != null ? cw.newClass(type) : 0;
+ if (lastHandler == null) {
+ catchTable = h;
+ } else {
+ lastHandler.next = h;
+ }
+ lastHandler = h;
+ }
+
+ public void visitLocalVariable(
+ final String name,
+ final String desc,
+ final String signature,
+ final Label start,
+ final Label end,
+ final int index)
+ {
+ if (signature != null) {
+ if (localVarType == null) {
+ localVarType = new ByteVector();
+ }
+ ++localVarTypeCount;
+ localVarType.putShort(start.position)
+ .putShort(end.position - start.position)
+ .putShort(cw.newUTF8(name))
+ .putShort(cw.newUTF8(signature))
+ .putShort(index);
+ }
+ if (localVar == null) {
+ localVar = new ByteVector();
+ }
+ ++localVarCount;
+ localVar.putShort(start.position)
+ .putShort(end.position - start.position)
+ .putShort(cw.newUTF8(name))
+ .putShort(cw.newUTF8(desc))
+ .putShort(index);
+
+ if(computeMaxs) {
+ // updates max locals
+ char c = desc.charAt(0);
+ int n = index + ( c=='L' || c=='D' ? 2 : 1);
+ if (n > maxLocals) {
+ maxLocals = n;
+ }
+ }
+ }
+
+ public void visitLineNumber(final int line, final Label start) {
+ if (lineNumber == null) {
+ lineNumber = new ByteVector();
+ }
+ ++lineNumberCount;
+ lineNumber.putShort(start.position);
+ lineNumber.putShort(line);
+ }
+
+ public void visitMaxs(final int maxStack, final int maxLocals) {
+ if (computeMaxs) {
+ // true (non relative) max stack size
+ int max = 0;
+ /*
+ * control flow analysis algorithm: while the block stack is not
+ * empty, pop a block from this stack, update the max stack size,
+ * compute the true (non relative) begin stack size of the
+ * successors of this block, and push these successors onto the
+ * stack (unless they have already been pushed onto the stack).
+ * Note: by hypothesis, the {@link Label#beginStackSize} of the
+ * blocks in the block stack are the true (non relative) beginning
+ * stack sizes of these blocks.
+ */
+ Label stack = blockStack;
+ while (stack != null) {
+ // pops a block from the stack
+ Label l = stack;
+ stack = stack.next;
+ // computes the true (non relative) max stack size of this block
+ int start = l.beginStackSize;
+ int blockMax = start + l.maxStackSize;
+ // updates the global max stack size
+ if (blockMax > max) {
+ max = blockMax;
+ }
+ // analyses the successors of the block
+ Edge b = l.successors;
+ while (b != null) {
+ l = b.successor;
+ // if this successor has not already been pushed onto the
+ // stack...
+ if (!l.pushed) {
+ // computes the true beginning stack size of this
+ // successor block
+ l.beginStackSize = start + b.stackSize;
+ // pushes this successor onto the stack
+ l.pushed = true;
+ l.next = stack;
+ stack = l;
+ }
+ b = b.next;
+ }
+ }
+ this.maxStack = max;
+ } else {
+ this.maxStack = maxStack;
+ this.maxLocals = maxLocals;
+ }
+ }
+
+ public void visitEnd() {
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods: control flow analysis algorithm
+ // ------------------------------------------------------------------------
+
+ /**
+ * Computes the size of the arguments and of the return value of a method.
+ *
+ * @param desc the descriptor of a method.
+ * @return the size of the arguments of the method (plus one for the
+ * implicit this argument), argSize, and the size of its return
+ * value, retSize, packed into a single int i =
+ * <tt>(argSize << 2) | retSize</tt> (argSize is therefore equal
+ * to <tt>i >> 2</tt>, and retSize to <tt>i & 0x03</tt>).
+ */
+ private static int getArgumentsAndReturnSizes(final String desc) {
+ int n = 1;
+ int c = 1;
+ while (true) {
+ char car = desc.charAt(c++);
+ if (car == ')') {
+ car = desc.charAt(c);
+ return n << 2
+ | (car == 'V' ? 0 : (car == 'D' || car == 'J' ? 2 : 1));
+ } else if (car == 'L') {
+ while (desc.charAt(c++) != ';') {
+ }
+ n += 1;
+ } else if (car == '[') {
+ while ((car = desc.charAt(c)) == '[') {
+ ++c;
+ }
+ if (car == 'D' || car == 'J') {
+ n -= 1;
+ }
+ } else if (car == 'D' || car == 'J') {
+ n += 2;
+ } else {
+ n += 1;
+ }
+ }
+ }
+
+ /**
+ * Adds a successor to the {@link #currentBlock currentBlock} block.
+ *
+ * @param stackSize the current (relative) stack size in the current block.
+ * @param successor the successor block to be added to the current block.
+ */
+ private void addSuccessor(final int stackSize, final Label successor) {
+ Edge b = new Edge();
+ // initializes the previous Edge object...
+ b.stackSize = stackSize;
+ b.successor = successor;
+ // ...and adds it to the successor list of the currentBlock block
+ b.next = currentBlock.successors;
+ currentBlock.successors = b;
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods: dump bytecode array
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the size of the bytecode of this method.
+ *
+ * @return the size of the bytecode of this method.
+ */
+ final int getSize() {
+ if (classReaderOffset != 0) {
+ return 6 + classReaderLength;
+ }
+ if (resize) {
+ // replaces the temporary jump opcodes introduced by Label.resolve.
+ resizeInstructions(new int[0], new int[0], 0);
+ }
+ int size = 8;
+ if (code.length > 0) {
+ cw.newUTF8("Code");
+ size += 18 + code.length + 8 * catchCount;
+ if (localVar != null) {
+ cw.newUTF8("LocalVariableTable");
+ size += 8 + localVar.length;
+ }
+ if (localVarType != null) {
+ cw.newUTF8("LocalVariableTypeTable");
+ size += 8 + localVarType.length;
+ }
+ if (lineNumber != null) {
+ cw.newUTF8("LineNumberTable");
+ size += 8 + lineNumber.length;
+ }
+ if (cattrs != null) {
+ size += cattrs.getSize(cw,
+ code.data,
+ code.length,
+ maxStack,
+ maxLocals);
+ }
+ }
+ if (exceptionCount > 0) {
+ cw.newUTF8("Exceptions");
+ size += 8 + 2 * exceptionCount;
+ }
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0
+ && (cw.version & 0xffff) < Opcodes.V1_5)
+ {
+ cw.newUTF8("Synthetic");
+ size += 6;
+ }
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ cw.newUTF8("Deprecated");
+ size += 6;
+ }
+ if (cw.version == Opcodes.V1_4) {
+ if ((access & Opcodes.ACC_VARARGS) != 0) {
+ cw.newUTF8("Varargs");
+ size += 6;
+ }
+ if ((access & Opcodes.ACC_BRIDGE) != 0) {
+ cw.newUTF8("Bridge");
+ size += 6;
+ }
+ }
+ if (signature != null) {
+ cw.newUTF8("Signature");
+ cw.newUTF8(signature);
+ size += 8;
+ }
+ if (annd != null) {
+ cw.newUTF8("AnnotationDefault");
+ size += 6 + annd.length;
+ }
+ if (anns != null) {
+ cw.newUTF8("RuntimeVisibleAnnotations");
+ size += 8 + anns.getSize();
+ }
+ if (ianns != null) {
+ cw.newUTF8("RuntimeInvisibleAnnotations");
+ size += 8 + ianns.getSize();
+ }
+ if (panns != null) {
+ cw.newUTF8("RuntimeVisibleParameterAnnotations");
+ size += 7 + 2 * panns.length;
+ for (int i = panns.length - 1; i >= 0; --i) {
+ size += panns[i] == null ? 0 : panns[i].getSize();
+ }
+ }
+ if (ipanns != null) {
+ cw.newUTF8("RuntimeInvisibleParameterAnnotations");
+ size += 7 + 2 * ipanns.length;
+ for (int i = ipanns.length - 1; i >= 0; --i) {
+ size += ipanns[i] == null ? 0 : ipanns[i].getSize();
+ }
+ }
+ if (attrs != null) {
+ size += attrs.getSize(cw, null, 0, -1, -1);
+ }
+ return size;
+ }
+
+ /**
+ * Puts the bytecode of this method in the given byte vector.
+ *
+ * @param out the byte vector into which the bytecode of this method must be
+ * copied.
+ */
+ final void put(final ByteVector out) {
+ out.putShort(access).putShort(name).putShort(desc);
+ if (classReaderOffset != 0) {
+ out.putByteArray(cw.cr.b, classReaderOffset, classReaderLength);
+ return;
+ }
+ int attributeCount = 0;
+ if (code.length > 0) {
+ ++attributeCount;
+ }
+ if (exceptionCount > 0) {
+ ++attributeCount;
+ }
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0
+ && (cw.version & 0xffff) < Opcodes.V1_5)
+ {
+ ++attributeCount;
+ }
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ ++attributeCount;
+ }
+ if (cw.version == Opcodes.V1_4) {
+ if ((access & Opcodes.ACC_VARARGS) != 0) {
+ ++attributeCount;
+ }
+ if ((access & Opcodes.ACC_BRIDGE) != 0) {
+ ++attributeCount;
+ }
+ }
+ if (signature != null) {
+ ++attributeCount;
+ }
+ if (annd != null) {
+ ++attributeCount;
+ }
+ if (anns != null) {
+ ++attributeCount;
+ }
+ if (ianns != null) {
+ ++attributeCount;
+ }
+ if (panns != null) {
+ ++attributeCount;
+ }
+ if (ipanns != null) {
+ ++attributeCount;
+ }
+ if (attrs != null) {
+ attributeCount += attrs.getCount();
+ }
+ out.putShort(attributeCount);
+ if (code.length > 0) {
+ int size = 12 + code.length + 8 * catchCount;
+ if (localVar != null) {
+ size += 8 + localVar.length;
+ }
+ if (localVarType != null) {
+ size += 8 + localVarType.length;
+ }
+ if (lineNumber != null) {
+ size += 8 + lineNumber.length;
+ }
+ if (cattrs != null) {
+ size += cattrs.getSize(cw,
+ code.data,
+ code.length,
+ maxStack,
+ maxLocals);
+ }
+ out.putShort(cw.newUTF8("Code")).putInt(size);
+ out.putShort(maxStack).putShort(maxLocals);
+ out.putInt(code.length).putByteArray(code.data, 0, code.length);
+ out.putShort(catchCount);
+ if (catchCount > 0) {
+ Handler h = catchTable;
+ while (h != null) {
+ out.putShort(h.start.position)
+ .putShort(h.end.position)
+ .putShort(h.handler.position)
+ .putShort(h.type);
+ h = h.next;
+ }
+ }
+ attributeCount = 0;
+ if (localVar != null) {
+ ++attributeCount;
+ }
+ if (localVarType != null) {
+ ++attributeCount;
+ }
+ if (lineNumber != null) {
+ ++attributeCount;
+ }
+ if (cattrs != null) {
+ attributeCount += cattrs.getCount();
+ }
+ out.putShort(attributeCount);
+ if (localVar != null) {
+ out.putShort(cw.newUTF8("LocalVariableTable"));
+ out.putInt(localVar.length + 2).putShort(localVarCount);
+ out.putByteArray(localVar.data, 0, localVar.length);
+ }
+ if (localVarType != null) {
+ out.putShort(cw.newUTF8("LocalVariableTypeTable"));
+ out.putInt(localVarType.length + 2).putShort(localVarTypeCount);
+ out.putByteArray(localVarType.data, 0, localVarType.length);
+ }
+ if (lineNumber != null) {
+ out.putShort(cw.newUTF8("LineNumberTable"));
+ out.putInt(lineNumber.length + 2).putShort(lineNumberCount);
+ out.putByteArray(lineNumber.data, 0, lineNumber.length);
+ }
+ if (cattrs != null) {
+ cattrs.put(cw, code.data, code.length, maxLocals, maxStack, out);
+ }
+ }
+ if (exceptionCount > 0) {
+ out.putShort(cw.newUTF8("Exceptions"))
+ .putInt(2 * exceptionCount + 2);
+ out.putShort(exceptionCount);
+ for (int i = 0; i < exceptionCount; ++i) {
+ out.putShort(exceptions[i]);
+ }
+ }
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0
+ && (cw.version & 0xffff) < Opcodes.V1_5)
+ {
+ out.putShort(cw.newUTF8("Synthetic")).putInt(0);
+ }
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ out.putShort(cw.newUTF8("Deprecated")).putInt(0);
+ }
+ if (cw.version == Opcodes.V1_4) {
+ if ((access & Opcodes.ACC_VARARGS) != 0) {
+ out.putShort(cw.newUTF8("Varargs")).putInt(0);
+ }
+ if ((access & Opcodes.ACC_BRIDGE) != 0) {
+ out.putShort(cw.newUTF8("Bridge")).putInt(0);
+ }
+ }
+ if (signature != null) {
+ out.putShort(cw.newUTF8("Signature"))
+ .putInt(2)
+ .putShort(cw.newUTF8(signature));
+ }
+ if (annd != null) {
+ out.putShort(cw.newUTF8("AnnotationDefault"));
+ out.putInt(annd.length);
+ out.putByteArray(annd.data, 0, annd.length);
+ }
+ if (anns != null) {
+ out.putShort(cw.newUTF8("RuntimeVisibleAnnotations"));
+ anns.put(out);
+ }
+ if (ianns != null) {
+ out.putShort(cw.newUTF8("RuntimeInvisibleAnnotations"));
+ ianns.put(out);
+ }
+ if (panns != null) {
+ out.putShort(cw.newUTF8("RuntimeVisibleParameterAnnotations"));
+ AnnotationWriter.put(panns, out);
+ }
+ if (ipanns != null) {
+ out.putShort(cw.newUTF8("RuntimeInvisibleParameterAnnotations"));
+ AnnotationWriter.put(ipanns, out);
+ }
+ if (attrs != null) {
+ attrs.put(cw, null, 0, -1, -1, out);
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods: instruction resizing (used to handle GOTO_W and JSR_W)
+ // ------------------------------------------------------------------------
+
+ /**
+ * Resizes the designated instructions, while keeping jump offsets and
+ * instruction addresses consistent. This may require to resize other
+ * existing instructions, or even to introduce new instructions: for
+ * example, increasing the size of an instruction by 2 at the middle of a
+ * method can increases the offset of an IFEQ instruction from 32766 to
+ * 32768, in which case IFEQ 32766 must be replaced with IFNEQ 8 GOTO_W
+ * 32765. This, in turn, may require to increase the size of another jump
+ * instruction, and so on... All these operations are handled automatically
+ * by this method. <p> <i>This method must be called after all the method
+ * that is being built has been visited</i>. In particular, the
+ * {@link Label Label} objects used to construct the method are no longer
+ * valid after this method has been called.
+ *
+ * @param indexes current positions of the instructions to be resized. Each
+ * instruction must be designated by the index of its <i>last</i>
+ * byte, plus one (or, in other words, by the index of the <i>first</i>
+ * byte of the <i>next</i> instruction).
+ * @param sizes the number of bytes to be <i>added</i> to the above
+ * instructions. More precisely, for each i &lt; <tt>len</tt>,
+ * <tt>sizes</tt>[i] bytes will be added at the end of the
+ * instruction designated by <tt>indexes</tt>[i] or, if
+ * <tt>sizes</tt>[i] is negative, the <i>last</i> |<tt>sizes[i]</tt>|
+ * bytes of the instruction will be removed (the instruction size
+ * <i>must not</i> become negative or null). The gaps introduced by
+ * this method must be filled in "manually" in {@link #code code}
+ * method.
+ * @param len the number of instruction to be resized. Must be smaller than
+ * or equal to <tt>indexes</tt>.length and <tt>sizes</tt>.length.
+ * @return the <tt>indexes</tt> array, which now contains the new
+ * positions of the resized instructions (designated as above).
+ */
+ private int[] resizeInstructions(
+ final int[] indexes,
+ final int[] sizes,
+ final int len)
+ {
+ byte[] b = code.data; // bytecode of the method
+ int u, v, label; // indexes in b
+ int i, j; // loop indexes
+
+ /*
+ * 1st step: As explained above, resizing an instruction may require to
+ * resize another one, which may require to resize yet another one, and
+ * so on. The first step of the algorithm consists in finding all the
+ * instructions that need to be resized, without modifying the code.
+ * This is done by the following "fix point" algorithm:
+ *
+ * Parse the code to find the jump instructions whose offset will need
+ * more than 2 bytes to be stored (the future offset is computed from
+ * the current offset and from the number of bytes that will be inserted
+ * or removed between the source and target instructions). For each such
+ * instruction, adds an entry in (a copy of) the indexes and sizes
+ * arrays (if this has not already been done in a previous iteration!).
+ *
+ * If at least one entry has been added during the previous step, go
+ * back to the beginning, otherwise stop.
+ *
+ * In fact the real algorithm is complicated by the fact that the size
+ * of TABLESWITCH and LOOKUPSWITCH instructions depends on their
+ * position in the bytecode (because of padding). In order to ensure the
+ * convergence of the algorithm, the number of bytes to be added or
+ * removed from these instructions is over estimated during the previous
+ * loop, and computed exactly only after the loop is finished (this
+ * requires another pass to parse the bytecode of the method).
+ */
+ int[] allIndexes = new int[len]; // copy of indexes
+ int[] allSizes = new int[len]; // copy of sizes
+ boolean[] resize; // instructions to be resized
+ int newOffset; // future offset of a jump instruction
+
+ System.arraycopy(indexes, 0, allIndexes, 0, len);
+ System.arraycopy(sizes, 0, allSizes, 0, len);
+ resize = new boolean[code.length];
+
+ // 3 = loop again, 2 = loop ended, 1 = last pass, 0 = done
+ int state = 3;
+ do {
+ if (state == 3) {
+ state = 2;
+ }
+ u = 0;
+ while (u < b.length) {
+ int opcode = b[u] & 0xFF; // opcode of current instruction
+ int insert = 0; // bytes to be added after this instruction
+
+ switch (ClassWriter.TYPE[opcode]) {
+ case ClassWriter.NOARG_INSN:
+ case ClassWriter.IMPLVAR_INSN:
+ u += 1;
+ break;
+ case ClassWriter.LABEL_INSN:
+ if (opcode > 201) {
+ // converts temporary opcodes 202 to 217, 218 and
+ // 219 to IFEQ ... JSR (inclusive), IFNULL and
+ // IFNONNULL
+ opcode = opcode < 218 ? opcode - 49 : opcode - 20;
+ label = u + readUnsignedShort(b, u + 1);
+ } else {
+ label = u + readShort(b, u + 1);
+ }
+ newOffset = getNewOffset(allIndexes, allSizes, u, label);
+ if (newOffset < Short.MIN_VALUE
+ || newOffset > Short.MAX_VALUE)
+ {
+ if (!resize[u]) {
+ if (opcode == Opcodes.GOTO
+ || opcode == Opcodes.JSR)
+ {
+ // two additional bytes will be required to
+ // replace this GOTO or JSR instruction with
+ // a GOTO_W or a JSR_W
+ insert = 2;
+ } else {
+ // five additional bytes will be required to
+ // replace this IFxxx <l> instruction with
+ // IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx
+ // is the "opposite" opcode of IFxxx (i.e.,
+ // IFNE for IFEQ) and where <l'> designates
+ // the instruction just after the GOTO_W.
+ insert = 5;
+ }
+ resize[u] = true;
+ }
+ }
+ u += 3;
+ break;
+ case ClassWriter.LABELW_INSN:
+ u += 5;
+ break;
+ case ClassWriter.TABL_INSN:
+ if (state == 1) {
+ // true number of bytes to be added (or removed)
+ // from this instruction = (future number of padding
+ // bytes - current number of padding byte) -
+ // previously over estimated variation =
+ // = ((3 - newOffset%4) - (3 - u%4)) - u%4
+ // = (-newOffset%4 + u%4) - u%4
+ // = -(newOffset & 3)
+ newOffset = getNewOffset(allIndexes, allSizes, 0, u);
+ insert = -(newOffset & 3);
+ } else if (!resize[u]) {
+ // over estimation of the number of bytes to be
+ // added to this instruction = 3 - current number
+ // of padding bytes = 3 - (3 - u%4) = u%4 = u & 3
+ insert = u & 3;
+ resize[u] = true;
+ }
+ // skips instruction
+ u = u + 4 - (u & 3);
+ u += 4 * (readInt(b, u + 8) - readInt(b, u + 4) + 1) + 12;
+ break;
+ case ClassWriter.LOOK_INSN:
+ if (state == 1) {
+ // like TABL_INSN
+ newOffset = getNewOffset(allIndexes, allSizes, 0, u);
+ insert = -(newOffset & 3);
+ } else if (!resize[u]) {
+ // like TABL_INSN
+ insert = u & 3;
+ resize[u] = true;
+ }
+ // skips instruction
+ u = u + 4 - (u & 3);
+ u += 8 * readInt(b, u + 4) + 8;
+ break;
+ case ClassWriter.WIDE_INSN:
+ opcode = b[u + 1] & 0xFF;
+ if (opcode == Opcodes.IINC) {
+ u += 6;
+ } else {
+ u += 4;
+ }
+ break;
+ case ClassWriter.VAR_INSN:
+ case ClassWriter.SBYTE_INSN:
+ case ClassWriter.LDC_INSN:
+ u += 2;
+ break;
+ case ClassWriter.SHORT_INSN:
+ case ClassWriter.LDCW_INSN:
+ case ClassWriter.FIELDORMETH_INSN:
+ case ClassWriter.TYPE_INSN:
+ case ClassWriter.IINC_INSN:
+ u += 3;
+ break;
+ case ClassWriter.ITFMETH_INSN:
+ u += 5;
+ break;
+ // case ClassWriter.MANA_INSN:
+ default:
+ u += 4;
+ break;
+ }
+ if (insert != 0) {
+ // adds a new (u, insert) entry in the allIndexes and
+ // allSizes arrays
+ int[] newIndexes = new int[allIndexes.length + 1];
+ int[] newSizes = new int[allSizes.length + 1];
+ System.arraycopy(allIndexes,
+ 0,
+ newIndexes,
+ 0,
+ allIndexes.length);
+ System.arraycopy(allSizes, 0, newSizes, 0, allSizes.length);
+ newIndexes[allIndexes.length] = u;
+ newSizes[allSizes.length] = insert;
+ allIndexes = newIndexes;
+ allSizes = newSizes;
+ if (insert > 0) {
+ state = 3;
+ }
+ }
+ }
+ if (state < 3) {
+ --state;
+ }
+ } while (state != 0);
+
+ // 2nd step:
+ // copies the bytecode of the method into a new bytevector, updates the
+ // offsets, and inserts (or removes) bytes as requested.
+
+ ByteVector newCode = new ByteVector(code.length);
+
+ u = 0;
+ while (u < code.length) {
+ for (i = allIndexes.length - 1; i >= 0; --i) {
+ if (allIndexes[i] == u) {
+ if (i < len) {
+ if (sizes[i] > 0) {
+ newCode.putByteArray(null, 0, sizes[i]);
+ } else {
+ newCode.length += sizes[i];
+ }
+ indexes[i] = newCode.length;
+ }
+ }
+ }
+ int opcode = b[u] & 0xFF;
+ switch (ClassWriter.TYPE[opcode]) {
+ case ClassWriter.NOARG_INSN:
+ case ClassWriter.IMPLVAR_INSN:
+ newCode.putByte(opcode);
+ u += 1;
+ break;
+ case ClassWriter.LABEL_INSN:
+ if (opcode > 201) {
+ // changes temporary opcodes 202 to 217 (inclusive), 218
+ // and 219 to IFEQ ... JSR (inclusive), IFNULL and
+ // IFNONNULL
+ opcode = opcode < 218 ? opcode - 49 : opcode - 20;
+ label = u + readUnsignedShort(b, u + 1);
+ } else {
+ label = u + readShort(b, u + 1);
+ }
+ newOffset = getNewOffset(allIndexes, allSizes, u, label);
+ if (resize[u]) {
+ // replaces GOTO with GOTO_W, JSR with JSR_W and IFxxx
+ // <l> with IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx is
+ // the "opposite" opcode of IFxxx (i.e., IFNE for IFEQ)
+ // and where <l'> designates the instruction just after
+ // the GOTO_W.
+ if (opcode == Opcodes.GOTO) {
+ newCode.putByte(200); // GOTO_W
+ } else if (opcode == Opcodes.JSR) {
+ newCode.putByte(201); // JSR_W
+ } else {
+ newCode.putByte(opcode <= 166
+ ? ((opcode + 1) ^ 1) - 1
+ : opcode ^ 1);
+ newCode.putShort(8); // jump offset
+ newCode.putByte(200); // GOTO_W
+ // newOffset now computed from start of GOTO_W
+ newOffset -= 3;
+ }
+ newCode.putInt(newOffset);
+ } else {
+ newCode.putByte(opcode);
+ newCode.putShort(newOffset);
+ }
+ u += 3;
+ break;
+ case ClassWriter.LABELW_INSN:
+ label = u + readInt(b, u + 1);
+ newOffset = getNewOffset(allIndexes, allSizes, u, label);
+ newCode.putByte(opcode);
+ newCode.putInt(newOffset);
+ u += 5;
+ break;
+ case ClassWriter.TABL_INSN:
+ // skips 0 to 3 padding bytes
+ v = u;
+ u = u + 4 - (v & 3);
+ // reads and copies instruction
+ newCode.putByte(Opcodes.TABLESWITCH);
+ while (newCode.length % 4 != 0) {
+ newCode.putByte(0);
+ }
+ label = v + readInt(b, u);
+ u += 4;
+ newOffset = getNewOffset(allIndexes, allSizes, v, label);
+ newCode.putInt(newOffset);
+ j = readInt(b, u);
+ u += 4;
+ newCode.putInt(j);
+ j = readInt(b, u) - j + 1;
+ u += 4;
+ newCode.putInt(readInt(b, u - 4));
+ for (; j > 0; --j) {
+ label = v + readInt(b, u);
+ u += 4;
+ newOffset = getNewOffset(allIndexes, allSizes, v, label);
+ newCode.putInt(newOffset);
+ }
+ break;
+ case ClassWriter.LOOK_INSN:
+ // skips 0 to 3 padding bytes
+ v = u;
+ u = u + 4 - (v & 3);
+ // reads and copies instruction
+ newCode.putByte(Opcodes.LOOKUPSWITCH);
+ while (newCode.length % 4 != 0) {
+ newCode.putByte(0);
+ }
+ label = v + readInt(b, u);
+ u += 4;
+ newOffset = getNewOffset(allIndexes, allSizes, v, label);
+ newCode.putInt(newOffset);
+ j = readInt(b, u);
+ u += 4;
+ newCode.putInt(j);
+ for (; j > 0; --j) {
+ newCode.putInt(readInt(b, u));
+ u += 4;
+ label = v + readInt(b, u);
+ u += 4;
+ newOffset = getNewOffset(allIndexes, allSizes, v, label);
+ newCode.putInt(newOffset);
+ }
+ break;
+ case ClassWriter.WIDE_INSN:
+ opcode = b[u + 1] & 0xFF;
+ if (opcode == Opcodes.IINC) {
+ newCode.putByteArray(b, u, 6);
+ u += 6;
+ } else {
+ newCode.putByteArray(b, u, 4);
+ u += 4;
+ }
+ break;
+ case ClassWriter.VAR_INSN:
+ case ClassWriter.SBYTE_INSN:
+ case ClassWriter.LDC_INSN:
+ newCode.putByteArray(b, u, 2);
+ u += 2;
+ break;
+ case ClassWriter.SHORT_INSN:
+ case ClassWriter.LDCW_INSN:
+ case ClassWriter.FIELDORMETH_INSN:
+ case ClassWriter.TYPE_INSN:
+ case ClassWriter.IINC_INSN:
+ newCode.putByteArray(b, u, 3);
+ u += 3;
+ break;
+ case ClassWriter.ITFMETH_INSN:
+ newCode.putByteArray(b, u, 5);
+ u += 5;
+ break;
+ // case MANA_INSN:
+ default:
+ newCode.putByteArray(b, u, 4);
+ u += 4;
+ break;
+ }
+ }
+
+ // updates the exception handler block labels
+ Handler h = catchTable;
+ while (h != null) {
+ getNewOffset(allIndexes, allSizes, h.start);
+ getNewOffset(allIndexes, allSizes, h.end);
+ getNewOffset(allIndexes, allSizes, h.handler);
+ h = h.next;
+ }
+ for (i = 0; i < 2; ++i) {
+ ByteVector bv = i == 0 ? localVar : localVarType;
+ if (bv != null) {
+ b = bv.data;
+ u = 0;
+ while (u < bv.length) {
+ label = readUnsignedShort(b, u);
+ newOffset = getNewOffset(allIndexes, allSizes, 0, label);
+ writeShort(b, u, newOffset);
+ label += readUnsignedShort(b, u + 2);
+ newOffset = getNewOffset(allIndexes, allSizes, 0, label)
+ - newOffset;
+ writeShort(b, u + 2, newOffset);
+ u += 10;
+ }
+ }
+ }
+ if (lineNumber != null) {
+ b = lineNumber.data;
+ u = 0;
+ while (u < lineNumber.length) {
+ writeShort(b, u, getNewOffset(allIndexes,
+ allSizes,
+ 0,
+ readUnsignedShort(b, u)));
+ u += 4;
+ }
+ }
+ // updates the labels of the other attributes
+ while (cattrs != null) {
+ Label[] labels = cattrs.getLabels();
+ if (labels != null) {
+ for (i = labels.length - 1; i >= 0; --i) {
+ if (!labels[i].resized) {
+ labels[i].position = getNewOffset(allIndexes,
+ allSizes,
+ 0,
+ labels[i].position);
+ labels[i].resized = true;
+ }
+ }
+ }
+ }
+
+ // replaces old bytecodes with new ones
+ code = newCode;
+
+ // returns the positions of the resized instructions
+ return indexes;
+ }
+
+ /**
+ * Reads an unsigned short value in the given byte array.
+ *
+ * @param b a byte array.
+ * @param index the start index of the value to be read.
+ * @return the read value.
+ */
+ static int readUnsignedShort(final byte[] b, final int index) {
+ return ((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF);
+ }
+
+ /**
+ * Reads a signed short value in the given byte array.
+ *
+ * @param b a byte array.
+ * @param index the start index of the value to be read.
+ * @return the read value.
+ */
+ static short readShort(final byte[] b, final int index) {
+ return (short) (((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF));
+ }
+
+ /**
+ * Reads a signed int value in the given byte array.
+ *
+ * @param b a byte array.
+ * @param index the start index of the value to be read.
+ * @return the read value.
+ */
+ static int readInt(final byte[] b, final int index) {
+ return ((b[index] & 0xFF) << 24) | ((b[index + 1] & 0xFF) << 16)
+ | ((b[index + 2] & 0xFF) << 8) | (b[index + 3] & 0xFF);
+ }
+
+ /**
+ * Writes a short value in the given byte array.
+ *
+ * @param b a byte array.
+ * @param index where the first byte of the short value must be written.
+ * @param s the value to be written in the given byte array.
+ */
+ static void writeShort(final byte[] b, final int index, final int s) {
+ b[index] = (byte) (s >>> 8);
+ b[index + 1] = (byte) s;
+ }
+
+ /**
+ * Computes the future value of a bytecode offset. <p> Note: it is possible
+ * to have several entries for the same instruction in the <tt>indexes</tt>
+ * and <tt>sizes</tt>: two entries (index=a,size=b) and (index=a,size=b')
+ * are equivalent to a single entry (index=a,size=b+b').
+ *
+ * @param indexes current positions of the instructions to be resized. Each
+ * instruction must be designated by the index of its <i>last</i>
+ * byte, plus one (or, in other words, by the index of the <i>first</i>
+ * byte of the <i>next</i> instruction).
+ * @param sizes the number of bytes to be <i>added</i> to the above
+ * instructions. More precisely, for each i < <tt>len</tt>,
+ * <tt>sizes</tt>[i] bytes will be added at the end of the
+ * instruction designated by <tt>indexes</tt>[i] or, if
+ * <tt>sizes</tt>[i] is negative, the <i>last</i> |<tt>sizes[i]</tt>|
+ * bytes of the instruction will be removed (the instruction size
+ * <i>must not</i> become negative or null).
+ * @param begin index of the first byte of the source instruction.
+ * @param end index of the first byte of the target instruction.
+ * @return the future value of the given bytecode offset.
+ */
+ static int getNewOffset(
+ final int[] indexes,
+ final int[] sizes,
+ final int begin,
+ final int end)
+ {
+ int offset = end - begin;
+ for (int i = 0; i < indexes.length; ++i) {
+ if (begin < indexes[i] && indexes[i] <= end) {
+ // forward jump
+ offset += sizes[i];
+ } else if (end < indexes[i] && indexes[i] <= begin) {
+ // backward jump
+ offset -= sizes[i];
+ }
+ }
+ return offset;
+ }
+
+ /**
+ * Updates the offset of the given label.
+ *
+ * @param indexes current positions of the instructions to be resized. Each
+ * instruction must be designated by the index of its <i>last</i>
+ * byte, plus one (or, in other words, by the index of the <i>first</i>
+ * byte of the <i>next</i> instruction).
+ * @param sizes the number of bytes to be <i>added</i> to the above
+ * instructions. More precisely, for each i < <tt>len</tt>,
+ * <tt>sizes</tt>[i] bytes will be added at the end of the
+ * instruction designated by <tt>indexes</tt>[i] or, if
+ * <tt>sizes</tt>[i] is negative, the <i>last</i> |<tt>sizes[i]</tt>|
+ * bytes of the instruction will be removed (the instruction size
+ * <i>must not</i> become negative or null).
+ * @param label the label whose offset must be updated.
+ */
+ static void getNewOffset(
+ final int[] indexes,
+ final int[] sizes,
+ final Label label)
+ {
+ if (!label.resized) {
+ label.position = getNewOffset(indexes, sizes, 0, label.position);
+ label.resized = true;
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/Opcodes.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/Opcodes.java
new file mode 100644
index 00000000000..94359a3c22d
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/Opcodes.java
@@ -0,0 +1,295 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+/**
+ * Defines the JVM opcodes, access flags and array type codes. This interface
+ * does not define all the JVM opcodes because some opcodes are automatically
+ * handled. For example, the xLOAD and xSTORE opcodes are automatically replaced
+ * by xLOAD_n and xSTORE_n opcodes when possible. The xLOAD_n and xSTORE_n
+ * opcodes are therefore not defined in this interface. Likewise for LDC,
+ * automatically replaced by LDC_W or LDC2_W when necessary, WIDE, GOTO_W and
+ * JSR_W.
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+public interface Opcodes {
+
+ // versions
+
+ int V1_1 = 3 << 16 | 45;
+ int V1_2 = 0 << 16 | 46;
+ int V1_3 = 0 << 16 | 47;
+ int V1_4 = 0 << 16 | 48;
+ int V1_5 = 0 << 16 | 49;
+ int V1_6 = 0 << 16 | 50;
+
+ // access flags
+
+ int ACC_PUBLIC = 0x0001; // class, field, method
+ int ACC_PRIVATE = 0x0002; // class, field, method
+ int ACC_PROTECTED = 0x0004; // class, field, method
+ int ACC_STATIC = 0x0008; // field, method
+ int ACC_FINAL = 0x0010; // class, field, method
+ int ACC_SUPER = 0x0020; // class
+ int ACC_SYNCHRONIZED = 0x0020; // method
+ int ACC_VOLATILE = 0x0040; // field
+ int ACC_BRIDGE = 0x0040; // method
+ int ACC_VARARGS = 0x0080; // method
+ int ACC_TRANSIENT = 0x0080; // field
+ int ACC_NATIVE = 0x0100; // method
+ int ACC_INTERFACE = 0x0200; // class
+ int ACC_ABSTRACT = 0x0400; // class, method
+ int ACC_STRICT = 0x0800; // method
+ int ACC_SYNTHETIC = 0x1000; // class, field, method
+ int ACC_ANNOTATION = 0x2000; // class
+ int ACC_ENUM = 0x4000; // class(?) field inner
+
+ // ASM specific pseudo access flags
+
+ int ACC_DEPRECATED = 131072; // class, field, method
+
+ // types for NEWARRAY
+
+ int T_BOOLEAN = 4;
+ int T_CHAR = 5;
+ int T_FLOAT = 6;
+ int T_DOUBLE = 7;
+ int T_BYTE = 8;
+ int T_SHORT = 9;
+ int T_INT = 10;
+ int T_LONG = 11;
+
+ // opcodes // visit method (- = idem)
+
+ int NOP = 0; // visitInsn
+ int ACONST_NULL = 1; // -
+ int ICONST_M1 = 2; // -
+ int ICONST_0 = 3; // -
+ int ICONST_1 = 4; // -
+ int ICONST_2 = 5; // -
+ int ICONST_3 = 6; // -
+ int ICONST_4 = 7; // -
+ int ICONST_5 = 8; // -
+ int LCONST_0 = 9; // -
+ int LCONST_1 = 10; // -
+ int FCONST_0 = 11; // -
+ int FCONST_1 = 12; // -
+ int FCONST_2 = 13; // -
+ int DCONST_0 = 14; // -
+ int DCONST_1 = 15; // -
+ int BIPUSH = 16; // visitIntInsn
+ int SIPUSH = 17; // -
+ int LDC = 18; // visitLdcInsn
+ // int LDC_W = 19; // -
+ // int LDC2_W = 20; // -
+ int ILOAD = 21; // visitVarInsn
+ int LLOAD = 22; // -
+ int FLOAD = 23; // -
+ int DLOAD = 24; // -
+ int ALOAD = 25; // -
+ // int ILOAD_0 = 26; // -
+ // int ILOAD_1 = 27; // -
+ // int ILOAD_2 = 28; // -
+ // int ILOAD_3 = 29; // -
+ // int LLOAD_0 = 30; // -
+ // int LLOAD_1 = 31; // -
+ // int LLOAD_2 = 32; // -
+ // int LLOAD_3 = 33; // -
+ // int FLOAD_0 = 34; // -
+ // int FLOAD_1 = 35; // -
+ // int FLOAD_2 = 36; // -
+ // int FLOAD_3 = 37; // -
+ // int DLOAD_0 = 38; // -
+ // int DLOAD_1 = 39; // -
+ // int DLOAD_2 = 40; // -
+ // int DLOAD_3 = 41; // -
+ // int ALOAD_0 = 42; // -
+ // int ALOAD_1 = 43; // -
+ // int ALOAD_2 = 44; // -
+ // int ALOAD_3 = 45; // -
+ int IALOAD = 46; // visitInsn
+ int LALOAD = 47; // -
+ int FALOAD = 48; // -
+ int DALOAD = 49; // -
+ int AALOAD = 50; // -
+ int BALOAD = 51; // -
+ int CALOAD = 52; // -
+ int SALOAD = 53; // -
+ int ISTORE = 54; // visitVarInsn
+ int LSTORE = 55; // -
+ int FSTORE = 56; // -
+ int DSTORE = 57; // -
+ int ASTORE = 58; // -
+ // int ISTORE_0 = 59; // -
+ // int ISTORE_1 = 60; // -
+ // int ISTORE_2 = 61; // -
+ // int ISTORE_3 = 62; // -
+ // int LSTORE_0 = 63; // -
+ // int LSTORE_1 = 64; // -
+ // int LSTORE_2 = 65; // -
+ // int LSTORE_3 = 66; // -
+ // int FSTORE_0 = 67; // -
+ // int FSTORE_1 = 68; // -
+ // int FSTORE_2 = 69; // -
+ // int FSTORE_3 = 70; // -
+ // int DSTORE_0 = 71; // -
+ // int DSTORE_1 = 72; // -
+ // int DSTORE_2 = 73; // -
+ // int DSTORE_3 = 74; // -
+ // int ASTORE_0 = 75; // -
+ // int ASTORE_1 = 76; // -
+ // int ASTORE_2 = 77; // -
+ // int ASTORE_3 = 78; // -
+ int IASTORE = 79; // visitInsn
+ int LASTORE = 80; // -
+ int FASTORE = 81; // -
+ int DASTORE = 82; // -
+ int AASTORE = 83; // -
+ int BASTORE = 84; // -
+ int CASTORE = 85; // -
+ int SASTORE = 86; // -
+ int POP = 87; // -
+ int POP2 = 88; // -
+ int DUP = 89; // -
+ int DUP_X1 = 90; // -
+ int DUP_X2 = 91; // -
+ int DUP2 = 92; // -
+ int DUP2_X1 = 93; // -
+ int DUP2_X2 = 94; // -
+ int SWAP = 95; // -
+ int IADD = 96; // -
+ int LADD = 97; // -
+ int FADD = 98; // -
+ int DADD = 99; // -
+ int ISUB = 100; // -
+ int LSUB = 101; // -
+ int FSUB = 102; // -
+ int DSUB = 103; // -
+ int IMUL = 104; // -
+ int LMUL = 105; // -
+ int FMUL = 106; // -
+ int DMUL = 107; // -
+ int IDIV = 108; // -
+ int LDIV = 109; // -
+ int FDIV = 110; // -
+ int DDIV = 111; // -
+ int IREM = 112; // -
+ int LREM = 113; // -
+ int FREM = 114; // -
+ int DREM = 115; // -
+ int INEG = 116; // -
+ int LNEG = 117; // -
+ int FNEG = 118; // -
+ int DNEG = 119; // -
+ int ISHL = 120; // -
+ int LSHL = 121; // -
+ int ISHR = 122; // -
+ int LSHR = 123; // -
+ int IUSHR = 124; // -
+ int LUSHR = 125; // -
+ int IAND = 126; // -
+ int LAND = 127; // -
+ int IOR = 128; // -
+ int LOR = 129; // -
+ int IXOR = 130; // -
+ int LXOR = 131; // -
+ int IINC = 132; // visitIincInsn
+ int I2L = 133; // visitInsn
+ int I2F = 134; // -
+ int I2D = 135; // -
+ int L2I = 136; // -
+ int L2F = 137; // -
+ int L2D = 138; // -
+ int F2I = 139; // -
+ int F2L = 140; // -
+ int F2D = 141; // -
+ int D2I = 142; // -
+ int D2L = 143; // -
+ int D2F = 144; // -
+ int I2B = 145; // -
+ int I2C = 146; // -
+ int I2S = 147; // -
+ int LCMP = 148; // -
+ int FCMPL = 149; // -
+ int FCMPG = 150; // -
+ int DCMPL = 151; // -
+ int DCMPG = 152; // -
+ int IFEQ = 153; // visitJumpInsn
+ int IFNE = 154; // -
+ int IFLT = 155; // -
+ int IFGE = 156; // -
+ int IFGT = 157; // -
+ int IFLE = 158; // -
+ int IF_ICMPEQ = 159; // -
+ int IF_ICMPNE = 160; // -
+ int IF_ICMPLT = 161; // -
+ int IF_ICMPGE = 162; // -
+ int IF_ICMPGT = 163; // -
+ int IF_ICMPLE = 164; // -
+ int IF_ACMPEQ = 165; // -
+ int IF_ACMPNE = 166; // -
+ int GOTO = 167; // -
+ int JSR = 168; // -
+ int RET = 169; // visitVarInsn
+ int TABLESWITCH = 170; // visiTableSwitchInsn
+ int LOOKUPSWITCH = 171; // visitLookupSwitch
+ int IRETURN = 172; // visitInsn
+ int LRETURN = 173; // -
+ int FRETURN = 174; // -
+ int DRETURN = 175; // -
+ int ARETURN = 176; // -
+ int RETURN = 177; // -
+ int GETSTATIC = 178; // visitFieldInsn
+ int PUTSTATIC = 179; // -
+ int GETFIELD = 180; // -
+ int PUTFIELD = 181; // -
+ int INVOKEVIRTUAL = 182; // visitMethodInsn
+ int INVOKESPECIAL = 183; // -
+ int INVOKESTATIC = 184; // -
+ int INVOKEINTERFACE = 185; // -
+ // int UNUSED = 186; // NOT VISITED
+ int NEW = 187; // visitTypeInsn
+ int NEWARRAY = 188; // visitIntInsn
+ int ANEWARRAY = 189; // visitTypeInsn
+ int ARRAYLENGTH = 190; // visitInsn
+ int ATHROW = 191; // -
+ int CHECKCAST = 192; // visitTypeInsn
+ int INSTANCEOF = 193; // -
+ int MONITORENTER = 194; // visitInsn
+ int MONITOREXIT = 195; // -
+ // int WIDE = 196; // NOT VISITED
+ int MULTIANEWARRAY = 197; // visitMultiANewArrayInsn
+ int IFNULL = 198; // visitJumpInsn
+ int IFNONNULL = 199; // -
+ // int GOTO_W = 200; // -
+ // int JSR_W = 201; // -
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/Type.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/Type.java
new file mode 100644
index 00000000000..cf8dbbf9930
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/Type.java
@@ -0,0 +1,760 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm;
+
+import java.lang.reflect.Method;
+
+/**
+ * A Java type. This class can be used to make it easier to manipulate type and
+ * method descriptors.
+ *
+ * @author Eric Bruneton
+ * @author Chris Nokleberg
+ */
+public class Type {
+
+ /**
+ * The sort of the <tt>void</tt> type. See {@link #getSort getSort}.
+ */
+ public final static int VOID = 0;
+
+ /**
+ * The sort of the <tt>boolean</tt> type. See {@link #getSort getSort}.
+ */
+ public final static int BOOLEAN = 1;
+
+ /**
+ * The sort of the <tt>char</tt> type. See {@link #getSort getSort}.
+ */
+ public final static int CHAR = 2;
+
+ /**
+ * The sort of the <tt>byte</tt> type. See {@link #getSort getSort}.
+ */
+ public final static int BYTE = 3;
+
+ /**
+ * The sort of the <tt>short</tt> type. See {@link #getSort getSort}.
+ */
+ public final static int SHORT = 4;
+
+ /**
+ * The sort of the <tt>int</tt> type. See {@link #getSort getSort}.
+ */
+ public final static int INT = 5;
+
+ /**
+ * The sort of the <tt>float</tt> type. See {@link #getSort getSort}.
+ */
+ public final static int FLOAT = 6;
+
+ /**
+ * The sort of the <tt>long</tt> type. See {@link #getSort getSort}.
+ */
+ public final static int LONG = 7;
+
+ /**
+ * The sort of the <tt>double</tt> type. See {@link #getSort getSort}.
+ */
+ public final static int DOUBLE = 8;
+
+ /**
+ * The sort of array reference types. See {@link #getSort getSort}.
+ */
+ public final static int ARRAY = 9;
+
+ /**
+ * The sort of object reference type. See {@link #getSort getSort}.
+ */
+ public final static int OBJECT = 10;
+
+ /**
+ * The <tt>void</tt> type.
+ */
+ public final static Type VOID_TYPE = new Type(VOID);
+
+ /**
+ * The <tt>boolean</tt> type.
+ */
+ public final static Type BOOLEAN_TYPE = new Type(BOOLEAN);
+
+ /**
+ * The <tt>char</tt> type.
+ */
+ public final static Type CHAR_TYPE = new Type(CHAR);
+
+ /**
+ * The <tt>byte</tt> type.
+ */
+ public final static Type BYTE_TYPE = new Type(BYTE);
+
+ /**
+ * The <tt>short</tt> type.
+ */
+ public final static Type SHORT_TYPE = new Type(SHORT);
+
+ /**
+ * The <tt>int</tt> type.
+ */
+ public final static Type INT_TYPE = new Type(INT);
+
+ /**
+ * The <tt>float</tt> type.
+ */
+ public final static Type FLOAT_TYPE = new Type(FLOAT);
+
+ /**
+ * The <tt>long</tt> type.
+ */
+ public final static Type LONG_TYPE = new Type(LONG);
+
+ /**
+ * The <tt>double</tt> type.
+ */
+ public final static Type DOUBLE_TYPE = new Type(DOUBLE);
+
+ // ------------------------------------------------------------------------
+ // Fields
+ // ------------------------------------------------------------------------
+
+ /**
+ * The sort of this Java type.
+ */
+ private final int sort;
+
+ /**
+ * A buffer containing the descriptor of this Java type. This field is only
+ * used for reference types.
+ */
+ private char[] buf;
+
+ /**
+ * The offset of the descriptor of this Java type in {@link #buf buf}. This
+ * field is only used for reference types.
+ */
+ private int off;
+
+ /**
+ * The length of the descriptor of this Java type.
+ */
+ private int len;
+
+ // ------------------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructs a primitive type.
+ *
+ * @param sort the sort of the primitive type to be constructed.
+ */
+ private Type(final int sort) {
+ this.sort = sort;
+ this.len = 1;
+ }
+
+ /**
+ * Constructs a reference type.
+ *
+ * @param sort the sort of the reference type to be constructed.
+ * @param buf a buffer containing the descriptor of the previous type.
+ * @param off the offset of this descriptor in the previous buffer.
+ * @param len the length of this descriptor.
+ */
+ private Type(final int sort, final char[] buf, final int off, final int len)
+ {
+ this.sort = sort;
+ this.buf = buf;
+ this.off = off;
+ this.len = len;
+ }
+
+ /**
+ * Returns the Java type corresponding to the given type descriptor.
+ *
+ * @param typeDescriptor a type descriptor.
+ * @return the Java type corresponding to the given type descriptor.
+ */
+ public static Type getType(final String typeDescriptor) {
+ return getType(typeDescriptor.toCharArray(), 0);
+ }
+
+ /**
+ * Returns the Java type corresponding to the given class.
+ *
+ * @param c a class.
+ * @return the Java type corresponding to the given class.
+ */
+ public static Type getType(final Class c) {
+ if (c.isPrimitive()) {
+ if (c == Integer.TYPE) {
+ return INT_TYPE;
+ } else if (c == Void.TYPE) {
+ return VOID_TYPE;
+ } else if (c == Boolean.TYPE) {
+ return BOOLEAN_TYPE;
+ } else if (c == Byte.TYPE) {
+ return BYTE_TYPE;
+ } else if (c == Character.TYPE) {
+ return CHAR_TYPE;
+ } else if (c == Short.TYPE) {
+ return SHORT_TYPE;
+ } else if (c == Double.TYPE) {
+ return DOUBLE_TYPE;
+ } else if (c == Float.TYPE) {
+ return FLOAT_TYPE;
+ } else /* if (c == Long.TYPE) */{
+ return LONG_TYPE;
+ }
+ } else {
+ return getType(getDescriptor(c));
+ }
+ }
+
+ /**
+ * Returns the Java types corresponding to the argument types of the given
+ * method descriptor.
+ *
+ * @param methodDescriptor a method descriptor.
+ * @return the Java types corresponding to the argument types of the given
+ * method descriptor.
+ */
+ public static Type[] getArgumentTypes(final String methodDescriptor) {
+ char[] buf = methodDescriptor.toCharArray();
+ int off = 1;
+ int size = 0;
+ while (true) {
+ char car = buf[off++];
+ if (car == ')') {
+ break;
+ } else if (car == 'L') {
+ while (buf[off++] != ';') {
+ }
+ ++size;
+ } else if (car != '[') {
+ ++size;
+ }
+ }
+ Type[] args = new Type[size];
+ off = 1;
+ size = 0;
+ while (buf[off] != ')') {
+ args[size] = getType(buf, off);
+ off += args[size].len;
+ size += 1;
+ }
+ return args;
+ }
+
+ /**
+ * Returns the Java types corresponding to the argument types of the given
+ * method.
+ *
+ * @param method a method.
+ * @return the Java types corresponding to the argument types of the given
+ * method.
+ */
+ public static Type[] getArgumentTypes(final Method method) {
+ Class[] classes = method.getParameterTypes();
+ Type[] types = new Type[classes.length];
+ for (int i = classes.length - 1; i >= 0; --i) {
+ types[i] = getType(classes[i]);
+ }
+ return types;
+ }
+
+ /**
+ * Returns the Java type corresponding to the return type of the given
+ * method descriptor.
+ *
+ * @param methodDescriptor a method descriptor.
+ * @return the Java type corresponding to the return type of the given
+ * method descriptor.
+ */
+ public static Type getReturnType(final String methodDescriptor) {
+ char[] buf = methodDescriptor.toCharArray();
+ return getType(buf, methodDescriptor.indexOf(')') + 1);
+ }
+
+ /**
+ * Returns the Java type corresponding to the return type of the given
+ * method.
+ *
+ * @param method a method.
+ * @return the Java type corresponding to the return type of the given
+ * method.
+ */
+ public static Type getReturnType(final Method method) {
+ return getType(method.getReturnType());
+ }
+
+ /**
+ * Returns the Java type corresponding to the given type descriptor.
+ *
+ * @param buf a buffer containing a type descriptor.
+ * @param off the offset of this descriptor in the previous buffer.
+ * @return the Java type corresponding to the given type descriptor.
+ */
+ private static Type getType(final char[] buf, final int off) {
+ int len;
+ switch (buf[off]) {
+ case 'V':
+ return VOID_TYPE;
+ case 'Z':
+ return BOOLEAN_TYPE;
+ case 'C':
+ return CHAR_TYPE;
+ case 'B':
+ return BYTE_TYPE;
+ case 'S':
+ return SHORT_TYPE;
+ case 'I':
+ return INT_TYPE;
+ case 'F':
+ return FLOAT_TYPE;
+ case 'J':
+ return LONG_TYPE;
+ case 'D':
+ return DOUBLE_TYPE;
+ case '[':
+ len = 1;
+ while (buf[off + len] == '[') {
+ ++len;
+ }
+ if (buf[off + len] == 'L') {
+ ++len;
+ while (buf[off + len] != ';') {
+ ++len;
+ }
+ }
+ return new Type(ARRAY, buf, off, len + 1);
+ // case 'L':
+ default:
+ len = 1;
+ while (buf[off + len] != ';') {
+ ++len;
+ }
+ return new Type(OBJECT, buf, off, len + 1);
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the sort of this Java type.
+ *
+ * @return {@link #VOID VOID}, {@link #BOOLEAN BOOLEAN},
+ * {@link #CHAR CHAR}, {@link #BYTE BYTE}, {@link #SHORT SHORT},
+ * {@link #INT INT}, {@link #FLOAT FLOAT}, {@link #LONG LONG},
+ * {@link #DOUBLE DOUBLE}, {@link #ARRAY ARRAY} or
+ * {@link #OBJECT OBJECT}.
+ */
+ public int getSort() {
+ return sort;
+ }
+
+ /**
+ * Returns the number of dimensions of this array type. This method should
+ * only be used for an array type.
+ *
+ * @return the number of dimensions of this array type.
+ */
+ public int getDimensions() {
+ int i = 1;
+ while (buf[off + i] == '[') {
+ ++i;
+ }
+ return i;
+ }
+
+ /**
+ * Returns the type of the elements of this array type. This method should
+ * only be used for an array type.
+ *
+ * @return Returns the type of the elements of this array type.
+ */
+ public Type getElementType() {
+ return getType(buf, off + getDimensions());
+ }
+
+ /**
+ * Returns the name of the class corresponding to this type.
+ *
+ * @return the fully qualified name of the class corresponding to this type.
+ */
+ public String getClassName() {
+ switch (sort) {
+ case VOID:
+ return "void";
+ case BOOLEAN:
+ return "boolean";
+ case CHAR:
+ return "char";
+ case BYTE:
+ return "byte";
+ case SHORT:
+ return "short";
+ case INT:
+ return "int";
+ case FLOAT:
+ return "float";
+ case LONG:
+ return "long";
+ case DOUBLE:
+ return "double";
+ case ARRAY:
+ StringBuffer b = new StringBuffer(getElementType().getClassName());
+ for (int i = getDimensions(); i > 0; --i) {
+ b.append("[]");
+ }
+ return b.toString();
+ // case OBJECT:
+ default:
+ return new String(buf, off + 1, len - 2).replace('/', '.');
+ }
+ }
+
+ /**
+ * Returns the internal name of the class corresponding to this object type.
+ * The internal name of a class is its fully qualified name, where '.' are
+ * replaced by '/'. This method should only be used for an object type.
+ *
+ * @return the internal name of the class corresponding to this object type.
+ */
+ public String getInternalName() {
+ return new String(buf, off + 1, len - 2);
+ }
+
+ // ------------------------------------------------------------------------
+ // Conversion to type descriptors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the descriptor corresponding to this Java type.
+ *
+ * @return the descriptor corresponding to this Java type.
+ */
+ public String getDescriptor() {
+ StringBuffer buf = new StringBuffer();
+ getDescriptor(buf);
+ return buf.toString();
+ }
+
+ /**
+ * Returns the descriptor corresponding to the given argument and return
+ * types.
+ *
+ * @param returnType the return type of the method.
+ * @param argumentTypes the argument types of the method.
+ * @return the descriptor corresponding to the given argument and return
+ * types.
+ */
+ public static String getMethodDescriptor(
+ final Type returnType,
+ final Type[] argumentTypes)
+ {
+ StringBuffer buf = new StringBuffer();
+ buf.append('(');
+ for (int i = 0; i < argumentTypes.length; ++i) {
+ argumentTypes[i].getDescriptor(buf);
+ }
+ buf.append(')');
+ returnType.getDescriptor(buf);
+ return buf.toString();
+ }
+
+ /**
+ * Appends the descriptor corresponding to this Java type to the given
+ * string buffer.
+ *
+ * @param buf the string buffer to which the descriptor must be appended.
+ */
+ private void getDescriptor(final StringBuffer buf) {
+ switch (sort) {
+ case VOID:
+ buf.append('V');
+ return;
+ case BOOLEAN:
+ buf.append('Z');
+ return;
+ case CHAR:
+ buf.append('C');
+ return;
+ case BYTE:
+ buf.append('B');
+ return;
+ case SHORT:
+ buf.append('S');
+ return;
+ case INT:
+ buf.append('I');
+ return;
+ case FLOAT:
+ buf.append('F');
+ return;
+ case LONG:
+ buf.append('J');
+ return;
+ case DOUBLE:
+ buf.append('D');
+ return;
+ // case ARRAY:
+ // case OBJECT:
+ default:
+ buf.append(this.buf, off, len);
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Direct conversion from classes to type descriptors,
+ // without intermediate Type objects
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the internal name of the given class. The internal name of a
+ * class is its fully qualified name, where '.' are replaced by '/'.
+ *
+ * @param c an object class.
+ * @return the internal name of the given class.
+ */
+ public static String getInternalName(final Class c) {
+ return c.getName().replace('.', '/');
+ }
+
+ /**
+ * Returns the descriptor corresponding to the given Java type.
+ *
+ * @param c an object class, a primitive class or an array class.
+ * @return the descriptor corresponding to the given class.
+ */
+ public static String getDescriptor(final Class c) {
+ StringBuffer buf = new StringBuffer();
+ getDescriptor(buf, c);
+ return buf.toString();
+ }
+
+ /**
+ * Returns the descriptor corresponding to the given method.
+ *
+ * @param m a {@link Method Method} object.
+ * @return the descriptor of the given method.
+ */
+ public static String getMethodDescriptor(final Method m) {
+ Class[] parameters = m.getParameterTypes();
+ StringBuffer buf = new StringBuffer();
+ buf.append('(');
+ for (int i = 0; i < parameters.length; ++i) {
+ getDescriptor(buf, parameters[i]);
+ }
+ buf.append(')');
+ getDescriptor(buf, m.getReturnType());
+ return buf.toString();
+ }
+
+ /**
+ * Appends the descriptor of the given class to the given string buffer.
+ *
+ * @param buf the string buffer to which the descriptor must be appended.
+ * @param c the class whose descriptor must be computed.
+ */
+ private static void getDescriptor(final StringBuffer buf, final Class c) {
+ Class d = c;
+ while (true) {
+ if (d.isPrimitive()) {
+ char car;
+ if (d == Integer.TYPE) {
+ car = 'I';
+ } else if (d == Void.TYPE) {
+ car = 'V';
+ } else if (d == Boolean.TYPE) {
+ car = 'Z';
+ } else if (d == Byte.TYPE) {
+ car = 'B';
+ } else if (d == Character.TYPE) {
+ car = 'C';
+ } else if (d == Short.TYPE) {
+ car = 'S';
+ } else if (d == Double.TYPE) {
+ car = 'D';
+ } else if (d == Float.TYPE) {
+ car = 'F';
+ } else /* if (d == Long.TYPE) */{
+ car = 'J';
+ }
+ buf.append(car);
+ return;
+ } else if (d.isArray()) {
+ buf.append('[');
+ d = d.getComponentType();
+ } else {
+ buf.append('L');
+ String name = d.getName();
+ int len = name.length();
+ for (int i = 0; i < len; ++i) {
+ char car = name.charAt(i);
+ buf.append(car == '.' ? '/' : car);
+ }
+ buf.append(';');
+ return;
+ }
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Corresponding size and opcodes
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the size of values of this type.
+ *
+ * @return the size of values of this type, i.e., 2 for <tt>long</tt> and
+ * <tt>double</tt>, and 1 otherwise.
+ */
+ public int getSize() {
+ return (sort == LONG || sort == DOUBLE ? 2 : 1);
+ }
+
+ /**
+ * Returns a JVM instruction opcode adapted to this Java type.
+ *
+ * @param opcode a JVM instruction opcode. This opcode must be one of ILOAD,
+ * ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL,
+ * ISHR, IUSHR, IAND, IOR, IXOR and IRETURN.
+ * @return an opcode that is similar to the given opcode, but adapted to
+ * this Java type. For example, if this type is <tt>float</tt> and
+ * <tt>opcode</tt> is IRETURN, this method returns FRETURN.
+ */
+ public int getOpcode(final int opcode) {
+ if (opcode == Opcodes.IALOAD || opcode == Opcodes.IASTORE) {
+ switch (sort) {
+ case BOOLEAN:
+ case BYTE:
+ return opcode + 5;
+ case CHAR:
+ return opcode + 6;
+ case SHORT:
+ return opcode + 7;
+ case INT:
+ return opcode;
+ case FLOAT:
+ return opcode + 2;
+ case LONG:
+ return opcode + 1;
+ case DOUBLE:
+ return opcode + 3;
+ // case ARRAY:
+ // case OBJECT:
+ default:
+ return opcode + 4;
+ }
+ } else {
+ switch (sort) {
+ case VOID:
+ return opcode + 5;
+ case BOOLEAN:
+ case CHAR:
+ case BYTE:
+ case SHORT:
+ case INT:
+ return opcode;
+ case FLOAT:
+ return opcode + 2;
+ case LONG:
+ return opcode + 1;
+ case DOUBLE:
+ return opcode + 3;
+ // case ARRAY:
+ // case OBJECT:
+ default:
+ return opcode + 4;
+ }
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Equals, hashCode and toString
+ // ------------------------------------------------------------------------
+
+ /**
+ * Tests if the given object is equal to this type.
+ *
+ * @param o the object to be compared to this type.
+ * @return <tt>true</tt> if the given object is equal to this type.
+ */
+ public boolean equals(final Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || !(o instanceof Type)) {
+ return false;
+ }
+ Type t = (Type) o;
+ if (sort != t.sort) {
+ return false;
+ }
+ if (sort == Type.OBJECT || sort == Type.ARRAY) {
+ if (len != t.len) {
+ return false;
+ }
+ for (int i = off, j = t.off, end = i + len; i < end; i++, j++) {
+ if (buf[i] != t.buf[j]) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Returns a hash code value for this type.
+ *
+ * @return a hash code value for this type.
+ */
+ public int hashCode() {
+ int hc = 13 * sort;
+ if (sort == Type.OBJECT || sort == Type.ARRAY) {
+ for (int i = off, end = i + len; i < end; i++) {
+ hc = 17 * (hc + buf[i]);
+ }
+ }
+ return hc;
+ }
+
+ /**
+ * Returns a string representation of this type.
+ *
+ * @return the descriptor of this type.
+ */
+ public String toString() {
+ return getDescriptor();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapAttribute.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapAttribute.java
new file mode 100644
index 00000000000..4df2f7ddec1
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapAttribute.java
@@ -0,0 +1,378 @@
+/**
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.attrs;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ByteVector;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
+
+/**
+ * StackMapAttribute is used by CDLC preverifier. Definition is given in
+ * appendix "CLDC Byte Code Typechecker Specification" from CDLC 1.1
+ * specification. <p> <i>Note that this implementation does not calculate
+ * StackMapFrame structures from the method bytecode. If method code is changed
+ * or generated from scratch, then developer is responsible to prepare a correct
+ * StackMapFrame structures.</i> <p> The format of the stack map in the class
+ * file is given below. In the following, <ul> <li>if the length of the
+ * method's byte code1 is 65535 or less, then <tt>uoffset</tt> represents the
+ * type u2; otherwise <tt>uoffset</tt> represents the type u4.</li> <li>If
+ * the maximum number of local variables for the method is 65535 or less, then
+ * <tt>ulocalvar</tt> represents the type u2; otherwise <tt>ulocalvar</tt>
+ * represents the type u4.</li> <li>If the maximum size of the operand stack
+ * is 65535 or less, then <tt>ustack</tt> represents the type u2; otherwise
+ * ustack represents the type u4.</li> </ul>
+ *
+ * <pre>
+ * stack_map { // attribute StackMap
+ * u2 attribute_name_index;
+ * u4 attribute_length
+ * uoffset number_of_entries;
+ * stack_map_frame entries[number_of_entries];
+ * }
+ * </pre>
+ *
+ * Each stack map frame has the following format:
+ *
+ * <pre>
+ * stack_map_frame {
+ * uoffset offset;
+ * ulocalvar number_of_locals;
+ * verification_type_info locals[number_of_locals];
+ * ustack number_of_stack_items;
+ * verification_type_info stack[number_of_stack_items];
+ * }
+ * </pre>
+ *
+ * The <tt>verification_type_info</tt> structure consists of a one-byte tag
+ * followed by zero or more bytes, giving more information about the tag. Each
+ * <tt>verification_type_info</tt> structure specifies the verification type
+ * of one or two locations.
+ *
+ * <pre>
+ * union verification_type_info {
+ * Top_variable_info;
+ * Integer_variable_info;
+ * Float_variable_info;
+ * Long_variable_info;
+ * Double_variable_info;
+ * Null_variable_info;
+ * UninitializedThis_variable_info;
+ * Object_variable_info;
+ * Uninitialized_variable_info;
+ * }
+ *
+ * Top_variable_info {
+ * u1 tag = ITEM_Top; // 0
+ * }
+ *
+ * Integer_variable_info {
+ * u1 tag = ITEM_Integer; // 1
+ * }
+ *
+ * Float_variable_info {
+ * u1 tag = ITEM_Float; // 2
+ * }
+ *
+ * Long_variable_info {
+ * u1 tag = ITEM_Long; // 4
+ * }
+ *
+ * Double_variable_info {
+ * u1 tag = ITEM_Double; // 3
+ * }
+ *
+ * Null_variable_info {
+ * u1 tag = ITEM_Null; // 5
+ * }
+ *
+ * UninitializedThis_variable_info {
+ * u1 tag = ITEM_UninitializedThis; // 6
+ * }
+ *
+ * Object_variable_info {
+ * u1 tag = ITEM_Object; // 7
+ * u2 cpool_index;
+ * }
+ *
+ * Uninitialized_variable_info {
+ * u1 tag = ITEM_Uninitialized // 8
+ * uoffset offset;
+ * }
+ * </pre>
+ *
+ * @see <a href="http://www.jcp.org/en/jsr/detail?id=139">JSR 139 : Connected
+ * Limited Device Configuration 1.1</a>
+ *
+ * @author Eugene Kuleshov
+ */
+public class StackMapAttribute extends Attribute {
+
+ static final int MAX_SIZE = 65535;
+
+ /**
+ * A List of <code>StackMapFrame</code> instances.
+ */
+ public List frames = new ArrayList();
+
+ public StackMapAttribute() {
+ super("StackMap");
+ }
+
+ public StackMapAttribute(List frames) {
+ this();
+ this.frames = frames;
+ }
+
+ public List getFrames() {
+ return frames;
+ }
+
+ public StackMapFrame getFrame(Label label) {
+ for (int i = 0; i < frames.size(); i++) {
+ StackMapFrame frame = (StackMapFrame) frames.get(i);
+ if (frame.label == label) {
+ return frame;
+ }
+ }
+ return null;
+ }
+
+ public boolean isUnknown() {
+ return false;
+ }
+
+ public boolean isCodeAttribute() {
+ return true;
+ }
+
+ protected Attribute read(
+ ClassReader cr,
+ int off,
+ int len,
+ char[] buf,
+ int codeOff,
+ Label[] labels)
+ {
+ StackMapAttribute attr = new StackMapAttribute();
+ // note that this is not the size of Code attribute
+ boolean isExtCodeSize = cr.readInt(codeOff + 4) > MAX_SIZE;
+ boolean isExtLocals = cr.readUnsignedShort(codeOff + 2) > MAX_SIZE;
+ boolean isExtStack = cr.readUnsignedShort(codeOff) > MAX_SIZE;
+
+ int size = 0;
+ if (isExtCodeSize) {
+ size = cr.readInt(off);
+ off += 4;
+ } else {
+ size = cr.readUnsignedShort(off);
+ off += 2;
+ }
+ for (int i = 0; i < size; i++) {
+ int offset;
+ if (isExtCodeSize) {
+ offset = cr.readInt(off);
+ off += 4;
+ } else {
+ offset = cr.readUnsignedShort(off);
+ off += 2;
+ }
+
+ Label label = getLabel(offset, labels);
+ List locals = new ArrayList();
+ List stack = new ArrayList();
+
+ off = readTypeInfo(cr,
+ off,
+ locals,
+ labels,
+ buf,
+ isExtLocals,
+ isExtCodeSize);
+ off = readTypeInfo(cr,
+ off,
+ stack,
+ labels,
+ buf,
+ isExtStack,
+ isExtCodeSize);
+
+ attr.frames.add(new StackMapFrame(label, locals, stack));
+ }
+ return attr;
+ }
+
+ private int readTypeInfo(
+ ClassReader cr,
+ int off,
+ List info,
+ Label[] labels,
+ char[] buf,
+ boolean isExt,
+ boolean isExtCode)
+ {
+ int n = 0;
+ if (isExt) {
+ n = cr.readInt(off);
+ off += 4;
+ } else {
+ n = cr.readUnsignedShort(off);
+ off += 2;
+ }
+ for (int j = 0; j < n; j++) {
+ int itemType = cr.readByte(off++);
+ StackMapType typeInfo = StackMapType.getTypeInfo(itemType);
+ info.add(typeInfo);
+ switch (itemType) {
+ case StackMapType.ITEM_Object: //
+ typeInfo.setObject(cr.readClass(off, buf));
+ off += 2;
+ break;
+ case StackMapType.ITEM_Uninitialized: //
+ int offset;
+ if (isExtCode) {
+ offset = cr.readInt(off);
+ off += 4;
+ } else {
+ offset = cr.readUnsignedShort(off);
+ off += 2;
+ }
+ typeInfo.setLabel(getLabel(offset, labels));
+ break;
+ }
+ }
+ return off;
+ }
+
+ private void writeTypeInfo(ByteVector bv, ClassWriter cw, List info, int max)
+ {
+ if (max > StackMapAttribute.MAX_SIZE) {
+ bv.putInt(info.size());
+ } else {
+ bv.putShort(info.size());
+ }
+ for (int j = 0; j < info.size(); j++) {
+ StackMapType typeInfo = (StackMapType) info.get(j);
+ bv.putByte(typeInfo.getType());
+ switch (typeInfo.getType()) {
+ case StackMapType.ITEM_Object: //
+ bv.putShort(cw.newClass(typeInfo.getObject()));
+ break;
+
+ case StackMapType.ITEM_Uninitialized: //
+ bv.putShort(typeInfo.getLabel().getOffset());
+ break;
+
+ }
+ }
+ }
+
+ private Label getLabel(int offset, Label[] labels) {
+ Label l = labels[offset];
+ if (l != null) {
+ return l;
+ }
+ return labels[offset] = new Label();
+ }
+
+ protected ByteVector write(
+ ClassWriter cw,
+ byte[] code,
+ int len,
+ int maxStack,
+ int maxLocals)
+ {
+ ByteVector bv = new ByteVector();
+ if (code != null && code.length > MAX_SIZE) { // TODO verify value
+ bv.putInt(frames.size());
+ } else {
+ bv.putShort(frames.size());
+ }
+ for (int i = 0; i < frames.size(); i++) {
+ writeFrame((StackMapFrame) frames.get(i),
+ cw,
+ maxStack,
+ maxLocals,
+ bv);
+ }
+ return bv;
+ }
+
+ protected Label[] getLabels() {
+ HashSet labels = new HashSet();
+ for (int i = 0; i < frames.size(); i++) {
+ getFrameLabels((StackMapFrame) frames.get(i), labels);
+ }
+ return (Label[]) labels.toArray(new Label[labels.size()]);
+ }
+
+ private void writeFrame(
+ StackMapFrame frame,
+ ClassWriter cw,
+ int maxStack,
+ int maxLocals,
+ ByteVector bv)
+ {
+ bv.putShort(frame.label.getOffset());
+ writeTypeInfo(bv, cw, frame.locals, maxLocals);
+ writeTypeInfo(bv, cw, frame.stack, maxStack);
+ }
+
+ private void getFrameLabels(StackMapFrame frame, Set labels) {
+ labels.add(frame.label);
+ getTypeInfoLabels(labels, frame.locals);
+ getTypeInfoLabels(labels, frame.stack);
+ }
+
+ private void getTypeInfoLabels(Set labels, List info) {
+ for (Iterator it = info.iterator(); it.hasNext();) {
+ StackMapType typeInfo = (StackMapType) it.next();
+ if (typeInfo.getType() == StackMapType.ITEM_Uninitialized) {
+ labels.add(typeInfo.getLabel());
+ }
+ }
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer("StackMap[");
+ for (int i = 0; i < frames.size(); i++) {
+ sb.append('\n').append('[').append(frames.get(i)).append(']');
+ }
+ sb.append("\n]");
+ return sb.toString();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapFrame.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapFrame.java
new file mode 100644
index 00000000000..bdd464179aa
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapFrame.java
@@ -0,0 +1,82 @@
+/**
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.attrs;
+
+import java.util.List;
+
+import org.objectweb.asm.Label;
+
+/**
+ * Holds the state of the stack and local variables for a single execution
+ * branch.
+ *
+ * <i>Note that Long and Double types are represented by two entries in locals
+ * and stack. Second entry should be always of type Top.</i>
+ *
+ * @see <a href="http://www.jcp.org/en/jsr/detail?id=139">JSR 139 : Connected
+ * Limited Device Configuration 1.1</a>
+ *
+ * @see "ClassFileFormat-Java6.fm Page 138 Friday, April 15, 2005 3:22 PM"
+ *
+ * @author Eugene Kuleshov
+ */
+public class StackMapFrame {
+
+ /**
+ * A <code>Label</code> for frame offset within method bytecode.
+ */
+ public Label label;
+
+ /**
+ * A List of <code>StackMapType</code> instances that represent locals for
+ * this frame.
+ */
+ public List locals;
+
+ /**
+ * A List of <code>StackMapType</code> instances that represent stack for
+ * this frame.
+ */
+ public List stack;
+
+ public StackMapFrame(Label label, List locals, List stack) {
+ this.label = label;
+ this.locals = locals;
+ this.stack = stack;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer("Frame:L");
+ sb.append(System.identityHashCode(label));
+ sb.append(" locals").append(locals);
+ sb.append(" stack").append(stack);
+ return sb.toString();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapTableAttribute.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapTableAttribute.java
new file mode 100644
index 00000000000..c0aa9c8a818
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapTableAttribute.java
@@ -0,0 +1,927 @@
+/**
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.attrs;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ByteVector;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+
+/**
+ * The stack map attribute is used during the process of verification by
+ * typechecking (§4.11.1). <br> <br> A stack map attribute consists of zero or
+ * more stack map frames. Each stack map frame specifies (either explicitly or
+ * implicitly) a bytecode offset, the verification types (§4.11.1) for the local
+ * variables, and the verification types for the operand stack. <br> <br> The
+ * type checker deals with and manipulates the expected types of a method's
+ * local variables and operand stack. Throughout this section, a location refers
+ * to either a single local variable or to a single operand stack entry. <br>
+ * <br> We will use the terms stack frame map and type state interchangeably to
+ * describe a mapping from locations in the operand stack and local variables of
+ * a method to verification types. We will usually use the term stack frame map
+ * when such a mapping is provided in the class file, and the term type state
+ * when the mapping is inferred by the type checker. <br> <br> If a method's
+ * Code attribute does not have a StackMapTable attribute, it has an implicit
+ * stack map attribute. This implicit stack map attribute is equivalent to a
+ * StackMapTable attribute with number_of_entries equal to zero. A method's Code
+ * attribute may have at most one StackMapTable attribute, otherwise a
+ * java.lang.ClassFormatError is thrown. <br> <br> The format of the stack map
+ * in the class file is given below. In the following, if the length of the
+ * method's byte code is 65535 or less, then uoffset represents the type u2;
+ * otherwise uoffset represents the type u4. If the maximum number of local
+ * variables for the method is 65535 or less, then <code>ulocalvar</code>
+ * represents the type u2; otherwise ulocalvar represents the type u4. If the
+ * maximum size of the operand stack is 65535 or less, then <code>ustack</code>
+ * represents the type u2; otherwise ustack represents the type u4.
+ *
+ * <pre>
+ * stack_map { // attribute StackMapTable
+ * u2 attribute_name_index;
+ * u4 attribute_length
+ * uoffset number_of_entries;
+ * stack_map_frame entries[number_of_entries];
+ * }
+ * </pre>
+ *
+ * Each stack_map_frame structure specifies the type state at a particular byte
+ * code offset. Each frame type specifies (explicitly or implicitly) a value,
+ * offset_delta, that is used to calulate the actual byte code offset at which
+ * it applies. The byte code offset at which the frame applies is given by
+ * adding <code>1 + offset_delta</code> to the <code>offset</code> of the
+ * previous frame, unless the previous frame is the initial frame of the method,
+ * in which case the byte code offset is <code>offset_delta</code>. <br> <br>
+ * <i>Note that the length of the byte codes is not the same as the length of
+ * the Code attribute. The byte codes are embedded in the Code attribute, along
+ * with other information.</i> <br> <br> By using an offset delta rather than
+ * the actual byte code offset we ensure, by definition, that stack map frames
+ * are in the correctly sorted order. Furthermore, by consistently using the
+ * formula <code>offset_delta + 1</code> for all explicit frames, we guarantee
+ * the absence of duplicates. <br> <br> All frame types, even full_frame, rely
+ * on the previous frame for some of their semantics. This raises the question
+ * of what is the very first frame? The initial frame is implicit, and computed
+ * from the method descriptor. See the Prolog code for methodInitialStacFrame.
+ * <br> <br> The stack_map_frame structure consists of a one-byte tag followed
+ * by zero or more bytes, giving more information, depending upon the tag. <br>
+ * <br> A stack map frame may belong to one of several frame types
+ *
+ * <pre>
+ * union stack_map_frame {
+ * same_frame;
+ * same_locals_1_stack_item_frame;
+ * chop_frame;
+ * same_frame_extended;
+ * append_frame;
+ * full_frame;
+ * }
+ * </pre>
+ *
+ * The frame type same_frame is represented by tags in the range [0-63]. If the
+ * frame type is same_frame, it means the frame has exactly the same locals as
+ * the previous stack map frame and that the number of stack items is zero. The
+ * offset_delta value for the frame is the value of the tag field, frame_type.
+ * The form of such a frame is then:
+ *
+ * <pre>
+ * same_frame {
+ * u1 frame_type = SAME; // 0-63
+ * }
+ * </pre>
+ *
+ * The frame type same_locals_1_stack_item_frame is represented by tags in the
+ * range [64, 127]. If the frame_type is same_locals_1_stack_item_frame, it
+ * means the frame has exactly the same locals as the previous stack map frame
+ * and that the number of stack items is 1. The offset_delta value for the frame
+ * is the value (frame_type - 64). There is a verification_type_info following
+ * the frame_type for the one stack item. The form of such a frame is then:
+ *
+ * <pre>
+ * same_locals_1_stack_item_frame {
+ * u1 frame_type = SAME_LOCALS_1_STACK_ITEM; // 64-127
+ * verification_type_info stack[1];
+ * }
+ * </pre>
+ *
+ * Tags in the range [128-247] are reserved for future use. <br> <br> The frame
+ * type chop_frame is represented by tags in the range [248-250]. If the
+ * frame_type is chop_frame, it means that the current locals are the same as
+ * the locals in the previous frame, except that the k last locals are absent.
+ * The value of k is given by the formula 251-frame_type. <br> <br> The form of
+ * such a frame is then:
+ *
+ * <pre>
+ * chop_frame {
+ * u1 frame_type=CHOP; // 248-250
+ * uoffset offset_delta;
+ * }
+ * </pre>
+ *
+ * The frame type same_frame_extended is represented by the tag value 251. If
+ * the frame type is same_frame_extended, it means the frame has exactly the
+ * same locals as the previous stack map frame and that the number of stack
+ * items is zero. The form of such a frame is then:
+ *
+ * <pre>
+ * same_frame_extended {
+ * u1 frame_type = SAME_FRAME_EXTENDED; // 251
+ * uoffset offset_delta;
+ * }
+ * </pre>
+ *
+ * The frame type append_frame is represented by tags in the range [252-254]. If
+ * the frame_type is append_frame, it means that the current locals are the same
+ * as the locals in the previous frame, except that k additional locals are
+ * defined. The value of k is given by the formula frame_type-251. <br> <br> The
+ * form of such a frame is then:
+ *
+ * <pre>
+ * append_frame {
+ * u1 frame_type =APPEND; // 252-254
+ * uoffset offset_delta;
+ * verification_type_info locals[frame_type -251];
+ * }
+ * </pre>
+ *
+ * The 0th entry in locals represents the type of the first additional local
+ * variable. If locals[M] represents local variable N, then locals[M+1]
+ * represents local variable N+1 if locals[M] is one of Top_variable_info,
+ * Integer_variable_info, Float_variable_info, Null_variable_info,
+ * UninitializedThis_variable_info, Object_variable_info, or
+ * Uninitialized_variable_info, otherwise locals[M+1] represents local variable
+ * N+2. It is an error if, for any index i, locals[i] represents a local
+ * variable whose index is greater than the maximum number of local variables
+ * for the method. <br> <br> The frame type full_frame is represented by the tag
+ * value 255. The form of such a frame is then:
+ *
+ * <pre>
+ * full_frame {
+ * u1 frame_type = FULL_FRAME; // 255
+ * uoffset offset_delta;
+ * ulocalvar number_of_locals;
+ * verification_type_info locals[number_of_locals];
+ * ustack number_of_stack_items;
+ * verification_type_info stack[number_of_stack_items];
+ * }
+ * </pre>
+ *
+ * The 0th entry in locals represents the type of local variable 0. If locals[M]
+ * represents local variable N, then locals[M+1] represents local variable N+1
+ * if locals[M] is one of Top_variable_info, Integer_variable_info,
+ * Float_variable_info, Null_variable_info, UninitializedThis_variable_info,
+ * Object_variable_info, or Uninitialized_variable_info, otherwise locals[M+1]
+ * represents local variable N+2. It is an error if, for any index i, locals[i]
+ * represents a local variable whose index is greater than the maximum number of
+ * local variables for the method. <br> <br> The 0th entry in stack represents
+ * the type of the bottom of the stack, and subsequent entries represent types
+ * of stack elements closer to the top of the operand stack. We shall refer to
+ * the bottom element of the stack as stack element 0, and to subsequent
+ * elements as stack element 1, 2 etc. If stack[M] represents stack element N,
+ * then stack[M+1] represents stack element N+1 if stack[M] is one of
+ * Top_variable_info, Integer_variable_info, Float_variable_info,
+ * Null_variable_info, UninitializedThis_variable_info, Object_variable_info, or
+ * Uninitialized_variable_info, otherwise stack[M+1] represents stack element
+ * N+2. It is an error if, for any index i, stack[i] represents a stack entry
+ * whose index is greater than the maximum operand stack size for the method.
+ * <br> <br> We say that an instruction in the byte code has a corresponding
+ * stack map frame if the offset in the offset field of the stack map frame is
+ * the same as the offset of the instruction in the byte codes. <br> <br> The
+ * verification_type_info structure consists of a one-byte tag followed by zero
+ * or more bytes, giving more information about the tag. Each
+ * verification_type_info structure specifies the verification type of one or
+ * two locations.
+ *
+ * <pre>
+ * union verification_type_info {
+ * Top_variable_info;
+ * Integer_variable_info;
+ * Float_variable_info;
+ * Long_variable_info;
+ * Double_variable_info;
+ * Null_variable_info;
+ * UninitializedThis_variable_info;
+ * Object_variable_info;
+ * Uninitialized_variable_info;
+ * }
+ * </pre>
+ *
+ * The Top_variable_info type indicates that the local variable has the
+ * verification type top (T.)
+ *
+ * <pre>
+ * Top_variable_info {
+ * u1 tag = ITEM_Top; // 0
+ * }
+ * </pre>
+ *
+ * The Integer_variable_info type indicates that the location contains the
+ * verification type int.
+ *
+ * <pre>
+ * Integer_variable_info {
+ * u1 tag = ITEM_Integer; // 1
+ * }
+ * </pre>
+ *
+ * The Float_variable_info type indicates that the location contains the
+ * verification type float.
+ *
+ * <pre>
+ * Float_variable_info {
+ * u1 tag = ITEM_Float; // 2
+ * }
+ * </pre>
+ *
+ * The Long_variable_info type indicates that the location contains the
+ * verification type long. If the location is a local variable, then:
+ *
+ * <ul> <li>It must not be the local variable with the highest index.</li>
+ * <li>The next higher numbered local variable contains the verification type
+ * T.</li> </ul>
+ *
+ * If the location is an operand stack entry, then:
+ *
+ * <ul> <li>The current location must not be the topmost location of the
+ * operand stack.</li> <li>the next location closer to the top of the operand
+ * stack contains the verification type T.</li> </ul>
+ *
+ * This structure gives the contents of two locations in the operand stack or in
+ * the local variables.
+ *
+ * <pre>
+ * Long_variable_info {
+ * u1 tag = ITEM_Long; // 4
+ * }
+ * </pre>
+ *
+ * The Double_variable_info type indicates that the location contains the
+ * verification type double. If the location is a local variable, then:
+ *
+ * <ul> <li>It must not be the local variable with the highest index.</li>
+ * <li>The next higher numbered local variable contains the verification type
+ * T. <li> </ul>
+ *
+ * If the location is an operand stack entry, then:
+ *
+ * <ul> <li>The current location must not be the topmost location of the
+ * operand stack.</li> <li>the next location closer to the top of the operand
+ * stack contains the verification type T.</li> </ul>
+ *
+ * This structure gives the contents of two locations in in the operand stack or
+ * in the local variables.
+ *
+ * <pre>
+ * Double_variable_info {
+ * u1 tag = ITEM_Double; // 3
+ * }
+ * </pre>
+ *
+ * The Null_variable_info type indicates that location contains the verification
+ * type null.
+ *
+ * <pre>
+ * Null_variable_info {
+ * u1 tag = ITEM_Null; // 5
+ * }
+ * </pre>
+ *
+ * The UninitializedThis_variable_info type indicates that the location contains
+ * the verification type uninitializedThis.
+ *
+ * <pre>
+ * UninitializedThis_variable_info {
+ * u1 tag = ITEM_UninitializedThis; // 6
+ * }
+ * </pre>
+ *
+ * The Object_variable_info type indicates that the location contains an
+ * instance of the class referenced by the constant pool entry.
+ *
+ * <pre>
+ * Object_variable_info {
+ * u1 tag = ITEM_Object; // 7
+ * u2 cpool_index;
+ * }
+ * </pre>
+ *
+ * The Uninitialized_variable_info indicates that the location contains the
+ * verification type uninitialized(offset). The offset item indicates the offset
+ * of the new instruction that created the object being stored in the location.
+ *
+ * <pre>
+ * Uninitialized_variable_info {
+ * u1 tag = ITEM_Uninitialized // 8
+ * uoffset offset;
+ * }
+ * </pre>
+ *
+ * @see "ClassFileFormat-Java6.fm Page 138 Friday, April 15, 2005 3:22 PM"
+ *
+ * @author Eugene Kuleshov
+ */
+public class StackMapTableAttribute extends Attribute {
+ /**
+ * Frame has exactly the same locals as the previous stack map frame and
+ * number of stack items is zero.
+ */
+ public static final int SAME_FRAME = 0; // to 63 (0-3f)
+
+ /**
+ * Frame has exactly the same locals as the previous stack map frame and
+ * number of stack items is 1
+ */
+ public static final int SAME_LOCALS_1_STACK_ITEM_FRAME = 64; // to 127
+
+ // (40-7f)
+
+ /**
+ * Reserved for future use
+ */
+ public static final int RESERVED = 128;
+
+ /**
+ * Frame has exactly the same locals as the previous stack map frame and
+ * number of stack items is 1. Offset is bigger then 63;
+ */
+ public static final int SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED = 247; // f7
+
+ /**
+ * Frame where current locals are the same as the locals in the previous
+ * frame, except that the k last locals are absent. The value of k is given
+ * by the formula 251-frame_type.
+ */
+ public static final int CHOP_FRAME = 248; // to 250 (f8-fA)
+
+ /**
+ * Frame has exactly the same locals as the previous stack map frame and
+ * number of stack items is zero. Offset is bigger then 63;
+ */
+ public static final int SAME_FRAME_EXTENDED = 251; // fb
+
+ /**
+ * Frame where current locals are the same as the locals in the previous
+ * frame, except that k additional locals are defined. The value of k is
+ * given by the formula frame_type-251.
+ */
+ public static final int APPEND_FRAME = 252; // to 254 // fc-fe
+
+ /**
+ * Full frame
+ */
+ public static final int FULL_FRAME = 255; // ff
+
+ private static final int MAX_SHORT = 65535;
+
+ /**
+ * A <code>List</code> of <code>StackMapFrame</code> instances.
+ */
+ private List frames;
+
+ public StackMapTableAttribute() {
+ super("StackMapTable");
+ }
+
+ public StackMapTableAttribute(List frames) {
+ this();
+ this.frames = frames;
+ }
+
+ public List getFrames() {
+ return frames;
+ }
+
+ public StackMapFrame getFrame(Label label) {
+ for (int i = 0; i < frames.size(); i++) {
+ StackMapFrame frame = (StackMapFrame) frames.get(i);
+ if (frame.label == label) {
+ return frame;
+ }
+ }
+ return null;
+ }
+
+ public boolean isUnknown() {
+ return false;
+ }
+
+ public boolean isCodeAttribute() {
+ return true;
+ }
+
+ protected Attribute read(
+ ClassReader cr,
+ int off,
+ int len,
+ char[] buf,
+ int codeOff,
+ Label[] labels)
+ {
+
+ ArrayList frames = new ArrayList();
+
+ // note that this is not the size of Code attribute
+ boolean isExtCodeSize = cr.readInt(codeOff + 4) > MAX_SHORT;
+ boolean isExtLocals = cr.readUnsignedShort(codeOff + 2) > MAX_SHORT;
+ boolean isExtStack = cr.readUnsignedShort(codeOff) > MAX_SHORT;
+
+ int offset = 0;
+
+ int methodOff = getMethodOff(cr, codeOff, buf);
+ StackMapFrame frame = new StackMapFrame(getLabel(offset, labels),
+ calculateLocals(cr.readClass(cr.header + 2, buf), // owner
+ cr.readUnsignedShort(methodOff), // method access
+ cr.readUTF8(methodOff + 2, buf), // method name
+ cr.readUTF8(methodOff + 4, buf)), // method desc
+ Collections.EMPTY_LIST);
+ frames.add(frame);
+
+ // System.err.println( cr.readUTF8( methodOff + 2, buf));
+ // System.err.println( offset +" delta:" + 0 +" : "+ frame);
+
+ int size;
+ if (isExtCodeSize) {
+ size = cr.readInt(off);
+ off += 4;
+ } else {
+ size = cr.readUnsignedShort(off);
+ off += 2;
+ }
+
+ for (; size > 0; size--) {
+ int tag = cr.readByte(off); // & 0xff;
+ off++;
+
+ List stack;
+ List locals;
+
+ int offsetDelta;
+ if (tag < SAME_LOCALS_1_STACK_ITEM_FRAME) { // SAME_FRAME
+ offsetDelta = tag;
+
+ locals = new ArrayList(frame.locals);
+ stack = Collections.EMPTY_LIST;
+
+ } else if (tag < RESERVED) { // SAME_LOCALS_1_STACK_ITEM_FRAME
+ offsetDelta = tag - SAME_LOCALS_1_STACK_ITEM_FRAME;
+
+ locals = new ArrayList(frame.locals);
+ stack = new ArrayList();
+ // read verification_type_info stack[1];
+ off = readType(stack, isExtCodeSize, cr, off, labels, buf);
+
+ } else {
+ if (isExtCodeSize) {
+ offsetDelta = cr.readInt(off);
+ off += 4;
+ } else {
+ offsetDelta = cr.readUnsignedShort(off);
+ off += 2;
+ }
+
+ if (tag == SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) { // SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED
+ locals = new ArrayList(frame.locals);
+ stack = new ArrayList();
+ // read verification_type_info stack[1];
+ off = readType(stack, isExtCodeSize, cr, off, labels, buf);
+
+ } else if (tag >= CHOP_FRAME && tag < SAME_FRAME_EXTENDED) { // CHOP_FRAME
+ stack = Collections.EMPTY_LIST;
+
+ int k = SAME_FRAME_EXTENDED - tag;
+ // copy locals from prev frame and chop last k
+ locals = new ArrayList(frame.locals.subList(0,
+ frame.locals.size() - k));
+
+ } else if (tag == SAME_FRAME_EXTENDED) { // SAME_FRAME_EXTENDED
+ stack = Collections.EMPTY_LIST;
+ locals = new ArrayList(frame.locals);
+
+ } else if ( /* tag>=APPEND && */tag < FULL_FRAME) { // APPEND_FRAME
+ stack = Collections.EMPTY_LIST;
+
+ // copy locals from prev frame and append new k
+ locals = new ArrayList(frame.locals);
+ for (int k = tag - SAME_FRAME_EXTENDED; k > 0; k--) {
+ off = readType(locals,
+ isExtCodeSize,
+ cr,
+ off,
+ labels,
+ buf);
+ }
+
+ } else if (tag == FULL_FRAME) { // FULL_FRAME
+ // read verification_type_info locals[number_of_locals];
+ locals = new ArrayList();
+ off = readTypes(locals,
+ isExtLocals,
+ isExtCodeSize,
+ cr,
+ off,
+ labels,
+ buf);
+
+ // read verification_type_info stack[number_of_stack_items];
+ stack = new ArrayList();
+ off = readTypes(stack,
+ isExtStack,
+ isExtCodeSize,
+ cr,
+ off,
+ labels,
+ buf);
+
+ } else {
+ throw new RuntimeException("Unknown frame type " + tag
+ + " after offset " + offset);
+
+ }
+ }
+
+ offset += offsetDelta;
+
+ Label offsetLabel = getLabel(offset, labels);
+
+ frame = new StackMapFrame(offsetLabel, locals, stack);
+ frames.add(frame);
+ // System.err.println( tag +" " + offset +" delta:" + offsetDelta +
+ // " frameType:"+ frameType+" : "+ frame);
+
+ offset++;
+ }
+
+ return new StackMapTableAttribute(frames);
+ }
+
+ protected ByteVector write(
+ ClassWriter cw,
+ byte[] code,
+ int len,
+ int maxStack,
+ int maxLocals)
+ {
+ ByteVector bv = new ByteVector();
+ // TODO verify this value (MAX_SHORT)
+ boolean isExtCodeSize = code != null && code.length > MAX_SHORT;
+ writeSize(frames.size() - 1, bv, isExtCodeSize);
+
+ if (frames.size() < 2) {
+ return bv;
+ }
+
+ boolean isExtLocals = maxLocals > MAX_SHORT;
+ boolean isExtStack = maxStack > MAX_SHORT;
+
+ // skip the first frame
+ StackMapFrame frame = (StackMapFrame) frames.get(0);
+ List locals = frame.locals;
+ int offset = frame.label.getOffset();
+
+ for (int i = 1; i < frames.size(); i++) {
+ frame = (StackMapFrame) frames.get(i);
+
+ List clocals = frame.locals;
+ List cstack = frame.stack;
+ int coffset = frame.label.getOffset();
+
+ int clocalsSize = clocals.size();
+ int cstackSize = cstack.size();
+
+ int localsSize = locals.size();
+
+ int delta = coffset - offset;
+
+ int type = FULL_FRAME;
+ int k = 0;
+ if (cstackSize == 0) {
+ k = clocalsSize - localsSize;
+ switch (k) {
+ case -3:
+ case -2:
+ case -1:
+ type = CHOP_FRAME; // CHOP or FULL
+ localsSize = clocalsSize; // for full_frame check
+ break;
+
+ case 0:
+ // SAME, SAME_EXTENDED or FULL
+ type = delta < 64 ? SAME_FRAME : SAME_FRAME_EXTENDED;
+ break;
+
+ case 1:
+ case 2:
+ case 3:
+ type = APPEND_FRAME; // APPEND or FULL
+ break;
+ }
+ } else if (localsSize == clocalsSize && cstackSize == 1) {
+ // SAME_LOCAL_1_STACK or FULL
+ type = delta < 63
+ ? SAME_LOCALS_1_STACK_ITEM_FRAME
+ : SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED;
+ }
+
+ if (type != FULL_FRAME) {
+ // verify if stack and locals are the same
+ for (int j = 0; j < localsSize && type != FULL_FRAME; j++) {
+ if (!locals.get(j).equals(clocals.get(j)))
+ type = FULL_FRAME;
+ }
+ }
+
+ switch (type) {
+ case SAME_FRAME:
+ bv.putByte(delta);
+ break;
+
+ case SAME_LOCALS_1_STACK_ITEM_FRAME:
+ bv.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME + delta);
+ writeTypeInfos(bv, cw, cstack, 0, 1);
+ break;
+
+ case SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED:
+ bv.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED);
+ writeSize(delta, bv, isExtCodeSize);
+ writeTypeInfos(bv, cw, cstack, 0, 1);
+ break;
+
+ case SAME_FRAME_EXTENDED:
+ bv.putByte(SAME_FRAME_EXTENDED);
+ writeSize(delta, bv, isExtCodeSize);
+ break;
+
+ case CHOP_FRAME:
+ bv.putByte(SAME_FRAME_EXTENDED + k); // negative k
+ writeSize(delta, bv, isExtCodeSize);
+ break;
+
+ case APPEND_FRAME:
+ bv.putByte(SAME_FRAME_EXTENDED + k); // positive k
+ writeSize(delta, bv, isExtCodeSize);
+ writeTypeInfos(bv,
+ cw,
+ clocals,
+ clocalsSize - 1,
+ clocalsSize);
+ break;
+
+ case FULL_FRAME:
+ bv.putByte(FULL_FRAME);
+ writeSize(delta, bv, isExtCodeSize);
+ writeSize(clocalsSize, bv, isExtLocals);
+ writeTypeInfos(bv, cw, clocals, 0, clocalsSize);
+ writeSize(cstackSize, bv, isExtStack);
+ writeTypeInfos(bv, cw, cstack, 0, cstackSize);
+ break;
+
+ default:
+ throw new RuntimeException();
+ }
+ offset = coffset + 1; // compensating non first offset
+ locals = clocals;
+ }
+ return bv;
+ }
+
+ private void writeSize(int delta, ByteVector bv, boolean isExt) {
+ if (isExt) {
+ bv.putInt(delta);
+ } else {
+ bv.putShort(delta);
+ }
+ }
+
+ private void writeTypeInfos(
+ ByteVector bv,
+ ClassWriter cw,
+ List info,
+ int start,
+ int end)
+ {
+ for (int j = start; j < end; j++) {
+ StackMapType typeInfo = (StackMapType) info.get(j);
+ bv.putByte(typeInfo.getType());
+
+ switch (typeInfo.getType()) {
+ case StackMapType.ITEM_Object: //
+ bv.putShort(cw.newClass(typeInfo.getObject()));
+ break;
+
+ case StackMapType.ITEM_Uninitialized: //
+ bv.putShort(typeInfo.getLabel().getOffset());
+ break;
+
+ }
+ }
+ }
+
+ public static int getMethodOff(ClassReader cr, int codeOff, char[] buf) {
+ int off = cr.header + 6;
+
+ int interfacesCount = cr.readUnsignedShort(off);
+ off += 2 + interfacesCount * 2;
+
+ int fieldsCount = cr.readUnsignedShort(off);
+ off += 2;
+ for (; fieldsCount > 0; --fieldsCount) {
+ int attrCount = cr.readUnsignedShort(off + 6); // field attributes
+ off += 8;
+ for (; attrCount > 0; --attrCount) {
+ off += 6 + cr.readInt(off + 2);
+ }
+ }
+
+ int methodsCount = cr.readUnsignedShort(off);
+ off += 2;
+ for (; methodsCount > 0; --methodsCount) {
+ int methodOff = off;
+ int attrCount = cr.readUnsignedShort(off + 6); // method attributes
+ off += 8;
+ for (; attrCount > 0; --attrCount) {
+ String attrName = cr.readUTF8(off, buf);
+ off += 6;
+ if (attrName.equals("Code")) {
+ if (codeOff == off) {
+ return methodOff;
+ }
+ }
+ off += cr.readInt(off - 4);
+ }
+ }
+
+ return -1;
+ }
+
+ /**
+ * Use method signature and access flags to resolve initial locals state.
+ *
+ * @param className name of the method's owner class.
+ * @param access access flags of the method.
+ * @param methodName name of the method.
+ * @param methodDesc descriptor of the method.
+ * @return list of <code>StackMapType</code> instances representing locals
+ * for an initial frame.
+ */
+ public static List calculateLocals(
+ String className,
+ int access,
+ String methodName,
+ String methodDesc)
+ {
+ List locals = new ArrayList();
+
+ // TODO
+ if ("<init>".equals(methodName)
+ && !className.equals("java/lang/Object"))
+ {
+ StackMapType typeInfo = StackMapType.getTypeInfo(StackMapType.ITEM_UninitializedThis);
+ typeInfo.setObject(className); // this
+ locals.add(typeInfo);
+ } else if ((access & Opcodes.ACC_STATIC) == 0) {
+ StackMapType typeInfo = StackMapType.getTypeInfo(StackMapType.ITEM_Object);
+ typeInfo.setObject(className); // this
+ locals.add(typeInfo);
+ }
+
+ Type[] types = Type.getArgumentTypes(methodDesc);
+ for (int i = 0; i < types.length; i++) {
+ Type t = types[i];
+ StackMapType smt;
+ switch (t.getSort()) {
+ case Type.LONG:
+ smt = StackMapType.getTypeInfo(StackMapType.ITEM_Long);
+ break;
+ case Type.DOUBLE:
+ smt = StackMapType.getTypeInfo(StackMapType.ITEM_Double);
+ break;
+
+ case Type.FLOAT:
+ smt = StackMapType.getTypeInfo(StackMapType.ITEM_Float);
+ break;
+
+ case Type.ARRAY:
+ case Type.OBJECT:
+ smt = StackMapType.getTypeInfo(StackMapType.ITEM_Object);
+ smt.setObject(t.getDescriptor()); // TODO verify name
+ break;
+
+ default:
+ smt = StackMapType.getTypeInfo(StackMapType.ITEM_Integer);
+ break;
+ }
+ }
+
+ return locals;
+ }
+
+ private int readTypes(
+ List info,
+ boolean isExt,
+ boolean isExtCodeSize,
+ ClassReader cr,
+ int off,
+ Label[] labels,
+ char[] buf)
+ {
+ int n = 0;
+ if (isExt) {
+ n = cr.readInt(off);
+ off += 4;
+ } else {
+ n = cr.readUnsignedShort(off);
+ off += 2;
+ }
+
+ for (; n > 0; n--) {
+ off = readType(info, isExtCodeSize, cr, off, labels, buf);
+ }
+ return off;
+ }
+
+ private int readType(
+ List info,
+ boolean isExtCodeSize,
+ ClassReader cr,
+ int off,
+ Label[] labels,
+ char[] buf)
+ {
+ int itemType = cr.readByte(off++);
+ StackMapType typeInfo = StackMapType.getTypeInfo(itemType);
+ info.add(typeInfo);
+ switch (itemType) {
+ // case StackMapType.ITEM_Long: //
+ // case StackMapType.ITEM_Double: //
+ // info.add(StackMapType.getTypeInfo(StackMapType.ITEM_Top));
+ // break;
+
+ case StackMapType.ITEM_Object: //
+ typeInfo.setObject(cr.readClass(off, buf));
+ off += 2;
+ break;
+
+ case StackMapType.ITEM_Uninitialized: //
+ int offset;
+ if (isExtCodeSize) {
+ offset = cr.readInt(off);
+ off += 4;
+ } else {
+ offset = cr.readUnsignedShort(off);
+ off += 2;
+ }
+
+ typeInfo.setLabel(getLabel(offset, labels));
+ break;
+ }
+ return off;
+ }
+
+ private Label getLabel(int offset, Label[] labels) {
+ Label l = labels[offset];
+ if (l != null) {
+ return l;
+ }
+ return labels[offset] = new Label();
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer("StackMapTable[");
+ for (int i = 0; i < frames.size(); i++) {
+ sb.append('\n').append('[').append(frames.get(i)).append(']');
+ }
+ sb.append("\n]");
+ return sb.toString();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapType.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapType.java
new file mode 100644
index 00000000000..ae3b8cee7e4
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/StackMapType.java
@@ -0,0 +1,114 @@
+/**
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.objectweb.asm.attrs;
+
+import org.objectweb.asm.Label;
+
+/**
+ * Verification type info used by {@link StackMapAttribute}.
+ *
+ * @see <a href="http://www.jcp.org/en/jsr/detail?id=139">JSR 139 : Connected
+ * Limited Device Configuration 1.1</a>
+ *
+ * @see "ClassFileFormat-Java6.fm Page 138 Friday, April 15, 2005 3:22 PM"
+ *
+ * @author Eugene Kuleshov
+ */
+
+public class StackMapType {
+
+ public static final int ITEM_Top = 0;
+ public static final int ITEM_Integer = 1;
+ public static final int ITEM_Float = 2;
+ public static final int ITEM_Double = 3;
+ public static final int ITEM_Long = 4;
+ public static final int ITEM_Null = 5;
+ public static final int ITEM_UninitializedThis = 6;
+ public static final int ITEM_Object = 7;
+ public static final int ITEM_Uninitialized = 8;
+
+ public static final String[] ITEM_NAMES = {
+ "Top",
+ "Integer",
+ "Float",
+ "Double",
+ "Long",
+ "Null",
+ "UninitializedThis",
+ "Object",
+ "Uninitialized" };
+
+ private int type;
+ private Label offset;
+ private String object;
+
+ private StackMapType(int type) {
+ this.type = type;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public static StackMapType getTypeInfo(int itemType) {
+ if (itemType < ITEM_Top || itemType > ITEM_Uninitialized) {
+ throw new IllegalArgumentException("" + itemType);
+ }
+ return new StackMapType(itemType);
+ }
+
+ public void setLabel(Label offset) {
+ this.offset = offset;
+ }
+
+ public void setObject(String object) {
+ this.object = object;
+ }
+
+ public Label getLabel() {
+ return offset;
+ }
+
+ public String getObject() {
+ return object;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer(ITEM_NAMES[type]);
+ if (type == ITEM_Object) {
+ sb.append(":").append(object);
+ }
+ if (type == ITEM_Uninitialized) {
+ sb.append(":L").append(System.identityHashCode(offset));
+ }
+ return sb.toString();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/package.html b/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/package.html
new file mode 100644
index 00000000000..51f0a02e8d3
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/attrs/package.html
@@ -0,0 +1,48 @@
+<html>
+<!--
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<body>
+Provides an implementation for optional class, field and method attributes.
+
+<p>
+
+By default ASM strips optional attributes, in order to keep them in
+the bytecode that is being readed you should pass an array of required attribute
+instances to {@link org.objectweb.asm.ClassReader#accept(org.objectweb.asm.ClassVisitor, org.objectweb.asm.Attribute[], boolean) ClassReader.accept()} method.
+In order to add custom attributes to the manually constructed bytecode concrete
+subclasses of the {@link org.objectweb.asm.Attribute Attribute} can be passed to
+the visitAttribute methods of the
+{@link org.objectweb.asm.ClassVisitor ClassVisitor},
+{@link org.objectweb.asm.FieldVisitor FieldVisitor} and
+{@link org.objectweb.asm.MethodVisitor MethodVisitor} interfaces.
+
+@since ASM 1.4.1
+</body>
+</html>
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/AdviceAdapter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/AdviceAdapter.java
new file mode 100644
index 00000000000..141c8e2113c
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/AdviceAdapter.java
@@ -0,0 +1,643 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.commons;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+
+/**
+ * A <code>MethodAdapter</code> to dispatch method body instruction
+ * <p>
+ * The behavior is like this:
+ * <ol>
+ *
+ * <li>as long as the INVOKESPECIAL for the object initialization has not been
+ * reached, every bytecode instruction is dispatched in the ctor code visitor</li>
+ *
+ * <li>when this one is reached, it is only added in the ctor code visitor and
+ * a JP invoke is added</li>
+ * <li>after that, only the other code visitor receives the instructions</li>
+ *
+ * </ol>
+ *
+ * @author Eugene Kuleshov
+ * @author Eric Bruneton
+ */
+public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes {
+ private static final Object THIS = new Object();
+ private static final Object OTHER = new Object();
+
+ protected int methodAccess;
+ protected String methodDesc;
+
+ private boolean constructor;
+ private boolean superInitialized;
+ private ArrayList stackFrame;
+ private HashMap branches;
+
+
+ /**
+ * Creates a new {@link AdviceAdapter}.
+ *
+ * @param mv the method visitor to which this adapter delegates calls.
+ * @param access the method's access flags (see {@link Opcodes}).
+ * @param name the method's name.
+ * @param desc the method's descriptor (see {@link Type Type}).
+ */
+ public AdviceAdapter(MethodVisitor mv, int access, String name, String desc) {
+ super(mv, access, name, desc);
+ methodAccess = access;
+ methodDesc = desc;
+
+ constructor = "<init>".equals(name);
+ if (!constructor) {
+ superInitialized = true;
+ onMethodEnter();
+ } else {
+ stackFrame = new ArrayList();
+ branches = new HashMap();
+ }
+ }
+
+ public void visitLabel(Label label) {
+ mv.visitLabel(label);
+
+ if (constructor && branches != null) {
+ ArrayList frame = (ArrayList) branches.get(label);
+ if (frame != null) {
+ stackFrame = frame;
+ branches.remove(label);
+ }
+ }
+ }
+
+ public void visitInsn(int opcode) {
+ if (constructor) {
+ switch (opcode) {
+ case RETURN: // empty stack
+ onMethodExit(opcode);
+ break;
+
+ case IRETURN: // 1 before n/a after
+ case FRETURN: // 1 before n/a after
+ case ARETURN: // 1 before n/a after
+ case ATHROW: // 1 before n/a after
+ popValue();
+ popValue();
+ onMethodExit(opcode);
+ break;
+
+ case LRETURN: // 2 before n/a after
+ case DRETURN: // 2 before n/a after
+ popValue();
+ popValue();
+ onMethodExit(opcode);
+ break;
+
+ case NOP:
+ case LALOAD: // remove 2 add 2
+ case DALOAD: // remove 2 add 2
+ case LNEG:
+ case DNEG:
+ case FNEG:
+ case INEG:
+ case L2D:
+ case D2L:
+ case F2I:
+ case I2B:
+ case I2C:
+ case I2S:
+ case I2F:
+ case Opcodes.ARRAYLENGTH:
+ break;
+
+ case ACONST_NULL:
+ case ICONST_M1:
+ case ICONST_0:
+ case ICONST_1:
+ case ICONST_2:
+ case ICONST_3:
+ case ICONST_4:
+ case ICONST_5:
+ case FCONST_0:
+ case FCONST_1:
+ case FCONST_2:
+ case F2L: // 1 before 2 after
+ case F2D:
+ case I2L:
+ case I2D:
+ pushValue(OTHER);
+ break;
+
+ case LCONST_0:
+ case LCONST_1:
+ case DCONST_0:
+ case DCONST_1:
+ pushValue(OTHER);
+ pushValue(OTHER);
+ break;
+
+ case IALOAD: // remove 2 add 1
+ case FALOAD: // remove 2 add 1
+ case AALOAD: // remove 2 add 1
+ case BALOAD: // remove 2 add 1
+ case CALOAD: // remove 2 add 1
+ case SALOAD: // remove 2 add 1
+ case POP:
+ case IADD:
+ case FADD:
+ case ISUB:
+ case LSHL: // 3 before 2 after
+ case LSHR: // 3 before 2 after
+ case LUSHR: // 3 before 2 after
+ case L2I: // 2 before 1 after
+ case L2F: // 2 before 1 after
+ case D2I: // 2 before 1 after
+ case D2F: // 2 before 1 after
+ case FSUB:
+ case FMUL:
+ case FDIV:
+ case FREM:
+ case FCMPL: // 2 before 1 after
+ case FCMPG: // 2 before 1 after
+ case IMUL:
+ case IDIV:
+ case IREM:
+ case ISHL:
+ case ISHR:
+ case IUSHR:
+ case IAND:
+ case IOR:
+ case IXOR:
+ case MONITORENTER:
+ case MONITOREXIT:
+ popValue();
+ break;
+
+ case POP2:
+ case LSUB:
+ case LMUL:
+ case LDIV:
+ case LREM:
+ case LADD:
+ case LAND:
+ case LOR:
+ case LXOR:
+ case DADD:
+ case DMUL:
+ case DSUB:
+ case DDIV:
+ case DREM:
+ popValue();
+ popValue();
+ break;
+
+ case IASTORE:
+ case FASTORE:
+ case AASTORE:
+ case BASTORE:
+ case CASTORE:
+ case SASTORE:
+ case LCMP: // 4 before 1 after
+ case DCMPL:
+ case DCMPG:
+ popValue();
+ popValue();
+ popValue();
+ break;
+
+ case LASTORE:
+ case DASTORE:
+ popValue();
+ popValue();
+ popValue();
+ popValue();
+ break;
+
+ case DUP:
+ pushValue(peekValue());
+ break;
+
+ case DUP_X1:
+ // TODO optimize this
+ {
+ Object o1 = popValue();
+ Object o2 = popValue();
+ pushValue(o1);
+ pushValue(o2);
+ pushValue(o1);
+ }
+ break;
+
+ case DUP_X2:
+ // TODO optimize this
+ {
+ Object o1 = popValue();
+ Object o2 = popValue();
+ Object o3 = popValue();
+ pushValue(o1);
+ pushValue(o3);
+ pushValue(o2);
+ pushValue(o1);
+ }
+ break;
+
+ case DUP2:
+ // TODO optimize this
+ {
+ Object o1 = popValue();
+ Object o2 = popValue();
+ pushValue(o2);
+ pushValue(o1);
+ pushValue(o2);
+ pushValue(o1);
+ }
+ break;
+
+ case DUP2_X1:
+ // TODO optimize this
+ {
+ Object o1 = popValue();
+ Object o2 = popValue();
+ Object o3 = popValue();
+ pushValue(o2);
+ pushValue(o1);
+ pushValue(o3);
+ pushValue(o2);
+ pushValue(o1);
+ }
+ break;
+
+ case DUP2_X2:
+ // TODO optimize this
+ {
+ Object o1 = popValue();
+ Object o2 = popValue();
+ Object o3 = popValue();
+ Object o4 = popValue();
+ pushValue(o2);
+ pushValue(o1);
+ pushValue(o4);
+ pushValue(o3);
+ pushValue(o2);
+ pushValue(o1);
+ }
+ break;
+
+ case SWAP: {
+ Object o1 = popValue();
+ Object o2 = popValue();
+ pushValue(o1);
+ pushValue(o2);
+ }
+ break;
+ }
+ } else {
+ switch (opcode) {
+ case RETURN:
+ case IRETURN:
+ case FRETURN:
+ case ARETURN:
+ case LRETURN:
+ case DRETURN:
+ case ATHROW:
+ onMethodExit(opcode);
+ break;
+ }
+ }
+ mv.visitInsn(opcode);
+ }
+
+ public void visitVarInsn(int opcode, int var) {
+ super.visitVarInsn(opcode, var);
+
+ if (constructor) {
+ switch (opcode) {
+ case ILOAD:
+ case FLOAD:
+ pushValue(OTHER);
+ break;
+ case LLOAD:
+ case DLOAD:
+ pushValue(OTHER);
+ pushValue(OTHER);
+ break;
+ case ALOAD:
+ pushValue(var == 0 ? THIS : OTHER);
+ break;
+ case ASTORE:
+ case ISTORE:
+ case FSTORE:
+ popValue();
+ break;
+ case LSTORE:
+ case DSTORE:
+ popValue();
+ popValue();
+ break;
+ }
+ }
+ }
+
+ public void visitFieldInsn(
+ int opcode,
+ String owner,
+ String name,
+ String desc)
+ {
+ mv.visitFieldInsn(opcode, owner, name, desc);
+
+ if (constructor) {
+ char c = desc.charAt(0);
+ boolean longOrDouble = c == 'J' || c == 'D';
+ switch (opcode) {
+ case GETSTATIC:
+ pushValue(OTHER);
+ if (longOrDouble) {
+ pushValue(OTHER);
+ }
+ break;
+ case PUTSTATIC:
+ popValue();
+ if(longOrDouble) {
+ popValue();
+ }
+ break;
+ case PUTFIELD:
+ popValue();
+ if(longOrDouble) {
+ popValue();
+ popValue();
+ }
+ break;
+ // case GETFIELD:
+ default:
+ if (longOrDouble) {
+ pushValue(OTHER);
+ }
+ }
+ }
+ }
+
+ public void visitIntInsn(int opcode, int operand) {
+ mv.visitIntInsn(opcode, operand);
+
+ if (constructor) {
+ switch (opcode) {
+ case BIPUSH:
+ case SIPUSH:
+ pushValue(OTHER);
+ }
+ }
+ }
+
+ public void visitLdcInsn(Object cst) {
+ mv.visitLdcInsn(cst);
+
+ if (constructor) {
+ pushValue(OTHER);
+ if (cst instanceof Double || cst instanceof Long) {
+ pushValue(OTHER);
+ }
+ }
+ }
+
+ public void visitMultiANewArrayInsn(String desc, int dims) {
+ mv.visitMultiANewArrayInsn(desc, dims);
+
+ if (constructor) {
+ for (int i = 0; i < dims; i++) {
+ popValue();
+ }
+ pushValue(OTHER);
+ }
+ }
+
+ public void visitTypeInsn(int opcode, String name) {
+ mv.visitTypeInsn(opcode, name);
+
+ // ANEWARRAY, CHECKCAST or INSTANCEOF don't change stack
+ if (constructor && opcode == NEW) {
+ pushValue(OTHER);
+ }
+ }
+
+ public void visitMethodInsn(
+ int opcode,
+ String owner,
+ String name,
+ String desc)
+ {
+ mv.visitMethodInsn(opcode, owner, name, desc);
+
+ if (constructor) {
+ Type[] types = Type.getArgumentTypes(desc);
+ for (int i = 0; i < types.length; i++) {
+ popValue();
+ if (types[i].getSize() == 2) {
+ popValue();
+ }
+ }
+ switch (opcode) {
+ // case INVOKESTATIC:
+ // break;
+
+ case INVOKEINTERFACE:
+ case INVOKEVIRTUAL:
+ popValue(); // objectref
+ break;
+
+ case INVOKESPECIAL:
+ Object type = popValue(); // objectref
+ if (type == THIS && !superInitialized) {
+ onMethodEnter();
+ superInitialized = true;
+ // once super has been initialized it is no longer
+ // necessary to keep track of stack state
+ constructor = false;
+ }
+ break;
+ }
+
+ Type returnType = Type.getReturnType(desc);
+ if (returnType != Type.VOID_TYPE) {
+ pushValue(OTHER);
+ if (returnType.getSize() == 2) {
+ pushValue(OTHER);
+ }
+ }
+ }
+ }
+
+ public void visitJumpInsn(int opcode, Label label) {
+ mv.visitJumpInsn(opcode, label);
+
+ if (constructor) {
+ switch (opcode) {
+ case IFEQ:
+ case IFNE:
+ case IFLT:
+ case IFGE:
+ case IFGT:
+ case IFLE:
+ case IFNULL:
+ case IFNONNULL:
+ popValue();
+ break;
+
+ case IF_ICMPEQ:
+ case IF_ICMPNE:
+ case IF_ICMPLT:
+ case IF_ICMPGE:
+ case IF_ICMPGT:
+ case IF_ICMPLE:
+ case IF_ACMPEQ:
+ case IF_ACMPNE:
+ popValue();
+ popValue();
+ break;
+
+ case JSR:
+ pushValue(OTHER);
+ break;
+ }
+ addBranch(label);
+ }
+ }
+
+ public void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels) {
+ mv.visitLookupSwitchInsn(dflt, keys, labels);
+
+ if (constructor) {
+ popValue();
+ addBranches(dflt, labels);
+ }
+ }
+
+ public void visitTableSwitchInsn(
+ int min,
+ int max,
+ Label dflt,
+ Label[] labels)
+ {
+ mv.visitTableSwitchInsn(min, max, dflt, labels);
+
+ if (constructor) {
+ popValue();
+ addBranches(dflt, labels);
+ }
+ }
+
+ private void addBranches(Label dflt, Label[] labels) {
+ addBranch(dflt);
+ for (int i = 0; i < labels.length; i++) {
+ addBranch(labels[i]);
+ }
+ }
+
+ private void addBranch(Label label) {
+ if (branches.containsKey(label)) {
+ return;
+ }
+ ArrayList frame = new ArrayList();
+ frame.addAll(stackFrame);
+ branches.put(label, frame);
+ }
+
+ private Object popValue() {
+ return stackFrame.remove(stackFrame.size()-1);
+ }
+
+ private Object peekValue() {
+ return stackFrame.get(stackFrame.size()-1);
+ }
+
+ private void pushValue(Object o) {
+ stackFrame.add(o);
+ }
+
+ /**
+ * Called at the beginning of the method or after super
+ * class class call in the constructor.
+ * <br><br>
+ *
+ * <i>Custom code can use or change all the local variables,
+ * but should not change state of the stack.</i>
+ */
+ protected abstract void onMethodEnter();
+
+ /**
+ * Called before explicit exit from the method using either
+ * return or throw. Top element on the stack contains the
+ * return value or exception instance. For example:
+ *
+ * <pre>
+ * public void onMethodExit(int opcode) {
+ * if(opcode==RETURN) {
+ * visitInsn(ACONST_NULL);
+ * } else if(opcode==ARETURN || opcode==ATHROW) {
+ * dup();
+ * } else {
+ * if(opcode==LRETURN || opcode==DRETURN) {
+ * dup2();
+ * } else {
+ * dup();
+ * }
+ * box(Type.getReturnType(this.methodDesc));
+ * }
+ * visitIntInsn(SIPUSH, opcode);
+ * visitMethodInsn(INVOKESTATIC, owner, "onExit", "(Ljava/lang/Object;I)V");
+ * }
+ *
+ * // an actual call back method
+ * public static void onExit(int opcode, Object param) {
+ * ...
+ * </pre>
+ *
+ * <br><br>
+ *
+ * <i>Custom code can use or change all the local variables,
+ * but should not change state of the stack.</i>
+ *
+ * @param opcode one of the RETURN, IRETURN, FRETURN,
+ * ARETURN, LRETURN, DRETURN or ATHROW
+ *
+ */
+ protected abstract void onMethodExit(int opcode);
+
+ // TODO onException, onMethodCall
+
+}
+
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/EmptyVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/EmptyVisitor.java
new file mode 100644
index 00000000000..de7cdc4bf64
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/EmptyVisitor.java
@@ -0,0 +1,211 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.commons;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * An empty implementation of the ASM visitor interfaces.
+ *
+ * @author Eric Bruneton
+ */
+public class EmptyVisitor implements
+ ClassVisitor,
+ FieldVisitor,
+ MethodVisitor,
+ AnnotationVisitor
+{
+
+ public void visit(
+ int version,
+ int access,
+ String name,
+ String signature,
+ String superName,
+ String[] interfaces)
+ {
+ }
+
+ public void visitSource(String source, String debug) {
+ }
+
+ public void visitOuterClass(String owner, String name, String desc) {
+ }
+
+ public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+ return this;
+ }
+
+ public void visitAttribute(Attribute attr) {
+ }
+
+ public void visitInnerClass(
+ String name,
+ String outerName,
+ String innerName,
+ int access)
+ {
+ }
+
+ public FieldVisitor visitField(
+ int access,
+ String name,
+ String desc,
+ String signature,
+ Object value)
+ {
+ return this;
+ }
+
+ public MethodVisitor visitMethod(
+ int access,
+ String name,
+ String desc,
+ String signature,
+ String[] exceptions)
+ {
+ return this;
+ }
+
+ public void visitEnd() {
+ }
+
+ public AnnotationVisitor visitAnnotationDefault() {
+ return this;
+ }
+
+ public AnnotationVisitor visitParameterAnnotation(
+ int parameter,
+ String desc,
+ boolean visible)
+ {
+ return this;
+ }
+
+ public void visitCode() {
+ }
+
+ public void visitInsn(int opcode) {
+ }
+
+ public void visitIntInsn(int opcode, int operand) {
+ }
+
+ public void visitVarInsn(int opcode, int var) {
+ }
+
+ public void visitTypeInsn(int opcode, String desc) {
+ }
+
+ public void visitFieldInsn(
+ int opcode,
+ String owner,
+ String name,
+ String desc)
+ {
+ }
+
+ public void visitMethodInsn(
+ int opcode,
+ String owner,
+ String name,
+ String desc)
+ {
+ }
+
+ public void visitJumpInsn(int opcode, Label label) {
+ }
+
+ public void visitLabel(Label label) {
+ }
+
+ public void visitLdcInsn(Object cst) {
+ }
+
+ public void visitIincInsn(int var, int increment) {
+ }
+
+ public void visitTableSwitchInsn(
+ int min,
+ int max,
+ Label dflt,
+ Label labels[])
+ {
+ }
+
+ public void visitLookupSwitchInsn(Label dflt, int keys[], Label labels[]) {
+ }
+
+ public void visitMultiANewArrayInsn(String desc, int dims) {
+ }
+
+ public void visitTryCatchBlock(
+ Label start,
+ Label end,
+ Label handler,
+ String type)
+ {
+ }
+
+ public void visitLocalVariable(
+ String name,
+ String desc,
+ String signature,
+ Label start,
+ Label end,
+ int index)
+ {
+ }
+
+ public void visitLineNumber(int line, Label start) {
+ }
+
+ public void visitMaxs(int maxStack, int maxLocals) {
+ }
+
+ public void visit(String name, Object value) {
+ }
+
+ public void visitEnum(String name, String desc, String value) {
+ }
+
+ public AnnotationVisitor visitAnnotation(String name, String desc) {
+ return this;
+ }
+
+ public AnnotationVisitor visitArray(String name) {
+ return this;
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/GeneratorAdapter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/GeneratorAdapter.java
new file mode 100644
index 00000000000..40b4db57779
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/GeneratorAdapter.java
@@ -0,0 +1,1454 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.commons;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+
+/**
+ * A {@link org.objectweb.asm.MethodAdapter} with convenient methods to generate
+ * code. For example, using this adapter, the class below
+ *
+ * <pre>
+ * public class Example {
+ * public static void main(String[] args) {
+ * System.out.println(&quot;Hello world!&quot;);
+ * }
+ * }
+ * </pre>
+ *
+ * can be generated as follows:
+ *
+ * <pre>
+ * ClassWriter cw = new ClassWriter(true);
+ * cw.visit(V1_1, ACC_PUBLIC, &quot;Example&quot;, null, &quot;java/lang/Object&quot;, null);
+ *
+ * Method m = Method.getMethod(&quot;void &lt;init&gt; ()&quot;);
+ * GeneratorAdapter mg = new GeneratorAdapter(ACC_PUBLIC, m, null, null, cw);
+ * mg.loadThis();
+ * mg.invokeConstructor(Type.getType(Object.class), m);
+ * mg.returnValue();
+ * mg.endMethod();
+ *
+ * m = Method.getMethod(&quot;void main (String[])&quot;);
+ * mg = new GeneratorAdapter(ACC_PUBLIC + ACC_STATIC, m, null, null, cw);
+ * mg.getStatic(Type.getType(System.class), &quot;out&quot;, Type.getType(PrintStream.class));
+ * mg.push(&quot;Hello world!&quot;);
+ * mg.invokeVirtual(Type.getType(PrintStream.class), Method.getMethod(&quot;void println (String)&quot;));
+ * mg.returnValue();
+ * mg.endMethod();
+ *
+ * cw.visitEnd();
+ * </pre>
+ *
+ * @author Juozas Baliuka
+ * @author Chris Nokleberg
+ * @author Eric Bruneton
+ */
+public class GeneratorAdapter extends LocalVariablesSorter {
+
+ private final static Type BYTE_TYPE = Type.getType("Ljava/lang/Byte;");
+
+ private final static Type BOOLEAN_TYPE = Type.getType("Ljava/lang/Boolean;");
+
+ private final static Type SHORT_TYPE = Type.getType("Ljava/lang/Short;");
+
+ private final static Type CHARACTER_TYPE = Type.getType("Ljava/lang/Character;");
+
+ private final static Type INTEGER_TYPE = Type.getType("Ljava/lang/Integer;");
+
+ private final static Type FLOAT_TYPE = Type.getType("Ljava/lang/Float;");
+
+ private final static Type LONG_TYPE = Type.getType("Ljava/lang/Long;");
+
+ private final static Type DOUBLE_TYPE = Type.getType("Ljava/lang/Double;");
+
+ private final static Type NUMBER_TYPE = Type.getType("Ljava/lang/Number;");
+
+ private final static Type OBJECT_TYPE = Type.getType("Ljava/lang/Object;");
+
+ private final static Method BOOLEAN_VALUE = Method.getMethod("boolean booleanValue()");
+
+ private final static Method CHAR_VALUE = Method.getMethod("char charValue()");
+
+ private final static Method INT_VALUE = Method.getMethod("int intValue()");
+
+ private final static Method FLOAT_VALUE = Method.getMethod("float floatValue()");
+
+ private final static Method LONG_VALUE = Method.getMethod("long longValue()");
+
+ private final static Method DOUBLE_VALUE = Method.getMethod("double doubleValue()");
+
+ /**
+ * Constant for the {@link #math math} method.
+ */
+ public final static int ADD = Opcodes.IADD;
+
+ /**
+ * Constant for the {@link #math math} method.
+ */
+ public final static int SUB = Opcodes.ISUB;
+
+ /**
+ * Constant for the {@link #math math} method.
+ */
+ public final static int MUL = Opcodes.IMUL;
+
+ /**
+ * Constant for the {@link #math math} method.
+ */
+ public final static int DIV = Opcodes.IDIV;
+
+ /**
+ * Constant for the {@link #math math} method.
+ */
+ public final static int REM = Opcodes.IREM;
+
+ /**
+ * Constant for the {@link #math math} method.
+ */
+ public final static int NEG = Opcodes.INEG;
+
+ /**
+ * Constant for the {@link #math math} method.
+ */
+ public final static int SHL = Opcodes.ISHL;
+
+ /**
+ * Constant for the {@link #math math} method.
+ */
+ public final static int SHR = Opcodes.ISHR;
+
+ /**
+ * Constant for the {@link #math math} method.
+ */
+ public final static int USHR = Opcodes.IUSHR;
+
+ /**
+ * Constant for the {@link #math math} method.
+ */
+ public final static int AND = Opcodes.IAND;
+
+ /**
+ * Constant for the {@link #math math} method.
+ */
+ public final static int OR = Opcodes.IOR;
+
+ /**
+ * Constant for the {@link #math math} method.
+ */
+ public final static int XOR = Opcodes.IXOR;
+
+ /**
+ * Constant for the {@link #ifCmp ifCmp} method.
+ */
+ public final static int EQ = Opcodes.IFEQ;
+
+ /**
+ * Constant for the {@link #ifCmp ifCmp} method.
+ */
+ public final static int NE = Opcodes.IFNE;
+
+ /**
+ * Constant for the {@link #ifCmp ifCmp} method.
+ */
+ public final static int LT = Opcodes.IFLT;
+
+ /**
+ * Constant for the {@link #ifCmp ifCmp} method.
+ */
+ public final static int GE = Opcodes.IFGE;
+
+ /**
+ * Constant for the {@link #ifCmp ifCmp} method.
+ */
+ public final static int GT = Opcodes.IFGT;
+
+ /**
+ * Constant for the {@link #ifCmp ifCmp} method.
+ */
+ public final static int LE = Opcodes.IFLE;
+
+ /**
+ * Access flags of the method visited by this adapter.
+ */
+ private final int access;
+
+ /**
+ * Return type of the method visited by this adapter.
+ */
+ private final Type returnType;
+
+ /**
+ * Argument types of the method visited by this adapter.
+ */
+ private final Type[] argumentTypes;
+
+ /**
+ * Types of the local variables of the method visited by this adapter.
+ */
+ private final List localTypes;
+
+ /**
+ * Creates a new {@link GeneratorAdapter}.
+ *
+ * @param mv the method visitor to which this adapter delegates calls.
+ * @param access the method's access flags (see {@link Opcodes}).
+ * @param name the method's name.
+ * @param desc the method's descriptor (see {@link Type Type}).
+ */
+ public GeneratorAdapter(
+ MethodVisitor mv,
+ int access,
+ String name,
+ String desc)
+ {
+ super(access, desc, mv);
+ this.access = access;
+ this.returnType = Type.getReturnType(desc);
+ this.argumentTypes = Type.getArgumentTypes(desc);
+ this.localTypes = new ArrayList();
+ }
+
+ /**
+ * Creates a new {@link GeneratorAdapter}.
+ *
+ * @param access access flags of the adapted method.
+ * @param method the adapted method.
+ * @param mv the method visitor to which this adapter delegates calls.
+ */
+ public GeneratorAdapter(
+ final int access,
+ final Method method,
+ final MethodVisitor mv)
+ {
+ super(access, method.getDescriptor(), mv);
+ this.access = access;
+ this.returnType = method.getReturnType();
+ this.argumentTypes = method.getArgumentTypes();
+ this.localTypes = new ArrayList();
+ }
+
+ /**
+ * Creates a new {@link GeneratorAdapter}.
+ *
+ * @param access access flags of the adapted method.
+ * @param method the adapted method.
+ * @param signature the signature of the adapted method (may be
+ * <tt>null</tt>).
+ * @param exceptions the exceptions thrown by the adapted method (may be
+ * <tt>null</tt>).
+ * @param cv the class visitor to which this adapter delegates calls.
+ */
+ public GeneratorAdapter(
+ final int access,
+ final Method method,
+ final String signature,
+ final Type[] exceptions,
+ final ClassVisitor cv)
+ {
+ this(access, method, cv.visitMethod(access,
+ method.getName(),
+ method.getDescriptor(),
+ signature,
+ getInternalNames(exceptions)));
+ }
+
+ /**
+ * Returns the internal names of the given types.
+ *
+ * @param types a set of types.
+ * @return the internal names of the given types.
+ */
+ private static String[] getInternalNames(final Type[] types) {
+ if (types == null) {
+ return null;
+ }
+ String[] names = new String[types.length];
+ for (int i = 0; i < names.length; ++i) {
+ names[i] = types[i].getInternalName();
+ }
+ return names;
+ }
+
+ // ------------------------------------------------------------------------
+ // Instructions to push constants on the stack
+ // ------------------------------------------------------------------------
+
+ /**
+ * Generates the instruction to push the given value on the stack.
+ *
+ * @param value the value to be pushed on the stack.
+ */
+ public void push(final boolean value) {
+ push(value ? 1 : 0);
+ }
+
+ /**
+ * Generates the instruction to push the given value on the stack.
+ *
+ * @param value the value to be pushed on the stack.
+ */
+ public void push(final int value) {
+ if (value >= -1 && value <= 5) {
+ mv.visitInsn(Opcodes.ICONST_0 + value);
+ } else if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) {
+ mv.visitIntInsn(Opcodes.BIPUSH, value);
+ } else if (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE) {
+ mv.visitIntInsn(Opcodes.SIPUSH, value);
+ } else {
+ mv.visitLdcInsn(new Integer(value));
+ }
+ }
+
+ /**
+ * Generates the instruction to push the given value on the stack.
+ *
+ * @param value the value to be pushed on the stack.
+ */
+ public void push(final long value) {
+ if (value == 0L || value == 1L) {
+ mv.visitInsn(Opcodes.LCONST_0 + (int) value);
+ } else {
+ mv.visitLdcInsn(new Long(value));
+ }
+ }
+
+ /**
+ * Generates the instruction to push the given value on the stack.
+ *
+ * @param value the value to be pushed on the stack.
+ */
+ public void push(final float value) {
+ int bits = Float.floatToIntBits(value);
+ if (bits == 0L || bits == 0x3f800000 || bits == 0x40000000) { // 0..2
+ mv.visitInsn(Opcodes.FCONST_0 + (int) value);
+ } else {
+ mv.visitLdcInsn(new Float(value));
+ }
+ }
+
+ /**
+ * Generates the instruction to push the given value on the stack.
+ *
+ * @param value the value to be pushed on the stack.
+ */
+ public void push(final double value) {
+ long bits = Double.doubleToLongBits(value);
+ if (bits == 0L || bits == 0x3ff0000000000000L) { // +0.0d and 1.0d
+ mv.visitInsn(Opcodes.DCONST_0 + (int) value);
+ } else {
+ mv.visitLdcInsn(new Double(value));
+ }
+ }
+
+ /**
+ * Generates the instruction to push the given value on the stack.
+ *
+ * @param value the value to be pushed on the stack. May be <tt>null</tt>.
+ */
+ public void push(final String value) {
+ if (value == null) {
+ mv.visitInsn(Opcodes.ACONST_NULL);
+ } else {
+ mv.visitLdcInsn(value);
+ }
+ }
+
+ /**
+ * Generates the instruction to push the given value on the stack.
+ *
+ * @param value the value to be pushed on the stack.
+ */
+ public void push(final Type value) {
+ if (value == null) {
+ mv.visitInsn(Opcodes.ACONST_NULL);
+ } else {
+ mv.visitLdcInsn(value);
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Instructions to load and store method arguments
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the index of the given method argument in the frame's local
+ * variables array.
+ *
+ * @param arg the index of a method argument.
+ * @return the index of the given method argument in the frame's local
+ * variables array.
+ */
+ private int getArgIndex(final int arg) {
+ int index = ((access & Opcodes.ACC_STATIC) == 0 ? 1 : 0);
+ for (int i = 0; i < arg; i++) {
+ index += argumentTypes[i].getSize();
+ }
+ return index;
+ }
+
+ /**
+ * Generates the instruction to push a local variable on the stack.
+ *
+ * @param type the type of the local variable to be loaded.
+ * @param index an index in the frame's local variables array.
+ */
+ private void loadInsn(final Type type, final int index) {
+ mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), index);
+ }
+
+ /**
+ * Generates the instruction to store the top stack value in a local
+ * variable.
+ *
+ * @param type the type of the local variable to be stored.
+ * @param index an index in the frame's local variables array.
+ */
+ private void storeInsn(final Type type, final int index) {
+ mv.visitVarInsn(type.getOpcode(Opcodes.ISTORE), index);
+ }
+
+ /**
+ * Generates the instruction to load 'this' on the stack.
+ */
+ public void loadThis() {
+ if ((access & Opcodes.ACC_STATIC) != 0) {
+ throw new IllegalStateException("no 'this' pointer within static method");
+ }
+ mv.visitVarInsn(Opcodes.ALOAD, 0);
+ }
+
+ /**
+ * Generates the instruction to load the given method argument on the stack.
+ *
+ * @param arg the index of a method argument.
+ */
+ public void loadArg(final int arg) {
+ loadInsn(argumentTypes[arg], getArgIndex(arg));
+ }
+
+ /**
+ * Generates the instructions to load the given method arguments on the
+ * stack.
+ *
+ * @param arg the index of the first method argument to be loaded.
+ * @param count the number of method arguments to be loaded.
+ */
+ public void loadArgs(final int arg, final int count) {
+ int index = getArgIndex(arg);
+ for (int i = 0; i < count; ++i) {
+ Type t = argumentTypes[arg + i];
+ loadInsn(t, index);
+ index += t.getSize();
+ }
+ }
+
+ /**
+ * Generates the instructions to load all the method arguments on the stack.
+ */
+ public void loadArgs() {
+ loadArgs(0, argumentTypes.length);
+ }
+
+ /**
+ * Generates the instructions to load all the method arguments on the stack,
+ * as a single object array.
+ */
+ public void loadArgArray() {
+ push(argumentTypes.length);
+ newArray(OBJECT_TYPE);
+ for (int i = 0; i < argumentTypes.length; i++) {
+ dup();
+ push(i);
+ loadArg(i);
+ box(argumentTypes[i]);
+ arrayStore(OBJECT_TYPE);
+ }
+ }
+
+ /**
+ * Generates the instruction to store the top stack value in the given
+ * method argument.
+ *
+ * @param arg the index of a method argument.
+ */
+ public void storeArg(final int arg) {
+ storeInsn(argumentTypes[arg], getArgIndex(arg));
+ }
+
+ // ------------------------------------------------------------------------
+ // Instructions to load and store local variables
+ // ------------------------------------------------------------------------
+
+ /**
+ * Creates a new local variable of the given type.
+ *
+ * @param type the type of the local variable to be created.
+ * @return the identifier of the newly created local variable.
+ */
+ public int newLocal(final Type type) {
+ int local = super.newLocal(type.getSize());
+ setLocalType(local, type);
+ return local;
+ }
+
+ /**
+ * Returns the type of the given local variable.
+ *
+ * @param local a local variable identifier, as returned by {@link #newLocal
+ * newLocal}.
+ * @return the type of the given local variable.
+ */
+ public Type getLocalType(final int local) {
+ return (Type) localTypes.get(local - firstLocal);
+ }
+
+ /**
+ * Sets the current type of the given local variable.
+ *
+ * @param local a local variable identifier, as returned by {@link #newLocal
+ * newLocal}.
+ * @param type the type of the value being stored in the local variable
+ */
+ private void setLocalType(final int local, final Type type) {
+ int index = local - firstLocal;
+ while (localTypes.size() < index + 1)
+ localTypes.add(null);
+ localTypes.set(index, type);
+ }
+
+ /**
+ * Generates the instruction to load the given local variable on the stack.
+ *
+ * @param local a local variable identifier, as returned by {@link #newLocal
+ * newLocal}.
+ */
+ public void loadLocal(final int local) {
+ loadInsn(getLocalType(local), local);
+ }
+
+ /**
+ * Generates the instruction to load the given local variable on the stack.
+ *
+ * @param local a local variable identifier, as returned by {@link #newLocal
+ * newLocal}.
+ * @param type the type of this local variable.
+ */
+ public void loadLocal(final int local, final Type type) {
+ setLocalType(local, type);
+ loadInsn(type, local);
+ }
+
+ /**
+ * Generates the instruction to store the top stack value in the given local
+ * variable.
+ *
+ * @param local a local variable identifier, as returned by {@link #newLocal
+ * newLocal}.
+ */
+ public void storeLocal(final int local) {
+ storeInsn(getLocalType(local), local);
+ }
+
+ /**
+ * Generates the instruction to store the top stack value in the given local
+ * variable.
+ *
+ * @param local a local variable identifier, as returned by {@link #newLocal
+ * newLocal}.
+ * @param type the type of this local variable.
+ */
+ public void storeLocal(final int local, final Type type) {
+ setLocalType(local, type);
+ storeInsn(type, local);
+ }
+
+ /**
+ * Generates the instruction to load an element from an array.
+ *
+ * @param type the type of the array element to be loaded.
+ */
+ public void arrayLoad(final Type type) {
+ mv.visitInsn(type.getOpcode(Opcodes.IALOAD));
+ }
+
+ /**
+ * Generates the instruction to store an element in an array.
+ *
+ * @param type the type of the array element to be stored.
+ */
+ public void arrayStore(final Type type) {
+ mv.visitInsn(type.getOpcode(Opcodes.IASTORE));
+ }
+
+ // ------------------------------------------------------------------------
+ // Instructions to manage the stack
+ // ------------------------------------------------------------------------
+
+ /**
+ * Generates a POP instruction.
+ */
+ public void pop() {
+ mv.visitInsn(Opcodes.POP);
+ }
+
+ /**
+ * Generates a POP2 instruction.
+ */
+ public void pop2() {
+ mv.visitInsn(Opcodes.POP2);
+ }
+
+ /**
+ * Generates a DUP instruction.
+ */
+ public void dup() {
+ mv.visitInsn(Opcodes.DUP);
+ }
+
+ /**
+ * Generates a DUP2 instruction.
+ */
+ public void dup2() {
+ mv.visitInsn(Opcodes.DUP2);
+ }
+
+ /**
+ * Generates a DUP_X1 instruction.
+ */
+ public void dupX1() {
+ mv.visitInsn(Opcodes.DUP_X1);
+ }
+
+ /**
+ * Generates a DUP_X2 instruction.
+ */
+ public void dupX2() {
+ mv.visitInsn(Opcodes.DUP_X2);
+ }
+
+ /**
+ * Generates a DUP2_X1 instruction.
+ */
+ public void dup2X1() {
+ mv.visitInsn(Opcodes.DUP2_X1);
+ }
+
+ /**
+ * Generates a DUP2_X2 instruction.
+ */
+ public void dup2X2() {
+ mv.visitInsn(Opcodes.DUP2_X2);
+ }
+
+ /**
+ * Generates a SWAP instruction.
+ */
+ public void swap() {
+ mv.visitInsn(Opcodes.SWAP);
+ }
+
+ /**
+ * Generates the instructions to swap the top two stack values.
+ *
+ * @param prev type of the top - 1 stack value.
+ * @param type type of the top stack value.
+ */
+ public void swap(final Type prev, final Type type) {
+ if (type.getSize() == 1) {
+ if (prev.getSize() == 1) {
+ swap(); // same as dupX1(), pop();
+ } else {
+ dupX2();
+ pop();
+ }
+ } else {
+ if (prev.getSize() == 1) {
+ dup2X1();
+ pop2();
+ } else {
+ dup2X2();
+ pop2();
+ }
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Instructions to do mathematical and logical operations
+ // ------------------------------------------------------------------------
+
+ /**
+ * Generates the instruction to do the specified mathematical or logical
+ * operation.
+ *
+ * @param op a mathematical or logical operation. Must be one of ADD, SUB,
+ * MUL, DIV, REM, NEG, SHL, SHR, USHR, AND, OR, XOR.
+ * @param type the type of the operand(s) for this operation.
+ */
+ public void math(final int op, final Type type) {
+ mv.visitInsn(type.getOpcode(op));
+ }
+
+ /**
+ * Generates the instructions to compute the bitwise negation of the top
+ * stack value.
+ */
+ public void not() {
+ mv.visitInsn(Opcodes.ICONST_1);
+ mv.visitInsn(Opcodes.IXOR);
+ }
+
+ /**
+ * Generates the instruction to increment the given local variable.
+ *
+ * @param local the local variable to be incremented.
+ * @param amount the amount by which the local variable must be incremented.
+ */
+ public void iinc(final int local, final int amount) {
+ mv.visitIincInsn(local, amount);
+ }
+
+ /**
+ * Generates the instructions to cast a numerical value from one type to
+ * another.
+ *
+ * @param from the type of the top stack value
+ * @param to the type into which this value must be cast.
+ */
+ public void cast(final Type from, final Type to) {
+ if (from != to) {
+ if (from == Type.DOUBLE_TYPE) {
+ if (to == Type.FLOAT_TYPE) {
+ mv.visitInsn(Opcodes.D2F);
+ } else if (to == Type.LONG_TYPE) {
+ mv.visitInsn(Opcodes.D2L);
+ } else {
+ mv.visitInsn(Opcodes.D2I);
+ cast(Type.INT_TYPE, to);
+ }
+ } else if (from == Type.FLOAT_TYPE) {
+ if (to == Type.DOUBLE_TYPE) {
+ mv.visitInsn(Opcodes.F2D);
+ } else if (to == Type.LONG_TYPE) {
+ mv.visitInsn(Opcodes.F2L);
+ } else {
+ mv.visitInsn(Opcodes.F2I);
+ cast(Type.INT_TYPE, to);
+ }
+ } else if (from == Type.LONG_TYPE) {
+ if (to == Type.DOUBLE_TYPE) {
+ mv.visitInsn(Opcodes.L2D);
+ } else if (to == Type.FLOAT_TYPE) {
+ mv.visitInsn(Opcodes.L2F);
+ } else {
+ mv.visitInsn(Opcodes.L2I);
+ cast(Type.INT_TYPE, to);
+ }
+ } else {
+ if (to == Type.BYTE_TYPE) {
+ mv.visitInsn(Opcodes.I2B);
+ } else if (to == Type.CHAR_TYPE) {
+ mv.visitInsn(Opcodes.I2C);
+ } else if (to == Type.DOUBLE_TYPE) {
+ mv.visitInsn(Opcodes.I2D);
+ } else if (to == Type.FLOAT_TYPE) {
+ mv.visitInsn(Opcodes.I2F);
+ } else if (to == Type.LONG_TYPE) {
+ mv.visitInsn(Opcodes.I2L);
+ } else if (to == Type.SHORT_TYPE) {
+ mv.visitInsn(Opcodes.I2S);
+ }
+ }
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Instructions to do boxing and unboxing operations
+ // ------------------------------------------------------------------------
+
+ /**
+ * Generates the instructions to box the top stack value. This value is
+ * replaced by its boxed equivalent on top of the stack.
+ *
+ * @param type the type of the top stack value.
+ */
+ public void box(final Type type) {
+ if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
+ return;
+ }
+ if (type == Type.VOID_TYPE) {
+ push((String) null);
+ } else {
+ Type boxed = type;
+ switch (type.getSort()) {
+ case Type.BYTE:
+ boxed = BYTE_TYPE;
+ break;
+ case Type.BOOLEAN:
+ boxed = BOOLEAN_TYPE;
+ break;
+ case Type.SHORT:
+ boxed = SHORT_TYPE;
+ break;
+ case Type.CHAR:
+ boxed = CHARACTER_TYPE;
+ break;
+ case Type.INT:
+ boxed = INTEGER_TYPE;
+ break;
+ case Type.FLOAT:
+ boxed = FLOAT_TYPE;
+ break;
+ case Type.LONG:
+ boxed = LONG_TYPE;
+ break;
+ case Type.DOUBLE:
+ boxed = DOUBLE_TYPE;
+ break;
+ }
+ newInstance(boxed);
+ if (type.getSize() == 2) {
+ // Pp -> Ppo -> oPpo -> ooPpo -> ooPp -> o
+ dupX2();
+ dupX2();
+ pop();
+ } else {
+ // p -> po -> opo -> oop -> o
+ dupX1();
+ swap();
+ }
+ invokeConstructor(boxed, new Method("<init>",
+ Type.VOID_TYPE,
+ new Type[] { type }));
+ }
+ }
+
+ /**
+ * Generates the instructions to unbox the top stack value. This value is
+ * replaced by its unboxed equivalent on top of the stack.
+ *
+ * @param type the type of the top stack value.
+ */
+ public void unbox(final Type type) {
+ Type t = NUMBER_TYPE;
+ Method sig = null;
+ switch (type.getSort()) {
+ case Type.VOID:
+ return;
+ case Type.CHAR:
+ t = CHARACTER_TYPE;
+ sig = CHAR_VALUE;
+ break;
+ case Type.BOOLEAN:
+ t = BOOLEAN_TYPE;
+ sig = BOOLEAN_VALUE;
+ break;
+ case Type.DOUBLE:
+ sig = DOUBLE_VALUE;
+ break;
+ case Type.FLOAT:
+ sig = FLOAT_VALUE;
+ break;
+ case Type.LONG:
+ sig = LONG_VALUE;
+ break;
+ case Type.INT:
+ case Type.SHORT:
+ case Type.BYTE:
+ sig = INT_VALUE;
+ }
+ if (sig == null) {
+ checkCast(type);
+ } else {
+ checkCast(t);
+ invokeVirtual(t, sig);
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Instructions to jump to other instructions
+ // ------------------------------------------------------------------------
+
+ /**
+ * Creates a new {@link Label}.
+ *
+ * @return a new {@link Label}.
+ */
+ public Label newLabel() {
+ return new Label();
+ }
+
+ /**
+ * Marks the current code position with the given label.
+ *
+ * @param label a label.
+ */
+ public void mark(final Label label) {
+ mv.visitLabel(label);
+ }
+
+ /**
+ * Marks the current code position with a new label.
+ *
+ * @return the label that was created to mark the current code position.
+ */
+ public Label mark() {
+ Label label = new Label();
+ mv.visitLabel(label);
+ return label;
+ }
+
+ /**
+ * Generates the instructions to jump to a label based on the comparison of
+ * the top two stack values.
+ *
+ * @param type the type of the top two stack values.
+ * @param mode how these values must be compared. One of EQ, NE, LT, GE, GT,
+ * LE.
+ * @param label where to jump if the comparison result is <tt>true</tt>.
+ */
+ public void ifCmp(final Type type, final int mode, final Label label) {
+ int intOp = -1;
+ int jumpMode = mode;
+ switch (mode) {
+ case GE:
+ jumpMode = LT;
+ break;
+ case LE:
+ jumpMode = GT;
+ break;
+ }
+ switch (type.getSort()) {
+ case Type.LONG:
+ mv.visitInsn(Opcodes.LCMP);
+ break;
+ case Type.DOUBLE:
+ mv.visitInsn(Opcodes.DCMPG);
+ break;
+ case Type.FLOAT:
+ mv.visitInsn(Opcodes.FCMPG);
+ break;
+ case Type.ARRAY:
+ case Type.OBJECT:
+ switch (mode) {
+ case EQ:
+ mv.visitJumpInsn(Opcodes.IF_ACMPEQ, label);
+ return;
+ case NE:
+ mv.visitJumpInsn(Opcodes.IF_ACMPNE, label);
+ return;
+ }
+ throw new IllegalArgumentException("Bad comparison for type "
+ + type);
+ default:
+ switch (mode) {
+ case EQ:
+ intOp = Opcodes.IF_ICMPEQ;
+ break;
+ case NE:
+ intOp = Opcodes.IF_ICMPNE;
+ break;
+ case GE:
+ intOp = Opcodes.IF_ICMPGE;
+ break;
+ case LT:
+ intOp = Opcodes.IF_ICMPLT;
+ break;
+ case LE:
+ intOp = Opcodes.IF_ICMPLE;
+ break;
+ case GT:
+ intOp = Opcodes.IF_ICMPGT;
+ break;
+ }
+ mv.visitJumpInsn(intOp, label);
+ return;
+ }
+ mv.visitJumpInsn(jumpMode, label);
+ }
+
+ /**
+ * Generates the instructions to jump to a label based on the comparison of
+ * the top two integer stack values.
+ *
+ * @param mode how these values must be compared. One of EQ, NE, LT, GE, GT,
+ * LE.
+ * @param label where to jump if the comparison result is <tt>true</tt>.
+ */
+ public void ifICmp(final int mode, final Label label) {
+ ifCmp(Type.INT_TYPE, mode, label);
+ }
+
+ /**
+ * Generates the instructions to jump to a label based on the comparison of
+ * the top integer stack value with zero.
+ *
+ * @param mode how these values must be compared. One of EQ, NE, LT, GE, GT,
+ * LE.
+ * @param label where to jump if the comparison result is <tt>true</tt>.
+ */
+ public void ifZCmp(final int mode, final Label label) {
+ mv.visitJumpInsn(mode, label);
+ }
+
+ /**
+ * Generates the instruction to jump to the given label if the top stack
+ * value is null.
+ *
+ * @param label where to jump if the condition is <tt>true</tt>.
+ */
+ public void ifNull(final Label label) {
+ mv.visitJumpInsn(Opcodes.IFNULL, label);
+ }
+
+ /**
+ * Generates the instruction to jump to the given label if the top stack
+ * value is not null.
+ *
+ * @param label where to jump if the condition is <tt>true</tt>.
+ */
+ public void ifNonNull(final Label label) {
+ mv.visitJumpInsn(Opcodes.IFNONNULL, label);
+ }
+
+ /**
+ * Generates the instruction to jump to the given label.
+ *
+ * @param label where to jump if the condition is <tt>true</tt>.
+ */
+ public void goTo(final Label label) {
+ mv.visitJumpInsn(Opcodes.GOTO, label);
+ }
+
+ /**
+ * Generates a RET instruction.
+ *
+ * @param local a local variable identifier, as returned by {@link #newLocal
+ * newLocal}.
+ */
+ public void ret(final int local) {
+ mv.visitVarInsn(Opcodes.RET, local);
+ }
+
+ /**
+ * Generates the instructions for a switch statement.
+ *
+ * @param keys the switch case keys.
+ * @param generator a generator to generate the code for the switch cases.
+ */
+ public void tableSwitch(
+ final int[] keys,
+ final TableSwitchGenerator generator)
+ {
+ float density;
+ if (keys.length == 0) {
+ density = 0;
+ } else {
+ density = (float) keys.length
+ / (keys[keys.length - 1] - keys[0] + 1);
+ }
+ tableSwitch(keys, generator, density >= 0.5f);
+ }
+
+ /**
+ * Generates the instructions for a switch statement.
+ *
+ * @param keys the switch case keys.
+ * @param generator a generator to generate the code for the switch cases.
+ * @param useTable <tt>true</tt> to use a TABLESWITCH instruction, or
+ * <tt>false</tt> to use a LOOKUPSWITCH instruction.
+ */
+ public void tableSwitch(
+ final int[] keys,
+ final TableSwitchGenerator generator,
+ final boolean useTable)
+ {
+ for (int i = 1; i < keys.length; ++i) {
+ if (keys[i] < keys[i - 1]) {
+ throw new IllegalArgumentException("keys must be sorted ascending");
+ }
+ }
+ Label def = newLabel();
+ Label end = newLabel();
+ if (keys.length > 0) {
+ int len = keys.length;
+ int min = keys[0];
+ int max = keys[len - 1];
+ int range = max - min + 1;
+ if (useTable) {
+ Label[] labels = new Label[range];
+ Arrays.fill(labels, def);
+ for (int i = 0; i < len; ++i) {
+ labels[keys[i] - min] = newLabel();
+ }
+ mv.visitTableSwitchInsn(min, max, def, labels);
+ for (int i = 0; i < range; ++i) {
+ Label label = labels[i];
+ if (label != def) {
+ mark(label);
+ generator.generateCase(i + min, end);
+ }
+ }
+ } else {
+ Label[] labels = new Label[len];
+ for (int i = 0; i < len; ++i) {
+ labels[i] = newLabel();
+ }
+ mv.visitLookupSwitchInsn(def, keys, labels);
+ for (int i = 0; i < len; ++i) {
+ mark(labels[i]);
+ generator.generateCase(keys[i], end);
+ }
+ }
+ }
+ mark(def);
+ generator.generateDefault();
+ mark(end);
+ }
+
+ /**
+ * Generates the instruction to return the top stack value to the caller.
+ */
+ public void returnValue() {
+ mv.visitInsn(returnType.getOpcode(Opcodes.IRETURN));
+ }
+
+ // ------------------------------------------------------------------------
+ // Instructions to load and store fields
+ // ------------------------------------------------------------------------
+
+ /**
+ * Generates a get field or set field instruction.
+ *
+ * @param opcode the instruction's opcode.
+ * @param ownerType the class in which the field is defined.
+ * @param name the name of the field.
+ * @param fieldType the type of the field.
+ */
+ private void fieldInsn(
+ final int opcode,
+ final Type ownerType,
+ final String name,
+ final Type fieldType)
+ {
+ mv.visitFieldInsn(opcode,
+ ownerType.getInternalName(),
+ name,
+ fieldType.getDescriptor());
+ }
+
+ /**
+ * Generates the instruction to push the value of a static field on the
+ * stack.
+ *
+ * @param owner the class in which the field is defined.
+ * @param name the name of the field.
+ * @param type the type of the field.
+ */
+ public void getStatic(final Type owner, final String name, final Type type)
+ {
+ fieldInsn(Opcodes.GETSTATIC, owner, name, type);
+ }
+
+ /**
+ * Generates the instruction to store the top stack value in a static field.
+ *
+ * @param owner the class in which the field is defined.
+ * @param name the name of the field.
+ * @param type the type of the field.
+ */
+ public void putStatic(final Type owner, final String name, final Type type)
+ {
+ fieldInsn(Opcodes.PUTSTATIC, owner, name, type);
+ }
+
+ /**
+ * Generates the instruction to push the value of a non static field on the
+ * stack.
+ *
+ * @param owner the class in which the field is defined.
+ * @param name the name of the field.
+ * @param type the type of the field.
+ */
+ public void getField(final Type owner, final String name, final Type type) {
+ fieldInsn(Opcodes.GETFIELD, owner, name, type);
+ }
+
+ /**
+ * Generates the instruction to store the top stack value in a non static
+ * field.
+ *
+ * @param owner the class in which the field is defined.
+ * @param name the name of the field.
+ * @param type the type of the field.
+ */
+ public void putField(final Type owner, final String name, final Type type) {
+ fieldInsn(Opcodes.PUTFIELD, owner, name, type);
+ }
+
+ // ------------------------------------------------------------------------
+ // Instructions to invoke methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Generates an invoke method instruction.
+ *
+ * @param opcode the instruction's opcode.
+ * @param type the class in which the method is defined.
+ * @param method the method to be invoked.
+ */
+ private void invokeInsn(
+ final int opcode,
+ final Type type,
+ final Method method)
+ {
+ String owner = type.getSort() == Type.ARRAY
+ ? type.getDescriptor()
+ : type.getInternalName();
+ mv.visitMethodInsn(opcode,
+ owner,
+ method.getName(),
+ method.getDescriptor());
+ }
+
+ /**
+ * Generates the instruction to invoke a normal method.
+ *
+ * @param owner the class in which the method is defined.
+ * @param method the method to be invoked.
+ */
+ public void invokeVirtual(final Type owner, final Method method) {
+ invokeInsn(Opcodes.INVOKEVIRTUAL, owner, method);
+ }
+
+ /**
+ * Generates the instruction to invoke a constructor.
+ *
+ * @param type the class in which the constructor is defined.
+ * @param method the constructor to be invoked.
+ */
+ public void invokeConstructor(final Type type, final Method method) {
+ invokeInsn(Opcodes.INVOKESPECIAL, type, method);
+ }
+
+ /**
+ * Generates the instruction to invoke a static method.
+ *
+ * @param owner the class in which the method is defined.
+ * @param method the method to be invoked.
+ */
+ public void invokeStatic(final Type owner, final Method method) {
+ invokeInsn(Opcodes.INVOKESTATIC, owner, method);
+ }
+
+ /**
+ * Generates the instruction to invoke an interface method.
+ *
+ * @param owner the class in which the method is defined.
+ * @param method the method to be invoked.
+ */
+ public void invokeInterface(final Type owner, final Method method) {
+ invokeInsn(Opcodes.INVOKEINTERFACE, owner, method);
+ }
+
+ // ------------------------------------------------------------------------
+ // Instructions to create objects and arrays
+ // ------------------------------------------------------------------------
+
+ /**
+ * Generates a type dependent instruction.
+ *
+ * @param opcode the instruction's opcode.
+ * @param type the instruction's operand.
+ */
+ private void typeInsn(final int opcode, final Type type) {
+ String desc;
+ if (type.getSort() == Type.ARRAY) {
+ desc = type.getDescriptor();
+ } else {
+ desc = type.getInternalName();
+ }
+ mv.visitTypeInsn(opcode, desc);
+ }
+
+ /**
+ * Generates the instruction to create a new object.
+ *
+ * @param type the class of the object to be created.
+ */
+ public void newInstance(final Type type) {
+ typeInsn(Opcodes.NEW, type);
+ }
+
+ /**
+ * Generates the instruction to create a new array.
+ *
+ * @param type the type of the array elements.
+ */
+ public void newArray(final Type type) {
+ int typ;
+ switch (type.getSort()) {
+ case Type.BOOLEAN:
+ typ = Opcodes.T_BOOLEAN;
+ break;
+ case Type.CHAR:
+ typ = Opcodes.T_CHAR;
+ break;
+ case Type.BYTE:
+ typ = Opcodes.T_BYTE;
+ break;
+ case Type.SHORT:
+ typ = Opcodes.T_SHORT;
+ break;
+ case Type.INT:
+ typ = Opcodes.T_INT;
+ break;
+ case Type.FLOAT:
+ typ = Opcodes.T_FLOAT;
+ break;
+ case Type.LONG:
+ typ = Opcodes.T_LONG;
+ break;
+ case Type.DOUBLE:
+ typ = Opcodes.T_DOUBLE;
+ break;
+ default:
+ typeInsn(Opcodes.ANEWARRAY, type);
+ return;
+ }
+ mv.visitIntInsn(Opcodes.NEWARRAY, typ);
+ }
+
+ // ------------------------------------------------------------------------
+ // Miscelaneous instructions
+ // ------------------------------------------------------------------------
+
+ /**
+ * Generates the instruction to compute the length of an array.
+ */
+ public void arrayLength() {
+ mv.visitInsn(Opcodes.ARRAYLENGTH);
+ }
+
+ /**
+ * Generates the instruction to throw an exception.
+ */
+ public void throwException() {
+ mv.visitInsn(Opcodes.ATHROW);
+ }
+
+ /**
+ * Generates the instructions to create and throw an exception. The
+ * exception class must have a constructor with a single String argument.
+ *
+ * @param type the class of the exception to be thrown.
+ * @param msg the detailed message of the exception.
+ */
+ public void throwException(final Type type, final String msg) {
+ newInstance(type);
+ dup();
+ push(msg);
+ invokeConstructor(type, Method.getMethod("void <init> (String)"));
+ throwException();
+ }
+
+ /**
+ * Generates the instruction to check that the top stack value is of the
+ * given type.
+ *
+ * @param type a class or interface type.
+ */
+ public void checkCast(final Type type) {
+ if (!type.equals(OBJECT_TYPE)) {
+ typeInsn(Opcodes.CHECKCAST, type);
+ }
+ }
+
+ /**
+ * Generates the instruction to test if the top stack value is of the given
+ * type.
+ *
+ * @param type a class or interface type.
+ */
+ public void instanceOf(final Type type) {
+ typeInsn(Opcodes.INSTANCEOF, type);
+ }
+
+ /**
+ * Generates the instruction to get the monitor of the top stack value.
+ */
+ public void monitorEnter() {
+ mv.visitInsn(Opcodes.MONITORENTER);
+ }
+
+ /**
+ * Generates the instruction to release the monitor of the top stack value.
+ */
+ public void monitorExit() {
+ mv.visitInsn(Opcodes.MONITOREXIT);
+ }
+
+ // ------------------------------------------------------------------------
+ // Non instructions
+ // ------------------------------------------------------------------------
+
+ /**
+ * Marks the end of the visited method.
+ */
+ public void endMethod() {
+ if ((access & Opcodes.ACC_ABSTRACT) == 0) {
+ mv.visitMaxs(0, 0);
+ }
+ }
+
+ /**
+ * Marks the start of an exception handler.
+ *
+ * @param start beginning of the exception handler's scope (inclusive).
+ * @param end end of the exception handler's scope (exclusive).
+ * @param exception internal name of the type of exceptions handled by the
+ * handler.
+ */
+ public void catchException(
+ final Label start,
+ final Label end,
+ final Type exception)
+ {
+ mv.visitTryCatchBlock(start, end, mark(), exception.getInternalName());
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/LocalVariablesSorter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/LocalVariablesSorter.java
new file mode 100644
index 00000000000..1253a0b5170
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/LocalVariablesSorter.java
@@ -0,0 +1,136 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.commons;
+
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodAdapter;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+
+/**
+ * A {@link MethodAdapter} that renumbers local variables in their order of
+ * appearance. This adapter allows one to easily add new local variables to a
+ * method.
+ *
+ * @author Chris Nokleberg
+ * @author Eric Bruneton
+ */
+public class LocalVariablesSorter extends MethodAdapter {
+
+ /**
+ * Mapping from old to new local variable indexes. A local variable at index
+ * i of size 1 is remapped to 'mapping[2*i]', while a local variable at
+ * index i of size 2 is remapped to 'mapping[2*i+1]'.
+ */
+ private int[] mapping = new int[40];
+
+ protected final int firstLocal;
+
+ private int nextLocal;
+
+ public LocalVariablesSorter(
+ final int access,
+ final String desc,
+ final MethodVisitor mv)
+ {
+ super(mv);
+ Type[] args = Type.getArgumentTypes(desc);
+ nextLocal = ((Opcodes.ACC_STATIC & access) != 0) ? 0 : 1;
+ for (int i = 0; i < args.length; i++) {
+ nextLocal += args[i].getSize();
+ }
+ firstLocal = nextLocal;
+ }
+
+ public void visitVarInsn(final int opcode, final int var) {
+ int size;
+ switch (opcode) {
+ case Opcodes.LLOAD:
+ case Opcodes.LSTORE:
+ case Opcodes.DLOAD:
+ case Opcodes.DSTORE:
+ size = 2;
+ break;
+ default:
+ size = 1;
+ }
+ mv.visitVarInsn(opcode, remap(var, size));
+ }
+
+ public void visitIincInsn(final int var, final int increment) {
+ mv.visitIincInsn(remap(var, 1), increment);
+ }
+
+ public void visitMaxs(final int maxStack, final int maxLocals) {
+ mv.visitMaxs(maxStack, nextLocal);
+ }
+
+ public void visitLocalVariable(
+ final String name,
+ final String desc,
+ final String signature,
+ final Label start,
+ final Label end,
+ final int index)
+ {
+ int size = "J".equals(desc) || "D".equals(desc) ? 2 : 1;
+ mv.visitLocalVariable(name, desc, signature, start, end, remap(index, size));
+ }
+
+ // -------------
+
+ protected int newLocal(final int size) {
+ int var = nextLocal;
+ nextLocal += size;
+ return var;
+ }
+
+ private int remap(final int var, final int size) {
+ if (var < firstLocal) {
+ return var;
+ }
+ int key = 2 * var + size - 1;
+ int length = mapping.length;
+ if (key >= length) {
+ int[] newMapping = new int[Math.max(2 * length, key + 1)];
+ System.arraycopy(mapping, 0, newMapping, 0, length);
+ mapping = newMapping;
+ }
+ int value = mapping[key];
+ if (value == 0) {
+ value = nextLocal + 1;
+ mapping[key] = value;
+ nextLocal += size;
+ }
+ return value - 1;
+ }
+
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/Method.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/Method.java
new file mode 100644
index 00000000000..741e7b5be26
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/Method.java
@@ -0,0 +1,220 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.commons;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.objectweb.asm.Type;
+
+/**
+ * A named method descriptor.
+ *
+ * @author Juozas Baliuka
+ * @author Chris Nokleberg
+ * @author Eric Bruneton
+ */
+public class Method {
+
+ /**
+ * The method name.
+ */
+ private final String name;
+
+ /**
+ * The method descriptor.
+ */
+ private final String desc;
+
+ /**
+ * Maps primitive Java type names to their descriptors.
+ */
+ private final static Map DESCRIPTORS;
+
+ static {
+ DESCRIPTORS = new HashMap();
+ DESCRIPTORS.put("void", "V");
+ DESCRIPTORS.put("byte", "B");
+ DESCRIPTORS.put("char", "C");
+ DESCRIPTORS.put("double", "D");
+ DESCRIPTORS.put("float", "F");
+ DESCRIPTORS.put("int", "I");
+ DESCRIPTORS.put("long", "J");
+ DESCRIPTORS.put("short", "S");
+ DESCRIPTORS.put("boolean", "Z");
+ }
+
+ /**
+ * Creates a new {@link Method}.
+ *
+ * @param name the method's name.
+ * @param desc the method's descriptor.
+ */
+ public Method(final String name, final String desc) {
+ this.name = name;
+ this.desc = desc;
+ }
+
+ /**
+ * Creates a new {@link Method}.
+ *
+ * @param name the method's name.
+ * @param returnType the method's return type.
+ * @param argumentTypes the method's argument types.
+ */
+ public Method(
+ final String name,
+ final Type returnType,
+ final Type[] argumentTypes)
+ {
+ this(name, Type.getMethodDescriptor(returnType, argumentTypes));
+ }
+
+ /**
+ * Returns a {@link Method} corresponding to the given Java method
+ * declaration.
+ *
+ * @param method a Java method declaration, without argument names, of the
+ * form "returnType name (argumentType1, ... argumentTypeN)", where
+ * the types are in plain Java (e.g. "int", "float",
+ * "java.util.List", ...).
+ * @return a {@link Method} corresponding to the given Java method
+ * declaration.
+ * @throws IllegalArgumentException if <code>method</code> could not get
+ * parsed.
+ */
+ public static Method getMethod(final String method)
+ throws IllegalArgumentException
+ {
+ int space = method.indexOf(' ');
+ int start = method.indexOf('(', space) + 1;
+ int end = method.indexOf(')', start);
+ if (space == -1 || start == -1 || end == -1) {
+ throw new IllegalArgumentException();
+ }
+ // TODO: Check validity of returnType, methodName and arguments.
+ String returnType = method.substring(0, space);
+ String methodName = method.substring(space + 1, start - 1).trim();
+ StringBuffer sb = new StringBuffer();
+ sb.append('(');
+ int p;
+ do {
+ p = method.indexOf(',', start);
+ if (p == -1) {
+ sb.append(map(method.substring(start, end).trim()));
+ } else {
+ sb.append(map(method.substring(start, p).trim()));
+ start = p + 1;
+ }
+ } while (p != -1);
+ sb.append(')');
+ sb.append(map(returnType));
+ return new Method(methodName, sb.toString());
+ }
+
+ private static String map(final String type) {
+ if (type.equals("")) {
+ return type;
+ }
+
+ StringBuffer sb = new StringBuffer();
+ int index = 0;
+ while ((index = type.indexOf("[]", index) + 1) > 0) {
+ sb.append('[');
+ }
+
+ String t = type.substring(0, type.length() - sb.length() * 2);
+ String desc = (String) DESCRIPTORS.get(t);
+ if (desc != null) {
+ sb.append(desc);
+ } else {
+ sb.append('L');
+ if (t.indexOf('.') < 0) {
+ sb.append("java/lang/" + t);
+ } else {
+ sb.append(t.replace('.', '/'));
+ }
+ sb.append(';');
+ }
+ return sb.toString();
+ }
+
+ /**
+ * Returns the name of the method described by this object.
+ *
+ * @return the name of the method described by this object.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Returns the descriptor of the method described by this object.
+ *
+ * @return the descriptor of the method described by this object.
+ */
+ public String getDescriptor() {
+ return desc;
+ }
+
+ /**
+ * Returns the return type of the method described by this object.
+ *
+ * @return the return type of the method described by this object.
+ */
+ public Type getReturnType() {
+ return Type.getReturnType(desc);
+ }
+
+ /**
+ * Returns the argument types of the method described by this object.
+ *
+ * @return the argument types of the method described by this object.
+ */
+ public Type[] getArgumentTypes() {
+ return Type.getArgumentTypes(desc);
+ }
+
+ public String toString() {
+ return name + desc;
+ }
+
+ public boolean equals(final Object o) {
+ if (!(o instanceof Method)) {
+ return false;
+ }
+ Method other = (Method) o;
+ return name.equals(other.name) && desc.equals(other.desc);
+ }
+
+ public int hashCode() {
+ return name.hashCode() ^ desc.hashCode();
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/SerialVersionUIDAdder.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/SerialVersionUIDAdder.java
new file mode 100644
index 00000000000..800ad4b3cd2
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/SerialVersionUIDAdder.java
@@ -0,0 +1,490 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.commons;
+
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.security.MessageDigest;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+
+import org.objectweb.asm.ClassAdapter;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
+/**
+ * A {@link ClassAdapter} that adds a serial version unique identifier to a
+ * class if missing. Here is typical usage of this class:
+ *
+ * <pre>
+ * ClassWriter cw = new ClassWriter(...);
+ * ClassVisitor sv = new SerialVersionUIDAdder(cw);
+ * ClassVisitor ca = new MyClassAdapter(sv);
+ * new ClassReader(orginalClass).accept(ca, false);
+ * </pre>
+ *
+ * The SVUID algorithm can be found <a href=
+ * "http://java.sun.com/j2se/1.4.2/docs/guide/serialization/spec/class.html"
+ * >http://java.sun.com/j2se/1.4.2/docs/guide/serialization/spec/class.html</a>:
+ *
+ * <pre>
+ * The serialVersionUID is computed using the signature of a stream of bytes
+ * that reflect the class definition. The National Institute of Standards and
+ * Technology (NIST) Secure Hash Algorithm (SHA-1) is used to compute a
+ * signature for the stream. The first two 32-bit quantities are used to form a
+ * 64-bit hash. A java.lang.DataOutputStream is used to convert primitive data
+ * types to a sequence of bytes. The values input to the stream are defined by
+ * the Java Virtual Machine (VM) specification for classes.
+ *
+ * The sequence of items in the stream is as follows:
+ *
+ * 1. The class name written using UTF encoding.
+ * 2. The class modifiers written as a 32-bit integer.
+ * 3. The name of each interface sorted by name written using UTF encoding.
+ * 4. For each field of the class sorted by field name (except private static
+ * and private transient fields):
+ * 1. The name of the field in UTF encoding.
+ * 2. The modifiers of the field written as a 32-bit integer.
+ * 3. The descriptor of the field in UTF encoding
+ * 5. If a class initializer exists, write out the following:
+ * 1. The name of the method, &lt;clinit&gt;, in UTF encoding.
+ * 2. The modifier of the method, java.lang.reflect.Modifier.STATIC,
+ * written as a 32-bit integer.
+ * 3. The descriptor of the method, ()V, in UTF encoding.
+ * 6. For each non-private constructor sorted by method name and signature:
+ * 1. The name of the method, &lt;init&gt;, in UTF encoding.
+ * 2. The modifiers of the method written as a 32-bit integer.
+ * 3. The descriptor of the method in UTF encoding.
+ * 7. For each non-private method sorted by method name and signature:
+ * 1. The name of the method in UTF encoding.
+ * 2. The modifiers of the method written as a 32-bit integer.
+ * 3. The descriptor of the method in UTF encoding.
+ * 8. The SHA-1 algorithm is executed on the stream of bytes produced by
+ * DataOutputStream and produces five 32-bit values sha[0..4].
+ *
+ * 9. The hash value is assembled from the first and second 32-bit values of
+ * the SHA-1 message digest. If the result of the message digest, the five
+ * 32-bit words H0 H1 H2 H3 H4, is in an array of five int values named
+ * sha, the hash value would be computed as follows:
+ *
+ * long hash = ((sha[0] &gt;&gt;&gt; 24) &amp; 0xFF) |
+ * ((sha[0] &gt;&gt;&gt; 16) &amp; 0xFF) &lt;&lt; 8 |
+ * ((sha[0] &gt;&gt;&gt; 8) &amp; 0xFF) &lt;&lt; 16 |
+ * ((sha[0] &gt;&gt;&gt; 0) &amp; 0xFF) &lt;&lt; 24 |
+ * ((sha[1] &gt;&gt;&gt; 24) &amp; 0xFF) &lt;&lt; 32 |
+ * ((sha[1] &gt;&gt;&gt; 16) &amp; 0xFF) &lt;&lt; 40 |
+ * ((sha[1] &gt;&gt;&gt; 8) &amp; 0xFF) &lt;&lt; 48 |
+ * ((sha[1] &gt;&gt;&gt; 0) &amp; 0xFF) &lt;&lt; 56;
+ * </pre>
+ *
+ * @author Rajendra Inamdar, Vishal Vishnoi
+ */
+public class SerialVersionUIDAdder extends ClassAdapter {
+
+ /**
+ * Flag that indicates if we need to compute SVUID.
+ */
+ protected boolean computeSVUID;
+
+ /**
+ * Set to true if the class already has SVUID.
+ */
+ protected boolean hasSVUID;
+
+ /**
+ * Classes access flags.
+ */
+ protected int access;
+
+ /**
+ * Internal name of the class
+ */
+ protected String name;
+
+ /**
+ * Interfaces implemented by the class.
+ */
+ protected String[] interfaces;
+
+ /**
+ * Collection of fields. (except private static and private transient
+ * fields)
+ */
+ protected Collection svuidFields;
+
+ /**
+ * Set to true if the class has static initializer.
+ */
+ protected boolean hasStaticInitializer;
+
+ /**
+ * Collection of non-private constructors.
+ */
+ protected Collection svuidConstructors;
+
+ /**
+ * Collection of non-private methods.
+ */
+ protected Collection svuidMethods;
+
+ /**
+ * Creates a new {@link SerialVersionUIDAdder}.
+ *
+ * @param cv a {@link ClassVisitor} to which this visitor will delegate
+ * calls.
+ */
+ public SerialVersionUIDAdder(final ClassVisitor cv) {
+ super(cv);
+ svuidFields = new ArrayList();
+ svuidConstructors = new ArrayList();
+ svuidMethods = new ArrayList();
+ }
+
+ // ------------------------------------------------------------------------
+ // Overriden methods
+ // ------------------------------------------------------------------------
+
+ /*
+ * Visit class header and get class name, access , and intefraces
+ * informatoin (step 1,2, and 3) for SVUID computation.
+ */
+ public void visit(
+ final int version,
+ final int access,
+ final String name,
+ final String signature,
+ final String superName,
+ final String[] interfaces)
+ {
+ computeSVUID = (access & Opcodes.ACC_INTERFACE) == 0;
+
+ if (computeSVUID) {
+ this.name = name;
+ this.access = access;
+ this.interfaces = interfaces;
+ }
+
+ super.visit(version, access, name, signature, superName, interfaces);
+ }
+
+ /*
+ * Visit the methods and get constructor and method information (step 5 and
+ * 7). Also determince if there is a class initializer (step 6).
+ */
+ public MethodVisitor visitMethod(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final String[] exceptions)
+ {
+ if (computeSVUID) {
+ if (name.equals("<clinit>")) {
+ hasStaticInitializer = true;
+ }
+ /*
+ * Remembers non private constructors and methods for SVUID
+ * computation For constructor and method modifiers, only the
+ * ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL,
+ * ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT and ACC_STRICT flags
+ * are used.
+ */
+ int mods = access
+ & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PRIVATE
+ | Opcodes.ACC_PROTECTED | Opcodes.ACC_STATIC
+ | Opcodes.ACC_FINAL | Opcodes.ACC_SYNCHRONIZED
+ | Opcodes.ACC_NATIVE | Opcodes.ACC_ABSTRACT | Opcodes.ACC_STRICT);
+
+ // all non private methods
+ if ((access & Opcodes.ACC_PRIVATE) == 0) {
+ if (name.equals("<init>")) {
+ svuidConstructors.add(new Item(name, mods, desc));
+ } else if (!name.equals("<clinit>")) {
+ svuidMethods.add(new Item(name, mods, desc));
+ }
+ }
+ }
+
+ return cv.visitMethod(access, name, desc, signature, exceptions);
+ }
+
+ /*
+ * Gets class field information for step 4 of the alogrithm. Also determines
+ * if the class already has a SVUID.
+ */
+ public FieldVisitor visitField(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final Object value)
+ {
+ if (computeSVUID) {
+ if (name.equals("serialVersionUID")) {
+ // since the class already has SVUID, we won't be computing it.
+ computeSVUID = false;
+ hasSVUID = true;
+ }
+ /*
+ * Remember field for SVUID computation For field modifiers, only
+ * the ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC,
+ * ACC_FINAL, ACC_VOLATILE, and ACC_TRANSIENT flags are used when
+ * computing serialVersionUID values.
+ */
+ int mods = access
+ & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PRIVATE
+ | Opcodes.ACC_PROTECTED | Opcodes.ACC_STATIC
+ | Opcodes.ACC_FINAL | Opcodes.ACC_VOLATILE | Opcodes.ACC_TRANSIENT);
+
+ if (((access & Opcodes.ACC_PRIVATE) == 0)
+ || ((access & (Opcodes.ACC_STATIC | Opcodes.ACC_TRANSIENT)) == 0))
+ {
+ svuidFields.add(new Item(name, mods, desc));
+ }
+ }
+
+ return super.visitField(access, name, desc, signature, value);
+ }
+
+ /*
+ * Add the SVUID if class doesn't have one
+ */
+ public void visitEnd() {
+ // compute SVUID and add it to the class
+ if (computeSVUID && !hasSVUID) {
+ try {
+ cv.visitField(Opcodes.ACC_FINAL + Opcodes.ACC_STATIC,
+ "serialVersionUID",
+ "J",
+ null,
+ new Long(computeSVUID()));
+ } catch (Throwable e) {
+ throw new RuntimeException("Error while computing SVUID for "
+ + name, e);
+ }
+ }
+
+ super.visitEnd();
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the value of SVUID if the class doesn't have one already. Please
+ * note that 0 is returned if the class already has SVUID, thus use
+ * <code>isHasSVUID</code> to determine if the class already had an SVUID.
+ *
+ * @return Returns the serial version UID
+ * @throws IOException
+ */
+ protected long computeSVUID() throws IOException {
+ if (hasSVUID) {
+ return 0;
+ }
+
+ ByteArrayOutputStream bos = null;
+ DataOutputStream dos = null;
+ long svuid = 0;
+
+ try {
+ bos = new ByteArrayOutputStream();
+ dos = new DataOutputStream(bos);
+
+ /*
+ * 1. The class name written using UTF encoding.
+ */
+ dos.writeUTF(name.replace('/', '.'));
+
+ /*
+ * 2. The class modifiers written as a 32-bit integer.
+ */
+ dos.writeInt(access
+ & (Opcodes.ACC_PUBLIC | Opcodes.ACC_FINAL
+ | Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT));
+
+ /*
+ * 3. The name of each interface sorted by name written using UTF
+ * encoding.
+ */
+ Arrays.sort(interfaces);
+ for (int i = 0; i < interfaces.length; i++) {
+ dos.writeUTF(interfaces[i].replace('/', '.'));
+ }
+
+ /*
+ * 4. For each field of the class sorted by field name (except
+ * private static and private transient fields):
+ *
+ * 1. The name of the field in UTF encoding. 2. The modifiers of the
+ * field written as a 32-bit integer. 3. The descriptor of the field
+ * in UTF encoding
+ *
+ * Note that field signatutes are not dot separated. Method and
+ * constructor signatures are dot separated. Go figure...
+ */
+ writeItems(svuidFields, dos, false);
+
+ /*
+ * 5. If a class initializer exists, write out the following: 1. The
+ * name of the method, <clinit>, in UTF encoding. 2. The modifier of
+ * the method, java.lang.reflect.Modifier.STATIC, written as a
+ * 32-bit integer. 3. The descriptor of the method, ()V, in UTF
+ * encoding.
+ */
+ if (hasStaticInitializer) {
+ dos.writeUTF("<clinit>");
+ dos.writeInt(Opcodes.ACC_STATIC);
+ dos.writeUTF("()V");
+ } // if..
+
+ /*
+ * 6. For each non-private constructor sorted by method name and
+ * signature: 1. The name of the method, <init>, in UTF encoding. 2.
+ * The modifiers of the method written as a 32-bit integer. 3. The
+ * descriptor of the method in UTF encoding.
+ */
+ writeItems(svuidConstructors, dos, true);
+
+ /*
+ * 7. For each non-private method sorted by method name and
+ * signature: 1. The name of the method in UTF encoding. 2. The
+ * modifiers of the method written as a 32-bit integer. 3. The
+ * descriptor of the method in UTF encoding.
+ */
+ writeItems(svuidMethods, dos, true);
+
+ dos.flush();
+
+ /*
+ * 8. The SHA-1 algorithm is executed on the stream of bytes
+ * produced by DataOutputStream and produces five 32-bit values
+ * sha[0..4].
+ */
+ byte[] hashBytes = computeSHAdigest(bos.toByteArray());
+
+ /*
+ * 9. The hash value is assembled from the first and second 32-bit
+ * values of the SHA-1 message digest. If the result of the message
+ * digest, the five 32-bit words H0 H1 H2 H3 H4, is in an array of
+ * five int values named sha, the hash value would be computed as
+ * follows:
+ *
+ * long hash = ((sha[0] >>> 24) & 0xFF) | ((sha[0] >>> 16) & 0xFF) <<
+ * 8 | ((sha[0] >>> 8) & 0xFF) << 16 | ((sha[0] >>> 0) & 0xFF) <<
+ * 24 | ((sha[1] >>> 24) & 0xFF) << 32 | ((sha[1] >>> 16) & 0xFF) <<
+ * 40 | ((sha[1] >>> 8) & 0xFF) << 48 | ((sha[1] >>> 0) & 0xFF) <<
+ * 56;
+ */
+ for (int i = Math.min(hashBytes.length, 8) - 1; i >= 0; i--) {
+ svuid = (svuid << 8) | (hashBytes[i] & 0xFF);
+ }
+ } finally {
+ // close the stream (if open)
+ if (dos != null) {
+ dos.close();
+ }
+ }
+
+ return svuid;
+ }
+
+ /**
+ * Returns the SHA-1 message digest of the given value.
+ *
+ * @param value the value whose SHA message digest must be computed.
+ * @return the SHA-1 message digest of the given value.
+ */
+ protected byte[] computeSHAdigest(byte[] value) {
+ try {
+ return MessageDigest.getInstance("SHA").digest(value);
+ } catch (Exception e) {
+ throw new UnsupportedOperationException(e);
+ }
+ }
+
+ /**
+ * Sorts the items in the collection and writes it to the data output stream
+ *
+ * @param itemCollection collection of items
+ * @param dos a <code>DataOutputStream</code> value
+ * @param dotted a <code>boolean</code> value
+ * @exception IOException if an error occurs
+ */
+ private void writeItems(
+ final Collection itemCollection,
+ final DataOutputStream dos,
+ final boolean dotted) throws IOException
+ {
+ int size = itemCollection.size();
+ Item items[] = (Item[]) itemCollection.toArray(new Item[size]);
+ Arrays.sort(items);
+ for (int i = 0; i < size; i++) {
+ dos.writeUTF(items[i].name);
+ dos.writeInt(items[i].access);
+ dos.writeUTF(dotted
+ ? items[i].desc.replace('/', '.')
+ : items[i].desc);
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Inner classes
+ // ------------------------------------------------------------------------
+
+ static class Item implements Comparable {
+
+ String name;
+
+ int access;
+
+ String desc;
+
+ Item(final String name, final int access, final String desc) {
+ this.name = name;
+ this.access = access;
+ this.desc = desc;
+ }
+
+ public int compareTo(final Object o) {
+ Item other = (Item) o;
+ int retVal = name.compareTo(other.name);
+ if (retVal == 0) {
+ retVal = desc.compareTo(other.desc);
+ }
+ return retVal;
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/StaticInitMerger.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/StaticInitMerger.java
new file mode 100644
index 00000000000..9aabe44cad2
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/StaticInitMerger.java
@@ -0,0 +1,99 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.commons;
+
+import org.objectweb.asm.ClassAdapter;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
+/**
+ * A {@link ClassAdapter} that merges clinit methods into a single one.
+ *
+ * @author Eric Bruneton
+ */
+public class StaticInitMerger extends ClassAdapter {
+
+ private String name;
+
+ private MethodVisitor clinit;
+
+ private String prefix;
+
+ private int counter;
+
+ public StaticInitMerger(final String prefix, final ClassVisitor cv) {
+ super(cv);
+ this.prefix = prefix;
+ }
+
+ public void visit(
+ final int version,
+ final int access,
+ final String name,
+ final String signature,
+ final String superName,
+ final String[] interfaces)
+ {
+ cv.visit(version, access, name, signature, superName, interfaces);
+ this.name = name;
+ }
+
+ public MethodVisitor visitMethod(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final String[] exceptions)
+ {
+ MethodVisitor mv;
+ if (name.equals("<clinit>")) {
+ int a = Opcodes.ACC_PRIVATE + Opcodes.ACC_STATIC;
+ String n = prefix + counter++;
+ mv = cv.visitMethod(a, n, desc, signature, exceptions);
+
+ if (clinit == null) {
+ clinit = cv.visitMethod(a, name, desc, null, null);
+ }
+ clinit.visitMethodInsn(Opcodes.INVOKESTATIC, this.name, n, desc);
+ } else {
+ mv = cv.visitMethod(access, name, desc, signature, exceptions);
+ }
+ return mv;
+ }
+
+ public void visitEnd() {
+ if (clinit != null) {
+ clinit.visitInsn(Opcodes.RETURN);
+ clinit.visitMaxs(0, 0);
+ }
+ cv.visitEnd();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/TableSwitchGenerator.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/TableSwitchGenerator.java
new file mode 100644
index 00000000000..73d8d926bb7
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/TableSwitchGenerator.java
@@ -0,0 +1,55 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.commons;
+
+import org.objectweb.asm.Label;
+
+/**
+ * A code generator for switch statements.
+ *
+ * @author Juozas Baliuka
+ * @author Chris Nokleberg
+ * @author Eric Bruneton
+ */
+public interface TableSwitchGenerator {
+
+ /**
+ * Generates the code for a switch case.
+ *
+ * @param key the switch case key.
+ * @param end a label that corresponds to the end of the switch statement.
+ */
+ void generateCase(int key, Label end);
+
+ /**
+ * Generates the code for the default switch case.
+ */
+ void generateDefault();
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/package.html b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/package.html
new file mode 100644
index 00000000000..33c860bb31b
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/commons/package.html
@@ -0,0 +1,33 @@
+<html>
+<!--
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<body>
+Provides some useful class and method adapters.
+</body> \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/AnnotationConstantsCollector.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/AnnotationConstantsCollector.java
new file mode 100644
index 00000000000..e35fead24cb
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/AnnotationConstantsCollector.java
@@ -0,0 +1,150 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.optimizer;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Type;
+
+/**
+ * An {@link AnnotationVisitor} that collects the {@link Constant}s of the
+ * annotations it visits.
+ *
+ * @author Eric Bruneton
+ */
+public class AnnotationConstantsCollector implements AnnotationVisitor {
+
+ private AnnotationVisitor av;
+
+ private ConstantPool cp;
+
+ public AnnotationConstantsCollector(
+ final AnnotationVisitor av,
+ final ConstantPool cp)
+ {
+ this.av = av;
+ this.cp = cp;
+ }
+
+ public void visit(final String name, final Object value) {
+ if (name != null) {
+ cp.newUTF8(name);
+ }
+ if (value instanceof Byte) {
+ cp.newInteger(((Byte) value).byteValue());
+ } else if (value instanceof Boolean) {
+ cp.newInteger(((Boolean) value).booleanValue() ? 1 : 0);
+ } else if (value instanceof Character) {
+ cp.newInteger(((Character) value).charValue());
+ } else if (value instanceof Short) {
+ cp.newInteger(((Short) value).shortValue());
+ } else if (value instanceof Type) {
+ cp.newUTF8(((Type) value).getDescriptor());
+ } else if (value instanceof byte[]) {
+ byte[] v = (byte[]) value;
+ for (int i = 0; i < v.length; i++) {
+ cp.newInteger(v[i]);
+ }
+ } else if (value instanceof boolean[]) {
+ boolean[] v = (boolean[]) value;
+ for (int i = 0; i < v.length; i++) {
+ cp.newInteger(v[i] ? 1 : 0);
+ }
+ } else if (value instanceof short[]) {
+ short[] v = (short[]) value;
+ for (int i = 0; i < v.length; i++) {
+ cp.newInteger(v[i]);
+ }
+ } else if (value instanceof char[]) {
+ char[] v = (char[]) value;
+ for (int i = 0; i < v.length; i++) {
+ cp.newInteger(v[i]);
+ }
+ } else if (value instanceof int[]) {
+ int[] v = (int[]) value;
+ for (int i = 0; i < v.length; i++) {
+ cp.newInteger(v[i]);
+ }
+ } else if (value instanceof long[]) {
+ long[] v = (long[]) value;
+ for (int i = 0; i < v.length; i++) {
+ cp.newLong(v[i]);
+ }
+ } else if (value instanceof float[]) {
+ float[] v = (float[]) value;
+ for (int i = 0; i < v.length; i++) {
+ cp.newFloat(v[i]);
+ }
+ } else if (value instanceof double[]) {
+ double[] v = (double[]) value;
+ for (int i = 0; i < v.length; i++) {
+ cp.newDouble(v[i]);
+ }
+ } else {
+ cp.newConst(value);
+ }
+ av.visit(name, value);
+ }
+
+ public void visitEnum(
+ final String name,
+ final String desc,
+ final String value)
+ {
+ if (name != null) {
+ cp.newUTF8(name);
+ }
+ cp.newUTF8(desc);
+ cp.newUTF8(value);
+ av.visitEnum(name, desc, value);
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String name,
+ final String desc)
+ {
+ if (name != null) {
+ cp.newUTF8(name);
+ }
+ cp.newUTF8(desc);
+ return new AnnotationConstantsCollector(av.visitAnnotation(name, desc),
+ cp);
+ }
+
+ public AnnotationVisitor visitArray(final String name) {
+ if (name != null) {
+ cp.newUTF8(name);
+ }
+ return new AnnotationConstantsCollector(av.visitArray(name), cp);
+ }
+
+ public void visitEnd() {
+ av.visitEnd();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/ClassConstantsCollector.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/ClassConstantsCollector.java
new file mode 100644
index 00000000000..9cfc6de31ee
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/ClassConstantsCollector.java
@@ -0,0 +1,212 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.optimizer;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassAdapter;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
+/**
+ * A {@link ClassVisitor} that collects the {@link Constant}s of the classes it
+ * visits.
+ *
+ * @author Eric Bruneton
+ */
+public class ClassConstantsCollector extends ClassAdapter {
+
+ private ConstantPool cp;
+
+ public ClassConstantsCollector(final ClassVisitor cv, final ConstantPool cp)
+ {
+ super(cv);
+ this.cp = cp;
+ }
+
+ public void visit(
+ final int version,
+ final int access,
+ final String name,
+ final String signature,
+ final String superName,
+ final String[] interfaces)
+ {
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ cp.newUTF8("Deprecated");
+ }
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
+ cp.newUTF8("Synthetic");
+ }
+ cp.newClass(name);
+ if (signature != null) {
+ cp.newUTF8("Signature");
+ cp.newUTF8(signature);
+ }
+ if (superName != null) {
+ cp.newClass(superName);
+ }
+ if (interfaces != null) {
+ for (int i = 0; i < interfaces.length; ++i) {
+ cp.newClass(interfaces[i]);
+ }
+ }
+ cv.visit(version, access, name, signature, superName, interfaces);
+ }
+
+ public void visitSource(final String source, final String debug) {
+ if (source != null) {
+ cp.newUTF8("SourceFile");
+ cp.newUTF8(source);
+ }
+ if (debug != null) {
+ cp.newUTF8("SourceDebugExtension");
+ }
+ cv.visitSource(source, debug);
+ }
+
+ public void visitOuterClass(
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ cp.newUTF8("EnclosingMethod");
+ cp.newClass(owner);
+ if (name != null && desc != null) {
+ cp.newNameType(name, desc);
+ }
+ cv.visitOuterClass(owner, name, desc);
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ cp.newUTF8(desc);
+ if (visible) {
+ cp.newUTF8("RuntimeVisibleAnnotations");
+ } else {
+ cp.newUTF8("RuntimeInvisibleAnnotations");
+ }
+ return new AnnotationConstantsCollector(cv.visitAnnotation(desc,
+ visible), cp);
+ }
+
+ public void visitAttribute(final Attribute attr) {
+ // can do nothing
+ cv.visitAttribute(attr);
+ }
+
+ public void visitInnerClass(
+ final String name,
+ final String outerName,
+ final String innerName,
+ final int access)
+ {
+ cp.newUTF8("InnerClasses");
+ if (name != null) {
+ cp.newClass(name);
+ }
+ if (outerName != null) {
+ cp.newClass(outerName);
+ }
+ if (innerName != null) {
+ cp.newClass(innerName);
+ }
+ cv.visitInnerClass(name, outerName, innerName, access);
+ }
+
+ public FieldVisitor visitField(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final Object value)
+ {
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
+ cp.newUTF8("Synthetic");
+ }
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ cp.newUTF8("Deprecated");
+ }
+ cp.newUTF8(name);
+ cp.newUTF8(desc);
+ if (signature != null) {
+ cp.newUTF8("Signature");
+ cp.newUTF8(signature);
+ }
+ if (value != null) {
+ cp.newConst(value);
+ }
+ return new FieldConstantsCollector(cv.visitField(access,
+ name,
+ desc,
+ signature,
+ value), cp);
+ }
+
+ public MethodVisitor visitMethod(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final String[] exceptions)
+ {
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
+ cp.newUTF8("Synthetic");
+ }
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ cp.newUTF8("Deprecated");
+ }
+ cp.newUTF8(name);
+ cp.newUTF8(desc);
+ if (signature != null) {
+ cp.newUTF8("Signature");
+ cp.newUTF8(signature);
+ }
+ if (exceptions != null) {
+ cp.newUTF8("Exceptions");
+ for (int i = 0; i < exceptions.length; ++i) {
+ cp.newClass(exceptions[i]);
+ }
+ }
+ return new MethodConstantsCollector(cv.visitMethod(access,
+ name,
+ desc,
+ signature,
+ exceptions), cp);
+ }
+
+ public void visitEnd() {
+ cv.visitEnd();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/ClassOptimizer.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/ClassOptimizer.java
new file mode 100644
index 00000000000..153b07ac286
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/ClassOptimizer.java
@@ -0,0 +1,182 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.optimizer;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassAdapter;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
+/**
+ * A {@link ClassAdapter} that renames fields and methods, and removes debug
+ * info.
+ *
+ * @author Eric Bruneton
+ */
+public class ClassOptimizer extends ClassAdapter {
+
+ private NameMapping mapping;
+
+ private String className;
+
+ private String pkgName;
+
+ public ClassOptimizer(final ClassVisitor cv, final NameMapping mapping) {
+ super(cv);
+ this.mapping = mapping;
+ }
+
+ public String getClassName() {
+ return className;
+ }
+
+ // ------------------------------------------------------------------------
+ // Overriden methods
+ // ------------------------------------------------------------------------
+
+ public void visit(
+ final int version,
+ final int access,
+ final String name,
+ final String signature,
+ final String superName,
+ final String[] interfaces)
+ {
+ className = name;
+ pkgName = name.substring(0, name.lastIndexOf('/'));
+ cv.visit(version,
+ access,
+ mapping.map(name),
+ null,
+ mapping.map(superName),
+ interfaces);
+ }
+
+ public void visitSource(final String source, final String debug) {
+ // remove debug info
+ }
+
+ public void visitOuterClass(
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ // remove debug info
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void visitAttribute(final Attribute attr) {
+ // remove non standard attribute
+ }
+
+ public void visitInnerClass(
+ final String name,
+ final String outerName,
+ final String innerName,
+ final int access)
+ {
+ // remove debug info
+ }
+
+ public FieldVisitor visitField(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final Object value)
+ {
+ String s = className + "." + name;
+ if ((access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED)) == 0) {
+ if ((access & Opcodes.ACC_FINAL) != 0
+ && (access & Opcodes.ACC_STATIC) != 0 && desc.equals("I"))
+ {
+ return null;
+ }
+ if (pkgName.equals("org/objectweb/asm")
+ && mapping.map(s).equals(name))
+ {
+ System.out.println("INFO: " + s + " could be renamed");
+ }
+ cv.visitField(access,
+ mapping.map(s),
+ mapping.fix(desc),
+ null,
+ value);
+ } else {
+ if (!mapping.map(s).equals(name)) {
+ throw new RuntimeException("The public or protected field " + s
+ + " must not be renamed.");
+ }
+ cv.visitField(access, name, desc, null, value);
+ }
+ return null; // remove debug info
+ }
+
+ public MethodVisitor visitMethod(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final String[] exceptions)
+ {
+ String s = className + "." + name + desc;
+ if ((access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED)) == 0) {
+ if (pkgName.equals("org/objectweb/asm") && !name.startsWith("<")
+ && mapping.map(s).equals(name))
+ {
+ System.out.println("INFO: " + s + " could be renamed");
+ }
+ return new MethodOptimizer(cv.visitMethod(access,
+ mapping.map(s),
+ mapping.fix(desc),
+ null,
+ exceptions), mapping);
+ } else {
+ if (!mapping.map(s).equals(name)) {
+ throw new RuntimeException("The public or protected method "
+ + s + " must not be renamed.");
+ }
+ return new MethodOptimizer(cv.visitMethod(access,
+ name,
+ desc,
+ null,
+ exceptions), mapping);
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/Constant.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/Constant.java
new file mode 100644
index 00000000000..b07b7c2d3f5
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/Constant.java
@@ -0,0 +1,265 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.optimizer;
+
+import org.objectweb.asm.ClassWriter;
+
+/**
+ * A constant pool item.
+ *
+ * @author Eric Bruneton
+ */
+class Constant {
+
+ /**
+ * Type of this constant pool item. A single class is used to represent all
+ * constant pool item types, in order to minimize the bytecode size of this
+ * package. The value of this field is I, J, F, D, S, s, C, T, G, M, or N
+ * (for Constant Integer, Long, Float, Double, STR, UTF8, Class, NameType,
+ * Fieldref, Methodref, or InterfaceMethodref constant pool items
+ * respectively).
+ */
+ char type;
+
+ /**
+ * Value of this item, for an integer item.
+ */
+ int intVal;
+
+ /**
+ * Value of this item, for a long item.
+ */
+ long longVal;
+
+ /**
+ * Value of this item, for a float item.
+ */
+ float floatVal;
+
+ /**
+ * Value of this item, for a double item.
+ */
+ double doubleVal;
+
+ /**
+ * First part of the value of this item, for items that do not hold a
+ * primitive value.
+ */
+ String strVal1;
+
+ /**
+ * Second part of the value of this item, for items that do not hold a
+ * primitive value.
+ */
+ String strVal2;
+
+ /**
+ * Third part of the value of this item, for items that do not hold a
+ * primitive value.
+ */
+ String strVal3;
+
+ /**
+ * The hash code value of this constant pool item.
+ */
+ int hashCode;
+
+ public Constant() {
+ }
+
+ public Constant(final Constant i) {
+ type = i.type;
+ intVal = i.intVal;
+ longVal = i.longVal;
+ floatVal = i.floatVal;
+ doubleVal = i.doubleVal;
+ strVal1 = i.strVal1;
+ strVal2 = i.strVal2;
+ strVal3 = i.strVal3;
+ hashCode = i.hashCode;
+ }
+
+ /**
+ * Sets this item to an integer item.
+ *
+ * @param intVal the value of this item.
+ */
+ void set(final int intVal) {
+ this.type = 'I';
+ this.intVal = intVal;
+ this.hashCode = 0x7FFFFFFF & (type + intVal);
+ }
+
+ /**
+ * Sets this item to a long item.
+ *
+ * @param longVal the value of this item.
+ */
+ void set(final long longVal) {
+ this.type = 'J';
+ this.longVal = longVal;
+ this.hashCode = 0x7FFFFFFF & (type + (int) longVal);
+ }
+
+ /**
+ * Sets this item to a float item.
+ *
+ * @param floatVal the value of this item.
+ */
+ void set(final float floatVal) {
+ this.type = 'F';
+ this.floatVal = floatVal;
+ this.hashCode = 0x7FFFFFFF & (type + (int) floatVal);
+ }
+
+ /**
+ * Sets this item to a double item.
+ *
+ * @param doubleVal the value of this item.
+ */
+ void set(final double doubleVal) {
+ this.type = 'D';
+ this.doubleVal = doubleVal;
+ this.hashCode = 0x7FFFFFFF & (type + (int) doubleVal);
+ }
+
+ /**
+ * Sets this item to an item that do not hold a primitive value.
+ *
+ * @param type the type of this item.
+ * @param strVal1 first part of the value of this item.
+ * @param strVal2 second part of the value of this item.
+ * @param strVal3 third part of the value of this item.
+ */
+ void set(
+ final char type,
+ final String strVal1,
+ final String strVal2,
+ final String strVal3)
+ {
+ this.type = type;
+ this.strVal1 = strVal1;
+ this.strVal2 = strVal2;
+ this.strVal3 = strVal3;
+ switch (type) {
+ case 's':
+ case 'S':
+ case 'C':
+ hashCode = 0x7FFFFFFF & (type + strVal1.hashCode());
+ return;
+ case 'T':
+ hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
+ * strVal2.hashCode());
+ return;
+ // case 'G':
+ // case 'M':
+ // case 'N':
+ default:
+ hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
+ * strVal2.hashCode() * strVal3.hashCode());
+ }
+ }
+
+ void write(final ClassWriter cw) {
+ switch (type) {
+ case 'I':
+ cw.newConst(new Integer(intVal));
+ break;
+ case 'J':
+ cw.newConst(new Long(longVal));
+ break;
+ case 'F':
+ cw.newConst(new Float(floatVal));
+ break;
+ case 'D':
+ cw.newConst(new Double(doubleVal));
+ break;
+ case 'S':
+ cw.newConst(strVal1);
+ break;
+ case 's':
+ cw.newUTF8(strVal1);
+ break;
+ case 'C':
+ cw.newClass(strVal1);
+ break;
+ case 'T':
+ cw.newNameType(strVal1, strVal2);
+ break;
+ case 'G':
+ cw.newField(strVal1, strVal2, strVal3);
+ break;
+ case 'M':
+ cw.newMethod(strVal1, strVal2, strVal3, false);
+ break;
+ case 'N':
+ cw.newMethod(strVal1, strVal2, strVal3, true);
+ break;
+ }
+ }
+
+ public boolean equals(final Object o) {
+ if (!(o instanceof Constant)) {
+ return false;
+ }
+ Constant c = (Constant) o;
+ if (c.type == type) {
+ switch (type) {
+ case 'I':
+ return c.intVal == intVal;
+ case 'J':
+ return c.longVal == longVal;
+ case 'F':
+ return c.floatVal == floatVal;
+ case 'D':
+ return c.doubleVal == doubleVal;
+ case 's':
+ case 'S':
+ case 'C':
+ return c.strVal1.equals(strVal1);
+ case 'T':
+ return c.strVal1.equals(strVal1)
+ && c.strVal2.equals(strVal2);
+ // case 'G':
+ // case 'M':
+ // case 'N':
+ default:
+ return c.strVal1.equals(strVal1)
+ && c.strVal2.equals(strVal2)
+ && c.strVal3.equals(strVal3);
+ }
+ }
+ return false;
+ }
+
+ public int hashCode() {
+ return hashCode;
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/ConstantPool.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/ConstantPool.java
new file mode 100644
index 00000000000..c918bef0f8e
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/ConstantPool.java
@@ -0,0 +1,198 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.optimizer;
+
+import java.util.HashMap;
+
+import org.objectweb.asm.Type;
+
+/**
+ * A constant pool.
+ *
+ * @author Eric Bruneton
+ */
+public class ConstantPool extends HashMap {
+
+ private Constant key1 = new Constant();
+
+ private Constant key2 = new Constant();
+
+ private Constant key3 = new Constant();
+
+ public Constant newInteger(final int value) {
+ key1.set(value);
+ Constant result = get(key1);
+ if (result == null) {
+ result = new Constant(key1);
+ put(result);
+ }
+ return result;
+ }
+
+ public Constant newFloat(final float value) {
+ key1.set(value);
+ Constant result = get(key1);
+ if (result == null) {
+ result = new Constant(key1);
+ put(result);
+ }
+ return result;
+ }
+
+ public Constant newLong(final long value) {
+ key1.set(value);
+ Constant result = get(key1);
+ if (result == null) {
+ result = new Constant(key1);
+ put(result);
+ }
+ return result;
+ }
+
+ public Constant newDouble(final double value) {
+ key1.set(value);
+ Constant result = get(key1);
+ if (result == null) {
+ result = new Constant(key1);
+ put(result);
+ }
+ return result;
+ }
+
+ public Constant newUTF8(final String value) {
+ key1.set('s', value, null, null);
+ Constant result = get(key1);
+ if (result == null) {
+ result = new Constant(key1);
+ put(result);
+ }
+ return result;
+ }
+
+ private Constant newString(final String value) {
+ key2.set('S', value, null, null);
+ Constant result = get(key2);
+ if (result == null) {
+ newUTF8(value);
+ result = new Constant(key2);
+ put(result);
+ }
+ return result;
+ }
+
+ public Constant newClass(final String value) {
+ key2.set('C', value, null, null);
+ Constant result = get(key2);
+ if (result == null) {
+ newUTF8(value);
+ result = new Constant(key2);
+ put(result);
+ }
+ return result;
+ }
+
+ public Constant newConst(final Object cst) {
+ if (cst instanceof Integer) {
+ int val = ((Integer) cst).intValue();
+ return newInteger(val);
+ } else if (cst instanceof Float) {
+ float val = ((Float) cst).floatValue();
+ return newFloat(val);
+ } else if (cst instanceof Long) {
+ long val = ((Long) cst).longValue();
+ return newLong(val);
+ } else if (cst instanceof Double) {
+ double val = ((Double) cst).doubleValue();
+ return newDouble(val);
+ } else if (cst instanceof String) {
+ return newString((String) cst);
+ } else if (cst instanceof Type) {
+ Type t = (Type) cst;
+ return newClass(t.getSort() == Type.OBJECT
+ ? t.getInternalName()
+ : t.getDescriptor());
+ } else {
+ throw new IllegalArgumentException("value " + cst);
+ }
+ }
+
+ public Constant newField(
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ key3.set('G', owner, name, desc);
+ Constant result = get(key3);
+ if (result == null) {
+ newClass(owner);
+ newNameType(name, desc);
+ result = new Constant(key3);
+ put(result);
+ }
+ return result;
+ }
+
+ public Constant newMethod(
+ final String owner,
+ final String name,
+ final String desc,
+ final boolean itf)
+ {
+ key3.set(itf ? 'N' : 'M', owner, name, desc);
+ Constant result = get(key3);
+ if (result == null) {
+ newClass(owner);
+ newNameType(name, desc);
+ result = new Constant(key3);
+ put(result);
+ }
+ return result;
+ }
+
+ public Constant newNameType(final String name, final String desc) {
+ key2.set('T', name, desc, null);
+ Constant result = get(key2);
+ if (result == null) {
+ newUTF8(name);
+ newUTF8(desc);
+ result = new Constant(key2);
+ put(result);
+ }
+ return result;
+ }
+
+ private Constant get(final Constant key) {
+ return (Constant) get((Object) key);
+ }
+
+ private void put(final Constant cst) {
+ put(cst, cst);
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/FieldConstantsCollector.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/FieldConstantsCollector.java
new file mode 100644
index 00000000000..e5e9b7682ff
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/FieldConstantsCollector.java
@@ -0,0 +1,76 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.optimizer;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.FieldVisitor;
+
+/**
+ * A {@link FieldVisitor} that collects the {@link Constant}s of the fields it
+ * visits.
+ *
+ * @author Eric Bruneton
+ */
+public class FieldConstantsCollector implements FieldVisitor {
+
+ private FieldVisitor fv;
+
+ private ConstantPool cp;
+
+ public FieldConstantsCollector(final FieldVisitor fv, final ConstantPool cp)
+ {
+ this.fv = fv;
+ this.cp = cp;
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ cp.newUTF8(desc);
+ if (visible) {
+ cp.newUTF8("RuntimeVisibleAnnotations");
+ } else {
+ cp.newUTF8("RuntimeInvisibleAnnotations");
+ }
+ return new AnnotationConstantsCollector(fv.visitAnnotation(desc,
+ visible), cp);
+ }
+
+ public void visitAttribute(final Attribute attr) {
+ // can do nothing
+ fv.visitAttribute(attr);
+ }
+
+ public void visitEnd() {
+ fv.visitEnd();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/JarOptimizer.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/JarOptimizer.java
new file mode 100644
index 00000000000..8302d99f75f
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/JarOptimizer.java
@@ -0,0 +1,87 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.optimizer;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Enumeration;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipOutputStream;
+
+/**
+ * A Jar file optimizer.
+ *
+ * @author Eric Bruneton
+ */
+public class JarOptimizer {
+
+ public static void main(final String[] args) throws IOException {
+ File f = new File(args[0]);
+ optimize(f);
+ }
+
+ static void optimize(final File f) throws IOException {
+ if (f.isDirectory()) {
+ File[] files = f.listFiles();
+ for (int i = 0; i < files.length; ++i) {
+ optimize(files[i]);
+ }
+ } else if (f.getName().endsWith(".jar")) {
+ File g = new File(f.getParentFile(), f.getName() + ".new");
+ ZipFile zf = new ZipFile(f);
+ ZipOutputStream out = new ZipOutputStream(new FileOutputStream(g));
+ Enumeration e = zf.entries();
+ byte[] buf = new byte[10000];
+ while (e.hasMoreElements()) {
+ ZipEntry ze = (ZipEntry) e.nextElement();
+ if (ze.isDirectory()) {
+ continue;
+ }
+ out.putNextEntry(ze);
+ InputStream is = zf.getInputStream(ze);
+ int n;
+ do {
+ n = is.read(buf, 0, buf.length);
+ if (n != -1) {
+ out.write(buf, 0, n);
+ }
+ } while (n != -1);
+ out.closeEntry();
+ }
+ out.close();
+ zf.close();
+ f.delete();
+ g.renameTo(f);
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/MethodConstantsCollector.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/MethodConstantsCollector.java
new file mode 100644
index 00000000000..dc7b1c1d6ac
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/MethodConstantsCollector.java
@@ -0,0 +1,168 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.optimizer;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodAdapter;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
+/**
+ * An {@link MethodVisitor} that collects the {@link Constant}s of the methods
+ * it visits.
+ *
+ * @author Eric Bruneton
+ */
+public class MethodConstantsCollector extends MethodAdapter {
+
+ private ConstantPool cp;
+
+ public MethodConstantsCollector(
+ final MethodVisitor mv,
+ final ConstantPool cp)
+ {
+ super(mv);
+ this.cp = cp;
+ }
+
+ public AnnotationVisitor visitAnnotationDefault() {
+ cp.newUTF8("AnnotationDefault");
+ return new AnnotationConstantsCollector(mv.visitAnnotationDefault(), cp);
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ cp.newUTF8(desc);
+ if (visible) {
+ cp.newUTF8("RuntimeVisibleAnnotations");
+ } else {
+ cp.newUTF8("RuntimeInvisibleAnnotations");
+ }
+ return new AnnotationConstantsCollector(mv.visitAnnotation(desc,
+ visible), cp);
+ }
+
+ public AnnotationVisitor visitParameterAnnotation(
+ final int parameter,
+ final String desc,
+ final boolean visible)
+ {
+ cp.newUTF8(desc);
+ if (visible) {
+ cp.newUTF8("RuntimeVisibleParameterAnnotations");
+ } else {
+ cp.newUTF8("RuntimeInvisibleParameterAnnotations");
+ }
+ return new AnnotationConstantsCollector(mv.visitParameterAnnotation(parameter,
+ desc,
+ visible),
+ cp);
+ }
+
+ public void visitTypeInsn(final int opcode, final String desc) {
+ cp.newClass(desc);
+ mv.visitTypeInsn(opcode, desc);
+ }
+
+ public void visitFieldInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ cp.newField(owner, name, desc);
+ mv.visitFieldInsn(opcode, owner, name, desc);
+ }
+
+ public void visitMethodInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ boolean itf = opcode == Opcodes.INVOKEINTERFACE;
+ cp.newMethod(owner, name, desc, itf);
+ mv.visitMethodInsn(opcode, owner, name, desc);
+ }
+
+ public void visitLdcInsn(final Object cst) {
+ cp.newConst(cst);
+ mv.visitLdcInsn(cst);
+ }
+
+ public void visitMultiANewArrayInsn(final String desc, final int dims) {
+ cp.newClass(desc);
+ mv.visitMultiANewArrayInsn(desc, dims);
+ }
+
+ public void visitTryCatchBlock(
+ final Label start,
+ final Label end,
+ final Label handler,
+ final String type)
+ {
+ if (type != null) {
+ cp.newClass(type);
+ }
+ mv.visitTryCatchBlock(start, end, handler, type);
+ }
+
+ public void visitLocalVariable(
+ final String name,
+ final String desc,
+ final String signature,
+ final Label start,
+ final Label end,
+ final int index)
+ {
+ if (signature != null) {
+ cp.newUTF8("LocalVariableTypeTable");
+ cp.newUTF8(name);
+ cp.newUTF8(signature);
+ }
+ cp.newUTF8("LocalVariableTable");
+ cp.newUTF8(name);
+ cp.newUTF8(desc);
+ mv.visitLocalVariable(name, desc, signature, start, end, index);
+ }
+
+ public void visitLineNumber(final int line, final Label start) {
+ cp.newUTF8("LineNumberTable");
+ mv.visitLineNumber(line, start);
+ }
+
+ public void visitMaxs(final int maxStack, final int maxLocals) {
+ cp.newUTF8("Code");
+ mv.visitMaxs(maxStack, maxLocals);
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/MethodOptimizer.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/MethodOptimizer.java
new file mode 100644
index 00000000000..91fa98b2a2f
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/MethodOptimizer.java
@@ -0,0 +1,108 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.optimizer;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodAdapter;
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * A {@link MethodAdapter} that renames fields and methods, and removes debug
+ * info.
+ *
+ * @author Eric Bruneton
+ */
+public class MethodOptimizer extends MethodAdapter {
+
+ private NameMapping mapping;
+
+ public MethodOptimizer(final MethodVisitor mv, final NameMapping mapping) {
+ super(mv);
+ this.mapping = mapping;
+ }
+
+ // ------------------------------------------------------------------------
+ // Overriden methods
+ // ------------------------------------------------------------------------
+
+ public AnnotationVisitor visitAnnotationDefault() {
+ throw new UnsupportedOperationException();
+ }
+
+ public AnnotationVisitor visitParameterAnnotation(
+ final int parameter,
+ final String desc,
+ final boolean visible)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void visitTypeInsn(final int opcode, final String desc) {
+ mv.visitTypeInsn(opcode, desc.startsWith("[")
+ ? mapping.fix(desc)
+ : mapping.map(desc));
+ }
+
+ public void visitFieldInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ mv.visitFieldInsn(opcode, mapping.map(owner), mapping.map(owner + "."
+ + name), mapping.fix(desc));
+ }
+
+ public void visitMethodInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ mv.visitMethodInsn(opcode, mapping.map(owner), mapping.map(owner + "."
+ + name + desc), mapping.fix(desc));
+ }
+
+ public void visitLocalVariable(
+ final String name,
+ final String desc,
+ final String signature,
+ final Label start,
+ final Label end,
+ final int index)
+ {
+ // remove debug info
+ }
+
+ public void visitLineNumber(final int line, final Label start) {
+ // remove debug info
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/NameMapping.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/NameMapping.java
new file mode 100644
index 00000000000..9cefb1ffe18
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/NameMapping.java
@@ -0,0 +1,101 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.optimizer;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
+import org.objectweb.asm.Type;
+
+/**
+ * A mapping from names to names, used to rename classes, fields and methods.
+ *
+ * @author Eric Bruneton
+ */
+public class NameMapping extends Properties {
+
+ public final Set unused;
+
+ public NameMapping(final String file) throws IOException {
+ load(new FileInputStream(file));
+ unused = new HashSet(keySet());
+ }
+
+ public String map(final String name) {
+ String s = (String) get(name);
+ if (s == null) {
+ int p = name.indexOf('.');
+ if (p != -1) {
+ int q = name.indexOf('(');
+ if (q != -1) {
+ s = name.substring(p + 1, q);
+ } else {
+ s = name.substring(p + 1);
+ }
+ } else {
+ s = name;
+ }
+ } else {
+ unused.remove(name);
+ }
+ return s;
+ }
+
+ public String fix(final String desc) {
+ if (desc.startsWith("(")) {
+ Type[] arguments = Type.getArgumentTypes(desc);
+ Type result = Type.getReturnType(desc);
+ for (int i = 0; i < arguments.length; ++i) {
+ arguments[i] = fix(arguments[i]);
+ }
+ result = fix(result);
+ return Type.getMethodDescriptor(result, arguments);
+ } else {
+ return fix(Type.getType(desc)).getDescriptor();
+ }
+ }
+
+ private Type fix(final Type t) {
+ if (t.getSort() == Type.OBJECT) {
+ return Type.getType("L" + map(t.getInternalName()) + ";");
+ } else if (t.getSort() == Type.ARRAY) {
+ String s = fix(t.getElementType()).getDescriptor();
+ for (int i = 0; i < t.getDimensions(); ++i) {
+ s = "[" + s;
+ }
+ return Type.getType(s);
+ } else {
+ return t;
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/Shrinker.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/Shrinker.java
new file mode 100644
index 00000000000..94e4068f0e5
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/Shrinker.java
@@ -0,0 +1,168 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.optimizer;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassWriter;
+
+/**
+ * A class file shrinker utility.
+ *
+ * @author Eric Bruneton
+ */
+public class Shrinker {
+
+ public static void main(final String[] args) throws IOException {
+ NameMapping mapping = new NameMapping(args[0]);
+ File f = new File(args[1]);
+ File d = new File(args[2]);
+ optimize(f, d, mapping);
+ Iterator i = mapping.unused.iterator();
+ while (i.hasNext()) {
+ System.out.println("INFO: unused mapping " + i.next());
+ }
+ }
+
+ static void optimize(final File f, final File d, final NameMapping mapping)
+ throws IOException
+ {
+ if (f.isDirectory()) {
+ File[] files = f.listFiles();
+ for (int i = 0; i < files.length; ++i) {
+ optimize(files[i], d, mapping);
+ }
+ } else if (f.getName().endsWith(".class")) {
+ ConstantPool cp = new ConstantPool();
+ ClassReader cr = new ClassReader(new FileInputStream(f));
+ ClassWriter cw = new ClassWriter(false);
+ ClassConstantsCollector ccc = new ClassConstantsCollector(cw, cp);
+ ClassOptimizer co = new ClassOptimizer(ccc, mapping);
+ cr.accept(co, true);
+
+ Set constants = new TreeSet(new ConstantComparator());
+ constants.addAll(cp.values());
+
+ cr = new ClassReader(cw.toByteArray());
+ cw = new ClassWriter(false);
+ Iterator i = constants.iterator();
+ while (i.hasNext()) {
+ Constant c = (Constant) i.next();
+ c.write(cw);
+ }
+ cr.accept(cw, true);
+
+ String n = mapping.map(co.getClassName());
+ File g = new File(d, n + ".class");
+ if (!g.exists() || g.lastModified() < f.lastModified()) {
+ g.getParentFile().mkdirs();
+ OutputStream os = new FileOutputStream(g);
+ os.write(cw.toByteArray());
+ os.close();
+ }
+ }
+ }
+
+ static class ConstantComparator implements Comparator {
+
+ public int compare(final Object o1, final Object o2) {
+ Constant c1 = (Constant) o1;
+ Constant c2 = (Constant) o2;
+ int d = getSort(c1) - getSort(c2);
+ if (d == 0) {
+ switch (c1.type) {
+ case 'I':
+ return new Integer(c1.intVal).compareTo(new Integer(c2.intVal));
+ case 'J':
+ return new Long(c1.longVal).compareTo(new Long(c2.longVal));
+ case 'F':
+ return new Float(c1.floatVal).compareTo(new Float(c2.floatVal));
+ case 'D':
+ return new Double(c1.doubleVal).compareTo(new Double(c2.doubleVal));
+ case 's':
+ case 'S':
+ case 'C':
+ return c1.strVal1.compareTo(c2.strVal1);
+ case 'T':
+ d = c1.strVal1.compareTo(c2.strVal1);
+ if (d == 0) {
+ d = c1.strVal2.compareTo(c2.strVal2);
+ }
+ break;
+ default:
+ d = c1.strVal1.compareTo(c2.strVal1);
+ if (d == 0) {
+ d = c1.strVal2.compareTo(c2.strVal2);
+ if (d == 0) {
+ d = c1.strVal3.compareTo(c2.strVal3);
+ }
+ }
+ }
+ }
+ return d;
+ }
+
+ private int getSort(Constant c) {
+ switch (c.type) {
+ case 'I':
+ return 0;
+ case 'J':
+ return 1;
+ case 'F':
+ return 2;
+ case 'D':
+ return 3;
+ case 's':
+ return 4;
+ case 'S':
+ return 5;
+ case 'C':
+ return 6;
+ case 'T':
+ return 7;
+ case 'G':
+ return 8;
+ case 'M':
+ return 9;
+ default:
+ return 10;
+ }
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/shrink.properties b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/shrink.properties
new file mode 100644
index 00000000000..868780bdd2d
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/optimizer/shrink.properties
@@ -0,0 +1,225 @@
+# class mappings
+
+#org/objectweb/asm/Edge=org/objectweb/asm/a
+#org/objectweb/asm/Item=org/objectweb/asm/b
+#org/objectweb/asm/FieldWriter=org/objectweb/asm/c
+#org/objectweb/asm/MethodWriter=org/objectweb/asm/d
+#org/objectweb/asm/AnnotationWriter=org/objectweb/asm/e
+
+# field mappings
+
+org/objectweb/asm/AnnotationWriter.cw=a
+org/objectweb/asm/AnnotationWriter.size=b
+org/objectweb/asm/AnnotationWriter.named=c
+org/objectweb/asm/AnnotationWriter.bv=d
+org/objectweb/asm/AnnotationWriter.parent=e
+org/objectweb/asm/AnnotationWriter.offset=f
+org/objectweb/asm/AnnotationWriter.next=g
+org/objectweb/asm/AnnotationWriter.prev=h
+
+org/objectweb/asm/Attribute.next=a
+org/objectweb/asm/Attribute.value=b
+
+org/objectweb/asm/ByteVector.data=a
+org/objectweb/asm/ByteVector.length=b
+
+org/objectweb/asm/ClassReader.items=a
+org/objectweb/asm/ClassReader.strings=c
+org/objectweb/asm/ClassReader.maxStringLength=d
+#org/objectweb/asm/ClassReader.header=e
+
+org/objectweb/asm/ClassWriter.TYPE=a
+org/objectweb/asm/ClassWriter.version=b
+org/objectweb/asm/ClassWriter.index=c
+org/objectweb/asm/ClassWriter.pool=d
+org/objectweb/asm/ClassWriter.items=e
+org/objectweb/asm/ClassWriter.threshold=f
+org/objectweb/asm/ClassWriter.key=g
+org/objectweb/asm/ClassWriter.key2=h
+org/objectweb/asm/ClassWriter.key3=i
+org/objectweb/asm/ClassWriter.access=j
+org/objectweb/asm/ClassWriter.name=k
+org/objectweb/asm/ClassWriter.signature=l
+org/objectweb/asm/ClassWriter.superName=m
+org/objectweb/asm/ClassWriter.interfaceCount=n
+org/objectweb/asm/ClassWriter.interfaces=o
+org/objectweb/asm/ClassWriter.sourceFile=p
+org/objectweb/asm/ClassWriter.sourceDebug=q
+org/objectweb/asm/ClassWriter.enclosingMethodOwner=r
+org/objectweb/asm/ClassWriter.enclosingMethod=s
+org/objectweb/asm/ClassWriter.anns=t
+org/objectweb/asm/ClassWriter.ianns=u
+org/objectweb/asm/ClassWriter.attrs=v
+org/objectweb/asm/ClassWriter.innerClassesCount=w
+org/objectweb/asm/ClassWriter.innerClasses=x
+org/objectweb/asm/ClassWriter.firstField=y
+org/objectweb/asm/ClassWriter.lastField=z
+org/objectweb/asm/ClassWriter.firstMethod=A
+org/objectweb/asm/ClassWriter.lastMethod=B
+org/objectweb/asm/ClassWriter.computeMaxs=C
+org/objectweb/asm/ClassWriter.cr=D
+
+org/objectweb/asm/Edge.stackSize=a
+org/objectweb/asm/Edge.successor=b
+org/objectweb/asm/Edge.next=c
+
+org/objectweb/asm/Handler.start=a
+org/objectweb/asm/Handler.end=b
+org/objectweb/asm/Handler.handler=c
+org/objectweb/asm/Handler.desc=d
+org/objectweb/asm/Handler.type=e
+org/objectweb/asm/Handler.next=f
+
+org/objectweb/asm/FieldWriter.next=a
+org/objectweb/asm/FieldWriter.cw=b
+org/objectweb/asm/FieldWriter.access=c
+org/objectweb/asm/FieldWriter.name=d
+org/objectweb/asm/FieldWriter.desc=e
+org/objectweb/asm/FieldWriter.signature=f
+org/objectweb/asm/FieldWriter.value=g
+org/objectweb/asm/FieldWriter.anns=h
+org/objectweb/asm/FieldWriter.ianns=i
+org/objectweb/asm/FieldWriter.attrs=j
+
+org/objectweb/asm/Item.index=a
+org/objectweb/asm/Item.type=b
+org/objectweb/asm/Item.intVal=c
+org/objectweb/asm/Item.longVal=d
+org/objectweb/asm/Item.floatVal=e
+org/objectweb/asm/Item.doubleVal=f
+org/objectweb/asm/Item.strVal1=g
+org/objectweb/asm/Item.strVal2=h
+org/objectweb/asm/Item.strVal3=i
+org/objectweb/asm/Item.hashCode=j
+org/objectweb/asm/Item.next=k
+
+org/objectweb/asm/Label.resolved=a
+org/objectweb/asm/Label.position=b
+org/objectweb/asm/Label.resized=c
+org/objectweb/asm/Label.referenceCount=d
+org/objectweb/asm/Label.srcAndRefPositions=e
+org/objectweb/asm/Label.beginStackSize=f
+org/objectweb/asm/Label.maxStackSize=g
+org/objectweb/asm/Label.successors=h
+org/objectweb/asm/Label.next=i
+org/objectweb/asm/Label.pushed=j
+org/objectweb/asm/Label.line=k
+
+org/objectweb/asm/MethodWriter.next=a
+org/objectweb/asm/MethodWriter.cw=b
+org/objectweb/asm/MethodWriter.access=c
+org/objectweb/asm/MethodWriter.name=d
+org/objectweb/asm/MethodWriter.desc=e
+org/objectweb/asm/MethodWriter.descriptor=f
+org/objectweb/asm/MethodWriter.signature=g
+org/objectweb/asm/MethodWriter.exceptionCount=h
+org/objectweb/asm/MethodWriter.exceptions=i
+org/objectweb/asm/MethodWriter.annd=j
+org/objectweb/asm/MethodWriter.anns=k
+org/objectweb/asm/MethodWriter.ianns=l
+org/objectweb/asm/MethodWriter.panns=m
+org/objectweb/asm/MethodWriter.ipanns=n
+org/objectweb/asm/MethodWriter.attrs=o
+org/objectweb/asm/MethodWriter.code=p
+org/objectweb/asm/MethodWriter.maxStack=q
+org/objectweb/asm/MethodWriter.maxLocals=r
+org/objectweb/asm/MethodWriter.catchCount=s
+org/objectweb/asm/MethodWriter.catchTable=t
+org/objectweb/asm/MethodWriter.localVarCount=u
+org/objectweb/asm/MethodWriter.localVar=v
+org/objectweb/asm/MethodWriter.localVarTypeCount=w
+org/objectweb/asm/MethodWriter.localVarType=x
+org/objectweb/asm/MethodWriter.lineNumberCount=y
+org/objectweb/asm/MethodWriter.lineNumber=z
+org/objectweb/asm/MethodWriter.cattrs=A
+org/objectweb/asm/MethodWriter.resize=B
+org/objectweb/asm/MethodWriter.computeMaxs=C
+org/objectweb/asm/MethodWriter.stackSize=D
+org/objectweb/asm/MethodWriter.maxStackSize=E
+org/objectweb/asm/MethodWriter.currentBlock=F
+org/objectweb/asm/MethodWriter.blockStack=G
+org/objectweb/asm/MethodWriter.SIZE=H
+org/objectweb/asm/MethodWriter.classReaderOffset=I
+org/objectweb/asm/MethodWriter.classReaderLength=J
+org/objectweb/asm/MethodWriter.lastHandler=K
+
+org/objectweb/asm/Type.sort=a
+org/objectweb/asm/Type.buf=b
+org/objectweb/asm/Type.off=c
+org/objectweb/asm/Type.len=d
+
+org/objectweb/asm/signature/SignatureReader.signature=a
+
+org/objectweb/asm/signature/SignatureWriter.buf=a
+org/objectweb/asm/signature/SignatureWriter.hasFormals=b
+org/objectweb/asm/signature/SignatureWriter.hasParameters=c
+org/objectweb/asm/signature/SignatureWriter.argumentStack=d
+
+# method mappings
+
+org/objectweb/asm/AnnotationWriter.getSize()I=a
+org/objectweb/asm/AnnotationWriter.put([Lorg/objectweb/asm/AnnotationWriter;Lorg/objectweb/asm/ByteVector;)V=a
+org/objectweb/asm/AnnotationWriter.put(Lorg/objectweb/asm/ByteVector;)V=a
+
+org/objectweb/asm/Attribute.getCount()I=a
+org/objectweb/asm/Attribute.getSize(Lorg/objectweb/asm/ClassWriter;[BIII)I=a
+org/objectweb/asm/Attribute.put(Lorg/objectweb/asm/ClassWriter;[BIIILorg/objectweb/asm/ByteVector;)V=a
+
+org/objectweb/asm/ByteVector.enlarge(I)V=a
+org/objectweb/asm/ByteVector.put11(II)Lorg/objectweb/asm/ByteVector;=a
+org/objectweb/asm/ByteVector.put12(II)Lorg/objectweb/asm/ByteVector;=b
+
+org/objectweb/asm/ClassReader.copyPool(Lorg/objectweb/asm/ClassWriter;)V=a
+org/objectweb/asm/ClassReader.readAnnotationValue(I[CLjava/lang/String;Lorg/objectweb/asm/AnnotationVisitor;)I=a
+org/objectweb/asm/ClassReader.readAnnotationValues(I[CLorg/objectweb/asm/AnnotationVisitor;)I=a
+org/objectweb/asm/ClassReader.readAttribute([Lorg/objectweb/asm/Attribute;Ljava/lang/String;II[CI[Lorg/objectweb/asm/Label;)Lorg/objectweb/asm/Attribute;=a
+org/objectweb/asm/ClassReader.readClass(Ljava/io/InputStream;)[B=a
+org/objectweb/asm/ClassReader.readParameterAnnotations(I[CZLorg/objectweb/asm/MethodVisitor;)V=a
+org/objectweb/asm/ClassReader.readUTF(II[C)Ljava/lang/String;=a
+
+org/objectweb/asm/ClassWriter.get(Lorg/objectweb/asm/Item;)Lorg/objectweb/asm/Item;=a
+org/objectweb/asm/ClassWriter.newClassItem(Ljava/lang/String;)Lorg/objectweb/asm/Item;=a
+org/objectweb/asm/ClassWriter.newConstItem(Ljava/lang/Object;)Lorg/objectweb/asm/Item;=a
+org/objectweb/asm/ClassWriter.newDouble(D)Lorg/objectweb/asm/Item;=a
+org/objectweb/asm/ClassWriter.newFloat(F)Lorg/objectweb/asm/Item;=a
+org/objectweb/asm/ClassWriter.newInteger(I)Lorg/objectweb/asm/Item;=a
+org/objectweb/asm/ClassWriter.newLong(J)Lorg/objectweb/asm/Item;=a
+org/objectweb/asm/ClassWriter.newMethodItem(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Lorg/objectweb/asm/Item;=a
+org/objectweb/asm/ClassWriter.newString(Ljava/lang/String;)Lorg/objectweb/asm/Item;=b
+org/objectweb/asm/ClassWriter.put122(III)V=a
+org/objectweb/asm/ClassWriter.put(Lorg/objectweb/asm/Item;)V=b
+
+org/objectweb/asm/FieldWriter.getSize()I=a
+org/objectweb/asm/FieldWriter.put(Lorg/objectweb/asm/ByteVector;)V=a
+
+org/objectweb/asm/Item.isEqualTo(Lorg/objectweb/asm/Item;)Z=a
+org/objectweb/asm/Item.set(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V=a
+org/objectweb/asm/Item.set(D)V=a
+org/objectweb/asm/Item.set(F)V=a
+org/objectweb/asm/Item.set(I)V=a
+org/objectweb/asm/Item.set(J)V=a
+
+org/objectweb/asm/Label.addReference(II)V=a
+org/objectweb/asm/Label.put(Lorg/objectweb/asm/MethodWriter;Lorg/objectweb/asm/ByteVector;IZ)V=a
+org/objectweb/asm/Label.resolve(Lorg/objectweb/asm/MethodWriter;I[B)Z=a
+
+org/objectweb/asm/MethodWriter.addSuccessor(ILorg/objectweb/asm/Label;)V=a
+org/objectweb/asm/MethodWriter.getArgumentsAndReturnSizes(Ljava/lang/String;)I=a
+org/objectweb/asm/MethodWriter.getNewOffset([I[III)I=a
+org/objectweb/asm/MethodWriter.getSize()I=a
+org/objectweb/asm/MethodWriter.put(Lorg/objectweb/asm/ByteVector;)V=a
+org/objectweb/asm/MethodWriter.readInt([BI)I=a
+org/objectweb/asm/MethodWriter.readShort([BI)S=b
+org/objectweb/asm/MethodWriter.readUnsignedShort([BI)I=c
+org/objectweb/asm/MethodWriter.resizeInstructions([I[II)[I=a
+org/objectweb/asm/MethodWriter.writeShort([BII)V=a
+org/objectweb/asm/MethodWriter.getNewOffset([I[ILorg/objectweb/asm/Label;)V=a
+
+org/objectweb/asm/Type.getType([CI)Lorg/objectweb/asm/Type;=a
+org/objectweb/asm/Type.getDescriptor(Ljava/lang/StringBuffer;)V=a
+org/objectweb/asm/Type.getDescriptor(Ljava/lang/StringBuffer;Ljava/lang/Class;)V=a
+
+org/objectweb/asm/signature/SignatureReader.parseType(Ljava/lang/String;ILorg/objectweb/asm/signature/SignatureVisitor;)I=a
+
+org/objectweb/asm/signature/SignatureWriter.endFormals()V=a
+org/objectweb/asm/signature/SignatureWriter.endArguments()V=b
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/package.html b/libjava/classpath/tools/external/asm/org/objectweb/asm/package.html
new file mode 100644
index 00000000000..1383dbee521
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/package.html
@@ -0,0 +1,87 @@
+<html>
+<!--
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<body>
+Provides a small and fast bytecode manipulation framework.
+
+<p>
+The <a href="http://www.objectweb.org/asm">ASM</a> framework is organized
+around the {@link org.objectweb.asm.ClassVisitor ClassVisitor},
+{@link org.objectweb.asm.FieldVisitor FieldVisitor} and
+{@link org.objectweb.asm.MethodVisitor MethodVisitor} interfaces, which allow
+one to visit the fields and methods of a class, including the bytecode
+instructions of each method.
+
+<p>
+In addition to these main interfaces, ASM provides a {@link
+org.objectweb.asm.ClassReader ClassReader} class, that can parse an
+existing class and make a given visitor visit it. ASM also provides
+a {@link org.objectweb.asm.ClassWriter ClassWriter} class, which is
+a visitor that generates Java class files.
+
+<p>
+In order to generate a class from scratch, only the {@link
+org.objectweb.asm.ClassWriter ClassWriter} class is necessary. Indeed,
+in order to generate a class, one must just call its visit<i>XXX</i>
+methods with the appropriate arguments to generate the desired fields
+and methods. See the "helloworld" example in the ASM distribution for
+more details about class generation.
+
+<p>
+In order to modify existing classes, one must use a {@link
+org.objectweb.asm.ClassReader ClassReader} class to analyze
+the original class, a class modifier, and a {@link org.objectweb.asm.ClassWriter
+ClassWriter} to construct the modified class. The class modifier
+is just a {@link org.objectweb.asm.ClassVisitor ClassVisitor}
+that delegates most of the work to another {@link org.objectweb.asm.ClassVisitor
+ClassVisitor}, but that sometimes changes some parameter values,
+or call additional methods, in order to implement the desired
+modification process. In order to make it easier to implement such
+class modifiers, ASM provides the {@link org.objectweb.asm.ClassAdapter
+ClassAdapter} and {@link org.objectweb.asm.MethodAdapter MethodAdapter}
+classes, which implement the {@link org.objectweb.asm.ClassVisitor ClassVisitor}
+and {@link org.objectweb.asm.MethodVisitor MethodVisitor} interfaces by
+delegating all work to other visitors. See the "adapt" example in the ASM
+distribution for more details about class modification.
+
+<p>
+The size of the core ASM library, <tt>asm.jar</tt>, is only 31KB, which is much
+more smaller than
+the size of the <a href="http://jakarta.apache.org/bcel">BCEL</a> library (350KB
+without the class verifier), and than the size of the
+<a href="http://serp.sourceforge.net">SERP</a> library (150KB). ASM is also
+much more faster than these tools. Indeed the overhead of a load time class
+transformation process is of the order of 60% with ASM, 700% or more with BCEL,
+and 1100% or more with SERP (see the <tt>test/perf</tt> directory in the ASM
+distribution)!
+
+@since ASM 1.3
+</body>
+</html>
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/signature/SignatureReader.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/signature/SignatureReader.java
new file mode 100644
index 00000000000..363692d8607
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/signature/SignatureReader.java
@@ -0,0 +1,233 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.signature;
+
+/**
+ * A type signature parser to make a signature visitor visit an existing
+ * signature.
+ *
+ * @author Thomas Hallgren
+ * @author Eric Bruneton
+ */
+public class SignatureReader {
+
+ /**
+ * The signature to be read.
+ */
+ private final String signature;
+
+ /**
+ * Constructs a {@link SignatureReader} for the given signature.
+ *
+ * @param signature A <i>ClassSignature</i>, <i>MethodTypeSignature</i>,
+ * or <i>FieldTypeSignature</i>.
+ */
+ public SignatureReader(final String signature) {
+ this.signature = signature;
+ }
+
+ /**
+ * Makes the given visitor visit the signature of this
+ * {@link SignatureReader}. This signature is the one specified in the
+ * constructor (see {@link #SignatureReader(String) SignatureReader}). This
+ * method is intended to be called on a {@link SignatureReader} that was
+ * created using a <i>ClassSignature</i> (such as the
+ * <code>signature</code> parameter of the
+ * {@link org.objectweb.asm.ClassVisitor#visit ClassVisitor.visit} method)
+ * or a <i>MethodTypeSignature</i> (such as the <code>signature</code>
+ * parameter of the
+ * {@link org.objectweb.asm.ClassVisitor#visitMethod ClassVisitor.visitMethod}
+ * method).
+ *
+ * @param v the visitor that must visit this signature.
+ */
+ public void accept(final SignatureVisitor v) {
+ String signature = this.signature;
+ int len = signature.length();
+ int pos;
+ char c;
+
+ if (signature.charAt(0) == '<') {
+ pos = 2;
+ do {
+ int end = signature.indexOf(':', pos);
+ v.visitFormalTypeParameter(signature.substring(pos - 1, end));
+ pos = end + 1;
+
+ c = signature.charAt(pos);
+ if (c == 'L' || c == '[' || c == 'T') {
+ pos = parseType(signature, pos, v.visitClassBound());
+ }
+
+ for (;;) {
+ if ((c = signature.charAt(pos++)) == ':') {
+ pos = parseType(signature, pos, v.visitInterfaceBound());
+ } else {
+ break;
+ }
+ }
+ } while (c != '>');
+ } else {
+ pos = 0;
+ }
+
+ if (signature.charAt(pos) == '(') {
+ pos = pos + 1;
+ while (signature.charAt(pos) != ')') {
+ pos = parseType(signature, pos, v.visitParameterType());
+ }
+ pos = parseType(signature, pos + 1, v.visitReturnType());
+ while (pos < len) {
+ pos = parseType(signature, pos + 1, v.visitExceptionType());
+ }
+ } else {
+ pos = parseType(signature, pos, v.visitSuperclass());
+ while (pos < len) {
+ pos = parseType(signature, pos, v.visitInterface());
+ }
+ }
+ }
+
+ /**
+ * Makes the given visitor visit the signature of this
+ * {@link SignatureReader}. This signature is the one specified in the
+ * constructor (see {@link #SignatureReader(String) SignatureReader}). This
+ * method is intended to be called on a {@link SignatureReader} that was
+ * created using a <i>FieldTypeSignature</i>, such as the
+ * <code>signature</code> parameter of the
+ * {@link org.objectweb.asm.ClassVisitor#visitField
+ * ClassVisitor.visitField} or {@link
+ * org.objectweb.asm.MethodVisitor#visitLocalVariable
+ * MethodVisitor.visitLocalVariable} methods.
+ *
+ * @param v the visitor that must visit this signature.
+ */
+ public void acceptType(final SignatureVisitor v) {
+ parseType(this.signature, 0, v);
+ }
+
+ /**
+ * Parses a field type signature and makes the given visitor visit it.
+ *
+ * @param signature a string containing the signature that must be parsed.
+ * @param pos index of the first character of the signature to parsed.
+ * @param v the visitor that must visit this signature.
+ * @return the index of the first character after the parsed signature.
+ */
+ private static int parseType(
+ final String signature,
+ int pos,
+ final SignatureVisitor v)
+ {
+ char c;
+ int start, end;
+ boolean visited, inner;
+ String name;
+
+ switch (c = signature.charAt(pos++)) {
+ case 'Z':
+ case 'C':
+ case 'B':
+ case 'S':
+ case 'I':
+ case 'F':
+ case 'J':
+ case 'D':
+ case 'V':
+ v.visitBaseType(c);
+ return pos;
+
+ case '[':
+ return parseType(signature, pos, v.visitArrayType());
+
+ case 'T':
+ end = signature.indexOf(';', pos);
+ v.visitTypeVariable(signature.substring(pos, end));
+ return end + 1;
+
+ default: // case 'L':
+ start = pos;
+ visited = false;
+ inner = false;
+ for (;;) {
+ switch (c = signature.charAt(pos++)) {
+ case '.':
+ case ';':
+ if (!visited) {
+ name = signature.substring(start, pos - 1);
+ if (inner) {
+ v.visitInnerClassType(name);
+ } else {
+ v.visitClassType(name);
+ }
+ }
+ if (c == ';') {
+ v.visitEnd();
+ return pos;
+ }
+ start = pos;
+ visited = false;
+ inner = true;
+ break;
+
+ case '<':
+ name = signature.substring(start, pos - 1);
+ if (inner) {
+ v.visitInnerClassType(name);
+ } else {
+ v.visitClassType(name);
+ }
+ visited = true;
+ top: for (;;) {
+ switch (c = signature.charAt(pos)) {
+ case '>':
+ break top;
+ case '*':
+ ++pos;
+ v.visitTypeArgument();
+ break;
+ case '+':
+ case '-':
+ pos = parseType(signature,
+ pos + 1,
+ v.visitTypeArgument(c));
+ break;
+ default:
+ pos = parseType(signature,
+ pos,
+ v.visitTypeArgument('='));
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/signature/SignatureVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/signature/SignatureVisitor.java
new file mode 100644
index 00000000000..8f087bd2ef7
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/signature/SignatureVisitor.java
@@ -0,0 +1,185 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.signature;
+
+/**
+ * A visitor to visit a generic signature. The methods of this interface must be
+ * called in one of the three following orders (the last one is the only valid
+ * order for a {@link SignatureVisitor} that is returned by a method of this
+ * interface): <ul> <li><i>ClassSignature</i> = (
+ * <tt>visitFormalTypeParameter</tt>
+ * <tt>visitClassBound</tt>?
+ * <tt>visitInterfaceBound</tt>* )* ( <tt>visitSuperClass</tt>
+ * <tt>visitInterface</tt>* )</li>
+ * <li><i>MethodSignature</i> = ( <tt>visitFormalTypeParameter</tt>
+ * <tt>visitClassBound</tt>?
+ * <tt>visitInterfaceBound</tt>* )* ( <tt>visitParameterType</tt>*
+ * <tt>visitReturnType</tt>
+ * <tt>visitExceptionType</tt>* )</li> <li><i>TypeSignature</i> =
+ * <tt>visitBaseType</tt> | <tt>visitTypeVariable</tt> |
+ * <tt>visitArrayType</tt> | (
+ * <tt>visitClassType</tt> <tt>visitTypeArgument</tt>* (
+ * <tt>visitInnerClassType</tt> <tt>visitTypeArgument</tt>* )*
+ * <tt>visitEnd</tt> ) )</li> </ul>
+ *
+ * @author Thomas Hallgren
+ * @author Eric Bruneton
+ */
+public interface SignatureVisitor {
+
+ /**
+ * Wildcard for an "extends" type argument.
+ */
+ char EXTENDS = '+';
+
+ /**
+ * Wildcard for a "super" type argument.
+ */
+ char SUPER = '-';
+
+ /**
+ * Wildcard for a normal type argument.
+ */
+ char INSTANCEOF = '=';
+
+ /**
+ * Visits a formal type parameter.
+ *
+ * @param name the name of the formal parameter.
+ */
+ void visitFormalTypeParameter(String name);
+
+ /**
+ * Visits the class bound of the last visited formal type parameter.
+ *
+ * @return a non null visitor to visit the signature of the class bound.
+ */
+ SignatureVisitor visitClassBound();
+
+ /**
+ * Visits an interface bound of the last visited formal type parameter.
+ *
+ * @return a non null visitor to visit the signature of the interface bound.
+ */
+ SignatureVisitor visitInterfaceBound();
+
+ /**
+ * Visits the type of the super class.
+ *
+ * @return a non null visitor to visit the signature of the super class
+ * type.
+ */
+ SignatureVisitor visitSuperclass();
+
+ /**
+ * Visits the type of an interface implemented by the class.
+ *
+ * @return a non null visitor to visit the signature of the interface type.
+ */
+ SignatureVisitor visitInterface();
+
+ /**
+ * Visits the type of a method parameter.
+ *
+ * @return a non null visitor to visit the signature of the parameter type.
+ */
+ SignatureVisitor visitParameterType();
+
+ /**
+ * Visits the return type of the method.
+ *
+ * @return a non null visitor to visit the signature of the return type.
+ */
+ SignatureVisitor visitReturnType();
+
+ /**
+ * Visits the type of a method exception.
+ *
+ * @return a non null visitor to visit the signature of the exception type.
+ */
+ SignatureVisitor visitExceptionType();
+
+ /**
+ * Visits a signature corresponding to a primitive type.
+ *
+ * @param descriptor the descriptor of the primitive type, or 'V' for
+ * <tt>void</tt>.
+ */
+ void visitBaseType(char descriptor);
+
+ /**
+ * Visits a signature corresponding to a type variable.
+ *
+ * @param name the name of the type variable.
+ */
+ void visitTypeVariable(String name);
+
+ /**
+ * Visits a signature corresponding to an array type.
+ *
+ * @return a non null visitor to visit the signature of the array element
+ * type.
+ */
+ SignatureVisitor visitArrayType();
+
+ /**
+ * Starts the visit of a signature corresponding to a class or interface
+ * type.
+ *
+ * @param name the internal name of the class or interface.
+ */
+ void visitClassType(String name);
+
+ /**
+ * Visits an inner class.
+ *
+ * @param name the local name of the inner class in its enclosing class.
+ */
+ void visitInnerClassType(String name);
+
+ /**
+ * Visits an unbounded type argument of the last visited class or inner
+ * class type.
+ */
+ void visitTypeArgument();
+
+ /**
+ * Visits a type argument of the last visited class or inner class type.
+ *
+ * @param wildcard '+', '-' or '='.
+ * @return a non null visitor to visit the signature of the type argument.
+ */
+ SignatureVisitor visitTypeArgument(char wildcard);
+
+ /**
+ * Ends the visit of a signature corresponding to a class or interface type.
+ */
+ void visitEnd();
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/signature/SignatureWriter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/signature/SignatureWriter.java
new file mode 100644
index 00000000000..b78d666a59c
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/signature/SignatureWriter.java
@@ -0,0 +1,207 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.signature;
+
+/**
+ * A signature visitor that generates signatures in string format.
+ *
+ * @author Thomas Hallgren
+ * @author Eric Bruneton
+ */
+public class SignatureWriter implements SignatureVisitor {
+
+ /**
+ * Buffer used to construct the signature.
+ */
+ private final StringBuffer buf = new StringBuffer();
+
+ /**
+ * Indicates if the signature contains formal type parameters.
+ */
+ private boolean hasFormals;
+
+ /**
+ * Indicates if the signature contains method parameter types.
+ */
+ private boolean hasParameters;
+
+ /**
+ * Stack used to keep track of class types that have arguments. Each element
+ * of this stack is a boolean encoded in one bit. The top of the stack is
+ * the lowest order bit. Pushing false = *2, pushing true = *2+1, popping =
+ * /2.
+ */
+ private int argumentStack;
+
+ /**
+ * Constructs a new {@link SignatureWriter} object.
+ */
+ public SignatureWriter() {
+ }
+
+ // ------------------------------------------------------------------------
+ // Implementation of the SignatureVisitor interface
+ // ------------------------------------------------------------------------
+
+ public void visitFormalTypeParameter(String name) {
+ if (!hasFormals) {
+ hasFormals = true;
+ buf.append('<');
+ }
+ buf.append(name);
+ buf.append(':');
+ }
+
+ public SignatureVisitor visitClassBound() {
+ return this;
+ }
+
+ public SignatureVisitor visitInterfaceBound() {
+ buf.append(':');
+ return this;
+ }
+
+ public SignatureVisitor visitSuperclass() {
+ endFormals();
+ return this;
+ }
+
+ public SignatureVisitor visitInterface() {
+ return this;
+ }
+
+ public SignatureVisitor visitParameterType() {
+ endFormals();
+ if (!hasParameters) {
+ hasParameters = true;
+ buf.append('(');
+ }
+ return this;
+ }
+
+ public SignatureVisitor visitReturnType() {
+ endFormals();
+ if (!hasParameters) {
+ buf.append('(');
+ }
+ buf.append(')');
+ return this;
+ }
+
+ public SignatureVisitor visitExceptionType() {
+ buf.append('^');
+ return this;
+ }
+
+ public void visitBaseType(char descriptor) {
+ buf.append(descriptor);
+ }
+
+ public void visitTypeVariable(String name) {
+ buf.append('T');
+ buf.append(name);
+ buf.append(';');
+ }
+
+ public SignatureVisitor visitArrayType() {
+ buf.append('[');
+ return this;
+ }
+
+ public void visitClassType(String name) {
+ buf.append('L');
+ buf.append(name);
+ argumentStack *= 2;
+ }
+
+ public void visitInnerClassType(String name) {
+ endArguments();
+ buf.append('.');
+ buf.append(name);
+ argumentStack *= 2;
+ }
+
+ public void visitTypeArgument() {
+ if (argumentStack % 2 == 0) {
+ ++argumentStack;
+ buf.append('<');
+ }
+ buf.append('*');
+ }
+
+ public SignatureVisitor visitTypeArgument(char wildcard) {
+ if (argumentStack % 2 == 0) {
+ ++argumentStack;
+ buf.append('<');
+ }
+ if (wildcard != '=') {
+ buf.append(wildcard);
+ }
+ return this;
+ }
+
+ public void visitEnd() {
+ endArguments();
+ buf.append(';');
+ }
+
+ /**
+ * Returns the signature that was built by this signature writer.
+ *
+ * @return the signature that was built by this signature writer.
+ */
+ public String toString() {
+ return buf.toString();
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Ends the formal type parameters section of the signature.
+ */
+ private void endFormals() {
+ if (hasFormals) {
+ hasFormals = false;
+ buf.append('>');
+ }
+ }
+
+ /**
+ * Ends the type arguments of a class or inner class type.
+ */
+ private void endArguments() {
+ if (argumentStack % 2 == 1) {
+ buf.append('>');
+ }
+ argumentStack /= 2;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/signature/package.html b/libjava/classpath/tools/external/asm/org/objectweb/asm/signature/package.html
new file mode 100644
index 00000000000..21f103a30d5
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/signature/package.html
@@ -0,0 +1,36 @@
+<html>
+<!--
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<body>
+Provides support for type signatures.
+
+@since ASM 2.0
+</body>
+</html>
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/AbstractInsnNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/AbstractInsnNode.java
new file mode 100644
index 00000000000..1f695e00ef9
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/AbstractInsnNode.java
@@ -0,0 +1,143 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a bytecode instruction.
+ *
+ * @author Eric Bruneton
+ */
+public abstract class AbstractInsnNode {
+
+ /**
+ * The type of {@link InsnNode} instructions.
+ */
+ public final static int INSN = 0;
+
+ /**
+ * The type of {@link IntInsnNode} instructions.
+ */
+ public final static int INT_INSN = 1;
+
+ /**
+ * The type of {@link VarInsnNode} instructions.
+ */
+ public final static int VAR_INSN = 2;
+
+ /**
+ * The type of {@link TypeInsnNode} instructions.
+ */
+ public final static int TYPE_INSN = 3;
+
+ /**
+ * The type of {@link FieldInsnNode} instructions.
+ */
+ public final static int FIELD_INSN = 4;
+
+ /**
+ * The type of {@link MethodInsnNode} instructions.
+ */
+ public final static int METHOD_INSN = 5;
+
+ /**
+ * The type of {@link JumpInsnNode} instructions.
+ */
+ public final static int JUMP_INSN = 6;
+
+ /**
+ * The type of {@link LabelNode} "instructions".
+ */
+ public final static int LABEL = 7;
+
+ /**
+ * The type of {@link LdcInsnNode} instructions.
+ */
+ public final static int LDC_INSN = 8;
+
+ /**
+ * The type of {@link IincInsnNode} instructions.
+ */
+ public final static int IINC_INSN = 9;
+
+ /**
+ * The type of {@link TableSwitchInsnNode} instructions.
+ */
+ public final static int TABLESWITCH_INSN = 10;
+
+ /**
+ * The type of {@link LookupSwitchInsnNode} instructions.
+ */
+ public final static int LOOKUPSWITCH_INSN = 11;
+
+ /**
+ * The type of {@link MultiANewArrayInsnNode} instructions.
+ */
+ public final static int MULTIANEWARRAY_INSN = 12;
+
+ /**
+ * The opcode of this instruction.
+ */
+ protected int opcode;
+
+ /**
+ * Constructs a new {@link AbstractInsnNode}.
+ *
+ * @param opcode the opcode of the instruction to be constructed.
+ */
+ protected AbstractInsnNode(final int opcode) {
+ this.opcode = opcode;
+ }
+
+ /**
+ * Returns the opcode of this instruction.
+ *
+ * @return the opcode of this instruction.
+ */
+ public int getOpcode() {
+ return opcode;
+ }
+
+ /**
+ * Returns the type of this instruction.
+ *
+ * @return the type of this instruction, i.e. one the constants defined in
+ * this class.
+ */
+ public abstract int getType();
+
+ /**
+ * Makes the given code visitor visit this instruction.
+ *
+ * @param cv a code visitor.
+ */
+ public abstract void accept(final MethodVisitor cv);
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/AnnotationNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/AnnotationNode.java
new file mode 100644
index 00000000000..4911e3e6e57
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/AnnotationNode.java
@@ -0,0 +1,187 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.objectweb.asm.AnnotationVisitor;
+
+/**
+ * A node that represents an annotationn.
+ *
+ * @author Eric Bruneton
+ */
+public class AnnotationNode implements AnnotationVisitor {
+
+ /**
+ * The class descriptor of the annotation class.
+ */
+ public String desc;
+
+ /**
+ * The name value pairs of this annotation. Each name value pair is stored
+ * as two consecutive elements in the list. The name is a {@link String},
+ * and the value may be a {@link Byte}, {@link Boolean}, {@link Character},
+ * {@link Short}, {@link Integer}, {@link Long}, {@link Float},
+ * {@link Double}, {@link String} or {@link org.objectweb.asm.Type}, or an
+ * two elements String array (for enumeration values), a
+ * {@link AnnotationNode}, or a {@link List} of values of one of the
+ * preceding types. The list may be <tt>null</tt> if there is no name
+ * value pair.
+ */
+ public List values;
+
+ /**
+ * Constructs a new {@link AnnotationNode}.
+ *
+ * @param desc the class descriptor of the annotation class.
+ */
+ public AnnotationNode(final String desc) {
+ this.desc = desc;
+ }
+
+ /**
+ * Constructs a new {@link AnnotationNode} to visit an array value.
+ *
+ * @param values where the visited values must be stored.
+ */
+ AnnotationNode(final List values) {
+ this.values = values;
+ }
+
+ // ------------------------------------------------------------------------
+ // Implementation of the AnnotationVisitor interface
+ // ------------------------------------------------------------------------
+
+ public void visit(final String name, final Object value) {
+ if (values == null) {
+ values = new ArrayList(this.desc != null ? 2 : 1);
+ }
+ if (this.desc != null) {
+ values.add(name);
+ }
+ values.add(value);
+ }
+
+ public void visitEnum(
+ final String name,
+ final String desc,
+ final String value)
+ {
+ if (values == null) {
+ values = new ArrayList(this.desc != null ? 2 : 1);
+ }
+ if (this.desc != null) {
+ values.add(name);
+ }
+ values.add(new String[] { desc, value });
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String name,
+ final String desc)
+ {
+ if (values == null) {
+ values = new ArrayList(this.desc != null ? 2 : 1);
+ }
+ if (this.desc != null) {
+ values.add(name);
+ }
+ AnnotationNode annotation = new AnnotationNode(desc);
+ values.add(annotation);
+ return annotation;
+ }
+
+ public AnnotationVisitor visitArray(final String name) {
+ if (values == null) {
+ values = new ArrayList(this.desc != null ? 2 : 1);
+ }
+ if (this.desc != null) {
+ values.add(name);
+ }
+ List array = new ArrayList();
+ values.add(array);
+ return new AnnotationNode(array);
+ }
+
+ public void visitEnd() {
+ }
+
+ // ------------------------------------------------------------------------
+ // Accept methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Makes the given visitor visit this annotation.
+ *
+ * @param av an annotation visitor.
+ */
+ public void accept(final AnnotationVisitor av) {
+ if (values != null) {
+ for (int i = 0; i < values.size(); i += 2) {
+ String name = (String) values.get(i);
+ Object value = values.get(i + 1);
+ accept(av, name, value);
+ }
+ }
+ av.visitEnd();
+ }
+
+ /**
+ * Makes the given visitor visit a given annotation value.
+ *
+ * @param av an annotation visitor.
+ * @param name the value name.
+ * @param value the actual value.
+ */
+ static void accept(
+ final AnnotationVisitor av,
+ final String name,
+ final Object value)
+ {
+ if (value instanceof String[]) {
+ String[] typeconst = (String[]) value;
+ av.visitEnum(name, typeconst[0], typeconst[1]);
+ } else if (value instanceof AnnotationNode) {
+ AnnotationNode an = (AnnotationNode) value;
+ an.accept(av.visitAnnotation(name, an.desc));
+ } else if (value instanceof List) {
+ AnnotationVisitor v = av.visitArray(name);
+ List array = (List) value;
+ for (int j = 0; j < array.size(); ++j) {
+ accept(v, null, array.get(j));
+ }
+ v.visitEnd();
+ } else {
+ av.visit(name, value);
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/ClassNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/ClassNode.java
new file mode 100644
index 00000000000..0771c87dc85
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/ClassNode.java
@@ -0,0 +1,283 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.FieldVisitor;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+/**
+ * A node that represents a class.
+ *
+ * @author Eric Bruneton
+ */
+public class ClassNode extends MemberNode implements ClassVisitor {
+
+ /**
+ * The class version.
+ */
+ public int version;
+
+ /**
+ * The class's access flags (see {@link org.objectweb.asm.Opcodes}). This
+ * field also indicates if the class is deprecated.
+ */
+ public int access;
+
+ /**
+ * The internal name of the class (see
+ * {@link org.objectweb.asm.Type#getInternalName() getInternalName}).
+ */
+ public String name;
+
+ /**
+ * The signature of the class. Mayt be <tt>null</tt>.
+ */
+ public String signature;
+
+ /**
+ * The internal of name of the super class (see
+ * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). For
+ * interfaces, the super class is {@link Object}. May be <tt>null</tt>,
+ * but only for the {@link Object} class.
+ */
+ public String superName;
+
+ /**
+ * The internal names of the class's interfaces (see
+ * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). This
+ * list is a list of {@link String} objects.
+ */
+ public List interfaces;
+
+ /**
+ * The name of the source file from which this class was compiled. May be
+ * <tt>null</tt>.
+ */
+ public String sourceFile;
+
+ /**
+ * Debug information to compute the correspondance between source and
+ * compiled elements of the class. May be <tt>null</tt>.
+ */
+ public String sourceDebug;
+
+ /**
+ * The internal name of the enclosing class of the class. May be
+ * <tt>null</tt>.
+ */
+ public String outerClass;
+
+ /**
+ * The name of the method that contains the class, or <tt>null</tt> if the
+ * class is not enclosed in a method.
+ */
+ public String outerMethod;
+
+ /**
+ * The descriptor of the method that contains the class, or <tt>null</tt>
+ * if the class is not enclosed in a method.
+ */
+ public String outerMethodDesc;
+
+ /**
+ * Informations about the inner classes of this class. This list is a list
+ * of {@link InnerClassNode} objects.
+ *
+ * @associates org.objectweb.asm.tree.InnerClassNode
+ */
+ public List innerClasses;
+
+ /**
+ * The fields of this class. This list is a list of {@link FieldNode}
+ * objects.
+ *
+ * @associates org.objectweb.asm.tree.FieldNode
+ */
+ public List fields;
+
+ /**
+ * The methods of this class. This list is a list of {@link MethodNode}
+ * objects.
+ *
+ * @associates org.objectweb.asm.tree.MethodNode
+ */
+ public List methods;
+
+ /**
+ * Constructs a new {@link ClassNode}.
+ */
+ public ClassNode() {
+ this.interfaces = new ArrayList();
+ this.innerClasses = new ArrayList();
+ this.fields = new ArrayList();
+ this.methods = new ArrayList();
+ }
+
+ // ------------------------------------------------------------------------
+ // Implementation of the ClassVisitor interface
+ // ------------------------------------------------------------------------
+
+ public void visit(
+ final int version,
+ final int access,
+ final String name,
+ final String signature,
+ final String superName,
+ final String[] interfaces)
+ {
+ this.version = version;
+ this.access = access;
+ this.name = name;
+ this.signature = signature;
+ this.superName = superName;
+ if (interfaces != null) {
+ this.interfaces.addAll(Arrays.asList(interfaces));
+ }
+ }
+
+ public void visitSource(final String file, final String debug) {
+ sourceFile = file;
+ sourceDebug = debug;
+ }
+
+ public void visitOuterClass(
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ outerClass = owner;
+ outerMethod = name;
+ outerMethodDesc = desc;
+ }
+
+ public void visitInnerClass(
+ final String name,
+ final String outerName,
+ final String innerName,
+ final int access)
+ {
+ InnerClassNode icn = new InnerClassNode(name,
+ outerName,
+ innerName,
+ access);
+ innerClasses.add(icn);
+ }
+
+ public FieldVisitor visitField(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final Object value)
+ {
+ FieldNode fn = new FieldNode(access, name, desc, signature, value);
+ fields.add(fn);
+ return fn;
+ }
+
+ public MethodVisitor visitMethod(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final String[] exceptions)
+ {
+ MethodNode mn = new MethodNode(access,
+ name,
+ desc,
+ signature,
+ exceptions);
+ methods.add(mn);
+ return mn;
+ }
+
+ public void visitEnd() {
+ }
+
+ // ------------------------------------------------------------------------
+ // Accept method
+ // ------------------------------------------------------------------------
+
+ /**
+ * Makes the given class visitor visit this class.
+ *
+ * @param cv a class visitor.
+ */
+ public void accept(final ClassVisitor cv) {
+ // visits header
+ String[] interfaces = new String[this.interfaces.size()];
+ this.interfaces.toArray(interfaces);
+ cv.visit(version, access, name, signature, superName, interfaces);
+ // visits source
+ if (sourceFile != null || sourceDebug != null) {
+ cv.visitSource(sourceFile, sourceDebug);
+ }
+ // visits outer class
+ if (outerClass != null) {
+ cv.visitOuterClass(outerClass, outerMethod, outerMethodDesc);
+ }
+ // visits attributes
+ int i, n;
+ n = visibleAnnotations == null ? 0 : visibleAnnotations.size();
+ for (i = 0; i < n; ++i) {
+ AnnotationNode an = (AnnotationNode) visibleAnnotations.get(i);
+ an.accept(cv.visitAnnotation(an.desc, true));
+ }
+ n = invisibleAnnotations == null ? 0 : invisibleAnnotations.size();
+ for (i = 0; i < n; ++i) {
+ AnnotationNode an = (AnnotationNode) invisibleAnnotations.get(i);
+ an.accept(cv.visitAnnotation(an.desc, false));
+ }
+ n = attrs == null ? 0 : attrs.size();
+ for (i = 0; i < n; ++i) {
+ cv.visitAttribute((Attribute) attrs.get(i));
+ }
+ // visits inner classes
+ for (i = 0; i < innerClasses.size(); ++i) {
+ ((InnerClassNode) innerClasses.get(i)).accept(cv);
+ }
+ // visits fields
+ for (i = 0; i < fields.size(); ++i) {
+ ((FieldNode) fields.get(i)).accept(cv);
+ }
+ // visits methods
+ for (i = 0; i < methods.size(); ++i) {
+ ((MethodNode) methods.get(i)).accept(cv);
+ }
+ // visits end
+ cv.visitEnd();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/FieldInsnNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/FieldInsnNode.java
new file mode 100644
index 00000000000..4399e3a25e1
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/FieldInsnNode.java
@@ -0,0 +1,97 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a field instruction. A field instruction is an
+ * instruction that loads or stores the value of a field of an object.
+ *
+ * @author Eric Bruneton
+ */
+public class FieldInsnNode extends AbstractInsnNode {
+
+ /**
+ * The internal name of the field's owner class (see
+ * {@link org.objectweb.asm.Type#getInternalName() getInternalName}).
+ */
+ public String owner;
+
+ /**
+ * The field's name.
+ */
+ public String name;
+
+ /**
+ * The field's descriptor (see {@link org.objectweb.asm.Type}).
+ */
+ public String desc;
+
+ /**
+ * Constructs a new {@link FieldInsnNode}.
+ *
+ * @param opcode the opcode of the type instruction to be constructed. This
+ * opcode must be GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
+ * @param owner the internal name of the field's owner class (see
+ * {@link org.objectweb.asm.Type#getInternalName() getInternalName}).
+ * @param name the field's name.
+ * @param desc the field's descriptor (see {@link org.objectweb.asm.Type}).
+ */
+ public FieldInsnNode(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ super(opcode);
+ this.owner = owner;
+ this.name = name;
+ this.desc = desc;
+ }
+
+ /**
+ * Sets the opcode of this instruction.
+ *
+ * @param opcode the new instruction opcode. This opcode must be GETSTATIC,
+ * PUTSTATIC, GETFIELD or PUTFIELD.
+ */
+ public void setOpcode(final int opcode) {
+ this.opcode = opcode;
+ }
+
+ public void accept(final MethodVisitor cv) {
+ cv.visitFieldInsn(opcode, owner, name, desc);
+ }
+
+ public int getType() {
+ return FIELD_INSN;
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/FieldNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/FieldNode.java
new file mode 100644
index 00000000000..c13ac9e22f1
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/FieldNode.java
@@ -0,0 +1,123 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+
+/**
+ * A node that represents a field.
+ *
+ * @author Eric Bruneton
+ */
+public class FieldNode extends MemberNode implements FieldVisitor {
+
+ /**
+ * The field's access flags (see {@link org.objectweb.asm.Opcodes}). This
+ * field also indicates if the field is synthetic and/or deprecated.
+ */
+ public int access;
+
+ /**
+ * The field's name.
+ */
+ public String name;
+
+ /**
+ * The field's descriptor (see {@link org.objectweb.asm.Type}).
+ */
+ public String desc;
+
+ /**
+ * The field's signature. May be <tt>null</tt>.
+ */
+ public String signature;
+
+ /**
+ * The field's initial value. This field, which may be <tt>null</tt> if
+ * the field does not have an initial value, must be an {@link Integer}, a
+ * {@link Float}, a {@link Long}, a {@link Double} or a {@link String}.
+ */
+ public Object value;
+
+ /**
+ * Constructs a new {@link FieldNode}.
+ *
+ * @param access the field's access flags (see
+ * {@link org.objectweb.asm.Opcodes}). This parameter also indicates
+ * if the field is synthetic and/or deprecated.
+ * @param name the field's name.
+ * @param desc the field's descriptor (see {@link org.objectweb.asm.Type}).
+ * @param signature the field's signature.
+ * @param value the field's initial value. This parameter, which may be
+ * <tt>null</tt> if the field does not have an initial value, must
+ * be an {@link Integer}, a {@link Float}, a {@link Long}, a
+ * {@link Double} or a {@link String}.
+ */
+ public FieldNode(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final Object value)
+ {
+ this.access = access;
+ this.name = name;
+ this.desc = desc;
+ this.signature = signature;
+ this.value = value;
+ }
+
+ /**
+ * Makes the given class visitor visit this field.
+ *
+ * @param cv a class visitor.
+ */
+ public void accept(final ClassVisitor cv) {
+ FieldVisitor fv = cv.visitField(access, name, desc, signature, value);
+ int i, n;
+ n = visibleAnnotations == null ? 0 : visibleAnnotations.size();
+ for (i = 0; i < n; ++i) {
+ AnnotationNode an = (AnnotationNode) visibleAnnotations.get(i);
+ an.accept(fv.visitAnnotation(an.desc, true));
+ }
+ n = invisibleAnnotations == null ? 0 : invisibleAnnotations.size();
+ for (i = 0; i < n; ++i) {
+ AnnotationNode an = (AnnotationNode) invisibleAnnotations.get(i);
+ an.accept(fv.visitAnnotation(an.desc, false));
+ }
+ n = attrs == null ? 0 : attrs.size();
+ for (i = 0; i < n; ++i) {
+ fv.visitAttribute((Attribute) attrs.get(i));
+ }
+ fv.visitEnd();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/IincInsnNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/IincInsnNode.java
new file mode 100644
index 00000000000..e7e79dc5145
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/IincInsnNode.java
@@ -0,0 +1,71 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
+/**
+ * A node that represents an IINC instruction.
+ *
+ * @author Eric Bruneton
+ */
+public class IincInsnNode extends AbstractInsnNode {
+
+ /**
+ * Index of the local variable to be incremented.
+ */
+ public int var;
+
+ /**
+ * Amount to increment the local variable by.
+ */
+ public int incr;
+
+ /**
+ * Constructs a new {@link IincInsnNode}.
+ *
+ * @param var index of the local variable to be incremented.
+ * @param incr increment amount to increment the local variable by.
+ */
+ public IincInsnNode(final int var, final int incr) {
+ super(Opcodes.IINC);
+ this.var = var;
+ this.incr = incr;
+ }
+
+ public void accept(final MethodVisitor mv) {
+ mv.visitIincInsn(var, incr);
+ }
+
+ public int getType() {
+ return IINC_INSN;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/InnerClassNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/InnerClassNode.java
new file mode 100644
index 00000000000..a325317b46e
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/InnerClassNode.java
@@ -0,0 +1,101 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.ClassVisitor;
+
+/**
+ * A node that represents an inner class.
+ *
+ * @author Eric Bruneton
+ */
+public class InnerClassNode {
+
+ /**
+ * The internal name of an inner class (see
+ * {@link org.objectweb.asm.Type#getInternalName() getInternalName}).
+ */
+ public String name;
+
+ /**
+ * The internal name of the class to which the inner class belongs (see
+ * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). May
+ * be <tt>null</tt>.
+ */
+ public String outerName;
+
+ /**
+ * The (simple) name of the inner class inside its enclosing class. May be
+ * <tt>null</tt> for anonymous inner classes.
+ */
+ public String innerName;
+
+ /**
+ * The access flags of the inner class as originally declared in the
+ * enclosing class.
+ */
+ public int access;
+
+ /**
+ * Constructs a new {@link InnerClassNode}.
+ *
+ * @param name the internal name of an inner class (see
+ * {@link org.objectweb.asm.Type#getInternalName() getInternalName}).
+ * @param outerName the internal name of the class to which the inner class
+ * belongs (see
+ * {@link org.objectweb.asm.Type#getInternalName() getInternalName}).
+ * May be <tt>null</tt>.
+ * @param innerName the (simple) name of the inner class inside its
+ * enclosing class. May be <tt>null</tt> for anonymous inner
+ * classes.
+ * @param access the access flags of the inner class as originally declared
+ * in the enclosing class.
+ */
+ public InnerClassNode(
+ final String name,
+ final String outerName,
+ final String innerName,
+ final int access)
+ {
+ this.name = name;
+ this.outerName = outerName;
+ this.innerName = innerName;
+ this.access = access;
+ }
+
+ /**
+ * Makes the given class visitor visit this inner class.
+ *
+ * @param cv a class visitor.
+ */
+ public void accept(final ClassVisitor cv) {
+ cv.visitInnerClass(name, outerName, innerName, access);
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/InsnNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/InsnNode.java
new file mode 100644
index 00000000000..434dd5b313d
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/InsnNode.java
@@ -0,0 +1,96 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a zero operand instruction.
+ *
+ * @author Eric Bruneton
+ */
+public class InsnNode extends AbstractInsnNode {
+
+ private final static InsnNode[] INSNS;
+
+ static {
+ INSNS = new InsnNode[255];
+ for (int i = 0; i < INSNS.length; ++i) {
+ INSNS[i] = new InsnNode(i);
+ }
+ }
+
+ /**
+ * Returns the {@link InsnNode} corresponding to the given opcode.
+ *
+ * @deprecated uses the constructor instead.
+ *
+ * @param opcode an instruction opcode.
+ * @return the {@link InsnNode} corresponding to the given opcode.
+ */
+ public final static InsnNode getByOpcode(final int opcode) {
+ return INSNS[opcode];
+ }
+
+ /**
+ * Constructs a new {@link InsnNode}.
+ *
+ * @param opcode the opcode of the instruction to be constructed. This
+ * opcode must be NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1,
+ * ICONST_2, ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1,
+ * FCONST_0, FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD, LALOAD,
+ * FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IASTORE, LASTORE,
+ * FASTORE, DASTORE, AASTORE, BASTORE, CASTORE, SASTORE, POP, POP2,
+ * DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP, IADD, LADD,
+ * FADD, DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV,
+ * LDIV, FDIV, DDIV, IREM, LREM, FREM, DREM, INEG, LNEG, FNEG, DNEG,
+ * ISHL, LSHL, ISHR, LSHR, IUSHR, LUSHR, IAND, LAND, IOR, LOR, IXOR,
+ * LXOR, I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F,
+ * I2B, I2C, I2S, LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN,
+ * FRETURN, DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW,
+ * MONITORENTER, or MONITOREXIT.
+ */
+ public InsnNode(final int opcode) {
+ super(opcode);
+ }
+
+ /**
+ * Makes the given visitor visit this instruction.
+ *
+ * @param mv a method visitor.
+ */
+ public void accept(final MethodVisitor mv) {
+ mv.visitInsn(opcode);
+ }
+
+ public int getType() {
+ return INSN;
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/IntInsnNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/IntInsnNode.java
new file mode 100644
index 00000000000..2c200a58567
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/IntInsnNode.java
@@ -0,0 +1,75 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents an instruction with a single int operand.
+ *
+ * @author Eric Bruneton
+ */
+public class IntInsnNode extends AbstractInsnNode {
+
+ /**
+ * The operand of this instruction.
+ */
+ public int operand;
+
+ /**
+ * Constructs a new {@link IntInsnNode}.
+ *
+ * @param opcode the opcode of the instruction to be constructed. This
+ * opcode must be BIPUSH, SIPUSH or NEWARRAY.
+ * @param operand the operand of the instruction to be constructed.
+ */
+ public IntInsnNode(final int opcode, final int operand) {
+ super(opcode);
+ this.operand = operand;
+ }
+
+ /**
+ * Sets the opcode of this instruction.
+ *
+ * @param opcode the new instruction opcode. This opcode must be BIPUSH,
+ * SIPUSH or NEWARRAY.
+ */
+ public void setOpcode(final int opcode) {
+ this.opcode = opcode;
+ }
+
+ public void accept(final MethodVisitor mv) {
+ mv.visitIntInsn(opcode, operand);
+ }
+
+ public int getType() {
+ return INT_INSN;
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/JumpInsnNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/JumpInsnNode.java
new file mode 100644
index 00000000000..5ab6e11ee53
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/JumpInsnNode.java
@@ -0,0 +1,84 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a jump instruction. A jump instruction is an
+ * instruction that may jump to another instruction.
+ *
+ * @author Eric Bruneton
+ */
+public class JumpInsnNode extends AbstractInsnNode {
+
+ /**
+ * The operand of this instruction. This operand is a label that designates
+ * the instruction to which this instruction may jump.
+ */
+ public Label label;
+
+ /**
+ * Constructs a new {@link JumpInsnNode}.
+ *
+ * @param opcode the opcode of the type instruction to be constructed. This
+ * opcode must be IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ,
+ * IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ,
+ * IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL.
+ * @param label the operand of the instruction to be constructed. This
+ * operand is a label that designates the instruction to which the
+ * jump instruction may jump.
+ */
+ public JumpInsnNode(final int opcode, final Label label) {
+ super(opcode);
+ this.label = label;
+ }
+
+ /**
+ * Sets the opcode of this instruction.
+ *
+ * @param opcode the new instruction opcode. This opcode must be IFEQ, IFNE,
+ * IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT,
+ * IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ, IF_ACMPNE, GOTO, JSR,
+ * IFNULL or IFNONNULL.
+ */
+ public void setOpcode(final int opcode) {
+ this.opcode = opcode;
+ }
+
+ public void accept(final MethodVisitor mv) {
+ mv.visitJumpInsn(opcode, label);
+ }
+
+ public int getType() {
+ return JUMP_INSN;
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LabelNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LabelNode.java
new file mode 100644
index 00000000000..5eead6e3380
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LabelNode.java
@@ -0,0 +1,54 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * An {@link AbstractInsnNode} that encapsulates a {@link Label}.
+ */
+public class LabelNode extends AbstractInsnNode {
+
+ public Label label;
+
+ public LabelNode(final Label label) {
+ super(-1);
+ this.label = label;
+ }
+
+ public void accept(final MethodVisitor cv) {
+ cv.visitLabel(label);
+ }
+
+ public int getType() {
+ return LABEL;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LdcInsnNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LdcInsnNode.java
new file mode 100644
index 00000000000..ef955137109
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LdcInsnNode.java
@@ -0,0 +1,68 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
+/**
+ * A node that represents an LDC instruction.
+ *
+ * @author Eric Bruneton
+ */
+public class LdcInsnNode extends AbstractInsnNode {
+
+ /**
+ * The constant to be loaded on the stack. This parameter must be a non null
+ * {@link Integer}, a {@link Float}, a {@link Long}, a {@link Double}, a
+ * {@link String} or a {@link org.objectweb.asm.Type}.
+ */
+ public Object cst;
+
+ /**
+ * Constructs a new {@link LdcInsnNode}.
+ *
+ * @param cst the constant to be loaded on the stack. This parameter must be
+ * a non null {@link Integer}, a {@link Float}, a {@link Long}, a
+ * {@link Double} or a {@link String}.
+ */
+ public LdcInsnNode(final Object cst) {
+ super(Opcodes.LDC);
+ this.cst = cst;
+ }
+
+ public void accept(final MethodVisitor mv) {
+ mv.visitLdcInsn(cst);
+ }
+
+ public int getType() {
+ return LDC_INSN;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LineNumberNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LineNumberNode.java
new file mode 100644
index 00000000000..0d4974749b6
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LineNumberNode.java
@@ -0,0 +1,73 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a line number declaration.
+ *
+ * @author Eric Bruneton
+ */
+public class LineNumberNode {
+
+ /**
+ * A line number. This number refers to the source file from which the class
+ * was compiled.
+ */
+ public int line;
+
+ /**
+ * The first instruction corresponding to this line number.
+ */
+ public Label start;
+
+ /**
+ * Constructs a new {@link LineNumberNode}.
+ *
+ * @param line a line number. This number refers to the source file from
+ * which the class was compiled.
+ * @param start the first instruction corresponding to this line number.
+ */
+ public LineNumberNode(final int line, final Label start) {
+ this.line = line;
+ this.start = start;
+ }
+
+ /**
+ * Makes the given visitor visit this line number declaration.
+ *
+ * @param mv a method visitor.
+ */
+ public void accept(final MethodVisitor mv) {
+ mv.visitLineNumber(line, start);
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LocalVariableNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LocalVariableNode.java
new file mode 100644
index 00000000000..b9efe44e314
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LocalVariableNode.java
@@ -0,0 +1,111 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Label;
+
+/**
+ * A node that represents a local variable declaration.
+ *
+ * @author Eric Bruneton
+ */
+public class LocalVariableNode {
+
+ /**
+ * The name of a local variable.
+ */
+ public String name;
+
+ /**
+ * The type descriptor of this local variable.
+ */
+ public String desc;
+
+ /**
+ * The signature of this local variable. May be <tt>null</tt>.
+ */
+ public String signature;
+
+ /**
+ * The first instruction corresponding to the scope of this local variable
+ * (inclusive).
+ */
+ public Label start;
+
+ /**
+ * The last instruction corresponding to the scope of this local variable
+ * (exclusive).
+ */
+ public Label end;
+
+ /**
+ * The local variable's index.
+ */
+ public int index;
+
+ /**
+ * Constructs a new {@link LocalVariableNode}.
+ *
+ * @param name the name of a local variable.
+ * @param desc the type descriptor of this local variable.
+ * @param signature the signature of this local variable. May be
+ * <tt>null</tt>.
+ * @param start the first instruction corresponding to the scope of this
+ * local variable (inclusive).
+ * @param end the last instruction corresponding to the scope of this local
+ * variable (exclusive).
+ * @param index the local variable's index.
+ */
+ public LocalVariableNode(
+ final String name,
+ final String desc,
+ final String signature,
+ final Label start,
+ final Label end,
+ final int index)
+ {
+ this.name = name;
+ this.desc = desc;
+ this.signature = signature;
+ this.start = start;
+ this.end = end;
+ this.index = index;
+ }
+
+ /**
+ * Makes the given visitor visit this local variable declaration.
+ *
+ * @param mv a method visitor.
+ */
+ public void accept(final MethodVisitor mv) {
+ mv.visitLocalVariable(name, desc, signature, start, end, index);
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LookupSwitchInsnNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LookupSwitchInsnNode.java
new file mode 100644
index 00000000000..1c8e69fcc60
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/LookupSwitchInsnNode.java
@@ -0,0 +1,103 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.Label;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.MethodVisitor;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+/**
+ * A node that represents a LOOKUPSWITCH instruction.
+ *
+ * @author Eric Bruneton
+ */
+public class LookupSwitchInsnNode extends AbstractInsnNode {
+
+ /**
+ * Beginning of the default handler block.
+ */
+ public Label dflt;
+
+ /**
+ * The values of the keys. This list is a list of {@link Integer} objects.
+ */
+ public List keys;
+
+ /**
+ * Beginnings of the handler blocks. This list is a list of {@link Label}
+ * objects.
+ */
+ public List labels;
+
+ /**
+ * Constructs a new {@link LookupSwitchInsnNode}.
+ *
+ * @param dflt beginning of the default handler block.
+ * @param keys the values of the keys.
+ * @param labels beginnings of the handler blocks. <tt>labels[i]</tt> is
+ * the beginning of the handler block for the <tt>keys[i]</tt> key.
+ */
+ public LookupSwitchInsnNode(
+ final Label dflt,
+ final int[] keys,
+ final Label[] labels)
+ {
+ super(Opcodes.LOOKUPSWITCH);
+ this.dflt = dflt;
+ this.keys = new ArrayList(keys == null ? 0 : keys.length);
+ this.labels = new ArrayList(labels == null ? 0 : labels.length);
+ if (keys != null) {
+ for (int i = 0; i < keys.length; ++i) {
+ this.keys.add(new Integer(keys[i]));
+ }
+ }
+ if (labels != null) {
+ this.labels.addAll(Arrays.asList(labels));
+ }
+ }
+
+ public void accept(final MethodVisitor mv) {
+ int[] keys = new int[this.keys.size()];
+ for (int i = 0; i < keys.length; ++i) {
+ keys[i] = ((Integer) this.keys.get(i)).intValue();
+ }
+ Label[] labels = new Label[this.labels.size()];
+ this.labels.toArray(labels);
+ mv.visitLookupSwitchInsn(dflt, keys, labels);
+ }
+
+ public int getType() {
+ return LOOKUPSWITCH_INSN;
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MemberNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MemberNode.java
new file mode 100644
index 00000000000..86b1c5c7bf8
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MemberNode.java
@@ -0,0 +1,120 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+
+/**
+ * An abstract class, field or method node.
+ *
+ * @author Eric Bruneton
+ */
+public abstract class MemberNode {
+
+ /**
+ * The runtime visible annotations of this class, field or method. This list
+ * is a list of {@link AnnotationNode} objects. May be <tt>null</tt>.
+ *
+ * @associates org.objectweb.asm.tree.AnnotationNode
+ * @label visible
+ */
+ public List visibleAnnotations;
+
+ /**
+ * The runtime invisible annotations of this class, field or method. This
+ * list is a list of {@link AnnotationNode} objects. May be <tt>null</tt>.
+ *
+ * @associates org.objectweb.asm.tree.AnnotationNode
+ * @label invisible
+ */
+ public List invisibleAnnotations;
+
+ /**
+ * The non standard attributes of this class, field or method. This list is
+ * a list of {@link Attribute} objects. May be <tt>null</tt>.
+ *
+ * @associates org.objectweb.asm.Attribute
+ */
+ public List attrs;
+
+ /**
+ * Constructs a new {@link MemberNode}.
+ */
+ public MemberNode() {
+ }
+
+ /**
+ * Visits an annotation of this class, field or method.
+ *
+ * @param desc the class descriptor of the annotation class.
+ * @param visible <tt>true</tt> if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values.
+ */
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ AnnotationNode an = new AnnotationNode(desc);
+ if (visible) {
+ if (visibleAnnotations == null) {
+ visibleAnnotations = new ArrayList(1);
+ }
+ visibleAnnotations.add(an);
+ } else {
+ if (invisibleAnnotations == null) {
+ invisibleAnnotations = new ArrayList(1);
+ }
+ invisibleAnnotations.add(an);
+ }
+ return an;
+ }
+
+ /**
+ * Visits a non standard attribute of this class, field or method.
+ *
+ * @param attr an attribute.
+ */
+ public void visitAttribute(final Attribute attr) {
+ if (attrs == null) {
+ attrs = new ArrayList(1);
+ }
+ attrs.add(attr);
+ }
+
+ /**
+ * Visits the end of this class, field or method.
+ */
+ public void visitEnd() {
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MethodInsnNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MethodInsnNode.java
new file mode 100644
index 00000000000..714aabe6e9b
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MethodInsnNode.java
@@ -0,0 +1,98 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a method instruction. A method instruction is an
+ * instruction that invokes a method.
+ *
+ * @author Eric Bruneton
+ */
+public class MethodInsnNode extends AbstractInsnNode {
+
+ /**
+ * The internal name of the method's owner class (see
+ * {@link org.objectweb.asm.Type#getInternalName() getInternalName}).
+ */
+ public String owner;
+
+ /**
+ * The method's name.
+ */
+ public String name;
+
+ /**
+ * The method's descriptor (see {@link org.objectweb.asm.Type}).
+ */
+ public String desc;
+
+ /**
+ * Constructs a new {@link MethodInsnNode}.
+ *
+ * @param opcode the opcode of the type instruction to be constructed. This
+ * opcode must be INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or
+ * INVOKEINTERFACE.
+ * @param owner the internal name of the method's owner class (see
+ * {@link org.objectweb.asm.Type#getInternalName() getInternalName}).
+ * @param name the method's name.
+ * @param desc the method's descriptor (see {@link org.objectweb.asm.Type}).
+ */
+ public MethodInsnNode(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ super(opcode);
+ this.owner = owner;
+ this.name = name;
+ this.desc = desc;
+ }
+
+ /**
+ * Sets the opcode of this instruction.
+ *
+ * @param opcode the new instruction opcode. This opcode must be
+ * INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE.
+ */
+ public void setOpcode(final int opcode) {
+ this.opcode = opcode;
+ }
+
+ public void accept(final MethodVisitor mv) {
+ mv.visitMethodInsn(opcode, owner, name, desc);
+ }
+
+ public int getType() {
+ return METHOD_INSN;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MethodNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MethodNode.java
new file mode 100644
index 00000000000..f746bfa3ffd
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MethodNode.java
@@ -0,0 +1,439 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+/**
+ * A node that represents a method.
+ *
+ * @author Eric Bruneton
+ */
+public class MethodNode extends MemberNode implements MethodVisitor {
+
+ /**
+ * The method's access flags (see {@link Opcodes}). This field also
+ * indicates if the method is synthetic and/or deprecated.
+ */
+ public int access;
+
+ /**
+ * The method's name.
+ */
+ public String name;
+
+ /**
+ * The method's descriptor (see {@link Type}).
+ */
+ public String desc;
+
+ /**
+ * The method's signature. May be <tt>null</tt>.
+ */
+ public String signature;
+
+ /**
+ * The internal names of the method's exception classes (see
+ * {@link Type#getInternalName() getInternalName}). This list is a list of
+ * {@link String} objects.
+ */
+ public List exceptions;
+
+ /**
+ * The default value of this annotation interface method. This field must be
+ * a {@link Byte}, {@link Boolean}, {@link Character}, {@link Short},
+ * {@link Integer}, {@link Long}, {@link Float}, {@link Double},
+ * {@link String} or {@link Type}, or an two elements String array (for
+ * enumeration values), a {@link AnnotationNode}, or a {@link List} of
+ * values of one of the preceding types. May be <tt>null</tt>.
+ */
+ public Object annotationDefault;
+
+ /**
+ * The runtime visible parameter annotations of this method. These lists are
+ * lists of {@link AnnotationNode} objects. May be <tt>null</tt>.
+ *
+ * @associates org.objectweb.asm.tree.AnnotationNode
+ * @label invisible parameters
+ */
+ public List[] visibleParameterAnnotations;
+
+ /**
+ * The runtime invisible parameter annotations of this method. These lists
+ * are lists of {@link AnnotationNode} objects. May be <tt>null</tt>.
+ *
+ * @associates org.objectweb.asm.tree.AnnotationNode
+ * @label visible parameters
+ */
+ public List[] invisibleParameterAnnotations;
+
+ /**
+ * The instructions of this method. This list is a list of
+ * {@link AbstractInsnNode} objects.
+ *
+ * @associates org.objectweb.asm.tree.AbstractInsnNode
+ * @label instructions
+ */
+ public List instructions;
+
+ /**
+ * The try catch blocks of this method. This list is a list of
+ * {@link TryCatchBlockNode} objects.
+ *
+ * @associates org.objectweb.asm.tree.TryCatchBlockNode
+ */
+ public List tryCatchBlocks;
+
+ /**
+ * The maximum stack size of this method.
+ */
+ public int maxStack;
+
+ /**
+ * The maximum number of local variables of this method.
+ */
+ public int maxLocals;
+
+ /**
+ * The local variables of this method. This list is a list of
+ * {@link LocalVariableNode} objects. May be <tt>null</tt>
+ *
+ * @associates org.objectweb.asm.tree.LocalVariableNode
+ */
+ public List localVariables;
+
+ /**
+ * The line numbers of this method. This list is a list of
+ * {@link LineNumberNode} objects. May be <tt>null</tt>
+ *
+ * @associates org.objectweb.asm.tree.LineNumberNode
+ */
+ public List lineNumbers;
+
+ /**
+ * Constructs a new {@link MethodNode}.
+ *
+ * @param access the method's access flags (see {@link Opcodes}). This
+ * parameter also indicates if the method is synthetic and/or
+ * deprecated.
+ * @param name the method's name.
+ * @param desc the method's descriptor (see {@link Type}).
+ * @param signature the method's signature. May be <tt>null</tt>.
+ * @param exceptions the internal names of the method's exception classes
+ * (see {@link Type#getInternalName() getInternalName}). May be
+ * <tt>null</tt>.
+ */
+ public MethodNode(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final String[] exceptions)
+ {
+ this.access = access;
+ this.name = name;
+ this.desc = desc;
+ this.signature = signature;
+ this.exceptions = new ArrayList(exceptions == null
+ ? 0
+ : exceptions.length);
+ boolean isAbstract = (access & Opcodes.ACC_ABSTRACT) != 0;
+ this.instructions = new ArrayList(isAbstract ? 0 : 24);
+ if (!isAbstract) {
+ this.localVariables = new ArrayList(5);
+ this.lineNumbers = new ArrayList(5);
+ }
+ this.tryCatchBlocks = new ArrayList();
+ if (exceptions != null) {
+ this.exceptions.addAll(Arrays.asList(exceptions));
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Implementation of the MethodVisitor interface
+ // ------------------------------------------------------------------------
+
+ public AnnotationVisitor visitAnnotationDefault() {
+ return new AnnotationNode(new ArrayList(0) {
+ public boolean add(Object o) {
+ annotationDefault = o;
+ return super.add(o);
+ }
+ });
+ }
+
+ public AnnotationVisitor visitParameterAnnotation(
+ final int parameter,
+ final String desc,
+ final boolean visible)
+ {
+ AnnotationNode an = new AnnotationNode(desc);
+ if (visible) {
+ if (visibleParameterAnnotations == null) {
+ int params = Type.getArgumentTypes(this.desc).length;
+ visibleParameterAnnotations = new List[params];
+ }
+ if (visibleParameterAnnotations[parameter] == null) {
+ visibleParameterAnnotations[parameter] = new ArrayList(1);
+ }
+ visibleParameterAnnotations[parameter].add(an);
+ } else {
+ if (invisibleParameterAnnotations == null) {
+ int params = Type.getArgumentTypes(this.desc).length;
+ invisibleParameterAnnotations = new List[params];
+ }
+ if (invisibleParameterAnnotations[parameter] == null) {
+ invisibleParameterAnnotations[parameter] = new ArrayList(1);
+ }
+ invisibleParameterAnnotations[parameter].add(an);
+ }
+ return an;
+ }
+
+ public void visitCode() {
+ }
+
+ public void visitInsn(final int opcode) {
+ instructions.add(new InsnNode(opcode));
+ }
+
+ public void visitIntInsn(final int opcode, final int operand) {
+ instructions.add(new IntInsnNode(opcode, operand));
+ }
+
+ public void visitVarInsn(final int opcode, final int var) {
+ instructions.add(new VarInsnNode(opcode, var));
+ }
+
+ public void visitTypeInsn(final int opcode, final String desc) {
+ instructions.add(new TypeInsnNode(opcode, desc));
+ }
+
+ public void visitFieldInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ instructions.add(new FieldInsnNode(opcode, owner, name, desc));
+ }
+
+ public void visitMethodInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ instructions.add(new MethodInsnNode(opcode, owner, name, desc));
+ }
+
+ public void visitJumpInsn(final int opcode, final Label label) {
+ instructions.add(new JumpInsnNode(opcode, label));
+ }
+
+ public void visitLabel(final Label label) {
+ instructions.add(new LabelNode(label));
+ }
+
+ public void visitLdcInsn(final Object cst) {
+ instructions.add(new LdcInsnNode(cst));
+ }
+
+ public void visitIincInsn(final int var, final int increment) {
+ instructions.add(new IincInsnNode(var, increment));
+ }
+
+ public void visitTableSwitchInsn(
+ final int min,
+ final int max,
+ final Label dflt,
+ final Label[] labels)
+ {
+ instructions.add(new TableSwitchInsnNode(min, max, dflt, labels));
+ }
+
+ public void visitLookupSwitchInsn(
+ final Label dflt,
+ final int[] keys,
+ final Label[] labels)
+ {
+ instructions.add(new LookupSwitchInsnNode(dflt, keys, labels));
+ }
+
+ public void visitMultiANewArrayInsn(final String desc, final int dims) {
+ instructions.add(new MultiANewArrayInsnNode(desc, dims));
+ }
+
+ public void visitTryCatchBlock(
+ final Label start,
+ final Label end,
+ final Label handler,
+ final String type)
+ {
+ tryCatchBlocks.add(new TryCatchBlockNode(start, end, handler, type));
+ }
+
+ public void visitLocalVariable(
+ final String name,
+ final String desc,
+ final String signature,
+ final Label start,
+ final Label end,
+ final int index)
+ {
+ localVariables.add(new LocalVariableNode(name,
+ desc,
+ signature,
+ start,
+ end,
+ index));
+ }
+
+ public void visitLineNumber(final int line, final Label start) {
+ lineNumbers.add(new LineNumberNode(line, start));
+ }
+
+ public void visitMaxs(final int maxStack, final int maxLocals) {
+ this.maxStack = maxStack;
+ this.maxLocals = maxLocals;
+ }
+
+ // ------------------------------------------------------------------------
+ // Accept method
+ // ------------------------------------------------------------------------
+
+ /**
+ * Makes the given class visitor visit this method.
+ *
+ * @param cv a class visitor.
+ */
+ public void accept(final ClassVisitor cv) {
+ String[] exceptions = new String[this.exceptions.size()];
+ this.exceptions.toArray(exceptions);
+ MethodVisitor mv = cv.visitMethod(access,
+ name,
+ desc,
+ signature,
+ exceptions);
+ if (mv != null) {
+ accept(mv);
+ }
+ }
+
+ /**
+ * Makes the given method visitor visit this method.
+ *
+ * @param mv a method visitor.
+ */
+ public void accept(final MethodVisitor mv) {
+ // visits the method attributes
+ int i, j, n;
+ if (annotationDefault != null) {
+ AnnotationVisitor av = mv.visitAnnotationDefault();
+ AnnotationNode.accept(av, null, annotationDefault);
+ av.visitEnd();
+ }
+ n = visibleAnnotations == null ? 0 : visibleAnnotations.size();
+ for (i = 0; i < n; ++i) {
+ AnnotationNode an = (AnnotationNode) visibleAnnotations.get(i);
+ an.accept(mv.visitAnnotation(an.desc, true));
+ }
+ n = invisibleAnnotations == null ? 0 : invisibleAnnotations.size();
+ for (i = 0; i < n; ++i) {
+ AnnotationNode an = (AnnotationNode) invisibleAnnotations.get(i);
+ an.accept(mv.visitAnnotation(an.desc, false));
+ }
+ n = visibleParameterAnnotations == null
+ ? 0
+ : visibleParameterAnnotations.length;
+ for (i = 0; i < n; ++i) {
+ List l = visibleParameterAnnotations[i];
+ if (l == null) {
+ continue;
+ }
+ for (j = 0; j < l.size(); ++j) {
+ AnnotationNode an = (AnnotationNode) l.get(j);
+ an.accept(mv.visitParameterAnnotation(i, an.desc, true));
+ }
+ }
+ n = invisibleParameterAnnotations == null
+ ? 0
+ : invisibleParameterAnnotations.length;
+ for (i = 0; i < n; ++i) {
+ List l = invisibleParameterAnnotations[i];
+ if (l == null) {
+ continue;
+ }
+ for (j = 0; j < l.size(); ++j) {
+ AnnotationNode an = (AnnotationNode) l.get(j);
+ an.accept(mv.visitParameterAnnotation(i, an.desc, false));
+ }
+ }
+ n = attrs == null ? 0 : attrs.size();
+ for (i = 0; i < n; ++i) {
+ mv.visitAttribute((Attribute) attrs.get(i));
+ }
+ // visits the method's code
+ if (instructions.size() > 0) {
+ mv.visitCode();
+ // visits try catch blocks
+ for (i = 0; i < tryCatchBlocks.size(); ++i) {
+ ((TryCatchBlockNode) tryCatchBlocks.get(i)).accept(mv);
+ }
+ // visits instructions
+ for (i = 0; i < instructions.size(); ++i) {
+ ((AbstractInsnNode) instructions.get(i)).accept(mv);
+ }
+ // visits local variables
+ n = localVariables == null ? 0 : localVariables.size();
+ for (i = 0; i < n; ++i) {
+ ((LocalVariableNode) localVariables.get(i)).accept(mv);
+ }
+ // visits line numbers
+ n = lineNumbers == null ? 0 : lineNumbers.size();
+ for (i = 0; i < n; ++i) {
+ ((LineNumberNode) lineNumbers.get(i)).accept(mv);
+ }
+ // visits maxs
+ mv.visitMaxs(maxStack, maxLocals);
+ }
+ mv.visitEnd();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MultiANewArrayInsnNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MultiANewArrayInsnNode.java
new file mode 100644
index 00000000000..a9cb3c14a1c
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/MultiANewArrayInsnNode.java
@@ -0,0 +1,71 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a MULTIANEWARRAY instruction.
+ *
+ * @author Eric Bruneton
+ */
+public class MultiANewArrayInsnNode extends AbstractInsnNode {
+
+ /**
+ * An array type descriptor (see {@link org.objectweb.asm.Type}).
+ */
+ public String desc;
+
+ /**
+ * Number of dimensions of the array to allocate.
+ */
+ public int dims;
+
+ /**
+ * Constructs a new {@link MultiANewArrayInsnNode}.
+ *
+ * @param desc an array type descriptor (see {@link org.objectweb.asm.Type}).
+ * @param dims number of dimensions of the array to allocate.
+ */
+ public MultiANewArrayInsnNode(final String desc, final int dims) {
+ super(Opcodes.MULTIANEWARRAY);
+ this.desc = desc;
+ this.dims = dims;
+ }
+
+ public void accept(final MethodVisitor mv) {
+ mv.visitMultiANewArrayInsn(desc, dims);
+ }
+
+ public int getType() {
+ return MULTIANEWARRAY_INSN;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/TableSwitchInsnNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/TableSwitchInsnNode.java
new file mode 100644
index 00000000000..fa5e3f8207b
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/TableSwitchInsnNode.java
@@ -0,0 +1,102 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.Label;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.MethodVisitor;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * A node that represents a TABLESWITCH instruction.
+ *
+ * @author Eric Bruneton
+ */
+public class TableSwitchInsnNode extends AbstractInsnNode {
+
+ /**
+ * The minimum key value.
+ */
+ public int min;
+
+ /**
+ * The maximum key value.
+ */
+ public int max;
+
+ /**
+ * Beginning of the default handler block.
+ */
+ public Label dflt;
+
+ /**
+ * Beginnings of the handler blocks. This list is a list of {@link Label}
+ * objects.
+ */
+ public List labels;
+
+ /**
+ * Constructs a new {@link TableSwitchInsnNode}.
+ *
+ * @param min the minimum key value.
+ * @param max the maximum key value.
+ * @param dflt beginning of the default handler block.
+ * @param labels beginnings of the handler blocks. <tt>labels[i]</tt> is
+ * the beginning of the handler block for the <tt>min + i</tt> key.
+ */
+ public TableSwitchInsnNode(
+ final int min,
+ final int max,
+ final Label dflt,
+ final Label[] labels)
+ {
+ super(Opcodes.TABLESWITCH);
+ this.min = min;
+ this.max = max;
+ this.dflt = dflt;
+ this.labels = new ArrayList();
+ if (labels != null) {
+ this.labels.addAll(Arrays.asList(labels));
+ }
+ }
+
+ public void accept(final MethodVisitor mv) {
+ Label[] labels = new Label[this.labels.size()];
+ this.labels.toArray(labels);
+ mv.visitTableSwitchInsn(min, max, dflt, labels);
+ }
+
+ public int getType() {
+ return TABLESWITCH_INSN;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/TryCatchBlockNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/TryCatchBlockNode.java
new file mode 100644
index 00000000000..18cd3102240
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/TryCatchBlockNode.java
@@ -0,0 +1,93 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a try catch block.
+ *
+ * @author Eric Bruneton
+ */
+public class TryCatchBlockNode {
+
+ /**
+ * Beginning of the exception handler's scope (inclusive).
+ */
+ public Label start;
+
+ /**
+ * End of the exception handler's scope (exclusive).
+ */
+ public Label end;
+
+ /**
+ * Beginning of the exception handler's code.
+ */
+ public Label handler;
+
+ /**
+ * Internal name of the type of exceptions handled by the handler. May be
+ * <tt>null</tt> to catch any exceptions (for "finally" blocks).
+ */
+ public String type;
+
+ /**
+ * Constructs a new {@link TryCatchBlockNode}.
+ *
+ * @param start beginning of the exception handler's scope (inclusive).
+ * @param end end of the exception handler's scope (exclusive).
+ * @param handler beginning of the exception handler's code.
+ * @param type internal name of the type of exceptions handled by the
+ * handler, or <tt>null</tt> to catch any exceptions (for "finally"
+ * blocks).
+ */
+ public TryCatchBlockNode(
+ final Label start,
+ final Label end,
+ final Label handler,
+ final String type)
+ {
+ this.start = start;
+ this.end = end;
+ this.handler = handler;
+ this.type = type;
+ }
+
+ /**
+ * Makes the given visitor visit this try catch block.
+ *
+ * @param mv a method visitor.
+ */
+ public void accept(final MethodVisitor mv) {
+ mv.visitTryCatchBlock(start, end, handler, type);
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/TypeInsnNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/TypeInsnNode.java
new file mode 100644
index 00000000000..67c6b841eae
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/TypeInsnNode.java
@@ -0,0 +1,78 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a type instruction. A type instruction is an
+ * instruction that takes a type descriptor as parameter.
+ *
+ * @author Eric Bruneton
+ */
+public class TypeInsnNode extends AbstractInsnNode {
+
+ /**
+ * The operand of this instruction. This operand is a type descriptor (see
+ * {@link org.objectweb.asm.Type}).
+ */
+ public String desc;
+
+ /**
+ * Constructs a new {@link TypeInsnNode}.
+ *
+ * @param opcode the opcode of the type instruction to be constructed. This
+ * opcode must be NEW, ANEWARRAY, CHECKCAST or INSTANCEOF.
+ * @param desc the operand of the instruction to be constructed. This
+ * operand is a type descriptor (see {@link org.objectweb.asm.Type}).
+ */
+ public TypeInsnNode(final int opcode, final String desc) {
+ super(opcode);
+ this.desc = desc;
+ }
+
+ /**
+ * Sets the opcode of this instruction.
+ *
+ * @param opcode the new instruction opcode. This opcode must be NEW,
+ * ANEWARRAY, CHECKCAST or INSTANCEOF.
+ */
+ public void setOpcode(final int opcode) {
+ this.opcode = opcode;
+ }
+
+ public void accept(final MethodVisitor mv) {
+ mv.visitTypeInsn(opcode, desc);
+ }
+
+ public int getType() {
+ return TYPE_INSN;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/VarInsnNode.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/VarInsnNode.java
new file mode 100644
index 00000000000..2fe3a952a50
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/VarInsnNode.java
@@ -0,0 +1,81 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree;
+
+import org.objectweb.asm.MethodVisitor;
+
+/**
+ * A node that represents a local variable instruction. A local variable
+ * instruction is an instruction that loads or stores the value of a local
+ * variable.
+ *
+ * @author Eric Bruneton
+ */
+public class VarInsnNode extends AbstractInsnNode {
+
+ /**
+ * The operand of this instruction. This operand is the index of a local
+ * variable.
+ */
+ public int var;
+
+ /**
+ * Constructs a new {@link VarInsnNode}.
+ *
+ * @param opcode the opcode of the local variable instruction to be
+ * constructed. This opcode must be ILOAD, LLOAD, FLOAD, DLOAD,
+ * ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or RET.
+ * @param var the operand of the instruction to be constructed. This operand
+ * is the index of a local variable.
+ */
+ public VarInsnNode(final int opcode, final int var) {
+ super(opcode);
+ this.var = var;
+ }
+
+ /**
+ * Sets the opcode of this instruction.
+ *
+ * @param opcode the new instruction opcode. This opcode must be ILOAD,
+ * LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE
+ * or RET.
+ */
+ public void setOpcode(final int opcode) {
+ this.opcode = opcode;
+ }
+
+ public void accept(final MethodVisitor mv) {
+ mv.visitVarInsn(opcode, var);
+ }
+
+ public int getType() {
+ return VAR_INSN;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Analyzer.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Analyzer.java
new file mode 100644
index 00000000000..9fd402831cc
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Analyzer.java
@@ -0,0 +1,416 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree.analysis;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.tree.AbstractInsnNode;
+import org.objectweb.asm.tree.IincInsnNode;
+import org.objectweb.asm.tree.JumpInsnNode;
+import org.objectweb.asm.tree.LabelNode;
+import org.objectweb.asm.tree.LookupSwitchInsnNode;
+import org.objectweb.asm.tree.MethodNode;
+import org.objectweb.asm.tree.TableSwitchInsnNode;
+import org.objectweb.asm.tree.TryCatchBlockNode;
+import org.objectweb.asm.tree.VarInsnNode;
+
+/**
+ * A semantic bytecode analyzer.
+ *
+ * @author Eric Bruneton
+ */
+public class Analyzer implements Opcodes {
+
+ private Interpreter interpreter;
+
+ private int n;
+
+ private IntMap indexes;
+
+ private List[] handlers;
+
+ private Frame[] frames;
+
+ private Subroutine[] subroutines;
+
+ private boolean[] queued;
+
+ private int[] queue;
+
+ private int top;
+
+ private boolean jsr;
+
+ /**
+ * Constructs a new {@link Analyzer}.
+ *
+ * @param interpreter the interpreter to be used to symbolically interpret
+ * the bytecode instructions.
+ */
+ public Analyzer(final Interpreter interpreter) {
+ this.interpreter = interpreter;
+ }
+
+ /**
+ * Analyzes the given method.
+ *
+ * @param owner the internal name of the class to which the method belongs.
+ * @param m the method to be analyzed.
+ * @return the symbolic state of the execution stack frame at each bytecode
+ * instruction of the method. The size of the returned array is
+ * equal to the number of instructions (and labels) of the method. A
+ * given frame is <tt>null</tt> if and only if the corresponding
+ * instruction cannot be reached (dead code).
+ * @throws AnalyzerException if a problem occurs during the analysis.
+ */
+ public Frame[] analyze(final String owner, final MethodNode m)
+ throws AnalyzerException
+ {
+ n = m.instructions.size();
+ indexes = new IntMap(2 * n);
+ handlers = new List[n];
+ frames = new Frame[n];
+ subroutines = new Subroutine[n];
+ queued = new boolean[n];
+ queue = new int[n];
+ top = 0;
+
+ // computes instruction indexes
+ for (int i = 0; i < n; ++i) {
+ Object insn = m.instructions.get(i);
+ if (insn instanceof LabelNode) {
+ insn = ((LabelNode) insn).label;
+ }
+ indexes.put(insn, i);
+ }
+
+ // computes exception handlers for each instruction
+ for (int i = 0; i < m.tryCatchBlocks.size(); ++i) {
+ TryCatchBlockNode tcb = (TryCatchBlockNode) m.tryCatchBlocks.get(i);
+ int begin = indexes.get(tcb.start);
+ int end = indexes.get(tcb.end);
+ for (int j = begin; j < end; ++j) {
+ List insnHandlers = handlers[j];
+ if (insnHandlers == null) {
+ insnHandlers = new ArrayList();
+ handlers[j] = insnHandlers;
+ }
+ insnHandlers.add(tcb);
+ }
+ }
+
+ // initializes the data structures for the control flow analysis
+ // algorithm
+ Frame current = newFrame(m.maxLocals, m.maxStack);
+ Frame handler = newFrame(m.maxLocals, m.maxStack);
+ Type[] args = Type.getArgumentTypes(m.desc);
+ int local = 0;
+ if ((m.access & ACC_STATIC) == 0) {
+ Type ctype = Type.getType("L" + owner + ";");
+ current.setLocal(local++, interpreter.newValue(ctype));
+ }
+ for (int i = 0; i < args.length; ++i) {
+ current.setLocal(local++, interpreter.newValue(args[i]));
+ if (args[i].getSize() == 2) {
+ current.setLocal(local++, interpreter.newValue(null));
+ }
+ }
+ while (local < m.maxLocals) {
+ current.setLocal(local++, interpreter.newValue(null));
+ }
+ merge(0, current, null);
+
+ // control flow analysis
+ while (top > 0) {
+ int insn = queue[--top];
+ Frame f = frames[insn];
+ Subroutine subroutine = subroutines[insn];
+ queued[insn] = false;
+
+ try {
+ Object o = m.instructions.get(insn);
+ jsr = false;
+
+ if (o instanceof LabelNode) {
+ merge(insn + 1, f, subroutine);
+ } else {
+ AbstractInsnNode insnNode = (AbstractInsnNode) o;
+ int insnOpcode = insnNode.getOpcode();
+
+ current.init(f).execute(insnNode, interpreter);
+ subroutine = subroutine == null ? null : subroutine.copy();
+
+ if (insnNode instanceof JumpInsnNode) {
+ JumpInsnNode j = (JumpInsnNode) insnNode;
+ if (insnOpcode != GOTO && insnOpcode != JSR) {
+ merge(insn + 1, current, subroutine);
+ }
+ if (insnOpcode == JSR) {
+ jsr = true;
+ merge(indexes.get(j.label),
+ current,
+ new Subroutine(j.label, m.maxLocals, j));
+ } else {
+ merge(indexes.get(j.label), current, subroutine);
+ }
+ } else if (insnNode instanceof LookupSwitchInsnNode) {
+ LookupSwitchInsnNode lsi = (LookupSwitchInsnNode) insnNode;
+ merge(indexes.get(lsi.dflt), current, subroutine);
+ for (int j = 0; j < lsi.labels.size(); ++j) {
+ Label label = (Label) lsi.labels.get(j);
+ merge(indexes.get(label), current, subroutine);
+ }
+ } else if (insnNode instanceof TableSwitchInsnNode) {
+ TableSwitchInsnNode tsi = (TableSwitchInsnNode) insnNode;
+ merge(indexes.get(tsi.dflt), current, subroutine);
+ for (int j = 0; j < tsi.labels.size(); ++j) {
+ Label label = (Label) tsi.labels.get(j);
+ merge(indexes.get(label), current, subroutine);
+ }
+ } else if (insnOpcode == RET) {
+ if (subroutine == null) {
+ throw new AnalyzerException("RET instruction outside of a sub routine");
+ }
+ for (int i = 0; i < subroutine.callers.size(); ++i) {
+ int caller = indexes.get(subroutine.callers.get(i));
+ merge(caller + 1,
+ frames[caller],
+ current,
+ subroutines[caller],
+ subroutine.access);
+ }
+ } else if (insnOpcode != ATHROW
+ && (insnOpcode < IRETURN || insnOpcode > RETURN))
+ {
+ if (subroutine != null) {
+ if (insnNode instanceof VarInsnNode) {
+ int var = ((VarInsnNode) insnNode).var;
+ subroutine.access[var] = true;
+ if (insnOpcode == LLOAD || insnOpcode == DLOAD
+ || insnOpcode == LSTORE
+ || insnOpcode == DSTORE)
+ {
+ subroutine.access[var + 1] = true;
+ }
+ } else if (insnNode instanceof IincInsnNode) {
+ int var = ((IincInsnNode) insnNode).var;
+ subroutine.access[var] = true;
+ }
+ }
+ merge(insn + 1, current, subroutine);
+ }
+ }
+
+ List insnHandlers = handlers[insn];
+ if (insnHandlers != null) {
+ for (int i = 0; i < insnHandlers.size(); ++i) {
+ TryCatchBlockNode tcb = (TryCatchBlockNode) insnHandlers.get(i);
+ Type type;
+ if (tcb.type == null) {
+ type = Type.getType("Ljava/lang/Throwable;");
+ } else {
+ type = Type.getType("L" + tcb.type + ";");
+ }
+ handler.init(f);
+ handler.clearStack();
+ handler.push(interpreter.newValue(type));
+ merge(indexes.get(tcb.handler), handler, subroutine);
+ }
+ }
+ } catch (AnalyzerException e) {
+ throw new AnalyzerException("Error at instruction " + insn
+ + ": " + e.getMessage(), e);
+ } catch(Exception e) {
+ throw new AnalyzerException("Error at instruction " + insn
+ + ": " + e.getMessage(), e);
+ }
+ }
+
+ return frames;
+ }
+
+ /**
+ * Returns the symbolic stack frame for each instruction of the last
+ * recently analyzed method.
+ *
+ * @return the symbolic state of the execution stack frame at each bytecode
+ * instruction of the method. The size of the returned array is
+ * equal to the number of instructions (and labels) of the method. A
+ * given frame is <tt>null</tt> if the corresponding instruction
+ * cannot be reached, or if an error occured during the analysis of
+ * the method.
+ */
+ public Frame[] getFrames() {
+ return frames;
+ }
+
+ /**
+ * Returns the index of the given instruction.
+ *
+ * @param insn a {@link Label} or {@link AbstractInsnNode} of the last
+ * recently analyzed method.
+ * @return the index of the given instruction of the last recently analyzed
+ * method.
+ */
+ public int getIndex(final Object insn) {
+ return indexes.get(insn);
+ }
+
+ /**
+ * Returns the exception handlers for the given instruction.
+ *
+ * @param insn the index of an instruction of the last recently analyzed
+ * method.
+ * @return a list of {@link TryCatchBlockNode} objects.
+ */
+ public List getHandlers(final int insn) {
+ return handlers[insn];
+ }
+
+ /**
+ * Constructs a new frame with the given size.
+ *
+ * @param nLocals the maximum number of local variables of the frame.
+ * @param nStack the maximum stack size of the frame.
+ * @return the created frame.
+ */
+ protected Frame newFrame(final int nLocals, final int nStack) {
+ return new Frame(nLocals, nStack);
+ }
+
+ /**
+ * Constructs a new frame that is identical to the given frame.
+ *
+ * @param src a frame.
+ * @return the created frame.
+ */
+ protected Frame newFrame(final Frame src) {
+ return new Frame(src);
+ }
+
+ /**
+ * Creates a control flow graph edge. The default implementation of this
+ * method does nothing. It can be overriden in order to construct the
+ * control flow graph of a method (this method is called by the
+ * {@link #analyze analyze} method during its visit of the method's code).
+ *
+ * @param frame the frame corresponding to an instruction.
+ * @param successor the frame corresponding to a successor instruction.
+ */
+ protected void newControlFlowEdge(final Frame frame, final Frame successor)
+ {
+ }
+
+ // -------------------------------------------------------------------------
+
+ private void merge(
+ final int insn,
+ final Frame frame,
+ final Subroutine subroutine) throws AnalyzerException
+ {
+ if (insn > n - 1) {
+ throw new AnalyzerException("Execution can fall off end of the code");
+ }
+
+ Frame oldFrame = frames[insn];
+ Subroutine oldSubroutine = subroutines[insn];
+ boolean changes = false;
+
+ if (oldFrame == null) {
+ frames[insn] = newFrame(frame);
+ changes = true;
+ } else {
+ changes |= oldFrame.merge(frame, interpreter);
+ }
+
+ newControlFlowEdge(frame, oldFrame);
+
+ if (oldSubroutine == null) {
+ if (subroutine != null) {
+ subroutines[insn] = subroutine.copy();
+ changes = true;
+ }
+ } else {
+ if (subroutine != null) {
+ changes |= oldSubroutine.merge(subroutine, !jsr);
+ }
+ }
+ if (changes && !queued[insn]) {
+ queued[insn] = true;
+ queue[top++] = insn;
+ }
+ }
+
+ private void merge(
+ final int insn,
+ final Frame beforeJSR,
+ final Frame afterRET,
+ final Subroutine subroutineBeforeJSR,
+ final boolean[] access) throws AnalyzerException
+ {
+ if (insn > n - 1) {
+ throw new AnalyzerException("Execution can fall off end of the code");
+ }
+
+ Frame oldFrame = frames[insn];
+ Subroutine oldSubroutine = subroutines[insn];
+ boolean changes = false;
+
+ afterRET.merge(beforeJSR, access);
+
+ if (oldFrame == null) {
+ frames[insn] = newFrame(afterRET);
+ changes = true;
+ } else {
+ changes |= oldFrame.merge(afterRET, access);
+ }
+
+ newControlFlowEdge(afterRET, oldFrame);
+
+ if (oldSubroutine == null) {
+ if (subroutineBeforeJSR != null) {
+ subroutines[insn] = subroutineBeforeJSR.copy();
+ changes = true;
+ }
+ } else {
+ if (subroutineBeforeJSR != null) {
+ changes |= oldSubroutine.merge(subroutineBeforeJSR, !jsr);
+ }
+ }
+ if (changes && !queued[insn]) {
+ queued[insn] = true;
+ queue[top++] = insn;
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/AnalyzerException.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/AnalyzerException.java
new file mode 100644
index 00000000000..3e0afac9797
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/AnalyzerException.java
@@ -0,0 +1,56 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree.analysis;
+
+/**
+ * Thrown if a problem occurs during the analysis of a method.
+ *
+ * @author Bing Ran
+ * @author Eric Bruneton
+ */
+public class AnalyzerException extends Exception {
+
+ public AnalyzerException(final String msg) {
+ super(msg);
+ }
+
+ public AnalyzerException(final String msg, final Throwable exception) {
+ super(msg, exception);
+ }
+
+ public AnalyzerException(
+ final String msg,
+ final Object expected,
+ final Value encountered)
+ {
+ super((msg == null ? "Expected " : msg + ": expected ") + expected
+ + ", but found " + encountered);
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/BasicInterpreter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/BasicInterpreter.java
new file mode 100644
index 00000000000..b92b57c2fee
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/BasicInterpreter.java
@@ -0,0 +1,335 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree.analysis;
+
+import java.util.List;
+
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.tree.AbstractInsnNode;
+import org.objectweb.asm.tree.FieldInsnNode;
+import org.objectweb.asm.tree.IntInsnNode;
+import org.objectweb.asm.tree.LdcInsnNode;
+import org.objectweb.asm.tree.MethodInsnNode;
+import org.objectweb.asm.tree.MultiANewArrayInsnNode;
+import org.objectweb.asm.tree.TypeInsnNode;
+
+/**
+ * An {@link Interpreter} for {@link BasicValue} values.
+ *
+ * @author Eric Bruneton
+ * @author Bing Ran
+ */
+public class BasicInterpreter implements Opcodes, Interpreter {
+
+ public Value newValue(final Type type) {
+ if (type == null) {
+ return BasicValue.UNINITIALIZED_VALUE;
+ }
+ switch (type.getSort()) {
+ case Type.VOID:
+ return null;
+ case Type.BOOLEAN:
+ case Type.CHAR:
+ case Type.BYTE:
+ case Type.SHORT:
+ case Type.INT:
+ return BasicValue.INT_VALUE;
+ case Type.FLOAT:
+ return BasicValue.FLOAT_VALUE;
+ case Type.LONG:
+ return BasicValue.LONG_VALUE;
+ case Type.DOUBLE:
+ return BasicValue.DOUBLE_VALUE;
+ case Type.ARRAY:
+ case Type.OBJECT:
+ return BasicValue.REFERENCE_VALUE;
+ default:
+ throw new RuntimeException("Internal error.");
+ }
+ }
+
+ public Value newOperation(final AbstractInsnNode insn) {
+ switch (insn.getOpcode()) {
+ case ACONST_NULL:
+ return newValue(Type.getType("Lnull;"));
+ case ICONST_M1:
+ case ICONST_0:
+ case ICONST_1:
+ case ICONST_2:
+ case ICONST_3:
+ case ICONST_4:
+ case ICONST_5:
+ return BasicValue.INT_VALUE;
+ case LCONST_0:
+ case LCONST_1:
+ return BasicValue.LONG_VALUE;
+ case FCONST_0:
+ case FCONST_1:
+ case FCONST_2:
+ return BasicValue.FLOAT_VALUE;
+ case DCONST_0:
+ case DCONST_1:
+ return BasicValue.DOUBLE_VALUE;
+ case BIPUSH:
+ case SIPUSH:
+ return BasicValue.INT_VALUE;
+ case LDC:
+ Object cst = ((LdcInsnNode) insn).cst;
+ if (cst instanceof Integer) {
+ return BasicValue.INT_VALUE;
+ } else if (cst instanceof Float) {
+ return BasicValue.FLOAT_VALUE;
+ } else if (cst instanceof Long) {
+ return BasicValue.LONG_VALUE;
+ } else if (cst instanceof Double) {
+ return BasicValue.DOUBLE_VALUE;
+ } else if (cst instanceof Type) {
+ return newValue(Type.getType("Ljava/lang/Class;"));
+ } else {
+ return newValue(Type.getType(cst.getClass()));
+ }
+ case JSR:
+ return BasicValue.RETURNADDRESS_VALUE;
+ case GETSTATIC:
+ return newValue(Type.getType(((FieldInsnNode) insn).desc));
+ case NEW:
+ return newValue(Type.getType("L" + ((TypeInsnNode) insn).desc
+ + ";"));
+ default:
+ throw new RuntimeException("Internal error.");
+ }
+ }
+
+ public Value copyOperation(final AbstractInsnNode insn, final Value value)
+ throws AnalyzerException
+ {
+ return value;
+ }
+
+ public Value unaryOperation(final AbstractInsnNode insn, final Value value)
+ throws AnalyzerException
+ {
+ switch (insn.getOpcode()) {
+ case INEG:
+ case IINC:
+ case L2I:
+ case F2I:
+ case D2I:
+ case I2B:
+ case I2C:
+ case I2S:
+ return BasicValue.INT_VALUE;
+ case FNEG:
+ case I2F:
+ case L2F:
+ case D2F:
+ return BasicValue.FLOAT_VALUE;
+ case LNEG:
+ case I2L:
+ case F2L:
+ case D2L:
+ return BasicValue.LONG_VALUE;
+ case DNEG:
+ case I2D:
+ case L2D:
+ case F2D:
+ return BasicValue.DOUBLE_VALUE;
+ case IFEQ:
+ case IFNE:
+ case IFLT:
+ case IFGE:
+ case IFGT:
+ case IFLE:
+ case TABLESWITCH:
+ case LOOKUPSWITCH:
+ case IRETURN:
+ case LRETURN:
+ case FRETURN:
+ case DRETURN:
+ case ARETURN:
+ case PUTSTATIC:
+ return null;
+ case GETFIELD:
+ return newValue(Type.getType(((FieldInsnNode) insn).desc));
+ case NEWARRAY:
+ switch (((IntInsnNode) insn).operand) {
+ case T_BOOLEAN:
+ return newValue(Type.getType("[Z"));
+ case T_CHAR:
+ return newValue(Type.getType("[C"));
+ case T_BYTE:
+ return newValue(Type.getType("[B"));
+ case T_SHORT:
+ return newValue(Type.getType("[S"));
+ case T_INT:
+ return newValue(Type.getType("[I"));
+ case T_FLOAT:
+ return newValue(Type.getType("[F"));
+ case T_DOUBLE:
+ return newValue(Type.getType("[D"));
+ case T_LONG:
+ return newValue(Type.getType("[J"));
+ default:
+ throw new AnalyzerException("Invalid array type");
+ }
+ case ANEWARRAY:
+ String desc = ((TypeInsnNode) insn).desc;
+ if (desc.charAt(0) == '[') {
+ return newValue(Type.getType("[" + desc));
+ } else {
+ return newValue(Type.getType("[L" + desc + ";"));
+ }
+ case ARRAYLENGTH:
+ return BasicValue.INT_VALUE;
+ case ATHROW:
+ return null;
+ case CHECKCAST:
+ desc = ((TypeInsnNode) insn).desc;
+ if (desc.charAt(0) == '[') {
+ return newValue(Type.getType(desc));
+ } else {
+ return newValue(Type.getType("L" + desc + ";"));
+ }
+ case INSTANCEOF:
+ return BasicValue.INT_VALUE;
+ case MONITORENTER:
+ case MONITOREXIT:
+ case IFNULL:
+ case IFNONNULL:
+ return null;
+ default:
+ throw new RuntimeException("Internal error.");
+ }
+ }
+
+ public Value binaryOperation(
+ final AbstractInsnNode insn,
+ final Value value1,
+ final Value value2) throws AnalyzerException
+ {
+ switch (insn.getOpcode()) {
+ case IALOAD:
+ case BALOAD:
+ case CALOAD:
+ case SALOAD:
+ case IADD:
+ case ISUB:
+ case IMUL:
+ case IDIV:
+ case IREM:
+ case ISHL:
+ case ISHR:
+ case IUSHR:
+ case IAND:
+ case IOR:
+ case IXOR:
+ return BasicValue.INT_VALUE;
+ case FALOAD:
+ case FADD:
+ case FSUB:
+ case FMUL:
+ case FDIV:
+ case FREM:
+ return BasicValue.FLOAT_VALUE;
+ case LALOAD:
+ case LADD:
+ case LSUB:
+ case LMUL:
+ case LDIV:
+ case LREM:
+ case LSHL:
+ case LSHR:
+ case LUSHR:
+ case LAND:
+ case LOR:
+ case LXOR:
+ return BasicValue.LONG_VALUE;
+ case DALOAD:
+ case DADD:
+ case DSUB:
+ case DMUL:
+ case DDIV:
+ case DREM:
+ return BasicValue.DOUBLE_VALUE;
+ case AALOAD:
+ Type t = ((BasicValue) value1).getType();
+ if (t != null && t.getSort() == Type.ARRAY) {
+ return newValue(t.getElementType());
+ } else {
+ return BasicValue.REFERENCE_VALUE;
+ }
+ case LCMP:
+ case FCMPL:
+ case FCMPG:
+ case DCMPL:
+ case DCMPG:
+ return BasicValue.INT_VALUE;
+ case IF_ICMPEQ:
+ case IF_ICMPNE:
+ case IF_ICMPLT:
+ case IF_ICMPGE:
+ case IF_ICMPGT:
+ case IF_ICMPLE:
+ case IF_ACMPEQ:
+ case IF_ACMPNE:
+ case PUTFIELD:
+ return null;
+ default:
+ throw new RuntimeException("Internal error.");
+ }
+ }
+
+ public Value ternaryOperation(
+ final AbstractInsnNode insn,
+ final Value value1,
+ final Value value2,
+ final Value value3) throws AnalyzerException
+ {
+ return null;
+ }
+
+ public Value naryOperation(final AbstractInsnNode insn, final List values)
+ throws AnalyzerException
+ {
+ if (insn.getOpcode() == MULTIANEWARRAY) {
+ return newValue(Type.getType(((MultiANewArrayInsnNode) insn).desc));
+ } else {
+ return newValue(Type.getReturnType(((MethodInsnNode) insn).desc));
+ }
+ }
+
+ public Value merge(final Value v, final Value w) {
+ if (!v.equals(w)) {
+ return BasicValue.UNINITIALIZED_VALUE;
+ }
+ return v;
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/BasicValue.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/BasicValue.java
new file mode 100644
index 00000000000..19cdb33a959
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/BasicValue.java
@@ -0,0 +1,105 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree.analysis;
+
+import org.objectweb.asm.Type;
+
+/**
+ * A {@link Value} that is represented by its type in a seven types type sytem.
+ * This type system distinguishes the UNINITIALZED, INT, FLOAT, LONG, DOUBLE,
+ * REFERENCE and RETURNADDRESS types.
+ *
+ * @author Eric Bruneton
+ */
+public class BasicValue implements Value {
+
+ public final static Value UNINITIALIZED_VALUE = new BasicValue(null);
+
+ public final static Value INT_VALUE = new BasicValue(Type.INT_TYPE);
+
+ public final static Value FLOAT_VALUE = new BasicValue(Type.FLOAT_TYPE);
+
+ public final static Value LONG_VALUE = new BasicValue(Type.LONG_TYPE);
+
+ public final static Value DOUBLE_VALUE = new BasicValue(Type.DOUBLE_TYPE);
+
+ public final static Value REFERENCE_VALUE = new BasicValue(Type.getType("Ljava/lang/Object;"));
+
+ public final static Value RETURNADDRESS_VALUE = new BasicValue(null);
+
+ private Type type;
+
+ public BasicValue(final Type type) {
+ this.type = type;
+ }
+
+ public Type getType() {
+ return type;
+ }
+
+ public int getSize() {
+ return type == Type.LONG_TYPE || type == Type.DOUBLE_TYPE ? 2 : 1;
+ }
+
+ public boolean isReference() {
+ return type != null
+ && (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY);
+ }
+
+ public boolean equals(final Object value) {
+ if (value == this) {
+ return true;
+ } else if (value instanceof BasicValue) {
+ if (type == null) {
+ return ((BasicValue) value).type == null;
+ } else {
+ return type.equals(((BasicValue) value).type);
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public int hashCode() {
+ return type == null ? 0 : type.hashCode();
+ }
+
+ public String toString() {
+ if (this == UNINITIALIZED_VALUE) {
+ return ".";
+ } else if (this == RETURNADDRESS_VALUE) {
+ return "A";
+ } else if (this == REFERENCE_VALUE) {
+ return "R";
+ } else {
+ return type.getDescriptor();
+ }
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/BasicVerifier.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/BasicVerifier.java
new file mode 100644
index 00000000000..0a797d493e7
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/BasicVerifier.java
@@ -0,0 +1,428 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree.analysis;
+
+import java.util.List;
+
+import org.objectweb.asm.Type;
+import org.objectweb.asm.tree.AbstractInsnNode;
+import org.objectweb.asm.tree.FieldInsnNode;
+import org.objectweb.asm.tree.MethodInsnNode;
+
+/**
+ * An extended {@link BasicInterpreter} that checks that bytecode instructions
+ * are correctly used.
+ *
+ * @author Eric Bruneton
+ * @author Bing Ran
+ */
+public class BasicVerifier extends BasicInterpreter {
+
+ public Value copyOperation(final AbstractInsnNode insn, final Value value)
+ throws AnalyzerException
+ {
+ Value expected;
+ switch (insn.getOpcode()) {
+ case ILOAD:
+ case ISTORE:
+ expected = BasicValue.INT_VALUE;
+ break;
+ case FLOAD:
+ case FSTORE:
+ expected = BasicValue.FLOAT_VALUE;
+ break;
+ case LLOAD:
+ case LSTORE:
+ expected = BasicValue.LONG_VALUE;
+ break;
+ case DLOAD:
+ case DSTORE:
+ expected = BasicValue.DOUBLE_VALUE;
+ break;
+ case ALOAD:
+ if (!((BasicValue) value).isReference()) {
+ throw new AnalyzerException(null,
+ "an object reference",
+ value);
+ }
+ return value;
+ case ASTORE:
+ if (!((BasicValue) value).isReference()
+ && value != BasicValue.RETURNADDRESS_VALUE)
+ {
+ throw new AnalyzerException(null,
+ "an object reference or a return address",
+ value);
+ }
+ return value;
+ default:
+ return value;
+ }
+ // type is necessarily a primitive type here,
+ // so value must be == to expected value
+ if (value != expected) {
+ throw new AnalyzerException(null, expected, value);
+ }
+ return value;
+ }
+
+ public Value unaryOperation(final AbstractInsnNode insn, Value value)
+ throws AnalyzerException
+ {
+ Value expected;
+ switch (insn.getOpcode()) {
+ case INEG:
+ case IINC:
+ case I2F:
+ case I2L:
+ case I2D:
+ case I2B:
+ case I2C:
+ case I2S:
+ case IFEQ:
+ case IFNE:
+ case IFLT:
+ case IFGE:
+ case IFGT:
+ case IFLE:
+ case TABLESWITCH:
+ case LOOKUPSWITCH:
+ case IRETURN:
+ case NEWARRAY:
+ case ANEWARRAY:
+ expected = BasicValue.INT_VALUE;
+ break;
+ case FNEG:
+ case F2I:
+ case F2L:
+ case F2D:
+ case FRETURN:
+ expected = BasicValue.FLOAT_VALUE;
+ break;
+ case LNEG:
+ case L2I:
+ case L2F:
+ case L2D:
+ case LRETURN:
+ expected = BasicValue.LONG_VALUE;
+ break;
+ case DNEG:
+ case D2I:
+ case D2F:
+ case D2L:
+ case DRETURN:
+ expected = BasicValue.DOUBLE_VALUE;
+ break;
+ case GETFIELD:
+ expected = newValue(Type.getType("L"
+ + ((FieldInsnNode) insn).owner + ";"));
+ break;
+ case CHECKCAST:
+ if (!((BasicValue) value).isReference()) {
+ throw new AnalyzerException(null,
+ "an object reference",
+ value);
+ }
+ return super.unaryOperation(insn, value);
+ case ARRAYLENGTH:
+ if (!isArrayValue(value)) {
+ throw new AnalyzerException(null,
+ "an array reference",
+ value);
+ }
+ return super.unaryOperation(insn, value);
+ case ARETURN:
+ case ATHROW:
+ case INSTANCEOF:
+ case MONITORENTER:
+ case MONITOREXIT:
+ case IFNULL:
+ case IFNONNULL:
+ if (!((BasicValue) value).isReference()) {
+ throw new AnalyzerException(null,
+ "an object reference",
+ value);
+ }
+ return super.unaryOperation(insn, value);
+ case PUTSTATIC:
+ expected = newValue(Type.getType(((FieldInsnNode) insn).desc));
+ break;
+ default:
+ throw new RuntimeException("Internal error.");
+ }
+ if (!isSubTypeOf(value, expected)) {
+ throw new AnalyzerException(null, expected, value);
+ }
+ return super.unaryOperation(insn, value);
+ }
+
+ public Value binaryOperation(
+ final AbstractInsnNode insn,
+ final Value value1,
+ final Value value2) throws AnalyzerException
+ {
+ Value expected1;
+ Value expected2;
+ switch (insn.getOpcode()) {
+ case IALOAD:
+ expected1 = newValue(Type.getType("[I"));
+ expected2 = BasicValue.INT_VALUE;
+ break;
+ case BALOAD:
+ if (!isSubTypeOf(value1, newValue(Type.getType("[Z")))) {
+ expected1 = newValue(Type.getType("[B"));
+ } else {
+ expected1 = newValue(Type.getType("[Z"));
+ }
+ expected2 = BasicValue.INT_VALUE;
+ break;
+ case CALOAD:
+ expected1 = newValue(Type.getType("[C"));
+ expected2 = BasicValue.INT_VALUE;
+ break;
+ case SALOAD:
+ expected1 = newValue(Type.getType("[S"));
+ expected2 = BasicValue.INT_VALUE;
+ break;
+ case LALOAD:
+ expected1 = newValue(Type.getType("[J"));
+ expected2 = BasicValue.INT_VALUE;
+ break;
+ case FALOAD:
+ expected1 = newValue(Type.getType("[F"));
+ expected2 = BasicValue.INT_VALUE;
+ break;
+ case DALOAD:
+ expected1 = newValue(Type.getType("[D"));
+ expected2 = BasicValue.INT_VALUE;
+ break;
+ case AALOAD:
+ expected1 = newValue(Type.getType("[Ljava/lang/Object;"));
+ expected2 = BasicValue.INT_VALUE;
+ break;
+ case IADD:
+ case ISUB:
+ case IMUL:
+ case IDIV:
+ case IREM:
+ case ISHL:
+ case ISHR:
+ case IUSHR:
+ case IAND:
+ case IOR:
+ case IXOR:
+ case IF_ICMPEQ:
+ case IF_ICMPNE:
+ case IF_ICMPLT:
+ case IF_ICMPGE:
+ case IF_ICMPGT:
+ case IF_ICMPLE:
+ expected1 = BasicValue.INT_VALUE;
+ expected2 = BasicValue.INT_VALUE;
+ break;
+ case FADD:
+ case FSUB:
+ case FMUL:
+ case FDIV:
+ case FREM:
+ case FCMPL:
+ case FCMPG:
+ expected1 = BasicValue.FLOAT_VALUE;
+ expected2 = BasicValue.FLOAT_VALUE;
+ break;
+ case LADD:
+ case LSUB:
+ case LMUL:
+ case LDIV:
+ case LREM:
+ case LAND:
+ case LOR:
+ case LXOR:
+ case LCMP:
+ expected1 = BasicValue.LONG_VALUE;
+ expected2 = BasicValue.LONG_VALUE;
+ break;
+ case LSHL:
+ case LSHR:
+ case LUSHR:
+ expected1 = BasicValue.LONG_VALUE;
+ expected2 = BasicValue.INT_VALUE;
+ break;
+ case DADD:
+ case DSUB:
+ case DMUL:
+ case DDIV:
+ case DREM:
+ case DCMPL:
+ case DCMPG:
+ expected1 = BasicValue.DOUBLE_VALUE;
+ expected2 = BasicValue.DOUBLE_VALUE;
+ break;
+ case IF_ACMPEQ:
+ case IF_ACMPNE:
+ expected1 = BasicValue.REFERENCE_VALUE;
+ expected2 = BasicValue.REFERENCE_VALUE;
+ break;
+ case PUTFIELD:
+ FieldInsnNode fin = (FieldInsnNode) insn;
+ expected1 = newValue(Type.getType("L" + fin.owner + ";"));
+ expected2 = newValue(Type.getType(fin.desc));
+ break;
+ default:
+ throw new RuntimeException("Internal error.");
+ }
+ if (!isSubTypeOf(value1, expected1)) {
+ throw new AnalyzerException("First argument", expected1, value1);
+ } else if (!isSubTypeOf(value2, expected2)) {
+ throw new AnalyzerException("Second argument", expected2, value2);
+ }
+ if (insn.getOpcode() == AALOAD) {
+ return getElementValue(value1);
+ } else {
+ return super.binaryOperation(insn, value1, value2);
+ }
+ }
+
+ public Value ternaryOperation(
+ final AbstractInsnNode insn,
+ final Value value1,
+ final Value value2,
+ final Value value3) throws AnalyzerException
+ {
+ Value expected1;
+ Value expected3;
+ switch (insn.getOpcode()) {
+ case IASTORE:
+ expected1 = newValue(Type.getType("[I"));
+ expected3 = BasicValue.INT_VALUE;
+ break;
+ case BASTORE:
+ if (!isSubTypeOf(value1, newValue(Type.getType("[Z")))) {
+ expected1 = newValue(Type.getType("[B"));
+ } else {
+ expected1 = newValue(Type.getType("[Z"));
+ }
+ expected3 = BasicValue.INT_VALUE;
+ break;
+ case CASTORE:
+ expected1 = newValue(Type.getType("[C"));
+ expected3 = BasicValue.INT_VALUE;
+ break;
+ case SASTORE:
+ expected1 = newValue(Type.getType("[S"));
+ expected3 = BasicValue.INT_VALUE;
+ break;
+ case LASTORE:
+ expected1 = newValue(Type.getType("[J"));
+ expected3 = BasicValue.LONG_VALUE;
+ break;
+ case FASTORE:
+ expected1 = newValue(Type.getType("[F"));
+ expected3 = BasicValue.FLOAT_VALUE;
+ break;
+ case DASTORE:
+ expected1 = newValue(Type.getType("[D"));
+ expected3 = BasicValue.DOUBLE_VALUE;
+ break;
+ case AASTORE:
+ expected1 = value1;
+ expected3 = BasicValue.REFERENCE_VALUE;
+ break;
+ default:
+ throw new RuntimeException("Internal error.");
+ }
+ if (!isSubTypeOf(value1, expected1)) {
+ throw new AnalyzerException("First argument", "a " + expected1
+ + " array reference", value1);
+ } else if (value2 != BasicValue.INT_VALUE) {
+ throw new AnalyzerException("Second argument",
+ BasicValue.INT_VALUE,
+ value2);
+ } else if (!isSubTypeOf(value3, expected3)) {
+ throw new AnalyzerException("Third argument", expected3, value3);
+ }
+ return null;
+ }
+
+ public Value naryOperation(final AbstractInsnNode insn, final List values)
+ throws AnalyzerException
+ {
+ int opcode = insn.getOpcode();
+ if (opcode == MULTIANEWARRAY) {
+ for (int i = 0; i < values.size(); ++i) {
+ if (values.get(i) != BasicValue.INT_VALUE) {
+ throw new AnalyzerException(null,
+ BasicValue.INT_VALUE,
+ (Value) values.get(i));
+ }
+ }
+ } else {
+ int i = 0;
+ int j = 0;
+ if (opcode != INVOKESTATIC) {
+ String own = ((MethodInsnNode) insn).owner;
+ if (own.charAt(0) != '[') { // can happen with JDK1.5 clone()
+ own = "L" + own + ";";
+ }
+ Type owner = Type.getType(own);
+ if (!isSubTypeOf((Value) values.get(i++), newValue(owner))) {
+ throw new AnalyzerException("Method owner",
+ newValue(owner),
+ (Value) values.get(0));
+ }
+ }
+ Type[] args = Type.getArgumentTypes(((MethodInsnNode) insn).desc);
+ while (i < values.size()) {
+ Value expected = newValue(args[j++]);
+ Value encountered = (Value) values.get(i++);
+ if (!isSubTypeOf(encountered, expected)) {
+ throw new AnalyzerException("Argument " + j,
+ expected,
+ encountered);
+ }
+ }
+ }
+ return super.naryOperation(insn, values);
+ }
+
+ protected boolean isArrayValue(final Value value) {
+ return ((BasicValue) value).isReference();
+ }
+
+ protected Value getElementValue(final Value objectArrayValue)
+ throws AnalyzerException
+ {
+ return BasicValue.REFERENCE_VALUE;
+ }
+
+ protected boolean isSubTypeOf(final Value value, final Value expected) {
+ return value == expected;
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/DataflowInterpreter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/DataflowInterpreter.java
new file mode 100644
index 00000000000..07edd74f920
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/DataflowInterpreter.java
@@ -0,0 +1,174 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree.analysis;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.tree.AbstractInsnNode;
+import org.objectweb.asm.tree.FieldInsnNode;
+import org.objectweb.asm.tree.LdcInsnNode;
+import org.objectweb.asm.tree.MethodInsnNode;
+
+/**
+ * An {@link Interpreter} for {@link DataflowValue} values.
+ *
+ * @author Eric Bruneton
+ */
+public class DataflowInterpreter implements Opcodes, Interpreter {
+
+ public Value newValue(final Type type) {
+ return new DataflowValue(type == null ? 1 : type.getSize());
+ }
+
+ public Value newOperation(final AbstractInsnNode insn) {
+ int size;
+ switch (insn.getOpcode()) {
+ case LCONST_0:
+ case LCONST_1:
+ case DCONST_0:
+ case DCONST_1:
+ size = 2;
+ break;
+ case LDC:
+ Object cst = ((LdcInsnNode) insn).cst;
+ size = cst instanceof Long || cst instanceof Double ? 2 : 1;
+ break;
+ case GETSTATIC:
+ size = Type.getType(((FieldInsnNode) insn).desc).getSize();
+ break;
+ default:
+ size = 1;
+ }
+ return new DataflowValue(size, insn);
+ }
+
+ public Value copyOperation(final AbstractInsnNode insn, final Value value) {
+ return new DataflowValue(value.getSize(), insn);
+ }
+
+ public Value unaryOperation(final AbstractInsnNode insn, final Value value)
+ {
+ int size;
+ switch (insn.getOpcode()) {
+ case LNEG:
+ case DNEG:
+ case I2L:
+ case I2D:
+ case L2D:
+ case F2L:
+ case F2D:
+ case D2L:
+ size = 2;
+ break;
+ case GETFIELD:
+ size = Type.getType(((FieldInsnNode) insn).desc).getSize();
+ break;
+ default:
+ size = 1;
+ }
+ return new DataflowValue(size, insn);
+ }
+
+ public Value binaryOperation(
+ final AbstractInsnNode insn,
+ final Value value1,
+ final Value value2)
+ {
+ int size;
+ switch (insn.getOpcode()) {
+ case LALOAD:
+ case DALOAD:
+ case LADD:
+ case DADD:
+ case LSUB:
+ case DSUB:
+ case LMUL:
+ case DMUL:
+ case LDIV:
+ case DDIV:
+ case LREM:
+ case DREM:
+ case LSHL:
+ case LSHR:
+ case LUSHR:
+ case LAND:
+ case LOR:
+ case LXOR:
+ size = 2;
+ break;
+ default:
+ size = 1;
+ }
+ return new DataflowValue(size, insn);
+ }
+
+ public Value ternaryOperation(
+ final AbstractInsnNode insn,
+ final Value value1,
+ final Value value2,
+ final Value value3)
+ {
+ return new DataflowValue(1, insn);
+ }
+
+ public Value naryOperation(final AbstractInsnNode insn, final List values) {
+ int size;
+ if (insn.getOpcode() == MULTIANEWARRAY) {
+ size = 1;
+ } else {
+ size = Type.getReturnType(((MethodInsnNode) insn).desc).getSize();
+ }
+ return new DataflowValue(size, insn);
+ }
+
+ public Value merge(final Value v, final Value w) {
+ DataflowValue dv = (DataflowValue) v;
+ DataflowValue dw = (DataflowValue) w;
+ if (dv.insns instanceof SmallSet && dw.insns instanceof SmallSet) {
+ Set s = ((SmallSet) dv.insns).union((SmallSet) dw.insns);
+ if (s == dv.insns && dv.size == dw.size) {
+ return v;
+ } else {
+ return new DataflowValue(Math.min(dv.size, dw.size), s);
+ }
+ }
+ if (dv.size != dw.size || !dv.insns.containsAll(dw.insns)) {
+ Set s = new HashSet();
+ s.addAll(dv.insns);
+ s.addAll(dw.insns);
+ return new DataflowValue(Math.min(dv.size, dw.size), s);
+ }
+ return v;
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/DataflowValue.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/DataflowValue.java
new file mode 100644
index 00000000000..0019d7f2c5d
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/DataflowValue.java
@@ -0,0 +1,92 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree.analysis;
+
+import java.util.Set;
+
+import org.objectweb.asm.tree.AbstractInsnNode;
+
+/**
+ * A {@link Value} that is represented by its type in a two types type system.
+ * This type system distinguishes the ONEWORD and TWOWORDS types.
+ *
+ * @author Eric Bruneton
+ */
+public class DataflowValue implements Value {
+
+ /**
+ * The size of this value.
+ */
+ public final int size;
+
+ /**
+ * The instructions that can produce this value. For example, for the Java
+ * code below, the instructions that can produce the value of <tt>i</tt>
+ * at line 5 are the txo ISTORE instructions at line 1 and 3:
+ *
+ * <pre>
+ * 1: i = 0;
+ * 2: if (...) {
+ * 3: i = 1;
+ * 4: }
+ * 5: return i;
+ * </pre>
+ *
+ * This field is a set of {@link AbstractInsnNode} objects.
+ */
+ public final Set insns;
+
+ public DataflowValue(final int size) {
+ this(size, SmallSet.EMPTY_SET);
+ }
+
+ public DataflowValue(final int size, final AbstractInsnNode insn) {
+ this.size = size;
+ this.insns = new SmallSet(insn, null);
+ }
+
+ public DataflowValue(final int size, final Set insns) {
+ this.size = size;
+ this.insns = insns;
+ }
+
+ public int getSize() {
+ return size;
+ }
+
+ public boolean equals(final Object value) {
+ DataflowValue v = (DataflowValue) value;
+ return size == v.size && insns.equals(v.insns);
+ }
+
+ public int hashCode() {
+ return insns.hashCode();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Frame.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Frame.java
new file mode 100644
index 00000000000..bc2d873e94d
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Frame.java
@@ -0,0 +1,670 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree.analysis;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.tree.AbstractInsnNode;
+import org.objectweb.asm.tree.IincInsnNode;
+import org.objectweb.asm.tree.MethodInsnNode;
+import org.objectweb.asm.tree.MultiANewArrayInsnNode;
+import org.objectweb.asm.tree.VarInsnNode;
+
+/**
+ * A symbolic execution stack frame. A stack frame contains a set of local
+ * variable slots, and an operand stack. Warning: long and double values are
+ * represented by <i>two</i> slots in local variables, and by <i>one</i> slot
+ * in the operand stack.
+ *
+ * @author Eric Bruneton
+ */
+public class Frame {
+
+ /**
+ * The local variables and operand stack of this frame.
+ */
+ private Value[] values;
+
+ /**
+ * The number of local variables of this frame.
+ */
+ private int locals;
+
+ /**
+ * The number of elements in the operand stack.
+ */
+ private int top;
+
+ /**
+ * Constructs a new frame with the given size.
+ *
+ * @param nLocals the maximum number of local variables of the frame.
+ * @param nStack the maximum stack size of the frame.
+ */
+ public Frame(final int nLocals, final int nStack) {
+ this.values = new Value[nLocals + nStack];
+ this.locals = nLocals;
+ }
+
+ /**
+ * Constructs a new frame that is identical to the given frame.
+ *
+ * @param src a frame.
+ */
+ public Frame(final Frame src) {
+ this(src.locals, src.values.length - src.locals);
+ init(src);
+ }
+
+ /**
+ * Copies the state of the given frame into this frame.
+ *
+ * @param src a frame.
+ * @return this frame.
+ */
+ public Frame init(final Frame src) {
+ System.arraycopy(src.values, 0, values, 0, values.length);
+ top = src.top;
+ return this;
+ }
+
+ /**
+ * Returns the maximum number of local variables of this frame.
+ *
+ * @return the maximum number of local variables of this frame.
+ */
+ public int getLocals() {
+ return locals;
+ }
+
+ /**
+ * Returns the value of the given local variable.
+ *
+ * @param i a local variable index.
+ * @return the value of the given local variable.
+ * @throws IndexOutOfBoundsException if the variable does not exist.
+ */
+ public Value getLocal(final int i) throws IndexOutOfBoundsException {
+ if (i >= locals) {
+ throw new IndexOutOfBoundsException("Trying to access an inexistant local variable");
+ }
+ return values[i];
+ }
+
+ /**
+ * Sets the value of the given local variable.
+ *
+ * @param i a local variable index.
+ * @param value the new value of this local variable.
+ * @throws IndexOutOfBoundsException if the variable does not exist.
+ */
+ public void setLocal(final int i, final Value value)
+ throws IndexOutOfBoundsException
+ {
+ if (i >= locals) {
+ throw new IndexOutOfBoundsException("Trying to access an inexistant local variable");
+ }
+ values[i] = value;
+ }
+
+ /**
+ * Returns the number of values in the operand stack of this frame. Long and
+ * double values are treated as single values.
+ *
+ * @return the number of values in the operand stack of this frame.
+ */
+ public int getStackSize() {
+ return top;
+ }
+
+ /**
+ * Returns the value of the given operand stack slot.
+ *
+ * @param i the index of an operand stack slot.
+ * @return the value of the given operand stack slot.
+ * @throws IndexOutOfBoundsException if the operand stack slot does not
+ * exist.
+ */
+ public Value getStack(final int i) throws IndexOutOfBoundsException {
+ if (i >= top) {
+ throw new IndexOutOfBoundsException("Trying to access an inexistant stack element");
+ }
+ return values[i + locals];
+ }
+
+ /**
+ * Clears the operand stack of this frame.
+ */
+ public void clearStack() {
+ top = 0;
+ }
+
+ /**
+ * Pops a value from the operand stack of this frame.
+ *
+ * @return the value that has been popped from the stack.
+ * @throws IndexOutOfBoundsException if the operand stack is empty.
+ */
+ public Value pop() throws IndexOutOfBoundsException {
+ if (top == 0) {
+ throw new IndexOutOfBoundsException("Cannot pop operand off an empty stack.");
+ }
+ return values[--top + locals];
+ }
+
+ /**
+ * Pushes a value into the operand stack of this frame.
+ *
+ * @param value the value that must be pushed into the stack.
+ * @throws IndexOutOfBoundsException if the operand stack is full.
+ */
+ public void push(final Value value) throws IndexOutOfBoundsException {
+ if (top + locals >= values.length) {
+ throw new IndexOutOfBoundsException("Insufficient maximum stack size.");
+ }
+ values[top++ + locals] = value;
+ }
+
+ public void execute(
+ final AbstractInsnNode insn,
+ final Interpreter interpreter) throws AnalyzerException
+ {
+ Value value1, value2, value3, value4;
+ List values;
+ int var;
+
+ switch (insn.getOpcode()) {
+ case Opcodes.NOP:
+ break;
+ case Opcodes.ACONST_NULL:
+ case Opcodes.ICONST_M1:
+ case Opcodes.ICONST_0:
+ case Opcodes.ICONST_1:
+ case Opcodes.ICONST_2:
+ case Opcodes.ICONST_3:
+ case Opcodes.ICONST_4:
+ case Opcodes.ICONST_5:
+ case Opcodes.LCONST_0:
+ case Opcodes.LCONST_1:
+ case Opcodes.FCONST_0:
+ case Opcodes.FCONST_1:
+ case Opcodes.FCONST_2:
+ case Opcodes.DCONST_0:
+ case Opcodes.DCONST_1:
+ case Opcodes.BIPUSH:
+ case Opcodes.SIPUSH:
+ case Opcodes.LDC:
+ push(interpreter.newOperation(insn));
+ break;
+ case Opcodes.ILOAD:
+ case Opcodes.LLOAD:
+ case Opcodes.FLOAD:
+ case Opcodes.DLOAD:
+ case Opcodes.ALOAD:
+ push(interpreter.copyOperation(insn,
+ getLocal(((VarInsnNode) insn).var)));
+ break;
+ case Opcodes.IALOAD:
+ case Opcodes.LALOAD:
+ case Opcodes.FALOAD:
+ case Opcodes.DALOAD:
+ case Opcodes.AALOAD:
+ case Opcodes.BALOAD:
+ case Opcodes.CALOAD:
+ case Opcodes.SALOAD:
+ value2 = pop();
+ value1 = pop();
+ push(interpreter.binaryOperation(insn, value1, value2));
+ break;
+ case Opcodes.ISTORE:
+ case Opcodes.LSTORE:
+ case Opcodes.FSTORE:
+ case Opcodes.DSTORE:
+ case Opcodes.ASTORE:
+ value1 = interpreter.copyOperation(insn, pop());
+ var = ((VarInsnNode) insn).var;
+ setLocal(var, value1);
+ if (value1.getSize() == 2) {
+ setLocal(var + 1, interpreter.newValue(null));
+ }
+ if (var > 0) {
+ Value local = getLocal(var - 1);
+ if (local != null && local.getSize() == 2) {
+ setLocal(var + 1, interpreter.newValue(null));
+ }
+ }
+ break;
+ case Opcodes.IASTORE:
+ case Opcodes.LASTORE:
+ case Opcodes.FASTORE:
+ case Opcodes.DASTORE:
+ case Opcodes.AASTORE:
+ case Opcodes.BASTORE:
+ case Opcodes.CASTORE:
+ case Opcodes.SASTORE:
+ value3 = pop();
+ value2 = pop();
+ value1 = pop();
+ interpreter.ternaryOperation(insn, value1, value2, value3);
+ break;
+ case Opcodes.POP:
+ if (pop().getSize() == 2) {
+ throw new AnalyzerException("Illegal use of POP");
+ }
+ break;
+ case Opcodes.POP2:
+ if (pop().getSize() == 1) {
+ if (pop().getSize() != 1) {
+ throw new AnalyzerException("Illegal use of POP2");
+ }
+ }
+ break;
+ case Opcodes.DUP:
+ value1 = pop();
+ if (value1.getSize() != 1) {
+ throw new AnalyzerException("Illegal use of DUP");
+ }
+ push(interpreter.copyOperation(insn, value1));
+ push(interpreter.copyOperation(insn, value1));
+ break;
+ case Opcodes.DUP_X1:
+ value1 = pop();
+ value2 = pop();
+ if (value1.getSize() != 1 || value2.getSize() != 1) {
+ throw new AnalyzerException("Illegal use of DUP_X1");
+ }
+ push(interpreter.copyOperation(insn, value1));
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ break;
+ case Opcodes.DUP_X2:
+ value1 = pop();
+ if (value1.getSize() == 1) {
+ value2 = pop();
+ if (value2.getSize() == 1) {
+ value3 = pop();
+ if (value3.getSize() == 1) {
+ push(interpreter.copyOperation(insn, value1));
+ push(interpreter.copyOperation(insn, value3));
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ break;
+ }
+ } else {
+ push(interpreter.copyOperation(insn, value1));
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ break;
+ }
+ }
+ throw new AnalyzerException("Illegal use of DUP_X2");
+ case Opcodes.DUP2:
+ value1 = pop();
+ if (value1.getSize() == 1) {
+ value2 = pop();
+ if (value2.getSize() == 1) {
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ break;
+ }
+ } else {
+ push(interpreter.copyOperation(insn, value1));
+ push(interpreter.copyOperation(insn, value1));
+ break;
+ }
+ throw new AnalyzerException("Illegal use of DUP2");
+ case Opcodes.DUP2_X1:
+ value1 = pop();
+ if (value1.getSize() == 1) {
+ value2 = pop();
+ if (value2.getSize() == 1) {
+ value3 = pop();
+ if (value3.getSize() == 1) {
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ push(interpreter.copyOperation(insn, value3));
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ break;
+ }
+ }
+ } else {
+ value2 = pop();
+ if (value2.getSize() == 1) {
+ push(interpreter.copyOperation(insn, value1));
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ break;
+ }
+ }
+ throw new AnalyzerException("Illegal use of DUP2_X1");
+ case Opcodes.DUP2_X2:
+ value1 = pop();
+ if (value1.getSize() == 1) {
+ value2 = pop();
+ if (value2.getSize() == 1) {
+ value3 = pop();
+ if (value3.getSize() == 1) {
+ value4 = pop();
+ if (value4.getSize() == 1) {
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ push(interpreter.copyOperation(insn, value4));
+ push(interpreter.copyOperation(insn, value3));
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ break;
+ }
+ } else {
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ push(interpreter.copyOperation(insn, value3));
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ break;
+ }
+ }
+ } else {
+ value2 = pop();
+ if (value2.getSize() == 1) {
+ value3 = pop();
+ if (value3.getSize() == 1) {
+ push(interpreter.copyOperation(insn, value1));
+ push(interpreter.copyOperation(insn, value3));
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ break;
+ }
+ } else {
+ push(interpreter.copyOperation(insn, value1));
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ break;
+ }
+ }
+ throw new AnalyzerException("Illegal use of DUP2_X2");
+ case Opcodes.SWAP:
+ value2 = pop();
+ value1 = pop();
+ if (value1.getSize() != 1 || value2.getSize() != 1) {
+ throw new AnalyzerException("Illegal use of SWAP");
+ }
+ push(interpreter.copyOperation(insn, value2));
+ push(interpreter.copyOperation(insn, value1));
+ break;
+ case Opcodes.IADD:
+ case Opcodes.LADD:
+ case Opcodes.FADD:
+ case Opcodes.DADD:
+ case Opcodes.ISUB:
+ case Opcodes.LSUB:
+ case Opcodes.FSUB:
+ case Opcodes.DSUB:
+ case Opcodes.IMUL:
+ case Opcodes.LMUL:
+ case Opcodes.FMUL:
+ case Opcodes.DMUL:
+ case Opcodes.IDIV:
+ case Opcodes.LDIV:
+ case Opcodes.FDIV:
+ case Opcodes.DDIV:
+ case Opcodes.IREM:
+ case Opcodes.LREM:
+ case Opcodes.FREM:
+ case Opcodes.DREM:
+ value2 = pop();
+ value1 = pop();
+ push(interpreter.binaryOperation(insn, value1, value2));
+ break;
+ case Opcodes.INEG:
+ case Opcodes.LNEG:
+ case Opcodes.FNEG:
+ case Opcodes.DNEG:
+ push(interpreter.unaryOperation(insn, pop()));
+ break;
+ case Opcodes.ISHL:
+ case Opcodes.LSHL:
+ case Opcodes.ISHR:
+ case Opcodes.LSHR:
+ case Opcodes.IUSHR:
+ case Opcodes.LUSHR:
+ case Opcodes.IAND:
+ case Opcodes.LAND:
+ case Opcodes.IOR:
+ case Opcodes.LOR:
+ case Opcodes.IXOR:
+ case Opcodes.LXOR:
+ value2 = pop();
+ value1 = pop();
+ push(interpreter.binaryOperation(insn, value1, value2));
+ break;
+ case Opcodes.IINC:
+ var = ((IincInsnNode) insn).var;
+ setLocal(var, interpreter.unaryOperation(insn, getLocal(var)));
+ break;
+ case Opcodes.I2L:
+ case Opcodes.I2F:
+ case Opcodes.I2D:
+ case Opcodes.L2I:
+ case Opcodes.L2F:
+ case Opcodes.L2D:
+ case Opcodes.F2I:
+ case Opcodes.F2L:
+ case Opcodes.F2D:
+ case Opcodes.D2I:
+ case Opcodes.D2L:
+ case Opcodes.D2F:
+ case Opcodes.I2B:
+ case Opcodes.I2C:
+ case Opcodes.I2S:
+ push(interpreter.unaryOperation(insn, pop()));
+ break;
+ case Opcodes.LCMP:
+ case Opcodes.FCMPL:
+ case Opcodes.FCMPG:
+ case Opcodes.DCMPL:
+ case Opcodes.DCMPG:
+ value2 = pop();
+ value1 = pop();
+ push(interpreter.binaryOperation(insn, value1, value2));
+ break;
+ case Opcodes.IFEQ:
+ case Opcodes.IFNE:
+ case Opcodes.IFLT:
+ case Opcodes.IFGE:
+ case Opcodes.IFGT:
+ case Opcodes.IFLE:
+ interpreter.unaryOperation(insn, pop());
+ break;
+ case Opcodes.IF_ICMPEQ:
+ case Opcodes.IF_ICMPNE:
+ case Opcodes.IF_ICMPLT:
+ case Opcodes.IF_ICMPGE:
+ case Opcodes.IF_ICMPGT:
+ case Opcodes.IF_ICMPLE:
+ case Opcodes.IF_ACMPEQ:
+ case Opcodes.IF_ACMPNE:
+ value2 = pop();
+ value1 = pop();
+ interpreter.binaryOperation(insn, value1, value2);
+ break;
+ case Opcodes.GOTO:
+ break;
+ case Opcodes.JSR:
+ push(interpreter.newOperation(insn));
+ break;
+ case Opcodes.RET:
+ break;
+ case Opcodes.TABLESWITCH:
+ case Opcodes.LOOKUPSWITCH:
+ case Opcodes.IRETURN:
+ case Opcodes.LRETURN:
+ case Opcodes.FRETURN:
+ case Opcodes.DRETURN:
+ case Opcodes.ARETURN:
+ interpreter.unaryOperation(insn, pop());
+ break;
+ case Opcodes.RETURN:
+ break;
+ case Opcodes.GETSTATIC:
+ push(interpreter.newOperation(insn));
+ break;
+ case Opcodes.PUTSTATIC:
+ interpreter.unaryOperation(insn, pop());
+ break;
+ case Opcodes.GETFIELD:
+ push(interpreter.unaryOperation(insn, pop()));
+ break;
+ case Opcodes.PUTFIELD:
+ value2 = pop();
+ value1 = pop();
+ interpreter.binaryOperation(insn, value1, value2);
+ break;
+ case Opcodes.INVOKEVIRTUAL:
+ case Opcodes.INVOKESPECIAL:
+ case Opcodes.INVOKESTATIC:
+ case Opcodes.INVOKEINTERFACE:
+ values = new ArrayList();
+ String desc = ((MethodInsnNode) insn).desc;
+ for (int i = Type.getArgumentTypes(desc).length; i > 0; --i) {
+ values.add(0, pop());
+ }
+ if (insn.getOpcode() != Opcodes.INVOKESTATIC) {
+ values.add(0, pop());
+ }
+ if (Type.getReturnType(desc) == Type.VOID_TYPE) {
+ interpreter.naryOperation(insn, values);
+ } else {
+ push(interpreter.naryOperation(insn, values));
+ }
+ break;
+ case Opcodes.NEW:
+ push(interpreter.newOperation(insn));
+ break;
+ case Opcodes.NEWARRAY:
+ case Opcodes.ANEWARRAY:
+ case Opcodes.ARRAYLENGTH:
+ push(interpreter.unaryOperation(insn, pop()));
+ break;
+ case Opcodes.ATHROW:
+ interpreter.unaryOperation(insn, pop());
+ break;
+ case Opcodes.CHECKCAST:
+ case Opcodes.INSTANCEOF:
+ push(interpreter.unaryOperation(insn, pop()));
+ break;
+ case Opcodes.MONITORENTER:
+ case Opcodes.MONITOREXIT:
+ interpreter.unaryOperation(insn, pop());
+ break;
+ case Opcodes.MULTIANEWARRAY:
+ values = new ArrayList();
+ for (int i = ((MultiANewArrayInsnNode) insn).dims; i > 0; --i) {
+ values.add(0, pop());
+ }
+ push(interpreter.naryOperation(insn, values));
+ break;
+ case Opcodes.IFNULL:
+ case Opcodes.IFNONNULL:
+ interpreter.unaryOperation(insn, pop());
+ break;
+ default:
+ throw new RuntimeException("Illegal opcode");
+ }
+ }
+
+ /**
+ * Merges this frame with the given frame.
+ *
+ * @param frame a frame.
+ * @param interpreter the interpreter used to merge values.
+ * @return <tt>true</tt> if this frame has been changed as a result of the
+ * merge operation, or <tt>false</tt> otherwise.
+ * @throws AnalyzerException if the frames have incompatible sizes.
+ */
+ public boolean merge(final Frame frame, final Interpreter interpreter)
+ throws AnalyzerException
+ {
+ if (top != frame.top) {
+ throw new AnalyzerException("Incompatible stack heights");
+ }
+ boolean changes = false;
+ for (int i = 0; i < locals + top; ++i) {
+ Value v = interpreter.merge(values[i], frame.values[i]);
+ if (v != values[i]) {
+ values[i] = v;
+ changes |= true;
+ }
+ }
+ return changes;
+ }
+
+ /**
+ * Merges this frame with the given frame (case of a RET instruction).
+ *
+ * @param frame a frame
+ * @param access the local variables that have been accessed by the
+ * subroutine to which the RET instruction corresponds.
+ * @return <tt>true</tt> if this frame has been changed as a result of the
+ * merge operation, or <tt>false</tt> otherwise.
+ */
+ public boolean merge(final Frame frame, final boolean[] access) {
+ boolean changes = false;
+ for (int i = 0; i < locals; ++i) {
+ if (!access[i] && !values[i].equals(frame.values[i])) {
+ values[i] = frame.values[i];
+ changes = true;
+ }
+ }
+ return changes;
+ }
+
+ /**
+ * Returns a string representation of this frame.
+ *
+ * @return a string representation of this frame.
+ */
+ public String toString() {
+ StringBuffer b = new StringBuffer();
+ for (int i = 0; i < locals; ++i) {
+ b.append(values[i]).append(' ');
+ }
+ b.append(' ');
+ for (int i = 0; i < top; ++i) {
+ b.append(values[i + locals].toString()).append(' ');
+ }
+ return b.toString();
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/IntMap.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/IntMap.java
new file mode 100644
index 00000000000..9528482e727
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/IntMap.java
@@ -0,0 +1,73 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree.analysis;
+
+/**
+ * A fixed size map of integer values.
+ *
+ * @author Eric Bruneton
+ */
+class IntMap {
+
+ private int size;
+
+ private Object[] keys;
+
+ private int[] values;
+
+ public IntMap(final int size) {
+ this.size = size;
+ this.keys = new Object[size];
+ this.values = new int[size];
+ }
+
+ public int get(final Object key) {
+ int n = size;
+ int h = (key.hashCode() & 0x7FFFFFFF) % n;
+ int i = h;
+ while (keys[i] != key) {
+ i = (i + 1) % n;
+ if (i == h) {
+ throw new RuntimeException("Cannot find index of " + key);
+ }
+ }
+ return values[i];
+ }
+
+ public void put(final Object key, final int value) {
+ int n = size;
+ int i = (key.hashCode() & 0x7FFFFFFF) % n;
+ while (keys[i] != null) {
+ i = (i + 1) % n;
+ }
+ keys[i] = key;
+ values[i] = value;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Interpreter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Interpreter.java
new file mode 100644
index 00000000000..f7a2f5301c3
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Interpreter.java
@@ -0,0 +1,178 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree.analysis;
+
+import java.util.List;
+
+import org.objectweb.asm.Type;
+import org.objectweb.asm.tree.AbstractInsnNode;
+
+/**
+ * A semantic bytecode interpreter. More precisely, this interpreter only
+ * manages the computation of values from other values: it does not manage the
+ * transfer of values to or from the stack, and to or from the local variables.
+ * This separation allows a generic bytecode {@link Analyzer} to work with
+ * various semantic interpreters, without needing to duplicate the code to
+ * simulate the transfer of values.
+ *
+ * @author Eric Bruneton
+ */
+public interface Interpreter {
+
+ /**
+ * Creates a new value that represents the given type.
+ *
+ * Called for method parameters (including <code>this</code>),
+ * exception handler variable and with <code>null</code> type
+ * for variables reserved by long and double types.
+ *
+ * @param type a primitive or reference type, or <tt>null</tt> to
+ * represent an uninitialized value.
+ * @return a value that represents the given type. The size of the returned
+ * value must be equal to the size of the given type.
+ */
+ Value newValue(Type type);
+
+ /**
+ * Interprets a bytecode instruction without arguments. This method is
+ * called for the following opcodes:
+ *
+ * ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4,
+ * ICONST_5, LCONST_0, LCONST_1, FCONST_0, FCONST_1, FCONST_2, DCONST_0,
+ * DCONST_1, BIPUSH, SIPUSH, LDC, JSR, GETSTATIC, NEW
+ *
+ * @param insn the bytecode instruction to be interpreted.
+ * @return the result of the interpretation of the given instruction.
+ * @throws AnalyzerException if an error occured during the interpretation.
+ */
+ Value newOperation(AbstractInsnNode insn) throws AnalyzerException;
+
+ /**
+ * Interprets a bytecode instruction that moves a value on the stack or to
+ * or from local variables. This method is called for the following opcodes:
+ *
+ * ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE,
+ * ASTORE, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP
+ *
+ * @param insn the bytecode instruction to be interpreted.
+ * @param value the value that must be moved by the instruction.
+ * @return the result of the interpretation of the given instruction. The
+ * returned value must be <tt>equal</tt> to the given value.
+ * @throws AnalyzerException if an error occured during the interpretation.
+ */
+ Value copyOperation(AbstractInsnNode insn, Value value)
+ throws AnalyzerException;
+
+ /**
+ * Interprets a bytecode instruction with a single argument. This method is
+ * called for the following opcodes:
+ *
+ * INEG, LNEG, FNEG, DNEG, IINC, I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L,
+ * F2D, D2I, D2L, D2F, I2B, I2C, I2S, IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE,
+ * TABLESWITCH, LOOKUPSWITCH, IRETURN, LRETURN, FRETURN, DRETURN, ARETURN,
+ * PUTSTATIC, GETFIELD, NEWARRAY, ANEWARRAY, ARRAYLENGTH, ATHROW, CHECKCAST,
+ * INSTANCEOF, MONITORENTER, MONITOREXIT, IFNULL, IFNONNULL
+ *
+ * @param insn the bytecode instruction to be interpreted.
+ * @param value the argument of the instruction to be interpreted.
+ * @return the result of the interpretation of the given instruction.
+ * @throws AnalyzerException if an error occured during the interpretation.
+ */
+ Value unaryOperation(AbstractInsnNode insn, Value value)
+ throws AnalyzerException;
+
+ /**
+ * Interprets a bytecode instruction with two arguments. This method is
+ * called for the following opcodes:
+ *
+ * IALOAD, LALOAD, FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IADD,
+ * LADD, FADD, DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV,
+ * LDIV, FDIV, DDIV, IREM, LREM, FREM, DREM, ISHL, LSHL, ISHR, LSHR, IUSHR,
+ * LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR, LCMP, FCMPL, FCMPG, DCMPL,
+ * DCMPG, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE,
+ * IF_ACMPEQ, IF_ACMPNE, PUTFIELD
+ *
+ * @param insn the bytecode instruction to be interpreted.
+ * @param value1 the first argument of the instruction to be interpreted.
+ * @param value2 the second argument of the instruction to be interpreted.
+ * @return the result of the interpretation of the given instruction.
+ * @throws AnalyzerException if an error occured during the interpretation.
+ */
+ Value binaryOperation(AbstractInsnNode insn, Value value1, Value value2)
+ throws AnalyzerException;
+
+ /**
+ * Interprets a bytecode instruction with three arguments. This method is
+ * called for the following opcodes:
+ *
+ * IASTORE, LASTORE, FASTORE, DASTORE, AASTORE, BASTORE, CASTORE, SASTORE
+ *
+ * @param insn the bytecode instruction to be interpreted.
+ * @param value1 the first argument of the instruction to be interpreted.
+ * @param value2 the second argument of the instruction to be interpreted.
+ * @param value3 the third argument of the instruction to be interpreted.
+ * @return the result of the interpretation of the given instruction.
+ * @throws AnalyzerException if an error occured during the interpretation.
+ */
+ Value ternaryOperation(
+ AbstractInsnNode insn,
+ Value value1,
+ Value value2,
+ Value value3) throws AnalyzerException;
+
+ /**
+ * Interprets a bytecode instruction with a variable number of arguments.
+ * This method is called for the following opcodes:
+ *
+ * INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC, INVOKEINTERFACE,
+ * MULTIANEWARRAY
+ *
+ * @param insn the bytecode instruction to be interpreted.
+ * @param values the arguments of the instruction to be interpreted.
+ * @return the result of the interpretation of the given instruction.
+ * @throws AnalyzerException if an error occured during the interpretation.
+ */
+ Value naryOperation(AbstractInsnNode insn, List values)
+ throws AnalyzerException;
+
+ /**
+ * Merges two values. The merge operation must return a value that
+ * represents both values (for instance, if the two values are two types,
+ * the merged value must be a common super type of the two types. If the two
+ * values are integer intervals, the merged value must be an interval that
+ * contains the previous ones. Likewise for other types of values).
+ *
+ * @param v a value.
+ * @param w another value.
+ * @return the merged value. If the merged value is equal to <tt>v</tt>,
+ * this method <i>must</i> return <tt>v</tt>.
+ */
+ Value merge(Value v, Value w);
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/SimpleVerifier.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/SimpleVerifier.java
new file mode 100644
index 00000000000..808b3f41cba
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/SimpleVerifier.java
@@ -0,0 +1,266 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree.analysis;
+
+import java.util.List;
+
+import org.objectweb.asm.Type;
+
+/**
+ * An extended {@link BasicVerifier} that performs more precise verifications.
+ * This verifier computes exact class types, instead of using a single "object
+ * reference" type (as done in the {@link BasicVerifier}).
+ *
+ * @author Eric Bruneton
+ * @author Bing Ran
+ */
+public class SimpleVerifier extends BasicVerifier {
+
+ /**
+ * The class that is verified.
+ */
+ private final Type currentClass;
+
+ /**
+ * The super class of the class that is verified.
+ */
+ private final Type currentSuperClass;
+
+ /**
+ * The interfaces implemented by the class that is verified.
+ */
+ private final List currentClassInterfaces;
+
+ /**
+ * If the class that is verified is an interface.
+ */
+ private final boolean isInterface;
+
+ /**
+ * Constructs a new {@link SimpleVerifier}.
+ */
+ public SimpleVerifier() {
+ this(null, null, false);
+ }
+
+ /**
+ * Constructs a new {@link SimpleVerifier} to verify a specific class. This
+ * class will not be loaded into the JVM since it may be incorrect.
+ *
+ * @param currentClass the class that is verified.
+ * @param currentSuperClass the super class of the class that is verified.
+ * @param isInterface if the class that is verified is an interface.
+ */
+ public SimpleVerifier(
+ final Type currentClass,
+ final Type currentSuperClass,
+ final boolean isInterface)
+ {
+ this(currentClass, currentSuperClass, null, isInterface);
+ }
+
+ /**
+ * Constructs a new {@link SimpleVerifier} to verify a specific class. This
+ * class will not be loaded into the JVM since it may be incorrect.
+ *
+ * @param currentClass the class that is verified.
+ * @param currentSuperClass the super class of the class that is verified.
+ * @param currentClassInterfaces the interfaces implemented by the class
+ * that is verified.
+ * @param isInterface if the class that is verified is an interface.
+ */
+ public SimpleVerifier(
+ final Type currentClass,
+ final Type currentSuperClass,
+ final List currentClassInterfaces,
+ final boolean isInterface)
+ {
+ this.currentClass = currentClass;
+ this.currentSuperClass = currentSuperClass;
+ this.currentClassInterfaces = currentClassInterfaces;
+ this.isInterface = isInterface;
+ }
+
+ public Value newValue(final Type type) {
+ Value v = super.newValue(type);
+ if (v == BasicValue.REFERENCE_VALUE) {
+ v = new BasicValue(type);
+ }
+ return v;
+ }
+
+ protected boolean isArrayValue(final Value value) {
+ Type t = ((BasicValue) value).getType();
+ if (t != null) {
+ return t.getDescriptor().equals("Lnull;")
+ || t.getSort() == Type.ARRAY;
+ }
+ return false;
+ }
+
+ protected Value getElementValue(final Value objectArrayValue)
+ throws AnalyzerException
+ {
+ Type arrayType = ((BasicValue) objectArrayValue).getType();
+ if (arrayType != null) {
+ if (arrayType.getSort() == Type.ARRAY) {
+ return newValue(Type.getType(arrayType.getDescriptor()
+ .substring(1)));
+ } else if (arrayType.getDescriptor().equals("Lnull;")) {
+ return objectArrayValue;
+ }
+ }
+ throw new AnalyzerException("Not an array type");
+ }
+
+ protected boolean isSubTypeOf(final Value value, final Value expected) {
+ Type expectedType = ((BasicValue) expected).getType();
+ Type type = ((BasicValue) value).getType();
+ if (expectedType == null) {
+ return type == null;
+ }
+ switch (expectedType.getSort()) {
+ case Type.INT:
+ case Type.FLOAT:
+ case Type.LONG:
+ case Type.DOUBLE:
+ return type == expectedType;
+ case Type.ARRAY:
+ case Type.OBJECT:
+ if (expectedType.getDescriptor().equals("Lnull;")) {
+ return type.getSort() == Type.OBJECT
+ || type.getSort() == Type.ARRAY;
+ }
+ if (type.getDescriptor().equals("Lnull;")) {
+ return true;
+ } else if (type.getSort() == Type.OBJECT
+ || type.getSort() == Type.ARRAY)
+ {
+ return isAssignableFrom(expectedType, type);
+ } else {
+ return false;
+ }
+ default:
+ throw new RuntimeException("Internal error");
+ }
+ }
+
+ public Value merge(final Value v, final Value w) {
+ if (!v.equals(w)) {
+ Type t = ((BasicValue) v).getType();
+ Type u = ((BasicValue) w).getType();
+ if (t != null
+ && (t.getSort() == Type.OBJECT || t.getSort() == Type.ARRAY))
+ {
+ if (u != null
+ && (u.getSort() == Type.OBJECT || u.getSort() == Type.ARRAY))
+ {
+ if (t.getDescriptor().equals("Lnull;")) {
+ return w;
+ }
+ if (u.getDescriptor().equals("Lnull;")) {
+ return v;
+ }
+ if (isAssignableFrom(t, u)) {
+ return v;
+ }
+ if (isAssignableFrom(u, t)) {
+ return w;
+ }
+ // TODO case of array classes of the same dimension
+ // TODO should we look also for a common super interface?
+ // problem: there may be several possible common super
+ // interfaces
+ do {
+ if (t == null || isInterface(t)) {
+ return BasicValue.REFERENCE_VALUE;
+ }
+ t = getSuperClass(t);
+ if (isAssignableFrom(t, u)) {
+ return newValue(t);
+ }
+ } while (true);
+ }
+ }
+ return BasicValue.UNINITIALIZED_VALUE;
+ }
+ return v;
+ }
+
+ private boolean isInterface(final Type t) {
+ if (currentClass != null && t.equals(currentClass)) {
+ return isInterface;
+ }
+ return getClass(t).isInterface();
+ }
+
+ private Type getSuperClass(final Type t) {
+ if (currentClass != null && t.equals(currentClass)) {
+ return currentSuperClass;
+ }
+ Class c = getClass(t).getSuperclass();
+ return c == null ? null : Type.getType(c);
+ }
+
+ private boolean isAssignableFrom(final Type t, final Type u) {
+ if (t.equals(u)) {
+ return true;
+ }
+ if (currentClass != null && t.equals(currentClass)) {
+ return isAssignableFrom(t, getSuperClass(u));
+ }
+ if (currentClass != null && u.equals(currentClass)) {
+ if (isAssignableFrom(t, currentSuperClass)) {
+ return true;
+ }
+ if (currentClassInterfaces != null) {
+ for (int i = 0; i < currentClassInterfaces.size(); ++i) {
+ Type v = (Type) currentClassInterfaces.get(i);
+ if (isAssignableFrom(t, v)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ return getClass(t).isAssignableFrom(getClass(u));
+ }
+
+ protected Class getClass(final Type t) {
+ try {
+ if (t.getSort() == Type.ARRAY) {
+ return Class.forName(t.getDescriptor().replace('/', '.'));
+ }
+ return Class.forName(t.getClassName());
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e.toString());
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/SmallSet.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/SmallSet.java
new file mode 100644
index 00000000000..74bd590ef1c
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/SmallSet.java
@@ -0,0 +1,126 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree.analysis;
+
+import java.util.AbstractSet;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * A set of at most two elements.
+ *
+ * @author Eric Bruneton
+ */
+class SmallSet extends AbstractSet implements Iterator {
+
+ // if e1 is null, e2 must be null; otherwise e2 must be different from e1
+
+ Object e1, e2;
+
+ final static SmallSet EMPTY_SET = new SmallSet(null, null);
+
+ SmallSet(Object e1, Object e2) {
+ this.e1 = e1;
+ this.e2 = e2;
+ }
+
+ // -------------------------------------------------------------------------
+ // Implementation of inherited abstract methods
+ // -------------------------------------------------------------------------
+
+ public Iterator iterator() {
+ return new SmallSet(e1, e2);
+ }
+
+ public int size() {
+ return e1 == null ? 0 : (e2 == null ? 1 : 2);
+ }
+
+ // -------------------------------------------------------------------------
+ // Implementation of the Iterator interface
+ // -------------------------------------------------------------------------
+
+ public boolean hasNext() {
+ return e1 != null;
+ }
+
+ public Object next() {
+ Object e = e1;
+ e1 = e2;
+ e2 = null;
+ return e;
+ }
+
+ public void remove() {
+ }
+
+ // -------------------------------------------------------------------------
+ // Utility methods
+ // -------------------------------------------------------------------------
+
+ Set union(SmallSet s) {
+ if ((s.e1 == e1 && s.e2 == e2) || (s.e1 == e2 && s.e2 == e1)) {
+ return this; // if the two sets are equal, return this
+ }
+ if (s.e1 == null) {
+ return this; // if s is empty, return this
+ }
+ if (e1 == null) {
+ return s; // if this is empty, return s
+ }
+ if (s.e2 == null) { // s contains exactly one element
+ if (e2 == null) {
+ return new SmallSet(e1, s.e1); // necessarily e1 != s.e1
+ } else if (s.e1 == e1 || s.e1 == e2) { // s is included in this
+ return this;
+ }
+ }
+ if (e2 == null) { // this contains exactly one element
+ // if (s.e2 == null) { // cannot happen
+ // return new SmallSet(e1, s.e1); // necessarily e1 != s.e1
+ // } else
+ if (e1 == s.e1 || e1 == s.e2) { // this in included in s
+ return s;
+ }
+ }
+ // here we know that there are at least 3 distinct elements
+ HashSet r = new HashSet(4);
+ r.add(e1);
+ if (e2 != null) {
+ r.add(e2);
+ }
+ r.add(s.e1);
+ if (s.e2 != null) {
+ r.add(s.e2);
+ }
+ return r;
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Subroutine.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Subroutine.java
new file mode 100644
index 00000000000..44120a7217b
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Subroutine.java
@@ -0,0 +1,96 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree.analysis;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.objectweb.asm.Label;
+import org.objectweb.asm.tree.JumpInsnNode;
+
+/**
+ * A method subroutine (corresponds to a JSR instruction).
+ *
+ * @author Eric Bruneton
+ */
+class Subroutine {
+
+ Label start;
+
+ boolean[] access;
+
+ List callers;
+
+ private Subroutine() {
+ }
+
+ public Subroutine(
+ final Label start,
+ final int maxLocals,
+ final JumpInsnNode caller)
+ {
+ this.start = start;
+ this.access = new boolean[maxLocals];
+ this.callers = new ArrayList();
+ callers.add(caller);
+ }
+
+ public Subroutine copy() {
+ Subroutine result = new Subroutine();
+ result.start = start;
+ result.access = new boolean[access.length];
+ System.arraycopy(access, 0, result.access, 0, access.length);
+ result.callers = new ArrayList(callers);
+ return result;
+ }
+
+ public boolean merge(final Subroutine subroutine, boolean checkOverlap)
+ throws AnalyzerException
+ {
+ if (checkOverlap && subroutine.start != start) {
+ throw new AnalyzerException("Overlapping sub routines");
+ }
+ boolean changes = false;
+ for (int i = 0; i < access.length; ++i) {
+ if (subroutine.access[i] && !access[i]) {
+ access[i] = true;
+ changes = true;
+ }
+ }
+ for (int i = 0; i < subroutine.callers.size(); ++i) {
+ Object caller = subroutine.callers.get(i);
+ if (!callers.contains(caller)) {
+ callers.add(caller);
+ changes = true;
+ }
+ }
+ return changes;
+ }
+} \ No newline at end of file
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Value.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Value.java
new file mode 100644
index 00000000000..6578b798665
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/Value.java
@@ -0,0 +1,45 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.tree.analysis;
+
+/**
+ * An immutable symbolic value for semantic interpretation of bytecode.
+ *
+ * @author Eric Bruneton
+ */
+public interface Value {
+
+ /**
+ * Returns the size of this value in words.
+ *
+ * @return either 1 or 2.
+ */
+ int getSize();
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/package.html b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/package.html
new file mode 100644
index 00000000000..7c20f2e754c
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/analysis/package.html
@@ -0,0 +1,36 @@
+<html>
+<!--
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<body>
+Provides a framework for static code analysis based on the asm.tree package.
+
+@since ASM 1.4.3
+</body>
+</html>
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/package.html b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/package.html
new file mode 100644
index 00000000000..d455211518e
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/tree/package.html
@@ -0,0 +1,149 @@
+<html>
+<!--
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<body>
+
+<p>
+Provides an ASM visitor that constructs a tree representation of the
+classes it visits. This class adapter can be useful to implement "complex"
+class manipulation operations, i.e., operations that would be very hard to
+implement without using a tree representation (such as optimizing the number
+of local variables used by a method).
+</p>
+
+<p>
+However, this class adapter has a cost: it makes ASM bigger and slower. Indeed
+it requires more than twenty new classes, and multiplies the time needed to
+transform a class by almost two (it is almost two times faster to read, "modify"
+and write a class with a ClassAdapter than with a ClassNode). This is why
+this package is bundled in an optional <tt>asm-tree.jar</tt> library that
+is separated from (but requires) the <tt>asm.jar</tt> library, which contains
+the core ASM framework. This is also why <i><font color="red">it is recommanded
+not to use this class adapter when it is possible</font></i>.
+</p>
+
+<p>
+The root class is the ClassNode, that can be created from scratch or
+from existing bytecode. For example:
+</p>
+
+<pre>
+ ClassReader cr = new ClassReader(source);
+ ClassNode cn = new ClassNode();
+ cr.accept(cn, true);
+</pre>
+
+<p>
+Now content of ClassNode can be modified and then
+serialized back into bytecode:
+</p>
+
+<pre>
+ ClassWriter cw = new ClassWriter(true);
+ cn.accept(cw);
+</pre>
+
+<p>
+Several strategies can be used to construct method code from scratch. The first
+possibility is to create a MethodNode, and then create and add XXXInsnNode to
+the instructions list:
+</p>
+
+<pre>
+MethodNode m = new MethodNode(...);
+m.instructions.add(new VarInsnNode(ALOAD, 0));
+...
+</pre>
+
+<p>
+Alternatively, you can use the fact that MethodNode is a MethodVisitor, and use
+that to create the XXXInsnNode and add them to the instructions list through
+the standard MethodVisitor interface:
+</p>
+
+<pre>
+MethodNode m = new MethodNode(...);
+m.visitVarInsn(ALOAD, 0);
+...
+</pre>
+
+<p>
+If you cannot generate all the instructions in sequential order, i.e. if you
+need to keep some pointers in the instruction list to insert some instructions
+at these places after other instructions have been generated, you can define
+an InsnListInsnNode pseudo instruction class that will in fact contain an
+instruction list, will possibly implement the MethodVisitor interface, and whose
+accept method will call the accept method of all the instructions of its list.
+</p>
+
+<pre>
+MethodNode m = new MethodNode(...);
+m.visitVarInsn(ALOAD, 0);
+InsnListInsnNode ptr = new InsnListInsnNode();
+m.instructions.add(ptr);
+m.visitVarInsn(ALOAD, 1);
+ptr.visitXXXInsn(...); // inserts an instruction between ALOAD 0 and ALOAD 1
+</pre>
+
+<p>
+If you need to insert instructions while iterating over an existing instruction
+list, you can also use several strategies. The first one is to use a
+ListIterator over the instruction list, and use its add method to insert
+instructions:
+</p>
+
+<pre>
+ListIterator i = m.instructions.listIterator();
+while (i.hasNext()) {
+ AbstractInsnNode n = (AbstractInsnNode) i.next();
+ if (...) {
+ i.add(new VarInsnNode(ALOAD, 0));
+ }
+}
+</pre>
+
+<p>
+If you want to insert these instructions through the MethodVisitor interface,
+you can define your own InsnListIterator class, that will implement both the
+ListIterator and MethodVisitor interface.
+</p>
+
+<p>
+Another strategy is to use ListIterator.add to insert InsnListInsnNode pseudo
+instructions, and then use these inserted pseudo instructions to insert an
+arbitrary number of instructions at these places.
+</p>
+
+<p>
+@since ASM 1.3.3
+</p>
+
+</body>
+</html>
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierAbstractVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierAbstractVisitor.java
new file mode 100644
index 00000000000..4ebc7fc097c
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierAbstractVisitor.java
@@ -0,0 +1,226 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import java.util.HashMap;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.util.attrs.ASMifiable;
+
+/**
+ * An abstract ASMifier visitor.
+ *
+ * @author Eric Bruneton
+ */
+public class ASMifierAbstractVisitor extends AbstractVisitor {
+
+ /**
+ * The name of the variable for this visitor in the produced code.
+ */
+ protected String name;
+
+ /**
+ * The label names. This map associates String values to Label keys. It is
+ * used only in ASMifierMethodVisitor.
+ */
+ HashMap labelNames;
+
+ /**
+ * Constructs a new {@link ASMifierAbstractVisitor}.
+ *
+ * @param name the name of the variable for this visitor in the produced
+ * code.
+ */
+ protected ASMifierAbstractVisitor(final String name) {
+ this.name = name;
+ }
+
+ /**
+ * Prints the ASM code that generates the given annotation.
+ *
+ * @param desc the class descriptor of the annotation class.
+ * @param visible <tt>true</tt> if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values.
+ */
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ buf.setLength(0);
+ buf.append("{\n")
+ .append("av0 = ")
+ .append(name)
+ .append(".visitAnnotation(");
+ appendConstant(desc);
+ buf.append(", ").append(visible).append(");\n");
+ text.add(buf.toString());
+ ASMifierAnnotationVisitor av = new ASMifierAnnotationVisitor(0);
+ text.add(av.getText());
+ text.add("}\n");
+ return av;
+ }
+
+ /**
+ * Prints the ASM code that generates the given attribute.
+ *
+ * @param attr an attribute.
+ */
+ public void visitAttribute(final Attribute attr) {
+ buf.setLength(0);
+ if (attr instanceof ASMifiable) {
+ buf.append("{\n");
+ buf.append("// ATTRIBUTE\n");
+ ((ASMifiable) attr).asmify(buf, "attr", labelNames);
+ buf.append(name).append(".visitAttribute(attr);\n");
+ buf.append("}\n");
+ } else {
+ buf.append("// WARNING! skipped a non standard attribute of type \"");
+ buf.append(attr.type).append("\"\n");
+ }
+ text.add(buf.toString());
+ }
+
+ /**
+ * Prints the ASM code to end the visit.
+ */
+ public void visitEnd() {
+ buf.setLength(0);
+ buf.append(name).append(".visitEnd();\n");
+ text.add(buf.toString());
+ }
+
+ /**
+ * Appends a string representation of the given constant to the given
+ * buffer.
+ *
+ * @param cst an {@link Integer}, {@link Float}, {@link Long},
+ * {@link Double} or {@link String} object. May be <tt>null</tt>.
+ */
+ void appendConstant(final Object cst) {
+ appendConstant(buf, cst);
+ }
+
+ /**
+ * Appends a string representation of the given constant to the given
+ * buffer.
+ *
+ * @param buf a string buffer.
+ * @param cst an {@link Integer}, {@link Float}, {@link Long},
+ * {@link Double} or {@link String} object. May be <tt>null</tt>.
+ */
+ static void appendConstant(final StringBuffer buf, final Object cst) {
+ if (cst == null) {
+ buf.append("null");
+ } else if (cst instanceof String) {
+ appendString(buf, (String) cst);
+ } else if (cst instanceof Type) {
+ buf.append("Type.getType(\"");
+ buf.append(((Type) cst).getDescriptor());
+ buf.append("\")");
+ } else if (cst instanceof Byte) {
+ buf.append("new Byte((byte)").append(cst).append(")");
+ } else if (cst instanceof Boolean) {
+ buf.append("new Boolean(").append(cst).append(")");
+ } else if (cst instanceof Short) {
+ buf.append("new Short((short)").append(cst).append(")");
+ } else if (cst instanceof Character) {
+ int c = ((Character) cst).charValue();
+ buf.append("new Character((char)").append(c).append(")");
+ } else if (cst instanceof Integer) {
+ buf.append("new Integer(").append(cst).append(")");
+ } else if (cst instanceof Float) {
+ buf.append("new Float(\"").append(cst).append("\")");
+ } else if (cst instanceof Long) {
+ buf.append("new Long(").append(cst).append("L)");
+ } else if (cst instanceof Double) {
+ buf.append("new Double(\"").append(cst).append("\")");
+ } else if (cst instanceof byte[]) {
+ byte[] v = (byte[]) cst;
+ buf.append("new byte[] {");
+ for (int i = 0; i < v.length; i++) {
+ buf.append(i == 0 ? "" : ",").append(v[i]);
+ }
+ buf.append("}");
+ } else if (cst instanceof boolean[]) {
+ boolean[] v = (boolean[]) cst;
+ buf.append("new boolean[] {");
+ for (int i = 0; i < v.length; i++) {
+ buf.append(i == 0 ? "" : ",").append(v[i]);
+ }
+ buf.append("}");
+ } else if (cst instanceof short[]) {
+ short[] v = (short[]) cst;
+ buf.append("new short[] {");
+ for (int i = 0; i < v.length; i++) {
+ buf.append(i == 0 ? "" : ",").append("(short)").append(v[i]);
+ }
+ buf.append("}");
+ } else if (cst instanceof char[]) {
+ char[] v = (char[]) cst;
+ buf.append("new char[] {");
+ for (int i = 0; i < v.length; i++) {
+ buf.append(i == 0 ? "" : ",")
+ .append("(char)")
+ .append((int) v[i]);
+ }
+ buf.append("}");
+ } else if (cst instanceof int[]) {
+ int[] v = (int[]) cst;
+ buf.append("new int[] {");
+ for (int i = 0; i < v.length; i++) {
+ buf.append(i == 0 ? "" : ",").append(v[i]);
+ }
+ buf.append("}");
+ } else if (cst instanceof long[]) {
+ long[] v = (long[]) cst;
+ buf.append("new long[] {");
+ for (int i = 0; i < v.length; i++) {
+ buf.append(i == 0 ? "" : ",").append(v[i]).append("L");
+ }
+ buf.append("}");
+ } else if (cst instanceof float[]) {
+ float[] v = (float[]) cst;
+ buf.append("new float[] {");
+ for (int i = 0; i < v.length; i++) {
+ buf.append(i == 0 ? "" : ",").append(v[i]).append("f");
+ }
+ buf.append("}");
+ } else if (cst instanceof double[]) {
+ double[] v = (double[]) cst;
+ buf.append("new double[] {");
+ for (int i = 0; i < v.length; i++) {
+ buf.append(i == 0 ? "" : ",").append(v[i]).append("d");
+ }
+ buf.append("}");
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierAnnotationVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierAnnotationVisitor.java
new file mode 100644
index 00000000000..bb48e2cdffb
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierAnnotationVisitor.java
@@ -0,0 +1,127 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import org.objectweb.asm.AnnotationVisitor;
+
+/**
+ * An {@link AnnotationVisitor} that prints the ASM code that generates the
+ * annotations it visits.
+ *
+ * @author Eric Bruneton
+ */
+public class ASMifierAnnotationVisitor extends AbstractVisitor implements
+ AnnotationVisitor
+{
+
+ /**
+ * Identifier of the annotation visitor variable in the produced code.
+ */
+ protected final int id;
+
+ /**
+ * Constructs a new {@link ASMifierAnnotationVisitor}.
+ *
+ * @param id identifier of the annotation visitor variable in the produced
+ * code.
+ */
+ public ASMifierAnnotationVisitor(final int id) {
+ this.id = id;
+ }
+
+ // ------------------------------------------------------------------------
+ // Implementation of the AnnotationVisitor interface
+ // ------------------------------------------------------------------------
+
+ public void visit(final String name, final Object value) {
+ buf.setLength(0);
+ buf.append("av").append(id).append(".visit(");
+ ASMifierAbstractVisitor.appendConstant(buf, name);
+ buf.append(", ");
+ ASMifierAbstractVisitor.appendConstant(buf, value);
+ buf.append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitEnum(
+ final String name,
+ final String desc,
+ final String value)
+ {
+ buf.setLength(0);
+ buf.append("av").append(id).append(".visitEnum(");
+ ASMifierAbstractVisitor.appendConstant(buf, name);
+ buf.append(", ");
+ ASMifierAbstractVisitor.appendConstant(buf, desc);
+ buf.append(", ");
+ ASMifierAbstractVisitor.appendConstant(buf, value);
+ buf.append(");\n");
+ text.add(buf.toString());
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String name,
+ final String desc)
+ {
+ buf.setLength(0);
+ buf.append("{\n");
+ buf.append("AnnotationVisitor av").append(id + 1).append(" = av");
+ buf.append(id).append(".visitAnnotation(");
+ ASMifierAbstractVisitor.appendConstant(buf, name);
+ buf.append(", ");
+ ASMifierAbstractVisitor.appendConstant(buf, desc);
+ buf.append(");\n");
+ text.add(buf.toString());
+ ASMifierAnnotationVisitor av = new ASMifierAnnotationVisitor(id + 1);
+ text.add(av.getText());
+ text.add("}\n");
+ return av;
+ }
+
+ public AnnotationVisitor visitArray(final String name) {
+ buf.setLength(0);
+ buf.append("{\n");
+ buf.append("AnnotationVisitor av").append(id + 1).append(" = av");
+ buf.append(id).append(".visitArray(");
+ ASMifierAbstractVisitor.appendConstant(buf, name);
+ buf.append(");\n");
+ text.add(buf.toString());
+ ASMifierAnnotationVisitor av = new ASMifierAnnotationVisitor(id + 1);
+ text.add(av.getText());
+ text.add("}\n");
+ return av;
+ }
+
+ public void visitEnd() {
+ buf.setLength(0);
+ buf.append("av").append(id).append(".visitEnd();\n");
+ text.add(buf.toString());
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierClassVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierClassVisitor.java
new file mode 100644
index 00000000000..222325f0f1d
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierClassVisitor.java
@@ -0,0 +1,607 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import java.io.FileInputStream;
+import java.io.PrintWriter;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+
+/**
+ * A {@link ClassVisitor} that prints the ASM code that generates the classes it
+ * visits. This class visitor can be used to quickly write ASM code to generate
+ * some given bytecode: <ul> <li>write the Java source code equivalent to the
+ * bytecode you want to generate;</li> <li>compile it with <tt>javac</tt>;</li>
+ * <li>make a {@link ASMifierClassVisitor} visit this compiled class (see the
+ * {@link #main main} method);</li> <li>edit the generated source code, if
+ * necessary.</li> </ul> The source code printed when visiting the
+ * <tt>Hello</tt> class is the following: <p> <blockquote>
+ *
+ * <pre>
+ * import org.objectweb.asm.*;
+ *
+ * public class HelloDump implements Opcodes {
+ *
+ * public static byte[] dump() throws Exception {
+ *
+ * ClassWriter cw = new ClassWriter(false);
+ * FieldVisitor fv;
+ * MethodVisitor mv;
+ * AnnotationVisitor av0;
+ *
+ * cw.visit(49,
+ * ACC_PUBLIC + ACC_SUPER,
+ * &quot;Hello&quot;,
+ * null,
+ * &quot;java/lang/Object&quot;,
+ * null);
+ *
+ * cw.visitSource(&quot;Hello.java&quot;, null);
+ *
+ * {
+ * mv = cw.visitMethod(ACC_PUBLIC, &quot;&lt;init&gt;&quot;, &quot;()V&quot;, null, null);
+ * mv.visitVarInsn(ALOAD, 0);
+ * mv.visitMethodInsn(INVOKESPECIAL,
+ * &quot;java/lang/Object&quot;,
+ * &quot;&lt;init&gt;&quot;,
+ * &quot;()V&quot;);
+ * mv.visitInsn(RETURN);
+ * mv.visitMaxs(1, 1);
+ * mv.visitEnd();
+ * }
+ * {
+ * mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC,
+ * &quot;main&quot;,
+ * &quot;([Ljava/lang/String;)V&quot;,
+ * null,
+ * null);
+ * mv.visitFieldInsn(GETSTATIC,
+ * &quot;java/lang/System&quot;,
+ * &quot;out&quot;,
+ * &quot;Ljava/io/PrintStream;&quot;);
+ * mv.visitLdcInsn(&quot;hello&quot;);
+ * mv.visitMethodInsn(INVOKEVIRTUAL,
+ * &quot;java/io/PrintStream&quot;,
+ * &quot;println&quot;,
+ * &quot;(Ljava/lang/String;)V&quot;);
+ * mv.visitInsn(RETURN);
+ * mv.visitMaxs(2, 1);
+ * mv.visitEnd();
+ * }
+ * cw.visitEnd();
+ *
+ * return cw.toByteArray();
+ * }
+ * }
+ *
+ * </pre>
+ *
+ * </blockquote> where <tt>Hello</tt> is defined by: <p> <blockquote>
+ *
+ * <pre>
+ * public class Hello {
+ *
+ * public static void main(String[] args) {
+ * System.out.println(&quot;hello&quot;);
+ * }
+ * }
+ * </pre>
+ *
+ * </blockquote>
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+public class ASMifierClassVisitor extends ASMifierAbstractVisitor implements
+ ClassVisitor
+{
+
+ /**
+ * Pseudo access flag used to distinguish class access flags.
+ */
+ private final static int ACCESS_CLASS = 262144;
+
+ /**
+ * Pseudo access flag used to distinguish field access flags.
+ */
+ private final static int ACCESS_FIELD = 524288;
+
+ /**
+ * Pseudo access flag used to distinguish inner class flags.
+ */
+ private static final int ACCESS_INNER = 1048576;
+
+ /**
+ * The print writer to be used to print the class.
+ */
+ protected final PrintWriter pw;
+
+ /**
+ * Prints the ASM source code to generate the given class to the standard
+ * output. <p> Usage: ASMifierClassVisitor [-debug] &lt;fully qualified
+ * class name or class file name&gt;
+ *
+ * @param args the command line arguments.
+ *
+ * @throws Exception if the class cannot be found, or if an IO exception
+ * occurs.
+ */
+ public static void main(final String[] args) throws Exception {
+ int i = 0;
+ boolean skipDebug = true;
+
+ boolean ok = true;
+ if (args.length < 1 || args.length > 2) {
+ ok = false;
+ }
+ if (ok && args[0].equals("-debug")) {
+ i = 1;
+ skipDebug = false;
+ if (args.length != 2) {
+ ok = false;
+ }
+ }
+ if (!ok) {
+ System.err.println("Prints the ASM code to generate the given class.");
+ System.err.println("Usage: ASMifierClassVisitor [-debug] "
+ + "<fully qualified class name or class file name>");
+ return;
+ }
+ ClassReader cr;
+ if (args[i].endsWith(".class") || args[i].indexOf('\\') > -1
+ || args[i].indexOf('/') > -1) {
+ cr = new ClassReader(new FileInputStream(args[i]));
+ } else {
+ cr = new ClassReader(args[i]);
+ }
+ cr.accept(new ASMifierClassVisitor(new PrintWriter(System.out)),
+ getDefaultAttributes(),
+ skipDebug);
+ }
+
+ /**
+ * Constructs a new {@link ASMifierClassVisitor} object.
+ *
+ * @param pw the print writer to be used to print the class.
+ */
+ public ASMifierClassVisitor(final PrintWriter pw) {
+ super("cw");
+ this.pw = pw;
+ }
+
+ // ------------------------------------------------------------------------
+ // Implementation of the ClassVisitor interface
+ // ------------------------------------------------------------------------
+
+ public void visit(
+ final int version,
+ final int access,
+ final String name,
+ final String signature,
+ final String superName,
+ final String[] interfaces)
+ {
+ String simpleName;
+ int n = name.lastIndexOf('/');
+ if (n != -1) {
+ text.add("package asm." + name.substring(0, n).replace('/', '.')
+ + ";\n");
+ simpleName = name.substring(n + 1);
+ } else {
+ simpleName = name;
+ }
+ text.add("import java.util.*;\n");
+ text.add("import org.objectweb.asm.*;\n");
+ text.add("import org.objectweb.asm.attrs.*;\n");
+ text.add("public class " + simpleName + "Dump implements Opcodes {\n\n");
+ text.add("public static byte[] dump () throws Exception {\n\n");
+ text.add("ClassWriter cw = new ClassWriter(false);\n");
+ text.add("FieldVisitor fv;\n");
+ text.add("MethodVisitor mv;\n");
+ text.add("AnnotationVisitor av0;\n\n");
+
+ buf.setLength(0);
+ buf.append("cw.visit(");
+ switch (version) {
+ case Opcodes.V1_1:
+ buf.append("V1_1");
+ break;
+ case Opcodes.V1_2:
+ buf.append("V1_2");
+ break;
+ case Opcodes.V1_3:
+ buf.append("V1_3");
+ break;
+ case Opcodes.V1_4:
+ buf.append("V1_4");
+ break;
+ case Opcodes.V1_5:
+ buf.append("V1_5");
+ break;
+ case Opcodes.V1_6:
+ buf.append("V1_6");
+ break;
+ default:
+ buf.append(version);
+ break;
+ }
+ buf.append(", ");
+ appendAccess(access | ACCESS_CLASS);
+ buf.append(", ");
+ appendConstant(name);
+ buf.append(", ");
+ appendConstant(signature);
+ buf.append(", ");
+ appendConstant(superName);
+ buf.append(", ");
+ if (interfaces != null && interfaces.length > 0) {
+ buf.append("new String[] {");
+ for (int i = 0; i < interfaces.length; ++i) {
+ buf.append(i == 0 ? " " : ", ");
+ appendConstant(interfaces[i]);
+ }
+ buf.append(" }");
+ } else {
+ buf.append("null");
+ }
+ buf.append(");\n\n");
+ text.add(buf.toString());
+ }
+
+ public void visitSource(final String file, final String debug) {
+ buf.setLength(0);
+ buf.append("cw.visitSource(");
+ appendConstant(file);
+ buf.append(", ");
+ appendConstant(debug);
+ buf.append(");\n\n");
+ text.add(buf.toString());
+ }
+
+ public void visitOuterClass(
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ buf.setLength(0);
+ buf.append("cw.visitOuterClass(");
+ appendConstant(owner);
+ buf.append(", ");
+ appendConstant(name);
+ buf.append(", ");
+ appendConstant(desc);
+ buf.append(");\n\n");
+ text.add(buf.toString());
+ }
+
+ public void visitInnerClass(
+ final String name,
+ final String outerName,
+ final String innerName,
+ final int access)
+ {
+ buf.setLength(0);
+ buf.append("cw.visitInnerClass(");
+ appendConstant(name);
+ buf.append(", ");
+ appendConstant(outerName);
+ buf.append(", ");
+ appendConstant(innerName);
+ buf.append(", ");
+ appendAccess(access | ACCESS_INNER);
+ buf.append(");\n\n");
+ text.add(buf.toString());
+ }
+
+ public FieldVisitor visitField(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final Object value)
+ {
+ buf.setLength(0);
+ buf.append("{\n");
+ buf.append("fv = cw.visitField(");
+ appendAccess(access | ACCESS_FIELD);
+ buf.append(", ");
+ appendConstant(name);
+ buf.append(", ");
+ appendConstant(desc);
+ buf.append(", ");
+ appendConstant(signature);
+ buf.append(", ");
+ appendConstant(value);
+ buf.append(");\n");
+ text.add(buf.toString());
+ ASMifierFieldVisitor aav = new ASMifierFieldVisitor();
+ text.add(aav.getText());
+ text.add("}\n");
+ return aav;
+ }
+
+ public MethodVisitor visitMethod(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final String[] exceptions)
+ {
+ buf.setLength(0);
+ buf.append("{\n");
+ buf.append("mv = cw.visitMethod(");
+ appendAccess(access);
+ buf.append(", ");
+ appendConstant(name);
+ buf.append(", ");
+ appendConstant(desc);
+ buf.append(", ");
+ appendConstant(signature);
+ buf.append(", ");
+ if (exceptions != null && exceptions.length > 0) {
+ buf.append("new String[] {");
+ for (int i = 0; i < exceptions.length; ++i) {
+ buf.append(i == 0 ? " " : ", ");
+ appendConstant(exceptions[i]);
+ }
+ buf.append(" }");
+ } else {
+ buf.append("null");
+ }
+ buf.append(");\n");
+ text.add(buf.toString());
+ ASMifierMethodVisitor acv = new ASMifierMethodVisitor();
+ text.add(acv.getText());
+ text.add("}\n");
+ return acv;
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ buf.setLength(0);
+ buf.append("{\n");
+ buf.append("av0 = cw.visitAnnotation(");
+ appendConstant(desc);
+ buf.append(", ");
+ buf.append(visible);
+ buf.append(");\n");
+ text.add(buf.toString());
+ ASMifierAnnotationVisitor av = new ASMifierAnnotationVisitor(0);
+ text.add(av.getText());
+ text.add("}\n");
+ return av;
+ }
+
+ public void visitEnd() {
+ text.add("cw.visitEnd();\n\n");
+ text.add("return cw.toByteArray();\n");
+ text.add("}\n");
+ text.add("}\n");
+ printList(pw, text);
+ pw.flush();
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Appends a string representation of the given access modifiers to {@link
+ * #buf buf}.
+ *
+ * @param access some access modifiers.
+ */
+ void appendAccess(final int access) {
+ boolean first = true;
+ if ((access & Opcodes.ACC_PUBLIC) != 0) {
+ buf.append("ACC_PUBLIC");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_PRIVATE) != 0) {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_PRIVATE");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_PROTECTED) != 0) {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_PROTECTED");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_FINAL) != 0) {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_FINAL");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_STATIC) != 0) {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_STATIC");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_SYNCHRONIZED) != 0) {
+ if (!first) {
+ buf.append(" + ");
+ }
+ if ((access & ACCESS_CLASS) != 0) {
+ buf.append("ACC_SUPER");
+ } else {
+ buf.append("ACC_SYNCHRONIZED");
+ }
+ first = false;
+ }
+ if ((access & Opcodes.ACC_VOLATILE) != 0
+ && (access & ACCESS_FIELD) != 0)
+ {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_VOLATILE");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_BRIDGE) != 0 && (access & ACCESS_CLASS) == 0
+ && (access & ACCESS_FIELD) == 0)
+ {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_BRIDGE");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_VARARGS) != 0 && (access & ACCESS_CLASS) == 0
+ && (access & ACCESS_FIELD) == 0)
+ {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_VARARGS");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_TRANSIENT) != 0
+ && (access & ACCESS_FIELD) != 0)
+ {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_TRANSIENT");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_NATIVE) != 0 && (access & ACCESS_CLASS) == 0
+ && (access & ACCESS_FIELD) == 0)
+ {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_NATIVE");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_ENUM) != 0
+ && ((access & ACCESS_CLASS) != 0
+ || (access & ACCESS_FIELD) != 0 || (access & ACCESS_INNER) != 0))
+ {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_ENUM");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_ANNOTATION) != 0
+ && ((access & ACCESS_CLASS) != 0))
+ {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_ANNOTATION");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_ABSTRACT) != 0) {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_ABSTRACT");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_INTERFACE) != 0) {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_INTERFACE");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_STRICT) != 0) {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_STRICT");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_SYNTHETIC");
+ first = false;
+ }
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ if (!first) {
+ buf.append(" + ");
+ }
+ buf.append("ACC_DEPRECATED");
+ first = false;
+ }
+ if (first) {
+ buf.append("0");
+ }
+ }
+
+ /**
+ * Appends a string representation of the given constant to the given
+ * buffer.
+ *
+ * @param buf a string buffer.
+ * @param cst an {@link java.lang.Integer Integer}, {@link java.lang.Float
+ * Float}, {@link java.lang.Long Long},
+ * {@link java.lang.Double Double} or {@link String String} object.
+ * May be <tt>null</tt>.
+ */
+ static void appendConstant(final StringBuffer buf, final Object cst) {
+ if (cst == null) {
+ buf.append("null");
+ } else if (cst instanceof String) {
+ AbstractVisitor.appendString(buf, (String) cst);
+ } else if (cst instanceof Type) {
+ buf.append("Type.getType(\"")
+ .append(((Type) cst).getDescriptor())
+ .append("\")");
+ } else if (cst instanceof Integer) {
+ buf.append("new Integer(").append(cst).append(")");
+ } else if (cst instanceof Float) {
+ buf.append("new Float(\"").append(cst).append("\")");
+ } else if (cst instanceof Long) {
+ buf.append("new Long(").append(cst).append("L)");
+ } else if (cst instanceof Double) {
+ buf.append("new Double(\"").append(cst).append("\")");
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierFieldVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierFieldVisitor.java
new file mode 100644
index 00000000000..9da152ca357
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierFieldVisitor.java
@@ -0,0 +1,50 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import org.objectweb.asm.FieldVisitor;
+
+/**
+ * A {@link FieldVisitor} that prints the ASM code that generates the fields it
+ * visits.
+ *
+ * @author Eric Bruneton
+ */
+public class ASMifierFieldVisitor extends ASMifierAbstractVisitor implements
+ FieldVisitor
+{
+
+ /**
+ * Constructs a new {@link ASMifierFieldVisitor}.
+ */
+ public ASMifierFieldVisitor() {
+ super("fv");
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierMethodVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierMethodVisitor.java
new file mode 100644
index 00000000000..33404d97525
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/ASMifierMethodVisitor.java
@@ -0,0 +1,347 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.Opcodes;
+
+import java.util.HashMap;
+
+/**
+ * A {@link MethodVisitor} that prints the ASM code that generates the methods
+ * it visits.
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+public class ASMifierMethodVisitor extends ASMifierAbstractVisitor implements
+ MethodVisitor
+{
+
+ /**
+ * Constructs a new {@link ASMifierMethodVisitor} object.
+ */
+ public ASMifierMethodVisitor() {
+ super("mv");
+ this.labelNames = new HashMap();
+ }
+
+ public AnnotationVisitor visitAnnotationDefault() {
+ buf.setLength(0);
+ buf.append("{\n").append("av0 = mv.visitAnnotationDefault();\n");
+ text.add(buf.toString());
+ ASMifierAnnotationVisitor av = new ASMifierAnnotationVisitor(0);
+ text.add(av.getText());
+ text.add("}\n");
+ return av;
+ }
+
+ public AnnotationVisitor visitParameterAnnotation(
+ final int parameter,
+ final String desc,
+ final boolean visible)
+ {
+ buf.setLength(0);
+ buf.append("{\n")
+ .append("av0 = mv.visitParameterAnnotation(")
+ .append(parameter)
+ .append(", ");
+ appendConstant(desc);
+ buf.append(", ").append(visible).append(");\n");
+ text.add(buf.toString());
+ ASMifierAnnotationVisitor av = new ASMifierAnnotationVisitor(0);
+ text.add(av.getText());
+ text.add("}\n");
+ return av;
+ }
+
+ public void visitCode() {
+ text.add("mv.visitCode();\n");
+ }
+
+ public void visitInsn(final int opcode) {
+ buf.setLength(0);
+ buf.append("mv.visitInsn(").append(OPCODES[opcode]).append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitIntInsn(final int opcode, final int operand) {
+ buf.setLength(0);
+ buf.append("mv.visitIntInsn(")
+ .append(OPCODES[opcode])
+ .append(", ")
+ .append(opcode == Opcodes.NEWARRAY
+ ? TYPES[operand]
+ : Integer.toString(operand))
+ .append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitVarInsn(final int opcode, final int var) {
+ buf.setLength(0);
+ buf.append("mv.visitVarInsn(")
+ .append(OPCODES[opcode])
+ .append(", ")
+ .append(var)
+ .append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitTypeInsn(final int opcode, final String desc) {
+ buf.setLength(0);
+ buf.append("mv.visitTypeInsn(").append(OPCODES[opcode]).append(", ");
+ appendConstant(desc);
+ buf.append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitFieldInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ buf.setLength(0);
+ buf.append("mv.visitFieldInsn(").append(OPCODES[opcode]).append(", ");
+ appendConstant(owner);
+ buf.append(", ");
+ appendConstant(name);
+ buf.append(", ");
+ appendConstant(desc);
+ buf.append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitMethodInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ buf.setLength(0);
+ buf.append("mv.visitMethodInsn(").append(OPCODES[opcode]).append(", ");
+ appendConstant(owner);
+ buf.append(", ");
+ appendConstant(name);
+ buf.append(", ");
+ appendConstant(desc);
+ buf.append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitJumpInsn(final int opcode, final Label label) {
+ buf.setLength(0);
+ declareLabel(label);
+ buf.append("mv.visitJumpInsn(").append(OPCODES[opcode]).append(", ");
+ appendLabel(label);
+ buf.append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitLabel(final Label label) {
+ buf.setLength(0);
+ declareLabel(label);
+ buf.append("mv.visitLabel(");
+ appendLabel(label);
+ buf.append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitLdcInsn(final Object cst) {
+ buf.setLength(0);
+ buf.append("mv.visitLdcInsn(");
+ appendConstant(cst);
+ buf.append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitIincInsn(final int var, final int increment) {
+ buf.setLength(0);
+ buf.append("mv.visitIincInsn(")
+ .append(var)
+ .append(", ")
+ .append(increment)
+ .append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitTableSwitchInsn(
+ final int min,
+ final int max,
+ final Label dflt,
+ final Label labels[])
+ {
+ buf.setLength(0);
+ for (int i = 0; i < labels.length; ++i) {
+ declareLabel(labels[i]);
+ }
+ declareLabel(dflt);
+
+ buf.append("mv.visitTableSwitchInsn(")
+ .append(min)
+ .append(", ")
+ .append(max)
+ .append(", ");
+ appendLabel(dflt);
+ buf.append(", new Label[] {");
+ for (int i = 0; i < labels.length; ++i) {
+ buf.append(i == 0 ? " " : ", ");
+ appendLabel(labels[i]);
+ }
+ buf.append(" });\n");
+ text.add(buf.toString());
+ }
+
+ public void visitLookupSwitchInsn(
+ final Label dflt,
+ final int keys[],
+ final Label labels[])
+ {
+ buf.setLength(0);
+ for (int i = 0; i < labels.length; ++i) {
+ declareLabel(labels[i]);
+ }
+ declareLabel(dflt);
+
+ buf.append("mv.visitLookupSwitchInsn(");
+ appendLabel(dflt);
+ buf.append(", new int[] {");
+ for (int i = 0; i < keys.length; ++i) {
+ buf.append(i == 0 ? " " : ", ").append(keys[i]);
+ }
+ buf.append(" }, new Label[] {");
+ for (int i = 0; i < labels.length; ++i) {
+ buf.append(i == 0 ? " " : ", ");
+ appendLabel(labels[i]);
+ }
+ buf.append(" });\n");
+ text.add(buf.toString());
+ }
+
+ public void visitMultiANewArrayInsn(final String desc, final int dims) {
+ buf.setLength(0);
+ buf.append("mv.visitMultiANewArrayInsn(");
+ appendConstant(desc);
+ buf.append(", ").append(dims).append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitTryCatchBlock(
+ final Label start,
+ final Label end,
+ final Label handler,
+ final String type)
+ {
+ buf.setLength(0);
+ declareLabel(start);
+ declareLabel(end);
+ declareLabel(handler);
+ buf.append("mv.visitTryCatchBlock(");
+ appendLabel(start);
+ buf.append(", ");
+ appendLabel(end);
+ buf.append(", ");
+ appendLabel(handler);
+ buf.append(", ");
+ appendConstant(type);
+ buf.append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitLocalVariable(
+ final String name,
+ final String desc,
+ final String signature,
+ final Label start,
+ final Label end,
+ final int index)
+ {
+ buf.setLength(0);
+ buf.append("mv.visitLocalVariable(");
+ appendConstant(name);
+ buf.append(", ");
+ appendConstant(desc);
+ buf.append(", ");
+ appendConstant(signature);
+ buf.append(", ");
+ appendLabel(start);
+ buf.append(", ");
+ appendLabel(end);
+ buf.append(", ").append(index).append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitLineNumber(final int line, final Label start) {
+ buf.setLength(0);
+ buf.append("mv.visitLineNumber(").append(line).append(", ");
+ appendLabel(start);
+ buf.append(");\n");
+ text.add(buf.toString());
+ }
+
+ public void visitMaxs(final int maxStack, final int maxLocals) {
+ buf.setLength(0);
+ buf.append("mv.visitMaxs(")
+ .append(maxStack)
+ .append(", ")
+ .append(maxLocals)
+ .append(");\n");
+ text.add(buf.toString());
+ }
+
+ /**
+ * Appends a declaration of the given label to {@link #buf buf}. This
+ * declaration is of the form "Label lXXX = new Label();". Does nothing if
+ * the given label has already been declared.
+ *
+ * @param l a label.
+ */
+ private void declareLabel(final Label l) {
+ String name = (String) labelNames.get(l);
+ if (name == null) {
+ name = "l" + labelNames.size();
+ labelNames.put(l, name);
+ buf.append("Label ").append(name).append(" = new Label();\n");
+ }
+ }
+
+ /**
+ * Appends the name of the given label to {@link #buf buf}. The given label
+ * <i>must</i> already have a name. One way to ensure this is to always
+ * call {@link #declareLabel declared} before calling this method.
+ *
+ * @param l a label.
+ */
+ private void appendLabel(final Label l) {
+ buf.append((String) labelNames.get(l));
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/AbstractVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/AbstractVisitor.java
new file mode 100644
index 00000000000..3e329f7fe4e
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/AbstractVisitor.java
@@ -0,0 +1,201 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.util.attrs.ASMStackMapAttribute;
+import org.objectweb.asm.util.attrs.ASMStackMapTableAttribute;
+
+/**
+ * An abstract visitor.
+ *
+ * @author Eric Bruneton
+ */
+public abstract class AbstractVisitor {
+
+ /**
+ * The names of the Java Virtual Machine opcodes.
+ */
+ public final static String[] OPCODES;
+ /**
+ * Types for <code>operand</code> parameter of the
+ * {@link org.objectweb.asm.MethodVisitor#visitIntInsn} method when
+ * <code>opcode</code> is <code>NEWARRAY</code>.
+ */
+ public final static String[] TYPES;
+
+ static {
+ String s = "NOP,ACONST_NULL,ICONST_M1,ICONST_0,ICONST_1,ICONST_2,"
+ + "ICONST_3,ICONST_4,ICONST_5,LCONST_0,LCONST_1,FCONST_0,"
+ + "FCONST_1,FCONST_2,DCONST_0,DCONST_1,BIPUSH,SIPUSH,LDC,,,"
+ + "ILOAD,LLOAD,FLOAD,DLOAD,ALOAD,,,,,,,,,,,,,,,,,,,,,IALOAD,"
+ + "LALOAD,FALOAD,DALOAD,AALOAD,BALOAD,CALOAD,SALOAD,ISTORE,"
+ + "LSTORE,FSTORE,DSTORE,ASTORE,,,,,,,,,,,,,,,,,,,,,IASTORE,"
+ + "LASTORE,FASTORE,DASTORE,AASTORE,BASTORE,CASTORE,SASTORE,POP,"
+ + "POP2,DUP,DUP_X1,DUP_X2,DUP2,DUP2_X1,DUP2_X2,SWAP,IADD,LADD,"
+ + "FADD,DADD,ISUB,LSUB,FSUB,DSUB,IMUL,LMUL,FMUL,DMUL,IDIV,LDIV,"
+ + "FDIV,DDIV,IREM,LREM,FREM,DREM,INEG,LNEG,FNEG,DNEG,ISHL,LSHL,"
+ + "ISHR,LSHR,IUSHR,LUSHR,IAND,LAND,IOR,LOR,IXOR,LXOR,IINC,I2L,"
+ + "I2F,I2D,L2I,L2F,L2D,F2I,F2L,F2D,D2I,D2L,D2F,I2B,I2C,I2S,LCMP,"
+ + "FCMPL,FCMPG,DCMPL,DCMPG,IFEQ,IFNE,IFLT,IFGE,IFGT,IFLE,"
+ + "IF_ICMPEQ,IF_ICMPNE,IF_ICMPLT,IF_ICMPGE,IF_ICMPGT,IF_ICMPLE,"
+ + "IF_ACMPEQ,IF_ACMPNE,GOTO,JSR,RET,TABLESWITCH,LOOKUPSWITCH,"
+ + "IRETURN,LRETURN,FRETURN,DRETURN,ARETURN,RETURN,GETSTATIC,"
+ + "PUTSTATIC,GETFIELD,PUTFIELD,INVOKEVIRTUAL,INVOKESPECIAL,"
+ + "INVOKESTATIC,INVOKEINTERFACE,,NEW,NEWARRAY,ANEWARRAY,"
+ + "ARRAYLENGTH,ATHROW,CHECKCAST,INSTANCEOF,MONITORENTER,"
+ + "MONITOREXIT,,MULTIANEWARRAY,IFNULL,IFNONNULL,";
+ OPCODES = new String[200];
+ int i = 0;
+ int j = 0;
+ int l;
+ while ((l = s.indexOf(',', j)) > 0) {
+ OPCODES[i++] = j + 1 == l ? null : s.substring(j, l);
+ j = l + 1;
+ }
+
+ s = "T_BOOLEAN,T_CHAR,T_FLOAT,T_DOUBLE,T_BYTE,T_SHORT,T_INT,T_LONG,";
+ TYPES = new String[12];
+ j = 0;
+ i = 4;
+ while ((l = s.indexOf(',', j)) > 0) {
+ TYPES[i++] = s.substring(j, l);
+ j = l + 1;
+ }
+ }
+
+ /**
+ * The text to be printed. Since the code of methods is not necessarily
+ * visited in sequential order, one method after the other, but can be
+ * interlaced (some instructions from method one, then some instructions
+ * from method two, then some instructions from method one again...), it is
+ * not possible to print the visited instructions directly to a sequential
+ * stream. A class is therefore printed in a two steps process: a string
+ * tree is constructed during the visit, and printed to a sequential stream
+ * at the end of the visit. This string tree is stored in this field, as a
+ * string list that can contain other string lists, which can themselves
+ * contain other string lists, and so on.
+ */
+ public final List text;
+
+ /**
+ * A buffer that can be used to create strings.
+ */
+ protected final StringBuffer buf;
+
+ /**
+ * Constructs a new {@link AbstractVisitor}.
+ */
+ protected AbstractVisitor() {
+ this.text = new ArrayList();
+ this.buf = new StringBuffer();
+ }
+
+ /**
+ * Returns the text printed by this visitor.
+ *
+ * @return the text printed by this visitor.
+ */
+ public List getText() {
+ return text;
+ }
+
+ /**
+ * Appends a quoted string to a given buffer.
+ *
+ * @param buf the buffer where the string must be added.
+ * @param s the string to be added.
+ */
+ public static void appendString(final StringBuffer buf, final String s) {
+ buf.append("\"");
+ for (int i = 0; i < s.length(); ++i) {
+ char c = s.charAt(i);
+ if (c == '\n') {
+ buf.append("\\n");
+ } else if (c == '\r') {
+ buf.append("\\r");
+ } else if (c == '\\') {
+ buf.append("\\\\");
+ } else if (c == '"') {
+ buf.append("\\\"");
+ } else if (c < 0x20 || c > 0x7f) {
+ buf.append("\\u");
+ if (c < 0x10) {
+ buf.append("000");
+ } else if (c < 0x100) {
+ buf.append("00");
+ } else if (c < 0x1000) {
+ buf.append("0");
+ }
+ buf.append(Integer.toString(c, 16));
+ } else {
+ buf.append(c);
+ }
+ }
+ buf.append("\"");
+ }
+
+ /**
+ * Prints the given string tree.
+ *
+ * @param pw the writer to be used to print the tree.
+ * @param l a string tree, i.e., a string list that can contain other string
+ * lists, and so on recursively.
+ */
+ void printList(final PrintWriter pw, final List l) {
+ for (int i = 0; i < l.size(); ++i) {
+ Object o = l.get(i);
+ if (o instanceof List) {
+ printList(pw, (List) o);
+ } else {
+ pw.print(o.toString());
+ }
+ }
+ }
+
+ /**
+ * Returns the default {@link ASMifiable} prototypes.
+ *
+ * @return the default {@link ASMifiable} prototypes.
+ */
+ public static Attribute[] getDefaultAttributes() {
+ try {
+ return new Attribute[] {
+ new ASMStackMapAttribute(),
+ new ASMStackMapTableAttribute() };
+ } catch (Exception e) {
+ return new Attribute[0];
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckAnnotationAdapter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckAnnotationAdapter.java
new file mode 100644
index 00000000000..d00933ca528
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckAnnotationAdapter.java
@@ -0,0 +1,125 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Type;
+
+/**
+ * An {@link AnnotationVisitor} that checks that its methods are properly used.
+ *
+ * @author Eric Bruneton
+ */
+public class CheckAnnotationAdapter implements AnnotationVisitor {
+
+ private AnnotationVisitor av;
+
+ private boolean named;
+
+ private boolean end;
+
+ public CheckAnnotationAdapter(final AnnotationVisitor av) {
+ this(av, true);
+ }
+
+ CheckAnnotationAdapter(
+ final AnnotationVisitor av,
+ final boolean named)
+ {
+ this.av = av;
+ this.named = named;
+ }
+
+ public void visit(final String name, final Object value) {
+ checkEnd();
+ checkName(name);
+ if (!(value instanceof Byte || value instanceof Boolean
+ || value instanceof Character || value instanceof Short
+ || value instanceof Integer || value instanceof Long
+ || value instanceof Float || value instanceof Double
+ || value instanceof String || value instanceof Type
+ || value instanceof byte[] || value instanceof boolean[]
+ || value instanceof char[] || value instanceof short[]
+ || value instanceof int[] || value instanceof long[]
+ || value instanceof float[] || value instanceof double[]))
+ {
+ throw new IllegalArgumentException("Invalid annotation value");
+ }
+ av.visit(name, value);
+ }
+
+ public void visitEnum(
+ final String name,
+ final String desc,
+ final String value)
+ {
+ checkEnd();
+ checkName(name);
+ CheckMethodAdapter.checkDesc(desc, false);
+ if (value == null) {
+ throw new IllegalArgumentException("Invalid enum value");
+ }
+ av.visitEnum(name, desc, value);
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String name,
+ final String desc)
+ {
+ checkEnd();
+ checkName(name);
+ CheckMethodAdapter.checkDesc(desc, false);
+ return new CheckAnnotationAdapter(av.visitAnnotation(name, desc));
+ }
+
+ public AnnotationVisitor visitArray(final String name) {
+ checkEnd();
+ checkName(name);
+ return new CheckAnnotationAdapter(av.visitArray(name), false);
+ }
+
+ public void visitEnd() {
+ checkEnd();
+ end = true;
+ av.visitEnd();
+ }
+
+ private void checkEnd() {
+ if (end) {
+ throw new IllegalStateException("Cannot call a visit method after visitEnd has been called");
+ }
+ }
+
+ private void checkName(final String name) {
+ if (named && name == null) {
+ throw new IllegalArgumentException("Annotation value name must not be null");
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckClassAdapter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckClassAdapter.java
new file mode 100644
index 00000000000..640e8b08308
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckClassAdapter.java
@@ -0,0 +1,416 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import java.io.FileInputStream;
+import java.io.PrintWriter;
+import java.util.List;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.ClassAdapter;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.tree.AbstractInsnNode;
+import org.objectweb.asm.tree.MethodNode;
+import org.objectweb.asm.tree.ClassNode;
+import org.objectweb.asm.tree.TryCatchBlockNode;
+import org.objectweb.asm.tree.analysis.Analyzer;
+import org.objectweb.asm.tree.analysis.SimpleVerifier;
+import org.objectweb.asm.tree.analysis.Frame;
+
+/**
+ * A {@link ClassAdapter} that checks that its methods are properly used. More
+ * precisely this class adapter checks each method call individually, based
+ * <i>only</i> on its arguments, but does <i>not</i> check the <i>sequence</i>
+ * of method calls. For example, the invalid sequence
+ * <tt>visitField(ACC_PUBLIC, "i", "I", null)</tt> <tt>visitField(ACC_PUBLIC,
+ * "i", "D", null)</tt>
+ * will <i>not</i> be detected by this class adapter.
+ *
+ * @author Eric Bruneton
+ */
+public class CheckClassAdapter extends ClassAdapter {
+
+ /**
+ * <tt>true</tt> if the visit method has been called.
+ */
+ private boolean start;
+
+ /**
+ * <tt>true</tt> if the visitSource method has been called.
+ */
+ private boolean source;
+
+ /**
+ * <tt>true</tt> if the visitOuterClass method has been called.
+ */
+ private boolean outer;
+
+ /**
+ * <tt>true</tt> if the visitEnd method has been called.
+ */
+ private boolean end;
+
+ /**
+ * Checks a given class. <p> Usage: CheckClassAdapter &lt;fully qualified
+ * class name or class file name&gt;
+ *
+ * @param args the command line arguments.
+ *
+ * @throws Exception if the class cannot be found, or if an IO exception
+ * occurs.
+ */
+ public static void main(final String[] args) throws Exception {
+ if (args.length != 1) {
+ System.err.println("Verifies the given class.");
+ System.err.println("Usage: CheckClassAdapter "
+ + "<fully qualified class name or class file name>");
+ return;
+ }
+ ClassReader cr;
+ if (args[0].endsWith(".class")) {
+ cr = new ClassReader(new FileInputStream(args[0]));
+ } else {
+ cr = new ClassReader(args[0]);
+ }
+
+ verify(cr, false, new PrintWriter(System.err));
+ }
+
+ /**
+ * Checks a given class
+ *
+ * @param cr a <code>ClassReader</code> that contains bytecode for the analysis.
+ * @param dump true if bytecode should be printed out not only when errors are found.
+ * @param pw write where results going to be printed
+ */
+ public static void verify(ClassReader cr, boolean dump, PrintWriter pw) {
+ ClassNode cn = new ClassNode();
+ cr.accept(new CheckClassAdapter(cn), true);
+
+ List methods = cn.methods;
+ for (int i = 0; i < methods.size(); ++i) {
+ MethodNode method = (MethodNode) methods.get(i);
+ if (method.instructions.size() > 0) {
+ Analyzer a = new Analyzer(new SimpleVerifier(Type.getType("L"
+ + cn.name + ";"),
+ Type.getType("L" + cn.superName + ";"),
+ (cn.access & Opcodes.ACC_INTERFACE) != 0));
+ try {
+ a.analyze(cn.name, method);
+ if (!dump) {
+ continue;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ Frame[] frames = a.getFrames();
+
+ TraceMethodVisitor mv = new TraceMethodVisitor();
+
+ pw.println(method.name + method.desc);
+ for (int j = 0; j < method.instructions.size(); ++j) {
+ ((AbstractInsnNode) method.instructions.get(j)).accept(mv);
+
+ StringBuffer s = new StringBuffer();
+ Frame f = frames[j];
+ if (f == null) {
+ s.append('?');
+ } else {
+ for (int k = 0; k < f.getLocals(); ++k) {
+ s.append(getShortName(f.getLocal(k).toString()))
+ .append(' ');
+ }
+ s.append(" : ");
+ for (int k = 0; k < f.getStackSize(); ++k) {
+ s.append(getShortName(f.getStack(k).toString()))
+ .append(' ');
+ }
+ }
+ while (s.length() < method.maxStack + method.maxLocals + 1)
+ {
+ s.append(' ');
+ }
+ pw.print(Integer.toString(j + 100000).substring(1));
+ pw.print(" " + s + " : " + mv.buf); // mv.text.get(j));
+ }
+ for (int j = 0; j < method.tryCatchBlocks.size(); ++j) {
+ ((TryCatchBlockNode) method.tryCatchBlocks.get(j)).accept(mv);
+ pw.print(" " + mv.buf);
+ }
+ pw.println();
+ }
+ }
+ }
+
+ private static String getShortName(String name) {
+ int n = name.lastIndexOf('/');
+ int k = name.length();
+ if(name.charAt(k-1)==';') k--;
+ return n==-1 ? name : name.substring(n+1, k);
+ }
+
+ /**
+ * Constructs a new {@link CheckClassAdapter}.
+ *
+ * @param cv the class visitor to which this adapter must delegate calls.
+ */
+ public CheckClassAdapter(final ClassVisitor cv) {
+ super(cv);
+ }
+
+ // ------------------------------------------------------------------------
+ // Implementation of the ClassVisitor interface
+ // ------------------------------------------------------------------------
+
+ public void visit(
+ final int version,
+ final int access,
+ final String name,
+ final String signature,
+ final String superName,
+ final String[] interfaces)
+ {
+ if (start) {
+ throw new IllegalStateException("visit must be called only once");
+ } else {
+ start = true;
+ }
+ checkState();
+ checkAccess(access, Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL
+ + Opcodes.ACC_SUPER + Opcodes.ACC_INTERFACE
+ + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC
+ + Opcodes.ACC_ANNOTATION + Opcodes.ACC_ENUM
+ + Opcodes.ACC_DEPRECATED);
+ CheckMethodAdapter.checkInternalName(name, "class name");
+ if ("java/lang/Object".equals(name)) {
+ if (superName != null) {
+ throw new IllegalArgumentException("The super class name of the Object class must be 'null'");
+ }
+ } else {
+ CheckMethodAdapter.checkInternalName(superName, "super class name");
+ }
+ if (signature != null) {
+ // TODO
+ }
+ if ((access & Opcodes.ACC_INTERFACE) != 0) {
+ if (!"java/lang/Object".equals(superName)) {
+ throw new IllegalArgumentException("The super class name of interfaces must be 'java/lang/Object'");
+ }
+ }
+ if (interfaces != null) {
+ for (int i = 0; i < interfaces.length; ++i) {
+ CheckMethodAdapter.checkInternalName(interfaces[i],
+ "interface name at index " + i);
+ }
+ }
+ cv.visit(version, access, name, signature, superName, interfaces);
+ }
+
+ public void visitSource(final String file, final String debug) {
+ checkState();
+ if (source) {
+ throw new IllegalStateException("visitSource can be called only once.");
+ }
+ source = true;
+ cv.visitSource(file, debug);
+ }
+
+ public void visitOuterClass(
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ checkState();
+ if (outer) {
+ throw new IllegalStateException("visitSource can be called only once.");
+ }
+ outer = true;
+ if (owner == null) {
+ throw new IllegalArgumentException("Illegal outer class owner");
+ }
+ if (desc != null) {
+ CheckMethodAdapter.checkMethodDesc(desc);
+ }
+ cv.visitOuterClass(owner, name, desc);
+ }
+
+ public void visitInnerClass(
+ final String name,
+ final String outerName,
+ final String innerName,
+ final int access)
+ {
+ checkState();
+ CheckMethodAdapter.checkInternalName(name, "class name");
+ if (outerName != null) {
+ CheckMethodAdapter.checkInternalName(outerName, "outer class name");
+ }
+ if (innerName != null) {
+ CheckMethodAdapter.checkIdentifier(innerName, "inner class name");
+ }
+ checkAccess(access, Opcodes.ACC_PUBLIC + Opcodes.ACC_PRIVATE
+ + Opcodes.ACC_PROTECTED + Opcodes.ACC_STATIC
+ + Opcodes.ACC_FINAL + Opcodes.ACC_INTERFACE
+ + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC
+ + Opcodes.ACC_ANNOTATION + Opcodes.ACC_ENUM);
+ cv.visitInnerClass(name, outerName, innerName, access);
+ }
+
+ public FieldVisitor visitField(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final Object value)
+ {
+ checkState();
+ checkAccess(access, Opcodes.ACC_PUBLIC + Opcodes.ACC_PRIVATE
+ + Opcodes.ACC_PROTECTED + Opcodes.ACC_STATIC
+ + Opcodes.ACC_FINAL + Opcodes.ACC_VOLATILE
+ + Opcodes.ACC_TRANSIENT + Opcodes.ACC_SYNTHETIC
+ + Opcodes.ACC_ENUM + Opcodes.ACC_DEPRECATED);
+ CheckMethodAdapter.checkIdentifier(name, "field name");
+ CheckMethodAdapter.checkDesc(desc, false);
+ if (signature != null) {
+ // TODO
+ }
+ if (value != null) {
+ CheckMethodAdapter.checkConstant(value);
+ }
+ FieldVisitor av = cv.visitField(access, name, desc, signature, value);
+ return new CheckFieldAdapter(av);
+ }
+
+ public MethodVisitor visitMethod(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final String[] exceptions)
+ {
+ checkState();
+ checkAccess(access, Opcodes.ACC_PUBLIC + Opcodes.ACC_PRIVATE
+ + Opcodes.ACC_PROTECTED + Opcodes.ACC_STATIC
+ + Opcodes.ACC_FINAL + Opcodes.ACC_SYNCHRONIZED
+ + Opcodes.ACC_BRIDGE + Opcodes.ACC_VARARGS + Opcodes.ACC_NATIVE
+ + Opcodes.ACC_ABSTRACT + Opcodes.ACC_STRICT
+ + Opcodes.ACC_SYNTHETIC + Opcodes.ACC_DEPRECATED);
+ CheckMethodAdapter.checkMethodIdentifier(name, "method name");
+ CheckMethodAdapter.checkMethodDesc(desc);
+ if (signature != null) {
+ // TODO
+ }
+ if (exceptions != null) {
+ for (int i = 0; i < exceptions.length; ++i) {
+ CheckMethodAdapter.checkInternalName(exceptions[i],
+ "exception name at index " + i);
+ }
+ }
+ return new CheckMethodAdapter(cv.visitMethod(access,
+ name,
+ desc,
+ signature,
+ exceptions));
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ checkState();
+ CheckMethodAdapter.checkDesc(desc, false);
+ return new CheckAnnotationAdapter(cv.visitAnnotation(desc, visible));
+ }
+
+ public void visitAttribute(final Attribute attr) {
+ checkState();
+ if (attr == null) {
+ throw new IllegalArgumentException("Invalid attribute (must not be null)");
+ }
+ cv.visitAttribute(attr);
+ }
+
+ public void visitEnd() {
+ checkState();
+ end = true;
+ cv.visitEnd();
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Checks that the visit method has been called and that visitEnd has not
+ * been called.
+ */
+ private void checkState() {
+ if (!start) {
+ throw new IllegalStateException("Cannot visit member before visit has been called.");
+ }
+ if (end) {
+ throw new IllegalStateException("Cannot visit member after visitEnd has been called.");
+ }
+ }
+
+ /**
+ * Checks that the given access flags do not contain invalid flags. This
+ * method also checks that mutually incompatible flags are not set
+ * simultaneously.
+ *
+ * @param access the access flags to be checked
+ * @param possibleAccess the valid access flags.
+ */
+ static void checkAccess(final int access, final int possibleAccess) {
+ if ((access & ~possibleAccess) != 0) {
+ throw new IllegalArgumentException("Invalid access flags: "
+ + access);
+ }
+ int pub = ((access & Opcodes.ACC_PUBLIC) != 0 ? 1 : 0);
+ int pri = ((access & Opcodes.ACC_PRIVATE) != 0 ? 1 : 0);
+ int pro = ((access & Opcodes.ACC_PROTECTED) != 0 ? 1 : 0);
+ if (pub + pri + pro > 1) {
+ throw new IllegalArgumentException("public private and protected are mutually exclusive: "
+ + access);
+ }
+ int fin = ((access & Opcodes.ACC_FINAL) != 0 ? 1 : 0);
+ int abs = ((access & Opcodes.ACC_ABSTRACT) != 0 ? 1 : 0);
+ if (fin + abs > 1) {
+ throw new IllegalArgumentException("final and abstract are mutually exclusive: "
+ + access);
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckFieldAdapter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckFieldAdapter.java
new file mode 100644
index 00000000000..3e7c113b80a
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckFieldAdapter.java
@@ -0,0 +1,75 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.FieldVisitor;
+
+/**
+ * A {@link FieldVisitor} that checks that its methods are properly used.
+ */
+public class CheckFieldAdapter implements FieldVisitor {
+
+ private FieldVisitor fv;
+
+ private boolean end;
+
+ public CheckFieldAdapter(final FieldVisitor fv) {
+ this.fv = fv;
+ }
+
+ public AnnotationVisitor visitAnnotation(final String desc, boolean visible)
+ {
+ checkEnd();
+ CheckMethodAdapter.checkDesc(desc, false);
+ return new CheckAnnotationAdapter(fv.visitAnnotation(desc, visible));
+ }
+
+ public void visitAttribute(final Attribute attr) {
+ checkEnd();
+ if (attr == null) {
+ throw new IllegalArgumentException("Invalid attribute (must not be null)");
+ }
+ fv.visitAttribute(attr);
+ }
+
+ public void visitEnd() {
+ checkEnd();
+ end = true;
+ fv.visitEnd();
+ }
+
+ private void checkEnd() {
+ if (end) {
+ throw new IllegalStateException("Cannot call a visit method after visitEnd has been called");
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckMethodAdapter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckMethodAdapter.java
new file mode 100644
index 00000000000..1cd77c676ad
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/CheckMethodAdapter.java
@@ -0,0 +1,942 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodAdapter;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.Type;
+
+import java.util.HashMap;
+
+/**
+ * A {@link MethodAdapter} that checks that its methods are properly used. More
+ * precisely this code adapter checks each instruction individually (i.e., each
+ * visit method checks some preconditions based <i>only</i> on its arguments -
+ * such as the fact that the given opcode is correct for a given visit method),
+ * but does <i>not</i> check the <i>sequence</i> of instructions. For example,
+ * in a method whose signature is <tt>void m ()</tt>, the invalid instruction
+ * IRETURN, or the invalid sequence IADD L2I will <i>not</i> be detected by
+ * this code adapter.
+ *
+ * @author Eric Bruneton
+ */
+public class CheckMethodAdapter extends MethodAdapter {
+
+ /**
+ * <tt>true</tt> if the visitCode method has been called.
+ */
+ private boolean startCode;
+
+ /**
+ * <tt>true</tt> if the visitMaxs method has been called.
+ */
+ private boolean endCode;
+
+ /**
+ * <tt>true</tt> if the visitEnd method has been called.
+ */
+ private boolean endMethod;
+
+ /**
+ * The already visited labels. This map associate Integer values to Label
+ * keys.
+ */
+ private HashMap labels;
+
+ /**
+ * Code of the visit method to be used for each opcode.
+ */
+ private final static int[] TYPE;
+
+ static {
+ String s = "BBBBBBBBBBBBBBBBCCIAADDDDDAAAAAAAAAAAAAAAAAAAABBBBBBBBDD"
+ + "DDDAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
+ + "BBBBBBBBBBBBBBBBBBBJBBBBBBBBBBBBBBBBBBBBHHHHHHHHHHHHHHHHD"
+ + "KLBBBBBBFFFFGGGGAECEBBEEBBAMHHAA";
+ TYPE = new int[s.length()];
+ for (int i = 0; i < TYPE.length; ++i) {
+ TYPE[i] = (s.charAt(i) - 'A' - 1);
+ }
+ }
+
+ // code to generate the above string
+ // public static void main (String[] args) {
+ // int[] TYPE = new int[] {
+ // 0, //NOP
+ // 0, //ACONST_NULL
+ // 0, //ICONST_M1
+ // 0, //ICONST_0
+ // 0, //ICONST_1
+ // 0, //ICONST_2
+ // 0, //ICONST_3
+ // 0, //ICONST_4
+ // 0, //ICONST_5
+ // 0, //LCONST_0
+ // 0, //LCONST_1
+ // 0, //FCONST_0
+ // 0, //FCONST_1
+ // 0, //FCONST_2
+ // 0, //DCONST_0
+ // 0, //DCONST_1
+ // 1, //BIPUSH
+ // 1, //SIPUSH
+ // 7, //LDC
+ // -1, //LDC_W
+ // -1, //LDC2_W
+ // 2, //ILOAD
+ // 2, //LLOAD
+ // 2, //FLOAD
+ // 2, //DLOAD
+ // 2, //ALOAD
+ // -1, //ILOAD_0
+ // -1, //ILOAD_1
+ // -1, //ILOAD_2
+ // -1, //ILOAD_3
+ // -1, //LLOAD_0
+ // -1, //LLOAD_1
+ // -1, //LLOAD_2
+ // -1, //LLOAD_3
+ // -1, //FLOAD_0
+ // -1, //FLOAD_1
+ // -1, //FLOAD_2
+ // -1, //FLOAD_3
+ // -1, //DLOAD_0
+ // -1, //DLOAD_1
+ // -1, //DLOAD_2
+ // -1, //DLOAD_3
+ // -1, //ALOAD_0
+ // -1, //ALOAD_1
+ // -1, //ALOAD_2
+ // -1, //ALOAD_3
+ // 0, //IALOAD
+ // 0, //LALOAD
+ // 0, //FALOAD
+ // 0, //DALOAD
+ // 0, //AALOAD
+ // 0, //BALOAD
+ // 0, //CALOAD
+ // 0, //SALOAD
+ // 2, //ISTORE
+ // 2, //LSTORE
+ // 2, //FSTORE
+ // 2, //DSTORE
+ // 2, //ASTORE
+ // -1, //ISTORE_0
+ // -1, //ISTORE_1
+ // -1, //ISTORE_2
+ // -1, //ISTORE_3
+ // -1, //LSTORE_0
+ // -1, //LSTORE_1
+ // -1, //LSTORE_2
+ // -1, //LSTORE_3
+ // -1, //FSTORE_0
+ // -1, //FSTORE_1
+ // -1, //FSTORE_2
+ // -1, //FSTORE_3
+ // -1, //DSTORE_0
+ // -1, //DSTORE_1
+ // -1, //DSTORE_2
+ // -1, //DSTORE_3
+ // -1, //ASTORE_0
+ // -1, //ASTORE_1
+ // -1, //ASTORE_2
+ // -1, //ASTORE_3
+ // 0, //IASTORE
+ // 0, //LASTORE
+ // 0, //FASTORE
+ // 0, //DASTORE
+ // 0, //AASTORE
+ // 0, //BASTORE
+ // 0, //CASTORE
+ // 0, //SASTORE
+ // 0, //POP
+ // 0, //POP2
+ // 0, //DUP
+ // 0, //DUP_X1
+ // 0, //DUP_X2
+ // 0, //DUP2
+ // 0, //DUP2_X1
+ // 0, //DUP2_X2
+ // 0, //SWAP
+ // 0, //IADD
+ // 0, //LADD
+ // 0, //FADD
+ // 0, //DADD
+ // 0, //ISUB
+ // 0, //LSUB
+ // 0, //FSUB
+ // 0, //DSUB
+ // 0, //IMUL
+ // 0, //LMUL
+ // 0, //FMUL
+ // 0, //DMUL
+ // 0, //IDIV
+ // 0, //LDIV
+ // 0, //FDIV
+ // 0, //DDIV
+ // 0, //IREM
+ // 0, //LREM
+ // 0, //FREM
+ // 0, //DREM
+ // 0, //INEG
+ // 0, //LNEG
+ // 0, //FNEG
+ // 0, //DNEG
+ // 0, //ISHL
+ // 0, //LSHL
+ // 0, //ISHR
+ // 0, //LSHR
+ // 0, //IUSHR
+ // 0, //LUSHR
+ // 0, //IAND
+ // 0, //LAND
+ // 0, //IOR
+ // 0, //LOR
+ // 0, //IXOR
+ // 0, //LXOR
+ // 8, //IINC
+ // 0, //I2L
+ // 0, //I2F
+ // 0, //I2D
+ // 0, //L2I
+ // 0, //L2F
+ // 0, //L2D
+ // 0, //F2I
+ // 0, //F2L
+ // 0, //F2D
+ // 0, //D2I
+ // 0, //D2L
+ // 0, //D2F
+ // 0, //I2B
+ // 0, //I2C
+ // 0, //I2S
+ // 0, //LCMP
+ // 0, //FCMPL
+ // 0, //FCMPG
+ // 0, //DCMPL
+ // 0, //DCMPG
+ // 6, //IFEQ
+ // 6, //IFNE
+ // 6, //IFLT
+ // 6, //IFGE
+ // 6, //IFGT
+ // 6, //IFLE
+ // 6, //IF_ICMPEQ
+ // 6, //IF_ICMPNE
+ // 6, //IF_ICMPLT
+ // 6, //IF_ICMPGE
+ // 6, //IF_ICMPGT
+ // 6, //IF_ICMPLE
+ // 6, //IF_ACMPEQ
+ // 6, //IF_ACMPNE
+ // 6, //GOTO
+ // 6, //JSR
+ // 2, //RET
+ // 9, //TABLESWITCH
+ // 10, //LOOKUPSWITCH
+ // 0, //IRETURN
+ // 0, //LRETURN
+ // 0, //FRETURN
+ // 0, //DRETURN
+ // 0, //ARETURN
+ // 0, //RETURN
+ // 4, //GETSTATIC
+ // 4, //PUTSTATIC
+ // 4, //GETFIELD
+ // 4, //PUTFIELD
+ // 5, //INVOKEVIRTUAL
+ // 5, //INVOKESPECIAL
+ // 5, //INVOKESTATIC
+ // 5, //INVOKEINTERFACE
+ // -1, //UNUSED
+ // 3, //NEW
+ // 1, //NEWARRAY
+ // 3, //ANEWARRAY
+ // 0, //ARRAYLENGTH
+ // 0, //ATHROW
+ // 3, //CHECKCAST
+ // 3, //INSTANCEOF
+ // 0, //MONITORENTER
+ // 0, //MONITOREXIT
+ // -1, //WIDE
+ // 11, //MULTIANEWARRAY
+ // 6, //IFNULL
+ // 6, //IFNONNULL
+ // -1, //GOTO_W
+ // -1 //JSR_W
+ // };
+ // for (int i = 0; i < TYPE.length; ++i) {
+ // System.out.print((char)(TYPE[i] + 1 + 'A'));
+ // }
+ // System.out.println();
+ // }
+
+ /**
+ * Constructs a new {@link CheckMethodAdapter} object.
+ *
+ * @param cv the code visitor to which this adapter must delegate calls.
+ */
+ public CheckMethodAdapter(final MethodVisitor cv) {
+ super(cv);
+ this.labels = new HashMap();
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ checkEndMethod();
+ checkDesc(desc, false);
+ return new CheckAnnotationAdapter(mv.visitAnnotation(desc, visible));
+ }
+
+ public AnnotationVisitor visitAnnotationDefault() {
+ checkEndMethod();
+ return new CheckAnnotationAdapter(mv.visitAnnotationDefault(), false);
+ }
+
+ public AnnotationVisitor visitParameterAnnotation(
+ final int parameter,
+ final String desc,
+ final boolean visible)
+ {
+ checkEndMethod();
+ checkDesc(desc, false);
+ return new CheckAnnotationAdapter(mv.visitParameterAnnotation(parameter,
+ desc,
+ visible));
+ }
+
+ public void visitAttribute(final Attribute attr) {
+ checkEndMethod();
+ if (attr == null) {
+ throw new IllegalArgumentException("Invalid attribute (must not be null)");
+ }
+ mv.visitAttribute(attr);
+ }
+
+ public void visitCode() {
+ startCode = true;
+ mv.visitCode();
+ }
+
+ public void visitInsn(final int opcode) {
+ checkStartCode();
+ checkEndCode();
+ checkOpcode(opcode, 0);
+ mv.visitInsn(opcode);
+ }
+
+ public void visitIntInsn(final int opcode, final int operand) {
+ checkStartCode();
+ checkEndCode();
+ checkOpcode(opcode, 1);
+ switch (opcode) {
+ case Opcodes.BIPUSH:
+ checkSignedByte(operand, "Invalid operand");
+ break;
+ case Opcodes.SIPUSH:
+ checkSignedShort(operand, "Invalid operand");
+ break;
+ // case Constants.NEWARRAY:
+ default:
+ if (operand < Opcodes.T_BOOLEAN || operand > Opcodes.T_LONG) {
+ throw new IllegalArgumentException("Invalid operand (must be an array type code T_...): "
+ + operand);
+ }
+ }
+ mv.visitIntInsn(opcode, operand);
+ }
+
+ public void visitVarInsn(final int opcode, final int var) {
+ checkStartCode();
+ checkEndCode();
+ checkOpcode(opcode, 2);
+ checkUnsignedShort(var, "Invalid variable index");
+ mv.visitVarInsn(opcode, var);
+ }
+
+ public void visitTypeInsn(final int opcode, final String desc) {
+ checkStartCode();
+ checkEndCode();
+ checkOpcode(opcode, 3);
+ if (desc != null && desc.length() > 0 && desc.charAt(0) == '[') {
+ checkDesc(desc, false);
+ } else {
+ checkInternalName(desc, "type");
+ }
+ if (opcode == Opcodes.NEW && desc.charAt(0) == '[') {
+ throw new IllegalArgumentException("NEW cannot be used to create arrays: "
+ + desc);
+ }
+ mv.visitTypeInsn(opcode, desc);
+ }
+
+ public void visitFieldInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ checkStartCode();
+ checkEndCode();
+ checkOpcode(opcode, 4);
+ checkInternalName(owner, "owner");
+ checkIdentifier(name, "name");
+ checkDesc(desc, false);
+ mv.visitFieldInsn(opcode, owner, name, desc);
+ }
+
+ public void visitMethodInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ checkStartCode();
+ checkEndCode();
+ checkOpcode(opcode, 5);
+ checkMethodIdentifier(name, "name");
+ if (!name.equals("clone")) {
+ // In JDK1.5, clone method can be called on array class descriptors
+ checkInternalName(owner, "owner");
+ }
+ checkMethodDesc(desc);
+ mv.visitMethodInsn(opcode, owner, name, desc);
+ }
+
+ public void visitJumpInsn(final int opcode, final Label label) {
+ checkStartCode();
+ checkEndCode();
+ checkOpcode(opcode, 6);
+ checkLabel(label, false, "label");
+ mv.visitJumpInsn(opcode, label);
+ }
+
+ public void visitLabel(final Label label) {
+ checkStartCode();
+ checkEndCode();
+ checkLabel(label, false, "label");
+ if (labels.get(label) != null) {
+ throw new IllegalArgumentException("Already visited label");
+ } else {
+ labels.put(label, new Integer(labels.size()));
+ }
+ mv.visitLabel(label);
+ }
+
+ public void visitLdcInsn(final Object cst) {
+ checkStartCode();
+ checkEndCode();
+ if (!(cst instanceof Type)) {
+ checkConstant(cst);
+ }
+ mv.visitLdcInsn(cst);
+ }
+
+ public void visitIincInsn(final int var, final int increment) {
+ checkStartCode();
+ checkEndCode();
+ checkUnsignedShort(var, "Invalid variable index");
+ checkSignedShort(increment, "Invalid increment");
+ mv.visitIincInsn(var, increment);
+ }
+
+ public void visitTableSwitchInsn(
+ final int min,
+ final int max,
+ final Label dflt,
+ final Label labels[])
+ {
+ checkStartCode();
+ checkEndCode();
+ if (max < min) {
+ throw new IllegalArgumentException("Max = " + max
+ + " must be greater than or equal to min = " + min);
+ }
+ checkLabel(dflt, false, "default label");
+ if (labels == null || labels.length != max - min + 1) {
+ throw new IllegalArgumentException("There must be max - min + 1 labels");
+ }
+ for (int i = 0; i < labels.length; ++i) {
+ checkLabel(labels[i], false, "label at index " + i);
+ }
+ mv.visitTableSwitchInsn(min, max, dflt, labels);
+ }
+
+ public void visitLookupSwitchInsn(
+ final Label dflt,
+ final int keys[],
+ final Label labels[])
+ {
+ checkEndCode();
+ checkStartCode();
+ checkLabel(dflt, false, "default label");
+ if (keys == null || labels == null || keys.length != labels.length) {
+ throw new IllegalArgumentException("There must be the same number of keys and labels");
+ }
+ for (int i = 0; i < labels.length; ++i) {
+ checkLabel(labels[i], false, "label at index " + i);
+ }
+ mv.visitLookupSwitchInsn(dflt, keys, labels);
+ }
+
+ public void visitMultiANewArrayInsn(final String desc, final int dims) {
+ checkStartCode();
+ checkEndCode();
+ checkDesc(desc, false);
+ if (desc.charAt(0) != '[') {
+ throw new IllegalArgumentException("Invalid descriptor (must be an array type descriptor): "
+ + desc);
+ }
+ if (dims < 1) {
+ throw new IllegalArgumentException("Invalid dimensions (must be greater than 0): "
+ + dims);
+ }
+ if (dims > desc.lastIndexOf('[') + 1) {
+ throw new IllegalArgumentException("Invalid dimensions (must not be greater than dims(desc)): "
+ + dims);
+ }
+ mv.visitMultiANewArrayInsn(desc, dims);
+ }
+
+ public void visitTryCatchBlock(
+ final Label start,
+ final Label end,
+ final Label handler,
+ final String type)
+ {
+ checkStartCode();
+ checkEndCode();
+ if (type != null) {
+ checkInternalName(type, "type");
+ }
+ mv.visitTryCatchBlock(start, end, handler, type);
+ }
+
+ public void visitLocalVariable(
+ final String name,
+ final String desc,
+ final String signature,
+ final Label start,
+ final Label end,
+ final int index)
+ {
+ checkStartCode();
+ checkEndCode();
+ checkIdentifier(name, "name");
+ checkDesc(desc, false);
+ checkLabel(start, true, "start label");
+ checkLabel(end, true, "end label");
+ checkUnsignedShort(index, "Invalid variable index");
+ int s = ((Integer) labels.get(start)).intValue();
+ int e = ((Integer) labels.get(end)).intValue();
+ if (e < s) {
+ throw new IllegalArgumentException("Invalid start and end labels (end must be greater than start)");
+ }
+ mv.visitLocalVariable(name, desc, signature, start, end, index);
+ }
+
+ public void visitLineNumber(final int line, final Label start) {
+ checkStartCode();
+ checkEndCode();
+ checkUnsignedShort(line, "Invalid line number");
+ checkLabel(start, true, "start label");
+ mv.visitLineNumber(line, start);
+ }
+
+ public void visitMaxs(final int maxStack, final int maxLocals) {
+ checkStartCode();
+ checkEndCode();
+ endCode = true;
+ checkUnsignedShort(maxStack, "Invalid max stack");
+ checkUnsignedShort(maxLocals, "Invalid max locals");
+ mv.visitMaxs(maxStack, maxLocals);
+ }
+
+ public void visitEnd() {
+ checkEndMethod();
+ endMethod = true;
+ mv.visitEnd();
+ }
+
+ // -------------------------------------------------------------------------
+
+ /**
+ * Checks that the visitCode method has been called.
+ */
+ void checkStartCode() {
+ if (!startCode) {
+ throw new IllegalStateException("Cannot visit instructions before visitCode has been called.");
+ }
+ }
+
+ /**
+ * Checks that the visitMaxs method has not been called.
+ */
+ void checkEndCode() {
+ if (endCode) {
+ throw new IllegalStateException("Cannot visit instructions after visitMaxs has been called.");
+ }
+ }
+
+ /**
+ * Checks that the visitEnd method has not been called.
+ */
+ void checkEndMethod() {
+ if (endMethod) {
+ throw new IllegalStateException("Cannot visit elements after visitEnd has been called.");
+ }
+ }
+
+ /**
+ * Checks that the type of the given opcode is equal to the given type.
+ *
+ * @param opcode the opcode to be checked.
+ * @param type the expected opcode type.
+ */
+ static void checkOpcode(final int opcode, final int type) {
+ if (opcode < 0 || opcode > 199 || TYPE[opcode] != type) {
+ throw new IllegalArgumentException("Invalid opcode: " + opcode);
+ }
+ }
+
+ /**
+ * Checks that the given value is a signed byte.
+ *
+ * @param value the value to be checked.
+ * @param msg an message to be used in case of error.
+ */
+ static void checkSignedByte(final int value, final String msg) {
+ if (value < Byte.MIN_VALUE || value > Byte.MAX_VALUE) {
+ throw new IllegalArgumentException(msg
+ + " (must be a signed byte): " + value);
+ }
+ }
+
+ /**
+ * Checks that the given value is a signed short.
+ *
+ * @param value the value to be checked.
+ * @param msg an message to be used in case of error.
+ */
+ static void checkSignedShort(final int value, final String msg) {
+ if (value < Short.MIN_VALUE || value > Short.MAX_VALUE) {
+ throw new IllegalArgumentException(msg
+ + " (must be a signed short): " + value);
+ }
+ }
+
+ /**
+ * Checks that the given value is an unsigned short.
+ *
+ * @param value the value to be checked.
+ * @param msg an message to be used in case of error.
+ */
+ static void checkUnsignedShort(final int value, final String msg) {
+ if (value < 0 || value > 65535) {
+ throw new IllegalArgumentException(msg
+ + " (must be an unsigned short): " + value);
+ }
+ }
+
+ /**
+ * Checks that the given value is an {@link Integer}, a{@link Float}, a
+ * {@link Long}, a {@link Double} or a {@link String}.
+ *
+ * @param cst the value to be checked.
+ */
+ static void checkConstant(final Object cst) {
+ if (!(cst instanceof Integer) && !(cst instanceof Float)
+ && !(cst instanceof Long) && !(cst instanceof Double)
+ && !(cst instanceof String))
+ {
+ throw new IllegalArgumentException("Invalid constant: " + cst);
+ }
+ }
+
+ /**
+ * Checks that the given string is a valid Java identifier.
+ *
+ * @param name the string to be checked.
+ * @param msg a message to be used in case of error.
+ */
+ static void checkIdentifier(final String name, final String msg) {
+ checkIdentifier(name, 0, -1, msg);
+ }
+
+ /**
+ * Checks that the given substring is a valid Java identifier.
+ *
+ * @param name the string to be checked.
+ * @param start index of the first character of the identifier (inclusive).
+ * @param end index of the last character of the identifier (exclusive). -1
+ * is equivalent to <tt>name.length()</tt> if name is not
+ * <tt>null</tt>.
+ * @param msg a message to be used in case of error.
+ */
+ static void checkIdentifier(
+ final String name,
+ final int start,
+ final int end,
+ final String msg)
+ {
+ if (name == null || (end == -1 ? name.length() <= start : end <= start))
+ {
+ throw new IllegalArgumentException("Invalid " + msg
+ + " (must not be null or empty)");
+ }
+ if (!Character.isJavaIdentifierStart(name.charAt(start))) {
+ throw new IllegalArgumentException("Invalid " + msg
+ + " (must be a valid Java identifier): " + name);
+ }
+ int max = (end == -1 ? name.length() : end);
+ for (int i = start + 1; i < max; ++i) {
+ if (!Character.isJavaIdentifierPart(name.charAt(i))) {
+ throw new IllegalArgumentException("Invalid " + msg
+ + " (must be a valid Java identifier): " + name);
+ }
+ }
+ }
+
+ /**
+ * Checks that the given string is a valid Java identifier or is equal to
+ * '&lt;init&gt;' or '&lt;clinit&gt;'.
+ *
+ * @param name the string to be checked.
+ * @param msg a message to be used in case of error.
+ */
+ static void checkMethodIdentifier(final String name, final String msg) {
+ if (name == null || name.length() == 0) {
+ throw new IllegalArgumentException("Invalid " + msg
+ + " (must not be null or empty)");
+ }
+ if (name.equals("<init>") || name.equals("<clinit>")) {
+ return;
+ }
+ if (!Character.isJavaIdentifierStart(name.charAt(0))) {
+ throw new IllegalArgumentException("Invalid "
+ + msg
+ + " (must be a '<init>', '<clinit>' or a valid Java identifier): "
+ + name);
+ }
+ for (int i = 1; i < name.length(); ++i) {
+ if (!Character.isJavaIdentifierPart(name.charAt(i))) {
+ throw new IllegalArgumentException("Invalid "
+ + msg
+ + " (must be '<init>' or '<clinit>' or a valid Java identifier): "
+ + name);
+ }
+ }
+ }
+
+ /**
+ * Checks that the given string is a valid internal class name.
+ *
+ * @param name the string to be checked.
+ * @param msg a message to be used in case of error.
+ */
+ static void checkInternalName(final String name, final String msg) {
+ checkInternalName(name, 0, -1, msg);
+ }
+
+ /**
+ * Checks that the given substring is a valid internal class name.
+ *
+ * @param name the string to be checked.
+ * @param start index of the first character of the identifier (inclusive).
+ * @param end index of the last character of the identifier (exclusive). -1
+ * is equivalent to <tt>name.length()</tt> if name is not
+ * <tt>null</tt>.
+ * @param msg a message to be used in case of error.
+ */
+ static void checkInternalName(
+ final String name,
+ final int start,
+ final int end,
+ final String msg)
+ {
+ if (name == null || name.length() == 0) {
+ throw new IllegalArgumentException("Invalid " + msg
+ + " (must not be null or empty)");
+ }
+ int max = (end == -1 ? name.length() : end);
+ try {
+ int begin = start;
+ int slash;
+ do {
+ slash = name.indexOf('/', begin + 1);
+ if (slash == -1 || slash > max) {
+ slash = max;
+ }
+ checkIdentifier(name, begin, slash, null);
+ begin = slash + 1;
+ } while (slash != max);
+ } catch (IllegalArgumentException _) {
+ throw new IllegalArgumentException("Invalid "
+ + msg
+ + " (must be a fully qualified class name in internal form): "
+ + name);
+ }
+ }
+
+ /**
+ * Checks that the given string is a valid type descriptor.
+ *
+ * @param desc the string to be checked.
+ * @param canBeVoid <tt>true</tt> if <tt>V</tt> can be considered valid.
+ */
+ static void checkDesc(final String desc, final boolean canBeVoid) {
+ int end = checkDesc(desc, 0, canBeVoid);
+ if (end != desc.length()) {
+ throw new IllegalArgumentException("Invalid descriptor: " + desc);
+ }
+ }
+
+ /**
+ * Checks that a the given substring is a valid type descriptor.
+ *
+ * @param desc the string to be checked.
+ * @param start index of the first character of the identifier (inclusive).
+ * @param canBeVoid <tt>true</tt> if <tt>V</tt> can be considered valid.
+ * @return the index of the last character of the type decriptor, plus one.
+ */
+ static int checkDesc(
+ final String desc,
+ final int start,
+ final boolean canBeVoid)
+ {
+ if (desc == null || start >= desc.length()) {
+ throw new IllegalArgumentException("Invalid type descriptor (must not be null or empty)");
+ }
+ int index;
+ switch (desc.charAt(start)) {
+ case 'V':
+ if (canBeVoid) {
+ return start + 1;
+ } else {
+ throw new IllegalArgumentException("Invalid descriptor: "
+ + desc);
+ }
+ case 'Z':
+ case 'C':
+ case 'B':
+ case 'S':
+ case 'I':
+ case 'F':
+ case 'J':
+ case 'D':
+ return start + 1;
+ case '[':
+ index = start + 1;
+ while (index < desc.length() && desc.charAt(index) == '[') {
+ ++index;
+ }
+ if (index < desc.length()) {
+ return checkDesc(desc, index, false);
+ } else {
+ throw new IllegalArgumentException("Invalid descriptor: "
+ + desc);
+ }
+ case 'L':
+ index = desc.indexOf(';', start);
+ if (index == -1 || index - start < 2) {
+ throw new IllegalArgumentException("Invalid descriptor: "
+ + desc);
+ }
+ try {
+ checkInternalName(desc, start + 1, index, null);
+ } catch (IllegalArgumentException _) {
+ throw new IllegalArgumentException("Invalid descriptor: "
+ + desc);
+ }
+ return index + 1;
+ default:
+ throw new IllegalArgumentException("Invalid descriptor: "
+ + desc);
+ }
+ }
+
+ /**
+ * Checks that the given string is a valid method descriptor.
+ *
+ * @param desc the string to be checked.
+ */
+ static void checkMethodDesc(final String desc) {
+ if (desc == null || desc.length() == 0) {
+ throw new IllegalArgumentException("Invalid method descriptor (must not be null or empty)");
+ }
+ if (desc.charAt(0) != '(' || desc.length() < 3) {
+ throw new IllegalArgumentException("Invalid descriptor: " + desc);
+ }
+ int start = 1;
+ if (desc.charAt(start) != ')') {
+ do {
+ if (desc.charAt(start) == 'V') {
+ throw new IllegalArgumentException("Invalid descriptor: "
+ + desc);
+ }
+ start = checkDesc(desc, start, false);
+ } while (start < desc.length() && desc.charAt(start) != ')');
+ }
+ start = checkDesc(desc, start + 1, true);
+ if (start != desc.length()) {
+ throw new IllegalArgumentException("Invalid descriptor: " + desc);
+ }
+ }
+
+ /**
+ * Checks that the given label is not null. This method can also check that
+ * the label has been visited.
+ *
+ * @param label the label to be checked.
+ * @param checkVisited <tt>true</tt> to check that the label has been
+ * visited.
+ * @param msg a message to be used in case of error.
+ */
+ void checkLabel(
+ final Label label,
+ final boolean checkVisited,
+ final String msg)
+ {
+ if (label == null) {
+ throw new IllegalArgumentException("Invalid " + msg
+ + " (must not be null)");
+ }
+ if (checkVisited && labels.get(label) == null) {
+ throw new IllegalArgumentException("Invalid " + msg
+ + " (must be visited first)");
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceAbstractVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceAbstractVisitor.java
new file mode 100644
index 00000000000..4250c815c9a
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceAbstractVisitor.java
@@ -0,0 +1,180 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.util.attrs.Traceable;
+
+/**
+ * An abstract trace visitor.
+ *
+ * @author Eric Bruneton
+ */
+public abstract class TraceAbstractVisitor extends AbstractVisitor {
+
+ /**
+ * Constant used in {@link #appendDescriptor appendDescriptor} for internal
+ * type names in bytecode notation.
+ */
+ public final static int INTERNAL_NAME = 0;
+
+ /**
+ * Constant used in {@link #appendDescriptor appendDescriptor} for field
+ * descriptors, formatted in bytecode notation
+ */
+ public final static int FIELD_DESCRIPTOR = 1;
+
+ /**
+ * Constant used in {@link #appendDescriptor appendDescriptor} for field
+ * signatures, formatted in bytecode notation
+ */
+ public final static int FIELD_SIGNATURE = 2;
+
+ /**
+ * Constant used in {@link #appendDescriptor appendDescriptor} for method
+ * descriptors, formatted in bytecode notation
+ */
+ public final static int METHOD_DESCRIPTOR = 3;
+
+ /**
+ * Constant used in {@link #appendDescriptor appendDescriptor} for method
+ * signatures, formatted in bytecode notation
+ */
+ public final static int METHOD_SIGNATURE = 4;
+
+ /**
+ * Constant used in {@link #appendDescriptor appendDescriptor} for class
+ * signatures, formatted in bytecode notation
+ */
+ public final static int CLASS_SIGNATURE = 5;
+
+ /**
+ * Constant used in {@link #appendDescriptor appendDescriptor} for field or
+ * method return value signatures, formatted in default Java notation
+ * (non-bytecode)
+ */
+ public final static int TYPE_DECLARATION = 6;
+
+ /**
+ * Constant used in {@link #appendDescriptor appendDescriptor} for class
+ * signatures, formatted in default Java notation (non-bytecode)
+ */
+ public final static int CLASS_DECLARATION = 7;
+
+ /**
+ * Constant used in {@link #appendDescriptor appendDescriptor} for method
+ * parameter signatures, formatted in default Java notation (non-bytecode)
+ */
+ public final static int PARAMETERS_DECLARATION = 8;
+
+ /**
+ * Tab for class members.
+ */
+ protected String tab = " ";
+
+ /**
+ * Prints a disassembled view of the given annotation.
+ *
+ * @param desc the class descriptor of the annotation class.
+ * @param visible <tt>true</tt> if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values.
+ */
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ buf.setLength(0);
+ buf.append(tab).append('@');
+ appendDescriptor(FIELD_DESCRIPTOR, desc);
+ buf.append('(');
+ text.add(buf.toString());
+ TraceAnnotationVisitor tav = createTraceAnnotationVisitor();
+ text.add(tav.getText());
+ text.add(visible ? ")\n" : ") // invisible\n");
+ return tav;
+ }
+
+ /**
+ * Prints a disassembled view of the given attribute.
+ *
+ * @param attr an attribute.
+ */
+ public void visitAttribute(final Attribute attr) {
+ buf.setLength(0);
+ buf.append(tab).append("ATTRIBUTE ");
+ appendDescriptor(-1, attr.type);
+
+ if (attr instanceof Traceable) {
+ ((Traceable) attr).trace(buf, null);
+ } else {
+ buf.append(" : ").append(attr.toString()).append("\n");
+ }
+
+ text.add(buf.toString());
+ }
+
+ /**
+ * Does nothing.
+ */
+ public void visitEnd() {
+ // does nothing
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods
+ // ------------------------------------------------------------------------
+
+ protected TraceAnnotationVisitor createTraceAnnotationVisitor() {
+ return new TraceAnnotationVisitor();
+ }
+
+ /**
+ * Appends an internal name, a type descriptor or a type signature to
+ * {@link #buf buf}.
+ *
+ * @param type indicates if desc is an internal name, a field descriptor, a
+ * method descriptor, a class signature, ...
+ * @param desc an internal name, type descriptor, or type signature. May be
+ * <tt>null</tt>.
+ */
+ protected void appendDescriptor(final int type, final String desc) {
+ if (type == CLASS_SIGNATURE || type == FIELD_SIGNATURE
+ || type == METHOD_SIGNATURE)
+ {
+ if (desc != null) {
+ buf.append("// signature ").append(desc).append('\n');
+ }
+ } else {
+ buf.append(desc);
+ }
+ }
+
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceAnnotationVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceAnnotationVisitor.java
new file mode 100644
index 00000000000..827225b1ca3
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceAnnotationVisitor.java
@@ -0,0 +1,272 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Type;
+
+/**
+ * An {@link AnnotationVisitor} that prints a disassembled view of the
+ * annotations it visits.
+ *
+ * @author Eric Bruneton
+ */
+public class TraceAnnotationVisitor extends TraceAbstractVisitor implements
+ AnnotationVisitor
+{
+
+ /**
+ * The {@link AnnotationVisitor} to which this visitor delegates calls. May
+ * be <tt>null</tt>.
+ */
+ protected AnnotationVisitor av;
+
+ private int valueNumber = 0;
+
+ /**
+ * Constructs a new {@link TraceAnnotationVisitor}.
+ */
+ public TraceAnnotationVisitor() {
+ // ignore
+ }
+
+ // ------------------------------------------------------------------------
+ // Implementation of the AnnotationVisitor interface
+ // ------------------------------------------------------------------------
+
+ public void visit(final String name, final Object value) {
+ buf.setLength(0);
+ appendComa(valueNumber++);
+
+ if (name != null) {
+ buf.append(name).append('=');
+ }
+
+ if (value instanceof String) {
+ visitString((String) value);
+ } else if (value instanceof Type) {
+ visitType((Type) value);
+ } else if (value instanceof Byte) {
+ visitByte(((Byte) value).byteValue());
+ } else if (value instanceof Boolean) {
+ visitBoolean(((Boolean) value).booleanValue());
+ } else if (value instanceof Short) {
+ visitShort(((Short) value).shortValue());
+ } else if (value instanceof Character) {
+ visitChar(((Character) value).charValue());
+ } else if (value instanceof Integer) {
+ visitInt(((Integer) value).intValue());
+ } else if (value instanceof Float) {
+ visitFloat(((Float) value).floatValue());
+ } else if (value instanceof Long) {
+ visitLong(((Long) value).longValue());
+ } else if (value instanceof Double) {
+ visitDouble(((Double) value).doubleValue());
+ } else if (value.getClass().isArray()) {
+ buf.append('{');
+ if (value instanceof byte[]) {
+ byte[] v = (byte[]) value;
+ for (int i = 0; i < v.length; i++) {
+ appendComa(i);
+ visitByte(v[i]);
+ }
+ } else if (value instanceof boolean[]) {
+ boolean[] v = (boolean[]) value;
+ for (int i = 0; i < v.length; i++) {
+ appendComa(i);
+ visitBoolean(v[i]);
+ }
+ } else if (value instanceof short[]) {
+ short[] v = (short[]) value;
+ for (int i = 0; i < v.length; i++) {
+ appendComa(i);
+ visitShort(v[i]);
+ }
+ } else if (value instanceof char[]) {
+ char[] v = (char[]) value;
+ for (int i = 0; i < v.length; i++) {
+ appendComa(i);
+ visitChar(v[i]);
+ }
+ } else if (value instanceof int[]) {
+ int[] v = (int[]) value;
+ for (int i = 0; i < v.length; i++) {
+ appendComa(i);
+ visitInt(v[i]);
+ }
+ } else if (value instanceof long[]) {
+ long[] v = (long[]) value;
+ for (int i = 0; i < v.length; i++) {
+ appendComa(i);
+ visitLong(v[i]);
+ }
+ } else if (value instanceof float[]) {
+ float[] v = (float[]) value;
+ for (int i = 0; i < v.length; i++) {
+ appendComa(i);
+ visitFloat(v[i]);
+ }
+ } else if (value instanceof double[]) {
+ double[] v = (double[]) value;
+ for (int i = 0; i < v.length; i++) {
+ appendComa(i);
+ visitDouble(v[i]);
+ }
+ }
+ buf.append('}');
+ } else {
+ buf.append(value);
+ }
+
+ text.add(buf.toString());
+
+ if (av != null) {
+ av.visit(name, value);
+ }
+ }
+
+ private void visitInt(int value) {
+ buf.append(value);
+ }
+
+ private void visitLong(long value) {
+ buf.append(value).append('L');
+ }
+
+ private void visitFloat(float value) {
+ buf.append(value).append('F');
+ }
+
+ private void visitDouble(double value) {
+ buf.append(value).append('D');
+ }
+
+ private void visitChar(char value) {
+ buf.append("(char)").append((int) value);
+ }
+
+ private void visitShort(short value) {
+ buf.append("(short)").append(value);
+ }
+
+ private void visitByte(byte value) {
+ buf.append("(byte)").append(value);
+ }
+
+ private void visitBoolean(boolean value) {
+ buf.append(value);
+ }
+
+ private void visitString(String value) {
+ appendString(buf, value);
+ }
+
+ private void visitType(Type value) {
+ buf.append(value.getClassName()).append(".class");
+ }
+
+ public void visitEnum(
+ final String name,
+ final String desc,
+ final String value)
+ {
+ buf.setLength(0);
+ appendComa(valueNumber++);
+ if (name != null) {
+ buf.append(name).append('=');
+ }
+ appendDescriptor(FIELD_DESCRIPTOR, desc);
+ buf.append('.').append(value);
+ text.add(buf.toString());
+
+ if (av != null) {
+ av.visitEnum(name, desc, value);
+ }
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String name,
+ final String desc)
+ {
+ buf.setLength(0);
+ appendComa(valueNumber++);
+ if (name != null) {
+ buf.append(name).append('=');
+ }
+ buf.append('@');
+ appendDescriptor(FIELD_DESCRIPTOR, desc);
+ buf.append('(');
+ text.add(buf.toString());
+ TraceAnnotationVisitor tav = createTraceAnnotationVisitor();
+ text.add(tav.getText());
+ text.add(")");
+ if (av != null) {
+ tav.av = av.visitAnnotation(name, desc);
+ }
+ return tav;
+ }
+
+ public AnnotationVisitor visitArray(final String name) {
+ buf.setLength(0);
+ appendComa(valueNumber++);
+ if (name != null) {
+ buf.append(name).append('=');
+ }
+ buf.append('{');
+ text.add(buf.toString());
+ TraceAnnotationVisitor tav = createTraceAnnotationVisitor();
+ text.add(tav.getText());
+ text.add("}");
+ if (av != null) {
+ tav.av = av.visitArray(name);
+ }
+ return tav;
+ }
+
+ public void visitEnd() {
+ if (av != null) {
+ av.visitEnd();
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods
+ // ------------------------------------------------------------------------
+
+ protected TraceAnnotationVisitor createTraceAnnotationVisitor() {
+ return new TraceAnnotationVisitor();
+ }
+
+ private void appendComa(int i) {
+ if (i != 0) {
+ buf.append(", ");
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceClassVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceClassVisitor.java
new file mode 100644
index 00000000000..9a727e50f38
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceClassVisitor.java
@@ -0,0 +1,534 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import java.io.FileInputStream;
+import java.io.PrintWriter;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.signature.SignatureReader;
+
+/**
+ * A {@link ClassVisitor} that prints a disassembled view of the classes it
+ * visits. This class visitor can be used alone (see the {@link #main main}
+ * method) to disassemble a class. It can also be used in the middle of class
+ * visitor chain to trace the class that is visited at a given point in this
+ * chain. This may be uselful for debugging purposes. <p> The trace printed when
+ * visiting the <tt>Hello</tt> class is the following: <p> <blockquote>
+ *
+ * <pre>
+ * // class version 49.0 (49)
+ * // access flags 33
+ * public class Hello {
+ *
+ * // compiled from: Hello.java
+ *
+ * // access flags 1
+ * public &lt;init&gt; ()V
+ * ALOAD 0
+ * INVOKESPECIAL java/lang/Object &lt;init&gt; ()V
+ * RETURN
+ * MAXSTACK = 1
+ * MAXLOCALS = 1
+ *
+ * // access flags 9
+ * public static main ([Ljava/lang/String;)V
+ * GETSTATIC java/lang/System out Ljava/io/PrintStream;
+ * LDC &quot;hello&quot;
+ * INVOKEVIRTUAL java/io/PrintStream println (Ljava/lang/String;)V
+ * RETURN
+ * MAXSTACK = 2
+ * MAXLOCALS = 1
+ * }
+ * </pre>
+ *
+ * </blockquote> where <tt>Hello</tt> is defined by: <p> <blockquote>
+ *
+ * <pre>
+ * public class Hello {
+ *
+ * public static void main(String[] args) {
+ * System.out.println(&quot;hello&quot;);
+ * }
+ * }
+ * </pre>
+ *
+ * </blockquote>
+ *
+ * @author Eric Bruneton
+ * @author Eugene Kuleshov
+ */
+public class TraceClassVisitor extends TraceAbstractVisitor implements
+ ClassVisitor
+{
+
+ /**
+ * The {@link ClassVisitor} to which this visitor delegates calls. May be
+ * <tt>null</tt>.
+ */
+ protected final ClassVisitor cv;
+
+ /**
+ * The print writer to be used to print the class.
+ */
+ protected final PrintWriter pw;
+
+ /**
+ * Prints a disassembled view of the given class to the standard output. <p>
+ * Usage: TraceClassVisitor [-debug] &lt;fully qualified class name or class
+ * file name &gt;
+ *
+ * @param args the command line arguments.
+ *
+ * @throws Exception if the class cannot be found, or if an IO exception
+ * occurs.
+ */
+ public static void main(final String[] args) throws Exception {
+ int i = 0;
+ boolean skipDebug = true;
+
+ boolean ok = true;
+ if (args.length < 1 || args.length > 2) {
+ ok = false;
+ }
+ if (ok && args[0].equals("-debug")) {
+ i = 1;
+ skipDebug = false;
+ if (args.length != 2) {
+ ok = false;
+ }
+ }
+ if (!ok) {
+ System.err.println("Prints a disassembled view of the given class.");
+ System.err.println("Usage: TraceClassVisitor [-debug] "
+ + "<fully qualified class name or class file name>");
+ return;
+ }
+ ClassReader cr;
+ if (args[i].endsWith(".class") || args[i].indexOf('\\') > -1
+ || args[i].indexOf('/') > -1)
+ {
+ cr = new ClassReader(new FileInputStream(args[i]));
+ } else {
+ cr = new ClassReader(args[i]);
+ }
+ cr.accept(new TraceClassVisitor(new PrintWriter(System.out)),
+ getDefaultAttributes(),
+ skipDebug);
+ }
+
+ /**
+ * Constructs a new {@link TraceClassVisitor}.
+ *
+ * @param pw the print writer to be used to print the class.
+ */
+ public TraceClassVisitor(final PrintWriter pw) {
+ this(null, pw);
+ }
+
+ /**
+ * Constructs a new {@link TraceClassVisitor}.
+ *
+ * @param cv the {@link ClassVisitor} to which this visitor delegates calls.
+ * May be <tt>null</tt>.
+ * @param pw the print writer to be used to print the class.
+ */
+ public TraceClassVisitor(final ClassVisitor cv, final PrintWriter pw) {
+ this.cv = cv;
+ this.pw = pw;
+ }
+
+ // ------------------------------------------------------------------------
+ // Implementation of the ClassVisitor interface
+ // ------------------------------------------------------------------------
+
+ public void visit(
+ final int version,
+ final int access,
+ final String name,
+ final String signature,
+ final String superName,
+ final String[] interfaces)
+ {
+ int major = version & 0xFFFF;
+ int minor = version >>> 16;
+ buf.setLength(0);
+ buf.append("// class version ")
+ .append(major)
+ .append('.')
+ .append(minor)
+ .append(" (")
+ .append(version)
+ .append(")\n");
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ buf.append("// DEPRECATED\n");
+ }
+ buf.append("// access flags ").append(access).append('\n');
+
+ appendDescriptor(CLASS_SIGNATURE, signature);
+ if (signature != null) {
+ TraceSignatureVisitor sv = new TraceSignatureVisitor(access);
+ SignatureReader r = new SignatureReader(signature);
+ r.accept(sv);
+ buf.append("// declaration: ")
+ .append(name)
+ .append(sv.getDeclaration())
+ .append('\n');
+ }
+
+ appendAccess(access & ~Opcodes.ACC_SUPER);
+ if ((access & Opcodes.ACC_ANNOTATION) != 0) {
+ buf.append("@interface ");
+ } else if ((access & Opcodes.ACC_INTERFACE) != 0) {
+ buf.append("interface ");
+ } else if ((access & Opcodes.ACC_ENUM) != 0) {
+ buf.append("enum ");
+ } else {
+ buf.append("class ");
+ }
+ appendDescriptor(INTERNAL_NAME, name);
+
+ if (superName != null && !superName.equals("java/lang/Object")) {
+ buf.append(" extends ");
+ appendDescriptor(INTERNAL_NAME, superName);
+ buf.append(' ');
+ }
+ if (interfaces != null && interfaces.length > 0) {
+ buf.append(" implements ");
+ for (int i = 0; i < interfaces.length; ++i) {
+ appendDescriptor(INTERNAL_NAME, interfaces[i]);
+ buf.append(' ');
+ }
+ }
+ buf.append(" {\n\n");
+
+ text.add(buf.toString());
+
+ if (cv != null) {
+ cv.visit(version, access, name, signature, superName, interfaces);
+ }
+ }
+
+ public void visitSource(final String file, final String debug) {
+ buf.setLength(0);
+ if (file != null) {
+ buf.append(tab)
+ .append("// compiled from: ")
+ .append(file)
+ .append('\n');
+ }
+ if (debug != null) {
+ buf.append(tab)
+ .append("// debug info: ")
+ .append(debug)
+ .append('\n');
+ }
+ if (buf.length() > 0) {
+ text.add(buf.toString());
+ }
+
+ if (cv != null) {
+ cv.visitSource(file, debug);
+ }
+ }
+
+ public void visitOuterClass(
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ buf.setLength(0);
+ buf.append(tab).append("OUTERCLASS ");
+ appendDescriptor(INTERNAL_NAME, owner);
+ // if enclosing name is null, so why should we show this info?
+ if (name != null) {
+ buf.append(' ').append(name).append(' ');
+ } else {
+ buf.append(' ');
+ }
+ appendDescriptor(METHOD_DESCRIPTOR, desc);
+ buf.append('\n');
+ text.add(buf.toString());
+
+ if (cv != null) {
+ cv.visitOuterClass(owner, name, desc);
+ }
+ }
+
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ text.add("\n");
+ AnnotationVisitor tav = super.visitAnnotation(desc, visible);
+ if (cv != null) {
+ ((TraceAnnotationVisitor) tav).av = cv.visitAnnotation(desc,
+ visible);
+ }
+ return tav;
+ }
+
+ public void visitAttribute(final Attribute attr) {
+ text.add("\n");
+ super.visitAttribute(attr);
+
+ if (cv != null) {
+ cv.visitAttribute(attr);
+ }
+ }
+
+ public void visitInnerClass(
+ final String name,
+ final String outerName,
+ final String innerName,
+ final int access)
+ {
+ buf.setLength(0);
+ buf.append(tab).append("// access flags ").append(access
+ & ~Opcodes.ACC_SUPER).append('\n');
+ buf.append(tab);
+ appendAccess(access);
+ buf.append("INNERCLASS ");
+ if ((access & Opcodes.ACC_ENUM) != 0) {
+ buf.append("enum ");
+ }
+ appendDescriptor(INTERNAL_NAME, name);
+ buf.append(' ');
+ appendDescriptor(INTERNAL_NAME, outerName);
+ buf.append(' ');
+ appendDescriptor(INTERNAL_NAME, innerName);
+ buf.append('\n');
+ text.add(buf.toString());
+
+ if (cv != null) {
+ cv.visitInnerClass(name, outerName, innerName, access);
+ }
+ }
+
+ public FieldVisitor visitField(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final Object value)
+ {
+ buf.setLength(0);
+ buf.append('\n');
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ buf.append(tab).append("// DEPRECATED\n");
+ }
+ buf.append(tab).append("// access flags ").append(access).append('\n');
+ if (signature != null) {
+ buf.append(tab);
+ appendDescriptor(FIELD_SIGNATURE, signature);
+
+ TraceSignatureVisitor sv = new TraceSignatureVisitor(0);
+ SignatureReader r = new SignatureReader(signature);
+ r.acceptType(sv);
+ buf.append(tab)
+ .append("// declaration: ")
+ .append(sv.getDeclaration())
+ .append('\n');
+ }
+
+ buf.append(tab);
+ appendAccess(access);
+ if ((access & Opcodes.ACC_ENUM) != 0) {
+ buf.append("enum ");
+ }
+
+ appendDescriptor(FIELD_DESCRIPTOR, desc);
+ buf.append(' ').append(name);
+ if (value != null) {
+ buf.append(" = ");
+ if (value instanceof String) {
+ buf.append("\"").append(value).append("\"");
+ } else {
+ buf.append(value);
+ }
+ }
+
+ buf.append('\n');
+ text.add(buf.toString());
+
+ TraceFieldVisitor tav = createTraceFieldVisitor();
+ text.add(tav.getText());
+
+ if (cv != null) {
+ tav.fv = cv.visitField(access, name, desc, signature, value);
+ }
+
+ return tav;
+ }
+
+ public MethodVisitor visitMethod(
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final String[] exceptions)
+ {
+ buf.setLength(0);
+ buf.append('\n');
+ if ((access & Opcodes.ACC_DEPRECATED) != 0) {
+ buf.append(tab).append("// DEPRECATED\n");
+ }
+ buf.append(tab).append("// access flags ").append(access).append('\n');
+ buf.append(tab);
+ appendDescriptor(METHOD_SIGNATURE, signature);
+
+ if (signature != null) {
+ TraceSignatureVisitor v = new TraceSignatureVisitor(0);
+ SignatureReader r = new SignatureReader(signature);
+ r.accept(v);
+ String genericDecl = v.getDeclaration();
+ String genericReturn = v.getReturnType();
+ String genericExceptions = v.getExceptions();
+
+ buf.append(tab)
+ .append("// declaration: ")
+ .append(genericReturn)
+ .append(' ')
+ .append(name)
+ .append(genericDecl);
+ if (genericExceptions != null) {
+ buf.append(" throws ").append(genericExceptions);
+ }
+ buf.append('\n');
+ }
+
+ appendAccess(access);
+ if ((access & Opcodes.ACC_NATIVE) != 0) {
+ buf.append("native ");
+ }
+ if ((access & Opcodes.ACC_VARARGS) != 0) {
+ buf.append("varargs ");
+ }
+ if ((access & Opcodes.ACC_BRIDGE) != 0) {
+ buf.append("bridge ");
+ }
+
+ buf.append(name);
+ appendDescriptor(METHOD_DESCRIPTOR, desc);
+ if (exceptions != null && exceptions.length > 0) {
+ buf.append(" throws ");
+ for (int i = 0; i < exceptions.length; ++i) {
+ appendDescriptor(INTERNAL_NAME, exceptions[i]);
+ buf.append(' ');
+ }
+ }
+
+ buf.append('\n');
+ text.add(buf.toString());
+
+ TraceMethodVisitor tcv = createTraceMethodVisitor();
+ text.add(tcv.getText());
+
+ if (cv != null) {
+ tcv.mv = cv.visitMethod(access, name, desc, signature, exceptions);
+ }
+
+ return tcv;
+ }
+
+ public void visitEnd() {
+ text.add("}\n");
+
+ printList(pw, text);
+ pw.flush();
+
+ if (cv != null) {
+ cv.visitEnd();
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods
+ // ------------------------------------------------------------------------
+
+ protected TraceFieldVisitor createTraceFieldVisitor() {
+ return new TraceFieldVisitor();
+ }
+
+ protected TraceMethodVisitor createTraceMethodVisitor() {
+ return new TraceMethodVisitor();
+ }
+
+ /**
+ * Appends a string representation of the given access modifiers to {@link
+ * #buf buf}.
+ *
+ * @param access some access modifiers.
+ */
+ private void appendAccess(final int access) {
+ if ((access & Opcodes.ACC_PUBLIC) != 0) {
+ buf.append("public ");
+ }
+ if ((access & Opcodes.ACC_PRIVATE) != 0) {
+ buf.append("private ");
+ }
+ if ((access & Opcodes.ACC_PROTECTED) != 0) {
+ buf.append("protected ");
+ }
+ if ((access & Opcodes.ACC_FINAL) != 0) {
+ buf.append("final ");
+ }
+ if ((access & Opcodes.ACC_STATIC) != 0) {
+ buf.append("static ");
+ }
+ if ((access & Opcodes.ACC_SYNCHRONIZED) != 0) {
+ buf.append("synchronized ");
+ }
+ if ((access & Opcodes.ACC_VOLATILE) != 0) {
+ buf.append("volatile ");
+ }
+ if ((access & Opcodes.ACC_TRANSIENT) != 0) {
+ buf.append("transient ");
+ }
+ // if ((access & Constants.ACC_NATIVE) != 0) {
+ // buf.append("native ");
+ // }
+ if ((access & Opcodes.ACC_ABSTRACT) != 0) {
+ buf.append("abstract ");
+ }
+ if ((access & Opcodes.ACC_STRICT) != 0) {
+ buf.append("strictfp ");
+ }
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
+ buf.append("synthetic ");
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceFieldVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceFieldVisitor.java
new file mode 100644
index 00000000000..7546a3c925e
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceFieldVisitor.java
@@ -0,0 +1,78 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.FieldVisitor;
+
+/**
+ * A {@link FieldVisitor} that prints a disassembled view of the fields it
+ * visits.
+ *
+ * @author Eric Bruneton
+ */
+public class TraceFieldVisitor extends TraceAbstractVisitor implements
+ FieldVisitor
+{
+
+ /**
+ * The {@link FieldVisitor} to which this visitor delegates calls. May be
+ * <tt>null</tt>.
+ */
+ protected FieldVisitor fv;
+
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ AnnotationVisitor av = super.visitAnnotation(desc, visible);
+ if (fv != null) {
+ ((TraceAnnotationVisitor) av).av = fv.visitAnnotation(desc, visible);
+ }
+ return av;
+ }
+
+ public void visitAttribute(final Attribute attr) {
+ super.visitAttribute(attr);
+
+ if (fv != null) {
+ fv.visitAttribute(attr);
+ }
+ }
+
+ public void visitEnd() {
+ super.visitEnd();
+
+ if (fv != null) {
+ fv.visitEnd();
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceMethodVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceMethodVisitor.java
new file mode 100644
index 00000000000..899f52ea79d
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceMethodVisitor.java
@@ -0,0 +1,486 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.signature.SignatureReader;
+import org.objectweb.asm.util.attrs.Traceable;
+
+import java.util.HashMap;
+
+/**
+ * A {@link MethodVisitor} that prints a disassembled view of the methods it
+ * visits.
+ *
+ * @author Eric Bruneton
+ */
+public class TraceMethodVisitor extends TraceAbstractVisitor implements
+ MethodVisitor
+{
+
+ /**
+ * The {@link MethodVisitor} to which this visitor delegates calls. May be
+ * <tt>null</tt>.
+ */
+ protected MethodVisitor mv;
+
+ /**
+ * Tab for bytecode instructions.
+ */
+ protected String tab2 = " ";
+
+ /**
+ * Tab for table and lookup switch instructions.
+ */
+ protected String tab3 = " ";
+
+ /**
+ * Tab for labels.
+ */
+ protected String ltab = " ";
+
+ /**
+ * The label names. This map associate String values to Label keys.
+ */
+ protected final HashMap labelNames;
+
+ /**
+ * Constructs a new {@link TraceMethodVisitor}.
+ */
+ public TraceMethodVisitor() {
+ this(null);
+ }
+
+ /**
+ * Constructs a new {@link TraceMethodVisitor}.
+ *
+ * @param mv the {@link MethodVisitor} to which this visitor delegates
+ * calls. May be <tt>null</tt>.
+ */
+ public TraceMethodVisitor(final MethodVisitor mv) {
+ this.labelNames = new HashMap();
+ this.mv = mv;
+ }
+
+ // ------------------------------------------------------------------------
+ // Implementation of the MethodVisitor interface
+ // ------------------------------------------------------------------------
+
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ AnnotationVisitor av = super.visitAnnotation(desc, visible);
+ if (mv != null) {
+ ((TraceAnnotationVisitor) av).av = mv.visitAnnotation(desc, visible);
+ }
+ return av;
+ }
+
+ public void visitAttribute(final Attribute attr) {
+ buf.setLength(0);
+ buf.append(tab).append("ATTRIBUTE ");
+ appendDescriptor(-1, attr.type);
+
+ if (attr instanceof Traceable) {
+ ((Traceable) attr).trace(buf, labelNames);
+ } else {
+ buf.append(" : ").append(attr.toString()).append("\n");
+ }
+
+ text.add(buf.toString());
+ if (mv != null) {
+ mv.visitAttribute(attr);
+ }
+ }
+
+ public AnnotationVisitor visitAnnotationDefault() {
+ text.add(tab2 + "default=");
+ TraceAnnotationVisitor tav = new TraceAnnotationVisitor();
+ text.add(tav.getText());
+ text.add("\n");
+ if (mv != null) {
+ tav.av = mv.visitAnnotationDefault();
+ }
+ return tav;
+ }
+
+ public AnnotationVisitor visitParameterAnnotation(
+ final int parameter,
+ final String desc,
+ final boolean visible)
+ {
+ buf.setLength(0);
+ buf.append(tab2).append('@');
+ appendDescriptor(FIELD_DESCRIPTOR, desc);
+ buf.append('(');
+ text.add(buf.toString());
+ TraceAnnotationVisitor tav = new TraceAnnotationVisitor();
+ text.add(tav.getText());
+ text.add(visible ? ") // parameter " : ") // invisible, parameter ");
+ text.add(new Integer(parameter));
+ text.add("\n");
+ if (mv != null) {
+ tav.av = mv.visitParameterAnnotation(parameter, desc, visible);
+ }
+ return tav;
+ }
+
+ public void visitCode() {
+ if (mv != null) {
+ mv.visitCode();
+ }
+ }
+
+ public void visitInsn(final int opcode) {
+ buf.setLength(0);
+ buf.append(tab2).append(OPCODES[opcode]).append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitInsn(opcode);
+ }
+ }
+
+ public void visitIntInsn(final int opcode, final int operand) {
+ buf.setLength(0);
+ buf.append(tab2)
+ .append(OPCODES[opcode])
+ .append(' ')
+ .append(opcode == Opcodes.NEWARRAY
+ ? TYPES[operand]
+ : Integer.toString(operand))
+ .append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitIntInsn(opcode, operand);
+ }
+ }
+
+ public void visitVarInsn(final int opcode, final int var) {
+ buf.setLength(0);
+ buf.append(tab2)
+ .append(OPCODES[opcode])
+ .append(' ')
+ .append(var)
+ .append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitVarInsn(opcode, var);
+ }
+ }
+
+ public void visitTypeInsn(final int opcode, final String desc) {
+ buf.setLength(0);
+ buf.append(tab2).append(OPCODES[opcode]).append(' ');
+ if (desc.startsWith("[")) {
+ appendDescriptor(FIELD_DESCRIPTOR, desc);
+ } else {
+ appendDescriptor(INTERNAL_NAME, desc);
+ }
+ buf.append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitTypeInsn(opcode, desc);
+ }
+ }
+
+ public void visitFieldInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ buf.setLength(0);
+ buf.append(tab2).append(OPCODES[opcode]).append(' ');
+ appendDescriptor(INTERNAL_NAME, owner);
+ buf.append('.').append(name).append(" : ");
+ appendDescriptor(FIELD_DESCRIPTOR, desc);
+ buf.append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitFieldInsn(opcode, owner, name, desc);
+ }
+ }
+
+ public void visitMethodInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ buf.setLength(0);
+ buf.append(tab2).append(OPCODES[opcode]).append(' ');
+ appendDescriptor(INTERNAL_NAME, owner);
+ buf.append('.').append(name).append(' ');
+ appendDescriptor(METHOD_DESCRIPTOR, desc);
+ buf.append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitMethodInsn(opcode, owner, name, desc);
+ }
+ }
+
+ public void visitJumpInsn(final int opcode, final Label label) {
+ buf.setLength(0);
+ buf.append(tab2).append(OPCODES[opcode]).append(' ');
+ appendLabel(label);
+ buf.append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitJumpInsn(opcode, label);
+ }
+ }
+
+ public void visitLabel(final Label label) {
+ buf.setLength(0);
+ buf.append(ltab);
+ appendLabel(label);
+ buf.append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitLabel(label);
+ }
+ }
+
+ public void visitLdcInsn(final Object cst) {
+ buf.setLength(0);
+ buf.append(tab2).append("LDC ");
+ if (cst instanceof String) {
+ AbstractVisitor.appendString(buf, (String) cst);
+ } else if (cst instanceof Type) {
+ buf.append(((Type) cst).getDescriptor() + ".class");
+ } else {
+ buf.append(cst);
+ }
+ buf.append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitLdcInsn(cst);
+ }
+ }
+
+ public void visitIincInsn(final int var, final int increment) {
+ buf.setLength(0);
+ buf.append(tab2)
+ .append("IINC ")
+ .append(var)
+ .append(' ')
+ .append(increment)
+ .append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitIincInsn(var, increment);
+ }
+ }
+
+ public void visitTableSwitchInsn(
+ final int min,
+ final int max,
+ final Label dflt,
+ final Label labels[])
+ {
+ buf.setLength(0);
+ buf.append(tab2).append("TABLESWITCH\n");
+ for (int i = 0; i < labels.length; ++i) {
+ buf.append(tab3).append(min + i).append(": ");
+ appendLabel(labels[i]);
+ buf.append('\n');
+ }
+ buf.append(tab3).append("default: ");
+ appendLabel(dflt);
+ buf.append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitTableSwitchInsn(min, max, dflt, labels);
+ }
+ }
+
+ public void visitLookupSwitchInsn(
+ final Label dflt,
+ final int keys[],
+ final Label labels[])
+ {
+ buf.setLength(0);
+ buf.append(tab2).append("LOOKUPSWITCH\n");
+ for (int i = 0; i < labels.length; ++i) {
+ buf.append(tab3).append(keys[i]).append(": ");
+ appendLabel(labels[i]);
+ buf.append('\n');
+ }
+ buf.append(tab3).append("default: ");
+ appendLabel(dflt);
+ buf.append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitLookupSwitchInsn(dflt, keys, labels);
+ }
+ }
+
+ public void visitMultiANewArrayInsn(final String desc, final int dims) {
+ buf.setLength(0);
+ buf.append(tab2).append("MULTIANEWARRAY ");
+ appendDescriptor(FIELD_DESCRIPTOR, desc);
+ buf.append(' ').append(dims).append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitMultiANewArrayInsn(desc, dims);
+ }
+ }
+
+ public void visitTryCatchBlock(
+ final Label start,
+ final Label end,
+ final Label handler,
+ final String type)
+ {
+ buf.setLength(0);
+ buf.append(tab2).append("TRYCATCHBLOCK ");
+ appendLabel(start);
+ buf.append(' ');
+ appendLabel(end);
+ buf.append(' ');
+ appendLabel(handler);
+ buf.append(' ');
+ appendDescriptor(INTERNAL_NAME, type);
+ buf.append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitTryCatchBlock(start, end, handler, type);
+ }
+ }
+
+ public void visitLocalVariable(
+ final String name,
+ final String desc,
+ final String signature,
+ final Label start,
+ final Label end,
+ final int index)
+ {
+ buf.setLength(0);
+ buf.append(tab2).append("LOCALVARIABLE ").append(name).append(' ');
+ appendDescriptor(FIELD_DESCRIPTOR, desc);
+ buf.append(' ');
+ appendLabel(start);
+ buf.append(' ');
+ appendLabel(end);
+ buf.append(' ').append(index).append('\n');
+
+ if (signature != null) {
+ buf.append(tab2);
+ appendDescriptor(FIELD_SIGNATURE, signature);
+
+ TraceSignatureVisitor sv = new TraceSignatureVisitor(0);
+ SignatureReader r = new SignatureReader(signature);
+ r.acceptType(sv);
+ buf.append(tab2)
+ .append("// declaration: ")
+ .append(sv.getDeclaration())
+ .append('\n');
+ }
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitLocalVariable(name, desc, signature, start, end, index);
+ }
+ }
+
+ public void visitLineNumber(final int line, final Label start) {
+ buf.setLength(0);
+ buf.append(tab2).append("LINENUMBER ").append(line).append(' ');
+ appendLabel(start);
+ buf.append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitLineNumber(line, start);
+ }
+ }
+
+ public void visitMaxs(final int maxStack, final int maxLocals) {
+ buf.setLength(0);
+ buf.append(tab2).append("MAXSTACK = ").append(maxStack).append('\n');
+ text.add(buf.toString());
+
+ buf.setLength(0);
+ buf.append(tab2).append("MAXLOCALS = ").append(maxLocals).append('\n');
+ text.add(buf.toString());
+
+ if (mv != null) {
+ mv.visitMaxs(maxStack, maxLocals);
+ }
+ }
+
+ public void visitEnd() {
+ super.visitEnd();
+
+ if (mv != null) {
+ mv.visitEnd();
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Utility methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Appends the name of the given label to {@link #buf buf}. Creates a new
+ * label name if the given label does not yet have one.
+ *
+ * @param l a label.
+ */
+ public void appendLabel(final Label l) {
+ String name = (String) labelNames.get(l);
+ if (name == null) {
+ name = "L" + labelNames.size();
+ labelNames.put(l, name);
+ }
+ buf.append(name);
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceSignatureVisitor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceSignatureVisitor.java
new file mode 100644
index 00000000000..c7145c0e86c
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/TraceSignatureVisitor.java
@@ -0,0 +1,300 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util;
+
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.signature.SignatureVisitor;
+
+/**
+ * A {@link SignatureVisitor} that prints a disassembled view of the signature
+ * it visits.
+ *
+ * @author Eugene Kuleshov
+ * @author Eric Bruneton
+ */
+public class TraceSignatureVisitor implements SignatureVisitor {
+
+ private StringBuffer declaration;
+
+ private boolean isInterface;
+
+ private boolean seenFormalParameter;
+
+ private boolean seenInterfaceBound;
+
+ private boolean seenParameter;
+
+ private boolean seenInterface;
+
+ private StringBuffer returnType;
+
+ private StringBuffer exceptions;
+
+ /**
+ * Stack used to keep track of class types that have arguments. Each element
+ * of this stack is a boolean encoded in one bit. The top of the stack is
+ * the lowest order bit. Pushing false = *2, pushing true = *2+1, popping =
+ * /2.
+ */
+ private int argumentStack;
+
+ /**
+ * Stack used to keep track of array class types. Each element of this stack
+ * is a boolean encoded in one bit. The top of the stack is the lowest order
+ * bit. Pushing false = *2, pushing true = *2+1, popping = /2.
+ */
+ private int arrayStack;
+
+ private String separator = "";
+
+ public TraceSignatureVisitor(int access) {
+ isInterface = (access & Opcodes.ACC_INTERFACE) != 0;
+ this.declaration = new StringBuffer();
+ }
+
+ private TraceSignatureVisitor(StringBuffer buf) {
+ this.declaration = buf;
+ }
+
+ public void visitFormalTypeParameter(String name) {
+ declaration.append(seenFormalParameter ? ", " : "<").append(name);
+ seenFormalParameter = true;
+ seenInterfaceBound = false;
+ }
+
+ public SignatureVisitor visitClassBound() {
+ separator = " extends ";
+ startType();
+ return this;
+ }
+
+ public SignatureVisitor visitInterfaceBound() {
+ separator = seenInterfaceBound ? ", " : " extends ";
+ seenInterfaceBound = true;
+ startType();
+ return this;
+ }
+
+ public SignatureVisitor visitSuperclass() {
+ endFormals();
+ separator = " extends ";
+ startType();
+ return this;
+ }
+
+ public SignatureVisitor visitInterface() {
+ separator = seenInterface ? ", " : (isInterface
+ ? " extends "
+ : " implements ");
+ seenInterface = true;
+ startType();
+ return this;
+ }
+
+ public SignatureVisitor visitParameterType() {
+ endFormals();
+ if (!seenParameter) {
+ seenParameter = true;
+ declaration.append('(');
+ } else {
+ declaration.append(", ");
+ }
+ startType();
+ return this;
+ }
+
+ public SignatureVisitor visitReturnType() {
+ endFormals();
+ if (!seenParameter) {
+ declaration.append('(');
+ } else {
+ seenParameter = false;
+ }
+ declaration.append(')');
+ returnType = new StringBuffer();
+ return new TraceSignatureVisitor(returnType);
+ }
+
+ public SignatureVisitor visitExceptionType() {
+ if (exceptions == null) {
+ exceptions = new StringBuffer();
+ } else {
+ exceptions.append(", ");
+ }
+ // startType();
+ return new TraceSignatureVisitor(exceptions);
+ }
+
+ public void visitBaseType(char descriptor) {
+ switch (descriptor) {
+ case 'V':
+ declaration.append("void");
+ break;
+ case 'B':
+ declaration.append("byte");
+ break;
+ case 'J':
+ declaration.append("long");
+ break;
+ case 'Z':
+ declaration.append("boolean");
+ break;
+ case 'I':
+ declaration.append("int");
+ break;
+ case 'S':
+ declaration.append("short");
+ break;
+ case 'C':
+ declaration.append("char");
+ break;
+ case 'F':
+ declaration.append("float");
+ break;
+ // case 'D':
+ default:
+ declaration.append("double");
+ break;
+ }
+ endType();
+ }
+
+ public void visitTypeVariable(String name) {
+ declaration.append(name);
+ endType();
+ }
+
+ public SignatureVisitor visitArrayType() {
+ startType();
+ arrayStack |= 1;
+ return this;
+ }
+
+ public void visitClassType(String name) {
+ if (!"java/lang/Object".equals(name)) {
+ declaration.append(separator).append(name.replace('/', '.'));
+ } else {
+ // Map<java.lang.Object,java.util.List>
+ // or
+ // abstract public V get(Object key); (seen in Dictionary.class)
+ // should have Object
+ // but java.lang.String extends java.lang.Object is unnecessary
+ boolean needObjectClass = argumentStack % 2 == 1 || seenParameter;
+ if (needObjectClass) {
+ declaration.append(separator).append(name.replace('/', '.'));
+ }
+ }
+ separator = "";
+ argumentStack *= 2;
+ }
+
+ public void visitInnerClassType(String name) {
+ if (argumentStack % 2 == 1) {
+ declaration.append('>');
+ }
+ argumentStack /= 2;
+ declaration.append('.');
+ declaration.append(separator).append(name.replace('/', '.'));
+ separator = "";
+ argumentStack *= 2;
+ }
+
+ public void visitTypeArgument() {
+ if (argumentStack % 2 == 0) {
+ ++argumentStack;
+ declaration.append('<');
+ } else {
+ declaration.append(", ");
+ }
+ declaration.append('?');
+ }
+
+ public SignatureVisitor visitTypeArgument(char tag) {
+ if (argumentStack % 2 == 0) {
+ ++argumentStack;
+ declaration.append('<');
+ } else {
+ declaration.append(", ");
+ }
+
+ if (tag == SignatureVisitor.EXTENDS) {
+ declaration.append("? extends ");
+ } else if (tag == SignatureVisitor.SUPER) {
+ declaration.append("? super ");
+ }
+
+ startType();
+ return this;
+ }
+
+ public void visitEnd() {
+ if (argumentStack % 2 == 1) {
+ declaration.append('>');
+ }
+ argumentStack /= 2;
+ endType();
+ }
+
+ public String getDeclaration() {
+ return declaration.toString();
+ }
+
+ public String getReturnType() {
+ return returnType == null ? null : returnType.toString();
+ }
+
+ public String getExceptions() {
+ return exceptions == null ? null : exceptions.toString();
+ }
+
+ // -----------------------------------------------
+
+ private void endFormals() {
+ if (seenFormalParameter) {
+ declaration.append('>');
+ seenFormalParameter = false;
+ }
+ }
+
+ private void startType() {
+ arrayStack *= 2;
+ }
+
+ private void endType() {
+ if (arrayStack % 2 == 1) {
+ while (arrayStack % 2 == 1) {
+ arrayStack /= 2;
+ declaration.append("[]");
+ }
+ } else {
+ arrayStack /= 2;
+ }
+ }
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/ASMStackMapAttribute.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/ASMStackMapAttribute.java
new file mode 100644
index 00000000000..88c7af89900
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/ASMStackMapAttribute.java
@@ -0,0 +1,223 @@
+/**
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util.attrs;
+
+import java.util.List;
+import java.util.Map;
+
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.attrs.StackMapAttribute;
+import org.objectweb.asm.attrs.StackMapFrame;
+import org.objectweb.asm.attrs.StackMapType;
+
+/**
+ * An {@link ASMifiable} {@link StackMapAttribute} sub class.
+ *
+ * @author Eugene Kuleshov
+ */
+public class ASMStackMapAttribute extends StackMapAttribute implements
+ ASMifiable,
+ Traceable
+{
+ /**
+ * Length of the attribute used for comparison
+ */
+ private int len;
+
+ public ASMStackMapAttribute() {
+ super();
+ }
+
+ public ASMStackMapAttribute(List frames, int len) {
+ super(frames);
+ this.len = len;
+ }
+
+ protected Attribute read(
+ ClassReader cr,
+ int off,
+ int len,
+ char[] buf,
+ int codeOff,
+ Label[] labels)
+ {
+ StackMapAttribute attr = (StackMapAttribute) super.read(cr,
+ off,
+ len,
+ buf,
+ codeOff,
+ labels);
+
+ return new ASMStackMapAttribute(attr.getFrames(), len);
+ }
+
+ public void asmify(StringBuffer buf, String varName, Map labelNames) {
+ List frames = getFrames();
+ buf.append("{\n");
+ buf.append("StackMapAttribute ").append(varName).append("Attr");
+ buf.append(" = new StackMapAttribute();\n");
+ if (frames.size() > 0) {
+ for (int i = 0; i < frames.size(); i++) {
+ asmify((StackMapFrame) frames.get(i), buf, varName + "frame"
+ + i, labelNames);
+ }
+ }
+ buf.append(varName).append(".visitAttribute(").append(varName);
+ buf.append("Attr);\n}\n");
+ }
+
+ void asmify(
+ StackMapFrame f,
+ StringBuffer buf,
+ String varName,
+ Map labelNames)
+ {
+ declareLabel(buf, labelNames, f.label);
+ buf.append("{\n");
+
+ buf.append("StackMapFrame ")
+ .append(varName)
+ .append(" = new StackMapFrame();\n");
+
+ buf.append(varName)
+ .append(".label = ")
+ .append(labelNames.get(f.label))
+ .append(";\n");
+
+ asmifyTypeInfo(buf, varName, labelNames, f.locals, "locals");
+ asmifyTypeInfo(buf, varName, labelNames, f.stack, "stack");
+
+ buf.append("cvAttr.frames.add(").append(varName).append(");\n");
+ buf.append("}\n");
+ }
+
+ void asmifyTypeInfo(
+ StringBuffer buf,
+ String varName,
+ Map labelNames,
+ List infos,
+ String field)
+ {
+ if (infos.size() > 0) {
+ buf.append("{\n");
+ for (int i = 0; i < infos.size(); i++) {
+ StackMapType typeInfo = (StackMapType) infos.get(i);
+ String localName = varName + "Info" + i;
+ int type = typeInfo.getType();
+ buf.append("StackMapType ")
+ .append(localName)
+ .append(" = StackMapType.getTypeInfo( StackMapType.ITEM_")
+ .append(StackMapType.ITEM_NAMES[type])
+ .append(");\n");
+
+ switch (type) {
+ case StackMapType.ITEM_Object: //
+ buf.append(localName)
+ .append(".setObject(\"")
+ .append(typeInfo.getObject())
+ .append("\");\n");
+ break;
+
+ case StackMapType.ITEM_Uninitialized: //
+ declareLabel(buf, labelNames, typeInfo.getLabel());
+ buf.append(localName)
+ .append(".setLabel(")
+ .append(labelNames.get(typeInfo.getLabel()))
+ .append(");\n");
+ break;
+ }
+ buf.append(varName)
+ .append(".")
+ .append(field)
+ .append(".add(")
+ .append(localName)
+ .append(");\n");
+ }
+ buf.append("}\n");
+ }
+ }
+
+ static void declareLabel(StringBuffer buf, Map labelNames, Label l) {
+ String name = (String) labelNames.get(l);
+ if (name == null) {
+ name = "l" + labelNames.size();
+ labelNames.put(l, name);
+ buf.append("Label ").append(name).append(" = new Label();\n");
+ }
+ }
+
+ public void trace(StringBuffer buf, Map labelNames) {
+ List frames = getFrames();
+ buf.append("[\n");
+ for (int i = 0; i < frames.size(); i++) {
+ StackMapFrame f = (StackMapFrame) frames.get(i);
+
+ buf.append(" Frame:");
+ appendLabel(buf, labelNames, f.label);
+
+ buf.append(" locals[");
+ traceTypeInfo(buf, labelNames, f.locals);
+ buf.append("]");
+ buf.append(" stack[");
+ traceTypeInfo(buf, labelNames, f.stack);
+ buf.append("]\n");
+ }
+ buf.append(" ] length:").append(len).append("\n");
+ }
+
+ private void traceTypeInfo(StringBuffer buf, Map labelNames, List infos) {
+ String sep = "";
+ for (int i = 0; i < infos.size(); i++) {
+ StackMapType t = (StackMapType) infos.get(i);
+
+ buf.append(sep).append(StackMapType.ITEM_NAMES[t.getType()]);
+ sep = ", ";
+ if (t.getType() == StackMapType.ITEM_Object) {
+ buf.append(":").append(t.getObject());
+ }
+ if (t.getType() == StackMapType.ITEM_Uninitialized) {
+ buf.append(":");
+ appendLabel(buf, labelNames, t.getLabel());
+ }
+ }
+ }
+
+ protected void appendLabel(StringBuffer buf, Map labelNames, Label l) {
+ String name = (String) labelNames.get(l);
+ if (name == null) {
+ name = "L" + labelNames.size();
+ labelNames.put(l, name);
+ }
+ buf.append(name);
+ }
+
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/ASMStackMapTableAttribute.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/ASMStackMapTableAttribute.java
new file mode 100644
index 00000000000..b878357d6b5
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/ASMStackMapTableAttribute.java
@@ -0,0 +1,214 @@
+/**
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util.attrs;
+
+import java.util.List;
+import java.util.Map;
+
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.attrs.StackMapTableAttribute;
+import org.objectweb.asm.attrs.StackMapFrame;
+import org.objectweb.asm.attrs.StackMapType;
+
+/**
+ * An {@link ASMifiable} {@link StackMapTableAttribute} sub class.
+ *
+ * @author Eugene Kuleshov
+ */
+public class ASMStackMapTableAttribute extends StackMapTableAttribute implements
+ ASMifiable,
+ Traceable
+{
+ /**
+ * Length of the attribute used for comparison
+ */
+ private int len;
+
+ public ASMStackMapTableAttribute() {
+ super();
+ }
+
+ public ASMStackMapTableAttribute(List frames, int len) {
+ super(frames);
+ this.len = len;
+ }
+
+ protected Attribute read(
+ ClassReader cr,
+ int off,
+ int len,
+ char[] buf,
+ int codeOff,
+ Label[] labels)
+ {
+ StackMapTableAttribute attr = (StackMapTableAttribute) super.read(cr,
+ off,
+ len,
+ buf,
+ codeOff,
+ labels);
+
+ return new ASMStackMapTableAttribute(attr.getFrames(), len);
+ }
+
+ public void asmify(StringBuffer buf, String varName, Map labelNames) {
+ List frames = getFrames();
+ if (frames.size() == 0) {
+ buf.append("List frames = Collections.EMPTY_LIST;\n");
+ } else {
+ buf.append("List frames = new ArrayList();\n");
+ for (int i = 0; i < frames.size(); i++) {
+ buf.append("{\n");
+ StackMapFrame f = (StackMapFrame) frames.get(i);
+ declareLabel(buf, labelNames, f.label);
+
+ String frameVar = varName + "frame" + i;
+ asmifyTypeInfo(buf, frameVar, labelNames, f.locals, "locals");
+ asmifyTypeInfo(buf, frameVar, labelNames, f.stack, "stack");
+
+ buf.append("StackMapFrame ")
+ .append(frameVar)
+ .append(" = new StackMapFrame(")
+ .append(labelNames.get(f.label))
+ .append(", locals, stack);\n");
+ buf.append("frames.add(").append(frameVar).append(");\n");
+ buf.append("}\n");
+ }
+ }
+ buf.append("StackMapTableAttribute ").append(varName);
+ buf.append(" = new StackMapTableAttribute(frames);\n");
+ }
+
+ void asmifyTypeInfo(
+ StringBuffer buf,
+ String varName,
+ Map labelNames,
+ List infos,
+ String field)
+ {
+ if (infos.size() == 0) {
+ buf.append("List ")
+ .append(field)
+ .append(" = Collections.EMPTY_LIST;\n");
+ } else {
+ buf.append("List ").append(field).append(" = new ArrayList();\n");
+ buf.append("{\n");
+ for (int i = 0; i < infos.size(); i++) {
+ StackMapType typeInfo = (StackMapType) infos.get(i);
+ String localName = varName + "Info" + i;
+ int type = typeInfo.getType();
+ buf.append("StackMapType ")
+ .append(localName)
+ .append(" = StackMapType.getTypeInfo( StackMapType.ITEM_")
+ .append(StackMapType.ITEM_NAMES[type])
+ .append(");\n");
+
+ switch (type) {
+ case StackMapType.ITEM_Object: //
+ buf.append(localName)
+ .append(".setObject(\"")
+ .append(typeInfo.getObject())
+ .append("\");\n");
+ break;
+
+ case StackMapType.ITEM_Uninitialized: //
+ declareLabel(buf, labelNames, typeInfo.getLabel());
+ buf.append(localName)
+ .append(".setLabel(")
+ .append(labelNames.get(typeInfo.getLabel()))
+ .append(");\n");
+ break;
+ }
+ buf.append(field)
+ .append(".add(")
+ .append(localName)
+ .append(");\n");
+ }
+ buf.append("}\n");
+ }
+ }
+
+ static void declareLabel(StringBuffer buf, Map labelNames, Label l) {
+ String name = (String) labelNames.get(l);
+ if (name == null) {
+ name = "l" + labelNames.size();
+ labelNames.put(l, name);
+ buf.append("Label ").append(name).append(" = new Label();\n");
+ }
+ }
+
+ public void trace(StringBuffer buf, Map labelNames) {
+ List frames = getFrames();
+ buf.append("[\n");
+ for (int i = 0; i < frames.size(); i++) {
+ StackMapFrame f = (StackMapFrame) frames.get(i);
+
+ buf.append(" Frame:");
+ appendLabel(buf, labelNames, f.label);
+
+ buf.append(" locals[");
+ traceTypeInfo(buf, labelNames, f.locals);
+ buf.append("]");
+ buf.append(" stack[");
+ traceTypeInfo(buf, labelNames, f.stack);
+ buf.append("]\n");
+ }
+ buf.append(" ] length:").append(len).append("\n");
+ }
+
+ private void traceTypeInfo(StringBuffer buf, Map labelNames, List infos) {
+ String sep = "";
+ for (int i = 0; i < infos.size(); i++) {
+ StackMapType t = (StackMapType) infos.get(i);
+
+ buf.append(sep).append(StackMapType.ITEM_NAMES[t.getType()]);
+ sep = ", ";
+ if (t.getType() == StackMapType.ITEM_Object) {
+ buf.append(":").append(t.getObject());
+ }
+ if (t.getType() == StackMapType.ITEM_Uninitialized) {
+ buf.append(":");
+ appendLabel(buf, labelNames, t.getLabel());
+ }
+ }
+ }
+
+ protected void appendLabel(StringBuffer buf, Map labelNames, Label l) {
+ String name = (String) labelNames.get(l);
+ if (name == null) {
+ name = "L" + labelNames.size();
+ labelNames.put(l, name);
+ }
+ buf.append(name);
+ }
+
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/ASMifiable.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/ASMifiable.java
new file mode 100644
index 00000000000..149d7daeeb1
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/ASMifiable.java
@@ -0,0 +1,53 @@
+/**
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util.attrs;
+
+import java.util.Map;
+
+/**
+ * An attribute that can print the ASM code to create an equivalent attribute.
+ *
+ * Implementation should print the ASM code that generates attribute data
+ * structures for current attribute state.
+ *
+ * @author Eugene Kuleshov
+ */
+public interface ASMifiable {
+
+ /**
+ * Prints the ASM code to create an attribute equal to this attribute.
+ *
+ * @param buf A buffer used for printing Java code.
+ * @param varName name of the variable in a printed code used to store
+ * attribute instance.
+ * @param labelNames map of label instances to their names.
+ */
+ void asmify(StringBuffer buf, String varName, Map labelNames);
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/Traceable.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/Traceable.java
new file mode 100644
index 00000000000..c40d2a62c3b
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/Traceable.java
@@ -0,0 +1,52 @@
+/**
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.util.attrs;
+
+import java.util.Map;
+
+/**
+ * An attribute that can print eadable representation of the attribute.
+ *
+ * Implementation should construct readable output from an attribute data
+ * structures for current attribute state. Such representation could be used in
+ * unit test assertions.
+ *
+ * @author Eugene Kuleshov
+ */
+public interface Traceable {
+
+ /**
+ * Build a human readable representation of the attribute.
+ *
+ * @param buf A buffer used for printing Java code.
+ * @param labelNames map of label instances to their names.
+ */
+ void trace(StringBuffer buf, Map labelNames);
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/package.html b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/package.html
new file mode 100644
index 00000000000..a21cb004a26
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/attrs/package.html
@@ -0,0 +1,36 @@
+<html>
+<!--
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<body>
+Provides attributes sub classes that can work with the ASMifier utility.
+
+@since ASM 1.4.3
+</body>
+</html>
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/util/package.html b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/package.html
new file mode 100644
index 00000000000..e967b8b1040
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/util/package.html
@@ -0,0 +1,40 @@
+<html>
+<!--
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2005 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<body>
+Provides ASM visitors that can be useful for programming and
+debugging purposes. These class visitors are normally not used by applications
+at runtime. This is why they are bundled in an optional <tt>asm-util.jar</tt>
+library that is separated from (but requires) the <tt>asm.jar</tt> library,
+which contains the core ASM framework.
+
+@since ASM 1.3.2
+</body>
+</html>
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/ASMContentHandler.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/ASMContentHandler.java
new file mode 100644
index 00000000000..1f6fee0ffab
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/ASMContentHandler.java
@@ -0,0 +1,1215 @@
+/***
+ * ASM XML Adapter
+ * Copyright (c) 2004, Eugene Kuleshov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.xml;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.Type;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * A {@link org.xml.sax.ContentHandler ContentHandler} that transforms XML
+ * document into Java class file. This class can be feeded by any kind of SAX
+ * 2.0 event producers, e.g. XML parser, XSLT or XPath engines, or custom code.
+ *
+ * @see org.objectweb.asm.xml.SAXClassAdapter
+ * @see org.objectweb.asm.xml.Processor
+ *
+ * @author Eugene Kuleshov
+ */
+public class ASMContentHandler extends DefaultHandler implements Opcodes {
+ /**
+ * Stack of the intermediate processing contexts.
+ */
+ private List stack = new ArrayList();
+
+ /**
+ * Complete name of the current element.
+ */
+ private String match = "";
+
+ /**
+ * <tt>true</tt> if the maximum stack size and number of local variables
+ * must be automatically computed.
+ */
+ protected boolean computeMax;
+
+ /**
+ * Output stream to write result bytecode.
+ */
+ protected OutputStream os;
+
+ /**
+ * Current instance of the {@link ClassWriter ClassWriter} used to write
+ * class bytecode.
+ */
+ protected ClassWriter cw;
+
+ /**
+ * Map of the active {@link Label Label} instances for current method.
+ */
+ protected Map labels;
+
+ private static final String BASE = "class";
+
+ private final RuleSet RULES = new RuleSet();
+ {
+ RULES.add(BASE, new ClassRule());
+ RULES.add(BASE + "/interfaces/interface", new InterfaceRule());
+ RULES.add(BASE + "/interfaces", new InterfacesRule());
+ RULES.add(BASE + "/outerclass", new OuterClassRule());
+ RULES.add(BASE + "/innerclass", new InnerClassRule());
+ RULES.add(BASE + "/source", new SourceRule());
+ RULES.add(BASE + "/field", new FieldRule());
+
+ RULES.add(BASE + "/method", new MethodRule());
+ RULES.add(BASE + "/method/exceptions/exception", new ExceptionRule());
+ RULES.add(BASE + "/method/exceptions", new ExceptionsRule());
+
+ RULES.add(BASE + "/method/annotationDefault",
+ new AnnotationDefaultRule());
+
+ RULES.add(BASE + "/method/code/*", new OpcodesRule()); // opcodes
+
+ RULES.add(BASE + "/method/code/TABLESWITCH", new TableSwitchRule());
+ RULES.add(BASE + "/method/code/TABLESWITCH/label",
+ new TableSwitchLabelRule());
+ RULES.add(BASE + "/method/code/LOOKUPSWITCH", new LookupSwitchRule());
+ RULES.add(BASE + "/method/code/LOOKUPSWITCH/label",
+ new LookupSwitchLabelRule());
+
+ RULES.add(BASE + "/method/code/Label", new LabelRule());
+ RULES.add(BASE + "/method/code/TryCatch", new TryCatchRule());
+ RULES.add(BASE + "/method/code/LineNumber", new LineNumberRule());
+ RULES.add(BASE + "/method/code/LocalVar", new LocalVarRule());
+ RULES.add(BASE + "/method/code/Max", new MaxRule());
+
+ RULES.add("*/annotation", new AnnotationRule());
+ RULES.add("*/parameterAnnotation", new AnnotationParameterRule());
+ RULES.add("*/annotationValue", new AnnotationValueRule());
+ RULES.add("*/annotationValueAnnotation",
+ new AnnotationValueAnnotationRule());
+ RULES.add("*/annotationValueEnum", new AnnotationValueEnumRule());
+ RULES.add("*/annotationValueArray", new AnnotationValueArrayRule());
+ };
+
+ private static interface OpcodeGroup {
+ public static final int INSN = 0;
+ public static final int INSN_INT = 1;
+ public static final int INSN_VAR = 2;
+ public static final int INSN_TYPE = 3;
+ public static final int INSN_FIELD = 4;
+ public static final int INSN_METHOD = 5;
+ public static final int INSN_JUMP = 6;
+ public static final int INSN_LDC = 7;
+ public static final int INSN_IINC = 8;
+ public static final int INSN_MULTIANEWARRAY = 9;
+ }
+
+ /**
+ * Map of the opcode names to opcode and opcode group
+ */
+ static final Map OPCODES = new HashMap();
+ static {
+ OPCODES.put("NOP", new Opcode(NOP, OpcodeGroup.INSN));
+ OPCODES.put("ACONST_NULL", new Opcode(ACONST_NULL, OpcodeGroup.INSN));
+ OPCODES.put("ICONST_M1", new Opcode(ICONST_M1, OpcodeGroup.INSN));
+ OPCODES.put("ICONST_0", new Opcode(ICONST_0, OpcodeGroup.INSN));
+ OPCODES.put("ICONST_1", new Opcode(ICONST_1, OpcodeGroup.INSN));
+ OPCODES.put("ICONST_2", new Opcode(ICONST_2, OpcodeGroup.INSN));
+ OPCODES.put("ICONST_3", new Opcode(ICONST_3, OpcodeGroup.INSN));
+ OPCODES.put("ICONST_4", new Opcode(ICONST_4, OpcodeGroup.INSN));
+ OPCODES.put("ICONST_5", new Opcode(ICONST_5, OpcodeGroup.INSN));
+ OPCODES.put("LCONST_0", new Opcode(LCONST_0, OpcodeGroup.INSN));
+ OPCODES.put("LCONST_1", new Opcode(LCONST_1, OpcodeGroup.INSN));
+ OPCODES.put("FCONST_0", new Opcode(FCONST_0, OpcodeGroup.INSN));
+ OPCODES.put("FCONST_1", new Opcode(FCONST_1, OpcodeGroup.INSN));
+ OPCODES.put("FCONST_2", new Opcode(FCONST_2, OpcodeGroup.INSN));
+ OPCODES.put("DCONST_0", new Opcode(DCONST_0, OpcodeGroup.INSN));
+ OPCODES.put("DCONST_1", new Opcode(DCONST_1, OpcodeGroup.INSN));
+ OPCODES.put("BIPUSH", new Opcode(BIPUSH, OpcodeGroup.INSN_INT));
+ OPCODES.put("SIPUSH", new Opcode(SIPUSH, OpcodeGroup.INSN_INT));
+ OPCODES.put("LDC", new Opcode(LDC, OpcodeGroup.INSN_LDC));
+ OPCODES.put("ILOAD", new Opcode(ILOAD, OpcodeGroup.INSN_VAR));
+ OPCODES.put("LLOAD", new Opcode(LLOAD, OpcodeGroup.INSN_VAR));
+ OPCODES.put("FLOAD", new Opcode(FLOAD, OpcodeGroup.INSN_VAR));
+ OPCODES.put("DLOAD", new Opcode(DLOAD, OpcodeGroup.INSN_VAR));
+ OPCODES.put("ALOAD", new Opcode(ALOAD, OpcodeGroup.INSN_VAR));
+ OPCODES.put("IALOAD", new Opcode(IALOAD, OpcodeGroup.INSN));
+ OPCODES.put("LALOAD", new Opcode(LALOAD, OpcodeGroup.INSN));
+ OPCODES.put("FALOAD", new Opcode(FALOAD, OpcodeGroup.INSN));
+ OPCODES.put("DALOAD", new Opcode(DALOAD, OpcodeGroup.INSN));
+ OPCODES.put("AALOAD", new Opcode(AALOAD, OpcodeGroup.INSN));
+ OPCODES.put("BALOAD", new Opcode(BALOAD, OpcodeGroup.INSN));
+ OPCODES.put("CALOAD", new Opcode(CALOAD, OpcodeGroup.INSN));
+ OPCODES.put("SALOAD", new Opcode(SALOAD, OpcodeGroup.INSN));
+ OPCODES.put("ISTORE", new Opcode(ISTORE, OpcodeGroup.INSN_VAR));
+ OPCODES.put("LSTORE", new Opcode(LSTORE, OpcodeGroup.INSN_VAR));
+ OPCODES.put("FSTORE", new Opcode(FSTORE, OpcodeGroup.INSN_VAR));
+ OPCODES.put("DSTORE", new Opcode(DSTORE, OpcodeGroup.INSN_VAR));
+ OPCODES.put("ASTORE", new Opcode(ASTORE, OpcodeGroup.INSN_VAR));
+ OPCODES.put("IASTORE", new Opcode(IASTORE, OpcodeGroup.INSN));
+ OPCODES.put("LASTORE", new Opcode(LASTORE, OpcodeGroup.INSN));
+ OPCODES.put("FASTORE", new Opcode(FASTORE, OpcodeGroup.INSN));
+ OPCODES.put("DASTORE", new Opcode(DASTORE, OpcodeGroup.INSN));
+ OPCODES.put("AASTORE", new Opcode(AASTORE, OpcodeGroup.INSN));
+ OPCODES.put("BASTORE", new Opcode(BASTORE, OpcodeGroup.INSN));
+ OPCODES.put("CASTORE", new Opcode(CASTORE, OpcodeGroup.INSN));
+ OPCODES.put("SASTORE", new Opcode(SASTORE, OpcodeGroup.INSN));
+ OPCODES.put("POP", new Opcode(POP, OpcodeGroup.INSN));
+ OPCODES.put("POP2", new Opcode(POP2, OpcodeGroup.INSN));
+ OPCODES.put("DUP", new Opcode(DUP, OpcodeGroup.INSN));
+ OPCODES.put("DUP_X1", new Opcode(DUP_X1, OpcodeGroup.INSN));
+ OPCODES.put("DUP_X2", new Opcode(DUP_X2, OpcodeGroup.INSN));
+ OPCODES.put("DUP2", new Opcode(DUP2, OpcodeGroup.INSN));
+ OPCODES.put("DUP2_X1", new Opcode(DUP2_X1, OpcodeGroup.INSN));
+ OPCODES.put("DUP2_X2", new Opcode(DUP2_X2, OpcodeGroup.INSN));
+ OPCODES.put("SWAP", new Opcode(SWAP, OpcodeGroup.INSN));
+ OPCODES.put("IADD", new Opcode(IADD, OpcodeGroup.INSN));
+ OPCODES.put("LADD", new Opcode(LADD, OpcodeGroup.INSN));
+ OPCODES.put("FADD", new Opcode(FADD, OpcodeGroup.INSN));
+ OPCODES.put("DADD", new Opcode(DADD, OpcodeGroup.INSN));
+ OPCODES.put("ISUB", new Opcode(ISUB, OpcodeGroup.INSN));
+ OPCODES.put("LSUB", new Opcode(LSUB, OpcodeGroup.INSN));
+ OPCODES.put("FSUB", new Opcode(FSUB, OpcodeGroup.INSN));
+ OPCODES.put("DSUB", new Opcode(DSUB, OpcodeGroup.INSN));
+ OPCODES.put("IMUL", new Opcode(IMUL, OpcodeGroup.INSN));
+ OPCODES.put("LMUL", new Opcode(LMUL, OpcodeGroup.INSN));
+ OPCODES.put("FMUL", new Opcode(FMUL, OpcodeGroup.INSN));
+ OPCODES.put("DMUL", new Opcode(DMUL, OpcodeGroup.INSN));
+ OPCODES.put("IDIV", new Opcode(IDIV, OpcodeGroup.INSN));
+ OPCODES.put("LDIV", new Opcode(LDIV, OpcodeGroup.INSN));
+ OPCODES.put("FDIV", new Opcode(FDIV, OpcodeGroup.INSN));
+ OPCODES.put("DDIV", new Opcode(DDIV, OpcodeGroup.INSN));
+ OPCODES.put("IREM", new Opcode(IREM, OpcodeGroup.INSN));
+ OPCODES.put("LREM", new Opcode(LREM, OpcodeGroup.INSN));
+ OPCODES.put("FREM", new Opcode(FREM, OpcodeGroup.INSN));
+ OPCODES.put("DREM", new Opcode(DREM, OpcodeGroup.INSN));
+ OPCODES.put("INEG", new Opcode(INEG, OpcodeGroup.INSN));
+ OPCODES.put("LNEG", new Opcode(LNEG, OpcodeGroup.INSN));
+ OPCODES.put("FNEG", new Opcode(FNEG, OpcodeGroup.INSN));
+ OPCODES.put("DNEG", new Opcode(DNEG, OpcodeGroup.INSN));
+ OPCODES.put("ISHL", new Opcode(ISHL, OpcodeGroup.INSN));
+ OPCODES.put("LSHL", new Opcode(LSHL, OpcodeGroup.INSN));
+ OPCODES.put("ISHR", new Opcode(ISHR, OpcodeGroup.INSN));
+ OPCODES.put("LSHR", new Opcode(LSHR, OpcodeGroup.INSN));
+ OPCODES.put("IUSHR", new Opcode(IUSHR, OpcodeGroup.INSN));
+ OPCODES.put("LUSHR", new Opcode(LUSHR, OpcodeGroup.INSN));
+ OPCODES.put("IAND", new Opcode(IAND, OpcodeGroup.INSN));
+ OPCODES.put("LAND", new Opcode(LAND, OpcodeGroup.INSN));
+ OPCODES.put("IOR", new Opcode(IOR, OpcodeGroup.INSN));
+ OPCODES.put("LOR", new Opcode(LOR, OpcodeGroup.INSN));
+ OPCODES.put("IXOR", new Opcode(IXOR, OpcodeGroup.INSN));
+ OPCODES.put("LXOR", new Opcode(LXOR, OpcodeGroup.INSN));
+ OPCODES.put("IINC", new Opcode(IINC, OpcodeGroup.INSN_IINC));
+ OPCODES.put("I2L", new Opcode(I2L, OpcodeGroup.INSN));
+ OPCODES.put("I2F", new Opcode(I2F, OpcodeGroup.INSN));
+ OPCODES.put("I2D", new Opcode(I2D, OpcodeGroup.INSN));
+ OPCODES.put("L2I", new Opcode(L2I, OpcodeGroup.INSN));
+ OPCODES.put("L2F", new Opcode(L2F, OpcodeGroup.INSN));
+ OPCODES.put("L2D", new Opcode(L2D, OpcodeGroup.INSN));
+ OPCODES.put("F2I", new Opcode(F2I, OpcodeGroup.INSN));
+ OPCODES.put("F2L", new Opcode(F2L, OpcodeGroup.INSN));
+ OPCODES.put("F2D", new Opcode(F2D, OpcodeGroup.INSN));
+ OPCODES.put("D2I", new Opcode(D2I, OpcodeGroup.INSN));
+ OPCODES.put("D2L", new Opcode(D2L, OpcodeGroup.INSN));
+ OPCODES.put("D2F", new Opcode(D2F, OpcodeGroup.INSN));
+ OPCODES.put("I2B", new Opcode(I2B, OpcodeGroup.INSN));
+ OPCODES.put("I2C", new Opcode(I2C, OpcodeGroup.INSN));
+ OPCODES.put("I2S", new Opcode(I2S, OpcodeGroup.INSN));
+ OPCODES.put("LCMP", new Opcode(LCMP, OpcodeGroup.INSN));
+ OPCODES.put("FCMPL", new Opcode(FCMPL, OpcodeGroup.INSN));
+ OPCODES.put("FCMPG", new Opcode(FCMPG, OpcodeGroup.INSN));
+ OPCODES.put("DCMPL", new Opcode(DCMPL, OpcodeGroup.INSN));
+ OPCODES.put("DCMPG", new Opcode(DCMPG, OpcodeGroup.INSN));
+ OPCODES.put("IFEQ", new Opcode(IFEQ, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("IFNE", new Opcode(IFNE, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("IFLT", new Opcode(IFLT, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("IFGE", new Opcode(IFGE, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("IFGT", new Opcode(IFGT, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("IFLE", new Opcode(IFLE, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("IF_ICMPEQ", new Opcode(IF_ICMPEQ, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("IF_ICMPNE", new Opcode(IF_ICMPNE, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("IF_ICMPLT", new Opcode(IF_ICMPLT, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("IF_ICMPGE", new Opcode(IF_ICMPGE, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("IF_ICMPGT", new Opcode(IF_ICMPGT, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("IF_ICMPLE", new Opcode(IF_ICMPLE, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("IF_ACMPEQ", new Opcode(IF_ACMPEQ, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("IF_ACMPNE", new Opcode(IF_ACMPNE, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("GOTO", new Opcode(GOTO, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("JSR", new Opcode(JSR, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("RET", new Opcode(RET, OpcodeGroup.INSN_VAR));
+ // OPCODES.put( "TABLESWITCH", new Opcode( TABLESWITCH,
+ // "visiTableSwitchInsn"));
+ // OPCODES.put( "LOOKUPSWITCH", new Opcode( LOOKUPSWITCH,
+ // "visitLookupSwitch"));
+ OPCODES.put("IRETURN", new Opcode(IRETURN, OpcodeGroup.INSN));
+ OPCODES.put("LRETURN", new Opcode(LRETURN, OpcodeGroup.INSN));
+ OPCODES.put("FRETURN", new Opcode(FRETURN, OpcodeGroup.INSN));
+ OPCODES.put("DRETURN", new Opcode(DRETURN, OpcodeGroup.INSN));
+ OPCODES.put("ARETURN", new Opcode(ARETURN, OpcodeGroup.INSN));
+ OPCODES.put("RETURN", new Opcode(RETURN, OpcodeGroup.INSN));
+ OPCODES.put("GETSTATIC", new Opcode(GETSTATIC, OpcodeGroup.INSN_FIELD));
+ OPCODES.put("PUTSTATIC", new Opcode(PUTSTATIC, OpcodeGroup.INSN_FIELD));
+ OPCODES.put("GETFIELD", new Opcode(GETFIELD, OpcodeGroup.INSN_FIELD));
+ OPCODES.put("PUTFIELD", new Opcode(PUTFIELD, OpcodeGroup.INSN_FIELD));
+ OPCODES.put("INVOKEVIRTUAL", new Opcode(INVOKEVIRTUAL,
+ OpcodeGroup.INSN_METHOD));
+ OPCODES.put("INVOKESPECIAL", new Opcode(INVOKESPECIAL,
+ OpcodeGroup.INSN_METHOD));
+ OPCODES.put("INVOKESTATIC", new Opcode(INVOKESTATIC,
+ OpcodeGroup.INSN_METHOD));
+ OPCODES.put("INVOKEINTERFACE", new Opcode(INVOKEINTERFACE,
+ OpcodeGroup.INSN_METHOD));
+ OPCODES.put("NEW", new Opcode(NEW, OpcodeGroup.INSN_TYPE));
+ OPCODES.put("NEWARRAY", new Opcode(NEWARRAY, OpcodeGroup.INSN_INT));
+ OPCODES.put("ANEWARRAY", new Opcode(ANEWARRAY, OpcodeGroup.INSN_TYPE));
+ OPCODES.put("ARRAYLENGTH", new Opcode(ARRAYLENGTH, OpcodeGroup.INSN));
+ OPCODES.put("ATHROW", new Opcode(ATHROW, OpcodeGroup.INSN));
+ OPCODES.put("CHECKCAST", new Opcode(CHECKCAST, OpcodeGroup.INSN_TYPE));
+ OPCODES.put("INSTANCEOF", new Opcode(INSTANCEOF, OpcodeGroup.INSN_TYPE));
+ OPCODES.put("MONITORENTER", new Opcode(MONITORENTER, OpcodeGroup.INSN));
+ OPCODES.put("MONITOREXIT", new Opcode(MONITOREXIT, OpcodeGroup.INSN));
+ OPCODES.put("MULTIANEWARRAY", new Opcode(MULTIANEWARRAY,
+ OpcodeGroup.INSN_MULTIANEWARRAY));
+ OPCODES.put("IFNULL", new Opcode(IFNULL, OpcodeGroup.INSN_JUMP));
+ OPCODES.put("IFNONNULL", new Opcode(IFNONNULL, OpcodeGroup.INSN_JUMP));
+ }
+
+ /**
+ * Constructs a new {@link ASMContentHandler ASMContentHandler} object.
+ *
+ * @param os output stream to write generated class.
+ * @param computeMax <tt>true</tt> if the maximum stack size and the
+ * maximum number of local variables must be automatically computed.
+ * This value is passed to {@link ClassWriter ClassWriter} instance.
+ */
+ public ASMContentHandler(OutputStream os, boolean computeMax) {
+ this.os = os;
+ this.computeMax = computeMax;
+ }
+
+ /**
+ * Returns the bytecode of the class that was build with underneath class
+ * writer.
+ *
+ * @return the bytecode of the class that was build with underneath class
+ * writer or null if there are no classwriter created.
+ */
+ public byte[] toByteArray() {
+ return cw == null ? null : cw.toByteArray();
+ }
+
+ /**
+ * Process notification of the start of an XML element being reached.
+ *
+ * @param ns - The Namespace URI, or the empty string if the element has no
+ * Namespace URI or if Namespace processing is not being performed.
+ * @param localName - The local name (without prefix), or the empty string
+ * if Namespace processing is not being performed.
+ * @param qName - The qualified name (with prefix), or the empty string if
+ * qualified names are not available.
+ * @param list - The attributes attached to the element. If there are no
+ * attributes, it shall be an empty Attributes object.
+ * @exception SAXException if a parsing error is to be reported
+ */
+ public final void startElement(
+ String ns,
+ String localName,
+ String qName,
+ Attributes list) throws SAXException
+ {
+ // the actual element name is either in localName or qName, depending
+ // on whether the parser is namespace aware
+ String name = localName;
+ if (name == null || name.length() < 1) {
+ name = qName;
+ }
+
+ // Compute the current matching rule
+ StringBuffer sb = new StringBuffer(match);
+ if (match.length() > 0) {
+ sb.append('/');
+ }
+ sb.append(name);
+ match = sb.toString();
+
+ // Fire "begin" events for all relevant rules
+ Rule r = (Rule) RULES.match(match);
+ if (r != null)
+ r.begin(name, list);
+ }
+
+ /**
+ * Process notification of the end of an XML element being reached.
+ *
+ * @param ns - The Namespace URI, or the empty string if the element has no
+ * Namespace URI or if Namespace processing is not being performed.
+ * @param localName - The local name (without prefix), or the empty string
+ * if Namespace processing is not being performed.
+ * @param qName - The qualified XML 1.0 name (with prefix), or the empty
+ * string if qualified names are not available.
+ *
+ * @exception SAXException if a parsing error is to be reported
+ */
+ public final void endElement(String ns, String localName, String qName)
+ throws SAXException
+ {
+ // the actual element name is either in localName or qName, depending
+ // on whether the parser is namespace aware
+ String name = localName;
+ if (name == null || name.length() < 1) {
+ name = qName;
+ }
+
+ // Fire "end" events for all relevant rules in reverse order
+ Rule r = (Rule) RULES.match(match);
+ if (r != null)
+ r.end(name);
+
+ // Recover the previous match expression
+ int slash = match.lastIndexOf('/');
+ if (slash >= 0) {
+ match = match.substring(0, slash);
+ } else {
+ match = "";
+ }
+ }
+
+ /**
+ * Process notification of the end of a document and write generated
+ * bytecode into output stream.
+ *
+ * @exception SAXException if parsing or writing error is to be reported.
+ */
+ public final void endDocument() throws SAXException {
+ try {
+ os.write(cw.toByteArray());
+ } catch (IOException ex) {
+ throw new SAXException(ex.toString(), ex);
+ }
+ }
+
+ /**
+ * Return the top object on the stack without removing it. If there are no
+ * objects on the stack, return <code>null</code>.
+ *
+ * @return the top object on the stack without removing it.
+ */
+ final Object peek() {
+ return stack.size() == 0 ? null : stack.get(stack.size() - 1);
+ }
+
+ /**
+ * Return the n'th object down the stack, where 0 is the top element and
+ * [getCount()-1] is the bottom element. If the specified index is out of
+ * range, return <code>null</code>.
+ *
+ * @param n Index of the desired element, where 0 is the top of the stack, 1
+ * is the next element down, and so on.
+ * @return the n'th object down the stack.
+ */
+ final Object peek(int n) {
+ return stack.size() < (n + 1) ? null : stack.get(n);
+ }
+
+ /**
+ * Pop the top object off of the stack, and return it. If there are no
+ * objects on the stack, return <code>null</code>.
+ *
+ * @return the top object off of the stack.
+ */
+ final Object pop() {
+ return stack.size() == 0 ? null : stack.remove(stack.size() - 1);
+ }
+
+ /**
+ * Push a new object onto the top of the object stack.
+ *
+ * @param object The new object
+ */
+ final void push(Object object) {
+ stack.add(object);
+ }
+
+ private static final class RuleSet {
+ private Map rules = new HashMap();
+
+ private List lpatterns = new ArrayList();
+
+ private List rpatterns = new ArrayList();
+
+ public void add(String path, Object rule) {
+ String pattern = path;
+ if (path.startsWith("*/")) {
+ pattern = path.substring(1);
+ lpatterns.add(pattern);
+ } else if (path.endsWith("/*")) {
+ pattern = path.substring(0, path.length() - 1);
+ rpatterns.add(pattern);
+ }
+ rules.put(pattern, rule);
+ }
+
+ public Object match(String path) {
+ if (rules.containsKey(path)) {
+ return rules.get(path);
+ }
+
+ int n = path.lastIndexOf('/');
+ for (Iterator it = lpatterns.iterator(); it.hasNext();) {
+ String pattern = (String) it.next();
+ if (path.substring(n).endsWith(pattern)) {
+ return rules.get(pattern);
+ }
+ }
+
+ for (Iterator it = rpatterns.iterator(); it.hasNext();) {
+ String pattern = (String) it.next();
+ if (path.startsWith(pattern)) {
+ return rules.get(pattern);
+ }
+ }
+
+ return null;
+ }
+
+ }
+
+ /**
+ * Rule
+ */
+ protected abstract class Rule {
+
+ public void begin(String name, Attributes attrs) {
+ }
+
+ public void end(String name) {
+ }
+
+ protected final Object getValue(String desc, String val) {
+ Object value = null;
+ if (val != null) {
+ if (desc.equals("Ljava/lang/String;")) {
+ value = decode(val);
+ } else if ("Ljava/lang/Integer;".equals(desc)
+ || "I".equals(desc) || "S".equals(desc)
+ || "B".equals(desc) || "C".equals(desc)
+ || desc.equals("Z"))
+ {
+ value = new Integer(val);
+
+ } else if ("Ljava/lang/Short;".equals(desc)) {
+ value = new Short(val);
+
+ } else if ("Ljava/lang/Byte;".equals(desc)) {
+ value = new Byte(val);
+
+ } else if ("Ljava/lang/Character;".equals(desc)) {
+ value = new Character(decode(val).charAt(0));
+
+ } else if ("Ljava/lang/Boolean;".equals(desc)) {
+ value = Boolean.valueOf(val);
+
+ // } else if ("Ljava/lang/Integer;".equals(desc)
+ // || desc.equals("I"))
+ // {
+ // value = new Integer(val);
+ // } else if ("Ljava/lang/Character;".equals(desc)
+ // || desc.equals("C"))
+ // {
+ // value = new Character(decode(val).charAt(0));
+ // } else if ("Ljava/lang/Short;".equals(desc) ||
+ // desc.equals("S"))
+ // {
+ // value = Short.valueOf(val);
+ // } else if ("Ljava/lang/Byte;".equals(desc) ||
+ // desc.equals("B"))
+ // {
+ // value = Byte.valueOf(val);
+
+ } else if ("Ljava/lang/Long;".equals(desc) || desc.equals("J"))
+ {
+ value = new Long(val);
+ } else if ("Ljava/lang/Float;".equals(desc) || desc.equals("F"))
+ {
+ value = new Float(val);
+ } else if ("Ljava/lang/Double;".equals(desc)
+ || desc.equals("D"))
+ {
+ value = new Double(val);
+ } else if (Type.getDescriptor(Type.class).equals(desc)) {
+ value = Type.getType(val);
+
+ // } else if ("[I".equals(desc)) {
+ // value = new int[0]; // TODO
+ // } else if ("[C".equals(desc)) {
+ // value = new char[0]; // TODO
+ // } else if ("[Z".equals(desc)) {
+ // value = new boolean[0]; // TODO
+ // } else if ("[S".equals(desc)) {
+ // value = new short[0]; // TODO
+ // } else if ("[B".equals(desc)) {
+ // value = new byte[0]; // TODO
+ // } else if ("[J".equals(desc)) {
+ // value = new long[0]; // TODO
+ // } else if ("[F".equals(desc)) {
+ // value = new float[0]; // TODO
+ // } else if ("[D".equals(desc)) {
+ // value = new double[0]; // TODO
+
+ } else {
+ throw new RuntimeException("Invalid value:" + val
+ + " desc:" + desc + " ctx:" + this);
+ }
+ }
+ return value;
+ }
+
+ private final String decode(String val) {
+ StringBuffer sb = new StringBuffer(val.length());
+ try {
+ int n = 0;
+ while (n < val.length()) {
+ char c = val.charAt(n);
+ if (c == '\\') {
+ n++;
+ c = val.charAt(n);
+ if (c == '\\') {
+ sb.append('\\');
+ } else {
+ n++; // skip 'u'
+ sb.append((char) Integer.parseInt(val.substring(n,
+ n + 4), 16));
+ n += 3;
+ }
+ } else {
+ sb.append(c);
+ }
+ n++;
+ }
+
+ } catch (RuntimeException ex) {
+ System.err.println(val + "\n" + ex.toString());
+ ex.printStackTrace();
+ throw ex;
+ }
+ return sb.toString();
+ }
+
+ protected final Label getLabel(Object label) {
+ Label lbl = (Label) labels.get(label);
+ if (lbl == null) {
+ lbl = new Label();
+ labels.put(label, lbl);
+ }
+ return lbl;
+ }
+
+ // TODO verify move to stack
+ protected final MethodVisitor getCodeVisitor() {
+ return (MethodVisitor) peek();
+ }
+
+ protected final int getAccess(String s) {
+ int access = 0;
+ if (s.indexOf("public") != -1)
+ access |= Opcodes.ACC_PUBLIC;
+ if (s.indexOf("private") != -1)
+ access |= Opcodes.ACC_PRIVATE;
+ if (s.indexOf("protected") != -1)
+ access |= Opcodes.ACC_PROTECTED;
+ if (s.indexOf("static") != -1)
+ access |= Opcodes.ACC_STATIC;
+ if (s.indexOf("final") != -1)
+ access |= Opcodes.ACC_FINAL;
+ if (s.indexOf("super") != -1)
+ access |= Opcodes.ACC_SUPER;
+ if (s.indexOf("synchronized") != -1)
+ access |= Opcodes.ACC_SYNCHRONIZED;
+ if (s.indexOf("volatile") != -1)
+ access |= Opcodes.ACC_VOLATILE;
+ if (s.indexOf("bridge") != -1)
+ access |= Opcodes.ACC_BRIDGE;
+ if (s.indexOf("varargs") != -1)
+ access |= Opcodes.ACC_VARARGS;
+ if (s.indexOf("transient") != -1)
+ access |= Opcodes.ACC_TRANSIENT;
+ if (s.indexOf("native") != -1)
+ access |= Opcodes.ACC_NATIVE;
+ if (s.indexOf("interface") != -1)
+ access |= Opcodes.ACC_INTERFACE;
+ if (s.indexOf("abstract") != -1)
+ access |= Opcodes.ACC_ABSTRACT;
+ if (s.indexOf("strict") != -1)
+ access |= Opcodes.ACC_STRICT;
+ if (s.indexOf("synthetic") != -1)
+ access |= Opcodes.ACC_SYNTHETIC;
+ if (s.indexOf("annotation") != -1)
+ access |= Opcodes.ACC_ANNOTATION;
+ if (s.indexOf("enum") != -1)
+ access |= Opcodes.ACC_ENUM;
+ if (s.indexOf("deprecated") != -1)
+ access |= Opcodes.ACC_DEPRECATED;
+ return access;
+ }
+
+ }
+
+ /**
+ * ClassRule
+ */
+ private final class ClassRule extends Rule {
+
+ public final void begin(String name, Attributes attrs) {
+ int major = Integer.parseInt(attrs.getValue("major"));
+ int minor = Integer.parseInt(attrs.getValue("minor"));
+ cw = new ClassWriter(computeMax);
+ Map vals = new HashMap();
+ vals.put("version", new Integer(minor << 16 | major));
+ vals.put("access", attrs.getValue("access"));
+ vals.put("name", attrs.getValue("name"));
+ vals.put("parent", attrs.getValue("parent"));
+ vals.put("source", attrs.getValue("source"));
+ vals.put("signature", attrs.getValue("signature"));
+ vals.put("interfaces", new ArrayList());
+ push(vals);
+ // values will be extracted in InterfacesRule.end();
+ }
+
+ }
+
+ private final class SourceRule extends Rule {
+
+ public void begin(String name, Attributes attrs) {
+ String file = attrs.getValue("file");
+ String debug = attrs.getValue("debug");
+ cw.visitSource(file, debug);
+ }
+
+ }
+
+ /**
+ * InterfaceRule
+ */
+ private final class InterfaceRule extends Rule {
+
+ public final void begin(String name, Attributes attrs) {
+ ((List) ((Map) peek()).get("interfaces")).add(attrs.getValue("name"));
+ }
+
+ }
+
+ /**
+ * InterfacesRule
+ */
+ private final class InterfacesRule extends Rule {
+
+ public final void end(String element) {
+ Map vals = (Map) pop();
+ int version = ((Integer) vals.get("version")).intValue();
+ int access = getAccess((String) vals.get("access"));
+ String name = (String) vals.get("name");
+ String signature = (String) vals.get("signature");
+ String parent = (String) vals.get("parent");
+ List infs = (List) vals.get("interfaces");
+ String[] interfaces = (String[]) infs.toArray(new String[infs.size()]);
+ cw.visit(version, access, name, signature, parent, interfaces);
+ push(cw);
+ }
+
+ }
+
+ /**
+ * OuterClassRule
+ */
+ private final class OuterClassRule extends Rule {
+
+ public final void begin(String element, Attributes attrs) {
+ String owner = attrs.getValue("owner");
+ String name = attrs.getValue("name");
+ String desc = attrs.getValue("desc");
+ cw.visitOuterClass(owner, name, desc);
+ }
+
+ }
+
+ /**
+ * InnerClassRule
+ */
+ private final class InnerClassRule extends Rule {
+
+ public final void begin(String element, Attributes attrs) {
+ int access = getAccess(attrs.getValue("access"));
+ String name = attrs.getValue("name");
+ String outerName = attrs.getValue("outerName");
+ String innerName = attrs.getValue("innerName");
+ cw.visitInnerClass(name, outerName, innerName, access);
+ }
+
+ }
+
+ /**
+ * FieldRule
+ */
+ private final class FieldRule extends Rule {
+
+ public final void begin(String element, Attributes attrs) {
+ int access = getAccess(attrs.getValue("access"));
+ String name = attrs.getValue("name");
+ String signature = attrs.getValue("signature");
+ String desc = attrs.getValue("desc");
+ Object value = getValue(desc, attrs.getValue("value"));
+ push(cw.visitField(access, name, desc, signature, value));
+ }
+
+ public void end(String name) {
+ ((FieldVisitor) pop()).visitEnd();
+ }
+
+ }
+
+ /**
+ * MethodRule
+ */
+ private final class MethodRule extends Rule {
+
+ public final void begin(String name, Attributes attrs) {
+ labels = new HashMap();
+ Map vals = new HashMap();
+ vals.put("access", attrs.getValue("access"));
+ vals.put("name", attrs.getValue("name"));
+ vals.put("desc", attrs.getValue("desc"));
+ vals.put("signature", attrs.getValue("signature"));
+ vals.put("exceptions", new ArrayList());
+ push(vals);
+ // values will be extracted in ExceptionsRule.end();
+ }
+
+ public final void end(String name) {
+ ((MethodVisitor) pop()).visitEnd();
+ labels = null;
+ }
+
+ }
+
+ /**
+ * ExceptionRule
+ */
+ private final class ExceptionRule extends Rule {
+
+ public final void begin(String name, Attributes attrs) {
+ ((List) ((Map) peek()).get("exceptions")).add(attrs.getValue("name"));
+ }
+
+ }
+
+ /**
+ * ExceptionsRule
+ */
+ private final class ExceptionsRule extends Rule {
+
+ public final void end(String element) {
+ Map vals = (Map) pop();
+ int access = getAccess((String) vals.get("access"));
+ String name = (String) vals.get("name");
+ String desc = (String) vals.get("desc");
+ String signature = (String) vals.get("signature");
+ List excs = (List) vals.get("exceptions");
+ String[] exceptions = (String[]) excs.toArray(new String[excs.size()]);
+
+ push(cw.visitMethod(access, name, desc, signature, exceptions));
+ }
+
+ }
+
+ /**
+ * TableSwitchRule
+ */
+ private class TableSwitchRule extends Rule {
+
+ public final void begin(String name, Attributes attrs) {
+ Map vals = new HashMap();
+ vals.put("min", attrs.getValue("min"));
+ vals.put("max", attrs.getValue("max"));
+ vals.put("dflt", attrs.getValue("dflt"));
+ vals.put("labels", new ArrayList());
+ push(vals);
+ }
+
+ public final void end(String name) {
+ Map vals = (Map) pop();
+ int min = Integer.parseInt((String) vals.get("min"));
+ int max = Integer.parseInt((String) vals.get("max"));
+ Label dflt = getLabel(vals.get("dflt"));
+ List lbls = (List) vals.get("labels");
+ Label[] labels = (Label[]) lbls.toArray(new Label[lbls.size()]);
+ getCodeVisitor().visitTableSwitchInsn(min, max, dflt, labels);
+ }
+
+ }
+
+ /**
+ * TableSwitchLabelRule
+ */
+ private final class TableSwitchLabelRule extends Rule {
+
+ public final void begin(String name, Attributes attrs) {
+ ((List) ((Map) peek()).get("labels")).add(getLabel(attrs.getValue("name")));
+ }
+
+ }
+
+ /**
+ * LookupSwitchRule
+ */
+ private final class LookupSwitchRule extends Rule {
+
+ public final void begin(String name, Attributes attrs) {
+ Map vals = new HashMap();
+ vals.put("dflt", attrs.getValue("dflt"));
+ vals.put("labels", new ArrayList());
+ vals.put("keys", new ArrayList());
+ push(vals);
+ }
+
+ public final void end(String name) {
+ Map vals = (Map) pop();
+ Label dflt = getLabel(vals.get("dflt"));
+ List keyList = (List) vals.get("keys");
+ List lbls = (List) vals.get("labels");
+ Label[] labels = (Label[]) lbls.toArray(new Label[lbls.size()]);
+ int[] keys = new int[keyList.size()];
+ for (int i = 0; i < keys.length; i++) {
+ keys[i] = Integer.parseInt((String) keyList.get(i));
+ }
+ getCodeVisitor().visitLookupSwitchInsn(dflt, keys, labels);
+ }
+
+ }
+
+ /**
+ * LookupSwitchLabelRule
+ */
+ private final class LookupSwitchLabelRule extends Rule {
+
+ public final void begin(String name, Attributes attrs) {
+ Map vals = (Map) peek();
+ ((List) vals.get("labels")).add(getLabel(attrs.getValue("name")));
+ ((List) vals.get("keys")).add(attrs.getValue("key"));
+ }
+
+ }
+
+ /**
+ * LabelRule
+ */
+ private final class LabelRule extends Rule {
+
+ public final void begin(String name, Attributes attrs) {
+ getCodeVisitor().visitLabel(getLabel(attrs.getValue("name")));
+ }
+
+ }
+
+ /**
+ * TryCatchRule
+ */
+ private final class TryCatchRule extends Rule {
+
+ public final void begin(String name, Attributes attrs) {
+ Label start = getLabel(attrs.getValue("start"));
+ Label end = getLabel(attrs.getValue("end"));
+ Label handler = getLabel(attrs.getValue("handler"));
+ String type = attrs.getValue("type");
+ getCodeVisitor().visitTryCatchBlock(start, end, handler, type);
+ }
+
+ }
+
+ /**
+ * LineNumberRule
+ */
+ private final class LineNumberRule extends Rule {
+
+ public final void begin(String name, Attributes attrs) {
+ int line = Integer.parseInt(attrs.getValue("line"));
+ Label start = getLabel(attrs.getValue("start"));
+ getCodeVisitor().visitLineNumber(line, start);
+ }
+
+ }
+
+ /**
+ * LocalVarRule
+ */
+ private final class LocalVarRule extends Rule {
+
+ public final void begin(String element, Attributes attrs) {
+ String name = attrs.getValue("name");
+ String desc = attrs.getValue("desc");
+ String signature = attrs.getValue("signature");
+ Label start = getLabel(attrs.getValue("start"));
+ Label end = getLabel(attrs.getValue("end"));
+ int var = Integer.parseInt(attrs.getValue("var"));
+ getCodeVisitor().visitLocalVariable(name,
+ desc,
+ signature,
+ start,
+ end,
+ var);
+ }
+
+ }
+
+ /**
+ * OpcodesRule
+ */
+ private final class OpcodesRule extends Rule {
+
+ // public boolean match( String match, String element) {
+ // return match.startsWith( path) && OPCODES.containsKey( element);
+ // }
+
+ public final void begin(String element, Attributes attrs) {
+ Opcode o = ((Opcode) OPCODES.get(element));
+ if (o == null)
+ return;
+
+ switch (o.type) {
+ case OpcodeGroup.INSN:
+ getCodeVisitor().visitInsn(o.opcode);
+ break;
+
+ case OpcodeGroup.INSN_FIELD:
+ getCodeVisitor().visitFieldInsn(o.opcode,
+ attrs.getValue("owner"),
+ attrs.getValue("name"),
+ attrs.getValue("desc"));
+ break;
+
+ case OpcodeGroup.INSN_INT:
+ getCodeVisitor().visitIntInsn(o.opcode,
+ Integer.parseInt(attrs.getValue("value")));
+ break;
+
+ case OpcodeGroup.INSN_JUMP:
+ getCodeVisitor().visitJumpInsn(o.opcode,
+ getLabel(attrs.getValue("label")));
+ break;
+
+ case OpcodeGroup.INSN_METHOD:
+ getCodeVisitor().visitMethodInsn(o.opcode,
+ attrs.getValue("owner"),
+ attrs.getValue("name"),
+ attrs.getValue("desc"));
+ break;
+
+ case OpcodeGroup.INSN_TYPE:
+ getCodeVisitor().visitTypeInsn(o.opcode,
+ attrs.getValue("desc"));
+ break;
+
+ case OpcodeGroup.INSN_VAR:
+ getCodeVisitor().visitVarInsn(o.opcode,
+ Integer.parseInt(attrs.getValue("var")));
+ break;
+
+ case OpcodeGroup.INSN_IINC:
+ getCodeVisitor().visitIincInsn(Integer.parseInt(attrs.getValue("var")),
+ Integer.parseInt(attrs.getValue("inc")));
+ break;
+
+ case OpcodeGroup.INSN_LDC:
+ getCodeVisitor().visitLdcInsn(getValue(attrs.getValue("desc"),
+ attrs.getValue("cst")));
+ break;
+
+ case OpcodeGroup.INSN_MULTIANEWARRAY:
+ getCodeVisitor().visitMultiANewArrayInsn(attrs.getValue("desc"),
+ Integer.parseInt(attrs.getValue("dims")));
+ break;
+
+ default:
+ throw new RuntimeException("Invalid element: " + element
+ + " at " + match);
+
+ }
+ }
+ }
+
+ /**
+ * MaxRule
+ */
+ private final class MaxRule extends Rule {
+
+ public final void begin(String element, Attributes attrs) {
+ int maxStack = Integer.parseInt(attrs.getValue("maxStack"));
+ int maxLocals = Integer.parseInt(attrs.getValue("maxLocals"));
+ getCodeVisitor().visitMaxs(maxStack, maxLocals);
+ }
+
+ }
+
+ private final class AnnotationRule extends Rule {
+
+ public void begin(String name, Attributes attrs) {
+ String desc = attrs.getValue("desc");
+ boolean visible = Boolean.valueOf(attrs.getValue("visible"))
+ .booleanValue();
+
+ Object v = peek();
+ if (v instanceof ClassVisitor) {
+ push(((ClassVisitor) v).visitAnnotation(desc, visible));
+ } else if (v instanceof FieldVisitor) {
+ push(((FieldVisitor) v).visitAnnotation(desc, visible));
+ } else if (v instanceof MethodVisitor) {
+ push(((MethodVisitor) v).visitAnnotation(desc, visible));
+ }
+ }
+
+ public void end(String name) {
+ ((AnnotationVisitor) pop()).visitEnd();
+ }
+
+ }
+
+ private final class AnnotationParameterRule extends Rule {
+
+ public void begin(String name, Attributes attrs) {
+ int parameter = Integer.parseInt(attrs.getValue("parameter"));
+ String desc = attrs.getValue("desc");
+ boolean visible = Boolean.valueOf(attrs.getValue("visible"))
+ .booleanValue();
+
+ push(((MethodVisitor) peek()).visitParameterAnnotation(parameter,
+ desc,
+ visible));
+ }
+
+ public void end(String name) {
+ ((AnnotationVisitor) pop()).visitEnd();
+ }
+
+ }
+
+ private final class AnnotationValueRule extends Rule {
+
+ public void begin(String nm, Attributes attrs) {
+ String name = attrs.getValue("name");
+ String desc = attrs.getValue("desc");
+ String value = attrs.getValue("value");
+ ((AnnotationVisitor) peek()).visit(name, getValue(desc, value));
+ }
+
+ }
+
+ private final class AnnotationValueEnumRule extends Rule {
+
+ public void begin(String nm, Attributes attrs) {
+ String name = attrs.getValue("name");
+ String desc = attrs.getValue("desc");
+ String value = attrs.getValue("value");
+ ((AnnotationVisitor) peek()).visitEnum(name, desc, value);
+ }
+
+ }
+
+ private final class AnnotationValueAnnotationRule extends Rule {
+
+ public void begin(String nm, Attributes attrs) {
+ String name = attrs.getValue("name");
+ String desc = attrs.getValue("desc");
+ push(((AnnotationVisitor) peek()).visitAnnotation(name, desc));
+ }
+
+ public void end(String name) {
+ ((AnnotationVisitor) pop()).visitEnd();
+ }
+
+ }
+
+ private final class AnnotationValueArrayRule extends Rule {
+
+ public void begin(String nm, Attributes attrs) {
+ String name = attrs.getValue("name");
+ push(((AnnotationVisitor) peek()).visitArray(name));
+ }
+
+ public void end(String name) {
+ ((AnnotationVisitor) pop()).visitEnd();
+ }
+
+ }
+
+ private final class AnnotationDefaultRule extends Rule {
+
+ public void begin(String nm, Attributes attrs) {
+ push(((MethodVisitor) peek()).visitAnnotationDefault());
+ }
+
+ public void end(String name) {
+ ((AnnotationVisitor) pop()).visitEnd();
+ }
+
+ }
+
+ /**
+ * Opcode
+ */
+ private final static class Opcode {
+ public int opcode;
+
+ public int type;
+
+ public Opcode(int opcode, int type) {
+ this.opcode = opcode;
+ this.type = type;
+ }
+
+ }
+
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/Processor.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/Processor.java
new file mode 100644
index 00000000000..2baeb0f36fe
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/Processor.java
@@ -0,0 +1,1048 @@
+/***
+ * ASM XML Adapter
+ * Copyright (c) 2004, Eugene Kuleshov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.xml;
+
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipOutputStream;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.Templates;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stream.StreamSource;
+
+import org.objectweb.asm.ClassReader;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.AttributesImpl;
+import org.xml.sax.helpers.DefaultHandler;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Processor is a command line tool that can be used for bytecode waving
+ * directed by XSL transformation. <p> In order to use a concrete XSLT engine,
+ * system property <tt>javax.xml.transform.TransformerFactory</tt> must be set
+ * to one of the following values.
+ *
+ * <blockquote> <table border="1" cellspacing="0" cellpadding="3"> <tr> <td>jd.xslt</td>
+ * <td>jd.xml.xslt.trax.TransformerFactoryImpl</td> </tr>
+ *
+ * <tr> <td>Saxon</td> <td>net.sf.saxon.TransformerFactoryImpl</td> </tr>
+ *
+ * <tr> <td>Caucho</td> <td>com.caucho.xsl.Xsl</td> </tr>
+ *
+ * <tr> <td>Xalan interpeter</td> <td>org.apache.xalan.processor.TransformerFactory</td>
+ * </tr>
+ *
+ * <tr> <td>Xalan xsltc</td> <td>org.apache.xalan.xsltc.trax.TransformerFactoryImpl</td>
+ * </tr> </table> </blockquote>
+ *
+ * @author Eugene Kuleshov
+ */
+public class Processor {
+
+ public static final int BYTECODE = 1;
+
+ public static final int MULTI_XML = 2;
+
+ public static final int SINGLE_XML = 3;
+
+ private static final String SINGLE_XML_NAME = "classes.xml";
+
+ private int inRepresentation;
+
+ private int outRepresentation;
+
+ private InputStream input = null;
+
+ private OutputStream output = null;
+
+ private Source xslt = null;
+
+ private boolean computeMax;
+
+ private int n = 0;
+
+ public Processor(
+ int inRepresenation,
+ int outRepresentation,
+ InputStream input,
+ OutputStream output,
+ Source xslt)
+ {
+ this.inRepresentation = inRepresenation;
+ this.outRepresentation = outRepresentation;
+ this.input = input;
+ this.output = output;
+ this.xslt = xslt;
+ this.computeMax = true;
+ }
+
+ public int process() throws TransformerException, IOException, SAXException
+ {
+ ZipInputStream zis = new ZipInputStream(input);
+ final ZipOutputStream zos = new ZipOutputStream(output);
+ final OutputStreamWriter osw = new OutputStreamWriter(zos);
+
+ Thread.currentThread()
+ .setContextClassLoader(getClass().getClassLoader());
+
+ TransformerFactory tf = TransformerFactory.newInstance();
+ if (!tf.getFeature(SAXSource.FEATURE)
+ || !tf.getFeature(SAXResult.FEATURE))
+ return 0;
+
+ SAXTransformerFactory saxtf = (SAXTransformerFactory) tf;
+ Templates templates = null;
+ if (xslt != null) {
+ templates = saxtf.newTemplates(xslt);
+ }
+
+ // configuring outHandlerFactory
+ // ///////////////////////////////////////////////////////
+
+ EntryElement entryElement = getEntryElement(zos);
+
+ ContentHandler outDocHandler = null;
+ switch (outRepresentation) {
+ case BYTECODE:
+ outDocHandler = new OutputSlicingHandler(new ASMContentHandlerFactory(zos,
+ computeMax),
+ entryElement,
+ false);
+ break;
+
+ case MULTI_XML:
+ outDocHandler = new OutputSlicingHandler(new SAXWriterFactory(osw,
+ true),
+ entryElement,
+ true);
+ break;
+
+ case SINGLE_XML:
+ ZipEntry outputEntry = new ZipEntry(SINGLE_XML_NAME);
+ zos.putNextEntry(outputEntry);
+ outDocHandler = new SAXWriter(osw, false);
+ break;
+
+ }
+
+ // configuring inputDocHandlerFactory
+ // /////////////////////////////////////////////////
+ ContentHandler inDocHandler = null;
+ if (templates == null) {
+ inDocHandler = outDocHandler;
+ } else {
+ inDocHandler = new InputSlicingHandler("class",
+ outDocHandler,
+ new TransformerHandlerFactory(saxtf,
+ templates,
+ outDocHandler));
+ }
+ ContentHandlerFactory inDocHandlerFactory = new SubdocumentHandlerFactory(inDocHandler);
+
+ if (inDocHandler != null && inRepresentation != SINGLE_XML) {
+ inDocHandler.startDocument();
+ inDocHandler.startElement("",
+ "classes",
+ "classes",
+ new AttributesImpl());
+ }
+
+ int i = 0;
+ ZipEntry ze = null;
+ while ((ze = zis.getNextEntry()) != null) {
+ update(ze.getName(), n++);
+ if (isClassEntry(ze)) {
+ processEntry(zis, ze, inDocHandlerFactory);
+ } else {
+ OutputStream os = entryElement.openEntry(getName(ze));
+ copyEntry(zis, os);
+ entryElement.closeEntry();
+ }
+
+ i++;
+ }
+
+ if (inDocHandler != null && inRepresentation != SINGLE_XML) {
+ inDocHandler.endElement("", "classes", "classes");
+ inDocHandler.endDocument();
+ }
+
+ if (outRepresentation == SINGLE_XML) {
+ zos.closeEntry();
+ }
+ zos.flush();
+ zos.close();
+
+ return i;
+ }
+
+ private void copyEntry(InputStream is, OutputStream os) throws IOException {
+ if (outRepresentation == SINGLE_XML)
+ return;
+
+ byte[] buff = new byte[2048];
+ int i;
+ while ((i = is.read(buff)) != -1) {
+ os.write(buff, 0, i);
+ }
+ }
+
+ private boolean isClassEntry(ZipEntry ze) {
+ String name = ze.getName();
+ return inRepresentation == SINGLE_XML && name.equals(SINGLE_XML_NAME)
+ || name.endsWith(".class") || name.endsWith(".class.xml");
+ }
+
+ private void processEntry(
+ final ZipInputStream zis,
+ ZipEntry ze,
+ ContentHandlerFactory handlerFactory)
+ {
+ ContentHandler handler = handlerFactory.createContentHandler();
+ try {
+
+ // if (CODE2ASM.equals(command)) { // read bytecode and process it
+ // // with TraceClassVisitor
+ // ClassReader cr = new ClassReader(readEntry(zis, ze));
+ // cr.accept(new TraceClassVisitor(null, new PrintWriter(os)),
+ // false);
+ // }
+
+ boolean singleInputDocument = inRepresentation == SINGLE_XML;
+ if (inRepresentation == BYTECODE) { // read bytecode and process it
+ // with handler
+ ClassReader cr = new ClassReader(readEntry(zis, ze));
+ cr.accept(new SAXClassAdapter(handler, singleInputDocument),
+ false);
+
+ } else { // read XML and process it with handler
+ XMLReader reader = XMLReaderFactory.createXMLReader();
+ reader.setContentHandler(handler);
+ reader.parse(new InputSource(singleInputDocument
+ ? (InputStream) new ProtectedInputStream(zis)
+ : new ByteArrayInputStream(readEntry(zis, ze))));
+
+ }
+ } catch (Exception ex) {
+ update(ze.getName(), 0);
+ update(ex, 0);
+ }
+ }
+
+ private EntryElement getEntryElement(ZipOutputStream zos) {
+ if (outRepresentation == SINGLE_XML) {
+ return new SingleDocElement(zos);
+ }
+ return new ZipEntryElement(zos);
+ }
+
+ // private ContentHandlerFactory getHandlerFactory(
+ // OutputStream os,
+ // SAXTransformerFactory saxtf,
+ // Templates templates)
+ // {
+ // ContentHandlerFactory factory = null;
+ // if (templates == null) {
+ // if (outputRepresentation == BYTECODE) { // factory used to write
+ // // bytecode
+ // factory = new ASMContentHandlerFactory(os, computeMax);
+ // } else { // factory used to write XML
+ // factory = new SAXWriterFactory(os, true);
+ // }
+ // } else {
+ // if (outputRepresentation == BYTECODE) { // factory used to transform
+ // // and then write bytecode
+ // factory = new ASMTransformerHandlerFactory(saxtf,
+ // templates,
+ // os,
+ // computeMax);
+ // } else { // factory used to transformand then write XML
+ // factory = new TransformerHandlerFactory(saxtf,
+ // templates,
+ // os,
+ // outputRepresentation == SINGLE_XML);
+ // }
+ // }
+ // return factory;
+ // }
+
+ private String getName(ZipEntry ze) {
+ String name = ze.getName();
+ if (isClassEntry(ze)) {
+ if (inRepresentation != BYTECODE && outRepresentation == BYTECODE) {
+ name = name.substring(0, name.length() - 4); // .class.xml to
+ // .class
+ } else if (inRepresentation == BYTECODE
+ && outRepresentation != BYTECODE)
+ {
+ name = name.concat(".xml"); // .class to .class.xml
+ }
+ // } else if( CODE2ASM.equals( command)) {
+ // name = name.substring( 0, name.length()-6).concat( ".asm");
+ }
+ return name;
+ }
+
+ private byte[] readEntry(ZipInputStream zis, ZipEntry ze)
+ throws IOException
+ {
+ long size = ze.getSize();
+ if (size > -1) {
+ byte[] buff = new byte[(int) size];
+ int k = 0;
+ int n;
+ while(( n = zis.read(buff, k, buff.length-k)) > 0) {
+ k += n;
+ }
+ return buff;
+ }
+
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ byte[] buff = new byte[4096];
+ int i;
+ while ((i = zis.read(buff)) != -1) {
+ bos.write(buff, 0, i);
+ }
+ return bos.toByteArray();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
+ */
+ protected void update(Object arg, int n) {
+ if (arg instanceof Throwable) {
+ ((Throwable) arg).printStackTrace();
+ } else {
+ if ((n % 100) == 0) {
+ System.err.println(n + " " + arg);
+ }
+ }
+ }
+
+ public static void main(String[] args) throws Exception {
+ if (args.length < 2) {
+ showUsage();
+ return;
+ }
+
+ int inRepresentation = getRepresentation(args[0]);
+ int outRepresentation = getRepresentation(args[1]);
+
+ InputStream is = System.in;
+ OutputStream os = new BufferedOutputStream(System.out);
+
+ Source xslt = null;
+ // boolean computeMax = true;
+
+ for (int i = 2; i < args.length; i++) {
+ if ("-in".equals(args[i])) {
+ is = new FileInputStream(args[++i]);
+
+ } else if ("-out".equals(args[i])) {
+ os = new BufferedOutputStream(new FileOutputStream(args[++i]));
+
+ } else if ("-xslt".equals(args[i])) {
+ xslt = new StreamSource(new FileInputStream(args[++i]));
+
+ // } else if( "-computemax".equals( args[ i].toLowerCase())) {
+ // computeMax = true;
+
+ } else {
+ showUsage();
+ return;
+
+ }
+ }
+
+ if (inRepresentation == 0 || outRepresentation == 0) {
+ showUsage();
+ return;
+ }
+
+ Processor m = new Processor(inRepresentation,
+ outRepresentation,
+ is,
+ os,
+ xslt);
+
+ long l1 = System.currentTimeMillis();
+ int n = m.process();
+ long l2 = System.currentTimeMillis();
+ System.err.println(n);
+ System.err.println("" + (l2 - l1) + "ms " + (1000f * n / (l2 - l1))
+ + " resources/sec");
+ }
+
+ private static int getRepresentation(String s) {
+ if ("code".equals(s)) {
+ return BYTECODE;
+ } else if ("xml".equals(s)) {
+ return MULTI_XML;
+ } else if ("singlexml".equals(s)) {
+ return SINGLE_XML;
+ }
+ return 0;
+ }
+
+ private static void showUsage() {
+ System.err.println("Usage: Main <in format> <out format> [-in <input jar>] [-out <output jar>] [-xslt <xslt file>]");
+ System.err.println(" when -in or -out is omitted sysin and sysout would be used");
+ System.err.println(" <in format> and <out format> - code | xml | singlexml");
+ }
+
+ /**
+ * IputStream wrapper class used to protect input streams from being closed
+ * by some stupid XML parsers.
+ */
+ private static final class ProtectedInputStream extends InputStream {
+ private final InputStream is;
+
+ private ProtectedInputStream(InputStream is) {
+ super();
+ this.is = is;
+ }
+
+ public final void close() throws IOException {
+ }
+
+ public final int read() throws IOException {
+ return is.read();
+ }
+
+ public final int read(byte[] b, int off, int len) throws IOException {
+ return is.read(b, off, len);
+ }
+
+ public final int available() throws IOException {
+ return is.available();
+ }
+ }
+
+ /**
+ * A {@link ContentHandlerFactory ContentHandlerFactory} is used to create
+ * {@link org.xml.sax.ContentHandler ContentHandler} instances for concrete
+ * context.
+ */
+ private static interface ContentHandlerFactory {
+
+ /**
+ * Creates an instance of the content handler.
+ *
+ * @return content handler
+ */
+ ContentHandler createContentHandler();
+
+ }
+
+ /**
+ * SAXWriterFactory
+ */
+ private static final class SAXWriterFactory implements
+ ContentHandlerFactory
+ {
+ private Writer w;
+
+ private boolean optimizeEmptyElements;
+
+ public SAXWriterFactory(Writer w, boolean optimizeEmptyElements) {
+ this.w = w;
+ this.optimizeEmptyElements = optimizeEmptyElements;
+ }
+
+ public final ContentHandler createContentHandler() {
+ return new SAXWriter(w, optimizeEmptyElements);
+ }
+
+ }
+
+ /**
+ * ASMContentHandlerFactory
+ */
+ private static final class ASMContentHandlerFactory implements
+ ContentHandlerFactory
+ {
+ private OutputStream os;
+
+ private boolean computeMax;
+
+ public ASMContentHandlerFactory(OutputStream os, boolean computeMax) {
+ this.os = os;
+ this.computeMax = computeMax;
+ }
+
+ public final ContentHandler createContentHandler() {
+ return new ASMContentHandler(os, computeMax);
+ }
+
+ }
+
+ /**
+ * TransformerHandlerFactory
+ */
+ private static final class TransformerHandlerFactory implements
+ ContentHandlerFactory
+ {
+ private SAXTransformerFactory saxtf;
+
+ private Templates templates;
+
+ private ContentHandler outputHandler;
+
+ public TransformerHandlerFactory(
+ SAXTransformerFactory saxtf,
+ Templates templates,
+ ContentHandler outputHandler)
+ {
+ this.saxtf = saxtf;
+ this.templates = templates;
+ this.outputHandler = outputHandler;
+ }
+
+ public final ContentHandler createContentHandler() {
+ try {
+ TransformerHandler handler = saxtf.newTransformerHandler(templates);
+ handler.setResult(new SAXResult(outputHandler));
+ return handler;
+ } catch (TransformerConfigurationException ex) {
+ throw new RuntimeException(ex.toString());
+ }
+ }
+ }
+
+ /**
+ * SubdocumentHandlerFactory
+ */
+ private final static class SubdocumentHandlerFactory implements
+ ContentHandlerFactory
+ {
+ private ContentHandler subdocumentHandler;
+
+ public SubdocumentHandlerFactory(ContentHandler subdocumentHandler) {
+ this.subdocumentHandler = subdocumentHandler;
+ }
+
+ public final ContentHandler createContentHandler() {
+ return subdocumentHandler;
+ }
+
+ }
+
+ /**
+ * A {@link org.xml.sax.ContentHandler ContentHandler} and
+ * {@link org.xml.sax.ext.LexicalHandler LexicalHandler} that serializes XML
+ * from SAX 2.0 events into {@link java.io.Writer Writer}.
+ *
+ * <i><blockquote> This implementation does not support namespaces, entity
+ * definitions (uncluding DTD), CDATA and text elements. </blockquote></i>
+ */
+ private final static class SAXWriter extends DefaultHandler implements
+ LexicalHandler
+ {
+ private static final char[] OFF = " ".toCharArray();
+
+ private Writer w;
+
+ private boolean optimizeEmptyElements;
+
+ private boolean openElement = false;
+
+ private int ident = 0;
+
+ /**
+ * Creates <code>SAXWriter</code>.
+ *
+ * @param w writer
+ * @param optimizeEmptyElements if set to <code>true</code>, short
+ * XML syntax will be used for empty elements
+ */
+ public SAXWriter(Writer w, boolean optimizeEmptyElements) {
+ this.w = w;
+ this.optimizeEmptyElements = optimizeEmptyElements;
+ }
+
+ public final void startElement(
+ String ns,
+ String localName,
+ String qName,
+ Attributes atts) throws SAXException
+ {
+ try {
+ closeElement();
+
+ writeIdent();
+ w.write("<".concat(qName));
+ if (atts != null && atts.getLength() > 0)
+ writeAttributes(atts);
+
+ if (!optimizeEmptyElements) {
+ w.write(">\n");
+ } else {
+ openElement = true;
+ }
+ ident += 2;
+
+ } catch (IOException ex) {
+ throw new SAXException(ex);
+
+ }
+ }
+
+ public final void endElement(String ns, String localName, String qName)
+ throws SAXException
+ {
+ ident -= 2;
+ try {
+ if (openElement) {
+ w.write("/>\n");
+ openElement = false;
+ } else {
+ writeIdent();
+ w.write("</" + qName + ">\n");
+ }
+
+ } catch (IOException ex) {
+ throw new SAXException(ex);
+
+ }
+ }
+
+ public final void endDocument() throws SAXException {
+ try {
+ w.flush();
+
+ } catch (IOException ex) {
+ throw new SAXException(ex);
+
+ }
+ }
+
+ public final void comment(char[] ch, int off, int len)
+ throws SAXException
+ {
+ try {
+ closeElement();
+
+ writeIdent();
+ w.write("<!-- ");
+ w.write(ch, off, len);
+ w.write(" -->\n");
+
+ } catch (IOException ex) {
+ throw new SAXException(ex);
+
+ }
+ }
+
+ public final void startDTD(String arg0, String arg1, String arg2)
+ throws SAXException
+ {
+ }
+
+ public final void endDTD() throws SAXException {
+ }
+
+ public final void startEntity(String arg0) throws SAXException {
+ }
+
+ public final void endEntity(String arg0) throws SAXException {
+ }
+
+ public final void startCDATA() throws SAXException {
+ }
+
+ public final void endCDATA() throws SAXException {
+ }
+
+ private final void writeAttributes(Attributes atts) throws IOException {
+ StringBuffer sb = new StringBuffer();
+ int len = atts.getLength();
+ for (int i = 0; i < len; i++) {
+ sb.append(" ")
+ .append(atts.getLocalName(i))
+ .append("=\"")
+ .append(esc(atts.getValue(i)))
+ .append("\"");
+ }
+ w.write(sb.toString());
+ }
+
+ /**
+ * Encode string with escaping.
+ *
+ * @param str string to encode.
+ * @return encoded string
+ */
+ private final String esc(String str) {
+ StringBuffer sb = new StringBuffer(str.length());
+ for (int i = 0; i < str.length(); i++) {
+ char ch = str.charAt(i);
+ switch (ch) {
+ case '&':
+ sb.append("&amp;");
+ break;
+
+ case '<':
+ sb.append("&lt;");
+ break;
+
+ case '>':
+ sb.append("&gt;");
+ break;
+
+ case '\"':
+ sb.append("&quot;");
+ break;
+
+ default:
+ if (ch > 0x7f) {
+ sb.append("&#")
+ .append(Integer.toString(ch))
+ .append(';');
+ } else {
+ sb.append(ch);
+ }
+
+ }
+ }
+ return sb.toString();
+ }
+
+ private final void writeIdent() throws IOException {
+ int n = ident;
+ while (n > 0) {
+ if (n > OFF.length) {
+ w.write(OFF);
+ n -= OFF.length;
+ } else {
+ w.write(OFF, 0, n);
+ n = 0;
+ }
+ }
+ }
+
+ private final void closeElement() throws IOException {
+ if (openElement) {
+ w.write(">\n");
+ }
+ openElement = false;
+ }
+
+ }
+
+ /**
+ * A {@link org.xml.sax.ContentHandler ContentHandler} that splits XML
+ * documents into smaller chunks. Each chunk is processed by the nested
+ * {@link org.xml.sax.ContentHandler ContentHandler} obtained from
+ * {@link java.net.ContentHandlerFactory ContentHandlerFactory}. This is
+ * useful for running XSLT engine against large XML document that will
+ * hardly fit into the memory all together. <p> TODO use complete path for
+ * subdocumentRoot
+ */
+ private final static class InputSlicingHandler extends DefaultHandler {
+ private String subdocumentRoot;
+
+ private ContentHandler rootHandler;
+
+ private ContentHandlerFactory subdocumentHandlerFactory;
+
+ private boolean subdocument = false;
+
+ private ContentHandler subdocumentHandler;
+
+ /**
+ * Constructs a new {@link InputSlicingHandler SubdocumentHandler}
+ * object.
+ *
+ * @param subdocumentRoot name/path to the root element of the
+ * subdocument
+ * @param rootHandler content handler for the entire document
+ * (subdocument envelope).
+ * @param subdocumentHandlerFactory a
+ * {@link ContentHandlerFactory ContentHandlerFactory} used to
+ * create {@link ContentHandler ContentHandler} instances for
+ * subdocuments.
+ */
+ public InputSlicingHandler(
+ String subdocumentRoot,
+ ContentHandler rootHandler,
+ ContentHandlerFactory subdocumentHandlerFactory)
+ {
+ this.subdocumentRoot = subdocumentRoot;
+ this.rootHandler = rootHandler;
+ this.subdocumentHandlerFactory = subdocumentHandlerFactory;
+ }
+
+ public final void startElement(
+ String namespaceURI,
+ String localName,
+ String qName,
+ Attributes list) throws SAXException
+ {
+ if (subdocument) {
+ subdocumentHandler.startElement(namespaceURI,
+ localName,
+ qName,
+ list);
+ } else if (localName.equals(subdocumentRoot)) {
+ subdocumentHandler = subdocumentHandlerFactory.createContentHandler();
+ subdocumentHandler.startDocument();
+ subdocumentHandler.startElement(namespaceURI,
+ localName,
+ qName,
+ list);
+ subdocument = true;
+ } else if (rootHandler != null) {
+ rootHandler.startElement(namespaceURI, localName, qName, list);
+ }
+ }
+
+ public final void endElement(
+ String namespaceURI,
+ String localName,
+ String qName) throws SAXException
+ {
+ if (subdocument) {
+ subdocumentHandler.endElement(namespaceURI, localName, qName);
+ if (localName.equals(subdocumentRoot)) {
+ subdocumentHandler.endDocument();
+ subdocument = false;
+ }
+ } else if (rootHandler != null) {
+ rootHandler.endElement(namespaceURI, localName, qName);
+ }
+ }
+
+ public final void startDocument() throws SAXException {
+ if (rootHandler != null) {
+ rootHandler.startDocument();
+ }
+ }
+
+ public final void endDocument() throws SAXException {
+ if (rootHandler != null) {
+ rootHandler.endDocument();
+
+ }
+ }
+
+ public final void characters(char[] buff, int offset, int size)
+ throws SAXException
+ {
+ if (subdocument) {
+ subdocumentHandler.characters(buff, offset, size);
+ } else if (rootHandler != null) {
+ rootHandler.characters(buff, offset, size);
+ }
+ }
+
+ }
+
+ /**
+ * A {@link org.xml.sax.ContentHandler ContentHandler} that splits XML
+ * documents into smaller chunks. Each chunk is processed by the nested
+ * {@link org.xml.sax.ContentHandler ContentHandler} obtained from
+ * {@link java.net.ContentHandlerFactory ContentHandlerFactory}. This is
+ * useful for running XSLT engine against large XML document that will
+ * hardly fit into the memory all together. <p> TODO use complete path for
+ * subdocumentRoot
+ */
+ private static final class OutputSlicingHandler extends DefaultHandler {
+ private String subdocumentRoot;
+
+ private ContentHandlerFactory subdocumentHandlerFactory;
+
+ private EntryElement entryElement;
+
+ private boolean isXml;
+
+ private boolean subdocument = false;
+
+ private ContentHandler subdocumentHandler;
+
+ /**
+ * Constructs a new {@link OutputSlicingHandler SubdocumentHandler}
+ * object.
+ *
+ * @param subdocumentHandlerFactory a
+ * {@link ContentHandlerFactory ContentHandlerFactory} used to
+ * create {@link ContentHandler ContentHandler} instances for
+ * subdocuments.
+ * @param entryElement TODO.
+ * @param isXml TODO.
+ */
+ public OutputSlicingHandler(
+ ContentHandlerFactory subdocumentHandlerFactory,
+ EntryElement entryElement,
+ boolean isXml)
+ {
+ this.subdocumentRoot = "class";
+ this.subdocumentHandlerFactory = subdocumentHandlerFactory;
+ this.entryElement = entryElement;
+ this.isXml = isXml;
+ }
+
+ public final void startElement(
+ String namespaceURI,
+ String localName,
+ String qName,
+ Attributes list) throws SAXException
+ {
+ if (subdocument) {
+ subdocumentHandler.startElement(namespaceURI,
+ localName,
+ qName,
+ list);
+ } else if (localName.equals(subdocumentRoot)) {
+ String name = list.getValue("name");
+ if (name == null || name.length() == 0)
+ throw new SAXException("Class element without name attribute.");
+ try {
+ entryElement.openEntry(isXml
+ ? name.concat(".class.xml")
+ : name.concat(".class"));
+ } catch (IOException ex) {
+ throw new SAXException(ex.toString(), ex);
+ }
+ subdocumentHandler = subdocumentHandlerFactory.createContentHandler();
+ subdocumentHandler.startDocument();
+ subdocumentHandler.startElement(namespaceURI,
+ localName,
+ qName,
+ list);
+ subdocument = true;
+ }
+ }
+
+ public final void endElement(
+ String namespaceURI,
+ String localName,
+ String qName) throws SAXException
+ {
+ if (subdocument) {
+ subdocumentHandler.endElement(namespaceURI, localName, qName);
+ if (localName.equals(subdocumentRoot)) {
+ subdocumentHandler.endDocument();
+ subdocument = false;
+ try {
+ entryElement.closeEntry();
+ } catch (IOException ex) {
+ throw new SAXException(ex.toString(), ex);
+ }
+ }
+ }
+ }
+
+ public final void startDocument() throws SAXException {
+ }
+
+ public final void endDocument() throws SAXException {
+ }
+
+ public final void characters(char[] buff, int offset, int size)
+ throws SAXException
+ {
+ if (subdocument) {
+ subdocumentHandler.characters(buff, offset, size);
+ }
+ }
+
+ }
+
+ private static interface EntryElement {
+
+ OutputStream openEntry(String name) throws IOException;
+
+ void closeEntry() throws IOException;
+
+ }
+
+ private static final class SingleDocElement implements EntryElement {
+ private OutputStream os;
+
+ public SingleDocElement(OutputStream os) {
+ this.os = os;
+ }
+
+ public OutputStream openEntry(String name) throws IOException {
+ return os;
+ }
+
+ public void closeEntry() throws IOException {
+ os.flush();
+ }
+
+ }
+
+ private static final class ZipEntryElement implements EntryElement {
+ private ZipOutputStream zos;
+
+ public ZipEntryElement(ZipOutputStream zos) {
+ this.zos = zos;
+ }
+
+ public OutputStream openEntry(String name) throws IOException {
+ ZipEntry entry = new ZipEntry(name);
+ zos.putNextEntry(entry);
+ return zos;
+ }
+
+ public void closeEntry() throws IOException {
+ zos.flush();
+ zos.closeEntry();
+ }
+
+ }
+
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXAdapter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXAdapter.java
new file mode 100644
index 00000000000..c8f6ecb994b
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXAdapter.java
@@ -0,0 +1,91 @@
+/***
+ * ASM XML Adapter
+ * Copyright (c) 2004, Eugene Kuleshov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.xml;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+
+/**
+ * SAXAdapter
+ *
+ * @author Eugene Kuleshov
+ */
+public abstract class SAXAdapter {
+ private final ContentHandler h;
+
+ public SAXAdapter(ContentHandler h) {
+ this.h = h;
+ }
+
+ protected ContentHandler getContentHandler() {
+ return h;
+ }
+
+ protected final void addEnd(String name) {
+ try {
+ h.endElement("", name, name);
+ } catch (SAXException ex) {
+ throw new RuntimeException(ex.toString());
+ }
+ }
+
+ protected final void addStart(String name, Attributes attrs) {
+ try {
+ h.startElement("", name, name, attrs);
+ } catch (SAXException ex) {
+ throw new RuntimeException(ex.toString());
+ }
+ }
+
+ protected final void addElement(String name, Attributes attrs) {
+ addStart(name, attrs);
+ addEnd(name);
+ }
+
+ protected void addDocumentStart() {
+ try {
+ h.startDocument();
+ } catch (SAXException ex) {
+ throw new RuntimeException(ex.getException());
+ }
+ }
+
+ protected void addDocumentEnd() {
+ try {
+ h.endDocument();
+ } catch (SAXException ex) {
+ // ex.getException().printStackTrace();
+ // ex.printStackTrace();
+ throw new RuntimeException(ex.toString());
+ }
+ }
+
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXAnnotationAdapter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXAnnotationAdapter.java
new file mode 100644
index 00000000000..e7382414b2c
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXAnnotationAdapter.java
@@ -0,0 +1,191 @@
+/***
+ * ASM XML Adapter
+ * Copyright (c) 2004, Eugene Kuleshov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.xml;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Type;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * SAXAnnotationAdapter
+ *
+ * @author Eugene Kuleshov
+ */
+public class SAXAnnotationAdapter extends SAXAdapter implements
+ AnnotationVisitor
+{
+ private final String elementName;
+
+ public SAXAnnotationAdapter(
+ ContentHandler h,
+ String elementName,
+ int visible,
+ String name,
+ String desc)
+ {
+ this(h, elementName, visible, desc, name, -1);
+ }
+
+ public SAXAnnotationAdapter(
+ ContentHandler h,
+ String elementName,
+ int visible,
+ int parameter,
+ String desc)
+ {
+ this(h, elementName, visible, desc, null, parameter);
+ }
+
+ private SAXAnnotationAdapter(
+ ContentHandler h,
+ String elementName,
+ int visible,
+ String desc,
+ String name,
+ int parameter)
+ {
+ super(h);
+ this.elementName = elementName;
+
+ AttributesImpl att = new AttributesImpl();
+ if (name != null)
+ att.addAttribute("", "name", "name", "", name);
+ if (visible != 0)
+ att.addAttribute("", "visible", "visible", "", visible > 0
+ ? "true"
+ : "false");
+ if (parameter != -1)
+ att.addAttribute("",
+ "parameter",
+ "parameter",
+ "",
+ Integer.toString(parameter));
+ if (desc != null)
+ att.addAttribute("", "desc", "desc", "", desc);
+
+ addStart(elementName, att);
+ }
+
+ public void visit(String name, Object value) {
+ Class c = value.getClass();
+ if (c.isArray()) {
+ AnnotationVisitor av = visitArray(name);
+ if (value instanceof byte[]) {
+ byte[] b = (byte[]) value;
+ for (int i = 0; i < b.length; i++)
+ av.visit(null, new Byte(b[i]));
+
+ } else if (value instanceof char[]) {
+ char[] b = (char[]) value;
+ for (int i = 0; i < b.length; i++)
+ av.visit(null, new Character(b[i]));
+
+ } else if (value instanceof boolean[]) {
+ boolean[] b = (boolean[]) value;
+ for (int i = 0; i < b.length; i++)
+ av.visit(null, Boolean.valueOf(b[i]));
+
+ } else if (value instanceof int[]) {
+ int[] b = (int[]) value;
+ for (int i = 0; i < b.length; i++)
+ av.visit(null, new Integer(b[i]));
+
+ } else if (value instanceof long[]) {
+ long[] b = (long[]) value;
+ for (int i = 0; i < b.length; i++)
+ av.visit(null, new Long(b[i]));
+
+ } else if (value instanceof float[]) {
+ float[] b = (float[]) value;
+ for (int i = 0; i < b.length; i++)
+ av.visit(null, new Float(b[i]));
+
+ } else if (value instanceof double[]) {
+ double[] b = (double[]) value;
+ for (int i = 0; i < b.length; i++)
+ av.visit(null, new Double(b[i]));
+
+ }
+ av.visitEnd();
+ } else {
+ addValueElement("annotationValue",
+ name,
+ Type.getDescriptor(c),
+ value.toString());
+ }
+ }
+
+ public void visitEnum(String name, String desc, String value) {
+ addValueElement("annotationValueEnum", name, desc, value);
+ }
+
+ public AnnotationVisitor visitAnnotation(String name, String desc) {
+ return new SAXAnnotationAdapter(getContentHandler(),
+ "annotationValueAnnotation",
+ 0,
+ name,
+ desc);
+ }
+
+ public AnnotationVisitor visitArray(String name) {
+ return new SAXAnnotationAdapter(getContentHandler(),
+ "annotationValueArray",
+ 0,
+ name,
+ null);
+ }
+
+ public void visitEnd() {
+ addEnd(elementName);
+ }
+
+ private void addValueElement(
+ String element,
+ String name,
+ String desc,
+ String value)
+ {
+ AttributesImpl att = new AttributesImpl();
+ if (name != null)
+ att.addAttribute("", "name", "name", "", name);
+ if (desc != null)
+ att.addAttribute("", "desc", "desc", "", desc);
+ if (value != null)
+ att.addAttribute("",
+ "value",
+ "value",
+ "",
+ SAXClassAdapter.encode(value));
+
+ addElement(element, att);
+ }
+
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXClassAdapter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXClassAdapter.java
new file mode 100644
index 00000000000..ba362d0606d
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXClassAdapter.java
@@ -0,0 +1,351 @@
+/***
+ * ASM XML Adapter
+ * Copyright (c) 2004, Eugene Kuleshov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.xml;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * A {@link org.objectweb.asm.ClassVisitor ClassVisitor} that generates SAX 2.0
+ * events from the visited class. It can feed any kind of
+ * {@link org.xml.sax.ContentHandler ContentHandler}, e.g. XML serializer, XSLT
+ * or XQuery engines.
+ *
+ * @see org.objectweb.asm.xml.Processor
+ * @see org.objectweb.asm.xml.ASMContentHandler
+ *
+ * @author Eugene Kuleshov
+ */
+public final class SAXClassAdapter extends SAXAdapter implements ClassVisitor {
+ private boolean singleDocument;
+
+ /**
+ * Constructs a new {@link SAXClassAdapter SAXClassAdapter} object.
+ *
+ * @param h content handler that will be used to send SAX 2.0 events.
+ * @param singleDocument if <tt>true</tt> adapter will not produce
+ * {@link ContentHandler#startDocument() startDocument()} and
+ * {@link ContentHandler#endDocument() endDocument()} events.
+ */
+ public SAXClassAdapter(ContentHandler h, boolean singleDocument) {
+ super(h);
+ this.singleDocument = singleDocument;
+ if (!singleDocument) {
+ addDocumentStart();
+ }
+ }
+
+ public void visitSource(String source, String debug) {
+ if (source == null && debug == null) {
+ return;
+ }
+
+ AttributesImpl att = new AttributesImpl();
+ if (source != null)
+ att.addAttribute("", "file", "file", "", encode(source));
+ if (debug != null)
+ att.addAttribute("", "debug", "debug", "", encode(debug));
+
+ addElement("source", att);
+ }
+
+ public void visitOuterClass(String owner, String name, String desc) {
+ AttributesImpl att = new AttributesImpl();
+ att.addAttribute("", "owner", "owner", "", owner);
+ if (name != null)
+ att.addAttribute("", "name", "name", "", name);
+ if (desc != null)
+ att.addAttribute("", "desc", "desc", "", desc);
+
+ addElement("outerclass", att);
+ }
+
+ public final void visitAttribute(Attribute attr) {
+ // TODO Auto-generated SAXClassAdapter.visitAttribute
+ }
+
+ public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+ return new SAXAnnotationAdapter(getContentHandler(),
+ "annotation",
+ visible ? 1 : -1,
+ null,
+ desc);
+ }
+
+ public void visit(
+ int version,
+ int access,
+ String name,
+ String signature,
+ String superName,
+ String[] interfaces)
+ {
+ StringBuffer sb = new StringBuffer();
+ if ((access & Opcodes.ACC_PUBLIC) != 0)
+ sb.append("public ");
+ if ((access & Opcodes.ACC_PRIVATE) != 0)
+ sb.append("private ");
+ if ((access & Opcodes.ACC_PROTECTED) != 0)
+ sb.append("protected ");
+ if ((access & Opcodes.ACC_FINAL) != 0)
+ sb.append("final ");
+ if ((access & Opcodes.ACC_SUPER) != 0)
+ sb.append("super ");
+ if ((access & Opcodes.ACC_INTERFACE) != 0)
+ sb.append("interface ");
+ if ((access & Opcodes.ACC_ABSTRACT) != 0)
+ sb.append("abstract ");
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0)
+ sb.append("synthetic ");
+ if ((access & Opcodes.ACC_ANNOTATION) != 0)
+ sb.append("annotation ");
+ if ((access & Opcodes.ACC_ENUM) != 0)
+ sb.append("enum ");
+ if ((access & Opcodes.ACC_DEPRECATED) != 0)
+ sb.append("deprecated ");
+
+ AttributesImpl att = new AttributesImpl();
+ att.addAttribute("", "access", "access", "", sb.toString());
+ if (name != null)
+ att.addAttribute("", "name", "name", "", name);
+ if (signature != null)
+ att.addAttribute("",
+ "signature",
+ "signature",
+ "",
+ encode(signature));
+ if (superName != null)
+ att.addAttribute("", "parent", "parent", "", superName);
+ att.addAttribute("",
+ "major",
+ "major",
+ "",
+ Integer.toString(version & 0xFFFF));
+ att.addAttribute("",
+ "minor",
+ "minor",
+ "",
+ Integer.toString(version >>> 16));
+ addStart("class", att);
+
+ addStart("interfaces", new AttributesImpl());
+ if (interfaces != null && interfaces.length > 0) {
+ for (int i = 0; i < interfaces.length; i++) {
+ AttributesImpl att2 = new AttributesImpl();
+ att2.addAttribute("", "name", "name", "", interfaces[i]);
+ addElement("interface", att2);
+ }
+ }
+ addEnd("interfaces");
+ }
+
+ public FieldVisitor visitField(
+ int access,
+ String name,
+ String desc,
+ String signature,
+ Object value)
+ {
+ StringBuffer sb = new StringBuffer();
+ if ((access & Opcodes.ACC_PUBLIC) != 0)
+ sb.append("public ");
+ if ((access & Opcodes.ACC_PRIVATE) != 0)
+ sb.append("private ");
+ if ((access & Opcodes.ACC_PROTECTED) != 0)
+ sb.append("protected ");
+ if ((access & Opcodes.ACC_STATIC) != 0)
+ sb.append("static ");
+ if ((access & Opcodes.ACC_FINAL) != 0)
+ sb.append("final ");
+ if ((access & Opcodes.ACC_VOLATILE) != 0)
+ sb.append("volatile ");
+ if ((access & Opcodes.ACC_TRANSIENT) != 0)
+ sb.append("transient ");
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0)
+ sb.append("synthetic ");
+ if ((access & Opcodes.ACC_ENUM) != 0)
+ sb.append("enum ");
+ if ((access & Opcodes.ACC_DEPRECATED) != 0)
+ sb.append("deprecated ");
+
+ AttributesImpl att = new AttributesImpl();
+ att.addAttribute("", "access", "access", "", sb.toString());
+ att.addAttribute("", "name", "name", "", name);
+ att.addAttribute("", "desc", "desc", "", desc);
+ if (signature != null)
+ att.addAttribute("",
+ "signature",
+ "signature",
+ "",
+ encode(signature));
+ if (value != null) {
+ att.addAttribute("", "value", "value", "", encode(value.toString()));
+ }
+
+ return new SAXFieldAdapter(getContentHandler(), att);
+ }
+
+ public MethodVisitor visitMethod(
+ int access,
+ String name,
+ String desc,
+ String signature,
+ String[] exceptions)
+ {
+ StringBuffer sb = new StringBuffer();
+ if ((access & Opcodes.ACC_PUBLIC) != 0)
+ sb.append("public ");
+ if ((access & Opcodes.ACC_PRIVATE) != 0)
+ sb.append("private ");
+ if ((access & Opcodes.ACC_PROTECTED) != 0)
+ sb.append("protected ");
+ if ((access & Opcodes.ACC_STATIC) != 0)
+ sb.append("static ");
+ if ((access & Opcodes.ACC_FINAL) != 0)
+ sb.append("final ");
+ if ((access & Opcodes.ACC_SYNCHRONIZED) != 0)
+ sb.append("synchronized ");
+ if ((access & Opcodes.ACC_BRIDGE) != 0)
+ sb.append("bridge ");
+ if ((access & Opcodes.ACC_VARARGS) != 0)
+ sb.append("varargs ");
+ if ((access & Opcodes.ACC_NATIVE) != 0)
+ sb.append("native ");
+ if ((access & Opcodes.ACC_ABSTRACT) != 0)
+ sb.append("abstract ");
+ if ((access & Opcodes.ACC_STRICT) != 0)
+ sb.append("strict ");
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0)
+ sb.append("synthetic ");
+ if ((access & Opcodes.ACC_DEPRECATED) != 0)
+ sb.append("deprecated ");
+
+ AttributesImpl att = new AttributesImpl();
+ att.addAttribute("", "access", "access", "", sb.toString());
+ att.addAttribute("", "name", "name", "", name);
+ att.addAttribute("", "desc", "desc", "", desc);
+ if (signature != null) {
+ att.addAttribute("", "signature", "signature", "", signature);
+ }
+ addStart("method", att);
+
+ addStart("exceptions", new AttributesImpl());
+ if (exceptions != null && exceptions.length > 0) {
+ for (int i = 0; i < exceptions.length; i++) {
+ AttributesImpl att2 = new AttributesImpl();
+ att2.addAttribute("", "name", "name", "", exceptions[i]);
+ addElement("exception", att2);
+ }
+ }
+ addEnd("exceptions");
+
+ return new SAXCodeAdapter(getContentHandler(), access);
+ }
+
+ public final void visitInnerClass(
+ String name,
+ String outerName,
+ String innerName,
+ int access)
+ {
+ StringBuffer sb = new StringBuffer();
+ if ((access & Opcodes.ACC_PUBLIC) != 0)
+ sb.append("public ");
+ if ((access & Opcodes.ACC_PRIVATE) != 0)
+ sb.append("private ");
+ if ((access & Opcodes.ACC_PROTECTED) != 0)
+ sb.append("protected ");
+ if ((access & Opcodes.ACC_STATIC) != 0)
+ sb.append("static ");
+ if ((access & Opcodes.ACC_FINAL) != 0)
+ sb.append("final ");
+ if ((access & Opcodes.ACC_SUPER) != 0)
+ sb.append("super ");
+ if ((access & Opcodes.ACC_INTERFACE) != 0)
+ sb.append("interface ");
+ if ((access & Opcodes.ACC_ABSTRACT) != 0)
+ sb.append("abstract ");
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0)
+ sb.append("synthetic ");
+ if ((access & Opcodes.ACC_ANNOTATION) != 0)
+ sb.append("annotation ");
+ if ((access & Opcodes.ACC_ENUM) != 0)
+ sb.append("enum ");
+ if ((access & Opcodes.ACC_DEPRECATED) != 0)
+ sb.append("deprecated ");
+
+ AttributesImpl att = new AttributesImpl();
+ att.addAttribute("", "access", "access", "", sb.toString());
+ if (name != null)
+ att.addAttribute("", "name", "name", "", name);
+ if (outerName != null)
+ att.addAttribute("", "outerName", "outerName", "", outerName);
+ if (innerName != null)
+ att.addAttribute("", "innerName", "innerName", "", innerName);
+ addElement("innerclass", att);
+ }
+
+ public final void visitEnd() {
+ addEnd("class");
+ if (!singleDocument) {
+ addDocumentEnd();
+ }
+ }
+
+ static final String encode(String s) {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < s.length(); i++) {
+ char c = s.charAt(i);
+ if (c == '\\') {
+ sb.append("\\\\");
+ } else if (c < 0x20 || c > 0x7f) {
+ sb.append("\\u");
+ if (c < 0x10) {
+ sb.append("000");
+ } else if (c < 0x100) {
+ sb.append("00");
+ } else if (c < 0x1000) {
+ sb.append("0");
+ }
+ sb.append(Integer.toString(c, 16));
+ } else {
+ sb.append(c);
+ }
+ }
+ return sb.toString();
+ }
+
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXCodeAdapter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXCodeAdapter.java
new file mode 100644
index 00000000000..abea7fbf41f
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXCodeAdapter.java
@@ -0,0 +1,310 @@
+/***
+ * ASM XML Adapter
+ * Copyright (c) 2004, Eugene Kuleshov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.xml;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.util.AbstractVisitor;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * A {@link MethodVisitor} that generates SAX 2.0 events from the visited
+ * method.
+ *
+ * @see org.objectweb.asm.xml.SAXClassAdapter
+ * @see org.objectweb.asm.xml.Processor
+ *
+ * @author Eugene Kuleshov
+ */
+public final class SAXCodeAdapter extends SAXAdapter implements MethodVisitor {
+ private Map labelNames;
+
+ /**
+ * Constructs a new {@link SAXCodeAdapter SAXCodeAdapter} object.
+ *
+ * @param h content handler that will be used to send SAX 2.0 events.
+ * @param access
+ */
+ public SAXCodeAdapter(ContentHandler h, int access) {
+ super(h);
+ labelNames = new HashMap();
+
+ if ((access & (Opcodes.ACC_ABSTRACT | Opcodes.ACC_INTERFACE | Opcodes.ACC_NATIVE)) == 0)
+ {
+ addStart("code", new AttributesImpl());
+ }
+ }
+
+ public final void visitCode() {
+ }
+
+ public final void visitInsn(int opcode) {
+ addElement(AbstractVisitor.OPCODES[opcode], new AttributesImpl());
+ }
+
+ public final void visitIntInsn(int opcode, int operand) {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("", "value", "value", "", Integer.toString(operand));
+ addElement(AbstractVisitor.OPCODES[opcode], attrs);
+ }
+
+ public final void visitVarInsn(int opcode, int var) {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("", "var", "var", "", Integer.toString(var));
+ addElement(AbstractVisitor.OPCODES[opcode], attrs);
+ }
+
+ public final void visitTypeInsn(int opcode, String desc) {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("", "desc", "desc", "", desc);
+ addElement(AbstractVisitor.OPCODES[opcode], attrs);
+ }
+
+ public final void visitFieldInsn(
+ int opcode,
+ String owner,
+ String name,
+ String desc)
+ {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("", "owner", "owner", "", owner);
+ attrs.addAttribute("", "name", "name", "", name);
+ attrs.addAttribute("", "desc", "desc", "", desc);
+ addElement(AbstractVisitor.OPCODES[opcode], attrs);
+ }
+
+ public final void visitMethodInsn(
+ int opcode,
+ String owner,
+ String name,
+ String desc)
+ {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("", "owner", "owner", "", owner);
+ attrs.addAttribute("", "name", "name", "", name);
+ attrs.addAttribute("", "desc", "desc", "", desc);
+ addElement(AbstractVisitor.OPCODES[opcode], attrs);
+ }
+
+ public final void visitJumpInsn(int opcode, Label label) {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("", "label", "label", "", getLabel(label));
+ addElement(AbstractVisitor.OPCODES[opcode], attrs);
+ }
+
+ public final void visitLabel(Label label) {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("", "name", "name", "", getLabel(label));
+ addElement("Label", attrs);
+ }
+
+ public final void visitLdcInsn(Object cst) {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("",
+ "cst",
+ "cst",
+ "",
+ SAXClassAdapter.encode(cst.toString()));
+ attrs.addAttribute("",
+ "desc",
+ "desc",
+ "",
+ Type.getDescriptor(cst.getClass()));
+ addElement(AbstractVisitor.OPCODES[Opcodes.LDC], attrs);
+ }
+
+ public final void visitIincInsn(int var, int increment) {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("", "var", "var", "", Integer.toString(var));
+ attrs.addAttribute("", "inc", "inc", "", Integer.toString(increment));
+ addElement(AbstractVisitor.OPCODES[Opcodes.IINC], attrs);
+ }
+
+ public final void visitTableSwitchInsn(
+ int min,
+ int max,
+ Label dflt,
+ Label[] labels)
+ {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("", "min", "min", "", Integer.toString(min));
+ attrs.addAttribute("", "max", "max", "", Integer.toString(max));
+ attrs.addAttribute("", "dflt", "dflt", "", getLabel(dflt));
+ String o = AbstractVisitor.OPCODES[Opcodes.TABLESWITCH];
+ addStart(o, attrs);
+ for (int i = 0; i < labels.length; i++) {
+ AttributesImpl att2 = new AttributesImpl();
+ att2.addAttribute("", "name", "name", "", getLabel(labels[i]));
+ addElement("label", att2);
+ }
+ addEnd(o);
+ }
+
+ public final void visitLookupSwitchInsn(
+ Label dflt,
+ int[] keys,
+ Label[] labels)
+ {
+ AttributesImpl att = new AttributesImpl();
+ att.addAttribute("", "dflt", "dflt", "", getLabel(dflt));
+ String o = AbstractVisitor.OPCODES[Opcodes.LOOKUPSWITCH];
+ addStart(o, att);
+ for (int i = 0; i < labels.length; i++) {
+ AttributesImpl att2 = new AttributesImpl();
+ att2.addAttribute("", "name", "name", "", getLabel(labels[i]));
+ att2.addAttribute("", "key", "key", "", Integer.toString(keys[i]));
+ addElement("label", att2);
+ }
+ addEnd(o);
+ }
+
+ public final void visitMultiANewArrayInsn(String desc, int dims) {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("", "desc", "desc", "", desc);
+ attrs.addAttribute("", "dims", "dims", "", Integer.toString(dims));
+ addElement(AbstractVisitor.OPCODES[Opcodes.MULTIANEWARRAY], attrs);
+ }
+
+ public final void visitTryCatchBlock(
+ Label start,
+ Label end,
+ Label handler,
+ String type)
+ {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("", "start", "start", "", getLabel(start));
+ attrs.addAttribute("", "end", "end", "", getLabel(end));
+ attrs.addAttribute("", "handler", "handler", "", getLabel(handler));
+ if (type != null)
+ attrs.addAttribute("", "type", "type", "", type);
+ addElement("TryCatch", attrs);
+ }
+
+ public final void visitMaxs(int maxStack, int maxLocals) {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("",
+ "maxStack",
+ "maxStack",
+ "",
+ Integer.toString(maxStack));
+ attrs.addAttribute("",
+ "maxLocals",
+ "maxLocals",
+ "",
+ Integer.toString(maxLocals));
+ addElement("Max", attrs);
+
+ addEnd("code");
+ }
+
+ public void visitLocalVariable(
+ String name,
+ String desc,
+ String signature,
+ Label start,
+ Label end,
+ int index)
+ {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("", "name", "name", "", name);
+ attrs.addAttribute("", "desc", "desc", "", desc);
+ if (signature != null)
+ attrs.addAttribute("",
+ "signature",
+ "signature",
+ "",
+ SAXClassAdapter.encode(signature));
+ attrs.addAttribute("", "start", "start", "", getLabel(start));
+ attrs.addAttribute("", "end", "end", "", getLabel(end));
+ attrs.addAttribute("", "var", "var", "", Integer.toString(index));
+ addElement("LocalVar", attrs);
+ }
+
+ public final void visitLineNumber(int line, Label start) {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute("", "line", "line", "", Integer.toString(line));
+ attrs.addAttribute("", "start", "start", "", getLabel(start));
+ addElement("LineNumber", attrs);
+ }
+
+ public AnnotationVisitor visitAnnotationDefault() {
+ return new SAXAnnotationAdapter(getContentHandler(),
+ "annotationDefault",
+ 0,
+ null,
+ null);
+ }
+
+ public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+ return new SAXAnnotationAdapter(getContentHandler(),
+ "annotation",
+ visible ? 1 : -1,
+ null,
+ desc);
+ }
+
+ public AnnotationVisitor visitParameterAnnotation(
+ int parameter,
+ String desc,
+ boolean visible)
+ {
+ return new SAXAnnotationAdapter(getContentHandler(),
+ "parameterAnnotation",
+ visible ? 1 : -1,
+ parameter,
+ desc);
+ }
+
+ public void visitEnd() {
+ addEnd("method");
+ }
+
+ public final void visitAttribute(Attribute attr) {
+ // TODO Auto-generated SAXCodeAdapter.visitAttribute
+ }
+
+ private final String getLabel(Label label) {
+ String name = (String) labelNames.get(label);
+ if (name == null) {
+ name = Integer.toString(labelNames.size());
+ labelNames.put(label, name);
+ }
+ return name;
+ }
+
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXFieldAdapter.java b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXFieldAdapter.java
new file mode 100644
index 00000000000..eabf00dfc66
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/SAXFieldAdapter.java
@@ -0,0 +1,77 @@
+/***
+ * ASM XML Adapter
+ * Copyright (c) 2004, Eugene Kuleshov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.objectweb.asm.xml;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.FieldVisitor;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * SAXFieldAdapter
+ *
+ * @author Eugene Kuleshov
+ */
+public class SAXFieldAdapter implements FieldVisitor {
+ private final ContentHandler h;
+
+ public SAXFieldAdapter(ContentHandler h, AttributesImpl att) {
+ this.h = h;
+
+ try {
+ h.startElement("", "field", "field", att);
+ } catch (SAXException ex) {
+ throw new RuntimeException(ex.toString());
+ }
+ }
+
+ public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+ return new SAXAnnotationAdapter(h,
+ "annotation",
+ visible ? 1 : -1,
+ null,
+ desc);
+ }
+
+ public void visitAttribute(Attribute attr) {
+ // TODO Auto-generated method stub
+ }
+
+ public void visitEnd() {
+ try {
+ h.endElement("", "field", "field");
+ } catch (SAXException ex) {
+ throw new RuntimeException(ex.toString());
+ }
+ }
+
+}
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/asm-xml.dtd b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/asm-xml.dtd
new file mode 100644
index 00000000000..7859259e050
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/asm-xml.dtd
@@ -0,0 +1,340 @@
+<!--
+ ASM XML Adapter
+ Copyright (c) 2004, Eugene Kuleshov
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holders nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<!--
+ This DTD must be used to create XML documents to be processed by
+ org.objectweb.asm.xml.ASMContentHandler
+-->
+
+<!--
+ Root element used to aggregate multiple classes into single document.
+-->
+<!ELEMENT classes ( class+ )>
+
+<!--
+ Root element for a single class.
+-->
+<!ELEMENT class ( interfaces, ( field | innerclass | method )*)>
+<!ATTLIST class access CDATA #REQUIRED>
+<!ATTLIST class name CDATA #REQUIRED>
+<!ATTLIST class parent CDATA #REQUIRED>
+<!ATTLIST class major CDATA #REQUIRED>
+<!ATTLIST class minor CDATA #REQUIRED>
+<!ATTLIST class source CDATA #IMPLIED>
+
+<!ELEMENT interfaces ( interface* )>
+<!ELEMENT interface EMPTY>
+<!ATTLIST interface name CDATA #REQUIRED>
+
+<!ELEMENT field EMPTY>
+<!ATTLIST field access CDATA #REQUIRED>
+<!ATTLIST field desc CDATA #REQUIRED>
+<!ATTLIST field name CDATA #REQUIRED>
+<!--
+ All characters out of interval 0x20 to 0x7f (inclusive) must
+ be encoded (\uXXXX) and character '\' must be replaced by "\\"
+-->
+<!ATTLIST field value CDATA #IMPLIED>
+
+<!ELEMENT innerclass EMPTY>
+<!ATTLIST innerclass access CDATA #REQUIRED>
+<!ATTLIST innerclass innerName CDATA #IMPLIED>
+<!ATTLIST innerclass name CDATA #REQUIRED>
+<!ATTLIST innerclass outerName CDATA #IMPLIED>
+
+<!--
+ Root element for method definition.
+-->
+<!ELEMENT method ( exceptions, code? )>
+<!ATTLIST method access CDATA #REQUIRED>
+<!ATTLIST method desc CDATA #REQUIRED>
+<!ATTLIST method name CDATA #REQUIRED>
+
+<!ELEMENT exceptions ( exception* )>
+<!ELEMENT exception EMPTY>
+<!ATTLIST exception name CDATA #REQUIRED>
+
+<!--
+ code element contains bytecode instructions and definitions for labels, line numbers, try/catch and max
+-->
+<!ELEMENT code (( AALOAD | AASTORE | ACONST_NULL | ALOAD | ANEWARRAY | ARETURN | ARRAYLENGTH | ASTORE | ATHROW | BALOAD | BASTORE | BIPUSH | CALOAD | CASTORE | CHECKCAST | D2F | D2I | D2L | DADD | DALOAD | DASTORE | DCMPG | DCMPL | DCONST_0 | DCONST_1 | DDIV | DLOAD | DMUL | DNEG | DREM | DRETURN | DSTORE | DSUB | DUP | DUP2 | DUP2_X1 | DUP2_X2 | DUP_X1 | DUP_X2 | F2D | F2I | F2L | FADD | FALOAD | FASTORE | FCMPG | FCMPL | FCONST_0 | FCONST_1 | FCONST_2 | FDIV | FLOAD | FMUL | FNEG | FRETURN | FSTORE | FSUB | GETFIELD | GETSTATIC | GOTO | I2B | I2C | I2D | I2F | I2L | I2S | IADD | IALOAD | IAND | IASTORE | ICONST_0 | ICONST_1 | ICONST_2 | ICONST_3 | ICONST_4 | ICONST_5 | ICONST_M1 | IDIV | IFEQ | IFGE | IFGT | IFLE | IFLT | IFNE | IFNONNULL | IFNULL | IF_ACMPEQ | IF_ACMPNE | IF_ICMPEQ | IF_ICMPGE | IF_ICMPGT | IF_ICMPLE | IF_ICMPLT | IF_ICMPNE | IINC | ILOAD | IMUL | INEG | INSTANCEOF | INVOKEINTERFACE | INVOKESPECIAL | INVOKESTATIC | INVOKEVIRTUAL | IOR | IREM | IRETURN | ISHL | ISHR | ISTORE | ISUB | IUSHR | IXOR | JSR | L2D | L2F | L2I | LADD | LALOAD | LAND | LASTORE | LCMP | LCONST_0 | LCONST_1 | LDC | LDIV | LLOAD | LMUL | LNEG | LOOKUPSWITCH | LOR | LREM | LRETURN | LSHL | LSHR | LSTORE | LSUB | LUSHR | LXOR | MONITORENTER | MONITOREXIT | MULTIANEWARRAY | NEW | NEWARRAY | NOP | POP | POP2 | PUTFIELD | PUTSTATIC | RET | RETURN | SALOAD | SASTORE | SIPUSH | TABLESWITCH | Label | LineNumber | TryCatch )*, Max)>
+
+<!ELEMENT Label EMPTY>
+<!ATTLIST Label name CDATA #REQUIRED>
+
+<!ELEMENT TryCatch EMPTY>
+<!ATTLIST TryCatch end CDATA #REQUIRED>
+<!ATTLIST TryCatch handler CDATA #REQUIRED>
+<!ATTLIST TryCatch start CDATA #REQUIRED>
+<!ATTLIST TryCatch type CDATA #IMPLIED>
+
+<!ELEMENT LineNumber EMPTY>
+<!ATTLIST LineNumber line CDATA #REQUIRED>
+<!ATTLIST LineNumber start CDATA #REQUIRED>
+
+<!ELEMENT Max EMPTY>
+<!ATTLIST Max maxLocals CDATA #REQUIRED>
+<!ATTLIST Max maxStack CDATA #REQUIRED>
+
+<!ELEMENT AALOAD EMPTY>
+<!ELEMENT AASTORE EMPTY>
+<!ELEMENT ACONST_NULL EMPTY>
+<!ELEMENT ALOAD EMPTY>
+<!ATTLIST ALOAD var CDATA #REQUIRED>
+<!ELEMENT ANEWARRAY EMPTY>
+<!ATTLIST ANEWARRAY desc CDATA #REQUIRED>
+<!ELEMENT ARETURN EMPTY>
+<!ELEMENT ARRAYLENGTH EMPTY>
+<!ELEMENT ASTORE EMPTY>
+<!ATTLIST ASTORE var CDATA #REQUIRED>
+<!ELEMENT ATHROW EMPTY>
+<!ELEMENT BALOAD EMPTY>
+<!ELEMENT BASTORE EMPTY>
+<!ELEMENT BIPUSH EMPTY>
+<!ATTLIST BIPUSH value CDATA #REQUIRED>
+<!ELEMENT CALOAD EMPTY>
+<!ELEMENT CASTORE EMPTY>
+<!ELEMENT CHECKCAST EMPTY>
+<!ATTLIST CHECKCAST desc CDATA #REQUIRED>
+<!ELEMENT D2F EMPTY>
+<!ELEMENT D2I EMPTY>
+<!ELEMENT D2L EMPTY>
+<!ELEMENT DADD EMPTY>
+<!ELEMENT DALOAD EMPTY>
+<!ELEMENT DASTORE EMPTY>
+<!ELEMENT DCMPG EMPTY>
+<!ELEMENT DCMPL EMPTY>
+<!ELEMENT DCONST_0 EMPTY>
+<!ELEMENT DCONST_1 EMPTY>
+<!ELEMENT DDIV EMPTY>
+<!ELEMENT DLOAD EMPTY>
+<!ATTLIST DLOAD var CDATA #REQUIRED>
+<!ELEMENT DMUL EMPTY>
+<!ELEMENT DNEG EMPTY>
+<!ELEMENT DREM EMPTY>
+<!ELEMENT DRETURN EMPTY>
+<!ELEMENT DSTORE EMPTY>
+<!ATTLIST DSTORE var CDATA #REQUIRED>
+<!ELEMENT DSUB EMPTY>
+<!ELEMENT DUP EMPTY>
+<!ELEMENT DUP2 EMPTY>
+<!ELEMENT DUP2_X1 EMPTY>
+<!ELEMENT DUP2_X2 EMPTY>
+<!ELEMENT DUP_X1 EMPTY>
+<!ELEMENT DUP_X2 EMPTY>
+<!ELEMENT F2D EMPTY>
+<!ELEMENT F2I EMPTY>
+<!ELEMENT F2L EMPTY>
+<!ELEMENT FADD EMPTY>
+<!ELEMENT FALOAD EMPTY>
+<!ELEMENT FASTORE EMPTY>
+<!ELEMENT FCMPG EMPTY>
+<!ELEMENT FCMPL EMPTY>
+<!ELEMENT FCONST_0 EMPTY>
+<!ELEMENT FCONST_1 EMPTY>
+<!ELEMENT FCONST_2 EMPTY>
+<!ELEMENT FDIV EMPTY>
+<!ELEMENT FLOAD EMPTY>
+<!ATTLIST FLOAD var CDATA #REQUIRED>
+<!ELEMENT FMUL EMPTY>
+<!ELEMENT FNEG EMPTY>
+<!ELEMENT FRETURN EMPTY>
+<!ELEMENT FSTORE EMPTY>
+<!ATTLIST FSTORE var CDATA #REQUIRED>
+<!ELEMENT FSUB EMPTY>
+<!ELEMENT GETFIELD EMPTY>
+<!ATTLIST GETFIELD desc CDATA #REQUIRED>
+<!ATTLIST GETFIELD name CDATA #REQUIRED>
+<!ATTLIST GETFIELD owner CDATA #REQUIRED>
+<!ELEMENT GETSTATIC EMPTY>
+<!ATTLIST GETSTATIC desc CDATA #REQUIRED>
+<!ATTLIST GETSTATIC name CDATA #REQUIRED>
+<!ATTLIST GETSTATIC owner CDATA #REQUIRED>
+<!ELEMENT GOTO EMPTY>
+<!ATTLIST GOTO label CDATA #REQUIRED>
+<!ELEMENT I2B EMPTY>
+<!ELEMENT I2C EMPTY>
+<!ELEMENT I2D EMPTY>
+<!ELEMENT I2F EMPTY>
+<!ELEMENT I2L EMPTY>
+<!ELEMENT I2S EMPTY>
+<!ELEMENT IADD EMPTY>
+<!ELEMENT IALOAD EMPTY>
+<!ELEMENT IAND EMPTY>
+<!ELEMENT IASTORE EMPTY>
+<!ELEMENT ICONST_0 EMPTY>
+<!ELEMENT ICONST_1 EMPTY>
+<!ELEMENT ICONST_2 EMPTY>
+<!ELEMENT ICONST_3 EMPTY>
+<!ELEMENT ICONST_4 EMPTY>
+<!ELEMENT ICONST_5 EMPTY>
+<!ELEMENT ICONST_M1 EMPTY>
+<!ELEMENT IDIV EMPTY>
+<!ELEMENT IFEQ EMPTY>
+<!ATTLIST IFEQ label CDATA #REQUIRED>
+<!ELEMENT IFGE EMPTY>
+<!ATTLIST IFGE label CDATA #REQUIRED>
+<!ELEMENT IFGT EMPTY>
+<!ATTLIST IFGT label CDATA #REQUIRED>
+<!ELEMENT IFLE EMPTY>
+<!ATTLIST IFLE label CDATA #REQUIRED>
+<!ELEMENT IFLT EMPTY>
+<!ATTLIST IFLT label CDATA #REQUIRED>
+<!ELEMENT IFNE EMPTY>
+<!ATTLIST IFNE label CDATA #REQUIRED>
+<!ELEMENT IFNONNULL EMPTY>
+<!ATTLIST IFNONNULL label CDATA #REQUIRED>
+<!ELEMENT IFNULL EMPTY>
+<!ATTLIST IFNULL label CDATA #REQUIRED>
+<!ELEMENT IF_ACMPEQ EMPTY>
+<!ATTLIST IF_ACMPEQ label CDATA #REQUIRED>
+<!ELEMENT IF_ACMPNE EMPTY>
+<!ATTLIST IF_ACMPNE label CDATA #REQUIRED>
+<!ELEMENT IF_ICMPEQ EMPTY>
+<!ATTLIST IF_ICMPEQ label CDATA #REQUIRED>
+<!ELEMENT IF_ICMPGE EMPTY>
+<!ATTLIST IF_ICMPGE label CDATA #REQUIRED>
+<!ELEMENT IF_ICMPGT EMPTY>
+<!ATTLIST IF_ICMPGT label CDATA #REQUIRED>
+<!ELEMENT IF_ICMPLE EMPTY>
+<!ATTLIST IF_ICMPLE label CDATA #REQUIRED>
+<!ELEMENT IF_ICMPLT EMPTY>
+<!ATTLIST IF_ICMPLT label CDATA #REQUIRED>
+<!ELEMENT IF_ICMPNE EMPTY>
+<!ATTLIST IF_ICMPNE label CDATA #REQUIRED>
+<!ELEMENT IINC EMPTY>
+<!ATTLIST IINC inc CDATA #REQUIRED>
+<!ATTLIST IINC var CDATA #REQUIRED>
+<!ELEMENT ILOAD EMPTY>
+<!ATTLIST ILOAD var CDATA #REQUIRED>
+<!ELEMENT IMUL EMPTY>
+<!ELEMENT INEG EMPTY>
+<!ELEMENT INSTANCEOF EMPTY>
+<!ATTLIST INSTANCEOF desc CDATA #REQUIRED>
+<!ELEMENT INVOKEINTERFACE EMPTY>
+<!ATTLIST INVOKEINTERFACE desc CDATA #REQUIRED>
+<!ATTLIST INVOKEINTERFACE name CDATA #REQUIRED>
+<!ATTLIST INVOKEINTERFACE owner CDATA #REQUIRED>
+<!ELEMENT INVOKESPECIAL EMPTY>
+<!ATTLIST INVOKESPECIAL desc CDATA #REQUIRED>
+<!ATTLIST INVOKESPECIAL name CDATA #REQUIRED>
+<!ATTLIST INVOKESPECIAL owner CDATA #REQUIRED>
+<!ELEMENT INVOKESTATIC EMPTY>
+<!ATTLIST INVOKESTATIC desc CDATA #REQUIRED>
+<!ATTLIST INVOKESTATIC name CDATA #REQUIRED>
+<!ATTLIST INVOKESTATIC owner CDATA #REQUIRED>
+<!ELEMENT INVOKEVIRTUAL EMPTY>
+<!ATTLIST INVOKEVIRTUAL desc CDATA #REQUIRED>
+<!ATTLIST INVOKEVIRTUAL name CDATA #REQUIRED>
+<!ATTLIST INVOKEVIRTUAL owner CDATA #REQUIRED>
+<!ELEMENT IOR EMPTY>
+<!ELEMENT IREM EMPTY>
+<!ELEMENT IRETURN EMPTY>
+<!ELEMENT ISHL EMPTY>
+<!ELEMENT ISHR EMPTY>
+<!ELEMENT ISTORE EMPTY>
+<!ATTLIST ISTORE var CDATA #REQUIRED>
+<!ELEMENT ISUB EMPTY>
+<!ELEMENT IUSHR EMPTY>
+<!ELEMENT IXOR EMPTY>
+<!ELEMENT JSR EMPTY>
+<!ATTLIST JSR label CDATA #REQUIRED>
+<!ELEMENT L2D EMPTY>
+<!ELEMENT L2F EMPTY>
+<!ELEMENT L2I EMPTY>
+<!ELEMENT LADD EMPTY>
+<!ELEMENT LALOAD EMPTY>
+<!ELEMENT LAND EMPTY>
+<!ELEMENT LASTORE EMPTY>
+<!ELEMENT LCMP EMPTY>
+<!ELEMENT LCONST_0 EMPTY>
+<!ELEMENT LCONST_1 EMPTY>
+<!ELEMENT LDC EMPTY>
+<!--
+ All characters out of interval 0x20 to 0x7f (inclusive) must
+ be encoded (\uXXXX) and character '\' must be replaced by "\\"
+-->
+<!ATTLIST LDC cst CDATA #REQUIRED>
+<!ATTLIST LDC desc CDATA #REQUIRED>
+<!ELEMENT LDIV EMPTY>
+<!ELEMENT LLOAD EMPTY>
+<!ATTLIST LLOAD var CDATA #REQUIRED>
+<!ELEMENT LMUL EMPTY>
+<!ELEMENT LNEG EMPTY>
+<!ELEMENT LOR EMPTY>
+<!ELEMENT LREM EMPTY>
+<!ELEMENT LRETURN EMPTY>
+<!ELEMENT LSHL EMPTY>
+<!ELEMENT LSHR EMPTY>
+<!ELEMENT LSTORE EMPTY>
+<!ATTLIST LSTORE var CDATA #REQUIRED>
+<!ELEMENT LSUB EMPTY>
+<!ELEMENT LUSHR EMPTY>
+<!ELEMENT LXOR EMPTY>
+<!ELEMENT MONITORENTER EMPTY>
+<!ELEMENT MONITOREXIT EMPTY>
+<!ELEMENT MULTIANEWARRAY EMPTY>
+<!ATTLIST MULTIANEWARRAY desc CDATA #REQUIRED>
+<!ATTLIST MULTIANEWARRAY dims CDATA #REQUIRED>
+<!ELEMENT NEW EMPTY>
+<!ATTLIST NEW desc CDATA #REQUIRED>
+<!ELEMENT NEWARRAY EMPTY>
+<!ATTLIST NEWARRAY value CDATA #REQUIRED>
+<!ELEMENT NOP EMPTY>
+<!ELEMENT POP EMPTY>
+<!ELEMENT POP2 EMPTY>
+<!ELEMENT PUTFIELD EMPTY>
+<!ATTLIST PUTFIELD desc CDATA #REQUIRED>
+<!ATTLIST PUTFIELD name CDATA #REQUIRED>
+<!ATTLIST PUTFIELD owner CDATA #REQUIRED>
+<!ELEMENT PUTSTATIC EMPTY>
+<!ATTLIST PUTSTATIC desc CDATA #REQUIRED>
+<!ATTLIST PUTSTATIC name CDATA #REQUIRED>
+<!ATTLIST PUTSTATIC owner CDATA #REQUIRED>
+<!ELEMENT RET EMPTY>
+<!ATTLIST RET var CDATA #REQUIRED>
+<!ELEMENT RETURN EMPTY>
+<!ELEMENT SALOAD EMPTY>
+<!ELEMENT SASTORE EMPTY>
+<!ELEMENT SIPUSH EMPTY>
+<!ATTLIST SIPUSH value CDATA #REQUIRED>
+
+<!ELEMENT LOOKUPSWITCH ( label+ )>
+<!ATTLIST LOOKUPSWITCH dflt CDATA #REQUIRED>
+
+<!ELEMENT TABLESWITCH ( label+ )>
+<!ATTLIST TABLESWITCH dflt CDATA #REQUIRED>
+<!ATTLIST TABLESWITCH max CDATA #REQUIRED>
+<!ATTLIST TABLESWITCH min CDATA #REQUIRED>
+
+<!ELEMENT label EMPTY>
+<!ATTLIST label key CDATA #IMPLIED>
+<!ATTLIST label name CDATA #REQUIRED>
+
diff --git a/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/package.html b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/package.html
new file mode 100644
index 00000000000..3bbb95f8c2c
--- /dev/null
+++ b/libjava/classpath/tools/external/asm/org/objectweb/asm/xml/package.html
@@ -0,0 +1,96 @@
+<html>
+<!--
+ * ASM XML Adapter
+ * Copyright (c) 2004, Eugene Kuleshov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<body>
+Provides <a href="http://sax.sourceforge.net/">SAX 2.0</a> adapters for ASM
+visitors to convert classes to and from XML.
+These adapters can be chained with other SAX compliant content handlers and
+filters, eg. XSLT or XQuery engines. This package is bundled as
+a separate <tt>asm-xml.jar</tt> library and requires <tt>asm.jar</tt>.
+<p>
+<tt>ASMContentHandler</tt> and <tt>SAXClassAdapter/SAXCodeAdapter</tt>
+are using <a href="asm-xml.dtd">asm-xml.dtd</a>.
+Here is the example of bytecode to bytecode XSLT transformation.
+
+<pre>
+ SAXTransformerFactory saxtf = ( SAXTransformerFactory) TransformerFactory.newInstance();
+ Templates templates = saxtf.newTemplates( xsltSource);
+
+ TransformerHandler handler = saxtf.newTransformerHandler( templates);
+ handler.setResult( new SAXResult( new ASMContentHandler( outputStream, computeMax)));
+
+ ClassReader cr = new ClassReader( bytecode);
+ cr.accept( new SAXClassAdapter( handler, cr.getVersion(), false), false);
+</pre>
+
+See JAXP and SAX documentation for more detils.
+
+<p>
+There are few illustrations of the bytecode transformation with XSLT in
+examples directory. The following XSLT procesors has been tested.
+
+<blockquote>
+<table border="1" cellspacing="0" cellpadding="3">
+<tr>
+<th>Engine</td>
+<th>javax.xml.transform.TransformerFactory property</td>
+</tr>
+
+<tr>
+<td>jd.xslt</td>
+<td>jd.xml.xslt.trax.TransformerFactoryImpl</td>
+</tr>
+
+<tr>
+<td>Saxon</td>
+<td>net.sf.saxon.TransformerFactoryImpl</td>
+</tr>
+
+<tr>
+<td>Caucho</td>
+<td>com.caucho.xsl.Xsl</td>
+</tr>
+
+<tr>
+<td>Xalan interpeter</td>
+<td>org.apache.xalan.processor.TransformerFactory</td>
+</tr>
+
+<tr>
+<td>Xalan xsltc</td>
+<td>org.apache.xalan.xsltc.trax.TransformerFactoryImpl</td>
+</tr>
+</table>
+</blockquote>
+
+@since ASM 1.4.3
+
+</body>
+</html>
diff --git a/libjava/classpath/tools/gjavah.in b/libjava/classpath/tools/gjavah.in
new file mode 100644
index 00000000000..3140e21e4b6
--- /dev/null
+++ b/libjava/classpath/tools/gjavah.in
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+## Copyright (C) 2006 Free Software Foundation, Inc.
+##
+## This file is a part of GNU Classpath.
+##
+## GNU Classpath is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or (at
+## your option) any later version.
+##
+## GNU Classpath is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with GNU Classpath; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+## USA.
+##
+## Linking this library statically or dynamically with other modules is
+## making a combined work based on this library. Thus, the terms and
+## conditions of the GNU General Public License cover the whole
+## combination.
+##
+## As a special exception, the copyright holders of this library give you
+## permission to link this library with independent modules to produce an
+## executable, regardless of the license terms of these independent
+## modules, and to copy and distribute the resulting executable under
+## terms of your choice, provided that you also meet, for each linked
+## independent module, the terms and conditions of the license of that
+## module. An independent module is a module which is not derived from
+## or based on this library. If you modify this library, you may extend
+## this exception to your version of the library, but you are not
+## obligated to do so. If you do not wish to do so, delete this
+## exception statement from your version.
+##
+##
+## A simple shell script to launch the GNU Classpath javah tool.
+##
+
+prefix=@prefix@
+tools_dir=@datadir@/@PACKAGE@
+tools_cp=${tools_dir}/tools.zip
+
+exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.javah.Main "$@"
diff --git a/libjava/classpath/tools/gnu/classpath/tools/AbstractMethodGenerator.java b/libjava/classpath/tools/gnu/classpath/tools/AbstractMethodGenerator.java
deleted file mode 100644
index d82284988e9..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/AbstractMethodGenerator.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* AbstractMethodGenerator.java -- the abstract method generator
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.classpath.tools;
-
-public interface AbstractMethodGenerator
-{
- /**
- * Generate this method for the Stub (remote caller) class.
- */
- String generateStubMethod();
-
- /**
- * Generate this method for the Tie (remote servant) class.
- */
- String generateTieMethod();
-
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/HelpPrinter.java b/libjava/classpath/tools/gnu/classpath/tools/HelpPrinter.java
deleted file mode 100644
index 89468918a08..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/HelpPrinter.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/* HelpPrinter -- help message printer
- Copyright (C) 2006 Free Software Foundation
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.classpath.tools;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-/**
- * The shared class to print the help message and exit, when applicable.
- * Support the --help key.
- *
- * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
- */
-public class HelpPrinter
-{
- /**
- * Check for the --help, -help and -? keys. If one is found, print help and
- * exit the program.
- *
- * @param args the program arguments.
- * @param helpResourcePath the path to the help resource, related to the
- * HelpPrinter class.
- */
- public static void checkHelpKey(String[] args, String helpResourcePath)
- {
- for (int i = 0; i < args.length; i++)
- {
- String a = args[i];
- if (a.equals("-?") || a.equalsIgnoreCase("-help")
- || a.equalsIgnoreCase("--help"))
- printHelpAndExit(helpResourcePath);
- }
- }
-
- /**
- * Prints the contents of the resource specified by the designated path.
- *
- * @param helpResourcePath the path to a help resource, related to the
- * HelpPrinter class.
- */
- public static void printHelp(String helpResourcePath)
- {
- InputStream in = HelpPrinter.class.getResourceAsStream(helpResourcePath);
- BufferedReader br = new BufferedReader(new InputStreamReader(in));
- try
- {
- String s;
- while ((s = br.readLine()) != null)
- System.out.println(s);
- }
- catch (IOException x)
- {
- System.err.print("Resource loading is broken:");
- x.printStackTrace(System.err);
- }
- finally
- {
- try
- {
- br.close();
- }
- catch (IOException ignored)
- {
- }
- }
- }
-
- /**
- * Prints the help message and terminates.
- *
- * @param helpResourcePath the path to the help resource, related to the
- * HelpPrinter class.
- */
- public static void printHelpAndExit(String helpResourcePath)
- {
- printHelp(helpResourcePath);
- System.exit(0);
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/AppletWarning.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/AppletWarning.java
deleted file mode 100644
index b2376a4cb77..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/AppletWarning.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* AppletWarning -- a security warning message display dialog
- Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.classpath.tools.appletviewer;
-
-import javax.swing.JOptionPane;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class AppletWarning
-{
- private static String TITLE = "WARNING";
- private static boolean showWarning = false;
-
- private static String MESSAGE =
- "The current version of this applet plugin does not provide\n" +
- "a security manager capable of handling Java (tm) applets. Applets\n" +
- "have UNRESTRICTED access to your computer. This means they can do\n" +
- "anything you can do, like deleting all your important data.\n\n" +
- "Continue ?";
-
- public static int show()
- {
- if (showWarning)
- return JOptionPane.showConfirmDialog(null, MESSAGE, TITLE,
- JOptionPane.YES_NO_OPTION,
- JOptionPane.WARNING_MESSAGE);
- else
- return JOptionPane.YES_OPTION;
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java
index bc0cc45e128..c41ac1d7c86 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java
@@ -98,7 +98,8 @@ class CommonAppletStub
}
catch (MalformedURLException e)
{
- throw new RuntimeException("unknown codebase");
+ throw new RuntimeException("Attempted to create"
+ + " invalid codebase URL.", e);
}
}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/ConsoleDialog.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/ConsoleDialog.java
deleted file mode 100644
index 9c937cc779d..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/ConsoleDialog.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/* ConsoleDialog -- a console dialog for applets
- Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.classpath.tools.appletviewer;
-
-import java.awt.BorderLayout;
-import java.awt.Button;
-import java.awt.FlowLayout;
-import java.awt.Frame;
-import java.awt.Panel;
-import java.awt.TextArea;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintStream;
-
-
-/**
- * This class is a little dialog showing standard output and standard error output.
- *
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class ConsoleDialog extends Frame
- implements ActionListener
-{
- static class InternalOutputStream extends OutputStream
- {
- private ConsoleDialog console;
-
- public InternalOutputStream(ConsoleDialog console)
- {
- super();
- this.console = console;
- }
-
- public void write(int data) throws IOException
- {
- console.print(String.valueOf((char) data));
- }
- }
-
- private TextArea textArea;
- private Button buttonClear;
- private Button buttonHide;
- private PrintStream printStream;
-
- /**
- * Creates a console dialog object.
- */
- public ConsoleDialog()
- {
- super(Main.messages.getString("gcjwebplugin.console_title"));
-
- setSize(400, 200);
- setLayout(new BorderLayout());
- addWindowListener(new WindowAdapter()
- {
- public void windowClosing(WindowEvent event)
- {
- hide();
- }
- });
-
- textArea = new TextArea();
- textArea.setEditable(false);
- add(textArea);
-
- Panel panel = new Panel();
- panel.setLayout(new FlowLayout());
- add(panel, BorderLayout.SOUTH);
-
- buttonClear = new Button(Main.messages.getString("gcjwebplugin.console_clear"));
- buttonClear.addActionListener(this);
- panel.add(buttonClear);
-
- buttonHide = new Button(Main.messages.getString("gcjwebplugin.console_hide"));
- buttonHide.addActionListener(this);
- panel.add(buttonHide);
-
- printStream = new PrintStream(new InternalOutputStream(this));
- clearTextArea();
- }
-
- /**
- * Clears the content of the textarea and inserts the initial text.
- */
- public void clearTextArea()
- {
- textArea.setText("");
-
- println("java.vm.version: " + System.getProperty("java.vm.version"));
- println("java.vm.vendor: " + System.getProperty("java.vm.vendor"));
- }
-
- /**
- * Print a message into the console dialog.
- *
- * @param message the message to print.
- */
- public void print(String message)
- {
- textArea.append(message);
- }
-
- /**
- * Print a line into the console dialog.
- *
- * @param message the line to print.
- */
- public void println(String message)
- {
- print(message + "\n");
- }
-
- /**
- * Perform actions on button clicks inside the console dialog.
- *
- * @param event the event.
- */
- public void actionPerformed(ActionEvent event)
- {
- if (event.getSource() == buttonHide)
- hide(); // Hide console window.
- else if (event.getSource() == buttonClear)
- clearTextArea(); // Clear text area and insert standard messages.
- }
-
- /**
- * Returns a <code>PrintStream</code> object that prints into the
- * console dialog.
- *
- * @return the <code>PrintStream</code> object.
- */
- public PrintStream getPrintStream()
- {
- return printStream;
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java
index 1d9fed2b04d..a10b889bc97 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java
@@ -37,17 +37,19 @@ exception statement from your version. */
package gnu.classpath.tools.appletviewer;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
import gnu.classpath.tools.getopt.Parser;
import java.applet.Applet;
import java.awt.Dimension;
+import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.URL;
import java.util.ArrayList;
@@ -58,12 +60,6 @@ import java.util.ResourceBundle;
class Main
{
- /**
- * The localized strings are kept in a separate file.
- */
- public static final ResourceBundle messages = ResourceBundle.getBundle
- ("gnu.classpath.tools.appletviewer.MessagesBundle");
-
private static HashMap classLoaderCache = new HashMap();
private static ClassLoader getClassLoader(URL codebase, ArrayList archives)
@@ -108,7 +104,7 @@ class Main
}
if (applet == null)
- applet = new ErrorApplet("Error loading applet");
+ applet = new ErrorApplet(Messages.getString ("Main.ErrorApplet"));
return applet;
}
@@ -125,68 +121,72 @@ class Main
public static void main(String[] args) throws IOException
{
parser = new ClasspathToolParser("appletviewer", true);
- parser.setHeader("usage: appletviewer [OPTION] -code CODE | URL...");
+ parser.setHeader(Messages.getString("Main.Usage"));
- OptionGroup attributeGroup = new OptionGroup("Applet tag options");
+ OptionGroup attributeGroup
+ = new OptionGroup(Messages.getString("Main.AppletTagOptions"));
- attributeGroup.add(new Option("code", Main.messages.getString
- ("gcjwebplugin.code_description"),
- "CODE")
+ attributeGroup.add(new Option("code",
+ Messages.getString("Main.CodeDescription"),
+ Messages.getString("Main.CodeArgument"))
{
public void parsed(String argument) throws OptionException
{
code = argument;
}
});
- attributeGroup.add(new Option("codebase", Main.messages.getString
- ("gcjwebplugin.codebase_description"),
- "CODEBASE")
+ attributeGroup.add
+ (new Option("codebase",
+ Messages.getString("Main.CodebaseDescription"),
+ Messages.getString("Main.CodebaseArgument"))
{
public void parsed(String argument) throws OptionException
{
codebase = argument;
}
});
- attributeGroup.add(new Option("archive", Main.messages.getString
- ("gcjwebplugin.archive_description"),
- "ARCHIVE")
+ attributeGroup.add
+ (new Option("archive",
+ Messages.getString("Main.ArchiveDescription"),
+ Messages.getString("Main.ArchiveArgument"))
{
public void parsed(String argument) throws OptionException
{
archive = argument;
}
});
- attributeGroup.add(new Option("width", Main.messages.getString
- ("gcjwebplugin.width_description"),
- "WIDTH")
+ attributeGroup.add(new Option("width",
+ Messages.getString("Main.WidthDescription"),
+ Messages.getString("Main.WidthArgument"))
{
public void parsed(String argument) throws OptionException
{
dimensions.width = Integer.parseInt(argument);
}
});
- attributeGroup.add(new Option("height", Main.messages.getString
- ("gcjwebplugin.height_description"),
- "HEIGHT")
+ attributeGroup.add(new Option("height",
+ Messages.getString("Main.HeightDescription"),
+ Messages.getString("Main.HeightArgument"))
{
public void parsed(String argument) throws OptionException
{
dimensions.height = Integer.parseInt(argument);
}
});
- attributeGroup.add(new Option("param", Main.messages.getString
- ("gcjwebplugin.param_description"),
- "NAME,VALUE")
+ attributeGroup.add(new Option("param",
+ Messages.getString("Main.ParamDescription"),
+ Messages.getString("Main.ParamArgument"))
{
public void parsed(String argument) throws OptionException
{
parameters.add(argument);
}
});
- OptionGroup pluginGroup = new OptionGroup("Plugin option");
- pluginGroup.add(new Option("plugin", Main.messages.getString
- ("gcjwebplugin.plugin_description"),
- "INPUT,OUTPUT")
+ OptionGroup pluginGroup
+ = new OptionGroup(Messages.getString("Main.PluginOption"));
+ pluginGroup.add(new Option("plugin",
+ Messages.getString("Main.PluginDescription"),
+ Messages.getString("Main.PluginArgument"))
{
public void parsed(String argument) throws OptionException
{
@@ -196,29 +196,34 @@ class Main
pipeOutName = argument.substring(comma + 1);
}
});
- OptionGroup debuggingGroup = new OptionGroup("Debugging option");
- debuggingGroup.add(new Option("verbose", Main.messages.getString
- ("gcjwebplugin.verbose_description"),
- (String) null)
+ OptionGroup debuggingGroup
+ = new OptionGroup(Messages.getString("Main.DebuggingOption"));
+ debuggingGroup.add
+ (new Option("verbose",
+ Messages.getString("Main.VerboseDescription"),
+ (String) null)
{
public void parsed(String argument) throws OptionException
{
verbose = true;
}
});
- OptionGroup compatibilityGroup = new OptionGroup("Compatibility options");
- compatibilityGroup.add(new Option("debug", Main.messages.getString
- ("gcjwebplugin.debug_description"),
- (String) null)
+ OptionGroup compatibilityGroup
+ = new OptionGroup(Messages.getString("Main.CompatibilityOptions"));
+ compatibilityGroup.add
+ (new Option("debug",
+ Messages.getString("Main.DebugDescription"),
+ (String) null)
{
public void parsed(String argument) throws OptionException
{
// Currently ignored.
}
});
- compatibilityGroup.add(new Option("encoding", Main.messages.getString
- ("gcjwebplugin.encoding_description"),
- "CHARSET")
+ compatibilityGroup.add
+ (new Option("encoding",
+ Messages.getString("Main.EncodingDescription"),
+ Messages.getString("Main.EncodingArgument"))
{
public void parsed(String argument) throws OptionException
{
@@ -249,6 +254,7 @@ class Main
if (pluginMode)
{
+ // Plugin will warn user about missing security manager.
InputStream in;
OutputStream out;
@@ -259,13 +265,37 @@ class Main
}
else
{
+ // Warn user about missing security manager.
+ System.err.println(Messages.getString("Main.SecurityWarning") + "\n");
+
+ System.err.println(Messages.getString("Main.ContinuationPrompt"));
+
+ BufferedReader stdin
+ = new BufferedReader(new InputStreamReader(System.in));
+ String response = null;
+
+ try
+ {
+ response = stdin.readLine();
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Failed to read response"
+ + " to continuation prompt.", e);
+ }
+
+ if (!(response.equals("c") || response.equals("C")))
+ {
+ System.exit(0);
+ }
+
if (code == null)
{
// The --code option wasn't given and there are no URL
// arguments so we have nothing to work with.
if (args.length == 0)
{
- System.err.println(Main.messages.getString("gcjwebplugin.no_input_files"));
+ System.err.println(Messages.getString("Main.NoInputFiles"));
System.exit(1);
}
// Create a standalone appletviewer from a list of URLs.
@@ -275,7 +305,8 @@ class Main
{
// Create a standalone appletviewer from the --code
// option.
- new StandaloneAppletViewer(code, codebase, archive, parameters, dimensions);
+ new StandaloneAppletViewer(code, codebase, archive,
+ parameters, dimensions);
}
}
}
@@ -284,7 +315,7 @@ class Main
{
if (verbose)
{
- System.out.println("raw arguments:");
+ System.out.println(Messages.getString("Main.RawArguments"));
for (int i = 0; i < args.length; i++)
System.out.println(" " + args[i]);
diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Messages.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Messages.java
new file mode 100644
index 00000000000..614a509fd53
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Messages.java
@@ -0,0 +1,67 @@
+/* Messages.java -- localization support for appletviewer
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.appletviewer;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages
+{
+ private static final String BUNDLE_NAME
+ = "gnu.classpath.tools.appletviewer.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE
+ = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages()
+ {
+ }
+
+ public static String getString(String key)
+ {
+ try
+ {
+ return RESOURCE_BUNDLE.getString(key);
+ }
+ catch (MissingResourceException e)
+ {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java
index a0e6acd124c..bc445a6b33c 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java
@@ -54,7 +54,7 @@ class PluginAppletContext extends CommonAppletContext
}
catch(IOException e)
{
- System.err.println("showDocument failed: " + e);
+ throw new RuntimeException("showDocument failed.", e);
}
}
@@ -66,7 +66,7 @@ class PluginAppletContext extends CommonAppletContext
}
catch(IOException e)
{
- System.err.println("showDocument failed: " + e);
+ throw new RuntimeException("showStatus failed.", e);
}
}
}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java
index fdb8097b44b..d77aad39223 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java
@@ -141,7 +141,9 @@ class PluginAppletViewer
pluginOutputStream.newLine();
pluginOutputStream.flush();
- System.err.println(" PIPE: applet viewer wrote: " + message);
+ System.err.println
+ (" " + Messages.getString("PluginAppletViewer.AppletViewerWrote")
+ + message);
}
/**
@@ -155,7 +157,9 @@ class PluginAppletViewer
{
String message = pluginInputStream.readLine();
- System.err.println(" PIPE: applet viewer read: " + message);
+ System.err.println
+ (" " + Messages.getString("PluginAppletViewer.AppletViewerRead")
+ + message);
if (message == null || message.equals("shutdown"))
{
@@ -163,7 +167,9 @@ class PluginAppletViewer
pluginInputStream.close();
pluginOutputStream.close();
- System.err.println("appletviewer: exiting plugin applet viewer");
+ System.err.println
+ (Messages.getString("PluginAppletViewer.AppletViewerExiting"));
+
System.exit(0);
}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java
index 6d36e1cf0b9..283d547b801 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java
@@ -428,10 +428,6 @@ class PluginAppletWindow
if (contexts.get(tag.getCodeBase()) == null)
contexts.put(tag.getCodeBase(), new PluginAppletContext());
- int result = AppletWarning.show();
- if (result == JOptionPane.NO_OPTION)
- return;
-
add(applet);
AppletContext context = (AppletContext) contexts.get(tag.getCodeBase());
diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java
index a779f068ab6..48468f84d67 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java
@@ -58,7 +58,8 @@ class StandaloneAppletContext extends CommonAppletContext
public void showDocument(URL url, String target)
{
- System.err.println("showDocument is not implemented in standalone mode");
+ System.err.println
+ (Messages.getString("StandaloneAppletContext.ShowDocumentError"));
}
// In standalone mode, there are potentially several windows, each
diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java
index 2b58f4b87e8..cc3a65cd72c 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java
@@ -79,7 +79,8 @@ class StandaloneAppletViewer extends Main
{
if (!(code.equals("") || code.endsWith(".class")))
{
- System.err.println("appletviewer: option '--code' requires a class filename");
+ System.err.println
+ (Messages.getString("StandaloneAppletViewer.CodeOptionError"));
System.exit(1);
}
@@ -118,13 +119,16 @@ class StandaloneAppletViewer extends Main
{
if (verbose)
{
- System.out.println("parsed applet tags:");
+ System.out.println
+ (Messages.getString("StandaloneAppletViewer.ParsedAppletTags"));
for (int i = 0; i < appletTags.size(); i++)
{
AppletTag tag = (AppletTag) appletTags.get(i);
- System.out.println(" tag " + i + ":");
+ System.out.println
+ (" " + Messages.getString("StandaloneAppletViewer.Tag")
+ + " " + i + ":");
System.out.println(tag);
}
}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java
index fd2a7c0d832..3a0a442825d 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java
@@ -128,57 +128,57 @@ class StandaloneAppletWindow
addHierarchyListener(this);
addHierarchyBoundsListener(this);
- restartItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_restart"));
+ restartItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuRestart"));
restartItem.setEnabled(false);
restartItem.addActionListener(this);
- reloadItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_reload"));
+ reloadItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuReload"));
reloadItem.setEnabled(false);
reloadItem.addActionListener(this);
- cancelItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_cancel"));
+ cancelItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuCancel"));
cancelItem.setEnabled(false);
cancelItem.addActionListener(this);
- saveItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_save"));
+ saveItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuSave"));
saveItem.setEnabled(false);
saveItem.addActionListener(this);
- startItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_start"));
+ startItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuStart"));
startItem.setEnabled(false);
startItem.addActionListener(this);
- cloneItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_clone"));
+ cloneItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuClone"));
cloneItem.setEnabled(false);
cloneItem.addActionListener(this);
- closeItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_close"));
+ closeItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuClose"));
closeItem.setEnabled(false);
closeItem.addActionListener(this);
tagItem =
- new MenuItem(Main.messages.getString("gcjwebplugin.menu_tag"));
+ new MenuItem(Messages.getString("StandaloneAppletWindow.MenuTag"));
tagItem.setEnabled(false);
tagItem.addActionListener(this);
infoItem =
- new MenuItem(Main.messages.getString("gcjwebplugin.menu_info"));
+ new MenuItem(Messages.getString("StandaloneAppletWindow.MenuInfo"));
infoItem.setEnabled(false);
infoItem.addActionListener(this);
editItem =
- new MenuItem(Main.messages.getString("gcjwebplugin.menu_edit"));
+ new MenuItem(Messages.getString("StandaloneAppletWindow.MenuEdit"));
editItem.setEnabled(false);
editItem.addActionListener(this);
editItem.setEnabled(false);
encodingItem =
- new MenuItem(Main.messages.getString("gcjwebplugin.menu_encoding"));
+ new MenuItem(Messages.getString("StandaloneAppletWindow.MenuEncoding"));
encodingItem.setEnabled(false);
encodingItem.addActionListener(this);
printItem =
- new MenuItem(Main.messages.getString("gcjwebplugin.menu_print"));
+ new MenuItem(Messages.getString("StandaloneAppletWindow.MenuPrint"));
printItem.setEnabled(false);
printItem.addActionListener(this);
propertiesItem =
- new MenuItem(Main.messages.getString("gcjwebplugin.menu_properties"));
+ new MenuItem(Messages.getString("StandaloneAppletWindow.MenuProperties"));
propertiesItem.setEnabled(false);
propertiesItem.addActionListener(this);
- quitItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_quit"));
+ quitItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuQuit"));
quitItem.addActionListener(this);
MenuBar menuBar = new MenuBar();
- Menu menuApplet = new Menu(Main.messages.getString("gcjwebplugin.menu_title"));
+ Menu menuApplet = new Menu(Messages.getString("StandaloneAppletWindow.MenuTitle"));
menuBar.add(menuApplet);
menuApplet.add(restartItem);
menuApplet.add(reloadItem);
@@ -199,7 +199,8 @@ class StandaloneAppletWindow
menuApplet.add(closeItem);
menuApplet.add(quitItem);
setMenuBar(menuBar);
- setTitle("GNU Classpath Applet Viewer: " + tag.code);
+ setTitle(Messages.getString("StandaloneAppletWindow.WindowTitle")
+ + " " + tag.code);
AppletContext context = (AppletContext) contexts.get(tag.codebase);
((StandaloneAppletContext) context).addApplet(applet);
diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/TagParser.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/TagParser.java
index 68dce97e0ba..b5bdca70f9b 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/TagParser.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/TagParser.java
@@ -230,12 +230,66 @@ public class TagParser
t.archives = parseArchives(val, t);
val = t.archives.toString();
}
-
+ val = unescapeString(val);
t.parameters.put(key.toLowerCase(), val);
}
}
/**
+ * This method does the same thing as the g_strcompress function in glib.
+ *
+ * @param value
+ * @return value in its original one-byte equivalence.
+ */
+ private static String unescapeString(String value)
+ {
+ String unescVal = "";
+ for (int i = 0; i < value.length(); i++)
+ {
+ if (i == value.length() - 1)
+ {
+ unescVal = unescVal.concat(value.substring(i));
+ break;
+ }
+ if (value.charAt(i) == '\\')
+ {
+ switch (value.charAt(i + 1))
+ {
+ case 'b':
+ unescVal = unescVal.concat("\b");
+ break;
+ case 'f':
+ unescVal = unescVal.concat("\f");
+ break;
+ case 'n':
+ unescVal = unescVal.concat("\n");
+ break;
+ case 'r':
+ unescVal = unescVal.concat("\r");
+ break;
+ case 't':
+ unescVal = unescVal.concat("\t");
+ break;
+ case '\\':
+ unescVal = unescVal.concat("\\");
+ break;
+ case '\"':
+ unescVal = unescVal.concat("\"");
+ break;
+ default:
+ unescVal = unescVal.concat("\\");
+ unescVal = unescVal.concat(value.substring(i + 1, i + 2));
+ break;
+ }
+ i++;
+ }
+ else
+ unescVal = unescVal.concat(value.substring(i, i + 1));
+ }
+ return unescVal;
+ }
+
+ /**
* Parses the archive string and returns a list.
*
* @param the list of archives (comma-separated) in a String.
diff --git a/libjava/classpath/tools/gnu/classpath/tools/common/ClasspathToolParser.java b/libjava/classpath/tools/gnu/classpath/tools/common/ClasspathToolParser.java
new file mode 100644
index 00000000000..e44b9011cfd
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/common/ClasspathToolParser.java
@@ -0,0 +1,87 @@
+/* ClasspathToolParser.java -- Parser subclass for classpath tools
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.classpath.tools.common;
+
+import java.text.MessageFormat;
+
+import gnu.classpath.Configuration;
+import gnu.classpath.tools.getopt.Option;
+import gnu.classpath.tools.getopt.OptionException;
+import gnu.classpath.tools.getopt.Parser;
+
+/**
+ * This is like the Parser class, but is specialized for use by
+ * tools distributed with GNU Classpath. In particular it automatically
+ * computes the version string using the program's name.
+ */
+public class ClasspathToolParser
+ extends Parser
+{
+ private static String getVersionString(String programName)
+ {
+ String fmt = (Messages.getString("ClasspathToolParser.VersionFormat")); //$NON-NLS-1$
+ return MessageFormat.format(fmt,
+ new Object[]
+ {
+ programName,
+ Configuration.CLASSPATH_VERSION
+ });
+ }
+
+ public ClasspathToolParser(String programName)
+ {
+ this(programName, false);
+ }
+
+ public ClasspathToolParser(String programName, boolean longOnly)
+ {
+ super(programName, getVersionString(programName), longOnly);
+ addFinal(new Option('J',
+ Messages.getString("ClasspathToolParser.JArgument"),//$NON-NLS-1$
+ Messages.getString("ClasspathToolParser.JName"), //$NON-NLS-1$
+ true)
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ // -J should be handled by the wrapper binary.
+ // We add it here so that it shows up in the --help output.
+ }
+ });
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/common/Messages.java b/libjava/classpath/tools/gnu/classpath/tools/common/Messages.java
new file mode 100644
index 00000000000..1c92d348d2b
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/common/Messages.java
@@ -0,0 +1,67 @@
+/* Messages.java -- i18n support for tools common code
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.common;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+class Messages
+{
+ private static final String BUNDLE_NAME
+ = "gnu.classpath.tools.common.Messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE
+ = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages()
+ {
+ }
+
+ public static String getString(String key)
+ {
+ try
+ {
+ return RESOURCE_BUNDLE.getString(key);
+ }
+ catch (MissingResourceException e)
+ {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/common/Persistent.java b/libjava/classpath/tools/gnu/classpath/tools/common/Persistent.java
new file mode 100644
index 00000000000..5a2b48a8ddc
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/common/Persistent.java
@@ -0,0 +1,87 @@
+/* PersistentBidiHasthable.java -- Constants for the persistent tables.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.common;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+/**
+ * The static fields, shared by the multiple classes, implementing the
+ * persistent work.
+ *
+ * @author Audrius Meskauskas (audriusa@bioinformatics.org)
+ */
+public interface Persistent
+{
+ /**
+ * Sheduled termination task.
+ */
+ static class ExitTask extends TimerTask
+ {
+ public void run()
+ {
+ System.exit(0);
+ }
+ }
+
+ /**
+ * The timer, sheduling all disk database update events, shared by all
+ * instances.
+ */
+ static Timer timer = new Timer(true);
+
+ /**
+ * The longest time, in ms, after that the database content on the disk must
+ * be updated. The algorithm is written to avoid the very frequent writings to
+ * the disk.
+ */
+ static long SAVE_AT_MOST_AFTER = 5000;
+
+ /**
+ * States how long the database may stay not updated during the intensive
+ * operations, in ms. Otherwise the intensively used structure may never
+ * be stored to the disk.
+ */
+ static long ALWAYS_UPDATE = 300000;
+
+ /**
+ * Write the database content to the disk.
+ */
+ void writeContent();
+
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/getopt/ClasspathToolParser.java b/libjava/classpath/tools/gnu/classpath/tools/getopt/ClasspathToolParser.java
deleted file mode 100644
index e712056ef98..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/getopt/ClasspathToolParser.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* ClasspathToolParser.java -- Parser subclass for classpath tools
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.classpath.tools.getopt;
-
-import java.text.MessageFormat;
-
-import gnu.classpath.Configuration;
-
-/**
- * This is like the Parser class, but is specialized for use by
- * tools distributed with GNU Classpath. In particular it automatically
- * computes the version string using the program's name.
- */
-public class ClasspathToolParser
- extends Parser
-{
- private static String getVersionString(String programName)
- {
- String fmt = (Messages.getString("ClasspathToolParser.VersionFormat")); //$NON-NLS-1$
- return MessageFormat.format(fmt,
- new Object[]
- {
- programName,
- Configuration.CLASSPATH_VERSION
- });
- }
-
- public ClasspathToolParser(String programName)
- {
- super(programName, getVersionString(programName));
- }
-
- public ClasspathToolParser(String programName, boolean longOnly)
- {
- super(programName, getVersionString(programName), longOnly);
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/getopt/Messages.java b/libjava/classpath/tools/gnu/classpath/tools/getopt/Messages.java
index 3c963d786b3..19f10174332 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/getopt/Messages.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/getopt/Messages.java
@@ -41,7 +41,7 @@ package gnu.classpath.tools.getopt;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages
+class Messages
{
private static final String BUNDLE_NAME
= "gnu.classpath.tools.getopt.Messages"; //$NON-NLS-1$
diff --git a/libjava/classpath/tools/gnu/classpath/tools/getopt/Option.java b/libjava/classpath/tools/gnu/classpath/tools/getopt/Option.java
index 6f775e4a105..53255811eb1 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/getopt/Option.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/getopt/Option.java
@@ -44,7 +44,10 @@ package gnu.classpath.tools.getopt;
* like '--verbose'; if the parser is working in "long option only" mode, then a
* long flag has a single dash, like '-verbose'. Both a long and a short form
* may be specified; it is not valid to have neither. A description is mandatory
- * for options; this is used to automatically generate '--help' output.
+ * for options; this is used to automatically generate '--help' output. An option
+ * which takes an argument and which has a short form can also be "joined", in
+ * this case the option's argument can either be separated, like "-I path" or
+ * joined with the short option name, like "-Ipath".
*/
public abstract class Option
{
@@ -56,6 +59,8 @@ public abstract class Option
private String argumentName;
+ private boolean joined;
+
/**
* Create a new option with the given short name and description.
*
@@ -64,6 +69,8 @@ public abstract class Option
*/
protected Option(char shortName, String description)
{
+ if (shortName == 0)
+ throw new IllegalArgumentException("short name must not be \\0");
this.shortName = shortName;
this.description = description;
}
@@ -78,12 +85,34 @@ public abstract class Option
*/
protected Option(char shortName, String description, String argumentName)
{
+ if (shortName == 0)
+ throw new IllegalArgumentException("short name must not be \\0");
this.shortName = shortName;
this.description = description;
this.argumentName = argumentName;
}
/**
+ * Create a new option with the given short name and description.
+ *
+ * @param shortName the short name
+ * @param description the description
+ * @param argumentName the descriptive name of the argument, if this option
+ * takes an argument; otherwise null
+ * @param joined true if the short option is joined to its argument
+ */
+ protected Option(char shortName, String description, String argumentName,
+ boolean joined)
+ {
+ if (shortName == 0)
+ throw new IllegalArgumentException("short name must not be \\0");
+ this.shortName = shortName;
+ this.description = description;
+ this.argumentName = argumentName;
+ this.joined = joined;
+ }
+
+ /**
* Create a new option with the given long name and description. The long name
* should be specified without any leading dashes.
*
@@ -122,6 +151,8 @@ public abstract class Option
*/
protected Option(String longName, char shortName, String description)
{
+ if (shortName == 0)
+ throw new IllegalArgumentException("short name must not be \\0");
this.shortName = shortName;
this.longName = longName;
this.description = description;
@@ -140,10 +171,35 @@ public abstract class Option
protected Option(String longName, char shortName, String description,
String argumentName)
{
+ if (shortName == 0)
+ throw new IllegalArgumentException("short name must not be \\0");
+ this.shortName = shortName;
+ this.longName = longName;
+ this.argumentName = argumentName;
+ this.description = description;
+ }
+
+ /**
+ * Create a new option with the given short and long names and description.
+ * The long name should be specified without any leading dashes.
+ *
+ * @param longName the long name
+ * @param shortName the short name
+ * @param description the description
+ * @param argumentName the descriptive name of the argument, if this option
+ * takes an argument; otherwise null
+ * @param joined true if the short option is joined to its argument
+ */
+ protected Option(String longName, char shortName, String description,
+ String argumentName, boolean joined)
+ {
+ if (shortName == 0)
+ throw new IllegalArgumentException("short name must not be \\0");
this.shortName = shortName;
this.longName = longName;
this.argumentName = argumentName;
this.description = description;
+ this.joined = joined;
}
/**
@@ -188,6 +244,16 @@ public abstract class Option
}
/**
+ * Return true if this is a "joined" option, false otherwise.
+ * Only the short form of an option can be joined; this will always
+ * return false for an option which does not have a short form.
+ */
+ public boolean isJoined()
+ {
+ return joined;
+ }
+
+ /**
* This is called by the parser when this option is recognized. It may be
* called multiple times during a single parse. If this option takes an
* argument, the argument will be passed in. Otherwise the argument will be
diff --git a/libjava/classpath/tools/gnu/classpath/tools/getopt/OptionGroup.java b/libjava/classpath/tools/gnu/classpath/tools/getopt/OptionGroup.java
index f7d966d9459..63853b2d0e4 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/getopt/OptionGroup.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/getopt/OptionGroup.java
@@ -231,10 +231,7 @@ public class OptionGroup
{
if (argName != null)
{
- // This is a silly hack just for '-J'. We don't
- // support joined options in general, but this option
- // is filtered out before argument processing can see it.
- if (option.getShortName() != 'J')
+ if (! option.isJoined())
{
out.print(' ');
++column;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/getopt/Parser.java b/libjava/classpath/tools/gnu/classpath/tools/getopt/Parser.java
index 3c6cf6f46ac..b142836a5dc 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/getopt/Parser.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/getopt/Parser.java
@@ -72,6 +72,8 @@ public class Parser
private OptionGroup defaultGroup = new OptionGroup();
+ private OptionGroup finalGroup;
+
// These are used while parsing.
private int currentIndex;
@@ -166,7 +168,7 @@ public class Parser
this.longOnly = longOnly;
// Put standard options in their own section near the end.
- OptionGroup finalGroup = new OptionGroup(Messages.getString("Parser.StdOptions")); //$NON-NLS-1$
+ finalGroup = new OptionGroup(Messages.getString("Parser.StdOptions")); //$NON-NLS-1$
finalGroup.add(new Option("help", Messages.getString("Parser.PrintHelp")) //$NON-NLS-1$ //$NON-NLS-2$
{
public void parsed(String argument) throws OptionException
@@ -183,15 +185,6 @@ public class Parser
System.exit(0);
}
});
- finalGroup.add(new Option('J', Messages.getString("Parser.JArgument"), Messages.getString("Parser.JName")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- public void parsed(String argument) throws OptionException
- {
- // -J should be handled by the appletviewer wrapper binary.
- // We add it here so that it shows up in the --help output.
- // Note that there is a special case for this in OptionGroup.
- }
- });
add(finalGroup);
add(defaultGroup);
@@ -230,6 +223,18 @@ public class Parser
}
/**
+ * This is like {@link #add(Option)}, but adds the option to the "final"
+ * group. This should be used sparingly, if at all; it is intended for
+ * other very generic options like --help or --version.
+ * @param opt the option to add
+ */
+ protected synchronized void addFinal(Option opt)
+ {
+ options.add(opt);
+ finalGroup.add(opt);
+ }
+
+ /**
* Add an option group to this parser. All the options in this group will be
* recognized by the parser.
*
@@ -314,11 +319,10 @@ public class Parser
String option = real.substring(index);
String justName = option;
int eq = option.indexOf('=');
- if (eq != - 1)
+ if (eq != -1)
justName = option.substring(0, eq);
- char shortName = 0;
- if (justName.length() == 1)
- shortName = justName.charAt(0);
+ boolean isPlainShort = justName.length() == 1;
+ char shortName = justName.charAt(0);
Option found = null;
for (int i = options.size() - 1; i >= 0; --i)
{
@@ -328,8 +332,14 @@ public class Parser
found = opt;
break;
}
- if (shortName != 0 && opt.getShortName() == shortName)
+ if ((isPlainShort || opt.isJoined())
+ && opt.getShortName() == shortName)
{
+ if (! isPlainShort)
+ {
+ // The rest of the option string is the argument.
+ eq = 0;
+ }
found = opt;
break;
}
@@ -343,7 +353,7 @@ public class Parser
String argument = null;
if (found.getTakesArgument())
{
- if (eq == - 1)
+ if (eq == -1)
argument = getArgument(real);
else
argument = option.substring(eq + 1);
@@ -358,35 +368,42 @@ public class Parser
found.parsed(argument);
}
- private void handleShortOption(char option) throws OptionException
+ private void handleShortOptions(String option) throws OptionException
{
- Option found = null;
- for (int i = options.size() - 1; i >= 0; --i)
+ for (int charIndex = 1; charIndex < option.length(); ++charIndex)
{
- Option opt = (Option) options.get(i);
- if (option == opt.getShortName())
+ char optChar = option.charAt(charIndex);
+ Option found = null;
+ for (int i = options.size() - 1; i >= 0; --i)
{
- found = opt;
- break;
+ Option opt = (Option) options.get(i);
+ if (optChar == opt.getShortName())
+ {
+ found = opt;
+ break;
+ }
}
- }
- if (found == null)
- {
- String msg = MessageFormat.format(Messages.getString("Parser.UnrecDash"), //$NON-NLS-1$
- new Object[] { "" + option }); //$NON-NLS-1$
- throw new OptionException(msg);
- }
- String argument = null;
- if (found.getTakesArgument())
- argument = getArgument("-" + option); //$NON-NLS-1$
- found.parsed(argument);
- }
-
- private void handleShortOptions(String option) throws OptionException
- {
- for (int i = 1; i < option.length(); ++i)
- {
- handleShortOption(option.charAt(i));
+ if (found == null)
+ {
+ String msg = MessageFormat.format(Messages.getString("Parser.UnrecDash"), //$NON-NLS-1$
+ new Object[] { "" + optChar }); //$NON-NLS-1$
+ throw new OptionException(msg);
+ }
+ String argument = null;
+ if (found.getTakesArgument())
+ {
+ // If this is a joined short option, and there are more
+ // characters left in this argument, use those as the
+ // argument.
+ if (found.isJoined() && charIndex + 1 < option.length())
+ {
+ argument = option.substring(charIndex + 1);
+ charIndex = option.length();
+ }
+ else
+ argument = getArgument("-" + optChar); //$NON-NLS-1$
+ }
+ found.parsed(argument);
}
}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/getopt/package.html b/libjava/classpath/tools/gnu/classpath/tools/getopt/package.html
new file mode 100644
index 00000000000..ce6d34a4370
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/getopt/package.html
@@ -0,0 +1,49 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in java.util package.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - gnu.classpath.tools.getopt</title></head>
+
+<body>
+<p>This package contains a GNU-style command line option parser. It
+handles short and long options, options with arguments (optionally
+joined to the option text), and a "long option only" mode. It also
+automatically handles <code>--help</code> output. </p>
+
+</body>
+</html>
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/GRMIC.java b/libjava/classpath/tools/gnu/classpath/tools/giop/GRMIC.java
deleted file mode 100644
index c910d7083c7..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/GRMIC.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/* GRMIC.java -- GIOP support for RMIC.
- Copyright (C) 2006 Free Software Foundation
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-*/
-
-package gnu.classpath.tools.giop;
-
-import gnu.classpath.tools.HelpPrinter;
-import gnu.classpath.tools.giop.grmic.GiopRmicCompiler;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * The main class of the GIOP compiler to generate stubs and ties for
- * javax.rmi package.
- *
- * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
- */
-public class GRMIC
-{
- /**
- * The version of the compiler.
- */
- public static String VERSION = "0.0 alpha pre";
-
- /**
- * The GRMIC compiler methods
- *
- * @param args the compiler parameters.
- */
- public static void main(String[] args)
- {
- boolean noWrite = false;
- boolean verbose = false;
-
- String HelpPath = "giop/GRMIC.txt";
-
- HelpPrinter.checkHelpKey(args, HelpPath);
-
- File output = new File(".");
-
- if (args.length == 0)
- {
- HelpPrinter.printHelpAndExit(HelpPath);
- }
- else
- {
- GiopRmicCompiler compiler = new GiopRmicCompiler();
-
- int cl = - 1;
-
- Options: for (int i = 0; i < args.length; i++)
- {
- String c = args[i];
- if (c.equals("-poa"))
- compiler.setPoaMode(true);
- else if (c.equals("-impl"))
- compiler.setPoaMode(false);
- else if (c.equals("-v"))
- {
- printVersion();
- System.exit(0);
- }
- else if (c.equals("-nowrite"))
- noWrite = true;
- else if (c.equals("-nowarn"))
- compiler.setWarnings(false);
- else if (c.equals("-verbose"))
- {
- verbose = true;
- compiler.setVerbose(true);
- }
- else if (c.equals("-force"))
- {
- compiler.setForce(true);
- }
- else if (c.equals("-d"))
- {
- int f = i + 1;
- if (f < args.length)
- {
- output = new File(args[f]);
- i++;
- }
- else
- HelpPrinter.printHelpAndExit(HelpPath);
- }
- else if (c.equals("-classpath"))
- {
- int f = i + 1;
- if (f < args.length)
- {
- compiler.setClassPath(args[f]);
- i++;
- }
- else
- HelpPrinter.printHelpAndExit(HelpPath);
- }
- else if (c.charAt(0) != '-')
- // No more options - start of class list.
- {
- cl = i;
- break Options;
- }
- }
-
- if (cl < 0)
- HelpPrinter.printHelpAndExit(HelpPath);
-
- if (verbose)
- System.out.println("Compiling to " + output.getAbsolutePath());
-
- // Compile classes
- Compile: for (int i = cl; i < args.length; i++)
- {
- if (args[i].charAt(0) != '-')
- {
- compiler.reset();
- Class c = compiler.loadClass(args[i]);
-
- compiler.compile(c);
- String packag = compiler.getPackageName().replace('.', '/');
- File fw = new File(output, packag);
-
- // Generate stub.
- String stub = compiler.generateStub();
- String subName = "_" + compiler.getStubName() + "_Stub.java";
-
- compiler.reset();
- compiler.compile(c);
-
- // Generate tie
- String tie = compiler.generateTie();
- String tieName = "_" + compiler.name(c) + "_Tie.java";
-
- if (noWrite)
- continue Compile;
-
- try
- {
- fw.mkdirs();
- OutputStream out = new FileOutputStream(new File(fw,
- subName));
- out.write(stub.getBytes());
- out.close();
-
- out = new FileOutputStream(new File(fw, tieName));
- out.write(tie.getBytes());
- out.close();
- }
- catch (IOException ioex)
- {
- System.err.println("Output path not accessible");
- ioex.printStackTrace();
- System.exit(1);
- }
- }
- }
- }
- }
-
- /**
- * Print the version information.
- */
- public static void printVersion()
- {
- System.out.println
- ("grmic v "+VERSION+" - GIOP stub and tie generator for javax.rmi.* ");
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/GRMIC.txt b/libjava/classpath/tools/gnu/classpath/tools/giop/GRMIC.txt
deleted file mode 100644
index 875bcdbcf38..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/GRMIC.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-GIOP stub and tie generator source code generator for javax.rmi.*, omg.org.*
-
-Copyright 2006 Free Software Foundation, Inc.
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-Please report bugs at http://www.gnu.org/software/classpath/bugs.html
-
-Usage: grmic <options> <class names>
-
- where <options> includes:
- -poa Generate the Servant based ties (default)
- -impl Generate the obsoleted ObjectImpl based ties
- (for backward compatibility)
- -nowarn Show no warnings
- -nowrite Do not write any files (check for errors only)
- -d <folder> Place generated files into the given folder
- -classpath <path> Specifies the path, where to find the classes being
- compiled
-
- -help Print this help text
- -v Print version
- -verbose Verbose output
- -force Try to generate code even if the input classes seem not
- consistent with RMI specification.
-
-
- and <class names> can include one or more non abstract classes that implement
- Remote and are accessible via current class path.
-
-* This tool generates the source code that must be compiled with java compiler.
-* GRMIC is invoked from RMIC if the -iiop or -giop keys are specified.
-
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/IorParser.java b/libjava/classpath/tools/gnu/classpath/tools/giop/IorParser.java
deleted file mode 100644
index 411b8997d49..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/IorParser.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* IorParser.java -- IOR parser.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-*/
-
-
-package gnu.classpath.tools.giop;
-
-import gnu.CORBA.IOR;
-import gnu.classpath.tools.HelpPrinter;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-
-import org.omg.CORBA.BAD_PARAM;
-
-/**
- * Parses the information, encoded in the Interoperable Object References
- * (IORs).
- *
- * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
- */
-public class IorParser
-{
- /**
- * Parse and print IOR reference. The system exit code is 0 if the parsed
- * IOR was correct, 1 if it was invalid or missing.
- *
- * @param args supports -f file to read IOR from the file.
- */
- public static void main(String[] args)
- {
- boolean ok = false;
- String HelpResource = "giop/IorParser.txt";
- HelpPrinter.checkHelpKey(args, HelpResource);
- if (args.length == 0)
- HelpPrinter.printHelpAndExit(HelpResource);
- else if (args[0].equals("-f") && args.length==2)
- {
- File file = new File(args[1]);
- if (!file.exists())
- System.err.println("The file "+file.getAbsolutePath()+" is missing.");
- // Read IOR reference from file.
- String ior = null;
- try
- {
- FileReader fr = new FileReader(file);
- BufferedReader br = new BufferedReader(fr);
- ior = br.readLine();
- br.close();
- ok = parseAndPrint(ior);
- }
- catch (IOException e)
- {
- System.err.print("Unable to read the file "+file);
- e.printStackTrace();
- }
-
- }
- else if (args.length == 1)
- ok = parseAndPrint(args[0]);
- else
- HelpPrinter.printHelpAndExit(HelpResource);
-
- if (ok)
- System.exit(0);
- else
- System.exit(1);
- }
-
- /**
- * Parse and print IOR.
- *
- * @param ior the IOR string to anlyse.
- * @return true if the passed value is a valid IOR, false otherwise.
- */
- public static boolean parseAndPrint(String ior)
- {
- try
- {
- IOR gior = IOR.parse(ior);
- System.out.println(gior.toStringFormatted());
- return true;
- }
- catch (BAD_PARAM e)
- {
- System.out.println("Invalid ior: "+e.getMessage());
- return false;
- }
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/IorParser.txt b/libjava/classpath/tools/gnu/classpath/tools/giop/IorParser.txt
deleted file mode 100644
index 3b04224f126..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/IorParser.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Copyright 2006 Free Software Foundation, Inc.
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-Please report bugs at http://www.gnu.org/software/classpath/bugs.html
-
-IOR (interoperable GIOP object reference) parser,
- usage: IorParser -f ior_file
- or: IorParser -f ior_string
-
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/NameService.java b/libjava/classpath/tools/gnu/classpath/tools/giop/NameService.java
deleted file mode 100644
index 7e13185f246..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/NameService.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* NameService.java -- Transient GIOP naming service.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.classpath.tools.giop;
-
-import gnu.CORBA.NamingService.NamingServiceTransient;
-import gnu.classpath.tools.HelpPrinter;
-
-/**
- * The implementation of the transient naming service. The naming service
- * is a kind of the network server that registers local and remote objects
- * by name, and later can provide the object reference in response to the
- * given name.
- *
- * GNU Classpath currently works with this naming service and is also
- * interoperable with the Sun Microsystems naming services from releases 1.3 and
- * 1.4, both transient <i>tnameserv</i> and persistent <i>orbd</i>.
- *
- * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
- */
-public class NameService
-{
- /**
- * Start the naming service on the current host at the given port. The
- * parameter -org.omg.CORBA.ORBInitialPort NNN or -ORBInitialPort NNN, if
- * present, specifies the port, on that the service must be started. If this
- * key is not specified, the service starts at the port 900.
- *
- * The parameter -ior FILE_NAME, if present, forces to store the ior string of
- * this naming service to the specified file.
- *
- * @param args the parameter string.
- */
- public static void main(String[] args)
- {
- HelpPrinter.checkHelpKey(args, "giop/NamingService.txt");
- System.out.println("Please use --help for options.");
- NamingServiceTransient.main(args);
- }
-
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/NameServicePersistent.java b/libjava/classpath/tools/gnu/classpath/tools/giop/NameServicePersistent.java
deleted file mode 100644
index df0c9539d6a..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/NameServicePersistent.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/* NamingServicePersistent.java -- The persistent naming service.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.classpath.tools.giop;
-
-import gnu.CORBA.OrbFunctional;
-import gnu.CORBA.IOR;
-import gnu.CORBA.NamingService.Ext;
-import gnu.classpath.tools.HelpPrinter;
-import gnu.classpath.tools.giop.nameservice.PersistentContext;
-
-import org.omg.CosNaming.NamingContextExt;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.PrintStream;
-import java.io.UnsupportedEncodingException;
-
-/**
- * The server for the gnu classpath persistent naming service.
- *
- * GNU Classpath currently works with this naming service and is also
- * interoperable with the Sun Microsystems naming services from releases 1.3 and
- * 1.4, both transient <i>tnameserv</i> and persistent <i>orbd</i>.
- *
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class NameServicePersistent
-{
- /**
- * The default port (900), on that the naming service starts if no
- * -ORBInitialPort is specified in the command line.
- */
- public static final int PORT = 900;
-
- /**
- * Get the object key for the naming service. The default key is the string
- * "NameService" in ASCII.
- *
- * @return the byte array.
- */
- public static byte[] getDefaultKey()
- {
- try
- { // NameService
- return "NameService".getBytes("UTF-8");
- }
- catch (UnsupportedEncodingException ex)
- {
- throw new InternalError("UTF-8 unsupported");
- }
- }
-
- /**
- * Start the naming service on the current host at the given port. The
- * parameter -org.omg.CORBA.ORBInitialPort NNN or -ORBInitialPort NNN, if
- * present, specifies the port, on that the service must be started. If this
- * key is not specified, the service starts at the port 900. The parameter
- * -ior FILE_NAME, if present, forces to store the ior string of this naming
- * service to the specified file.
- *
- * @param args the parameter string.
- */
- public static void main(String[] args)
- {
- HelpPrinter.checkHelpKey(args, "giop/NameServicePersistent.txt");
- System.out.println("Please use --help for options.");
-
- int port = PORT;
- String iorf = null;
- boolean reset = false;
- String folder = "";
- try
- {
- // Create and initialize the ORB
- final OrbFunctional orb = new OrbFunctional();
-
- for (int i = 0; i < args.length; i++)
- {
- if (i < args.length - 1)
- {
- if (args[i].endsWith("ORBInitialPort"))
- port = Integer.parseInt(args[i + 1]);
-
- if (args[i].equals("-ior"))
- iorf = args[i + 1];
-
- if (args[i].equals("-folder"))
- folder = args[i + 1];
- }
- if (args[i].equals("-reset"))
- reset = true;
- }
-
- OrbFunctional.setPort(port);
-
- // Create the servant and register it with the ORB
- File dataFolder = new File(folder);
- System.out.println("Persistent data stored at "
- + dataFolder.getAbsolutePath());
- dataFolder.mkdirs();
-
- // / TODO support more starting modes.
- NamingContextExt namer = new Ext(
- new PersistentContext(
- orb,
- dataFolder,
- reset));
-
- // Case with the key "NameService".
- orb.connect(namer, "NameService".getBytes());
-
- // Storing the IOR reference.
- String ior = orb.object_to_string(namer);
- IOR iorr = IOR.parse(ior);
- if (iorf != null)
- {
- FileOutputStream f = new FileOutputStream(iorf);
- PrintStream p = new PrintStream(f);
- p.print(ior);
- p.close();
- }
-
- System.out.println("GNU Classpath persistent naming service "
- + "started at " + iorr.Internet.host + ":"
- + iorr.Internet.port + " key 'NameService'.\n\n"
- + "Copyright (C) 2006 Free Software Foundation\n"
- + "This tool comes with ABSOLUTELY NO WARRANTY. "
- + "This is free software, and you are\nwelcome to "
- + "redistribute it under conditions, defined in "
- + "GNU Classpath license.\n\n" + ior);
-
- new Thread()
- {
- public void run()
- {
- // Wait for invocations from clients.
- orb.run();
- }
- }.start();
- }
- catch (Exception e)
- {
- System.err.println("ERROR: " + e);
- e.printStackTrace(System.out);
- }
-
- // Restore the default value for allocating ports for the subsequent
- // objects.
- OrbFunctional.setPort(OrbFunctional.DEFAULT_INITIAL_PORT);
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/NameServicePersistent.txt b/libjava/classpath/tools/gnu/classpath/tools/giop/NameServicePersistent.txt
deleted file mode 100644
index 3de15f62a96..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/NameServicePersistent.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright 2006 Free Software Foundation, Inc.
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-Please report bugs at http://www.gnu.org/software/classpath/bugs.html
-
-GNU Classpath GIOP persitent naming service.
- usage: NameServicePersistent <options>
-
- where <options> includes:
-* -org.omg.CORBA.ORBInitialPort NNN
- or -ORBInitialPort NNN - specifies the port, on that the
- service must be started. If this key
- is not specified, the service starts
- at the port 900.
-
-* -ior FILE_NAME - store the IOR reference to this naming
- service to the specified file. The
- IOR reference contains enough
- information to locate the service
- on the web.
-* - folder FOLDER - store the persistent information
- to the given folder
-* - reset - discard any previously stored
- persistent information (cold start)
-
-
-
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/NamingService.txt b/libjava/classpath/tools/gnu/classpath/tools/giop/NamingService.txt
deleted file mode 100644
index f57e4ac66a7..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/NamingService.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-Copyright 2006 Free Software Foundation, Inc.
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-Please report bugs at http://www.gnu.org/software/classpath/bugs.html
-
-GNU Classpath GIOP naming service, usage: NameService <options>
-
- where <options> includes:
-* -org.omg.CORBA.ORBInitialPort NNN or
-* -ORBInitialPort NNN - specifies the port, on that the
- service must be started. If this key
- is not specified, the service starts
- at the port 900.
-
-* -ior FILE_NAME - store the IOR reference to this naming
- service to the specified file. The
- IOR reference contains enough
- information to locate the service
- on the web.
-
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/README b/libjava/classpath/tools/gnu/classpath/tools/giop/README
deleted file mode 100644
index 94fc2f15825..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/README
+++ /dev/null
@@ -1,19 +0,0 @@
-This package defines GIOP tools for creating the applications that use this
-protocol. It provides necessary support for org.omg.* and javax.rmi.*
-packages.
-
-All GIOP tools support the --help option.
-
-The list of the currently available tools:
-
-* GRMIC - RMI-IIOP stub and tie generator.
-* NameService - GIOP transient naming service (this tool is called
- tnameserv in Sun's package).
-* NameServicePersistent
- - GIOP persistent naming service (this tool is called
- orbd in Sun's package).
-* IorParser - Parses the stringified form of the interoperable
- object references (IOR's).
-* RMIC - RMI stub and tie source code generator (complements
- the ASM based bytecode generator in the separate
- tools package). \ No newline at end of file
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/CompilationError.java b/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/CompilationError.java
deleted file mode 100644
index d1fa814ee38..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/CompilationError.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* CompilationError.java -- Thrown on compilation error.
- Copyright (C) 2006 Free Software Foundation
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-*/
-
-package gnu.classpath.tools.giop.grmic;
-
-/**
- * This error is thrown when the target being compiled has illegal
- * strutures.
- *
- * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
- */
-public class CompilationError extends Error
-{
- /**
- * Use serialVersionUID for interoperability.
- */
- private static final long serialVersionUID = 1;
-
- /**
- * Create error with explaining message and cause.
- */
- public CompilationError(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- /**
- * Create error with explaining message
- */
- public CompilationError(String message)
- {
- super(message);
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/Generator.java b/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/Generator.java
deleted file mode 100644
index 17ab821ecc9..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/Generator.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/* Generator.java -- Generic code generator.
- Copyright (C) 2006 Free Software Foundation
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-*/
-
-package gnu.classpath.tools.giop.grmic;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringReader;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * Contains basic methods, used in code generation.
- *
- * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
- */
-public class Generator
-{
- /**
- * Get resource with the given name, as string.
- *
- * @param name the resource name
- * @return the resourse string (in subfolder /templates).
- */
- public String getResource(String name)
- {
- String resourcePath = "templates/" + name;
- InputStream in = getClass().getResourceAsStream(resourcePath);
-
- if (in == null)
- throw new InternalError(getClass().getName() + ": no resource "
- + resourcePath);
-
- BufferedReader r = new BufferedReader(new InputStreamReader(in));
- StringBuffer b = new StringBuffer();
-
- String s;
- try
- {
- while ((s = r.readLine()) != null)
- {
- b.append(s);
- b.append('\n');
- }
- r.close();
- }
- catch (IOException e)
- {
- InternalError ierr = new InternalError("No expected resource " + name);
- ierr.initCause(e);
- throw ierr;
- }
-
- return b.toString();
- }
-
- /**
- * Replace the variable references (starting from #) in the template string by
- * the values, present in the given map. The strings, not present in the
- * variable map, are ignored.
- *
- * @param template
- * the template string
- * @param variables
- * the map of variables (name to value) to replace.
- * @return the string with replaced values.
- */
- public String replaceAll(String template, Map variables)
- {
- BufferedReader r = new BufferedReader(new StringReader(template));
- String s;
- StringBuffer b = new StringBuffer(template.length());
- try
- {
- Iterator iter;
- Collection vars = variables.keySet();
- while ((s = r.readLine()) != null)
- {
- // At least one variable must appear in the string to make
- // the string scan sensible.
- if (s.indexOf('#') >= 0)
- {
- iter = vars.iterator();
- String variable;
- while (iter.hasNext())
- {
- variable = (String) iter.next();
- if (s.indexOf(variable) >= 0)
- s = s.replaceAll(variable,
- (String) variables.get(variable));
- }
- }
- b.append(s);
- b.append('\n');
- }
- r.close();
- }
- catch (IOException e)
- {
- // This should never happen.
- InternalError ierr = new InternalError("");
- ierr.initCause(e);
- throw ierr;
- }
- return b.toString();
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/GiopIo.java b/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/GiopIo.java
deleted file mode 100644
index 0e0df7bc57a..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/GiopIo.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/* GiopIo.java -- Generates GIOP input/output statements.
- Copyright (C) 2006 Free Software Foundation
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-*/
-
-package gnu.classpath.tools.giop.grmic;
-
-import java.rmi.Remote;
-
-import org.omg.CORBA.portable.ObjectImpl;
-
-/**
- * Generates the code for reading and writing data over GIOP stream.
- *
- * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
- */
-public class GiopIo
-{
- /**
- * Get the statement for writing the variable of the given type to the GIOP ({@link org.omg.CORBA_2_3.portable.OutputStream) stream. The
- * stream is always named "out".
- *
- * @param c
- * the class of the object being written
- * @param variable
- * the variable, where the object value is stored
- * @param r
- * the parent generator, used to name the class
- * @return the write statement.
- */
- public static String getWriteStatement(Class c, String variable, GiopRmicCompiler r)
- {
- if (c.equals(boolean.class))
- return "out.write_boolean(" + variable + ");";
- if (c.equals(byte.class))
- return "out.write_octet(" + variable + ");";
- else if (c.equals(short.class))
- return "out.write_int(" + variable + ");";
- else if (c.equals(int.class))
- return "out.write_long(" + variable + ");";
- else if (c.equals(long.class))
- return "out.write_long_long(" + variable + ");";
- else if (c.equals(double.class))
- return "out.write_double(" + variable + ");";
- else if (c.equals(float.class))
- return "out.write_float(" + variable + ");";
- else if (c.equals(char.class))
- return "out.write_char(" + variable + ");";
- else if (Remote.class.isAssignableFrom(c))
- return "Util.writeRemoteObject(out, " + variable + ");";
- else if (ObjectImpl.class.isAssignableFrom(c))
- return "out.write_Object(" + variable + ");";
- else
- return "out.write_value(" + variable + ", " + r.name(c) + ".class);";
- }
-
- /**
- * Get the statement for reading the value of the given type from to the GIOP ({@link org.omg.CORBA_2_3.portable.InputStream) stream. The
- * stream is always named "in".
- *
- * @param c
- * the class of the object being written
- * @param r
- * the parent generator, used to name the class
- * @return the right side of the read statement.
- */
- public static String getReadStatement(Class c, GiopRmicCompiler r)
- {
- if (c.equals(boolean.class))
- return "in.read_boolean();";
- else if (c.equals(byte.class))
- return "in.read_octet();";
- else if (c.equals(short.class))
- return "in.read_int();";
- else if (c.equals(int.class))
- return "in.read_long();";
- else if (c.equals(long.class))
- return "in.read_long_long();";
- else if (c.equals(double.class))
- return "in.read_double();";
- else if (c.equals(float.class))
- return "in.read_float();";
- else if (c.equals(char.class))
- return "in.read_char();";
- else if (Remote.class.isAssignableFrom(c))
- return "(" + r.name(c)
- + ") PortableRemoteObject.narrow(in.read_Object()," + r.name(c)
- + ".class);";
- else if (ObjectImpl.class.isAssignableFrom(c))
- return "in.read_Object();";
- else
- return "(" + r.name(c)
- + ") in.read_value(" + r.name(c) + ".class);";
- }
-
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java b/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java
deleted file mode 100644
index 6d895a14cd3..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java
+++ /dev/null
@@ -1,593 +0,0 @@
-/* GiopRmicCompiler -- Central GIOP-based RMI stub and tie compiler class.
- Copyright (C) 2006 Free Software Foundation
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-*/
-
-package gnu.classpath.tools.giop.grmic;
-
-import gnu.classpath.tools.AbstractMethodGenerator;
-
-import java.io.File;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.StringTokenizer;
-import java.util.TreeSet;
-
-/**
- * Provides the extended rmic functionality to generate the POA - based classes
- * for GIOP (javax.rmi.CORBA package).
- *
- * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
- */
-public class GiopRmicCompiler
- extends Generator implements Comparator
-{
- /** The package name. */
- protected String packag;
-
- /**
- * The "basic" name (normally, the interface name, unless several Remote -
- * derived interfaces are implemented.
- */
- protected String name;
-
- /**
- * The name (without package) of the class, passed as the parameter.
- */
- protected String implName;
-
- /**
- * The proposed name for the stub.
- */
- protected String stubName;
-
- /**
- * The Remote's, implemented by this class.
- */
- protected Collection implementedRemotes = new HashSet();
-
- /**
- * The extra classes that must be imported.
- */
- protected Collection extraImports = new HashSet();
-
- /**
- * The methods we must implement.
- */
- protected Collection methods = new HashSet();
-
- /**
- * The map of all code generator variables.
- */
- public Properties vars = new Properties();
-
- /**
- * If this flag is set (true by default), the compiler generates the Servant
- * based classes. If set to false, the compiler generates the old style
- * ObjectImpl based classes.
- */
- protected boolean poaMode = true;
-
- /**
- * If this flag is set (true by default), the compiler emits warnings.
- */
- protected boolean warnings = true;
-
- /**
- * Verbose output
- */
- protected boolean verbose = false;
-
- /**
- * Force mode - do not check the exceptions
- */
- protected boolean force = false;
-
- /**
- * The class loader to load the class being compiled.
- */
- ClassLoader classLoader;
-
- /**
- * Clear data, preparing for the next compilation.
- */
- public void reset()
- {
- packag = name = implName = stubName = null;
- implementedRemotes.clear();
- extraImports.clear();
- methods.clear();
- vars.clear();
- }
-
- /**
- * Set the class path (handle the -classpath key)
- *
- * @param classPath the class path to set.
- */
- public void setClassPath(String classPath)
- {
- classLoader = Thread.currentThread().getContextClassLoader();
- StringTokenizer tok = new StringTokenizer(classPath, File.pathSeparator,
- true);
- ArrayList urls = new ArrayList(tok.countTokens());
- String s = null;
- try
- {
- while (tok.hasMoreTokens())
- {
- s = tok.nextToken();
- if (s.equals(File.pathSeparator))
- urls.add(new File(".").toURL());
- else
- {
- urls.add(new File(s).toURL());
- if (tok.hasMoreTokens())
- {
- // Skip the separator.
- tok.nextToken();
- // If the classpath ended with a separator,
- // append the current directory.
- if (! tok.hasMoreTokens())
- urls.add(new File(".").toURL());
- }
- }
- }
- }
- catch (MalformedURLException ex)
- {
- System.err.println("Malformed path '" + s + "' in classpath '"
- + classPath + "'");
- System.exit(1);
- }
- URL[] u = new URL[urls.size()];
- for (int i = 0; i < u.length; i++)
- {
- u[i] = (URL) urls.get(i);
- }
-
- classLoader = new URLClassLoader(u, classLoader);
- }
-
- /**
- * Loads the class with the given name (uses class path, if applicable)
- *
- * @param name the name of the class.
- */
- public Class loadClass(String name)
- {
- ClassLoader loader = classLoader;
- if (loader == null)
- loader = Thread.currentThread().getContextClassLoader();
- try
- {
- return loader.loadClass(name);
- }
- catch (ClassNotFoundException e)
- {
- System.err.println(name+" not found on "+loader);
- System.exit(1);
- // Unreacheable code.
- return null;
- }
- }
-
- /**
- * Compile the given class (the instance of Remote), generating the stub and
- * tie for it.
- *
- * @param remote
- * the class to compile.
- */
- public synchronized void compile(Class remote)
- {
- reset();
- String s;
-
- // Get the package.
- s = remote.getName();
- int p = s.lastIndexOf('.');
- if (p < 0)
- {
- // Root package.
- packag = "";
- implName = name = s;
- }
- else
- {
- packag = s.substring(0, p);
- implName = name = s.substring(p + 1);
- }
-
- name = convertStubName(name);
-
- stubName = name;
-
- vars.put("#name", name);
- vars.put("#package", packag);
- vars.put("#implName", implName);
-
- if (verbose)
- System.out.println("Package " + packag + ", name " + name + " impl "
- + implName);
-
- // Get the implemented remotes.
- Class[] interfaces = remote.getInterfaces();
-
- for (int i = 0; i < interfaces.length; i++)
- {
- if (Remote.class.isAssignableFrom(interfaces[i]))
- {
- if (! interfaces[i].equals(Remote.class))
- {
- implementedRemotes.add(interfaces[i]);
- }
- }
- }
-
- vars.put("#idList", getIdList(implementedRemotes));
-
- // Collect and process methods.
- Iterator iter = implementedRemotes.iterator();
-
- while (iter.hasNext())
- {
- Class c = (Class) iter.next();
- Method[] m = c.getMethods();
-
- // Check if throws RemoteException.
- for (int i = 0; i < m.length; i++)
- {
- Class[] exc = m[i].getExceptionTypes();
- boolean remEx = false;
-
- for (int j = 0; j < exc.length; j++)
- {
- if (RemoteException.class.isAssignableFrom(exc[j]))
- {
- remEx = true;
- break;
- }
- }
- if (! remEx && !force)
- throw new CompilationError(m[i].getName() + ", defined in "
- + c.getName()
- + ", does not throw "
- + RemoteException.class.getName());
- AbstractMethodGenerator mm = createMethodGenerator(m[i]);
- methods.add(mm);
- }
- }
- }
-
- /**
- * Create the method generator for the given method.
- *
- * @param m the method
- *
- * @return the created method generator
- */
- protected AbstractMethodGenerator createMethodGenerator(Method m)
- {
- return new MethodGenerator(m, this);
- }
-
- /**
- * Get the name of the given class. The class is added to imports, if not
- * already present and not from java.lang and not from the current package.
- *
- * @param nameIt
- * the class to name
- * @return the name of class as it should appear in java language
- */
- public String name(Class nameIt)
- {
- if (nameIt.isArray())
- {
- // Mesure dimensions:
- int dimension = 0;
- Class finalComponent = nameIt;
- while (finalComponent.isArray())
- {
- finalComponent = finalComponent.getComponentType();
- dimension++;
- }
-
- StringBuffer brackets = new StringBuffer();
-
- for (int i = 0; i < dimension; i++)
- {
- brackets.append("[]");
- }
-
- return name(finalComponent) + " " + brackets;
- }
- else
- {
- String n = nameIt.getName();
- if (! nameIt.isArray() && ! nameIt.isPrimitive())
- if (! n.startsWith("java.lang")
- && ! (packag != null && n.startsWith(packag)))
- extraImports.add(n);
-
- int p = n.lastIndexOf('.');
- if (p < 0)
- return n;
- else
- return n.substring(p + 1);
- }
- }
-
- /**
- * Get the RMI-style repository Id for the given class.
- *
- * @param c
- * the interface, for that the repository Id must be created.
- * @return the repository id
- */
- public String getId(Class c)
- {
- return "RMI:" + c.getName() + ":0000000000000000";
- }
-
- /**
- * Get repository Id string array declaration.
- *
- * @param remotes
- * the collection of interfaces
- * @return the fully formatted string array.
- */
- public String getIdList(Collection remotes)
- {
- StringBuffer b = new StringBuffer();
-
- // Keep the Ids sorted, ensuring, that the same order will be preserved
- // between compilations.
- TreeSet sortedIds = new TreeSet();
-
- Iterator iter = remotes.iterator();
- while (iter.hasNext())
- {
- sortedIds.add(getId((Class) iter.next()));
- }
-
- iter = sortedIds.iterator();
- while (iter.hasNext())
- {
- b.append(" \"" + iter.next() + "\"");
- if (iter.hasNext())
- b.append(", \n");
- }
- return b.toString();
- }
-
- /**
- * Generate stub. Can only be called from {@link #compile}.
- *
- * @return the string, containing the text of the generated stub.
- */
- public String generateStub()
- {
- String template = getResource("Stub.jav");
-
- // Generate methods.
- StringBuffer b = new StringBuffer();
- Iterator iter = methods.iterator();
- while (iter.hasNext())
- {
- AbstractMethodGenerator m = (AbstractMethodGenerator) iter.next();
- b.append(m.generateStubMethod());
- }
-
- vars.put("#stub_methods", b.toString());
- vars.put("#imports", getImportStatements());
- vars.put("#interfaces", getAllInterfaces());
-
- String output = replaceAll(template, vars);
- return output;
- }
-
- /**
- * Get the list of all interfaces, implemented by the class, that are
- * derived from Remote.
- *
- * @return the string - all interfaces.
- */
- public String getAllInterfaces()
- {
- StringBuffer b = new StringBuffer();
- Iterator iter = implementedRemotes.iterator();
-
- while (iter.hasNext())
- {
- b.append(name((Class) iter.next()));
- if (iter.hasNext())
- b.append(", ");
- }
-
- return b.toString();
- }
-
- /**
- * Generate Tie. Can only be called from {@link #compile}.
- *
- * @return the string, containing the text of the generated Tie.
- */
- public String generateTie()
- {
- String template;
- if (poaMode)
- template = getResource("Tie.jav");
- else
- template = getResource("ImplTie.jav");
-
- // Generate methods.
- HashFinder hashFinder = new HashFinder();
-
- // Find the hash character position:
- Iterator iter = methods.iterator();
- String[] names = new String[methods.size()];
- int p = 0;
-
- for (int i = 0; i < names.length; i++)
- names[i] = ((MethodGenerator) iter.next()).getGiopMethodName();
-
- int hashCharPosition = hashFinder.findHashCharPosition(names);
-
- iter = methods.iterator();
- while (iter.hasNext())
- ((MethodGenerator) iter.next()).hashCharPosition = hashCharPosition;
-
- vars.put("#hashCharPos", Integer.toString(hashCharPosition));
-
- ArrayList sortedMethods = new ArrayList(methods);
- Collections.sort(sortedMethods, this);
-
- iter = sortedMethods.iterator();
-
- StringBuffer b = new StringBuffer();
-
- MethodGenerator prev = null;
-
- while (iter.hasNext())
- {
- MethodGenerator m = (MethodGenerator) iter.next();
- m.previous = prev;
- m.hashCharPosition = hashCharPosition;
- prev = m;
- b.append(m.generateTieMethod());
- }
-
- vars.put("#tie_methods", b.toString());
-
- vars.put("#imports", getImportStatements());
-
- String output = replaceAll(template, vars);
- return output;
- }
-
- public int compare(Object a, Object b)
- {
- MethodGenerator g1 = (MethodGenerator) a;
- MethodGenerator g2 = (MethodGenerator) b;
-
- return g1.getHashChar() - g2.getHashChar();
- }
-
- /**
- * Import the extra classes, used as the method parameters and return values.
- *
- * @return the additional import block.
- */
- protected String getImportStatements()
- {
- TreeSet imp = new TreeSet();
-
- Iterator it = extraImports.iterator();
- while (it.hasNext())
- {
- String ic = it.next().toString();
- imp.add("import " + ic + ";\n");
- }
-
- StringBuffer b = new StringBuffer();
- it = imp.iterator();
-
- while (it.hasNext())
- {
- b.append(it.next());
- }
- return b.toString();
- }
-
- /**
- * If this flag is set (true by default), the compiler generates the Servant
- * based classes. If set to false, the compiler generates the old style
- * ObjectImpl based classes.
- */
- public void setPoaMode(boolean mode)
- {
- poaMode = mode;
- }
-
- /**
- * Set the verbose output mode (false by default)
- *
- * @param isVerbose the verbose output mode
- */
- public void setVerbose(boolean isVerbose)
- {
- verbose = isVerbose;
- }
-
- /**
- * If this flag is set (true by default), the compiler emits warnings.
- */
- public void setWarnings(boolean warn)
- {
- warnings = warn;
- }
-
- /**
- * Set the error ignore mode.
- */
- public void setForce(boolean isforce)
- {
- force = isforce;
- }
-
- /**
- * Get the package name.
- */
- public String getPackageName()
- {
- return packag;
- }
-
- /**
- * Get the proposed stub name
- */
- public String getStubName()
- {
- return stubName;
- }
-
- /**
- * Additional processing of the stub name.
- */
- public String convertStubName(String name)
- {
- // Drop the Impl suffix, if one exists.
- if (name.endsWith("Impl"))
- return name.substring(0, name.length() - "Impl".length());
- else
- return name;
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/HashFinder.java b/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/HashFinder.java
deleted file mode 100644
index 2efdb1e76de..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/HashFinder.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* HashFinder.java -- finds the hash character.
- Copyright (C) 2006 Free Software Foundation
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-*/
-
-
-package gnu.classpath.tools.giop.grmic;
-
-import java.util.HashSet;
-
-/**
- * This class finds the hash character (the most different character in
- * the passed array of strings). This character is used to accelerate the
- * method invocation by name.
- *
- * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
- */
-public class HashFinder
-{
- /**
- * Find the hash char position in the given collection of strings.
- *
- * @param strings the string collection
- *
- * @return the optimal hash character position, always less then the
- * length of the shortest string.
- */
- public int findHashCharPosition(String[] strings)
- {
- // Find the length of the shortest string:
-
- int l = strings[0].length();
- for (int i = 1; i < strings.length; i++)
- {
- if (strings[i].length() < l)
- l = strings[i].length();
- }
-
- // Find the position with the smallest number of the matching characters:
- HashSet[] charLists = new HashSet[l];
-
- for (int i = 0; i < charLists.length; i++)
- {
- charLists[i] = new HashSet(strings.length);
- }
-
- for (int i = 0; i < strings.length; i++)
- for (int p = 0; p < l; p++)
- {
- charLists[p].add(new Integer(strings[i].charAt(p)));
- }
-
- int m = 0;
- int v = charLists[0].size();
-
- for (int i = 1; i < charLists.length; i++)
- {
- // Replace on equality also, seeking the hash char closer to the end
- // of line.
- if (charLists[i].size()>=v)
- {
- m = i;
- v = charLists[i].size();
- }
- }
- return m;
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/MethodGenerator.java b/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/MethodGenerator.java
deleted file mode 100644
index 80148d51aff..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/MethodGenerator.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/* MethodGenerator.java -- Generates methods for GIOP rmic compiler.
- Copyright (C) 2006 Free Software Foundation
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-*/
-
-package gnu.classpath.tools.giop.grmic;
-
-import gnu.classpath.tools.AbstractMethodGenerator;
-
-import java.lang.reflect.Method;
-import java.util.Properties;
-
-/**
- * Keeps information about the single method and generates the code fragments,
- * related to that method.
- *
- * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
- */
-public class MethodGenerator implements AbstractMethodGenerator
-{
- /**
- * The method being defined.
- */
- Method method;
-
- /**
- * The parent code generator.
- */
- GiopRmicCompiler rmic;
-
- /**
- * The previous method in the list, null for the first element.
- * Used to avoid repretetive inclusion of the same hash code label.
- */
- MethodGenerator previous = null;
-
- /**
- * The hash character position.
- */
- int hashCharPosition;
-
- /**
- * Create the new method generator for the given method.
- *
- * @param aMethod
- * the related method.
- * @param aRmic
- * the Rmic generator instance, where more class - related
- * information is defined.
- */
- public MethodGenerator(Method aMethod, GiopRmicCompiler aRmic)
- {
- method = aMethod;
- rmic = aRmic;
- }
-
- /**
- * Get the method name.
- *
- * @return the name of the method.
- */
- public String getGiopMethodName()
- {
- String m = method.getName();
- if (m.startsWith("get"))
- return "_get_J" + m.substring("get".length());
- else if (m.startsWith("set"))
- return "_set_J" + m.substring("set".length());
- else
- return m;
- }
-
- /**
- * Get the method parameter declaration.
- *
- * @return the string - method parameter declaration.
- */
- public String getArgumentList()
- {
- StringBuffer b = new StringBuffer();
-
- Class[] args = method.getParameterTypes();
-
- for (int i = 0; i < args.length; i++)
- {
- b.append(rmic.name(args[i]));
- b.append(" p" + i);
- if (i < args.length - 1)
- b.append(", ");
- }
- return b.toString();
- }
-
- /**
- * Get the method parameter list only (no type declarations). This is used to
- * generate the method invocations statement.
- *
- * @return the string - method parameter list.
- */
- public String getArgumentNames()
- {
- StringBuffer b = new StringBuffer();
-
- Class[] args = method.getParameterTypes();
-
- for (int i = 0; i < args.length; i++)
- {
- b.append(" p" + i);
- if (i < args.length - 1)
- b.append(", ");
- }
- return b.toString();
- }
-
- /**
- * Get the list of exceptions, thrown by this method.
- *
- * @return the list of exceptions.
- */
- public String getThrows()
- {
- StringBuffer b = new StringBuffer();
-
- Class[] args = method.getExceptionTypes();
-
- for (int i = 0; i < args.length; i++)
- {
- b.append(rmic.name(args[i]));
- if (i < args.length - 1)
- b.append(", ");
- }
- return b.toString();
- }
-
- /**
- * Generate this method for the Stub class.
- *
- * @return the method body for the stub class.
- */
- public String generateStubMethod()
- {
- String templateName;
-
- Properties vars = new Properties(rmic.vars);
- vars.put("#return_type", rmic.name(method.getReturnType()));
- vars.put("#method_name", method.getName());
- vars.put("#giop_method_name", getGiopMethodName());
- vars.put("#argument_list", getArgumentList());
- vars.put("#argument_names", getArgumentNames());
-
- vars.put("#argument_write", getStubParaWriteStatement());
-
- if (method.getReturnType().equals(void.class))
- vars.put("#read_return", "return;");
- else
- vars.put("#read_return",
- "return "
- + GiopIo.getReadStatement(method.getReturnType(), rmic));
- String thr = getThrows();
- if (thr.length() > 0)
- vars.put("#throws", "\n throws " + thr);
- else
- vars.put("#throws", "");
-
- if (method.getReturnType().equals(void.class))
- templateName = "StubMethodVoid.jav";
- else
- {
- vars.put("#write_result",
- GiopIo.getWriteStatement(method.getReturnType(), "result",
- rmic));
- templateName = "StubMethod.jav";
- }
-
- String template = rmic.getResource(templateName);
- String generated = rmic.replaceAll(template, vars);
- return generated;
- }
-
- /**
- * Generate this method handling fragment for the Tie class.
- *
- * @return the fragment to handle this method for the Tie class.
- */
- public String generateTieMethod()
- {
- String templateName;
-
- Properties vars = new Properties(rmic.vars);
- vars.put("#return_type", rmic.name(method.getReturnType()));
- vars.put("#method_name", method.getName());
- vars.put("#giop_method_name", getGiopMethodName());
- vars.put("#argument_list", getArgumentList());
- vars.put("#argument_names", getArgumentNames());
-
- vars.put("#argument_write", getStubParaWriteStatement());
-
- if (previous == null || previous.getHashChar()!=getHashChar())
- vars.put("#hashCodeLabel"," case '"+getHashChar()+"':");
- else
- vars.put("#hashCodeLabel"," // also '"+getHashChar()+"':");
-
- if (method.getReturnType().equals(void.class))
- templateName = "TieMethodVoid.jav";
- else
- {
- vars.put("#write_result",
- GiopIo.getWriteStatement(method.getReturnType(), "result",
- rmic));
- templateName = "TieMethod.jav";
- }
- vars.put("#read_and_define_args", getRda());
-
- String template = rmic.getResource(templateName);
- String generated = rmic.replaceAll(template, vars);
- return generated;
- }
-
- /**
- * Generate sentences for Reading and Defining Arguments.
- *
- * @return the sequence of sentences for reading and defining arguments.
- */
- public String getRda()
- {
- StringBuffer b = new StringBuffer();
- Class[] args = method.getParameterTypes();
-
- for (int i = 0; i < args.length; i++)
- {
- b.append(" ");
- b.append(rmic.name(args[i]));
- b.append(" ");
- b.append("p"+i);
- b.append(" = ");
- b.append(GiopIo.getReadStatement(args[i], rmic));
- if (i<args.length-1)
- b.append("\n");
- }
- return b.toString();
- }
-
- /**
- * Get the write statement for writing parameters inside the stub.
- *
- * @return the write statement.
- */
- public String getStubParaWriteStatement()
- {
- StringBuffer b = new StringBuffer();
- Class[] args = method.getParameterTypes();
-
- for (int i = 0; i < args.length; i++)
- {
- b.append(" ");
- b.append(GiopIo.getWriteStatement(args[i], "p" + i, rmic));
- b.append("\n");
- }
- return b.toString();
- }
-
- /**
- * Get the hash char.
- */
- public char getHashChar()
- {
- return getGiopMethodName().charAt(hashCharPosition);
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/nameservice/PersistentContext.java b/libjava/classpath/tools/gnu/classpath/tools/giop/nameservice/PersistentContext.java
deleted file mode 100644
index 9f0903f0ab8..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/nameservice/PersistentContext.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/* PersistentContext.java -- The persistent naming context.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
- This file is part of GNU Classpath.
-
- GNU Classpath is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- GNU Classpath is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Classpath; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 USA.
-
- Linking this library statically or dynamically with other modules is
- making a combined work based on this library. Thus, the terms and
- conditions of the GNU General Public License cover the whole
- combination.
-
- As a special exception, the copyright holders of this library give you
- permission to link this library with independent modules to produce an
- executable, regardless of the license terms of these independent
- modules, and to copy and distribute the resulting executable under
- terms of your choice, provided that you also meet, for each linked
- independent module, the terms and conditions of the license of that
- module. An independent module is a module which is not derived from
- or based on this library. If you modify this library, you may extend
- this exception to your version of the library, but you are not
- obligated to do so. If you do not wish to do so, delete this
- exception statement from your version. */
-
-
-package gnu.classpath.tools.giop.nameservice;
-
-import gnu.CORBA.NamingService.NameTransformer;
-import gnu.CORBA.NamingService.TransientContext;
-
-import java.io.File;
-
-import org.omg.CORBA.ORB;
-import org.omg.CosNaming.NameComponent;
-import org.omg.CosNaming.NamingContext;
-import org.omg.CosNaming.NamingContextPackage.AlreadyBound;
-import org.omg.CosNaming.NamingContextPackage.CannotProceed;
-import org.omg.CosNaming.NamingContextPackage.InvalidName;
-import org.omg.CosNaming.NamingContextPackage.NotFound;
-
-/**
- * This class implements the persistent naming service, defined by
- * {@link NamingContext}. The 'persistent' means that the service remembers the
- * mappings, stored between restarts.
- *
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class PersistentContext
- extends TransientContext
-{
- /**
- * Use serial version UID for interoperability.
- */
- private static final long serialVersionUID = 2;
-
- /**
- * The folder, where the persistent context information is stored.
- */
- File contextFolder;
-
- /**
- * The uinque context identifier.
- */
- static long num = System.currentTimeMillis();
-
- /**
- * The naming service orb.
- */
- ORB orb;
-
- /**
- * Create the persistent naming context that will store the files in the given
- * folder of the local file system. This method also connects object to the
- * passed ORB.
- *
- * @param an_orb the naming service ORB, used to obtain and produce the object
- * stringified references.
- * @param folder the folder, where the persistent information is stored.
- * @param reset if true, the previous naming data are discarded. If false
- * (normally expected), they are loaded from the persistent memory to
- * provide the persistence.
- */
- public PersistentContext(ORB an_orb, File folder, boolean reset)
- {
- super(
- new PersistentContextMap(an_orb, new File(folder, "contexts.txt"), reset),
- new PersistentMap(an_orb, new File(folder, "objects.txt"), reset));
- contextFolder = folder;
- folder.mkdirs();
- orb = an_orb;
- orb.connect(this);
- }
-
- /**
- * Get the unique context number;
- *
- * @return the context number
- */
- static synchronized String getNum()
- {
- return Long.toHexString(num++);
- }
-
- /**
- * Create new persistent context.
- */
- public NamingContext new_context()
- {
- File ctxFolder = new File(contextFolder, "ctx_"+getNum());
- return new PersistentContext(orb, ctxFolder, true);
- }
-
- /**
- * Create a new context and give it a given name (bound it) in the current
- * context. The method benefits from passing the better readable context name.
- *
- * @param a_name the name being given to the new context.
- * @return the newly created context.
- * @throws AlreadyBound if the name is already in use.
- * @throws InvalidName if the name has zero length or otherwise invalid.
- */
- public NamingContext bind_new_context(NameComponent[] a_name)
- throws NotFound, AlreadyBound, CannotProceed, InvalidName
- {
- if (named_contexts.containsKey(a_name[0])
- || named_objects.containsKey(a_name[0]))
- throw new AlreadyBound();
-
- NameTransformer transformer = new NameTransformer();
-
- File ctxFolder = new File(contextFolder,
- transformer.toString(a_name).replace('/', '.')
- + ".v" + getNum());
-
- NamingContext child = new PersistentContext(orb, ctxFolder, true);
- bind_context(a_name, child);
- return child;
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/nameservice/PersistentContextMap.java b/libjava/classpath/tools/gnu/classpath/tools/giop/nameservice/PersistentContextMap.java
deleted file mode 100644
index ce0188cf2b1..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/nameservice/PersistentContextMap.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* PersistentContextMap.java -- The persistent context naming map
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.classpath.tools.giop.nameservice;
-
-import java.io.File;
-
-import org.omg.CORBA.ORB;
-import org.omg.CORBA.Object;
-
-/**
- * The persistent context naming map for the persistent naming service.
- *
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class PersistentContextMap extends PersistentMap
-{
- /**
- * Create the persistent context map that stores information in the given
- * file.
- *
- * @param an_orb the naming service ORB, used to obtain and produce the object
- * stringified references.
- * @param mapFile the file, where the persistent information is stored.
- * @param reset if true, the previous naming data are discarded. If false
- * (normally expected), they are loaded from the persistent memory to
- * provide the persistence.
- */
- public PersistentContextMap(ORB an_orb, File mapFile, boolean reset)
- {
- super(an_orb, mapFile, reset);
- }
-
- /**
- * This method expects the PersistentContext as its parameter. The returned
- * description line is the name of the context parent folder.
- */
- protected String object_to_string(Object object)
- {
- PersistentContext pc = (PersistentContext) object;
- return pc.contextFolder.getAbsolutePath();
- }
-
- /**
- * This method restores the PersistenContext. The description line is
- * interpreted as the folder name, absolute path.
- */
- protected Object string_to_object(String description)
- {
- return new PersistentContext(orb, new File(description), reset);
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/nameservice/PersistentMap.java b/libjava/classpath/tools/gnu/classpath/tools/giop/nameservice/PersistentMap.java
deleted file mode 100644
index 6939ede17c2..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/nameservice/PersistentMap.java
+++ /dev/null
@@ -1,454 +0,0 @@
-/* PersistentMap.java -- The persistent object naming map
- Copyright (C) 2006 Free Software Foundation, Inc.
-
- This file is part of GNU Classpath.
-
- GNU Classpath is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- GNU Classpath is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Classpath; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 USA.
-
- Linking this library statically or dynamically with other modules is
- making a combined work based on this library. Thus, the terms and
- conditions of the GNU General Public License cover the whole
- combination.
-
- As a special exception, the copyright holders of this library give you
- permission to link this library with independent modules to produce an
- executable, regardless of the license terms of these independent
- modules, and to copy and distribute the resulting executable under
- terms of your choice, provided that you also meet, for each linked
- independent module, the terms and conditions of the license of that
- module. An independent module is a module which is not derived from
- or based on this library. If you modify this library, you may extend
- this exception to your version of the library, but you are not
- obligated to do so. If you do not wish to do so, delete this
- exception statement from your version. */
-
-
-package gnu.classpath.tools.giop.nameservice;
-
-import gnu.CORBA.NamingService.NamingMap;
-
-import java.io.BufferedOutputStream;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.omg.CORBA.ORB;
-import org.omg.CosNaming.NameComponent;
-import org.omg.CosNaming.NamingContextPackage.AlreadyBound;
-import org.omg.CosNaming.NamingContextPackage.InvalidName;
-
-/**
- * The persistent object naming map for the persistent naming service. The
- * inherited (super.) naming map implementation is transient and is used as a
- * cache. During the normal work, the naming map does not read from the disk,
- * just stores the changes there. Map only reads from the disk when it starts.
- *
- * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
- */
-public class PersistentMap
- extends NamingMap
-{
- /**
- * The data entry.
- */
- public static class Entry
- {
- String id;
-
- String kind;
-
- String ior;
-
- /**
- * Get the name component node.
- */
- public NameComponent getComponent()
- {
- return new NameComponent(id, kind);
- }
-
- /**
- * Write the naming map entry to the output stream.
- */
- public void write(OutputStream out) throws IOException
- {
- // Format: id.kind <eoln> ior <eoln><eoln>
- out.write(getKey(id, kind).getBytes());
- out.write('\n');
- out.write(ior.getBytes());
- out.write('\n');
- out.close();
- }
-
- /**
- * Read the name component from the input stream
- */
- public boolean read(BufferedReader in) throws IOException
- {
- String key = in.readLine();
- String xior = in.readLine();
-
- if (key != null && xior != null)
- {
- if (key.length() < 2)
- {
- // A single char key cannot have the kind part.
- id = key;
- kind = "";
- }
- else
- {
- // Search for the id/kind splitter, dot:
- int iks = - 1;
- for (int i = 1; i < key.length(); i++)
- {
- if (key.charAt(i) == '.')
- // The id is separated from kind by dot, unless preceeded by
- // the
- // escape character, \.
- if (key.charAt(i - 1) != '\\')
- {
- iks = i;
- break;
- }
- }
-
- // May also end by dot, if the kind field is missing.
- if (iks < 0)
- {
- id = key;
- kind = "";
- }
- else if (iks == key.length() - 1)
- {
- id = key.substring(0, key.length() - 1);
- kind = "";
- }
- else
- {
- id = key.substring(0, iks);
- kind = key.substring(iks + 1);
- }
- }
- ior = xior;
- return true;
- }
- else
- return false;
- }
-
- /**
- * Get the key value from the name component.
- *
- * @param id the component id
- * @param kind the component kind
- * @return the key value
- */
- public String getKey(String id, String kind)
- {
- StringBuffer b = new StringBuffer(id.length() + 8);
- appEscaping(b, id);
- b.append('.');
- if (kind != null && kind.length() > 0)
- appEscaping(b, kind);
- return b.toString();
- }
-
- /**
- * Append the contents of the string to this string buffer, inserting the
- * escape sequences, where required.
- *
- * @param b a buffer to append the contents to.
- * @param s a string to append.
- */
- void appEscaping(StringBuffer b, String s)
- {
- char c;
- for (int i = 0; i < s.length(); i++)
- {
- c = s.charAt(i);
- switch (c)
- {
- case '.':
- case '/':
- case '\\':
- b.append('\\');
- b.append(c);
- break;
-
- default:
- b.append(c);
- break;
- }
- }
- }
- }
-
- /**
- * The file, where the persistent naming map stores the information. The
- * format of this file is n*(id LF kind LF ior LFLF).
- */
- public final File file;
-
- /**
- * The naming service ORB, used to obtain and produce the object stringified
- * references.
- */
- ORB orb;
-
- /**
- * If true, all existing data on the file system are discarded.
- */
- boolean reset;
-
- /**
- * Create the persistent map that stores information in the given file.
- *
- * @param an_orb the naming service ORB, used to obtain and produce the object
- * stringified references.
- * @param mapFile the file, where the persistent information is stored.
- * @param a_reset if true, the previous naming data are discarded. If false
- * (normally expected), they are loaded from the persistent memory to
- * provide the persistence.
- */
- public PersistentMap(ORB an_orb, File mapFile, boolean a_reset)
- {
- super();
- orb = an_orb;
- file = mapFile;
- reset = a_reset;
-
- // Initialise the persistent map with existing data.
- if (file.exists() && ! reset)
- {
-
- BufferedReader in;
- try
- {
- FileInputStream fin = new FileInputStream(file);
- in = new BufferedReader(new InputStreamReader(fin));
- Entry e = new Entry();
- boolean ok;
-
- while (e.read(in))
- {
- org.omg.CORBA .Object object = string_to_object(e.ior);
- orb.connect(object);
- map.put(e.getComponent(), object);
- }
- }
- catch (Exception ex)
- {
- InternalError ierr = new InternalError(file.getAbsolutePath());
- ierr.initCause(ex);
- throw ierr;
- }
- }
- }
-
- /**
- * Restore object from its string description.
- *
- * @param description the string, describing the object
- *
- * @return the object.
- */
- protected org.omg.CORBA.Object string_to_object(String description)
- {
- return orb.string_to_object(description);
- }
-
- /**
- * Convert the object to its string description
- *
- * @param object the object to convert
- * @return the string description of the object
- */
- protected String object_to_string(org.omg.CORBA .Object object)
- {
- return orb.object_to_string(object);
- }
-
- /**
- * Put the given GIOP object, specifying the given name as a key. If the entry
- * with the given name already exists, or if the given object is already
- * mapped under another name, the {@link AlreadyBound} exception will be
- * thrown.
- *
- * @param name the name
- * @param object the object
- */
- public void bind(NameComponent name, org.omg.CORBA.Object object)
- throws AlreadyBound, InvalidName
- {
- if (!containsKey(name))
- {
- super.bind(name, object);
- register(name, object);
- }
- else
- throw new AlreadyBound(name.id + "." + name.kind);
- }
-
- /**
- * Put the given CORBA object, specifying the given name as a key. Remove all
- * pre - existing mappings for the given name and object.
- *
- * @param name the name.
- * @param object the object
- */
- public void rebind(NameComponent name, org.omg.CORBA.Object object)
- throws InvalidName
- {
- if (containsKey(name))
- {
- org.omg.CORBA.Object existing = get(name);
- String ior = object_to_string(object);
- String xior = object_to_string(existing);
-
- // Same name and same ior - nothing to do.
- if (ior.equals(xior))
- return;
- else
- remove(name);
- }
-
- Iterator iter = entries().iterator();
- Map.Entry item;
-
- // Remove the existing mapping for the given object, if present.
- while (iter.hasNext())
- {
- item = (Map.Entry) iter.next();
- if (item.getValue().equals(object))
- iter.remove();
- }
-
- map.put(name, object);
- register(name, object);
- }
-
- /**
- * Removes the given name, if present.
- *
- * @param name a name to remove.
- */
- public void remove(NameComponent name)
- {
- super.remove(name);
- unregister(name);
- }
-
- /**
- * Register this name - object pair in the persistent storage.
- *
- * @param name the name.
- * @param object the object
- */
- public void register(NameComponent name, org.omg.CORBA.Object object)
- {
- // If this key is already known, and this is the same object,
- // then return without action.
- String ior = object_to_string(object);
-
- synchronized (file)
- {
- try
- {
- FileOutputStream fou;
-
- if (! file.exists())
- fou = new FileOutputStream(file);
- else
- fou = new FileOutputStream(file, true);
-
- Entry e = new Entry();
- e.id = name.id;
- e.kind = name.kind;
- e.ior = ior;
- e.write(fou);
- fou.close();
- }
- catch (Exception e)
- {
- InternalError ierr = new InternalError(file.getAbsolutePath());
- ierr.initCause(e);
- throw ierr;
- }
- }
- }
-
- /**
- * Remove this name from the persistent storage.
- *
- * @param name the name to remove
- */
- public void unregister(NameComponent name)
- {
- synchronized (file)
- {
- try
- {
- File nf = new File(file.getParent(), file.getName() + "_t");
- FileInputStream fin = new FileInputStream(file);
- FileOutputStream fou = new FileOutputStream(nf);
- BufferedOutputStream ou = new BufferedOutputStream(fou);
-
- BufferedReader in = new BufferedReader(new InputStreamReader(fin));
- String s;
- String nk = name.kind;
- if (nk == null)
- nk = "";
-
- Entry e = new Entry();
-
- while (e.read(in))
- {
- if (e.id.equals(name.id) && e.kind.equals(nk))
- {
- // Do nothing - skip.
- }
- else
- {
- e.write(ou);
- }
- }
-
- File deleteIt = new File(file.getParent(), file.getName() + "_d");
- if (deleteIt.exists())
- deleteIt.delete();
-
- if (! file.renameTo(deleteIt))
- throw new IOException(file.getAbsolutePath() + " rename failed");
-
- if (! nf.renameTo(file))
- throw new IOException(file.getAbsolutePath() + " rename failed");
- }
- catch (Exception e)
- {
- InternalError ierr = new InternalError(file.getAbsolutePath());
- ierr.initCause(e);
- throw ierr;
- }
- }
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java b/libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java
index 55159660d46..294549327a6 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java
@@ -142,15 +142,18 @@ public class Creator
throws IOException
{
boolean isDirectory = file.isDirectory();
- InputStream inputStream = null;
if (isDirectory)
{
if (filename.charAt(filename.length() - 1) != '/')
filename += '/';
+ writeFile(isDirectory, null, filename, verbose);
}
else
- inputStream = new FileInputStream(file);
- writeFile(isDirectory, inputStream, filename, verbose);
+ {
+ InputStream inputStream = new FileInputStream(file);
+ writeFile(isDirectory, inputStream, filename, verbose);
+ inputStream.close();
+ }
}
private void addEntries(ArrayList result, Entry entry)
diff --git a/libjava/classpath/tools/gnu/classpath/tools/jar/Main.java b/libjava/classpath/tools/gnu/classpath/tools/jar/Main.java
index 8ea770bb63f..34f637204e7 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/jar/Main.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/jar/Main.java
@@ -38,7 +38,7 @@
package gnu.classpath.tools.jar;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.FileArgumentCallback;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/jarsigner/Main.java b/libjava/classpath/tools/gnu/classpath/tools/jarsigner/Main.java
index b6b50e7417a..0cff2fd856a 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/jarsigner/Main.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/jarsigner/Main.java
@@ -41,8 +41,8 @@ package gnu.classpath.tools.jarsigner;
import gnu.classpath.Configuration;
import gnu.classpath.SystemProperties;
import gnu.classpath.tools.common.CallbackUtil;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.common.ProviderUtil;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
import gnu.classpath.tools.getopt.FileArgumentCallback;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java b/libjava/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java
new file mode 100644
index 00000000000..e238065c2c0
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java
@@ -0,0 +1,346 @@
+/* ClassWrapper.java - wrap ASM class objects
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import org.objectweb.asm.tree.ClassNode;
+import org.objectweb.asm.tree.FieldNode;
+import org.objectweb.asm.tree.MethodNode;
+
+public class ClassWrapper
+ extends ClassNode
+{
+ Main classpath;
+
+ ClassWrapper superClass;
+
+ ArrayList interfaceClasses;
+
+ // The virtual table for this class.
+ ArrayList vtable;
+
+ // A set of all the bridge method targets we've found.
+ HashSet bridgeTargets;
+
+ // A set of all the method names in this class.
+ HashSet methodNames = new HashSet();
+
+ public ClassWrapper(Main classpath)
+ {
+ this.classpath = classpath;
+ }
+
+ public boolean hasNativeMethod()
+ {
+ Iterator i = methods.iterator();
+ while (i.hasNext())
+ {
+ MethodNode method = (MethodNode) i.next();
+ if (Modifier.isNative(method.access))
+ return true;
+ }
+ return false;
+ }
+
+ public boolean isThrowable() throws IOException
+ {
+ linkSupers();
+ ClassWrapper self = this;
+ while (self != null)
+ {
+ if (self.name.equals("java/lang/Throwable"))
+ return true;
+ self = self.superClass;
+ }
+ return false;
+ }
+
+ private void linkSupers() throws IOException
+ {
+ if (superName == null)
+ {
+ // Object, do nothing.
+ return;
+ }
+ if (superClass == null)
+ {
+ superClass = classpath.getClass(superName);
+ assert interfaceClasses == null;
+ interfaceClasses = new ArrayList();
+ for (int i = 0; i < interfaces.size(); ++i)
+ {
+ String ifname = (String) interfaces.get(i);
+ ClassWrapper iface = classpath.getClass(ifname);
+ iface.linkSupers();
+ interfaceClasses.add(iface);
+ }
+ }
+ superClass.linkSupers();
+ }
+
+ private int findSlot(MethodNode method)
+ {
+ for (int i = vtable.size() - 1; i >= 0; --i)
+ {
+ MethodNode base = (MethodNode) vtable.get(i);
+ if (MethodHelper.overrides(method, base))
+ return i;
+ }
+ return - 1;
+ }
+
+ private void addInterfaceMethods(ClassWrapper iface)
+ {
+ Iterator i = iface.methods.iterator();
+ while (i.hasNext())
+ {
+ MethodNode im = (MethodNode) i.next();
+ int slot = findSlot(im);
+ if (slot == - 1)
+ {
+ vtable.add(im);
+ // Also add it to our local methods.
+ methods.add(im);
+ }
+ }
+ addInterfaces(iface);
+ }
+
+ private void addInterfaces(ClassWrapper base)
+ {
+ if (base.interfaceClasses == null)
+ return;
+ Iterator i = base.interfaceClasses.iterator();
+ while (i.hasNext())
+ {
+ ClassWrapper iface = (ClassWrapper) i.next();
+ addInterfaceMethods(iface);
+ }
+ }
+
+ private void addLocalMethods()
+ {
+ Iterator i = methods.iterator();
+ while (i.hasNext())
+ {
+ MethodNode meth = (MethodNode) i.next();
+ methodNames.add(meth.name);
+ if (Modifier.isStatic(meth.access))
+ continue;
+ int slot = findSlot(meth);
+ if (slot == - 1)
+ vtable.add(meth);
+ else
+ vtable.set(slot, meth);
+ }
+ }
+
+ private void makeVtable() throws IOException
+ {
+ if (vtable != null)
+ return;
+ if (superClass != null)
+ {
+ superClass.makeVtable();
+ vtable = new ArrayList(superClass.vtable);
+ bridgeTargets = new HashSet(superClass.bridgeTargets);
+ }
+ else
+ {
+ // Object.
+ vtable = new ArrayList();
+ bridgeTargets = new HashSet();
+ }
+ addLocalMethods();
+ addInterfaces(this);
+
+ // Make a set of all the targets of bridge methods.
+ // We rename bridge methods to avoid problems with C++.
+ Iterator i = methods.iterator();
+ while (i.hasNext())
+ {
+ MethodNode m = (MethodNode) i.next();
+ String desc = MethodHelper.getBridgeTarget(m);
+ if (desc != null)
+ bridgeTargets.add(m.name + desc);
+ }
+ }
+
+ private void printFields(CniPrintStream out)
+ {
+ Iterator i = fields.iterator();
+ ClassWrapper self = superClass;
+ while (i.hasNext())
+ {
+ FieldNode f = (FieldNode) i.next();
+ boolean hasMethodName = methodNames.contains(f.name);
+ if (FieldHelper.print(out, f, self, hasMethodName))
+ self = null;
+ }
+ }
+
+ private void printMethods(CniPrintStream out) throws IOException
+ {
+ makeVtable();
+
+ // A given method is either static, overrides a super method, or
+ // is already in vtable order.
+ Iterator i = methods.iterator();
+ while (i.hasNext())
+ {
+ MethodNode m = (MethodNode) i.next();
+ boolean isTarget = bridgeTargets.contains(m.name + m.desc);
+ MethodHelper.print(out, m, this, isTarget);
+ }
+ }
+
+ private void printTextList(PrintStream out, int what, ArrayList textList)
+ {
+ if (textList == null)
+ return;
+ Iterator i = textList.iterator();
+ boolean first = true;
+ while (i.hasNext())
+ {
+ Text item = (Text) i.next();
+ if (item.type == what)
+ {
+ if (first)
+ {
+ out.println();
+ first = false;
+ }
+ if (what == Text.FRIEND)
+ out.print(" friend ");
+ out.println(item.text);
+ }
+ }
+ }
+
+ public void print(CniPrintStream out)
+ {
+ out.print("::" + name.replaceAll("/", "::"));
+ }
+
+ // This prints the body of a class to a CxxPrintStream.
+ private void printContents(CniPrintStream out, ArrayList textList)
+ throws IOException
+ {
+ printTextList(out, Text.PREPEND, textList);
+ out.println();
+
+ out.print("class ");
+ // Don't use our print() -- we don't want the leading "::".
+ out.print(name.replaceAll("/", "::"));
+ if (superClass != null)
+ {
+ out.print(" : public ");
+ superClass.print(out);
+ }
+ out.println();
+ out.println("{");
+
+ printTextList(out, Text.ADD, textList);
+ out.println();
+
+ // Note: methods must come first, as we build the list
+ // of method names while printing them.
+ printMethods(out);
+ printFields(out);
+
+ out.setModifiers(Modifier.PUBLIC);
+ out.println(" static ::java::lang::Class class$;");
+
+ printTextList(out, Text.FRIEND, textList);
+
+ out.print("}");
+ if (Modifier.isInterface(access))
+ out.print(" __attribute__ ((java_interface))");
+ out.println(";");
+
+ printTextList(out, Text.APPEND, textList);
+ }
+
+ public void printFully(PrintStream out) throws IOException
+ {
+ linkSupers();
+
+ ArrayList textList = classpath.getClassTextList(name);
+
+ out.println("// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-");
+ out.println();
+ String xname = "__" + name.replaceAll("/", "_") + "__";
+ out.println("#ifndef " + xname);
+ out.println("#define " + xname);
+ out.println();
+ out.println("#pragma interface");
+ out.println();
+
+ if (superClass != null)
+ {
+ out.print("#include <");
+ out.print(superName);
+ out.println(".h>");
+ }
+
+ // Write the body of the stream here. This lets
+ // us emit the namespaces without a second pass.
+ ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ CniPrintStream cxxOut = new CniPrintStream(bytes);
+ cxxOut.addClass(this);
+ printContents(cxxOut, textList);
+ cxxOut.printNamespaces(out);
+ bytes.writeTo(out);
+
+ out.println();
+ out.println("#endif // " + xname);
+ }
+
+ public String toString()
+ {
+ return name;
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/CniIncludePrinter.java b/libjava/classpath/tools/gnu/classpath/tools/javah/CniIncludePrinter.java
new file mode 100644
index 00000000000..fb007b13101
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/CniIncludePrinter.java
@@ -0,0 +1,80 @@
+/* CniIncludePrinter.java - generate CNI header files
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+
+public class CniIncludePrinter
+ extends Printer
+{
+ protected CniIncludePrinter(Main classpath, File outFile, boolean isDir,
+ boolean force)
+ {
+ super(classpath, outFile, isDir, force);
+ }
+
+ protected void writePreambleImpl(PrintStream ps)
+ {
+ // does nothing
+ }
+
+ protected PrintStream getPrintStreamImpl(FileOutputStream fos,
+ ClassWrapper klass)
+ {
+ return new PrintStream(fos);
+ }
+
+ public void printClass(ClassWrapper klass) throws IOException
+ {
+ // Never write Object or Class. This is a hack, maybe
+ // the user would like to see what they look like...
+ if (klass.name.equals("java/lang/Object")
+ || klass.name.equals("java/lang/Class"))
+ return;
+ PrintStream ps = getPrintStream(klass.name + ".h", klass);
+ if (ps == null)
+ return;
+ ps.println();
+ klass.printFully(ps);
+ ps.close();
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/CniPrintStream.java b/libjava/classpath/tools/gnu/classpath/tools/javah/CniPrintStream.java
new file mode 100644
index 00000000000..64ba537d4d3
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/CniPrintStream.java
@@ -0,0 +1,243 @@
+/* CniPrintStream.java - PrintStream that emits CNI declarations
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import java.util.HashSet;
+
+import org.objectweb.asm.Type;
+
+public class CniPrintStream
+ extends PrintStream
+{
+ int currentModifiers = Modifier.PRIVATE;
+
+ // True if we saw an array type.
+ boolean sawArray;
+
+ // All the classes referenced by this header.
+ HashSet allClasses = new HashSet();
+
+ String[] previousPackage = new String[0];
+
+ public CniPrintStream(OutputStream out)
+ {
+ super(out);
+ }
+
+ public void addClass(ClassWrapper cw)
+ {
+ allClasses.add(cw.name);
+ }
+
+ public void setModifiers(int newMods)
+ {
+ newMods &= (Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE);
+ if (newMods != currentModifiers)
+ {
+ switch (newMods)
+ {
+ case Modifier.PUBLIC:
+ println("public:");
+ break;
+ case Modifier.PROTECTED:
+ println("public: // actually protected");
+ break;
+ case Modifier.PRIVATE:
+ println("private:");
+ break;
+ default:
+ println("public: // actually package-private");
+ break;
+ }
+ currentModifiers = newMods;
+ }
+ }
+
+ private String getName(Type type)
+ {
+ if (type == Type.BOOLEAN_TYPE)
+ return "jboolean";
+ else if (type == Type.BYTE_TYPE)
+ return "jbyte";
+ else if (type == Type.CHAR_TYPE)
+ return "jchar";
+ else if (type == Type.SHORT_TYPE)
+ return "jshort";
+ else if (type == Type.INT_TYPE)
+ return "jint";
+ else if (type == Type.LONG_TYPE)
+ return "jlong";
+ else if (type == Type.FLOAT_TYPE)
+ return "jfloat";
+ else if (type == Type.DOUBLE_TYPE)
+ return "jdouble";
+ else
+ {
+ assert type == Type.VOID_TYPE;
+ return "void";
+ }
+ }
+
+ public String getClassName(Type type)
+ {
+ String name = type.toString();
+ name = name.substring(1, name.length() - 1);
+ // Add the plain class name; we'll handle it when
+ // we process namespaces.
+ allClasses.add(name);
+ return "::" + name.replaceAll("/", "::") + " *";
+ }
+
+ public void print(Type type)
+ {
+ int arrayCount = 0;
+ if (type.getSort() == Type.ARRAY)
+ {
+ arrayCount = type.getDimensions();
+ for (int i = 0; i < arrayCount; ++i)
+ print("JArray< ");
+ type = type.getElementType();
+ sawArray = true;
+ }
+ if (type.getSort() == Type.OBJECT)
+ {
+ print(getClassName(type));
+ }
+ else
+ {
+ print(getName(type));
+ }
+ if (arrayCount > 0)
+ {
+ while (arrayCount-- > 0)
+ {
+ print(" > *");
+ }
+ }
+ }
+
+ private void indent(PrintStream out, int n)
+ {
+ for (int i = 0; i < n; ++i)
+ {
+ out.print(" ");
+ }
+ }
+
+ private void moveToPackage(PrintStream out, String[] pkgParts)
+ {
+ // Find greatest common part.
+ int commonIndex;
+ for (commonIndex = 0; commonIndex < previousPackage.length; ++commonIndex)
+ {
+ if (commonIndex >= pkgParts.length)
+ break;
+ if (! previousPackage[commonIndex].equals(pkgParts[commonIndex]))
+ break;
+ }
+ // Close old parts after the common part.
+ for (int j = previousPackage.length - 1; j >= commonIndex; --j)
+ {
+ indent(out, j + 1);
+ out.println("}");
+ }
+ // Open new parts.
+ for (int j = commonIndex; j < pkgParts.length; ++j)
+ {
+ indent(out, j + 1);
+ out.print("namespace ");
+ out.println(pkgParts[j]);
+ indent(out, j + 1);
+ out.println("{");
+ }
+ previousPackage = pkgParts;
+ }
+
+ private void writeClass(PrintStream out, String klass)
+ {
+ int index = klass.lastIndexOf('/');
+ String pkg = index == -1 ? "" : klass.substring(0, index);
+ String[] pkgParts = index == -1 ? new String[0] : pkg.split("/");
+ String className = index == -1 ? klass : klass.substring(index + 1);
+ moveToPackage(out, pkgParts);
+ indent(out, pkgParts.length + 2);
+ out.print("class ");
+ out.print(className);
+ out.println(";");
+ }
+
+ public void printNamespaces(PrintStream out)
+ {
+ if (sawArray)
+ {
+ out.println("#include <gcj/array.h>");
+ out.println();
+ }
+
+ String[] classes = (String[]) allClasses.toArray(new String[0]);
+ Arrays.sort(classes);
+
+ boolean first = true;
+ boolean seen = false;
+ for (int i = 0; i < classes.length; ++i)
+ {
+ String klass = classes[i];
+ if (klass.startsWith("java/lang/") || klass.startsWith("java/io/")
+ || klass.startsWith("java/util/"))
+ continue;
+ if (first)
+ {
+ out.println("extern \"Java\"");
+ out.println("{");
+ first = false;
+ seen = true;
+ }
+ writeClass(out, klass);
+ }
+ if (seen)
+ {
+ moveToPackage(out, new String[0]);
+ out.println("}");
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/CniStubPrinter.java b/libjava/classpath/tools/gnu/classpath/tools/javah/CniStubPrinter.java
new file mode 100644
index 00000000000..d91f367c45c
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/CniStubPrinter.java
@@ -0,0 +1,129 @@
+/* CniStubPrinter.java - Generate a CNI stub file
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.reflect.Modifier;
+import java.util.Iterator;
+
+import org.objectweb.asm.Type;
+import org.objectweb.asm.tree.MethodNode;
+
+public class CniStubPrinter
+ extends Printer
+{
+ protected CniStubPrinter(Main classpath, File outFile, boolean isDir,
+ boolean force)
+ {
+ super(classpath, outFile, isDir, force);
+ }
+
+ private void printDecl(CniPrintStream out, String className, MethodNode method)
+ {
+ out.print(className);
+ out.print("::");
+ out.print(method.name);
+ out.print("(");
+ Type[] argTypes = Type.getArgumentTypes(method.desc);
+ for (int j = 0; j < argTypes.length; ++j)
+ {
+ if (j > 0)
+ out.print(", ");
+ out.print(argTypes[j]);
+ }
+ out.print(")");
+ }
+
+ protected void writePreambleImpl(PrintStream out)
+ {
+ out.println("// This file is intended to give you a head start on implementing native");
+ out.println("// methods using CNI.");
+ out.println("// Be aware: running 'gcjh -stubs' once more for this class may");
+ out.println("// overwrite any edits you have made to this file.");
+ out.println();
+ out.println("#include <gcj/cni.h>");
+ out.println("#include <java/lang/UnsupportedOperationException.h>");
+ }
+
+ protected PrintStream getPrintStreamImpl(FileOutputStream fos,
+ ClassWrapper klass)
+ {
+ return new CniPrintStream(fos);
+ }
+
+ public void printClass(ClassWrapper klass) throws IOException
+ {
+ if (! klass.hasNativeMethod())
+ return;
+ String className = klass.name.replaceAll("/", "::");
+ CniPrintStream out = (CniPrintStream) getPrintStream(klass.name + ".cc",
+ klass);
+ if (out == null)
+ return;
+ out.println();
+ out.println("#include <" + klass.name + ".h>");
+ out.println();
+
+ Iterator i = klass.methods.iterator();
+ boolean first = true;
+ while (i.hasNext())
+ {
+ MethodNode method = (MethodNode) i.next();
+ if (! Modifier.isNative(method.access))
+ continue;
+ if (! first)
+ out.println();
+ first = false;
+ out.print(Type.getReturnType(method.desc));
+ out.println();
+ printDecl(out, className, method);
+ out.println();
+ out.println("{");
+ out.print(" throw new ::java::lang::UnsupportedOperationException(");
+ out.print("JvNewStringLatin1 (\"");
+ printDecl(out, className, method);
+ out.println("\"));");
+ out.println("}");
+ }
+ out.close();
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/FieldHelper.java b/libjava/classpath/tools/gnu/classpath/tools/javah/FieldHelper.java
new file mode 100644
index 00000000000..a9385e04d33
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/FieldHelper.java
@@ -0,0 +1,99 @@
+/* FieldHelper.java - field helper methods for CNI
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+import java.lang.reflect.Modifier;
+
+import org.objectweb.asm.Type;
+import org.objectweb.asm.tree.FieldNode;
+
+public class FieldHelper
+{
+ public static boolean print(CniPrintStream out, FieldNode field,
+ ClassWrapper superType, boolean hasMethodName)
+ {
+ out.setModifiers(field.access);
+ out.print(" ");
+ if (Modifier.isStatic(field.access))
+ out.print("static ");
+ if (Modifier.isVolatile(field.access))
+ out.print("volatile ");
+ if ((field.value instanceof Integer) || (field.value instanceof Long))
+ out.print("const ");
+ out.print(Type.getType(field.desc));
+ out.print(" ");
+ boolean result = false;
+ if (superType != null && ! Modifier.isStatic(field.access))
+ {
+ out.print("__attribute__((aligned(__alignof__( ");
+ superType.print(out);
+ out.print(")))) ");
+ result = true;
+ }
+ out.print(Keywords.getCxxName(field.name));
+ if (hasMethodName)
+ out.print("__");
+ if (Modifier.isStatic(field.access))
+ {
+ if (field.value instanceof Integer)
+ {
+ out.print(" = ");
+ int val = ((Integer) field.value).intValue();
+ if (val == Integer.MIN_VALUE)
+ out.print("-" + Integer.MAX_VALUE + " - 1");
+ else
+ out.print(val);
+ }
+ else if (field.value instanceof Long)
+ {
+ out.print(" = ");
+ long val = ((Long) field.value).longValue();
+ if (val == Long.MIN_VALUE)
+ out.print("-" + Long.MAX_VALUE + "LL - 1");
+ else
+ {
+ out.print(val);
+ out.print("LL");
+ }
+ }
+ }
+ out.println(";");
+ return result;
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/JniHelper.java b/libjava/classpath/tools/gnu/classpath/tools/javah/JniHelper.java
new file mode 100644
index 00000000000..7c508997e18
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/JniHelper.java
@@ -0,0 +1,120 @@
+/* JniHelper.java - name mangling and other JNI support
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+import java.io.IOException;
+
+import org.objectweb.asm.Type;
+
+public class JniHelper
+{
+ public static String getName(Main classpath, Type type) throws IOException
+ {
+ if (type == Type.BOOLEAN_TYPE)
+ return "jboolean";
+ else if (type == Type.BYTE_TYPE)
+ return "jbyte";
+ else if (type == Type.CHAR_TYPE)
+ return "jchar";
+ else if (type == Type.SHORT_TYPE)
+ return "jshort";
+ else if (type == Type.INT_TYPE)
+ return "jint";
+ else if (type == Type.LONG_TYPE)
+ return "jlong";
+ else if (type == Type.FLOAT_TYPE)
+ return "jfloat";
+ else if (type == Type.DOUBLE_TYPE)
+ return "jdouble";
+ else if (type == Type.VOID_TYPE)
+ return "void";
+
+ if (type.getSort() == Type.ARRAY)
+ {
+ Type elt = type.getElementType();
+ int eltSort = elt.getSort();
+ if (type.getDimensions() == 1 && eltSort != Type.OBJECT)
+ return getName(classpath, elt) + "Array";
+ return "jobjectArray";
+ }
+
+ // assert type.getSort() == Type.OBJECT;
+ String className = type.getClassName();
+ // FIXME: is this correct?
+ if (className.equals("java/lang/Class")
+ || className.equals("java.lang.Class"))
+ return "jclass";
+ if (className.equals("java/lang/String")
+ || className.equals("java.lang.String"))
+ return "jstring";
+
+ ClassWrapper klass = classpath.getClass(className);
+ if (klass.isThrowable())
+ return "jthrowable";
+ return "jobject";
+ }
+
+ public static String mangle(String name)
+ {
+ StringBuffer result = new StringBuffer();
+ for (int i = 0; i < name.length(); ++i)
+ {
+ char c = name.charAt(i);
+ if (c == '_')
+ result.append("_1");
+ else if (c == ';')
+ result.append("_2");
+ else if (c == '[')
+ result.append("_3");
+ else if (c == '/')
+ result.append("_");
+ else if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z')
+ || (c >= 'A' && c <= 'Z'))
+ result.append(c);
+ else
+ {
+ result.append("_0");
+ // Sigh.
+ String hex = "0000" + Integer.toHexString(c);
+ result.append(hex.substring(hex.length() - 4));
+ }
+ }
+ return result.toString();
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/JniIncludePrinter.java b/libjava/classpath/tools/gnu/classpath/tools/javah/JniIncludePrinter.java
new file mode 100644
index 00000000000..f29bfc30050
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/JniIncludePrinter.java
@@ -0,0 +1,158 @@
+/* JniIncludePrinter.java - Generate a JNI header file
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.reflect.Modifier;
+import java.util.Iterator;
+
+import org.objectweb.asm.Type;
+import org.objectweb.asm.tree.FieldNode;
+import org.objectweb.asm.tree.MethodNode;
+
+public class JniIncludePrinter
+ extends Printer
+{
+ protected JniIncludePrinter(Main classpath, File outFile, boolean isDir,
+ boolean force)
+ {
+ super(classpath, outFile, isDir, force);
+ }
+
+ private void writeFields(ClassWrapper klass, JniPrintStream out)
+ {
+ boolean wroteAny = false;
+ for (; klass != null; klass = klass.superClass)
+ {
+ Iterator i = klass.fields.iterator();
+ while (i.hasNext())
+ {
+ FieldNode field = (FieldNode) i.next();
+ if (! Modifier.isStatic(field.access)
+ || ! Modifier.isFinal(field.access))
+ continue;
+ if (! (field.value instanceof Integer)
+ && ! (field.value instanceof Long))
+ continue;
+
+ // Note that we don't want to mangle the field name.
+ String name = (JniHelper.mangle(klass.name) + "_" + field.name);
+ out.print("#undef ");
+ out.println(name);
+ out.print("#define ");
+ out.print(name);
+ out.print(" ");
+ out.print(field.value);
+ if (field.value instanceof Integer)
+ out.print("L");
+ else if (field.value instanceof Long)
+ out.print("LL");
+ out.println();
+ wroteAny = true;
+ }
+ }
+ if (wroteAny)
+ out.println();
+ }
+
+ protected void writePreambleImpl(PrintStream out)
+ {
+ out.println("/* DO NOT EDIT THIS FILE - it is machine generated */");
+ out.println();
+ out.println("#include <jni.h>");
+ }
+
+ protected PrintStream getPrintStreamImpl(FileOutputStream fos,
+ ClassWrapper klass)
+ {
+ return new JniPrintStream(classpath, fos, klass);
+ }
+
+ public void printClass(ClassWrapper klass) throws IOException
+ {
+ if (! klass.hasNativeMethod())
+ return;
+ String xname = JniHelper.mangle(klass.name);
+ JniPrintStream out = (JniPrintStream) getPrintStream(klass.name + ".h", klass);
+ if (out == null)
+ return;
+ out.println();
+ out.print("#ifndef __");
+ out.print(xname);
+ out.println("__");
+ out.print("#define __");
+ out.print(xname);
+ out.println("__");
+ out.println();
+ out.println("#ifdef __cplusplus");
+ out.println("extern \"C\"");
+ out.println("{");
+ out.println("#endif");
+ out.println();
+
+ Iterator i = klass.methods.iterator();
+ while (i.hasNext())
+ {
+ MethodNode method = (MethodNode) i.next();
+ if (! Modifier.isNative(method.access))
+ continue;
+ out.print("JNIEXPORT ");
+ out.print(Type.getReturnType(method.desc));
+ out.print(" JNICALL ");
+ out.print(method, xname);
+ out.println(";");
+ }
+
+ out.println();
+
+ writeFields(klass, out);
+
+ out.println("#ifdef __cplusplus");
+ out.println("}");
+ out.println("#endif");
+ out.println();
+ out.print("#endif /* __");
+ out.print(xname);
+ out.println("__ */");
+ out.close();
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/JniPrintStream.java b/libjava/classpath/tools/gnu/classpath/tools/javah/JniPrintStream.java
new file mode 100644
index 00000000000..a0461f475fd
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/JniPrintStream.java
@@ -0,0 +1,115 @@
+/* JniPrintStream.java - PrintStream that emits JNI declarations
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.lang.reflect.Modifier;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.objectweb.asm.Type;
+import org.objectweb.asm.tree.MethodNode;
+
+public class JniPrintStream
+ extends PrintStream
+{
+ Main classpath;
+
+ // This is used to determine whether a method has an overload.
+ HashMap methodNameMap = new HashMap();
+
+ public JniPrintStream(Main classpath, OutputStream out, ClassWrapper klass)
+ {
+ super(out);
+ this.classpath = classpath;
+ computeOverloads(klass);
+ }
+
+ private void computeOverloads(ClassWrapper klass)
+ {
+ Iterator i = klass.methods.iterator();
+ while (i.hasNext())
+ {
+ MethodNode method = (MethodNode) i.next();
+ if (! Modifier.isNative(method.access))
+ continue;
+ if (methodNameMap.containsKey(method.name))
+ {
+ Integer val = (Integer) methodNameMap.get(method.name);
+ methodNameMap.put(method.name, new Integer(val.intValue() + 1));
+ }
+ else
+ methodNameMap.put(method.name, new Integer(1));
+ }
+ }
+
+ public void print(Type type) throws IOException
+ {
+ print(JniHelper.getName(classpath, type));
+ }
+
+ public void print(MethodNode method, String className) throws IOException
+ {
+ print("Java_");
+ print(className);
+ print("_");
+ print(JniHelper.mangle(method.name));
+ Integer overloadCount = (Integer) methodNameMap.get(method.name);
+ if (overloadCount.intValue() > 1)
+ {
+ print("__");
+ int lastOffset = method.desc.lastIndexOf(')');
+ print(JniHelper.mangle(method.desc.substring(1, lastOffset)));
+ }
+ print(" (JNIEnv *env");
+ if (Modifier.isStatic(method.access))
+ print(", jclass");
+ else
+ print(", jobject");
+ Type[] types = Type.getArgumentTypes(method.desc);
+ for (int i = 0; i < types.length; ++i)
+ {
+ print(", ");
+ print(types[i]);
+ }
+ print(")");
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/JniStubPrinter.java b/libjava/classpath/tools/gnu/classpath/tools/javah/JniStubPrinter.java
new file mode 100644
index 00000000000..4e7871008d7
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/JniStubPrinter.java
@@ -0,0 +1,106 @@
+/* JniStubPrinter.java - Generate JNI stub files
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.reflect.Modifier;
+import java.util.Iterator;
+
+import org.objectweb.asm.Type;
+import org.objectweb.asm.tree.MethodNode;
+
+public class JniStubPrinter
+ extends Printer
+{
+ protected JniStubPrinter(Main classpath, File outFile, boolean isDir,
+ boolean force)
+ {
+ super(classpath, outFile, isDir, force);
+ }
+
+ protected void writePreambleImpl(PrintStream out)
+ {
+ out.println("/* This file is intended to give you a head start on implementing native");
+ out.println(" methods using JNI.");
+ out.println(" Be aware: running gcjh or compatible tool with '-stubs' option once more");
+ out.println(" for the same input may overwrite any edits you have made to this file. */");
+ }
+
+ protected PrintStream getPrintStreamImpl(FileOutputStream fos,
+ ClassWrapper klass)
+ {
+ return new JniPrintStream(classpath, fos, klass);
+ }
+
+ public void printClass(ClassWrapper klass) throws IOException
+ {
+ if (! klass.hasNativeMethod())
+ return;
+ String xname = JniHelper.mangle(klass.name);
+ JniPrintStream out = (JniPrintStream) getPrintStream(klass.name + ".c", klass);
+ if (out == null)
+ return;
+ out.println();
+ out.print("#include <");
+ out.print(klass.name);
+ out.println(".h>");
+
+ Iterator i = klass.methods.iterator();
+ while (i.hasNext())
+ {
+ MethodNode method = (MethodNode) i.next();
+ if (! Modifier.isNative(method.access))
+ continue;
+ out.println();
+ out.print(Type.getReturnType(method.desc));
+ out.println();
+ out.print(method, xname);
+ out.println();
+ out.println("{");
+ out.print(" (*env)->FatalError (env, \"");
+ out.print(method, xname);
+ out.println(" not implemented\");");
+ out.println("}");
+ }
+ out.close();
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/Keywords.java b/libjava/classpath/tools/gnu/classpath/tools/javah/Keywords.java
new file mode 100644
index 00000000000..46543ba45df
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/Keywords.java
@@ -0,0 +1,85 @@
+/* Keywords.java - List of C++ keywords
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+import java.util.HashSet;
+
+public class Keywords
+{
+ private static final String[] words = { "and", "and_eq", "asm", "auto",
+ "bitand", "bitor", "bool", "break",
+ "case", "catch", "char", "class",
+ "compl", "const", "const_cast",
+ "continue", "default", "delete", "do",
+ "double", "dynamic_cast", "else",
+ "enum", "explicit", "export",
+ "extern", "false", "float", "for",
+ "friend", "goto", "if", "inline",
+ "int", "long", "mutable", "namespace",
+ "new", "not", "not_eq", "operator",
+ "or", "or_eq", "private", "protected",
+ "public", "register",
+ "reinterpret_cast", "return", "short",
+ "signed", "sizeof", "static",
+ "static_cast", "struct", "switch",
+ "template", "this", "throw", "true",
+ "try", "typedef", "typeid",
+ "typename", "typeof", "union",
+ "unsigned", "using", "virtual",
+ "void", "volatile", "wchar_t",
+ "while", "xor", "xor_eq" };
+
+ private static final HashSet keywords;
+ static
+ {
+ keywords = new HashSet();
+ for (int i = 0; i < words.length; ++i)
+ keywords.add(words[i]);
+ }
+
+ public static String getCxxName(String name)
+ {
+ int i;
+ for (i = name.length() - 1; i >= 0 && name.charAt(i) == '$'; --i)
+ ;
+ if (keywords.contains(name.substring(0, i + 1)))
+ return name + "$";
+ return name;
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/Main.java b/libjava/classpath/tools/gnu/classpath/tools/javah/Main.java
new file mode 100644
index 00000000000..2cddbaae750
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/Main.java
@@ -0,0 +1,441 @@
+/* Main.java - javah main program
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+import gnu.classpath.tools.common.ClasspathToolParser;
+import gnu.classpath.tools.getopt.Option;
+import gnu.classpath.tools.getopt.OptionException;
+import gnu.classpath.tools.getopt.Parser;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import org.objectweb.asm.ClassReader;
+
+public class Main
+{
+ // This is an option group for classpath-related options,
+ // and also is used for loading classes.
+ PathOptionGroup classpath = new PathOptionGroup();
+
+ // The output directory.
+ String outputDir;
+
+ // The output file name used if/when -o option is used.
+ String outFileName;
+
+ // The loader that we use to load class files.
+ URLClassLoader loader;
+
+ // In -all mode, the name of the directory to scan.
+ String allDirectory;
+
+ // True for verbose mode.
+ boolean verbose;
+
+ // True if we're emitting stubs.
+ boolean stubs;
+
+ // True if we're emitting CNI code.
+ boolean cni;
+
+ // True if output files should always be written.
+ boolean force;
+
+ // Map class names to class wrappers.
+ HashMap classMap = new HashMap();
+
+ // Map class names to lists of Text objects.
+ HashMap textMap = new HashMap();
+
+ void readCommandFile(String textFileName) throws OptionException
+ {
+ FileInputStream fis;
+ try
+ {
+ fis = new FileInputStream(textFileName);
+ }
+ catch (FileNotFoundException ignore)
+ {
+ throw new OptionException("file \"" + textFileName + "\" not found");
+ }
+ BufferedReader reader = new BufferedReader(new InputStreamReader(fis));
+ String currentClass = null;
+ ArrayList currentValues = null;
+ while (true)
+ {
+ String line;
+ try
+ {
+ line = reader.readLine();
+ }
+ catch (IOException _)
+ {
+ break;
+ }
+ if (line == null)
+ break;
+ line = line.trim();
+ if (line.length() == 0 || line.charAt(0) == '#')
+ continue;
+ int index = line.indexOf(' ');
+ String cmd = line.substring(0, index);
+ String value = line.substring(index + 1);
+ int cmdValue;
+ if ("class".equals(cmd))
+ {
+ if (currentClass != null)
+ {
+ textMap.put(currentClass, currentValues);
+ }
+ currentClass = value;
+ currentValues = new ArrayList();
+ continue;
+ }
+ if (currentClass == null)
+ throw new OptionException("no class set");
+ if ("add".equals(cmd))
+ cmdValue = Text.ADD;
+ else if ("append".equals(cmd))
+ cmdValue = Text.APPEND;
+ else if ("prepend".equals(cmd))
+ cmdValue = Text.PREPEND;
+ else if ("friend".equals(cmd))
+ cmdValue = Text.FRIEND;
+ else
+ throw new OptionException("unrecognized command: " + cmd);
+ currentValues.add(new Text(cmdValue, value));
+ }
+ if (currentClass != null)
+ {
+ textMap.put(currentClass, currentValues);
+ }
+ }
+
+ void scanDirectory(File dir, final HashSet results)
+ {
+ File[] files = dir.listFiles(new FileFilter()
+ {
+ public boolean accept(File pathname)
+ {
+ if (pathname.isDirectory())
+ {
+ scanDirectory(pathname, results);
+ return false;
+ }
+ return pathname.getName().endsWith(".class");
+ }
+ });
+ if (files != null)
+ results.addAll(Arrays.asList(files));
+ }
+
+ private Parser getParser()
+ {
+ ClasspathToolParser result = new ClasspathToolParser("javah", true);
+ result.setHeader("usage: javah [OPTIONS] CLASS...");
+ result.add(classpath);
+ result.add(new Option('d', "Set output directory", "DIR")
+ {
+ public void parsed(String dir) throws OptionException
+ {
+ if (outputDir != null)
+ throw new OptionException("-d already seen");
+ if (outFileName != null)
+ throw new OptionException("only one of -d or -o may be used");
+ outputDir = dir;
+ }
+ });
+ result.add(new Option('o',
+ "Set output file (only one of -d or -o may be used)",
+ "FILE")
+ {
+ public void parsed(String fileName) throws OptionException
+ {
+ if (outFileName != null)
+ throw new OptionException("-o already seen");
+ if (outputDir != null)
+ throw new OptionException("only one of -d or -o may be used");
+ outFileName = fileName;
+ }
+ });
+ result.add(new Option("cmdfile", "Read command file", "FILE")
+ {
+ public void parsed(String file) throws OptionException
+ {
+ readCommandFile(file);
+ }
+ });
+ result.add(new Option("all", "Operate on all class files under directory",
+ "DIR")
+ {
+ public void parsed(String arg) throws OptionException
+ {
+ // FIXME: lame restriction...
+ if (allDirectory != null)
+ throw new OptionException("-all already specified");
+ allDirectory = arg;
+ }
+ });
+ result.add(new Option("stubs", "Emit stub implementation")
+ {
+ public void parsed(String arg0) throws OptionException
+ {
+ stubs = true;
+ }
+ });
+ result.add(new Option("jni", "Emit JNI stubs or header (default)")
+ {
+ public void parsed(String arg0) throws OptionException
+ {
+ if (cni)
+ throw new OptionException("only one of -jni or -cni may be used");
+ cni = false;
+ }
+ });
+ result.add(new Option("cni", "Emit CNI stubs or header (default JNI)")
+ {
+ public void parsed(String arg0) throws OptionException
+ {
+ cni = true;
+ }
+ });
+ result.add(new Option("verbose", "Set verbose mode")
+ {
+ public void parsed(String arg0) throws OptionException
+ {
+ verbose = true;
+ }
+ });
+ result.add(new Option("force", "Output files should always be written")
+ {
+ public void parsed(String arg0) throws OptionException
+ {
+ force = true;
+ }
+ });
+ return result;
+ }
+
+ private File makeOutputDirectory() throws IOException
+ {
+ File outputFile;
+ if (outputDir == null)
+ outputFile = new File(".");
+ else
+ outputFile = new File(outputDir);
+ return outputFile;
+ }
+
+ /**
+ * @return The {@link File} object where the generated code will be written.
+ * Returns <code>null</code> if the option <code>-force</code> was
+ * specified on the command line and the designated file already
+ * exists.
+ * @throws IOException if <code>outFileName</code> is not a writable file.
+ */
+ private File makeOutputFile() throws IOException
+ {
+ File result = new File(outFileName);
+ if (result.exists())
+ {
+ if (! result.isFile())
+ throw new IOException("'" + outFileName + "' is not a file");
+ if (! force)
+ {
+ if (verbose)
+ System.err.println("["+ outFileName
+ + " already exists. Use -force to overwrite]");
+ return null;
+ }
+ if (! result.delete())
+ throw new IOException("Was unable to delete existing file: "
+ + outFileName);
+ }
+ return result;
+ }
+
+ private void writeHeaders(ArrayList klasses, Printer printer)
+ throws IOException
+ {
+ Iterator i = klasses.iterator();
+ while (i.hasNext())
+ {
+ ClassWrapper klass = (ClassWrapper) i.next();
+ if (verbose)
+ System.err.println("[writing " + klass + "]");
+ printer.printClass(klass);
+ }
+ }
+
+ private void run(String[] args) throws IOException
+ {
+ Parser p = getParser();
+ String[] classNames = p.parse(args);
+ loader = classpath.getLoader();
+
+ boolean isDirectory = outFileName == null;
+ File outputFile = isDirectory ? makeOutputDirectory() : makeOutputFile();
+ if (outputFile == null)
+ return;
+
+ Printer printer;
+ if (! cni)
+ {
+ if (stubs)
+ printer = new JniStubPrinter(this, outputFile, isDirectory, force);
+ else
+ printer = new JniIncludePrinter(this, outputFile, isDirectory, force);
+ }
+ else
+ {
+ if (stubs)
+ printer = new CniStubPrinter(this, outputFile, isDirectory, force);
+ else
+ printer = new CniIncludePrinter(this, outputFile, isDirectory, force);
+ }
+
+ // First we load all of the files. That way if
+ // there are references between the files we will
+ // be loading the set that the user asked for.
+ HashSet klasses = new HashSet();
+ if (allDirectory != null)
+ scanDirectory(new File(allDirectory), klasses);
+ // Add the command-line arguments. We use the type of
+ // an item in 'klasses' to decide how to load each class.
+ for (int i = 0; i < classNames.length; ++i)
+ {
+ if (classNames[i].endsWith(".class"))
+ {
+ klasses.add(new File(classNames[i]));
+ }
+ else
+ {
+ klasses.add(classNames[i]);
+ }
+ }
+
+ Iterator i = klasses.iterator();
+ ArrayList results = new ArrayList();
+ while (i.hasNext())
+ {
+ // Let user specify either kind of class name or a
+ // file name.
+ Object item = i.next();
+ ClassWrapper klass;
+ if (item instanceof File)
+ {
+ // Load class from file.
+ if (verbose)
+ System.err.println("[reading file " + item + "]");
+ klass = getClass((File) item);
+ }
+ else
+ {
+ // Load class given the class name.
+ String className = ((String) item).replace('.', '/');
+ if (verbose)
+ System.err.println("[reading class " + className + "]");
+ klass = getClass(className);
+ }
+ results.add(klass);
+ }
+
+ writeHeaders(results, printer);
+ }
+
+ public ArrayList getClassTextList(String name)
+ {
+ return (ArrayList) textMap.get(name);
+ }
+
+ private ClassWrapper readClass(InputStream is) throws IOException
+ {
+ ClassReader r = new ClassReader(is);
+ ClassWrapper result = new ClassWrapper(this);
+ r.accept(result, true);
+ is.close();
+ return result;
+ }
+
+ private ClassWrapper getClass(File fileName) throws IOException
+ {
+ InputStream is = new FileInputStream(fileName);
+ ClassWrapper result = readClass(is);
+ if (classMap.containsKey(result.name))
+ throw new IllegalArgumentException("class " + result.name
+ + " already loaded");
+ classMap.put(result.name, result);
+ return result;
+ }
+
+ public ClassWrapper getClass(String name) throws IOException
+ {
+ if (! classMap.containsKey(name))
+ {
+ String resource = name.replace('.', '/') + ".class";
+ URL url = loader.findResource(resource);
+ if (url == null)
+ throw new IOException("can't find class file " + resource);
+ InputStream is = url.openStream();
+ ClassWrapper result = readClass(is);
+ classMap.put(name, result);
+ }
+ return (ClassWrapper) classMap.get(name);
+ }
+
+ public static void main(String[] args) throws IOException
+ {
+ Main m = new Main();
+ m.run(args);
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/MethodHelper.java b/libjava/classpath/tools/gnu/classpath/tools/javah/MethodHelper.java
new file mode 100644
index 00000000000..6657f115ac4
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/MethodHelper.java
@@ -0,0 +1,130 @@
+/* MethodHelper.java - helper class for manipulating methods
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+import java.lang.reflect.Modifier;
+import java.util.Iterator;
+
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.tree.AbstractInsnNode;
+import org.objectweb.asm.tree.MethodInsnNode;
+import org.objectweb.asm.tree.MethodNode;
+
+public class MethodHelper
+{
+
+ public static boolean overrides(MethodNode derived, MethodNode base)
+ {
+ if (! derived.name.equals(base.name))
+ return false;
+ if (! derived.desc.equals(base.desc))
+ return false;
+ // FIXME: permission madness?
+ return true;
+ }
+
+ public static String getBridgeTarget(MethodNode meth)
+ {
+ if ((meth.access & Opcodes.ACC_BRIDGE) == 0)
+ return null;
+ Iterator i = meth.instructions.iterator();
+ while (i.hasNext())
+ {
+ AbstractInsnNode insn = (AbstractInsnNode) i.next();
+ if (! (insn instanceof MethodInsnNode))
+ continue;
+ return ((MethodInsnNode) insn).desc;
+ }
+ return null;
+ }
+
+ public static void print(CniPrintStream out, MethodNode meth,
+ ClassWrapper declarer, boolean isBridgeTarget)
+ {
+ if ("<clinit>".equals(meth.name))
+ return;
+ boolean isInit = "<init>".equals(meth.name);
+ out.setModifiers(meth.access);
+ out.print(" ");
+ if (Modifier.isStatic(meth.access))
+ out.print("static ");
+ // If a class is final then we might as well skip 'virtual'.
+ // The reason here is that it is safe in this case for C++
+ // ABI code to generate a direct call. The method does end
+ // up in the vtable (for BC code) but we don't care. Also,
+ // the class can't be derived from anyway.
+ else if (! isInit && ! Modifier.isPrivate(meth.access)
+ && ! Modifier.isFinal(declarer.access))
+ out.print("virtual ");
+ if (! isInit)
+ {
+ out.print(Type.getReturnType(meth.desc));
+ out.print(" ");
+ if (isBridgeTarget)
+ {
+ out.print("target$");
+ out.print(meth.name);
+ }
+ else
+ {
+ out.print(Keywords.getCxxName(meth.name));
+ }
+ }
+ else
+ {
+ String name = declarer.name;
+ int index = name.lastIndexOf('/');
+ name = name.substring(index + 1);
+ out.print(name);
+ }
+ out.print("(");
+ Type[] argTypes = Type.getArgumentTypes(meth.desc);
+ for (int i = 0; i < argTypes.length; ++i)
+ {
+ if (i > 0)
+ out.print(", ");
+ out.print(argTypes[i]);
+ }
+ out.print(")");
+ if (Modifier.isAbstract(meth.access))
+ out.print(" = 0");
+ out.println(";");
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/PackageWrapper.java b/libjava/classpath/tools/gnu/classpath/tools/javah/PackageWrapper.java
new file mode 100644
index 00000000000..11b38b20f96
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/PackageWrapper.java
@@ -0,0 +1,54 @@
+/* PackageWrapper.java - represent a package
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+public class PackageWrapper
+{
+ // This is null if there is no parent package.
+ PackageWrapper parent;
+
+ // Name of this package relative to its parent's name.
+ String name;
+
+ public PackageWrapper(PackageWrapper parent, String name)
+ {
+ this.parent = parent;
+ this.name = name;
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/PathOptionGroup.java b/libjava/classpath/tools/gnu/classpath/tools/javah/PathOptionGroup.java
new file mode 100644
index 00000000000..4287354aed6
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/PathOptionGroup.java
@@ -0,0 +1,135 @@
+/* PathOptionGroup.java - handle classpath-setting options
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+import gnu.classpath.tools.getopt.Option;
+import gnu.classpath.tools.getopt.OptionException;
+import gnu.classpath.tools.getopt.OptionGroup;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.StringTokenizer;
+
+public class PathOptionGroup
+ extends OptionGroup
+{
+ ArrayList classpath = new ArrayList();
+
+ ArrayList bootclasspath = new ArrayList();
+
+ void setPath(ArrayList list, String path)
+ {
+ list.clear();
+ StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
+ while (st.hasMoreTokens())
+ {
+ list.add(st.nextToken());
+ }
+ }
+
+ void addExtDirs(ArrayList list, String path)
+ {
+ StringTokenizer tok = new StringTokenizer(path, File.pathSeparator);
+ while (tok.hasMoreTokens())
+ {
+ File dir = new File(tok.nextToken());
+ list.addAll(Arrays.asList(dir.list(new FilenameFilter()
+ {
+ public boolean accept(File dir, String name)
+ {
+ return name.endsWith(".zip") || name.endsWith(".jar");
+ }
+ })));
+ }
+ }
+
+ public PathOptionGroup()
+ {
+ super("Class path options");
+
+ add(new Option("classpath", "Set the class path", "PATH")
+ {
+ public void parsed(String path) throws OptionException
+ {
+ setPath(classpath, path);
+ }
+ });
+ add(new Option('I', "Add directory to class path", "DIR", true)
+ {
+ public void parsed(String path) throws OptionException
+ {
+ classpath.add(path);
+ }
+ });
+ add(new Option("bootclasspath", "Set the boot class path", "PATH")
+ {
+ public void parsed(String path) throws OptionException
+ {
+ setPath(bootclasspath, path);
+ }
+ });
+ add(new Option("extdirs", "Set the extension directory path", "PATH")
+ {
+ public void parsed(String path) throws OptionException
+ {
+ addExtDirs(classpath, path);
+ }
+ });
+ }
+
+ public URLClassLoader getLoader() throws MalformedURLException
+ {
+ ArrayList urls = new ArrayList();
+ classpath.addAll(bootclasspath);
+ Iterator i = classpath.iterator();
+ while (i.hasNext())
+ {
+ String f = (String) i.next();
+ urls.add(new File(f).toURL());
+ }
+ URL[] urlArray = (URL[]) urls.toArray(new URL[0]);
+ return new URLClassLoader(urlArray);
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/Printer.java b/libjava/classpath/tools/gnu/classpath/tools/javah/Printer.java
new file mode 100644
index 00000000000..9c4b48d2e5c
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/Printer.java
@@ -0,0 +1,138 @@
+/* Print.java - abstract base class for printing classes
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+
+public abstract class Printer
+{
+ protected Main classpath;
+
+ /**
+ * The {@link File} object that denotes either a directory (when the
+ * <code>-d</code> option was used), or a file (when the <code>-o</code>
+ * option was used) on the command line.
+ */
+ protected File outputFileObject;
+
+ /**
+ * Set to <code>true</code> if the field <code>outputFileObject</code> denotes
+ * a directory; i.e. for each input class file, one JNI header file will be
+ * generated in that directory.
+ * <p>
+ * Set to <code>false</code> if the field <code>outputFileObject</code>
+ * denotes a file; i.e. all generated headers will be written to that file.
+ */
+ protected boolean isDirectory;
+
+ /**
+ * Set to <code>true</code> if the output file(s) should always be written.
+ * <p>
+ * When set to <code>false</code>, the contents of the header/stub are only
+ * written to the file if it does not already exist.
+ */
+ protected boolean force;
+
+ /**
+ * Set to <code>true</code> if all output is directed to one file, and the
+ * common preamble text has already been generated.
+ */
+ protected boolean wrotePreamble;
+
+ protected Printer(Main classpath, File outFile, boolean isDir, boolean force)
+ {
+ this.classpath = classpath;
+ if (outFile == null)
+ throw new IllegalArgumentException("File argument MUST NOT be null");
+ outputFileObject = outFile;
+ isDirectory = isDir;
+ if (! isDirectory)
+ {
+ File parent = outputFileObject.getParentFile();
+ if (parent != null)
+ parent.mkdirs();
+ }
+ this.force = force;
+ }
+
+ public abstract void printClass(ClassWrapper klass) throws IOException;
+
+ protected abstract void writePreambleImpl(PrintStream ps);
+
+ protected abstract PrintStream getPrintStreamImpl(FileOutputStream fos,
+ ClassWrapper klass);
+
+ protected PrintStream getPrintStream(String fullName, ClassWrapper klass)
+ throws FileNotFoundException
+ {
+ PrintStream result;
+ FileOutputStream fos;
+ if (isDirectory)
+ {
+ File outFile = new File(outputFileObject, fullName);
+ if (outFile.exists() && ! force)
+ return null;
+ File parent = outFile.getParentFile();
+ if (parent != null)
+ parent.mkdirs();
+ fos = new FileOutputStream(outFile);
+ result = getPrintStreamImpl(fos, klass);
+ writePreamble(result);
+ }
+ else
+ {
+ // the first time we open this file, wrotePreamble is false
+ fos = new FileOutputStream(outputFileObject, wrotePreamble);
+ result = getPrintStreamImpl(fos, klass);
+ if (! wrotePreamble)
+ writePreamble(result);
+ }
+ return result;
+ }
+
+ protected void writePreamble(PrintStream out)
+ {
+ writePreambleImpl(out);
+ wrotePreamble = true;
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/Text.java b/libjava/classpath/tools/gnu/classpath/tools/javah/Text.java
new file mode 100644
index 00000000000..37a1ad66906
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/javah/Text.java
@@ -0,0 +1,60 @@
+/* Text.java - convenience class for CNI header text insertions
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.javah;
+
+public class Text
+{
+ public static final int ADD = 0;
+
+ public static final int APPEND = 1;
+
+ public static final int FRIEND = 2;
+
+ public static final int PREPEND = 3;
+
+ public int type;
+
+ public String text;
+
+ public Text(int type, String text)
+ {
+ this.type = type;
+ this.text = text;
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/CACertCmd.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/CACertCmd.java
index 2bf832beee0..a53a8b21ae3 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/CACertCmd.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/CACertCmd.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package gnu.classpath.tools.keytool;
import gnu.classpath.Configuration;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/CertReqCmd.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/CertReqCmd.java
index 692b1f69015..bdf3aac8f9e 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/CertReqCmd.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/CertReqCmd.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package gnu.classpath.tools.keytool;
import gnu.classpath.Configuration;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/Command.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/Command.java
index bc5cff2aaba..af91e4a7151 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/Command.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/Command.java
@@ -56,7 +56,6 @@ import gnu.java.security.hash.MD5;
import gnu.java.security.hash.Sha160;
import gnu.java.security.util.Util;
import gnu.java.security.x509.X500DistinguishedName;
-import gnu.javax.security.auth.callback.ConsoleCallbackHandler;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -1203,7 +1202,8 @@ abstract class Command
* <p>
* If no installed providers were found, this method falls back on the GNU
* provider, by-passing the Security search mechanism. The default console
- * callback handler implementation is {@link ConsoleCallbackHandler}.
+ * callback handler implementation is
+ * {@link gnu.javax.security.auth.callback.ConsoleCallbackHandler}.
*
* @return a console-based {@link CallbackHandler}.
*/
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/DeleteCmd.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/DeleteCmd.java
index 8107055d02b..53611b21cda 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/DeleteCmd.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/DeleteCmd.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package gnu.classpath.tools.keytool;
import gnu.classpath.Configuration;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/ExportCmd.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/ExportCmd.java
index 75f71801c9a..a07edc6316f 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/ExportCmd.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/ExportCmd.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package gnu.classpath.tools.keytool;
import gnu.classpath.Configuration;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/GenKeyCmd.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/GenKeyCmd.java
index 03a1555a8c6..79d3824af81 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/GenKeyCmd.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/GenKeyCmd.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package gnu.classpath.tools.keytool;
import gnu.classpath.Configuration;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
@@ -217,7 +217,6 @@ class GenKeyCmd extends Command
protected String _providerClassName;
private int keySize;
private X500DistinguishedName distinguishedName;
- private Parser cmdOptionsParser;
// default 0-arguments constructor
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/IdentityDBCmd.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/IdentityDBCmd.java
index d0de589d933..ac0ee1329e9 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/IdentityDBCmd.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/IdentityDBCmd.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package gnu.classpath.tools.keytool;
import gnu.classpath.Configuration;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/ImportCmd.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/ImportCmd.java
index 3a6ed872bfb..18a21aa683d 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/ImportCmd.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/ImportCmd.java
@@ -40,7 +40,7 @@ package gnu.classpath.tools.keytool;
import gnu.classpath.Configuration;
import gnu.classpath.SystemProperties;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
@@ -207,7 +207,6 @@ class ImportCmd extends Command
protected String _ksPassword;
protected String _providerClassName;
private CertificateFactory x509Factory;
- private boolean imported;
/**
* Pathname to a GKR-type cacerts file to use when trustCACerts is true. This
* is usually a file named "cacerts.gkr" located in lib/security in the folder
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/KeyCloneCmd.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/KeyCloneCmd.java
index 81549864b9e..973ed46ce51 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/KeyCloneCmd.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/KeyCloneCmd.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package gnu.classpath.tools.keytool;
import gnu.classpath.Configuration;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/KeyPasswdCmd.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/KeyPasswdCmd.java
index 89e6daa0249..5f91becd973 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/KeyPasswdCmd.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/KeyPasswdCmd.java
@@ -40,7 +40,7 @@ package gnu.classpath.tools.keytool;
import gnu.classpath.Configuration;
import gnu.classpath.SystemProperties;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/ListCmd.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/ListCmd.java
index 61cec01a4dc..7579c3f85c0 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/ListCmd.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/ListCmd.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package gnu.classpath.tools.keytool;
import gnu.classpath.Configuration;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/Main.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/Main.java
index 08d55556efd..2d5234ad0dd 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/Main.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/Main.java
@@ -39,8 +39,8 @@ exception statement from your version. */
package gnu.classpath.tools.keytool;
import gnu.classpath.Configuration;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.common.ProviderUtil;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
@@ -296,14 +296,6 @@ public class Main
log.exiting(this.getClass().getName(), "teardown"); //$NON-NLS-1$
}
- private void printHelp()
- {
- if (helpPrinted)
- return;
-
- helpPrinted = true;
- }
-
// Inner class(es)
// ==========================================================================
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/PrintCertCmd.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/PrintCertCmd.java
index 2c5461b3619..2100a60261b 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/PrintCertCmd.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/PrintCertCmd.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package gnu.classpath.tools.keytool;
import gnu.classpath.Configuration;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/SelfCertCmd.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/SelfCertCmd.java
index 75f1e8299ed..f297046c79a 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/SelfCertCmd.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/SelfCertCmd.java
@@ -39,7 +39,7 @@ exception statement from your version. */
package gnu.classpath.tools.keytool;
import gnu.classpath.Configuration;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/keytool/StorePasswdCmd.java b/libjava/classpath/tools/gnu/classpath/tools/keytool/StorePasswdCmd.java
index 1313ec6abe7..489ecccb070 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/keytool/StorePasswdCmd.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/keytool/StorePasswdCmd.java
@@ -40,7 +40,7 @@ package gnu.classpath.tools.keytool;
import gnu.classpath.Configuration;
import gnu.classpath.SystemProperties;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
import gnu.classpath.tools.getopt.OptionGroup;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java b/libjava/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java
index 9508c103e08..622de6056ce 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java
@@ -38,7 +38,7 @@
package gnu.classpath.tools.native2ascii;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.FileArgumentCallback;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/orbd/Main.java b/libjava/classpath/tools/gnu/classpath/tools/orbd/Main.java
new file mode 100644
index 00000000000..91c50d7f8c7
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/orbd/Main.java
@@ -0,0 +1,228 @@
+/* NamingServicePersistent.java -- The persistent naming service.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.orbd;
+
+import gnu.CORBA.OrbFunctional;
+import gnu.CORBA.IOR;
+import gnu.CORBA.NamingService.Ext;
+import gnu.classpath.tools.common.ClasspathToolParser;
+import gnu.classpath.tools.getopt.FileArgumentCallback;
+import gnu.classpath.tools.getopt.Option;
+import gnu.classpath.tools.getopt.OptionException;
+import gnu.classpath.tools.getopt.OptionGroup;
+import gnu.classpath.tools.getopt.Parser;
+
+import org.omg.CosNaming.NamingContextExt;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileNotFoundException;
+import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
+
+/**
+ * The server for the GNU Classpath persistent naming service.
+ *
+ * GNU Classpath currently works with this naming service and is also
+ * interoperable with the Sun Microsystems naming services from releases 1.3 and
+ * 1.4, both transient <i>tnameserv</i> and persistent <i>orbd</i>.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public class Main
+{
+ /**
+ * The default port (900), on that the naming service starts if no
+ * -ORBInitialPort is specified in the command line.
+ */
+ public static final int PORT = 900;
+
+ private int port = PORT;
+ private String iorf;
+ private boolean cold;
+ private String directory = "";
+
+ /**
+ * Get the object key for the naming service. The default key is the string
+ * "NameService" in ASCII.
+ *
+ * @return the byte array.
+ */
+ public static byte[] getDefaultKey()
+ {
+ try
+ { // NameService
+ return "NameService".getBytes("UTF-8");
+ }
+ catch (UnsupportedEncodingException ex)
+ {
+ throw new InternalError("UTF-8 unsupported");
+ }
+ }
+
+ private Parser initializeParser()
+ {
+ Parser parser = new ClasspathToolParser("orbd", true); //$NON-NLS-1$
+ parser.setHeader(Messages.getString("Main.Usage")); //$NON-NLS-1$
+
+ parser.add(new Option("ORBInitialPort", //$NON-NLS-1$
+ Messages.getString("Main.ORBInitialPort"), //$NON-NLS-1$
+ Messages.getString("Main.Port")) //$NON-NLS-1$
+ {
+ public void parsed(String portArgument) throws OptionException
+ {
+ port = Integer.parseInt(portArgument);
+ }
+ });
+
+ parser.add(new Option("ior", //$NON-NLS-1$
+ Messages.getString("Main.IOR"), //$NON-NLS-1$
+ Messages.getString("Main.IORFile")) //$NON-NLS-1$
+ {
+ public void parsed(String fileArgument) throws OptionException
+ {
+ iorf = fileArgument;
+ }
+ });
+ parser.add(new Option("directory", //$NON-NLS-1$
+ Messages.getString("Main.Directory"), //$NON-NLS-1$
+ Messages.getString("Main.DirectoryArgument")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ directory = argument;
+ }
+ });
+ parser.add(new Option("restart", //$NON-NLS-1$
+ Messages.getString("Main.Restart")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ cold = true;
+ }
+ });
+
+ return parser;
+ }
+
+ private void run(String[] args)
+ {
+ Parser parser = initializeParser();
+ parser.parse(args);
+
+ try
+ {
+ // Create and initialize the ORB
+ final OrbFunctional orb = new OrbFunctional();
+ OrbFunctional.setPort(port);
+
+ // Create the servant and register it with the ORB
+ File dataDirectory = new File(directory);
+ System.out.println("Persistent data stored at "
+ + dataDirectory.getAbsolutePath());
+ dataDirectory.mkdirs();
+
+ // / TODO support more starting modes.
+ NamingContextExt namer = new Ext(
+ new PersistentContext(
+ orb,
+ dataDirectory,
+ cold));
+
+ // Case with the key "NameService".
+ orb.connect(namer, "NameService".getBytes());
+
+ // Storing the IOR reference.
+ String ior = orb.object_to_string(namer);
+ IOR iorr = IOR.parse(ior);
+ if (iorf != null)
+ {
+ FileOutputStream f = new FileOutputStream(iorf);
+ PrintStream p = new PrintStream(f);
+ p.print(ior);
+ p.close();
+ }
+
+ System.out.println("GNU Classpath persistent naming service "
+ + "started at " + iorr.Internet.host + ":"
+ + iorr.Internet.port + " key 'NameService'.\n\n"
+ + "Copyright (C) 2006 Free Software Foundation\n"
+ + "This tool comes with ABSOLUTELY NO WARRANTY. "
+ + "This is free software, and you are\nwelcome to "
+ + "redistribute it under conditions, defined in "
+ + "GNU Classpath license.\n\n" + ior);
+
+ new Thread()
+ {
+ public void run()
+ {
+ // Wait for invocations from clients.
+ orb.run();
+ }
+ }.start();
+ }
+ catch (FileNotFoundException e)
+ {
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ // Restore the default value for allocating ports for the subsequent
+ // objects.
+ OrbFunctional.setPort(OrbFunctional.DEFAULT_INITIAL_PORT);
+ }
+ }
+
+ /**
+ * The persistent naming service entry point.
+ */
+ public static void main(String[] args)
+ {
+ Main orbdprogram = new Main();
+ try
+ {
+ orbdprogram.run(args);
+ }
+ catch (Exception e)
+ {
+ System.err.println(Messages.getString("Main.InternalError")); //$NON-NLS-1$
+ e.printStackTrace(System.err);
+ System.exit(1);
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/orbd/Messages.java b/libjava/classpath/tools/gnu/classpath/tools/orbd/Messages.java
new file mode 100644
index 00000000000..c9bb371ad3b
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/orbd/Messages.java
@@ -0,0 +1,67 @@
+/* Messages.java -- localization support for orbd
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.orbd;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages
+{
+ private static final String BUNDLE_NAME
+ = "gnu.classpath.tools.orbd.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE
+ = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages()
+ {
+ }
+
+ public static String getString(String key)
+ {
+ try
+ {
+ return RESOURCE_BUNDLE.getString(key);
+ }
+ catch (MissingResourceException e)
+ {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentContext.java b/libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentContext.java
new file mode 100644
index 00000000000..9b4f27a3d7d
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentContext.java
@@ -0,0 +1,152 @@
+/* PersistentContext.java -- The persistent naming context.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.orbd;
+
+import gnu.CORBA.NamingService.NameTransformer;
+import gnu.CORBA.NamingService.TransientContext;
+
+import java.io.File;
+
+import org.omg.CORBA.ORB;
+import org.omg.CosNaming.NameComponent;
+import org.omg.CosNaming.NamingContext;
+import org.omg.CosNaming.NamingContextPackage.AlreadyBound;
+import org.omg.CosNaming.NamingContextPackage.CannotProceed;
+import org.omg.CosNaming.NamingContextPackage.InvalidName;
+import org.omg.CosNaming.NamingContextPackage.NotFound;
+
+/**
+ * This class implements the persistent naming service, defined by
+ * {@link NamingContext}. The 'persistent' means that the service remembers the
+ * mappings, stored between restarts.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public class PersistentContext
+ extends TransientContext
+{
+ /**
+ * Use serial version UID for interoperability.
+ */
+ private static final long serialVersionUID = 2;
+
+ /**
+ * The folder, where the persistent context information is stored.
+ */
+ File contextFolder;
+
+ /**
+ * The uinque context identifier.
+ */
+ static long num = System.currentTimeMillis();
+
+ /**
+ * The naming service orb.
+ */
+ ORB orb;
+
+ /**
+ * Create the persistent naming context that will store the files in the given
+ * folder of the local file system. This method also connects object to the
+ * passed ORB.
+ *
+ * @param an_orb the naming service ORB, used to obtain and produce the object
+ * stringified references.
+ * @param folder the folder, where the persistent information is stored.
+ * @param reset if true, the previous naming data are discarded. If false
+ * (normally expected), they are loaded from the persistent memory to
+ * provide the persistence.
+ */
+ public PersistentContext(ORB an_orb, File folder, boolean reset)
+ {
+ super(
+ new PersistentContextMap(an_orb, new File(folder, "contexts.txt"), reset),
+ new PersistentMap(an_orb, new File(folder, "objects.txt"), reset));
+ contextFolder = folder;
+ folder.mkdirs();
+ orb = an_orb;
+ orb.connect(this);
+ }
+
+ /**
+ * Get the unique context number;
+ *
+ * @return the context number
+ */
+ static synchronized String getNum()
+ {
+ return Long.toHexString(num++);
+ }
+
+ /**
+ * Create new persistent context.
+ */
+ public NamingContext new_context()
+ {
+ File ctxFolder = new File(contextFolder, "ctx_"+getNum());
+ return new PersistentContext(orb, ctxFolder, true);
+ }
+
+ /**
+ * Create a new context and give it a given name (bound it) in the current
+ * context. The method benefits from passing the better readable context name.
+ *
+ * @param a_name the name being given to the new context.
+ * @return the newly created context.
+ * @throws AlreadyBound if the name is already in use.
+ * @throws InvalidName if the name has zero length or otherwise invalid.
+ */
+ public NamingContext bind_new_context(NameComponent[] a_name)
+ throws NotFound, AlreadyBound, CannotProceed, InvalidName
+ {
+ if (named_contexts.containsKey(a_name[0])
+ || named_objects.containsKey(a_name[0]))
+ throw new AlreadyBound();
+
+ NameTransformer transformer = new NameTransformer();
+
+ File ctxFolder = new File(contextFolder,
+ transformer.toString(a_name).replace('/', '.')
+ + ".v" + getNum());
+
+ NamingContext child = new PersistentContext(orb, ctxFolder, true);
+ bind_context(a_name, child);
+ return child;
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentContextMap.java b/libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentContextMap.java
new file mode 100644
index 00000000000..e983ef30f7a
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentContextMap.java
@@ -0,0 +1,87 @@
+/* PersistentContextMap.java -- The persistent context naming map
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.classpath.tools.orbd;
+
+import java.io.File;
+
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Object;
+
+/**
+ * The persistent context naming map for the persistent naming service.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public class PersistentContextMap extends PersistentMap
+{
+ /**
+ * Create the persistent context map that stores information in the given
+ * file.
+ *
+ * @param an_orb the naming service ORB, used to obtain and produce the object
+ * stringified references.
+ * @param mapFile the file, where the persistent information is stored.
+ * @param reset if true, the previous naming data are discarded. If false
+ * (normally expected), they are loaded from the persistent memory to
+ * provide the persistence.
+ */
+ public PersistentContextMap(ORB an_orb, File mapFile, boolean reset)
+ {
+ super(an_orb, mapFile, reset);
+ }
+
+ /**
+ * This method expects the PersistentContext as its parameter. The returned
+ * description line is the name of the context parent folder.
+ */
+ protected String object_to_string(Object object)
+ {
+ PersistentContext pc = (PersistentContext) object;
+ return pc.contextFolder.getAbsolutePath();
+ }
+
+ /**
+ * This method restores the PersistenContext. The description line is
+ * interpreted as the folder name, absolute path.
+ */
+ protected Object string_to_object(String description)
+ {
+ return new PersistentContext(orb, new File(description), reset);
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentMap.java b/libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentMap.java
new file mode 100644
index 00000000000..6c6164d21f4
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentMap.java
@@ -0,0 +1,454 @@
+/* PersistentMap.java -- The persistent object naming map
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.orbd;
+
+import gnu.CORBA.NamingService.NamingMap;
+
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.omg.CORBA.ORB;
+import org.omg.CosNaming.NameComponent;
+import org.omg.CosNaming.NamingContextPackage.AlreadyBound;
+import org.omg.CosNaming.NamingContextPackage.InvalidName;
+
+/**
+ * The persistent object naming map for the persistent naming service. The
+ * inherited (super.) naming map implementation is transient and is used as a
+ * cache. During the normal work, the naming map does not read from the disk,
+ * just stores the changes there. Map only reads from the disk when it starts.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public class PersistentMap
+ extends NamingMap
+{
+ /**
+ * The data entry.
+ */
+ public static class Entry
+ {
+ String id;
+
+ String kind;
+
+ String ior;
+
+ /**
+ * Get the name component node.
+ */
+ public NameComponent getComponent()
+ {
+ return new NameComponent(id, kind);
+ }
+
+ /**
+ * Write the naming map entry to the output stream.
+ */
+ public void write(OutputStream out) throws IOException
+ {
+ // Format: id.kind <eoln> ior <eoln><eoln>
+ out.write(getKey(id, kind).getBytes());
+ out.write('\n');
+ out.write(ior.getBytes());
+ out.write('\n');
+ out.close();
+ }
+
+ /**
+ * Read the name component from the input stream
+ */
+ public boolean read(BufferedReader in) throws IOException
+ {
+ String key = in.readLine();
+ String xior = in.readLine();
+
+ if (key != null && xior != null)
+ {
+ if (key.length() < 2)
+ {
+ // A single char key cannot have the kind part.
+ id = key;
+ kind = "";
+ }
+ else
+ {
+ // Search for the id/kind splitter, dot:
+ int iks = - 1;
+ for (int i = 1; i < key.length(); i++)
+ {
+ if (key.charAt(i) == '.')
+ // The id is separated from kind by dot, unless preceeded by
+ // the
+ // escape character, \.
+ if (key.charAt(i - 1) != '\\')
+ {
+ iks = i;
+ break;
+ }
+ }
+
+ // May also end by dot, if the kind field is missing.
+ if (iks < 0)
+ {
+ id = key;
+ kind = "";
+ }
+ else if (iks == key.length() - 1)
+ {
+ id = key.substring(0, key.length() - 1);
+ kind = "";
+ }
+ else
+ {
+ id = key.substring(0, iks);
+ kind = key.substring(iks + 1);
+ }
+ }
+ ior = xior;
+ return true;
+ }
+ else
+ return false;
+ }
+
+ /**
+ * Get the key value from the name component.
+ *
+ * @param id the component id
+ * @param kind the component kind
+ * @return the key value
+ */
+ public String getKey(String id, String kind)
+ {
+ StringBuffer b = new StringBuffer(id.length() + 8);
+ appEscaping(b, id);
+ b.append('.');
+ if (kind != null && kind.length() > 0)
+ appEscaping(b, kind);
+ return b.toString();
+ }
+
+ /**
+ * Append the contents of the string to this string buffer, inserting the
+ * escape sequences, where required.
+ *
+ * @param b a buffer to append the contents to.
+ * @param s a string to append.
+ */
+ void appEscaping(StringBuffer b, String s)
+ {
+ char c;
+ for (int i = 0; i < s.length(); i++)
+ {
+ c = s.charAt(i);
+ switch (c)
+ {
+ case '.':
+ case '/':
+ case '\\':
+ b.append('\\');
+ b.append(c);
+ break;
+
+ default:
+ b.append(c);
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * The file, where the persistent naming map stores the information. The
+ * format of this file is n*(id LF kind LF ior LFLF).
+ */
+ public final File file;
+
+ /**
+ * The naming service ORB, used to obtain and produce the object stringified
+ * references.
+ */
+ ORB orb;
+
+ /**
+ * If true, all existing data on the file system are discarded.
+ */
+ boolean reset;
+
+ /**
+ * Create the persistent map that stores information in the given file.
+ *
+ * @param an_orb the naming service ORB, used to obtain and produce the object
+ * stringified references.
+ * @param mapFile the file, where the persistent information is stored.
+ * @param a_reset if true, the previous naming data are discarded. If false
+ * (normally expected), they are loaded from the persistent memory to
+ * provide the persistence.
+ */
+ public PersistentMap(ORB an_orb, File mapFile, boolean a_reset)
+ {
+ super();
+ orb = an_orb;
+ file = mapFile;
+ reset = a_reset;
+
+ // Initialise the persistent map with existing data.
+ if (file.exists() && ! reset)
+ {
+
+ BufferedReader in;
+ try
+ {
+ FileInputStream fin = new FileInputStream(file);
+ in = new BufferedReader(new InputStreamReader(fin));
+ Entry e = new Entry();
+ boolean ok;
+
+ while (e.read(in))
+ {
+ org.omg.CORBA .Object object = string_to_object(e.ior);
+ orb.connect(object);
+ map.put(e.getComponent(), object);
+ }
+ }
+ catch (Exception ex)
+ {
+ InternalError ierr = new InternalError(file.getAbsolutePath());
+ ierr.initCause(ex);
+ throw ierr;
+ }
+ }
+ }
+
+ /**
+ * Restore object from its string description.
+ *
+ * @param description the string, describing the object
+ *
+ * @return the object.
+ */
+ protected org.omg.CORBA.Object string_to_object(String description)
+ {
+ return orb.string_to_object(description);
+ }
+
+ /**
+ * Convert the object to its string description
+ *
+ * @param object the object to convert
+ * @return the string description of the object
+ */
+ protected String object_to_string(org.omg.CORBA .Object object)
+ {
+ return orb.object_to_string(object);
+ }
+
+ /**
+ * Put the given GIOP object, specifying the given name as a key. If the entry
+ * with the given name already exists, or if the given object is already
+ * mapped under another name, the {@link AlreadyBound} exception will be
+ * thrown.
+ *
+ * @param name the name
+ * @param object the object
+ */
+ public void bind(NameComponent name, org.omg.CORBA.Object object)
+ throws AlreadyBound, InvalidName
+ {
+ if (!containsKey(name))
+ {
+ super.bind(name, object);
+ register(name, object);
+ }
+ else
+ throw new AlreadyBound(name.id + "." + name.kind);
+ }
+
+ /**
+ * Put the given CORBA object, specifying the given name as a key. Remove all
+ * pre - existing mappings for the given name and object.
+ *
+ * @param name the name.
+ * @param object the object
+ */
+ public void rebind(NameComponent name, org.omg.CORBA.Object object)
+ throws InvalidName
+ {
+ if (containsKey(name))
+ {
+ org.omg.CORBA.Object existing = get(name);
+ String ior = object_to_string(object);
+ String xior = object_to_string(existing);
+
+ // Same name and same ior - nothing to do.
+ if (ior.equals(xior))
+ return;
+ else
+ remove(name);
+ }
+
+ Iterator iter = entries().iterator();
+ Map.Entry item;
+
+ // Remove the existing mapping for the given object, if present.
+ while (iter.hasNext())
+ {
+ item = (Map.Entry) iter.next();
+ if (item.getValue().equals(object))
+ iter.remove();
+ }
+
+ map.put(name, object);
+ register(name, object);
+ }
+
+ /**
+ * Removes the given name, if present.
+ *
+ * @param name a name to remove.
+ */
+ public void remove(NameComponent name)
+ {
+ super.remove(name);
+ unregister(name);
+ }
+
+ /**
+ * Register this name - object pair in the persistent storage.
+ *
+ * @param name the name.
+ * @param object the object
+ */
+ public void register(NameComponent name, org.omg.CORBA.Object object)
+ {
+ // If this key is already known, and this is the same object,
+ // then return without action.
+ String ior = object_to_string(object);
+
+ synchronized (file)
+ {
+ try
+ {
+ FileOutputStream fou;
+
+ if (! file.exists())
+ fou = new FileOutputStream(file);
+ else
+ fou = new FileOutputStream(file, true);
+
+ Entry e = new Entry();
+ e.id = name.id;
+ e.kind = name.kind;
+ e.ior = ior;
+ e.write(fou);
+ fou.close();
+ }
+ catch (Exception e)
+ {
+ InternalError ierr = new InternalError(file.getAbsolutePath());
+ ierr.initCause(e);
+ throw ierr;
+ }
+ }
+ }
+
+ /**
+ * Remove this name from the persistent storage.
+ *
+ * @param name the name to remove
+ */
+ public void unregister(NameComponent name)
+ {
+ synchronized (file)
+ {
+ try
+ {
+ File nf = new File(file.getParent(), file.getName() + "_t");
+ FileInputStream fin = new FileInputStream(file);
+ FileOutputStream fou = new FileOutputStream(nf);
+ BufferedOutputStream ou = new BufferedOutputStream(fou);
+
+ BufferedReader in = new BufferedReader(new InputStreamReader(fin));
+ String s;
+ String nk = name.kind;
+ if (nk == null)
+ nk = "";
+
+ Entry e = new Entry();
+
+ while (e.read(in))
+ {
+ if (e.id.equals(name.id) && e.kind.equals(nk))
+ {
+ // Do nothing - skip.
+ }
+ else
+ {
+ e.write(ou);
+ }
+ }
+
+ File deleteIt = new File(file.getParent(), file.getName() + "_d");
+ if (deleteIt.exists())
+ deleteIt.delete();
+
+ if (! file.renameTo(deleteIt))
+ throw new IOException(file.getAbsolutePath() + " rename failed");
+
+ if (! nf.renameTo(file))
+ throw new IOException(file.getAbsolutePath() + " rename failed");
+ }
+ catch (Exception e)
+ {
+ InternalError ierr = new InternalError(file.getAbsolutePath());
+ ierr.initCause(e);
+ throw ierr;
+ }
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/Persistent.java b/libjava/classpath/tools/gnu/classpath/tools/rmi/Persistent.java
deleted file mode 100644
index 5cd1efe91f7..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/Persistent.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* PersistentBidiHasthable.java -- Constants for the persistent tables.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.classpath.tools.rmi;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-/**
- * The static fields, shared by the multiple classes, implementing the
- * persistent work.
- *
- * @author Audrius Meskauskas (audriusa@bioinformatics.org)
- */
-public interface Persistent
-{
- /**
- * Sheduled termination task.
- */
- static class ExitTask extends TimerTask
- {
- public void run()
- {
- System.exit(0);
- }
- }
-
- /**
- * The timer, sheduling all disk database update events, shared by all
- * instances.
- */
- static Timer timer = new Timer(true);
-
- /**
- * The longest time, in ms, after that the database content on the disk must
- * be updated. The algorithm is written to avoid the very frequent writings to
- * the disk.
- */
- static long SAVE_AT_MOST_AFTER = 5000;
-
- /**
- * States how long the database may stay not updated during the intensive
- * operations, in ms. Otherwise the intensively used structure may never
- * be stored to the disk.
- */
- static long ALWAYS_UPDATE = 300000;
-
- /**
- * Write the database content to the disk.
- */
- void writeContent();
-
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/PersistentBidiHashTable.java b/libjava/classpath/tools/gnu/classpath/tools/rmi/PersistentBidiHashTable.java
deleted file mode 100644
index 94b5bcbeeb7..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/PersistentBidiHashTable.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/* PersistentBidiHasthable.java -- Bidirectional persistent hash table.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.classpath.tools.rmi;
-
-import gnu.classpath.tools.rmi.rmid.ActivationSystemImpl;
-import gnu.java.rmi.activation.BidiTable;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TimerTask;
-
-/**
- * The persistent bidirectional hash table, maps both a to b and b to a. The
- * changes are written to dist after SAVE_AT_MOST_AFTER time from the latest
- * database change or at most after ALWAYS_UPDATE, if the database is updated
- * very frequently. To ensure that no information is lost, the shutdown method
- * must be called before exit.
- *
- * @author Audrius Meskauskas (audriusa@bioinformatics.org)
- */
-public class PersistentBidiHashTable extends BidiTable implements
- Persistent
-{
- class WriteToDiskTask extends TimerTask
- {
- /**
- * Save the database.
- */
- public void run()
- {
- writeContent();
- sheduled = null;
- }
- }
-
- /**
- * Replaces instances of ActivationSystemImpl into the currently active
- * instance of the ActivationSystemImpl
- */
- class AdaptedReader extends ObjectInputStream
- {
- AdaptedReader(InputStream in) throws IOException
- {
- super(in);
- enableResolveObject(true);
- }
-
- protected Object resolveObject(Object obj) throws IOException
- {
- if (obj instanceof ActivationSystemImpl)
- return ActivationSystemImpl.singleton2;
- else
- return obj;
- }
- }
-
- /**
- * The database file.
- */
- File database;
-
- /**
- * The currently sheduled write to disk task, null if none.
- */
- WriteToDiskTask sheduled = null;
-
- /**
- * The time, when the disk database was last updated.
- */
- long lastUpdated;
-
- /**
- * Create the unitialised instance that must be initalised when
- * ActivationSystemImpl.singleton2 is assigned.
- */
- public PersistentBidiHashTable()
- {
- // Do not initalise the table fields - the initalise method must be
- // called later.
- super(0);
- }
-
- /**
- * Create a new persistent table that stores its information into the given
- * file. The ActivationSystemImpl.singleton2 must be assigned.
- *
- * @param file
- * the file, where the table stores its information.
- * @param coldStart
- * if true, the existing file with this name will be erased and
- * ignored. Otherwise, it will be assumed that the file contains the
- * persistent table information.
- */
- public void init(File file, boolean coldStart)
- {
- try
- {
- database = file;
- if (database.exists())
- {
- if (coldStart)
- {
- k2v = new Hashtable();
- v2k = new Hashtable();
- database.delete();
- }
- else
- {
- FileInputStream fi = new FileInputStream(file);
- BufferedInputStream b = new BufferedInputStream(fi);
- ObjectInputStream oin = new AdaptedReader(b);
-
- k2v = (Map) oin.readObject();
- oin.close();
-
- v2k = new Hashtable(k2v.size());
-
- // Reguild v2k from k2v:
- Iterator en = k2v.keySet().iterator();
- Object key;
- while (en.hasNext())
- {
- key = en.next();
- v2k.put(k2v.get(key), key);
- }
- }
- }
- else
- {
- k2v = new Hashtable();
- v2k = new Hashtable();
- }
- }
- catch (Exception ioex)
- {
- InternalError ierr = new InternalError("Unable to intialize with file "
- + file);
- ierr.initCause(ioex);
- throw ierr;
- }
- }
-
- /**
- * Write the database content to the disk.
- */
- public synchronized void writeContent()
- {
- try
- {
- FileOutputStream fou = new FileOutputStream(database);
- BufferedOutputStream b = new BufferedOutputStream(fou);
- ObjectOutputStream oout = new ObjectOutputStream(b);
- oout.writeObject(k2v);
- oout.close();
- }
- catch (Exception ioex)
- {
- InternalError ierr = new InternalError(
- "Failed to write database to disk: "
- + database);
- ierr.initCause(ioex);
- throw ierr;
- }
- }
-
- /**
- * Mark the modified database as modified. The database will be written after
- * several seconds, unless another modification occurs.
- */
- public void markDirty()
- {
- if (System.currentTimeMillis() - lastUpdated > ALWAYS_UPDATE)
- {
- // Force storing to disk under intensive operation.
- writeContent();
- lastUpdated = System.currentTimeMillis();
- if (sheduled != null)
- {
- sheduled.cancel();
- sheduled = null;
- }
- }
- else
- {
- // Otherwise coalesce the disk database copy update events.
- if (sheduled != null)
- sheduled.cancel();
- sheduled = new WriteToDiskTask();
- timer.schedule(sheduled, SAVE_AT_MOST_AFTER);
- }
- }
-
- /**
- * Save the current database state to the disk before exit.
- */
- public void shutdown()
- {
- if (sheduled != null)
- {
- writeContent();
- sheduled = null;
- }
- }
-
- /**
- * Update the memory maps and mark as should be written to the disk.
- */
- public void put(Object key, Object value)
- {
- super.put(key, value);
- markDirty();
- }
-
- /**
- * Update the memory maps and mark as should be written to the disk.
- */
- public void removeKey(Object key)
- {
- super.removeKey(key);
- markDirty();
- }
-
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/PersistentHashTable.java b/libjava/classpath/tools/gnu/classpath/tools/rmi/PersistentHashTable.java
deleted file mode 100644
index 925e829ffd0..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/PersistentHashTable.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/* PersistentHasthable.java -- Persistent hash table.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.classpath.tools.rmi;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.TimerTask;
-
-/**
- * The persistent hash table. The changes are written to dist after
- * SAVE_AT_MOST_AFTER time from the latest database change or at most after
- * ALWAYS_UPDATE, if the database is updated very frequently. To ensure that no
- * information is lost, the shutdown method must be called before exit.
- *
- * @author Audrius Meskauskas (audriusa@bioinformatics.org)
- */
-public class PersistentHashTable
- extends Hashtable
- implements Serializable, Persistent
-{
-
- /**
- * Use serialVersionUID for interoperability
- */
- private static final long serialVersionUID = 1;
-
- class WriteToDiskTask extends TimerTask
- {
- /**
- * Save the database.
- */
- public void run()
- {
- writeContent();
- sheduled = null;
- }
- }
-
- /**
- * The database file.
- */
- File database;
-
- /**
- * The currently sheduled write to disk task, null if none.
- */
- WriteToDiskTask sheduled = null;
-
- /**
- * The time, when the disk database was last updated.
- */
- long lastUpdated;
-
- /**
- * Setting to false prevents the automated disk update.
- * The initial value is true to prevent writing while reading and is set
- * to false in createInstance.
- */
- transient boolean ready;
-
- /**
- * Use static method to obtain the instance.
- */
- private PersistentHashTable(File file)
- {
- if (file == null)
- throw new NullPointerException("Null file provided");
- database = file;
- }
-
- /**
- * Create a new persistent table that stores its information into the given
- * file.
- *
- * @param file
- * the file, where the table stores its information.
- * @param coldStart
- * if true, the existing file with this name will be erased and
- * ignored. Otherwise, it will be assumed that the file contains the
- * persistent table information.
- */
- public static Map createInstance(File file, boolean coldStart)
- {
- try
- {
- PersistentHashTable k2v;
- if (file.exists())
- {
- if (coldStart)
- {
- file.delete();
- k2v = new PersistentHashTable(file);
- }
- else
- {
- FileInputStream fi = new FileInputStream(file);
- BufferedInputStream b = new BufferedInputStream(fi);
- ObjectInputStream oin = new ObjectInputStream(b);
-
- k2v = (PersistentHashTable) oin.readObject();
- oin.close();
- }
- }
- else
- k2v = new PersistentHashTable(file);
-
- k2v.ready = true;
- return k2v;
- }
- catch (Exception ioex)
- {
- InternalError ierr = new InternalError("Unable to intialize with file "
- + file);
- ierr.initCause(ioex);
- throw ierr;
- }
- }
-
-
- /**
- * Write the database content to the disk.
- */
- public synchronized void writeContent()
- {
- try
- {
- FileOutputStream fou = new FileOutputStream(database);
- BufferedOutputStream b = new BufferedOutputStream(fou);
- ObjectOutputStream oout = new ObjectOutputStream(b);
- oout.writeObject(this);
- oout.close();
- }
- catch (Exception ioex)
- {
- InternalError ierr = new InternalError(
- "Failed to write database to disk: "+ database);
- ierr.initCause(ioex);
- throw ierr;
- }
- }
-
- /**
- * Mark the modified database as modified. The database will be written after
- * several seconds, unless another modification occurs.
- */
- public void markDirty()
- {
- if (System.currentTimeMillis() - lastUpdated > ALWAYS_UPDATE)
- {
- // Force storing to disk under intensive operation.
- writeContent();
- lastUpdated = System.currentTimeMillis();
- if (sheduled != null)
- {
- sheduled.cancel();
- sheduled = null;
- }
- }
- else
- {
- // Otherwise coalesce the disk database copy update events.
- if (sheduled != null)
- sheduled.cancel();
- sheduled = new WriteToDiskTask();
- timer.schedule(sheduled, SAVE_AT_MOST_AFTER);
- }
- }
-
- /**
- * Save the current database state to the disk before exit.
- */
- public void shutdown()
- {
- if (sheduled != null)
- {
- writeContent();
- sheduled = null;
- }
- }
-
- /**
- * Update the memory maps and mark as should be written to the disk.
- */
- public Object put(Object key, Object value)
- {
- super.put(key, value);
- if (ready)
- markDirty();
- return value;
- }
-
- /**
- * Update the memory maps and mark as should be written to the disk.
- */
- public Object remove(Object key)
- {
- Object removed = super.remove(key);
- if (ready)
- markDirty();
- return removed;
- }
-
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/REGISTRY.java b/libjava/classpath/tools/gnu/classpath/tools/rmi/REGISTRY.java
deleted file mode 100644
index 63f633f992e..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/REGISTRY.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/* REGISTY.java -- RMI registry starter.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.classpath.tools.rmi;
-
-import gnu.classpath.tools.HelpPrinter;
-import gnu.classpath.tools.rmi.registry.RegistryImpl;
-import gnu.java.rmi.server.UnicastServerRef;
-
-import java.io.File;
-import java.rmi.NotBoundException;
-import java.rmi.RemoteException;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-import java.rmi.server.ObjID;
-import java.rmi.server.RMIServerSocketFactory;
-import java.util.Hashtable;
-import java.util.Map;
-
-/**
- * The optionally persistent RMI registry implementation.
- *
- * @author Audrius Meskauskas (audriusa@bioinformatics.org)
- */
-public class REGISTRY
-{
- /**
- * The stop command.
- */
- public static String STOP = "gnu.classpath.tools.rmi.registry.command.STOP";
-
- /**
- * If true, the registry prints registration events to console.
- */
- public static boolean verbose = false;
-
- /**
- * The RMI registry implementation entry point.
- */
- public static void main(String[] args)
- {
- String HelpPath = "rmi/REGISTRY.txt";
- HelpPrinter.checkHelpKey(args, HelpPath);
-
- // Parse parameters:
- String folder = ".";
- boolean cold = false;
- boolean trans = false;
- boolean stop = false;
-
- int port = Registry.REGISTRY_PORT;
- RMIServerSocketFactory ssf = null;
-
- for (int i = 0; i < args.length; i++)
- {
- String a = args[i];
- if (a.equals("-restart"))
- cold = true;
- else if (a.equals("-transient"))
- trans = true;
- else if (a.equals("-verbose"))
- verbose = true;
- else if (a.equals("-stop"))
- stop = true;
- else if (i < args.length - 1)
- {
- // The additional key parameter is possible.
- if (a.equals("-port"))
- port = Integer.parseInt(args[++i]);
- else if (a.equals("-folder"))
- folder = args[++i];
- }
- }
-
- if (!stop)
- {
- Map table;
- if (trans)
- table = new Hashtable();
- else
- {
- // Start the system.
- File dataFolder = new File(folder);
- if (!dataFolder.exists())
- dataFolder.mkdirs();
- table = PersistentHashTable.createInstance(
- new File(dataFolder, "rmiregistry.data"), cold);
- }
-
- RegistryImpl system = new RegistryImpl(table);
-
- // We must export with the specific activation id that is only
- // possible when going into the gnu.java.rmi
- try
- {
- UnicastServerRef sref = new UnicastServerRef(
- new ObjID(ObjID.REGISTRY_ID), port, ssf);
-
- sref.exportObject(system);
- System.out.println("The RMI naming service is listening at " + port);
- }
- catch (Exception ex)
- {
- System.out.println("Failed to start RMI naming service at " + port);
- }
- }
- else
- {
- // Stop the naming service.
- try
- {
- Registry r = LocateRegistry.getRegistry(port);
- // Search for this specific line will command to stop the registry.
-
- // Our service returns null, but any other service will thrown
- // NotBoundException.
- r.unbind(STOP);
- }
- catch (RemoteException e)
- {
- System.out.println("Failed to stop RMI naming service at " + port);
- }
- catch (NotBoundException e)
- {
- System.out.println("The naming service at port "+port+" is not a "+
- REGISTRY.class.getName());
- }
- }
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/REGISTRY.txt b/libjava/classpath/tools/gnu/classpath/tools/rmi/REGISTRY.txt
deleted file mode 100644
index 7d8e192329f..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/REGISTRY.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-The persistent RMI naming service, required for the remote method invocations
-(packages java.rmi.*, java.rmi.Registry.*).
-
-Copyright 2006 Free Software Foundation, Inc.
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-Please report bugs at http://www.gnu.org/software/classpath/bugs.html
-
-Usage: rmiregistry <options>
-
- where <options> includes:
- -port N Start the registry on the given local port. If this key
- is not specified, the service starts on the port 1099.
- -verbose Log binding events to stdout.
- -stop Stop the running naming service at the given port.
-
- -transient Start transient registry service that does not write any
- data to the disk. Such service looses the stored bindings if
- restarted. If this key is not specified, the
- persistent naming service is started.
- -restart "Cold start:, clear the persistent naming database, if any.
- -folder Folder Store the persistent binding file in the given folder. If this
- key is not specified, the file with persistent bindings is
- stored into the current folder.
-
-
-
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/RMIC.java b/libjava/classpath/tools/gnu/classpath/tools/rmi/RMIC.java
deleted file mode 100644
index fa4d87c1707..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/RMIC.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/* RMIC.java -- RMI stub generator.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-*/
-
-
-package gnu.classpath.tools.rmi;
-
-import gnu.classpath.tools.HelpPrinter;
-import gnu.classpath.tools.giop.GRMIC;
-import gnu.classpath.tools.rmi.rmic.RmicCompiler;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * Generates the ordinary stubs (not GIOP based) for java.rmi.* package.
- *
- * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
- */
-public class RMIC
-{
- /**
- * The version of the compiler.
- */
- public static String VERSION = "0.01 alpha pre";
-
- /**
- * The GRMIC compiler methods
- *
- * @param args the compiler parameters.
- */
- public static void main(String[] args)
- {
- // Check for the -iiop or -giop keys. If one of these keys is present,
- // forward all call to GRMIC.
- for (int i = 0; i < args.length; i++)
- {
- if (args[i].equals("-giop") || args[i].equals("-iiop"))
- {
- GRMIC.main(args);
- return;
- }
- }
-
- boolean noWrite = false;
- boolean verbose = false;
-
- String HelpPath = "rmi/RMIC.txt";
-
- HelpPrinter.checkHelpKey(args, HelpPath);
-
- File output = new File(".");
-
- if (args.length == 0)
- {
- HelpPrinter.printHelpAndExit(HelpPath);
- }
- else
- {
- RmicCompiler compiler = new RmicCompiler();
-
- int cl = - 1;
-
- Options: for (int i = 0; i < args.length; i++)
- {
- String c = args[i];
- if (c.equals("-v"))
- {
- printVersion();
- System.exit(0);
- }
- else if (c.equals("-nowrite"))
- noWrite = true;
- else if (c.equals("-nowarn"))
- compiler.setWarnings(false);
- else if (c.equals("-verbose"))
- {
- verbose = true;
- compiler.setVerbose(true);
- }
- else if (c.equals("-force"))
- {
- compiler.setForce(true);
- }
- else if (c.equals("-d"))
- {
- int f = i + 1;
- if (f < args.length)
- {
- output = new File(args[f]);
- i++;
- }
- else
- HelpPrinter.printHelpAndExit(HelpPath);
- }
- else if (c.equals("-classpath"))
- {
- int f = i + 1;
- if (f < args.length)
- {
- compiler.setClassPath(args[f]);
- i++;
- }
- else
- HelpPrinter.printHelpAndExit(HelpPath);
- }
- else if (c.charAt(0) != '-')
- // No more options - start of class list.
- {
- cl = i;
- break Options;
- }
- }
-
- if (cl < 0)
- HelpPrinter.printHelpAndExit(HelpPath);
-
- if (verbose)
- System.out.println("Compiling to " + output.getAbsolutePath());
-
- // Compile classes
- Compile: for (int i = cl; i < args.length; i++)
- {
- if (args[i].charAt(0) != '-')
- {
- compiler.reset();
- Class c = compiler.loadClass(args[i]);
-
- compiler.compile(c);
- String packag = compiler.getPackageName().replace('.', '/');
- File fw = new File(output, packag);
-
- // Generate stub.
- String stub = compiler.generateStub();
- String subName = compiler.getStubName() + "_Stub.java";
-
- if (noWrite)
- continue Compile;
-
- try
- {
- fw.mkdirs();
- OutputStream out = new FileOutputStream(new File(fw,
- subName));
- out.write(stub.getBytes());
- out.close();
- }
- catch (IOException ioex)
- {
- System.err.println("Output path not accessible");
- ioex.printStackTrace();
- System.exit(1);
- }
- }
- }
- }
- }
-
- /**
- * Print the version information.
- */
- public static void printVersion()
- {
- System.out.println
- ("rmic v "+VERSION+" - RMI stub generator for java.rmi.* ");
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/RMIC.txt b/libjava/classpath/tools/gnu/classpath/tools/rmi/RMIC.txt
deleted file mode 100644
index 882cca5538a..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/RMIC.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-RMI stub and tie source code generator for java.rmi.*, javax.rmi.*
-
-Copyright 2006 Free Software Foundation, Inc.
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-Please report bugs at http://www.gnu.org/software/classpath/bugs.html
-
-Usage: rmic <options> <class names>
-
- where <options> includes:
- -nowarn Show no warnings
- -nowrite Do not write any files (check for errors only)
- -d <folder> Place generated files into the given folder
- -classpath <path> Specifies the path, where to find the classes being
- compiled
-
- -help Print this help text
- -v Print version
- -verbose Verbose output
- -force Try to generate code even if the input classes seem not
- consistent with RMI specification.
-
- -1.2 Generate v 1.2 stubs (default)*
-
- -iiop Generate stubs and ties for the GIOP based RMI package
- extension, javax.rmi. With this key, the two additional
- keys are accepted:
- -poa Generate the Servant based ties (default)
- -impl Generate the obsoleted ObjectImpl based ties
- (for backward compatibility)
- -help Show more details on the giop stub and tie generator
- options.
- -giop Same as -iiop*
-
-
- and <class names> can include one or more non abstract classes that implement
- Remote and are accessible via current class path.
-
-* This tool generates the source code that must be compiled with java compiler.
-* The deprecated 1.1 version stubs are currently not supported (the v 1.2
- style stubs are always generated).
-* -iiop is a standard key for this tool, but it is also a registered OMG mark
- when giop is not.
-
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/RMID.java b/libjava/classpath/tools/gnu/classpath/tools/rmi/RMID.java
deleted file mode 100644
index 81d09671a79..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/RMID.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/* RMID.java -- the RMI activation daemon.
- Copyright (c) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.classpath.tools.rmi;
-
-import gnu.classpath.tools.HelpPrinter;
-import gnu.classpath.tools.rmi.rmid.ActivationSystemImpl;
-import gnu.java.rmi.activation.ActivationSystemTransient;
-import gnu.java.rmi.server.UnicastServerRef;
-
-import java.io.File;
-import java.net.InetAddress;
-import java.rmi.Remote;
-import java.rmi.activation.ActivationSystem;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-import java.rmi.server.ObjID;
-import java.rmi.server.RMIServerSocketFactory;
-
-
-/**
- * The persistent RMI activation daemon.
- *
- * @author Audrius Meskauskas (audriusa@bioinformatics.org)
- */
-public class RMID
-{
- /**
- * The RMI server socket factory.
- */
- static RMIServerSocketFactory ACTIVATION_REGISTY_SOCKET_FACTORY = null;
-
- /**
- * The activation registry port.
- */
- static int ACTIVATION_REGISTRY_PORT = ActivationSystem.SYSTEM_PORT;
-
- /**
- * The activation system name.
- */
- static String ACTIVATION_SYSTEM_NAME = "java.rmi.activation.ActivationSystem";
-
- /**
- * The RMI activation daemon entry point.
- */
- public static void main(String[] args)
- {
- String HelpPath = "rmi/RMID.txt";
- HelpPrinter.checkHelpKey(args, HelpPath);
-
- // Parse parameters:
- boolean stop = false;
- String folder = ".";
- boolean cold = false;
- boolean trans = false;
-
- for (int i = 0; i < args.length; i++)
- {
- String a = args[i];
- if (a.equals("-verbose"))
- ActivationSystemTransient.debug = true;
- else if (a.equals("-stop"))
- stop = true;
- else if (a.equals("-restart"))
- cold = true;
- else if (a.equals("-transient"))
- trans = true;
- else if (i < args.length - 1)
- {
- // The additional key parameter is possible.
- if (a.equals("-port"))
- ACTIVATION_REGISTRY_PORT = Integer.parseInt(args[++i]);
- else if (a.equals("-folder"))
- folder = args[++i];
- }
- }
-
- try
- {
- if (!stop)
- {
- // Start the system.
- File dataFolder = new File(folder);
- if (!dataFolder.exists())
- dataFolder.mkdirs();
- ActivationSystem system;
-
- if (trans)
- system = ActivationSystemTransient.getInstance();
- else
- system = ActivationSystemImpl.getInstance(dataFolder, cold);
-
- // We must export with the specific activation id that is only
- // possible when going into the gnu.java.rmi.activation.
- UnicastServerRef sref = new UnicastServerRef(
- new ObjID(ObjID.ACTIVATOR_ID), ACTIVATION_REGISTRY_PORT,
- ACTIVATION_REGISTY_SOCKET_FACTORY);
- Remote systemStub = sref.exportObject(system);
-
- // Start the naming system on the activation system port
- // (if not already running).
-
- Registry r;
- try
- {
- // Expect the naming service running first.
- // The local host may want to use the shared registry
- r = LocateRegistry.getRegistry(ACTIVATION_REGISTRY_PORT);
- r.rebind(ACTIVATION_SYSTEM_NAME, systemStub);
- }
- catch (Exception ex)
- {
- // The naming service is not running. Start it.
- r = LocateRegistry.createRegistry(ACTIVATION_REGISTRY_PORT);
- r.rebind(ACTIVATION_SYSTEM_NAME, systemStub);
- }
- String host = InetAddress.getLocalHost().getCanonicalHostName();
- System.out.println("The RMI daemon is listening on " + host +
- " (port "
- + ACTIVATION_REGISTRY_PORT + ")");
-
- }
- else
- {
- // Stop the activation system.
- Registry r;
- try
- {
- System.out.print("Stopping RMI daemon at "
- + ACTIVATION_REGISTRY_PORT+" ... ");
- // Expect the naming service running first.
- // The local host may want to use the shared registry
- r = LocateRegistry.getRegistry(ACTIVATION_REGISTRY_PORT);
- ActivationSystem asys =
- (ActivationSystem) r.lookup(ACTIVATION_SYSTEM_NAME);
- asys.shutdown();
- System.out.println("OK.");
- }
- catch (Exception ex)
- {
- System.out.println("The RMI daemon seems not running at "
- + ACTIVATION_REGISTRY_PORT);
- if (ActivationSystemTransient.debug)
- ex.printStackTrace();
- }
- }
- }
- catch (Exception e)
- {
- System.out.println("Failed to start the RMI daemon.");
- if (ActivationSystemTransient.debug)
- e.printStackTrace();
- }
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/RMID.txt b/libjava/classpath/tools/gnu/classpath/tools/rmi/RMID.txt
deleted file mode 100644
index a62613fd4a2..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/RMID.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-The persistent RMI activation daemon, support RMI object activation
-(package java.rmi.activation.*).
-
-Copyright 2006 Free Software Foundation, Inc.
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-Please report bugs at http://www.gnu.org/software/classpath/bugs.html
-
-Usage: rmid <options>
-
- where <options> includes:
- -port N Start the service on the given local port. If this key
- is not specified, the service starts on the port 1098.
- -verbose Log registration events to stdout.
- -stop Stop the running activation service at the given port.
-
- -transient Start transient activation service that does not write any
- data to the disk. Such service looses the stored activation
- descriptors, if restarted. If this key is not specified, the
- persistent naming service is started.
- -restart "Cold start:, clear the activation descriptor database, if any.
- -folder Folder Store the persistent descriptor file in the given folder. If this
- key is not specified, the file with persistent activation
- information is stored into the current folder.
-
-All activation groups are activated on the same virtual machine, where the
-daemon is running. For security reasons, all the classes, required for
-activation, must be available in the classpath of that machine.
- \ No newline at end of file
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/registry/RegistryImpl.java b/libjava/classpath/tools/gnu/classpath/tools/rmi/registry/RegistryImpl.java
deleted file mode 100644
index 90bd3a6bdac..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/registry/RegistryImpl.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/* RegistryImpl.java -- the RMI registry implementation
- Copyright (c) 1996, 1997, 1998, 1999, 2002, 2005, 2006
- Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.classpath.tools.rmi.registry;
-
-import gnu.classpath.tools.rmi.Persistent;
-import gnu.classpath.tools.rmi.REGISTRY;
-
-import java.rmi.AccessException;
-import java.rmi.AlreadyBoundException;
-import java.rmi.NotBoundException;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.registry.Registry;
-import java.util.ArrayList;
-import java.util.Map;
-
-/**
- * The optionally persistent registry implementation.
- *
- * @author Audrius Meskauskas (audriusa@bioinformatics.org)
- */
-public class RegistryImpl implements Registry
-{
- /**
- * The binding table.
- */
- Map bindings;
-
- /**
- * Create the registry implementation that uses the given bidirectinal
- * table to keep the data.
- */
- public RegistryImpl(Map aTable)
- {
- bindings = aTable;
- }
-
- /** @inheritDoc */
- public Remote lookup(String name) throws RemoteException, NotBoundException,
- AccessException
- {
- Object obj = bindings.get(name);
- if (obj == null)
- throw new NotBoundException(name);
- return ((Remote) obj);
- }
-
- /** @inheritDoc */
- public void bind(String name, Remote obj) throws RemoteException,
- AlreadyBoundException, AccessException
- {
- if (REGISTRY.verbose)
- System.out.println("Bind "+name);
- if (bindings.containsKey(name))
- throw new AlreadyBoundException(name);
- bindings.put(name, obj);
- }
-
- /** @inheritDoc */
- public void unbind(String name) throws RemoteException, NotBoundException,
- AccessException
- {
- if (name.equals(REGISTRY.STOP))
- {
- if (bindings instanceof Persistent)
- ((Persistent) bindings).writeContent();
- // Terminate in 10 seconds.
- System.out.println("Shutdown command received. Will terminate in 10 s");
- Persistent.timer.schedule(new Persistent.ExitTask(), 10000);
- }
- else
- {
- if (REGISTRY.verbose)
- System.out.println("Unbind "+name);
-
- if (!bindings.containsKey(name))
- throw new NotBoundException(name);
- else
- bindings.remove(name);
- }
- }
-
- /** @inheritDoc */
- public void rebind(String name, Remote obj) throws RemoteException,
- AccessException
- {
- if (REGISTRY.verbose)
- System.out.println("Rebind "+name);
- bindings.put(name, obj);
- }
-
- /** @inheritDoc */
- public String[] list() throws RemoteException, AccessException
- {
- // Create a separated array to prevent race conditions.
- ArrayList keys = new ArrayList(bindings.keySet());
- int n = keys.size();
- String[] rt = new String[n];
- for (int i = 0; i < n; i++)
- rt[i] = (String) keys.get(i);
- return rt;
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/registry/RegistryImpl_Skel.java b/libjava/classpath/tools/gnu/classpath/tools/rmi/registry/RegistryImpl_Skel.java
deleted file mode 100644
index 36b7d94a595..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/registry/RegistryImpl_Skel.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/* RegistryImpl_Skel.java
- Copyright (C) 2002, 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.classpath.tools.rmi.registry;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.rmi.MarshalException;
-import java.rmi.Remote;
-import java.rmi.UnmarshalException;
-import java.rmi.server.Operation;
-import java.rmi.server.RemoteCall;
-import java.rmi.server.SkeletonMismatchException;
-
-/**
- * This skeleton supports unlikely cases when the naming service is
- * contacted from other interoperable java implementation that still uses
- * the old style skeleton-dependent invocations.
- */
-public final class RegistryImpl_Skel
- implements java.rmi.server.Skeleton
-{
- private static final long interfaceHash = 4905912898345647071L;
-
- /**
- * Repeated multiple times.
- */
- static final String EUM = "error unmarshalling arguments for Registry";
-
- /**
- * Repeated multiple times.
- */
- static final String EMR = "error marshalling return from Registry";
-
- private static final Operation[] operations =
- {
- new Operation("void bind(java.lang.String, Remote"),
- new Operation("java.lang.String[] list("),
- new Operation("Remote lookup(java.lang.String"),
- new Operation("void rebind(java.lang.String, Remote"),
- new Operation("void unbind(java.lang.String")
- };
-
- public Operation[] getOperations()
- {
- return ((Operation[]) operations.clone());
- }
-
- public void dispatch(Remote obj, RemoteCall call,
- int opnum, long hash) throws java.lang.Exception
- {
- if (opnum < 0)
- {
- if (hash == 7583982177005850366L)
- opnum = 0;
- else if (hash == 2571371476350237748L)
- opnum = 1;
- else if (hash == -7538657168040752697L)
- opnum = 2;
- else if (hash == -8381844669958460146L)
- opnum = 3;
- else if (hash == 7305022919901907578L)
- opnum = 4;
- else
- throw new SkeletonMismatchException("interface hash mismatch");
- }
- else if (hash != interfaceHash)
- throw new SkeletonMismatchException("interface hash mismatch");
-
- RegistryImpl server = (RegistryImpl) obj;
- switch (opnum)
- {
- case 0:
- {
- java.lang.String $param_0;
- Remote $param_1;
- try
- {
- ObjectInput in = call.getInputStream();
- $param_0 = (java.lang.String) in.readObject();
- $param_1 = (Remote) in.readObject();
-
- }
- catch (IOException e)
- {
- throw new UnmarshalException(EUM, e);
- }
- catch (java.lang.ClassCastException e)
- {
- throw new UnmarshalException(EUM, e);
- }
- finally
- {
- call.releaseInputStream();
- }
- server.bind($param_0, $param_1);
- try
- {
- ObjectOutput out = call.getResultStream(true);
- }
- catch (IOException e)
- {
- throw new MarshalException(EMR, e);
- }
- break;
- }
-
- case 1:
- {
- try
- {
- ObjectInput in = call.getInputStream();
-
- }
- catch (IOException e)
- {
- throw new UnmarshalException(EUM, e);
- }
- finally
- {
- call.releaseInputStream();
- }
- java.lang.String[] $result = server.list();
- try
- {
- ObjectOutput out = call.getResultStream(true);
- out.writeObject($result);
- }
- catch (IOException e)
- {
- throw new MarshalException(EMR, e);
- }
- break;
- }
-
- case 2:
- {
- java.lang.String $param_0;
- try
- {
- ObjectInput in = call.getInputStream();
- $param_0 = (java.lang.String) in.readObject();
-
- }
- catch (IOException e)
- {
- throw new UnmarshalException(EUM, e);
- }
- catch (java.lang.ClassCastException e)
- {
- throw new UnmarshalException(EUM, e);
- }
- finally
- {
- call.releaseInputStream();
- }
- Remote $result = server.lookup($param_0);
- try
- {
- ObjectOutput out = call.getResultStream(true);
- out.writeObject($result);
- }
- catch (IOException e)
- {
- throw new MarshalException(EMR, e);
- }
- break;
- }
-
- case 3:
- {
- java.lang.String $param_0;
- Remote $param_1;
- try
- {
- ObjectInput in = call.getInputStream();
- $param_0 = (java.lang.String) in.readObject();
- $param_1 = (Remote) in.readObject();
-
- }
- catch (IOException e)
- {
- throw new UnmarshalException(EUM, e);
- }
- catch (java.lang.ClassCastException e)
- {
- throw new UnmarshalException(EUM, e);
- }
- finally
- {
- call.releaseInputStream();
- }
- server.rebind($param_0, $param_1);
- try
- {
- ObjectOutput out = call.getResultStream(true);
- }
- catch (IOException e)
- {
- throw new MarshalException(EMR, e);
- }
- break;
- }
-
- case 4:
- {
- java.lang.String $param_0;
- try
- {
- ObjectInput in = call.getInputStream();
- $param_0 = (java.lang.String) in.readObject();
-
- }
- catch (IOException e)
- {
- throw new UnmarshalException(EUM, e);
- }
- catch (java.lang.ClassCastException e)
- {
- throw new UnmarshalException(EUM, e);
- }
- finally
- {
- call.releaseInputStream();
- }
- server.unbind($param_0);
- try
- {
- ObjectOutput out = call.getResultStream(true);
- }
- catch (IOException e)
- {
- throw new MarshalException(EMR, e);
- }
- break;
- }
-
- default:
- throw new UnmarshalException("invalid method number");
- }
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/registry/RegistryImpl_Stub.java b/libjava/classpath/tools/gnu/classpath/tools/rmi/registry/RegistryImpl_Stub.java
deleted file mode 100644
index d8cac5bfcb3..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/registry/RegistryImpl_Stub.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/* RegistryImpl_Stub.java -- Registry stub.
- Copyright (c) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.classpath.tools.rmi.registry;
-
-import java.rmi.AccessException;
-import java.rmi.AlreadyBoundException;
-import java.rmi.NotBoundException;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.registry.Registry;
-
-import java.lang.reflect.Method;
-import java.rmi.server.RemoteRef;
-import java.rmi.server.RemoteStub;
-import java.rmi.UnexpectedException;
-
-/**
- * This class delegates its method calls to the remote RMI object, referenced
- * by {@link RemoteRef}.
- *
- * It is normally generated with rmic.
- */
-public final class RegistryImpl_Stub
- extends RemoteStub
- implements Registry
-{
- /**
- * Use serialVersionUID for interoperability
- */
- private static final long serialVersionUID = 3;
-
- /**
- * The explaining message for {@ling UnexpectedException}.
- */
- private static final String exception_message =
- "undeclared checked exception";
-
- /* All remote methods, invoked by this stub: */
- private static final Method met_list;
- private static final Method met_rebind;
- private static final Method met_unbind;
- private static final Method met_lookup;
- private static final Method met_bind;
- private static final Object[] NO_ARGS = new Object[0];
- static
- {
- final Class[] NO_ARGSc = new Class[0];
- try
- {
- met_list =
- Registry.class.getMethod("list", NO_ARGSc);
- met_rebind =
- Registry.class.getMethod("rebind", new Class[]
- {
- String.class, Remote.class
- });
- met_unbind =
- Registry.class.getMethod("unbind", new Class[]
- {
- String.class
- });
- met_lookup =
- Registry.class.getMethod("lookup", new Class[]
- {
- String.class
- });
- met_bind =
- Registry.class.getMethod("bind", new Class[]
- {
- String.class, Remote.class
- });
-
- }
- catch (NoSuchMethodException nex)
- {
- NoSuchMethodError err = new NoSuchMethodError(
- "RegistryImpl_Stub class initialization failed");
- err.initCause(nex);
- throw err;
- }
- }
-
- /**
- * Create the instance for _RegistryImpl_Stub that forwards method calls to the
- * remote object.
- *
- * @para the reference to the remote object.
- */
- public RegistryImpl_Stub(RemoteRef reference)
- {
- super(reference);
- }
-
- /* Methods */
- /** @inheritDoc */
- public String [] list()
- throws RemoteException, AccessException
- {
- try
- {
- Object result = ref.invoke(this, met_list,
- NO_ARGS,
- 2571371476350237748L);
- return (String []) result;
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public void rebind(String p0, Remote p1)
- throws RemoteException, AccessException
- {
- try
- {
- ref.invoke(this, met_rebind,
- new Object[] {p0, p1},
- -8381844669958460146L);
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public void unbind(String p0)
- throws RemoteException, NotBoundException, AccessException
- {
- try
- {
- ref.invoke(this, met_unbind,
- new Object[] {p0},
- 7305022919901907578L);
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public Remote lookup(String p0)
- throws RemoteException, NotBoundException, AccessException
- {
- try
- {
- Object result = ref.invoke(this, met_lookup,
- new Object[] {p0},
- -7538657168040752697L);
- return (Remote) result;
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public void bind(String p0, Remote p1)
- throws RemoteException, AlreadyBoundException, AccessException
- {
- try
- {
- ref.invoke(this, met_bind,
- new Object[] {p0, p1},
- 7583982177005850366L);
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
-
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java b/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java
deleted file mode 100644
index 8da486571ce..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/* MethodGenerator.java -- Generates methods for rmi compiler.
- Copyright (C) 2006 Free Software Foundation
-
- This file is part of GNU Classpath.
-
- GNU Classpath is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- GNU Classpath is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Classpath; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 USA.
-
- Linking this library statically or dynamically with other modules is
- making a combined work based on this library. Thus, the terms and
- conditions of the GNU General Public License cover the whole
- combination.
-*/
-
-
-package gnu.classpath.tools.rmi.rmic;
-
-import gnu.classpath.tools.AbstractMethodGenerator;
-import gnu.java.rmi.server.RMIHashes;
-
-import java.lang.reflect.Method;
-import java.util.Properties;
-
-/**
- * Keeps information about the single method and generates the code fragments,
- * related to that method.
- *
- * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
- */
-public class RmiMethodGenerator
- implements AbstractMethodGenerator
-{
- /**
- * The method being defined.
- */
- Method method;
-
- /**
- * The parent code generator.
- */
- RmicCompiler rmic;
-
- /**
- * Create the new method generator for the given method.
- *
- * @param aMethod the related method.
- * @param aRmic the Rmic generator instance, where more class - related
- * information is defined.
- */
- public RmiMethodGenerator(Method aMethod, RmicCompiler aRmic)
- {
- method = aMethod;
- rmic = aRmic;
- if (method.getParameterTypes().length == 0)
- rmic.addZeroSizeObjecArray = true;
- }
-
- /**
- * Get the method parameter declaration.
- *
- * @return the string - method parameter declaration.
- */
- public String getArgumentList()
- {
- StringBuffer b = new StringBuffer();
-
- Class[] args = method.getParameterTypes();
-
- for (int i = 0; i < args.length; i++)
- {
- b.append(rmic.name(args[i]));
- b.append(" p" + i);
- if (i < args.length - 1)
- b.append(", ");
- }
- return b.toString();
- }
-
- /**
- * Get the method parameter list only (no type declarations). This is used to
- * generate the method invocations statement.
- *
- * @return the string - method parameter list.
- */
- public String getArgumentNames()
- {
- StringBuffer b = new StringBuffer();
-
- Class[] args = method.getParameterTypes();
-
- for (int i = 0; i < args.length; i++)
- {
- b.append(" p" + i);
- if (i < args.length - 1)
- b.append(", ");
- }
- return b.toString();
- }
-
- /**
- * Get the list of exceptions, thrown by this method.
- *
- * @return the list of exceptions.
- */
- public String getThrows()
- {
- StringBuffer b = new StringBuffer();
-
- Class[] args = method.getExceptionTypes();
-
- for (int i = 0; i < args.length; i++)
- {
- b.append(rmic.name(args[i]));
- if (i < args.length - 1)
- b.append(", ");
- }
- return b.toString();
- }
-
- /**
- * Generate this method for the Stub class.
- *
- * @return the method body for the stub class.
- */
- public String generateStubMethod()
- {
- String templateName;
-
- Properties vars = new Properties(rmic.vars);
- vars.put("#return_type", rmic.name(method.getReturnType()));
- vars.put("#method_name", method.getName());
- vars.put("#method_hash", getMethodHashCode());
- vars.put("#argument_list", getArgumentList());
- vars.put("#object_arg_list", getArgListAsObjectArray());
- vars.put("#declaring_class", rmic.name(method.getDeclaringClass()));
- vars.put("#class_arg_list", getArgListAsClassArray());
-
- String thr = getThrows();
- if (thr.length() > 0)
- vars.put("#throws", "\n throws " + thr);
- else
- vars.put("#throws", "");
-
- if (method.getReturnType().equals(void.class))
- templateName = "Stub_12MethodVoid.jav";
- else
- {
- templateName = "Stub_12Method.jav";
- vars.put("#return_statement", getReturnStatement());
- }
-
- String template = rmic.getResource(templateName);
- String generated = rmic.replaceAll(template, vars);
- return generated;
- }
-
- /**
- * Generate sentences for Reading and Defining Arguments.
- *
- * @return the sequence of sentences for reading and defining arguments.
- */
- public String getStaticMethodDeclarations()
- {
- StringBuffer b = new StringBuffer();
- Class[] args = method.getParameterTypes();
-
- for (int i = 0; i < args.length; i++)
- {
- b.append(" ");
- b.append(rmic.name(args[i]));
- b.append(" ");
- b.append("p" + i);
- b.append(" = ");
- if (i < args.length - 1)
- b.append("\n");
- }
- return b.toString();
- }
-
- /**
- * Get the write statement for writing parameters inside the stub.
- *
- * @return the write statement.
- */
- public String getArgListAsObjectArray()
- {
- Class[] args = method.getParameterTypes();
-
- if (args.length==0)
- return "NO_ARGS";
-
- StringBuffer b = new StringBuffer("new Object[] {");
-
- for (int i = 0; i < args.length; i++)
- {
- if (!args[i].isPrimitive())
- b.append("p"+i);
- else
- {
- b.append("new "+rmic.name(WrapUnWrapper.getWrappingClass(args[i])));
- b.append("(p"+i+")");
- }
- if (i<args.length-1)
- b.append(", ");
- }
- b.append("}");
- return b.toString();
- }
-
- /**
- * Get the return statement, assuming that the returned object is placed into
- * the variable "result".
- */
- public String getReturnStatement()
- {
- Class r = method.getReturnType();
- if (r.equals(void.class))
- return "";
- else
- {
- if (r.isPrimitive())
- {
- String wcd = rmic.name(WrapUnWrapper.getWrappingClass(r));
- return "return ((" + wcd + ") result)."
- + WrapUnWrapper.getUnwrappingMethod(r) + ";";
- }
- else
- return "return (" + rmic.name(r) + ") result;";
- }
- }
-
- /**
- * Get argument list as class array.
- */
- public String getArgListAsClassArray()
- {
- StringBuffer b = new StringBuffer();
- Class[] args = method.getParameterTypes();
-
- for (int i = 0; i < args.length; i++)
- {
- b.append(rmic.name(args[i]));
- b.append(".class");
- if (i < args.length - 1)
- b.append(", ");
- }
- return b.toString();
- }
-
- /**
- * RMI ties (previously named Skeletons) are no longer used since v 1.2. This
- * method should never be called.
- */
- public String generateTieMethod()
- {
- throw new InternalError();
- }
-
- /**
- * Get the method hash code.
- */
- public String getMethodHashCode()
- {
- return RMIHashes.getMethodHash(method)+"L";
- }
-
- /**
- * Additional processing of the stub name (nothing to do for JRMP stubs).
- */
- public String convertStubName(String name)
- {
- return name;
- }
-
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/RmicCompiler.java b/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/RmicCompiler.java
deleted file mode 100644
index bc51aad38b9..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/RmicCompiler.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/* RmicCompiler.java -- RMI stub generator for java.rmi.*
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-*/
-
-
-package gnu.classpath.tools.rmi.rmic;
-
-import java.lang.reflect.Method;
-import java.util.Iterator;
-
-import gnu.classpath.tools.AbstractMethodGenerator;
-import gnu.classpath.tools.giop.grmic.GiopRmicCompiler;
-
-/**
- * RMI stub source code generator, required to support java.rmi.*
- *
- * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
- */
-public class RmicCompiler extends GiopRmicCompiler
-{
- /**
- * If true, the zero size object array is declared in the stub to reduce
- * garbage generation.
- */
- public boolean addZeroSizeObjecArray;
-
- /**
- * Generate a RMI stub.
- *
- * @return the string, containing the text of the generated stub.
- */
- public String generateStub()
- {
- String template = getResource("Stub_12.jav");
-
- // Generate methods.
- StringBuffer b = new StringBuffer();
- Iterator iter = methods.iterator();
- while (iter.hasNext())
- {
- RmiMethodGenerator m = (RmiMethodGenerator) iter.next();
- b.append(m.generateStubMethod());
- }
-
- vars.put("#stub_methods", b.toString());
- vars.put("#imports", getImportStatements());
- vars.put("#interfaces", getAllInterfaces());
- vars.put("#stub_method_declarations", getStubMethodDeclarations());
- vars.put("#stub_method_initializations", getStubMethodInitializations());
- if (addZeroSizeObjecArray)
- {
- vars.put("#zeroSizeObjecArray",
- "private static final Object[] NO_ARGS = new Object[0];");
- vars.put("#zeroSizeClassArray",
- "final Class[] NO_ARGSc = new Class[0];");
- }
- else
- {
- vars.put("#zeroSizeObjecArray","");
- vars.put("#zeroSizeClassArray","");
- }
-
- String output = replaceAll(template, vars);
- return output;
- }
-
- /**
- * Create a method generator, applicable for RMI stub methods.
- */
- protected AbstractMethodGenerator createMethodGenerator(Method m)
- {
- return new RmiMethodGenerator(m, this);
- }
-
- /**
- * Get the stub method declarations.
- */
- public String getStubMethodDeclarations()
- {
- StringBuffer b = new StringBuffer();
-
- Iterator iter = methods.iterator();
-
- while (iter.hasNext())
- {
- RmiMethodGenerator method = (RmiMethodGenerator) iter.next();
- b.append(" ");
- b.append("private static final Method met_");
- b.append(method.method.getName());
- b.append(';');
- if (iter.hasNext())
- b.append('\n');
- }
- return b.toString();
- }
-
- /**
- * Get stub method initializations. These must be done in a try-catch
- * statement to catch {@link NoSuchMethodException}.
- */
- public String getStubMethodInitializations()
- {
- StringBuffer b = new StringBuffer();
-
- Iterator iter = methods.iterator();
-
- while (iter.hasNext())
- {
- RmiMethodGenerator method = (RmiMethodGenerator) iter.next();
- b.append(" ");
- b.append("met_");
- b.append(method.method.getName());
- b.append(" =\n ");
- b.append(name(method.method.getDeclaringClass()));
- b.append(".class.getMethod(");
- b.append('"');
- b.append(method.method.getName());
- b.append("\", ");
- if (method.method.getParameterTypes().length == 0)
- b.append("NO_ARGSc);");
- else
- {
- b.append("new Class[]\n {\n ");
- b.append(method.getArgListAsClassArray());
- b.append("\n }");
- b.append(");");
- }
- b.append('\n');
- }
- return b.toString();
- }
-
- /**
- * Prepare for the compilation of the next class.
- */
- public void reset()
- {
- addZeroSizeObjecArray = false;
- super.reset();
- }
-
- /**
- * Additional processing of the stub name (nothing to do for JRMP stubs).
- */
- public String convertStubName(String name)
- {
- return name;
- }
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/WrapUnWrapper.java b/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/WrapUnWrapper.java
deleted file mode 100644
index 8ee4fa5f26d..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/WrapUnWrapper.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* WrapUnWrapper.java -- Wrapper and unwrapper for primitive types.
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-*/
-
-
-package gnu.classpath.tools.rmi.rmic;
-
-
-public class WrapUnWrapper
-{
- /**
- * Get the wrapper class for the primitive type
- *
- * @param primitive the class of the primitive type
- *
- * @return the wrapper class
- */
- public static Class getWrappingClass(Class primitive)
- {
- if (primitive.equals(byte.class))
- return Byte.class;
- if (primitive.equals(int.class))
- return Integer.class;
- if (primitive.equals(long.class))
- return Long.class;
- if (primitive.equals(boolean.class))
- return Boolean.class;
- if (primitive.equals(double.class))
- return Double.class;
- if (primitive.equals(float.class))
- return Float.class;
- if (primitive.equals(char.class))
- return Character.class;
- else
- return null;
- }
-
- /**
- * Get the method, invocation of that would return the wrapped value.
- *
- * @param primitive the class of the primitive type.
- *
- * @return the wrapper method that unwraps the value to the primitive type.
- */
- public static String getUnwrappingMethod(Class primitive)
- {
- if (primitive.equals(byte.class))
- return "byteValue()";
- if (primitive.equals(int.class))
- return "intValue()";
- if (primitive.equals(long.class))
- return "longValue()";
- if (primitive.equals(boolean.class))
- return "booleanValue()";
- if (primitive.equals(double.class))
- return "doubleValue()";
- if (primitive.equals(float.class))
- return "floatValue()";
- if (primitive.equals(char.class))
- return "charValue()";
- else
- return null;
- }
-
-
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmid/ActivationSystemImpl.java b/libjava/classpath/tools/gnu/classpath/tools/rmi/rmid/ActivationSystemImpl.java
deleted file mode 100644
index dda40b06c02..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmid/ActivationSystemImpl.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/* ActivationSystemImpl.java -- implementation of the activation system.
- Copyright (c) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.classpath.tools.rmi.rmid;
-
-import gnu.classpath.tools.rmi.Persistent;
-import gnu.classpath.tools.rmi.PersistentBidiHashTable;
-import gnu.java.rmi.activation.ActivationSystemTransient;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.rmi.MarshalledObject;
-import java.rmi.RemoteException;
-import java.rmi.activation.ActivationDesc;
-import java.rmi.activation.ActivationException;
-import java.rmi.activation.ActivationGroupDesc;
-import java.rmi.activation.ActivationGroupID;
-import java.rmi.activation.ActivationID;
-import java.rmi.activation.ActivationInstantiator;
-import java.rmi.activation.ActivationMonitor;
-import java.rmi.activation.ActivationSystem;
-import java.rmi.activation.Activator;
-import java.rmi.activation.UnknownGroupException;
-import java.rmi.activation.UnknownObjectException;
-
-/**
- * Implements the rmid activation system.
- *
- * @author Audrius Meskauskas (audriusa@bioinformatics.org)
- */
-public class ActivationSystemImpl extends ActivationSystemTransient implements
- ActivationSystem, Activator, ActivationMonitor, Serializable
-{
- /**
- * Use for interoperability.
- */
- private static final long serialVersionUID = 1;
-
- /**
- * The singleton instance of this class.
- */
- public static ActivationSystemImpl singleton2;
-
- /**
- * Obtain the singleton instance of this class.
- *
- * @param folder the folder, where the activation system will keep its files.
- * @param cold do the cold start if true, hot (usual) if false.
- */
- public static ActivationSystem getInstance(File folder, boolean cold)
- {
- if (singleton2 == null)
- singleton2 = new ActivationSystemImpl(folder, cold);
- return singleton2;
- }
-
- /**
- * Creates the group with transient maps.
- *
- * @param folder
- * the folder, where the activation system will keep its files.
- * @param cold
- * do the cold start if true, hot (usual) if false.
- */
- protected ActivationSystemImpl(File folder, boolean cold)
- {
- super(new PersistentBidiHashTable(), new PersistentBidiHashTable());
- singleton2 = this;
- ((PersistentBidiHashTable) groupDescs).init(
- new File(folder, "asi_objects.data"), cold);
- ((PersistentBidiHashTable) descriptions).init(
- new File(folder, "asi_groups.data"), cold);
- }
-
- /** @inheritDoc */
- public MarshalledObject activate(ActivationID id, boolean force)
- throws ActivationException, UnknownObjectException, RemoteException
- {
- return super.activate(id, force);
- }
-
- /** @inheritDoc */
- public ActivationMonitor activeGroup(ActivationGroupID id,
- ActivationInstantiator group,
- long incarnation)
- throws UnknownGroupException, ActivationException, RemoteException
- {
- return super.activeGroup(id, group, incarnation);
- }
-
- /** @inheritDoc */
- public void activeObject(ActivationID id, MarshalledObject obj)
- throws UnknownObjectException, RemoteException
- {
- super.activeObject(id, obj);
- }
-
- /** @inheritDoc */
- public ActivationDesc getActivationDesc(ActivationID id)
- throws ActivationException, UnknownObjectException, RemoteException
- {
- return super.getActivationDesc(id);
- }
-
- public ActivationGroupDesc getActivationGroupDesc(ActivationGroupID groupId)
- throws ActivationException, UnknownGroupException, RemoteException
- {
- return super.getActivationGroupDesc(groupId);
- }
-
- /** @inheritDoc */
- public void inactiveGroup(ActivationGroupID groupId, long incarnation)
- throws UnknownGroupException, RemoteException
- {
- super.inactiveGroup(groupId, incarnation);
- }
-
- /** @inheritDoc */
- public void inactiveObject(ActivationID id) throws UnknownObjectException,
- RemoteException
- {
- super.inactiveObject(id);
- }
-
- /** @inheritDoc */
- public ActivationGroupID registerGroup(ActivationGroupDesc groupDesc)
- throws ActivationException, RemoteException
- {
- return super.registerGroup(groupDesc);
- }
-
- /** @inheritDoc */
- public ActivationID registerObject(ActivationDesc desc)
- throws ActivationException, UnknownGroupException, RemoteException
- {
- return super.registerObject(desc);
- }
-
- /** @inheritDoc */
- public ActivationDesc setActivationDesc(ActivationID id, ActivationDesc desc)
- throws ActivationException, UnknownObjectException,
- UnknownGroupException, RemoteException
- {
- return super.setActivationDesc(id, desc);
- }
-
- /** @inheritDoc */
- public ActivationGroupDesc setActivationGroupDesc(
- ActivationGroupID groupId, ActivationGroupDesc groupDesc)
- throws ActivationException, UnknownGroupException, RemoteException
- {
- return super.setActivationGroupDesc(groupId, groupDesc);
- }
-
- /**
- * This method saves the state of the activation system and then
- * terminates in 10 seconds.
- */
- public void shutdown() throws RemoteException
- {
- super.shutdown();
- System.out.println("Shutdown command received. Will terminate in 10 s");
- Persistent.timer.schedule(new Persistent.ExitTask(), 10000);
- }
-
- /** @inheritDoc */
- public void unregisterGroup(ActivationGroupID groupId)
- throws ActivationException, UnknownGroupException, RemoteException
- {
- super.unregisterGroup(groupId);
- }
-
- /** @inheritDoc */
- public void unregisterObject(ActivationID id) throws ActivationException,
- UnknownObjectException, RemoteException
- {
- super.unregisterObject(id);
- }
-
- /**
- * Read the object from the input stream.
- *
- * @param in the stream to read from
- *
- * @throws IOException if thrown by the stream
- * @throws ClassNotFoundException
- */
- private void readObject(ObjectInputStream in) throws IOException,
- ClassNotFoundException
- {
- // Read no fields.
- }
-
- /**
- * Write the object to the output stream.
- *
- * @param out the stream to write int
- * @throws IOException if thrown by the stream
- * @throws ClassNotFoundException
- */
- private void writeObject(ObjectOutputStream out) throws IOException,
- ClassNotFoundException
- {
- // Write no fields.
- };
-
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmid/ActivationSystemImpl_Stub.java b/libjava/classpath/tools/gnu/classpath/tools/rmi/rmid/ActivationSystemImpl_Stub.java
deleted file mode 100644
index 22fa10e4be2..00000000000
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmid/ActivationSystemImpl_Stub.java
+++ /dev/null
@@ -1,556 +0,0 @@
-/* ActivationSystemImpl.java -- implementation of the activation system.
- Copyright (c) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.classpath.tools.rmi.rmid;
-
-import java.rmi.MarshalledObject;
-import java.rmi.RemoteException;
-import java.rmi.activation.ActivationDesc;
-import java.rmi.activation.ActivationException;
-import java.rmi.activation.ActivationGroupDesc;
-import java.rmi.activation.ActivationGroupID;
-import java.rmi.activation.ActivationID;
-import java.rmi.activation.ActivationInstantiator;
-import java.rmi.activation.ActivationMonitor;
-import java.rmi.activation.ActivationSystem;
-import java.rmi.activation.Activator;
-import java.rmi.activation.UnknownGroupException;
-import java.rmi.activation.UnknownObjectException;
-
-import java.lang.reflect.Method;
-import java.rmi.server.RemoteRef;
-import java.rmi.server.RemoteStub;
-import java.rmi.UnexpectedException;
-
-/**
- * This class delegates its method calls to the remote RMI object, referenced
- * by {@link RemoteRef}.
- *
- * It is normally generated with rmic.
- */
-public final class ActivationSystemImpl_Stub
- extends RemoteStub
- implements ActivationMonitor, Activator, ActivationSystem
-{
- /**
- * Use serialVersionUID for interoperability
- */
- private static final long serialVersionUID = 2;
-
- /**
- * The explaining message for {@ling UnexpectedException}.
- */
- private static final String exception_message =
- "undeclared checked exception";
-
- /* All remote methods, invoked by this stub: */
- private static final Method met_setActivationGroupDesc;
- private static final Method met_inactiveGroup;
- private static final Method met_unregisterObject;
- private static final Method met_getActivationDesc;
- private static final Method met_setActivationDesc;
- private static final Method met_shutdown;
- private static final Method met_activate;
- private static final Method met_activeGroup;
- private static final Method met_registerGroup;
- private static final Method met_getActivationGroupDesc;
- private static final Method met_activeObject;
- private static final Method met_registerObject;
- private static final Method met_inactiveObject;
- private static final Method met_unregisterGroup;
- private static final Object[] NO_ARGS = new Object[0];
- static
- {
- final Class[] NO_ARGSc = new Class[0];
- try
- {
- met_setActivationGroupDesc =
- ActivationSystem.class.getMethod("setActivationGroupDesc", new Class[]
- {
- ActivationGroupID.class, ActivationGroupDesc.class
- });
- met_inactiveGroup =
- ActivationMonitor.class.getMethod("inactiveGroup", new Class[]
- {
- ActivationGroupID.class, long.class
- });
- met_unregisterObject =
- ActivationSystem.class.getMethod("unregisterObject", new Class[]
- {
- ActivationID.class
- });
- met_getActivationDesc =
- ActivationSystem.class.getMethod("getActivationDesc", new Class[]
- {
- ActivationID.class
- });
- met_setActivationDesc =
- ActivationSystem.class.getMethod("setActivationDesc", new Class[]
- {
- ActivationID.class, ActivationDesc.class
- });
- met_shutdown =
- ActivationSystem.class.getMethod("shutdown", NO_ARGSc);
- met_activate =
- Activator.class.getMethod("activate", new Class[]
- {
- ActivationID.class, boolean.class
- });
- met_activeGroup =
- ActivationSystem.class.getMethod("activeGroup", new Class[]
- {
- ActivationGroupID.class, ActivationInstantiator.class, long.class
- });
- met_registerGroup =
- ActivationSystem.class.getMethod("registerGroup", new Class[]
- {
- ActivationGroupDesc.class
- });
- met_getActivationGroupDesc =
- ActivationSystem.class.getMethod("getActivationGroupDesc", new Class[]
- {
- ActivationGroupID.class
- });
- met_activeObject =
- ActivationMonitor.class.getMethod("activeObject", new Class[]
- {
- ActivationID.class, MarshalledObject.class
- });
- met_registerObject =
- ActivationSystem.class.getMethod("registerObject", new Class[]
- {
- ActivationDesc.class
- });
- met_inactiveObject =
- ActivationMonitor.class.getMethod("inactiveObject", new Class[]
- {
- ActivationID.class
- });
- met_unregisterGroup =
- ActivationSystem.class.getMethod("unregisterGroup", new Class[]
- {
- ActivationGroupID.class
- });
-
- }
- catch (NoSuchMethodException nex)
- {
- NoSuchMethodError err = new NoSuchMethodError(
- "ActivationSystemImpl_Stub class initialization failed");
- err.initCause(nex);
- throw err;
- }
- }
-
- /**
- * Create the instance for _ActivationSystemImpl_Stub that forwards method calls to the
- * remote object.
- *
- * @para the reference to the remote object.
- */
- public ActivationSystemImpl_Stub(RemoteRef reference)
- {
- super(reference);
- }
-
- /* Methods */
- /** @inheritDoc */
- public ActivationGroupDesc setActivationGroupDesc(ActivationGroupID p0,
- ActivationGroupDesc p1)
- throws ActivationException, UnknownGroupException, RemoteException
- {
- try
- {
- Object result = ref.invoke(this, met_setActivationGroupDesc,
- new Object[] { p0, p1 },
- 1213918527826541191L);
- return (ActivationGroupDesc) result;
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public void inactiveGroup(ActivationGroupID p0, long p1)
- throws UnknownGroupException, RemoteException
- {
- try
- {
- ref.invoke(this, met_inactiveGroup, new Object[] { p0, new Long(p1) },
- -399287892768650944L);
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public void unregisterObject(ActivationID p0) throws ActivationException,
- UnknownObjectException, RemoteException
- {
- try
- {
- ref.invoke(this, met_unregisterObject, new Object[] { p0 },
- -6843850585331411084L);
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public ActivationDesc getActivationDesc(ActivationID p0)
- throws ActivationException, UnknownObjectException, RemoteException
- {
- try
- {
- Object result = ref.invoke(this, met_getActivationDesc,
- new Object[] { p0 }, 4830055440982622087L);
- return (ActivationDesc) result;
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public ActivationDesc setActivationDesc(ActivationID p0, ActivationDesc p1)
- throws ActivationException, UnknownObjectException,
- UnknownGroupException, RemoteException
- {
- try
- {
- Object result = ref.invoke(this, met_setActivationDesc,
- new Object[] { p0, p1 },
- 7128043237057180796L);
- return (ActivationDesc) result;
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public void shutdown() throws RemoteException
- {
- try
- {
- ref.invoke(this, met_shutdown, NO_ARGS, -7207851917985848402L);
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public MarshalledObject activate(ActivationID p0, boolean p1)
- throws ActivationException, UnknownObjectException, RemoteException
- {
- try
- {
- Object result = ref.invoke(this, met_activate,
- new Object[] { p0, new Boolean(p1) },
- -8767355154875805558L);
- return (MarshalledObject) result;
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public ActivationMonitor activeGroup(ActivationGroupID p0,
- ActivationInstantiator p1, long p2)
- throws UnknownGroupException, ActivationException, RemoteException
- {
- try
- {
- Object result = ref.invoke(this, met_activeGroup,
- new Object[] { p0, p1, new Long(p2) },
- -4575843150759415294L);
- return (ActivationMonitor) result;
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public ActivationGroupID registerGroup(ActivationGroupDesc p0)
- throws ActivationException, RemoteException
- {
- try
- {
- Object result = ref.invoke(this, met_registerGroup,
- new Object[] { p0 }, 6921515268192657754L);
- return (ActivationGroupID) result;
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public ActivationGroupDesc getActivationGroupDesc(ActivationGroupID p0)
- throws ActivationException, UnknownGroupException, RemoteException
- {
- try
- {
- Object result = ref.invoke(this, met_getActivationGroupDesc,
- new Object[] { p0 }, -8701843806548736528L);
- return (ActivationGroupDesc) result;
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public void activeObject(ActivationID p0, MarshalledObject p1)
- throws UnknownObjectException, RemoteException
- {
- try
- {
- ref.invoke(this, met_activeObject, new Object[] { p0, p1 },
- 2543984342209939736L);
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public ActivationID registerObject(ActivationDesc p0)
- throws ActivationException, UnknownGroupException, RemoteException
- {
- try
- {
- Object result = ref.invoke(this, met_registerObject,
- new Object[] { p0 }, -3006759798994351347L);
- return (ActivationID) result;
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public void inactiveObject(ActivationID p0) throws UnknownObjectException,
- RemoteException
- {
- try
- {
- ref.invoke(this, met_inactiveObject, new Object[] { p0 },
- -4165404120701281807L);
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
- /** @inheritDoc */
- public void unregisterGroup(ActivationGroupID p0) throws ActivationException,
- UnknownGroupException, RemoteException
- {
- try
- {
- ref.invoke(this, met_unregisterGroup, new Object[] { p0 },
- 3768097077835970701L);
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (RemoteException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- UnexpectedException uex = new UnexpectedException(exception_message);
- uex.detail = e;
- throw uex;
- }
- }
-
-
-}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/AbstractMethodGenerator.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/AbstractMethodGenerator.java
new file mode 100644
index 00000000000..492566a80f6
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/AbstractMethodGenerator.java
@@ -0,0 +1,53 @@
+/* AbstractMethodGenerator.java -- the abstract method generator
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.classpath.tools.rmic;
+
+public interface AbstractMethodGenerator
+{
+ /**
+ * Generate this method for the Stub (remote caller) class.
+ */
+ String generateStubMethod();
+
+ /**
+ * Generate this method for the Tie (remote servant) class.
+ */
+ String generateTieMethod();
+
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java
new file mode 100644
index 00000000000..9c50efa8ff9
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java
@@ -0,0 +1,1824 @@
+/* ClassRmicCompiler.java --
+ Copyright (c) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA. */
+
+package gnu.classpath.tools.rmic;
+
+import gnu.java.rmi.server.RMIHashes;
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.PrintWriter;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.rmi.MarshalException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.UnexpectedException;
+import java.rmi.UnmarshalException;
+import java.rmi.server.Operation;
+import java.rmi.server.RemoteCall;
+import java.rmi.server.RemoteObject;
+import java.rmi.server.RemoteRef;
+import java.rmi.server.RemoteStub;
+import java.rmi.server.Skeleton;
+import java.rmi.server.SkeletonMismatchException;
+import java.security.MessageDigest;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.Type;
+
+public class ClassRmicCompiler
+ implements RmicBackend
+{
+ private String[] args;
+ private int next;
+ private List errors = new ArrayList();
+ private boolean keep = false;
+ private boolean need11Stubs = true;
+ private boolean need12Stubs = true;
+ private boolean compile = true;
+ private boolean verbose;
+ private boolean noWrite;
+ private String destination;
+ private String classpath;
+ private ClassLoader loader;
+ private int errorCount = 0;
+
+ private Class clazz;
+ private String classname;
+ private String classInternalName;
+ private String fullclassname;
+ private MethodRef[] remotemethods;
+ private String stubname;
+ private String skelname;
+ private List mRemoteInterfaces;
+
+ /**
+ * @return true if run was successful
+ */
+ public boolean run(String[] inputFiles)
+ {
+ args = inputFiles;
+
+ if (next >= args.length)
+ return false;
+
+ for (int i = next; i < args.length; i++)
+ {
+ try
+ {
+ if (verbose)
+ System.out.println("[Processing class " + args[i] + ".class]");
+ processClass(args[i].replace(File.separatorChar, '.'));
+ }
+ catch (IOException e)
+ {
+ errors.add(e);
+ }
+ catch (RMICException e)
+ {
+ errors.add(e);
+ }
+ }
+ if (errors.size() > 0)
+ {
+ for (Iterator it = errors.iterator(); it.hasNext(); )
+ {
+ Exception ex = (Exception) it.next();
+ logError(ex);
+ }
+ }
+
+ return errorCount == 0;
+ }
+
+ private void processClass(String cls) throws IOException, RMICException
+ {
+ // reset class specific vars
+ clazz = null;
+ classname = null;
+ classInternalName = null;
+ fullclassname = null;
+ remotemethods = null;
+ stubname = null;
+ skelname = null;
+ mRemoteInterfaces = new ArrayList();
+
+ analyzeClass(cls);
+ generateStub();
+ if (need11Stubs)
+ generateSkel();
+ }
+
+ private void analyzeClass(String cname)
+ throws RMICException
+ {
+ if (verbose)
+ System.out.println("[analyze class " + cname + "]");
+ int p = cname.lastIndexOf('.');
+ if (p != -1)
+ classname = cname.substring(p + 1);
+ else
+ classname = cname;
+ fullclassname = cname;
+
+ findClass();
+ findRemoteMethods();
+ }
+
+ /**
+ * @deprecated
+ */
+ public Exception getException()
+ {
+ return errors.size() == 0 ? null : (Exception) errors.get(0);
+ }
+
+ private void findClass()
+ throws RMICException
+ {
+ ClassLoader cl = (loader == null
+ ? ClassLoader.getSystemClassLoader()
+ : loader);
+ try
+ {
+ clazz = Class.forName(fullclassname, false, cl);
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ throw new RMICException
+ ("Class " + fullclassname + " not found in classpath", cnfe);
+ }
+
+ if (! Remote.class.isAssignableFrom(clazz))
+ {
+ throw new RMICException
+ ("Class " + clazz.getName()
+ + " does not implement a remote interface.");
+ }
+ }
+
+ private static Type[] typeArray(Class[] cls)
+ {
+ Type[] t = new Type[cls.length];
+ for (int i = 0; i < cls.length; i++)
+ {
+ t[i] = Type.getType(cls[i]);
+ }
+
+ return t;
+ }
+
+ private static String[] internalNameArray(Type[] t)
+ {
+ String[] s = new String[t.length];
+ for (int i = 0; i < t.length; i++)
+ {
+ s[i] = t[i].getInternalName();
+ }
+
+ return s;
+ }
+
+ private static String[] internalNameArray(Class[] c)
+ {
+ return internalNameArray(typeArray(c));
+ }
+
+ private static final String forName = "class$";
+
+ private static Object param(Method m, int argIndex)
+ {
+ List l = new ArrayList();
+ l.add(m);
+ l.add(new Integer(argIndex));
+ return l;
+ }
+
+ private static void generateClassForNamer(ClassVisitor cls)
+ {
+ MethodVisitor cv =
+ cls.visitMethod
+ (Opcodes.ACC_PRIVATE + Opcodes.ACC_STATIC + Opcodes.ACC_SYNTHETIC, forName,
+ Type.getMethodDescriptor
+ (Type.getType(Class.class), new Type[] { Type.getType(String.class) }),
+ null, null);
+
+ Label start = new Label();
+ cv.visitLabel(start);
+ cv.visitVarInsn(Opcodes.ALOAD, 0);
+ cv.visitMethodInsn
+ (Opcodes.INVOKESTATIC,
+ Type.getInternalName(Class.class),
+ "forName",
+ Type.getMethodDescriptor
+ (Type.getType(Class.class), new Type[] { Type.getType(String.class) }));
+ cv.visitInsn(Opcodes.ARETURN);
+
+ Label handler = new Label();
+ cv.visitLabel(handler);
+ cv.visitVarInsn(Opcodes.ASTORE, 1);
+ cv.visitTypeInsn(Opcodes.NEW, typeArg(NoClassDefFoundError.class));
+ cv.visitInsn(Opcodes.DUP);
+ cv.visitVarInsn(Opcodes.ALOAD, 1);
+ cv.visitMethodInsn
+ (Opcodes.INVOKEVIRTUAL,
+ Type.getInternalName(ClassNotFoundException.class),
+ "getMessage",
+ Type.getMethodDescriptor(Type.getType(String.class), new Type[] {}));
+ cv.visitMethodInsn
+ (Opcodes.INVOKESPECIAL,
+ Type.getInternalName(NoClassDefFoundError.class),
+ "<init>",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE, new Type[] { Type.getType(String.class) }));
+ cv.visitInsn(Opcodes.ATHROW);
+ cv.visitTryCatchBlock
+ (start, handler, handler,
+ Type.getInternalName(ClassNotFoundException.class));
+ cv.visitMaxs(-1, -1);
+ }
+
+ private void generateClassConstant(MethodVisitor cv, Class cls) {
+ if (cls.isPrimitive())
+ {
+ Class boxCls;
+ if (cls.equals(Boolean.TYPE))
+ boxCls = Boolean.class;
+ else if (cls.equals(Character.TYPE))
+ boxCls = Character.class;
+ else if (cls.equals(Byte.TYPE))
+ boxCls = Byte.class;
+ else if (cls.equals(Short.TYPE))
+ boxCls = Short.class;
+ else if (cls.equals(Integer.TYPE))
+ boxCls = Integer.class;
+ else if (cls.equals(Long.TYPE))
+ boxCls = Long.class;
+ else if (cls.equals(Float.TYPE))
+ boxCls = Float.class;
+ else if (cls.equals(Double.TYPE))
+ boxCls = Double.class;
+ else if (cls.equals(Void.TYPE))
+ boxCls = Void.class;
+ else
+ throw new IllegalArgumentException("unknown primitive type " + cls);
+
+ cv.visitFieldInsn
+ (Opcodes.GETSTATIC, Type.getInternalName(boxCls), "TYPE",
+ Type.getDescriptor(Class.class));
+ return;
+ }
+ cv.visitLdcInsn(cls.getName());
+ cv.visitMethodInsn
+ (Opcodes.INVOKESTATIC, classInternalName, forName,
+ Type.getMethodDescriptor
+ (Type.getType(Class.class),
+ new Type[] { Type.getType(String.class) }));
+ }
+
+ private void generateClassArray(MethodVisitor code, Class[] classes)
+ {
+ code.visitLdcInsn(new Integer(classes.length));
+ code.visitTypeInsn(Opcodes.ANEWARRAY, typeArg(Class.class));
+ for (int i = 0; i < classes.length; i++)
+ {
+ code.visitInsn(Opcodes.DUP);
+ code.visitLdcInsn(new Integer(i));
+ generateClassConstant(code, classes[i]);
+ code.visitInsn(Opcodes.AASTORE);
+ }
+ }
+
+ private void fillOperationArray(MethodVisitor clinit)
+ {
+ // Operations array
+ clinit.visitLdcInsn(new Integer(remotemethods.length));
+ clinit.visitTypeInsn(Opcodes.ANEWARRAY, typeArg(Operation.class));
+ clinit.visitFieldInsn
+ (Opcodes.PUTSTATIC, classInternalName, "operations",
+ Type.getDescriptor(Operation[].class));
+
+ for (int i = 0; i < remotemethods.length; i++)
+ {
+ Method m = remotemethods[i].meth;
+
+ StringBuffer desc = new StringBuffer();
+ desc.append(getPrettyName(m.getReturnType()) + " ");
+ desc.append(m.getName() + "(");
+
+ // signature
+ Class[] sig = m.getParameterTypes();
+ for (int j = 0; j < sig.length; j++)
+ {
+ desc.append(getPrettyName(sig[j]));
+ if (j + 1 < sig.length)
+ desc.append(", ");
+ }
+
+ // push operations array
+ clinit.visitFieldInsn
+ (Opcodes.GETSTATIC, classInternalName, "operations",
+ Type.getDescriptor(Operation[].class));
+
+ // push array index
+ clinit.visitLdcInsn(new Integer(i));
+
+ // instantiate operation and leave a copy on the stack
+ clinit.visitTypeInsn(Opcodes.NEW, typeArg(Operation.class));
+ clinit.visitInsn(Opcodes.DUP);
+ clinit.visitLdcInsn(desc.toString());
+ clinit.visitMethodInsn
+ (Opcodes.INVOKESPECIAL,
+ Type.getInternalName(Operation.class),
+ "<init>",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE, new Type[] { Type.getType(String.class) }));
+
+ // store in operations array
+ clinit.visitInsn(Opcodes.AASTORE);
+ }
+ }
+
+ private void generateStaticMethodObjs(MethodVisitor clinit)
+ {
+ for (int i = 0; i < remotemethods.length; i++)
+ {
+ Method m = remotemethods[i].meth;
+
+ /*
+ * $method_<i>m.getName()</i>_<i>i</i> =
+ * <i>m.getDeclaringClass()</i>.class.getMethod
+ * (m.getName(), m.getParameterType())
+ */
+ String methodVar = "$method_" + m.getName() + "_" + i;
+ generateClassConstant(clinit, m.getDeclaringClass());
+ clinit.visitLdcInsn(m.getName());
+ generateClassArray(clinit, m.getParameterTypes());
+ clinit.visitMethodInsn
+ (Opcodes.INVOKEVIRTUAL,
+ Type.getInternalName(Class.class),
+ "getMethod",
+ Type.getMethodDescriptor
+ (Type.getType(Method.class),
+ new Type[] { Type.getType(String.class),
+ Type.getType(Class[].class) }));
+
+ clinit.visitFieldInsn
+ (Opcodes.PUTSTATIC, classInternalName, methodVar,
+ Type.getDescriptor(Method.class));
+ }
+ }
+
+ private void generateStub()
+ throws IOException
+ {
+ stubname = fullclassname + "_Stub";
+ String stubclassname = classname + "_Stub";
+ File file = new File((destination == null ? "." : destination)
+ + File.separator
+ + stubname.replace('.', File.separatorChar)
+ + ".class");
+
+ if (verbose)
+ System.out.println("[Generating class " + stubname + "]");
+
+ final ClassWriter stub = new ClassWriter(true);
+ classInternalName = stubname.replace('.', '/');
+ final String superInternalName =
+ Type.getType(RemoteStub.class).getInternalName();
+
+ String[] remoteInternalNames =
+ internalNameArray((Class[]) mRemoteInterfaces.toArray(new Class[] {}));
+ stub.visit
+ (Opcodes.V1_2, Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL, classInternalName,
+ null, superInternalName, remoteInternalNames);
+
+ if (need12Stubs)
+ {
+ stub.visitField
+ (Opcodes.ACC_PRIVATE + Opcodes.ACC_STATIC + Opcodes.ACC_FINAL, "serialVersionUID",
+ Type.LONG_TYPE.getDescriptor(), null, new Long(2L));
+ }
+
+ if (need11Stubs)
+ {
+ stub.visitField
+ (Opcodes.ACC_PRIVATE + Opcodes.ACC_STATIC + Opcodes.ACC_FINAL,
+ "interfaceHash", Type.LONG_TYPE.getDescriptor(), null,
+ new Long(RMIHashes.getInterfaceHash(clazz)));
+
+ if (need12Stubs)
+ {
+ stub.visitField
+ (Opcodes.ACC_PRIVATE + Opcodes.ACC_STATIC, "useNewInvoke",
+ Type.BOOLEAN_TYPE.getDescriptor(), null, null);
+ }
+
+ stub.visitField
+ (Opcodes.ACC_PRIVATE + Opcodes.ACC_STATIC + Opcodes.ACC_FINAL,
+ "operations", Type.getDescriptor(Operation[].class), null, null);
+ }
+
+ // Set of method references.
+ if (need12Stubs)
+ {
+ for (int i = 0; i < remotemethods.length; i++)
+ {
+ Method m = remotemethods[i].meth;
+ String slotName = "$method_" + m.getName() + "_" + i;
+ stub.visitField
+ (Opcodes.ACC_PRIVATE + Opcodes.ACC_STATIC, slotName,
+ Type.getDescriptor(Method.class), null, null);
+ }
+ }
+
+ MethodVisitor clinit = stub.visitMethod
+ (Opcodes.ACC_STATIC, "<clinit>",
+ Type.getMethodDescriptor(Type.VOID_TYPE, new Type[] {}), null, null);
+
+ if (need11Stubs)
+ {
+ fillOperationArray(clinit);
+ if (! need12Stubs)
+ clinit.visitInsn(Opcodes.RETURN);
+ }
+
+ if (need12Stubs)
+ {
+ // begin of try
+ Label begin = new Label();
+
+ // beginning of catch
+ Label handler = new Label();
+ clinit.visitLabel(begin);
+
+ // Initialize the methods references.
+ if (need11Stubs)
+ {
+ /*
+ * RemoteRef.class.getMethod("invoke", new Class[] {
+ * Remote.class, Method.class, Object[].class, long.class })
+ */
+ generateClassConstant(clinit, RemoteRef.class);
+ clinit.visitLdcInsn("invoke");
+ generateClassArray
+ (clinit, new Class[] { Remote.class, Method.class,
+ Object[].class, long.class });
+ clinit.visitMethodInsn
+ (Opcodes.INVOKEVIRTUAL,
+ Type.getInternalName(Class.class),
+ "getMethod",
+ Type.getMethodDescriptor
+ (Type.getType(Method.class),
+ new Type[] { Type.getType(String.class),
+ Type.getType(Class[].class) }));
+
+ // useNewInvoke = true
+ clinit.visitInsn(Opcodes.ICONST_1);
+ clinit.visitFieldInsn
+ (Opcodes.PUTSTATIC, classInternalName, "useNewInvoke",
+ Type.BOOLEAN_TYPE.getDescriptor());
+ }
+
+ generateStaticMethodObjs(clinit);
+
+ // jump past handler
+ clinit.visitInsn(Opcodes.RETURN);
+ clinit.visitLabel(handler);
+ if (need11Stubs)
+ {
+ // useNewInvoke = false
+ clinit.visitInsn(Opcodes.ICONST_0);
+ clinit.visitFieldInsn
+ (Opcodes.PUTSTATIC, classInternalName, "useNewInvoke",
+ Type.BOOLEAN_TYPE.getDescriptor());
+ clinit.visitInsn(Opcodes.RETURN);
+ }
+ else
+ {
+ // throw NoSuchMethodError
+ clinit.visitTypeInsn(Opcodes.NEW, typeArg(NoSuchMethodError.class));
+ clinit.visitInsn(Opcodes.DUP);
+ clinit.visitLdcInsn("stub class initialization failed");
+ clinit.visitMethodInsn
+ (Opcodes.INVOKESPECIAL,
+ Type.getInternalName(NoSuchMethodError.class),
+ "<init>",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE,
+ new Type[] { Type.getType(String.class) }));
+ clinit.visitInsn(Opcodes.ATHROW);
+ }
+
+ clinit.visitTryCatchBlock
+ (begin, handler, handler,
+ Type.getInternalName(NoSuchMethodException.class));
+
+ }
+
+ clinit.visitMaxs(-1, -1);
+
+ generateClassForNamer(stub);
+
+ // Constructors
+ if (need11Stubs)
+ {
+ // no arg public constructor
+ MethodVisitor code = stub.visitMethod
+ (Opcodes.ACC_PUBLIC, "<init>",
+ Type.getMethodDescriptor(Type.VOID_TYPE, new Type[] {}),
+ null, null);
+ code.visitVarInsn(Opcodes.ALOAD, 0);
+ code.visitMethodInsn
+ (Opcodes.INVOKESPECIAL, superInternalName, "<init>",
+ Type.getMethodDescriptor(Type.VOID_TYPE, new Type[] {}));
+ code.visitInsn(Opcodes.RETURN);
+
+ code.visitMaxs(-1, -1);
+ }
+
+ // public RemoteRef constructor
+ MethodVisitor constructor = stub.visitMethod
+ (Opcodes.ACC_PUBLIC, "<init>",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE, new Type[] {Type.getType(RemoteRef.class)}),
+ null, null);
+ constructor.visitVarInsn(Opcodes.ALOAD, 0);
+ constructor.visitVarInsn(Opcodes.ALOAD, 1);
+ constructor.visitMethodInsn
+ (Opcodes.INVOKESPECIAL, superInternalName, "<init>",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE, new Type[] {Type.getType(RemoteRef.class)}));
+ constructor.visitInsn(Opcodes.RETURN);
+ constructor.visitMaxs(-1, -1);
+
+ // Method implementations
+ for (int i = 0; i < remotemethods.length; i++)
+ {
+ Method m = remotemethods[i].meth;
+ Class[] sig = m.getParameterTypes();
+ Class returntype = m.getReturnType();
+ Class[] except = sortExceptions
+ ((Class[]) remotemethods[i].exceptions.toArray(new Class[0]));
+
+ MethodVisitor code = stub.visitMethod
+ (Opcodes.ACC_PUBLIC,
+ m.getName(),
+ Type.getMethodDescriptor(Type.getType(returntype), typeArray(sig)),
+ null,
+ internalNameArray(typeArray(except)));
+
+ final Variables var = new Variables();
+
+ // this and parameters are the declared vars
+ var.declare("this");
+ for (int j = 0; j < sig.length; j++)
+ var.declare(param(m, j), size(sig[j]));
+
+ Label methodTryBegin = new Label();
+ code.visitLabel(methodTryBegin);
+
+ if (need12Stubs)
+ {
+ Label oldInvoke = new Label();
+ if (need11Stubs)
+ {
+ // if not useNewInvoke jump to old invoke
+ code.visitFieldInsn
+ (Opcodes.GETSTATIC, classInternalName, "useNewInvoke",
+ Type.getDescriptor(boolean.class));
+ code.visitJumpInsn(Opcodes.IFEQ, oldInvoke);
+ }
+
+ // this.ref
+ code.visitVarInsn(Opcodes.ALOAD, var.get("this"));
+ code.visitFieldInsn
+ (Opcodes.GETFIELD, Type.getInternalName(RemoteObject.class),
+ "ref", Type.getDescriptor(RemoteRef.class));
+
+ // "this" is first arg to invoke
+ code.visitVarInsn(Opcodes.ALOAD, var.get("this"));
+
+ // method object is second arg to invoke
+ String methName = "$method_" + m.getName() + "_" + i;
+ code.visitFieldInsn
+ (Opcodes.GETSTATIC, classInternalName, methName,
+ Type.getDescriptor(Method.class));
+
+ // args to remote method are third arg to invoke
+ if (sig.length == 0)
+ code.visitInsn(Opcodes.ACONST_NULL);
+ else
+ {
+ // create arg Object[] (with boxed primitives) and push it
+ code.visitLdcInsn(new Integer(sig.length));
+ code.visitTypeInsn(Opcodes.ANEWARRAY, typeArg(Object.class));
+
+ var.allocate("argArray");
+ code.visitVarInsn(Opcodes.ASTORE, var.get("argArray"));
+
+ for (int j = 0; j < sig.length; j++)
+ {
+ int size = size(sig[j]);
+ int insn = loadOpcode(sig[j]);
+ Class box = sig[j].isPrimitive() ? box(sig[j]) : null;
+
+ code.visitVarInsn(Opcodes.ALOAD, var.get("argArray"));
+ code.visitLdcInsn(new Integer(j));
+
+ // put argument on stack
+ if (box != null)
+ {
+ code.visitTypeInsn(Opcodes.NEW, typeArg(box));
+ code.visitInsn(Opcodes.DUP);
+ code.visitVarInsn(insn, var.get(param(m, j)));
+ code.visitMethodInsn
+ (Opcodes.INVOKESPECIAL,
+ Type.getInternalName(box),
+ "<init>",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE,
+ new Type[] { Type.getType(sig[j]) }));
+ }
+ else
+ code.visitVarInsn(insn, var.get(param(m, j)));
+
+ code.visitInsn(Opcodes.AASTORE);
+ }
+
+ code.visitVarInsn(Opcodes.ALOAD, var.deallocate("argArray"));
+ }
+
+ // push remote operation opcode
+ code.visitLdcInsn(new Long(remotemethods[i].hash));
+ code.visitMethodInsn
+ (Opcodes.INVOKEINTERFACE,
+ Type.getInternalName(RemoteRef.class),
+ "invoke",
+ Type.getMethodDescriptor
+ (Type.getType(Object.class),
+ new Type[] { Type.getType(Remote.class),
+ Type.getType(Method.class),
+ Type.getType(Object[].class),
+ Type.LONG_TYPE }));
+
+ if (! returntype.equals(Void.TYPE))
+ {
+ int retcode = returnOpcode(returntype);
+ Class boxCls =
+ returntype.isPrimitive() ? box(returntype) : null;
+ code.visitTypeInsn
+ (Opcodes.CHECKCAST, typeArg(boxCls == null ? returntype : boxCls));
+ if (returntype.isPrimitive())
+ {
+ // unbox
+ code.visitMethodInsn
+ (Opcodes.INVOKEVIRTUAL,
+ Type.getType(boxCls).getInternalName(),
+ unboxMethod(returntype),
+ Type.getMethodDescriptor
+ (Type.getType(returntype), new Type[] {}));
+ }
+
+ code.visitInsn(retcode);
+ }
+ else
+ code.visitInsn(Opcodes.RETURN);
+
+
+ if (need11Stubs)
+ code.visitLabel(oldInvoke);
+ }
+
+ if (need11Stubs)
+ {
+
+ // this.ref.newCall(this, operations, index, interfaceHash)
+ code.visitVarInsn(Opcodes.ALOAD, var.get("this"));
+ code.visitFieldInsn
+ (Opcodes.GETFIELD,
+ Type.getInternalName(RemoteObject.class),
+ "ref",
+ Type.getDescriptor(RemoteRef.class));
+
+ // "this" is first arg to newCall
+ code.visitVarInsn(Opcodes.ALOAD, var.get("this"));
+
+ // operations is second arg to newCall
+ code.visitFieldInsn
+ (Opcodes.GETSTATIC, classInternalName, "operations",
+ Type.getDescriptor(Operation[].class));
+
+ // method index is third arg
+ code.visitLdcInsn(new Integer(i));
+
+ // interface hash is fourth arg
+ code.visitFieldInsn
+ (Opcodes.GETSTATIC, classInternalName, "interfaceHash",
+ Type.LONG_TYPE.getDescriptor());
+
+ code.visitMethodInsn
+ (Opcodes.INVOKEINTERFACE,
+ Type.getInternalName(RemoteRef.class),
+ "newCall",
+ Type.getMethodDescriptor
+ (Type.getType(RemoteCall.class),
+ new Type[] { Type.getType(RemoteObject.class),
+ Type.getType(Operation[].class),
+ Type.INT_TYPE,
+ Type.LONG_TYPE }));
+
+ // store call object on stack and leave copy on stack
+ var.allocate("call");
+ code.visitInsn(Opcodes.DUP);
+ code.visitVarInsn(Opcodes.ASTORE, var.get("call"));
+
+ Label beginArgumentTryBlock = new Label();
+ code.visitLabel(beginArgumentTryBlock);
+
+ // ObjectOutput out = call.getOutputStream();
+ code.visitMethodInsn
+ (Opcodes.INVOKEINTERFACE,
+ Type.getInternalName(RemoteCall.class),
+ "getOutputStream",
+ Type.getMethodDescriptor
+ (Type.getType(ObjectOutput.class), new Type[] {}));
+
+ for (int j = 0; j < sig.length; j++)
+ {
+ // dup the ObjectOutput
+ code.visitInsn(Opcodes.DUP);
+
+ // get j'th arg to remote method
+ code.visitVarInsn(loadOpcode(sig[j]), var.get(param(m, j)));
+
+ Class argCls =
+ sig[j].isPrimitive() ? sig[j] : Object.class;
+
+ // out.writeFoo
+ code.visitMethodInsn
+ (Opcodes.INVOKEINTERFACE,
+ Type.getInternalName(ObjectOutput.class),
+ writeMethod(sig[j]),
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE,
+ new Type[] { Type.getType(argCls) }));
+ }
+
+ // pop ObjectOutput
+ code.visitInsn(Opcodes.POP);
+
+ Label iohandler = new Label();
+ Label endArgumentTryBlock = new Label();
+ code.visitJumpInsn(Opcodes.GOTO, endArgumentTryBlock);
+ code.visitLabel(iohandler);
+
+ // throw new MarshalException(msg, ioexception);
+ code.visitVarInsn(Opcodes.ASTORE, var.allocate("exception"));
+ code.visitTypeInsn(Opcodes.NEW, typeArg(MarshalException.class));
+ code.visitInsn(Opcodes.DUP);
+ code.visitLdcInsn("error marshalling arguments");
+ code.visitVarInsn(Opcodes.ALOAD, var.deallocate("exception"));
+ code.visitMethodInsn
+ (Opcodes.INVOKESPECIAL,
+ Type.getInternalName(MarshalException.class),
+ "<init>",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE,
+ new Type[] { Type.getType(String.class),
+ Type.getType(Exception.class) }));
+ code.visitInsn(Opcodes.ATHROW);
+
+ code.visitLabel(endArgumentTryBlock);
+ code.visitTryCatchBlock
+ (beginArgumentTryBlock, iohandler, iohandler,
+ Type.getInternalName(IOException.class));
+
+ // this.ref.invoke(call)
+ code.visitVarInsn(Opcodes.ALOAD, var.get("this"));
+ code.visitFieldInsn
+ (Opcodes.GETFIELD, Type.getInternalName(RemoteObject.class),
+ "ref", Type.getDescriptor(RemoteRef.class));
+ code.visitVarInsn(Opcodes.ALOAD, var.get("call"));
+ code.visitMethodInsn
+ (Opcodes.INVOKEINTERFACE,
+ Type.getInternalName(RemoteRef.class),
+ "invoke",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE,
+ new Type[] { Type.getType(RemoteCall.class) }));
+
+ // handle return value
+ boolean needcastcheck = false;
+
+ Label beginReturnTryCatch = new Label();
+ code.visitLabel(beginReturnTryCatch);
+
+ int returncode = returnOpcode(returntype);
+
+ if (! returntype.equals(Void.TYPE))
+ {
+ // call.getInputStream()
+ code.visitVarInsn(Opcodes.ALOAD, var.get("call"));
+ code.visitMethodInsn
+ (Opcodes.INVOKEINTERFACE,
+ Type.getInternalName(RemoteCall.class),
+ "getInputStream",
+ Type.getMethodDescriptor
+ (Type.getType(ObjectInput.class), new Type[] {}));
+
+ Class readCls =
+ returntype.isPrimitive() ? returntype : Object.class;
+ code.visitMethodInsn
+ (Opcodes.INVOKEINTERFACE,
+ Type.getInternalName(ObjectInput.class),
+ readMethod(returntype),
+ Type.getMethodDescriptor
+ (Type.getType(readCls), new Type[] {}));
+
+ boolean castresult = false;
+
+ if (! returntype.isPrimitive())
+ {
+ if (! returntype.equals(Object.class))
+ castresult = true;
+ else
+ needcastcheck = true;
+ }
+
+ if (castresult)
+ code.visitTypeInsn(Opcodes.CHECKCAST, typeArg(returntype));
+
+ // leave result on stack for return
+ }
+
+ // this.ref.done(call)
+ code.visitVarInsn(Opcodes.ALOAD, var.get("this"));
+ code.visitFieldInsn
+ (Opcodes.GETFIELD,
+ Type.getInternalName(RemoteObject.class),
+ "ref",
+ Type.getDescriptor(RemoteRef.class));
+ code.visitVarInsn(Opcodes.ALOAD, var.deallocate("call"));
+ code.visitMethodInsn
+ (Opcodes.INVOKEINTERFACE,
+ Type.getInternalName(RemoteRef.class),
+ "done",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE,
+ new Type[] { Type.getType(RemoteCall.class) }));
+
+ // return; or return result;
+ code.visitInsn(returncode);
+
+ // exception handler
+ Label handler = new Label();
+ code.visitLabel(handler);
+ code.visitVarInsn(Opcodes.ASTORE, var.allocate("exception"));
+
+ // throw new UnmarshalException(msg, e)
+ code.visitTypeInsn(Opcodes.NEW, typeArg(UnmarshalException.class));
+ code.visitInsn(Opcodes.DUP);
+ code.visitLdcInsn("error unmarshalling return");
+ code.visitVarInsn(Opcodes.ALOAD, var.deallocate("exception"));
+ code.visitMethodInsn
+ (Opcodes.INVOKESPECIAL,
+ Type.getInternalName(UnmarshalException.class),
+ "<init>",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE,
+ new Type[] { Type.getType(String.class),
+ Type.getType(Exception.class) }));
+ code.visitInsn(Opcodes.ATHROW);
+
+ Label endReturnTryCatch = new Label();
+
+ // catch IOException
+ code.visitTryCatchBlock
+ (beginReturnTryCatch, handler, handler,
+ Type.getInternalName(IOException.class));
+
+ if (needcastcheck)
+ {
+ // catch ClassNotFoundException
+ code.visitTryCatchBlock
+ (beginReturnTryCatch, handler, handler,
+ Type.getInternalName(ClassNotFoundException.class));
+ }
+ }
+
+ Label rethrowHandler = new Label();
+ code.visitLabel(rethrowHandler);
+ // rethrow declared exceptions
+ code.visitInsn(Opcodes.ATHROW);
+
+ boolean needgeneral = true;
+ for (int j = 0; j < except.length; j++)
+ {
+ if (except[j] == Exception.class)
+ needgeneral = false;
+ }
+
+ for (int j = 0; j < except.length; j++)
+ {
+ code.visitTryCatchBlock
+ (methodTryBegin, rethrowHandler, rethrowHandler,
+ Type.getInternalName(except[j]));
+ }
+
+ if (needgeneral)
+ {
+ // rethrow unchecked exceptions
+ code.visitTryCatchBlock
+ (methodTryBegin, rethrowHandler, rethrowHandler,
+ Type.getInternalName(RuntimeException.class));
+
+ Label generalHandler = new Label();
+ code.visitLabel(generalHandler);
+ String msg = "undeclared checked exception";
+
+ // throw new java.rmi.UnexpectedException(msg, e)
+ code.visitVarInsn(Opcodes.ASTORE, var.allocate("exception"));
+ code.visitTypeInsn(Opcodes.NEW, typeArg(UnexpectedException.class));
+ code.visitInsn(Opcodes.DUP);
+ code.visitLdcInsn(msg);
+ code.visitVarInsn(Opcodes.ALOAD, var.deallocate("exception"));
+ code.visitMethodInsn
+ (Opcodes.INVOKESPECIAL,
+ Type.getInternalName(UnexpectedException.class),
+ "<init>",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE,
+ new Type [] { Type.getType(String.class),
+ Type.getType(Exception.class) }));
+ code.visitInsn(Opcodes.ATHROW);
+
+ code.visitTryCatchBlock
+ (methodTryBegin, rethrowHandler, generalHandler,
+ Type.getInternalName(Exception.class));
+ }
+
+ code.visitMaxs(-1, -1);
+ }
+
+ stub.visitEnd();
+ byte[] classData = stub.toByteArray();
+ if (!noWrite)
+ {
+ if (file.exists())
+ file.delete();
+ if (file.getParentFile() != null)
+ file.getParentFile().mkdirs();
+ FileOutputStream fos = new FileOutputStream(file);
+ fos.write(classData);
+ fos.flush();
+ fos.close();
+ }
+ }
+
+ private void generateSkel() throws IOException
+ {
+ skelname = fullclassname + "_Skel";
+ String skelclassname = classname + "_Skel";
+ File file = new File(destination == null ? "" : destination
+ + File.separator
+ + skelname.replace('.', File.separatorChar)
+ + ".class");
+ if (verbose)
+ System.out.println("[Generating class " + skelname + "]");
+
+ final ClassWriter skel = new ClassWriter(true);
+ classInternalName = skelname.replace('.', '/');
+ skel.visit
+ (Opcodes.V1_1, Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL,
+ classInternalName, Type.getInternalName(Object.class), null,
+ new String[] { Type.getType(Skeleton.class).getInternalName() });
+
+ skel.visitField
+ (Opcodes.ACC_PRIVATE + Opcodes.ACC_STATIC + Opcodes.ACC_FINAL, "interfaceHash",
+ Type.LONG_TYPE.getDescriptor(), null,
+ new Long(RMIHashes.getInterfaceHash(clazz)));
+
+ skel.visitField
+ (Opcodes.ACC_PRIVATE + Opcodes.ACC_STATIC + Opcodes.ACC_FINAL, "operations",
+ Type.getDescriptor(Operation[].class), null, null);
+
+ MethodVisitor clinit = skel.visitMethod
+ (Opcodes.ACC_STATIC, "<clinit>",
+ Type.getMethodDescriptor(Type.VOID_TYPE, new Type[] {}), null, null);
+
+ fillOperationArray(clinit);
+ clinit.visitInsn(Opcodes.RETURN);
+
+ clinit.visitMaxs(-1, -1);
+
+ // no arg public constructor
+ MethodVisitor init = skel.visitMethod
+ (Opcodes.ACC_PUBLIC, "<init>",
+ Type.getMethodDescriptor(Type.VOID_TYPE, new Type[] {}), null, null);
+ init.visitVarInsn(Opcodes.ALOAD, 0);
+ init.visitMethodInsn
+ (Opcodes.INVOKESPECIAL, Type.getInternalName(Object.class), "<init>",
+ Type.getMethodDescriptor(Type.VOID_TYPE, new Type[] {}));
+ init.visitInsn(Opcodes.RETURN);
+ init.visitMaxs(-1, -1);
+
+ /*
+ * public Operation[] getOperations()
+ * returns a clone of the operations array
+ */
+ MethodVisitor getOp = skel.visitMethod
+ (Opcodes.ACC_PUBLIC, "getOperations",
+ Type.getMethodDescriptor
+ (Type.getType(Operation[].class), new Type[] {}),
+ null, null);
+ getOp.visitFieldInsn
+ (Opcodes.GETSTATIC, classInternalName, "operations",
+ Type.getDescriptor(Operation[].class));
+ getOp.visitMethodInsn
+ (Opcodes.INVOKEVIRTUAL, Type.getInternalName(Object.class),
+ "clone", Type.getMethodDescriptor(Type.getType(Object.class),
+ new Type[] {}));
+ getOp.visitTypeInsn(Opcodes.CHECKCAST, typeArg(Operation[].class));
+ getOp.visitInsn(Opcodes.ARETURN);
+ getOp.visitMaxs(-1, -1);
+
+ // public void dispatch(Remote, RemoteCall, int opnum, long hash)
+ MethodVisitor dispatch = skel.visitMethod
+ (Opcodes.ACC_PUBLIC,
+ "dispatch",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE,
+ new Type[] { Type.getType(Remote.class),
+ Type.getType(RemoteCall.class),
+ Type.INT_TYPE, Type.LONG_TYPE }), null,
+ new String[] { Type.getInternalName(Exception.class) });
+
+ Variables var = new Variables();
+ var.declare("this");
+ var.declare("remoteobj");
+ var.declare("remotecall");
+ var.declare("opnum");
+ var.declareWide("hash");
+
+ /*
+ * if opnum >= 0
+ * XXX it is unclear why there is handling of negative opnums
+ */
+ dispatch.visitVarInsn(Opcodes.ILOAD, var.get("opnum"));
+ Label nonNegativeOpnum = new Label();
+ Label opnumSet = new Label();
+ dispatch.visitJumpInsn(Opcodes.IFGE, nonNegativeOpnum);
+
+ for (int i = 0; i < remotemethods.length; i++)
+ {
+ // assign opnum if hash matches supplied hash
+ dispatch.visitVarInsn(Opcodes.LLOAD, var.get("hash"));
+ dispatch.visitLdcInsn(new Long(remotemethods[i].hash));
+ Label notIt = new Label();
+ dispatch.visitInsn(Opcodes.LCMP);
+ dispatch.visitJumpInsn(Opcodes.IFNE, notIt);
+
+ // opnum = <opnum>
+ dispatch.visitLdcInsn(new Integer(i));
+ dispatch.visitVarInsn(Opcodes.ISTORE, var.get("opnum"));
+ dispatch.visitJumpInsn(Opcodes.GOTO, opnumSet);
+ dispatch.visitLabel(notIt);
+ }
+
+ // throw new SkeletonMismatchException
+ Label mismatch = new Label();
+ dispatch.visitJumpInsn(Opcodes.GOTO, mismatch);
+
+ dispatch.visitLabel(nonNegativeOpnum);
+
+ // if opnum is already set, check that the hash matches the interface
+ dispatch.visitVarInsn(Opcodes.LLOAD, var.get("hash"));
+ dispatch.visitFieldInsn
+ (Opcodes.GETSTATIC, classInternalName,
+ "interfaceHash", Type.LONG_TYPE.getDescriptor());
+ dispatch.visitInsn(Opcodes.LCMP);
+ dispatch.visitJumpInsn(Opcodes.IFEQ, opnumSet);
+
+ dispatch.visitLabel(mismatch);
+ dispatch.visitTypeInsn
+ (Opcodes.NEW, typeArg(SkeletonMismatchException.class));
+ dispatch.visitInsn(Opcodes.DUP);
+ dispatch.visitLdcInsn("interface hash mismatch");
+ dispatch.visitMethodInsn
+ (Opcodes.INVOKESPECIAL,
+ Type.getInternalName(SkeletonMismatchException.class),
+ "<init>",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE, new Type[] { Type.getType(String.class) }));
+ dispatch.visitInsn(Opcodes.ATHROW);
+
+ // opnum has been set
+ dispatch.visitLabel(opnumSet);
+
+ dispatch.visitVarInsn(Opcodes.ALOAD, var.get("remoteobj"));
+ dispatch.visitTypeInsn(Opcodes.CHECKCAST, typeArg(clazz));
+ dispatch.visitVarInsn(Opcodes.ASTORE, var.get("remoteobj"));
+
+ Label deflt = new Label();
+ Label[] methLabels = new Label[remotemethods.length];
+ for (int i = 0; i < methLabels.length; i++)
+ methLabels[i] = new Label();
+
+ // switch on opnum
+ dispatch.visitVarInsn(Opcodes.ILOAD, var.get("opnum"));
+ dispatch.visitTableSwitchInsn
+ (0, remotemethods.length - 1, deflt, methLabels);
+
+ // Method dispatch
+ for (int i = 0; i < remotemethods.length; i++)
+ {
+ dispatch.visitLabel(methLabels[i]);
+ Method m = remotemethods[i].meth;
+ generateMethodSkel(dispatch, m, var);
+ }
+
+ dispatch.visitLabel(deflt);
+ dispatch.visitTypeInsn(Opcodes.NEW, typeArg(UnmarshalException.class));
+ dispatch.visitInsn(Opcodes.DUP);
+ dispatch.visitLdcInsn("invalid method number");
+ dispatch.visitMethodInsn
+ (Opcodes.INVOKESPECIAL,
+ Type.getInternalName(UnmarshalException.class),
+ "<init>",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE, new Type[] { Type.getType(String.class) }));
+ dispatch.visitInsn(Opcodes.ATHROW);
+
+ dispatch.visitMaxs(-1, -1);
+
+ skel.visitEnd();
+ byte[] classData = skel.toByteArray();
+ if (!noWrite)
+ {
+ if (file.exists())
+ file.delete();
+ if (file.getParentFile() != null)
+ file.getParentFile().mkdirs();
+ FileOutputStream fos = new FileOutputStream(file);
+ fos.write(classData);
+ fos.flush();
+ fos.close();
+ }
+ }
+
+ private void generateMethodSkel(MethodVisitor cv, Method m, Variables var)
+ {
+ Class[] sig = m.getParameterTypes();
+
+ Label readArgs = new Label();
+ cv.visitLabel(readArgs);
+
+ boolean needcastcheck = false;
+
+ // ObjectInput in = call.getInputStream();
+ cv.visitVarInsn(Opcodes.ALOAD, var.get("remotecall"));
+ cv.visitMethodInsn
+ (Opcodes.INVOKEINTERFACE,
+ Type.getInternalName(RemoteCall.class), "getInputStream",
+ Type.getMethodDescriptor
+ (Type.getType(ObjectInput.class), new Type[] {}));
+ cv.visitVarInsn(Opcodes.ASTORE, var.allocate("objectinput"));
+
+ for (int i = 0; i < sig.length; i++)
+ {
+ // dup input stream
+ cv.visitVarInsn(Opcodes.ALOAD, var.get("objectinput"));
+
+ Class readCls = sig[i].isPrimitive() ? sig[i] : Object.class;
+
+ // in.readFoo()
+ cv.visitMethodInsn
+ (Opcodes.INVOKEINTERFACE,
+ Type.getInternalName(ObjectInput.class),
+ readMethod(sig[i]),
+ Type.getMethodDescriptor
+ (Type.getType(readCls), new Type [] {}));
+
+ if (! sig[i].isPrimitive() && ! sig[i].equals(Object.class))
+ {
+ needcastcheck = true;
+ cv.visitTypeInsn(Opcodes.CHECKCAST, typeArg(sig[i]));
+ }
+
+ // store arg in variable
+ cv.visitVarInsn
+ (storeOpcode(sig[i]), var.allocate(param(m, i), size(sig[i])));
+ }
+
+ var.deallocate("objectinput");
+
+ Label doCall = new Label();
+ Label closeInput = new Label();
+
+ cv.visitJumpInsn(Opcodes.JSR, closeInput);
+ cv.visitJumpInsn(Opcodes.GOTO, doCall);
+
+ // throw new UnmarshalException
+ Label handler = new Label();
+ cv.visitLabel(handler);
+ cv.visitVarInsn(Opcodes.ASTORE, var.allocate("exception"));
+ cv.visitTypeInsn(Opcodes.NEW, typeArg(UnmarshalException.class));
+ cv.visitInsn(Opcodes.DUP);
+ cv.visitLdcInsn("error unmarshalling arguments");
+ cv.visitVarInsn(Opcodes.ALOAD, var.deallocate("exception"));
+ cv.visitMethodInsn
+ (Opcodes.INVOKESPECIAL,
+ Type.getInternalName(UnmarshalException.class),
+ "<init>",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE, new Type[] { Type.getType(String.class),
+ Type.getType(Exception.class) }));
+ cv.visitVarInsn(Opcodes.ASTORE, var.allocate("toThrow"));
+ cv.visitJumpInsn(Opcodes.JSR, closeInput);
+ cv.visitVarInsn(Opcodes.ALOAD, var.get("toThrow"));
+ cv.visitInsn(Opcodes.ATHROW);
+
+ cv.visitTryCatchBlock
+ (readArgs, handler, handler, Type.getInternalName(IOException.class));
+ if (needcastcheck)
+ {
+ cv.visitTryCatchBlock
+ (readArgs, handler, handler,
+ Type.getInternalName(ClassCastException.class));
+ }
+
+ // finally block
+ cv.visitLabel(closeInput);
+ cv.visitVarInsn(Opcodes.ASTORE, var.allocate("retAddress"));
+ cv.visitVarInsn(Opcodes.ALOAD, var.get("remotecall"));
+ cv.visitMethodInsn
+ (Opcodes.INVOKEINTERFACE,
+ Type.getInternalName(RemoteCall.class),
+ "releaseInputStream",
+ Type.getMethodDescriptor(Type.VOID_TYPE, new Type[] {}));
+ cv.visitVarInsn(Opcodes.RET, var.deallocate("retAddress"));
+ var.deallocate("toThrow");
+
+ // do the call using args stored as variables
+ cv.visitLabel(doCall);
+ cv.visitVarInsn(Opcodes.ALOAD, var.get("remoteobj"));
+ for (int i = 0; i < sig.length; i++)
+ cv.visitVarInsn(loadOpcode(sig[i]), var.deallocate(param(m, i)));
+ cv.visitMethodInsn
+ (Opcodes.INVOKEVIRTUAL, Type.getInternalName(clazz), m.getName(),
+ Type.getMethodDescriptor(m));
+
+ Class returntype = m.getReturnType();
+ if (! returntype.equals(Void.TYPE))
+ {
+ cv.visitVarInsn
+ (storeOpcode(returntype), var.allocate("result", size(returntype)));
+ }
+
+ // write result to result stream
+ Label writeResult = new Label();
+ cv.visitLabel(writeResult);
+ cv.visitVarInsn(Opcodes.ALOAD, var.get("remotecall"));
+ cv.visitInsn(Opcodes.ICONST_1);
+ cv.visitMethodInsn
+ (Opcodes.INVOKEINTERFACE,
+ Type.getInternalName(RemoteCall.class),
+ "getResultStream",
+ Type.getMethodDescriptor
+ (Type.getType(ObjectOutput.class),
+ new Type[] { Type.BOOLEAN_TYPE }));
+
+ if (! returntype.equals(Void.TYPE))
+ {
+ // out.writeFoo(result)
+ cv.visitVarInsn(loadOpcode(returntype), var.deallocate("result"));
+ Class writeCls = returntype.isPrimitive() ? returntype : Object.class;
+ cv.visitMethodInsn
+ (Opcodes.INVOKEINTERFACE,
+ Type.getInternalName(ObjectOutput.class),
+ writeMethod(returntype),
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE, new Type[] { Type.getType(writeCls) }));
+ }
+
+ cv.visitInsn(Opcodes.RETURN);
+
+ // throw new MarshalException
+ Label marshalHandler = new Label();
+ cv.visitLabel(marshalHandler);
+ cv.visitVarInsn(Opcodes.ASTORE, var.allocate("exception"));
+ cv.visitTypeInsn(Opcodes.NEW, typeArg(MarshalException.class));
+ cv.visitInsn(Opcodes.DUP);
+ cv.visitLdcInsn("error marshalling return");
+ cv.visitVarInsn(Opcodes.ALOAD, var.deallocate("exception"));
+ cv.visitMethodInsn
+ (Opcodes.INVOKESPECIAL,
+ Type.getInternalName(MarshalException.class),
+ "<init>",
+ Type.getMethodDescriptor
+ (Type.VOID_TYPE, new Type[] { Type.getType(String.class),
+ Type.getType(Exception.class) }));
+ cv.visitInsn(Opcodes.ATHROW);
+ cv.visitTryCatchBlock
+ (writeResult, marshalHandler, marshalHandler,
+ Type.getInternalName(IOException.class));
+ }
+
+ private static String typeArg(Class cls)
+ {
+ if (cls.isArray())
+ return Type.getDescriptor(cls);
+
+ return Type.getInternalName(cls);
+ }
+
+ private static String readMethod(Class cls)
+ {
+ if (cls.equals(Void.TYPE))
+ throw new IllegalArgumentException("can not read void");
+
+ String method;
+ if (cls.equals(Boolean.TYPE))
+ method = "readBoolean";
+ else if (cls.equals(Byte.TYPE))
+ method = "readByte";
+ else if (cls.equals(Character.TYPE))
+ method = "readChar";
+ else if (cls.equals(Short.TYPE))
+ method = "readShort";
+ else if (cls.equals(Integer.TYPE))
+ method = "readInt";
+ else if (cls.equals(Long.TYPE))
+ method = "readLong";
+ else if (cls.equals(Float.TYPE))
+ method = "readFloat";
+ else if (cls.equals(Double.TYPE))
+ method = "readDouble";
+ else
+ method = "readObject";
+
+ return method;
+ }
+
+ private static String writeMethod(Class cls)
+ {
+ if (cls.equals(Void.TYPE))
+ throw new IllegalArgumentException("can not read void");
+
+ String method;
+ if (cls.equals(Boolean.TYPE))
+ method = "writeBoolean";
+ else if (cls.equals(Byte.TYPE))
+ method = "writeByte";
+ else if (cls.equals(Character.TYPE))
+ method = "writeChar";
+ else if (cls.equals(Short.TYPE))
+ method = "writeShort";
+ else if (cls.equals(Integer.TYPE))
+ method = "writeInt";
+ else if (cls.equals(Long.TYPE))
+ method = "writeLong";
+ else if (cls.equals(Float.TYPE))
+ method = "writeFloat";
+ else if (cls.equals(Double.TYPE))
+ method = "writeDouble";
+ else
+ method = "writeObject";
+
+ return method;
+ }
+
+ private static int returnOpcode(Class cls)
+ {
+ int returncode;
+ if (cls.equals(Boolean.TYPE))
+ returncode = Opcodes.IRETURN;
+ else if (cls.equals(Byte.TYPE))
+ returncode = Opcodes.IRETURN;
+ else if (cls.equals(Character.TYPE))
+ returncode = Opcodes.IRETURN;
+ else if (cls.equals(Short.TYPE))
+ returncode = Opcodes.IRETURN;
+ else if (cls.equals(Integer.TYPE))
+ returncode = Opcodes.IRETURN;
+ else if (cls.equals(Long.TYPE))
+ returncode = Opcodes.LRETURN;
+ else if (cls.equals(Float.TYPE))
+ returncode = Opcodes.FRETURN;
+ else if (cls.equals(Double.TYPE))
+ returncode = Opcodes.DRETURN;
+ else if (cls.equals(Void.TYPE))
+ returncode = Opcodes.RETURN;
+ else
+ returncode = Opcodes.ARETURN;
+
+ return returncode;
+ }
+
+ private static int loadOpcode(Class cls)
+ {
+ if (cls.equals(Void.TYPE))
+ throw new IllegalArgumentException("can not load void");
+
+ int loadcode;
+ if (cls.equals(Boolean.TYPE))
+ loadcode = Opcodes.ILOAD;
+ else if (cls.equals(Byte.TYPE))
+ loadcode = Opcodes.ILOAD;
+ else if (cls.equals(Character.TYPE))
+ loadcode = Opcodes.ILOAD;
+ else if (cls.equals(Short.TYPE))
+ loadcode = Opcodes.ILOAD;
+ else if (cls.equals(Integer.TYPE))
+ loadcode = Opcodes.ILOAD;
+ else if (cls.equals(Long.TYPE))
+ loadcode = Opcodes.LLOAD;
+ else if (cls.equals(Float.TYPE))
+ loadcode = Opcodes.FLOAD;
+ else if (cls.equals(Double.TYPE))
+ loadcode = Opcodes.DLOAD;
+ else
+ loadcode = Opcodes.ALOAD;
+
+ return loadcode;
+ }
+
+ private static int storeOpcode(Class cls)
+ {
+ if (cls.equals(Void.TYPE))
+ throw new IllegalArgumentException("can not load void");
+
+ int storecode;
+ if (cls.equals(Boolean.TYPE))
+ storecode = Opcodes.ISTORE;
+ else if (cls.equals(Byte.TYPE))
+ storecode = Opcodes.ISTORE;
+ else if (cls.equals(Character.TYPE))
+ storecode = Opcodes.ISTORE;
+ else if (cls.equals(Short.TYPE))
+ storecode = Opcodes.ISTORE;
+ else if (cls.equals(Integer.TYPE))
+ storecode = Opcodes.ISTORE;
+ else if (cls.equals(Long.TYPE))
+ storecode = Opcodes.LSTORE;
+ else if (cls.equals(Float.TYPE))
+ storecode = Opcodes.FSTORE;
+ else if (cls.equals(Double.TYPE))
+ storecode = Opcodes.DSTORE;
+ else
+ storecode = Opcodes.ASTORE;
+
+ return storecode;
+ }
+
+ private static String unboxMethod(Class primitive)
+ {
+ if (! primitive.isPrimitive())
+ throw new IllegalArgumentException("can not unbox nonprimitive");
+
+ String method;
+ if (primitive.equals(Boolean.TYPE))
+ method = "booleanValue";
+ else if (primitive.equals(Byte.TYPE))
+ method = "byteValue";
+ else if (primitive.equals(Character.TYPE))
+ method = "charValue";
+ else if (primitive.equals(Short.TYPE))
+ method = "shortValue";
+ else if (primitive.equals(Integer.TYPE))
+ method = "intValue";
+ else if (primitive.equals(Long.TYPE))
+ method = "longValue";
+ else if (primitive.equals(Float.TYPE))
+ method = "floatValue";
+ else if (primitive.equals(Double.TYPE))
+ method = "doubleValue";
+ else
+ throw new IllegalStateException("unknown primitive class " + primitive);
+
+ return method;
+ }
+
+ public static Class box(Class cls)
+ {
+ if (! cls.isPrimitive())
+ throw new IllegalArgumentException("can only box primitive");
+
+ Class box;
+ if (cls.equals(Boolean.TYPE))
+ box = Boolean.class;
+ else if (cls.equals(Byte.TYPE))
+ box = Byte.class;
+ else if (cls.equals(Character.TYPE))
+ box = Character.class;
+ else if (cls.equals(Short.TYPE))
+ box = Short.class;
+ else if (cls.equals(Integer.TYPE))
+ box = Integer.class;
+ else if (cls.equals(Long.TYPE))
+ box = Long.class;
+ else if (cls.equals(Float.TYPE))
+ box = Float.class;
+ else if (cls.equals(Double.TYPE))
+ box = Double.class;
+ else
+ throw new IllegalStateException("unknown primitive type " + cls);
+
+ return box;
+ }
+
+ private static int size(Class cls) {
+ if (cls.equals(Long.TYPE) || cls.equals(Double.TYPE))
+ return 2;
+ else
+ return 1;
+ }
+
+ /**
+ * Sort exceptions so the most general go last.
+ */
+ private Class[] sortExceptions(Class[] except)
+ {
+ for (int i = 0; i < except.length; i++)
+ {
+ for (int j = i + 1; j < except.length; j++)
+ {
+ if (except[i].isAssignableFrom(except[j]))
+ {
+ Class tmp = except[i];
+ except[i] = except[j];
+ except[j] = tmp;
+ }
+ }
+ }
+ return (except);
+ }
+
+ public void setup(boolean keep, boolean need11Stubs, boolean need12Stubs,
+ boolean iiop, boolean poa, boolean debug, boolean warnings,
+ boolean noWrite, boolean verbose, boolean force, String classpath,
+ String bootclasspath, String extdirs, String outputDirectory)
+ {
+ this.keep = keep;
+ this.need11Stubs = need11Stubs;
+ this.need12Stubs = need12Stubs;
+ this.verbose = verbose;
+ this.noWrite = noWrite;
+
+ // Set up classpath.
+ this.classpath = classpath;
+ StringTokenizer st =
+ new StringTokenizer(classpath, File.pathSeparator);
+ URL[] u = new URL[st.countTokens()];
+ for (int i = 0; i < u.length; i++)
+ {
+ String path = st.nextToken();
+ File f = new File(path);
+ try
+ {
+ u[i] = f.toURL();
+ }
+ catch (java.net.MalformedURLException mue)
+ {
+ logError("malformed classpath component " + path);
+ return;
+ }
+ }
+ loader = new URLClassLoader(u);
+
+ destination = outputDirectory;
+ }
+
+ private void findRemoteMethods()
+ throws RMICException
+ {
+ List rmeths = new ArrayList();
+ for (Class cur = clazz; cur != null; cur = cur.getSuperclass())
+ {
+ Class[] interfaces = cur.getInterfaces();
+ for (int i = 0; i < interfaces.length; i++)
+ {
+ if (java.rmi.Remote.class.isAssignableFrom(interfaces[i]))
+ {
+ Class remoteInterface = interfaces[i];
+ if (verbose)
+ System.out.println
+ ("[implements " + remoteInterface.getName() + "]");
+
+ // check if the methods declare RemoteExceptions
+ Method[] meths = remoteInterface.getMethods();
+ for (int j = 0; j < meths.length; j++)
+ {
+ Method m = meths[j];
+ Class[] exs = m.getExceptionTypes();
+
+ boolean throwsRemote = false;
+ for (int k = 0; k < exs.length; k++)
+ {
+ if (exs[k].isAssignableFrom(RemoteException.class))
+ throwsRemote = true;
+ }
+
+ if (! throwsRemote)
+ {
+ throw new RMICException
+ ("Method " + m + " in interface " + remoteInterface
+ + " does not throw a RemoteException");
+ }
+
+ rmeths.add(m);
+ }
+
+ mRemoteInterfaces.add(remoteInterface);
+ }
+ }
+ }
+
+ // intersect exceptions for doubly inherited methods
+ boolean[] skip = new boolean[rmeths.size()];
+ for (int i = 0; i < skip.length; i++)
+ skip[i] = false;
+ List methrefs = new ArrayList();
+ for (int i = 0; i < rmeths.size(); i++)
+ {
+ if (skip[i]) continue;
+ Method current = (Method) rmeths.get(i);
+ MethodRef ref = new MethodRef(current);
+ for (int j = i+1; j < rmeths.size(); j++)
+ {
+ Method other = (Method) rmeths.get(j);
+ if (ref.isMatch(other))
+ {
+ ref.intersectExceptions(other);
+ skip[j] = true;
+ }
+ }
+ methrefs.add(ref);
+ }
+
+ // Convert into a MethodRef array and sort them
+ remotemethods = (MethodRef[])
+ methrefs.toArray(new MethodRef[methrefs.size()]);
+ Arrays.sort(remotemethods);
+ }
+
+ /**
+ * Prints an error to System.err and increases the error count.
+ */
+ private void logError(Exception theError)
+ {
+ logError(theError.getMessage());
+ if (verbose)
+ theError.printStackTrace(System.err);
+ }
+
+ /**
+ * Prints an error to System.err and increases the error count.
+ */
+ private void logError(String theError)
+ {
+ errorCount++;
+ System.err.println("error: " + theError);
+ }
+
+ private static String getPrettyName(Class cls)
+ {
+ StringBuffer str = new StringBuffer();
+ for (int count = 0;; count++)
+ {
+ if (! cls.isArray())
+ {
+ str.append(cls.getName());
+ for (; count > 0; count--)
+ str.append("[]");
+ return (str.toString());
+ }
+ cls = cls.getComponentType();
+ }
+ }
+
+ private static class MethodRef
+ implements Comparable
+ {
+ Method meth;
+ long hash;
+ List exceptions;
+ private String sig;
+
+ MethodRef(Method m) {
+ meth = m;
+ sig = Type.getMethodDescriptor(meth);
+ hash = RMIHashes.getMethodHash(m);
+ // add exceptions removing subclasses
+ exceptions = removeSubclasses(m.getExceptionTypes());
+ }
+
+ public int compareTo(Object obj) {
+ MethodRef that = (MethodRef) obj;
+ int name = this.meth.getName().compareTo(that.meth.getName());
+ if (name == 0) {
+ return this.sig.compareTo(that.sig);
+ }
+ return name;
+ }
+
+ public boolean isMatch(Method m)
+ {
+ if (!meth.getName().equals(m.getName()))
+ return false;
+
+ Class[] params1 = meth.getParameterTypes();
+ Class[] params2 = m.getParameterTypes();
+ if (params1.length != params2.length)
+ return false;
+
+ for (int i = 0; i < params1.length; i++)
+ if (!params1[i].equals(params2[i])) return false;
+
+ return true;
+ }
+
+ private static List removeSubclasses(Class[] classes)
+ {
+ List list = new ArrayList();
+ for (int i = 0; i < classes.length; i++)
+ {
+ Class candidate = classes[i];
+ boolean add = true;
+ for (int j = 0; j < classes.length; j++)
+ {
+ if (classes[j].equals(candidate))
+ continue;
+ else if (classes[j].isAssignableFrom(candidate))
+ add = false;
+ }
+ if (add) list.add(candidate);
+ }
+
+ return list;
+ }
+
+ public void intersectExceptions(Method m)
+ {
+ List incoming = removeSubclasses(m.getExceptionTypes());
+
+ List updated = new ArrayList();
+
+ for (int i = 0; i < exceptions.size(); i++)
+ {
+ Class outer = (Class) exceptions.get(i);
+ boolean addOuter = false;
+ for (int j = 0; j < incoming.size(); j++)
+ {
+ Class inner = (Class) incoming.get(j);
+
+ if (inner.equals(outer) || inner.isAssignableFrom(outer))
+ addOuter = true;
+ else if (outer.isAssignableFrom(inner))
+ updated.add(inner);
+ }
+
+ if (addOuter)
+ updated.add(outer);
+ }
+
+ exceptions = updated;
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/CompilationError.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/CompilationError.java
new file mode 100644
index 00000000000..176a09598d2
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/CompilationError.java
@@ -0,0 +1,52 @@
+/* CompilationError.java -- Thrown on compilation error.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+*/
+
+package gnu.classpath.tools.rmic;
+
+/**
+ * This error is thrown when the target being compiled has illegal
+ * strutures.
+ *
+ * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
+ */
+public class CompilationError extends Error
+{
+ /**
+ * Use serialVersionUID for interoperability.
+ */
+ private static final long serialVersionUID = 1;
+
+ /**
+ * Create error with explaining message and cause.
+ */
+ public CompilationError(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ /**
+ * Create error with explaining message
+ */
+ public CompilationError(String message)
+ {
+ super(message);
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/Generator.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/Generator.java
new file mode 100644
index 00000000000..64eb2eaf66c
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/Generator.java
@@ -0,0 +1,128 @@
+/* Generator.java -- Generic code generator.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+*/
+
+package gnu.classpath.tools.rmic;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * Contains basic methods, used in code generation.
+ *
+ * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
+ */
+public class Generator
+{
+ /**
+ * Get resource with the given name, as string.
+ *
+ * @param name the resource name
+ * @return the resourse string (in subfolder /templates).
+ */
+ public String getResource(String name)
+ {
+ String resourcePath = "templates/" + name;
+ InputStream in = getClass().getResourceAsStream(resourcePath);
+
+ if (in == null)
+ throw new InternalError(getClass().getName() + ": no resource "
+ + resourcePath);
+
+ BufferedReader r = new BufferedReader(new InputStreamReader(in));
+ StringBuffer b = new StringBuffer();
+
+ String s;
+ try
+ {
+ while ((s = r.readLine()) != null)
+ {
+ b.append(s);
+ b.append('\n');
+ }
+ r.close();
+ }
+ catch (IOException e)
+ {
+ InternalError ierr = new InternalError("No expected resource " + name);
+ ierr.initCause(e);
+ throw ierr;
+ }
+
+ return b.toString();
+ }
+
+ /**
+ * Replace the variable references (starting from #) in the template string by
+ * the values, present in the given map. The strings, not present in the
+ * variable map, are ignored.
+ *
+ * @param template
+ * the template string
+ * @param variables
+ * the map of variables (name to value) to replace.
+ * @return the string with replaced values.
+ */
+ public String replaceAll(String template, Map variables)
+ {
+ BufferedReader r = new BufferedReader(new StringReader(template));
+ String s;
+ StringBuffer b = new StringBuffer(template.length());
+ try
+ {
+ Iterator iter;
+ Collection vars = variables.keySet();
+ while ((s = r.readLine()) != null)
+ {
+ // At least one variable must appear in the string to make
+ // the string scan sensible.
+ if (s.indexOf('#') >= 0)
+ {
+ iter = vars.iterator();
+ String variable;
+ while (iter.hasNext())
+ {
+ variable = (String) iter.next();
+ if (s.indexOf(variable) >= 0)
+ s = s.replaceAll(variable,
+ (String) variables.get(variable));
+ }
+ }
+ b.append(s);
+ b.append('\n');
+ }
+ r.close();
+ }
+ catch (IOException e)
+ {
+ // This should never happen.
+ InternalError ierr = new InternalError("");
+ ierr.initCause(e);
+ throw ierr;
+ }
+ return b.toString();
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/GiopIo.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/GiopIo.java
new file mode 100644
index 00000000000..0d77d1a787e
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/GiopIo.java
@@ -0,0 +1,112 @@
+/* GiopIo.java -- Generates GIOP input/output statements.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+*/
+
+package gnu.classpath.tools.rmic;
+
+import java.rmi.Remote;
+
+import org.omg.CORBA.portable.ObjectImpl;
+
+/**
+ * Generates the code for reading and writing data over GIOP stream.
+ *
+ * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
+ */
+public class GiopIo
+{
+ /**
+ * Get the statement for writing the variable of the given type to the GIOP ({@link org.omg.CORBA_2_3.portable.OutputStream) stream. The
+ * stream is always named "out".
+ *
+ * @param c
+ * the class of the object being written
+ * @param variable
+ * the variable, where the object value is stored
+ * @param r
+ * the parent generator, used to name the class
+ * @return the write statement.
+ */
+ public static String getWriteStatement(Class c, String variable, SourceGiopRmicCompiler r)
+ {
+ if (c.equals(boolean.class))
+ return "out.write_boolean(" + variable + ");";
+ if (c.equals(byte.class))
+ return "out.write_octet(" + variable + ");";
+ else if (c.equals(short.class))
+ return "out.write_int(" + variable + ");";
+ else if (c.equals(int.class))
+ return "out.write_long(" + variable + ");";
+ else if (c.equals(long.class))
+ return "out.write_long_long(" + variable + ");";
+ else if (c.equals(double.class))
+ return "out.write_double(" + variable + ");";
+ else if (c.equals(float.class))
+ return "out.write_float(" + variable + ");";
+ else if (c.equals(char.class))
+ return "out.write_char(" + variable + ");";
+ else if (Remote.class.isAssignableFrom(c))
+ return "Util.writeRemoteObject(out, " + variable + ");";
+ else if (ObjectImpl.class.isAssignableFrom(c))
+ return "out.write_Object(" + variable + ");";
+ else
+ return "out.write_value(" + variable + ", " + r.name(c) + ".class);";
+ }
+
+ /**
+ * Get the statement for reading the value of the given type from to the GIOP ({@link org.omg.CORBA_2_3.portable.InputStream) stream. The
+ * stream is always named "in".
+ *
+ * @param c
+ * the class of the object being written
+ * @param r
+ * the parent generator, used to name the class
+ * @return the right side of the read statement.
+ */
+ public static String getReadStatement(Class c, SourceGiopRmicCompiler r)
+ {
+ if (c.equals(boolean.class))
+ return "in.read_boolean();";
+ else if (c.equals(byte.class))
+ return "in.read_octet();";
+ else if (c.equals(short.class))
+ return "in.read_int();";
+ else if (c.equals(int.class))
+ return "in.read_long();";
+ else if (c.equals(long.class))
+ return "in.read_long_long();";
+ else if (c.equals(double.class))
+ return "in.read_double();";
+ else if (c.equals(float.class))
+ return "in.read_float();";
+ else if (c.equals(char.class))
+ return "in.read_char();";
+ else if (Remote.class.isAssignableFrom(c))
+ return "(" + r.name(c)
+ + ") PortableRemoteObject.narrow(in.read_Object()," + r.name(c)
+ + ".class);";
+ else if (ObjectImpl.class.isAssignableFrom(c))
+ return "in.read_Object();";
+ else
+ return "(" + r.name(c)
+ + ") in.read_value(" + r.name(c) + ".class);";
+ }
+
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/HashFinder.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/HashFinder.java
new file mode 100644
index 00000000000..cf4d67f0cc0
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/HashFinder.java
@@ -0,0 +1,84 @@
+/* HashFinder.java -- finds the hash character.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+*/
+
+
+package gnu.classpath.tools.rmic;
+
+import java.util.HashSet;
+
+/**
+ * This class finds the hash character (the most different character in
+ * the passed array of strings). This character is used to accelerate the
+ * method invocation by name.
+ *
+ * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
+ */
+public class HashFinder
+{
+ /**
+ * Find the hash char position in the given collection of strings.
+ *
+ * @param strings the string collection
+ *
+ * @return the optimal hash character position, always less then the
+ * length of the shortest string.
+ */
+ public int findHashCharPosition(String[] strings)
+ {
+ // Find the length of the shortest string:
+
+ int l = strings[0].length();
+ for (int i = 1; i < strings.length; i++)
+ {
+ if (strings[i].length() < l)
+ l = strings[i].length();
+ }
+
+ // Find the position with the smallest number of the matching characters:
+ HashSet[] charLists = new HashSet[l];
+
+ for (int i = 0; i < charLists.length; i++)
+ {
+ charLists[i] = new HashSet(strings.length);
+ }
+
+ for (int i = 0; i < strings.length; i++)
+ for (int p = 0; p < l; p++)
+ {
+ charLists[p].add(new Integer(strings[i].charAt(p)));
+ }
+
+ int m = 0;
+ int v = charLists[0].size();
+
+ for (int i = 1; i < charLists.length; i++)
+ {
+ // Replace on equality also, seeking the hash char closer to the end
+ // of line.
+ if (charLists[i].size()>=v)
+ {
+ m = i;
+ v = charLists[i].size();
+ }
+ }
+ return m;
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/Main.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/Main.java
new file mode 100644
index 00000000000..12d1fa20eda
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/Main.java
@@ -0,0 +1,282 @@
+/* Main.java -- RMI stub generator.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+*/
+
+package gnu.classpath.tools.rmic;
+
+import gnu.classpath.tools.common.ClasspathToolParser;
+import gnu.classpath.tools.getopt.FileArgumentCallback;
+import gnu.classpath.tools.getopt.Option;
+import gnu.classpath.tools.getopt.OptionException;
+import gnu.classpath.tools.getopt.OptionGroup;
+import gnu.classpath.tools.getopt.Parser;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+
+/**
+ * Generates the ordinary stubs (not GIOP based) for java.rmi.* package.
+ *
+ * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
+ */
+public class Main
+{
+ private boolean noWrite;
+ private boolean warnings = true;
+ private boolean verbose;
+ private boolean force;
+ private String classpath = ".";
+ private String outputDirectory = ".";
+ private boolean poa;
+ private boolean need11Stubs = false;
+ private boolean need12Stubs = true;
+ private boolean keep;
+ private boolean iiop;
+ /**
+ * Specifies whether or not JRMP mode was explicitly requested.
+ */
+ private boolean jrmp;
+
+ private Parser initializeParser()
+ {
+ Parser parser = new ClasspathToolParser("rmic", true); //$NON-NLS-1$
+ parser.setHeader(Messages.getString("Main.Usage")); //$NON-NLS-1$
+
+ parser.add(new Option("nowarn", //$NON-NLS-1$
+ Messages.getString("Main.NoWarn")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ warnings = false;
+ }
+ });
+ parser.add(new Option("nowrite", //$NON-NLS-1$
+ Messages.getString("Main.NoWrite")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ noWrite = true;
+ }
+ });
+ parser.add(new Option("verbose", //$NON-NLS-1$
+ Messages.getString("Main.Verbose")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ verbose = true;
+ }
+ });
+ parser.add(new Option("d", //$NON-NLS-1$
+ Messages.getString("Main.DirOpt"), //$NON-NLS-1$
+ Messages.getString("Main.DirArg")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ outputDirectory = argument;
+ }
+ });
+ parser.add(new Option("classpath", //$NON-NLS-1$
+ Messages.getString("Main.ClasspathOpt"), //$NON-NLS-1$
+ Messages.getString("Main.ClasspathArg")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ classpath = argument;
+ }
+ });
+ parser.add(new Option("bootclasspath", //$NON-NLS-1$
+ Messages.getString("Main.BootclasspathOpt"), //$NON-NLS-1$
+ Messages.getString("Main.BootclasspathArg")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ }
+ });
+ parser.add(new Option("extdirs", //$NON-NLS-1$
+ Messages.getString("Main.ExtdirsOpt"), //$NON-NLS-1$
+ Messages.getString("Main.ExtdirsArg")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ }
+ });
+ parser.add(new Option("iiop", //$NON-NLS-1$
+ Messages.getString("Main.IIOP")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ iiop = true;
+ }
+ });
+ parser.add(new Option("always", //$NON-NLS-1$
+ Messages.getString("Main.Always")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ force = true;
+ }
+ });
+ parser.add(new Option("alwaysgenerate", //$NON-NLS-1$
+ Messages.getString("Main.AlwaysGenerate")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ force = true;
+ }
+ });
+ parser.add(new Option("nolocalstubs", //$NON-NLS-1$
+ Messages.getString("Main.NoLocalStubs")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ }
+ });
+ parser.add(new Option("poa", //$NON-NLS-1$
+ Messages.getString("Main.POA")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ poa = true;
+ }
+ });
+ parser.add(new Option("keep", //$NON-NLS-1$
+ Messages.getString("Main.Keep")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ keep = true;
+ }
+ });
+ parser.add(new Option("keepgenerated", //$NON-NLS-1$
+ Messages.getString("Main.KeepGenerated")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ keep = true;
+ }
+ });
+ parser.add(new Option("v1.1", //$NON-NLS-1$
+ Messages.getString("Main.v11")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ need11Stubs = true;
+ need12Stubs = false;
+ jrmp = true;
+ }
+ });
+ parser.add(new Option("v1.2", //$NON-NLS-1$
+ Messages.getString("Main.v12")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ jrmp = true;
+ }
+ });
+ parser.add(new Option("vcompat", //$NON-NLS-1$
+ Messages.getString("Main.vcompat")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ need11Stubs = true;
+ need12Stubs = true;
+ jrmp = true;
+ }
+ });
+ parser.add(new Option("g", //$NON-NLS-1$
+ Messages.getString("Main.DebugInfo")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ }
+ });
+
+ return parser;
+ }
+
+ private void run(String[] args)
+ {
+ Parser p = initializeParser();
+ String[] files = p.parse(args);
+
+ if (files.length == 0)
+ {
+ p.printHelp();
+ System.exit(1);
+ }
+
+ ArrayList backends = new ArrayList();
+
+ // FIXME: need an IDL RmicBackend
+ // FIXME: need a ClassGiopRmicCompiler RmicBackend
+ if (iiop)
+ {
+ backends.add(new SourceGiopRmicCompiler());
+
+ if (jrmp)
+ {
+ // Both IIOP and JRMP stubs were requested.
+ backends.add(new ClassRmicCompiler());
+ // FIXME: SourceRmicCompiler should support v1.1
+ if (keep)
+ backends.add(new SourceRmicCompiler());
+ }
+ }
+ else
+ {
+ backends.add(new ClassRmicCompiler());
+ if (keep)
+ backends.add(new SourceRmicCompiler());
+ }
+
+ for (int i = 0; i < backends.size(); i++)
+ {
+ RmicBackend b = (RmicBackend) backends.get(i);
+ b.setup(keep, need11Stubs, need12Stubs,
+ iiop, poa, false, warnings,
+ noWrite, verbose, force, classpath,
+ null, null, outputDirectory);
+ if (!b.run(files))
+ System.exit(1);
+ }
+ }
+
+ /**
+ * The RMI compiler entry point.
+ */
+ public static void main(String[] args)
+ {
+ Main rmicprogram = new Main();
+ try
+ {
+ rmicprogram.run(args);
+ }
+ catch (Exception e)
+ {
+ System.err.println(Messages.getString("Main.InternalError")); //$NON-NLS-1$
+ e.printStackTrace(System.err);
+ System.exit(1);
+ }
+ }
+
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/Messages.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/Messages.java
new file mode 100644
index 00000000000..5e67dd163c4
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/Messages.java
@@ -0,0 +1,67 @@
+/* Messages.java -- localization support for rmic
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.rmic;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages
+{
+ private static final String BUNDLE_NAME
+ = "gnu.classpath.tools.rmic.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE
+ = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages()
+ {
+ }
+
+ public static String getString(String key)
+ {
+ try
+ {
+ return RESOURCE_BUNDLE.getString(key);
+ }
+ catch (MissingResourceException e)
+ {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/MethodGenerator.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/MethodGenerator.java
new file mode 100644
index 00000000000..335a0a65c30
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/MethodGenerator.java
@@ -0,0 +1,285 @@
+/* MethodGenerator.java -- Generates methods for GIOP rmic compiler.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+*/
+
+package gnu.classpath.tools.rmic;
+
+import gnu.classpath.tools.rmic.AbstractMethodGenerator;
+
+import java.lang.reflect.Method;
+import java.util.Properties;
+
+/**
+ * Keeps information about the single method and generates the code fragments,
+ * related to that method.
+ *
+ * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
+ */
+public class MethodGenerator implements AbstractMethodGenerator
+{
+ /**
+ * The method being defined.
+ */
+ Method method;
+
+ /**
+ * The parent code generator.
+ */
+ SourceGiopRmicCompiler rmic;
+
+ /**
+ * The previous method in the list, null for the first element.
+ * Used to avoid repretetive inclusion of the same hash code label.
+ */
+ MethodGenerator previous = null;
+
+ /**
+ * The hash character position.
+ */
+ int hashCharPosition;
+
+ /**
+ * Create the new method generator for the given method.
+ *
+ * @param aMethod
+ * the related method.
+ * @param aRmic
+ * the Rmic generator instance, where more class - related
+ * information is defined.
+ */
+ public MethodGenerator(Method aMethod, SourceGiopRmicCompiler aRmic)
+ {
+ method = aMethod;
+ rmic = aRmic;
+ }
+
+ /**
+ * Get the method name.
+ *
+ * @return the name of the method.
+ */
+ public String getGiopMethodName()
+ {
+ String m = method.getName();
+ if (m.startsWith("get"))
+ return "_get_J" + m.substring("get".length());
+ else if (m.startsWith("set"))
+ return "_set_J" + m.substring("set".length());
+ else
+ return m;
+ }
+
+ /**
+ * Get the method parameter declaration.
+ *
+ * @return the string - method parameter declaration.
+ */
+ public String getArgumentList()
+ {
+ StringBuffer b = new StringBuffer();
+
+ Class[] args = method.getParameterTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(rmic.name(args[i]));
+ b.append(" p" + i);
+ if (i < args.length - 1)
+ b.append(", ");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Get the method parameter list only (no type declarations). This is used to
+ * generate the method invocations statement.
+ *
+ * @return the string - method parameter list.
+ */
+ public String getArgumentNames()
+ {
+ StringBuffer b = new StringBuffer();
+
+ Class[] args = method.getParameterTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(" p" + i);
+ if (i < args.length - 1)
+ b.append(", ");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Get the list of exceptions, thrown by this method.
+ *
+ * @return the list of exceptions.
+ */
+ public String getThrows()
+ {
+ StringBuffer b = new StringBuffer();
+
+ Class[] args = method.getExceptionTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(rmic.name(args[i]));
+ if (i < args.length - 1)
+ b.append(", ");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Generate this method for the Stub class.
+ *
+ * @return the method body for the stub class.
+ */
+ public String generateStubMethod()
+ {
+ String templateName;
+
+ Properties vars = new Properties(rmic.vars);
+ vars.put("#return_type", rmic.name(method.getReturnType()));
+ vars.put("#method_name", method.getName());
+ vars.put("#giop_method_name", getGiopMethodName());
+ vars.put("#argument_list", getArgumentList());
+ vars.put("#argument_names", getArgumentNames());
+
+ vars.put("#argument_write", getStubParaWriteStatement());
+
+ if (method.getReturnType().equals(void.class))
+ vars.put("#read_return", "return;");
+ else
+ vars.put("#read_return",
+ "return "
+ + GiopIo.getReadStatement(method.getReturnType(), rmic));
+ String thr = getThrows();
+ if (thr.length() > 0)
+ vars.put("#throws", "\n throws " + thr);
+ else
+ vars.put("#throws", "");
+
+ if (method.getReturnType().equals(void.class))
+ templateName = "StubMethodVoid.jav";
+ else
+ {
+ vars.put("#write_result",
+ GiopIo.getWriteStatement(method.getReturnType(), "result",
+ rmic));
+ templateName = "StubMethod.jav";
+ }
+
+ String template = rmic.getResource(templateName);
+ String generated = rmic.replaceAll(template, vars);
+ return generated;
+ }
+
+ /**
+ * Generate this method handling fragment for the Tie class.
+ *
+ * @return the fragment to handle this method for the Tie class.
+ */
+ public String generateTieMethod()
+ {
+ String templateName;
+
+ Properties vars = new Properties(rmic.vars);
+ vars.put("#return_type", rmic.name(method.getReturnType()));
+ vars.put("#method_name", method.getName());
+ vars.put("#giop_method_name", getGiopMethodName());
+ vars.put("#argument_list", getArgumentList());
+ vars.put("#argument_names", getArgumentNames());
+
+ vars.put("#argument_write", getStubParaWriteStatement());
+
+ if (previous == null || previous.getHashChar()!=getHashChar())
+ vars.put("#hashCodeLabel"," case '"+getHashChar()+"':");
+ else
+ vars.put("#hashCodeLabel"," // also '"+getHashChar()+"':");
+
+ if (method.getReturnType().equals(void.class))
+ templateName = "TieMethodVoid.jav";
+ else
+ {
+ vars.put("#write_result",
+ GiopIo.getWriteStatement(method.getReturnType(), "result",
+ rmic));
+ templateName = "TieMethod.jav";
+ }
+ vars.put("#read_and_define_args", getRda());
+
+ String template = rmic.getResource(templateName);
+ String generated = rmic.replaceAll(template, vars);
+ return generated;
+ }
+
+ /**
+ * Generate sentences for Reading and Defining Arguments.
+ *
+ * @return the sequence of sentences for reading and defining arguments.
+ */
+ public String getRda()
+ {
+ StringBuffer b = new StringBuffer();
+ Class[] args = method.getParameterTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(" ");
+ b.append(rmic.name(args[i]));
+ b.append(" ");
+ b.append("p"+i);
+ b.append(" = ");
+ b.append(GiopIo.getReadStatement(args[i], rmic));
+ if (i<args.length-1)
+ b.append("\n");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Get the write statement for writing parameters inside the stub.
+ *
+ * @return the write statement.
+ */
+ public String getStubParaWriteStatement()
+ {
+ StringBuffer b = new StringBuffer();
+ Class[] args = method.getParameterTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(" ");
+ b.append(GiopIo.getWriteStatement(args[i], "p" + i, rmic));
+ b.append("\n");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Get the hash char.
+ */
+ public char getHashChar()
+ {
+ return getGiopMethodName().charAt(hashCharPosition);
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/RMICException.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/RMICException.java
new file mode 100644
index 00000000000..300d60947d7
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/RMICException.java
@@ -0,0 +1,54 @@
+/* RMICException.java --
+ Copyright (c) 2003, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA. */
+
+
+package gnu.classpath.tools.rmic;
+
+/**
+ * Thrown by the underlying compiler used by RMIC when it fails to compile a
+ * file.
+ *
+ * @author Dalibor Topic <robilad@kaffe.org>
+ */
+public class RMICException
+ extends Exception
+{
+ /**
+ * Create an exception with a message. The cause remains uninitialized.
+ *
+ * @param message the message string
+ * @see #initCause(Throwable)
+ */
+ public RMICException(String message)
+ {
+ super(message);
+ }
+
+ /**
+ * Create an exception with a message and a cause.
+ *
+ * @param message the message string
+ * @param cause the cause of this exception
+ */
+ public RMICException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java
new file mode 100644
index 00000000000..48abb8fade9
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java
@@ -0,0 +1,287 @@
+/* MethodGenerator.java -- Generates methods for rmi compiler.
+ Copyright (C) 2006 Free Software Foundation
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+*/
+
+
+package gnu.classpath.tools.rmic;
+
+import gnu.classpath.tools.rmic.AbstractMethodGenerator;
+import gnu.java.rmi.server.RMIHashes;
+
+import java.lang.reflect.Method;
+import java.util.Properties;
+
+/**
+ * Keeps information about the single method and generates the code fragments,
+ * related to that method.
+ *
+ * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
+ */
+public class RmiMethodGenerator
+ implements AbstractMethodGenerator
+{
+ /**
+ * The method being defined.
+ */
+ Method method;
+
+ /**
+ * The parent code generator.
+ */
+ SourceRmicCompiler rmic;
+
+ /**
+ * Create the new method generator for the given method.
+ *
+ * @param aMethod the related method.
+ * @param aRmic the Rmic generator instance, where more class - related
+ * information is defined.
+ */
+ public RmiMethodGenerator(Method aMethod, SourceRmicCompiler aRmic)
+ {
+ method = aMethod;
+ rmic = aRmic;
+ if (method.getParameterTypes().length == 0)
+ rmic.addZeroSizeObjecArray = true;
+ }
+
+ /**
+ * Get the method parameter declaration.
+ *
+ * @return the string - method parameter declaration.
+ */
+ public String getArgumentList()
+ {
+ StringBuffer b = new StringBuffer();
+
+ Class[] args = method.getParameterTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(rmic.name(args[i]));
+ b.append(" p" + i);
+ if (i < args.length - 1)
+ b.append(", ");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Get the method parameter list only (no type declarations). This is used to
+ * generate the method invocations statement.
+ *
+ * @return the string - method parameter list.
+ */
+ public String getArgumentNames()
+ {
+ StringBuffer b = new StringBuffer();
+
+ Class[] args = method.getParameterTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(" p" + i);
+ if (i < args.length - 1)
+ b.append(", ");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Get the list of exceptions, thrown by this method.
+ *
+ * @return the list of exceptions.
+ */
+ public String getThrows()
+ {
+ StringBuffer b = new StringBuffer();
+
+ Class[] args = method.getExceptionTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(rmic.name(args[i]));
+ if (i < args.length - 1)
+ b.append(", ");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Generate this method for the Stub class.
+ *
+ * @return the method body for the stub class.
+ */
+ public String generateStubMethod()
+ {
+ String templateName;
+
+ Properties vars = new Properties(rmic.vars);
+ vars.put("#return_type", rmic.name(method.getReturnType()));
+ vars.put("#method_name", method.getName());
+ vars.put("#method_hash", getMethodHashCode());
+ vars.put("#argument_list", getArgumentList());
+ vars.put("#object_arg_list", getArgListAsObjectArray());
+ vars.put("#declaring_class", rmic.name(method.getDeclaringClass()));
+ vars.put("#class_arg_list", getArgListAsClassArray());
+
+ String thr = getThrows();
+ if (thr.length() > 0)
+ vars.put("#throws", "\n throws " + thr);
+ else
+ vars.put("#throws", "");
+
+ if (method.getReturnType().equals(void.class))
+ templateName = "Stub_12MethodVoid.jav";
+ else
+ {
+ templateName = "Stub_12Method.jav";
+ vars.put("#return_statement", getReturnStatement());
+ }
+
+ String template = rmic.getResource(templateName);
+ String generated = rmic.replaceAll(template, vars);
+ return generated;
+ }
+
+ /**
+ * Generate sentences for Reading and Defining Arguments.
+ *
+ * @return the sequence of sentences for reading and defining arguments.
+ */
+ public String getStaticMethodDeclarations()
+ {
+ StringBuffer b = new StringBuffer();
+ Class[] args = method.getParameterTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(" ");
+ b.append(rmic.name(args[i]));
+ b.append(" ");
+ b.append("p" + i);
+ b.append(" = ");
+ if (i < args.length - 1)
+ b.append("\n");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Get the write statement for writing parameters inside the stub.
+ *
+ * @return the write statement.
+ */
+ public String getArgListAsObjectArray()
+ {
+ Class[] args = method.getParameterTypes();
+
+ if (args.length==0)
+ return "NO_ARGS";
+
+ StringBuffer b = new StringBuffer("new Object[] {");
+
+ for (int i = 0; i < args.length; i++)
+ {
+ if (!args[i].isPrimitive())
+ b.append("p"+i);
+ else
+ {
+ b.append("new "+rmic.name(WrapUnWrapper.getWrappingClass(args[i])));
+ b.append("(p"+i+")");
+ }
+ if (i<args.length-1)
+ b.append(", ");
+ }
+ b.append("}");
+ return b.toString();
+ }
+
+ /**
+ * Get the return statement, assuming that the returned object is placed into
+ * the variable "result".
+ */
+ public String getReturnStatement()
+ {
+ Class r = method.getReturnType();
+ if (r.equals(void.class))
+ return "";
+ else
+ {
+ if (r.isPrimitive())
+ {
+ String wcd = rmic.name(WrapUnWrapper.getWrappingClass(r));
+ return "return ((" + wcd + ") result)."
+ + WrapUnWrapper.getUnwrappingMethod(r) + ";";
+ }
+ else
+ return "return (" + rmic.name(r) + ") result;";
+ }
+ }
+
+ /**
+ * Get argument list as class array.
+ */
+ public String getArgListAsClassArray()
+ {
+ StringBuffer b = new StringBuffer();
+ Class[] args = method.getParameterTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(rmic.name(args[i]));
+ b.append(".class");
+ if (i < args.length - 1)
+ b.append(", ");
+ }
+ return b.toString();
+ }
+
+ /**
+ * RMI ties (previously named Skeletons) are no longer used since v 1.2. This
+ * method should never be called.
+ */
+ public String generateTieMethod()
+ {
+ throw new InternalError();
+ }
+
+ /**
+ * Get the method hash code.
+ */
+ public String getMethodHashCode()
+ {
+ return RMIHashes.getMethodHash(method)+"L";
+ }
+
+ /**
+ * Additional processing of the stub name (nothing to do for JRMP stubs).
+ */
+ public String convertStubName(String name)
+ {
+ return name;
+ }
+
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/RmicBackend.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/RmicBackend.java
new file mode 100644
index 00000000000..60eb854ca4c
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/RmicBackend.java
@@ -0,0 +1,31 @@
+/* RmicBackend.java --
+ Copyright (c) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA. */
+
+package gnu.classpath.tools.rmic;
+public interface RmicBackend
+{
+ void setup(boolean keep, boolean need11Stubs, boolean need12Stubs,
+ boolean iiop, boolean poa, boolean debug, boolean warnings,
+ boolean noWrite, boolean verbose, boolean force, String classpath,
+ String bootclasspath, String extdirs, String outputDirectory);
+
+ boolean run(String[] inputFiles);
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java
new file mode 100644
index 00000000000..e9b7bff0b7e
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java
@@ -0,0 +1,694 @@
+/* SourceGiopRmicCompiler -- Central GIOP-based RMI stub and tie compiler class.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+*/
+
+package gnu.classpath.tools.rmic;
+
+import gnu.classpath.tools.rmic.AbstractMethodGenerator;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.StringTokenizer;
+import java.util.TreeSet;
+
+/**
+ * Provides the extended rmic functionality to generate the POA - based classes
+ * for GIOP (javax.rmi.CORBA package).
+ *
+ * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
+ */
+public class SourceGiopRmicCompiler
+ extends Generator implements Comparator, RmicBackend
+{
+ /** The package name. */
+ protected String packag;
+
+ /**
+ * The "basic" name (normally, the interface name, unless several Remote -
+ * derived interfaces are implemented.
+ */
+ protected String name;
+
+ /**
+ * The name (without package) of the class, passed as the parameter.
+ */
+ protected String implName;
+
+ /**
+ * The proposed name for the stub.
+ */
+ protected String stubName;
+
+ /**
+ * The Remote's, implemented by this class.
+ */
+ protected Collection implementedRemotes = new HashSet();
+
+ /**
+ * The extra classes that must be imported.
+ */
+ protected Collection extraImports = new HashSet();
+
+ /**
+ * The methods we must implement.
+ */
+ protected Collection methods = new HashSet();
+
+ /**
+ * The map of all code generator variables.
+ */
+ public Properties vars = new Properties();
+
+ /**
+ * If this flag is set (true by default), the compiler generates the Servant
+ * based classes. If set to false, the compiler generates the old style
+ * ObjectImpl based classes.
+ */
+ protected boolean poaMode = true;
+
+ /**
+ * If this flag is set (true by default), the compiler emits warnings.
+ */
+ protected boolean warnings = true;
+
+ /**
+ * If this flag is set (false by default), the compiler does not
+ * write output files.
+ */
+ protected boolean noWrite = false;
+
+ /**
+ * If this flag is set (false by default), the compiler keeps source
+ * output files. For SourceGiopRmicCompiler this overrides
+ * -nowrite, since -nowrite doesn't apply to sources kept with
+ * -keep.
+ */
+ protected boolean keep = false;
+
+ /**
+ * Verbose output
+ */
+ protected boolean verbose = false;
+
+ /**
+ * Force mode - do not check the exceptions
+ */
+ protected boolean force = false;
+
+ /**
+ * The output directory for generated files.
+ */
+ protected String outputDirectory;
+
+ /**
+ * The class loader to load the class being compiled.
+ */
+ ClassLoader classLoader;
+
+ /**
+ * Clear data, preparing for the next compilation.
+ */
+ public void reset()
+ {
+ packag = name = implName = stubName = null;
+ implementedRemotes.clear();
+ extraImports.clear();
+ methods.clear();
+ vars.clear();
+ }
+
+ /**
+ * Set the class path (handle the -classpath key)
+ *
+ * @param classPath the class path to set.
+ */
+ public void setClassPath(String classPath)
+ {
+ classLoader = Thread.currentThread().getContextClassLoader();
+ StringTokenizer tok = new StringTokenizer(classPath, File.pathSeparator,
+ true);
+ ArrayList urls = new ArrayList(tok.countTokens());
+ String s = null;
+ try
+ {
+ while (tok.hasMoreTokens())
+ {
+ s = tok.nextToken();
+ if (s.equals(File.pathSeparator))
+ urls.add(new File(".").toURL());
+ else
+ {
+ urls.add(new File(s).toURL());
+ if (tok.hasMoreTokens())
+ {
+ // Skip the separator.
+ tok.nextToken();
+ // If the classpath ended with a separator,
+ // append the current directory.
+ if (! tok.hasMoreTokens())
+ urls.add(new File(".").toURL());
+ }
+ }
+ }
+ }
+ catch (MalformedURLException ex)
+ {
+ System.err.println("Malformed path '" + s + "' in classpath '"
+ + classPath + "'");
+ System.exit(1);
+ }
+ URL[] u = new URL[urls.size()];
+ for (int i = 0; i < u.length; i++)
+ {
+ u[i] = (URL) urls.get(i);
+ }
+
+ classLoader = new URLClassLoader(u, classLoader);
+ }
+
+ /**
+ * Loads the class with the given name (uses class path, if applicable)
+ *
+ * @param name the name of the class.
+ */
+ public Class loadClass(String name)
+ {
+ ClassLoader loader = classLoader;
+ if (loader == null)
+ loader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ return loader.loadClass(name);
+ }
+ catch (ClassNotFoundException e)
+ {
+ System.err.println(name+" not found on "+loader);
+ System.exit(1);
+ // Unreacheable code.
+ return null;
+ }
+ }
+
+ /**
+ * Compile the given class (the instance of Remote), generating the stub and
+ * tie for it.
+ *
+ * @param remote
+ * the class to compile.
+ */
+ public synchronized void compile(Class remote)
+ {
+ reset();
+ String s;
+
+ // Get the package.
+ s = remote.getName();
+ int p = s.lastIndexOf('.');
+ if (p < 0)
+ {
+ // Root package.
+ packag = "";
+ implName = name = s;
+ }
+ else
+ {
+ packag = s.substring(0, p);
+ implName = name = s.substring(p + 1);
+ }
+
+ name = convertStubName(name);
+
+ stubName = name;
+
+ vars.put("#name", name);
+ vars.put("#package", packag);
+ vars.put("#implName", implName);
+
+ if (verbose)
+ System.out.println("Package " + packag + ", name " + name + " impl "
+ + implName);
+
+ // Get the implemented remotes.
+ Class[] interfaces = remote.getInterfaces();
+
+ for (int i = 0; i < interfaces.length; i++)
+ {
+ if (Remote.class.isAssignableFrom(interfaces[i]))
+ {
+ if (! interfaces[i].equals(Remote.class))
+ {
+ implementedRemotes.add(interfaces[i]);
+ }
+ }
+ }
+
+ vars.put("#idList", getIdList(implementedRemotes));
+
+ // Collect and process methods.
+ Iterator iter = implementedRemotes.iterator();
+
+ while (iter.hasNext())
+ {
+ Class c = (Class) iter.next();
+ Method[] m = c.getMethods();
+
+ // Check if throws RemoteException.
+ for (int i = 0; i < m.length; i++)
+ {
+ Class[] exc = m[i].getExceptionTypes();
+ boolean remEx = false;
+
+ for (int j = 0; j < exc.length; j++)
+ {
+ if (RemoteException.class.isAssignableFrom(exc[j]))
+ {
+ remEx = true;
+ break;
+ }
+ }
+ if (! remEx && !force)
+ throw new CompilationError(m[i].getName() + ", defined in "
+ + c.getName()
+ + ", does not throw "
+ + RemoteException.class.getName());
+ AbstractMethodGenerator mm = createMethodGenerator(m[i]);
+ methods.add(mm);
+ }
+ }
+ }
+
+ /**
+ * Create the method generator for the given method.
+ *
+ * @param m the method
+ *
+ * @return the created method generator
+ */
+ protected AbstractMethodGenerator createMethodGenerator(Method m)
+ {
+ return new MethodGenerator(m, this);
+ }
+
+ /**
+ * Get the name of the given class. The class is added to imports, if not
+ * already present and not from java.lang and not from the current package.
+ *
+ * @param nameIt
+ * the class to name
+ * @return the name of class as it should appear in java language
+ */
+ public String name(Class nameIt)
+ {
+ if (nameIt.isArray())
+ {
+ // Mesure dimensions:
+ int dimension = 0;
+ Class finalComponent = nameIt;
+ while (finalComponent.isArray())
+ {
+ finalComponent = finalComponent.getComponentType();
+ dimension++;
+ }
+
+ StringBuffer brackets = new StringBuffer();
+
+ for (int i = 0; i < dimension; i++)
+ {
+ brackets.append("[]");
+ }
+
+ return name(finalComponent) + " " + brackets;
+ }
+ else
+ {
+ String n = nameIt.getName();
+ if (! nameIt.isArray() && ! nameIt.isPrimitive())
+ if (! n.startsWith("java.lang")
+ && ! (packag != null && n.startsWith(packag)))
+ extraImports.add(n);
+
+ int p = n.lastIndexOf('.');
+ if (p < 0)
+ return n;
+ else
+ return n.substring(p + 1);
+ }
+ }
+
+ /**
+ * Get the RMI-style repository Id for the given class.
+ *
+ * @param c
+ * the interface, for that the repository Id must be created.
+ * @return the repository id
+ */
+ public String getId(Class c)
+ {
+ return "RMI:" + c.getName() + ":0000000000000000";
+ }
+
+ /**
+ * Get repository Id string array declaration.
+ *
+ * @param remotes
+ * the collection of interfaces
+ * @return the fully formatted string array.
+ */
+ public String getIdList(Collection remotes)
+ {
+ StringBuffer b = new StringBuffer();
+
+ // Keep the Ids sorted, ensuring, that the same order will be preserved
+ // between compilations.
+ TreeSet sortedIds = new TreeSet();
+
+ Iterator iter = remotes.iterator();
+ while (iter.hasNext())
+ {
+ sortedIds.add(getId((Class) iter.next()));
+ }
+
+ iter = sortedIds.iterator();
+ while (iter.hasNext())
+ {
+ b.append(" \"" + iter.next() + "\"");
+ if (iter.hasNext())
+ b.append(", \n");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Generate stub. Can only be called from {@link #compile}.
+ *
+ * @return the string, containing the text of the generated stub.
+ */
+ public String generateStub()
+ {
+ String template = getResource("Stub.jav");
+
+ // Generate methods.
+ StringBuffer b = new StringBuffer();
+ Iterator iter = methods.iterator();
+ while (iter.hasNext())
+ {
+ AbstractMethodGenerator m = (AbstractMethodGenerator) iter.next();
+ b.append(m.generateStubMethod());
+ }
+
+ vars.put("#stub_methods", b.toString());
+ vars.put("#imports", getImportStatements());
+ vars.put("#interfaces", getAllInterfaces());
+
+ String output = replaceAll(template, vars);
+ return output;
+ }
+
+ /**
+ * Get the list of all interfaces, implemented by the class, that are
+ * derived from Remote.
+ *
+ * @return the string - all interfaces.
+ */
+ public String getAllInterfaces()
+ {
+ StringBuffer b = new StringBuffer();
+ Iterator iter = implementedRemotes.iterator();
+
+ while (iter.hasNext())
+ {
+ b.append(name((Class) iter.next()));
+ if (iter.hasNext())
+ b.append(", ");
+ }
+
+ return b.toString();
+ }
+
+ /**
+ * Generate Tie. Can only be called from {@link #compile}.
+ *
+ * @return the string, containing the text of the generated Tie.
+ */
+ public String generateTie()
+ {
+ String template;
+ if (poaMode)
+ template = getResource("Tie.jav");
+ else
+ template = getResource("ImplTie.jav");
+
+ // Generate methods.
+ HashFinder hashFinder = new HashFinder();
+
+ // Find the hash character position:
+ Iterator iter = methods.iterator();
+ String[] names = new String[methods.size()];
+ int p = 0;
+
+ for (int i = 0; i < names.length; i++)
+ names[i] = ((MethodGenerator) iter.next()).getGiopMethodName();
+
+ int hashCharPosition = hashFinder.findHashCharPosition(names);
+
+ iter = methods.iterator();
+ while (iter.hasNext())
+ ((MethodGenerator) iter.next()).hashCharPosition = hashCharPosition;
+
+ vars.put("#hashCharPos", Integer.toString(hashCharPosition));
+
+ ArrayList sortedMethods = new ArrayList(methods);
+ Collections.sort(sortedMethods, this);
+
+ iter = sortedMethods.iterator();
+
+ StringBuffer b = new StringBuffer();
+
+ MethodGenerator prev = null;
+
+ while (iter.hasNext())
+ {
+ MethodGenerator m = (MethodGenerator) iter.next();
+ m.previous = prev;
+ m.hashCharPosition = hashCharPosition;
+ prev = m;
+ b.append(m.generateTieMethod());
+ }
+
+ vars.put("#tie_methods", b.toString());
+
+ vars.put("#imports", getImportStatements());
+
+ String output = replaceAll(template, vars);
+ return output;
+ }
+
+ public int compare(Object a, Object b)
+ {
+ MethodGenerator g1 = (MethodGenerator) a;
+ MethodGenerator g2 = (MethodGenerator) b;
+
+ return g1.getHashChar() - g2.getHashChar();
+ }
+
+ /**
+ * Import the extra classes, used as the method parameters and return values.
+ *
+ * @return the additional import block.
+ */
+ protected String getImportStatements()
+ {
+ TreeSet imp = new TreeSet();
+
+ Iterator it = extraImports.iterator();
+ while (it.hasNext())
+ {
+ String ic = it.next().toString();
+ imp.add("import " + ic + ";\n");
+ }
+
+ StringBuffer b = new StringBuffer();
+ it = imp.iterator();
+
+ while (it.hasNext())
+ {
+ b.append(it.next());
+ }
+ return b.toString();
+ }
+
+ /**
+ * If this flag is set (true by default), the compiler generates the Servant
+ * based classes. If set to false, the compiler generates the old style
+ * ObjectImpl based classes.
+ */
+ public void setPoaMode(boolean mode)
+ {
+ poaMode = mode;
+ }
+
+ /**
+ * Set the verbose output mode (false by default)
+ *
+ * @param isVerbose the verbose output mode
+ */
+ public void setVerbose(boolean isVerbose)
+ {
+ verbose = isVerbose;
+ }
+
+ /**
+ * If this flag is set (true by default), the compiler emits warnings.
+ */
+ public void setWarnings(boolean warn)
+ {
+ warnings = warn;
+ }
+
+ /**
+ * Set the error ignore mode.
+ */
+ public void setForce(boolean isforce)
+ {
+ force = isforce;
+ }
+
+ /**
+ * Get the package name.
+ */
+ public String getPackageName()
+ {
+ return packag;
+ }
+
+ /**
+ * Get the proposed stub name
+ */
+ public String getStubName()
+ {
+ return stubName;
+ }
+
+ /**
+ * Additional processing of the stub name.
+ */
+ public String convertStubName(String name)
+ {
+ // Drop the Impl suffix, if one exists.
+ if (name.endsWith("Impl"))
+ return name.substring(0, name.length() - "Impl".length());
+ else
+ return name;
+ }
+
+ /**
+ * Assumes that output directory is already created.
+ */
+ protected boolean outputTie(File fw, Class c)
+ {
+ try
+ {
+ String tie = generateTie();
+ String tieName = "_" + name(c) + "_Tie.java";
+
+ OutputStream out = new FileOutputStream(new File(fw, tieName));
+ out.write(tie.getBytes());
+ out.close();
+ }
+ catch (IOException ioex)
+ {
+ System.err.println("Output path not accessible");
+ ioex.printStackTrace();
+ return false;
+ }
+ return true;
+ }
+
+ public void setup(boolean keep, boolean need11Stubs, boolean need12Stubs,
+ boolean iiop, boolean poa, boolean debug, boolean warnings,
+ boolean noWrite, boolean verbose, boolean force, String classpath,
+ String bootclasspath, String extdirs, String outputDirectory)
+ {
+ setWarnings(warnings);
+ setVerbose(verbose);
+ setForce(force);
+ setClassPath(classpath);
+ setPoaMode(poa);
+ this.outputDirectory = outputDirectory;
+ this.noWrite = noWrite;
+ this.keep = keep;
+ }
+
+ public boolean run(String[] inputFiles)
+ {
+ for (int i = 0; i < inputFiles.length; i++)
+ {
+ reset();
+ Class c = loadClass(inputFiles[i]);
+
+ compile(c);
+ String packag = getPackageName().replace('.', '/');
+ File fw = new File(outputDirectory, packag);
+
+ // Generate stub.
+ String stub = generateStub();
+ String subName = getStubName() + "_Stub.java";
+
+ // -keep overrides -nowrite for sources.
+ if (!noWrite || keep)
+ {
+ try
+ {
+ fw.mkdirs();
+ OutputStream out = new FileOutputStream(new File(fw,
+ subName));
+ out.write(stub.getBytes());
+ out.close();
+
+ // Generate tie
+ if (!outputTie(fw, c))
+ return false;
+ }
+ catch (IOException ioex)
+ {
+ System.err.println("Output path not accessible");
+ ioex.printStackTrace();
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/SourceRmicCompiler.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/SourceRmicCompiler.java
new file mode 100644
index 00000000000..3779c5d28fb
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/SourceRmicCompiler.java
@@ -0,0 +1,179 @@
+/* SourceRmicCompiler.java -- RMI stub generator for java.rmi.*
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+*/
+
+
+package gnu.classpath.tools.rmic;
+
+import java.lang.reflect.Method;
+import java.io.File;
+import java.util.Iterator;
+
+import gnu.classpath.tools.rmic.AbstractMethodGenerator;
+
+/**
+ * RMI stub source code generator, required to support java.rmi.*
+ *
+ * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
+ */
+public class SourceRmicCompiler extends SourceGiopRmicCompiler
+{
+ /**
+ * If true, the zero size object array is declared in the stub to reduce
+ * garbage generation.
+ */
+ public boolean addZeroSizeObjecArray;
+
+ /**
+ * Generate a RMI stub.
+ *
+ * @return the string, containing the text of the generated stub.
+ */
+ public String generateStub()
+ {
+ String template = getResource("Stub_12.jav");
+
+ // Generate methods.
+ StringBuffer b = new StringBuffer();
+ Iterator iter = methods.iterator();
+ while (iter.hasNext())
+ {
+ RmiMethodGenerator m = (RmiMethodGenerator) iter.next();
+ b.append(m.generateStubMethod());
+ }
+
+ vars.put("#stub_methods", b.toString());
+ vars.put("#imports", getImportStatements());
+ vars.put("#interfaces", getAllInterfaces());
+ vars.put("#stub_method_declarations", getStubMethodDeclarations());
+ vars.put("#stub_method_initializations", getStubMethodInitializations());
+ if (addZeroSizeObjecArray)
+ {
+ vars.put("#zeroSizeObjecArray",
+ "private static final Object[] NO_ARGS = new Object[0];");
+ vars.put("#zeroSizeClassArray",
+ "final Class[] NO_ARGSc = new Class[0];");
+ }
+ else
+ {
+ vars.put("#zeroSizeObjecArray","");
+ vars.put("#zeroSizeClassArray","");
+ }
+
+ String output = replaceAll(template, vars);
+ return output;
+ }
+
+ /**
+ * Create a method generator, applicable for RMI stub methods.
+ */
+ protected AbstractMethodGenerator createMethodGenerator(Method m)
+ {
+ return new RmiMethodGenerator(m, this);
+ }
+
+ /**
+ * Get the stub method declarations.
+ */
+ public String getStubMethodDeclarations()
+ {
+ StringBuffer b = new StringBuffer();
+
+ Iterator iter = methods.iterator();
+
+ while (iter.hasNext())
+ {
+ RmiMethodGenerator method = (RmiMethodGenerator) iter.next();
+ b.append(" ");
+ b.append("private static final Method met_");
+ b.append(method.method.getName());
+ b.append(';');
+ if (iter.hasNext())
+ b.append('\n');
+ }
+ return b.toString();
+ }
+
+ /**
+ * Get stub method initializations. These must be done in a try-catch
+ * statement to catch {@link NoSuchMethodException}.
+ */
+ public String getStubMethodInitializations()
+ {
+ StringBuffer b = new StringBuffer();
+
+ Iterator iter = methods.iterator();
+
+ while (iter.hasNext())
+ {
+ RmiMethodGenerator method = (RmiMethodGenerator) iter.next();
+ b.append(" ");
+ b.append("met_");
+ b.append(method.method.getName());
+ b.append(" =\n ");
+ b.append(name(method.method.getDeclaringClass()));
+ b.append(".class.getMethod(");
+ b.append('"');
+ b.append(method.method.getName());
+ b.append("\", ");
+ if (method.method.getParameterTypes().length == 0)
+ b.append("NO_ARGSc);");
+ else
+ {
+ b.append("new Class[]\n {\n ");
+ b.append(method.getArgListAsClassArray());
+ b.append("\n }");
+ b.append(");");
+ }
+ b.append('\n');
+ }
+ return b.toString();
+ }
+
+ /**
+ * Prepare for the compilation of the next class.
+ */
+ public void reset()
+ {
+ addZeroSizeObjecArray = false;
+ super.reset();
+ }
+
+ /**
+ * Additional processing of the stub name (nothing to do for JRMP stubs).
+ */
+ public String convertStubName(String name)
+ {
+ return name;
+ }
+
+ /**
+ * Override to do nothing.
+ */
+ protected boolean outputTie(File fw, Class c)
+ {
+ return true;
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/Variables.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/Variables.java
new file mode 100644
index 00000000000..bddf5f78377
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/Variables.java
@@ -0,0 +1,137 @@
+/* Variables.java --
+ Copyright (c) 2004, 2005
+ Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA. */
+
+package gnu.classpath.tools.rmic;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+
+class Variables
+{
+ private final HashSet free = new HashSet();
+ private final HashMap names = new HashMap();
+ private final HashSet wides = new HashSet();
+ private final HashSet declared = new HashSet();
+ private boolean allocated = false;
+
+ public void declare(Object name)
+ {
+ declare(name, 1);
+ }
+
+ public void declareWide(Object name)
+ {
+ declare(name, 2);
+ }
+
+ public void declare(Object name, int size)
+ {
+ if (allocated)
+ throw new IllegalStateException("cannot declare after allocating");
+ if (size != 1 && size != 2)
+ throw new IllegalArgumentException("size must be 1 or 2");
+ if (names.containsKey(name))
+ throw new IllegalStateException("already allocated " + name);
+
+ allocateNew(name, size);
+ declared.add(name);
+ }
+
+ private int allocateNew(Object name, int size)
+ {
+ // total allocation size is first unallocated slot
+ int i = free.size() + names.size() + wides.size();
+ names.put(name, new Integer(i));
+ if (size == 2) wides.add(name);
+ return i;
+ }
+
+ public int allocate(Object name)
+ {
+ return allocate(name, 1);
+ }
+
+ public int allocateWide(Object name)
+ {
+ return allocate(name, 2);
+ }
+
+ public int allocate(Object name, int size)
+ {
+ allocated = true;
+ if (size != 1 && size != 2)
+ throw new IllegalArgumentException("size must be 1 or 2");
+ if (names.containsKey(name))
+ throw new IllegalStateException("already allocated " + name);
+
+ if (size == 2)
+ {
+ // look for consecutive free slots
+ for (Iterator it = free.iterator(); it.hasNext(); )
+ {
+ Integer i = (Integer) it.next();
+ Integer next = new Integer(i.intValue() + 1);
+ if (free.contains(next))
+ {
+ free.remove(i);
+ free.remove(next);
+ wides.add(name);
+ names.put(name, i);
+ return i.intValue();
+ }
+ }
+ }
+ else if (free.size() > 0)
+ {
+ Integer i = (Integer) free.iterator().next();
+ free.remove(i);
+ names.put(name, i);
+ return i.intValue();
+ }
+
+ return allocateNew(name, size);
+ }
+
+ public int deallocate(Object name)
+ {
+ if (! names.containsKey(name))
+ throw new IllegalArgumentException("no variable " + name);
+
+ if (declared.contains(name))
+ throw new IllegalStateException(name + " can't be deallocated");
+
+ Integer i = (Integer) names.get(name);
+ names.remove(name);
+ free.add(i);
+ if (wides.remove(name))
+ free.add(new Integer(i.intValue() + 1));
+ return i.intValue();
+ }
+
+ public int get(Object name)
+ {
+ if (! names.containsKey(name))
+ throw new IllegalArgumentException("no variable " + name);
+
+ return ((Integer) names.get(name)).intValue();
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/WrapUnWrapper.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/WrapUnWrapper.java
new file mode 100644
index 00000000000..c51925fa6b9
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/WrapUnWrapper.java
@@ -0,0 +1,83 @@
+/* WrapUnWrapper.java -- Wrapper and unwrapper for primitive types.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+*/
+
+
+package gnu.classpath.tools.rmic;
+
+
+public class WrapUnWrapper
+{
+ /**
+ * Get the wrapper class for the primitive type
+ *
+ * @param primitive the class of the primitive type
+ *
+ * @return the wrapper class
+ */
+ public static Class getWrappingClass(Class primitive)
+ {
+ if (primitive.equals(byte.class))
+ return Byte.class;
+ if (primitive.equals(int.class))
+ return Integer.class;
+ if (primitive.equals(long.class))
+ return Long.class;
+ if (primitive.equals(boolean.class))
+ return Boolean.class;
+ if (primitive.equals(double.class))
+ return Double.class;
+ if (primitive.equals(float.class))
+ return Float.class;
+ if (primitive.equals(char.class))
+ return Character.class;
+ else
+ return null;
+ }
+
+ /**
+ * Get the method, invocation of that would return the wrapped value.
+ *
+ * @param primitive the class of the primitive type.
+ *
+ * @return the wrapper method that unwraps the value to the primitive type.
+ */
+ public static String getUnwrappingMethod(Class primitive)
+ {
+ if (primitive.equals(byte.class))
+ return "byteValue()";
+ if (primitive.equals(int.class))
+ return "intValue()";
+ if (primitive.equals(long.class))
+ return "longValue()";
+ if (primitive.equals(boolean.class))
+ return "booleanValue()";
+ if (primitive.equals(double.class))
+ return "doubleValue()";
+ if (primitive.equals(float.class))
+ return "floatValue()";
+ if (primitive.equals(char.class))
+ return "charValue()";
+ else
+ return null;
+ }
+
+
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/ImplTie.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/ImplTie.jav
index aff606b90cc..aff606b90cc 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/ImplTie.jav
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/ImplTie.jav
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/Stub.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub.jav
index 371e12d4486..371e12d4486 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/Stub.jav
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub.jav
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/StubMethod.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/StubMethod.jav
index 17636deb670..17636deb670 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/StubMethod.jav
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/StubMethod.jav
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/StubMethodVoid.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/StubMethodVoid.jav
index 0125a02b0a3..0125a02b0a3 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/StubMethodVoid.jav
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/StubMethodVoid.jav
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12.jav
index 1c55a059799..1c55a059799 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12.jav
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12Method.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12Method.jav
index 9aaf8f5adc0..9aaf8f5adc0 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12Method.jav
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12Method.jav
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12MethodVoid.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12MethodVoid.jav
index 860a93c8447..860a93c8447 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12MethodVoid.jav
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12MethodVoid.jav
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/Tie.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Tie.jav
index 797ae1401de..797ae1401de 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/Tie.jav
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Tie.jav
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/TieMethod.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/TieMethod.jav
index 493f0009b48..493f0009b48 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/TieMethod.jav
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/TieMethod.jav
diff --git a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/TieMethodVoid.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/TieMethodVoid.jav
index 3db17da7c84..3db17da7c84 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/giop/grmic/templates/TieMethodVoid.jav
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/TieMethodVoid.jav
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmid/ActivationSystemImpl.java b/libjava/classpath/tools/gnu/classpath/tools/rmid/ActivationSystemImpl.java
new file mode 100644
index 00000000000..390117a0527
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmid/ActivationSystemImpl.java
@@ -0,0 +1,243 @@
+/* ActivationSystemImpl.java -- implementation of the activation system.
+ Copyright (c) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.rmid;
+
+import gnu.classpath.tools.common.Persistent;
+import gnu.java.rmi.activation.ActivationSystemTransient;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.rmi.MarshalledObject;
+import java.rmi.RemoteException;
+import java.rmi.activation.ActivationDesc;
+import java.rmi.activation.ActivationException;
+import java.rmi.activation.ActivationGroupDesc;
+import java.rmi.activation.ActivationGroupID;
+import java.rmi.activation.ActivationID;
+import java.rmi.activation.ActivationInstantiator;
+import java.rmi.activation.ActivationMonitor;
+import java.rmi.activation.ActivationSystem;
+import java.rmi.activation.Activator;
+import java.rmi.activation.UnknownGroupException;
+import java.rmi.activation.UnknownObjectException;
+
+/**
+ * Implements the rmid activation system.
+ *
+ * @author Audrius Meskauskas (audriusa@bioinformatics.org)
+ */
+public class ActivationSystemImpl extends ActivationSystemTransient implements
+ ActivationSystem, Activator, ActivationMonitor, Serializable
+{
+ /**
+ * Use for interoperability.
+ */
+ private static final long serialVersionUID = 1;
+
+ /**
+ * The singleton instance of this class.
+ */
+ public static ActivationSystemImpl singleton2;
+
+ /**
+ * Obtain the singleton instance of this class.
+ *
+ * @param folder the folder, where the activation system will keep its files.
+ * @param cold do the cold start if true, hot (usual) if false.
+ */
+ public static ActivationSystem getInstance(File folder, boolean cold)
+ {
+ if (singleton2 == null)
+ singleton2 = new ActivationSystemImpl(folder, cold);
+ return singleton2;
+ }
+
+ /**
+ * Creates the group with transient maps.
+ *
+ * @param folder
+ * the folder, where the activation system will keep its files.
+ * @param cold
+ * do the cold start if true, hot (usual) if false.
+ */
+ protected ActivationSystemImpl(File folder, boolean cold)
+ {
+ super(new PersistentBidiHashTable(), new PersistentBidiHashTable());
+ singleton2 = this;
+ ((PersistentBidiHashTable) groupDescs).init(
+ new File(folder, "asi_objects.data"), cold);
+ ((PersistentBidiHashTable) descriptions).init(
+ new File(folder, "asi_groups.data"), cold);
+ }
+
+ /** @inheritDoc */
+ public MarshalledObject activate(ActivationID id, boolean force)
+ throws ActivationException, UnknownObjectException, RemoteException
+ {
+ return super.activate(id, force);
+ }
+
+ /** @inheritDoc */
+ public ActivationMonitor activeGroup(ActivationGroupID id,
+ ActivationInstantiator group,
+ long incarnation)
+ throws UnknownGroupException, ActivationException, RemoteException
+ {
+ return super.activeGroup(id, group, incarnation);
+ }
+
+ /** @inheritDoc */
+ public void activeObject(ActivationID id, MarshalledObject obj)
+ throws UnknownObjectException, RemoteException
+ {
+ super.activeObject(id, obj);
+ }
+
+ /** @inheritDoc */
+ public ActivationDesc getActivationDesc(ActivationID id)
+ throws ActivationException, UnknownObjectException, RemoteException
+ {
+ return super.getActivationDesc(id);
+ }
+
+ public ActivationGroupDesc getActivationGroupDesc(ActivationGroupID groupId)
+ throws ActivationException, UnknownGroupException, RemoteException
+ {
+ return super.getActivationGroupDesc(groupId);
+ }
+
+ /** @inheritDoc */
+ public void inactiveGroup(ActivationGroupID groupId, long incarnation)
+ throws UnknownGroupException, RemoteException
+ {
+ super.inactiveGroup(groupId, incarnation);
+ }
+
+ /** @inheritDoc */
+ public void inactiveObject(ActivationID id) throws UnknownObjectException,
+ RemoteException
+ {
+ super.inactiveObject(id);
+ }
+
+ /** @inheritDoc */
+ public ActivationGroupID registerGroup(ActivationGroupDesc groupDesc)
+ throws ActivationException, RemoteException
+ {
+ return super.registerGroup(groupDesc);
+ }
+
+ /** @inheritDoc */
+ public ActivationID registerObject(ActivationDesc desc)
+ throws ActivationException, UnknownGroupException, RemoteException
+ {
+ return super.registerObject(desc);
+ }
+
+ /** @inheritDoc */
+ public ActivationDesc setActivationDesc(ActivationID id, ActivationDesc desc)
+ throws ActivationException, UnknownObjectException,
+ UnknownGroupException, RemoteException
+ {
+ return super.setActivationDesc(id, desc);
+ }
+
+ /** @inheritDoc */
+ public ActivationGroupDesc setActivationGroupDesc(
+ ActivationGroupID groupId, ActivationGroupDesc groupDesc)
+ throws ActivationException, UnknownGroupException, RemoteException
+ {
+ return super.setActivationGroupDesc(groupId, groupDesc);
+ }
+
+ /**
+ * This method saves the state of the activation system and then
+ * terminates in 10 seconds.
+ */
+ public void shutdown() throws RemoteException
+ {
+ super.shutdown();
+ System.out.println("Shutdown command received. Will terminate in 10 s");
+ Persistent.timer.schedule(new Persistent.ExitTask(), 10000);
+ }
+
+ /** @inheritDoc */
+ public void unregisterGroup(ActivationGroupID groupId)
+ throws ActivationException, UnknownGroupException, RemoteException
+ {
+ super.unregisterGroup(groupId);
+ }
+
+ /** @inheritDoc */
+ public void unregisterObject(ActivationID id) throws ActivationException,
+ UnknownObjectException, RemoteException
+ {
+ super.unregisterObject(id);
+ }
+
+ /**
+ * Read the object from the input stream.
+ *
+ * @param in the stream to read from
+ *
+ * @throws IOException if thrown by the stream
+ * @throws ClassNotFoundException
+ */
+ private void readObject(ObjectInputStream in) throws IOException,
+ ClassNotFoundException
+ {
+ // Read no fields.
+ }
+
+ /**
+ * Write the object to the output stream.
+ *
+ * @param out the stream to write int
+ * @throws IOException if thrown by the stream
+ * @throws ClassNotFoundException
+ */
+ private void writeObject(ObjectOutputStream out) throws IOException,
+ ClassNotFoundException
+ {
+ // Write no fields.
+ };
+
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmid/ActivationSystemImpl_Stub.java b/libjava/classpath/tools/gnu/classpath/tools/rmid/ActivationSystemImpl_Stub.java
new file mode 100644
index 00000000000..535f8ab92ac
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmid/ActivationSystemImpl_Stub.java
@@ -0,0 +1,556 @@
+/* ActivationSystemImpl.java -- implementation of the activation system.
+ Copyright (c) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.classpath.tools.rmid;
+
+import java.rmi.MarshalledObject;
+import java.rmi.RemoteException;
+import java.rmi.activation.ActivationDesc;
+import java.rmi.activation.ActivationException;
+import java.rmi.activation.ActivationGroupDesc;
+import java.rmi.activation.ActivationGroupID;
+import java.rmi.activation.ActivationID;
+import java.rmi.activation.ActivationInstantiator;
+import java.rmi.activation.ActivationMonitor;
+import java.rmi.activation.ActivationSystem;
+import java.rmi.activation.Activator;
+import java.rmi.activation.UnknownGroupException;
+import java.rmi.activation.UnknownObjectException;
+
+import java.lang.reflect.Method;
+import java.rmi.server.RemoteRef;
+import java.rmi.server.RemoteStub;
+import java.rmi.UnexpectedException;
+
+/**
+ * This class delegates its method calls to the remote RMI object, referenced
+ * by {@link RemoteRef}.
+ *
+ * It is normally generated with rmic.
+ */
+public final class ActivationSystemImpl_Stub
+ extends RemoteStub
+ implements ActivationMonitor, Activator, ActivationSystem
+{
+ /**
+ * Use serialVersionUID for interoperability
+ */
+ private static final long serialVersionUID = 2;
+
+ /**
+ * The explaining message for {@ling UnexpectedException}.
+ */
+ private static final String exception_message =
+ "undeclared checked exception";
+
+ /* All remote methods, invoked by this stub: */
+ private static final Method met_setActivationGroupDesc;
+ private static final Method met_inactiveGroup;
+ private static final Method met_unregisterObject;
+ private static final Method met_getActivationDesc;
+ private static final Method met_setActivationDesc;
+ private static final Method met_shutdown;
+ private static final Method met_activate;
+ private static final Method met_activeGroup;
+ private static final Method met_registerGroup;
+ private static final Method met_getActivationGroupDesc;
+ private static final Method met_activeObject;
+ private static final Method met_registerObject;
+ private static final Method met_inactiveObject;
+ private static final Method met_unregisterGroup;
+ private static final Object[] NO_ARGS = new Object[0];
+ static
+ {
+ final Class[] NO_ARGSc = new Class[0];
+ try
+ {
+ met_setActivationGroupDesc =
+ ActivationSystem.class.getMethod("setActivationGroupDesc", new Class[]
+ {
+ ActivationGroupID.class, ActivationGroupDesc.class
+ });
+ met_inactiveGroup =
+ ActivationMonitor.class.getMethod("inactiveGroup", new Class[]
+ {
+ ActivationGroupID.class, long.class
+ });
+ met_unregisterObject =
+ ActivationSystem.class.getMethod("unregisterObject", new Class[]
+ {
+ ActivationID.class
+ });
+ met_getActivationDesc =
+ ActivationSystem.class.getMethod("getActivationDesc", new Class[]
+ {
+ ActivationID.class
+ });
+ met_setActivationDesc =
+ ActivationSystem.class.getMethod("setActivationDesc", new Class[]
+ {
+ ActivationID.class, ActivationDesc.class
+ });
+ met_shutdown =
+ ActivationSystem.class.getMethod("shutdown", NO_ARGSc);
+ met_activate =
+ Activator.class.getMethod("activate", new Class[]
+ {
+ ActivationID.class, boolean.class
+ });
+ met_activeGroup =
+ ActivationSystem.class.getMethod("activeGroup", new Class[]
+ {
+ ActivationGroupID.class, ActivationInstantiator.class, long.class
+ });
+ met_registerGroup =
+ ActivationSystem.class.getMethod("registerGroup", new Class[]
+ {
+ ActivationGroupDesc.class
+ });
+ met_getActivationGroupDesc =
+ ActivationSystem.class.getMethod("getActivationGroupDesc", new Class[]
+ {
+ ActivationGroupID.class
+ });
+ met_activeObject =
+ ActivationMonitor.class.getMethod("activeObject", new Class[]
+ {
+ ActivationID.class, MarshalledObject.class
+ });
+ met_registerObject =
+ ActivationSystem.class.getMethod("registerObject", new Class[]
+ {
+ ActivationDesc.class
+ });
+ met_inactiveObject =
+ ActivationMonitor.class.getMethod("inactiveObject", new Class[]
+ {
+ ActivationID.class
+ });
+ met_unregisterGroup =
+ ActivationSystem.class.getMethod("unregisterGroup", new Class[]
+ {
+ ActivationGroupID.class
+ });
+
+ }
+ catch (NoSuchMethodException nex)
+ {
+ NoSuchMethodError err = new NoSuchMethodError(
+ "ActivationSystemImpl_Stub class initialization failed");
+ err.initCause(nex);
+ throw err;
+ }
+ }
+
+ /**
+ * Create the instance for _ActivationSystemImpl_Stub that forwards method calls to the
+ * remote object.
+ *
+ * @para the reference to the remote object.
+ */
+ public ActivationSystemImpl_Stub(RemoteRef reference)
+ {
+ super(reference);
+ }
+
+ /* Methods */
+ /** @inheritDoc */
+ public ActivationGroupDesc setActivationGroupDesc(ActivationGroupID p0,
+ ActivationGroupDesc p1)
+ throws ActivationException, UnknownGroupException, RemoteException
+ {
+ try
+ {
+ Object result = ref.invoke(this, met_setActivationGroupDesc,
+ new Object[] { p0, p1 },
+ 1213918527826541191L);
+ return (ActivationGroupDesc) result;
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public void inactiveGroup(ActivationGroupID p0, long p1)
+ throws UnknownGroupException, RemoteException
+ {
+ try
+ {
+ ref.invoke(this, met_inactiveGroup, new Object[] { p0, new Long(p1) },
+ -399287892768650944L);
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public void unregisterObject(ActivationID p0) throws ActivationException,
+ UnknownObjectException, RemoteException
+ {
+ try
+ {
+ ref.invoke(this, met_unregisterObject, new Object[] { p0 },
+ -6843850585331411084L);
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public ActivationDesc getActivationDesc(ActivationID p0)
+ throws ActivationException, UnknownObjectException, RemoteException
+ {
+ try
+ {
+ Object result = ref.invoke(this, met_getActivationDesc,
+ new Object[] { p0 }, 4830055440982622087L);
+ return (ActivationDesc) result;
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public ActivationDesc setActivationDesc(ActivationID p0, ActivationDesc p1)
+ throws ActivationException, UnknownObjectException,
+ UnknownGroupException, RemoteException
+ {
+ try
+ {
+ Object result = ref.invoke(this, met_setActivationDesc,
+ new Object[] { p0, p1 },
+ 7128043237057180796L);
+ return (ActivationDesc) result;
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public void shutdown() throws RemoteException
+ {
+ try
+ {
+ ref.invoke(this, met_shutdown, NO_ARGS, -7207851917985848402L);
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public MarshalledObject activate(ActivationID p0, boolean p1)
+ throws ActivationException, UnknownObjectException, RemoteException
+ {
+ try
+ {
+ Object result = ref.invoke(this, met_activate,
+ new Object[] { p0, new Boolean(p1) },
+ -8767355154875805558L);
+ return (MarshalledObject) result;
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public ActivationMonitor activeGroup(ActivationGroupID p0,
+ ActivationInstantiator p1, long p2)
+ throws UnknownGroupException, ActivationException, RemoteException
+ {
+ try
+ {
+ Object result = ref.invoke(this, met_activeGroup,
+ new Object[] { p0, p1, new Long(p2) },
+ -4575843150759415294L);
+ return (ActivationMonitor) result;
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public ActivationGroupID registerGroup(ActivationGroupDesc p0)
+ throws ActivationException, RemoteException
+ {
+ try
+ {
+ Object result = ref.invoke(this, met_registerGroup,
+ new Object[] { p0 }, 6921515268192657754L);
+ return (ActivationGroupID) result;
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public ActivationGroupDesc getActivationGroupDesc(ActivationGroupID p0)
+ throws ActivationException, UnknownGroupException, RemoteException
+ {
+ try
+ {
+ Object result = ref.invoke(this, met_getActivationGroupDesc,
+ new Object[] { p0 }, -8701843806548736528L);
+ return (ActivationGroupDesc) result;
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public void activeObject(ActivationID p0, MarshalledObject p1)
+ throws UnknownObjectException, RemoteException
+ {
+ try
+ {
+ ref.invoke(this, met_activeObject, new Object[] { p0, p1 },
+ 2543984342209939736L);
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public ActivationID registerObject(ActivationDesc p0)
+ throws ActivationException, UnknownGroupException, RemoteException
+ {
+ try
+ {
+ Object result = ref.invoke(this, met_registerObject,
+ new Object[] { p0 }, -3006759798994351347L);
+ return (ActivationID) result;
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public void inactiveObject(ActivationID p0) throws UnknownObjectException,
+ RemoteException
+ {
+ try
+ {
+ ref.invoke(this, met_inactiveObject, new Object[] { p0 },
+ -4165404120701281807L);
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public void unregisterGroup(ActivationGroupID p0) throws ActivationException,
+ UnknownGroupException, RemoteException
+ {
+ try
+ {
+ ref.invoke(this, met_unregisterGroup, new Object[] { p0 },
+ 3768097077835970701L);
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmid/Main.java b/libjava/classpath/tools/gnu/classpath/tools/rmid/Main.java
new file mode 100644
index 00000000000..d601b13f178
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmid/Main.java
@@ -0,0 +1,259 @@
+/* Main.java -- the RMI activation daemon.
+ Copyright (c) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.rmid;
+
+import gnu.classpath.tools.rmid.ActivationSystemImpl;
+import gnu.classpath.tools.common.ClasspathToolParser;
+import gnu.classpath.tools.getopt.FileArgumentCallback;
+import gnu.classpath.tools.getopt.Option;
+import gnu.classpath.tools.getopt.OptionException;
+import gnu.classpath.tools.getopt.OptionGroup;
+import gnu.classpath.tools.getopt.Parser;
+import gnu.java.rmi.activation.ActivationSystemTransient;
+import gnu.java.rmi.server.UnicastServerRef;
+
+import java.io.File;
+import java.net.InetAddress;
+import java.rmi.Remote;
+import java.rmi.activation.ActivationSystem;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.rmi.server.ObjID;
+import java.rmi.server.RMIServerSocketFactory;
+
+
+/**
+ * The persistent RMI activation daemon.
+ *
+ * @author Audrius Meskauskas (audriusa@bioinformatics.org)
+ */
+public class Main
+{
+ /**
+ * The RMI server socket factory.
+ */
+ static RMIServerSocketFactory ACTIVATION_REGISTY_SOCKET_FACTORY = null;
+
+ /**
+ * The activation registry port.
+ */
+ static int ACTIVATION_REGISTRY_PORT = ActivationSystem.SYSTEM_PORT;
+
+ /**
+ * The activation system name.
+ */
+ static String ACTIVATION_SYSTEM_NAME = "java.rmi.activation.ActivationSystem";
+
+ // Parse parameters:
+ private boolean stop = false;
+ private String directory = ".";
+ private boolean cold = false;
+ private boolean persistent = false;
+
+ private Parser initializeParser()
+ {
+ Parser parser = new ClasspathToolParser("rmiregistry", true); //$NON-NLS-1$
+ parser.setHeader(Messages.getString("Main.Usage")); //$NON-NLS-1$
+
+
+ OptionGroup controlGroup
+ = new OptionGroup(Messages.getString("Main.ControlGroup")); //$NON-NLS-1$
+ controlGroup.add(new Option("port", //$NON-NLS-1$
+ Messages.getString("Main.PortOption"), //$NON-NLS-1$
+ Messages.getString("Main.Port")) //$NON-NLS-1$
+ {
+ public void parsed(String portArgument) throws OptionException
+ {
+ ACTIVATION_REGISTRY_PORT = Integer.parseInt(portArgument);
+ }
+ });
+ controlGroup.add(new Option("restart", //$NON-NLS-1$
+ Messages.getString("Main.Restart")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ cold = true;
+ }
+ });
+ controlGroup.add(new Option("stop", //$NON-NLS-1$
+ Messages.getString("Main.Stop")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ stop = true;
+ }
+ });
+ parser.add(controlGroup);
+
+ OptionGroup persistenceGroup
+ = new OptionGroup(Messages.getString("Main.PersistenceGroup")); //$NON-NLS-1$
+ persistenceGroup.add(new Option("persistent", //$NON-NLS-1$
+ Messages.getString("Main.Persistent")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ persistent = true;
+ }
+ });
+ persistenceGroup.add(new Option("directory", //$NON-NLS-1$
+ Messages.getString("Main.Directory"), //$NON-NLS-1$
+ Messages.getString("Main.DirectoryArgument")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ directory = argument;
+ }
+ });
+ parser.add(persistenceGroup);
+
+ OptionGroup debuggingGroup
+ = new OptionGroup(Messages.getString("Main.DebugGroup")); //$NON-NLS-1$
+ debuggingGroup.add(new Option("verbose", //$NON-NLS-1$
+ Messages.getString ("Main.Verbose")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ ActivationSystemTransient.debug = true;
+ }
+ });
+ parser.add(debuggingGroup);
+
+ return parser;
+ }
+
+ private void run(String[] args)
+ {
+ Parser p = initializeParser();
+ p.parse(args);
+
+ try
+ {
+ if (!stop)
+ {
+ // Start the system.
+ File dataDirectory = new File(directory);
+ if (!dataDirectory.exists())
+ dataDirectory.mkdirs();
+ ActivationSystem system;
+
+ if (!persistent)
+ system = ActivationSystemTransient.getInstance();
+ else
+ system = ActivationSystemImpl.getInstance(dataDirectory, cold);
+
+ // We must export with the specific activation id that is only
+ // possible when going into the gnu.java.rmi.activation.
+ UnicastServerRef sref = new UnicastServerRef(
+ new ObjID(ObjID.ACTIVATOR_ID), ACTIVATION_REGISTRY_PORT,
+ ACTIVATION_REGISTY_SOCKET_FACTORY);
+ Remote systemStub = sref.exportObject(system);
+
+ // Start the naming system on the activation system port
+ // (if not already running).
+
+ Registry r;
+ try
+ {
+ // Expect the naming service running first.
+ // The local host may want to use the shared registry
+ r = LocateRegistry.getRegistry(ACTIVATION_REGISTRY_PORT);
+ r.rebind(ACTIVATION_SYSTEM_NAME, systemStub);
+ }
+ catch (Exception ex)
+ {
+ // The naming service is not running. Start it.
+ r = LocateRegistry.createRegistry(ACTIVATION_REGISTRY_PORT);
+ r.rebind(ACTIVATION_SYSTEM_NAME, systemStub);
+ }
+ String host = InetAddress.getLocalHost().getCanonicalHostName();
+ System.out.println("The RMI daemon is listening on " + host +
+ " (port "
+ + ACTIVATION_REGISTRY_PORT + ")");
+
+ }
+ else
+ {
+ // Stop the activation system.
+ Registry r;
+ try
+ {
+ System.out.print("Stopping RMI daemon at "
+ + ACTIVATION_REGISTRY_PORT+" ... ");
+ // Expect the naming service running first.
+ // The local host may want to use the shared registry
+ r = LocateRegistry.getRegistry(ACTIVATION_REGISTRY_PORT);
+ ActivationSystem asys =
+ (ActivationSystem) r.lookup(ACTIVATION_SYSTEM_NAME);
+ asys.shutdown();
+ System.out.println("OK.");
+ }
+ catch (Exception ex)
+ {
+ System.out.println("The RMI daemon seems not running at "
+ + ACTIVATION_REGISTRY_PORT);
+ if (ActivationSystemTransient.debug)
+ ex.printStackTrace();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ System.out.println("Failed to start the RMI daemon.");
+ if (ActivationSystemTransient.debug)
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * The activation system entry point.
+ */
+ public static void main(String[] args)
+ {
+ Main rmidprogram = new Main();
+ try
+ {
+ rmidprogram.run(args);
+ }
+ catch (Exception e)
+ {
+ System.err.println(Messages.getString("Main.InternalError")); //$NON-NLS-1$
+ e.printStackTrace(System.err);
+ System.exit(1);
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmid/Messages.java b/libjava/classpath/tools/gnu/classpath/tools/rmid/Messages.java
new file mode 100644
index 00000000000..4365c6de7ca
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmid/Messages.java
@@ -0,0 +1,67 @@
+/* Messages.java -- localization support for rmid
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.rmid;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages
+{
+ private static final String BUNDLE_NAME
+ = "gnu.classpath.tools.rmid.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE
+ = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages()
+ {
+ }
+
+ public static String getString(String key)
+ {
+ try
+ {
+ return RESOURCE_BUNDLE.getString(key);
+ }
+ catch (MissingResourceException e)
+ {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmid/PersistentBidiHashTable.java b/libjava/classpath/tools/gnu/classpath/tools/rmid/PersistentBidiHashTable.java
new file mode 100644
index 00000000000..d213373d5ff
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmid/PersistentBidiHashTable.java
@@ -0,0 +1,269 @@
+/* PersistentBidiHasthable.java -- Bidirectional persistent hash table.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.rmid;
+
+import gnu.classpath.tools.common.Persistent;
+import gnu.classpath.tools.rmid.ActivationSystemImpl;
+import gnu.java.rmi.activation.BidiTable;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.TimerTask;
+
+/**
+ * The persistent bidirectional hash table, maps both a to b and b to a. The
+ * changes are written to dist after SAVE_AT_MOST_AFTER time from the latest
+ * database change or at most after ALWAYS_UPDATE, if the database is updated
+ * very frequently. To ensure that no information is lost, the shutdown method
+ * must be called before exit.
+ *
+ * @author Audrius Meskauskas (audriusa@bioinformatics.org)
+ */
+public class PersistentBidiHashTable extends BidiTable implements
+ Persistent
+{
+ class WriteToDiskTask extends TimerTask
+ {
+ /**
+ * Save the database.
+ */
+ public void run()
+ {
+ writeContent();
+ sheduled = null;
+ }
+ }
+
+ /**
+ * Replaces instances of ActivationSystemImpl into the currently active
+ * instance of the ActivationSystemImpl
+ */
+ class AdaptedReader extends ObjectInputStream
+ {
+ AdaptedReader(InputStream in) throws IOException
+ {
+ super(in);
+ enableResolveObject(true);
+ }
+
+ protected Object resolveObject(Object obj) throws IOException
+ {
+ if (obj instanceof ActivationSystemImpl)
+ return ActivationSystemImpl.singleton2;
+ else
+ return obj;
+ }
+ }
+
+ /**
+ * The database file.
+ */
+ File database;
+
+ /**
+ * The currently sheduled write to disk task, null if none.
+ */
+ WriteToDiskTask sheduled = null;
+
+ /**
+ * The time, when the disk database was last updated.
+ */
+ long lastUpdated;
+
+ /**
+ * Create the unitialised instance that must be initalised when
+ * ActivationSystemImpl.singleton2 is assigned.
+ */
+ public PersistentBidiHashTable()
+ {
+ // Do not initalise the table fields - the initalise method must be
+ // called later.
+ super(0);
+ }
+
+ /**
+ * Create a new persistent table that stores its information into the given
+ * file. The ActivationSystemImpl.singleton2 must be assigned.
+ *
+ * @param file
+ * the file, where the table stores its information.
+ * @param coldStart
+ * if true, the existing file with this name will be erased and
+ * ignored. Otherwise, it will be assumed that the file contains the
+ * persistent table information.
+ */
+ public void init(File file, boolean coldStart)
+ {
+ try
+ {
+ database = file;
+ if (database.exists())
+ {
+ if (coldStart)
+ {
+ k2v = new Hashtable();
+ v2k = new Hashtable();
+ database.delete();
+ }
+ else
+ {
+ FileInputStream fi = new FileInputStream(file);
+ BufferedInputStream b = new BufferedInputStream(fi);
+ ObjectInputStream oin = new AdaptedReader(b);
+
+ k2v = (Map) oin.readObject();
+ oin.close();
+
+ v2k = new Hashtable(k2v.size());
+
+ // Reguild v2k from k2v:
+ Iterator en = k2v.keySet().iterator();
+ Object key;
+ while (en.hasNext())
+ {
+ key = en.next();
+ v2k.put(k2v.get(key), key);
+ }
+ }
+ }
+ else
+ {
+ k2v = new Hashtable();
+ v2k = new Hashtable();
+ }
+ }
+ catch (Exception ioex)
+ {
+ InternalError ierr = new InternalError("Unable to intialize with file "
+ + file);
+ ierr.initCause(ioex);
+ throw ierr;
+ }
+ }
+
+ /**
+ * Write the database content to the disk.
+ */
+ public synchronized void writeContent()
+ {
+ try
+ {
+ FileOutputStream fou = new FileOutputStream(database);
+ BufferedOutputStream b = new BufferedOutputStream(fou);
+ ObjectOutputStream oout = new ObjectOutputStream(b);
+ oout.writeObject(k2v);
+ oout.close();
+ }
+ catch (Exception ioex)
+ {
+ InternalError ierr = new InternalError(
+ "Failed to write database to disk: "
+ + database);
+ ierr.initCause(ioex);
+ throw ierr;
+ }
+ }
+
+ /**
+ * Mark the modified database as modified. The database will be written after
+ * several seconds, unless another modification occurs.
+ */
+ public void markDirty()
+ {
+ if (System.currentTimeMillis() - lastUpdated > ALWAYS_UPDATE)
+ {
+ // Force storing to disk under intensive operation.
+ writeContent();
+ lastUpdated = System.currentTimeMillis();
+ if (sheduled != null)
+ {
+ sheduled.cancel();
+ sheduled = null;
+ }
+ }
+ else
+ {
+ // Otherwise coalesce the disk database copy update events.
+ if (sheduled != null)
+ sheduled.cancel();
+ sheduled = new WriteToDiskTask();
+ timer.schedule(sheduled, SAVE_AT_MOST_AFTER);
+ }
+ }
+
+ /**
+ * Save the current database state to the disk before exit.
+ */
+ public void shutdown()
+ {
+ if (sheduled != null)
+ {
+ writeContent();
+ sheduled = null;
+ }
+ }
+
+ /**
+ * Update the memory maps and mark as should be written to the disk.
+ */
+ public void put(Object key, Object value)
+ {
+ super.put(key, value);
+ markDirty();
+ }
+
+ /**
+ * Update the memory maps and mark as should be written to the disk.
+ */
+ public void removeKey(Object key)
+ {
+ super.removeKey(key);
+ markDirty();
+ }
+
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/Main.java b/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/Main.java
new file mode 100644
index 00000000000..e5c41930de1
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/Main.java
@@ -0,0 +1,232 @@
+/* Main.java -- RMI registry starter.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.classpath.tools.rmiregistry;
+
+import gnu.classpath.tools.common.ClasspathToolParser;
+import gnu.classpath.tools.getopt.FileArgumentCallback;
+import gnu.classpath.tools.getopt.Option;
+import gnu.classpath.tools.getopt.OptionException;
+import gnu.classpath.tools.getopt.OptionGroup;
+import gnu.classpath.tools.getopt.Parser;
+import gnu.classpath.tools.rmiregistry.RegistryImpl;
+import gnu.java.rmi.server.UnicastServerRef;
+
+import java.io.File;
+import java.rmi.NotBoundException;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.rmi.server.ObjID;
+import java.rmi.server.RMIServerSocketFactory;
+import java.util.Hashtable;
+import java.util.Map;
+
+/**
+ * The optionally persistent RMI registry implementation.
+ *
+ * @author Audrius Meskauskas (audriusa@bioinformatics.org)
+ */
+public class Main
+{
+ /**
+ * The stop command.
+ */
+ public static String STOP = "gnu.classpath.tools.rmi.registry.command.STOP";
+
+ /**
+ * If true, the registry prints registration events to console.
+ */
+ public static boolean verbose = false;
+
+ /**
+ * Parsed parameters.
+ */
+ private String directory = ".";
+ private boolean cold = false;
+ private boolean persistent = false;
+ private boolean stop = false;
+ private int port = Registry.REGISTRY_PORT;
+ private RMIServerSocketFactory ssf = null;
+
+ private Parser initializeParser()
+ {
+ Parser parser = new ClasspathToolParser("rmiregistry", true); //$NON-NLS-1$
+ parser.setHeader(Messages.getString("Main.Usage")); //$NON-NLS-1$
+
+ OptionGroup controlGroup
+ = new OptionGroup(Messages.getString("Main.ControlGroup")); //$NON-NLS-1$
+ controlGroup.add(new Option("restart", //$NON-NLS-1$
+ Messages.getString("Main.Restart")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ cold = true;
+ }
+ });
+ controlGroup.add(new Option("stop", //$NON-NLS-1$
+ Messages.getString("Main.Stop")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ stop = true;
+ }
+ });
+ parser.add(controlGroup);
+
+ OptionGroup persistenceGroup
+ = new OptionGroup(Messages.getString("Main.PersistenceGroup")); //$NON-NLS-1$
+ persistenceGroup.add(new Option("persistent", //$NON-NLS-1$
+ Messages.getString("Main.Persistent")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ persistent = true;
+ }
+ });
+ persistenceGroup.add(new Option("directory", //$NON-NLS-1$
+ Messages.getString("Main.Directory"), //$NON-NLS-1$
+ Messages.getString("Main.DirectoryArgument")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ directory = argument;
+ }
+ });
+ parser.add(persistenceGroup);
+
+ OptionGroup debuggingGroup
+ = new OptionGroup(Messages.getString("Main.DebugGroup")); //$NON-NLS-1$
+ debuggingGroup.add(new Option("verbose", //$NON-NLS-1$
+ Messages.getString ("Main.Verbose")) //$NON-NLS-1$
+ {
+ public void parsed(String argument) throws OptionException
+ {
+ verbose = true;
+ }
+ });
+ parser.add(debuggingGroup);
+
+ return parser;
+ }
+
+ private void run(String[] args)
+ {
+ Parser p = initializeParser();
+ p.parse(args, new FileArgumentCallback()
+ {
+ public void notifyFile(String portArgument)
+ {
+ port = Integer.parseInt(portArgument);
+ }
+ });
+
+ if (!stop)
+ {
+ Map table;
+ if (!persistent)
+ table = new Hashtable();
+ else
+ {
+ // Start the system.
+ File dataDirectory = new File(directory);
+ if (!dataDirectory.exists())
+ dataDirectory.mkdirs();
+ table = PersistentHashTable.createInstance(
+ new File(dataDirectory, "rmiregistry.data"), cold);
+ }
+
+ RegistryImpl system = new RegistryImpl(table);
+
+ // We must export with the specific activation id that is only
+ // possible when going into the gnu.java.rmi
+ try
+ {
+ UnicastServerRef sref = new UnicastServerRef(
+ new ObjID(ObjID.REGISTRY_ID), port, ssf);
+
+ sref.exportObject(system);
+ System.out.println("The RMI naming service is listening at " + port);
+ }
+ catch (Exception ex)
+ {
+ System.out.println("Failed to start RMI naming service at " + port);
+ }
+ }
+ else
+ {
+ // Stop the naming service.
+ try
+ {
+ Registry r = LocateRegistry.getRegistry(port);
+ // Search for this specific line will command to stop the registry.
+
+ // Our service returns null, but any other service will thrown
+ // NotBoundException.
+ r.unbind(STOP);
+ }
+ catch (RemoteException e)
+ {
+ System.out.println("Failed to stop RMI naming service at " + port);
+ }
+ catch (NotBoundException e)
+ {
+ System.out.println("The naming service at port " + port + " is not a "
+ + Main.class.getName());
+ }
+ }
+ }
+
+ /**
+ * The RMI registry implementation entry point.
+ */
+ public static void main(String[] args)
+ {
+ Main rmiregistryprogram = new Main();
+ try
+ {
+ rmiregistryprogram.run(args);
+ }
+ catch (Exception e)
+ {
+ System.err.println(Messages.getString("Main.InternalError")); //$NON-NLS-1$
+ e.printStackTrace(System.err);
+ System.exit(1);
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/Messages.java b/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/Messages.java
new file mode 100644
index 00000000000..05bfcf62d23
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/Messages.java
@@ -0,0 +1,67 @@
+/* Messages.java -- localization support for rmiregistry
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.rmiregistry;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages
+{
+ private static final String BUNDLE_NAME
+ = "gnu.classpath.tools.rmiregistry.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE
+ = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages()
+ {
+ }
+
+ public static String getString(String key)
+ {
+ try
+ {
+ return RESOURCE_BUNDLE.getString(key);
+ }
+ catch (MissingResourceException e)
+ {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/PersistentHashTable.java b/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/PersistentHashTable.java
new file mode 100644
index 00000000000..89d66ce4ad7
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/PersistentHashTable.java
@@ -0,0 +1,262 @@
+/* PersistentHasthable.java -- Persistent hash table.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.rmiregistry;
+
+import gnu.classpath.tools.common.Persistent;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.TimerTask;
+
+/**
+ * The persistent hash table. The changes are written to dist after
+ * SAVE_AT_MOST_AFTER time from the latest database change or at most after
+ * ALWAYS_UPDATE, if the database is updated very frequently. To ensure that no
+ * information is lost, the shutdown method must be called before exit.
+ *
+ * @author Audrius Meskauskas (audriusa@bioinformatics.org)
+ */
+public class PersistentHashTable
+ extends Hashtable
+ implements Serializable, Persistent
+{
+
+ /**
+ * Use serialVersionUID for interoperability
+ */
+ private static final long serialVersionUID = 1;
+
+ class WriteToDiskTask extends TimerTask
+ {
+ /**
+ * Save the database.
+ */
+ public void run()
+ {
+ writeContent();
+ sheduled = null;
+ }
+ }
+
+ /**
+ * The database file.
+ */
+ File database;
+
+ /**
+ * The currently sheduled write to disk task, null if none.
+ */
+ WriteToDiskTask sheduled = null;
+
+ /**
+ * The time, when the disk database was last updated.
+ */
+ long lastUpdated;
+
+ /**
+ * Setting to false prevents the automated disk update.
+ * The initial value is true to prevent writing while reading and is set
+ * to false in createInstance.
+ */
+ transient boolean ready;
+
+ /**
+ * Use static method to obtain the instance.
+ */
+ private PersistentHashTable(File file)
+ {
+ if (file == null)
+ throw new NullPointerException("Null file provided");
+ database = file;
+ }
+
+ /**
+ * Create a new persistent table that stores its information into the given
+ * file.
+ *
+ * @param file
+ * the file, where the table stores its information.
+ * @param coldStart
+ * if true, the existing file with this name will be erased and
+ * ignored. Otherwise, it will be assumed that the file contains the
+ * persistent table information.
+ */
+ public static Map createInstance(File file, boolean coldStart)
+ {
+ try
+ {
+ PersistentHashTable k2v;
+ System.out.println ("Here1");
+ if (file.exists())
+ {
+ System.out.println ("Here2");
+ if (coldStart)
+ {
+ System.out.println ("Here2.5");
+ file.delete();
+ k2v = new PersistentHashTable(file);
+ }
+ else
+ {
+ System.out.println ("Here3");
+ FileInputStream fi = new FileInputStream(file);
+ System.out.println ("Here3.1");
+ BufferedInputStream b = new BufferedInputStream(fi);
+ System.out.println ("Here3.2");
+ ObjectInputStream oin = new ObjectInputStream(b);
+ System.out.println ("Here3.3");
+
+ System.out.println ("Here4");
+ k2v = (PersistentHashTable) oin.readObject();
+ oin.close();
+ System.out.println ("Here5");
+ }
+ }
+ else
+ {
+ System.out.println ("Here6");
+ k2v = new PersistentHashTable(file);
+ System.out.println ("Here7");
+ }
+
+ System.out.println ("Here8");
+ k2v.ready = true;
+ return k2v;
+ }
+ catch (Exception ioex)
+ {
+ InternalError ierr = new InternalError("Unable to intialize with file "
+ + file);
+ ierr.initCause(ioex);
+ throw ierr;
+ }
+ }
+
+
+ /**
+ * Write the database content to the disk.
+ */
+ public synchronized void writeContent()
+ {
+ try
+ {
+ FileOutputStream fou = new FileOutputStream(database);
+ BufferedOutputStream b = new BufferedOutputStream(fou);
+ ObjectOutputStream oout = new ObjectOutputStream(b);
+ oout.writeObject(this);
+ oout.close();
+ }
+ catch (Exception ioex)
+ {
+ InternalError ierr = new InternalError(
+ "Failed to write database to disk: "+ database);
+ ierr.initCause(ioex);
+ throw ierr;
+ }
+ }
+
+ /**
+ * Mark the modified database as modified. The database will be written after
+ * several seconds, unless another modification occurs.
+ */
+ public void markDirty()
+ {
+ if (System.currentTimeMillis() - lastUpdated > ALWAYS_UPDATE)
+ {
+ // Force storing to disk under intensive operation.
+ writeContent();
+ lastUpdated = System.currentTimeMillis();
+ if (sheduled != null)
+ {
+ sheduled.cancel();
+ sheduled = null;
+ }
+ }
+ else
+ {
+ // Otherwise coalesce the disk database copy update events.
+ if (sheduled != null)
+ sheduled.cancel();
+ sheduled = new WriteToDiskTask();
+ timer.schedule(sheduled, SAVE_AT_MOST_AFTER);
+ }
+ }
+
+ /**
+ * Save the current database state to the disk before exit.
+ */
+ public void shutdown()
+ {
+ if (sheduled != null)
+ {
+ writeContent();
+ sheduled = null;
+ }
+ }
+
+ /**
+ * Update the memory maps and mark as should be written to the disk.
+ */
+ public Object put(Object key, Object value)
+ {
+ super.put(key, value);
+ if (ready)
+ markDirty();
+ return value;
+ }
+
+ /**
+ * Update the memory maps and mark as should be written to the disk.
+ */
+ public Object remove(Object key)
+ {
+ Object removed = super.remove(key);
+ if (ready)
+ markDirty();
+ return removed;
+ }
+
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/RegistryImpl.java b/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/RegistryImpl.java
new file mode 100644
index 00000000000..b93d3c1169e
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/RegistryImpl.java
@@ -0,0 +1,138 @@
+/* RegistryImpl.java -- the RMI registry implementation
+ Copyright (c) 1996, 1997, 1998, 1999, 2002, 2005, 2006
+ Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.rmiregistry;
+
+import gnu.classpath.tools.common.Persistent;
+
+import java.rmi.AccessException;
+import java.rmi.AlreadyBoundException;
+import java.rmi.NotBoundException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.registry.Registry;
+import java.util.ArrayList;
+import java.util.Map;
+
+/**
+ * The optionally persistent registry implementation.
+ *
+ * @author Audrius Meskauskas (audriusa@bioinformatics.org)
+ */
+public class RegistryImpl implements Registry
+{
+ /**
+ * The binding table.
+ */
+ Map bindings;
+
+ /**
+ * Create the registry implementation that uses the given bidirectinal
+ * table to keep the data.
+ */
+ public RegistryImpl(Map aTable)
+ {
+ bindings = aTable;
+ }
+
+ /** @inheritDoc */
+ public Remote lookup(String name) throws RemoteException, NotBoundException,
+ AccessException
+ {
+ Object obj = bindings.get(name);
+ if (obj == null)
+ throw new NotBoundException(name);
+ return ((Remote) obj);
+ }
+
+ /** @inheritDoc */
+ public void bind(String name, Remote obj) throws RemoteException,
+ AlreadyBoundException, AccessException
+ {
+ if (Main.verbose)
+ System.out.println("Bind "+name);
+ if (bindings.containsKey(name))
+ throw new AlreadyBoundException(name);
+ bindings.put(name, obj);
+ }
+
+ /** @inheritDoc */
+ public void unbind(String name) throws RemoteException, NotBoundException,
+ AccessException
+ {
+ if (name.equals(Main.STOP))
+ {
+ if (bindings instanceof Persistent)
+ ((Persistent) bindings).writeContent();
+ // Terminate in 10 seconds.
+ System.out.println("Shutdown command received. Will terminate in 10 s");
+ Persistent.timer.schedule(new Persistent.ExitTask(), 10000);
+ }
+ else
+ {
+ if (Main.verbose)
+ System.out.println("Unbind "+name);
+
+ if (!bindings.containsKey(name))
+ throw new NotBoundException(name);
+ else
+ bindings.remove(name);
+ }
+ }
+
+ /** @inheritDoc */
+ public void rebind(String name, Remote obj) throws RemoteException,
+ AccessException
+ {
+ if (Main.verbose)
+ System.out.println("Rebind "+name);
+ bindings.put(name, obj);
+ }
+
+ /** @inheritDoc */
+ public String[] list() throws RemoteException, AccessException
+ {
+ // Create a separated array to prevent race conditions.
+ ArrayList keys = new ArrayList(bindings.keySet());
+ int n = keys.size();
+ String[] rt = new String[n];
+ for (int i = 0; i < n; i++)
+ rt[i] = (String) keys.get(i);
+ return rt;
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/RegistryImpl_Skel.java b/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/RegistryImpl_Skel.java
new file mode 100644
index 00000000000..5150debd1de
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/RegistryImpl_Skel.java
@@ -0,0 +1,278 @@
+/* RegistryImpl_Skel.java
+ Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.classpath.tools.rmiregistry;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.rmi.MarshalException;
+import java.rmi.Remote;
+import java.rmi.UnmarshalException;
+import java.rmi.server.Operation;
+import java.rmi.server.RemoteCall;
+import java.rmi.server.SkeletonMismatchException;
+
+/**
+ * This skeleton supports unlikely cases when the naming service is
+ * contacted from other interoperable java implementation that still uses
+ * the old style skeleton-dependent invocations.
+ */
+public final class RegistryImpl_Skel
+ implements java.rmi.server.Skeleton
+{
+ private static final long interfaceHash = 4905912898345647071L;
+
+ /**
+ * Repeated multiple times.
+ */
+ static final String EUM = "error unmarshalling arguments for Registry";
+
+ /**
+ * Repeated multiple times.
+ */
+ static final String EMR = "error marshalling return from Registry";
+
+ private static final Operation[] operations =
+ {
+ new Operation("void bind(java.lang.String, Remote"),
+ new Operation("java.lang.String[] list("),
+ new Operation("Remote lookup(java.lang.String"),
+ new Operation("void rebind(java.lang.String, Remote"),
+ new Operation("void unbind(java.lang.String")
+ };
+
+ public Operation[] getOperations()
+ {
+ return ((Operation[]) operations.clone());
+ }
+
+ public void dispatch(Remote obj, RemoteCall call,
+ int opnum, long hash) throws java.lang.Exception
+ {
+ if (opnum < 0)
+ {
+ if (hash == 7583982177005850366L)
+ opnum = 0;
+ else if (hash == 2571371476350237748L)
+ opnum = 1;
+ else if (hash == -7538657168040752697L)
+ opnum = 2;
+ else if (hash == -8381844669958460146L)
+ opnum = 3;
+ else if (hash == 7305022919901907578L)
+ opnum = 4;
+ else
+ throw new SkeletonMismatchException("interface hash mismatch");
+ }
+ else if (hash != interfaceHash)
+ throw new SkeletonMismatchException("interface hash mismatch");
+
+ RegistryImpl server = (RegistryImpl) obj;
+ switch (opnum)
+ {
+ case 0:
+ {
+ java.lang.String $param_0;
+ Remote $param_1;
+ try
+ {
+ ObjectInput in = call.getInputStream();
+ $param_0 = (java.lang.String) in.readObject();
+ $param_1 = (Remote) in.readObject();
+
+ }
+ catch (IOException e)
+ {
+ throw new UnmarshalException(EUM, e);
+ }
+ catch (java.lang.ClassCastException e)
+ {
+ throw new UnmarshalException(EUM, e);
+ }
+ finally
+ {
+ call.releaseInputStream();
+ }
+ server.bind($param_0, $param_1);
+ try
+ {
+ ObjectOutput out = call.getResultStream(true);
+ }
+ catch (IOException e)
+ {
+ throw new MarshalException(EMR, e);
+ }
+ break;
+ }
+
+ case 1:
+ {
+ try
+ {
+ ObjectInput in = call.getInputStream();
+
+ }
+ catch (IOException e)
+ {
+ throw new UnmarshalException(EUM, e);
+ }
+ finally
+ {
+ call.releaseInputStream();
+ }
+ java.lang.String[] $result = server.list();
+ try
+ {
+ ObjectOutput out = call.getResultStream(true);
+ out.writeObject($result);
+ }
+ catch (IOException e)
+ {
+ throw new MarshalException(EMR, e);
+ }
+ break;
+ }
+
+ case 2:
+ {
+ java.lang.String $param_0;
+ try
+ {
+ ObjectInput in = call.getInputStream();
+ $param_0 = (java.lang.String) in.readObject();
+
+ }
+ catch (IOException e)
+ {
+ throw new UnmarshalException(EUM, e);
+ }
+ catch (java.lang.ClassCastException e)
+ {
+ throw new UnmarshalException(EUM, e);
+ }
+ finally
+ {
+ call.releaseInputStream();
+ }
+ Remote $result = server.lookup($param_0);
+ try
+ {
+ ObjectOutput out = call.getResultStream(true);
+ out.writeObject($result);
+ }
+ catch (IOException e)
+ {
+ throw new MarshalException(EMR, e);
+ }
+ break;
+ }
+
+ case 3:
+ {
+ java.lang.String $param_0;
+ Remote $param_1;
+ try
+ {
+ ObjectInput in = call.getInputStream();
+ $param_0 = (java.lang.String) in.readObject();
+ $param_1 = (Remote) in.readObject();
+
+ }
+ catch (IOException e)
+ {
+ throw new UnmarshalException(EUM, e);
+ }
+ catch (java.lang.ClassCastException e)
+ {
+ throw new UnmarshalException(EUM, e);
+ }
+ finally
+ {
+ call.releaseInputStream();
+ }
+ server.rebind($param_0, $param_1);
+ try
+ {
+ ObjectOutput out = call.getResultStream(true);
+ }
+ catch (IOException e)
+ {
+ throw new MarshalException(EMR, e);
+ }
+ break;
+ }
+
+ case 4:
+ {
+ java.lang.String $param_0;
+ try
+ {
+ ObjectInput in = call.getInputStream();
+ $param_0 = (java.lang.String) in.readObject();
+
+ }
+ catch (IOException e)
+ {
+ throw new UnmarshalException(EUM, e);
+ }
+ catch (java.lang.ClassCastException e)
+ {
+ throw new UnmarshalException(EUM, e);
+ }
+ finally
+ {
+ call.releaseInputStream();
+ }
+ server.unbind($param_0);
+ try
+ {
+ ObjectOutput out = call.getResultStream(true);
+ }
+ catch (IOException e)
+ {
+ throw new MarshalException(EMR, e);
+ }
+ break;
+ }
+
+ default:
+ throw new UnmarshalException("invalid method number");
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/RegistryImpl_Stub.java b/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/RegistryImpl_Stub.java
new file mode 100644
index 00000000000..94d35e92fb3
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/rmiregistry/RegistryImpl_Stub.java
@@ -0,0 +1,263 @@
+/* RegistryImpl_Stub.java -- Registry stub.
+ Copyright (c) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.rmiregistry;
+
+import java.rmi.AccessException;
+import java.rmi.AlreadyBoundException;
+import java.rmi.NotBoundException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.registry.Registry;
+
+import java.lang.reflect.Method;
+import java.rmi.server.RemoteRef;
+import java.rmi.server.RemoteStub;
+import java.rmi.UnexpectedException;
+
+/**
+ * This class delegates its method calls to the remote RMI object, referenced
+ * by {@link RemoteRef}.
+ *
+ * It is normally generated with rmic.
+ */
+public final class RegistryImpl_Stub
+ extends RemoteStub
+ implements Registry
+{
+ /**
+ * Use serialVersionUID for interoperability
+ */
+ private static final long serialVersionUID = 3;
+
+ /**
+ * The explaining message for {@ling UnexpectedException}.
+ */
+ private static final String exception_message =
+ "undeclared checked exception";
+
+ /* All remote methods, invoked by this stub: */
+ private static final Method met_list;
+ private static final Method met_rebind;
+ private static final Method met_unbind;
+ private static final Method met_lookup;
+ private static final Method met_bind;
+ private static final Object[] NO_ARGS = new Object[0];
+ static
+ {
+ final Class[] NO_ARGSc = new Class[0];
+ try
+ {
+ met_list =
+ Registry.class.getMethod("list", NO_ARGSc);
+ met_rebind =
+ Registry.class.getMethod("rebind", new Class[]
+ {
+ String.class, Remote.class
+ });
+ met_unbind =
+ Registry.class.getMethod("unbind", new Class[]
+ {
+ String.class
+ });
+ met_lookup =
+ Registry.class.getMethod("lookup", new Class[]
+ {
+ String.class
+ });
+ met_bind =
+ Registry.class.getMethod("bind", new Class[]
+ {
+ String.class, Remote.class
+ });
+
+ }
+ catch (NoSuchMethodException nex)
+ {
+ NoSuchMethodError err = new NoSuchMethodError(
+ "RegistryImpl_Stub class initialization failed");
+ err.initCause(nex);
+ throw err;
+ }
+ }
+
+ /**
+ * Create the instance for _RegistryImpl_Stub that forwards method calls to the
+ * remote object.
+ *
+ * @para the reference to the remote object.
+ */
+ public RegistryImpl_Stub(RemoteRef reference)
+ {
+ super(reference);
+ }
+
+ /* Methods */
+ /** @inheritDoc */
+ public String [] list()
+ throws RemoteException, AccessException
+ {
+ try
+ {
+ Object result = ref.invoke(this, met_list,
+ NO_ARGS,
+ 2571371476350237748L);
+ return (String []) result;
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public void rebind(String p0, Remote p1)
+ throws RemoteException, AccessException
+ {
+ try
+ {
+ ref.invoke(this, met_rebind,
+ new Object[] {p0, p1},
+ -8381844669958460146L);
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public void unbind(String p0)
+ throws RemoteException, NotBoundException, AccessException
+ {
+ try
+ {
+ ref.invoke(this, met_unbind,
+ new Object[] {p0},
+ 7305022919901907578L);
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public Remote lookup(String p0)
+ throws RemoteException, NotBoundException, AccessException
+ {
+ try
+ {
+ Object result = ref.invoke(this, met_lookup,
+ new Object[] {p0},
+ -7538657168040752697L);
+ return (Remote) result;
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+ /** @inheritDoc */
+ public void bind(String p0, Remote p1)
+ throws RemoteException, AlreadyBoundException, AccessException
+ {
+ try
+ {
+ ref.invoke(this, met_bind,
+ new Object[] {p0, p1},
+ 7583982177005850366L);
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (RemoteException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ UnexpectedException uex = new UnexpectedException(exception_message);
+ uex.detail = e;
+ throw uex;
+ }
+ }
+
+
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/serialver/SerialVer.java b/libjava/classpath/tools/gnu/classpath/tools/serialver/SerialVer.java
index b5a12ec927b..21e0a805a6f 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/serialver/SerialVer.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/serialver/SerialVer.java
@@ -21,7 +21,7 @@
package gnu.classpath.tools.serialver;
-import gnu.classpath.tools.getopt.ClasspathToolParser;
+import gnu.classpath.tools.common.ClasspathToolParser;
import gnu.classpath.tools.getopt.FileArgumentCallback;
import gnu.classpath.tools.getopt.Option;
import gnu.classpath.tools.getopt.OptionException;
diff --git a/libjava/classpath/tools/gnu/classpath/tools/tnameserv/Main.java b/libjava/classpath/tools/gnu/classpath/tools/tnameserv/Main.java
new file mode 100644
index 00000000000..460b7818532
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/tnameserv/Main.java
@@ -0,0 +1,117 @@
+/* Main.java -- Transient GIOP naming service.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.tnameserv;
+
+import gnu.CORBA.NamingService.NamingServiceTransient;
+import gnu.classpath.tools.common.ClasspathToolParser;
+import gnu.classpath.tools.getopt.FileArgumentCallback;
+import gnu.classpath.tools.getopt.Option;
+import gnu.classpath.tools.getopt.OptionException;
+import gnu.classpath.tools.getopt.OptionGroup;
+import gnu.classpath.tools.getopt.Parser;
+
+/**
+ * The implementation of the transient naming service. The naming service
+ * is a kind of the network server that registers local and remote objects
+ * by name, and later can provide the object reference in response to the
+ * given name.
+ *
+ * GNU Classpath currently works with this naming service and is also
+ * interoperable with the Sun Microsystems naming services from releases 1.3 and
+ * 1.4, both transient <i>tnameserv</i> and persistent <i>orbd</i>.
+ *
+ * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
+ */
+public class Main
+{
+ private int port = -1;
+ private String iorf;
+
+ private Parser initializeParser()
+ {
+ Parser parser = new ClasspathToolParser("tnameserv", true); //$NON-NLS-1$
+ parser.setHeader(Messages.getString("Main.Usage")); //$NON-NLS-1$
+
+ parser.add(new Option("ORBInitialPort", //$NON-NLS-1$
+ Messages.getString("Main.ORBInitialPort"), //$NON-NLS-1$
+ Messages.getString("Main.Port")) //$NON-NLS-1$
+ {
+ public void parsed(String portArgument) throws OptionException
+ {
+ port = Integer.parseInt(portArgument);
+ }
+ });
+
+ parser.add(new Option("ior", //$NON-NLS-1$
+ Messages.getString("Main.IOR"), //$NON-NLS-1$
+ Messages.getString("Main.IORFile")) //$NON-NLS-1$
+ {
+ public void parsed(String fileArgument) throws OptionException
+ {
+ iorf = fileArgument;
+ }
+ });
+
+ return parser;
+ }
+
+ private void run(String[] args)
+ {
+ Parser p = initializeParser();
+ p.parse(args);
+ NamingServiceTransient.start(port, iorf);
+ }
+
+ /**
+ * The naming service entry point.
+ */
+ public static void main(String[] args)
+ {
+ Main tnameservprogram = new Main();
+ try
+ {
+ tnameservprogram.run(args);
+ }
+ catch (Exception e)
+ {
+ System.err.println(Messages.getString("Main.InternalError")); //$NON-NLS-1$
+ e.printStackTrace(System.err);
+ System.exit(1);
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gnu/classpath/tools/tnameserv/Messages.java b/libjava/classpath/tools/gnu/classpath/tools/tnameserv/Messages.java
new file mode 100644
index 00000000000..505397302b4
--- /dev/null
+++ b/libjava/classpath/tools/gnu/classpath/tools/tnameserv/Messages.java
@@ -0,0 +1,67 @@
+/* Messages.java -- localization support for tnameserv
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.classpath.tools.tnameserv;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages
+{
+ private static final String BUNDLE_NAME
+ = "gnu.classpath.tools.tnameserv.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE
+ = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages()
+ {
+ }
+
+ public static String getString(String key)
+ {
+ try
+ {
+ return RESOURCE_BUNDLE.getString(key);
+ }
+ catch (MissingResourceException e)
+ {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/libjava/classpath/tools/gorbd.in b/libjava/classpath/tools/gorbd.in
new file mode 100644
index 00000000000..ab1a19a8602
--- /dev/null
+++ b/libjava/classpath/tools/gorbd.in
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+## Copyright (C) 2006 Free Software Foundation, Inc.
+##
+## This file is a part of GNU Classpath.
+##
+## GNU Classpath is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or (at
+## your option) any later version.
+##
+## GNU Classpath is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with GNU Classpath; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+## USA.
+##
+## Linking this library statically or dynamically with other modules is
+## making a combined work based on this library. Thus, the terms and
+## conditions of the GNU General Public License cover the whole
+## combination.
+##
+## As a special exception, the copyright holders of this library give you
+## permission to link this library with independent modules to produce an
+## executable, regardless of the license terms of these independent
+## modules, and to copy and distribute the resulting executable under
+## terms of your choice, provided that you also meet, for each linked
+## independent module, the terms and conditions of the license of that
+## module. An independent module is a module which is not derived from
+## or based on this library. If you modify this library, you may extend
+## this exception to your version of the library, but you are not
+## obligated to do so. If you do not wish to do so, delete this
+## exception statement from your version.
+##
+##
+## A simple shell script to launch the GNU Classpath orbd tool.
+##
+
+prefix=@prefix@
+tools_dir=@datadir@/@PACKAGE@
+tools_cp=${tools_dir}/tools.zip
+
+exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.orbd.Main "$@"
diff --git a/libjava/classpath/tools/grmic.in b/libjava/classpath/tools/grmic.in
new file mode 100644
index 00000000000..eabce0e498c
--- /dev/null
+++ b/libjava/classpath/tools/grmic.in
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+## Copyright (C) 2006 Free Software Foundation, Inc.
+##
+## This file is a part of GNU Classpath.
+##
+## GNU Classpath is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or (at
+## your option) any later version.
+##
+## GNU Classpath is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with GNU Classpath; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+## USA.
+##
+## Linking this library statically or dynamically with other modules is
+## making a combined work based on this library. Thus, the terms and
+## conditions of the GNU General Public License cover the whole
+## combination.
+##
+## As a special exception, the copyright holders of this library give you
+## permission to link this library with independent modules to produce an
+## executable, regardless of the license terms of these independent
+## modules, and to copy and distribute the resulting executable under
+## terms of your choice, provided that you also meet, for each linked
+## independent module, the terms and conditions of the license of that
+## module. An independent module is a module which is not derived from
+## or based on this library. If you modify this library, you may extend
+## this exception to your version of the library, but you are not
+## obligated to do so. If you do not wish to do so, delete this
+## exception statement from your version.
+##
+##
+## A simple shell script to launch the GNU Classpath rmic tool.
+##
+
+prefix=@prefix@
+tools_dir=@datadir@/@PACKAGE@
+tools_cp=${tools_dir}/tools.zip
+
+exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.rmic.Main "$@"
diff --git a/libjava/classpath/tools/grmid.in b/libjava/classpath/tools/grmid.in
new file mode 100644
index 00000000000..aa4e1432ad1
--- /dev/null
+++ b/libjava/classpath/tools/grmid.in
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+## Copyright (C) 2006 Free Software Foundation, Inc.
+##
+## This file is a part of GNU Classpath.
+##
+## GNU Classpath is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or (at
+## your option) any later version.
+##
+## GNU Classpath is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with GNU Classpath; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+## USA.
+##
+## Linking this library statically or dynamically with other modules is
+## making a combined work based on this library. Thus, the terms and
+## conditions of the GNU General Public License cover the whole
+## combination.
+##
+## As a special exception, the copyright holders of this library give you
+## permission to link this library with independent modules to produce an
+## executable, regardless of the license terms of these independent
+## modules, and to copy and distribute the resulting executable under
+## terms of your choice, provided that you also meet, for each linked
+## independent module, the terms and conditions of the license of that
+## module. An independent module is a module which is not derived from
+## or based on this library. If you modify this library, you may extend
+## this exception to your version of the library, but you are not
+## obligated to do so. If you do not wish to do so, delete this
+## exception statement from your version.
+##
+##
+## A simple shell script to launch the GNU Classpath rmid tool.
+##
+
+prefix=@prefix@
+tools_dir=@datadir@/@PACKAGE@
+tools_cp=${tools_dir}/tools.zip
+
+exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.rmid.Main "$@"
diff --git a/libjava/classpath/tools/grmiregistry.in b/libjava/classpath/tools/grmiregistry.in
new file mode 100644
index 00000000000..5e2798fd3ad
--- /dev/null
+++ b/libjava/classpath/tools/grmiregistry.in
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+## Copyright (C) 2006 Free Software Foundation, Inc.
+##
+## This file is a part of GNU Classpath.
+##
+## GNU Classpath is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or (at
+## your option) any later version.
+##
+## GNU Classpath is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with GNU Classpath; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+## USA.
+##
+## Linking this library statically or dynamically with other modules is
+## making a combined work based on this library. Thus, the terms and
+## conditions of the GNU General Public License cover the whole
+## combination.
+##
+## As a special exception, the copyright holders of this library give you
+## permission to link this library with independent modules to produce an
+## executable, regardless of the license terms of these independent
+## modules, and to copy and distribute the resulting executable under
+## terms of your choice, provided that you also meet, for each linked
+## independent module, the terms and conditions of the license of that
+## module. An independent module is a module which is not derived from
+## or based on this library. If you modify this library, you may extend
+## this exception to your version of the library, but you are not
+## obligated to do so. If you do not wish to do so, delete this
+## exception statement from your version.
+##
+##
+## A simple shell script to launch the GNU Classpath rmiregistry tool.
+##
+
+prefix=@prefix@
+tools_dir=@datadir@/@PACKAGE@
+tools_cp=${tools_dir}/tools.zip
+
+exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.rmiregistry.Main "$@"
diff --git a/libjava/classpath/tools/gtnameserv.in b/libjava/classpath/tools/gtnameserv.in
new file mode 100644
index 00000000000..c8e7484f6ff
--- /dev/null
+++ b/libjava/classpath/tools/gtnameserv.in
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+## Copyright (C) 2006 Free Software Foundation, Inc.
+##
+## This file is a part of GNU Classpath.
+##
+## GNU Classpath is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or (at
+## your option) any later version.
+##
+## GNU Classpath is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with GNU Classpath; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+## USA.
+##
+## Linking this library statically or dynamically with other modules is
+## making a combined work based on this library. Thus, the terms and
+## conditions of the GNU General Public License cover the whole
+## combination.
+##
+## As a special exception, the copyright holders of this library give you
+## permission to link this library with independent modules to produce an
+## executable, regardless of the license terms of these independent
+## modules, and to copy and distribute the resulting executable under
+## terms of your choice, provided that you also meet, for each linked
+## independent module, the terms and conditions of the license of that
+## module. An independent module is a module which is not derived from
+## or based on this library. If you modify this library, you may extend
+## this exception to your version of the library, but you are not
+## obligated to do so. If you do not wish to do so, delete this
+## exception statement from your version.
+##
+##
+## A simple shell script to launch the GNU Classpath tnameserv tool.
+##
+
+prefix=@prefix@
+tools_dir=@datadir@/@PACKAGE@
+tools_cp=${tools_dir}/tools.zip
+
+exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.tnameserv.Main "$@"
diff --git a/libjava/classpath/tools/toolwrapper.c b/libjava/classpath/tools/toolwrapper.c
index 9ad14ac6d1b..41c07c690b8 100644
--- a/libjava/classpath/tools/toolwrapper.c
+++ b/libjava/classpath/tools/toolwrapper.c
@@ -37,6 +37,7 @@ obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
#include <jni.h>
+#include <ltdl.h>
#include <string.h>
#include <stdlib.h>
#include "config.h"
@@ -51,6 +52,9 @@ union env_union
JNIEnv *jni_env;
};
+/* Typedef for JNI_CreateJavaVM dlopen call. */
+typedef jint createVM (JavaVM **, void **, void *);
+
int
main (int argc, const char** argv)
{
@@ -68,6 +72,10 @@ main (int argc, const char** argv)
int non_vm_argc;
int i;
int classpath_found = 0;
+ /* Variables for JNI_CreateJavaVM dlopen call. */
+ lt_dlhandle libjvm_handle = NULL;
+ createVM* libjvm_create = NULL;
+ int libjvm_error = 0;
env = NULL;
jvm = NULL;
@@ -128,7 +136,7 @@ main (int argc, const char** argv)
goto destroy;
}
- vm_args.options[vm_args.nOptions++].optionString = "-Djava.class.path=" TOOLS_ZIP;
+ vm_args.options[vm_args.nOptions++].optionString = "-Xbootclasspath/p:" TOOLS_ZIP;
}
/* Terminate vm_args.options with a NULL element. */
@@ -152,7 +160,27 @@ main (int argc, const char** argv)
vm_args.version = JNI_VERSION_1_2;
vm_args.ignoreUnrecognized = JNI_TRUE;
- result = JNI_CreateJavaVM (&jvm, &tmp.void_env, &vm_args);
+ /* dlopen libjvm.so */
+ libjvm_error = lt_dlinit ();
+ if (libjvm_error)
+ {
+ fprintf (stderr, TOOLNAME ": lt_dlinit failed.\n");
+ goto destroy;
+ }
+
+ libjvm_handle = lt_dlopenext (LIBJVM);
+ if (!libjvm_handle)
+ {
+ fprintf (stderr, TOOLNAME ": failed to open " LIBJVM "\n");
+ goto destroy;
+ }
+ libjvm_create = (createVM*) lt_dlsym (libjvm_handle, "JNI_CreateJavaVM");
+ if (!libjvm_create)
+ {
+ fprintf (stderr, TOOLNAME ": failed to load JNI_CreateJavaVM symbol from " LIBJVM "\n");
+ goto destroy;
+ }
+ result = (*libjvm_create) (&jvm, &tmp.void_env, &vm_args);
if (result < 0)
{
@@ -216,5 +244,15 @@ main (int argc, const char** argv)
(*jvm)->DestroyJavaVM (jvm);
}
+ /* libltdl cleanup */
+ if (libjvm_handle)
+ {
+ if (lt_dlclose (libjvm_handle) != 0)
+ fprintf (stderr, TOOLNAME ": failed to close " LIBJVM "\n");
+ }
+
+ if (lt_dlexit () != 0)
+ fprintf (stderr, TOOLNAME ": lt_dlexit failed.\n");
+
return 1;
}
diff --git a/libjava/classpath/vm/.cvsignore b/libjava/classpath/vm/.cvsignore
new file mode 100644
index 00000000000..282522db034
--- /dev/null
+++ b/libjava/classpath/vm/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/libjava/classpath/vm/reference/.cvsignore b/libjava/classpath/vm/reference/.cvsignore
new file mode 100644
index 00000000000..282522db034
--- /dev/null
+++ b/libjava/classpath/vm/reference/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/libjava/classpath/vm/reference/gnu/classpath/VMStackWalker.java b/libjava/classpath/vm/reference/gnu/classpath/VMStackWalker.java
index e995c46341d..2214e757110 100644
--- a/libjava/classpath/vm/reference/gnu/classpath/VMStackWalker.java
+++ b/libjava/classpath/vm/reference/gnu/classpath/VMStackWalker.java
@@ -1,5 +1,5 @@
/* VMStackWalker.java -- Reference implementation of VM hooks for stack access
- Copyright (C) 2005 Free Software Foundation
+ Copyright (C) 2005, 2006 Free Software Foundation
This file is part of GNU Classpath.
@@ -112,5 +112,20 @@ public final class VMStackWalker
* is here to work around access permissions.
*/
public static native ClassLoader getClassLoader(Class cl);
-}
+ /**
+ * Walk up the stack and return the first non-null class loader.
+ * If there aren't any non-null class loaders on the stack, return null.
+ */
+ public static ClassLoader firstNonNullClassLoader()
+ {
+ Class[] stack = getClassContext();
+ for (int i = 0; i < stack.length; i++)
+ {
+ ClassLoader loader = getClassLoader(stack[i]);
+ if (loader != null)
+ return loader;
+ }
+ return null;
+ }
+}
diff --git a/libjava/classpath/vm/reference/gnu/classpath/jdwp/VMVirtualMachine.java b/libjava/classpath/vm/reference/gnu/classpath/jdwp/VMVirtualMachine.java
index d4985bf2f2e..d8616063d19 100644
--- a/libjava/classpath/vm/reference/gnu/classpath/jdwp/VMVirtualMachine.java
+++ b/libjava/classpath/vm/reference/gnu/classpath/jdwp/VMVirtualMachine.java
@@ -199,7 +199,7 @@ public class VMVirtualMachine
* @return an array of virtual machine methods
*/
public static native VMMethod[] getAllClassMethods (Class klass)
- throws JdwpException;
+ { return null; }
/**
* A factory method for getting valid virtual machine methods
@@ -213,7 +213,7 @@ public class VMVirtualMachine
* @throws JdwpException for any other error
*/
public static native VMMethod getClassMethod(Class klass, long id)
- throws JdwpException;
+ { return null; }
/**
* Returns the thread's call stack
diff --git a/libjava/classpath/vm/reference/gnu/java/lang/management/VMMemoryMXBeanImpl.java b/libjava/classpath/vm/reference/gnu/java/lang/management/VMMemoryMXBeanImpl.java
index 193e3353517..43b9ae1a100 100644
--- a/libjava/classpath/vm/reference/gnu/java/lang/management/VMMemoryMXBeanImpl.java
+++ b/libjava/classpath/vm/reference/gnu/java/lang/management/VMMemoryMXBeanImpl.java
@@ -90,7 +90,7 @@ final class VMMemoryMXBeanImpl
* information when memory is allocated and deallocated. The
* format of the output is left up to the virtual machine.
*
- * @return true if verbose class loading output is on.
+ * @return true if verbose memory usage output is on.
*/
static native boolean isVerbose();
@@ -101,7 +101,7 @@ final class VMMemoryMXBeanImpl
* may be called by multiple threads concurrently, but there
* is only one global setting of verbosity that is affected.
*
- * @param verbose the new setting for verbose class loading
+ * @param verbose the new setting for verbose memory usage
* output.
*/
static native void setVerbose(boolean verbose);
diff --git a/libjava/classpath/vm/reference/gnu/java/net/VMPlainSocketImpl.java b/libjava/classpath/vm/reference/gnu/java/net/VMPlainSocketImpl.java
index 76be558dcd4..916f9593087 100644
--- a/libjava/classpath/vm/reference/gnu/java/net/VMPlainSocketImpl.java
+++ b/libjava/classpath/vm/reference/gnu/java/net/VMPlainSocketImpl.java
@@ -38,15 +38,16 @@ exception statement from your version. */
package gnu.java.net;
import java.io.IOException;
+import java.net.Inet4Address;
+import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
-import java.net.SocketAddress;
+import java.net.NetworkInterface;
import java.net.SocketException;
-import java.net.SocketImpl;
import java.net.SocketOptions;
-import java.net.UnknownHostException;
import gnu.classpath.Configuration;
+import gnu.java.nio.VMChannel;
/**
* The VM interface for {@link gnu.java.net.PlainSocketImpl}.
@@ -56,6 +57,12 @@ import gnu.classpath.Configuration;
*/
public final class VMPlainSocketImpl
{
+ /** Option id for time to live
+ */
+ private static final int CP_IP_TTL = 0x1E61;
+
+ private final State nfd;
+
/**
* Static initializer to load native library.
*/
@@ -66,249 +73,440 @@ public final class VMPlainSocketImpl
System.loadLibrary("javanet");
}
}
+
+ public VMPlainSocketImpl()
+ {
+ // XXX consider adding security check here.
+ nfd = new State();
+ }
+
+ public VMPlainSocketImpl(VMChannel channel) throws IOException
+ {
+ this();
+ nfd.setChannelFD(channel.getState());
+ }
+
+ public State getState()
+ {
+ return nfd;
+ }
- /**
- * Sets the specified option on a socket to the passed in object.
- * The optionId parameter is one of the defined constants in
- * the SocketImpl interface.
- *
- * @param socket the socket object
- * @param optionId the identifier of the option
- * @param value the value to set the option to
+ /** This method exists to hide the CP_IP_TTL value from
+ * higher levels.
*
- * @throws SocketException if an error occurs
+ * Always think of JNode ... :)
*/
- static native void setOption(PlainSocketImpl socket, int optionId, Object value)
- throws SocketException;
+ public void setTimeToLive(int ttl)
+ throws SocketException
+ {
+ try
+ {
+ setOption(nfd.getNativeFD(), CP_IP_TTL, ttl);
+ }
+ catch (IOException ioe)
+ {
+ SocketException se = new SocketException();
+ se.initCause(ioe);
+ throw se;
+ }
+ }
- /**
- * Returns the current setting of the specified option. The optionId
- * is one of the defined constants in this interface.
- *
- * @param socket the socket object
- * @param optionId the option identifier
- *
- * @return the current value of the option
- *
- * @throws SocketException ff an error occurs
- */
- static native Object getOption(PlainSocketImpl socket, int optionId)
+ public int getTimeToLive()
+ throws SocketException
+ {
+ try
+ {
+ return getOption(nfd.getNativeFD(), CP_IP_TTL);
+ }
+ catch (IOException ioe)
+ {
+ SocketException se = new SocketException();
+ se.initCause(ioe);
+ throw se;
+ }
+ }
+
+ public void setOption(int optionId, Object optionValue)
+ throws SocketException
+ {
+ int value;
+ if (optionValue instanceof Integer)
+ value = ((Integer) optionValue).intValue();
+ else if (optionValue instanceof Boolean)
+ // Switching off the linger behavior is done by setting
+ // the value to -1. This is how the Java API interprets
+ // it.
+ value = ((Boolean) optionValue).booleanValue()
+ ? 1
+ : (optionId == SocketOptions.SO_LINGER)
+ ? -1
+ : 0;
+ else
+ throw new IllegalArgumentException("option value type "
+ + optionValue.getClass().getName());
+
+ try
+ {
+ setOption(nfd.getNativeFD(), optionId, value);
+ }
+ catch (IOException ioe)
+ {
+ SocketException se = new SocketException();
+ se.initCause(ioe);
+ throw se;
+ }
+ }
+
+ private static native void setOption(int fd, int id, int value)
throws SocketException;
- /**
- * Creates a new socket that is not bound to any local address/port and
- * is not connected to any remote address/port.
- *
- * @param socket the socket object
- *
- * @throws IOException if something goes wrong while creating the socket
- */
- static native void create(PlainSocketImpl socket) throws IOException;
+ public void setMulticastInterface(int optionId, InetAddress addr)
+ throws SocketException
+ {
+ try
+ {
+ if (addr instanceof Inet4Address)
+ setMulticastInterface(nfd.getNativeFD(), optionId, (Inet4Address) addr);
+ else if (addr instanceof Inet6Address)
+ {
+ NetworkInterface iface = NetworkInterface.getByInetAddress(addr);
+ setMulticastInterface6(nfd.getNativeFD(), optionId, iface.getName());
+ }
+ else
+ throw new SocketException("Unknown address format: " + addr);
+ }
+ catch (SocketException se)
+ {
+ throw se;
+ }
+ catch (IOException ioe)
+ {
+ SocketException se = new SocketException();
+ se.initCause(ioe);
+ throw se;
+ }
+ }
- /**
- * Connects to the remote address and port specified as arguments.
- *
- * @param socket the socket object
- * @param addr the remote address to connect to
- * @param port the remote port to connect to
- *
- * @throws IOException if an error occurs
- */
- static native void connect(PlainSocketImpl socket, InetAddress addr,
- int port) throws IOException;
+ private static native void setMulticastInterface(int fd,
+ int optionId,
+ Inet4Address addr);
- /**
- * Binds to the specified port on the specified addr. Note that this addr
- * must represent a local IP address. **** How bind to INADDR_ANY? ****
- *
- * @param socket the socket object
- * @param addr the address to bind to
- * @param port the port number to bind to
- *
- * @exception IOException If an error occurs
- */
- static native void bind(PlainSocketImpl socket, InetAddress addr, int port)
- throws IOException;
+ private static native void setMulticastInterface6(int fd,
+ int optionId,
+ String ifName);
/**
- * Starts listening for connections on a socket. The queueLen parameter
- * is how many pending connections will queue up waiting to be serviced
- * before being accepted. If the queue of pending requests exceeds this
- * number, additional connections will be refused.
- *
- * @param socket the socket object
- * @param queueLen the length of the pending connection queue
+ * Get a socket option. This implementation is only required to support
+ * socket options that are boolean values, which include:
+ *
+ * SocketOptions.IP_MULTICAST_LOOP
+ * SocketOptions.SO_BROADCAST
+ * SocketOptions.SO_KEEPALIVE
+ * SocketOptions.SO_OOBINLINE
+ * SocketOptions.SO_REUSEADDR
+ * SocketOptions.TCP_NODELAY
+ *
+ * and socket options that are integer values, which include:
*
- * @exception IOException if an error occurs
+ * SocketOptions.IP_TOS
+ * SocketOptions.SO_LINGER
+ * SocketOptions.SO_RCVBUF
+ * SocketOptions.SO_SNDBUF
+ * SocketOptions.SO_TIMEOUT
+ *
+ * @param optionId The option ID to fetch.
+ * @return A {@link Boolean} or {@link Integer} containing the socket
+ * option.
+ * @throws SocketException
*/
- static native void listen(PlainSocketImpl socket, int queueLen)
- throws IOException;
+ public Object getOption(int optionId) throws SocketException
+ {
+ int value;
+ try
+ {
+ value = getOption(nfd.getNativeFD(), optionId);
+ }
+ catch (IOException ioe)
+ {
+ SocketException se = new SocketException();
+ se.initCause(ioe);
+ throw se;
+ }
+
+ switch (optionId)
+ {
+ case SocketOptions.IP_MULTICAST_LOOP:
+ case SocketOptions.SO_BROADCAST:
+ case SocketOptions.SO_KEEPALIVE:
+ case SocketOptions.SO_OOBINLINE:
+ case SocketOptions.SO_REUSEADDR:
+ case SocketOptions.TCP_NODELAY:
+ return Boolean.valueOf(value != 0);
+
+ case SocketOptions.IP_TOS:
+ case SocketOptions.SO_LINGER:
+ case SocketOptions.SO_RCVBUF:
+ case SocketOptions.SO_SNDBUF:
+ case SocketOptions.SO_TIMEOUT:
+ return new Integer(value);
+
+ default:
+ throw new SocketException("getting option " + optionId +
+ " not supported here");
+ }
+ }
+
+ private static native int getOption(int fd, int id) throws SocketException;
/**
- * Accepts a new connection on this socket.
+ * Returns an Inet4Address or Inet6Address instance belonging to the
+ * interface which is set as the multicast interface.
*
- * @param socket the socket object
- * @param impl the socket object to accept this connection.
+ * The optionId is provided to make it possible that the native
+ * implementation may do something different depending on whether
+ * the value is SocketOptions.IP_MULTICAST_IF or
+ * SocketOptions.IP_MULTICAST_IF2.
*/
- static native void accept(PlainSocketImpl socket, SocketImpl impl)
- throws IOException;
+ public InetAddress getMulticastInterface(int optionId)
+ throws SocketException
+ {
+ try
+ {
+ return getMulticastInterface(nfd.getNativeFD(), optionId);
+ }
+ catch (IOException ioe)
+ {
+ SocketException se = new SocketException();
+ se.initCause(ioe);
+ throw se;
+ }
+ }
+ private static native InetAddress getMulticastInterface(int fd,
+ int optionId);
+
/**
- * Returns the number of bytes that the caller can read from this socket
- * without blocking.
- *
- * @param socket the socket object
+ * Binds this socket to the given local address and port.
*
- * @return the number of readable bytes before blocking
- *
- * @throws IOException If an error occurs
+ * @param address The address to bind to; the InetAddress is either
+ * an IPv4 or IPv6 address.
+ * @throws IOException If binding fails; for example, if the port
+ * in the given InetSocketAddress is privileged, and the current
+ * process has insufficient privileges.
*/
- static native int available(PlainSocketImpl socket) throws IOException;
-
+ public void bind(InetSocketAddress address) throws IOException
+ {
+ InetAddress addr = address.getAddress();
+ if (addr instanceof Inet4Address)
+ {
+ bind (nfd.getNativeFD(), addr.getAddress(), address.getPort());
+ }
+ else if (addr instanceof Inet6Address)
+ bind6 (nfd.getNativeFD(), addr.getAddress(), address.getPort());
+ else
+ throw new SocketException ("unsupported address type");
+ }
+
/**
- * Closes the socket. This will cause any InputStream or OutputStream
- * objects for this Socket to be closed as well.
- *
- * <p>
- * Note that if the SO_LINGER option is set on this socket, then the
- * operation could block.
- * </p>
- *
- * @param socket the socket object
+ * Native bind function for IPv4 addresses. The addr array must be
+ * exactly four bytes long.
+ *
+ * VMs without native support need not implement this.
*
- * @throws IOException if an error occurs
+ * @param fd The native file descriptor integer.
+ * @param addr The IPv4 address, in network byte order.
+ * @param port The port to bind to.
+ * @throws IOException
*/
- static native void close(PlainSocketImpl socket) throws IOException;
-
+ private static native void bind(int fd, byte[] addr, int port)
+ throws IOException;
+
/**
- * Internal method used by SocketInputStream for reading data from
- * the connection. Reads up to len bytes of data into the buffer
- * buf starting at offset bytes into the buffer.
- *
- * @param socket the socket object
- *
- * @return the actual number of bytes read or -1 if end of stream.
+ * Native bind function for IPv6 addresses. The addr array must be
+ * exactly sixteen bytes long.
+ *
+ * VMs without native support need not implement this.
*
- * @throws IOException if an error occurs
+ * @param fd The native file descriptor integer.
+ * @param addr The IPv6 address, in network byte order.
+ * @param port The port to bind to.
+ * @throws IOException
*/
- static native int read(PlainSocketImpl socket, byte[] buf, int offset,
- int len) throws IOException;
+ private static native void bind6(int fd, byte[] addr, int port)
+ throws IOException;
/**
- * Internal method used by SocketInputStream for reading data from
- * the connection. Reads and returns one byte of data.
- *
- * @param socket the socket object
- *
- * @return read byte or -1 if end of stream.
+ * Listen on this socket for incoming connections.
*
- * @throws IOException if an error occurs
+ * @param backlog The backlog of connections.
+ * @throws IOException If listening fails.
+ * @see gnu.java.nio.VMChannel#accept()
*/
- static int read(PlainSocketImpl socket) throws IOException
+ public void listen(int backlog) throws IOException
{
- byte[] buf = new byte[1];
- if (read(socket, buf, 0, 1) > 0)
- return buf[0] & 0xFF;
- else
- return -1;
+ listen(nfd.getNativeFD(), backlog);
}
-
+
/**
- * Internal method used by SocketOuputStream for writing data to
- * the connection. Writes up to len bytes of data from the buffer
- * <code>buf</code> starting at <cod>offset</code> bytes into the buffer.
+ * Native listen function. VMs without native support need not implement
+ * this.
*
- * @param socket the socket object
- * @param buf the buffer to write to the stream
- * @param offset the start offset in the buffer
- * @param len the number of bytes to write
- *
- * @throws IOException if an error occurs
+ * @param fd The file descriptor integer.
+ * @param backlog The listen backlog size.
+ * @throws IOException
*/
- static native void write(PlainSocketImpl socket, byte[] buf, int offset,
- int len) throws IOException;
+ private static native void listen(int fd, int backlog) throws IOException;
- /**
- * Internal method used by SocketOuputStream for writing data to
- * the connection. Writes exactly one byte to the socket.
- *
- * @param socket the socket object
- * @param data the byte to write to the socket
- *
- * @throws IOException if an error occurs
- */
- static void write(PlainSocketImpl socket, int data)
- throws IOException
+ public void join(InetAddress group) throws IOException
{
- write(socket, new byte[]{ (byte) data }, 0, 1);
+ if (group instanceof Inet4Address)
+ join(nfd.getNativeFD(), group.getAddress());
+ else if (group instanceof Inet6Address)
+ join6(nfd.getNativeFD(), group.getAddress());
+ else
+ throw new IllegalArgumentException("unknown address type");
}
+
+ private static native void join(int fd, byte[] addr) throws IOException;
+
+ private static native void join6(int fd, byte[] addr) throws IOException;
+
+ public void leave(InetAddress group) throws IOException
+ {
+ if (group instanceof Inet4Address)
+ leave(nfd.getNativeFD(), group.getAddress());
+ else if (group instanceof Inet6Address)
+ leave6(nfd.getNativeFD(), group.getAddress());
+ else
+ throw new IllegalArgumentException("unknown address type");
+ }
+
+ private static native void leave(int fd, byte[] addr) throws IOException;
+
+ private static native void leave6(int fd, byte[] addr) throws IOException;
- /**
- * Sets the input stream for this socket to the end of the stream. Any
- * attempts to read more bytes from the stream will return an EOF.
- *
- * @param socket the socket object
- *
- * @throws IOException if I/O errors occur
- */
- static native void shutdownInput(PlainSocketImpl socket) throws IOException;
-
- /**
- * Disables the output stream for this socket. Any attempt to write more
- * data to the socket will throw an IOException.
- *
- * @param socket the socket object
- *
- * @throws IOException if I/O errors occur
- */
- static native void shutdownOutput(PlainSocketImpl socket) throws IOException;
-
- /**
- * Connects to the remote socket address with a specified timeout.
- *
- * @param socket the socket object
- * @param address the remote address to connect to
- * @param timeout the timeout to use for this connect, 0 means infinite.
- *
- * @throws IOException if an error occurs
- */
- static synchronized void connect(PlainSocketImpl socket,
- SocketAddress address, int timeout)
+ public void joinGroup(InetSocketAddress addr, NetworkInterface netif)
throws IOException
{
- InetSocketAddress sockAddr = (InetSocketAddress) address;
- InetAddress addr = sockAddr.getAddress();
-
- if (addr == null)
- throw new UnknownHostException(sockAddr.getHostName());
-
- int port = sockAddr.getPort();
-
- if (timeout < 0)
- throw new IllegalArgumentException("negative timeout");
-
- Object oldTimeoutObj = null;
- try
- {
- oldTimeoutObj = getOption(socket, SocketOptions.SO_TIMEOUT);
- setOption(socket, SocketOptions.SO_TIMEOUT, new Integer(timeout));
- connect(socket, addr, port);
- }
- finally
- {
- if (oldTimeoutObj != null)
- setOption(socket, SocketOptions.SO_TIMEOUT, oldTimeoutObj);
- }
+ InetAddress address = addr.getAddress();
+
+ if (address instanceof Inet4Address)
+ joinGroup(nfd.getNativeFD(), address.getAddress(),
+ netif != null ? netif.getName() : null);
+ else if (address instanceof Inet6Address)
+ joinGroup6(nfd.getNativeFD(), address.getAddress(),
+ netif != null ? netif.getName() : null);
+ else
+ throw new IllegalArgumentException("unknown address type");
}
-
+
+ private static native void joinGroup(int fd, byte[] addr, String ifname)
+ throws IOException;
+
+ private static native void joinGroup6(int fd, byte[] addr, String ifname)
+ throws IOException;
+
+ public void leaveGroup(InetSocketAddress addr, NetworkInterface netif)
+ throws IOException
+ {
+ InetAddress address = addr.getAddress();
+ if (address instanceof Inet4Address)
+ leaveGroup(nfd.getNativeFD(), address.getAddress(),
+ netif != null ? netif.getName() : null);
+ else if (address instanceof Inet6Address)
+ leaveGroup6(nfd.getNativeFD(), address.getAddress(),
+ netif != null ? netif.getName() : null);
+ else
+ throw new IllegalArgumentException("unknown address type");
+ }
+
+ private static native void leaveGroup(int fd, byte[] addr, String ifname)
+ throws IOException;
+
+ private static native void leaveGroup6(int fd, byte[] addr, String ifname)
+ throws IOException;
+
+
+ public void shutdownInput() throws IOException
+ {
+ shutdownInput(nfd.getNativeFD());
+ }
+
+ private static native void shutdownInput(int native_fd) throws IOException;
+
+ public void shutdownOutput() throws IOException
+ {
+ shutdownOutput(nfd.getNativeFD());
+ }
+
+ private static native void shutdownOutput(int native_fd) throws IOException;
+
+ public void sendUrgentData(int data) throws IOException
+ {
+ sendUrgentData(nfd.getNativeFD(), data);
+ }
+
+ private static native void sendUrgentData(int natfive_fd, int data) throws IOException;
+
+ public void close() throws IOException
+ {
+ nfd.close();
+ }
+
+ // Inner classes.
+
/**
- * Send one byte of urgent data over the socket.
- *
- * @param socket the socket object
- * @param data the byte to send
+ * Our wrapper for the native file descriptor. In this implementation,
+ * it is a simple wrapper around {@link VMChannel.State}, to simplify
+ * management of the native state.
*/
- static void sendUrgendData(PlainSocketImpl socket, int data)
+ public final class State
{
- throw new InternalError ("PlainSocketImpl::sendUrgentData not implemented");
+ private VMChannel.State channelFd;
+
+ State()
+ {
+ channelFd = null;
+ }
+
+ public boolean isValid()
+ {
+ if (channelFd != null)
+ return channelFd.isValid();
+ return false;
+ }
+
+ public int getNativeFD() throws IOException
+ {
+ return channelFd.getNativeFD();
+ }
+
+ public void setChannelFD(final VMChannel.State nfd) throws IOException
+ {
+ if (this.channelFd != null && this.channelFd.isValid())
+ throw new IOException("file descriptor already initialized");
+ this.channelFd = nfd;
+ }
+
+ public void close() throws IOException
+ {
+ if (channelFd == null)
+ throw new IOException("invalid file descriptor");
+ channelFd.close();
+ }
+
+ protected void finalize() throws Throwable
+ {
+ try
+ {
+ if (isValid())
+ close();
+ }
+ finally
+ {
+ super.finalize();
+ }
+ }
}
}
+
diff --git a/libjava/classpath/vm/reference/gnu/java/nio/VMChannel.java b/libjava/classpath/vm/reference/gnu/java/nio/VMChannel.java
index fdea8ff6213..1f69877b6ba 100644
--- a/libjava/classpath/vm/reference/gnu/java/nio/VMChannel.java
+++ b/libjava/classpath/vm/reference/gnu/java/nio/VMChannel.java
@@ -39,13 +39,16 @@ exception statement from your version. */
package gnu.java.nio;
import gnu.classpath.Configuration;
-import gnu.java.net.PlainSocketImpl;
-import gnu.java.nio.PipeImpl.SinkChannelImpl;
-import gnu.java.nio.PipeImpl.SourceChannelImpl;
-import gnu.java.nio.channels.FileChannelImpl;
import java.io.IOException;
+import java.net.Inet4Address;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.SocketException;
import java.nio.ByteBuffer;
+import java.nio.MappedByteBuffer;
/**
* Native interface to support configuring of channel to run in a non-blocking
@@ -54,33 +57,43 @@ import java.nio.ByteBuffer;
* @author Michael Barker <mike@middlesoft.co.uk>
*
*/
-public class VMChannel
+public final class VMChannel
{
- private final int fd;
-
- private VMChannel(int fd)
- {
- this.fd = fd;
- }
+ /**
+ * Our reference implementation uses an integer to store the native
+ * file descriptor. Implementations without such support
+ */
+ private final State nfd;
- public static VMChannel getVMChannel(PlainSocketImpl socket)
- {
- return new VMChannel(socket.getNativeFD());
- }
+ private Kind kind;
- public static VMChannel getVMChannel(SourceChannelImpl source)
+ public VMChannel()
{
- return new VMChannel(source.getNativeFD());
+ // XXX consider adding security check here, so only Classpath
+ // code may create instances.
+ this.nfd = new State();
+ kind = Kind.OTHER;
}
- public static VMChannel getVMChannel(SinkChannelImpl sink)
+ /**
+ * This constructor is used by the POSIX reference implementation;
+ * other virtual machines need not support it.
+ *
+ * <strong>Important:</strong> do not call this in library code that is
+ * not specific to Classpath's reference implementation.
+ *
+ * @param native_fd The native file descriptor integer.
+ * @throws IOException
+ */
+ VMChannel(final int native_fd) throws IOException
{
- return new VMChannel(sink.getNativeFD());
+ this();
+ this.nfd.setNativeFD(native_fd);
}
- public static VMChannel getVMChannel(FileChannelImpl file)
+ public State getState()
{
- return new VMChannel(file.getNativeFD());
+ return nfd;
}
static
@@ -93,81 +106,151 @@ public class VMChannel
initIDs();
}
+ public static VMChannel getStdin() throws IOException
+ {
+ return new VMChannel(stdin_fd());
+ }
+
+ public static VMChannel getStdout() throws IOException
+ {
+ return new VMChannel(stdout_fd());
+ }
+
+ public static VMChannel getStderr() throws IOException
+ {
+ return new VMChannel(stderr_fd());
+ }
+
+ private static native int stdin_fd();
+ private static native int stdout_fd();
+ private static native int stderr_fd();
+
/**
* Set the file descriptor to have the required blocking
* setting.
*
- * @param fd
- * @param blocking
+ * @param blocking The blocking flag to set.
*/
- public native void setBlocking(int fd, boolean blocking);
+ public void setBlocking(boolean blocking) throws IOException
+ {
+ setBlocking(nfd.getNativeFD(), blocking);
+ }
- public void setBlocking(boolean blocking)
+ private static native void setBlocking(int fd, boolean blocking)
+ throws IOException;
+
+ public int available() throws IOException
{
- setBlocking(fd, blocking);
+ return available(nfd.getNativeFD());
}
+ private static native int available(int native_fd) throws IOException;
/**
* Reads a byte buffer directly using the supplied file descriptor.
- * Assumes that the buffer is a DirectBuffer.
*
- * @param fd Native file descriptor to read from.
* @param dst Direct Byte Buffer to read to.
* @return Number of bytes read.
* @throws IOException If an error occurs or dst is not a direct buffers.
*/
- native int read(int fd, ByteBuffer dst)
- throws IOException;
-
public int read(ByteBuffer dst)
throws IOException
{
- return read(fd, dst);
+ return read(nfd.getNativeFD(), dst);
+ }
+
+ private static native int read(int fd, ByteBuffer dst) throws IOException;
+
+ /**
+ * Read a single byte.
+ *
+ * @return The byte read, or -1 on end of file.
+ * @throws IOException
+ */
+ public int read() throws IOException
+ {
+ return read(nfd.getNativeFD());
}
+ private static native int read(int fd) throws IOException;
+
/**
* Reads into byte buffers directly using the supplied file descriptor.
* Assumes that the buffer list contains DirectBuffers. Will perform a
* scattering read.
*
- * @param fd Native file descriptor to read from.
* @param dsts An array direct byte buffers.
* @param offset Index of the first buffer to read to.
* @param length The number of buffers to read to.
* @return Number of bytes read.
* @throws IOException If an error occurs or the dsts are not direct buffers.
*/
- native long readScattering(int fd, ByteBuffer[] dsts, int offset, int length)
- throws IOException;
-
public long readScattering(ByteBuffer[] dsts, int offset, int length)
throws IOException
{
if (offset + length > dsts.length)
throw new IndexOutOfBoundsException("offset + length > dsts.length");
+
+ return readScattering(nfd.getNativeFD(), dsts, offset, length);
+ }
+
+ private static native long readScattering(int fd, ByteBuffer[] dsts,
+ int offset, int length)
+ throws IOException;
+
+ /**
+ * Receive a datagram on this channel, returning the host address
+ * that sent the datagram.
+ *
+ * @param dst Where to store the datagram.
+ * @return The host address that sent the datagram.
+ * @throws IOException
+ */
+ public SocketAddress receive(ByteBuffer dst) throws IOException
+ {
+ if (kind != Kind.SOCK_DGRAM)
+ throw new SocketException("not a datagram socket");
+ ByteBuffer hostPort = ByteBuffer.allocateDirect(18);
+ int hostlen = receive(nfd.getNativeFD(), dst, hostPort);
+ if (hostlen == 0)
+ return null;
+ if (hostlen == 4) // IPv4
+ {
+ byte[] addr = new byte[4];
+ hostPort.get(addr);
+ int port = hostPort.getShort() & 0xFFFF;
+ return new InetSocketAddress(Inet4Address.getByAddress(addr), port);
+ }
+ if (hostlen == 16) // IPv6
+ {
+ byte[] addr = new byte[16];
+ hostPort.get(addr);
+ int port = hostPort.getShort() & 0xFFFF;
+ return new InetSocketAddress(Inet6Address.getByAddress(addr), port);
+ }
- return readScattering(fd, dsts, offset, length);
+ throw new SocketException("host address received with invalid length: "
+ + hostlen);
}
+ private static native int receive (int fd, ByteBuffer dst, ByteBuffer address)
+ throws IOException;
+
/**
* Writes from a direct byte bufer using the supplied file descriptor.
* Assumes the buffer is a DirectBuffer.
*
- * @param fd
- * @param src
+ * @param src The source buffer.
* @return Number of bytes written.
* @throws IOException
*/
- native int write(int fd, ByteBuffer src)
- throws IOException;
-
- public int write(ByteBuffer src)
- throws IOException
+ public int write(ByteBuffer src) throws IOException
{
- return write(fd, src);
+ return write(nfd.getNativeFD(), src);
}
+ private native int write(int fd, ByteBuffer src) throws IOException;
+
/**
* Writes from byte buffers directly using the supplied file descriptor.
* Assumes the that buffer list constains DirectBuffers. Will perform
@@ -180,18 +263,488 @@ public class VMChannel
* @return Number of bytes written.
* @throws IOException
*/
- native long writeGathering(int fd, ByteBuffer[] srcs, int offset, int length)
- throws IOException;
-
public long writeGathering(ByteBuffer[] srcs, int offset, int length)
throws IOException
{
if (offset + length > srcs.length)
throw new IndexOutOfBoundsException("offset + length > srcs.length");
- return writeGathering(fd, srcs, offset, length);
+ // A gathering write is limited to 16 buffers; when writing, ensure
+ // that we have at least one buffer with something in it in the 16
+ // buffer window starting at offset.
+ while (!srcs[offset].hasRemaining() && offset < srcs.length)
+ offset++;
+
+ // There are no buffers with anything to write.
+ if (offset == srcs.length)
+ return 0;
+
+ // If we advanced `offset' so far that we don't have `length'
+ // buffers left, reset length to only the remaining buffers.
+ if (length > srcs.length - offset)
+ length = srcs.length - offset;
+
+ return writeGathering(nfd.getNativeFD(), srcs, offset, length);
+ }
+
+ private native long writeGathering(int fd, ByteBuffer[] srcs,
+ int offset, int length)
+ throws IOException;
+
+ /**
+ * Send a datagram to the given address.
+ *
+ * @param src The source buffer.
+ * @param dst The destination address.
+ * @return The number of bytes written.
+ * @throws IOException
+ */
+ public int send(ByteBuffer src, InetSocketAddress dst)
+ throws IOException
+ {
+ InetAddress addr = dst.getAddress();
+ if (addr == null)
+ throw new NullPointerException();
+ if (addr instanceof Inet4Address)
+ return send(nfd.getNativeFD(), src, addr.getAddress(), dst.getPort());
+ else if (addr instanceof Inet6Address)
+ return send6(nfd.getNativeFD(), src, addr.getAddress(), dst.getPort());
+ else
+ throw new SocketException("unrecognized inet address type");
+ }
+
+ // Send to an IPv4 address.
+ private static native int send(int fd, ByteBuffer src, byte[] addr, int port)
+ throws IOException;
+
+ // Send to an IPv6 address.
+ private static native int send6(int fd, ByteBuffer src, byte[] addr, int port)
+ throws IOException;
+
+ /**
+ * Write a single byte.
+ *
+ * @param b The byte to write.
+ * @throws IOException
+ */
+ public void write(int b) throws IOException
+ {
+ write(nfd.getNativeFD(), b);
}
+ private static native void write(int fd, int b) throws IOException;
+
private native static void initIDs();
+ // Network (socket) specific methods.
+
+ /**
+ * Create a new socket. This method will initialize the native file
+ * descriptor state of this instance.
+ *
+ * @param stream Whether or not to create a streaming socket, or a datagram
+ * socket.
+ * @throws IOException If creating a new socket fails, or if this
+ * channel already has its native descriptor initialized.
+ */
+ public void initSocket(boolean stream) throws IOException
+ {
+ if (nfd.isValid())
+ throw new IOException("native FD already initialized");
+ if (stream)
+ kind = Kind.SOCK_STREAM;
+ else
+ kind = Kind.SOCK_DGRAM;
+ nfd.setNativeFD(socket(stream));
+ }
+
+ /**
+ * Create a new socket, returning the native file descriptor.
+ *
+ * @param stream Set to true for streaming sockets; false for datagrams.
+ * @return The native file descriptor.
+ * @throws IOException If creating the socket fails.
+ */
+ private static native int socket(boolean stream) throws IOException;
+
+ /**
+ * Connect the underlying socket file descriptor to the remote host.
+ *
+ * @param saddr The address to connect to.
+ * @param timeout The connect timeout to use for blocking connects.
+ * @return True if the connection succeeded; false if the file descriptor
+ * is in non-blocking mode and the connection did not immediately
+ * succeed.
+ * @throws IOException If an error occurs while connecting.
+ */
+ public boolean connect(InetSocketAddress saddr, int timeout)
+ throws SocketException
+ {
+ int fd;
+
+ InetAddress addr = saddr.getAddress();
+
+ // Translates an IOException into a SocketException to conform
+ // to the throws clause.
+ try
+ {
+ fd = nfd.getNativeFD();
+ }
+ catch (IOException ioe)
+ {
+ throw new SocketException(ioe.getMessage());
+ }
+
+ if (addr instanceof Inet4Address)
+ return connect(fd, addr.getAddress(), saddr.getPort(),
+ timeout);
+ if (addr instanceof Inet6Address)
+ return connect6(fd, addr.getAddress(), saddr.getPort(),
+ timeout);
+ throw new SocketException("unsupported internet address");
+ }
+
+ private static native boolean connect(int fd, byte[] addr, int port, int timeout)
+ throws SocketException;
+
+ private static native boolean connect6(int fd, byte[] addr, int port, int timeout)
+ throws SocketException;
+
+ /**
+ * Disconnect this channel, if it is a datagram socket. Disconnecting
+ * a datagram channel will disassociate it from any address, so the
+ * socket will remain open, but can send and receive datagrams from
+ * any address.
+ *
+ * @throws IOException If disconnecting this channel fails, or if this
+ * channel is not a datagram channel.
+ */
+ public void disconnect() throws IOException
+ {
+ if (kind != Kind.SOCK_DGRAM)
+ throw new IOException("can only disconnect datagram channels");
+ disconnect(nfd.getNativeFD());
+ }
+
+ private static native void disconnect(int fd) throws IOException;
+
+ public InetSocketAddress getLocalAddress() throws IOException
+ {
+ if (!nfd.isValid())
+ return null;
+ ByteBuffer name = ByteBuffer.allocateDirect(18);
+ int namelen = getsockname(nfd.getNativeFD(), name);
+ if (namelen == 0) // not bound
+ return null; // XXX return some wildcard?
+ if (namelen == 4)
+ {
+ byte[] addr = new byte[4];
+ name.get(addr);
+ int port = name.getShort() & 0xFFFF;
+ return new InetSocketAddress(Inet4Address.getByAddress(addr), port);
+ }
+ if (namelen == 16)
+ {
+ byte[] addr = new byte[16];
+ name.get(addr);
+ int port = name.getShort() & 0xFFFF;
+ return new InetSocketAddress(Inet6Address.getByAddress(addr), port);
+ }
+ throw new SocketException("invalid address length");
+ }
+
+ private static native int getsockname(int fd, ByteBuffer name)
+ throws IOException;
+
+ /**
+ * Returns the socket address of the remote peer this channel is connected
+ * to, or null if this channel is not yet connected.
+ *
+ * @return The peer address.
+ * @throws IOException
+ */
+ public InetSocketAddress getPeerAddress() throws IOException
+ {
+ if (!nfd.isValid())
+ return null;
+ ByteBuffer name = ByteBuffer.allocateDirect(18);
+ int namelen = getpeername (nfd.getNativeFD(), name);
+ if (namelen == 0) // not connected yet
+ return null;
+ if (namelen == 4) // IPv4
+ {
+ byte[] addr = new byte[4];
+ name.get(addr);
+ int port = name.getShort() & 0xFFFF;
+ return new InetSocketAddress(Inet4Address.getByAddress(addr), port);
+ }
+ else if (namelen == 16) // IPv6
+ {
+ byte[] addr = new byte[16];
+ name.get(addr);
+ int port = name.getShort() & 0xFFFF;
+ return new InetSocketAddress(Inet6Address.getByAddress(addr), port);
+ }
+ throw new SocketException("invalid address length");
+ }
+
+ /*
+ * The format here is the peer address, followed by the port number.
+ * The returned value is the length of the peer address; thus, there
+ * will be LEN + 2 valid bytes put into NAME.
+ */
+ private static native int getpeername(int fd, ByteBuffer name)
+ throws IOException;
+
+ /**
+ * Accept an incoming connection, returning a new VMChannel, or null
+ * if the channel is nonblocking and no connection is pending.
+ *
+ * @return The accepted connection, or null.
+ * @throws IOException If an IO error occurs.
+ */
+ public VMChannel accept() throws IOException
+ {
+ int new_fd = accept(nfd.getNativeFD());
+ if (new_fd == -1) // non-blocking accept had no pending connection
+ return null;
+ return new VMChannel(new_fd);
+ }
+
+ private static native int accept(int native_fd) throws IOException;
+
+ // File-specific methods.
+
+ /**
+ * Open a file at PATH, initializing the native state to operate on
+ * that open file.
+ *
+ * @param path The absolute file path.
+ * @throws IOException If the file cannot be opened, or if this
+ * channel was previously initialized.
+ */
+ public void openFile(String path, int mode) throws IOException
+ {
+ if (nfd.isValid() || nfd.isClosed())
+ throw new IOException("can't reinitialize this channel");
+ int fd = open(path, mode);
+ nfd.setNativeFD(fd);
+ kind = Kind.FILE;
+ }
+
+ private static native int open(String path, int mode) throws IOException;
+
+ public long position() throws IOException
+ {
+ if (kind != Kind.FILE)
+ throw new IOException("not a file");
+ return position(nfd.getNativeFD());
+ }
+
+ private static native long position(int fd) throws IOException;
+
+ public void seek(long pos) throws IOException
+ {
+ if (kind != Kind.FILE)
+ throw new IOException("not a file");
+ seek(nfd.getNativeFD(), pos);
+ }
+
+ private static native void seek(int fd, long pos) throws IOException;
+
+ public void truncate(long length) throws IOException
+ {
+ if (kind != Kind.FILE)
+ throw new IOException("not a file");
+ truncate(nfd.getNativeFD(), length);
+ }
+
+ private static native void truncate(int fd, long len) throws IOException;
+
+ public boolean lock(long pos, long len, boolean shared, boolean wait)
+ throws IOException
+ {
+ if (kind != Kind.FILE)
+ throw new IOException("not a file");
+ return lock(nfd.getNativeFD(), pos, len, shared, wait);
+ }
+
+ private static native boolean lock(int fd, long pos, long len,
+ boolean shared, boolean wait)
+ throws IOException;
+
+ public void unlock(long pos, long len) throws IOException
+ {
+ if (kind != Kind.FILE)
+ throw new IOException("not a file");
+ unlock(nfd.getNativeFD(), pos, len);
+ }
+
+ private static native void unlock(int fd, long pos, long len) throws IOException;
+
+ public long size() throws IOException
+ {
+ if (kind != Kind.FILE)
+ throw new IOException("not a file");
+ return size(nfd.getNativeFD());
+ }
+
+ private static native long size(int fd) throws IOException;
+
+ public MappedByteBuffer map(char mode, long position, int size)
+ throws IOException
+ {
+ if (kind != Kind.FILE)
+ throw new IOException("not a file");
+ return map(nfd.getNativeFD(), mode, position, size);
+ }
+
+ private static native MappedByteBuffer map(int fd, char mode,
+ long position, int size)
+ throws IOException;
+
+ public boolean flush(boolean metadata) throws IOException
+ {
+ if (kind != Kind.FILE)
+ throw new IOException("not a file");
+ return flush(nfd.getNativeFD(), metadata);
+ }
+
+ private static native boolean flush(int fd, boolean metadata) throws IOException;
+
+ // Close.
+
+ /**
+ * Close this socket. The socket is also automatically closed when this
+ * object is finalized.
+ *
+ * @throws IOException If closing the socket fails, or if this object has
+ * no open socket.
+ */
+ public void close() throws IOException
+ {
+ nfd.close();
+ }
+
+ static native void close(int native_fd) throws IOException;
+
+ /**
+ * <p>Provides a simple mean for the JNI code to find out whether the
+ * current thread was interrupted by a call to Thread.interrupt().</p>
+ *
+ * @return
+ */
+ static boolean isThreadInterrupted()
+ {
+ return Thread.currentThread().isInterrupted();
+ }
+
+ // Inner classes.
+
+ /**
+ * A wrapper for a native file descriptor integer. This tracks the state
+ * of an open file descriptor, and ensures that
+ *
+ * This class need not be fully supported by virtual machines; if a
+ * virtual machine does not use integer file descriptors, or does and
+ * wishes to hide that, then the methods of this class may be stubbed out.
+ *
+ * System-specific classes that depend on access to native file descriptor
+ * integers SHOULD declare this fact.
+ */
+ public final class State
+ {
+ private int native_fd;
+ private boolean valid;
+ private boolean closed;
+
+ State()
+ {
+ native_fd = -1;
+ valid = false;
+ closed = false;
+ }
+
+ public boolean isValid()
+ {
+ return valid;
+ }
+
+ public boolean isClosed()
+ {
+ return closed;
+ }
+
+ public int getNativeFD() throws IOException
+ {
+ if (!valid)
+ throw new IOException("invalid file descriptor");
+ return native_fd;
+ }
+
+ void setNativeFD(final int native_fd) throws IOException
+ {
+ if (valid)
+ throw new IOException("file descriptor already initialized");
+ this.native_fd = native_fd;
+ valid = true;
+ }
+
+ public void close() throws IOException
+ {
+ if (!valid)
+ throw new IOException("invalid file descriptor");
+ try
+ {
+ VMChannel.close(native_fd);
+ }
+ finally
+ {
+ valid = false;
+ closed = true;
+ }
+ }
+
+ public String toString()
+ {
+ if (closed)
+ return "<<closed>>";
+ if (!valid)
+ return "<<invalid>>";
+ return String.valueOf(native_fd);
+ }
+
+ protected void finalize() throws Throwable
+ {
+ try
+ {
+ if (valid)
+ close();
+ }
+ finally
+ {
+ super.finalize();
+ }
+ }
+ }
+
+ /**
+ * An enumeration of possible kinds of channel.
+ */
+ static class Kind // XXX enum
+ {
+ /** A streaming (TCP) socket. */
+ static final Kind SOCK_STREAM = new Kind();
+
+ /** A datagram (UDP) socket. */
+ static final Kind SOCK_DGRAM = new Kind();
+
+ /** A file. */
+ static final Kind FILE = new Kind();
+
+ /** Something else; not a socket or file. */
+ static final Kind OTHER = new Kind();
+
+ private Kind() { }
+ }
}
diff --git a/libjava/classpath/vm/reference/gnu/java/nio/VMPipe.java b/libjava/classpath/vm/reference/gnu/java/nio/VMPipe.java
index 11dd2aa7b4b..e5257c1cf96 100644
--- a/libjava/classpath/vm/reference/gnu/java/nio/VMPipe.java
+++ b/libjava/classpath/vm/reference/gnu/java/nio/VMPipe.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package gnu.java.nio;
import java.io.IOException;
-import java.nio.channels.spi.SelectorProvider;
import gnu.classpath.Configuration;
/**
@@ -58,7 +57,24 @@ final class VMPipe
System.loadLibrary ("javanio");
}
}
-
- static native void init(PipeImpl self, SelectorProvider provider)
- throws IOException;
+
+ /**
+ * Create a pipe, consisting of a readable VMChannel and a writable
+ * VMChannel. The readable channel is returned is the first element
+ * of the array, and the writable in the second.
+ *
+ * @return A pair of VMChannels; the first readable, the second
+ * writable.
+ * @throws IOException If the pipe cannot be created.
+ */
+ static VMChannel[] pipe() throws IOException
+ {
+ VMChannel[] pipe = new VMChannel[2];
+ int[] fds = pipe0();
+ pipe[0] = new VMChannel(fds[0]);
+ pipe[1] = new VMChannel(fds[1]);
+ return pipe;
+ }
+
+ private static native int[] pipe0() throws IOException;
}
diff --git a/libjava/classpath/vm/reference/java/io/VMFile.java b/libjava/classpath/vm/reference/java/io/VMFile.java
index 2f48aad71f8..13d256d424a 100644
--- a/libjava/classpath/vm/reference/java/io/VMFile.java
+++ b/libjava/classpath/vm/reference/java/io/VMFile.java
@@ -38,6 +38,9 @@ exception statement from your version. */
package java.io;
+import java.net.MalformedURLException;
+import java.net.URL;
+
import gnu.classpath.Configuration;
import gnu.java.io.PlatformHelper;
@@ -209,6 +212,108 @@ final class VMFile
}
/**
+ * Returns the path as an absolute path name. The value returned is the
+ * current directory plus the separatory string plus the path of the file.
+ * The current directory is determined from the <code>user.dir</code> system
+ * property.
+ *
+ * @param path the path to convert to absolute path
+ *
+ * @return the absolute path that corresponds to <code>path</code>
+ */
+ static String getAbsolutePath(String path)
+ {
+ if (File.separatorChar == '\\'
+ && path.length() > 0 && path.charAt (0) == '\\')
+ {
+ // On Windows, even if the path starts with a '\\' it is not
+ // really absolute until we prefix the drive specifier from
+ // the current working directory to it.
+ return System.getProperty ("user.dir").substring (0, 2) + path;
+ }
+ else if (File.separatorChar == '\\'
+ && path.length() > 1 && path.charAt (1) == ':'
+ && ((path.charAt (0) >= 'a' && path.charAt (0) <= 'z')
+ || (path.charAt (0) >= 'A' && path.charAt (0) <= 'Z')))
+ {
+ // On Windows, a process has a current working directory for
+ // each drive and a path like "G:foo\bar" would mean the
+ // absolute path "G:\wombat\foo\bar" if "\wombat" is the
+ // working directory on the G drive.
+ String drvDir = null;
+ try
+ {
+ drvDir = new File (path.substring (0, 2)).getCanonicalPath();
+ }
+ catch (IOException e)
+ {
+ drvDir = path.substring (0, 2) + "\\";
+ }
+
+ // Note: this would return "C:\\." for the path "C:.", if "\"
+ // is the working folder on the C drive, but this is
+ // consistent with what Sun's JRE 1.4.1.01 actually returns!
+ if (path.length() > 2)
+ return drvDir + '\\' + path.substring (2, path.length());
+ else
+ return drvDir;
+ }
+ else if (path.equals(""))
+ return System.getProperty ("user.dir");
+ else
+ return System.getProperty ("user.dir") + File.separatorChar + path;
+ }
+
+ /**
+ * This method returns true if the path represents an absolute file
+ * path and false if it does not. The definition of an absolute path varies
+ * by system. As an example, on GNU systems, a path is absolute if it starts
+ * with a "/".
+ *
+ * @param path the path to check
+ *
+ * @return <code>true</code> if path represents an absolute file name,
+ * <code>false</code> otherwise.
+ */
+ static boolean isAbsolute(String path)
+ {
+ if (File.separatorChar == '\\')
+ return path.startsWith(File.separator + File.separator)
+ || (path.length() > 2
+ && ((path.charAt(0) >= 'a' && path.charAt(0) <= 'z')
+ || (path.charAt(0) >= 'A' && path.charAt(0) <= 'Z'))
+ && path.charAt(1) == ':'
+ && path.charAt(2) == '\\');
+ else
+ return path.startsWith(File.separator);
+ }
+
+ /**
+ * Returns a <code>URL</code> with the <code>file:</code>
+ * protocol that represents this file. The exact form of this URL is
+ * system dependent.
+ *
+ * @param file the file to convert to URL
+ *
+ * @return a <code>URL</code> for this object.
+ *
+ * @throws MalformedURLException if the URL cannot be created
+ * successfully.
+ */
+ static URL toURL(File file)
+ throws MalformedURLException
+ {
+ // On Win32, Sun's JDK returns URLs of the form "file:/c:/foo/bar.txt",
+ // while on UNIX, it returns URLs of the form "file:/foo/bar.txt".
+ if (File.separatorChar == '\\')
+ return new URL ("file:/" + file.getAbsolutePath().replace ('\\', '/')
+ + (file.isDirectory() ? "/" : ""));
+ else
+ return new URL ("file:" + file.getAbsolutePath()
+ + (file.isDirectory() ? "/" : ""));
+ }
+
+ /**
* This method returns a canonical representation of the pathname of
* this file. The actual form of the canonical representation is
* system-dependent. On the GNU system, conversion to canonical
diff --git a/libjava/classpath/vm/reference/java/io/VMObjectInputStream.java b/libjava/classpath/vm/reference/java/io/VMObjectInputStream.java
index 5fb56fcd4c9..be0f8eb5235 100644
--- a/libjava/classpath/vm/reference/java/io/VMObjectInputStream.java
+++ b/libjava/classpath/vm/reference/java/io/VMObjectInputStream.java
@@ -40,10 +40,7 @@ exception statement from your version. */
package java.io;
import gnu.classpath.Configuration;
-import gnu.classpath.VMStackWalker;
import java.lang.reflect.Constructor;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
final class VMObjectInputStream
{
@@ -56,42 +53,6 @@ final class VMObjectInputStream
}
/**
- * PrivilegedAction needed for Class.getClassLoader()
- */
- private static PrivilegedAction loaderAction = new PrivilegedAction()
- {
- /**
- * Returns the first user defined class loader on the call stack, or the
- * context class loader of the current thread, when no non-null class loader
- * was found.
- */
- public Object run()
- {
- Class[] ctx = VMStackWalker.getClassContext();
-
- for (int i = 0; i < ctx.length; i++)
- {
- ClassLoader cl = ctx[i].getClassLoader();
- if (cl != null)
- return cl;
- }
- return Thread.currentThread().getContextClassLoader();
- }
- };
-
- /**
- * Returns the first user defined class loader on the call stack, or the
- * context class loader of the current thread, when no non-null class loader
- * was found.
- *
- * @return the class loader
- */
- static ClassLoader currentClassLoader()
- {
- return (ClassLoader) AccessController.doPrivileged(loaderAction);
- }
-
- /**
* Allocates a new Object of type clazz but without running the
* default constructor on it. It then calls the given constructor on
* it. The given constructor method comes from the constr_clazz
diff --git a/libjava/classpath/vm/reference/java/lang/VMClassLoader.java b/libjava/classpath/vm/reference/java/lang/VMClassLoader.java
index 897df5186b3..e56152d0126 100644
--- a/libjava/classpath/vm/reference/java/lang/VMClassLoader.java
+++ b/libjava/classpath/vm/reference/java/lang/VMClassLoader.java
@@ -415,8 +415,9 @@ final class VMClassLoader
{
byte[] modifiedData = new byte[len];
System.arraycopy(data, offset, modifiedData, 0, len);
+ String jvmName = name.replace('.', '/');
modifiedData =
- ((InstrumentationImpl)instrumenter).callTransformers(loader, name,
+ ((InstrumentationImpl)instrumenter).callTransformers(loader, jvmName,
null, pd, modifiedData);
return defineClass(loader, name, modifiedData, 0, modifiedData.length,
diff --git a/libjava/classpath/vm/reference/java/lang/reflect/Constructor.java b/libjava/classpath/vm/reference/java/lang/reflect/Constructor.java
index 521190b6656..eebee5f5d2a 100644
--- a/libjava/classpath/vm/reference/java/lang/reflect/Constructor.java
+++ b/libjava/classpath/vm/reference/java/lang/reflect/Constructor.java
@@ -77,11 +77,11 @@ import java.util.Arrays;
* @since 1.1
* @status updated to 1.4
*/
-public final class Constructor
+public final class Constructor<T>
extends AccessibleObject
implements GenericDeclaration, Member
{
- private Class clazz;
+ private Class<T> clazz;
private int slot;
private static final int CONSTRUCTOR_MODIFIERS
@@ -104,7 +104,7 @@ public final class Constructor
* Gets the class that declared this constructor.
* @return the class that declared this member
*/
- public Class getDeclaringClass()
+ public Class<T> getDeclaringClass()
{
return clazz;
}
@@ -166,7 +166,7 @@ public final class Constructor
*
* @return a list of the types of the constructor's parameters
*/
- public native Class[] getParameterTypes();
+ public native Class<?>[] getParameterTypes();
/**
* Get the exception types this constructor says it throws, in no particular
@@ -175,7 +175,7 @@ public final class Constructor
*
* @return a list of the types in the constructor's throws clause
*/
- public native Class[] getExceptionTypes();
+ public native Class<?>[] getExceptionTypes();
/**
* Compare two objects to see if they are semantically equivalent.
@@ -244,8 +244,8 @@ public final class Constructor
return sb.toString();
}
- /* FIXME[GENERICS]: Add X extends GenericDeclaration and TypeVariable<X> */
- static void addTypeParameters(StringBuilder sb, TypeVariable[] typeArgs)
+ static <X extends GenericDeclaration>
+ void addTypeParameters(StringBuilder sb, TypeVariable<X>[] typeArgs)
{
if (typeArgs.length == 0)
return;
@@ -313,15 +313,15 @@ public final class Constructor
* @throws ExceptionInInitializerError if construction triggered class
* initialization, which then failed
*/
- public Object newInstance(Object args[])
+ public T newInstance(Object... args)
throws InstantiationException, IllegalAccessException,
InvocationTargetException
{
return constructNative(args, clazz, slot);
}
- private native Object constructNative(Object[] args, Class declaringClass,
- int slot)
+ private native T constructNative(Object[] args, Class declaringClass,
+ int slot)
throws InstantiationException, IllegalAccessException,
InvocationTargetException;
@@ -337,8 +337,7 @@ public final class Constructor
* specification, version 3.
* @since 1.5
*/
- /* FIXME[GENERICS]: Add <Constructor<T>> */
- public TypeVariable[] getTypeParameters()
+ public TypeVariable<Constructor<T>>[] getTypeParameters()
{
String sig = getSignature();
if (sig == null)
@@ -395,4 +394,3 @@ public final class Constructor
return p.getGenericParameterTypes();
}
}
-
diff --git a/libjava/classpath/vm/reference/java/lang/reflect/Field.java b/libjava/classpath/vm/reference/java/lang/reflect/Field.java
index 5121700fede..5db1fa3ecc1 100644
--- a/libjava/classpath/vm/reference/java/lang/reflect/Field.java
+++ b/libjava/classpath/vm/reference/java/lang/reflect/Field.java
@@ -102,7 +102,7 @@ extends AccessibleObject implements Member
* is a non-inherited member.
* @return the class that declared this member
*/
- public Class getDeclaringClass()
+ public Class<?> getDeclaringClass()
{
return declaringClass;
}
@@ -159,7 +159,7 @@ extends AccessibleObject implements Member
* Gets the type of this field.
* @return the type of this field
*/
- public native Class getType();
+ public native Class<?> getType();
/**
* Compare two objects to see if they are semantically equivalent.
@@ -213,7 +213,7 @@ extends AccessibleObject implements Member
sb.append(getName());
return sb.toString();
}
-
+
public String toGenericString()
{
StringBuilder sb = new StringBuilder(64);
@@ -658,5 +658,4 @@ extends AccessibleObject implements Member
* is no Signature attribute, return null.
*/
private native String getSignature();
-
}
diff --git a/libjava/classpath/vm/reference/java/lang/reflect/Method.java b/libjava/classpath/vm/reference/java/lang/reflect/Method.java
index a9920241b17..c520f057024 100644
--- a/libjava/classpath/vm/reference/java/lang/reflect/Method.java
+++ b/libjava/classpath/vm/reference/java/lang/reflect/Method.java
@@ -104,7 +104,7 @@ extends AccessibleObject implements Member, GenericDeclaration
* is a non-inherited member.
* @return the class that declared this member
*/
- public Class getDeclaringClass()
+ public Class<?> getDeclaringClass()
{
return declaringClass;
}
@@ -172,7 +172,7 @@ extends AccessibleObject implements Member, GenericDeclaration
* Gets the return type of this method.
* @return the type of this method
*/
- public native Class getReturnType();
+ public native Class<?> getReturnType();
/**
* Get the parameter list for this method, in declaration order. If the
@@ -180,7 +180,7 @@ extends AccessibleObject implements Member, GenericDeclaration
*
* @return a list of the types of the method's parameters
*/
- public native Class[] getParameterTypes();
+ public native Class<?>[] getParameterTypes();
/**
* Get the exception types this method says it throws, in no particular
@@ -189,7 +189,7 @@ extends AccessibleObject implements Member, GenericDeclaration
*
* @return a list of the types in the method's throws clause
*/
- public native Class[] getExceptionTypes();
+ public native Class<?>[] getExceptionTypes();
/**
* Compare two objects to see if they are semantically equivalent.
@@ -349,7 +349,7 @@ extends AccessibleObject implements Member, GenericDeclaration
* @throws ExceptionInInitializerError if accessing a static method triggered
* class initialization, which then failed
*/
- public Object invoke(Object o, Object[] args)
+ public Object invoke(Object o, Object... args)
throws IllegalAccessException, InvocationTargetException
{
return invokeNative(o, args, declaringClass, slot);
@@ -375,8 +375,7 @@ extends AccessibleObject implements Member, GenericDeclaration
* specification, version 3.
* @since 1.5
*/
- /* FIXME[GENERICS]: Should be TypeVariable<Method>[] */
- public TypeVariable[] getTypeParameters()
+ public TypeVariable<Method>[] getTypeParameters()
{
String sig = getSignature();
if (sig == null)
@@ -451,4 +450,3 @@ extends AccessibleObject implements Member, GenericDeclaration
return p.getGenericReturnType();
}
}
-
diff --git a/libjava/classpath/vm/reference/java/net/VMInetAddress.java b/libjava/classpath/vm/reference/java/net/VMInetAddress.java
index 19f5d7d341c..a99c216b96c 100644
--- a/libjava/classpath/vm/reference/java/net/VMInetAddress.java
+++ b/libjava/classpath/vm/reference/java/net/VMInetAddress.java
@@ -84,4 +84,14 @@ class VMInetAddress implements Serializable
*/
public static native byte[][] getHostByName(String hostname)
throws UnknownHostException;
+
+ /**
+ * Return the IP address represented by a literal address.
+ * Will return null if the literal address is not valid.
+ *
+ * @param address the name of the host
+ *
+ * @return The IP address as a byte array
+ */
+ public static native byte[] aton(String address);
}
diff --git a/libjava/classpath/vm/reference/java/net/VMNetworkInterface.java b/libjava/classpath/vm/reference/java/net/VMNetworkInterface.java
index 47f803246d5..7f1e3ad9890 100644
--- a/libjava/classpath/vm/reference/java/net/VMNetworkInterface.java
+++ b/libjava/classpath/vm/reference/java/net/VMNetworkInterface.java
@@ -40,6 +40,9 @@ package java.net;
import gnu.classpath.Configuration;
+import java.nio.ByteBuffer;
+import java.util.HashSet;
+import java.util.Set;
import java.util.Vector;
/**
@@ -54,22 +57,67 @@ import java.util.Vector;
*/
final class VMNetworkInterface
{
+ String name;
+ Set addresses;
+
+ VMNetworkInterface(String name)
+ {
+ this.name = name;
+ addresses = new HashSet();
+ }
+
+ /**
+ * Creates a dummy instance which represents any network
+ * interface.
+ */
+ public VMNetworkInterface()
+ {
+ addresses = new HashSet();
+ try
+ {
+ addresses.add(InetAddress.getByName("0.0.0.0"));
+ }
+ catch (UnknownHostException _)
+ {
+ // Cannot happen.
+ }
+ }
+
static
- {
- if (Configuration.INIT_LOAD_LIBRARY)
- System.loadLibrary("javanet");
- }
+ {
+ if (Configuration.INIT_LOAD_LIBRARY)
+ System.loadLibrary("javanet");
+
+ initIds();
+ }
+
+ private static native void initIds();
/**
- * Returns a Vector of InetAddresses. The returned value will be
- * 'condensed', meaning that all elements with the same interface
- * name will be collapesed into one InetAddress for that name
- * containing all addresses before the returning the result to the
- * user. This means the native method can be implemented in a naive
- * way mapping each address/interface to a name even if that means
- * that the Vector contains multiple InetAddresses with the same
- * interface name.
+ * Return a list of VM network interface objects.
+ *
+ * @return The list of network interfaces.
+ * @throws SocketException
*/
- public static native Vector getInterfaces()
+ public static native VMNetworkInterface[] getVMInterfaces()
throws SocketException;
+
+ private void addAddress(ByteBuffer addr)
+ throws SocketException, UnknownHostException
+ {
+ if (addr.remaining() == 4)
+ {
+ byte[] ipv4 = new byte[4];
+ addr.get(ipv4);
+ addresses.add(Inet4Address.getByAddress(ipv4));
+ }
+ else if (addr.remaining() == 16)
+ {
+ byte[] ipv6 = new byte[16];
+ addr.get(ipv6);
+ addresses.add(Inet6Address.getByAddress(ipv6));
+ }
+ else
+ throw new SocketException("invalid interface address");
+ }
}
diff --git a/libjava/classpath/vm/reference/java/nio/channels/VMChannels.java b/libjava/classpath/vm/reference/java/nio/channels/VMChannels.java
index e58d7fbf92c..c833b6eecfd 100644
--- a/libjava/classpath/vm/reference/java/nio/channels/VMChannels.java
+++ b/libjava/classpath/vm/reference/java/nio/channels/VMChannels.java
@@ -40,7 +40,7 @@ package java.nio.channels;
import gnu.java.nio.ChannelInputStream;
import gnu.java.nio.ChannelOutputStream;
-import gnu.java.nio.channels.FileChannelImpl;
+import gnu.java.nio.FileChannelImpl;
import java.io.FileInputStream;
import java.io.FileOutputStream;
diff --git a/libjava/classpath/vm/reference/sun/reflect/misc/ReflectUtil.java b/libjava/classpath/vm/reference/sun/reflect/misc/ReflectUtil.java
index aa89c50ac9b..88a6f2515bf 100644
--- a/libjava/classpath/vm/reference/sun/reflect/misc/ReflectUtil.java
+++ b/libjava/classpath/vm/reference/sun/reflect/misc/ReflectUtil.java
@@ -51,9 +51,29 @@ public class ReflectUtil
{
}
+ /**
+ * Check if the current thread is allowed to access the package of
+ * the declaringClass.
+ *
+ * @param declaringClass class name to check access to
+ * @throws SecurityException if permission is denied
+ * @throws NullPointerException if declaringClass is null
+ */
public static void checkPackageAccess(Class declaringClass)
{
- // FIXME: not sure what to check here.
+ SecurityManager sm;
+ if ((sm = System.getSecurityManager()) != null)
+ {
+ while (declaringClass.isArray())
+ declaringClass = declaringClass.getComponentType();
+ String name = declaringClass.getName();
+ int i = name.lastIndexOf('.');
+ if (i != -1) // if declaringClass is a member of a package
+ {
+ name = name.substring(0, i);
+ sm.checkPackageAccess(name);
+ }
+ }
}
/**
@@ -64,6 +84,7 @@ public class ReflectUtil
* @param declarer the declaring class of the member
* @param ignored unknown parameter; always null
* @param modifiers the modifiers on the member
+ * @return true if access is granted, false otherwise
*/
public static void ensureMemberAccess(Class caller,
Class declarer,